summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2022-05-11 09:23:58 -0400
committermattkae <mattkae@protonmail.com>2022-05-11 09:23:58 -0400
commit3f4a0d5370ae6c34afe180df96add3b8522f4af1 (patch)
treeae901409e02bde8ee278475f8cf6818f8f680a60
initial commit
-rw-r--r--.gitignore2
-rw-r--r--README.md2
-rw-r--r--elpa/ac-js2-20190101.933/ac-js2-autoloads.el70
-rw-r--r--elpa/ac-js2-20190101.933/ac-js2-pkg.el11
-rw-r--r--elpa/ac-js2-20190101.933/ac-js2-tests.el76
-rw-r--r--elpa/ac-js2-20190101.933/ac-js2-tests.elcbin0 -> 5403 bytes
-rw-r--r--elpa/ac-js2-20190101.933/ac-js2.el608
-rw-r--r--elpa/ac-js2-20190101.933/ac-js2.elcbin0 -> 21918 bytes
-rw-r--r--elpa/ac-js2-20190101.933/skewer-addon.js116
-rw-r--r--elpa/all-the-icons-20220325.1238/all-the-icons-autoloads.el75
-rw-r--r--elpa/all-the-icons-20220325.1238/all-the-icons-faces.el230
-rw-r--r--elpa/all-the-icons-20220325.1238/all-the-icons-faces.elcbin0 -> 6261 bytes
-rw-r--r--elpa/all-the-icons-20220325.1238/all-the-icons-pkg.el12
-rw-r--r--elpa/all-the-icons-20220325.1238/all-the-icons.el1189
-rw-r--r--elpa/all-the-icons-20220325.1238/all-the-icons.elcbin0 -> 71083 bytes
-rw-r--r--elpa/all-the-icons-20220325.1238/data/data-alltheicons.el70
-rw-r--r--elpa/all-the-icons-20220325.1238/data/data-alltheicons.elcbin0 -> 1734 bytes
-rw-r--r--elpa/all-the-icons-20220325.1238/data/data-faicons.el641
-rw-r--r--elpa/all-the-icons-20220325.1238/data/data-faicons.elcbin0 -> 14554 bytes
-rw-r--r--elpa/all-the-icons-20220325.1238/data/data-fileicons.el491
-rw-r--r--elpa/all-the-icons-20220325.1238/data/data-fileicons.elcbin0 -> 9642 bytes
-rw-r--r--elpa/all-the-icons-20220325.1238/data/data-material.el935
-rw-r--r--elpa/all-the-icons-20220325.1238/data/data-material.elcbin0 -> 23293 bytes
-rw-r--r--elpa/all-the-icons-20220325.1238/data/data-octicons.el165
-rw-r--r--elpa/all-the-icons-20220325.1238/data/data-octicons.elcbin0 -> 3902 bytes
-rw-r--r--elpa/all-the-icons-20220325.1238/data/data-weathericons.el594
-rw-r--r--elpa/all-the-icons-20220325.1238/data/data-weathericons.elcbin0 -> 14992 bytes
-rw-r--r--elpa/archives/gnu/archive-contents3501
-rw-r--r--elpa/archives/gnu/archive-contents.signed1
-rw-r--r--elpa/archives/melpa/archive-contents5184
-rw-r--r--elpa/archives/nongnu/archive-contents1643
-rw-r--r--elpa/archives/nongnu/archive-contents.signed1
-rw-r--r--elpa/bind-key-20210210.1609/bind-key-autoloads.el84
-rw-r--r--elpa/bind-key-20210210.1609/bind-key-pkg.el2
-rw-r--r--elpa/bind-key-20210210.1609/bind-key.el492
-rw-r--r--elpa/bind-key-20210210.1609/bind-key.elcbin0 -> 12131 bytes
-rw-r--r--elpa/company-20220326.48/company-abbrev.el52
-rw-r--r--elpa/company-20220326.48/company-abbrev.elcbin0 -> 1289 bytes
-rw-r--r--elpa/company-20220326.48/company-autoloads.el384
-rw-r--r--elpa/company-20220326.48/company-bbdb.el63
-rw-r--r--elpa/company-20220326.48/company-bbdb.elcbin0 -> 1798 bytes
-rw-r--r--elpa/company-20220326.48/company-capf.el225
-rw-r--r--elpa/company-20220326.48/company-capf.elcbin0 -> 5358 bytes
-rw-r--r--elpa/company-20220326.48/company-clang.el420
-rw-r--r--elpa/company-20220326.48/company-clang.elcbin0 -> 15697 bytes
-rw-r--r--elpa/company-20220326.48/company-cmake.el207
-rw-r--r--elpa/company-20220326.48/company-cmake.elcbin0 -> 6111 bytes
-rw-r--r--elpa/company-20220326.48/company-css.el446
-rw-r--r--elpa/company-20220326.48/company-css.elcbin0 -> 16988 bytes
-rw-r--r--elpa/company-20220326.48/company-dabbrev-code.el105
-rw-r--r--elpa/company-20220326.48/company-dabbrev-code.elcbin0 -> 3734 bytes
-rw-r--r--elpa/company-20220326.48/company-dabbrev.el207
-rw-r--r--elpa/company-20220326.48/company-dabbrev.elcbin0 -> 7099 bytes
-rw-r--r--elpa/company-20220326.48/company-elisp.el226
-rw-r--r--elpa/company-20220326.48/company-elisp.elcbin0 -> 6669 bytes
-rw-r--r--elpa/company-20220326.48/company-etags.el108
-rw-r--r--elpa/company-20220326.48/company-etags.elcbin0 -> 3148 bytes
-rw-r--r--elpa/company-20220326.48/company-files.el161
-rw-r--r--elpa/company-20220326.48/company-files.elcbin0 -> 4914 bytes
-rw-r--r--elpa/company-20220326.48/company-gtags.el161
-rw-r--r--elpa/company-20220326.48/company-gtags.elcbin0 -> 5275 bytes
-rw-r--r--elpa/company-20220326.48/company-ispell.el83
-rw-r--r--elpa/company-20220326.48/company-ispell.elcbin0 -> 2033 bytes
-rw-r--r--elpa/company-20220326.48/company-keywords.el354
-rw-r--r--elpa/company-20220326.48/company-keywords.elcbin0 -> 19999 bytes
-rw-r--r--elpa/company-20220326.48/company-nxml.el143
-rw-r--r--elpa/company-20220326.48/company-nxml.elcbin0 -> 4470 bytes
-rw-r--r--elpa/company-20220326.48/company-oddmuse.el57
-rw-r--r--elpa/company-20220326.48/company-oddmuse.elcbin0 -> 1569 bytes
-rw-r--r--elpa/company-20220326.48/company-pkg.el12
-rw-r--r--elpa/company-20220326.48/company-semantic.el168
-rw-r--r--elpa/company-20220326.48/company-semantic.elcbin0 -> 5208 bytes
-rw-r--r--elpa/company-20220326.48/company-template.el272
-rw-r--r--elpa/company-20220326.48/company-template.elcbin0 -> 8444 bytes
-rw-r--r--elpa/company-20220326.48/company-tempo.el71
-rw-r--r--elpa/company-20220326.48/company-tempo.elcbin0 -> 2255 bytes
-rw-r--r--elpa/company-20220326.48/company-tng.el196
-rw-r--r--elpa/company-20220326.48/company-tng.elcbin0 -> 4986 bytes
-rw-r--r--elpa/company-20220326.48/company-yasnippet.el184
-rw-r--r--elpa/company-20220326.48/company-yasnippet.elcbin0 -> 4333 bytes
-rw-r--r--elpa/company-20220326.48/company.el3917
-rw-r--r--elpa/company-20220326.48/company.elcbin0 -> 131133 bytes
-rw-r--r--elpa/company-20220326.48/company.info1695
-rw-r--r--elpa/company-20220326.48/dir18
-rw-r--r--elpa/company-20220326.48/icons/LICENSE395
-rw-r--r--elpa/company-20220326.48/icons/attribution.md5
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/folder.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/references.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-array.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-boolean.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-class.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-color.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-constant.svg4
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-enumerator-member.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-enumerator.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-event.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-field.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-file.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-interface.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-key.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-keyword.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-method.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-misc.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-namespace.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-numeric.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-operator.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-parameter.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-property.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-ruler.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-snippet.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-string.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-structure.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-dark/symbol-variable.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/folder.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/references.svg10
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-array.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-boolean.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-class.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-color.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-constant.svg4
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-enumerator-member.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-enumerator.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-event.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-field.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-file.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-interface.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-key.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-keyword.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-method.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-misc.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-namespace.svg10
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-numeric.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-operator.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-parameter.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-property.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-ruler.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-snippet.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-string.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-structure.svg3
-rw-r--r--elpa/company-20220326.48/icons/vscode-light/symbol-variable.svg3
-rwxr-xr-xelpa/company-20220326.48/images/small/echo-meta.pngbin0 -> 43396 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/echo-qa.pngbin0 -> 18377 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/echo-strip-qa.pngbin0 -> 21063 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/echo-strip.pngbin0 -> 15339 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/echo.pngbin0 -> 16360 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/preview-dark.pngbin0 -> 5168 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/preview-light.pngbin0 -> 5559 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-annotations.pngbin0 -> 29532 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-faces-light.pngbin0 -> 14633 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-filter.pngbin0 -> 29646 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-flip.pngbin0 -> 33501 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-icon-bg.pngbin0 -> 25540 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-icon-face.pngbin0 -> 28233 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-icons-dot.pngbin0 -> 45177 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-icons-text.pngbin0 -> 41525 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-icons-vscode.pngbin0 -> 47354 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-limit.pngbin0 -> 21246 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-margin.pngbin0 -> 29931 bytes
-rw-r--r--elpa/company-20220326.48/images/small/tooltip-minimum-above.pngbin0 -> 42117 bytes
-rw-r--r--elpa/company-20220326.48/images/small/tooltip-minimum-below.pngbin0 -> 22238 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-offset-display.pngbin0 -> 28312 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-qa-faces-light.pngbin0 -> 27127 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-quick-access.pngbin0 -> 19467 bytes
-rwxr-xr-xelpa/company-20220326.48/images/small/tooltip-search.pngbin0 -> 45384 bytes
-rw-r--r--elpa/company-irony-20190124.2346/company-irony-autoloads.el36
-rw-r--r--elpa/company-irony-20190124.2346/company-irony-pkg.el2
-rw-r--r--elpa/company-irony-20190124.2346/company-irony.el158
-rw-r--r--elpa/company-irony-20190124.2346/company-irony.elcbin0 -> 4225 bytes
-rw-r--r--elpa/dash-20210826.1149/dash-autoloads.el74
-rw-r--r--elpa/dash-20210826.1149/dash-pkg.el12
-rw-r--r--elpa/dash-20210826.1149/dash.el3531
-rw-r--r--elpa/dash-20210826.1149/dash.elcbin0 -> 138391 bytes
-rw-r--r--elpa/dash-20210826.1149/dash.info4738
-rw-r--r--elpa/dash-20210826.1149/dir18
-rw-r--r--elpa/epl-20180205.2049/epl-autoloads.el22
-rw-r--r--elpa/epl-20180205.2049/epl-pkg.el2
-rw-r--r--elpa/epl-20180205.2049/epl.el712
-rw-r--r--elpa/epl-20180205.2049/epl.elcbin0 -> 32521 bytes
-rw-r--r--elpa/flycheck-20220314.27/flycheck-autoloads.el306
-rw-r--r--elpa/flycheck-20220314.27/flycheck-buttercup.el157
-rw-r--r--elpa/flycheck-20220314.27/flycheck-ert.el507
-rw-r--r--elpa/flycheck-20220314.27/flycheck-ert.elcbin0 -> 24846 bytes
-rw-r--r--elpa/flycheck-20220314.27/flycheck-pkg.el16
-rw-r--r--elpa/flycheck-20220314.27/flycheck.el12465
-rw-r--r--elpa/flycheck-20220314.27/flycheck.elcbin0 -> 553689 bytes
-rw-r--r--elpa/flycheck-irony-20180604.2152/flycheck-irony-autoloads.el28
-rw-r--r--elpa/flycheck-irony-20180604.2152/flycheck-irony-pkg.el2
-rw-r--r--elpa/flycheck-irony-20180604.2152/flycheck-irony.el121
-rw-r--r--elpa/flycheck-irony-20180604.2152/flycheck-irony.elcbin0 -> 3165 bytes
-rw-r--r--elpa/gnupg/pubring.kbxbin0 -> 2413 bytes
-rw-r--r--elpa/gnupg/trustdb.gpgbin0 -> 1200 bytes
-rw-r--r--elpa/ht-20210119.741/ht-autoloads.el22
-rw-r--r--elpa/ht-20210119.741/ht-pkg.el2
-rw-r--r--elpa/ht-20210119.741/ht.el337
-rw-r--r--elpa/ht-20210119.741/ht.elcbin0 -> 13905 bytes
-rw-r--r--elpa/irony-20220110.849/.dir-locals.el10
-rw-r--r--elpa/irony-20220110.849/irony-autoloads.el169
-rw-r--r--elpa/irony-20220110.849/irony-cdb-clang-complete.el79
-rw-r--r--elpa/irony-20220110.849/irony-cdb-clang-complete.elcbin0 -> 1655 bytes
-rw-r--r--elpa/irony-20220110.849/irony-cdb-json.el336
-rw-r--r--elpa/irony-20220110.849/irony-cdb-json.elcbin0 -> 10353 bytes
-rw-r--r--elpa/irony-20220110.849/irony-cdb-libclang.el73
-rw-r--r--elpa/irony-20220110.849/irony-cdb-libclang.elcbin0 -> 1744 bytes
-rw-r--r--elpa/irony-20220110.849/irony-cdb.el218
-rw-r--r--elpa/irony-20220110.849/irony-cdb.elcbin0 -> 6228 bytes
-rw-r--r--elpa/irony-20220110.849/irony-completion.el426
-rw-r--r--elpa/irony-20220110.849/irony-completion.elcbin0 -> 10814 bytes
-rw-r--r--elpa/irony-20220110.849/irony-diagnostics.el90
-rw-r--r--elpa/irony-20220110.849/irony-diagnostics.elcbin0 -> 2215 bytes
-rw-r--r--elpa/irony-20220110.849/irony-iotask.el441
-rw-r--r--elpa/irony-20220110.849/irony-iotask.elcbin0 -> 33819 bytes
-rw-r--r--elpa/irony-20220110.849/irony-pkg.el13
-rw-r--r--elpa/irony-20220110.849/irony-snippet.el135
-rw-r--r--elpa/irony-20220110.849/irony-snippet.elcbin0 -> 2997 bytes
-rw-r--r--elpa/irony-20220110.849/irony.el917
-rw-r--r--elpa/irony-20220110.849/irony.elcbin0 -> 31843 bytes
-rw-r--r--elpa/irony-20220110.849/server/.clang-format8
-rw-r--r--elpa/irony-20220110.849/server/.clang-tidy24
-rw-r--r--elpa/irony-20220110.849/server/CMakeLists.txt33
-rw-r--r--elpa/irony-20220110.849/server/build-aux/run-clang-tidy/LICENSE.TXT43
-rw-r--r--elpa/irony-20220110.849/server/build-aux/run-clang-tidy/README12
-rwxr-xr-xelpa/irony-20220110.849/server/build-aux/run-clang-tidy/run-clang-tidy.py236
-rw-r--r--elpa/irony-20220110.849/server/cmake/CheckClangResourceDir.cmake90
-rw-r--r--elpa/irony-20220110.849/server/cmake/LibClangDiagnosticsChecker.cpp47
-rw-r--r--elpa/irony-20220110.849/server/cmake/modules/FindLibClang.cmake106
-rw-r--r--elpa/irony-20220110.849/server/src/CMakeLists.txt111
-rw-r--r--elpa/irony-20220110.849/server/src/Command.cpp278
-rw-r--r--elpa/irony-20220110.849/server/src/Command.h73
-rw-r--r--elpa/irony-20220110.849/server/src/Commands.def39
-rw-r--r--elpa/irony-20220110.849/server/src/CompDBCache.cpp71
-rw-r--r--elpa/irony-20220110.849/server/src/CompDBCache.h86
-rw-r--r--elpa/irony-20220110.849/server/src/Irony.cpp638
-rw-r--r--elpa/irony-20220110.849/server/src/Irony.h147
-rw-r--r--elpa/irony-20220110.849/server/src/Style.h17
-rw-r--r--elpa/irony-20220110.849/server/src/TUManager.cpp182
-rw-r--r--elpa/irony-20220110.849/server/src/TUManager.h109
-rw-r--r--elpa/irony-20220110.849/server/src/main.cpp235
-rw-r--r--elpa/irony-20220110.849/server/src/support/CIndex.h33
-rw-r--r--elpa/irony-20220110.849/server/src/support/CommandLineParser.cpp119
-rw-r--r--elpa/irony-20220110.849/server/src/support/CommandLineParser.h21
-rw-r--r--elpa/irony-20220110.849/server/src/support/NonCopyable.h34
-rw-r--r--elpa/irony-20220110.849/server/src/support/TemporaryFile.cpp74
-rw-r--r--elpa/irony-20220110.849/server/src/support/TemporaryFile.h36
-rw-r--r--elpa/irony-20220110.849/server/src/support/iomanip_quoted.h52
-rw-r--r--elpa/irony-20220110.849/server/test/CMakeLists.txt3
-rw-r--r--elpa/irony-20220110.849/server/test/elisp/CMakeLists.txt47
-rw-r--r--elpa/irony-20220110.849/server/test/elisp/irony-cdb-json.el87
-rw-r--r--elpa/irony-20220110.849/server/test/elisp/irony-iotask.el249
-rw-r--r--elpa/irony-20220110.849/server/test/elisp/irony.el121
-rw-r--r--elpa/irony-20220110.849/server/test/elisp/test-config.el14
-rw-r--r--elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars-autoloads.el44
-rw-r--r--elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars-pkg.el2
-rw-r--r--elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars.el210
-rw-r--r--elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars.elcbin0 -> 7623 bytes
-rw-r--r--elpa/js2-mode-20220402.2211/js2-imenu-extras.el518
-rw-r--r--elpa/js2-mode-20220402.2211/js2-imenu-extras.elcbin0 -> 21305 bytes
-rw-r--r--elpa/js2-mode-20220402.2211/js2-mode-autoloads.el126
-rw-r--r--elpa/js2-mode-20220402.2211/js2-mode-pkg.el15
-rw-r--r--elpa/js2-mode-20220402.2211/js2-mode.el13090
-rw-r--r--elpa/js2-mode-20220402.2211/js2-mode.elcbin0 -> 1220333 bytes
-rw-r--r--elpa/js2-mode-20220402.2211/js2-old-indent.el712
-rw-r--r--elpa/js2-mode-20220402.2211/js2-old-indent.elcbin0 -> 15397 bytes
-rw-r--r--elpa/js2-refactor-20210306.2003/js2-refactor-autoloads.el131
-rw-r--r--elpa/js2-refactor-20210306.2003/js2-refactor-pkg.el17
-rw-r--r--elpa/js2-refactor-20210306.2003/js2-refactor.el248
-rw-r--r--elpa/js2-refactor-20210306.2003/js2-refactor.elcbin0 -> 6594 bytes
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-conditionals.el57
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-conditionals.elcbin0 -> 1101 bytes
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-conveniences.el242
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-conveniences.elcbin0 -> 6927 bytes
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-formatting.el251
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-formatting.elcbin0 -> 9109 bytes
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-functions.el537
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-functions.elcbin0 -> 20598 bytes
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-helpers.el221
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-helpers.elcbin0 -> 8930 bytes
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-iife.el174
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-iife.elcbin0 -> 5336 bytes
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-paredit.el227
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-paredit.elcbin0 -> 6044 bytes
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-vars.el376
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-vars.elcbin0 -> 11338 bytes
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-wrapping.el76
-rw-r--r--elpa/js2-refactor-20210306.2003/js2r-wrapping.elcbin0 -> 1286 bytes
-rw-r--r--elpa/log4e-20211019.948/log4e-autoloads.el33
-rw-r--r--elpa/log4e-20211019.948/log4e-pkg.el2
-rw-r--r--elpa/log4e-20211019.948/log4e.el592
-rw-r--r--elpa/log4e-20211019.948/log4e.elcbin0 -> 21292 bytes
-rw-r--r--elpa/multiple-cursors-20220328.1724/mc-cycle-cursors.el123
-rw-r--r--elpa/multiple-cursors-20220328.1724/mc-cycle-cursors.elcbin0 -> 3079 bytes
-rw-r--r--elpa/multiple-cursors-20220328.1724/mc-edit-lines.el110
-rw-r--r--elpa/multiple-cursors-20220328.1724/mc-edit-lines.elcbin0 -> 2425 bytes
-rw-r--r--elpa/multiple-cursors-20220328.1724/mc-hide-unmatched-lines-mode.el109
-rw-r--r--elpa/multiple-cursors-20220328.1724/mc-hide-unmatched-lines-mode.elcbin0 -> 4795 bytes
-rw-r--r--elpa/multiple-cursors-20220328.1724/mc-mark-more.el737
-rw-r--r--elpa/multiple-cursors-20220328.1724/mc-mark-more.elcbin0 -> 23159 bytes
-rw-r--r--elpa/multiple-cursors-20220328.1724/mc-mark-pop.el22
-rw-r--r--elpa/multiple-cursors-20220328.1724/mc-mark-pop.elcbin0 -> 449 bytes
-rw-r--r--elpa/multiple-cursors-20220328.1724/mc-separate-operations.el151
-rw-r--r--elpa/multiple-cursors-20220328.1724/mc-separate-operations.elcbin0 -> 4529 bytes
-rw-r--r--elpa/multiple-cursors-20220328.1724/multiple-cursors-autoloads.el388
-rw-r--r--elpa/multiple-cursors-20220328.1724/multiple-cursors-core.el879
-rw-r--r--elpa/multiple-cursors-20220328.1724/multiple-cursors-core.elcbin0 -> 31361 bytes
-rw-r--r--elpa/multiple-cursors-20220328.1724/multiple-cursors-pkg.el12
-rw-r--r--elpa/multiple-cursors-20220328.1724/multiple-cursors.el202
-rw-r--r--elpa/multiple-cursors-20220328.1724/multiple-cursors.elcbin0 -> 394 bytes
-rw-r--r--elpa/multiple-cursors-20220328.1724/rectangular-region-mode.el128
-rw-r--r--elpa/multiple-cursors-20220328.1724/rectangular-region-mode.elcbin0 -> 5307 bytes
-rw-r--r--elpa/org-9.5.2.signed1
-rw-r--r--elpa/org-9.5.2/.dir-locals.el22
-rw-r--r--elpa/org-9.5.2/CONTRIBUTE71
-rw-r--r--elpa/org-9.5.2/COPYING674
-rw-r--r--elpa/org-9.5.2/Makefile93
-rw-r--r--elpa/org-9.5.2/README66
-rw-r--r--elpa/org-9.5.2/README_ELPA38
-rw-r--r--elpa/org-9.5.2/dir19
-rw-r--r--elpa/org-9.5.2/doc/.aspell.org.conf81
-rw-r--r--elpa/org-9.5.2/doc/.nosearch1
-rw-r--r--elpa/org-9.5.2/doc/Documentation_Standards.org171
-rw-r--r--elpa/org-9.5.2/doc/Makefile102
-rw-r--r--elpa/org-9.5.2/doc/dir19
-rw-r--r--elpa/org-9.5.2/doc/doc-setup.org53
-rw-r--r--elpa/org-9.5.2/doc/fdl.org490
-rw-r--r--elpa/org-9.5.2/doc/htmlxref.cnf2
-rw-r--r--elpa/org-9.5.2/doc/org-guide.org2654
-rw-r--r--elpa/org-9.5.2/doc/org-manual.org22234
-rw-r--r--elpa/org-9.5.2/doc/org-version.inc3
-rw-r--r--elpa/org-9.5.2/doc/org.texi23491
-rw-r--r--elpa/org-9.5.2/doc/orgcard.tex691
-rw-r--r--elpa/org-9.5.2/doc/orgguide.texi2688
-rw-r--r--elpa/org-9.5.2/doc/pdflayout.sty44
-rw-r--r--elpa/org-9.5.2/doc/texinfo.tex10145
-rw-r--r--elpa/org-9.5.2/etc/Makefile31
-rw-r--r--elpa/org-9.5.2/etc/ORG-NEWS6327
-rw-r--r--elpa/org-9.5.2/etc/csl/README10
-rw-r--r--elpa/org-9.5.2/etc/csl/chicago-author-date.csl658
-rw-r--r--elpa/org-9.5.2/etc/csl/locales-en-US.xml357
-rw-r--r--elpa/org-9.5.2/etc/styles/OrgOdtContentTemplate.xml275
-rw-r--r--elpa/org-9.5.2/etc/styles/OrgOdtStyles.xml861
-rw-r--r--elpa/org-9.5.2/etc/styles/README36
-rw-r--r--elpa/org-9.5.2/local.mk52
-rw-r--r--elpa/org-9.5.2/ob-C.el505
-rw-r--r--elpa/org-9.5.2/ob-C.elcbin0 -> 15265 bytes
-rw-r--r--elpa/org-9.5.2/ob-R.el570
-rw-r--r--elpa/org-9.5.2/ob-R.elcbin0 -> 19213 bytes
-rw-r--r--elpa/org-9.5.2/ob-awk.el110
-rw-r--r--elpa/org-9.5.2/ob-awk.elcbin0 -> 3156 bytes
-rw-r--r--elpa/org-9.5.2/ob-calc.el109
-rw-r--r--elpa/org-9.5.2/ob-calc.elcbin0 -> 2396 bytes
-rw-r--r--elpa/org-9.5.2/ob-clojure.el254
-rw-r--r--elpa/org-9.5.2/ob-clojure.elcbin0 -> 8037 bytes
-rw-r--r--elpa/org-9.5.2/ob-comint.el312
-rw-r--r--elpa/org-9.5.2/ob-comint.elcbin0 -> 10777 bytes
-rw-r--r--elpa/org-9.5.2/ob-core.el3269
-rw-r--r--elpa/org-9.5.2/ob-core.elcbin0 -> 104908 bytes
-rw-r--r--elpa/org-9.5.2/ob-css.el46
-rw-r--r--elpa/org-9.5.2/ob-css.elcbin0 -> 888 bytes
-rw-r--r--elpa/org-9.5.2/ob-ditaa.el122
-rw-r--r--elpa/org-9.5.2/ob-ditaa.elcbin0 -> 3094 bytes
-rw-r--r--elpa/org-9.5.2/ob-dot.el91
-rw-r--r--elpa/org-9.5.2/ob-dot.elcbin0 -> 2118 bytes
-rw-r--r--elpa/org-9.5.2/ob-emacs-lisp.el110
-rw-r--r--elpa/org-9.5.2/ob-emacs-lisp.elcbin0 -> 3134 bytes
-rw-r--r--elpa/org-9.5.2/ob-eshell.el110
-rw-r--r--elpa/org-9.5.2/ob-eshell.elcbin0 -> 3123 bytes
-rw-r--r--elpa/org-9.5.2/ob-eval.el160
-rw-r--r--elpa/org-9.5.2/ob-eval.elcbin0 -> 4171 bytes
-rw-r--r--elpa/org-9.5.2/ob-exp.el418
-rw-r--r--elpa/org-9.5.2/ob-exp.elcbin0 -> 11184 bytes
-rw-r--r--elpa/org-9.5.2/ob-forth.el88
-rw-r--r--elpa/org-9.5.2/ob-forth.elcbin0 -> 2030 bytes
-rw-r--r--elpa/org-9.5.2/ob-fortran.el170
-rw-r--r--elpa/org-9.5.2/ob-fortran.elcbin0 -> 5515 bytes
-rw-r--r--elpa/org-9.5.2/ob-gnuplot.el299
-rw-r--r--elpa/org-9.5.2/ob-gnuplot.elcbin0 -> 8938 bytes
-rw-r--r--elpa/org-9.5.2/ob-groovy.el113
-rw-r--r--elpa/org-9.5.2/ob-groovy.elcbin0 -> 3765 bytes
-rw-r--r--elpa/org-9.5.2/ob-haskell.el281
-rw-r--r--elpa/org-9.5.2/ob-haskell.elcbin0 -> 10810 bytes
-rw-r--r--elpa/org-9.5.2/ob-java.el490
-rw-r--r--elpa/org-9.5.2/ob-java.elcbin0 -> 15758 bytes
-rw-r--r--elpa/org-9.5.2/ob-js.el204
-rw-r--r--elpa/org-9.5.2/ob-js.elcbin0 -> 6822 bytes
-rw-r--r--elpa/org-9.5.2/ob-julia.el333
-rw-r--r--elpa/org-9.5.2/ob-julia.elcbin0 -> 11595 bytes
-rw-r--r--elpa/org-9.5.2/ob-latex.el283
-rw-r--r--elpa/org-9.5.2/ob-latex.elcbin0 -> 8138 bytes
-rw-r--r--elpa/org-9.5.2/ob-lilypond.el428
-rw-r--r--elpa/org-9.5.2/ob-lilypond.elcbin0 -> 14755 bytes
-rw-r--r--elpa/org-9.5.2/ob-lisp.el125
-rw-r--r--elpa/org-9.5.2/ob-lisp.elcbin0 -> 3708 bytes
-rw-r--r--elpa/org-9.5.2/ob-lob.el164
-rw-r--r--elpa/org-9.5.2/ob-lob.elcbin0 -> 5087 bytes
-rw-r--r--elpa/org-9.5.2/ob-lua.el403
-rw-r--r--elpa/org-9.5.2/ob-lua.elcbin0 -> 13257 bytes
-rw-r--r--elpa/org-9.5.2/ob-makefile.el45
-rw-r--r--elpa/org-9.5.2/ob-makefile.elcbin0 -> 876 bytes
-rw-r--r--elpa/org-9.5.2/ob-matlab.el45
-rw-r--r--elpa/org-9.5.2/ob-matlab.elcbin0 -> 500 bytes
-rw-r--r--elpa/org-9.5.2/ob-maxima.el128
-rw-r--r--elpa/org-9.5.2/ob-maxima.elcbin0 -> 3817 bytes
-rw-r--r--elpa/org-9.5.2/ob-ocaml.el169
-rw-r--r--elpa/org-9.5.2/ob-ocaml.elcbin0 -> 5726 bytes
-rw-r--r--elpa/org-9.5.2/ob-octave.el264
-rw-r--r--elpa/org-9.5.2/ob-octave.elcbin0 -> 9916 bytes
-rw-r--r--elpa/org-9.5.2/ob-org.el70
-rw-r--r--elpa/org-9.5.2/ob-org.elcbin0 -> 1710 bytes
-rw-r--r--elpa/org-9.5.2/ob-perl.el156
-rw-r--r--elpa/org-9.5.2/ob-perl.elcbin0 -> 4648 bytes
-rw-r--r--elpa/org-9.5.2/ob-plantuml.el165
-rw-r--r--elpa/org-9.5.2/ob-plantuml.elcbin0 -> 5299 bytes
-rw-r--r--elpa/org-9.5.2/ob-processing.el195
-rw-r--r--elpa/org-9.5.2/ob-processing.elcbin0 -> 4685 bytes
-rw-r--r--elpa/org-9.5.2/ob-python.el444
-rw-r--r--elpa/org-9.5.2/ob-python.elcbin0 -> 15845 bytes
-rw-r--r--elpa/org-9.5.2/ob-ref.el246
-rw-r--r--elpa/org-9.5.2/ob-ref.elcbin0 -> 6028 bytes
-rw-r--r--elpa/org-9.5.2/ob-ruby.el279
-rw-r--r--elpa/org-9.5.2/ob-ruby.elcbin0 -> 10061 bytes
-rw-r--r--elpa/org-9.5.2/ob-sass.el68
-rw-r--r--elpa/org-9.5.2/ob-sass.elcbin0 -> 1537 bytes
-rw-r--r--elpa/org-9.5.2/ob-scheme.el241
-rw-r--r--elpa/org-9.5.2/ob-scheme.elcbin0 -> 6714 bytes
-rw-r--r--elpa/org-9.5.2/ob-screen.el143
-rw-r--r--elpa/org-9.5.2/ob-screen.elcbin0 -> 4415 bytes
-rw-r--r--elpa/org-9.5.2/ob-sed.el106
-rw-r--r--elpa/org-9.5.2/ob-sed.elcbin0 -> 2762 bytes
-rw-r--r--elpa/org-9.5.2/ob-shell.el309
-rw-r--r--elpa/org-9.5.2/ob-shell.elcbin0 -> 11876 bytes
-rw-r--r--elpa/org-9.5.2/ob-sql.el421
-rw-r--r--elpa/org-9.5.2/ob-sql.elcbin0 -> 11587 bytes
-rw-r--r--elpa/org-9.5.2/ob-sqlite.el148
-rw-r--r--elpa/org-9.5.2/ob-sqlite.elcbin0 -> 4344 bytes
-rw-r--r--elpa/org-9.5.2/ob-table.el152
-rw-r--r--elpa/org-9.5.2/ob-table.elcbin0 -> 3426 bytes
-rw-r--r--elpa/org-9.5.2/ob-tangle.el616
-rw-r--r--elpa/org-9.5.2/ob-tangle.elcbin0 -> 18738 bytes
-rw-r--r--elpa/org-9.5.2/ob.el43
-rw-r--r--elpa/org-9.5.2/ob.elcbin0 -> 692 bytes
-rw-r--r--elpa/org-9.5.2/oc-basic.el789
-rw-r--r--elpa/org-9.5.2/oc-basic.elcbin0 -> 22076 bytes
-rw-r--r--elpa/org-9.5.2/oc-biblatex.el318
-rw-r--r--elpa/org-9.5.2/oc-biblatex.elcbin0 -> 8508 bytes
-rw-r--r--elpa/org-9.5.2/oc-csl.el631
-rw-r--r--elpa/org-9.5.2/oc-csl.elcbin0 -> 16308 bytes
-rw-r--r--elpa/org-9.5.2/oc-natbib.el193
-rw-r--r--elpa/org-9.5.2/oc-natbib.elcbin0 -> 6413 bytes
-rw-r--r--elpa/org-9.5.2/oc.el1650
-rw-r--r--elpa/org-9.5.2/oc.elcbin0 -> 63667 bytes
-rw-r--r--elpa/org-9.5.2/ol-bbdb.el546
-rw-r--r--elpa/org-9.5.2/ol-bbdb.elcbin0 -> 12623 bytes
-rw-r--r--elpa/org-9.5.2/ol-bibtex.el770
-rw-r--r--elpa/org-9.5.2/ol-bibtex.elcbin0 -> 26407 bytes
-rw-r--r--elpa/org-9.5.2/ol-docview.el103
-rw-r--r--elpa/org-9.5.2/ol-docview.elcbin0 -> 2099 bytes
-rw-r--r--elpa/org-9.5.2/ol-doi.el72
-rw-r--r--elpa/org-9.5.2/ol-doi.elcbin0 -> 1921 bytes
-rw-r--r--elpa/org-9.5.2/ol-eshell.el68
-rw-r--r--elpa/org-9.5.2/ol-eshell.elcbin0 -> 1533 bytes
-rw-r--r--elpa/org-9.5.2/ol-eww.el181
-rw-r--r--elpa/org-9.5.2/ol-eww.elcbin0 -> 3343 bytes
-rw-r--r--elpa/org-9.5.2/ol-gnus.el272
-rw-r--r--elpa/org-9.5.2/ol-gnus.elcbin0 -> 8338 bytes
-rw-r--r--elpa/org-9.5.2/ol-info.el148
-rw-r--r--elpa/org-9.5.2/ol-info.elcbin0 -> 4357 bytes
-rw-r--r--elpa/org-9.5.2/ol-irc.el269
-rw-r--r--elpa/org-9.5.2/ol-irc.elcbin0 -> 6010 bytes
-rw-r--r--elpa/org-9.5.2/ol-man.el86
-rw-r--r--elpa/org-9.5.2/ol-man.elcbin0 -> 2381 bytes
-rw-r--r--elpa/org-9.5.2/ol-mhe.el219
-rw-r--r--elpa/org-9.5.2/ol-mhe.elcbin0 -> 5447 bytes
-rw-r--r--elpa/org-9.5.2/ol-rmail.el117
-rw-r--r--elpa/org-9.5.2/ol-rmail.elcbin0 -> 2672 bytes
-rw-r--r--elpa/org-9.5.2/ol-w3m.el221
-rw-r--r--elpa/org-9.5.2/ol-w3m.elcbin0 -> 4379 bytes
-rw-r--r--elpa/org-9.5.2/ol.el2042
-rw-r--r--elpa/org-9.5.2/ol.elcbin0 -> 59986 bytes
-rw-r--r--elpa/org-9.5.2/org-agenda.el10892
-rw-r--r--elpa/org-9.5.2/org-agenda.elcbin0 -> 390040 bytes
-rw-r--r--elpa/org-9.5.2/org-archive.el639
-rw-r--r--elpa/org-9.5.2/org-archive.elcbin0 -> 18853 bytes
-rw-r--r--elpa/org-9.5.2/org-attach-git.el142
-rw-r--r--elpa/org-9.5.2/org-attach-git.elcbin0 -> 4817 bytes
-rw-r--r--elpa/org-9.5.2/org-attach.el787
-rw-r--r--elpa/org-9.5.2/org-attach.elcbin0 -> 27138 bytes
-rw-r--r--elpa/org-9.5.2/org-autoloads.el1528
-rw-r--r--elpa/org-9.5.2/org-capture.el1965
-rw-r--r--elpa/org-9.5.2/org-capture.elcbin0 -> 62582 bytes
-rw-r--r--elpa/org-9.5.2/org-clock.el3149
-rw-r--r--elpa/org-9.5.2/org-clock.elcbin0 -> 96631 bytes
-rw-r--r--elpa/org-9.5.2/org-colview.el1738
-rw-r--r--elpa/org-9.5.2/org-colview.elcbin0 -> 57144 bytes
-rw-r--r--elpa/org-9.5.2/org-compat.el1256
-rw-r--r--elpa/org-9.5.2/org-compat.elcbin0 -> 47300 bytes
-rw-r--r--elpa/org-9.5.2/org-crypt.el320
-rw-r--r--elpa/org-9.5.2/org-crypt.elcbin0 -> 7397 bytes
-rw-r--r--elpa/org-9.5.2/org-ctags.el534
-rw-r--r--elpa/org-9.5.2/org-ctags.elcbin0 -> 12106 bytes
-rw-r--r--elpa/org-9.5.2/org-datetree.el270
-rw-r--r--elpa/org-9.5.2/org-datetree.elcbin0 -> 8441 bytes
-rw-r--r--elpa/org-9.5.2/org-duration.el460
-rw-r--r--elpa/org-9.5.2/org-duration.elcbin0 -> 12170 bytes
-rw-r--r--elpa/org-9.5.2/org-element.el6265
-rw-r--r--elpa/org-9.5.2/org-element.elcbin0 -> 181342 bytes
-rw-r--r--elpa/org-9.5.2/org-entities.el602
-rw-r--r--elpa/org-9.5.2/org-entities.elcbin0 -> 27463 bytes
-rw-r--r--elpa/org-9.5.2/org-faces.el730
-rw-r--r--elpa/org-9.5.2/org-faces.elcbin0 -> 27029 bytes
-rw-r--r--elpa/org-9.5.2/org-feed.el719
-rw-r--r--elpa/org-9.5.2/org-feed.elcbin0 -> 19722 bytes
-rw-r--r--elpa/org-9.5.2/org-footnote.el1023
-rw-r--r--elpa/org-9.5.2/org-footnote.elcbin0 -> 29286 bytes
-rw-r--r--elpa/org-9.5.2/org-goto.el291
-rw-r--r--elpa/org-9.5.2/org-goto.elcbin0 -> 9290 bytes
-rw-r--r--elpa/org-9.5.2/org-habit.el476
-rw-r--r--elpa/org-9.5.2/org-habit.elcbin0 -> 13997 bytes
-rw-r--r--elpa/org-9.5.2/org-id.el755
-rw-r--r--elpa/org-9.5.2/org-id.elcbin0 -> 23067 bytes
-rw-r--r--elpa/org-9.5.2/org-indent.el428
-rw-r--r--elpa/org-9.5.2/org-indent.elcbin0 -> 15433 bytes
-rw-r--r--elpa/org-9.5.2/org-inlinetask.el354
-rw-r--r--elpa/org-9.5.2/org-inlinetask.elcbin0 -> 9059 bytes
-rw-r--r--elpa/org-9.5.2/org-keys.el931
-rw-r--r--elpa/org-9.5.2/org-keys.elcbin0 -> 26711 bytes
-rw-r--r--elpa/org-9.5.2/org-lint.el1321
-rw-r--r--elpa/org-9.5.2/org-lint.elcbin0 -> 54329 bytes
-rw-r--r--elpa/org-9.5.2/org-list.el3582
-rw-r--r--elpa/org-9.5.2/org-list.elcbin0 -> 94474 bytes
-rw-r--r--elpa/org-9.5.2/org-loaddefs.el4612
-rw-r--r--elpa/org-9.5.2/org-macro.el421
-rw-r--r--elpa/org-9.5.2/org-macro.elcbin0 -> 11487 bytes
-rw-r--r--elpa/org-9.5.2/org-macs.el1308
-rw-r--r--elpa/org-9.5.2/org-macs.elcbin0 -> 43850 bytes
-rw-r--r--elpa/org-9.5.2/org-mobile.el1141
-rw-r--r--elpa/org-9.5.2/org-mobile.elcbin0 -> 37327 bytes
-rw-r--r--elpa/org-9.5.2/org-mouse.el1100
-rw-r--r--elpa/org-9.5.2/org-mouse.elcbin0 -> 32769 bytes
-rw-r--r--elpa/org-9.5.2/org-num.el476
-rw-r--r--elpa/org-9.5.2/org-num.elcbin0 -> 13218 bytes
-rw-r--r--elpa/org-9.5.2/org-pcomplete.el451
-rw-r--r--elpa/org-9.5.2/org-pcomplete.elcbin0 -> 13142 bytes
-rw-r--r--elpa/org-9.5.2/org-pkg.el2
-rw-r--r--elpa/org-9.5.2/org-plot.el730
-rw-r--r--elpa/org-9.5.2/org-plot.elcbin0 -> 22403 bytes
-rw-r--r--elpa/org-9.5.2/org-protocol.el777
-rw-r--r--elpa/org-9.5.2/org-protocol.elcbin0 -> 22016 bytes
-rw-r--r--elpa/org-9.5.2/org-refile.el752
-rw-r--r--elpa/org-9.5.2/org-refile.elcbin0 -> 23662 bytes
-rw-r--r--elpa/org-9.5.2/org-src.el1311
-rw-r--r--elpa/org-9.5.2/org-src.elcbin0 -> 42376 bytes
-rw-r--r--elpa/org-9.5.2/org-table.el6340
-rw-r--r--elpa/org-9.5.2/org-table.elcbin0 -> 207949 bytes
-rw-r--r--elpa/org-9.5.2/org-tempo.el188
-rw-r--r--elpa/org-9.5.2/org-tempo.elcbin0 -> 5027 bytes
-rw-r--r--elpa/org-9.5.2/org-timer.el494
-rw-r--r--elpa/org-9.5.2/org-timer.elcbin0 -> 14454 bytes
-rw-r--r--elpa/org-9.5.2/org-version.el24
-rw-r--r--elpa/org-9.5.2/org.el21484
-rw-r--r--elpa/org-9.5.2/org.elcbin0 -> 719476 bytes
-rw-r--r--elpa/org-9.5.2/org.info23626
-rw-r--r--elpa/org-9.5.2/orgguide.info2642
-rw-r--r--elpa/org-9.5.2/ox-ascii.el2205
-rw-r--r--elpa/org-9.5.2/ox-ascii.elcbin0 -> 67981 bytes
-rw-r--r--elpa/org-9.5.2/ox-beamer.el1158
-rw-r--r--elpa/org-9.5.2/ox-beamer.elcbin0 -> 35390 bytes
-rw-r--r--elpa/org-9.5.2/ox-html.el3895
-rw-r--r--elpa/org-9.5.2/ox-html.elcbin0 -> 132996 bytes
-rw-r--r--elpa/org-9.5.2/ox-icalendar.el1031
-rw-r--r--elpa/org-9.5.2/ox-icalendar.elcbin0 -> 34342 bytes
-rw-r--r--elpa/org-9.5.2/ox-koma-letter.el989
-rw-r--r--elpa/org-9.5.2/ox-koma-letter.elcbin0 -> 29675 bytes
-rw-r--r--elpa/org-9.5.2/ox-latex.el3828
-rw-r--r--elpa/org-9.5.2/ox-latex.elcbin0 -> 122294 bytes
-rw-r--r--elpa/org-9.5.2/ox-man.el1141
-rw-r--r--elpa/org-9.5.2/ox-man.elcbin0 -> 31879 bytes
-rw-r--r--elpa/org-9.5.2/ox-md.el787
-rw-r--r--elpa/org-9.5.2/ox-md.elcbin0 -> 25563 bytes
-rw-r--r--elpa/org-9.5.2/ox-odt.el4338
-rw-r--r--elpa/org-9.5.2/ox-odt.elcbin0 -> 132921 bytes
-rw-r--r--elpa/org-9.5.2/ox-org.el357
-rw-r--r--elpa/org-9.5.2/ox-org.elcbin0 -> 12648 bytes
-rw-r--r--elpa/org-9.5.2/ox-publish.el1380
-rw-r--r--elpa/org-9.5.2/ox-publish.elcbin0 -> 44840 bytes
-rw-r--r--elpa/org-9.5.2/ox-texinfo.el1757
-rw-r--r--elpa/org-9.5.2/ox-texinfo.elcbin0 -> 59693 bytes
-rw-r--r--elpa/org-9.5.2/ox.el7029
-rw-r--r--elpa/org-9.5.2/ox.elcbin0 -> 242218 bytes
-rw-r--r--elpa/org-9.5.2/request-assign-future.txt44
-rw-r--r--elpa/pkg-info-20150517.1143/pkg-info-autoloads.el127
-rw-r--r--elpa/pkg-info-20150517.1143/pkg-info-pkg.el2
-rw-r--r--elpa/pkg-info-20150517.1143/pkg-info.el332
-rw-r--r--elpa/pkg-info-20150517.1143/pkg-info.elcbin0 -> 9914 bytes
-rw-r--r--elpa/projectile-20220313.1334/projectile-autoloads.el612
-rw-r--r--elpa/projectile-20220313.1334/projectile-pkg.el2
-rw-r--r--elpa/projectile-20220313.1334/projectile.el5746
-rw-r--r--elpa/projectile-20220313.1334/projectile.elcbin0 -> 213969 bytes
-rw-r--r--elpa/req-package-20180605.1141/req-package-args.el31
-rw-r--r--elpa/req-package-20180605.1141/req-package-args.elcbin0 -> 1150 bytes
-rw-r--r--elpa/req-package-20180605.1141/req-package-autoloads.el50
-rw-r--r--elpa/req-package-20180605.1141/req-package-cycles.el35
-rw-r--r--elpa/req-package-20180605.1141/req-package-cycles.elcbin0 -> 1572 bytes
-rw-r--r--elpa/req-package-20180605.1141/req-package-hooks.el26
-rw-r--r--elpa/req-package-20180605.1141/req-package-hooks.elcbin0 -> 1236 bytes
-rw-r--r--elpa/req-package-20180605.1141/req-package-pkg.el15
-rw-r--r--elpa/req-package-20180605.1141/req-package.el494
-rw-r--r--elpa/req-package-20180605.1141/req-package.elcbin0 -> 19471 bytes
-rw-r--r--elpa/s-20210616.619/s-autoloads.el22
-rw-r--r--elpa/s-20210616.619/s-pkg.el2
-rw-r--r--elpa/s-20210616.619/s.el745
-rw-r--r--elpa/s-20210616.619/s.elcbin0 -> 28078 bytes
-rw-r--r--elpa/simple-httpd-20191103.1446/simple-httpd-autoloads.el38
-rw-r--r--elpa/simple-httpd-20191103.1446/simple-httpd-pkg.el2
-rw-r--r--elpa/simple-httpd-20191103.1446/simple-httpd.el904
-rw-r--r--elpa/simple-httpd-20191103.1446/simple-httpd.elcbin0 -> 25989 bytes
-rw-r--r--elpa/skewer-mode-20200304.1142/cache-table.el66
-rw-r--r--elpa/skewer-mode-20200304.1142/cache-table.elcbin0 -> 6281 bytes
-rw-r--r--elpa/skewer-mode-20200304.1142/example.html9
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-bower.el217
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-bower.elcbin0 -> 7211 bytes
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-css.el134
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-css.elcbin0 -> 5346 bytes
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-everything.user.js54
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-html.el165
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-html.elcbin0 -> 7845 bytes
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-mode-autoloads.el160
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-mode-pkg.el12
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-mode.el620
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-mode.elcbin0 -> 29666 bytes
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-repl.el210
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-repl.elcbin0 -> 8507 bytes
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-setup.el21
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer-setup.elcbin0 -> 378 bytes
-rw-r--r--elpa/skewer-mode-20200304.1142/skewer.js436
-rw-r--r--elpa/use-package-20210207.1926/dir18
-rw-r--r--elpa/use-package-20210207.1926/use-package-autoloads.el230
-rw-r--r--elpa/use-package-20210207.1926/use-package-bind-key.el172
-rw-r--r--elpa/use-package-20210207.1926/use-package-bind-key.elcbin0 -> 4638 bytes
-rw-r--r--elpa/use-package-20210207.1926/use-package-core.el1633
-rw-r--r--elpa/use-package-20210207.1926/use-package-core.elcbin0 -> 55873 bytes
-rw-r--r--elpa/use-package-20210207.1926/use-package-delight.el91
-rw-r--r--elpa/use-package-20210207.1926/use-package-delight.elcbin0 -> 1852 bytes
-rw-r--r--elpa/use-package-20210207.1926/use-package-diminish.el80
-rw-r--r--elpa/use-package-20210207.1926/use-package-diminish.elcbin0 -> 1766 bytes
-rw-r--r--elpa/use-package-20210207.1926/use-package-ensure.el214
-rw-r--r--elpa/use-package-20210207.1926/use-package-ensure.elcbin0 -> 5395 bytes
-rw-r--r--elpa/use-package-20210207.1926/use-package-jump.el79
-rw-r--r--elpa/use-package-20210207.1926/use-package-jump.elcbin0 -> 1773 bytes
-rw-r--r--elpa/use-package-20210207.1926/use-package-lint.el84
-rw-r--r--elpa/use-package-20210207.1926/use-package-lint.elcbin0 -> 1545 bytes
-rw-r--r--elpa/use-package-20210207.1926/use-package-pkg.el13
-rw-r--r--elpa/use-package-20210207.1926/use-package.el54
-rw-r--r--elpa/use-package-20210207.1926/use-package.elcbin0 -> 718 bytes
-rw-r--r--elpa/use-package-20210207.1926/use-package.info1048
-rw-r--r--elpa/yasnippet-20200604.246/yasnippet-autoloads.el81
-rw-r--r--elpa/yasnippet-20200604.246/yasnippet-pkg.el2
-rw-r--r--elpa/yasnippet-20200604.246/yasnippet.el5311
-rw-r--r--elpa/yasnippet-20200604.246/yasnippet.elcbin0 -> 227446 bytes
-rw-r--r--init.el59
-rwxr-xr-xirony/bin/irony-serverbin0 -> 498184 bytes
-rw-r--r--lisp/#org-custom.el#64
-rw-r--r--lisp/cpp.el54
-rw-r--r--lisp/general.el57
-rw-r--r--lisp/hl-line.el298
-rw-r--r--lisp/js-mode-custom.el20
-rw-r--r--lisp/minimap.el936
m---------lisp/neotree0
-rw-r--r--lisp/neotree.el2226
-rw-r--r--lisp/org-bullets.el126
-rw-r--r--lisp/org-custom.el68
-rw-r--r--lisp/perfect-margin.el336
-rw-r--r--lisp/smooth-scrolling.el327
-rw-r--r--lisp/text.el7
-rw-r--r--projectile-bookmarks.eld1
-rw-r--r--projects2
-rw-r--r--themes/vs-light-theme.el81
675 files changed, 336331 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f9b96ed
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.~
+*~ \ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..9df8313
--- /dev/null
+++ b/README.md
@@ -0,0 +1,2 @@
+# emacs
+Emacs configuration file
diff --git a/elpa/ac-js2-20190101.933/ac-js2-autoloads.el b/elpa/ac-js2-20190101.933/ac-js2-autoloads.el
new file mode 100644
index 0000000..f6b19e7
--- /dev/null
+++ b/elpa/ac-js2-20190101.933/ac-js2-autoloads.el
@@ -0,0 +1,70 @@
+;;; ac-js2-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*-
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "ac-js2" "ac-js2.el" (0 0 0 0))
+;;; Generated autoloads from ac-js2.el
+
+(autoload 'ac-js2-expand-function "ac-js2" "\
+Expand the function definition left of point.
+Expansion will only occur for candidates whose documentation
+string contain a function prototype." t nil)
+
+(autoload 'ac-js2-completion-function "ac-js2" "\
+Function for `completions-at-point'." nil nil)
+
+(autoload 'ac-js2-company "ac-js2" "\
+
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(autoload 'ac-js2-jump-to-definition "ac-js2" "\
+Jump to the definition of an object's property, variable or function.
+Navigation to a property definend in an Object literal isn't
+implemented." t nil)
+
+(autoload 'ac-js2-mode "ac-js2" "\
+A minor mode that provides auto-completion and navigation for Js2-mode.
+
+This is a minor mode. If called interactively, toggle the
+`Ac-Js2 mode' mode. If the prefix argument is positive, enable
+the mode, and if it is zero or negative, disable the mode.
+
+If called from Lisp, toggle the mode if ARG is `toggle'. Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+To check whether the minor mode is enabled in the current buffer,
+evaluate `ac-js2-mode'.
+
+The mode's hook is called both when the mode is enabled and when
+it is disabled.
+
+\(fn &optional ARG)" t nil)
+
+(register-definition-prefixes "ac-js2" '("ac-js2-"))
+
+;;;***
+
+;;;### (autoloads nil "ac-js2-tests" "ac-js2-tests.el" (0 0 0 0))
+;;; Generated autoloads from ac-js2-tests.el
+
+(register-definition-prefixes "ac-js2-tests" '("completion-frontend-test"))
+
+;;;***
+
+;;;### (autoloads nil nil ("ac-js2-pkg.el") (0 0 0 0))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; ac-js2-autoloads.el ends here
diff --git a/elpa/ac-js2-20190101.933/ac-js2-pkg.el b/elpa/ac-js2-20190101.933/ac-js2-pkg.el
new file mode 100644
index 0000000..9b42769
--- /dev/null
+++ b/elpa/ac-js2-20190101.933/ac-js2-pkg.el
@@ -0,0 +1,11 @@
+(define-package "ac-js2" "20190101.933" "Auto-complete source for Js2-mode, with navigation"
+ '((js2-mode "20090723")
+ (skewer-mode "1.4"))
+ :commit "2b56d09a16c1a0ce514cc1b85d64cb1be4502723" :authors
+ '(("Scott Barnett" . "scott.n.barnett@gmail.com"))
+ :maintainer
+ '("Scott Barnett" . "scott.n.barnett@gmail.com")
+ :url "https://github.com/ScottyB/ac-js2")
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/elpa/ac-js2-20190101.933/ac-js2-tests.el b/elpa/ac-js2-20190101.933/ac-js2-tests.el
new file mode 100644
index 0000000..05514e3
--- /dev/null
+++ b/elpa/ac-js2-20190101.933/ac-js2-tests.el
@@ -0,0 +1,76 @@
+;;; Tests for ac-js2
+
+(require 'ert)
+(require 'skewer-mode)
+(require 'js2-mode)
+(require 'ac-js2)
+
+;;; Must have a skewer client connected before running the tests
+;; Need to call httpd-stop from main Emacs if running tests in batch mode
+(unless skewer-clients
+ (run-skewer))
+
+(ert-deftest ac-js2-candidates-test ()
+ "Test the major function that returns candidates for all frontends."
+ (let (property
+ property-dot
+ func-call
+ var)
+ (with-temp-buffer
+ (insert "
+ var temp = function(param1, param2) {
+ var localParam = 15;
+ return param1 + param2;
+ };
+
+ var look;
+
+temp.aFun = function(lolParam) {};
+temp.anotherFunction = function() { return {about: 3};}")
+ (setq ac-js2-evaluate-calls t)
+ (setq ac-js2-external-libraries nil)
+
+ (js2-mode)
+ (ac-js2-mode t)
+ (js2-parse)
+
+ (insert "tem")
+ (ac-js2-candidates)
+ (setq var ac-js2-skewer-candidates)
+ (delete-char -3)
+
+ (insert "temp.")
+ (js2-parse)
+ (ac-js2-candidates)
+ (setq property-dot ac-js2-skewer-candidates)
+ (delete-char -5)
+
+ (insert "temp.aF")
+ (js2-parse)
+ (ac-js2-candidates)
+ (setq property ac-js2-skewer-candidates))
+
+ (should (assoc 'anotherFunction property-dot))
+ (print property)
+ (should (assoc 'aFun property))
+ (should (assoc 'temp var))))
+
+(defmacro completion-frontend-test (test-name completion-function)
+ "Utility for testing completion front ends.
+TODO: cover more cases"
+ `(ert-deftest ,test-name ()
+ (let (var)
+ (with-temp-buffer
+ (insert "var testComplete = function(param1, param2) {};")
+
+ (js2-mode)
+ (ac-js2-mode t)
+ (js2-parse)
+
+ (insert "testComplet")
+ (funcall ',completion-function)
+ (setq var (thing-at-point 'word)))
+ (should (string= var "testComplete")))))
+
+(completion-frontend-test auto-complete-test auto-complete)
+(completion-frontend-test completion-at-point-test completion-at-point)
diff --git a/elpa/ac-js2-20190101.933/ac-js2-tests.elc b/elpa/ac-js2-20190101.933/ac-js2-tests.elc
new file mode 100644
index 0000000..030ca04
--- /dev/null
+++ b/elpa/ac-js2-20190101.933/ac-js2-tests.elc
Binary files differ
diff --git a/elpa/ac-js2-20190101.933/ac-js2.el b/elpa/ac-js2-20190101.933/ac-js2.el
new file mode 100644
index 0000000..1951388
--- /dev/null
+++ b/elpa/ac-js2-20190101.933/ac-js2.el
@@ -0,0 +1,608 @@
+;;; ac-js2.el --- Auto-complete source for Js2-mode, with navigation
+
+;; Copyright (C) 2013 Scott Barnett
+
+;; Author: Scott Barnett <scott.n.barnett@gmail.com>
+;; URL: https://github.com/ScottyB/ac-js2
+;; Version: 1.0
+;; Package-Requires: ((js2-mode "20090723")(skewer-mode "1.4"))
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; An attempt to get context sensitive Javascript completion in Emacs.
+;; Basic completions are obtained by parsing Javascript code with
+;; Js2-mode's parser.
+;;
+;; Installation
+;;
+;; Easiest way to get ac-js2 is to install it from MELPA. You may need
+;; this snippet
+;;
+;; `(add-to-list 'package-archives
+;; '("melpa" . "http://melpa.milkbox.net/packages/") t)'
+;;
+;; if you don't have it already to fetch packages from MELPA.
+;;
+;; Enable ac-js2 in js2-mode as follows:
+;;
+;; (add-hook 'js2-mode-hook 'ac-js2-mode)
+;;
+;; Ac-js2 does not require auto-complete mode but I suggest you grab
+;; it anyway as ac-js2 is designed to work with a completion frontend.
+;; Support for Company mode is on its way.
+;;
+;; For more comprehensive completions you can opt to evaluate the code
+;; for candidates. A browser needs to be connected to Emacs for the
+;; evaluation completions to work. Put this in your init.el file.
+;;
+;; `(setq ac-js2-evaluate-calls t)'
+;;
+;; To add completions for external libraries add something like this:
+;;
+;; (add-to-list 'ac-js2-external-libraries "path/to/lib/library.js")
+;;
+;; Then connect a browser to Emacs by calling `(run-skewer)'. You may
+;; need to save the buffer for completions to start.
+;;
+;; If auto-complete mode is installed on your system then completions
+;; should start showing up otherwise use `completion-at-point'.
+;;
+;; Note: library completions will only work if `ac-js2-evaluate-calls'
+;; is set and a browser is connected to Emacs.
+;;
+;; Bonus: M-. is bound to `ac-js2-jump-to-definition' which will jump
+;; to Javascript definitions found in the same buffer. Given the
+;; following proprety reference:
+;;
+;; foo.bar.baz();
+;;
+;; placing the cursor on `foo', `bar' or `baz' and executing M-. will
+;; take you straight to their respective definitions. Use M-, to jump
+;; back to where you were. Also works for object literals.
+;;
+;; Recently added `ac-js2-expand-function' that will expand a function's
+;; parameters bound to `C-c C-c`. Expansion will only work if the cursor
+;; is after the function.
+;;
+;; If you have any issues or suggestions please create an issue on Github:
+;; https://github.com/ScottyB/ac-js2
+
+;;; History:
+
+;; Version 1.0
+;; * Navigation within current buffer
+;; * Completion and docstring for objects via Skewer
+;; * External library support
+;; * Basic completions of objects in current buffer
+
+;;; Code:
+
+(require 'js2-mode)
+(require 'skewer-mode)
+(require 'cl-lib)
+(require 'etags)
+
+(defgroup ac-js2 nil
+ "Auto-completion for js2-mode."
+ :group 'completion
+ :prefix "ac-js2-")
+
+;;; Configuration variables
+
+(defcustom ac-js2-add-ecma-262-externs t
+ "If non-nil add `js2-ecma-262-externs' to completion candidates.")
+
+(defcustom ac-js2-add-browser-externs t
+ "If non-nil add `js2-browser-externs' to completion candidates.")
+
+(defcustom ac-js2-add-keywords t
+ "If non-nil add `js2-keywords' to completion candidates.")
+
+(defcustom ac-js2-add-prototype-completions t
+ "When non-nil traverse the prototype chain adding to completion candidates.")
+
+(defcustom ac-js2-external-libraries '()
+ "List of absolute paths to external Javascript libraries.")
+
+(defcustom ac-js2-evaluate-calls nil
+ "Warning. When true function calls will be evaluated in the browser.
+This may cause undesired side effects however it will
+ provide better completions. Use at your own risk.")
+
+(defcustom ac-js2-force-reparse t
+ "Force Js2-mode to reparse buffer before fetching completion candidates.")
+
+;;; Internal variables
+
+(defvar ac-js2-keywords '()
+ "Cached string version of `js2-keywords'.")
+
+(defvar ac-js2-candidates '())
+
+;; Types of skewer completion methods available
+(defconst ac-js2-method-eval 0)
+(defconst ac-js2-method-global 1
+ "Return candidates for the global object.
+Only keys of the object are returned as the other properties come
+ from js2-mode's externs.")
+
+(defvar ac-js2-data-root (file-name-directory load-file-name)
+ "Location of data files needed for `ac-js2-on-skewer-load'.")
+
+;;; Skewer integration
+
+(defvar ac-js2-skewer-candidates '()
+ "Cadidates obtained from skewering.")
+
+(defun ac-js2-on-skewer-load ()
+ "Inject skewer addon and evaluate external libraries in browser."
+ (insert-file-contents (expand-file-name "skewer-addon.js" ac-js2-data-root))
+ (and ac-js2-evaluate-calls
+ (mapcar (lambda (library)
+ (with-temp-buffer
+ (insert-file-contents (expand-file-name library))
+ (skewer-eval (buffer-string)
+ nil
+ :type "complete"))) ac-js2-external-libraries)))
+
+(defun ac-js2-skewer-completion-candidates ()
+ "Get completions returned from skewer."
+ (mapcar (lambda (candidate) (symbol-name (car candidate))) ac-js2-skewer-candidates))
+
+(defun ac-js2-skewer-document-candidates (name)
+ "Return document string for NAME from skewer."
+ (let ((doc (cdr (assoc-string name ac-js2-skewer-candidates))))
+ (or (ac-js2-format-function doc) doc)))
+
+(defun ac-js2-get-object-properties (name)
+ "Find properties of NAME for completion."
+ (ac-js2-skewer-eval-wrapper name `((prototypes . ,ac-js2-add-prototype-completions))))
+
+(defun ac-js2-skewer-result-callback (result)
+ "Process the RESULT passed from the browser."
+ (let ((value (cdr (assoc 'value result))))
+ (if (and (skewer-success-p result) value)
+ (setq ac-js2-skewer-candidates (append value nil)))))
+
+(defun ac-js2-skewer-eval-wrapper (str &optional extras)
+ "Wrap `skewer-eval-synchronously' to check if a skewer-client is avilable.
+STR is the text to send to the browser for evaluation. Extra
+parameters can be passed to the browser using EXTRAS. EXTRAS must
+be of the form (param-string . value) where param-string is the
+reference and value is the value that can be retrieved from the
+request object in Javacript."
+ (setq ac-js2-skewer-candidates nil)
+ (if skewer-clients
+ (if (or ac-js2-evaluate-calls
+ (not (ac-js2-has-function-calls str)))
+ (ac-js2-skewer-result-callback
+ (skewer-eval-synchronously str
+ :type "complete"
+ :extra extras)))
+ (setq skewer-queue nil)))
+
+;; Generate candidates
+(defun ac-js2-candidates ()
+ "Main function called to gather candidates for auto-completion."
+ (if ac-js2-force-reparse (js2-reparse))
+ (let ((node (js2-node-parent (js2-node-at-point (1- (point)))))
+ beg
+ (prop-get-regex "[a-zA-Z)]\\.")
+ name)
+ (setq ac-js2-candidates nil)
+ (cond
+ ((looking-back "\\.")
+ ;; TODO: Need to come up with a better way to extract object than this regex!!
+ (save-excursion
+ (setq beg (and (skip-chars-backward "[a-zA-Z_$][0-9a-zA-Z_$#\"())]+\\.") (point))))
+ (setq name (buffer-substring-no-properties beg (1- (point))))
+ (ac-js2-get-object-properties name)
+ (setq node (ac-js2-initialized-node (if (string-match prop-get-regex name)
+ (reverse (split-string name prop-get-regex)) name)))
+ (if (js2-object-node-p node)
+ (setq ac-js2-candidates
+ (mapcar (lambda (elem)
+ (ac-js2-format-node (js2-node-string (js2-object-prop-node-left elem))
+ elem))
+ (js2-object-node-elems node))))
+ (append (mapcar 'cl-first ac-js2-candidates)
+ (ac-js2-skewer-completion-candidates)))
+ ((js2-prop-get-node-p node)
+ (setq node (js2-prop-get-node-left node))
+ (setq name (js2-node-string node))
+ (ac-js2-get-object-properties name)
+ (ac-js2-skewer-completion-candidates))
+ (t
+ (ac-js2-skewer-eval-wrapper "" `((method . ,ac-js2-method-global)))
+ (append (ac-js2-skewer-completion-candidates)
+ (ac-js2-add-extra-completions
+ (mapcar 'cl-first (ac-js2-get-names-in-scope))))))))
+
+(defun ac-js2-document (name)
+ "Show documentation for NAME from local buffer if present
+otherwise use documentation obtained from skewer."
+ (let* ((docs (cdr (assoc name ac-js2-candidates)))
+ (doc (if (listp docs) (cl-first docs) docs)))
+ (if doc doc (ac-js2-skewer-document-candidates name))))
+
+;; Auto-complete settings
+
+(defun ac-js2-ac-candidates ()
+ "Completion candidates for auto-complete mode."
+ (ac-js2-candidates))
+
+(defun ac-js2-ac-document (name)
+ "Documentation to be shown for auto-complete mode."
+ (ac-js2-document name))
+
+(defun ac-js2-ac-prefix()
+ (or (ac-prefix-default) (ac-prefix-c-dot)))
+
+(defun ac-js2-save ()
+ "Called on `before-save-hook' to evaluate buffer."
+ (interactive)
+ (when (string= major-mode "js2-mode")
+ (ac-js2-skewer-eval-wrapper (buffer-string)))
+ t)
+
+;;;###autoload
+(defun ac-js2-expand-function()
+ "Expand the function definition left of point.
+Expansion will only occur for candidates whose documentation
+string contain a function prototype."
+ (interactive)
+ (let* ((word (progn
+ (if (featurep 'auto-complete) (ac-complete))
+ (substring-no-properties (or (thing-at-point 'word) ""))))
+ (candidate (ac-js2-ac-document word)))
+ (if (and (looking-back word) (stringp candidate))
+ (when (string-match "^function" candidate)
+ (cond ((featurep 'yasnippet)
+ (yas-expand-snippet
+ (concat "("
+ (replace-regexp-in-string "\\([a-zA-Z0-9]+\\)"
+ (lambda (txt) (concat "${" txt "}"))
+ (cl-second (split-string candidate "[()]")))
+ ")$0"))))))))
+
+(defun ac-js2-setup-auto-complete-mode ()
+ "Setup ac-js2 to be used with auto-complete-mode."
+ (add-to-list 'ac-sources 'ac-source-js2)
+ (auto-complete-mode)
+ (ac-define-source "js2"
+ '((candidates . ac-js2-ac-candidates)
+ (document . ac-js2-ac-document)
+ (prefix . ac-js2-ac-prefix)
+ (requires . -1))))
+
+;;; Completion at point function
+
+;;;###autoload
+(defun ac-js2-completion-function ()
+ "Function for `completions-at-point'."
+ (save-excursion
+ (let ((bounds (if (looking-back "\\.")
+ (cons (point) (point))
+ (bounds-of-thing-at-point 'word))))
+ (list (car bounds) (cdr bounds) (ac-js2-candidates)))))
+
+;;; Company
+
+;;;###autoload
+(defun ac-js2-company (command &optional arg &rest ignored)
+ (interactive (list 'interactive))
+ (if (not (featurep 'company))
+ (message "Company is not installed")
+ (cl-case command
+ (interactive (company-begin-backend 'ac-js2-company))
+ (prefix (when ac-js2-mode
+ (or (company-grab-symbol)
+ 'stop)))
+ (candidates (all-completions arg (ac-js2-candidates)))
+ (duplicates t)
+ (meta (let ((doc (ac-js2-document arg)))
+ (when doc
+ (with-temp-buffer
+ (insert doc)
+ (js-mode)
+ (if (fboundp 'font-lock-ensure)
+ (font-lock-ensure)
+ (with-no-warnings
+ (font-lock-fontify-buffer)))
+ (buffer-string))))))))
+
+;;; Helper functions
+
+(defun ac-js2-build-prop-name-list (prop-node)
+ "Build a list of names from a PROP-NODE."
+ (let* (names
+ left
+ left-node)
+ (unless (js2-prop-get-node-p prop-node)
+ (error "Node is not a property prop-node"))
+ (while (js2-prop-get-node-p prop-node)
+ (push (js2-name-node-name (js2-prop-get-node-right prop-node)) names)
+ (setq left-node (js2-prop-get-node-left prop-node))
+ (when (js2-name-node-p left-node)
+ (setq left (js2-name-node-name left-node)))
+ (setq prop-node (js2-node-parent prop-node)))
+ (append names `(,left))))
+
+(defun ac-js2-prop-names-left (name-node)
+ "Create a list of all of the names in the property NAME-NODE.
+NAME-NODE must have a js2-prop-get-node as parent. Only adds
+properties to the left of point. This is so individual jump
+points can be found for each property in the chain."
+ (let* (name
+ (parent (js2-node-parent name-node))
+ left
+ names)
+ (unless (or (js2-prop-get-node-p parent) (js2-name-node-p name-node))
+ (error "Not a name node or doesn't have a prop-get-node as parent"))
+ (setq name (js2-name-node-name name-node)
+ left (js2-prop-get-node-left parent))
+ (if (and (js2-name-node-p left)
+ (string= name (js2-name-node-name left)))
+ (setq names name)
+ (js2-visit-ast
+ parent
+ (lambda (node endp)
+ (unless endp
+ (if (js2-name-node-p node)
+ (push (js2-name-node-name node) names)
+ t))))
+ names)))
+
+(defun ac-js2-has-function-calls (string)
+ "Check if the Javascript code in STRING has a Js2-call-node."
+ (with-temp-buffer
+ (insert string)
+ (let* ((ast (js2-parse)))
+ (catch 'call-node
+ (js2-visit-ast-root
+ ast
+ (lambda (node end-p)
+ (unless end-p
+ (if (js2-call-node-p node)
+ (throw 'call-node t)
+ t))))))))
+
+(defun ac-js2-add-extra-completions (completions)
+ "Add extra candidates to COMPLETIONS."
+ (append completions
+ (if ac-js2-add-keywords (or ac-js2-keywords (setq ac-js2-keywords (mapcar 'symbol-name js2-keywords))))
+ (if ac-js2-add-ecma-262-externs js2-ecma-262-externs)
+ (if ac-js2-add-browser-externs js2-browser-externs)))
+
+(defun ac-js2-root-or-node ()
+ "Return the current node or js2-ast-root node."
+ (let ((node (js2-node-at-point)))
+ (if (js2-ast-root-p node)
+ node
+ (js2-node-get-enclosing-scope node))))
+
+(defun ac-js2-get-names-in-scope ()
+ "Fetches all symbols in scope and formats them for completion."
+ (let* ((scope (ac-js2-root-or-node))
+ result)
+ (while scope
+ (setq result (append result
+ (cl-loop for item in (js2-scope-symbol-table scope)
+ if (not (assoc (car item) result))
+ collect item)))
+ (setq scope (js2-scope-parent-scope scope)))
+ (setq ac-js2-candidates
+ (mapcar #'(lambda (x)
+ (let* ((name (symbol-name (car x)))
+ (init (ac-js2-initialized-node name)))
+ (ac-js2-format-node name init)))
+ result))))
+
+(defun ac-js2-initialized-node (name)
+ "Return initial value assigned to NAME.
+NAME may be either a variable, a function or a variable that
+holds a function. NAME may also be a list of names that make up a
+object property. Returns nil if no initial value can be found."
+ (let* ((node (if (listp name) (ac-js2-find-property name)
+ (ac-js2-name-declaration name)))
+ (parent (if node (js2-node-parent node)))
+ (init (cond
+ ((js2-function-node-p parent)
+ parent)
+ ((js2-function-node-p node)
+ node)
+ ((js2-var-init-node-p parent)
+ (js2-var-init-node-initializer parent))
+ ((js2-assign-node-p parent)
+ (js2-assign-node-right parent))
+ (t
+ nil))))
+ init))
+
+(defun ac-js2-name-declaration (name)
+ "Return the declaration node for node named NAME."
+ (let* ((node (ac-js2-root-or-node))
+ (scope-def (js2-get-defining-scope node name))
+ (scope (if scope-def (js2-scope-get-symbol scope-def name) nil))
+ (symbol (if scope (js2-symbol-ast-node scope) nil)))
+ (if (not symbol)
+ (ac-js2-get-function-node name scope-def)
+ symbol)))
+
+;;; Completion candidate formatting
+
+(defun ac-js2-format-node (name node)
+ "Format NAME and NODE for completion.
+Returned format is a list where the first element is the NAME of
+the node (shown in completion candidate list) and the last
+element is the text to show as documentation."
+ (let ((node (if (js2-object-prop-node-p node) (js2-object-prop-node-right node) node))
+ (name-format (replace-regexp-in-string "\"" "" name))
+ (doc (if (and (js2-function-node-p node)
+ (cl-find name (js2-function-node-params node)
+ :test '(lambda (name param) (string= name (js2-name-node-name param)))))
+ "Function parameter"
+ (ac-js2-format-node-doc node))))
+ `(,name-format . ,doc)))
+
+(defun ac-js2-format-object-node-doc (obj-node)
+ "Format OBJ-NODE to display as documentation."
+ (let (elems)
+ (unless (js2-object-node-p obj-node)
+ (error "Node is not an object node"))
+ (setq elems (js2-object-node-elems obj-node))
+ (if (not elems)
+ "{}"
+ (mapconcat #'(lambda (x) (ac-js2-format-js2-object-prop-doc x)) elems "\n"))))
+
+(defun ac-js2-format-node-doc (node)
+ "Format NODE for displaying in a document string."
+ (let* ((node-above (and node (js2-node-at-point
+ (save-excursion
+ (goto-char (js2-node-abs-pos node))
+ (forward-line -1)
+ (point)))))
+ (comment (if (js2-comment-node-p node-above)
+ (ac-js2-format-comment (js2-node-string node-above))))
+ (doc (cond
+ ((js2-function-node-p node)
+ (ac-js2-format-function node))
+ ((js2-object-node-p node)
+ (ac-js2-format-object-node-doc node))
+ ((js2-object-prop-node-p node)
+ (ac-js2-format-node-doc (js2-object-prop-node-right node)))
+ (t
+ (if (js2-node-p node) (js2-node-string node) "")))))
+ (if comment (concat comment "\n" doc) doc)))
+
+(defun ac-js2-format-js2-object-prop-doc (obj-prop)
+ "Format an OBJ-PROP for displaying as a document string."
+ (unless (js2-object-prop-node-p obj-prop)
+ (error "Node is not an object property node"))
+ (let* ((left (js2-object-prop-node-left obj-prop))
+ (right (js2-object-prop-node-right obj-prop)))
+ (concat (js2-node-string left) " : "
+ (ac-js2-format-node-doc right))))
+
+(defun ac-js2-format-function (func)
+ "Formats a function for a document string.
+FUNC can be either a function node or a string starting with
+'function'. Returns nil if neither."
+ (let ((str (or (and (js2-function-node-p func) (js2-node-string func))
+ (and (stringp func) (eq 0 (string-match "function" func)) func))))
+ (if str (substring str 0 (1+ (string-match ")" str))))))
+
+(defun ac-js2-format-comment (comment)
+ "Prepare a COMMENT node for displaying in a popup."
+ (let* ((node-string (if (js2-comment-node-p comment)
+ (js2-node-string comment)
+ comment))
+ (string (replace-regexp-in-string "[ \t]$" ""
+ (replace-regexp-in-string "^[ \t\n*/*]+" "" node-string))))
+ string))
+
+;;; Navigation commands for js2-mode
+
+(defun ac-js2-find-property (list-names)
+ "Find the property definition that consists of LIST-NAMES.
+Supports navigation to 'foo.bar = 3' and 'foo = {bar: 3}'."
+ (catch 'prop-found
+ (js2-visit-ast-root
+ js2-mode-ast
+ (lambda (node endp)
+ (let ((parent (js2-node-parent node)))
+ (unless endp
+ (if (or (and (js2-prop-get-node-p node)
+ (not (or (js2-elem-get-node-p parent) (js2-call-node-p parent)))
+ (equal list-names (ac-js2-build-prop-name-list node)))
+ (and (js2-name-node-p node)
+ (js2-object-prop-node-p parent)
+ (string= (js2-name-node-name node)
+ (cl-first list-names))))
+ (throw 'prop-found node))
+ t))))))
+
+(defun ac-js2-get-function-node (name scope)
+ "Return node of function named NAME in SCOPE."
+ (catch 'function-found
+ (js2-visit-ast
+ scope
+ (lambda (node end-p)
+ (when (and (not end-p)
+ (string= name (ac-js2-get-function-name node)))
+ (throw 'function-found node))
+ t))
+ nil))
+
+;;;###autoload
+(defun ac-js2-jump-to-definition ()
+ "Jump to the definition of an object's property, variable or function.
+Navigation to a property definend in an Object literal isn't
+implemented."
+ (interactive)
+ (ring-insert find-tag-marker-ring (point-marker))
+ (let* ((node (js2-node-at-point))
+ (parent (js2-node-parent node))
+ (prop-names (if (js2-prop-get-node-p parent)
+ (ac-js2-prop-names-left node)))
+ (name (if (and (js2-name-node-p node)
+ (not (js2-object-prop-node-p parent)))
+ (js2-name-node-name node)
+ (error "Node is not a supported jump node")))
+ (node-init (if (and prop-names (listp prop-names))
+ (ac-js2-find-property prop-names)
+ (ac-js2-name-declaration name))))
+ (unless node-init
+ (pop-tag-mark)
+ (error "No jump location found"))
+ (goto-char (js2-node-abs-pos node-init))))
+
+(defun ac-js2-get-function-name (fn-node)
+ "Return the name of the function FN-NODE.
+Value may be either function name or the variable name that holds
+the function."
+ (let ((parent (js2-node-parent fn-node)))
+ (if (js2-function-node-p fn-node)
+ (or (js2-function-name fn-node)
+ (if (js2-var-init-node-p parent)
+ (js2-name-node-name (js2-var-init-node-target parent)))))))
+
+(defvar ac-js2-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map (kbd "M-.") 'ac-js2-jump-to-definition)
+ (define-key map (kbd "M-,") 'pop-tag-mark)
+ (define-key map (kbd "C-c C-c") 'ac-js2-expand-function)
+ map)
+ "Keymap for `ac-js2-mode'.")
+
+;;; Minor mode
+
+;;;###autoload
+(define-minor-mode ac-js2-mode
+ "A minor mode that provides auto-completion and navigation for Js2-mode."
+ :keymap ac-js2-mode-map
+ (if (featurep 'auto-complete)
+ (ac-js2-setup-auto-complete-mode))
+ (set (make-local-variable 'completion-at-point-functions)
+ (cons 'ac-js2-completion-function completion-at-point-functions))
+ (ac-js2-skewer-eval-wrapper (buffer-string))
+ (add-hook 'before-save-hook 'ac-js2-save nil t)
+ (add-hook 'skewer-js-hook 'ac-js2-on-skewer-load))
+
+
+(provide 'ac-js2)
+
+;;; ac-js2.el ends here
diff --git a/elpa/ac-js2-20190101.933/ac-js2.elc b/elpa/ac-js2-20190101.933/ac-js2.elc
new file mode 100644
index 0000000..abe484e
--- /dev/null
+++ b/elpa/ac-js2-20190101.933/ac-js2.elc
Binary files differ
diff --git a/elpa/ac-js2-20190101.933/skewer-addon.js b/elpa/ac-js2-20190101.933/skewer-addon.js
new file mode 100644
index 0000000..8e2b5a1
--- /dev/null
+++ b/elpa/ac-js2-20190101.933/skewer-addon.js
@@ -0,0 +1,116 @@
+/**
+ * @fileOverview Completion request handler for skewer.js
+ * @requires skewer
+ * @version 1.0
+ */
+
+/**
+ * Handles a completion request from Emacs.
+ * @param request The request object sent by Emacs
+ * @returns The completions and init values to be returned to Emacs
+ */
+skewer.fn.complete = function(request) {
+ var result = {
+ type : request.type,
+ id : request.id,
+ strict : request.strict,
+ status : "success"
+ },
+
+ /**
+ * Methods for generating candidates
+ */
+ METHOD = {
+ EVAL : 0,
+ GLOBAL : 1
+ },
+
+ /**
+ * Add the properties from object to extendObject. Properties
+ * may be from the prototype but we still want to add them.
+ */
+ extend = function(extendObject, object) {
+ for(var key in object) {
+ extendObject[key] = object[key];
+ }
+ },
+
+ globalCompletion = function() {
+ var global = Function('return this')(),
+ keys = Object.keys(global);
+ candidates = buildCandidates(global, keys);
+ },
+
+ evalCompletion = function(evalObject) {
+ var obj = (eval, eval)(evalObject);
+ if (typeof obj === "object") {
+ candidates = buildCandidates(obj) || {};
+ while (request.prototypes && (obj = Object.getPrototypeOf(obj)) !== null) {
+ extend(candidates, buildCandidates(obj));
+ }
+ } else if (typeof obj === "function"){
+ candidates = buildCandidates(obj) || {};
+ extend(candidates, buildCandidates(Object.getPrototypeOf(obj)));
+ if (request.prototypes) {
+ var protoObject = Object.getPrototypeOf(obj.prototype);
+ if (protoObject !== null) {
+ extend(candidates, buildCandidates(protoObject));
+ } else {
+ extend(candidates, buildCandidates(obj.prototype));
+ }
+ }
+ }
+ },
+
+ /**
+ * Completion candidates sent back to Emacs. Keys are
+ * completion candidates the values are the inital items or
+ * function interfaces.
+ */
+ candidates = {},
+
+ /**
+ * Build the candiates to return to Emacs.
+ * @param obj The object to get candidates from
+ * @param items The selected keys from obj to create candidates for
+ * @return object containing completion candidates and documentation strings
+ */
+ buildCandidates = function(obj, items) {
+ var keys = items || Object.getOwnPropertyNames(obj), values = {};
+ for (var i = 0; i < keys.length; i++) {
+ var key = keys[i];
+ if (key === "callee" || key === "caller" || key === "arguments") continue;
+ if (Object.prototype.toString.call(obj[key]) === "[object Function]") {
+ values[key] = obj[key].toString();
+ } else if (typeof obj[key] === "object"){
+ values[key] = "[object Object]";
+ } else if (typeof obj[key] === "number") {
+ if (!(obj instanceof Array)) {
+ values[key] = obj[key].toString();
+ }
+ } else if (typeof obj[key] === "string") {
+ values[key] = obj[key].toString();
+ } else if(obj[key] === true) {
+ values[key] = "true";
+ } else if (obj[key] === false) {
+ values[key] = "false";
+ } else {
+ values[key] = "";
+ }
+ }
+ return values;
+ };
+ try {
+ switch (request.method) {
+ case METHOD.GLOBAL:
+ globalCompletion();
+ break;
+ default:
+ evalCompletion(request.eval);
+ }
+ result.value = candidates;
+ } catch (error){
+ skewer.errorResult(error, result, request);
+ }
+ return result;
+};
diff --git a/elpa/all-the-icons-20220325.1238/all-the-icons-autoloads.el b/elpa/all-the-icons-20220325.1238/all-the-icons-autoloads.el
new file mode 100644
index 0000000..121bfa6
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/all-the-icons-autoloads.el
@@ -0,0 +1,75 @@
+;;; all-the-icons-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "all-the-icons" "all-the-icons.el" (0 0 0 0))
+;;; Generated autoloads from all-the-icons.el
+
+(autoload 'all-the-icons-icon-for-dir "all-the-icons" "\
+Get the formatted icon for DIR.
+ARG-OVERRIDES should be a plist containining `:height',
+`:v-adjust' or `:face' properties like in the normal icon
+inserting functions.
+
+Note: You want chevron, please use `all-the-icons-icon-for-dir-with-chevron'.
+
+\(fn DIR &rest ARG-OVERRIDES)" nil nil)
+
+(autoload 'all-the-icons-icon-for-file "all-the-icons" "\
+Get the formatted icon for FILE.
+ARG-OVERRIDES should be a plist containining `:height',
+`:v-adjust' or `:face' properties like in the normal icon
+inserting functions.
+
+\(fn FILE &rest ARG-OVERRIDES)" nil nil)
+
+(autoload 'all-the-icons-icon-for-mode "all-the-icons" "\
+Get the formatted icon for MODE.
+ARG-OVERRIDES should be a plist containining `:height',
+`:v-adjust' or `:face' properties like in the normal icon
+inserting functions.
+
+\(fn MODE &rest ARG-OVERRIDES)" nil nil)
+
+(autoload 'all-the-icons-icon-for-url "all-the-icons" "\
+Get the formatted icon for URL.
+If an icon for URL isn't found in `all-the-icons-url-alist', a globe is used.
+ARG-OVERRIDES should be a plist containining `:height',
+`:v-adjust' or `:face' properties like in the normal icon
+inserting functions.
+
+\(fn URL &rest ARG-OVERRIDES)" nil nil)
+
+(autoload 'all-the-icons-install-fonts "all-the-icons" "\
+Helper function to download and install the latests fonts based on OS.
+When PFX is non-nil, ignore the prompt and just install
+
+\(fn &optional PFX)" t nil)
+
+(autoload 'all-the-icons-insert "all-the-icons" "\
+Interactive icon insertion function.
+When Prefix ARG is non-nil, insert the propertized icon.
+When FAMILY is non-nil, limit the candidates to the icon set matching it.
+
+\(fn &optional ARG FAMILY)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "all-the-icons" '("all-the-icons-")))
+
+;;;***
+
+;;;### (autoloads nil nil ("all-the-icons-faces.el" "all-the-icons-pkg.el")
+;;;;;; (0 0 0 0))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; all-the-icons-autoloads.el ends here
diff --git a/elpa/all-the-icons-20220325.1238/all-the-icons-faces.el b/elpa/all-the-icons-20220325.1238/all-the-icons-faces.el
new file mode 100644
index 0000000..4408e97
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/all-the-icons-faces.el
@@ -0,0 +1,230 @@
+;;; all-the-icons-faces.el --- A module of faces for all-the-icons
+
+;; Copyright (C) 2016 Dominic Charlesworth <dgc336@gmail.com>
+
+;; Author: Dominic Charlesworth <dgc336@gmail.com>
+;; Version: 1.0.0
+;; Package-Requires: ((emacs "24.3"))
+;; URL: https://github.com/domtronn/all-the-icons.el
+;; Keywords: convenient, lisp
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file contains all of the faces used by the package for
+;; colouring icons
+
+;;; Code:
+
+(defgroup all-the-icons-faces nil
+ "Manage how All The Icons icons are coloured and themed."
+ :prefix "all-the-icons-"
+ :group 'tools
+ :group 'all-the-icons)
+
+
+;; red
+(defface all-the-icons-red
+ '((((background dark)) :foreground "#AC4142")
+ (((background light)) :foreground "#AC4142"))
+ "Face for red icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-lred
+ '((((background dark)) :foreground "#EB595A")
+ (((background light)) :foreground "#EB595A"))
+ "Face for lred icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-dred
+ '((((background dark)) :foreground "#843031")
+ (((background light)) :foreground "#843031"))
+ "Face for dred icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-red-alt
+ '((((background dark)) :foreground "#ce5643")
+ (((background light)) :foreground "#843031"))
+ "Face for dred icons"
+ :group 'all-the-icons-faces)
+
+;; green
+(defface all-the-icons-green
+ '((((background dark)) :foreground "#90A959")
+ (((background light)) :foreground "#90A959"))
+ "Face for green icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-lgreen
+ '((((background dark)) :foreground "#C6E87A")
+ (((background light)) :foreground "#3D6837"))
+ "Face for lgreen icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-dgreen
+ '((((background dark)) :foreground "#6D8143")
+ (((background light)) :foreground "#6D8143"))
+ "Face for dgreen icons"
+ :group 'all-the-icons-faces)
+
+;; yellow
+(defface all-the-icons-yellow
+ '((((background dark)) :foreground "#FFD446")
+ (((background light)) :foreground "#FFCC0E"))
+ "Face for yellow icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-lyellow
+ '((((background dark)) :foreground "#FFC16D")
+ (((background light)) :foreground "#FF9300"))
+ "Face for lyellow icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-dyellow
+ '((((background dark)) :foreground "#B48D56")
+ (((background light)) :foreground "#B48D56"))
+ "Face for dyellow icons"
+ :group 'all-the-icons-faces)
+
+;; blue
+(defface all-the-icons-blue
+ '((((background dark)) :foreground "#6A9FB5")
+ (((background light)) :foreground "#6A9FB5"))
+ "Face for blue icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-blue-alt
+ '((((background dark)) :foreground "#2188b6")
+ (((background light)) :foreground "#2188b6"))
+ "Face for blue icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-lblue
+ '((((background dark)) :foreground "#8FD7F4")
+ (((background light)) :foreground "#677174"))
+ "Face for lblue icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-dblue
+ '((((background dark)) :foreground "#446674")
+ (((background light)) :foreground "#446674"))
+ "Face for dblue icons"
+ :group 'all-the-icons-faces)
+
+;; maroon
+(defface all-the-icons-maroon
+ '((((background dark)) :foreground "#8F5536")
+ (((background light)) :foreground "#8F5536"))
+ "Face for maroon icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-lmaroon
+ '((((background dark)) :foreground "#CE7A4E")
+ (((background light)) :foreground "#CE7A4E"))
+ "Face for lmaroon icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-dmaroon
+ '((((background dark)) :foreground "#72584B")
+ (((background light)) :foreground "#72584B"))
+ "Face for dmaroon icons"
+ :group 'all-the-icons-faces)
+
+;; purple
+(defface all-the-icons-purple
+ '((((background dark)) :foreground "#AA759F")
+ (((background light)) :foreground "#68295B"))
+ "Face for purple icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-purple-alt
+ '((((background dark)) :foreground "#5D54E1")
+ (((background light)) :foreground "#5D54E1"))
+ "Face for purple icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-lpurple
+ '((((background dark)) :foreground "#E69DD6")
+ (((background light)) :foreground "#E69DD6"))
+ "Face for lpurple icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-dpurple
+ '((((background dark)) :foreground "#694863")
+ (((background light)) :foreground "#694863"))
+ "Face for dpurple icons"
+ :group 'all-the-icons-faces)
+
+;; orange
+(defface all-the-icons-orange
+ '((((background dark)) :foreground "#D4843E")
+ (((background light)) :foreground "#D4843E"))
+ "Face for orange icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-lorange
+ '((((background dark)) :foreground "#FFA500")
+ (((background light)) :foreground "#FFA500"))
+ "Face for lorange icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-dorange
+ '((((background dark)) :foreground "#915B2D")
+ (((background light)) :foreground "#915B2D"))
+ "Face for dorange icons"
+ :group 'all-the-icons-faces)
+
+;; cyan
+(defface all-the-icons-cyan
+ '((((background dark)) :foreground "#75B5AA")
+ (((background light)) :foreground "#75B5AA"))
+ "Face for cyan icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-cyan-alt
+ '((((background dark)) :foreground "#61dafb")
+ (((background light)) :foreground "#0595bd"))
+ "Face for cyan icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-lcyan
+ '((((background dark)) :foreground "#A5FDEC")
+ (((background light)) :foreground "#2C7D6E"))
+ "Face for lcyan icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-dcyan
+ '((((background dark)) :foreground "#48746D")
+ (((background light)) :foreground "#48746D"))
+ "Face for dcyan icons"
+ :group 'all-the-icons-faces)
+
+;; pink
+(defface all-the-icons-pink
+ '((((background dark)) :foreground "#F2B4B8")
+ (((background light)) :foreground "#FC505B"))
+ "Face for pink icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-lpink
+ '((((background dark)) :foreground "#FFBDC1")
+ (((background light)) :foreground "#FF505B"))
+ "Face for lpink icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-dpink
+ '((((background dark)) :foreground "#B18286")
+ (((background light)) :foreground "#7E5D5F"))
+ "Face for dpink icons"
+ :group 'all-the-icons-faces)
+
+;; silver
+(defface all-the-icons-silver
+ '((((background dark)) :foreground "#716E68")
+ (((background light)) :foreground "#716E68"))
+ "Face for silver icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-lsilver
+ '((((background dark)) :foreground "#B9B6AA")
+ (((background light)) :foreground "#7F7869"))
+ "Face for lsilver icons"
+ :group 'all-the-icons-faces)
+(defface all-the-icons-dsilver
+ '((((background dark)) :foreground "#838484")
+ (((background light)) :foreground "#838484"))
+ "Face for dsilver icons"
+ :group 'all-the-icons-faces)
+
+
+(provide 'all-the-icons-faces)
+;;; all-the-icons-faces.el ends here
diff --git a/elpa/all-the-icons-20220325.1238/all-the-icons-faces.elc b/elpa/all-the-icons-20220325.1238/all-the-icons-faces.elc
new file mode 100644
index 0000000..26c672b
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/all-the-icons-faces.elc
Binary files differ
diff --git a/elpa/all-the-icons-20220325.1238/all-the-icons-pkg.el b/elpa/all-the-icons-20220325.1238/all-the-icons-pkg.el
new file mode 100644
index 0000000..b606660
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/all-the-icons-pkg.el
@@ -0,0 +1,12 @@
+(define-package "all-the-icons" "20220325.1238" "A library for inserting Developer icons"
+ '((emacs "24.3"))
+ :commit "65c496d3d1d1298345beb9845840067bffb2ffd8" :authors
+ '(("Dominic Charlesworth" . "dgc336@gmail.com"))
+ :maintainer
+ '("Dominic Charlesworth" . "dgc336@gmail.com")
+ :keywords
+ '("convenient" "lisp")
+ :url "https://github.com/domtronn/all-the-icons.el")
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/elpa/all-the-icons-20220325.1238/all-the-icons.el b/elpa/all-the-icons-20220325.1238/all-the-icons.el
new file mode 100644
index 0000000..999246e
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/all-the-icons.el
@@ -0,0 +1,1189 @@
+;;; all-the-icons.el --- A library for inserting Developer icons -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2016 Dominic Charlesworth <dgc336@gmail.com>
+
+;; Author: Dominic Charlesworth <dgc336@gmail.com>
+;; Version: 5.0.0
+;; Package-Requires: ((emacs "24.3"))
+;; URL: https://github.com/domtronn/all-the-icons.el
+;; Keywords: convenient, lisp
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This package is a utility for using and formatting various Icon
+;; fonts within Emacs. Icon Fonts allow you to propertize and format
+;; icons the same way you would normal text. This enables things such
+;; as better scaling of and anti aliasing of the icons.
+
+;; This package was inspired by
+
+;; - `mode-icons' for Emacs, found at https://github.com/ryuslash/mode-icons
+;; - `file-icons' for Atom, found at https://atom.io/packages/file-icons
+
+;; Currently, this package provides an interface to the following Icon Fonts
+
+;; - Atom File Icons, found at https://atom.io/packages/file-icons
+;; - FontAwesome Icons, found at http://fontawesome.io/
+;; - GitHub Octicons, found at http://octicons.github.com
+;; - Material Design Icons, found at http://google.github.io/material-design-icons/
+;; - Weather Icons, found at https://erikflowers.github.io/weather-icons/
+;; - AllTheIcons, a custom Icon Font maintained as part of this package
+
+;; Requests for new icons will be accepted and added to the AllTheIcons Icon Font
+
+;;; Usage:
+
+;; The simplest usage for this package is to use the following functions;
+
+;; `all-the-icons-icon-for-buffer'
+;; `all-the-icons-icon-for-dir'
+;; `all-the-icons-icon-for-file'
+;; `all-the-icons-icon-for-mode'
+;; `all-the-icons-icon-for-url'
+
+;; Which can be used to get a formatted icon for the current buffer, a
+;; file name, a major mode, or an URL respectively. e.g.
+
+;; (insert (all-the-icons-icon-for-file "foo.js"))
+
+;; Inserts a JavaScript icon formatted like this
+
+;; #("some-icon" 0 1 (display (raise -0.24)
+;; face (:family "dev-icons" :height 1.08 :foreground "#FFD446")))
+
+;; You can also insert icons directly using the individual icon family
+;; functions
+
+;; `all-the-icons-alltheicon' // Custom font with fewest icons
+;; `all-the-icons-devicon' // Developer Icons
+;; `all-the-icons-faicon' // Font Awesome Icons
+;; `all-the-icons-fileicon' // File Icons from the Atom File Icons package
+;; `all-the-icons-octicon' // GitHub Octicons
+;; `all-the-icons-material' // Material Design Icons
+;; `all-the-icons-wicon' // Weather Icons
+
+;; You can call these functions with the icon name you want to insert, e.g.
+
+;; (all-the-icons-octicon "file-binary") // GitHub Octicon for Binary File
+;; (all-the-icons-faicon "cogs") // FontAwesome icon for cogs
+;; (all-the-icons-wicon "tornado") // Weather Icon for tornado
+
+;; A list of all the icon names for the different font families can be
+;; found in the data directory, or by inspecting the alist variables.
+;; All the alist variables are prefixed with `all-the-icons-data/'
+
+;;; Code:
+(require 'cl-lib)
+
+(require 'data-alltheicons "./data/data-alltheicons")
+(require 'data-faicons "./data/data-faicons")
+(require 'data-fileicons "./data/data-fileicons")
+(require 'data-octicons "./data/data-octicons")
+(require 'data-weathericons "./data/data-weathericons")
+(require 'data-material "./data/data-material")
+
+(require 'all-the-icons-faces)
+
+(defvar web-mode-content-type) ;silence byte-compiler warning
+;;; Custom Variables
+(defgroup all-the-icons nil
+ "Manage how All The Icons formats icons."
+ :prefix "all-the-icons-"
+ :group 'appearance
+ :group 'convenience)
+
+(defcustom all-the-icons-color-icons t
+ "Whether or not to include a foreground colour when formatting the icon."
+ :group 'all-the-icons
+ :type 'boolean)
+
+(defcustom all-the-icons-scale-factor 1.2
+ "The base Scale Factor for the `height' face property of an icon."
+ :group 'all-the-icons
+ :type 'number)
+
+(defcustom all-the-icons-default-adjust -0.2
+ "The default adjustment to be made to the `raise' display property of an icon."
+ :group 'all-the-icons
+ :type 'number)
+
+(defvar all-the-icons-font-families '() "List of defined icon font families.")
+(defvar all-the-icons-font-names '() "List of defined font file names this package was built with.")
+
+(defvar all-the-icons-extension-icon-alist
+ '(
+ ("fish" all-the-icons-alltheicon "terminal" :face all-the-icons-lpink)
+ ("zsh" all-the-icons-alltheicon "terminal" :face all-the-icons-lcyan)
+ ("sh" all-the-icons-alltheicon "terminal" :face all-the-icons-purple)
+ ;; Meta
+ ("tags" all-the-icons-octicon "tag" :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
+ ("log" all-the-icons-octicon "bug" :height 1.0 :v-adjust 0.0 :face all-the-icons-maroon)
+ ;; Config
+ ("node" all-the-icons-alltheicon "nodejs" :height 1.0 :face all-the-icons-green)
+ ("babelrc" all-the-icons-fileicon "babel" :face all-the-icons-yellow)
+ ("bashrc" all-the-icons-alltheicon "script" :height 0.9 :face all-the-icons-dpink)
+ ("bowerrc" all-the-icons-alltheicon "bower" :height 1.0 :v-adjust 0.0 :face all-the-icons-silver)
+ ("ini" all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-yellow)
+ ("eslintignore" all-the-icons-fileicon "eslint" :height 0.9 :face all-the-icons-purple)
+ ("eslint" all-the-icons-fileicon "eslint" :height 0.9 :face all-the-icons-lpurple)
+ ("git" all-the-icons-alltheicon "git" :height 1.0 :face all-the-icons-lred)
+ ("mk" all-the-icons-fileicon "gnu" :face all-the-icons-dorange)
+ ("cmake" all-the-icons-fileicon "cmake" :face all-the-icons-red)
+ ("dockerignore" all-the-icons-fileicon "dockerfile" :height 1.2 :face all-the-icons-dblue)
+ ("xml" all-the-icons-faicon "file-code-o" :height 0.95 :face all-the-icons-lorange)
+ ("json" all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-yellow)
+ ("cson" all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-yellow)
+ ("yml" all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-dyellow)
+ ("yaml" all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-dyellow)
+ ;; ?
+ ("pkg" all-the-icons-octicon "package" :v-adjust 0.0 :face all-the-icons-dsilver)
+ ("rpm" all-the-icons-octicon "package" :v-adjust 0.0 :face all-the-icons-dsilver)
+ ("elc" all-the-icons-octicon "file-binary" :v-adjust 0.0 :face all-the-icons-dsilver)
+ ("gz" all-the-icons-octicon "file-binary" :v-adjust 0.0 :face all-the-icons-lmaroon)
+ ("zip" all-the-icons-octicon "file-zip" :v-adjust 0.0 :face all-the-icons-lmaroon)
+ ("7z" all-the-icons-octicon "file-zip" :v-adjust 0.0 :face all-the-icons-lmaroon)
+ ("dat" all-the-icons-faicon "bar-chart" :face all-the-icons-cyan :height 0.9)
+ ("dmg" all-the-icons-octicon "tools" :v-adjust 0.0 :face all-the-icons-lsilver)
+ ("dll" all-the-icons-faicon "cogs" :face all-the-icons-silver)
+ ("ds_store" all-the-icons-faicon "cogs" :face all-the-icons-silver)
+ ;; Source Codes
+ ("scpt" all-the-icons-fileicon "apple" :face all-the-icons-pink)
+ ("aup" all-the-icons-fileicon "audacity" :face all-the-icons-yellow)
+ ("elm" all-the-icons-fileicon "elm" :face all-the-icons-blue)
+ ("erl" all-the-icons-alltheicon "erlang" :face all-the-icons-red :v-adjust -0.1 :height 0.9)
+ ("hrl" all-the-icons-alltheicon "erlang" :face all-the-icons-dred :v-adjust -0.1 :height 0.9)
+ ("eex" all-the-icons-alltheicon "elixir" :face all-the-icons-lorange :v-adjust -0.1 :height 0.9)
+ ("leex" all-the-icons-alltheicon "elixir" :face all-the-icons-lorange :v-adjust -0.1 :height 0.9)
+ ("heex" all-the-icons-alltheicon "elixir" :face all-the-icons-lorange :v-adjust -0.1 :height 0.9)
+ ("ex" all-the-icons-alltheicon "elixir" :face all-the-icons-lpurple :v-adjust -0.1 :height 0.9)
+ ("exs" all-the-icons-alltheicon "elixir" :face all-the-icons-lred :v-adjust -0.1 :height 0.9)
+ ("java" all-the-icons-alltheicon "java" :height 1.0 :face all-the-icons-purple)
+ ("gradle" all-the-icons-fileicon "gradle" :height 1.0 :face all-the-icons-silver)
+ ("ebuild" all-the-icons-fileicon "gentoo" :face all-the-icons-cyan)
+ ("eclass" all-the-icons-fileicon "gentoo" :face all-the-icons-blue)
+ ("go" all-the-icons-fileicon "go" :height 1.0 :face all-the-icons-blue)
+ ("jl" all-the-icons-fileicon "julia" :face all-the-icons-purple :v-adjust 0.0)
+ ("magik" all-the-icons-faicon "magic" :face all-the-icons-blue)
+ ("matlab" all-the-icons-fileicon "matlab" :face all-the-icons-orange)
+ ("nix" all-the-icons-fileicon "nix" :face all-the-icons-blue)
+ ("pl" all-the-icons-alltheicon "perl" :face all-the-icons-lorange)
+ ("pm" all-the-icons-alltheicon "perl" :face all-the-icons-lorange)
+ ("pl6" all-the-icons-fileicon "raku" :face all-the-icons-cyan)
+ ("pm6" all-the-icons-fileicon "raku" :face all-the-icons-pink)
+ ("pod" all-the-icons-alltheicon "perldocs" :height 1.2 :face all-the-icons-lgreen)
+ ("php" all-the-icons-fileicon "php" :face all-the-icons-lsilver)
+ ("pony" all-the-icons-fileicon "pony" :face all-the-icons-maroon)
+ ("ps1" all-the-icons-fileicon "powershell" :face all-the-icons-blue)
+ ("pro" all-the-icons-alltheicon "prolog" :height 1.1 :face all-the-icons-lmaroon)
+ ("proog" all-the-icons-alltheicon "prolog" :height 1.1 :face all-the-icons-lmaroon)
+ ("py" all-the-icons-alltheicon "python" :height 1.0 :face all-the-icons-dblue)
+ ("idr" all-the-icons-fileicon "idris" :face all-the-icons-red)
+ ("ipynb" all-the-icons-fileicon "jupyter" :height 1.0 :face all-the-icons-dorange)
+ ("gem" all-the-icons-alltheicon "ruby-alt" :face all-the-icons-red)
+ ("raku" all-the-icons-fileicon "raku" :face all-the-icons-cyan)
+ ("rakumod" all-the-icons-fileicon "raku" :face all-the-icons-pink)
+ ("rb" all-the-icons-octicon "ruby" :v-adjust 0.0 :face all-the-icons-lred)
+ ("rs" all-the-icons-alltheicon "rust" :height 1.2 :face all-the-icons-maroon)
+ ("rlib" all-the-icons-alltheicon "rust" :height 1.2 :face all-the-icons-dmaroon)
+ ("r" all-the-icons-fileicon "R" :face all-the-icons-lblue)
+ ("rd" all-the-icons-fileicon "R" :face all-the-icons-lblue)
+ ("rdx" all-the-icons-fileicon "R" :face all-the-icons-lblue)
+ ("rsx" all-the-icons-fileicon "R" :face all-the-icons-lblue)
+ ;; There seems to be a a bug with this font icon which does not
+ ;; let you propertise it without it reverting to being a lower
+ ;; case phi
+ ("c" all-the-icons-alltheicon "c-line" :face all-the-icons-blue)
+ ("h" all-the-icons-alltheicon "c-line" :face all-the-icons-purple)
+ ("m" all-the-icons-fileicon "apple" :v-adjust 0.0 :height 1.0)
+ ("mm" all-the-icons-fileicon "apple" :v-adjust 0.0 :height 1.0)
+ ;;
+ ("cc" all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-blue)
+ ("cpp" all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-blue)
+ ("cxx" all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-blue)
+ ("hh" all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-purple)
+ ("hpp" all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-purple)
+ ("hxx" all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-purple)
+ ;; Lisps
+ ("cl" all-the-icons-fileicon "clisp" :face all-the-icons-lorange)
+ ("l" all-the-icons-fileicon "lisp" :face all-the-icons-orange)
+ ("lisp" all-the-icons-fileicon "lisp" :face all-the-icons-orange)
+ ("hy" all-the-icons-fileicon "hy" :face all-the-icons-blue)
+ ("el" all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.2 :face all-the-icons-purple)
+ ("clj" all-the-icons-alltheicon "clojure-line" :height 1.0 :face all-the-icons-blue :v-adjust 0.0)
+ ("cljc" all-the-icons-alltheicon "clojure-line" :height 1.0 :face all-the-icons-blue :v-adjust 0.0)
+ ("cljs" all-the-icons-fileicon "cljs" :height 1.0 :face all-the-icons-dblue :v-adjust 0.0)
+ ("coffee" all-the-icons-alltheicon "coffeescript" :height 1.0 :face all-the-icons-maroon)
+ ("iced" all-the-icons-alltheicon "coffeescript" :height 1.0 :face all-the-icons-lmaroon)
+ ("dart" all-the-icons-fileicon "dart" :height 1.0 :face all-the-icons-blue :v-adjust 0.0)
+ ("rkt" all-the-icons-fileicon "racket" :height 1.2 :face all-the-icons-red)
+ ("scrbl" all-the-icons-fileicon "racket" :height 1.2 :face all-the-icons-blue)
+ ;; Stylesheeting
+ ("css" all-the-icons-alltheicon "css3" :face all-the-icons-yellow)
+ ("scss" all-the-icons-alltheicon "sass" :face all-the-icons-pink)
+ ("sass" all-the-icons-alltheicon "sass" :face all-the-icons-dpink)
+ ("less" all-the-icons-alltheicon "less" :height 0.8 :face all-the-icons-dyellow)
+ ("postcss" all-the-icons-fileicon "postcss" :face all-the-icons-dred)
+ ("sss" all-the-icons-fileicon "postcss" :face all-the-icons-dred)
+ ("styl" all-the-icons-alltheicon "stylus" :face all-the-icons-lgreen)
+ ("csv" all-the-icons-octicon "graph" :v-adjust 0.0 :face all-the-icons-dblue)
+ ;; haskell
+ ("hs" all-the-icons-alltheicon "haskell" :height 1.0 :face all-the-icons-red)
+ ("chs" all-the-icons-alltheicon "haskell" :height 1.0 :face all-the-icons-red)
+ ("lhs" all-the-icons-alltheicon "haskell" :height 1.0 :face all-the-icons-red)
+ ("hsc" all-the-icons-alltheicon "haskell" :height 1.0 :face all-the-icons-red)
+ ;; Web modes
+ ("inky-haml" all-the-icons-fileicon "haml" :face all-the-icons-lyellow)
+ ("haml" all-the-icons-fileicon "haml" :face all-the-icons-lyellow)
+ ("htm" all-the-icons-alltheicon "html5" :face all-the-icons-orange)
+ ("html" all-the-icons-alltheicon "html5" :face all-the-icons-orange)
+ ("inky-er" all-the-icons-alltheicon "html5" :face all-the-icons-lred)
+ ("inky-erb" all-the-icons-alltheicon "html5" :face all-the-icons-lred)
+ ("erb" all-the-icons-alltheicon "html5" :face all-the-icons-lred)
+ ("hbs" all-the-icons-fileicon "moustache" :face all-the-icons-green)
+ ("inky-slim" all-the-icons-octicon "dashboard" :v-adjust 0.0 :face all-the-icons-yellow)
+ ("slim" all-the-icons-octicon "dashboard" :v-adjust 0.0 :face all-the-icons-yellow)
+ ("jade" all-the-icons-fileicon "jade" :face all-the-icons-red)
+ ("pug" all-the-icons-fileicon "pug-alt" :face all-the-icons-red)
+ ;; Javascript
+ ("d3js" all-the-icons-alltheicon "d3" :height 0.8 :face all-the-icons-lgreen)
+ ("re" all-the-icons-fileicon "reason" :height 1.0 :face all-the-icons-red-alt)
+ ("rei" all-the-icons-fileicon "reason" :height 1.0 :face all-the-icons-dred)
+ ("ml" all-the-icons-fileicon "ocaml" :height 1.0 :face all-the-icons-lpink)
+ ("mli" all-the-icons-fileicon "ocaml" :height 1.0 :face all-the-icons-dpink)
+ ("react" all-the-icons-alltheicon "react" :height 1.1 :face all-the-icons-lblue)
+ ("ts" all-the-icons-fileicon "typescript" :height 1.0 :v-adjust -0.1 :face all-the-icons-blue-alt)
+ ("js" all-the-icons-alltheicon "javascript" :height 1.0 :v-adjust 0.0 :face all-the-icons-yellow)
+ ("es" all-the-icons-alltheicon "javascript" :height 1.0 :v-adjust 0.0 :face all-the-icons-yellow)
+ ("jsx" all-the-icons-fileicon "jsx-2" :height 1.0 :v-adjust -0.1 :face all-the-icons-cyan-alt)
+ ("tsx" all-the-icons-fileicon "tsx" :height 1.0 :v-adjust -0.1 :face all-the-icons-cyan-alt)
+ ("njs" all-the-icons-alltheicon "nodejs" :height 1.2 :face all-the-icons-lgreen)
+ ("vue" all-the-icons-fileicon "vue" :face all-the-icons-lgreen)
+
+ ("sbt" all-the-icons-fileicon "sbt" :face all-the-icons-red)
+ ("scala" all-the-icons-alltheicon "scala" :face all-the-icons-red)
+ ("scm" all-the-icons-fileicon "scheme" :height 1.2 :face all-the-icons-red)
+ ("swift" all-the-icons-alltheicon "swift" :height 1.0 :v-adjust -0.1 :face all-the-icons-green)
+
+ ("tcl" all-the-icons-fileicon "tcl" :height 1.0 :face all-the-icons-dred)
+
+ ("tf" all-the-icons-fileicon "terraform" :height 1.0 :face all-the-icons-purple-alt)
+ ("tfvars" all-the-icons-fileicon "terraform" :height 1.0 :face all-the-icons-purple-alt)
+ ("tfstate" all-the-icons-fileicon "terraform" :height 1.0 :face all-the-icons-purple-alt)
+
+ ("asm" all-the-icons-fileicon "assembly" :height 1.0 :face all-the-icons-blue)
+ ;; Verilog(-AMS) and SystemVerilog(-AMS)
+ ("v" all-the-icons-fileicon "verilog" :height 1.0 :v-adjust -0.2 :face all-the-icons-red)
+ ("vams" all-the-icons-fileicon "verilog" :height 1.0 :v-adjust -0.2 :face all-the-icons-red)
+ ("sv" all-the-icons-fileicon "verilog" :height 1.0 :v-adjust -0.2 :face all-the-icons-red)
+ ("sva" all-the-icons-fileicon "verilog" :height 1.0 :v-adjust -0.2 :face all-the-icons-red)
+ ("svh" all-the-icons-fileicon "verilog" :height 1.0 :v-adjust -0.2 :face all-the-icons-red)
+ ("svams" all-the-icons-fileicon "verilog" :height 1.0 :v-adjust -0.2 :face all-the-icons-red)
+ ;; VHDL(-AMS)
+ ("vhd" all-the-icons-fileicon "vhdl" :face all-the-icons-blue)
+ ("vhdl" all-the-icons-fileicon "vhdl" :face all-the-icons-blue)
+ ("vhms" all-the-icons-fileicon "vhdl" :face all-the-icons-blue)
+ ;; Cabal
+ ("cabal" all-the-icons-fileicon "cabal" :face all-the-icons-lblue)
+ ;; Kotlin
+ ("kt" all-the-icons-fileicon "kotlin" :face all-the-icons-orange)
+ ("kts" all-the-icons-fileicon "kotlin" :face all-the-icons-orange)
+ ;; Nimrod
+ ("nim" all-the-icons-fileicon "nimrod" :face all-the-icons-yellow)
+ ("nims" all-the-icons-fileicon "nimrod" :face all-the-icons-yellow)
+ ;; SQL
+ ("sql" all-the-icons-octicon "database" :face all-the-icons-silver)
+ ;; Styles
+ ("styles" all-the-icons-material "style" :face all-the-icons-red)
+ ;; Lua
+ ("lua" all-the-icons-fileicon "lua" :face all-the-icons-dblue)
+ ;; ASCII doc
+ ("adoc" all-the-icons-fileicon "asciidoc" :face all-the-icons-lblue)
+ ("asciidoc" all-the-icons-fileicon "asciidoc" :face all-the-icons-lblue)
+ ;; Puppet
+ ("pp" all-the-icons-fileicon "puppet" :face all-the-icons-yellow)
+ ;; Jinja
+ ("j2" all-the-icons-fileicon "jinja" :face all-the-icons-silver)
+ ("jinja2" all-the-icons-fileicon "jinja" :face all-the-icons-silver)
+ ;; Docker
+ ("dockerfile" all-the-icons-fileicon "dockerfile" :face all-the-icons-cyan)
+ ;; Vagrant
+ ("vagrantfile" all-the-icons-fileicon "vagrant" :face all-the-icons-blue)
+ ;; GLSL
+ ("glsl" all-the-icons-fileicon "vertex-shader" :face all-the-icons-blue)
+ ("vert" all-the-icons-fileicon "vertex-shader" :face all-the-icons-blue)
+ ("tesc" all-the-icons-fileicon "vertex-shader" :face all-the-icons-purple)
+ ("tese" all-the-icons-fileicon "vertex-shader" :face all-the-icons-dpurple)
+ ("geom" all-the-icons-fileicon "vertex-shader" :face all-the-icons-green)
+ ("frag" all-the-icons-fileicon "vertex-shader" :face all-the-icons-red)
+ ("comp" all-the-icons-fileicon "vertex-shader" :face all-the-icons-dblue)
+ ;; CUDA
+ ("cu" all-the-icons-fileicon "nvidia" :face all-the-icons-green)
+ ("cuh" all-the-icons-fileicon "nvidia" :face all-the-icons-green)
+ ;; Fortran
+ ("f90" all-the-icons-fileicon "fortran" :face all-the-icons-purple)
+ ;; C#
+ ("cs" all-the-icons-alltheicon "csharp-line" :face all-the-icons-dblue)
+ ("csx" all-the-icons-alltheicon "csharp-line" :face all-the-icons-dblue)
+ ;; F#
+ ("fs" all-the-icons-fileicon "fsharp" :face all-the-icons-blue-alt)
+ ("fsi" all-the-icons-fileicon "fsharp" :face all-the-icons-blue-alt)
+ ("fsx" all-the-icons-fileicon "fsharp" :face all-the-icons-blue-alt)
+ ("fsscript" all-the-icons-fileicon "fsharp" :face all-the-icons-blue-alt)
+ ;; zig
+ ("zig" all-the-icons-fileicon "zig" :face all-the-icons-orange)
+ ;; File Types
+ ("ico" all-the-icons-octicon "file-media" :v-adjust 0.0 :face all-the-icons-blue)
+ ("png" all-the-icons-octicon "file-media" :v-adjust 0.0 :face all-the-icons-orange)
+ ("gif" all-the-icons-octicon "file-media" :v-adjust 0.0 :face all-the-icons-green)
+ ("jpeg" all-the-icons-octicon "file-media" :v-adjust 0.0 :face all-the-icons-dblue)
+ ("jpg" all-the-icons-octicon "file-media" :v-adjust 0.0 :face all-the-icons-dblue)
+ ("webp" all-the-icons-octicon "file-media" :v-adjust 0.0 :face all-the-icons-dblue)
+ ;; Audio
+ ("mp3" all-the-icons-faicon "volume-up" :face all-the-icons-dred)
+ ("wav" all-the-icons-faicon "volume-up" :face all-the-icons-dred)
+ ("m4a" all-the-icons-faicon "volume-up" :face all-the-icons-dred)
+ ("ogg" all-the-icons-faicon "volume-up" :face all-the-icons-dred)
+ ("flac" all-the-icons-faicon "volume-up" :face all-the-icons-dred)
+ ("opus" all-the-icons-faicon "volume-up" :face all-the-icons-dred)
+ ("au" all-the-icons-faicon "volume-up" :face all-the-icons-dred)
+ ("aif" all-the-icons-faicon "volume-up" :face all-the-icons-dred)
+ ("aifc" all-the-icons-faicon "volume-up" :face all-the-icons-dred)
+ ("aiff" all-the-icons-faicon "volume-up" :face all-the-icons-dred)
+ ("svg" all-the-icons-alltheicon "svg" :height 0.9 :face all-the-icons-lgreen)
+ ;; Video
+ ("mov" all-the-icons-faicon "film" :face all-the-icons-blue)
+ ("mp4" all-the-icons-faicon "film" :face all-the-icons-blue)
+ ("ogv" all-the-icons-faicon "film" :face all-the-icons-dblue)
+ ("mpg" all-the-icons-faicon "film" :face all-the-icons-blue)
+ ("mpeg" all-the-icons-faicon "film" :face all-the-icons-blue)
+ ("flv" all-the-icons-faicon "film" :face all-the-icons-blue)
+ ("ogv" all-the-icons-faicon "film" :face all-the-icons-dblue)
+ ("mkv" all-the-icons-faicon "film" :face all-the-icons-blue)
+ ("webm" all-the-icons-faicon "film" :face all-the-icons-blue)
+ ;; Fonts
+ ("ttf" all-the-icons-fileicon "font" :v-adjust 0.0 :face all-the-icons-dcyan)
+ ("woff" all-the-icons-fileicon "font" :v-adjust 0.0 :face all-the-icons-cyan)
+ ("woff2" all-the-icons-fileicon "font" :v-adjust 0.0 :face all-the-icons-cyan)
+ ;; Doc
+ ("pdf" all-the-icons-octicon "file-pdf" :v-adjust 0.0 :face all-the-icons-dred)
+ ("text" all-the-icons-octicon "file-text" :v-adjust 0.0 :face all-the-icons-cyan)
+ ("txt" all-the-icons-octicon "file-text" :v-adjust 0.0 :face all-the-icons-cyan)
+ ("doc" all-the-icons-fileicon "word" :face all-the-icons-blue)
+ ("docx" all-the-icons-fileicon "word" :face all-the-icons-blue)
+ ("docm" all-the-icons-fileicon "word" :face all-the-icons-blue)
+ ("texi" all-the-icons-fileicon "tex" :face all-the-icons-lred)
+ ("tex" all-the-icons-fileicon "tex" :face all-the-icons-lred)
+ ("md" all-the-icons-octicon "markdown" :v-adjust 0.0 :face all-the-icons-lblue)
+ ("bib" all-the-icons-fileicon "bib" :face all-the-icons-maroon)
+ ("org" all-the-icons-fileicon "org" :face all-the-icons-lgreen)
+ ("pps" all-the-icons-fileicon "powerpoint" :face all-the-icons-orange)
+ ("ppt" all-the-icons-fileicon "powerpoint" :face all-the-icons-orange)
+ ("pptsx" all-the-icons-fileicon "powerpoint" :face all-the-icons-orange)
+ ("ppttx" all-the-icons-fileicon "powerpoint" :face all-the-icons-orange)
+ ("knt" all-the-icons-fileicon "powerpoint" :face all-the-icons-cyan)
+ ("xlsx" all-the-icons-fileicon "excel" :face all-the-icons-dgreen)
+ ("xlsm" all-the-icons-fileicon "excel" :face all-the-icons-dgreen)
+ ("xlsb" all-the-icons-fileicon "excel" :face all-the-icons-dgreen)
+ ("xltx" all-the-icons-fileicon "excel" :face all-the-icons-dgreen)
+ ("xltm" all-the-icons-fileicon "excel" :face all-the-icons-dgreen)
+ ("ly" all-the-icons-faicon "music" :face all-the-icons-green)
+ ;;
+ ("key" all-the-icons-octicon "key" :v-adjust 0.0 :face all-the-icons-lblue)
+ ("pem" all-the-icons-octicon "key" :v-adjust 0.0 :face all-the-icons-orange)
+ ("p12" all-the-icons-octicon "key" :v-adjust 0.0 :face all-the-icons-dorange)
+ ("crt" all-the-icons-octicon "key" :v-adjust 0.0 :face all-the-icons-lblue)
+ ("pub" all-the-icons-octicon "key" :v-adjust 0.0 :face all-the-icons-blue)
+ ("gpg" all-the-icons-octicon "key" :v-adjust 0.0 :face all-the-icons-lblue)
+ ("cache" all-the-icons-octicon "database" :height 1.0 :v-adjust 0.0 :face all-the-icons-green)))
+
+
+(define-obsolete-variable-alias 'all-the-icons-icon-alist
+ 'all-the-icons-regexp-icon-alist
+ "5.0.0"
+ "`all-the-icons-icon-alist' has been split to
+`all-the-icons-extension-icon-alist' and `all-the-icons-regexp-icon-alist'
+for performance sake.")
+
+(defvar all-the-icons-regexp-icon-alist
+ '(
+ ;;
+ ("^TAGS$" all-the-icons-octicon "tag" :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
+ ("^TODO$" all-the-icons-octicon "checklist" :v-adjust 0.0 :face all-the-icons-lyellow)
+ ("^LICENSE$" all-the-icons-octicon "book" :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
+ ("^readme" all-the-icons-octicon "book" :height 1.0 :v-adjust 0.0 :face all-the-icons-lcyan)
+
+ ;; Config
+ ("^bower.json$" all-the-icons-alltheicon "bower" :height 1.0 :v-adjust 0.0 :face all-the-icons-lorange)
+ ("nginx$" all-the-icons-fileicon "nginx" :height 0.9 :face all-the-icons-dgreen)
+ ("apache$" all-the-icons-alltheicon "apache" :height 0.9 :face all-the-icons-dgreen)
+ ("^Makefile$" all-the-icons-fileicon "gnu" :face all-the-icons-dorange)
+ ("^CMakeLists.txt$" all-the-icons-fileicon "cmake" :face all-the-icons-red)
+ ("^CMakeCache.txt$" all-the-icons-fileicon "cmake" :face all-the-icons-blue)
+
+ ("^\\.?Dockerfile" all-the-icons-fileicon "dockerfile" :face all-the-icons-blue)
+ ("^Brewfile$" all-the-icons-faicon "beer" :face all-the-icons-lsilver)
+ ("\\.npmignore$" all-the-icons-fileicon "npm" :face all-the-icons-dred)
+ ("^package.json$" all-the-icons-fileicon "npm" :face all-the-icons-red)
+ ("^package.lock.json$" all-the-icons-fileicon "npm" :face all-the-icons-dred)
+ ("^yarn\\.lock" all-the-icons-fileicon "yarn" :face all-the-icons-blue-alt)
+
+ ;; ;; AWS
+ ("^stack.*.json$" all-the-icons-alltheicon "aws" :face all-the-icons-orange)
+
+
+ ("^serverless\\.yml$" all-the-icons-faicon "bolt" :v-adjust 0.0 :face all-the-icons-yellow)
+
+ ;; lock files
+ ("~$" all-the-icons-octicon "lock" :v-adjust 0.0 :face all-the-icons-maroon)
+
+ ;; Source Codes
+ ("^mix.lock$" all-the-icons-alltheicon "elixir" :face all-the-icons-lyellow :v-adjust -0.1 :height 0.9)
+
+ ("^Gemfile\\(\\.lock\\)?$" all-the-icons-alltheicon "ruby-alt" :face all-the-icons-red)
+ ("_?test\\.rb$" all-the-icons-fileicon "test-ruby" :height 1.0 :v-adjust 0.0 :face all-the-icons-red)
+ ("_?test_helper\\.rb$" all-the-icons-fileicon "test-ruby" :height 1.0 :v-adjust 0.0 :face all-the-icons-dred)
+ ("_?spec\\.rb$" all-the-icons-fileicon "test-ruby" :height 1.0 :v-adjust 0.0 :face all-the-icons-red)
+ ("_?spec_helper\\.rb$" all-the-icons-fileicon "test-ruby" :height 1.0 :v-adjust 0.0 :face all-the-icons-dred)
+
+ ("-?spec\\.ts$" all-the-icons-fileicon "test-typescript" :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
+ ("-?test\\.ts$" all-the-icons-fileicon "test-typescript" :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
+ ("-?spec\\.js$" all-the-icons-fileicon "test-js" :height 1.0 :v-adjust 0.0 :face all-the-icons-lpurple)
+ ("-?test\\.js$" all-the-icons-fileicon "test-js" :height 1.0 :v-adjust 0.0 :face all-the-icons-lpurple)
+ ("-?spec\\.jsx$" all-the-icons-fileicon "test-react" :height 1.0 :v-adjust 0.0 :face all-the-icons-blue-alt)
+ ("-?test\\.jsx$" all-the-icons-fileicon "test-react" :height 1.0 :v-adjust 0.0 :face all-the-icons-blue-alt)
+
+ ;; Git
+ ("^MERGE_" all-the-icons-octicon "git-merge" :v-adjust 0.0 :face all-the-icons-red)
+ ("^COMMIT_EDITMSG" all-the-icons-octicon "git-commit" :v-adjust 0.0 :face all-the-icons-red)
+
+ ;; Stylesheeting
+ ("stylelint" all-the-icons-fileicon "stylelint" :face all-the-icons-lyellow)
+ ;; JavaScript
+ ("^gulpfile" all-the-icons-alltheicon "gulp" :height 1.0 :face all-the-icons-lred)
+ ("^gruntfile" all-the-icons-alltheicon "grunt" :height 1.0 :v-adjust -0.1 :face all-the-icons-lyellow)
+ ("^webpack" all-the-icons-fileicon "webpack" :face all-the-icons-lblue)
+
+ ("bookmark" all-the-icons-octicon "bookmark" :height 1.1 :v-adjust 0.0 :face all-the-icons-lpink)
+
+ ("^\\*scratch\\*$" all-the-icons-faicon "sticky-note" :face all-the-icons-lyellow)
+ ("^\\*scratch.*" all-the-icons-faicon "sticky-note" :face all-the-icons-yellow)
+ ("^\\*new-tab\\*$" all-the-icons-material "star" :face all-the-icons-cyan)
+
+ ("^\\." all-the-icons-octicon "gear" :v-adjust 0.0)
+ ))
+
+(defvar all-the-icons-default-file-icon
+ '(all-the-icons-faicon "file-o" :v-adjust 0.0 :face all-the-icons-dsilver))
+
+(defvar all-the-icons-dir-icon-alist
+ '(
+ ("trash" all-the-icons-faicon "trash-o" :height 1.2 :v-adjust -0.1)
+ ("dropbox" all-the-icons-faicon "dropbox" :height 1.0 :v-adjust -0.1)
+ ("google[ _-]drive" all-the-icons-alltheicon "google-drive" :height 1.0 :v-adjust -0.1)
+ ("^atom$" all-the-icons-alltheicon "atom" :height 1.2 :v-adjust -0.1)
+ ("documents" all-the-icons-faicon "book" :height 1.0 :v-adjust -0.1)
+ ("download" all-the-icons-faicon "cloud-download" :height 0.9 :v-adjust -0.1)
+ ("desktop" all-the-icons-octicon "device-desktop" :height 1.0 :v-adjust -0.1)
+ ("pictures" all-the-icons-faicon "picture-o" :height 0.9 :v-adjust -0.2)
+ ("photos" all-the-icons-faicon "camera-retro" :height 1.0 :v-adjust -0.1)
+ ("music" all-the-icons-faicon "music" :height 1.0 :v-adjust -0.1)
+ ("movies" all-the-icons-faicon "film" :height 0.9 :v-adjust -0.1)
+ ("code" all-the-icons-octicon "code" :height 1.1 :v-adjust -0.1)
+ ("workspace" all-the-icons-octicon "code" :height 1.1 :v-adjust -0.1)
+ ("test" all-the-icons-fileicon "test-dir" :height 0.9)
+ ("\\.git" all-the-icons-alltheicon "git" :height 1.0)
+ (".?" all-the-icons-octicon "file-directory" :height 1.0 :v-adjust -0.1)
+ ))
+
+(defvar all-the-icons-weather-icon-alist
+ '(
+ ("tornado" all-the-icons-wicon "tornado")
+ ("hurricane" all-the-icons-wicon "hurricane")
+ ("thunderstorms" all-the-icons-wicon "thunderstorm")
+ ("sunny" all-the-icons-wicon "day-sunny")
+ ("rain.*snow" all-the-icons-wicon "rain-mix")
+ ("rain.*hail" all-the-icons-wicon "rain-mix")
+ ("sleet" all-the-icons-wicon "sleet")
+ ("hail" all-the-icons-wicon "hail")
+ ("drizzle" all-the-icons-wicon "sprinkle")
+ ("rain" all-the-icons-wicon "showers" :height 1.1 :v-adjust 0.0)
+ ("showers" all-the-icons-wicon "showers")
+ ("blowing.*snow" all-the-icons-wicon "snow-wind")
+ ("snow" all-the-icons-wicon "snow")
+ ("dust" all-the-icons-wicon "dust")
+ ("fog" all-the-icons-wicon "fog")
+ ("haze" all-the-icons-wicon "day-haze")
+ ("smoky" all-the-icons-wicon "smoke")
+ ("blustery" all-the-icons-wicon "cloudy-windy")
+ ("windy" all-the-icons-wicon "cloudy-gusts")
+ ("cold" all-the-icons-wicon "snowflake-cold")
+ ("partly.*cloudy.*night" all-the-icons-wicon "night-alt-partly-cloudy")
+ ("partly.*cloudy" all-the-icons-wicon "day-cloudy-high")
+ ("cloudy.*night" all-the-icons-wicon "night-alt-cloudy")
+ ("cxloudy.*day" all-the-icons-wicon "day-cloudy")
+ ("cloudy" all-the-icons-wicon "cloudy")
+ ("clear.*night" all-the-icons-wicon "night-clear")
+ ("fair.*night" all-the-icons-wicon "stars")
+ ("fair.*day" all-the-icons-wicon "horizon")
+ ("hot" all-the-icons-wicon "hot")
+ ("not.*available" all-the-icons-wicon "na")
+ ))
+
+(defvar all-the-icons-mode-icon-alist
+ '(
+ (emacs-lisp-mode all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1 :face all-the-icons-purple)
+ (circe-server-mode all-the-icons-faicon "commenting-o" :height 1.0 :v-adjust 0.0)
+ (circe-channel-mode all-the-icons-faicon "commenting-o" :height 1.0 :v-adjust 0.0)
+ (erc-mode all-the-icons-faicon "commenting-o" :height 1.0 :v-adjust 0.0)
+ (inferior-emacs-lisp-mode all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1 :face all-the-icons-lblue)
+ (dired-mode all-the-icons-octicon "file-directory" :v-adjust 0.0)
+ (lisp-interaction-mode all-the-icons-fileicon "lisp" :v-adjust -0.1 :face all-the-icons-orange)
+ (sly-mrepl-mode all-the-icons-fileicon "clisp" :v-adjust -0.1 :face all-the-icons-orange)
+ (slime-repl-mode all-the-icons-fileicon "clisp" :v-adjust -0.1 :face all-the-icons-orange)
+ (org-mode all-the-icons-fileicon "org" :v-adjust 0.0 :face all-the-icons-lgreen)
+ (typescript-mode all-the-icons-fileicon "typescript" :v-adjust -0.1 :face all-the-icons-blue-alt)
+ (typescript-tsx-mode all-the-icons-fileicon "tsx" :v-adjust -0.1 :face all-the-icons-cyan-alt)
+ (js-mode all-the-icons-alltheicon "javascript" :v-adjust -0.1 :face all-the-icons-yellow)
+ (js-jsx-mode all-the-icons-alltheicon "javascript" :v-adjust -0.1 :face all-the-icons-yellow)
+ (js2-mode all-the-icons-alltheicon "javascript" :v-adjust -0.1 :face all-the-icons-yellow)
+ (js3-mode all-the-icons-alltheicon "javascript" :v-adjust -0.1 :face all-the-icons-yellow)
+ (rjsx-mode all-the-icons-fileicon "jsx-2" :v-adjust -0.1 :face all-the-icons-cyan-alt)
+ (term-mode all-the-icons-octicon "terminal" :v-adjust 0.2)
+ (vterm-mode all-the-icons-octicon "terminal" :v-adjust 0.2)
+ (eshell-mode all-the-icons-octicon "terminal" :v-adjust 0.0 :face all-the-icons-purple)
+ (magit-refs-mode all-the-icons-octicon "git-branch" :v-adjust 0.0 :face all-the-icons-red)
+ (magit-process-mode all-the-icons-octicon "mark-github" :v-adjust 0.0)
+ (magit-diff-mode all-the-icons-octicon "git-compare" :v-adjust 0.0 :face all-the-icons-lblue)
+ (ediff-mode all-the-icons-octicon "git-compare" :v-adjust 0.0 :Face all-the-icons-red)
+ (comint-mode all-the-icons-faicon "terminal" :v-adjust 0.0 :face all-the-icons-lblue)
+ (eww-mode all-the-icons-faicon "firefox" :v-adjust -0.1 :face all-the-icons-red)
+ (org-agenda-mode all-the-icons-octicon "checklist" :v-adjust 0.0 :face all-the-icons-lgreen)
+ (cfw:calendar-mode all-the-icons-octicon "calendar" :v-adjust 0.0)
+ (ibuffer-mode all-the-icons-faicon "files-o" :v-adjust 0.0 :face all-the-icons-dsilver)
+ (messages-buffer-mode all-the-icons-faicon "file-o" :v-adjust 0.0 :face all-the-icons-dsilver)
+ (help-mode all-the-icons-faicon "info" :v-adjust -0.1 :face all-the-icons-purple)
+ (benchmark-init/tree-mode all-the-icons-octicon "dashboard" :v-adjust 0.0)
+ (jenkins-mode all-the-icons-fileicon "jenkins" :face all-the-icons-blue)
+ (magit-popup-mode all-the-icons-alltheicon "git" :face all-the-icons-red)
+ (magit-status-mode all-the-icons-alltheicon "git" :face all-the-icons-lred)
+ (magit-log-mode all-the-icons-alltheicon "git" :face all-the-icons-green)
+ (mu4e-compose-mode all-the-icons-octicon "pencil" :v-adjust 0.0)
+ (mu4e-headers-mode all-the-icons-octicon "mail" :v-adjust 0.0)
+ (mu4e-main-mode all-the-icons-octicon "mail" :v-adjust 0.0)
+ (mu4e-view-mode all-the-icons-octicon "mail-read" :v-adjust 0.0)
+ (package-menu-mode all-the-icons-faicon "archive" :height 1.0 :v-adjust 0.0 :face all-the-icons-silver)
+ (paradox-menu-mode all-the-icons-faicon "archive" :height 1.0 :v-adjust 0.0 :face all-the-icons-silver)
+ (Custom-mode all-the-icons-octicon "settings" :v-adjust -0.1)
+
+ ;; Special matcher for Web Mode based on the `web-mode-content-type' of the current buffer
+ (web-mode all-the-icons--web-mode-icon)
+
+ (fundamental-mode all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1 :face all-the-icons-dsilver)
+ (special-mode all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1 :face all-the-icons-yellow)
+ (text-mode all-the-icons-octicon "file-text" :v-adjust 0.0 :face all-the-icons-cyan)
+ (enh-ruby-mode all-the-icons-alltheicon "ruby-alt" :face all-the-icons-lred)
+ (ruby-mode all-the-icons-alltheicon "ruby-alt" :face all-the-icons-lred)
+ (inf-ruby-mode all-the-icons-alltheicon "ruby-alt" :face all-the-icons-red)
+ (projectile-rails-compilation-mode all-the-icons-alltheicon "ruby-alt" :face all-the-icons-red)
+ (rspec-compilation-mode all-the-icons-alltheicon "ruby-alt" :face all-the-icons-red)
+ (rake-compilation-mode all-the-icons-alltheicon "ruby-alt" :face all-the-icons-red)
+ (sh-mode all-the-icons-alltheicon "terminal" :face all-the-icons-purple)
+ (shell-mode all-the-icons-alltheicon "terminal" :face all-the-icons-purple)
+ (fish-mode all-the-icons-alltheicon "terminal" :face all-the-icons-lpink)
+ (nginx-mode all-the-icons-fileicon "nginx" :height 0.9 :face all-the-icons-dgreen)
+ (apache-mode all-the-icons-alltheicon "apache" :height 0.9 :face all-the-icons-dgreen)
+ (makefile-mode all-the-icons-fileicon "gnu" :face all-the-icons-dorange)
+ (cmake-mode all-the-icons-fileicon "cmake" :face all-the-icons-red)
+ (dockerfile-mode all-the-icons-fileicon "dockerfile" :face all-the-icons-blue)
+ (docker-compose-mode all-the-icons-fileicon "dockerfile" :face all-the-icons-lblue)
+ (nxml-mode all-the-icons-faicon "file-code-o" :height 0.95 :face all-the-icons-lorange)
+ (json-mode all-the-icons-octicon "settings" :face all-the-icons-yellow)
+ (yaml-mode all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-dyellow)
+ (elisp-byte-code-mode all-the-icons-octicon "file-binary" :v-adjust 0.0 :face all-the-icons-dsilver)
+ (archive-mode all-the-icons-octicon "file-zip" :v-adjust 0.0 :face all-the-icons-lmaroon)
+ (elm-mode all-the-icons-fileicon "elm" :face all-the-icons-blue)
+ (erlang-mode all-the-icons-alltheicon "erlang" :face all-the-icons-red :v-adjust -0.1 :height 0.9)
+ (elixir-mode all-the-icons-alltheicon "elixir" :face all-the-icons-lorange :v-adjust -0.1 :height 0.9)
+ (java-mode all-the-icons-alltheicon "java" :height 1.0 :face all-the-icons-purple)
+ (go-mode all-the-icons-fileicon "go" :height 1.0 :face all-the-icons-blue)
+ (matlab-mode all-the-icons-fileicon "matlab" :face all-the-icons-orange)
+ (nix-mode all-the-icons-fileicon "nix" :face all-the-icons-blue)
+ (perl-mode all-the-icons-alltheicon "perl" :face all-the-icons-lorange)
+ (cperl-mode all-the-icons-alltheicon "perl" :face all-the-icons-lorange)
+ (php-mode all-the-icons-fileicon "php" :face all-the-icons-lsilver)
+ (prolog-mode all-the-icons-alltheicon "prolog" :height 1.1 :face all-the-icons-lmaroon)
+ (python-mode all-the-icons-alltheicon "python" :height 1.0 :face all-the-icons-dblue)
+ (inferior-python-mode all-the-icons-alltheicon "python" :height 1.0 :face all-the-icons-dblue)
+ (racket-mode all-the-icons-fileicon "racket" :height 1.2 :face all-the-icons-red)
+ (rust-mode all-the-icons-alltheicon "rust" :height 1.2 :face all-the-icons-maroon)
+ (scala-mode all-the-icons-alltheicon "scala" :face all-the-icons-red)
+ (scheme-mode all-the-icons-fileicon "scheme" :height 1.2 :face all-the-icons-red)
+ (swift-mode all-the-icons-alltheicon "swift" :height 1.0 :v-adjust -0.1 :face all-the-icons-green)
+ (c-mode all-the-icons-alltheicon "c-line" :face all-the-icons-blue)
+ (c++-mode all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-blue)
+ (csharp-mode all-the-icons-alltheicon "csharp-line" :face all-the-icons-dblue)
+ (clojure-mode all-the-icons-alltheicon "clojure" :height 1.0 :face all-the-icons-blue)
+ (cider-repl-mode all-the-icons-alltheicon "clojure" :height 1.0 :face all-the-icons-green)
+ (clojurescript-mode all-the-icons-fileicon "cljs" :height 1.0 :face all-the-icons-dblue)
+ (coffee-mode all-the-icons-alltheicon "coffeescript" :height 1.0 :face all-the-icons-maroon)
+ (lisp-mode all-the-icons-fileicon "lisp" :face all-the-icons-orange)
+ (css-mode all-the-icons-alltheicon "css3" :face all-the-icons-yellow)
+ (scss-mode all-the-icons-alltheicon "sass" :face all-the-icons-pink)
+ (sass-mode all-the-icons-alltheicon "sass" :face all-the-icons-dpink)
+ (less-css-mode all-the-icons-alltheicon "less" :height 0.8 :face all-the-icons-dyellow)
+ (stylus-mode all-the-icons-alltheicon "stylus" :face all-the-icons-lgreen)
+ (csv-mode all-the-icons-octicon "graph" :v-adjust 0.0 :face all-the-icons-dblue)
+ (haskell-mode all-the-icons-alltheicon "haskell" :height 1.0 :face all-the-icons-red)
+ (haskell-c2hs-mode all-the-icons-alltheicon "haskell" :height 1.0 :face all-the-icons-red)
+ (literate-haskell-mode all-the-icons-alltheicon "haskell" :height 1.0 :face all-the-icons-red)
+ (haml-mode all-the-icons-fileicon "haml" :face all-the-icons-lyellow)
+ (html-mode all-the-icons-alltheicon "html5" :face all-the-icons-orange)
+ (rhtml-mode all-the-icons-alltheicon "html5" :face all-the-icons-lred)
+ (mustache-mode all-the-icons-fileicon "moustache" :face all-the-icons-green)
+ (slim-mode all-the-icons-octicon "dashboard" :v-adjust 0.0 :face all-the-icons-yellow)
+ (jade-mode all-the-icons-fileicon "jade" :face all-the-icons-red)
+ (pug-mode all-the-icons-fileicon "pug" :face all-the-icons-red)
+ (react-mode all-the-icons-alltheicon "react" :height 1.1 :face all-the-icons-lblue)
+ (image-mode all-the-icons-octicon "file-media" :v-adjust 0.0 :face all-the-icons-blue)
+ (texinfo-mode all-the-icons-fileicon "tex" :face all-the-icons-lred)
+ (markdown-mode all-the-icons-octicon "markdown" :v-adjust 0.0 :face all-the-icons-lblue)
+ (bibtex-mode all-the-icons-fileicon "bib" :face all-the-icons-maroon)
+ (org-mode all-the-icons-fileicon "org" :face all-the-icons-lgreen)
+ (compilation-mode all-the-icons-faicon "cogs" :v-adjust 0.0 :height 1.0)
+ (objc-mode all-the-icons-faicon "apple" :v-adjust 0.0 :height 1.0)
+ (tuareg-mode all-the-icons-fileicon "ocaml" :v-adjust 0.0 :height 1.0)
+ (purescript-mode all-the-icons-fileicon "purescript" :v-adjust 0.0 :height 1.0)
+ (verilog-mode all-the-icons-fileicon "verilog" :height 1.0 :v-adjust -0.2 :face all-the-icons-red)
+ (vhdl-mode all-the-icons-fileicon "vhdl" :face all-the-icons-blue)
+ (haskell-cabal-mode all-the-icons-fileicon "cabal" :face all-the-icons-lblue)
+ (kotlin-mode all-the-icons-fileicon "kotlin" :face all-the-icons-orange)
+ (nim-mode all-the-icons-fileicon "nimrod" :face all-the-icons-yellow)
+ (sql-mode all-the-icons-octicon "database" :face all-the-icons-silver)
+ (lua-mode all-the-icons-fileicon "lua" :face all-the-icons-dblue)
+ (adoc-mode all-the-icons-fileicon "asciidoc" :face all-the-icons-lblue)
+ (puppet-mode all-the-icons-fileicon "puppet" :face all-the-icons-yellow)
+ (jinja2-mode all-the-icons-fileicon "jinja" :face all-the-icons-silver)
+ (powershell-mode all-the-icons-fileicon "powershell" :face all-the-icons-blue)
+ (tex-mode all-the-icons-fileicon "tex" :face all-the-icons-lred)
+ (latex-mode all-the-icons-fileicon "tex" :face all-the-icons-lred)
+ (dart-mode all-the-icons-fileicon "dart" :height 1.0 :face all-the-icons-blue)
+ (fsharp-mode all-the-icons-fileicon "fsharp" :height 1.0 :face all-the-icons-blue)
+ (asm-mode all-the-icons-fileicon "assembly" :height 1.0 :face all-the-icons-blue)
+ (nasm-mode all-the-icons-fileicon "assembly" :height 1.0 :face all-the-icons-blue)
+ (tcl-mode all-the-icons-fileicon "tcl" :height 1.0 :face all-the-icons-dred)
+ (cuda-mode all-the-icons-fileicon "nvidia" :face all-the-icons-green)
+ (f90-mode all-the-icons-fileicon "fortran" :face all-the-icons-purple)
+ (hy-mode all-the-icons-fileicon "hy" :face all-the-icons-blue)
+ (glsl-mode all-the-icons-fileicon "vertex-shader" :face all-the-icons-green)
+ (zig-mode all-the-icons-fileicon "zig" :face all-the-icons-orange)
+ (pdf-view-mode all-the-icons-octicon "file-pdf" :v-adjust 0.0 :face all-the-icons-dred)
+ (elfeed-search-mode all-the-icons-faicon "rss-square" :face all-the-icons-orange)
+ (elfeed-show-mode all-the-icons-faicon "rss" :face all-the-icons-orange)
+ (lilypond-mode all-the-icons-faicon "music" :face all-the-icons-green)
+ (magik-session-mode all-the-icons-alltheicon "terminal" :face all-the-icons-blue)
+ (magik-cb-mode all-the-icons-faicon "book" :face all-the-icons-blue)))
+
+(defvar all-the-icons-url-alist
+ '(
+ ;; Social media and communities
+ ("^\\(https?://\\)?\\(www\\.\\)?del\\.icio\\.us" all-the-icons-faicon "delicious")
+ ("^\\(https?://\\)?\\(www\\.\\)?behance\\.net" all-the-icons-faicon "behance")
+ ("^\\(https?://\\)?\\(www\\.\\)?dribbble\\.com" all-the-icons-faicon "dribbble")
+ ("^\\(https?://\\)?\\(www\\.\\)?facebook\\.com" all-the-icons-faicon "facebook-official")
+ ("^\\(https?://\\)?\\(www\\.\\)?glide\\.me" all-the-icons-faicon "glide-g")
+ ("^\\(https?://\\)?\\(www\\.\\)?plus\\.google\\.com" all-the-icons-faicon "google-plus")
+ ("linkedin\\.com" all-the-icons-faicon "linkedin")
+ ("^\\(https?://\\)?\\(www\\.\\)?ok\\.ru" all-the-icons-faicon "odnoklassniki")
+ ("^\\(https?://\\)?\\(www\\.\\)?reddit\\.com" all-the-icons-faicon "reddit-alien")
+ ("^\\(https?://\\)?\\(www\\.\\)?slack\\.com" all-the-icons-faicon "slack")
+ ("^\\(https?://\\)?\\(www\\.\\)?snapchat\\.com" all-the-icons-faicon "snapchat-ghost")
+ ("^\\(https?://\\)?\\(www\\.\\)?weibo\\.com" all-the-icons-faicon "weibo")
+ ("^\\(https?://\\)?\\(www\\.\\)?twitter\\.com" all-the-icons-faicon "twitter")
+ ;; Blogging
+ ("joomla\\.org" all-the-icons-faicon "joomla")
+ ("^\\(https?://\\)?\\(www\\.\\)?medium\\.com" all-the-icons-faicon "medium")
+ ("tumblr\\.com" all-the-icons-faicon "tumblr")
+ ("^wordpress\\.com" all-the-icons-faicon "wordpress")
+ ;; Programming
+ ("^\\(https?://\\)?\\(www\\.\\)?bitbucket\\.org" all-the-icons-faicon "bitbucket")
+ ("^\\(https?://\\)?\\(www\\.\\)?codepen\\.io" all-the-icons-faicon "codepen")
+ ("^\\(https?://\\)?\\(www\\.\\)?codiepie\\.com" all-the-icons-faicon "codiepie")
+ ("^\\(https?://\\)?\\(www\\.\\)?gist\\.github\\.com" all-the-icons-octicon "gist")
+ ("^\\(https?://\\)?\\(www\\.\\)?github\\.com" all-the-icons-octicon "mark-github")
+ ("^\\(https?://\\)?\\(www\\.\\)?gitlab\\.com" all-the-icons-faicon "gitlab")
+ ("^\\(https?://\\)?\\(www\\.\\)?news\\.ycombinator\\.com" all-the-icons-faicon "hacker-news")
+ ("^\\(https?://\\)?\\(www\\.\\)?jsfiddle\\.net" all-the-icons-faicon "jsfiddle")
+ ("^\\(https?://\\)?\\(www\\.\\)?maxcdn\\.com" all-the-icons-faicon "maxcdn")
+ ("^\\(https?://\\)?\\(www\\.\\)?stackoverflow\\.com" all-the-icons-faicon "stack-overflow")
+ ;; Video
+ ("^\\(https?://\\)?\\(www\\.\\)?twitch\\.tv" all-the-icons-faicon "twitch")
+ ("^\\(https?://\\)?\\(www\\.\\)?vimeo\\.com" all-the-icons-faicon "vimeo")
+ ("^\\(https?://\\)?\\(www\\.\\)?youtube\\.com" all-the-icons-faicon "youtube")
+ ("^\\(https?://\\)?\\(www\\.\\)?youtu\\.be" all-the-icons-faicon "youtube")
+ ("^\\(https?://\\)?\\(www\\.\\)?vine\\.co" all-the-icons-faicon "vine")
+ ;; Sound
+ ("^\\(https?://\\)?\\(www\\.\\)?last\\.fm" all-the-icons-faicon "lastfm")
+ ("^\\(https?://\\)?\\(www\\.\\)?mixcloud\\.com" all-the-icons-faicon "mixcloud")
+ ("^\\(https?://\\)?\\(www\\.\\)?soundcloud\\.com" all-the-icons-faicon "soundcloud")
+ ("spotify\\.com" all-the-icons-faicon "spotify")
+ ;; Shopping
+ ("^\\(https?://\\)?\\(www\\.\\)?amazon\\." all-the-icons-faicon "amazon")
+ ("^\\(https?://\\)?\\(www\\.\\)?opencart\\.com" all-the-icons-faicon "opencart")
+ ("^\\(https?://\\)?\\(www\\.\\)?paypal\\.com" all-the-icons-faicon "paypal")
+ ("^\\(https?://\\)?\\(www\\.\\)?shirtsinbulk\\.com" all-the-icons-faicon "shitsinbulk")
+ ;; Images
+ ("^\\(https?://\\)?\\(www\\.\\)?500px\\.com" all-the-icons-faicon "500px")
+ ("^\\(https?://\\)?\\(www\\.\\)?deviantart\\.com" all-the-icons-faicon "deviantart")
+ ("^\\(https?://\\)?\\(www\\.\\)?flickr\\.com" all-the-icons-faicon "flickr")
+ ("^\\(https?://\\)?\\(www\\.\\)?instagram\\.com" all-the-icons-faicon "instagram")
+ ("^\\(https?://\\)?\\(www\\.\\)?pinterest\\." all-the-icons-faicon "pinterest")
+ ;; Information and books
+ ("^\\(https?://\\)?\\(www\\.\\)?digg\\.com" all-the-icons-faicon "digg")
+ ("^\\(https?://\\)?\\(www\\.\\)?foursquare\\.com" all-the-icons-faicon "foursquare")
+ ("^\\(https?://\\)?\\(www\\.\\)?getpocket\\.com" all-the-icons-faicon "get-pocket")
+ ("^\\(https?://\\)?\\(www\\.\\)?scribd\\.com" all-the-icons-faicon "scribd")
+ ("^\\(https?://\\)?\\(www\\.\\)?slideshare\\.net" all-the-icons-faicon "slideshare")
+ ("stackexchange\\.com" all-the-icons-faicon "stack-exchange")
+ ("^\\(https?://\\)?\\(www\\.\\)?stumbleupon\\.com" all-the-icons-faicon "stumbleupon")
+ ("^\\(https?://\\)?\\(www\\.\\)?tripadvisor\\." all-the-icons-faicon "tripadvisor")
+ ("^\\(https?://\\)?\\(www\\.\\)?yelp\\." all-the-icons-faicon "yelp")
+
+ ("wikipedia\\.org" all-the-icons-faicon "wikipedia-w")
+ ;; Various companies and tools
+ ("^\\(https?://\\)?\\(www\\.\\)?angel\\.co" all-the-icons-faicon "angellist")
+ ("^\\(https?://\\)?\\(www\\.\\)?apple\\.com" all-the-icons-faicon "apple")
+ ("^\\(https?://\\)?\\(www\\.\\)?buysellads\\.com" all-the-icons-faicon "buysellads")
+ ("^\\(https?://\\)?\\(www\\.\\)?connectdevelop\\.com" all-the-icons-faicon "connectdevelop")
+ ("^\\(https?://\\)?\\(www\\.\\)?dashcube\\.com" all-the-icons-faicon "dashcube")
+ ("^\\(https?://\\)?\\(www\\.\\)?dropbox\\.com" all-the-icons-faicon "dropbox")
+ ("^\\(https?://\\)?\\(www\\.\\)?enviragallery\\.com" all-the-icons-faicon "envira")
+ ("^\\(https?://\\)?\\(www\\.\\)?fortawesome\\.com" all-the-icons-faicon "fort-awesome")
+ ("^\\(https?://\\)?\\(www\\.\\)?forumbee\\.com" all-the-icons-faicon "forumbee")
+ ("^\\(https?://\\)?\\(www\\.\\)?gratipay\\.com" all-the-icons-faicon "gratipay")
+ ("^\\(https?://\\)?\\(www\\.\\)?modx\\.com" all-the-icons-faicon "modx")
+ ("^\\(https?://\\)?\\(www\\.\\)?pagelines\\.com" all-the-icons-faicon "pagelines")
+ ("^\\(https?://\\)?\\(www\\.\\)?producthunt\\.com" all-the-icons-faicon "product-hunt")
+ ("sellsy\\.com" all-the-icons-faicon "sellsy")
+ ("^\\(https?://\\)?\\(www\\.\\)?simplybuilt\\.com" all-the-icons-faicon "simplybuilt")
+ ("^\\(https?://\\)?\\(www\\.\\)?skyatlas\\.com" all-the-icons-faicon "skyatlas")
+ ("^\\(https?://\\)?\\(www\\.\\)?skype\\.com" all-the-icons-faicon "skype")
+ ("steampowered\\.com" all-the-icons-faicon "steam")
+ ("^\\(https?://\\)?\\(www\\.\\)?themeisle\\.com" all-the-icons-faicon "themeisle")
+ ("^\\(https?://\\)?\\(www\\.\\)?trello\\.com" all-the-icons-faicon "trello")
+ ("^\\(https?://\\)?\\(www\\.\\)?whatsapp\\.com" all-the-icons-faicon "whatsapp")
+ ("^\\(https?://\\)?\\(www\\.\\)?ycombinator\\.com" all-the-icons-faicon "y-combinator")
+ ("yahoo\\.com" all-the-icons-faicon "yahoo")
+ ("^\\(https?://\\)?\\(www\\.\\)?yoast\\.com" all-the-icons-faicon "yoast")
+ ;; Catch all
+ ("android" all-the-icons-faicon "android")
+ ("creativecommons" all-the-icons-faicon "creative-commons")
+ ("forums?" all-the-icons-octicon "comment-discussion")
+ ("\\.pdf$" all-the-icons-octicon "file-pdf" :v-adjust 0.0 :face all-the-icons-dred)
+ ("google" all-the-icons-faicon "google")
+ ("\\.rss" all-the-icons-faicon "rss")
+ ))
+
+;; ====================
+;; Functions Start
+;; ====================
+
+(defun all-the-icons-auto-mode-match? (&optional file)
+ "Whether or not FILE's `major-mode' match against its `auto-mode-alist'."
+ (let* ((file (or file (buffer-file-name) (buffer-name)))
+ (auto-mode (all-the-icons-match-to-alist file auto-mode-alist)))
+ (eq major-mode auto-mode)))
+
+(defun all-the-icons-match-to-alist (file alist)
+ "Match FILE against an entry in ALIST using `string-match'."
+ (cdr (cl-find-if (lambda (it) (string-match (car it) file)) alist)))
+
+(defun all-the-icons-dir-is-submodule (dir)
+ "Checker whether or not DIR is a git submodule."
+ (let* ((gitmodule-dir (locate-dominating-file dir ".gitmodules"))
+ (modules-file (expand-file-name (format "%s.gitmodules" gitmodule-dir)))
+ (module-search (format "submodule \".*?%s\"" (file-name-base dir))))
+
+ (when (and gitmodule-dir (file-exists-p (format "%s/.git" dir)))
+ (with-temp-buffer
+ (insert-file-contents modules-file)
+ (search-forward-regexp module-search (point-max) t)))))
+
+;; Icon functions
+(defun all-the-icons-icon-for-dir-with-chevron (dir &optional chevron padding)
+ "Format an icon for DIR with CHEVRON similar to tree based directories.
+
+If PADDING is provided, it will prepend and separate the chevron
+and directory with PADDING.
+
+Produces different symbols by inspecting DIR to distinguish
+symlinks and git repositories which do not depend on the
+directory contents"
+ (let ((icon (all-the-icons-icon-for-dir dir))
+ (chevron (if chevron (all-the-icons-octicon (format "chevron-%s" chevron) :height 0.8 :v-adjust -0.1) ""))
+ (padding (or padding "\t")))
+ (format "%s%s%s%s%s" padding chevron padding icon padding)))
+
+(defun all-the-icons-icon-for-buffer ()
+ "Get the formatted icon for the current buffer.
+
+This function prioritises the use of the buffers file extension to
+discern the icon when its `major-mode' matches its auto mode,
+otherwise it will use the buffers `major-mode' to decide its
+icon."
+ (all-the-icons--icon-info-for-buffer))
+
+(defun all-the-icons-icon-family-for-buffer ()
+ "Get the icon font family for the current buffer."
+ (all-the-icons--icon-info-for-buffer "family"))
+
+(defun all-the-icons--web-mode-icon (&rest arg-overrides) "Get icon for a `web-mode' buffer with ARG-OVERRIDES." (all-the-icons--web-mode nil arg-overrides))
+(defun all-the-icons--web-mode-icon-family () "Get icon family for a `web-mode' buffer." (all-the-icons--web-mode t))
+(defun all-the-icons--web-mode (&optional family arg-overrides)
+ "Return icon or FAMILY for `web-mode' based on `web-mode-content-type'.
+Providing ARG-OVERRIDES will modify the creation of the icon."
+ (let ((non-nil-args (cl-reduce (lambda (acc it) (if it (append acc (list it)) acc)) arg-overrides :initial-value '())))
+ (cond
+ ((equal web-mode-content-type "jsx")
+ (if family (all-the-icons-fileicon-family) (apply 'all-the-icons-fileicon (append '("jsx-2") non-nil-args))))
+ ((equal web-mode-content-type "javascript")
+ (if family (all-the-icons-alltheicon-family) (apply 'all-the-icons-alltheicon (append '("javascript") non-nil-args))))
+ ((equal web-mode-content-type "json")
+ (if family (all-the-icons-alltheicon-family) (apply 'all-the-icons-alltheicon (append '("less") non-nil-args))))
+ ((equal web-mode-content-type "xml")
+ (if family (all-the-icons-faicon-family) (apply 'all-the-icons-faicon (append '("file-code-o") non-nil-args))))
+ ((equal web-mode-content-type "css")
+ (if family (all-the-icons-alltheicon-family) (apply 'all-the-icons-alltheicon (append '("css3") non-nil-args))))
+ (t
+ (if family (all-the-icons-alltheicon-family) (apply 'all-the-icons-alltheicon (append '("html5") non-nil-args)))))))
+
+;; Icon Functions
+
+;;;###autoload
+(defun all-the-icons-icon-for-dir (dir &rest arg-overrides)
+ "Get the formatted icon for DIR.
+ARG-OVERRIDES should be a plist containining `:height',
+`:v-adjust' or `:face' properties like in the normal icon
+inserting functions.
+
+Note: You want chevron, please use `all-the-icons-icon-for-dir-with-chevron'."
+ (let* ((dirname (file-name-base (directory-file-name dir)))
+ (path (expand-file-name dir))
+ (icon (all-the-icons-match-to-alist dirname all-the-icons-dir-icon-alist))
+ (args (cdr icon)))
+ (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
+ (cond
+ ((file-remote-p path)
+ (apply #'all-the-icons-octicon "terminal" (cdr args)))
+ ((file-symlink-p path)
+ (apply #'all-the-icons-octicon "file-symlink-directory" (cdr args)))
+ ((all-the-icons-dir-is-submodule path)
+ (apply #'all-the-icons-octicon "file-submodule" (cdr args)))
+ ((file-exists-p (format "%s/.git" path))
+ (apply #'all-the-icons-octicon "repo" (cdr args)))
+ (t (apply (car icon) args)))))
+
+;;;###autoload
+(defun all-the-icons-icon-for-file (file &rest arg-overrides)
+ "Get the formatted icon for FILE.
+ARG-OVERRIDES should be a plist containining `:height',
+`:v-adjust' or `:face' properties like in the normal icon
+inserting functions."
+ (let* ((ext (file-name-extension file))
+ (icon (or (all-the-icons-match-to-alist file all-the-icons-regexp-icon-alist)
+ (and ext
+ (cdr (assoc (downcase ext)
+ all-the-icons-extension-icon-alist)))
+ all-the-icons-default-file-icon))
+ (args (cdr icon)))
+ (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
+ (apply (car icon) args)))
+
+;;;###autoload
+(defun all-the-icons-icon-for-mode (mode &rest arg-overrides)
+ "Get the formatted icon for MODE.
+ARG-OVERRIDES should be a plist containining `:height',
+`:v-adjust' or `:face' properties like in the normal icon
+inserting functions."
+ (let* ((icon (cdr (or (assoc mode all-the-icons-mode-icon-alist)
+ (assoc (get mode 'derived-mode-parent) all-the-icons-mode-icon-alist))))
+ (args (cdr icon)))
+ (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
+ (if icon (apply (car icon) args) mode)))
+
+;;;###autoload
+(defun all-the-icons-icon-for-url (url &rest arg-overrides)
+ "Get the formatted icon for URL.
+If an icon for URL isn't found in `all-the-icons-url-alist', a globe is used.
+ARG-OVERRIDES should be a plist containining `:height',
+`:v-adjust' or `:face' properties like in the normal icon
+inserting functions."
+ (let* ((icon (all-the-icons-match-to-alist url all-the-icons-url-alist))
+ (args (cdr icon)))
+ (unless icon
+ (setq icon '(all-the-icons-faicon "globe"))
+ (setq args (cdr icon)))
+ (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
+ (apply (car icon) args)))
+
+(defcustom all-the-icons--cache-limit 2048
+ "Maximum cache size for functions cached by `all-the-icons-cache'."
+ :type 'integer)
+
+(defun all-the-icons-cache (func)
+ "Set a cache for FUNC. Does not work on interactive functions."
+ (unless (get func 'all-the-icons--cached)
+ (let ((cache (make-hash-table :test #'equal
+ :size all-the-icons--cache-limit))
+ (orig-fn (symbol-function func)))
+ (fset func
+ (lambda (&rest args)
+ (or (gethash args cache)
+ (progn
+ (when (> (hash-table-count cache)
+ all-the-icons--cache-limit)
+ (clrhash cache))
+ (puthash args (apply orig-fn args) cache)))))))
+
+ (put func 'all-the-icons--cached t))
+
+(all-the-icons-cache #'all-the-icons-icon-for-dir)
+(all-the-icons-cache #'all-the-icons-icon-for-file)
+(all-the-icons-cache #'all-the-icons-icon-for-mode)
+(all-the-icons-cache #'all-the-icons-icon-for-url)
+
+;; Family Face Functions
+(defun all-the-icons-icon-family-for-file (file)
+ "Get the icons font family for FILE."
+ (let ((icon (all-the-icons-match-to-alist file all-the-icons-regexp-icon-alist)))
+ (funcall (intern (format "%s-family" (car icon))))))
+
+(defun all-the-icons-icon-family-for-mode (mode)
+ "Get the icons font family for MODE."
+ (let ((icon (cdr (assoc mode all-the-icons-mode-icon-alist))))
+ (if icon (funcall (intern (format "%s-family" (car icon)))) nil)))
+
+(defun all-the-icons-icon-family (icon)
+ "Get a propertized ICON family programmatically."
+ (plist-get (get-text-property 0 'face icon) :family))
+
+(all-the-icons-cache #'all-the-icons-icon-family-for-file)
+(all-the-icons-cache #'all-the-icons-icon-family-for-mode)
+(all-the-icons-cache #'all-the-icons-icon-family)
+
+(defun all-the-icons--icon-info-for-buffer (&optional f)
+ "Get icon info for the current buffer.
+
+When F is provided, the info function is calculated with the format
+`all-the-icons-icon-%s-for-file' or `all-the-icons-icon-%s-for-mode'."
+ (let* ((base-f (concat "all-the-icons-icon" (when f (format "-%s" f))))
+ (file-f (intern (concat base-f "-for-file")))
+ (mode-f (intern (concat base-f "-for-mode"))))
+ (if (and (buffer-file-name)
+ (all-the-icons-auto-mode-match?))
+ (funcall file-f (file-name-nondirectory (buffer-file-name)))
+ (funcall mode-f major-mode))))
+
+;; Weather icons
+(defun all-the-icons-icon-for-weather (weather)
+ "Get an icon for a WEATHER status."
+ (let ((icon (all-the-icons-match-to-alist weather all-the-icons-weather-icon-alist)))
+ (if icon (apply (car icon) (cdr icon)) weather)))
+
+;; Definitions
+
+(eval-and-compile
+ (defun all-the-icons--function-name (name)
+ "Get the symbol for an icon function name for icon set NAME."
+ (intern (concat "all-the-icons-" (downcase (symbol-name name)))))
+
+ (defun all-the-icons--family-name (name)
+ "Get the symbol for an icon family function for icon set NAME."
+ (intern (concat "all-the-icons-" (downcase (symbol-name name)) "-family")))
+
+ (defun all-the-icons--data-name (name)
+ "Get the symbol for an icon family function for icon set NAME."
+ (intern (concat "all-the-icons-" (downcase (symbol-name name)) "-data")))
+
+ (defun all-the-icons--insert-function-name (name)
+ "Get the symbol for an icon insert function for icon set NAME."
+ (intern (concat "all-the-icons-insert-" (downcase (symbol-name name)))))
+
+ (defun all-the-icons--family-scale-factor (family)
+ (intern (concat "all-the-icons-" (symbol-name family) "-scale-factor")))
+
+ (defun all-the-icons--family-adjust (family)
+ (intern (concat "all-the-icons-default-" (symbol-name family) "-adjust"))))
+
+;; Icon insertion functions
+
+(defun all-the-icons--read-candidates ()
+ "Helper to build a list of candidates for all families."
+ (cl-reduce 'append (mapcar (lambda (it) (all-the-icons--read-candidates-for-family it t)) all-the-icons-font-families)))
+
+(defun all-the-icons--read-candidates-for-family (family &optional show-family)
+ "Helper to build read candidates for FAMILY.
+If SHOW-FAMILY is non-nil, displays the icons family in the candidate string."
+ (let ((data (funcall (all-the-icons--data-name family)))
+ (icon-f (all-the-icons--function-name family)))
+ (mapcar
+ (lambda (it)
+ (let* ((icon-name (car it))
+ (icon-name-head (substring icon-name 0 1))
+ (icon-name-tail (substring icon-name 1))
+
+ (icon-display (propertize icon-name-head 'display (format "%s\t%s" (funcall icon-f icon-name) icon-name-head)))
+ (icon-family (if show-family (format "\t[%s]" family) ""))
+
+ (candidate-name (format "%s%s%s" icon-display icon-name-tail icon-family))
+ (candidate-icon (funcall (all-the-icons--function-name family) icon-name)))
+
+ (cons candidate-name candidate-icon)))
+ data)))
+
+;;;###autoload
+(defun all-the-icons-install-fonts (&optional pfx)
+ "Helper function to download and install the latests fonts based on OS.
+When PFX is non-nil, ignore the prompt and just install"
+ (interactive "P")
+ (when (or pfx (yes-or-no-p "This will download and install fonts, are you sure you want to do this?"))
+ (let* ((url-format "https://raw.githubusercontent.com/domtronn/all-the-icons.el/master/fonts/%s")
+ (font-dest (cond
+ ;; Default Linux install directories
+ ((member system-type '(gnu gnu/linux gnu/kfreebsd))
+ (concat (or (getenv "XDG_DATA_HOME")
+ (concat (getenv "HOME") "/.local/share"))
+ "/fonts/"))
+ ;; Default MacOS install directory
+ ((eq system-type 'darwin)
+ (concat (getenv "HOME") "/Library/Fonts/"))))
+ (known-dest? (stringp font-dest))
+ (font-dest (or font-dest (read-directory-name "Font installation directory: " "~/"))))
+
+ (unless (file-directory-p font-dest) (mkdir font-dest t))
+
+ (mapc (lambda (font)
+ (url-copy-file (format url-format font) (expand-file-name font font-dest) t))
+ all-the-icons-font-names)
+ (when known-dest?
+ (message "Fonts downloaded, updating font cache... <fc-cache -f -v> ")
+ (shell-command-to-string (format "fc-cache -f -v")))
+ (message "%s Successfully %s `all-the-icons' fonts to `%s'!"
+ (all-the-icons-wicon "stars" :v-adjust 0.0)
+ (if known-dest? "installed" "downloaded")
+ font-dest))))
+
+;;;###autoload
+(defun all-the-icons-insert (&optional arg family)
+ "Interactive icon insertion function.
+When Prefix ARG is non-nil, insert the propertized icon.
+When FAMILY is non-nil, limit the candidates to the icon set matching it."
+ (interactive "P")
+ (let* ((standard-output (current-buffer))
+ (candidates (if family
+ (all-the-icons--read-candidates-for-family family)
+ (all-the-icons--read-candidates)))
+ (prompt (if family
+ (format "%s Icon: " (funcall (all-the-icons--family-name family)))
+ "Icon : "))
+
+ (selection (completing-read prompt candidates nil t))
+ (result (cdr (assoc selection candidates))))
+
+ (if arg (prin1 result) (insert result))))
+
+;; Debug Helpers
+
+(defun all-the-icons-insert-icons-for (family &optional height duration)
+ "Insert all of the available icons associated with FAMILY.
+If a HEIGHT is provided it will render the icons at this height.
+This is useful both to see the icons more clearly and to test
+different height rendering. If DURATION is provided, it will
+pause for DURATION seconds between printing each character."
+ (let* ((data-f (all-the-icons--data-name family))
+ (insert-f (all-the-icons--function-name family))
+
+ (height (or height 2.0))
+ (data (funcall data-f)))
+ (mapc
+ (lambda (it)
+ (insert (format "%s - %s\n" (funcall insert-f (car it) :height height) (car it)))
+ (when duration (sit-for duration 0)))
+ data)))
+
+(defmacro all-the-icons-define-icon (name alist family &optional font-name)
+ "Macro to generate functions for inserting icons for icon set NAME.
+
+NAME defines is the name of the iconset and will produce a
+function of the for `all-the-icons-NAME'.
+
+ALIST is the alist containing maps between icon names and the
+UniCode for the character. All of these can be found in the data
+directory of this package.
+
+FAMILY is the font family to use for the icons.
+FONT-NAME is the name of the .ttf file providing the font, defaults to FAMILY."
+ `(progn
+ (add-to-list 'all-the-icons-font-families (quote ,name))
+ (add-to-list 'all-the-icons-font-names (quote ,(downcase (format "%s.ttf" (or font-name family)))))
+ (defcustom ,(all-the-icons--family-scale-factor name) 1.0
+ ,(format "The additional `height' face property Scale Factor for %s icons."
+ (symbol-name name))
+ :group 'all-the-icons
+ :type 'number)
+ (defcustom ,(all-the-icons--family-adjust name) 0.0
+ ,(format "The additional `raise' display property adjustment for %s icons."
+ (symbol-name name))
+ :group 'all-the-icons
+ :type 'number)
+ (defun ,(all-the-icons--family-name name) () ,family)
+ (defun ,(all-the-icons--data-name name) () ,alist)
+ (defun ,(all-the-icons--function-name name) (icon-name &rest args)
+ (let ((icon (cdr (assoc icon-name ,alist)))
+ (other-face (when all-the-icons-color-icons (plist-get args :face)))
+ (height (* all-the-icons-scale-factor
+ ,(all-the-icons--family-scale-factor name)
+ (or (plist-get args :height) 1.0)))
+ (v-adjust (* all-the-icons-scale-factor ,(all-the-icons--family-scale-factor name)
+ (+ (or (plist-get args :v-adjust) all-the-icons-default-adjust)
+ ,(all-the-icons--family-adjust name))))
+ (family ,family))
+ (unless icon
+ (error (format "Unable to find icon with name `%s' in icon set `%s'" icon-name (quote ,name))))
+ (let ((face (if other-face
+ `(:family ,family :height ,height :inherit ,other-face)
+ `(:family ,family :height ,height))))
+ (propertize icon
+ 'face face ;so that this works without `font-lock-mode' enabled
+ 'font-lock-face face ;so that `font-lock-mode' leaves this alone
+ 'display `(raise ,v-adjust)
+ 'rear-nonsticky t))))
+ (defun ,(all-the-icons--insert-function-name name) (&optional arg)
+ ,(format "Insert a %s icon at point." family)
+ (interactive "P")
+ (all-the-icons-insert arg (quote ,name)))))
+
+(define-obsolete-function-alias 'define-icon 'all-the-icons-define-icon "4.0.0")
+
+(all-the-icons-define-icon alltheicon all-the-icons-data/alltheicons-alist "all-the-icons")
+(all-the-icons-define-icon fileicon all-the-icons-data/file-icon-alist "file-icons")
+(all-the-icons-define-icon faicon all-the-icons-data/fa-icon-alist "FontAwesome")
+(all-the-icons-define-icon octicon all-the-icons-data/octicons-alist "github-octicons" "octicons")
+(all-the-icons-define-icon wicon all-the-icons-data/weather-icons-alist "Weather Icons" "weathericons")
+(all-the-icons-define-icon material all-the-icons-data/material-icons-alist "Material Icons" "material-design-icons")
+
+(provide 'all-the-icons)
+
+;;; all-the-icons.el ends here
diff --git a/elpa/all-the-icons-20220325.1238/all-the-icons.elc b/elpa/all-the-icons-20220325.1238/all-the-icons.elc
new file mode 100644
index 0000000..1990d6b
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/all-the-icons.elc
Binary files differ
diff --git a/elpa/all-the-icons-20220325.1238/data/data-alltheicons.el b/elpa/all-the-icons-20220325.1238/data/data-alltheicons.el
new file mode 100644
index 0000000..3322500
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/data/data-alltheicons.el
@@ -0,0 +1,70 @@
+(defvar all-the-icons-data/alltheicons-alist
+ '(
+
+ ( "apache" . "\xe909" )
+ ( "atom" . "\xe917" )
+ ( "aws" . "\xe90c" )
+ ( "bower" . "\xe918" )
+ ( "c" . "\xe915" )
+ ( "c-line" . "\xe90f" )
+ ( "clojure" . "\xe919" )
+ ( "clojure-line" . "\xe91a" )
+ ( "coffeescript" . "\xe914" )
+ ( "cplusplus" . "\xe913" )
+ ( "cplusplus-line" . "\xe910" )
+ ( "csharp" . "\xe911" )
+ ( "csharp-line" . "\xe912" )
+ ( "css3" . "\xe91b" )
+ ( "css3-alt" . "\xe91c" )
+ ( "d3" . "\xe90e" )
+ ( "dlang" . "\xe935" )
+ ( "elixir" . "\xe936" )
+ ( "erlang" . "\xe934" )
+ ( "git" . "\xe907" )
+ ( "go" . "\xe91d" )
+ ( "google-drive" . "\xe91e" )
+ ( "grunt" . "\xe90d" )
+ ( "grunt-line" . "\xe91f" )
+ ( "gulp" . "\xe920" )
+ ( "haskell" . "\xe921" )
+ ( "html5" . "\xe932" )
+ ( "jasmine" . "\xe904" )
+ ( "java" . "\xe922" )
+ ( "javascript" . "\xe906" )
+ ( "javascript-badge" . "\xe923" )
+ ( "javascript-shield" . "\xe924" )
+ ( "less" . "\xe90b" )
+ ( "nginx" . "\xe933" )
+ ( "nodejs" . "\xe925" )
+ ( "perl" . "\xe905" )
+ ( "perldocs" . "\xe926" )
+ ( "postgresql" . "\xe938" )
+ ( "prolog" . "\xe927" )
+ ( "python" . "\xe928" )
+ ( "react" . "\xe929" )
+ ( "ruby" . "\xe92a" )
+ ( "ruby-alt" . "\xe92b" )
+ ( "rust" . "\xe92c" )
+ ( "sass" . "\xe92d" )
+ ( "scala" . "\xe908" )
+ ( "script" . "\xe90a" )
+ ( "spring" . "\xe937" )
+ ( "stylus" . "\xe92e" )
+ ( "svg" . "\xe903" )
+ ( "swift" . "\xe92f" )
+ ( "terminal" . "\xe930" )
+ ( "terminal-alt" . "\xe931" )
+ ( "battery-charging" . "\xe939" )
+
+ ( "arrow-left" . "\xe93a" )
+ ( "arrow-right" . "\xe93b" )
+ ( "cup-left" . "\xe93c" )
+ ( "cup-right" . "\xe93d" )
+ ( "slant-left" . "\xe93e" )
+ ( "slant-right" . "\xe93f" )
+ ( "wave-left" . "\xe940" )
+ ( "wave-right" . "\xe941" )
+
+ ))
+
+(provide 'data-alltheicons)
diff --git a/elpa/all-the-icons-20220325.1238/data/data-alltheicons.elc b/elpa/all-the-icons-20220325.1238/data/data-alltheicons.elc
new file mode 100644
index 0000000..76b2125
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/data/data-alltheicons.elc
Binary files differ
diff --git a/elpa/all-the-icons-20220325.1238/data/data-faicons.el b/elpa/all-the-icons-20220325.1238/data/data-faicons.el
new file mode 100644
index 0000000..6ab0480
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/data/data-faicons.el
@@ -0,0 +1,641 @@
+(defvar all-the-icons-data/fa-icon-alist
+ '(
+
+ ("500px" . "\xf26e")
+ ("adjust" . "\xf042")
+ ("adn" . "\xf170")
+ ("align-center" . "\xf037")
+ ("align-justify" . "\xf039")
+ ("align-left" . "\xf036")
+ ("align-right" . "\xf038")
+ ("amazon" . "\xf270")
+ ("ambulance" . "\xf0f9")
+ ("american-sign-language-interpreting" . "\xf2a3")
+ ("anchor" . "\xf13d")
+ ("android" . "\xf17b")
+ ("angellist" . "\xf209")
+ ("angle-double-down" . "\xf103")
+ ("angle-double-left" . "\xf100")
+ ("angle-double-right" . "\xf101")
+ ("angle-double-up" . "\xf102")
+ ("angle-down" . "\xf107")
+ ("angle-left" . "\xf104")
+ ("angle-right" . "\xf105")
+ ("angle-up" . "\xf106")
+ ("apple" . "\xf179")
+ ("archive" . "\xf187")
+ ("area-chart" . "\xf1fe")
+ ("arrow-circle-down" . "\xf0ab")
+ ("arrow-circle-left" . "\xf0a8")
+ ("arrow-circle-o-down" . "\xf01a")
+ ("arrow-circle-o-left" . "\xf190")
+ ("arrow-circle-o-right" . "\xf18e")
+ ("arrow-circle-o-up" . "\xf01b")
+ ("arrow-circle-right" . "\xf0a9")
+ ("arrow-circle-up" . "\xf0aa")
+ ("arrow-down" . "\xf063")
+ ("arrow-left" . "\xf060")
+ ("arrow-right" . "\xf061")
+ ("arrow-up" . "\xf062")
+ ("arrows" . "\xf047")
+ ("arrows-alt" . "\xf0b2")
+ ("arrows-h" . "\xf07e")
+ ("arrows-v" . "\xf07d")
+ ("assistive-listening-systems" . "\xf2a2")
+ ("asterisk" . "\xf069")
+ ("at" . "\xf1fa")
+ ("audio-description" . "\xf29e")
+ ("backward" . "\xf04a")
+ ("balance-scale" . "\xf24e")
+ ("ban" . "\xf05e")
+ ("bar-chart" . "\xf080")
+ ("barcode" . "\xf02a")
+ ("bars" . "\xf0c9")
+ ("battery-empty" . "\xf244")
+ ("battery-full" . "\xf240")
+ ("battery-half" . "\xf242")
+ ("battery-quarter" . "\xf243")
+ ("battery-three-quarters" . "\xf241")
+ ("bed" . "\xf236")
+ ("beer" . "\xf0fc")
+ ("behance" . "\xf1b4")
+ ("behance-square" . "\xf1b5")
+ ("bell" . "\xf0f3")
+ ("bell-o" . "\xf0a2")
+ ("bell-slash" . "\xf1f6")
+ ("bell-slash-o" . "\xf1f7")
+ ("bicycle" . "\xf206")
+ ("binoculars" . "\xf1e5")
+ ("birthday-cake" . "\xf1fd")
+ ("bitbucket" . "\xf171")
+ ("bitbucket-square" . "\xf172")
+ ("black-tie" . "\xf27e")
+ ("blind" . "\xf29d")
+ ("bluetooth" . "\xf293")
+ ("bluetooth-b" . "\xf294")
+ ("bold" . "\xf032")
+ ("bolt" . "\xf0e7")
+ ("bomb" . "\xf1e2")
+ ("book" . "\xf02d")
+ ("bookmark" . "\xf02e")
+ ("bookmark-o" . "\xf097")
+ ("braille" . "\xf2a1")
+ ("briefcase" . "\xf0b1")
+ ("btc" . "\xf15a")
+ ("bug" . "\xf188")
+ ("building" . "\xf1ad")
+ ("building-o" . "\xf0f7")
+ ("bullhorn" . "\xf0a1")
+ ("bullseye" . "\xf140")
+ ("bus" . "\xf207")
+ ("buysellads" . "\xf20d")
+ ("calculator" . "\xf1ec")
+ ("calendar" . "\xf073")
+ ("calendar-check-o" . "\xf274")
+ ("calendar-minus-o" . "\xf272")
+ ("calendar-o" . "\xf133")
+ ("calendar-plus-o" . "\xf271")
+ ("calendar-times-o" . "\xf273")
+ ("camera" . "\xf030")
+ ("camera-retro" . "\xf083")
+ ("car" . "\xf1b9")
+ ("caret-down" . "\xf0d7")
+ ("caret-left" . "\xf0d9")
+ ("caret-right" . "\xf0da")
+ ("caret-square-o-down" . "\xf150")
+ ("caret-square-o-left" . "\xf191")
+ ("caret-square-o-right" . "\xf152")
+ ("caret-square-o-up" . "\xf151")
+ ("caret-up" . "\xf0d8")
+ ("cart-arrow-down" . "\xf218")
+ ("cart-plus" . "\xf217")
+ ("cc" . "\xf20a")
+ ("cc-amex" . "\xf1f3")
+ ("cc-diners-club" . "\xf24c")
+ ("cc-discover" . "\xf1f2")
+ ("cc-jcb" . "\xf24b")
+ ("cc-mastercard" . "\xf1f1")
+ ("cc-paypal" . "\xf1f4")
+ ("cc-stripe" . "\xf1f5")
+ ("cc-visa" . "\xf1f0")
+ ("certificate" . "\xf0a3")
+ ("chain-broken" . "\xf127")
+ ("check" . "\xf00c")
+ ("check-circle" . "\xf058")
+ ("check-circle-o" . "\xf05d")
+ ("check-square" . "\xf14a")
+ ("check-square-o" . "\xf046")
+ ("chevron-circle-down" . "\xf13a")
+ ("chevron-circle-left" . "\xf137")
+ ("chevron-circle-right" . "\xf138")
+ ("chevron-circle-up" . "\xf139")
+ ("chevron-down" . "\xf078")
+ ("chevron-left" . "\xf053")
+ ("chevron-right" . "\xf054")
+ ("chevron-up" . "\xf077")
+ ("child" . "\xf1ae")
+ ("chrome" . "\xf268")
+ ("circle" . "\xf111")
+ ("circle-o" . "\xf10c")
+ ("circle-o-notch" . "\xf1ce")
+ ("circle-thin" . "\xf1db")
+ ("clipboard" . "\xf0ea")
+ ("clock-o" . "\xf017")
+ ("clone" . "\xf24d")
+ ("cloud" . "\xf0c2")
+ ("cloud-download" . "\xf0ed")
+ ("cloud-upload" . "\xf0ee")
+ ("code" . "\xf121")
+ ("code-fork" . "\xf126")
+ ("codepen" . "\xf1cb")
+ ("codiepie" . "\xf284")
+ ("coffee" . "\xf0f4")
+ ("cog" . "\xf013")
+ ("cogs" . "\xf085")
+ ("columns" . "\xf0db")
+ ("comment" . "\xf075")
+ ("comment-o" . "\xf0e5")
+ ("commenting" . "\xf27a")
+ ("commenting-o" . "\xf27b")
+ ("comments" . "\xf086")
+ ("comments-o" . "\xf0e6")
+ ("compass" . "\xf14e")
+ ("compress" . "\xf066")
+ ("connectdevelop" . "\xf20e")
+ ("contao" . "\xf26d")
+ ("copyright" . "\xf1f9")
+ ("creative-commons" . "\xf25e")
+ ("credit-card" . "\xf09d")
+ ("credit-card-alt" . "\xf283")
+ ("crop" . "\xf125")
+ ("crosshairs" . "\xf05b")
+ ("css3" . "\xf13c")
+ ("cube" . "\xf1b2")
+ ("cubes" . "\xf1b3")
+ ("cutlery" . "\xf0f5")
+ ("dashcube" . "\xf210")
+ ("database" . "\xf1c0")
+ ("deaf" . "\xf2a4")
+ ("delicious" . "\xf1a5")
+ ("desktop" . "\xf108")
+ ("deviantart" . "\xf1bd")
+ ("diamond" . "\xf219")
+ ("digg" . "\xf1a6")
+ ("dot-circle-o" . "\xf192")
+ ("download" . "\xf019")
+ ("dribbble" . "\xf17d")
+ ("dropbox" . "\xf16b")
+ ("drupal" . "\xf1a9")
+ ("edge" . "\xf282")
+ ("eject" . "\xf052")
+ ("ellipsis-h" . "\xf141")
+ ("ellipsis-v" . "\xf142")
+ ("empire" . "\xf1d1")
+ ("envelope" . "\xf0e0")
+ ("envelope-o" . "\xf003")
+ ("envelope-square" . "\xf199")
+ ("envira" . "\xf299")
+ ("eraser" . "\xf12d")
+ ("eur" . "\xf153")
+ ("exchange" . "\xf0ec")
+ ("exclamation" . "\xf12a")
+ ("exclamation-circle" . "\xf06a")
+ ("exclamation-triangle" . "\xf071")
+ ("expand" . "\xf065")
+ ("expeditedssl" . "\xf23e")
+ ("external-link" . "\xf08e")
+ ("external-link-square" . "\xf14c")
+ ("eye" . "\xf06e")
+ ("eye-slash" . "\xf070")
+ ("eyedropper" . "\xf1fb")
+ ("facebook" . "\xf09a")
+ ("facebook-official" . "\xf230")
+ ("facebook-square" . "\xf082")
+ ("fast-backward" . "\xf049")
+ ("fast-forward" . "\xf050")
+ ("fax" . "\xf1ac")
+ ("female" . "\xf182")
+ ("fighter-jet" . "\xf0fb")
+ ("file" . "\xf15b")
+ ("file-archive-o" . "\xf1c6")
+ ("file-audio-o" . "\xf1c7")
+ ("file-code-o" . "\xf1c9")
+ ("file-excel-o" . "\xf1c3")
+ ("file-image-o" . "\xf1c5")
+ ("file-o" . "\xf016")
+ ("file-pdf-o" . "\xf1c1")
+ ("file-powerpoint-o" . "\xf1c4")
+ ("file-text" . "\xf15c")
+ ("file-text-o" . "\xf0f6")
+ ("file-video-o" . "\xf1c8")
+ ("file-word-o" . "\xf1c2")
+ ("files-o" . "\xf0c5")
+ ("film" . "\xf008")
+ ("filter" . "\xf0b0")
+ ("fire" . "\xf06d")
+ ("fire-extinguisher" . "\xf134")
+ ("firefox" . "\xf269")
+ ("first-order" . "\xf2b0")
+ ("flag" . "\xf024")
+ ("flag-checkered" . "\xf11e")
+ ("flag-o" . "\xf11d")
+ ("flask" . "\xf0c3")
+ ("flickr" . "\xf16e")
+ ("floppy-o" . "\xf0c7")
+ ("folder" . "\xf07b")
+ ("folder-o" . "\xf114")
+ ("folder-open" . "\xf07c")
+ ("folder-open-o" . "\xf115")
+ ("font" . "\xf031")
+ ("font-awesome" . "\xf2b4")
+ ("fonticons" . "\xf280")
+ ("fort-awesome" . "\xf286")
+ ("forumbee" . "\xf211")
+ ("forward" . "\xf04e")
+ ("foursquare" . "\xf180")
+ ("frown-o" . "\xf119")
+ ("futbol-o" . "\xf1e3")
+ ("gamepad" . "\xf11b")
+ ("gavel" . "\xf0e3")
+ ("gbp" . "\xf154")
+ ("genderless" . "\xf22d")
+ ("get-pocket" . "\xf265")
+ ("gg" . "\xf260")
+ ("gg-circle" . "\xf261")
+ ("gift" . "\xf06b")
+ ("git" . "\xf1d3")
+ ("git-square" . "\xf1d2")
+ ("github" . "\xf09b")
+ ("github-alt" . "\xf113")
+ ("github-square" . "\xf092")
+ ("gitlab" . "\xf296")
+ ("glass" . "\xf000")
+ ("glide" . "\xf2a5")
+ ("glide-g" . "\xf2a6")
+ ("globe" . "\xf0ac")
+ ("google" . "\xf1a0")
+ ("google-plus" . "\xf0d5")
+ ("google-plus-official" . "\xf2b3")
+ ("google-plus-square" . "\xf0d4")
+ ("google-wallet" . "\xf1ee")
+ ("graduation-cap" . "\xf19d")
+ ("gratipay" . "\xf184")
+ ("h-square" . "\xf0fd")
+ ("hacker-news" . "\xf1d4")
+ ("hand-lizard-o" . "\xf258")
+ ("hand-o-down" . "\xf0a7")
+ ("hand-o-left" . "\xf0a5")
+ ("hand-o-right" . "\xf0a4")
+ ("hand-o-up" . "\xf0a6")
+ ("hand-paper-o" . "\xf256")
+ ("hand-peace-o" . "\xf25b")
+ ("hand-pointer-o" . "\xf25a")
+ ("hand-rock-o" . "\xf255")
+ ("hand-scissors-o" . "\xf257")
+ ("hand-spock-o" . "\xf259")
+ ("hashtag" . "\xf292")
+ ("hdd-o" . "\xf0a0")
+ ("header" . "\xf1dc")
+ ("headphones" . "\xf025")
+ ("heart" . "\xf004")
+ ("heart-o" . "\xf08a")
+ ("heartbeat" . "\xf21e")
+ ("history" . "\xf1da")
+ ("home" . "\xf015")
+ ("hospital-o" . "\xf0f8")
+ ("hourglass" . "\xf254")
+ ("hourglass-end" . "\xf253")
+ ("hourglass-half" . "\xf252")
+ ("hourglass-o" . "\xf250")
+ ("hourglass-start" . "\xf251")
+ ("houzz" . "\xf27c")
+ ("html5" . "\xf13b")
+ ("i-cursor" . "\xf246")
+ ("ils" . "\xf20b")
+ ("inbox" . "\xf01c")
+ ("indent" . "\xf03c")
+ ("industry" . "\xf275")
+ ("info" . "\xf129")
+ ("info-circle" . "\xf05a")
+ ("inr" . "\xf156")
+ ("instagram" . "\xf16d")
+ ("internet-explorer" . "\xf26b")
+ ("ioxhost" . "\xf208")
+ ("italic" . "\xf033")
+ ("joomla" . "\xf1aa")
+ ("jpy" . "\xf157")
+ ("jsfiddle" . "\xf1cc")
+ ("key" . "\xf084")
+ ("keyboard-o" . "\xf11c")
+ ("krw" . "\xf159")
+ ("language" . "\xf1ab")
+ ("laptop" . "\xf109")
+ ("lastfm" . "\xf202")
+ ("lastfm-square" . "\xf203")
+ ("leaf" . "\xf06c")
+ ("leanpub" . "\xf212")
+ ("lemon-o" . "\xf094")
+ ("level-down" . "\xf149")
+ ("level-up" . "\xf148")
+ ("life-ring" . "\xf1cd")
+ ("lightbulb-o" . "\xf0eb")
+ ("line-chart" . "\xf201")
+ ("link" . "\xf0c1")
+ ("linkedin" . "\xf0e1")
+ ("linkedin-square" . "\xf08c")
+ ("linux" . "\xf17c")
+ ("list" . "\xf03a")
+ ("list-alt" . "\xf022")
+ ("list-ol" . "\xf0cb")
+ ("list-ul" . "\xf0ca")
+ ("location-arrow" . "\xf124")
+ ("lock" . "\xf023")
+ ("long-arrow-down" . "\xf175")
+ ("long-arrow-left" . "\xf177")
+ ("long-arrow-right" . "\xf178")
+ ("long-arrow-up" . "\xf176")
+ ("low-vision" . "\xf2a8")
+ ("magic" . "\xf0d0")
+ ("magnet" . "\xf076")
+ ("male" . "\xf183")
+ ("map" . "\xf279")
+ ("map-marker" . "\xf041")
+ ("map-o" . "\xf278")
+ ("map-pin" . "\xf276")
+ ("map-signs" . "\xf277")
+ ("mars" . "\xf222")
+ ("mars-double" . "\xf227")
+ ("mars-stroke" . "\xf229")
+ ("mars-stroke-h" . "\xf22b")
+ ("mars-stroke-v" . "\xf22a")
+ ("maxcdn" . "\xf136")
+ ("meanpath" . "\xf20c")
+ ("medium" . "\xf23a")
+ ("medkit" . "\xf0fa")
+ ("meh-o" . "\xf11a")
+ ("mercury" . "\xf223")
+ ("microphone" . "\xf130")
+ ("microphone-slash" . "\xf131")
+ ("minus" . "\xf068")
+ ("minus-circle" . "\xf056")
+ ("minus-square" . "\xf146")
+ ("minus-square-o" . "\xf147")
+ ("mixcloud" . "\xf289")
+ ("mobile" . "\xf10b")
+ ("modx" . "\xf285")
+ ("money" . "\xf0d6")
+ ("moon-o" . "\xf186")
+ ("motorcycle" . "\xf21c")
+ ("mouse-pointer" . "\xf245")
+ ("music" . "\xf001")
+ ("neuter" . "\xf22c")
+ ("newspaper-o" . "\xf1ea")
+ ("object-group" . "\xf247")
+ ("object-ungroup" . "\xf248")
+ ("odnoklassniki" . "\xf263")
+ ("odnoklassniki-square" . "\xf264")
+ ("opencart" . "\xf23d")
+ ("openid" . "\xf19b")
+ ("opera" . "\xf26a")
+ ("optin-monster" . "\xf23c")
+ ("outdent" . "\xf03b")
+ ("pagelines" . "\xf18c")
+ ("paint-brush" . "\xf1fc")
+ ("paper-plane" . "\xf1d8")
+ ("paper-plane-o" . "\xf1d9")
+ ("paperclip" . "\xf0c6")
+ ("paragraph" . "\xf1dd")
+ ("pause" . "\xf04c")
+ ("pause-circle" . "\xf28b")
+ ("pause-circle-o" . "\xf28c")
+ ("paw" . "\xf1b0")
+ ("paypal" . "\xf1ed")
+ ("pencil" . "\xf040")
+ ("pencil-square" . "\xf14b")
+ ("pencil-square-o" . "\xf044")
+ ("percent" . "\xf295")
+ ("phone" . "\xf095")
+ ("phone-square" . "\xf098")
+ ("picture-o" . "\xf03e")
+ ("pie-chart" . "\xf200")
+ ("pied-piper" . "\xf2ae")
+ ("pied-piper-alt" . "\xf1a8")
+ ("pied-piper-pp" . "\xf1a7")
+ ("pinterest" . "\xf0d2")
+ ("pinterest-p" . "\xf231")
+ ("pinterest-square" . "\xf0d3")
+ ("plane" . "\xf072")
+ ("play" . "\xf04b")
+ ("play-circle" . "\xf144")
+ ("play-circle-o" . "\xf01d")
+ ("plug" . "\xf1e6")
+ ("plus" . "\xf067")
+ ("plus-circle" . "\xf055")
+ ("plus-square" . "\xf0fe")
+ ("plus-square-o" . "\xf196")
+ ("power-off" . "\xf011")
+ ("print" . "\xf02f")
+ ("product-hunt" . "\xf288")
+ ("puzzle-piece" . "\xf12e")
+ ("qq" . "\xf1d6")
+ ("qrcode" . "\xf029")
+ ("question" . "\xf128")
+ ("question-circle" . "\xf059")
+ ("question-circle-o" . "\xf29c")
+ ("quote-left" . "\xf10d")
+ ("quote-right" . "\xf10e")
+ ("random" . "\xf074")
+ ("rebel" . "\xf1d0")
+ ("recycle" . "\xf1b8")
+ ("reddit" . "\xf1a1")
+ ("reddit-alien" . "\xf281")
+ ("reddit-square" . "\xf1a2")
+ ("refresh" . "\xf021")
+ ("registered" . "\xf25d")
+ ("renren" . "\xf18b")
+ ("repeat" . "\xf01e")
+ ("reply" . "\xf112")
+ ("reply-all" . "\xf122")
+ ("retweet" . "\xf079")
+ ("road" . "\xf018")
+ ("rocket" . "\xf135")
+ ("rss" . "\xf09e")
+ ("rss-square" . "\xf143")
+ ("rub" . "\xf158")
+ ("safari" . "\xf267")
+ ("scissors" . "\xf0c4")
+ ("scribd" . "\xf28a")
+ ("search" . "\xf002")
+ ("search-minus" . "\xf010")
+ ("search-plus" . "\xf00e")
+ ("sellsy" . "\xf213")
+ ("server" . "\xf233")
+ ("share" . "\xf064")
+ ("share-alt" . "\xf1e0")
+ ("share-alt-square" . "\xf1e1")
+ ("share-square" . "\xf14d")
+ ("share-square-o" . "\xf045")
+ ("shield" . "\xf132")
+ ("ship" . "\xf21a")
+ ("shirtsinbulk" . "\xf214")
+ ("shopping-bag" . "\xf290")
+ ("shopping-basket" . "\xf291")
+ ("shopping-cart" . "\xf07a")
+ ("sign-in" . "\xf090")
+ ("sign-language" . "\xf2a7")
+ ("sign-out" . "\xf08b")
+ ("signal" . "\xf012")
+ ("simplybuilt" . "\xf215")
+ ("sitemap" . "\xf0e8")
+ ("skyatlas" . "\xf216")
+ ("skype" . "\xf17e")
+ ("slack" . "\xf198")
+ ("sliders" . "\xf1de")
+ ("slideshare" . "\xf1e7")
+ ("smile-o" . "\xf118")
+ ("snapchat" . "\xf2ab")
+ ("snapchat-ghost" . "\xf2ac")
+ ("snapchat-square" . "\xf2ad")
+ ("sort" . "\xf0dc")
+ ("sort-alpha-asc" . "\xf15d")
+ ("sort-alpha-desc" . "\xf15e")
+ ("sort-amount-asc" . "\xf160")
+ ("sort-amount-desc" . "\xf161")
+ ("sort-asc" . "\xf0de")
+ ("sort-desc" . "\xf0dd")
+ ("sort-numeric-asc" . "\xf162")
+ ("sort-numeric-desc" . "\xf163")
+ ("soundcloud" . "\xf1be")
+ ("space-shuttle" . "\xf197")
+ ("spinner" . "\xf110")
+ ("spoon" . "\xf1b1")
+ ("spotify" . "\xf1bc")
+ ("square" . "\xf0c8")
+ ("square-o" . "\xf096")
+ ("stack-exchange" . "\xf18d")
+ ("stack-overflow" . "\xf16c")
+ ("star" . "\xf005")
+ ("star-half" . "\xf089")
+ ("star-half-o" . "\xf123")
+ ("star-o" . "\xf006")
+ ("steam" . "\xf1b6")
+ ("steam-square" . "\xf1b7")
+ ("step-backward" . "\xf048")
+ ("step-forward" . "\xf051")
+ ("stethoscope" . "\xf0f1")
+ ("sticky-note" . "\xf249")
+ ("sticky-note-o" . "\xf24a")
+ ("stop" . "\xf04d")
+ ("stop-circle" . "\xf28d")
+ ("stop-circle-o" . "\xf28e")
+ ("street-view" . "\xf21d")
+ ("strikethrough" . "\xf0cc")
+ ("stumbleupon" . "\xf1a4")
+ ("stumbleupon-circle" . "\xf1a3")
+ ("subscript" . "\xf12c")
+ ("subway" . "\xf239")
+ ("suitcase" . "\xf0f2")
+ ("sun-o" . "\xf185")
+ ("superscript" . "\xf12b")
+ ("table" . "\xf0ce")
+ ("tablet" . "\xf10a")
+ ("tachometer" . "\xf0e4")
+ ("tag" . "\xf02b")
+ ("tags" . "\xf02c")
+ ("tasks" . "\xf0ae")
+ ("taxi" . "\xf1ba")
+ ("television" . "\xf26c")
+ ("tencent-weibo" . "\xf1d5")
+ ("terminal" . "\xf120")
+ ("text-height" . "\xf034")
+ ("text-width" . "\xf035")
+ ("th" . "\xf00a")
+ ("th-large" . "\xf009")
+ ("th-list" . "\xf00b")
+ ("themeisle" . "\xf2b2")
+ ("thumb-tack" . "\xf08d")
+ ("thumbs-down" . "\xf165")
+ ("thumbs-o-down" . "\xf088")
+ ("thumbs-o-up" . "\xf087")
+ ("thumbs-up" . "\xf164")
+ ("ticket" . "\xf145")
+ ("times" . "\xf00d")
+ ("times-circle" . "\xf057")
+ ("times-circle-o" . "\xf05c")
+ ("tint" . "\xf043")
+ ("toggle-off" . "\xf204")
+ ("toggle-on" . "\xf205")
+ ("trademark" . "\xf25c")
+ ("train" . "\xf238")
+ ("transgender" . "\xf224")
+ ("transgender-alt" . "\xf225")
+ ("trash" . "\xf1f8")
+ ("trash-o" . "\xf014")
+ ("tree" . "\xf1bb")
+ ("trello" . "\xf181")
+ ("tripadvisor" . "\xf262")
+ ("trophy" . "\xf091")
+ ("truck" . "\xf0d1")
+ ("try" . "\xf195")
+ ("tty" . "\xf1e4")
+ ("tumblr" . "\xf173")
+ ("tumblr-square" . "\xf174")
+ ("twitch" . "\xf1e8")
+ ("twitter" . "\xf099")
+ ("twitter-square" . "\xf081")
+ ("umbrella" . "\xf0e9")
+ ("underline" . "\xf0cd")
+ ("undo" . "\xf0e2")
+ ("universal-access" . "\xf29a")
+ ("university" . "\xf19c")
+ ("unlock" . "\xf09c")
+ ("unlock-alt" . "\xf13e")
+ ("upload" . "\xf093")
+ ("usb" . "\xf287")
+ ("usd" . "\xf155")
+ ("user" . "\xf007")
+ ("user-md" . "\xf0f0")
+ ("user-plus" . "\xf234")
+ ("user-secret" . "\xf21b")
+ ("user-times" . "\xf235")
+ ("users" . "\xf0c0")
+ ("venus" . "\xf221")
+ ("venus-double" . "\xf226")
+ ("venus-mars" . "\xf228")
+ ("viacoin" . "\xf237")
+ ("viadeo" . "\xf2a9")
+ ("viadeo-square" . "\xf2aa")
+ ("video-camera" . "\xf03d")
+ ("vimeo" . "\xf27d")
+ ("vimeo-square" . "\xf194")
+ ("vine" . "\xf1ca")
+ ("vk" . "\xf189")
+ ("volume-control-phone" . "\xf2a0")
+ ("volume-down" . "\xf027")
+ ("volume-off" . "\xf026")
+ ("volume-up" . "\xf028")
+ ("weibo" . "\xf18a")
+ ("weixin" . "\xf1d7")
+ ("whatsapp" . "\xf232")
+ ("wheelchair" . "\xf193")
+ ("wheelchair-alt" . "\xf29b")
+ ("wifi" . "\xf1eb")
+ ("wikipedia-w" . "\xf266")
+ ("windows" . "\xf17a")
+ ("wordpress" . "\xf19a")
+ ("wpbeginner" . "\xf297")
+ ("wpforms" . "\xf298")
+ ("wrench" . "\xf0ad")
+ ("xing" . "\xf168")
+ ("xing-square" . "\xf169")
+ ("y-combinator" . "\xf23b")
+ ("yahoo" . "\xf19e")
+ ("yelp" . "\xf1e9")
+ ("yoast" . "\xf2b1")
+ ("youtube" . "\xf167")
+ ("youtube-play" . "\xf16a")
+ ("youtube-square" . "\xf166")
+
+ ))
+
+(provide 'data-faicons)
diff --git a/elpa/all-the-icons-20220325.1238/data/data-faicons.elc b/elpa/all-the-icons-20220325.1238/data/data-faicons.elc
new file mode 100644
index 0000000..3d0970d
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/data/data-faicons.elc
Binary files differ
diff --git a/elpa/all-the-icons-20220325.1238/data/data-fileicons.el b/elpa/all-the-icons-20220325.1238/data/data-fileicons.el
new file mode 100644
index 0000000..df91ac4
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/data/data-fileicons.el
@@ -0,0 +1,491 @@
+(defvar all-the-icons-data/file-icon-alist
+ '(
+
+ ( "1c" . "\xa5ea" )
+ ( "1c-alt" . "\xea28" )
+ ( "MJML" . "\xea6f" )
+ ( "R" . "\xe905" )
+ ( "abap" . "\xe92b" )
+ ( "abif" . "\xea4e" )
+ ( "access" . "\xe9ea" )
+ ( "actionscript" . "\xe92e" )
+ ( "ada" . "\xe90b" )
+ ( "ae" . "\xe9f3" )
+ ( "ai" . "\xe6b4" )
+ ( "akka" . "\xea0e" )
+ ( "alex" . "\x29cb" )
+ ( "alloy" . "\xe935" )
+ ( "alpine-linux" . "\xe9ff" )
+ ( "ampl" . "\xe94e" )
+ ( "amx" . "\xe99b" )
+ ( "angelscript" . "\xea5b" )
+ ( "ansible" . "\x24b6" )
+ ( "ansible-alt" . "\x61" )
+ ( "ant" . "\xe93e" )
+ ( "antlr" . "\xe92c" )
+ ( "antwar" . "\x2591" )
+ ( "api-blueprint" . "\xe92d" )
+ ( "apl" . "\x234b" )
+ ( "apl-old" . "\xe909" )
+ ( "apple" . "\xe925" )
+ ( "appveyor" . "\xe923" )
+ ( "arc" . "\xe92f" )
+ ( "arch-linux" . "\x41" )
+ ( "arduino" . "\xe930" )
+ ( "arttext" . "\x24d0" )
+ ( "asciidoc" . "\xe918" )
+ ( "assembly" . "\xEB4F" )
+ ( "ats" . "\xe934" )
+ ( "audacity" . "\xe9f9" )
+ ( "augeas" . "\xe931" )
+ ( "aurelia" . "\xea48" )
+ ( "auto-hotkey" . "\xe932" )
+ ( "autoit" . "\xe933" )
+ ( "babel" . "\xe91f" )
+ ( "bazel" . "\xea5a" )
+ ( "bem" . "\xea59" )
+ ( "bib" . "\xe601" )
+ ( "bintray" . "\xea6e" )
+ ( "bithound" . "\xea2a" )
+ ( "blender" . "\xe9fa" )
+ ( "bluespec" . "\xe93c" )
+ ( "boo" . "\xe939" )
+ ( "brain" . "\xe93a" )
+ ( "brakeman" . "\xe9d6" )
+ ( "bro" . "\xe93b" )
+ ( "broccoli" . "\xe922" )
+ ( "brotli" . "\xea6c" )
+ ( "browserslist" . "\xea80" )
+ ( "brunch" . "\xea47" )
+ ( "buck" . "\xea46" )
+ ( "build-boot" . "\xf103" )
+ ( "bundler" . "\xea45" )
+ ( "byond" . "\xe962" )
+ ( "cabal" . "\xe9c2" )
+ ( "caddy" . "\xea58" )
+ ( "cake" . "\xe9e3" )
+ ( "cakefile" . "\xe924" )
+ ( "cakephp" . "\xea43" )
+ ( "cakephp-old" . "\xe9d3" )
+ ( "cc" . "\xe9d5" )
+ ( "ceylon" . "\xe94f" )
+ ( "chai" . "\x63" )
+ ( "chapel" . "\xe950" )
+ ( "chartjs" . "\xea0b" )
+ ( "chef" . "\xea42" )
+ ( "chuck" . "\xe943" )
+ ( "circle-ci" . "\xea12" )
+ ( "cirru" . "\xe951" )
+ ( "ckeditor" . "\xea0c" )
+ ( "clarion" . "\xe952" )
+ ( "clean" . "\xe95b" )
+ ( "click" . "\xe95c" )
+ ( "clips" . "\xe940" )
+ ( "clj" . "\xf105" )
+ ( "cljs" . "\xf104" )
+ ( "closure-template" . "\xea82" )
+ ( "cmake" . "\xe93f" )
+ ( "cobol" . "\xea44" )
+ ( "codecov" . "\x2602" )
+ ( "codekit" . "\xea41" )
+ ( "codemirror" . "\xea0d" )
+ ( "codeship" . "\xea6a" )
+ ( "cold-fusion" . "\xe929" )
+ ( "clisp" . "\xe972" )
+ ( "composer" . "\xe683" )
+ ( "config" . "\xf07c" )
+ ( "coq" . "\xe95f" )
+ ( "cordova" . "\xea11" )
+ ( "cp" . "\xe942" )
+ ( "cpan" . "\xea87" )
+ ( "creole" . "\xe95e" )
+ ( "crystal" . "\xe902" )
+ ( "cs-script" . "\xe9e2" )
+ ( "csound" . "\xe9f0" )
+ ( "cucumber" . "\xf02b" )
+ ( "cython" . "\xe963" )
+ ( "d3" . "\xea10" )
+ ( "darcs" . "\xe964" )
+ ( "dart" . "\xe698" )
+ ( "dashboard" . "\xf07d" )
+ ( "dbase" . "\xe9f1" )
+ ( "default" . "\x1f5cc" )
+ ( "delphi" . "\xea40" )
+ ( "devicetree" . "\xea57" )
+ ( "diff" . "\xe960" )
+ ( "dockerfile" . "\xf106" )
+ ( "doclets" . "\xea3f" )
+ ( "doge" . "\xe946" )
+ ( "dom" . "\xea71" )
+ ( "donejs" . "\x1f3c1" )
+ ( "doxygen" . "\xe928" )
+ ( "dragula" . "\x1f44c" )
+ ( "drone" . "\xea3d" )
+ ( "dyalog" . "\xe90c" )
+ ( "dylib" . "\xea15" )
+ ( "e" . "\x45" )
+ ( "eagle" . "\xe965" )
+ ( "easybuild" . "\xea85" )
+ ( "ec" . "\xe9c9" )
+ ( "ecere" . "\xe966" )
+ ( "edge" . "\xea78" )
+ ( "editorconfig" . "\xea1b" )
+ ( "eiffel" . "\xe967" )
+ ( "ejs" . "\xea4b" )
+ ( "electron" . "\xea27" )
+ ( "elm" . "\xf102" )
+ ( "emacs" . "\xe926" )
+ ( "elisp" . "\xe926" )
+ ( "ember" . "\xe61b" )
+ ( "emberscript" . "\xe968" )
+ ( "eq" . "\xea0a" )
+ ( "esdoc" . "\xea5c" )
+ ( "eslint" . "\xea0f" )
+ ( "eslint-old" . "\xe90e" )
+ ( "excel" . "\xe9ee" )
+ ( "fabfile" . "\xe94b" )
+ ( "factor" . "\xe96a" )
+ ( "fancy" . "\xe96b" )
+ ( "fantom" . "\xe96f" )
+ ( "fbx" . "\xe9fc" )
+ ( "ffmpeg" . "\xea22" )
+ ( "finder" . "\xe9e9" )
+ ( "firebase" . "\xea7f" )
+ ( "flow" . "\xe921" )
+ ( "flux" . "\xe969" )
+ ( "font" . "\xe90f" )
+ ( "fontforge" . "\xfb00" )
+ ( "fortran" . "\xe90a" )
+ ( "franca" . "\xea56" )
+ ( "freemarker" . "\xe970" )
+ ( "frege" . "\xe96e" )
+ ( "fsharp" . "\xe6a7" )
+ ( "fuel-ux" . "\xea09" )
+ ( "gams" . "\xe973" )
+ ( "gap" . "\xe971" )
+ ( "gdb" . "\xea08" )
+ ( "genshi" . "\xe976" )
+ ( "gentoo" . "\xe96d" )
+ ( "gf" . "\xe978" )
+ ( "gitlab" . "\xea3c" )
+ ( "glade" . "\xe938" )
+ ( "glyphs" . "\x47" )
+ ( "gn" . "\xea25" )
+ ( "gnu" . "\xe679" )
+ ( "go" . "\xeaae" )
+ ( "godot" . "\xe974" )
+ ( "golo" . "\xe979" )
+ ( "gosu" . "\xe97a" )
+ ( "gradle" . "\xe903" )
+ ( "graphql" . "\xe97c" )
+ ( "graphviz" . "\xe97d" )
+ ( "groovy" . "\xe904" )
+ ( "grunt" . "\xe611" )
+ ( "gulp" . "\xe610" )
+ ( "hack" . "\xe9ce" )
+ ( "haml" . "\xf15b" )
+ ( "harbour" . "\xe97b" )
+ ( "hashicorp" . "\xe97e" )
+ ( "haxe" . "\xe907" )
+ ( "haxedevelop" . "\xea3b" )
+ ( "hg" . "\x263f" )
+ ( "hoplon" . "\xea4d" )
+ ( "hy" . "\xe97f" )
+ ( "icu" . "\xea23" )
+ ( "id" . "\xe9f4" )
+ ( "idl" . "\xe947" )
+ ( "idris" . "\xe983" )
+ ( "igorpro" . "\xe980" )
+ ( "image" . "\xf012" )
+ ( "inform7" . "\xe984" )
+ ( "inno" . "\xe985" )
+ ( "io" . "\xe981" )
+ ( "ioke" . "\xe982" )
+ ( "ionic-project" . "\xf14b" )
+ ( "isabelle" . "\xe945" )
+ ( "j" . "\xe937" )
+ ( "jade" . "\xe90d" )
+ ( "jake" . "\xe948" )
+ ( "jasmine" . "\xea3a" )
+ ( "jenkins" . "\xe667" )
+ ( "jest" . "\xea39" )
+ ( "jinja" . "\xe944" )
+ ( "jison" . "\xea55" )
+ ( "jolie" . "\xea75" )
+ ( "jsonld" . "\xe958" )
+ ( "jsx" . "\xf100" )
+ ( "jsx-2" . "\xf101" )
+ ( "jsx2-alt" . "\xe9e6" )
+ ( "julia" . "\x26ec" )
+ ( "junos" . "\xea81" )
+ ( "jupyter" . "\xe987" )
+ ( "karma" . "\xe9cd" )
+ ( "keynote" . "\xe9e5" )
+ ( "khronos" . "\xe9f8" )
+ ( "kicad" . "\xea4c" )
+ ( "kitchenci" . "\xea38" )
+ ( "kivy" . "\xe901" )
+ ( "knockout" . "\x4b" )
+ ( "kotlin" . "\xe989" )
+ ( "krl" . "\xe988" )
+ ( "labview" . "\xe98a" )
+ ( "lasso" . "\xe98c" )
+ ( "leaflet" . "\xea07" )
+ ( "lean" . "\x4c" )
+ ( "lerna" . "\xea37" )
+ ( "lfe" . "\xe94c" )
+ ( "libuv" . "\xea21" )
+ ( "lightwave" . "\xe9fb" )
+ ( "lime" . "\xea36" )
+ ( "lisp" . "\xe908" )
+ ( "livescript" . "\xe914" )
+ ( "llvm" . "\xe91d" )
+ ( "logtalk" . "\xe98d" )
+ ( "lookml" . "\xe98e" )
+ ( "lsl" . "\xe98b" )
+ ( "lua" . "\xe91b" )
+ ( "mako" . "\xe98f" )
+ ( "man-page" . "\xe936" )
+ ( "mapbox" . "\xe941" )
+ ( "markdownlint" . "\xf0c9" )
+ ( "marko" . "\xe920" )
+ ( "mathematica" . "\xe990" )
+ ( "mathjax" . "\xea06" )
+ ( "matlab" . "\xe991" )
+ ( "max" . "\xe993" )
+ ( "maxscript" . "\xe900" )
+ ( "maya" . "\xe9f6" )
+ ( "mediawiki" . "\xe954" )
+ ( "mercury" . "\xe994" )
+ ( "meson" . "\xea54" )
+ ( "metal" . "\x4d" )
+ ( "meteor" . "\xe6a5" )
+ ( "microsoft-infopath" . "\xea35" )
+ ( "minecraft" . "\xe9dc" )
+ ( "minizinc" . "\xea53" )
+ ( "mirah" . "\xe995" )
+ ( "miranda" . "\xea52" )
+ ( "mocha" . "\x26fe" )
+ ( "modula-2" . "\xe996" )
+ ( "moment" . "\x1f558" )
+ ( "moment-tz" . "\x1f30d" )
+ ( "monkey" . "\xe997" )
+ ( "moustache" . "\xe60f" )
+ ( "mruby" . "\xea18" )
+ ( "mupad" . "\xe9ca" )
+ ( "nano" . "\xea76" )
+ ( "nanoc" . "\xea51" )
+ ( "nant" . "\xe9e1" )
+ ( "nasm" . "\xea72" )
+ ( "neko" . "\xea05" )
+ ( "netlogo" . "\xe99c" )
+ ( "new-relic" . "\xe9d7" )
+ ( "nginx" . "\xf146b" )
+ ( "nib" . "\x2712" )
+ ( "nimrod" . "\xe998" )
+ ( "nit" . "\xe999" )
+ ( "nix" . "\xe99a" )
+ ( "nmap" . "\xe94d" )
+ ( "nodemon" . "\xea26" )
+ ( "normalize" . "\xea04" )
+ ( "npm" . "\xe91c" )
+ ( "npm-old" . "\xf17b" )
+ ( "nsis" . "\xea1e" )
+ ( "nsis-old" . "\xe992" )
+ ( "nuclide" . "\xea34" )
+ ( "nuget" . "\xe9d9" )
+ ( "numpy" . "\xe99d" )
+ ( "nunjucks" . "\xe953" )
+ ( "nvidia" . "\xe95d" )
+ ( "nxc" . "\xea6b" )
+ ( "obj" . "\xe9e8" )
+ ( "objective-j" . "\xe99e" )
+ ( "ocaml" . "\xe91a" )
+ ( "octave" . "\xea33" )
+ ( "onenote" . "\xe9eb" )
+ ( "ooc" . "\xe9cb" )
+ ( "opa" . "\x2601" )
+ ( "opencl" . "\xe99f" )
+ ( "opengl" . "\xea7a" )
+ ( "openoffice" . "\xe9e4" )
+ ( "openscad" . "\xe911" )
+ ( "org" . "\xe917" )
+ ( "owl" . "\xe957" )
+ ( "ox" . "\xe9a1" )
+ ( "oxygene" . "\xe9bf" )
+ ( "oz" . "\xe9be" )
+ ( "p4" . "\xea50" )
+ ( "pan" . "\xe9bd" )
+ ( "papyrus" . "\xe9bc" )
+ ( "parrot" . "\xe9bb" )
+ ( "pascal" . "\xe92a" )
+ ( "patch" . "\xe961" )
+ ( "pawn" . "\x265f" )
+ ( "pb" . "\xea14" )
+ ( "pegjs" . "\xea74" )
+ ( "raku" . "\xe96c" )
+ ( "phalcon" . "\xe94a" )
+ ( "phoenix" . "\xea5f" )
+ ( "php" . "\xf147" )
+ ( "phpunit" . "\xea32" )
+ ( "pickle" . "\xe9c4" )
+ ( "pike" . "\xe9b9" )
+ ( "platformio" . "\xea2c" )
+ ( "pm2" . "\x2630" )
+ ( "pod" . "\xea84" )
+ ( "pogo" . "\xe9b8" )
+ ( "pointwise" . "\xe977" )
+ ( "polymer" . "\xea2b" )
+ ( "pony" . "\xe9b7" )
+ ( "postcss" . "\xe910" )
+ ( "postscript" . "\xe955" )
+ ( "povray" . "\x50" )
+ ( "powerpoint" . "\xe9ec" )
+ ( "powershell" . "\xe9da" )
+ ( "precision" . "\x2295" )
+ ( "premiere" . "\xe9f5" )
+ ( "processing" . "\xe9a0" )
+ ( "progress" . "\xe9c0" )
+ ( "propeller" . "\xe9b5" )
+ ( "proselint" . "\xea6d" )
+ ( "protractor" . "\xe9de" )
+ ( "ps" . "\xe6b8" )
+ ( "pug" . "\xea13" )
+ ( "pug-alt" . "\xe9d0" )
+ ( "puppet" . "\xf0c3" )
+ ( "purebasic" . "\x1b5" )
+ ( "purescript" . "\xe9b2" )
+ ( "racket" . "\xe9b1" )
+ ( "raml" . "\xe913" )
+ ( "rascal" . "\xea24" )
+ ( "rdoc" . "\xe9b0" )
+ ( "realbasic" . "\xe9af" )
+ ( "reason" . "\xea1d" )
+ ( "rebol" . "\xe9ae" )
+ ( "red" . "\xe9ad" )
+ ( "redux" . "\xea30" )
+ ( "regex" . "\x2a" )
+ ( "rexx" . "\xea16" )
+ ( "rhino" . "\xea4a" )
+ ( "ring" . "\x1f48d" )
+ ( "riot" . "\xe919" )
+ ( "robot" . "\xe9ac" )
+ ( "rollup" . "\xea20" )
+ ( "rollup-old" . "\xe9fd" )
+ ( "rot" . "\x1f764" )
+ ( "rspec" . "\xea31" )
+ ( "rst" . "\xe9cc" )
+ ( "sage" . "\xe9ab" )
+ ( "saltstack" . "\xe915" )
+ ( "sas" . "\xe95a" )
+ ( "sbt" . "\xe9d2" )
+ ( "sc" . "\xe9a2" )
+ ( "scheme" . "\x3bb" )
+ ( "scilab" . "\xe9a9" )
+ ( "scrutinizer" . "\xe9d4" )
+ ( "self" . "\xe9a8" )
+ ( "sequelize" . "\xea2f" )
+ ( "sf" . "\xe9db" )
+ ( "shen" . "\xe9a7" )
+ ( "shipit" . "\x26f5" )
+ ( "shippable" . "\xea2d" )
+ ( "shopify" . "\xe9cf" )
+ ( "shuriken" . "\x272b" )
+ ( "silverstripe" . "\xe800" )
+ ( "sinatra" . "\xea03" )
+ ( "sketch" . "\xe927" )
+ ( "sketchup-layout" . "\xea7c" )
+ ( "sketchup-make" . "\xea7e" )
+ ( "sketchup-stylebuilder" . "\xea7d" )
+ ( "slash" . "\xe9a6" )
+ ( "snyk" . "\xea1c" )
+ ( "solidity" . "\xea86" )
+ ( "sparql" . "\xe959" )
+ ( "spray" . "\xea02" )
+ ( "sqf" . "\xe9a5" )
+ ( "sqlite" . "\xe9dd" )
+ ( "squarespace" . "\xea5e" )
+ ( "stan" . "\xe9a4" )
+ ( "stata" . "\xe9a3" )
+ ( "storyist" . "\xe9ef" )
+ ( "strings" . "\xe9e0" )
+ ( "stylelint" . "\xe93d" )
+ ( "stylus" . "\x73" )
+ ( "stylus-full" . "\xe9f7" )
+ ( "stylus-orb" . "\x53" )
+ ( "sublime" . "\xe986" )
+ ( "sv" . "\xe9c3" )
+ ( "svn" . "\xea17" )
+ ( "swagger" . "\xea29" )
+ ( "tag" . "\xf015" )
+ ( "tcl" . "\xe956" )
+ ( "telegram" . "\x2708" )
+ ( "terminal" . "\xf0c8" )
+ ( "tern" . "\x1f54a" )
+ ( "terraform" . "\xe916" )
+ ( "test-coffeescript" . "\xea62" )
+ ( "test-dir" . "\xea60" )
+ ( "test-generic" . "\xea63" )
+ ( "test-js" . "\xea64" )
+ ( "test-perl" . "\xea65" )
+ ( "test-python" . "\xea66" )
+ ( "test-react" . "\xea67" )
+ ( "test-ruby" . "\xea68" )
+ ( "test-typescript" . "\xea69" )
+ ( "tex" . "\xe600" )
+ ( "textile" . "\x74" )
+ ( "textmate" . "\x2122" )
+ ( "thor" . "\xe9d8" )
+ ( "tinymce" . "\xea01" )
+ ( "tsx" . "\xe9d1" )
+ ( "tsx-alt" . "\xe9e7" )
+ ( "tt" . "\x54" )
+ ( "turing" . "\xe9b6" )
+ ( "twig" . "\x2e19" )
+ ( "twine" . "\xea5d" )
+ ( "txl" . "\xe9c1" )
+ ( "typedoc" . "\xe9fe" )
+ ( "typescript" . "\xe912" )
+ ( "typescript-alt" . "\x2a6" )
+ ( "typings" . "\xe9df" )
+ ( "uno" . "\xe9b3" )
+ ( "unreal" . "\x75" )
+ ( "urweb" . "\xe9ba" )
+ ( "v8" . "\xea1f" )
+ ( "vagrant" . "\x56" )
+ ( "vcl" . "\xe9b4" )
+ ( "verilog" . "\xe949" )
+ ( "vertex-shader" . "\xea79" )
+ ( "vhdl" . "\xe9aa" )
+ ( "video" . "\xf057" )
+ ( "virtualbox" . "\xea3e" )
+ ( "virtualbox-alt" . "\xea2e" )
+ ( "visio" . "\xea83" )
+ ( "vmware" . "\xea49" )
+ ( "vue" . "\xe906" )
+ ( "wasm" . "\xea70" )
+ ( "watchman" . "\xea4f" )
+ ( "webgl" . "\xea7b" )
+ ( "webpack" . "\xea61" )
+ ( "webpack-old" . "\xe91e" )
+ ( "wercker" . "\xea19" )
+ ( "word" . "\xe9ed" )
+ ( "x10" . "\x2169" )
+ ( "xamarin" . "\xea77" )
+ ( "xmos" . "\x58" )
+ ( "xpages" . "\xe9c5" )
+ ( "xtend" . "\xe9c6" )
+ ( "yarn" . "\xea1a" )
+ ( "yasm" . "\xea73" )
+ ( "yin-yang" . "\x262f" )
+ ( "yoyo" . "\xe975" )
+ ( "yui" . "\xea00" )
+ ( "zbrush" . "\xe9f2" )
+ ( "zephir" . "\xe9c7" )
+ ("zig" . "\x7A")
+ ( "zimpl" . "\xe9c8" )
+
+ )
+ )
+
+(provide 'data-fileicons)
diff --git a/elpa/all-the-icons-20220325.1238/data/data-fileicons.elc b/elpa/all-the-icons-20220325.1238/data/data-fileicons.elc
new file mode 100644
index 0000000..7f11538
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/data/data-fileicons.elc
Binary files differ
diff --git a/elpa/all-the-icons-20220325.1238/data/data-material.el b/elpa/all-the-icons-20220325.1238/data/data-material.el
new file mode 100644
index 0000000..bafcfe7
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/data/data-material.el
@@ -0,0 +1,935 @@
+(defvar all-the-icons-data/material-icons-alist
+ '(("3d_rotation" . "\xe84d")
+ ("ac_unit" . "\xeb3b")
+ ("access_alarm" . "\xe190")
+ ("access_alarms" . "\xe191")
+ ("access_time" . "\xe192")
+ ("accessibility" . "\xe84e")
+ ("accessible" . "\xe914")
+ ("account_balance" . "\xe84f")
+ ("account_balance_wallet" . "\xe850")
+ ("account_box" . "\xe851")
+ ("account_circle" . "\xe853")
+ ("adb" . "\xe60e")
+ ("add" . "\xe145")
+ ("add_a_photo" . "\xe439")
+ ("add_alarm" . "\xe193")
+ ("add_alert" . "\xe003")
+ ("add_box" . "\xe146")
+ ("add_circle" . "\xe147")
+ ("add_circle_outline" . "\xe148")
+ ("add_location" . "\xe567")
+ ("add_shopping_cart" . "\xe854")
+ ("add_to_photos" . "\xe39d")
+ ("add_to_queue" . "\xe05c")
+ ("adjust" . "\xe39e")
+ ("airline_seat_flat" . "\xe630")
+ ("airline_seat_flat_angled" . "\xe631")
+ ("airline_seat_individual_suite" . "\xe632")
+ ("airline_seat_legroom_extra" . "\xe633")
+ ("airline_seat_legroom_normal" . "\xe634")
+ ("airline_seat_legroom_reduced" . "\xe635")
+ ("airline_seat_recline_extra" . "\xe636")
+ ("airline_seat_recline_normal" . "\xe637")
+ ("airplanemode_active" . "\xe195")
+ ("airplanemode_inactive" . "\xe194")
+ ("airplay" . "\xe055")
+ ("airport_shuttle" . "\xeb3c")
+ ("alarm" . "\xe855")
+ ("alarm_add" . "\xe856")
+ ("alarm_off" . "\xe857")
+ ("alarm_on" . "\xe858")
+ ("album" . "\xe019")
+ ("all_inclusive" . "\xeb3d")
+ ("all_out" . "\xe90b")
+ ("android" . "\xe859")
+ ("announcement" . "\xe85a")
+ ("apps" . "\xe5c3")
+ ("archive" . "\xe149")
+ ("arrow_back" . "\xe5c4")
+ ("arrow_downward" . "\xe5db")
+ ("arrow_drop_down" . "\xe5c5")
+ ("arrow_drop_down_circle" . "\xe5c6")
+ ("arrow_drop_up" . "\xe5c7")
+ ("arrow_forward" . "\xe5c8")
+ ("arrow_upward" . "\xe5d8")
+ ("art_track" . "\xe060")
+ ("aspect_ratio" . "\xe85b")
+ ("assessment" . "\xe85c")
+ ("assignment" . "\xe85d")
+ ("assignment_ind" . "\xe85e")
+ ("assignment_late" . "\xe85f")
+ ("assignment_return" . "\xe860")
+ ("assignment_returned" . "\xe861")
+ ("assignment_turned_in" . "\xe862")
+ ("assistant" . "\xe39f")
+ ("assistant_photo" . "\xe3a0")
+ ("attach_file" . "\xe226")
+ ("attach_money" . "\xe227")
+ ("attachment" . "\xe2bc")
+ ("audiotrack" . "\xe3a1")
+ ("autorenew" . "\xe863")
+ ("av_timer" . "\xe01b")
+ ("backspace" . "\xe14a")
+ ("backup" . "\xe864")
+ ("battery_alert" . "\xe19c")
+ ("battery_charging_full" . "\xe1a3")
+ ("battery_full" . "\xe1a4")
+ ("battery_std" . "\xe1a5")
+ ("battery_unknown" . "\xe1a6")
+ ("beach_access" . "\xeb3e")
+ ("beenhere" . "\xe52d")
+ ("block" . "\xe14b")
+ ("bluetooth" . "\xe1a7")
+ ("bluetooth_audio" . "\xe60f")
+ ("bluetooth_connected" . "\xe1a8")
+ ("bluetooth_disabled" . "\xe1a9")
+ ("bluetooth_searching" . "\xe1aa")
+ ("blur_circular" . "\xe3a2")
+ ("blur_linear" . "\xe3a3")
+ ("blur_off" . "\xe3a4")
+ ("blur_on" . "\xe3a5")
+ ("book" . "\xe865")
+ ("bookmark" . "\xe866")
+ ("bookmark_border" . "\xe867")
+ ("border_all" . "\xe228")
+ ("border_bottom" . "\xe229")
+ ("border_clear" . "\xe22a")
+ ("border_color" . "\xe22b")
+ ("border_horizontal" . "\xe22c")
+ ("border_inner" . "\xe22d")
+ ("border_left" . "\xe22e")
+ ("border_outer" . "\xe22f")
+ ("border_right" . "\xe230")
+ ("border_style" . "\xe231")
+ ("border_top" . "\xe232")
+ ("border_vertical" . "\xe233")
+ ("branding_watermark" . "\xe06b")
+ ("brightness_1" . "\xe3a6")
+ ("brightness_2" . "\xe3a7")
+ ("brightness_3" . "\xe3a8")
+ ("brightness_4" . "\xe3a9")
+ ("brightness_5" . "\xe3aa")
+ ("brightness_6" . "\xe3ab")
+ ("brightness_7" . "\xe3ac")
+ ("brightness_auto" . "\xe1ab")
+ ("brightness_high" . "\xe1ac")
+ ("brightness_low" . "\xe1ad")
+ ("brightness_medium" . "\xe1ae")
+ ("broken_image" . "\xe3ad")
+ ("brush" . "\xe3ae")
+ ("bubble_chart" . "\xe6dd")
+ ("bug_report" . "\xe868")
+ ("build" . "\xe869")
+ ("burst_mode" . "\xe43c")
+ ("business" . "\xe0af")
+ ("business_center" . "\xeb3f")
+ ("cached" . "\xe86a")
+ ("cake" . "\xe7e9")
+ ("call" . "\xe0b0")
+ ("call_end" . "\xe0b1")
+ ("call_made" . "\xe0b2")
+ ("call_merge" . "\xe0b3")
+ ("call_missed" . "\xe0b4")
+ ("call_missed_outgoing" . "\xe0e4")
+ ("call_received" . "\xe0b5")
+ ("call_split" . "\xe0b6")
+ ("call_to_action" . "\xe06c")
+ ("camera" . "\xe3af")
+ ("camera_alt" . "\xe3b0")
+ ("camera_enhance" . "\xe8fc")
+ ("camera_front" . "\xe3b1")
+ ("camera_rear" . "\xe3b2")
+ ("camera_roll" . "\xe3b3")
+ ("cancel" . "\xe5c9")
+ ("card_giftcard" . "\xe8f6")
+ ("card_membership" . "\xe8f7")
+ ("card_travel" . "\xe8f8")
+ ("casino" . "\xeb40")
+ ("cast" . "\xe307")
+ ("cast_connected" . "\xe308")
+ ("center_focus_strong" . "\xe3b4")
+ ("center_focus_weak" . "\xe3b5")
+ ("change_history" . "\xe86b")
+ ("chat" . "\xe0b7")
+ ("chat_bubble" . "\xe0ca")
+ ("chat_bubble_outline" . "\xe0cb")
+ ("check" . "\xe5ca")
+ ("check_box" . "\xe834")
+ ("check_box_outline_blank" . "\xe835")
+ ("check_circle" . "\xe86c")
+ ("chevron_left" . "\xe5cb")
+ ("chevron_right" . "\xe5cc")
+ ("child_care" . "\xeb41")
+ ("child_friendly" . "\xeb42")
+ ("chrome_reader_mode" . "\xe86d")
+ ("class" . "\xe86e")
+ ("clear" . "\xe14c")
+ ("clear_all" . "\xe0b8")
+ ("close" . "\xe5cd")
+ ("closed_caption" . "\xe01c")
+ ("cloud" . "\xe2bd")
+ ("cloud_circle" . "\xe2be")
+ ("cloud_done" . "\xe2bf")
+ ("cloud_download" . "\xe2c0")
+ ("cloud_off" . "\xe2c1")
+ ("cloud_queue" . "\xe2c2")
+ ("cloud_upload" . "\xe2c3")
+ ("code" . "\xe86f")
+ ("collections" . "\xe3b6")
+ ("collections_bookmark" . "\xe431")
+ ("color_lens" . "\xe3b7")
+ ("colorize" . "\xe3b8")
+ ("comment" . "\xe0b9")
+ ("compare" . "\xe3b9")
+ ("compare_arrows" . "\xe915")
+ ("computer" . "\xe30a")
+ ("confirmation_number" . "\xe638")
+ ("contact_mail" . "\xe0d0")
+ ("contact_phone" . "\xe0cf")
+ ("contacts" . "\xe0ba")
+ ("content_copy" . "\xe14d")
+ ("content_cut" . "\xe14e")
+ ("content_paste" . "\xe14f")
+ ("control_point" . "\xe3ba")
+ ("control_point_duplicate" . "\xe3bb")
+ ("copyright" . "\xe90c")
+ ("create" . "\xe150")
+ ("create_new_folder" . "\xe2cc")
+ ("credit_card" . "\xe870")
+ ("crop" . "\xe3be")
+ ("crop_16_9" . "\xe3bc")
+ ("crop_3_2" . "\xe3bd")
+ ("crop_5_4" . "\xe3bf")
+ ("crop_7_5" . "\xe3c0")
+ ("crop_din" . "\xe3c1")
+ ("crop_free" . "\xe3c2")
+ ("crop_landscape" . "\xe3c3")
+ ("crop_original" . "\xe3c4")
+ ("crop_portrait" . "\xe3c5")
+ ("crop_rotate" . "\xe437")
+ ("crop_square" . "\xe3c6")
+ ("dashboard" . "\xe871")
+ ("data_usage" . "\xe1af")
+ ("date_range" . "\xe916")
+ ("dehaze" . "\xe3c7")
+ ("delete" . "\xe872")
+ ("delete_forever" . "\xe92b")
+ ("delete_sweep" . "\xe16c")
+ ("description" . "\xe873")
+ ("desktop_mac" . "\xe30b")
+ ("desktop_windows" . "\xe30c")
+ ("details" . "\xe3c8")
+ ("developer_board" . "\xe30d")
+ ("developer_mode" . "\xe1b0")
+ ("device_hub" . "\xe335")
+ ("devices" . "\xe1b1")
+ ("devices_other" . "\xe337")
+ ("dialer_sip" . "\xe0bb")
+ ("dialpad" . "\xe0bc")
+ ("directions" . "\xe52e")
+ ("directions_bike" . "\xe52f")
+ ("directions_boat" . "\xe532")
+ ("directions_bus" . "\xe530")
+ ("directions_car" . "\xe531")
+ ("directions_railway" . "\xe534")
+ ("directions_run" . "\xe566")
+ ("directions_subway" . "\xe533")
+ ("directions_transit" . "\xe535")
+ ("directions_walk" . "\xe536")
+ ("disc_full" . "\xe610")
+ ("dns" . "\xe875")
+ ("do_not_disturb" . "\xe612")
+ ("do_not_disturb_alt" . "\xe611")
+ ("do_not_disturb_off" . "\xe643")
+ ("do_not_disturb_on" . "\xe644")
+ ("dock" . "\xe30e")
+ ("domain" . "\xe7ee")
+ ("done" . "\xe876")
+ ("done_all" . "\xe877")
+ ("donut_large" . "\xe917")
+ ("donut_small" . "\xe918")
+ ("drafts" . "\xe151")
+ ("drag_handle" . "\xe25d")
+ ("drive_eta" . "\xe613")
+ ("dvr" . "\xe1b2")
+ ("edit" . "\xe3c9")
+ ("edit_location" . "\xe568")
+ ("eject" . "\xe8fb")
+ ("email" . "\xe0be")
+ ("enhanced_encryption" . "\xe63f")
+ ("equalizer" . "\xe01d")
+ ("error" . "\xe000")
+ ("error_outline" . "\xe001")
+ ("euro_symbol" . "\xe926")
+ ("ev_station" . "\xe56d")
+ ("event" . "\xe878")
+ ("event_available" . "\xe614")
+ ("event_busy" . "\xe615")
+ ("event_note" . "\xe616")
+ ("event_seat" . "\xe903")
+ ("exit_to_app" . "\xe879")
+ ("expand_less" . "\xe5ce")
+ ("expand_more" . "\xe5cf")
+ ("explicit" . "\xe01e")
+ ("explore" . "\xe87a")
+ ("exposure" . "\xe3ca")
+ ("exposure_neg_1" . "\xe3cb")
+ ("exposure_neg_2" . "\xe3cc")
+ ("exposure_plus_1" . "\xe3cd")
+ ("exposure_plus_2" . "\xe3ce")
+ ("exposure_zero" . "\xe3cf")
+ ("extension" . "\xe87b")
+ ("face" . "\xe87c")
+ ("fast_forward" . "\xe01f")
+ ("fast_rewind" . "\xe020")
+ ("favorite" . "\xe87d")
+ ("favorite_border" . "\xe87e")
+ ("featured_play_list" . "\xe06d")
+ ("featured_video" . "\xe06e")
+ ("feedback" . "\xe87f")
+ ("fiber_dvr" . "\xe05d")
+ ("fiber_manual_record" . "\xe061")
+ ("fiber_new" . "\xe05e")
+ ("fiber_pin" . "\xe06a")
+ ("fiber_smart_record" . "\xe062")
+ ("file_download" . "\xe2c4")
+ ("file_upload" . "\xe2c6")
+ ("filter" . "\xe3d3")
+ ("filter_1" . "\xe3d0")
+ ("filter_2" . "\xe3d1")
+ ("filter_3" . "\xe3d2")
+ ("filter_4" . "\xe3d4")
+ ("filter_5" . "\xe3d5")
+ ("filter_6" . "\xe3d6")
+ ("filter_7" . "\xe3d7")
+ ("filter_8" . "\xe3d8")
+ ("filter_9" . "\xe3d9")
+ ("filter_9_plus" . "\xe3da")
+ ("filter_b_and_w" . "\xe3db")
+ ("filter_center_focus" . "\xe3dc")
+ ("filter_drama" . "\xe3dd")
+ ("filter_frames" . "\xe3de")
+ ("filter_hdr" . "\xe3df")
+ ("filter_list" . "\xe152")
+ ("filter_none" . "\xe3e0")
+ ("filter_tilt_shift" . "\xe3e2")
+ ("filter_vintage" . "\xe3e3")
+ ("find_in_page" . "\xe880")
+ ("find_replace" . "\xe881")
+ ("fingerprint" . "\xe90d")
+ ("first_page" . "\xe5dc")
+ ("fitness_center" . "\xeb43")
+ ("flag" . "\xe153")
+ ("flare" . "\xe3e4")
+ ("flash_auto" . "\xe3e5")
+ ("flash_off" . "\xe3e6")
+ ("flash_on" . "\xe3e7")
+ ("flight" . "\xe539")
+ ("flight_land" . "\xe904")
+ ("flight_takeoff" . "\xe905")
+ ("flip" . "\xe3e8")
+ ("flip_to_back" . "\xe882")
+ ("flip_to_front" . "\xe883")
+ ("folder" . "\xe2c7")
+ ("folder_open" . "\xe2c8")
+ ("folder_shared" . "\xe2c9")
+ ("folder_special" . "\xe617")
+ ("font_download" . "\xe167")
+ ("format_align_center" . "\xe234")
+ ("format_align_justify" . "\xe235")
+ ("format_align_left" . "\xe236")
+ ("format_align_right" . "\xe237")
+ ("format_bold" . "\xe238")
+ ("format_clear" . "\xe239")
+ ("format_color_fill" . "\xe23a")
+ ("format_color_reset" . "\xe23b")
+ ("format_color_text" . "\xe23c")
+ ("format_indent_decrease" . "\xe23d")
+ ("format_indent_increase" . "\xe23e")
+ ("format_italic" . "\xe23f")
+ ("format_line_spacing" . "\xe240")
+ ("format_list_bulleted" . "\xe241")
+ ("format_list_numbered" . "\xe242")
+ ("format_paint" . "\xe243")
+ ("format_quote" . "\xe244")
+ ("format_shapes" . "\xe25e")
+ ("format_size" . "\xe245")
+ ("format_strikethrough" . "\xe246")
+ ("format_textdirection_l_to_r" . "\xe247")
+ ("format_textdirection_r_to_l" . "\xe248")
+ ("format_underlined" . "\xe249")
+ ("forum" . "\xe0bf")
+ ("forward" . "\xe154")
+ ("forward_10" . "\xe056")
+ ("forward_30" . "\xe057")
+ ("forward_5" . "\xe058")
+ ("free_breakfast" . "\xeb44")
+ ("fullscreen" . "\xe5d0")
+ ("fullscreen_exit" . "\xe5d1")
+ ("functions" . "\xe24a")
+ ("g_translate" . "\xe927")
+ ("gamepad" . "\xe30f")
+ ("games" . "\xe021")
+ ("gavel" . "\xe90e")
+ ("gesture" . "\xe155")
+ ("get_app" . "\xe884")
+ ("gif" . "\xe908")
+ ("golf_course" . "\xeb45")
+ ("gps_fixed" . "\xe1b3")
+ ("gps_not_fixed" . "\xe1b4")
+ ("gps_off" . "\xe1b5")
+ ("grade" . "\xe885")
+ ("gradient" . "\xe3e9")
+ ("grain" . "\xe3ea")
+ ("graphic_eq" . "\xe1b8")
+ ("grid_off" . "\xe3eb")
+ ("grid_on" . "\xe3ec")
+ ("group" . "\xe7ef")
+ ("group_add" . "\xe7f0")
+ ("group_work" . "\xe886")
+ ("hd" . "\xe052")
+ ("hdr_off" . "\xe3ed")
+ ("hdr_on" . "\xe3ee")
+ ("hdr_strong" . "\xe3f1")
+ ("hdr_weak" . "\xe3f2")
+ ("headset" . "\xe310")
+ ("headset_mic" . "\xe311")
+ ("healing" . "\xe3f3")
+ ("hearing" . "\xe023")
+ ("help" . "\xe887")
+ ("help_outline" . "\xe8fd")
+ ("high_quality" . "\xe024")
+ ("highlight" . "\xe25f")
+ ("highlight_off" . "\xe888")
+ ("history" . "\xe889")
+ ("home" . "\xe88a")
+ ("hot_tub" . "\xeb46")
+ ("hotel" . "\xe53a")
+ ("hourglass_empty" . "\xe88b")
+ ("hourglass_full" . "\xe88c")
+ ("http" . "\xe902")
+ ("https" . "\xe88d")
+ ("image" . "\xe3f4")
+ ("image_aspect_ratio" . "\xe3f5")
+ ("import_contacts" . "\xe0e0")
+ ("import_export" . "\xe0c3")
+ ("important_devices" . "\xe912")
+ ("inbox" . "\xe156")
+ ("indeterminate_check_box" . "\xe909")
+ ("info" . "\xe88e")
+ ("info_outline" . "\xe88f")
+ ("input" . "\xe890")
+ ("insert_chart" . "\xe24b")
+ ("insert_comment" . "\xe24c")
+ ("insert_drive_file" . "\xe24d")
+ ("insert_emoticon" . "\xe24e")
+ ("insert_invitation" . "\xe24f")
+ ("insert_link" . "\xe250")
+ ("insert_photo" . "\xe251")
+ ("invert_colors" . "\xe891")
+ ("invert_colors_off" . "\xe0c4")
+ ("iso" . "\xe3f6")
+ ("keyboard" . "\xe312")
+ ("keyboard_arrow_down" . "\xe313")
+ ("keyboard_arrow_left" . "\xe314")
+ ("keyboard_arrow_right" . "\xe315")
+ ("keyboard_arrow_up" . "\xe316")
+ ("keyboard_backspace" . "\xe317")
+ ("keyboard_capslock" . "\xe318")
+ ("keyboard_hide" . "\xe31a")
+ ("keyboard_return" . "\xe31b")
+ ("keyboard_tab" . "\xe31c")
+ ("keyboard_voice" . "\xe31d")
+ ("kitchen" . "\xeb47")
+ ("label" . "\xe892")
+ ("label_outline" . "\xe893")
+ ("landscape" . "\xe3f7")
+ ("language" . "\xe894")
+ ("laptop" . "\xe31e")
+ ("laptop_chromebook" . "\xe31f")
+ ("laptop_mac" . "\xe320")
+ ("laptop_windows" . "\xe321")
+ ("last_page" . "\xe5dd")
+ ("launch" . "\xe895")
+ ("layers" . "\xe53b")
+ ("layers_clear" . "\xe53c")
+ ("leak_add" . "\xe3f8")
+ ("leak_remove" . "\xe3f9")
+ ("lens" . "\xe3fa")
+ ("library_add" . "\xe02e")
+ ("library_books" . "\xe02f")
+ ("library_music" . "\xe030")
+ ("lightbulb_outline" . "\xe90f")
+ ("line_style" . "\xe919")
+ ("line_weight" . "\xe91a")
+ ("linear_scale" . "\xe260")
+ ("link" . "\xe157")
+ ("linked_camera" . "\xe438")
+ ("list" . "\xe896")
+ ("live_help" . "\xe0c6")
+ ("live_tv" . "\xe639")
+ ("local_activity" . "\xe53f")
+ ("local_airport" . "\xe53d")
+ ("local_atm" . "\xe53e")
+ ("local_bar" . "\xe540")
+ ("local_cafe" . "\xe541")
+ ("local_car_wash" . "\xe542")
+ ("local_convenience_store" . "\xe543")
+ ("local_dining" . "\xe556")
+ ("local_drink" . "\xe544")
+ ("local_florist" . "\xe545")
+ ("local_gas_station" . "\xe546")
+ ("local_grocery_store" . "\xe547")
+ ("local_hospital" . "\xe548")
+ ("local_hotel" . "\xe549")
+ ("local_laundry_service" . "\xe54a")
+ ("local_library" . "\xe54b")
+ ("local_mall" . "\xe54c")
+ ("local_movies" . "\xe54d")
+ ("local_offer" . "\xe54e")
+ ("local_parking" . "\xe54f")
+ ("local_pharmacy" . "\xe550")
+ ("local_phone" . "\xe551")
+ ("local_pizza" . "\xe552")
+ ("local_play" . "\xe553")
+ ("local_post_office" . "\xe554")
+ ("local_printshop" . "\xe555")
+ ("local_see" . "\xe557")
+ ("local_shipping" . "\xe558")
+ ("local_taxi" . "\xe559")
+ ("location_city" . "\xe7f1")
+ ("location_disabled" . "\xe1b6")
+ ("location_off" . "\xe0c7")
+ ("location_on" . "\xe0c8")
+ ("location_searching" . "\xe1b7")
+ ("lock" . "\xe897")
+ ("lock_open" . "\xe898")
+ ("lock_outline" . "\xe899")
+ ("looks" . "\xe3fc")
+ ("looks_3" . "\xe3fb")
+ ("looks_4" . "\xe3fd")
+ ("looks_5" . "\xe3fe")
+ ("looks_6" . "\xe3ff")
+ ("looks_one" . "\xe400")
+ ("looks_two" . "\xe401")
+ ("loop" . "\xe028")
+ ("loupe" . "\xe402")
+ ("low_priority" . "\xe16d")
+ ("loyalty" . "\xe89a")
+ ("mail" . "\xe158")
+ ("mail_outline" . "\xe0e1")
+ ("map" . "\xe55b")
+ ("markunread" . "\xe159")
+ ("markunread_mailbox" . "\xe89b")
+ ("memory" . "\xe322")
+ ("menu" . "\xe5d2")
+ ("merge_type" . "\xe252")
+ ("message" . "\xe0c9")
+ ("mic" . "\xe029")
+ ("mic_none" . "\xe02a")
+ ("mic_off" . "\xe02b")
+ ("mms" . "\xe618")
+ ("mode_comment" . "\xe253")
+ ("mode_edit" . "\xe254")
+ ("monetization_on" . "\xe263")
+ ("money_off" . "\xe25c")
+ ("monochrome_photos" . "\xe403")
+ ("mood" . "\xe7f2")
+ ("mood_bad" . "\xe7f3")
+ ("more" . "\xe619")
+ ("more_horiz" . "\xe5d3")
+ ("more_vert" . "\xe5d4")
+ ("motorcycle" . "\xe91b")
+ ("mouse" . "\xe323")
+ ("move_to_inbox" . "\xe168")
+ ("movie" . "\xe02c")
+ ("movie_creation" . "\xe404")
+ ("movie_filter" . "\xe43a")
+ ("multiline_chart" . "\xe6df")
+ ("music_note" . "\xe405")
+ ("music_video" . "\xe063")
+ ("my_location" . "\xe55c")
+ ("nature" . "\xe406")
+ ("nature_people" . "\xe407")
+ ("navigate_before" . "\xe408")
+ ("navigate_next" . "\xe409")
+ ("navigation" . "\xe55d")
+ ("near_me" . "\xe569")
+ ("network_cell" . "\xe1b9")
+ ("network_check" . "\xe640")
+ ("network_locked" . "\xe61a")
+ ("network_wifi" . "\xe1ba")
+ ("new_releases" . "\xe031")
+ ("next_week" . "\xe16a")
+ ("nfc" . "\xe1bb")
+ ("no_encryption" . "\xe641")
+ ("no_sim" . "\xe0cc")
+ ("not_interested" . "\xe033")
+ ("note" . "\xe06f")
+ ("note_add" . "\xe89c")
+ ("notifications" . "\xe7f4")
+ ("notifications_active" . "\xe7f7")
+ ("notifications_none" . "\xe7f5")
+ ("notifications_off" . "\xe7f6")
+ ("notifications_paused" . "\xe7f8")
+ ("offline_pin" . "\xe90a")
+ ("ondemand_video" . "\xe63a")
+ ("opacity" . "\xe91c")
+ ("open_in_browser" . "\xe89d")
+ ("open_in_new" . "\xe89e")
+ ("open_with" . "\xe89f")
+ ("pages" . "\xe7f9")
+ ("pageview" . "\xe8a0")
+ ("palette" . "\xe40a")
+ ("pan_tool" . "\xe925")
+ ("panorama" . "\xe40b")
+ ("panorama_fish_eye" . "\xe40c")
+ ("panorama_horizontal" . "\xe40d")
+ ("panorama_vertical" . "\xe40e")
+ ("panorama_wide_angle" . "\xe40f")
+ ("party_mode" . "\xe7fa")
+ ("pause" . "\xe034")
+ ("pause_circle_filled" . "\xe035")
+ ("pause_circle_outline" . "\xe036")
+ ("payment" . "\xe8a1")
+ ("people" . "\xe7fb")
+ ("people_outline" . "\xe7fc")
+ ("perm_camera_mic" . "\xe8a2")
+ ("perm_contact_calendar" . "\xe8a3")
+ ("perm_data_setting" . "\xe8a4")
+ ("perm_device_information" . "\xe8a5")
+ ("perm_identity" . "\xe8a6")
+ ("perm_media" . "\xe8a7")
+ ("perm_phone_msg" . "\xe8a8")
+ ("perm_scan_wifi" . "\xe8a9")
+ ("person" . "\xe7fd")
+ ("person_add" . "\xe7fe")
+ ("person_outline" . "\xe7ff")
+ ("person_pin" . "\xe55a")
+ ("person_pin_circle" . "\xe56a")
+ ("personal_video" . "\xe63b")
+ ("pets" . "\xe91d")
+ ("phone" . "\xe0cd")
+ ("phone_android" . "\xe324")
+ ("phone_bluetooth_speaker" . "\xe61b")
+ ("phone_forwarded" . "\xe61c")
+ ("phone_in_talk" . "\xe61d")
+ ("phone_iphone" . "\xe325")
+ ("phone_locked" . "\xe61e")
+ ("phone_missed" . "\xe61f")
+ ("phone_paused" . "\xe620")
+ ("phonelink" . "\xe326")
+ ("phonelink_erase" . "\xe0db")
+ ("phonelink_lock" . "\xe0dc")
+ ("phonelink_off" . "\xe327")
+ ("phonelink_ring" . "\xe0dd")
+ ("phonelink_setup" . "\xe0de")
+ ("photo" . "\xe410")
+ ("photo_album" . "\xe411")
+ ("photo_camera" . "\xe412")
+ ("photo_filter" . "\xe43b")
+ ("photo_library" . "\xe413")
+ ("photo_size_select_actual" . "\xe432")
+ ("photo_size_select_large" . "\xe433")
+ ("photo_size_select_small" . "\xe434")
+ ("picture_as_pdf" . "\xe415")
+ ("picture_in_picture" . "\xe8aa")
+ ("picture_in_picture_alt" . "\xe911")
+ ("pie_chart" . "\xe6c4")
+ ("pie_chart_outlined" . "\xe6c5")
+ ("pin_drop" . "\xe55e")
+ ("place" . "\xe55f")
+ ("play_arrow" . "\xe037")
+ ("play_circle_filled" . "\xe038")
+ ("play_circle_outline" . "\xe039")
+ ("play_for_work" . "\xe906")
+ ("playlist_add" . "\xe03b")
+ ("playlist_add_check" . "\xe065")
+ ("playlist_play" . "\xe05f")
+ ("plus_one" . "\xe800")
+ ("poll" . "\xe801")
+ ("polymer" . "\xe8ab")
+ ("pool" . "\xeb48")
+ ("portable_wifi_off" . "\xe0ce")
+ ("portrait" . "\xe416")
+ ("power" . "\xe63c")
+ ("power_input" . "\xe336")
+ ("power_settings_new" . "\xe8ac")
+ ("pregnant_woman" . "\xe91e")
+ ("present_to_all" . "\xe0df")
+ ("print" . "\xe8ad")
+ ("priority_high" . "\xe645")
+ ("public" . "\xe80b")
+ ("publish" . "\xe255")
+ ("query_builder" . "\xe8ae")
+ ("question_answer" . "\xe8af")
+ ("queue" . "\xe03c")
+ ("queue_music" . "\xe03d")
+ ("queue_play_next" . "\xe066")
+ ("radio" . "\xe03e")
+ ("radio_button_checked" . "\xe837")
+ ("radio_button_unchecked" . "\xe836")
+ ("rate_review" . "\xe560")
+ ("receipt" . "\xe8b0")
+ ("recent_actors" . "\xe03f")
+ ("record_voice_over" . "\xe91f")
+ ("redeem" . "\xe8b1")
+ ("redo" . "\xe15a")
+ ("refresh" . "\xe5d5")
+ ("remove" . "\xe15b")
+ ("remove_circle" . "\xe15c")
+ ("remove_circle_outline" . "\xe15d")
+ ("remove_from_queue" . "\xe067")
+ ("remove_red_eye" . "\xe417")
+ ("remove_shopping_cart" . "\xe928")
+ ("reorder" . "\xe8fe")
+ ("repeat" . "\xe040")
+ ("repeat_one" . "\xe041")
+ ("replay" . "\xe042")
+ ("replay_10" . "\xe059")
+ ("replay_30" . "\xe05a")
+ ("replay_5" . "\xe05b")
+ ("reply" . "\xe15e")
+ ("reply_all" . "\xe15f")
+ ("report" . "\xe160")
+ ("report_problem" . "\xe8b2")
+ ("restaurant" . "\xe56c")
+ ("restaurant_menu" . "\xe561")
+ ("restore" . "\xe8b3")
+ ("restore_page" . "\xe929")
+ ("ring_volume" . "\xe0d1")
+ ("room" . "\xe8b4")
+ ("room_service" . "\xeb49")
+ ("rotate_90_degrees_ccw" . "\xe418")
+ ("rotate_left" . "\xe419")
+ ("rotate_right" . "\xe41a")
+ ("rounded_corner" . "\xe920")
+ ("router" . "\xe328")
+ ("rowing" . "\xe921")
+ ("rss_feed" . "\xe0e5")
+ ("rv_hookup" . "\xe642")
+ ("satellite" . "\xe562")
+ ("save" . "\xe161")
+ ("scanner" . "\xe329")
+ ("schedule" . "\xe8b5")
+ ("school" . "\xe80c")
+ ("screen_lock_landscape" . "\xe1be")
+ ("screen_lock_portrait" . "\xe1bf")
+ ("screen_lock_rotation" . "\xe1c0")
+ ("screen_rotation" . "\xe1c1")
+ ("screen_share" . "\xe0e2")
+ ("sd_card" . "\xe623")
+ ("sd_storage" . "\xe1c2")
+ ("search" . "\xe8b6")
+ ("security" . "\xe32a")
+ ("select_all" . "\xe162")
+ ("send" . "\xe163")
+ ("sentiment_dissatisfied" . "\xe811")
+ ("sentiment_neutral" . "\xe812")
+ ("sentiment_satisfied" . "\xe813")
+ ("sentiment_very_dissatisfied" . "\xe814")
+ ("sentiment_very_satisfied" . "\xe815")
+ ("settings" . "\xe8b8")
+ ("settings_applications" . "\xe8b9")
+ ("settings_backup_restore" . "\xe8ba")
+ ("settings_bluetooth" . "\xe8bb")
+ ("settings_brightness" . "\xe8bd")
+ ("settings_cell" . "\xe8bc")
+ ("settings_ethernet" . "\xe8be")
+ ("settings_input_antenna" . "\xe8bf")
+ ("settings_input_component" . "\xe8c0")
+ ("settings_input_composite" . "\xe8c1")
+ ("settings_input_hdmi" . "\xe8c2")
+ ("settings_input_svideo" . "\xe8c3")
+ ("settings_overscan" . "\xe8c4")
+ ("settings_phone" . "\xe8c5")
+ ("settings_power" . "\xe8c6")
+ ("settings_remote" . "\xe8c7")
+ ("settings_system_daydream" . "\xe1c3")
+ ("settings_voice" . "\xe8c8")
+ ("share" . "\xe80d")
+ ("shop" . "\xe8c9")
+ ("shop_two" . "\xe8ca")
+ ("shopping_basket" . "\xe8cb")
+ ("shopping_cart" . "\xe8cc")
+ ("short_text" . "\xe261")
+ ("show_chart" . "\xe6e1")
+ ("shuffle" . "\xe043")
+ ("signal_cellular_4_bar" . "\xe1c8")
+ ("signal_cellular_connected_no_internet_4_bar" . "\xe1cd")
+ ("signal_cellular_no_sim" . "\xe1ce")
+ ("signal_cellular_null" . "\xe1cf")
+ ("signal_cellular_off" . "\xe1d0")
+ ("signal_wifi_4_bar" . "\xe1d8")
+ ("signal_wifi_4_bar_lock" . "\xe1d9")
+ ("signal_wifi_off" . "\xe1da")
+ ("sim_card" . "\xe32b")
+ ("sim_card_alert" . "\xe624")
+ ("skip_next" . "\xe044")
+ ("skip_previous" . "\xe045")
+ ("slideshow" . "\xe41b")
+ ("slow_motion_video" . "\xe068")
+ ("smartphone" . "\xe32c")
+ ("smoke_free" . "\xeb4a")
+ ("smoking_rooms" . "\xeb4b")
+ ("sms" . "\xe625")
+ ("sms_failed" . "\xe626")
+ ("snooze" . "\xe046")
+ ("sort" . "\xe164")
+ ("sort_by_alpha" . "\xe053")
+ ("spa" . "\xeb4c")
+ ("space_bar" . "\xe256")
+ ("speaker" . "\xe32d")
+ ("speaker_group" . "\xe32e")
+ ("speaker_notes" . "\xe8cd")
+ ("speaker_notes_off" . "\xe92a")
+ ("speaker_phone" . "\xe0d2")
+ ("spellcheck" . "\xe8ce")
+ ("star" . "\xe838")
+ ("star_border" . "\xe83a")
+ ("star_half" . "\xe839")
+ ("stars" . "\xe8d0")
+ ("stay_current_landscape" . "\xe0d3")
+ ("stay_current_portrait" . "\xe0d4")
+ ("stay_primary_landscape" . "\xe0d5")
+ ("stay_primary_portrait" . "\xe0d6")
+ ("stop" . "\xe047")
+ ("stop_screen_share" . "\xe0e3")
+ ("storage" . "\xe1db")
+ ("store" . "\xe8d1")
+ ("store_mall_directory" . "\xe563")
+ ("straighten" . "\xe41c")
+ ("streetview" . "\xe56e")
+ ("strikethrough_s" . "\xe257")
+ ("style" . "\xe41d")
+ ("subdirectory_arrow_left" . "\xe5d9")
+ ("subdirectory_arrow_right" . "\xe5da")
+ ("subject" . "\xe8d2")
+ ("subscriptions" . "\xe064")
+ ("subtitles" . "\xe048")
+ ("subway" . "\xe56f")
+ ("supervisor_account" . "\xe8d3")
+ ("surround_sound" . "\xe049")
+ ("swap_calls" . "\xe0d7")
+ ("swap_horiz" . "\xe8d4")
+ ("swap_vert" . "\xe8d5")
+ ("swap_vertical_circle" . "\xe8d6")
+ ("switch_camera" . "\xe41e")
+ ("switch_video" . "\xe41f")
+ ("sync" . "\xe627")
+ ("sync_disabled" . "\xe628")
+ ("sync_problem" . "\xe629")
+ ("system_update" . "\xe62a")
+ ("system_update_alt" . "\xe8d7")
+ ("tab" . "\xe8d8")
+ ("tab_unselected" . "\xe8d9")
+ ("tablet" . "\xe32f")
+ ("tablet_android" . "\xe330")
+ ("tablet_mac" . "\xe331")
+ ("tag_faces" . "\xe420")
+ ("tap_and_play" . "\xe62b")
+ ("terrain" . "\xe564")
+ ("text_fields" . "\xe262")
+ ("text_format" . "\xe165")
+ ("textsms" . "\xe0d8")
+ ("texture" . "\xe421")
+ ("theaters" . "\xe8da")
+ ("thumb_down" . "\xe8db")
+ ("thumb_up" . "\xe8dc")
+ ("thumbs_up_down" . "\xe8dd")
+ ("time_to_leave" . "\xe62c")
+ ("timelapse" . "\xe422")
+ ("timeline" . "\xe922")
+ ("timer" . "\xe425")
+ ("timer_10" . "\xe423")
+ ("timer_3" . "\xe424")
+ ("timer_off" . "\xe426")
+ ("title" . "\xe264")
+ ("toc" . "\xe8de")
+ ("today" . "\xe8df")
+ ("toll" . "\xe8e0")
+ ("tonality" . "\xe427")
+ ("touch_app" . "\xe913")
+ ("toys" . "\xe332")
+ ("track_changes" . "\xe8e1")
+ ("traffic" . "\xe565")
+ ("train" . "\xe570")
+ ("tram" . "\xe571")
+ ("transfer_within_a_station" . "\xe572")
+ ("transform" . "\xe428")
+ ("translate" . "\xe8e2")
+ ("trending_down" . "\xe8e3")
+ ("trending_flat" . "\xe8e4")
+ ("trending_up" . "\xe8e5")
+ ("tune" . "\xe429")
+ ("turned_in" . "\xe8e6")
+ ("turned_in_not" . "\xe8e7")
+ ("tv" . "\xe333")
+ ("unarchive" . "\xe169")
+ ("undo" . "\xe166")
+ ("unfold_less" . "\xe5d6")
+ ("unfold_more" . "\xe5d7")
+ ("update" . "\xe923")
+ ("usb" . "\xe1e0")
+ ("verified_user" . "\xe8e8")
+ ("vertical_align_bottom" . "\xe258")
+ ("vertical_align_center" . "\xe259")
+ ("vertical_align_top" . "\xe25a")
+ ("vibration" . "\xe62d")
+ ("video_call" . "\xe070")
+ ("video_label" . "\xe071")
+ ("video_library" . "\xe04a")
+ ("videocam" . "\xe04b")
+ ("videocam_off" . "\xe04c")
+ ("videogame_asset" . "\xe338")
+ ("view_agenda" . "\xe8e9")
+ ("view_array" . "\xe8ea")
+ ("view_carousel" . "\xe8eb")
+ ("view_column" . "\xe8ec")
+ ("view_comfy" . "\xe42a")
+ ("view_compact" . "\xe42b")
+ ("view_day" . "\xe8ed")
+ ("view_headline" . "\xe8ee")
+ ("view_list" . "\xe8ef")
+ ("view_module" . "\xe8f0")
+ ("view_quilt" . "\xe8f1")
+ ("view_stream" . "\xe8f2")
+ ("view_week" . "\xe8f3")
+ ("vignette" . "\xe435")
+ ("visibility" . "\xe8f4")
+ ("visibility_off" . "\xe8f5")
+ ("voice_chat" . "\xe62e")
+ ("voicemail" . "\xe0d9")
+ ("volume_down" . "\xe04d")
+ ("volume_mute" . "\xe04e")
+ ("volume_off" . "\xe04f")
+ ("volume_up" . "\xe050")
+ ("vpn_key" . "\xe0da")
+ ("vpn_lock" . "\xe62f")
+ ("wallpaper" . "\xe1bc")
+ ("warning" . "\xe002")
+ ("watch" . "\xe334")
+ ("watch_later" . "\xe924")
+ ("wb_auto" . "\xe42c")
+ ("wb_cloudy" . "\xe42d")
+ ("wb_incandescent" . "\xe42e")
+ ("wb_iridescent" . "\xe436")
+ ("wb_sunny" . "\xe430")
+ ("wc" . "\xe63d")
+ ("web" . "\xe051")
+ ("web_asset" . "\xe069")
+ ("weekend" . "\xe16b")
+ ("whatshot" . "\xe80e")
+ ("widgets" . "\xe1bd")
+ ("wifi" . "\xe63e")
+ ("wifi_lock" . "\xe1e1")
+ ("wifi_tethering" . "\xe1e2")
+ ("work" . "\xe8f9")
+ ("wrap_text" . "\xe25b")
+ ("youtube_searched_for" . "\xe8fa")
+ ("zoom_in" . "\xe8ff")
+ ("zoom_out" . "\xe900")
+ ("zoom_out_map" . "\xe56b")))
+
+ (provide 'data-material)
diff --git a/elpa/all-the-icons-20220325.1238/data/data-material.elc b/elpa/all-the-icons-20220325.1238/data/data-material.elc
new file mode 100644
index 0000000..96cb645
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/data/data-material.elc
Binary files differ
diff --git a/elpa/all-the-icons-20220325.1238/data/data-octicons.el b/elpa/all-the-icons-20220325.1238/data/data-octicons.el
new file mode 100644
index 0000000..432251e
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/data/data-octicons.el
@@ -0,0 +1,165 @@
+(defvar all-the-icons-data/octicons-alist
+ '(
+
+ ("alert" . "\xf02d")
+ ("arrow-down" . "\xf03f")
+ ("arrow-left" . "\xf040")
+ ("arrow-right" . "\xf03e")
+ ("arrow-small-down" . "\xf0a0")
+ ("arrow-small-left" . "\xf0a1")
+ ("arrow-small-right" . "\xf071")
+ ("arrow-small-up" . "\xf09f")
+ ("arrow-up" . "\xf03d")
+ ("book" . "\xf007")
+ ("bookmark" . "\xf07b")
+ ("briefcase" . "\xf0d3")
+ ("broadcast" . "\xf048")
+ ("browser" . "\xf0c5")
+ ("bug" . "\xf091")
+ ("calendar" . "\xf068")
+ ("check" . "\xf03a")
+ ("checklist" . "\xf076")
+ ("chevron-down" . "\xf0a3")
+ ("chevron-left" . "\xf0a4")
+ ("chevron-right" . "\xf078")
+ ("chevron-up" . "\xf0a2")
+ ("circle-slash" . "\xf084")
+ ("circuit-board" . "\xf0d6")
+ ("clippy" . "\xf035")
+ ("clock" . "\xf046")
+ ("cloud-download" . "\xf00b")
+ ("cloud-upload" . "\xf00c")
+ ("code" . "\xf05f")
+ ("comment" . "\xf02b")
+ ("comment-discussion" . "\xf04f")
+ ("credit-card" . "\xf045")
+ ("dash" . "\xf0ca")
+ ("dashboard" . "\xf07d")
+ ("database" . "\xf096")
+ ("device-camera" . "\xf056")
+ ("device-camera-video" . "\xf057")
+ ("device-desktop" . "\xf27c")
+ ("device-mobile" . "\xf038")
+ ("diff" . "\xf04d")
+ ("diff-added" . "\xf06b")
+ ("diff-ignored" . "\xf099")
+ ("diff-modified" . "\xf06d")
+ ("diff-removed" . "\xf06c")
+ ("diff-renamed" . "\xf06e")
+ ("ellipsis" . "\xf09a")
+ ("eye" . "\xf04e")
+ ("file-binary" . "\xf094")
+ ("file-code" . "\xf010")
+ ("file-directory" . "\xf016")
+ ("file-media" . "\xf012")
+ ("file-pdf" . "\xf014")
+ ("file-submodule" . "\xf017")
+ ("file-symlink-directory" . "\xf0b1")
+ ("file-symlink-file" . "\xf0b0")
+ ("file-text" . "\xf011")
+ ("file-zip" . "\xf013")
+ ("flame" . "\xf0d2")
+ ("fold" . "\xf0cc")
+ ("gear" . "\xf02f")
+ ("gift" . "\xf042")
+ ("gist" . "\xf00e")
+ ("gist-secret" . "\xf08c")
+ ("git-branch" . "\xf020")
+ ("git-commit" . "\xf01f")
+ ("git-compare" . "\xf0ac")
+ ("git-merge" . "\xf023")
+ ("git-pull-request" . "\xf009")
+ ("globe" . "\xf0b6")
+ ("graph" . "\xf043")
+ ("beaker" . "\xf0dd")
+ ("heart" . "\x2665")
+ ("history" . "\xf07e")
+ ("home" . "\xf08d")
+ ("horizontal-rule" . "\xf070")
+ ("hourglass" . "\xf09e")
+ ("hubot" . "\xf09d")
+ ("inbox" . "\xf0cf")
+ ("info" . "\xf059")
+ ("issue-closed" . "\xf028")
+ ("issue-opened" . "\xf026")
+ ("issue-reopened" . "\xf027")
+ ("jersey" . "\xf019")
+ ("key" . "\xf049")
+ ("keyboard" . "\xf00d")
+ ("law" . "\xf0d8")
+ ("light-bulb" . "\xf000")
+ ("link" . "\xf05c")
+ ("link-external" . "\xf07f")
+ ("list-ordered" . "\xf062")
+ ("list-unordered" . "\xf061")
+ ("location" . "\xf060")
+ ("lock" . "\xf06a")
+ ("logo-github" . "\xf092")
+ ("mail" . "\xf03b")
+ ("mail-read" . "\xf03c")
+ ("mail-reply" . "\xf051")
+ ("mark-github" . "\xf00a")
+ ("markdown" . "\xf0c9")
+ ("megaphone" . "\xf077")
+ ("mention" . "\xf0be")
+ ("milestone" . "\xf075")
+ ("mirror" . "\xf024")
+ ("mortar-board" . "\xf0d7")
+ ("mute" . "\xf080")
+ ("no-newline" . "\xf09c")
+ ("octoface" . "\xf008")
+ ("organization" . "\xf037")
+ ("package" . "\xf0c4")
+ ("paintcan" . "\xf0d1")
+ ("pencil" . "\xf058")
+ ("person" . "\xf018")
+ ("pin" . "\xf041")
+ ("plug" . "\xf0d4")
+ ("plus" . "\xf05d")
+ ("primitive-dot" . "\xf052")
+ ("primitive-square" . "\xf053")
+ ("pulse" . "\xf085")
+ ("puzzle" . "\xf0c0")
+ ("question" . "\xf02c")
+ ("quote" . "\xf063")
+ ("radio-tower" . "\xf030")
+ ("repo" . "\xf001")
+ ("repo-clone" . "\xf04c")
+ ("repo-force-push" . "\xf04a")
+ ("repo-forked" . "\xf002")
+ ("repo-pull" . "\xf006")
+ ("repo-push" . "\xf005")
+ ("rocket" . "\xf033")
+ ("rss" . "\xf034")
+ ("ruby" . "\xf047")
+ ("search" . "\xf02e")
+ ("server" . "\xf097")
+ ("settings" . "\xf07c")
+ ("sign-in" . "\xf036")
+ ("sign-out" . "\xf032")
+ ("squirrel" . "\xf0b2")
+ ("star" . "\xf02a")
+ ("steps" . "\xf0c7")
+ ("stop" . "\xf08f")
+ ("sync" . "\xf087")
+ ("tag" . "\xf015")
+ ("telescope" . "\xf088")
+ ("terminal" . "\xf0c8")
+ ("three-bars" . "\xf05e")
+ ("thumbsdown" . "\xf0db")
+ ("thumbsup" . "\xf0da")
+ ("tools" . "\xf031")
+ ("trashcan" . "\xf0d0")
+ ("triangle-down" . "\xf05b")
+ ("triangle-left" . "\xf044")
+ ("triangle-right" . "\xf05a")
+ ("triangle-up" . "\xf0aa")
+ ("unfold" . "\xf039")
+ ("unmute" . "\xf0ba")
+ ("versions" . "\xf064")
+ ("x" . "\xf081")
+ ("zap" . "\x26A1")
+
+ ))
+
+(provide 'data-octicons)
diff --git a/elpa/all-the-icons-20220325.1238/data/data-octicons.elc b/elpa/all-the-icons-20220325.1238/data/data-octicons.elc
new file mode 100644
index 0000000..3b3968b
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/data/data-octicons.elc
Binary files differ
diff --git a/elpa/all-the-icons-20220325.1238/data/data-weathericons.el b/elpa/all-the-icons-20220325.1238/data/data-weathericons.el
new file mode 100644
index 0000000..676581c
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/data/data-weathericons.el
@@ -0,0 +1,594 @@
+(defvar all-the-icons-data/weather-icons-alist
+ '(
+
+ ("alien" . "\xf075")
+ ("barometer" . "\xf079")
+ ("celsius" . "\xf03c")
+ ("cloud" . "\xf041")
+ ("cloud-down" . "\xf03d")
+ ("cloud-refresh" . "\xf03e")
+ ("cloud-up" . "\xf040")
+ ("cloudy" . "\xf013")
+ ("cloudy-gusts" . "\xf011")
+ ("cloudy-windy" . "\xf012")
+ ("day-cloudy" . "\xf002")
+ ("day-cloudy-gusts" . "\xf000")
+ ("day-cloudy-high" . "\xf07d")
+ ("day-cloudy-windy" . "\xf001")
+ ("day-fog" . "\xf003")
+ ("day-hail" . "\xf004")
+ ("day-haze" . "\xf0b6")
+ ("day-light-wind" . "\xf0c4")
+ ("day-lightning" . "\xf005")
+ ("day-rain" . "\xf008")
+ ("day-rain-mix" . "\xf006")
+ ("day-rain-wind" . "\xf007")
+ ("day-showers" . "\xf009")
+ ("day-sleet" . "\xf0b2")
+ ("day-sleet-storm" . "\xf068")
+ ("day-snow" . "\xf00a")
+ ("day-snow-thunderstorm" . "\xf06b")
+ ("day-snow-wind" . "\xf065")
+ ("day-sprinkle" . "\xf00b")
+ ("day-storm-showers" . "\xf00e")
+ ("day-sunny" . "\xf00d")
+ ("day-sunny-overcast" . "\xf00c")
+ ("day-thunderstorm" . "\xf010")
+ ("day-windy" . "\xf085")
+ ("degrees" . "\xf042")
+ ("direction-down" . "\xf044")
+ ("direction-down-left" . "\xf043")
+ ("direction-down-right" . "\xf088")
+ ("direction-left" . "\xf048")
+ ("direction-right" . "\xf04d")
+ ("direction-up" . "\xf058")
+ ("direction-up-left" . "\xf087")
+ ("direction-up-right" . "\xf057")
+ ("dust" . "\xf063")
+ ("earthquake" . "\xf0c6")
+ ("fahrenheit" . "\xf045")
+ ("fire" . "\xf0c7")
+ ("flood" . "\xf07c")
+ ("fog" . "\xf014")
+ ("forecast-io-clear-day" . "\xf00d")
+ ("forecast-io-clear-night" . "\xf02e")
+ ("forecast-io-cloudy" . "\xf013")
+ ("forecast-io-fog" . "\xf014")
+ ("forecast-io-hail" . "\xf015")
+ ("forecast-io-partly-cloudy-day" . "\xf002")
+ ("forecast-io-partly-cloudy-night" . "\xf031")
+ ("forecast-io-rain" . "\xf019")
+ ("forecast-io-sleet" . "\xf0b5")
+ ("forecast-io-snow" . "\xf01b")
+ ("forecast-io-thunderstorm" . "\xf01e")
+ ("forecast-io-tornado" . "\xf056")
+ ("forecast-io-wind" . "\xf050")
+ ("gale-warning" . "\xf0cd")
+ ("hail" . "\xf015")
+ ("horizon" . "\xf047")
+ ("horizon-alt" . "\xf046")
+ ("hot" . "\xf072")
+ ("humidity" . "\xf07a")
+ ("hurricane" . "\xf073")
+ ("hurricane-warning" . "\xf0cf")
+ ("lightning" . "\xf016")
+ ("lunar-eclipse" . "\xf070")
+ ("meteor" . "\xf071")
+ ("moon-0" . "\xf095")
+ ("moon-1" . "\xf096")
+ ("moon-10" . "\xf09f")
+ ("moon-11" . "\xf0a0")
+ ("moon-12" . "\xf0a1")
+ ("moon-13" . "\xf0a2")
+ ("moon-14" . "\xf0a3")
+ ("moon-15" . "\xf0a4")
+ ("moon-16" . "\xf0a5")
+ ("moon-17" . "\xf0a6")
+ ("moon-18" . "\xf0a7")
+ ("moon-19" . "\xf0a8")
+ ("moon-2" . "\xf097")
+ ("moon-20" . "\xf0a9")
+ ("moon-21" . "\xf0aa")
+ ("moon-22" . "\xf0ab")
+ ("moon-23" . "\xf0ac")
+ ("moon-24" . "\xf0ad")
+ ("moon-25" . "\xf0ae")
+ ("moon-26" . "\xf0af")
+ ("moon-27" . "\xf0b0")
+ ("moon-3" . "\xf098")
+ ("moon-4" . "\xf099")
+ ("moon-5" . "\xf09a")
+ ("moon-6" . "\xf09b")
+ ("moon-7" . "\xf09c")
+ ("moon-8" . "\xf09d")
+ ("moon-9" . "\xf09e")
+ ("moon-alt-first-quarter" . "\xf0d6")
+ ("moon-alt-full" . "\xf0dd")
+ ("moon-alt-new" . "\xf0eb")
+ ("moon-alt-third-quarter" . "\xf0e4")
+ ("moon-alt-waning-crescent-1" . "\xf0e5")
+ ("moon-alt-waning-crescent-2" . "\xf0e6")
+ ("moon-alt-waning-crescent-3" . "\xf0e7")
+ ("moon-alt-waning-crescent-4" . "\xf0e8")
+ ("moon-alt-waning-crescent-5" . "\xf0e9")
+ ("moon-alt-waning-crescent-6" . "\xf0ea")
+ ("moon-alt-waning-gibbous-1" . "\xf0de")
+ ("moon-alt-waning-gibbous-2" . "\xf0df")
+ ("moon-alt-waning-gibbous-3" . "\xf0e0")
+ ("moon-alt-waning-gibbous-4" . "\xf0e1")
+ ("moon-alt-waning-gibbous-5" . "\xf0e2")
+ ("moon-alt-waning-gibbous-6" . "\xf0e3")
+ ("moon-alt-waxing-crescent-1" . "\xf0d0")
+ ("moon-alt-waxing-crescent-2" . "\xf0d1")
+ ("moon-alt-waxing-crescent-3" . "\xf0d2")
+ ("moon-alt-waxing-crescent-4" . "\xf0d3")
+ ("moon-alt-waxing-crescent-5" . "\xf0d4")
+ ("moon-alt-waxing-crescent-6" . "\xf0d5")
+ ("moon-alt-waxing-gibbous-1" . "\xf0d7")
+ ("moon-alt-waxing-gibbous-2" . "\xf0d8")
+ ("moon-alt-waxing-gibbous-3" . "\xf0d9")
+ ("moon-alt-waxing-gibbous-4" . "\xf0da")
+ ("moon-alt-waxing-gibbous-5" . "\xf0db")
+ ("moon-alt-waxing-gibbous-6" . "\xf0dc")
+ ("moon-first-quarter" . "\xf09c")
+ ("moon-full" . "\xf0a3")
+ ("moon-new" . "\xf095")
+ ("moon-third-quarter" . "\xf0aa")
+ ("moon-waning-crescent-1" . "\xf0ab")
+ ("moon-waning-crescent-2" . "\xf0ac")
+ ("moon-waning-crescent-3" . "\xf0ad")
+ ("moon-waning-crescent-4" . "\xf0ae")
+ ("moon-waning-crescent-5" . "\xf0af")
+ ("moon-waning-crescent-6" . "\xf0b0")
+ ("moon-waning-gibbous-1" . "\xf0a4")
+ ("moon-waning-gibbous-2" . "\xf0a5")
+ ("moon-waning-gibbous-3" . "\xf0a6")
+ ("moon-waning-gibbous-4" . "\xf0a7")
+ ("moon-waning-gibbous-5" . "\xf0a8")
+ ("moon-waning-gibbous-6" . "\xf0a9")
+ ("moon-waxing-crescent-1" . "\xf096")
+ ("moon-waxing-crescent-2" . "\xf097")
+ ("moon-waxing-crescent-3" . "\xf098")
+ ("moon-waxing-crescent-4" . "\xf099")
+ ("moon-waxing-crescent-5" . "\xf09a")
+ ("moon-waxing-crescent-6" . "\xf09b")
+ ("moon-waxing-gibbous-1" . "\xf09d")
+ ("moon-waxing-gibbous-2" . "\xf09e")
+ ("moon-waxing-gibbous-3" . "\xf09f")
+ ("moon-waxing-gibbous-4" . "\xf0a0")
+ ("moon-waxing-gibbous-5" . "\xf0a1")
+ ("moon-waxing-gibbous-6" . "\xf0a2")
+ ("moonrise" . "\xf0c9")
+ ("moonset" . "\xf0ca")
+ ("na" . "\xf07b")
+ ("night-alt-cloudy" . "\xf086")
+ ("night-alt-cloudy-gusts" . "\xf022")
+ ("night-alt-cloudy-high" . "\xf07e")
+ ("night-alt-cloudy-windy" . "\xf023")
+ ("night-alt-hail" . "\xf024")
+ ("night-alt-lightning" . "\xf025")
+ ("night-alt-partly-cloudy" . "\xf081")
+ ("night-alt-rain" . "\xf028")
+ ("night-alt-rain-mix" . "\xf026")
+ ("night-alt-rain-wind" . "\xf027")
+ ("night-alt-showers" . "\xf029")
+ ("night-alt-sleet" . "\xf0b4")
+ ("night-alt-sleet-storm" . "\xf06a")
+ ("night-alt-snow" . "\xf02a")
+ ("night-alt-snow-thunderstorm" . "\xf06d")
+ ("night-alt-snow-wind" . "\xf067")
+ ("night-alt-sprinkle" . "\xf02b")
+ ("night-alt-storm-showers" . "\xf02c")
+ ("night-alt-thunderstorm" . "\xf02d")
+ ("night-clear" . "\xf02e")
+ ("night-cloudy" . "\xf031")
+ ("night-cloudy-gusts" . "\xf02f")
+ ("night-cloudy-high" . "\xf080")
+ ("night-cloudy-windy" . "\xf030")
+ ("night-fog" . "\xf04a")
+ ("night-hail" . "\xf032")
+ ("night-lightning" . "\xf033")
+ ("night-partly-cloudy" . "\xf083")
+ ("night-rain" . "\xf036")
+ ("night-rain-mix" . "\xf034")
+ ("night-rain-wind" . "\xf035")
+ ("night-showers" . "\xf037")
+ ("night-sleet" . "\xf0b3")
+ ("night-sleet-storm" . "\xf069")
+ ("night-snow" . "\xf038")
+ ("night-snow-thunderstorm" . "\xf06c")
+ ("night-snow-wind" . "\xf066")
+ ("night-sprinkle" . "\xf039")
+ ("night-storm-showers" . "\xf03a")
+ ("night-thunderstorm" . "\xf03b")
+ ("owm-200" . "\xf01e")
+ ("owm-201" . "\xf01e")
+ ("owm-202" . "\xf01e")
+ ("owm-210" . "\xf016")
+ ("owm-211" . "\xf016")
+ ("owm-212" . "\xf016")
+ ("owm-221" . "\xf016")
+ ("owm-230" . "\xf01e")
+ ("owm-231" . "\xf01e")
+ ("owm-232" . "\xf01e")
+ ("owm-300" . "\xf01c")
+ ("owm-301" . "\xf01c")
+ ("owm-302" . "\xf019")
+ ("owm-310" . "\xf017")
+ ("owm-311" . "\xf019")
+ ("owm-312" . "\xf019")
+ ("owm-313" . "\xf01a")
+ ("owm-314" . "\xf019")
+ ("owm-321" . "\xf01c")
+ ("owm-500" . "\xf01c")
+ ("owm-501" . "\xf019")
+ ("owm-502" . "\xf019")
+ ("owm-503" . "\xf019")
+ ("owm-504" . "\xf019")
+ ("owm-511" . "\xf017")
+ ("owm-520" . "\xf01a")
+ ("owm-521" . "\xf01a")
+ ("owm-522" . "\xf01a")
+ ("owm-531" . "\xf01d")
+ ("owm-600" . "\xf01b")
+ ("owm-601" . "\xf01b")
+ ("owm-602" . "\xf0b5")
+ ("owm-611" . "\xf017")
+ ("owm-612" . "\xf017")
+ ("owm-615" . "\xf017")
+ ("owm-616" . "\xf017")
+ ("owm-620" . "\xf017")
+ ("owm-621" . "\xf01b")
+ ("owm-622" . "\xf01b")
+ ("owm-701" . "\xf01a")
+ ("owm-711" . "\xf062")
+ ("owm-721" . "\xf0b6")
+ ("owm-731" . "\xf063")
+ ("owm-741" . "\xf014")
+ ("owm-761" . "\xf063")
+ ("owm-762" . "\xf063")
+ ("owm-771" . "\xf011")
+ ("owm-781" . "\xf056")
+ ("owm-800" . "\xf00d")
+ ("owm-801" . "\xf011")
+ ("owm-802" . "\xf011")
+ ("owm-803" . "\xf012")
+ ("owm-804" . "\xf013")
+ ("owm-900" . "\xf056")
+ ("owm-901" . "\xf01d")
+ ("owm-902" . "\xf073")
+ ("owm-903" . "\xf076")
+ ("owm-904" . "\xf072")
+ ("owm-905" . "\xf021")
+ ("owm-906" . "\xf015")
+ ("owm-957" . "\xf050")
+ ("owm-day-200" . "\xf010")
+ ("owm-day-201" . "\xf010")
+ ("owm-day-202" . "\xf010")
+ ("owm-day-210" . "\xf005")
+ ("owm-day-211" . "\xf005")
+ ("owm-day-212" . "\xf005")
+ ("owm-day-221" . "\xf005")
+ ("owm-day-230" . "\xf010")
+ ("owm-day-231" . "\xf010")
+ ("owm-day-232" . "\xf010")
+ ("owm-day-300" . "\xf00b")
+ ("owm-day-301" . "\xf00b")
+ ("owm-day-302" . "\xf008")
+ ("owm-day-310" . "\xf008")
+ ("owm-day-311" . "\xf008")
+ ("owm-day-312" . "\xf008")
+ ("owm-day-313" . "\xf008")
+ ("owm-day-314" . "\xf008")
+ ("owm-day-321" . "\xf00b")
+ ("owm-day-500" . "\xf00b")
+ ("owm-day-501" . "\xf008")
+ ("owm-day-502" . "\xf008")
+ ("owm-day-503" . "\xf008")
+ ("owm-day-504" . "\xf008")
+ ("owm-day-511" . "\xf006")
+ ("owm-day-520" . "\xf009")
+ ("owm-day-521" . "\xf009")
+ ("owm-day-522" . "\xf009")
+ ("owm-day-531" . "\xf00e")
+ ("owm-day-600" . "\xf00a")
+ ("owm-day-601" . "\xf0b2")
+ ("owm-day-602" . "\xf00a")
+ ("owm-day-611" . "\xf006")
+ ("owm-day-612" . "\xf006")
+ ("owm-day-615" . "\xf006")
+ ("owm-day-616" . "\xf006")
+ ("owm-day-620" . "\xf006")
+ ("owm-day-621" . "\xf00a")
+ ("owm-day-622" . "\xf00a")
+ ("owm-day-701" . "\xf009")
+ ("owm-day-711" . "\xf062")
+ ("owm-day-721" . "\xf0b6")
+ ("owm-day-731" . "\xf063")
+ ("owm-day-741" . "\xf003")
+ ("owm-day-761" . "\xf063")
+ ("owm-day-762" . "\xf063")
+ ("owm-day-781" . "\xf056")
+ ("owm-day-800" . "\xf00d")
+ ("owm-day-801" . "\xf000")
+ ("owm-day-802" . "\xf000")
+ ("owm-day-803" . "\xf000")
+ ("owm-day-804" . "\xf00c")
+ ("owm-day-900" . "\xf056")
+ ("owm-day-902" . "\xf073")
+ ("owm-day-903" . "\xf076")
+ ("owm-day-904" . "\xf072")
+ ("owm-day-906" . "\xf004")
+ ("owm-day-957" . "\xf050")
+ ("owm-night-200" . "\xf02d")
+ ("owm-night-201" . "\xf02d")
+ ("owm-night-202" . "\xf02d")
+ ("owm-night-210" . "\xf025")
+ ("owm-night-211" . "\xf025")
+ ("owm-night-212" . "\xf025")
+ ("owm-night-221" . "\xf025")
+ ("owm-night-230" . "\xf02d")
+ ("owm-night-231" . "\xf02d")
+ ("owm-night-232" . "\xf02d")
+ ("owm-night-300" . "\xf02b")
+ ("owm-night-301" . "\xf02b")
+ ("owm-night-302" . "\xf028")
+ ("owm-night-310" . "\xf028")
+ ("owm-night-311" . "\xf028")
+ ("owm-night-312" . "\xf028")
+ ("owm-night-313" . "\xf028")
+ ("owm-night-314" . "\xf028")
+ ("owm-night-321" . "\xf02b")
+ ("owm-night-500" . "\xf02b")
+ ("owm-night-501" . "\xf028")
+ ("owm-night-502" . "\xf028")
+ ("owm-night-503" . "\xf028")
+ ("owm-night-504" . "\xf028")
+ ("owm-night-511" . "\xf026")
+ ("owm-night-520" . "\xf029")
+ ("owm-night-521" . "\xf029")
+ ("owm-night-522" . "\xf029")
+ ("owm-night-531" . "\xf02c")
+ ("owm-night-600" . "\xf02a")
+ ("owm-night-601" . "\xf0b4")
+ ("owm-night-602" . "\xf02a")
+ ("owm-night-611" . "\xf026")
+ ("owm-night-612" . "\xf026")
+ ("owm-night-615" . "\xf026")
+ ("owm-night-616" . "\xf026")
+ ("owm-night-620" . "\xf026")
+ ("owm-night-621" . "\xf02a")
+ ("owm-night-622" . "\xf02a")
+ ("owm-night-701" . "\xf029")
+ ("owm-night-711" . "\xf062")
+ ("owm-night-721" . "\xf0b6")
+ ("owm-night-731" . "\xf063")
+ ("owm-night-741" . "\xf04a")
+ ("owm-night-761" . "\xf063")
+ ("owm-night-762" . "\xf063")
+ ("owm-night-781" . "\xf056")
+ ("owm-night-800" . "\xf02e")
+ ("owm-night-801" . "\xf022")
+ ("owm-night-802" . "\xf022")
+ ("owm-night-803" . "\xf022")
+ ("owm-night-804" . "\xf086")
+ ("owm-night-900" . "\xf056")
+ ("owm-night-902" . "\xf073")
+ ("owm-night-903" . "\xf076")
+ ("owm-night-904" . "\xf072")
+ ("owm-night-906" . "\xf024")
+ ("owm-night-957" . "\xf050")
+ ("rain" . "\xf019")
+ ("rain-mix" . "\xf017")
+ ("rain-wind" . "\xf018")
+ ("raindrop" . "\xf078")
+ ("raindrops" . "\xf04e")
+ ("refresh" . "\xf04c")
+ ("refresh-alt" . "\xf04b")
+ ("sandstorm" . "\xf082")
+ ("showers" . "\xf01a")
+ ("sleet" . "\xf0b5")
+ ("small-craft-advisory" . "\xf0cc")
+ ("smog" . "\xf074")
+ ("smoke" . "\xf062")
+ ("snow" . "\xf01b")
+ ("snow" . "\xf01b")
+ ("snow-wind" . "\xf064")
+ ("snowflake-cold" . "\xf076")
+ ("solar-eclipse" . "\xf06e")
+ ("sprinkle" . "\xf01c")
+ ("stars" . "\xf077")
+ ("storm-showers" . "\xf01d")
+ ("storm-showers" . "\xf01d")
+ ("storm-warning" . "\xf0ce")
+ ("strong-wind" . "\xf050")
+ ("sunrise" . "\xf051")
+ ("sunset" . "\xf052")
+ ("thermometer" . "\xf055")
+ ("thermometer-exterior" . "\xf053")
+ ("thermometer-internal" . "\xf054")
+ ("thunderstorm" . "\xf01e")
+ ("thunderstorm" . "\xf01e")
+ ("time-1" . "\xf08a")
+ ("time-10" . "\xf093")
+ ("time-11" . "\xf094")
+ ("time-12" . "\xf089")
+ ("time-2" . "\xf08b")
+ ("time-3" . "\xf08c")
+ ("time-4" . "\xf08d")
+ ("time-5" . "\xf08e")
+ ("time-6" . "\xf08f")
+ ("time-7" . "\xf090")
+ ("time-8" . "\xf091")
+ ("time-9" . "\xf092")
+ ("tornado" . "\xf056")
+ ("train" . "\xf0cb")
+ ("tsunami" . "\xf0c5")
+ ("umbrella" . "\xf084")
+ ("volcano" . "\xf0c8")
+ ("wind-beaufort-0" . "\xf0b7")
+ ("wind-beaufort-1" . "\xf0b8")
+ ("wind-beaufort-10" . "\xf0c1")
+ ("wind-beaufort-11" . "\xf0c2")
+ ("wind-beaufort-12" . "\xf0c3")
+ ("wind-beaufort-2" . "\xf0b9")
+ ("wind-beaufort-3" . "\xf0ba")
+ ("wind-beaufort-4" . "\xf0bb")
+ ("wind-beaufort-5" . "\xf0bc")
+ ("wind-beaufort-6" . "\xf0bd")
+ ("wind-beaufort-7" . "\xf0be")
+ ("wind-beaufort-8" . "\xf0bf")
+ ("wind-beaufort-9" . "\xf0c0")
+ ("wind-direction" . "\xf0b1")
+ ("windy" . "\xf021")
+ ("wmo4680-00" . "\xf055")
+ ("wmo4680-01" . "\xf013")
+ ("wmo4680-02" . "\xf055")
+ ("wmo4680-03" . "\xf013")
+ ("wmo4680-04" . "\xf014")
+ ("wmo4680-05" . "\xf014")
+ ("wmo4680-10" . "\xf014")
+ ("wmo4680-11" . "\xf014")
+ ("wmo4680-12" . "\xf016")
+ ("wmo4680-18" . "\xf050")
+ ("wmo4680-20" . "\xf014")
+ ("wmo4680-21" . "\xf017")
+ ("wmo4680-22" . "\xf017")
+ ("wmo4680-23" . "\xf019")
+ ("wmo4680-24" . "\xf01b")
+ ("wmo4680-25" . "\xf015")
+ ("wmo4680-26" . "\xf01e")
+ ("wmo4680-27" . "\xf063")
+ ("wmo4680-28" . "\xf063")
+ ("wmo4680-29" . "\xf063")
+ ("wmo4680-30" . "\xf014")
+ ("wmo4680-31" . "\xf014")
+ ("wmo4680-32" . "\xf014")
+ ("wmo4680-33" . "\xf014")
+ ("wmo4680-34" . "\xf014")
+ ("wmo4680-35" . "\xf014")
+ ("wmo4680-40" . "\xf017")
+ ("wmo4680-41" . "\xf01c")
+ ("wmo4680-42" . "\xf019")
+ ("wmo4680-43" . "\xf01c")
+ ("wmo4680-44" . "\xf019")
+ ("wmo4680-45" . "\xf015")
+ ("wmo4680-46" . "\xf015")
+ ("wmo4680-47" . "\xf01b")
+ ("wmo4680-48" . "\xf01b")
+ ("wmo4680-50" . "\xf01c")
+ ("wmo4680-51" . "\xf01c")
+ ("wmo4680-52" . "\xf019")
+ ("wmo4680-53" . "\xf019")
+ ("wmo4680-54" . "\xf076")
+ ("wmo4680-55" . "\xf076")
+ ("wmo4680-56" . "\xf076")
+ ("wmo4680-57" . "\xf01c")
+ ("wmo4680-58" . "\xf019")
+ ("wmo4680-60" . "\xf01c")
+ ("wmo4680-61" . "\xf01c")
+ ("wmo4680-62" . "\xf019")
+ ("wmo4680-63" . "\xf019")
+ ("wmo4680-64" . "\xf015")
+ ("wmo4680-65" . "\xf015")
+ ("wmo4680-66" . "\xf015")
+ ("wmo4680-67" . "\xf017")
+ ("wmo4680-68" . "\xf017")
+ ("wmo4680-70" . "\xf01b")
+ ("wmo4680-71" . "\xf01b")
+ ("wmo4680-72" . "\xf01b")
+ ("wmo4680-73" . "\xf01b")
+ ("wmo4680-74" . "\xf076")
+ ("wmo4680-75" . "\xf076")
+ ("wmo4680-76" . "\xf076")
+ ("wmo4680-77" . "\xf01b")
+ ("wmo4680-78" . "\xf076")
+ ("wmo4680-80" . "\xf019")
+ ("wmo4680-81" . "\xf01c")
+ ("wmo4680-82" . "\xf019")
+ ("wmo4680-83" . "\xf019")
+ ("wmo4680-84" . "\xf01d")
+ ("wmo4680-85" . "\xf017")
+ ("wmo4680-86" . "\xf017")
+ ("wmo4680-87" . "\xf017")
+ ("wmo4680-89" . "\xf015")
+ ("wmo4680-90" . "\xf016")
+ ("wmo4680-91" . "\xf01d")
+ ("wmo4680-92" . "\xf01e")
+ ("wmo4680-93" . "\xf01e")
+ ("wmo4680-94" . "\xf016")
+ ("wmo4680-95" . "\xf01e")
+ ("wmo4680-96" . "\xf01e")
+ ("wmo4680-99" . "\xf056")
+ ("wu-chanceflurries" . "\xf064")
+ ("wu-chancerain" . "\xf019")
+ ("wu-chancesleat" . "\xf0b5")
+ ("wu-chancesnow" . "\xf01b")
+ ("wu-chancetstorms" . "\xf01e")
+ ("wu-clear" . "\xf00d")
+ ("wu-cloudy" . "\xf002")
+ ("wu-flurries" . "\xf064")
+ ("wu-hazy" . "\xf0b6")
+ ("wu-mostlycloudy" . "\xf002")
+ ("wu-mostlysunny" . "\xf00d")
+ ("wu-partlycloudy" . "\xf002")
+ ("wu-partlysunny" . "\xf00d")
+ ("wu-rain" . "\xf01a")
+ ("wu-sleat" . "\xf0b5")
+ ("wu-snow" . "\xf01b")
+ ("wu-sunny" . "\xf00d")
+ ("wu-tstorms" . "\xf01e")
+ ("wu-unknown" . "\xf00d")
+ ("yahoo-0" . "\xf056")
+ ("yahoo-1" . "\xf00e")
+ ("yahoo-10" . "\xf015")
+ ("yahoo-11" . "\xf01a")
+ ("yahoo-12" . "\xf01a")
+ ("yahoo-13" . "\xf01b")
+ ("yahoo-14" . "\xf00a")
+ ("yahoo-15" . "\xf064")
+ ("yahoo-16" . "\xf01b")
+ ("yahoo-17" . "\xf015")
+ ("yahoo-18" . "\xf017")
+ ("yahoo-19" . "\xf063")
+ ("yahoo-2" . "\xf073")
+ ("yahoo-20" . "\xf014")
+ ("yahoo-21" . "\xf021")
+ ("yahoo-22" . "\xf062")
+ ("yahoo-23" . "\xf050")
+ ("yahoo-24" . "\xf050")
+ ("yahoo-25" . "\xf076")
+ ("yahoo-26" . "\xf013")
+ ("yahoo-27" . "\xf031")
+ ("yahoo-28" . "\xf002")
+ ("yahoo-29" . "\xf031")
+ ("yahoo-3" . "\xf01e")
+ ("yahoo-30" . "\xf002")
+ ("yahoo-31" . "\xf02e")
+ ("yahoo-32" . "\xf00d")
+ ("yahoo-3200" . "\xf077")
+ ("yahoo-33" . "\xf083")
+ ("yahoo-34" . "\xf00c")
+ ("yahoo-35" . "\xf017")
+ ("yahoo-36" . "\xf072")
+ ("yahoo-37" . "\xf00e")
+ ("yahoo-38" . "\xf00e")
+ ("yahoo-39" . "\xf00e")
+ ("yahoo-4" . "\xf01e")
+ ("yahoo-40" . "\xf01a")
+ ("yahoo-41" . "\xf064")
+ ("yahoo-42" . "\xf01b")
+ ("yahoo-43" . "\xf064")
+ ("yahoo-44" . "\xf00c")
+ ("yahoo-45" . "\xf00e")
+ ("yahoo-46" . "\xf01b")
+ ("yahoo-47" . "\xf00e")
+ ("yahoo-5" . "\xf017")
+ ("yahoo-6" . "\xf017")
+ ("yahoo-7" . "\xf017")
+ ("yahoo-8" . "\xf015")
+ ("yahoo-9" . "\xf01a")
+
+ ))
+
+(provide 'data-weathericons)
diff --git a/elpa/all-the-icons-20220325.1238/data/data-weathericons.elc b/elpa/all-the-icons-20220325.1238/data/data-weathericons.elc
new file mode 100644
index 0000000..0e10e04
--- /dev/null
+++ b/elpa/all-the-icons-20220325.1238/data/data-weathericons.elc
Binary files differ
diff --git a/elpa/archives/gnu/archive-contents b/elpa/archives/gnu/archive-contents
new file mode 100644
index 0000000..9bc5840
--- /dev/null
+++ b/elpa/archives/gnu/archive-contents
@@ -0,0 +1,3501 @@
+(1
+ (ace-window .
+ [(0 10 0)
+ ((avy
+ (0 5 0)))
+ "Quickly switch windows." tar
+ ((:url . "https://github.com/abo-abo/ace-window")
+ (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com")
+ (:authors
+ ("Oleh Krehel" . "ohwoeowho@gmail.com"))
+ (:keywords "window" "location"))])
+ (ack .
+ [(1 10)
+ nil "interface to ack-like tools" tar
+ ((:url . "https://github.com/leoliu/ack-el")
+ (:maintainer "João Távora" . "joaotavora@gmail.com")
+ (:authors
+ ("Leo Liu" . "sdl.web@gmail.com"))
+ (:keywords "tools" "processes" "convenience"))])
+ (ada-mode .
+ [(7 2 0)
+ ((uniquify-files
+ (1 0 1))
+ (wisi
+ (3 1 5))
+ (emacs
+ (25 3)))
+ "major-mode for editing Ada sources" tar
+ ((:url . "http://www.nongnu.org/ada-mode/")
+ (:keywords "languages" "ada")
+ (:maintainer "Stephen Leake" . "stephen_leake@stephe-leake.org")
+ (:authors
+ ("Stephen Leake" . "stephen_leake@stephe-leake.org")))])
+ (ada-ref-man .
+ [(2020 1)
+ nil "Ada Reference Manual 2012" tar
+ ((:url . "http://stephe-leake.org/ada/arm.html")
+ (:maintainer "Stephen Leake" . "stephen_leake@member.fsf.org")
+ (:authors
+ ("Stephen Leake" . "stephen_leake@member.fsf.org"))
+ (:keywords "languages" "ada"))])
+ (adaptive-wrap .
+ [(0 8)
+ nil "Smart line-wrapping with wrap-prefix" tar
+ ((:maintainer "Stephen Berman" . "stephen.berman@gmx.net")
+ (:authors
+ ("Stephen Berman" . "stephen.berman@gmx.net")
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:url . "https://elpa.gnu.org/packages/adaptive-wrap.html"))])
+ (adjust-parens .
+ [(3 1)
+ nil "Indent and dedent Lisp code, automatically adjust close parens" tar
+ ((:maintainer "Barry O'Reilly" . "gundaetiapo@gmail.com")
+ (:authors
+ ("Barry O'Reilly" . "gundaetiapo@gmail.com"))
+ (:url . "http://elpa.gnu.org/packages/adjust-parens.html"))])
+ (advice-patch .
+ [(0 1)
+ ((emacs
+ (24 4)))
+ "Use patches to advise the inside of functions" single
+ ((:url . "http://elpa.gnu.org/packages/advice-patch.html")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (aggressive-completion .
+ [(1 7)
+ ((emacs
+ (27 1)))
+ "Automatic minibuffer completion" tar
+ ((:keywords "minibuffer" "completion")
+ (:maintainer "Tassilo Horn" . "tsdh@gnu.org")
+ (:authors
+ ("Tassilo Horn" . "tsdh@gnu.org"))
+ (:url . "https://elpa.gnu.org/packages/aggressive-completion.html")
+ (:commit . "d92bf2428133b6e261780e16b7030afe91d3668e"))])
+ (aggressive-indent .
+ [(1 10 0)
+ ((emacs
+ (24 3)))
+ "Minor mode to aggressively keep your code always indented" tar
+ ((:url . "https://github.com/Malabarba/aggressive-indent-mode")
+ (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com")
+ (:authors
+ ("Artur Malabarba" . "emacs@endlessparentheses.com"))
+ (:keywords "indent" "lisp" "maint" "tools"))])
+ (ahungry-theme .
+ [(1 10 0)
+ ((emacs
+ (24)))
+ "Ahungry color theme for Emacs. Make sure to (load-theme 'ahungry)." tar
+ ((:url . "https://github.com/ahungry/color-theme-ahungry")
+ (:maintainer "Matthew Carter" . "m@ahungry.com")
+ (:authors
+ ("Matthew Carter" . "m@ahungry.com"))
+ (:keywords "ahungry" "palette" "color" "theme" "emacs" "color-theme" "deftheme"))])
+ (all .
+ [(1 0)
+ nil "Edit all lines matching a given regexp" single
+ ((:url . "http://elpa.gnu.org/packages/all.html")
+ (:keywords "matching")
+ (:authors
+ ("Per Abrahamsen" . "per.abrahamsen@gmail.com"))
+ (:maintainer "Per Abrahamsen" . "per.abrahamsen@gmail.com"))])
+ (ampc .
+ [(0 2)
+ nil "Asynchronous Music Player Controller" single
+ ((:url . "http://elpa.gnu.org/packages/ampc.html")
+ (:keywords "ampc" "mpc" "mpd")
+ (:authors
+ ("Christopher Schmidt" . "christopher@ch.ristopher.com"))
+ (:maintainer nil . "emacs-devel@gnu.org"))])
+ (arbitools .
+ [(0 977)
+ ((cl-lib
+ (0 5)))
+ "Package for chess tournaments administration" single
+ ((:url . "http://elpa.gnu.org/packages/arbitools.html")
+ (:authors
+ ("David Gonzalez Gandara" . "dggandara@member.fsf.org"))
+ (:maintainer "David Gonzalez Gandara" . "dggandara@member.fsf.org"))])
+ (ascii-art-to-unicode .
+ [(1 13)
+ nil "a small artist adjunct" single
+ ((:keywords "ascii" "unicode" "box-drawing")
+ (:authors
+ ("Thien-Thi Nguyen" . "ttn@gnu.org"))
+ (:maintainer "Thien-Thi Nguyen" . "ttn@gnu.org")
+ (:url . "http://www.gnuvola.org/software/aa2u/"))])
+ (async .
+ [(1 9 5)
+ ((emacs
+ (24 3)))
+ "Asynchronous processing in Emacs" tar
+ ((:url . "https://github.com/jwiegley/emacs-async")
+ (:maintainer "John Wiegley" . "jwiegley@gmail.com")
+ (:authors
+ ("John Wiegley" . "jwiegley@gmail.com"))
+ (:keywords "async"))])
+ (auctex .
+ [(13 1 3)
+ ((emacs
+ (25 1)))
+ "Integrated environment for *TeX*" tar
+ ((:url . "https://www.gnu.org/software/auctex/")
+ (:keywords "tex" "latex" "texinfo" "context" "doctex" "preview-latex")
+ (:maintainer nil . "auctex-devel@gnu.org")
+ (:commit . "b91f15b3a375445985143ed1d6e41490ea62780a"))])
+ (aumix-mode .
+ [(7)
+ nil "run the aumix program in a buffer" single
+ ((:keywords "multimedia" "mixer" "aumix")
+ (:authors
+ ("Kevin Ryde" . "user42_kevin@yahoo.com.au"))
+ (:maintainer "Kevin Ryde" . "user42_kevin@yahoo.com.au")
+ (:url . "http://user42.tuxfamily.org/aumix-mode/index.html"))])
+ (auto-correct .
+ [(1 1 4)
+ nil "Remembers and automatically fixes past corrections" single
+ ((:url . "http://elpa.gnu.org/packages/auto-correct.html")
+ (:keywords "editing")
+ (:authors
+ ("Ian Dunn" . "dunni@gnu.org"))
+ (:maintainer "Ian Dunn" . "dunni@gnu.org"))])
+ (auto-overlays .
+ [(0 10 10)
+ ((cl-lib
+ (0 5)))
+ "Automatic regexp-delimited overlays" tar
+ ((:url . "http://www.dr-qubit.org/tags/computing-code-emacs.html")
+ (:maintainer "Toby Cubitt" . "toby-predictive@dr-qubit.org")
+ (:authors
+ ("Toby Cubitt" . "toby-predictive@dr-qubit.org"))
+ (:keywords "extensions"))])
+ (avy .
+ [(0 5 0)
+ ((emacs
+ (24 1))
+ (cl-lib
+ (0 5)))
+ "Jump to arbitrary positions in visible text and select text quickly." tar
+ ((:url . "https://github.com/abo-abo/avy")
+ (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com")
+ (:authors
+ ("Oleh Krehel" . "ohwoeowho@gmail.com"))
+ (:keywords "point" "location"))])
+ (bbdb .
+ [(3 2 2 2)
+ ((emacs
+ (24))
+ (cl-lib
+ (0 5)))
+ "Big Brother DataBase" tar
+ ((:maintainer "Roland Winkler" . "winkler@gnu.org")
+ (:url . "https://elpa.gnu.org/packages/bbdb.html")
+ (:commit . "715f35b5f53d6bcdcb3754b4f98933df01b57c15"))])
+ (beacon .
+ [(1 3 3)
+ ((seq
+ (2 14)))
+ "Highlight the cursor whenever the window scrolls" single
+ ((:keywords "convenience")
+ (:authors
+ ("Artur Malabarba" . "emacs@endlessparentheses.com"))
+ (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com")
+ (:url . "https://github.com/Malabarba/beacon"))])
+ (blist .
+ [(0 1)
+ nil "Display bookmarks in an ibuffer way" tar
+ ((:keywords "convenience")
+ (:maintainer "Durand" . "mmemmew@gmail.com")
+ (:authors
+ ("Durand" . "mmemmew@gmail.com"))
+ (:url . "https://elpa.gnu.org/packages/blist.html"))])
+ (bluetooth .
+ [(0 3 1)
+ ((emacs
+ (25 1))
+ (dash
+ (2 18 1)))
+ "A Major mode for Bluetooth devices" tar
+ ((:url . "https://gitlab.com/rstocker/emacs-bluetooth")
+ (:keywords "hardware")
+ (:maintainer "Raffael Stocker" . "r.stocker@mnet-mail.de")
+ (:authors
+ ("Raffael Stocker" . "r.stocker@mnet-mail.de")
+ ("Etienne Prud’homme" . "e.e.f.prudhomme@gmail.com"))
+ (:commit . "84488dfdd2355e512f9e9444a233448221b3d9cc"))])
+ (bnf-mode .
+ [(0 4 5)
+ ((cl-lib
+ (0 5))
+ (emacs
+ (24 3)))
+ "Major mode for editing BNF grammars." tar
+ ((:url . "https://github.com/sergeyklay/bnf-mode")
+ (:maintainer "Serghei Iakovlev" . "egrep@protonmail.ch")
+ (:authors
+ ("Serghei Iakovlev" . "egrep@protonmail.ch"))
+ (:keywords "languages"))])
+ (boxy .
+ [(1 0 5)
+ ((emacs
+ (26 1)))
+ "A boxy layout framework" tar
+ ((:url . "https://gitlab.com/tygrdev/boxy.el")
+ (:keywords "tools")
+ (:maintainer "Tyler Grinn" . "tylergrinn@gmail.com")
+ (:authors
+ ("Tyler Grinn" . "tylergrinn@gmail.com"))
+ (:commit . "3a949d5b14349f33f27bc5041178445a0fedcc6c"))])
+ (boxy-headings .
+ [(2 1 2)
+ ((emacs
+ (26 1))
+ (boxy
+ (1 0))
+ (org
+ (9 3)))
+ "View org files in a boxy diagram" tar
+ ((:url . "https://gitlab.com/tygrdev/boxy-headings")
+ (:keywords "tools")
+ (:maintainer "Tyler Grinn" . "tylergrinn@gmail.com")
+ (:authors
+ ("Tyler Grinn" . "tylergrinn@gmail.com")))])
+ (brief .
+ [(5 87)
+ nil "Brief Editor Emulator (Brief Mode)" tar
+ ((:maintainer "Luke Lee" . "luke.yx.lee@gmail.com")
+ (:authors
+ ("Luke Lee" . "luke.yx.lee@gmail.com"))
+ (:keywords "brief" "emulations" "crisp")
+ (:url . "http://elpa.gnu.org/packages/brief.html"))])
+ (buffer-env .
+ [(0 3)
+ ((emacs
+ (27 1)))
+ "Buffer-local process environments" tar
+ ((:url . "https://github.com/astoff/buffer-env")
+ (:keywords "processes" "tools")
+ (:maintainer "Augusto Stoffel" . "arstoffel@gmail.com")
+ (:authors
+ ("Augusto Stoffel" . "arstoffel@gmail.com"))
+ (:commit . "ba1c9d24d3f1ba58445cbf1f762ba6859b66f6bf"))])
+ (buffer-expose .
+ [(0 4 3)
+ ((emacs
+ (25))
+ (cl-lib
+ (0 5)))
+ "Visual buffer switching using a window grid" single
+ ((:keywords "convenience")
+ (:authors
+ ("Clemens Radermacher" . "clemera@posteo.net"))
+ (:maintainer "Clemens Radermacher" . "clemera@posteo.net")
+ (:url . "https://github.com/clemera/buffer-expose"))])
+ (bug-hunter .
+ [(1 3 1)
+ ((seq
+ (1 3))
+ (cl-lib
+ (0 5)))
+ "Hunt down errors by bisecting elisp files" tar
+ ((:url . "https://github.com/Malabarba/elisp-bug-hunter")
+ (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com")
+ (:authors
+ ("Artur Malabarba" . "emacs@endlessparentheses.com"))
+ (:keywords "lisp"))])
+ (cape .
+ [(0 7)
+ ((emacs
+ (27 1)))
+ "Completion At Point Extensions" tar
+ ((:url . "https://github.com/minad/cape")
+ (:maintainer "Daniel Mendler" . "mail@daniel-mendler.de")
+ (:authors
+ ("Daniel Mendler" . "mail@daniel-mendler.de"))
+ (:commit . "51b9bf1276445faebfbad636d9b6a39dc57b22bc"))])
+ (capf-autosuggest .
+ [(0 3)
+ ((emacs
+ (25 1)))
+ "History autosuggestions for comint and eshell" tar
+ ((:url . "https://repo.or.cz/emacs-capf-autosuggest.git")
+ (:maintainer "jakanakaevangeli" . "jakanakaevangeli@chiru.no")
+ (:authors
+ ("jakanakaevangeli" . "jakanakaevangeli@chiru.no")))])
+ (caps-lock .
+ [(1 0)
+ nil "Caps-lock as a minor mode" single
+ ((:url . "http://elpa.gnu.org/packages/caps-lock.html")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (captain .
+ [(1 0 3)
+ nil "CAPiTalization is Automatic IN emacs" single
+ ((:url . "http://elpa.gnu.org/packages/captain.html")
+ (:keywords "editing")
+ (:authors
+ ("Ian Dunn" . "dunni@gnu.org"))
+ (:maintainer "Ian Dunn" . "dunni@gnu.org"))])
+ (chess .
+ [(2 0 5)
+ ((cl-lib
+ (0 5)))
+ "Play chess in GNU Emacs" tar
+ ((:maintainer "Mario Lang" . "mlang@delysid.org")
+ (:authors
+ ("John Wiegley" . "johnw@gnu.org"))
+ (:keywords "games")
+ (:url . "http://elpa.gnu.org/packages/chess.html"))])
+ (cl-generic .
+ [(0 3)
+ nil "Forward cl-generic compatibility for Emacs<25" single
+ ((:url . "http://elpa.gnu.org/packages/cl-generic.html")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (cl-lib .
+ [(0 7)
+ nil "Forward cl-lib compatibility library for Emacs<24.3" tar
+ ((:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:url . "https://elpa.gnu.org/packages/cl-lib.html"))])
+ (cl-print .
+ [(1 0)
+ ((emacs
+ (25)))
+ "CL-style generic printing" single
+ ((:url . "http://elpa.gnu.org/packages/cl-print.html")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (clipboard-collector .
+ [(0 3)
+ ((emacs
+ (25)))
+ "Collect clipboard entries according to regex rules" tar
+ ((:url . "https://github.com/clemera/clipboard-collector")
+ (:maintainer "Clemens Radermacher" . "clemera@posteo.net")
+ (:authors
+ ("Clemens Radermacher" . "clemera@posteo.net"))
+ (:keywords "convenience"))])
+ (cobol-mode .
+ [(1 0 0)
+ ((cl-lib
+ (0 5)))
+ "Mode for editing COBOL code" single
+ ((:url . "http://elpa.gnu.org/packages/cobol-mode.html")
+ (:keywords "languages")
+ (:authors
+ ("Edward Hart" . "edward.dan.hart@gmail.com"))
+ (:maintainer "Edward Hart" . "edward.dan.hart@gmail.com"))])
+ (code-cells .
+ [(0 2)
+ ((emacs
+ (27 1)))
+ "Lightweight notebooks with support for ipynb files" tar
+ ((:url . "https://github.com/astoff/code-cells.el")
+ (:keywords "convenience" "outlines")
+ (:maintainer "Augusto Stoffel" . "arstoffel@gmail.com")
+ (:authors
+ ("Augusto Stoffel" . "arstoffel@gmail.com"))
+ (:commit . "ea7799c447066fee78c4efbafbdaf09520c7109d"))])
+ (coffee-mode .
+ [(0 4 1 1)
+ nil "Major mode for CoffeeScript files" single
+ ((:keywords "coffeescript" "major" "mode")
+ (:authors
+ ("Chris Wanstrath" . "chris@ozmm.org"))
+ (:maintainer "Chris Wanstrath" . "chris@ozmm.org")
+ (:url . "http://github.com/defunkt/coffee-mode"))])
+ (comint-mime .
+ [(0 1)
+ ((emacs
+ (28 1)))
+ "Display content of various MIME types in comint buffers" tar
+ ((:url . "https://github.com/astoff/comint-mime")
+ (:keywords "processes" "multimedia")
+ (:maintainer "Augusto Stoffel" . "arstoffel@gmail.com")
+ (:authors
+ ("Augusto Stoffel" . "arstoffel@gmail.com"))
+ (:commit . "2ac67834d9bb8e6a3521d75b934a4b496a3a0f9d"))])
+ (compact-docstrings .
+ [(0 2)
+ nil "Shrink blank lines in docstrings and doc comments" single
+ ((:keywords "convenience" "faces" "lisp" "maint" "c")
+ (:authors
+ ("Clément Pit-Claudel" . "clement.pitclaudel@live.com"))
+ (:maintainer "Clément Pit-Claudel" . "clement.pitclaudel@live.com")
+ (:url . "https://github.com/cpitclaudel/compact-docstrings"))])
+ (company .
+ [(0 9 13)
+ ((emacs
+ (24 3)))
+ "Modular text completion framework" tar
+ ((:url . "http://company-mode.github.io/")
+ (:maintainer "Dmitry Gutov" . "dgutov@yandex.ru")
+ (:authors
+ ("Nikolaj Schumacher"))
+ (:keywords "abbrev" "convenience" "matching"))])
+ (company-ebdb .
+ [(1 1)
+ ((company
+ (0 9 4))
+ (ebdb
+ (0 2)))
+ "company-mode completion backend for EBDB in message-mode" single
+ ((:url . "http://elpa.gnu.org/packages/company-ebdb.html")
+ (:authors
+ ("Jan Tatarik" . "jan.tatarik@gmail.com"))
+ (:maintainer "Eric Abrahamsen" . "eric@ericabrahamsen.net"))])
+ (company-math .
+ [(1 4)
+ ((company
+ (0 8 0))
+ (math-symbol-lists
+ (1 3)))
+ "Completion backends for unicode math symbols and latex tags" tar
+ ((:url . "https://github.com/vspinu/company-math")
+ (:maintainer "Vitalie Spinu" . "spinuvit@gmail.com")
+ (:authors
+ ("Vitalie Spinu" . "spinuvit@gmail.com"))
+ (:keywords "unicode" "symbols" "completion"))])
+ (company-statistics .
+ [(0 2 3)
+ ((emacs
+ (24 3))
+ (company
+ (0 8 5)))
+ "Sort candidates using completion history" tar
+ ((:url . "https://github.com/company-mode/company-statistics")
+ (:maintainer "Ingo Lohmar" . "i.lohmar@gmail.com")
+ (:authors
+ ("Ingo Lohmar" . "i.lohmar@gmail.com"))
+ (:keywords "abbrev" "convenience" "matching"))])
+ (compat .
+ [(28 1 1 1)
+ ((emacs
+ (24 3))
+ (nadvice
+ (0 3)))
+ "Compatibility Library" tar
+ ((:url . "https://sr.ht/~pkal/compat")
+ (:keywords "lisp")
+ (:maintainer "Compat Development" . "~pkal/compat-devel@lists.sr.ht")
+ (:authors
+ ("Philip Kaludercic" . "philipk@posteo.net"))
+ (:commit . "5f1f156d8048c44e727cf3dd9a55422822562c3e"))])
+ (consult .
+ [(0 17)
+ ((emacs
+ (27 1)))
+ "Consulting completing-read" tar
+ ((:url . "https://github.com/minad/consult")
+ (:maintainer "Daniel Mendler" . "mail@daniel-mendler.de")
+ (:authors
+ ("Daniel Mendler and Consult contributors"))
+ (:commit . "f517b70dd8a3be0b8c883633f2a7721448b40f0f"))])
+ (context-coloring .
+ [(8 1 0)
+ ((emacs
+ (24 3)))
+ "Highlight by scope" tar
+ ((:url . "https://github.com/jacksonrayhamilton/context-coloring")
+ (:maintainer "Jackson Ray Hamilton" . "jackson@jacksonrayhamilton.com")
+ (:authors
+ ("Jackson Ray Hamilton" . "jackson@jacksonrayhamilton.com"))
+ (:keywords "convenience" "faces" "tools"))])
+ (corfu .
+ [(0 23)
+ ((emacs
+ (27 1)))
+ "Completion Overlay Region FUnction" tar
+ ((:url . "https://github.com/minad/corfu")
+ (:maintainer "Daniel Mendler" . "mail@daniel-mendler.de")
+ (:authors
+ ("Daniel Mendler" . "mail@daniel-mendler.de"))
+ (:commit . "bf9bb725f70fb3165e2831c5926217bd6a8bc68d"))])
+ (coterm .
+ [(1 5)
+ ((emacs
+ (26 1)))
+ "Terminal emulation for comint" tar
+ ((:url . "https://repo.or.cz/emacs-coterm.git")
+ (:keywords "processes")
+ (:maintainer "jakanakaevangeli" . "jakanakaevangeli@chiru.no")
+ (:authors
+ ("jakanakaevangeli" . "jakanakaevangeli@chiru.no"))
+ (:commit . "ef4b5fb55304266244c87d2c6aaefab58149da62"))])
+ (counsel .
+ [(0 13 4)
+ ((emacs
+ (24 5))
+ (ivy
+ (0 13 4))
+ (swiper
+ (0 13 4)))
+ "Various completion functions using Ivy" tar
+ ((:url . "https://github.com/abo-abo/swiper")
+ (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com")
+ (:authors
+ ("Oleh Krehel" . "ohwoeowho@gmail.com"))
+ (:keywords "convenience" "matching" "tools"))])
+ (cpio-mode .
+ [(0 17)
+ ((emacs
+ (24 5)))
+ "Handle cpio archives in the style of dired." tar
+ ((:maintainer "Douglas Lewan" . "d.lewan2000@gmail.com")
+ (:authors
+ ("Douglas Lewan" . "d.lewan2000@gmail.com"))
+ (:keywords "files")
+ (:url . "http://elpa.gnu.org/packages/cpio-mode.html"))])
+ (cpupower .
+ [(1 0 4)
+ nil "cpupower command interface" tar
+ ((:url . "https://gitlab.com/steve-emacs-stuff/cpupower-el")
+ (:keywords "hardware" "cpupower" "cpu" "frequency-scaling")
+ (:maintainer "Stephen Meister" . "pallagun@gmail.com")
+ (:authors
+ ("Stephen Meister" . "pallagun@gmail.com"))
+ (:commit . "36520f1fa7bbfdbfd525a4c729b3fd067f7a05f1"))])
+ (crdt .
+ [(0 2 7)
+ nil "Collaborative editing using Conflict-free Replicated Data Types" tar
+ ((:url . "https://code.librehq.com/qhong/crdt.el")
+ (:keywords "collaboration" "crdt")
+ (:maintainer "Qiantan Hong" . "qhong@alum.mit.edu")
+ (:authors
+ ("Qiantan Hong" . "qhong@alum.mit.edu")))])
+ (crisp .
+ [(1 3 6)
+ nil "CRiSP/Brief Emacs emulator" single
+ ((:url . "http://elpa.gnu.org/packages/crisp.html")
+ (:keywords "emulations" "brief" "crisp")
+ (:authors
+ ("Gary D. Foster" . "Gary.Foster@Corp.Sun.COM"))
+ (:maintainer "Luke Lee" . "luke.yx.lee@gmail.com"))])
+ (csharp-mode .
+ [(1 1 1)
+ ((emacs
+ (26 1)))
+ "C# mode derived mode" tar
+ ((:url . "https://github.com/emacs-csharp/csharp-mode")
+ (:keywords "c#" "languages" "oop" "mode")
+ (:maintainer "Jostein Kjønigsen" . "jostein@gmail.com")
+ (:authors
+ ("Theodor Thornhill" . "theo@thornhill.no")))])
+ (csv-mode .
+ [(1 19)
+ ((emacs
+ (24 1))
+ (cl-lib
+ (0 5)))
+ "Major mode for editing comma/char separated values" tar
+ ((:keywords "convenience")
+ (:maintainer nil . "emacs-devel@gnu.org")
+ (:authors
+ ("\"Francis J. Wright\"" . "F.J.Wright@qmul.ac.uk"))
+ (:url . "https://elpa.gnu.org/packages/csv-mode.html")
+ (:commit . "5c19624398bfd6b976cc9876db582e3e23611601"))])
+ (cursory .
+ [(0 1 4)
+ ((emacs
+ (27 1)))
+ "Manage cursor styles using presets" tar
+ ((:url . "https://git.sr.ht/~protesilaos/cursory")
+ (:keywords "convenience" "cursor")
+ (:maintainer "Protesilaos Stavrou" . "info@protesilaos.com")
+ (:authors
+ ("Protesilaos Stavrou" . "info@protesilaos.com"))
+ (:commit . "63c4b42ebe4446484bfb2a81b0b97ff65bcfbb3d"))])
+ (cycle-quotes .
+ [(0 1)
+ nil "Cycle between quote styles" tar
+ ((:maintainer "Simen Heggestøyl" . "simenheg@gmail.com")
+ (:authors
+ ("Simen Heggestøyl" . "simenheg@gmail.com"))
+ (:keywords "convenience")
+ (:url . "http://elpa.gnu.org/packages/cycle-quotes.html"))])
+ (darkroom .
+ [(0 3)
+ ((cl-lib
+ (0 5)))
+ "Remove visual distractions and focus on writing" single
+ ((:url . "http://elpa.gnu.org/packages/darkroom.html")
+ (:keywords "convenience" "emulations")
+ (:authors
+ ("João Távora" . "joaotavora@gmail.com"))
+ (:maintainer "João Távora" . "joaotavora@gmail.com"))])
+ (dash .
+ [(2 19 1)
+ ((emacs
+ (24)))
+ "A modern list library for Emacs" tar
+ ((:url . "https://github.com/magnars/dash.el")
+ (:maintainer "Magnar Sveen" . "magnars@gmail.com")
+ (:authors
+ ("Magnar Sveen" . "magnars@gmail.com"))
+ (:keywords "extensions" "lisp"))])
+ (dbus-codegen .
+ [(0 1)
+ ((cl-lib
+ (0 5)))
+ "Lisp code generation for D-Bus." single
+ ((:url . "http://elpa.gnu.org/packages/dbus-codegen.html")
+ (:keywords "comm" "dbus" "convenience")
+ (:authors
+ ("Daiki Ueno" . "ueno@gnu.org"))
+ (:maintainer nil . "emacs-devel@gnu.org"))])
+ (debbugs .
+ [(0 32)
+ ((emacs
+ (26 1))
+ (soap-client
+ (3 1 5)))
+ "SOAP library to access debbugs servers" tar
+ ((:keywords "comm" "hypermedia")
+ (:maintainer "Michael Albinus" . "michael.albinus@gmx.de")
+ (:authors
+ ("Michael Albinus" . "michael.albinus@gmx.de"))
+ (:url . "https://elpa.gnu.org/packages/debbugs.html")
+ (:commit . "a35646a9798226b8630fbd7a0691edc78ccd92b3"))])
+ (delight .
+ [(1 7)
+ ((cl-lib
+ (0 5))
+ (nadvice
+ (0 3)))
+ "A dimmer switch for your lighter text" single
+ ((:keywords "convenience")
+ (:authors
+ ("Phil Sainty" . "psainty@orcon.net.nz"))
+ (:maintainer "Phil Sainty" . "psainty@orcon.net.nz")
+ (:url . "https://savannah.nongnu.org/projects/delight"))])
+ (devdocs .
+ [(0 4)
+ ((emacs
+ (27 1)))
+ "Emacs viewer for DevDocs" tar
+ ((:url . "https://github.com/astoff/devdocs.el")
+ (:keywords "help")
+ (:maintainer "Augusto Stoffel" . "arstoffel@gmail.com")
+ (:authors
+ ("Augusto Stoffel" . "arstoffel@gmail.com"))
+ (:commit . "cdc1a7cc3f05235883ffb098fe1c5a8963ed06e2"))])
+ (dict-tree .
+ [(0 16)
+ ((trie
+ (0 3))
+ (tNFA
+ (0 1 1))
+ (heap
+ (0 3)))
+ "Dictionary data structure" tar
+ ((:url . "http://www.dr-qubit.org/emacs.php")
+ (:maintainer "Toby Cubitt" . "toby-predictive@dr-qubit.org")
+ (:authors
+ ("Toby Cubitt" . "toby-predictive@dr-qubit.org"))
+ (:keywords "extensions" "matching" "data structures trie" "tree" "dictionary" "completion" "regexp"))])
+ (diff-hl .
+ [(1 8 8)
+ ((cl-lib
+ (0 2))
+ (emacs
+ (24 3)))
+ "Highlight uncommitted changes using VC" tar
+ ((:url . "https://github.com/dgutov/diff-hl")
+ (:maintainer "Dmitry Gutov" . "dgutov@yandex.ru")
+ (:authors
+ ("Dmitry Gutov" . "dgutov@yandex.ru"))
+ (:keywords "vc" "diff"))])
+ (diffview .
+ [(1 0)
+ nil "View diffs in side-by-side format" single
+ ((:keywords "convenience" "diff")
+ (:authors
+ ("Mitchel Humpherys" . "mitch.special@gmail.com"))
+ (:maintainer "Mitchel Humpherys" . "mitch.special@gmail.com")
+ (:url . "https://github.com/mgalgs/diffview-mode"))])
+ (diminish .
+ [(0 46)
+ ((emacs
+ (24 3)))
+ "Diminished modes are minor modes with no modeline display" tar
+ ((:url . "https://github.com/myrjola/diminish.el")
+ (:keywords "extensions" "diminish" "minor" "codeprose")
+ (:maintainer "Martin Yrjölä" . "martin.yrjola@gmail.com")
+ (:authors
+ ("Will Mengarini" . "seldon@eskimo.com"))
+ (:commit . "66b3902401059d161424b1b8d0abc3cb0a7d6df0"))])
+ (dired-du .
+ [(0 5 2)
+ ((emacs
+ (24 4))
+ (cl-lib
+ (0 5)))
+ "Dired with recursive directory sizes" tar
+ ((:maintainer "Tino Calancha" . "tino.calancha@gmail.com")
+ (:authors
+ ("Tino Calancha" . "tino.calancha@gmail.com"))
+ (:keywords "files" "unix" "convenience")
+ (:url . "http://elpa.gnu.org/packages/dired-du.html"))])
+ (dired-git-info .
+ [(0 3 1)
+ ((emacs
+ (25)))
+ "Show git info in dired" single
+ ((:keywords "dired" "files")
+ (:authors
+ ("Clemens Radermacher" . "clemera@posteo.net"))
+ (:maintainer "Clemens Radermacher" . "clemera@posteo.net")
+ (:url . "https://github.com/clemera/dired-git-info"))])
+ (disk-usage .
+ [(1 3 3)
+ ((emacs
+ (26 1)))
+ "Sort and browse disk usage listings" single
+ ((:keywords "files" "convenience" "tools")
+ (:authors
+ ("Pierre Neidhardt" . "mail@ambrevar.xyz"))
+ (:maintainer "Pierre Neidhardt" . "mail@ambrevar.xyz")
+ (:url . "https://gitlab.com/Ambrevar/emacs-disk-usage"))])
+ (dismal .
+ [(1 5 2)
+ ((cl-lib
+ (0))
+ (emacs
+ (24 3)))
+ "Dis Mode Ain't Lotus: Spreadsheet program Emacs" tar
+ ((:maintainer "UnMaintainer" . "emacs-devel@gnu.org")
+ (:authors
+ (nil . "David Fox, fox@cs.nyu.edu")
+ (nil . "Frank E. Ritter, ritter@cs.cmu.edu"))
+ (:url . "https://elpa.gnu.org/packages/dismal.html"))])
+ (djvu .
+ [(1 1 2)
+ nil "Edit and view Djvu files via djvused" tar
+ ((:keywords "files" "wp")
+ (:maintainer "Roland Winkler" . "winkler@gnu.org")
+ (:authors
+ ("Roland Winkler" . "winkler@gnu.org"))
+ (:url . "https://elpa.gnu.org/packages/djvu.html")
+ (:commit . "071c8ab168588897475899c46eaa16e70141db8c"))])
+ (docbook .
+ [(0 1)
+ nil "Info-like viewer for DocBook" single
+ ((:url . "http://elpa.gnu.org/packages/docbook.html")
+ (:keywords "docs" "help")
+ (:authors
+ ("Chong Yidong" . "cyd@gnu.org"))
+ (:maintainer "Chong Yidong" . "cyd@gnu.org"))])
+ (dtache .
+ [(0 6)
+ ((emacs
+ (27 1)))
+ "Run and interact with detached shell commands" tar
+ ((:url . "https://www.gitlab.com/niklaseklund/dtache.git")
+ (:keywords "convenience" "processes")
+ (:maintainer "Niklas Eklund" . "niklas.eklund@posteo.net")
+ (:authors
+ ("Niklas Eklund" . "niklas.eklund@posteo.net"))
+ (:commit . "4ecda689e4ccddc23805a22484c95c4f3f65e3bb"))])
+ (dts-mode .
+ [(1 0)
+ ((emacs
+ (24)))
+ "Major mode for Device Tree source files" tar
+ ((:keywords "languages")
+ (:maintainer "Ben Gamari" . "ben@smart-cactus.org")
+ (:authors
+ ("Ben Gamari" . "ben@smart-cactus.org"))
+ (:url . "https://elpa.gnu.org/packages/dts-mode.html")
+ (:commit . "8413d2dc9b3347831aa9e8c8b2524af3ef005441"))])
+ (easy-escape .
+ [(0 2 1)
+ nil "Improve readability of escape characters in regular expressions" tar
+ ((:url . "https://github.com/cpitclaudel/easy-escape")
+ (:keywords "convenience" "lisp" "tools")
+ (:maintainer "Clément Pit-Claudel" . "clement.pitclaudel@live.com")
+ (:authors
+ ("Clément Pit-Claudel" . "clement.pitclaudel@live.com")))])
+ (easy-kill .
+ [(0 9 5)
+ ((emacs
+ (25))
+ (cl-lib
+ (0 5)))
+ "kill & mark things easily" tar
+ ((:url . "https://github.com/leoliu/easy-kill")
+ (:keywords "killing" "convenience")
+ (:maintainer "Leo Liu" . "sdl.web@gmail.com")
+ (:authors
+ ("Leo Liu" . "sdl.web@gmail.com"))
+ (:commit . "f155d19c528e27f8f6c72f0d75f652edbdcab37f"))])
+ (ebdb .
+ [(0 8 14)
+ ((emacs
+ (25 1))
+ (seq
+ (2 15)))
+ "Contact management package" tar
+ ((:url . "https://github.com/girzel/ebdb")
+ (:keywords "convenience" "mail")
+ (:maintainer "Eric Abrahamsen" . "eric@ericabrahamsen.net")
+ (:authors
+ ("Eric Abrahamsen" . "eric@ericabrahamsen.net"))
+ (:commit . "c98512ebb6984701bbf090f1eabedb120c51e7bd"))])
+ (ebdb-gnorb .
+ [(1 0 2)
+ ((gnorb
+ (1 1 0))
+ (ebdb
+ (0 2)))
+ "Utilities for connecting EBDB to Gnorb" single
+ ((:url . "http://elpa.gnu.org/packages/ebdb-gnorb.html")
+ (:authors
+ ("Eric Abrahamsen" . "eric@ericabrahamsen.net"))
+ (:maintainer "Eric Abrahamsen" . "eric@ericabrahamsen.net"))])
+ (ebdb-i18n-chn .
+ [(1 3 2)
+ ((pyim
+ (1 6 0))
+ (ebdb
+ (0 6 17)))
+ "China-specific internationalization support for EBDB" tar
+ ((:maintainer "Eric Abrahamsen" . "eric@ericabrahamsen.net")
+ (:authors
+ ("Eric Abrahamsen" . "eric@ericabrahamsen.net"))
+ (:url . "https://elpa.gnu.org/packages/ebdb-i18n-chn.html"))])
+ (ediprolog .
+ [(2 1)
+ nil "Emacs Does Interactive Prolog" single
+ ((:keywords "languages" "processes")
+ (:authors
+ ("Markus Triska" . "triska@metalevel.at"))
+ (:maintainer "Markus Triska" . "triska@metalevel.at")
+ (:url . "https://www.metalevel.at/ediprolog/"))])
+ (eev .
+ [(20220416)
+ ((emacs
+ (24 4)))
+ "Support for e-scripts (eepitch blocks, elisp hyperlinks, etc)" tar
+ ((:url . "http://angg.twu.net/#eev")
+ (:keywords "lisp" "e-scripts")
+ (:maintainer "Eduardo Ochs" . "eduardoochs@gmail.com")
+ (:authors
+ ("Eduardo Ochs" . "eduardoochs@gmail.com"))
+ (:commit . "84a0b6e6bb247efcb519c1e32de172aa55e184c7"))])
+ (eglot .
+ [(1 8)
+ ((emacs
+ (26 1))
+ (jsonrpc
+ (1 0 14))
+ (flymake
+ (1 0 9))
+ (project
+ (0 3 0))
+ (xref
+ (1 0 1))
+ (eldoc
+ (1 11 0)))
+ "Client for Language Server Protocol (LSP) servers" tar
+ ((:url . "https://github.com/joaotavora/eglot")
+ (:keywords "convenience" "languages")
+ (:maintainer "João Távora" . "joaotavora@gmail.com")
+ (:authors
+ ("João Távora" . "joaotavora@gmail.com"))
+ (:commit . "132ea08f97f94ad2e050fc8d1628ecb41de7229a"))])
+ (el-search .
+ [(1 12 6 1)
+ ((emacs
+ (25))
+ (stream
+ (2 2 4))
+ (cl-print
+ (1 0)))
+ "Expression based interactive search for Emacs Lisp" tar
+ ((:maintainer "Michael Heerdegen" . "michael_heerdegen@web.de")
+ (:authors
+ ("Michael Heerdegen" . "michael_heerdegen@web.de"))
+ (:keywords "lisp")
+ (:url . "http://elpa.gnu.org/packages/el-search.html"))])
+ (eldoc .
+ [(1 12 0)
+ ((emacs
+ (26 3)))
+ "Show function arglist or variable docstring in echo area" tar
+ ((:keywords "extensions")
+ (:maintainer "Noah Friedman" . "friedman@splode.com")
+ (:authors
+ ("Noah Friedman" . "friedman@splode.com"))
+ (:url . "https://elpa.gnu.org/packages/eldoc.html")
+ (:commit . "d377b396432412b06647eef01f837126982f3e6d"))])
+ (eldoc-eval .
+ [(0 2)
+ nil "Enable eldoc support when minibuffer is in use." tar
+ ((:maintainer "Thierry Volpiatto" . "thievol@posteo.net")
+ (:authors
+ ("Thierry Volpiatto" . "thievol@posteo.net"))
+ (:url . "https://elpa.gnu.org/packages/eldoc-eval.html")
+ (:commit . "e91800503c90cb75dc70abe42f1d6ae499346cc1"))])
+ (electric-spacing .
+ [(5 0)
+ nil "Insert operators with surrounding spaces smartly" single
+ ((:url . "http://elpa.gnu.org/packages/electric-spacing.html")
+ (:authors
+ ("William Xu" . "william.xwl@gmail.com"))
+ (:maintainer "William Xu" . "william.xwl@gmail.com"))])
+ (elisp-benchmarks .
+ [(1 14)
+ nil "elisp benchmarks collection" tar
+ ((:keywords "languages" "lisp")
+ (:maintainer "Andrea Corallo" . "akrl@sdf.org")
+ (:authors
+ ("Andrea Corallo" . "akrl@sdf.org"))
+ (:url . "https://elpa.gnu.org/packages/elisp-benchmarks.html")
+ (:commit . "70e38dbfa8f4acbdebfd0f417410d99f5031e05f"))])
+ (embark .
+ [(0 16)
+ ((emacs
+ (26 1)))
+ "Conveniently act on minibuffer completions" tar
+ ((:url . "https://github.com/oantolin/embark")
+ (:keywords "convenience")
+ (:maintainer "Omar Antolín Camarena" . "omar@matem.unam.mx")
+ (:authors
+ ("Omar Antolín Camarena" . "omar@matem.unam.mx"))
+ (:commit . "5faf1389162dd64bfe3511dfb8f52c18efb5140b"))])
+ (embark-consult .
+ [(0 5)
+ ((emacs
+ (26 1))
+ (embark
+ (0 12))
+ (consult
+ (0 10)))
+ "Consult integration for Embark" tar
+ ((:url . "https://github.com/oantolin/embark")
+ (:keywords "convenience")
+ (:maintainer "Omar Antolín Camarena" . "omar@matem.unam.mx")
+ (:authors
+ ("Omar Antolín Camarena" . "omar@matem.unam.mx"))
+ (:commit . "5faf1389162dd64bfe3511dfb8f52c18efb5140b"))])
+ (emms .
+ [(10)
+ ((cl-lib
+ (0 5))
+ (nadvice
+ (0 3))
+ (seq
+ (0)))
+ "The Emacs Multimedia System" tar
+ ((:url . "https://www.gnu.org/software/emms/")
+ (:keywords "emms" "mp3" "ogg" "flac" "music" "mpeg" "video" "multimedia")
+ (:maintainer "Yoni Rabkin" . "yrk@gnu.org")
+ (:authors
+ ("Jorgen Schäfer" . "forcer@forcix.cx"))
+ (:commit . "6afe1b26d679357586380ecd69c9795985231013"))])
+ (engrave-faces .
+ [(0 3 0)
+ ((emacs
+ (27 1)))
+ "Convert font-lock faces to other formats" tar
+ ((:url . "https://github.com/tecosaur/engrave-faces")
+ (:keywords "faces")
+ (:maintainer "TEC" . "tec@tecosaur.com")
+ (:authors
+ ("TEC <https://github/tecosaur>"))
+ (:commit . "3739d9f690412beb5bf717b11bc828fe39ade231"))])
+ (enwc .
+ [(2 0)
+ ((emacs
+ (25 1)))
+ "The Emacs Network Client" tar
+ ((:url . "https://savannah.nongnu.org/p/enwc")
+ (:maintainer "Ian Dunn" . "dunni@gnu.org")
+ (:authors
+ ("Ian Dunn" . "dunni@gnu.org"))
+ (:keywords "external" "network" "wicd" "manager" "nm"))])
+ (epoch-view .
+ [(0 0 1)
+ nil "Minor mode to visualize epoch timestamps" single
+ ((:url . "http://elpa.gnu.org/packages/epoch-view.html")
+ (:keywords "data" "timestamp" "epoch" "unix")
+ (:authors
+ ("Ted Zlatanov" . "tzz@lifelogs.com"))
+ (:maintainer "Ted Zlatanov" . "tzz@lifelogs.com"))])
+ (erc .
+ [(5 4 1)
+ ((emacs
+ (27 1)))
+ "An Emacs Internet Relay Chat client" tar
+ ((:url . "https://www.gnu.org/software/emacs/erc.html")
+ (:keywords "irc" "chat" "client" "internet")
+ (:maintainer "Amin Bandali" . "bandali@gnu.org")
+ (:authors
+ ("Alexander L. Belikoff" . "alexander@belikoff.net")))])
+ (ergoemacs-mode .
+ [(5 16 10 12)
+ ((emacs
+ (24 1))
+ (undo-tree
+ (0 6 5))
+ (cl-lib
+ (0 5)))
+ "Emacs mode based on common modern interface and ergonomics." tar
+ ((:url . "https://github.com/ergoemacs/ergoemacs-mode")
+ (:maintainer "Matthew L. Fidler" . "matthew.fidler@gmail.com")
+ (:authors
+ ("Xah Lee" . "xah@xahlee.org")
+ ("David Capello" . "davidcapello@gmail.com")
+ ("Matthew L. Fidler" . "matthew.fidler@gmail.com"))
+ (:keywords "convenience"))])
+ (excorporate .
+ [(1 0 0)
+ ((emacs
+ (24 1))
+ (cl-lib
+ (0 6 1))
+ (fsm
+ (0 2 1))
+ (soap-client
+ (3 2 0))
+ (url-http-ntlm
+ (2 0 4))
+ (nadvice
+ (0 3)))
+ "Exchange Web Services (EWS) integration" tar
+ ((:url . "https://www.fitzsim.org/blog/")
+ (:maintainer "Thomas Fitzsimmons" . "fitzsim@fitzsim.org")
+ (:authors
+ ("Thomas Fitzsimmons" . "fitzsim@fitzsim.org"))
+ (:keywords "calendar"))])
+ (expand-region .
+ [(0 11 0)
+ nil "Increase selected region by semantic units." tar
+ ((:url . "https://github.com/magnars/expand-region.el")
+ (:maintainer "Magnar Sveen" . "magnars@gmail.com")
+ (:authors
+ ("Magnar Sveen" . "magnars@gmail.com"))
+ (:keywords "marking" "region"))])
+ (exwm .
+ [(0 26)
+ ((xelb
+ (0 18)))
+ "Emacs X Window Manager" tar
+ ((:url . "https://github.com/ch11ng/exwm")
+ (:keywords "unix")
+ (:maintainer "Adrián Medraño Calvo" . "adrian@medranocalvo.com")
+ (:authors
+ ("Chris Feng" . "chris.w.feng@gmail.com")))])
+ (f90-interface-browser .
+ [(1 1)
+ nil "Parse and browse f90 interfaces" single
+ ((:authors
+ ("Lawrence Mitchell" . "wence@gmx.li"))
+ (:maintainer "Lawrence Mitchell" . "wence@gmx.li")
+ (:url . "http://github.com/wence-/f90-iface/"))])
+ (filladapt .
+ [(2 12 2)
+ ((emacs
+ (24 4)))
+ "Adaptive fill" single
+ ((:url . "http://elpa.gnu.org/packages/filladapt.html")
+ (:authors
+ ("Kyle E. Jones" . "kyle_jones@wonderworks.com"))
+ (:maintainer nil . "emacs-devel@gnu.org"))])
+ (flylisp .
+ [(0 2)
+ ((emacs
+ (24 1))
+ (cl-lib
+ (0 4)))
+ "Color unbalanced parentheses and parentheses inconsistent with indentation" single
+ ((:url . "http://elpa.gnu.org/packages/flylisp.html")
+ (:authors
+ ("Barry O'Reilly" . "gundaetiapo@gmail.com"))
+ (:maintainer "Barry O'Reilly" . "gundaetiapo@gmail.com"))])
+ (flymake .
+ [(1 2 2)
+ ((emacs
+ (26 1))
+ (eldoc
+ (1 1 0))
+ (project
+ (0 7 1)))
+ "A universal on-the-fly syntax checker" tar
+ ((:keywords "c" "languages" "tools")
+ (:maintainer "João Távora" . "joaotavora@gmail.com")
+ (:authors
+ ("Pavel Kobyakov" . "pk_at_work@yahoo.com"))
+ (:url . "https://elpa.gnu.org/packages/flymake.html")
+ (:commit . "31af9bca99fa88350271e1a905c9b435eaec28cf"))])
+ (flymake-proselint .
+ [(0 2 3)
+ ((emacs
+ (26 1)))
+ "Flymake backend for proselint" tar
+ ((:url . "https://github.com/manuel-uberti/flymake-proselint")
+ (:keywords "convenience")
+ (:maintainer "Manuel Uberti" . "manuel.uberti@inventati.org")
+ (:authors
+ ("Manuel Uberti" . "manuel.uberti@inventati.org")))])
+ (fontaine .
+ [(0 2 0)
+ ((emacs
+ (27 1)))
+ "Set font configurations using presets" tar
+ ((:url . "https://git.sr.ht/~protesilaos/fontaine")
+ (:maintainer "Protesilaos Stavrou" . "info@protesilaos.com")
+ (:authors
+ ("Protesilaos Stavrou" . "info@protesilaos.com"))
+ (:commit . "a8e7f2e9b8ec6c4eaa75eb55acbc74702c96d438"))])
+ (frame-tabs .
+ [(1 1)
+ nil "show buffer tabs in side window" single
+ ((:url . "http://elpa.gnu.org/packages/frame-tabs.html")
+ (:keywords "frames" "tabs")
+ (:authors
+ ("Martin Rudalics" . "rudalics@gmx.at"))
+ (:maintainer "Martin Rudalics" . "rudalics@gmx.at"))])
+ (frog-menu .
+ [(0 2 11)
+ ((emacs
+ (26))
+ (avy
+ (0 4))
+ (posframe
+ (0 4)))
+ "Quickly pick items from ad hoc menus" single
+ ((:keywords "convenience")
+ (:authors
+ ("Clemens Radermacher" . "clemera@posteo.net"))
+ (:maintainer "Clemens Radermacher" . "clemera@posteo.net")
+ (:url . "https://github.com/clemera/frog-menu"))])
+ (fsm .
+ [(0 2 1)
+ ((emacs
+ (24 1))
+ (cl-lib
+ (0 5)))
+ "state machine library" single
+ ((:url . "http://elpa.gnu.org/packages/fsm.html")
+ (:keywords "extensions")
+ (:authors
+ ("Magnus Henoch" . "magnus.henoch@gmail.com"))
+ (:maintainer "Thomas Fitzsimmons" . "fitzsim@fitzsim.org"))])
+ (ftable .
+ [(1 0)
+ ((emacs
+ (26 0)))
+ "Fill a table to fit in n columns" tar
+ ((:url . "https://github.com/casouri/ftable")
+ (:maintainer "Yuan Fu" . "casouri@gmail.com")
+ (:authors
+ ("Yuan Fu" . "casouri@gmail.com"))
+ (:keywords "convenience" "text" "table"))])
+ (gcmh .
+ [(0 2 1)
+ ((emacs
+ (24)))
+ "the Garbage Collector Magic Hack" single
+ ((:keywords "internal")
+ (:authors
+ ("Andrea Corallo" . "akrl@sdf.org"))
+ (:maintainer nil . "akrl@sdf.org")
+ (:url . "https://gitlab.com/koral/gcmh"))])
+ (ggtags .
+ [(0 9 0)
+ ((emacs
+ (25)))
+ "emacs frontend to GNU Global source code tagging system" tar
+ ((:url . "https://github.com/leoliu/ggtags")
+ (:maintainer "Leo Liu" . "sdl.web@gmail.com")
+ (:authors
+ ("Leo Liu" . "sdl.web@gmail.com"))
+ (:keywords "tools" "convenience"))])
+ (gited .
+ [(0 6 0)
+ ((emacs
+ (24 4))
+ (cl-lib
+ (0 5)))
+ "Operate on Git branches like dired" tar
+ ((:maintainer "Tino Calancha" . "tino.calancha@gmail.com")
+ (:authors
+ ("Tino Calancha" . "tino.calancha@gmail.com"))
+ (:keywords "git" "vc" "convenience")
+ (:url . "http://elpa.gnu.org/packages/gited.html"))])
+ (gle-mode .
+ [(1 1)
+ ((cl-lib
+ (0 5)))
+ "Major mode to edit Graphics Layout Engine files" single
+ ((:url . "http://elpa.gnu.org/packages/gle-mode.html")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (gnome-c-style .
+ [(0 1)
+ nil "minor mode for editing GNOME-style C source code" tar
+ ((:maintainer "Daiki Ueno" . "ueno@gnu.org")
+ (:authors
+ ("Daiki Ueno" . "ueno@gnu.org"))
+ (:keywords "gnome" "c" "coding style")
+ (:url . "http://elpa.gnu.org/packages/gnome-c-style.html"))])
+ (gnorb .
+ [(1 6 10)
+ ((cl-lib
+ (0 5)))
+ "Glue code between Gnus, Org, and BBDB" tar
+ ((:keywords "mail" "org" "gnus" "bbdb" "todo" "task")
+ (:maintainer "Eric Abrahamsen" . "eric@ericabrahamsen.net")
+ (:authors
+ ("Eric Abrahamsen" . "eric@ericabrahamsen.net"))
+ (:url . "https://elpa.gnu.org/packages/gnorb.html"))])
+ (gnu-elpa .
+ [(1 1)
+ nil "Advertize GNU ELPA packages" tar
+ ((:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:url . "http://elpa.gnu.org/packages/gnu-elpa.html"))])
+ (gnu-elpa-keyring-update .
+ [(2019 3)
+ nil "Update Emacs's GPG keyring for GNU ELPA" tar
+ ((:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:keywords "maint" "tools")
+ (:url . "http://elpa.gnu.org/packages/gnu-elpa-keyring-update.html"))])
+ (gnugo .
+ [(3 1 2)
+ ((ascii-art-to-unicode
+ (1 5))
+ (xpm
+ (1 0 1))
+ (cl-lib
+ (0 5)))
+ "play GNU Go in a buffer" tar
+ ((:url . "https://www.gnuvola.org/software/gnugo/")
+ (:keywords "games" "processes")
+ (:maintainer "Thien-Thi Nguyen" . "ttn@gnu.org")
+ (:authors
+ ("Thien-Thi Nguyen" . "ttn@gnu.org")))])
+ (gnus-mock .
+ [(0 5)
+ nil "Mock Gnus installation for testing" tar
+ ((:maintainer "Eric Abrahamsen" . "eric@ericabrahamsen.net")
+ (:authors
+ ("Eric Abrahamsen" . "eric@ericabrahamsen.net"))
+ (:url . "https://elpa.gnu.org/packages/gnus-mock.html"))])
+ (gpastel .
+ [(0 5 0)
+ ((emacs
+ (25 1)))
+ "Integrates GPaste with the kill-ring" single
+ ((:keywords "tools")
+ (:authors
+ ("Damien Cassou" . "damien@cassou.me"))
+ (:maintainer "Damien Cassou" . "damien@cassou.me")
+ (:url . "https://gitlab.petton.fr/DamienCassou/desktop-environment"))])
+ (greader .
+ [(0 1)
+ ((emacs
+ (25)))
+ "gnamù reader, a reader with espeak tts" tar
+ ((:maintainer "Michelangelo Rodriguez" . "michelangelo.rodriguez@gmail.com")
+ (:authors
+ ("Michelangelo Rodriguez" . "michelangelo.rodriguez@gmail.com"))
+ (:keywords "tools" "accessibility")
+ (:url . "http://elpa.gnu.org/packages/greader.html"))])
+ (greenbar .
+ [(1 1)
+ nil "Mark comint output with \"greenbar\" background" single
+ ((:url . "http://elpa.gnu.org/packages/greenbar.html")
+ (:keywords "faces" "terminals")
+ (:authors
+ ("Michael R. Mauger" . "michael@mauger.com"))
+ (:maintainer "Michael R. Mauger" . "michael@mauger.com"))])
+ (gtags-mode .
+ [(1 0)
+ ((emacs
+ (28)))
+ "GNU Global integration with xref, project and imenu." tar
+ ((:url . "https://github.com/Ergus/gtags-mode")
+ (:keywords "xref" "project" "imenu" "gtags" "global")
+ (:maintainer "Jimmy Aguilar Mena")
+ (:authors
+ ("Jimmy Aguilar Mena"))
+ (:commit . "f108a46c6c03eb5e18c73a908c655071aa153a14"))])
+ (guess-language .
+ [(0 0 1)
+ ((cl-lib
+ (0 5))
+ (emacs
+ (24))
+ (nadvice
+ (0 1)))
+ "Robust automatic language detection" single
+ ((:authors
+ ("Titus von der Malsburg" . "malsburg@posteo.de"))
+ (:maintainer "Titus von der Malsburg" . "malsburg@posteo.de")
+ (:url . "https://github.com/tmalsburg/guess-language.el"))])
+ (heap .
+ [(0 5)
+ nil "Heap (a.k.a. priority queue) data structure" single
+ ((:keywords "extensions" "data structures" "heap" "priority queue")
+ (:authors
+ ("Toby Cubitt" . "toby-predictive@dr-qubit.org"))
+ (:maintainer "Toby Cubitt" . "toby-predictive@dr-qubit.org")
+ (:url . "http://www.dr-qubit.org/emacs.php"))])
+ (hiddenquote .
+ [(1 1)
+ ((emacs
+ (25 1)))
+ "Major mode for doing hidden quote puzzles" tar
+ ((:url . "http://mauroaranda.com/puzzles/hidden-quote-puzzle/")
+ (:maintainer "Mauro Aranda" . "maurooaranda@gmail.com")
+ (:authors
+ ("Mauro Aranda" . "maurooaranda@gmail.com"))
+ (:keywords "games"))])
+ (highlight-escape-sequences .
+ [(0 4)
+ nil "Highlight escape sequences" single
+ ((:keywords "convenience")
+ (:authors
+ ("Dmitry Gutov" . "dgutov@yandex.ru")
+ ("Pavel Matcula" . "dev.plvlml@gmail.com"))
+ (:maintainer "Dmitry Gutov" . "dgutov@yandex.ru")
+ (:url . "https://github.com/dgutov/highlight-escape-sequences"))])
+ (hook-helpers .
+ [(1 1 1)
+ ((emacs
+ (25 1)))
+ "Anonymous, modifiable hook functions" tar
+ ((:url . "https://savannah.nongnu.org/projects/hook-helpers-el/")
+ (:maintainer "Ian Dunn" . "dunni@gnu.org")
+ (:authors
+ ("Ian Dunn" . "dunni@gnu.org"))
+ (:keywords "development" "hooks"))])
+ (html5-schema .
+ [(0 1)
+ nil "Add HTML5 schemas for use by nXML" tar
+ ((:url . "https://github.com/validator/validator")
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:keywords "html" "xml"))])
+ (hydra .
+ [(0 14 0)
+ ((cl-lib
+ (0 5)))
+ "Make bindings that stick around." tar
+ ((:url . "https://github.com/abo-abo/hydra")
+ (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com")
+ (:authors
+ ("Oleh Krehel" . "ohwoeowho@gmail.com"))
+ (:keywords "bindings"))])
+ (hyperbole .
+ [(8 0 0)
+ ((emacs
+ (27 0)))
+ "GNU Hyperbole: The Everyday Hypertextual Information Manager" tar
+ ((:url . "http://www.gnu.org/software/hyperbole")
+ (:keywords "comm" "convenience" "files" "frames" "hypermedia" "languages" "mail" "matching" "mouse" "multimedia" "outlines" "tools" "wp")
+ (:maintainer "Bob Weiner <rsw@gnu.org>, Mats Lidell" . "matsl@gnu.org")
+ (:authors
+ ("Bob Weiner"))
+ (:commit . "4214716e06920a3e10db5811bd22a343ad6435d9"))])
+ (ilist .
+ [(0 1)
+ nil "Display a list in an ibuffer way." tar
+ ((:keywords "convenience")
+ (:maintainer "Durand" . "mmemmew@gmail.com")
+ (:authors
+ ("Durand" . "mmemmew@gmail.com"))
+ (:url . "https://elpa.gnu.org/packages/ilist.html"))])
+ (ioccur .
+ [(2 6)
+ ((emacs
+ (24))
+ (cl-lib
+ (0 5)))
+ "Incremental occur" tar
+ ((:url . "https://github.com/thierryvolpiatto/ioccur")
+ (:maintainer "Thierry Volpiatto" . "thievol@posteo.net")
+ (:authors
+ ("Thierry Volpiatto" . "thievol@posteo.net")))])
+ (isearch-mb .
+ [(0 5)
+ ((emacs
+ (27 1)))
+ "Control isearch from the minibuffer" tar
+ ((:url . "https://github.com/astoff/isearch-mb")
+ (:keywords "matching")
+ (:maintainer "Augusto Stoffel" . "arstoffel@gmail.com")
+ (:authors
+ ("Augusto Stoffel" . "arstoffel@gmail.com"))
+ (:commit . "e70ba8f594afef989006493dd71bd693a29e9f42"))])
+ (iterators .
+ [(0 1 1)
+ ((emacs
+ (25)))
+ "Functions for working with iterators" single
+ ((:url . "http://elpa.gnu.org/packages/iterators.html")
+ (:keywords "extensions" "elisp")
+ (:authors
+ ("Michael Heerdegen" . "michael_heerdegen@web.de"))
+ (:maintainer "Michael Heerdegen" . "michael_heerdegen@web.de"))])
+ (ivy .
+ [(0 13 4)
+ ((emacs
+ (24 5)))
+ "Incremental Vertical completYon" tar
+ ((:url . "https://github.com/abo-abo/swiper")
+ (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com")
+ (:authors
+ ("Oleh Krehel" . "ohwoeowho@gmail.com"))
+ (:keywords "matching"))])
+ (ivy-avy .
+ [(0 13 4)
+ ((emacs
+ (24 5))
+ (ivy
+ (0 13 4))
+ (avy
+ (0 5 0)))
+ "Avy integration for Ivy" tar
+ ((:url . "https://github.com/abo-abo/swiper")
+ (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com")
+ (:authors
+ ("Oleh Krehel" . "ohwoeowho@gmail.com"))
+ (:keywords "convenience"))])
+ (ivy-explorer .
+ [(0 3 2)
+ ((emacs
+ (25))
+ (ivy
+ (0 10 0)))
+ "Dynamic file browsing grid using ivy" single
+ ((:keywords "convenience" "files" "matching")
+ (:authors
+ ("Clemens Radermacher" . "clemera@posteo.net"))
+ (:maintainer "Clemens Radermacher" . "clemera@posteo.net")
+ (:url . "https://github.com/clemera/ivy-explorer"))])
+ (ivy-hydra .
+ [(0 13 5)
+ ((emacs
+ (24 5))
+ (ivy
+ (0 13 4))
+ (hydra
+ (0 14 0)))
+ "Additional key bindings for Ivy" tar
+ ((:url . "https://github.com/abo-abo/swiper")
+ (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com")
+ (:authors
+ ("Oleh Krehel" . "ohwoeowho@gmail.com"))
+ (:keywords "convenience"))])
+ (ivy-posframe .
+ [(0 6 3)
+ ((emacs
+ (26 0))
+ (posframe
+ (1 0 0))
+ (ivy
+ (0 13 0)))
+ "Using posframe to show Ivy" tar
+ ((:url . "https://github.com/tumashu/ivy-posframe")
+ (:keywords "abbrev" "convenience" "matching" "ivy")
+ (:maintainer "Feng Shu" . "tumashu@163.com")
+ (:authors
+ ("Feng Shu" . "tumashu@163.com")
+ ("Naoya Yamashita" . "conao3@gmail.com")))])
+ (javaimp .
+ [(0 8)
+ nil "Add and reorder Java import statements in Maven/Gradle projects" tar
+ ((:keywords "java" "maven" "gradle" "programming")
+ (:maintainer "Filipp Gunbin" . "fgunbin@fastmail.fm")
+ (:authors
+ ("Filipp Gunbin" . "fgunbin@fastmail.fm"))
+ (:url . "https://elpa.gnu.org/packages/javaimp.html"))])
+ (jgraph-mode .
+ [(1 1)
+ ((cl-lib
+ (0 5)))
+ "Major mode for Jgraph files" single
+ ((:url . "http://elpa.gnu.org/packages/jgraph-mode.html")
+ (:keywords "tex" "wp")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (js2-mode .
+ [(20211229)
+ ((emacs
+ (24 1))
+ (cl-lib
+ (0 5)))
+ "Improved JavaScript editing mode" tar
+ ((:url . "https://github.com/mooz/js2-mode/")
+ (:keywords "languages" "javascript")
+ (:maintainer "Steve Yegge" . "steve.yegge@gmail.com")
+ (:authors
+ ("Steve Yegge" . "steve.yegge@gmail.com")
+ ("mooz" . "stillpedant@gmail.com")
+ ("Dmitry Gutov" . "dgutov@yandex.ru")))])
+ (json-mode .
+ [(0 2)
+ ((emacs
+ (25 1)))
+ "Major mode for editing JSON files" single
+ ((:url . "http://elpa.gnu.org/packages/json-mode.html")
+ (:keywords "data")
+ (:authors
+ ("Simen Heggestøyl" . "simenheg@gmail.com"))
+ (:maintainer "Simen Heggestøyl" . "simenheg@gmail.com"))])
+ (jsonrpc .
+ [(1 0 15)
+ ((emacs
+ (25 2)))
+ "JSON-RPC library" tar
+ ((:keywords "processes" "languages" "extensions")
+ (:maintainer "João Távora" . "joaotavora@gmail.com")
+ (:authors
+ ("João Távora" . "joaotavora@gmail.com"))
+ (:url . "https://elpa.gnu.org/packages/jsonrpc.html")
+ (:commit . "50654cf0b1bf6210fc8f46d8e7ae13bbeeccecb5"))])
+ (jumpc .
+ [(3 0)
+ nil "jump to previous insertion points" single
+ ((:url . "http://elpa.gnu.org/packages/jumpc.html")
+ (:authors
+ ("Ivan Kanis" . "ivan@kanis.fr"))
+ (:maintainer "Ivan Kanis" . "ivan@kanis.fr"))])
+ (kind-icon .
+ [(0 1 5)
+ ((emacs
+ (27 1))
+ (svg-lib
+ (0)))
+ "Completion kind icons" tar
+ ((:url . "https://github.com/jdtsmith/kind-icon")
+ (:keywords "completion")
+ (:maintainer "J.D. Smith" . "jdtsmith@gmail.com")
+ (:authors
+ ("J.D. Smith" . "jdtsmith@gmail.com"))
+ (:commit . "235c3d20d1e667d6ac73e11d55a380e070b7cacf"))])
+ (kiwix .
+ [(1 1 5)
+ ((emacs
+ (25 1))
+ (request
+ (0 3 0)))
+ "Searching offline Wikipedia through Kiwix." tar
+ ((:url . "https://github.com/stardiviner/kiwix.el")
+ (:keywords "kiwix" "wikipedia")
+ (:maintainer "stardiviner" . "numbchild@gmail.com")
+ (:authors
+ ("stardiviner" . "numbchild@gmail.com")))])
+ (kmb .
+ [(0 1)
+ ((emacs
+ (24 1)))
+ "Kill buffers matching a regexp w/o confirmation" single
+ ((:url . "http://elpa.gnu.org/packages/kmb.html")
+ (:keywords "lisp" "convenience")
+ (:authors
+ ("Tino Calancha" . "tino.calancha@gmail.com"))
+ (:maintainer "Tino Calancha" . "tino.calancha@gmail.com"))])
+ (landmark .
+ [(1 0)
+ nil "Neural-network robot that learns landmarks" single
+ ((:url . "http://elpa.gnu.org/packages/landmark.html")
+ (:keywords "games" "neural network" "adaptive search" "chemotaxis")
+ (:authors
+ ("Terrence Brannon" . "metaperl@gmail.com"))
+ (:maintainer nil . "emacs-devel@gnu.org"))])
+ (leaf .
+ [(4 5 5)
+ ((emacs
+ (24 1)))
+ "Simplify your init.el configuration, extended use-package" tar
+ ((:url . "https://github.com/conao3/leaf.el")
+ (:keywords "lisp" "settings")
+ (:maintainer "Naoya Yamashita" . "conao3@gmail.com")
+ (:authors
+ ("Naoya Yamashita" . "conao3@gmail.com"))
+ (:commit . "7cc38f9739eadc569b1179fabe7f7893167105da"))])
+ (let-alist .
+ [(1 0 6)
+ ((emacs
+ (24 1)))
+ "Easily let-bind values of an assoc-list by their names" single
+ ((:url . "http://elpa.gnu.org/packages/let-alist.html")
+ (:keywords "extensions" "lisp")
+ (:authors
+ ("Artur Malabarba" . "emacs@endlessparentheses.com"))
+ (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com"))])
+ (lex .
+ [(1 1)
+ nil "Lexical analyser construction" tar
+ ((:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:url . "http://elpa.gnu.org/packages/lex.html"))])
+ (lin .
+ [(0 3 1)
+ ((emacs
+ (27 1)))
+ "Make `hl-line-mode' more suitable for selection UIs" tar
+ ((:url . "https://git.sr.ht/~protesilaos/lin")
+ (:keywords "convenience" "faces" "theme")
+ (:maintainer "Protesilaos Stavrou" . "info@protesilaos.com")
+ (:authors
+ ("Protesilaos Stavrou" . "info@protesilaos.com"))
+ (:commit . "520621e51a6f6882beda4420fa5ccee6682748dd"))])
+ (lmc .
+ [(1 4)
+ ((emacs
+ (24))
+ (cl-lib
+ (0 5)))
+ "Little Man Computer in Elisp" single
+ ((:url . "http://elpa.gnu.org/packages/lmc.html")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (load-dir .
+ [(0 0 5)
+ ((cl-lib
+ (0 5)))
+ "Load all Emacs Lisp files in a given directory" single
+ ((:url . "http://elpa.gnu.org/packages/load-dir.html")
+ (:keywords "lisp" "files" "convenience")
+ (:maintainer "Teodor Zlatanov" . "tzz@lifelogs.com"))])
+ (load-relative .
+ [(1 3 1)
+ nil "Relative file load (within a multi-file Emacs package)" single
+ ((:keywords "internal")
+ (:authors
+ ("Rocky Bernstein" . "rocky@gnu.org"))
+ (:maintainer "Rocky Bernstein" . "rocky@gnu.org")
+ (:url . "http://github.com/rocky/emacs-load-relative"))])
+ (loc-changes .
+ [(1 2)
+ nil "keep track of positions even after buffer changes" single
+ ((:authors
+ ("Rocky Bernstein" . "rocky@gnu.org"))
+ (:maintainer "Rocky Bernstein" . "rocky@gnu.org")
+ (:url . "http://github.com/rocky/emacs-loc-changes"))])
+ (loccur .
+ [(1 2 4)
+ ((emacs
+ (24 3)))
+ "Perform an occur-like folding in current buffer" single
+ ((:keywords "matching")
+ (:authors
+ ("Alexey Veretennikov" . "alexey.veretennikov@gmail.com"))
+ (:maintainer "Alexey Veretennikov" . "alexey.veretennikov@gmail.com")
+ (:url . "https://github.com/fourier/loccur"))])
+ (logos .
+ [(0 3 2)
+ ((emacs
+ (27 1)))
+ "Simple focus mode and extras" tar
+ ((:url . "https://git.sr.ht/~protesilaos/logos")
+ (:keywords "convenience" "focus" "writing" "presentation" "narrowing")
+ (:maintainer "Protesilaos Stavrou" . "info@protesilaos.com")
+ (:authors
+ ("Protesilaos Stavrou" . "info@protesilaos.com"))
+ (:commit . "dd25e36b64320f2ba9400a3929443aa81085e697"))])
+ (map .
+ [(3 2 1)
+ ((emacs
+ (26)))
+ "Map manipulation functions" tar
+ ((:keywords "extensions" "lisp")
+ (:maintainer nil . "emacs-devel@gnu.org")
+ (:authors
+ ("Nicolas Petton" . "nicolas@petton.fr"))
+ (:url . "https://elpa.gnu.org/packages/map.html")
+ (:commit . "fa92b040c6738de7278605cadeace0c5380a0814"))])
+ (marginalia .
+ [(0 13)
+ ((emacs
+ (26 1)))
+ "Enrich existing commands with completion annotations" tar
+ ((:url . "https://github.com/minad/marginalia")
+ (:maintainer "Omar Antolín Camarena <omar@matem.unam.mx>, Daniel Mendler" . "mail@daniel-mendler.de")
+ (:authors
+ ("Omar Antolín Camarena <omar@matem.unam.mx>, Daniel Mendler" . "mail@daniel-mendler.de"))
+ (:commit . "bd98c02720bc59a5c185c293f60595d06dfd7637"))])
+ (markchars .
+ [(0 2 2)
+ nil "Mark chars fitting certain characteristics" single
+ ((:url . "http://elpa.gnu.org/packages/markchars.html")
+ (:authors
+ ("Lennart Borgman" . "lennart.borgman@gmail.com"))
+ (:maintainer "Lennart Borgman" . "lennart.borgman@gmail.com"))])
+ (math-symbol-lists .
+ [(1 2 1)
+ nil "Lists of Unicode math symbols and latex commands" single
+ ((:keywords "unicode" "symbols" "mathematics")
+ (:authors
+ ("Vitalie Spinu" . "spinuvit@gmail.com"))
+ (:maintainer "Vitalie Spinu" . "spinuvit@gmail.com")
+ (:url . "https://github.com/vspinu/math-symbol-lists"))])
+ (mct .
+ [(0 5 0)
+ ((emacs
+ (27 1)))
+ "Minibuffer and Completions in Tandem" tar
+ ((:url . "https://gitlab.com/protesilaos/mct")
+ (:maintainer "Protesilaos Stavrou" . "info@protesilaos.com")
+ (:authors
+ ("Protesilaos Stavrou" . "info@protesilaos.com"))
+ (:commit . "680d7727216ed05ba58e7d2f04a046d1f27cf3e9"))])
+ (memory-usage .
+ [(0 2)
+ nil "Analyze the memory usage of Emacs in various ways" single
+ ((:url . "http://elpa.gnu.org/packages/memory-usage.html")
+ (:keywords "maint")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (metar .
+ [(0 3)
+ ((cl-lib
+ (0 5)))
+ "Retrieve and decode METAR weather information" single
+ ((:url . "http://elpa.gnu.org/packages/metar.html")
+ (:keywords "comm")
+ (:authors
+ ("Mario Lang" . "mlang@delysid.org"))
+ (:maintainer "Mario Lang" . "mlang@delysid.org"))])
+ (midi-kbd .
+ [(0 2)
+ ((emacs
+ (25)))
+ "Create keyboard events from Midi input" single
+ ((:url . "http://elpa.gnu.org/packages/midi-kbd.html")
+ (:keywords "convenience" "hardware" "multimedia")
+ (:authors
+ ("David Kastrup" . "dak@gnu.org"))
+ (:maintainer "David Kastrup" . "dak@gnu.org"))])
+ (mines .
+ [(1 6)
+ ((emacs
+ (24 4))
+ (cl-lib
+ (0 5)))
+ "Minesweeper game" tar
+ ((:url . "https://github.com/calancha/Minesweeper")
+ (:maintainer "Tino Calancha" . "tino.calancha@gmail.com")
+ (:authors
+ ("Tino Calancha" . "tino.calancha@gmail.com"))
+ (:keywords "games"))])
+ (minibuffer-line .
+ [(0 1)
+ nil "Display status info in the minibuffer window" single
+ ((:url . "http://elpa.gnu.org/packages/minibuffer-line.html")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (minimap .
+ [(1 4)
+ nil "Sidebar showing a \"mini-map\" of a buffer" single
+ ((:url . "http://elpa.gnu.org/packages/minimap.html")
+ (:authors
+ ("David Engster" . "deng@randomsample.de"))
+ (:maintainer "David Engster" . "deng@randomsample.de"))])
+ (mmm-mode .
+ [(0 5 8)
+ ((cl-lib
+ (0 2)))
+ "Allow Multiple Major Modes in a buffer" tar
+ ((:url . "https://github.com/purcell/mmm-mode")
+ (:maintainer "Dmitry Gutov" . "dgutov@yandex.ru")
+ (:authors
+ ("Michael Abraham Shulman" . "viritrilbia@gmail.com"))
+ (:keywords "convenience" "faces" "languages" "tools"))])
+ (modus-operandi-theme .
+ [(0 13 2)
+ ((emacs
+ (26 1))
+ (modus-themes
+ (1 2 4)))
+ "Accessible light theme (WCAG AAA) [DEPRECATED]" tar
+ ((:url . "https://gitlab.com/protesilaos/modus-themes")
+ (:maintainer "Protesilaos Stavrou" . "info@protesilaos.com")
+ (:authors
+ ("Protesilaos Stavrou" . "info@protesilaos.com"))
+ (:keywords "faces" "theme" "accessibility"))])
+ (modus-themes .
+ [(2 3 0)
+ ((emacs
+ (27 1)))
+ "Elegant, highly legible and customizable themes" tar
+ ((:url . "https://gitlab.com/protesilaos/modus-themes")
+ (:keywords "faces" "theme" "accessibility")
+ (:maintainer "Protesilaos Stavrou" . "info@protesilaos.com")
+ (:authors
+ ("Protesilaos Stavrou" . "info@protesilaos.com"))
+ (:commit . "7b08e3a8e41db1483322f48305f837e705540249"))])
+ (modus-vivendi-theme .
+ [(0 13 2)
+ ((emacs
+ (26 1))
+ (modus-themes
+ (1 2 4)))
+ "Accessible dark theme (WCAG AAA) [DEPRECATED]" tar
+ ((:url . "https://gitlab.com/protesilaos/modus-themes")
+ (:maintainer "Protesilaos Stavrou" . "info@protesilaos.com")
+ (:authors
+ ("Protesilaos Stavrou" . "info@protesilaos.com"))
+ (:keywords "faces" "theme" "accessibility"))])
+ (multi-mode .
+ [(1 14)
+ nil "support for multiple major modes" tar
+ ((:url . "http://www.loveshack.ukfsn.org/emacs")
+ (:keywords "languages" "extensions" "files")
+ (:maintainer "Dave Love" . "fx@gnu.org")
+ (:authors
+ ("Dave Love" . "fx@gnu.org")))])
+ (multishell .
+ [(1 1 9)
+ ((cl-lib
+ (0 5)))
+ "Easily use multiple shell buffers, local and remote" tar
+ ((:url . "https://github.com/kenmanheimer/EmacsMultishell")
+ (:maintainer "Ken Manheimer" . "ken.manheimer@gmail.com")
+ (:authors
+ ("Ken Manheimer" . "ken.manheimer@gmail.com"))
+ (:keywords "processes"))])
+ (muse .
+ [(3 20 2)
+ nil "Authoring and publishing tool for Emacs" tar
+ ((:url . "http://mwolson.org/projects/EmacsMuse.html")
+ (:maintainer "Michael Olson" . "mwolson@gnu.org")
+ (:authors
+ ("John Wiegley" . "johnw@gnu.org"))
+ (:keywords "hypermedia"))])
+ (myers .
+ [(0 1)
+ ((emacs
+ (25)))
+ "Random-access singly-linked lists" single
+ ((:url . "http://elpa.gnu.org/packages/myers.html")
+ (:keywords "list" "containers")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (nadvice .
+ [(0 3)
+ nil "Forward compatibility for Emacs-24.4's nadvice" single
+ ((:url . "http://elpa.gnu.org/packages/nadvice.html")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (nameless .
+ [(1 0 2)
+ ((emacs
+ (24 4)))
+ "Hide package namespace in your emacs-lisp code" single
+ ((:keywords "convenience" "lisp")
+ (:authors
+ ("Artur Malabarba" . "emacs@endlessparentheses.com"))
+ (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com")
+ (:url . "https://github.com/Malabarba/nameless"))])
+ (names .
+ [(20151201 0)
+ ((emacs
+ (24 1))
+ (cl-lib
+ (0 5))
+ (nadvice
+ (0 3)))
+ "Namespaces for emacs-lisp. Avoid name clobbering without hiding symbols." tar
+ ((:url . "https://github.com/Malabarba/names")
+ (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com")
+ (:authors
+ ("Artur Malabarba" . "emacs@endlessparentheses.com"))
+ (:keywords "extensions" "lisp"))])
+ (nano-agenda .
+ [(0 2 1)
+ ((emacs
+ (27 1)))
+ "N Λ N O agenda" tar
+ ((:url . "https://github.com/rougier/nano-agenda")
+ (:keywords "convenience" "org-mode" "org-agenda")
+ (:maintainer "Nicolas P. Rougier" . "Nicolas.Rougier@inria.fr"))])
+ (nano-modeline .
+ [(0 6)
+ ((emacs
+ (27 1)))
+ "N Λ N O modeline" tar
+ ((:url . "https://github.com/rougier/nano-modeline")
+ (:keywords "convenience" "mode-line" "header-line")
+ (:maintainer "Nicolas P. Rougier" . "Nicolas.Rougier@inria.fr")
+ (:commit . "1c743a9dbe72a1bdc2196ad43a217060e163c929"))])
+ (nano-theme .
+ [(0 3 1)
+ ((emacs
+ (27 1)))
+ "N Λ N O theme" tar
+ ((:url . "https://github.com/rougier/nano-theme")
+ (:keywords "theme" "dark" "light")
+ (:maintainer "Nicolas P. Rougier" . "Nicolas.Rougier@inria.fr")
+ (:commit . "c4f296d349cf5ef2efd88d68535a4dbf577b9a87"))])
+ (nhexl-mode .
+ [(1 5)
+ ((emacs
+ (24 4))
+ (cl-lib
+ (0 5)))
+ "Minor mode to edit files via hex-dump format" single
+ ((:url . "http://elpa.gnu.org/packages/nhexl-mode.html")
+ (:keywords "data")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (nlinum .
+ [(1 9)
+ nil "Show line numbers in the margin" single
+ ((:url . "http://elpa.gnu.org/packages/nlinum.html")
+ (:keywords "convenience")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (notes-mode .
+ [(1 30)
+ nil "Indexing system for on-line note-taking" tar
+ ((:maintainer nil . "<johnh@isi.edu>.")
+ (:authors
+ (nil . "<johnh@isi.edu>."))
+ (:url . "http://elpa.gnu.org/packages/notes-mode.html"))])
+ (ntlm .
+ [(2 1 0)
+ nil "NTLM (NT LanManager) authentication support" single
+ ((:url . "http://elpa.gnu.org/packages/ntlm.html")
+ (:keywords "ntlm" "sasl" "comm")
+ (:authors
+ ("Taro Kawagishi" . "tarok@transpulse.org"))
+ (:maintainer "Thomas Fitzsimmons" . "fitzsim@fitzsim.org"))])
+ (num3-mode .
+ [(1 3)
+ nil "highlight groups of digits in long numbers" single
+ ((:url . "http://elpa.gnu.org/packages/num3-mode.html")
+ (:keywords "faces" "minor-mode")
+ (:authors
+ ("Felix Lee <felix8a@gmail.com>, Michal Nazarewicz" . "mina86@mina86.com"))
+ (:maintainer "Michal Nazarewicz" . "mina86@mina86.com"))])
+ (oauth2 .
+ [(0 16)
+ ((cl-lib
+ (0 5))
+ (nadvice
+ (0 3)))
+ "OAuth 2.0 Authorization Protocol" tar
+ ((:maintainer "Julien Danjou" . "julien@danjou.info")
+ (:authors
+ ("Julien Danjou" . "julien@danjou.info"))
+ (:keywords "comm")
+ (:url . "https://elpa.gnu.org/packages/oauth2.html"))])
+ (ob-haxe .
+ [(1 0)
+ nil "org-babel functions for haxe evaluation" tar
+ ((:url . "https://orgmode.org")
+ (:maintainer "Ian Martins" . "ianxm@jhu.edu")
+ (:authors
+ ("Ian Martins" . "ianxm@jhu.edu"))
+ (:keywords "literate programming" "reproducible research"))])
+ (objed .
+ [(0 8 3)
+ ((emacs
+ (25))
+ (cl-lib
+ (0 5)))
+ "Navigate and edit text objects." tar
+ ((:url . "https://github.com/clemera/objed")
+ (:maintainer "Clemens Radermacher" . "clemera@posteo.net")
+ (:authors
+ ("Clemens Radermacher" . "clemera@posteo.net"))
+ (:keywords "convenience"))])
+ (omn-mode .
+ [(1 2)
+ nil "Support for OWL Manchester Notation" single
+ ((:url . "http://elpa.gnu.org/packages/omn-mode.html")
+ (:authors
+ ("Phillip Lord" . "phillip.lord@newcastle.ac.uk"))
+ (:maintainer "Phillip Lord" . "phillip.lord@newcastle.ac.uk"))])
+ (on-screen .
+ [(1 3 3)
+ ((cl-lib
+ (0)))
+ "guide your eyes while scrolling" single
+ ((:keywords "convenience")
+ (:authors
+ ("Michael Heerdegen" . "michael_heerdegen@web.de"))
+ (:maintainer "Michael Heerdegen" . "michael_heerdegen@web.de")
+ (:url . "https://github.com/michael-heerdegen/on-screen.el"))])
+ (orderless .
+ [(0 7)
+ ((emacs
+ (26 1)))
+ "Completion style for matching regexps in any order" tar
+ ((:url . "https://github.com/oantolin/orderless")
+ (:keywords "extensions")
+ (:maintainer "Omar Antolín Camarena" . "omar@matem.unam.mx")
+ (:authors
+ ("Omar Antolín Camarena" . "omar@matem.unam.mx"))
+ (:commit . "92008e762b30cb445a2227e458cbb9a5e1b1d4e8"))])
+ (org .
+ [(9 5 3)
+ ((emacs
+ (25 1)))
+ "Outline-based notes management and organizer" tar
+ ((:url . "https://orgmode.org")
+ (:keywords "outlines" "hypermedia" "calendar" "wp")
+ (:maintainer "Bastien Guerry" . "bzg@gnu.org")
+ (:authors
+ ("Carsten Dominik" . "carsten.dominik@gmail.com"))
+ (:commit . "69c588947d1be9bca1eb8c773f2a8ff117d264ba"))])
+ (org-edna .
+ [(1 1 2)
+ ((emacs
+ (25 1))
+ (seq
+ (2 19))
+ (org
+ (9 0 5)))
+ "Extensible Dependencies 'N' Actions" tar
+ ((:url . "https://savannah.nongnu.org/projects/org-edna-el/")
+ (:maintainer "Ian Dunn" . "dunni@gnu.org")
+ (:authors
+ ("Ian Dunn" . "dunni@gnu.org"))
+ (:keywords "convenience" "text" "org"))])
+ (org-modern .
+ [(0 3)
+ ((emacs
+ (27 1)))
+ "Modern looks for Org" tar
+ ((:url . "https://github.com/minad/org-modern")
+ (:maintainer "Daniel Mendler" . "mail@daniel-mendler.de")
+ (:authors
+ ("Daniel Mendler" . "mail@daniel-mendler.de"))
+ (:commit . "64fa67a3e4cc7af4084bb879bd8a0e5380333bcf"))])
+ (org-real .
+ [(1 0 4)
+ ((emacs
+ (26 1))
+ (boxy
+ (1 0))
+ (org
+ (9 3)))
+ "Keep track of real things as org-mode links" tar
+ ((:url . "https://gitlab.com/tygrdev/org-real")
+ (:keywords "tools")
+ (:maintainer "Tyler Grinn" . "tylergrinn@gmail.com")
+ (:authors
+ ("Tyler Grinn" . "tylergrinn@gmail.com")))])
+ (org-remark .
+ [(1 0 4)
+ ((emacs
+ (27 1))
+ (org
+ (9 4)))
+ "Highlight & annotate any text files" tar
+ ((:url . "https://github.com/nobiot/org-remark")
+ (:keywords "org-mode" "annotation" "writing" "note-taking" "marginal-notes")
+ (:maintainer "Noboru Ota" . "me@nobiot.com")
+ (:authors
+ ("Noboru Ota" . "me@nobiot.com"))
+ (:commit . "e78cdff25edffc74bfe4c65f3a02777d454f6d96"))])
+ (org-transclusion .
+ [(1 2 0)
+ ((emacs
+ (27 1))
+ (org
+ (9 4)))
+ "Transclude text content via links" tar
+ ((:url . "https://github.com/nobiot/org-transclusion")
+ (:keywords "org-mode" "transclusion" "writing")
+ (:maintainer "Noboru Ota" . "me@nobiot.com")
+ (:authors
+ ("Noboru Ota" . "me@nobiot.com"))
+ (:commit . "2d44c56fb666da2dbb6c988389a21bee5bdd406c"))])
+ (org-translate .
+ [(0 1 4)
+ ((emacs
+ (27 1))
+ (org
+ (9 1)))
+ "Org-based translation environment" tar
+ ((:maintainer "Eric Abrahamsen" . "eric@ericabrahamsen.net")
+ (:authors
+ ("Eric Abrahamsen" . "eric@ericabrahamsen.net"))
+ (:url . "https://elpa.gnu.org/packages/org-translate.html")
+ (:commit . "bdc5d169ef0c502f46aa673918ccf34fcc8415f2"))])
+ (orgalist .
+ [(1 13)
+ ((emacs
+ (24 4)))
+ "Manage Org-like lists in non-Org buffers" single
+ ((:url . "http://elpa.gnu.org/packages/orgalist.html")
+ (:keywords "convenience")
+ (:authors
+ ("Nicolas Goaziou" . "mail@nicolasgoaziou.fr"))
+ (:maintainer "Nicolas Goaziou" . "mail@nicolasgoaziou.fr"))])
+ (osc .
+ [(0 4)
+ nil "Open Sound Control protocol library" tar
+ ((:maintainer "Mario Lang" . "mlang@blind.guru")
+ (:authors
+ ("Mario Lang" . "mlang@blind.guru"))
+ (:keywords "comm" "processes" "multimedia")
+ (:url . "https://elpa.gnu.org/packages/osc.html"))])
+ (osm .
+ [(0 7)
+ ((emacs
+ (27 1)))
+ "OpenStreetMap viewer" tar
+ ((:url . "https://github.com/minad/osm")
+ (:maintainer "Daniel Mendler" . "mail@daniel-mendler.de")
+ (:authors
+ ("Daniel Mendler" . "mail@daniel-mendler.de"))
+ (:commit . "e3ea969ce1bf84343f357efa2de97e1dd857f481"))])
+ (other-frame-window .
+ [(1 0 6)
+ ((emacs
+ (24 4)))
+ "Minor mode to enable global prefix keys for other frame/window buffer placement" single
+ ((:url . "http://elpa.gnu.org/packages/other-frame-window.html")
+ (:keywords "frame" "window")
+ (:authors
+ ("Stephen Leake" . "stephen_leake@member.fsf.org"))
+ (:maintainer "Stephen Leake" . "stephen_leake@member.fsf.org"))])
+ (pabbrev .
+ [(4 2 1)
+ nil "Predictive abbreviation expansion" single
+ ((:url . "http://elpa.gnu.org/packages/pabbrev.html")
+ (:authors
+ ("Phillip Lord" . "phillip.lord@newcastle.ac.uk"))
+ (:maintainer "Phillip Lord" . "phillip.lord@newcastle.ac.uk"))])
+ (paced .
+ [(1 1 3)
+ ((emacs
+ (25 1))
+ (async
+ (1 9 1)))
+ "Predictive Abbreviation Completion and Expansion using Dictionaries" tar
+ ((:url . "https://savannah.nongnu.org/projects/paced-el/")
+ (:maintainer "Ian Dunn" . "dunni@gnu.org")
+ (:authors
+ ("Ian Dunn" . "dunni@gnu.org"))
+ (:keywords "convenience" "completion"))])
+ (parsec .
+ [(0 1 3)
+ ((emacs
+ (24))
+ (cl-lib
+ (0 5)))
+ "Parser combinator library" tar
+ ((:url . "https://github.com/cute-jumper/parsec.el")
+ (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com")
+ (:authors
+ ("Junpeng Qiu" . "qjpchmail@gmail.com"))
+ (:keywords "extensions"))])
+ (parser-generator .
+ [(0 1 5)
+ ((emacs
+ (26)))
+ "Parser Generator library" tar
+ ((:url . "https://github.com/cjohansson/emacs-parser-generator")
+ (:keywords "tools" "convenience")
+ (:maintainer "Christian Johansson" . "christian@cvj.se")
+ (:authors
+ ("Christian Johansson" . "christian@cvj.se"))
+ (:commit . "bf7229332f7040d49fdac56e54da13d73752395d"))])
+ (path-iterator .
+ [(1 0)
+ ((emacs
+ (25 0)))
+ "An iterator for traversing a directory path." tar
+ ((:maintainer "Stephen Leake" . "stephen_leake@stephe-leake.org")
+ (:authors
+ ("Stephen Leake" . "stephen_leake@stephe-leake.org"))
+ (:url . "http://elpa.gnu.org/packages/path-iterator.html"))])
+ (peg .
+ [(1 0)
+ ((emacs
+ (25)))
+ "Parsing Expression Grammars in Emacs Lisp" tar
+ ((:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca")
+ (:authors
+ ("Helmut Eller" . "eller.helmut@gmail.com"))
+ (:url . "http://elpa.gnu.org/packages/peg.html"))])
+ (persist .
+ [(0 4)
+ nil "Persist Variables between Emacs Sessions" tar
+ ((:maintainer "Phillip Lord" . "phillip.lord@russet.org.uk")
+ (:authors
+ ("Phillip Lord" . "phillip.lord@russet.org.uk"))
+ (:url . "http://elpa.gnu.org/packages/persist.html"))])
+ (phps-mode .
+ [(0 4 20)
+ ((emacs
+ (26)))
+ "Major mode for PHP with code intelligence" tar
+ ((:url . "https://github.com/cjohansson/emacs-phps-mode")
+ (:keywords "tools" "convenience")
+ (:maintainer "Christian Johansson" . "christian@cvj.se")
+ (:authors
+ ("Christian Johansson" . "christian@cvj.se"))
+ (:commit . "3a09d15aa143b175235674f4cd45f92b0b0a6c36"))])
+ (pinentry .
+ [(0 1)
+ nil "GnuPG Pinentry server implementation" single
+ ((:url . "http://elpa.gnu.org/packages/pinentry.html")
+ (:keywords "gnupg")
+ (:authors
+ ("Daiki Ueno" . "ueno@gnu.org"))
+ (:maintainer "Daiki Ueno" . "ueno@gnu.org"))])
+ (poker .
+ [(0 2)
+ nil "Texas hold 'em poker" single
+ ((:url . "http://elpa.gnu.org/packages/poker.html")
+ (:keywords "games")
+ (:authors
+ ("Mario Lang" . "mlang@delysid.org"))
+ (:maintainer "Mario Lang" . "mlang@delysid.org"))])
+ (posframe .
+ [(1 1 7)
+ ((emacs
+ (26 1)))
+ "Pop a posframe (just a frame) at point" tar
+ ((:url . "https://github.com/tumashu/posframe")
+ (:keywords "convenience" "tooltip")
+ (:maintainer "Feng Shu" . "tumashu@163.com")
+ (:authors
+ ("Feng Shu" . "tumashu@163.com"))
+ (:commit . "c91d4d53fa479ceb604071008ce0a901770eff57"))])
+ (project .
+ [(0 8 1)
+ ((emacs
+ (26 1))
+ (xref
+ (1 0 2)))
+ "Operations on the current project" tar
+ ((:url . "https://elpa.gnu.org/packages/project.html")
+ (:commit . "6bf29072e968401f842789c71468e624e5c913a9"))])
+ (psgml .
+ [(1 3 4)
+ nil "SGML-editing mode with parsing support" tar
+ ((:maintainer "Lennart Staflin" . "lstaflin@gmail.com")
+ (:authors
+ ("Lennart Staflin" . "lenst@lysator.liu.se")
+ ("James Clark" . "jjc@clark.com"))
+ (:keywords "languages")
+ (:url . "http://elpa.gnu.org/packages/psgml.html"))])
+ (pspp-mode .
+ [(1 1)
+ nil "Major mode for editing PSPP files" single
+ ((:url . "http://elpa.gnu.org/packages/pspp-mode.html")
+ (:keywords "pspp" "major-mode")
+ (:authors
+ ("Scott Andrew Borton" . "scott@pp.htv.fi"))
+ (:maintainer "John Darrington" . "john@darrington.wattle.id.au"))])
+ (pulsar .
+ [(0 3 1)
+ ((emacs
+ (27 1)))
+ "Pulse highlight on demand or after select functions" tar
+ ((:url . "https://git.sr.ht/~protesilaos/pulsar")
+ (:keywords "convenience" "pulse" "highlight")
+ (:maintainer "Protesilaos Stavrou" . "info@protesilaos.com")
+ (:authors
+ ("Protesilaos Stavrou" . "info@protesilaos.com"))
+ (:commit . "86a7c429c6878287c068106b318889824cad3210"))])
+ (pyim .
+ [(4 2 0)
+ ((emacs
+ (25 1))
+ (async
+ (1 6))
+ (xr
+ (1 13)))
+ "A Chinese input method support quanpin, shuangpin, wubi, cangjie and rime." tar
+ ((:url . "https://github.com/tumashu/pyim")
+ (:keywords "convenience" "chinese" "pinyin" "input-method")
+ (:maintainer "Feng Shu" . "tumashu@163.com")
+ (:authors
+ ("Ye Wenbin" . "wenbinye@163.com")
+ ("Feng Shu" . "tumashu@163.com"))
+ (:commit . "cd1bfd2bbc10fe0ac47d0ec383cde453f6019e6c"))])
+ (pyim-basedict .
+ [(0 5 0)
+ nil "The default pinyin dict of pyim" tar
+ ((:url . "https://github.com/tumashu/pyim-basedict")
+ (:maintainer "Feng Shu" . "tumashu@163.com")
+ (:authors
+ ("Feng Shu" . "tumashu@163.com"))
+ (:keywords "convenience" "chinese" "pinyin" "input-method" "complete"))])
+ (python .
+ [(0 28)
+ ((emacs
+ (24 4))
+ (cl-lib
+ (1 0)))
+ "Python's flying circus support for Emacs" tar
+ ((:url . "https://github.com/fgallina/python.el")
+ (:keywords "languages")
+ (:maintainer nil . "emacs-devel@gnu.org")
+ (:authors
+ ("Fabián E. Gallina" . "fgallina@gnu.org"))
+ (:commit . "b3d0f53b296a0876ec7a55ae840868e65ed54e14"))])
+ (quarter-plane .
+ [(0 1)
+ nil "Minor mode for quarter-plane style editing" single
+ ((:url . "http://elpa.gnu.org/packages/quarter-plane.html")
+ (:keywords "convenience" "wp")
+ (:authors
+ ("Peter J. Weisberg" . "pj@irregularexpressions.net"))
+ (:maintainer "Peter J. Weisberg" . "pj@irregularexpressions.net"))])
+ (queue .
+ [(0 2)
+ nil "Queue data structure" single
+ ((:keywords "extensions" "data structures" "queue")
+ (:authors
+ ("Inge Wallin" . "inge@lysator.liu.se")
+ ("Toby Cubitt" . "toby-predictive@dr-qubit.org"))
+ (:maintainer "Toby Cubitt" . "toby-predictive@dr-qubit.org")
+ (:url . "http://www.dr-qubit.org/emacs.php"))])
+ (rainbow-mode .
+ [(1 0 6)
+ nil "Colorize color names in buffers" tar
+ ((:keywords "faces")
+ (:maintainer "Julien Danjou" . "julien@danjou.info")
+ (:authors
+ ("Julien Danjou" . "julien@danjou.info"))
+ (:url . "https://elpa.gnu.org/packages/rainbow-mode.html")
+ (:commit . "ac68593018ef3555e64ea592d72334f4e3e39209"))])
+ (rbit .
+ [(0 1)
+ nil "Red-black persistent interval trees" single
+ ((:url . "http://elpa.gnu.org/packages/rbit.html")
+ (:keywords "data structures" "binary tree" "intervals")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (rcirc-color .
+ [(0 4 2)
+ ((emacs
+ (24 4)))
+ "color nicks" tar
+ ((:maintainer "Alex Schroeder" . "alex@gnu.org")
+ (:authors
+ ("Alex Schroeder" . "alex@gnu.org"))
+ (:keywords "comm")
+ (:url . "https://elpa.gnu.org/packages/rcirc-color.html"))])
+ (rcirc-menu .
+ [(1 1)
+ nil "A menu of all your rcirc connections" single
+ ((:url . "http://elpa.gnu.org/packages/rcirc-menu.html")
+ (:keywords "comm")
+ (:authors
+ ("Alex Schroeder" . "alex@gnu.org"))
+ (:maintainer "Alex Schroeder" . "alex@gnu.org"))])
+ (realgud .
+ [(1 5 1)
+ ((load-relative
+ (1 3 1))
+ (loc-changes
+ (1 2))
+ (test-simple
+ (1 3 0))
+ (emacs
+ (25)))
+ "A modular front-end for interacting with external debuggers" tar
+ ((:url . "http://github.com/realgud/realgud/")
+ (:maintainer "Rocky Bernstein" . "rocky@gnu.org")
+ (:authors
+ ("Rocky Bernstein" . "rocky@gnu.org"))
+ (:keywords "debugger" "gdb" "python" "perl" "go" "bash" "zsh" "bashdb" "zshdb" "remake" "trepan" "perldb" "pdb"))])
+ (realgud-ipdb .
+ [(1 0 0)
+ ((realgud
+ (1 5 0))
+ (load-relative
+ (1 3 1))
+ (emacs
+ (25)))
+ "Realgud front-end to ipdb" tar
+ ((:url . "http://github.com/rocky/realgud-ipdb")
+ (:maintainer "Rocky Bernstein" . "rocky@gnu.org")
+ (:authors
+ ("Rocky Bernstein" . "rocky@gnu.org")))])
+ (realgud-jdb .
+ [(1 0 0)
+ ((realgud
+ (1 4 5))
+ (load-relative
+ (1 2))
+ (cl-lib
+ (0 5))
+ (emacs
+ (25)))
+ "Realgud front-end to Java's jdb debugger\"" tar
+ ((:url . "http://github.com/realgud/realgud-jdb")
+ (:maintainer "Rocky Bernstein" . "rocky@gnu.org")
+ (:authors
+ ("Rocky Bernstein" . "rocky@gnu.org")))])
+ (realgud-lldb .
+ [(1 0 2)
+ ((load-relative
+ (1 3 1))
+ (realgud
+ (1 5 0))
+ (emacs
+ (25)))
+ "Realgud front-end to lldb" tar
+ ((:url . "http://github.com/realgud/realgud-lldb")
+ (:maintainer "Rocky Bernstein" . "rocky@gnu.org")
+ (:authors
+ ("Rocky Bernstein" . "rocky@gnu.org")))])
+ (realgud-node-debug .
+ [(1 0 0)
+ ((realgud
+ (1 4 5))
+ (load-relative
+ (1 2))
+ (cl-lib
+ (0 5))
+ (emacs
+ (25)))
+ "Realgud front-end to older \"node debug\"" tar
+ ((:url . "http://github.com/realgud/realgud-node-debug")
+ (:maintainer "Rocky Bernstein" . "rocky@gnu.org")
+ (:authors
+ ("Rocky Bernstein" . "rocky@gnu.org")))])
+ (realgud-node-inspect .
+ [(1 0 0)
+ ((realgud
+ (1 4 5))
+ (load-relative
+ (1 2))
+ (cl-lib
+ (0 5))
+ (emacs
+ (24)))
+ "Realgud front-end to newer \"node inspect\"" tar
+ ((:url . "http://github.com/realgud/realgud-node-inspect")
+ (:maintainer "Rocky Bernstein" . "rocky@gnu.org")
+ (:authors
+ ("Rocky Bernstein" . "rocky@gnu.org")))])
+ (realgud-trepan-ni .
+ [(1 0 1)
+ ((load-relative
+ (1 2))
+ (realgud
+ (1 5 0))
+ (cl-lib
+ (0 5))
+ (emacs
+ (25)))
+ "Realgud front-end to trepan-ni" tar
+ ((:url . "http://github.com/realgud/realgud-trepan-ni")
+ (:maintainer "Rocky Bernstein" . "rocky@gnu.org")
+ (:authors
+ ("Rocky Bernstein" . "rocky@gnu.org")))])
+ (rec-mode .
+ [(1 8 3)
+ ((emacs
+ (25)))
+ "Major mode for viewing/editing rec files" tar
+ ((:url . "https://www.gnu.org/software/recutils/")
+ (:maintainer "Antoine Kalmbach" . "ane@iki.fi")
+ (:authors
+ ("Jose E. Marchesi" . "jemarch@gnu.org"))
+ (:commit . "24adb19f70f682f28d6edac03598b1fee971d599"))])
+ (register-list .
+ [(0 1)
+ nil "Interactively list/edit registers" single
+ ((:url . "http://elpa.gnu.org/packages/register-list.html")
+ (:keywords "register")
+ (:authors
+ ("Bastien Guerry" . "bzg@gnu.org"))
+ (:maintainer "Bastien Guerry" . "bzg@gnu.org"))])
+ (relint .
+ [(1 20)
+ ((xr
+ (1 22))
+ (emacs
+ (26 1)))
+ "Elisp regexp mistake finder" tar
+ ((:url . "https://github.com/mattiase/relint")
+ (:keywords "lisp" "regexps")
+ (:maintainer "Mattias Engdegård" . "mattiase@acm.org")
+ (:authors
+ ("Mattias Engdegård" . "mattiase@acm.org"))
+ (:commit . "5a918af0c99ab83355d4ec73a2fb39e70c173956"))])
+ (repology .
+ [(1 2 3)
+ ((emacs
+ (26 1)))
+ "Repology API access via Elisp" tar
+ ((:keywords "web")
+ (:maintainer "Nicolas Goaziou" . "mail@nicolasgoaziou.fr")
+ (:authors
+ ("Nicolas Goaziou" . "mail@nicolasgoaziou.fr"))
+ (:url . "https://elpa.gnu.org/packages/repology.html")
+ (:commit . "b5829003decbdbe9002e7e1d29f45989a4659927"))])
+ (rich-minority .
+ [(1 0 3)
+ ((cl-lib
+ (0 5)))
+ "Clean-up and Beautify the list of minor-modes." tar
+ ((:url . "https://github.com/Malabarba/rich-minority")
+ (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com")
+ (:authors
+ ("Artur Malabarba" . "emacs@endlessparentheses.com"))
+ (:keywords "mode-line" "faces"))])
+ (rnc-mode .
+ [(0 2)
+ nil "Emacs mode to edit Relax-NG Compact files" single
+ ((:url . "http://elpa.gnu.org/packages/rnc-mode.html")
+ (:keywords "xml" "relaxng")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (rt-liberation .
+ [(5)
+ nil "Emacs interface to RT" tar
+ ((:url . "http://www.nongnu.org/rtliber/")
+ (:keywords "rt" "tickets")
+ (:maintainer "Yoni Rabkin" . "yrk@gnu.org")
+ (:authors
+ ("Yoni Rabkin" . "yrk@gnu.org"))
+ (:commit . "b76ae2828b12efc5f45f51ba873489e049a70924"))])
+ (rudel .
+ [(0 3 2)
+ ((emacs
+ (24))
+ (cl-lib
+ (0 5))
+ (cl-generic
+ (0 3))
+ (cl-print
+ (1 0)))
+ "A collaborative editing framework for Emacs" tar
+ ((:url . "http://rudel.sourceforge.net/")
+ (:maintainer "Jan Moringen" . "scymtym@users.sourceforge.net")
+ (:authors
+ ("Jan Moringen" . "scymtym@users.sourceforge.net"))
+ (:keywords "rudel" "collaboration"))])
+ (satchel .
+ [(0 2)
+ ((emacs
+ (27 2))
+ (project
+ (0 8 1)))
+ "A bag for your files, separated by git branches" tar
+ ((:keywords "tools" "languages")
+ (:maintainer "Theodor Thornhill" . "theo@thornhill.no")
+ (:authors
+ ("Theodor Thornhill" . "theo@thornhill.no"))
+ (:url . "https://elpa.gnu.org/packages/satchel.html")
+ (:commit . "6e5613e203f6937202cb5d55249e7e6be939067b"))])
+ (scanner .
+ [(0 2)
+ ((emacs
+ (25 1))
+ (dash
+ (2 12 0)))
+ "Scan documents and images" tar
+ ((:url . "https://gitlab.com/rstocker/scanner.git")
+ (:maintainer "Raffael Stocker" . "r.stocker@mnet-mail.de")
+ (:authors
+ ("Raffael Stocker" . "r.stocker@mnet-mail.de"))
+ (:keywords "hardware" "multimedia"))])
+ (scroll-restore .
+ [(1 0)
+ nil "restore original position after scrolling" single
+ ((:url . "http://elpa.gnu.org/packages/scroll-restore.html")
+ (:keywords "scrolling")
+ (:authors
+ ("Martin Rudalics" . "rudalics@gmx.at"))
+ (:maintainer "Martin Rudalics" . "rudalics@gmx.at"))])
+ (sed-mode .
+ [(1 0)
+ nil "Major mode to edit sed scripts" single
+ ((:url . "http://elpa.gnu.org/packages/sed-mode.html")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (seq .
+ [(2 23)
+ nil "Sequence manipulation functions" tar
+ ((:keywords "sequences")
+ (:maintainer nil . "emacs-devel@gnu.org")
+ (:authors
+ ("Nicolas Petton" . "nicolas@petton.fr"))
+ (:url . "https://elpa.gnu.org/packages/seq.html"))])
+ (setup .
+ [(1 2 0)
+ ((emacs
+ (26 1)))
+ "Helpful Configuration Macro" tar
+ ((:url . "https://git.sr.ht/~pkal/setup")
+ (:keywords "lisp" "local")
+ (:maintainer "Philip Kaludercic" . "philipk@posteo.net")
+ (:authors
+ ("Philip Kaludercic" . "philipk@posteo.net")))])
+ (shelisp .
+ [(1 0 0)
+ nil "execute elisp in shell" tar
+ ((:keywords "terminals" "lisp" "processes")
+ (:maintainer "Michael R. Mauger" . "michael@mauger.com")
+ (:authors
+ ("Michael R. Mauger" . "michael@mauger.com"))
+ (:url . "https://elpa.gnu.org/packages/shelisp.html"))])
+ (shell-command+ .
+ [(2 3 2)
+ ((emacs
+ (24 1)))
+ "An extended shell-command" tar
+ ((:url . "https://git.sr.ht/~pkal/shell-command-plus")
+ (:keywords "unix" "processes" "convenience")
+ (:maintainer "Philip Kaludercic" . "philipk@posteo.net")
+ (:authors
+ ("Philip Kaludercic" . "philipk@posteo.net")))])
+ (shen-mode .
+ [(0 1)
+ nil "A major mode for editing shen source code" tar
+ ((:maintainer "Eric Schulte" . "schulte.eric@gmail.com")
+ (:authors
+ ("Eric Schulte" . "schulte.eric@gmail.com"))
+ (:keywords "languages" "shen")
+ (:url . "http://elpa.gnu.org/packages/shen-mode.html"))])
+ (sisu-mode .
+ [(7 1 8)
+ nil "Major mode for SiSU markup text" single
+ ((:keywords "text" "syntax" "processes" "tools")
+ (:authors
+ ("Ralph Amissah & Ambrose Kofi Laing"))
+ (:maintainer "Ralph Amissah" . "ralph.amissah@gmail.com")
+ (:url . "http://www.sisudoc.org/"))])
+ (sketch-mode .
+ [(1 0 4)
+ nil "Quickly create svg sketches using keyboard and mouse" tar
+ ((:url . "https://github.com/dalanicolai/sketch-mode")
+ (:keywords "multimedia")
+ (:maintainer "D.L. Nicolai" . "dalanicolai@gmail.com")
+ (:authors
+ ("D.L. Nicolai" . "dalanicolai@gmail.com")))])
+ (slime-volleyball .
+ [(1 2 0)
+ ((cl-lib
+ (0 5)))
+ "An SVG Slime Volleyball Game" tar
+ ((:maintainer "Thomas Fitzsimmons" . "fitzsim@fitzsim.org")
+ (:authors
+ ("Thomas Fitzsimmons" . "fitzsim@fitzsim.org"))
+ (:keywords "games")
+ (:url . "https://elpa.gnu.org/packages/slime-volleyball.html"))])
+ (sm-c-mode .
+ [(1 1)
+ nil "C major mode based on SMIE" single
+ ((:url . "http://elpa.gnu.org/packages/sm-c-mode.html")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (smalltalk-mode .
+ [(4 0)
+ nil "Major mode for the GNU Smalltalk programming language" tar
+ ((:maintainer "Derek Zhou" . "derek@3qin.us")
+ (:authors
+ ("Steve Byrne"))
+ (:url . "https://elpa.gnu.org/packages/smalltalk-mode.html"))])
+ (smart-yank .
+ [(0 1 1)
+ ((emacs
+ (24)))
+ "A different approach of yank pointer handling" single
+ ((:url . "http://elpa.gnu.org/packages/smart-yank.html")
+ (:keywords "convenience")
+ (:authors
+ ("Michael Heerdegen" . "michael_heerdegen@web.de"))
+ (:maintainer "Michael Heerdegen" . "michael_heerdegen@web.de"))])
+ (sml-mode .
+ [(6 10)
+ ((emacs
+ (24 3))
+ (cl-lib
+ (0 5)))
+ "Major mode for editing (Standard) ML" single
+ ((:url . "http://elpa.gnu.org/packages/sml-mode.html")
+ (:keywords "sml")
+ (:authors
+ ("Lars Bo Nielsen")
+ (" Olin Shivers")
+ (" Fritz Knabe (?)")
+ (" Steven Gilmore (?)")
+ (" Matthew Morley" . "mjm@scs.leeds.ac.uk")
+ (" Matthias Blume" . "blume@cs.princeton.edu")
+ (" (Stefan Monnier)" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (so-long .
+ [(1 1 2)
+ ((emacs
+ (24 4)))
+ "Say farewell to performance problems with minified code." tar
+ ((:url . "https://savannah.nongnu.org/projects/so-long")
+ (:keywords "convenience")
+ (:maintainer "Phil Sainty" . "psainty@orcon.net.nz")
+ (:authors
+ ("Phil Sainty" . "psainty@orcon.net.nz"))
+ (:commit . "045a4fe94c18cd36ef297e62a80cdff449af3aa5"))])
+ (soap-client .
+ [(3 2 1)
+ ((emacs
+ (24 1))
+ (cl-lib
+ (0 6 1)))
+ "Access SOAP web services" tar
+ ((:url . "https://github.com/alex-hhh/emacs-soap-client")
+ (:keywords "soap" "web-services" "comm" "hypermedia")
+ (:maintainer "Alexandru Harsanyi" . "AlexHarsanyi@gmail.com")
+ (:authors
+ ("Alexandru Harsanyi" . "AlexHarsanyi@gmail.com"))
+ (:commit . "37eef19fd608ca81acb40f974b8d7bbe7fc27127"))])
+ (sokoban .
+ [(1 4 8)
+ ((emacs
+ (23 1))
+ (cl-lib
+ (0 5)))
+ "Implementation of Sokoban for Emacs." tar
+ ((:maintainer "Dieter Deyke" . "dieter.deyke@gmail.com")
+ (:authors
+ ("Glynn Clements" . "glynn.clements@xemacs.org"))
+ (:keywords "games")
+ (:url . "http://elpa.gnu.org/packages/sokoban.html"))])
+ (sotlisp .
+ [(1 6 2)
+ ((emacs
+ (24 1)))
+ "Write lisp at the speed of thought." single
+ ((:keywords "convenience" "lisp")
+ (:authors
+ ("Artur Malabarba" . "emacs@endlessparentheses.com"))
+ (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com")
+ (:url . "https://github.com/Malabarba/speed-of-thought-lisp"))])
+ (spinner .
+ [(1 7 4)
+ ((emacs
+ (24 3)))
+ "Add spinners and progress-bars to the mode-line for ongoing operations" tar
+ ((:url . "https://github.com/Malabarba/spinner.el")
+ (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com")
+ (:authors
+ ("Artur Malabarba" . "emacs@endlessparentheses.com"))
+ (:keywords "processes" "mode-line"))])
+ (sql-beeline .
+ [(0 1)
+ nil "Beeline support for sql.el" tar
+ ((:keywords "sql" "hive" "beeline" "hiveserver2")
+ (:maintainer "Filipp Gunbin" . "fgunbin@fastmail.fm")
+ (:authors
+ ("Filipp Gunbin" . "fgunbin@fastmail.fm"))
+ (:url . "https://elpa.gnu.org/packages/sql-beeline.html"))])
+ (sql-cassandra .
+ [(0 2 1)
+ ((emacs
+ (29)))
+ "Cassandra support for sql.el" tar
+ ((:keywords "sql" "cassandra" "cql" "cqlsh")
+ (:maintainer "Filipp Gunbin" . "fgunbin@fastmail.fm")
+ (:authors
+ ("Filipp Gunbin" . "fgunbin@fastmail.fm"))
+ (:url . "https://elpa.gnu.org/packages/sql-cassandra.html")
+ (:commit . "2920f8c64e937904087f3636696501fb1cfe7acc"))])
+ (sql-indent .
+ [(1 6)
+ ((cl-lib
+ (0 5)))
+ "Support for indenting code in SQL files." tar
+ ((:url . "https://github.com/alex-hhh/emacs-sql-indent")
+ (:maintainer "Alex Harsanyi" . "AlexHarsanyi@gmail.com")
+ (:authors
+ ("Alex Harsanyi" . "AlexHarsanyi@gmail.com"))
+ (:keywords "languages" "sql"))])
+ (ssh-deploy .
+ [(3 1 13)
+ ((emacs
+ (25)))
+ "Deployment via Tramp, global or per directory." tar
+ ((:url . "https://github.com/cjohansson/emacs-ssh-deploy")
+ (:maintainer "Christian Johansson" . "christian@cvj.se")
+ (:authors
+ ("Christian Johansson" . "christian@cvj.se"))
+ (:keywords "tools" "convenience"))])
+ (stream .
+ [(2 2 5)
+ ((emacs
+ (25)))
+ "Implementation of streams" tar
+ ((:maintainer nil . "nicolas@petton.fr")
+ (:authors
+ ("Nicolas Petton" . "nicolas@petton.fr"))
+ (:keywords "stream" "laziness" "sequences")
+ (:url . "http://elpa.gnu.org/packages/stream.html"))])
+ (svg .
+ [(1 1)
+ ((emacs
+ (25)))
+ "SVG image creation functions" single
+ ((:url . "http://elpa.gnu.org/packages/svg.html")
+ (:keywords "image")
+ (:authors
+ ("Lars Magne Ingebrigtsen" . "larsi@gnus.org")
+ ("Felix E. Klee" . "felix.klee@inka.de"))
+ (:maintainer "Lars Magne Ingebrigtsen" . "larsi@gnus.org"))])
+ (svg-clock .
+ [(1 2)
+ ((svg
+ (1 0))
+ (emacs
+ (27 0)))
+ "Analog clock using Scalable Vector Graphics" single
+ ((:url . "http://elpa.gnu.org/packages/svg-clock.html")
+ (:keywords "demo" "svg" "clock")
+ (:authors
+ ("Ulf Jasper" . "ulf.jasper@web.de"))
+ (:maintainer "Ulf Jasper" . "ulf.jasper@web.de"))])
+ (svg-lib .
+ [(0 2 5)
+ ((emacs
+ (27 1)))
+ "SVG tags, progress bars & icons" tar
+ ((:url . "https://github.com/rougier/svg-lib")
+ (:keywords "svg" "icons" "tags" "convenience")
+ (:maintainer "Nicolas P. Rougier" . "Nicolas.Rougier@inria.fr")
+ (:commit . "0486c9453449771bc3f5872f70bc5cb23580d0f4"))])
+ (svg-tag-mode .
+ [(0 3 2)
+ ((emacs
+ (27 1))
+ (svg-lib
+ (0 2)))
+ "Replace keywords with SVG tags" tar
+ ((:url . "https://github.com/rougier/svg-tag-mode")
+ (:keywords "convenience")
+ (:maintainer "Nicolas P. Rougier" . "Nicolas.Rougier@inria.fr")
+ (:authors
+ ("Nicolas P. Rougier" . "Nicolas.Rougier@inria.fr")))])
+ (swiper .
+ [(0 13 4)
+ ((emacs
+ (24 5))
+ (ivy
+ (0 13 4)))
+ "Isearch with an overview. Oh, man!" tar
+ ((:url . "https://github.com/abo-abo/swiper")
+ (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com")
+ (:authors
+ ("Oleh Krehel" . "ohwoeowho@gmail.com"))
+ (:keywords "matching"))])
+ (system-packages .
+ [(1 0 11)
+ ((emacs
+ (24 3)))
+ "functions to manage system packages" tar
+ ((:url . "https://gitlab.com/jabranham/system-packages")
+ (:maintainer "J. Alexander Branham" . "alex.branham@gmail.com")
+ (:authors
+ ("J. Alexander Branham" . "alex.branham@gmail.com")))])
+ (tNFA .
+ [(0 1 1)
+ ((queue
+ (0 1)))
+ "Tagged non-deterministic finite-state automata" single
+ ((:keywords "extensions" "matching" "data structures tnfa" "nfa" "dfa" "finite state automata" "automata" "regexp")
+ (:authors
+ ("Toby Cubitt" . "toby-predictive@dr-qubit.org"))
+ (:maintainer "Toby Cubitt" . "toby-predictive@dr-qubit.org")
+ (:url . "http://www.dr-qubit.org/emacs.php"))])
+ (taxy .
+ [(0 9)
+ ((emacs
+ (26 3)))
+ "Programmable taxonomical grouping for arbitrary objects" tar
+ ((:url . "https://github.com/alphapapa/taxy.el")
+ (:keywords "lisp")
+ (:maintainer "Adam Porter" . "adam@alphapapa.net")
+ (:authors
+ ("Adam Porter" . "adam@alphapapa.net"))
+ (:commit . "b209692b632bbe8d7f97ea8a39b0c28c1be3b7ec"))])
+ (taxy-magit-section .
+ [(0 9 1)
+ ((emacs
+ (26 3))
+ (magit-section
+ (3 2 1)))
+ "View Taxy structs in a Magit Section buffer" tar
+ ((:url . "https://github.com/alphapapa/taxy.el")
+ (:keywords "lisp")
+ (:maintainer "Adam Porter" . "adam@alphapapa.net")
+ (:authors
+ ("Adam Porter" . "adam@alphapapa.net"))
+ (:commit . "62624c32d7f58bfa4acc89becc7cc8427d546aab"))])
+ (temp-buffer-browse .
+ [(1 5)
+ ((emacs
+ (24)))
+ "temp buffer browse mode" single
+ ((:url . "http://elpa.gnu.org/packages/temp-buffer-browse.html")
+ (:keywords "convenience")
+ (:authors
+ ("Leo Liu" . "sdl.web@gmail.com"))
+ (:maintainer "Leo Liu" . "sdl.web@gmail.com"))])
+ (tempel .
+ [(0 3)
+ ((emacs
+ (27 1)))
+ "Tempo templates/snippets with in-buffer field editing" tar
+ ((:url . "https://github.com/minad/tempel")
+ (:maintainer "Daniel Mendler" . "mail@daniel-mendler.de")
+ (:authors
+ ("Daniel Mendler" . "mail@daniel-mendler.de"))
+ (:commit . "ee964c24b69579fcd5ec3c7d3d1d84d1ca3d90e4"))])
+ (test-simple .
+ [(1 3 0)
+ ((cl-lib
+ (0)))
+ "Simple Unit Test Framework for Emacs Lisp" single
+ ((:keywords "unit-test")
+ (:authors
+ ("Rocky Bernstein" . "rocky@gnu.org"))
+ (:maintainer "Rocky Bernstein" . "rocky@gnu.org")
+ (:url . "http://github.com/rocky/emacs-test-simple"))])
+ (timerfunctions .
+ [(1 4 2)
+ ((cl-lib
+ (0 5))
+ (emacs
+ (24)))
+ "Enhanced versions of some timer.el functions" single
+ ((:url . "http://elpa.gnu.org/packages/timerfunctions.html")
+ (:authors
+ ("Dave Goel" . "deego3@gmail.com"))
+ (:maintainer "Dave Goel" . "deego3@gmail.com"))])
+ (tiny .
+ [(0 2 1)
+ nil "Quickly generate linear ranges in Emacs" tar
+ ((:url . "https://github.com/abo-abo/tiny")
+ (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com")
+ (:authors
+ ("Oleh Krehel" . "ohwoeowho@gmail.com"))
+ (:keywords "convenience"))])
+ (tmr .
+ [(0 2 3)
+ ((emacs
+ (27 1)))
+ "Set timers using a convenient notation" tar
+ ((:url . "https://git.sr.ht/~protesilaos/tmr")
+ (:keywords "convenience" "timer")
+ (:maintainer "Protesilaos Stavrou" . "info@protesilaos.com")
+ (:authors
+ ("Protesilaos Stavrou" . "info@protesilaos.com"))
+ (:commit . "7157ec61c451e3b97ba6117688d0de52bf294bea"))])
+ (tomelr .
+ [(0 3 0)
+ ((emacs
+ (26 3))
+ (map
+ (3 2 1))
+ (seq
+ (2 23)))
+ "Convert S-expressions to TOML" tar
+ ((:url . "https://github.com/kaushalmodi/tomelr/")
+ (:keywords "data" "tools" "toml" "serialization" "config")
+ (:maintainer "Kaushal Modi" . "kaushal.modi@gmail.com")
+ (:authors
+ ("Kaushal Modi" . "kaushal.modi@gmail.com"))
+ (:commit . "ede27810243a3bf0872d4d30bb02a51ba9e8166f"))])
+ (tramp .
+ [(2 5 2 4)
+ ((emacs
+ (25 1)))
+ "Transparent Remote Access, Multiple Protocol" tar
+ ((:url . "https://www.gnu.org/software/tramp/")
+ (:keywords "comm" "processes")
+ (:maintainer "Michael Albinus" . "michael.albinus@gmx.de")
+ (:authors
+ ("Kai Großjohann" . "kai.grossjohann@gmx.net"))
+ (:commit . "8f2578d043d2d633c20a74a8b836920b7d0a3fa0"))])
+ (tramp-nspawn .
+ [(1 0)
+ ((emacs
+ (23)))
+ "Tramp integration for systemd-nspawn containers" tar
+ ((:url . "https://github.com/bjc/tramp-nspawn")
+ (:keywords "tramp" "nspawn" "machinectl" "systemd" "systemd-nspawn")
+ (:maintainer "Brian Cully" . "bjc@kublai.com")
+ (:authors
+ ("Brian Cully" . "bjc@kublai.com"))
+ (:commit . "b8380ee8a7c15ad4b96963d224969fc1a0337180"))])
+ (tramp-theme .
+ [(0 2)
+ ((emacs
+ (24 1)))
+ "Custom theme for remote buffers" single
+ ((:url . "http://elpa.gnu.org/packages/tramp-theme.html")
+ (:keywords "convenience" "faces")
+ (:authors
+ ("Michael Albinus" . "michael.albinus@gmx.de"))
+ (:maintainer "Michael Albinus" . "michael.albinus@gmx.de"))])
+ (transcribe .
+ [(1 5 2)
+ nil "Package for audio transcriptions" single
+ ((:url . "http://elpa.gnu.org/packages/transcribe.html")
+ (:authors
+ ("David Gonzalez Gandara" . "dggandara@member.fsf.org"))
+ (:maintainer "David Gonzalez Gandara" . "dggandara@member.fsf.org"))])
+ (transient .
+ [(0 3 7)
+ ((emacs
+ (25 1)))
+ "Transient commands" tar
+ ((:url . "https://github.com/magit/transient")
+ (:keywords "bindings")
+ (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li")
+ (:authors
+ ("Jonas Bernoulli" . "jonas@bernoul.li")))])
+ (transient-cycles .
+ [(1 0)
+ ((emacs
+ (27 1)))
+ "Define command variants with transient cycling" tar
+ ((:url . "https://git.spwhitton.name/dotfiles/tree/.emacs.d/site-lisp/transient-cycles.el")
+ (:keywords "buffer" "window" "minor-mode" "convenience")
+ (:maintainer "Sean Whitton" . "spwhitton@spwhitton.name")
+ (:authors
+ ("Sean Whitton" . "spwhitton@spwhitton.name"))
+ (:commit . "a5b86dd04e84e7ff1cf8c4062843fccb92991145"))])
+ (trie .
+ [(0 5)
+ ((tNFA
+ (0 1 1))
+ (heap
+ (0 3)))
+ "Trie data structure" tar
+ ((:url . "http://www.dr-qubit.org/emacs.php")
+ (:maintainer "Toby Cubitt" . "toby-predictive@dr-qubit.org")
+ (:authors
+ ("Toby Cubitt" . "toby-predictive@dr-qubit.org"))
+ (:keywords "extensions" "matching" "data structures trie" "ternary search tree" "tree" "completion" "regexp"))])
+ (undo-tree .
+ [(0 8 2)
+ ((queue
+ (0 2))
+ (emacs
+ (24 3)))
+ "Treat undo history as a tree" tar
+ ((:url . "https://www.dr-qubit.org/undo-tree.html")
+ (:keywords "convenience" "files" "undo" "redo" "history" "tree")
+ (:maintainer "Toby Cubitt" . "toby+undo-tree@dr-qubit.org")
+ (:authors
+ ("Toby Cubitt" . "toby+undo-tree@dr-qubit.org"))
+ (:commit . "42aab056e37e033816b2d192f9121b89410b958e"))])
+ (uni-confusables .
+ [(0 3)
+ nil "Unicode confusables table" tar
+ ((:maintainer "Teodor Zlatanov" . "tzz@lifelogs.com")
+ (:url . "https://elpa.gnu.org/packages/uni-confusables.html")
+ (:commit . "393e1adeec5b0eb51f9606983655cfe2272c6e54"))])
+ (uniquify-files .
+ [(1 0 3)
+ ((emacs
+ (25 0)))
+ "Completion style for files, minimizing directories" tar
+ ((:keywords "completion" "table" "uniquify")
+ (:maintainer "Stephen Leake" . "stephen_leake@stephe-leake.org")
+ (:authors
+ ("Stephen Leake" . "stephen_leake@stephe-leake.org"))
+ (:url . "https://elpa.gnu.org/packages/uniquify-files.html"))])
+ (url-http-ntlm .
+ [(2 0 4)
+ ((cl-lib
+ (0 5))
+ (ntlm
+ (2 1 0)))
+ "NTLM authentication for the url library" single
+ ((:keywords "comm" "data" "processes" "hypermedia")
+ (:authors
+ ("Tom Schutzer-Weissmann" . "tom.weissmann@gmail.com"))
+ (:maintainer "Thomas Fitzsimmons" . "fitzsim@fitzsim.org")
+ (:url . "https://code.google.com/p/url-http-ntlm/"))])
+ (validate .
+ [(1 0 4)
+ ((emacs
+ (24 1))
+ (cl-lib
+ (0 5))
+ (seq
+ (2 16)))
+ "Schema validation for Emacs-lisp" single
+ ((:url . "http://elpa.gnu.org/packages/validate.html")
+ (:keywords "lisp")
+ (:authors
+ ("Artur Malabarba" . "emacs@endlessparentheses.com"))
+ (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com"))])
+ (valign .
+ [(3 1 1)
+ ((emacs
+ (26 0)))
+ "Visually align tables" tar
+ ((:url . "https://github.com/casouri/valign")
+ (:maintainer "Yuan Fu" . "casouri@gmail.com")
+ (:authors
+ ("Yuan Fu" . "casouri@gmail.com"))
+ (:keywords "convenience" "text" "table"))])
+ (vc-backup .
+ [(1 1 0)
+ nil "VC backend for versioned backups" tar
+ ((:url . "https://git.sr.ht/~pkal/vc-backup")
+ (:keywords "vc")
+ (:maintainer "Philip Kaludercic" . "philipk@posteo.net")
+ (:authors
+ ("Philip Kaludercic" . "philipk@posteo.net")))])
+ (vc-got .
+ [(1 1)
+ ((emacs
+ (25 1)))
+ "VC backend for Game of Trees VCS" tar
+ ((:url . "https://git.omarpolo.com/vc-got/")
+ (:keywords "vc" "tools")
+ (:maintainer "Omar Polo" . "op@omarpolo.com")
+ (:authors
+ ("Omar Polo" . "op@omarpolo.com")
+ ("Timo Myyrä" . "timo.myyra@bittivirhe.fi"))
+ (:commit . "86d9909a7e54c02179e40afd05693c00f6689edc"))])
+ (vc-hgcmd .
+ [(1 14 1)
+ ((emacs
+ (25 1)))
+ "VC mercurial backend that uses hg command server" tar
+ ((:url . "https://github.com/muffinmad/emacs-vc-hgcmd")
+ (:keywords "vc")
+ (:maintainer "Andrii Kolomoiets" . "andreyk.mad@gmail.com")
+ (:authors
+ ("Andrii Kolomoiets" . "andreyk.mad@gmail.com")))])
+ (vcard .
+ [(0 2 1)
+ ((emacs
+ (27 1)))
+ "Package for handling vCard files" tar
+ ((:maintainer "Eric Abrahamsen" . "eric@ericabrahamsen.net")
+ (:authors
+ ("Eric Abrahamsen" . "eric@ericabrahamsen.net"))
+ (:url . "https://elpa.gnu.org/packages/vcard.html"))])
+ (vcl-mode .
+ [(1 1)
+ nil "Major mode for Varnish Configuration Language" single
+ ((:url . "http://elpa.gnu.org/packages/vcl-mode.html")
+ (:keywords "varnish" "vcl")
+ (:authors
+ ("Sergey Poznyakoff" . "gray@gnu.org.ua"))
+ (:maintainer "Sergey Poznyakoff" . "gray@gnu.org.ua"))])
+ (vdiff .
+ [(0 2 4)
+ ((emacs
+ (24 4))
+ (hydra
+ (0 13 0)))
+ "A diff tool similar to vimdiff" tar
+ ((:url . "https://github.com/justbur/emacs-vdiff")
+ (:maintainer "Justin Burkett" . "justin@burkett.cc")
+ (:authors
+ ("Justin Burkett" . "justin@burkett.cc"))
+ (:keywords "diff"))])
+ (verilog-mode .
+ [(2021 10 14 127365406)
+ nil "major mode for editing verilog source in Emacs" tar
+ ((:url . "https://www.veripool.org")
+ (:keywords "languages")
+ (:maintainer "Michael McNamara" . "mac@verilog.com")
+ (:authors
+ ("Michael McNamara" . "mac@verilog.com")
+ ("Wilson Snyder" . "wsnyder@wsnyder.org"))
+ (:commit . "86f08fb377e2b8f2df0614c48783bdce347f3758"))])
+ (vertico .
+ [(0 23)
+ ((emacs
+ (27 1)))
+ "VERTical Interactive COmpletion" tar
+ ((:url . "https://github.com/minad/vertico")
+ (:maintainer "Daniel Mendler" . "mail@daniel-mendler.de")
+ (:authors
+ ("Daniel Mendler" . "mail@daniel-mendler.de"))
+ (:commit . "68bb4d67e295bd75b8ef1a6d5ddda26849510fa6"))])
+ (vertico-posframe .
+ [(0 5 4)
+ ((emacs
+ (26 0))
+ (posframe
+ (1 1 4))
+ (vertico
+ (0 13 0)))
+ "Using posframe to show Vertico" tar
+ ((:url . "https://github.com/tumashu/vertico-posframe")
+ (:keywords "abbrev" "convenience" "matching" "vertico")
+ (:maintainer "Feng Shu" . "tumashu@163.com")
+ (:authors
+ ("Feng Shu" . "tumashu@163.com"))
+ (:commit . "7ca364d319e7ba8ccba26a0d57513f3e66f1b05b"))])
+ (vigenere .
+ [(1 0)
+ ((emacs
+ (25 1)))
+ "Run a vigenere cipher on a block of text ;" single
+ ((:keywords "data" "vigenere" "cipher")
+ (:authors
+ ("Ian Dunn" . "dunni@gnu.org"))
+ (:maintainer "Ian Dunn" . "dunni@gnu.org")
+ (:url . "https://elpa.gnu.org/packages/vigenere.html"))])
+ (visual-filename-abbrev .
+ [(1 1)
+ ((emacs
+ (26 1)))
+ "Visually abbreviate filenames" tar
+ ((:maintainer "Tassilo Horn" . "tsdh@gnu.org")
+ (:authors
+ ("Tassilo Horn" . "tsdh@gnu.org"))
+ (:keywords "tools")
+ (:url . "https://elpa.gnu.org/packages/visual-filename-abbrev.html"))])
+ (visual-fill .
+ [(0 1)
+ nil "Auto-refill paragraphs without modifying the buffer" single
+ ((:url . "http://elpa.gnu.org/packages/visual-fill.html")
+ (:authors
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:maintainer "Stefan Monnier" . "monnier@iro.umontreal.ca"))])
+ (vlf .
+ [(1 7 2)
+ nil "View Large Files" tar
+ ((:url . "https://github.com/m00natic/vlfi")
+ (:maintainer "Andrey Kotlarski" . "m00naticus@gmail.com")
+ (:keywords "large files" "utilities"))])
+ (vundo .
+ [(2 0 0)
+ ((emacs
+ (28 1)))
+ "Visual undo tree" tar
+ ((:url . "https://github.com/casouri/vundo")
+ (:keywords "undo" "text" "editing")
+ (:maintainer "Yuan Fu" . "casouri@gmail.com")
+ (:authors
+ ("Yuan Fu" . "casouri@gmail.com"))
+ (:commit . "10d5debe317b2244d19085151040f955dda4a9ab"))])
+ (wcheck-mode .
+ [(2021)
+ nil "General interface for text checkers" tar
+ ((:url . "https://github.com/tlikonen/wcheck-mode")
+ (:keywords "text" "spell" "check" "languages" "ispell")
+ (:maintainer "Teemu Likonen" . "tlikonen@iki.fi")
+ (:authors
+ ("Teemu Likonen" . "tlikonen@iki.fi")))])
+ (wconf .
+ [(0 2 1)
+ ((emacs
+ (24 4)))
+ "Minimal window layout manager" single
+ ((:keywords "windows" "frames" "layout")
+ (:authors
+ ("Ingo Lohmar" . "i.lohmar@gmail.com"))
+ (:maintainer "Ingo Lohmar" . "i.lohmar@gmail.com")
+ (:url . "https://github.com/ilohmar/wconf"))])
+ (web-server .
+ [(0 1 2)
+ ((emacs
+ (24 3)))
+ "Emacs Web Server" tar
+ ((:url . "https://github.com/eschulte/emacs-web-server")
+ (:maintainer "Eric Schulte" . "schulte.eric@gmail.com")
+ (:authors
+ ("Eric Schulte" . "schulte.eric@gmail.com"))
+ (:keywords "http" "server" "network"))])
+ (webfeeder .
+ [(1 1 2)
+ ((emacs
+ (25 1)))
+ "Build RSS and Atom webfeeds from HTML files" tar
+ ((:url . "https://gitlab.com/Ambrevar/emacs-webfeeder")
+ (:maintainer "Pierre Neidhardt" . "mail@ambrevar.xyz")
+ (:authors
+ ("Pierre Neidhardt" . "mail@ambrevar.xyz"))
+ (:keywords "news" "hypermedia" "blog" "feed" "rss" "atom"))])
+ (websocket .
+ [(1 13 1)
+ ((cl-lib
+ (0 5)))
+ "Emacs WebSocket client and server" tar
+ ((:url . "https://github.com/ahyatt/emacs-websocket")
+ (:maintainer "Andrew Hyatt" . "ahyatt@gmail.com")
+ (:authors
+ ("Andrew Hyatt" . "ahyatt@gmail.com"))
+ (:keywords "communication" "websocket" "server"))])
+ (which-key .
+ [(3 6 0)
+ ((emacs
+ (24 4)))
+ "Display available keybindings in popup" tar
+ ((:url . "https://github.com/justbur/emacs-which-key")
+ (:maintainer "Justin Burkett" . "justin@burkett.cc")
+ (:authors
+ ("Justin Burkett" . "justin@burkett.cc"))
+ (:commit . "1217db8c6356659e67b35dedd9f5f260c06f6e99"))])
+ (windower .
+ [(0 0 1)
+ ((emacs
+ (25)))
+ "Helper functions for window manipulation." single
+ ((:keywords "convenience" "tools")
+ (:authors
+ ("Pierre Neidhardt" . "mail@ambrevar.xyz"))
+ (:maintainer "Pierre Neidhardt" . "mail@ambrevar.xyz")
+ (:url . "https://gitlab.com/ambrevar/windower"))])
+ (windresize .
+ [(0 1)
+ nil "Resize windows interactively" single
+ ((:url . "http://elpa.gnu.org/packages/windresize.html")
+ (:keywords "window")
+ (:authors
+ ("Bastien" . "bzg@gnu.org"))
+ (:maintainer "Bastien" . "bzg@gnu.org"))])
+ (wisi .
+ [(3 1 7)
+ ((emacs
+ (25 3))
+ (seq
+ (2 20)))
+ "Utilities for implementing an indentation/navigation engine using a generalized LALR parser" tar
+ ((:url . "http://stephe-leake.org/ada/wisitoken.html")
+ (:keywords "parser" "indentation" "navigation")
+ (:maintainer "Stephen Leake" . "stephen_leake@stephe-leake.org")
+ (:authors
+ ("Stephen Leake" . "stephen_leake@stephe-leake.org")))])
+ (wisitoken-grammar-mode .
+ [(1 2 0)
+ ((wisi
+ (3 1 1))
+ (emacs
+ (25 0))
+ (mmm-mode
+ (0 5 7)))
+ "Major mode for editing WisiToken grammar files" tar
+ ((:url . "http://www.nongnu.org/ada-mode/")
+ (:maintainer "Stephen Leake" . "stephen_leake@stephe-leake.org")
+ (:authors
+ ("Stephen Leake" . "stephen_leake@stephe-leake.org"))
+ (:keywords "languages"))])
+ (wpuzzle .
+ [(1 1)
+ nil "find as many word in a given time" single
+ ((:url . "http://elpa.gnu.org/packages/wpuzzle.html")
+ (:authors
+ ("Ivan Kanis" . "ivan@kanis.fr"))
+ (:maintainer "Ivan Kanis" . "ivan@kanis.fr"))])
+ (xclip .
+ [(1 11)
+ nil "Copy&paste GUI clipboard from text terminal" tar
+ ((:keywords "convenience" "tools")
+ (:maintainer "Leo Liu" . "sdl.web@gmail.com")
+ (:authors
+ ("Leo Liu" . "sdl.web@gmail.com"))
+ (:url . "https://elpa.gnu.org/packages/xclip.html")
+ (:commit . "5b54645cab438e133e27b4690c57066f8271a992"))])
+ (xelb .
+ [(0 18)
+ ((emacs
+ (24 4))
+ (cl-generic
+ (0 2)))
+ "X protocol Emacs Lisp Binding" tar
+ ((:url . "https://github.com/ch11ng/xelb")
+ (:maintainer "Chris Feng" . "chris.w.feng@gmail.com")
+ (:authors
+ ("Chris Feng" . "chris.w.feng@gmail.com"))
+ (:keywords "unix"))])
+ (xpm .
+ [(1 0 5)
+ ((cl-lib
+ (0 5))
+ (queue
+ (0 2)))
+ "edit XPM images" tar
+ ((:url . "https://www.gnuvola.org/software/xpm/")
+ (:keywords "multimedia" "xpm")
+ (:maintainer "Thien-Thi Nguyen" . "ttn@gnu.org")
+ (:authors
+ ("Thien-Thi Nguyen" . "ttn@gnu.org")))])
+ (xr .
+ [(1 22)
+ ((emacs
+ (26 1)))
+ "Convert string regexp to rx notation" tar
+ ((:url . "https://github.com/mattiase/xr")
+ (:keywords "lisp" "regexps")
+ (:maintainer "Mattias Engdegård" . "mattiase@acm.org")
+ (:authors
+ ("Mattias Engdegård" . "mattiase@acm.org"))
+ (:commit . "a873bbbe9cdf1abab63fc94730966f5a8f9adaa6"))])
+ (xref .
+ [(1 4 1)
+ ((emacs
+ (26 1)))
+ "Cross-referencing commands" tar
+ ((:url . "https://elpa.gnu.org/packages/xref.html")
+ (:commit . "890b08e41580a716c2f0b3f1a40ef9b52a19372c"))])
+ (yasnippet .
+ [(0 14 0)
+ ((cl-lib
+ (0 5)))
+ "Yet another snippet extension for Emacs" tar
+ ((:url . "http://github.com/joaotavora/yasnippet")
+ (:maintainer "Noam Postavsky" . "npostavs@gmail.com")
+ (:keywords "convenience" "emulation"))])
+ (yasnippet-classic-snippets .
+ [(1 0 2)
+ ((yasnippet
+ (0 9 1)))
+ "\"Classic\" yasnippet snippets" tar
+ ((:maintainer "Noam Postavsky" . "npostavs@gmail.com")
+ (:keywords "snippets")
+ (:url . "http://elpa.gnu.org/packages/yasnippet-classic-snippets.html"))])
+ (zones .
+ [(2019 7 13)
+ nil "Zones of text - like multiple regions" single
+ ((:keywords "narrow" "restriction" "widen" "region" "zone")
+ (:authors
+ ("Drew Adams"))
+ (:maintainer "Drew Adams" . "drew.adams@oracle.com")
+ (:url . "https://elpa.gnu.org/packages/zones.html"))])
+ (ztree .
+ [(1 0 6)
+ ((cl-lib
+ (0)))
+ "Text mode directory tree" tar
+ ((:url . "https://github.com/fourier/ztree")
+ (:maintainer "Alexey Veretennikov" . "alexey.veretennikov@gmail.com")
+ (:authors
+ ("Alexey Veretennikov" . "alexey.veretennikov@gmail.com"))
+ (:keywords "files" "tools"))]))
diff --git a/elpa/archives/gnu/archive-contents.signed b/elpa/archives/gnu/archive-contents.signed
new file mode 100644
index 0000000..2667276
--- /dev/null
+++ b/elpa/archives/gnu/archive-contents.signed
@@ -0,0 +1 @@
+Good signature from 066DAFCB81E42C40 GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org> (trust undefined) created at 2022-05-09T17:05:03-0400 using RSA \ No newline at end of file
diff --git a/elpa/archives/melpa/archive-contents b/elpa/archives/melpa/archive-contents
new file mode 100644
index 0000000..1db4d99
--- /dev/null
+++ b/elpa/archives/melpa/archive-contents
@@ -0,0 +1,5184 @@
+(1
+ (0blayout . [(20190703 527) nil "Layout grouping with ease" single ((:commit . "fd9a8f353dbd45b4628b5f84b8d8c2525ebf571d") (:authors ("Elis \"etu\" Axelsson")) (:maintainer "Elis \"etu\" Axelsson") (:keywords "convenience" "window-management") (:url . "https://github.com/etu/0blayout"))])
+ (0x0 . [(20210701 839) ((emacs (26 1))) "Upload sharing to 0x0.st" single ((:commit . "63cd5eccc85e527f28e1acc89502a53245000428") (:authors ("William Vaughn <https://gitlab.com/willvaughn>")) (:maintainer "William Vaughn" . "vaughnwilld@gmail.com") (:url . "https://gitlab.com/willvaughn/emacs-0x0"))])
+ (0xc . [(20201025 2105) ((emacs (24 4)) (s (1 11 0))) "Base conversion made easy" tar ((:commit . "eec4fb10b9288c0852f751cfb05d638664fa2411") (:authors ("Adam Niederer" . "adam.niederer@gmail.com")) (:maintainer "Adam Niederer" . "adam.niederer@gmail.com") (:keywords "base" "conversion") (:url . "http://github.com/AdamNiederer/0xc"))])
+ (2048-game . [(20200417 259) nil "play 2048 in Emacs" single ((:commit . "aad4a590ea91f9a3256233b9b345e9159c6993f2") (:authors ("Zachary Kanfer" . "zkanfer@gmail.com")) (:maintainer "Zachary Kanfer" . "zkanfer@gmail.com") (:url . "https://hg.sr.ht/~zck/game-2048"))])
+ (2bit . [(20200926 1418) ((emacs (24 3))) "Library for reading data from 2bit files" single ((:commit . "69b4ec1d6d2ad95c9e59dacb43224abbec7a8989") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "files" "data") (:url . "https://github.com/davep/2bit.el"))])
+ (4clojure . [(20210102 459) ((request (0 2 0))) "Open and evaluate 4clojure.com questions." single ((:commit . "6f494d3905284ccdd57aae3d8ac16fc7ab431596") (:authors ("Joshua Hoff")) (:maintainer "Sasha Kovar" . "sasha-git@arcocene.org") (:keywords "languages" "data") (:url . "https://github.com/abend/4clojure.el"))])
+ (750words . [(20210701 1950) ((emacs (24 4))) "Emacs integration and Org exporter for 750words.com" single ((:commit . "0fed7621c04debad64ea6455455494d4e6eb03fa") (:authors ("Diego Zamboni <https://github.com/zzamboni>")) (:maintainer "Diego Zamboni" . "diego@zzamboni.org") (:keywords "files" "org" "writing") (:url . "https://github.com/zzamboni/750words-client"))])
+ (@ . [(20181225 1438) ((emacs (24 3))) "multiple-inheritance prototype-based objects DSL" tar ((:commit . "0a6189f8be42dbbc5d9358cbd447d471236135a2") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/at-el"))])
+ (a . [(20210929 1510) ((emacs (25))) "Associative data structure functions" single ((:commit . "93e5ed8c495794d1ba3c04b43041b95ce01079b1") (:authors ("Arne Brasseur" . "arne@arnebrasseur.net")) (:maintainer "Arne Brasseur" . "arne@arnebrasseur.net") (:keywords "lisp") (:url . "https://github.com/plexus/a.el"))])
+ (aa-edit-mode . [(20170119 320) ((emacs (24 3)) (navi2ch (2 0 0))) "Major mode for editing AA(S_JIS Art) and .mlt file" single ((:commit . "1dd801225b7ad3c23ad09698f5e77f0df7012a65") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "wp" "text" "shiftjis" "mlt" "yaruo"))])
+ (aas . [(20220426 2058) ((emacs (26 3))) "Snippet expansions mid-typing" single ((:commit . "566944e3b336c29d3ac11cd739a954c9d112f3fb") (:authors ("Yoav Marco" . "yoavm448@gmail.com")) (:maintainer "Yoav Marco" . "yoavm448@gmail.com") (:keywords "abbrev" "tools") (:url . "https://github.com/ymarco/auto-activating-snippets"))])
+ (abc-mode . [(20210508 1552) nil "Major mode for editing abc music files" single ((:commit . "80fa954787b57d14e21e19bd65e52abab1686f4a") (:authors ("Matthew K. Junker" . "junker@alum.mit.edu")) (:maintainer "Matthew K. Junker" . "junker@alum.mit.edu") (:keywords "local" "docs"))])
+ (abgaben . [(20171119 646) ((pdf-tools (0 80)) (f (0 19 0)) (s (1 11 0))) "review and correct assignments received by mail" single ((:commit . "20d14830f07d66e2a04bcad1498a4a6fbf4b4451") (:authors ("Arne Köhn" . "arne@chark.eu")) (:maintainer "Arne Köhn" . "arne@chark.eu") (:keywords "mail" "outlines" "convenience") (:url . "http://arne.chark.eu/"))])
+ (abl-mode . [(20210923 950) nil "Python TDD minor mode" single ((:commit . "0d6aace2ffd184137618a0c6e7f29826cbd8d1f9") (:authors ("Ulas Tuerkmen <ulas.tuerkmen at gmail dot com>")) (:maintainer "Ulas Tuerkmen <ulas.tuerkmen at gmail dot com>") (:url . "http://github.com/afroisalreadyinu/abl-mode"))])
+ (abridge-diff . [(20220419 2358) ((emacs (26 1))) "Abridge long line-based diff hunks, including in magit" single ((:commit . "996d921da0a0ee651b3486c2afe29447f48be50f") (:authors ("J.D. Smith <jdtsmith AT gmail>")) (:maintainer "J.D. Smith <jdtsmith AT gmail>") (:keywords "magit" "diffs" "tools") (:url . "https://github.com/jdtsmith/abridge-diff"))])
+ (abs-mode . [(20220316 921) ((emacs (26 1)) (erlang (2 8)) (maude-mode (0 3)) (flymake (1 0))) "Major mode for the modeling language Abs" single ((:commit . "d860ddbbd7cb93c7a77980c78c1a2a7634ef01e1") (:authors ("Rudi Schlatte" . "rudi@constantly.at")) (:maintainer "Rudi Schlatte" . "rudi@constantly.at") (:keywords "languages") (:url . "https://github.com/abstools/abs-mode"))])
+ (abyss-theme . [(20170808 1345) ((emacs (24))) "A dark theme with contrasting colours." single ((:commit . "18791c6e8d9cc2b4815c9f08627a2e94fc0eeb14") (:authors ("Matt Russell" . "matt@mgrbyte.co.uk")) (:maintainer "Matt Russell" . "matt@mgrbyte.co.uk") (:keywords "theme" "dark" "contrasting colours") (:url . "https://github.com/mgrbyte/emacs-abyss-theme"))])
+ (ac-alchemist . [(20150908 656) ((auto-complete (1 5 0)) (alchemist (1 5 0)) (cl-lib (0 5))) "auto-complete source for alchemist" single ((:commit . "b1891c3d41aed83f61d78a609ea97be5cc2758d9") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-ac-alchemist"))])
+ (ac-c-headers . [(20200816 1007) ((auto-complete (1 3 1))) "auto-complete source for C headers" single ((:commit . "67e1e86a48c9bed57bc7ce5ce2553ad203f5752e") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://zk-phi.gitub.io/"))])
+ (ac-capf . [(20151101 217) ((auto-complete (1 4)) (cl-lib (0 5))) "auto-complete source with completion-at-point" single ((:commit . "17571dba0a8f98111f2ab758e9bea285b263781b") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-ac-capf"))])
+ (ac-cider . [(20161006 719) ((cider (0 8 0)) (auto-complete (1 4)) (cl-lib (0 3))) "Clojure auto-complete sources using CIDER" single ((:commit . "fa13e067dd9c8c76151c7d140a2803da1d109b84") (:authors ("Alex Yakushev" . "alex@bytopia.org") ("Steve Purcell" . "steve@sanityinc.com") ("Sam Aaron" . "samaaron@gmail.com")) (:maintainer "Alex Yakushev" . "alex@bytopia.org") (:keywords "languages" "clojure" "nrepl" "cider" "compliment") (:url . "https://github.com/clojure-emacs/ac-cider"))])
+ (ac-clang . [(20180710 546) ((emacs (24)) (cl-lib (0 5)) (auto-complete (1 4 0)) (pos-tip (0 4 6)) (yasnippet (0 8 0))) "Auto Completion source by libclang for GNU Emacs" tar ((:commit . "3294b968eb1a8317049190940193f9da47c085ef") (:authors ("yaruopooner [https://github.com/yaruopooner]")) (:maintainer "yaruopooner [https://github.com/yaruopooner]") (:keywords "completion" "convenience" "intellisense") (:url . "https://github.com/yaruopooner/ac-clang"))])
+ (ac-dcd . [(20210428 1556) ((auto-complete (1 3 1)) (flycheck-dmd-dub (0 7))) "Auto Completion source for dcd for GNU Emacs" single ((:commit . "56d9817159acdebdbb3d5499c7e9379d29af0cd4") (:authors (nil . "<atila.neves@gmail.com>")) (:maintainer nil . "<atila.neves@gmail.com>") (:keywords "languages") (:url . "http://github.com/atilaneves/ac-dcd"))])
+ (ac-emacs-eclim . [(20180911 1121) ((eclim (0 3)) (auto-complete (1 5))) "auto-complete source for eclim" single ((:commit . "222ddd48fcf0ee01592dec77c58e0cf3f2ea1100"))])
+ (ac-emmet . [(20131015 1558) ((emmet-mode (1 0 2)) (auto-complete (1 4))) "auto-complete sources for emmet-mode's snippets" single ((:commit . "88f24876ee3b759978d4614a758280b5d512d543") (:authors ("Yasuyuki Oka" . "yasuyk@gmail.com")) (:maintainer "Yasuyuki Oka" . "yasuyk@gmail.com") (:keywords "completion" "convenience" "emmet") (:url . "https://github.com/yasuyk/ac-emmet"))])
+ (ac-emoji . [(20150823 711) ((auto-complete (1 5 0)) (cl-lib (0 5))) "auto-complete source of Emoji" tar ((:commit . "40a639764eb654f1b4bb705c817b66032a26ff2b") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-ac-emoji"))])
+ (ac-etags . [(20161001 1507) ((auto-complete (1 4))) "etags/ctags completion source for auto-complete" single ((:commit . "7983e631c226fe0fa53af3b2d56bf4eca3d785ce") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-ac-etags"))])
+ (ac-geiser . [(20200318 824) ((geiser (0 5)) (auto-complete (1 4))) "Auto-complete backend for geiser" tar ((:commit . "93818c936ee7e2f1ba1b315578bde363a7d43d05"))])
+ (ac-haskell-process . [(20150423 1402) ((auto-complete (1 4)) (haskell-mode (13))) "Haskell auto-complete source which uses the current haskell process" single ((:commit . "0362d4323511107ec70e7165cb612f3ab01b712f") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "languages"))])
+ (ac-helm . [(20160319 233) ((helm (1 6 3)) (auto-complete (1 4 0)) (popup (0 5 0)) (cl-lib (0 5))) "Helm interface for auto-complete" single ((:commit . "baf2b1e04bcffa835084389c0fab415f26efbf32") (:authors ("rubikitch" . "rubikitch@ruby-lang.org") ("Yasuyuki Oka" . "yasuyk@gmail.com")) (:maintainer "Yasuyuki Oka" . "yasuyk@gmail.com") (:keywords "completion" "convenience" "helm"))])
+ (ac-html . [(20151005 731) ((auto-complete (1 4)) (s (1 9)) (f (0 17)) (dash (2 10))) "auto complete source for html tags and attributes" tar ((:commit . "668154cba123c321d1b07c2dc8b26d14092253b8") (:authors ("Zhang Kai Yu" . "yeannylam@gmail.com")) (:maintainer "Zhang Kai Yu" . "yeannylam@gmail.com") (:keywords "html" "auto-complete" "slim" "haml" "jade") (:url . "https://github.com/cheunghy/ac-html"))])
+ (ac-html-angular . [(20151225 719) ((web-completion-data (0 1))) "auto complete angular15 data for `ac-html' and `company-web'" tar ((:commit . "6bafe09afe03112ca4183d58461c1a6f6c2b3c67") (:authors ("Olexandr Sydorchuk" . "olexandr.syd@gmail.com")) (:maintainer "Olexandr Sydorchuk" . "olexandr.syd@gmail.com") (:keywords "html" "auto-complete" "angular") (:url . "https://github.com/osv/ac-html-bootstrap"))])
+ (ac-html-bootstrap . [(20160302 1701) ((web-completion-data (0 1))) "auto complete bootstrap3/fontawesome classes for `ac-html' and `company-web'" tar ((:commit . "481e6e441cd566554ce71cd8cb28c9e7ebb1c24b") (:authors ("Olexandr Sydorchuk" . "olexandr.syd@gmail.com")) (:maintainer "Olexandr Sydorchuk" . "olexandr.syd@gmail.com") (:keywords "html" "auto-complete" "bootstrap" "cssx") (:url . "https://github.com/osv/ac-html-bootstrap"))])
+ (ac-html-csswatcher . [(20151208 2113) ((web-completion-data (0 1))) "css/less class/id completion with `ac-html' or `company-web'" single ((:commit . "b0f3e7e1a3fe49e88b6eb6432377232fc715f221") (:authors ("Olexandr Sydorchuck " . "olexandr.syd@gmail.com")) (:maintainer "Olexandr Sydorchuck " . "olexandr.syd@gmail.com") (:keywords "html" "css" "less" "auto-complete") (:url . "https://github.com/osv/ac-html-csswatcher"))])
+ (ac-inf-ruby . [(20131115 1150) ((inf-ruby (2 3 2)) (auto-complete (1 4))) "Enable auto-complete in inf-ruby sessions" single ((:commit . "ee53fc9c61950da9a96df3ff5ef186f9a9faf151") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "languages" "tools"))])
+ (ac-ispell . [(20151101 226) ((auto-complete (1 4)) (cl-lib (0 5))) "ispell completion source for auto-complete" single ((:commit . "22bace7387e9012002a6a444922f75f9913077b0") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-ac-ispell"))])
+ (ac-js2 . [(20190101 933) ((js2-mode (20090723)) (skewer-mode (1 4))) "Auto-complete source for Js2-mode, with navigation" tar ((:commit . "2b56d09a16c1a0ce514cc1b85d64cb1be4502723") (:authors ("Scott Barnett" . "scott.n.barnett@gmail.com")) (:maintainer "Scott Barnett" . "scott.n.barnett@gmail.com") (:url . "https://github.com/ScottyB/ac-js2"))])
+ (ac-math . [(20141116 2127) ((auto-complete (1 4)) (math-symbol-lists (1 0))) "Auto-complete sources for input of mathematical symbols and latex tags" single ((:commit . "c012a8f620a48cb18db7d78995035d65eae28f11") (:authors ("Vitalie Spinu")) (:maintainer "Vitalie Spinu") (:keywords "latex" "auto-complete" "unicode" "symbols") (:url . "https://github.com/vitoshka/ac-math"))])
+ (ac-mozc . [(20150227 1619) ((cl-lib (0 5)) (auto-complete (1 4)) (mozc (0))) "auto-complete sources for Japanese input using Mozc" single ((:commit . "4c6c8be4701010d9362184437c0f783e0335c631") (:authors ("igjit" . "igjit1@gmail.com")) (:maintainer "igjit" . "igjit1@gmail.com") (:url . "https://github.com/igjit/ac-mozc"))])
+ (ac-octave . [(20180406 334) ((auto-complete (1 4 0))) "An auto-complete source for Octave" single ((:commit . "fe0f931f2024f43de3c4fff4b1ace672413adeae") (:authors ("coldnew" . "coldnew.tw@gmail.com")) (:maintainer "coldnew" . "coldnew.tw@gmail.com") (:keywords "octave" "auto-complete" "completion") (:url . "https://github.com/coldnew/ac-octave"))])
+ (ac-php . [(20200916 751) ((ac-php-core (2 0)) (auto-complete (1 4 0)) (yasnippet (0 8 0))) "Auto Completion source for PHP." single ((:commit . "f34e09783b77d1158ea139b7b3d8034bc52b0b9f") (:authors ("jim" . "xcwenn@qq.com")) (:maintainer "jim") (:keywords "completion" "convenience" "intellisense") (:url . "https://github.com/xcwen/ac-php"))])
+ (ac-php-core . [(20220418 419) ((dash (1)) (php-mode (1)) (s (1)) (f (0 17 0)) (popup (0 5 0)) (xcscope (1 0))) "The core library of the ac-php" tar ((:commit . "f34e09783b77d1158ea139b7b3d8034bc52b0b9f") (:authors ("jim" . "xcwenn@qq.com") ("Serghei Iakovlev" . "sadhooklay@gmail.com")) (:maintainer "jim") (:keywords "completion" "convenience" "intellisense") (:url . "https://github.com/xcwen/ac-php"))])
+ (ac-racer . [(20170114 809) ((emacs (24 3)) (auto-complete (1 5 0)) (racer (0 0 2))) "auto-complete source of racer" single ((:commit . "4408c2d652dec0432e20c05e001db8222d778c6b") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-ac-racer"))])
+ (ac-rtags . [(20191222 920) ((auto-complete (1 4 0)) (rtags (2 10))) "auto-complete back-end for RTags" single ((:commit . "db39790fda5c2443bc790b8971ac140914f7e9c2") (:authors ("Jan Erik Hanssen" . "jhanssen@gmail.com") ("Anders Bakken" . "agbakken@gmail.com")) (:maintainer "Jan Erik Hanssen" . "jhanssen@gmail.com") (:url . "https://github.com/Andersbakken/rtags"))])
+ (ac-skk . [(20141230 119) ((auto-complete (1 3 1)) (ddskk (16 0 50)) (tinysegmenter (0)) (cl-lib (0 5))) "auto-complete-mode source for DDSKK a.k.a Japanese input method" single ((:commit . "d25a265930430d080329789fb253d786c01dfa24") (:authors ("lugecy <https://twitter.com/lugecy>")) (:maintainer "myuhe") (:keywords "convenience" "auto-complete") (:url . "https://github.com/myuhe/ac-skk.el"))])
+ (ac-slime . [(20171027 2100) ((auto-complete (1 4)) (slime (2 9)) (cl-lib (0 5))) "An auto-complete source using slime completions" single ((:commit . "6c80cb602ddad46486288f94ad7546396c6e4b1a") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/ac-slime"))])
+ (ac-sly . [(20170728 1027) ((sly (1 0 0 -3)) (auto-complete (1 4)) (cl-lib (0 5))) "An auto-complete source using sly completions" single ((:commit . "bf69c687c4ecf1994349d20c182e9b567399912e") (:authors ("Damian T. Dobroczy\\'nski" . "qoocku@gmail.com")) (:maintainer "Damian T. Dobroczy\\'nski" . "qoocku@gmail.com") (:url . "https://github.com/qoocku/ac-sly"))])
+ (academic-phrases . [(20180723 1021) ((dash (2 12 0)) (s (1 12 0)) (ht (2 0)) (emacs (24))) "Bypass that mental block when writing your papers." single ((:commit . "25d9cf67feac6359cb213f061735e2679c84187f") (:authors ("Nasser Alshammari" . "designernasser@gmail.com")) (:maintainer "Nasser Alshammari" . "designernasser@gmail.com") (:keywords "academic" "convenience" "papers" "writing" "wp") (:url . "https://github.com/nashamri/academic-phrases"))])
+ (accent . [(20220202 1312) ((emacs (24 3)) (popup (0 5 8))) "Popup for accented characters (diacritics)" single ((:commit . "6b502df6940587dae2dfbd349c22dfd44c803a86") (:authors ("Elia Scotto" . "eliascotto94@gmail.com")) (:maintainer "Elia Scotto" . "eliascotto94@gmail.com") (:keywords "i18n") (:url . "https://github.com/elias94/accent"))])
+ (ace-flyspell . [(20170309 509) ((avy (0 4 0))) "Jump to and correct spelling errors using `ace-jump-mode' and flyspell" single ((:commit . "538d4f8508d305262ba0228dfe7c819fb65b53c9") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions") (:url . "https://github.com/cute-jumper/ace-flyspell"))])
+ (ace-isearch . [(20210830 746) ((emacs (24))) "A seamless bridge between isearch, ace-jump-mode, avy, helm-swoop and swiper" single ((:commit . "8439136206a42e41ef95af923e0dc3bbd4fa306c") (:authors ("Akira Tamamori")) (:maintainer "Akira Tamamori") (:url . "https://github.com/tam17aki/ace-isearch"))])
+ (ace-jump-buffer . [(20171031 1550) ((avy (0 4 0)) (dash (2 4 0))) "fast buffer switching extension to `avy'" single ((:commit . "0d335064230caf3efdd5a732e8fbd67e3948ed6a") (:authors ("Justin Talbott" . "justin@waymondo.com")) (:maintainer "Justin Talbott" . "justin@waymondo.com") (:url . "https://github.com/waymondo/ace-jump-buffer"))])
+ (ace-jump-helm-line . [(20160918 1836) ((avy (0 4 0)) (helm (1 6 3))) "Ace-jump to a candidate in helm window" single ((:commit . "1483055255df3f8ae349f7520f05b1e43ea3ed37") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions") (:url . "https://github.com/cute-jumper/ace-jump-helm-line"))])
+ (ace-jump-mode . [(20140616 815) nil "a quick cursor location minor mode for emacs" single ((:commit . "8351e2df4fbbeb2a4003f2fb39f46d33803f3dac") (:authors ("winterTTr" . "winterTTr@gmail.com")) (:maintainer "winterTTr" . "winterTTr@gmail.com") (:keywords "motion" "location" "cursor") (:url . "https://github.com/winterTTr/ace-jump-mode/"))])
+ (ace-jump-zap . [(20170717 1849) ((ace-jump-mode (1 0)) (dash (2 10 0))) "Character zapping, `ace-jump-mode` style" single ((:commit . "52b5d4c6c73bd0fc833a0dcb4e803a5287d8cae8") (:authors ("justin talbott" . "justin@waymondo.com")) (:maintainer "justin talbott" . "justin@waymondo.com") (:keywords "convenience" "tools" "extensions") (:url . "https://github.com/waymondo/ace-jump-zap"))])
+ (ace-link . [(20210121 923) ((avy (0 4 0))) "Quickly follow links" single ((:commit . "e1b1c91b280d85fce2194fea861a9ae29e8b03dd") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "convenience" "links" "avy") (:url . "https://github.com/abo-abo/ace-link"))])
+ (ace-mc . [(20190206 749) ((ace-jump-mode (1 0)) (multiple-cursors (1 0)) (dash (2 10 0))) "Add multiple cursors quickly using ace jump" single ((:commit . "6877880efd99e177e4e9116a364576def3da391b") (:authors ("Josh Moller-Mara" . "jmm@cns.nyu.edu")) (:maintainer "Josh Moller-Mara" . "jmm@cns.nyu.edu") (:keywords "motion" "location" "cursor") (:url . "https://github.com/mm--/ace-mc"))])
+ (ace-pinyin . [(20210827 355) ((avy (0 2 0)) (pinyinlib (0 1 0))) "Jump to Chinese characters using avy or ace-jump-mode" single ((:commit . "47662c0b05775ba353464b44c0f1a037c85e746e") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions") (:url . "https://github.com/cute-jumper/ace-pinyin"))])
+ (ace-popup-menu . [(20210608 839) ((emacs (24 3)) (avy-menu (0 1))) "Replace GUI popup menu with something more efficient" single ((:commit . "bc3524eaa28b21725287b59b903c03624cbd5316") (:authors ("Mark Karpov" . "markkarpov92@gmail.com")) (:maintainer "Mark Karpov" . "markkarpov92@gmail.com") (:keywords "convenience" "popup" "menu") (:url . "https://github.com/mrkkrp/ace-popup-menu"))])
+ (ace-window . [(20200606 1259) ((avy (0 5 0))) "Quickly switch windows." single ((:commit . "0577c426a9833ab107bab46c60d1885c611b2fb9") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "window" "location") (:url . "https://github.com/abo-abo/ace-window"))])
+ (achievements . [(20150531 1317) ((keyfreq (0 0 3))) "Achievements for emacs usage." tar ((:commit . "c8275ee492d56255999d58f2988129ab29145182") (:authors ("Ivan Andrus" . "darthandrus@gmail.com")) (:maintainer "Ivan Andrus" . "darthandrus@gmail.com") (:keywords "games"))])
+ (ack-menu . [(20150504 2022) ((mag-menu (0 1 0))) "A menu-based front-end for ack" single ((:commit . "f77be93a4697926ecf3195a355eb69580f695f4d") (:authors ("Steven Thomas") ("Nikolaj Schumacher")) (:maintainer "Steven Thomas") (:keywords "tools" "matching" "convenience") (:url . "https://github.com/chumpage/ack-menu"))])
+ (acme-theme . [(20210430 302) nil "A color theme based on Acme & Sam from Plan 9" single ((:commit . "7c408d111c5e451ecb8fdd5f76cf7d8074aec793") (:authors ("Ian Y.E. Pan")) (:maintainer "Ian Y.E. Pan") (:url . "https://github.com/ianpan870102/acme-emacs-theme"))])
+ (actionscript-mode . [(20180527 1701) nil "A simple mode for editing Actionscript 3 files" single ((:commit . "75639cc7fe85392b5671a1e94dcedb409a949cae") (:authors ("Austin Haas")) (:maintainer "Austin Haas") (:keywords "language" "modes"))])
+ (activity-watch-mode . [(20220111 1121) ((emacs (25)) (request (0)) (json (0)) (cl-lib (0))) "Automatic time tracking extension." single ((:commit . "789ec3425623e43a29755e8daaa02305df8da8ed") (:authors ("Gabor Torok <gabor@20y.hu>, Alan Hamlett" . "alan@wakatime.com")) (:maintainer "Paul d'Hubert" . "paul.dhubert@ya.ru") (:keywords "calendar" "comm") (:url . "https://github.com/pauldub/activity-watch-mode"))])
+ (adafruit-wisdom . [(20200217 306) ((emacs (25 1)) (request (0 3 1))) "Get/display adafruit.com quotes" single ((:commit . "a9314331ba6ea846be9e1f7bded1e2e0ab70cd8e") (:authors ("Neil Okamoto" . "neil.okamoto+melpa@gmail.com")) (:maintainer "Neil Okamoto" . "neil.okamoto+melpa@gmail.com") (:keywords "games") (:url . "https://github.com/gonewest818/adafruit-wisdom.el"))])
+ (add-hooks . [(20171217 123) nil "Functions for setting multiple hooks" single ((:commit . "1845137703461fc44bd77cf24014ba58f19c369d") (:authors ("Nick McCurdy" . "nick@nickmccurdy.com")) (:maintainer "Nick McCurdy" . "nick@nickmccurdy.com") (:keywords "lisp") (:url . "https://github.com/nickmccurdy/add-hooks"))])
+ (add-node-modules-path . [(20220315 340) ((s (1 12 0))) "Add node_modules to your exec-path" single ((:commit . "63f047fd84b825876152743f66de7ee6f9ed203b") (:authors ("Neri Marschik" . "marschik_neri@cyberagent.co.jp")) (:maintainer "Neri Marschik" . "marschik_neri@cyberagent.co.jp") (:keywords "javascript" "node" "node_modules" "eslint") (:url . "https://github.com/codesuki/add-node-modules-path"))])
+ (addressbook-bookmark . [(20190612 1638) ((emacs (24))) "An address book based on Standard Emacs bookmarks." single ((:commit . "d8e502fc2f3d3ab1508ce9e50ebf8a9addc6e5b3") (:authors ("Thierry Volpiatto" . "thierry.volpiatto@gmail.com")) (:maintainer "Thierry Volpiatto" . "thierry.volpiatto@gmail.com") (:url . "https://github.com/thierryvolpiatto/addressbook-bookmark"))])
+ (ado-mode . [(20220415 1647) ((emacs (25 1))) "Major mode for editing Stata-related files" tar ((:commit . "695ea71cf4d6ae5f0afbc37b6fd08458e5c584c4") (:authors ("Bill Rising" . "brising@alum.mit.edu")) (:maintainer "Bill Rising" . "brising@alum.mit.edu") (:keywords "tools" "languages" "files" "convenience" "stata" "mata" "ado") (:url . "https://github.com/louabill/ado-mode"))])
+ (adoc-mode . [(20160314 2130) ((markup-faces (1 0 0))) "a major-mode for editing AsciiDoc files in Emacs" single ((:commit . "745884359a1b8826ede2c4cfd2f0b5478953ac40") (:authors ("Florian Kaufmann" . "sensorflo@gmail.com")) (:maintainer "Florian Kaufmann" . "sensorflo@gmail.com") (:keywords "wp" "asciidoc") (:url . "https://github.com/sensorflo/adoc-mode/wiki"))])
+ (aes . [(20211204 2348) ((emacs (26 1))) "Implementation of AES" single ((:commit . "c9cd12d6c1dbc18603eb4703276132cea59d5c78") (:authors ("Markus Sauermann" . "emacs-aes@sauermann-consulting.de")) (:maintainer "Markus Sauermann" . "emacs-aes@sauermann-consulting.de") (:keywords "data" "tools") (:url . "https://github.com/Sauermann/emacs-aes"))])
+ (affe . [(20220407 2313) ((emacs (27 1)) (consult (0 16))) "Asynchronous Fuzzy Finder for Emacs" tar ((:commit . "a61d593d0cbff65a93111be96b9f53d3e640cf8d") (:authors ("Daniel Mendler")) (:maintainer "Daniel Mendler") (:url . "https://github.com/minad/affe"))])
+ (afternoon-theme . [(20140104 1859) ((emacs (24 1))) "Dark color theme with a deep blue background" single ((:commit . "89b1d778a1f8b385775c122f2bd1c62f0fbf931a") (:authors ("Ozan Sener" . "ozan@ozansener.com")) (:maintainer "Ozan Sener" . "ozan@ozansener.com") (:keywords "themes") (:url . "http://github.com/osener/emacs-afternoon-theme"))])
+ (ag . [(20201031 2202) ((dash (2 8 0)) (s (1 9 0)) (cl-lib (0 5))) "A front-end for ag ('the silver searcher'), the C ack replacement." single ((:commit . "ed7e32064f92f1315cecbfc43f120bbc7508672c") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:url . "https://github.com/Wilfred/ag.el"))])
+ (agda-editor-tactics . [(20211024 2357) ((s (1 12 0)) (dash (2 16 0)) (emacs (27 1)) (org (9 1))) "An editor tactic to produce Σ-types from Agda records" single ((:commit . "c401c0c1ec0ad38bb5ee1636504e0e531b9e34b9") (:authors ("Musa Al-hassy" . "alhassy@gmail.com")) (:maintainer "Musa Al-hassy" . "alhassy@gmail.com") (:keywords "abbrev" "convenience" "languages" "agda" "tools") (:url . "https://github.com/alhassy/next-700-module-systems"))])
+ (aggressive-fill-paragraph . [(20180910 816) ((dash (2 10 0))) "A mode to automatically keep paragraphs filled" single ((:commit . "4a620e62b5e645a48b0a818bf4eb19daea4977df") (:authors ("David Shepherd" . "davidshepherd7@gmail.com")) (:maintainer "David Shepherd" . "davidshepherd7@gmail.com") (:keywords "fill-paragraph" "automatic" "comments") (:url . "https://github.com/davidshepherd7/aggressive-fill-paragraph-mode"))])
+ (aggressive-indent . [(20210701 2224) ((emacs (24 3))) "Minor mode to aggressively keep your code always indented" single ((:commit . "cb416faf61c46977c06cf9d99525b04dc109a33c") (:authors ("Artur Malabarba" . "emacs@endlessparentheses.com")) (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com") (:keywords "indent" "lisp" "maint" "tools") (:url . "https://github.com/Malabarba/aggressive-indent-mode"))])
+ (agtags . [(20200730 116) ((emacs (25))) "A frontend to GNU Global" tar ((:commit . "d80c6f61dee74040c07b7010d48cab1df13a3abf") (:authors ("Vietor Liu" . "vietor.liu@gmail.com")) (:maintainer "Vietor Liu" . "vietor.liu@gmail.com") (:keywords "tools" "convenience") (:url . "https://github.com/vietor/agtags"))])
+ (ah . [(20201213 218) ((emacs (25 1))) "Additional hooks" single ((:commit . "869219e7853510aeb00af3580aede0e5d49b324a") (:authors ("Takaaki ISHIKAWA <takaxp at ieee dot org>")) (:maintainer "Takaaki ISHIKAWA <takaxp at ieee dot org>") (:keywords "convenience") (:url . "https://github.com/takaxp/ah"))])
+ (ahg . [(20210412 847) nil "Alberto's Emacs interface for Mercurial (Hg)" single ((:commit . "77bc2a628df006dcd2dc359ac12acdf8091a1356") (:authors ("Alberto Griggio" . "agriggio@users.sourceforge.net")) (:maintainer "Alberto Griggio" . "agriggio@users.sourceforge.net") (:url . "https://bitbucket.org/agriggio/ahg"))])
+ (ahk-mode . [(20200412 1832) ((emacs (24 3))) "Major mode for editing AHK (AutoHotkey and AutoHotkey_L)" single ((:commit . "729007b5f22a49f5187ff47fca18c0d674e73047") (:authors ("Rich Alesi")) (:maintainer "Rich Alesi") (:keywords "ahk" "autohotkey" "hotkey" "keyboard shortcut" "automation") (:url . "https://github.com/ralesi/ahk-mode"))])
+ (ahungry-theme . [(20180131 328) ((emacs (24))) "Ahungry color theme for Emacs. Make sure to (load-theme 'ahungry)." single ((:commit . "7d18c85c014671573628686012f3952fcd72c97b") (:authors ("Matthew Carter" . "m@ahungry.com")) (:maintainer "Matthew Carter" . "m@ahungry.com") (:keywords "ahungry" "palette" "color" "theme" "emacs" "color-theme" "deftheme") (:url . "https://github.com/ahungry/color-theme-ahungry"))])
+ (aio . [(20200610 1904) ((emacs (26 1))) "async/await for Emacs Lisp" tar ((:commit . "da93523e235529fa97d6f251319d9e1d6fc24a41") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/emacs-aio"))])
+ (airline-themes . [(20211214 1749) ((powerline (2 3))) "vim-airline themes for emacs powerline" tar ((:commit . "6bd102e49a7d87af1a72eb86e953991ff7bc954e") (:authors ("Anthony DiGirolamo" . "anthony.digirolamo@gmail.com")) (:maintainer "Anthony DiGirolamo" . "anthony.digirolamo@gmail.com") (:keywords "evil" "mode-line" "powerline" "airline" "themes") (:url . "http://github.com/AnthonyDiGirolamo/airline-themes"))])
+ (airplay . [(20130212 1226) ((request (20130110 2144)) (simple-httpd (1 4 1)) (deferred (0 3 1))) "Airplay bindings to Emacs" tar ((:commit . "bd690aafcae3a887946e1bba8327597932d964ad") (:authors ("Wataru MIYAGUNI" . "gonngo@gmail.com")) (:maintainer "Wataru MIYAGUNI" . "gonngo@gmail.com") (:keywords "appletv" "airplay") (:url . "https://github.com/gongo/airplay-el"))])
+ (alan-mode . [(20220106 727) ((flycheck (32)) (emacs (25 1)) (s (1 12))) "Major mode for editing Alan files" single ((:commit . "e96b06115f53ef81097f585f627855d97b35b89f") (:authors ("Paul van Dam" . "pvandam@kjerner.com")) (:maintainer "Paul van Dam" . "pvandam@kjerner.com") (:keywords "alan" "languages") (:url . "https://github.com/Kjerner/AlanForEmacs"))])
+ (alarm-clock . [(20191204 716) ((emacs (24 4)) (f (0 17 0))) "Alarm Clock" tar ((:commit . "644f331071f8b09a898fae490541908b5054d2e6") (:authors ("Steve Lemuel" . "wlemuel@hotmail.com")) (:maintainer "Steve Lemuel" . "wlemuel@hotmail.com") (:keywords "calendar" "tools" "convenience") (:url . "https://github.com/wlemuel/alarm-clock"))])
+ (alchemist . [(20180312 1304) ((elixir-mode (2 2 5)) (dash (2 11 0)) (emacs (24 4)) (company (0 8 0)) (pkg-info (0 4)) (s (1 11 0))) "Elixir tooling integration into Emacs" tar ((:commit . "6f99367511ae209f8fe2c990779764bbb4ccb6ed") (:authors ("Samuel Tonini" . "tonini.samuel@gmail.com")) (:maintainer "Samuel Tonini" . "tonini.samuel@gmail.com") (:keywords "languages" "elixir" "elixirc" "mix" "hex" "alchemist") (:url . "http://www.github.com/tonini/alchemist.el"))])
+ (alda-mode . [(20210705 654) ((emacs (24 0))) "An Alda major mode" single ((:commit . "4de011d572e958a377fb16daae05a1b411f0c8ad") (:authors ("Jay Kamat" . "jaygkamat@gmail.com")) (:maintainer "Jay Kamat" . "jaygkamat@gmail.com") (:keywords "alda" "highlight") (:url . "http://gitlab.com/jgkamat/alda-mode"))])
+ (alect-themes . [(20211022 1651) ((emacs (24 0))) "Configurable light, dark and black themes for Emacs 24 or later" tar ((:commit . "89560047934c236d05ea6b911c0c63702a8e06f3") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "color" "theme") (:url . "https://github.com/alezost/alect-themes"))])
+ (alectryon . [(20211018 321) ((flycheck (31)) (emacs (25 1))) "Toggle between Coq and reStructuredText" tar ((:commit . "c8ab1ec50f7c62fb42a78c0617624b91ba62a162") (:authors ("Clément Pit-Claudel" . "clement.pitclaudel@live.com")) (:maintainer "Clément Pit-Claudel" . "clement.pitclaudel@live.com") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/cpitclaudel/alectryon"))])
+ (alert . [(20200303 2118) ((gntp (0 1)) (log4e (0 3 0)) (cl-lib (0 5))) "Growl-style notification system for Emacs" single ((:commit . "7046393272686c7a1a9b3e7f7b1d825d2e5250a6") (:authors ("John Wiegley" . "jwiegley@gmail.com")) (:maintainer "John Wiegley" . "jwiegley@gmail.com") (:keywords "notification" "emacs" "message") (:url . "https://github.com/jwiegley/alert"))])
+ (alert-termux . [(20181119 951) ((emacs (24 4))) "alert.el notifications on Termux" single ((:commit . "47c414285c2f5971f3be52aaf0a4066ea6989238") (:authors ("Gergely Polonkai" . "gergely@polonkai.eu")) (:maintainer "Gergely Polonkai" . "gergely@polonkai.eu") (:keywords "terminals") (:url . "https://github.com/gergelypolonkai/alert-termux"))])
+ (alert-toast . [(20220312 229) ((emacs (25 1)) (alert (1 2)) (f (0 20 0)) (s (1 12 0))) "Windows 10 toast notifications" single ((:commit . "ba931529a266537783cfec2a28c2b8c058364ff2") (:authors ("Grzegorz Kowzan" . "grzegorz@kowzan.eu")) (:maintainer "Grzegorz Kowzan" . "grzegorz@kowzan.eu") (:url . "https://github.com/gkowzan/alert-toast"))])
+ (align-cljlet . [(20160112 2101) ((clojure-mode (1 11 5))) "Space align various Clojure forms" single ((:commit . "602d72a7ad52788a0265e3c6da519464a98166b8") (:url . "https://github.com/gstamp/align-cljlet"))])
+ (all-ext . [(20200315 1443) ((emacs (24 4)) (all (1 0))) "M-x all with helm-swoop/anything/multiple-cursors/line-number" single ((:commit . "c865c62506af2c9edc7705a7c24dc8b70d5d4de2") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "matching" "all" "search" "replace" "anything" "helm" "helm-swoop" "occur") (:url . "https://github.com/rubikitch/all-ext"))])
+ (all-the-icons . [(20220427 1911) ((emacs (24 3))) "A library for inserting Developer icons" tar ((:commit . "68365b48f142d75ef4bdc3a274256d97752e3b65") (:authors ("Dominic Charlesworth" . "dgc336@gmail.com")) (:maintainer "Dominic Charlesworth" . "dgc336@gmail.com") (:keywords "convenient" "lisp") (:url . "https://github.com/domtronn/all-the-icons.el"))])
+ (all-the-icons-completion . [(20220409 1204) ((emacs (26 1)) (all-the-icons (5 0))) "Add icons to completion candidates" single ((:commit . "286e2c064a1298be0d8d4100dc91d7a7a554d04a") (:authors ("Itai Y. Efrat <https://github.com/iyefrat>")) (:maintainer "Itai Y. Efrat" . "itai3397@gmail.com") (:keywords "convenient" "lisp") (:url . "https://github.com/iyefrat/all-the-icons-completion"))])
+ (all-the-icons-dired . [(20220304 1638) ((emacs (24 4)) (all-the-icons (2 2 0))) "Shows icons for each file in dired mode" single ((:commit . "147ed0dfd1034a686795a08dc63e2c293128597e") (:authors ("jtbm37")) (:maintainer "Jimmy Yuen Ho Wong" . "wyuenho@gmail.com") (:keywords "files" "icons" "dired") (:url . "https://github.com/wyuenho/all-the-icons-dired"))])
+ (all-the-icons-gnus . [(20180511 654) ((emacs (24 4)) (dash (2 12 0)) (all-the-icons (3 1 0))) "Shows icons for in Gnus" single ((:commit . "27f78996da0725943bcfb2d18038e6f7bddfa9c7") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "mail" "tools"))])
+ (all-the-icons-ibuffer . [(20220424 1027) ((emacs (24 4)) (all-the-icons (2 2 0))) "Display icons for all buffers in ibuffer" single ((:commit . "0fcb43eb440e18078c8faf67c27a2189bbb45dfb") (:authors ("Vincent Zhang" . "seagle0128@gmail.com")) (:maintainer "Vincent Zhang" . "seagle0128@gmail.com") (:keywords "convenience" "icons" "ibuffer") (:url . "https://github.com/seagle0128/all-the-icons-ibuffer"))])
+ (all-the-icons-ivy . [(20190508 1803) ((emacs (24 4)) (all-the-icons (2 4 0)) (ivy (0 8 0))) "Shows icons while using ivy and counsel" single ((:commit . "a70cbfa1effe36efc946a823a580cec686d5e88d") (:authors ("asok")) (:maintainer "asok") (:keywords "faces"))])
+ (all-the-icons-ivy-rich . [(20220505 834) ((emacs (25 1)) (ivy-rich (0 1 0)) (all-the-icons (2 2 0))) "Better experience with icons for ivy" single ((:commit . "7c9db258ba7dd0a8c90eb7cebd335961cc45e031") (:authors ("Vincent Zhang" . "seagle0128@gmail.com")) (:maintainer "Vincent Zhang" . "seagle0128@gmail.com") (:keywords "convenience" "icons" "ivy") (:url . "https://github.com/seagle0128/all-the-icons-ivy-rich"))])
+ (almost-mono-themes . [(20220422 1714) ((emacs (24))) "Almost monochromatic color themes" tar ((:commit . "0641bf565c113caef8d5c2a93f38cff32ebb62b7") (:authors ("John Olsson" . "john@cryon.se")) (:maintainer "John Olsson" . "john@cryon.se") (:keywords "faces") (:url . "https://github.com/cryon/almost-mono-themes"))])
+ (alsamixer . [(20191002 1133) nil "Functions to call out to amixer." single ((:commit . "1bdb99e433acd38685f05408562746cfbf2bc820") (:authors ("R.W. van 't Veer")) (:maintainer "R.W. van 't Veer") (:keywords "convenience") (:url . "https://github.com/remvee/alsamixer-el"))])
+ (alt-codes . [(20220212 1526) ((emacs (26 1))) "Insert alt codes using meta key" single ((:commit . "45deed4b9aadcd5e2a5482b0fe5110bb78ba1dd6") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/alt-codes"))])
+ (amd-mode . [(20180111 1402) ((emacs (25)) (projectile (20161008 47)) (s (1 9 0)) (f (0 16 2)) (seq (2 16)) (makey (0 3)) (js2-mode (20140114)) (js2-refactor (0 6 1))) "Minor mode for handling JavaScript AMD module requirements." single ((:commit . "01fd19e0d635ccaf8e812364d8720733f2e84126") (:authors ("Nicolas Petton" . "petton.nicolas@gmail.com")) (:maintainer "Nicolas Petton" . "petton.nicolas@gmail.com") (:keywords "javascript" "amd" "projectile"))])
+ (ameba . [(20200103 1454) ((emacs (24 4))) "An interface to Crystal Ameba linter" single ((:commit . "0c4925ae0e998818326adcb47ed27ddf9761c7dc") (:authors ("Vitalii Elenhaupt")) (:maintainer "Vitalii Elenhaupt") (:keywords "convenience") (:url . "https://github.com/crystal-ameba/ameba.el"))])
+ (ample-regexps . [(20200508 1021) nil "ample regular expressions for Emacs" tar ((:commit . "153969ce547afe410b8986f01c9ed4087c9cd20b") (:authors ("immerrr" . "immerrr@gmail.com")) (:maintainer "immerrr" . "immerrr@gmail.com") (:keywords "regexps" "extensions" "tools"))])
+ (ample-theme . [(20180207 1745) nil "Calm Dark Theme for Emacs" tar ((:commit . "f5a163626e04abda2d3c168f703c3f330f302a7c") (:authors ("Jordon Biondo" . "jordonbiondo@gmail.com")) (:maintainer "Jordon Biondo" . "jordonbiondo@gmail.com") (:keywords "theme" "dark") (:url . "https://github.com/jordonbiondo/ample-theme"))])
+ (ample-zen-theme . [(20150119 2154) nil "AmpleZen Theme for Emacs 24" single ((:commit . "b277bb7abd4b6624e8d59f02474b79af50a007bd") (:authors ("Michael Wall")) (:maintainer "Michael Wall") (:keywords "theme" "dark" "emacs 24") (:url . "https://github.com/mjwall/ample-zen"))])
+ (amread-mode . [(20220210 1354) ((emacs (24 3)) (cl-lib (0 6 1))) "A minor mode helper user speed-reading" single ((:commit . "a3358645582148e81bff54e18877451b747173bb") (:keywords "wp") (:url . "https://repo.or.cz/amread-mode.git"))])
+ (amsreftex . [(20220115 1838) ((emacs (25 1))) "Add amsrefs bibliography support for reftex" single ((:commit . "facf47b82572e3f62bd8d9b8d4f4d5258f6c8a38") (:authors ("Fran Burstall" . "fran.burstall@gmail.com")) (:maintainer "Fran Burstall" . "fran.burstall@gmail.com") (:keywords "tex") (:url . "https://github.com/franburstall/amsreftex"))])
+ (amx . [(20210305 118) ((emacs (24 4)) (s (0))) "Alternative M-x with extra features." single ((:commit . "37f9c7ae55eb0331b27200fb745206fc58ceffc0") (:authors ("Ryan C. Thompson" . "rct@thompsonclan.org") ("Cornelius Mika" . "cornelius.mika@gmail.com")) (:maintainer "Ryan C. Thompson" . "rct@thompsonclan.org") (:keywords "convenience" "usability" "completion") (:url . "http://github.com/DarwinAwardWinner/amx/"))])
+ (anaconda-mode . [(20211122 817) ((emacs (25 1)) (pythonic (0 1 0)) (dash (2 6 0)) (s (1 9)) (f (0 16 2))) "Code navigation, documentation lookup and completion for Python" tar ((:commit . "cbea0fb3182321d34ff93981c5a59f8dd72d82a5") (:authors ("Artem Malyshev" . "proofit404@gmail.com")) (:maintainer "Artem Malyshev" . "proofit404@gmail.com") (:url . "https://github.com/proofit404/anaconda-mode"))])
+ (anakondo . [(20210221 1727) ((emacs (26 3))) "Adds clj-kondo based Clojure[Script] editing facilities" single ((:commit . "16b0ba14d94a5d7e55655efc9e1d6d069a9306f2") (:authors ("Didier A." . "didibus@users.noreply.github.com")) (:maintainer "Didier A." . "didibus@users.noreply.github.com") (:keywords "clojure" "clojurescript" "cljc" "clj-kondo" "completion" "languages" "tools") (:url . "https://github.com/didibus/anakondo"))])
+ (anaphora . [(20180618 2200) nil "anaphoric macros providing implicit temp variables" single ((:commit . "3b2da3f759b244975852e79721c4a2dbad3905cf") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "extensions") (:url . "http://github.com/rolandwalker/anaphora"))])
+ (ancient-one-dark-theme . [(20211030 1358) ((emacs (24 1))) "A color theme based off uetchy's Ancient One Dark Theme" single ((:commit . "db79f86842c10874ce18c1a1e4496e9d0e28bed9") (:authors ("Daniils Petrovs")) (:maintainer "Daniils Petrovs") (:url . "https://github.com/DaniruKun/ancient-one-dark-emacs-theme"))])
+ (android-env . [(20200722 1403) ((emacs (24 3))) "Helper functions for working in android" single ((:commit . "5c6a6d9449f300eec4f374a5410edc1cbab02e40") (:authors ("Fernando Jascovich")) (:maintainer "Fernando Jascovich") (:keywords "android" "gradle" "java" "tools" "convenience") (:url . "https://github.com/fernando-jascovich/android-env.el"))])
+ (android-mode . [(20190903 811) nil "Minor mode for Android application development" single ((:commit . "d5332e339a1f5e30559a53feffb8442ca79265d6") (:authors ("R.W. van 't Veer")) (:maintainer "R.W. van 't Veer") (:keywords "tools" "processes") (:url . "https://github.com/remvee/android-mode"))])
+ (angry-police-captain . [(20120829 1252) nil "Show quote from http://theangrypolicecaptain.com in the minibuffer" single ((:commit . "d11931c5cb63368dcc4a48797962428cca6d3e9d") (:authors ("Rolando Pereira" . "rolando_pereira@sapo.pt")) (:maintainer "Rolando Pereira" . "rolando_pereira@sapo.pt") (:keywords "games" "web" "fun"))])
+ (angular-mode . [(20151201 2127) nil "Major mode for Angular.js" tar ((:commit . "8720cde86af0f1859ccc8580571e8d0ad1c52cff") (:authors ("Rudolf Olah" . "omouse@gmail.com")) (:maintainer "Rudolf Olah" . "omouse@gmail.com") (:keywords "languages" "javascript") (:url . "https://github.com/omouse/angularjs-mode"))])
+ (angular-snippets . [(20140514 523) ((s (1 4 0)) (dash (1 2 0))) "Yasnippets for AngularJS" tar ((:commit . "af5ae0a4a8603b040446c28afcf6ca01a8b4bd7b") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "snippets"))])
+ (anki-connect . [(20191123 1858) ((emacs (24 3))) "AnkiConnect API" single ((:commit . "1324f0c248aa2c6e73d6cf93fad6119d699f7dae") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "lisp" "anki") (:url . "https://github.com/lujun9972/anki-connect.el"))])
+ (anki-editor . [(20190922 1223) ((emacs (25)) (request (0 3 0)) (dash (2 12 0))) "Minor mode for making Anki cards with Org" tar ((:commit . "546774a453ef4617b1bcb0d1626e415c67cc88df") (:authors ("Lei Tan")) (:maintainer "Lei Tan") (:url . "https://github.com/louietan/anki-editor"))])
+ (anki-mode . [(20201223 719) ((emacs (24 4)) (dash (2 12 0)) (markdown-mode (2 2)) (s (1 11 0)) (request (0 3 0))) "A major mode for creating anki cards" single ((:commit . "d9b84028cd6a1ae040fb5604080a8b5fa8138562") (:authors ("David Shepherd" . "davidshepherd7@gmail.com")) (:maintainer "David Shepherd" . "davidshepherd7@gmail.com") (:keywords "tools") (:url . "https://github.com/davidshepherd7/anki-mode"))])
+ (anki-vocabulary . [(20200103 325) ((emacs (24 4)) (s (1 0)) (youdao-dictionary (0 4)) (anki-connect (1 0)) (s (1 10))) "Help you to create vocabulary cards in Anki" single ((:commit . "863fe0219577f996ab126f1b7902db3c2cc59b2b") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "lisp" "anki" "translator" "chinese") (:url . "https://github.com/lujun9972/anki-vocabulary.el"))])
+ (annalist . [(20190929 207) ((emacs (24 4)) (cl-lib (0 5))) "Record and display information such as keybindings" tar ((:commit . "134fa3f0fb91a636a1c005c483516d4b64905a6d") (:authors ("Fox Kiester" . "noct@posteo.net")) (:maintainer "Fox Kiester" . "noct@posteo.net") (:keywords "convenience" "tools" "keybindings" "org") (:url . "https://github.com/noctuid/annalist.el"))])
+ (annotate . [(20220428 1339) nil "annotate files without changing them" single ((:commit . "e982a7b74a681a8c2c823d8dcaafd185ab5f719e") (:authors ("Bastian Bechtold")) (:maintainer "Bastian Bechtold <bastibe.dev@mailbox.org>, cage" . "cage-dev@twistfold.it") (:url . "https://github.com/bastibe/annotate.el"))])
+ (annotate-depth . [(20160520 2040) nil "Annotate buffer if indentation depth is beyond threshold." single ((:commit . "fcb24fa36287250e40d195590c4ca4a8a696277b") (:authors ("Morten Slot Kristensen <msk AT nullpointer DOT dk>")) (:maintainer "Morten Slot Kristensen <msk AT nullpointer DOT dk>") (:keywords "convenience") (:url . "https://github.com/netromdk/annotate-depth"))])
+ (annotation . [(20200914 644) nil "Functions for annotating text with faces and help bubbles" single ((:commit . "9a5f2b4a8cd14edbde9d16dcdfcb8db2a91be0d8") (:url . "https://github.com/agda/agda"))])
+ (annoying-arrows-mode . [(20161024 646) ((cl-lib (0 5))) "Ring the bell if using arrows too much" single ((:commit . "3c42e9807d7696da2da2a21b63beebf9cdb3f5dc") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com"))])
+ (ansi . [(20211104 1420) ((emacs (24 1)) (cl-lib (0 6))) "Turn string into ansi strings" single ((:commit . "2367fba7b3b2340364a30cd6de7f3eb6bb9898a3") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "terminals" "color" "ansi") (:url . "http://github.com/rejeep/ansi"))])
+ (ansible . [(20220114 45) ((s (1 9 0)) (f (0 16 2))) "Ansible minor mode" tar ((:commit . "d89ac0ee57742cca0f0e0a3453d9dcc521575690") (:authors ("k1LoW (Kenichirou Oyama), <k1lowxb [at] gmail [dot] com> <k1low [at] 101000lab [dot] org>")) (:maintainer "k1LoW (Kenichirou Oyama), <k1lowxb [at] gmail [dot] com> <k1low [at] 101000lab [dot] org>") (:url . "https://github.com/k1LoW/emacs-ansible"))])
+ (ansible-doc . [(20160924 824) ((emacs (24 3))) "Ansible documentation Minor Mode" single ((:commit . "86083a7bb2ed0468ca64e52076b06441a2f8e9e0") (:authors ("Sebastian Wiesner" . "swiesner@lunaryorn")) (:maintainer "Sebastian Wiesner" . "swiesner@lunaryorn") (:keywords "tools" "help") (:url . "https://github.com/lunaryorn/ansible-doc.el"))])
+ (ansible-vault . [(20211119 1500) ((emacs (24 3))) "Minor mode for editing ansible vault files" single ((:commit . "8da2ad658dbe94c71aad1c75d6fd22888338030c") (:maintainer "Zachary Elliott" . "contact@zell.io") (:keywords "ansible" "ansible-vault" "tools") (:url . "http://github.com/zellio/ansible-vault-mode"))])
+ (ant . [(20160211 1543) nil "helpers for compiling with ant" single ((:commit . "510b5a3f57ee4b2855422d88d359a28922c1ab70") (:keywords "compilation" "ant" "java"))])
+ (anti-zenburn-theme . [(20180712 1838) nil "Low-contrast Zenburn-inverted theme" single ((:commit . "dbafbaa86be67c1d409873f57a5c0bbe1e7ca158") (:authors ("Andrey Kotlarski" . "m00naticus@gmail.com")) (:maintainer "Andrey Kotlarski" . "m00naticus@gmail.com") (:url . "https://github.com/m00natic/anti-zenburn-theme"))])
+ (anx-api . [(20140208 1514) nil "Interact with the AppNexus API from Emacs." single ((:commit . "b2411ebc966ac32c3ffc61bc22bf183834df0fa0") (:authors ("Rich Loveland")) (:maintainer "Rich Loveland") (:keywords "convenience" "json" "rest" "api" "appnexus"))])
+ (anybar . [(20160816 1421) nil "Control AnyBar from Emacs" single ((:commit . "7a0743e0d31bcb36ab1bb2e351f3e7139c422ac5") (:authors ("Christopher Shea" . "cmshea@gmail.com")) (:maintainer "Christopher Shea" . "cmshea@gmail.com") (:keywords "anybar"))])
+ (anyins . [(20131229 1041) nil "Insert content at multiple places from shell command or kill-ring" single ((:commit . "83844c17ac9b5b6c7655ee556b75689e4c8ea663") (:authors ("Anthony HAMON" . "hamon.anth@gmail.com")) (:maintainer "Anthony HAMON" . "hamon.anth@gmail.com") (:keywords "insert" "rectangular") (:url . "http://github.com/antham/anyins"))])
+ (anzu . [(20211002 2255) ((emacs (25 1))) "Show number of matches in mode-line while searching" single ((:commit . "5abb37455ea44fa401d5f4c1bdc58adb2448db67") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Neil Okamoto" . "neil.okamoto+melpa@gmail.com") (:url . "https://github.com/emacsorphanage/anzu"))])
+ (aozora-view . [(20140310 1317) nil "Aozora Bunko text Emacs viewer." tar ((:commit . "b0390616d19e45f15f9a2f5d5688274831e721fd") (:authors ("KAWABATA, Taichi <kawabata.taichi_at_gmail.com>")) (:maintainer "KAWABATA, Taichi <kawabata.taichi_at_gmail.com>") (:keywords "text") (:url . "https://github.com/kawabata/aozora-view"))])
+ (apache-mode . [(20210519 1931) nil "Major mode for editing Apache httpd configuration files" single ((:commit . "f2c11aac2f5fc598123e04f4604bea248689a117") (:authors ("Karl Chen" . "quarl@nospam.quarl.org")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "languages" "faces") (:url . "https://github.com/emacs-php/apache-mode"))])
+ (apdl-mode . [(20211023 1831) ((emacs (25 1))) "Major mode for the APDL programming language." tar ((:commit . "c55c6468526100ba0da00bff05cfb17cdf8839cf") (:authors ("H. Dieter Wilhelm" . "dieter@duenenhof-wilhelm.de")) (:maintainer "H. Dieter Wilhelm") (:keywords "languages" "convenience" "tools" "ansys" "apdl") (:url . "https://github.com/dieter-wilhelm/apdl-mode"))])
+ (apel . [(20220427 1121) ((emacs (24 5))) "A Portable Emacs Library provides support for portable Emacs Lisp programs" tar ((:commit . "6947dc4605ebbb87762edf7051a78a3f7b5f17c5"))])
+ (apheleia . [(20220509 2258) ((emacs (26))) "Reformat buffer stably" single ((:commit . "a0737fd69591f4186a626eb72ccd9488a6da437c") (:authors ("Radian LLC" . "contact+apheleia@radian.codes")) (:maintainer "Radian LLC" . "contact+apheleia@radian.codes") (:keywords "tools") (:url . "https://github.com/raxod502/apheleia"))])
+ (apib-mode . [(20200101 1017) ((markdown-mode (2 1))) "Major mode for API Blueprint files" single ((:commit . "c6dd05201f6eb9295736d8668a79a7510d11159e") (:authors ("Vilibald Wanča" . "vilibald@wvi.cz")) (:maintainer "Vilibald Wanča" . "vilibald@wvi.cz") (:keywords "tools" "api-blueprint") (:url . "http://github.com/w-vi/apib-mode"))])
+ (apiwrap . [(20180602 2231) ((emacs (25))) "api-wrapping macros" single ((:commit . "a4fb21d96027369307b22439a4a6c765ee272f44") (:authors ("Sean Allred" . "code@seanallred.com")) (:maintainer "Sean Allred" . "code@seanallred.com") (:keywords "tools" "maint" "convenience") (:url . "https://github.com/vermiculus/apiwrap.el"))])
+ (apparmor-mode . [(20220411 648) ((emacs (24 4))) "Major mode for editing AppArmor policy files" single ((:commit . "abc2a6adf563b89daee9f8fa07a71d78957defdb") (:authors ("Alex Murray" . "murray.alex@gmail.com")) (:maintainer "Alex Murray" . "murray.alex@gmail.com") (:url . "https://github.com/alexmurray/apparmor-mode"))])
+ (apples-mode . [(20110121 418) nil "Major mode for editing and executing AppleScript code" tar ((:commit . "83a9ab0d6ba82496e2f7df386909b1a55701fccb") (:authors ("tequilasunset" . "tequilasunset.mac@gmail.com")) (:maintainer "tequilasunset" . "tequilasunset.mac@gmail.com") (:keywords "applescript" "languages"))])
+ (applescript-mode . [(20210802 1715) ((emacs (24 3))) "major mode for editing AppleScript source" single ((:commit . "ea9a32aa33580b0695e7298d56c3d5f050a02b87") (:authors ("sakito" . "sakito@users.sourceforge.jp")) (:maintainer "sakito" . "sakito@users.sourceforge.jp") (:keywords "languages" "tools") (:url . "https://github.com/emacsorphanage/applescript-mode"))])
+ (aproject . [(20220410 541) nil "Basic project framework for Emacs" tar ((:commit . "13e176ee69851403bec6471c5cceed17b7912b6f") (:authors ("Vietor Liu" . "vietor.liu@gmail.com")) (:maintainer "Vietor Liu" . "vietor.liu@gmail.com") (:keywords "environment" "project") (:url . "https://github.com/vietor/aproject"))])
+ (apropospriate-theme . [(20220418 1554) nil "A colorful, low-contrast, light & dark theme set for Emacs with a fun name." tar ((:commit . "52ed4bf4aaa01c527271d71e6ce00f3607839777"))])
+ (apt-sources-list . [(20180527 1241) ((emacs (24 4))) "Mode for editing APT source.list files" single ((:commit . "5289443ceff230dfc8a2c1c6b524c90560eb08a5") (:authors ("Dr. Rafael Sepúlveda" . "drs@gnulinux.org.mx")) (:maintainer "Joe Wreschnig" . "joe.wreschnig@gmail.com") (:url . "https://git.korewanetadesu.com/apt-sources-list.git"))])
+ (aqi . [(20200215 1334) ((emacs (25 1)) (request (0 3)) (let-alist (0 0))) "Air quality data from the World Air Quality Index" single ((:commit . "c107a2e21cd1ac6008d8baaeeedb3fab26583d45") (:authors ("nik gaffney" . "nik@fo.am")) (:maintainer "nik gaffney" . "nik@fo.am") (:keywords "air quality" "aqi" "pollution" "weather" "data") (:url . "https://github.com/zzkt/aqi"))])
+ (arc-dark-theme . [(20190314 1632) ((emacs (24))) "Arc dark theme" single ((:commit . "ee17dcca35dd0304145efc468b3f25af6907a59d") (:authors ("Christopher Fraser" . "cfraz89@gmail.com")) (:maintainer "Christopher Fraser" . "cfraz89@gmail.com") (:keywords "faces" "theme") (:url . "https://github.com/cfraz89/arc-dark-theme"))])
+ (arch-packer . [(20170730 1321) ((emacs (25 1)) (s (1 11 0)) (async (1 9 2)) (dash (2 12 0))) "Arch Linux package management frontend" single ((:commit . "940e96f7d357c6570b675a0f942181c787f1bfd7") (:authors ("Fritz Stelzer" . "brotzeitmacher@gmail.com")) (:maintainer "Fritz Stelzer" . "brotzeitmacher@gmail.com") (:url . "https://github.com/brotzeitmacher/arch-packer"))])
+ (archive-region . [(20200316 1425) ((emacs (24 4))) "Move region to archive file instead of killing" single ((:commit . "53cd2d96ea7c33f320353982b36854f25c900c2e") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "languages") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/archive-region.el"))])
+ (archive-rpm . [(20220314 1647) ((emacs (24 4))) "RPM and CPIO support for archive-mode" tar ((:commit . "515d2230352fffcc982ae2e322d95cbee6aca760") (:authors ("Magnus Henoch" . "magnus.henoch@gmail.com")) (:maintainer "Magnus Henoch" . "magnus.henoch@gmail.com") (:keywords "files"))])
+ (arduino-cli-mode . [(20210511 653) ((emacs (25 1))) "Arduino-CLI command wrapper" single ((:commit . "a93de7e8fef202163df4657f2ab522b57f70f202") (:authors ("Love Lagerkvist")) (:maintainer "Love Lagerkvist") (:keywords "processes" "tools") (:url . "https://github.com/motform/arduino-cli-mode"))])
+ (arduino-mode . [(20220210 1355) ((emacs (25 1)) (spinner (1 7 3))) "Major mode for editing Arduino code" tar ((:commit . "652c6a328fa8f2db06534d5f231c6b6933be3edc") (:maintainer "stardiviner" . "numbchild@gmail.com") (:keywords "languages" "arduino") (:url . "https://repo.or.cz/arduino-mode.git"))])
+ (aria2 . [(20190816 25) ((emacs (24 4))) "Control aria2c commandline tool from Emacs" single ((:commit . "32e08d5a8ad2f305578e0f783e087c1d312238c7") (:authors ("Łukasz Gruner" . "lukasz@gruner.lu")) (:maintainer "Łukasz Gruner" . "lukasz@gruner.lu") (:keywords "download" "bittorrent" "aria2") (:url . "https://bitbucket.org/ukaszg/aria2-mode"))])
+ (ariadne . [(20131117 1711) ((bert (0 1))) "Ariadne plugin for Emacs" single ((:commit . "6fe401c7f996bcbc2f685e7971324c6f5e5eaf15") (:authors ("Oleksandr Manzyuk" . "manzyuk@gmail.com")) (:maintainer "Oleksandr Manzyuk" . "manzyuk@gmail.com") (:keywords "comm" "convenience" "processes"))])
+ (arjen-grey-theme . [(20170522 2047) nil "A soothing dark grey theme" single ((:commit . "4cd0be72b65d42390e2105cfdaa408a1ead8d8d1") (:authors ("Arjen Wiersma" . "arjen@wiersma.org")) (:maintainer "Arjen Wiersma" . "arjen@wiersma.org") (:keywords "faces") (:url . "https://github.com/credmp/arjen-grey"))])
+ (artbollocks-mode . [(20170524 422) nil "Improve your writing (especially about art)" single ((:commit . "33a41ca4f8206f57e5498a526d3b0ea18d08bb93") (:authors ("Rob Myers <rob@robmyers.org>, Sacha Chua" . "sacha@sachachua.com")) (:maintainer "Rob Myers <rob@robmyers.org>, Sacha Chua" . "sacha@sachachua.com") (:url . "https://github.com/sachac/artbollocks-mode"))])
+ (arview . [(20160419 2109) nil "extract and view archives in the temporary directory" single ((:commit . "5437b4221b64b238c273a651d4792c577dba6d45") (:authors ("Andrey Fainer" . "fandrey@gmx.com")) (:maintainer "Andrey Fainer" . "fandrey@gmx.com") (:keywords "files") (:url . "https://github.com/afainer/arview"))])
+ (arxiv-mode . [(20220128 920) ((emacs (27 1)) (hydra (0))) "Read and search for articles on arXiv.org" tar ((:commit . "f550583d2da8bd9600bd26bb4028fe22a9744da2") (:authors ("Alex Chen (fizban007)" . "fizban007@gmail.com") ("Simon Lin (Simon-Lin)" . "n.sibetz@gmail.com")) (:maintainer "Alex Chen (fizban007)" . "fizban007@gmail.com") (:keywords "bib" "convenience" "hypermedia") (:url . "https://github.com/fizban007/arxiv-mode"))])
+ (ascii-table . [(20201019 700) ((emacs (24 3)) (cl-lib (0 5))) "Interactive ASCII table" single ((:commit . "4f68ad0b36c365c0652756691ab1703d0d46b4b4") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "help" "tools") (:url . "https://github.com/lassik/emacs-ascii-table"))])
+ (asilea . [(20150105 1525) ((emacs (24)) (cl-lib (0 5))) "Find best compiler options using simulated annealing" single ((:commit . "2aab1cc63b64ef08d12e84fd7ba5c94065f6039f") (:authors ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Fanael Linithien" . "fanael4@gmail.com") (:url . "https://github.com/Fanael/asilea"))])
+ (asm-blox . [(20220124 1430) ((emacs (26 1)) (yaml (0 3 4))) "Programming game involving WAT and YAML" tar ((:commit . "47aa63d320c39f8566a8d95c61f27383f561b001") (:authors ("Zachary Romero")) (:maintainer "Zachary Romero") (:keywords "games") (:url . "https://github.com/zkry/asm-blox"))])
+ (asn1-mode . [(20170729 226) ((emacs (24 3)) (s (1 10 0))) "ASN.1/GDMO mode for GNU Emacs" single ((:commit . "d5d4a8259daf708411699bcea85d322f18beb972") (:authors ("Taichi Kawabata <kawabata.taichi_at_gmail.com>")) (:maintainer "Taichi Kawabata <kawabata.taichi_at_gmail.com>") (:keywords "languages" "processes" "tools") (:url . "https://github.com/kawabata/asn1-mode/"))])
+ (assess . [(20200211 1817) ((emacs (24 4)) (m-buffer (0 15))) "Test support functions" tar ((:commit . "5bac045b273623772b6a2d820997d50f7ab4e466") (:authors ("Phillip Lord" . "phillip.lord@russet.org.uk")) (:maintainer "Phillip Lord" . "phillip.lord@russet.org.uk"))])
+ (astyle . [(20200328 616) ((emacs (24 4)) (reformatter (0 3))) "Astyle formatter functions" single ((:commit . "04ff2941f08c4b731fe6a18ee1697436d1ca1cc0") (:authors ("Petter Storvik")) (:maintainer "Petter Storvik") (:keywords "astyle" "c" "c++" "cpp" "reformatter") (:url . "https://github.com/storvik/emacs-astyle"))])
+ (asx . [(20191024 1100) ((emacs (26 1))) "Ask StackExchange/StackOverflow" single ((:commit . "ec4bf74de602b97df1f306d51acf4cda45184aac") (:authors ("Alex Ragone" . "ragonedk@gmail.com")) (:maintainer "Alex Ragone" . "ragonedk@gmail.com") (:keywords "convenience") (:url . "https://github.com/ragone/asx"))])
+ (async . [(20220318 1342) ((emacs (24 4))) "Asynchronous processing in Emacs" tar ((:commit . "c78bab7506a70a735d2c3deab13fa87bf44a83d3") (:authors ("John Wiegley" . "jwiegley@gmail.com")) (:maintainer "Thierry Volpiatto" . "thievol@posteo.net") (:keywords "async") (:url . "https://github.com/jwiegley/emacs-async"))])
+ (async-await . [(20200117 828) ((emacs (25 1)) (promise (1 1)) (iter2 (0 9 10))) "Async/Await" single ((:commit . "deef2bb343463f5196545f1dd8c2a32d0cb3b146") (:authors ("chuntaro" . "chuntaro@sakura-games.jp")) (:maintainer "chuntaro" . "chuntaro@sakura-games.jp") (:keywords "async" "await" "convenience") (:url . "https://github.com/chuntaro/emacs-async-await"))])
+ (async-backup . [(20220131 1438) ((emacs (24 4))) "Backup on each save without freezing Emacs" single ((:commit . "6ddb39fe77d66cdef48b87cb0d0554ad7d132308") (:authors ("contrapunctus" . "xmpp:contrapunctus@jabjab.de")) (:maintainer "contrapunctus" . "xmpp:contrapunctus@jabjab.de") (:keywords "files") (:url . "https://tildegit.org/contrapunctus/async-backup"))])
+ (atcoder-tools . [(20200109 1236) ((emacs (26)) (f (0 20)) (s (1 12))) "An atcoder-tools client" single ((:commit . "cfe61ed18ea9b3b1bfb6f9e7d80a47599680cd1f") (:authors ("Seong Yong-ju" . "sei40kr@gmail.com")) (:maintainer "Seong Yong-ju" . "sei40kr@gmail.com") (:keywords "extensions" "tools") (:url . "https://github.com/sei40kr/atcoder-tools"))])
+ (atl-long-lines . [(20201026 339) ((emacs (24 3))) "Turn off truncate-lines when the line is long" single ((:commit . "43ca538ecece4e14bb9bcd887854aeb14b3d45f4") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/atl-long-lines"))])
+ (atl-markup . [(20210731 609) ((emacs (24 3))) "Automatically truncate lines for markup languages" single ((:commit . "e0d11744d9b2bca780322b1b282fb5ffb18cfd75") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/atl-markup"))])
+ (atom-dark-theme . [(20220114 1902) nil "An Emacs port of the Atom Dark theme from Atom.io." single ((:commit . "2b3c7ad42bbcab3214a131f8957b92e717b36ad3") (:authors ("Jeremy Whitlock" . "jwhitlock@apache.org")) (:maintainer "Jeremy Whitlock" . "jwhitlock@apache.org") (:keywords "themes" "atom" "dark") (:url . "https://github.com/whitlockjc/atom-dark-theme-emacs"))])
+ (atom-one-dark-theme . [(20210128 1640) nil "Atom One Dark color theme" single ((:commit . "b34b62e85593812b55ee552a1cb0eecfb04767bb") (:authors ("Jonathan Chu" . "me@jonathanchu.is")) (:maintainer "Jonathan Chu" . "me@jonathanchu.is") (:url . "https://github.com/jonathanchu/atom-one-dark-theme"))])
+ (atomic-chrome . [(20210221 59) ((emacs (24 4)) (let-alist (1 0 4)) (websocket (1 4))) "Edit Chrome text area with Emacs using Atomic Chrome" single ((:commit . "c73367d8aa660f2b3c3f70ef5c39f5b502d60404") (:authors ("alpha22jp" . "alpha22jp@gmail.com")) (:maintainer "alpha22jp" . "alpha22jp@gmail.com") (:keywords "chrome" "edit" "textarea") (:url . "https://github.com/alpha22jp/atomic-chrome"))])
+ (attrap . [(20220124 1253) ((dash (2 12 0)) (emacs (25 1)) (f (0 19 0)) (flycheck (0 30)) (s (1 11 0))) "ATtempt To Repair At Point" single ((:commit . "19a520ecb99529790906a1fb5599acdf2b4f005f") (:authors ("Jean-Philippe Bernardy" . "jeanphilippe.bernardy@gmail.com")) (:maintainer "Jean-Philippe Bernardy" . "jeanphilippe.bernardy@gmail.com") (:keywords "programming" "tools") (:url . "https://github.com/jyp/attrap"))])
+ (auctex-cluttex . [(20210226 302) ((emacs (24 4)) (auctex (12 2))) "ClutTeX support for AUCTeX" single ((:commit . "9a15742a6de1285831329eac93f9e35752472685") (:authors ("Masahiro Nakamura" . "tsuucat@icloud.com")) (:maintainer "Masahiro Nakamura" . "tsuucat@icloud.com") (:keywords "tex") (:url . "https://github.com/tsuu32/auctex-cluttex"))])
+ (auctex-latexmk . [(20170618 1636) ((auctex (11 87))) "Add LatexMk support to AUCTeX" single ((:commit . "4d353522650d7685acbf1d38f7dbc504f734bd84") (:authors ("Tomoya Tanjo" . "ttanjo@gmail.com")) (:maintainer "Tomoya Tanjo" . "ttanjo@gmail.com") (:keywords "tex") (:url . "https://github.com/tom-tan/auctex-latexmk/"))])
+ (auctex-lua . [(20151121 1610) ((auctex (11 86)) (lua-mode (20130419))) "Lua editing support for AUCTeX" single ((:commit . "799cd8ac10c96991bb63d9aa60528ae5d8c786b5") (:authors ("Sean Allred" . "seallred@smcm.edu")) (:maintainer "Sean Allred" . "seallred@smcm.edu") (:keywords "latex" "lua") (:url . "http://github.com/vermiculus/auctex-lua"))])
+ (audacious . [(20210917 51) ((helm (3 6 2)) (emacs (24 4))) "Emacs interface to control audacious" single ((:commit . "65c37f12a5c774a0ae434beee27ff7737006dd2f") (:authors ("Hitoshi Uchida" . "hitoshi.uchida@gmail.com")) (:maintainer "Hitoshi Uchida" . "hitoshi.uchida@gmail.com") (:url . "https://github.com/shishimaru/audacious.el"))])
+ (audio-notes-mode . [(20170611 2159) nil "Play audio notes synced from somewhere else." single ((:commit . "fa38350829c7e97257efc746a010471d33748a68") (:authors ("Artur Malabarba" . "bruce.connor.am@gmail.com")) (:maintainer "Artur Malabarba" . "bruce.connor.am@gmail.com") (:keywords "hypermedia" "convenience") (:url . "http://github.com/Bruce-Connor/audio-notes-mode"))])
+ (aurel . [(20170114 937) ((emacs (24 3)) (bui (1 1 0)) (dash (2 11 0))) "Search, get info, vote for and download AUR packages" single ((:commit . "fc7ad208f43f8525f84a18941c9b55f956df8961") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "tools") (:url . "https://github.com/alezost/aurel"))])
+ (aurora-config-mode . [(20180216 2302) nil "Major mode for Apache Aurora configuration files" single ((:commit . "8273ec7937a21b469b9dbb6c11714255b890f410") (:authors ("Berk D. Demir" . "bdd@mindcast.org")) (:maintainer "Berk D. Demir" . "bdd@mindcast.org") (:keywords "languages" "configuration") (:url . "https://github.com/bdd/aurora-config.el"))])
+ (auth-source-keytar . [(20220222 640) ((emacs (24 4)) (keytar (0 1 2)) (s (1 12 0))) "Integrate auth-source with keytar" single ((:commit . "5c6f0952f28ce722f4a75139f3dc1afc99e12396") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/emacs-grammarly/auth-source-keytar"))])
+ (auth-source-kwallet . [(20210605 1032) ((emacs (24 4))) "KWallet integration for auth-source" single ((:commit . "053ed5e964acaf6f16a1708c36d812eeb7c1817d") (:authors ("Ekaterina Vaartis" . "vaartis@kotobank.ch")) (:maintainer "Ekaterina Vaartis" . "vaartis@kotobank.ch") (:url . "https://github.com/vaartis/auth-source-kwallet"))])
+ (auth-source-xoauth2 . [(20200911 1554) ((emacs (26 1))) "Integrate auth-source with XOAUTH2" single ((:commit . "d3890eaa3a46dc89758ec6b789949e70ae782896") (:authors ("Cesar Crusius" . "ccrusius@google.com")) (:maintainer "Cesar Crusius" . "ccrusius@google.com") (:url . "https://github.com/ccrusius/auth-source-xoauth2"))])
+ (auto-async-byte-compile . [(20160916 454) nil "Automatically byte-compile when saved" single ((:commit . "8681e74ddb8481789c5dbb3cafabb327db4c4484") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "lisp" "convenience") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/auto-async-byte-compile.el"))])
+ (auto-auto-indent . [(20131106 1903) ((es-lib (0 1)) (cl-lib (1 0))) "Indents code as you type" single ((:commit . "0139378577f936d34b20276af6f022fb457af490") (:authors ("sabof")) (:maintainer "sabof") (:url . "https://github.com/sabof/auto-auto-indent"))])
+ (auto-compile . [(20220422 1600) ((emacs (25 1)) (compat (28 1 1 0)) (packed (3 0 3))) "Automatically compile Emacs Lisp libraries" single ((:commit . "16de66c381dab3c1fb7bc248e0f81ef68966bd7d") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "compile" "convenience" "lisp") (:url . "https://github.com/emacscollective/auto-compile"))])
+ (auto-complete . [(20220105 439) ((popup (0 5 0)) (cl-lib (0 5))) "Auto Completion for GNU Emacs" tar ((:commit . "d546b18c3e83e38686d9b7316c6c705597e1a8b3") (:authors ("Tomohiro Matsuyama" . "m2ym.pub@gmail.com")) (:maintainer "Jen-Chieh Shen" . "jcs090218@gmail.com") (:keywords "completion" "convenience") (:url . "https://github.com/auto-complete/auto-complete"))])
+ (auto-complete-auctex . [(20140223 1758) ((yasnippet (0 6 1)) (auto-complete (1 4))) "auto-completion for auctex" single ((:commit . "855633f668bcc4b9408396742a7cb84e0c4a2f77") (:authors ("Christopher Monsanto" . "chris@monsan.to")) (:maintainer "Christopher Monsanto" . "chris@monsan.to"))])
+ (auto-complete-c-headers . [(20150912 323) ((auto-complete (1 4))) "An auto-complete source for C/C++ header files" single ((:commit . "52fef720c6f274ad8de52bef39a343421006c511") (:authors ("Masafumi Oyamada" . "stillpedant@gmail.com")) (:maintainer "Masafumi Oyamada" . "stillpedant@gmail.com") (:keywords "c"))])
+ (auto-complete-chunk . [(20140225 946) ((auto-complete (1 4))) "Auto-completion for dot.separated.words." single ((:commit . "a9aa77ffb84a1037984a7ce4dda25074272f13fe") (:authors ("ARAKAKI, Takafumi")) (:maintainer "ARAKAKI, Takafumi") (:url . "https://github.com/tkf/auto-complete-chunk"))])
+ (auto-complete-clang . [(20140409 752) ((auto-complete (1 3 1))) "Auto Completion source for clang for GNU Emacs" single ((:commit . "a195db1d0593b4fb97efe50885e12aa6764d998c") (:authors ("Brian Jiang" . "brianjcj@gmail.com")) (:maintainer "Brian Jiang" . "brianjcj@gmail.com") (:keywords "completion" "convenience") (:url . "https://github.com/brianjcj/auto-complete-clang"))])
+ (auto-complete-clang-async . [(20130526 1514) nil "Auto Completion source for clang for GNU Emacs" single ((:commit . "5d9c5cabbb6b31e0ac3637631c0c8b25184aa8b4") (:keywords "completion" "convenience"))])
+ (auto-complete-distel . [(20180827 1344) ((auto-complete (1 4)) (distel-completion-lib (1 0 0))) "Erlang/distel completion backend for auto-complete-mode" single ((:commit . "acc4c0a5521904203d797fe96b08e5fae4233c7e") (:authors ("Sebastian Weddmark Olsson")) (:maintainer "Sebastian Weddmark Olsson") (:keywords "erlang" "distel" "auto-complete") (:url . "github.com/sebastiw/distel-completion"))])
+ (auto-complete-exuberant-ctags . [(20140320 724) ((auto-complete (1 4 0))) "Exuberant ctags auto-complete.el source" single ((:commit . "ff6121ff8b71beb5aa606d28fd389c484ed49765") (:authors ("Kenichirou Oyama" . "k1lowxb@gmail.com")) (:maintainer "Kenichirou Oyama" . "k1lowxb@gmail.com") (:keywords "anto-complete" "exuberant ctags") (:url . "http://code.101000lab.org"))])
+ (auto-complete-nxml . [(20140221 458) ((auto-complete (1 4))) "do completion by auto-complete.el on nXML-mode" single ((:commit . "ac7b09a23e45f9bd02affb31847263de4180163a") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "completion" "html" "xml") (:url . "https://github.com/aki2o/auto-complete-nxml"))])
+ (auto-complete-pcmp . [(20140227 651) ((auto-complete (1 4 0)) (log4e (0 2 0)) (yaxception (0 1))) "Provide auto-complete sources using pcomplete results" single ((:commit . "2595d3dab1ef3549271ca922f212928e9d830eec") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "completion") (:url . "https://github.com/aki2o/auto-complete-pcmp"))])
+ (auto-complete-rst . [(20140225 944) ((auto-complete (1 4))) "Auto-complete extension for ReST and Sphinx" tar ((:commit . "4803ce41a96224e6fa54e6741a5b5f40ebed7351") (:authors ("ARAKAKI, Takafumi")) (:maintainer "ARAKAKI, Takafumi") (:url . "https://github.com/tkf/auto-complete-rst"))])
+ (auto-complete-sage . [(20160514 751) ((auto-complete (1 5 1)) (sage-shell-mode (0 1 0))) "An auto-complete source for sage-shell-mode." single ((:commit . "51b8e3905196d266e1f8aa47881189833151b398") (:authors ("Sho Takemori" . "stakemorii@gmail.com")) (:maintainer "Sho Takemori" . "stakemorii@gmail.com") (:keywords "sage" "math" "auto-complete") (:url . "https://github.com/stakemori/auto-complete-sage"))])
+ (auto-dark . [(20220320 1703) ((emacs (24 4))) "Automatically set the dark-mode theme based on MacOS status" single ((:commit . "c5dd3afa6771f4777db9e427f21bfcbe4883abaf") (:authors ("Rahul M. Juliato") ("Tim Harper <timcharper at gmail dot com>")) (:maintainer "Rahul M. Juliato") (:keywords "tools" "unix" "faces") (:url . "https://github.com/LionyxML/auto-dark-emacs"))])
+ (auto-dictionary . [(20150410 1610) nil "automatic dictionary switcher for flyspell" single ((:commit . "b364e08009fe0062cf0927d8a0582fad5a12b8e7") (:authors ("Nikolaj Schumacher <bugs * nschum de>")) (:maintainer "Nikolaj Schumacher <bugs * nschum de>") (:keywords "wp") (:url . "http://nschum.de/src/emacs/auto-dictionary/"))])
+ (auto-dim-other-buffers . [(20220209 2101) nil "Makes windows without focus less prominent" single ((:commit . "33b5f88b799a17947c266b04ad59462c5aeb4ed7") (:authors ("Michal Nazarewicz" . "mina86@mina86.com")) (:maintainer "Michal Nazarewicz" . "mina86@mina86.com") (:url . "https://github.com/mina86/auto-dim-other-buffers.el"))])
+ (auto-highlight-symbol . [(20220505 505) ((emacs (26 1)) (ht (2 3))) "Automatic highlighting current symbol minor mode" single ((:commit . "e31a2d2bb97ffcbeb493f3501311b30c3f10952f") (:authors ("Mitsuo Saito" . "arch320@NOSPAM.gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:keywords "highlight" "face" "match" "convenience") (:url . "http://github.com/jcs-elpa/auto-highlight-symbol"))])
+ (auto-indent-mode . [(20211029 11) nil "Auto indent Minor mode" tar ((:commit . "664006b67329a8e27330541547f8c2187dab947c") (:authors ("Matthew L. Fidler, Le Wang & Others")) (:maintainer "Matthew L. Fidler") (:keywords "auto" "indentation") (:url . "https://github.com/mlf176f2/auto-indent-mode.el/"))])
+ (auto-minor-mode . [(20180527 1123) ((emacs (24 4))) "Enable minor modes by file name and contents" single ((:commit . "17cfa1b54800fdef2975c0c0531dad34846a5065") (:authors ("Joe Wreschnig" . "joe.wreschnig@gmail.com")) (:maintainer "Joe Wreschnig" . "joe.wreschnig@gmail.com") (:keywords "convenience") (:url . "https://github.com/joewreschnig/auto-minor-mode"))])
+ (auto-org-md . [(20180213 2343) ((emacs (24 4))) "export a markdown file automatically when you save an org-file" single ((:commit . "9318338bdb7fe8bd698d88f3af89b2d6413efdd2") (:authors ("jamcha" . "jamcha.aa@gmail.com")) (:maintainer "jamcha" . "jamcha.aa@gmail.com") (:keywords "org" "markdown") (:url . "https://github.com/jamcha-aa/auto-org-md"))])
+ (auto-package-update . [(20211108 2025) ((emacs (24 4)) (dash (2 1 0))) "Automatically update Emacs packages." single ((:commit . "ad95435fefe2bb501d1d787b08272f9c1b7df488") (:authors ("Renan Ranelli")) (:maintainer "Renan Ranelli") (:keywords "package" "update") (:url . "http://github.com/rranelli/auto-package-update.el"))])
+ (auto-pause . [(20160426 1216) ((emacs (24 4))) "Run processes which will be paused when Emacs is idle" single ((:commit . "a4d778de774ca3895542cb559a953e0d98657338") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "convenience" "menu") (:url . "https://github.com/lujun9972/auto-pause"))])
+ (auto-read-only . [(20200827 1754) ((emacs (25 1)) (cl-lib (0 5))) "Automatically make the buffer to read-only" single ((:commit . "db209bf5b7f76f4c3dc4d0892fc6a24430779f29") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "files" "convenience") (:url . "https://github.com/zonuexe/auto-read-only.el"))])
+ (auto-rename-tag . [(20210805 1344) ((emacs (24 4))) "Automatically rename paired HTML/XML tag" single ((:commit . "85b02fa6ce76ab872c025a82c2f14614af3d89e1") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/auto-rename-tag"))])
+ (auto-save-buffers-enhanced . [(20161109 710) nil "Automatically save buffers in a decent way" single ((:commit . "461e8c816c1b7c650be5f209078b381fe55da8c6") (:authors ("Kentaro Kuribayashi" . "kentarok@gmail.com")) (:maintainer "Kentaro Kuribayashi" . "kentarok@gmail.com"))])
+ (auto-shell-command . [(20180817 1502) ((deferred (20130312)) (popwin (20130329))) "Run the shell command asynchronously that you specified when you save the file." single ((:commit . "a8f9213e3c773b5687b81881240e6e648f2f56ba") (:authors ("ongaeshi")) (:maintainer "ongaeshi") (:keywords "shell" "save" "async" "deferred" "auto"))])
+ (auto-sudoedit . [(20220421 1147) ((emacs (26 1)) (f (0 19 0))) "Auto sudo edit by tramp" single ((:commit . "39cb574a4b5ec74ad62857320bf5fec58abe876f") (:authors ("ncaq" . "ncaq@ncaq.net")) (:maintainer "ncaq" . "ncaq@ncaq.net") (:url . "https://github.com/ncaq/auto-sudoedit"))])
+ (auto-virtualenv . [(20211215 907) ((cl-lib (0 5)) (pyvenv (1 9)) (s (1 10 0))) "Auto activate python virtualenvs" single ((:commit . "07064e05feb62277991b8a7c04f7cdad50acaddf") (:authors ("Marcwebbie" . "marcwebbie@gmail.com")) (:maintainer "Marcwebbie" . "marcwebbie@gmail.com") (:keywords "python" "virtualenv" "tools") (:url . "http://github.com/marcwebbie/auto-virtualenv"))])
+ (auto-virtualenvwrapper . [(20200510 1006) ((cl-lib (0 6)) (s (1 10 0)) (virtualenvwrapper (0))) "Lightweight auto activate python virtualenvs" single ((:commit . "30fb54aa3c99f3c614ea9a92669d634df30c9439") (:authors ("Marcwebbie" . "marcwebbie@gmail.com") ("Robert Zaremba" . "robert-zaremba@scale-it.pl")) (:maintainer "Marcwebbie" . "marcwebbie@gmail.com") (:keywords "python" "virtualenv" "tools"))])
+ (auto-yasnippet . [(20191015 942) ((yasnippet (0 13 0))) "Quickly create disposable yasnippets" single ((:commit . "db9e0dd4335b2202cd5dac95bbbc87a1032d9bbe") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:url . "https://github.com/abo-abo/auto-yasnippet"))])
+ (autobookmarks . [(20220509 1712) ((dash (2 10 0)) (cl-lib (0 5))) "Save recently visited files and buffers" single ((:commit . "8acd6f182181e23257e01c1b5cf90b872507a74d") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "files"))])
+ (autobuild . [(20200713 227) ((cl-lib (0 3)) (emacs (26 1))) "Define and execute build rules and compilation pipelines" single ((:commit . "9b068d979bad78aba8e8bef9f9e7c3bfecb34d2d") (:authors ("Ernesto Alfonso")) (:maintainer nil . "(concat \"erjoalgo\" \"@\" \"gmail\" \".com\")") (:keywords "compile" "build" "pipeline" "autobuild" "extensions" "processes" "tools") (:url . "https://github.com/erjoalgo/autobuild"))])
+ (autocrypt . [(20220215 1204) ((emacs (24 3))) "Autocrypt implementation" tar ((:commit . "c439cbe029f7ffeca6de0ea72258069c41350509") (:authors ("Philip Kaludercic" . "philipk@posteo.net")) (:maintainer "Philip Kaludercic" . "~pkal/public-inbox@lists.sr.ht") (:keywords "comm") (:url . "https://git.sr.ht/~pkal/autocrypt"))])
+ (autodisass-java-bytecode . [(20211005 1920) nil "Automatically disassemble Java bytecode" tar ((:commit . "9eaddd63645e64825b2d07805999c5a645248c53") (:authors ("George Balatsouras <gbalats(at)gmail(dot)com>")) (:maintainer "George Balatsouras <gbalats(at)gmail(dot)com>") (:keywords "convenience" "data" "files"))])
+ (autodisass-llvm-bitcode . [(20150411 125) nil "Automatically disassemble LLVM bitcode" tar ((:commit . "d2579e3a1427af2dc947c343e49eb3434078bf04") (:authors ("George Balatsouras <gbalats(at)gmail(dot)com>")) (:maintainer "George Balatsouras <gbalats(at)gmail(dot)com>") (:keywords "convenience" "data" "files"))])
+ (autotest . [(20190331 2230) nil "ZenTest's autotest integration with emacs." single ((:commit . "09166f32d3ece2b297da036f0abbeba63329580e") (:authors ("Ryan Davis" . "ryand-ruby@zenspider.com")) (:maintainer "Ryan Davis" . "ryand-ruby@zenspider.com") (:keywords "testing" "ruby" "convenience") (:url . "https://github.com/zenspider/elisp/blob/master/autotest.el"))])
+ (autotetris-mode . [(20141114 1646) ((cl-lib (0 5))) "automatically play tetris" single ((:commit . "0c3a746dcc304a67d2a6e7ad4ef93f512486343a") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/autotetris-mode"))])
+ (autothemer . [(20220106 416) ((dash (2 10 0)) (emacs (24)) (cl-lib (0 5))) "Conveniently define themes." single ((:commit . "1dbc06ad430c51b5ec1a602a808ee46b9bd4bafa") (:authors ("Sebastian Sturm")) (:maintainer "Sebastian Sturm") (:url . "https://github.com/sebastiansturm/autothemer"))])
+ (autumn-light-theme . [(20150515 1447) nil "A light color theme with muted, autumnal colors." single ((:commit . "1e3b2a43a3001e4a97a5ff073ba3f0d2ea3888f9") (:authors ("Adam Alpern" . "adam.alpern@gmail.com")) (:maintainer "Adam Alpern" . "adam.alpern@gmail.com") (:keywords "color" "theme") (:url . "http://github.com/aalpern/emacs-color-theme-autumn-light"))])
+ (avandu . [(20170101 1903) nil "Gateway to Tiny Tiny RSS" tar ((:commit . "f44588d8e747fa880411cb4542cc39962252b90a") (:authors ("Tom Willemse" . "tom@ryuslash.org")) (:maintainer "Tom Willemse" . "tom@ryuslash.org") (:keywords "net"))])
+ (avk-emacs-themes . [(20210521 1051) nil "Collection of avk themes" tar ((:commit . "7b9b6517873c4d4d73e6e34ca56c54062db60759") (:authors ("Alex V. Koval" . "alex@koval.kharkov.ua")) (:maintainer "Alex V. Koval" . "alex@koval.kharkov.ua") (:keywords "theme") (:url . "https://github.com/avkoval/avk-emacs-themes"))])
+ (avy . [(20220102 805) ((emacs (24 1)) (cl-lib (0 5))) "Jump to arbitrary positions in visible text and select text quickly." single ((:commit . "ba5f035be33693d1a136a5cbeedb24327f551a92") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "point" "location") (:url . "https://github.com/abo-abo/avy"))])
+ (avy-embark-collect . [(20220221 1638) ((emacs (25 1)) (embark (0 9)) (avy (0 5))) "Use avy to jump to Embark Collect entries" single ((:commit . "81c7f751be1de33dee9f7523fd3429ee3fe9a0d1") (:authors ("Omar Antolín Camarena" . "omar@matem.unam.mx")) (:maintainer "Omar Antolín Camarena" . "omar@matem.unam.mx") (:keywords "convenience") (:url . "https://github.com/oantolin/embark"))])
+ (avy-flycheck . [(20160720 1500) ((emacs (24 1)) (flycheck (0 14)) (seq (1 11)) (avy (0 4 0))) "Jump to and fix syntax errors using `flycheck' with `avy' interface" single ((:commit . "5522f3bbbed1801d9278ed696ec0cbba38352985") (:authors ("Xu Ma" . "magicdirac@gmail.com")) (:maintainer "Xu Ma" . "magicdirac@gmail.com") (:keywords "tools" "convenience" "avy" "flycheck") (:url . "https://github.com/magicdirac/avy-flycheck"))])
+ (avy-menu . [(20210321 1732) ((emacs (24 3)) (avy (0 4 0))) "Library providing avy-powered popup menu" single ((:commit . "18bb320f395b7e412f7e377cf4c46d205d4b4e1a") (:authors ("Mark Karpov" . "markkarpov92@gmail.com")) (:maintainer "Mark Karpov" . "markkarpov92@gmail.com") (:keywords "popup" "menu") (:url . "https://github.com/mrkkrp/avy-menu"))])
+ (avy-migemo . [(20180716 1455) ((emacs (24 4)) (avy (0 4 0)) (migemo (1 9))) "avy with migemo" tar ((:commit . "922a6dd82c0bfa316b0fbb56a9d4dd4ffa5707e7") (:authors ("momomo5717")) (:maintainer "momomo5717") (:keywords "avy" "migemo") (:url . "https://github.com/momomo5717/avy-migemo"))])
+ (avy-zap . [(20190801 329) ((avy (0 2 0))) "Zap to char using `avy'" single ((:commit . "7c8d1f40e43d03e2f6c1696bfa547526528ce8cb") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions") (:url . "https://github.com/cute-jumper/avy-zap"))])
+ (aws-ec2 . [(20161007 1914) ((emacs (24 4)) (dash (2 12 1)) (tblui (0 1 0))) "Manage AWS EC2 instances" single ((:commit . "5601d4f268fc34b86a02ca90cde7d3771619a368") (:authors ("Yuki Inoue <inouetakahiroki _at_ gmail.com>")) (:maintainer "Yuki Inoue <inouetakahiroki _at_ gmail.com>") (:url . "https://github.com/Yuki-Inoue/aws.el"))])
+ (aws-snippets . [(20191203 1553) ((yasnippet (0 8 0))) "Yasnippets for AWS" tar ((:commit . "557d19a0bc486e0fddb597b2be5087769d9bd47e") (:keywords "snippets"))])
+ (awscli-capf . [(20190930 1517) ((emacs (26))) "Completion at point function for the AWS CLI" single ((:commit . "eadfb26b35802ae8164565581e4a9c4d0280a7b5") (:authors ("Sebastian Monia" . "smonia@outlook.com")) (:maintainer "Sebastian Monia" . "smonia@outlook.com") (:keywords "tools" "convenience" "abbrev") (:url . "https://github.com/sebasmonia/awscli-capf.git"))])
+ (axe . [(20210816 1530) ((emacs (25 1)) (hmac (0 0)) (request (0 3 2)) (s (1 12 0)) (xmlgen (0 5)) (dash (2 17 0)) (mimetypes (1 0))) "AWS Extensions" tar ((:commit . "eb4a5b3b06c3cbed521e2c0e0985941c367f4e74") (:authors ("Craig Niles <niles.c at gmail.com>")) (:maintainer "Craig Niles <niles.c at gmail.com>") (:url . "https://github.com/cniles/axe"))])
+ (axiom-environment . [(20211120 1646) ((emacs (24 2))) "An environment for using Axiom/OpenAxiom/FriCAS" tar ((:commit . "e60de5ed107ffeb530a56d24d04f38988124d12b") (:authors ("Paul Onions" . "paul.onions@acm.org")) (:maintainer "Paul Onions" . "paul.onions@acm.org") (:keywords "axiom" "openaxiom" "fricas"))])
+ (ayu-theme . [(20200521 1157) ((emacs (24 1))) "Ayu theme" tar ((:commit . "ed98a9f41d9f0e08458ee71cc1038f66c50e1979") (:authors ("Tran Anh Vu")) (:maintainer "Tran Anh Vu") (:keywords "lisp" "theme" "emacs") (:url . "https://github.com/vutran1710/Ayu-Theme-Emacs"))])
+ (babel . [(20210612 640) nil "interface to web translation services such as Babelfish" single ((:commit . "946e69c61188bc41793402ac48466d8967ddb43d") (:authors ("Juergen Hoetzel" . "juergen@hoetzel.info") ("Eric Marsden" . "emarsden@laas.fr")) (:maintainer "Juergen Hoetzel" . "juergen@hoetzel.info") (:keywords "translation" "web") (:url . "http://github.com/juergenhoetzel/babel"))])
+ (babel-repl . [(20160504 2201) ((emacs (24))) "Run babel REPL" single ((:commit . "e619c16e349a1ee7bd0ee0d7f3650d33bff73fc3") (:authors ("Hung Phan")) (:maintainer "Hung Phan") (:keywords "babel" "javascript" "es6") (:url . "https://github.com/hung-phan/babel-repl/"))])
+ (back-button . [(20150804 2004) ((nav-flash (1 0 0)) (smartrep (0 0 3)) (ucs-utils (0 7 2)) (list-utils (0 4 2)) (persistent-soft (0 8 8)) (pcache (0 2 3))) "Visual navigation through mark rings" single ((:commit . "98d92984a740acd1547bd7ed05cca0affdb21c3e") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "convenience" "navigation" "interface") (:url . "http://github.com/rolandwalker/back-button"))])
+ (backlight . [(20210513 129) ((emacs (24 3))) "backlight brightness adjustment on GNU/Linux" single ((:commit . "b6826a60440d8bf440618e3cdafb40158de920e6") (:authors ("Michael Schuldt" . "mbschuldt@gmail.com")) (:maintainer "Michael Schuldt" . "mbschuldt@gmail.com") (:keywords "hardware") (:url . "https://github.com/mschuldt/backlight.el"))])
+ (backline . [(20220424 2212) ((emacs (25 1)) (compat (28 1 1 0)) (outline-minor-faces (0 1 2))) "Preserve appearance of outline headings" single ((:commit . "edc5f1e8ca049c06d18d703479c4737f3530602e") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "outlines") (:url . "https://github.com/tarsius/backline"))])
+ (backup-each-save . [(20180227 557) nil "backup each savepoint of a file" single ((:commit . "3c414b9d6b278911c95c5b8b71819e6af6f8a02a") (:authors ("Benjamin Rutt" . "brutt@bloomington.in.us")) (:maintainer "Conor Nash" . "conor@nashcobusinessservicesllc.com"))])
+ (backup-walker . [(20130720 1516) nil "quickly traverse all backups of a file" single ((:commit . "934a4128c122972ac32bb9952addf279a60a94da") (:authors ("Le Wang")) (:maintainer "Le Wang") (:keywords "backup") (:url . "https://github.com/lewang/backup-walker"))])
+ (backward-forward . [(20161229 550) ((emacs (24 5))) "navigation backwards and forwards across marks" single ((:commit . "58489957a62a0da25dfb5df902624d2548d800b4") (:authors ("Currell Berry" . "currellberry@gmail.com")) (:maintainer "Currell Berry" . "currellberry@gmail.com") (:keywords "navigation" "convenience" "backward" "forward") (:url . "https://gitlab.com/vancan1ty/emacs-backward-forward/tree/master"))])
+ (badger-theme . [(20140717 232) nil "A dark theme for Emacs 24." single ((:commit . "493d672d5a5478976da7d5ca752008cc7837c57f") (:authors ("Cody Canning" . "cocanning11@gmail.com")) (:maintainer "Cody Canning" . "cocanning11@gmail.com") (:url . "https://github.com/ccann/badger-theme"))])
+ (badwolf-theme . [(20161004 715) ((emacs (24))) "Bad Wolf color theme" single ((:commit . "ea01a3d9358e968f75e3ed15dec6a2a96ce3d9a1") (:authors ("bkruczyk" . "bartlomiej.kruczyk@gmail.com")) (:maintainer "bkruczyk" . "bartlomiej.kruczyk@gmail.com") (:keywords "themes") (:url . "https://github.com/bkruczyk/badwolf-emacs"))])
+ (baff . [(20200824 1807) ((emacs (24 3)) (f (0 20 0))) "Create a byte array from a file" single ((:commit . "7af72db9c6e542ed2b60952933113d0aa86728cf") (:authors ("Dave Footitt" . "dave.footitt@gmail.com")) (:maintainer "Dave Footitt" . "dave.footitt@gmail.com") (:keywords "convenience" "usability") (:url . "https://github.com/dave-f/baff/"))])
+ (baidu-translate . [(20211130 1235) ((unicode-escape (1 1))) "A plugin using baidu-translate-api" single ((:commit . "16101d5e6ce19bbcc8badf4422a95db457160999") (:authors (nil . "<LiShizhen gsu4017@gmail.com>")) (:maintainer nil . "<LiShizhen gsu4017@gmail.com>") (:keywords "docs") (:url . "https://github.com/liShiZhensPi/baidu-translate"))])
+ (balanced-windows . [(20190903 1120) ((emacs (25))) "Keep windows balanced" single ((:commit . "1da5354ad8a9235d13928e2ee0863f3642ccdd13") (:authors ("wouter bolsterlee" . "wouter@bolsterl.ee")) (:maintainer "wouter bolsterlee" . "wouter@bolsterl.ee") (:keywords "convenience") (:url . "https://github.com/wbolster/emacs-balanced-windows"))])
+ (banner-comment . [(20190606 1809) ((emacs (24 4))) "For producing banner comments." single ((:commit . "35d3315683d3f97605207691b77e9f447af18fe2") (:authors ("James Ferguson" . "james@faff.org")) (:maintainer "James Ferguson" . "james@faff.org") (:keywords "convenience") (:url . "https://github.com/WJCFerguson/banner-comment"))])
+ (bap-mode . [(20200128 1354) nil "Major-mode for BAP's IR" single ((:commit . "8969679f60db0aa918d35f40d959c0a9c723b111") (:authors ("Thomas Barabosch <http://github/tbarabosch>")) (:maintainer "Thomas Barabosch" . "thomas.barabosch@fkie.fraunhofer.de") (:keywords "languages") (:url . "https://github.com/fkie-cad/bap-mode"))])
+ (bar-cursor . [(20201204 2244) nil "package used to switch block cursor to a bar" single ((:commit . "78f195b6db63459033c4f1c7e7add5d82f3ce424") (:authors ("Joe Casadonte" . "emacs@northbound-train.com")) (:maintainer "Andrew Johnson" . "andrew@andrewjamesjohnson.com") (:keywords "files") (:url . "https://github.com/ajsquared/bar-cursor"))])
+ (bart-mode . [(20190601 1004) ((emacs (24 3))) "Real time BART departures info." single ((:commit . "f70b6c42452e47c0c6b3ebd4c90e555a9bedeec7") (:authors ("Michael Schuldt" . "mbschuldt@gmail.com")) (:maintainer "Michael Schuldt" . "mbschuldt@gmail.com") (:keywords "convenience" "transit") (:url . "https://github.com/mschuldt/bart-mode"))])
+ (base16-theme . [(20220510 423) nil "Collection of themes built on combinations of 16 base colors" tar ((:commit . "43f3257aaf53e9c50f5db11b81fd66ec41ab2883") (:authors ("Kaleb Elwert" . "belak@coded.io") ("Neil Bhakta")) (:maintainer "Kaleb Elwert" . "belak@coded.io") (:url . "https://github.com/belak/base16-emacs"))])
+ (bash-completion . [(20220328 844) ((emacs (24 3))) "BASH completion for the shell buffer" single ((:commit . "29b5fc860a5b0db9828acfceca09b773fbdb8e8a") (:authors ("Stephane Zermatten" . "szermatt@gmx.net")) (:maintainer "Stephane Zermatten" . "szermatt@gmail.com") (:keywords "shell" "bash" "bash-completion") (:url . "http://github.com/szermatt/emacs-bash-completion"))])
+ (basic-c-compile . [(20170302 1112) ((cl-lib (0 5)) (f (0 19 0))) "Quickly create a Makefile, compile and run C." single ((:commit . "0129786aeee50d7bb0020d9fc2b7508875d403e8") (:authors ("Nick Spain" . "nicholas.spain96@gmail.com")) (:maintainer "Nick Spain" . "nicholas.spain96@gmail.com") (:keywords "c" "makefile" "compilation" "convenience") (:url . "https://github.com/nick96/basic-c-compile"))])
+ (basic-ide . [(20200429 1104) ((emacs (25)) (basic-mode (0 4 2)) (company (0 9 12)) (flycheck (0 22)) (dash (2 12 0)) (f (0 17 0))) "BASIC IDE c64" single ((:commit . "1d026b6ae70db9cde36596dcf46b101058a2e004") (:authors ("Fermin MF" . "fmfs@posteo.net")) (:maintainer "Fermin MF" . "fmfs@posteo.net") (:keywords "languages" "basic") (:url . "https://gitlab.com/sasanidas/emacs-c64-basic-ide"))])
+ (basic-mode . [(20210316 1253) ((seq (2 20)) (emacs (24 3))) "major mode for editing BASIC code" single ((:commit . "eaa5f24d2fb303d9e5d7de2a28c7c18b01532ab6") (:authors ("Johan Dykstrom")) (:maintainer "Johan Dykstrom") (:keywords "basic" "languages") (:url . "https://github.com/dykstrom/basic-mode"))])
+ (basic-theme . [(20160817 827) ((emacs (24))) "Minimalistic light color theme" single ((:commit . "e2a855bd39f4b78296228d4b790f9123156f7d7e") (:authors ("Felix Geller" . "fgeller@gmail.com")) (:maintainer "Felix Geller" . "fgeller@gmail.com") (:keywords "theme" "basic" "minimal" "colors") (:url . "http://github.com/fgeller/basic-theme.el"))])
+ (bats-mode . [(20160514 615) nil "Emacs mode for editing and running Bats tests" single ((:commit . "d519f7c89f5ae17dfc33400596df4564b478315f") (:authors ("Doug MacEachern")) (:maintainer "Doug MacEachern") (:keywords "bats" "tests") (:url . "https://github.com/dougm/bats-mode"))])
+ (battery-notifier . [(20210521 1238) ((alert (1 3))) "Notify when battery capacity is low" single ((:commit . "ae2043db954e131d9de7347ab1a6107fd07e8893") (:authors ("Jason Johnson" . "jason@fullsteamlabs.com")) (:maintainer "Jason Johnson" . "jason@fullsteamlabs.com") (:keywords "hardware" "battery") (:url . "https://github.com/jasonmj/battery-notifier"))])
+ (battle-haxe . [(20210219 354) ((emacs (25)) (company (0 9 9)) (helm (3 0)) (async (1 9 3)) (cl-lib (0 5)) (dash (2 18 0)) (s (1 10 0)) (f (0 19 0))) "A Haxe development system, with code completion and more" single ((:commit . "2f32c81dcecfc68fd410cb9d2aca303d6e3028c7") (:authors ("Alon Tzarafi " . "alontzarafi@gmail.com")) (:maintainer "Alon Tzarafi " . "alontzarafi@gmail.com") (:keywords "programming" "languages" "completion") (:url . "https://github.com/AlonTzarafi/battle-haxe"))])
+ (bazel . [(20220222 1616) ((emacs (26 1))) "Bazel support for Emacs" single ((:commit . "e07a16666154c8ddc65ddaae599d58b25727350d") (:keywords "build tools" "languages") (:url . "https://github.com/bazelbuild/emacs-bazel-mode"))])
+ (bbcode-mode . [(20190304 2122) ((emacs (24)) (cl-lib (0 5))) "Major mode for phpBB posts (BBCode markup)" single ((:commit . "e16619c80ea21154b4a4ccc2e13d0077e97c9caf") (:authors ("Eric James Michael Ritz" . "lobbyjones@gmail.com")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "bbcode" "languages") (:url . "https://github.com/lassik/emacs-bbcode-mode"))])
+ (bbdb . [(20220416 405) nil "The Insidious Big Brother Database for GNU Emacs" tar ((:commit . "ed7648f723d3fd03476b8a007a76e9058f7f7f47") (:maintainer "Roland Winkler" . "winkler@gnu.org"))])
+ (bbdb- . [(20140221 2354) ((bbdb (20140123 1541)) (log4e (0 2 0)) (yaxception (0 1))) "provide interface for more easily search/choice than BBDB." single ((:commit . "2839e84c894de2513af41053e80a277a1b483d22") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "bbdb" "news" "mail") (:url . "https://github.com/aki2o/bbdb-"))])
+ (bbdb-csv-import . [(20140802 1142) ((pcsv (1 3 3)) (dash (2 5 0)) (bbdb (20140412 1949))) "import csv to bbdb version 3+" single ((:commit . "dc9e722d1c1fcd55b71625ee3f05a4921851d186") (:authors ("Ian Kelling" . "ian@iankelling.org")) (:maintainer "Ian Kelling" . "ian@iankelling.org") (:keywords "csv" "util" "bbdb") (:url . "https://gitlab.com/iankelling/bbdb-csv-import"))])
+ (bbdb-ext . [(20151220 2013) ((bbdb (2 36))) "Extra commands for BBDB" single ((:commit . "fee97b1b3faa83edaea00fbc5ad3cbca5e791a55") (:authors ("Joe Bloggs" . "vapniks@yahoo.com")) (:maintainer "Joe Bloggs" . "vapniks@yahoo.com") (:keywords "extensions") (:url . "https://github.com/vapniks/bbdb-ext"))])
+ (bbdb-vcard . [(20210325 2208) ((bbdb (3 0))) "vCard import/export for BBDB" tar ((:commit . "113c66115ce68316e209f51ebce56de8dded3606") (:authors ("Bert Burgemeister" . "trebbu@googlemail.com") ("Toke Høiland-Jørgensen") ("Kevin Brubeck Unhammer") ("Steve Purcell") ("Vincent Geddes" . "vincent.geddes@gmail.com")) (:maintainer "Bert Burgemeister" . "trebbu@googlemail.com") (:keywords "data" "calendar" "mail" "news") (:url . "https://github.com/tohojo/bbdb-vcard"))])
+ (bbdb2erc . [(20190822 907) ((bbdb (3 0))) "make bbdb show if pal is online with ERC, click i to chat" single ((:commit . "40b89e961762af3e7ade3a1844a9fbcd4084ac65") (:authors ("Kevin Brubeck Unhammer" . "unhammer@fsfe.org")) (:maintainer "Kevin Brubeck Unhammer" . "unhammer@fsfe.org") (:keywords "irc" "contacts" "chat" "client" "internet"))])
+ (bbyac . [(20180206 1441) ((browse-kill-ring (1 3)) (cl-lib (0 5))) "Type a little Bit, and Bang! You Are Completed." tar ((:commit . "9f0de9cad13801891ffb590dc09f51ff9a7cb225") (:authors ("Bao Haojun" . "baohaojun@gmail.com")) (:maintainer "Bao Haojun" . "baohaojun@gmail.com") (:keywords "abbrev") (:url . "https://github.com/baohaojun/bbyac"))])
+ (beacon . [(20190104 1931) ((seq (2 14))) "Highlight the cursor whenever the window scrolls" single ((:commit . "bde78180c678b233c94321394f46a81dc6dce1da") (:authors ("Artur Malabarba" . "emacs@endlessparentheses.com")) (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com") (:keywords "convenience") (:url . "https://github.com/Malabarba/beacon"))])
+ (beeminder . [(20201227 1533) ((emacs (24 3)) (seq (2 16)) (org (7))) "Emacs interface for Beeminder" tar ((:commit . "161d9c94c594614a01cb08219693d9e000af4f69") (:authors ("Phil Newton" . "phil@sodaware.net")) (:maintainer "Phil Newton" . "phil@sodaware.net") (:keywords "tools" "beeminder") (:url . "http://www.philnewton.net/code/beeminder-el/"))])
+ (beginend . [(20220409 846) ((emacs (25 3))) "Redefine M-< and M-> for some modes" single ((:commit . "bbcfdc0909c20ddee41e95b7ade7de63af73b220") (:url . "https://github.com/DamienCassou/beginend"))])
+ (belarus-holidays . [(20190102 1343) nil "Belarus holidays whith transfers" single ((:commit . "35a18273e19edc3b4c761030ffbd11116483b83e") (:authors ("Yauhen Makei" . "yauhen.makei@gmail.com")) (:maintainer "Yauhen Makei" . "yauhen.makei@gmail.com") (:url . "http://bitbucket.org/EugeneMakei/belarus-holidays.el"))])
+ (benchmark-init . [(20220414 1612) ((emacs (24 3))) "Benchmarks for require and load calls" tar ((:commit . "02435560415bbadbcf5051fb7042880549170e7e") (:authors ("Steve Purcell")) (:maintainer "David Holm" . "dholmster@gmail.com") (:keywords "convenience" "benchmark") (:url . "https://github.com/dholm/benchmark-init-el"))])
+ (benchstat . [(20171014 312) nil "proper benchmarking made simple" single ((:commit . "a5b67cf7972ca2bbc9f5bc6a0f521ab02b76d4f0") (:authors ("Iskander Sharipov" . "quasilyte@gmail.com")) (:maintainer "Iskander Sharipov" . "quasilyte@gmail.com") (:keywords "lisp") (:url . "https://github.com/Quasilyte/benchstat.el"))])
+ (bencoding . [(20200331 1102) ((emacs (25 1))) "Bencoding decoding and encoding" single ((:commit . "1e16ccfd5c6560a83ae2926afe4a5076a541d3d6") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:keywords "tools") (:url . "https://github.com/xuchunyang/bencoding.el"))])
+ (berrys-theme . [(20191201 1609) ((emacs (24 1))) "A light, clean and elegant theme" single ((:commit . "888a14206b2fb3dc45b5273aeb05075f3e0b5f60") (:authors ("Slava Buzin" . "v8v.buzin@gmail.com")) (:maintainer "Slava Buzin" . "v8v.buzin@gmail.com") (:url . "https://github.com/vbuzin/berrys-theme"))])
+ (bert . [(20131117 1014) nil "BERT serialization library for Emacs" single ((:commit . "a3eec6980a725aa4abd2019e4c00246450260490") (:authors ("Oleksandr Manzyuk" . "manzyuk@gmail.com")) (:maintainer "Oleksandr Manzyuk" . "manzyuk@gmail.com") (:keywords "comm" "data"))])
+ (better-defaults . [(20220116 2220) ((emacs (25 1))) "Fixing weird quirks and poor defaults" single ((:commit . "20ac176ccdc18ff8cb4a6b37cf1fe90fa7f88335") (:authors ("Phil Hagelberg")) (:maintainer "Phil Hagelberg") (:keywords "convenience") (:url . "https://github.com/technomancy/better-defaults"))])
+ (better-jumper . [(20220110 118) ((emacs (25 1))) "configurable jump list" single ((:commit . "47622213783ece37d5337dc28d33b530540fc319") (:authors ("Bryan Gilbert <http://github/gilbertw1>")) (:maintainer "Bryan Gilbert" . "bryan@bryan.sh") (:keywords "convenience" "jump" "history" "evil") (:url . "https://github.com/gilbertw1/better-jumper"))])
+ (better-scroll . [(20210715 1004) ((emacs (24 3))) "Improve user experience when scrolling window" single ((:commit . "f04dad824b9879f7382f36780a0151e4ef544815") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/better-scroll"))])
+ (better-shell . [(20191025 1737) ((emacs (24 4))) "Better shell management" single ((:commit . "70c787b981caeef8c5f8012b170eb7b9f167cd13") (:authors ("Russell Black" . "killdash9@github")) (:maintainer "Russell Black" . "killdash9@github") (:keywords "convenience") (:url . "https://github.com/killdash9/better-shell"))])
+ (bf-mode . [(20130403 1442) nil "Browse file persistently on dired" single ((:commit . "7cc4d09aed64d9db6be95646f5f5067de68f8895") (:authors ("isojin")) (:maintainer "myuhe <yuhei.maeda_at_gmail.com>") (:keywords "convenience") (:url . "https://github.com/emacs-jp/bf-mode"))])
+ (bfbuilder . [(20210228 1740) ((cl-lib (0 3)) (emacs (24 4))) "A brainfuck development environment with interactive debugger" single ((:commit . "689f320a9a1326cdeff43b8538e0d739f8519c4b") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://zk-phi.gitub.io/"))])
+ (bibclean-format . [(20190302 2017) ((emacs (24 3)) (reformatter (0 3))) "Reformat BibTeX and Scribe using bibclean" single ((:commit . "b4003950a925d1c659bc359ab5e88e4441775d77") (:authors ("Peter W. V. Tran-Jørgensen" . "peter.w.v.jorgensen@gmail.com")) (:maintainer "Peter W. V. Tran-Jørgensen" . "peter.w.v.jorgensen@gmail.com") (:keywords "languages") (:url . "https://github.com/peterwvj/bibclean-format"))])
+ (biblio . [(20210418 406) ((emacs (24 3)) (biblio-core (0 2))) "Browse and import bibliographic references from CrossRef, arXiv, DBLP, HAL, Dissemin, and doi.org" tar ((:commit . "517ec18f00f91b61481214b178f7ae0b8fbc499b") (:authors ("Clément Pit-Claudel" . "clement.pitclaudel@live.com")) (:maintainer "Clément Pit-Claudel" . "clement.pitclaudel@live.com") (:keywords "bib" "tex" "convenience" "hypermedia") (:url . "https://github.com/cpitclaudel/biblio.el"))])
+ (biblio-bibsonomy . [(20190105 1200) ((emacs (24 4)) (biblio-core (0 2))) "Lookup bibliographic entries from Bibsonomy" single ((:commit . "778cc944db3c6dababe2e7fec5877fba42e8c00d") (:authors ("Andreas Jansson and contributors")) (:maintainer "Andreas Jansson and contributors") (:keywords "bib" "tex" "bibsonomy") (:url . "http://github.com/andreasjansson/biblio-bibsonomy/"))])
+ (biblio-core . [(20210418 406) ((emacs (24 3)) (let-alist (1 0 4)) (seq (1 11)) (dash (2 12 1))) "A framework for looking up and displaying bibliographic entries" single ((:commit . "517ec18f00f91b61481214b178f7ae0b8fbc499b") (:authors ("Clément Pit-Claudel" . "clement.pitclaudel@live.com")) (:maintainer "Clément Pit-Claudel" . "clement.pitclaudel@live.com") (:keywords "bib" "tex" "convenience" "hypermedia") (:url . "https://github.com/cpitclaudel/biblio.el"))])
+ (bibliothek . [(20190124 1828) ((emacs (24 4)) (pdf-tools (0 70)) (a (0 1 0 -3 4))) "Managing a digital library of PDFs" single ((:commit . "350af0e5d53307c900e4f8b2617f3852f51a74d2") (:authors ("Göktuğ Kayaalp" . "self@gkayaalp.com")) (:maintainer "Göktuğ Kayaalp" . "self@gkayaalp.com") (:keywords "tools") (:url . "https://dev.gkayaalp.com/elisp/index.html#bibliothek-el"))])
+ (bibretrieve . [(20191124 1855) ((auctex (11 87)) (emacs (24 3))) "Retrieve BibTeX entries from the internet" tar ((:commit . "81dc8e0db3629cc180eafb2bc34b60dcd8980316") (:authors ("Antonio Sartori")) (:maintainer "Pavel Zorin-Kranich" . "pzorin@uni-bonn.de") (:keywords "bibtex" "bibliography" "mathscinet" "arxiv" "zbmath") (:url . "https://github.com/pzorin/bibretrieve"))])
+ (bibslurp . [(20151202 2346) ((s (1 6 0)) (dash (1 5 0))) "retrieve BibTeX entries from NASA ADS" single ((:commit . "0116bbb04840d20a6b087e6d9c921bb1c2489a8f") (:keywords "bibliography" "nasa ads") (:url . "https://github.com/mkmcc/bibslurp"))])
+ (bibtex-completion . [(20220404 1608) ((parsebib (1 0)) (s (1 9 0)) (dash (2 6 0)) (f (0 16 2)) (cl-lib (0 5)) (biblio (0 2)) (emacs (26 1))) "A BibTeX backend for completion frameworks" single ((:commit . "ce8c17690ddad73d01531084b282f221f8eb6669") (:authors ("Titus von der Malsburg" . "malsburg@posteo.de") ("Justin Burkett" . "justin@burkett.cc")) (:maintainer "Titus von der Malsburg" . "malsburg@posteo.de") (:url . "https://github.com/tmalsburg/helm-bibtex"))])
+ (bibtex-utils . [(20190703 2117) nil "Provides utilities for extending BibTeX mode" single ((:commit . "26a8f0909b6adbf545a2b5e57ce7f779bf7a65af") (:authors ("Tyler Smith" . "tyler@plantarum.ca")) (:maintainer "Tyler Smith" . "tyler@plantarum.ca") (:keywords "bibtex") (:url . "https://github.com/plantarum/bibtex-utils"))])
+ (bicycle . [(20220422 1600) ((emacs (25 1)) (compat (28 1 1 0))) "Cycle outline and code visibility" single ((:commit . "e6d8ca47f77e0579fcb5a1dcb88218087102c355") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "outlines") (:url . "https://github.com/tarsius/bicycle"))])
+ (bifocal . [(20200325 539) ((emacs (24 4))) "Split-screen scrolling for comint-mode buffers" single ((:commit . "de8d09b08b0b30714c4f9b98c97e9577d47b9be6") (:keywords "frames" "processes") (:url . "https://github.com/riscy/bifocal-mode"))])
+ (binclock . [(20170802 1116) ((cl-lib (0 5))) "Display the current time using a binary clock." single ((:commit . "87042230d7f3fe3e9a77fae0dbab7d8f7e7794ad") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "games" "time" "display") (:url . "https://github.com/davep/binclock.el"))])
+ (bind-chord . [(20171204 2010) ((bind-key (1 0)) (key-chord (0 6))) "key-chord binding helper for use-package-chords" single ((:commit . "a7422fb8ab1baee19adb2717b5b47b9c3812a84c") (:authors ("Justin Talbott" . "justin@waymondo.com")) (:maintainer "Justin Talbott" . "justin@waymondo.com") (:keywords "convenience" "tools" "extensions") (:url . "https://github.com/waymondo/use-package-chords"))])
+ (bind-key . [(20210210 1609) nil "A simple way to manage personal keybindings" single ((:commit . "a7422fb8ab1baee19adb2717b5b47b9c3812a84c") (:authors ("John Wiegley" . "johnw@newartisans.com")) (:maintainer "John Wiegley" . "johnw@newartisans.com") (:keywords "keys" "keybinding" "config" "dotemacs") (:url . "https://github.com/jwiegley/use-package"))])
+ (bind-map . [(20220108 228) ((emacs (24 3))) "Bind personal keymaps in multiple locations" single ((:commit . "510a24138d8de3b8df0783f1ac493a551fc9bd74") (:authors ("Justin Burkett" . "justin@burkett.cc")) (:maintainer "Justin Burkett" . "justin@burkett.cc") (:url . "https://github.com/justbur/emacs-bind-map"))])
+ (binder . [(20220429 2055) ((emacs (24 4)) (seq (2 20))) "Global minor mode to facilitate multi-file writing projects" tar ((:commit . "127463a7cb8cc2fa9904d3feb3fca95d2244ddcc") (:authors ("Paul W. Rankin" . "pwr@bydasein.com")) (:maintainer "Paul W. Rankin" . "pwr@bydasein.com") (:keywords "files" "outlines" "wp" "text") (:url . "https://github.com/rnkn/binder"))])
+ (bing-dict . [(20200216 110) nil "Minimalists' English-Chinese Bing dictionary" tar ((:commit . "1d581aaa9622b34f8fb83af5579fa252aa24cfef") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions") (:url . "https://github.com/cute-jumper/bing-dict.el"))])
+ (birds-of-paradise-plus-theme . [(20130419 2129) nil "A brown/orange light-on-dark theme for Emacs 24 (deftheme)." single ((:commit . "bb9f9d4ef7f7872a388ec4eee1253069adcadb6f") (:authors ("Jim Myhrberg" . "contact@jimeh.me")) (:maintainer "Jim Myhrberg" . "contact@jimeh.me") (:keywords "themes") (:url . "https://github.com/jimeh/birds-of-paradise-plus-theme.el"))])
+ (bison-mode . [(20210527 717) nil "Major mode for editing bison, yacc and lex files." single ((:commit . "4f2e20394a475931409618c1635e9c9f1cf07d9c") (:authors ("Eric Beuscher" . "beuscher@eecs.tulane.edu")) (:maintainer "Eric Beuscher" . "beuscher@eecs.tulane.edu") (:keywords "bison-mode" "yacc-mode"))])
+ (bitbake . [(20220509 1236) ((emacs (24 1)) (dash (2 6 0)) (mmm-mode (0 5 4)) (s (1 10 0))) "Running bitbake from emacs" single ((:commit . "434b088ab8715731d62978264cb934e34c75c4b3") (:authors ("Damien Merenne")) (:maintainer "Damien Merenne") (:keywords "convenience") (:url . "https://github.com/canatella/bitbake-el"))])
+ (bitbucket . [(20170405 446) ((emacs (24)) (request (0 1 0)) (s (1 9 0))) "Bitbucket API wrapper" tar ((:commit . "5e663da1bd38a14c1ecf4d66a79d4321ac833bcf") (:authors ("2017 Tjaart van der Walt" . "tjaart@tjaart.co.za")) (:maintainer "2017 Tjaart van der Walt" . "tjaart@tjaart.co.za") (:keywords "bitbucket") (:url . "http://github.com/tjaartvdwalt/bitbucket.el/"))])
+ (bitlbee . [(20151203 0) nil "Help get Bitlbee (http://www.bitlbee.org) up and running." single ((:commit . "3a92a4119e0c007df2c7dcf1b1c3a5f23ee40e05"))])
+ (blackboard-bold-mode . [(20160813 206) ((cl-lib (0 5))) "Easily insert Unicode mathematical double-struck characters" single ((:commit . "5299cb064ba71baa3e331b8560bf8dd38cbbc4ed") (:authors ("Grant Rettke" . "gcr@wisdomandwonder.com")) (:maintainer nil . "<gcr@wisdomandwonder.com>") (:keywords "unicode" "double struck" "blackboard bold" "math" "mathematical") (:url . "https://github.com/grettke/blackboard-bold-mode"))])
+ (blackboard-theme . [(20161216 656) ((emacs (24))) "TextMate Blackboard Theme" single ((:commit . "7a0d79410feb728ff5cce75c140fadc19a3f9a6d") (:authors ("Dong Zheng")) (:maintainer "Dong Zheng") (:url . "https://github.com/don9z/blackboard-theme"))])
+ (blacken . [(20220110 1841) ((emacs (25 2))) "Reformat python buffers using the \"black\" formatter" single ((:commit . "563c744f545552cb92e8e84d5be4e2cdbabc93ca") (:authors ("Artem Malyshev" . "proofit404@gmail.com")) (:maintainer "Artem Malyshev" . "proofit404@gmail.com") (:url . "https://github.com/proofit404/blacken"))])
+ (blackout . [(20220509 2350) ((emacs (26))) "Better mode lighter overriding" single ((:commit . "7707211370f03f03a2f74df15f42ac24a1e99300") (:authors ("Radian LLC" . "contact+blackout@radian.codes")) (:maintainer "Radian LLC" . "contact+blackout@radian.codes") (:keywords "extensions") (:url . "https://github.com/radian-software/blackout"))])
+ (blamer . [(20220404 1917) ((emacs (27 1))) "Show git blame info about current line" single ((:commit . "f5c0b5ef2ae46062ba13dd03215cdfc49d0fd30b") (:authors ("Artur Yaroshenko" . "artawower@protonmail.com")) (:maintainer "Artur Yaroshenko" . "artawower@protonmail.com") (:url . "https://github.com/artawower/blamer.el"))])
+ (blgrep . [(20150401 1416) ((clmemo (20140321 715))) "Block grep" tar ((:commit . "605beda210610a5829750a987f5fcebea97af546") (:authors ("Masayuki Ataka" . "masayuki.ataka@gmail.com")) (:maintainer "Masayuki Ataka" . "masayuki.ataka@gmail.com") (:keywords "tools" "convenience"))])
+ (blimp . [(20180903 2240) ((emacs (25)) (eimp (1 4 0))) "Bustling Image Manipulation Package" single ((:commit . "39562f02acc1113595cb253a85bb3b9da743ddd2") (:authors ("Sebastian Wålinder" . "s.walinder@gmail.com")) (:maintainer "Sebastian Wålinder" . "s.walinder@gmail.com") (:keywords "multimedia" "unix") (:url . "https://github.com/walseb/blimp"))])
+ (bliss-theme . [(20170808 1307) ((emacs (24 0))) "an Emacs 24 theme based on Bliss (tmTheme)" single ((:commit . "c3cf6d8a666ab26909b7da158f9e94df71a5fbbf") (:authors ("Jason Milkins")) (:maintainer "Jason Milkins") (:url . "https://github.com/emacsfodder/tmtheme-to-deftheme"))])
+ (blitzmax-mode . [(20211128 2028) ((emacs (24 1))) "A major mode for editing BlitzMax source code" single ((:commit . "c9651fa69116b5821cd34fb34eabc3e12ce238e2") (:authors ("Phil Newton")) (:maintainer "Phil Newton") (:keywords "languages" "blitzmax") (:url . "https://www.sodaware.net/dev/tools/blitzmax-mode/"))])
+ (bln-mode . [(20181121 918) nil "binary line navigation minor mode for cursor movement in long lines" single ((:commit . "a601b0bf975dd1432f6552ab6afe3f4f71133b4a") (:authors ("Maarten Grachten")) (:maintainer "Maarten Grachten") (:keywords "motion" "location" "cursor" "convenience") (:url . "https://github.com/mgrachten/bln-mode"))])
+ (block-nav . [(20201005 202) ((emacs (25 1))) "Jump across indentation levels for quick navigation" single ((:commit . "d69acaa3d6c75bf4c518d8ab8896ad63580253fc") (:maintainer "Philip Dumaresq" . "phdumaresq@protonmail.com") (:keywords "convenience") (:url . "https://github.com/nixin72/block-nav.el"))])
+ (blockdiag-mode . [(20160427 524) ((emacs (24 3))) "Major mode for editing blockdiag files" single ((:commit . "f3b21ba433d60327cebd103ae4492200750e24a9") (:authors ("xcezx" . "main.xcezx@gmail.com")) (:maintainer "xcezx" . "main.xcezx@gmail.com") (:url . "https://github.com/xcezx/xdiag-mode"))])
+ (blog-admin . [(20170923 1409) ((ctable (0 1 1)) (s (1 10 0)) (f (0 17 3)) (names (20151201 0)) (cl-lib (0 5))) "Blog admin for emacs with hexo/org-page supported" tar ((:commit . "b5f2e1dad7d68ec903619f7280bb0bcb7e398a1e") (:authors (nil . "code.falling@gmail.com")) (:maintainer nil . "code.falling@gmail.com") (:keywords "tools" "blog" "org" "hexo" "org-page"))])
+ (blog-minimal . [(20181021 849) ((ht (1 5)) (simple-httpd (1 4 6)) (mustache (0 22)) (s (1 11 0)) (org (9 0 3))) "a simple static site generator based on org mode" tar ((:commit . "356c878322258159021eecdd15757e11cf02e335") (:authors ("Thank Fly" . "thiefuniverses@gmail.com")) (:maintainer "Thank Fly" . "thiefuniverses@gmail.com") (:keywords "tools") (:url . "https://github.com/thiefuniverse/blog-minimal"))])
+ (blox . [(20210225 1900) ((emacs (25 1))) "Interaction with Roblox tooling" single ((:commit . "2bf0e618451fb1da11263d8a35ffcd9210590c0a") (:authors ("Kenneth Loeffler" . "kenneth.loeffler@outlook.com")) (:maintainer "Kenneth Loeffler" . "kenneth.loeffler@outlook.com") (:keywords "roblox" "rojo" "tools") (:url . "https://github.com/kennethloeffler/blox"))])
+ (bm . [(20210421 1351) nil "Visible bookmarks in buffer." tar ((:commit . "9a31c61f44e6f1033ca43bd7f3eb33ffdb2ca595") (:authors ("Jo Odland <jo.odland(at)gmail.com>")) (:maintainer "Jo Odland <jo.odland(at)gmail.com>") (:keywords "bookmark" "highlight" "faces" "persistent") (:url . "https://github.com/joodland/bm"))])
+ (bmx-mode . [(20210319 620) ((emacs (25 1)) (cl-lib (0 5)) (company (0 9 4)) (dash (2 13 0)) (s (1 12 0))) "Batch Mode eXtras" single ((:commit . "6f008707efe0bb5646f0c1b0d6f57f0a8800e200") (:authors ("Jostein Kjønigsen" . "jostein@gmail.com")) (:maintainer "Jostein Kjønigsen" . "jostein@gmail.com") (:keywords "c" "convenience" "tools") (:url . "http://github.com/josteink/bmx-mode"))])
+ (bnf-mode . [(20200323 1348) ((cl-lib (0 5)) (emacs (24 3))) "Major mode for editing BNF grammars." tar ((:commit . "d9329dd90e5d4f629295e85898362d9682047898") (:authors ("Serghei Iakovlev" . "egrep@protonmail.ch")) (:maintainer "Serghei Iakovlev" . "egrep@protonmail.ch") (:keywords "languages") (:url . "https://github.com/sergeyklay/bnf-mode"))])
+ (bnfc . [(20160605 1927) ((emacs (24 3))) "Define context-free grammars for the BNFC tool" single ((:commit . "1b58df1dd0cb9b81900632fb2843a03b94f56fdb") (:authors ("Jacob Mitchell" . "jmitchell@member.fsf.org")) (:maintainer "Jacob Mitchell" . "jmitchell@member.fsf.org") (:keywords "languages" "tools") (:url . "https://github.com/jmitchell/bnfc-mode"))])
+ (bog . [(20201030 357) ((cl-lib (0 5))) "Extensions for research notes in Org mode" single ((:commit . "af929c164c4ffaee0c33ba97c06733f0ce9431d4") (:authors ("Kyle Meyer" . "kyle@kyleam.com")) (:maintainer "Kyle Meyer" . "kyle@kyleam.com") (:keywords "bib" "outlines") (:url . "https://github.com/kyleam/bog"))])
+ (bolt-mode . [(20180310 810) ((emacs (24 3))) "Editing support for Bolt language" single ((:commit . "85a5a752bfbebb4aed884326c25db64c000e9934") (:authors ("Mikhail Pontus" . "mpontus@gmail.com")) (:maintainer "Mikhail Pontus" . "mpontus@gmail.com") (:keywords "languages") (:url . "https://github.com/mpontus/bolt-mode"))])
+ (bongo . [(20201002 1020) ((cl-lib (0 5)) (emacs (24 1))) "play music with Emacs" tar ((:commit . "9e9629090262bba6d0003dabe5a375e47a4477f1"))])
+ (bonjourmadame . [(20170919 1134) nil "Say \"Hello ma'am!\"" single ((:commit . "d3df185fce78aefa689fded8e56a654f0fde4ac0"))])
+ (boogie-friends . [(20220419 2240) ((cl-lib (0 5)) (dash (2 10 0)) (flycheck (0 23)) (yasnippet (0 9 0 1)) (company (0 8 12))) "A collection of programming modes for Boogie, Dafny, and Z3 (SMTLIB v2)." tar ((:commit . "d685a52259f50c2db51205ef9cc93f713ae8d8fa") (:authors ("Clément Pit--Claudel" . "clement.pitclaudel@live.com")) (:maintainer "Clément Pit--Claudel" . "clement.pitclaudel@live.com") (:keywords "convenience" "languages") (:url . "https://github.com/boogie-org/boogie-friends/"))])
+ (bookmark-in-project . [(20220507 1118) ((emacs (27 1))) "Bookmark access within a project" single ((:commit . "0e08e4bd4fedc87b2371313d55691356bee0ad7d") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:keywords "convenience") (:url . "https://codeberg.com/ideasman42/emacs-bookmark-in-project"))])
+ (bookmark-view . [(20220403 2204) ((emacs (27 1))) "Bookmark views" single ((:commit . "0d40ac67f53b7fa75fe65c38a5ef65701ce4c3da") (:authors ("Daniel Mendler")) (:maintainer "Daniel Mendler") (:url . "https://github.com/minad/bookmark-view"))])
+ (bool-flip . [(20161215 1539) ((emacs (24 3))) "flip the boolean under the point" single ((:commit . "f58a9a7b9ab875bcfbd57c8262697ae404eb4485") (:authors ("Michael Brandt" . "michaelbrandt5@gmail.com")) (:maintainer "Michael Brandt" . "michaelbrandt5@gmail.com") (:keywords "boolean" "convenience" "usability") (:url . "http://github.com/michaeljb/bool-flip/"))])
+ (boon . [(20220502 1850) ((emacs (26 1)) (dash (2 12 0)) (expand-region (0 10 0)) (multiple-cursors (1 3 0))) "Ergonomic Command Mode for Emacs." tar ((:commit . "db7b6083d390e3febf82f9af5782e1a36d30093c"))])
+ (borg . [(20220509 2044) ((emacs (26)) (epkg (3 3 3)) (magit (3 3 0))) "Assimilate Emacs packages as Git submodules" tar ((:commit . "492e0e44bfa0576a8227be21635c6ef0a853ad38") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "tools") (:url . "https://github.com/emacscollective/borg"))])
+ (borland-blue-theme . [(20160117 1321) ((emacs (24 1))) "Blue/yellow theme based on old DOS Borland/Turbo C IDE" single ((:commit . "db74eefebbc89d3c62575f8f50b319e87b4a3470") (:authors ("Alexey Veretennikov <alexey dot veretennikov at gmail dot com>")) (:maintainer "Alexey Veretennikov <alexey dot veretennikov at gmail dot com>") (:keywords "themes") (:url . "http://github.com/fourier/borland-blue-theme"))])
+ (boron-theme . [(20170808 1308) ((emacs (24 0))) "an Emacs 24 theme based on Boron (tmTheme)" single ((:commit . "87ae1a765e07429fec25d2f29b004f84b52d2e0a") (:authors ("Jason Milkins")) (:maintainer "Jason Milkins") (:url . "https://github.com/emacsfodder/tmtheme-to-deftheme"))])
+ (boxquote . [(20220105 1515) ((cl-lib (0 5))) "Quote text with a semi-box." single ((:commit . "67775ce80886b776efedceb31cdbacec1e26678e") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "quoting") (:url . "https://github.com/davep/boxquote.el"))])
+ (bpe . [(20141228 2205) ((emacs (24 1))) "Blog from Org mode to Blogger" single ((:commit . "7b5b25f83506e6c9f4075d3803fa32404943a189") (:authors ("Yuta Yamada <cokesboy\"at\"gmail.com>")) (:maintainer "Yuta Yamada <cokesboy\"at\"gmail.com>") (:keywords "blogger" "blog") (:url . "https://github.com/yuutayamada/bpe"))])
+ (bpftrace-mode . [(20190608 2201) ((emacs (24 0))) "Major mode for editing bpftrace script files" single ((:commit . "181065e1f9ab4ec7096bafffe6818b0d7f5362b1") (:authors ("Jay Kamat" . "jaygkamat@gmail.com")) (:maintainer "Jay Kamat" . "jaygkamat@gmail.com") (:keywords "highlight" "c") (:url . "http://gitlab.com/jgkamat/bpftrace-mode"))])
+ (bpr . [(20180220 1844) ((emacs (24))) "Background Process Runner" tar ((:commit . "7f3c787ed80ac0e83447192ac5450dfa7110ade1") (:authors ("Ilya Babanov" . "ilya-babanov@ya.ru")) (:maintainer "Ilya Babanov" . "ilya-babanov@ya.ru") (:keywords "background" "async" "process" "management") (:url . "https://github.com/ilya-babanov/emacs-bpr"))])
+ (bracketed-paste . [(20160407 2348) ((emacs (24 3))) "bracketed paste mode support within emacs -nw" single ((:commit . "843ce3bbb63d560face889e13a57a2f7543957d5") (:authors ("Takeshi Banse" . "takebi@laafc.net")) (:maintainer "Takeshi Banse" . "takebi@laafc.net") (:keywords "terminals"))])
+ (brainfuck-mode . [(20150113 842) ((langdoc (20130601 1450))) "Brainfuck mode for Emacs" single ((:commit . "36e69552bb3b97a4f888d362c59845651bd0d492") (:authors ("Tomoya Tanjo" . "ttanjo@gmail.com")) (:maintainer "Tomoya Tanjo" . "ttanjo@gmail.com") (:keywords "brainfuck" "langdoc") (:url . "https://github.com/tom-tan/brainfuck-mode/"))])
+ (brazilian-holidays . [(20210302 107) ((emacs (26))) "Brazilian holidays" single ((:commit . "68811fd5f3e9d9c0572995c3ca46ead2c35eb421") (:authors ("Jaguaraquem A. Reinaldo" . "jaguar.adler@gmail.com")) (:maintainer "Jaguaraquem A. Reinaldo" . "jaguar.adler@gmail.com") (:keywords "calendar" "holidays" "brazilian") (:url . "https://github.com/jadler/brazilian-holidays"))])
+ (brf . [(20220104 2222) ((fringe-helper (0 1 1)) (emacs (24 3))) "Brf-mode provides features from the legendary editor Brief" tar ((:commit . "59ec15094917666f253eaf61d17664525a7971f4") (:authors ("Mike Woolley" . "mike@bulsara.com")) (:maintainer "Mike Woolley" . "mike@bulsara.com") (:keywords "brief" "crisp" "emulations") (:url . "https://bitbucket.org/MikeWoolley/brf-mode"))])
+ (brightscript-mode . [(20200321 2126) ((emacs (26 3))) "Major mode for editing Brightscript files" single ((:commit . "71c555c2e254629c365e6fc44c2fc4d5b6d0ae8b") (:authors ("Daniel Mircea" . "daniel@viseztrance.com")) (:maintainer nil . "daniel@viseztrance.com") (:keywords "languages") (:url . "https://github.com/viseztrance/brightscript-mode"))])
+ (broadcast . [(20151205 212) ((emacs (24 4))) "Links buffers together for simultaneous editing." single ((:commit . "f6f9cd2e0e3f8c31d6b8e7446c27eb0e50b25f16") (:authors ("Russell Black" . "killdash9@github")) (:maintainer "Russell Black" . "killdash9@github") (:keywords "convenience" "frames" "link" "cursors") (:url . "https://github.com/killdash9/broadcast.el"))])
+ (browse-at-remote . [(20210603 802) ((f (0 17 2)) (s (1 9 0)) (cl-lib (0 5))) "Open github/gitlab/bitbucket/stash/gist/phab/sourcehut page from Emacs" single ((:commit . "cef26f2c063f2473af42d0e126c8613fe2f709e4") (:authors ("Rustem Muslimov" . "r.muslimov@gmail.com")) (:maintainer "Rustem Muslimov" . "r.muslimov@gmail.com") (:keywords "github" "gitlab" "bitbucket" "gist" "stash" "phabricator" "sourcehut" "pagure") (:url . "https://github.com/rmuslimov/browse-at-remote"))])
+ (browse-kill-ring . [(20220410 1509) nil "interactively insert items from kill-ring" single ((:commit . "6e06736a8245a8cdf436f6585c71439239219836") (:authors ("Colin Walters" . "walters@verbum.org")) (:maintainer "browse-kill-ring" . "browse-kill-ring@tonotdo.com") (:keywords "convenience") (:url . "https://github.com/browse-kill-ring/browse-kill-ring"))])
+ (browse-url-dwim . [(20140731 1922) ((string-utils (0 3 2))) "Context-sensitive external browse URL or Internet search" single ((:commit . "3d611dbb167c286109ac53995ad68286d87aafb9") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "hypermedia") (:url . "http://github.com/rolandwalker/browse-url-dwim"))])
+ (brutalist-theme . [(20220507 909) nil "Brutalist theme" tar ((:commit . "c58131f3a8cb71cc0f8efa47766f29578c45bc59") (:authors ("Gergely Nagy")) (:maintainer "Gergely Nagy") (:url . "https://git.madhouse-project.org/algernon/brutalist-theme.el"))])
+ (bshell . [(20201219 139) ((emacs (26)) (buffer-manage (0 11))) "Manage and track multiple inferior shells" single ((:commit . "469c841f19f28c271b4f172b40f3f9ca830254df") (:authors ("Paul Landes")) (:maintainer "Paul Landes") (:keywords "unix" "interactive" "shell" "management") (:url . "https://github.com/plandes/bshell"))])
+ (btc-ticker . [(20220409 1647) ((json (1 2)) (request (0 2 0))) "Shows latest bitcoin price" single ((:commit . "2ed18ac6338d5fe98c578f0875840af07f0bc42a") (:authors ("Jorge Niedbalski R." . "jnr@metaklass.org")) (:maintainer "Jorge Niedbalski R." . "jnr@metaklass.org") (:keywords "news"))])
+ (bts . [(20151109 1333) ((widget-mvc (0 0 2)) (log4e (0 3 0)) (yaxception (0 3 3)) (dash (2 9 0)) (s (1 9 0)) (pos-tip (0 4 5))) "A unified UI for various bug tracking systems" single ((:commit . "df42d58a36447697f93b56e69f5e700b2baef1f9") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "convenience") (:url . "https://github.com/aki2o/emacs-bts"))])
+ (bts-github . [(20170401 1249) ((bts (0 0 1)) (gh (0 8 2))) "A plugin of bts.el for GitHub" single ((:commit . "ef2cf9202dc2128e5efdb613bfde9276a8cd95ad") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "convenience" "git" "github") (:url . "https://github.com/aki2o/emacs-bts-github"))])
+ (bubbleberry-theme . [(20141017 944) ((emacs (24 1))) "A theme based on LightTable for Emacs24" single ((:commit . "22e9adf4586414024e4592972022ec297321b320") (:authors ("Jason Milkins" . "jasonm23@gmail.com") ("Gaurav Giri github.com/grvgr")) (:maintainer "Jason Milkins" . "jasonm23@gmail.com") (:url . "https://github.com/jasonm23/emacs-bubbleberry-theme"))])
+ (buckwalter . [(20191119 1950) nil "Write arabic using Buckwalter transliteration" single ((:commit . "b8c0c2170c7113b515477b1bb39c58d22aad67e1") (:authors ("Joe HAKIM RAHME" . "joehakimrahme@gmail.com")) (:maintainer "Joe HAKIM RAHME" . "joehakimrahme@gmail.com") (:keywords "arabic" "transliteration" "i18n") (:url . "https://github.com/joehakimrahme/buckwalter-arabic"))])
+ (buffer-buttons . [(20150106 1439) nil "Define, save, and load code-safe buttons in files for emacs" single ((:commit . "2feb8494fa7863b98256bc85da670d74a3a8a975") (:authors ("Ryan Pavlik" . "rpavlik@gmail.com")) (:maintainer "Ryan Pavlik" . "rpavlik@gmail.com") (:url . "https://github.com/rpav/buffer-buttons"))])
+ (buffer-env . [(20220506 1506) ((emacs (27 1))) "Buffer-local process environments" single ((:commit . "7b7e5c2a79ad3b31b465387df0ccc18a5809f9d1") (:authors ("Augusto Stoffel" . "arstoffel@gmail.com")) (:maintainer "Augusto Stoffel" . "arstoffel@gmail.com") (:keywords "processes" "tools") (:url . "https://github.com/astoff/buffer-env"))])
+ (buffer-flip . [(20180307 2251) nil "Cycle through buffers like Alt-Tab in Windows" single ((:commit . "b8ecbf0251a59c351a3e44607ee502af343da64b") (:authors ("Russell Black" . "killdash9@github")) (:maintainer "Russell Black" . "killdash9@github") (:keywords "convenience") (:url . "https://github.com/killdash9/buffer-flip.el"))])
+ (buffer-manage . [(20211122 1957) ((emacs (26 1)) (choice-program (0 13)) (dash (2 17 0))) "Manage buffers" tar ((:commit . "819bbfd9ae2f028361f484bc3b60d751623a2df5") (:authors ("Paul Landes")) (:maintainer "Paul Landes") (:keywords "internal" "maint") (:url . "https://github.com/plandes/buffer-manage"))])
+ (buffer-move . [(20160615 1803) nil "easily swap buffers" single ((:commit . "cb517ecf8409b5fdcda472d7190c6021f0c49751") (:keywords "lisp" "convenience") (:url . "https://github.com/lukhas/buffer-move"))])
+ (buffer-ring . [(20220120 124) ((emacs (25 1)) (dynaring (0 3)) (s (1 12 0)) (ht (2 0))) "Rings and tori for buffer navigation" single ((:commit . "177d67238c4d126a0270585e21c0f03ae750ca2a") (:authors ("Mike Mattie" . "codermattie@gmail.com") ("Sid Kasivajhula" . "sid@countvajhula.com")) (:maintainer "Sid Kasivajhula" . "sid@countvajhula.com") (:url . "https://github.com/countvajhula/buffer-ring"))])
+ (buffer-sets . [(20170718 340) ((cl-lib (0 5))) "Sets of Buffers for Buffer Management" single ((:commit . "bc84c2f79a33609cccf3c996101125859b2e26ab") (:authors ("Samuel W. Flint" . "swflint@flintfam.org")) (:maintainer "Samuel W. Flint" . "swflint@flintfam.org") (:keywords "buffer-management") (:url . "http://github.com/swflint/buffer-sets"))])
+ (buffer-utils . [(20140512 1400) nil "Buffer-manipulation utility functions" single ((:commit . "685b13457e3a2085b7584e41365d2aa0779a1b6f") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "extensions") (:url . "http://github.com/rolandwalker/buffer-utils"))])
+ (buffer-watcher . [(20170913 839) ((f (0 16 2)) (cl-lib (0 5))) "Easily run shell scripts per filetype/directory when a buffer is saved" single ((:commit . "b32c67c8a5d724257d759f4c903d0dedc32246ef") (:authors ("Nicolas Petton" . "nicolas@petton.fr")) (:maintainer "Nicolas Petton" . "nicolas@petton.fr"))])
+ (buffer-wrap . [(20200924 345) ((emacs (24 4))) "Wrap the beginning and the end of buffer" single ((:commit . "b918ba023212b0e223a7ca7df3a2ec12a7c54206") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/buffer-wrap"))])
+ (bufler . [(20210907 1145) ((emacs (26 3)) (dash (2 18)) (f (0 17)) (pretty-hydra (0 2 2)) (magit-section (0 1)) (map (2 1))) "Group buffers into workspaces with programmable rules" tar ((:commit . "a68e0eb2719c67ab8a3ad56c4036364061d06004") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "convenience") (:url . "https://github.com/alphapapa/bufler.el"))])
+ (bufshow . [(20130726 1838) ((emacs (24 1))) "A simple presentation tool for Emacs." single ((:commit . "d60a554e7239e6f7520d9c3436d5ecdbc9cf6957") (:authors ("Peter Jones" . "pjones@pmade.com")) (:maintainer "Peter Jones" . "pjones@pmade.com") (:url . "https://github.com/pjones/bufshow"))])
+ (bug-reference-github . [(20200206 2158) nil "Set `bug-reference-url-format' in Github repos" tar ((:commit . "c9512a010f19633e69f1d4b1597eff7048b21112") (:authors ("Arne Jørgensen" . "arne@arnested.dk")) (:maintainer "Arne Jørgensen" . "arne@arnested.dk") (:keywords "programming" "tools") (:url . "https://github.com/arnested/bug-reference-github"))])
+ (bui . [(20210108 1141) ((emacs (24 3)) (dash (2 11 0))) "Buffer interface library" tar ((:commit . "f3a137628e112a91910fd33c0cff0948fa58d470") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "tools") (:url . "https://github.com/alezost/bui.el"))])
+ (build-farm . [(20181218 2002) ((emacs (24 4)) (bui (1 2 1)) (magit-popup (2 1 0))) "Interface for Nix and Guix build farms (Hydra and Cuirass)" tar ((:commit . "5c268a3c235ace0d79ef1ec82c440120317e06f5") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "tools") (:url . "https://gitlab.com/alezost-emacs/build-farm"))])
+ (build-helper . [(20161009 1755) ((projectile (0 9 0))) "Utilities to help build code" single ((:commit . "7a6fe71125a26ed1c492dab77cc688a7fe1d68ac") (:authors ("Afonso Bordado" . "afonsobordado@az8.co")) (:maintainer "Afonso Bordado" . "afonsobordado@az8.co") (:keywords "convenience") (:url . "http://github.com/afonso360/build-helper"))])
+ (build-status . [(20190807 1231) ((cl-lib (0 5))) "Mode line build status indicator" single ((:commit . "1a1d2473aa62f2fdda47d8bfeb9fe352d2579b48") (:authors ("Skye Shaw" . "skye.shaw@gmail.com")) (:maintainer "Skye Shaw" . "skye.shaw@gmail.com") (:keywords "mode-line" "ci" "circleci" "travis-ci") (:url . "http://github.com/sshaw/build-status"))])
+ (bundler . [(20200129 1338) ((inf-ruby (2 1)) (cl-lib (0 5))) "Interact with Bundler from Emacs" single ((:commit . "43efb6be4ed118b06d787ce7fbcffd68a31732a7") (:authors ("Tobias Svensson" . "tob@tobiassvensson.co.uk")) (:maintainer "Tobias Svensson" . "tob@tobiassvensson.co.uk") (:keywords "bundler" "ruby") (:url . "http://github.com/endofunky/bundler.el"))])
+ (burly . [(20220413 1529) ((emacs (26 3)) (map (2 1))) "Save and restore frame/window configurations with buffers" tar ((:commit . "96f59fe24fdce14d14f204372f99bf522ab192bf") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "convenience") (:url . "https://github.com/alphapapa/burly.el"))])
+ (burnt-toast . [(20201113 814) ((emacs (25 1)) (dash (2 10)) (alert (1 2))) "Elisp integration with the BurntToast PowerShell module" tar ((:commit . "eed66036d65b0ee26ce02371d14dce16a360acb4") (:authors ("Sam Cedarbaum" . "scedarbaum@gmail.com")) (:maintainer "Sam Cedarbaum" . "scedarbaum@gmail.com") (:keywords "alert" "notifications" "powershell" "comm") (:url . "https://github.com/cedarbaum/burnt-toast.el"))])
+ (bury-successful-compilation . [(20181106 403) nil "Bury the *compilation* buffer after successful compilation" single ((:commit . "674644c844184605a1bb4f9487a60f7a780a6fe7") (:authors ("Eric Crosson" . "esc@ericcrosson.com")) (:maintainer "Eric Crosson" . "esc@ericcrosson.com") (:keywords "compilation"))])
+ (buster-mode . [(20140928 1213) nil "Minor mode to speed up development when writing tests with Buster.js" single ((:commit . "de6958ef8369400922618b8d1e99abfa91b97ac5") (:keywords "buster" "testing" "javascript"))])
+ (buster-snippets . [(20151125 1010) ((yasnippet (0 8 0))) "Yasnippets for the Buster javascript testing framework" tar ((:commit . "bb8769dae132659858e74d52f3f4e8790399423a") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "snippets"))])
+ (busybee-theme . [(20170719 928) nil "port of vim's mustang theme" single ((:commit . "66b2315b030582d0ebee605cf455d386d8c30fcd") (:authors ("martin haesler")) (:maintainer "martin haesler") (:url . "http://github.com/mswift42/busybee-theme"))])
+ (butler . [(20210928 230) ((deferred (0 3 2)) (json (1 2)) (emacs (24))) "Emacs client for Jenkins" tar ((:commit . "10943ccdf2030187b2f7bd97337d78acb7fd31c9") (:authors ("Ashton Kemerling" . "ashtonkemerling@gmail.com")) (:maintainer "Ashton Kemerling" . "ashtonkemerling@gmail.com") (:keywords "jenkins" "hudson" "ci") (:url . "http://www.github.com/AshtonKem/Butler.git"))])
+ (buttercup . [(20220410 1557) ((emacs (24 3))) "Behavior-Driven Emacs Lisp Testing" tar ((:commit . "ceedad5efa797e860dbb356bc2c3028a4e0321ec") (:authors ("Jorgen Schaefer" . "contact@jorgenschaefer.de")) (:maintainer "Ola Nilsson" . "ola.nilsson@gmail.com") (:url . "https://github.com/jorgenschaefer/emacs-buttercup"))])
+ (buttercup-junit . [(20190802 2258) ((emacs (24 3)) (buttercup (1 15))) "JUnit reporting for Buttercup" single ((:commit . "3ae4f84813c9e04e03a6e703990ca998b62b6deb") (:authors ("Ola Nilsson" . "ola.nilsson@gmail.com")) (:maintainer "Ola Nilsson" . "ola.nilsson@gmail.com") (:keywords "tools" "test" "unittest" "buttercup" "ci") (:url . "https://bitbucket.org/olanilsson/buttercup-junit"))])
+ (button-lock . [(20200309 1323) nil "Clickable text defined by regular expression" single ((:commit . "9afe0f4d05910b0cccc94cb6d4d880119f3b0528") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "mouse" "button" "hypermedia" "extensions") (:url . "http://github.com/rolandwalker/button-lock"))])
+ (buttons . [(20201123 2333) ((cl-lib (0 3))) "Define and visualize hierarchies of keymaps" single ((:commit . "de41b48244574a13000c4289fdb4216a2b0490ff") (:authors ("Ernesto Alfonso")) (:maintainer nil . "(concat \"erjoalgo\" \"@\" \"gmail\" \".com\")") (:keywords "keymap" "template" "snippet") (:url . "http://github.com/erjoalgo/emacs-buttons"))])
+ (c-c-combo . [(20151224 255) nil "Make stuff happen when you reach a target wpm" tar ((:commit . "a261a833499a7fdc29610863b3aafc74818770ba") (:authors ("Diego Berrocal" . "cestdiego@gmail.com")) (:maintainer "Diego Berrocal" . "cestdiego@gmail.com") (:url . "https://www.github.com/CestDiego/c-c-combo.el"))])
+ (c-eldoc . [(20201004 2347) nil "helpful description of the arguments to C functions" single ((:commit . "f4ede1f37f6de583376669735326367d84a0a917") (:authors ("Nathaniel Flath" . "flat0103@gmail.com")) (:maintainer "Nathaniel Flath" . "flat0103@gmail.com") (:url . "http://github.com/nflath/c-eldoc"))])
+ (c-eval . [(20210611 705) ((emacs (24 5))) "Compile and run one-off C code snippets" single ((:commit . "fd129bfcb75475ac6820cc33862bd8efb8097fae") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "c" "languages") (:url . "https://github.com/lassik/emacs-c-eval"))])
+ (c0-mode . [(20151110 1852) nil "Major mode for editing C0 files" tar ((:commit . "c214093c36864d6208fcb9e6a72413ed17ed5d60") (:authors ("Jakob Max Uecker")) (:maintainer "Jakob Max Uecker") (:keywords "c0" "languages") (:url . "http://c0.typesafety.net/"))])
+ (ca65-mode . [(20210218 106) ((emacs (26 1))) "Major mode for ca65 assembly files" single ((:commit . "590d90cc0e1c1864dd7ce03df99b741ba866d52a") (:authors ("Wendel Scardua" . "wendel@scardua.net")) (:maintainer "Wendel Scardua" . "wendel@scardua.net") (:keywords "languages" "assembly" "ca65" "6502") (:url . "https://github.com/wendelscardua/ca65-mode"))])
+ (cabledolphin . [(20160204 938) ((emacs (24 4)) (seq (1 0))) "capture Emacs network traffic" single ((:commit . "fffc192cafa61558e924323d6da8166fe5f2a6f9") (:authors ("Magnus Henoch" . "magnus.henoch@gmail.com")) (:maintainer "Magnus Henoch" . "magnus.henoch@gmail.com") (:keywords "comm"))])
+ (cache . [(20111019 2300) nil "implementation of a hash table whose key-value pairs expire" single ((:commit . "7499586b6c8224df9f5c5bc4dec96b008258d580") (:authors ("Nathaniel Flath")) (:maintainer "Nathaniel Flath"))])
+ (cacoo . [(20120319 2359) ((concurrent (0 3 1))) "Minor mode for Cacoo : http://cacoo.com" tar ((:commit . "c9fa04fbe97639b24698709530361c2bb5f3273c") (:authors ("SAKURAI Masashi <m.sakurai atmark kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai atmark kiwanami.net>") (:keywords "convenience" "diagram") (:url . "https://github.com/kiwanami/emacs-cacoo/"))])
+ (caddyfile-mode . [(20181204 858) ((emacs (25)) (loop (1 3))) "Major mode for Caddy configuration files" single ((:commit . "976ad0664c3f44bfa11cb9b8787ddfb094d0a666") (:authors ("Thomas Jost" . "schnouki@schnouki.net")) (:maintainer "Thomas Jost" . "schnouki@schnouki.net") (:keywords "languages") (:url . "https://github.com/Schnouki/caddyfile-mode/"))])
+ (cake-inflector . [(20140415 858) ((s (1 9 0))) "Lazy porting CakePHP infrector.php to el" single ((:commit . "a1d338ec4840b1b1bc14f7f9298c07e2c1d2d8fc") (:authors ("k1LoW (Kenichirou Oyama), <k1lowxb [at] gmail [dot] com> <k1low [at] 101000lab [dot] org>")) (:maintainer "k1LoW (Kenichirou Oyama), <k1lowxb [at] gmail [dot] com> <k1low [at] 101000lab [dot] org>") (:url . "https://github.com/k1LoW/emacs-cake-inflector"))])
+ (cakecrumbs . [(20180929 139) ((emacs (24 4))) "Show parents on header for HTML/Jade/Sass/Stylus" single ((:commit . "cf8c1df885eee004602f73c4f841301e200e5850") (:authors ("ono hiroko <kuanyui.github.io>")) (:maintainer "ono hiroko <kuanyui.github.io>") (:keywords "languages" "html" "jade" "pug" "sass" "scss" "stylus") (:url . "https://github.com/kuanyui/cakecrumbs.el"))])
+ (cal-china-x . [(20200924 1837) ((cl-lib (0 5))) "Chinese localization, lunar/horoscope/zodiac info and more..." tar ((:commit . "94005e678a1d2522b7a00299779f40c5c77286b8") (:authors ("William Xu" . "william.xwl@gmail.com")) (:maintainer "William Xu" . "william.xwl@gmail.com") (:url . "https://github.com/xwl/cal-china-x"))])
+ (calc-at-point . [(20210219 1252) ((emacs (26)) (dash (2 18 0))) "Perform calculations at point or over selection" single ((:commit . "0c1a9e94b519b0edb0abcbacdf6101eea2f2a524") (:authors ("Sebastian Wålinder" . "s.walinder@gmail.com")) (:maintainer "Sebastian Wålinder" . "s.walinder@gmail.com") (:keywords "convenience") (:url . "https://github.com/walseb/calc-at-point"))])
+ (calendar-norway . [(20220211 1129) nil "Norwegian calendar" single ((:commit . "0db0ea63365f4ff5f7d18fb8335fa88af194a2cc") (:authors ("Kevin Brubeck Unhammer" . "unhammer@fsfe.org")) (:maintainer "Kevin Brubeck Unhammer" . "unhammer@fsfe.org") (:keywords "calendar" "norwegian" "localization"))])
+ (calfw . [(20180118 45) nil "Calendar view framework on Emacs" single ((:commit . "03abce97620a4a7f7ec5f911e669da9031ab9088") (:authors ("SAKURAI Masashi <m.sakurai at kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai at kiwanami.net>") (:keywords "calendar") (:url . "https://github.com/kiwanami/emacs-calfw"))])
+ (calfw-cal . [(20170320 1206) nil "calendar view for emacs diary" single ((:commit . "03abce97620a4a7f7ec5f911e669da9031ab9088") (:authors ("SAKURAI Masashi <m.sakurai at kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai at kiwanami.net>") (:keywords "calendar"))])
+ (calfw-gcal . [(20120111 1000) nil "edit Google calendar for calfw.el." tar ((:commit . "14aab20687d6cc9e6c5ddb9e11984c4e14c3d870") (:authors ("myuhe <yuhei.maeda_at_gmail.com>")) (:maintainer "myuhe") (:keywords "convenience" "calendar" "calfw.el") (:url . "https://github.com/myuhe/calfw-gcal.el"))])
+ (calfw-howm . [(20170704 4) nil "calendar view for howm" single ((:commit . "03abce97620a4a7f7ec5f911e669da9031ab9088") (:authors ("SAKURAI Masashi <m.sakurai at kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai at kiwanami.net>") (:keywords "calendar"))])
+ (calfw-ical . [(20150703 819) nil "calendar view for ical format" single ((:commit . "03abce97620a4a7f7ec5f911e669da9031ab9088") (:authors ("SAKURAI Masashi <m.sakurai at kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai at kiwanami.net>") (:keywords "calendar"))])
+ (calfw-org . [(20160303 258) nil "calendar view for org-agenda" single ((:commit . "03abce97620a4a7f7ec5f911e669da9031ab9088") (:authors ("SAKURAI Masashi <m.sakurai at kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai at kiwanami.net>") (:keywords "calendar" "org"))])
+ (calibredb . [(20220504 516) ((emacs (25 1)) (org (9 3)) (transient (0 1 0)) (s (1 12 0)) (dash (2 17 0)) (request (0 3 3)) (esxml (0 3 7))) "Yet another calibre client" tar ((:commit . "a59e8ab65601e30073fa55bef76e95c964c678d8") (:authors ("Damon Chan" . "elecming@gmail.com")) (:maintainer "Damon Chan" . "elecming@gmail.com") (:keywords "tools") (:url . "https://github.com/chenyanming/calibredb.el"))])
+ (call-graph . [(20220506 1214) ((emacs (25 1)) (hierarchy (0 7 0)) (tree-mode (1 0 0)) (ivy (0 10 0))) "Generate call graph for c/c++ functions" tar ((:commit . "42023e5d1781c75f425e8c72b63b28e53dae6e9c") (:authors ("Huming Chen" . "chenhuming@gmail.com")) (:maintainer "Huming Chen" . "chenhuming@gmail.com") (:keywords "programming" "convenience") (:url . "https://github.com/beacoder/call-graph"))])
+ (calmer-forest-theme . [(20130926 510) nil "Darkish theme with green/orange tint" single ((:commit . "87ba7bae389084d13fe3bc34e0c923017eda6ba0") (:authors ("Artur Hefczyc, created 2003-04-18") ("David Caldwell" . "david@porkrind.org")) (:maintainer "Artur Hefczyc, created 2003-04-18") (:url . "https://github.com/caldwell/calmer-forest-theme"))])
+ (camcorder . [(20190317 2138) ((emacs (24)) (names (20150000)) (cl-lib (0 5))) "Record screencasts in gif or other formats." single ((:commit . "b11ca61491a27681bb3131b72b51c105fd996bed") (:authors ("Artur Malabarba" . "bruce.connor.am@gmail.com")) (:maintainer "Artur Malabarba" . "bruce.connor.am@gmail.com") (:keywords "multimedia" "screencast") (:url . "http://github.com/Bruce-Connor/camcorder.el"))])
+ (caml . [(20220503 1742) ((emacs (24 3))) "Caml mode for GNU Emacs" tar ((:commit . "f2f170f46b758341d96385986e8a93b9b4d248f1") (:authors ("Jacques Garrigue" . "garrigue@kurims.kyoto-u.ac.jp") ("Ian T Zimmerman" . "itz@rahul.net") ("Damien Doligez" . "damien.doligez@inria.fr")) (:maintainer "Christophe Troestler" . "Christophe.Troestler@umons.ac.be") (:keywords "ocaml") (:url . "https://github.com/ocaml/caml-mode"))])
+ (cangjie . [(20211201 2307) ((emacs (24 4)) (s (1 12 0)) (dash (2 14 1)) (f (0 2 0))) "Retrieve cangjie code for han characters" tar ((:commit . "87408d79b73a69194842a8848de6d7708e98c3a4") (:keywords "convenience" "writing") (:url . "https://github.com/kisaragi-hiu/cangjie.el"))])
+ (cape . [(20220506 1814) ((emacs (27 1))) "Completion At Point Extensions" tar ((:commit . "e72edf2d6357beb64798ef1894cc807190f80901") (:authors ("Daniel Mendler" . "mail@daniel-mendler.de")) (:maintainer "Daniel Mendler" . "mail@daniel-mendler.de") (:url . "https://github.com/minad/cape"))])
+ (capnp-mode . [(20210707 2310) nil "Major mode for editing Capn' Proto Files" single ((:commit . "02dc92c900babbd232fbcdd14f7ccf44d234ee77") (:authors ("Brian Taylor" . "el.wubo@gmail.com")) (:maintainer "Brian Taylor" . "el.wubo@gmail.com") (:url . "https://github.com/capnproto/capnproto"))])
+ (capture . [(20130828 1644) nil "screencasting with \"avconv\" or \"ffmpeg\"" tar ((:commit . "1bb26060311da76767f70096218313fc93b0c806") (:authors ("Sergey Pashinin <sergey at pashinin dot com>")) (:maintainer "Sergey Pashinin <sergey at pashinin dot com>"))])
+ (carbon-now-sh . [(20201028 950) ((emacs (24 4))) "https://carbon.now.sh integration." single ((:commit . "6444a77a6065803cf97c3321f811bd34a8063d76") (:authors ("Vitalii Elenhaupt")) (:maintainer "Vitalii Elenhaupt") (:keywords "convenience") (:url . "https://github.com/veelenga/carbon-now-sh.el"))])
+ (cargo . [(20220311 827) ((emacs (24 3)) (markdown-mode (2 4))) "Emacs Minor Mode for Cargo, Rust's Package Manager." tar ((:commit . "8335b5577dfa526c645f7c1839c473f99b9ad1a8") (:authors ("Kevin W. van Rooijen")) (:maintainer "Kevin W. van Rooijen") (:keywords "tools"))])
+ (cargo-mode . [(20210605 1003) ((emacs (25 1))) "Cargo Major Mode. Cargo is the Rust package manager" single ((:commit . "b98ea60ddec30eac174012671ee09e125748a193") (:authors ("Ayrat Badykov" . "ayratin555@gmail.com")) (:maintainer "Ayrat Badykov" . "ayratin555@gmail.com") (:keywords "tools") (:url . "https://github.com/ayrat555/cargo-mode"))])
+ (caroline-theme . [(20160318 520) ((emacs (24))) "A trip down to New Orleans..." single ((:commit . "222fd483db304509f9e422dc82883d808e023ceb") (:authors ("Jack Killilea" . "jaaacckz1@gmail.com")) (:maintainer "Jack Killilea" . "jaaacckz1@gmail.com") (:url . "https://github.com/xjackk/carolines-theme"))])
+ (cascading-dir-locals . [(20211013 1955) ((emacs (26 1))) "Apply all (!) .dir-locals.el from root to current directory" single ((:commit . "345d4b70e837d45ee84014684127e7399932d5e6") (:authors ("Fritz Grabo" . "hello@fritzgrabo.com")) (:maintainer "Fritz Grabo" . "hello@fritzgrabo.com") (:keywords "convenience") (:url . "https://github.com/fritzgrabo/cascading-dir-locals"))])
+ (caseformat . [(20160115 1615) ((emacs (24)) (cl-lib (0 5)) (dash (2 12 1)) (s (1 10 0))) "Format based letter case converter" single ((:commit . "75ddb9c64eeb78b46d9e1db99bef8d0fb1e46b99") (:authors ("Hiroki YAMAKAWA" . "s06139@gmail.com")) (:maintainer "Hiroki YAMAKAWA" . "s06139@gmail.com") (:keywords "convenience") (:url . "https://github.com/HKey/caseformat"))])
+ (cask . [(20220504 1421) ((emacs (24 5)) (s (1 8 0)) (f (0 16 0)) (epl (0 5)) (shut-up (0 1 0)) (cl-lib (0 3)) (package-build (0)) (ansi (0 4 1))) "Cask: Project management for package development" tar ((:commit . "2eb520e64c2e1047319761df0bcc6fa5149f8cd6") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "speed" "convenience") (:url . "http://github.com/cask/cask"))])
+ (cask-mode . [(20160410 1449) ((emacs (24 3))) "major mode for editing Cask files" single ((:commit . "be8b69e55916cf2e78886927f58c7c49b969c0b8") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk"))])
+ (cask-package-toolset . [(20170921 2256) ((emacs (24)) (cl-lib (0 3)) (s (1 6 1)) (dash (1 8 0)) (f (0 10 0)) (commander (0 2 0)) (ansi (0 1 0)) (shut-up (0 1 0))) "Toolsettize your package" tar ((:commit . "2c74cd827e88c7f8360581a841e45f0b794510e7") (:authors ("Adrien Becchis" . "adriean.khisbe@live.fr")) (:maintainer "Adrien Becchis" . "adriean.khisbe@live.fr") (:keywords "convenience" "tools") (:url . "http://github.com/AdrieanKhisbe/cask-package-toolset.el"))])
+ (caskxy . [(20140513 1539) ((log4e (0 2 0)) (yaxception (0 1))) "Control Cask in Emacs" single ((:commit . "dc18dcab7ed526070ab76de071c9c5272e6ac40e") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "convenience") (:url . "https://github.com/aki2o/caskxy"))])
+ (catmacs . [(20170826 1157) ((emacs (24))) "Simple CAT interface for Yaesu Transceivers." single ((:commit . "65d3e0563abe6ff9577202cf2278074d4130fbdd") (:authors ("Frank Singleton" . "b17flyboy@gmail.com")) (:maintainer "Frank Singleton" . "b17flyboy@gmail.com") (:keywords "comm" "hardware") (:url . "https://bitbucket.org/pymaximus/catmacs"))])
+ (catppuccin-theme . [(20220330 1021) ((emacs (25 1))) "Catppuccin Theme" single ((:commit . "352ebf62099e95cb4a71060a7d4a228f00358b97") (:authors ("pspiagicw")) (:maintainer "pspiagicw" . "pspiagicw@gmail.com") (:url . "https://github.com/catppuccin/emacs"))])
+ (cbm . [(20171116 1240) ((cl-lib (0 5))) "Switch to similar buffers." single ((:commit . "5b41c936ba9f6d170309a85ffebc9939c1050b31") (:authors ("Lukas Fürmetz" . "fuermetz@mailbox.org")) (:maintainer "Lukas Fürmetz" . "fuermetz@mailbox.org") (:keywords "buffers") (:url . "http://github.com/akermu/cbm.el"))])
+ (cc-cedict . [(20210814 819) ((emacs (26 1))) "Interface to CC-CEDICT (a Chinese-English dictionary)" single ((:commit . "03fbe7d1589d36f627ef9fe7b86f9fe6f623cbb3") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:url . "https://github.com/xuchunyang/cc-cedict.el"))])
+ (ccc . [(20210501 820) nil "buffer local cursor color control library" single ((:commit . "c664b26d0861621ac86b5b5f47835dd84f06dc93") (:authors ("Masatake YAMATO" . "masata-y@is.aist-nara.ac.jp")) (:maintainer "SKK Development Team") (:keywords "cursor") (:url . "https://github.com/skk-dev/ddskk"))])
+ (ccls . [(20200820 308) ((emacs (25 1)) (lsp-mode (6 3 1)) (dash (2 14 1))) "ccls client for lsp-mode" tar ((:commit . "675a5704c14a27931e835a431beea3631d92e8e6") (:authors ("Tobias Pisani, Fangrui Song")) (:maintainer "Tobias Pisani, Fangrui Song") (:keywords "languages" "lsp" "c++") (:url . "https://github.com/MaskRay/emacs-ccls"))])
+ (cd-compile . [(20141108 1957) nil "run compile in a specific directory" single ((:commit . "10284ccae86afda4a37b09ba90acd1e2efedec9f") (:authors ("Jamie Nicol" . "jamie@thenicols.net")) (:maintainer "Jamie Nicol" . "jamie@thenicols.net"))])
+ (cdb . [(20200904 1431) nil "constant database (cdb) reader for Emacs Lisp" single ((:commit . "c664b26d0861621ac86b5b5f47835dd84f06dc93") (:authors ("Yusuke Shinyama <yusuke at cs . nyu . edu>")) (:maintainer "SKK Development Team") (:keywords "cdb") (:url . "https://github.com/skk-dev/ddskk"))])
+ (cdlatex . [(20210804 452) nil "Fast input methods for LaTeX environments and math" single ((:commit . "8e963c68531f75e459e8ebe7a34fd3ba9d3729a0") (:authors ("Carsten Dominik" . "carsten.dominik@gmail.com")) (:maintainer "Carsten Dominik" . "carsten.dominik@gmail.com") (:keywords "tex"))])
+ (cdnjs . [(20161031 1522) ((dash (2 13 0)) (deferred (0 4)) (f (0 17 2)) (pkg-info (0 5))) "A front end for http://cdnjs.com" single ((:commit . "ce19880d3ec3d81e6c665d0b1dfea99cc7a3f908") (:authors ("Yasuyuki Oka" . "yasuyk@gmail.com")) (:maintainer "Yasuyuki Oka" . "yasuyk@gmail.com") (:keywords "tools") (:url . "https://github.com/yasuyk/cdnjs.el"))])
+ (cedit . [(20200816 526) nil "paredit-like commands for c-like languages" single ((:commit . "cb38316903e6cfa8b8c978defa7e1dafcd4e0c12") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://zk-phi.gitub.io/"))])
+ (celery . [(20170225 924) ((emacs (24)) (dash-functional (2 11 0)) (s (1 9 0)) (deferred (0 3 2))) "a minor mode to draw stats from celery and more?" single ((:commit . "51197d74f5eaa8ae09144af7663a2f4277f07d16") (:authors ("ardumont" . "eniotna.t@gmail.com")) (:maintainer "ardumont" . "eniotna.t@gmail.com") (:keywords "celery" "convenience") (:url . "https://github.com/ardumont/emacs-celery"))])
+ (celestial-mode-line . [(20180518 822) ((emacs (24))) "Show lunar phase and sunrise/-set time in modeline" single ((:commit . "3f5794aca99b977f1592cf1ab4516ae7922196a1") (:authors ("Peter" . "craven@gmx.net")) (:maintainer "Peter" . "craven@gmx.net") (:keywords "extensions") (:url . "https://github.com/ecraven/celestial-mode-line"))])
+ (centaur-tabs . [(20220224 808) ((emacs (24 4)) (powerline (2 4)) (cl-lib (0 5))) "Aesthetic, modern looking customizable tabs plugin" tar ((:commit . "f4cef95acbd2eb99c8db3b6cdde74a6e0a966a0a") (:authors ("Emmanuel Bustos" . "ema2159@gmail.com")) (:maintainer "Emmanuel Bustos" . "ema2159@gmail.com") (:url . "https://github.com/ema2159/centaur-tabs"))])
+ (centered-cursor-mode . [(20200507 1529) nil "cursor stays vertically centered" single ((:commit . "4093821cc9759ca5a3c6e527d4cc915fc3a5ad74") (:authors ("André Riemann" . "andre.riemann@web.de")) (:maintainer "André Riemann" . "andre.riemann@web.de") (:keywords "convenience") (:url . "https://github.com/andre-r/centered-cursor-mode.el"))])
+ (centered-window . [(20220125 804) ((emacs (24 4))) "Center the text when there's only one window" single ((:commit . "80965f6c6afe8d918481433984b493de72af5399") (:authors ("Anler Hernández Peral" . "inbox+emacs@anler.me")) (:maintainer "Anler Hernández Peral" . "inbox+emacs@anler.me") (:keywords "faces" "windows") (:url . "https://github.com/anler/centered-window-mode"))])
+ (centimacro . [(20201225 1132) nil "Assign multiple macros as global key bindings" single ((:commit . "0149877584b333c4f1953f0767f0cae23881b0df") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "macros") (:url . "https://github.com/abo-abo/centimacro"))])
+ (cerbere . [(20181113 1641) ((pkg-info (0 5))) "Unit testing in Emacs for several programming languages" tar ((:commit . "c667c165d9c1657f13d2d46f09ba21b61f9402cc") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "python" "go" "php" "phpunit" "elisp" "ert" "tests" "tdd") (:url . "https://github.com/nlamirault/cerbere"))])
+ (ceylon-mode . [(20180606 1324) ((emacs (25))) "Major mode for editing Ceylon source code" single ((:commit . "948515672bc596dc118e8e3ede3ede5ec6a3c95a") (:authors ("Lucas Werkmeister" . "mail@lucaswerkmeister.de")) (:maintainer "Lucas Werkmeister" . "mail@lucaswerkmeister.de") (:keywords "languages" "ceylon") (:url . "https://github.com/lucaswerkmeister/ceylon-mode"))])
+ (cfengine-code-style . [(20171115 2108) nil "C code style for CFEngine project." single ((:commit . "0d98e5a6f0c08e2b1d2c8e96c3dfc7e619210f72") (:authors ("Mikhail Gusarov" . "mikhail.gusarov@cfengine.com")) (:maintainer "Mikhail Gusarov" . "mikhail.gusarov@cfengine.com") (:url . "https://github.com/cfengine/core"))])
+ (cff . [(20160118 2018) ((cl-lib (0 5)) (emacs (24))) "Search of the C/C++ file header by the source and vice versa" single ((:commit . "b6ab2a28e64ef06f281ec74cfe3114e450644dfa") (:authors ("Alexey Veretennikov" . "alexey.veretennikov@gmail.com")) (:maintainer "Alexey Veretennikov" . "alexey.veretennikov@gmail.com") (:keywords "find-file") (:url . "https://github.com/fourier/cff"))])
+ (cfml-mode . [(20190617 1130) ((emacs (25))) "Emacs mode for editing CFML files" single ((:commit . "2de315abddb6af088a2346e142cc305889dcd775") (:authors ("Andrew Myers" . "am2605@gmail.com")) (:maintainer "Andrew Myers" . "am2605@gmail.com") (:url . "https://github.com/am2605/cfml-mode"))])
+ (cfn-mode . [(20220221 1029) ((emacs (26 0)) (f (0 20 0)) (s (1 12 0)) (yaml-mode (0 0 13))) "AWS cloudformation mode" tar ((:commit . "4cf56affe3035fda364109836e26499431095185") (:authors ("William Orr" . "will@worrbase.com")) (:maintainer "William Orr" . "will@worrbase.com") (:keywords "convenience" "languages" "tools") (:url . "https://gitlab.com/worr/cfn-mode"))])
+ (cframe . [(20201222 1930) ((emacs (26)) (buffer-manage (0 11)) (dash (2 17 0))) "Customize a frame and fast switch size and positions" single ((:commit . "38544521e82befc06e397123a118dd96dda2c6b6") (:authors ("Paul Landes")) (:maintainer "Paul Landes") (:keywords "frames") (:url . "https://github.com/plandes/cframe"))])
+ (cfrs . [(20220129 1149) ((emacs (26 1)) (dash (2 11 0)) (s (1 10 0)) (posframe (0 6 0))) "Child-frame based read-string" single ((:commit . "f3a21f237b2a54e6b9f8a420a9da42b4f0a63121") (:authors ("Alexander Miller" . "alexanderm@web.de")) (:maintainer "Alexander Miller" . "alexanderm@web.de") (:url . "https://github.com/Alexander-Miller/cfrs"))])
+ (cg . [(20220318 1007) ((emacs (26 1))) "Major mode for editing Constraint Grammar files" single ((:commit . "06011b53bf64d671c74a79757332b9ef13f47f2b") (:authors ("Kevin Brubeck Unhammer" . "unhammer@fsfe.org")) (:maintainer "Kevin Brubeck Unhammer" . "unhammer@fsfe.org") (:keywords "languages") (:url . "https://visl.sdu.dk/constraint_grammar.html"))])
+ (challenger-deep-theme . [(20210120 941) ((emacs (24))) "challenger-deep Theme" single ((:commit . "2a799259406a8b96a688873093ffab6630a3ad3b") (:authors ("MaxSt")) (:maintainer "MaxSt") (:url . "https://github.com/challenger-deep-theme/emacs"))])
+ (change-inner . [(20210126 1456) ((expand-region (0 7))) "Change contents based on semantic units" single ((:commit . "42cad58aed2caec260f8e8ff61f78a7d3db72d1b") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "convenience" "extensions"))])
+ (chapel-mode . [(20210513 457) ((emacs (25 1)) (hydra (0 15 0))) "A major mode for the Chapel programming language" single ((:commit . "39fd24bb7cf44808200354ac0496be4fc4fddd9a") (:keywords "chapel" "chpl" "programming" "languages") (:url . "https://github.com/damon-kwok/chapel-mode"))])
+ (char-menu . [(20210321 1657) ((emacs (24 3)) (avy-menu (0 1))) "Create your own menu for fast insertion of arbitrary symbols" single ((:commit . "16e9ce0380a7661c6dae9ccec1172fe4757df682") (:authors ("Mark Karpov" . "markkarpov92@gmail.com")) (:maintainer "Mark Karpov" . "markkarpov92@gmail.com") (:keywords "convenience" "editing") (:url . "https://github.com/mrkkrp/char-menu"))])
+ (charmap . [(20200616 1418) nil "Unicode table for Emacs" single ((:commit . "a810347b43b024a86167ab9be935dcf56c122743") (:authors ("Anan Mikami" . "lateau@gmail.com")) (:maintainer "Anan Mikami" . "lateau@gmail.com") (:keywords "unicode" "character" "ucs") (:url . "https://github.com/lateau/charmap"))])
+ (chatwork . [(20170511 442) nil "ChatWork client for Emacs" single ((:commit . "fea231d479f06bf40dbfcf45de143eecc9ed744c") (:authors ("Masayuki Ataka" . "masayuki.ataka@gmail.com")) (:maintainer "Masayuki Ataka" . "masayuki.ataka@gmail.com") (:keywords "web") (:url . "https://github.com/ataka/chatwork"))])
+ (cheat-sh . [(20210607 1307) ((emacs (25 1))) "Interact with cheat.sh" single ((:commit . "33bae22feae8d3375739c6bdef08d0dcdf47ee42") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "docs" "help") (:url . "https://github.com/davep/cheat-sh.el"))])
+ (cheatsheet . [(20170126 2150) ((emacs (24)) (cl-lib (0 5))) "create your own cheatsheet" single ((:commit . "e4f8e0110167ea16a17a74517d1f10cb7ff805b8") (:authors ("Shirin Nikita" . "shirin.nikita@gmail.com")) (:maintainer "Shirin Nikita" . "shirin.nikita@gmail.com") (:keywords "convenience" "usability") (:url . "http://github.com/darksmile/cheatsheet/"))])
+ (checkbox . [(20141117 58) ((emacs (24)) (cl-lib (0 5))) "Quick manipulation of textual checkboxes" single ((:commit . "335afa4404adf72973195a580458927004664d98") (:authors ("Cameron Desautels" . "camdez@gmail.com")) (:maintainer "Cameron Desautels" . "camdez@gmail.com") (:keywords "convenience") (:url . "http://github.com/camdez/checkbox.el"))])
+ (chee . [(20171123 2233) ((dash (2 12 1)) (s (1 10 0)) (f (0 18 2))) "Interface to chee using dired and image-dired" tar ((:commit . "669ff9ee429f24c3c2d03b83d9cb9aec5f86bb8b") (:url . "https://github.com/eikek/chee/tree/release/0.3.0/emacs"))])
+ (cheerilee . [(20160313 1835) ((xelb (0 1))) "Toolkit library" tar ((:commit . "41bd81b5b0bb657241ceda5be6af5e07254d7376") (:authors ("Alessio Vanni" . "vannilla@firemail.cc")) (:maintainer "Alessio Vanni" . "vannilla@firemail.cc") (:keywords "multimedia" "tools") (:url . "https://github.com/Vannil/cheerilee.el"))])
+ (chef-mode . [(20180628 1453) nil "minor mode for editing an opscode chef repository" single ((:commit . "048d691cb63981ae235763d4a6ced4af5c729924") (:authors ("Maciej Pasternacki" . "maciej@pasternacki.net")) (:maintainer "Maciej Pasternacki" . "maciej@pasternacki.net") (:keywords "chef" "knife"))])
+ (chembalance . [(20210601 1653) ((emacs (24 4))) "Balance chemical equations" single ((:commit . "ae36c823ca151f1dc6144ec96b2f5e98181c0dbb") (:authors ("Sergi Ruiz Trepat")) (:maintainer "Sergi Ruiz Trepat") (:keywords "convenience" "chemistry") (:url . "https://github.com/sergiruiztrepat/chembalance"))])
+ (chemtable . [(20210713 1551) ((emacs (24 1))) "Periodic table of the elements" single ((:commit . "05fc1449db497e715b33b8e08359fa17c3148c7b") (:authors ("Sergi Ruiz Trepat")) (:maintainer "Sergi Ruiz Trepat") (:keywords "convenience" "chemistry") (:url . "https://github.com/sergiruiztrepat/chemtable"))])
+ (cherry-blossom-theme . [(20150622 342) ((emacs (24 0))) "a soothing color theme for Emacs24." single ((:commit . "eea7653e00f35973857ee23b27bc2fae5e753e50") (:authors ("Ben Yelsey" . "byelsey1@gmail.com")) (:maintainer "Ben Yelsey" . "byelsey1@gmail.com") (:url . "https://github.com/inlinestyle/emacs-cherry-blossom-theme"))])
+ (chezmoi . [(20220310 2014) ((emacs (26 1))) "A package for interacting with chezmoi" tar ((:commit . "781783c483bc8fcdba3a230bb774c3a8a5ebe396") (:authors ("Harrison Pielke-Lombardo")) (:maintainer "Harrison Pielke-Lombardo") (:keywords "vc") (:url . "http://www.github.com/tuh8888/chezmoi.el"))])
+ (chinese-conv . [(20170807 2128) ((cl-lib (0 5))) "Conversion between Chinese Characters with opencc or cconv" single ((:commit . "b56815bbb163d642e97fa73093b5a7e87cc32574") (:authors ("gucong" . "gucong43216@gmail.com")) (:maintainer "gucong" . "gucong43216@gmail.com") (:url . "https://github.com/gucong/emacs-chinese-conv"))])
+ (chinese-number . [(20161008 509) nil "Convert numbers between Arabic and Chinese formats" single ((:commit . "7311c2a0c5eea5f016a90d733dfe75144c302fb2") (:authors (nil . "zhcosin<zhcosin@163.com>")) (:maintainer nil . "zhcosin<zhcosin@163.com>") (:url . "https://github.com/zhcosin/chinese-number"))])
+ (chinese-wbim . [(20190727 854) nil "Enable Wubi Input Method in Emacs." tar ((:commit . "5d496364b0b6bbaaf0f9b37e5a6d260d4994f260") (:authors (nil . "Guanghui Qu<guanghui8827@gmail.com>")) (:maintainer nil . "Guanghui Qu<guanghui8827@gmail.com>") (:keywords "wubi" "input" "method.") (:url . "https://github.com/andyque/chinese-wbim"))])
+ (chinese-word-at-point . [(20170811 941) ((cl-lib (0 5))) "Add `chinese-word' thing to `thing-at-point'" single ((:commit . "8223d7439e005555b86995a005b225ae042f0538") (:authors ("Chunyang Xu" . "xuchunyang56@gmail.com")) (:maintainer "Chunyang Xu" . "xuchunyang56@gmail.com") (:keywords "convenience" "chinese") (:url . "https://github.com/xuchunyang/chinese-word-at-point.el"))])
+ (chinese-yasdcv . [(20171015 144) ((cl-lib (0 5)) (pyim (1 6 0))) "Yet another StarDict frontend" tar ((:commit . "5ab830daf1273d5a5cddcb94b56a9737f12d996f") (:authors ("Feng Shu" . "tumashu@gmail.com")) (:maintainer "Feng Shu" . "tumashu@gmail.com") (:keywords "convenience" "chinese" "dictionary") (:url . "https://github.com/tumashu/chinese-yasdcv"))])
+ (chocolate-theme . [(20210128 1647) ((emacs (24 1)) (autothemer (0 2))) "A dark chocolaty theme" single ((:commit . "ccc05f7ad96d3d1332727689bf6250443adc7ec0") (:url . "http://github.com/SavchenkoValeriy/emacs-chocolate-theme"))])
+ (choice-program . [(20201217 1751) ((emacs (26)) (dash (2 17 0))) "Parameter based program" tar ((:commit . "b8b1b6c5568f8778783454d5747912487c8e69b8") (:authors ("Paul Landes")) (:maintainer "Paul Landes") (:keywords "execution" "processes" "unix" "lisp") (:url . "https://github.com/plandes/choice-program"))])
+ (chronometer . [(20190304 1528) ((emacs (24))) "a [not so] simple chronometer" single ((:commit . "8457b296ef87be339cbe47730b922757d60bdcd5") (:authors ("Marcelo Toledo" . "marcelo@marcelotoledo.com")) (:maintainer "Marcelo Toledo" . "marcelo@marcelotoledo.com") (:keywords "tools" "convenience") (:url . "https://github.com/marcelotoledo/chronometer"))])
+ (chronometrist . [(20220415 1213) ((emacs (27 1)) (dash (2 16 0)) (seq (2 20)) (ts (0 2))) "Friendly and powerful personal time tracker and analyzer" tar ((:commit . "f7b2defceed8bafb87da704ce3e7774f53abf1c4") (:authors ("contrapunctus" . "xmpp:contrapunctus@jabjab.de")) (:maintainer "contrapunctus" . "xmpp:contrapunctus@jabjab.de") (:keywords "calendar") (:url . "https://tildegit.org/contrapunctus/chronometrist"))])
+ (chronometrist-goal . [(20210510 1831) ((emacs (25 1)) (alert (1 2)) (chronometrist (0 7 0))) "Adds support for time goals to Chronometrist" single ((:commit . "6cb939d160f5d5966d7853aa23f3ed7c7ef9df44") (:authors ("contrapunctus" . "xmpp:contrapunctus@jabber.fr")) (:maintainer "contrapunctus" . "xmpp:contrapunctus@jabber.fr") (:keywords "calendar") (:url . "https://tildegit.org/contrapunctus/chronometrist-goal"))])
+ (chronometrist-key-values . [(20220414 726) ((chronometrist (0 7 0))) "add key-values to Chronometrist data" tar ((:commit . "f7b2defceed8bafb87da704ce3e7774f53abf1c4") (:authors ("contrapunctus" . "xmpp:contrapunctus@jabjab.de")) (:maintainer "contrapunctus" . "xmpp:contrapunctus@jabjab.de") (:keywords "calendar") (:url . "https://tildegit.org/contrapunctus/chronometrist"))])
+ (chronometrist-spark . [(20220321 349) ((emacs (25 1)) (chronometrist (0 7 0)) (spark (0 1))) "Show sparklines in Chronometrist buffers" tar ((:commit . "f7b2defceed8bafb87da704ce3e7774f53abf1c4") (:authors ("contrapunctus" . "xmpp:contrapunctus@jabjab.de")) (:maintainer "contrapunctus" . "xmpp:contrapunctus@jabjab.de") (:keywords "calendar") (:url . "https://tildegit.org/contrapunctus/chronometrist"))])
+ (chronos . [(20150602 1529) nil "multiple simultaneous countdown / countup timers" tar ((:commit . "b360d9dae57aa553cf2a14ffa0756a51ad71de09") (:authors ("David Knight" . "dxknight@opmbx.org")) (:maintainer "David Knight" . "dxknight@opmbx.org") (:keywords "calendar") (:url . "http://github.com/dxknight/chronos"))])
+ (chruby . [(20180114 1652) ((cl-lib (0 5))) "Emacs integration for chruby" single ((:commit . "42bc6d521f832eca8e2ba210f30d03ad5529788f") (:authors ("Arne Brasseur" . "arne@arnebrasseur.net")) (:maintainer "Arne Brasseur" . "arne@arnebrasseur.net") (:keywords "languages") (:url . "https://github.com/plexus/chruby.el"))])
+ (chyla-theme . [(20180302 1658) nil "chyla.org - green color theme." single ((:commit . "ae5e7ecace2ab474151eb0ac5ef07fba2dc32f8a") (:authors ("Adam Chyła" . "adam@chyla.org")) (:maintainer "Adam Chyła" . "adam@chyla.org") (:url . "https://github.com/chyla/ChylaThemeForEmacs"))])
+ (cider . [(20220507 1357) ((emacs (26)) (clojure-mode (5 14)) (parseedn (1 0 6)) (queue (0 2)) (spinner (1 7)) (seq (2 22)) (sesman (0 3 2))) "Clojure Interactive Development Environment that Rocks" tar ((:commit . "69d374818bd0af1489ee8828b258c689ccc24a66") (:authors ("Tim King" . "kingtim@gmail.com") ("Phil Hagelberg" . "technomancy@gmail.com") ("Bozhidar Batsov" . "bozhidar@batsov.dev") ("Artur Malabarba" . "bruce.connor.am@gmail.com") ("Hugo Duncan" . "hugo@hugoduncan.org") ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev") (:keywords "languages" "clojure" "cider") (:url . "http://www.github.com/clojure-emacs/cider"))])
+ (cider-decompile . [(20151122 537) ((cider (0 3 0)) (javap-mode (9))) "decompilation extension for cider" single ((:commit . "5d87035f3c3c14025e8f01c0c53d0ce2c8f56651") (:authors ("Dmitry Bushenko")) (:maintainer "Dmitry Bushenko") (:keywords "languages" "clojure" "cider") (:url . "http://www.github.com/clojure-emacs/cider-decompile"))])
+ (cider-eval-sexp-fu . [(20190311 2152) ((emacs (24)) (eval-sexp-fu (0 5 0))) "Briefly highlights an evaluated sexp." single ((:commit . "7fd229f1441356866aedba611fd0cf4e89b50921") (:authors ("Sylvain Benner" . "sylvain.benner@gmail.com")) (:maintainer "Sylvain Benner" . "sylvain.benner@gmail.com") (:keywords "languages" "clojure" "cider"))])
+ (cider-hydra . [(20190816 1121) ((cider (0 22 0)) (hydra (0 13 0))) "Hydras for CIDER." single ((:commit . "c3b8a15d72dddfbc390ab6a454bd7e4c765a2c95") (:authors ("Tianxiang Xiong" . "tianxiang.xiong@gmail.com")) (:maintainer "Tianxiang Xiong" . "tianxiang.xiong@gmail.com") (:keywords "convenience" "tools") (:url . "https://github.com/clojure-emacs/cider-hydra"))])
+ (ciel . [(20180914 815) ((emacs (24))) "A command that is clone of \"ci\" in vim." single ((:commit . "429773a3c551691a463ecfddd634b8bae2f48503") (:authors ("Takuma Matsushita" . "cs14095@gmail.com")) (:maintainer "Takuma Matsushita" . "cs14095@gmail.com") (:keywords "convinience") (:url . "https://github.com/cs14095/ciel.el"))])
+ (cil-mode . [(20160622 1430) nil "Common Intermediate Language mode" single ((:commit . "a78a88ca9a66a82f069329a96e34b67478ae2d9b") (:authors ("Friedrich von Never" . "friedrich@fornever.me")) (:maintainer "Friedrich von Never" . "friedrich@fornever.me") (:keywords "languages") (:url . "https://github.com/ForNeVeR/cil-mode"))])
+ (cilk-mode . [(20220411 1342) ((emacs (25 1)) (flycheck (32 -4))) "Minor mode for Cilk code editing" single ((:commit . "794821e129ea47b04fdeedc61d9ccb3c4240c72d") (:authors ("Alexandros-Stavros Iliopoulos <https://github.com/ailiop>")) (:maintainer "Alexandros-Stavros Iliopoulos" . "1577182+ailiop@users.noreply.github.com") (:keywords "c" "convenience" "faces" "languages") (:url . "https://github.com/ailiop/cilk-mode"))])
+ (cinspect . [(20150716 233) ((emacs (24)) (cl-lib (0 5)) (deferred (0 3 1)) (python-environment (0 0 2))) "Use cinspect to look at the CPython source of builtins and other C objects!" single ((:commit . "4e199a90f89b335cccda1518aa0963e0a1d4fbab") (:authors ("Ben Yelsey" . "ben.yelsey@gmail.com")) (:maintainer "Ben Yelsey" . "ben.yelsey@gmail.com") (:keywords "python") (:url . "https://github.com/inlinestyle/cinspect-mode"))])
+ (circadian . [(20181024 1256) ((emacs (24 4))) "Theme-switching based on daytime" single ((:commit . "bf5a00ea45c14dfdcda72c5d9f61bcd230c48159") (:authors ("Guido Schmidt")) (:maintainer "Guido Schmidt" . "git@guidoschmidt.cc") (:keywords "themes") (:url . "https://github.com/GuidoSchmidt/circadian"))])
+ (circe . [(20220421 1956) ((emacs (24 5)) (cl-lib (0 5))) "Client for IRC in Emacs" tar ((:commit . "710f057fedae6e9b820cce9336fef24b7d057e4c") (:authors ("Jorgen Schaefer" . "forcer@forcix.cx")) (:maintainer "Jorgen Schaefer" . "forcer@forcix.cx") (:keywords "irc" "chat" "comm") (:url . "https://github.com/emacs-circe/circe"))])
+ (circe-notifications . [(20180102 2318) ((emacs (24 4)) (circe (2 3)) (alert (1 2))) "Add desktop notifications to Circe." single ((:commit . "291149ac12877bbd062da993479d3533a26862b0") (:authors ("Ruben Maher" . "r@rkm.id.au")) (:maintainer "Ruben Maher" . "r@rkm.id.au") (:url . "https://github.com/eqyiel/circe-notifications"))])
+ (circleci-api . [(20210227 1607) ((emacs (27)) (request (0 3 2))) "Bindings for the CircleCI API" single ((:commit . "2e39c5896819bb2063f9d7795c4299f419cf5542") (:authors ("Robin Schroer")) (:maintainer "Robin Schroer") (:url . "https://github.com/sulami/circleci-api"))])
+ (citar . [(20220509 2336) ((emacs (27 1)) (parsebib (3 0)) (org (9 5)) (citeproc (0 9))) "Citation-related commands for org, latex, markdown" tar ((:commit . "9a6fc6da11ad2b475244cc4cbd51c77615e9aad3") (:authors ("Bruce D'Arcus <https://github.com/bdarcus>")) (:maintainer "Bruce D'Arcus <https://github.com/bdarcus>") (:url . "https://github.com/bdarcus/citar"))])
+ (citeproc . [(20220124 721) ((emacs (25)) (dash (2 13 0)) (s (1 12 0)) (f (0 18 0)) (queue (0 2)) (string-inflection (1 0)) (org (9)) (parsebib (2 4))) "A CSL 1.0.2 Citation Processor" tar ((:commit . "ba49516265fa24b138346c4918d39d19b4de8a62") (:authors ("András Simonyi" . "andras.simonyi@gmail.com")) (:maintainer "András Simonyi" . "andras.simonyi@gmail.com") (:keywords "bib") (:url . "https://github.com/andras-simonyi/citeproc-el"))])
+ (citeproc-org . [(20200915 2009) ((emacs (25 1)) (dash (2 12 0)) (org (9)) (f (0 18 0)) (citeproc (0 1)) (org-ref (1 1 1))) "Render org-mode references in CSL styles" tar ((:commit . "20cd7e817420a3f6e7b82faea901a3c67c6d4d9f") (:authors ("András Simonyi" . "andras.simonyi@gmail.com")) (:maintainer "András Simonyi" . "andras.simonyi@gmail.com") (:keywords "org-ref" "org-mode" "cite" "bib") (:url . "https://github.com/andras-simonyi/citeproc-org"))])
+ (citre . [(20220427 1203) ((emacs (26 1))) "Ctags IDE on the True Editor" tar ((:commit . "87e2cbf3b2ae6d59ec919a2dcb38e56ccfa5ec14") (:authors ("Hao Wang" . "amaikinono@gmail.com")) (:maintainer "Hao Wang" . "amaikinono@gmail.com") (:keywords "convenience" "tools") (:url . "https://github.com/universal-ctags/citre"))])
+ (cl-format . [(20210831 530) nil "CL format routine." tar ((:commit . "ad1a4fb6bc91e65ea90bcf6792cc5a1be5380f9d") (:authors ("Andreas Politz" . "politza@fh-trier.de")) (:maintainer "akater" . "nuclearspace@gmail.com") (:keywords "extensions") (:url . "https://gitlab.com/akater/elisp-cl-format"))])
+ (cl-libify . [(20181130 230) ((emacs (25))) "Update elisp code to use cl-lib instead of cl" single ((:commit . "f215866d7d7c52e84220cd541f40608a5b85abf0") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "lisp") (:url . "https://github.com/purcell/cl-libify"))])
+ (clang-capf . [(20220122 1219) ((emacs (24 4))) "Completion-at-point backend for c/c++ using clang" single ((:commit . "b1765719288a138e125cc5ce624ef561c80015bf") (:authors ("Philip K. <philipk [at] posteo [dot] net>")) (:maintainer "Philip K. <philipk [at] posteo [dot] net>") (:keywords "c" "abbrev" "convenience") (:url . "https://git.sr.ht/~pkal/clang-capf"))])
+ (clang-format . [(20191106 950) ((cl-lib (0 3))) "Format code using clang-format" single ((:commit . "e48ff8ae18dc7ab6118c1f6752deb48cb1fc83ac") (:keywords "tools" "c"))])
+ (clang-format+ . [(20190824 2216) ((emacs (25 1)) (clang-format (20180406 1514))) "Minor mode for automatic clang-format application" single ((:commit . "ddd4bfe1a13c2fd494ce339a320a51124c1d2f68") (:keywords "c" "c++" "clang-format") (:url . "https://github.com/SavchenkoValeriy/emacs-clang-format-plus"))])
+ (clean-aindent-mode . [(20171017 2043) nil "Simple indent and unindent, trims indent white-space" single ((:commit . "a97bcae8f43a9ff64e95473e4ef0d8bafe829211") (:authors ("peter marinov" . "efravia@gmail.com")) (:maintainer "peter marinov" . "efravia@gmail.com") (:keywords "indentation" "whitespace" "backspace") (:url . "https://github.com/pmarinov/clean-aindent-mode"))])
+ (clean-buffers . [(20160529 2259) ((cl-lib (0 5))) "clean useless buffers" single ((:commit . "1be6c54e3095761b6b64bf749faae3dfce94e72a") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "convenience" "usability" "buffers"))])
+ (clear-text . [(20160406 2043) nil "Make you use clear text" tar ((:commit . "b50669b6077d6948f72cb3c649281d206e0c2f2b") (:authors ("Chunyang Xu" . "xuchunyang56@gmail.com")) (:maintainer "Chunyang Xu" . "xuchunyang56@gmail.com") (:keywords "convenience") (:url . "https://github.com/xuchunyang/clear-text.el"))])
+ (clevercss . [(20131229 155) nil "A major mode for editing CleverCSS files" single ((:commit . "b8a3c0dd674367c62b1a1ffec84d88fe0c0219bc") (:authors ("Joe Schafer" . "joesmoe10@gmail.com")) (:maintainer "Joe Schafer" . "joesmoe10@gmail.com") (:keywords "languages" "css"))])
+ (clhs . [(20210428 1911) nil "Access the Common Lisp HyperSpec (CLHS)" single ((:commit . "7b106c4fb5a6388ab753f94740f6dfadcdeedcbb") (:maintainer "Sam Steingold" . "sds@gnu.org") (:keywords "lisp" "common lisp" "emacs" "ansi cl" "hyperspec") (:url . "https://gitlab.com/sam-s/clhs"))])
+ (click-mode . [(20180611 44) ((emacs (24))) "Major mode for the Click Modular Router Project" single ((:commit . "b94ea8cce89cf0e753b2ab915202d49ffc470fb6") (:authors ("Brian Malehorn" . "bmalehorn@gmail.com")) (:maintainer "Brian Malehorn" . "bmalehorn@gmail.com") (:keywords "click" "router") (:url . "https://github.com/bmalehorn/click-mode"))])
+ (clingo-mode . [(20220502 2020) ((emacs (24 3))) "A major mode for editing Answer Set Programs" single ((:commit . "cf56ce6b5c50506f6cea27e1dde0441dd8d15ee9") (:authors ("Ivan Uemlianin" . "ivan@llaisdy.com")) (:maintainer "Ivan Uemlianin" . "ivan@llaisdy.com") (:keywords "asp" "clingo" "answer set programs" "potassco" "major mode" "languages") (:url . "https://github.com/llaisdy/clingo-mode"))])
+ (clipetty . [(20200327 2241) ((emacs (25 1))) "Send every kill from a TTY frame to the system clipboard" single ((:commit . "01b39044b9b65fa4ea7d3166f8b1ffab6f740362") (:authors ("Mike Hamrick" . "mikeh@muppetlabs.com")) (:maintainer "Mike Hamrick" . "mikeh@muppetlabs.com") (:keywords "terminals" "convenience") (:url . "https://github.com/spudlyo/clipetty"))])
+ (cliphist . [(20210813 750) ((emacs (25 1))) "paste from clipboard managers" tar ((:commit . "a794c95e2f70a9b042af7bd07e2483fde75f2a2e") (:authors ("Chen Bin <chenbin DOT sh AT gmail DOT com>")) (:maintainer "Chen Bin <chenbin DOT sh AT gmail DOT com>") (:keywords "clipboard" "manager" "history") (:url . "http://github.com/redguardtoo/cliphist"))])
+ (clipmon . [(20180129 1054) nil "Clipboard monitor - watch system clipboard, add changes to kill ring/autoinsert" tar ((:commit . "95dc56c7ed84a654ec90f4740eb6df1050de8cf1") (:authors ("Brian Burns" . "bburns.km@gmail.com")) (:maintainer "Brian Burns" . "bburns.km@gmail.com") (:keywords "convenience") (:url . "https://github.com/bburns/clipmon"))])
+ (clippy . [(20161028 1954) ((pos-tip (1 0))) "Show tooltip with function documentation at point" single ((:commit . "e77f6b63e54d74e243be98accad474e38f7e2a86") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "docs") (:url . "https://github.com/Fuco1/clippy.el"))])
+ (clips-mode . [(20170909 823) nil "Major mode for editing CLIPS code and REPL" tar ((:commit . "dd38e2822640a38f7d8bfec4f69d8dd24be27074") (:authors ("David E. Young" . "david.young@fnc.fujitsu.com") ("Andrey Kotlarski" . "m00naticus@gmail.com") ("Grant Rettke" . "grettke@acm.org")) (:maintainer "Grant Rettke" . "grettke@acm.org") (:keywords "clips"))])
+ (clj-decompiler . [(20220103 1746) ((emacs (26 1)) (clojure-mode (5 12)) (cider (1 2 0))) "Clojure Java decompiler expansion" single ((:commit . "8c0c53f87e6e33f2be7e7aff6095eb586b50be1a") (:authors ("Ben Sless" . "ben.sless@gmail.com")) (:maintainer "Ben Sless" . "ben.sless@gmail.com") (:keywords "languages" "clojure" "cider" "java" "decompiler") (:url . "https://www.github.com/bsless/clj-decompiler.el"))])
+ (clj-deps-new . [(20220221 2235) ((emacs (25 1)) (transient (0 3 7))) "Create clojure projects from templates" single ((:commit . "183089e6d4ded90efff491916e1c87411ead0461") (:authors ("jpe90" . "eskinjp@gmail.com")) (:maintainer "jpe90" . "eskinjp@gmail.com") (:url . "https://github.com/jpe90/emacs-deps-new"))])
+ (clj-refactor . [(20220315 2251) ((emacs (26 1)) (seq (2 19)) (yasnippet (0 6 1)) (paredit (24)) (multiple-cursors (1 2 2)) (clojure-mode (5 14)) (cider (1 3)) (parseedn (1 0 6)) (inflections (2 3)) (hydra (0 13 2))) "A collection of commands for refactoring Clojure code" tar ((:commit . "f368c56c83843396b160440f472a661a3b639862") (:authors ("Magnar Sveen" . "magnars@gmail.com") ("Lars Andersen" . "expez@expez.com") ("Benedek Fazekas" . "benedek.fazekas@gmail.com") ("Bozhidar Batsov" . "bozhidar@batsov.dev")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "convenience" "clojure" "cider"))])
+ (cljr-helm . [(20160913 828) ((clj-refactor (0 13 0)) (helm-core (1 7 7)) (cl-lib (0 5))) "Wraps clojure refactor commands with helm" single ((:commit . "f2fc7b698a56e4a44d5dfbc6a55d77a93c0fa9a4") (:authors ("Phil Jackson" . "phil@shellarchive.co.uk")) (:maintainer "Phil Jackson" . "phil@shellarchive.co.uk") (:keywords "helm" "clojure" "refactor") (:url . "https://github.com/philjackson/cljr-helm"))])
+ (cljr-ivy . [(20200602 1607) ((clj-refactor (2 5 0)) (ivy (0 13 0)) (emacs (24 3)) (cl-lib (0 6 1))) "Access clojure refactor with ivy completion" single ((:commit . "921ba65d0db7cda4edcd690c708946125b874a70") (:authors ("Wanderson Ferreira" . "iagwanderson@gmail.com")) (:maintainer "Wanderson Ferreira" . "iagwanderson@gmail.com") (:keywords "convenience" "matching") (:url . "https://github.com/wandersoncferreira/cljr-ivy"))])
+ (cljsbuild-mode . [(20160402 1700) nil "A minor mode for the ClojureScript 'lein cljsbuild' command" single ((:commit . "fa2315660cb3ce944b5e16c679dcf5afd6a97f4c") (:keywords "clojure" "clojurescript" "leiningen" "compilation") (:url . "http://github.com/kototama/cljsbuild-mode"))])
+ (clmemo . [(20220204 1345) nil "Change Log MEMO" tar ((:commit . "f695c38c551f72f6ac5e1a82badc540c80d3b33b") (:authors ("Masayuki Ataka" . "masayuki.ataka@gmail.com")) (:maintainer "Masayuki Ataka" . "masayuki.ataka@gmail.com") (:keywords "convenience") (:url . "https://github.com/ataka/clmemo"))])
+ (cloc . [(20170728 1824) ((cl-lib (0 5))) "count lines of code over emacs buffers" single ((:commit . "f30f0472e465cc8d433d2473e9d3b8dfe2c94491") (:authors ("Danny McClanahan" . "danieldmcclanahan@gmail.com")) (:maintainer "Danny McClanahan" . "danieldmcclanahan@gmail.com") (:keywords "cloc" "count" "source" "code" "lines") (:url . "https://github.com/cosmicexplorer/cloc-emacs"))])
+ (clocker . [(20190214 1833) ((projectile (0 11 0)) (dash (2 10)) (spaceline (2 0 1))) "Note taker and clock-in enforcer" single ((:commit . "c4d76968a49287ce3bac0832bb5d5d076054c96f") (:authors ("Roman Gonzalez" . "romanandreg@gmail.com")) (:maintainer "Roman Gonzalez" . "romanandreg@gmail.com") (:keywords "org"))])
+ (clojars . [(20180825 1951) ((request-deferred (0 2 0))) "clojars.org search interface" single ((:commit . "696c5b056e45067512a7d6dcce2515f3c639f61b") (:authors ("Joshua Miller" . "josh@joshmiller.io")) (:maintainer "Joshua Miller" . "josh@joshmiller.io") (:keywords "docs" "help" "tools") (:url . "https://github.com/joshuamiller/clojars.el"))])
+ (clojure-essential-ref . [(20200619 1653) ((emacs (24)) (cider (0 24 0))) "Cider-doc to \"Clojure, The Essential Reference\"" single ((:commit . "13ac560c25f7355fba00d9ca8c9f4ca03e7fd189") (:url . "https://github.com/p3r7/clojure-essential-ref"))])
+ (clojure-essential-ref-nov . [(20200719 608) ((emacs (24)) (dash (2 16 0)) (nov (0 3 1)) (clojure-essential-ref (0 1 0))) "Cider-doc to \"Clojure, The Essential Reference\" (EPUB)" single ((:commit . "13ac560c25f7355fba00d9ca8c9f4ca03e7fd189") (:url . "https://github.com/p3r7/clojure-essential-ref"))])
+ (clojure-mode . [(20220418 2015) ((emacs (25 1))) "Major mode for Clojure code" single ((:commit . "b6f41d74904daa9312648f3a7bea7a72fd8e140b") (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev") (:keywords "languages" "clojure" "clojurescript" "lisp") (:url . "http://github.com/clojure-emacs/clojure-mode"))])
+ (clojure-mode-extra-font-locking . [(20211230 817) ((clojure-mode (3 0))) "Extra font-locking for Clojure mode" single ((:commit . "b6f41d74904daa9312648f3a7bea7a72fd8e140b") (:authors ("Bozhidar Batsov" . "bozhidar@batsov.dev")) (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev") (:keywords "languages" "lisp") (:url . "http://github.com/clojure-emacs/clojure-mode"))])
+ (clojure-quick-repls . [(20150814 736) ((cider (0 8 1)) (dash (2 9 0))) "Quickly create Clojure and ClojureScript repls for a project." single ((:commit . "730311dd3ac4e0aceb0204f818b422017873467f") (:keywords "languages" "clojure" "cider" "clojurescript") (:url . "https://github.com/symfrog/clojure-quick-repls"))])
+ (clojure-snippets . [(20180314 1308) ((yasnippet (0 10 0))) "Yasnippets for clojure" tar ((:commit . "6068dca90467a0f4ebc2cd39338a173d6f5ddc04") (:authors ("Max Penet" . "m@qbits.cc")) (:maintainer "Max Penet" . "m@qbits.cc") (:keywords "snippets"))])
+ (clomacs . [(20220415 1035) ((emacs (24 3)) (cider (0 22 1)) (s (1 12 0)) (simple-httpd (1 4 6)) (dash (2 19 1))) "Simplifies Emacs Lisp interaction with Clojure." single ((:commit . "9cd7c9fd86bc7bc627a31275d1ef131378b90a49") (:authors ("Kostafey" . "kostafey@gmail.com")) (:maintainer "Kostafey" . "kostafey@gmail.com") (:keywords "clojure" "interaction") (:url . "https://github.com/clojure-emacs/clomacs"))])
+ (closql . [(20220422 1601) ((emacs (25 1)) (compat (28 1 1 0)) (emacsql-sqlite (3 0 0))) "Store EIEIO objects using EmacSQL" single ((:commit . "87d2edae8bc3d390bcfc5e909e9c13ff9fce994a") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "extensions") (:url . "https://github.com/emacscollective/closql"))])
+ (closure-lint-mode . [(20101118 2124) nil "minor mode for the Closure Linter" single ((:commit . "bc3d2fd5c35580bf1b8af43b12484c95a343b4b5") (:authors ("Roman Scherer" . "roman@burningswell.com")) (:maintainer "Roman Scherer" . "roman@burningswell.com") (:keywords "tools" "closure" "javascript" "lint" "flymake") (:url . "https://github.com/r0man/closure-lint-mode"))])
+ (cloud-theme . [(20220205 1336) ((emacs (24))) "A light colored theme" single ((:commit . "16372ea1f527917102ac302afaec3ef09e289d24") (:authors ("Valerii Lysenko" . "vallyscode@gmail.com")) (:maintainer "Valerii Lysenko" . "vallyscode@gmail.com") (:keywords "color" "theme") (:url . "https://github.com/vallyscode/cloud-theme"))])
+ (cloud-to-butt-erc . [(20130627 2308) nil "Replace 'the cloud' with 'my butt'" single ((:commit . "6710c03d1bc91736435cbfe845924940cae34e5c") (:authors ("David Leatherman" . "leathekd@gmail.com")) (:maintainer "David Leatherman" . "leathekd@gmail.com") (:url . "http://www.github.com/leathekd/cloud-to-butt-erc"))])
+ (clues-theme . [(20161213 1127) ((emacs (24 0))) "an Emacs 24 theme which may well be fully awesome..." single ((:commit . "abd61f2b7f3e98de58ca26e6d1230e70c6406cc7") (:authors ("Jason Milkins" . "jasonm23@gmail.com")) (:maintainer "Jason Milkins" . "jasonm23@gmail.com") (:url . "https://github.com/emacsfodder/emacs-clues-theme"))])
+ (cm-mode . [(20170203 2107) ((cl-lib (0 5))) "Minor mode for CriticMarkup" single ((:commit . "276d49c859822265070ae5dfbb403fd7d8d06436") (:authors ("Joost Kremers" . "joostkremers@fastmail.fm")) (:maintainer "Joost Kremers" . "joostkremers@fastmail.fm") (:keywords "text" "markdown"))])
+ (cmake-font-lock . [(20211224 2006) ((cmake-mode (0 0))) "Advanced, type aware, highlight support for CMake" single ((:commit . "0d6111b36a66013aa9b452e664c93308df3b07e1") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "faces" "languages") (:url . "https://github.com/Lindydancer/cmake-font-lock"))])
+ (cmake-ide . [(20210610 1525) ((emacs (24 4)) (cl-lib (0 5)) (seq (1 11)) (levenshtein (0)) (s (1 11 0))) "Calls CMake to find out include paths and other compiler flags" single ((:commit . "28dc4ab5bd01d99553901b4efeb7234280928b18") (:authors ("Atila Neves" . "atila.neves@gmail.com")) (:maintainer "Atila Neves" . "atila.neves@gmail.com") (:keywords "languages") (:url . "http://github.com/atilaneves/cmake-ide"))])
+ (cmake-mode . [(20220322 1258) ((emacs (24 1))) "major-mode for editing CMake sources" single ((:commit . "02b4cd9827b7f2354350bef4e44cb3514edb5c26"))])
+ (cmake-project . [(20171121 1115) nil "Integrates CMake build process with Emacs" single ((:commit . "a7cf9e4c01c4683e14b6942cc5cc5e8cddc98721") (:authors ("Alexander Lamaison" . "alexander.lamaison@gmail")) (:maintainer "Alexander Lamaison" . "alexander.lamaison@gmail") (:keywords "c" "cmake" "languages" "tools") (:url . "http://github.com/alamaison/emacs-cmake-project"))])
+ (cmd-to-echo . [(20161203 2133) ((emacs (24 4)) (s (1 11 0)) (shell-split-string (20151224 208))) "Show the output of long-running commands in the echo area" single ((:commit . "e0e874fc0e1ad6d291e39ed76023445297ad438a") (:authors ("Tijs Mallaerts" . "tijs.mallaerts@gmail.com")) (:maintainer "Tijs Mallaerts" . "tijs.mallaerts@gmail.com"))])
+ (cmm-mode . [(20150225 746) nil "Major mode for C-- source code" single ((:commit . "c3ad514dff3eb30434f6b20d953276d4c00de1ee"))])
+ (cnfonts . [(20211227 248) ((emacs (24))) "A simple Chinese fonts config tool" tar ((:commit . "7279d4178b4d52ae763d2224140488887ce57261") (:authors ("Feng Shu" . "tumashu@163.com")) (:maintainer "Feng Shu" . "tumashu@163.com") (:keywords "convenience" "chinese" "font") (:url . "https://github.com/tumashu/cnfonts"))])
+ (cobalt . [(20180304 1155) ((emacs (24))) "Easily use the Cobalt.rs static site generator" single ((:commit . "88ef936373a5493183d49ec69ca541bcc749a109") (:authors ("Juan Karlo Licudine" . "accidentalrebel@gmail.com")) (:maintainer "Juan Karlo Licudine" . "accidentalrebel@gmail.com") (:keywords "convenience") (:url . "https://github.com/cobalt-org/cobalt.el"))])
+ (cobra-mode . [(20140116 2116) nil "Major mode for .NET-based Cobra language" single ((:commit . "acd6e53f6286af5176471d01f25257e5ddb6dd01") (:authors ("Taylor \"Nekroze\" Lawson")) (:maintainer "Taylor \"Nekroze\" Lawson") (:keywords "languages") (:url . "http://github.com/Nekroze/cobra-mode"))])
+ (codcut . [(20190915 1009) nil "Share pieces of code to Codcut" single ((:commit . "7ca7db69e8c38ec45eb572ad16ab2b56086f2131") (:authors ("Diego Pasquali" . "hello@dgopsq.space")) (:maintainer "Diego Pasquali" . "hello@dgopsq.space") (:keywords "comm" "tools" "codcut" "share") (:url . "https://github.com/codcut/codcut-emacs"))])
+ (code-archive . [(20190612 308) ((emacs (24 3))) "git supported code archive and reference for org-mode" single ((:commit . "1ad9af6679d0294c3056eab9cad673f29c562721") (:authors ("Michael Schuldt" . "mbschuldt@gmail.com")) (:maintainer "Michael Schuldt" . "mbschuldt@gmail.com") (:url . "https://github.com/mschuldt/code-archive"))])
+ (code-cells . [(20220305 1320) ((emacs (27 1))) "Lightweight notebooks with support for ipynb files" single ((:commit . "8660bdeedee360e5eb632f1eb1356eb09d7dfbee") (:authors ("Augusto Stoffel" . "arstoffel@gmail.com")) (:maintainer "Augusto Stoffel" . "arstoffel@gmail.com") (:keywords "convenience" "outlines") (:url . "https://github.com/astoff/code-cells.el"))])
+ (code-library . [(20160426 1218) ((gist (1 3 1))) "use org-mode to collect code snippets" single ((:commit . "32d59c5c845d6dbdda18f9bd1c03a58d55417fc5") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "lisp" "code"))])
+ (code-review . [(20220503 1344) ((emacs (25 1)) (closql (1 2 0)) (magit (3 0 0)) (a (1 0 0)) (ghub (3 5 1)) (uuidgen (1 2)) (deferred (0 5 1)) (markdown-mode (2 4)) (forge (0 3 0)) (emojify (1 2))) "Perform code review from Github, Gitlab, and Bitbucket Cloud" tar ((:commit . "d38fbe59304ed31c759ce733cda16f69a8ef2d8c") (:authors ("Wanderson Ferreira <https://github.com/wandersoncferreira>")) (:maintainer "Wanderson Ferreira" . "wand@hey.com") (:keywords "git" "tools" "vc") (:url . "https://github.com/wandersoncferreira/code-review"))])
+ (code-stats . [(20201209 2135) ((emacs (25)) (request (0 3 0))) "Code::Stats plugin" single ((:commit . "9a467dfd6a3cef849468623e1c085cbf59dac154") (:authors ("Xu Chunyang" . "mail@xuchunyang.me")) (:maintainer "Xu Chunyang" . "mail@xuchunyang.me") (:url . "https://github.com/xuchunyang/code-stats-emacs"))])
+ (codebug . [(20140929 2137) nil "Interact with codebug" single ((:commit . "ac0e4331ba94ccb5203fa492570e1ca6b90c3d52") (:authors ("Shane Dowling")) (:maintainer "Shane Dowling") (:url . "http://www.shanedowling.com/"))])
+ (codesearch . [(20181006 1431) ((log4e (0 3 1))) "Core support for managing codesearch tools" tar ((:commit . "f6eb96f034a925444412cfa03e45e0ccbbafe3f2") (:authors ("Austin Bingham" . "austin.bingham@gmail.com") ("Youngjoo Lee" . "youngker@gmail.com")) (:maintainer "Austin Bingham" . "austin.bingham@gmail.com") (:keywords "tools" "development" "search") (:url . "https://github.com/abingham/emacs-codesearch"))])
+ (codic . [(20150926 1127) ((emacs (24)) (cl-lib (0 5))) "Search Codic (codic.jp) naming dictionaries" tar ((:commit . "52bbb6997ef4ab9fb7fea43bbfff7f04671aa557") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-codic"))])
+ (coffee-fof . [(20131012 1230) ((coffee-mode (0 4 1))) "A coffee-mode configuration for `ff-find-other-file'." single ((:commit . "211529594bc074721c6cbc4edb73a63cc05f89ac") (:authors ("Yasuyki Oka" . "yasuyk@gmail.com")) (:maintainer "Yasuyki Oka" . "yasuyk@gmail.com") (:keywords "coffee-mode") (:url . "http://github.com/yasuyk/coffee-fof"))])
+ (coffee-mode . [(20200315 1133) ((emacs (24 3))) "Major mode for CoffeeScript code" single ((:commit . "35a41c7d8233eac0b267d9593e67fb8b6235e134") (:authors ("Chris Wanstrath" . "chris@ozmm.org")) (:maintainer "Chris Wanstrath" . "chris@ozmm.org") (:keywords "coffeescript" "major" "mode") (:url . "http://github.com/defunkt/coffee-mode"))])
+ (coin-ticker . [(20170611 727) ((request (0 3 0)) (emacs (25))) "Show a cryptocurrency price ticker" single ((:commit . "9efab90fe4e6f29464af14e0d8fd1e20c0147b80") (:authors ("Evan Klitzke" . "evan@eklitzke.org")) (:maintainer "Evan Klitzke" . "evan@eklitzke.org") (:keywords "news") (:url . "https://github.com/eklitzke/coin-ticker-mode"))])
+ (colonoscopy-theme . [(20170808 1309) ((emacs (24 0))) "an Emacs 24 theme based on Colonoscopy (tmTheme)" single ((:commit . "64bbb322b13dae91ce9f1e3581f836f94f800ead") (:authors ("Jason Milkins")) (:maintainer "Jason Milkins") (:url . "https://github.com/emacsfodder/tmtheme-to-deftheme"))])
+ (color-identifiers-mode . [(20220327 1143) ((dash (2 5 0)) (emacs (24))) "Color identifiers based on their names" single ((:commit . "6fe76f0c3090f6023da3806e9d760e93810905d4") (:authors ("Ankur Dave" . "ankurdave@gmail.com")) (:maintainer "Ankur Dave" . "ankurdave@gmail.com") (:keywords "faces" "languages") (:url . "https://github.com/ankurdave/color-identifiers-mode"))])
+ (color-moccur . [(20141223 35) nil "multi-buffer occur (grep) mode" single ((:commit . "4f1c59ffd1ccc2ab1a171cd6b721e8cb9e002fb7") (:keywords "convenience") (:url . "http://www.bookshelf.jp/elc/color-moccur.el"))])
+ (color-theme . [(20190220 1115) nil "An OBSOLETE color-theme implementation" tar ((:commit . "3a2f6b615f5e2401e30d93a3e0adc210bbb4b7aa") (:authors ("Jonadab the Unsightly One" . "jonadab@bright.net")) (:maintainer "Xavier Maillard" . "zedek@gnu.org") (:keywords "faces") (:url . "http://www.emacswiki.org/cgi-bin/wiki.pl?ColorTheme"))])
+ (color-theme-approximate . [(20140228 436) nil "Makes Emacs theme works on terminal transparently" single ((:commit . "f54301ca39bc5d2ffb000f233f8114184a3e7d71") (:authors ("Tung Dao" . "me@tungdao.com")) (:maintainer "Tung Dao" . "me@tungdao.com"))])
+ (color-theme-buffer-local . [(20170126 601) ((color-theme (0))) "Install color-themes by buffer." single ((:commit . "e606dec66f16a06140b9aad625a4fd52bca4f936") (:authors ("Victor Borja" . "vic.borja@gmail.com")) (:maintainer "Victor Borja" . "vic.borja@gmail.com") (:keywords "faces") (:url . "http://github.com/vic/color-theme-buffer-local"))])
+ (color-theme-modern . [(20220506 858) ((emacs (24))) "Reimplement colortheme with Emacs 24 theme framework." tar ((:commit . "74ad69bbca6fcfff3c0960d888c7c9c1f9f3e2e8") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/emacs-jp/replace-colorthemes"))])
+ (color-theme-sanityinc-solarized . [(20200805 603) ((emacs (24 1)) (cl-lib (0 6))) "A version of Ethan Schoonover's Solarized themes" tar ((:commit . "7ef39ac9d99bfb699903cfc3623521c0ceec7b86") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "faces" "themes") (:url . "https://github.com/purcell/color-theme-sanityinc-solarized"))])
+ (color-theme-sanityinc-tomorrow . [(20220412 1643) nil "A version of Chris Kempson's \"tomorrow\" themes" tar ((:commit . "2b373a767129ed4e8c4d52e0ee827786224d7106") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "faces" "themes") (:url . "https://github.com/purcell/color-theme-sanityinc-tomorrow"))])
+ (color-theme-x . [(20201204 2245) ((cl-lib (0 5))) "convert color themes to X11 resource settings" single ((:commit . "ec853dd931d625e07116fbc91d8829bd15f90889") (:authors ("Matthew Kennedy" . "mkennedy@killr.ath.cx")) (:maintainer "Andrew Johnson" . "andrew@andrewjamesjohnson.com") (:keywords "convenience" "faces" "frames") (:url . "https://github.com/ajsquared/color-theme-x"))])
+ (colorless-themes . [(20210102 1035) ((emacs (24 1))) "A macro to generate mostly colorless themes" single ((:commit . "c1ed1e12541cf05cc6c558d23c089c07e10b54d7") (:authors ("Thomas Letan" . "contact@thomasletan.fr")) (:maintainer "Thomas Letan" . "contact@thomasletan.fr") (:keywords "faces themes" "faces") (:url . "https://git.sr.ht/~lthms/colorless-themes.el"))])
+ (colormaps . [(20171008 2224) ((emacs (25))) "Hex colormaps" single ((:commit . "19fbb64a6288d505b9cf45c9b5a3eed0bfb135e2") (:authors ("Abhinav Tushar" . "lepisma@fastmail.com")) (:maintainer "Abhinav Tushar" . "lepisma@fastmail.com") (:keywords "tools") (:url . "https://github.com/lepisma/colormaps.el"))])
+ (column-enforce-mode . [(20200605 1933) nil "Highlight text that extends beyond a column" single ((:commit . "14a7622f2268890e33536ccd29510024d51ee96f") (:authors ("Jordon Biondo")) (:maintainer "Jordon Biondo") (:url . "www.github.com/jordonbiondo/column-enforce-mode"))])
+ (com-css-sort . [(20201002 1430) ((emacs (25 1)) (s (1 12 0))) "Common way of sorting the CSS attributes" single ((:commit . "fa85a6b9d852d725730a6ad1cc5afeb4ede93ca7") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs090218/com-css-sort"))])
+ (comb . [(20201010 1147) ((emacs (25 1))) "Interactive code auditing and grep tool" tar ((:commit . "31f3e94afb2a7f7d18d30c2468a0c683700f7a66") (:authors ("Andrea Cardaci" . "cyrus.and@gmail.com")) (:maintainer "Andrea Cardaci" . "cyrus.and@gmail.com") (:keywords "matching") (:url . "https://github.com/cyrus-and/comb"))])
+ (comby . [(20200629 140) ((emacs (25 1))) "Emacs comby integration" single ((:commit . "928b8b8959a2556aba5526f2a25801341eb59dc3") (:authors ("Sergey Kostyaev" . "feo.me@ya.ru")) (:maintainer "Sergey Kostyaev" . "feo.me@ya.ru") (:keywords "languages") (:url . "https://github.com/s-kostyaev/comby.el"))])
+ (comint-hyperlink . [(20211026 100) ((emacs (24 3))) "Create hyperlinks in comint for SGR URL control sequences" single ((:commit . "905f2db1f95950899301b9f71faed9e9362cf5dc") (:authors ("Matthew Bauer" . "mjbauer95@gmail.com")) (:maintainer "Matthew Bauer" . "mjbauer95@gmail.com") (:keywords "comint" "shell" "processes" "hypermedia" "terminals") (:url . "https://github.com/matthewbauer/comint-hyperlink"))])
+ (comint-intercept . [(20200106 454) ((emacs (24 3))) "Intercept input in comint-mode" single ((:commit . "3c9a6125e450435b79ab5e6466f830e57c5e0a30") (:authors ("\"Huang, Ying\"" . "huang.ying.caritas@gmail.com")) (:maintainer "\"Huang, Ying\"" . "huang.ying.caritas@gmail.com") (:keywords "processes" "terminals") (:url . "https://github.com/hying-caritas/comint-intercept"))])
+ (command-log-mode . [(20160413 447) nil "log keyboard commands to buffer" single ((:commit . "af600e6b4129c8115f464af576505ea8e789db27") (:authors ("Michael Weber" . "michaelw@foldr.org")) (:maintainer "Michael Weber" . "michaelw@foldr.org") (:keywords "help") (:url . "https://github.com/lewang/command-log-mode"))])
+ (command-queue . [(20160328 1725) ((emacs (24 3))) "shell command queue" single ((:commit . "f327c6f852592229a755ec6de0c62c6aeafd6659") (:authors ("Yuki INOUE <inouetakahiroki at gmail.com>")) (:maintainer "Yuki INOUE <inouetakahiroki at gmail.com>") (:url . "https://github.com/Yuki-Inoue/command-queue"))])
+ (commander . [(20140120 1852) ((s (1 6 0)) (dash (2 0 0)) (cl-lib (0 3)) (f (0 6 1))) "Emacs command line parser" single ((:commit . "9ba1456b0a389a2f7b42b6f42a4208ddd87ce609") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "cli" "argv") (:url . "http://github.com/rejeep/commander.el"))])
+ (comment-dwim-2 . [(20210101 1820) ((emacs (24 4))) "An all-in-one comment command to rule them all" single ((:commit . "7cdafd6d98234a7402865b8abdae54a2f2551c94") (:authors ("Rémy Ferré" . "dev@remyferre.net")) (:maintainer "Rémy Ferré" . "dev@remyferre.net") (:keywords "convenience") (:url . "https://github.com/remyferre/comment-dwim-2"))])
+ (comment-or-uncomment-sexp . [(20190225 1122) ((emacs (24))) "Command for commenting the sexp under point." single ((:commit . "bec730d3fc1e6c17ff1339eb134af16c034a4d95") (:authors ("Artur Malabarba" . "artur@endlessparentheses.com")) (:maintainer "Artur Malabarba" . "artur@endlessparentheses.com") (:keywords "convenience") (:url . "https://github.com/Malabarba/comment-or-uncomment-sexp"))])
+ (comment-tags . [(20170910 1735) ((emacs (24 5))) "Highlight & navigate comment tags like 'TODO'." single ((:commit . "7d914097f0a03484af71e621db533737fc692f58") (:authors ("Vincent Dumas" . "vincekd@gmail.com")) (:maintainer "Vincent Dumas" . "vincekd@gmail.com") (:keywords "convenience" "comments" "tags") (:url . "https://github.com/vincekd/comment-tags"))])
+ (commentary-theme . [(20210714 1757) ((emacs (24))) "A minimal theme with contrasting comments" single ((:commit . "a73e1256f667065933e96bd6032c463cb115201d") (:url . "https://github.com/pzel/commentary-theme"))])
+ (commenter . [(20160219 1627) ((emacs (24 4)) (let-alist (1 0 4))) "multiline-comment support package" single ((:commit . "6d1885419434ba779270c6fda0e30d390bb074bd") (:authors ("Yuta Yamada <cokesboy\"at\"gmail.com>")) (:maintainer "Yuta Yamada <cokesboy\"at\"gmail.com>") (:keywords "comment") (:url . "https://github.com/yuutayamada/commenter"))])
+ (commify . [(20210904 1106) ((s (1 9 0))) "Toggle grouping commas in numbers" single ((:commit . "d6656bd3a909917a51ba033a11d4ab5f5fe55f83") (:authors ("Daniel E. Doherty" . "ded-commify@ddoherty.net")) (:maintainer "Daniel E. Doherty" . "ded-commify@ddoherty.net") (:keywords "convenience" "editing" "numbers" "grouping" "commas") (:url . "https://github.com/ddoherty03/commify"))])
+ (common-lisp-snippets . [(20180226 1523) ((yasnippet (0 8 0))) "Yasnippets for Common Lisp" tar ((:commit . "c82ebf18f4ad49f390dd96ffcc59f8683c1a868b") (:authors ("Mark Karpov" . "markkarpov92@gmail.com")) (:maintainer "Mark Karpov" . "markkarpov92@gmail.com") (:keywords "snippets") (:url . "https://github.com/mrkkrp/common-lisp-snippets"))])
+ (company . [(20220425 1145) ((emacs (25 1))) "Modular text completion framework" tar ((:commit . "d5145006b948f93e673f439a766da01f636d39fc") (:authors ("Nikolaj Schumacher")) (:maintainer "Dmitry Gutov" . "dgutov@yandex.ru") (:keywords "abbrev" "convenience" "matching") (:url . "http://company-mode.github.io/"))])
+ (company-anaconda . [(20200404 1859) ((company (0 8 0)) (anaconda-mode (0 1 1)) (cl-lib (0 5 0)) (dash (2 6 0)) (s (1 9))) "Anaconda backend for company-mode" single ((:commit . "da1566db41a68809ef7f91ebf2de28118067c89b") (:authors ("Artem Malyshev" . "proofit404@gmail.com")) (:maintainer "Artem Malyshev" . "proofit404@gmail.com") (:url . "https://github.com/proofit404/anaconda-mode"))])
+ (company-ansible . [(20200306 1441) ((emacs (24 4)) (company (0 8 12))) "A company back-end for ansible" tar ((:commit . "79dd421b161efa49fbdffad57fa40edb41f484a3") (:authors ("Krzysztof Magosa" . "krzysztof@magosa.pl")) (:maintainer "Krzysztof Magosa" . "krzysztof@magosa.pl") (:keywords "ansible") (:url . "https://github.com/krzysztof-magosa/company-ansible"))])
+ (company-arduino . [(20160306 1739) ((emacs (24 1)) (company (0 8 0)) (irony (0 1 0)) (cl-lib (0 5)) (company-irony (0 1 0)) (company-c-headers (20140930)) (arduino-mode (1 0))) "company-mode for Arduino" single ((:commit . "d7e369702b8eee63e6dfdeba645ce28b6dc66fb1") (:authors ("Yuta Yamada" . "sleepboy.zzz@gmail.com")) (:maintainer "Yuta Yamada" . "sleepboy.zzz@gmail.com") (:keywords "convenience" "development" "company") (:url . "https://github.com/yuutayamada/company-arduino"))])
+ (company-auctex . [(20200529 1835) ((yasnippet (0 8 0)) (company (0 8 0)) (auctex (11 87))) "Company-mode auto-completion for AUCTeX" single ((:commit . "9400a2ec7459dde8cbf1a5d50dfee4e300ed7e18") (:authors ("Christopher Monsanto <chris@monsan.to>, Alexey Romanov" . "alexey.v.romanov@gmail.com")) (:maintainer "Christopher Monsanto <chris@monsan.to>, Alexey Romanov" . "alexey.v.romanov@gmail.com") (:url . "https://github.com/alexeyr/company-auctex/"))])
+ (company-axiom . [(20191027 1928) ((emacs (24)) (company (0 9)) (axiom-environment (20171021))) "A company-mode backend for the axiom-environment system" single ((:commit . "e60de5ed107ffeb530a56d24d04f38988124d12b") (:authors ("Paul Onions" . "paul.onions@acm.org")) (:maintainer "Paul Onions" . "paul.onions@acm.org") (:keywords "axiom" "openaxiom" "fricas" "axiom-environment"))])
+ (company-bibtex . [(20171105 644) ((company (0 9 0)) (cl-lib (0 5)) (parsebib (1 0))) "Company completion for bibtex keys" single ((:commit . "da67faf3a6faba8e7f1b222dedfc5521b02c7655") (:authors ("GB Gardner" . "gbgar@users.noreply.github.com")) (:maintainer "GB Gardner" . "gbgar@users.noreply.github.com") (:keywords "company-mode" "bibtex") (:url . "https://github.com/gbgar/company-bibtex"))])
+ (company-box . [(20211020 2007) ((emacs (26 0 91)) (dash (2 19 0)) (company (0 9 6)) (frame-local (0 0 1))) "Company front-end with icons" tar ((:commit . "f9cbbc7df8efbb56a8d31a5b422d158660d9109e") (:authors ("Sebastien Chapuis" . "sebastien@chapu.is")) (:maintainer "Sebastien Chapuis" . "sebastien@chapu.is") (:keywords "company" "completion" "front-end" "convenience") (:url . "https://github.com/sebastiencs/company-box"))])
+ (company-c-headers . [(20190825 1631) ((emacs (24 1)) (company (0 8))) "Company mode backend for C/C++ header files" single ((:commit . "9d384571b1190e99d0a789e5296176d69a3d0771") (:authors ("Alastair Rankine" . "alastair@girtby.net")) (:maintainer "Alastair Rankine" . "alastair@girtby.net") (:keywords "development" "company"))])
+ (company-cabal . [(20170917 1317) ((cl-lib (0 5)) (company (0 8 0)) (emacs (24))) "company-mode cabal backend" tar ((:commit . "62112a7259e24bd6c08885629a185afe512b7d3d") (:authors ("Iku Iwasa" . "iku.iwasa@gmail.com")) (:maintainer "Iku Iwasa" . "iku.iwasa@gmail.com") (:url . "https://github.com/iquiw/company-cabal"))])
+ (company-coq . [(20220314 526) ((cl-lib (0 5)) (dash (2 12 1)) (yasnippet (0 11 0)) (company (0 8 12)) (company-math (1 1))) "A collection of extensions for Proof General's Coq mode" tar ((:commit . "a6e349e0131f676a885bd14c908fd26054b2df42") (:authors ("Clément Pit-Claudel" . "clement.pitclaudel@live.com")) (:maintainer "Clément Pit-Claudel" . "clement.pitclaudel@live.com") (:keywords "convenience" "languages") (:url . "https://github.com/cpitclaudel/company-coq"))])
+ (company-ctags . [(20211211 338) ((emacs (25 1)) (company (0 9 0))) "Fastest company-mode completion backend for ctags" single ((:commit . "313508ba5d4f1e4b5d5d554faaa74076201c3248") (:authors ("Chen Bin" . "chenbin.sh@gmail.com")) (:maintainer "Chen Bin" . "chenbin.sh@gmail.com") (:keywords "convenience") (:url . "https://github.com/redguardtoo/company-ctags"))])
+ (company-dcd . [(20210307 649) ((company (0 9)) (flycheck-dmd-dub (0 7)) (yasnippet (0 8)) (popwin (0 7)) (cl-lib (0 5)) (ivy (20160804 326))) "Company backend for Dlang using DCD." single ((:commit . "858500115d4f0285f963698ede9492f409a90e52") (:authors ("tsukimizake <shomasd_at_gmail.com>")) (:maintainer "tsukimizake <shomasd_at_gmail.com>") (:keywords "languages") (:url . "http://github.com/tsukimizake/company-dcd"))])
+ (company-dict . [(20190302 5) ((emacs (24 4)) (company (0 8 12)) (parent-mode (2 3))) "A backend that emulates ac-source-dictionary" single ((:commit . "cd7b8394f6014c57897f65d335d6b2bd65dab1f4") (:authors ("Henrik Lissner <http://github/hlissner>")) (:maintainer "Henrik Lissner" . "henrik@lissner.net") (:keywords "company" "dictionary" "ac-source-dictionary") (:url . "https://github.com/hlissner/emacs-company-dict"))])
+ (company-distel . [(20180827 1344) ((distel-completion-lib (1 0 0))) "Erlang/distel completion backend for company-mode" single ((:commit . "acc4c0a5521904203d797fe96b08e5fae4233c7e") (:authors ("Sebastian Weddmark Olsson")) (:maintainer "Sebastian Weddmark Olsson") (:keywords "erlang" "distel" "company") (:url . "github.com/sebastiw/distel-completion"))])
+ (company-emacs-eclim . [(20180911 1121) ((eclim (0 3)) (company (0 7)) (cl-lib (0 5))) "Eclim company backend" single ((:commit . "222ddd48fcf0ee01592dec77c58e0cf3f2ea1100"))])
+ (company-emoji . [(20210427 2151) ((cl-lib (0 5)) (company (0 8 0))) "company-mode backend for emoji" tar ((:commit . "90594eb58b20fb937cfd4e946efcc446ee630e6f") (:authors ("Alex Dunn" . "dunn.alex@gmail.com")) (:maintainer "Alex Dunn" . "dunn.alex@gmail.com") (:keywords "emoji" "company") (:url . "https://github.com/dunn/company-emoji.git"))])
+ (company-emojify . [(20210718 424) ((emacs (26 1)) (company (0 8 0)) (emojify (1 2 1)) (ht (2 0))) "Company completion for Emojify" single ((:commit . "6f095b419468b0443e1dcd8537ef4b84092f155c") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/company-emojify"))])
+ (company-erlang . [(20170123 538) ((emacs (24 4)) (ivy-erlang-complete (0 1)) (company (0 9 2))) "company backend based on ivy-erlang-complete" single ((:commit . "bc0524a16f17b66c7397690e4ca0e004f09ea6c5") (:authors ("Sergey Kostyaev" . "feo.me@ya.ru")) (:maintainer "Sergey Kostyaev" . "feo.me@ya.ru") (:keywords "tools"))])
+ (company-flow . [(20180225 2159) ((company (0 8 0)) (dash (2 13 0))) "Flow backend for company-mode" single ((:commit . "76ef585c70d2a3206c2eadf24ba61e59124c3a16") (:authors ("Aaron Jensen" . "aaronjensen@gmail.com")) (:maintainer "Aaron Jensen" . "aaronjensen@gmail.com") (:url . "https://github.com/aaronjensen/company-flow"))])
+ (company-flx . [(20180103 518) ((emacs (24)) (company (0 8 12)) (flx (0 5))) "flx based fuzzy matching for company" single ((:commit . "16ca0d2f84e8e768bf2db8c5cfe421230a00bded") (:authors ("PythonNut" . "pythonnut@pythonnut.com")) (:maintainer "PythonNut" . "pythonnut@pythonnut.com") (:keywords "convenience" "company" "fuzzy" "flx") (:url . "https://github.com/PythonNut/company-flx"))])
+ (company-fuzzy . [(20220409 1753) ((emacs (26 1)) (company (0 8 12)) (s (1 12 0)) (ht (2 0))) "Fuzzy matching for `company-mode'" single ((:commit . "e2e8a39976506cbf149f9c62a69c7a438be09579") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/company-fuzzy"))])
+ (company-ghci . [(20190707 311) ((company (0 8 11)) (haskell-mode (13))) "company backend which uses the current ghci process." single ((:commit . "a1d25652583ab4666c5a78cac18cd8039776b50d") (:authors ("Hector Orellana" . "hofm92@gmail.com")) (:maintainer "Hector Orellana" . "hofm92@gmail.com"))])
+ (company-glsl . [(20210109 1403) ((company (0 9 4)) (glsl-mode (2 4)) (emacs (24 4))) "Support glsl in company-mode" single ((:commit . "3a40501ba831a30a7fd3e8529b20d1305d0454aa") (:authors ("Guido Schmidt" . "git@guidoschmidt.cc")) (:maintainer "Guido Schmidt" . "git@guidoschmidt.cc") (:url . "https://github.com/guidoschmidt/company-glsl"))])
+ (company-go . [(20170825 1643) ((company (0 8 0)) (go-mode (1 0 0))) "company-mode backend for Go (using gocode)" single ((:commit . "31948b463f2fc18f8801e5a8fe511fef300eb3dd") (:authors ("nsf" . "no.smile.face@gmail.com")) (:maintainer "nsf" . "no.smile.face@gmail.com") (:keywords "languages"))])
+ (company-inf-ruby . [(20140805 2054) ((company (0 6 10)) (inf-ruby (2 2 7)) (emacs (24 1))) "company-mode completion back-end for inf-ruby" single ((:commit . "fe3e4863bc971fbb81edad447efad5795ead1b17") (:authors ("Dmitry Gutov" . "dgutov@yandex.ru")) (:maintainer "Dmitry Gutov" . "dgutov@yandex.ru") (:url . "https://github.com/company-mode/company-inf-ruby"))])
+ (company-ipa . [(20210307 1838) ((emacs (24 3)) (company (0 8 12))) "IPA backend for company" single ((:commit . "8634021cac885f53f3274ef6dcce7eab19321046") (:authors ("Matías Guzmán Naranjo" . "mguzmann89@gmail.com")) (:maintainer "Matías Guzmán Naranjo" . "mguzmann89@gmail.com") (:keywords "convenience" "company" "ipa") (:url . "https://github.com/mguzmann/company-ipa"))])
+ (company-irony . [(20190124 2346) ((emacs (24 1)) (company (0 8 0)) (irony (1 1 0)) (cl-lib (0 5))) "company-mode completion back-end for irony-mode" single ((:commit . "b44711dfce445610c1ffaec4951c6ff3882b216a") (:authors ("Guillaume Papin" . "guillaume.papin@epitech.eu")) (:maintainer "Guillaume Papin" . "guillaume.papin@epitech.eu") (:keywords "convenience") (:url . "https://github.com/Sarcasm/company-irony/"))])
+ (company-irony-c-headers . [(20151018 909) ((cl-lib (0 5)) (company (0 9 0)) (irony (0 2 0))) "Company mode backend for C/C++ header files with Irony" single ((:commit . "72c386aeb079fb261d9ec02e39211272f76bbd97") (:authors ("Yutian Li" . "hotpxless@gmail.com")) (:maintainer "Yutian Li" . "hotpxless@gmail.com") (:keywords "c" "company") (:url . "https://github.com/hotpxl/company-irony-c-headers"))])
+ (company-jedi . [(20200324 25) ((emacs (24)) (cl-lib (0 5)) (company (0 8 11)) (jedi-core (0 2 7))) "Company-mode completion back-end for Python JEDI" single ((:commit . "ea22b1f7a980c49aaf2c5e840e4536577f6602f6") (:authors ("Boy" . "boyw165@gmail.com")) (:maintainer "Neil Okamoto" . "neil.okamoto+melpa@gmail.com") (:url . "https://github.com/emacsorphanage/company-jedi"))])
+ (company-lean . [(20210305 1705) ((emacs (24 3)) (dash (2 18 0)) (s (1 10 0)) (f (0 19 0)) (company (0 9 3)) (lean-mode (3 3 0))) "A company backend for lean-mode" single ((:commit . "362bc6fa3efb1874c525ed6b4b6f24f76af22596") (:authors ("Leonardo de Moura" . "leonardo@microsoft.com") ("Soonho Kong " . "soonhok@cs.cmu.edu") ("Gabriel Ebner " . "gebner@gebner.org") ("Sebastian Ullrich" . "sebasti@nullri.ch")) (:maintainer "Sebastian Ullrich" . "sebasti@nullri.ch") (:keywords "languages") (:url . "https://github.com/leanprover/lean-mode"))])
+ (company-ledger . [(20210910 250) ((emacs (24 3)) (company (0 8 0))) "Fuzzy auto-completion for Ledger & friends" single ((:commit . "c6911b7e39b29c0d5f2541392ff485b0f53fd366") (:authors ("Debanjum Singh Solanky <debanjum AT gmail DOT com>")) (:maintainer "Debanjum Singh Solanky <debanjum AT gmail DOT com>") (:keywords "abbrev" "matching" "auto-complete" "beancount" "ledger" "company") (:url . "https://github.com/debanjum/company-ledger"))])
+ (company-lua . [(20171108 2306) ((company (0 8 12)) (s (1 10 0)) (f (0 17 0)) (lua-mode (20151025))) "Company backend for Lua" tar ((:commit . "29f6819de4d691e5fd0b62893a9f4fbc1c6fcb52") (:authors ("Peter Vasil" . "mail@petervasil.net")) (:maintainer "Peter Vasil" . "mail@petervasil.net"))])
+ (company-manually . [(20200709 913) ((emacs (24 3)) (company (0 9 0)) (ivy (0 13 0))) "A company backend that lets you manually build candidates" single ((:commit . "44c7a655e5f2a462835a96d1f0ed2ce434848416") (:authors ("Yanghao Xie")) (:maintainer "Yanghao Xie" . "yhaoxie@gmail.com") (:keywords "convenience" "company-mode" "manually build candidates") (:url . "https://github.com/yanghaoxie/company-manually"))])
+ (company-math . [(20210731 2019) ((company (0 8 0)) (math-symbol-lists (1 3))) "Completion backends for unicode math symbols and latex tags" single ((:commit . "45778f5731c97a21a83e3b965cbde42018709afd") (:authors ("Vitalie Spinu" . "spinuvit@gmail.com")) (:maintainer "Vitalie Spinu" . "spinuvit@gmail.com") (:keywords "unicode" "symbols" "completion") (:url . "https://github.com/vspinu/company-math"))])
+ (company-maxima . [(20210520 2034) ((emacs (25 1)) (maxima (0 6 1)) (seq (2 20)) (company (0 9 13))) "Maxima company integration" single ((:commit . "ce5fd160c193e387d9e2bacdba4065c4b4262cb1") (:authors ("Fermin Munoz")) (:maintainer "Fermin Munoz" . "fmfs@posteo.net") (:keywords "languages" "tools" "convenience") (:url . "https://gitlab.com/sasanidas/maxima"))])
+ (company-nand2tetris . [(20171201 1813) ((nand2tetris (1 1 0)) (company (0 5)) (cl-lib (0 5 0))) "Company backend for nand2tetris major mode" single ((:commit . "33acee34d24b1c6a87db833b7d23449cf858f64f") (:authors ("Diego Berrocal" . "cestdiego@gmail.com")) (:maintainer "Diego Berrocal" . "cestdiego@gmail.com") (:keywords "nand2tetris" "hdl" "company") (:url . "http://www.github.com/CestDiego/nand2tetris.el/"))])
+ (company-native-complete . [(20220103 1622) ((emacs (26 1)) (company (0 9 0)) (native-complete (0 1 0))) "Company completion using native-complete" single ((:commit . "01d8a2048e13f29dd3aa06281ac8cb466caddb64") (:authors ("Troy Hinckley" . "troy.hinckley@gmail.com")) (:maintainer "Troy Hinckley" . "troy.hinckley@gmail.com") (:url . "https://github.com/CeleritasCelery/emacs-native-shell-complete"))])
+ (company-nginx . [(20220210 1411) ((emacs (24)) (cl-lib (0)) (company (0))) "company-mode keywords support for nginx-mode" single ((:commit . "8a9f1a5653fe2d9a5042bfb9377d54f37fcc64c8") (:keywords "company" "nginx") (:url . "https://repo.or.cz/company-nginx.git"))])
+ (company-ngram . [(20170129 1913) ((cl-lib (0 5)) (company (0 8 0))) "N-gram based completion" tar ((:commit . "09a68b802e64799e95f205b438d469bbd78cd2e6") (:authors ("kshramt")) (:maintainer "kshramt") (:url . "https://github.com/kshramt/company-ngram"))])
+ (company-nixos-options . [(20160215 857) ((company (0 8 0)) (nixos-options (0 0 1)) (cl-lib (0 5 0))) "Company Backend for nixos-options" single ((:commit . "053a2d5110ce05b7f99bcc2ac4804b70cbe87916") (:authors ("Diego Berrocal" . "cestdiego@gmail.com") ("Travis B. Hartwell" . "nafai@travishartwell.net")) (:maintainer "Diego Berrocal" . "cestdiego@gmail.com") (:keywords "unix") (:url . "http://www.github.com/travisbhartwell/nix-emacs/"))])
+ (company-org-block . [(20210825 2107) ((emacs (25 1)) (company (0 8 0)) (org (9 2 0))) "Org blocks company backend" single ((:commit . "115af0a3625f4669358eca568466d468cacc78bd") (:authors ("Alvaro Ramirez")) (:maintainer "Alvaro Ramirez") (:url . "https://github.com/xenodium/company-org-block"))])
+ (company-php . [(20211204 558) ((cl-lib (0 5)) (ac-php-core (2 0)) (company (0 9))) "A company back-end for PHP." single ((:commit . "f34e09783b77d1158ea139b7b3d8034bc52b0b9f") (:authors ("jim" . "xcwenn@qq.com")) (:maintainer "jim") (:keywords "completion" "convenience" "intellisense") (:url . "https://github.com/xcwen/ac-php"))])
+ (company-phpactor . [(20200121 1218) ((emacs (24 3)) (company (0 9 6)) (phpactor (0 1 0))) "company-mode backend for Phpactor" single ((:commit . "34195f1533209e2ffd0f898a69c7db2bffd1eabe") (:authors ("Martin Tang" . "martin.tang365@gmail.com") ("Mikael Kermorgant" . "mikael@kgtech.fi")) (:maintainer "Martin Tang" . "martin.tang365@gmail.com") (:keywords "tools" "php") (:url . "https://github.com/emacs-php/phpactor.el"))])
+ (company-plisp . [(20200531 1927) ((emacs (25)) (s (1 2 0)) (company (0 8 12)) (dash (2 12 0)) (cl-lib (0 5))) "Company mode backend for PicoLisp language" tar ((:commit . "fc0b56d2a711340ca3e63119bfe692bb3e8620fb") (:authors ("Fermin MF" . "fmfs@posteo.net")) (:maintainer "Fermin MF" . "fmfs@posteo.net") (:keywords "company" "plisp" "convenience" "auto-completion") (:url . "https://gitlab.com/sasanidas/company-plisp"))])
+ (company-plsense . [(20180118 58) ((company (0 9 3)) (cl-lib (0 5 0)) (dash (2 12 0)) (s (1 12)) (emacs (24))) "Company backend for Perl" single ((:commit . "b48e3181e08ec597269621d621aa06636f02d883") (:authors ("Troy Hinckley" . "troy.hinckley@gmail.com")) (:maintainer "Troy Hinckley" . "troy.hinckley@gmail.com") (:url . "https://github.com/CeleritasCelery/company-plsense"))])
+ (company-pollen . [(20160812 1510) ((company (0 9 0)) (pollen-mode (1 0))) "company-mode completion backend for pollen" single ((:commit . "09a9dc48c468dcd385982b9629f325e70d569faf") (:authors ("Junsong Li <ljs.darkfish AT GMAIL>")) (:maintainer "Junsong Li") (:keywords "languages" "pollen" "pollenpub" "company") (:url . "https://github.com/lijunsong/pollen-mode"))])
+ (company-posframe . [(20220331 2141) ((emacs (26 0)) (company (0 9 0)) (posframe (0 9 0))) "Use a posframe as company candidate menu" single ((:commit . "df0e34f69dc8e9aaa1a6c5e88783898f4ae3f2df") (:authors ("Clément Pit-Claudel, Feng Shu, Lars Andersen" . "expez@expez.com")) (:maintainer "Feng Shu" . "tumashu@163.com") (:keywords "abbrev" "convenience" "matching") (:url . "https://github.com/tumashu/company-posframe"))])
+ (company-prescient . [(20220509 2300) ((emacs (25 1)) (prescient (5 2)) (company (0 9 6))) "prescient.el + Company" single ((:commit . "c05f8a43c6ff07a8b5a3ba8df7a2ec35677b7484") (:authors ("Radian LLC" . "contact+prescient@radian.codes")) (:maintainer "Radian LLC" . "contact+prescient@radian.codes") (:keywords "extensions") (:url . "https://github.com/raxod502/prescient.el"))])
+ (company-qml . [(20170428 1708) ((qml-mode (0 1)) (company (0 8 12))) "Company backend for QML files" tar ((:commit . "4af4f32a7ad86d86bb9293fb0b675aec513b5736") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions"))])
+ (company-quickhelp . [(20211115 1335) ((emacs (24 3)) (company (0 8 9)) (pos-tip (0 4 6))) "Popup documentation for completion candidates" single ((:commit . "3ca2708b4e5190205aca01d65fe1b391963a53f9") (:authors ("Lars Andersen" . "expez@expez.com")) (:maintainer "Lars Andersen" . "expez@expez.com") (:keywords "company" "popup" "documentation" "quickhelp") (:url . "https://www.github.com/expez/company-quickhelp"))])
+ (company-quickhelp-terminal . [(20210715 1010) ((emacs (24 4)) (company-quickhelp (2 2 0)) (popup (0 5 3))) "Terminal support for `company-quickhelp'" single ((:commit . "75a2f5c7669833646fc653cabd531737b52fb469") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/company-quickhelp-terminal"))])
+ (company-racer . [(20171205 310) ((emacs (24 4)) (cl-lib (0 5)) (company (0 8 0)) (deferred (0 3 1))) "Company integration for racer" single ((:commit . "a00381c9d416f375f783fcb6ae8d40669ce1f567") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "convenience") (:url . "https://github.com/emacs-pe/company-racer"))])
+ (company-reftex . [(20210418 1316) ((emacs (25 1)) (s (1 12)) (company (0 8))) "Company backend based on RefTeX." single ((:commit . "42eb98c6504e65989635d95ab81b65b9d5798e76") (:authors ("Eivind Fonn" . "evfonn@gmail.com")) (:maintainer "Eivind Fonn" . "evfonn@gmail.com") (:keywords "bib" "tex" "company" "latex" "reftex" "references" "labels" "citations") (:url . "https://github.com/TheBB/company-reftex"))])
+ (company-restclient . [(20190426 1312) ((cl-lib (0 5)) (company (0 8 0)) (emacs (24)) (know-your-http-well (0 2 0)) (restclient (0 0 0))) "company-mode completion back-end for restclient-mode" single ((:commit . "e5a3ec54edb44776738c13e13e34c85b3085277b") (:authors ("Iku Iwasa" . "iku.iwasa@gmail.com")) (:maintainer "Iku Iwasa" . "iku.iwasa@gmail.com") (:url . "https://github.com/iquiw/company-restclient"))])
+ (company-rtags . [(20191222 920) ((emacs (24 3)) (company (0 8 1)) (rtags (2 10))) "RTags back-end for company" single ((:commit . "db39790fda5c2443bc790b8971ac140914f7e9c2") (:authors ("Jan Erik Hanssen" . "jhanssen@gmail.com") ("Anders Bakken" . "agbakken@gmail.com")) (:maintainer "Jan Erik Hanssen" . "jhanssen@gmail.com") (:url . "https://github.com/Andersbakken/rtags"))])
+ (company-shell . [(20211013 1725) ((emacs (24 4)) (company (0 8 12)) (dash (2 12 0)) (cl-lib (0 5))) "Company mode backend for shell functions" single ((:commit . "a77f4de75912aa87314cde92c603b831d5050246") (:authors ("Alexander Miller" . "alexanderm@web.de")) (:maintainer "Alexander Miller" . "alexanderm@web.de") (:keywords "company" "shell" "auto-completion") (:url . "https://github.com/Alexander-Miller/company-shell"))])
+ (company-solidity . [(20181117 1518) ((company (0 9 0)) (cl-lib (0 5 0)) (solidity-mode (0 1 9))) "Company-mode back-end for solidity-mode" single ((:commit . "20fb77e089e10187b37ae1a94153017b82ed2a0a") (:authors ("Samuel Smolkin" . "sam@future-precedent.org")) (:maintainer "Samuel Smolkin" . "sam@future-precedent.org") (:keywords "solidity" "completion" "company") (:url . "https://github.com/ethereum/emacs-solidity"))])
+ (company-sourcekit . [(20210430 2155) ((emacs (24 3)) (company (0 8 12)) (dash (2 18 0)) (sourcekit (0 2 0))) "company-mode completion backend for SourceKit" single ((:commit . "a1860ad4dd3a542acd2fa0dfac2a388cbdf4af0c") (:authors ("Nathan Kot" . "nk@nathankot.com")) (:maintainer "Nathan Kot" . "nk@nathankot.com") (:keywords "abbrev") (:url . "https://github.com/nathankot/company-sourcekit"))])
+ (company-stan . [(20211129 2051) ((emacs (24 3)) (company (0 9 10)) (stan-mode (10 3 0))) "A company-mode completion backend for stan" single ((:commit . "150bbbe5fd3ad2b5a3dbfba9d291e66eeea1a581") (:authors ("Kazuki Yoshida" . "kazukiyoshida@mail.harvard.edu")) (:maintainer "Kazuki Yoshida" . "kazukiyoshida@mail.harvard.edu") (:keywords "languages") (:url . "https://github.com/stan-dev/stan-mode/tree/master/company-stan"))])
+ (company-statistics . [(20170210 1933) ((emacs (24 3)) (company (0 8 5))) "Sort candidates using completion history" single ((:commit . "e62157d43b2c874d2edbd547c3bdfb05d0a7ae5c") (:authors ("Ingo Lohmar" . "i.lohmar@gmail.com")) (:maintainer "Ingo Lohmar" . "i.lohmar@gmail.com") (:keywords "abbrev" "convenience" "matching") (:url . "https://github.com/company-mode/company-statistics"))])
+ (company-suggest . [(20200911 1845) ((company (0 9 0)) (emacs (25 1))) "Company-mode back-end for search engine suggests" single ((:commit . "1c89c9de3852f07ce28b0bedf1fbf56fe6eedcdc") (:authors ("Jürgen Hötzel" . "juergen@archlinux.org")) (:maintainer "Jürgen Hötzel" . "juergen@archlinux.org") (:keywords "completion" "convenience") (:url . "https://github.com/juergenhoetzel/company-suggest"))])
+ (company-tabnine . [(20210310 2247) ((emacs (25)) (company (0 9 3)) (cl-lib (0 5)) (dash (2 16 0)) (s (1 12 0)) (unicode-escape (1 1))) "A company-mode backend for TabNine" single ((:commit . "98e9e8b38b6ca289fbe265b0a7b62c7fe38ed0e2") (:authors ("Tommy Xiang" . "tommyx058@gmail.com")) (:maintainer "Tommy Xiang" . "tommyx058@gmail.com") (:keywords "convenience") (:url . "https://github.com/TommyX12/company-tabnine/"))])
+ (company-terraform . [(20220509 1759) ((emacs (24 4)) (company (0 8 12)) (terraform-mode (0 6))) "A company backend for terraform" tar ((:commit . "8d5a16d1bbeeb18ca49a8fd57b5d8cd30c8b8dc7") (:authors ("Rafał Cieślak" . "rafalcieslak256@gmail.com")) (:maintainer "Rafał Cieślak" . "rafalcieslak256@gmail.com") (:keywords "abbrev" "convenience" "terraform" "company") (:url . "https://github.com/rafalcieslak/emacs-company-terraform"))])
+ (company-try-hard . [(20200417 1603) ((emacs (24 3)) (company (0 8 0)) (dash (2 0))) "get all completions from company backends" single ((:commit . "2b41136b5ed6e02032d99bcdb0599ecf00394fa5") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:keywords "matching") (:url . "https://github.com/Wilfred/company-try-hard"))])
+ (company-web . [(20220115 2146) ((company (0 8 0)) (dash (2 8 0)) (cl-lib (0 5 0)) (web-completion-data (0 1 0))) "Company version of ac-html, complete for web,html,emmet,jade,slim modes" tar ((:commit . "863fb84b81ed283474e50330cd8d27b1ca0d74f1") (:authors ("Olexandr Sydorchuk" . "olexandr.syd@gmail.com")) (:maintainer "Olexandr Sydorchuk" . "olexandr.syd@gmail.com") (:keywords "html" "company") (:url . "https://github.com/osv/company-web"))])
+ (company-wordfreq . [(20220405 2000) ((emacs (27 1)) (company (0 9))) "Company backend for human language texts" single ((:commit . "83569cf346c2320ef22f6a858e3424f771c4324e") (:authors ("Johannes Mueller" . "github@johannes-mueller.org")) (:maintainer "Johannes Mueller" . "github@johannes-mueller.org") (:keywords "company" "convenience" "matching") (:url . "https://github.com/johannes-mueller/company-wordfreq.el"))])
+ (company-ycm . [(20140904 1817) ((ycm (0 1))) "company-ycm" single ((:commit . "4da8a14abcd0f4fa3235042ade2e12b5068c0601") (:authors ("Ajay Gopinathan" . "ajay@gopinathan.net")) (:maintainer "Ajay Gopinathan" . "ajay@gopinathan.net") (:keywords "abbrev"))])
+ (company-ycmd . [(20180520 1053) ((ycmd (1 3)) (company (0 9 3)) (deferred (0 5 1)) (s (1 11 0)) (dash (2 13 0)) (let-alist (1 0 5)) (f (0 19 0))) "company-mode backend for ycmd" single ((:commit . "c17ff9e0250a9b39d23af37015a2b300e2f36fed") (:url . "https://github.com/abingham/emacs-ycmd"))])
+ (compdef . [(20200304 611) ((emacs (24 4))) "A local completion definer" single ((:commit . "30fb5846ed851efee641ce8c5d8879ad36cd7ac6") (:authors ("Uros Perisic")) (:maintainer "Uros Perisic") (:keywords "convenience") (:url . "https://gitlab.com/jjzmajic/compdef"))])
+ (competitive-programming-snippets . [(20201115 1702) ((emacs (26)) (yasnippet (0 8 0))) "Competitive Programming snippets for yasnippet" tar ((:commit . "3b43c1aeaa6676d1d3d0c47e78790db9bee150b6") (:authors ("Seong Yong-ju" . "sei40kr@gmail.com")) (:maintainer "Seong Yong-ju" . "sei40kr@gmail.com") (:keywords "tools") (:url . "https://github.com/sei40kr/competitive-programming-snippets"))])
+ (compiler-explorer . [(20210916 1316) ((emacs (26 1)) (request (0 3 0))) "Compiler explorer client (godbolt.org)" single ((:commit . "9ea0cc78ac40f667dfaf9277758a22b9058ca434") (:authors ("Michał Krzywkowski" . "k.michal@zoho.com")) (:maintainer "Michał Krzywkowski" . "k.michal@zoho.com") (:keywords "c" "tools") (:url . "https://github.com/mkcms/compiler-explorer.el"))])
+ (completions-frame . [(20210430 640) ((emacs (26 1))) "Show completions in child frame" single ((:commit . "860e5b97730df7ef5c34584ad164bc69c561db84") (:authors ("Andrii Kolomoiets" . "andreyk.mad@gmail.com")) (:maintainer "Andrii Kolomoiets" . "andreyk.mad@gmail.com") (:keywords "frames") (:url . "https://github.com/muffinmad/emacs-completions-frame"))])
+ (composable . [(20201024 1458) ((emacs (24 4))) "composable editing" tar ((:commit . "6f2efaa7018feb854720cc2518e4274ad708f793") (:authors ("Simon Friis Vindum" . "simon@vindum.io")) (:maintainer "Simon Friis Vindum" . "simon@vindum.io") (:keywords "lisp"))])
+ (composer . [(20200616 1717) ((emacs (24 3)) (s (1 9 0)) (f (0 17)) (seq (1 9)) (php-runtime (0 1 0))) "Interface to PHP Composer" single ((:commit . "7c7f89df226cac69664d7eca5e913b544dc475c5") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "tools" "php" "dependency" "manager") (:url . "https://github.com/zonuexe/composer.el"))])
+ (comware-router-mode . [(20220108 2111) ((dash (2 16 0)) (emacs (24 3))) "Major mode for editing Comware configuration files" single ((:commit . "cd8c74653c0e221e3dd1ca540496c4b4c7ee4617") (:authors ("Davide Restivo" . "davide.restivo@yahoo.it")) (:maintainer "Davide Restivo" . "davide.restivo@yahoo.it") (:keywords "convenience" "faces") (:url . "https://github.com/daviderestivo/comware-router-mode"))])
+ (concurrent . [(20161229 330) ((emacs (24 3)) (deferred (0 5 0))) "Concurrent utility functions for emacs lisp" single ((:commit . "2239671d94b38d92e9b28d4e12fd79814cfb9c16") (:authors ("SAKURAI Masashi <m.sakurai at kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai at kiwanami.net>") (:keywords "deferred" "async" "concurrent") (:url . "https://github.com/kiwanami/emacs-deferred/blob/master/README-concurrent.markdown"))])
+ (conda . [(20220315 1533) ((emacs (24 4)) (pythonic (0 1 0)) (dash (2 13 0)) (s (1 11 0)) (f (0 18 2))) "Work with your conda environments" single ((:commit . "9c28d7a853b4b4bd00215cf7f07856c1563f2ad7") (:authors ("Rami Chowdhury" . "rami.chowdhury@gmail.com")) (:maintainer "Rami Chowdhury" . "rami.chowdhury@gmail.com") (:keywords "python" "environment" "conda") (:url . "http://github.com/necaris/conda.el"))])
+ (config-general-mode . [(20171024 1840) nil "Config::General config file mode" single ((:commit . "b4a8e6ba0bb027a77e4a0f701409f3e57bb2e4c0") (:authors ("T.v.Dein" . "tlinden@cpan.org")) (:maintainer "T.v.Dein" . "tlinden@cpan.org") (:keywords "files") (:url . "https://github.com/tlinden/config-general-mode"))])
+ (config-parser . [(20160426 1219) ((emacs (24 4))) "a library for parsing config file" single ((:commit . "85d559e7889d8f5b98b8794b79426ae25ec3caa5") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "convenience" "config") (:url . "https://github.com/lujun9972/el-config-parser"))])
+ (conkeror-minor-mode . [(20150114 1604) nil "Mode for editing conkeror javascript files." single ((:commit . "476e81c27b056e21c192391fe674a2bf875466b0") (:authors ("Artur Malabarba" . "bruce.connor.am@gmail.com>")) (:maintainer "Artur Malabarba" . "bruce.connor.am@gmail.com>") (:keywords "programming" "tools") (:url . "http://github.com/Bruce-Connor/conkeror-minor-mode"))])
+ (conllu-mode . [(20200501 2328) ((emacs (25)) (cl-lib (0 5)) (flycheck (30)) (hydra (0 13 0)) (s (1 0))) "editing mode for CoNLL-U files" tar ((:commit . "0db3063572b0de08874822e20570bb153747e6ed") (:authors ("bruno cuconato" . "bcclaro+emacs@gmail.com")) (:maintainer "bruno cuconato" . "bcclaro+emacs@gmail.com") (:keywords "extensions") (:url . "https://github.com/odanoburu/conllu-mode"))])
+ (connection . [(20191111 446) nil "TCP-based client connection" single ((:commit . "bdf0aa7761d1c1a3bc0652b2fdc4a54b3acdb06a") (:authors ("Torsten Hilbrich" . "torsten.hilbrich@gmx.net")) (:maintainer "Torsten Hilbrich" . "torsten.hilbrich@gmx.net") (:keywords "network"))])
+ (constant-theme . [(20180921 1012) ((emacs (24 1))) "A calm, dark, almost monochrome color theme." tar ((:commit . "23543a09729569b566175abe1efbe774048d3fa8") (:authors ("Jannis Pohlmann" . "contact@jannispohlmann.de")) (:maintainer "Jannis Pohlmann" . "contact@jannispohlmann.de") (:keywords "themes") (:url . "https://github.com/jannis/emacs-constant-theme"))])
+ (consult . [(20220508 928) ((emacs (27 1)) (compat (28 1))) "Consulting completing-read" tar ((:commit . "1dfdf55f3d941f08089e5d0e611cd9daa8a44b19") (:authors ("Daniel Mendler and Consult contributors")) (:maintainer "Daniel Mendler" . "mail@daniel-mendler.de") (:url . "https://github.com/minad/consult"))])
+ (consult-ag . [(20220419 1721) ((emacs (27 1)) (consult (0 16))) "The silver searcher integration using Consult" single ((:commit . "2460ae6829e86c9f1186a852304d919526838cb8") (:authors ("Kanon Kakuno" . "yadex205@outlook.jp")) (:maintainer "Kanon Kakuno" . "yadex205@outlook.jp") (:url . "https://github.com/yadex205/consult-ag"))])
+ (consult-company . [(20211021 1152) ((emacs (27 1)) (company (0 9)) (consult (0 9))) "Consult frontend for company" single ((:commit . "ef1c553b4a72b23297b55708bf6f6dd1b27cc68e") (:authors ("mohsin kaleem" . "mohkale@kisara.moe")) (:maintainer "mohsin kaleem" . "mohkale@kisara.moe") (:url . "https://github.com/mohkale/consult-company"))])
+ (consult-dir . [(20220505 1037) ((emacs (26 1)) (consult (0 9)) (project (0 6 0))) "Insert paths into the minibuffer prompt" single ((:commit . "d397ca6ea67af4d3c59a330a778affd825f0efd9") (:authors ("Karthik Chikmagalur")) (:maintainer "Karthik Chikmagalur" . "karthik.chikmagalur@gmail.com") (:keywords "convenience") (:url . "https://github.com/karthink/consult-dir"))])
+ (consult-eglot . [(20220409 1238) ((emacs (27 1)) (eglot (1 7)) (consult (0 16)) (project (0 3 0))) "A consulting-read interface for eglot" single ((:commit . "0da8801dd8435160ce1f62ad8066bd52e38f5cbd") (:authors ("mohsin kaleem" . "mohkale@kisara.moe")) (:maintainer "Mohsin Kaleem") (:keywords "tools" "completion" "lsp") (:url . "https://github.com/mohkale/consult-eglot"))])
+ (consult-flycheck . [(20220403 1810) ((consult (0 16)) (flycheck (31)) (emacs (27 1))) "Provides the command `consult-flycheck'" single ((:commit . "9b40f136c017fadf6239d7602d16bf73b4ad5198") (:authors ("Daniel Mendler and Consult contributors")) (:maintainer "Daniel Mendler" . "mail@daniel-mendler.de") (:url . "https://github.com/minad/consult"))])
+ (consult-flyspell . [(20220419 2044) ((emacs (25 1)) (consult (0 12))) "Consult integration for flyspell" single ((:commit . "396def174495cc77413e2065ef79658a02490dad") (:authors ("Marco Pawłowski")) (:maintainer "Marco Pawłowski") (:keywords "convenience") (:url . "https://gitlab.com/OlMon/consult-flyspell"))])
+ (consult-ghq . [(20210606 2047) ((emacs (26 1)) (consult (0 8)) (affe (0 1))) "Ghq interface using consult" single ((:commit . "c8619d66bd8f8728e43ed15096078b89eb4d2083") (:authors ("Tomoya Otake" . "tomoya.ton@gmail.com")) (:maintainer "Tomoya Otake" . "tomoya.ton@gmail.com") (:keywords "convenience" "usability" "consult" "ghq") (:url . "https://github.com/tomoya/consult-ghq"))])
+ (consult-ls-git . [(20220501 1823) ((emacs (27 1)) (consult (0 16))) "Consult integration for git" single ((:commit . "f2398b354994e583ad22af324a129cf94d06009e") (:authors ("Robin Joy")) (:maintainer "Robin Joy") (:keywords "convenience") (:url . "https://github.com/rcj/consult-ls-git"))])
+ (consult-lsp . [(20220507 856) ((emacs (27 1)) (lsp-mode (5 0)) (consult (0 16)) (f (0 20 0))) "LSP-mode Consult integration" single ((:commit . "19606a03cf854e1b0930c4526ed92c4560dccdc2") (:authors ("Gerry Agbobada")) (:maintainer "Gerry Agbobada") (:keywords "tools" "completion" "lsp") (:url . "https://github.com/gagbo/consult-lsp"))])
+ (consult-notmuch . [(20220421 717) ((emacs (26 1)) (consult (0 9)) (notmuch (0 31))) "Notmuch search using consult" single ((:commit . "16eb2c100ca144140f07014c32e99487c6a73e18") (:authors ("Jose A Ortega Ruiz" . "jao@gnu.org")) (:maintainer "Jose A Ortega Ruiz") (:keywords "mail") (:url . "https://codeberg.org/jao/consult-notmuch"))])
+ (consult-org-roam . [(20220508 1232) ((emacs (27 1)) (org-roam (2 2 0)) (consult (0 16))) "Consult integration for org-roam" single ((:commit . "05cec288f931a1f3cd5984b88a79f1339110e4b9") (:authors ("jgru <https://github.com/jgru>")) (:maintainer "jgru <https://github.com/jgru>") (:url . "https://github.com/jgru/consult-org-roam"))])
+ (consult-project-extra . [(20220424 1815) ((emacs (27 1)) (consult (0 17)) (project (0 8 1))) "Consult integration for project.el" single ((:commit . "fa882a0bf9b697ebb59d0dfa2ffd81ea6daabf41") (:authors ("Enrique Kessler Martínez")) (:maintainer "Enrique Kessler Martínez") (:keywords "convenience" "project" "management") (:url . "https://github.com/Qkessler/consult-project-extra"))])
+ (consult-projectile . [(20220505 1139) ((emacs (25 1)) (consult (0 12)) (projectile (2 5 0))) "Consult integration for projectile" single ((:commit . "8e618bc62405e345cc59e891f82d8ee45691010a") (:authors ("Marco Pawłowski")) (:maintainer "Marco Pawłowski") (:keywords "convenience") (:url . "https://gitlab.com/OlMon/consult-projectile"))])
+ (consult-recoll . [(20220227 2050) ((emacs (26 1)) (consult (0 9))) "Recoll queries using consult" single ((:commit . "228306eeda8c57db45609ca068f60ee433367c17") (:authors ("Jose A Ortega Ruiz" . "jao@gnu.org")) (:maintainer "Jose A Ortega Ruiz") (:keywords "docs" "convenience") (:url . "https://codeberg.org/jao/consult-recoll"))])
+ (consult-spotify . [(20211114 2258) ((emacs (26 1)) (consult (0 8)) (espotify (0 1))) "Spotify queries using consult" single ((:commit . "ea6d6021e5acc550560325db2f09198839ee702f") (:authors ("Jose A Ortega Ruiz" . "jao@gnu.org")) (:maintainer "Jose A Ortega Ruiz") (:keywords "multimedia") (:url . "https://codeberg.org/jao/espotify"))])
+ (consult-yasnippet . [(20220409 1209) ((emacs (27 1)) (yasnippet (0 14)) (consult (0 16))) "A consulting-read interface for yasnippet" single ((:commit . "cdb256d2c50e4f8473c6052e1009441b65b8f8ab") (:authors ("mohsin kaleem" . "mohkale@kisara.moe")) (:maintainer "mohsin kaleem" . "mohkale@kisara.moe") (:url . "https://github.com/mohkale/consult-yasnippet"))])
+ (contextual . [(20180726 800) ((emacs (24)) (dash (2 12 1)) (cl-lib (0 5))) "Contextual profile management system" single ((:commit . "e3c0de4a2e06757a0e8407c3c6e75930026191e3") (:authors ("Alexander Kahl" . "ak@sodosopa.io")) (:maintainer "Alexander Kahl" . "ak@sodosopa.io") (:keywords "convenience" "tools") (:url . "https://github.com/lshift-de/contextual"))])
+ (contextual-menubar . [(20180205 709) nil "display the menubar only on a graphical display" single ((:commit . "f76f55232ac07df76ef9a334a0c527dfab97c40b") (:authors ("Aaron Jensen" . "aaronjensen@gmail.com")) (:maintainer "Aaron Jensen" . "aaronjensen@gmail.com") (:url . "https://github.com/aaronjensen/contextual-menubar"))])
+ (contrast-color . [(20160903 1807) ((emacs (24 3)) (cl-lib (0 5))) "Pick best contrast color for you" single ((:commit . "c5fb77a211ebbef3185ada37bea7420534c33f94") (:authors ("Yuta Yamada <cokesboy[at]gmail.com>")) (:maintainer "Yuta Yamada <cokesboy[at]gmail.com>") (:keywords "color" "convenience") (:url . "https://github.com/yuutayamada/contrast-color-el"))])
+ (control-mode . [(20160624 1710) nil "A \"control\" mode, similar to vim's \"normal\" mode" single ((:commit . "72d6179b60adc438aada74083b2bf4264b575de3") (:authors ("Stephen Marsh" . "stephen.david.marsh@gmail.com")) (:maintainer "Stephen Marsh" . "stephen.david.marsh@gmail.com") (:keywords "convenience" "emulations") (:url . "https://github.com/stephendavidmarsh/control-mode"))])
+ (conventional-changelog . [(20211212 1158) ((emacs (27)) (transient (0 3 6))) "Conventional Changelog Generator" single ((:commit . "40c2ee58364422b776e81dc153918205bfbeda86") (:authors ("liuyinz" . "liuyinz95@gmail.com")) (:maintainer "liuyinz" . "liuyinz95@gmail.com") (:keywords "tools") (:url . "https://github.com/liuyinz/emacs-conventional-changelog"))])
+ (copy-as-format . [(20190523 258) ((cl-lib (0 5))) "Copy buffer locations as GitHub/Slack/JIRA etc... formatted code" single ((:commit . "a0962b670e26b723ce304b14e3397da453aef84e") (:authors ("Skye Shaw" . "skye.shaw@gmail.com")) (:maintainer "Skye Shaw" . "skye.shaw@gmail.com") (:keywords "github" "slack" "jira" "hipchat" "gitlab" "bitbucket" "org-mode" "pod" "rst" "asciidoc" "tools" "convenience") (:url . "https://github.com/sshaw/copy-as-format"))])
+ (copy-file-on-save . [(20200616 518) ((emacs (24 3)) (cl-lib (0 5)) (f (0 17)) (s (1 7 0))) "Copy file on save, automatic deployment it." single ((:commit . "811c8fe638c5616b6471525421e61a4470be3b52") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "files" "comm" "deploy") (:url . "https://github.com/emacs-php/emacs-auto-deployment"))])
+ (copyit . [(20190919 1258) ((emacs (24 3)) (s (1 9 0))) "Copy it, yank anything!" single ((:commit . "c4f2c28e5b6270e8e3364341619f1154bb4e682e") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "convenience" "yank" "clipboard") (:url . "https://github.com/zonuexe/emacs-copyit"))])
+ (copyit-pandoc . [(20190919 1258) ((emacs (24 3)) (copyit (0 1 0)) (pandoc (0 0 1))) "Copy it, yank anything!" single ((:commit . "c4f2c28e5b6270e8e3364341619f1154bb4e682e") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "convenience" "yank" "clipboard") (:url . "https://github.com/zonuexe/emacs-copyit"))])
+ (coq-commenter . [(20170822 2309) ((dash (2 13 0)) (s (1 11 0)) (cl-lib (0 5))) "Coq commenting minor mode for proof" single ((:commit . "7fe9a2cc0ebdb0b1e54a24eb7971d757fb588ac3") (:authors ("Junyoung Clare Jang" . "jjc9310@gmail.com")) (:maintainer "Junyoung Clare Jang" . "jjc9310@gmail.com") (:keywords "comment" "coq" "proof") (:url . "http://github.com/ailrun/coq-commenter"))])
+ (corfu-doc . [(20220429 1348) ((emacs (26 0)) (corfu (0 16 0))) "Documentation popup for Corfu" single ((:commit . "5a6f4f879de6dc2ca6e22789878d416e88e85905") (:authors ("Yuwei Tian" . "ibluefocus@NOSPAM.gmail.com")) (:maintainer "Yuwei Tian" . "ibluefocus@NOSPAM.gmail.com") (:keywords "corfu" "popup" "documentation" "convenience") (:url . "https://github.com/galeo/corfu-doc"))])
+ (corral . [(20160502 701) nil "Quickly surround text with delimiters" single ((:commit . "e7ab6aa118e46b93d4933d1364bc273f57cd6911") (:authors ("Kevin Liu" . "mail@nivekuil.com")) (:maintainer "Kevin Liu" . "mail@nivekuil.com") (:url . "http://github.com/nivekuil/corral"))])
+ (cort . [(20211020 18) ((emacs (24 1)) (ansi (0 4)) (cl-lib (0 6))) "Simplify extended unit test framework" single ((:commit . "3f64a7b03a4c5b768ec21fd5987acd0d62d16c7b") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "test" "lisp") (:url . "https://github.com/conao3/cort.el"))])
+ (cosmo . [(20170922 744) ((emacs (24 4))) "Cosmological Calculator" single ((:commit . "dd83b09a49a2843606b28279b674b2207040b36b") (:authors ("Francesco Montanari" . "fmnt@fmnt.info")) (:maintainer "Francesco Montanari" . "fmnt@fmnt.info") (:keywords "tools") (:url . "https://gitlab.com/montanari/cosmo-el"))])
+ (counsel . [(20220402 953) ((emacs (24 5)) (ivy (0 13 4)) (swiper (0 13 4))) "Various completion functions using Ivy" single ((:commit . "8bf8027e4bd8c093bddb76a813952d2a0dcbf21d") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "convenience" "matching" "tools") (:url . "https://github.com/abo-abo/swiper"))])
+ (counsel-ag-popup . [(20210121 805) ((emacs (26 1)) (counsel (0 13 0)) (transient (0 3 0))) "Interactive search with counsel-ag" single ((:commit . "41d85fe36edd72da68f5009ad9cf9013cd19960d") (:authors ("Eder Elorriaga" . "gexplorer8@gmail.com")) (:maintainer "Eder Elorriaga" . "gexplorer8@gmail.com") (:keywords "convenience" "matching" "tools") (:url . "https://github.com/gexplorer/counsel-ag-popup"))])
+ (counsel-at-point . [(20220507 1118) ((emacs (26 2)) (counsel (0 13 0))) "Context sensitive project search" single ((:commit . "f618411fc8f607e4c93b5efa98584fd461c53ac6") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:keywords "convenience") (:url . "https://codeberg.com/ideasman42/emacs-counsel-at-point"))])
+ (counsel-bbdb . [(20181128 1320) ((ivy (0 8 0)) (emacs (24 3))) "Quick search&input email from BBDB based on ivy" single ((:commit . "df2890deb73b09f8055243bd91942ea887d9b7a1") (:authors ("Chen Bin <chenbin.sh AT gmail>")) (:maintainer "Chen Bin <chenbin.sh AT gmail>") (:keywords "mail" "abbrev" "convenience" "matching") (:url . "https://github.com/redguard/counsel-bbdb"))])
+ (counsel-chrome-bm . [(20211022 1427) ((emacs (25 1)) (counsel (0 13 0))) "Browse Chrom(e/ium) bookmarks with Ivy" single ((:commit . "72b31889581f20f4037c0361f5259ff3633bc128") (:authors ("BlueBoxWare" . "BlueBoxWare@users.noreply.github.com")) (:maintainer "BlueBoxWare" . "BlueBoxWare@users.noreply.github.com") (:keywords "hypermedia") (:url . "https://github.com/BlueBoxWare/counsel-chrome-bm"))])
+ (counsel-codesearch . [(20180925 803) ((codesearch (1)) (counsel (0 10 0)) (emacs (24)) (ivy (0 10 0))) "Counsel interface for codesearch.el" single ((:commit . "b7989fad3e06f301c31d5e896c42b6cc549a0e0c") (:authors ("Austin Bingham" . "austin.bingham@gmail.com")) (:maintainer "Austin Bingham" . "austin.bingham@gmail.com") (:keywords "tools") (:url . "https://github.com/abingham/emacs-counsel-codesearch"))])
+ (counsel-css . [(20211115 1755) ((emacs (24 4)) (counsel (0 7 0)) (cl-lib (0 5))) "stylesheet-selector-aware swiper" single ((:commit . "8e9c0515fc952452eee786d8ebb43d48ea86c9f8") (:authors ("Henrik Lissner <http://github/hlissner>")) (:maintainer "Henrik Lissner" . "contact@henrik.io") (:keywords "convenience" "tools" "counsel" "swiper" "selector" "css" "less" "scss") (:url . "https://github.com/hlissner/emacs-counsel-css"))])
+ (counsel-dash . [(20200103 1411) ((emacs (24 4)) (dash-docs (1 4 0)) (counsel (0 8 0)) (cl-lib (0 5))) "Browse dash docsets using Ivy" single ((:commit . "370d5f6f14b5294d0eb717f7b2a6a8e93df1ed24") (:authors ("Nathan Kot" . "nk@nathankot.com")) (:maintainer "Nathan Kot" . "nk@nathankot.com") (:keywords "dash" "ivy" "counsel") (:url . "https://github.com/nathankot/counsel-dash"))])
+ (counsel-edit-mode . [(20210824 1504) ((emacs (26 1)) (ht (2 3)) (s (1 12 0)) (counsel (0 10 0))) "Edit results of counsel commands in-place" single ((:commit . "378803ac0040c04762ff001ab1aca7d4325ecf22") (:authors ("Tyler Dodge")) (:maintainer "Tyler Dodge") (:keywords "convenience" "matching") (:url . "https://github.com/tyler-dodge/counsel-edit-mode"))])
+ (counsel-etags . [(20220405 510) ((emacs (25 1)) (counsel (0 13 4))) "Fast and complete Ctags/Etags solution using ivy" single ((:commit . "c74ae94297c4a2dc0b6878c2e9460a4f386158d4") (:authors ("Chen Bin <chenbin dot sh AT gmail dot com>")) (:maintainer "Chen Bin <chenbin dot sh AT gmail dot com>") (:keywords "tools" "convenience") (:url . "http://github.com/redguardtoo/counsel-etags"))])
+ (counsel-fd . [(20210606 1724) ((counsel (0 12 0))) "counsel interface for fd" single ((:commit . "e9513a3c7f6cdbdf038f951e828e631c0455e7d4") (:keywords "tools") (:url . "https://github.com/CsBigDataHub/counsel-fd"))])
+ (counsel-ffdata . [(20191017 1237) ((emacs (25 1)) (counsel (0 11 0)) (emacsql (3 0 0))) "Use ivy to access firefox data" single ((:commit . "88c2348c4039d9e562bd3d9a364708b01037c283") (:authors ("Zhu Zihao" . "all_but_last@163.com")) (:maintainer "Zhu Zihao" . "all_but_last@163.com") (:keywords "convenience" "tools" "matching") (:url . "https://github.com/cireu/counsel-ffdata"))])
+ (counsel-gtags . [(20210222 1803) ((emacs (25 1)) (counsel (0 8 0)) (seq (1 0))) "ivy for GNU global" single ((:commit . "1d52eaeffeb60266434d4f7416a108ca058fde91") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com") ("Felipe Lema" . "felipelema@mortemale.org") ("Jimmy Aguilar Mena" . "spacibba@aol.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/FelipeLema/emacs-counsel-gtags"))])
+ (counsel-jq . [(20210329 749) ((swiper (0 12 0)) (ivy (0 12 0)) (emacs (24 1))) "Live preview of \"jq\" queries using counsel" single ((:commit . "8cadd2e96470402ede4881b4e955872976443689") (:authors ("Alain M. Lafon" . "alain@200ok.ch")) (:maintainer "Alain M. Lafon" . "alain@200ok.ch") (:keywords "convenience" "data" "matching") (:url . "https://github.com/200ok-ch/counsel-jq"))])
+ (counsel-mairix . [(20210422 649) ((emacs (26 3)) (ivy (0 13 1))) "Counsel interface for Mairix" single ((:commit . "39fa2ad10a5f899cb3f3275f9a6ebd166c51216a") (:authors ("Antoine Kalmbach" . "ane@iki.fi")) (:maintainer "Antoine Kalmbach" . "ane@iki.fi") (:keywords "mail") (:url . "https://sr.ht/~ane/counsel-mairix"))])
+ (counsel-notmuch . [(20181203 935) ((emacs (24)) (ivy (0 10 0)) (notmuch (0 21)) (s (1 12 0))) "Search emails in Notmuch asynchronously with Ivy" single ((:commit . "a4a1562935e4180c42524c51609d1283e9be0688") (:authors ("Alexander Fu Xi" . "fuxialexander@gmail.com")) (:maintainer "Alexander Fu Xi" . "fuxialexander@gmail.com") (:keywords "mail") (:url . "https://github.com/fuxialexander/counsel-notmuch"))])
+ (counsel-org-capture-string . [(20200810 1114) ((emacs (25 1)) (ivy (0 13))) "Counsel for org-capture-string" single ((:commit . "dbb7d95f99d7910d76ffc2d024580088a34ec444") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:keywords "outlines") (:url . "https://github.com/akirak/counsel-org-capture-string"))])
+ (counsel-org-clock . [(20200810 1109) ((emacs (25 1)) (ivy (0 10 0)) (dash (2 0))) "Counsel commands for org-clock" single ((:commit . "0f790def6ac2b5a84d01eed47a7ee53619a8f5b9") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:url . "https://github.com/akirak/counsel-org-clock"))])
+ (counsel-osx-app . [(20160821 809) ((ivy (0 8 0)) (emacs (24 3))) "launch osx applications via ivy interface" single ((:commit . "b1c54cbc033c4939966910d85ce035503079e108") (:authors ("Boris Buliga" . "d12frosted@gmail.com")) (:maintainer "Boris Buliga" . "d12frosted@gmail.com") (:url . "https://github.com/d12frosted/counsel-osx-app"))])
+ (counsel-projectile . [(20211004 2003) ((counsel (0 13 4)) (projectile (2 5 0))) "Ivy integration for Projectile" single ((:commit . "40d1e1d4bb70acb00fddd6f4df9778bf2c52734b") (:authors ("Eric Danan")) (:maintainer "Eric Danan") (:keywords "project" "convenience") (:url . "https://github.com/ericdanan/counsel-projectile"))])
+ (counsel-pydoc . [(20171018 2042) ((emacs (24 3)) (ivy (0 9 1))) "run pydoc with counsel" single ((:commit . "1d8ff8ca3b9d69453cde423b1887fbb490a95c9e") (:authors (nil . "Hao Deng(denghao8888@gmail.com)")) (:maintainer nil . "Hao Deng(denghao8888@gmail.com)") (:keywords "completion" "matching") (:url . "https://github.com/co-dh/pydoc_utils"))])
+ (counsel-spotify . [(20200818 2055) ((emacs (25 1)) (ivy (0 13 0))) "Control Spotify search and select music with Ivy" tar ((:commit . "2743ad52a9def53534fd505397fbe1ac49e53015") (:authors ("Lautaro García <https://github.com/Lautaro-Garcia>")) (:maintainer "Lautaro García <https://github.com/Lautaro-Garcia>") (:url . "https://github.com/Lautaro-Garcia/counsel-spotify"))])
+ (counsel-test . [(20190819 1920) ((emacs (25 1)) (ivy (0 11 0)) (s (1 12 0))) "Browse and execute tests with ivy" tar ((:commit . "7fc4e5d0d65c53edbcb4c25917bcf7faaea36ec7") (:keywords "tools" "ivy" "counsel" "testing" "ctest" "pytest") (:url . "http://github.com/xmagpie/counsel-test"))])
+ (counsel-tramp . [(20210518 1153) ((emacs (24 3)) (counsel (0 10))) "Tramp ivy interface for ssh, docker, vagrant" single ((:commit . "76719eebb791920272c69e75e234f05a815bb5c2") (:authors ("Masashı Mıyaura")) (:maintainer "Masashı Mıyaura") (:url . "https://github.com/masasam/emacs-counsel-tramp"))])
+ (counsel-web . [(20210609 2156) ((emacs (25 1)) (counsel (0 13 0)) (request (0 3 0))) "Search the Web using Ivy" single ((:commit . "1359b3b204fcdac7a3d6664c7d540a88b5acecfd") (:authors ("Matthew Sojourner Newton" . "matt@mnewton.com")) (:maintainer "Matthew Sojourner Newton" . "matt@mnewton.com") (:keywords "convenience" "hypermedia") (:url . "https://github.com/mnewt/counsel-web"))])
+ (counsel-world-clock . [(20190709 2211) ((ivy (0 9 0)) (s (1 12 0))) "Display world clock using Ivy." single ((:commit . "674e4c6b82a92ea765af97cc5f017b357284c7dc") (:authors ("Kuang Chen <http://github.com/kchenphy>")) (:maintainer "Kuang Chen <http://github.com/kchenphy>") (:url . "https://github.com/kchenphy/counsel-world-clock"))])
+ (countdown . [(20190626 244) ((emacs (25 1)) (stream (2 2 4))) "Countdown using big LCD-like digits" single ((:commit . "139dea91fc818d65944aca5f16c9626abbdfbf04") (:authors ("Xu Chunyang" . "mail@xuchunyang.me")) (:maintainer "Xu Chunyang" . "mail@xuchunyang.me") (:keywords "tools") (:url . "https://github.com/xuchunyang/countdown.el"))])
+ (cov . [(20220410 2247) ((emacs (24 4)) (f (0 18 2)) (s (1 11 0)) (elquery (0))) "Show coverage stats in the fringe." single ((:commit . "8396fa82a84965cd88fa23f5b361ab80ff28e231") (:authors ("Adam Niederer")) (:maintainer "Adam Niederer") (:keywords "coverage" "gcov" "c") (:url . "https://github.com/AdamNiederer/cov"))])
+ (coverage . [(20191113 1958) ((ov (1 0)) (cl-lib (0 5))) "Code coverage line highlighting" single ((:commit . "6e3c6f2dcb759a76086adeeb1fdfe83e4f082482") (:authors ("Kieran Trezona-le Comte" . "trezona.lecomte@gmail.com")) (:maintainer "Kieran Trezona-le Comte" . "trezona.lecomte@gmail.com") (:keywords "coverage" "metrics" "simplecov" "ruby" "rspec") (:url . "https://github.com/trezona-lecomte/coverage"))])
+ (coverlay . [(20190414 940) ((emacs (24 1)) (cl-lib (0 5))) "Test coverage overlays" single ((:commit . "0beae208d0e7d746a94385428bd61aa5cd7ea828") (:authors ("Takuto Wada <takuto.wada at gmail com>")) (:maintainer "Takuto Wada <takuto.wada at gmail com>") (:keywords "coverage" "overlay") (:url . "https://github.com/twada/coverlay.el"))])
+ (cowsay . [(20210510 1540) ((emacs (24 5))) "Poorly drawn ASCII cartoons saying things" single ((:commit . "683c23afa2a37272be54de822ad19f4e11dd86ba") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "games") (:url . "https://github.com/lassik/emacs-cowsay"))])
+ (cp5022x . [(20120323 2335) nil "cp50220, cp50221, cp50222 coding system" single ((:commit . "ea7327dd75e54539576916f592ae1be98179ae35") (:authors ("ARISAWA Akihiro" . "ari@mbf.ocn.ne.jp")) (:maintainer "ARISAWA Akihiro" . "ari@mbf.ocn.ne.jp") (:keywords "languages" "cp50220" "cp50221" "cp50222" "cp51932" "cp932"))])
+ (cpanfile-mode . [(20161001 710) ((emacs (24 4))) "Major mode for cpanfiles" single ((:commit . "eda675703525198df1f76ddf250bffa40217ec5d") (:authors ("Zak B. Elep" . "zakame@zakame.net")) (:maintainer "Zak B. Elep" . "zakame@zakame.net") (:keywords "perl") (:url . "https://github.com/zakame/cpanfile-mode"))])
+ (cpp-auto-include . [(20210318 2217) ((cl-lib (0 5))) "Insert and delete C++ header files automatically" single ((:commit . "0ce829f27d466c083e78b9fe210dcfa61fb417f4") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/emacsorphanage/cpp-auto-include"))])
+ (cpputils-cmake . [(20181006 328) nil "Easy realtime C++ syntax check and IntelliSense with CMake." single ((:commit . "64b2b05eff5398b4cd522e66efaf14553ab18ff4") (:authors ("Chen Bin" . "chenbin.sh@gmail.com")) (:maintainer "Chen Bin" . "chenbin.sh@gmail.com") (:keywords "cmake" "intellisense" "flymake" "flycheck") (:url . "http://github.com/redguardtoo/cpputils-cmake"))])
+ (cpu-sos . [(20200409 2356) ((emacs (25 1))) "S.O.S. from a CPU in distress" single ((:commit . "1594b76d4ad3a6e3c471d82da366226d156e6226") (:authors ("Bruno Félix Rezende Ribeiro" . "oitofelix@gnu.org")) (:maintainer "Bruno Félix Rezende Ribeiro" . "oitofelix@gnu.org") (:keywords "processes") (:url . "https://github.com/oitofelix/cpu-sos"))])
+ (cql-mode . [(20190315 225) ((emacs (24))) "Major mode for editting CQLs" single ((:commit . "d400c046850d3cf404778b2c47d6be4ff84ca04b") (:authors ("Yuki Inoue <inouetakahiroki at gmail.com>")) (:maintainer "Yuki Inoue <inouetakahiroki at gmail.com>") (:keywords "cql" "cassandra") (:url . "https://github.com/Yuki-Inoue/cql-mode"))])
+ (cquery . [(20190118 542) ((emacs (25 1)) (lsp-mode (3 4)) (dash (0 13))) "cquery client for lsp-mode" tar ((:commit . "555e50984ebda177421fdcdc8c76cb29235d9694") (:authors ("Tobias Pisani")) (:maintainer "Tobias Pisani") (:keywords "languages" "lsp" "c++") (:url . "https://github.com/jacobdufault/cquery"))])
+ (crappy-jsp-mode . [(20140311 931) nil "A pretty crappy major-mode for jsp." single ((:commit . "6c45ab92b452411cc0fab9bcee2f456276b4fc40") (:keywords "jsp" "major" "mode"))])
+ (creamsody-theme . [(20170222 1058) ((autothemer (0 2))) "Straight from the soda fountain." single ((:commit . "32fa3f4e461da92700523b1b20e7b28974c19a26") (:url . "http://github.com/emacsfodder/emacs-theme-creamsody"))])
+ (create-link . [(20211014 1617) ((emacs (25 1))) "Smart format link generator" single ((:commit . "e765b1067ced891a90ba0478af7fe675cff9b713") (:authors ("Kijima Daigo" . "norimaking777@gmail.com")) (:maintainer "Kijima Daigo" . "norimaking777@gmail.com") (:keywords "link" "format" "browser" "convenience") (:url . "https://github.com/kijimaD/create-link"))])
+ (creds . [(20140510 1706) ((s (1 9 0)) (dash (2 5 0))) "A parser credentials file library (not limited to credentials entries)" tar ((:commit . "b059397a7d59481f05fbb1bb9c8d3c2c69226482") (:authors ("Antoine R. Dumont <eniotna.t AT gmail.com>")) (:maintainer "Antoine R. Dumont <eniotna.t AT gmail.com>") (:keywords "credentials") (:url . "https://github.com/ardumont/emacs-creds"))])
+ (creole . [(20140924 1500) ((noflet (0 0 3)) (kv (0 0 17))) "A parser for the Creole Wiki language" single ((:commit . "7d5cffe93857f6c75ca09ac79c0e47b8d4410e53") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "lisp" "creole" "wiki"))])
+ (creole-mode . [(20130722 50) nil "a markup mode for creole" single ((:commit . "b5e79b2ec5f19fb5aacf689b5febc3e0b61515c4") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "hypermedia" "wp") (:url . "https://github.com/nicferrier/creole-mode"))])
+ (cricbuzz . [(20180804 2254) ((enlive (0 0 1)) (f (0 19 0)) (dash (2 13 0)) (s (1 11 0))) "Cricket scores from cricbuzz in emacs" single ((:commit . "0b95d45991bbcd2fa58d96ce921f6a57ba42c153") (:authors ("Abhinav Tushar" . "abhinav.tushar.vs@gmail.com")) (:maintainer "Abhinav Tushar" . "abhinav.tushar.vs@gmail.com") (:keywords "cricket" "score") (:url . "https://github.com/lepisma/cricbuzz.el"))])
+ (crm-custom . [(20160117 6) ((cl-lib (0 5))) "Alternate `completing-read-multiple' that uses `completing-read'" single ((:commit . "f1aaccf64306a5f99d9bf7ba815d7ea41c15518d") (:authors ("Ryan C. Thompson" . "rct@thompsonclan.org")) (:maintainer "Ryan C. Thompson" . "rct@thompsonclan.org") (:keywords "completion" "minibuffer" "multiple elements") (:url . "https://github.com/DarwinAwardWinner/crm-custom"))])
+ (crontab-mode . [(20210715 133) ((emacs (24 3))) "Major mode for crontab(5)" single ((:commit . "7412f3df0958812bfcacd5875a409fa795fa8ecc") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "languages") (:url . "https://github.com/emacs-pe/crontab-mode"))])
+ (crossword . [(20210614 633) ((emacs (26 1))) "Download and play crossword puzzles" single ((:commit . "a8594b6e13f5e276aa9bc810ac74a8032bb1f678") (:keywords "games") (:url . "https://github.com/Boruch-Baum/emacs-crossword"))])
+ (crux . [(20210811 436) ((seq (1 11))) "A Collection of Ridiculously Useful eXtensions" single ((:commit . "6bfd212a7f7ae32e455802fde1f9e3f4fba932a0") (:authors ("Bozhidar Batsov" . "bozhidar@batsov.dev")) (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev") (:keywords "convenience") (:url . "https://github.com/bbatsov/crux"))])
+ (cryptol-mode . [(20190531 2051) nil "Cryptol major mode for Emacs" single ((:commit . "81ebbde83f7cb75b2dfaefc09de6a1703068c769") (:authors (nil . "Austin Seipp <aseipp [@at] pobox [dot] com>")) (:maintainer nil . "Austin Seipp <aseipp [@at] pobox [dot] com>") (:keywords "cryptol" "cryptography") (:url . "http://github.com/thoughtpolice/cryptol-mode"))])
+ (crystal-mode . [(20220104 2146) ((emacs (24 4))) "Major mode for editing Crystal files" single ((:commit . "96a8058205b24b513d0b9307db32f05e30f9570b") (:keywords "languages" "crystal") (:url . "https://github.com/crystal-lang-tools/emacs-crystal-mode"))])
+ (crystal-playground . [(20180830 501) ((emacs (25)) (crystal-mode (0 1 2))) "Local crystal playground for short code snippets." single ((:commit . "fb3691b1281207b459c5be50015a626f356dc40d") (:authors ("Jason Howell")) (:maintainer "Jason Howell") (:keywords "tools" "crystal") (:url . "https://github.com/jasonrobot/crystal-playground"))])
+ (csgo-conf-mode . [(20161209 1619) nil "CS:GO Configuration files syntax highlighting" single ((:commit . "57e7224f87a3ccc76b5564cc95fa0ff43bb6807c") (:authors ("Guillermo Robles" . "guillerobles1995@gmail.com")) (:maintainer "Guillermo Robles" . "guillerobles1995@gmail.com") (:keywords "languages") (:url . "https://github.com/wynro/emacs-csgo-conf-mode"))])
+ (csharp-mode . [(20211124 1105) ((emacs (26 1))) "C# mode derived mode" tar ((:commit . "fa06dfa206812476217ada6c4178de34ff1efc42") (:authors ("Theodor Thornhill" . "theo@thornhill.no")) (:maintainer "Jostein Kjønigsen" . "jostein@gmail.com") (:keywords "c#" "languages" "oop" "mode") (:url . "https://github.com/emacs-csharp/csharp-mode"))])
+ (csound-mode . [(20211215 1925) ((emacs (25)) (shut-up (0 3 2)) (multi (2 0 1)) (dash (2 16 0)) (highlight (0))) "A major mode for interacting and coding Csound" tar ((:commit . "44c49e5a9262ede4b4477bafb13b42b1ba047b9c") (:authors ("Hlöðver Sigurðsson" . "hlolli@gmail.com")) (:maintainer "Hlöðver Sigurðsson" . "hlolli@gmail.com") (:url . "https://github.com/hlolli/csound-mode"))])
+ (csproj-mode . [(20200801 1732) ((emacs (24))) "Work with .NET project files (csproj, vbproj)" tar ((:commit . "a7f0f4610c976a28c41b9b8299892f88b5d0336c") (:authors ("Omair Majid" . "omair.majid@gmail.com")) (:maintainer "Omair Majid" . "omair.majid@gmail.com") (:keywords "languages" "tools") (:url . "https://github.com/omajid/csproj-mode"))])
+ (css-autoprefixer . [(20180311 1600) ((emacs (24))) "Adds autoprefix to CSS" single ((:commit . "386a5defc8543a3b87820f1761c075c7d1d93b38") (:authors (nil . "Kyung Mo Kweon<kkweon@gmail.com> and contributors")) (:maintainer nil . "Kyung Mo Kweon<kkweon@gmail.com> and contributors") (:keywords "convenience" "usability" "css") (:url . "https://github.com/kkweon/emacs-css-autoprefixer"))])
+ (css-comb . [(20160416 559) nil "Sort CSS properties in a particular order using CSS Comb" single ((:commit . "6fa45e5af8a8bd3af6c1154cde3540e32c4206ee") (:authors ("Charanjit Singh" . "ckhabra@gmail.com")) (:maintainer "Charanjit Singh" . "ckhabra@gmail.com") (:url . "https://github.com/channikhabra/css-comb.el"))])
+ (css-eldoc . [(20220415 1629) nil "an eldoc-mode plugin for CSS source code" tar ((:commit . "73ebf9757a043b56b7d3b5befec5a38e6754b9e5") (:authors ("Zeno Zeng" . "zenoes@qq.com")) (:maintainer "Zeno Zeng" . "zenoes@qq.com"))])
+ (cssh . [(20150810 1709) nil "clusterssh implementation for emacs" single ((:commit . "2fe2754235225a59b63f08b130cfd4352e2e1c3f") (:authors ("Dimitri Fontaine" . "dim@tapoueh.org")) (:maintainer "Dimitri Fontaine" . "dim@tapoueh.org") (:keywords "clusterssh" "ssh" "cssh") (:url . "http://tapoueh.org/emacs/cssh.html"))])
+ (csv . [(20161113 1510) nil "Functions for reading and parsing CSV files." single ((:commit . "aa1dfa1263565d5fac3879c21d8ddf5f8915e411") (:authors ("Ulf Jasper" . "ulf.jasper@web.de")) (:maintainer "Ulf Jasper" . "ulf.jasper@web.de") (:keywords "extensions" "data" "csv"))])
+ (ct . [(20210219 1344) ((emacs (26 1)) (dash (2 18 0)) (hsluv (1 0 0))) "Color Tools - a color api" single ((:commit . "c302ee94feee0c5efc511e8f9fd8cb2f6dfe3490") (:authors ("neeasade")) (:maintainer "neeasade") (:keywords "convenience" "color" "theming" "rgb" "hsv" "hsl" "cie-lab" "background") (:url . "https://github.com/neeasade/ct.el"))])
+ (ctable . [(20210128 629) ((emacs (24 3)) (cl-lib (0 5))) "Table component for Emacs Lisp" single ((:commit . "48b73742757a3ae5736d825fe49e00034cc453b5") (:authors ("SAKURAI Masashi <m.sakurai at kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai at kiwanami.net>") (:keywords "table") (:url . "https://github.com/kiwanami/emacs-ctable"))])
+ (ctags-update . [(20190609 613) nil "(auto) update TAGS in parent directory using exuberant-ctags" single ((:commit . "67faf248b92388442958a069263c62a345425a1b") (:authors (nil . "Joseph(纪秀峰) jixiuf@gmail.com")) (:maintainer nil . "Joseph(纪秀峰) jixiuf@gmail.com") (:keywords "exuberant-ctags" "etags") (:url . "https://github.com/jixiuf/ctags-update"))])
+ (ctl-mode . [(20151202 1006) nil "Major mode for editing GrADS script files" single ((:commit . "1a13051db21b999c7682a015b33a03096ff9d891") (:authors ("Joe Wielgosz" . "joew@cola.iges.org")) (:maintainer "Joe Wielgosz" . "joew@cola.iges.org") (:keywords "grads" "script" "major-mode"))])
+ (ctrlf . [(20220509 2344) ((emacs (25 1))) "Emacs finally learns how to ctrl+F" single ((:commit . "d37d7a997e1e3ef5e2223aeecbbef92f369b0760") (:authors ("Radian LLC" . "contact+ctrlf@radian.codes")) (:maintainer "Radian LLC" . "contact+ctrlf@radian.codes") (:keywords "extensions") (:url . "https://github.com/radian-software/ctrlf"))])
+ (ctrlxo . [(20201021 701) ((emacs (25 1))) "Switch to the most recently used window" single ((:commit . "8ad95a81bd1ece06ebe40e2a83490775db64b419") (:authors ("Andrii Kolomoiets" . "andreyk.mad@gmail.com")) (:maintainer "Andrii Kolomoiets" . "andreyk.mad@gmail.com") (:keywords "frames") (:url . "https://github.com/muffinmad/emacs-ctrlxo"))])
+ (ctune . [(20210205 1428) ((emacs (26 1))) "Tune out CC Mode Noise Macros" tar ((:commit . "3f7abc6e74d4e5954b476ba9a1dc652f96b10c05") (:authors ("Mauro Aranda" . "maurooaranda@gmail.com")) (:maintainer "Mauro Aranda" . "maurooaranda@gmail.com") (:keywords "c" "convenience") (:url . "https://github.com/maurooaranda/ctune"))])
+ (ctxmenu . [(20140303 2142) ((popup (20140205 103)) (log4e (0 2 0)) (yaxception (0 1))) "Provide a context menu like right-click." tar ((:commit . "5c2376859562b98c07c985d2b483658e4c0e888e") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "popup") (:url . "https://github.com/aki2o/emacs-ctxmenu"))])
+ (cubicaltt . [(20171108 1402) ((emacs (24 1)) (cl-lib (0 5))) "Mode for cubical type theory" single ((:commit . "a5c6f94bfc0da84e214641e0b87aa9649ea114ea") (:keywords "languages") (:url . "https://github.com/mortberg/cubicaltt"))])
+ (cubicle-mode . [(20171009 1957) nil "Major mode for the Cubicle model checker" single ((:commit . "00f09bb2d4bb496549775e770d7ada08bc1e4866") (:authors ("Alain Mebsout")) (:maintainer "Alain Mebsout"))])
+ (cucumber-goto-step . [(20131210 519) ((pcre2el (1 5))) "Jump to cucumber step definition" single ((:commit . "f2713ffb26ebe1b757d1f2ea80e900b55e5895aa") (:authors ("Glen Stampoultzis" . "gstamp@gmail.com")) (:maintainer "Glen Stampoultzis" . "gstamp@gmail.com") (:url . "http://orthogonal.me"))])
+ (cuda-mode . [(20201013 2230) nil "NVIDIA CUDA Major Mode" single ((:commit . "7f593518fd135fc6af994024bcb47986dfa502d2") (:authors ("Jack Morrison" . "jackmorrison1@gmail.com")) (:maintainer "Jack Morrison" . "jackmorrison1@gmail.com") (:keywords "c" "languages"))])
+ (cue-mode . [(20220507 1728) ((emacs (25 1))) "Major mode for CUE language files" single ((:commit . "598c9b33b888e067e7472710a5f159cee98a0307") (:authors ("Russell Sim" . "russell.sim@gmail.com")) (:maintainer "Russell Sim" . "russell.sim@gmail.com") (:keywords "data" "languages") (:url . "https://github.com/russell/cue-mode"))])
+ (curl-to-elisp . [(20201124 1012) ((emacs (25 1))) "Convert cURL command to Emacs Lisp code" single ((:commit . "63d8d9c6d5efb8af8aa88042bfc0690ba699ef64") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:keywords "lisp") (:url . "https://github.com/xuchunyang/curl-to-elisp"))])
+ (currency-convert . [(20210427 2032) ((emacs (24 4))) "Currency converter" single ((:commit . "12805ea66aa8421de5eedda39d23f709de634460") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "comm" "convenience" "i18n") (:url . "https://github.com/lassik/emacs-currency-convert"))])
+ (current-word-highlight . [(20210323 1401) nil "Highlight the current word minor mode" single ((:commit . "d860f4e170ffa4cef840da93647f458cc409d554") (:authors ("Kijima Daigo" . "norimaking777@gmail.com")) (:maintainer "Kijima Daigo" . "norimaking777@gmail.com") (:keywords "highlight" "face" "convenience" "word") (:url . "https://github.com/kijimaD/current-word-highlight"))])
+ (curry-on-theme . [(20210322 1717) ((emacs (24 1))) "A low contrast color theme" single ((:commit . "b53a61d443cc75906d9f97e19f19be71f1e19bc4") (:authors ("Martín Varela" . "martin@varela.fi")) (:maintainer "Martín Varela" . "martin@varela.fi") (:url . "https://github.com/mvarela/Curry-On-Theme"))])
+ (cursor-flash . [(20210722 445) ((emacs (24 3))) "Highlight the cursor on buffer/window-switch" single ((:commit . "6bb54a1e2e1bf9df80926718b1b8b9ee49080484") (:keywords "convenience" "faces" "maint") (:url . "https://github.com/Boruch-Baum/emacs-cursor-flash"))])
+ (cursor-test . [(20131207 1732) ((emacs (24))) "testing library for cursor position in emacs." single ((:commit . "e09956e048b88fd2ee8dd90b5678baed8b04d31b") (:authors ("ainame")) (:maintainer "ainame") (:url . "https://github.com/ainame/cursor-test.el"))])
+ (cwl-mode . [(20210510 1150) ((yaml-mode (0 0 13)) (emacs (24 4))) "A major mode for editing CWL" single ((:commit . "23a333119efaac78453cba95d316109805bd6aec") (:authors ("Tomoya Tanjo" . "ttanjo@gmail.com")) (:maintainer "Tomoya Tanjo" . "ttanjo@gmail.com") (:keywords "languages" "cwl" "common workflow language") (:url . "https://github.com/tom-tan/cwl-mode"))])
+ (cyberpunk-2019-theme . [(20191008 1133) ((emacs (24 1))) "A retina-scorching cyberpunk theme" single ((:commit . "7e40c37210c363b2819fd9bb98a73101d7a3c206") (:authors ("Alex Lynham" . "alex@lynh.am")) (:maintainer "Alex Lynham" . "alex@lynh.am") (:keywords "cyberpunk" "theme" "themes") (:url . "https://github.com/the-frey/cyberpunk-2019"))])
+ (cyberpunk-theme . [(20200601 1632) nil "Cyberpunk Color Theme" single ((:commit . "cbd0d7193e69ff9e98262eb06aee3d27667ff5f5") (:authors ("Nicholas M. Van Horn" . "nvanhorn@protonmail.com")) (:maintainer "Nicholas M. Van Horn" . "nvanhorn@protonmail.com") (:keywords "color" "theme" "cyberpunk") (:url . "https://github.com/n3mo/cyberpunk-theme.el"))])
+ (cycbuf . [(20131203 2037) nil "Cycle buffers, inspired by swbuff.el, swbuff-x.el, and bs.el" single ((:commit . "1079b41c3eb27d65b66d4399959bb6253f84858e") (:authors ("Martin Pohlack martinp (at) gmx.de")) (:maintainer "Martin Pohlack martinp (at) gmx.de") (:keywords "files" "convenience" "buffer switching") (:url . "https://github.com/martinp26/cycbuf"))])
+ (cycle-at-point . [(20220507 1118) ((emacs (28 1)) (recomplete (0 2))) "Cycle (rotate) the thing under the cursor" tar ((:commit . "85750fa695797b95608b331b64ea49d81f7c8a36") (:authors ("Campbell Barton")) (:maintainer "Campbell Barton") (:keywords "convenience") (:url . "https://codeberg.com/ideasman42/emacs-cycle-at-point"))])
+ (cycle-resize . [(20160521 1557) nil "Cycle resize the current window horizontally or vertically" single ((:commit . "7d255d6fe85f12c967a0f7fcfcf18633be194c88") (:authors ("Pierre Lecocq")) (:maintainer "Pierre Lecocq") (:url . "https://github.com/pierre-lecocq/cycle-resize"))])
+ (cycle-themes . [(20150403 309) ((cl-lib (0 5))) "A global minor mode to make switching themes easier" single ((:commit . "6e125d11fdbc6b78fc9f219eb2609a5e29815898") (:keywords "themes" "utility" "global minor mode") (:url . "http://github.com/toroidal-code/cycle-themes.el"))])
+ (cyphejor . [(20210816 1607) ((emacs (24 4))) "Shorten major mode names using user-defined rules" single ((:commit . "576d237a46be79449a22e3a7912a3464d7b0c233") (:authors ("Mark Karpov" . "markkarpov92@gmail.com")) (:maintainer "Mark Karpov" . "markkarpov92@gmail.com") (:keywords "mode-line" "major-mode") (:url . "https://github.com/mrkkrp/cyphejor"))])
+ (cypher-mode . [(20151110 1142) nil "major mode for editing cypher scripts" single ((:commit . "ce8543d7877c736c574a17b49874c9dcdc7a06d6") (:authors ("François-Xavier Bois <fxbois AT Google Mail Service>")) (:maintainer "François-Xavier Bois") (:keywords "cypher" "graph") (:url . "http://github.com/fxbois/cypher-mode"))])
+ (cython-mode . [(20211111 1407) nil "Major mode for editing Cython files" single ((:commit . "812585935131125f8988c38417bb73bfd5a81c05"))])
+ (czech-holidays . [(20160113 1752) nil "Adds a list of Czech public holidays to Emacs calendar" single ((:commit . "d136fa09a152b3cd80db6d55c7b4ddfe07b90fbf") (:authors ("David Chkhikvadze" . "david.chk@outlook.com")) (:maintainer "David Chkhikvadze" . "david.chk@outlook.com") (:keywords "calendar"))])
+ (d-mode . [(20210119 1853) ((emacs (25 1))) "D Programming Language major mode for (X)Emacs" single ((:commit . "199743df55c6bfce3cdb08405bd8519768c8dfa9") (:authors ("William Baxter")) (:maintainer "Russel Winder" . "russel@winder.org.uk") (:keywords "d" "programming" "language" "emacs" "cc-mode"))])
+ (dactyl-mode . [(20140906 1725) nil "Major mode for editing Pentadactyl config files" single ((:commit . "cc55fe6b987271d9647492b8df4c812d884f661f") (:keywords "languages" "vim") (:url . "https://github.com/luxbock/dactyl-mode"))])
+ (dad-joke . [(20170928 658) ((emacs (24))) "Get/display dad jokes" single ((:commit . "bee47e7b746b403228fa7d7361cb095de19ac9ba") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "games") (:url . "https://github.com/davep/dad-joke.el"))])
+ (daemons . [(20211214 1251) ((emacs (25 1))) "UI for managing init system daemons (services)" tar ((:commit . "e18e84ccc13101f1609c213029cf011ae0ad1178") (:authors ("Chris Bowdon")) (:maintainer "Chris Bowdon") (:keywords "unix" "convenience") (:url . "https://github.com/cbowdon/daemons.el"))])
+ (dakrone-light-theme . [(20170808 2140) nil "dakrone's custom light theme" single ((:commit . "06f198dc8b4ca7421990b30a23d89c8e0b8c5de4") (:authors ("Lee Hinman <lee _AT_ writequit.org>")) (:maintainer "Lee Hinman <lee _AT_ writequit.org>") (:keywords "color" "themes" "faces") (:url . "https://github.com/dakrone/dakrone-light-theme"))])
+ (dakrone-theme . [(20170801 1933) nil "dakrone's custom dark theme" single ((:commit . "232ad1be5f3572dcbdf528f1655109aa355a6937") (:authors ("Lee Hinman <lee _AT_ writequit.org>")) (:maintainer "Lee Hinman <lee _AT_ writequit.org>") (:keywords "color" "themes") (:url . "https://github.com/dakrone/dakrone-theme"))])
+ (danneskjold-theme . [(20220316 1101) nil "Beautiful high-contrast Emacs theme." tar ((:commit . "054c0b9bc9cefb53a4065096e66707d20885c461") (:authors ("Dmitry Akatov" . "akatovda@yandex.com")) (:maintainer "Dmitry Akatov" . "akatovda@yandex.com") (:url . "https://github.com/rails-to-cosmos/"))])
+ (dante . [(20220429 1454) ((dash (2 12 0)) (emacs (25 1)) (f (0 19 0)) (flycheck (0 30)) (company (0 9)) (haskell-mode (13 14)) (s (1 11 0)) (lcr (1 0))) "Development mode for Haskell" single ((:commit . "b81081c2eb8dcbd7e67e05cf5e1991df6cf3e57c") (:authors ("Jean-Philippe Bernardy" . "jeanphilippe.bernardy@gmail.com")) (:maintainer "Jean-Philippe Bernardy" . "jeanphilippe.bernardy@gmail.com") (:keywords "haskell" "tools") (:url . "https://github.com/jyp/dante"))])
+ (dap-mode . [(20220509 1638) ((emacs (26 1)) (dash (2 18 0)) (lsp-mode (6 0)) (bui (1 1 0)) (f (0 20 0)) (s (1 12 0)) (lsp-treemacs (0 1)) (posframe (0 7 0)) (ht (2 3))) "Debug Adapter Protocol mode" tar ((:commit . "61b5938d9a61882c2e76c58ca7f70e9337ddba00") (:authors ("Ivan Yonchovski" . "yyoncho@gmail.com")) (:maintainer "Ivan Yonchovski" . "yyoncho@gmail.com") (:keywords "languages" "debug") (:url . "https://github.com/emacs-lsp/dap-mode"))])
+ (darcsum . [(20190316 2215) nil "a pcl-cvs like interface for managing darcs patches" single ((:commit . "6a8b690539d133c5e3d17cb23fe4365fbb6fb493") (:authors ("John Wiegley" . "johnw@gnu.org")) (:maintainer "John Wiegley" . "johnw@gnu.org") (:keywords "completion" "convenience" "tools" "vc"))])
+ (darcula-theme . [(20171227 1845) nil "Inspired by IntelliJ's Darcula theme" single ((:commit . "d9b82b58ded9014985be6658f4ab17e26ed9e93e") (:authors ("Sam Halliday" . "Sam.Halliday@gmail.com")) (:maintainer "Sam Halliday" . "Sam.Halliday@gmail.com") (:keywords "faces") (:url . "https://gitlab.com/fommil/emacs-darcula-theme"))])
+ (dark-krystal-theme . [(20170808 1300) ((emacs (24 0))) "an Emacs 24 theme based on Dark Krystal (tmTheme)" single ((:commit . "79084b99665dc9ffb0ec62cc092349a5ecebebbc") (:authors ("Jason Milkins")) (:maintainer "Jason Milkins") (:url . "https://github.com/emacsfodder/tmtheme-to-deftheme"))])
+ (dark-mint-theme . [(20160302 642) nil "dark & minty fresh theme" single ((:commit . "95c30a26de31549cd341184ba9ab2be8fdc67eba"))])
+ (dark-souls . [(20140314 1128) nil "Prepare to die" single ((:commit . "94122b1215423e58dcf18584a2bd022029d54d4b") (:authors ("Tom Jakubowski" . "tom@crystae.net")) (:maintainer "Tom Jakubowski" . "tom@crystae.net") (:keywords "games") (:url . "http://github.com/tomjakubowski/dark-souls.el"))])
+ (darkburn-theme . [(20170423 1652) nil "A not-so-low contrast color theme for Emacs." single ((:commit . "0af794ff7fac19778ac8a7efb92455c6f6c2158f") (:authors ("Jonas Gorauskas" . "jgorauskas@gmail.com")) (:maintainer "Jonas Gorauskas" . "jgorauskas@gmail.com") (:url . "http://github.com/gorauskas/darkburn-theme"))])
+ (darkmine-theme . [(20160406 624) nil "Yet another emacs dark color theme." single ((:commit . "7f7e82ca03bcad52911fa41fb3e204e32d6ee63e") (:authors ("Pierre Lecocq" . "pierre.lecocq@gmail.com")) (:maintainer "Pierre Lecocq" . "pierre.lecocq@gmail.com") (:url . "https://github.com/pierre-lecocq/darkmine-theme"))])
+ (darkokai-theme . [(20200614 1452) nil "A darker variant on Monokai." single ((:commit . "5820aeddfc8c869ba840cc534eba776936656a66") (:url . "http://github.com/sjrmanning/darkokai"))])
+ (darktooth-theme . [(20201215 822) ((autothemer (0 2))) "From the darkness... it watches" single ((:commit . "ec03b30ee7f43f89ca4c382bb3fe4ee560c028a8") (:url . "http://github.com/emacsfodder/emacs-theme-darktooth"))])
+ (dart-mode . [(20220401 0) ((emacs (24 3))) "Major mode for editing Dart files" single ((:commit . "9c846769abd37f7fdc7ba8388d1f3a2b844b75e3") (:authors ("https://github.com/bradyt/dart-mode/issues")) (:maintainer "https://github.com/bradyt/dart-mode/issues") (:keywords "languages") (:url . "https://github.com/bradyt/dart-mode"))])
+ (dart-server . [(20210501 1445) ((emacs (24 5)) (cl-lib (0 5)) (dash (2 10 0)) (flycheck (0 23)) (s (1 10))) "Minor mode for editing Dart files" single ((:commit . "75562baf9a89b7e314bc2f795f6ecdc5d1f2cc8c") (:authors ("Natalie Weizenbaum") ("Brady Trainor" . "mail@bradyt.com")) (:maintainer "Brady Trainor" . "mail@bradyt.com") (:keywords "languages") (:url . "https://github.com/bradyt/dart-server"))])
+ (dash . [(20220417 2250) ((emacs (24))) "A modern list library for Emacs" tar ((:commit . "7fd71338dce041b352f84e7939f6966f4d379459") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "extensions" "lisp") (:url . "https://github.com/magnars/dash.el"))])
+ (dash-alfred . [(20191024 450) ((emacs (25 1))) "Search Dash documentation via Dash-Alfred-Workflow" single ((:commit . "fcd21bd6c7eb5cd31377be970406ff3d2454bd5c") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:keywords "docs") (:url . "https://github.com/xuchunyang/dash-alfred.el"))])
+ (dash-at-point . [(20211023 104) nil "Search the word at point with Dash" single ((:commit . "fba1a6f42ea51d05110e12c62bdced664059eb55") (:authors ("Shinji Tanaka" . "shinji.tanaka@gmail.com")) (:maintainer "Shinji Tanaka" . "shinji.tanaka@gmail.com") (:url . "https://github.com/stanaka/dash-at-point"))])
+ (dash-docs . [(20210830 926) ((emacs (24 4)) (cl-lib (0 5)) (async (1 9 3))) "Offline documentation browser using Dash docsets." tar ((:commit . "29848b6b347ac520f7646c200ed2ec36cea3feda") (:authors ("Raimon Grau" . "raimonster@gmail.com") ("Toni Reina " . "areina0@gmail.com") ("Bryan Gilbert" . "bryan@bryan.sh")) (:maintainer "Raimon Grau" . "raimonster@gmail.com") (:keywords "docs") (:url . "http://github.com/areina/helm-dash"))])
+ (dash-functional . [(20210210 1449) ((dash (2 18 0))) "Collection of useful combinators for Emacs Lisp" single ((:commit . "7fd71338dce041b352f84e7939f6966f4d379459") (:authors ("Matus Goljer" . "matus.goljer@gmail.com") ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "extensions" "lisp") (:url . "https://github.com/magnars/dash.el"))])
+ (dashboard . [(20220409 620) ((emacs (26 1))) "A startup screen extracted from Spacemacs" tar ((:commit . "0a86c0eabe6bb5e188e6ae915d971103248a3d26") (:authors ("Rakan Al-Hneiti" . "rakan.alhneiti@gmail.com")) (:maintainer "Jesús Martínez" . "jesusmartinez93@gmail.com") (:keywords "startup" "screen" "tools" "dashboard") (:url . "https://github.com/emacs-dashboard/emacs-dashboard"))])
+ (dashboard-hackernews . [(20190109 205) ((emacs (24)) (dashboard (1 2 5)) (request (0 3 0))) "Display Hacker News on dashboard" single ((:commit . "b71814716d8f78181b9d1990f06072460de0797e") (:authors ("Hayato KAJIYAMA" . "kaji1216@gmail.com")) (:maintainer "Hayato KAJIYAMA" . "kaji1216@gmail.com") (:url . "https://github.com/hyakt/emacs-dashboard-hackernews"))])
+ (dashboard-ls . [(20220326 628) ((emacs (24 3)) (dashboard (1 2 5))) "Display files/directories in current directory on Dashboard" single ((:commit . "f9e199a20c654c3d1d8f405fdec9acb294afc004") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/emacs-dashboard/dashboard-ls"))])
+ (dashboard-project-status . [(20190202 1354) ((emacs (24)) (git (0 1 1)) (dashboard (1 2 5))) "Display a git project status in a dashboard widget." single ((:commit . "7675c138e9df8fe2c626e7ba9bbb8b6717671a41") (:authors ("Jason Duncan" . "jasond496@msn.com")) (:maintainer "Jason Duncan" . "jasond496@msn.com") (:url . "https://github.com/functionreturnfunction/dashboard-project-status"))])
+ (date-at-point . [(20150308 1243) nil "Add `date' to `thing-at-point' function" single ((:commit . "38df823d05df08ec0748a4185113fae5f99090e9") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "convenience") (:url . "https://github.com/alezost/date-at-point.el"))])
+ (date-field . [(20141129 105) ((dash (2 9 0)) (log4e (0 2 0)) (yaxception (0 3 2))) "Date widget" single ((:commit . "11c9170d1f7b343233f7716d4c0a62be024c1654") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "widgets") (:url . "https://github.com/aki2o/emacs-date-field"))])
+ (date2name . [(20190630 933) ((emacs (24 4))) "Package to prepend ISO Timestamps to files" single ((:commit . "386dbe73678705d6107cd5c9bdeb4f7c97632360") (:authors ("Max Beutelspacher")) (:maintainer "Max Beutelspacher") (:keywords "files" "convenience") (:url . "https://github.com/DerBeutlin/date2name.el"))])
+ (datetime . [(20211016 1656) ((emacs (24 4)) (extmap (1 1 1))) "Parsing, formatting and matching timestamps" tar ((:commit . "77dc214d9ae853c7206ae95cc92d720445c1eeb4") (:authors ("Paul Pogonyshev" . "pogonyshev@gmail.com")) (:maintainer "Paul Pogonyshev" . "pogonyshev@gmail.com") (:keywords "lisp" "i18n") (:url . "https://github.com/doublep/datetime"))])
+ (datetime-format . [(20160612 1715) nil "Datetime functions" single ((:commit . "e6427538b547cbe02e1bd6ed4b765c73620bdae8") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "datetime" "calendar") (:url . "https://github.com/zonuexe/emacs-datetime"))])
+ (datomic-snippets . [(20180817 1045) ((s (1 4 0)) (dash (1 2 0)) (yasnippet (0 6 1))) "Yasnippets for Datomic" tar ((:commit . "4a14228840d5252e13d2bf6209670f26345bbb84") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "snippets"))])
+ (dayone . [(20160105 1240) ((uuid (0 0 3)) (mustache (0 22)) (ht (1 5))) "Utility script for Day One" tar ((:commit . "ab628274f0806451f23bce16f62a6a11cbf91a2b") (:authors ("mori-dev" . "mori.dev.asdf@gmail.com")) (:maintainer "mori-dev" . "mori.dev.asdf@gmail.com") (:keywords "day one" "tools" "convenience") (:url . "https://github.com/mori-dev/emacs-dayone"))])
+ (db . [(20140421 2111) ((kv (0 0 11))) "A database for EmacsLisp" single ((:commit . "b3a423fb8e72f9013009cbe033d654df2ce31438") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "data" "lisp"))])
+ (db-pg . [(20130131 1902) ((pg (0 12)) (db (0 0 6))) "A PostgreSQL adapter for emacs-db" single ((:commit . "7d5ab86b74b05fe003b3b434d4835f37f3f3eded") (:authors ("Nic Ferrier" . "nic@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nic@ferrier.me.uk") (:keywords "data" "comm" "database" "postgresql"))])
+ (dbc . [(20201001 1452) ((emacs (24 4)) (cl-lib (0 5)) (ht (2 3))) "Control how to open buffers" single ((:commit . "6728e72f72347d098b7d75ac4c29a7d687cc9ed3") (:authors ("Matsievskiy S.V.")) (:maintainer "Matsievskiy S.V.") (:keywords "convenience") (:url . "https://gitlab.com/matsievskiysv/display-buffer-control"))])
+ (ddskk . [(20220501 2005) ((ccc (1 43)) (cdb (20141201 754))) "Simple Kana to Kanji conversion program." tar ((:commit . "c664b26d0861621ac86b5b5f47835dd84f06dc93"))])
+ (ddskk-posframe . [(20200812 917) ((emacs (26 1)) (posframe (0 4 3)) (ddskk (16 2 50))) "Show Henkan tooltip for ddskk via posframe" single ((:commit . "299493dd951e5a0b43b8213321e3dc0bac10f762") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "tooltip" "convenience" "posframe") (:url . "https://github.com/conao3/ddskk-posframe.el"))])
+ (deadgrep . [(20220507 1755) ((emacs (25 1)) (dash (2 12 0)) (s (1 11 0)) (spinner (1 7 3))) "fast, friendly searching with ripgrep" single ((:commit . "ae333e4069e296e98bf9631088c8198f50891d55") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:keywords "tools") (:url . "https://github.com/Wilfred/deadgrep"))])
+ (debian-el . [(20211006 1939) nil "Emacs helpers specific to Debian users" tar ((:commit . "a3ef20c269b9192710567571b20718f572942bc4"))])
+ (debpaste . [(20160113 2347) ((xml-rpc (1 6 7))) "Interface for getting/posting/deleting pastes from paste.debian.net" single ((:commit . "6f2a400665062468ebd03a2ce1de2a73d9084958") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "paste") (:url . "http://github.com/alezost/debpaste.el"))])
+ (debug-print . [(20140126 19) ((emacs (24))) "A nice printf debugging environment by the way Gauche do" single ((:commit . "d817fd9ea2d3f8d2c1ace4d8af155684f3a99dc5") (:authors ("Ken Okada" . "keno.ss57@gmail.com")) (:maintainer "Ken Okada" . "keno.ss57@gmail.com") (:keywords "extensions" "lisp" "tools" "maint") (:url . "https://github.com/kenoss/debug-print"))])
+ (decide . [(20220319 1927) nil "rolling dice and other random things" single ((:commit . "b4feee9d5ad32c7b73ab3e1da5cfcdab532754c2") (:authors ("Pelle Nilsson" . "perni@lysator.liu.se")) (:maintainer "Pelle Nilsson" . "perni@lysator.liu.se"))])
+ (decl . [(20220102 1310) ((dash (2 5 0)) (emacs (24 3)) (cl-lib (0 3))) "Library for organizing code declaratively" single ((:commit . "9e6e2395e1f739e390697c35a9af99452642869e") (:authors ("Preetpal S. Sohal")) (:maintainer "Preetpal S. Sohal") (:url . "https://github.com/preetpalS/decl.el"))])
+ (declutter . [(20220310 2101) ((emacs (25 1))) "Read html content and (some) paywall sites without clutter" single ((:commit . "8ac50a64dc3a12440d98bc1556b5c7727fdf51ed") (:authors ("Sanel Zukan" . "sanelz@gmail.com")) (:maintainer "Sanel Zukan" . "sanelz@gmail.com") (:keywords "html" "hypermedia" "terminals") (:url . "http://www.github.com/sanel/declutter"))])
+ (dedicated . [(20151202 110) nil "A very simple minor mode for dedicated buffers" single ((:commit . "f47b504c0c56fa5ab9d1028417ca1f65a713a2f0") (:authors ("Eric Crampton" . "eric@atdesk.com")) (:maintainer "Eric Crampton" . "eric@atdesk.com") (:keywords "dedicated" "buffer"))])
+ (dedukti-mode . [(20171103 1212) nil "Major mode for Dedukti files" single ((:commit . "d7c3505a1046187de3c3aeb144455078d514594e") (:authors ("Raphaël Cauderlier")) (:maintainer "Raphaël Cauderlier") (:keywords "languages" "dedukti") (:url . "https://github.com/rafoo/dedukti-mode"))])
+ (default-font-presets . [(20220507 1118) ((emacs (26 1))) "Support selecting fonts from a list of presets" single ((:commit . "7117ddadafcf0264c19b7a6bb912d52efe5553f9") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://codeberg.com/ideasman42/emacs-default-font-presets"))])
+ (default-text-scale . [(20191226 2234) ((emacs (24))) "Easily adjust the font size in all frames" single ((:commit . "bfc0987c37e93742255d3b23d86c17096fda8e7e") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "frames" "faces") (:url . "https://github.com/purcell/default-text-scale"))])
+ (deferred . [(20170901 1330) ((emacs (24 4))) "Simple asynchronous functions for emacs lisp" single ((:commit . "2239671d94b38d92e9b28d4e12fd79814cfb9c16") (:authors ("SAKURAI Masashi <m.sakurai at kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai at kiwanami.net>") (:keywords "deferred" "async") (:url . "https://github.com/kiwanami/emacs-deferred"))])
+ (define-it . [(20220414 932) ((emacs (25 1)) (s (1 12 0)) (request (0 3 0)) (popup (0 5 3)) (pos-tip (0 4 6)) (posframe (1 1 7)) (google-translate (0 11 18)) (wiki-summary (0 1))) "Define, translate, wiki the word" single ((:commit . "51fd884c52faf61339aef3a3429fe91672b3e6a8") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/define-it"))])
+ (define-word . [(20220104 1848) ((emacs (24 3))) "display the definition of word at point." single ((:commit . "31a8c67405afa99d0e25e7c86a4ee7ef84a808fe") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "dictionary" "convenience") (:url . "https://github.com/abo-abo/define-word"))])
+ (defproject . [(20151201 2219) ((emacs (24))) "Manager dir-locals and project specific variables" single ((:commit . "674d48a5e34cb4bba76faa38ee901322ec649086") (:authors (nil . "<kotfic@gmail.com>")) (:maintainer nil . "<kotfic@gmail.com>") (:keywords "convenience") (:url . "https://github.com/kotfic/defproject"))])
+ (defrepeater . [(20180830 410) ((emacs (25 2)) (s (1 12 0))) "Easily make commands repeatable" single ((:commit . "9c027a2561fe141dcfb79f75fcaee36cd0386ec1") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "convenience") (:url . "http://github.com/alphapapa/defrepeater.el"))])
+ (deft . [(20210707 1633) nil "quickly browse, filter, and edit plain text notes" single ((:commit . "28be94d89bff2e1c7edef7244d7c5ba0636b1296") (:authors ("Jason R. Blevins" . "jrblevin@xbeta.org")) (:maintainer "Jason R. Blevins" . "jrblevin@xbeta.org") (:keywords "plain text" "notes" "simplenote" "notational velocity") (:url . "https://jblevins.org/projects/deft/"))])
+ (delim-kill . [(20100517 620) nil "Kill text between delimiters." single ((:commit . "1dbe47344f2d2cbc8c54beedf0cf0bf10fd203c1") (:authors ("Thomas Kappler" . "tkappler@gmail.com")) (:maintainer "Thomas Kappler" . "tkappler@gmail.com") (:keywords "convenience" "languages") (:url . "http://github.com/thomas11/delim-kill/tree/master"))])
+ (demangle-mode . [(20210822 2210) ((cl-lib (0 1)) (emacs (24 3))) "Automatically demangle C++, D, and Rust symbols" single ((:commit . "04f545adab066708d6151f13da65aaf519f8ac4e") (:authors ("Ben Liblit" . "liblit@acm.org")) (:maintainer "Ben Liblit" . "liblit@acm.org") (:keywords "c" "tools") (:url . "https://github.com/liblit/demangle-mode"))])
+ (demap . [(20220322 2309) ((emacs (25 1))) "Detachable minimap package" tar ((:commit . "c42ec4752544f80ca7c172ff65e705a56089bc96") (:authors ("Sawyer Gardner <https://gitlab.com/sawyerjgardner>")) (:maintainer "Sawyer Gardner <https://gitlab.com/sawyerjgardner>") (:keywords "lisp" "tools" "convenience") (:url . "https://gitlab.com/sawyerjgardner/demap.el"))])
+ (demo-it . [(20211221 2152) nil "Create demonstrations" tar ((:commit . "e399fd7ceb73caeae7cb50b247359bafcaee2a3f") (:authors ("Howard Abrams" . "howard.abrams@gmail.com")) (:maintainer "Howard Abrams" . "howard.abrams@gmail.com") (:keywords "demonstration" "presentation" "test"))])
+ (deno-fmt . [(20200520 1838) ((emacs (24))) "Minor mode for using deno fmt on save" single ((:commit . "3b193eef576e2c14fdcf350495955e6e8546dddd") (:authors ("Russell Clarey <http://github/rclarey>")) (:maintainer "Russell Clarey <http://github/rclarey>") (:url . "https://github.com/russell/deno-emacs"))])
+ (describe-hash . [(20200718 1556) nil "Help function for examining a hash map" single ((:commit . "18e69a932d5495c8439571ba8f2d2ee123d434b1") (:url . "https://github.com/Junker/describe-hash"))])
+ (describe-number . [(20151101 55) ((yabin (1 1))) "Describe arbitrarily large number at point." single ((:commit . "40618345a37831804b29589849a785ef5aa5ac24") (:authors ("Morten Slot Kristensen <msk AT nullpointer DOT dk>")) (:maintainer "Morten Slot Kristensen <msk AT nullpointer DOT dk>") (:keywords "describe" "value" "help") (:url . "https://github.com/netromdk/describe-number"))])
+ (desktop+ . [(20170107 2132) ((emacs (24 4)) (dash (2 11 0)) (f (0 17 2))) "Handle special buffers when saving & restoring sessions" single ((:commit . "88055cee526a000056201898499cebbd35e3ea76") (:authors ("François Févotte" . "fevotte@gmail.com")) (:maintainer "François Févotte" . "fevotte@gmail.com") (:url . "https://github.com/ffevotte/desktop-plus"))])
+ (desktop-environment . [(20220425 1834) ((emacs (25 1))) "Helps you control your GNU/Linux computer" single ((:commit . "2863dc3d66aed9052c8af39cc8c8c264be300560") (:authors ("Damien Cassou <damien@cassou.me>, Nicolas Petton" . "nicolas@petton.fr")) (:maintainer "Damien Cassou <damien@cassou.me>, Nicolas Petton" . "nicolas@petton.fr") (:url . "https://gitlab.petton.fr/DamienCassou/desktop-environment"))])
+ (desktop-mail-user-agent . [(20210519 1008) ((emacs (24 3))) "Call OS default mail program to compose mail" single ((:commit . "caac672ef7e4ddced960fa31cef3a6ba5d7ab451") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "mail") (:url . "https://github.com/lassik/emacs-desktop-mail-user-agent"))])
+ (desktop-registry . [(20140119 2143) nil "Keep a central registry of desktop files" single ((:commit . "244c2e7f9f0a1050aa8a47ad0b38f4e4584682dd") (:authors ("Tom Willemse" . "tom@ryuslash.org")) (:maintainer "Tom Willemse" . "tom@ryuslash.org") (:keywords "convenience") (:url . "http://projects.ryuslash.org/desktop-registry/"))])
+ (detour . [(20181122 2138) ((emacs (24 4))) "Take a quick detour and return" single ((:commit . "1ff23c236e18971ed1077840daf047cde79a45ee") (:authors ("Stefan Kamphausen <www.skamphausen.de>")) (:maintainer "Stefan Kamphausen <www.skamphausen.de>") (:keywords "convenience" "abbrev") (:url . "https://github.com/ska2342/detour/"))])
+ (devdocs . [(20220410 1627) ((emacs (27 1))) "Emacs viewer for DevDocs" single ((:commit . "4257e59dafbffb2616d240f84c5c25770ee28cac") (:authors ("Augusto Stoffel" . "arstoffel@gmail.com")) (:maintainer "Augusto Stoffel" . "arstoffel@gmail.com") (:keywords "help") (:url . "https://github.com/astoff/devdocs.el"))])
+ (devdocs-browser . [(20211218 949) ((emacs (27 1))) "Browse devdocs.io documents using EWW" single ((:commit . "a46a2cdb83ed27869befe56fea04914a33252b3a") (:authors ("blahgeek" . "i@blahgeek.com")) (:maintainer "blahgeek" . "i@blahgeek.com") (:keywords "docs" "help" "tools") (:url . "https://github.com/blahgeek/emacs-devdocs-browser"))])
+ (dfmt . [(20170728 1023) nil "Emacs Interface to D indenting/formatting tool dfmt." single ((:commit . "21b9094e907b7ac53f5ecb4ff4539613a9d12434") (:authors ("Per Nordlöw")) (:maintainer "Kirill Babikhin <qsimpleq>") (:keywords "tools" "convenience" "languages" "dlang") (:url . "https://github.com/qsimpleq/elisp-dfmt"))])
+ (dhall-mode . [(20200822 258) ((emacs (24 4)) (reformatter (0 3))) "Major mode for the dhall configuration language" single ((:commit . "ad259c8a2292fb398dff1ce7d25c686edb02945d") (:authors ("Sibi Prabakaran" . "sibi@psibi.in")) (:maintainer "Sibi Prabakaran" . "sibi@psibi.in") (:keywords "languages") (:url . "https://github.com/psibi/dhall-mode"))])
+ (dianyou . [(20210525 1517) ((emacs (24 4))) "Search and analyze mails in Gnus" single ((:commit . "f77d9e76be5d8022fa6ee5426144f13f38dd09f2") (:authors ("Chen Bin <chenbin DOT sh AT gmail DOT com>")) (:maintainer "Chen Bin <chenbin DOT sh AT gmail DOT com>") (:keywords "mail") (:url . "http://github.com/redguardtoo/dianyou"))])
+ (diary-manager . [(20220508 128) ((emacs (25))) "Simple personal diary" single ((:commit . "c538504e606208fa902d040e54188072df6193d0") (:authors ("Radian LLC" . "contact+diary-manager@radian.codes")) (:maintainer "Radian LLC" . "contact+diary-manager@radian.codes") (:keywords "extensions") (:url . "https://github.com/radian-software/diary-manager"))])
+ (dic-lookup-w3m . [(20180526 1621) ((w3m (20120723 324)) (stem (20120826))) "look up dictionaries on the Internet" tar ((:commit . "3254ab10cbf0078c7162557dd1f68dac28459cf9") (:authors ("mcprvmec")) (:maintainer "mcprvmec") (:keywords "emacs-w3m" "w3m" "dictionary"))])
+ (dictcc . [(20220219 1302) ((emacs (24 4)) (cl-lib (0 5)) (ivy (0 10 0))) "Look up translations on dict.cc" single ((:commit . "8ecb954fcf193cba138191f8947c8b0b60a1c6c5") (:authors ("Marten Lienen" . "marten.lienen@gmail.com")) (:maintainer "Marten Lienen" . "marten.lienen@gmail.com") (:keywords "convenience"))])
+ (dictionary . [(20201001 1727) ((connection (1 11)) (link (1 11))) "Client for rfc2229 dictionary servers" single ((:commit . "bdf0aa7761d1c1a3bc0652b2fdc4a54b3acdb06a") (:authors ("Torsten Hilbrich" . "torsten.hilbrich@gmx.net")) (:maintainer "Torsten Hilbrich" . "torsten.hilbrich@gmx.net") (:keywords "interface" "dictionary"))])
+ (didyoumean . [(20200905 1843) ((emacs (24 4))) "Did you mean to open another file?" single ((:commit . "ce5edcce160b86e7f6480f0381be785d43f97e19") (:keywords "convenience") (:url . "https://gitlab.com/kisaragi-hiu/didyoumean.el"))])
+ (diff-ansi . [(20220507 1118) ((emacs (27 1))) "Display diff's using alternative diffing tools" single ((:commit . "bfcce7f609a95b4b5e11c384c75fef8c7c972b95") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://codeberg.com/ideasman42/emacs-diff-ansi"))])
+ (diff-at-point . [(20220507 1118) ((emacs (26 2))) "Diff navigation" single ((:commit . "aabb96b2b59f0e0d94d7b6889fa30016927ea03d") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://codeberg.com/ideasman42/emacs-diff-at-point"))])
+ (diff-hl . [(20220506 2102) ((cl-lib (0 2)) (emacs (25 1))) "Highlight uncommitted changes using VC" tar ((:commit . "14f2db367e8023ab0027713315a38ecd703afdbf") (:authors ("Dmitry Gutov" . "dgutov@yandex.ru")) (:maintainer "Dmitry Gutov" . "dgutov@yandex.ru") (:keywords "vc" "diff") (:url . "https://github.com/dgutov/diff-hl"))])
+ (difflib . [(20210224 2242) ((emacs (24 4)) (cl-generic (0 3)) (ht (2 2)) (s (1 12 0))) "Helpers for computing deltas between sequences." single ((:commit . "646fc4388274fe765bbf4661e17a24e4d081250c") (:authors ("Diego A. Mundo" . "dieggsy@pm.me")) (:maintainer "Diego A. Mundo" . "dieggsy@pm.me") (:keywords "matching" "tools" "string") (:url . "http://github.com/dieggsy/difflib.el"))])
+ (diffpdf . [(20210626 1447) ((emacs (25 1)) (transient (0 3 0))) "Transient diffpdf" single ((:commit . "a5b203b549e373cb9b0ef3f00c0010bd34dd644a") (:authors ("Shuguang Sun" . "shuguang79@qq.com")) (:maintainer "Shuguang Sun" . "shuguang79@qq.com") (:keywords "tools") (:url . "https://github.com/ShuguangSun/diffpdf.el"))])
+ (diffscuss-mode . [(20141014 2357) nil "Major mode for diffscuss files." single ((:commit . "53f2d001bd3a5cb80c6ada16b4e570afd1989a09") (:authors ("Edmund Jorgensen" . "edmund@hut8labs.com")) (:maintainer "Edmund Jorgensen" . "edmund@hut8labs.com") (:keywords "tools"))])
+ (diffsync . [(20220502 1513) ((emacs (25 1))) "Use diff to allow syncing of directories" single ((:commit . "3f8540ef0a677ea8c2b57aaf4a07937512bb148c") (:authors ("Bernhard Rotter" . "bernhard@b-rotter.de")) (:maintainer "Bernhard Rotter" . "bernhard@b-rotter.de") (:keywords "tools") (:url . "https://github.com/ber-ro/diffsync"))])
+ (diffview . [(20220322 2334) nil "View diffs in side-by-side format" single ((:commit . "af2251a01f532efa819d236802cb3d942befe5a1") (:authors ("Mitchel Humpherys" . "mitch.special@gmail.com")) (:maintainer "Mitchel Humpherys" . "mitch.special@gmail.com") (:keywords "convenience" "diff") (:url . "https://github.com/mgalgs/diffview-mode"))])
+ (digistar-mode . [(20210129 1719) nil "major mode for Digistar scripts" single ((:commit . "e12b128023b7696a23545f812877e8c6531d261c") (:authors ("John Foerch" . "jjfoerch@gmail.com")) (:maintainer "John Foerch" . "jjfoerch@gmail.com") (:keywords "languages"))])
+ (digit-groups . [(20200506 37) ((dash (2 11 0))) "Highlight place-value positions in numbers" single ((:commit . "7b81930cad19b8b7913b7eedbcb498964bfdcbdb") (:authors ("Michael D. Adams <http://michaeldadams.org>")) (:maintainer "Michael D. Adams <http://michaeldadams.org>") (:url . "https://github.com/adamsmd/digit-groups/"))])
+ (digitalocean . [(20190607 726) ((request (2 5)) (emacs (24 4))) "Create and manipulate digitalocean droplets" single ((:commit . "6c32d3593286e2a62d9afab0057c829407b0d1e8") (:authors ("Oliver Marks" . "oly@digitaloctave.com")) (:maintainer "Oliver Marks" . "oly@digitaloctave.com") (:keywords "processes" "tools") (:url . "https://github.com/olymk2/emacs-digitalocean"))])
+ (digitalocean-helm . [(20180610 746) ((emacs (24 3)) (helm (2 5)) (digitalocean (0 1))) "Create and manipulate digitalocean droplets" single ((:commit . "b125c9882eded7d73ec109d152b26625f333440b") (:authors ("Oliver Marks" . "oly@digitaloctave.com")) (:maintainer "Oliver Marks" . "oly@digitaloctave.com") (:keywords "processes" "tools") (:url . "https://gitlab.com/olymk2/digitalocean-api"))])
+ (dilbert . [(20211118 1512) ((emacs (26 1)) (enlive (0 0 1)) (dash (2 19 1))) "View Dilbert comics" single ((:commit . "3e9a39717490be4d5c14211a47fcd8588ef668af") (:authors ("Daniils Petrovs" . "thedanpetrov@gmail.com")) (:maintainer "Daniils Petrovs" . "thedanpetrov@gmail.com") (:keywords "multimedia" "news") (:url . "https://github.com/DaniruKun/dilbert-el"))])
+ (dim . [(20160818 949) ((emacs (24 4))) "Change mode-line names of major/minor modes" single ((:commit . "5515f2e8657ef14adcc34aa5b05383a2684328ae") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "convenience") (:url . "https://github.com/alezost/dim.el"))])
+ (dim-autoload . [(20220422 1601) ((emacs (25 1)) (compat (28 1 1 0))) "Dim or hide autoload cookie lines" single ((:commit . "81c94b0707d5ddd9a3b9962ee441206db1d25967") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "convenience") (:url . "https://github.com/tarsius/dim-autoload"))])
+ (dime . [(20210329 604) ((emacs (25 1)) (dylan (3 0))) "Dylan interaction mode" tar ((:commit . "9d2891e3e06405b75072d296f385fa795aeb9835") (:url . "https://opendylan.org/"))])
+ (diminish . [(20220104 1539) ((emacs (24 3))) "Diminished modes are minor modes with no modeline display" single ((:commit . "6b7e837b0cf0129e9d7d6abae48093cf599bb9e8") (:authors ("Will Mengarini" . "seldon@eskimo.com")) (:maintainer "Martin Yrjölä" . "martin.yrjola@gmail.com") (:keywords "extensions" "diminish" "minor" "codeprose") (:url . "https://github.com/myrjola/diminish.el"))])
+ (diminish-buffer . [(20220218 1541) ((emacs (24 4))) "Diminish (hide) buffers from buffer-menu" single ((:commit . "3b3b24eb231af889b0eea50e6e0a20c2bca9c439") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/diminish-buffer"))])
+ (dimmer . [(20211123 1536) ((emacs (25 1))) "Visually highlight the selected buffer" single ((:commit . "2f915b100044e09dd647b22085e1696249c4b115") (:authors ("Neil Okamoto")) (:maintainer "Neil Okamoto") (:keywords "faces" "editing") (:url . "https://github.com/gonewest818/dimmer.el"))])
+ (dionysos . [(20160810 1056) ((libmpdee (2 1 0)) (alert (1 2)) (s (1 11 0)) (dash (2 12 1)) (pkg-info (0 5 0)) (cl-lib (0 5))) "Dionysos, a music player for Emacs" tar ((:commit . "0aac21caadabc5a7f09e18a9dcb02f3dec26588b") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "music") (:url . "https://github.com/nlamirault/dionysos"))])
+ (dir-treeview . [(20220505 27) ((emacs (24 4)) (treeview (1 1 0))) "A directory tree browser and simple file manager" tar ((:commit . "fa0b795b36740755ec37f5b41c3a734ad702e5a1") (:authors ("Tilman Rassy" . "tilman.rassy@googlemail.com")) (:maintainer "Tilman Rassy" . "tilman.rassy@googlemail.com") (:keywords "tools" "convenience" "files") (:url . "https://github.com/tilmanrassy/emacs-dir-treeview"))])
+ (dircmp . [(20141204 1756) nil "Compare and sync directories." tar ((:commit . "558ee0b601c2de9d247612085aafe2926f56a09f") (:authors ("Matt McClure -- http://matthewlmcclure.com")) (:maintainer "Matt McClure -- http://matthewlmcclure.com") (:keywords "unix" "tools") (:url . "https://github.com/matthewlmcclure/dircmp-mode"))])
+ (dired-atool . [(20210719 404) ((emacs (24))) "Pack/unpack files with atool on dired." single ((:commit . "01416fd5961b901c50686c91cb59b3833adc831b") (:authors ("Hiroki YAMAKAWA" . "s06139@gmail.com")) (:maintainer "Hiroki YAMAKAWA" . "s06139@gmail.com") (:keywords "files") (:url . "https://github.com/HKey/dired-atool"))])
+ (dired-avfs . [(20161012 1104) ((dash (2 5 0)) (dired-hacks-utils (0 0 1))) "AVFS support for dired" single ((:commit . "7c0ef09d57a80068a11edc74c3568e5ead5cc15a") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "files"))])
+ (dired-collapse . [(20210403 1230) ((dash (2 10 0)) (f (0 19 0)) (dired-hacks-utils (0 0 1))) "Collapse unique nested paths in dired listing" single ((:commit . "7c0ef09d57a80068a11edc74c3568e5ead5cc15a") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "files"))])
+ (dired-dups . [(20130527 2125) nil "Find duplicate files and display them in a dired buffer" single ((:commit . "694ad128c822c59348ced16c4a0c1356d43da47a") (:authors ("Joe Bloggs" . "vapniks@yahoo.com")) (:maintainer "Joe Bloggs" . "vapniks@yahoo.com") (:keywords "unix") (:url . "https://github.com/vapniks/dired-dups"))])
+ (dired-efap . [(20220421 1535) nil "Edit Filename At Point in a dired buffer" single ((:commit . "360b369cb19998c6730ee1debfbec3edb7f349a9") (:authors ("Juan-Leon Lahoz" . "juanleon1@gmail.com")) (:maintainer "Juan-Leon Lahoz" . "juanleon1@gmail.com") (:keywords "dired" "environment" "files" "renaming") (:url . "https://github.com/juan-leon/dired-efap"))])
+ (dired-explorer . [(20180607 221) ((cl-lib (0 5))) "minor-mode provides Explorer like select file at dired." single ((:commit . "3ade0a31b5340271d05e9bf443f2504960f6c6dd") (:maintainer "jidaikobo-shibata") (:keywords "dired" "explorer"))])
+ (dired-fdclone . [(20220119 717) nil "dired functions and settings to mimic FDclone" single ((:commit . "66e337012e72cebd2485f1efca0b2f78dc9c6252") (:authors ("Akinori MUSHA" . "knu@iDaemons.org")) (:maintainer "Akinori MUSHA" . "knu@iDaemons.org") (:keywords "unix" "directories" "dired") (:url . "https://github.com/knu/dired-fdclone.el"))])
+ (dired-filetype-face . [(20180907 1339) nil "Set different faces for different filetypes in dired" single ((:commit . "7ade7f7e8c2d7518c65f3f0343a10c272da0f47e") (:authors ("纪秀峰 <jixiuf at gmail dot com>")) (:maintainer "纪秀峰 <jixiuf at gmail dot com>") (:keywords "dired" "filetype" "face") (:url . "https://github.com/jixiuf/dired-filetype-face"))])
+ (dired-filter . [(20191105 1404) ((dash (2 10 0)) (dired-hacks-utils (0 0 1)) (f (0 17 0)) (cl-lib (0 3))) "Ibuffer-like filtering for dired" single ((:commit . "7c0ef09d57a80068a11edc74c3568e5ead5cc15a") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "files"))])
+ (dired-git . [(20200527 732) ((emacs (26 1)) (async-await (1 0)) (async (1 9 4)) (all-the-icons (2 2 0)) (ppp (1 0 0))) "Git integration for dired" single ((:commit . "82c93bdb2fe392b122f79d2e425c632f1c69ede3") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "tools") (:url . "https://github.com/conao3/dired-git.el"))])
+ (dired-hacks-utils . [(20201005 2318) ((dash (2 5 0))) "Utilities and helpers for dired-hacks collection" single ((:commit . "7c0ef09d57a80068a11edc74c3568e5ead5cc15a") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "files"))])
+ (dired-hide-dotfiles . [(20210222 1919) ((emacs (25 1))) "Hide dotfiles in dired" single ((:commit . "6a379f23f64045f5950d229254ce6f32dbbf5364") (:authors ("Mattias Bengtsson" . "mattias.jc.bengtsson@gmail.com")) (:maintainer "Mattias Bengtsson" . "mattias.jc.bengtsson@gmail.com") (:keywords "files") (:url . "https://github.com/mattiasb/dired-hide-dotfiles"))])
+ (dired-icon . [(20170223 526) ((emacs (24 3))) "A minor mode to display a list of associated icons in dired buffers." tar ((:commit . "f60e10757a5011235b519231ad35974ff25963ed") (:authors ("Hong Xu" . "hong@topbug.net")) (:maintainer "Hong Xu" . "hong@topbug.net") (:keywords "dired" "files") (:url . "https://gitlab.com/xuhdev/dired-icon"))])
+ (dired-imenu . [(20140109 1610) nil "imenu binding for dired mode" single ((:commit . "610e21fe0988c85931d34894d3eee2442c79ab0a") (:authors ("Damien Cassou" . "damien.cassou@gmail.com")) (:maintainer "Damien Cassou" . "damien.cassou@gmail.com") (:keywords "dired" "imenu") (:url . "https://github.com/DamienCassou/dired-imenu"))])
+ (dired-k . [(20211002 2358) ((emacs (24 3))) "Highlight dired by size, date, git status" tar ((:commit . "1ddd8e0ea06f0e25cd5dedb2370cfa0cacfa8c9d") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Neil Okamoto" . "neil.okamoto+melpa@gmail.com") (:url . "https://github.com/emacsorphanage/dired-k"))])
+ (dired-launch . [(20220317 1839) nil "Use dired as a launcher" single ((:commit . "72ebbe2b3d2e04dbfda636fa114d4f47835ce044") (:authors ("David Thompson")) (:maintainer "David Thompson") (:keywords "dired" "launch") (:url . "https://github.com/thomp/dired-launch"))])
+ (dired-lsi . [(20200812 929) ((emacs (26 1))) "Add memo to directory and show it in dired" single ((:commit . "0f4038c8b47f6cfc70f82062800700c14c9912c2") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience") (:url . "https://github.com/conao3/dired-lsi.el"))])
+ (dired-narrow . [(20181114 1723) ((dash (2 7 0)) (dired-hacks-utils (0 0 1))) "Live-narrowing of search results for dired" single ((:commit . "7c0ef09d57a80068a11edc74c3568e5ead5cc15a") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "files"))])
+ (dired-open . [(20180922 1113) ((dash (2 5 0)) (dired-hacks-utils (0 0 1))) "Open files from dired using using custom actions" single ((:commit . "7c0ef09d57a80068a11edc74c3568e5ead5cc15a") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "files"))])
+ (dired-posframe . [(20200817 420) ((emacs (26 1)) (posframe (0 7))) "Peep dired items using posframe" single ((:commit . "1a21eb9ad956a0371dd3c9e1bec53407d685f705") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience") (:url . "https://github.com/conao3/dired-posframe.el"))])
+ (dired-quick-sort . [(20201221 403) ((hydra (0 13 0)) (emacs (24))) "Persistent quick sorting of dired buffers in various ways." single ((:commit . "69b06f306a5fc2b38e707bae3ff1e35db2b39b6b") (:authors ("Hong Xu" . "hong@topbug.net")) (:maintainer "Hong Xu" . "hong@topbug.net") (:keywords "convenience" "files") (:url . "https://gitlab.com/xuhdev/dired-quick-sort#dired-quick-sort"))])
+ (dired-rainbow . [(20190722 1109) ((dash (2 5 0)) (dired-hacks-utils (0 0 1))) "Extended file highlighting according to its type" single ((:commit . "7c0ef09d57a80068a11edc74c3568e5ead5cc15a") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "files"))])
+ (dired-ranger . [(20180401 2206) ((dash (2 7 0)) (dired-hacks-utils (0 0 1))) "Implementation of useful ranger features for dired" single ((:commit . "7c0ef09d57a80068a11edc74c3568e5ead5cc15a") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "files"))])
+ (dired-recent . [(20211004 1924) ((emacs (24))) "Dired visited paths history" single ((:commit . "a376f53e42fdca80c3286e8111578c65c64b0711") (:authors ("Wojciech Siewierski <wojciech dot siewierski at onet dot pl>")) (:maintainer "Wojciech Siewierski <wojciech dot siewierski at onet dot pl>") (:keywords "files") (:url . "https://github.com/vifon/dired-recent.el"))])
+ (dired-rifle . [(20210316 1452) nil "Call rifle(1) from dired" single ((:commit . "cc1af692bbac651f5e5111d9ab1c0805989d65e5") (:authors ("Wojciech Siewierski <wojciech dot siewierski at onet dot pl>")) (:maintainer "Wojciech Siewierski <wojciech dot siewierski at onet dot pl>") (:keywords "files" "convenience") (:url . "https://github.com/vifon/dired-rifle.el"))])
+ (dired-rmjunk . [(20191007 1232) nil "A home directory cleanup utility for Dired." single ((:commit . "92af5fcc2bd0bc3826f4ce238a850e9a362533a4") (:authors ("Jakob L. Kreuze" . "zerodaysfordays@sdf.lonestar.org")) (:maintainer "Jakob L. Kreuze" . "zerodaysfordays@sdf.lonestar.org") (:keywords "files" "matching") (:url . "https://git.sr.ht/~jakob/dired-rmjunk"))])
+ (dired-rsync . [(20220313 1533) ((s (1 12 0)) (dash (2 0 0)) (emacs (24))) "Allow rsync from dired buffers" tar ((:commit . "b327971d197e95e9b78e7ef92539bd4196a12797") (:authors ("Alex Bennée" . "alex@bennee.com")) (:maintainer "Alex Bennée" . "alex@bennee.com") (:url . "https://github.com/stsquad/dired-rsync"))])
+ (dired-sidebar . [(20220413 753) ((emacs (25 1)) (dired-subtree (0 0 1))) "Tree browser leveraging dired" single ((:commit . "0521cdc53e4a7ae7ea4728e5ac9f69287528dc56") (:authors ("James Nguyen" . "james@jojojames.com")) (:maintainer "James Nguyen" . "james@jojojames.com") (:keywords "dired" "files" "tools") (:url . "https://github.com/jojojames/dired-sidebar"))])
+ (dired-single . [(20211101 2319) nil "Reuse the current dired buffer to visit a directory" single ((:commit . "b254f9b7bfc96a5eab5760a56811f2872d2c590a") (:keywords "dired" "reuse" "buffer") (:url . "https://github.com/crocket/dired-single"))])
+ (dired-subtree . [(20210105 1127) ((dash (2 5 0)) (dired-hacks-utils (0 0 1))) "Insert subdirectories in a tree-like fashion" single ((:commit . "7c0ef09d57a80068a11edc74c3568e5ead5cc15a") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "files"))])
+ (dired-toggle . [(20190616 303) nil "Show dired as sidebar and will not create new buffers when changing dir" single ((:commit . "7fe5fe35c63d1b0da14d6d6d52bdf6b2a5410ba7") (:authors ("Xu FaSheng <fasheng[AT]fasheng.info>")) (:maintainer "Xu FaSheng") (:keywords "dired" "sidebar") (:url . "https://github.com/fasheng/dired-toggle"))])
+ (dired-toggle-sudo . [(20211216 102) nil "Browse directory with sudo privileges." single ((:commit . "9f86cdf858225b15c20affb97ed105e4109047bf") (:authors ("Sebastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>")) (:maintainer "Sebastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>") (:keywords "emacs" "dired"))])
+ (dired-view-data . [(20220129 339) ((emacs (26 1)) (ess (18 10 1)) (ess-view-data (1 0))) "View data from dired via ESS and R" single ((:commit . "96d4cb6569fd2be90a516dedd98263374bbc6ead") (:authors ("Shuguang Sun" . "shuguang79@qq.com")) (:maintainer "Shuguang Sun" . "shuguang79@qq.com") (:keywords "tools") (:url . "https://github.com/ShuguangSun/dired-view-data"))])
+ (diredc . [(20220113 332) ((emacs (26 1)) (key-assist (1 0))) "Extensions for dired" single ((:commit . "7ee68f6b1c87f8ab86cf23416472747e88860717") (:keywords "files") (:url . "https://github.com/Boruch-Baum/emacs-diredc"))])
+ (diredfl . [(20220508 805) ((emacs (24))) "Extra font lock rules for a more colourful dired" single ((:commit . "62b559e1d6b69834a56a57eb1832ac6ad4d2e5d0") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "faces") (:url . "https://github.com/purcell/diredfl"))])
+ (diredful . [(20160529 2017) nil "colorful file names in dired buffers" single ((:commit . "ad328a15c5deffc1021af9b3f19a745dcd8f4415") (:authors ("Thamer Mahmoud" . "thamer.mahmoud@gmail.com")) (:maintainer "Thamer Mahmoud" . "thamer.mahmoud@gmail.com") (:keywords "dired" "colors" "extension" "widget") (:url . "https://github.com/thamer/diredful"))])
+ (direnv . [(20220103 1342) ((emacs (25 1)) (dash (2 12 0))) "direnv integration" single ((:commit . "d71ceb415732c3b76a2948147fa3559622aceba2") (:authors ("wouter bolsterlee" . "wouter@bolsterl.ee")) (:maintainer "wouter bolsterlee" . "wouter@bolsterl.ee") (:keywords "direnv" "environment" "processes" "unix" "tools") (:url . "https://github.com/wbolster/emacs-direnv"))])
+ (direx . [(20170422 1327) nil "Simple Directory Explorer" tar ((:commit . "a79bfdb5980cf6ed7bfb3b41ddc471a7b6c0ede4") (:authors ("Tomohiro Matsuyama" . "m2ym.pub@gmail.com")) (:maintainer "Tomohiro Matsuyama" . "m2ym.pub@gmail.com") (:keywords "convenience"))])
+ (direx-grep . [(20140515 1506) ((direx (0 1 -3))) "Grep node of direx.el using incremental search like anything.el/helm.el" single ((:commit . "1109a512a80b2673a70b18b8568514049017faad") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "convenience") (:url . "https://github.com/aki2o/direx-grep"))])
+ (dirtree . [(20140129 832) ((tree-mode (1 1 1 1)) (windata (0))) "Directory tree views" single ((:commit . "ba55f1e716e386fdd37cb8e7f48616e405dc7251") (:authors ("Ye Wenbin" . "wenbinye@gmail.com")) (:maintainer "Ye Wenbin" . "wenbinye@gmail.com"))])
+ (dirtree-prosjekt . [(20140129 904) ((prosjekt (0 3)) (dirtree (0 1))) "dirtree integration for prosjekt." single ((:commit . "a864a8be5842223043702395f311e3350c28e9db") (:authors ("Austin Bingham" . "austin.bingham@gmail.com")) (:maintainer "Austin Bingham" . "austin.bingham@gmail.com") (:url . "https://github.com/abingham/prosjekt"))])
+ (dirvish . [(20220508 1705) ((emacs (27 1))) "A modern file manager based on dired mode" tar ((:commit . "75d5abb62670dac0dce3e43e8dbe2e42b7abe6ab") (:authors ("Alex Lu <https://github.com/alexluigit>")) (:maintainer "Alex Lu <https://github.com/alexluigit>") (:keywords "files" "convenience") (:url . "https://github.com/alexluigit/dirvish"))])
+ (disable-mouse . [(20210512 2114) ((emacs (24 1))) "Disable mouse commands globally" single ((:commit . "cae3be9dd012727b40ad3b511731191f79cebe42") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "mouse") (:url . "https://github.com/purcell/disable-mouse"))])
+ (disaster . [(20171016 2152) nil "Disassemble C/C++ code under cursor in Emacs" single ((:commit . "10a785facc60d89d78e0d5177985ab1af1741bb4") (:authors ("Justine Tunney" . "jtunney@gmail.com")) (:maintainer "Justine Tunney" . "jtunney@gmail.com") (:keywords "tools") (:url . "https://github.com/jart/disaster"))])
+ (discourse . [(20160911 819) ((cl-lib (0 5)) (request (0 2)) (s (1 11 0))) "discourse api" single ((:commit . "a86c7e608851e186fe12e892a573994f08c8e65e") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "lisp" "discourse") (:url . "https://github.com/lujun9972/discourse-api"))])
+ (discover . [(20140103 2139) ((makey (0 3))) "discover more of Emacs" single ((:commit . "7b0044bbb3b3bd5d811fdfb0f5ac6ec8de1239df") (:authors ("Mickey Petersen" . "mickey@fyeah.org")) (:maintainer "Mickey Petersen" . "mickey@fyeah.org"))])
+ (discover-clj-refactor . [(20150328 1459) ((clj-refactor (0 14 0)) (discover (0 3))) "Adds discover context menu for clj-refactor" single ((:commit . "3fbd5c1162739e606d7cf5d4f5d7426547d99647") (:authors ("Marian Schubert" . "marian.schubert@gmail.com")) (:maintainer "Marian Schubert" . "marian.schubert@gmail.com") (:keywords "clj-refactor" "discover" "convenience"))])
+ (discover-js2-refactor . [(20140129 1552) ((js2-refactor (20131221 501)) (discover (20140103 1339))) "Adds discover context menu for js2-refactor" single ((:commit . "3812abf61f39f3e73a9f3daefa6fed4f21a429ba") (:authors ("Nicolas Petton" . "petton.nicolas@gmail.com")) (:maintainer "Nicolas Petton" . "petton.nicolas@gmail.com") (:keywords "js2-refactor" "discover"))])
+ (discover-my-major . [(20180606 511) ((makey (0 2))) "Discover key bindings and their meaning for the current Emacs major mode" single ((:commit . "c592e5e67454f0d1b68669ac0c270073164b16b3") (:authors ("steckerhalter")) (:maintainer "steckerhalter") (:keywords "discover" "help" "major-mode" "keys") (:url . "https://framagit.org/steckerhalter/discover-my-major"))])
+ (disk . [(20171116 731) nil "simplified find-file, revert-file, save-buffer interface" single ((:commit . "283e54e3be7d08f959076240b2ab324e25632137") (:authors ("Alex Schroeder" . "alex@gnu.org") ("Peter Barabas" . "peter.barabas+disk@gmail.com")) (:maintainer "Alex Schroeder" . "alex@gnu.org") (:keywords "convenience") (:url . "http://www.emacswiki.org/emacs/DiskKey"))])
+ (dispass . [(20140202 1531) ((dash (1 0 0))) "Emacs wrapper for DisPass" single ((:commit . "b6e8f89040ebaaf0e7609b04bc27a8979f0ae861") (:authors ("Tom Willemsen" . "tom@ryuslash.org")) (:maintainer "Tom Willemsen" . "tom@ryuslash.org") (:keywords "processes") (:url . "http://projects.ryuslash.org/dispass.el/"))])
+ (display-theme . [(20140115 1556) ((emacs (24))) "display current theme(s) at mode-line" single ((:commit . "b180b3be7a74ae4799a14e7e4bc2fe10e3ff7a15") (:authors ("KAWABATA, Taichi <kawabata.taichi_at_gmail.com>")) (:maintainer "KAWABATA, Taichi <kawabata.taichi_at_gmail.com>") (:keywords "tools") (:url . "https://github.com/kawabata/emacs-display-theme/"))])
+ (display-wttr . [(20220316 213) ((emacs (27 1))) "Display wttr(weather) in the mode line" single ((:commit . "2cb36df32b0ecf381185126a969b7282af5a0e01") (:authors ("Jose G Perez Taveras" . "josegpt27@gmail.com")) (:maintainer "Jose G Perez Taveras" . "josegpt27@gmail.com") (:url . "https://github.com/josegpt/display-wttr"))])
+ (dispwatch . [(20210305 342) ((emacs (24 4))) "Watch displays for configuration changes" single ((:commit . "03abbac89a9f625aaa1a808dd49ae4906f466421") (:authors ("Mitchell Perilstein" . "mitchell.perilstein@gmail.com")) (:maintainer "Mitchell Perilstein" . "mitchell.perilstein@gmail.com") (:keywords "frames") (:url . "https://github.com/mnp/dispwatch"))])
+ (dist-file-mode . [(20180830 418) ((emacs (24)) (cl-lib (0 5)) (s (1 9 0))) "Dispatch major mode for *.dist files" single ((:commit . "e1ce8f592bc5d4d86d2f09e334728ac0d524c761") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "files" "convenience") (:url . "https://github.com/emacs-php/dist-file-mode.el"))])
+ (distel-completion-lib . [(20180827 1344) nil "Completion library for Erlang/Distel" single ((:commit . "acc4c0a5521904203d797fe96b08e5fae4233c7e") (:authors ("Sebastian Weddmark Olsson")) (:maintainer "Sebastian Weddmark Olsson") (:keywords "erlang" "distel" "completion") (:url . "github.com/sebastiw/distel-completion"))])
+ (distinguished-theme . [(20151216 2015) nil "A dark and elegant theme for emacs." single ((:commit . "9b1d25ac59465a5016d187ea84b7614c95a29b3b") (:authors ("Kim Silkebækken" . "kim.silkebaekken@gmail.com")) (:maintainer "Kim Silkebækken" . "kim.silkebaekken@gmail.com") (:url . "https://github.com/Lokaltog/distinguished-theme"))])
+ (ditz-mode . [(20150729 940) nil "Emacs interface to Ditz issue tracking system" single ((:commit . "74b6b93b097d595a001c019e3b762abfc60f821a") (:authors ("Glenn Hutchings" . "zondo42@gmail.com")) (:maintainer "Glenn Hutchings" . "zondo42@gmail.com") (:keywords "tools"))])
+ (dix . [(20220323 1046) ((cl-lib (0 5)) (emacs (26 2))) "Apertium XML editing minor mode" tar ((:commit . "5230c18456ab034f2fb69acdbef62c1abae6a8cf") (:authors ("Kevin Brubeck Unhammer" . "unhammer@fsfe.org")) (:maintainer "Kevin Brubeck Unhammer" . "unhammer@fsfe.org") (:keywords "languages") (:url . "http://wiki.apertium.org/wiki/Emacs"))])
+ (dix-evil . [(20170105 1423) ((dix (0 3 0)) (evil (1 0 7))) "optional evil-integration with dix.el" single ((:commit . "5230c18456ab034f2fb69acdbef62c1abae6a8cf") (:authors ("Kevin Brubeck Unhammer" . "unhammer@fsfe.org")) (:maintainer "Kevin Brubeck Unhammer" . "unhammer@fsfe.org") (:keywords "languages") (:url . "http://wiki.apertium.org/wiki/Emacs"))])
+ (dizzee . [(20171201 916) nil "A more pleasant way to manage your project's subprocesses in Emacs." tar ((:commit . "e3cf1c2ea5d0fc00747524b6f3c5b905d0a8c8e1") (:authors ("David Miller" . "david@deadpansincerity.com")) (:maintainer "David Miller" . "david@deadpansincerity.com") (:keywords "emacs" "processes") (:url . "https://github.com/davidmiller/dizzee"))])
+ (django-commands . [(20220314 1545) ((emacs (25 1))) "Run django commands" single ((:commit . "7510c0f068bf214ad012c203d68e03ff4262efdf") (:authors ("Andrii Kolomoiets" . "andreyk.mad@gmail.com")) (:maintainer "Andrii Kolomoiets" . "andreyk.mad@gmail.com") (:keywords "tools") (:url . "https://github.com/muffinmad/emacs-django-commands"))])
+ (django-manage . [(20160819 212) ((hydra (0 13 2))) "Django minor mode for commanding manage.py" single ((:commit . "876fb2cb627d465adfdc905841279784bcdd7ee8") (:authors ("Daniel Gopar" . "gopardaniel@yahoo.com")) (:maintainer "Daniel Gopar" . "gopardaniel@yahoo.com") (:keywords "languages"))])
+ (django-mode . [(20170522 714) ((projectile (0)) (s (0)) (helm-make (0))) "Major mode for Django web framework." tar ((:commit . "a71b8dd984e7f724b8321246e5c353a4ae5c986e") (:authors ("Greg V" . "floatboth@me.com")) (:maintainer "Greg V" . "floatboth@me.com") (:keywords "languages"))])
+ (django-snippets . [(20131229 1611) ((yasnippet (0 8 0))) "Yasnippets for django" tar ((:commit . "a71b8dd984e7f724b8321246e5c353a4ae5c986e") (:authors ("Yasuyuki Oka" . "yasuyk@gmail.com")) (:maintainer "Yasuyuki Oka" . "yasuyk@gmail.com") (:url . "https://github.com/myfreeweb/django-mode"))])
+ (django-theme . [(20131022 902) nil "Custom face theme for Emacs" single ((:commit . "86c8142b3eb1addd94a43aa6f1d98dab06401af0") (:authors ("Andrzej Sliwa")) (:maintainer "Andrzej Sliwa") (:url . "http://github/anrzejsliwa/django-theme"))])
+ (djangonaut . [(20200503 921) ((emacs (25 2)) (magit-popup (2 6 0)) (pythonic (0 1 0)) (f (0 20 0)) (s (1 12 0))) "Minor mode to interact with Django projects" single ((:commit . "75f642114e3997308a1e7e67c3025738cecee0fe") (:authors ("Artem Malyshev" . "proofit404@gmail.com")) (:maintainer "Artem Malyshev" . "proofit404@gmail.com") (:url . "https://github.com/proofit404/djangonaut"))])
+ (djinni-mode . [(20190303 139) ((emacs (24 4))) "Major-mode for editing Djinni files." single ((:commit . "6f84bc60d078725cc8b922a259ec5f4c7de83681") (:authors ("Daniel Martín" . "mardani29@yahoo.es")) (:maintainer "Daniel Martín" . "mardani29@yahoo.es") (:keywords "languages") (:url . "https://github.com/danielmartin/djinni-mode"))])
+ (dkdo . [(20131110 1119) ((dkmisc (0 50)) (emacs (24 1))) "Do List major mode based on org-mode." tar ((:commit . "fd6bb105e8331fafb6385c5238c988c4c5bbe2da") (:authors ("David Keegan" . "dksw@eircom.net")) (:maintainer "David Keegan" . "dksw@eircom.net") (:keywords "dolist" "task" "productivity") (:url . "https://github.com/davidkeegan/dkdo"))])
+ (dkl . [(20161005 7) nil "Display keyboard layout." tar ((:commit . "6b4584f86037bda3383960c678d51f340229fb91") (:authors ("Alexis" . "flexibeast@gmail.com")) (:maintainer "Alexis" . "flexibeast@gmail.com") (:keywords "input" "keyboard" "layout") (:url . "https://github.com/flexibeast/dkl"))])
+ (dklrt . [(20131110 1341) ((dkmisc (0 50)) (ledger-mode (20130908 1357)) (emacs (24 1))) "Ledger Recurring Transactions." tar ((:commit . "5d6c99f8018335256ab934b4c1049708ae2d48ba") (:authors ("David Keegan" . "dksw@eircom.net")) (:maintainer "David Keegan" . "dksw@eircom.net") (:keywords "ledger" "ledger-cli" "recurring" "periodic" "automatic") (:url . "https://github.com/davidkeegan/dklrt"))])
+ (dkmisc . [(20131110 1115) ((emacs (24 1))) "Miscellaneous functions required by dk* packages." tar ((:commit . "fe3d49c6f8322b6f89466361acd97585bdfe0608") (:authors ("David Keegan" . "dksw@eircom.net")) (:maintainer "David Keegan" . "dksw@eircom.net") (:keywords "utility" "time" "date" "file") (:url . "https://github.com/davidkeegan/dkmisc"))])
+ (dmacro . [(20200803 633) ((emacs (24 1)) (cl-lib (0 6))) "Repeated detection and execution of key operation" single ((:commit . "3480b97aaad9e65fa03c6a9d1a0a8111be1179f8") (:authors ("Toshiyuki Masui" . "masui@ptiecan.com") ("Makoto Owada") ("Eiji Obata") ("Nobuyuki Mine")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "convenience") (:url . "https://github.com/emacs-jp/dmacro"))])
+ (dmenu . [(20190908 44) ((cl-lib (0 5))) "simulate the dmenu command line program" single ((:commit . "e8cc9b27c79d3ecc252267c082ab8e9c82eab264") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "convenience" "usability"))])
+ (dna-mode . [(20191001 2108) nil "a major mode for editing dna sequences" tar ((:commit . "7a48393fcf0015eed2368fcb89b3091c9d029dc4") (:authors ("Harley Gorrell" . "harley@panix.com")) (:maintainer "Harley Gorrell" . "harley@panix.com") (:keywords "dna" "emacs" "editing") (:url . "http://www.mahalito.net/~harley/elisp/dna-mode.el"))])
+ (doc-show-inline . [(20220507 1118) ((emacs (26 2))) "Show doc-strings found in external files" single ((:commit . "0cceb39df31fd578cfc95d756f667874e6321001") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:keywords "convenience") (:url . "https://codeberg.com/ideasman42/emacs-doc-show-inline"))])
+ (docbook-snippets . [(20150714 1625) ((yasnippet (0 8 0))) "Yasnippets for DocBook" tar ((:commit . "b06297fdec039a541aaa6312cb328a11062cfab4") (:authors ("Jaromir Hradilek" . "jhradilek@gmail.com")) (:maintainer "Jaromir Hradilek" . "jhradilek@gmail.com") (:keywords "snippets" "docbook") (:url . "https://github.com/jhradilek/emacs-docbook-snippets"))])
+ (docean . [(20180605 1744) ((emacs (24)) (cl-lib (0 5)) (request (0 2 0))) "Interact with DigitalOcean from Emacs." single ((:commit . "bbe2298fd21f7876fc2d5c52a69b931ff59df979") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "convenience") (:url . "https://github.com/emacs-pe/docean.el"))])
+ (docker . [(20220409 1157) ((aio (1 0)) (dash (2 19 1)) (docker-tramp (0 1)) (emacs (26 1)) (json-mode (1 8 0)) (s (1 12 0)) (tablist (1 0)) (transient (0 3 7))) "Interface to Docker" tar ((:commit . "cf137f5b8af7cbda17ef1d09c626db35e0e84078") (:authors ("Philippe Vaucher" . "philippe.vaucher@gmail.com")) (:maintainer "Philippe Vaucher" . "philippe.vaucher@gmail.com") (:keywords "filename" "convenience") (:url . "https://github.com/Silex/docker.el"))])
+ (docker-api . [(20160525 720) ((dash (2 12 1)) (request (0 2 0)) (s (1 11 0))) "Emacs interface to the Docker API" tar ((:commit . "206144346b7fa4165223349cfeb64a75d47ddd1b") (:authors ("Philippe Vaucher" . "philippe.vaucher@gmail.com")) (:maintainer "Philippe Vaucher" . "philippe.vaucher@gmail.com") (:url . "https://github.com/Silex/docker-api.el"))])
+ (docker-cli . [(20190524 1624) nil "Running various commands in docker containers" single ((:commit . "c4b02894466d8642ad3d49df4c4a80e023a672aa") (:authors ("Boško Ivanišević" . "bosko.ivanisevic@gmail.com")) (:maintainer "Boško Ivanišević" . "bosko.ivanisevic@gmail.com") (:keywords "processes") (:url . "https://github.com/bosko/docker-cli"))])
+ (docker-compose-mode . [(20200830 1336) ((emacs (24 3)) (dash (2 12 0)) (yaml-mode (0 0 12))) "Major mode for editing docker-compose files" single ((:commit . "abaa4f3aeb5c62d7d16e186dd7d77f4e846e126a") (:authors ("Ricardo Martins")) (:maintainer "Ricardo Martins") (:keywords "convenience") (:url . "https://github.com/meqif/docker-compose-mode"))])
+ (docker-tramp . [(20220219 420) ((emacs (24)) (cl-lib (0 5))) "TRAMP integration for docker containers" tar ((:commit . "930d7b46c180d8a13240a028c1b40af84f2a3219") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "docker" "convenience") (:url . "https://github.com/emacs-pe/docker-tramp.el"))])
+ (dockerfile-mode . [(20220220 1439) ((emacs (24))) "Major mode for editing Docker's Dockerfiles" single ((:commit . "b63a3d12b7dea0cb9efc7f78d7ad5672ceab2a3f") (:keywords "docker") (:url . "https://github.com/spotify/dockerfile-mode"))])
+ (docopt . [(20220319 1912) ((emacs (26 3)) (dash (2 17 0)) (emacs (26 1)) (f (0 20 0)) (parsec (0 1 3)) (s (1 12 0)) (transient (0 3 0))) "A Docopt implementation in Elisp" tar ((:commit . "a7f5b4a8b1a43552067ce27bce6080a509c92cff") (:authors ("r0man" . "roman@burningswell.com")) (:maintainer "r0man" . "roman@burningswell.com") (:keywords "docopt" "tools" "processes") (:url . "https://github.com/r0man/docopt.el"))])
+ (docstr . [(20220214 1539) ((emacs (24 4)) (s (1 9 0))) "A document string minor mode" tar ((:commit . "bb7485d24a4fb147fc7fc7fcd1e1c7ddd3ff64b5") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/docstr"))])
+ (doct . [(20220227 205) ((emacs (25 1))) "DOCT: Declarative Org capture templates" single ((:commit . "4033a8fd8681d3989550f7a2532d6b4e3c45bfe8") (:authors ("Nicholas Vollmer" . "progfolio@protonmail.com")) (:maintainer "Nicholas Vollmer" . "progfolio@protonmail.com") (:keywords "org" "convenience") (:url . "https://github.com/progfolio/doct"))])
+ (dogears . [(20210913 1259) ((emacs (26 3)) (map (2 1))) "Never lose your place again" single ((:commit . "c05b69e504a538c9e00fbb0ea86934fafe191d0c") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "convenience") (:url . "https://github.com/alphapapa/dogears.el"))])
+ (dokuwiki . [(20180102 59) ((emacs (24 3)) (xml-rpc (1 6 8))) "Edit Remote DokuWiki Pages Using XML-RPC" single ((:commit . "594c4d4904dcc2796bbbd2c0845d9e7c09ccf6f7") (:authors ("Juan Karlo Licudine" . "accidentalrebel@gmail.com")) (:maintainer "Juan Karlo Licudine" . "accidentalrebel@gmail.com") (:keywords "convenience") (:url . "http://www.github.com/accidentalrebel/emacs-dokuwiki"))])
+ (dokuwiki-mode . [(20170223 1301) nil "Major mode for DokuWiki document" single ((:commit . "e4e116f6fcc373e3f5937c1a7daa5c2c9c6d3fa1") (:authors ("Tsunenobu Kai" . "kai2nenobu@gmail.com")) (:maintainer "Tsunenobu Kai" . "kai2nenobu@gmail.com") (:keywords "hypermedia" "text" "dokuwiki") (:url . "https://github.com/kai2nenobu/emacs-dokuwiki-mode"))])
+ (dollaro . [(20151123 1302) ((s (1 6 0))) "simple text templates" single ((:commit . "500127f0172ac7a1eec627e026b59136580a74ac") (:authors ("Alessandro Piras" . "laynor@gmail.com")) (:maintainer "Alessandro Piras" . "laynor@gmail.com") (:keywords "tools" "convenience"))])
+ (doneburn-theme . [(20181110 1857) nil "A light theme based on Bozhidar Batsov's Zenburn" single ((:commit . "da4fa915a2a659001eea04498d790cdd8cac1fce") (:authors ("Manuel Uberti" . "manuel.uberti@inventati.org")) (:maintainer "Manuel Uberti" . "manuel.uberti@inventati.org") (:keywords "faces" "themes") (:url . "http://github.com/manuel-uberti/doneburn-emacs"))])
+ (doom . [(20180301 2308) ((cl-lib (0 5))) "DOM implementation and manipulation library" single ((:commit . "e59040aefc92dd9b3134eb623624307fb9e4327b") (:authors ("Alex Schroeder" . "alex@gnu.org") ("Henrik.Motakef" . "elisp@henrik-motakef.de") ("Katherine Whitlock" . "toroidal-code@gmail.com") ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Alex Schroeder") (:keywords "xml" "dom") (:url . "http://www.github.com/kensanata/doom.el/"))])
+ (doom-modeline . [(20220412 853) ((emacs (25 1)) (all-the-icons (2 2 0)) (shrink-path (0 2 0)) (dash (2 11 0))) "A minimal and modern mode-line" tar ((:commit . "85bdd9ed8674710f6b9815e9a1c41ad4b5a45ace") (:authors ("Vincent Zhang" . "seagle0128@gmail.com")) (:maintainer "Vincent Zhang" . "seagle0128@gmail.com") (:keywords "faces" "mode-line") (:url . "https://github.com/seagle0128/doom-modeline"))])
+ (doom-modeline-now-playing . [(20210831 1442) ((emacs (24 4)) (doom-modeline (3 0 0)) (async (1 9 3))) "Segment for Doom Modeline to show playerctl information" single ((:commit . "ef9158dfdf32e8eb789b69e7394d0bddaa68f42c") (:authors ("Ellis Kenyő" . "me@elken.dev")) (:maintainer "Ellis Kenyő" . "me@elken.dev") (:url . "https://github.com/elken/doom-modeline-now-playing"))])
+ (doom-themes . [(20220504 1557) ((emacs (25 1)) (cl-lib (0 5))) "an opinionated pack of modern color-themes" tar ((:commit . "e9bdd137116fa2037ed60037b8421cf68c64888d") (:authors ("Henrik Lissner" . "contact@henrik.io")) (:maintainer "Henrik Lissner" . "contact@henrik.io") (:keywords "themes" "faces") (:url . "https://github.com/doomemacs/themes"))])
+ (dot-mode . [(20180312 2300) ((emacs (24 3))) "minor mode to repeat typing or commands" single ((:commit . "6ca22b73bcdae2363ee9641b822a60685df16a3e") (:authors ("Robert Wyrick" . "rob@wyrick.org")) (:maintainer "Robert Wyrick" . "rob@wyrick.org") (:keywords "convenience") (:url . "https://github.com/wyrickre/dot-mode"))])
+ (dotenv-mode . [(20191027 2129) ((emacs (24 3))) "Major mode for .env files" single ((:commit . "e3701bf739bde44f6484eb7753deadaf691b73fb") (:authors ("Preetpal S. Sohal")) (:maintainer "Preetpal S. Sohal") (:url . "https://github.com/preetpalS/emacs-dotenv-mode"))])
+ (dotnet . [(20200803 1032) nil "Interact with dotnet CLI tool" single ((:commit . "83ba1305d7895b03f3dffb2d3458b7ec75e6909f") (:authors ("Julien BLANCHARD" . "julien@sideburns.eu")) (:maintainer "Julien BLANCHARD" . "julien@sideburns.eu") (:keywords ".net" "tools") (:url . "https://github.com/julienXX/dotnet.el"))])
+ (double-saber . [(20190325 1917) ((emacs (24 4))) "Narrow and delete in search buffers." single ((:commit . "93d9b1ec833a871bde2fd0f78abc269872808048") (:authors ("Daniel Ting" . "deep.paren.12@gmail.com")) (:maintainer "Daniel Ting" . "deep.paren.12@gmail.com") (:keywords "double-saber" "narrow" "delete" "sort" "tools" "convenience" "matching") (:url . "https://github.com/dp12/double-saber.git"))])
+ (download-region . [(20210306 415) ((cl-lib (0 3))) "Simple in-buffer download manager" single ((:commit . "e0a721858a22896fa1d7f1d5689dd0878dbc58fa") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://zk-phi.github.io/"))])
+ (downplay-mode . [(20151125 2009) nil "focus attention on a region of the buffer" single ((:commit . "4a2c3addc73c8ca3816345c3c11c08af265baedb") (:authors ("Toby Crawley" . "toby@tcrawley.org")) (:maintainer "Toby Crawley" . "toby@tcrawley.org") (:url . "https://github.com/tobias/downplay-mode/"))])
+ (doxy-graph-mode . [(20210604 723) ((emacs (26 3))) "Links source code editing with doxygen call graphs" single ((:commit . "88af6ef4bc9c8918b66c7774f0a115b2addc310e") (:authors ("Gustavo Puche" . "gustavo.puche@gmail.com")) (:maintainer "Gustavo Puche" . "gustavo.puche@gmail.com") (:keywords "languages" "all") (:url . "https://github.com/gustavopuche/doxy-graph-mode"))])
+ (dpaste . [(20160303 2112) nil "Emacs integration for dpaste.com" single ((:commit . "5ebabb466a6ae70882549855b6b2194fc32189f8") (:authors ("Greg Newman" . "greg@gregnewman.org") ("Guilherme Gondim" . "semente@taurinus.org")) (:maintainer "Greg Newman" . "greg@gregnewman.org") (:keywords "paste" "pastie" "pastebin" "dpaste" "python"))])
+ (dpaste_de . [(20131015 1225) ((web (0 3 7))) "Emacs mode to paste to dpaste.de" single ((:commit . "f0c39e8864299f735642f7d9fa490689398ce39d") (:authors ("Thejaswi Puthraya" . "thejaswi.puthraya@gmail.com")) (:maintainer "Thejaswi Puthraya" . "thejaswi.puthraya@gmail.com") (:keywords "pastebin"))])
+ (dpkg-dev-el . [(20190824 2314) ((debian-el (37))) "Emacs modes for debian packaging" tar ((:commit . "458f5230d02b15c94e94eca1af4eabaec30f45db") (:authors ("Peter S Galbraith" . "psg@debian.org")) (:maintainer "Peter S Galbraith" . "psg@debian.org"))])
+ (dr-racket-like-unicode . [(20200513 1642) ((emacs (24 1))) "DrRacket-style unicode input" single ((:commit . "70bc1caea6b277e49e1cb29e1926a7b0c83c5ebc") (:authors ("David Christiansen" . "david@davidchristiansen.dk")) (:maintainer "David Christiansen" . "david@davidchristiansen.dk") (:keywords "i18n" "tools"))])
+ (dracula-theme . [(20220209 724) ((emacs (24 3))) "Dracula Theme" single ((:commit . "e725c9e790c9e9cdaccdb35faaae9d5cb16ddb89") (:authors ("film42")) (:maintainer "Étienne Deparis" . "etienne@depar.is") (:url . "https://github.com/dracula/emacs"))])
+ (draft-mode . [(20140609 1456) nil "Rough drafting for Emacs." single ((:commit . "4779fb32daf53746459da2def7e08004492d4f18") (:authors ("Eeli Reilin" . "gaudecker@fea.st")) (:maintainer "Eeli Reilin" . "gaudecker@fea.st") (:keywords "draft" "drafting") (:url . "https://github.com/gaudecker/draft-mode"))])
+ (drag-stuff . [(20161108 749) nil "Drag stuff (lines, words, region, etc...) around" tar ((:commit . "6d06d846cd37c052d79acd0f372c13006aa7e7c8") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "speed" "convenience") (:url . "http://github.com/rejeep/drag-stuff"))])
+ (drawille . [(20160418 1838) ((cl-lib (0 5))) "Drawille implementation in elisp" tar ((:commit . "d914845725719d8293e2f0dea3c9c7e0a1e0e62a") (:authors ("Josuah Demangeon" . "josuah.demangeon@gmail.com")) (:maintainer "Josuah Demangeon" . "josuah.demangeon@gmail.com") (:keywords "graphics") (:url . "https://github.com/sshbio/elisp-drawille"))])
+ (dream-theme . [(20210419 605) ((emacs (26 1))) "Maximalist Nordic/Zenburn-inspired color theme" single ((:commit . "0c27f05544b90e41338f79ea923044b358a323c6") (:authors ("Dirk-Jan C. Binnema" . "djcb@djcbsoftware.nl")) (:maintainer "Dirk-Jan C. Binnema" . "djcb@djcbsoftware.nl") (:keywords "faces" "theme") (:url . "https://github.com/djcb/dream-theme"))])
+ (drill-instructor-AZIK-force . [(20151123 514) ((popup (0 5))) "Support AZIK input" tar ((:commit . "008cea202dc31d7d6fb1e7d8e6334d516403b7a5") (:authors ("Yuhei Maeda <yuhei.maeda_at_gmail.com>")) (:maintainer "Yuhei Maeda") (:keywords "convenience") (:url . "https://github.com/myuhe/drill-instructor-AZIK-force.el"))])
+ (drone . [(20161106 918) nil "Launch your drone test suite if drone.yml is present" single ((:commit . "1d4ee037ad3208847a4235426edf0c4a3e7b1899") (:authors ("Oliver Marks" . "oly@digitaloctave.com")) (:maintainer "Oliver Marks" . "oly@digitaloctave.com") (:keywords "drone" "tests" "ci") (:url . "https://github.com/olymk2/emacs-drone"))])
+ (dropbox . [(20220314 1638) ((request (0 3 0)) (json (1 2)) (oauth (1 0 3))) "Emacs backend for dropbox" single ((:commit . "c048faad0be24e8fa31974f08b710a87cf5b668c") (:authors ("Pavel Panchekha" . "me@pavpanchekha.com")) (:maintainer "Pavel Panchekha" . "me@pavpanchekha.com") (:keywords "dropbox"))])
+ (drupal-mode . [(20220125 1044) ((php-mode (1 5 0))) "Advanced minor mode for Drupal development" tar ((:commit . "17927723adc5921e8058f7c29e5e50e88b975639") (:authors ("Arne Jørgensen" . "arne@arnested.dk")) (:maintainer "Arne Jørgensen" . "arne@arnested.dk") (:keywords "programming" "php" "drupal") (:url . "https://github.com/arnested/drupal-mode"))])
+ (drupal-spell . [(20130520 1655) nil "Aspell extra dictionary for Drupal" tar ((:commit . "4087c28c89a884ee050961c57166e6b09085f59d") (:authors ("Arne Jørgensen" . "arne@arnested.dk")) (:maintainer "Arne Jørgensen" . "arne@arnested.dk") (:keywords "wp") (:url . "https://github.com/arnested/drupal-spell"))])
+ (dsvn . [(20190316 2201) nil "Subversion interface" single ((:commit . "c37d2412ba92aad647bcf5aeb151e620e8069f8d") (:authors ("David Kågedal" . "davidk@lysator.liu.se") (" Mattias Engdegård" . "mattiase@acm.org")) (:maintainer "Mattias Engdegård" . "mattiase@acm.org") (:keywords "docs"))])
+ (dtache . [(20220501 931) ((emacs (27 1))) "Run and interact with detached shell commands" tar ((:commit . "9becf3a921a0fde3a6e5d6f30379cf3d9826d565") (:authors ("Niklas Eklund" . "niklas.eklund@posteo.net")) (:maintainer "Niklas Eklund" . "niklas.eklund@posteo.net") (:keywords "convenience" "processes") (:url . "https://www.gitlab.com/niklaseklund/dtache.git"))])
+ (dtb-mode . [(20210105 1132) ((emacs (25))) "Show device tree souce in dtbs" single ((:commit . "7f66de945a0be2be5a26b4619cae097288fb55cd") (:authors ("Schspa Shi" . "schspa@gmail.com")) (:maintainer "Schspa Shi" . "schspa@gmail.com") (:keywords "dtb" "dts" "convenience") (:url . "https://github.com/schspa/dtb-mode"))])
+ (dtk . [(20220309 759) ((emacs (24 4)) (cl-lib (0 6 1)) (dash (2 12 0)) (seq (1 9)) (s (1 9))) "access SWORD content via diatheke" single ((:commit . "56b339bc76926defa775c406113e306ec6d31b36") (:authors ("David Thompson")) (:maintainer "David Thompson") (:keywords "hypermedia") (:url . "https://github.com/dtk01/dtk.el"))])
+ (dtrace-script-mode . [(20150214 623) nil "DTrace code editing commands for Emacs" single ((:commit . "801af1ef16075d31a19830ebb8404bbf3a322f10"))])
+ (dtrt-indent . [(20220226 1354) nil "Adapt to foreign indentation offsets" tar ((:commit . "66fc30af02901db023e464a24d2b5fb3ff472794") (:authors ("Julian Scheid" . "julians37@googlemail.com")) (:maintainer "Reuben Thomas" . "rrt@sc3d.org") (:keywords "convenience" "files" "languages" "c"))])
+ (dts-mode . [(20211202 18) nil "Major mode for Devicetree source code" single ((:commit . "32517e7eeeccc785b7c669fd5e93c5df45597ef1") (:authors ("Ben Gamari" . "ben@smart-cactus.org")) (:maintainer "Ben Gamari" . "ben@smart-cactus.org") (:keywords "languages"))])
+ (ducpel . [(20140702 1154) ((cl-lib (0 5))) "Logic game with sokoban elements" tar ((:commit . "b53b935ab95c02b82ccf38f63c89e39e99477a55") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "games") (:url . "https://github.com/alezost/ducpel"))])
+ (dumb-diff . [(20171211 2122) ((emacs (24 3))) "fast arbitrary diffs" single ((:commit . "1a2331d283049b71a07c1b06b1e0627a950d55f4") (:authors ("jack angers")) (:maintainer "jack angers") (:keywords "programming" "diff"))])
+ (dumb-jump . [(20211018 1545) ((emacs (24 3)) (s (1 11 0)) (dash (2 9 0)) (popup (0 5 3))) "Jump to definition for 50+ languages without configuration" single ((:commit . "dbb915441a2b66f2fbb954ff5de2723c5a4771d4") (:authors ("jack angers and contributors")) (:maintainer "jack angers and contributors") (:keywords "programming") (:url . "https://github.com/jacktasia/dumb-jump"))])
+ (dummyparens . [(20141009 1024) nil "parenthesis auto-pairing and wrapping" single ((:commit . "9798ef1d0eaa24e4fe66f8aa6022a8c62714cc89") (:authors ("Sergei Nosov <sergei.nosov [at] gmail.com>")) (:maintainer "Sergei Nosov <sergei.nosov [at] gmail.com>") (:keywords "dummyparens" "auto-pair" "wrapping") (:url . "https://github.com/snosov1/dummyparens"))])
+ (dune . [(20210909 1010) nil "Integration with the dune build system" tar ((:commit . "4633b71e64abe3e8a737a45e181daef43f7db48d") (:url . "https://github.com/ocaml/dune"))])
+ (dune-format . [(20210505 108) ((reformatter (0 6)) (emacs (24 1))) "Reformat OCaml's dune files automatically" single ((:commit . "196f16a01f4c855de7becddbc4cfed2f6788693a") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "languages") (:url . "https://github.com/purcell/emacs-dune-format"))])
+ (duplicate-thing . [(20181031 1500) nil "Duplicate current line & selection" single ((:commit . "9d8fd05e3e5caa35d3f2a0c0032c92f0c0908e21") (:authors ("ongaeshi")) (:maintainer "ongaeshi") (:keywords "convenience" "command" "duplicate" "line" "selection") (:url . "https://github.com/ongaeshi/duplicate-thing"))])
+ (dut-mode . [(20170729 2111) ((emacs (24))) "Major mode for the Dut programming language" single ((:commit . "9235c7acaa6690942e9de8b7acd1e4be0c859dc1") (:authors ("The dut-mode Authors")) (:maintainer "The dut-mode Authors") (:keywords "languages" "gut") (:url . "https://github.com/dut-lang/dut-mode"))])
+ (dw . [(20210331 2246) ((emacs (25 1))) "Diceware passphrase generation commands" single ((:commit . "61c5718ba64ace4c9e29de18aa2690ecc3f0f258") (:authors ("D. Williams" . "d.williams@posteo.net")) (:maintainer "D. Williams" . "d.williams@posteo.net") (:keywords "convenience" "games") (:url . "https://github.com/integral-dw/dw-passphrase-generator"))])
+ (dyalog-mode . [(20210413 810) ((cl-lib (0 2)) (emacs (24 3))) "Major mode for editing Dyalog APL source code" tar ((:commit . "697a84194766708d2607e8ba48a552e383c6523e") (:authors ("Joakim Hårsman" . "joakim.harsman@gmail.com")) (:maintainer "Joakim Hårsman" . "joakim.harsman@gmail.com") (:keywords "languages") (:url . "https://github.com/harsman/dyalog-mode.git"))])
+ (dylan . [(20220115 1804) ((emacs (25 1))) "Dylan editing modes" tar ((:commit . "9d2891e3e06405b75072d296f385fa795aeb9835") (:url . "https://opendylan.org/"))])
+ (dynamic-fonts . [(20140731 1226) ((font-utils (0 7 0)) (persistent-soft (0 8 8)) (pcache (0 2 3))) "Set faces based on available fonts" single ((:commit . "ab0c65accbdb59acaed5b263327e22ec019b3e82") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "faces" "frames") (:url . "http://github.com/rolandwalker/dynamic-fonts"))])
+ (dynamic-graphs . [(20210908 2010) ((emacs (26 1))) "Manipulation with graphviz graphs" single ((:commit . "64ca58dffecdecb636f7fe61c0c86e9c3c64d4dd") (:authors ("Tomas Zellerin" . "tomas@zellerin.cz")) (:maintainer "Tomas Zellerin" . "tomas@zellerin.cz") (:keywords "tools") (:url . "https://github.com/zellerin/dynamic-graphs"))])
+ (dynamic-ruler . [(20160602 808) nil "Displays a dynamic ruler at point." single ((:commit . "c9c0de6fe5721f06b50e01d9b4684b519c71b367") (:authors ("Francesc Rocher" . "francesc.rocher@gmail.com")) (:maintainer "Francesc Rocher" . "francesc.rocher@gmail.com") (:keywords "ruler" "tools" "convenience") (:url . "http://rocher.github.io/dynamic-ruler"))])
+ (dynamic-spaces . [(20171027 1851) nil "When editing, don't move text separated by spaces" single ((:commit . "97ae8480c257ba573ca3d06dbf602f9b23c41d38") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "convenience") (:url . "https://github.com/Lindydancer/dynamic-spaces"))])
+ (dynaring . [(20210924 2026) ((emacs (25 1))) "A dynamically sized ring structure" single ((:commit . "dc9013117bdcdc1b12feebcc58eaf129a6ad3a73") (:authors ("Mike Mattie" . "codermattie@gmail.com") ("Sid Kasivajhula" . "sid@countvajhula.com")) (:maintainer "Sid Kasivajhula" . "sid@countvajhula.com") (:url . "https://github.com/countvajhula/dynaring"))])
+ (dyncloze . [(20210712 145) ((emacs (25 1)) (dash (2 18))) "Language alternatives self-testing" tar ((:commit . "aafc5adc25c7f714b619109bccf92e475d6c84ef") (:authors ("Andrew Hyatt" . "ahyatt@gmail.com")) (:maintainer "Andrew Hyatt" . "ahyatt@gmail.com") (:url . "https://github.com/ahyatt/emacs-dyncloze"))])
+ (e2ansi . [(20190517 1902) ((face-explorer (0 0 4))) "Syntax highlighting support for `less', powered by Emacs." tar ((:commit . "6e1bb4e4e27885d1786db08b091cfa13b184fb54") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "faces" "languages") (:url . "https://github.com/Lindydancer/e2ansi"))])
+ (e2wm . [(20170215 36) ((window-layout (1 4))) "simple window manager for emacs" tar ((:commit . "4353d3394c77a49f8f0291c239858c8c5e877549") (:authors ("SAKURAI Masashi <m.sakurai atmark kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai atmark kiwanami.net>") (:keywords "tools" "window manager"))])
+ (e2wm-R . [(20151230 926) ((e2wm (1 3)) (inlineR (1 0)) (ess (15 3))) "some e2wm plugin and perspective for GNU R" single ((:commit . "4350601ee1a96bf89777b3f09f1b79b88e2e6e4d") (:authors ("myuhe <yuhei.maeda_at_gmail.com>")) (:maintainer "myuhe") (:keywords "convenience" "e2wm") (:url . "https://github.com/myuhe/e2wm-R.el"))])
+ (e2wm-bookmark . [(20151123 521) ((e2wm (1 2))) "Bookmark plugin for e2wm.el" single ((:commit . "bad816b6d8049984d69bcd277b7d325fb84d55eb") (:authors ("Yuhei Maeda <yuhei.maeda_at_gmail.com>")) (:maintainer "Yuhei Maeda <yuhei.maeda_at_gmail.com>") (:keywords "convenience"))])
+ (e2wm-direx . [(20200805 1414) ((e2wm (1 2)) (direx (0 1 -3))) "Plugin of e2wm.el for direx.el" single ((:commit . "5672bc44d8e5cea6bc3b84c3b58e522050ffae0e") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "tools" "window manager" "convenience") (:url . "https://github.com/aki2o/e2wm-direx"))])
+ (e2wm-pkgex4pl . [(20140525 1047) ((e2wm (1 2)) (plsense-direx (0 2 0))) "Plugin of e2wm.el for package explorer of Perl" single ((:commit . "7ea994450727190c4f3cb46cb429ba41b692ecc0") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "tools" "window manager" "perl") (:url . "https://github.com/aki2o/e2wm-pkgex4pl"))])
+ (e2wm-svg-clock . [(20150106 1306) ((e2wm (20130225 1602)) (svg-clock (0 4))) "e2wm plugin for svg-clock" single ((:commit . "d425925e3afffcbe2ff74edc80b714e4319d4c94") (:authors ("Yuhei Maeda <yuhei.maeda_at_gmail.com>")) (:maintainer "Yuhei Maeda") (:keywords "convenience" "e2wm") (:url . "https://github.com/myuhe/e2wm-svg-clock.el"))])
+ (e2wm-sww . [(20200805 1339) ((e2wm (1 2))) "Plugin of e2wm.el to switch plugin quickly" single ((:commit . "8926d0c70be05c7b4ef821e22e411e8813973687") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "tools" "window manager") (:url . "https://github.com/aki2o/e2wm-sww"))])
+ (e2wm-term . [(20200322 729) ((e2wm (1 2)) (log4e (0 2 0)) (yaxception (0 3 2))) "Perspective of e2wm.el for work in terminal" single ((:commit . "74362d6271e736272df32ea807c5a22e4df54a50") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "tools" "window manager") (:url . "https://github.com/aki2o/e2wm-term"))])
+ (eacl . [(20220101 1517) ((emacs (25 1))) "Auto-complete lines by grepping project" single ((:commit . "4d9d42fa05e550dbac71a2c93e1da71c48af9449") (:authors ("Chen Bin <chenbin DOT sh AT gmail DOT com>")) (:maintainer "Chen Bin <chenbin DOT sh AT gmail DOT com>") (:keywords "abbrev" "convenience" "matching") (:url . "http://github.com/redguardtoo/eacl"))])
+ (earthfile-mode . [(20210903 230) ((emacs (26))) "Major mode for editing Earthly file" single ((:commit . "0f24876223a358d2718383e9e4975a26cee55f9d") (:authors ("Thanabodee Charoenpiriyakij" . "wingyminus@gmail.com")) (:maintainer "Thanabodee Charoenpiriyakij" . "wingyminus@gmail.com") (:url . "https://github.com/earthly/earthly-mode"))])
+ (easy-after-load . [(20170817 1231) nil "eval-after-load for all files in a directory" single ((:commit . "29e20145da49ac9ea40463c552130777408040de") (:authors ("Kyle Hargraves")) (:maintainer "Kyle Hargraves") (:url . "https://github.com/pd/easy-after-load"))])
+ (easy-escape . [(20210917 1254) nil "Improve readability of escape characters in regular expressions" single ((:commit . "938497a21e65ba6b3ff8ec90e93a6d0ab18dc9b4") (:authors ("Clément Pit-Claudel" . "clement.pitclaudel@live.com")) (:maintainer "Clément Pit-Claudel" . "clement.pitclaudel@live.com") (:keywords "convenience" "lisp" "tools") (:url . "https://github.com/cpitclaudel/easy-escape"))])
+ (easy-hugo . [(20211017 1248) ((emacs (25 1)) (popup (0 5 3)) (request (0 3 0)) (transient (0 3 6))) "Write blogs made with hugo by markdown or org-mode" tar ((:commit . "baead14d7f2fa86e108269932a94bf376de9c2e5") (:authors ("Masashi Miyaura")) (:maintainer "Masashi Miyaura") (:url . "https://github.com/masasam/emacs-easy-hugo"))])
+ (easy-jekyll . [(20211217 2311) ((emacs (25 1)) (request (0 3 0))) "Major mode managing jekyll blogs" single ((:commit . "7f19af310162464956f2bc4c38c6b7e95cb20321") (:authors ("Masashi Miyaura")) (:maintainer "Masashi Miyaura") (:url . "https://github.com/masasam/emacs-easy-jekyll"))])
+ (easy-kill . [(20220311 1506) ((emacs (25)) (cl-lib (0 5))) "kill & mark things easily" single ((:commit . "f9b450a87c41e5ef616df565ed158cb236aa5189") (:authors ("Leo Liu" . "sdl.web@gmail.com")) (:maintainer "Leo Liu" . "sdl.web@gmail.com") (:keywords "killing" "convenience") (:url . "https://github.com/leoliu/easy-kill"))])
+ (easy-kill-extras . [(20210529 945) ((easy-kill (0 9 4))) "Extra functions for easy-kill." tar ((:commit . "74e9d0fcafc38d5f24e6209671a552bc1ba5a867") (:authors ("Akinori MUSHA" . "knu@iDaemons.org")) (:maintainer "Akinori MUSHA" . "knu@iDaemons.org") (:keywords "killing" "convenience") (:url . "https://github.com/knu/easy-kill-extras.el"))])
+ (easy-repeat . [(20150516 848) ((emacs (24 4))) "Repeat easily" single ((:commit . "060f0e6801c82c40c06961dc0528a00e18947a8c") (:authors ("Chunyang Xu" . "xuchunyang56@gmail.com")) (:maintainer "Chunyang Xu" . "xuchunyang56@gmail.com") (:keywords "repeat" "convenience") (:url . "https://github.com/xuchunyang/easy-repeat.el"))])
+ (ebf . [(20210225 1211) ((dash (2 18 0)) (cl-lib (0 5))) "brainfuck language transpiler to Emacs Lisp" tar ((:commit . "6cbeb4d62416f4cfd5be8906667342af8ecc44a6") (:authors ("Alexey Kutepov" . "reximkut@gmail.com")) (:maintainer "Alexey Kutepov" . "reximkut@gmail.com") (:url . "http://github.com/rexim/ebf"))])
+ (ebib . [(20220430 2219) ((parsebib (2 3)) (emacs (26 1))) "a BibTeX database manager" tar ((:commit . "0e243a78f435038dda31953c5b48cbddf2a89e27") (:authors ("Joost Kremers" . "joostkremers@fastmail.fm")) (:maintainer "Joost Kremers" . "joostkremers@fastmail.fm") (:keywords "text" "bibtex") (:url . "http://joostkremers.github.io/ebib/"))])
+ (ebuku . [(20220106 902) ((emacs (25 1))) "Interface to the buku Web bookmark manager" single ((:commit . "5004d377f8c89436c28d4a7ffbef407a2b28861e") (:authors ("Alexis <flexibeast@gmail.com>, Erik Sjöstrand" . "sjostrand.erik@gmail.com")) (:maintainer "Alexis" . "flexibeast@gmail.com") (:keywords "bookmarks" "buku" "data" "web" "www") (:url . "https://github.com/flexibeast/ebuku"))])
+ (ecb . [(20170728 1921) nil "a code browser for Emacs" tar ((:commit . "1330a44cf3c171781083b0b926ab7622f64e6e81") (:authors ("Jesper Nordenberg" . "mayhem@home.se") ("Klaus Berndl" . "klaus.berndl@sdm.de") ("Kevin A. Burton" . "burton@openprivacy.org")) (:maintainer "Klaus Berndl" . "klaus.berndl@sdm.de") (:keywords "browser" "code" "programming" "tools"))])
+ (echo-bar . [(20220222 214) nil "Turn the echo area into a custom status bar" single ((:commit . "06cc8ef88f3b054f676b76815879bd6c71107591") (:authors ("Adam Tillou" . "qaiviq@gmail.com")) (:maintainer "Adam Tillou" . "qaiviq@gmail.com") (:keywords "convenience" "tools") (:url . "https://github.com/qaiviq/echo-bar.el"))])
+ (eclim . [(20181108 1134) ((dash (2 11 0)) (json (1 2)) (popup (0 5 2)) (s (1 9 0)) (cl-lib (0 5)) (yasnippet (0 10 0))) "An interface to the Eclipse IDE." tar ((:commit . "222ddd48fcf0ee01592dec77c58e0cf3f2ea1100"))])
+ (eclipse-theme . [(20191113 1518) nil "Theme based on Eclipse circa 2010" single ((:commit . "dcf97865512ed450f9d5137c1a05e12edb5b7f80") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "themes") (:url . "https://github.com/abo-abo/eclipse-theme"))])
+ (ecukes . [(20210202 1241) ((commander (0 6 1)) (espuds (0 2 2)) (ansi (0 3 0)) (dash (2 2 0)) (s (1 8 0)) (f (0 11 0))) "Cucumber for Emacs." tar ((:commit . "d173cdf487bc2c62305e2232db96290bc021950f"))])
+ (edbi . [(20160225 141) ((concurrent (0 3 1)) (ctable (0 1 2)) (epc (0 1 1))) "Emacs Database Interface" tar ((:commit . "6f50aaf4bde75255221f2292c7a4ad3fa9d918c0") (:authors ("SAKURAI Masashi <m.sakurai at kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai at kiwanami.net>") (:keywords "database" "epc") (:url . "https://github.com/kiwanami/emacs-edbi"))])
+ (ede-compdb . [(20150920 2033) ((ede (1 2)) (semantic (2 2)) (cl-lib (0 4))) "Support for compilation database projects in EDE" single ((:commit . "d6d8466cd62876fc90adeff5875a1a584fd846cd") (:authors ("Alastair Rankine" . "alastair@girtby.net")) (:maintainer "Alastair Rankine" . "alastair@girtby.net") (:keywords "development" "ninja" "build" "cedet" "ede"))])
+ (ede-php-autoload . [(20180901 1255) nil "Simple EDE PHP Project" tar ((:commit . "8a4eeeaa93b8d87b65a107c4ebcbeb14528d9449") (:authors ("Steven Rémot" . "steven.remot@gmail.com") ("original code for C++ by Eric M. Ludlam" . "eric@siege-engine.com")) (:maintainer "Steven Rémot" . "steven.remot@gmail.com") (:keywords "php" "project" "ede") (:url . "https://github.com/emacs-php/ede-php-autoload"))])
+ (ede-php-autoload-composer-installers . [(20170221 2026) ((ede-php-autoload (1 0 0)) (f (0 19 0)) (s (1 7 0))) "Composer installers support for ede-php-autoload" single ((:commit . "7840439802c7d11ee086bbf465657f3da12f9f66") (:authors ("Thomas Fini Hansen" . "xen@xen.dk")) (:maintainer "Thomas Fini Hansen" . "xen@xen.dk") (:keywords "programming" "php") (:url . "https://github.com/xendk/ede-php-autoload-composer-installers"))])
+ (ede-php-autoload-drupal . [(20170316 2158) ((ede-php-autoload (1 0 0)) (f (0 19 0)) (s (1 7 0))) "Drupal support for ede-php-autoload" single ((:commit . "54a04241d94fabc4f4d16ae4dc8ba4f0c6e3b435") (:authors ("Thomas Fini Hansen" . "xen@xen.dk")) (:maintainer "Thomas Fini Hansen" . "xen@xen.dk") (:keywords "programming" "php" "drupal"))])
+ (edebug-inline-result . [(20220210 1357) ((emacs (25 1))) "Show Edebug result inline" single ((:commit . "9fb3c48434da24f800833a5ee3419452d5fb83cb") (:keywords "extensions" "lisp" "tools") (:url . "https://repo.or.cz/edebug-inline-result.git"))])
+ (edebug-x . [(20130616 625) nil "Extensions for Edebug" single ((:commit . "a2c2c42553d3bcbd5ac11898554865acbed1bc46") (:authors ("Scott Barnett" . "scott.n.barnett@gmail.com")) (:maintainer "Scott Barnett" . "scott.n.barnett@gmail.com") (:keywords "extensions") (:url . "https://github.com/ScottyB/edebug-x"))])
+ (edit-as-format . [(20220221 1312) ((emacs (26 1)) (edit-indirect (0 1 5))) "Edit document as other format" tar ((:commit . "59c6f439683846d994a7a2110b9b00cc16c08c40") (:authors ("Xiaobing Jing" . "jingxiaobing@gmail.com")) (:maintainer "Xiaobing Jing" . "jingxiaobing@gmail.com") (:keywords "files" "outlines" "convenience") (:url . "https://github.com/etern/edit-as-format"))])
+ (edit-at-point . [(20191013 1218) nil "edit(copy,cut..) current things(word,symbol..) under cursor" single ((:commit . "28c85a65c9c61f2aff50bc5e93f61cde26a5d9c0") (:authors (nil . "<e.enoson@gmail.com>")) (:maintainer nil . "<e.enoson@gmail.com>") (:url . "http://github.com/enoson/edit-at-point.el"))])
+ (edit-chrome-textarea . [(20200324 1513) ((emacs (25 1)) (websocket (1 4))) "Edit Chrome Textarea" single ((:commit . "e9ef6a72bdc6b58f932c51aa161869cee11b4bc9") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:keywords "tools") (:url . "https://github.com/xuchunyang/edit-chrome-textarea.el"))])
+ (edit-color-stamp . [(20130529 1733) ((es-lib (0 2)) (cl-lib (1 0))) "Edit a hex color stamp, using a QT or the internal color picker" tar ((:commit . "32dc1ca5bcf3dcf83fad5e39b55dc5b77becb3d3") (:authors ("sabof")) (:maintainer "sabof") (:url . "https://github.com/sabof/edit-color-stamp"))])
+ (edit-indirect . [(20220216 1812) ((emacs (24 3))) "Edit regions in separate buffers" single ((:commit . "e3d86416bcf8ddca951d7d112e57ad30c5f9a081") (:authors ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Fanael Linithien" . "fanael4@gmail.com") (:url . "https://github.com/Fanael/edit-indirect"))])
+ (edit-indirect-region-latex . [(20161129 645) ((emacs (24 3)) (ht (2 2)) (edit-indirect (0 1 4))) "Edit LaTeX regions in separate buffers, e.g. for English grammar checks" single ((:commit . "05043f2c0c9838947d3ca4b51b695deb7c47612e") (:authors ("Hirotaka Niitsuma" . "hirotaka.niitsuma@gmail.com")) (:maintainer "Hirotaka Niitsuma" . "hirotaka.niitsuma@gmail.com") (:url . "https://github.com/niitsuma/edit-indirect-region-latex"))])
+ (edit-list . [(20100930 1443) nil "edit a single list" single ((:commit . "f460d3f9e208a4e606fe6ded307f1b011916ca71") (:authors ("Michael Olson" . "mwolson@gnu.org")) (:maintainer "Michael Olson" . "mwolson@gnu.org") (:url . "http://mwolson.org/static/dist/elisp/edit-list.el"))])
+ (edit-server . [(20181016 1125) nil "server that responds to edit requests from Chrome" single ((:commit . "65a8e434547dcbe1df89dc3fd7aee075f8b06366") (:authors ("Alex Bennée" . "alex@bennee.com")) (:maintainer "Alex Bennée" . "alex@bennee.com") (:url . "https://github.com/stsquad/emacs_chrome"))])
+ (edit-server-htmlize . [(20130329 2248) ((edit-server (1 9))) "(de)HTMLization hooks for edit-server.el" single ((:commit . "e7f8dadfabe869c77ca241cd6fbd4c52bd908392") (:authors ("Roland McGrath" . "roland@hack.frob.com")) (:maintainer "Roland McGrath" . "roland@hack.frob.com") (:url . "https://github.com/frobtech/edit-server-htmlize"))])
+ (editorconfig . [(20220301 332) ((cl-lib (0 5)) (nadvice (0 3)) (emacs (24))) "EditorConfig Emacs Plugin" tar ((:commit . "1f6f16c24fd0030322d59c2853067a6dccc9e736") (:authors ("EditorConfig Team" . "editorconfig@googlegroups.com")) (:maintainer "EditorConfig Team" . "editorconfig@googlegroups.com") (:url . "https://github.com/editorconfig/editorconfig-emacs#readme"))])
+ (editorconfig-charset-extras . [(20180223 457) ((editorconfig (0 6 0))) "Extra EditorConfig Charset Support" single ((:commit . "4f75e175ad15ce2038f926fe4f0e5a0c1d0cbc46") (:authors ("10sr" . "8.slashes@gmail.com")) (:maintainer "10sr" . "8.slashes@gmail.com") (:keywords "tools") (:url . "https://github.com/10sr/editorconfig-charset-extras-el"))])
+ (editorconfig-custom-majormode . [(20180816 244) ((editorconfig (0 6 0))) "Decide major-mode and mmm-mode from EditorConfig" single ((:commit . "13ad1c83f847bedd4b3a19f9df7fd925853b19de") (:authors ("10sr <8slashes+el [at] gmail [dot] com>")) (:maintainer "10sr <8slashes+el [at] gmail [dot] com>") (:keywords "editorconfig" "util") (:url . "https://github.com/10sr/editorconfig-custom-majormode-el"))])
+ (editorconfig-domain-specific . [(20180505 924) ((cl-lib (0 5)) (editorconfig (0 6 0))) "Apply brace style and other \"domain-specific\" EditorConfig properties" single ((:commit . "e9824160fb2e466afa755240ee3ab7cc5657fb04") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "editorconfig" "util") (:url . "https://github.com/lassik/editorconfig-emacs-domain-specific"))])
+ (editorconfig-generate . [(20190513 433) ((emacs (24))) "Generate .editorconfig" single ((:commit . "47a31f928f46d2a0188db8e2cffa5d6354a81573") (:authors ("10sr" . "8.slashes@gmail.com")) (:maintainer "10sr" . "8.slashes@gmail.com") (:keywords "tools") (:url . "https://github.com/10sr/editorconfig-generate-el"))])
+ (edn . [(20160215 1219) ((cl-lib (0 3)) (emacs (24 1)) (peg (0 6))) "Support for reading and writing the edn data format from elisp" single ((:commit . "21e120a6914ee9a694be0a051f9f2af34ef055e4") (:authors ("Lars Andersen" . "expez@expez.com")) (:maintainer "Lars Andersen" . "expez@expez.com") (:keywords "edn" "clojure") (:url . "https://www.github.com/expez/edn.el"))])
+ (ednc . [(20220404 2105) ((emacs (26 1))) "Emacs Desktop Notification Center" single ((:commit . "d1a3c37235dd87e0bce6ffc75f5568218d6d83b4") (:authors ("Simon Nicolussi" . "sinic@sinic.name")) (:maintainer "Simon Nicolussi" . "sinic@sinic.name") (:keywords "unix") (:url . "https://github.com/sinic/ednc"))])
+ (edts . [(20220415 1722) ((auto-complete (20201213 1255)) (auto-highlight-symbol (20211106 638)) (dash (20210609 1330)) (emacs (24 3)) (erlang (20210315 1640)) (f (20191110 1357)) (popup (20210317 138)) (s (20210603 736))) "Erlang Development Tool Suite" tar ((:commit . "5c096ecdf9462b125f2eb4092899ff63636cfc40"))])
+ (edwina . [(20200113 1714) ((emacs (25))) "Dynamic window manager" tar ((:commit . "c5368716a504c93407fd8cb4ef925a8d8eb62698") (:authors ("Alex Griffin" . "a@ajgrf.com")) (:maintainer "Alex Griffin" . "a@ajgrf.com") (:keywords "convenience") (:url . "https://github.com/ajgrf/edwina"))])
+ (efar . [(20211122 1943) ((emacs (26 1))) "FAR-like file manager" single ((:commit . "49dc9b89a8b9bf2523c202ac8830d1245768f3f4") (:authors ("\"Vladimir Suntsov\"" . "vladimir@suntsov.online")) (:maintainer nil . "vladimir@suntsov.online") (:keywords "files") (:url . "https://github.com/suntsov/efar"))])
+ (efire . [(20151009 2031) ((circe (1 2))) "Use campfire from Emacs" single ((:commit . "91a644662afb352475efad0b377713656f131e5c") (:authors ("João Távora" . "joaotavora@gmail.com")) (:maintainer "João Távora" . "joaotavora@gmail.com") (:keywords "convenience" "tools") (:url . "https://github.com/capitaomorte/efire"))])
+ (eg . [(20170830 815) ((cl-lib (0 5)) (emacs (24 3))) "Norton Guide reader" single ((:commit . "1c7f1613d2aaae728ef540305f6ba030616f86bd") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "docs") (:url . "https://github.com/davep/eg.el"))])
+ (egalgo . [(20211105 1657) ((emacs (24 3))) "Genetic algorithm" single ((:commit . "a56a86591351d53ca2add7c651757bfb0064fb22") (:authors ("ROCKTAKEY" . "rocktakey@gmail.com")) (:maintainer "ROCKTAKEY" . "rocktakey@gmail.com") (:keywords "data") (:url . "https://github.com/ROCKTAKEY/egalgo"))])
+ (egg . [(20181126 500) nil "Emacs Got Git - Emacs interface to Git" tar ((:commit . "00e768a78ac3d25f457eed667d02cac568480bf9") (:authors ("Bogolisk" . "bogolisk@gmail.com")) (:maintainer "Bogolisk" . "bogolisk@gmail.com") (:keywords "git" "version control" "release management"))])
+ (egg-timer . [(20200217 1650) ((emacs (25 1))) "Commonly used intervals for setting timers while working" single ((:commit . "e3542aeb80905956b94373a222a9cbac04e6497e") (:authors ("William Carroll" . "wpcarro@gmail.com")) (:maintainer "William Carroll" . "wpcarro@gmail.com") (:url . "https://github.com/wpcarro/egg-timer.el"))])
+ (egison-mode . [(20200107 2333) nil "Egison editing mode" tar ((:commit . "dbb395b41a4e4eb69f3f045cbfbe95a1575ac45b") (:authors ("Satoshi Egi" . "egisatoshi@gmail.com")) (:maintainer "Satoshi Egi" . "egisatoshi@gmail.com") (:url . "https://github.com/egisatoshi/egison3/blob/master/elisp/egison-mode.el"))])
+ (eglot . [(20220509 1904) ((emacs (26 1)) (jsonrpc (1 0 14)) (flymake (1 2 1)) (project (0 3 0)) (xref (1 0 1)) (eldoc (1 11 0)) (seq (2 23))) "Client for Language Server Protocol (LSP) servers" single ((:commit . "ba618d2cee55c8c339d46621b7e721957cc30a72") (:authors ("João Távora" . "joaotavora@gmail.com")) (:maintainer "João Távora" . "joaotavora@gmail.com") (:keywords "convenience" "languages") (:url . "https://github.com/joaotavora/eglot"))])
+ (eglot-fsharp . [(20220409 1811) ((emacs (27 1)) (eglot (1 4)) (fsharp-mode (1 10)) (jsonrpc (1 0 14))) "fsharp-mode eglot integration" single ((:commit . "5208b54098c7534f4768b87c5f4c8a01b638737b") (:authors ("Jürgen Hötzel" . "juergen@archlinux.org")) (:maintainer "Jürgen Hötzel" . "juergen@archlinux.org") (:keywords "languages") (:url . "https://github.com/fsharp/emacs-fsharp-mode"))])
+ (eglot-java . [(20220403 1815) ((emacs (26 1)) (eglot (1 0)) (jsonrpc (1 0 0))) "Java extension for the eglot LSP client" single ((:commit . "da76eb69b3f86992d62302649a987f157b7b7371") (:authors ("Yves Zoundi" . "yves_zoundi@hotmail.com")) (:maintainer "Yves Zoundi" . "yves_zoundi@hotmail.com") (:keywords "convenience" "languages") (:url . "https://github.com/yveszoundi/eglot-java"))])
+ (eglot-jl . [(20211208 359) ((emacs (25 1)) (eglot (1 4)) (julia-mode (0 3))) "Julia support for eglot" tar ((:commit . "2e35cf9768d97a0429a72deddbe30d6d7722d454") (:authors ("Adam Beckmeyer" . "adam_git@thebeckmeyers.xyz")) (:maintainer "Adam Beckmeyer" . "adam_git@thebeckmeyers.xyz") (:keywords "convenience" "languages") (:url . "https://github.com/non-Jedi/eglot-jl"))])
+ (ego . [(20200803 1101) ((emacs (24 5)) (ht (1 5)) (mustache (0 22)) (htmlize (1 47)) (org (8 0)) (dash (2 0 0))) "a static site generator based on org mode, forked from org-page." tar ((:commit . "211c4cb2af2582849d9df984fb2346deecaf79be") (:authors ("Feng Shu <tumashu AT 163.com>") ("Kelvin Hu <ini DOT kelvin AT gmail DOT com>") ("Kuangdash <kuangdash AT 163.com>")) (:maintainer "Feng Shu <tumashu AT 163.com>") (:keywords "org-mode" "convenience" "beautify") (:url . "https://github.com/emacs-china/EGO"))])
+ (eide . [(20220316 619) nil "IDE interface" tar ((:commit . "23c78f4850f44d18eef66c694e7e05882d841ba6") (:authors ("Cédric Marie" . "cedric@hjuvi.fr.eu.org")) (:maintainer "Cédric Marie" . "cedric@hjuvi.fr.eu.org") (:url . "https://forge.chapril.org/hjuvi/eide"))])
+ (eimp . [(20120826 2039) nil "Emacs Image Manipulation Package" single ((:commit . "2e7536fe6d8f7faf1bad7a8ae37faba0162c3b4f") (:authors ("Matthew P. Hodges" . "MPHodges@member.fsf.org")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "files" "frames"))])
+ (ein . [(20220419 735) ((emacs (25)) (websocket (1 12)) (anaphora (1 0 4)) (request (0 3 3)) (deferred (0 5)) (polymode (0 2 2)) (dash (2 13 0)) (with-editor (0 -1))) "Emacs IPython Notebook" tar ((:commit . "388c8f753cfb99b4f82acbdff26bbe27189d2299") (:keywords "jupyter" "literate programming" "reproducible research") (:url . "https://github.com/dickmao/emacs-ipython-notebook"))])
+ (eink-theme . [(20190219 858) nil "E Ink color theme" single ((:commit . "326b07523dcb076d6209cdbc7fdbb73df296dbdb") (:authors ("Marian Schubert" . "marian.schubert@gmail.com")) (:maintainer "Marian Schubert" . "marian.schubert@gmail.com") (:url . "http://github.com/maio/eink-emacs"))])
+ (ejc-sql . [(20220414 1329) ((emacs (26 3)) (clomacs (0 0 5)) (dash (2 16 0)) (spinner (1 7 3)) (direx (1 0 0))) "Emacs SQL client uses Clojure JDBC." tar ((:commit . "5c6341c751da9c7dbed43eafc8e99f456c1de0d2") (:authors ("Kostafey" . "kostafey@gmail.com")) (:maintainer "Kostafey" . "kostafey@gmail.com") (:keywords "sql" "jdbc") (:url . "https://github.com/kostafey/ejc-sql"))])
+ (ejson-mode . [(20190720 2138) ((emacs (25))) "Major mode for editing ejson files." single ((:commit . "9630dfac9549779711dbe89e621f516bb4b3a354") (:authors ("Dante Catalfamo")) (:maintainer "Dante Catalfamo") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/dantecatalfamo/ejson-mode"))])
+ (el-autoyas . [(20120918 1317) nil "Automatically create Emacs-Lisp Yasnippets" tar ((:commit . "bde0251ecb504f585dfa27c205c8e312655310cc") (:authors ("Matthew L. Fidler")) (:maintainer "Matthew L. Fidler") (:keywords "emacs" "lisp" "mode" "yasnippet") (:url . "https://github.com/mlf176f2/el-autoyas.el"))])
+ (el-fetch . [(20220509 1439) ((emacs (25 1))) "Show system information in Neofetch-like style (eg CPU, RAM)" single ((:commit . "7fdb153ea2a40955ae3a9551da63d173fb59cb39") (:authors ("Maciej Barć" . "xgqt@riseup.net")) (:maintainer "Maciej Barć" . "xgqt@riseup.net") (:url . "https://gitlab.com/xgqt/emacs-el-fetch"))])
+ (el-fly-indent-mode . [(20180422 243) ((emacs (25))) "Indent Emacs Lisp on the fly" single ((:commit . "39738c88c01a3a035edffe63400d434edb1e3003") (:authors ("Jiahao Li" . "jiahaowork@gmail.com")) (:maintainer "Jiahao Li" . "jiahaowork@gmail.com") (:keywords "lisp" "languages") (:url . "https://github.com/jiahaowork/el-fly-indent-mode.el"))])
+ (el-get . [(20211224 959) nil "Manage the external elisp bits and pieces you depend upon" tar ((:commit . "9353309744e4f8a7c9b1adf22ec99536fb2146b0") (:authors ("Dimitri Fontaine" . "dim@tapoueh.org")) (:maintainer "Dimitri Fontaine" . "dim@tapoueh.org") (:keywords "emacs" "package" "elisp" "install" "elpa" "git" "git-svn" "bzr" "cvs" "svn" "darcs" "hg" "apt-get" "fink" "pacman" "http" "http-tar" "emacswiki") (:url . "http://www.emacswiki.org/emacs/el-get"))])
+ (el-init . [(20150728 920) ((emacs (24)) (cl-lib (0 5)) (anaphora (1 0 0))) "A loader inspired by init-loader" single ((:commit . "7538e1511ff7ceea2ba65ed4783c57e2f9176ee6") (:authors ("Hiroki YAMAKAWA" . "s06139@gmail.com")) (:maintainer "Hiroki YAMAKAWA" . "s06139@gmail.com") (:url . "https://github.com/HKey/el-init"))])
+ (el-init-viewer . [(20150303 828) ((emacs (24)) (cl-lib (0 5)) (ctable (0 1 2)) (dash (2 10 0)) (anaphora (1 0 0)) (el-init (0 1 4))) "Record viewer for el-init" single ((:commit . "7c0169d356d6c007317e253e5776e1e48a60d6ad") (:authors ("Hiroki YAMAKAWA" . "s06139@gmail.com")) (:maintainer "Hiroki YAMAKAWA" . "s06139@gmail.com") (:url . "https://github.com/HKey/el-init-viewer"))])
+ (el-mock . [(20170824 1954) nil "Tiny Mock and Stub framework in Emacs Lisp" single ((:commit . "6ebfe64410d54b4cf76f655e416d49935d5e2ceb") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "lisp" "testing" "unittest") (:url . "http://github.com/rejeep/el-mock.el"))])
+ (el-patch . [(20220509 2253) ((emacs (26))) "Future-proof your Elisp" tar ((:commit . "156c61b72c1c9c61bd886b5931b8a382153f52fa") (:authors ("Radian LLC" . "contact+el-patch@radian.codes")) (:maintainer "Radian LLC" . "contact+el-patch@radian.codes") (:keywords "extensions") (:url . "https://github.com/radian-software/el-patch"))])
+ (el-secretario . [(20220422 2005) ((emacs (27 1)) (org-ql (0 6 -1)) (hercules (0 3))) "Unify all your inboxes with the Emacs secretary" tar ((:commit . "c28a4f42829ed1f96a17abb63a8616216db913a5") (:authors ("Leo Okawa Ericson <http://github/Zetagon>")) (:maintainer "Leo" . "github@relevant-information.com") (:keywords "convenience") (:url . "https://git.sr.ht/~zetagon/el-secretario"))])
+ (el-secretario-elfeed . [(20211214 1851) ((emacs (27 1)) (el-secretario (0 0 1)) (elfeed (3 4 1))) "Add notmuch email inboxes to el-secretario" single ((:commit . "c28a4f42829ed1f96a17abb63a8616216db913a5") (:authors ("Leo Okawa Ericson <http://github/Zetagon>")) (:maintainer "Leo" . "github@relevant-information.com") (:keywords "convenience") (:url . "https://git.sr.ht/~zetagon/el-secretario"))])
+ (el-secretario-mu4e . [(20220422 2006) ((emacs (27 1)) (org-ql (0 6 -1)) (el-secretario (0 0 1))) "Add mu4e inboxes to el-secretario" single ((:commit . "c28a4f42829ed1f96a17abb63a8616216db913a5") (:authors ("Leo Okawa Ericson <http://github/Zetagon>")) (:maintainer "Leo" . "github@relevant-information.com") (:keywords "convenience" "mail") (:url . "https://git.sr.ht/~zetagon/el-secretario"))])
+ (el-secretario-notmuch . [(20220426 1905) ((emacs (27 1)) (el-secretario (0 0 1)) (notmuch (0 3 1))) "Add notmuch inboxes to el-secretario" single ((:commit . "c28a4f42829ed1f96a17abb63a8616216db913a5") (:authors ("Leo Okawa Ericson <http://github/Zetagon>")) (:maintainer "Leo" . "github@relevant-information.com") (:keywords "convenience" "mail") (:url . "https://git.sr.ht/~zetagon/el-secretario"))])
+ (el-secretario-org . [(20220411 1419) ((emacs (27 1)) (org-ql (0 6 -1)) (dash (2 18 1)) (el-secretario (0 0 1))) "Create inboxes out of org-mode files for el-secretario" single ((:commit . "c28a4f42829ed1f96a17abb63a8616216db913a5") (:authors ("Leo Okawa Ericson <http://github/Zetagon>")) (:maintainer "Leo" . "github@relevant-information.com") (:keywords "convenience") (:url . "https://git.sr.ht/~zetagon/el-secretario"))])
+ (el-spec . [(20121018 704) nil "ruby's rspec like syntax test frame work" single ((:commit . "1dbc465401d4aea5560318c4f13ff30920a0718d") (:authors ("Yuuki Arisawa" . "yuuki.ari@gmail.com")) (:maintainer "Yuuki Arisawa" . "yuuki.ari@gmail.com") (:keywords "test") (:url . "https://github.com/uk-ar/el-spec"))])
+ (el-spice . [(20201013 1729) nil "Extra spice for emacs lisp programming" tar ((:commit . "a1adde201ee10881b522e67aa2c605378943a28d") (:authors ("Vedang Manerikar" . "vedang.manerikar@gmail.com")) (:maintainer "Vedang Manerikar" . "vedang.manerikar@gmail.com") (:keywords "languages" "extensions") (:url . "https://github.com/vedang/el-spice"))])
+ (el-sprunge . [(20200312 1212) ((web-server (20140105 2246)) (htmlize (20130207 1202)) (emacs (24 3))) "Command line paste server with Emacs highlighting" tar ((:commit . "e4365ea0bdf60969817619376bdcc98003fec33d") (:authors ("Eric Schulte" . "schulte.eric@gmail.com")) (:maintainer "Eric Schulte" . "schulte.eric@gmail.com") (:keywords "http" "html" "server" "sprunge" "paste"))])
+ (el-spy . [(20131226 2008) nil "Mocking framework for Emacs lisp. It also support spy, proxy." single ((:commit . "b1dead9d1877660856ada22d906ac4e54695aec7") (:authors ("Yuuki Arisawa" . "yuuki.ari@gmail.com")) (:maintainer "Yuuki Arisawa" . "yuuki.ari@gmail.com") (:keywords "test") (:url . "https://github.com/uk-ar/el-spy"))])
+ (el2markdown . [(20170630 1858) nil "Convert commentary section of elisp files to markdown." single ((:commit . "368d99313683cd943c99feaffca356be60bdb636") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:url . "https://github.com/Lindydancer/el2markdown"))])
+ (el2org . [(20200408 146) ((emacs (25 1))) "Convert elisp file to org file" single ((:commit . "7db77fdd73f378d4e60e34c11bbdf00677adc32c") (:authors ("Feng Shu " . "tumashu@163.com")) (:maintainer "Feng Shu " . "tumashu@163.com") (:keywords "convenience") (:url . "https://github.com/tumashu/el2org"))])
+ (elbank . [(20180316 1343) ((emacs (25)) (seq (2 16))) "Personal finances reporting application" tar ((:commit . "fa9bc7dec0a8fd489e90b9f178719344cc8d315a") (:authors ("Nicolas Petton" . "nicolas@petton.fr")) (:maintainer "Nicolas Petton" . "nicolas@petton.fr") (:keywords "tools" "personal-finances"))])
+ (elcontext . [(20210109 1238) ((ht (2 3)) (hydra (0 14 0)) (emacs (24 3)) (f (0 20 0)) (osx-location (0 4)) (uuidgen (0 3))) "Create context specific actions" tar ((:commit . "2efd3dd8c5176c4f071bb048be6cb069b05d6e9e") (:authors ("Thomas Sojka")) (:maintainer "Thomas Sojka") (:keywords "calendar" "convenience") (:url . "https://github.com/rollacaster/elcontext"))])
+ (elcord . [(20220305 1234) ((emacs (25 1))) "Allows you to integrate Rich Presence from Discord" tar ((:commit . "70fd716e673b724b30b921f4cfa0033f9c02d0f2") (:authors ("heatingdevice") ("Wilfredo Velázquez-Rodríguez" . "zulu.inuoe@gmail.com")) (:maintainer "heatingdevice") (:keywords "games") (:url . "https://github.com/Mstrodl/elcord"))])
+ (elcouch . [(20201108 955) ((emacs (25 1)) (json-mode (1 0 0)) (libelcouch (0 11 0)) (navigel (0 3 0))) "View and manipulate CouchDB databases" single ((:commit . "3d162dda14411349e12509029d2b621c5d1edea2") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:keywords "data" "tools") (:url . "https://gitlab.petton.fr/DamienCassou/elcouch"))])
+ (eldev . [(20220501 1128) ((emacs (24 4))) "Elisp Development Tool" tar ((:commit . "7275089749779599d87bee878e5103921ea919f9") (:authors ("Paul Pogonyshev" . "pogonyshev@gmail.com")) (:maintainer "Paul Pogonyshev" . "pogonyshev@gmail.com") (:keywords "maint" "tools") (:url . "https://github.com/doublep/eldev"))])
+ (eldoc-box . [(20220506 28) ((emacs (27 1))) "Display documentation in childframe" single ((:commit . "8d523f4fddbd8986340cf76f349ab18c0b3d5581") (:authors ("Sebastien Chapuis" . "sebastien@chapu.is")) (:maintainer "Yuan Fu" . "casouri@gmail.com") (:url . "https://github.com/casouri/eldoc-box"))])
+ (eldoc-cmake . [(20190419 2244) ((emacs (25 1))) "Eldoc support for CMake" single ((:commit . "4453c03b5c95ff32842f13db2fc317fb0fe2f79e") (:authors ("Kirill Ignatiev")) (:maintainer "Kirill Ignatiev") (:url . "https://github.com/ikirill/eldoc-cmake"))])
+ (eldoc-eval . [(20220106 1951) nil "Enable eldoc support when minibuffer is in use." single ((:commit . "e91800503c90cb75dc70abe42f1d6ae499346cc1") (:authors ("Thierry Volpiatto" . "thievol@posteo.net")) (:maintainer "Thierry Volpiatto" . "thievol@posteo.net"))])
+ (eldoc-overlay . [(20220210 1358) ((emacs (24 3)) (inline-docs (1 0 1)) (quick-peek (1 0))) "Display eldoc with contextual documentation overlay." single ((:commit . "b96f5864a47407ec608c807e0d890f62b891ee03") (:authors ("stardiviner" . "numbchild@gmail.com")) (:maintainer "stardiviner" . "numbchild@gmail.com") (:keywords "documentation" "eldoc" "overlay") (:url . "https://repo.or.cz/eldoc-overlay.git"))])
+ (eldoc-stan . [(20211129 2051) ((emacs (25)) (stan-mode (10 3 0))) "Eldoc support for stan functions" tar ((:commit . "150bbbe5fd3ad2b5a3dbfba9d291e66eeea1a581") (:authors ("Kazuki Yoshida" . "kazukiyoshida@mail.harvard.edu")) (:maintainer "Kazuki Yoshida" . "kazukiyoshida@mail.harvard.edu") (:keywords "help" "tools") (:url . "https://github.com/stan-dev/stan-mode/tree/master/eldoc-stan"))])
+ (eldoc-toml . [(20211026 1122) ((emacs (24 4))) "TOML table name at point for ElDoc" single ((:commit . "61106be3c3f3a5b293c3f285eec8c6f400142b6d") (:authors ("Maor Kadosh" . "git@avocadosh.xyz")) (:maintainer "Maor Kadosh" . "git@avocadosh.xyz") (:keywords "data") (:url . "https://github.com/it-is-wednesday/eldoc-toml"))])
+ (electric-case . [(20150417 1112) nil "insert camelCase, snake_case words without \"Shift\"ing" single ((:commit . "bac64e772107e3dc721a9819f63b9ebdc28a81f7") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://hins11.yu-yake.com/"))])
+ (electric-cursor . [(20220108 2052) ((emacs (25 1))) "Change cursor automatically depending on mode" single ((:commit . "92f77b05fec80c5440a8b800b33345dabca13872") (:authors ("Case Duckworth" . "acdw@acdw.net")) (:maintainer "Case Duckworth" . "acdw@acdw.net") (:keywords "terminals" "frames") (:url . "https://github.com/duckwork/electric-cursor"))])
+ (electric-operator . [(20220417 809) ((dash (2 10 0)) (emacs (24 4))) "Automatically add spaces around operators" tar ((:commit . "f567f03da4a55d6eafa0e6e148ca4884d5370498") (:authors ("David Shepherd" . "davidshepherd7@gmail.com")) (:maintainer "David Shepherd" . "davidshepherd7@gmail.com") (:keywords "electric") (:url . "https://github.com/davidshepherd7/electric-operator"))])
+ (electric-spacing . [(20220220 1540) nil "Insert operators with surrounding spaces smartly" tar ((:commit . "c37b2502512dd49a8311d7c34e9bfd1af3d4dbcd") (:authors ("William Xu" . "william.xwl@gmail.com")) (:maintainer "William Xu" . "william.xwl@gmail.com"))])
+ (elegant-agenda-mode . [(20210115 353) ((emacs (26 1))) "An elegant theme for your org-agenda" single ((:commit . "5cbc688584ba103ea3be7d7b30e5d94e52f59eb6") (:authors ("Justin Barclay" . "justinbarclay@gmail.com")) (:maintainer "Justin Barclay" . "justinbarclay@gmail.com") (:keywords "faces") (:url . "https://github.com/justinbarclay/elegant-agenda-mode"))])
+ (elein . [(20120120 1116) nil "running leiningen commands from emacs" single ((:commit . "d4c0c0491dbb7c90e953d7a16172107c37103605") (:authors ("R.W. van 't Veer")) (:maintainer "R.W. van 't Veer") (:keywords "tools" "processes") (:url . "https://github.com/remvee/elein"))])
+ (elescope . [(20210312 1147) ((emacs (25 1)) (ivy (0 10)) (request (0 3)) (seq (2 0))) "Seach and clone projects from the minibuffer" single ((:commit . "36566c8c1f5f993f67eadc85d18539ff375c0f98") (:authors ("Stéphane Maniaci" . "stephane.maniaci@gmail.com")) (:maintainer "Stéphane Maniaci" . "stephane.maniaci@gmail.com") (:keywords "vc") (:url . "https://github.com/freesteph/elescope"))])
+ (elf-mode . [(20161009 748) ((emacs (24 3))) "Show symbols in binaries" single ((:commit . "cd280d683cd3341d8bb31af6db7e3b74a133e6ab") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "matching") (:url . "https://github.com/abo-abo/elf-mode"))])
+ (elfeed . [(20210822 2129) ((emacs (24 3))) "an Emacs Atom/RSS feed reader" tar ((:commit . "162d7d545ed41c27967d108c04aa31f5a61c8e16") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/elfeed"))])
+ (elfeed-autotag . [(20210607 637) ((emacs (27 1)) (elfeed (3 4 1)) (elfeed-protocol (0 8 0)) (org (8 2 7)) (dash (2 10 0)) (s (1 9 0))) "Easy auto-tagging for elfeed" single ((:commit . "bc62c37fb79b720ff8b6d67f04f2268841306dcd") (:authors ("Paul Elms <https://paul.elms.pro>")) (:maintainer "Paul Elms" . "paul@elms.pro") (:keywords "news") (:url . "https://github.com/paulelms/elfeed-autotag"))])
+ (elfeed-dashboard . [(20210727 603) ((emacs (25 1)) (elfeed (3 3 0))) "An extensible frontend for elfeed using org-mode" single ((:commit . "26ff3573efce3cb66c8814854a2983a69683af09") (:authors ("Manoj Kumar Manikchand" . "manojm321@protonmail.com")) (:maintainer "Manoj Kumar Manikchand" . "manojm321@protonmail.com") (:keywords "convenience") (:url . "https://github.com/Manoj321/elfeed-dashboard"))])
+ (elfeed-goodies . [(20220306 2253) ((popwin (1 0 0)) (powerline (2 2)) (elfeed (2 0 0)) (cl-lib (0 5)) (link-hint (0 1))) "Elfeed goodies" tar ((:commit . "6711de66c22360f80fcfd9730293e5f3d419f787") (:authors ("Gergely Nagy")) (:maintainer "Gergely Nagy") (:url . "https://github.com/algernon/elfeed-goodies"))])
+ (elfeed-org . [(20220420 1234) ((elfeed (1 1 1)) (org (8 2 7)) (dash (2 10 0)) (s (1 9 0)) (cl-lib (0 5))) "Configure elfeed with one or more org-mode files" single ((:commit . "e6bf4268485703907a97896fb1080f59977c9e3d") (:authors ("Remy Honig" . "remyhonig@gmail.com")) (:maintainer "Remy Honig" . "remyhonig@gmail.com") (:keywords "news") (:url . "https://github.com/remyhonig/elfeed-org"))])
+ (elfeed-protocol . [(20220419 1358) ((emacs (24 4)) (elfeed (2 1 1)) (cl-lib (0 5))) "Provide fever/newsblur/owncloud/ttrss protocols for elfeed" tar ((:commit . "eaf1329ff221098eb6d4709245010d070c89b173") (:authors ("Xu Fasheng <fasheng[AT]fasheng.info>")) (:maintainer "Xu Fasheng <fasheng[AT]fasheng.info>") (:keywords "news") (:url . "https://github.com/fasheng/elfeed-protocol"))])
+ (elfeed-score . [(20220428 123) ((emacs (26 1)) (elfeed (3 3 0))) "Gnus-style scoring for Elfeed" tar ((:commit . "419de17d681d75789271b8457509fa3f942eab54") (:authors ("Michael Herstine" . "sp1ff@pobox.com")) (:maintainer "Michael Herstine" . "sp1ff@pobox.com") (:keywords "news") (:url . "https://github.com/sp1ff/elfeed-score"))])
+ (elfeed-summary . [(20220506 720) ((emacs (27 1)) (magit-section (3 3 0)) (elfeed (3 4 1))) "Feed summary interface for elfeed" single ((:commit . "641a453cfd03e098b5e6376e035eafd080b08781") (:authors ("Korytov Pavel" . "thexcloud@gmail.com")) (:maintainer "Korytov Pavel" . "thexcloud@gmail.com") (:url . "https://github.com/SqrtMinusOne/elfeed-summary.el"))])
+ (elfeed-web . [(20210226 258) ((simple-httpd (1 5 1)) (elfeed (3 2 0)) (emacs (24 3))) "web interface to Elfeed" tar ((:commit . "162d7d545ed41c27967d108c04aa31f5a61c8e16") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/elfeed"))])
+ (elforth . [(20210522 928) ((emacs (26 1))) "Do you have what it takes to hack Emacs Lisp in Forth?" single ((:commit . "2d8540434a28e7edaa04a992c3c362832b2fd61e") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "games") (:url . "https://github.com/lassik/elforth"))])
+ (elgrep . [(20211221 852) ((emacs (26 2)) (async (1 5))) "Searching files for regular expressions" single ((:commit . "f8124c699b6a4abfb471269bc26afbcc8136f476") (:authors ("Tobias Zawada" . "i@tn-home.de")) (:maintainer "Tobias Zawada" . "i@tn-home.de") (:keywords "tools" "matching" "files" "unix") (:url . "https://github.com/TobiasZawada/elgrep"))])
+ (elhome . [(20161025 2042) ((initsplit (20120630))) "A framework for a \"home\" Emacs configuration" tar ((:commit . "e789e806469af3e9705f72298683c21f6c3a516d") (:authors ("Dave Abrahams" . "dave@boostpro.com")) (:maintainer "Demyan Rogozhin" . "demyan.rogozhin@gmail.com") (:keywords "lisp") (:url . "http://github.com/demyanrogozhin/elhome"))])
+ (elisp-def . [(20210126 750) ((dash (2 12 0)) (f (0 19 0)) (s (1 11 0)) (emacs (24 3))) "macro-aware go-to-definition for elisp" single ((:commit . "dfca043ec0cbead67bd9c526cb009daf771d0fa2") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:keywords "lisp"))])
+ (elisp-demos . [(20210312 542) ((emacs (24 4))) "Elisp API Demos" tar ((:commit . "924b07d28e4f5b82f0e1377bcde800068f0a6d9d") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:keywords "lisp" "docs") (:url . "https://github.com/xuchunyang/elisp-demos"))])
+ (elisp-depend . [(20190325 1114) nil "Parse depend libraries of elisp file." single ((:commit . "6679da9a6be5a845bb4804224c8394a9bc62168f"))])
+ (elisp-depmap . [(20220223 1131) ((emacs (26 1)) (dash (2 17 0))) "Generate an elisp dependency map in graphviz" tar ((:commit . "15909462e3f7daf445d3cecf402ee16c7e3263ed") (:authors ("Mehmet Tekman")) (:maintainer "Mehmet Tekman") (:keywords "outlines") (:url . "https://gitlab.com/mtekman/elisp-depmap.el"))])
+ (elisp-docstring-mode . [(20170304 1615) nil "Major mode for editing elisp docstrings." single ((:commit . "f512e509dd690f65133e55563ebbfd2dede5034f") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "languages"))])
+ (elisp-format . [(20160508 952) nil "Format elisp code" single ((:commit . "03cc293eb2f78ec58fc1d84279af06816a04b979") (:authors (nil . "Andy Stewart lazycat.manatee@gmail.com")) (:maintainer "Yuki Inoue inouetakahiroki _at_ gmail.com") (:url . "https://github.com/Yuki-Inoue/elisp-format"))])
+ (elisp-lint . [(20220419 252) ((emacs (24 4)) (dash (2 15 0)) (package-lint (0 11))) "Basic linting for Emacs Lisp" single ((:commit . "c5765abf75fd1ad22505b349ae1e6be5303426c2") (:authors ("Nikolaj Schumacher <bugs * nschum de>,")) (:maintainer "Neil Okamoto" . "neil.okamoto+melpa@gmail.com") (:keywords "lisp" "maint" "tools") (:url . "http://github.com/gonewest818/elisp-lint/"))])
+ (elisp-refs . [(20220220 2305) ((dash (2 12 0)) (s (1 11 0))) "find callers of elisp functions or macros" single ((:commit . "8f84280997d8b233d66fb9958a34b46078c58b03") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:keywords "lisp"))])
+ (elisp-sandbox . [(20131116 1842) nil "Evaluate EmacsLisp expressions in a sandbox" single ((:commit . "d894d68934ef09c42f72ac4e1173a0bedc23f139") (:authors ("Joel McCracken <mccracken.joel@gmail.com>, D. Goel" . "deego@gnufans.org")) (:maintainer "Joel McCracken <mccracken.joel@gmail.com>, D. Goel" . "deego@gnufans.org") (:keywords "lisp") (:url . "https://github.com/joelmccracken/elisp-sandbox"))])
+ (elisp-slime-nav . [(20210510 528) ((emacs (24 1)) (cl-lib (0 2))) "Make M-. and M-, work in elisp like they do in slime" single ((:commit . "8588d80d414aee1fafce5b9da0e913612ee0bcdd") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "languages" "navigation" "slime" "elisp" "emacs-lisp") (:url . "https://github.com/purcell/elisp-slime-nav"))])
+ (elixir-mode . [(20220314 1302) ((emacs (25))) "Major mode for editing Elixir files" tar ((:commit . "e0d0466d83ec80ddb412bb1473908a21baad1ec3") (:keywords "languages" "elixir") (:url . "https://github.com/elixir-editors/emacs-elixir"))])
+ (elixir-yasnippets . [(20150417 1239) ((yasnippet (0 8 0))) "Yasnippets for Elixir" tar ((:commit . "980ca7626c14ef0573bec0035ec7942796062783") (:authors ("Yinghai Zhao" . "zyinghai@gmail.com")) (:maintainer "Yinghai Zhao" . "zyinghai@gmail.com") (:keywords "snippets"))])
+ (ellocate . [(20200112 1931) ((emacs (25 1)) (s (1 12 0)) (f (0 20 0))) "The locate command reimplemented in Emacs Lisp" single ((:commit . "81405082f68f0577c9f176d3d4f034a7142aba59") (:authors ("Sebastian Wålinder" . "s.walinder@gmail.com")) (:maintainer "Sebastian Wålinder" . "s.walinder@gmail.com") (:keywords "matching") (:url . "https://github.com/walseb/ellocate"))])
+ (elm-mode . [(20220227 931) ((f (0 17)) (s (1 7 0)) (emacs (25 1)) (seq (2 23)) (reformatter (0 3))) "Major mode for Elm" tar ((:commit . "1e277684d8a6681a2410cce2dd589ee30a998369") (:authors ("Joseph Collard")) (:maintainer "Joseph Collard") (:url . "https://github.com/jcollard/elm-mode"))])
+ (elm-test-runner . [(20190105 1923) ((emacs (24 4))) "Enhanced support for running elm-test" single ((:commit . "a31d567a64d86d36e3675347abd696824a731e0c") (:authors ("Juan Edi")) (:maintainer "Juan Edi") (:url . "https://github.com/juanedi/elm-test-runner"))])
+ (elm-yasnippets . [(20160401 524) ((yasnippet (0 8 0))) "Yasnippets for Elm" tar ((:commit . "45a11a0cef0c36633fb3477d3dc4167e82779ba4") (:authors ("Austin Bingham" . "austin.bingham@gmail.com")) (:maintainer "Austin Bingham" . "austin.bingham@gmail.com") (:keywords "snippets"))])
+ (elmacro . [(20210716 639) ((s (1 11 0)) (dash (2 13 0))) "Convert keyboard macros to emacs lisp" single ((:commit . "d2e05012cee4f54fab6d8d8d6aced6e5eeef4f31") (:authors ("Philippe Vaucher" . "philippe.vaucher@gmail.com")) (:maintainer "Philippe Vaucher" . "philippe.vaucher@gmail.com") (:keywords "macro" "elisp" "convenience") (:url . "https://github.com/Silex/elmacro"))])
+ (elmine . [(20200520 1237) ((s (1 10 0))) "Redmine API access via elisp." single ((:commit . "c78cc8705c2dffbf649b858f02b5028225943482") (:authors ("Arthur Andersen" . "leoc.git@gmail.com")) (:maintainer "Arthur Andersen" . "leoc.git@gmail.com") (:keywords "tools") (:url . "http://github.com/leoc/elmine"))])
+ (elmpd . [(20210904 7) ((emacs (25 1))) "A tight, ergonomic, async client library for mpd" single ((:commit . "c9e413fcb6c526c86e1a64d45c7ea94aceca4e6e") (:authors ("Michael Herstine" . "sp1ff@pobox.com")) (:maintainer "Michael Herstine" . "sp1ff@pobox.com") (:keywords "comm") (:url . "https://github.com/sp1ff/elmpd"))])
+ (elnode . [(20190702 1509) ((web (0 1 4)) (dash (1 1 0)) (noflet (0 0 7)) (s (1 5 0)) (creole (0 8 14)) (fakir (0 1 6)) (db (0 0 5)) (kv (0 0 17))) "The Emacs webserver." tar ((:commit . "29ef0f51a65a24fca7fdcdb4140d2e4556e4bb29") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "GitHub user \"Jcaw\"") (:keywords "lisp" "http" "hypermedia"))])
+ (elog . [(20160724 2255) ((eieio (1 3))) "logging library extended from logito" single ((:commit . "a67237d9813c7591614d95e2ef31cc5e5ed3f31b") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "lisp" "tool" "log"))])
+ (elogcat . [(20151121 41) ((s (1 9 0)) (dash (2 10 0))) "logcat interface" single ((:commit . "4f311b7a07565b0d060334bc68edb36f2bff703f") (:authors ("Youngjoo Lee" . "youngker@gmail.com")) (:maintainer "Youngjoo Lee" . "youngker@gmail.com") (:keywords "tools"))])
+ (eloud . [(20190706 1707) ((emacs (24 4))) "A lightweight, interactive screen reader" single ((:commit . "b8f4af1f652268d73281de91fb333b5984970847") (:authors ("Patrick Smyth" . "patricksmyth01@gmail.com")) (:maintainer "Patrick Smyth" . "patricksmyth01@gmail.com") (:keywords "extensions") (:url . "https://github.com/smythp/eloud"))])
+ (elpa-audit . [(20141023 1331) nil "Handy functions for inspecting and comparing package archives" single ((:commit . "727da50e626977351aff2675b6540a36818bbbe6") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "maint") (:url . "https://github.com/purcell/elpa-audit"))])
+ (elpa-clone . [(20211205 1237) ((emacs (24 4))) "Clone ELPA archive" single ((:commit . "03d8e2af55dfb34ab9da1f9385079a995383b2ea") (:authors ("ZHANG Weiyi" . "dochang@gmail.com")) (:maintainer "ZHANG Weiyi" . "dochang@gmail.com") (:keywords "comm" "elpa" "clone" "mirror") (:url . "https://github.com/dochang/elpa-clone"))])
+ (elpa-deploy . [(20191022 718) ((emacs (24 4)) (f (0 0))) "ELPA deployment library" single ((:commit . "f5126a2da1e0e52981fad9c12028814be80328c2") (:authors ("Bruno Félix Rezende Ribeiro" . "oitofelix@gnu.org")) (:maintainer "Bruno Félix Rezende Ribeiro" . "oitofelix@gnu.org") (:keywords "tools") (:url . "https://github.com/oitofelix/elpa-deploy"))])
+ (elpa-mirror . [(20220123 1237) ((emacs (25 1))) "Create local package repository from installed packages" single ((:commit . "3e0fe0f91d1c5798752c255b89950617f88b8d9e") (:authors ("Chen Bin" . "chenbin.sh@gmail.com")) (:maintainer "Chen Bin" . "chenbin.sh@gmail.com") (:keywords "tools") (:url . "http://github.com/redguardtoo/elpa-mirror"))])
+ (elpher . [(20220503 833) ((emacs (27 1))) "A friendly gopher and gemini client" tar ((:commit . "bf0dd36eb2f5b339c6b561dbe3ee9693565b484b") (:authors ("Tim Vaughan" . "plugd@thelambdalab.xyz")) (:maintainer "Tim Vaughan" . "plugd@thelambdalab.xyz") (:keywords "comm" "gopher") (:url . "https://thelambdalab.xyz/elpher"))])
+ (elpl . [(20220314 1353) ((emacs (24 4))) "Emacs Lisp REPL" single ((:commit . "32eaec0fc7d20b8acbd4d459bfb8f8b72d75bb66") (:authors ("Gong Qijian" . "gongqijian@gmail.com")) (:maintainer "Gong Qijian" . "gongqijian@gmail.com") (:keywords "lisp" "tool") (:url . "https://github.com/twlz0ne/elpl"))])
+ (elpy . [(20220322 41) ((company (0 9 2)) (emacs (24 4)) (highlight-indentation (0 5 0)) (pyvenv (1 3)) (yasnippet (0 8 0)) (s (1 11 0))) "Emacs Python Development Environment" tar ((:commit . "1746e7009000b7635c0ea6f1559018143aa61642") (:authors ("Jorgen Schaefer <contact@jorgenschaefer.de>, Gaby Launay" . "gaby.launay@protonmail.com")) (:maintainer "Jorgen Schaefer <contact@jorgenschaefer.de>, Gaby Launay" . "gaby.launay@protonmail.com") (:keywords "python" "ide" "languages" "tools") (:url . "https://github.com/jorgenschaefer/elpy"))])
+ (elpygen . [(20171225 1736) ((emacs (25)) (yasnippet (0 8 0))) "Generate a Python function/method using a symbol under point" single ((:commit . "21929c997a05968f9eefe52b85a76ceaab3b0d81") (:authors ("Vladimir Kazanov" . "vkazanov@inbox.ru")) (:maintainer "Vladimir Kazanov" . "vkazanov@inbox.ru") (:keywords "python" "languages" "tools") (:url . "https://github.com/vkazanov/elpygen"))])
+ (elquery . [(20220331 143) ((emacs (25 1)) (dash (2 13 0))) "The HTML library for elisp" tar ((:commit . "38f3bd41096cb270919b06095da0b9ac1add4598") (:authors ("Adam Niederer")) (:maintainer "Adam Niederer") (:keywords "html" "hypermedia" "tools" "webscale") (:url . "https://github.com/AdamNiederer/elquery"))])
+ (elsa . [(20220223 2021) ((trinary (1 0 0)) (emacs (25 1)) (seq (0)) (f (0)) (dash (2 14)) (cl-lib (0 3))) "Emacs Lisp Static Analyser" tar ((:commit . "21ed4f46e2d02ffb48b3ae377b0c93732ccf3f4f") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "languages" "lisp"))])
+ (elscreen . [(20181009 451) ((emacs (24))) "Emacs window session manager" tar ((:commit . "cc58337faf5ba1eae7e87f75f6ff3758675688f2") (:authors ("Naoto Morishima" . "naoto@morishima.net")) (:maintainer "Akinori MUSHA" . "knu@iDaemons.org") (:keywords "window" "convenience") (:url . "https://github.com/knu/elscreen"))])
+ (elscreen-buffer-group . [(20200109 2338) ((emacs (24 4)) (elscreen (0)) (cl-lib (0 5))) "elscreen buffer group" single ((:commit . "b48e71d4782adfeb2958f227d78c04164d26e4bd") (:authors ("Jeff Gran" . "jeff@jeffgran.com") ("Author: Ryan C. Thompson")) (:maintainer "Jeff Gran" . "jeff@jeffgran.com") (:keywords "buffer") (:url . "https://github.com/jeffgran/elscreen-buffer-group"))])
+ (elscreen-fr . [(20160920 953) ((elscreen (0)) (seq (1 11))) "Use frame title as screen tab" single ((:commit . "6dc77e1d3f17b3f76da5ccf92b715572aa55fb85") (:authors ("Francesc Rocher" . "francesc.rocher@gmail.com")) (:maintainer "Francesc Rocher" . "francesc.rocher@gmail.com") (:url . "http://github.com/rocher/elscreen-fr"))])
+ (elscreen-mew . [(20160504 1835) ((elscreen (20120413 807))) "ElScreen Add-On for Mew" single ((:commit . "c90a23441d836da14a1cb12788432308ba58e2b6") (:authors ("Takashi Masuda" . "masutaka.net@gmail.com")) (:maintainer "Takashi Masuda" . "masutaka.net@gmail.com") (:url . "https://github.com/masutaka/elscreen-mew"))])
+ (elscreen-multi-term . [(20200417 821) ((emacs (24 4)) (elscreen (1 4 6)) (multi-term (1 3))) "Multi term for elscreen" single ((:commit . "4ea89bae0444d9d4377515929f76cb3e98140f1f") (:authors ("wamei" . "wamei.cho@gmail.com")) (:maintainer "wamei" . "wamei.cho@gmail.com") (:keywords "elscreen" "multi term"))])
+ (elscreen-separate-buffer-list . [(20200807 1324) ((emacs (24 4)) (elscreen (1 4 6))) "Separate buffer list manager for elscreen" single ((:commit . "88d8850108947949431425a2d938a09d941454e8") (:authors ("wamei" . "wamei.cho@gmail.com")) (:maintainer "wamei" . "wamei.cho@gmail.com") (:keywords "elscreen"))])
+ (elscreen-tab . [(20201229 1428) ((emacs (26)) (elscreen (20180321)) (dash (2 14 1))) "minor mode to display tabs of elscreen in a dedicated buffer" tar ((:commit . "5d7a740e47a56365413d75f4f0553de74f5ca198") (:authors ("Aki Syunsuke" . "sunny.day.dev@gmail.com")) (:maintainer "Aki Syunsuke" . "sunny.day.dev@gmail.com") (:keywords "tools" "extensions") (:url . "https://github.com/aki-s/elscreen-tab"))])
+ (elvish-mode . [(20180809 1612) ((emacs (24 3))) "Defines a major mode for Elvish" single ((:commit . "a13fcaf209d803e2e450ca2bf80dea94b40a0141") (:authors ("Adam Schwalm" . "adamschwalm@gmail.com")) (:maintainer "Adam Schwalm" . "adamschwalm@gmail.com") (:url . "https://github.com/ALSchwalm/elvish-mode"))])
+ (elwm . [(20150817 1007) ((dash (1 1 0))) "Minimalistic window manager for emacs" single ((:commit . "c33b183f006ad476c3a44dab316f580f8b369930") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "docs") (:url . "https://github.com/Fuco1/elwm"))])
+ (elx . [(20220331 2252) ((emacs (25 1))) "extract information from Emacs Lisp libraries" single ((:commit . "ea0b10340b22e8dd0454fe37ba84ff2157fada4f") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "docs" "libraries" "packages") (:url . "https://github.com/emacscollective/elx"))])
+ (emacs-everywhere . [(20220407 329) ((emacs (26 3))) "System-wide popup windows for quick edits" single ((:commit . "54b9ba1ac0d7f8b644354fd6d27c9e3aff111dcc") (:authors ("TEC <https://github.com/tecosaur>")) (:maintainer "TEC" . "tec@tecosaur.com") (:keywords "conenience" "frames") (:url . "https://github.com/tecosaur/emacs-everywhere"))])
+ (emacsc . [(20220420 1042) nil "helper for emacsc(1)" tar ((:commit . "199c08147ebe98da1004c478c92ba8866950b637") (:authors ("Akinori MUSHA" . "knu@iDaemons.org")) (:maintainer "Akinori MUSHA" . "knu@iDaemons.org") (:keywords "tools") (:url . "https://github.com/knu/emacsc"))])
+ (emacsist-view . [(20160426 1223) nil "Mode for viewing emacsist.com" single ((:commit . "f67761259ed779a9bc95c9a4e0474522990c5c6b") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "convenience" "usability") (:url . "https://github.com/lujun9972/emacsist-view"))])
+ (emacsql . [(20220408 1614) ((emacs (25 1))) "high-level SQL database front-end" tar ((:commit . "373975cbccf7776af771e23f86043b236a330702") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/emacsql"))])
+ (emacsql-mysql . [(20171219 227) ((emacs (25 1)) (emacsql (2 0 0))) "EmacSQL back-end for MySQL" single ((:commit . "373975cbccf7776af771e23f86043b236a330702") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/emacsql"))])
+ (emacsql-psql . [(20220101 1820) ((emacs (25 1)) (emacsql (2 0 0))) "EmacSQL back-end for PostgreSQL via psql" tar ((:commit . "373975cbccf7776af771e23f86043b236a330702") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/emacsql"))])
+ (emacsql-sqlite . [(20220218 1543) ((emacs (25 1)) (emacsql (2 0 0))) "EmacSQL back-end for SQLite" tar ((:commit . "373975cbccf7776af771e23f86043b236a330702") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/emacsql"))])
+ (emacsql-sqlite-builtin . [(20220422 1605) ((emacs (29)) (emacsql (3 0 0)) (emacsql-sqlite (3 0 0))) "EmacSQL back-end for SQLite using builtin support" single ((:commit . "3e820c66fdaa9937f9e612900954dcd6c7d01943") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "data") (:url . "https://github.com/emacscollective/emacsql-sqlite-builtin"))])
+ (emacsql-sqlite-module . [(20220422 1605) ((emacs (25)) (emacsql (3 0 0)) (emacsql-sqlite (3 0 0)) (sqlite3 (0 15))) "EmacSQL back-end for SQLite using a module" single ((:commit . "3e820c66fdaa9937f9e612900954dcd6c7d01943") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "data") (:url . "https://github.com/emacscollective/emacsql-sqlite-builtin"))])
+ (emacsql-sqlite3 . [(20220304 1014) ((emacs (26 1)) (emacsql (3 0 0))) "Yet another EmacSQL backend for SQLite" single ((:commit . "2113618732665f2112cb932a66c0e89c404d8777") (:authors ("Zhu Zihao" . "all_but_last@163.com")) (:maintainer "Zhu Zihao" . "all_but_last@163.com") (:keywords "extensions") (:url . "https://github.com/cireu/emacsql-sqlite3"))])
+ (emacsshot . [(20191206 944) ((emacs (24 4))) "Snapshot a frame or window from within" tar ((:commit . "fe958b11056f3c671ebdd604d5aa574323284ca5") (:authors ("Marco Wahl" . "marcowahlsoft@gmail.com")) (:maintainer "Marco Wahl") (:keywords "convenience") (:url . "https://gitlab.com/marcowahl/emacsshot"))])
+ (emamux . [(20200315 1220) ((emacs (24 3))) "Interact with tmux" single ((:commit . "6172131d78038f0b1490e24bac60534bf4ad3b30") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-emamux"))])
+ (emamux-ruby-test . [(20130812 1639) ((emamux (0 1)) (projectile (0 9 1))) "Ruby test with emamux" single ((:commit . "23b73c650573b340351a919da3da416acfc2ac84") (:url . "https://github.com/syohex/emamux-ruby-test"))])
+ (emaps . [(20200508 1759) ((dash (2 17 0)) (emacs (24))) "Utilities for working with keymaps" single ((:commit . "7c561f3ded2015ed3774e5784059d6601082743e") (:authors ("Ben Moon" . "software@guiltydolphin.com")) (:maintainer "Ben Moon" . "software@guiltydolphin.com") (:keywords "convenience" "keyboard" "keymap" "utility") (:url . "https://github.com/GuiltyDolphin/emaps"))])
+ (embark . [(20220509 2259) ((emacs (26 1))) "Conveniently act on minibuffer completions" tar ((:commit . "81c7f751be1de33dee9f7523fd3429ee3fe9a0d1") (:authors ("Omar Antolín Camarena" . "omar@matem.unam.mx")) (:maintainer "Omar Antolín Camarena" . "omar@matem.unam.mx") (:keywords "convenience") (:url . "https://github.com/oantolin/embark"))])
+ (embark-consult . [(20220507 143) ((emacs (27 1)) (embark (0 12)) (consult (0 10))) "Consult integration for Embark" single ((:commit . "81c7f751be1de33dee9f7523fd3429ee3fe9a0d1") (:authors ("Omar Antolín Camarena" . "omar@matem.unam.mx")) (:maintainer "Omar Antolín Camarena" . "omar@matem.unam.mx") (:keywords "convenience") (:url . "https://github.com/oantolin/embark"))])
+ (ember-mode . [(20200208 1423) ((cl-lib (0 5))) "Ember navigation mode for emacs" single ((:commit . "a587c423041b2fcb065fd5b6a03b2899b764e462") (:authors ("Aad Versteden" . "madnificent@gmail.com")) (:maintainer "Aad Versteden" . "madnificent@gmail.com") (:keywords "ember" "ember.js" "emberjs"))])
+ (ember-yasnippets . [(20160526 1658) ((yasnippet (0 8 0))) "Snippets for Ember.js development" tar ((:commit . "3b5bd01569646237bf1b540d097e12f9118b67f4") (:authors ("Ron White" . "ronco@costite.com")) (:maintainer "Ron White" . "ronco@costite.com") (:keywords "tools" "abbrev" "languages"))])
+ (embrace . [(20171031 1833) ((cl-lib (0 5)) (expand-region (0 10 0))) "Add/Change/Delete pairs based on `expand-region'" single ((:commit . "dd5da196e5bcc5e6d87e1937eca0c21da4334ef2") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions"))])
+ (emidje . [(20190209 1726) ((emacs (25)) (cider (0 17 0)) (seq (2 16)) (magit-popup (2 4 0))) "Test runner and report viewer for Midje" single ((:commit . "7e92f053964d925c97dc8cca8d4d70a3030021db") (:authors ("Alan Ghelardi" . "alan.ghelardi@nubank.com.br")) (:maintainer "Alan Ghelardi" . "alan.ghelardi@nubank.com.br") (:keywords "tools") (:url . "https://github.com/nubank/emidje"))])
+ (emmet-mode . [(20210820 1124) nil "Unofficial Emmet's support for emacs" single ((:commit . "6b2e554f7fd27f732810f4b14ea01e3c54b7b3da") (:authors ("Shin Aoyama" . "smihica@gmail.com")) (:maintainer "Shin Aoyama" . "smihica@gmail.com") (:keywords "convenience") (:url . "https://github.com/smihica/emmet-mode"))])
+ (emms . [(20220422 1318) ((cl-lib (0 5)) (nadvice (0 3)) (seq (0))) "The Emacs Multimedia System" tar ((:commit . "22f3d9e5359c565b33f55715f90fbde35e4f675e") (:authors ("Jorgen Schäfer" . "forcer@forcix.cx")) (:maintainer "Yoni Rabkin" . "yrk@gnu.org") (:keywords "emms" "mp3" "ogg" "flac" "music" "mpeg" "video" "multimedia") (:url . "https://www.gnu.org/software/emms/"))])
+ (emms-bilibili . [(20180103 418) ((emacs (25)) (cl-lib (0 5))) "Play Bilibili in EMMS." single ((:commit . "294bca3dfc42fe3a55fb326ab39bc0fcfc8c5090") (:keywords "emms" "bilibili") (:url . "https://github.com/stardiviner/emms-bilibili"))])
+ (emms-info-mediainfo . [(20131223 1300) ((emms (0))) "Info-method for EMMS using medianfo" single ((:commit . "bce16eae9eacd38719fea62a9755225a888da59d") (:authors ("Fabián Ezequiel Gallina" . "fgallina@gnu.org")) (:maintainer "Fabián Ezequiel Gallina" . "fgallina@gnu.org") (:keywords "multimedia" "processes"))])
+ (emms-mark-ext . [(20130529 327) ((emms (3 0))) "Extra functions for emms-mark-mode and emms-tag-edit-mode" single ((:commit . "ec68129e3e9e469e5bf160c6a1b7030e322f3541") (:authors ("Joe Bloggs" . "vapniks@yahoo.com")) (:maintainer "Joe Bloggs" . "vapniks@yahoo.com") (:keywords "convenience" "multimedia") (:url . "https://github.com/vapniks/emms-mark-ext"))])
+ (emms-mode-line-cycle . [(20160221 1120) ((emacs (24)) (emms (4 0))) "Display the emms mode line as a ticker" single ((:commit . "2c2f395e484a1d345050ddd61ff5fab71a92a6bc") (:authors ("momomo5717")) (:maintainer "momomo5717") (:keywords "emms" "mode-line") (:url . "https://github.com/momomo5717/emms-mode-line-cycle"))])
+ (emms-player-mpv-jp-radios . [(20180325 1117) ((emacs (24)) (cl-lib (0 5)) (emms (4 0)) (emms-player-simple-mpv (0 1 7))) "EMMS players and stream lists of Japan radio stations" tar ((:commit . "f6b37f5878c741124d5fca43c5b80af873541edd") (:keywords "emms" "mpv" "radio") (:url . "https://github.com/momomo5717/emms-player-mpv-jp-radios"))])
+ (emms-player-simple-mpv . [(20180316 1549) ((emacs (24)) (cl-lib (0 5)) (emms (4 0))) "An extension of emms-player-simple.el for mpv JSON IPC" tar ((:commit . "101d120ccdee1c2c213fd2f0423c858b21649c00") (:authors ("momomo5717")) (:maintainer "momomo5717") (:keywords "emms" "mpv") (:url . "https://github.com/momomo5717/emms-player-simple-mpv"))])
+ (emms-soundcloud . [(20131221 1145) ((emms (20131016)) (json (1 2))) "EMMS source for Soundcloud audio sharing platform" single ((:commit . "87e5cbf9609d1f26c24dc834fdeb78b33d453c2b") (:authors ("Ozan Sener" . "ozan@ozansener.com")) (:maintainer "Ozan Sener" . "ozan@ozansener.com") (:keywords "emms" "soundcloud") (:url . "http://github.com/osener/emms-soundcloud"))])
+ (emms-state . [(20211023 1942) ((emms (0))) "Display track description and playing time in the mode line" single ((:commit . "cdb3ee85369758727b3c082e4ade1ae2b559b334") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "emms") (:url . "https://github.com/alezost/emms-state.el"))])
+ (emoji-cheat-sheet-plus . [(20200202 1404) ((emacs (24)) (helm (1 6 4))) "emoji-cheat-sheet for emacs" tar ((:commit . "ffcc84d7060dfa000148e7f8be4fd6701593a74f") (:authors ("Sylvain Benner (based on the work of Shingo Fukuyama)")) (:maintainer "Sylvain Benner (based on the work of Shingo Fukuyama)") (:keywords "emacs" "emoji") (:url . "https://github.com/syl20bnr/emacs-emoji-cheat-sheet-plus"))])
+ (emoji-display . [(20140117 1013) nil "emoji displaying module" single ((:commit . "bb4217f6400151a9cfa6d4524b8427f01feb5193") (:authors ("Kazuhiro Ito" . "kzhr@d1.dion.ne.jp")) (:maintainer "Kazuhiro Ito" . "kzhr@d1.dion.ne.jp") (:keywords "emoji") (:url . "https://github.com/ikazuhiro/emoji-display"))])
+ (emoji-fontset . [(20160726 1924) nil "Set font face for Emoji." single ((:commit . "8f159e8073b9b57a07a54b549df687424eeb98ee") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "emoji" "font" "config"))])
+ (emoji-github . [(20200825 425) ((emacs (24 4)) (emojify (1 0)) (request (0 3 0))) "Display list of GitHub's emoji. (cheat sheet)" single ((:commit . "434ccc9df8eb884f248d5934e7d465348bb203a4") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/emoji-github"))])
+ (emoji-recall . [(20160723 2208) ((emacs (24))) "How many emoji can you recall from memory?" tar ((:commit . "d9122f8fb1467309260109a1985cd14f18fdf631") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "game") (:url . "https://github.com/lujun9972/emoji-recall.el"))])
+ (emojify . [(20210108 1111) ((seq (1 11)) (ht (2 0)) (emacs (24 3))) "Display emojis in Emacs" tar ((:commit . "1b726412f19896abf5e4857d4c32220e33400b55") (:authors ("Iqbal Ansari" . "iqbalansari02@yahoo.com")) (:maintainer "Iqbal Ansari" . "iqbalansari02@yahoo.com") (:keywords "multimedia" "convenience") (:url . "https://github.com/iqbalansari/emacs-emojify"))])
+ (emojify-logos . [(20180814 917) ((emojify (0 4))) "Add logos to emojify" tar ((:commit . "a3e78bcbdf863092d4c9b026ac08bf7d1c7c0e8b") (:authors ("mxgoldstein" . "m_goldstein@gmx.net")) (:maintainer "mxgoldstein" . "m_goldstein@gmx.net") (:url . "https://github.com/mxgoldstein/emojify-logos"))])
+ (empos . [(20151011 1916) nil "Locate bibtex citations from within emacs" single ((:commit . "7b99ad30e56937adb7e6349777e5a2045597d564") (:authors ("Dimitris Alikaniotis <da352 [at] cam.ac.uk>")) (:maintainer "Dimitris Alikaniotis <da352 [at] cam.ac.uk>") (:keywords "citations" "reference" "bibtex" "reftex") (:url . "http://github.com/dimalik/empos/"))])
+ (emr . [(20220108 548) ((s (1 3 1)) (dash (1 2 0)) (cl-lib (0 2)) (popup (0 5 0)) (emacs (24 1)) (list-utils (0 3 0)) (paredit (24 0 0)) (projectile (0 9 1)) (clang-format (0 0 1)) (iedit (0 97))) "Emacs refactoring system." tar ((:commit . "cac1b52932926f56d7f6d2923732d20bbd20670d") (:authors ("Chris Barrett" . "chris.d.barrett@me.com")) (:maintainer "Chris Barrett" . "chris.d.barrett@me.com") (:keywords "tools" "convenience" "refactoring") (:url . "https://github.com/Wilfred/emacs-refactor"))])
+ (enclose . [(20121008 1614) nil "Enclose cursor within punctuation pairs." tar ((:commit . "2747653e84af39017f503064bc66ed1812a77259") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "speed" "convenience") (:url . "http://github.com/rejeep/enclose"))])
+ (encourage-mode . [(20151128 905) ((emacs (24 4))) "Encourages you in your work. :D" single ((:commit . "99edacf2d94d168d3da0609860dc7253db7c9815") (:authors ("Patrick Mosby" . "patrick@schreiblogade.de")) (:maintainer "Patrick Mosby" . "patrick@schreiblogade.de") (:keywords "fun") (:url . "https://github.com/halbtuerke/encourage-mode.el"))])
+ (engine-mode . [(20200611 1825) ((cl-lib (0 5))) "Define and query search engines from within Emacs." single ((:commit . "e0910f141f2d37c28936c51c3c8bb8a9ca0c01d1") (:authors ("Harry R. Schwartz" . "hello@harryrschwartz.com")) (:maintainer "Harry R. Schwartz" . "hello@harryrschwartz.com") (:url . "https://github.com/hrs/engine-mode"))])
+ (enh-ruby-mode . [(20220426 1750) ((emacs (24 3))) "Major mode for editing Ruby files" tar ((:commit . "f240ac00ccbbd0916b5e3d272c0064a26f527ef8") (:authors ("Geoff Jacobsen")) (:maintainer "Ryan Davis") (:keywords "languages" "elisp" "ruby") (:url . "http://github.com/zenspider/Enhanced-Ruby-Mode"))])
+ (enlightened-theme . [(20210220 2327) nil "A theme based on enlightened" single ((:commit . "1bfebd8f47e8a8357c9e557cf6e95d7027861e6d") (:url . "https://hg.sr.ht/~slondr/enlightened"))])
+ (enlive . [(20170725 1417) nil "query html document with css selectors" single ((:commit . "604a8ca272b6889f114e2b5a13adb5b1dc4bae86") (:authors ("ZHOU Feng" . "zf.pascal@gmail.com")) (:maintainer "ZHOU Feng" . "zf.pascal@gmail.com") (:keywords "css" "selector" "query") (:url . "http://github.com/zweifisch/enlive"))])
+ (eno . [(20191013 1239) ((dash (2 12 1)) (edit-at-point (1 0))) "Goto/copy/cut any word/symbol/line in view, similar to ace-jump/easymotion" single ((:commit . "c5c6193687c0bede1ddf507c430cf8b0a6d272d9") (:authors (nil . "<e.enoson@gmail.com>")) (:maintainer nil . "<e.enoson@gmail.com>") (:url . "http://github.com/enoson/eno.el"))])
+ (enotify . [(20130407 1348) nil "A networked notification system for emacs" tar ((:commit . "7fd2f48ef4ff32c8f013c634ea2dd6b1d1409f80") (:authors ("Alessandro Piras" . "laynor@gmail.com")) (:maintainer "Alessandro Piras" . "laynor@gmail.com") (:keywords "tools"))])
+ (envrc . [(20220218 1627) ((seq (2)) (emacs (24 4)) (inheritenv (0 1))) "Support for `direnv' that operates buffer-locally" single ((:commit . "4730b31ff1479b6d822ccc7517251dcb52de45b3") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "processes" "tools") (:url . "https://github.com/purcell/envrc"))])
+ (eopengrok . [(20200205 624) ((s (1 9 0)) (dash (2 10 0)) (magit (2 1 0)) (cl-lib (0 5))) "opengrok interface for emacs" single ((:commit . "6fa16c4ccaaebaef64dca0d3d29904c45fd6597d") (:authors ("Youngjoo Lee" . "youngker@gmail.com")) (:maintainer "Youngjoo Lee" . "youngker@gmail.com") (:keywords "tools"))])
+ (epc . [(20140610 534) ((concurrent (0 3 1)) (ctable (0 1 2))) "A RPC stack for the Emacs Lisp" tar ((:commit . "e1bfa5ca163273859336e3cc89b4b6460f7f8cda") (:authors ("SAKURAI Masashi <m.sakurai at kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai at kiwanami.net>") (:keywords "lisp" "rpc") (:url . "https://github.com/kiwanami/emacs-epc"))])
+ (epic . [(20170210 23) ((htmlize (1 47))) "Evernote Picker for Cocoa Emacs" single ((:commit . "a41826c330eb0ea061d58a08cc861b0c4ac8ec4e") (:authors ("Yoshinari Nomura" . "nom@quickhack.net")) (:maintainer "Yoshinari Nomura" . "nom@quickhack.net") (:keywords "evernote" "applescript") (:url . "https://github.com/yoshinari-nomura/epic"))])
+ (eping . [(20201027 2149) ((emacs (25 1))) "Ping websites to check internet connectivity" tar ((:commit . "99d3a4b6973d5b09864e0af7425a61f99c19b90a") (:authors ("Sean Hutchings" . "seanhut@yandex.com")) (:maintainer "Sean Hutchings" . "seanhut@yandex.com") (:keywords "comm" "processes" "terminals" "unix") (:url . "https://github.com/sean-hut/eping"))])
+ (epkg . [(20220503 1115) ((emacs (25 1)) (compat (28 1 1 0)) (closql (20210927))) "Browse the Emacsmirror package database" tar ((:commit . "fb86b5edd910b2571fc21477d0dac90be97a8f61") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "tools") (:url . "https://github.com/emacscollective/epkg"))])
+ (epkg-marginalia . [(20220424 2211) ((emacs (26)) (compat (28 1 1 0)) (epkg (3 3 1)) (marginalia (0 12))) "Show Epkg information in completion annotations" single ((:commit . "ac43d5797300ac478e8dc862ec572b67ae4d5d86") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "tools") (:url . "https://github.com/emacscollective/epkg-marginalia"))])
+ (epl . [(20180205 2049) ((cl-lib (0 3))) "Emacs Package Library" single ((:commit . "78ab7a85c08222cd15582a298a364774e3282ce6") (:authors ("Sebastian Wiesner" . "swiesner@lunaryorn.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "convenience") (:url . "http://github.com/cask/epl"))])
+ (epm . [(20190509 443) ((emacs (24 3)) (epl (0 8))) "Emacs Package Manager" tar ((:commit . "6375ddbf93c5f25647f6ebb25b54045b3c93a5be") (:authors ("Chunyang Xu" . "xuchunyang.me@gmail.com")) (:maintainer "Chunyang Xu" . "xuchunyang.me@gmail.com") (:url . "https://github.com/xuchunyang/epm"))])
+ (epresent . [(20160411 201) ((org (8)) (cl-lib (0 5))) "Simple presentation mode for Emacs Org-mode" single ((:commit . "6c8abedcf46ff08091fa2bba52eb905c6290057d") (:keywords "gui") (:url . "https://github.com/dakrone/epresent"))])
+ (eproject . [(20180312 1642) ((helm (1 6 4))) "assign files to projects, programatically" tar ((:commit . "068218d2cf2138cb2e8fc29b57e773a0097a7e8b") (:authors ("Jonathan Rockway" . "jon@jrock.us")) (:maintainer "Jonathan Rockway" . "jon@jrock.us") (:keywords "programming" "projects"))])
+ (equake . [(20220424 350) ((emacs (26 1)) (dash (2 14 1))) "Drop-down console for (e)shell & terminal emulation" single ((:commit . "ea5c0570f58b8e62249e001ed434a1056a50abe7") (:authors ("Benjamin Slade" . "slade@lambda-y.net")) (:maintainer "Benjamin Slade" . "slade@lambda-y.net") (:keywords "convenience" "frames" "terminals" "tools" "window-system") (:url . "https://gitlab.com/emacsomancer/equake"))])
+ (eradio . [(20210327 1000) ((emacs (24 1))) "A simple Internet radio player" single ((:commit . "47769986c79def84307921f0277e9bb2714756c2") (:authors ("Olav Fosse" . "mail@olavfosse.no")) (:maintainer "Olav Fosse" . "mail@olavfosse.no") (:url . "https://github.com/fossegrim/eradio"))])
+ (erblint . [(20200622 5) ((emacs (24))) "An interface for checking HTML ERB files using Erblint" single ((:commit . "89af42f776d8dc656104322edaace2ede7499932") (:authors ("Leonardo Santos")) (:maintainer "Leonardo Santos") (:keywords "project" "convenience") (:url . "https://github.com/leodcs/erblint-emacs"))])
+ (erc-colorize . [(20170107 1339) nil "Per user colorization of whole message" single ((:commit . "d026a016dcb9d63d9ac66d30627a92a8f1681bbd") (:authors ("Sylvain Rousseau <thisirs at gmail dot com>")) (:maintainer "Sylvain Rousseau <thisirs at gmail dot com>") (:keywords "erc" "convenience") (:url . "https://github.com/thisirs/erc-colorize.git"))])
+ (erc-crypt . [(20200516 2054) ((cl-lib (0 5))) "Symmetric Encryption for ERC" single ((:commit . "be87248435509f83c56a7f08ac9bcbbd3b20d780") (:authors ("xristos" . "xristos@sdf.org")) (:maintainer "xristos" . "xristos@sdf.org") (:keywords "comm") (:url . "https://github.com/atomontage/erc-crypt"))])
+ (erc-hl-nicks . [(20200317 16) nil "ERC nick highlighter that ignores uniquifying chars when colorizing" single ((:commit . "a67fe361c8f2aa20fc235447fbb898f424b51439") (:authors ("David Leatherman" . "leathekd@gmail.com")) (:maintainer "David Leatherman" . "leathekd@gmail.com") (:url . "http://www.github.com/leathekd/erc-hl-nicks"))])
+ (erc-image . [(20210604 753) nil "Show received image urls in the ERC buffer" single ((:commit . "883084f0801d46a5ccf183e51ae9a734755bbb97") (:authors ("Jon de Andrés Frías" . "jondeandres@gmail.com") ("Raimon Grau Cuscó" . "raimonster@gmail.com")) (:maintainer "Jon de Andrés Frías" . "jondeandres@gmail.com") (:keywords "multimedia"))])
+ (erc-matterircd . [(20210804 504) ((emacs (27 1))) "Integrate matterircd with ERC" single ((:commit . "e3a59267c044474f9ca066d36517e9a3d872759c") (:authors ("Alex Murray" . "murray.alex@gmail.com")) (:maintainer "Alex Murray" . "murray.alex@gmail.com") (:url . "https://github.com/alexmurray/erc-matterircd"))])
+ (erc-scrolltoplace . [(20180608 606) ((emacs (24 0)) (switch-buffer-functions (0 0 1))) "An Erc module to scrolltobottom better with keep-place" single ((:commit . "38cfd0c2e2f5f6533b217189c3afaf6640b5602e") (:authors ("Jay Kamat" . "jaygkamat@gmail.com")) (:maintainer "Jay Kamat" . "jaygkamat@gmail.com") (:keywords "erc" "module" "comm" "scrolltobottom" "keep-place") (:url . "http://gitlab.com/jgkamat/erc-scrolltoplace"))])
+ (erc-social-graph . [(20150508 1204) nil "A social network graph module for ERC." single ((:commit . "e6ef3416a1c5064054bf054d9f0c1c7bf54a9cd0") (:authors ("Vibhav Pant" . "vibhavp@gmail.com")) (:maintainer "Vibhav Pant" . "vibhavp@gmail.com") (:keywords "erc" "graph") (:url . "https://github.com/vibhavp/erc-social-graph"))])
+ (erc-terminal-notifier . [(20140115 1024) nil "OSX notifications via the terminal-notifier gem for Emacs ERC." single ((:commit . "a3dacb935845e4a20031212bbd82b2170f68d2a8") (:authors ("Julien Blanchard" . "julien@sideburns.eu")) (:maintainer "Julien Blanchard" . "julien@sideburns.eu") (:keywords "erc" "terminal-notifier" "nick") (:url . "http://github.com/julienXX/"))])
+ (erc-track-score . [(20130328 1215) nil "Add score support to tracked channel buffers" single ((:commit . "5b27531ea6b1a4c4b703b270dfa9128cb5bfdaa3") (:authors ("Julien Danjou" . "julien@danjou.info")) (:maintainer "Julien Danjou" . "julien@danjou.info") (:url . "http://julien.danjou.info/erc-track-score.html"))])
+ (erc-tweet . [(20150920 1258) nil "shows text of a tweet when an url is posted in erc buffers" single ((:commit . "91fed61e139fa788d66a7358f0d50acc896414b8") (:authors ("Raimon Grau" . "raimonster@gmail.com")) (:maintainer "Raimon Grau" . "raimonster@gmail.com") (:keywords "extensions"))])
+ (erc-twitch . [(20170427 606) ((json (1 3)) (erc (5 0))) "Support for Twitch emotes for ERC." single ((:commit . "53c6af0cb72e56d897d30a40e7e5066668d6b5ec") (:authors ("Vibhav Pant" . "vibhavp@gmail.com")) (:maintainer "Vibhav Pant" . "vibhavp@gmail.com") (:keywords "twitch" "erc" "emotes") (:url . "https://github.com/vibhavp/erc-twitch"))])
+ (erc-view-log . [(20140227 2039) nil "Major mode for viewing ERC logs" single ((:commit . "c5a25f0cbca84ed2e4f72068c02b66bd0ea3b266") (:authors ("Antoine Levitt") ("Thomas Riccardi" . "riccardi.thomas@gmail.com")) (:maintainer "Antoine Levitt") (:keywords "erc" "viewer" "logs" "colors") (:url . "http://github.com/Niluge-KiWi/erc-view-log/raw/master/erc-view-log.el"))])
+ (erc-yank . [(20210220 1815) nil "Automagically create a Gist if pasting more than 5 lines" single ((:commit . "55d96f18c5df9d8fce51fa073d7a12c47a46ac80") (:authors ("John Wiegley" . "jwiegley@gmail.com")) (:maintainer "John Wiegley" . "jwiegley@gmail.com") (:keywords "comm" "erc" "chat" "irc" "yank" "gist") (:url . "https://github.com/jwiegley/erc-yank"))])
+ (erc-youtube . [(20150603 2136) nil "Show info about a YouTube URL in an ERC buffer." single ((:commit . "97054ba8475b442e2aa81e5a291f668b7f28697f") (:authors ("Raimon Grau Cuscó" . "raimonster@gmail.com")) (:maintainer "Raimon Grau Cuscó" . "raimonster@gmail.com") (:keywords "multimedia"))])
+ (erc-yt . [(20150426 1249) ((dash (2 10 0))) "An erc module to display youtube links nicely" single ((:commit . "43e7d49325b17a3217a6ffb4a9daf75c5ff4e6f8") (:authors ("William Stevenson" . "yhvh2000@gmail.com")) (:maintainer "William Stevenson" . "yhvh2000@gmail.com") (:keywords "multimedia"))])
+ (ercn . [(20150523 1503) nil "Flexible ERC notifications" single ((:commit . "79a4df5609046ae2e2e3375998287be6dda80615") (:authors ("David Leatherman" . "leathekd@gmail.com")) (:maintainer "David Leatherman" . "leathekd@gmail.com") (:url . "http://www.github.com/leathekd/ercn"))])
+ (ereader . [(20170810 501) ((emacs (24 4)) (dash (2 12 1)) (s (1 10 0)) (xml+ (0 0 0))) "Major mode for reading ebooks with org-mode integration" tar ((:commit . "f3bbd3f13195f8fba3e3c880aab0e4c60430dcf3") (:authors ("Ben Dean" . "bendean837@gmail.com")) (:maintainer "Ben Dean" . "bendean837@gmail.com") (:keywords "epub" "ebook") (:url . "https://github.com/bddean/emacs-ereader"))])
+ (eredis . [(20181119 131) ((dash (0))) "eredis, a Redis client in emacs lisp" single ((:commit . "bc86b9f63a3e7a5eb263875030d0e15d6f5f6e37") (:authors ("Justin Heyes-Jones" . "justinhj@gmail.com")) (:maintainer "Justin Heyes-Jones" . "justinhj@gmail.com") (:keywords "redis" "api" "tools" "org") (:url . "http://github.com/justinhj/eredis/"))])
+ (erefactor . [(20200513 1252) ((cl-lib (0 3))) "Emacs-Lisp refactoring utilities" single ((:commit . "bfe27a1b8c7cac0fe054e76113e941efa3775fe8") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "extensions" "tools" "maint") (:url . "https://github.com/mhayashi1120/Emacs-erefactor"))])
+ (ergoemacs-mode . [(20220411 338) ((emacs (24 1)) (cl-lib (0 5))) "Emacs mode based on common modern interface and ergonomics." tar ((:commit . "9cd89eef490f6c9f4af273bb3dd2c68d5ed2de61") (:authors ("Xah Lee" . "xah@xahlee.org") ("David Capello" . "davidcapello@gmail.com") ("Matthew L. Fidler" . "matthew.fidler@gmail.com") ("Kim F. Storm" . "storm@cua.dk")) (:maintainer "Matthew L. Fidler" . "matthew.fidler@gmail.com") (:keywords "convenience") (:url . "https://github.com/ergoemacs/ergoemacs-mode"))])
+ (ergoemacs-status . [(20160318 538) ((powerline (2 3)) (mode-icons (0 1 0))) "Adaptive Status Bar / Mode Line" single ((:commit . "d952cc2361adf6eb4d6af60950ad4ab699c81320") (:authors ("Matthew Fidler")) (:maintainer "Matthew Fidler"))])
+ (eri . [(20200914 644) nil "Enhanced relative indentation (eri)" single ((:commit . "9a5f2b4a8cd14edbde9d16dcdfcb8db2a91be0d8") (:url . "https://github.com/agda/agda"))])
+ (erlang . [(20220215 1844) ((emacs (24 1))) "Erlang major mode" tar ((:commit . "9962287133b7107c34931f91d11aea6bea8fa4d1") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "erlang" "languages" "processes"))])
+ (erlstack-mode . [(20210419 1917) ((emacs (25 1)) (dash (2 12 0))) "Minor mode for analysing Erlang stacktraces" single ((:commit . "ca264bca24cdaa8b2bac57882716f03f633e42b0") (:authors ("k32")) (:maintainer "k32") (:keywords "tools" "erlang") (:url . "https://github.com/k32/erlstack-mode"))])
+ (eros . [(20180415 618) ((emacs (24 4))) "Evaluation Result OverlayS for Emacs Lisp" single ((:commit . "dd8910279226259e100dab798b073a52f9b4233a") (:authors ("Tianxiang Xiong" . "tianxiang.xiong@gmail.com")) (:maintainer "Tianxiang Xiong" . "tianxiang.xiong@gmail.com") (:keywords "convenience" "lisp") (:url . "https://github.com/xiongtx/eros"))])
+ (ert-async . [(20200105 1031) ((emacs (24 1))) "Async support for ERT" single ((:commit . "948cf2faa10e085bda3739034ca5ea1912893433") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "lisp" "test") (:url . "http://github.com/rejeep/ert-async.el"))])
+ (ert-expectations . [(20121009 734) nil "The simplest unit test framework in the world" single ((:commit . "aed70e002c4305b66aed7f6d0d48e9addd2dc1e6") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "test" "unittest" "ert" "expectations") (:url . "http://www.emacswiki.org/emacs/download/ert-expectations.el"))])
+ (ert-junit . [(20190802 2232) ((ert (0)) (emacs (23 4))) "JUnit XML reports from ert results" single ((:commit . "65f91c35b088b87943dbbbe7e1ce354bc9bc0992") (:authors ("Ola Nilsson" . "ola.nilsson@gmail.com")) (:maintainer "Ola Nilsson" . "ola.nilsson@gmail.com") (:keywords "tools" "test" "unittest" "ert") (:url . "http://bitbucket.org/olanilsson/ert-junit"))])
+ (ert-modeline . [(20140115 1015) ((s (1 3 1)) (dash (1 2 0)) (emacs (24 1)) (projectile (0 9 1))) "displays ert test results in the modeline." single ((:commit . "e7be2b81191afb437b70368a819770f8f750e4af") (:authors ("Chris Barrett" . "chris.d.barrett@me.com")) (:maintainer "Chris Barrett" . "chris.d.barrett@me.com") (:keywords "tools" "tests" "convenience"))])
+ (ert-runner . [(20201005 2336) ((s (1 6 1)) (dash (1 8 0)) (f (0 10 0)) (commander (0 2 0)) (ansi (0 1 0)) (shut-up (0 1 0))) "Opinionated Ert testing workflow" tar ((:commit . "80cf4f60ec8c1f04f58054ed8ad2dcfacc17d8b5") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "test") (:url . "http://github.com/rejeep/ert-runner.el"))])
+ (es-lib . [(20141111 1830) ((cl-lib (0 3))) "A collection of emacs utilities" tar ((:commit . "753b27363e39c10edc9e4e452bdbbbe4d190df4a") (:authors ("sabof")) (:maintainer "sabof") (:url . "https://github.com/sabof/es-lib"))])
+ (es-mode . [(20201125 2059) ((dash (2 11 0)) (cl-lib (0 5)) (spark (1 0)) (s (1 11 0)) (request (0 3 0))) "A major mode for editing and executing Elasticsearch queries" tar ((:commit . "cde5cafcbbbd57db6d38ae7452de626305bba68d") (:authors ("Lee Hinman" . "lee@writequit.org")) (:maintainer "Lee Hinman" . "lee@writequit.org") (:keywords "elasticsearch") (:url . "http://www.github.com/dakrone/es-mode"))])
+ (es-windows . [(20140211 904) ((cl-lib (0 3)) (emacs (24))) "Window-management utilities" single ((:commit . "239e30408cb1adb4bc8bd63e2df34711fa910b4f") (:authors ("sabof")) (:maintainer "sabof") (:url . "https://github.com/sabof/es-windows"))])
+ (esa . [(20180403 1525) ((cl-lib (0 5))) "Interface to esa.io" single ((:commit . "417e0ac55abe9b17e0b7165d0df26bc018aff42e") (:authors ("Nab Inno" . "nab@blahfe.com")) (:maintainer "Nab Inno" . "nab@blahfe.com") (:keywords "tools" "esa") (:url . "https://github.com/nabinno/esa.el"))])
+ (esh-autosuggest . [(20210906 1446) ((emacs (24 4)) (company (0 9 4))) "History autosuggestions for eshell" single ((:commit . "bf676b137d35553debe32ff134dbec25f3978ae7") (:authors ("Diego A. Mundo" . "dieggsy@pm.me")) (:maintainer "Diego A. Mundo" . "dieggsy@pm.me") (:keywords "completion" "company" "matching" "convenience" "abbrev") (:url . "http://github.com/dieggsy/esh-autosuggest"))])
+ (esh-buf-stack . [(20140107 1018) nil "Add a buffer stack feature to Eshell" single ((:commit . "ce0ea5aadca3150eaa9d2e6ec20296add4e99176") (:authors ("Tomoya Tanjo" . "ttanjo@gmail.com")) (:maintainer "Tomoya Tanjo" . "ttanjo@gmail.com") (:keywords "eshell" "extensions"))])
+ (esh-help . [(20190905 22) ((dash (1 4 0))) "Add some help functions and support for Eshell" single ((:commit . "417673ed18a983930a66a6692dbfb288a995cb80") (:authors ("Tomoya Tanjo" . "ttanjo@gmail.com")) (:maintainer "Tomoya Tanjo" . "ttanjo@gmail.com") (:keywords "eshell" "extensions") (:url . "https://github.com/tom-tan/esh-help/"))])
+ (eshell-autojump . [(20201117 235) nil "autojump command for Eshell" single ((:commit . "c1056bfc6b46646ae1e606247689fef9aee621af") (:authors ("Alex Schroeder")) (:maintainer "Yen-Chin, Lee" . "coldnew.tw@gmail.com") (:url . "http://github.com/coldnew/eshell-autojump"))])
+ (eshell-bookmark . [(20170922 1514) ((emacs (24 3))) "Integrate bookmarks with eshell." single ((:commit . "99a491c77e27ecc4626bdd4ad453ac71aa2654d4") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "convenience" "files") (:url . "https://github.com/Fuco1/eshell-bookmark"))])
+ (eshell-did-you-mean . [(20211104 237) ((emacs (24 1)) (cl-lib (0 5))) "command not found (\"did you mean…\" feature) in Eshell" single ((:commit . "80cd8c4b186a2fb29621cf634bcf2bcd914f1e3d") (:authors ("Chunyang Xu" . "xuchunyang56@gmail.com")) (:maintainer "Chunyang Xu" . "xuchunyang56@gmail.com") (:keywords "eshell") (:url . "https://github.com/xuchunyang/eshell-did-you-mean"))])
+ (eshell-fixed-prompt . [(20220104 1535) ((emacs (25)) (s (1 11 0))) "Restrict eshell to a single fixed prompt" single ((:commit . "302c241b42764bd6b4ed6d3c6ea360b5a2292fbc") (:authors ("Tijs Mallaerts" . "tijs.mallaerts@gmail.com")) (:maintainer "Tijs Mallaerts" . "tijs.mallaerts@gmail.com"))])
+ (eshell-fringe-status . [(20170117 2316) nil "Show last status in fringe" single ((:commit . "adc6997c68e39c0d52a2af1b2fd5cf2057783797") (:authors ("Tom Willemse" . "tom@ryuslash.org")) (:maintainer "Tom Willemse" . "tom@ryuslash.org") (:url . "http://projects.ryuslash.org/eshell-fringe-status/"))])
+ (eshell-git-prompt . [(20220206 458) ((emacs (24 1)) (cl-lib (0 5)) (dash (2 11 0))) "Some Eshell prompt for Git users" single ((:commit . "1eb1fd56649f291cac482fbf06dd43ef867873bc") (:authors ("Chunyang Xu" . "mail@xuchunyang.me")) (:maintainer "Chunyang Xu" . "mail@xuchunyang.me") (:keywords "eshell" "git") (:url . "https://github.com/xuchunyang/eshell-git-prompt"))])
+ (eshell-info-banner . [(20220402 1721) ((emacs (25 1)) (s (1))) "System information as your Eshell banner" single ((:commit . "53fc69b8712b9869cee49468a6e418d64d2c3ab9") (:authors ("Lucien Cartier-Tilet" . "lucien@phundrak.com")) (:maintainer "Lucien Cartier-Tilet" . "lucien@phundrak.com") (:url . "https://github.com/Phundrak/eshell-info-banner.el"))])
+ (eshell-outline . [(20201121 620) ((emacs (25 1))) "Enhanced outline-mode for Eshell" single ((:commit . "6f917afa5b3d36764d76d7864589094647d8c3b4") (:authors ("Jamie Beardslee" . "jdb@jamzattack.xyz")) (:maintainer "Jamie Beardslee" . "jdb@jamzattack.xyz") (:keywords "unix" "eshell" "outline" "convenience") (:url . "https://git.jamzattack.xyz/eshell-outline"))])
+ (eshell-prompt-extras . [(20210925 110) ((emacs (25))) "Display extra information for your eshell prompt." single ((:commit . "c2078093323206b91a1b1f5786d79faa00b76be7") (:authors ("zwild" . "judezhao@outlook.com")) (:maintainer "Chunyang Xu" . "mail@xuchunyang.me") (:keywords "eshell" "prompt") (:url . "https://github.com/zwild/eshell-prompt-extras"))])
+ (eshell-syntax-highlighting . [(20210429 413) ((emacs (25 1))) "Highlight eshell commands" single ((:commit . "8e3a685fc6d97af79e1046e5b24385786d8e92f6") (:authors ("Alex Kreisher" . "akreisher18@gmail.com")) (:maintainer "Alex Kreisher" . "akreisher18@gmail.com") (:keywords "convenience") (:url . "https://github.com/akreisher/eshell-syntax-highlighting"))])
+ (eshell-toggle . [(20210407 2039) ((emacs (25 1)) (dash (2 11 0))) "Show/hide eshell under active window." single ((:commit . "7160518ca56444fead841b8acff59aeffc7cebb3") (:authors ("Dmitry Cherkassov" . "dcherkassov@gmail.com")) (:maintainer "Dmitry Cherkassov" . "dcherkassov@gmail.com") (:keywords "processes") (:url . "https://github.com/4da/eshell-toggle"))])
+ (eshell-up . [(20170425 1737) ((emacs (24))) "Quickly go to a specific parent directory in eshell" single ((:commit . "ff84e6069b98f2ed00857a0f78bff19d96e4955c") (:authors ("Peter W. V. Tran-Jørgensen" . "peter.w.v.jorgensen@gmail.com")) (:maintainer "Peter W. V. Tran-Jørgensen" . "peter.w.v.jorgensen@gmail.com") (:keywords "eshell") (:url . "https://github.com/peterwvj/eshell-up"))])
+ (eshell-vterm . [(20220506 1212) ((emacs (27 1)) (vterm (0 0 1))) "Vterm for visual commands in eshell" single ((:commit . "4e8589fcaf6243011a76b4816e7689d913927aab") (:authors ("Illia Ostapyshyn" . "ilya.ostapyshyn@gmail.com")) (:maintainer "Illia Ostapyshyn" . "ilya.ostapyshyn@gmail.com") (:keywords "eshell" "vterm" "terminals" "shell" "visual" "tools" "processes") (:url . "https://github.com/iostapyshyn/eshell-vterm"))])
+ (eshell-z . [(20191116 333) ((cl-lib (0 5))) "cd to frequent directory in eshell" single ((:commit . "337cb241e17bd472bd3677ff166a0800f684213c") (:authors ("Chunyang Xu" . "mail@xuchunyang.me")) (:maintainer "Chunyang Xu" . "mail@xuchunyang.me") (:keywords "convenience") (:url . "https://github.com/xuchunyang/eshell-z"))])
+ (eslint-disable-rule . [(20220328 354) ((emacs (27 2))) "Commands to add JS comments disabling eslint rules" tar ((:commit . "7d4cc05d336fbc465f91a87b38bf360efaf76fcf") (:url . "https://github.com/DamienCassou/eslint-disable-rule"))])
+ (eslint-fix . [(20211005 221) nil "Fix JavaScript files using ESLint" single ((:commit . "0435d8e2864bb4f1be59ae548d0068c69fa31c7a") (:authors ("Neri Marschik" . "marschik_neri@cyberagent.co.jp")) (:maintainer "Neri Marschik" . "marschik_neri@cyberagent.co.jp") (:keywords "tools" "javascript" "eslint" "lint" "formatting" "style") (:url . "https://github.com/codesuki/eslint-fix"))])
+ (eslint-rc . [(20220328 800) ((emacs (24 3)) (eslint-fix (0 1 0))) "Use local rc rules with ESLint" single ((:commit . "eb6f3e715792952bc957d5dc8ab1a607f3dbbd55") (:authors ("Joel Bryan Juliano <joelbryan dot juliano at gmail dot com>")) (:maintainer "Joel Bryan Juliano <joelbryan dot juliano at gmail dot com>") (:keywords "convenience" "edit" "js" "ts" "rc" "eslintrc" "eslint-rc" "eslint" "eslint-fix") (:url . "https://github.com/jjuliano/eslint-rc-emacs"))])
+ (eslintd-fix . [(20210731 1649) ((dash (2 12 0)) (emacs (26 3))) "use eslint_d to automatically fix js files" single ((:commit . "3897d8a679a6e98e3f5054aaefe07f6b55f8f128") (:authors ("Aaron Jensen" . "aaronjensen@gmail.com")) (:maintainer "Aaron Jensen" . "aaronjensen@gmail.com") (:url . "https://github.com/aaronjensen/eslintd-fix"))])
+ (esonify . [(20190110 1621) ((deferred (0 3 1)) (cl-lib (0 5))) "Sonify your code" tar ((:commit . "bdc79d4ab2e3c449b5bef46e5cabc552beeed5c6") (:authors ("Oliver Flatt" . "oflatt@gmail.com")) (:maintainer "Oliver Flatt" . "oflatt@gmail.com") (:url . "https://github.com/oflatt/esonify"))])
+ (espotify . [(20220121 2057) ((emacs (26 1))) "Spotify access library" single ((:commit . "ea6d6021e5acc550560325db2f09198839ee702f") (:authors ("Jose A Ortega Ruiz" . "jao@gnu.org")) (:maintainer "Jose A Ortega Ruiz") (:keywords "multimedia") (:url . "https://codeberg.org/jao/espotify"))])
+ (espresso-theme . [(20210505 1957) nil "Espresso Tutti Colori port for Emacs" single ((:commit . "580f673729f02aa07070c5300bedf24733d56e74") (:authors ("Martin Kühl <purl.org/net/mkhl>")) (:maintainer "Martin Kühl <purl.org/net/mkhl>") (:url . "https://github.com/dgutov/espresso-theme"))])
+ (espuds . [(20160905 1300) ((s (1 7 0)) (dash (2 2 0)) (f (0 12 1))) "Ecukes step definitions" single ((:commit . "78fc53feaf77a98d63894cd410faee2a18107b00") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "test") (:url . "http://github.com/ecukes/espuds"))])
+ (espy . [(20200317 2333) ((emacs (24))) "Emacs Simple Password Yielder" single ((:commit . "2c01be937a5e5bde62921684a0b27300705fb4e0") (:authors ("Sebastian Wålinder" . "s.walinder@gmail.com")) (:maintainer "Sebastian Wålinder" . "s.walinder@gmail.com") (:keywords "convenience") (:url . "https://github.com/walseb/espy"))])
+ (esqlite . [(20151206 1206) ((pcsv (1 3 3))) "Manipulate sqlite file from Emacs" single ((:commit . "08a779a821f8d32c1a1985d8d9eb6cf21646ce2e") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "data") (:url . "https://github.com/mhayashi1120/Emacs-esqlite"))])
+ (esqlite-helm . [(20151116 850) ((esqlite (0 2 0)) (helm (20131207 845))) "Define helm source for sqlite database" single ((:commit . "08a779a821f8d32c1a1985d8d9eb6cf21646ce2e") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "data") (:url . "https://github.com/mhayashi1120/Emacs-esqlite"))])
+ (ess . [(20220225 1523) ((emacs (25 1))) "Emacs Speaks Statistics" tar ((:commit . "39eba283000a7b0220303d7c5a4f3ee05efc1e9c") (:authors ("David Smith" . "dsmith@stats.adelaide.edu.au") ("A.J. Rossini" . "blindglobe@gmail.com") ("Richard M. Heiberger" . "rmh@temple.edu") ("Kurt Hornik" . "Kurt.Hornik@R-project.org") ("Martin Maechler" . "maechler@stat.math.ethz.ch") ("Rodney A. Sparapani" . "rsparapa@mcw.edu") ("Stephen Eglen" . "stephen@gnu.org") ("Sebastian P. Luque" . "spluque@gmail.com") ("Henning Redestig" . "henning.red@googlemail.com") ("Vitalie Spinu" . "spinuvit@gmail.com") ("Lionel Henry" . "lionel.hry@gmail.com") ("J. Alexander Branham" . "alex.branham@gmail.com")) (:maintainer "ESS Core Team" . "ESS-core@r-project.org") (:url . "https://ess.r-project.org/"))])
+ (ess-R-data-view . [(20130509 1158) ((ctable (20130313 1743)) (popup (20130324 1305)) (ess (20130225 1754))) "Data viewer for GNU R" single ((:commit . "d6e98d3ae1e2a2ea39a56eebcdb73e99d29562e9") (:authors ("myuhe <yuhei.maeda_at_gmail.com>")) (:maintainer "myuhe") (:keywords "convenience") (:url . "https://github.com/myuhe/ess-R-data-view.el"))])
+ (ess-r-insert-obj . [(20211209 812) ((emacs (26 1)) (ess (18 10 1))) "Insert objects in ESS-R" single ((:commit . "dd367cb918c90ec6d3824da869f7a75bb1ca49b6") (:authors ("Shuguang Sun" . "shuguang79@qq.com")) (:maintainer "Shuguang Sun" . "shuguang79@qq.com") (:keywords "tools") (:url . "https://github.com/ShuguangSun/ess-r-insert-obj"))])
+ (ess-smart-equals . [(20210411 1333) ((emacs (25 1)) (ess (18 10))) "flexible, context-sensitive assignment key for R/S" single ((:commit . "fea9eea4b59c3e9559b379508e3500076ca99ef1") (:authors ("Christopher R. Genovese" . "genovese@cmu.edu")) (:maintainer "Christopher R. Genovese" . "genovese@cmu.edu") (:keywords "r" "s" "ess" "convenience") (:url . "https://github.com/genovese/ess-smart-equals"))])
+ (ess-smart-underscore . [(20190309 101) ((ess (0))) "Ess Smart Underscore" tar ((:commit . "aa871c5b0448515db439ea9bed6a8574e82ddb47") (:authors ("Matthew L. Fidler")) (:maintainer "Matthew Fidler") (:keywords "ess" "underscore") (:url . "http://github.com/mlf176f2/ess-smart-underscore.el"))])
+ (ess-view . [(20181001 1730) ((ess (15)) (s (1 8 0)) (f (0 16 0))) "View R dataframes in a spreadsheet software" single ((:commit . "925cafd876e2cc37bc756bb7fcf3f34534b457e2") (:authors ("Bocci Gionata" . "boccigionata@gmail.com")) (:maintainer "Bocci Gionata" . "boccigionata@gmail.com") (:keywords "extensions" "ess") (:url . "https://github.com/GioBo/ess-view"))])
+ (ess-view-data . [(20220124 1430) ((emacs (26 1)) (ess (18 10 1)) (csv-mode (1 12))) "View Data" single ((:commit . "6277684e06d5c3a2cbd340f656b7ffca4046e45b") (:authors ("Shuguang Sun" . "shuguang79@qq.com")) (:maintainer "Shuguang Sun" . "shuguang79@qq.com") (:keywords "tools") (:url . "https://github.com/ShuguangSun/ess-view-data"))])
+ (esup . [(20220202 2335) ((cl-lib (0 5)) (s (1 2)) (emacs (25 1))) "The Emacs StartUp Profiler (ESUP)" tar ((:commit . "4b49c8d599d4cc0fbf994e9e54a9c78e5ab62a5f") (:authors ("Joe Schafer" . "joe@jschaf.com")) (:maintainer "Serghei Iakovlev" . "egrep@protonmail.ch") (:keywords "convenience" "processes") (:url . "https://github.com/jschaf/esup"))])
+ (esxml . [(20220506 759) ((emacs (24 1)) (kv (0 0 5)) (cl-lib (0 5))) "Library for working with xml via esxml and sxml" tar ((:commit . "7ac1fec0e45f12836b301fd9b8e7297434db2f70") (:authors ("Evan Izaksonas-Smith <izak0002 at umn dot edu>")) (:maintainer "Evan Izaksonas-Smith") (:keywords "tools" "lisp" "comm") (:url . "https://github.com/tali713/esxml"))])
+ (eta . [(20210115 1655) ((emacs (25 1)) (ht (2 2)) (dash (2 17))) "standard and multi dispatch key bind" single ((:commit . "c7540ac50163f368fec1918dfc334304d9b36c51") (:authors ("Chris Zheng")) (:maintainer "Chris Zheng") (:keywords "convenience" "usability") (:url . "https://www.github.com/zcaudate/eta"))])
+ (etable . [(20161028 2009) ((dash (2 9 0)) (interval-list (0 1)) (emacs (24 4))) "Implementation of javax.swing.JTable for Emacs." tar ((:commit . "d502141f0c69bf95256ba5cb9cd15350c7e942d2") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "convenience") (:url . "https://github.com/Fuco1/ETable"))])
+ (etc-sudoers-mode . [(20201102 1707) ((sudo-edit (0)) (with-editor (0))) "Edit Sudo security policies" single ((:commit . "74c66c58c9578a0d841206d5dec04d81e7b3d741") (:authors ("Peter Oliver" . "git@mavit.org.uk")) (:maintainer "Peter Oliver" . "git@mavit.org.uk") (:keywords "languages") (:url . "https://gitlab.com/mavit/etc-sudoers-mode/"))])
+ (eterm-256color . [(20210224 2241) ((emacs (24 4)) (xterm-color (1 7)) (f (0 19 0))) "Customizable 256 colors for term." tar ((:commit . "c9cfccef03e730f7ab2b407aada3df15ace1fe32") (:authors ("Diego A. Mundo" . "dieggsy@pm.me")) (:maintainer "Diego A. Mundo" . "dieggsy@pm.me") (:keywords "faces") (:url . "http://github.com/dieggsy/eterm-256color"))])
+ (eterm-fn . [(20191010 2331) ((term (0))) "Function keys (F1--F12) for term." tar ((:commit . "66f3b2f6308fa2ac4d8a32be5a7e35a96e08a9ee") (:authors ("Bruno Félix Rezende Ribeiro" . "oitofelix@gnu.org")) (:maintainer "Bruno Félix Rezende Ribeiro" . "oitofelix@gnu.org") (:keywords "terminals") (:url . "https://github.com/oitofelix/eterm-fn"))])
+ (ethan-wspace . [(20201106 2059) nil "whitespace customizations for emacs" single ((:commit . "035c7d698c99e3891a522d6e6f8fde23c6267c15") (:authors ("Ethan Glasser-Camp" . "ethan@betacantrips.com")) (:maintainer "Ethan Glasser-Camp" . "ethan@betacantrips.com") (:keywords "whitespace" "tab" "newline" "trailing" "clean"))])
+ (etherpad . [(20211128 106) ((emacs (26 3)) (request (0 3)) (let-alist (0 0)) (websocket (1 12)) (parsec (0 1)) (0xc (0 1))) "Interface to the Etherpad API" tar ((:commit . "1fae6a03084e0794e09ac036838b53aaae1dbd63") (:authors ("nik gaffney" . "nik@fo.am")) (:maintainer "nik gaffney" . "nik@fo.am") (:keywords "comm" "etherpad" "collaborative editing") (:url . "https://github.com/zzkt/ethermacs"))])
+ (euslisp-mode . [(20170830 1929) ((emacs (24 3)) (s (1 9)) (exec-path-from-shell (0)) (helm-ag (0 58))) "Major mode for Euslisp-formatted text" single ((:commit . "db62a2d148482317794727982576494596365a55") (:authors ("iory" . "ab.ioryz@gmail.com")) (:maintainer "iory" . "ab.ioryz@gmail.com") (:keywords "euslisp" "euslisp" "github") (:url . "https://github.com/iory/euslisp-mode"))])
+ (eval-expr . [(20120619 647) nil "enhanced eval-expression command" single ((:commit . "a0e69e83de41df8dbccefc1962ab4f02206a3328") (:authors ("Noah Friedman" . "friedman@splode.com")) (:maintainer nil . "friedman@splode.com") (:keywords "lisp" "extensions"))])
+ (eval-in-repl . [(20201121 1341) ((dash (0 0 0)) (paredit (0 0 0)) (ace-window (0 0 0))) "Consistent ESS-like eval interface for various REPLs" tar ((:commit . "2abb9ccf6f08ae3a5ab504f0b3fd81ce0345b766") (:authors ("Kazuki YOSHIDA" . "kazukiyoshida@mail.harvard.edu")) (:maintainer "Kazuki YOSHIDA" . "kazukiyoshida@mail.harvard.edu") (:keywords "tools" "convenience") (:url . "https://github.com/kaz-yos/eval-in-repl"))])
+ (eval-sexp-fu . [(20191128 825) ((cl-lib (0))) "Tiny functionality enhancements for evaluating sexps." single ((:commit . "36d2fe3bcf602e15ca10a7f487da103515ef391a") (:authors ("Takeshi Banse" . "takebi@laafc.net")) (:maintainer "Takeshi Banse" . "takebi@laafc.net") (:keywords "lisp" "highlight" "convenience"))])
+ (evalator . [(20160213 128) ((helm-core (1 9 1))) "Package for interactive transformation of data with helm" tar ((:commit . "f30da4da48c0b3f3cfa1fc1c7cfdb53ffe79df36") (:authors ("Sean Irby")) (:maintainer "Sean Irby" . "sean.t.irby@gmail.com") (:keywords "languages" "elisp" "helm") (:url . "http://www.github.com/seanirby/evalator"))])
+ (evalator-clojure . [(20160208 2148) ((cider (0 10 0)) (evalator (1 0 0))) "Clojure evaluation context for evalator via CIDER." tar ((:commit . "caa4e0a137bdfada86593128a654e16aa617ad50") (:authors ("Sean Irby")) (:maintainer "Sean Irby" . "sean.t.irby@gmail.com") (:keywords "languages" "clojure" "cider" "helm") (:url . "http://www.github.com/seanirby/evalator-clojure"))])
+ (eve-mode . [(20170822 2231) ((emacs (25)) (polymode (1 0)) (markdown-mode (2 0))) "Major mode for editing Eve documents." single ((:commit . "a4661114d9c18725691b76321d72167ca5a9070a") (:authors ("Joshua Cole" . "joshuafcole@gmail.com")) (:maintainer "Joshua Cole" . "joshuafcole@gmail.com") (:keywords "languages" "wp" "tools") (:url . "https://github.com/witheve/emacs-eve-mode"))])
+ (everlasting-scratch . [(20220412 921) ((emacs (25 1))) "The *scratch* that lasts forever" single ((:commit . "8706c55f3b7c267c15b8f10170ecec9998b3cc3d") (:authors ("Huming Chen" . "chenhuming@gmail.com")) (:maintainer "Huming Chen" . "chenhuming@gmail.com") (:keywords "convenience" "tool") (:url . "https://github.com/beacoder/everlasting-scratch"))])
+ (evil . [(20220509 2023) ((emacs (24 1)) (goto-chg (1 6)) (cl-lib (0 5))) "Extensible Vi layer for Emacs." tar ((:commit . "b32e00179538af9685ab7c31d46eea6dc40595d4") (:maintainer "Tom Dalziel" . "tom.dalziel@gmail.com") (:keywords "emulation" "vim") (:url . "https://github.com/emacs-evil/evil"))])
+ (evil-anzu . [(20200514 1902) ((evil (1 0 0)) (anzu (0 46))) "anzu for evil-mode" single ((:commit . "d3f6ed4773b48767bd5f4708c7f083336a8a8a86") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com") ("Fredrik Bergroth" . "fbergroth@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-evil-anzu"))])
+ (evil-args . [(20220125 1626) ((evil (1 0 8))) "Motions and text objects for delimited arguments in Evil." single ((:commit . "2671071a4a57eaee7cc8c27b9e4b6fc60fd2ccd3") (:authors ("Connor Smith" . "wconnorsmith@gmail.com")) (:maintainer "Connor Smith" . "wconnorsmith@gmail.com") (:keywords "evil" "vim-emulation") (:url . "http://github.com/wcsmith/evil-args"))])
+ (evil-avy . [(20150908 748) ((emacs (24 1)) (cl-lib (0 5)) (avy (0 3 0)) (evil (1 2 3))) "set-based completion" single ((:commit . "2dd955cc3ecaa7ddeb67b295298abdc6d16dd3a5") (:authors ("Yufan Lou" . "loganlyf@gmail.com")) (:maintainer "Yufan Lou" . "loganlyf@gmail.com") (:keywords "point" "location" "evil" "vim") (:url . "https://github.com/louy2/evil-avy"))])
+ (evil-better-visual-line . [(20200123 2045) ((evil (1 2 13))) "gj and gk visual line mode fix" single ((:commit . "4373f930ab1a8d3a2a90e68540967702313b2ce9") (:authors ("<nuckollsp at gmail.com>")) (:maintainer "<nuckollsp at gmail.com>") (:keywords "evil" "vim" "motion") (:url . "https://github.com/yourfin/evil-better-visual-line"))])
+ (evil-cleverparens . [(20170718 413) ((evil (1 0)) (paredit (1)) (smartparens (1 6 1)) (emacs (24 4)) (dash (2 12 0))) "Evil friendly minor-mode for editing lisp." tar ((:commit . "8c45879d49bfa6d4e414b6c1df700a4a51cbb869") (:authors ("Olli Piepponen" . "opieppo@gmail.com")) (:maintainer "Olli Piepponen" . "opieppo@gmail.com") (:keywords "cleverparens" "parentheses" "evil" "paredit" "smartparens") (:url . "https://github.com/luxbock/evil-cleverparens"))])
+ (evil-colemak-basics . [(20220222 1856) ((emacs (24 3)) (evil (1 2 12)) (evil-snipe (2 0 3))) "Basic Colemak key bindings for evil-mode" single ((:commit . "66648de206a7368013f28c0d053b1b32c3efe6c6") (:authors ("Wouter Bolsterlee" . "wouter@bolsterl.ee")) (:maintainer "Wouter Bolsterlee" . "wouter@bolsterl.ee") (:keywords "convenience" "emulations" "colemak" "evil") (:url . "https://github.com/wbolster/evil-colemak-basics"))])
+ (evil-colemak-minimal . [(20171006 1317) ((emacs (24)) (evil (1 2 12))) "Minimal Colemak key bindings for evil-mode" single ((:commit . "6d98b6da60f414524a0d718f76024c26dce742b3") (:authors ("Bryan Allred" . "bryan@revolvingcow.com")) (:maintainer "Bryan Allred" . "bryan@revolvingcow.com") (:keywords "colemak" "evil") (:url . "https://github.com/bmallred/evil-colemak-minimal"))])
+ (evil-collection . [(20220505 619) ((emacs (25 1)) (evil (1 2 13)) (annalist (1 0))) "A set of keybindings for Evil mode" tar ((:commit . "9707efcae4fc76fa204b1c29565aae35b99b865a") (:authors ("James Nguyen" . "james@jojojames.com")) (:maintainer "James Nguyen" . "james@jojojames.com") (:keywords "evil" "tools") (:url . "https://github.com/emacs-evil/evil-collection"))])
+ (evil-commentary . [(20210210 1702) ((evil (1 0 0))) "Comment stuff out. A port of vim-commentary." tar ((:commit . "2dab6ac34d1617971768ad219d73af48f7473fec") (:authors ("Quang Linh LE" . "linktohack@gmail.com")) (:maintainer "Quang Linh LE" . "linktohack@gmail.com") (:keywords "evil" "comment" "commentary" "evil-commentary") (:url . "http://github.com/linktohack/evil-commentary"))])
+ (evil-dvorak . [(20160416 1841) ((evil (1 0 8))) "evil keybindings for that work with dvorak mode" tar ((:commit . "824f7c56980d72a0ff04c662223540cd66f13754") (:authors ("Joshua Branson")) (:maintainer "Joshua Branson") (:keywords "dvorak" "evil" "vim"))])
+ (evil-easymotion . [(20200424 135) ((emacs (24)) (avy (0 3 0)) (cl-lib (0 5))) "A port of vim's easymotion to emacs" single ((:commit . "f96c2ed38ddc07908db7c3c11bcd6285a3e8c2e9") (:authors ("PythonNut" . "pythonnut@pythonnut.com")) (:maintainer "PythonNut" . "pythonnut@pythonnut.com") (:keywords "convenience" "evil") (:url . "https://github.com/pythonnut/evil-easymotion"))])
+ (evil-ediff . [(20170724 1923) ((evil (1 2 3))) "Make ediff a little evil" single ((:commit . "50d26cb0654fca8f8fd7227410e5cbf0b8f681cf") (:authors ("Justin Burkett" . "justin@burkett.cc")) (:maintainer "Justin Burkett" . "justin@burkett.cc") (:url . "https://github.com/justbur/evil-ediff"))])
+ (evil-embrace . [(20220211 606) ((emacs (24 4)) (embrace (0 1 0)) (evil-surround (0))) "Evil integration of embrace.el" single ((:commit . "7b5a539cfe7db238d860122c793a0cb2d329cc6e") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions"))])
+ (evil-escape . [(20180910 1234) ((emacs (24)) (evil (1 0 9)) (cl-lib (0 5))) "No description available." single ((:commit . "f4e9116bfbaac8c9d210c17ad488e0982291245f") (:authors ("Sylvain Benner" . "sylvain.benner@gmail.com")) (:maintainer "Sylvain Benner" . "sylvain.benner@gmail.com") (:keywords "convenience" "editing" "evil") (:url . "https://github.com/syl20bnr/evil-escape"))])
+ (evil-ex-fasd . [(20180903 612) ((emacs (24 4)) (evil (1 1 0)) (fasd (0))) "using fasd right from evil-ex" single ((:commit . "ed8fbbe23a8a268d9dcbf1a6132e928ba2c655c5") (:authors ("Rashawn Zhang" . "namy.19@gmail.com")) (:maintainer "Rashawn Zhang" . "namy.19@gmail.com") (:keywords "tools" "fasd" "evil" "navigation") (:url . "https://github.com/yqrashawn/evil-ex-fasd"))])
+ (evil-ex-shell-command . [(20181226 226) ((emacs (24 4)) (evil (1 1 0))) "invoke shell-command right from evil-ex" single ((:commit . "a6ca6d27c07f6a0807abfb5b8f8865f1d17f54aa") (:authors ("Rashawn Zhang" . "namy.19@gmail.com")) (:maintainer "Rashawn Zhang" . "namy.19@gmail.com") (:keywords "tools" "shell-command" "evil") (:url . "https://github.com/yqrashawn/evil-ex-shell-command"))])
+ (evil-exchange . [(20200118 252) ((evil (1 2 8)) (cl-lib (0 3))) "Exchange text more easily within Evil" single ((:commit . "5f0a2d41434c17c6fb02e4f744043775de1c63a2") (:authors ("Dewdrops" . "v_v_4474@126.com")) (:maintainer "Dewdrops" . "v_v_4474@126.com") (:keywords "evil" "plugin") (:url . "http://github.com/Dewdrops/evil-exchange"))])
+ (evil-expat . [(20190521 714) ((emacs (24 3)) (evil (1 0 0))) "Evil ex commands" single ((:commit . "f4fcd0aa3edc359adb5c986b5dd9188d220d84e2") (:authors ("edkolev" . "evgenysw@gmail.com")) (:maintainer "edkolev" . "evgenysw@gmail.com") (:keywords "emulations" "evil" "vim") (:url . "http://github.com/edkolev/evil-expat"))])
+ (evil-extra-operator . [(20210225 1239) ((evil (1 0 7))) "Evil operator for evaluating codes, taking notes, searching via google, etc." single ((:commit . "fb249889acacc3e28869491195391fa6f617ae56") (:authors ("Dewdrops" . "v_v_4474@126.com")) (:maintainer "Dewdrops" . "v_v_4474@126.com") (:keywords "evil" "plugin") (:url . "http://github.com/Dewdrops/evil-extra-operator"))])
+ (evil-find-char-pinyin . [(20160514 2041) ((evil (1 2 12)) (pinyinlib (0 1 0))) "Evil's f/F/t/T/evil-snipe commands with Pinyin support" single ((:commit . "04e277946d658f1a73c68dcbbadea9c21097a31c") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions"))])
+ (evil-fringe-mark . [(20190320 453) ((emacs (24 3)) (evil (1 0 0)) (fringe-helper (0 1 1)) (goto-chg (1 6))) "Display evil-mode marks in the fringe" tar ((:commit . "a1689fddb7ee79aaa720a77aada1208b8afd5c20") (:authors ("Andrew Smith" . "andy.bill.smith@gmail.com")) (:maintainer "Andrew Smith" . "andy.bill.smith@gmail.com") (:url . "https://github.com/Andrew-William-Smith/evil-fringe-mark"))])
+ (evil-god-state . [(20141117 255) ((evil (1 0 8)) (god-mode (2 12 0))) "use god-mode keybindings in evil-mode" single ((:commit . "3d44197dc0a1fb40e7b7ff8717f8a8c339ce1d40") (:authors ("Eric Seidel")) (:maintainer "Eric Seidel") (:keywords "evil" "leader" "god-mode") (:url . "https://github.com/gridaphobe/evil-god-state"))])
+ (evil-goggles . [(20220112 1302) ((emacs (24 4)) (evil (1 0 0))) "Add a visual hint to evil operations" single ((:commit . "8f20a16e74016f37ad76dc4f2230d9b00c6df3c2") (:authors ("edkolev" . "evgenysw@gmail.com")) (:maintainer "edkolev" . "evgenysw@gmail.com") (:keywords "emulations" "evil" "vim" "visual") (:url . "http://github.com/edkolev/evil-goggles"))])
+ (evil-iedit-state . [(20220219 1432) ((evil (1 0 9)) (iedit (0 9 9 9))) "Evil states to interface iedit mode." single ((:commit . "6f7b502447ba35676375169d7707372ebad2791f") (:authors ("Sylvain Benner" . "sylvain.benner@gmail.com")) (:maintainer "Sylvain Benner" . "sylvain.benner@gmail.com") (:keywords "convenience" "editing" "evil" "iedit" "mnemonic") (:url . "https://github.com/syl20bnr/evil-iedit-state"))])
+ (evil-indent-plus . [(20220106 931) ((evil (0)) (cl-lib (0 5))) "Evil textobjects based on indentation" single ((:commit . "b4dacbfdb57f474f798bfbf5026d434d549eb65c") (:authors ("Eivind Fonn" . "evfonn@gmail.com")) (:maintainer "Eivind Fonn" . "evfonn@gmail.com") (:keywords "convenience" "evil") (:url . "http://github.com/TheBB/evil-indent-plus"))])
+ (evil-indent-textobject . [(20130831 2219) ((evil (0))) "evil textobjects based on indentation" single ((:commit . "70a1154a531b7cfdbb9a31d6922482791e20a3a7") (:authors ("Michael Markert" . "markert.michael@gmail.com")) (:maintainer "Michael Markert" . "markert.michael@gmail.com") (:keywords "convenience" "evil") (:url . "http://github.com/cofi/evil-indent-textobject"))])
+ (evil-leader . [(20140606 1243) ((evil (0))) "let there be <leader>" single ((:commit . "39f7014bcf8b36463e0c7512c638bda4bac6c2cf") (:authors ("Michael Markert" . "markert.michael@googlemail.com")) (:maintainer "Michael Markert" . "markert.michael@googlemail.com") (:keywords "evil" "vim-emulation" "leader") (:url . "http://github.com/cofi/evil-leader"))])
+ (evil-ledger . [(20180802 1612) ((emacs (24 4)) (evil (1 2 12)) (ledger-mode (0))) "Make `ledger-mode' more `evil'." single ((:commit . "7a9f9f5d39c42fffdba8004f8982642351f2b233") (:authors ("Aaron Jacobs" . "atheriel@gmail.com")) (:maintainer "Aaron Jacobs" . "atheriel@gmail.com") (:keywords "convenience" "evil" "languages" "ledger" "vim-emulation") (:url . "https://github.com/atheriel/evil-ledger"))])
+ (evil-lion . [(20220317 1030) ((emacs (24 3)) (evil (1 0 0))) "Evil align operator, port of vim-lion" single ((:commit . "4da660e124731ed65e7aaa6c067c30e876619429") (:authors ("edkolev" . "evgenysw@gmail.com")) (:maintainer "edkolev" . "evgenysw@gmail.com") (:keywords "emulations" "evil" "vim") (:url . "http://github.com/edkolev/evil-lion"))])
+ (evil-lisp-state . [(20160404 248) ((evil (1 0 9)) (bind-map (0)) (smartparens (1 6 1))) "An evil state to edit Lisp code" single ((:commit . "3c65fecd9917a41eaf6460f22187e2323821f3ce") (:authors ("Sylvain Benner" . "sylvain.benner@gmail.com")) (:maintainer "Sylvain Benner" . "sylvain.benner@gmail.com") (:keywords "convenience" "editing" "evil" "smartparens" "lisp" "mnemonic") (:url . "https://github.com/syl20bnr/evil-lisp-state"))])
+ (evil-lispy . [(20190502 739) ((lispy (0 26 0)) (evil (1 2 12)) (hydra (0 13 5))) "precision Lisp editing with Evil and Lispy" tar ((:commit . "ed317f7fccbdbeea8aa04a91b1b1f48a0e2ddc4e") (:authors ("Brandon Carrell <brandoncarrell@gmail.com>, Mika Vilpas" . "mika.vilpas@gmail.com")) (:maintainer "Brandon Carrell <brandoncarrell@gmail.com>, Mika Vilpas" . "mika.vilpas@gmail.com") (:keywords "lisp") (:url . "https://github.com/sp3ctum/evil-lispy"))])
+ (evil-mark-replace . [(20200630 940) ((evil (1 14 0))) "replace the thing in marked area" single ((:commit . "d4fec7b10e93cca149163324cd2b2b2dcc211047") (:authors ("Chen Bin <chenbin DOT sh AT gmail DOT com>")) (:maintainer "Chen Bin <chenbin DOT sh AT gmail DOT com>") (:keywords "convenience") (:url . "http://github.com/redguardtoo/evil-mark-replace"))])
+ (evil-matchit . [(20220414 1316) ((evil (1 14 0)) (emacs (25 1))) "Vim matchit ported to Evil" tar ((:commit . "b314e816bacfc01bb7df9b19a06b18638af5cdbe") (:authors ("Chen Bin" . "chenbin.sh@gmail.com")) (:maintainer "Chen Bin" . "chenbin.sh@gmail.com") (:keywords "matchit" "vim" "evil") (:url . "http://github.com/redguardtoo/evil-matchit"))])
+ (evil-mc . [(20220118 122) ((emacs (24 3)) (evil (1 2 14)) (cl-lib (0 5))) "Multiple cursors for evil-mode" tar ((:commit . "63fd2fe0c213a4cc31c464d246f92931c4cb720f") (:authors ("Gabriel Adomnicai" . "gabesoft@gmail.com")) (:maintainer "Gabriel Adomnicai" . "gabesoft@gmail.com") (:keywords "evil" "editing" "multiple-cursors" "vim" "evil-multiple-cursors" "evil-mc" "evil-mc") (:url . "https://github.com/gabesoft/evil-mc"))])
+ (evil-mc-extras . [(20170202 1649) ((emacs (24 3)) (evil (1 2 12)) (cl-lib (0 5)) (evil-mc (0 0 2)) (evil-numbers (0 4))) "Extra functionality for evil-mc" tar ((:commit . "8c1af3232dd1e15b2ea38360b8cd1e857e11c416") (:authors ("Gabriel Adomnicai" . "gabesoft@gmail.com")) (:maintainer "Gabriel Adomnicai" . "gabesoft@gmail.com") (:keywords "evil" "editing" "multiple-cursors" "vim" "evil-multiple-cursors" "evil-mc" "evil-mc-extras") (:url . "https://github.com/gabesoft/evil-mc-extras"))])
+ (evil-mu4e . [(20180613 1039) ((emacs (24 4)) (evil (1 2 10))) "evil-based key bindings for mu4e" single ((:commit . "5b22c1e30246318f233264506272d770f63897ca") (:authors ("Joris Engbers" . "info@jorisengbers.nl")) (:maintainer "Joris Engbers" . "info@jorisengbers.nl") (:url . "https://github.com/JorisE/evil-mu4e"))])
+ (evil-multiedit . [(20211121 1650) ((emacs (25 1)) (evil (1 14 0)) (iedit (0 9 9)) (cl-lib (0 5))) "multiple cursors for evil-mode" single ((:commit . "23b53bc8743fb82a8854ba907b1d277374c93a79") (:authors ("Henrik Lissner <http://github/hlissner>")) (:maintainer "Henrik Lissner" . "contact@henrik.io") (:keywords "multiple cursors" "editing" "iedit") (:url . "https://github.com/hlissner/evil-multiedit"))])
+ (evil-nerd-commenter . [(20220414 1201) ((emacs (25 1))) "Comment/uncomment lines efficiently. Like Nerd Commenter in Vim" tar ((:commit . "95ed1ad2448e7f49f1ee417061b61edbb69a0749") (:authors ("Chen Bin" . "chenbin.sh@gmail.com")) (:maintainer "Chen Bin" . "chenbin.sh@gmail.com") (:keywords "convenience" "evil") (:url . "http://github.com/redguardtoo/evil-nerd-commenter"))])
+ (evil-nl-break-undo . [(20181125 2054) nil "Break evil's undo sequence on CR" single ((:commit . "4a8f2bf99c978a109eeb92965a72a17bedb68762") (:authors ("VanLaser" . "Gabriel.Lazar@com.utcluj.ro")) (:maintainer "VanLaser" . "Gabriel.Lazar@com.utcluj.ro") (:url . "https://github.com/VanLaser/evil-nl-break-undo"))])
+ (evil-numbers . [(20211011 103) ((emacs (24 1)) (evil (1 2 0))) "Increment/decrement numbers like in VIM" single ((:commit . "08f0c1ee93b8a563770eaefaf21ab9087fca7bdb") (:authors ("Michael Markert" . "markert.michael@googlemail.com")) (:maintainer "Julia Path" . "julia@jpath.de") (:keywords "convenience" "tools") (:url . "http://github.com/juliapath/evil-numbers"))])
+ (evil-opener . [(20161207 1810) ((evil (1 2 12)) (opener (0 2 2))) "opening urls as buffers in evil" tar ((:commit . "c384f67278046fdcd220275fdd212ab85672cbeb") (:authors ("Tim Reddehase" . "tr@rightsrestricted.com")) (:maintainer "Tim Reddehase" . "tr@rightsrestricted.com") (:keywords "url" "http" "files") (:url . "https://github.com/0robustus1/opener.el"))])
+ (evil-org . [(20220227 1024) ((emacs (24 4)) (evil (1 0))) "evil keybindings for org-mode" tar ((:commit . "0d10ff7bb9a3a93d25cd91018b17f0a052b335f3") (:maintainer "Somelauw") (:keywords "evil" "vim-emulation" "org-mode" "key-bindings" "presets") (:url . "https://github.com/Somelauw/evil-org-mode.git"))])
+ (evil-owl . [(20210416 1700) ((emacs (25 1)) (evil (1 2 13))) "Preview evil registers and marks before using them" single ((:commit . "a41a6d28e26052b25f3d21da37ccf1d8fde1e6aa") (:authors ("Daniel Phan" . "daniel.phan36@gmail.com")) (:maintainer "Daniel Phan" . "daniel.phan36@gmail.com") (:keywords "emulations" "evil" "visual") (:url . "https://github.com/mamapanda/evil-owl"))])
+ (evil-paredit . [(20150413 2048) ((evil (1 0 9)) (paredit (25 -2))) "Paredit support for evil keybindings" single ((:commit . "e058fbdcf9dbf7ad6cc77f0172d7517ef233d55f") (:authors ("Roman Gonzalez" . "romanandreg@gmail.com")) (:maintainer "Roman Gonzalez" . "romanandreg@gmail.com") (:keywords "paredit" "evil") (:url . "https://github.com/roman/evil-paredit"))])
+ (evil-pinyin . [(20200927 849) ((emacs (25)) (names (0 5)) (evil (1))) "Evil search Chinese characters by pinyin" tar ((:commit . "3e9e501ded86f88e01a4edec5d526ab0fab879d7") (:keywords "extensions") (:url . "https://github.com/laishulu/evil-pinyin"))])
+ (evil-python-movement . [(20180724 1420) ((emacs (25 1)) (cl-lib (0 5)) (dash (2 13 0)) (evil (1 0)) (s (1 12 0))) "Port Neovim's python movement to Evil" single ((:commit . "9936b3b7f8d96415d517c1f3604637889484a637") (:authors ("Felipe Lema <felipelema en mortemale punto org>")) (:maintainer "Felipe Lema <felipelema en mortemale punto org>") (:url . "https://bitbucket.org/FelipeLema/evil-python-movement.el/"))])
+ (evil-quickscope . [(20160202 1924) ((evil (0))) "Highlight unique characters in words for f,F,t,T navigation" single ((:commit . "37a20e4c56c6058abf186ad4013c155e695e876f") (:authors ("Michael Chen" . "blorbx@gmail.com")) (:maintainer "Michael Chen" . "blorbx@gmail.com") (:keywords "faces" "emulation" "vim" "evil") (:url . "http://github.com/blorbx/evil-quickscope"))])
+ (evil-rails . [(20190512 1517) ((evil (1 0)) (projectile-rails (1 0))) "Rails support for Evil Mode" single ((:commit . "b0f1c5de6720714febeb76c4b569b71bb891938c") (:authors ("Antono Vasiljev" . "antono.vasiljev@gmail.com")) (:maintainer "Antono Vasiljev" . "antono.vasiljev@gmail.com") (:keywords "ruby" "rails" "vim" "project" "convenience" "web" "evil" "projectile") (:url . "https://github.com/antono/evil-rails"))])
+ (evil-replace-with-char . [(20180324 2206) ((evil (1 2 13)) (emacs (24))) "replace chars of a text object with a char" single ((:commit . "ed4a12d5bff11163eb03ad2826c52fd30f51a8d3") (:authors ("Filipe Silva" . "filipe.silva@gmail.com")) (:maintainer "Filipe Silva" . "filipe.silva@gmail.com") (:url . "https://github.com/ninrod/evil-replace-with-char"))])
+ (evil-replace-with-register . [(20170713 925) ((evil (1 0 8))) "Port of vim plugin ReplaceWithRegister" single ((:commit . "91cc7bf21a94703c441cc9212214075b226b7f67") (:authors ("Dewdrops" . "v_v_4474@126.com")) (:maintainer "Dewdrops" . "v_v_4474@126.com") (:keywords "evil" "plugin") (:url . "https://github.com/Dewdrops/evil-ReplaceWithRegister"))])
+ (evil-rsi . [(20160221 2104) ((evil (1 0 0))) "Use emacs motion keys in evil, inspired by vim-rsi" single ((:commit . "65ae60866be494e4622fe383e23975e04d2a42a3") (:authors ("Quang Linh LE" . "linktohack@gmail.com")) (:maintainer "Quang Linh LE" . "linktohack@gmail.com") (:keywords "evil" "rsi" "evil-rsi") (:url . "http://github.com/linktohack/evil-rsi"))])
+ (evil-ruby-text-objects . [(20200323 1552) ((emacs (25 1)) (evil (1 2 0))) "Evil text objects for Ruby code" single ((:commit . "32983d91be83ed903b6ef9655e00f69beed2572c") (:authors ("Sergio Gil" . "sgilperez@gmail.com")) (:maintainer "Sergio Gil" . "sgilperez@gmail.com") (:keywords "languages") (:url . "https://github.com/porras/evil-ruby-text-objects"))])
+ (evil-search-highlight-persist . [(20170523 334) ((highlight (0))) "Persistent highlights after search" single ((:commit . "979d2dec58d3b9c5ca5fdf4bb802a0209913794e") (:authors ("Juanjo Alvarez" . "juanjo@juanjoalvarez.net")) (:maintainer "Juanjo Alvarez" . "juanjo@juanjoalvarez.net"))])
+ (evil-smartparens . [(20171210 1513) ((evil (1 0)) (emacs (24 4)) (smartparens (1 10 1))) "Evil support for smartparens" single ((:commit . "026d4a3cfce415a4dfae1457f871b385386e61d3") (:authors ("Lars Andersen" . "expez@expez.com")) (:maintainer "Lars Andersen" . "expez@expez.com") (:keywords "evil" "smartparens") (:url . "https://www.github.com/expez/evil-smartparens"))])
+ (evil-snipe . [(20220428 1432) ((emacs (24 4)) (evil (1 2 12)) (cl-lib (0 5))) "emulate vim-sneak & vim-seek" single ((:commit . "c07788c35cf8cd8e652a494322fdc0643e30a89f") (:authors ("Henrik Lissner <http://github/hlissner>")) (:maintainer "Henrik Lissner" . "contact@henrik.io") (:keywords "emulation" "vim" "evil" "sneak" "seek") (:url . "https://github.com/hlissner/evil-snipe"))])
+ (evil-space . [(20151208 1228) ((evil (1 0 0))) "Repeat motion in Evil. Correct the behaviour of what SPC should do." single ((:commit . "a9c07284d308425deee134c9d88a2d538dd229e6") (:authors ("Quang Linh LE" . "linktohack@gmail.com")) (:maintainer "Quang Linh LE" . "linktohack@gmail.com") (:keywords "space" "repeat" "motion") (:url . "http://github.com/linktohack/evil-space"))])
+ (evil-string-inflection . [(20180313 1755) ((emacs (24)) (evil (1 2 13)) (string-inflection (1 0 6))) "snake_case -> CamelCase -> etc. for text objects" single ((:commit . "d22a90ab807afa7f27f3815b5b5ea47d52d05218") (:authors ("Filipe Silva" . "filipe.silva@gmail.com")) (:maintainer "Filipe Silva" . "filipe.silva@gmail.com") (:url . "https://github.com/ninrod/evil-string-inflection"))])
+ (evil-surround . [(20220504 802) ((evil (1 2 12))) "emulate surround.vim from Vim" single ((:commit . "c9e1449bf3f740b5e9b99e7820df4eca7fc7cf02") (:authors ("Tim Harper <timcharper at gmail dot com>") ("Vegard Øye <vegard_oye at hotmail dot com>")) (:maintainer "Tim Harper <timcharper at gmail dot com>") (:keywords "emulation" "vi" "evil"))])
+ (evil-swap-keys . [(20191105 1426) ((emacs (24 4))) "Intelligently swap keys on text input with evil" single ((:commit . "b5ef105499f998b5667da40da30c073229a213ea") (:authors ("Wouter Bolsterlee" . "wouter@bolsterl.ee")) (:maintainer "Wouter Bolsterlee" . "wouter@bolsterl.ee") (:keywords "convenience" "data" "languages" "tools") (:url . "https://github.com/wbolster/evil-swap-keys"))])
+ (evil-tabs . [(20160217 1520) ((evil (0 0 0)) (elscreen (0 0 0))) "Integrating Vim-style tabs for Evil mode users." single ((:commit . "53d3314a810017b6056ab6796aef671f5ea1c063") (:authors ("Kris Jenkins" . "krisajenkins@gmail.com")) (:maintainer "Kris Jenkins" . "krisajenkins@gmail.com") (:keywords "evil" "tab" "tabs" "vim") (:url . "https://github.com/krisajenkins/evil-tabs"))])
+ (evil-terminal-cursor-changer . [(20220422 255) ((evil (1 0 8))) "Change cursor shape and color by evil state in terminal" single ((:commit . "69d562932f9ab9869ab1ed923e9789cbfa0ff14c") (:authors ("7696122")) (:maintainer "7696122") (:keywords "evil" "terminal" "cursor") (:url . "https://github.com/7696122/evil-terminal-cursor-changer"))])
+ (evil-test-helpers . [(20220425 2132) ((evil (1 15 0))) "unit test helpers for Evil" single ((:commit . "b32e00179538af9685ab7c31d46eea6dc40595d4") (:authors ("Vegard Øye <vegard_oye at hotmail.com>")) (:maintainer "Vegard Øye <vegard_oye at hotmail.com>"))])
+ (evil-tex . [(20220415 842) ((emacs (26 1)) (evil (1 0)) (auctex (11 88))) "Useful features for editing LaTeX in evil-mode" single ((:commit . "26035ec9a09f8b38ce0d495ff788e83ec8b195d5") (:keywords "tex" "emulation" "vi" "evil" "wp") (:url . "https://github.com/iyefrat/evil-tex"))])
+ (evil-text-object-python . [(20191010 1328) ((emacs (25)) (evil (1 2 14)) (dash (2 16 0))) "Python specific evil text objects" single ((:commit . "39d22fc524f0413763f291267eaab7f4e7984318") (:authors ("Wouter Bolsterlee" . "wouter@bolsterl.ee")) (:maintainer "Wouter Bolsterlee" . "wouter@bolsterl.ee") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/wbolster/evil-text-object-python"))])
+ (evil-textobj-anyblock . [(20170905 1907) ((cl-lib (0 5)) (evil (1 1 0))) "Textobject for the closest user-defined blocks." single ((:commit . "ff00980f0634f95bf2ad9956b615a155ea8743be") (:authors ("Fox Kiester" . "noct@openmailbox.org")) (:maintainer "Fox Kiester" . "noct@openmailbox.org") (:keywords "evil") (:url . "https://github.com/noctuid/evil-textobj-anyblock"))])
+ (evil-textobj-column . [(20170905 1905) ((names (0 5)) (emacs (24)) (evil (0))) "Provides column text objects." single ((:commit . "835d7036d0bc9a6e44fc9b7c54ccf2a7c01428cd") (:authors ("Fox Kiester" . "noct@openmailbox.org")) (:maintainer "Fox Kiester" . "noct@openmailbox.org") (:keywords "evil" "column" "text-object") (:url . "https://github.com/noctuid/evil-textobj-column"))])
+ (evil-textobj-entire . [(20150422 1254) ((emacs (24)) (evil (1 0 0))) "text object for entire lines of buffer for evil" single ((:commit . "5b3a98f3a69edc3a788f539f6ffef4a0ef5e853d") (:authors ("supermomonga")) (:maintainer "supermomonga") (:keywords "convenience" "emulations") (:url . "https://github.com/supermomonga/evil-textobj-entire"))])
+ (evil-textobj-line . [(20211101 1429) ((evil (1 0 0))) "Line text object for Evil" single ((:commit . "9eaf9a5485c2b5c05e16552b34632ca520cd681d") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com"))])
+ (evil-textobj-syntax . [(20181210 1213) ((names (0 5)) (emacs (24)) (evil (0))) "Provides syntax text objects." single ((:commit . "2d9ba8c75c754b409aea7469f46a5cfa52a872f3") (:keywords "evil" "syntax" "highlight" "text-object") (:url . "https://github.com/laishulu/evil-textobj-syntax"))])
+ (evil-textobj-tree-sitter . [(20220423 947) ((emacs (25 1)) (evil (1 0 0)) (tree-sitter (0 15 0))) "Provides evil textobjects using tree-sitter" tar ((:commit . "bfdef5a292f7dde36967bb86eb2f7009b03631b1") (:keywords "evil" "tree-sitter" "text-object" "convenience") (:url . "https://github.com/meain/evil-textobj-tree-sitter"))])
+ (evil-traces . [(20191214 558) ((emacs (25 1)) (evil (1 2 13))) "Visual hints for `evil-ex'" single ((:commit . "290b5323542c46af364ec485c8ec9000040acf90") (:authors ("Daniel Phan" . "daniel.phan36@gmail.com")) (:maintainer "Daniel Phan" . "daniel.phan36@gmail.com") (:keywords "emulations" "evil" "visual") (:url . "https://github.com/mamapanda/evil-traces"))])
+ (evil-tree-edit . [(20220425 2355) ((emacs (27 1)) (tree-edit (0 1 0)) (tree-sitter (0 15 0)) (evil (1 0 0)) (avy (0 5 0)) (s (0 0 0))) "Evil structural editing for any language!" tar ((:commit . "eafee31ca4f532a9dbee326d3ec3bdd1e997223b") (:authors ("Ethan Leba" . "ethanleba5@gmail.com")) (:maintainer "Ethan Leba" . "ethanleba5@gmail.com") (:url . "https://github.com/ethan-leba/tree-edit"))])
+ (evil-tutor . [(20150103 650) ((evil (1 0 9))) "Vimtutor adapted to Evil and wrapped in a major-mode" tar ((:commit . "4e124cd3911dc0d1b6817ad2c9e59b4753638f28") (:authors ("Sylvain Benner" . "sylvain.benner@gmail.com")) (:maintainer "Sylvain Benner" . "sylvain.benner@gmail.com") (:keywords "convenience" "editing" "evil") (:url . "https://github.com/syl20bnr/evil-tutor"))])
+ (evil-tutor-ja . [(20160917 132) ((evil (1 0 9)) (evil-tutor (0 1))) "Japanese Vimtutor adapted to Evil and wrapped in a major-mode" tar ((:commit . "99af7d82e02ce3bcdfaff47c5c80b57327a7ea8d") (:authors ("Kenji Miyazaki" . "kenjizmyzk@gmail.com")) (:maintainer "Kenji Miyazaki" . "kenjizmyzk@gmail.com") (:keywords "convenience" "editing" "evil" "japanese") (:url . "https://github.com/kenjimyzk/evil-tutor-ja"))])
+ (evil-vimish-fold . [(20200122 117) ((emacs (24 4)) (evil (1 0 0)) (vimish-fold (0 2 0))) "Integrate vimish-fold with evil" single ((:commit . "b6e0e6b91b8cd047e80debef1a536d9d49eef31a") (:authors ("Alex Murray" . "murray.alex@gmail.com")) (:maintainer "Alex Murray" . "murray.alex@gmail.com") (:url . "https://github.com/alexmurray/evil-vimish-fold"))])
+ (evil-visual-mark-mode . [(20190116 1557) ((evil (1 0 9)) (dash (2 10))) "Display evil marks on buffer" single ((:commit . "ac5997971972a9251f140b5542d82790ca4a43b4") (:authors ("Roman Gonzalez" . "romanandreg@gmail.com")) (:maintainer "Roman Gonzalez" . "romanandreg@gmail.com") (:keywords "evil"))])
+ (evil-visual-replace . [(20171016 613) ((evil (1 0 0))) "search/replace commands for evil visual state, inc. blocks" single ((:commit . "163fc827a1ffc106475da470c37fb26f4cc9b008") (:authors ("Troy Pracy")) (:maintainer "Troy Pracy") (:keywords "evil" "search" "replace" "regexp" "block" "rectangular" "region" "visual") (:url . "https://github.com/troyp/evil-visual-replace"))])
+ (evil-visualstar . [(20160223 48) ((evil (0))) "Starts a * or # search from the visual selection" single ((:commit . "06c053d8f7381f91c53311b1234872ca96ced752") (:authors ("Bailey Ling")) (:maintainer "Bailey Ling") (:keywords "evil" "vim" "visualstar") (:url . "https://github.com/bling/evil-visualstar"))])
+ (evm . [(20141007 1156) ((dash (2 3 0)) (f (0 13 0))) "Emacs Version Manager" single ((:commit . "d0623b2355436a5fd9f7238b419782080c79196b") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:url . "http://github.com/rejeep/evm"))])
+ (evm-mode . [(20220503 1106) nil "Major mode for editing Ethereum EVM bytecode" single ((:commit . "2b326751c9421842521e851d969b9c269c79f8b3") (:authors ("Ta Quang Trung")) (:maintainer "Ta Quang Trung") (:keywords "languages") (:url . "https://github.com/taquangtrung/emacs-evm-mode"))])
+ (ewal . [(20200305 230) ((emacs (25 1))) "A pywal-based theme generator" tar ((:commit . "e2a04f5c97b7d5e087af26e646c0b45a24522e56") (:authors ("Uros Perisic")) (:maintainer "Uros Perisic") (:keywords "faces") (:url . "https://gitlab.com/jjzmajic/ewal"))])
+ (ewal-doom-themes . [(20200922 325) ((emacs (25)) (ewal (0 1)) (doom-themes (0 1))) "Dread the colors of darkness" tar ((:commit . "e2a04f5c97b7d5e087af26e646c0b45a24522e56") (:authors ("Uros Perisic")) (:maintainer "Uros Perisic") (:keywords "faces") (:url . "https://gitlab.com/jjzmajic/ewal"))])
+ (ewal-evil-cursors . [(20190911 1315) ((emacs (25)) (ewal (0 1))) "`ewal'-colored evil cursor for Emacs and Spacemacs" single ((:commit . "e2a04f5c97b7d5e087af26e646c0b45a24522e56") (:authors ("Uros Perisic")) (:maintainer "Uros Perisic") (:keywords "faces") (:url . "https://gitlab.com/jjzmajic/ewal"))])
+ (ewal-spacemacs-themes . [(20190911 1305) ((emacs (25)) (ewal (0 1)) (spacemacs-theme (0 1))) "Ride the rainbow spaceship" tar ((:commit . "e2a04f5c97b7d5e087af26e646c0b45a24522e56") (:authors ("Uros Perisic")) (:maintainer "Uros Perisic") (:keywords "faces") (:url . "https://gitlab.com/jjzmajic/ewal"))])
+ (ewmctrl . [(20170922 217) nil "Use `wmctrl' to manage desktop windows via EWMH/NetWM." single ((:commit . "3d0217c4d6cdb5c308b6cb4293574f470d4faacf") (:authors ("Alexis" . "flexibeast@gmail.com") ("Adam Plaice" . "plaice.adam@gmail.com")) (:maintainer "Alexis" . "flexibeast@gmail.com") (:keywords "desktop" "windows" "ewmh" "netwm") (:url . "https://github.com/flexibeast/ewmctrl"))])
+ (eww-lnum . [(20150102 1512) nil "Conkeror-like functionality for eww" single ((:commit . "4b0ecec769919ecb05ca4fb15ec51911ba589929") (:authors ("Andrey Kotlarski" . "m00naticus@gmail.com")) (:maintainer "Andrey Kotlarski" . "m00naticus@gmail.com") (:keywords "eww" "browse" "conkeror") (:url . "https://github.com/m00natic/eww-lnum"))])
+ (exato . [(20180305 1042) ((evil (1 2 13)) (emacs (24))) "EXATO: Evil XML/HTML Attributes Text Object" single ((:commit . "aee7af7b7a0e7551478f453d1de7d5b9cb2e06c4") (:authors ("Filipe Silva" . "filipe.silva@gmail.com")) (:maintainer "Filipe Silva" . "filipe.silva@gmail.com") (:url . "https://github.com/ninrod/exato"))])
+ (exec-path-from-shell . [(20210914 1247) ((emacs (24 1)) (cl-lib (0 6))) "Get environment variables such as $PATH from the shell" single ((:commit . "6336db9be13d46e2d4bc3b50bc37a3fbf30fdc9e") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "unix" "environment") (:url . "https://github.com/purcell/exec-path-from-shell"))])
+ (execline . [(20190711 2010) ((emacs (26 1)) (s (1 6 0))) "Major mode for editing execline scripts" single ((:commit . "c75dd9b2c54d8e59fc35fd4bd98d8e213948a3f5") (:authors ("Dmitry Bogatov" . "KAction@debian.org")) (:maintainer "Dmitry Bogatov" . "KAction@debian.org") (:keywords "tools" "unix" "languages") (:url . "https://gitlab.com/KAction/emacs-execline"))])
+ (exiftool . [(20190520 1106) ((emacs (25))) "Elisp wrapper around ExifTool" single ((:commit . "fc6713e753380f3034d8df55b7af3a737ea52ab4") (:authors ("Arun I" . "arunisaac@systemreboot.net")) (:maintainer "Arun I" . "arunisaac@systemreboot.net") (:keywords "data") (:url . "https://git.systemreboot.net/exiftool.el"))])
+ (exotica-theme . [(20180212 2329) ((emacs (24))) "A dark theme with vibrant colors" single ((:commit . "ff3ef4f6fa38c93b99becad977c7810c990a4d2f") (:authors ("Bharat Joshi" . "jbharat@outlook.com")) (:maintainer "Bharat Joshi" . "jbharat@outlook.com") (:keywords "faces" "theme" "dark" "vibrant colors") (:url . "https://github.com/jbharat/exotica-theme"))])
+ (expand-line . [(20151006 207) nil "Expand selection by line" single ((:commit . "75a5d0241f35dd0748ab8ecb4ff16891535be372") (:authors ("Kai Yu" . "yeannylam@gmail.com")) (:maintainer "Kai Yu" . "yeannylam@gmail.com"))])
+ (expand-region . [(20210708 1952) nil "Increase selected region by semantic units." tar ((:commit . "7e5bbe2763c12bae3e77fe0c49bcad05ff91dbfe") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "marking" "region"))])
+ (expenses . [(20220318 842) ((emacs (26 1)) (dash (2 19 1)) (ht (2 3))) "Record and view expenses" tar ((:commit . "e668666770858e92de83d8217c7e384de3ba1e34") (:authors ("Md Arif Shaikh" . "arifshaikh.astro@gmail.com")) (:maintainer "Md Arif Shaikh" . "arifshaikh.astro@gmail.com") (:keywords "expense tracking" "convenience") (:url . "https://github.com/md-arif-shaikh/expenses"))])
+ (express . [(20140508 2041) ((string-utils (0 3 2))) "Alternatives to `message'" single ((:commit . "93dae7377eace4a5413ba99aecb6f26f90798725") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "extensions" "message" "interface") (:url . "http://github.com/rolandwalker/express"))])
+ (exsqlaim-mode . [(20170607 1003) ((s (1 10 0))) "Use variables inside sql queries" single ((:commit . "a2e0a62ec8b87193d8eaa695774bfd689324b06c") (:authors ("Ahmad Nazir Raja" . "ahmadnazir@gmail.com")) (:maintainer "Ahmad Nazir Raja" . "ahmadnazir@gmail.com") (:url . "https://github.com/ahmadnazir/exsqlaim-mode"))])
+ (extempore-mode . [(20210512 2350) ((emacs (24 4))) "Emacs major mode for Extempore source files" single ((:commit . "eb2dee8860f3d761e949d7c2ee8e2e469ac1cf51") (:authors ("Ben Swift" . "ben@benswift.me")) (:maintainer "Ben Swift" . "ben@benswift.me") (:keywords "extempore") (:url . "http://github.com/extemporelang/extempore-emacs-mode"))])
+ (extend-dnd . [(20151122 1850) nil "R drag and Drop" tar ((:commit . "80c966c93b82c9bb5c6225a432557c39144fc602") (:authors ("Matthew L. Fidler")) (:maintainer "Matthew L. Fidler") (:keywords "extend" "drag and drop") (:url . "https://github.com/mlf176f2/extend-dnd"))])
+ (extmap . [(20211023 1904) ((emacs (24 1))) "Externally-stored constant mapping for Elisp" single ((:commit . "5875a4ab27831eb81af6246b12a174c765d52a78") (:authors ("Paul Pogonyshev" . "pogonyshev@gmail.com")) (:maintainer "Paul Pogonyshev" . "pogonyshev@gmail.com") (:keywords "lisp") (:url . "https://github.com/doublep/extmap"))])
+ (exunit . [(20211209 1012) ((s (1 11 0)) (emacs (24 3)) (f (0 20 0)) (transient (0 3 6))) "ExUnit test runner" single ((:commit . "0715c2dc2dca0b56c61330eda0690f90cca5f98b") (:authors ("Anantha kumaran" . "ananthakumaran@gmail.com")) (:maintainer "Anantha kumaran" . "ananthakumaran@gmail.com") (:keywords "processes" "elixir" "exunit") (:url . "http://github.com/ananthakumaran/exunit.el"))])
+ (exwm-edit . [(20220414 106) ((emacs (25 1))) "Edit mode for EXWM" single ((:commit . "b5b7e950f57e30befd68d51df34540b70e6ac28f") (:authors ("Ag Ibragimov")) (:maintainer "Ag Ibragimov") (:keywords "convenience") (:url . "https://github.com/agzam/exwm-edit"))])
+ (exwm-firefox-core . [(20190812 2110) ((emacs (24 4)) (exwm (0 16))) "Firefox hotkeys to functions" single ((:commit . "e2fe2a895e8f973307ef52f8c9976b26e701cbd0") (:authors ("Sebastian Wålinder" . "s.walinder@gmail.com")) (:maintainer "Sebastian Wålinder" . "s.walinder@gmail.com") (:keywords "extensions") (:url . "https://github.com/walseb/exwm-firefox-core"))])
+ (exwm-firefox-evil . [(20220318 1958) ((emacs (24 4)) (exwm (0 16)) (evil (1 0 0)) (exwm-firefox-core (1 0))) "evil-mode implementation of exwm-firefox-core" single ((:commit . "a377326e2e4ac386a0abb3fc9b1b356a0d955b61") (:authors ("Sebastian Wålinder" . "s.walinder@gmail.com")) (:maintainer "Sebastian Wålinder" . "s.walinder@gmail.com") (:keywords "extensions") (:url . "https://github.com/walseb/exwm-firefox-evil"))])
+ (exwm-float . [(20210207 2035) ((emacs (25 1)) (xelb (0 18)) (exwm (0 24)) (popwin (1 0 2))) "Convenient modes and bindings for floating EXWM frames" single ((:commit . "eb1b60b4a65e1ca5e323ef68a284ec6af72e637a") (:authors ("Mehmet Tekman")) (:maintainer "Mehmet Tekman") (:keywords "outlines") (:url . "https://gitlab.com/mtekman/exwm-float.el"))])
+ (exwm-mff . [(20210603 1723) ((emacs (25 1))) "Mouse Follows Focus" single ((:commit . "89206f2e3189f589c27c56bd2b6203e906ee7100") (:authors ("Ian Eure" . "public@lowbar.fyi")) (:maintainer "Ian Eure" . "public@lowbar.fyi") (:keywords "unix") (:url . "https://github.com/ieure/exwm-mff"))])
+ (exwm-modeline . [(20220131 1520) ((emacs (27 1)) (exwm (0 26))) "A modeline segment for EXWM workspaces" single ((:commit . "3225ec1803c3da9aee3f53562278c3558c179c26") (:authors ("Korytov Pavel" . "thexcloud@gmail.com")) (:maintainer "Korytov Pavel" . "thexcloud@gmail.com") (:url . "https://github.com/SqrtMinusOne/exwm-modeline"))])
+ (exwm-surf . [(20171204 1140) ((emacs (24 4)) (exwm (0 16))) "Interface for Surf (surf.suckless.org) under exwm" single ((:commit . "6c17e2c1597fe4b7b454a1dac23b9127ac951e94") (:authors ("Peter" . "craven@gmx.net")) (:maintainer "Peter" . "craven@gmx.net") (:keywords "extensions") (:url . "https://github.com/ecraven/exwm-surf"))])
+ (exwm-x . [(20210419 950) ((cl-lib (0 5)) (async (1 6)) (exwm (0 22))) "A derivative wm based on EXWM (emacs x window manager)" tar ((:commit . "2ab026f407b011a8e8380c889990e85e69cb3a4e") (:authors ("Feng Shu" . "tumashu@163.com")) (:maintainer "Feng Shu" . "tumashu@163.com") (:keywords "window-manager" "exwm") (:url . "https://github.com/tumashu/exwm-x"))])
+ (eyebrowse . [(20201107 955) ((dash (2 7 0)) (emacs (24 3 1))) "Easy window config switching" single ((:commit . "f7e129b84183367f54f0d0d3c9db8540f754bd8d") (:authors ("Vasilij Schneidermann" . "mail@vasilij.de")) (:maintainer "Vasilij Schneidermann" . "mail@vasilij.de") (:keywords "convenience") (:url . "https://depp.brause.cc/eyebrowse"))])
+ (eyuml . [(20141028 2227) ((request (0 2 0)) (s (1 8 0))) "Write textual uml diagram from emacs using yuml.me" single ((:commit . "eb29c37316e44a14741f16e894fbcfcb7537dc80") (:authors ("Anthony HAMON" . "hamon.anth@gmail.com")) (:maintainer "Anthony HAMON" . "hamon.anth@gmail.com") (:keywords "uml") (:url . "http://github.com/antham/eyuml"))])
+ (ez-query-replace . [(20210724 2247) ((dash (1 2 0)) (s (1 11 0))) "a smarter context-sensitive query-replace that can be reapplied" single ((:commit . "2b68472f4007a73908c3b242e83ac5a7587967ff") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk"))])
+ (eziam-theme . [(20200327 1810) nil "A mostly monochrome theme, inspired by Tao and Leuven, with dark and light versions." tar ((:commit . "d7e517f8e626035df3b63ec6fc07b85d48a996c5"))])
+ (f . [(20220405 1534) ((s (1 7 0)) (dash (2 2 0))) "Modern API for working with files and directories" single ((:commit . "b5cb884b3b4372a6f3d1d4428cf092ca1e5c8044") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "files" "directories") (:url . "http://github.com/rejeep/f.el"))])
+ (f3 . [(20180130 1158) ((emacs (24 3)) (helm (2 8 8)) (cl-lib (0 5))) "a helm interface to find" tar ((:commit . "000009ce4adf7a57eae80512f29c4ec2a1391ce5") (:authors ("Danny McClanahan")) (:maintainer "Danny McClanahan") (:keywords "find" "file" "files" "helm" "fast" "finder") (:url . "https://github.com/cosmicexplorer/f3"))])
+ (fabric . [(20171116 656) nil "Launch Fabric using Emacs" tar ((:commit . "df79be341d0b34ed23850f9894136092fa5fea8c") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@chmouel.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@chmouel.com") (:keywords "python" "fabric") (:url . "https://github.com/nlamirault/fabric.el"))])
+ (face-explorer . [(20190517 1857) nil "Library and tools for faces and text properties" single ((:commit . "ad1300e13e5643e4c246cabfd91f833d39113052") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "faces") (:url . "https://github.com/Lindydancer/face-explorer"))])
+ (face-shift . [(20210725 2146) ((emacs (24 1))) "Shift the colour of certain faces" single ((:commit . "14dce79fc42116c49eb4c8a4ab7ca3c4bd7cbf6f") (:authors ("Philip Kaludercic" . "philipk@posteo.net")) (:maintainer "Philip Kaludercic" . "philipk@posteo.net") (:keywords "faces") (:url . "https://git.sr.ht/~pkal/face-shift"))])
+ (faceup . [(20170925 1946) nil "Markup language for faces and font-lock regression testing" single ((:commit . "6c92dad56a133e14e7b27831e1bcf9b3a71ff154") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "faces" "languages") (:url . "https://github.com/Lindydancer/faceup"))])
+ (factlog . [(20130210 140) ((deferred (0 3 1))) "File activity logger" single ((:commit . "6503d77ea882c995b051d22e72db336fb28770fc") (:authors ("Takafumi Arakaki <aka.tkf at gmail.com>")) (:maintainer "Takafumi Arakaki <aka.tkf at gmail.com>") (:url . "https://github.com/tkf/factlog"))])
+ (faff-theme . [(20220407 145) nil "Light Emacs color theme on cornsilk3 background" single ((:commit . "f824c3f55ea42d65e0b632879c6948d3eb43b2f3") (:authors ("James Ferguson <(concat \"wjcferguson\" at-sign \"gmail.com\")>")) (:maintainer "James Ferguson <(concat \"wjcferguson\" at-sign \"gmail.com\")>") (:keywords "color" "theme") (:url . "https://github.com/WJCFerguson/emacs-faff-theme"))])
+ (fakir . [(20140729 1652) ((noflet (0 0 8)) (dash (1 3 2)) (kv (0 0 19))) "fakeing bits of Emacs" single ((:commit . "1fca406ad7de80fece6319ff75d4230b648534b0") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "lisp" "tools") (:url . "http://github.com/nicferrier/emacs-fakir"))])
+ (fancy-battery . [(20150101 1204) ((emacs (24 1))) "Fancy battery display" single ((:commit . "9b88ae77a01aa3edc529840338bcb2db7f445822") (:authors ("Sebastian Wiesner" . "swiesner@lunaryorn.com")) (:maintainer "Sebastian Wiesner" . "swiesner@lunaryorn.com") (:keywords "convenience" "tools" "hardware") (:url . "https://github.com/lunaryorn/fancy-battery.el"))])
+ (fancy-dabbrev . [(20220211 633) ((emacs (25 1)) (popup (0 5 3))) "Like dabbrev-expand with preview and popup menu" single ((:commit . "cf4a2f7e3e43e07ab9aa9db16532a21010e9fc8c") (:authors ("Joel Rosdahl" . "joel@rosdahl.net")) (:maintainer "Joel Rosdahl" . "joel@rosdahl.net") (:url . "https://github.com/jrosdahl/fancy-dabbrev"))])
+ (fancy-narrow . [(20171031 16) nil "narrow-to-region with more eye candy." single ((:commit . "c9b3363752c09045b8ce7a2635afae42d2ae63c7") (:authors ("Artur Malabarba" . "bruce.connor.am@gmail.com")) (:maintainer "Artur Malabarba" . "bruce.connor.am@gmail.com") (:keywords "faces" "convenience") (:url . "http://github.com/Bruce-Connor/fancy-narrow"))])
+ (fantom-theme . [(20200328 604) ((emacs (24 1))) "Dark theme based on Phantom Code for VSCode" single ((:commit . "2c1c7fd53086c2ff86ee0961642c3b58e2343c08") (:authors ("Adam Svanberg")) (:maintainer "Adam Svanberg") (:url . "https://github.com/adsva/fantom-emacs-theme"))])
+ (fanyi . [(20220310 358) ((emacs (27 1)) (s (1 12 0))) "Not only English-Chinese translator" tar ((:commit . "b01cb24209d223ae0e7281c279daab87800ee7f4") (:authors ("Zhiwei Chen" . "condy0919@gmail.com")) (:maintainer "Zhiwei Chen" . "condy0919@gmail.com") (:keywords "convenience" "tools") (:url . "https://github.com/condy0919/fanyi.el"))])
+ (farmhouse-theme . [(20160713 2244) nil "Farmhouse Theme, Emacs edition" tar ((:commit . "7ddc1ff13b4a3d5466bd0d33ecb86100352e83a7"))])
+ (fasd . [(20210104 738) nil "Emacs integration for the command-line productivity booster `fasd'" single ((:commit . "c1d92553f33ebb018135c698db1a6d7f86731a26") (:authors ("steckerhalter")) (:maintainer "steckerhalter") (:keywords "cli" "bash" "zsh" "autojump") (:url . "https://framagit.org/steckerhalter/emacs-fasd"))])
+ (fast-scroll . [(20191016 327) ((emacs (25 1)) (cl-lib (0 6 1))) "Some utilities for faster scrolling over large buffers." single ((:commit . "3f6ca0d5556fe9795b74714304564f2295dcfa24") (:authors ("Matthew Carter" . "m@ahungry.com")) (:maintainer "Matthew Carter" . "m@ahungry.com") (:keywords "ahungry" "convenience" "fast" "scroll" "scrolling") (:url . "https://github.com/ahungry/fast-scroll"))])
+ (fastdef . [(20160713 1329) ((ivy (0 7 0)) (w3m (0 0))) "Insert terminology from Google top search results" single ((:commit . "0696f41dc150d35ce31fe8d2ea74f4173818bb55") (:authors ("Chen Bin <chenin DOT sh AT gmail DOT com>")) (:maintainer "Chen Bin <chenin DOT sh AT gmail DOT com>") (:keywords "terminology" "org-mode" "markdown") (:url . "http://github.com/redguardtoo/fastdef"))])
+ (fastnav . [(20120211 1457) nil "Fast navigation and editing routines." single ((:commit . "1019ba2b61d1a070204099b23da347278a61bc89") (:authors ("Zsolt Terek" . "zsolt@google.com")) (:maintainer "Zsolt Terek" . "zsolt@google.com") (:keywords "nav" "fast" "fastnav" "navigation"))])
+ (faust-mode . [(20201004 1353) nil "Faust syntax colorizer for Emacs." single ((:commit . "2a56cda14b152d5471f21a5d82f23c141dc7134c") (:authors ("rukano" . "rukano@gmail.com")) (:maintainer "Yassin Philip" . "xaccrocheur@gmail.com") (:keywords "languages" "faust") (:url . "https://github.com/rukano/emacs-faust-mode"))])
+ (faustine . [(20171122 1202) ((emacs (24 3)) (faust-mode (0 3))) "Edit, visualize, build and run Faust code" single ((:commit . "07a38963111518f86123802f9d477be0d4689a3f") (:authors ("Yassin Philip" . "xaccrocheur@gmail.com")) (:maintainer "Yassin Philip" . "xaccrocheur@gmail.com") (:keywords "languages" "faust") (:url . "https://bitbucket.org/yphil/faustine"))])
+ (fb2-reader . [(20211214 954) ((emacs (26 2)) (f (0 17)) (s (1 11 0)) (dash (2 12 0)) (visual-fill-column (2 2)) (async (1 9 4))) "Read FB2 and FB2.ZIP documents" single ((:commit . "9dcc0801a7dd302ee0620781ea17868895d3f082") (:authors ("Dmitriy Pshonko" . "jumper047@gmail.com")) (:maintainer "Dmitriy Pshonko" . "jumper047@gmail.com") (:keywords "multimedia" "ebook" "fb2") (:url . "https://github.com/jumper047/fb2-reader"))])
+ (fcitx . [(20190806 1923) nil "Make fcitx better in Emacs" single ((:commit . "12dc2638ddd15c8f6cfaecb20e1f428ab2bb5624") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions") (:url . "https://github.com/cute-jumper/fcitx.el"))])
+ (fcopy . [(20150304 1403) nil "Funny Copy, set past point HERE then search copy text" single ((:commit . "e355f6ec889d8ecbdb096019c2dc660b1cec4941") (:authors ("Masayuki Ataka" . "masayuki.ataka@gmail.com")) (:maintainer "Masayuki Ataka" . "masayuki.ataka@gmail.com") (:keywords "convenience") (:url . "https://github.com/ataka/fcopy"))])
+ (fd-dired . [(20210723 549) ((emacs (25))) "find-dired alternative using fd" single ((:commit . "458464771bb220b6eb87ccfd4c985c436e57dc7e") (:authors ("Rashawn Zhang" . "namy.19@gmail.com")) (:maintainer "Rashawn Zhang" . "namy.19@gmail.com") (:keywords "tools" "fd" "find" "dired") (:url . "https://github.com/yqrashawn/fd-dired"))])
+ (feather . [(20200321 1237) ((emacs (26 3)) (async (1 9)) (async-await (1 0)) (ppp (1 0)) (page-break-lines (0 1))) "Parallel thread modern package manager" tar ((:commit . "3f19293dada8bf368e9f86f783610e7ca0a51ecb") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience" "package") (:url . "https://github.com/conao3/feather.el"))])
+ (feature-mode . [(20220418 848) nil "Major mode for editing Gherkin (i.e. Cucumber) user stories" tar ((:commit . "e204d9e204b767cf95d6a051ff283f05dc51e9d3") (:authors ("Michael Klishin")) (:maintainer "Michael Klishin") (:url . "https://github.com/michaelklishin/cucumber.el"))])
+ (feebleline . [(20190822 1401) nil "Replace modeline with a slimmer proxy" single ((:commit . "b2f2db25cac77817bf0c49ea2cea6383556faea0") (:authors ("Benjamin Lindqvist" . "benjamin.lindqvist@gmail.com")) (:maintainer "Benjamin Lindqvist" . "benjamin.lindqvist@gmail.com") (:url . "https://github.com/tautologyclub/feebleline"))])
+ (feed-discovery . [(20200714 1118) ((emacs (25 1)) (dash (2 16 0))) "Discover feed url by RSS/Atom autodiscovery" single ((:commit . "12fcd1a28fe7c8c46c74e32f395ec631d45ec739") (:authors ("Hiroki YAMAKAWA" . "s06139@gmail.com")) (:maintainer "Hiroki YAMAKAWA" . "s06139@gmail.com") (:url . "https://github.com/HKey/feed-discovery"))])
+ (fennel-mode . [(20220510 748) ((emacs (26 1))) "A major-mode for editing Fennel code" tar ((:commit . "0e9ed013a163d91993a2883ad5c37c02694c2b92") (:authors ("Phil Hagelberg")) (:maintainer "Phil Hagelberg") (:keywords "languages" "tools") (:url . "https://git.sr.ht/~technomancy/fennel-mode"))])
+ (fetch . [(20131201 730) nil "Fetch and unpack resources" single ((:commit . "3f2793afcbbc32f320e572453166f9354ecc6d06") (:authors ("Christian 'crshd' Brassat" . "christian.brassat@gmail.com")) (:maintainer "Christian 'crshd' Brassat" . "christian.brassat@gmail.com") (:url . "https://github.com/crshd/fetch.el"))])
+ (ffmpeg-player . [(20200720 1028) ((emacs (24 4)) (s (1 12 0)) (f (0 20 0))) "Play video using ffmpeg" single ((:commit . "d81983cf389dd5d2ec6cf9d702ff28ffd1be676b") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/ffmpeg-player"))])
+ (fic-mode . [(20180603 2035) nil "Show FIXME/TODO/BUG(...) in special face only in comments and strings" single ((:commit . "a05fc36ed54ba0c6dc22ac216a6a72cf191ca13d") (:url . "https://github.com/lewang/fic-mode"))])
+ (fifo-class . [(20160425 558) nil "First in first out abstract class" single ((:commit . "8fe4cf690727f4ac7b67f29c55f845df023c3f21") (:authors ("Mola-T" . "Mola@molamola.xyz")) (:maintainer "Mola-T" . "Mola@molamola.xyz") (:keywords "lisp") (:url . "https://github.com/mola-T/fifo-class"))])
+ (figlet . [(20160218 2237) nil "Annoy people with big, ascii art text" single ((:commit . "19a38783a90e151faf047ff233a21a729db0cea9") (:authors ("Philip Jackson" . "phil@shellarchive.co.uk")) (:maintainer "Philip Jackson" . "phil@shellarchive.co.uk"))])
+ (filelock . [(20180524 2215) ((emacs (24)) (cl-lib (0)) (f (0))) "Functions for manipulating file locks" single ((:commit . "17a5ca6e0dee14d2e7d92c84be91143bca9d9663") (:authors ("Ryan C. Thompson")) (:maintainer "Ryan C. Thompson") (:keywords "extensions" "files" "tools") (:url . "https://github.com/DarwinAwardWinner/emacs-filelock"))])
+ (filetags . [(20190706 804) ((emacs (24 4))) "Package to manage filetags in filename" single ((:commit . "01e6a919507a832ee001a2a0fc257657f8b04b72") (:authors ("Max Beutelspacher")) (:maintainer "Max Beutelspacher") (:keywords "convenience" "files") (:url . "https://github.com/DerBeutlin/filetags.el"))])
+ (filetree . [(20220312 1650) ((dash (2 12 0)) (helm (3 7 0)) (seq (2 23)) (transient (0 3 6))) "File tree view/manipulatation package" single ((:commit . "9125e5b7ebbb99b8c007018fcfd5034e7ac6630d") (:authors ("Ketan Patel" . "knpatel401@gmail.com")) (:maintainer "Ketan Patel" . "knpatel401@gmail.com") (:url . "https://github.com/knpatel401/filetree"))])
+ (fill-column-indicator . [(20200806 2239) nil "Graphically indicate the fill column" single ((:commit . "c35f9de072c241699b57bcb46da84bed5af29cfe") (:authors ("Alp Aker" . "alp.tekin.aker@gmail.com")) (:maintainer "Alp Aker" . "alp.tekin.aker@gmail.com") (:keywords "convenience"))])
+ (fill-function-arguments . [(20201223 819) ((emacs (24 4))) "Convert function arguments to/from single line" single ((:commit . "a0a2f8538c80ac08e497dea784fcb90c93ab465b") (:authors ("David Shepherd" . "davidshepherd7@gmail.com")) (:maintainer "David Shepherd" . "davidshepherd7@gmail.com") (:keywords "convenience") (:url . "https://github.com/davidshepherd7/fill-function-arguments"))])
+ (fill-page . [(20210707 354) ((emacs (24 4))) "Fill buffer so you don't see empty lines at the end" single ((:commit . "02ab2b3854df5515245ca2a924f89bf830f9c4de") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/fill-page"))])
+ (fillcode . [(20200524 2226) nil "Fill (wrap) function calls and expressions in source code" single ((:commit . "501468082e46bd0975ef4d8765363fd564338099") (:authors ("Ryan Barrett" . "fillcode@ryanb.org")) (:maintainer "Ryan Barrett" . "fillcode@ryanb.org") (:url . "https://snarfed.org/fillcode"))])
+ (filldent . [(20220423 2216) ((emacs (24 1))) "Fill or indent" single ((:commit . "2f32e0cf5e27c613f962fa41bf3427bbdc04e6c0") (:authors ("Case Duckworth" . "acdw@acdw.net")) (:maintainer "Case Duckworth" . "acdw@acdw.net") (:url . "https://github.com/duckwork/filldent.el"))])
+ (finalize . [(20170418 1945) ((emacs (24 1)) (cl-generic (0 3)) (cl-lib (0 3)) (eieio (1 4))) "finalizers for Emacs Lisp" tar ((:commit . "846731531e7d1d80451787992e07bfe7dedbe9ff") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/elisp-finalize"))])
+ (find-by-pinyin-dired . [(20180210 218) ((pinyinlib (0 1 0))) "Find file by first PinYin character of Chinese Hanzi" single ((:commit . "3b4781148dddc84a701ad76c0934ed991ecd59d5") (:authors ("Chen Bin" . "chenbin.sh@gmail.com")) (:maintainer "Chen Bin" . "chenbin.sh@gmail.com") (:keywords "hanzi" "chinese" "dired" "find" "file" "pinyin") (:url . "http://github.com/redguardtoo/find-by-pinyin-dired"))])
+ (find-dupes-dired . [(20210426 835) ((emacs (26 1))) "Find dupes and handle in dired" single ((:commit . "904225a3f89bbd3b44ea097a282ec6ca7945f7f1") (:authors ("Shuguang Sun" . "shuguang79@qq.com")) (:maintainer "Shuguang Sun" . "shuguang79@qq.com") (:keywords "tools") (:url . "https://github.com/ShuguangSun/find-dupes-dired"))])
+ (find-file-in-project . [(20220430 107) ((emacs (25 1))) "Find file/directory and review Diff/Patch/Commit efficiently" single ((:commit . "116b976b526680c038109882d5cd2d9f218b62a5") (:authors ("Phil Hagelberg, Doug Alcorn, and Will Farrington")) (:maintainer "Chen Bin" . "chenbin.sh@gmail.com") (:keywords "project" "convenience") (:url . "https://github.com/redguardtoo/find-file-in-project"))])
+ (find-file-in-repository . [(20210301 2202) nil "Quickly find files in a git, mercurial or other repository" single ((:commit . "10f5bd919ce35691addc5ce0d281597a46813a79") (:authors ("Samuel Hoffstaetter" . "samuel@hoffstaetter.com")) (:maintainer "Samuel Hoffstaetter" . "samuel@hoffstaetter.com") (:keywords "files" "convenience" "repository" "project" "source control") (:url . "https://github.com/hoffstaetter/find-file-in-repository"))])
+ (find-file-rg . [(20220314 1540) ((emacs (25 1))) "Find file in project using ripgrep" single ((:commit . "404b1cc97c2f700d3dc1c66b640f96ed5a268dc3") (:authors ("Andrii Kolomoiets" . "andreyk.mad@gmail.com")) (:maintainer "Andrii Kolomoiets" . "andreyk.mad@gmail.com") (:keywords "tools") (:url . "https://github.com/muffinmad/emacs-find-file-rg"))])
+ (find-temp-file . [(20200117 2254) nil "Open quickly a temporary file" single ((:commit . "2bfcdba0d6a8a0e6faa080cb04ff0f7ed06491ba") (:authors ("Sylvain Rousseau <thisirs at gmail dot com>")) (:maintainer "Sylvain Rousseau <thisirs at gmail dot com>") (:keywords "convenience") (:url . "https://github.com/thisirs/find-temp-file.git"))])
+ (find-things-fast . [(20150519 2226) nil "Find things fast, leveraging the power of git" single ((:commit . "efc7c189019ed65430e2f9e910e8e0a5ca9d2d03") (:authors ("Elvio Toccalino and Elliot Glaysher and Phil Hagelberg and Doug Alcorn")) (:maintainer "Elvio Toccalino and Elliot Glaysher and Phil Hagelberg and Doug Alcorn") (:keywords "project" "convenience"))])
+ (findr . [(20130127 2032) nil "Breadth-first file-finding facility for (X)Emacs" single ((:commit . "1ddbc0464bb05dcda392b62666ad17239a2152d3") (:authors ("David Bakhash" . "cadet@bu.edu")) (:maintainer "David Bakhash" . "cadet@bu.edu") (:keywords "files"))])
+ (fingers . [(20160817 829) nil "Modal editing with universal text manipulation helpers." tar ((:commit . "fed0f742afb1d72eaef29d8da394467550a030fa") (:authors ("Felix Geller" . "fgeller@gmail.com")) (:maintainer "Felix Geller" . "fgeller@gmail.com") (:keywords "fingers" "modal" "editing" "workman") (:url . "http://github.com/fgeller/fingers.el"))])
+ (finito . [(20220427 1932) ((emacs (27 1)) (dash (2 17 0)) (request (0 3 2)) (f (0 2 0)) (s (1 12 0)) (transient (0 3 0)) (graphql (0 1 1)) (async (1 9 3))) "View and collect books" tar ((:commit . "a0fe025086046aecf5490c993afe9e716324f7e5") (:authors ("Laurence Warne")) (:maintainer "Laurence Warne") (:keywords "outlines") (:url . "https://github.com/LaurenceWarne/finito.el"))])
+ (fiplr . [(20140724 645) ((grizzl (0 1 0)) (cl-lib (0 1))) "Fuzzy Search for Files in Projects" tar ((:commit . "3f50159fd42125440d5b0eb9d6398560461f030b") (:authors ("Chris Corbyn" . "chris@w3style.co.uk")) (:maintainer "Chris Corbyn" . "chris@w3style.co.uk") (:keywords "convenience" "usability" "project") (:url . "https://github.com/d11wtq/fiplr"))])
+ (fira-code-mode . [(20210702 1631) ((emacs (24 4))) "Minor mode for Fira Code ligatures using prettify-symbols" single ((:commit . "eaff81f867d9c84e25891368f3d0cac7513984e8") (:authors ("Jonathan Ming" . "jming422@gmail.com")) (:maintainer "Jonathan Ming" . "jming422@gmail.com") (:keywords "faces" "ligatures" "fonts" "programming-ligatures") (:url . "https://github.com/jming422/fira-code-mode"))])
+ (firecode-theme . [(20170808 1311) ((emacs (24 0))) "an Emacs 24 theme based on FireCode (tmTheme)" single ((:commit . "8b7b03ecdd41e70dab145b98906017e1392eaef4") (:authors ("Jason Milkins")) (:maintainer "Jason Milkins") (:url . "https://github.com/emacsfodder/tmtheme-to-deftheme"))])
+ (fireplace . [(20200402 2206) nil "A cozy fireplace for emacs" single ((:commit . "f6c23e259349922aae25cf2898ba815a7d8f2527") (:authors ("Johan Sivertsen" . "johanvts@gmail.com")) (:maintainer "Johan Sivertsen" . "johanvts@gmail.com") (:keywords "games") (:url . "https://github.com/johanvts/emacs-fireplace"))])
+ (firestarter . [(20210508 1626) ((emacs (24 1))) "Execute (shell) commands on save" single ((:commit . "76070c9074aa363350abe6ad06143e90b3e12ab1") (:authors ("Vasilij Schneidermann" . "mail@vasilij.de")) (:maintainer "Vasilij Schneidermann" . "mail@vasilij.de") (:keywords "convenience") (:url . "https://depp.brause.cc/firestarter"))])
+ (firrtl-mode . [(20200329 2002) ((emacs (24 3))) "mode for working with FIRRTL files" single ((:commit . "fa40141411a876ce7a1a9d6d3fe47134bc1fa954") (:authors ("Schuyler Eldridge" . "schuyler.eldridge@ibm.com")) (:maintainer "Schuyler Eldridge" . "schuyler.eldridge@ibm.com") (:keywords "languages" "firrtl") (:url . "https://github.com/ibm/firrtl-mode"))])
+ (fish-completion . [(20191103 1210) ((emacs (25 1))) "Fish completion for pcomplete (shell and Eshell)" single ((:commit . "10384881817b5ae38cf6197a077a663420090d2c") (:authors ("Pierre Neidhardt" . "mail@ambrevar.xyz")) (:maintainer "Pierre Neidhardt" . "mail@ambrevar.xyz") (:url . "https://gitlab.com/Ambrevar/emacs-fish-completion"))])
+ (fish-mode . [(20220505 1111) ((emacs (24))) "Major mode for fish shell scripts" single ((:commit . "d04478c0aba018cb789d77d591bfe315cb25132a") (:authors ("Tony Wang" . "wwwjfy@gmail.com")) (:maintainer "Tony Wang" . "wwwjfy@gmail.com") (:keywords "fish" "shell"))])
+ (fit-text-scale . [(20211230 2002) ((emacs (25 1))) "Fit text by scaling" single ((:commit . "c53c8ce606380088643463848a9ee3502b0c64f4") (:authors ("Marco Wahl" . "marcowahlsoft@gmail.com")) (:maintainer "Marco Wahl" . "marcowahlsoft@gmail.com") (:keywords "convenience") (:url . "https://gitlab.com/marcowahl/fit-text-scale"))])
+ (fix-input . [(20210320 1244) ((emacs (24 4))) "Make input methods play nicely with alternative keyboard layout on OS level" single ((:commit . "b611a8b269d28d226ed1e78fcc7a3120df20f74c") (:authors ("Mark Karpov" . "markkarpov92@gmail.com")) (:maintainer "Mark Karpov" . "markkarpov92@gmail.com") (:keywords "input" "method") (:url . "https://github.com/mrkkrp/fix-input"))])
+ (fix-muscle-memory . [(20210702 1755) nil "Simple hacks to fix muscle memory problems" single ((:commit . "b8d4b8025d758762f4459c70c3a7a209ead865ed") (:authors ("Jonathan Arkell" . "jonnay@jonnay.net")) (:maintainer "Jonathan Arkell" . "jonnay@jonnay.net") (:keywords "spelling" "typing"))])
+ (fix-word . [(20210319 1414) ((emacs (24 1)) (cl-lib (0 5))) "Convenient word transformation" single ((:commit . "e967dd4ac98d777deeede8b497d6337634c06df4") (:authors ("Mark Karpov" . "markkarpov92@gmail.com")) (:maintainer "Mark Karpov" . "markkarpov92@gmail.com") (:keywords "word" "convenience") (:url . "https://github.com/mrkkrp/fix-word"))])
+ (fixmee . [(20150223 1355) ((button-lock (1 0 2)) (nav-flash (1 0 0)) (back-button (0 6 0)) (smartrep (0 0 3)) (string-utils (0 3 2)) (tabulated-list (0))) "Quickly navigate to FIXME notices in code" single ((:commit . "5cddb64e0d52635e9a1529d80cb5cefa6f829341") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "navigation" "convenience") (:url . "http://github.com/rolandwalker/fixmee"))])
+ (flame . [(20180303 2016) ((emacs (24))) "automatic generation of flamage, as if we needed more." single ((:commit . "a749b2a77b87e505572d0f1f5d59fac76348bb73") (:authors ("Ian G. Batten" . "batten@uk.ac.bham.multics") ("Noah Friedman" . "friedman@splode.com")) (:maintainer "Noah Friedman" . "friedman@splode.com") (:keywords "games") (:url . "https://github.com/mschuldt/flame"))])
+ (flames-of-freedom . [(20191202 1637) ((emacs (25 1))) "The flames of freedom" single ((:commit . "5e47ff27cfa2f7c06081be2ffefe91a731efd012") (:authors ("Stéphane Champailler" . "schampailler@skynet.be")) (:maintainer "Stéphane Champailler" . "schampailler@skynet.be") (:keywords "multimedia") (:url . "https://github.com/wiz21b/FlamesOfFreedom"))])
+ (flappymacs . [(20171023 1004) nil "flappybird clone for emacs" single ((:commit . "27f3e21acb22f786606481e3f4e5dc1edbaaaed4") (:authors ("Takayuki Sato")) (:maintainer "Takayuki Sato") (:keywords "games") (:url . "https://github.com/taksatou/flappymacs"))])
+ (flash-region . [(20130923 1817) nil "Flash a region" single ((:commit . "261b3597b23cdd40e5c14262a5687bcc6c1d0901") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "utility"))])
+ (flatbuffers-mode . [(20210710 1004) ((emacs (24 3))) "Major mode for editing flatbuffers" single ((:commit . "8e7783db45a64c9456130fd0c108ac12d45a7789") (:authors ("Asal Mirzaieva" . "asalle.kim@gmail.com")) (:maintainer "Asal Mirzaieva" . "asalle.kim@gmail.com") (:keywords "flatbuffers" "languages") (:url . "https://github.com/Asalle/flatbuffers-mode"))])
+ (flatfluc-theme . [(20210908 1423) ((emacs (26 1))) "Custom merge of flucui and flatui themes" single ((:commit . "33726cd072ad83c6943e1c3b83db2fff60f324ce") (:authors ("Sébastien Le Maguer" . "lemagues@tcd.ie")) (:maintainer "Sébastien Le Maguer" . "lemagues@tcd.ie") (:keywords "lisp") (:url . "https://github.com/seblemaguer/flatfluc-theme"))])
+ (flatland-black-theme . [(20170808 1312) ((emacs (24 0))) "an Emacs 24 theme based on Flatland Black (tmTheme)" single ((:commit . "348c5d5fe615e6ea13cadc17f046e506e789ce07") (:authors ("Jason Milkins")) (:maintainer "Jason Milkins") (:url . "https://github.com/emacsfodder/flatland-black-theme"))])
+ (flatland-theme . [(20171113 1521) nil "A simple theme for Emacs based on the Flatland theme for Sublime Text" single ((:commit . "a98a6f19ad4dff0fa3fad1ea487b7d0ef634a19a") (:authors ("Greg Chapple" . "info@gregchapple.com")) (:maintainer "Greg Chapple" . "info@gregchapple.com") (:url . "http://github.com/gregchapple/flatland-emacs"))])
+ (flatui-dark-theme . [(20170513 1422) ((emacs (24))) "Dark color theme with colors from https://flatuicolors.com/" single ((:commit . "5b959a9f743f891e4660b1b432086417947872ea") (:authors ("Andrew Phillips" . "theasp@gmail.com")) (:maintainer "Andrew Phillips" . "theasp@gmail.com") (:keywords "color" "theme" "dark" "flatui" "faces") (:url . "https://github.com/theasp/flatui-dark-theme"))])
+ (flatui-theme . [(20160619 127) nil "A color theme for Emacs based on flatuicolors.com" single ((:commit . "9c15db5526c15c8dba55023f5698372b19c2a780") (:authors ("John Louis Del Rosario" . "john2x@gmail.com")) (:maintainer "John Louis Del Rosario" . "john2x@gmail.com") (:url . "https://github.com/john2x/flatui-theme.el"))])
+ (flex-autopair . [(20120809 1218) nil "Automatically insert pair braces and quotes, insertion conditions & actions are highly customizable." single ((:commit . "4bb757f2556a4a51828e2fed8fb81e31e83052cb") (:authors ("Yuuki Arisawa" . "yuuki.ari@gmail.com")) (:maintainer "Yuuki Arisawa" . "yuuki.ari@gmail.com") (:keywords "keyboard" "input") (:url . "https://github.com/uk-ar/flex-autopair.el"))])
+ (flex-compile . [(20220205 205) ((emacs (26 1)) (dash (2 17 0)) (buffer-manage (1 1))) "Run, evaluate and compile across many languages" tar ((:commit . "2da0e5e791896810747c710276ff3a1d0465d843") (:authors ("Paul Landes")) (:maintainer "Paul Landes") (:keywords "compilation" "integration" "processes") (:url . "https://github.com/plandes/flex-compile"))])
+ (flex-isearch . [(20170308 2010) nil "Flex matching (like ido) in isearch." single ((:commit . "b1f7e04de762282c276343cc2709af9ff4abc9d2") (:authors ("Jonathan Kotta" . "jpkotta@gmail.com")) (:maintainer "Jonathan Kotta" . "jpkotta@gmail.com") (:keywords "convenience" "search") (:url . "https://bitbucket.org/jpkotta/flex-isearch"))])
+ (flim . [(20220503 1442) ((emacs (24 5)) (apel (10 8)) (oauth2 (0 11))) "A library to provide basic features about message representation or encoding." tar ((:commit . "289e5bbd66f6f14306a6e0b922ee8f26267e2470"))])
+ (flimenu . [(20200810 1510) ((emacs (24 4))) "Flatten imenu automatically" single ((:commit . "4c0ff37cf3bd6c836bd136b5f6c450560a6c92b9") (:authors ("Ivan Malison" . "IvanMalison@gmail.com")) (:maintainer "Ivan Malison" . "IvanMalison@gmail.com") (:keywords "imenu" "browse" "structure" "hook" "mode" "matching" "tools" "convenience" "files") (:url . "https://github.com/IvanMalison/flimenu"))])
+ (fliptext . [(20171124 2056) nil "Input method for flipping characters upside down" single ((:commit . "fd821f645ffebae6ae3894afa7ba7fc06f91afc6") (:authors ("André Riemann" . "andre.riemann@web.de")) (:maintainer "André Riemann" . "andre.riemann@web.de") (:keywords "games" "i18n"))])
+ (floobits . [(20211018 550) ((json (1 2)) (highlight (0))) "Floobits plugin for real-time collaborative editing" tar ((:commit . "93b3317fb6c842efe165e54c8a32bf51d436837d") (:authors ("Matt Kaniaris") ("Geoff Greer")) (:maintainer "Matt Kaniaris") (:keywords "comm" "tools") (:url . "http://github.com/Floobits/floobits-emacs"))])
+ (flow-js2-mode . [(20191213 1004) ((flow-minor-mode (0)) (js2-mode (0)) (emacs (25 1))) "Support for flow annotations in js2-mode" single ((:commit . "7520bdda70287e8d57b3f41033b1e0ca59a3be95") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "languages" "extensions"))])
+ (flow-minor-mode . [(20200905 1730) ((emacs (25 1))) "Flow type mode based on web-mode." single ((:commit . "804217a15a28f6918fba93c91d495ed7d50b0495") (:url . "https://github.com/an-sh/flow-minor-mode"))])
+ (flower . [(20220416 1744) ((emacs (24 4)) (clomacs (0 0 4))) "Emacs task tracker client." tar ((:commit . "047846409867b2dd0ba4e2047a414b498680cd9c") (:authors ("Sergey Sobko" . "flower@tpg.am")) (:maintainer "Sergey Sobko" . "flower@tpg.am") (:keywords "hypermedia" "outlines" "tools" "vc") (:url . "https://github.com/FlowerAutomation/flower"))])
+ (flucui-themes . [(20200815 2103) ((emacs (24))) "Custom theme inspired by the Flat UI palette" tar ((:commit . "6591b5093e6e8f0e720e3995a16a91835b2e7a48") (:authors ("MetroWind" . "chris.corsair@gmail.com")) (:maintainer "MetroWind" . "chris.corsair@gmail.com") (:keywords "lisp") (:url . "https://github.com/MetroWind/flucui-theme"))])
+ (flutter . [(20220502 50) ((emacs (25 1))) "Tools for working with Flutter SDK" tar ((:commit . "e49cbcb70235fa39a7d243521e03ad874451a39a") (:authors ("Aaron Madlon-Kay")) (:maintainer "Aaron Madlon-Kay") (:keywords "languages") (:url . "https://github.com/amake/flutter.el"))])
+ (flutter-l10n-flycheck . [(20220502 50) ((emacs (25 1)) (flycheck (30)) (flutter (0 1 0))) "Flycheck checker for intl_translation" single ((:commit . "e49cbcb70235fa39a7d243521e03ad874451a39a") (:authors ("Aaron Madlon-Kay")) (:maintainer "Aaron Madlon-Kay") (:keywords "languages") (:url . "https://github.com/amake/flutter.el"))])
+ (fluxus-mode . [(20210715 58) ((osc (0 1)) (emacs (24 4))) "Major mode for interfacing with Fluxus" single ((:commit . "a14578640c578a4fd09cb7e25da1e87d637719ae") (:authors ("modula t." . "defaultxr@gmail.com")) (:maintainer "modula t." . "defaultxr@gmail.com") (:keywords "languages") (:url . "https://github.com/defaultxr/fluxus-mode"))])
+ (flx . [(20211101 146) ((cl-lib (0 3))) "fuzzy matching with good sorting" single ((:commit . "e3b3f0533e44c5250ce73d728b59a7e96c692b5d") (:authors ("Le Wang")) (:maintainer "Le Wang") (:url . "https://github.com/lewang/flx"))])
+ (flx-ido . [(20180117 1519) ((flx (0 1)) (cl-lib (0 3))) "flx integration for ido" single ((:commit . "e3b3f0533e44c5250ce73d728b59a7e96c692b5d") (:authors ("Le Wang")) (:maintainer "Le Wang") (:url . "https://github.com/lewang/flx"))])
+ (flx-isearch . [(20191119 515) ((emacs (24)) (flx (20140821)) (cl-lib (0 5))) "Fuzzy incremental searching for emacs" single ((:commit . "a44097fb8f539a193c2f09a37ea52a68f2c51839") (:authors ("PythonNut" . "pythonnut@pythonnut.com")) (:maintainer "PythonNut" . "pythonnut@pythonnut.com") (:keywords "convenience" "search" "flx") (:url . "https://github.com/pythonnut/flx-isearch"))])
+ (flycheck . [(20220504 830) ((dash (2 12 1)) (pkg-info (0 4)) (let-alist (1 0 4)) (seq (1 11)) (emacs (24 3))) "On-the-fly syntax checking" tar ((:commit . "1d7c1b20782ccbaa6f97e37f5e1d0cee3d5eda8a") (:authors ("Sebastian Wiesner" . "swiesner@lunaryorn.com")) (:maintainer "Clément Pit-Claudel" . "clement.pitclaudel@live.com") (:keywords "convenience" "languages" "tools") (:url . "http://www.flycheck.org"))])
+ (flycheck-ameba . [(20191226 1011) ((emacs (24 4)) (flycheck (30))) "Add support for Ameba to Flycheck" single ((:commit . "0c4925ae0e998818326adcb47ed27ddf9761c7dc") (:keywords "tools" "crystal" "ameba") (:url . "https://github.com/crystal-ameba/ameba.el"))])
+ (flycheck-apertium . [(20181211 1038) ((flycheck (0 25))) "Apertium checkers in flycheck" tar ((:commit . "22b60a17836477ac1edd15dc85b14f88ca871ba9") (:authors ("Kevin Brubeck Unhammer" . "unhammer+apertium@mm.st")) (:maintainer "Kevin Brubeck Unhammer" . "unhammer+apertium@mm.st") (:keywords "convenience" "tools" "xml") (:url . "http://wiki.apertium.org/wiki/Emacs"))])
+ (flycheck-aspell . [(20220411 826) ((flycheck (28 0)) (emacs (25 1))) "Aspell checker for flycheck" single ((:commit . "dcf7e6543e4d94d58375e00e4a10db615ef06941") (:authors ("Leo Gaskin" . "leo.gaskin@le0.gs")) (:maintainer "Leo Gaskin" . "leo.gaskin@le0.gs") (:keywords "wp" "flycheck" "spell" "aspell") (:url . "https://github.com/leotaku/flycheck-aspell"))])
+ (flycheck-ats2 . [(20170225 1636) ((emacs (24 1)) (flycheck (0 22))) "Flycheck: ATS2 support" single ((:commit . "9f77add8408462af35bdddf87e37a661880255e3") (:authors ("Mark Laws" . "mdl@60hz.org")) (:maintainer "Mark Laws" . "mdl@60hz.org") (:keywords "convenience" "tools" "languages") (:url . "http://github.com/drvink/flycheck-ats2"))])
+ (flycheck-bashate . [(20200625 642) ((flycheck (0 24)) (emacs (24 4))) "Integrate bashate with flycheck" single ((:commit . "5e673c591d017329d0a07a61dc1223fa98639ee2") (:authors ("Alex Murray" . "murray.alex@gmail.com")) (:maintainer "Alex Murray" . "murray.alex@gmail.com") (:url . "https://github.com/alexmurray/flycheck-bashate"))])
+ (flycheck-cask . [(20200926 1502) ((emacs (24 3)) (flycheck (0 14)) (dash (2 4 0))) "Cask support in Flycheck" single ((:commit . "4b2ede6362ded4a45678dfbef1876faa42edbd58") (:authors ("Sebastian Wiesner" . "swiesner@lunaryorn.com")) (:maintainer "Sebastian Wiesner" . "swiesner@lunaryorn.com") (:keywords "tools" "convenience") (:url . "https://github.com/flycheck/flycheck-cask"))])
+ (flycheck-cfn . [(20220221 1029) ((emacs (26 1)) (flycheck (31))) "Flycheck backend for AWS cloudformation" single ((:commit . "4cf56affe3035fda364109836e26499431095185") (:authors ("William Orr" . "will@worrbase.com")) (:maintainer "William Orr" . "will@worrbase.com") (:keywords "convenience") (:url . "https://gitlab.com/worr/cfn-mode"))])
+ (flycheck-checkbashisms . [(20190403 218) ((emacs (24)) (flycheck (0 25))) "checkbashisms checker for flycheck" single ((:commit . "53598158fa8b74d2e7efea6210edb274e1f0273c") (:authors ("Cuong Le" . "cuong.manhle.vn@gmail.com")) (:maintainer "Cuong Le" . "cuong.manhle.vn@gmail.com") (:keywords "convenience" "tools" "sh" "unix") (:url . "https://github.com/cuonglm/flycheck-checkbashisms"))])
+ (flycheck-checkpatch . [(20170217 1025) ((emacs (25)) (flycheck (30))) "Flycheck support for checkpatch.pl tool" single ((:commit . "6461fc7b0d493eb9863814055f8bce5fa35739de") (:authors ("Alexander Yarygin" . "yarygin.alexander@gmail.com")) (:maintainer "Alexander Yarygin" . "yarygin.alexander@gmail.com") (:url . "https://github.com/zpp0/flycheck-checkpatch"))])
+ (flycheck-clang-analyzer . [(20211214 648) ((flycheck (0 24)) (emacs (24 4))) "Integrate Clang Analyzer with flycheck" single ((:commit . "646d9f3a80046ab231a07526778695d5decad92d") (:authors ("Alex Murray" . "murray.alex@gmail.com")) (:maintainer "Alex Murray" . "murray.alex@gmail.com") (:url . "https://github.com/alexmurray/flycheck-clang-analyzer"))])
+ (flycheck-clang-tidy . [(20201115 1232) ((flycheck (0 30))) "Flycheck syntax checker using clang-tidy" single ((:commit . "f9ae7306bd6ca08b689b36c1e8f6f6b91d61db5f") (:authors (nil . "Sebastian Nagel<sebastian.nagel@ncoding.at>")) (:maintainer "tastytea" . "tastytea@tastytea.de") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/ch1bo/flycheck-clang-tidy"))])
+ (flycheck-clangcheck . [(20150712 710) ((cl-lib (0 5)) (seq (1 7)) (flycheck (0 17))) "A Flycheck checker difinition for ClangCheck." single ((:commit . "24a9424c484420073a24443a829fd5779752362b") (:authors ("kumar8600" . "kumar8600@gmail.com")) (:maintainer "kumar8600" . "kumar8600@gmail.com") (:url . "https://github.com/kumar8600/flycheck-clangcheck"))])
+ (flycheck-clj-kondo . [(20211227 2226) ((emacs (24 3)) (flycheck (0 18))) "Add clj-kondo linter to flycheck" single ((:commit . "35daaccc75b0367844b249a8cb05bf73bcebd52a") (:authors ("Michiel Borkent" . "michielborkent@gmail.com")) (:maintainer "Michiel Borkent" . "michielborkent@gmail.com") (:url . "https://github.com/borkdude/flycheck-clj-kondo"))])
+ (flycheck-clojure . [(20191215 2227) ((cider (0 22 0)) (flycheck (32 -4)) (let-alist (1 0 1)) (emacs (25))) "Flycheck: Clojure support" single ((:commit . "592c4f89efb5112784cbf94c9ea6fdd045771b62") (:authors ("Peter Fraenkel" . "pnf@podsnap.com") ("Sebastian Wiesner" . "swiesner@lunaryorn.com")) (:maintainer "Peter Fraenkel" . "pnf@podsnap.com") (:url . "https://github.com/clojure-emacs/squiggly-clojure"))])
+ (flycheck-clolyze . [(20190422 2134) ((flycheck (0 25)) (emacs (24))) "Add Clolyze to to flycheck" single ((:commit . "c8b27602dd505aeae6486feb6f584754079baf51") (:authors ("Daniel Laps" . "daniel.laps@hhu.de")) (:maintainer "Daniel Laps" . "daniel.laps@hhu.de") (:url . "https://github.com/DLaps/flycheck-clolyze"))])
+ (flycheck-color-mode-line . [(20200528 416) ((flycheck (0 15)) (dash (1 2)) (emacs (24 3))) "Change mode line color with Flycheck status" single ((:commit . "575b604cfe21f65fb07c134392c382c163c87739") (:authors ("Sylvain Benner" . "sylvain.benner@gmail.com")) (:maintainer "Sylvain Benner" . "sylvain.benner@gmail.com") (:keywords "convenience" "language" "tools") (:url . "https://github.com/flycheck/flycheck-color-mode-line"))])
+ (flycheck-coverity . [(20170704 59) ((flycheck (0 24)) (dash (2 12 0)) (emacs (24 4))) "Integrate Coverity with flycheck" single ((:commit . "cb211e3dd50413a5042eb20175be518214591c9d") (:authors ("Alex Murray" . "murray.alex@gmail.com")) (:maintainer "Alex Murray" . "murray.alex@gmail.com") (:url . "https://github.com/alexmurray/flycheck-coverity"))])
+ (flycheck-credo . [(20170526 1545) ((flycheck (29))) "flycheck checker for elixir credo" single ((:commit . "e88f11ead53805c361ec7706e44c3dfee1daa19f") (:authors ("Aaron Jensen" . "aaronjensen@gmail.com")) (:maintainer "Aaron Jensen" . "aaronjensen@gmail.com") (:url . "https://github.com/aaronjensen/flycheck-credo"))])
+ (flycheck-crystal . [(20200805 2344) ((flycheck (30))) "Add support for Crystal to Flycheck" single ((:commit . "96a8058205b24b513d0b9307db32f05e30f9570b") (:keywords "tools" "crystal") (:url . "https://github.com/crystal-lang-tools/emacs-crystal-mode"))])
+ (flycheck-css-colorguard . [(20161031 1122) ((flycheck (0 22)) (emacs (24))) "Detect similar colors in CSS" single ((:commit . "ae94fa0396acd99f9ec36d9572459df793f37fe8") (:authors ("Saša Jovanić" . "info@simplify.ba")) (:maintainer "Saša Jovanić" . "info@simplify.ba") (:keywords "flycheck" "css" "colorguard") (:url . "https://github.com/Simplify/flycheck-css-colorguard/"))])
+ (flycheck-cstyle . [(20160905 2341) ((flycheck (0 24)) (emacs (24 4))) "Integrate cstyle with flycheck" single ((:commit . "207285140a353d08cf1fc450cacab158bc98ba82") (:authors ("Alex Murray" . "murray.alex@gmail.com")) (:maintainer "Alex Murray" . "murray.alex@gmail.com") (:url . "https://github.com/alexmurray/flycheck-cstyle"))])
+ (flycheck-cython . [(20170724 958) ((flycheck (0 25))) "Support Cython in flycheck" single ((:commit . "ecc4454d35ab5317ab66a04406f36f0c1dbc0b76") (:authors ("Lorenzo Bolla" . "lbolla@gmail.com")) (:maintainer "Lorenzo Bolla" . "lbolla@gmail.com"))])
+ (flycheck-d-unittest . [(20160522 417) ((flycheck (0 21 -4 1)) (dash (1 4 0))) "Add D unittest support to flycheck" single ((:commit . "3e614f23cb4a5566fd7988dbcaaf254af81c7718") (:authors ("Tomoya Tanjo" . "ttanjo@gmail.com")) (:maintainer "Tomoya Tanjo" . "ttanjo@gmail.com") (:keywords "flycheck" "d") (:url . "https://github.com/tom-tan/flycheck-d-unittest/"))])
+ (flycheck-dedukti . [(20171103 1212) ((flycheck (0 19)) (dedukti-mode (0 1))) "Flycheck integration of Dedukti" single ((:commit . "3dbff5646355f39d57a3ec514f560a6b0082a1cd") (:authors ("Raphaël Cauderlier")) (:maintainer "Raphaël Cauderlier") (:keywords "convenience" "languages" "tools" "flycheck" "dedukti") (:url . "https://github.com/rafoo/flycheck-dedukti"))])
+ (flycheck-dialyxir . [(20170515 1525) ((flycheck (29))) "flycheck checker for elixir dialyxir" single ((:commit . "adfb73374cb2bee75724822972f405f2ec371199") (:authors ("Aaron Jensen" . "aaronjensen@gmail.com")) (:maintainer "Aaron Jensen" . "aaronjensen@gmail.com") (:url . "https://github.com/aaronjensen/flycheck-dialyxir"))])
+ (flycheck-dialyzer . [(20160326 1430) ((flycheck (0 18))) "Support dialyzer in flycheck" single ((:commit . "a5df0db95ac69f397b5f85d325a6d88cf8974f64") (:authors ("Lorenzo Bolla" . "lbolla@gmail.com")) (:maintainer "Lorenzo Bolla" . "lbolla@gmail.com"))])
+ (flycheck-dmd-dub . [(20210412 1608) ((flycheck (0 24)) (f (0 18 2))) "Sets flycheck-dmd-include-paths from dub package information" single ((:commit . "818bfed45ac8597b6ad568c71eb9428138a125c8") (:authors ("Atila Neves" . "atila.neves@gmail.com")) (:maintainer "Atila Neves" . "atila.neves@gmail.com") (:keywords "languages") (:url . "http://github.com/atilaneves/flycheck-dmd-dub"))])
+ (flycheck-dogma . [(20170125 721) ((flycheck (29))) "flycheck checker for elixir dogma" single ((:commit . "eea1844a81e87e2488b05e703a93272d0fc3bc74") (:authors ("Aaron Jensen" . "aaronjensen@gmail.com")) (:maintainer "Aaron Jensen" . "aaronjensen@gmail.com") (:url . "https://github.com/aaronjensen/flycheck-dogma"))])
+ (flycheck-drstring . [(20200210 1903) ((emacs (25 1)) (flycheck (0 25)) (swift-mode (8 0))) "Doc linting for Swift using DrString" single ((:commit . "d8d5a560e792a6657ef5ac69934c74f1ed51372d") (:authors ("Daniel Martín" . "mardani29@yahoo.es")) (:maintainer "Daniel Martín" . "mardani29@yahoo.es") (:keywords "tools" "flycheck") (:url . "https://github.com/danielmartin/flycheck-drstring"))])
+ (flycheck-dtrace . [(20180903 1630) ((emacs (25 1)) (flycheck (0 22))) "Flycheck: DTrace support" single ((:commit . "951fab3a15c11d92b9fac1ea4791a80dfe034a00") (:authors ("Jürgen Hötzel" . "juergen@hoetzel.info")) (:maintainer "Jürgen Hötzel" . "juergen@hoetzel.info") (:keywords "languages" "convenience" "tools"))])
+ (flycheck-eldev . [(20210305 2231) ((flycheck (32)) (dash (2 17)) (emacs (24 4))) "Eldev support in Flycheck" single ((:commit . "2ed17db874da51fba3d2991a1e05cf375fca9619") (:authors ("Paul Pogonyshev" . "pogonyshev@gmail.com")) (:maintainer "Paul Pogonyshev" . "pogonyshev@gmail.com") (:keywords "tools" "convenience") (:url . "https://github.com/flycheck/flycheck-eldev"))])
+ (flycheck-elixir . [(20210413 612) ((flycheck (0 25))) "Support Elixir in flycheck" single ((:commit . "b57a77a21d6cf9621b3387831cba34135c4fa35d") (:authors ("Lorenzo Bolla" . "lbolla@gmail.com")) (:maintainer "Lorenzo Bolla" . "lbolla@gmail.com"))])
+ (flycheck-elm . [(20181107 146) ((flycheck (0 29 -4)) (emacs (24 4)) (let-alist (1 0 5)) (seq (2 20))) "Flycheck support for the elm language" single ((:commit . "1b60050efd4729bfba548f3e5adbcb58436667cb") (:authors ("Brian Sermons")) (:maintainer "Brian Sermons") (:url . "https://github.com/bsermons/flycheck-elm"))])
+ (flycheck-elsa . [(20200203 1758) ((emacs (25)) (seq (2 0))) "Flycheck for Elsa." tar ((:commit . "911ffb3498e411c538eebce20c6b20b39d725af6") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "convenience") (:url . "https://github.com/emacs-elsa/flycheck-elsa"))])
+ (flycheck-flawfinder . [(20211214 647) ((flycheck (0 24)) (emacs (24 4))) "Integrate flawfinder with flycheck" single ((:commit . "85701b849ea1ed8438ed4b7ae236e99d0f5528c7") (:authors ("Alex Murray" . "murray.alex@gmail.com")) (:maintainer "Alex Murray" . "murray.alex@gmail.com") (:url . "https://github.com/alexmurray/flycheck-flawfinder"))])
+ (flycheck-flow . [(20190304 1459) ((flycheck (0 18)) (json (1 4))) "Support Flow in flycheck" single ((:commit . "9e8e52cfc98af6a23fd906f9cb5d5d470d8cf82d") (:authors ("Lorenzo Bolla" . "lbolla@gmail.com")) (:maintainer "Lorenzo Bolla" . "lbolla@gmail.com"))])
+ (flycheck-ghcmod . [(20150114 632) ((flycheck (0 21 -4 1)) (dash (2 0))) "A flycheck checker for Haskell using ghcmod" single ((:commit . "6bb7b7d879f05bbae54e99eb04806c877adf3ccc") (:authors ("Shen Chao" . "scturtle@gmail.com")) (:maintainer "Shen Chao" . "scturtle@gmail.com") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/scturtle/flycheck-ghcmod"))])
+ (flycheck-golangci-lint . [(20190330 1412) ((emacs (24)) (flycheck (0 22))) "Flycheck checker for golangci-lint" single ((:commit . "8e446c68311048f0b87febf8ef0379e29d358851") (:authors ("Wei Jian Gan" . "weijiangan@outlook.com")) (:maintainer "Wei Jian Gan" . "weijiangan@outlook.com") (:keywords "convenience" "tools" "go") (:url . "https://github.com/weijiangan/flycheck-golangci-lint"))])
+ (flycheck-gometalinter . [(20180424 941) ((emacs (24)) (flycheck (0 22))) "flycheck checker for gometalinter" single ((:commit . "1e3eede14da405b914a7d8b00300846e4393cb83") (:authors ("Diep Pham" . "me@favadi.com")) (:maintainer "Diep Pham" . "me@favadi.com") (:keywords "convenience" "tools" "go") (:url . "https://github.com/favadi/flycheck-gometalinter"))])
+ (flycheck-google-cpplint . [(20210210 300) ((flycheck (0 20 -4 1))) "Help to comply with the Google C++ Style Guide" single ((:commit . "c52ba814f299f62a2a339bae679f3d6d04566854") (:authors ("Akiha Senda" . "senda.akiha@gmail.com")) (:maintainer "Jen-Chieh Shen" . "jcs090218@gmail.com") (:keywords "flycheck" "c" "c++") (:url . "https://github.com/flycheck/flycheck-google-cpplint/"))])
+ (flycheck-gradle . [(20190315 234) ((emacs (25 1)) (flycheck (0 25))) "Flycheck extension for Gradle." single ((:commit . "1ca08bbc343362a923cbdc2010f66e41655e92ab") (:maintainer "James Nguyen" . "james@jojojames.com") (:keywords "languages" "gradle") (:url . "https://github.com/jojojames/flycheck-gradle"))])
+ (flycheck-grammalecte . [(20210705 1656) ((emacs (26 1)) (flycheck (26))) "Integrate Grammalecte with Flycheck" tar ((:commit . "59b37e09923290da1c8458e507da43f403f555d2") (:authors ("Guilhem Doulcier" . "guilhem.doulcier@espci.fr") ("Étienne Deparis" . "etienne@depar.is")) (:maintainer "Étienne Deparis" . "etienne@depar.is") (:keywords "i18n" "text") (:url . "https://git.umaneti.net/flycheck-grammalecte/"))])
+ (flycheck-grammarly . [(20220228 731) ((emacs (25 1)) (flycheck (0 14)) (grammarly (0 3 0)) (s (1 12 0))) "Grammarly support for Flycheck" single ((:commit . "abc66e71d542f65a90c394058cdd3a7b2002c6a6") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/emacs-grammarly/flycheck-grammarly"))])
+ (flycheck-guile . [(20201202 509) ((emacs (24 1)) (flycheck (0 22)) (geiser (0 11))) "A Flycheck checker for GNU Guile" single ((:commit . "e46d6e5453dd7471309fae6549445c48e6d8f340") (:authors ("Ricardo Wurmus" . "rekado@elephly.net")) (:maintainer "Andrew Whatson" . "whatson@gmail.com") (:url . "https://github.com/flatwhatson/flycheck-guile"))])
+ (flycheck-haskell . [(20220426 2358) ((emacs (24 3)) (flycheck (0 25)) (haskell-mode (13 7)) (dash (2 4 0)) (seq (1 11)) (let-alist (1 0 1))) "Flycheck: Automatic Haskell configuration" tar ((:commit . "d92dea78fb8638f7c27a3eb925d84c669fb257dd") (:authors ("Sebastian Wiesner" . "swiesner@lunaryorn.com")) (:maintainer "Sebastian Wiesner" . "swiesner@lunaryorn.com") (:keywords "tools" "convenience") (:url . "https://github.com/flycheck/flycheck-haskell"))])
+ (flycheck-hdevtools . [(20160926 702) ((flycheck (0 21 -4 1)) (dash (2 0))) "A flycheck checker for Haskell using hdevtools" single ((:commit . "8248ebaf8376ee5e37ff47c814a291550a7bdcf2") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/flycheck/flycheck-hdevtools"))])
+ (flycheck-hledger . [(20220323 726) ((emacs (27 1)) (flycheck (31))) "Flycheck module to check hledger journals" single ((:commit . "87b275b9b3d476b5f458e85e760f3f7fa3e66775") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:url . "https://github.com/DamienCassou/flycheck-hledger/"))])
+ (flycheck-indent . [(20200129 2046) ((emacs (25 1)) (indent-lint (1 0 0)) (flycheck (31))) "Indent-lint frontend for flycheck" single ((:commit . "c55f4ded11e8e50a96f43675a071354a8fb501c3") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "tools") (:url . "https://github.com/conao3/indent-lint.el"))])
+ (flycheck-indicator . [(20200331 1142) ((flycheck (0 15))) "A fancy mode line indicator for `flycheck-mode'" single ((:commit . "e00d9a20cbc21d6814c27cc9206296da394478e8") (:authors ("Eder Elorriaga" . "gexplorer8@gmail.com")) (:maintainer "Eder Elorriaga" . "gexplorer8@gmail.com") (:keywords "convenience" "language" "tools") (:url . "https://github.com/gexplorer/flycheck-indicator"))])
+ (flycheck-ini-pyinilint . [(20190312 1931) ((flycheck (31))) "Flycheck integration for PyINILint" single ((:commit . "7febbea9ed407eccc4bfd24ae0d3afd1c19394f7") (:authors ("Daniel J. R. May" . "daniel.may@danieljrmay.com")) (:maintainer "Daniel J. R. May" . "daniel.may@danieljrmay.com") (:keywords "convenience" "files" "tools") (:url . "https://gitlab.com/danieljrmay/flycheck-ini-pyinilint"))])
+ (flycheck-inline . [(20200808 1019) ((emacs (25 1)) (flycheck (32))) "Display Flycheck errors inline" single ((:commit . "8e00b4c5951a9515a450a14aefe92e9f6ddcfbde") (:authors ("fmdkdd")) (:maintainer "fmdkdd") (:keywords "tools" "convenience") (:url . "https://github.com/flycheck/flycheck-inline"))])
+ (flycheck-irony . [(20180604 2152) ((emacs (24 1)) (flycheck (0 22)) (irony (0 2 0))) "Flycheck: C/C++ support via Irony" single ((:commit . "42dbecd4a865cabeb301193bb4d660e26ae3befe") (:authors ("Guillaume Papin" . "guillaume.papin@epitech.eu")) (:maintainer "Guillaume Papin" . "guillaume.papin@epitech.eu") (:keywords "convenience" "tools" "c") (:url . "https://github.com/Sarcasm/flycheck-irony/"))])
+ (flycheck-jest . [(20180411 328) ((emacs (25 1)) (flycheck (0 25))) "Flycheck extension for Jest." single ((:commit . "08f27c5ed97c83c445f99fab58f0b6c826f14449") (:maintainer "James Nguyen" . "james@jojojames.com") (:keywords "languages" "jest") (:url . "https://github.com/jojojames/flycheck-jest"))])
+ (flycheck-joker . [(20200412 2346) ((flycheck (0 18))) "Add Clojure syntax checker (via Joker) to flycheck" single ((:commit . "93576295fef7a749bf779eeece5edd85e21868e2") (:authors ("Roman Bataev" . "roman.bataev@gmail.com")) (:maintainer "Roman Bataev" . "roman.bataev@gmail.com"))])
+ (flycheck-julia . [(20170729 2141) ((emacs (24)) (flycheck (0 22))) "Julia support for Flycheck" single ((:commit . "213b60a5a9a1cb7887260e1d159b5bb27167cbb6") (:authors ("Guido Kraemer" . "guido.kraemer@gmx.de")) (:maintainer "Guido Kraemer" . "guido.kraemer@gmx.de") (:keywords "convenience" "tools" "languages") (:url . "https://github.com/gdkrmr/flycheck-julia"))])
+ (flycheck-keg . [(20200726 218) ((emacs (24 3)) (keg (0 1)) (flycheck (0 1))) "Flycheck for Keg projects" single ((:commit . "944e36144d92a798e1fd0f3d83fc6347d57a976e") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience") (:url . "https://github.com/conao3/keg.el"))])
+ (flycheck-kotlin . [(20210406 1148) ((flycheck (0 20))) "Support kotlin in flycheck" single ((:commit . "bf1b398bdde128806a0a7479ebbe369bbaa40dae") (:authors ("Elric Milon" . "whirm_REMOVETHIS__@gmx.com")) (:maintainer "Elric Milon" . "whirm_REMOVETHIS__@gmx.com"))])
+ (flycheck-languagetool . [(20220402 1703) ((emacs (25 1)) (flycheck (0 14))) "Flycheck support for LanguageTool" single ((:commit . "63674d8b928377d763df40317e15f4ca257f77d6") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com") ("Peter Oliver" . "git@mavit.org.uk")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/emacs-languagetool/flycheck-languagetool"))])
+ (flycheck-ledger . [(20200304 2204) ((emacs (24 1)) (flycheck (0 15))) "Flycheck integration for ledger files" single ((:commit . "628e25ba66604946085571652a94a54f4d1ad96f") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/purcell/flycheck-ledger"))])
+ (flycheck-lilypond . [(20211006 2102) ((emacs (24 3)) (flycheck (0 22))) "LilyPond support in Flycheck" single ((:commit . "78f8c16cd67f9f6d3f1806e1fd403222723ba400") (:authors ("Hinrik Örn Sigurðsson" . "hinrik.sig@gmail.com")) (:maintainer "Hinrik Örn Sigurðsson" . "hinrik.sig@gmail.com") (:keywords "tools" "convenience") (:url . "https://github.com/hinrik/flycheck-lilypond"))])
+ (flycheck-liquidhs . [(20170412 2326) ((flycheck (0 15))) "A flycheck checker for Haskell using liquid (i.e. liquidhaskell)" single ((:commit . "c27252ac24d77f4b6eec76a4ba9cd61761a3fba9") (:authors ("Ranjit Jhala" . "jhala@cs.ucsd.edu")) (:maintainer "Ranjit Jhala" . "jhala@cs.ucsd.edu") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/ucsd-progsys/liquidhaskell/flycheck-liquid.el"))])
+ (flycheck-mercury . [(20181118 1952) ((flycheck (0 22)) (s (1 9 0)) (dash (2 4 0))) "Mercury support in Flycheck" single ((:commit . "b6807a8db70981e21a91a93324c31e49de85c89f") (:authors ("Matthias Güdemann" . "matthias.gudemann@gmail.com")) (:maintainer "Matthias Güdemann" . "matthias.gudemann@gmail.com") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/flycheck/flycheck-mercury"))])
+ (flycheck-mmark . [(20190713 1323) ((emacs (24 4)) (flycheck (0 29))) "Flycheck checker for the MMark markdown processor" single ((:commit . "67d6216229337c9c020a8aecd6ae2417de29b5e8") (:authors ("Mark Karpov" . "markkarpov92@gmail.com")) (:maintainer "Mark Karpov" . "markkarpov92@gmail.com") (:keywords "convenience" "text") (:url . "https://github.com/mmark-md/flycheck-mmark"))])
+ (flycheck-mypy . [(20200113 1336) ((flycheck (0 18))) "Support mypy in flycheck" single ((:commit . "5b4e14ab0cbce2ff35fee7e69b5b95eafd609c80") (:authors ("Lorenzo Bolla" . "lbolla@gmail.com")) (:maintainer "Lorenzo Bolla" . "lbolla@gmail.com"))])
+ (flycheck-nim . [(20190927 1514) ((dash (2 4 0)) (flycheck (0 20))) "Defines a flycheck syntax checker for nim" single ((:commit . "ddfade51001571c2399f78bcc509e0aa8eb752a4") (:authors ("Adam Schwalm" . "adamschwalm@gmail.com")) (:maintainer "Adam Schwalm" . "adamschwalm@gmail.com") (:url . "https://github.com/ALSchwalm/flycheck-nim"))])
+ (flycheck-nimsuggest . [(20171027 2208) ((flycheck (0 23)) (emacs (24 3))) "flycheck backend for Nim using nimsuggest" single ((:commit . "dc9a5de1cb3ee05db5794d824610959a1f603bc9") (:authors ("Yuta Yamada <cokesboy\"at\"gmail.com>")) (:maintainer "Yuta Yamada <cokesboy\"at\"gmail.com>") (:url . "https://github.com/yuutayamada/flycheck-nimsuggest"))])
+ (flycheck-objc-clang . [(20210911 1023) ((emacs (24 4)) (flycheck (26))) "Flycheck: Objective-C support using Clang" single ((:commit . "0a86156fad0d6f02e8e6b4c5594f7173c96d6481") (:authors ("Goichi Hirakawa" . "gooichi@gyazsquare.com")) (:maintainer "Goichi Hirakawa" . "gooichi@gyazsquare.com") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/GyazSquare/flycheck-objc-clang"))])
+ (flycheck-ocaml . [(20170730 2153) ((emacs (24 1)) (flycheck (0 22)) (merlin (3 0 1)) (let-alist (1 0 3))) "Flycheck: OCaml support" single ((:commit . "8707a7bf545a8639a6a5c600a98d9a2ea1487dc9") (:authors ("Sebastian Wiesner" . "swiesner@lunaryorn.com")) (:maintainer "Sebastian Wiesner" . "swiesner@lunaryorn.com") (:keywords "convenience" "tools" "languages") (:url . "https://github.com/flycheck/flycheck-ocaml"))])
+ (flycheck-package . [(20210509 2323) ((emacs (24 1)) (flycheck (0 22)) (package-lint (0 2))) "A Flycheck checker for elisp package authors" single ((:commit . "615c1ed8c6fb7c73abec6aaa73d3fef498d231bc") (:authors ("Steve Purcell" . "steve@sanityinc.com") ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "lisp") (:url . "https://github.com/purcell/flycheck-package"))])
+ (flycheck-pact . [(20180920 2052) ((emacs (24 3)) (flycheck (0 25)) (pact-mode (0 0 4))) "Flycheck support for pact-mode" single ((:commit . "0e10045064ef89ec8b6f5a473073d47b976a2ca3") (:authors ("Stuart Popejoy")) (:maintainer "Stuart Popejoy" . "stuart@kadena.io") (:keywords "pact" "lisp" "languages" "blockchain" "smartcontracts" "tools" "linting") (:url . "http://github.com/kadena-io/flycheck-pact"))])
+ (flycheck-pest . [(20200317 1503) ((emacs (26 3)) (flycheck (31)) (pest-mode (0 1))) "Flycheck integration for Pest -" single ((:commit . "43447a2c70f98edd1139005e32f437d3f142442b") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience" "flycheck") (:url . "https://github.com/ksqsf/pest-mode"))])
+ (flycheck-php-noverify . [(20211005 401) ((flycheck (0 22))) "Flycheck checker for PHP Noverify linter" single ((:commit . "3c5cfa5b790bb7f0a8da7f3caee8e4782b67f8ac") (:url . "https://github.com/Junker/flycheck-php-noverify"))])
+ (flycheck-phpstan . [(20210714 1805) ((emacs (24 3)) (flycheck (26)) (phpstan (0 5 0))) "Flycheck integration for PHPStan" single ((:commit . "0869b152f82a76138daa53e953285936b9d558bd") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "tools" "php") (:url . "https://github.com/emacs-php/phpstan.el"))])
+ (flycheck-pkg-config . [(20200409 501) ((dash (2 8 0)) (s (1 9 0)) (flycheck (29))) "configure flycheck using pkg-config" single ((:commit . "b76b24ea1f4800f5fb96ce9c6c4788e0e63133d3") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:keywords "flycheck"))])
+ (flycheck-plantuml . [(20171018 111) ((flycheck (0 24)) (emacs (24 4)) (plantuml-mode (1 2 2))) "Integrate plantuml with flycheck" single ((:commit . "183be89e1dbba0b38237dd198dff600e0790309d") (:authors ("Alex Murray" . "murray.alex@gmail.com")) (:maintainer "Alex Murray" . "murray.alex@gmail.com") (:url . "https://github.com/alexmurray/flycheck-plantuml"))])
+ (flycheck-pony . [(20210118 1326) ((flycheck (0 25 1))) "Pony support in Flycheck" single ((:commit . "2d5b72903e69e1e5eec2d03b9006a62fbbf75233") (:keywords "tools" "convenience") (:url . "https://github.com/seantallen/flycheck-pony"))])
+ (flycheck-popup-tip . [(20170812 2351) ((flycheck (0 22)) (popup (0 5)) (emacs (24))) "Display Flycheck error messages using popup.el" single ((:commit . "ef86aad907f27ca076859d8d9416f4f7727619c6") (:authors ("Saša Jovanić" . "sasa@simplify.ba")) (:maintainer "Saša Jovanić" . "sasa@simplify.ba") (:keywords "convenience" "tools" "flycheck" "tooltip") (:url . "https://github.com/flycheck/flycheck-popup-tip/"))])
+ (flycheck-pos-tip . [(20200516 1600) ((emacs (24 1)) (flycheck (0 22)) (pos-tip (0 4 6))) "Display Flycheck errors in GUI tooltips" single ((:commit . "dc57beac0e59669926ad720c7af38b27c3a30467") (:authors ("Akiha Senda" . "senda.akiha@gmail.com") ("Sebastian Wiesner" . "swiesner@lunaryorn.com")) (:maintainer "Sebastian Wiesner" . "swiesner@lunaryorn.com") (:keywords "tools" "convenience") (:url . "https://github.com/flycheck/flycheck-pos-tip"))])
+ (flycheck-posframe . [(20210316 618) ((flycheck (0 24)) (emacs (26)) (posframe (0 7 0))) "Show flycheck error messages using posframe.el" single ((:commit . "8f60c9bf124ab9597d681504a73fdf116a0bde12") (:authors ("Alex Murray" . "murray.alex@gmail.com")) (:maintainer "Alex Murray" . "murray.alex@gmail.com") (:url . "https://github.com/alexmurray/flycheck-posframe"))])
+ (flycheck-projectile . [(20201031 1952) ((emacs (25 1)) (flycheck (31)) (projectile (2 2))) "Project-wide errors" single ((:commit . "ce6e9e8793a55dace13d5fa13badab2dca3b5ddb") (:authors ("Nikita Bloshchanevich" . "nikblos@outlook.com")) (:maintainer "Nikita Bloshchanevich" . "nikblos@outlook.com") (:url . "https://github.com/nbfalcon/flycheck-projectile"))])
+ (flycheck-prospector . [(20180524 450) ((flycheck (0 22))) "Support prospector in flycheck" single ((:commit . "92f2680573290ba4a69a2d6e140f44680efce6a8") (:authors ("Carlos Coelho" . "carlospecter@gmail.com")) (:maintainer "Carlos Coelho" . "carlospecter@gmail.com") (:url . "https://github.com/chocoelho/flycheck-prospector"))])
+ (flycheck-psalm . [(20211002 1555) ((emacs (24 3)) (flycheck (26)) (psalm (0 6 0))) "Flycheck integration for Psalm" single ((:commit . "28d546a79cb865a78b94cd7e929d66d720505faa") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "tools" "php") (:url . "https://github.com/emacs-php/psalm.el"))])
+ (flycheck-pycheckers . [(20211122 235) ((flycheck (0 18))) "multiple syntax checker for Python, using Flycheck" tar ((:commit . "56965c0ef5d45bcef90093360718c6967ce4ef39") (:keywords "convenience" "tools" "languages") (:url . "https://github.com/msherry/flycheck-pycheckers"))])
+ (flycheck-pyflakes . [(20170330 2311) ((flycheck (0 18))) "Support pyflakes in flycheck" single ((:commit . "61b045939e3743b2162b7e4e73249c66fc2b8f65") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk"))])
+ (flycheck-pyre . [(20190215 1222) ((emacs (24)) (flycheck (29)) (cl-lib (0 6))) "Support Pyre in flycheck" tar ((:commit . "0560122caae207d99d8af1ac2b4e5d6f6a1ce444") (:authors ("Vyacheslav Linnik" . "vyacheslav.linnik@gmail.com")) (:maintainer "Vyacheslav Linnik" . "vyacheslav.linnik@gmail.com") (:url . "https://github.com/linnik/flycheck-pyre"))])
+ (flycheck-raku . [(20220420 732) ((emacs (26 3)) (flycheck (0 22))) "Raku support in Flycheck" single ((:commit . "4da1970a75396aff1957b07f7579c1de6b817e6b") (:authors ("Hinrik Örn Sigurðsson" . "hinrik.sig@gmail.com") ("Johnathon Weare" . "jrweare@gmail.com") ("Siavash Askari Nasr" . "siavash.askari.nasr@gmail.com")) (:maintainer "Hinrik Örn Sigurðsson" . "hinrik.sig@gmail.com") (:keywords "tools" "convenience") (:url . "https://github.com/Raku/flycheck-raku"))])
+ (flycheck-relint . [(20200721 2217) ((emacs (26 1)) (flycheck (0 22)) (relint (1 15))) "A Flycheck checker for elisp regular expressions" single ((:commit . "c66d0c8d2e3a8abb6a3dfda597801e460b2eeb6f") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "lisp") (:url . "https://github.com/purcell/flycheck-relint"))])
+ (flycheck-rtags . [(20191222 920) ((emacs (24)) (flycheck (0 23)) (rtags (2 10))) "RTags Flycheck integration" single ((:commit . "db39790fda5c2443bc790b8971ac140914f7e9c2") (:authors ("Christian Schwarzgruber" . "c.schwarzgruber.cs@gmail.com")) (:maintainer "Christian Schwarzgruber" . "c.schwarzgruber.cs@gmail.com") (:url . "https://github.com/Andersbakken/rtags"))])
+ (flycheck-rust . [(20190319 1546) ((emacs (24 1)) (flycheck (28)) (dash (2 13 0)) (seq (2 3)) (let-alist (1 0 4))) "Flycheck: Rust additions and Cargo support" single ((:commit . "a139cd53c5062697e9ed94ad80b803c37d999600") (:authors ("Sebastian Wiesner" . "swiesner@lunaryorn.com")) (:maintainer "Sebastian Wiesner" . "swiesner@lunaryorn.com") (:keywords "tools" "convenience") (:url . "https://github.com/flycheck/flycheck-rust"))])
+ (flycheck-stan . [(20211129 2051) ((emacs (25 1)) (flycheck (0 16 0)) (stan-mode (10 3 0))) "Add Stan support for Flycheck" tar ((:commit . "150bbbe5fd3ad2b5a3dbfba9d291e66eeea1a581") (:authors ("Jeffrey Arnold" . "jeffrey.arnold@gmail.com") ("Kazuki Yoshida" . "kazukiyoshida@mail.harvard.edu")) (:maintainer "Kazuki Yoshida" . "kazukiyoshida@mail.harvard.edu") (:keywords "c" "languages") (:url . "https://github.com/stan-dev/stan-mode/tree/master/flycheck-stan"))])
+ (flycheck-status-emoji . [(20180330 2325) ((cl-lib (0 1)) (emacs (24)) (flycheck (0 20)) (let-alist (1 0))) "Show flycheck status using cute, compact emoji" single ((:commit . "4bd113ab42dec9544b66e0a27ed9008ce8148433") (:authors ("Ben Liblit" . "liblit@acm.org")) (:maintainer "Ben Liblit" . "liblit@acm.org") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/liblit/flycheck-status-emoji"))])
+ (flycheck-swift . [(20170129 549) ((emacs (24 4)) (flycheck (0 25))) "Flycheck extension for Apple's Swift." single ((:commit . "4c5ad401252400a78da395fd56a71e67ff8c2761") (:keywords "languages" "swift"))])
+ (flycheck-swift3 . [(20210910 1244) ((emacs (24 4)) (flycheck (26))) "Flycheck: Swift support for Apple swift-mode" single ((:commit . "54193175c87a4c0bbf7ed16a3e76d6daff35c76f") (:authors ("Goichi Hirakawa" . "gooichi@gyazsquare.com")) (:maintainer "Goichi Hirakawa" . "gooichi@gyazsquare.com") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/GyazSquare/flycheck-swift3"))])
+ (flycheck-swiftlint . [(20180830 340) ((emacs (25 1)) (flycheck (0 25))) "Flycheck extension for Swiftlint." single ((:commit . "8861ddbd9c1c2a951630d9ea29162ad0916580cb") (:maintainer "James Nguyen" . "james@jojojames.com") (:keywords "languages" "swiftlint" "swift" "emacs") (:url . "https://github.com/jojojames/flycheck-swiftlint"))])
+ (flycheck-swiftx . [(20200814 845) ((emacs (26 1)) (flycheck (26)) (xcode-project (1 0))) "Flycheck: Swift backend" single ((:commit . "84f42393dea362d3bdfc9253a205a17ec7a12a76") (:authors ("John Buckley" . "john@olivetoast.com")) (:maintainer "John Buckley" . "john@olivetoast.com") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/nhojb/flycheck-swiftx"))])
+ (flycheck-tcl . [(20180327 1259) ((emacs (24 4)) (flycheck (0 22))) "A flycheck checker for Tcl using tclchecker" single ((:commit . "7ca23f4673e178b9f5dcc8a82b86cf05b15d7236") (:authors ("Niels Widger" . "niels.widger@gmail.com")) (:maintainer "Niels Widger" . "niels.widger@gmail.com") (:url . "https://github.com/nwidger/flycheck-tcl"))])
+ (flycheck-tip . [(20171020 1048) ((flycheck (29)) (emacs (24 1)) (popup (0 5 0))) "Show flycheck/flymake errors by tooltip" tar ((:commit . "9b0072d92e6b4a52834bf5a34120a0f5e1c8c2fd") (:authors ("Yuta Yamada <cokesboy\"at\"gmail.com>")) (:maintainer "Yuta Yamada <cokesboy\"at\"gmail.com>") (:keywords "flycheck") (:url . "https://github.com/yuutayamada/flycheck-tip"))])
+ (flycheck-title . [(20210321 558) ((flycheck (30)) (emacs (24))) "show flycheck errors in the frame title" single ((:commit . "74e4375f372f7b9ce0fdfa34dc74a048376679ae") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk"))])
+ (flycheck-vale . [(20190609 1533) ((emacs (24 4)) (flycheck (0 22)) (let-alist (1 0 4))) "flycheck integration for vale" single ((:commit . "f08249535348d046d0974b9c20fe1b7dd3cd2660") (:authors ("Austin Bingham" . "austin.bingham@gmail.com")) (:maintainer "Austin Bingham" . "austin.bingham@gmail.com") (:url . "https://github.com/abingham/flycheck-vale"))])
+ (flycheck-vdm . [(20190304 839) ((emacs (24)) (flycheck (32 -4)) (vdm-mode (0 0 4))) "Syntax checking for vdm-mode" single ((:commit . "56336930555df91787f196acac15680498d17d5e") (:authors ("Peter W. V. Tran-Jørgensen" . "peter.w.v.jorgensen@gmail.com")) (:maintainer "Peter W. V. Tran-Jørgensen" . "peter.w.v.jorgensen@gmail.com") (:keywords "languages") (:url . "https://github.com/peterwvj/vdm-mode"))])
+ (flycheck-xcode . [(20180122 651) ((emacs (25 1)) (flycheck (0 25))) "Flycheck extension for Apple's Xcode." single ((:commit . "b76f872c8985801951a095b8b3c1572b94189f9e") (:maintainer "James Nguyen" . "james@jojojames.com") (:keywords "languages" "xcode") (:url . "https://github.com/jojojames/flycheck-xcode"))])
+ (flycheck-yamllint . [(20170325 1735) ((flycheck (30))) "Flycheck integration for YAMLLint" single ((:commit . "1e9fe3b2d3e42d551b94473816a8eeee637b446c") (:authors ("Krzysztof Magosa" . "krzysztof@magosa.pl")) (:maintainer "Krzysztof Magosa" . "krzysztof@magosa.pl") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/krzysztof-magosa/flycheck-yamllint"))])
+ (flycheck-yang . [(20180312 1831) ((yang-mode (0 9 4)) (flycheck (0 18))) "YANG flycheck checker" single ((:commit . "47881fc42ef0163c47064b72b5d6dbef4f83d778") (:authors (nil . "Andrew Fort (@andaru)")) (:maintainer nil . "Andrew Fort (@andaru)"))])
+ (flycheck-ycmd . [(20181016 618) ((emacs (24)) (dash (2 13 0)) (flycheck (0 22)) (ycmd (1 2)) (let-alist (1 0 5))) "flycheck integration for ycmd" single ((:commit . "c17ff9e0250a9b39d23af37015a2b300e2f36fed") (:authors ("Austin Bingham" . "austin.bingham@gmail.com")) (:maintainer "Austin Bingham" . "austin.bingham@gmail.com") (:url . "https://github.com/abingham/emacs-ycmd"))])
+ (flymake-aspell . [(20220411 826) ((emacs (26 1))) "Aspell checker for flymake" single ((:commit . "dcf7e6543e4d94d58375e00e4a10db615ef06941") (:authors ("Leo Gaskin" . "leo.gaskin@le0.gs")) (:maintainer "Leo Gaskin" . "leo.gaskin@le0.gs") (:keywords "wp" "flymake" "spell" "aspell") (:url . "https://github.com/leotaku/flycheck-aspell"))])
+ (flymake-coffee . [(20170723 146) ((flymake-easy (0 1))) "A flymake handler for coffee script" single ((:commit . "dee295acf30820ed15fe0de17137d50bc27fc80c") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/flymake-coffee"))])
+ (flymake-collection . [(20220410 1343) ((emacs (28 1)) (let-alist (1 0)) (flymake (1 2 1))) "Collection of checkers for flymake, bringing flymake to the level of flycheck" tar ((:commit . "8f36fed9eef834cf94931fc8b813f9ac8db6d2a4") (:authors ("Mohsin Kaleem" . "mohkale@kisara.moe")) (:maintainer "Mohsin Kaleem" . "mohkale@kisara.moe") (:keywords "language" "tools") (:url . "https://github.com/mohkale/flymake-collection"))])
+ (flymake-css . [(20170723 146) ((flymake-easy (0 1))) "Flymake support for css using csslint" single ((:commit . "de090163ba289910ceeb61b13368ce42d0f2dfd8") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/flymake-css"))])
+ (flymake-cursor . [(20220506 1458) ((flymake (0 3))) "Show flymake messages in the minibuffer after delay" single ((:commit . "6ce75c17bc02ae9755deda50d5ac366785c94091") (:authors ("Unknown Original Author") ("Dino Chiesa" . "dpchiesa@hotmail.com") ("Sam Graham <libflymake-emacs BLAHBLAH illusori.co.uk>")) (:maintainer "Sam Graham <libflymake-emacs BLAHBLAH illusori.co.uk>") (:keywords "languages" "mode" "flymake") (:url . "https://github.com/flymake/emacs-flymake-cursor"))])
+ (flymake-diagnostic-at-point . [(20180815 1004) ((emacs (26 1)) (popup (0 5 3))) "Display flymake diagnostics at point" single ((:commit . "379616b1c6f5ebeaf08fbe54ae765008a78b3be7") (:authors ("Ricardo Martins" . "ricardo@scarybox.net")) (:maintainer "Ricardo Martins" . "ricardo@scarybox.net") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/meqif/flymake-diagnostic-at-point"))])
+ (flymake-easy . [(20140818 755) nil "Helpers for easily building flymake checkers" single ((:commit . "de41ea49503f71f997e5c359a2ad08df696c0147") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "convenience" "internal") (:url . "https://github.com/purcell/flymake-easy"))])
+ (flymake-elixir . [(20130810 1417) nil "A flymake handler for elixir-mode .ex files." single ((:commit . "3810566cffe35d04cc3f01e27fe397d68d52f802") (:authors ("Sylvain Benner" . "syl20bnr@gmail.com")) (:maintainer "Sylvain Benner" . "syl20bnr@gmail.com"))])
+ (flymake-eslint . [(20220318 152) ((emacs (26 0))) "A Flymake backend for Javascript using eslint" single ((:commit . "bfcf28259c7d774b259a6ed122f1f0936a5b96b9") (:authors ("Dan Orzechowski")) (:maintainer "Dan Orzechowski") (:url . "https://github.com/orzechowskid/flymake-eslint"))])
+ (flymake-flycheck . [(20220313 924) ((flycheck (31)) (emacs (26 1))) "Use flycheck checkers as flymake backends" single ((:commit . "9040be3763b8f9952dccd9a04be25ac20a0f8745") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/purcell/flymake-flycheck"))])
+ (flymake-gjshint . [(20130327 1232) nil "A flymake handler for javascript using both jshint and gjslint" single ((:commit . "dc957c14cb060819585de8aedb330e24efa4b784") (:authors ("Yasuyuki Oka" . "yasuyk@gmail.com")) (:maintainer "Yasuyuki Oka" . "yasuyk@gmail.com") (:keywords "flymake" "javascript" "jshint" "gjslint"))])
+ (flymake-go . [(20150714 733) nil "A flymake handler for go-mode files" single ((:commit . "ae83761aa908c1a50ff34af04f00dcc46bca2ce9") (:authors ("Michael Fellinger" . "michael@iron.io") ("Robert Zaremba" . "robert.marek.zaremba@wp.eu")) (:maintainer "Michael Fellinger" . "michael@iron.io") (:keywords "go" "flymake") (:url . "https://github.com/robert-zaremba/flymake-go"))])
+ (flymake-go-staticcheck . [(20190708 1325) ((emacs (25))) "Go staticcheck linter for flymake" single ((:commit . "130079fcd29c3e2a72f8325f3041042bcc6286f1") (:authors ("Sergey Kostyaev" . "feo.me@ya.ru")) (:maintainer "Sergey Kostyaev" . "feo.me@ya.ru") (:keywords "languages" "tools") (:url . "https://github.com/s-kostyaev/flymake-go-staticcheck"))])
+ (flymake-golangci . [(20191028 1927) ((flymake-easy (0 1)) (emacs (24))) "A flymake handler for go-mode files using Golang CI lint" single ((:commit . "dfc31a1a6ae3f087b49fe6f5f21b3866780aa91c") (:authors ("Jorge Javier Araya Navarro" . "jorgejavieran@yahoo.com.mx")) (:maintainer "Jorge Javier Araya Navarro" . "jorgejavieran@yahoo.com.mx") (:url . "https://gitlab.com/shackra/flymake-golangci"))])
+ (flymake-gradle . [(20190315 233) ((emacs (26 1))) "Flymake extension for Gradle." single ((:commit . "dbedd29b78d4828ef57d4de20867be5df3eaab99") (:maintainer "James Nguyen" . "james@jojojames.com") (:keywords "languages" "gradle") (:url . "https://github.com/jojojames/flymake-gradle"))])
+ (flymake-grammarly . [(20220222 638) ((emacs (26 1)) (grammarly (0 3 0)) (s (1 12 0))) "Flymake support for Grammarly" single ((:commit . "74ab6bb817205dbf1cd77a161be76904c1e17b75") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/emacs-grammarly/flymake-grammarly"))])
+ (flymake-hadolint . [(20220328 823) ((emacs (26 1))) "Flymake backend for hadolint, a Dockerfile linter" single ((:commit . "82a6df7f6cc95e1ab95c5d28f2edcd8c1d4c7382") (:authors ("Taiki Sugawara" . "buzz.taiki@gmail.com")) (:maintainer "Taiki Sugawara" . "buzz.taiki@gmail.com") (:keywords "convenience" "processes" "docker" "flymake") (:url . "https://github.com/buzztaiki/flymake-hadolint"))])
+ (flymake-haml . [(20170723 146) ((flymake-easy (0 1))) "A flymake handler for haml files" single ((:commit . "22a81e8484734552d461e7ae7305664dc244447e") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/flymake-haml"))])
+ (flymake-haskell-multi . [(20170723 146) ((flymake-easy (0 1))) "Syntax-check haskell-mode using both ghc and hlint" tar ((:commit . "b564a94312259885b1380272eb867bf52a164020") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/flymake-haskell-multi"))])
+ (flymake-hlint . [(20170723 146) ((flymake-easy (0 1))) "A flymake handler for haskell-mode files using hlint" single ((:commit . "f910736b26784efc9a2fa29503f45c1f1dd0aa38") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/flymake-hlint"))])
+ (flymake-joker . [(20200315 1429) ((emacs (26 1)) (flymake-quickdef (0 1 1))) "Add Clojure syntax checker (via Joker) to flymake" single ((:commit . "fc132beedac9e6f415b72e578e77318fd13af9ee") (:authors ("Mateusz Probachta" . "mateusz.probachta@gmail.com")) (:maintainer "Mateusz Probachta" . "mateusz.probachta@gmail.com") (:url . "https://github.com/beetleman/flymake-joker"))])
+ (flymake-jshint . [(20140319 2200) ((flymake-easy (0 8))) "making flymake work with JSHint" single ((:commit . "79dd554c227883c487db38ac111306c8d5382c95") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:keywords "flymake" "jshint" "javascript"))])
+ (flymake-jslint . [(20170723 146) ((flymake-easy (0 1))) "A flymake handler for javascript using jslint" single ((:commit . "8edb82be605542b0ef62d38d818adcdde335eecb") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/flymake-jslint"))])
+ (flymake-json . [(20180511 911) ((flymake-easy (0 1))) "A flymake handler for json using jsonlint" single ((:commit . "03b4e5e7ad11938781257a783e717ab95fe65952") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/flymake-json"))])
+ (flymake-kondor . [(20211026 501) ((emacs (26 1))) "Linter with clj-kondo" single ((:commit . "784e57f36812a37e323409b90b935ef3c6920a22") (:authors ("https://turbocafe.keybase.pub")) (:maintainer "https://turbocafe.keybase.pub") (:url . "https://github.com/turbo-cafe/flymake-kondor"))])
+ (flymake-ktlint . [(20180831 346) ((emacs (26 1))) "Flymake extension for Ktlint." single ((:commit . "56aab6f2d22061999050783dbc3166cdb456d0bb") (:maintainer "James Nguyen" . "james@jojojames.com") (:keywords "languages" "ktlint") (:url . "https://github.com/jojojames/flymake-ktlint"))])
+ (flymake-languagetool . [(20220414 429) ((emacs (27 1)) (s (1 9 0))) "Flymake support for LanguageTool" single ((:commit . "a61bafdda1c9bb684a98216598df95a33cbb9549") (:url . "https://github.com/emacs-languagetool/flymake-languagetool"))])
+ (flymake-less . [(20151111 738) ((less-css-mode (0 15)) (flymake-easy (0 1))) "Flymake handler for LESS stylesheets (lesscss.org)" single ((:commit . "32d3c28a9a5c52b82d1741ff9d715013b6498421") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "languages"))])
+ (flymake-lua . [(20170129 154) nil "Flymake for Lua" single ((:commit . "84589f20066921a5b79cf3a1f914a223a2552d2a") (:authors (nil . "Sébastien Roccaserra (format \"<%s%s@%s.%s>\" \"s\" \"roccaserra\" \"yahoo\" \"com\")")) (:maintainer nil . "Sébastien Roccaserra (format \"<%s%s@%s.%s>\" \"s\" \"roccaserra\" \"yahoo\" \"com\")") (:keywords "lua"))])
+ (flymake-markdownlint . [(20220320 1208) ((emacs (27 1))) "Markdown linter with markdownlint" single ((:commit . "59e3520668d9394c573e07b7980a2d48d9f6086c") (:authors ("Martin Kjær Jørgensen" . "mkj@gotu.dk")) (:maintainer "Martin Kjær Jørgensen" . "mkj@gotu.dk") (:url . "https://github.com/shaohme/flymake-markdownlint"))])
+ (flymake-nasm . [(20210310 1540) ((flymake-quickdef (1 0 0)) (emacs (26 1))) "A flymake handler for asm-mode files using nasm" single ((:commit . "27e58d7f3a48ca6fc12238fe6c888a3fdffc3f75") (:authors ("Jürgen Hötzel" . "juergen@hoetzel.info")) (:maintainer "Jürgen Hötzel") (:keywords "tools" "languages") (:url . "http://github.com/juergenhoetzel/flymake-nasm"))])
+ (flymake-perlcritic . [(20120328 814) ((flymake (0 3))) "Flymake handler for Perl to invoke Perl::Critic" tar ((:commit . "06d819c6d1292f8c87ebc0681c83c9fb48620bbe") (:authors ("Sam Graham <libflymake-perlcritic-emacs BLAHBLAH illusori.co.uk>")) (:maintainer "Sam Graham <libflymake-perlcritic-emacs BLAHBLAH illusori.co.uk>") (:url . "https://github.com/illusori/emacs-flymake-perlcritic"))])
+ (flymake-pest . [(20200317 1503) ((emacs (26 3)) (pest-mode (0 1))) "A flymake handler for Pest files" single ((:commit . "43447a2c70f98edd1139005e32f437d3f142442b") (:authors ("ksqsf" . "i@ksqsf.moe") ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "ksqsf" . "i@ksqsf.moe") (:keywords "languages" "flymake") (:url . "https://github.com/ksqsf/pest-mode"))])
+ (flymake-php . [(20170723 146) ((flymake-easy (0 1))) "A flymake handler for php-mode files" single ((:commit . "c045d01e002ba5e09b05f40e25bf5068d02126bc") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/flymake-php"))])
+ (flymake-phpcs . [(20140713 631) ((flymake-easy (0 9))) "making flymake work with PHP CodeSniffer" single ((:commit . "10d3e7e1c31c104e3da694b2b52cd34df61efa5e") (:authors ("Akiha Senda")) (:maintainer "Akiha Senda") (:keywords "flymake" "phpcs" "php") (:url . "https://github.com/senda-akiha/flymake-phpcs/"))])
+ (flymake-phpstan . [(20210714 1805) ((emacs (26 1)) (phpstan (0 5 0))) "Flymake backend for PHP using PHPStan" single ((:commit . "0869b152f82a76138daa53e953285936b9d558bd") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "tools" "php") (:url . "https://github.com/emacs-php/phpstan.el"))])
+ (flymake-puppet . [(20170801 554) ((flymake-easy (0 9))) "Flymake handler using puppet-lint" single ((:commit . "8a772395f4ccc59d883712ab53a92a17c1d9a429") (:authors ("Ben Prew")) (:maintainer "Ben Prew") (:url . "https://github.com/benprew/flymake-puppet"))])
+ (flymake-python-pyflakes . [(20170723 146) ((flymake-easy (0 8))) "A flymake handler for python-mode files using pyflakes (or flake8)" single ((:commit . "1d65c26bf65a5dcbd29fcd967e2feb90e1e7a33d") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/flymake-python-pyflakes"))])
+ (flymake-quickdef . [(20200308 2342) ((emacs (26 1))) "Quickly define a new Flymake backend" single ((:commit . "150c5839768a3d32f988f9dc08052978a68f2ad7") (:authors ("Karl Otness")) (:maintainer "Karl Otness") (:keywords "languages" "tools" "convenience" "lisp") (:url . "https://github.com/karlotness/flymake-quickdef"))])
+ (flymake-racket . [(20210105 606) ((emacs (26 1))) "Flymake extension for Racket." single ((:commit . "3d3e5f2a9ab696670f9e52baa4dde7b84b7542df") (:maintainer "James Nguyen" . "james@jojojames.com") (:keywords "languages" "racket" "scheme") (:url . "https://github.com/jojojames/flymake-racket"))])
+ (flymake-rakudo . [(20220424 637) ((emacs (28 1)) (flymake-collection (2 0 0)) (let-alist (1 0))) "Flymake syntax checker for Rakudo" single ((:commit . "f8e3d03a7207876cd891174702efd572d74f2e49") (:authors ("Siavash Askari Nasr" . "ciavash@proton.me")) (:maintainer "Siavash Askari Nasr" . "ciavash@proton.me") (:keywords "language" "tools" "convenience") (:url . "https://github.com/Raku/flymake-rakudo"))])
+ (flymake-ruby . [(20170723 146) ((flymake-easy (0 1))) "A flymake handler for ruby-mode files" single ((:commit . "6c320c6fb686c5223bf975cc35178ad6b195e073") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/flymake-ruby"))])
+ (flymake-sass . [(20170723 146) ((flymake-easy (0 1))) "Flymake handler for sass and scss files" single ((:commit . "2de28148e92deb93bff3d55fe14e7c67ac476056") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/flymake-sass"))])
+ (flymake-shell . [(20170723 146) ((flymake-easy (0 1))) "A flymake syntax-checker for shell scripts" single ((:commit . "a16cf453056b9849cc7c912bb127fb0b08fc6dab") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/flymake-shell"))])
+ (flymake-shellcheck . [(20220308 2218) ((emacs (26))) "A bash/sh Flymake backend powered by ShellCheck" single ((:commit . "688638177b4e23ecc192975e3062274ca904ada1") (:authors ("Federico Tedin" . "federicotedin@gmail.com")) (:maintainer "Federico Tedin" . "federicotedin@gmail.com") (:url . "https://github.com/federicotdn/flymake-shellcheck"))])
+ (flymake-solidity . [(20170805 644) ((flymake-easy (0 10))) "A flymake handler for solidity using solc" single ((:commit . "48bfe9525f764d8a68cc0270905dbf45bfd00bb8") (:authors ("Pascal van Kooten" . "kootenpv@gmail.com")) (:maintainer "Pascal van Kooten" . "kootenpv@gmail.com") (:url . "https://github.com/kootenvp/flymake-solidity"))])
+ (flymake-swi-prolog . [(20220404 950) ((emacs (26 1))) "A Flymake backend for SWI-Prolog" single ((:commit . "ae0e4b706a40b71c007ed6cb0ec5425d49bea4c3") (:authors ("Eshel Yaron")) (:maintainer "Eshel Yaron") (:keywords "languages") (:url . "https://git.sr.ht/~eshel/flymake-swi-prolog"))])
+ (flymake-vala . [(20150326 531) ((flymake-easy (0 1))) "A flymake handler for vala-mode files" single ((:commit . "c3674f461fc84fb0300cd3a562fb903a59782745") (:authors ("Daniel Lawrence" . "dannyla@linux.com")) (:maintainer "Daniel Lawrence" . "dannyla@linux.com") (:keywords "convenience" "vala") (:url . "https://github.com/daniellawrence/flymake-vala"))])
+ (flymake-vnu . [(20181128 216) ((emacs (26 1))) "Flymake extension for the v.Nu HTML validator." single ((:commit . "7c4ab9d12611756ad5a80d866890b2f9b73fb611") (:maintainer "Stefan Kuznetsov" . "skuznetsov@posteo.net") (:keywords "languages") (:url . "https://github.com/theneosloth/flymake-vnu"))])
+ (flymake-yaml . [(20130423 1548) ((flymake-easy (0 1))) "A flymake handler for YAML" single ((:commit . "24cb5b744a1796e554e6dbfc6eeb237d06a00b10") (:authors ("Yasuyuki Oka" . "yasuyk@gmail.com")) (:maintainer "Yasuyuki Oka" . "yasuyk@gmail.com") (:keywords "yaml") (:url . "https://github.com/yasuyk/flymake-yaml"))])
+ (flymake-yamllint . [(20220311 636) ((emacs (26 1))) "YAML linter with yamllint" single ((:commit . "a93bf9a6697566f0e29fb51a87c5cc7b2a972d2d") (:authors ("Martin Kjær Jørgensen" . "mkj@gotu.dk")) (:maintainer "Martin Kjær Jørgensen" . "mkj@gotu.dk") (:url . "https://github.com/shaohme/flymake-yamllint"))])
+ (flymd . [(20160617 1214) ((cl-lib (0 5))) "On the fly markdown preview" tar ((:commit . "84d5a68bcfed4a295952c33ffcd11e880978d9d7") (:authors ("Mola-T" . "Mola@molamola.xyz")) (:maintainer "Mola-T" . "Mola@molamola.xyz") (:keywords "markdown" "convenience") (:url . "https://github.com/mola-T/flymd"))])
+ (flyparens . [(20140723 1846) nil "Check for unbalanced parens on the fly" tar ((:commit . "af9b8cfd647d0e5f97684d613dc2eea7cfc19398") (:authors ("Jisang Yoo")) (:maintainer "Jisang Yoo") (:keywords "faces" "convenience" "lisp" "matching" "parentheses" "parens"))])
+ (flyspell-correct . [(20220131 834) ((emacs (24))) "Correcting words with flyspell via custom interface" tar ((:commit . "e8027a412262bc04056a5b5440efdb7f370c3320") (:authors ("Boris Buliga" . "boris@d12frosted.io")) (:maintainer "Boris Buliga" . "boris@d12frosted.io") (:url . "https://github.com/d12frosted/flyspell-correct"))])
+ (flyspell-correct-avy-menu . [(20210124 1143) ((flyspell-correct (0 6 1)) (avy-menu (0 1 1)) (emacs (24))) "Correcting words with flyspell via avy-menu interface" single ((:commit . "e8027a412262bc04056a5b5440efdb7f370c3320") (:authors ("Boris Buliga" . "boris@d12frosted.io") ("Clemens Radermacher" . "clemera@posteo.net")) (:maintainer "Boris Buliga" . "boris@d12frosted.io") (:url . "https://github.com/d12frosted/flyspell-correct"))])
+ (flyspell-correct-helm . [(20210124 1143) ((flyspell-correct (0 6 1)) (helm (1 9 0)) (emacs (24))) "Correcting words with flyspell via helm interface" single ((:commit . "e8027a412262bc04056a5b5440efdb7f370c3320") (:authors ("Boris Buliga" . "boris@d12frosted.io")) (:maintainer "Boris Buliga" . "boris@d12frosted.io") (:url . "https://github.com/d12frosted/flyspell-correct"))])
+ (flyspell-correct-ivy . [(20210124 1143) ((flyspell-correct (0 6 1)) (ivy (0 8 0)) (emacs (24 4))) "Correcting words with flyspell via ivy interface" single ((:commit . "e8027a412262bc04056a5b5440efdb7f370c3320") (:authors ("Boris Buliga" . "boris@d12frosted.io")) (:maintainer "Boris Buliga" . "boris@d12frosted.io") (:url . "https://github.com/d12frosted/flyspell-correct"))])
+ (flyspell-correct-popup . [(20210124 1143) ((flyspell-correct (0 6 1)) (popup (0 5 3)) (emacs (24))) "Correcting words with flyspell via popup interface" single ((:commit . "e8027a412262bc04056a5b5440efdb7f370c3320") (:authors ("Boris Buliga" . "boris@d12frosted.io")) (:maintainer "Boris Buliga" . "boris@d12frosted.io") (:url . "https://github.com/d12frosted/flyspell-correct"))])
+ (flyspell-lazy . [(20210308 1253) nil "Improve flyspell responsiveness using idle timers" single ((:commit . "0fc5996bcee20b46cbd227ae948d343c3bef7339") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "spelling") (:url . "http://github.com/rolandwalker/flyspell-lazy"))])
+ (flyspell-popup . [(20170529 815) ((popup (0 5 0))) "Correcting words with Flyspell in popup menus" single ((:commit . "29311849bfd253b9b689bf331860b4c4d3bd4dde") (:authors ("Chunyang Xu" . "mail@xuchunyang.me")) (:maintainer "Chunyang Xu" . "mail@xuchunyang.me") (:keywords "convenience") (:url . "https://github.com/xuchunyang/flyspell-popup"))])
+ (fm-bookmarks . [(20170104 1716) ((emacs (24 3)) (cl-lib (0 5))) "Use file manager bookmarks (eg Dolphin, Nautilus, PCManFM) in Dired" single ((:commit . "11dacfd16a926bfecba96a94c6b13e162c7717f7") (:authors ("Ono Hiroko" . "azazabc123@gmail.com")) (:maintainer "Ono Hiroko" . "azazabc123@gmail.com") (:keywords "files" "convenience") (:url . "http://github.com/kuanyui/fm-bookmarks.el"))])
+ (fn . [(20210304 1812) ((emacs (24)) (cl-lib (0 5)) (dash (2 18 0))) "Concise anonymous functions for Emacs Lisp" single ((:commit . "98e3fe1b4785e162d9aca978a2db106baa79260f") (:authors ("Troy Pracy")) (:maintainer "Troy Pracy") (:keywords "functional"))])
+ (focus . [(20191209 2210) ((emacs (24 3)) (cl-lib (0 5))) "Dim the font color of text in surrounding sections" single ((:commit . "5f3f20e7f22fb9fd7c48abce8bd38061d97e4bc0") (:authors ("Lars Tveito" . "larstvei@ifi.uio.no")) (:maintainer "Lars Tveito" . "larstvei@ifi.uio.no") (:url . "http://github.com/larstvei/Focus"))])
+ (focus-autosave-mode . [(20160519 2116) ((emacs (24 4))) "Automatically save files in focus-out-hook." single ((:commit . "2e0844fabb6f0dc9e0f31928e4785febf38b9e35") (:authors ("Wojciech Siewierski" . "wojciech.siewierski@onet.pl")) (:maintainer "Wojciech Siewierski" . "wojciech.siewierski@onet.pl") (:keywords "convenience" "files" "frames" "mouse"))])
+ (foggy-night-theme . [(20190123 1614) ((emacs (24))) "Dark low contrast theme with soft and muted colors." single ((:commit . "14894e06ee5c6e14db36f2cb07387ee971c1736f") (:authors ("Martin Haesler")) (:maintainer "Martin Haesler"))])
+ (fold-dwim . [(20140208 1637) nil "Unified user interface for Emacs folding modes" single ((:commit . "c46f4bb2ce91b4e307136320e72c28dd50b6cd8b") (:authors ("Peter Heslin" . "p.j.heslin@dur.ac.uk")) (:maintainer "Peter Heslin" . "p.j.heslin@dur.ac.uk") (:url . "http://www.dur.ac.uk/p.j.heslin/Software/Emacs"))])
+ (fold-dwim-org . [(20131203 1351) ((fold-dwim (1 2))) "Fold DWIM bound to org key-strokes." single ((:commit . "c09bb2b46d65afbd1d0febc6fded7495be7a3037") (:authors ("Matthew L. Fidler & Shane Celis")) (:maintainer "Matthew L. Fidler") (:keywords "folding" "emacs" "org-mode") (:url . "https://github.com/mlf176f2/fold-dwim-org"))])
+ (fold-this . [(20191107 1816) nil "Just fold this region please" single ((:commit . "c3912c738cf0515f65162479c55999e2992afce5") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "convenience") (:url . "https://github.com/magnars/fold-this.el"))])
+ (folding . [(20220110 1718) nil "A folding-editor-like minor mode." tar ((:commit . "1ce338b991c69358a607c37bfb16ffb7de7e91c4") (:maintainer "Jari Aalto <jari aalto A T cante dt net>") (:keywords "tools"))])
+ (font-lock-profiler . [(20170208 2008) ((emacs (24 3))) "Coverage and timing tool for font-lock keywords." single ((:commit . "6e096458416888a4f63cca0d6bc5965a052753c8") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "faces" "tools") (:url . "https://github.com/Lindydancer/font-lock-profiler"))])
+ (font-lock-studio . [(20170127 2051) ((emacs (24 3))) "interactive debugger for Font Lock keywords." single ((:commit . "12c35967b31233e06946c70627aa3152dacfe261") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "faces" "tools") (:url . "https://github.com/Lindydancer/font-lock-studio"))])
+ (font-utils . [(20210405 1149) ((persistent-soft (0 8 8)) (pcache (0 2 3))) "Utility functions for working with fonts" single ((:commit . "abc572eb0dc30a26584c0058c3fe6c7273a10003") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "extensions") (:url . "http://github.com/rolandwalker/font-utils"))])
+ (fontawesome . [(20170305 1356) ((emacs (24 4))) "fontawesome utility" tar ((:commit . "a5fafe89d4032fd1f0c21b7b04708ef2cce2517b") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-fontawesome"))])
+ (fontify-face . [(20210503 1956) ((emacs (24))) "Fontify symbols representing faces with that face." single ((:commit . "d1386c88ccc77ccfb40b888ff90d6181325d14f8") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "faces") (:url . "https://github.com/Fuco1/fontify-face"))])
+ (fontsloth . [(20211118 2018) ((f (0 20 0)) (logito (0 1)) (pcache (0 5)) (stream (2 2 5)) (emacs (28 0))) "Elisp otf/ttf font loader/renderer" tar ((:commit . "5572a44e14d6c00a628f58cc695c735ef64e0ebd") (:authors ("Jo Gay" . "jo.gay@mailfence.com")) (:maintainer "Jo Gay" . "jo.gay@mailfence.com") (:keywords "data" "font" "rasterization" "ttf" "otf") (:url . "https://github.com/jollm/fontsloth"))])
+ (forecast . [(20191004 1850) ((emacs (24 4))) "Weather forecasts" single ((:commit . "350af0e5d53307c900e4f8b2617f3852f51a74d2") (:authors ("Göktuğ Kayaalp" . "self@gkayaalp.com")) (:maintainer "Göktuğ Kayaalp" . "self@gkayaalp.com") (:keywords "weather" "forecast") (:url . "https://dev.gkayaalp.com/elisp/index.html#forecast-el"))])
+ (foreign-regexp . [(20200325 50) nil "search and replace by foreign regexp." tar ((:commit . "e2dd47f2160cadc194eb156e7c76c3c869e6706e") (:authors ("K-talo Miyazaki <Keitaro dot Miyazaki at gmail dot com>")) (:maintainer "K-talo Miyazaki <Keitaro dot Miyazaki at gmail dot com>") (:keywords "convenience" "emulations" "matching" "tools" "unix" "wp"))])
+ (foreman-mode . [(20170725 1422) ((s (1 9 0)) (dash (2 10 0)) (dash-functional (1 2 0)) (f (0 17 2)) (emacs (24))) "View and manage Procfile-based applications" single ((:commit . "22b3bb13134b617870ed1e888af739f4818be929") (:authors ("ZHOU Feng" . "zf.pascal@gmail.com")) (:maintainer "ZHOU Feng" . "zf.pascal@gmail.com") (:keywords "foreman") (:url . "http://github.com/zweifisch/foreman-mode"))])
+ (forest-blue-theme . [(20160627 842) ((emacs (24))) "Emacs theme with a dark background." single ((:commit . "58096ce1a25615d2bae806c3775bae3e2775019d") (:authors ("olkinn")) (:maintainer "olkinn"))])
+ (forge . [(20220506 420) ((emacs (25 1)) (compat (28 1 1 0)) (closql (1 2 0)) (dash (2 19 1)) (emacsql-sqlite (3 0 0)) (ghub (3 5 4)) (let-alist (1 0 6)) (magit (3 3 0)) (markdown-mode (2 4)) (transient (0 3 6)) (yaml (0 3 4))) "Access Git forges from Magit." tar ((:commit . "05babf69068de7a982bd2e8ad888f37dc7319003") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "git" "tools" "vc") (:url . "https://github.com/magit/forge"))])
+ (form-feed . [(20210508 1627) ((emacs (24 1))) "Display ^L glyphs as horizontal lines" single ((:commit . "ac1f0ef30a11979f5dfe12d8c05a666739e486ff") (:authors ("Vasilij Schneidermann" . "mail@vasilij.de")) (:maintainer "Vasilij Schneidermann" . "mail@vasilij.de") (:keywords "faces") (:url . "https://depp.brause.cc/form-feed"))])
+ (format-all . [(20220412 1141) ((emacs (24 4)) (inheritenv (0 1)) (language-id (0 19))) "Auto-format C, C++, JS, Python, Ruby and 50 other languages" single ((:commit . "a07bf109ce8e27458a40420508943f53856549fc") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "languages" "util") (:url . "https://github.com/lassik/emacs-format-all-the-code"))])
+ (format-sql . [(20150422 1333) nil "Use format-sql to make your SQL readable in directly Emacs." single ((:commit . "97f475c245cd6c81a72a265678e2087cee66ac7b") (:authors ("Friedrich Paetzke" . "paetzke@fastmail.fm")) (:maintainer "Friedrich Paetzke" . "paetzke@fastmail.fm") (:url . "https://github.com/paetzke/format-sql.el"))])
+ (format-table . [(20181223 1616) ((emacs (25)) (dash (2 14 1))) "Parse and reformat tabular data." single ((:commit . "dfcae3a867e574577fc09a43b045889ff155b58f") (:authors ("Jason Duncan" . "jasond496@msn.com")) (:maintainer "Jason Duncan" . "jasond496@msn.com") (:keywords "data") (:url . "https://github.com/functionreturnfunction/format-table"))])
+ (forth-mode . [(20220402 2103) nil "Programming language mode for Forth" tar ((:commit . "122a9916c1ad1f1e3f4888951e1ad92a2fc10804") (:authors ("Lars Brinkhoff" . "lars@nocrew.org")) (:maintainer "Lars Brinkhoff" . "lars@nocrew.org") (:keywords "languages" "forth") (:url . "http://github.com/larsbrinkhoff/forth-mode"))])
+ (fortpy . [(20150715 2032) ((epc (0 1 0)) (auto-complete (1 4)) (python-environment (0 0 2)) (pos-tip (0 4 5))) "a Fortran auto-completion for Emacs" tar ((:commit . "c614517e9396ef7a78be3b8786fbf303879cf43b") (:authors ("Conrad Rosenbrock <rosenbrockc at gmail.com>")) (:maintainer "Conrad Rosenbrock <rosenbrockc at gmail.com>"))])
+ (fortune-cookie . [(20181223 842) nil "Print a fortune in your scratch buffer." single ((:commit . "6c1c08f5be83822c0b762872ab25e3dbee96f333") (:authors ("Andrew Schwartzmeyer" . "andrew@schwartzmeyer.com")) (:maintainer "Andrew Schwartzmeyer" . "andrew@schwartzmeyer.com") (:keywords "fortune" "cowsay" "scratch" "startup") (:url . "https://github.com/andschwa/fortune-cookie"))])
+ (fountain-mode . [(20211223 405) ((emacs (24 4)) (seq (2 20))) "Major mode for screenwriting in Fountain markup" tar ((:commit . "fba17c2b316122e26292ba995f1c62191b7b3eb0") (:authors ("Paul W. Rankin" . "pwr@bydasein.com")) (:maintainer "Paul W. Rankin" . "pwr@bydasein.com") (:keywords "wp" "text") (:url . "https://github.com/rnkn/fountain-mode"))])
+ (fraktur-mode . [(20160815 227) ((cl-lib (0 5))) "Easily insert Unicode mathematical Fraktur characters" single ((:commit . "514baf5546aed12a0d9fa0fe66e87cdcc7843b08") (:authors ("Grant Rettke" . "gcr@wisdomandwonder.com")) (:maintainer nil . "<gcr@wisdomandwonder.com>") (:keywords "unicode" "fraktur" "math" "mathematical") (:url . "https://github.com/grettke/fraktur-mode"))])
+ (frame-local . [(20180330 940) ((emacs (25 1))) "Variables local to a frame" single ((:commit . "7ee1106c3bcd4022f48421f8cb1ef4f995da816e") (:authors ("Sebastien Chapuis" . "sebastien@chapu.is")) (:maintainer "Sebastien Chapuis" . "sebastien@chapu.is") (:keywords "frames" "tools" "local" "lisp") (:url . "https://github.com/sebastiencs/frame-local"))])
+ (frame-mode . [(20190710 2030) ((s (1 9 0)) (emacs (24 4))) "Use frames instead of windows" single ((:commit . "ae2366969927c9f89ea07c999bef382b0b47cac1") (:authors ("Ivan Malison" . "IvanMalison@gmail.com")) (:maintainer "Ivan Malison" . "IvanMalison@gmail.com") (:keywords "frames") (:url . "https://github.com/IvanMalison/frame-mode"))])
+ (frame-purpose . [(20211011 1518) ((emacs (25 1)) (dash (2 18))) "Purpose-specific frames" single ((:commit . "7d498147445cc0afb87b922a8225d2e163e5ed5a") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "buffers" "convenience" "frames") (:url . "http://github.com/alphapapa/frame-purpose.el"))])
+ (frame-tag . [(20170111 6) ((cl-lib (0 5))) "Minor mode that assigns a unique number to each frame for easy switching" single ((:commit . "73d6163568c7d32952175e663318b872f995a4e5") (:authors ("Wong Liang Zan" . "zan@liangzan.net")) (:maintainer "Wong Liang Zan" . "zan@liangzan.net") (:keywords "frame" "movement") (:url . "http://github.com/liangzan/frame-tag.el"))])
+ (frames-only-mode . [(20210107 918) ((emacs (24 4)) (dash (2 13 0)) (s (1 11 0))) "Use frames instead of Emacs windows" single ((:commit . "d3f6647c484656ddabdac5d18546599a03823cd4") (:authors ("David Shepherd" . "davidshepherd7@gmail.com")) (:maintainer "David Shepherd" . "davidshepherd7@gmail.com") (:keywords "frames" "windows") (:url . "https://github.com/davidshepherd7/frames-only-mode"))])
+ (frameshot . [(20220509 2010) ((emacs (25 3)) (compat (28 1 1 0))) "Take screenshots of a frame" single ((:commit . "ea57484dbba917a437ad3a20ea956aa2275bdc9a") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "multimedia") (:url . "https://github.com/tarsius/frameshot"))])
+ (framesize . [(20131017 2132) ((key-chord (0 5 20080915))) "change the size of frames in Emacs" single ((:commit . "f2dbf5d2513b2bc45f2085370a55c1754b6025da") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "frames") (:url . "http://github.com/nicferrier/emacs-framesize"))])
+ (frecency . [(20170909 631) ((emacs (25 1)) (a (0 1)) (dash (2 13 0))) "Library for sorting items by frequency and recency of access" single ((:commit . "6d57aee131d96315aedf6cb7d6e5d6d09bf71503") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "libraries" "recency" "recent" "frequency" "frequent") (:url . "http://github.com/alphapapa/frecency.el"))])
+ (frecentf . [(20210330 1521) ((emacs (26 1)) (frecency (0 1 -1)) (persist (0 4)) (async (1 9 4))) "Pervasive recentf using frecency" single ((:commit . "19e2c48a8b8c8ee8cae5c93b58b57a0aa81a8c46") (:authors ("Felipe Lema" . "felipel@mortemale.org")) (:maintainer "Felipe Lema" . "felipel@mortemale.org") (:keywords "files" "maint") (:url . "https://launchpad.net/frecentf.el"))])
+ (free-keys . [(20211116 1501) ((cl-lib (0 3))) "Show free keybindings for modkeys or prefixes" single ((:commit . "7348ce68192871b8a69b687ec124d9f816d493ca") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "convenience") (:url . "https://github.com/Fuco1/free-keys"))])
+ (freeradius-mode . [(20190401 1743) ((emacs (24 4))) "major mode for FreeRadius server config files" single ((:commit . "cf8bf0359cf6c77848facbd24b764b3e111b4c2d") (:url . "https://github.com/VersBinarii/freeradius-mode"))])
+ (freeze-it . [(20220301 148) ((emacs (24 4))) "Minor mode to make your previous writing read-only" single ((:commit . "ad92e33a7ebd860905da60d194833516bf61cbf5") (:authors ("Paul W. Rankin" . "pwr@bydasein.com")) (:maintainer "Paul W. Rankin" . "pwr@bydasein.com") (:keywords "wp" "text") (:url . "https://github.com/rnkn/freeze-it"))])
+ (friendly-remote-shell . [(20200527 830) ((emacs (24 1)) (cl-lib (0 6 1)) (with-shell-interpreter (0 2 3)) (friendly-tramp-path (0 1 0)) (friendly-shell (0 2 0))) "Human-friendly remote interactive shells" single ((:commit . "e530e359848e8bdad09d26529f17eb25e5558b3e") (:keywords "processes" "terminals") (:url . "https://github.com/p3r7/friendly-shell"))])
+ (friendly-shell . [(20220309 1711) ((emacs (24 1)) (cl-lib (0 6 1)) (dash (2 17 0)) (with-shell-interpreter (0 2 4))) "Better shell-mode API" single ((:commit . "e530e359848e8bdad09d26529f17eb25e5558b3e") (:keywords "processes" "terminals") (:url . "https://github.com/p3r7/friendly-shell"))])
+ (friendly-shell-command . [(20200527 830) ((emacs (24 1)) (cl-lib (0 6 1)) (dash (2 17 0)) (with-shell-interpreter (0 2 3))) "Better shell-command API" single ((:commit . "e530e359848e8bdad09d26529f17eb25e5558b3e") (:keywords "processes" "terminals") (:url . "https://github.com/p3r7/friendly-shell"))])
+ (friendly-tramp-path . [(20200502 1032) ((cl-lib (0 6 1))) "Human-friendly TRAMP path construction" single ((:commit . "be572b8953b9e5a3a35c30bb64c2936d3e9802ba") (:url . "https://github.com/p3r7/prf-tramp"))])
+ (fringe-current-line . [(20140111 411) nil "show current line on the fringe." single ((:commit . "0ef000bac76abae30601222e6f06c7d133ab4942") (:authors ("Kouhei Yanagita" . "yanagi@shakenbu.org")) (:maintainer "Kouhei Yanagita" . "yanagi@shakenbu.org") (:url . "http://github.com/kyanagi/fringe-current-line/raw/master/fringe-current-line.el"))])
+ (fringe-helper . [(20140620 2109) nil "helper functions for fringe bitmaps" single ((:commit . "ef4a9c023bae18ec1ddd7265f1f2d6d2e775efdd") (:authors ("Nikolaj Schumacher <bugs * nschum de>")) (:maintainer "Nikolaj Schumacher <bugs * nschum de>") (:keywords "lisp") (:url . "http://nschum.de/src/emacs/fringe-helper/"))])
+ (frog-jump-buffer . [(20220414 1935) ((emacs (24)) (avy (0 4 0)) (dash (2 4 0)) (frog-menu (0 2 8))) "The fastest buffer-jumping Emacs lisp package around." single ((:commit . "ff0cfe9cb4a60d855f0754b741a9417ee413dee0") (:authors ("Justin Talbott")) (:maintainer "Justin Talbott") (:keywords "convenience" "tools") (:url . "https://github.com/waymondo/frog-jump-buffer"))])
+ (frontside-javascript . [(20220315 1057) ((emacs (25 1)) (add-node-modules-path (1 2 0)) (company (0 9 2)) (flycheck (20201228 2104)) (js2-mode (20201220)) (js2-refactor (0 9 0)) (rjsx-mode (0 5 0)) (tide (4 0 2)) (web-mode (17)) (lsp-mode (20220124))) "JS development that just work™️" tar ((:commit . "18816534a977fbd28848389b58c22b6538cfdeec") (:authors ("Frontside Engineering" . "engineering@frontside.com")) (:maintainer "Frontside Engineering" . "engineering@frontside.com") (:keywords "files" "tools") (:url . "https://github.com/thefrontside/frontmacs"))])
+ (fsbot-data-browser . [(20160921 1533) nil "browse the fsbot database using tabulated-list-mode" single ((:commit . "6bca4f7de63e31839d2542f6c678b79931dec344") (:authors ("Benaiah Mischenko")) (:maintainer "Benaiah Mischenko") (:keywords "fsbot" "irc" "tabulated-list-mode") (:url . "http://github.com/benaiah/fsbot-data-browser"))])
+ (fsharp-mode . [(20220429 1847) ((emacs (25))) "Support for the F# programming language" tar ((:commit . "5208b54098c7534f4768b87c5f4c8a01b638737b") (:authors ("1993-1997 Xavier Leroy, Jacques Garrigue and Ian T Zimmerman") ("2010-2011 Laurent Le Brun" . "laurent@le-brun.eu") ("2012-2014 Robin Neatherway" . "robin.neatherway@gmail.com") ("2017-2022 Jürgen Hötzel")) (:maintainer "Jürgen Hötzel") (:keywords "languages"))])
+ (fstar-mode . [(20220106 2256) ((emacs (24 3)) (dash (2 11)) (company (0 8 12)) (quick-peek (1 0)) (yasnippet (0 11 0)) (flycheck (30 0)) (company-quickhelp (2 2 0))) "Support for F* programming" tar ((:commit . "c95c2a61a6c42a1fa8bab9a8eb812a41be3e6f69") (:authors ("Clément Pit-Claudel" . "clement.pitclaudel@live.com")) (:maintainer "Clément Pit-Claudel" . "clement.pitclaudel@live.com") (:keywords "convenience" "languages") (:url . "https://github.com/FStarLang/fstar-mode.el"))])
+ (fuel . [(20211221 2127) ((cl-lib (0 2)) (emacs (24 2))) "Major mode for the Factor programming language." tar ((:commit . "b90d529eacb643421991f94288151e72ed573b55"))])
+ (fuff . [(20170202 1503) ((seq (2 3))) "Find files with findutils, recursively" single ((:commit . "278e849913df87bd8756c59382282d87474802c3") (:authors ("Joel Moberg")) (:maintainer "Joel Moberg") (:keywords "files" "project" "convenience") (:url . "https://github.com/joelmo/fuff"))])
+ (full-ack . [(20140223 1732) nil "a front-end for ack" single ((:commit . "761d846e105b150f8e6d13d7a8983f0248313a45") (:authors ("Nikolaj Schumacher <bugs * nschum de>")) (:maintainer "Nikolaj Schumacher <bugs * nschum de>") (:keywords "tools" "matching") (:url . "http://nschum.de/src/emacs/full-ack/"))])
+ (fullframe . [(20210226 1057) ((cl-lib (0 5))) "Generalized automatic execution in a single frame" single ((:commit . "886b831c001b44ec95aec4ff36e8bc1b3003c786") (:authors ("Tom Regner" . "tom@goochesa.de")) (:maintainer "Tom Regner" . "tom@goochesa.de") (:keywords "fullscreen"))])
+ (function-args . [(20211231 1150) ((ivy (0 9 1))) "C++ completion for GNU Emacs" tar ((:commit . "503e78fad9e7741ef4b8f5c24ff70c8909240db2") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:url . "https://github.com/abo-abo/function-args"))])
+ (fuo . [(20190812 927) ((emacs (24 4))) "feeluown client." single ((:commit . "0e4122f94a336a50c02bc96652d25ac3d74bedeb") (:authors ("cosven" . "yinshaowen241@gmail.com")) (:maintainer "cosven" . "yinshaowen241@gmail.com") (:keywords "feeluown" "multimedia" "unix") (:url . "http://github.com/cosven/emacs-fuo"))])
+ (furl . [(20150509 316) nil "Friendly URL retrieval" single ((:commit . "014438271e0ef27333dfcd599cb247f12a20d870") (:authors ("Natalie Weizenbaum" . "nweiz@google.com")) (:maintainer "Natalie Weizenbaum" . "nweiz@google.com"))])
+ (futhark-mode . [(20220425 1144) ((emacs (24 3)) (cl-lib (0 5))) "major mode for editing Futhark source files" tar ((:commit . "7fd0a3c6c96ed8afd0249ab0734d9b63d4fd1cb1") (:keywords "languages") (:url . "https://github.com/diku-dk/futhark-mode"))])
+ (fuz . [(20200104 524) ((emacs (25 1))) "Fast and precise fuzzy scoring/matching utils" tar ((:commit . "fee874aa35d2ee6b12b836290b5c8eaa44175a28") (:authors ("Zhu Zihao" . "all_but_last@163.com")) (:maintainer "Zhu Zihao" . "all_but_last@163.com") (:keywords "lisp") (:url . "https://github.com/cireu/fuz.el"))])
+ (fuzzy . [(20211231 1837) ((emacs (24 3))) "Fuzzy Matching" single ((:commit . "7691a73a85f014a34cc161650e989801f2aba5a3") (:authors ("Tomohiro Matsuyama" . "m2ym.pub@gmail.com")) (:maintainer "Tomohiro Matsuyama" . "m2ym.pub@gmail.com") (:keywords "convenience") (:url . "https://github.com/auto-complete/fuzzy-el"))])
+ (fuzzy-finder . [(20210906 217) ((emacs (24 4))) "Fuzzy Finder App Integration" single ((:commit . "915a281fc8e50df84dcc205f9357e8314d60fa54") (:authors ("10sr" . "8.slashes@gmail.com")) (:maintainer "10sr" . "8.slashes@gmail.com") (:keywords "matching") (:url . "https://github.com/10sr/fuzzy-finder-el"))])
+ (fvwm-mode . [(20160411 1138) nil "A major mode for editing Fvwm configuration files" single ((:commit . "6832a1c1f68bf6249c3fd6672ea8e27dc7a5c79e") (:authors ("Bert Geens" . "bert@lair.be")) (:maintainer "Bert Geens" . "bert@lair.be") (:keywords "files") (:url . "https://github.com/theBlackDragon/fvwm-mode"))])
+ (fwb-cmds . [(20220422 1610) ((emacs (25 1)) (compat (28 1 1 0))) "misc frame, window and buffer commands" single ((:commit . "e6eeac7552b61d4f7abd51aff6ce72394133663e") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "convenience") (:url . "https://github.com/tarsius/fwb-cmds"))])
+ (fxrd-mode . [(20170728 1801) ((s (1 2))) "Major mode for editing fixed field width files" tar ((:commit . "18a603474abb5a786a8d9f20c283d5f7beed3540") (:authors ("Marc Sherry" . "msherry@gmail.com")) (:maintainer "Marc Sherry" . "msherry@gmail.com") (:keywords "convenience") (:url . "https://github.com/msherry/fxrd-mode"))])
+ (fyure . [(20130216 1314) nil "An interface to fix Japanese hyoki-yure" tar ((:commit . "b6977f1eb148e8b63259f7233b55bb050e44d9b8") (:authors ("Masafumi Oyamada" . "stillpedant@gmail.com")) (:maintainer "Masafumi Oyamada" . "stillpedant@gmail.com") (:keywords "languages"))])
+ (fzf . [(20211228 2005) ((emacs (24 4))) "A front-end for fzf." single ((:commit . "d61cecbdb60b0f10cecd50ff2ae115aeb77f9fdc") (:authors ("Bailey Ling")) (:maintainer "Bailey Ling") (:keywords "fzf" "fuzzy" "search") (:url . "https://github.com/bling/fzf.el"))])
+ (gameoflife . [(20200614 1814) nil "Screensaver running Conway's Game of Life" single ((:commit . "2483f3d98dbcf7f1633f551cc3691f5659b4b942") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "games") (:url . "https://github.com/Lindydancer/gameoflife"))])
+ (gams-ac . [(20180423 926) ((emacs (24)) (auto-complete (1 0)) (gams-mode (4 0))) "auto-complete source file for GAMS mode" single ((:commit . "66d04ff36033f54205c19bc1d893e926d4dbf02e") (:authors ("Shiro Takeda")) (:maintainer "Shiro Takeda") (:keywords "languages" "tools" "gams-mode" "auto-complete") (:url . "https://github.com/ShiroTakeda/gams-ac"))])
+ (gams-mode . [(20220501 1507) ((emacs (24 3))) "Major mode for General Algebraic Modeling System (GAMS)" tar ((:commit . "1964d9a52693f3aa9279eed8864bc317ee5c6dc4") (:authors ("Shiro Takeda")) (:maintainer "Shiro Takeda") (:keywords "languages" "tools" "gams") (:url . "http://shirotakeda.org/en/gams/gams-mode/"))])
+ (gandalf-theme . [(20130809 947) nil "Gandalf color theme" single ((:commit . "4e472fc851431458537d458d09c1f5895e338536") (:authors ("Peter Vasil" . "mail@petervasil.net")) (:maintainer "Peter Vasil" . "mail@petervasil.net") (:keywords "color" "theme"))])
+ (gap-mode . [(20220503 1555) nil "Major mode for editing files in the GAP programing language." tar ((:commit . "99237f714c28981142674e8cfeb155863c834858") (:authors ("Michael Smith" . "smith@pell.anu.edu.au") ("Gary Zablackis") ("Goetz Pfeiffer") ("Ivan Andrus" . "darthandrus@gmail.com")) (:maintainer "Ivan Andrus" . "darthandrus@gmail.com") (:keywords "gap") (:url . "https://gitlab.com/gvol/gap-mode"))])
+ (gather . [(20141230 1338) nil "Gather string in buffer." single ((:commit . "50809fbc22d70a1c724c2dd99ac5a1f818ffeb6b") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "matching" "convenience" "tools") (:url . "https://github.com/mhayashi1120/Emacs-gather/raw/master/gather.el"))])
+ (gcmh . [(20201116 2251) ((emacs (24))) "the Garbage Collector Magic Hack" single ((:commit . "0089f9c3a6d4e9a310d0791cf6fa8f35642ecfd9") (:authors ("Andrea Corallo" . "akrl@sdf.org")) (:maintainer nil . "akrl@sdf.org") (:keywords "internal") (:url . "https://gitlab.com/koral/gcmh"))])
+ (gcode-mode . [(20210522 1025) ((emacs (24 4))) "Simple G-Code major mode" tar ((:commit . "1f83845af4102efc5e5856b55bd5ad165b2f0cdd") (:authors ("Yuri D'Elia" . "wavexx@thregr.org")) (:maintainer "Yuri D'Elia" . "wavexx@thregr.org") (:keywords "gcode" "languages" "highlight" "syntax") (:url . "https://gitlab.com/wavexx/gcode-mode.el"))])
+ (gdscript-mode . [(20210328 2037) ((emacs (26 3))) "Major mode for Godot's GDScript language" tar ((:commit . "4badcf6a0c951daba4d7259db3913b78254c0423") (:authors ("Nathan Lovato <nathan@gdquest.com>, Fabián E. Gallina" . "fgallina@gnu.org")) (:maintainer nil . "nathan@gdquest.com") (:keywords "languages") (:url . "https://github.com/godotengine/emacs-gdscript-mode/"))])
+ (geben . [(20210830 422) ((emacs (24 3)) (cl-lib (0 5))) "DBGp protocol frontend, a script debugger" tar ((:commit . "d3706387ed25b3037338572f3968b4cc2d8825a0") (:authors ("Matthew Carter" . "m@ahungry.com")) (:maintainer "Matthew Carter" . "m@ahungry.com") (:keywords "c" "comm" "tools") (:url . "https://github.com/ahungry/geben"))])
+ (geben-helm-projectile . [(20160611 59) ((emacs (24)) (geben (0 26)) (helm-projectile (0 13 0))) "Integrate helm-projectile with geben" single ((:commit . "31ce0faca5dcc71924884f03fd5a7a25d00ccd9b") (:authors ("Matthew Carter" . "m@ahungry.com")) (:maintainer "Matthew Carter" . "m@ahungry.com") (:keywords "ahungry" "emacs" "geben" "helm" "projectile" "debug") (:url . "https://github.com/ahungry/geben-helm-projectile"))])
+ (geeknote . [(20220213 612) ((emacs (24))) "Use Evernote in Emacs through geeknote" single ((:commit . "ce2738aebeeda35f9d31027e9b7bad0813b975c3") (:authors ("Evan Dale Aromin")) (:maintainer "Evan Dale Aromin") (:keywords "evernote" "geeknote" "note" "emacs-evernote" "evernote-mode") (:url . "http://github.com/avendael/emacs-geeknote"))])
+ (geiser . [(20220507 34) ((emacs (25 1)) (transient (0 3)) (project (0 8 1))) "GNU Emacs and Scheme talk to each other" tar ((:commit . "d28d19b582347bffebbf0ca905297e744842a5f2") (:authors ("Jose Antonio Ortega Ruiz" . "jao@gnu.org")) (:maintainer "Jose Antonio Ortega Ruiz" . "jao@gnu.org") (:keywords "languages" "scheme" "geiser") (:url . "https://gitlab.com/emacs-geiser/"))])
+ (geiser-chez . [(20211216 2332) ((emacs (26 1)) (geiser (0 19))) "Chez Scheme's implementation of the geiser protocols" tar ((:commit . "48427d4aecc6fed751d266673f1ce2ad57ddbcfc") (:authors ("Peter" . "craven@gmx.net")) (:maintainer "Jose A Ortega Ruiz" . "jao@gnu.org") (:keywords "languages" "chez" "scheme" "geiser") (:url . "https://gitlab.com/emacs-geiser/chez"))])
+ (geiser-chibi . [(20211204 1938) ((emacs (24 4)) (geiser (0 18))) "Chibi Scheme's implementation of the geiser protocols" tar ((:commit . "5a6a5a580ea45cd4974df21629a8d50cbe3d6e99") (:authors ("Peter" . "craven@gmx.net")) (:maintainer "Jose A Ortega Ruiz" . "jao@gnu.org") (:keywords "languages" "chibi" "scheme" "geiser") (:url . "https://gitlab.com/emacs-geiser/chibi"))])
+ (geiser-chicken . [(20211204 2049) ((emacs (24 4)) (geiser (0 19))) "Chicken's implementation of the geiser protocols" tar ((:commit . "79a9ac78f4df7c9ec1f918313c543c116dbb8b70") (:authors ("Daniel Leslie")) (:maintainer "Daniel Leslie") (:keywords "languages" "chicken" "scheme" "geiser") (:url . "https://gitlab.com/emacs-geiser/chicken"))])
+ (geiser-gambit . [(20220208 1356) ((emacs (26 1)) (geiser (0 18))) "Gambit's implementation of the geiser protocols" tar ((:commit . "381d74ca5059b44fe3d8b5daf42214019c6d1a88") (:authors ("Daniel Leslie")) (:maintainer "Jose A Ortega Ruiz" . "jao@gnu.org") (:keywords "languages" "gambit" "scheme" "geiser") (:url . "https://gitlab.com/emacs-geiser/gambit"))])
+ (geiser-gauche . [(20220503 1700) ((emacs (26 1)) (geiser (0 11 2))) "Gauche scheme support for Geiser" tar ((:commit . "8ff743f6416f00751e24aef8b9791501a40f5421") (:authors ("András Simonyi" . "andras.simonyi@gmail.com")) (:maintainer "András Simonyi" . "andras.simonyi@gmail.com") (:keywords "languages" "gauche" "scheme" "geiser") (:url . "https://gitlab.com/emacs-geiser/gauche"))])
+ (geiser-guile . [(20220323 2352) ((emacs (25 1)) (geiser (0 23 2))) "Guile's implementation of the geiser protocols" tar ((:commit . "c641fcc50b6b86ca95743122b5206cdcd475f96e") (:authors ("Jose Antonio Ortega Ruiz" . "jao@gnu.org")) (:maintainer "Jose Antonio Ortega Ruiz" . "jao@gnu.org") (:keywords "languages" "guile" "scheme" "geiser") (:url . "https://gitlab.com/emacs-geiser/guile"))])
+ (geiser-kawa . [(20210920 1607) ((emacs (26 1)) (geiser (0 16))) "Kawa scheme support for Geiser" tar ((:commit . "5896b19642923f74f718eb68d447560b2d26d797") (:authors ("spellcard199" . "spellcard199@protonmail.com")) (:maintainer "spellcard199" . "spellcard199@protonmail.com") (:keywords "languages" "kawa" "scheme" "geiser") (:url . "https://gitlab.com/emacs-geiser/kawa"))])
+ (geiser-mit . [(20211204 1935) ((emacs (24 4)) (geiser (0 18))) "MIT/GNU Scheme's implementation of the geiser protocols" tar ((:commit . "4e90e9ae815e89f3540fb9644e6016c663ef5765") (:authors ("Peter" . "craven@gmx.net")) (:maintainer "Jose A Ortega Ruiz" . "jao@gnu.org") (:keywords "languages" "mit" "scheme" "geiser") (:url . "https://gitlab.com/emacs-geiser/mit"))])
+ (geiser-racket . [(20210421 125) ((emacs (26 1)) (geiser (0 16))) "Support for Racket in Geiser" tar ((:commit . "22e56ce80389544d3872cf4beb4008fb514b2218") (:authors ("Jose Antonio Ortega Ruiz" . "jao@gnu.org")) (:maintainer "Jose Antonio Ortega Ruiz" . "jao@gnu.org") (:keywords "languages" "racket" "scheme" "geiser") (:url . "https://gitlab.com/emacs-geiser/racket"))])
+ (geiser-stklos . [(20211117 2114) ((emacs (24 4)) (geiser (0 16))) "STklos Scheme implementation of the geiser protocols" single ((:commit . "9db60a7e751c97e30dd528e2a96ff19575b618d2") (:authors ("Jeronimo Pellegrini" . "j_p@aleph0.info")) (:maintainer "Jeronimo Pellegrini" . "j_p@aleph0.info") (:keywords "languages" "stklos" "scheme" "geiser") (:url . "https://gitlab.com/emacs-geiser/stklos"))])
+ (gemini-mode . [(20210909 1442) ((emacs (24 4))) "A simple highlighting package for text/gemini" single ((:commit . "60bd07b3a1e532c950c132673777ceb635c9960d") (:authors ("Jason McBrayer <jmcbray@carcosa.net>, tastytea <tastytea@tastytea.de>, Étienne Deparis" . "etienne@depar.is")) (:maintainer "Jason McBrayer <jmcbray@carcosa.net>, tastytea <tastytea@tastytea.de>, Étienne Deparis" . "etienne@depar.is") (:keywords "languages") (:url . "https://git.carcosa.net/jmcbray/gemini.el"))])
+ (gemini-write . [(20211114 1032) ((emacs (26)) (elpher (2 8 0)) (gemini-mode (1 0 0))) "Elpher for Titan" single ((:commit . "2a7d07d0ce4c5b8750f3ff1182ad94ee616734c8") (:authors ("Alex Schroeder" . "alex@gnu.org")) (:maintainer "Alex Schroeder" . "alex@gnu.org") (:keywords "comm" "gemini") (:url . "https://alexschroeder.ch/cgit/gemini-write"))])
+ (general . [(20211203 120) ((emacs (24 4)) (cl-lib (0 5))) "Convenience wrappers for keybindings." tar ((:commit . "9651024e7f40a8ac5c3f31f8675d3ebe2b667344") (:authors ("Fox Kiester" . "noct@posteo.net")) (:maintainer "Fox Kiester" . "noct@posteo.net") (:keywords "vim" "evil" "leader" "keybindings" "keys") (:url . "https://github.com/noctuid/general.el"))])
+ (genrnc . [(20140612 1237) ((deferred (0 3 1)) (concurrent (0 3)) (log4e (0 2 0)) (yaxception (0 1))) "generate RELAX NG Compact Schema from RELAX NG Schema, XML Schema and DTD." tar ((:commit . "da75b1966a73ad215ec2ced4522c25f4d0bf1f9a") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "xml") (:url . "https://github.com/aki2o/emacs-genrnc"))])
+ (geoip . [(20200310 911) ((emacs (25 1))) "Find out where an IP address is located via GeoIP2" single ((:commit . "25eb1278788b942c38405c233d3614a1de92ddea") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:keywords "tools") (:url . "https://github.com/xuchunyang/geoip.el"))])
+ (geolocation . [(20200317 1559) ((request-deferred (0 3 2)) (deferred (0 5 1)) (emacs (25 1))) "Get your location on Earth" single ((:commit . "bc7848832eb0352e3a71f4b9d89d917fe12d18be") (:authors ("Neil Okamoto" . "neil.okamoto+melpa@gmail.com")) (:maintainer "Neil Okamoto" . "neil.okamoto+melpa@gmail.com") (:keywords "hardware") (:url . "https://github.com/gonewest818/geolocation.el"))])
+ (german-holidays . [(20181213 644) nil "German holidays for Emacs calendar" single ((:commit . "a8462dffccaf2b665f2032e646b5370e993a386a") (:authors ("Sebastian Christ" . "rudolfo.christ@gmail.com")) (:maintainer "Sebastian Christ" . "rudolfo.christ@gmail.com") (:url . "https://github.com/rudolfochrist/german-holidays"))])
+ (germanium . [(20220116 1634) ((emacs (26 1))) "Generate image from source code using germanium" single ((:commit . "54c9a56da1e86941f2580d4838fbb6097f22f349") (:authors ("Masaya Watanabe")) (:maintainer "Masaya Watanabe") (:keywords "convenience") (:url . "https://github.com/matsuyoshi30/germanium-el"))])
+ (gerrit . [(20220508 704) ((emacs (25 1)) (magit (2 13 1)) (s (1 12 0)) (dash (0 2 15))) "Gerrit client" tar ((:commit . "2ca9cf999534a94c9aa93b393f30ed373eb2ed86") (:authors ("Thomas Hisch" . "t.hisch@gmail.com")) (:maintainer "Thomas Hisch" . "t.hisch@gmail.com") (:keywords "extensions") (:url . "https://github.com/thisch/gerrit.el"))])
+ (gerrit-download . [(20150714 1408) ((emacs (24 0)) (magit (2 1 0))) "Show gerrit reviews in a diff buffer." single ((:commit . "d568acc7c5935188c9bc19ba72719a6092d9f6fd") (:authors ("Chmouel Boudjnah" . "chmouel@chmouel.com")) (:maintainer "Chmouel Boudjnah" . "chmouel@chmouel.com") (:keywords "tools" "gerrit" "git") (:url . "https://github.com/chmouel/gerrit-download.el"))])
+ (gf . [(20181028 1542) ((s (1 0)) (ht (2 0))) "Major mode for editing GF code" single ((:commit . "30b3127f229e0db522c7752f6957ca01b2ea2821") (:authors ("Johan Bockgård" . "bojohan+mail@dd.chalmers.se")) (:maintainer "bruno cuconato" . "bcclaro+emacs@gmail.com") (:keywords "languages") (:url . "https://github.com/GrammaticalFramework/gf-emacs-mode"))])
+ (ggo-mode . [(20210310 1345) nil "Gengetopt major mode" single ((:commit . "6a7617b5af3d13029e4d680a375e8107c40d0fac") (:authors ("Matthew K. Junker" . "junker@alum.mit.edu")) (:maintainer "Matthew K. Junker" . "junker@alum.mit.edu") (:keywords "extensions" "convenience" "local"))])
+ (ggtags . [(20220420 1610) ((emacs (25))) "emacs frontend to GNU Global source code tagging system" single ((:commit . "22d3a3a951cb605d29138f1acee191ef674a4518") (:authors ("Leo Liu" . "sdl.web@gmail.com")) (:maintainer "Leo Liu" . "sdl.web@gmail.com") (:keywords "tools" "convenience") (:url . "https://github.com/leoliu/ggtags"))])
+ (gh . [(20220302 549) ((emacs (25 1)) (pcache (0 4 2)) (logito (0 1)) (marshal (0 9 0)) (cl-lib (0 3))) "A GitHub library for Emacs" tar ((:commit . "27ccc892e94f7e747e5b879eec71119965d9ed6e") (:authors ("Yann Hodique" . "yhodique@gmail.com")) (:maintainer "Yann Hodique" . "yhodique@gmail.com") (:url . "https://github.com/sigma/gh.el"))])
+ (gh-md . [(20220316 1432) ((emacs (24 3))) "Render markdown using the Github api" single ((:commit . "e721fd5e41e682f47f2dd4ce26ef2ba28c7fa0b5") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "convenience") (:url . "https://github.com/emacs-pe/gh-md.el"))])
+ (gh-notify . [(20211126 638) ((emacs (27 1)) (magit (3 0 0)) (forge (0 2 0))) "A veneer for Magit/Forge GitHub notifications" single ((:commit . "aa4d8bc0c56366d437e7c126e7eedc5938109342") (:authors ("Bas Alberts" . "bas@anti.computer") ("xristos" . "xristos@sdf.org")) (:maintainer "Bas Alberts" . "bas@anti.computer") (:keywords "comm") (:url . "https://github.com/anticomputer/gh-notify"))])
+ (ghc-imported-from . [(20141124 1932) ((emacs (24 1))) "Haskell documentation lookup with ghc-imported-from" single ((:commit . "fcff08628a19f5d26151564659218cc677779b79") (:authors ("David Raymond Christiansen" . "david@davidchristiansen.dk")) (:maintainer "David Raymond Christiansen" . "david@davidchristiansen.dk") (:keywords "languages"))])
+ (ghci-completion . [(20151125 1257) ((emacs (24 1)) (cl-lib (0 5))) "Completion for GHCi commands in inferior-haskell buffers" single ((:commit . "c47e23d585d2a3c7b13aac163693fdc4f2bb90e5") (:authors ("Oleksandr Manzyuk" . "manzyuk@gmail.com")) (:maintainer "Oleksandr Manzyuk" . "manzyuk@gmail.com") (:keywords "convenience"))])
+ (gherkin-mode . [(20171224 1353) nil "An emacs major mode for editing gherkin files." single ((:commit . "0313492e7da152f0aa73ddf96c0287ded8f51253") (:authors ("Craig Andera")) (:maintainer "Craig Andera") (:keywords "languages"))])
+ (ghost-blog . [(20171023 742) ((markdown-mode (1 0))) "A package to manage Ghost blog" single ((:commit . "71b358643cc9a2db1bf752281ff94aba9b59e4cc") (:authors ("Javier Aguirre" . "hello@javaguirre.net")) (:maintainer "Javier Aguirre" . "hello@javaguirre.net") (:keywords "ghost" "blog") (:url . "https://github.com/javaguirre/ghost-blog"))])
+ (ghq . [(20210504 902) nil "Ghq interface for emacs" single ((:commit . "582bd6daa505d04c7cc06d6c82ed8aee0624bfbe") (:authors ("Roman Coedo" . "romancoedo@gmail.com")) (:maintainer "Roman Coedo" . "romancoedo@gmail.com") (:keywords "ghq"))])
+ (ghub . [(20220429 1708) ((emacs (25 1)) (compat (28 1 1 0)) (let-alist (1 0 6)) (treepy (0 1 1))) "Client libraries for Git forge APIs." tar ((:commit . "f14c1bc84135fe149c42348dce6eaa23ba610224") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "tools") (:url . "https://github.com/magit/ghub"))])
+ (ghub+ . [(20191229 1748) ((emacs (25)) (ghub (2 0)) (apiwrap (0 5))) "a thick GitHub API client built on ghub" single ((:commit . "b1adef2402d7599911d4dd447a987a0cea04e6fe") (:authors ("Sean Allred" . "code@seanallred.com")) (:maintainer "Sean Allred" . "code@seanallred.com") (:keywords "extensions" "multimedia" "tools") (:url . "https://github.com/vermiculus/ghub-plus"))])
+ (gif-screencast . [(20210401 656) ((emacs (25 1))) "One-frame-per-action GIF recording" single ((:commit . "5517a557a17d8016c9e26b0acb74197550f829b9") (:authors ("Pierre Neidhardt" . "mail@ambrevar.xyz")) (:maintainer "Pierre Neidhardt" . "mail@ambrevar.xyz") (:keywords "multimedia" "screencast") (:url . "https://gitlab.com/ambrevar/emacs-gif-screencast"))])
+ (gift-mode . [(20210528 1459) nil "major mode for editing GIFT format quizzes" single ((:commit . "c93354e8fe1173b22f398f17b127875807f15b87") (:authors ("Christophe Rhodes" . "christophe@rhodes.io")) (:maintainer "Christophe Rhodes" . "christophe@rhodes.io") (:url . "https://github.com/csrhodes/gift-mode"))])
+ (gildas-mode . [(20181022 649) ((polymode (0 1 5)) (emacs (25))) "Major mode for Gildas" single ((:commit . "d0c9e997e2aa0bcd9b8b7db082d69100448cb1b2") (:authors ("Sébastien Maret" . "sebastien.maret@icloud.com")) (:maintainer "Sébastien Maret" . "sebastien.maret@icloud.com") (:keywords "languages" "gildas") (:url . "https://github.com/smaret/gildas-mode"))])
+ (gist . [(20171128 406) ((emacs (24 1)) (gh (0 10 0))) "Emacs integration for gist.github.com" single ((:commit . "314fe6ab80fae35b95f0734eceb82f72813b6f41") (:authors ("Yann Hodique" . "yann.hodique@gmail.com")) (:maintainer "Yann Hodique" . "yann.hodique@gmail.com") (:keywords "tools") (:url . "https://github.com/defunkt/gist.el"))])
+ (git . [(20140128 1041) ((s (1 7 0)) (dash (2 2 0)) (f (0 10 0))) "An Elisp API for programmatically using Git" single ((:commit . "a3396a7027a7d986598c6a2d6d5599bac918f3da") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "git") (:url . "http://github.com/rejeep/git.el"))])
+ (git-annex . [(20190625 2118) nil "Mode for easy editing of git-annex'd files" single ((:commit . "1324d3f23c534fe79391a2c256bb8803054e383b") (:authors ("John Wiegley" . "jwiegley@gmail.com")) (:maintainer "John Wiegley" . "jwiegley@gmail.com") (:keywords "files" "data" "git" "annex") (:url . "https://github.com/jwiegley/git-annex-el"))])
+ (git-assembler-mode . [(20210207 1545) ((emacs (24 4))) "git-assembler major mode" single ((:commit . "1243bdc1a9cdc79802ece05c90731ee14e4f92c9") (:authors ("Yuri D'Elia" . "wavexx@thregr.org")) (:maintainer "Yuri D'Elia" . "wavexx@thregr.org") (:keywords "git" "git-assembler" "languages" "highlight" "syntax") (:url . "https://gitlab.com/wavexx/git-assembler-mode.el"))])
+ (git-attr . [(20180925 2003) ((emacs (24 3))) "Git attributes of buffer file" tar ((:commit . "50df0630eba2a931146f676d349b29bde6b6b37b") (:authors ("Arne Jørgensen" . "arne@arnested.dk")) (:maintainer "Arne Jørgensen" . "arne@arnested.dk") (:keywords "vc") (:url . "https://github.com/arnested/emacs-git-attr"))])
+ (git-auto-commit-mode . [(20200828 653) nil "Emacs Minor mode to automatically commit and push" single ((:commit . "a6b6e0fa183be381463e2b44ef128db1b6c4234b") (:authors ("Tom Willemse" . "tom@ryuslash.org")) (:maintainer "Tom Willemse" . "tom@ryuslash.org") (:keywords "vc") (:url . "https://github.com/ryuslash/git-auto-commit-mode"))])
+ (git-backup . [(20191209 2144) ((emacs (24 3)) (s (1 8 0))) "Backup each file change using git" single ((:commit . "67e38c659c918e98642171ba3f385a15182347f4") (:authors ("Anthony HAMON" . "hamon.anth@gmail.com")) (:maintainer "Anthony HAMON" . "hamon.anth@gmail.com") (:keywords "backup" "files" "tools" "git") (:url . "http://github.com/antham/git-backup"))])
+ (git-backup-ivy . [(20220412 1914) ((ivy (0 12 0)) (git-backup (0 0 1)) (emacs (25 1))) "An ivy interface to git-backup" single ((:commit . "c53e1bc800963c0d826226c37c22e36f2353c70d") (:authors ("Sebastian Wålinder" . "s.walinder@gmail.com")) (:maintainer "Sebastian Wålinder" . "s.walinder@gmail.com") (:keywords "backup" "convenience" "files" "tools" "vc") (:url . "https://github.com/walseb/git-backup-ivy"))])
+ (git-blamed . [(20161028 1926) nil "Minor mode for incremental blame for Git" single ((:commit . "cef196abf398e2dd11f775d1e6cd8690567408aa") (:keywords "git" "version control" "release management"))])
+ (git-command . [(20191028 333) ((term-run (0 1 4)) (with-editor (2 3 1))) "A Git Command-Line interface" single ((:commit . "a773d40da39dfb1c6ecf2b0758aa370ddea8f06d") (:authors ("10sr <8slashes+el [at] gmail [dot] com>")) (:maintainer "10sr <8slashes+el [at] gmail [dot] com>") (:keywords "utility" "git") (:url . "https://github.com/10sr/git-command-el"))])
+ (git-commit . [(20220506 1936) ((emacs (25 1)) (compat (28 1 1 0)) (transient (20210920)) (with-editor (20211001))) "Edit Git commit messages." tar ((:commit . "125a8d5e417dda4438ce41d71a821d8a936fa5ea") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li") ("Sebastian Wiesner" . "lunaryorn@gmail.com") ("Florian Ragwitz" . "rafl@debian.org") ("Marius Vollmer" . "marius.vollmer@gmail.com")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "git" "tools" "vc") (:url . "https://github.com/magit/magit"))])
+ (git-commit-insert-issue . [(20210107 2018) ((emacs (25)) (projectile (0)) (s (0)) (ghub (0)) (bitbucket (0))) "Get issues list when typing \"Fixes #\"" single ((:commit . "6cfb8b4b5b23ae881cf3d005da4d7f60d91cd2cd") (:authors ("Vindarel")) (:maintainer "Vindarel") (:keywords "tools" "vc" "github" "gitlab" "bitbucket" "commit" "issues") (:url . "https://gitlab.com/emacs-stuff/git-commit-insert-issue/"))])
+ (git-dwim . [(20170126 1214) nil "Context-aware git commands such as branch handling" single ((:commit . "485c732130686c2f28a026e385366006435394b9") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "git" "tools" "convenience") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/git-dwim.el"))])
+ (git-grep . [(20200920 1751) ((projectile (0 10 0))) "Search tools using git grep" single ((:commit . "12ff6045e9b6aa42f98abd4ddc44d670268a0849") (:authors ("Sam Kleinman")) (:maintainer "tychoish" . "garen@tychoish.com") (:keywords "matching" "files" "grep" "search" "using" "git-grep") (:url . "https://github.com/tychoish/git-grep.el"))])
+ (git-gutter . [(20220423 1704) ((emacs (25 1))) "Port of Sublime Text plugin GitGutter" single ((:commit . "a50672b62a678922b8c0cab95225d520f493439b") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Neil Okamoto" . "neil.okamoto+melpa@gmail.com") (:url . "https://github.com/emacsorphanage/git-gutter"))])
+ (git-gutter+ . [(20151204 1723) ((git-commit (0)) (dash (0))) "Manage Git hunks straight from the buffer" single ((:commit . "b7726997806d9a2da9fe84ff00ecf21d62b6f975") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:keywords "git" "vc") (:url . "https://github.com/nonsequitur/git-gutter-plus"))])
+ (git-gutter-fringe . [(20211003 2228) ((git-gutter (0 88)) (fringe-helper (0 1 1)) (cl-lib (0 5)) (emacs (24))) "Fringe version of git-gutter.el" single ((:commit . "648cb5b57faec55711803cdc9434e55a733c3eba") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Neil Okamoto" . "neil.okamoto+melpa@gmail.com") (:url . "https://github.com/emacsorphanage/git-gutter-fringe"))])
+ (git-gutter-fringe+ . [(20140729 1103) ((git-gutter+ (0 1)) (fringe-helper (1 0 1))) "Fringe version of git-gutter+.el" single ((:commit . "7a2f49d2455a3a872e90e5f7dd4e6b27f1d96cfc") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/nonsequitur/git-gutter-fringe-plus"))])
+ (git-identity . [(20220402 708) ((emacs (25 1)) (dash (2 10)) (hydra (0 14)) (f (0 20))) "Identity management for (ma)git" single ((:commit . "e7da2b3e3a5a790311431e3263b00df41d335136") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:keywords "git" "vc" "convenience") (:url . "https://github.com/akirak/git-identity.el"))])
+ (git-io . [(20180317 1752) ((emacs (24 4))) "git.io integration" single ((:commit . "48753acba73b48b997bb678fb5e2a938ae63b5d6") (:authors ("Tejas Bubane" . "tejasbubane@gmail.com")) (:maintainer "Tejas Bubane" . "tejasbubane@gmail.com") (:keywords "convenience" "files") (:url . "https://github.com/tejasbubane/emacs-git-io"))])
+ (git-lens . [(20190319 1342) ((emacs (24 4))) "Show new, deleted or modified files in branch" single ((:commit . "f6cc0a37c9c5c422c49c32650e70bc4721707985") (:authors ("Peter Stiernström" . "peter@stiernstrom.se")) (:maintainer "Peter Stiernström" . "peter@stiernstrom.se") (:keywords "vc" "convenience") (:url . "https://github.com/pidu/git-lens"))])
+ (git-link . [(20220406 2328) ((emacs (24 3))) "Get the GitHub/Bitbucket/GitLab URL for a buffer location" single ((:commit . "0197c9812417e18df2c7b5cd5c0084271c2f3286") (:authors ("Skye Shaw" . "skye.shaw@gmail.com")) (:maintainer "Skye Shaw" . "skye.shaw@gmail.com") (:keywords "git" "vc" "github" "bitbucket" "gitlab" "sourcehut" "aws" "azure" "convenience") (:url . "http://github.com/sshaw/git-link"))])
+ (git-messenger . [(20201202 1637) ((emacs (24 3)) (popup (0 5 3))) "Popup last commit of current line" single ((:commit . "eade986ef529aa2dac6944ad61b18de55cee0b76") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Neil Okamoto") (:url . "https://github.com/emacsorphanage/git-messenger"))])
+ (git-modes . [(20220422 1611) ((emacs (25 1))) "Major modes for editing Git configuration files" tar ((:commit . "eca3bb42ea8abed9ef8549b2ac91bbea445c5bb5") (:authors ("Sebastian Wiesner" . "lunaryorn@gmail.com") ("Rüdiger Sonderfeld" . "ruediger@c-plusplus.net") ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "convenience" "vc" "git") (:url . "https://github.com/magit/git-modes"))])
+ (git-msg-prefix . [(20191031 1304) ((emacs (24)) (s (1 10 0)) (dash (2 9 0))) "Insert commit message prefix (issue number)" single ((:commit . "43f6b31c1090371260a2f15b2117a7666920bee7") (:authors ("Raimon Grau" . "raimonster@gmail.com")) (:maintainer "Raimon Grau" . "raimonster@gmail.com") (:keywords "vc" "tools") (:url . "http://github.com/kidd/git-msg-prefix.el"))])
+ (git-ps1-mode . [(20200113 704) nil "Global minor-mode to print __git_ps1 in mode-line" single ((:commit . "6762a309bd593d26258dfbf43e7bc21254a70fbf") (:authors ("10sr <8slashes+el [at] gmail [dot] com>")) (:maintainer "10sr <8slashes+el [at] gmail [dot] com>") (:keywords "utility" "mode-line" "git") (:url . "https://github.com/10sr/git-ps1-mode-el"))])
+ (git-time-metric . [(20181116 2011) nil "Provide function to record time with gtm ( git time metric )" single ((:commit . "287108ed1d6885dc795eb3bad4476aa08c626186") (:authors ("Anton Sivolapov" . "anton.sivolapov@gmail.com")) (:maintainer "Anton Sivolapov" . "anton.sivolapov@gmail.com") (:keywords "tools" "gtm" "productivity" "time") (:url . "https://github.com/c301/gtm-emacs-plugin"))])
+ (git-timemachine . [(20220324 1057) ((emacs (24 3)) (transient (0 1 0))) "Walk through git revisions of a file" single ((:commit . "ca09684e94767cc0b2339b77b778b4de4f9d104f") (:authors ("Peter Stiernström" . "peter@stiernstrom.se")) (:maintainer "Peter Stiernström" . "peter@stiernstrom.se") (:keywords "vc") (:url . "https://gitlab.com/pidu/git-timemachine"))])
+ (git-walktree . [(20191101 302) ((emacs (26 1)) (git (0 1 1)) (cl-lib (0 5))) "Browse Git tree and blob objects" tar ((:commit . "162d9073286c256502df4baa9845790b9f4c2f05") (:authors ("10sr <8.slashes [at] gmail [dot] com>")) (:maintainer "10sr <8.slashes [at] gmail [dot] com>") (:keywords "vc" "utility" "git") (:url . "https://github.com/10sr/git-walktree-el"))])
+ (git-wip-timemachine . [(20150408 1006) ((s (1 9 0))) "Walk through git-wip revisions of a file" single ((:commit . "ed4c7931a5f5233bf3e358b1e81647d063526460") (:authors ("Tim Krones" . "t.krones@gmx.net")) (:maintainer "Tim Krones" . "t.krones@gmx.net") (:keywords "git") (:url . "https://github.com/itsjeyd/git-wip-timemachine"))])
+ (gitconfig . [(20130718 935) nil "Emacs lisp interface to work with git-config variables" single ((:commit . "7612a37ca14009cac8fb8d6b6f54adad739a5741") (:authors ("Samuel Tonini")) (:maintainer "Samuel Tonini") (:keywords "git" "gitconfig" "git-config"))])
+ (github-browse-file . [(20160205 1427) ((cl-lib (0 5))) "View the file you're editing on GitHub" single ((:commit . "9742a5183af853788c6ecb83fb7ee0b00d1675ac") (:authors ("Ozan Sener" . "ozan@ozansener.com")) (:maintainer "Ozan Sener" . "ozan@ozansener.com") (:keywords "convenience" "vc" "git" "github") (:url . "https://github.com/osener/github-browse-file"))])
+ (github-clone . [(20210108 1920) ((gh (1 0 1)) (magit (3 0 0)) (emacs (25 1))) "Fork and clone github repos" single ((:commit . "9e40d6d3c6128407d7456bf71c95ad1fbb473b2a") (:authors ("Charles L.G. Comstock" . "dgtized@gmail.com")) (:maintainer "Charles L.G. Comstock" . "dgtized@gmail.com") (:keywords "vc" "tools") (:url . "https://github.com/dgtized/github-clone.el"))])
+ (github-dark-vscode-theme . [(20220313 2033) ((emacs (24 1))) "The GitHub Dark Theme from Visual Studio Code" single ((:commit . "785d2192d7cd30fb7d9c6cd660133a4002f598cc") (:authors ("Justintime50")) (:maintainer "Justintime50") (:keywords "faces") (:url . "https://github.com/justintime50/github-dark-vscode-emacs-theme"))])
+ (github-elpa . [(20200129 417) ((package-build (1 0)) (commander (0 7 0)) (git (0 1 1))) "Build and publish ELPA repositories with GitHub Pages" tar ((:commit . "04a55c723ffcd84dd35e5438e7e2b9f1cce08d42") (:authors (nil . "10sr<8slashes+el@gmail.com>")) (:maintainer nil . "10sr<8slashes+el@gmail.com>") (:url . "https://github.com/10sr/github-elpa"))])
+ (github-explorer . [(20220305 1450) ((emacs (25)) (graphql (0))) "Explore a GitHub repository on the fly" single ((:commit . "49e5c350169b556deaabdcb67e9440bd4d5b4f8b") (:authors ("Giap Tran" . "txgvnn@gmail.com")) (:maintainer "Giap Tran" . "txgvnn@gmail.com") (:keywords "comm") (:url . "https://github.com/TxGVNN/github-explorer"))])
+ (github-linguist . [(20220418 22) ((emacs (27 1)) (project (0 8)) (async (1 9)) (map (3))) "Run GitHub Linguist on projects to collect information" single ((:commit . "e1055cba19d82620a735e8e40d094b538e1f4d94") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:keywords "processes") (:url . "https://github.com/akirak/github-linguist.el"))])
+ (github-modern-theme . [(20171109 1251) nil "The GitHub color theme for Emacs." single ((:commit . "a7e7b8e5e9c122138e79e837caf9b7299e748d44") (:authors ("Philip Arvidsson" . "philip@philiparvidsson.com")) (:maintainer "Philip Arvidsson" . "philip@philiparvidsson.com") (:url . "https://github.com/philiparvidsson/GitHub-Theme-for-Emacs"))])
+ (github-notifier . [(20180421 316) ((emacs (24))) "Displays your GitHub notifications unread count in mode-line" single ((:commit . "274f3812926ea371346f639fcee98066f6e8c96f") (:authors ("Chunyang Xu" . "mail@xuchunyang.me")) (:maintainer "Chunyang Xu" . "mail@xuchunyang.me") (:keywords "github" "mode-line") (:url . "https://github.com/xuchunyang/github-notifier.el"))])
+ (github-pullrequest . [(20170116 616) ((emacs (24 4)) (request (0 2 0)) (dash (2 11 0)) (magit (2 10 0))) "Create and fetch Github Pull requests with ease" single ((:commit . "6ae5c38b0fc15b638b5ba4490112d9822ce5e267") (:authors ("Jakob Lind" . "karl.jakob.lind@gmail.com")) (:maintainer "Jakob Lind" . "karl.jakob.lind@gmail.com") (:keywords "tools") (:url . "https://github.com/jakoblind/github-pullrequest"))])
+ (github-review . [(20211029 243) ((emacs (25 1)) (s (1 12 0)) (ghub (2 0)) (dash (2 11 0)) (deferred (0 5 1)) (a (0 1 1))) "GitHub based code review" single ((:commit . "725fbc7b385228f53a7ddc46a92c1276bab4aea8") (:authors ("Laurent Charignon" . "l.charignon@gmail.com")) (:maintainer "Laurent Charignon" . "l.charignon@gmail.com") (:keywords "git" "tools" "vc" "github") (:url . "https://github.com/charignon/github-review"))])
+ (github-search . [(20190624 436) ((magit (0 8 1)) (gh (1 0 0))) "Clone repositories by searching github" single ((:commit . "b73efaf19491010522b09db35bb0f1bad1620e63") (:authors ("Ivan Malison" . "IvanMalison@gmail.com")) (:maintainer "Ivan Malison" . "IvanMalison@gmail.com") (:keywords "github" "search" "clone" "api" "gh" "magit" "vc" "tools") (:url . "https://github.com/IvanMalison/github-search"))])
+ (github-stars . [(20190517 1319) ((emacs (25 1)) (ghub (2 0 0))) "Browse your Github Stars" single ((:commit . "a9f25ab2487c886f5d50d26693d49856bd51383b") (:authors ("Xu Chunyang" . "mail@xuchunyang.me")) (:maintainer "Xu Chunyang" . "mail@xuchunyang.me") (:keywords "tools") (:url . "https://github.com/xuchunyang/github-stars.el"))])
+ (github-theme . [(20170630 2201) nil "The GitHub color theme for Emacs." single ((:commit . "29f00a51d949a248a5f6355a97131e216747c797") (:authors ("Philip Arvidsson" . "philip@philiparvidsson.com")) (:maintainer "Philip Arvidsson" . "philip@philiparvidsson.com") (:url . "https://github.com/philiparvidsson/GitHub-Theme-for-Emacs"))])
+ (gitignore-snippets . [(20201118 1551) ((emacs (26)) (yasnippet (0 8 0))) "Gitignore.io templates for Yasnippet" tar ((:commit . "0de6945ff0fc6943eebcf92d1cbb66b6a1d8fa60") (:authors ("Seong Yong-ju" . "sei40kr@gmail.com")) (:maintainer "Seong Yong-ju" . "sei40kr@gmail.com") (:keywords "tools") (:url . "https://github.com/sei40kr/gitignore-snippets"))])
+ (gitignore-templates . [(20210814 144) ((emacs (24 3))) "Create .gitignore using GitHub or gitignore.io API" single ((:commit . "d28cd1cec00242b688861648d36d086818b06099") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:keywords "tools") (:url . "https://github.com/xuchunyang/gitignore-templates.el"))])
+ (gitlab . [(20180312 1647) ((s (1 9 0)) (dash (2 9 0)) (pkg-info (0 5 0)) (request (0 1 0))) "Emacs client for Gitlab" tar ((:commit . "8c2324c02119500f094c2f92dfaba4c9977ce1ba") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "gitlab") (:url . "https://github.com/nlamirault/emacs-gitlab"))])
+ (gitlab-ci-mode . [(20191022 2017) ((emacs (25 1)) (yaml-mode (0 0 12))) "Mode for editing GitLab CI files" single ((:commit . "c861dc5fa17d380d5c3aca99dc3bbec5eee623bc") (:authors ("Joe Wreschnig")) (:maintainer "Joe Wreschnig") (:keywords "tools" "vc") (:url . "https://gitlab.com/joewreschnig/gitlab-ci-mode/"))])
+ (gitlab-ci-mode-flycheck . [(20190323 1829) ((emacs (25)) (flycheck (31)) (gitlab-ci-mode (1))) "Flycheck support for ‘gitlab-ci-mode’" single ((:commit . "eba81cfb7224fd1fa4e4da90d11729cc7ea12f72") (:authors ("Joe Wreschnig")) (:maintainer "Joe Wreschnig") (:keywords "tools" "vc" "convenience") (:url . "https://gitlab.com/joewreschnig/gitlab-ci-mode-flycheck/"))])
+ (gitlab-pipeline . [(20210601 1339) ((emacs (25 1)) (ghub (3 3 0))) "Get infomation about Gitlab pipelines" single ((:commit . "2404f9cf0a064aabea975adada250895c385e057") (:authors ("Giap Tran" . "txgvnn@gmail.com")) (:maintainer "Giap Tran" . "txgvnn@gmail.com") (:keywords "comm" "tools" "git") (:url . "https://github.com/TxGVNN/gitlab-pipeline"))])
+ (gitlab-snip-helm . [(20200427 2014) ((emacs (25)) (dash (2 12 0)) (helm (3 2))) "Gitlab snippets api helm package" single ((:commit . "782df679e33646db29e07508311bc8e8624b484e") (:authors ("Fermin MF" . "fmfs@posteo.net")) (:maintainer "Fermin MF" . "fmfs@posteo.net") (:keywords "tools" "files" "convenience") (:url . "https://gitlab.com/sasanidas/gitlab-snip-helm"))])
+ (gitolite-clone . [(20160609 2355) ((dash (2 10 0)) (s (1 9 0)) (pcache (0 3 1)) (emacs (24))) "Clone gitolite repositories from a completing list" single ((:commit . "d8a4c2875c984e51137c980b5773f42703602721") (:authors ("Ivan Malison" . "IvanMalison@gmail.com")) (:maintainer "Ivan Malison" . "IvanMalison@gmail.com") (:keywords "gitolite" "clone" "git") (:url . "https://github.com/IvanMalison/gitolite-clone"))])
+ (gitpatch . [(20170722 410) ((emacs (24 3))) "Git-format patch toolkit" single ((:commit . "577d5adf65c8133caa325c10e89e1e2fc323c907") (:authors ("Feng Shu" . "tumashu@163.com")) (:maintainer "Feng Shu" . "tumashu@163.com") (:keywords "convenience") (:url . "https://github.com/tumashu/gitpatch"))])
+ (gitter . [(20220316 138) ((emacs (24 4)) (let-alist (1 0 4))) "An Emacs Gitter client" single ((:commit . "49327c91eb50cfea633af8fd32b0643691d75cb7") (:authors ("Chunyang Xu" . "mail@xuchunyang.me")) (:maintainer "Chunyang Xu" . "mail@xuchunyang.me") (:keywords "gitter" "chat" "client" "internet") (:url . "https://github.com/xuchunyang/gitter.el"))])
+ (gkroam . [(20220326 521) ((emacs (26 3)) (db (0 0 6)) (company (0 9 10))) "A lightweight org-mode Roam Research replica" single ((:commit . "38f517ac2894b16e6cf983b93ee96762fffa152a") (:authors ("Kinney Zhang" . "kinneyzhang666@gmail.com")) (:maintainer "Kinney Zhang" . "kinneyzhang666@gmail.com") (:keywords "org" "convenience") (:url . "https://github.com/Kinneyzhang/gkroam"))])
+ (gl-conf-mode . [(20170714 1310) ((emacs (24 3))) "Mode for editing gitolite config files" single ((:commit . "9136a9b737e0a5b6471a91571d104c487c43f35b") (:authors ("Luis Lloret")) (:maintainer "Luis Lloret") (:keywords "git" "gitolite" "languages") (:url . "https://github.com/llloret/gitolite-emacs"))])
+ (global-tags . [(20211120 347) ((emacs (26 1)) (async (1 9 4)) (project (0 5 2)) (ht (2 3))) "Elisp API and editor integration for GNU global" single ((:commit . "aaa37da4c538f35a90149ef4ad3d8b0922af54ab") (:authors ("Felipe Lema" . "felipelema@mortemale.org")) (:maintainer "Felipe Lema" . "felipelema@mortemale.org") (:keywords "convenience" "matching" "tools") (:url . "https://launchpad.net/global-tags.el"))])
+ (glsl-mode . [(20210808 1945) nil "major mode for Open GLSL shader files" single ((:commit . "9b2e5f28e489a1f73c4aed734105618ac0dc0c43") (:keywords "languages" "opengl" "gpu" "spir-v" "vulkan") (:url . "https://github.com/jimhourihan/glsl-mode"))])
+ (gmail-message-mode . [(20160627 1847) ((ham-mode (1 0))) "A major-mode for editing gmail messages using markdown syntax." single ((:commit . "ec36672a9dc93c09ebe2f77597b498d11883d008") (:authors ("Artur Malabarba" . "bruce.connor.am@gmail.com")) (:maintainer "Artur Malabarba" . "bruce.connor.am@gmail.com") (:keywords "mail" "convenience" "emulation") (:url . "http://github.com/Bruce-Connor/gmail-message-mode"))])
+ (gmail2bbdb . [(20170423 1144) nil "import email and name into bbdb from vcard." single ((:commit . "a84fa385cfaec7fc5f1518c368e52722da139f99") (:authors ("Chen Bin" . "chenbin.sh@gmail.com")) (:maintainer "Chen Bin" . "chenbin.sh@gmail.com") (:keywords "vcard" "bbdb" "email" "contact" "gmail") (:url . "http://github.com/redguardtoo/gmail2bbdb"))])
+ (gmpl-mode . [(20220121 631) ((emacs (24))) "Major mode for editing GMPL(MathProg) files" single ((:commit . "97b103eea8b18f7e27b0f0be6cb4809a4156c032") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions"))])
+ (gmsh-mode . [(20211204 826) ((emacs (26 1))) "Highlight GMSH mesh generator script syntax" single ((:commit . "2b7c573f378f7e9210400115d4d9dfd879f8a4ad") (:authors ("Matsievskiy S.V.")) (:maintainer "Matsievskiy S.V.") (:keywords "languages") (:url . "https://gitlab.com/matsievskiysv/gmsh-mode"))])
+ (gn-mode . [(20190428 1812) ((emacs (24)) (cl-lib (0 5))) "major mode for editing GN (generate ninja) files" single ((:commit . "fcf8e1e500d953364e97e7ebc5708a2c00fa3cd2") (:authors ("Emily Backes" . "lucca@accela.net")) (:maintainer "Emily Backes" . "lucca@accela.net") (:keywords "data") (:url . "http://github.com/lashtear/gn-mode"))])
+ (gnome-calendar . [(20161110 1256) nil "Integration with the GNOME Shell calendar" single ((:commit . "489f9f15f7bb35696b1cc19db75b554ae8328df2") (:authors ("Nicolas Petton" . "nicolas@petton.fr")) (:maintainer "Nicolas Petton" . "nicolas@petton.fr") (:keywords "gnome" "calendar"))])
+ (gnome-screencast . [(20210125 2001) ((emacs (25))) "Use Gnome screen recording functionality using elisp" single ((:commit . "6450ee470e84ff14a15c5c3c0489c79ff593f165") (:authors ("Jürgen Hötzel" . "juergen@hoetzel.info")) (:maintainer "Jürgen Hötzel" . "juergen@hoetzel.info") (:keywords "tools" "multimedia") (:url . "https://github.com/juergenhoetzel/emacs-gnome-screencast"))])
+ (gnomenm . [(20150316 1918) ((s (1 9 0)) (dash (2 3 0)) (kv (0 0 19))) "Emacs interface to Gnome nmcli command" single ((:commit . "9065cda44ffc9e06239b8189a0154d31314c3b4d") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "processes" "hardware") (:url . "http://github.com/nicferrier/emacs-nm"))])
+ (gntp . [(20141025 250) nil "Growl Notification Protocol for Emacs" single ((:commit . "767571135e2c0985944017dc59b0be79af222ef5") (:authors ("Engelke Eschner" . "tekai@gmx.li")) (:maintainer "Engelke Eschner" . "tekai@gmx.li"))])
+ (gnu-apl-mode . [(20220404 341) ((emacs (27))) "Integrate GNU APL with Emacs" tar ((:commit . "c8695b0d55b5167263a843252ffd21a589018427") (:authors ("Elias Mårtenson" . "lokedhs@gmail.com")) (:maintainer "Elias Mårtenson" . "lokedhs@gmail.com") (:keywords "languages") (:url . "http://www.gnu.org/software/apl/"))])
+ (gnu-indent . [(20220330 422) ((emacs (27 2))) "Indent your code with GNU Indent" single ((:commit . "cd5dc79ac65c24e9e775bd2582ad620e316f2182") (:authors ("Akib Azmain Turja" . "akib@disroot.org")) (:maintainer "Akib Azmain Turja" . "akib@disroot.org") (:keywords "tools" "c") (:url . "https://codeberg.org/akib/emacs-gnu-indent"))])
+ (gnuplot . [(20220102 1637) ((emacs (24 3))) "Major-mode and interactive frontend for gnuplot" tar ((:commit . "57be3c7addec31e226a5a27aa553e996f9c684e3") (:authors ("Jon Oddie") ("Bruce Ravel") ("Phil Type")) (:maintainer "Bruce Ravel" . "bruceravel1@gmail.com") (:keywords "data" "gnuplot" "plotting") (:url . "https://github.com/emacsorphanage/gnuplot"))])
+ (gnuplot-mode . [(20171013 1616) nil "Major mode for editing gnuplot scripts" single ((:commit . "601f6392986f0cba332c87678d31ae0d0a496ce7") (:keywords "gnuplot" "plotting") (:url . "https://github.com/mkmcc/gnuplot-mode"))])
+ (gnus-alias . [(20150316 42) nil "an alternative to gnus-posting-styles" single ((:commit . "9447d3ccb4c0e75d0468899cccff7aa249657bac") (:authors ("Joe Casadonte" . "emacs@northbound-train.com")) (:maintainer "Mark A. Hershberger" . "mah@everybody.org") (:keywords "personality" "identity" "news" "mail" "gnus"))])
+ (gnus-desktop-notify . [(20180623 1538) ((gnus (1 0))) "Gnus Desktop Notification global minor mode" single ((:commit . "b438feb59136621a8ab979f0e2784f7002398d06") (:authors ("Yuri D'Elia <wavexx AT thregr.org>")) (:maintainer "Yuri D'Elia <wavexx AT thregr.org>") (:url . "http://www.thregr.org/~wavexx/software/gnus-desktop-notify.el/"))])
+ (gnus-notes . [(20210207 1010) ((emacs (27 1)) (bbdb (3 1)) (helm (3 1)) (hydra (0 13 0)) (org (8 3)) (s (0 0)) (lv (0 0)) (async (1 9 1))) "Keep handy notes of read Gnus articles with helm and org" tar ((:commit . "1457bba34b40d5197aa14dbf0856925f83025ae1") (:authors ("Deus Max" . "deusmax@gmx.com")) (:maintainer "Deus Max" . "deusmax@gmx.com") (:keywords "convenience" "mail" "bbdb" "gnus" "helm" "org" "hydra") (:url . "https://github.com/deusmax/gnus-notes"))])
+ (gnus-recent . [(20220324 2011) ((emacs (25 3 2))) "Article breadcrumbs for Gnus" single ((:commit . "a0ace8ea6e62a6b79a18149fbd560c6948a8103b") (:authors ("Kevin Brubeck Unhammer" . "unhammer@fsfe.org")) (:maintainer "Kevin Brubeck Unhammer" . "unhammer@fsfe.org") (:keywords "convenience" "mail") (:url . "https://github.com/unhammer/gnus-recent"))])
+ (gnus-select-account . [(20170722 511) nil "Select an account before writing a mail in gnus" single ((:commit . "ddc8c135eeaf90f5b6692a033af2badae36e68ce") (:authors ("Feng Shu " . "tumashu@163.com")) (:maintainer "Feng Shu " . "tumashu@163.com") (:keywords "convenience") (:url . "https://github.com/tumashu/gnus-select-account"))])
+ (gnus-summary-ext . [(20180113 1316) nil "Extra limit and process mark commands for the gnus summary buffer" single ((:commit . "025fd853fe9280ae696a89ec2c2cac9befd010aa") (:authors ("Joe Bloggs" . "vapniks@yahoo.com")) (:maintainer "Joe Bloggs" . "vapniks@yahoo.com") (:keywords "comm") (:url . "https://github.com/vapniks/gnus-summary-ext"))])
+ (gnus-summary-repo . [(20190617 1419) ((emacs (25))) "Import and export files between IMAP and local by using GNUS" single ((:commit . "1341b68dfda952a95f5d9b4cb7d427716dafa310") (:authors ("Giap Tran" . "txgvnn@gmail.com")) (:maintainer "Giap Tran" . "txgvnn@gmail.com") (:keywords "gnus" "repository") (:url . "https://github.com/TxGVNN/gnus-summary-repo"))])
+ (gnus-x-gm-raw . [(20140610 731) ((log4e (0 2 0)) (yaxception (0 1))) "Search mail of Gmail using X-GM-RAW as web interface" single ((:commit . "978bdfcecc8844465b71641c2e909fcdc66b22be") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "gnus") (:url . "https://github.com/aki2o/gnus-x-gm-raw"))])
+ (go . [(20220414 1956) ((emacs (24))) "Play GO, translate and transfer between GO back ends" tar ((:commit . "79690579496b0df85a1c94199aca968371b58b3c") (:authors ("Eric Schulte" . "schulte.eric@gmail.com")) (:maintainer "Eric Schulte" . "schulte.eric@gmail.com") (:keywords "game" "go" "sgf") (:url . "http://eschulte.github.io/el-go/"))])
+ (go-add-tags . [(20161123 1227) ((emacs (24 3)) (s (1 11 0))) "Add field tags for struct fields" single ((:commit . "54879945e46a0884c5f93d7fd6c866a9cdf401ac") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-go-add-tags"))])
+ (go-autocomplete . [(20170626 1023) ((auto-complete (1 4 0))) "auto-complete-mode backend for go-mode" single ((:commit . "5327738ec1be51061a3f31010c89bdd4924ca496") (:authors ("Mikhail" . "tensai@cirno.in")) (:maintainer "Mikhail" . "tensai@cirno.in") (:keywords "languages"))])
+ (go-complete . [(20190409 516) ((go-mode (0)) (cl-lib (0 5))) "Native code completion for Go" single ((:commit . "056294014f37a1004958ec17ebd6748deed63502") (:authors ("Vibhav Pant" . "vibhavp@gmail.com")) (:maintainer "Vibhav Pant" . "vibhavp@gmail.com") (:keywords "go" "golang" "completion") (:url . "https://github.com/vibhavp/go-complete"))])
+ (go-direx . [(20150316 143) ((direx (1 0 0)) (cl-lib (0 5))) "Tree style source code viewer for Go language" single ((:commit . "8f2206469328ee932c7f1892f5e1fb02dec98432") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-go-direx"))])
+ (go-dlv . [(20220126 1436) ((go-mode (1 3 1))) "Go Delve - Debug Go programs interactively with the GUD." single ((:commit . "0a296bc3b7b4dcf0c140a78c5ca3e1a8c6b7ea1a") (:authors ("Marko Bencun" . "mbencun@gmail.com")) (:maintainer "Marko Bencun" . "mbencun@gmail.com") (:keywords "go" "debug" "debugger" "delve" "interactive" "gud") (:url . "https://github.com/benma/go-dlv.el/"))])
+ (go-eldoc . [(20170305 1427) ((emacs (24 3)) (go-mode (1 0 0))) "eldoc for go-mode" single ((:commit . "cbbd2ea1e94a36004432a9ac61414cb5a95a39bd") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-go-eldoc"))])
+ (go-errcheck . [(20160723 43) nil "errcheck integration for go-mode" single ((:commit . "9db21eccecedc2490793f176246094167164af31") (:authors ("Dominik Honnef" . "dominikh@fork-bomb.org")) (:maintainer "Dominik Honnef" . "dominikh@fork-bomb.org"))])
+ (go-expr-completion . [(20200817 1750) ((emacs (24 1))) "Complement the return values for Go" single ((:commit . "66bba78f52a732b978848e3a4c99fa2afeb6c25f") (:authors ("Ryo Fujimoto" . "fujimisakri@gmail.com")) (:maintainer "Ryo Fujimoto" . "fujimisakri@gmail.com") (:url . "https://github.com/fujimisakari/emacs-go-expr-completion"))])
+ (go-fill-struct . [(20171225 331) ((emacs (24))) "Fill struct for golang." single ((:commit . "a613d0b378473eef39e8fd5724abe790aea84321") (:authors ("Sergey Kostyaev" . "feo.me@ya.ru")) (:maintainer "Sergey Kostyaev" . "feo.me@ya.ru") (:keywords "tools") (:url . "https://github.com/s-kostyaev/go-fill-struct"))])
+ (go-gen-test . [(20210816 1215) ((emacs (24 3)) (s (1 12))) "Generate tests for go code with gotests" single ((:commit . "35df36dcd555233ee1a618c0f6a58ce6db4154d9") (:authors ("Sergey Kostyaev" . "feo.me@ya.ru")) (:maintainer "Sergey Kostyaev" . "feo.me@ya.ru") (:keywords "languages") (:url . "https://github.com/s-kostyaev/go-gen-test"))])
+ (go-gopath . [(20160705 1034) ((cl-lib (0 5))) "Will guess GOPATH using gb and projectile." single ((:commit . "5172fc53f21edbf9347d5ee7d1d745da1ec88a15") (:authors ("Andrew Kirilenko" . "andrew.kirilenko.main@gmail.com")) (:maintainer "Andrew Kirilenko" . "andrew.kirilenko.main@gmail.com") (:url . "http://github.com/iced/go-gopath/"))])
+ (go-guru . [(20181012 330) ((go-mode (1 3 1)) (cl-lib (0 5))) "Integration of the Go 'guru' analysis tool into Emacs." single ((:commit . "fa2693278637f56759480d2bf203bb8aad107230") (:keywords "tools"))])
+ (go-imenu . [(20181029 1029) ((emacs (24 3))) "Enhance imenu for go language" single ((:commit . "4f3f334ed0b6f6afaca6b9775636a52ad3843053") (:authors ("Brantou" . "brantou89@gmail.com")) (:maintainer "Brantou" . "brantou89@gmail.com") (:keywords "tools") (:url . "https://github.com/brantou/go-imenu.el"))])
+ (go-impl . [(20210621 743) ((emacs (24 3)) (go-mode (1 3 0))) "impl integration for go-mode" single ((:commit . "1eebba6ccd02d11a5a82ad4540a8d562797bc3b3") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-go-impl"))])
+ (go-imports . [(20190715 1647) nil "Insert go import statement given package name" tar ((:commit . "55681e815da93b6f927213c4aa352ae33db97c37") (:authors ("Yaz Saito")) (:maintainer "Yaz Saito") (:keywords "tools" "go" "import") (:url . "https://github.com/yasushi-saito/go-imports"))])
+ (go-mode . [(20220114 2239) ((emacs (26 1))) "Major mode for the Go programming language" single ((:commit . "fa2693278637f56759480d2bf203bb8aad107230") (:authors ("The go-mode Authors")) (:maintainer "The go-mode Authors") (:keywords "languages" "go") (:url . "https://github.com/dominikh/go-mode.el"))])
+ (go-noisegate . [(20200502 703) ((emacs (24 4))) "Run Golang tests with Noise Gate" single ((:commit . "e3fc198c234131c94f7d307b7f7c6ef623fb93b7") (:authors ("The Noise Gate Authors")) (:maintainer "The Noise Gate Authors") (:keywords "languages" "go" "test") (:url . "https://github.com/go-noisegate/go-noisegate.el"))])
+ (go-playground . [(20220106 1618) ((emacs (24)) (go-mode (1 4 0)) (gotest (0 13 0))) "Local Golang playground for short snippets." single ((:commit . "9ee7dcc7f78be67cc391f13efa6570c2baac0204") (:authors ("Alexander I.Grafov" . "grafov@gmail.com")) (:maintainer "Alexander I.Grafov" . "grafov@gmail.com") (:keywords "tools" "golang") (:url . "https://github.com/grafov/go-playground"))])
+ (go-playground-cli . [(20160503 914) ((emacs (24)) (request (0 2 0)) (deferred (0 3 2)) (names (20151201 404)) (s (1 10 0)) (f (0 17 2)) (let-alist (1 0 4)) (cl-lib (0 5))) "Go Playground client tool" single ((:commit . "60beebd98e3930641d41cee0189c579626f223bc") (:authors ("KOBAYASHI Shigeru (kosh)" . "shigeru.kb@gmail.com")) (:maintainer "KOBAYASHI Shigeru (kosh)" . "shigeru.kb@gmail.com") (:url . "https://github.com/kosh04/go-playground-cli"))])
+ (go-projectile . [(20200609 131) ((projectile (0 10 0)) (go-mode (0)) (go-eldoc (0 16)) (go-rename (0)) (go-guru (0)) (dash (2 17 0))) "Go add-ons for Projectile" single ((:commit . "ad4ca3b5695a0e31e95e3cc4ccab498f87d68303") (:authors ("Doug MacEachern" . "dougm@vmware.com")) (:maintainer "Doug MacEachern" . "dougm@vmware.com") (:keywords "project" "convenience") (:url . "https://github.com/dougm/go-projectile"))])
+ (go-rename . [(20190805 2101) ((go-mode (1 3 1))) "Integration of the 'gorename' tool into Emacs." single ((:commit . "fa2693278637f56759480d2bf203bb8aad107230") (:keywords "tools"))])
+ (go-scratch . [(20150810 440) ((go-mode (1 3 1)) (emacs (24))) "*scratch* buffer for Go" single ((:commit . "3f68cbcce04f59eb8e83af109164731ec0454be0") (:authors ("Emanuel Evans" . "mail@emanuel.industries")) (:maintainer "Emanuel Evans" . "mail@emanuel.industries") (:keywords "languages" "go"))])
+ (go-snippets . [(20180113 611) ((yasnippet (0 8 0))) "Yasnippets for go" tar ((:commit . "d437df148879566ffe7f2e503a3cf2602aa9fb28") (:keywords "snippets"))])
+ (go-stacktracer . [(20150430 2142) nil "parse Go stack traces" single ((:commit . "a2ac6d801b389f80ca4e2fcc1ab44513a9e55976") (:authors ("Samer Masterson" . "samer@samertm.com")) (:maintainer "Samer Masterson" . "samer@samertm.com") (:keywords "tools") (:url . "https://github.com/samertm/go-stacktracer.el"))])
+ (go-tag . [(20180227 411) ((emacs (24 0)) (go-mode (1 5 0))) "Edit Golang struct field tag" single ((:commit . "59b243f2fa079d9de9d56f6e2d94397e9560310a") (:authors ("Brantou" . "brantou89@gmail.com")) (:maintainer "Brantou" . "brantou89@gmail.com") (:keywords "tools") (:url . "https://github.com/brantou/emacs-go-tag"))])
+ (go-translate . [(20220404 1240) ((emacs (27 1))) "Translation framework supports multiple engines such as Google/Bing/DeepL" tar ((:commit . "b0898e6cd647e38e6f70e6cd121b789610573237") (:authors ("lorniu" . "lorniu@gmail.com")) (:maintainer "lorniu" . "lorniu@gmail.com") (:keywords "convenience") (:url . "https://github.com/lorniu/go-translate"))])
+ (gobgen . [(20161020 1523) ((emacs (24 4))) "Generate GObject descendants using a detailed form" single ((:commit . "ed2c2b0d217deae293096f3cf14aa492791ddd4f") (:authors ("Gergely Polonkai" . "gergely@polonkai.eu")) (:maintainer "Gergely Polonkai" . "gergely@polonkai.eu") (:keywords "gobject" "glib" "gtk" "helper" "utilities"))])
+ (god-mode . [(20210102 515) ((emacs (25 1))) "Minor mode for God-like command entering" tar ((:commit . "fac7d26ecde1be5b0bf6bd6e0ec5b4895be13906") (:authors ("Chris Done" . "chrisdone@gmail.com")) (:maintainer "Chris Done" . "chrisdone@gmail.com") (:url . "https://github.com/emacsorphanage/god-mode"))])
+ (godoctor . [(20180710 2152) nil "Frontend for godoctor" single ((:commit . "4b45ff3d0572f0e84056e4c3ba91fcc178199859") (:authors ("Sangho Na" . "microamp@protonmail.com")) (:maintainer "Sangho Na" . "microamp@protonmail.com") (:keywords "go" "golang" "refactoring") (:url . "https://github.com/microamp/godoctor.el"))])
+ (goggles . [(20220403 1812) ((emacs (27 1))) "Pulse modified regions" single ((:commit . "6941fd5bc19c0a2789dda38334d2be582ed34e5a") (:authors ("Daniel Mendler")) (:maintainer "Daniel Mendler") (:url . "https://github.com/minad/goggles"))])
+ (gold-mode . [(20140607 206) ((sws-mode (0))) "Major mode for editing .gold files" single ((:commit . "6d3aa59602b1b835495271c8c9741ac344c2eab1") (:authors ("Yuta Yamada <cokesboy\"at\"gmail.com>")) (:maintainer "Yuta Yamada <cokesboy\"at\"gmail.com>") (:keywords "golang" "template" "gold") (:url . "https://github.com/yuutayamada/gold-mode-el"))])
+ (golden-ratio . [(20191028 1732) nil "Automatic resizing of Emacs windows to the golden ratio" single ((:commit . "007911d8a431b72670f5fe5f0e5b4380c2777a31") (:authors ("Roman Gonzalez" . "romanandreg@gmail.com")) (:maintainer "Roman Gonzalez" . "romanandreg@gmail.com") (:keywords "window" "resizing"))])
+ (golden-ratio-scroll-screen . [(20200419 451) nil "Scroll half screen down or up, and highlight current line" single ((:commit . "1b6ff0e3e8822423335d3f7d88c1fcb4cf43ce42") (:authors ("纪秀峰 <jixiuf at gmail dot com>")) (:maintainer "纪秀峰 <jixiuf at gmail dot com>") (:keywords "scroll" "screen" "highlight") (:url . "https://github.com/jixiuf/golden-ratio-scroll-screen"))])
+ (goldendict . [(20220210 1401) ((emacs (24 4)) (cl-lib (0 5))) "query word smartly with goldendict.el" single ((:commit . "f3fbe658a8d31dc1bd0ca69e4d2ebaab59e92791") (:keywords "dict" "goldendict") (:url . "https://repo.or.cz/goldendict.el.git"))])
+ (golint . [(20180221 2015) nil "lint for the Go source code" single ((:commit . "6edffad5e6160f5949cdefc81710b2706fbcd4f6") (:url . "https://github.com/golang/lint"))])
+ (gom-mode . [(20131008 253) nil "Major mode for Gomfile" single ((:commit . "972e33df1d38ff323bc97de87477305826013701") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-gom-mode"))])
+ (gomacro-mode . [(20200326 1103) ((emacs (24 4)) (go-mode (1 5 0))) "Gomacro mode and Go REPL integration" single ((:commit . "3112e56d2d5e645a3e0fd877f3e810dbccbf989f") (:authors ("Petter Storvik")) (:maintainer "Petter Storvik") (:keywords "gomacro" "repl" "languages" "tools" "processes") (:url . "https://github.com/storvik/gomacro-mode"))])
+ (good-scroll . [(20211101 942) ((emacs (27 1))) "Good pixel line scrolling" tar ((:commit . "a7ffd5c0e5935cebd545a0570f64949077f71ee3") (:authors ("Benjamin Levy" . "blevy@protonmail.com")) (:maintainer "Benjamin Levy" . "blevy@protonmail.com") (:url . "https://github.com/io12/good-scroll.el"))])
+ (google . [(20140416 1748) nil "Emacs interface to the Google API" single ((:commit . "3b3189a8b201c8d36fed6e61496274e530dd40bd") (:authors ("Edward O'Connor" . "ted@oconnor.cx")) (:maintainer "Edward O'Connor" . "ted@oconnor.cx") (:keywords "comm" "processes" "tools"))])
+ (google-c-style . [(20220210 1659) nil "Google's C/C++ style for c-mode" single ((:commit . "1faa779a126c3564e74d6254d596da8dd2b4bf56") (:keywords "c" "tools"))])
+ (google-contacts . [(20201012 1056) ((oauth2 (0 10)) (cl-lib (0 5))) "Support for Google Contacts in Emacs" tar ((:commit . "8923c238fe0906184d2254b33ba72792ed12cd47") (:authors ("Julien Danjou" . "julien@danjou.info")) (:maintainer "Julien Danjou" . "julien@danjou.info") (:keywords "comm") (:url . "https://github.com/jd/google-contacts.el"))])
+ (google-maps . [(20181121 1532) ((emacs (24 3))) "Access Google Maps from Emacs" tar ((:commit . "2eb16ff609f5a9f8d02c15238a111fbb7db6c146") (:authors ("Julien Danjou" . "julien@danjou.info")) (:maintainer "Julien Danjou" . "julien@danjou.info") (:keywords "comm") (:url . "https://julien.danjou.info/projects/emacs-packages#google-maps"))])
+ (google-this . [(20170810 1215) ((emacs (24 1))) "A set of functions and bindings to google under point." single ((:commit . "8a2e3ca5da6a8c89bfe99a21486c6c7db125dc84") (:authors ("Artur Malabarba" . "bruce.connor.am@gmail.com")) (:maintainer "Artur Malabarba" . "bruce.connor.am@gmail.com") (:keywords "convenience" "hypermedia") (:url . "http://github.com/Malabarba/emacs-google-this"))])
+ (google-translate . [(20210406 1138) nil "Emacs interface to Google Translate." tar ((:commit . "0f7f48a09bca064999ecea03102a7c96f52cbd1b") (:authors ("Oleksandr Manzyuk" . "manzyuk@gmail.com")) (:maintainer "Andrey Tykhonov" . "atykhonov@gmail.com") (:keywords "convenience") (:url . "https://github.com/atykhonov/google-translate"))])
+ (goose-theme . [(20160828 1245) ((emacs (24 1))) "A gray color theme" single ((:commit . "acd017b50ab25a75fd1331eb3de66467e2042e9c") (:authors ("Stephen Whipple" . "shw@wicdmedia.org")) (:maintainer "Stephen Whipple" . "shw@wicdmedia.org") (:url . "https://github.com/thwg/goose-theme"))])
+ (gore-mode . [(20151123 1927) ((go-mode (1 0 0))) "Simple mode for gore, a command-line evaluator for golang." single ((:commit . "94d7f3e99104e06167967c98fdc201049c433c2d") (:authors ("Sergey Pashaev" . "sergey.pashaev@gmail.com")) (:maintainer "Sergey Pashaev" . "sergey.pashaev@gmail.com") (:keywords "go" "repl"))])
+ (gorepl-mode . [(20170905 945) ((emacs (24)) (s (1 11 0)) (f (0 19 0)) (hydra (0 13 0))) "Go REPL Interactive Development in top of Gore" single ((:commit . "6a73bf352e8d893f89cad36c958c4db2b5e35e07") (:authors ("Manuel Alonso" . "manuteali@gmail.com")) (:maintainer "Manuel Alonso" . "manuteali@gmail.com") (:keywords "languages" "go" "golang" "gorepl") (:url . "http://www.github.com/manute/gorepl-mode"))])
+ (gotest . [(20220209 1739) ((emacs (24 3)) (s (1 11 0)) (f (0 19 0)) (go-mode (1 5 0))) "Launch GO unit tests" single ((:commit . "78be56c0f210224b1e3a7d58239e2a32f8f84bf4") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "languages" "go" "tests") (:url . "https://github.com/nlamirault/gotest.el"))])
+ (gotham-theme . [(20220107 1730) ((emacs (24 1))) "A very dark Emacs color theme" single ((:commit . "4b8214df0851bb69b44c3e864568b7e0030a95d2") (:authors ("Vasilij Schneidermann" . "mail@vasilij.de")) (:maintainer "Vasilij Schneidermann" . "mail@vasilij.de") (:url . "https://depp.brause.cc/gotham-theme"))])
+ (goto-char-preview . [(20210323 332) ((emacs (24 3))) "Preview character when executing `goto-char` command" single ((:commit . "ea845966423ce90526d717bb27d0022101c75796") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/goto-char-preview"))])
+ (goto-chg . [(20220107 1733) ((emacs (24 1))) "Go to last change" single ((:commit . "278cd3e6d5107693aa2bb33189ca503f22f227d0") (:authors ("David Andersson <l.david.andersson(at)sverige.nu>")) (:maintainer "Vasilij Schneidermann" . "mail@vasilij.de") (:keywords "convenience" "matching") (:url . "https://github.com/emacs-evil/goto-chg"))])
+ (goto-last-change . [(20150109 1823) nil "Move point through buffer-undo-list positions" single ((:commit . "58b0928bc255b47aad318cd183a5dce8f62199cc") (:authors ("Kevin Rodgers" . "ihs_4664@yahoo.com")) (:maintainer "Kevin Rodgers" . "ihs_4664@yahoo.com") (:keywords "convenience") (:url . "https://github.com/camdez/goto-last-change.el"))])
+ (goto-last-point . [(20190525 1855) ((emacs (24 3))) "Record and jump to the last point in the buffer." single ((:commit . "7ea191df18ff4774cf1dc568e1726143dd54ea02") (:authors ("Manuel Uberti" . "manuel.uberti@inventati.org")) (:maintainer "Manuel Uberti" . "manuel.uberti@inventati.org") (:keywords "convenience") (:url . "https://github.com/manuel-uberti/goto-last-point"))])
+ (goto-line-preview . [(20210323 422) ((emacs (25))) "Preview line when executing `goto-line` command" single ((:commit . "d4db955860de830ebc067b065cba16a776717e76") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/goto-line-preview"))])
+ (govc . [(20220509 1455) ((emacs (24 3)) (dash (1 5 0)) (s (1 9 0)) (magit-popup (2 0 50)) (json-mode (1 6 0))) "Interface to govc for managing VMware ESXi and vCenter" single ((:commit . "72c2000c01b73c884f1f94df52765762e187b1de") (:authors ("The govc developers")) (:maintainer "The govc developers") (:keywords "convenience") (:url . "https://github.com/vmware/govmomi/tree/master/govc/emacs"))])
+ (govet . [(20170808 1724) nil "linter/problem finder for the Go source code" single ((:commit . "1c05817cf8b96589076c7ac4e52ee58a860a0cbf") (:url . "https://godoc.org/golang.org/x/tools/cmd/vet"))])
+ (gpastel . [(20181229 1404) ((emacs (25 1))) "Integrates GPaste with the kill-ring" single ((:commit . "d5fc55bc825203f998537c5834718e665bb87c29") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:keywords "tools") (:url . "https://gitlab.petton.fr/DamienCassou/desktop-environment"))])
+ (grab-mac-link . [(20210511 1303) ((emacs (24))) "Grab link from Mac Apps and insert it into Emacs" single ((:commit . "2c722016ca01bd4265d57c4a7d55712c94cf4ea5") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:keywords "mac" "hyperlink") (:url . "https://github.com/xuchunyang/grab-mac-link.el"))])
+ (grab-x-link . [(20191113 848) ((emacs (24)) (cl-lib (0 5))) "Grab links from X11 apps and insert into Emacs" single ((:commit . "d898db46e4864118359fdedfe915e180de3fe290") (:authors ("Xu Chunyang" . "mail@xuchunyang.me")) (:maintainer "Xu Chunyang" . "mail@xuchunyang.me") (:keywords "hyperlink") (:url . "https://github.com/xuchunyang/grab-x-link"))])
+ (gradle-mode . [(20150313 1905) ((s (1 8 0))) "Gradle integration with Emacs' compile" single ((:commit . "e4d665d5784ecda7ddfba015f07c69be3cfc45f2") (:authors ("Daniel Mijares" . "daniel.j.mijares@gmail.com")) (:maintainer "Daniel Mijares" . "daniel.j.mijares@gmail.com") (:keywords "gradle") (:url . "http://github.com/jacobono/emacs-gradle-mode"))])
+ (grails . [(20220407 1847) ((emacs (24))) "Minor mode for Grails projects" single ((:commit . "350869ecc4f429fc4e26f826d6050d068e724c5d") (:url . "https://github.com/lifeisfoo/emacs-grails"))])
+ (grails-mode . [(20220407 1954) nil "minor-mode that adds some Grails project management to a grails project" single ((:commit . "29210e5a969c02169b68e04f2e28e3bf2fc13363") (:authors ("Jim Morris" . "morris@wolfman.com")) (:maintainer "Russel Winder" . "russel@winder.org.uk") (:keywords "languages") (:url . "http://blog.wolfman.com"))])
+ (grails-projectile-mode . [(20160327 1324) ((projectile (0 10 0)) (emacs (24)) (cl-lib (0 5))) "Grails mode with Projectile for projects management." tar ((:commit . "8efca50ce92b556fe9d467b157d7aec635bcc017") (:authors ("Yves Zoundi" . "rimerosolutions@gmail.com")) (:maintainer "Yves Zoundi") (:keywords "grails" "projectile") (:url . "https://github.com/yveszoundi/grails-projectile-mode"))])
+ (grammarly . [(20220509 1937) ((emacs (26 1)) (s (1 12 0)) (request (0 3 0)) (websocket (1 6))) "Grammarly API interface" single ((:commit . "3e14e53b87465ca35b08b5355061e380afb87b31") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/emacs-grammarly/grammarly"))])
+ (grandshell-theme . [(20180606 517) nil "Dark color theme for Emacs > 24 with intensive colors." tar ((:commit . "0ed8e4273607dd4fcaa742b4097259233b09eda6") (:authors ("steckerhalter")) (:maintainer "steckerhalter") (:keywords "color" "theme" "grand" "shell" "faces") (:url . "https://framagit.org/steckerhalter/grandshell-theme"))])
+ (graphene . [(20180529 1112) ((dash (2 10 0)) (exec-path-from-shell (1 9)) (ppd-sr-speedbar (0 0 6)) (sr-speedbar (20140505)) (ido-completing-read+ (4 3)) (smex (3 0)) (web-mode (11 2)) (smartparens (1 8 0)) (graphene-meta-theme (0 0 2)) (flycheck (0 23)) (company (0 8 12))) "Friendly Emacs defaults" tar ((:commit . "cc8477fcfb7771ea4e5bbaf3c01f9e679234c1c1") (:authors ("Robert Dallas Gray" . "mail@robertdallasgray.com")) (:maintainer "Robert Dallas Gray" . "mail@robertdallasgray.com") (:keywords "defaults") (:url . "https://github.com/rdallasgray/graphene"))])
+ (graphene-meta-theme . [(20161204 1607) nil "Integrated theming for common packages" single ((:commit . "62cc73fee31f1bd9474027b83a249feee050271e") (:authors ("Robert Dallas Gray" . "mail@robertdallasgray.com")) (:maintainer "Robert Dallas Gray" . "mail@robertdallasgray.com") (:keywords "defaults") (:url . "https://github.com/rdallasgray/graphene"))])
+ (graphql . [(20180912 31) ((emacs (25))) "GraphQL utilities" single ((:commit . "5ca5f50b5e6f3883f1138453a356d59a1c002120") (:authors ("Sean Allred" . "code@seanallred.com")) (:maintainer "Sean Allred" . "code@seanallred.com") (:keywords "hypermedia" "tools" "lisp") (:url . "https://github.com/vermiculus/graphql.el"))])
+ (graphql-doc . [(20210808 8) ((emacs (26 1)) (request (0 3 2)) (promise (1 1))) "GraphQL Documentation Explorer" single ((:commit . "6ba7961fc9c5c9818bd60abce6ba9dfef2dad452") (:authors ("Ian Fitzpatrick")) (:maintainer "Ian Fitzpatrick") (:url . "https://github.com/ifitzpatrick/graphql-doc.el"))])
+ (graphql-mode . [(20211127 1023) ((emacs (24 3))) "Major mode for editing GraphQL schemas" single ((:commit . "9740e4027bd9313697d5cac5caaa5b15626ab1da") (:authors ("David Vazquez Pua" . "davazp@gmail.com")) (:maintainer "David Vazquez Pua" . "davazp@gmail.com") (:keywords "languages") (:url . "https://github.com/davazp/graphql-mode"))])
+ (graphviz-dot-mode . [(20220309 1336) ((emacs (25 0))) "Mode for the dot-language used by graphviz (att)." tar ((:commit . "6e96a89762760935a7dff6b18393396f6498f976") (:maintainer "Pieter Pareit" . "pieter.pareit@gmail.com") (:keywords "mode" "dot" "dot-language" "dotlanguage" "graphviz" "graphs" "att") (:url . "https://ppareit.github.io/graphviz-dot-mode/"))])
+ (grapnel . [(20131001 1534) nil "HTTP request lib with flexible callback dispatch" single ((:commit . "fbd0f9a51139973d35e4014855964fa435e8ecaf") (:authors ("David Leatherman" . "leathekd@gmail.com")) (:maintainer "David Leatherman" . "leathekd@gmail.com") (:url . "http://www.github.com/leathekd/grapnel"))])
+ (grass-mode . [(20170503 1500) ((cl-lib (0 2)) (dash (2 8 0))) "Provides Emacs modes for interacting with the GRASS GIS program" single ((:commit . "8a7e9dcb2295eef1ec25d886b05e09c876bd8398") (:authors ("Tyler Smith" . "tyler@plantarum.ca")) (:maintainer "Tyler Smith" . "tyler@plantarum.ca") (:keywords "grass" "gis"))])
+ (grayscale-theme . [(20171005 802) nil "A simple grayscale theme" single ((:commit . "53ad50e10e68f2f076ebfc96e10ecef7a932d38d") (:authors ("Kaleb Elwert" . "belak@coded.io")) (:maintainer "Kaleb Elwert" . "belak@coded.io") (:keywords "lisp") (:url . "https://github.com/belak/emacs-grayscale-theme"))])
+ (greek-polytonic . [(20190303 1358) ((emacs (24))) "Quail package for inputting polytonic Greek" single ((:commit . "114cba0f57cc077871693c799b807df2292341ec") (:authors ("Johannes Choo" . "jhanschoo@gmail.com")) (:maintainer "Johannes Choo" . "jhanschoo@gmail.com") (:keywords "i18n" "multilingual" "input method" "greek") (:url . "https://github.com/jhanschoo/greek-polytonic"))])
+ (green-is-the-new-black-theme . [(20210203 1511) nil "A cool and minimalist green blackened theme engine" single ((:commit . "09f6908064dd1854379a072d7cdd706959256299") (:authors ("Fred Campos" . "fred.tecnologia@gmail.com")) (:maintainer "Fred Campos" . "fred.tecnologia@gmail.com") (:keywords "faces" "themes") (:url . "https://github.com/fredcamps/green-is-the-new-black-emacs"))])
+ (green-phosphor-theme . [(20150515 1447) nil "A light color theme with muted, autumnal colors." single ((:commit . "fa42f598626adfdc5450e5c380fa2d5df6110f28") (:authors ("Adam Alpern" . "adam.alpern@gmail.com")) (:maintainer "Adam Alpern" . "adam.alpern@gmail.com") (:keywords "color" "theme") (:url . "http://github.com/aalpern/emacs-color-theme-green-phosphor"))])
+ (green-screen-theme . [(20180816 1502) nil "A nice color theme for those who miss green CRTs" single ((:commit . "774e8f6c033786406267f71ec07319d906a30b75") (:authors ("Ricardo Banffy" . "rbanffy@gmail.com")) (:maintainer "Ricardo Banffy" . "rbanffy@gmail.com") (:keywords "faces" "theme") (:url . "https://github.com/rbanffy/green-screen-emacs"))])
+ (gregorio-mode . [(20170705 1451) nil "Gregorio Mode for .gabc files" single ((:commit . "736fd3d05fb67f707cca1a7ce24e3ee7ca5e9567") (:authors ("Fr. John Jenkins" . "jenkins@sspx.ng")) (:maintainer "Fr. John Jenkins" . "jenkins@sspx.ng") (:keywords "gregorio" "chant") (:url . "https://jsrjenkins.github.io/gregorio-mode/"))])
+ (grep-a-lot . [(20210618 1420) nil "manages multiple search results buffers for grep.el" single ((:commit . "223819dbea049bdeb5f97f9849fce139a5f16a75") (:authors ("Avi Rozen" . "avi.rozen@gmail.com")) (:maintainer "Avi Rozen" . "avi.rozen@gmail.com") (:keywords "tools" "convenience" "search") (:url . "https://github.com/ZungBang/emacs-grep-a-lot"))])
+ (greymatters-theme . [(20150621 1123) ((emacs (24))) "Emacs 24 theme with a light background." single ((:commit . "a7220a8c6cf18ccae2b76946b6f01188a7c9d5d1") (:authors ("Martin Haesler")) (:maintainer "Martin Haesler"))])
+ (grip-mode . [(20220430 1545) ((emacs (24 4))) "Instant GitHub-flavored Markdown/Org preview using grip." single ((:commit . "7fa9e9e6b650f7a6c026b7e24c2af171e8818667") (:authors ("Vincent Zhang" . "seagle0128@gmail.com")) (:maintainer "Vincent Zhang" . "seagle0128@gmail.com") (:keywords "convenience" "markdown" "preview") (:url . "https://github.com/seagle0128/grip-mode"))])
+ (grizzl . [(20160818 737) ((cl-lib (0 5)) (emacs (24 3))) "Fast fuzzy search index for Emacs." single ((:commit . "1e917253ce2b846f0272b8356fad3dbff9cd513a") (:authors ("Chris Corbyn" . "chris@w3style.co.uk")) (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.com") (:keywords "convenience" "usability") (:url . "https://github.com/grizzl/grizzl"))])
+ (groovy-imports . [(20210505 1807) ((emacs (24 4)) (s (1 10 0)) (pcache (0 3 2))) "Code for dealing with Groovy imports" single ((:commit . "a60c3202973e3185091db623d960f71840a22205") (:authors ("Miro Bezjak")) (:maintainer "Miro Bezjak") (:keywords "groovy") (:url . "http://www.github.com/mbezjak/emacs-groovy-imports"))])
+ (groovy-mode . [(20220212 646) ((s (1 12 0)) (emacs (24 3)) (dash (2 13 0))) "Major mode for Groovy source files" tar ((:commit . "29210e5a969c02169b68e04f2e28e3bf2fc13363") (:authors ("Russel Winder" . "russel@winder.org.uk") ("Jim Morris" . "morris@wolfman.com") ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Russel Winder" . "russel@winder.org.uk") (:keywords "languages"))])
+ (gruber-darker-theme . [(20220107 1815) nil "Gruber Darker color theme for Emacs 24." single ((:commit . "72278089c440d45c00fb8afcd53af82fd30f451b") (:authors ("Alexey Kutepov" . "reximkut@gmail.com")) (:maintainer "Alexey Kutepov" . "reximkut@gmail.com") (:url . "http://github.com/rexim/gruber-darker-theme"))])
+ (grugru . [(20211119 815) ((emacs (24 4))) "Rotate text at point" tar ((:commit . "ac92a8d54efe000557564a9b01a426f34cc01dfa") (:authors ("ROCKTAKEY" . "rocktakey@gmail.com")) (:maintainer "ROCKTAKEY" . "rocktakey@gmail.com") (:keywords "convenience" "abbrev" "tools") (:url . "https://github.com/ROCKTAKEY/grugru"))])
+ (grunt . [(20160316 1528) ((dash (2 9 0)) (ansi-color (3 4 2)) (emacs (24 3))) "Some glue to stick Emacs and Gruntfiles together" single ((:commit . "4c269e2738658643ec2ed9ef61a2a3d71b08d304") (:authors ("Daniel Gempesaw" . "dgempesaw@sharecare.com")) (:maintainer "Daniel Gempesaw" . "dgempesaw@sharecare.com") (:keywords "convenience" "grunt") (:url . "https://github.com/gempesaw/grunt.el"))])
+ (gruvbox-theme . [(20220101 1208) ((autothemer (0 2))) "A retro-groove colour theme for Emacs" tar ((:commit . "921bfd7a2f5174b68682b04e6010b156bbfe6c70") (:authors ("Jason Milkins" . "jasonm23@gmail.com")) (:maintainer "Jason Milkins" . "jasonm23@gmail.com") (:url . "http://github.com/greduan/emacs-theme-gruvbox"))])
+ (gs-mode . [(20151202 1006) nil "Major mode for editing GrADS script files" single ((:commit . "1a13051db21b999c7682a015b33a03096ff9d891") (:authors ("Joe Wielgosz" . "joew@cola.iges.org")) (:maintainer "Joe Wielgosz" . "joew@cola.iges.org") (:keywords "grads" "script" "major-mode"))])
+ (gscholar-bibtex . [(20190130 555) nil "Retrieve BibTeX from Google Scholar and other online sources(ACM, IEEE, DBLP)" single ((:commit . "3b651e3de116860eb1f1aef9b547a561784871fe") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions"))])
+ (gsettings . [(20210407 2045) ((emacs (24 3)) (dash (2 16 0)) (gvariant (1 0 0)) (s (1 12 0))) "GSettings (Gnome) helpers" single ((:commit . "9f9fb1fe946bbba46307c26355f355225ea7262a") (:authors ("wouter bolsterlee" . "wouter@bolsterl.ee")) (:maintainer "wouter bolsterlee" . "wouter@bolsterl.ee") (:keywords "languages") (:url . "https://github.com/wbolster/emacs-gsettings"))])
+ (gsnip . [(20220206 1526) ((emacs (26)) (aio (1 0)) (log4e (0 3 3))) "A gitlab snippet client" single ((:commit . "4d473b726b3f3b6bb7d1b5f66a9d368588ce0f86") (:authors ("Wang Kai" . "kaiwkx@gmail.com")) (:maintainer "Wang Kai" . "kaiwkx@gmail.com") (:keywords "extensions" "tools") (:url . "https://github.com/kaiwk/gitlab-snippet"))])
+ (gtk-pomodoro-indicator . [(20191007 1500) nil "A pomodoro indicator for the GTK tray" tar ((:commit . "338e6dca6d749cfc85195907bba593f9f6855715") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "convenience" "pomodoro") (:url . "https://github.com/abo-abo/gtk-pomodoro-indicator"))])
+ (gtk-variant . [(20200416 2136) ((emacs (25 1))) "Set the GTK theme variant (titlebar color)" single ((:commit . "e0653e4a654b7800dc15f7e1a06a956b77d2aabe") (:authors ("Paul Oppenheimer")) (:maintainer "Paul Oppenheimer") (:keywords "frames" "gtk" "titlebar") (:url . "https://github.com/bepvte/gtk-variant.el"))])
+ (guess-language . [(20220408 1545) ((cl-lib (0 5)) (emacs (24))) "Robust automatic language detection" tar ((:commit . "b1fc363ca2c30b8a8ddaf2e366bca7770c8cfbec") (:authors ("Titus von der Malsburg" . "malsburg@posteo.de")) (:maintainer "Titus von der Malsburg" . "malsburg@posteo.de") (:keywords "wp") (:url . "https://github.com/tmalsburg/guess-language.el"))])
+ (guide-key . [(20150108 635) ((dash (2 10 0)) (popwin (0 3 0)) (s (1 9 0))) "Guide the following key bindings automatically and dynamically" single ((:commit . "8f8b839f42edd53af13d588254f07727108ae312") (:authors ("Tsunenobu Kai" . "kai2nenobu@gmail.com")) (:maintainer "Tsunenobu Kai" . "kai2nenobu@gmail.com") (:keywords "help" "convenience") (:url . "https://github.com/kai2nenobu/guide-key"))])
+ (guide-key-tip . [(20161011 823) ((guide-key (1 2 3)) (pos-tip (0 4 5))) "Show guide-key.el hints using pos-tip.el" single ((:commit . "02c5d4b0b65f3e91be5a47f0ff1ae5e86e00c64e") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "help" "convenience" "tooltip") (:url . "https://github.com/aki2o/guide-key-tip"))])
+ (guix . [(20210608 1653) ((emacs (24 3)) (dash (2 11 0)) (geiser (0 8)) (bui (1 2 0)) (magit-popup (2 1 0)) (edit-indirect (0 1 4))) "Interface for GNU Guix" tar ((:commit . "c9aef52121b458297e70bb50f49f7276b4a8d759") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "tools") (:url . "https://emacs-guix.gitlab.io/website/"))])
+ (gulp-task-runner . [(20170718 2041) nil "Gulp task runner" single ((:commit . "877990e956b1d71e2d9c7c3e5a129ad199b9debb") (:authors ("Nicolas Petton" . "nicolas@petton.fr")) (:maintainer "Nicolas Petton" . "nicolas@petton.fr") (:keywords "convenience" "javascript"))])
+ (gumshoe . [(20211229 152) ((emacs (25 1))) "Scoped spatial and temporal POINT movement tracking" tar ((:commit . "2366f1c65cdcf09c6b98ca466110842cd88c9db3") (:authors ("overdr0ne")) (:maintainer "overdr0ne") (:keywords "tools") (:url . "https://github.com/Overdr0ne/gumshoe"))])
+ (guru-mode . [(20211025 1157) nil "Become an Emacs guru" single ((:commit . "a3370e547eab260d24774cd50ccbe865373c8631") (:authors ("Bozhidar Batsov" . "bozhidar@batsov.dev")) (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev") (:keywords "convenience") (:url . "https://github.com/bbatsov/guru-mode"))])
+ (gvariant . [(20210507 1310) ((emacs (24)) (parsec (0 1 4))) "GVariant (GLib) helpers" single ((:commit . "f2e87076845800cbaaeed67f175ad4e4a9c01e37") (:authors ("wouter bolsterlee" . "wouter@bolsterl.ee")) (:maintainer "wouter bolsterlee" . "wouter@bolsterl.ee") (:keywords "languages") (:url . "https://github.com/wbolster/emacs-gvariant"))])
+ (gvpr-mode . [(20201007 2054) nil "A major mode offering basic syntax coloring for gvpr scripts." single ((:commit . "ef6ec2d4a4c9de68078c94a0e43b05bf77ec4674") (:authors ("Rod Waldhoff" . "r.waldhoff@gmail.com")) (:maintainer "Rod Waldhoff" . "r.waldhoff@gmail.com") (:keywords "graphviz" "gv" "dot" "gvpr" "graph") (:url . "https://raw.github.com/rodw/gvpr-lib/master/extra/gvpr-mode.el"))])
+ (gxref . [(20170411 1753) ((emacs (25))) "xref backend using GNU Global." single ((:commit . "380b02c3c3c2586c828456716eef6a6392bb043b") (:authors ("Dedi Hirschfeld")) (:maintainer "Dedi Hirschfeld") (:keywords "xref" "global" "tools") (:url . "https://github.com/dedi/gxref"))])
+ (habamax-theme . [(20181001 850) ((emacs (24))) "Boring white background color that gets the job done." single ((:commit . "6e86a1b23b6e2aaf40d4374b5673da00a28be447") (:authors ("Maxim Kim" . "habamax@gmail.com")) (:maintainer "Maxim Kim" . "habamax@gmail.com") (:url . "https://github.com/habamax/habamax-theme"))])
+ (habitica . [(20220215 1758) ((org (8 3 5)) (emacs (24 3))) "Interface for habitica.com" single ((:commit . "9e1fde7f359f7f6a6976b857fbbdbc8dd4fd3327") (:authors ("Adrien Brochard")) (:maintainer "Adrien Brochard") (:keywords "habitica" "todo") (:url . "https://github.com/abrochard/emacs-habitica"))])
+ (hack-mode . [(20211224 19) ((emacs (25 1)) (s (1 11 0))) "Major mode for the Hack programming language" single ((:commit . "a522f61c088ee2a13ab17f289a3131329e59badf") (:authors ("John Allen <jallen@fb.com>, Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "John Allen <jallen@fb.com>, Wilfred Hughes" . "me@wilfred.me.uk") (:url . "https://github.com/hhvm/hack-mode"))])
+ (hacker-typer . [(20170206 1520) ((emacs (24))) "Pretend to write code like a pro" tar ((:commit . "d5a23714a4ccc5071580622f278597d5973f40bd") (:authors ("Diego A. Mundo" . "diegoamundo@gmail.com")) (:maintainer "Diego A. Mundo" . "diegoamundo@gmail.com") (:keywords "hacker" "typer" "multimedia" "games") (:url . "http://github.com/therockmandolinist/emacs-hacker-typer"))])
+ (hackernews . [(20210226 1226) nil "Hacker News Client for Emacs" single ((:commit . "ccfa75c0b3d67201cdf0f2324f311544ade498db") (:authors ("Lincoln de Sousa" . "lincoln@comum.org")) (:maintainer "Basil L. Contovounesios" . "contovob@tcd.ie") (:keywords "comm" "hypermedia" "news") (:url . "https://github.com/clarete/hackernews.el"))])
+ (hal-mode . [(20160704 1746) nil "Major mode for editing HAL files" single ((:commit . "cd2f66f219ee520198d4586fb6b169cef7ad3f21") (:authors ("Alexander Rössler")) (:maintainer "Alexander Rössler") (:keywords "language") (:url . "https://github.com/strahlex/hal-mode/"))])
+ (ham-mode . [(20150811 1306) ((html-to-markdown (1 2)) (markdown-mode (2 0))) "Html As Markdown. Transparently edit an html file using markdown" single ((:commit . "3a141986a21c2aa6eefb428983352abb8b7907d2") (:authors ("Artur Malabarba" . "bruce.connor.am@gmail.com")) (:maintainer "Artur Malabarba" . "bruce.connor.am@gmail.com") (:keywords "convenience" "emulation" "wp") (:url . "http://github.com/Bruce-Connor/ham-mode"))])
+ (hamburg-theme . [(20160123 740) ((emacs (24))) "Color Theme with a dark blue background." single ((:commit . "aacefdf1501d97a5afc0e63c8ead4b2463323028") (:authors ("Martin Haesler")) (:maintainer "Martin Haesler"))])
+ (hamburger-menu . [(20220509 1341) ((emacs (28 1))) "Mode line hamburger menu" single ((:commit . "06bc9d6872007a31226d7410d497a0acd98b272b") (:authors ("Iain Nicol")) (:maintainer "Iain Nicol") (:keywords "hamburger" "menu") (:url . "https://gitlab.com/iain/hamburger-menu-mode"))])
+ (haml-mode . [(20190219 2102) ((emacs (24)) (cl-lib (0 5))) "Major mode for editing Haml files" single ((:commit . "bf5b6c11b1206759d2b28af48765e04882dd1fc4") (:authors ("Natalie Weizenbaum")) (:maintainer "Natalie Weizenbaum") (:keywords "markup" "languages" "html") (:url . "https://github.com/nex3/haml-mode"))])
+ (hamlet-mode . [(20131208 724) ((cl-lib (0 3)) (dash (2 3 0)) (s (1 7 0))) "Hamlet editing mode" single ((:commit . "7362b955e556a3d007fa06945a27e5b99349527d") (:authors (nil . "Kata <lightquake@amateurtopologist.com")) (:maintainer nil . "Kata <lightquake@amateurtopologist.com") (:keywords "wp" "languages" "comm") (:url . "https://github.com/lightquake/hamlet-mode"))])
+ (handle . [(20191029 856) ((emacs (25 1)) (parent-mode (2 3))) "A handle for major-mode generic functions." single ((:commit . "e27b2d0b229923f81a2c8afa3e9c65ae9e84a0da") (:authors ("Uros Perisic")) (:maintainer "Uros Perisic") (:keywords "convenience") (:url . "https://gitlab.com/jjzmajic/handle"))])
+ (handlebars-mode . [(20150211 1749) nil "A major mode for editing Handlebars files." single ((:commit . "81f6b73fea8f397807781a1b51568397af21a6ef") (:authors ("Tony Gentilcore") ("Chris Wanstrath") ("Daniel Hackney") ("Daniel Evans")) (:maintainer "Tony Gentilcore"))])
+ (handlebars-sgml-mode . [(20130623 2333) nil "Add Handlebars contextual indenting support to sgml-mode" single ((:commit . "c76df93a9a8c1b1b3efdcc4add32bf93304192a4") (:authors ("Geoff Jacobsen" . "geoffjacobsen@gmail.com")) (:maintainer "Geoff Jacobsen" . "geoffjacobsen@gmail.com") (:url . "http://github.com/jacott/handlebars-sgml-mode"))])
+ (handoff . [(20150917 600) nil "Get your hand off that mouse, damn it!" single ((:commit . "75dc7a7e352f38679f65d0ca80ad158798e168bd") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:url . "http://github.com/rejeep/handoff.el"))])
+ (hardcore-mode . [(20151114 701) nil "Disable arrow keys + optionally backspace and return" single ((:commit . "b1dda19692b4a7a58a689e81784a9b35be39e70d") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com"))])
+ (hardhat . [(20210515 1422) ((emacs (24 3)) (ignoramus (0 7 0))) "Protect against clobbering user-writable files" single ((:commit . "908cb130be3d56921a3687a00b974ba5eef3a11f") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "convenience") (:url . "http://github.com/rolandwalker/hardhat"))])
+ (harpoon . [(20220402 446) ((emacs (27 2)) (f (0 20 0)) (hydra (0 14 0)) (project (0 8 1))) "Bookmarks on steroids" single ((:commit . "a23571eaab94fb2da0569ed5ab3c1b469f123b97") (:authors ("Otávio Schwanck" . "otavioschwanck@gmail.com")) (:maintainer "Otávio Schwanck" . "otavioschwanck@gmail.com") (:keywords "tools" "languages") (:url . "https://github.com/otavioschwanck/harpoon.el"))])
+ (harvest . [(20170822 1746) ((swiper (0 7 0)) (hydra (0 13 0)) (s (1 11 0))) "Harvest integration" single ((:commit . "7acbc0564b250521b67131ee2a0a92720239454f") (:authors ("Kosta Harlan" . "kosta@kostaharlan.net")) (:maintainer "Kosta Harlan" . "kosta@kostaharlan.net") (:keywords "harvest") (:url . "https://github.com/kostajh/harvest.el"))])
+ (haskell-emacs . [(20160904 2026) nil "Write emacs extensions in haskell" tar ((:commit . "a2c6a079175904689eed7c6c200754bfa85d1ed9") (:authors ("Florian Knupfer")) (:maintainer "Florian Knupfer") (:keywords "haskell" "emacs" "ffi") (:url . "https://github.com/knupfer/haskell-emacs"))])
+ (haskell-emacs-base . [(20150714 1559) ((haskell-emacs (2 4 0))) "Haskell functions from Prelude" tar ((:commit . "a2c6a079175904689eed7c6c200754bfa85d1ed9") (:authors ("Florian Knupfer")) (:maintainer "Florian Knupfer") (:keywords "haskell" "emacs" "ffi") (:url . "https://github.com/knupfer/haskell-emacs/modules/base"))])
+ (haskell-emacs-text . [(20150713 1416) ((haskell-emacs (2 4 0))) "Haskell functions from Data.Text" tar ((:commit . "a2c6a079175904689eed7c6c200754bfa85d1ed9") (:authors ("Florian Knupfer")) (:maintainer "Florian Knupfer") (:keywords "haskell" "emacs" "ffi") (:url . "https://github.com/knupfer/haskell-emacs/modules/text"))])
+ (haskell-mode . [(20220331 1645) ((emacs (25 1))) "A Haskell editing mode" tar ((:commit . "4ec2aa32b1772e629a6a2b47b84048e1990d6728") (:authors ("1992 Simon Marlow") ("1997-1998 Graeme E Moss" . "gem@cs.york.ac.uk") ("Tommy Thorn" . "thorn@irisa.fr") ("2001-2002 Reuben Thomas (>=v1.4)") ("2003 Dave Love" . "fx@gnu.org") ("2016 Arthur Fayzrakhmanov")) (:maintainer "1992 Simon Marlow") (:keywords "faces" "files" "haskell") (:url . "https://github.com/haskell/haskell-mode"))])
+ (haskell-snippets . [(20210228 344) ((cl-lib (0 5)) (yasnippet (0 8 0))) "Yasnippets for Haskell" tar ((:commit . "1c29c4a68ce89848b8d371c6510d1de3b586c8b3") (:authors ("Luke Hoersten" . "luke@hoersten.org")) (:maintainer "Luke Hoersten" . "luke@hoersten.org") (:keywords "snippets" "haskell") (:url . "https://github.com/haskell/haskell-snippets"))])
+ (haskell-tab-indent . [(20200513 1950) nil "tab-based indentation for haskell-mode" single ((:commit . "3239e814d6999f31ad845cc58df53395ad299059") (:authors ("Sean Whitton" . "spwhitton@spwhitton.name")) (:maintainer "Sean Whitton" . "spwhitton@spwhitton.name") (:keywords "indentation" "haskell") (:url . "https://spwhitton.name/tech/code/haskell-tab-indent/"))])
+ (hasklig-mode . [(20211017 1730) ((emacs (25))) "Hasklig ligatures" single ((:commit . "d708937592f9e2d28ae5622086b9c24d60cd8ac2") (:authors ("Daniel Mendler")) (:maintainer "Daniel Mendler") (:url . "https://github.com/minad/hasklig-mode"))])
+ (hass . [(20220402 1326) ((emacs (25 1)) (request (0 3 3))) "Interact with Home Assistant" tar ((:commit . "c6bded14ae4b68194bd9e35428e9973ca144569b") (:authors ("Ben Whitley")) (:maintainer "Ben Whitley") (:url . "https://github.com/purplg/hass"))])
+ (haste . [(20141030 2034) ((json (1 2))) "Emacs client for hastebin (http://hastebin.com/about.md)" single ((:commit . "22d05aacc3296ab50a7361222ab139fb4d447c25") (:authors ("Ric Lister")) (:maintainer "Ric Lister") (:url . "http://github.com/rlister/emacs-haste-client"))])
+ (haxe-imports . [(20170330 2304) ((emacs (24 4)) (s (1 10 0)) (pcache (0 3 1))) "Code for dealing with Haxe imports" single ((:commit . "f104a641f3dfe698359d9aca1f28d9383cf43e04") (:authors ("Juan Karlo Licudine" . "karlo@accidentalrebel.com")) (:maintainer "Juan Karlo Licudine" . "karlo@accidentalrebel.com") (:keywords "haxe") (:url . "http://www.github.com/accidentalrebel/emacs-haxe-imports"))])
+ (haxe-mode . [(20210108 1835) nil "Major mode for editing Haxe files" single ((:commit . "6641a0d7c00ce633887baf3f8c594d9a8a504e9b") (:authors ("Jens Peter Secher (original)")) (:maintainer "Jen-Chieh Shen" . "jcs090218@gmail.com") (:url . "https://github.com/emacsorphanage/haxe-mode"))])
+ (haxor-mode . [(20160618 1129) ((emacs (24 0))) "Major mode for editing Haxor Assembly Files" single ((:commit . "6fa25a8e6b6a59481bc0354c2fe1e0ed53cbdc91") (:authors ("Krzysztof Magosa" . "krzysztof@magosa.pl")) (:maintainer "Krzysztof Magosa" . "krzysztof@magosa.pl") (:keywords "haxor") (:url . "https://github.com/krzysztof-magosa/haxor-mode"))])
+ (hayoo . [(20140831 1221) ((emacs (24)) (json (1 3))) "Query hayoo and show results in a tabulated buffer." single ((:commit . "3ca2fb0c4d5f337d0410c21b2702dd147014e984") (:authors ("Marko Bencun" . "mbencun@gmail.com")) (:maintainer "Marko Bencun" . "mbencun@gmail.com") (:keywords "hayoo" "haskell") (:url . "https://github.com/benma/hayoo.el/"))])
+ (hc-zenburn-theme . [(20150928 1633) nil "An higher contrast version of the Zenburn theme." single ((:commit . "fd0024a5191cdce204d91c8f1db99ba31640f6e9") (:authors ("Nantas Nardelli" . "nantas.nardelli@gmail.com")) (:maintainer "Nantas Nardelli" . "nantas.nardelli@gmail.com") (:url . "https:github.com/edran/hc-zenburn-emacs"))])
+ (hcl-mode . [(20200315 2129) ((emacs (24 3))) "Major mode for Hashicorp" single ((:commit . "e4d9eef631e8a386341ae8f94f7c2579586e65b5") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/emacs-hcl-mode"))])
+ (headlong . [(20150417 1526) nil "reckless completion" single ((:commit . "f6830f87f236eee88263cb6976125f72422abe72") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "completion") (:url . "https://github.com/abo-abo/headlong"))])
+ (heaven-and-hell . [(20190713 1830) ((emacs (24 4))) "easy toggle light/dark themes" single ((:commit . "e1febfd60d060c110a1e43c5f093cd8537251308") (:authors ("Valentin Ignatev" . "valentignatev@gmail.com")) (:maintainer "Valentin Ignatev" . "valentignatev@gmail.com") (:keywords "faces") (:url . "https://github.com/valignatev/heaven-and-hell"))])
+ (helm . [(20220509 1011) ((helm-core (3 8 4)) (popup (0 5 3))) "Helm is an Emacs incremental and narrowing framework" tar ((:commit . "ec76b7d0ffaa77bae47be5b9ee9069601a463d5b") (:authors ("Thierry Volpiatto" . "thierry.volpiatto@gmail.com")) (:maintainer "Thierry Volpiatto" . "thierry.volpiatto@gmail.com") (:url . "https://emacs-helm.github.io/helm/"))])
+ (helm-R . [(20120820 14) ((helm (20120517)) (ess (20120509))) "helm-sources and some utilities for GNU R." single ((:commit . "b0eb9d5f6a483a9dbe6eb6cf1f2024d4f5938bc2") (:authors ("myuhe <yuhei.maeda_at_gmail.com>")) (:maintainer "myuhe") (:keywords "convenience") (:url . "https://github.com/myuhe/helm-R.el"))])
+ (helm-ack . [(20141030 1226) ((helm (1 0)) (cl-lib (0 5))) "Ack command with helm interface" single ((:commit . "889bc225318d14c6e3be80e73b1d9d6fb30e48c3") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-helm-ack"))])
+ (helm-ad . [(20151209 1015) ((dash (2 8 0)) (helm (1 6 2))) "helm source for Active Directory" single ((:commit . "8ac044705d8620ee354a9cfa8cc1b865e83c0d55") (:authors ("Takahiro Noda" . "takahiro.noda+github@gmail.com")) (:maintainer "Takahiro Noda" . "takahiro.noda+github@gmail.com") (:keywords "comm"))])
+ (helm-ag . [(20210702 845) ((emacs (25 1)) (helm (2 0))) "The silver searcher with helm interface" single ((:commit . "9820ba1893c8a7e31e756c891f9b4cf0eff1e50b") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-helm-ag"))])
+ (helm-ag-r . [(20131123 1531) ((helm (1 0))) "Search something by ag and display by helm" single ((:commit . "67de4ebafe9b088db950eefa5ef590a6d78b4ac8") (:authors ("Yuta Yamada <cokesboy\"at\"gmail.com>")) (:maintainer "Yuta Yamada <cokesboy\"at\"gmail.com>") (:keywords "searching") (:url . "https://github.com/yuutayamada/helm-ag-r"))])
+ (helm-apt . [(20210324 1929) ((helm (3 6)) (emacs (25 1))) "Helm interface for Debian/Ubuntu packages (apt-*)" single ((:commit . "c952b5dc26015bc9c947973df99246212d276b63") (:authors ("Thierry Volpiatto" . "thierry.volpiatto@gmail.com")) (:maintainer "Thierry Volpiatto" . "thierry.volpiatto@gmail.com") (:url . "https://github.com/emacs-helm/helm-apt"))])
+ (helm-atoms . [(20201013 1723) ((emacs (25 1)) (helm (2 0))) "Reverse variable lookup using Helm" single ((:commit . "7e6f91a16f556c96ae1b0d1f965ea56861bb6372") (:authors ("Dante Catalfamo")) (:maintainer "Dante Catalfamo") (:keywords "help" "lisp" "maint" "helm" "tools" "matching") (:url . "https://github.com/dantecatalfamo/helm-atoms"))])
+ (helm-aws . [(20180514 1032) ((helm (1 5 3)) (cl-lib (0 5)) (s (1 9 0))) "Manage AWS EC2 server instances directly from Emacs" single ((:commit . "b36c744b3f00f458635a91d1f5158fccbb5baef6") (:authors ("istib")) (:maintainer "istib") (:url . "https://github.com/istib/helm-aws"))])
+ (helm-backup . [(20180911 614) ((helm (1 5 5)) (s (1 8 0)) (cl-lib (0))) "Backup each file change using git" single ((:commit . "691fe542f38fc7c8cca409997f6a0ff5d76ad6c2") (:authors ("Anthony HAMON" . "hamon.anth@gmail.com")) (:maintainer "Anthony HAMON" . "hamon.anth@gmail.com") (:keywords "backup" "convenience" "files" "tools" "vc") (:url . "http://github.com/antham/helm-backup"))])
+ (helm-bbdb . [(20190728 1325) ((emacs (24 3)) (helm (1 5)) (bbdb (3 1 2))) "Helm interface for bbdb" single ((:commit . "db69114ff1af8bf48b5a222242e3a8dd6e101e67") (:url . "https://github.com/emacs-helm/helm-bbdb"))])
+ (helm-bibtex . [(20210725 1510) ((bibtex-completion (1 0 0)) (helm (1 5 5)) (cl-lib (0 5)) (emacs (24 1))) "A bibliography manager based on Helm" single ((:commit . "ce8c17690ddad73d01531084b282f221f8eb6669") (:authors ("Titus von der Malsburg" . "malsburg@posteo.de")) (:maintainer "Titus von der Malsburg" . "malsburg@posteo.de") (:url . "https://github.com/tmalsburg/helm-bibtex"))])
+ (helm-bibtexkey . [(20140214 1504) ((helm (1 5 8))) "Bibtexkey source for helm" tar ((:commit . "aa1637ea5c8c5f1817e480fc2a3750cafab3d99f") (:authors ("TAKAGI Kentaro <kentaro0910_at_gmail.com>")) (:maintainer "TAKAGI Kentaro <kentaro0910_at_gmail.com>") (:keywords "bib" "tex") (:url . "https://github.com/kenbeese/helm-bibtexkey"))])
+ (helm-bind-key . [(20141109 515) ((bind-key (1 0)) (helm (1 6 4))) "helm-source for for bind-key." single ((:commit . "9da6ad8b7530e72fb4ac67be8c6a482898dddc25") (:authors ("Yuhei Maeda <yuhei.maeda_at_gmail.com>")) (:maintainer "myuhe") (:keywords "convenience" "emulation"))])
+ (helm-bitbucket . [(20190422 1102) ((emacs (24)) (helm-core (3 0))) "Search Bitbucket with Helm" single ((:commit . "c722016622ad019202419cca60c3be3c53e56130") (:authors ("Peter Urbak" . "tolowercase@gmail.com")) (:maintainer "Peter Urbak" . "tolowercase@gmail.com") (:keywords "matching") (:url . "https://github.com/dragonwasrobot/helm-bitbucket"))])
+ (helm-bm . [(20160321 1331) ((bm (1 0)) (cl-lib (0 5)) (helm (1 9 3)) (s (1 11 0))) "helm sources for bm.el" single ((:commit . "d66341f5646c23178d4d8bffb6cfebe3fb73f1d7") (:authors ("Yasuyuki Oka" . "yasuyk@gmail.com")) (:maintainer "Yasuyuki Oka" . "yasuyk@gmail.com") (:keywords "helm" "bookmark") (:url . "https://github.com/yasuyk/helm-bm"))])
+ (helm-books . [(20170325 631) ((helm (1 7 7))) "Helm interface for searching books" single ((:commit . "625aadec1541a5ca36951e4ce1301f4b6fe2bf3f") (:authors ("grugrut" . "grugruglut+github@gmail.com")) (:maintainer "grugrut" . "grugruglut+github@gmail.com") (:url . "https://github.com/grugrut/helm-books"))])
+ (helm-bufler . [(20210708 2217) ((emacs (26 3)) (bufler (0 2 -1)) (helm (1 9 4))) "Helm source for Bufler" single ((:commit . "a68e0eb2719c67ab8a3ad56c4036364061d06004") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "convenience") (:url . "https://github.com/alphapapa/bufler.el"))])
+ (helm-bundle-show . [(20190526 1401) ((emacs (24)) (helm (1 8 0))) "Bundle show with helm interface" single ((:commit . "70f1ca7d1847c7d5cd5a3e488562cd4a295b809f") (:authors ("Takashi Masuda" . "masutaka.net@gmail.com")) (:maintainer "Takashi Masuda" . "masutaka.net@gmail.com") (:url . "https://github.com/masutaka/emacs-helm-bundle-show"))])
+ (helm-c-moccur . [(20151230 924) ((helm (20120811)) (color-moccur (2 71))) "helm source for color-moccur.el" single ((:commit . "b0a906f85fa352db091f88b91a9c510de607dfe9") (:authors ("Kenji.I (Kenji Imakado)" . "ken.imakaado@gmail.com")) (:maintainer "Kenji.I (Kenji Imakado)" . "ken.imakaado@gmail.com") (:keywords "convenience" "emulation"))])
+ (helm-c-yasnippet . [(20210330 16) ((emacs (25 1)) (helm (1 7 7)) (yasnippet (0 8 0))) "helm source for yasnippet.el" single ((:commit . "e214eec8b2875d8a7cd09006dfb6a8e15e9e4079") (:authors ("Kenji.I (Kenji Imakado)" . "ken.imakaado@gmail.com")) (:maintainer "Kenji.I (Kenji Imakado)" . "ken.imakaado@gmail.com") (:keywords "convenience" "emulation"))])
+ (helm-catkin . [(20190425 1520) ((emacs (24 3)) (helm (0)) (xterm-color (0))) "Package for compile ROS workspaces with catkin-tools" single ((:commit . "d33c71cecd35616dfa7c3b81d8f51c128405977f") (:authors ("Thore Goll" . "thoregoll@googlemail.com")) (:maintainer "Thore Goll" . "thoregoll@googlemail.com") (:keywords "catkin" "helm" "build" "tools" "ros") (:url . "https://github.com/gollth/helm-catkin"))])
+ (helm-charinfo . [(20170810 1231) ((emacs (24)) (helm (1 7 0)) (cl-lib (0 5))) "A helm source for character information" single ((:commit . "91798a49dc115342a7e01e48b264e9a0bf5ea414") (:authors ("Christian Wittern" . "cwittern@gmail.com")) (:maintainer "Christian Wittern" . "cwittern@gmail.com") (:keywords "convenience") (:url . "https://github.com/cwittern/helm-charinfo"))])
+ (helm-chrome . [(20160719 520) ((helm (1 5)) (cl-lib (0 3)) (emacs (24))) "Helm interface for Chrome bookmarks" single ((:commit . "fd630ace4b4b4f33355a973743bbfe0c90ce4830") (:authors ("KAWABATA, Taichi <kawabata.taichi_at_gmail.com>")) (:maintainer "KAWABATA, Taichi <kawabata.taichi_at_gmail.com>") (:keywords "tools") (:url . "https://github.com/kawabata/helm-chrome"))])
+ (helm-chrome-control . [(20190707 1807) ((emacs (25 1)) (helm-core (3 0))) "Control Chrome tabs with Helm (macOS only)" tar ((:commit . "e6758763099959e961e218bb1122526323f7ee5e") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:url . "https://github.com/xuchunyang/helm-chrome-control"))])
+ (helm-chrome-history . [(20191031 1233) ((emacs (25 1)) (helm-core (3 0))) "Browse Chrome History with Helm" single ((:commit . "f9002d4c12df65a99830376b126dbbeae3ef2148") (:authors ("Xu Chunyang" . "mail@xuchunyang.me")) (:maintainer "Xu Chunyang" . "mail@xuchunyang.me") (:keywords "tools") (:url . "https://github.com/xuchunyang/helm-chrome-history"))])
+ (helm-chronos . [(20150528 2036) ((chronos (1 2)) (helm (1 7 1))) "helm interface for chronos timers" tar ((:commit . "a14fc3d65dd96ce6616234b3f7b8b08b4c1817ef") (:authors ("David Knight" . "dxknight@opmbx.org")) (:maintainer "David Knight" . "dxknight@opmbx.org") (:keywords "calendar") (:url . "http://github.com/dxknight/helm-chronos"))])
+ (helm-cider . [(20220102 1626) ((emacs (26)) (cider (1 0)) (helm-core (2 8))) "Helm interface to CIDER" tar ((:commit . "00809e45de919c82753f332f29358f0ddbf21936") (:authors ("Tianxiang Xiong" . "tianxiang.xiong@gmail.com")) (:maintainer "Tianxiang Xiong" . "tianxiang.xiong@gmail.com") (:keywords "cider" "clojure" "helm" "languages") (:url . "https://github.com/clojure-emacs/helm-cider"))])
+ (helm-cider-history . [(20150719 2120) ((helm (1 4 0)) (cider (0 9 0))) "Helm interface for cider history" single ((:commit . "c391fcb2e162a02001605a0b9449783575a831fd") (:authors ("Andreas Klein" . "git@kungi.org")) (:maintainer "Andreas Klein" . "git@kungi.org") (:keywords "convenience") (:url . "https://github.com/Kungi/helm-cider-history"))])
+ (helm-circe . [(20160207 652) ((emacs (24)) (helm (0 0)) (circe (0 0)) (cl-lib (0 5))) "helm circe buffer management." single ((:commit . "9091651d9fdd8d49d8ff6f9dcf3a2ae416c9f15a") (:authors ("Les Harris" . "les@lesharris.com")) (:maintainer "Les Harris" . "les@lesharris.com") (:keywords "helm" "circe") (:url . "https://github.com/lesharris/helm-circe"))])
+ (helm-clojuredocs . [(20160405 723) ((edn (1 1 2)) (helm (1 5 7))) "search for help in clojuredocs.org" single ((:commit . "5a7f0f2cb401be0b09e73262a1c18265ab9a3cea") (:authors ("Michal Buczko" . "michal.buczko@gmail.com")) (:maintainer "Michal Buczko" . "michal.buczko@gmail.com") (:keywords "helm" "clojure") (:url . "https://github.com/mbuczko/helm-clojuredocs"))])
+ (helm-cmd-t . [(20170125 1459) nil "cmd-t style completion" tar ((:commit . "7fa3d4a9f7271512e54c5de999079b27c9eec6bf") (:authors ("Le Wang")) (:maintainer "Le Wang") (:keywords "helm" "project-management" "completion" "convenience" "cmd-t" "textmate") (:url . "https://github.com/lewang/helm-cmd-t"))])
+ (helm-codesearch . [(20190412 1153) ((emacs (25 1)) (s (1 11 0)) (dash (2 12 0)) (helm (1 7 7)) (cl-lib (0 5))) "helm interface for codesearch" single ((:commit . "72f1d1de746115ab7e861178b49fa3c0b6b58d90") (:authors ("Youngjoo Lee" . "youngker@gmail.com")) (:maintainer "Youngjoo Lee" . "youngker@gmail.com") (:keywords "tools"))])
+ (helm-commandlinefu . [(20150611 545) ((emacs (24 1)) (helm (1 7 0)) (json (1 3)) (let-alist (1 0 3))) "Search and browse commandlinefu.com from helm" single ((:commit . "9ee7e018c5db23ae9c8d1c8fa969876f15b7280d") (:authors ("Chunyang Xu" . "xuchunyang56@gmail.com")) (:maintainer "Chunyang Xu" . "xuchunyang56@gmail.com") (:keywords "commandlinefu.com") (:url . "https://github.com/xuchunyang/helm-commandlinefu"))])
+ (helm-company . [(20190812 1429) ((helm (1 5 9)) (company (0 6 13))) "Helm interface for company-mode" single ((:commit . "6eb5c2d730a60e394e005b47c1db018697094dde") (:authors ("Yasuyuki Oka" . "yasuyk@gmail.com")) (:maintainer "Daniel Ralston" . "Sodel-the-Vociferous@users.noreply.github.com") (:url . "https://github.com/Sodel-the-Vociferous/helm-company"))])
+ (helm-core . [(20220503 622) ((emacs (25 1)) (async (1 9 4))) "Development files for Helm" tar ((:commit . "ec76b7d0ffaa77bae47be5b9ee9069601a463d5b") (:authors ("Thierry Volpiatto" . "thierry.volpiatto@gmail.com")) (:maintainer "Thierry Volpiatto" . "thierry.volpiatto@gmail.com") (:url . "https://emacs-helm.github.io/helm/"))])
+ (helm-cscope . [(20190615 41) ((xcscope (1 0)) (helm (1 6 7)) (cl-lib (0 5)) (emacs (24 1))) "Helm interface for xcscope.el." single ((:commit . "af1d9e7f4460a88d7400b5a74d5da68084089ac1") (:authors ("alpha22jp" . "alpha22jp@gmail.com")) (:maintainer "alpha22jp" . "alpha22jp@gmail.com") (:keywords "cscope" "helm") (:url . "https://github.com/alpha22jp/helm-cscope.el"))])
+ (helm-css-scss . [(20191230 1549) ((emacs (24 3)) (helm (1 0))) "CSS/SCSS/LESS Selectors with helm interface" single ((:commit . "48b996f73af1fef8d6e88a1c545d98f8c50b0cf3") (:authors ("Shingo Fukuyama - http://fukuyama.co")) (:maintainer "Shingo Fukuyama - http://fukuyama.co") (:keywords "convenience" "scss" "css" "less" "selector" "helm") (:url . "https://github.com/ShingoFukuyama/helm-css-scss"))])
+ (helm-ctest . [(20191031 1435) ((s (1 9 0)) (dash (2 11 0)) (helm-core (1 7 4))) "Run ctest from within emacs" single ((:commit . "2a29cfb4ec583da247fa2ae7bac88790b1223e40") (:authors ("Dan LaManna" . "me@danlamanna.com")) (:maintainer "Dan LaManna" . "me@danlamanna.com") (:keywords "helm" "ctest"))])
+ (helm-dash . [(20190527 1118) ((emacs (24 4)) (dash-docs (1 4 0)) (helm (1 9 2)) (cl-lib (0 5))) "Offline documentation browser for +150 APIs using Dash docsets." single ((:commit . "7f853bd34da666f0e9a883011c80f451b06f6c59") (:authors ("Raimon Grau" . "raimonster@gmail.com") ("Toni Reina " . "areina0@gmail.com") ("Bryan Gilbert" . "bryan@bryan.sh")) (:maintainer "Raimon Grau" . "raimonster@gmail.com") (:keywords "docs") (:url . "https://github.com/dash-docs-el/helm-dash"))])
+ (helm-descbinds . [(20190501 935) ((helm (1 5))) "A convenient `describe-bindings' with `helm'" single ((:commit . "b72515982396b6e336ad7beb6767e95a80fca192") (:authors ("Taiki SUGAWARA" . "buzz.taiki@gmail.com")) (:maintainer "Taiki SUGAWARA" . "buzz.taiki@gmail.com") (:keywords "helm" "help") (:url . "https://github.com/emacs-helm/helm-descbinds"))])
+ (helm-describe-modes . [(20160212 518) ((helm (1 9)) (cl-lib (0 5)) (emacs (24 1))) "Helm interface to major and minor modes." single ((:commit . "11fb36af119b784539d31c6160002de1957408aa") (:authors ("Tianxiang Xiong" . "tianxiang.xiong@gmail.com")) (:maintainer "Tianxiang Xiong" . "tianxiang.xiong@gmail.com") (:keywords "docs" "convenience") (:url . "https://github.com/emacs-helm/helm-describe-modes"))])
+ (helm-dictionary . [(20220319 955) ((helm (1 5 5))) "Helm source for looking up dictionaries" single ((:commit . "69f1e5bf03d67c9e5cb0065e702e8c311ac9d3db") (:authors ("Titus von der Malsburg" . "malsburg@posteo.de") ("Michael Heerdegen" . "michael_heerdegen@web.de")) (:maintainer "Titus von der Malsburg" . "malsburg@posteo.de") (:url . "https://github.com/emacs-helm/helm-dictionary"))])
+ (helm-directory . [(20170706 402) ((emacs (24 4)) (helm (2 0))) "selecting directory before select the file" single ((:commit . "51bd7cd6e40a84a7efda894283ec76a0107830ad") (:authors ("Masashı Mıyaura")) (:maintainer "Masashı Mıyaura") (:url . "https://github.com/masasam/emacs-helm-directory"))])
+ (helm-dired-history . [(20170524 1046) ((helm (1 9 8)) (cl-lib (0 5))) "Show dired history with helm.el support." single ((:commit . "06654656d3ad502742056d9030dd59e0da984764") (:authors ("Joseph(纪秀峰)" . "jixiuf@gmail.com")) (:maintainer "Joseph(纪秀峰)" . "jixiuf@gmail.com") (:keywords "helm" "dired history") (:url . "https://github.com/jixiuf/helm-dired-history"))])
+ (helm-dired-recent-dirs . [(20131228 1414) ((helm (1 0))) "Show recent dirs with helm.el support." single ((:commit . "3bcd125b44f5a707588ae3868777d91192351523") (:authors ("Akisute" . "akisute3@gmail.com")) (:maintainer "Akisute" . "akisute3@gmail.com") (:keywords "helm" "dired" "zsh"))])
+ (helm-dirset . [(20151209 12) ((f (0 16 2)) (helm (1 6 1)) (s (1 9 0)) (cl-lib (0 5))) "helm sources for multi directories" single ((:commit . "eb30810cd26e1ee73d84a863e6b2667700e9aead") (:authors ("k1LoW (Kenichirou Oyama), <k1lowxb [at] gmail [dot] com> <k1low [at] 101000lab [dot] org>")) (:maintainer "k1LoW (Kenichirou Oyama), <k1lowxb [at] gmail [dot] com> <k1low [at] 101000lab [dot] org>") (:keywords "files" "directories") (:url . "http://101000lab.org"))])
+ (helm-dogears . [(20210822 2106) ((emacs (26 3)) (dogears (0 1 -1)) (helm (3 6))) "Helm source for Dogears" single ((:commit . "c05b69e504a538c9e00fbb0ea86934fafe191d0c") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "convenience") (:url . "https://github.com/alphapapa/dogears.el"))])
+ (helm-emmet . [(20160713 1231) ((helm (1 0)) (emmet-mode (1 0 2))) "helm sources for emmet-mode's snippets" single ((:commit . "f0364e736b10cf44232053a78de04133a88185ae") (:authors ("Yasuyuki Oka" . "yasuyk@gmail.com")) (:maintainer "Yasuyuki Oka" . "yasuyk@gmail.com") (:keywords "convenience" "helm" "emmet") (:url . "https://github.com/yasuyk/helm-emmet"))])
+ (helm-emms . [(20220314 1633) ((helm (1 5)) (emms (6 0)) (cl-lib (0 5)) (emacs (24 1))) "Emms for Helm." single ((:commit . "aefa44ab77808626c4951be2df49a2eab7820805") (:authors ("Thierry Volpiatto" . "thierry.volpiatto@gmail.com")) (:maintainer "Thierry Volpiatto" . "thierry.volpiatto@gmail.com") (:keywords "multimedia" "emms") (:url . "https://github.com/emacs-helm/helm-emms"))])
+ (helm-esa . [(20190721 1429) ((emacs (26 2)) (helm (3 2)) (request (0 3 0))) "Esa with helm interface" single ((:commit . "d93b4af404346870cb2cf9c257d055332ef3f577") (:authors ("Takashi Masuda" . "masutaka.net@gmail.com")) (:maintainer "Takashi Masuda" . "masutaka.net@gmail.com") (:url . "https://github.com/masutaka/emacs-helm-esa"))])
+ (helm-etags-plus . [(20201003 1424) ((helm (1 7 8))) "Another Etags helm.el interface" single ((:commit . "52598fe69636add4b62cd9873041de5c6db9b7ac") (:authors ("纪秀峰(Joseph)" . "jixiuf@gmail.com")) (:maintainer "纪秀峰(Joseph)" . "jixiuf@gmail.com") (:keywords "helm" "etags") (:url . "https://github.com/jixiuf/helm-etags-plus"))])
+ (helm-evil-markers . [(20200506 715) ((emacs (25 1)) (helm (2 0 0)) (evil (1 2 10))) "Show evil markers with helm" single ((:commit . "0245f0c268e0eaec85df51ab2deba7ac961f6770") (:authors ("Bill Xue")) (:maintainer "Bill Xue") (:keywords "extensions") (:url . "https://github.com/xueeinstein/helm-evil-markers"))])
+ (helm-eww . [(20190315 907) ((emacs (24 4)) (helm (2 8 6)) (seq (1 8))) "Helm UI wrapper for EWW." single ((:commit . "76ba59fda8dd6f32a1bc7c6df0b43c6f76169911") (:authors ("Pierre Neidhardt" . "mail@ambrevar.xyz")) (:maintainer "Pierre Neidhardt" . "mail@ambrevar.xyz") (:keywords "helm" "packages") (:url . "https://github.com/emacs-helm/helm-eww"))])
+ (helm-ext . [(20200722 107) ((emacs (24 4)) (helm (2 5 3))) "A few extensions to Helm" tar ((:commit . "c30f7772ec577a5ce1de3215f0507826e0725a69") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions"))])
+ (helm-exwm . [(20210215 858) ((emacs (25 2)) (helm (2 8 5)) (exwm (0 15))) "Helm for EXWM buffers" single ((:commit . "5b35a42ff10fbcbf673268987df700ea6b6288e8") (:authors ("Pierre Neidhardt" . "mail@ambrevar.xyz")) (:maintainer "Pierre Neidhardt" . "mail@ambrevar.xyz") (:keywords "helm" "exwm") (:url . "https://github.com/emacs-helm/helm-exwm"))])
+ (helm-file-preview . [(20200927 528) ((emacs (25 1)) (helm (2 0))) "Preview the current helm file selection" single ((:commit . "f9ffd81c3b7fa3e5f79f511a6c2226b5e99b73e6") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/helm-file-preview"))])
+ (helm-filesets . [(20140929 1835) ((helm (1 6 3)) (filesets+ (0))) "A helm source for emacs filesets" single ((:commit . "b352910af4c3099267a8aa0169c7f743b35bb1fa") (:authors ("Graham Clark" . "grclark@gmail.com")) (:maintainer "Graham Clark" . "grclark@gmail.com") (:keywords "filesets") (:url . "https://github.com/gcla/helm-filesets"))])
+ (helm-firefox . [(20220420 1346) ((helm (1 5)) (cl-lib (0 5)) (emacs (24 1))) "Firefox bookmarks" single ((:commit . "571cf8dfcbe43d91f9890eebefc88d7572c62e75") (:url . "https://github.com/emacs-helm/helm-firefox"))])
+ (helm-fish-completion . [(20200908 1504) ((emacs (25)) (helm (3)) (fish-completion (1 2))) "Helm interface for fish completion" single ((:commit . "2a2001b3a876da3c468ffec8935572509c485aac") (:authors ("Pierre Neidhardt" . "mail@ambrevar.xyz")) (:maintainer "Pierre Neidhardt" . "mail@ambrevar.xyz") (:url . "https://github.com/emacs-helm/helm-fish-completion"))])
+ (helm-flx . [(20220402 21) ((emacs (24 4)) (helm (1 7 9)) (flx (0 5))) "Sort helm candidates by flx score" single ((:commit . "27dd9e3ce385a3ca15092150e65781de14b5b00b") (:authors ("Jonathan Hayase" . "jonathan.hayase@gmail.com")) (:maintainer "Jonathan Hayase" . "jonathan.hayase@gmail.com") (:keywords "convenience" "helm" "fuzzy" "flx") (:url . "https://github.com/PythonNut/helm-flx"))])
+ (helm-flycheck . [(20160710 829) ((dash (2 12 1)) (flycheck (28)) (helm-core (1 9 8))) "Show flycheck errors with helm" single ((:commit . "3cf7d3bb194acacc6395f88360588013d92675d6") (:authors ("Yasuyuki Oka" . "yasuyk@gmail.com")) (:maintainer "Yasuyuki Oka" . "yasuyk@gmail.com") (:keywords "helm" "flycheck") (:url . "https://github.com/yasuyk/helm-flycheck"))])
+ (helm-flymake . [(20160610 2) ((helm (1 0))) "helm interface for flymake" single ((:commit . "72cf18a1a1f843db9bb5d58301739ea9ccb1655b") (:authors ("Akira Tamamori" . "tamamori5917@gmail.com")) (:maintainer "Akira Tamamori" . "tamamori5917@gmail.com") (:url . "https://github.com/tam17aki"))])
+ (helm-flyspell . [(20170210 1901) ((helm (1 6 5))) "Helm extension for correcting words with flyspell" single ((:commit . "8d4d947c687cb650cb149aa2271ad5201ea92594") (:authors ("Andrzej Pronobis")) (:maintainer "Andrzej Pronobis") (:keywords "convenience") (:url . "https://github.com/pronobis/helm-flyspell"))])
+ (helm-frame . [(20180604 1005) ((emacs (24 4))) "open helm buffers in a dedicated frame" single ((:commit . "485e2a534b0de5e8dbeb144a9a60ceca00215a4a") (:authors ("chee" . "chee@snake.dog")) (:maintainer "chee" . "chee@snake.dog") (:keywords "lisp" "helm" "popup" "frame"))])
+ (helm-fuz . [(20200812 1222) ((emacs (25 1)) (fuz (1 4 0)) (helm (3 6))) "Integrate Helm and Fuz" single ((:commit . "fee874aa35d2ee6b12b836290b5c8eaa44175a28") (:authors ("Zhu Zihao" . "all_but_last@163.com")) (:maintainer "Zhu Zihao" . "all_but_last@163.com") (:keywords "convenience") (:url . "https://github.com/cireu/fuz.el"))])
+ (helm-fuzzier . [(20160605 2145) ((emacs (24 3)) (helm (1 7 0))) "Better fuzzy matching for Helm" single ((:commit . "8798dcf3583b863df5b9dea7fe3b0179ba1c35bc") (:authors ("Ephram Perdition")) (:maintainer "Ephram Perdition") (:keywords "convenience" "helm" "fuzzy") (:url . "http://github.com/EphramPerdition/helm-fuzzier"))])
+ (helm-fuzzy . [(20200927 532) ((emacs (24 4)) (helm (1 7 9)) (flx (0 5))) "Fuzzy matching for helm source" single ((:commit . "dd092e8eea5257d49bbdf694df4fefd86252e54b") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/helm-fuzzy"))])
+ (helm-fuzzy-find . [(20171106 400) ((emacs (24 1)) (helm (1 7 0))) "Find file using Fuzzy Search" single ((:commit . "de2abbf7ca13609587325bacd4a1ed4376b5c927") (:authors ("Chunyang Xu" . "xuchunyang56@gmail.com")) (:maintainer "Chunyang Xu" . "xuchunyang56@gmail.com") (:keywords "helm" "fuzzy" "find" "file") (:url . "https://github.com/xuchunyang/helm-fuzzy-find"))])
+ (helm-ghq . [(20210724 744) ((emacs (24)) (helm (3 8 0))) "Ghq with helm interface" single ((:commit . "7b47ac91e42762f2ecbbceeaadc05b86c9fe5f14") (:authors ("Takashi Masuda" . "masutaka.net@gmail.com")) (:maintainer "Takashi Masuda" . "masutaka.net@gmail.com") (:url . "https://github.com/masutaka/emacs-helm-ghq"))])
+ (helm-ghs . [(20170715 541) ((emacs (24)) (helm (2 2 0))) "ghs with helm interface" single ((:commit . "17a70bf16255d90d67c8350e88200ec8bfd47563") (:authors ("iory" . "ab.ioryz@gmail.com")) (:maintainer "iory" . "ab.ioryz@gmail.com") (:url . "https://github.com/iory/emacs-helm-ghs"))])
+ (helm-git . [(20120630 2103) nil "Helm extension for Git." single ((:commit . "cb96a52b5aecadd3c27aba7749d14e43ab128d55") (:authors ("Marian Schubert" . "marian.schubert@gmail.com")) (:maintainer "Marian Schubert" . "marian.schubert@gmail.com") (:keywords "helm" "git") (:url . "https://github.com/maio/helm-git"))])
+ (helm-git-files . [(20141212 1317) ((helm (1 5 9))) "helm for git files" single ((:commit . "43193960774069369ac6964bbf7c026900206fa8") (:authors ("INA Lintaro <tarao.gnn at gmail.com>") ("TAKAGI Kentaro <kentaro0910_at_gmail.com>")) (:maintainer "INA Lintaro <tarao.gnn at gmail.com>") (:keywords "helm" "git"))])
+ (helm-git-grep . [(20170614 1411) ((helm-core (2 2 0))) "helm for git grep, an incremental git-grep(1)" single ((:commit . "744cea07dba6e6a5effbdba83f1b786c78fd86d3") (:authors ("mechairoi")) (:maintainer "Yasuyuki Oka" . "yasuyk@gmail.com") (:url . "https://github.com/yasuyk/helm-git-grep"))])
+ (helm-github-stars . [(20190428 1047) ((helm (1 6 8)) (emacs (24 4))) "Helm interface for your github's stars" single ((:commit . "c891690218b0d8b957ea6cb45b1b6cffd15a6950") (:authors ("Sliim" . "sliim@mailoo.org") ("xuchunyang" . "xuchunyang56@gmail.com")) (:maintainer "Sliim" . "sliim@mailoo.org") (:keywords "helm" "github" "stars") (:url . "https://github.com/Sliim/helm-github-stars"))])
+ (helm-gitignore . [(20170211 8) ((gitignore-mode (1 1 0)) (helm (1 7 0)) (request (0 1 0)) (cl-lib (0 5))) "Generate .gitignore files with gitignore.io." single ((:commit . "2a2e7da7855a6db0ab3bb6a6a087863d7abd4391") (:authors ("Juan Placencia")) (:maintainer "Juan Placencia") (:keywords "helm" "gitignore" "gitignore.io") (:url . "https://github.com/jupl/helm-gitignore"))])
+ (helm-gitlab . [(20180312 1647) ((s (1 9 0)) (dash (2 9 0)) (helm (1 0)) (gitlab (0 8 0))) "Helm interface to Gitlab" single ((:commit . "8c2324c02119500f094c2f92dfaba4c9977ce1ba") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "gitlab" "helm") (:url . "https://github.com/nlamirault/emacs-gitlab"))])
+ (helm-go-package . [(20161103 153) ((emacs (24 4)) (helm-core (2 2 1)) (go-mode (1 4 0)) (deferred (0 4 0))) "helm sources for Go programming language's package" single ((:commit . "e42c563936c205ceedb930a687c11b4bb56447bc") (:authors ("Yasuyuki Oka" . "yasuyk@gmail.com")) (:maintainer "Yasuyuki Oka" . "yasuyk@gmail.com") (:url . "https://github.com/yasuyk/helm-go-package"))])
+ (helm-google . [(20210527 900) ((helm (0))) "Emacs Helm Interface for quick Google searches" single ((:commit . "27834161391c350ef790062391cb7eab1d59fb62") (:authors ("steckerhalter")) (:maintainer "steckerhalter") (:keywords "helm" "google" "search" "browse" "searx") (:url . "https://framagit.org/steckerhalter/helm-google"))])
+ (helm-grepint . [(20200811 1616) ((helm (2 9 7)) (emacs (24 4))) "Generic helm interface to grep" single ((:commit . "9aec98428823b749eb14d2c8512b46b59ca9f8ca") (:authors ("Kalle Kankare" . "kalle.kankare@iki.fi")) (:maintainer "Kalle Kankare" . "kalle.kankare@iki.fi") (:keywords "grep" "grepping" "searching" "helm" "tools" "convenience") (:url . "https://github.com/kopoli/helm-grepint"))])
+ (helm-growthforecast . [(20140120 344) ((helm (1 5 9))) "helm extensions for growthforecast." single ((:commit . "0f94ac090d6c354058ad89a86e5c18385c136d9b") (:authors ("Daichi Hirata" . "daichi.hirat@gmail.com")) (:maintainer "Daichi Hirata" . "daichi.hirat@gmail.com") (:url . "https://github.com/daic-h/helm-growthforecast"))])
+ (helm-gtags . [(20200602 1610) ((emacs (24 4)) (helm (2 0))) "GNU GLOBAL helm interface" single ((:commit . "6285c083d885ea8e110868c6a5b9df69c3f3c4af") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-helm-gtags"))])
+ (helm-hatena-bookmark . [(20210724 732) ((emacs (24)) (helm (2 8 2))) "Hatena::Bookmark with helm interface" single ((:commit . "a6a2b37370ac84ca2cae5ef65b2b144a010b1584") (:authors ("Takashi Masuda" . "masutaka.net@gmail.com")) (:maintainer "Takashi Masuda" . "masutaka.net@gmail.com") (:url . "https://github.com/masutaka/emacs-helm-hatena-bookmark"))])
+ (helm-hayoo . [(20151014 651) ((helm (1 6 0)) (json (1 2)) (haskell-mode (13 7))) "Source and configured helm for searching hayoo" single ((:commit . "dd4c0c8c87521026edf1b808c4de01fa19b7c693") (:authors ("Markus Hauck" . "markus1189@gmail.com")) (:maintainer "Markus Hauck" . "markus1189@gmail.com") (:keywords "helm"))])
+ (helm-helm-commands . [(20130902 1748) ((helm (1 5 4))) "List all helm commands with helm" single ((:commit . "3a05aa19c976501343ad9ae630a36810921a85f6") (:authors ("Joe Bloggs" . "vapniks@yahoo.com")) (:maintainer "Joe Bloggs" . "vapniks@yahoo.com") (:keywords "convenience") (:url . "https://github.com/vapniks/helm-helm-commands"))])
+ (helm-hoogle . [(20161027 534) ((helm (1 6 2)) (emacs (24 4))) "Use helm to navigate query results from Hoogle" single ((:commit . "73969a9d46d2121a849a01a9f7ed3636d01f7bbc") (:authors ("John Wiegley" . "jwiegley@gmail.com")) (:maintainer "John Wiegley" . "jwiegley@gmail.com") (:keywords "haskell" "programming" "hoogle") (:url . "https://github.com/jwiegley/haskell-config"))])
+ (helm-hunks . [(20171217 1933) ((emacs (24 4)) (helm (1 9 8))) "A helm interface for git hunks - browsing, staging, unstaging and killing" single ((:commit . "6392bf716f618eac23ce81140aceb0dfacb9c6d0") (:authors ("@torgeir")) (:maintainer "@torgeir") (:keywords "helm" "git" "hunks" "vc"))])
+ (helm-icons . [(20210330 1216) ((emacs (25 1)) (dash (2 14 1)) (f (0 20 0)) (treemacs (2 7))) "Helm icons" single ((:commit . "8d2f5e705c8b78a390677cf242024739c932fc95") (:authors ("Ivan Yonchovski" . "yyoncho@gmail.com")) (:maintainer "Ivan Yonchovski" . "yyoncho@gmail.com") (:keywords "convenience") (:url . "https://github.com/yyoncho/helm-icons"))])
+ (helm-idris . [(20141202 1757) ((helm (0 0 0)) (idris-mode (0 9 14))) "A Helm datasource for Idris documentation, queried from the compiler" single ((:commit . "a2f45d6817974f318b55ad9b7fd19d5df132d47e") (:authors ("David Raymond Christiansen" . "david@davidchristiansen.dk")) (:maintainer "David Raymond Christiansen" . "david@davidchristiansen.dk") (:keywords "languages" "helm"))])
+ (helm-img . [(20151224 2321) ((helm (1 7 7)) (cl-lib (0 5))) "Utilities for making image sources for helm." tar ((:commit . "aa3f8a5dce8d0413bf07584f07153a39015c2bfc") (:authors ("Sho Matsumoto <l3msh0_at_gmail.com>")) (:maintainer "l3msh0") (:keywords "convenience") (:url . "https://github.com/l3msh0/helm-img"))])
+ (helm-img-tiqav . [(20151224 2322) ((helm-img (0 0 1))) "An helm-source for joking." single ((:commit . "33a7e9508bc8f37d53320b56c92b53d321a57bb0") (:authors ("Sho Matsumoto <l3msh0_at_gmail.com>")) (:maintainer "l3msh0") (:keywords "convenience") (:url . "https://github.com/l3msh0/helm-img"))])
+ (helm-ispell . [(20151231 853) ((helm-core (1 7 7))) "ispell-complete-word with helm interface" single ((:commit . "cb735695ab3a0e66c123c2f3f3e8911fb1c2d5fc") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-helm-ispell"))])
+ (helm-itunes . [(20151013 648) ((helm (1 6 1))) "Play local iTunes and Spotify tracks" single ((:commit . "966de755a5aadbe02311a6cef77bd4790e84c263") (:authors ("Adam Schwartz" . "adam@adamschwartz.io")) (:maintainer "Adam Schwartz" . "adam@adamschwartz.io") (:url . "https://github.com/daschwa/helm-itunes"))])
+ (helm-j-cheatsheet . [(20170217 829) ((helm (1 5 3))) "Quick J reference for Emacs" single ((:commit . "6c47e7162b9ba2de4b41221d01180146973d860b") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:url . "https://github.com/abo-abo/helm-j-cheatsheet"))])
+ (helm-jira . [(20180802 815) ((emacs (25)) (cl-lib (0 5)) (helm (1 9 9))) "Helm bindings for JIRA/Bitbucket/stash" single ((:commit . "75d6ed5bd7a041fa8c1adb21cbbbe57b5a7c7cc7") (:authors ("Roman Decker <roman dot decker at gmail dot com>")) (:maintainer "Roman Decker <roman dot decker at gmail dot com>") (:keywords "tools" "helm" "jira" "bitbucket" "stash") (:url . "https://github.com/DeX3/helm-jira"))])
+ (helm-js-codemod . [(20190921 942) ((emacs (24 4)) (helm-core (1 9 8)) (js-codemod (1 0 0))) "A helm interface for running js-codemods" single ((:commit . "29b1b3c441f0d7e450a3c65b5ff9e72023dc6314") (:authors (nil . "Torgeir Thoresen <@torgeir>")) (:maintainer nil . "Torgeir Thoresen <@torgeir>") (:keywords "helm" "js" "codemod" "region"))])
+ (helm-jstack . [(20150603 422) ((emacs (24)) (helm (1 7 0)) (cl-lib (0 5))) "Helm interface to Jps & Jstack for Java/JVM processes" single ((:commit . "2064f7215dcf4ccbd6a7b8784223251507746da4") (:authors ("Raghav Kumar Gautam" . "rgautam@apache.com")) (:maintainer "Raghav Kumar Gautam" . "rgautam@apache.com") (:keywords "java" "jps" "jstack" "jvm" "emacs" "elisp" "helm"))])
+ (helm-kythe . [(20170709 726) ((emacs (25)) (dash (2 12 0)) (helm (2 0))) "Google Kythe helm interface" single ((:commit . "eabbef4948f8ec7c7b2fac498e9145dfdb10ca82") (:authors ("Fangrui Song" . "i@maskray.me")) (:maintainer "Fangrui Song" . "i@maskray.me") (:url . "https://github.com/MaskRay/emacs-helm-kythe"))])
+ (helm-lastpass . [(20180722 806) ((emacs (25 1)) (helm (2 0)) (csv (2 1))) "Helm interface of LastPass" single ((:commit . "82e1ffb6ae77d9d9e29c398eb013cd20ce963f77") (:authors ("Xu Chunyang" . "mail@xuchunyang.me")) (:maintainer "Xu Chunyang" . "mail@xuchunyang.me") (:url . "https://github.com/xuchunyang/helm-lastpass"))])
+ (helm-lean . [(20210305 1705) ((emacs (24 3)) (dash (2 18 0)) (helm (2 8 0)) (lean-mode (3 3 0))) "Helm interfaces for lean-mode" single ((:commit . "362bc6fa3efb1874c525ed6b4b6f24f76af22596") (:authors ("Leonardo de Moura" . "leonardo@microsoft.com") ("Soonho Kong " . "soonhok@cs.cmu.edu") ("Gabriel Ebner " . "gebner@gebner.org") ("Sebastian Ullrich" . "sebasti@nullri.ch")) (:maintainer "Sebastian Ullrich" . "sebasti@nullri.ch") (:keywords "languages") (:url . "https://github.com/leanprover/lean-mode"))])
+ (helm-lib-babel . [(20180510 1324) ((cl-lib (0 5)) (helm (1 9 2)) (emacs (24 4))) "helm insertion of babel function references" single ((:commit . "41bc0cdea8a604c6c8dc83ed5066644d33688fad") (:authors ("Derek Feichtinger" . "dfeich@gmail.com")) (:maintainer "Derek Feichtinger" . "dfeich@gmail.com") (:keywords "convenience") (:url . "https://github.com/dfeich/helm-lib-babel.el"))])
+ (helm-lines . [(20220103 1909) ((emacs (24 4)) (helm (1 9 8))) "A helm interface for completing by lines" single ((:commit . "f5ad178818d223f32a0bf60d370b50c01df5f3da") (:authors ("@torgeir")) (:maintainer "@torgeir") (:keywords "files" "helm" "rg" "ag" "pt" "vc" "git" "lines" "complete" "tools" "languages") (:url . "https://github.com/torgeir/helm-lines.el/"))])
+ (helm-lobsters . [(20150213 1546) ((helm (1 0)) (cl-lib (0 5))) "helm front-end for lobste.rs" single ((:commit . "53c5b42baf72776dcba891fc3d7cd7d47721e9b0") (:authors ("Julien BLANCHARD" . "julien@sideburns.eu")) (:maintainer "Julien BLANCHARD" . "julien@sideburns.eu") (:url . "https://github.com/julienXX/helm-lobste.rs"))])
+ (helm-ls-git . [(20220418 657) ((helm (1 7 8))) "list git files." single ((:commit . "c6494a462e605d6fd16c9355e32685c3e0085589"))])
+ (helm-ls-hg . [(20150909 543) ((helm (1 7 8))) "List hg files in hg project." single ((:commit . "61b91a22fcfb62d0fc56e361ec01ce96973c7165"))])
+ (helm-ls-svn . [(20190316 2203) ((emacs (24 1)) (helm (1 7 0)) (cl-lib (0 5))) "helm extension to list svn files" single ((:commit . "a6043e1187282f649e2cb9f0e722a42daf41294b") (:authors ("Chunyang Xu" . "chunyang@macports.org")) (:maintainer "Chunyang Xu" . "chunyang@macports.org") (:keywords "helm" "svn") (:url . "https://svn.macports.org/repository/macports/users/chunyang/helm-ls-svn.el/helm-ls-svn.el"))])
+ (helm-lsp . [(20210419 2014) ((emacs (25 1)) (dash (2 14 1)) (lsp-mode (5 0)) (helm (2 0))) "LSP helm integration" single ((:commit . "c2c6974dadfac459b1a69a1217441283874cea92") (:authors ("Ivan Yonchovski" . "yyoncho@gmail.com")) (:maintainer "Ivan Yonchovski" . "yyoncho@gmail.com") (:keywords "languages" "debug") (:url . "https://github.com/yyoncho/helm-lsp"))])
+ (helm-lxc . [(20200323 816) ((emacs (25)) (cl-lib (0 5)) (helm (2 9 4)) (lxc-tramp (0 2 0))) "Helm interface to manage LXC containers" single ((:commit . "37fe2d7ed97967edf59a3b68b1434910516ae24f") (:authors ("montag451")) (:maintainer "montag451") (:keywords "helm" "lxc" "convenience") (:url . "https://github.com/montag451/helm-lxc"))])
+ (helm-make . [(20200620 27) nil "Select a Makefile target with helm" single ((:commit . "ebd71e85046d59b37f6a96535e01993b6962c559") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "makefile") (:url . "https://github.com/abo-abo/helm-make"))])
+ (helm-migemo . [(20151010 356) ((emacs (24 4)) (helm-core (1 7 8)) (migemo (1 9)) (cl-lib (0 5))) "Migemo plug-in for helm" single ((:commit . "66c6a19d07c6a385daefd2090d0709d26b608b4e") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "Yuhei Maeda <yuhei.maeda_at_gmail.com>") (:keywords "matching" "convenience" "tools" "i18n") (:url . "https://github.com/emacs-jp/helm-migemo"))])
+ (helm-mode-manager . [(20210108 2330) ((helm (1 5 3))) "Select and toggle major and minor modes with helm" single ((:commit . "7df8ed3ddd46a0402838b748d317c01454346164") (:authors ("istib")) (:maintainer "istib") (:url . "https://github.com/istib/helm-mode-manager"))])
+ (helm-mt . [(20160918 452) ((emacs (24)) (helm (0 0)) (multi-term (0 0)) (cl-lib (0 5))) "helm multi-term management" single ((:commit . "d2bff4100118483bc398c56d0ff095294209265b") (:authors ("Didier Deshommes" . "dfdeshom@gmail.com")) (:maintainer "Didier Deshommes" . "dfdeshom@gmail.com") (:keywords "helm" "multi-term") (:url . "https://github.com/dfdeshom/helm-mt"))])
+ (helm-mu . [(20210816 913) ((helm (1 5 5))) "Helm sources for searching emails and contacts" single ((:commit . "b85019d01815a4b58d6016c3a30fefa60d8363f2") (:authors ("Titus von der Malsburg" . "malsburg@posteo.de")) (:maintainer "Titus von der Malsburg" . "malsburg@posteo.de") (:url . "https://github.com/emacs-helm/helm-mu"))])
+ (helm-navi . [(20201220 1823) ((emacs (24 4)) (helm (1 9 4)) (helm-org (1 0)) (navi-mode (2 0)) (s (1 10 0))) "Helm for navi-mode" single ((:commit . "c5666cc171288d1fa892900ee66fba2a1c892c81") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "navigation" "outlines") (:url . "http://github.com/emacs-helm/helm-navi"))])
+ (helm-nixos-options . [(20151013 2309) ((nixos-options (0 0 1)) (helm (1 5 6))) "Helm Interface for nixos-options" single ((:commit . "053a2d5110ce05b7f99bcc2ac4804b70cbe87916") (:authors ("Diego Berrocal" . "cestdiego@gmail.com") ("Travis B. Hartwell" . "nafai@travishartwell.net")) (:maintainer "Diego Berrocal" . "cestdiego@gmail.com") (:keywords "unix") (:url . "http://www.github.com/travisbhartwell/nix-emacs/"))])
+ (helm-notmuch . [(20190320 1048) ((helm (1 9 3)) (notmuch (0 21))) "Search emails with Notmuch and Helm" single ((:commit . "97a01497e079a7b6505987e9feba6b603bbec288") (:authors ("Chunyang Xu" . "mail@xuchunyang.me")) (:maintainer "Chunyang Xu" . "mail@xuchunyang.me") (:keywords "mail") (:url . "https://github.com/emacs-helm/helm-notmuch"))])
+ (helm-open-github . [(20170220 159) ((emacs (24 4)) (helm-core (1 7 7)) (gh (0 8 2))) "Utilities of Opening Github Page" single ((:commit . "2f03d97552a1233db7694116d5f80ecde7612756") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-helm-open-github"))])
+ (helm-org . [(20210324 1927) ((helm (3 3)) (emacs (24 4))) "Helm for org headlines and keywords completion" single ((:commit . "d67186d3a64e610c03a5f3d583488f018fb032e4") (:authors ("Thierry Volpiatto" . "thierry.volpiatto@gmail.com")) (:maintainer "Thierry Volpiatto" . "thierry.volpiatto@gmail.com") (:url . "https://github.com/emacs-helm/helm-org"))])
+ (helm-org-multi-wiki . [(20210228 1853) ((emacs (26 1)) (org (9 3)) (org-multi-wiki (0 4)) (org-ql (0 5)) (dash (2 18)) (helm-org-ql (0 5)) (helm (3 5))) "Helm interface to org-multi-wiki" single ((:commit . "bf8039aadddaf02569fab473f766071ef7e63563") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:keywords "org" "outlines") (:url . "https://github.com/akirak/org-multi-wiki"))])
+ (helm-org-ql . [(20220318 1529) ((emacs (26 1)) (dash (2 18 1)) (s (1 12 0)) (helm-org (1 0)) (org-ql (0 6 -1))) "Helm support for org-ql" single ((:commit . "46f523d94a376b168176c75bbd0e3e0d00e61170") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:url . "https://github.com/alphapapa/org-ql"))])
+ (helm-org-recent-headings . [(20211011 1519) ((emacs (26 1)) (org (9 0 5)) (dash (2 18 0)) (helm (1 9 4)) (org-recent-headings (0 2 -1)) (s (1 12 0))) "Helm source for org-recent-headings" single ((:commit . "97418d581ea030f0718794e50b005e9bae44582e") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "hypermedia" "outlines" "org") (:url . "http://github.com/alphapapa/org-recent-headings"))])
+ (helm-org-rifle . [(20200512 1943) ((emacs (24 4)) (dash (2 12)) (f (0 18 1)) (helm (1 9 4)) (s (1 10 0))) "Rifle through your Org files" single ((:commit . "5e13a0e59606b40088927870dab116a8eab8e66c") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "hypermedia" "outlines") (:url . "http://github.com/alphapapa/helm-org-rifle"))])
+ (helm-orgcard . [(20151001 1524) ((helm-core (1 7 7))) "browse the orgcard by helm" single ((:commit . "9655ac340d1ccc5f3d1c0f7c49be8dd3556d4d0d") (:authors ("Yuhei Maeda <yuhei.maeda_at_gmail.com>")) (:maintainer "Yuhei Maeda") (:keywords "convenience" "helm" "org") (:url . "https://github.com/emacs-jp/helm-orgcard"))])
+ (helm-osx-app . [(20190717 958) ((emacs (25 1)) (helm-core (3 0))) "Launch macOS apps with helm" single ((:commit . "634ed5d721a20af265825a018e9df3ee6640daee") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:url . "https://github.com/xuchunyang/helm-osx-app"))])
+ (helm-pages . [(20161121 226) ((helm (1 6 5)) (emacs (24)) (cl-lib (0 5))) "Pages in current buffer as Helm datasource" single ((:commit . "51dcb9374d1df9feaae85e60cfb39b970554ecba") (:authors ("David Christiansen" . "david@davidchristiansen.dk")) (:maintainer "David Christiansen" . "david@davidchristiansen.dk") (:keywords "convenience" "helm" "outlines"))])
+ (helm-pass . [(20210221 1655) ((emacs (25)) (helm (0)) (password-store (0)) (auth-source-pass (4 0 0))) "helm interface of pass, the standard Unix password manager" single ((:commit . "4ce46f1801f2e76e53482c65aa0619d427a3fbf9") (:authors ("J. Alexander Branham" . "branham@utexas.edu")) (:maintainer "Pierre Neidhardt" . "mail@ambrevar.xyz") (:url . "https://github.com/emacs-helm/helm-pass"))])
+ (helm-perldoc . [(20200315 1716) ((helm-core (2 0)) (deferred (0 3 1)) (emacs (24 4))) "perldoc with helm interface" tar ((:commit . "6f3526f07f3df3059dbde779f8e681f5f1fee6ea") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-helm-perldoc"))])
+ (helm-perspeen . [(20170228 1345) ((perspeen (0 1 0)) (helm (2 5 0))) "Helm interface for perspeen." single ((:commit . "7fe2922d85608bfa9e18269fc44181428b8849ff") (:authors ("Yoshinobu Fujimoto")) (:maintainer "Yoshinobu Fujimoto") (:keywords "projects" "lisp") (:url . "https://github.com/jimo1001/helm-perspeen"))])
+ (helm-phpunit . [(20160513 853) ((helm (1 9 5)) (phpunit (0 7 0))) "Helm integration for phpunit.el" single ((:commit . "739f26204ad2ba76c25f45e8eab1e5216f7c3518") (:authors ("Eric Hansen" . "hansen.c.eric@gmail.com")) (:maintainer "Eric Hansen" . "hansen.c.eric@gmail.com") (:keywords "phpunit" "helm" "php") (:url . "https://github.com/eric-hansen/phpunit-helm"))])
+ (helm-posframe . [(20211103 236) ((emacs (26 0)) (posframe (1 0 0)) (helm (0 1))) "Using posframe to show helm window" single ((:commit . "87461b52b6f3f378c63642a33f584d4a4ba28351") (:authors ("Feng Shu")) (:maintainer "Feng Shu" . "tumashu@163.com") (:keywords "abbrev" "convenience" "matching" "helm") (:url . "https://github.com/tumashu/helm-posframe"))])
+ (helm-proc . [(20161006 305) ((helm (1 6 0))) "Helm interface for managing system processes" tar ((:commit . "576d31c2d74ba3897d56e2acd2b0993f52c2547c") (:authors ("Markus Hauck" . "markus1189@gmail.com")) (:maintainer "Markus Hauck" . "markus1189@gmail.com") (:keywords "helm"))])
+ (helm-project-persist . [(20151210 1543) ((helm (1 5 2)) (project-persist (0 1 4))) "Helm integration for project-persist package" single ((:commit . "357950fbac18090985a750e40d5d8b10ee9dcd53") (:authors ("Sliim" . "sliim@mailoo.org")) (:maintainer "Sliim" . "sliim@mailoo.org") (:keywords "project-persist" "project" "helm"))])
+ (helm-projectile . [(20201217 908) ((helm (1 9 9)) (projectile (2 2 0)) (cl-lib (0 3))) "Helm integration for Projectile" single ((:commit . "58123f14c392021714fc5d23b9f95c7f95ce07f1") (:authors ("Bozhidar Batsov")) (:maintainer "Bozhidar Batsov") (:keywords "project" "convenience") (:url . "https://github.com/bbatsov/helm-projectile"))])
+ (helm-prosjekt . [(20140129 717) ((prosjekt (0 3)) (helm (1 5 9))) "Helm integration for prosjekt." single ((:commit . "a864a8be5842223043702395f311e3350c28e9db") (:authors ("Sohail Somani" . "sohail@taggedtype.net")) (:maintainer "Sohail Somani" . "sohail@taggedtype.net") (:url . "https://github.com/abingham/prosjekt"))])
+ (helm-pt . [(20160214 2342) ((helm (1 5 6))) "Helm interface to the platinum searcher" tar ((:commit . "8acc52911dad1ed0c3975f134a468762afe0b76b") (:authors ("Rich Alesi")) (:maintainer "Rich Alesi") (:url . "https://github.com/ralesi/helm-pt"))])
+ (helm-purpose . [(20170114 1636) ((emacs (24)) (helm (1 9 2)) (window-purpose (1 4))) "Helm Interface for Purpose" single ((:commit . "9ff4c21c1e9ebc7afb851b738f815df7343bb287") (:authors ("Bar Magal (2016)")) (:maintainer "Bar Magal (2016)") (:url . "https://github.com/bmag/helm-purpose"))])
+ (helm-pydoc . [(20160918 542) ((helm-core (2 0)) (emacs (24 4))) "pydoc with helm interface" tar ((:commit . "85480a29b56dacde425655bc8f5a597c785afdf5") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-helm-pydoc"))])
+ (helm-qiita . [(20190526 1359) ((emacs (24)) (helm (2 8 2))) "Qiita with helm interface" single ((:commit . "5f82010c595f8e122aa3f68148ba8d8ccb1333d8") (:authors ("Takashi Masuda" . "masutaka.net@gmail.com")) (:maintainer "Takashi Masuda" . "masutaka.net@gmail.com") (:url . "https://github.com/masutaka/emacs-helm-qiita"))])
+ (helm-rage . [(20180118 1532) ((helm (1 9 8)) (emacs (24 4)) (dash (2 13 0)) (s (1 11 0))) "Helm command for rage characters." tar ((:commit . "5d0aefb53d859186181d4bdcfeff7d315339c7b8") (:keywords "helm" "rage" "meme") (:url . "https://github.com/bomgar/helm-rage"))])
+ (helm-rails . [(20130424 1519) ((helm (1 5 1)) (inflections (1 1))) "Helm extension for Rails projects." single ((:commit . "506d9948d45dfbc575c9c4c0d102c1ad2f511e82") (:authors ("Adam Sokolnicki" . "adam.sokolnicki@gmail.com")) (:maintainer "Adam Sokolnicki" . "adam.sokolnicki@gmail.com") (:keywords "helm" "rails" "git") (:url . "https://github.com/asok/helm-rails"))])
+ (helm-rb . [(20131123 1639) ((helm (1 0)) (helm-ag-r (20131123))) "Search Ruby's method by ag and display helm" tar ((:commit . "4949d646420a9849af234dacdd8eb34a77c662fd") (:authors ("Yuta Yamada <cokesboy\"at\"gmail.com>")) (:maintainer "Yuta Yamada <cokesboy\"at\"gmail.com>") (:keywords "searching" "ruby") (:url . "https://github.com/yuutayamada/helm-rb"))])
+ (helm-rdefs . [(20161130 536) ((emacs (24)) (helm (1 6 4))) "rdefs with helm interface" single ((:commit . "cd3a6b3af3015ee58ef30cb7c81c79ebe5fc867b") (:authors ("Hiroshi Saito" . "monodie@gmail.com")) (:maintainer "Hiroshi Saito" . "monodie@gmail.com") (:keywords "matching" "tools") (:url . "https://github.com/saidie/helm-rdefs"))])
+ (helm-recoll . [(20200805 1235) ((helm (3 3)) (emacs (24 4))) "helm interface for the recoll desktop search tool." single ((:commit . "c021a3b5e8c010bdad062cceb80fb49788f89e9f") (:authors ("Thierry Volpiatto <thierry.volpiatto at gmail.com>")) (:maintainer "Thierry Volpiatto <thierry.volpiatto at gmail.com>") (:keywords "convenience") (:url . "https://github.com/emacs-helm/helm-recoll"))])
+ (helm-rg . [(20200721 725) ((emacs (25)) (cl-lib (0 5)) (dash (2 13 0)) (helm (2 8 8))) "a helm interface to ripgrep" single ((:commit . "ee0a3c09da0c843715344919400ab0a0190cc9dc") (:authors ("Danny McClanahan")) (:maintainer "Danny McClanahan") (:keywords "find" "file" "files" "helm" "fast" "rg" "ripgrep" "grep" "search" "match") (:url . "https://github.com/cosmicexplorer/helm-rg"))])
+ (helm-rhythmbox . [(20160524 1158) ((helm (1 5 0)) (cl-lib (0 5))) "control Rhythmbox's play queue via Helm" single ((:commit . "c92e1ded34ddd4e62e7e9a558259c232e05193fa") (:authors ("Thomas Winant" . "dewinant@gmail.com")) (:maintainer "Thomas Winant" . "dewinant@gmail.com") (:url . "https://github.com/mrBliss/helm-rhythmbox"))])
+ (helm-robe . [(20151209 355) ((helm (1 7 7))) "completing read function for robe" single ((:commit . "6e69543b4ee76c5f8f3f2510c76e6d9aed17a370") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-helm-robe"))])
+ (helm-ros . [(20160812 1752) ((helm (1 9 9)) (xterm-color (1 0)) (cl-lib (0 5))) "Interfaces ROS with helm" single ((:commit . "92b0b215f6a017f0f57f1af15466cc0b2a5a0135") (:authors ("David Landry" . "davidlandry93@gmail.com")) (:maintainer "David Landry" . "davidlandry93@gmail.com") (:keywords "helm" "ros") (:url . "https://www.github.com/davidlandry93/helm-ros"))])
+ (helm-rtags . [(20191222 920) ((helm (2 0)) (rtags (2 10))) "A front-end for rtags" single ((:commit . "db39790fda5c2443bc790b8971ac140914f7e9c2") (:authors ("Jan Erik Hanssen" . "jhanssen@gmail.com") ("Anders Bakken" . "agbakken@gmail.com")) (:maintainer "Jan Erik Hanssen" . "jhanssen@gmail.com") (:url . "https://github.com/Andersbakken/rtags"))])
+ (helm-rubygems-local . [(20130712 111) ((helm (1 5 3))) "Installed local rubygems find-file for helm" single ((:commit . "289cb33d41c703af9791d6da46b55f070013c2e3") (:authors ("hadashiA" . "dev@hadashikick.jp")) (:maintainer "hadashiA" . "dev@hadashikick.jp") (:url . "https://github.com/f-kubotar/helm-rubygems-local"))])
+ (helm-rubygems-org . [(20140826 1156) ((emacs (24)) (helm (1 6 3)) (cl-lib (0 5))) "Use helm to search rubygems.org" single ((:commit . "6aaed984f698cbdf9f9aceb0221404563e28764d") (:authors ("Chad Albers" . "calbers@neomantic.com")) (:maintainer "Chad Albers" . "calbers@neomantic.com") (:keywords "ruby" "rubygems" "gemfile" "helm") (:url . "https://github.com/neomantic/helm-rubygems-org"))])
+ (helm-safari . [(20160404 324) ((helm (1 9 1)) (emacs (24))) "Browse your Safari bookmarks and history" single ((:commit . "664c7f4488829228eed7e90cd53002e14bec555b") (:authors ("Chunyang Xu" . "xuchunyang56@gmail.com")) (:maintainer "Chunyang Xu" . "xuchunyang56@gmail.com") (:keywords "tools") (:url . "https://github.com/xuchunyang/helm-safari"))])
+ (helm-sage . [(20160514 745) ((cl-lib (0 5)) (helm (1 5 6)) (sage-shell-mode (0 1 0))) "A helm extension for sage-shell-mode." single ((:commit . "f14e9281d8f2162df7d8f9c2ad9ad1248a24803b") (:authors ("Sho Takemori" . "stakemorii@gmail.com")) (:maintainer "Sho Takemori" . "stakemorii@gmail.com") (:keywords "sage" "math" "helm") (:url . "https://github.com/stakemori/helm-sage"))])
+ (helm-searcher . [(20210221 923) ((emacs (25 1)) (helm (2 0)) (searcher (0 1 8)) (s (1 12 0)) (f (0 20 0))) "Helm interface to use searcher" single ((:commit . "d0a3aa7c4a882c6563c053c3317600582043d71c") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/emacs-helm/helm-searcher"))])
+ (helm-selected . [(20171223 210) ((emacs (24 4)) (helm (2 8 6)) (selected (1 1))) "helm extension for selected.el" single ((:commit . "a9c769998bc56373d19f0ec9cbbbb4bd89a43c2d") (:authors ("Takaaki ISHIKAWA <takaxp at ieee dot org>")) (:maintainer "Takaaki ISHIKAWA <takaxp at ieee dot org>") (:keywords "extensions" "convenience") (:url . "https://github.com/takaxp/helm-selected"))])
+ (helm-selector . [(20210125 857) ((emacs (26 1)) (helm (3))) "Helm buffer selector" tar ((:commit . "4da4711c4cfd14527abe20d66787beeb49171b26") (:authors ("Pierre Neidhardt" . "mail@ambrevar.xyz")) (:maintainer "Pierre Neidhardt" . "mail@ambrevar.xyz") (:url . "https://github.com/emacs-helm/helm-selector"))])
+ (helm-sheet . [(20130630 1239) ((helm (1 0))) "helm sources for sheet" single ((:commit . "d360b68d0ddb09aa1854e7b2f3cb39caeee26463") (:authors ("Yasuyuki Oka" . "yasuyk@gmail.com")) (:maintainer "Yasuyuki Oka" . "yasuyk@gmail.com") (:keywords "helm" "sheet") (:url . "https://github.com/yasuyk/helm-sheet"))])
+ (helm-shell-history . [(20210214 948) ((helm (3 7)) (emacs (24 3))) "Find shell history from helm" single ((:commit . "0c861f3db721e54053fc65f5651cf548cc1cb600") (:authors ("Yuta Yamada <cokesboy\"at\"gmail.com>")) (:maintainer "Yuta Yamada <cokesboy\"at\"gmail.com>") (:keywords "helm" "terminals" "shell") (:url . "https://github.com/yuutayamada/helm-shell-history"))])
+ (helm-slime . [(20191016 1601) ((emacs (25)) (helm (3 2)) (slime (2 18)) (cl-lib (0 5))) "helm-sources and some utilities for SLIME." single ((:commit . "7886cc49906a87ebd73be3b71f5dd6b1433a9b7b") (:authors ("Takeshi Banse" . "takebi@laafc.net")) (:maintainer "Takeshi Banse" . "takebi@laafc.net") (:keywords "convenience" "helm" "slime") (:url . "https://github.com/emacs-helm/helm-slime"))])
+ (helm-sly . [(20210205 1424) ((emacs (25 1)) (helm (3 2)) (cl-lib (0 5)) (sly (0 0))) "Helm sources and some utilities for SLY." single ((:commit . "3691626c80620e992a338c3222283d9149f1ecb5") (:authors ("Pierre Neidhardt" . "mail@ambrevar.xyz")) (:maintainer "Pierre Neidhardt" . "mail@ambrevar.xyz") (:keywords "convenience" "helm" "sly" "lisp") (:url . "https://github.com/emacs-helm/helm-sly"))])
+ (helm-smex . [(20171004 2008) ((emacs (24)) (smex (3 0)) (helm (1 7 7))) "Helm interface for smex" single ((:commit . "2269375dfa452b88b5170d1a5d5849ebb2c1e413") (:authors ("Peter Vasil" . "mail@petervasil.net")) (:maintainer "Peter Vasil" . "mail@petervasil.net") (:keywords "convenience"))])
+ (helm-spaces . [(20161001 1409) ((helm-core (2 2)) (spaces (0 1 0))) "helm sources for spaces" single ((:commit . "877e2b5178926308d6a7c2a37477bb12c33a96d4") (:authors ("Yasuyuki Oka" . "yasuyk@gmail.com")) (:maintainer "Yasuyuki Oka" . "yasuyk@gmail.com") (:keywords "helm" "frames" "convenience") (:url . "https://github.com/yasuyk/helm-spaces"))])
+ (helm-spotify . [(20160905 2147) ((helm (0 0 0)) (multi (2 0 0))) "Control Spotify with Helm." single ((:commit . "f7a62d1ff88e3127de9be7cd3e818b0a92268ab3") (:authors ("Kris Jenkins" . "krisajenkins@gmail.com")) (:maintainer "Kris Jenkins" . "krisajenkins@gmail.com") (:keywords "helm" "spotify") (:url . "https://github.com/krisajenkins/helm-spotify"))])
+ (helm-spotify-plus . [(20190913 2236) ((emacs (24 4)) (helm (2 0 0)) (multi (2 0 1))) "Control Spotify search and select music with Helm." single ((:commit . "c3922ec368250965e483876cde5880d88a40a71b") (:authors ("Wanderson Ferreira <https://github.com/wandersoncferreira> and Luis Moneda <https://github.com/lgmoneda>")) (:maintainer "Wanderson Ferreira <https://github.com/wandersoncferreira> and Luis Moneda <https://github.com/lgmoneda>") (:url . "https://github.com/wandersoncferreira/helm-spotify-plus"))])
+ (helm-sql-connect . [(20170319 1251) ((helm (0 0 0))) "Choose a database to connect to via Helm." single ((:commit . "5aead55b6f8636140945714d8c332b287ab9ef10") (:authors ("Eric Hansen" . "hansen.c.eric@gmail.com")) (:maintainer "Eric Hansen" . "hansen.c.eric@gmail.com") (:keywords "tools" "convenience" "comm") (:url . "https://github.com/eric-hansen/helm-sql-connect"))])
+ (helm-switch-shell . [(20210713 1440) ((emacs (25 1)) (helm (2 8 8))) "A Helm source for switching between shell buffers" single ((:commit . "8d7ba1d99ff12a8f1d6ce3b9684ae8aebf494cf3") (:authors ("James N. V. Cash" . "james.cash@occasionallycogent.com")) (:maintainer "James N. V. Cash" . "james.cash@occasionallycogent.com") (:keywords "matching" "processes" "terminals" "tools") (:url . "https://github.com/jamesnvc/helm-switch-shell"))])
+ (helm-switch-to-repl . [(20210206 844) ((emacs (26 1)) (helm (3))) "Helm action to switch directory in REPLs" single ((:commit . "f0e732e7217fc0373b0805245fa15920cf676619") (:authors ("Pierre Neidhardt" . "mail@ambrevar.xyz")) (:maintainer "Pierre Neidhardt" . "mail@ambrevar.xyz") (:url . "https://github.com/emacs-helm/helm-switch-to-repl"))])
+ (helm-swoop . [(20210426 547) ((emacs (25 1)) (helm (3 6))) "Efficiently hopping squeezed lines powered by helm interface" single ((:commit . "1b3285791f1dc1fde548fe67aec07214d698fd57") (:authors ("Shingo Fukuyama - http://fukuyama.co")) (:maintainer "Shingo Fukuyama - http://fukuyama.co") (:keywords "convenience" "helm" "swoop" "inner" "buffer" "search") (:url . "https://github.com/emacsorphanage/helm-swoop"))])
+ (helm-system-packages . [(20210628 1727) ((emacs (24 4)) (helm (2 8 7)) (seq (1 8))) "Helm UI wrapper for system package managers." tar ((:commit . "a16bb1c3708416984106a98353700d456414b6a1") (:authors ("Pierre Neidhardt" . "mail@ambrevar.xyz")) (:maintainer "Pierre Neidhardt" . "mail@ambrevar.xyz") (:keywords "helm" "packages") (:url . "https://github.com/emacs-helm/helm-system-packages"))])
+ (helm-systemd . [(20210105 542) ((emacs (24 4)) (helm (1 9 2)) (with-editor (2 5 0))) "helm's systemd interface" single ((:commit . "8b26ab2d3a5b08c1e03c9312818512d7492bbc9a") (:authors (nil . "<lompik@oriontabArch>")) (:maintainer nil . "<lompik@oriontabArch>") (:keywords "convenience"))])
+ (helm-tail . [(20181124 439) ((emacs (25 1)) (helm (2 7 0))) "Read recent output from various sources" single ((:commit . "1f5a6355aa3bdb00b9b0bc93db29c17f0d6701e3") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:keywords "maint" "tools") (:url . "https://github.com/akirak/helm-tail"))])
+ (helm-taskswitch . [(20190304 1414) ((emacs (24)) (helm (3 0))) "Use helm to switch windows and buffers" single ((:commit . "59f7cb99defa6e6bf6e7d599559fa8d5786cf8a9") (:authors ("Brian Caruso" . "briancaruso@gmail.com")) (:maintainer "Brian Caruso" . "briancaruso@gmail.com") (:keywords "frames") (:url . "https://github.com/bdc34/helm-taskswitch"))])
+ (helm-themes . [(20200323 712) ((helm-core (2 0)) (emacs (24 4))) "Color theme selection with helm interface" single ((:commit . "b6bd3379b98d306935731e9632907387b078e000") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-helm-themes"))])
+ (helm-tramp . [(20190616 125) ((emacs (24 3)) (helm (2 0))) "Tramp helm interface for ssh, docker, vagrant" single ((:commit . "55e56975fe1456591a293bf60c183c3dda9f788f") (:authors ("Masashı Mıyaura")) (:maintainer "Masashı Mıyaura") (:url . "https://github.com/masasam/emacs-helm-tramp"))])
+ (helm-tree-sitter . [(20220328 1345) ((emacs (25 1)) (helm (3 6 2)) (tree-sitter (0 16 1))) "Helm interface for tree-sitter" tar ((:commit . "ef5209bd1deb56d6cab7a26e6d55615161f2115a") (:authors ("Giedrius Jonikas" . "giedriusj1@gmail.com")) (:maintainer "Giedrius Jonikas" . "giedriusj1@gmail.com") (:url . "https://github.com/Giedriusj1/helm-tree-sitter"))])
+ (helm-twitch . [(20220420 1625) ((dash (2 11 0)) (helm (1 5)) (emacs (24)) (twitch-api (20210809 1641)) (streamlink (20210811 1429))) "Navigate Twitch.tv via `helm'" single ((:commit . "27fbec24cc250d508cd2f4286da16262752908eb") (:authors ("Aaron Jacobs" . "atheriel@gmail.com")) (:maintainer "Aaron Jacobs" . "atheriel@gmail.com") (:keywords "helm" "twitch" "games") (:url . "https://github.com/BenediktBroich/helm-twitch"))])
+ (helm-unicode . [(20180608 1407) ((helm (1 9 8)) (emacs (24 4))) "Helm command for unicode characters." single ((:commit . "fbeb0c5e741a6f462520884b744d43a9acbe1d34"))])
+ (helm-w32-launcher . [(20141223 2014) ((emacs (24)) (helm (1 6 5)) (cl-lib (0 5))) "Start Menu entry launcher using Helm" tar ((:commit . "3e59ad62b89dd21d334af0203d445a83eb25dc5b") (:authors ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Fanael Linithien" . "fanael4@gmail.com") (:url . "https://github.com/Fanael/helm-w32-launcher"))])
+ (helm-w3m . [(20210315 723) ((helm (1 5)) (w3m (0 0)) (cl-lib (0 5)) (emacs (24 1))) "W3m bookmark - helm interface." single ((:commit . "0a25a2b1df9bc660a90d633beb301b3815556e4e"))])
+ (helm-wikipedia . [(20210525 717) ((helm (3 6)) (emacs (25 1))) "Wikipedia suggestions" single ((:commit . "c242c74efaeda2ffbafd281ee6bceae1a42507bb") (:url . "https://github.com/emacs-helm/helm-wikipedia"))])
+ (helm-wordnet . [(20160128 1507) ((emacs (24)) (helm (1 7 0)) (cl-lib (0 5))) "Helm interface to local wordnet dictionary" single ((:commit . "a36dbc6fcb570b812870bc1e190f203e0a0042fc") (:authors ("Raghav Kumar Gautam" . "rgautam@apache.com")) (:maintainer "Raghav Kumar Gautam" . "rgautam@apache.com") (:keywords "dictionary" "wordnet" "emacs" "elisp" "helm") (:url . "https://github.com/raghavgautam/helm-wordnet"))])
+ (helm-xcdoc . [(20160116 1018) ((helm (1 5)) (emacs (24 4))) "Search Xcode Document by docsetutil and eww with helm interface" single ((:commit . "a85612149a6d8e18ab309b3db2d222ce39c42049") (:authors ("Ryo Fujimoto" . "fujimisakri@gmail.com")) (:maintainer "Ryo Fujimoto" . "fujimisakri@gmail.com") (:url . "https://github.com/fujimisakari/emacs-helm-xcdoc"))])
+ (helm-xref . [(20211017 1334) ((emacs (25 1)) (helm (1 9 4))) "Helm interface for xref results" single ((:commit . "ea0e4ed8a9baf236e4085cbc7178241f109a53fa") (:authors ("Fritz Stelzer" . "brotzeitmacher@gmail.com")) (:maintainer "Fritz Stelzer" . "brotzeitmacher@gmail.com") (:url . "https://github.com/brotzeit/helm-xref"))])
+ (helm-youtube . [(20190101 1733) ((request (0 2 0)) (helm (2 3 1)) (cl-lib (0 5))) "Query YouTube and play videos in your browser" single ((:commit . "e7272f1648c7fa836ea5ac1a61770b4931ab4709") (:authors ("Maximilian Roquemore" . "maximus12793@gmail.com")) (:maintainer "Maximilian Roquemore" . "maximus12793@gmail.com") (:keywords "youtube" "multimedia") (:url . "https://github.com/maximus12793/helm-youtube"))])
+ (helm-z . [(20171204 325) ((helm (1 0))) "Show z directory list with helm.el support." single ((:commit . "37212220bebea8b9c238cb1bbacd8332b7f26c03") (:authors ("yynozk" . "yynozk@gmail.com")) (:maintainer "yynozk" . "yynozk@gmail.com") (:url . "https://github.com/yynozk/helm-z"))])
+ (helm-zhihu-daily . [(20160625 1145) ((helm (1 0)) (cl-lib (0 5)) (emacs (24 4))) "Helm interface for 知乎日报 (http://daily.zhihu.com)" single ((:commit . "be27dcc6be1eb97663b65581a9a5c0fc81cfaba7") (:authors ("Chunyang Xu" . "xuchunyang56@gmail.com")) (:maintainer "Chunyang Xu" . "xuchunyang56@gmail.com") (:url . "https://github.com/xuchunyang/helm-zhihu-daily"))])
+ (help-find . [(20210826 928) ((emacs (25 2)) (dash (2 12))) "Additional help functions for working with keymaps" single ((:commit . "576d6505b9e42f50f121b1a6a675f17f03a04406") (:authors ("Duncan Burke" . "duncankburke@gmail.com")) (:maintainer "Duncan Burke" . "duncankburke@gmail.com") (:keywords "help") (:url . "https://github.com/duncanburke/help-find"))])
+ (help-find-org-mode . [(20181204 234) ((emacs (24 4))) "Advise help to find org source over tangled code" single ((:commit . "aeda7f92c086dab9d8dfcd580fe80b332887a548") (:authors ("Eric Crosson" . "eric.s.crosson@utexas.com")) (:maintainer "Eric Crosson" . "eric.s.crosson@utexas.com") (:keywords "convenience") (:url . "https://github.com/EricCrosson/help-find-org-mode"))])
+ (helpful . [(20220412 421) ((emacs (25)) (dash (2 18 0)) (s (1 11 0)) (f (0 20 0)) (elisp-refs (1 2))) "A better *help* buffer" single ((:commit . "c2729a236a84a1fbd3d184c163fbd10e0fd62077") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:keywords "help" "lisp") (:url . "https://github.com/Wilfred/helpful"))])
+ (hemera-theme . [(20180916 924) ((emacs (24))) "Light theme" single ((:commit . "b67c902b210b37b00cac68726822404543147ba8") (:authors ("Guido Schmidt")) (:maintainer "Guido Schmidt" . "guido.schmidt.2912@gmail.com") (:keywords "themes" "light-theme") (:url . "https://github.com/GuidoSchmidt/emacs-hemera-theme"))])
+ (hemisu-theme . [(20130508 1844) nil "Hemisu for Emacs." tar ((:commit . "5c206561aa2c844ecdf3e3b672c3235e559ddd7f") (:authors ("Andrzej Sliwa")) (:maintainer "Andrzej Sliwa") (:url . "http://github/anrzejsliwa/django-theme"))])
+ (hercules . [(20200420 747) ((emacs (24 4)) (which-key (3 3 2))) "An auto-magical, which-key-based hydra banisher." single ((:commit . "557da39878d0637395fdded91243b340c37eff7b") (:authors ("Uros Perisic")) (:maintainer "Uros Perisic") (:keywords "convenience") (:url . "https://gitlab.com/jjzmajic/hercules"))])
+ (heroku-theme . [(20150523 219) nil "Heroku color theme" single ((:commit . "8083643fe92ec3a1c3eb82f1b8dc2236c9c9691d") (:authors ("Jonathan Chu" . "me@jonathanchu.is")) (:maintainer "Jonathan Chu" . "me@jonathanchu.is") (:url . "https://github.com/jonathanchu/color-theme-heroku"))])
+ (hexo . [(20200416 1410) ((emacs (24 3))) "Major mode & tools for Hexo" single ((:commit . "d600b6c2d51959f1331c8abf3953365544322afa") (:authors ("Ono Hiroko (kuanyui)" . "azazabc123@gmail.com")) (:maintainer "Ono Hiroko (kuanyui)" . "azazabc123@gmail.com") (:keywords "tools" "hexo") (:url . "https://github.com/kuanyui/hexo.el"))])
+ (hfst-mode . [(20160708 1202) nil "major mode for editing HFST files" single ((:commit . "ac1bb9dd92545d3e7fdc05c83996c227cc15c6b8") (:authors ("Kevin Brubeck Unhammer" . "unhammer@fsfe.org")) (:maintainer "Kevin Brubeck Unhammer" . "unhammer@fsfe.org") (:keywords "languages") (:url . "http://wiki.apertium.org/wiki/Emacs"))])
+ (hg-histedit . [(20210302 2334) ((emacs (25 1)) (with-editor (2 8 3))) "Edit HG histedit files" single ((:commit . "a05149483b9c5f7848ece0ba6028c900595a6a25") (:authors ("James Nguyen" . "james@jojojames.com")) (:maintainer "James Nguyen" . "james@jojojames.com") (:keywords "mercurial" "hg" "emacs" "tools") (:url . "https://github.com/jojojames/hg-histedit"))])
+ (hgignore-mode . [(20210314 431) nil "a major mode for editing hgignore files" single ((:commit . "2c5aa4c238848f5b4f2955afcfb5f21ea513653b") (:authors ("Omair Majid" . "omair.majid@gmail.com")) (:maintainer "Omair Majid" . "omair.majid@gmail.com") (:keywords "convenience" "vc" "hg") (:url . "http://github.com/omajid/hgignore-mode"))])
+ (hgrc-mode . [(20150409 2043) nil "major mode for editing hgrc files" single ((:commit . "314e8320b82cc1ce74b1bd372f296252e7a23090") (:authors ("Omair Majid" . "omair.majid@gmail.com")) (:maintainer "Omair Majid" . "omair.majid@gmail.com") (:keywords "convenience" "vc" "hg") (:url . "http://github.com/omajid/hgrc-mode"))])
+ (hi2 . [(20141005 1931) nil "indentation module for Haskell Mode" single ((:commit . "c9d199727b5cdcb9e36a972b38131ce4611fd6c8") (:authors ("Gergely Risko" . "gergely@risko.hu")) (:maintainer "Gergely Risko" . "gergely@risko.hu") (:keywords "indentation" "haskell") (:url . "https://github.com/errge/hi2"))])
+ (hiccup-cli . [(20210208 652) ((emacs (26 1))) "Convert HTML to Hiccup syntax" single ((:commit . "b56ae0d5cd5ce3ef24ed13be5103e231c91ef4e2") (:authors ("Kevin W. van Rooijen")) (:maintainer "Kevin W. van Rooijen") (:keywords "tools") (:url . "https://github.com/kwrooijen/hiccup-cli"))])
+ (hide-lines . [(20210513 1636) nil "Commands for hiding lines based on a regexp" single ((:commit . "f0828c15e50db5eddb905de783e7683b04d1eca3") (:authors ("Mark Hulme-Jones <ture at plig cucumber dot net>")) (:maintainer "Joe Bloggs" . "vapniks@yahoo.com") (:keywords "convenience") (:url . "https://github.com/vapniks/hide-lines"))])
+ (hide-mode-line . [(20211112 1400) ((emacs (24 4))) "minor mode that hides/masks your modeline" single ((:commit . "bc5d293576c5e08c29e694078b96a5ed85631942") (:authors ("Henrik Lissner <http://github/hlissner>")) (:maintainer "Henrik Lissner" . "git@henrik.io") (:keywords "frames" "mode-line") (:url . "https://github.com/hlissner/emacs-hide-mode-line"))])
+ (hidepw . [(20200326 112) nil "Minor mode to hide passwords" single ((:commit . "73f099da79d73fe4087472df3469d8b9b20a59f2") (:authors ("Chris Forno" . "jekor@jekor.com")) (:maintainer "Chris Forno" . "jekor@jekor.com") (:keywords "hide" "hidden" "password" "faces") (:url . "https://github.com/jekor/hidepw"))])
+ (hideshow-org . [(20120223 2250) nil "Provides org-mode like hide and show for hideshow.el" single ((:commit . "16419e52e6cdd2f46f755144c0ab11ce00d1a626") (:authors ("Shane Celis <shane (at) gnufoo (dot) org>")) (:maintainer "Shane Celis <shane (at) gnufoo (dot) org>") (:keywords "c" "c++" "java" "lisp" "tools" "editing" "comments" "blocks" "hiding" "outlines" "org-mode"))])
+ (hierarchy . [(20190425 842) ((emacs (25 1))) "Library to create and display hierarchy structures" single ((:commit . "fed505b8e71bf51772887c8a94bb57f5b8838b63") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:url . "https://github.com/DamienCassou/hierarchy"))])
+ (highlight . [(20210318 2248) nil "Highlighting commands." single ((:commit . "28557cb8d99b96eb509aaec1334c7cdda162517f") (:authors ("Drew Adams")) (:maintainer nil . "Drew Adams (concat \"drew.adams\" \"@\" \"oracle\" \".com\")") (:keywords "faces" "help" "local") (:url . "https://www.emacswiki.org/emacs/download/highlight.el"))])
+ (highlight-blocks . [(20190318 1557) ((emacs (24))) "Highlight the blocks point is in" single ((:commit . "33cf3d36662faa36c86c8d53e4d5a3922efa3eb8") (:authors ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Fanael Linithien" . "fanael4@gmail.com") (:url . "https://github.com/Fanael/highlight-blocks"))])
+ (highlight-context-line . [(20181122 2203) nil "Improve orientation when scrolling" single ((:commit . "6b334e8207c780835a05b6909b4d826898c33d26") (:authors ("Stefan Kamphausen <www.skamphausen.de>")) (:maintainer "Stefan Kamphausen <www.skamphausen.de>") (:keywords "faces" "services" "user") (:url . "https://github.com/ska2342/highlight-context-line/"))])
+ (highlight-defined . [(20210411 222) ((emacs (24))) "Syntax highlighting of known Elisp symbols" single ((:commit . "4420bdda419875dacb065468aafe273b2022580e") (:authors ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Fanael Linithien" . "fanael4@gmail.com") (:url . "https://github.com/Fanael/highlight-defined"))])
+ (highlight-doxygen . [(20200520 1713) nil "Highlight Doxygen comments" single ((:commit . "eec4874e2e89d4eb39091aad89a67dff8f8ec84c") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "faces") (:url . "https://github.com/Lindydancer/highlight-doxygen"))])
+ (highlight-escape-sequences . [(20201214 1730) nil "Highlight escape sequences" single ((:commit . "fae976568c04b6fe8a9f2d854c8fe23b357a6878") (:authors ("Dmitry Gutov" . "dgutov@yandex.ru") ("Pavel Matcula" . "dev.plvlml@gmail.com")) (:maintainer "Dmitry Gutov" . "dgutov@yandex.ru") (:keywords "convenience") (:url . "https://github.com/dgutov/highlight-escape-sequences"))])
+ (highlight-function-calls . [(20170908 500) ((emacs (24 4))) "Highlight function/macro calls" single ((:commit . "f7a1eaf95fc64cc0db4d0567f9ff79ec4ae04787") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "faces" "highlighting") (:url . "http://github.com/alphapapa/highlight-function-calls"))])
+ (highlight-indent-guides . [(20200820 2328) ((emacs (24 1))) "Minor mode to highlight indentation" single ((:commit . "cf352c85cd15dd18aa096ba9d9ab9b7ab493e8f6") (:authors ("DarthFennec" . "darthfennec@derpymail.org")) (:maintainer "DarthFennec" . "darthfennec@derpymail.org") (:url . "https://github.com/DarthFennec/highlight-indent-guides"))])
+ (highlight-indentation . [(20210221 1418) nil "Minor modes for highlighting indentation" single ((:commit . "d88db4248882da2d4316e76ed673b4ac1fa99ce3") (:authors ("Anton Johansson" . "anton.johansson@gmail.com")) (:maintainer "Anton Johansson" . "anton.johansson@gmail.com") (:url . "https://github.com/antonj/Highlight-Indentation-for-Emacs"))])
+ (highlight-leading-spaces . [(20151216 1222) ((emacs (24 4))) "Highlight leading spaces" single ((:commit . "840db19d863dd97993fd9f893f5be501627b6354") (:authors ("Thomas Winant" . "dewinant@gmail.com")) (:maintainer "Thomas Winant" . "dewinant@gmail.com") (:url . "https://github.com/mrBliss/highlight-leading-spaces"))])
+ (highlight-numbers . [(20181013 1744) ((emacs (24)) (parent-mode (2 0))) "Highlight numbers in source code" single ((:commit . "8b4744c7f46c72b1d3d599d4fb75ef8183dee307") (:authors ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Fanael Linithien" . "fanael4@gmail.com") (:url . "https://github.com/Fanael/highlight-numbers"))])
+ (highlight-operators . [(20170213 2220) nil "a face for operators in programming modes" single ((:commit . "7696b43419505d6e3511ad2781f9f1dd3c55ef8c") (:authors ("Jonathan Kotta" . "jpkotta@gmail.com")) (:maintainer "Jonathan Kotta" . "jpkotta@gmail.com"))])
+ (highlight-parentheses . [(20220408 845) ((emacs (24 3))) "Highlight surrounding parentheses" single ((:commit . "438a1cb2563e2a2496be4678cc0df8d5b22caf5d") (:authors ("Nikolaj Schumacher <bugs * nschum de>")) (:maintainer "Tassilo Horn" . "tsdh@gnu.org") (:keywords "faces" "matching") (:url . "https://sr.ht/~tsdh/highlight-parentheses.el/"))])
+ (highlight-quoted . [(20140916 1822) ((emacs (24))) "Highlight Lisp quotes and quoted symbols" single ((:commit . "24103478158cd19fbcfb4339a3f1fa1f054f1469") (:authors ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Fanael Linithien" . "fanael4@gmail.com") (:url . "https://github.com/Fanael/highlight-quoted"))])
+ (highlight-refontification . [(20170211 2024) nil "Visualize font-lock refontification." single ((:commit . "32632897d88c4611fadb08517ca00ef5cbc989b6") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "faces" "tools") (:url . "https://github.com/Lindydancer/highlight-refontification"))])
+ (highlight-stages . [(20210306 418) nil "highlight staged (quasi-quoted) expressions" single ((:commit . "95daa710f3d8fc83f42c5da38003fc71ae0da1fc") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://hins11.yu-yake.com/"))])
+ (highlight-symbol . [(20160102 2009) nil "automatic and manual symbol highlighting" single ((:commit . "7a789c779648c55b16e43278e51be5898c121b3a") (:authors ("Nikolaj Schumacher <bugs * nschum de>")) (:maintainer "Nikolaj Schumacher <bugs * nschum de>") (:keywords "faces" "matching") (:url . "http://nschum.de/src/emacs/highlight-symbol/"))])
+ (highlight-thing . [(20181229 1301) nil "Minimalistic minor mode to highlight current thing under point." single ((:commit . "561d08a26f78f18d405d4f371f1c813db094e2f3") (:authors ("Felix Geller" . "fgeller@gmail.com")) (:maintainer "Felix Geller" . "fgeller@gmail.com") (:keywords "highlight" "thing" "symbol") (:url . "https://github.com/fgeller/highlight-thing.el"))])
+ (highlight-unique-symbol . [(20130612 542) ((deferred (0 3 2))) "highlight symbols which not appear in the repository" single ((:commit . "4141bf86a94e30d94d9af9c29d40b16886226e1c") (:authors ("hitode909" . "hitode909@gmail.com")) (:maintainer "hitode909" . "hitode909@gmail.com") (:url . "https://github.com/hitode909/emacs-highlight-unique-symbol"))])
+ (highlight2clipboard . [(20151020 1840) ((htmlize (1 47))) "Copy text to clipboard with highlighting." tar ((:commit . "6ce58a060d9c5843ccb8c79ec2bba7858c68ac15") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "tools"))])
+ (hindent . [(20210201 148) ((cl-lib (0 5))) "Indent haskell code using the \"hindent\" program" single ((:commit . "f7e7b12fd119e91c795cbe21bebf7b5af5d273b8") (:authors ("Chris Done" . "chrisdone@gmail.com")) (:maintainer "Chris Done" . "chrisdone@gmail.com") (:url . "https://github.com/chrisdone/hindent"))])
+ (hippie-exp-ext . [(20160502 2326) nil "Extension of hippie-expand" single ((:commit . "4eda13f90da51ab217d024701f4c30f91ffcb90e") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "abbrev" "convenience" "completions" "hippie-expand") (:url . "http://www.emacswiki.org/emacs/download/hippie-exp-ext.el"))])
+ (hippie-expand-slime . [(20170723 146) nil "Hook slime's completion into hippie-expand" single ((:commit . "39bbae94896a62854d31754debdfae71d35fec62") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:url . "https://github.com/purcell/hippie-expand-slime"))])
+ (hippie-namespace . [(20140508 2041) nil "Special treatment for namespace prefixes in hippie-expand" single ((:commit . "d0d0f15c67ab8bef5e9d1e29a89ecd3613a60b49") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "convenience" "lisp" "tools" "completion") (:url . "http://github.com/rolandwalker/hippie-namespace"))])
+ (historian . [(20200203 1927) ((emacs (24 4))) "Persistently store selected minibuffer candidates" single ((:commit . "852cb4e72c0f78c8dbb2c972bdcb4e7b0108ff4c") (:authors ("PythonNut" . "pythonnut@pythonnut.com")) (:maintainer "PythonNut" . "pythonnut@pythonnut.com") (:keywords "convenience") (:url . "https://github.com/PythonNut/historian.el"))])
+ (history . [(20160821 1602) ((emacs (24 3))) "History utility for source code navigation" tar ((:commit . "5317663fb45bbd5e96d258cb0807dcc266ce67ff") (:authors ("boyw165")) (:maintainer "boyw165") (:url . "https://github.com/boyw165/history"))])
+ (historyf . [(20151124 159) nil "file history library like browser" single ((:commit . "196c058ceb092fdd56b0e4ce85b7e714d6f72224") (:authors ("k1LoW (Kenichirou Oyama), <k1lowxb [at] gmail [dot] com> <k1low [at] 101000lab [dot] org>")) (:maintainer "k1LoW (Kenichirou Oyama), <k1lowxb [at] gmail [dot] com> <k1low [at] 101000lab [dot] org>") (:url . "https://github.com/k1LoW/emacs-historyf"))])
+ (hive . [(20131217 1512) ((sql (3 0))) "Hive SQL mode extension" single ((:commit . "11b5172e081ad8079fc78758bef6f306f82ae32b") (:authors ("Roman Scherer" . "roman@burningswell.com")) (:maintainer "Roman Scherer" . "roman@burningswell.com") (:keywords "sql" "hive"))])
+ (hiwin . [(20150825 827) nil "Visible active window mode." single ((:commit . "6ee8ed051405653bd9b7332d7e9fbb591d954051") (:authors ("k.sugita")) (:maintainer "k.sugita") (:keywords "faces" "editing" "emulating"))])
+ (hl-anything . [(20160422 1708) ((emacs (24 3))) "Highlight symbols, selections, enclosing parens and more." tar ((:commit . "8696bc55a8cba408f0fc83a907a9ec529d79e558") (:authors ("boyw165")) (:maintainer "boyw165"))])
+ (hl-block-mode . [(20220507 1118) ((emacs (26 1))) "Highlighting nested blocks" single ((:commit . "7e0452c768a4e309d1cdc15025683ebfe71e626f") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://codeberg.com/ideasman42/emacs-hl-block-mode"))])
+ (hl-fill-column . [(20200607 757) ((names (0 5)) (emacs (24))) "Highlight fill column." single ((:commit . "5782a91ba0182c4e562fa0db6379ff9dd472856b") (:keywords "fill column" "faces") (:url . "https://github.com/laishulu/hl-fill-column"))])
+ (hl-indent . [(20170429 2104) ((emacs (24)) (cl-lib (0 5))) "Highlight irregular indentation." single ((:commit . "bdb2e0177a7c8b29af26998e688b856adc6ded93") (:authors ("Kirill Ignatiev <github.com/ikirill>")) (:maintainer "Kirill Ignatiev <github.com/ikirill>") (:keywords "convenience" "faces") (:url . "https://github.com/ikirill/hl-indent"))])
+ (hl-prog-extra . [(20220507 1118) ((emacs (26 2))) "Customizable highlighting for source-code" tar ((:commit . "a8e2ee5d43ce70c59e57d2ab90b39a6cf9e7b851") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:keywords "convenience") (:url . "https://codeberg.com/ideasman42/emacs-hl-prog-extra"))])
+ (hl-sentence . [(20171018 1519) nil "highlight a sentence based on customizable face" single ((:commit . "86ae38d3103bd20da5485cbdd59dfbd396c45ee4") (:authors ("Donald Ephraim Curtis" . "dcurtis@milkbox.net")) (:maintainer "Donald Ephraim Curtis" . "dcurtis@milkbox.net") (:keywords "highlighting") (:url . "http://github.com/milkypostman/hl-sentence"))])
+ (hl-todo . [(20220422 1611) ((emacs (25 1)) (compat (28 1 1 0))) "Highlight TODO and similar keywords" single ((:commit . "2337eac8cab0d4b73a96fb3936d2ac87600e3c91") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "convenience") (:url . "https://github.com/tarsius/hl-todo"))])
+ (hledger-mode . [(20210706 1225) ((emacs (24 4)) (popup (0 5 3)) (async (1 9)) (htmlize (1 47))) "A mode for writing journal entries for hledger." tar ((:commit . "9ac07ff0adbce6a402c17e789b1750f9da0d22f4") (:authors ("Narendra Joshi" . "narendraj9@gmail.com")) (:maintainer "Narendra Joshi" . "narendraj9@gmail.com") (:keywords "data") (:url . "https://github.com/narendraj9/hledger-mode.git"))])
+ (hlint-refactor . [(20190115 900) nil "Apply HLint suggestions" single ((:commit . "c4307f86aad6d02e32e9b30cb6edc115584c791c") (:keywords "haskell" "refactor") (:url . "https://github.com/mpickering/hlint-refactor-mode"))])
+ (hlinum . [(20180422 412) ((cl-lib (0 2))) "Extension for linum.el to highlight current line number" single ((:commit . "5646d9c0b9e7598b20b2004eab5439fdc6dbeda5") (:authors ("Tomoya Tanjo" . "ttanjo@gmail.com")) (:maintainer "Tomoya Tanjo" . "ttanjo@gmail.com") (:keywords "convenience" "extensions") (:url . "https://github.com/tom-tan/hlinum-mode/"))])
+ (hmac . [(20201004 1819) ((emacs (25 1))) "Hash-based message authentication code" single ((:commit . "f2b99a9a10becfff207cf9418c6dce78364b1a4b") (:authors ("Sean McAfee")) (:maintainer "Sean McAfee") (:url . "https://github.com/grimnebulin/emacs-hmac"))])
+ (hnreader . [(20220103 1909) ((emacs (25 1)) (promise (1 1)) (request (0 3 0)) (org (9 2))) "A hackernews reader" single ((:commit . "e17006072b0cd06ab7ff32c6187e9565131a78b2") (:authors ("Thanh Vuong" . "thanhvg@gmail.com")) (:maintainer "Thanh Vuong" . "thanhvg@gmail.com") (:url . "https://github.com/thanhvg/emacs-hnreader/"))])
+ (hoa-mode . [(20200610 1339) nil "Major mode for the HOA format" single ((:commit . "18f5c981e256f867f29a93376ccdc04717b159cd") (:authors ("Alexandre Duret-Lutz" . "adl@lrde.epita.fr")) (:maintainer "Alexandre Duret-Lutz" . "adl@lrde.epita.fr") (:keywords "major-mode" "automata" "convenience") (:url . "https://gitlab.lrde.epita.fr/spot/emacs-modes"))])
+ (holiday-pascha-etc . [(20160822 58) nil "Eastern Christian analog to holiday-easter-etc" single ((:commit . "eb198656f63cb8679fb0e3a8248782df071a0f3c") (:authors ("Mark A. Hershberger" . "mah@everybody.org")) (:maintainer "Mark A. Hershberger" . "mah@everybody.org") (:url . "http://github.com/hexmode/holiday-pascha-etc"))])
+ (holy-books . [(20211025 127) ((s (1 12 0)) (dash (2 16 0)) (emacs (27 1)) (org (9 1))) "Org-mode links/tooltips/lookups for Quran & Bible" single ((:commit . "02c2956d36631d3d8c8b4bacdcf0a5cdd1f3136d") (:authors ("Musa Al-hassy" . "alhassy@gmail.com")) (:maintainer "Musa Al-hassy" . "alhassy@gmail.com") (:keywords "quran" "bible" "links" "tooltips" "convenience" "comm" "hypermedia") (:url . "https://alhassy.github.io/holy-books/"))])
+ (home-end . [(20180817 855) ((emacs (24 3)) (keypress-multi-event (1 0))) "Smart multi-purpose home / end keys" single ((:commit . "fbddad2c1268720ce17662a232b48f666e489526") (:authors ("Boruch Baum" . "boruch_baum@gmx.com")) (:maintainer "Boruch Baum" . "boruch_baum@gmx.com") (:keywords "abbrev" "convenience" "wp" "keyboard") (:url . "https://www.github.com/Boruch_Baum/emacs-home-end"))])
+ (homebrew-mode . [(20210919 331) ((emacs (24 4)) (inf-ruby (2 4 0)) (dash (1 2 0))) "minor mode for editing Homebrew formulae" single ((:commit . "8c630c6f768b942a86a10750f720abc64a817cd0") (:authors ("Alex Dunn" . "dunn.alex@gmail.com")) (:maintainer "Alex Dunn" . "dunn.alex@gmail.com") (:keywords "homebrew" "brew" "ruby") (:url . "https://github.com/dunn/homebrew-mode"))])
+ (honcho . [(20190623 2120) ((emacs (25 1)) (sudo-edit (0 1))) "Run and manage long-running services" single ((:commit . "d5e6206dd23ff9305d976c52845c750a064aca4b") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "convenience") (:url . "https://github.com/emacs-pe/honcho.el"))])
+ (hookify . [(20141216 2209) ((s (1 9 0)) (dash (1 5 0))) "Interactive commands to create temporary hooks" single ((:commit . "21baae7393b07257de5796402fde0ca72fb00d77") (:authors ("Philippe Vaucher" . "philippe.vaucher@gmail.com")) (:maintainer "Philippe Vaucher" . "philippe.vaucher@gmail.com") (:keywords "hook" "convenience") (:url . "https://github.com/Silex/hookify"))])
+ (horizon-theme . [(20200720 1832) ((emacs (24 3))) "A beautifully warm dual theme" single ((:commit . "9595549c514a9376c61d5d303405f6a6982e9e46") (:url . "https://github.com/aodhneine/horizon-theme.el"))])
+ (horoscope . [(20180409 641) ((emacs (24))) "generate horoscopes." single ((:commit . "f4c683e991adce0a8f9023f15050f306f9b9a9ed") (:authors ("Bob Manson" . "manson@cygnus.com")) (:maintainer "Noah Friedman" . "friedman@prep.ai.mit.edu") (:keywords "extensions" "games") (:url . "https://github.com/mschuldt/horoscope.el"))])
+ (hotfuzz . [(20210924 936) ((emacs (27 1))) "Fuzzy completion style" single ((:commit . "95a1be449624aa2b25128b900b6211034d0e17bb") (:authors ("Axel Forsman" . "axelsfor@gmail.com")) (:maintainer "Axel Forsman" . "axelsfor@gmail.com") (:keywords "matching") (:url . "https://github.com/axelf4/hotfuzz"))])
+ (hound . [(20200122 1700) ((request (0 2 0)) (cl-lib (0 5))) "Display hound search results in a compilation window" single ((:commit . "35e2cdc81fcc904b450a7ef3ec00fd25df6a4431") (:authors ("Ryan Young")) (:maintainer "Ryan Young"))])
+ (hover . [(20220129 1935) ((emacs (25 2)) (dash (2 14 1))) "Package to use hover with flutter" single ((:commit . "4ca0638a14a8b304ac2b46e7b342b8d8732ad199") (:authors ("Eric Dallo")) (:maintainer "Eric Dallo") (:keywords "hover" "flutter" "mobile" "tools") (:url . "https://github.com/ericdallo/hover.el"))])
+ (howdoi . [(20150204 43) nil "Instant coding answers via Emacs." tar ((:commit . "5fbf7069ee160c597a328e5ce5fb32920e1ca88f") (:authors ("Andrey Tykhonov <atykhonov at gmail.com>")) (:maintainer "Andrey Tykhonov" . "atykhonov@gmail.com") (:keywords "howdoi" "convenience") (:url . "https://github.com/atykhonov/emacs-howdoi/"))])
+ (howdoyou . [(20210909 2000) ((emacs (25 1)) (promise (1 1)) (request (0 3 3)) (org (9 2))) "A stackoverflow and its sisters' sites reader" single ((:commit . "a01971a7279c8a031de78513c004d7a09d293712") (:authors ("Thanh Vuong" . "thanhvg@gmail.com")) (:maintainer "Thanh Vuong" . "thanhvg@gmail.com") (:url . "https://github.com/thanhvg/howdoyou/"))])
+ (howm . [(20211230 1221) ((cl-lib (0 5))) "Wiki-like note-taking tool" tar ((:commit . "c381e50f0c771c38306bda37bd972a37a36a5db5") (:authors ("HIRAOKA Kazuyuki" . "khi@users.osdn.me")) (:maintainer "HIRAOKA Kazuyuki" . "khi@users.osdn.me") (:url . "https://howm.osdn.jp"))])
+ (hsluv . [(20181127 1206) ((seq (2 20))) "hsluv color space conversions" single ((:commit . "c3bc5228e30d66e7dee9ff1a0694c2b976862fc0") (:authors ("Geert Vermeiren")) (:maintainer "Geert Vermeiren") (:keywords "color" "hsluv") (:url . "https://github.com/hsluv/hsluv-emacs"))])
+ (ht . [(20210119 741) ((dash (2 12 0))) "The missing hash table library for Emacs" single ((:commit . "c4c1be487d6ecb353d07881526db05d7fc90ea87") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:keywords "hash table" "hash map" "hash"))])
+ (html-check-frag . [(20201106 1748) ((emacs (24 3))) "Check html-fragments" single ((:commit . "b9d1f2003a126c2e8b6d469964ec2278ad55c9df") (:authors ("Tobias.Zawada" . "i@tn-home.de")) (:maintainer "Tobias.Zawada" . "i@tn-home.de") (:keywords "html"))])
+ (html-script-src . [(20120403 1815) nil "Insert <script src=\"..\"> for popular JavaScript libraries" single ((:commit . "66460f8ab1b24656e6f3ce5bd50cff6a81be8422") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "tools" "convenience") (:url . "http://github.com/rejeep/html-script-src"))])
+ (html-to-hiccup . [(20211129 944) ((emacs (25 1)) (dash (2 13 0)) (s (1 10 0))) "Convert HTML to Hiccup syntax" single ((:commit . "97ecc8cce11f577ad4406da0367aa5eeec1bd8c6") (:authors ("Arne Brasseur" . "arne@arnebrasseur.net")) (:maintainer "Arne Brasseur" . "arne@arnebrasseur.net") (:keywords "html" "hiccup" "clojure") (:url . "https://github.com/plexus/html-to-hiccup"))])
+ (html-to-markdown . [(20151105 840) ((cl-lib (0 5))) "HTML to Markdown converter written in Emacs-lisp." single ((:commit . "60c5498c801be186478cf7c05be05b4430c4a144") (:authors ("Artur Malabarba" . "bruce.connor.am@gmail.com")) (:maintainer "Artur Malabarba" . "bruce.connor.am@gmail.com") (:keywords "tools" "wp" "languages") (:url . "http://github.com/Bruce-Connor/html-to-markdown"))])
+ (html2org . [(20170418 501) ((emacs (24 4))) "Convert html to org format text" single ((:commit . "6904aed40259ad8afccff079ebd8a07bff319ebc") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "convenience" "html" "org") (:url . "http://github.com/lujun9972/html2org.el"))])
+ (htmlize . [(20210825 2150) nil "Convert buffer text and decorations to HTML." single ((:commit . "dd27bc3f26efd728f2b1f01f9e4ac4f61f2ffbf9") (:authors ("Hrvoje Niksic" . "hniksic@gmail.com")) (:maintainer "Hrvoje Niksic" . "hniksic@gmail.com") (:keywords "hypermedia" "extensions") (:url . "https://github.com/hniksic/emacs-htmlize"))])
+ (htmltagwrap . [(20200929 559) ((emacs (24 4))) "Wraps a chunk of HTML code in tags" single ((:commit . "049efcadbd9b51a601cca60fc78616bcef0799ae") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/htmltagwrap"))])
+ (http . [(20201010 920) ((emacs (24 4)) (request (0 2 0)) (edit-indirect (0 1 4))) "Yet another HTTP client" single ((:commit . "5fdceed1fbf36e274e578e349a53ce922c574774") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "convenience") (:url . "https://github.com/emacs-pe/http.el"))])
+ (http-post-simple . [(20170715 940) nil "HTTP POST requests using the url library" single ((:commit . "f53697fca278c741051aeb668b00466b5e0fd3fe") (:authors ("Tom Schutzer-Weissmann")) (:maintainer "Tom Schutzer-Weissmann") (:keywords "comm" "data" "processes" "hypermedia"))])
+ (http-twiddle . [(20160801 1911) nil "send & twiddle & resend HTTP requests" single ((:commit . "4d0c73b7dcbde8b483d4f3a75c49c74d2fe3ca45") (:authors ("Luke Gorrie" . "luke@synap.se")) (:maintainer "Hasan Veldstra" . "h@vidiowiki.com") (:keywords "http" "rest" "soap") (:url . "https://github.com/hassy/http-twiddle/blob/master/http-twiddle.el"))])
+ (httpcode . [(20121002 345) nil "explains the meaning of an HTTP status code" single ((:commit . "a45e735082b09477cd704a99294d336cdbeb12ba") (:authors ("Ruslan Spivak" . "ruslan.spivak@gmail.com")) (:maintainer "Ruslan Spivak" . "ruslan.spivak@gmail.com") (:url . "http://github.com/rspivak/httpcode.el"))])
+ (httprepl . [(20141101 1734) ((s (1 9 0)) (dash (2 5 0)) (emacs (24))) "An HTTP REPL" single ((:commit . "cfa3693267a8ed1c96a86a126823f37dbfe077d8") (:authors ("Greg Sexton" . "gregsexton@gmail.com")) (:maintainer "Greg Sexton" . "gregsexton@gmail.com") (:keywords "http" "repl") (:url . "https://github.com/gregsexton/httprepl.el"))])
+ (huecycle . [(20210830 340) ((emacs (27 1))) "Idle color animation" single ((:commit . "a05e32351dcff3e61b5f15800556adfe1939c112") (:authors ("Phillip O'Reggio <https://github.com/pnor>")) (:maintainer "Phillip O'Reggio") (:keywords "faces") (:url . "https://github.com/pnor/huecycle"))])
+ (hugsql-ghosts . [(20211124 1646) ((s (1 9 0)) (dash (2 10 0)) (cider (0 14 0))) "Display hugsql defqueries in clojure code as an overlay" single ((:commit . "7cd242cc2e70ac48959c42be725c81d7fe00b314") (:authors ("Roland Kaercher" . "roland.kaercher@gmail.com")) (:maintainer "Roland Kaercher" . "roland.kaercher@gmail.com") (:url . "https://github.com/rkaercher/hugsql-ghosts"))])
+ (humanoid-themes . [(20220305 930) ((emacs (24 3))) "Color themes with a dark and light variant" tar ((:commit . "5828705bcc3eab9af9dd36fd7dc96d48c3020d85") (:authors ("Thomas Friese")) (:maintainer "Thomas Friese") (:keywords "faces" "color" "theme") (:url . "https://github.com/humanoid-colors/emacs-humanoid-themes"))])
+ (hungarian-holidays . [(20161020 1138) nil "Adds a list of Hungarian public holidays to Emacs calendar" single ((:commit . "653108769279499d84a79267c90e640d98823872") (:authors ("Gergely Polonkai" . "gergely@polonkai.eu")) (:maintainer "Gergely Polonkai" . "gergely@polonkai.eu") (:keywords "calendar"))])
+ (hungry-delete . [(20210409 1643) nil "hungry delete minor mode" single ((:commit . "d919e555e5c13a2edf4570f3ceec84f0ade71657") (:authors ("Nathaniel Flath" . "flat0103@gmail.com")) (:maintainer "Nathaniel Flath" . "flat0103@gmail.com") (:url . "http://github.com/nflath/hungry-delete"))])
+ (hy-mode . [(20211016 2011) ((dash (2 18 0)) (s (1 11 0)) (emacs (24))) "Major mode for Hylang" tar ((:commit . "df814865a1faa8414dacdbb35b2a9029995312ec") (:keywords "languages" "lisp" "python") (:url . "http://github.com/hylang/hy-mode"))])
+ (hyai . [(20170301 1447) ((cl-lib (0 5)) (emacs (24))) "Haskell Yet Another Indentation" single ((:commit . "9efad2ac6a57059b3be624588f649e276a96fdd4") (:authors ("Iku Iwasa" . "iku.iwasa@gmail.com")) (:maintainer "Iku Iwasa" . "iku.iwasa@gmail.com") (:url . "https://github.com/iquiw/hyai"))])
+ (hybrid-reverse-theme . [(20210806 1955) ((emacs (24 1))) "Emacs theme with material color scheme" single ((:commit . "cb784a69e60938efe14b48130558f1bb1af92d3c") (:authors ("Riyyi")) (:maintainer "Riyyi") (:keywords "faces" "theme") (:url . "https://github.com/riyyi/emacs-hybrid-reverse"))])
+ (hydandata-light-theme . [(20190809 1925) nil "A light color theme that is easy on your eyes" single ((:commit . "180c3797fa7ef3e4bb679baaf5b492c33bbb9b8b") (:authors ("David Chkhikvadze" . "david@chkhd.net")) (:maintainer "David Chkhikvadze" . "david@chkhd.net") (:keywords "color-theme" "theme") (:url . "https://github.com/chkhd/hydandata-light-theme"))])
+ (hyde . [(20160508 308) nil "Major mode to help create and manage Jekyll blogs" tar ((:commit . "a8cd6ed00ecd8d7de0ded2f4867015b412b15b76"))])
+ (hydra . [(20220102 803) ((cl-lib (0 5)) (lv (0))) "Make bindings that stick around." tar ((:commit . "9e9e00cb240ea1903ffd36a54956b3902c379d29") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "bindings") (:url . "https://github.com/abo-abo/hydra"))])
+ (hyperkitty . [(20220226 1951) ((request (0 3 2)) (emacs (25 1))) "Emacs interface for Hyperkitty archives" single ((:commit . "2c1d22ff017d096c359aa151e6a29f7214a58118") (:authors ("Abhilash Raj" . "maxking@asynchronous.in")) (:maintainer "Abhilash Raj" . "maxking@asynchronous.in") (:keywords "mail" "hyperkitty" "mailman") (:url . "https://github.com/maxking/hyperkitty.el"))])
+ (hyperlist-mode . [(20200515 2209) ((emacs (24))) "A major-mode for viewing Hyperlists" single ((:commit . "374cdc04761df23e7a50ca276319ba9745cda9d7") (:authors ("Wojciech Siewierski")) (:maintainer "Wojciech Siewierski") (:keywords "outlines") (:url . "https://github.com/vifon/hyperlist-mode"))])
+ (hyperspace . [(20210603 1825) ((emacs (25)) (s (1 12 0))) "Get there from here" single ((:commit . "c4c363c140250ba6b775516082063878975a6154") (:authors ("Ian Eure" . "ian@retrospec.tv")) (:maintainer "Ian Eure" . "ian@retrospec.tv") (:keywords "tools" "convenience") (:url . "https://github.com/ieure/hyperspace-el"))])
+ (i-ching . [(20211112 1528) ((emacs (25 1)) (request (0 3))) "The Book of Changes" tar ((:commit . "992f53ae2bd572b89bc642ca70b8bdaa5eb2553f") (:authors ("nik gaffney" . "nik@fo.am")) (:maintainer "nik gaffney" . "nik@fo.am") (:keywords "games" "divination" "stochastism" "cleromancy" "change") (:url . "https://github.com/zzkt/i-ching"))])
+ (i2b2-mode . [(20140710 104) nil "Highlights corresponding PHI data in the text portion of an i2b2 XML Document." single ((:commit . "db10efcfc8bed369a516bbf7526ede41f98cb95a") (:authors ("Dan LaManna" . "dan.lamanna@gmail.com")) (:maintainer "Dan LaManna" . "dan.lamanna@gmail.com") (:keywords "xml" "phi" "i2b2" "deidi2b2"))])
+ (i3wm . [(20170822 1438) nil "i3wm integration library" single ((:commit . "71391dc61063fee77ad174f3b2ca25c60b41009e") (:authors ("Samuel W. Flint" . "swflint@flintfam.org")) (:maintainer "Samuel W. Flint" . "swflint@flintfam.org") (:keywords "convenience" "extensions") (:url . "https://git.flintfam.org/swf-projects/emacs-i3"))])
+ (i3wm-config-mode . [(20201105 2022) ((emacs (24 1))) "Better syntax highlighting for i3wm's config file" single ((:commit . "c70bdc1367e461299e13a4797bc9d9d950184edd") (:authors ("Alexander Miller" . "alexanderm@web.de")) (:maintainer "Alexander Miller" . "alexanderm@web.de") (:keywords "faces" "languages" "i3wm" "font-lock") (:url . "https://github.com/Alexander-Miller/i3wm-Config-Mode"))])
+ (ialign . [(20200711 1117) ((emacs (24 4))) "visual align-regexp" single ((:commit . "eca40b8b59ea713dba21b18f5b047a6c086b91dc") (:authors ("Michał Krzywkowski" . "k.michal@zoho.com")) (:maintainer "Michał Krzywkowski" . "k.michal@zoho.com") (:keywords "tools" "editing" "align" "interactive") (:url . "https://github.com/mkcms/interactive-align"))])
+ (iasm-mode . [(20171023 1422) nil "interactive assembly major mode." single ((:commit . "abbec7f308f9ce97beeb57e459fff35f559b4c18") (:authors ("Rémi Attab" . "remi.attab@gmail.com")) (:maintainer "Rémi Attab" . "remi.attab@gmail.com") (:keywords ":" "tools") (:url . "https://github.com/RAttab/iasm-mode"))])
+ (ibuffer-git . [(20110508 731) nil "show git status in ibuffer column" single ((:commit . "d326319c05ddb8280885b31f9094040c1b365876") (:authors ("Jonathan Rockway" . "jon@jrock.us")) (:maintainer "Jonathan Rockway" . "jon@jrock.us") (:keywords "convenience"))])
+ (ibuffer-project . [(20220321 1312) ((emacs (25 1))) "Group ibuffer's list by project or any function" single ((:commit . "bfc0ec1f27b02b8ab816dcfd9073e5d78dae1aed") (:authors ("Andrii Kolomoiets" . "andreyk.mad@gmail.com")) (:maintainer "Andrii Kolomoiets" . "andreyk.mad@gmail.com") (:keywords "tools") (:url . "https://github.com/muffinmad/emacs-ibuffer-project"))])
+ (ibuffer-projectile . [(20200805 604) ((projectile (0 11 0)) (emacs (24 1))) "Group ibuffer's list by projectile root" single ((:commit . "ecbe482804a217b1471593f6c7a8b3d64f3cdc47") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "convenience") (:url . "https://github.com/purcell/ibuffer-projectile"))])
+ (ibuffer-rcirc . [(20150215 2118) ((cl-lib (0 2))) "Ibuffer integration for rcirc" single ((:commit . "8a4409b1c679d65c819dee4085faf929840e79f8") (:authors ("Fabián Ezequiel Gallina" . "fgallina@gnu.org")) (:maintainer "Fabián Ezequiel Gallina" . "fgallina@gnu.org") (:keywords "buffer" "convenience" "comm") (:url . "https://github.com/fgallina/ibuffer-rcirc"))])
+ (ibuffer-sidebar . [(20210508 836) ((emacs (25 1))) "Sidebar for `ibuffer'" single ((:commit . "fb685e1e43db979e25713081d8ae4073453bbd5e") (:authors ("James Nguyen" . "james@jojojames.com")) (:maintainer "James Nguyen" . "james@jojojames.com") (:keywords "ibuffer" "files" "tools") (:url . "https://github.com/jojojames/ibuffer-sidebar"))])
+ (ibuffer-tramp . [(20151118 1739) nil "Group ibuffer's list by TRAMP connection" single ((:commit . "bcad0bda3a67f55d1be936bf8fa9ef735fe1e3f3") (:authors ("Svend Sorensen" . "svend@ciffer.net")) (:maintainer "Svend Sorensen" . "svend@ciffer.net") (:keywords "convenience") (:url . "http://github.com/svend/ibuffer-tramp"))])
+ (ibuffer-vc . [(20200805 604) ((emacs (24 1)) (cl-lib (0 2))) "Group ibuffer's list by VC project, or show VC status" single ((:commit . "5fa6aea09bc67f71ea743302d609f459967b1e81") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "convenience") (:url . "https://github.com/purcell/ibuffer-vc"))])
+ (iceberg-theme . [(20200812 943) ((emacs (26 1)) (solarized-theme (1 3))) "Well-designed, eye-friendly, dark blue color scheme" single ((:commit . "183b41eae07d94d4a8f299306078410bddc41d34") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience") (:url . "https://github.com/conao3/iceberg-theme.el"))])
+ (icomplete-vertical . [(20220418 2119) ((emacs (26 1))) "Display icomplete candidates vertically" tar ((:commit . "f5775d535630199703c936380d210d38249b342c") (:authors ("Omar Antolín Camarena" . "omar@matem.unam.mx")) (:maintainer "Omar Antolín Camarena" . "omar@matem.unam.mx") (:keywords "convenience" "completion") (:url . "https://github.com/oantolin/icomplete-vertical"))])
+ (icsql . [(20210612 1340) ((emacs (26)) (choice-program (0 13)) (buffer-manage (0 12))) "Interactive iSQL iteraface to ciSQL" single ((:commit . "4521e9d2debef7687bfd26a664479f0c46688a36") (:authors ("Paul Landes")) (:maintainer "Paul Landes") (:keywords "isql" "sql" "rdbms" "data") (:url . "https://github.com/plandes/icsql"))])
+ (id-manager . [(20170320 1246) nil "id-password management" single ((:commit . "14ebc35db298aac4dedc8aa188bc46bacab81f3b") (:authors ("SAKURAI Masashi <m.sakurai atmark kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai atmark kiwanami.net>") (:keywords "password" "convenience"))])
+ (idea-darkula-theme . [(20160416 2303) ((emacs (24 1))) "Color theme based on IntelliJ IDEA Darkula color theme" single ((:commit . "52602d9b91883e1f297d000951aeed48bf60176e") (:authors ("Alexey Veretennikov <alexey dot veretennikov at gmail dot com>")) (:maintainer "Alexey Veretennikov <alexey dot veretennikov at gmail dot com>") (:keywords "themes") (:url . "http://github.com/fourier/idea-darkula-theme"))])
+ (identica-mode . [(20130204 2253) nil "Major mode API client for status.net open microblogging" tar ((:commit . "cf9183ee11ac922e85c7c908f04e2d00b03111b3") (:authors ("Gabriel Saldana" . "gsaldana@gmail.com")) (:maintainer "Gabriel Saldana" . "gsaldana@gmail.com") (:keywords "identica" "web") (:url . "http://blog.gabrielsaldana.org/identica-mode-for-emacs/"))])
+ (idle-highlight-in-visible-buffers-mode . [(20181027 1531) nil "highlight the word the point is on" single ((:commit . "8d8de309d5bd4b035c01bf7f0cfc6e079c79d898") (:authors ("Ignacy Moryc")) (:maintainer "Ignacy Moryc") (:keywords "convenience") (:url . "https://github.com/ignacy/idle-highlight-in-visible-buffers"))])
+ (idle-highlight-mode . [(20220507 1118) ((emacs (27 1))) "Highlight the word the point is on" single ((:commit . "5418252a11b00377a59295e50b7436f53afe68bb") (:authors ("Phil Hagelberg, Cornelius Mika, Campbell Barton")) (:maintainer "Phil Hagelberg, Cornelius Mika, Campbell Barton") (:keywords "convenience") (:url . "https://codeberg.com/ideasman42/emacs-idle-highlight-mode"))])
+ (idle-org-agenda . [(20190106 1844) nil "Shows your agenda when editor is idle." single ((:commit . "8e6052fc4923c30132052d67d794b76c92851c20") (:authors ("John Wiegley" . "jwiegley@gmail.com")) (:maintainer "Enis Özgen" . "mail@enisozgen.com") (:keywords "org" "org-mode" "org-agenda" "calendar") (:url . "https://github.com/enisozgen/idle-org-agenda"))])
+ (idle-require . [(20090715 2203) nil "load elisp libraries while Emacs is idle" single ((:commit . "33592bb098223b4432d7a35a1d65ab83f47c1ec1") (:authors ("Nikolaj Schumacher <bugs * nschum de>")) (:maintainer "Nikolaj Schumacher <bugs * nschum de>") (:keywords "internal") (:url . "http://nschum.de/src/emacs/idle-require/"))])
+ (ido-at-point . [(20151021 757) ((emacs (24))) "ido-style completion-at-point" single ((:commit . "e5907bbe8a3d148d07698b76bd994dc3076e16ee") (:authors ("katspaugh")) (:maintainer "katspaugh") (:keywords "convenience" "abbrev") (:url . "https://github.com/katspaugh/ido-at-point"))])
+ (ido-complete-space-or-hyphen . [(20210206 1505) nil "Allow spaces to also match hyphens in ido" single ((:commit . "d1244243e042b8d5b6b991db752a17a44ea169bc") (:authors ("Ryan C. Thompson" . "rct@thompsonclan.org") ("Ian Yang <me (at) iany.me>")) (:maintainer "Ryan C. Thompson" . "rct@thompsonclan.org") (:keywords "ido" "completion" "convenience") (:url . "https://github.com/DarwinAwardWinner/ido-complete-space-or-hyphen"))])
+ (ido-completing-read+ . [(20210529 1318) ((emacs (24 4)) (seq (0 5)) (memoize (1 1))) "A completing-read-function using ido" single ((:commit . "49e7967ea8c0ab0a206b40d70fc19be115083fa1") (:authors ("Ryan C. Thompson" . "rct@thompsonclan.org")) (:maintainer "Ryan C. Thompson" . "rct@thompsonclan.org") (:keywords "ido" "completion" "convenience") (:url . "https://github.com/DarwinAwardWinner/ido-completing-read-plus"))])
+ (ido-exit-target . [(20170717 1851) ((emacs (24 4))) "Commands and keys for selecting other window and frame targets within ido" single ((:commit . "e56fc6928649c87ccf39d56d84ab53ebaced1f73") (:authors ("justin talbott" . "justin@waymondo.com")) (:maintainer "justin talbott" . "justin@waymondo.com") (:keywords "convenience" "tools" "extensions") (:url . "https://github.com/waymondo/ido-exit-target"))])
+ (ido-flex-with-migemo . [(20190408 350) ((flx-ido (0 6 1)) (migemo (1 9 1)) (emacs (24 4))) "use ido with flex and migemo" single ((:commit . "da64f2fe3849492d35e155d81a817308a4853473") (:authors ("ROCKTAKEY " . "rocktakey@gmail.com")) (:maintainer "ROCKTAKEY " . "rocktakey@gmail.com") (:keywords "matching") (:url . "https://github.com/ROCKTAKEY/ido-flex-with-migemo"))])
+ (ido-gnus . [(20140216 1646) ((gnus (5 13))) "Access gnus groups or servers using ido" single ((:commit . "f5fe3f6aa8086f675ba216abace9e3d5f2e3a089") (:authors ("Joe Bloggs" . "vapniks@yahoo.com")) (:maintainer "Joe Bloggs" . "vapniks@yahoo.com") (:keywords "comm") (:url . "https://github.com/vapniks/ido-gnus"))])
+ (ido-grid-mode . [(20160122 1139) ((emacs (24 4))) "Display ido-prospects in the minibuffer in a grid." single ((:commit . "7cfca3988a6dc3ad18e28abe114218095ff2366f") (:authors ("Tom Hinton")) (:maintainer "Tom Hinton" . "t@larkery.com") (:keywords "convenience") (:url . "https://github.com/larkery/ido-grid-mode.el"))])
+ (ido-hacks . [(20190206 2153) nil "Put more IDO in your IDO" single ((:commit . "d2153a3e8d23436ee07ecae2a106f434361a10c5") (:authors ("Andreas Politz")) (:maintainer "Scott Jaderholm" . "jaderholm@gmail.com") (:keywords "convenience"))])
+ (ido-load-library . [(20140611 1600) ((persistent-soft (0 8 8)) (pcache (0 2 3))) "Load-library alternative using ido-completing-read" single ((:commit . "e03b55957c93aa1a7dd190e173e16ec59dbb2ba7") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "maint" "completion") (:url . "http://github.com/rolandwalker/ido-load-library"))])
+ (ido-migemo . [(20191017 1919) ((migemo (1 9 1))) "Migemo plug-in for Ido" single ((:commit . "09a2cc175b500cab7655a25ffc982e78d46ca669") (:authors ("myuhe <yuhei.maeda_at_gmail.com>")) (:maintainer "myuhe") (:keywords "files") (:url . "https://github.com/myuhe/ido-migemo.el"))])
+ (ido-occasional . [(20150214 1248) ((emacs (24 1))) "Use ido where you choose." single ((:commit . "d405f1795e1e0c63be411ee2825184738d29c33a") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "completion") (:url . "https://github.com/abo-abo/ido-occasional"))])
+ (ido-select-window . [(20131220 2047) ((emacs (24 1))) "Select a window using ido and buffer names" single ((:commit . "a64707d8d154664d50d12e26417d586e4c3dd78b") (:authors ("Peter Jones" . "pjones@devalot.com")) (:maintainer "Peter Jones" . "pjones@devalot.com") (:url . "https://github.com/pjones/ido-select-window"))])
+ (ido-skk . [(20151111 950) ((emacs (24 4)) (ddskk (20150912 1820))) "ido interface for skk henkan" single ((:commit . "89a2e62799bff2841ff634517c86084c4ce69246") (:authors ("tsukimizake <shomasd_at_gmail.com>")) (:maintainer "tsukimizake <shomasd_at_gmail.com>") (:keywords "languages") (:url . "https://github.com/tsukimizake/ido-skk"))])
+ (ido-sort-mtime . [(20171121 859) nil "Sort Ido's file list by modification time" single ((:commit . "f638ff0c922af862f5211779f2311a27fde428eb") (:authors ("Paweł Kraśnicki")) (:maintainer "Paweł Kraśnicki") (:keywords "convenience" "files"))])
+ (ido-springboard . [(20170106 755) nil "Temporarily change default-directory for one command" single ((:commit . "687d1e5898a880878995dc9bffe93b4598366203") (:authors ("John Wiegley" . "jwiegley@gmail.com")) (:maintainer "John Wiegley" . "jwiegley@gmail.com") (:keywords "ido") (:url . "https://github.com/jwiegley/springboard"))])
+ (ido-vertical-mode . [(20210205 436) ((emacs (24 4))) "Makes ido-mode display vertically" single ((:commit . "b1659e967da0687abceca733b389ace24004fa66") (:authors ("Steven Degutis")) (:maintainer "Christopher Reichert" . "creichert07@gmail.com") (:keywords "convenience") (:url . "https://github.com/creichert/ido-vertical-mode.el"))])
+ (ido-yes-or-no . [(20161108 2351) ((ido-completing-read+ (0))) "Use Ido to answer yes-or-no questions" single ((:commit . "c55383b1fce5879e87e7ca6809fc60534508e182") (:authors ("Ryan C. Thompson")) (:maintainer "Ryan C. Thompson") (:keywords "convenience" "completion" "ido") (:url . "https://github.com/DarwinAwardWinner/ido-yes-or-no"))])
+ (idomenu . [(20141123 2120) nil "imenu tag selection a la ido" single ((:commit . "4b0152d606360c70204fb4c27f68de79ca885386") (:authors ("Georg Brandl" . "georg@python.org")) (:maintainer "Georg Brandl" . "georg@python.org"))])
+ (idris-mode . [(20220105 1300) ((emacs (24)) (prop-menu (0 1)) (cl-lib (0 5))) "Major mode for editing Idris code" tar ((:commit . "65d6db1b7574ceccd3d97eee3790c2f74aa9724d") (:keywords "languages") (:url . "https://github.com/idris-hackers/idris-mode"))])
+ (ids-edit . [(20170818 1502) ((emacs (24 3))) "IDS (Ideographic Description Sequence) editing tool" tar ((:commit . "8562a6cbfb3f2d44bc6f62ab15081a80f8fee502") (:authors ("KAWABATA, Taichi <kawabata.taichi_at_gmail.com>")) (:maintainer "KAWABATA, Taichi <kawabata.taichi_at_gmail.com>") (:keywords "i18n" "wp") (:url . "http://github.com/kawabata/ids-edit"))])
+ (iedit . [(20220216 717) nil "Edit multiple regions in the same way simultaneously." tar ((:commit . "27c61866b1b9b8d77629ac702e5f48e67dfe0d3b") (:authors ("Victor Ren" . "victorhge@gmail.com")) (:maintainer "Victor Ren" . "victorhge@gmail.com") (:keywords "occurrence" "region" "simultaneous" "refactoring") (:url . "https://github.com/victorhge/iedit"))])
+ (ietf-docs . [(20190420 851) nil "Fetch, Cache and Load IETF documents" single ((:commit . "ae157549eae5ec78dcbf215c2f48cb662b73abd0") (:authors ("Christian E. Hopps" . "chopps@gmail.com")) (:maintainer "Christian E. Hopps" . "chopps@gmail.com") (:keywords "ietf" "rfc") (:url . "https://github.com/choppsv1/ietf-docs"))])
+ (iflipb . [(20210907 1717) nil "Interactively flip between recently visited buffers" single ((:commit . "2854e73cebb463007b686a784b66242999c3366b") (:authors ("Joel Rosdahl" . "joel@rosdahl.net")) (:maintainer "Joel Rosdahl" . "joel@rosdahl.net") (:url . "https://github.com/jrosdahl/iflipb"))])
+ (ignoramus . [(20210515 1422) ((emacs (24 3))) "Ignore backups, build files, et al." single ((:commit . "e509e134eeb81617414e5381b610108c967dbc45") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "convenience" "tools") (:url . "http://github.com/rolandwalker/ignoramus"))])
+ (igv . [(20141210 1227) nil "Control Integrative Genomic Viewer within Emacs" single ((:commit . "47ac6ceede252f451348a2c696398c0cb5279555") (:authors ("Stefano Barbi" . "stefanobarbi@gmail.com")) (:maintainer "Stefano Barbi" . "stefanobarbi@gmail.com"))])
+ (image+ . [(20150707 1616) ((cl-lib (0 3))) "Image manipulate extensions for Emacs" single ((:commit . "6834d0c09bb4df9ecc0d7a559bd7827fed48fffc") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "multimedia" "extensions") (:url . "https://github.com/mhayashi1120/Emacs-imagex"))])
+ (image-archive . [(20150621 132) ((emacs (24)) (cl-lib (0 5))) "Image thumbnails in archive file with non-blocking" single ((:commit . "8d29535bd832329ffeeac780aae7aa8919af1175") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "multimedia") (:url . "https://github.com/mhayashi1120/Emacs-image-archive"))])
+ (image-dired+ . [(20150430 544) ((cl-lib (0 3))) "Image-dired extensions" single ((:commit . "b68094625d963056ad64e0e44af0e2266b2eadc7") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "extensions" "multimedia") (:url . "https://github.com/mhayashi1120/Emacs-image-diredx"))])
+ (imakado . [(20141024 923) nil "imakado's usefull macros and functions" single ((:commit . "00a1e7eea2cb9e9066343a23927d6c747707902f") (:authors ("imakado <ken.imakado_at_gmail.com>")) (:maintainer "imakado") (:keywords "convenience") (:url . "https://github.com/imakado/emacs-imakado"))])
+ (imake . [(20220422 1611) ((emacs (25 1)) (compat (28 1 1 0))) "Simple, opinionated make target runner" single ((:commit . "4dbc59789835396fdc76bfde4ae4971c8a9ceaed") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "convenience") (:url . "https://github.com/tarsius/imake"))])
+ (imapfilter . [(20180318 2027) nil "run the imapfilter executable" single ((:commit . "79bbbe918319bc1e8f42a0bef53dc7c77fe868ea") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "mail") (:url . "https://github.com/tarsius/imapfilter"))])
+ (imbot . [(20210423 731) ((emacs (25 1))) "Automatic system input method switcher" tar ((:commit . "a90183954522876ebbf1ce96d88b80e6a31b9d34") (:keywords "convenience") (:url . "https://github.com/QiangF/imbot"))])
+ (imenu-anywhere . [(20210201 1704) ((cl-lib (0 5)) (emacs (25))) "ido/ivy/helm imenu across same mode/project/etc buffers" single ((:commit . "06ec33d79e33edf01b9118aead1eabeae8ee08b1") (:authors ("Vitalie Spinu <spinuvit.list[ aaattt ]gmail[ dot ]com>")) (:maintainer "Vitalie Spinu <spinuvit.list[ aaattt ]gmail[ dot ]com>") (:keywords "ido" "imenu" "tags") (:url . "https://github.com/vitoshka/imenu-anywhere"))])
+ (imenu-extra . [(20201229 1035) ((emacs (25 1))) "Add extra items into existing imenu items" single ((:commit . "a8d867e7cc446afcd4dc71d4f528e58d639840e1") (:authors ("Chen Bin <chenbin DOT sh AT gmail DOT com>")) (:maintainer "Chen Bin <chenbin DOT sh AT gmail DOT com>") (:keywords "convenience") (:url . "https://github.com/redguardtoo/imenu-extra"))])
+ (imenu-list . [(20210420 1200) ((emacs (24 3))) "Show imenu entries in a separate buffer" single ((:commit . "76f2335ee6f2f066d87fe4e4729219d70c9bc70d") (:authors ("Bar Magal (2015)")) (:maintainer "Bar Magal (2015)") (:url . "https://github.com/bmag/imenu-list"))])
+ (imenus . [(20200730 855) ((cl-lib (0 5))) "Imenu for multiple buffers and without subgroups" single ((:commit . "90200f5f22377903b405082eabe185447968f3e2") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "tools" "convenience") (:url . "https://github.com/alezost/imenus.el"))])
+ (imgbb . [(20180609 1649) ((emacs (24)) (request (0 3 0))) "Simple image upload client for imgbb.com" single ((:commit . "a524a46263835aa474f908827ebab4e8fa586001") (:authors ("Peter" . "craven@gmx.net")) (:maintainer "Peter" . "craven@gmx.net") (:keywords "extensions") (:url . "https://github.com/ecraven/imgbb.el"))])
+ (immaterial-theme . [(20220214 1859) ((emacs (25))) "A flexible theme based on material design principles" tar ((:commit . "ca82a1700cf7834b55ada36e53811f6effde6283") (:authors ("Peter Gardfjäll")) (:maintainer "Peter Gardfjäll") (:keywords "themes") (:url . "https://github.com/petergardfjall/emacs-immaterial-theme"))])
+ (immortal-scratch . [(20160517 2118) nil "respawn the scratch buffer when it's killed" single ((:commit . "faeab0ad6c33c74c0cbd1dfcebffaa0690de40c6") (:authors ("Jonathan Kotta" . "jpkotta@gmail.com")) (:maintainer "Jonathan Kotta" . "jpkotta@gmail.com"))])
+ (immutant-server . [(20140311 2208) nil "Run your Immutant server in Emacs" single ((:commit . "2a21e65588acb6a976f2998e30b21fdabdba4dbb") (:authors ("David Leatherman" . "leathekd@gmail.com")) (:maintainer "David Leatherman" . "leathekd@gmail.com") (:url . "http://www.github.com/leathekd/immutant-server.el"))])
+ (impatient-mode . [(20200723 2117) ((emacs (24 3)) (simple-httpd (1 5 0)) (htmlize (1 40))) "Serve buffers live over HTTP" tar ((:commit . "479a2412596ff1dbdddeb7bdbba45482ce5b230c") (:authors ("Brian Taylor" . "el.wubo@gmail.com")) (:maintainer "Brian Taylor" . "el.wubo@gmail.com") (:url . "https://github.com/netguy204/imp.el"))])
+ (impatient-showdown . [(20200914 221) ((emacs (24 3)) (impatient-mode (1 1))) "Preview markdown buffer live over HTTP using showdown" tar ((:commit . "6825147ebacb1d738b1c96baf0534a5ed3e6b289") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/impatient-showdown"))])
+ (import-js . [(20220215 1948) ((grizzl (0 1 0)) (emacs (24))) "Import Javascript dependencies" single ((:commit . "d2bbb53f96395415f9f01de4fa88d82c1f59ba63") (:authors ("Kevin Kehl" . "kevin.kehl@gmail.com")) (:maintainer "Kevin Kehl" . "kevin.kehl@gmail.com") (:keywords "javascript") (:url . "http://github.com/Galooshi/emacs-import-js/"))])
+ (import-popwin . [(20170218 1407) ((emacs (24 3)) (popwin (0 6))) "popwin buffer near by import statements with popwin" single ((:commit . "bb05a9e226f8c63fe7b18a3e92010357049ab5ba") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-import-popwin"))])
+ (importmagic . [(20180520 303) ((f (0 11 0)) (epc (0 1 0)) (emacs (24 3))) "Fix Python imports using importmagic." tar ((:commit . "701dfcca5f3ab42be0f26a8d381d7116c79be850") (:authors ("Nicolás Salas V." . "nikosalas@gmail.com")) (:maintainer "Nicolás Salas V." . "nikosalas@gmail.com") (:keywords "languages" "convenience") (:url . "https://github.com/anachronic/importmagic.el"))])
+ (impostman . [(20220102 1856) ((emacs (27 1))) "Import Postman collections" single ((:commit . "5b122f3d5a3421aa2d89bdc9dc4aafaf19cf85d4") (:authors ("Sébastien Helleu" . "flashcode@flashtux.org")) (:maintainer "Sébastien Helleu" . "flashcode@flashtux.org") (:keywords "tools") (:url . "https://github.com/flashcode/impostman"))])
+ (indent-control . [(20220227 653) ((emacs (26 1))) "Management for indentation level" single ((:commit . "6fb6c9326077105febe2cd9c77b683b7c310cf03") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/indent-control"))])
+ (indent-guide . [(20210115 400) nil "show vertical lines to guide indentation" single ((:commit . "d388c3387781a370ca13233ff445d03f3c5cf12f") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://hins11.yu-yake.com/"))])
+ (indent-info . [(20210111 745) ((emacs (24 3))) "Show indentation information in status bar" single ((:commit . "05a787afeb9946714d8b0c724868195a678db49e") (:authors ("Terje Larsen" . "terlar@gmail.com")) (:maintainer "Terje Larsen" . "terlar@gmail.com") (:keywords "convenience" "tools") (:url . "https://github.com/terlar/indent-info.el"))])
+ (indent-lint . [(20200812 949) ((emacs (25 1)) (async-await (1 0)) (async (1 9 4))) "Async indentation checker" single ((:commit . "c55f4ded11e8e50a96f43675a071354a8fb501c3") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "tools") (:url . "https://github.com/conao3/indent-lint.el"))])
+ (indent-tools . [(20210622 1207) ((s (0)) (hydra (0)) (yafolding (0))) "Indent, navigate (and more) by blocks of indentation: yaml, python etc." tar ((:commit . "c731f05fa3950e2e8580ec61b88abbc705639830") (:authors ("vindarel" . "vindarel@mailz.org")) (:maintainer "vindarel" . "vindarel@mailz.org") (:keywords "indentation" "movements" "navigation" "kill" "fold" "yaml" "python") (:url . "https://gitlab.com/emacs-stuff/indent-tools/"))])
+ (indian-ext . [(20190424 1547) ((emacs (24))) "Extension to Indian language utilities" single ((:commit . "c941cde1205642c6b933ae6abbc47d199f609df0") (:authors ("Patrick McAllister" . "pma@rdorte.org")) (:maintainer "Patrick McAllister" . "pma@rdorte.org") (:keywords "i18n" "tools" "wp" "indian" "devanagari" "encoding") (:url . "https://github.com/paddymcall/indian-ext"))])
+ (indicators . [(20161211 1126) ((dash (2 13 0)) (cl-lib (0 5 0))) "Display the buffer relative location of line in the fringe." single ((:commit . "f62a1201f21453e3aca93f48483e65ae8251432e") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "fringe" "frames") (:url . "https://github.com/Fuco1/indicators.el"))])
+ (indium . [(20210309 1210) ((emacs (25)) (seq (2 16)) (js2-mode (20140114)) (js2-refactor (0 9 0)) (company (0 9 0)) (json-process-client (0 2 0))) "JavaScript Awesome Development Environment" tar ((:commit . "8499e156bf7286846c3a2bf8c9e0c4d4f24b224c") (:authors ("Nicolas Petton" . "nicolas@petton.fr")) (:maintainer "Nicolas Petton" . "nicolas@petton.fr") (:keywords "tools" "javascript") (:url . "https://github.com/NicolasPetton/indium"))])
+ (indy . [(20190807 625) nil "A minor mode and EDSL to manage your mode's indentation rules." single ((:commit . "abc5bee424780ad2de5520f8fefbf8e120c0d9ed") (:authors ("Kevin W. van Rooijen" . "kevin.van.rooijen@attichacker.com")) (:maintainer "Kevin W. van Rooijen" . "kevin.van.rooijen@attichacker.com") (:keywords "convenience" "matching" "tools"))])
+ (inf-clojure . [(20220421 559) ((emacs (25 1)) (clojure-mode (5 11))) "Run an external Clojure process in an Emacs buffer" single ((:commit . "abeab8d6d4cb3bdded5e9083776aab0c06cbdf57") (:keywords "processes" "clojure") (:url . "http://github.com/clojure-emacs/inf-clojure"))])
+ (inf-crystal . [(20180119 211) ((emacs (24 3)) (crystal-mode (0 1 0))) "Run a Inferior-Crystal process in a buffer" single ((:commit . "02007b2a2a3bea44902d7c83c4acba1e39d278e3") (:authors ("Brantou" . "brantou89@gmail.com")) (:maintainer "Brantou" . "brantou89@gmail.com") (:keywords "languages" "crystal") (:url . "https://github.com/brantou/inf-crystal.el"))])
+ (inf-elixir . [(20211202 210) ((emacs (25 1))) "Run an interactive Elixir shell" single ((:commit . "acb948ca41a862c8c9b3f61ad576dec2c30d0052") (:authors ("Jonathan Arnett" . "jonathan.arnett@protonmail.com")) (:maintainer "Jonathan Arnett" . "jonathan.arnett@protonmail.com") (:keywords "languages" "processes" "tools") (:url . "https://github.com/J3RN/inf-elixir"))])
+ (inf-mongo . [(20180408 1338) nil "Run a MongoDB shell process in a buffer" single ((:commit . "2e498d1c88bd1904eeec18ed06b1a0cf8bdc2a92") (:authors ("Tobias Svensson")) (:maintainer "Tobias Svensson") (:keywords "databases" "mongodb") (:url . "http://github.com/endofunky/inf-mongo"))])
+ (inf-ruby . [(20220228 208) ((emacs (24 3))) "Run a Ruby process in a buffer" single ((:commit . "dbf4386bac12f1733257db6105e3f1fca05ffb79") (:authors ("Yukihiro Matsumoto") ("Nobuyoshi Nakada") ("Cornelius Mika" . "cornelius.mika@gmail.com") ("Dmitry Gutov" . "dgutov@yandex.ru") ("Kyle Hargraves" . "pd@krh.me")) (:maintainer "Yukihiro Matsumoto") (:keywords "languages" "ruby") (:url . "http://github.com/nonsequitur/inf-ruby"))])
+ (inflections . [(20210110 2237) ((cl-lib (0 5)) (emacs (24))) "convert english words between singular and plural" single ((:commit . "55caa66a7cc6e0b1a76143fd40eff38416928941") (:authors ("Dmitry Galinsky, Howard Yeh")) (:maintainer "Dmitry Galinsky, Howard Yeh") (:keywords "languages" "tools" "wp") (:url . "https://github.com/eschulte/jump.el"))])
+ (info-beamer . [(20210427 1033) ((emacs (24 4))) "Utilities for working with info-beamer" single ((:commit . "6b4cc29f1aec72d8e23b2c25a99cdd84e6cdc92b") (:authors ("Daniel Kraus" . "daniel@kraus.my")) (:maintainer "Daniel Kraus" . "daniel@kraus.my") (:keywords "tools" "processes" "comm") (:url . "https://github.com/dakra/info-beamer.el"))])
+ (info-buffer . [(20170112 1422) nil "Display info topics in separate buffers" single ((:commit . "d35dad6e766c6e2ddb8dc6acb4ce5b6e10fbcaa7") (:authors ("Lluís Vilanova" . "vilanova@ac.upc.edu")) (:maintainer "Lluís Vilanova" . "vilanova@ac.upc.edu") (:keywords "docs" "info") (:url . "http://www.github.com/llvilanova/info-buffer"))])
+ (info-colors . [(20200125 1447) ((emacs (24)) (cl-lib (0 5))) "Extra colors for Info-mode" single ((:commit . "47ee73cc19b1049eef32c9f3e264ea7ef2aaf8a5") (:authors ("Tuấn-Anh Nguyễn" . "ubolonton@gmail.com")) (:maintainer "Tuấn-Anh Nguyễn" . "ubolonton@gmail.com") (:keywords "faces") (:url . "https://github.com/ubolonton/info-colors"))])
+ (info-rename-buffer . [(20200328 1450) ((emacs (24 3))) "Rename Info buffers to match manuals" single ((:commit . "87fb263b18717538fd04878e3358e1e720415db8") (:authors ("Bruno Félix Rezende Ribeiro" . "oitofelix@gnu.org")) (:maintainer "Bruno Félix Rezende Ribeiro" . "oitofelix@gnu.org") (:keywords "help") (:url . "https://github.com/oitofelix/info-rename-buffer"))])
+ (inform . [(20200723 500) ((emacs (25 1))) "Symbol links in Info buffers to their help documentation." tar ((:commit . "8ff0a19a9f40cfa8283da8ed73de94c35a327423") (:authors ("H. Dieter Wilhelm" . "dieter@duenenhof-wilhelm.de")) (:maintainer "H. Dieter Wilhelm") (:keywords "help" "docs" "convenience") (:url . "https://github.com/dieter-wilhelm/inform"))])
+ (inform7 . [(20200430 1539) ((emacs (24 3)) (s (1 12 0))) "Major mode for working with Inform 7 files" single ((:commit . "a409bbc6f04264f7f00616a995fa6ecf59d33d0d") (:authors ("Ben Moon" . "software@guiltydolphin.com")) (:maintainer "Ben Moon" . "software@guiltydolphin.com") (:keywords "languages") (:url . "https://github.com/GuiltyDolphin/inform7-mode"))])
+ (inherit-local . [(20170409 1649) ((emacs (24 3))) "Inherited buffer-local variables" single ((:commit . "b1f4ff9c41f9d64e4adaf5adcc280b82f084cdc7") (:authors ("Shea Levy")) (:maintainer "Shea Levy") (:url . "https://github.com/shlevy/inherit-local/tree-master/"))])
+ (inheritenv . [(20210204 354) ((emacs (24 4))) "Make temp buffers inherit buffer-local environment variables" single ((:commit . "c2c879acf89682559b157fb069e1da008f4912ea") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "unix") (:url . "https://github.com/purcell/inheritenv"))])
+ (ini-mode . [(20170424 909) nil "Major mode for Windows-style ini files." single ((:commit . "2194cfa2fd13196a37350ec20b3f00dcf6162b7c") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "languages" "faces") (:url . "https://github.com/Lindydancer/ini-mode"))])
+ (init-loader . [(20210703 902) ((cl-lib (0 5))) "Loader for configuration files" single ((:commit . "ecab5a66b40227c4173992adfa5cfeae09f1657e") (:authors ("IMAKADO" . "ken.imakado@gmail.com")) (:maintainer "IMAKADO" . "ken.imakado@gmail.com") (:url . "https://github.com/emacs-jp/init-loader/"))])
+ (init-open-recentf . [(20220220 2004) ((emacs (24 4))) "Invoke a command immediately after startup" single ((:commit . "51463effe54ca9390ec339b9678968f35a40dbfd") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "files" "recentf" "after-init-hook") (:url . "https://github.com/zonuexe/init-open-recentf.el"))])
+ (initsplit . [(20160919 1818) nil "code to split customizations into different files" single ((:commit . "c941d436eb2b10b01c76a582c5a2b23fb30751aa") (:authors ("John Wiegley <johnw@gnu.org>, Dave Abrahams" . "dave@boostpro.com")) (:maintainer "John Wiegley <johnw@gnu.org>, Dave Abrahams" . "dave@boostpro.com") (:keywords "lisp") (:url . "http://www.gci-net.com/users/j/johnw/emacs.html"))])
+ (ink-mode . [(20201105 2242) ((emacs (26 1))) "Major mode for writing interactive fiction in Ink" tar ((:commit . "63c7ef39acf434a1682951bcf352e8fe1e1ac6d9") (:authors ("Erik Sjöstrand") ("Damien Picard")) (:maintainer "Damien Picard") (:keywords "languages" "wp" "hypermedia") (:url . "https://github.com/Kungsgeten/ink-mode"))])
+ (inkpot-theme . [(20220507 1118) ((emacs (24 1))) "A port of vim's inkpot theme" single ((:commit . "59056ef2e8850d33abc6e787219fcff404217afc") (:authors ("Sarah Iovan" . "sarah@hwaetageek.com") ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Sarah Iovan" . "sarah@hwaetageek.com") (:url . "https://codeberg.com/ideasman42/emacs-inkpot-theme"))])
+ (inline-crypt . [(20170824 900) nil "Simple inline encryption via openssl" tar ((:commit . "281385b383f850fd2e895926b1cef804dd052633") (:authors ("Daniel Ralston" . "Wubbulous@gmail.com")) (:maintainer "Daniel Ralston" . "Wubbulous@gmail.com") (:keywords "crypt") (:url . "https://github.com/Sodel-the-Vociferous/inline-crypt-el"))])
+ (inline-docs . [(20220210 1402) ((emacs (24 3))) "Show inline contextual docs." single ((:commit . "cda596d9ff4c2aa5035692a97c430f6589eafbb1") (:authors ("stardiviner" . "numbchild@gmail.com")) (:maintainer "stardiviner" . "numbchild@gmail.com") (:keywords "inline" "docs" "overlay") (:url . "https://repo.or.cz/inline-docs.git"))])
+ (inlineR . [(20191017 1920) nil "insert Tag for inline image of R graphics" single ((:commit . "bf6450a3540aa3538546d312324c41befd0a4e54") (:authors ("myuhe <yuhei.maeda_at_gmail.com>")) (:maintainer "myuhe") (:keywords "convenience" "iimage.el" "cacoo.el") (:url . "https://github.com/myuhe/inlineR.el"))])
+ (insert-char-preview . [(20201023 2108) ((emacs (24 1))) "Insert Unicode char" single ((:commit . "0e4a62b5407fb1bed8920a4c13cf9a91065e15ad") (:authors ("Matsievskiy S.V.")) (:maintainer "Matsievskiy S.V.") (:keywords "convenience") (:url . "https://gitlab.com/matsievskiysv/insert-char-preview"))])
+ (insert-esv . [(20201201 722) ((emacs (24 3)) (request (0 3 2))) "Insert ESV Bible passages" single ((:commit . "067bdd92ab2fccdfdee3d8707aa570527c74fd6a") (:authors ("Sam (sam030820)")) (:maintainer "Sam (sam030820)") (:keywords "convenience") (:url . "https://github.com/sam030820/insert-esv/"))])
+ (insert-kaomoji . [(20220215 1204) ((emacs (24 4))) "Easily insert kaomojis" tar ((:commit . "974bb7dc02059253e032c501b2c3c0ece448d472") (:authors ("Philip Kaludercic" . "philipk@posteo.net")) (:maintainer "Philip Kaludercic" . "~pkal/public-inbox@lists.sr.ht") (:keywords "wp") (:url . "https://git.sr.ht/~pkal/insert-kaomoji"))])
+ (insert-shebang . [(20201203 1648) nil "Insert shebang line automatically." single ((:commit . "cc8cea997a8523bce9f303de993af3a73eb0d2e2") (:authors ("Sachin Patil" . "iclcoolster@gmail.com")) (:maintainer "Sachin Patil" . "iclcoolster@gmail.com") (:keywords "shebang" "tool" "convenience") (:url . "https://gitlab.com/psachin/insert-shebang"))])
+ (insfactor . [(20141117 2) nil "Client for a Clojure project with insfactor in it" single ((:commit . "7ef5446cebb08a17d4106d2e6f3c053e49e1e829") (:authors ("John D. Hume" . "duelin.markers@gmail.com")) (:maintainer "John D. Hume" . "duelin.markers@gmail.com") (:keywords "clojure") (:url . "http://github.com/duelinmarkers/insfactor.el"))])
+ (instapaper . [(20110419 1355) nil "No description available." single ((:commit . "f21531bcb935e7e9b9e8df83dd0e0838adbf9b1b") (:authors ("Jason F. McBrayer" . "jmcbray@carcosa.net")) (:maintainer "Jason F. McBrayer" . "jmcbray@carcosa.net") (:url . "htts://bitbucket.org/jfm/emacs-instapaper"))])
+ (intel-hex-mode . [(20180423 31) nil "Mode for Intel Hex files." single ((:commit . "e83c94e1c31a8435a88b3ae395f2bc842ef83217") (:maintainer "Michael Schuldt" . "mbschuldt@gmail.com") (:keywords "tools" "hex") (:url . "https://github.com/mschuldt/intel-hex-mode"))])
+ (intellij-theme . [(20171017 1415) nil "Inspired by IntelliJ's default theme" single ((:commit . "1bbfff8e6742d18e9b77ed796f44da3b7bd10606") (:authors ("Vladimir Polushin" . "vovapolu@gmail.com")) (:maintainer "Vladimir Polushin" . "vovapolu@gmail.com") (:keywords "faces"))])
+ (interaction-log . [(20160305 1301) ((cl-lib (0))) "exhaustive log of interactions with Emacs" single ((:commit . "a49a06746d4df6bcfceec3c48dece065d635f9f9") (:authors ("Michael Heerdegen" . "michael_heerdegen@web.de")) (:maintainer "Michael Heerdegen" . "michael_heerdegen@web.de") (:keywords "convenience") (:url . "https://github.com/michael-heerdegen/interaction-log.el"))])
+ (interval-list . [(20150327 1718) ((dash (2 4 0)) (cl-lib (0 5)) (emacs (24 4))) "Interval list data structure for 1D selections" single ((:commit . "38af7ecf0a493ad8f487074938a2a115f3531177") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "extensions" "data structure") (:url . "https://github.com/Fuco1/interval-list"))])
+ (interval-tree . [(20130325 1407) ((dash (1 1 0))) "Interval tree data structure for 1D range queries" single ((:commit . "301302f480617091cf3ab6989caac385d52543dc") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "extensions" "data structure") (:url . "https://github.com/Fuco1/interval-tree"))])
+ (inverse-acme-theme . [(20210204 1640) ((autothemer (0 2)) (cl-lib (0 5))) "A theme that looks like an inverse of Acme's color scheme." single ((:commit . "79008920ce7923312ada6f95a3ec1f96ce513c0b") (:authors ("Dylan Johnson")) (:maintainer "Dylan Johnson") (:url . "http://github.com/dcjohnson/inverse-acme-theme"))])
+ (io-mode . [(20161004 756) nil "Major mode to edit Io language files in Emacs" single ((:commit . "fd65ae769093defcf554d6d637eba6e6dfc29f56") (:authors ("Sergei Lebedev" . "superbobry@gmail.com")) (:maintainer "Sergei Lebedev" . "superbobry@gmail.com") (:keywords "languages" "io") (:url . "https://github.com/superbobry/io-mode"))])
+ (io-mode-inf . [(20140128 1934) nil "Interaction with an Io interpreter." single ((:commit . "6dd2bac3fd87484bb7d97e135b06c29d70b444b6") (:keywords "io" "languages") (:url . "https://github.com/slackorama/io-emacs"))])
+ (iodine-theme . [(20151031 1639) ((emacs (24))) "A light emacs color theme" single ((:commit . "02fb780e1d8d8a6b9c709bfac399abe1665c6999") (:authors ("Srđan Panić" . "srdja.panic@gmail.com")) (:maintainer "Srđan Panić" . "srdja.panic@gmail.com") (:keywords "themes") (:url . "https://github.com/srdja/iodine-theme"))])
+ (ipcalc . [(20210903 958) ((cl-lib (0 5))) "IP subnet calculator" single ((:commit . "8d5af5b8e075f204c1e265174c96587886831996") (:authors ("\"Aleksandar Simic\"" . "asimic@gmail.com")) (:maintainer "\"Aleksandar Simic\"" . "asimic@gmail.com") (:keywords "networking" "tools") (:url . "http://github.com/dotemacs/ipcalc.el"))])
+ (iplayer . [(20161120 2120) nil "Browse and download BBC TV/radio shows" single ((:commit . "b788fffa4b36bbd558047ffa6be51b1f0f462f23") (:authors ("Christophe Rhodes" . "csr21@cantab.net")) (:maintainer "Christophe Rhodes" . "csr21@cantab.net") (:keywords "multimedia" "bbc") (:url . "https://github.com/csrhodes/iplayer-el"))])
+ (ipretty . [(20180606 522) nil "Interactive Emacs Lisp pretty-printing" single ((:commit . "042f5cc4e6f81d59115e8335c582bb5c571c2585") (:authors ("steckerhalter")) (:maintainer "steckerhalter") (:keywords "pretty-print" "elisp" "buffer") (:url . "https://framagit.org/steckerhalter/ipretty"))])
+ (ipython-shell-send . [(20190220 2246) ((emacs (24))) "Send code (including magics) to ipython shell" single ((:commit . "0faed86faff02a361f23ce5fc923d0e9b09bb2da") (:authors ("Jack Kamm" . "jackkamm@gmail.com")) (:maintainer "Jack Kamm" . "jackkamm@gmail.com") (:keywords "tools" "processes") (:url . "https://github.com/jackkamm/ipython-shell-send-el"))])
+ (iqa . [(20200520 1137) ((emacs (24 3))) "Init file(and directory) Quick Access" single ((:commit . "c1077aca6553cb2011f21b178e10271a17fe4f58") (:url . "https://github.com/a13/iqa.el"))])
+ (ir-black-theme . [(20130303 755) nil "Port of ir-black theme" single ((:commit . "36e930d107604b5763c80294a6f92aaa02e6c272") (:authors ("Jon-Michael Deldin" . "dev@jmdeldin.com")) (:maintainer "Jon-Michael Deldin" . "dev@jmdeldin.com") (:keywords "faces"))])
+ (iregister . [(20150515 2107) nil "Interactive register commands for Emacs." tar ((:commit . "6a48c66187289de5f300492be11c83e98410c018") (:authors ("Andrey Tykhonov" . "atykhonov@gmail.com")) (:maintainer "Andrey Tykhonov" . "atykhonov@gmail.com") (:keywords "convenience") (:url . "https://github.com/atykhonov/iregister.el"))])
+ (irony . [(20220110 849) ((cl-lib (0 5)) (json (1 2))) "C/C++ minor mode powered by libclang" tar ((:commit . "870d1576fb279bb93f776a71e65f45283c423a9e") (:authors ("Guillaume Papin" . "guillaume.papin@epitech.eu")) (:maintainer "Guillaume Papin" . "guillaume.papin@epitech.eu") (:keywords "c" "convenience" "tools") (:url . "https://github.com/Sarcasm/irony-mode"))])
+ (irony-eldoc . [(20200622 2214) ((emacs (24)) (cl-lib (0 5)) (irony (0 1))) "irony-mode support for eldoc-mode" single ((:commit . "73e79a89fad982a2ba072f2fcc1b4e41f0aa2978") (:authors ("Kirill Ignatiev <github.com/ikirill>")) (:maintainer "Kirill Ignatiev <github.com/ikirill>") (:keywords "c" "c++" "objc" "convenience" "tools") (:url . "https://github.com/ikirill/irony-eldoc"))])
+ (iscroll . [(20210128 1938) ((emacs (26 0))) "Smooth scrolling over images" single ((:commit . "d6e11066169d232fe23c2867d44c012722ddfc5a") (:authors ("Yuan Fu" . "casouri@gmail.com")) (:maintainer "Yuan Fu" . "casouri@gmail.com") (:keywords "convenience" "image") (:url . "https://github.com/casouri/iscroll"))])
+ (isearch-dabbrev . [(20141224 622) ((cl-lib (0 5))) "Use dabbrev in isearch" single ((:commit . "1efe7abba4923015cbc2462395deaec5446a9cc8") (:authors ("Dewdrops" . "v_v_4474@126.com")) (:maintainer "Dewdrops" . "v_v_4474@126.com") (:keywords "dabbrev" "isearch") (:url . "https://github.com/Dewdrops/isearch-dabbrev"))])
+ (isearch-project . [(20210715 1041) ((emacs (26 1)) (f (0 20 0))) "Incremental search through the whole project" single ((:commit . "e6c9d5e19533eda6b74505a86198416eeecb915a") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/isearch-project"))])
+ (isearch-symbol-at-point . [(20130728 2221) nil "Use isearch to search for the symbol at point" single ((:commit . "51a1029bec1ec414885f9edb7e5947603dffdab2") (:authors ("atom smith")) (:maintainer "atom smith") (:keywords "isearch") (:url . "https://github.com/re5et/isearch-symbol-at-point"))])
+ (isend-mode . [(20210106 1506) nil "Interactively send parts of an Emacs buffer to an interpreter" single ((:commit . "ea855f63be7febc15bd08aec6229fab9407734fb") (:authors ("François Févotte" . "fevotte@gmail.com")) (:maintainer "François Févotte" . "fevotte@gmail.com") (:url . "https://github.com/ffevotte/isend-mode.el"))])
+ (isgd . [(20150414 936) nil "Shorten URLs using the isgd.com shortener service" single ((:commit . "764306dadd5a9213799081a48aba22f7c75cca9a") (:authors ("Chmouel Boudjnah" . "chmouel@chmouel.com")) (:maintainer "Chmouel Boudjnah" . "chmouel@chmouel.com") (:url . "https://github.com/chmouel/isgd.el"))])
+ (isortify . [(20190315 2004) ((emacs (25)) (pythonic (0 1 0))) "(automatically) format python buffers using isort." single ((:commit . "ae7fb7163ce075209543f72953c9f431d103f6a3") (:authors ("Artem Malyshev" . "proofit404@gmail.com")) (:maintainer "Artem Malyshev" . "proofit404@gmail.com") (:url . "https://github.com/proofit404/isortify"))])
+ (ispc-mode . [(20201215 852) nil "Syntax coloring for ispc programs" single ((:commit . "722fdc45da2714f8fe0757968589cdb5ccacc8a0") (:authors ("Philip Munksgaard" . "philip@munksgaard.me")) (:maintainer "Philip Munksgaard" . "philip@munksgaard.me") (:keywords "c" "ispc") (:url . "https://github.com/Munksgaard/ispc-mode"))])
+ (iss-mode . [(20141001 1913) nil "Mode for InnoSetup install scripts" single ((:commit . "3b517aff31529bab33f8d7b562bd17aff0107fd1") (:authors ("Stefan Reichoer," . "stefan@xsteve.at")) (:maintainer "Stefan Reichoer," . "stefan@xsteve.at"))])
+ (itail . [(20171112 804) nil "An interactive tail mode" single ((:commit . "6e43c20da03be3b9c6ece93b7dc3495975ec1888") (:authors ("atom smith")) (:maintainer "atom smith") (:keywords "tail") (:url . "https://github.com/re5et/itail"))])
+ (itasca . [(20170601 1622) ((emacs (24 3))) "Major modes for Itasca software data files." tar ((:commit . "3d15dd1b70d6db69b0f4758a3e28b8b506cc84ca") (:authors ("Jason Furtney" . "jkfurtney@gmail.com")) (:maintainer "Jason Furtney" . "jkfurtney@gmail.com") (:keywords "itasca" "flac" "3dec" "udec" "flac3d" "pfc" "pfc2d" "pfc3d" "fish") (:url . "http://github.com/jkfurtney/itasca-emacs/"))])
+ (iter2 . [(20220501 1542) ((emacs (25 1))) "Reimplementation of Elisp generators" single ((:commit . "1abca3665ecfa6b016311906560f8be4fbb3e3db") (:authors ("Paul Pogonyshev" . "pogonyshev@gmail.com")) (:maintainer "Paul Pogonyshev" . "pogonyshev@gmail.com") (:keywords "elisp" "extensions") (:url . "https://github.com/doublep/iter2"))])
+ (iterator . [(20210109 1859) ((emacs (24)) (cl-lib (0 5))) "A library to create and use elisp iterators objects." single ((:commit . "b514d4d1d0167e5973afbc93a34070d1aa967d82") (:authors ("Thierry Volpiatto <thierry dot volpiatto at gmail dot com>")) (:maintainer "Thierry Volpiatto <thierry dot volpiatto at gmail dot com>") (:url . "https://github.com/thierryvolpiatto/iterator"))])
+ (ivariants . [(20170823 224) ((emacs (24 3)) (ivs-edit (1 0))) "Ideographic variants editor and browser" tar ((:commit . "ca0b74d32b5d2d77a45cc6ad6edc00be0ee85284") (:authors ("KAWABATA, Taichi <kawabata.taichi_at_gmail.com>")) (:maintainer "KAWABATA, Taichi <kawabata.taichi_at_gmail.com>") (:keywords "i18n" "languages") (:url . "http://github.com/kawabata/ivariants"))])
+ (ivs-edit . [(20170818 1441) ((emacs (24 3)) (dash (2 6 0)) (cl-lib (1 0))) "IVS (Ideographic Variation Sequence) editing tool" tar ((:commit . "5db39c234aa7393b591168a4fd0a9a4cbbca347d") (:authors ("KAWABATA, Taichi <kawabata.taichi_at_gmail.com>")) (:maintainer "KAWABATA, Taichi <kawabata.taichi_at_gmail.com>") (:keywords "text") (:url . "http://github.com/kawabata/ivs-edit"))])
+ (ivy . [(20220406 1052) ((emacs (24 5))) "Incremental Vertical completYon" tar ((:commit . "8bf8027e4bd8c093bddb76a813952d2a0dcbf21d") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "matching") (:url . "https://github.com/abo-abo/swiper"))])
+ (ivy-avy . [(20211021 1602) ((emacs (24 5)) (ivy (0 13 4)) (avy (0 5 0))) "Avy integration for Ivy" single ((:commit . "8bf8027e4bd8c093bddb76a813952d2a0dcbf21d") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "convenience") (:url . "https://github.com/abo-abo/swiper"))])
+ (ivy-bibtex . [(20210927 1205) ((bibtex-completion (1 0 0)) (ivy (0 13 0)) (cl-lib (0 5))) "A bibliography manager based on Ivy" single ((:commit . "ce8c17690ddad73d01531084b282f221f8eb6669") (:authors ("Justin Burkett" . "justin@burkett.cc")) (:maintainer "Titus von der Malsburg" . "malsburg@posteo.de") (:url . "https://github.com/tmalsburg/helm-bibtex"))])
+ (ivy-clipmenu . [(20220202 2122) ((emacs (26 1)) (f (0 20 0)) (s (1 12 0)) (dash (2 16 0)) (ivy (0 13 0))) "Ivy client for clipmenu" single ((:commit . "7c200cd4732821187084fad23547ee3f58365062") (:authors ("William Carroll" . "wpcarro@gmail.com")) (:maintainer "William Carroll" . "wpcarro@gmail.com") (:url . "https://github.com/wpcarro/ivy-clipmenu.el"))])
+ (ivy-clojuredocs . [(20201129 2355) ((edn (1 1 2)) (ivy (0 12 0)) (emacs (24 4))) "Search for help in clojuredocs.org" single ((:commit . "8b6de19b3578c72d2b88f898e2290d94c04350f9") (:authors ("Wanderson Ferreira" . "iagwanderson@gmail.com")) (:maintainer "Wanderson Ferreira" . "iagwanderson@gmail.com") (:keywords "matching") (:url . "https://github.com/wandersoncferreira/ivy-clojuredocs"))])
+ (ivy-dired-history . [(20210715 48) ((ivy (0 9 0)) (counsel (0 9 0)) (cl-lib (0 5))) "use ivy to open recent directories" single ((:commit . "dba848929cb063a5536cb442c70be1099e2f5baa") (:authors ("纪秀峰" . "jixiuf@gmail.com")) (:maintainer "纪秀峰" . "jixiuf@gmail.com") (:url . "https://github.com/jixiuf/ivy-dired-history"))])
+ (ivy-emms . [(20210817 1300) ((ivy (0 13 0)) (emms (0 0)) (emacs (24 4))) "Ivy interface to emms tracks" single ((:commit . "dfde98c3bdad8136709eac8382ba048fafdcc6ac") (:authors ("Fran Burstall" . "fran.burstall@gmail.com")) (:maintainer "Fran Burstall" . "fran.burstall@gmail.com") (:keywords "multimedia") (:url . "https://github.com/franburstall/ivy-emms"))])
+ (ivy-emoji . [(20200316 2351) ((emacs (26 1)) (ivy (0 13 0))) "Insert emojis with ivy" single ((:commit . "a1b7d32048278afd9b06536a8af96f533639d146") (:authors ("Gabriele Bozzola" . "sbozzolator@gmail.com")) (:maintainer "Gabriele Bozzola" . "sbozzolator@gmail.com") (:keywords "emoji" "ivy" "convenience") (:url . "https://github.com/sbozzolo/ivy-emoji.git"))])
+ (ivy-erlang-complete . [(20211019 447) ((async (1 9)) (counsel (0 13 4)) (ivy (0 13 4)) (erlang (19 2)) (emacs (25 1))) "Erlang context sensitive completion at point using ivy. It also support xref and eldoc." tar ((:commit . "6913f6ef7c942a5a2c42bc17635d09c91353e7ca") (:authors ("Sergey Kostyaev" . "feo.me@ya.ru")) (:maintainer "Sergey Kostyaev" . "feo.me@ya.ru") (:keywords "languages" "tools"))])
+ (ivy-explorer . [(20190909 1921) ((emacs (25)) (ivy (0 10 0))) "Dynamic file browsing grid using ivy" single ((:commit . "a413966cfbcecacc082d99297fa1abde0c10d3f3") (:authors ("Clemens Radermacher" . "clemera@posteo.net")) (:maintainer "Clemens Radermacher" . "clemera@posteo.net") (:keywords "convenience" "files" "matching") (:url . "https://github.com/clemera/ivy-explorer"))])
+ (ivy-file-preview . [(20210124 1639) ((emacs (25 1)) (ivy (0 8 0)) (s (1 12 0)) (f (0 20 0))) "Preview the current ivy file selection" single ((:commit . "942b2565097c97c1afc4fa395fac5788eabc730b") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/ivy-file-preview"))])
+ (ivy-fuz . [(20191222 946) ((emacs (25 1)) (fuz (1 3 0)) (ivy (0 13 0))) "Integration between fuz and ivy." single ((:commit . "f171ac73422a4bae1503d63d804e691482ed35b2") (:authors ("Zhu Zihao" . "all_but_last@163.com")) (:maintainer "Philippe Vaucher" . "philippe.vaucher@gmail.com") (:keywords "convenience") (:url . "https://github.com/Silex/ivy-fuz.el"))])
+ (ivy-gitlab . [(20181228 826) ((s (1 9 0)) (dash (2 9 0)) (ivy (0 8 0)) (gitlab (0 8))) "Ivy interface to Gitlab" single ((:commit . "8c2324c02119500f094c2f92dfaba4c9977ce1ba") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "gitlab" "ivy") (:url . "https://github.com/nlamirault/emacs-gitlab"))])
+ (ivy-historian . [(20210714 56) ((emacs (24 4)) (historian (20170111)) (ivy (0 8 0)) (flx (0 6 1))) "Persistently store selected minibuffer candidates" single ((:commit . "852cb4e72c0f78c8dbb2c972bdcb4e7b0108ff4c") (:authors ("PythonNut" . "pythonnut@pythonnut.com")) (:maintainer "PythonNut" . "pythonnut@pythonnut.com") (:keywords "convenience" "ivy") (:url . "https://github.com/PythonNut/historian.el"))])
+ (ivy-hydra . [(20220402 1348) ((emacs (24 5)) (ivy (0 13 4)) (hydra (0 14 0))) "Additional key bindings for Ivy" single ((:commit . "8bf8027e4bd8c093bddb76a813952d2a0dcbf21d") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "convenience") (:url . "https://github.com/abo-abo/swiper"))])
+ (ivy-lobsters . [(20200818 1406) ((ivy (0 8 0)) (cl-lib (0 5))) "Browse lobste.rs stories with ivy." single ((:commit . "3f7f90751d15ebcf91253ef3cda18c0aa7d856ff") (:authors ("Julien Blanchard <https://github.com/julienXX>")) (:maintainer "Julien Blanchard <https://github.com/julienXX>") (:url . "https://github.com/julienXX/ivy-lobsters"))])
+ (ivy-migemo . [(20220309 605) ((emacs (24 3)) (ivy (0 13 0)) (migemo (1 9 2)) (nadvice (0 3))) "Use migemo on ivy" single ((:commit . "f31a2b314b81e328ce0222d8796b808230ddaa0e") (:authors ("ROCKTAKEY" . "rocktakey@gmail.com")) (:maintainer "ROCKTAKEY" . "rocktakey@gmail.com") (:keywords "matching") (:url . "https://github.com/ROCKTAKEY/ivy-migemo"))])
+ (ivy-mpdel . [(20190428 920) ((emacs (25 1)) (ivy (0 10 0)) (libmpdel (1 0 0)) (mpdel (1 0 0))) "Ivy interface to navigate MPD" single ((:commit . "a42dcc943914c71975c115195d38c739f25e475c") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:keywords "multimedia") (:url . "https://gitlab.petton.fr/mpdel/ivy-mpdel"))])
+ (ivy-omni-org . [(20200810 1050) ((emacs (25 1)) (ivy (0 13)) (dash (2 12))) "Browse anything in Org mode" single ((:commit . "a6b284f65b229d9b118b4316c2f6377de93400b1") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:keywords "outlines") (:url . "https://github.com/akirak/ivy-omni-org"))])
+ (ivy-pass . [(20170812 1955) ((emacs (24)) (ivy (0 8 0)) (password-store (1 6 5))) "ivy interface for pass" single ((:commit . "5b523de1151f2109fdd6a8114d0af12eef83d3c5") (:authors ("ecraven")) (:maintainer "ecraven") (:keywords "pass" "password" "convenience" "data") (:url . "https://github.com/ecraven/ivy-pass/"))])
+ (ivy-phpunit . [(20180219 915) ((ivy (0 10 0)) (phpunit (0 7 0)) (emacs (25))) "Ivy integration for phpunit.el" single ((:commit . "ffedb0138d36564e8e36a28fd9bc71ea8944681f") (:authors ("12pt")) (:maintainer "12pt") (:keywords "convenience" "tools" "ivy" "phpunit" "php") (:url . "https://github.com/12pt/ivy-phpunit"))])
+ (ivy-posframe . [(20211217 234) ((emacs (26 0)) (posframe (1 0 0)) (ivy (0 13 0))) "Using posframe to show Ivy" single ((:commit . "533a8e368fcabfd534761a5c685ce713376fa594") (:authors ("Feng Shu" . "tumashu@163.com") ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Feng Shu" . "tumashu@163.com") (:keywords "abbrev" "convenience" "matching" "ivy") (:url . "https://github.com/tumashu/ivy-posframe"))])
+ (ivy-prescient . [(20220509 2300) ((emacs (25 1)) (prescient (5 2)) (ivy (0 11 0))) "prescient.el + Ivy" single ((:commit . "c05f8a43c6ff07a8b5a3ba8df7a2ec35677b7484") (:authors ("Radian LLC" . "contact+prescient@radian.codes")) (:maintainer "Radian LLC" . "contact+prescient@radian.codes") (:keywords "extensions") (:url . "https://github.com/raxod502/prescient.el"))])
+ (ivy-purpose . [(20160724 1003) ((emacs (24)) (ivy (0 8)) (window-purpose (1 5))) "Ivy Interface for Purpose" single ((:commit . "0495f2f3aed64d7e0028125e76a9a68f8fc4107e") (:authors ("Bar Magal (2016)")) (:maintainer "Bar Magal (2016)") (:url . "https://github.com/bmag/ivy-purpose"))])
+ (ivy-rich . [(20210409 931) ((emacs (25 1)) (ivy (0 13 0))) "More friendly display transformer for ivy" single ((:commit . "600b8183ed0be8668dcc548cc2c8cb94b001363b") (:authors ("Yevgnen Koh" . "wherejoystarts@gmail.com")) (:maintainer "Yevgnen Koh" . "wherejoystarts@gmail.com") (:keywords "convenience" "ivy") (:url . "https://github.com/Yevgnen/ivy-rich"))])
+ (ivy-rtags . [(20191222 920) ((ivy (0 7 0)) (rtags (2 10))) "RTags completion back-end for ivy" single ((:commit . "db39790fda5c2443bc790b8971ac140914f7e9c2") (:authors ("Jan Erik Hanssen" . "jhanssen@gmail.com") ("Anders Bakken" . "agbakken@gmail.com")) (:maintainer "Jan Erik Hanssen" . "jhanssen@gmail.com") (:url . "https://github.com/Andersbakken/rtags"))])
+ (ivy-searcher . [(20210221 923) ((emacs (25 1)) (ivy (0 8 0)) (searcher (0 1 8)) (s (1 12 0)) (f (0 20 0))) "Ivy interface to use searcher" single ((:commit . "17a93eadb8a681d878e1d66b90073ed1be2e1dc2") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/ivy-searcher"))])
+ (ivy-spotify . [(20210329 312) ((emacs (26 1)) (espotify (0 1)) (ivy (0 13 1))) "Search spotify with ivy" single ((:commit . "ea6d6021e5acc550560325db2f09198839ee702f") (:authors ("Jose A Ortega Ruiz" . "jao@gnu.org")) (:maintainer "Jose A Ortega Ruiz") (:keywords "multimedia") (:url . "https://codeberg.org/jao/espotify"))])
+ (ivy-todo . [(20200323 2005) ((ivy (0 8 0)) (emacs (25))) "Manage org-mode TODOs with ivy" single ((:commit . "d74501cd334b7d709659946c5e02b21cfd5507de") (:authors ("Erik Sjöstrand" . "sjostrand.erik@gmail.com")) (:maintainer "Erik Sjöstrand" . "sjostrand.erik@gmail.com") (:keywords "convenience") (:url . "https://github.com/Kungsgeten/ivy-todo"))])
+ (ivy-xcdoc . [(20160917 1055) ((ivy (0 8 0)) (emacs (24 4))) "Search Xcode documents with ivy interface." single ((:commit . "5ea22af36c4c2737fb0bec53432c233482d8b314") (:authors ("C.T.Chen" . "chenct@7adybird.com")) (:maintainer "C.T.Chen" . "chenct@7adybird.com") (:keywords "ivy" "xcode" "xcdoc") (:url . "https://github.com/hex2010/emacs-ivy-xcdoc"))])
+ (ivy-xref . [(20211008 1103) ((emacs (25 1)) (ivy (0 10 0))) "Ivy interface for xref results" single ((:commit . "a82e8e117d2dd62c28b6a3e3d6e4cfb11c0bda38") (:authors ("Alex Murray" . "murray.alex@gmail.com")) (:maintainer "Alex Murray" . "murray.alex@gmail.com") (:url . "https://github.com/alexmurray/ivy-xref"))])
+ (ivy-yasnippet . [(20200704 700) ((emacs (24 1)) (cl-lib (0 6)) (ivy (0 10 0)) (yasnippet (0 12 2)) (dash (2 14 1))) "Preview yasnippets with ivy" single ((:commit . "83402d91b4eba5307f71884a72df8e11cc6a994e") (:authors ("Michał Krzywkowski" . "k.michal@zoho.com")) (:maintainer "Michał Krzywkowski" . "k.michal@zoho.com") (:keywords "convenience") (:url . "https://github.com/mkcms/ivy-yasnippet"))])
+ (ivy-ycmd . [(20180909 1225) ((ycmd (1 3)) (emacs (24)) (ivy (0 10 0)) (dash (2 14 1))) "Ivy interface to ycmd" single ((:commit . "25bfee8f676e4ecbb645e4f30b47083410a00c58") (:authors ("Austin Bingham" . "austin.bingham@gmail.com")) (:maintainer "Austin Bingham" . "austin.bingham@gmail.com") (:keywords "tools") (:url . "https://github.com/abingham/emacs-ivy-ycmd"))])
+ (ivy-youtube . [(20181126 1039) ((request (0 2 0)) (ivy (0 8 0)) (cl-lib (0 5))) "Query YouTube and play videos in your browser" single ((:commit . "273788e0d22a06cca1050eb1205d3fbc2245d001") (:authors ("Brunno dos Santos")) (:maintainer "Brunno dos Santos") (:keywords "youtube" "multimedia" "mpv" "vlc") (:url . "https://github.com/squiter/ivy-youtube"))])
+ (ix . [(20131027 1629) ((grapnel (0 5 3))) "Emacs client for http://ix.io pastebin" single ((:commit . "aea4c54a5cc5a6f26637353c16a3a0e70fc76963") (:authors ("Abhishek L" . "abhishekl.2006@gmail.com")) (:maintainer "Abhishek L" . "abhishekl.2006@gmail.com") (:url . "http://www.github.com/theanalyst/ix.el"))])
+ (j-mode . [(20171224 1856) nil "Major mode for editing J programs" tar ((:commit . "e8725ac8af95498faabb2ca3ab3bd809a8f148e6") (:keywords "j" "languages") (:url . "http://github.com/zellio/j-mode"))])
+ (jabber . [(20180927 2325) ((fsm (0 2)) (srv (0 2))) "A Jabber client for Emacs." tar ((:commit . "fff33826f42e040dad7ef64ea312d85215d3b0a1"))])
+ (jabber-otr . [(20150918 1144) ((emacs (24)) (jabber (0 8 92))) "Off-The-Record messaging for jabber.el" tar ((:commit . "2692b1530234e0ba9a0d6c1eaa1cbe8679f193c0") (:authors ("Magnus Henoch" . "magnus.henoch@gmail.com")) (:maintainer "Magnus Henoch" . "magnus.henoch@gmail.com") (:keywords "comm") (:url . "https://github.com/legoscia/emacs-jabber-otr/"))])
+ (jack-connect . [(20220201 1417) nil "Manage jack connections within Emacs" single ((:commit . "1acaebfe8f37f0194e95c3e812c9515a6f688eee") (:authors ("Stefano Barbi" . "stefanobarbi@gmail.com")) (:maintainer "Stefano Barbi" . "stefanobarbi@gmail.com"))])
+ (jade-mode . [(20210908 2121) nil "Major mode for editing .jade files" single ((:commit . "1ad7c51f3c6a6ae64550d9510c5e4e8470014375") (:authors ("Brian M. Carlson and other contributors")) (:maintainer "Brian M. Carlson and other contributors") (:keywords "languages") (:url . "https://github.com/brianc/jade-mode"))])
+ (jammer . [(20210508 1633) ((emacs (24 1))) "Punish yourself for using Emacs inefficiently" single ((:commit . "a780e4c2adb2e85a4daadcefd1a2b189d761872f") (:authors ("Vasilij Schneidermann" . "mail@vasilij.de")) (:maintainer "Vasilij Schneidermann" . "mail@vasilij.de") (:keywords "games") (:url . "https://depp.brause.cc/jammer"))])
+ (janet-mode . [(20210924 44) ((emacs (24 3))) "Defines a major mode for Janet" single ((:commit . "9e3254a0249d720d5fa5603f1f8c3ed0612695af") (:authors ("Adam Schwalm" . "adamschwalm@gmail.com")) (:maintainer "Adam Schwalm" . "adamschwalm@gmail.com") (:url . "https://github.com/ALSchwalm/janet-mode"))])
+ (japanese-holidays . [(20201229 755) ((emacs (24 1)) (cl-lib (0 3))) "Calendar functions for the Japanese calendar" single ((:commit . "324b6bf2f55ec050bef49e001caedaabaf4fa35d") (:authors ("Takashi Hattori" . "hattori@sfc.keio.ac.jp") ("Hiroya Murata" . "lapis-lazuli@pop06.odn.ne.jp")) (:maintainer "Takashi Hattori" . "hattori@sfc.keio.ac.jp") (:keywords "calendar") (:url . "https://github.com/emacs-jp/japanese-holidays"))])
+ (jape-mode . [(20140903 1506) nil "An Emacs editing mode mode for GATE's JAPE files" single ((:commit . "85b9182850707b5d107391f6caee5bd401507a7d") (:keywords "languages" "jape" "gate") (:url . "http://github.com/tanzoniteblack/jape-mode"))])
+ (jar-manifest-mode . [(20160501 26) nil "Major mode to edit JAR manifest files" single ((:commit . "270dae14c481300f75ed96dad3a5ae42ca928a1d") (:authors ("Omair Majid" . "omair.majid@gmail.com")) (:maintainer "Omair Majid" . "omair.majid@gmail.com") (:keywords "convenience" "languages") (:url . "http://github.com/omajid/jar-manifest-mode"))])
+ (jasminejs-mode . [(20150527 5) nil "A minor mode for manipulating jasmine test files" tar ((:commit . "9f8044bf81ab5b4841a30b0bd099916e1b7ff54a") (:authors ("Eric Stolten" . "stoltene2@gmail.com")) (:maintainer "Eric Stolten" . "stoltene2@gmail.com") (:keywords "javascript" "jasmine") (:url . "https://github.com/stoltene2/jasminejs-mode"))])
+ (jastadd-ast-mode . [(20200926 1820) ((emacs (25))) "Major mode for editing JastAdd AST files" single ((:commit . "b7a0e32b669e726c8ccc348dd6b18ad4a7c70e1b") (:authors ("Rudi Schlatte" . "rudi@constantly.at")) (:maintainer "Rudi Schlatte" . "rudi@constantly.at") (:keywords "languages") (:url . "https://github.com/rudi/jastadd-ast-mode"))])
+ (java-imports . [(20211006 2153) ((emacs (24 4)) (s (1 10 0)) (pcache (0 3 2))) "Code for dealing with Java imports" single ((:commit . "7535a36d85497448a6e83579b822beaca7251ccb") (:authors ("Lee Hinman" . "lee@writequit.org")) (:maintainer "Lee Hinman" . "lee@writequit.org") (:keywords "java" "kotlin") (:url . "http://www.github.com/dakrone/emacs-java-imports"))])
+ (java-snippets . [(20160627 252) ((yasnippet (0 8 0))) "Yasnippets for Java" tar ((:commit . "6d0e2768823be27dbe07448f4cb244cd657a7136") (:authors ("Takayoshi Kimura")) (:maintainer "Takayoshi Kimura") (:url . "https://github.com/nekop/yasnippet-java-mode"))])
+ (javadoc-lookup . [(20160214 31) ((cl-lib (0 3))) "Javadoc Emacs integration with Maven" tar ((:commit . "507a2dd443d60b537b8f779c1847e2cd0ccd1382") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/javadoc-lookup"))])
+ (javap-mode . [(20120223 2208) nil "Javap major mode" single ((:commit . "864c1130e204b2072e1d19cd027b6fce8ebe6629") (:url . "http://github.com/hiredman/javap-mode"))])
+ (jaword . [(20210306 420) ((tinysegmenter (0 1)) (emacs (25 1))) "Minor-mode for handling Japanese words better" single ((:commit . "783544a265f91b2e568b52311afb36e3691d5ad3") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://zk-phi.github.io/"))])
+ (jazz-theme . [(20201026 1027) nil "A warm color theme for Emacs 24+." single ((:commit . "0b5bfe7a30590326bdf38120fb4bc25fff21a509") (:authors ("Roman Parykin" . "donderom@ymail.com")) (:maintainer "Roman Parykin" . "donderom@ymail.com") (:url . "https://github.com/donderom/jazz-theme"))])
+ (jbeans-theme . [(20200924 1946) ((emacs (24))) "Jbeans theme for GNU Emacs 24 (deftheme)" single ((:commit . "a63916a928324c42bfbe3016972c2ecff598b1ae") (:authors ("Adam Olsen" . "arolsen@gmail.com")) (:maintainer "Adam Olsen" . "arolsen@gmail.com") (:url . "https://github.com/synic/jbeans-emacs"))])
+ (jdecomp . [(20170224 2200) ((emacs (24 5))) "Interface to Java decompilers" single ((:commit . "692866abc83deedce62be8d6040cf24dda7fb7a8") (:authors ("Tianxiang Xiong" . "tianxiang.xiong@gmail.com")) (:maintainer "Tianxiang Xiong" . "tianxiang.xiong@gmail.com") (:keywords "decompile" "java" "languages" "tools") (:url . "https://github.com/xiongtx/jdecomp"))])
+ (jdee . [(20191102 1426) ((emacs (24 3)) (flycheck (30)) (memoize (1 0 1)) (dash (2 13 0)) (s (1 12 0))) "Java Development Environment for Emacs" tar ((:commit . "b510a29f1fc1bea218a6230fb219922775687c78") (:authors ("Paul Kinnucan" . "pkinnucan@attbi.com")) (:maintainer "Paul Landes") (:keywords "java" "tools") (:url . "http://github.com/jdee-emacs/jdee"))])
+ (jedi . [(20191011 1750) ((emacs (24)) (jedi-core (0 2 2)) (auto-complete (1 4))) "a Python auto-completion for Emacs" single ((:commit . "81c5a42b83f3a3c9d062b487f48009def11310f8") (:authors ("Takafumi Arakaki <aka.tkf at gmail.com>")) (:maintainer "Takafumi Arakaki <aka.tkf at gmail.com>"))])
+ (jedi-core . [(20210503 1315) ((emacs (24)) (epc (0 1 0)) (python-environment (0 0 2)) (cl-lib (0 5))) "Common code of jedi.el and company-jedi.el" tar ((:commit . "81c5a42b83f3a3c9d062b487f48009def11310f8") (:authors ("Takafumi Arakaki <aka.tkf at gmail.com>")) (:maintainer "Takafumi Arakaki <aka.tkf at gmail.com>"))])
+ (jedi-direx . [(20140310 936) ((jedi (0 1 2)) (direx (0 1 -3))) "Tree style source code viewer for Python buffer" single ((:commit . "7a2e677400717ed12b959cb5988e7b3fb1c12117") (:authors ("Takafumi Arakaki <aka.tkf at gmail.com>")) (:maintainer "Takafumi Arakaki <aka.tkf at gmail.com>"))])
+ (jeison . [(20190721 1651) ((emacs (25 1)) (dash (2 16 0))) "A library for declarative JSON parsing" single ((:commit . "66e276c1f2f08ca54d2cd60f2c9f974c662aae8b") (:keywords "lisp" "json" "data-types") (:url . "http://github.com/SavchenkoValeriy/jeison"))])
+ (jekyll-modes . [(20141117 1314) ((polymode (0 2))) "Major modes (markdown and HTML) for authoring Jekyll content" single ((:commit . "7cb10b50fd2883e3f7b10fdfd98f19f2f0b2381c") (:authors ("Fredrik Appelberg" . "fredrik@milgrim.local")) (:maintainer "Fredrik Appelberg" . "fredrik@milgrim.local") (:keywords "docs") (:url . "https://github.com/fred-o/jekyll-modes"))])
+ (jemdoc-mode . [(20170704 2027) ((emacs (24 3))) "Major mode for editing jemdoc files" single ((:commit . "529b4d4681e1198b9892f340fdd6c3f1592a047a") (:authors ("Dimitar Dimitrov" . "mail.mitko@gmail.com")) (:maintainer "Dimitar Dimitrov" . "mail.mitko@gmail.com") (:keywords "convenience" "usability") (:url . "https://github.com/drdv/jemdoc-mode"))])
+ (jenkins . [(20200524 2016) ((dash (2 12)) (emacs (24 3)) (json (1 4))) "Minimalistic Jenkins client for Emacs" single ((:commit . "bd06cdc57c0cb9217d773eeba06ecc998f10033b") (:authors ("Rustem Muslimov" . "r.muslimov@gmail.com")) (:maintainer "Rustem Muslimov" . "r.muslimov@gmail.com") (:keywords "jenkins" "convenience"))])
+ (jenkins-watch . [(20121004 2326) nil "Watch continuous integration build status" single ((:commit . "37b84dfbd98240a57ff798e1ff8bc7dba2913577") (:authors ("Andrew Taylor" . "ataylor@redtoad.ca")) (:maintainer "Andrew Taylor" . "ataylor@redtoad.ca") (:url . "https://github.com/ataylor284/jenkins-watch"))])
+ (jenkinsfile-mode . [(20220428 1113) ((emacs (24)) (groovy-mode (2 0))) "Major mode for editing Jenkins declarative pipeline syntax" single ((:commit . "fa5545be1329df3067dcfd81749bbd99df070d6b") (:url . "https://github.com/john2x/jenkinsfile-mode"))])
+ (jest . [(20220114 213) ((emacs (24 4)) (dash (2 18 0)) (magit-popup (2 12 0)) (projectile (0 14 0)) (s (1 12 0)) (js2-mode (20180301)) (cl-lib (0 6 1))) "helpers to run jest" single ((:commit . "760a783a190afb23e12cf3cf3d8949e9a53c7c79") (:authors ("Edmund Miller" . "edmund.a.miller@gmail.com")) (:maintainer "Edmund Miller" . "edmund.a.miller@gmail.com") (:keywords "jest" "javascript" "testing") (:url . "https://github.com/emiller88/emacs-jest/"))])
+ (jest-test-mode . [(20220131 304) ((emacs (25 1))) "Minor mode for running Node.js tests using jest" single ((:commit . "e08326a467ccb1ec9ddf99c1f5d53f55c50e52b4") (:authors ("Raymond Huang" . "rymndhng@gmail.com")) (:maintainer "Raymond Huang" . "rymndhng@gmail.com") (:url . "https://github.com/rymndhng/jest-test-mode.el"))])
+ (jetbrains . [(20180301 502) ((emacs (24 3)) (cl-lib (0 5)) (f (0 17))) "JetBrains IDE bridge" single ((:commit . "56f71a17d455581c10d48f6dbb31d9e2126227bf") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "tools" "php") (:url . "https://github.com/emacs-php/jetbrains.el"))])
+ (jetbrains-darcula-theme . [(20210602 1430) nil "A complete port of the default JetBrains Darcula theme" single ((:commit . "296e3ca6e0341d9882f4771131a386fe2991e913") (:authors ("Ian Y.E. Pan")) (:maintainer "Ian Y.E. Pan") (:url . "https://github.com/ianpan870102/jetbrains-darcula-emacs-theme"))])
+ (jg-quicknav . [(20170809 130) ((s (1 9 0)) (cl-lib (0 5))) "Quickly navigate the file system to find a file." single ((:commit . "c8d53e774d63e68a944092c08a026b57da741038") (:authors ("Jeff Gran" . "jeff@jeffgran.com")) (:maintainer "Jeff Gran" . "jeff@jeffgran.com") (:keywords "navigation") (:url . "https://github.com/jeffgran/jg-quicknav"))])
+ (jinja2-mode . [(20220117 807) nil "A major mode for jinja2" single ((:commit . "03e5430a7efe1d163a16beaf3c82c5fd2c2caee1") (:authors ("Florian Mounier aka paradoxxxzero")) (:maintainer "Florian Mounier aka paradoxxxzero"))])
+ (jira-markup-mode . [(20150601 2109) nil "Emacs Major mode for JIRA-markup-formatted text files" single ((:commit . "4fc534c47df26a2f402bf835ebe2ed89474a4062") (:authors ("Matthias Nuessler" . "m.nuessler@web.de>")) (:maintainer "Matthias Nuessler" . "m.nuessler@web.de>") (:keywords "jira" "markup") (:url . "https://github.com/mnuessler/jira-markup-mode"))])
+ (jiralib2 . [(20200520 2031) ((emacs (25)) (request (0 3)) (dash (2 14 1))) "JIRA REST API bindings to Elisp" single ((:commit . "c21c4e759eff549dbda11099f2f680b78d7f5a01") (:authors ("Henrik Nyman" . "h@nyymanni.com")) (:maintainer "Henrik Nyman" . "h@nyymanni.com") (:keywords "comm" "jira" "rest" "api") (:url . "https://github.com/nyyManni/jiralib2"))])
+ (jist . [(20161229 1721) ((emacs (24 4)) (dash (2 12 0)) (seq (1 11)) (let-alist (1 0 4)) (magit (2 1 0)) (request (0 2 0))) "Gist integration" single ((:commit . "da0692452e312a99bb27d8708504b521798aca48") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "convenience") (:url . "https://github.com/emacs-pe/jist.el"))])
+ (jknav . [(20121006 2025) nil "Automatically enable j/k keys for line-based navigation" single ((:commit . "861245715c728503dad6573278fdd75c271dbf8b") (:authors ("Aaron Culich" . "aculich@gmail.com")) (:maintainer "Aaron Culich" . "aculich@gmail.com") (:keywords "keyboard" "navigation"))])
+ (jmt-mode . [(20220510 430) ((emacs (24 4))) "Java Mode Tamed" single ((:commit . "f968413df2c2bd1e00c5b6c61c53bdd208b90ee3") (:authors ("Michael Allan" . "mike@reluk.ca")) (:maintainer "Michael Allan" . "mike@reluk.ca") (:keywords "c" "languages") (:url . "http://reluk.ca/project/Java/Emacs/"))])
+ (jonprl-mode . [(20160819 59) ((emacs (24 3)) (cl-lib (0 5)) (yasnippet (0 8 0))) "A major mode for editing JonPRL files" tar ((:commit . "6059bb64891fae45827174e044d6a87ac07172d8") (:authors ("David Raymond Christiansen" . "david@davidchristiansen.dk")) (:maintainer "David Raymond Christiansen" . "david@davidchristiansen.dk") (:keywords "languages"))])
+ (journalctl-mode . [(20201217 1625) ((emacs (24 1))) "Sample major mode for viewing output journalctl" single ((:commit . "c5bca1a5f42d2fe2a00fdf52fe480137ace971d3") (:authors ("Sebastian Meisel" . "sebastian.meisel@gmail.com")) (:maintainer "Sebastian Meisel" . "sebastian.meisel@gmail.com") (:keywords "unix") (:url . "https://github.com/SebastianMeisel/journalctl-mode"))])
+ (jpop . [(20170410 1250) ((emacs (24)) (dash (2 11 0)) (cl-lib (0 5))) "Lightweight project caching and navigation framework" tar ((:commit . "7628b03260be96576b34459d45959ee77d8b2110") (:authors ("Dom Charlesworth" . "dgc336@gmail.com")) (:maintainer "Dom Charlesworth" . "dgc336@gmail.com") (:keywords "project" "convenience") (:url . "https://github.com/domtronn/jpop.el"))])
+ (jq-format . [(20190428 1434) ((emacs (24)) (reformatter (0 3))) "Reformat JSON and JSONLines using jq" single ((:commit . "47e1c5adb89b37b4d53fe01302d8c675913c20e7") (:authors ("wouter bolsterlee" . "wouter@bolsterl.ee")) (:maintainer "wouter bolsterlee" . "wouter@bolsterl.ee") (:keywords "languages") (:url . "https://github.com/wbolster/emacs-jq-format"))])
+ (jq-mode . [(20200604 833) ((emacs (25 1))) "Edit jq scripts." tar ((:commit . "1af31ba701cf844f938f840ed78867c9a28174b6") (:authors ("Bjarte Johansen <Bjarte dot Johansen at gmail dot com>")) (:maintainer "Bjarte Johansen <Bjarte dot Johansen at gmail dot com>") (:url . "https://github.com/ljos/jq-mode"))])
+ (jquery-doc . [(20150812 758) nil "jQuery api documentation interface for emacs" tar ((:commit . "24032284919b942ec27707d929bdd8bf48420062") (:authors ("Anantha kumaran" . "ananthakumaran@gmail.com")) (:maintainer "Anantha kumaran" . "ananthakumaran@gmail.com") (:keywords "docs" "jquery"))])
+ (js-auto-beautify . [(20161031 509) ((web-beautify (0 3 1)) (web-mode (14 0 27))) "auto format you js/jsx file" single ((:commit . "180d15af7b5dfaab4ee1954cca2fdc797932f9de") (:authors (nil . "quanwei9958@126.com")) (:maintainer nil . "quanwei9958@126.com"))])
+ (js-auto-format-mode . [(20180807 1352) ((emacs (24))) "Minor mode for auto-formatting JavaScript code" single ((:commit . "b8b4e3e54118b38fd6003cb97e1ff6e456a24f26") (:authors ("Masafumi Koba" . "ybiquitous@gmail.com")) (:maintainer "Masafumi Koba" . "ybiquitous@gmail.com") (:keywords "languages") (:url . "https://github.com/ybiquitous/js-auto-format-mode"))])
+ (js-codemod . [(20190921 941) ((emacs (24 4))) "Run js-codemod on current sentence or selected region" tar ((:commit . "056bdf3e5e0c807b8cf17edb5834179a90fb722b") (:authors (nil . "Torgeir Thoresen <@torgeir>")) (:maintainer nil . "Torgeir Thoresen <@torgeir>") (:keywords "js" "codemod" "region"))])
+ (js-comint . [(20200117 615) ((emacs (24 3))) "JavaScript interpreter in window." single ((:commit . "7920252e88eb610add7c9760f7016bb9b884307a") (:authors ("Paul Huff" . "paul.huff@gmail.com")) (:maintainer "Chen Bin <chenbin.sh AT gmail DOT com>") (:keywords "javascript" "node" "inferior-mode" "convenience") (:url . "https://github.com/redguardtoo/js-comint"))])
+ (js-doc . [(20160715 434) nil "Insert JsDoc style comment easily" single ((:commit . "f0606e89d5aa89146f96edb38cf69af0068a9d1e") (:authors ("mooz" . "stillpedant@gmail.com")) (:maintainer "mooz" . "stillpedant@gmail.com") (:keywords "document" "comment") (:url . "https://github.com/mooz/js-doc"))])
+ (js-format . [(20170119 102) ((emacs (24 1)) (js2-mode (20101228))) "Format or transform code style using NodeJS server with different javascript formatter" tar ((:commit . "544bda9be72b74ec2d442543ba60cff727d96669") (:authors ("James Yang" . "jamesyang999@gmail.com")) (:maintainer "James Yang" . "jamesyang999@gmail.com") (:keywords "js" "javascript" "format" "standard" "jsbeautify" "esformatter" "airbnb") (:url . "http://github.com/futurist/js-format.el"))])
+ (js-import . [(20210105 829) ((emacs (24 4)) (f (0 19 0)) (projectile (0 14 0)) (dash (2 13 0))) "Import Javascript files from your current project or dependencies" single ((:commit . "941091b3ab074c482a5920194d61f50e9b50d503") (:authors ("Jakob Lind" . "karl.jakob.lind@gmail.com")) (:maintainer "Jakob Lind" . "karl.jakob.lind@gmail.com") (:keywords "tools") (:url . "https://github.com/jakoblind/js-import"))])
+ (js-react-redux-yasnippets . [(20200316 1144) ((emacs (24 3)) (yasnippet (0 8 0))) "JavaScript,React,Redux yasnippets" tar ((:commit . "9f509043f01fa59bff4daf31b2e95d63f8deab4a") (:authors ("sooqua")) (:maintainer "sooqua") (:keywords "convenience" "snippets") (:url . "https://github.com/sooqua/js-react-redux-yasnippets"))])
+ (js2-closure . [(20170816 1918) ((js2-mode (20150909))) "Google Closure dependency manager" single ((:commit . "f59db386d7d0693935d0bf52babcd2c203c06d04") (:authors ("Justine Tunney" . "jart@google.com")) (:maintainer "Justine Tunney" . "jart@google.com") (:keywords "javascript" "closure") (:url . "http://github.com/jart/js2-closure"))])
+ (js2-highlight-vars . [(20170418 1829) ((emacs (24 4)) (js2-mode (20150908))) "highlight occurrences of the variable under cursor" single ((:commit . "e3bb177e50f76b272e8073a94d4f46be6512a163") (:authors ("Mihai Bazon" . "mihai.bazon@gmail.com")) (:maintainer "Mihai Bazon" . "mihai.bazon@gmail.com") (:url . "http://mihai.bazon.net/projects/editing-javascript-with-emacs-js2-mode/js2-highlight-vars-mode"))])
+ (js2-mode . [(20220402 2211) ((emacs (24 1)) (cl-lib (0 5))) "Improved JavaScript editing mode" tar ((:commit . "fed41615b26404e0bfd7e4f64643981ca798a34b") (:authors ("Steve Yegge" . "steve.yegge@gmail.com") ("mooz" . "stillpedant@gmail.com") ("Dmitry Gutov" . "dgutov@yandex.ru")) (:maintainer "Steve Yegge" . "steve.yegge@gmail.com") (:keywords "languages" "javascript") (:url . "https://github.com/mooz/js2-mode/"))])
+ (js2-refactor . [(20210306 2003) ((js2-mode (20101228)) (s (1 9 0)) (multiple-cursors (1 0 0)) (dash (1 0 0)) (s (1 0 0)) (yasnippet (0 9 0 1))) "A JavaScript refactoring library for emacs." tar ((:commit . "a0977c4ce1918cc266db9d6cd7a2ab63f3a76b9a") (:authors ("Magnar Sveen" . "magnars@gmail.com") ("Nicolas Petton" . "nicolas@petton.fr")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "conveniences"))])
+ (js2hl . [(20201119 816) ((emacs (25 1)) (js2-mode (20190219))) "Highlight/rename things using js2-mode parser" single ((:commit . "ab01c290860ab0d8f43afcf1f7466fdced24e123") (:authors ("Chen Bin <chenbin DOT sh AT gmail DOT com>")) (:maintainer "Chen Bin <chenbin DOT sh AT gmail DOT com>") (:keywords "convenience") (:url . "https://github.com/redguardtoo/js2hl"))])
+ (js3-mode . [(20160515 1550) nil "An improved JavaScript editing mode" tar ((:commit . "229aeb374f1b1f3ee5c59b8ba3eebb6385c232cb") (:authors ("Thom Blake" . "webmaster@thomblake.com")) (:maintainer "Thom Blake" . "webmaster@thomblake.com") (:keywords "javascript" "languages"))])
+ (jscs . [(20151015 1749) ((emacs (24 1)) (cl-lib (0 5))) "Consistent JavaScript editing using JSCS" single ((:commit . "9d39d0f2355e69a020bf76242504f3a33e013ccf") (:authors ("papaeye" . "papaeye@gmail.com")) (:maintainer "papaeye" . "papaeye@gmail.com") (:keywords "languages" "convenience") (:url . "https://github.com/papaeye/emacs-jscs"))])
+ (jsfmt . [(20180920 1008) nil "Interface to jsfmt command for javascript files" single ((:commit . "ca141a135c7700eaedef92561d334e1fb7dc28a1") (:authors ("Brett Langdon" . "brett@blangdon.com")) (:maintainer "Brett Langdon" . "brett@blangdon.com") (:url . "https://github.com/brettlangdon/jsfmt.el"))])
+ (json-mode . [(20211011 630) ((json-snatcher (1 0 0)) (emacs (24 4))) "Major mode for editing JSON files." single ((:commit . "eedb4560034f795a7950fa07016bd4347c368873") (:authors ("Josh Johnston")) (:maintainer "Josh Johnston") (:url . "https://github.com/joshwnj/json-mode"))])
+ (json-navigator . [(20191213 755) ((emacs (25 1)) (hierarchy (0 6 0))) "View and navigate JSON structures" single ((:commit . "afd902e0b5cde37fad4786515a695d17f1625286") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:url . "https://github.com/DamienCassou/json-navigator"))])
+ (json-par . [(20220122 352) ((emacs (24 4)) (json-mode (1 7 0))) "Minor mode for structural editing of JSON" tar ((:commit . "962e5a2221136aa07f512834925c381cfeed2d92") (:authors ("taku0 (http://github.com/taku0)")) (:maintainer "taku0 (http://github.com/taku0)") (:keywords "abbrev" "convenience" "files") (:url . "https://github.com/taku0/json-par"))])
+ (json-process-client . [(20210525 733) ((emacs (25 1))) "Interact with a TCP process using JSON" single ((:commit . "373b2cc7e3d26dc00594e0b2c1bb66815aad2826") (:authors ("Nicolas Petton" . "nicolas@petton.fr") ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Nicolas Petton" . "nicolas@petton.fr") (:url . "https://gitlab.petton.fr/nico/json-process-client"))])
+ (json-reformat . [(20160212 853) nil "Reformatting tool for JSON" single ((:commit . "8eb6668ed447988aea06467ba8f42e1f2178246f") (:authors ("Wataru MIYAGUNI" . "gonngo@gmail.com")) (:maintainer "Wataru MIYAGUNI" . "gonngo@gmail.com") (:keywords "json") (:url . "https://github.com/gongo/json-reformat"))])
+ (json-rpc . [(20200417 1629) ((emacs (24 1)) (cl-lib (0 5))) "JSON-RPC library" single ((:commit . "81a5a520072e20d18aeab2aac4d66c046b031e56") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/elisp-json-rpc"))])
+ (json-rpc-server . [(20220205 1503) ((emacs (26))) "Server-side JSON-RPC library." single ((:commit . "9bf7efd5c69f429acbac41f33a1c9fdaddcb9914") (:authors ("GitHub user \"Jcaw\"")) (:maintainer "GitHub user \"Jcaw\"") (:keywords "tools" "comm" "json" "rpc") (:url . "https://github.com/jcaw/json-rpc-server.el"))])
+ (json-snatcher . [(20200916 1717) ((emacs (24))) "Grabs the path to JSON values in a JSON file" single ((:commit . "b28d1c0670636da6db508d03872d96ffddbc10f2") (:authors ("Sterling Graham" . "sterlingrgraham@gmail.com")) (:maintainer "Sterling Graham" . "sterlingrgraham@gmail.com") (:url . "http://github.com/sterlingg/json-snatcher"))])
+ (jsonl . [(20190623 509) ((emacs (25))) "Utility functions for working with line-delimited JSON" single ((:commit . "3dd0b7bb2b4bce9f9de7367941f0cc78f82049c9") (:authors ("Erik Anderson" . "erik@ebpa.link")) (:maintainer "Erik Anderson" . "erik@ebpa.link") (:keywords "tools") (:url . "https://github.com/ebpa/jsonl.el"))])
+ (jsonnet-mode . [(20220121 2109) ((emacs (24)) (dash (2 17 0))) "Major mode for editing jsonnet files" single ((:commit . "7c9961b084b1ea352555317076bc27a512dd341f") (:authors ("Nick Lanham")) (:maintainer "Nick Lanham") (:keywords "languages") (:url . "https://github.com/mgyucht/jsonnet-mode"))])
+ (jss . [(20130508 1423) ((emacs (24 1)) (websocket (0)) (js2-mode (0))) "An emacs interface to webkit and mozilla debuggers" tar ((:commit . "41749257aecf13c7bd6ed489b5ab3304d06e40bc") (:authors ("Marco Baringer" . "mb@bese.it")) (:maintainer "Marco Baringer" . "mb@bese.it") (:keywords "languages"))])
+ (jst . [(20150604 1138) ((s (1 9)) (f (0 17)) (dash (2 10)) (pcache (0 3)) (emacs (24 4))) "JS test mode" single ((:commit . "2a3fd16c992f7790dc67134ef06a814c3d20579c") (:authors ("Cheung Hoi Yu" . "yeannylam@gmail.com")) (:maintainer "Cheung Hoi Yu" . "yeannylam@gmail.com") (:keywords "js" "javascript" "jasmine" "coffee" "coffeescript") (:url . "https://github.com/cheunghy/jst-mode"))])
+ (jtags . [(20160211 2029) nil "enhanced tags functionality for Java development" tar ((:commit . "b50daa48510f71e74ce0ec2eb85030896a79cf96") (:authors ("Alexander Baltatzis" . "alexander@baltatzis.com") ("Johan Dykstrom" . "jody4711-sf@yahoo.se")) (:maintainer "Johan Dykstrom" . "jody4711-sf@yahoo.se") (:keywords "languages" "tools") (:url . "http://jtags.sourceforge.net"))])
+ (julia-formatter . [(20220106 1414) ((emacs (27 1))) "Use JuliaFormatter.jl for julia code" single ((:commit . "a86a526a4e5755eaa67b2d9c040c5679d6f04bf4") (:authors ("Felipe Lema" . "felipe.lema@mortemale.org")) (:maintainer "Felipe Lema" . "felipe.lema@mortemale.org") (:keywords "convenience" "tools") (:url . "https://codeberg.org/FelipeLema/julia-formatter.el"))])
+ (julia-mode . [(20220418 809) ((emacs (24 3))) "Major mode for editing Julia source code" tar ((:commit . "adf4029be778c5983c436873b8a78bc72a6b09f8") (:keywords "languages") (:url . "https://github.com/JuliaEditorSupport/julia-emacs"))])
+ (julia-repl . [(20220428 541) ((emacs (25 1)) (s (1 12))) "A minor mode for a Julia REPL" single ((:commit . "2342003662071cf7b256f0a7cd8f545bcffaf22a") (:authors ("Tamas Papp" . "tkpapp@gmail.com")) (:maintainer "Tamas Papp" . "tkpapp@gmail.com") (:keywords "languages") (:url . "https://github.com/tpapp/julia-repl"))])
+ (julia-shell . [(20161125 1910) ((julia-mode (0 3))) "Major mode for an inferior Julia shell" tar ((:commit . "583a0b2ca20461ab4356929fd0f2212c22341b69") (:authors ("Dennis Ogbe" . "dogbe@purdue.edu")) (:maintainer "Dennis Ogbe" . "dogbe@purdue.edu"))])
+ (julia-snail . [(20220508 456) ((emacs (26 2)) (dash (2 16 0)) (julia-mode (0 3)) (s (1 12 0)) (spinner (1 7 3)) (vterm (0 0 1)) (popup (0 5 9))) "Julia Snail" tar ((:commit . "47cfc8cc0c5b383b0647c91e657f1ffeaf73cce8") (:url . "https://github.com/gcv/julia-snail"))])
+ (julia-vterm . [(20220503 7) ((emacs (25 1)) (vterm (0 0 1))) "A mode for Julia REPL using vterm" single ((:commit . "443924f6eb77d64a20b4b34a99d3c7d2d54f73a8") (:authors ("Shigeaki Nishina")) (:maintainer "Shigeaki Nishina") (:keywords "languages" "julia") (:url . "https://github.com/shg/julia-vterm.el"))])
+ (jumblr . [(20170727 2043) ((s (1 8 0)) (dash (2 2 0))) "an anagram game for emacs" tar ((:commit . "34533dfb9db8538c005f4eaffafeff7ed193729f") (:keywords "anagram" "word game" "games") (:url . "https://github.com/mkmcc/jumblr"))])
+ (jump . [(20161127 128) ((findr (0 7)) (inflections (2 4)) (cl-lib (0 5))) "build functions which contextually jump between files" single ((:commit . "55caa66a7cc6e0b1a76143fd40eff38416928941") (:authors ("Eric Schulte")) (:maintainer "Eric Schulte") (:keywords "project" "convenience" "navigation") (:url . "http://github.com/eschulte/jump.el"))])
+ (jump-char . [(20180601 1348) nil "navigation by char" single ((:commit . "1e31a3c687f2b3c71bbfab881c6d75915534bb9e") (:authors ("Le Wang")) (:maintainer "Le Wang") (:url . "https://github.com/lewang/jump-char"))])
+ (jump-to-line . [(20130122 1653) nil "Jump to line number at point." single ((:commit . "01ef8c3529d85e6c59cc20840acbc4a8e8325bc8") (:authors ("ongaeshi")) (:maintainer "ongaeshi") (:keywords "jump" "line" "back" "file" "ruby" "csharp" "python" "perl"))])
+ (jump-tree . [(20171014 1551) nil "Treat position history as a tree" tar ((:commit . "282267dc6305889e31d46b405b7ad4dfe5923b66") (:authors ("Wen Yang" . "yangwen0228@foxmail.com")) (:maintainer "Wen Yang" . "yangwen0228@foxmail.com") (:keywords "convenience" "position" "jump" "tree") (:url . "https://github.com/yangwen0228/jump-tree"))])
+ (jumplist . [(20151120 345) ((cl-lib (0 5))) "Jump like vim jumplist or ex jumplist" single ((:commit . "c482d137d95bc5e1bcd790cdbde25b7f729b2502") (:authors ("ganmacs <ganmacs_at_gmail.com>")) (:maintainer "ganmacs <ganmacs_at_gmail.com>") (:keywords "jumplist" "vim") (:url . "https://github.com/ganmacs/jumplist"))])
+ (jupyter . [(20220419 1852) ((emacs (26)) (zmq (0 10 3)) (cl-lib (0 5)) (simple-httpd (1 5 0)) (websocket (1 9))) "Jupyter" tar ((:commit . "7d20c0aee2f9c896215f35232905b23532ef04c5") (:authors ("Nathaniel Nicandro" . "nathanielnicandro@gmail.com")) (:maintainer "Nathaniel Nicandro" . "nathanielnicandro@gmail.com") (:url . "https://github.com/dzop/emacs-jupyter"))])
+ (just-mode . [(20220401 1814) ((emacs (26 1))) "Justfile editing mode" single ((:commit . "35f1bd4748cd3e960e6930b34310e5506212b304") (:authors ("Leon Barrett" . "leon@barrettnexus.com")) (:maintainer "Leon Barrett" . "leon@barrettnexus.com") (:keywords "files" "languages" "tools") (:url . "https://github.com/leon-barrett/just-mode.el"))])
+ (justl . [(20220312 1104) ((transient (0 1 0)) (emacs (25 3)) (xterm-color (2 0)) (s (1 2 0)) (f (0 20 0))) "Major mode for driving just files" single ((:commit . "9f77366aaf2227bb0cbd3cdc0f78088032f2e873") (:authors ("Sibi Prabakaran")) (:maintainer "Sibi Prabakaran") (:keywords "just" "justfile" "tools" "processes") (:url . "https://github.com/psibi/justl.el"))])
+ (jvm-mode . [(20150422 708) ((dash (2 6 0)) (emacs (24))) "Monitor and manage your JVMs" single ((:commit . "3355dbaf5b0185aadfbad24160399abb32c5bea0") (:authors ("Martin Trojer" . "martin.trojer@gmail.com")) (:maintainer "Martin Trojer" . "martin.trojer@gmail.com") (:keywords "convenience") (:url . "https://github.com/martintrojer/jvm-mode.el"))])
+ (k8s-mode . [(20211121 518) ((emacs (24 3)) (yaml-mode (0 0 10))) "Major mode for Kubernetes configuration file" tar ((:commit . "083bcffbfeeaf5e79015a012b4dbf2f283a493ab") (:authors ("Giap Tran" . "txgvnn@gmail.com")) (:maintainer "Giap Tran" . "txgvnn@gmail.com") (:url . "https://github.com/TxGVNN/emacs-k8s-mode"))])
+ (kaesar . [(20160128 1008) ((cl-lib (0 3))) "Another AES algorithm encrypt/decrypt string with password." single ((:commit . "d087075cb1a46c2c85cd075220e09b2eaef9b86e") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "data") (:url . "https://github.com/mhayashi1120/Emacs-kaesar"))])
+ (kaesar-file . [(20160128 1008) ((kaesar (0 1 1))) "Encrypt/Decrypt file by AES with password." single ((:commit . "d087075cb1a46c2c85cd075220e09b2eaef9b86e") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "data" "files") (:url . "https://github.com/mhayashi1120/Emacs-kaesar"))])
+ (kaesar-mode . [(20160128 1008) ((kaesar (0 1 4)) (cl-lib (0 3))) "Encrypt/Decrypt buffer by AES with password." single ((:commit . "d087075cb1a46c2c85cd075220e09b2eaef9b86e") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "data" "convenience") (:url . "https://github.com/mhayashi1120/Emacs-kaesar"))])
+ (kakapo-mode . [(20171004 451) ((cl-lib (0 5))) "TABS (hard or soft) for indentation (leading whitespace), and SPACES for alignment." single ((:commit . "292e07203c676361a1d918deb5acf2123cd70eaf") (:keywords "indentation") (:url . "https://github.com/listx/kakapo-mode"))])
+ (kakoune . [(20210220 1858) ((ryo-modal (0 45)) (multiple-cursors (1 4)) (expand-region (0 11 0)) (emacs (25 1))) "A simulation, but not emulation, of kakoune" tar ((:commit . "d81bd00323ba10343a28bc855ee5ddbd09b7d2a5") (:authors ("Joseph Morag" . "jm4157@columbia.edu")) (:maintainer "Joseph Morag" . "jm4157@columbia.edu") (:url . "https://github.com/jmorag/kakoune.el"))])
+ (kaleidoscope . [(20170808 817) ((s (1 11 0))) "Controlling Kaleidoscope-powered devices." single ((:commit . "af4034dcace867c4ede0bce744d5cb888c318f23") (:authors ("Gergely Nagy")) (:maintainer "Gergely Nagy") (:url . "https://github.com/algernon/kaleidoscope.el"))])
+ (kaleidoscope-evil-state-flash . [(20170728 1020) ((evil (1 2 12)) (kaleidoscope (0 1 0)) (s (1 11 0))) "Flash keyboard LEDs when changing Evil state" single ((:commit . "af4034dcace867c4ede0bce744d5cb888c318f23") (:authors ("Gergely Nagy")) (:maintainer "Gergely Nagy") (:url . "https://github.com/algernon/kaleidoscope.el"))])
+ (kana . [(20210531 1427) ((emacs (24 4)) (dash (2 17 0))) "Learn Japanese hiragana and katakana" single ((:commit . "d3d550aad67ef8625b3860598bf3622f5b2a7d32") (:authors ("Damon Chan" . "elecming@gmail.com")) (:maintainer "Damon Chan" . "elecming@gmail.com") (:keywords "tools") (:url . "https://github.com/chenyanming/kana"))])
+ (kanban . [(20170418 810) nil "Parse org-todo headlines to use org-tables as Kanban tables" single ((:commit . "fcf0173ce0144e59de97ba8a7808192620e5f8f4") (:authors ("Arne Babenhauserheide" . "arne_bab@web.de")) (:maintainer "Arne Babenhauserheide" . "arne_bab@web.de") (:keywords "outlines" "convenience"))])
+ (kanji-mode . [(20160826 1139) nil "View stroke order for kanji characters at cursor" tar ((:commit . "eda4f8666486689d36317db7dbda54fb73d3e3d2") (:authors ("Wojciech Gac" . "wojciech.s.gac@gmail.com")) (:maintainer "Wojciech Gac" . "wojciech.s.gac@gmail.com") (:url . "http://github.com/wsgac/kanji-mode "))])
+ (kaocha-runner . [(20190904 1950) ((emacs (26)) (s (1 4 0)) (cider (0 21 0)) (parseedn (0 1 0))) "A package for running Kaocha tests via CIDER." single ((:commit . "755b0dfb3bd676c769c4b4aeb81c2cd5828bd207") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:url . "https://github.com/magnars/kaocha-runner.el"))])
+ (kaolin-themes . [(20220422 1305) ((emacs (25 1)) (autothemer (0 2 2)) (cl-lib (0 6))) "A set of eye pleasing themes" tar ((:commit . "51b1f719bc300a4f684b6dc7511dfb044f75f575") (:authors ("Ogden Webb" . "ogdenwebb@gmail.com")) (:maintainer "Ogden Webb" . "ogdenwebb@gmail.com") (:keywords "dark" "light" "teal" "blue" "violet" "purple" "brown" "theme" "faces") (:url . "https://github.com/ogdenwebb/emacs-kaolin-themes"))])
+ (kaomoji . [(20171227 440) ((emacs (24 3)) (helm-core (1 9 1))) "Input kaomoji superb easily" tar ((:commit . "90a1490743b2a30762f5454c9d9309018eff83dd") (:authors ("Ono Hiroko" . "azazabc123@gmail.com")) (:maintainer "Ono Hiroko" . "azazabc123@gmail.com") (:keywords "tools" "fun") (:url . "https://github.com/kuanyui/kaomoji.el"))])
+ (kapacitor . [(20190414 1908) ((emacs (25 1)) (magit (2 13 0)) (magit-popup (2 12 4))) "Main file for kapacitor-mode" single ((:commit . "e3300d8b4017a2f66b0d929cb85bcc7ee2612072") (:authors ("Manoj Kumar Manikchand" . "manojm.321@gmail.com")) (:maintainer "Manoj Kumar Manikchand" . "manojm.321@gmail.com") (:keywords "kapacitor" "emacs" "magit" "tools") (:url . "http://github.com/Manoj321/kapacitor-el"))])
+ (karma . [(20160220 1245) ((pkg-info (0 4)) (emacs (24))) "Karma Test Runner Emacs Integration" single ((:commit . "31d3e7708246183d7ed0686be92bf23140af348c") (:authors ("Samuel Tonini")) (:maintainer "Samuel Tonini") (:keywords "language" "javascript" "js" "karma" "testing") (:url . "http://github.com/tonini/karma.el"))])
+ (kconfig-mode . [(20211018 2142) ((emacs (24 3))) "Major mode for editing Kconfig files" single ((:commit . "241436a507782d18f09dab7d1f373ddea60fad3d") (:authors ("Dela Anthonio" . "dell.anthonio@gmail.com")) (:maintainer "Dela Anthonio" . "dell.anthonio@gmail.com") (:keywords "kconfig" "languages" "linux" "kernel") (:url . "https://github.com/delaanthonio/kconfig-mode"))])
+ (kdeconnect . [(20210519 2016) nil "An interface for KDE Connect" single ((:commit . "4977af8cb5fdc21da770f3ee43ad7823f2937da3") (:authors ("Carl Lieberman" . "dev@carl.ac")) (:maintainer "Carl Lieberman" . "dev@carl.ac") (:keywords "kdeconnect" "android"))])
+ (keepass-mode . [(20211030 948) ((emacs (27))) "Mode to open Keepass DB" single ((:commit . "be190a86fd82337fe5280c1833f92d1f9997bced") (:authors ("Ignasi Fosch" . "natx@y10k.ws")) (:maintainer "Ignasi Fosch" . "natx@y10k.ws") (:keywords "data" "files" "tools") (:url . "https://github.com/ifosch/keepass-mode"))])
+ (keg . [(20220309 647) ((emacs (24 1))) "Modern Elisp package development system" tar ((:commit . "944e36144d92a798e1fd0f3d83fc6347d57a976e") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience") (:url . "https://github.com/conao3/keg.el"))])
+ (keg-mode . [(20220307 829) ((emacs (24 4))) "Major mode for editing Keg files" single ((:commit . "944e36144d92a798e1fd0f3d83fc6347d57a976e") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience") (:url . "https://github.com/conao3/keg.el"))])
+ (kerl . [(20150424 2005) nil "Emacs integration for kerl" single ((:commit . "1732ee26213f021bf040919c45ad276aafcaae14") (:authors ("Correl Roush" . "correl@gmail.com")) (:maintainer "Correl Roush" . "correl@gmail.com") (:keywords "tools") (:url . "http://github.com/correl/kerl.el/"))])
+ (key-assist . [(20210722 758) ((emacs (24 3))) "Minibuffer keybinding cheatsheet and launcher" single ((:commit . "8e5cd089e0b2fedec57c55eeff74cdb6121441aa") (:authors ("Boruch Baum" . "boruch_baum@gmx.com")) (:maintainer "Boruch Baum" . "boruch_baum@gmx.com") (:keywords "abbrev" "convenience" "docs" "help") (:url . "https://github.com/Boruch-Baum/emacs-key-assist"))])
+ (key-chord . [(20201222 2030) ((emacs (24))) "map pairs of simultaneously pressed keys to commands" single ((:commit . "7f7fd7c5bd2b996fa054779357e1566f7989e07d") (:authors ("David Andersson <l.david.andersson(at)sverige.nu>")) (:maintainer "David Andersson <l.david.andersson(at)sverige.nu>") (:keywords "keyboard" "chord" "input"))])
+ (key-combo . [(20150324 1439) nil "map key sequence to commands" single ((:commit . "2fb5c65bc82d5bd2964e2b163822429ab45d90a1") (:authors ("Yuuki Arisawa" . "yuuki.ari@gmail.com")) (:maintainer "Vitalie Spinu" . "spinuvit@gmail.com") (:keywords "keyboard" "input") (:url . "https://github.com/uk-ar/key-combo"))])
+ (key-intercept . [(20140211 749) nil "Intercept prefix keys" single ((:commit . "d9a60edb4ce893f2d3d94f242164fdcc62d43cf2") (:authors ("INA Lintaro <tarao.gnn at gmail.com>")) (:maintainer "INA Lintaro <tarao.gnn at gmail.com>") (:keywords "keyboard") (:url . "http://github.com/tarao/key-intercept-el"))])
+ (key-leap . [(20160831 1447) ((emacs (24 3))) "Leap between lines by typing keywords" single ((:commit . "b3f6ef15c8a13870475d5af159fa24b30f97dea0") (:authors ("Martin Rykfors" . "martinrykfors@gmail.com")) (:maintainer "Martin Rykfors" . "martinrykfors@gmail.com") (:keywords "point" "convenience") (:url . "https://github.com/MartinRykfors/key-leap"))])
+ (key-quiz . [(20200226 2129) ((emacs (26))) "Emacs Keys Quiz" single ((:commit . "6d31fcf78a1ab1841f735dfb5cbd2bf6b2ed25db") (:authors ("Federico Tedin" . "federicotedin@gmail.com")) (:maintainer "Federico Tedin" . "federicotedin@gmail.com") (:keywords "games") (:url . "https://github.com/federicotdn/key-quiz"))])
+ (key-seq . [(20150907 756) ((key-chord (0 6))) "map pairs of sequentially pressed keys to commands" single ((:commit . "e29b083a6427d061638749194fc249ef69ad2cc0") (:authors ("Vyacheslav Levit" . "dev@vlevit.org")) (:maintainer "Vyacheslav Levit" . "dev@vlevit.org") (:keywords "convenience" "keyboard" "keybindings") (:url . "http://github.com/vlevit/key-seq.el"))])
+ (keycast . [(20220422 1611) ((emacs (25 3)) (compat (28 1 1 0))) "Show current command and its binding" single ((:commit . "296fba536287e7a0d88109e75a0bc0181647dc5e") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "multimedia") (:url . "https://github.com/tarsius/keycast"))])
+ (keychain-environment . [(20180318 2223) nil "load keychain environment variables" single ((:commit . "d3643196de6dc79ea77f9f4805028350fd76100b") (:authors ("Paul Tipper <bluefoo at googlemail dot com>")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "gnupg" "pgp" "ssh") (:url . "https://github.com/tarsius/keychain-environment"))])
+ (keydef . [(20090428 1931) nil "a simpler way to define keys, with kbd syntax" single ((:commit . "dff2be9f58d12d8c6a490ad0c1b2b10b55528dc0") (:authors ("Michael John Downes" . "mjd@ams.org")) (:maintainer "Michael John Downes" . "mjd@ams.org") (:keywords "convenience" "lisp" "customization" "keyboard" "keys"))])
+ (keyfreq . [(20210630 1318) ((cl-lib (0 5))) "track command frequencies" single ((:commit . "7bb36e910ae04ff1dce387e3ce73b669d299680b") (:authors ("Ryan Yeske, Michal Nazarewicz (mina86/AT/mina86.com)")) (:maintainer "David Capello, Xah lee"))])
+ (keymap-utils . [(20220422 1612) ((emacs (25 1)) (compat (28 1 1 0))) "Keymap utilities" single ((:commit . "f95fded924a7184a638ef233324fcda34c60ff7e") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "convenience" "extensions") (:url . "https://github.com/tarsius/keymap-utils"))])
+ (keypress-multi-event . [(20190109 530) ((emacs (24 3))) "Perform different actions for the same keypress." single ((:commit . "f7041deccd9d03066c2fe41c3443c42a4713ac02") (:authors ("Boruch Baum" . "boruch_baum@gmx.com")) (:maintainer "Boruch Baum" . "boruch_baum@gmx.com") (:keywords "abbrev" "convenience" "wp" "keyboard") (:url . "https://www.github.com/Boruch_Baum/emacs-keypress-multi-event"))])
+ (keypression . [(20200819 534) ((emacs (26 3))) "Keystroke visualizer" single ((:commit . "9427241f3fa539e4b5ad7581a05eb7e49f2cf518") (:authors ("chuntaro" . "chuntaro@sakura-games.jp")) (:maintainer "chuntaro" . "chuntaro@sakura-games.jp") (:keywords "key" "screencast" "tools") (:url . "https://github.com/chuntaro/emacs-keypression"))])
+ (keyset . [(20150220 530) ((dash (2 8 0)) (cl-lib (0 5))) "A small library for structuring key bindings." single ((:commit . "45ce83c4b56f064874256db37e697a63b2c69e65") (:authors ("Hiroki YAMAKAWA" . "s06139@gmail.com")) (:maintainer "Hiroki YAMAKAWA" . "s06139@gmail.com") (:url . "https://github.com/HKey/keyset"))])
+ (keystore-mode . [(20190409 1946) ((emacs (24 3)) (origami (1 0)) (s (1 12 0)) (seq (2 20))) "A major mode for viewing and managing (java) keystores" tar ((:commit . "43bd5926348298d077c7221f37902c990df3f951") (:authors ("Peterpaul Taekele Klein Haneveld" . "pp.kleinhaneveld@gmail.com")) (:maintainer "Peterpaul Taekele Klein Haneveld" . "pp.kleinhaneveld@gmail.com") (:keywords "tools") (:url . "https://github.com/peterpaul/keystore-mode"))])
+ (keyswap . [(20160813 957) ((emacs (24 3))) "swap bindings between key pairs" single ((:commit . "cd682a7c4a8d64d6bae6a005db5045232e5e7b95") (:authors ("Matthew Malcomson" . "hardenedapple@gmail.com")) (:maintainer "Matthew Malcomson" . "hardenedapple@gmail.com") (:keywords "convenience") (:url . "http://github.com/hardenedapple/keyswap.el"))])
+ (keytar . [(20220222 639) ((emacs (24 4))) "Emacs Lisp interface for node-keytar" single ((:commit . "d6fe2d51769ee5d1d84a74adeae5c3a0aa66a602") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/emacs-grammarly/keytar"))])
+ (keyword-search . [(20180424 1102) nil "browser keyword search from Emacs" tar ((:commit . "f8475ecaddb8804a9be6bee47678207c86ac8dee") (:maintainer "Jens Petersen") (:keywords "web" "search" "keyword") (:url . "https://github.com/juhp/keyword-search"))])
+ (kfg . [(20140909 538) ((f (0 17 1))) "an emacs configuration system" single ((:commit . "d2c9dd26618fb2f7bf1e7b6eae193b1cceba3c97") (:authors ("Austin Bingham" . "austin.bingham@gmail.com")) (:maintainer "Austin Bingham" . "austin.bingham@gmail.com") (:url . "https://github.com/abingham/kfg"))])
+ (khalel . [(20211114 1233) ((emacs (27 1))) "Import, edit and create calendar events through khal" single ((:commit . "a0503498ae43a50157549c661381d94578ad2bd7") (:authors ("Hanno Perrey <http://gitlab.com/hperrey>")) (:maintainer "Hanno Perrey" . "hanno@hoowl.se") (:keywords "event" "calendar" "ics" "khal") (:url . "https://gitlab.com/hperrey/khalel"))])
+ (khardel . [(20220223 934) ((emacs (27 1)) (yaml-mode (0 0 13))) "Integrate with khard" tar ((:commit . "1436ec5ef1b5b26104a4735ee64c0afe148700de") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:url . "https://github.com/DamienCassou/khardel"))])
+ (kibit-helper . [(20150508 1533) ((s (0 8)) (emacs (24))) "Conveniently use the Kibit Leiningen plugin from Emacs" single ((:commit . "16bdfff785ee05d8e74a5780f6808506d990cef7") (:authors ("Jonas Enlund") ("James Elliott" . "james@brunchboy.com")) (:maintainer "Jonas Enlund") (:keywords "languages" "clojure" "kibit") (:url . "http://www.github.com/brunchboy/kibit-helper"))])
+ (kill-or-bury-alive . [(20210320 1231) ((emacs (24 4)) (cl-lib (0 5))) "Precise control over buffer killing in Emacs" single ((:commit . "534300796d5dc528462e2d5deb4c7a8932936909") (:authors ("Mark Karpov" . "markkarpov92@gmail.com")) (:maintainer "Mark Karpov" . "markkarpov92@gmail.com") (:keywords "buffer" "killing" "convenience") (:url . "https://github.com/mrkkrp/kill-or-bury-alive"))])
+ (kill-ring-search . [(20140422 1555) nil "incremental search for the kill ring" single ((:commit . "23535b4a01a1cb1574604e36c49614e84e85c883") (:authors ("Nikolaj Schumacher <bugs * nschum de>")) (:maintainer "Nikolaj Schumacher <bugs * nschum de>") (:keywords "convenience" "matching") (:url . "http://nschum.de/src/emacs/kill-ring-search/"))])
+ (killer . [(20190128 10) nil "kill and delete text" single ((:commit . "ace0547944933440384ceeb5876b1f68c082d540") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "convenience") (:url . "http://github.com/tarsius/killer"))])
+ (kite . [(20130201 1938) ((json (1 2)) (websocket (0 93 1))) "WebKit inspector front-end" tar ((:commit . "7ed74d1147a6ddd152d3da65dc30df3517d53144") (:authors ("Julian Scheid" . "julians37@gmail.com")) (:maintainer "Julian Scheid" . "julians37@gmail.com") (:keywords "tools"))])
+ (kite-mini . [(20160508 1106) ((dash (2 11 0)) (websocket (1 5))) "Remotely evaluate JavaScript in the WebKit debugger" tar ((:commit . "a68619dbc109c7989f3448426d8c1ee9e797c11f") (:authors ("Tung Dao" . "me@tungdao.com")) (:maintainer "Tung Dao" . "me@tungdao.com") (:keywords "webkit") (:url . "https://github.com/tungd/kite-mini.el"))])
+ (kivy-mode . [(20210318 2106) nil "Emacs major mode for editing Kivy files" single ((:commit . "93ccd2058c1980207848810942dbb1a6d9edebe9") (:authors ("Dean Serenevy" . "dean@serenevy.net")) (:maintainer "Dean Serenevy" . "dean@serenevy.net"))])
+ (kiwix . [(20220316 847) ((emacs (25 1)) (request (0 3 0))) "Searching offline Wikipedia through Kiwix." tar ((:commit . "444f686a7f75db788d54f544b923a3532732eb8b") (:authors ("stardiviner" . "numbchild@gmail.com")) (:maintainer "stardiviner" . "numbchild@gmail.com") (:keywords "kiwix" "wikipedia") (:url . "https://repo.or.cz/kiwix.el.git"))])
+ (kixtart-mode . [(20150611 1604) ((emacs (24))) "major mode for Kixtart scripting files" single ((:commit . "1c2356797e7b766bbaaa2b341176a8b10499cd79") (:authors ("Ryrun <https://github.com/ryrun>")) (:maintainer "Ryrun <https://github.com/ryrun>") (:keywords "languages") (:url . "https://github.com/ryrun/kixtart-mode"))])
+ (klere-theme . [(20210320 1912) ((emacs (24))) "A dark theme with lambent color highlights and incremental grays" single ((:commit . "f9eacacc00455e6c42961ec41f24f864c2a05ace") (:authors ("Wamm K. D." . "jaft.r@outlook.com")) (:maintainer "Wamm K. D." . "jaft.r@outlook.com") (:url . "https://codeberg.org/WammKD/emacs-klere-theme"))])
+ (kmacro-x . [(20220323 2215) ((emacs (27 2))) "Keyboard macro helpers and extensions" single ((:commit . "429abd82c97031948b7681197551bb77708bd174") (:authors ("Wojciech Siewierski")) (:maintainer "Wojciech Siewierski") (:keywords "convenience") (:url . "https://github.com/vifon/kmacro-x.el"))])
+ (know-your-http-well . [(20160208 2304) nil "Look up the meaning of HTTP headers, methods, relations, status codes" tar ((:commit . "3cc5ab6d2764ab7aacb1b6e026abaccbeb6c37f2"))])
+ (kodi-remote . [(20190622 1325) ((request (0 2 0)) (let-alist (1 0 4)) (json (1 4)) (cl-lib (0 5)) (f (20190109 906))) "Remote Control for Kodi" single ((:commit . "f5e932036c16e2b61a63020e006fc601e38d181e") (:authors ("Stefan Huchler" . "stefan.huchler@mail.de")) (:maintainer "Stefan Huchler" . "stefan.huchler@mail.de") (:keywords "kodi" "tools" "convinience") (:url . "http://github.com/spiderbit/kodi-remote.el"))])
+ (kolon-mode . [(20140122 1134) nil "Syntax highlighting for Text::Xslate's Kolon syntax" single ((:commit . "5af0955e280ae991862189ebecd3937c5fc8fb9f") (:authors ("Sam Tran")) (:maintainer "Sam Tran") (:keywords "xslate" "perl") (:url . "https://github.com/samvtran/kolon-mode"))])
+ (kooten-theme . [(20161023 905) ((emacs (24 1))) "Dark color theme" single ((:commit . "d10197b4dd7af02cd14aeab2573c273a294798c3") (:authors ("Pascal van Kooten" . "kootenpv@gmail.com")) (:maintainer "Pascal van Kooten" . "kootenpv@gmail.com") (:keywords "themes") (:url . "http://github.com/kootenpv/emacs-kooten-theme"))])
+ (korean-holidays . [(20190102 1558) nil "Korean holidays for calendar." single ((:commit . "3f90ed86f46f8e5533f23baa40e2513ac497ca2b") (:authors ("SeungKi Kim" . "tttuuu888@gmail.com")) (:maintainer "SeungKi Kim" . "tttuuu888@gmail.com") (:keywords "calendar") (:url . "https://github.com/tttuuu888/korean-holidays"))])
+ (kosmos-theme . [(20170502 1850) ((emacs (24))) "Black and lightgray theme with not so much syntax highlighting." single ((:commit . "616456d2376a75dc31190ad65137d179fbad4336") (:authors ("Maxim Kim" . "habamax@gmail.com")) (:maintainer "Maxim Kim" . "habamax@gmail.com") (:url . "https://github.com/habamax/kosmos-theme"))])
+ (kotlin-mode . [(20210917 1911) ((emacs (24 3))) "Major mode for kotlin" tar ((:commit . "3e0c34087ba4965a8bf08d3f27325f0a1e631bfb") (:authors ("Shodai Yokoyama" . "quantumcars@gmail.com")) (:maintainer "Shodai Yokoyama" . "quantumcars@gmail.com") (:keywords "languages"))])
+ (kpm-list . [(20170924 1352) nil "An emacs buffer list that tries to intelligently group together buffers." single ((:commit . "e0f5112e5ce8ec1b603f4428fa51681c68bb28f5") (:authors ("Kevin Mahoney")) (:maintainer "Kevin Mahoney") (:url . "https://github.com/KMahoney/kpm-list/"))])
+ (kroman . [(20150827 2340) nil "Korean hangul romanization" single ((:commit . "90402b6ae40383e75d8ba97d66eee93eebf40f70") (:authors ("Zhang Kai Yu" . "yeannylam@gmail.com")) (:maintainer "Zhang Kai Yu" . "yeannylam@gmail.com") (:keywords "korean" "roman"))])
+ (ksp-cfg-mode . [(20190414 2348) ((emacs (24)) (cl-lib (0 5))) "major mode for editing KSP CFG files" single ((:commit . "faec8bd8456c67276d065eb68c88a30efcef59ef") (:authors ("Emily Backes" . "lucca@accela.net")) (:maintainer "Emily Backes" . "lucca@accela.net") (:keywords "data") (:url . "http://github.com/lashtear/ksp-cfg-mode"))])
+ (kubectx-mode . [(20200116 1918) ((emacs (24))) "Change kubectl context/namespace and show in mode line" single ((:commit . "f08687ae5403eb18bbeffc6dafdfde469bdb9a36") (:authors ("Terje Sannum" . "terje@offpiste.org")) (:maintainer "Terje Sannum" . "terje@offpiste.org") (:keywords "tools" "kubernetes") (:url . "https://github.com/terjesannum/emacs-kubectx-mode"))])
+ (kubedoc . [(20220401 1113) ((emacs (27 1))) "Kubernetes API Documentation" single ((:commit . "f8503f121e38f0ff9343544a5c912e50b25efd4c") (:authors ("Dean Lindqvist Todevski <https://github.com/r0bobo>")) (:maintainer "Dean Lindqvist Todevski") (:keywords "docs" "help" "k8s" "kubernetes" "tools") (:url . "https://github.com/r0bobo/kubedoc.el/"))])
+ (kubel . [(20220509 104) ((transient (0 1 0)) (emacs (25 3)) (dash (2 12 0)) (s (1 2 0)) (yaml-mode (0 0 14))) "Control Kubernetes with limited permissions" single ((:commit . "c45e19a215e8e7df80a61c10ca1fa26dcfd1de35") (:authors ("Adrien Brochard")) (:maintainer "Adrien Brochard") (:keywords "kubernetes" "k8s" "tools" "processes") (:url . "https://github.com/abrochard/kubel"))])
+ (kubel-evil . [(20220318 2124) ((kubel (1 0)) (evil (1 0)) (emacs (25 3))) "extension for kubel to provide evil keybindings" single ((:commit . "c45e19a215e8e7df80a61c10ca1fa26dcfd1de35") (:authors ("Marcel Patzwahl")) (:maintainer "Marcel Patzwahl") (:keywords "kubernetes" "k8s" "tools" "processes" "evil" "keybindings") (:url . "https://github.com/abrochard/kubel"))])
+ (kubernetes . [(20220331 1314) ((emacs (25 1)) (dash (2 12 0)) (magit-section (3 1 1)) (magit-popup (2 13 0)) (with-editor (3 0 4)) (request (0 3 2)) (s (1 12 0)) (transient (0 3 0))) "Magit-like porcelain for Kubernetes" tar ((:commit . "e0d0cd6b949802fe63ff8940cc743cc7efedb089") (:authors ("Chris Barrett" . "chris+emacs@walrus.cool")) (:maintainer "Chris Barrett" . "chris+emacs@walrus.cool") (:keywords "kubernetes") (:url . "https://github.com/kubernetes-el/kubernetes-el"))])
+ (kubernetes-evil . [(20211225 300) ((kubernetes (0 17 0)) (evil (1 2 12))) "Kubernetes keybindings for evil-mode." single ((:commit . "e0d0cd6b949802fe63ff8940cc743cc7efedb089") (:authors ("Chris Barrett" . "chris+emacs@walrus.cool")) (:maintainer "Chris Barrett" . "chris+emacs@walrus.cool"))])
+ (kubernetes-helm . [(20210902 2232) ((yaml-mode (0 0 13)) (emacs (25 3))) "extension for helm, the package manager for kubernetes" single ((:commit . "95cf92600436f67bd7bfe650763e68635f5ecc8e") (:authors ("Adrien Brochard")) (:maintainer "Adrien Brochard") (:keywords "kubernetes" "helm" "k8s" "tools" "processes") (:url . "https://github.com/abrochard/kubernetes-helm"))])
+ (kubernetes-tramp . [(20181228 922) ((emacs (24)) (cl-lib (0 5))) "TRAMP integration for kubernetes containers" single ((:commit . "8713571b66940f8f3f496b55baa23cdf1df7a869") (:authors ("Giovanni Ruggiero" . "giovanni.ruggiero+github@gmail.com")) (:maintainer "Giovanni Ruggiero" . "giovanni.ruggiero+github@gmail.com") (:keywords "kubernetes" "convenience") (:url . "https://github.com/gruggiero/kubernetes-tramp"))])
+ (kurecolor . [(20220508 929) ((emacs (24 1)) (s (1 0))) "color editing goodies for Emacs" single ((:commit . "1c80df0f2c542f54920f18aa4eb837f0a51c7676") (:authors ("Jason Milkins" . "jasonm23@gmail.com")) (:maintainer "Jason Milkins" . "jasonm23@gmail.com"))])
+ (kuronami-theme . [(20220309 604) ((emacs (24 1))) "A deep blue theme with cool autumnal colors" single ((:commit . "910e8fa56a0cfe89dae888522f9fec4045d017fb") (:authors ("Eric Chung <>")) (:maintainer "Eric Chung <>") (:url . "https://github.com/super3ggo/kuronami"))])
+ (kv . [(20140108 1534) nil "key/value data structure functions" single ((:commit . "721148475bce38a70e0b678ba8aa923652e8900e") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "lisp"))])
+ (kwin . [(20220120 2125) nil "communicatewith the KWin window manager" single ((:commit . "20fac6508e5535a26df783ba05f04d1800b7382c") (:authors ("Simon Hafner")) (:maintainer "Simon Hafner") (:url . "http://github.com/reactormonk/kwin-minor-mode"))])
+ (l . [(20220422 1612) ((seq (2 20))) "Compact syntax for short lambda" single ((:commit . "3ab31ef28596ac2f95be4c4280cd86489232da97") (:keywords "extensions") (:url . "https://git.sr.ht/~tarsius/l"))])
+ (laas . [(20220509 1234) ((emacs (26 3)) (auctex (11 88)) (aas (1 1)) (yasnippet (0 14))) "A bundle of as-you-type LaTeX snippets" tar ((:commit . "44533de4968fee924d9cc81ce9a23c9d82847db3") (:maintainer "Yoav Marco" . "yoavm448@gmail.com") (:keywords "tools" "tex") (:url . "https://github.com/tecosaur/LaTeX-auto-activating-snippets"))])
+ (lab-themes . [(20200815 2104) ((emacs (24))) "A custom theme carefully constructed in the LAB space" tar ((:commit . "9d7deb9635959d3a50ccb1082eb1207275f4b3e8") (:authors ("MetroWind" . "chris.corsair@gmail.com")) (:maintainer "MetroWind" . "chris.corsair@gmail.com") (:keywords "lisp") (:url . "https://github.com/MetroWind/lab-theme"))])
+ (labburn-theme . [(20200822 2153) nil "A lab color space zenburn theme." single ((:commit . "4ef2892f56c973907361bc91495d14204744f678") (:authors ("Johannes Goslar")) (:maintainer "Johannes Goslar") (:keywords "theme" "zenburn") (:url . "https://github.com/ksjogo/labburn-theme"))])
+ (lacquer . [(20220321 720) ((emacs (25 2))) "Switch theme/font by selecting from a cache" tar ((:commit . "0d7d09f7fe22fb0241e91228ce44568ed3e3e798") (:authors ("dingansich_kum0" . "zy.hua1122@outlook.com")) (:maintainer "dingansich_kum0" . "zy.hua1122@outlook.com") (:keywords "tools") (:url . "https://github.com/dingansichKum0/lacquer"))])
+ (laguna-theme . [(20220419 1459) nil "An updated blue-green Laguna Theme." single ((:commit . "48d14ffad6f0ffb4bd60c341e618c47ddbb7a2d8") (:authors ("Henry Newcomer" . "a.cliche.email@gmail.com")) (:maintainer "Henry Newcomer" . "a.cliche.email@gmail.com") (:url . "https://github.com/HenryNewcomer/laguna-theme"))])
+ (lakota-input . [(20200823 2146) nil "Input modes for Lakota language orthographies" single ((:commit . "b74b9de284a0404a120bb15340def4dd2f9a4779") (:authors ("Grant Shangreaux" . "shshoshin@protonmail.com")) (:maintainer "Grant Shangreaux" . "shshoshin@protonmail.com") (:url . "https://git.sr.ht/~shoshin/lakota-input.git"))])
+ (lambdapi-mode . [(20220106 1308) ((emacs (26 1)) (eglot (1 5)) (math-symbol-lists (1 2 1)) (highlight (20190710 1527))) "A major mode for editing Lambdapi source code" tar ((:commit . "a205bd0e8ba492a3a784ddd7a97c5167fce50675") (:maintainer "Deducteam" . "dedukti-dev@inria.fr") (:keywords "languages") (:url . "https://github.com/Deducteam/lambdapi"))])
+ (lammps-mode . [(20180801 1319) ((emacs (24 4))) "basic syntax highlighting for LAMMPS files" single ((:commit . "a5b68d7a59975770b56ee8f6e66fa4f703a72ffe") (:authors ("Aidan Thompson <athomps at sandia.gov>")) (:maintainer "Rohit Goswami <r95g10 at gmail.com>") (:keywords "languages" "faces") (:url . "https://github.com/lammps/lammps/tree/master/tools/emacs"))])
+ (lang-refactor-perl . [(20131122 2127) nil "Simple refactorings, primarily for Perl" single ((:commit . "691bd69639de6b7af357e3b7143563ececd9c497") (:authors (nil . "Johan Lindstrom <buzzwordninja not_this_bit@googlemail.com>")) (:maintainer nil . "Johan Lindstrom <buzzwordninja not_this_bit@googlemail.com>") (:keywords "languages" "refactoring" "perl") (:url . "https://github.com/jplindstrom/emacs-lang-refactor-perl"))])
+ (langdoc . [(20150218 645) ((cl-lib (0 2))) "Help to define help document mode for various languages" single ((:commit . "2c7223bacb116992d700ecb19a60df5c09c63424") (:authors ("Tomoya Tanjo" . "ttanjo@gmail.com")) (:maintainer "Tomoya Tanjo" . "ttanjo@gmail.com") (:keywords "convenience" "eldoc") (:url . "https://github.com/tom-tan/langdoc/"))])
+ (langtool . [(20200529 230) ((cl-lib (0 3))) "Grammar check utility using LanguageTool" single ((:commit . "8276eccc5587bc12fd205ee58a7a982f0a136e41") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "docs") (:url . "https://github.com/mhayashi1120/Emacs-langtool"))])
+ (langtool-ignore-fonts . [(20210526 2340) ((emacs (25 1)) (langtool (2 2 1))) "Force langtool to ignore certain fonts" single ((:commit . "c3291c85b733b9047653cbb1f525655394610bdb") (:authors ("Christopher Lloyd" . "cjl8zf@virginia.edu")) (:maintainer "Christopher Lloyd" . "cjl8zf@virginia.edu") (:url . "https://github.com/cjl8zf/langtool-ignore-fonts"))])
+ (language-detection . [(20161123 1813) ((emacs (24)) (cl-lib (0 5))) "Automatic language detection from code snippets" single ((:commit . "54a6ecf55304fba7d215ef38a4ec96daff2f35a4") (:authors ("Andreas Jansson" . "andreas@jansson.me.uk")) (:maintainer "Andreas Jansson" . "andreas@jansson.me.uk") (:url . "https://github.com/andreasjansson/language-detection.el"))])
+ (language-id . [(20220411 1932) ((emacs (24 3))) "Library to work with programming language identifiers" single ((:commit . "5325af36d9cd726de47a698ac159fce59f3fd6d9") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "languages" "util") (:url . "https://github.com/lassik/emacs-language-id"))])
+ (languagetool . [(20220127 2215) ((emacs (27 0)) (request (0 3 2))) "LanguageTool integration for grammar and spell check" tar ((:commit . "ea50c120ee3418489b43d51ed750288791d6eb95") (:authors ("Joar Buitrago" . "jebuitragoc@unal.edu.co")) (:maintainer "Joar Buitrago" . "jebuitragoc@unal.edu.co") (:keywords "grammar" "text" "docs" "tools" "convenience" "checker") (:url . "https://github.com/PillFall/Emacs-LanguageTool.el"))])
+ (lastfm . [(20211018 838) ((emacs (26 1)) (request (0 3 0)) (anaphora (1 0 4)) (memoize (1 1)) (elquery (0 1 0)) (s (1 12 0))) "Last.fm API for Emacs Lisp" single ((:commit . "b4b19f0aadc5087febeeb3f59944a89c4cdcf325") (:authors ("Mihai Olteanu" . "mihai_olteanu@fastmail.fm")) (:maintainer "Mihai Olteanu" . "mihai_olteanu@fastmail.fm") (:keywords "multimedia" "api") (:url . "https://github.com/mihaiolteanu/lastfm.el/"))])
+ (lastpass . [(20201229 2109) ((emacs (24 4)) (seq (1 9)) (cl-lib (0 5))) "LastPass command wrapper" single ((:commit . "2366de7824b6c5f8e9ec6811d219dc06794e8630") (:authors ("Petter Storvik")) (:maintainer "Petter Storvik") (:keywords "extensions" "processes" "lpass" "lastpass") (:url . "https://github.com/storvik/emacs-lastpass"))])
+ (latex-extra . [(20170817 147) ((auctex (11 86 1)) (cl-lib (0 5))) "Adds several useful functionalities to LaTeX-mode." single ((:commit . "82d99b8b0c2db20e5270749582e03bcc2443ffb5") (:authors ("Artur Malabarba" . "artur@endlessparentheses.com")) (:maintainer "Artur Malabarba" . "artur@endlessparentheses.com") (:keywords "tex") (:url . "http://github.com/Malabarba/latex-extra"))])
+ (latex-math-preview . [(20211228 641) nil "preview LaTeX mathematical expressions." single ((:commit . "1c082179493eed3ce8bc255f87791eb4acb1fbdb") (:authors ("Takayuki YAMAGUCHI" . "d@ytak.info")) (:maintainer "Takayuki YAMAGUCHI" . "d@ytak.info") (:keywords "latex" "tex") (:url . "https://gitlab.com/latex-math-preview/latex-math-preview"))])
+ (latex-pretty-symbols . [(20151112 1044) nil "Display many latex symbols as their unicode counterparts" single ((:commit . "83d5888147bb734a94dfd4847a11e975a7d86ba8") (:authors ("Erik Parmann" . "eparmann@gmail.com") ("Pål Drange")) (:maintainer "Erik Parmann" . "eparmann@gmail.com") (:keywords "convenience" "display") (:url . "https://bitbucket.org/mortiferus/latex-pretty-symbols.el"))])
+ (latex-preview-pane . [(20181008 1822) nil "Makes LaTeX editing less painful by providing a updatable preview pane" tar ((:commit . "5297668a89996b50b2b62f99cba01cc544dbed2e") (:authors ("John L. Singleton" . "jsinglet@gmail.com")) (:maintainer "John L. Singleton" . "jsinglet@gmail.com") (:keywords "latex" "preview") (:url . "http://www.emacswiki.org/emacs/LaTeXPreviewPane"))])
+ (latex-unicode-math-mode . [(20170123 1816) nil "Input method for Unicode math symbols" tar ((:commit . "eb4a5c9f9b00a58d2ca80f90782a851f4c8497b8") (:authors ("Christoph Dittmann" . "github@christoph-d.de")) (:maintainer "Christoph Dittmann" . "github@christoph-d.de") (:url . "https://github.com/Christoph-D/latex-unicode-math-mode"))])
+ (latexdiff . [(20190827 1651) ((emacs (24 4))) "Latexdiff integration in Emacs" single ((:commit . "56d0b240867527d1b43d3ddec14059361929b971") (:authors ("Launay Gaby" . "gaby.launay@tutanota.com")) (:maintainer "Launay Gaby" . "gaby.launay@tutanota.com") (:keywords "tex" "vc" "tools" "git" "helm") (:url . "http://github.com/galaunay/latexdiff.el"))])
+ (launch . [(20130619 2204) nil "launch files with OS-standard associated applications." single ((:commit . "e7c3b573fc05fe4d3d322389079909311542e799") (:authors ("Simon Law" . "sfllaw@sfllaw.ca")) (:maintainer "Simon Law" . "sfllaw@sfllaw.ca") (:keywords "convenience" "processes") (:url . "https://github.com/sfllaw/emacs-launch"))])
+ (launch-mode . [(20170106 512) ((emacs (24 4))) "Major mode for launch-formatted text" tar ((:commit . "25ebd4ba77afcbe729901eb74923dbe9ae81c313") (:authors ("iory" . "ab.ioryz@gmail.com")) (:maintainer "iory" . "ab.ioryz@gmail.com") (:url . "https://github.com/iory/launch-mode"))])
+ (launchctl . [(20210611 2243) ((emacs (24 1))) "Interface to launchctl on Mac OS X." single ((:commit . "c9b7e93f5ec6fa504dfb03d60571cf3e5dc38e12") (:authors ("Peking Duck <github.com/pekingduck>")) (:maintainer "Peking Duck <github.com/pekingduck>") (:keywords "tools" "convenience") (:url . "http://github.com/pekingduck/launchctl-el"))])
+ (lavender-theme . [(20170808 1313) ((emacs (24 0))) "an Emacs 24 theme based on Lavender (tmTheme)" single ((:commit . "ef5e959b95d7fb8152137bc186c4c24e986c1e3c") (:authors ("Jason Milkins")) (:maintainer "Jason Milkins") (:url . "https://github.com/emacsfodder/tmtheme-to-deftheme"))])
+ (lavenderless-theme . [(20201222 1627) ((colorless-themes (0 2))) "A mostly colorless version of lavender-theme" single ((:commit . "c1ed1e12541cf05cc6c558d23c089c07e10b54d7") (:authors ("Thomas Letan" . "lthms@soap.coffee")) (:maintainer "Thomas Letan" . "lthms@soap.coffee") (:keywords "faces" "theme") (:url . "https://git.sr.ht/~lthms/colorless-themes.el"))])
+ (lcb-mode . [(20160816 540) ((emacs (24))) "LiveCode Builder major mode" single ((:commit . "be0768e9aa6f9b8e76f2230f4f7f4d152a766b9a") (:authors ("Peter TB Brett" . "peter@peter-b.co.uk")) (:maintainer "Peter TB Brett" . "peter@peter-b.co.uk") (:keywords "languages") (:url . "https://github.com/peter-b/lcb-mode"))])
+ (lcr . [(20210102 853) ((dash (2 12 0)) (emacs (25 1))) "lightweight coroutines" single ((:commit . "493424dab9f374c5521dca8714481b70cb3c3cfd") (:authors ("Jean-Philippe Bernardy" . "jeanphilippe.bernardy@gmail.com")) (:maintainer "Jean-Philippe Bernardy" . "jeanphilippe.bernardy@gmail.com") (:keywords "tools") (:url . "https://github.com/jyp/lcr"))])
+ (le-thesaurus . [(20220509 2120) ((request (0 3 2)) (emacs (24 4))) "Query thesaurus.com for synonyms of a given word" single ((:commit . "2af1ab37097cdd17044ab217e9aa6839add98626") (:url . "https://github.com/AnselmC/le-thesaurus"))])
+ (leaf . [(20211226 1633) ((emacs (24 1))) "Simplify your init.el configuration, extended use-package" single ((:commit . "9eb18e8c9c375aa0158fbd06ea906bfbf54408fe") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "lisp" "settings") (:url . "https://github.com/conao3/leaf.el"))])
+ (leaf-convert . [(20210816 1103) ((emacs (26 1)) (leaf (3 6 0)) (leaf-keywords (1 1 0)) (ppp (2 1))) "Convert many format to leaf format" single ((:commit . "da86654f1021445cc42c1a5a9195f15097352209") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "tools") (:url . "https://github.com/conao3/leaf-convert.el"))])
+ (leaf-defaults . [(20210301 118) ((emacs (26 1)) (leaf (4 1)) (leaf-keywords (1 1))) "Awesome leaf config collections" tar ((:commit . "96ce39d4f16736f1e654e24eac16a2603976c724") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience") (:url . "https://github.com/conao3/leaf-defaults.el"))])
+ (leaf-keywords . [(20210816 1107) ((emacs (24 4)) (leaf (3 5 0))) "Additional leaf.el keywords for external packages" single ((:commit . "849b579f87c263e2f1d7fb7eda93b6ce441f217e") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "lisp" "settings") (:url . "https://github.com/conao3/leaf-keywords.el"))])
+ (leaf-manager . [(20211225 624) ((emacs (26 1)) (leaf (4 1)) (leaf-convert (1 0)) (ppp (2 1))) "Configuration manager for leaf based init.el" single ((:commit . "a9fb7fda1432d0cf6bd8546d98a11b3fbe1d84e6") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience" "leaf") (:url . "https://github.com/conao3/leaf-manager.el"))])
+ (leaf-tree . [(20211105 19) ((emacs (25 1)) (imenu-list (0 8))) "Interactive side-bar feature for init.el using leaf" single ((:commit . "89c3b8842df067bba67663d309f43aa311acdccd") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience" "leaf") (:url . "https://github.com/conao3/leaf-tree.el"))])
+ (lean-mode . [(20220501 1007) ((emacs (24 3)) (dash (2 18 0)) (s (1 10 0)) (f (0 19 0)) (flycheck (30))) "A major mode for the Lean 3 language" tar ((:commit . "362bc6fa3efb1874c525ed6b4b6f24f76af22596") (:authors ("Leonardo de Moura" . "leonardo@microsoft.com") ("Soonho Kong " . "soonhok@cs.cmu.edu") ("Gabriel Ebner " . "gebner@gebner.org") ("Sebastian Ullrich" . "sebasti@nullri.ch")) (:maintainer "Sebastian Ullrich" . "sebasti@nullri.ch") (:keywords "languages") (:url . "https://github.com/leanprover/lean-mode"))])
+ (leanote . [(20161223 139) ((emacs (24 4)) (cl-lib (0 5)) (request (0 2)) (let-alist (1 0 3)) (pcache (0 4 0)) (s (1 10 0)) (async (1 9))) "A minor mode writing markdown leanote" single ((:commit . "d499e7b59bb1f1a2fabc0e4c26fb101ed62ebc7b") (:authors ("Aborn Jiang" . "aborn.jiang@gmail.com")) (:maintainer "Aborn Jiang" . "aborn.jiang@gmail.com") (:keywords "leanote" "note" "markdown") (:url . "https://github.com/aborn/leanote-emacs"))])
+ (learn-ocaml . [(20211003 1412) ((emacs (25 1))) "Emacs frontend for learn-ocaml" single ((:commit . "ac6ef9cbd39f7d9ac0019e28da09aad5bc2cfae5") (:url . "https://github.com/pfitaxel/learn-ocaml.el"))])
+ (ledger-import . [(20210419 818) ((emacs (25 1)) (ledger-mode (3 1 1))) "Fetch OFX files from bank and push them to Ledger" single ((:commit . "f77adf79ce67524c3e08546448ac88ea1a665b64") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:url . "https://gitlab.petton.fr/mpdel/libmpdel"))])
+ (ledger-mode . [(20220307 854) ((emacs (25 1))) "Helper code for use with the \"ledger\" command-line tool" tar ((:commit . "11e850395448ee7012dba16bd6df103f5552ebfb"))])
+ (leerzeichen . [(20170422 1313) nil "Minor mode to display whitespace characters." single ((:commit . "5acf9855ecb2b2cd5da4402bb48df149e7525cc5") (:authors ("Felix Geller" . "fgeller@gmail.com")) (:maintainer "Felix Geller" . "fgeller@gmail.com") (:keywords "whitespace" "characters") (:url . "http://github.com/fgeller/leerzeichen.el"))])
+ (leetcode . [(20220503 534) ((emacs (26 1)) (dash (2 16 0)) (graphql (0 1 1)) (spinner (1 7 3)) (aio (1 0)) (log4e (0 3 3))) "An leetcode client" single ((:commit . "682f7a44d0bea0daf6f9a2888fa7f905d3a0cd70") (:authors ("Wang Kai" . "kaiwkx@gmail.com")) (:maintainer "Wang Kai" . "kaiwkx@gmail.com") (:keywords "extensions" "tools") (:url . "https://github.com/kaiwk/leetcode.el"))])
+ (legalese . [(20200119 2248) nil "Add legalese to your program files" single ((:commit . "e465471d2d5a62d35073d93e0f8d40387a82e302") (:authors ("Jorgen Schaefer" . "forcer@forcix.cx")) (:maintainer "Jorgen Schaefer" . "forcer@forcix.cx") (:keywords "convenience") (:url . "https://github.com/jorgenschaefer/legalese"))])
+ (lemon-mode . [(20130216 1304) nil "A major mode for editing lemon grammar files" single ((:commit . "155bfced6c9afc8072a0133d3d1baa54c6d67430") (:authors ("mooz" . "stillpedant@gmail.com")) (:maintainer "mooz" . "stillpedant@gmail.com") (:keywords "lemon"))])
+ (lentic . [(20210727 1247) ((emacs (24 4)) (m-buffer (0 13)) (dash (2 5 0)) (f (0 17 2)) (s (1 9 0))) "One buffer as a view of another" tar ((:commit . "36861bdf9c1d88492648da553f66529e3a879880") (:authors ("Phillip Lord" . "phillip.lord@russet.org.uk")) (:maintainer "Phillip Lord" . "phillip.lord@russet.org.uk"))])
+ (lentic-server . [(20160717 2052) ((lentic (0 8)) (web-server (0 1 1))) "Web Server for Emacs Literate Source" single ((:commit . "8e809fafbb27a98f815b544d9d9ee15843eb6a36") (:authors ("Phillip Lord" . "phillip.lord@newcastle.ac.uk")) (:maintainer "Phillip Lord" . "phillip.lord@newcastle.ac.uk"))])
+ (leo . [(20220111 1045) ((emacs (27 1))) "Interface for dict.leo.org" tar ((:commit . "12c7133c826925e088e0ddb2ae46f51bf3111af1") (:authors ("M.T. Enders <michael AT michael-enders.com>") ("Marty Hiatt <martianhiatus AT riseup.net>")) (:maintainer "M.T. Enders <michael AT michael-enders.com>") (:keywords "convenience" "translate") (:url . "https://github.com/mtenders/emacs-leo"))])
+ (less-css-mode . [(20161001 453) nil "Major mode for editing LESS CSS files (lesscss.org)" single ((:commit . "c7fa3d56d83206b28657f2e56439dc62280a2bf2") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "less" "css" "mode") (:url . "https://github.com/purcell/less-css-mode"))])
+ (letcheck . [(20160202 1948) nil "Check the erroneous assignments in let forms" single ((:commit . "edf188ca2f85349e971b83f164c6484264e79426") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "convenience") (:url . "https://github.com/Fuco1/letcheck"))])
+ (letterbox-mode . [(20170702 125) ((emacs (24 3))) "hide sensitive text on a buffer" single ((:commit . "88c67a51d67216d569a28e8423200883fde096dd") (:authors ("Fernando Leboran" . "f.leboran@gmail.com")) (:maintainer "Fernando Leboran" . "f.leboran@gmail.com") (:keywords "password" "convenience") (:url . "http://github.com/pacha64/letterbox-mode"))])
+ (leuven-theme . [(20220203 947) nil "Awesome Emacs color theme on white background" tar ((:commit . "d7dd9188a65e2ab7cf73c2e575a830baae38cb0c") (:authors ("Fabrice Niessen <(concat \"fniessen\" at-sign \"pirilampo.org\")>")) (:maintainer "Fabrice Niessen <(concat \"fniessen\" at-sign \"pirilampo.org\")>") (:keywords "color" "theme") (:url . "https://github.com/fniessen/emacs-leuven-theme"))])
+ (levenshtein . [(20090830 1040) nil "Edit distance between two strings." single ((:commit . "070925197ebf6b704e6e00c4f2d2ec783f3df38c") (:authors ("Aaron S. Hawley <ashawley at uvm dot edu>,") ("Art Taylor")) (:maintainer "Aaron S. Hawley <ashawley at uvm dot edu>,") (:keywords "lisp"))])
+ (lexbind-mode . [(20141027 1429) nil "Puts the value of lexical-binding in the mode line" single ((:commit . "fa0a6848c1cfd3fbf45db43dc2deef16377d887d") (:authors ("Andrew Kirkpatrick" . "ubermonk@gmail.com")) (:maintainer "Andrew Kirkpatrick" . "ubermonk@gmail.com") (:keywords "convenience" "lisp") (:url . "https://github.com/spacebat/lexbind-mode"))])
+ (lexic . [(20220501 1432) ((emacs (26 3))) "A major mode to find out more about words" single ((:commit . "f9b3de4d9c2dd1ce5022383e1a504b87bf7d1b09") (:authors ("pluskid" . "pluskid@gmail.com") ("gucong" . "gucong43216@gmail.com") ("TEC" . "tec@tecosaur.com")) (:maintainer "TEC" . "tec@tecosaur.com") (:url . "https://github.com/tecosaur/lexic"))])
+ (lf . [(20210808 1921) ((s (1 12 0)) (dash (2 16 0)) (emacs (27 1))) "A Language Features library for Emacs Lisp" single ((:commit . "35db92ca765a0544721fdeea036d77b7d192d083") (:authors ("Musa Al-hassy" . "alhassy@gmail.com")) (:maintainer "Musa Al-hassy" . "alhassy@gmail.com") (:keywords "convenience" "programming") (:url . "https://alhassy.github.io/lf.el/"))])
+ (lfe-mode . [(20220102 1653) nil "Lisp Flavoured Erlang mode" tar ((:commit . "6e1e42768d40528e7a13f7cebf0a56cffbeda3c6"))])
+ (libbcel . [(20191203 654) ((emacs (26 1)) (request (0 3 1))) "Library to connect to basecamp 3 API" tar ((:commit . "df466d31544c53d8550f9c08e58b70adc559c48c") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:url . "https://gitlab.petton.fr/bcel/libbcel"))])
+ (libelcouch . [(20200923 1836) ((emacs (26 1)) (request (0 3 0))) "Communication with CouchDB" single ((:commit . "5ae35266c9a2eb33f0c708bc8c0687339cee9133") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:keywords "tools") (:url . "https://gitlab.petton.fr/elcouch/libelcouch/"))])
+ (liberime . [(20211203 244) ((emacs (25 1))) "Rime elisp binding" tar ((:commit . "79b709debe036f98d74ac129934e59c4d08c1dd5") (:authors ("A.I.")) (:maintainer "A.I.") (:keywords "convenience" "chinese" "input-method" "rime") (:url . "https://github.com/merrickluo/liberime"))])
+ (libgit . [(20210620 2017) ((emacs (25 1))) "Thin bindings to libgit2." tar ((:commit . "77bd28aeaa2a49962e8f714741f5a69b656a2183") (:authors ("Eivind Fonn" . "evfonn@gmail.com")) (:maintainer "Eivind Fonn" . "evfonn@gmail.com") (:keywords "git" "vc") (:url . "https://github.com/magit/libegit2"))])
+ (liblouis . [(20220426 657) ((emacs (26 1))) "Mode for editing liblouis braille translation tables" single ((:commit . "a341a0c434cdbe7f46956c8db13203c3fc941a34") (:authors ("Christian Egli" . "christian.egli@sbs.ch")) (:maintainer "Christian Egli" . "christian.egli@sbs.ch") (:keywords "languages") (:url . "https://github.com/liblouis/liblouis-mode"))])
+ (libmpdee . [(20160117 2301) nil "Client end library for mpd, a music playing daemon" single ((:commit . "a6ca3b7d6687f3ba60996b9b5044ad1d3b228290") (:authors ("Ramkumar R. Aiyengar" . "andyetitmoves@gmail.com")) (:maintainer "Ramkumar R. Aiyengar" . "andyetitmoves@gmail.com") (:keywords "music" "mpd"))])
+ (libmpdel . [(20210627 755) ((emacs (25 1))) "Communication with an MPD server" tar ((:commit . "e4ae63dd002fe07835c3c8a35b20b6e8347f8e84") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:keywords "multimedia") (:url . "https://gitea.petton.fr/mpdel/libmpdel"))])
+ (librera-sync . [(20210827 2300) ((emacs (26 1)) (f (0 17))) "Sync document's position with Librera Reader for Android" tar ((:commit . "b6b97adc08c26b1595249e1c129793100f4ca26e") (:authors ("Dmitriy Pshonko" . "jumper047@gmail.com")) (:maintainer "Dmitriy Pshonko" . "jumper047@gmail.com") (:keywords "multimedia" "sync") (:url . "https://github.com/jumper047/librera-sync"))])
+ (lice . [(20220312 2215) nil "License And Header Template" tar ((:commit . "0b69ba54057146f1473e85c0760029e584e3eb13") (:authors ("Taiki Sugawara" . "buzz.taiki@gmail.com")) (:maintainer "Taiki Sugawara" . "buzz.taiki@gmail.com") (:keywords "template" "license" "tools") (:url . "https://github.com/buzztaiki/lice-el"))])
+ (license-snippets . [(20201117 1619) ((emacs (26)) (yasnippet (0 8 0))) "LICENSE templates for yasnippet" tar ((:commit . "a729748b7d7f38a916fe61f23db6e7446c0a5e8f") (:authors ("Seong Yong-ju" . "sei40kr@gmail.com")) (:maintainer "Seong Yong-ju" . "sei40kr@gmail.com") (:keywords "tools") (:url . "https://github.com/sei40kr/license-snippets"))])
+ (license-templates . [(20200906 2047) ((emacs (24 3)) (request (0 3 0))) "Create LICENSE using GitHub API" single ((:commit . "e03f4a30c4abf354fb961babe4dce1dfa733aa82") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/license-templates"))])
+ (light-soap-theme . [(20150607 1445) ((emacs (24))) "Emacs 24 theme with a light background." single ((:commit . "76a787bd40c6b567ae68ced7f5d9f9f10725e00d"))])
+ (ligo-mode . [(20220209 755) ((emacs (27 1))) "A major mode for editing LIGO source code" single ((:commit . "4e334c2092a8560ca0bb75670026d1d938575bc7") (:authors ("LigoLang SASU")) (:maintainer "LigoLang SASU") (:keywords "languages") (:url . "https://gitlab.com/ligolang/ligo/-/tree/dev/tools/emacs"))])
+ (line-reminder . [(20220502 1210) ((emacs (25 1)) (indicators (0 0 4)) (fringe-helper (1 0 1)) (ov (1 0 6)) (ht (2 0))) "Line annotation for changed and saved lines" single ((:commit . "c0cebef629a98556f5696f78436f4d8428ce8135") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/emacs-vs/line-reminder"))])
+ (line-up-words . [(20180219 1024) nil "Align words in an intelligent way" single ((:commit . "254ee815eb3fe77edea7c9da6f6f3839163735f3") (:url . "https://github.com/janestreet/line-up-words"))])
+ (lines-at-once . [(20180422 247) ((emacs (25))) "Insert and edit multiple lines at once" single ((:commit . "31bce4b79fe16251b7cf118f0d343b0b46f72360") (:authors ("Jiahao Li" . "jiahaowork@gmail.com")) (:maintainer "Jiahao Li" . "jiahaowork@gmail.com") (:keywords "abbrev" "tools") (:url . "https://github.com/jiahaowork/lines-at-once.el"))])
+ (lingr . [(20100807 1731) nil "Lingr Client for GNU Emacs" single ((:commit . "4215a8704492d3c860097cbe2649936c22c196df") (:authors ("lugecy" . "lugecy@gmail.com")) (:maintainer "lugecy" . "lugecy@gmail.com") (:keywords "chat" "client" "internet") (:url . "http://github.com/lugecy/lingr-el"))])
+ (linguistic . [(20181129 2116) nil "A package for basic linguistic analysis." tar ((:commit . "23e47e98cdb09ee61883669b6d8a11bf6449862c") (:authors ("Andrew Favia <drewlinguistics01 at gmail dot com>")) (:maintainer "Andrew Favia <drewlinguistics01 at gmail dot com>") (:keywords "linguistics" "text analysis" "matching") (:url . "https://github.com/andcarnivorous/linguistic"))])
+ (link . [(20191111 446) nil "Hypertext links in text buffers" single ((:commit . "bdf0aa7761d1c1a3bc0652b2fdc4a54b3acdb06a") (:authors ("Torsten Hilbrich" . "torsten.hilbrich@gmx.net")) (:maintainer "Torsten Hilbrich" . "torsten.hilbrich@gmx.net") (:keywords "interface" "hypermedia"))])
+ (link-hint . [(20220414 56) ((avy (0 4 0)) (emacs (24 4))) "Use avy to open, copy, etc. visible links" single ((:commit . "a24546e0dee901bce94e3a11c20b1ed12a22b9c6") (:authors ("Fox Kiester" . "noct@posteo.net")) (:maintainer "Fox Kiester" . "noct@posteo.net") (:keywords "convenience" "url" "avy" "link" "links" "hyperlink") (:url . "https://github.com/noctuid/link-hint.el"))])
+ (linkode . [(20200607 2152) nil "Generate a linkode snippet with region/buffer content" single ((:commit . "675e612e30b74764c57de4117d950ea803b15f74") (:authors ("Erick Navarro" . "erick@navarro.io")) (:maintainer "Erick Navarro" . "erick@navarro.io") (:url . "https://github.com/erickgnavar/linkode.el"))])
+ (linphone . [(20130524 1109) nil "Emacs interface to Linphone" tar ((:commit . "99af3db941b7f4e5272bb48bff96c1ce4ceac302") (:authors ("Yoni Rabkin" . "yonirabkin@member.fsf.org")) (:maintainer "Yoni Rabkin" . "yonirabkin@member.fsf.org") (:keywords "comm") (:url . "https://github.com/zabbal/emacs-linphone"))])
+ (linum-off . [(20160217 2137) nil "Provides an interface for turning line-numbering off" single ((:commit . "116e66ac259b183e0763b85616888316ab196822") (:authors ("Matthew L. Fidler, Florian Adamsky (see wiki)")) (:maintainer "Matthew L. Fidler") (:keywords "line" "numbering") (:url . "http://www.emacswiki.org/emacs/auto-indent-mode.el "))])
+ (linum-relative . [(20180124 1047) nil "display relative line number in emacs." single ((:commit . "c74a6981b688a5e1e6b8e0809363963ff558ce4d") (:authors ("coldnew" . "coldnew.tw@gmail.com")) (:maintainer "coldnew" . "coldnew.tw@gmail.com") (:keywords "converience") (:url . "http://github.com/coldnew/linum-relative"))])
+ (liquid-types . [(20151202 735) ((flycheck (0 13)) (dash (1 2)) (emacs (24 1)) (popup (0 5 2)) (pos-tip (0 5 0)) (flycheck-liquidhs (0 0 1)) (button-lock (1 0 2))) "show inferred liquid-types" single ((:commit . "cc4bacbbf204ef9cf0756f78dfebee2c6ae14d7b") (:authors ("Ranjit Jhala" . "jhala@cs.ucsd.edu")) (:maintainer "Ranjit Jhala" . "jhala@cs.ucsd.edu"))])
+ (liquidmetal . [(20211004 1429) ((emacs (24 4))) "A mimetic poly-alloy of the Quicksilver scoring algorithm" single ((:commit . "22dd4c3ea4c0d2bd82270e2fb272317d0bc87752") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/liquidmetal"))])
+ (liso-theme . [(20160410 2029) nil "Eclectic Dark Theme for GNU Emacs" single ((:commit . "844688245eb860d23043455e165ee24503454c81") (:authors ("Vlad Piersec" . "vlad.piersec@gmail.com")) (:maintainer "Vlad Piersec" . "vlad.piersec@gmail.com") (:keywords "theme" "themes") (:url . "https://github.com/caisah/liso-theme"))])
+ (lisp-butt-mode . [(20210215 2206) ((emacs (25))) "Slim Lisp Butts" single ((:commit . "7330f08dd85ee715096f3596df516877894c6c2f") (:authors ("Marco Wahl" . "marcowahlsoft@gmail.com")) (:maintainer "Marco Wahl" . "marcowahlsoft@gmail.com") (:keywords "lisp") (:url . "https://gitlab.com/marcowahl/lisp-butt-mode"))])
+ (lisp-extra-font-lock . [(20181008 1921) nil "Highlight bound variables and quoted exprs." single ((:commit . "4605eccbe1a7fcbd3cacf5b71249435413b4db4f") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "languages" "faces") (:url . "https://github.com/Lindydancer/lisp-extra-font-lock"))])
+ (lisp-local . [(20210605 1347) ((emacs (24 3))) "Allow different Lisp indentation in each buffer" single ((:commit . "22e221c9330d2b5dc07e8b2caa34c83ac7c20b0d") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "languages" "lisp") (:url . "https://github.com/lispunion/emacs-lisp-local"))])
+ (lispxmp . [(20170926 23) nil "Automagic emacs lisp code annotation" single ((:commit . "7ad077b4ee91ce8a42f84eeddb9fc7ea4eac7814") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "lisp" "convenience") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/lispxmp.el"))])
+ (lispy . [(20220209 1138) ((emacs (24 3)) (ace-window (0 9 0)) (iedit (0 9 9)) (swiper (0 13 4)) (hydra (0 14 0)) (zoutline (0 1 0))) "vi-like Paredit" tar ((:commit . "df1b7e614fb0f73646755343e8892ddda310f427") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "lisp") (:url . "https://github.com/abo-abo/lispy"))])
+ (lispyville . [(20210702 2031) ((lispy (0)) (evil (1 2 12)) (cl-lib (0 5)) (emacs (24 4))) "A minor mode for integrating evil with lispy." single ((:commit . "9c14bed0359f659e246d345c706f895737c3d172") (:authors ("Fox Kiester" . "noct@posteo.net")) (:maintainer "Fox Kiester" . "noct@posteo.net") (:keywords "vim" "evil" "lispy" "lisp" "parentheses") (:url . "https://github.com/noctuid/lispyville"))])
+ (list-environment . [(20210930 1439) nil "A tabulated process environment editor" single ((:commit . "0a72a5a9c1abc090b25202a0387e3f766994b053") (:authors ("Charles L.G. Comstock" . "dgtized@gmail.com")) (:maintainer "Charles L.G. Comstock" . "dgtized@gmail.com") (:keywords "processes" "unix"))])
+ (list-packages-ext . [(20151115 1716) ((s (1 6 0)) (ht (1 5 0)) (persistent-soft (0 8 6))) "Extras for list-packages" single ((:commit . "b4dd644e4369c9aa66f5bb8895ea49ebbfd0a27a") (:authors ("Alessandro Piras" . "laynor@gmail.com")) (:maintainer "Alessandro Piras" . "laynor@gmail.com") (:keywords "convenience" "tools"))])
+ (list-unicode-display . [(20181121 2316) ((emacs (24 3))) "Search for and list unicode characters by name" single ((:commit . "0ecc2402b258990e7a0cf7e60847712c69444070") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "convenience"))])
+ (list-utils . [(20210111 1522) nil "List-manipulation utility functions" single ((:commit . "ca9654cd1418e874c876c6b3b7d4cd8339bfde77") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "extensions") (:url . "http://github.com/rolandwalker/list-utils"))])
+ (lister . [(20220118 1322) ((emacs (26 1))) "Yet another list printer" tar ((:commit . "51581b53ecf8e68d67a2d85dde539533aa7199ee") (:authors (nil . "<joerg@joergvolbers.de>")) (:maintainer nil . "<joerg@joergvolbers.de>") (:keywords "lisp") (:url . "https://github.com/publicimageltd/lister"))])
+ (lit-mode . [(20141123 1736) nil "Major mode for lit" single ((:commit . "c61c403afc8333a5649c5421ab1a6341dc1c7d92") (:authors ("Hector A Escobedo" . "ninjahector.escobedo@gmail.com")) (:maintainer "Hector A Escobedo" . "ninjahector.escobedo@gmail.com") (:keywords "languages" "tools"))])
+ (litable . [(20200130 1329) ((dash (2 6 0))) "dynamic evaluation replacement with emacs" single ((:commit . "02247ca284cbc79f3afb783d62ed092bfc5b8d83") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "lisp"))])
+ (litanize . [(20200211 621) ((emacs (24 1)) (enlive (0 0 1)) (s (1 12 0))) "Generate \"Latour Litanies\"" single ((:commit . "ba73259e35b4649884ba56542d3a55f43bd3b80b") (:authors ("nik gaffney" . "nik@fo.am")) (:maintainer "nik gaffney" . "nik@fo.am") (:keywords "tools" "latour litany" "alien phenomenology" "ontography" "metaphorism" "carpentry") (:url . "https://github.com/zzkt/litanizer"))])
+ (litecoin-ticker . [(20160612 11) ((json (1 2))) "litecoin price in modeline" single ((:commit . "3d8047c736e4ee0b8638953f8cc63eaefad34106") (:authors ("Zhe Lei")) (:maintainer "Zhe Lei"))])
+ (literal-string . [(20191023 733) ((emacs (25)) (edit-indirect (0 1 5))) "edit string literals in a dedicated buffer" single ((:commit . "afffa86e626798ee9f9188ea3be2d5ee6ad17c39") (:authors ("Joost Diepenmaat" . "joost@zeekat.nl")) (:maintainer "Joost Diepenmaat" . "joost@zeekat.nl") (:keywords "lisp" "tools" "docs") (:url . "https://github.com/joodie/literal-string-mode/"))])
+ (literate-calc-mode . [(20220215 1814) ((emacs (25 1)) (s (1 12 0))) "Inline results from calc" single ((:commit . "f5133e65d8ffdab918cdfc269ac0c067a0de5e9b") (:authors ("Robin Schroer")) (:maintainer "Robin Schroer") (:keywords "calc" "languages" "tools") (:url . "https://github.com/sulami/literate-calc-mode.el"))])
+ (literate-coffee-mode . [(20170211 1515) ((coffee-mode (0 5 0))) "major-mode for Literate CoffeeScript" single ((:commit . "55ce0305495f4a38c8063c4bd63deb1e1252373d") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-literate-coffee-mode"))])
+ (literate-elisp . [(20220322 133) ((emacs (26 1))) "Load Emacs Lisp code blocks from Org files" single ((:commit . "dc4f9d64a8483aa6e394178087c589cdefc571e2") (:authors ("Jingtao Xu" . "jingtaozf@gmail.com")) (:maintainer "Jingtao Xu" . "jingtaozf@gmail.com") (:keywords "lisp" "docs" "extensions" "tools") (:url . "https://github.com/jingtaozf/literate-elisp"))])
+ (literate-starter-kit . [(20150730 1854) ((emacs (24 3))) "A literate starter kit to configure Emacs using Org-mode files." tar ((:commit . "6dce1d01781966c14558aa553cfc85008c06e115"))])
+ (litex-mode . [(20220415 1704) ((cl-lib (0 5)) (emacs (24 1))) "Minor mode for converting lisp to LaTeX" tar ((:commit . "5d5750af2990c050c8d36baa4b8e7a45850d5a6a") (:authors ("Gaurav Atreya" . "allmanpride@gmail.com")) (:maintainer "Gaurav Atreya" . "allmanpride@gmail.com") (:keywords "calculator" "lisp" "latex") (:url . "https://github.com/Atreyagaurav/litex-mode"))])
+ (live-code-talks . [(20180907 1647) ((emacs (24)) (cl-lib (0 5)) (narrowed-page-navigation (0 1))) "Support for slides with live code in them" single ((:commit . "97f16a9ee4e6ff3e0f9291eaead772c66e3e12ae") (:authors ("David Raymond Christiansen" . "david@davidchristiansen.dk")) (:maintainer "David Raymond Christiansen" . "david@davidchristiansen.dk") (:keywords "docs" "multimedia"))])
+ (live-preview . [(20201010 1948) ((emacs (24 4))) "Live preview by any shell command while editing" single ((:commit . "603a4a1759fbec92e7a1cabc249517c78e59ce7e") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "languages" "util") (:url . "https://github.com/lassik/emacs-live-preview"))])
+ (live-py-mode . [(20220404 0) ((emacs (24 3))) "Live Coding in Python" tar ((:commit . "b466460b6783caacf1ea3fcfa28752cb73fd0805") (:authors ("Don Kirkby http://donkirkby.github.io")) (:maintainer "Don Kirkby http://donkirkby.github.io") (:keywords "live" "coding") (:url . "http://donkirkby.github.io/live-py-plugin/"))])
+ (lively . [(20171005 754) nil "interactively updating text" single ((:commit . "348675828c6a81bfa1ac311ca465aad813542c1b") (:authors ("Luke Gorrie" . "luke@bup.co.nz")) (:maintainer "Steve Purcell" . "steve@sanityinc.com"))])
+ (livereload . [(20170629 650) ((emacs (25)) (websocket (1 8))) "Livereload server" tar ((:commit . "1e501d7e46dbd476c2c7cc9d20b5ac9d41fb1955") (:authors ("João Távora" . "joaotavora@gmail.com")) (:maintainer "João Távora" . "joaotavora@gmail.com") (:keywords "convenience"))])
+ (livescript-mode . [(20140613 421) nil "Major mode for editing LiveScript files" single ((:commit . "90a918d9686e256e6d4d439cc20f24dad8d3b804") (:authors ("Hisamatsu Yasuyuki" . "yas@null.net")) (:maintainer "Hisamatsu Yasuyuki" . "yas@null.net") (:keywords "languages" "livescript") (:url . "https://github.com/yhisamatsu/livescript-mode"))])
+ (livid-mode . [(20131116 1344) ((skewer-mode (1 5 3)) (s (1 8 0))) "Live browser eval of JavaScript every time a buffer changes" single ((:commit . "dfe5212fa64738bc4138bfebf349fbc8bc237c26") (:authors ("Murphy McMahon")) (:maintainer "Murphy McMahon") (:url . "https://github.com/pandeiro/livid-mode"))])
+ (ll-debug . [(20211002 1031) ((emacs (24 3))) "Low level debug tools" single ((:commit . "a2cfeab46e5100c348b35987fae34f9ea76d7c0b") (:authors ("Claus Brunzema" . "mail@cbrunzema.de")) (:maintainer "Claus Brunzema" . "mail@cbrunzema.de") (:keywords "abbrev" "convenience" "tools" "c" "lisp") (:url . "https://github.com/replrep/ll-debug"))])
+ (llama . [(20220428 1405) ((seq (2 20))) "Anonymous function literals" single ((:commit . "adc5d169fad53d6d11000a72dc95f8489a8c7534") (:keywords "extensions") (:url . "https://git.sr.ht/~tarsius/llama"))])
+ (lms . [(20210820 2200) ((emacs (25 1))) "Squeezebox / Logitech Media Server frontend" single ((:commit . "05c8fd16ff94590393b6b0a9cb193ec9572a9c97") (:authors ("Iñigo Serna" . "inigoserna@gmx.com")) (:maintainer "Iñigo Serna" . "inigoserna@gmx.com") (:keywords "multimedia") (:url . "https://hg.serna.eu/emacs/lms"))])
+ (load-bash-alias . [(20220108 2103) ((emacs (24 1)) (seq (2 16))) "Convert bash aliases into eshell ones" single ((:commit . "968f037eff48ceca15fd135738051c48ab14cfd6") (:authors ("Davide Restivo" . "davide.restivo@yahoo.it")) (:maintainer "Davide Restivo" . "davide.restivo@yahoo.it") (:keywords "emacs" "bash" "eshell" "alias") (:url . "https://github.com/daviderestivo/load-bash-alias"))])
+ (load-env-vars . [(20180511 2210) ((emacs (24))) "Load environment variables from files" single ((:commit . "3808520efaf9492033f6e11a9bffd68eabf02a0f") (:authors ("Jorge Dias" . "jorge@mrdias.com")) (:maintainer "Jorge Dias" . "jorge@mrdias.com") (:keywords "lisp") (:url . "https://github.com/diasjorge/emacs-load-env-vars"))])
+ (load-relative . [(20201130 2202) nil "Relative file load (within a multi-file Emacs package)" tar ((:commit . "ff2a827144353d29d70392fd95c14c15df207011") (:authors ("Rocky Bernstein" . "rocky@gnu.org")) (:maintainer "Rocky Bernstein" . "rocky@gnu.org") (:keywords "internal") (:url . "https://github.com/rocky/emacs-load-relative"))])
+ (load-theme-buffer-local . [(20120702 2036) nil "Install emacs24 color themes by buffer." single ((:commit . "e606dec66f16a06140b9aad625a4fd52bca4f936") (:authors ("Victor Borja" . "vic.borja@gmail.com")) (:maintainer "Victor Borja" . "vic.borja@gmail.com") (:keywords "faces") (:url . "http://github.com/vic/color-theme-buffer-local"))])
+ (loc-changes . [(20200722 1111) nil "keep track of positions even after buffer changes" single ((:commit . "0a55bcba684f78417e831eef2cc32da24a207f29") (:authors ("Rocky Bernstein" . "rocky@gnu.org")) (:maintainer "Rocky Bernstein" . "rocky@gnu.org") (:url . "https://github.com/rocky/emacs-loc-changes"))])
+ (loccur . [(20210224 2041) ((emacs (25 1))) "Perform an occur-like folding in current buffer" single ((:commit . "01b7afa62589432a98171074abb8c5a1e089034a") (:authors ("Alexey Veretennikov" . "alexey.veretennikov@gmail.com")) (:maintainer "Alexey Veretennikov" . "alexey.veretennikov@gmail.com") (:keywords "matching") (:url . "https://github.com/fourier/loccur"))])
+ (lockfile-mode . [(20170625 507) nil "Major mode for .lock files" single ((:commit . "fcfef88460cb3cd67c4d83a1801d0326d282feac") (:authors ("Preetpal S. Sohal")) (:maintainer "Preetpal S. Sohal") (:url . "https://github.com/preetpalS/emacs-lockfile-mode"))])
+ (lodgeit . [(20190802 1308) nil "Paste to a lodgeit powered pastebin" single ((:commit . "442637194d48a7105b7747b8d98772f5899f9e21") (:authors ("Eric Larson" . "eric@ionrock.org")) (:maintainer "Eric Larson" . "eric@ionrock.org") (:keywords "pastebin" "lodgeit") (:url . "https://github.com/ionrock/lodgeit-el"))])
+ (log4e . [(20211019 948) nil "provide logging framework for elisp" single ((:commit . "737d275eac28dbdfb0b26d28e99da148bfce9d16") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "log") (:url . "https://github.com/aki2o/log4e"))])
+ (log4j-mode . [(20160108 1918) nil "major mode for viewing log files" single ((:commit . "26171b1e723502055e085393b0ecdcb6db406010") (:authors ("Johan Dykstrom" . "jody4711-sf@yahoo.se")) (:maintainer "Johan Dykstrom" . "jody4711-sf@yahoo.se") (:keywords "tools") (:url . "http://log4j-mode.sourceforge.net"))])
+ (logalimacs . [(20131021 1829) ((popwin (0 6 2)) (popup (0 5 0)) (stem (20130120))) "Front-end to logaling-command for Ruby gems" single ((:commit . "8286e39502250fc6c3c6656a7f46a8eee8e9a713") (:authors ("Yuta Yamada <cokesboy\"at\"gmail.com>")) (:maintainer "Yuta Yamada <cokesboy\"at\"gmail.com>") (:keywords "translation" "logaling-command") (:url . "https://github.com/logaling/logalimacs"))])
+ (logito . [(20201226 534) ((emacs (25 1))) "logging library for Emacs" single ((:commit . "d5934ce10ba3a70d3fcfb94d742ce3b9136ce124") (:authors ("Yann Hodique" . "yann.hodique@gmail.com")) (:maintainer "Yann Hodique" . "yann.hodique@gmail.com") (:keywords "lisp" "extensions"))])
+ (logms . [(20210721 349) ((emacs (27 1)) (f (0 20 0)) (s (1 9 0)) (ht (2 3))) "Log message with clickable links to context" single ((:commit . "b3366ec866b6e3b5c608fee23e86eb832d132ef8") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/logms"))])
+ (lognav-mode . [(20220410 1344) ((emacs (24 3))) "Navigate Log Error Messages" single ((:commit . "100541ec31468b771073a7d2ad4512c1dcb1eb07") (:authors ("Shawn Ellis" . "shawn.ellis17@gmail.com")) (:maintainer "Shawn Ellis" . "shawn.ellis17@gmail.com") (:keywords "log" "error" "lognav-mode" "convenience") (:url . "https://hg.osdn.net/view/lognav-mode/lognav-mode"))])
+ (logpad . [(20201113 917) nil "Simulate Windows Notepad for logging." single ((:commit . "166543873e665936b468d9f120155cce515da3f8") (:authors ("Sven Knurr" . "git@tuxproject.de")) (:maintainer "Sven Knurr" . "git@tuxproject.de") (:keywords "files" "outlines" "notepad") (:url . "https://github.com/dertuxmalwieder/logpad.el"))])
+ (logstash-conf . [(20210123 1949) nil "basic mode for editing logstash configuration" single ((:commit . "ebc4731c45709ad1e0526f4f4164020ae83cbeff") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk"))])
+ (logview . [(20201014 2033) ((emacs (24 4)) (datetime (0 6 1)) (extmap (1 0))) "Major mode for viewing log files" single ((:commit . "5a543c53d04d32f0adcc023253888198e0b69589") (:authors ("Paul Pogonyshev" . "pogonyshev@gmail.com")) (:maintainer "Paul Pogonyshev" . "pogonyshev@gmail.com") (:keywords "files" "tools") (:url . "https://github.com/doublep/logview"))])
+ (lol-data-dragon . [(20200705 1822) ((emacs (25 1))) "Browse Champions of League of Legends on Data Dragon" single ((:commit . "0deec9867bd7ba96220ee2968a9b2a94fd474431") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:keywords "games" "hypermedia") (:url . "https://github.com/xuchunyang/lol-data-dragon.el"))])
+ (lolcat . [(20190527 1145) ((emacs (24 3))) "Rainbows and unicorns!" single ((:commit . "4855e587a3b9681c077dac4b9f166dd860f439a4") (:authors ("Xu Chunyang" . "mail@xuchunyang.me")) (:maintainer "Xu Chunyang" . "mail@xuchunyang.me") (:url . "https://github.com/xuchunyang/lolcat.el"))])
+ (lolcode-mode . [(20111002 847) nil "Major mode for editing LOLCODE" single ((:commit . "1914f1ba87587ecf5f175eeb2144c28e9f039317") (:authors ("Bodil Stokke" . "lolcode@bodil.tv")) (:maintainer "Bodil Stokke" . "lolcode@bodil.tv") (:keywords "lolcode" "major" "mode") (:url . "http://github.com/bodil/lolcode-mode"))])
+ (look-dired . [(20160729 2323) ((look-mode (1 0))) "Extensions to look-mode for dired buffers" single ((:commit . "9bfa4e5e6f3810705b6426c88493ea0bf6b15640") (:authors ("Joe Bloggs" . "vapniks@yahoo.com")) (:maintainer "Joe Bloggs" . "vapniks@yahoo.com") (:keywords "convenience") (:url . "https://github.com/vapniks/look-dired"))])
+ (look-mode . [(20220313 2103) nil "quick file viewer for image and text file browsing" single ((:commit . "4ab32794b07f77b1d243dc07239c417f20cab7b8") (:authors ("Peter H. Mao <peter.mao@gmail.com>" . "petermao@jpl.nasa.gov")) (:maintainer "Peter H. Mao <peter.mao@gmail.com>" . "petermao@jpl.nasa.gov"))])
+ (loop . [(20160813 1407) nil "friendly imperative loop structures" single ((:commit . "9db6372791bbd0cf3fa907ed0ae3e6b7bcf6cc57") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:keywords "loop" "while" "for each" "break" "continue"))])
+ (loophole . [(20220311 1130) ((emacs (27 1))) "Manage temporary key bindings" single ((:commit . "bd93fcd42fc2db76bf6bc3fbb4eb7401444bd04d") (:authors ("0x60DF" . "0x60df@gmail.com")) (:maintainer "0x60DF" . "0x60df@gmail.com") (:keywords "convenience") (:url . "https://github.com/0x60df/loophole"))])
+ (loopy . [(20220510 323) ((emacs (27 1)) (map (3 0)) (seq (2 22))) "A looping macro" tar ((:commit . "98537cb29e28d32d3607fa61253ff1bf04db2539") (:authors ("Earl Hyatt")) (:maintainer "Earl Hyatt") (:keywords "extensions") (:url . "https://github.com/okamsn/loopy"))])
+ (loopy-dash . [(20220330 127) ((emacs (25 1)) (loopy (0 10 1)) (dash (2 19))) "Dash destructuring for `loopy'" single ((:commit . "98537cb29e28d32d3607fa61253ff1bf04db2539") (:authors ("Earl Hyatt")) (:maintainer "Earl Hyatt") (:keywords "extensions") (:url . "https://github.com/okamsn/loopy"))])
+ (lorem-ipsum . [(20190819 2042) nil "Insert dummy pseudo Latin text." single ((:commit . "da75c155da327c7a7aedb80f5cfe409984787049") (:authors ("Jean-Philippe Theberge" . "jphil21@sourceforge.net")) (:maintainer "Joe Schafer" . "joe@jschaf.com") (:keywords "tools" "language" "convenience"))])
+ (lox-mode . [(20200619 1700) ((emacs (24 3))) "Major mode for the Lox programming language" single ((:commit . "b6935b3f5b131d2c1c7685cf6464274f7cd64943") (:authors ("Timmy Jose" . "zoltan.jose@gmail.com")) (:maintainer "Timmy Jose" . "zoltan.jose@gmail.com") (:keywords "languages" "lox") (:url . "https://github.com/timmyjose-projects/lox-mode"))])
+ (lpy . [(20201027 1425) ((emacs (25 1)) (lispy (0 27 0))) "A lispy interface to Python" tar ((:commit . "076ce9acb68f6ac1b39127b634a91ffd865d13d8") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "python" "lisp") (:url . "https://github.com/abo-abo/lpy"))])
+ (lsp-dart . [(20220430 1535) ((emacs (26 3)) (lsp-treemacs (0 3)) (lsp-mode (7 0 1)) (dap-mode (0 6)) (f (0 20 0)) (dash (2 14 1)) (dart-mode (1 0 5))) "Dart support lsp-mode" tar ((:commit . "7ca60ce9a703ad7a950dcd5ec36ef4251f57d207") (:keywords "languages" "extensions") (:url . "https://emacs-lsp.github.io/lsp-dart"))])
+ (lsp-docker . [(20220501 1056) ((emacs (26 1)) (dash (2 14 1)) (lsp-mode (6 2 1)) (f (0 20 0)) (yaml (0 2 0)) (ht (2 0))) "LSP Docker integration" single ((:commit . "c57863609abfb93fccabf81dc3112ac38f93c4a2") (:authors ("Ivan Yonchovski" . "yyoncho@gmail.com")) (:maintainer "Ivan Yonchovski" . "yyoncho@gmail.com") (:keywords "languages" "langserver") (:url . "https://github.com/emacs-lsp/lsp-docker"))])
+ (lsp-focus . [(20200906 1917) ((emacs (26 1)) (focus (0 1 1)) (lsp-mode (6 1))) "focus.el support for lsp-mode" single ((:commit . "d01f0af156e4e78dcb9fa8e080a652cf8f221d30") (:authors ("Vibhav Pant")) (:maintainer "Vibhav Pant") (:keywords "languages" "lsp-mode") (:url . "https://github.com/emacs-lsp/lsp-focus"))])
+ (lsp-grammarly . [(20220509 823) ((emacs (27 1)) (lsp-mode (6 1)) (grammarly (0 3 0)) (request (0 3 0)) (s (1 12 0)) (ht (2 3))) "LSP Clients for Grammarly" single ((:commit . "3fe46f0cc7c757582e7ba14c1d29e084cc0d5357") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/emacs-grammarly/lsp-grammarly"))])
+ (lsp-haskell . [(20220307 2312) ((emacs (24 3)) (lsp-mode (3 0))) "Haskell support for lsp-mode" single ((:commit . "daa51072e1718ca075987901fccbbc2357bca1fc") (:keywords "haskell") (:url . "https://github.com/emacs-lsp/lsp-haskell"))])
+ (lsp-intellij . [(20180831 2051) ((emacs (25 1)) (lsp-mode (4 1))) "intellij lsp client" single ((:commit . "cf30f0ac63bd0140e758840b8ab070e8313697b2") (:authors ("Ruin0x11" . "ipickering2@gmail.com")) (:maintainer "Ruin0x11" . "ipickering2@gmail.com") (:keywords "languages" "processes" "tools") (:url . "https://github.com/Ruin0x11/lsp-intellij"))])
+ (lsp-ivy . [(20210904 2043) ((emacs (25 1)) (dash (2 14 1)) (lsp-mode (6 2 1)) (ivy (0 13 0))) "LSP ivy integration" single ((:commit . "3e87441a625d65ced5a208a0b0442d573596ffa3") (:keywords "languages" "debug") (:url . "https://github.com/emacs-lsp/lsp-ivy"))])
+ (lsp-java . [(20220325 547) ((emacs (25 1)) (lsp-mode (6 0)) (markdown-mode (2 3)) (dash (2 18 0)) (f (0 20 0)) (ht (2 0)) (request (0 3 0)) (treemacs (2 5)) (dap-mode (0 5))) "Java support for lsp-mode" tar ((:commit . "39ca56e24d6f9db2c9d889f79808713e4afde027") (:keywords "languague" "tools") (:url . "https://github.com/emacs-lsp/lsp-java"))])
+ (lsp-javacomp . [(20190124 1755) ((emacs (25 1)) (lsp-mode (3 0)) (s (1 2 0))) "Provide Java IDE features powered by JavaComp." single ((:commit . "82aa4ad6ca03a74565c35e855b318b1887bcd89b") (:keywords "java" "tools" "lsp") (:url . "https://github.com/tigersoldier/lsp-javacomp"))])
+ (lsp-jedi . [(20220430 18) ((emacs (25 1)) (lsp-mode (6 0))) "Lsp client plugin for Python Jedi Language Server" single ((:commit . "5e3eb3e160c2d38b8bd2b5cd3b86fa4f823f9330") (:authors ("Fred Campos" . "fred.tecnologia@gmail.com")) (:maintainer "Fred Campos") (:keywords "language-server" "tools" "python" "jedi" "ide") (:url . "http://github.com/fredcamps/lsp-jedi"))])
+ (lsp-julia . [(20211229 1534) ((emacs (25 1)) (lsp-mode (6 3)) (julia-mode (0 3))) "Julia support for lsp-mode" tar ((:commit . "d6688bb131ff4a5a0201f6d3826ef0b018265389") (:authors ("Martin Wolke" . "vibhavp@gmail.com") ("Adam Beckmeyer" . "adam_git@thebeckmeyers.xyz") ("Guido Kraemer" . "gdkrmr@users.noreply.github.com")) (:maintainer "Guido Kraemer" . "gdkrmr@users.noreply.github.com") (:keywords "languages" "tools") (:url . "https://github.com/gdkrmr/lsp-julia"))])
+ (lsp-latex . [(20210815 1426) ((emacs (25 1)) (lsp-mode (6 0))) "LSP-mode client for LaTeX, on texlab" single ((:commit . "3f6b2ac9585682828eef81f895757f74cfba7309") (:authors ("ROCKTAKEY" . "rocktakey@gmail.com")) (:maintainer "ROCKTAKEY" . "rocktakey@gmail.com") (:keywords "languages" "tex") (:url . "https://github.com/ROCKTAKEY/lsp-latex"))])
+ (lsp-ltex . [(20220508 533) ((emacs (26 1)) (lsp-mode (6 1))) "LSP Clients for LTEX" single ((:commit . "8c2ba735ed1e21777408167f6a7c7d9681d9e7bc") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/emacs-languagetool/lsp-ltex"))])
+ (lsp-metals . [(20220330 1958) ((emacs (26 1)) (scala-mode (1 1)) (lsp-mode (7 0)) (lsp-treemacs (0 2)) (dap-mode (0 3)) (dash (2 18 0)) (f (0 20 0)) (ht (2 0)) (treemacs (2 5))) "Scala Client settings" tar ((:commit . "b7f77de69431786c54e9a57845e4f2d75fbee053") (:authors ("Ross A. Baker" . "ross@rossabaker.com") ("Evgeny Kurnevsky" . "kurnevsky@gmail.com")) (:maintainer "Ross A. Baker" . "ross@rossabaker.com") (:keywords "languages" "extensions") (:url . "https://github.com/emacs-lsp/lsp-metals"))])
+ (lsp-mode . [(20220505 630) ((emacs (26 1)) (dash (2 18 0)) (f (0 20 0)) (ht (2 3)) (spinner (1 7 3)) (markdown-mode (2 3)) (lv (0))) "LSP mode" tar ((:commit . "6327359f3b5e19aeaa1c9ee6bd9b80b51f95f843") (:authors ("Vibhav Pant, Fangrui Song, Ivan Yonchovski")) (:maintainer "Vibhav Pant, Fangrui Song, Ivan Yonchovski") (:keywords "languages") (:url . "https://github.com/emacs-lsp/lsp-mode"))])
+ (lsp-mssql . [(20191204 1150) ((emacs (25 1)) (lsp-mode (6 2)) (dash (2 14 1)) (f (0 20 0)) (ht (2 0)) (lsp-treemacs (0 1))) "MSSQL LSP bindings" tar ((:commit . "8d5d4d4a7f72b4cae89a48ea8618f3ef28bcb121") (:authors ("Ivan Yonchovski" . "yyoncho@gmail.com")) (:maintainer "Ivan Yonchovski" . "yyoncho@gmail.com") (:keywords "data" "languages") (:url . "https://github.com/emacs-lsp/lsp-mssql"))])
+ (lsp-origami . [(20211016 1045) ((origami (1 0)) (lsp-mode (6 1))) "origami.el support for lsp-mode" single ((:commit . "7df9c91a309aa4229bec41f109920b37c4197618") (:authors ("Vibhav Pant")) (:maintainer "Vibhav Pant") (:keywords "languages" "lsp-mode") (:url . "https://github.com/emacs-lsp/lsp-origami"))])
+ (lsp-p4 . [(20190127 1049) ((lsp-mode (3 0))) "P4 support for lsp-mode" tar ((:commit . "669460d93b87fb876df11b2b68229677e7ad1a26") (:authors ("Dmitri Makarov")) (:maintainer "Dmitri Makarov") (:keywords "lsp" "p4") (:url . "https://github.com/dmakarov/p4ls"))])
+ (lsp-pascal . [(20200422 1610) ((emacs (24 4)) (lsp-mode (6 3))) "LSP client for Pascal" single ((:commit . "b132bdf66748e4abe0d4140f6d061b1ccd56082a") (:authors ("Arjan Adriaanse" . "arjan@adriaan.se")) (:maintainer "Arjan Adriaanse" . "arjan@adriaan.se") (:keywords "languages" "tools") (:url . "https://github.com/arjanadriaanse/lsp-pascal"))])
+ (lsp-pyre . [(20190406 335) ((lsp-mode (6 0))) "lsp-mode client for python using pyre" single ((:commit . "e177b8f5efd1a955b5753aeb5d1894e6d21be35a") (:authors ("John Allen" . "oss@porcnick.com")) (:maintainer "John Allen" . "oss@porcnick.com") (:url . "https://github.com/jra3/lsp-pyre"))])
+ (lsp-pyright . [(20220411 1753) ((emacs (26 1)) (lsp-mode (7 0)) (dash (2 18 0)) (ht (2 0))) "Python LSP client using Pyright" single ((:commit . "ab7369d96f4d7d058d0e06e743f86fda8ecc191c") (:authors ("Arif Rezai, Vincent Zhang, Andrew Christianson")) (:maintainer "Arif Rezai, Vincent Zhang, Andrew Christianson") (:keywords "languages" "tools" "lsp") (:url . "https://github.com/emacs-lsp/lsp-pyright"))])
+ (lsp-python-ms . [(20211204 1209) ((emacs (25 1)) (lsp-mode (6 1))) "The lsp-mode client for Microsoft python-language-server" single ((:commit . "f8e7c4bcaefbc3fd96e1ca53d17589be0403b828") (:authors ("Charl Botha")) (:maintainer "Andrew Christianson, Vincent Zhang") (:keywords "languages" "tools") (:url . "https://github.com/emacs-lsp/lsp-python-ms"))])
+ (lsp-rescript . [(20220314 1957) ((lsp-mode (7 0 1)) (emacs (25 1)) (rescript-mode (0 1))) "LSP client configuration for lsp-mode and rescript-vscode" single ((:commit . "7baf9adf10234cf964feefae99050268e9bc5681") (:authors ("John Lee")) (:maintainer "John Lee") (:keywords "languages") (:url . "https://github.com/jjlee/lsp-rescript"))])
+ (lsp-sonarlint . [(20210820 2044) ((emacs (25)) (dash (2 12 0)) (lsp-mode (6 3)) (ht (2 3))) "Emacs Sonarlint lsp client" tar ((:commit . "3af97828f9c08d782fb2086e3a73bda5759e6788") (:authors ("Fermin MF" . "fmfs@posteo.net")) (:maintainer "Fermin MF" . "fmfs@posteo.net") (:keywords "languages" "tools" "php" "javascript" "xml" "ruby" "html" "scala" "java" "python") (:url . "https://github.com/emacs-lsp/lsp-sonarlint"))])
+ (lsp-sourcekit . [(20210905 2017) ((emacs (25 1)) (lsp-mode (5))) "sourcekit-lsp client for lsp-mode" single ((:commit . "97ff36b228a61e69734c7180f33cc6951b1a600f") (:authors ("Daniel Martín")) (:maintainer "Daniel Martín") (:keywords "languages" "lsp" "swift" "objective-c" "c++") (:url . "https://github.com/emacs-lsp/lsp-sourcekit"))])
+ (lsp-tailwindcss . [(20211211 248) ((lsp-mode (7 1)) (emacs (26 1))) "A lsp-mode client for tailwindcss" single ((:commit . "8c04fc4ac6f5eb8053ecdaaedffa35e0f7a5b865") (:authors ("A.I." . "merrick@luois.me")) (:maintainer "A.I." . "merrick@luois.me") (:keywords "language" "tools") (:url . "https://github.com/merrickluo/lsp-tailwindcss"))])
+ (lsp-treemacs . [(20220502 459) ((emacs (26 1)) (dash (2 18 0)) (f (0 20 0)) (ht (2 0)) (treemacs (2 5)) (lsp-mode (6 0))) "LSP treemacs" tar ((:commit . "9859326df6b8e8c954a3c227e53b6878e54aaae8") (:authors ("Ivan Yonchovski")) (:maintainer "Ivan Yonchovski") (:keywords "languages") (:url . "https://github.com/emacs-lsp/lsp-treemacs"))])
+ (lsp-ui . [(20220510 627) ((emacs (26 1)) (dash (2 18 0)) (lsp-mode (6 0)) (markdown-mode (2 3))) "UI modules for lsp-mode" tar ((:commit . "eba9c4eaa255a14e2facd658e7122674c05390f8") (:authors ("Sebastien Chapuis <sebastien@chapu.is>, Fangrui Song" . "i@maskray.me")) (:maintainer "Sebastien Chapuis <sebastien@chapu.is>, Fangrui Song" . "i@maskray.me") (:keywords "languages" "tools") (:url . "https://github.com/emacs-lsp/lsp-ui"))])
+ (lua-mode . [(20210809 1320) ((emacs (24 3))) "a major-mode for editing Lua scripts" single ((:commit . "5a9bee8d5fc978dc64fcb677167417010321ba65") (:authors ("2011-2013 immerrr" . "immerrr+lua@gmail.com") ("2010-2011 Reuben Thomas" . "rrt@sc3d.org") ("2006 Juergen Hoetzel" . "juergen@hoetzel.info") ("2004 various (support for Lua 5 and byte compilation)") ("2001 Christian Vogler" . "cvogler@gradient.cis.upenn.edu") ("1997 Bret Mogilefsky" . "mogul-lua@gelatinous.com") ("tcl-mode by Gregor Schmid" . "schmid@fb3-s7.math.tu-berlin.de") ("with tons of assistance from") ("Paul Du Bois" . "pld-lua@gelatinous.com") ("Aaron Smith" . "aaron-lua@gelatinous.com")) (:maintainer "2011-2013 immerrr" . "immerrr+lua@gmail.com") (:keywords "languages" "processes" "tools") (:url . "https://immerrr.github.io/lua-mode"))])
+ (luarocks . [(20170430 2305) ((emacs (24)) (cl-lib (0 5))) "luarocks tools" single ((:commit . "cee27ba0716edf338077387969883226dd2b7484") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "convenience") (:url . "https://github.com/emacs-pe/luarocks.el"))])
+ (lush-theme . [(20180816 2200) ((emacs (24))) "A dark theme with lush colors" single ((:commit . "645e1959143532df8f7ef90e1184e9556df18af7") (:authors ("Andre Richter" . "andre.o.richter@gmail.com")) (:maintainer "Andre Richter" . "andre.o.richter@gmail.com") (:keywords "theme" "dark" "strong colors") (:url . "https://github.com/andre-richter/emacs-lush-theme"))])
+ (lusty-explorer . [(20200602 228) ((emacs (25 1))) "Dynamic filesystem explorer and buffer switcher" single ((:commit . "a746514ccd8df71fc920ba8ad0aa8dca58702631") (:keywords "convenience" "files" "matching" "tools") (:url . "https://github.com/sjbach/lusty-emacs"))])
+ (lux-mode . [(20220328 1301) ((emacs (24 3))) "Major mode for editing lux files" single ((:commit . "924dcda3e4212c0b28e8ce140b9d8e9a1117c5ef") (:authors ("Håkan Mattsson")) (:maintainer "Håkan Mattsson") (:url . "https://github.com/hawk/lux"))])
+ (lv . [(20200507 1518) nil "Other echo area" single ((:commit . "9e9e00cb240ea1903ffd36a54956b3902c379d29") (:authors ("Oleh Krehel")) (:maintainer "Oleh Krehel"))])
+ (lxc . [(20140410 2022) nil "lxc integration with Emacs" single ((:commit . "88bed56c954d1edd9ff5ce0ced2c02dcf9f71835") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "processes") (:url . "https://github.com/nicferrier/emacs-lxc"))])
+ (lxc-tramp . [(20200414 1445) ((emacs (24)) (cl-lib (0 6))) "TRAMP integration for LXC containers" single ((:commit . "1585e55a5deb89e2f4e30a0ad9e0f121d1e0ebcb") (:authors ("montag451")) (:maintainer "montag451") (:keywords "lxc" "convenience") (:url . "https://github.com/montag451/lxc-tramp"))])
+ (lxd-tramp . [(20181023 7) ((emacs (24 4)) (cl-lib (0 6))) "TRAMP integration for LXD containers" single ((:commit . "f335c76245f62b02cf67a9376eca6f3863c8a75a") (:authors ("Yc.S" . "onixie@gmail.com")) (:maintainer "Yc.S" . "onixie@gmail.com") (:keywords "lxd" "lxc" "convenience") (:url . "https://github.com/onixie/lxd-tramp.git"))])
+ (lyrics . [(20220206 116) ((emacs (25 1)) (seq (2 15))) "Show lyrics" single ((:commit . "c3d42f1e039941f32f49252e1b1610de337b4470") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "convenience") (:url . "https://github.com/emacs-pe/lyrics.el"))])
+ (lyrics-fetcher . [(20220207 1326) ((emacs (27)) (emms (7 5)) (f (0 20 0)) (request (0 3 2))) "Fetch song lyrics and album covers" tar ((:commit . "06bd0293dfa759df48faefd73be60d43d1febd17") (:authors ("Korytov Pavel" . "thexcloud@gmail.com")) (:maintainer "Korytov Pavel" . "thexcloud@gmail.com") (:url . "https://github.com/SqrtMinusOne/lyrics-fetcher.el"))])
+ (m-buffer . [(20170407 2141) ((seq (2 14))) "List-Oriented, Functional Buffer Manipulation" tar ((:commit . "8681342aaffa187e5c54945ab91b812965a96d19") (:authors ("Phillip Lord" . "phillip.lord@russet.org.uk")) (:maintainer "Phillip Lord" . "phillip.lord@russet.rg.uk"))])
+ (mac-pseudo-daemon . [(20200215 513) ((cl-lib (0 1))) "Daemon mode that plays nice with Mac OS." single ((:commit . "94240ebb716f11af8427b6295c3f44c0c43419d3") (:authors ("Ryan C. Thompson")) (:maintainer "Ryan C. Thompson") (:keywords "convenience" "osx" "mac") (:url . "https://github.com/DarwinAwardWinner/osx-pseudo-daemon"))])
+ (maces-game . [(20170903 1551) ((dash (2 12 0)) (cl-lib (0 5)) (emacs (24))) "another anagram game." tar ((:commit . "c0fb795f5642467ea528d2f04d904547e8a77ecd") (:authors ("Pawel Bokota" . "pawelb.lnx@gmail.com")) (:maintainer "Pawel Bokota" . "pawelb.lnx@gmail.com") (:keywords "games" "word games" "anagram") (:url . "https://github.com/pawelbx/anagram-game"))])
+ (macports . [(20220509 1326) ((emacs (25 1)) (transient (0 1 0))) "A porcelain for MacPorts" tar ((:commit . "114fc87055a27a4f21901397b4418c018f293e1d") (:authors ("Aaron Madlon-Kay")) (:maintainer "Aaron Madlon-Kay") (:keywords "convenience") (:url . "https://github.com/amake/macports.el"))])
+ (macro-math . [(20130328 1604) nil "in-buffer mathematical operations" single ((:commit . "216e59371e9ee39c34117ba79b9acd78bb415750") (:authors ("Nikolaj Schumacher <bugs * nschum de>")) (:maintainer "Nikolaj Schumacher <bugs * nschum de>") (:keywords "convenience") (:url . "http://nschum.de/src/emacs/macro-math/"))])
+ (macrostep . [(20161120 2106) ((cl-lib (0 5))) "interactive macro expander" tar ((:commit . "424e3734a1ee526a1bd7b5c3cd1d3ef19d184267") (:authors ("joddie" . "j.j.oddie@gmail.com")) (:maintainer "joddie" . "j.j.oddie@gmail.com") (:keywords "lisp" "languages" "macro" "debugging") (:url . "https://github.com/joddie/macrostep"))])
+ (macrostep-geiser . [(20210717 801) ((emacs (24 4)) (macrostep (0 9)) (geiser (0 12))) "Macrostep for `geiser'" single ((:commit . "f6a2d5bb96ade4f23df557649af87ebd0cc45125") (:authors ("Nikita Bloshchanevich")) (:maintainer "Nikita Bloshchanevich") (:keywords "languages" "scheme") (:url . "https://github.com/nbfalcon/macrostep-geiser"))])
+ (madhat2r-theme . [(20170203 30) ((emacs (24))) "dark color theme that is easy on the eyes" single ((:commit . "6b387f09de055cfcc15d74981cd4f32f8f9a7323") (:authors ("Micah Duke")) (:maintainer "Micah Duke") (:keywords "color" "theme") (:url . "https://github.com/madhat2r/madhat2r-theme"))])
+ (mag-menu . [(20150505 1850) ((splitter (0 1 0))) "Intuitive keyboard-centric menu system" single ((:commit . "9b9277021cd09fb1dba64b1d2a00705d20914bd6") (:authors ("Steven Thomas")) (:maintainer "Steven Thomas") (:keywords "convenience") (:url . "https://github.com/chumpage/mag-menu"))])
+ (magic-filetype . [(20180219 1552) ((emacs (24)) (s (1 9 0))) "Enhance filetype major mode" single ((:commit . "019494add5ff02dd36cb3f500142fc51125522cc") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "emulations" "vim" "ft" "file" "magic-mode") (:url . "https://github.com/zonuexe/magic-filetype.el"))])
+ (magic-latex-buffer . [(20210306 422) ((cl-lib (0 5)) (emacs (25 1))) "Magically enhance LaTeX-mode font-locking for semi-WYSIWYG editing" single ((:commit . "903ec91872760e47c0e5715795f8465173615098") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://zk-phi.github.io/"))])
+ (magik-mode . [(20220422 837) nil "mode for editing Magik + some utils." tar ((:commit . "af1b83786c95d448dcb4df5406eb1cdba975abf5") (:keywords "languages") (:url . "http://github.com/roadrunner1776/magik"))])
+ (magit . [(20220508 1841) ((emacs (25 1)) (compat (28 1 1 0)) (dash (20210826)) (git-commit (20220222)) (magit-section (20220325)) (transient (20220325)) (with-editor (20220318))) "A Git porcelain inside Emacs." tar ((:commit . "125a8d5e417dda4438ce41d71a821d8a936fa5ea") (:authors ("Marius Vollmer" . "marius.vollmer@gmail.com") ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "git" "tools" "vc") (:url . "https://github.com/magit/magit"))])
+ (magit-annex . [(20220302 1725) ((cl-lib (0 3)) (magit (3 0 0))) "Control git-annex from Magit" single ((:commit . "efe484644666c6b7c544b0fb7b87e30703fa9425") (:authors ("Kyle Meyer" . "kyle@kyleam.com") ("Rémi Vanicat" . "vanicat@debian.org")) (:maintainer "Kyle Meyer" . "kyle@kyleam.com") (:keywords "vc" "tools") (:url . "https://github.com/magit/magit-annex"))])
+ (magit-circleci . [(20191209 2113) ((dash (2 16 0)) (transient (0 1 0)) (magit (2 90 0)) (emacs (25 3))) "CircleCI integration for Magit" single ((:commit . "2d4bdacf498ed3ff7d2c3574d346b2d24cbb12da") (:authors ("Adrien Brochard")) (:maintainer "Adrien Brochard") (:keywords "circleci" "continuous" "integration" "magit" "vc" "tools") (:url . "https://github.com/abrochard/magit-circleci"))])
+ (magit-commit-mark . [(20220507 1118) ((emacs (28 1)) (magit (3 3 0))) "Support marking commits as read" single ((:commit . "bea29dc0419122b5dbc68b6b56cb0fbe97729e2d") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://codeberg.com/ideasman42/emacs-magit-commit-mark"))])
+ (magit-delta . [(20220125 50) ((emacs (25 1)) (magit (20200426)) (xterm-color (2 0))) "Use Delta when displaying diffs in Magit" single ((:commit . "5fc7dbddcfacfe46d3fd876172ad02a9ab6ac616") (:authors ("Dan Davison" . "dandavison7@gmail.com")) (:maintainer "Dan Davison" . "dandavison7@gmail.com") (:url . "https://github.com/dandavison/magit-delta"))])
+ (magit-diff-flycheck . [(20190524 551) ((magit (2)) (flycheck (31)) (seq (2)) (emacs (25 1))) "Report errors in diffs" single ((:commit . "28acf74f59e385865746cccf4b1e4c4025ae9433") (:authors ("Alex Ragone" . "ragonedk@gmail.com")) (:maintainer "Alex Ragone" . "ragonedk@gmail.com") (:keywords "convenience" "matching") (:url . "https://github.com/ragone/magit-diff-flycheck"))])
+ (magit-filenotify . [(20151116 2340) ((magit (1 3 0)) (emacs (24 4))) "Refresh status buffer when git tree changes" single ((:commit . "c0865b3c41af20b6cd89de23d3b0beb54c8401a4") (:authors ("Rüdiger Sonderfeld" . "ruediger@c-plusplus.de")) (:maintainer "Rüdiger Sonderfeld" . "ruediger@c-plusplus.de") (:keywords "tools"))])
+ (magit-find-file . [(20150702 830) ((magit (2 1 0)) (dash (2 8 0))) "completing-read over all files in Git" single ((:commit . "c3ea91bab37d10a814a829728ec972811f728d60") (:authors ("Bradley Wright" . "brad@intranation.com")) (:maintainer "Bradley Wright" . "brad@intranation.com") (:keywords "git") (:url . "https://github.com/bradleywright/magit-find-file.el"))])
+ (magit-gerrit . [(20210831 1453) ((emacs (25 1)) (magit (2 90 1)) (transient (0 3 0))) "Magit plugin for Gerrit Code Review" single ((:commit . "9104713f6ea918e9faaf25f2cc182c65029db936") (:authors ("Brian Fransioli" . "assem@terranpro.org")) (:maintainer "Brian Fransioli" . "assem@terranpro.org") (:url . "https://github.com/emacsorphanage/magit-gerrit"))])
+ (magit-gh-pulls . [(20191230 1944) ((emacs (24 4)) (gh (0 9 1)) (magit (2 12 0)) (pcache (0 2 3)) (s (1 6 1))) "GitHub pull requests extension for Magit" single ((:commit . "57f3a5158bbc7bfd169ee136fde351cce999e0ca") (:authors ("Yann Hodique" . "yann.hodique@gmail.com")) (:maintainer "Yann Hodique" . "yann.hodique@gmail.com") (:keywords "git" "tools") (:url . "https://github.com/sigma/magit-gh-pulls"))])
+ (magit-gitflow . [(20170929 824) ((magit (2 1 0)) (magit-popup (2 2 0))) "gitflow extension for magit" single ((:commit . "cc41b561ec6eea947fe9a176349fb4f771ed865b") (:authors ("Jan Tatarik" . "Jan.Tatarik@gmail.com")) (:maintainer "Jan Tatarik" . "Jan.Tatarik@gmail.com") (:keywords "vc" "tools") (:url . "https://github.com/jtatarik/magit-gitflow"))])
+ (magit-imerge . [(20220306 2311) ((emacs (25 1)) (magit (3 0 0))) "Magit extension for git-imerge" single ((:commit . "37bca48218dc32cad964e01e0f9936a90f634fba") (:authors ("Kyle Meyer" . "kyle@kyleam.com")) (:maintainer "Kyle Meyer" . "kyle@kyleam.com") (:keywords "vc" "tools") (:url . "https://github.com/magit/magit-imerge"))])
+ (magit-lfs . [(20220314 1957) ((emacs (24 4)) (magit (2 10 3)) (dash (2 13 0))) "Magit plugin for Git LFS" single ((:commit . "8ebe246f20f4ab5c9f191c38137833c7f01a0432") (:authors ("Junyoung/Clare Jang" . "jjc9310@gmail.com")) (:maintainer "Junyoung/Clare Jang" . "jjc9310@gmail.com") (:keywords "magit" "git" "lfs" "tools" "vc") (:url . "https://github.com/ailrun/magit-lfs"))])
+ (magit-libgit . [(20220429 1720) ((emacs (25 1)) (compat (28 1 1 0)) (libgit (0)) (magit (20211004))) "(POC) Teach Magit to use Libgit2." tar ((:commit . "125a8d5e417dda4438ce41d71a821d8a936fa5ea") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "git" "tools" "vc") (:url . "https://github.com/magit/magit"))])
+ (magit-org-todos . [(20180709 1950) ((magit (2 0 0)) (emacs (24))) "Add local todo items to the magit status buffer" single ((:commit . "9ffa3efb098434d837cab4bacd1601fdfc6fe999") (:authors ("Daniel Ma")) (:maintainer "Daniel Ma") (:keywords "org-mode" "magit" "tools") (:url . "http://github.com/danielma/magit-org-todos"))])
+ (magit-patch-changelog . [(20220313 1229) ((emacs (25 1)) (magit (3 3 0))) "Generate a patch according to emacs-mirror/CONTRIBUTE" single ((:commit . "96936d2bd92c8bbf87f65bc293f3246014bc2764") (:keywords "git" "tools" "vc") (:url . "https://github.com/dickmao/magit-patch-changelog"))])
+ (magit-popup . [(20200719 1015) ((emacs (24 4)) (dash (2 13 0))) "Define prefix-infix-suffix command combos" tar ((:commit . "d8585fa39f88956963d877b921322530257ba9f5") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "bindings") (:url . "https://github.com/magit/magit-popup"))])
+ (magit-rbr . [(20181009 2016) ((magit (2 13 0)) (emacs (24 3))) "Support for git rbr in Magit" single ((:commit . "029203b3e48537205052a058e964f058cd802c3c") (:authors ("Anatoly Fayngelerin" . "fanatoly+magitrbr@gmail.com")) (:maintainer "Anatoly Fayngelerin" . "fanatoly+magitrbr@gmail.com") (:keywords "git" "magit" "rbr" "tools") (:url . "https://github.com/fanatoly/magit-rbr"))])
+ (magit-reviewboard . [(20200727 1748) ((emacs (25 2)) (magit (2 13 0)) (s (1 12 0)) (request (0 3 0))) "Show open Reviewboard reviews in Magit" single ((:commit . "aceedff88921f1dfef8a6b2fb18fe316fb7223a8") (:authors ("Jules Tamagnan" . "jtamagnan@gmail.com")) (:maintainer "Jules Tamagnan" . "jtamagnan@gmail.com") (:keywords "magit" "vc") (:url . "http://github.com/jtamagnan/magit-reviewboard"))])
+ (magit-section . [(20220506 1936) ((emacs (25 1)) (compat (28 1 1 0)) (dash (20210826))) "Sections for read-only buffers." tar ((:commit . "125a8d5e417dda4438ce41d71a821d8a936fa5ea") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "tools") (:url . "https://github.com/magit/magit"))])
+ (magit-svn . [(20210426 2114) ((emacs (25 1)) (magit (2 90 1)) (transient (0 3 2))) "Git-Svn extension for Magit" single ((:commit . "350493217afdb7637564e089f475909adecd9208") (:authors ("Phil Jackson" . "phil@shellarchive.co.uk")) (:maintainer "Phil Jackson" . "phil@shellarchive.co.uk") (:keywords "vc" "tools"))])
+ (magit-tbdiff . [(20220306 2311) ((emacs (25 1)) (magit (3 0 0))) "Magit extension for range diffs" single ((:commit . "ae9345d867539a4c5c635be04df2e26468444da8") (:authors ("Kyle Meyer" . "kyle@kyleam.com")) (:maintainer "Kyle Meyer" . "kyle@kyleam.com") (:keywords "vc" "tools") (:url . "https://github.com/magit/magit-tbdiff"))])
+ (magit-todos . [(20220326 519) ((emacs (25 2)) (async (1 9 2)) (dash (2 13 0)) (f (0 17 2)) (hl-todo (1 9 0)) (magit (2 13 0)) (pcre2el (1 8)) (s (1 12 0)) (transient (0 2 0))) "Show source file TODOs in Magit" single ((:commit . "67fd80c2f10aec4d5b2a24b5d3d53c08cc1f05dc") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "magit" "vc") (:url . "http://github.com/alphapapa/magit-todos"))])
+ (magit-topgit . [(20160313 1954) ((emacs (24 4)) (magit (2 1 0))) "TopGit extension for Magit" single ((:commit . "11489ea798bc88d0ea5244bbf725285eedfefbef") (:authors ("Yann Hodique" . "yann.hodique@gmail.com")) (:maintainer "Robin Green" . "greenrd@greenrd.org") (:keywords "vc" "tools"))])
+ (magit-vcsh . [(20190817 2014) ((magit (2 90 1)) (vcsh (0 4)) (emacs (24 4))) "Magit vcsh integration" single ((:commit . "fcff128cdbe3ef547dc64f2496cb6405b8ee21ca") (:authors ("Štěpán Němec" . "stepnem@gmail.com")) (:maintainer "Štěpán Němec" . "stepnem@gmail.com") (:keywords "vc" "files" "magit") (:url . "https://gitlab.com/stepnem/magit-vcsh-el"))])
+ (magithub . [(20220315 117) ((emacs (25)) (magit (2 12)) (s (1 12 0)) (ghub+ (0 3)) (git-commit (2 12)) (markdown-mode (2 3))) "Magit interfaces for GitHub" tar ((:commit . "dd62c7057155c0a334e6d9087779a2923d2300b8") (:authors ("Sean Allred" . "code@seanallred.com")) (:maintainer "Sean Allred" . "code@seanallred.com") (:keywords "git" "tools" "vc") (:url . "https://github.com/vermiculus/magithub"))])
+ (magma-mode . [(20211018 917) ((emacs (24 3)) (cl-lib (0 3)) (dash (2 6 0)) (f (0 17 1))) "Mode for editing Magma source code" tar ((:commit . "dd784445bc8cddf4a3ebe0f60009bed1f722f597") (:url . "https://github.com/ThibautVerron/magma-mode"))])
+ (magnatune . [(20151030 1935) ((dash (2 9 0)) (s (1 9 0))) "browse magnatune's music catalog" tar ((:commit . "605b01505ba30589c77ebb4c96834b5072ccbdd4"))])
+ (magrant . [(20210706 1438) ((emacs (25 1)) (dash (2 17 0)) (s (1 12 0)) (tablist (0 70)) (transient (0 2 0)) (friendly-shell-command (0 2 3))) "Transient Interface to Vagrant" tar ((:commit . "6309c001355126e3ade79493479b517925943d17") (:keywords "processes" "terminals") (:url . "https://github.com/p3r7/magrant"))])
+ (majapahit-theme . [(20160817 1848) nil "Color theme with a dark and light versions" tar ((:commit . "77c96df7619666b2102d90d452eeadf04adc89a6"))])
+ (major-mode-hydra . [(20210221 834) ((dash (2 18 0)) (pretty-hydra (0 2 2)) (emacs (25))) "Major mode keybindings managed by Hydra" single ((:commit . "84c1929a5153be169ca5c36737439d51dffde505") (:authors ("Jerry Peng" . "pr2jerry@gmail.com")) (:maintainer "Jerry Peng" . "pr2jerry@gmail.com") (:url . "https://github.com/jerrypnz/major-mode-hydra.el"))])
+ (major-mode-icons . [(20220210 1404) ((emacs (24 3)) (powerline (2 4)) (all-the-icons (2 3 0))) "display icon for major-mode on mode-line." tar ((:commit . "b0214e0af13cd3691c4d28f03e3108bd98ec7a85") (:keywords "frames" "multimedia") (:url . "https://repo.or.cz/major-mode-icons.git"))])
+ (make-color . [(20140625 1150) nil "Alternative to picking color - update fg/bg color by pressing r/g/b/... keys" single ((:commit . "5ca1383ca9228bca82120b238bdc119f302b75c0") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "color") (:url . "https://github.com/alezost/make-color.el"))])
+ (make-it-so . [(20190625 1036) ((swiper (0 8 0)) (emacs (24))) "Transform files with Makefile recipes." tar ((:commit . "b73dfb640588123c9eece230ad72b37604f5c126") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "make" "dired") (:url . "https://github.com/abo-abo/make-it-so"))])
+ (makefile-executor . [(20201119 1500) ((emacs (24 3)) (dash (2 11 0)) (f (0 11 0)) (s (1 10 0))) "Commands for conveniently running makefile targets" single ((:commit . "d0a34c355fb80a8616ae7ed5eebbda8507aa14ac") (:authors ("Lowe Thiderman" . "lowe.thiderman@gmail.com")) (:maintainer "Lowe Thiderman" . "lowe.thiderman@gmail.com") (:keywords "processes") (:url . "https://github.com/thiderman/makefile-executor.el"))])
+ (makey . [(20131231 1430) ((cl-lib (0 2))) "interactive commandline mode" single ((:commit . "c0b6bd5956744dd64052e54574e35d39f7c9d75b") (:authors ("Mickey Petersen" . "mickey@masteringemacs.org")) (:maintainer "Mickey Petersen" . "mickey@masteringemacs.org"))])
+ (malinka . [(20171202 1021) ((s (1 9 0)) (dash (2 4 0)) (f (0 11 0)) (cl-lib (0 3)) (rtags (0 0)) (projectile (0 11 0))) "A C/C++ project configuration package for Emacs" single ((:commit . "d4aa517c7a9022eae16c758c7efdb3a0403542d7") (:authors ("Lefteris Karapetsas" . "lefteris@refu.co")) (:maintainer "Lefteris Karapetsas" . "lefteris@refu.co") (:keywords "c" "c++" "project-management") (:url . "https://github.com/LefterisJP/malinka"))])
+ (mallard-mode . [(20131204 425) nil "Major mode for editing Mallard files" tar ((:commit . "c48170c1ace4959abcc5fb1df0d4cb149cff44c1") (:authors ("Jaromir Hradilek" . "jhradilek@gmail.com")) (:maintainer "Jaromir Hradilek" . "jhradilek@gmail.com") (:keywords "xml" "mallard") (:url . "https://github.com/jhradilek/emacs-mallard-mode"))])
+ (mallard-snippets . [(20131023 1851) ((yasnippet (0 8 0)) (mallard-mode (0 1 1))) "Yasnippets for Mallard" tar ((:commit . "70c5293f10722f2ace73bdf74d9a18f95b040edc") (:authors ("Jaromir Hradilek" . "jhradilek@gmail.com")) (:maintainer "Jaromir Hradilek" . "jhradilek@gmail.com") (:keywords "snippets" "mallard") (:url . "https://github.com/jhradilek/emacs-mallard-snippets"))])
+ (malyon . [(20161208 2125) ((cl-lib (0 5))) "mode to execute Z-code files version 3, 5, 8" single ((:commit . "0d9882650720b4a791556f5e2d917388965d6fc0") (:authors ("Peter Ilberg <peter.ilberg@gmail.com>, Christopher Madsen <cjm@cjmweb.net>, Erik Selberg" . "erik@selberg.org")) (:maintainer "Christopher Madsen <cjm@cjmweb.net>, Erik Selberg" . "erik@selberg.org") (:keywords "games" "emulations") (:url . "https://github.com/speedenator/malyon"))])
+ (man-commands . [(20151221 2221) ((cl-lib (0 5))) "Add interactive commands for every manpages installed in your computer." single ((:commit . "f4ba0c3790855d7544dff92d470d212f24de1d9d") (:authors ("Nathaniel Flath" . "nflath@gmail.com")) (:maintainer "Nathaniel Flath" . "nflath@gmail.com") (:url . "http://github.com/nflath/man-commands"))])
+ (manage-minor-mode . [(20210108 1832) ((emacs (24 3))) "Manage your minor-modes easily" single ((:commit . "e1af20253fbc5a91034ccd01cf00141130c11863") (:authors ("Shingo Fukuyama - http://fukuyama.co")) (:maintainer "Jen-Chieh Shen" . "jcs090218@gmail.com") (:keywords "tools" "minor-mode" "manage" "emacs") (:url . "https://github.com/ShingoFukuyama/manage-minor-mode"))])
+ (manage-minor-mode-table . [(20200717 809) ((emacs (25 1)) (manage-minor-mode (1 1))) "Manage minor-modes in table" single ((:commit . "e4c38aeb8ef6a85d8c082ad683720e5a4174aa79") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/manage-minor-mode-table"))])
+ (mandm-theme . [(20220426 1131) nil "An M&M color theme." single ((:commit . "4991bbc4b17308f5dc53742dc528cbfdc467ee01") (:authors ("Christian Hopps" . "chopps@gmail.com")) (:maintainer "Christian Hopps" . "chopps@gmail.com") (:url . "https://github.com/choppsv1/emacs-mandm-theme.git"))])
+ (mandoku . [(20180403 1106) ((org (8)) (github-clone (20150705 1705))) "A tool to access repositories of premodern Chinese texts" tar ((:commit . "d65dbaa329ecf931f4142be72862972ea6a24e63") (:authors ("Christian Wittern" . "cwittern@gmail.com")) (:maintainer "Christian Wittern" . "cwittern@gmail.com") (:keywords "convenience") (:url . "http://www.mandoku.org"))])
+ (mandoku-tls . [(20171118 240) ((emacs (24 4)) (mandoku (20170301)) (github-clone (0 2)) (hydra (0 13 6)) (helm (1 7 0)) (org (9 0)) (helm-charinfo (20170601))) "A tool to access the TLS database" single ((:commit . "ffeebf5bd451ac1806ddfe1744fbbd036a56f902") (:authors ("Christian Wittern" . "cwittern@gmail.com")) (:maintainer "Christian Wittern" . "cwittern@gmail.com") (:keywords "convenience") (:url . "https://github.com/mandoku/mandoku-tls"))])
+ (map-progress . [(20190128 16) ((cl-lib (0 6 1))) "mapping macros that report progress" single ((:commit . "1fb916159cd054c233ce3c80d9d01adfae640297") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "convenience") (:url . "https://github.com/tarsius/map-progress"))])
+ (map-regexp . [(20190128 18) ((cl-lib (0 6 1))) "map over matches of a regular expression" single ((:commit . "ae2d1c22f786ad987aef3e319925e80160a887a0") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "convenience") (:url . "https://github.com/tarsius/map-regexp"))])
+ (marcopolo . [(20160421 1004) ((s (1 9 0)) (dash (2 9 0)) (pkg-info (0 5 0)) (request (0 1 0))) "Emacs client to the Docker HUB/Registry API" tar ((:commit . "9193aabdf12223087b5ed58f1507d5d8a24a4381") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "docker") (:url . "https://github.com/nlamirault/marcopolo"))])
+ (marginalia . [(20220426 449) ((emacs (27 1))) "Enrich existing commands with completion annotations" single ((:commit . "26f2bd9ee7b63bcad6604108e2f565b34bc6083b") (:authors ("Omar Antolín Camarena <omar@matem.unam.mx>, Daniel Mendler" . "mail@daniel-mendler.de")) (:maintainer "Omar Antolín Camarena <omar@matem.unam.mx>, Daniel Mendler" . "mail@daniel-mendler.de") (:url . "https://github.com/minad/marginalia"))])
+ (mark-multiple . [(20121118 1554) nil "Sorta lets you mark several regions at once." tar ((:commit . "f6a53c7c5283d640ae718f4548b0fda78877a375") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "marking" "library"))])
+ (mark-thing-at . [(20201219 231) ((emacs (26)) (choice-program (0 13))) "Mark a pattern at the current point" single ((:commit . "a622d128afc8d2d67de897666a1e2eccba8d7818") (:authors ("Paul Landes")) (:maintainer "Paul Landes") (:keywords "mark" "point" "lisp") (:url . "https://github.com/plandes/mark-thing-at"))])
+ (mark-tools . [(20130614 1025) nil "Some simple tools to access the mark-ring in Emacs" single ((:commit . "a11b61effa90bd0abc876d12573674d36fc17f0c") (:authors ("Alex Bennée" . "alex@bennee.com")) (:maintainer "Alex Bennée" . "alex@bennee.com") (:url . "https://github.com/stsquad/emacs-mark-tools"))])
+ (markdown-changelog . [(20200120 2253) ((emacs (26)) (dash (2 13 0))) "Maintain changelog entries" single ((:commit . "1a2c3a4c3e4196f2b5dbb145b01b4bc435a93a96") (:authors ("Paul Landes")) (:maintainer "Paul Landes") (:keywords "markdown" "changelog" "files") (:url . "https://github.com/plandes/markdown-changelog"))])
+ (markdown-mode . [(20220508 1219) ((emacs (26 1))) "Major mode for Markdown-formatted text" single ((:commit . "5b6e660c13ca3f4d15dbc1aa3d7ab2f228491ef9") (:authors ("Jason R. Blevins" . "jblevins@xbeta.org")) (:maintainer "Jason R. Blevins" . "jblevins@xbeta.org") (:keywords "markdown" "github flavored markdown" "itex") (:url . "https://jblevins.org/projects/markdown-mode/"))])
+ (markdown-preview-eww . [(20160111 1502) ((emacs (24 4))) "Realtime preview by eww" single ((:commit . "5853f836425c877c8a956501f0adda137ef1d3b7") (:authors ("niku" . "niku@niku.name")) (:maintainer "niku" . "niku@niku.name") (:url . "https://github.com/niku/markdown-preview-eww"))])
+ (markdown-preview-mode . [(20210516 936) ((emacs (24 4)) (websocket (1 6)) (markdown-mode (2 0)) (cl-lib (0 5)) (web-server (0 1 1))) "markdown realtime preview minor mode." tar ((:commit . "dde87b96de9e81dd01d174da67ef68687b3a5eb5") (:authors ("Igor Shymko" . "igor.shimko@gmail.com")) (:maintainer "Igor Shymko" . "igor.shimko@gmail.com") (:keywords "markdown" "gfm" "convenience") (:url . "https://github.com/ancane/markdown-preview-mode"))])
+ (markdown-toc . [(20210905 738) ((s (1 9 0)) (dash (2 11 0)) (markdown-mode (2 1))) "A simple TOC generator for markdown file" tar ((:commit . "3d724e518a897343b5ede0b976d6fb46c46bcc01") (:authors (nil . "Antoine R. Dumont (@ardumont)")) (:maintainer nil . "Antoine R. Dumont (@ardumont)") (:keywords "markdown" "toc" "tools") (:url . "http://github.com/ardumont/markdown-toc"))])
+ (markdownfmt . [(20160609 1241) ((emacs (24))) "Format markdown using markdownfmt" single ((:commit . "187a74eb4fd9e8520ce08da42d1d292b9af7f2b7") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "markdown") (:url . "https://github.com/nlamirault/emacs-markdownfmt"))])
+ (markless . [(20190306 1002) ((emacs (24 4))) "Major mode for Markless documents" single ((:commit . "75fdef45df96978e9326ea4d9bf4e534a250c4c0") (:authors ("Nicolas Hafner" . "shinmera@tymoon.eu")) (:maintainer "Nicolas Hafner" . "shinmera@tymoon.eu") (:keywords "languages" "wp") (:url . "http://github.com/shirakumo/markless.el/"))])
+ (markup . [(20170420 1129) ((cl-lib (0 5))) "Simple markup generation helpers." single ((:commit . "876da2d3f23473475bb0fd0a1480ae11d2671291") (:authors ("Arthur Leonard Andersen" . "leoc.git@gmail.com")) (:maintainer "Arthur Leonard Andersen" . "leoc.git@gmail.com") (:keywords "convenience" "markup" "html") (:url . "http://github.com/leoc/markup.el"))])
+ (markup-faces . [(20141110 817) nil "collection of faces for markup language modes" single ((:commit . "98a807ed82473eb41c6a201ed7ef816d6bcd67b0") (:authors ("Florian Kaufmann" . "sensorflo@gmail.com")) (:maintainer "Florian Kaufmann" . "sensorflo@gmail.com") (:keywords "wp" "faces") (:url . "https://github.com/sensorflo/markup-faces"))])
+ (marmalade-client . [(20141231 2007) ((web (0 5 2)) (kv (0 0 19)) (gh (0 8 0))) "client for marmalade API from emacs" tar ((:commit . "f315dea57e4fbebd9ee0668c0bafd4c45c7b754a") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "lisp") (:url . "https://github.com/nicferrier/emacs-marmalade-upload"))])
+ (marquee-header . [(20200720 1034) ((emacs (25 1))) "Code interface for displaying marquee in header" single ((:commit . "c36dcf8c282f547da5b3666f025a3000b5dbd1d9") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/marquee-header"))])
+ (marshal . [(20201223 1853) ((emacs (25 1)) (ht (2 0))) "eieio extension for automatic (un)marshalling" single ((:commit . "490496d974d03906f784707ecc2e0ac36ed84b96") (:authors ("Yann Hodique" . "yann.hodique@gmail.com")) (:maintainer "Yann Hodique" . "yann.hodique@gmail.com") (:keywords "extensions") (:url . "https://github.com/sigma/marshal.el"))])
+ (maruo-macro-mode . [(20160616 1349) ((emacs (24 3))) "Major mode for editing Hidemaru/Maruo macro script" single ((:commit . "8fc9a38ad051eafa8eb94038711acc52c5d1d8d5") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "programming" "editor" "macro"))])
+ (masm-mode . [(20200308 1450) ((emacs (25 1))) "MASM x86 and x64 assembly major mode" single ((:commit . "626b9255c2bb967a53d1d50be0b98a1bcae3250c") (:authors ("YiGeeker" . "zyfchinese@yeah.net")) (:maintainer "YiGeeker" . "zyfchinese@yeah.net") (:keywords "languages") (:url . "https://github.com/YiGeeker/masm-mode"))])
+ (mastodon . [(20220405 1531) ((emacs (27 1)) (request (0 3 2)) (seq (1 0))) "Client for Mastodon" tar ((:commit . "e5ff349d23c71a521db41dcdb1ac9765bac5388f") (:authors ("Johnson Denen" . "johnson.denen@gmail.com")) (:maintainer "Marty Hiatt" . "martianhiatus@riseup.net") (:url . "https://codeberg.org/martianh/mastodon.el"))])
+ (material-theme . [(20210904 1226) ((emacs (24 1))) "A Theme based on the colors of the Google Material Design" tar ((:commit . "6823009bc92f82aa3a90e27e1009f7da8e87b648") (:authors ("Christoph Paulik" . "cpaulik@gmail.com")) (:maintainer "Christoph Paulik" . "cpaulik@gmail.com") (:keywords "themes") (:url . "http://github.com/cpaulik/emacs-material-theme"))])
+ (math-preview . [(20211221 1611) ((emacs (26 1)) (dash (2 18 0)) (s (1 12 0))) "Preview TeX math equations inline" single ((:commit . "75dd44ad8dcfa12fe03f8e65babe0ea04e1a7d1a") (:authors ("Matsievskiy S.V.")) (:maintainer "Matsievskiy S.V.") (:keywords "convenience") (:url . "https://gitlab.com/matsievskiysv/math-preview"))])
+ (math-symbol-lists . [(20200131 2338) nil "Lists of Unicode math symbols and latex commands" tar ((:commit . "590d9f09f8ad9aab747b97f077396a2035dcf50f") (:authors ("Vitalie Spinu" . "spinuvit@gmail.com")) (:maintainer "Vitalie Spinu" . "spinuvit@gmail.com") (:keywords "unicode" "symbols" "mathematics") (:url . "https://github.com/vspinu/math-symbol-lists"))])
+ (math-symbols . [(20201005 2313) nil "Math Symbol Input methods and conversion tools" tar ((:commit . "091b81cb40ceaff97614999ffe85b572ace182f0") (:authors ("KAWABATA, Taichi <kawabata.taichi_at_gmail.com>")) (:maintainer "KAWABATA, Taichi <kawabata.taichi_at_gmail.com>") (:keywords "i18n" "languages" "tex") (:url . "https://github.com/kawabata/math-symbols"))])
+ (matlab-mode . [(20220412 913) nil "Major mode for MATLAB(R) dot-m files" tar ((:commit . "5069e3ca0034e0da64eb9b3cd426f52992938d06"))])
+ (maude-mode . [(20220419 1454) ((emacs (25))) "Emacs mode for the programming language Maude" single ((:commit . "68de3c11ae16c409afa74516aaf465996d1a9e59") (:authors ("Ellef Gjelstad <ellefg+maude*ifi.uio.no>")) (:maintainer "Rudi Schlatte" . "rudi@constantly.at") (:keywords "languages" "maude") (:url . "https://github.com/rudi/abs-mode"))])
+ (maven-test-mode . [(20141220 557) ((s (1 9)) (emacs (24))) "Utilities for navigating test files and running maven test tasks." single ((:commit . "a19151861df2ad8ae4880a2e7c86ddf848cb569a") (:authors ("Renan Ranelli")) (:maintainer "Renan Ranelli") (:keywords "java" "maven" "test") (:url . "http://github.com/rranelli/maven-test-mode"))])
+ (maxframe . [(20170120 1705) nil "maximize the emacs frame based on display size" single ((:commit . "f7048ce95443f2c06cb6b140814451e3a037103a") (:authors ("Ryan McGeary")) (:maintainer "Ryan McGeary") (:keywords "display" "frame" "window" "maximize"))])
+ (maxima . [(20210526 1525) ((emacs (25 1)) (s (1 11 0)) (test-simple (1 3 0))) "Major mode for Maxima" tar ((:commit . "ce5fd160c193e387d9e2bacdba4065c4b4262cb1") (:authors ("William F. Schelter") ("Jay Belanger") ("Fermin Munoz")) (:maintainer "Fermin Munoz" . "fmfs@posteo.net") (:keywords "maxima" "tools" "math") (:url . "https://gitlab.com/sasanidas/maxima"))])
+ (mb-url . [(20211205 1100) ((emacs (25))) "Multiple Backends for Emacs URL package" tar ((:commit . "09f32af1a58d0b042b699c76d2b30e9226508f5e") (:authors ("ZHANG Weiyi" . "dochang@gmail.com")) (:maintainer "ZHANG Weiyi" . "dochang@gmail.com") (:keywords "comm" "data" "processes" "hypermedia") (:url . "https://github.com/dochang/mb-url"))])
+ (mbe . [(20151126 1134) ((emacs (24)) (cl-lib (0 5))) "Macros by Example" single ((:commit . "bb10aa8f26bb7e9b1d5746934c94edb00402940c") (:authors ("Ian Price" . "ianprice90@googlemail.com")) (:maintainer "Ian Price" . "ianprice90@googlemail.com") (:keywords "tools" "macros") (:url . "https://github.com/ijp/mbe.el"))])
+ (mbo70s-theme . [(20170808 1315) ((emacs (24 0))) "70s style palette, with similarities to mbo theme" single ((:commit . "bed3db8965708ed4e9482b224a9b084765c052f2") (:authors ("Jason Milkins")) (:maintainer "Jason Milkins") (:url . "https://github.com/emacsfodder/tmtheme-to-deftheme"))])
+ (mbsync . [(20200128 1053) nil "run mbsync to fetch mails" single ((:commit . "d3c81da81ce5b154c0d048047a47277338721a70") (:authors ("Dimitri Fontaine" . "dim@tapoueh.org")) (:maintainer "Dimitri Fontaine" . "dim@tapoueh.org") (:url . "https://github.com/dimitri/mbsync-el"))])
+ (mc-calc . [(20200420 1836) ((emacs (24 4)) (multiple-cursors (1 2 1))) "Combine multiple-cursors and calc" single ((:commit . "74a046a5728919a4d1135ca62738326b0dde278c") (:authors (nil . "Frank Roland hatheroldev@fgmail.com>")) (:maintainer nil . "Frank Roland hatheroldev@fgmail.com>") (:keywords "convenience") (:url . "https://github.com/hatheroldev/mc-calc"))])
+ (mc-extras . [(20181109 1735) ((multiple-cursors (1 2 1))) "Extra functions for multiple-cursors mode." tar ((:commit . "053abc52181b8718559d7361a587bbb795faf164") (:authors ("Akinori MUSHA" . "knu@iDaemons.org")) (:maintainer "Akinori MUSHA" . "knu@iDaemons.org") (:keywords "editing" "cursors") (:url . "https://github.com/knu/mc-extras.el"))])
+ (md-readme . [(20191112 1943) nil "Markdown-formatted READMEs for your ELisp" tar ((:commit . "ca99f44de11fab18d1f50d4b1722f2ceee3c814d") (:authors ("Thomas Kappler" . "tkappler@gmail.com")) (:maintainer "Thomas Kappler" . "tkappler@gmail.com") (:keywords "lisp" "help" "readme" "markdown" "header" "documentation" "github") (:url . "http://github.com/thomas11/md-readme/tree/master"))])
+ (md4rd . [(20220105 1558) ((emacs (25 1)) (hierarchy (0 7 0)) (request (0 3 0)) (cl-lib (0 6 1)) (dash (2 12 0)) (s (1 12 0)) (tree-mode (1 0 0))) "Mode for reddit (browse it)." single ((:commit . "6aa4fd6339d7fac78ce57e5d8821cd7009d21172") (:authors ("Matthew Carter" . "m@ahungry.com")) (:maintainer "Matthew Carter" . "m@ahungry.com") (:keywords "ahungry" "reddit" "browse" "news") (:url . "https://github.com/ahungry/md4rd"))])
+ (mediawiki . [(20200718 1529) nil "mediawiki frontend" single ((:commit . "932497604fd417964e4f04614e28d96f4eee028e") (:authors ("Mark A. Hershberger" . "mah@everybody.org")) (:maintainer "Mark A. Hershberger" . "mah@everybody.org") (:keywords "mediawiki" "wikipedia" "network" "wiki") (:url . "https://github.com/hexmode/mediawiki-el"))])
+ (meghanada . [(20220101 501) ((emacs (24 3)) (yasnippet (0 6 1)) (company (0 9 0)) (flycheck (0 23))) "A better java development mode" tar ((:commit . "59c46cabb7eee715fe810ce59424934a1286df84") (:authors ("Yutaka Matsubara" . "yutaka.matsubara@gmail.com")) (:maintainer "Yutaka Matsubara" . "yutaka.matsubara@gmail.com") (:keywords "languages" "java") (:url . "https://github.com/mopemope/meghanada-emacs"))])
+ (mellow-theme . [(20170808 1317) ((emacs (24 0))) "an Emacs 24 theme based on Mellow (tmTheme)" single ((:commit . "2bdf18f05f5212b6f269d9a94afe2cf201766891") (:authors ("Jason Milkins")) (:maintainer "Jason Milkins") (:url . "https://github.com/emacsfodder/tmtheme-to-deftheme"))])
+ (melpa-upstream-visit . [(20130720 1033) ((s (1 6 0))) "A set of kludges to visit a melpa-hosted package's homepage" single ((:commit . "7310c74fdead3c0f86ad6eff76cf989e63f70f66") (:authors ("Alessandro Piras" . "laynor@gmail.com")) (:maintainer "Alessandro Piras" . "laynor@gmail.com") (:keywords "convenience"))])
+ (memento-mori . [(20190628 2147) ((emacs (24)) (cl-lib (0 5))) "Reminder of mortality" single ((:commit . "b99c5ff526079fc5a1e1be097534855da176bc2b") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "help") (:url . "https://github.com/lassik/emacs-memento-mori"))])
+ (memoize . [(20200103 2036) nil "Memoization functions" single ((:commit . "51b075935ca7070f62fae1d69fe0ff7d8fa56fdd") (:authors ("Christopher Wellons" . "mosquitopsu@gmail.com")) (:maintainer "Christopher Wellons" . "mosquitopsu@gmail.com") (:url . "https://github.com/skeeto/emacs-memoize"))])
+ (memolist . [(20150804 1721) ((markdown-mode (22 0)) (ag (0 45))) "memolist.el is Emacs port of memolist.vim." single ((:commit . "c437a32d3955f859d9bbcbadf0911bbe27d877ff") (:authors ("mikanfactory <k952i4j14x17_at_gmail.com>")) (:maintainer "mikanfactory") (:keywords "markdown" "memo") (:url . "http://github.com/mikanfactory/emacs-memolist"))])
+ (mentor . [(20220113 2136) ((emacs (25 1)) (xml-rpc (1 6 15)) (seq (1 11)) (async (1 9 3))) "Frontend for the rTorrent bittorrent client" tar ((:commit . "afab3a14a4bfb5117f8e25417fdf151611b3df0b") (:authors ("Stefan Kangas" . "stefankangas@gmail.com")) (:maintainer "Stefan Kangas" . "stefankangas@gmail.com") (:keywords "comm" "processes" "bittorrent") (:url . "https://github.com/skangas/mentor"))])
+ (meow . [(20220501 1918) ((emacs (27 1))) "Yet Another modal editing" tar ((:commit . "72d6ff36b62a57aa9c9dbfbd44cdb3002a0e940a") (:authors ("Shi Tianshu")) (:maintainer "Shi Tianshu") (:keywords "convenience" "modal-editing") (:url . "https://www.github.com/DogLooksGood/meow"))])
+ (merlin . [(20220502 811) ((emacs (25 1))) "Mode for Merlin, an assistant for OCaml" tar ((:commit . "49324b4fdc14987164ed7a3a8c3681df5b4866ee") (:authors ("Frédéric Bour <frederic.bour(_)lakaban.net>")) (:maintainer "Frédéric Bour <frederic.bour(_)lakaban.net>") (:keywords "ocaml" "languages") (:url . "https://github.com/ocaml/merlin"))])
+ (merlin-ac . [(20210615 1208) ((emacs (25 1)) (merlin (3)) (auto-complete (1 5))) "Merlin and auto-complete integration." single ((:commit . "49324b4fdc14987164ed7a3a8c3681df5b4866ee") (:authors ("Simon Castellan <simon.castellan(_)iuwt.fr>") ("Frédéric Bour <frederic.bour(_)lakaban.net>") ("Thomas Refis <thomas.refis(_)gmail.com>")) (:maintainer "Simon Castellan <simon.castellan(_)iuwt.fr>") (:keywords "ocaml" "languages") (:url . "http://github.com/ocaml/merlin"))])
+ (merlin-company . [(20210615 1208) ((emacs (25 1)) (merlin (3)) (company (0 9))) "Merlin and company mode integration." single ((:commit . "49324b4fdc14987164ed7a3a8c3681df5b4866ee") (:authors ("Simon Castellan <simon.castellan(_)iuwt.fr>") ("Frédéric Bour <frederic.bour(_)lakaban.net>") ("Thomas Refis <thomas.refis(_)gmail.com>")) (:maintainer "Simon Castellan <simon.castellan(_)iuwt.fr>") (:keywords "ocaml" "languages") (:url . "http://github.com/ocaml/merlin"))])
+ (merlin-eldoc . [(20190830 517) ((emacs (24 4)) (merlin (3 0))) "eldoc for OCaml and Reason" single ((:commit . "db7fab1eddfe34781b7e79694f8923b285698032") (:authors ("Louis Roché" . "louis@louisroche.net")) (:maintainer "Louis Roché" . "louis@louisroche.net") (:keywords "merlin" "ocaml" "languages" "eldoc") (:url . "https://github.com/khady/merlin-eldoc"))])
+ (merlin-iedit . [(20220330 1736) ((emacs (25 1)) (merlin (3)) (iedit (0 9))) "Merlin and iedit integration." single ((:commit . "49324b4fdc14987164ed7a3a8c3681df5b4866ee") (:authors ("Simon Castellan <simon.castellan(_)iuwt.fr>") ("Frédéric Bour <frederic.bour(_)lakaban.net>") ("Thomas Refis <thomas.refis(_)gmail.com>")) (:maintainer "Simon Castellan <simon.castellan(_)iuwt.fr>") (:keywords "ocaml" "languages") (:url . "http://github.com/ocaml/merlin"))])
+ (mermaid-mode . [(20220426 1631) ((f (0 20 0)) (emacs (25 3))) "major mode for working with mermaid graphs" single ((:commit . "1a6526bc68561b7da6a612152b842a41ffb0aa09") (:authors ("Adrien Brochard")) (:maintainer "Adrien Brochard") (:keywords "mermaid" "graphs" "tools" "processes") (:url . "https://github.com/abrochard/mermaid-mode"))])
+ (meson-mode . [(20210820 905) ((emacs (26 1))) "Major mode for the Meson build system files" tar ((:commit . "1a2e2abb098c9288c2cdb3affbad76edd98abf59") (:authors ("Michal Sojka" . "sojkam1@fel.cvut.cz")) (:maintainer "Michal Sojka" . "sojkam1@fel.cvut.cz") (:keywords "languages" "tools") (:url . "https://github.com/wentasah/meson-mode"))])
+ (message-attachment-reminder . [(20200428 124) ((emacs (24 1))) "Remind if missing attachment" single ((:commit . "ce506b27b15cc39a47c58ff795026eaea8632e2f") (:authors ("Alex Murray" . "murray.alex@gmail.com")) (:maintainer "Alex Murray" . "murray.alex@gmail.com") (:url . "https://github.com/alexmurray/message-attachment-reminder"))])
+ (message-view-patch . [(20210904 2227) ((emacs (24 4)) (magit (3 0 0))) "Colorize patch-like emails in mu4e" single ((:commit . "40bc2e554fc1d0b6f0c403192c0a3ceaa019a78d") (:authors ("Sean Farley")) (:maintainer "Sean Farley") (:keywords "extensions" "mu4e" "gnus") (:url . "https://github.com/seanfarley/message-view-patch"))])
+ (messages-are-flowing . [(20191029 954) nil "visible indication when composing \"flowed\" emails" single ((:commit . "d582a564a63b7b90764ffc5c618bc5300225d0ab") (:authors ("Magnus Henoch" . "magnus.henoch@gmail.com")) (:maintainer "Magnus Henoch" . "magnus.henoch@gmail.com") (:keywords "mail"))])
+ (meta-presenter . [(20210714 1658) nil "A simple multi-file presentation tool for Emacs" single ((:commit . "4ab48dacea245b223a0ffd2723ece746bd61c0af") (:authors ("Mohammed Ismail Ansari" . "team.terminal@gmail.com")) (:maintainer "Mohammed Ismail Ansari" . "team.terminal@gmail.com") (:keywords "productivity" "presentation") (:url . "http://ismail.teamfluxion.com"))])
+ (metal-archives . [(20210223 1638) ((emacs (26 3)) (alert (1 2)) (ht (2 3)) (request (0 2 2))) "List future releases using Metal-Archives API" single ((:commit . "a218d63b990365edeef6a2394f72d1f2286aeeae") (:authors ("Sébastien Le Maguer" . "lemagues@tcd.ie")) (:maintainer "Sébastien Le Maguer" . "lemagues@tcd.ie") (:keywords "lisp" "calendar") (:url . "https://github.com/seblemaguer/metal-archives.el"))])
+ (metal-archives-shopping-list . [(20201229 949) ((emacs (26 3)) (org-ml (5 5 2)) (alert (1 2)) (ht (2 3)) (metal-archives (0 1))) "Add shopping list generation support to metal-archives" single ((:commit . "a218d63b990365edeef6a2394f72d1f2286aeeae") (:authors ("Sébastien Le Maguer" . "lemagues@tcd.ie")) (:maintainer "Sébastien Le Maguer" . "lemagues@tcd.ie") (:keywords "org" "calendar") (:url . "https://github.com/seblemaguer/metal-archives.el"))])
+ (metalheart-theme . [(20160710 641) ((emacs (24))) "Low-contrast theme with a dark blue-green background." single ((:commit . "ec98ea2c11dc1213dae8cbe1fe0cee73ca138bb2") (:authors ("Martin Haesler")) (:maintainer "Martin Haesler"))])
+ (metamorph . [(20220328 129) ((emacs (26 1))) "Transform your buffers with lisp" single ((:commit . "3633e32a9601c491df32d6c2212dbe63dc6484f4") (:authors ("Adam Niederer" . "adam.niederer@gmail.com")) (:maintainer "Adam Niederer" . "adam.niederer@gmail.com") (:keywords "metaprogramming" "wp") (:url . "http://github.com/AdamNiederer/metamorph"))])
+ (metascript-mode . [(20150709 57) ((emacs (24 3))) "Major mode for the Metascript programming language" single ((:commit . "edb361c7b0e5de231e5334a17b90652fb1df78f9") (:keywords "languages" "metascript" "mjs") (:url . "http://github.com/metascript/metascript-mode"))])
+ (metaweblog . [(20210422 326) ((emacs (26 3))) "An XML-RPC MetaWeblog and WordPress API client." single ((:commit . "68695ed0e012379556d57f9564ac5ad8cd68fbb8") (:authors ("Puneeth Chaganti" . "punchagan+org2blog@gmail.com")) (:maintainer "Grant Rettke" . "grant@wisdomandwonder.com") (:keywords "comm") (:url . "https://github.com/org2blog/org2blog"))])
+ (metrics-tracker . [(20211026 1347) ((emacs (24 4)) (seq (2 3))) "Generate reports of personal metrics from diary entries" single ((:commit . "115f6de4a01b9e10936b7e6d1fdadd3770bae391") (:authors ("Ian Martins" . "ianxm@jhu.edu")) (:maintainer "Ian Martins" . "ianxm@jhu.edu") (:keywords "calendar") (:url . "https://github.com/ianxm/emacs-tracker"))])
+ (metronome . [(20220210 147) ((emacs (25 1))) "A simple metronome" tar ((:commit . "1e1bd5234f3ecfb608041d423be7412c461ad3c2") (:authors ("Jonathan Gregory <jgrg at autistici dot org>")) (:maintainer "Jonathan Gregory <jgrg at autistici dot org>") (:url . "https://gitlab.com/jagrg/metronome"))])
+ (mew . [(20210625 240) nil "Messaging in the Emacs World" tar ((:commit . "fc4bca6d95d8b8d5e169ecf1433d968c2eec299d") (:authors ("Kazu Yamamoto" . "Kazu@Mew.org")) (:maintainer "Kazu Yamamoto" . "Kazu@Mew.org"))])
+ (mexican-holidays . [(20210604 1421) nil "Mexico holidays for Emacs calendar." single ((:commit . "8e28907ea69f2c0ed9aad9f3b99664ca147379d0") (:authors ("Saúl Gutiérrez" . "me@sggc.me")) (:maintainer "Saúl Gutiérrez" . "me@sggc.me") (:keywords "calendar") (:url . "https://github.com/sggutier/mexican-holidays"))])
+ (meyvn . [(20211025 106) ((emacs (25 1)) (cider (0 23)) (projectile (2 1)) (s (1 12)) (dash (2 17)) (parseedn (0 1 0)) (geiser (0 12))) "Meyvn client" single ((:commit . "80ece19a6ce6fd3dac374911edb9734286978450") (:authors ("Daniel Szmulewicz" . "daniel.szmulewicz@gmail.com")) (:maintainer "Daniel Szmulewicz" . "daniel.szmulewicz@gmail.com") (:url . "https://github.com/danielsz/meyvn-el"))])
+ (mgmtconfig-mode . [(20210131 2152) ((emacs (24 3))) "mgmt configuration management language" single ((:commit . "b26f842de19a31c36fb5149f292b9117dbf4bed7") (:authors ("Peter Oliver" . "mgmtconfig@mavit.org.uk")) (:maintainer "Mgmt contributors <https://github.com/purpleidea/mgmt>") (:keywords "languages") (:url . "https://github.com/purpleidea/mgmt/misc/emacs"))])
+ (mhc . [(20201227 406) ((calfw (20150703))) "Message Harmonized Calendaring system." tar ((:commit . "67f9596dcd43b7ece3ab6e7a6ce8dc18a4851fe8") (:authors ("Yoshinari Nomura" . "nom@quickhack.net")) (:maintainer "Yoshinari Nomura" . "nom@quickhack.net") (:keywords "calendar") (:url . "http://www.quickhack.net/mhc"))])
+ (mic-paren . [(20170731 1907) nil "advanced highlighting of matching parentheses" single ((:commit . "d0410c7d805c9aaf51a1bcefaaef092bed5824c4") (:authors ("Mikael Sjödin" . "mic@docs.uu.se") ("Klaus Berndl " . "berndl@sdm.de") ("Jonathan Kotta" . "jpkotta@gmail.com")) (:maintainer "ttn") (:keywords "languages" "faces" "parenthesis" "matching"))])
+ (micgoline . [(20160415 326) ((emacs (24 3)) (powerline (2 3))) "powerline mode, color schemes from microsoft and google's logo." single ((:commit . "837504263bb1711203b0f7efecd6b7b5f272fae0") (:authors ("yzprofile" . "yzprofiles@gmail.com")) (:maintainer "yzprofile" . "yzprofiles@gmail.com") (:keywords "mode-line" "powerline" "theme") (:url . "https://github.com/yzprofile/micgoline"))])
+ (midje-mode . [(20170809 403) ((cider (0 1 4)) (clojure-mode (1 0))) "Minor mode for running Midje tests in emacs" tar ((:commit . "10ad5b6084cd03d5cd268b486a7c3c246d85535f"))])
+ (migemo . [(20200913 12) ((cl-lib (0 5))) "Japanese incremental search through dynamic pattern expansion" single ((:commit . "f756cba3d5268968da361463c2e29b3a659a3de7") (:authors ("Satoru Takabayashi" . "satoru-t@is.aist-nara.ac.jp")) (:maintainer "Satoru Takabayashi" . "satoru-t@is.aist-nara.ac.jp") (:url . "https://github.com/emacs-jp/migemo"))])
+ (milkode . [(20140927 529) nil "Command line search and direct jump with Milkode" single ((:commit . "ba97e2aeefa1d9d0b3835bf08edd0de248b0c513") (:authors ("ongaeshi")) (:maintainer "ongaeshi") (:keywords "milkode" "search" "grep" "jump" "keyword"))])
+ (mimetypes . [(20201115 1605) ((emacs (25 1))) "Guess a file's mimetype by extension" single ((:commit . "1663054ce266ed25e47ec707c19f619d33225903") (:authors ("Craig Niles <niles.c at gmail.com>")) (:maintainer "Craig Niles <niles.c at gmail.com>") (:url . "https://github.com/cniles/emacs-mimetypes"))])
+ (minesweeper . [(20200416 2342) nil "play minesweeper in Emacs" single ((:commit . "d4248e3c9b3e9e7277cb9e6d081330611898f334") (:authors ("Zachary Kanfer" . "zkanfer@gmail.com")) (:maintainer "Zachary Kanfer" . "zkanfer@gmail.com") (:keywords "game" "fun" "minesweeper" "inane" "diversion") (:url . "https://hg.sr.ht/~zck/minesweeper"))])
+ (mingus . [(20190106 1443) ((libmpdee (2 1))) "MPD Interface" tar ((:commit . "4223be618f57f10f18114a74393a71955b568884") (:authors ("Niels Giesen <pft on #emacs>")) (:maintainer "Niels Giesen <pft on #emacs>") (:keywords "multimedia" "elisp" "music" "mpd") (:url . "https://github.com/pft/mingus"))])
+ (mini-frame . [(20210710 1941) ((emacs (26 1))) "Show minibuffer in child frame on read-from-minibuffer" single ((:commit . "57a049b9e1ea4a9b65e82fc10c8c7e70a042f636") (:authors ("Andrii Kolomoiets" . "andreyk.mad@gmail.com")) (:maintainer "Andrii Kolomoiets" . "andreyk.mad@gmail.com") (:keywords "frames") (:url . "https://github.com/muffinmad/emacs-mini-frame"))])
+ (mini-header-line . [(20170621 1221) ((emacs (24 4))) "a minimal header-line" single ((:commit . "73b6724e0a26c4528d93768191c8aa59e6bce2e5") (:authors ("Johannes Goslar")) (:maintainer "Johannes Goslar") (:keywords "header-line" "mode-line") (:url . "https://github.com/ksjogo/mini-header-line"))])
+ (mini-modeline . [(20211130 604) ((emacs (25 1)) (dash (2 12 0))) "Display modeline in minibuffer" single ((:commit . "434b98b22c69c8b3b08e9c267c935591c49a8301") (:authors ("Kien Nguyen" . "kien.n.quang@gmail.com")) (:maintainer "Kien Nguyen" . "kien.n.quang@gmail.com") (:keywords "convenience" "tools") (:url . "https://github.com/kiennq/emacs-mini-modeline"))])
+ (minibuf-isearch . [(20151226 1943) nil "incremental search on minibuffer history" single ((:commit . "2846c6ac369ee623dad4cd3c8a7a6d9078965516") (:authors ("Keiichiro Nagano" . "knagano@sodan.org") ("Hideyuki SHIRAI " . "shirai@meadowy.org")) (:maintainer "Keiichiro Nagano" . "knagano@sodan.org") (:keywords "minibuffer" "history" "incremental search"))])
+ (minibuffer-complete-cycle . [(20130813 1645) nil "Cycle through the *Completions* buffer" single ((:commit . "3df80135887d0169e02294a948711f6dfeca4a6f") (:authors ("Akinori MUSHA" . "knu@iDaemons.org") ("Kevin Rodgers" . "ihs_4664@yahoo.com")) (:maintainer "Akinori MUSHA" . "knu@iDaemons.org") (:keywords "completion") (:url . "https://github.com/knu/minibuffer-complete-cycle"))])
+ (minibuffer-cua . [(20130906 1134) nil "Make CUA mode's S-up/S-down work in minibuffer" single ((:commit . "adc4979a64f8b36e05960e9afa0746dfa9e2e4c7") (:authors ("Akinori MUSHA" . "knu@iDaemons.org")) (:maintainer "Akinori MUSHA" . "knu@iDaemons.org") (:keywords "completion" "editing") (:url . "https://github.com/knu/minibuffer-cua.el"))])
+ (minibuffer-modifier-keys . [(20210823 713) ((emacs (24 3))) "Use spacebar as a modifier key in the minibuffer" single ((:commit . "38da548225f51ca7bca22d3e9b0de78e3b9e6cdd") (:authors ("SpringHan")) (:maintainer "SpringHan") (:keywords "tools") (:url . "https://github.com/SpringHan/minibuffer-modifier-keys.git"))])
+ (miniedit . [(20100419 1745) nil "Enhanced editing for minibuffer fields." single ((:commit . "e12bf659c3eb92dd8a4cb77642dc0865c54667a3"))])
+ (minimal-session-saver . [(20140508 2041) nil "Very lean session saver" single ((:commit . "cf654ac549850746dc21091746e4bcc1aef7668e") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "tools" "frames" "project") (:url . "http://github.com/rolandwalker/minimal-session-saver"))])
+ (minimal-theme . [(20190113 2132) nil "A light/dark minimalistic Emacs 24 theme." tar ((:commit . "221b43aad320d226863892dfe4d85465e8eb81ce") (:authors ("Anler Hp <anler86 [at] gmail.com>")) (:maintainer "Anler Hp <anler86 [at] gmail.com>") (:keywords "color" "theme" "minimal") (:url . "http://github.com/ikame/minimal-theme"))])
+ (minions . [(20220422 1615) ((emacs (25 2)) (compat (28 1 1 0))) "A minor-mode menu for the mode line" single ((:commit . "19dae1c41542777cb5b0311b6e2e77f43e2fd407") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "convenience") (:url . "https://github.com/tarsius/minions"))])
+ (minitest . [(20200506 308) ((dash (1 0 0))) "An Emacs mode for ruby minitest files" tar ((:commit . "ddd152c990a528ad09a696bfad23afa4330ea4d7") (:authors ("Arthur Neves")) (:maintainer "Arthur Neves") (:url . "https://github.com/arthurnn/minitest-emacs"))])
+ (minizinc-mode . [(20180201 1450) ((emacs (24 1))) "Major mode for MiniZinc code" single ((:commit . "2512521ba7f8e263a06db88df663fc6b3cca7e16") (:keywords "languages" "minizinc") (:url . "http://github.com/m00nlight/minizinc-mode"))])
+ (minor-mode-hack . [(20170926 34) nil "Change priority of minor-mode keymaps" single ((:commit . "9688994e23ccb2de568225ef125b41c46e5667c3") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "lisp") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/minor-mode-hack.el"))])
+ (minsk-theme . [(20200306 1220) ((emacs (24))) "Minsk, a theme in deep muted greens" single ((:commit . "e4dcdec3a4472a507d6b249ae2194dacaa885ecb") (:authors ("Jean Lo" . "jlpaca@users.noreply.github.com")) (:maintainer "Jean Lo" . "jlpaca@users.noreply.github.com") (:keywords "theme" "faces") (:url . "https://github.com/jlpaca/minsk-theme"))])
+ (mip-mode . [(20151127 617) nil "virtual projects for emacs." single ((:commit . "7c88c383b4c7ed0a4c1dc397735f365c1fcb461c") (:authors ("Eeli Reilin" . "gaudecker@fea.st")) (:maintainer "Eeli Reilin" . "gaudecker@fea.st") (:keywords "workspaces" "workspace" "project" "projects" "mip-mode"))])
+ (mips-mode . [(20211114 1645) nil "Major-mode for MIPS assembly" single ((:commit . "5676174bea9a5780ddd33d2d8111b8678dfa4e99") (:authors ("Henrik Lissner <http://github/hlissner>")) (:maintainer "Henrik Lissner" . "contact@henrik.io") (:keywords "languages" "mips" "assembly") (:url . "https://github.com/hlissner/emacs-mips-mode"))])
+ (mix . [(20210605 1015) ((emacs (25 1))) "Mix Major Mode. Build Elixir using Mix" single ((:commit . "bfe61ed4e7dd8cfc0bb2603fbac3eb44b32438bf") (:authors ("Ayrat Badykov" . "ayratin555@gmail.com")) (:maintainer "Ayrat Badykov" . "ayratin555@gmail.com") (:keywords "tools") (:url . "https://github.com/ayrat555/mix.el"))])
+ (mixed-pitch . [(20210304 1900) ((emacs (24 3))) "Use a variable pitch, keeping fixed pitch where it's sensible" single ((:commit . "519e05f74825abf04b7d2e0e38ec040d013a125a") (:authors ("J. Alexander Branham" . "branham@utexas.edu")) (:maintainer "J. Alexander Branham" . "branham@utexas.edu") (:url . "https://gitlab.com/jabranham/mixed-pitch"))])
+ (mkdown . [(20140517 1418) ((markdown-mode (2 0))) "Pretty Markdown previews based on mkdown.com" tar ((:commit . "8e23de82719af6c5b53b52b3308a02b3a1fb872e") (:authors ("Andrew Tulloch")) (:maintainer "Andrew Tulloch") (:keywords "markdown") (:url . "https://github.com/ajtulloch/mkdown.el"))])
+ (mlscroll . [(20210601 2158) ((emacs (27 1))) "A scroll bar for the modeline" single ((:commit . "a9f2abd32f2517392a396d61e558bea3c887b5b6") (:authors ("J.D. Smith")) (:maintainer "J.D. Smith") (:keywords "convenience") (:url . "https://github.com/jdtsmith/mlscroll"))])
+ (mmm-jinja2 . [(20170313 1420) ((mmm-mode (0 5 4))) "MMM submode class for Jinja2 Templates" single ((:commit . "0bdcb5c7547cbf353f960c36ca4090520f6fc3c3") (:authors ("Ben Hayden" . "hayden767@gmail.com")) (:maintainer "Ben Hayden" . "hayden767@gmail.com") (:url . "https://github.com/glynnforrest/mmm-jinja2"))])
+ (mmm-mode . [(20200908 2236) ((cl-lib (0 2))) "Allow Multiple Major Modes in a buffer" tar ((:commit . "0d00cdf4d02cc166304f6967a20fa22e2eaf208b") (:authors ("Michael Abraham Shulman" . "viritrilbia@gmail.com")) (:maintainer "Dmitry Gutov" . "dgutov@yandex.ru") (:keywords "convenience" "faces" "languages" "tools") (:url . "https://github.com/purcell/mmm-mode"))])
+ (mmt . [(20210321 1829) ((emacs (24 5)) (cl-lib (0 3))) "Missing macro tools for Emacs Lisp" single ((:commit . "e5cd2b4d0967758471fd2753f78120bdeb93a781") (:authors ("Mark Karpov" . "markkarpov92@gmail.com")) (:maintainer "Mark Karpov" . "markkarpov92@gmail.com") (:keywords "macro" "emacs-lisp") (:url . "https://github.com/mrkkrp/mmt"))])
+ (mo-git-blame . [(20160129 1759) nil "An interactive, iterative 'git blame' mode for Emacs" single ((:commit . "254a675eb794cdbbdef9fa2b4b7bb510b70089c0") (:authors ("Moritz Bunkus" . "moritz@bunkus.org")) (:maintainer "Moritz Bunkus" . "moritz@bunkus.org") (:keywords "tools"))])
+ (mo-vi-ment-mode . [(20181217 206) nil "Provide vi-like cursor movement that's easy on the fingers" single ((:commit . "e8b525ffc5faa31d36ecc5496b40f0f5c3603c08") (:authors ("Ajay MT" . "ajay.tatachar@gmail.com")) (:maintainer "Ajay MT" . "ajay.tatachar@gmail.com") (:keywords "convenience"))])
+ (mobdebug-mode . [(20140110 346) ((lua-mode (20130419)) (emacs (24))) "Major mode for MobDebug" single ((:commit . "e1d483bc4e341c762bc5c0a8c52306a8d01ea0da") (:authors ("Shihpin Tseng" . "deftsp@gmail.com")) (:maintainer "Shihpin Tseng" . "deftsp@gmail.com") (:url . "https://github.com/deftsp/mobdebug-mode"))])
+ (mocha . [(20200729 1130) ((js2-mode (20150909)) (f (0 18))) "Run Mocha or Jasmine tests" single ((:commit . "6a72fa20e7be6e55c09b1bc9887ee09c5df28e45") (:authors ("Al Scott")) (:maintainer "Al Scott") (:keywords "javascript" "mocha" "jasmine") (:url . "http://github.com/scottaj/mocha.el"))])
+ (mocha-snippets . [(20190417 1931) ((yasnippet (0 8 0))) "Yasnippets for the Mocha JS Testing Framework" tar ((:commit . "44998ea42136a6912ce80061909db1c4c77c8ed8") (:authors ("Charles Lowell" . "cowboyd@frontside.io")) (:maintainer "Charles Lowell" . "cowboyd@frontside.io") (:keywords "test" "javascript"))])
+ (mocker . [(20210115 157) ((emacs (25 1))) "mocking framework for emacs" single ((:commit . "5b01b3cc51388faf1ba823683c3600790099c84c") (:authors ("Yann Hodique" . "yann.hodique@gmail.com")) (:maintainer "Yann Hodique" . "yann.hodique@gmail.com") (:keywords "lisp" "testing"))])
+ (modalka . [(20210318 1748) ((emacs (24 4))) "Modal editing your way" single ((:commit . "3d7f652d06c8e39cfe252ece804868a20730df07") (:authors ("Mark Karpov" . "markkarpov92@gmail.com")) (:maintainer "Mark Karpov" . "markkarpov92@gmail.com") (:keywords "modal" "editing") (:url . "https://github.com/mrkkrp/modalka"))])
+ (mode-icons . [(20200920 2031) ((emacs (24)) (cl-lib (0 5))) "Show icons for modes" tar ((:commit . "a5f978e84e07a1d79c6c8e35043ac93d8e5d50ed") (:authors ("Tom Willemse" . "tom@ryuslash.org")) (:maintainer "Tom Willemse" . "tom@ryuslash.org") (:keywords "multimedia") (:url . "http://ryuslash.org/projects/mode-icons.html"))])
+ (mode-line-bell . [(20181029 516) nil "Flash the mode line instead of ringing the bell" single ((:commit . "26ac7d97abdeb762ceaeab6b892f3ed7e3412494") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "convenience"))])
+ (mode-line-debug . [(20220422 1615) ((emacs (25 1)) (compat (28 1 1 0))) "Show status of debug-on-error in mode-line" single ((:commit . "e8e17b96df1b9fdc448bfc5367a24c2917de88d4") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "convenience" "lisp") (:url . "https://github.com/tarsius/mode-line-debug"))])
+ (mode-line-idle . [(20220507 1118) ((emacs (28 1))) "Evaluate mode line content when idle" single ((:commit . "28658a54fbf20e8224cbc71b074670309ec2e998") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://codeberg.com/ideasman42/emacs-mode-line-idle"))])
+ (modern-cpp-font-lock . [(20210405 1155) nil "Font-locking for \"Modern C++\"" single ((:commit . "43c6b68ff58fccdf9deef11674a172e4eaa8455c") (:authors ("Ludwig PACIFICI" . "ludwig@lud.cc")) (:maintainer "Ludwig PACIFICI" . "ludwig@lud.cc") (:keywords "languages" "c++" "cpp" "font-lock") (:url . "https://github.com/ludwigpacifici/modern-cpp-font-lock"))])
+ (modern-fringes . [(20220401 202) nil "Replaces default fringe bitmaps with better looking ones" single ((:commit . "98473694a33922cfdddb18b4791028e4854b53b5") (:authors ("Quen Jankosky" . "quen.jankosky@gmail.com")) (:maintainer "Quen Jankosky" . "quen.jankosky@gmail.com") (:keywords "themes" "fringes" "convenience") (:url . "http://github.com/specialbomb/emacs-modern-fringes"))])
+ (modern-sh . [(20211101 1001) ((emacs (25 1)) (hydra (0 15 0)) (eval-in-repl (0 9 7))) "Minor mode for editing shell script" single ((:commit . "8ebebe77304aa8170f7af809e7564c79d3bd45da") (:keywords "languages" "programming") (:url . "https://github.com/damon-kwok/modern-sh"))])
+ (modtime-skip-mode . [(20140128 2201) nil "Minor mode for disabling modtime and supersession checks on files." single ((:commit . "c0e49523aa26b2263a8693691ac775988015f592") (:authors ("Jordon Biondo" . "biondoj@mail.gvsu.edu")) (:maintainer "Jordon Biondo" . "biondoj@mail.gvsu.edu") (:url . "http://www.github.com/jordonbiondo/modtime-skip-mode"))])
+ (modular-config . [(20210726 1614) ((emacs (25 1))) "Organize your config into small and loadable modules" single ((:commit . "2bd77193fa3a7ec0541db284b4034821a8f59fea") (:authors ("Sidharth Arya" . "sidhartharya10@gmail.com")) (:maintainer "Sidharth Arya" . "sidhartharya10@gmail.com") (:keywords "startup" "lisp" "tools") (:url . "https://github.com/SidharthArya/modular-config.el"))])
+ (modus-themes . [(20220510 332) ((emacs (27 1))) "Elegant, highly legible and customizable themes" tar ((:commit . "6117ec171bdfb3df5e5d43e8995bdbbd23267ae3") (:authors ("Protesilaos Stavrou" . "info@protesilaos.com")) (:maintainer "Protesilaos Stavrou" . "info@protesilaos.com") (:keywords "faces" "theme" "accessibility") (:url . "https://git.sr.ht/~protesilaos/modus-themes"))])
+ (moe-theme . [(20220111 1220) nil "A colorful eye-candy theme. Moe, moe, kyun!" tar ((:commit . "edf3fe47fb986e283e3b04cba443dcb39fe8720e") (:authors ("kuanyui" . "azazabc123@gmail.com")) (:maintainer "kuanyui" . "azazabc123@gmail.com") (:keywords "themes") (:url . "https://github.com/kuanyui/moe-theme.el"))])
+ (molar-mass . [(20210519 1342) ((emacs (24 3))) "Calculates molar mass of a molecule" single ((:commit . "838db1486a2dc5a3774eb195d62fbcdef71a63f7") (:authors ("Sergi Ruiz Trepat")) (:maintainer "Sergi Ruiz Trepat") (:keywords "convenience" "chemistry") (:url . "https://github.com/sergiruiztrepat/molar-mass.el"))])
+ (molecule . [(20180527 743) ((emacs (25 1))) "Simple wrapper for molecule" single ((:commit . "2ef72b81d9aa24ea782b71a061a3abdad6cae162") (:authors (": drymer <drymer [ AT ] autistici.org>")) (:maintainer ": drymer <drymer [ AT ] autistici.org>") (:keywords ":" "languages" "terminals") (:url . "https://git.daemons.it/drymer/molecule.el"))])
+ (molokai-theme . [(20220106 1520) nil "molokai theme with Emacs theme engine" single ((:commit . "cc53e997e7eff93b58ad16a376a292c1dd66044b") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/alloy-d/color-theme-molokai"))])
+ (mongo . [(20150315 1219) nil "MongoDB driver for Emacs Lisp" tar ((:commit . "595529ddd70ecb9fab8b11daad2c3929941099d6") (:authors ("Tomohiro Matsuyama" . "m2ym.pub@gmail.com")) (:maintainer "Tomohiro Matsuyama" . "m2ym.pub@gmail.com") (:keywords "convenience"))])
+ (monitor . [(20161018 1144) ((dash (2 13 0))) "Utilities for monitoring expressions." tar ((:commit . "63f4643a0ee81616dbb692b8b03bae21df2283e2") (:authors ("Ben Moon" . "software@guiltydolphin.com")) (:maintainer "Ben Moon" . "software@guiltydolphin.com") (:keywords "lisp" "monitor" "utility") (:url . "https://github.com/guiltydolphin/monitor"))])
+ (monkeytype . [(20210110 513) ((emacs (25 1)) (scrollable-quick-peek (0 1 0))) "Mode for speed typing" single ((:commit . "f64b1580f8516ddbf5f71688fb9ace2cd1631b41") (:authors ("Pablo Barrantes" . "xjpablobrx@gmail.com")) (:maintainer "Pablo Barrantes" . "xjpablobrx@gmail.com") (:keywords "games") (:url . "https://github.com/jpablobr/emacs-monkeytype"))])
+ (monky . [(20210417 12) nil "Control Hg from Emacs." tar ((:commit . "72c7cd21b7b995c476e938fd0b92a494aa25c3a7") (:authors ("Anantha kumaran" . "ananthakumaran@gmail.com")) (:maintainer "Anantha kumaran" . "ananthakumaran@gmail.com") (:keywords "tools") (:url . "http://github.com/ananthakumaran/monky"))])
+ (monochrome-theme . [(20140326 1050) nil "A dark Emacs 24 theme for your focused hacking sessions" tar ((:commit . "bfca67fe7365310bc47ae9ca96c417caada54896") (:authors ("Xavier Noria" . "fxn@hashref.com")) (:maintainer "Xavier Noria" . "fxn@hashref.com"))])
+ (monokai-alt-theme . [(20170630 2048) ((emacs (24))) "Theme with a dark background. Based on sublime monokai theme." single ((:commit . "f342b6afc31f929be0626eca2d696ee9fab78011") (:authors ("Dmytro Koval")) (:maintainer "Dmytro Koval") (:url . "https://github.com/dawidof/emacs-monokai-theme"))])
+ (monokai-pro-theme . [(20210206 1820) nil "A simple theme based on the Monokai Pro Sublime color schemes" tar ((:commit . "d0489741a80d818713c290a1a4bdd985877228bb") (:authors ("Kaleb Elwert" . "belak@coded.io")) (:maintainer "Kaleb Elwert" . "belak@coded.io") (:url . "https://github.com/belak/emacs-monokai-pro-theme"))])
+ (monokai-theme . [(20220117 1244) nil "A fruity color theme for Emacs." single ((:commit . "4a09c59f948ba5b602b6f395e667f53224fd75a2") (:authors ("Kelvin Smith" . "oneKelvinSmith@gmail.com")) (:maintainer "Kelvin Smith" . "oneKelvinSmith@gmail.com") (:url . "http://github.com/oneKelvinSmith/monokai-emacs"))])
+ (monotropic-theme . [(20211116 1328) ((emacs (24))) "Monotropic Theme" single ((:commit . "f32a04b5bfee9cbcce4b223f17228d1142a28211") (:authors ("caffo")) (:maintainer "caffo") (:url . "https://github.com/caffo/monotropic-theme"))])
+ (monroe . [(20210824 2348) nil "Yet another client for nREPL" single ((:commit . "d140512781bda5160b4786f591694a569639b9ad") (:authors ("Sanel Zukan" . "sanelz@gmail.com")) (:maintainer "Sanel Zukan" . "sanelz@gmail.com") (:keywords "languages" "clojure" "nrepl" "lisp") (:url . "http://www.github.com/sanel/monroe"))])
+ (mood-line . [(20211003 2113) ((emacs (25 1))) "A minimal mode-line inspired by doom-modeline" single ((:commit . "ef1c752679a8f92faa7b4828adbbb300b6942f22") (:authors ("Jessie Hildebrandt <jessieh.net>")) (:maintainer "Jessie Hildebrandt <jessieh.net>") (:keywords "mode-line" "faces") (:url . "https://gitlab.com/jessieh/mood-line"))])
+ (mood-one-theme . [(20210221 18) ((emacs (24 4))) "A dark color scheme inspired by the Doom One theme." single ((:commit . "42e402a89473458f55a71c5bbe785575e9a927ba") (:authors ("Jessie Hildebrandt <jessieh.net>")) (:maintainer "Jessie Hildebrandt <jessieh.net>") (:keywords "mode-line" "faces") (:url . "https://gitlab.com/jessieh/mood-one-theme"))])
+ (moody . [(20220422 1616) ((emacs (25 3)) (compat (28 1 1 0))) "Tabs and ribbons for the mode line" single ((:commit . "d56a70bc71cdf90cfd5cf4d8517aa1d808659241") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "faces") (:url . "https://github.com/tarsius/moody"))])
+ (moom . [(20210324 825) ((emacs (25 1))) "Commands to control frame position and size" tar ((:commit . "f94cf84138a81212ffe856599834f7824a1b6e95") (:authors ("Takaaki ISHIKAWA <takaxp at ieee dot org>")) (:maintainer "Takaaki ISHIKAWA <takaxp at ieee dot org>") (:keywords "frames" "faces" "convenience") (:url . "https://github.com/takaxp/Moom"))])
+ (moonscript . [(20170831 2226) ((cl-lib (0 5)) (emacs (24))) "Major mode for editing MoonScript code" tar ((:commit . "56f90471e2ced2b0a177aed4d8c2f854797e9cc7") (:authors ("@GriffinSchneider, @k2052, @EmacsFodder")) (:maintainer "@GriffinSchneider, @k2052, @EmacsFodder"))])
+ (moonshot . [(20210627 2244) ((emacs (25 1)) (cl-lib (0 5)) (f (0 18)) (s (1 11 0)) (projectile (2 0 0)) (counsel (0 11 0)) (realgud (1 5 1)) (seq (2 20)) (levenshtein (1 0))) "Run executable file, debug and build commands on project" single ((:commit . "ec37a12825888047a90d9ee8131aa4bea348edf7") (:authors ("Jong-Hyouk Yun" . "ageldama@gmail.com")) (:maintainer "Jong-Hyouk Yun" . "ageldama@gmail.com") (:keywords "convenience" "files" "processes" "tools" "unix") (:url . "https://github.com/ageldama/moonshot"))])
+ (morganey-mode . [(20170118 934) ((emacs (24 4))) "Major mode for editing Morganey files" single ((:commit . "5cf3870432a2aeb69d373abe63b3be1f325f6d21") (:authors ("Alexey Kutepov" . "reximkut@gmail.com")) (:maintainer "Alexey Kutepov" . "reximkut@gmail.com") (:url . "https://github.com/morganey-lang/morganey-mode"))])
+ (morgentau-theme . [(20220319 1049) ((emacs (24))) "Tango-based custom theme" single ((:commit . "a8da5640b4a9b72a3136901d0a1a03071d9fcb00") (:authors ("Benjamin Vincent Schulenburg")) (:maintainer "Benjamin Vincent Schulenburg") (:keywords "theme" "dark" "faces") (:url . "https://github.com/Melchizedek6809/morgentau-theme"))])
+ (morlock . [(20220422 1616) ((emacs (25 1)) (compat (28 1 1 0))) "More font-lock keywords for elisp" single ((:commit . "3b3716e3f865dd71e3acc3f54a0a9f7e2445695a") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "convenience") (:url . "https://github.com/tarsius/morlock"))])
+ (mosey . [(20180614 1649) ((emacs (24 4))) "Mosey around your buffers" single ((:commit . "2e3ac9d334fa2937ed5267193dfd25d8e1f14dc2") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "convenience") (:url . "http://github.com/alphapapa/mosey.el"))])
+ (most-used-words . [(20200808 931) ((emacs (24 3))) "Display most used words in buffer" single ((:commit . "f712879493660c3c3ee3793470b8f8939b79c2b0") (:authors ("Udyant Wig" . "udyant.wig@gmail.com")) (:maintainer "Udyant Wig" . "udyant.wig@gmail.com") (:keywords "convenience" "wp") (:url . "https://github.com/udyantw/most-used-words"))])
+ (mote-mode . [(20160123 29) ((ruby-mode (1 1))) "Mote minor mode" single ((:commit . "666c6641addbd3b337a7aa01fd2742ded2f41b83") (:authors ("Leandro López (inkel)" . "inkel.ar@gmail.com")) (:maintainer "Leandro López (inkel)" . "inkel.ar@gmail.com") (:url . "http://inkel.github.com/mote-mode/"))])
+ (motion-mode . [(20140920 156) ((flymake-easy (0 7)) (flymake-cursor (1 0 2))) "major mode for RubyMotion enviroment" tar ((:commit . "4c94180e3ecea611a61240a0c0cd48f1032c4a55") (:authors ("Satoshi Namai")) (:maintainer "Satoshi Namai") (:url . "https://github.com/ainame/motion-mode"))])
+ (move-dup . [(20210127 1938) ((emacs (25 1))) "Eclipse-like moving and duplicating lines or rectangles" single ((:commit . "5906503e0b9b832b1d5062c9cd27cf72a2ce4817") (:authors ("Jimmy Yuen Ho Wong" . "wyuenho@gmail.com")) (:maintainer "Jimmy Yuen Ho Wong" . "wyuenho@gmail.com") (:keywords "convenience" "text" "edit") (:url . "https://github.com/wyuenho/move-dup"))])
+ (move-text . [(20170909 330) nil "Move current line or region with M-up or M-down." single ((:commit . "bfc255110ad05732a43cf25d6a0e3b4a6710b58c") (:authors ("Jason Milkins" . "jasonm23@gmail.com")) (:maintainer "Jason Milkins" . "jasonm23@gmail.com") (:keywords "edit") (:url . "https://github.com/emacsfodder/move-text"))])
+ (mowedline . [(20161122 235) nil "elisp utilities for using mowedline" single ((:commit . "6121b7d4aacd18f7b24da226e61dbae054e50a7c") (:authors ("John Foerch" . "jjfoerch@earthlink.net")) (:maintainer "John Foerch" . "jjfoerch@earthlink.net"))])
+ (mozc . [(20210306 1053) nil "minor mode to input Japanese with Mozc" single ((:commit . "247db142f7251062978ade3fd27c815259eaa05b") (:keywords "mule" "multilingual" "input method"))])
+ (mozc-cand-posframe . [(20200208 750) ((emacs (26 1)) (posframe (0 5 0)) (mozc (20180101 800)) (s (1 12))) "Posframe frontend for mozc.el" single ((:commit . "1d07d5055381008ccbb29b97315d140e09a7ee95") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:keywords "i18n" "tooltip") (:url . "https://github.com/akirak/mozc-posframe"))])
+ (mozc-im . [(20160412 22) ((mozc (0))) "Mozc with input-method-function interface." single ((:commit . "df614a1076c28a11551fb3e822868bae47e855a5") (:authors ("Daisuke Kobayashi" . "d5884jp@gmail.com")) (:maintainer "Daisuke Kobayashi" . "d5884jp@gmail.com") (:keywords "i18n" "extentions"))])
+ (mozc-popup . [(20150224 34) ((popup (0 5 2)) (mozc (0))) "Mozc with popup" single ((:commit . "f0684b875a7427ec08f8df13939a486e5d5cf420") (:authors ("Daisuke Kobayashi" . "d5884jp@gmail.com")) (:maintainer "Daisuke Kobayashi" . "d5884jp@gmail.com") (:keywords "i18n" "extentions"))])
+ (mozc-temp . [(20160228 840) ((emacs (24)) (dash (2 10 0)) (mozc (0))) "Use mozc temporarily" single ((:commit . "90a6eb1db8fa1283b944432cfb83739286b37f92") (:authors ("Hiroki YAMAKAWA" . "s06139@gmail.com")) (:maintainer "Hiroki YAMAKAWA" . "s06139@gmail.com") (:url . "https://github.com/HKey/mozc-temp"))])
+ (mpages . [(20150710 1404) nil "An Emacs buffer for quickly writing your Morning Pages" single ((:commit . "39a72a0931ab1cdbfdf0ab9f412dc12d43a3829f") (:authors ("Sean Levin")) (:maintainer "Sean Levin") (:url . "https://github.com/slevin/mpages"))])
+ (mpdel . [(20210107 1303) ((emacs (25 1)) (libmpdel (1 2 0)) (navigel (0 7 0))) "Play and control your MPD music" tar ((:commit . "6682446c6263a79e79c55cf32c0efb066245feec") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:keywords "multimedia") (:url . "https://gitea.petton.fr/mpdel/mpdel"))])
+ (mpdmacs . [(20210904 35) ((emacs (25 1)) (elmpd (0 1))) "A lightweight MPD client" single ((:commit . "334b066dc5bb82d9ccb6cc30d63afed0f7610fe8") (:authors ("Michael Herstine" . "sp1ff@pobox.com")) (:maintainer "Michael Herstine" . "sp1ff@pobox.com") (:keywords "comm") (:url . "https://github.com/sp1ff/mpdmacs"))])
+ (mpmc-queue . [(20180303 2029) ((emacs (26 0)) (queue (0 2 0))) "a multiple-producer-multiple-consumer queue" single ((:commit . "df07d6bef7468edb1d73ef73b8331b94d0e5d0ca") (:authors ("Sho Mizoe" . "sho.mizoe@gmail.com")) (:maintainer "Sho Mizoe" . "sho.mizoe@gmail.com") (:keywords "lisp" "async") (:url . "https://github.com/smizoe/mpmc-queue"))])
+ (mpv . [(20211228 2043) ((cl-lib (0 5)) (emacs (25 1)) (json (1 3)) (org (8 0))) "control mpv for easy note-taking" single ((:commit . "4fd8baa508dbc1a6b42b4e40292c0dbb0f19c9b9") (:authors ("Johann Klähn" . "johann@jklaehn.de")) (:maintainer "Johann Klähn" . "johann@jklaehn.de") (:keywords "tools" "multimedia") (:url . "https://github.com/kljohann/mpv.el"))])
+ (mqr . [(20180527 1204) ((emacs (24 4))) "Multi-dimensional query and replace" single ((:commit . "4ade19d4620b8b61340290bf63fa56d5e493859f") (:authors ("Tino Calancha" . "tino.calancha@gmail.com")) (:maintainer "Tino Calancha" . "tino.calancha@gmail.com") (:keywords "convenience" "extensions" "lisp") (:url . "https://github.com/calancha/multi-replace"))])
+ (mqtt-mode . [(20180611 1735) ((emacs (25)) (dash (2 12 0))) "client for interaction with MQTT servers" single ((:commit . "613e70e9b9940e635e779994b5c83f86eb62c8e6") (:authors ("Andreas Müller" . "code@0x7.ch")) (:maintainer "Andreas Müller" . "code@0x7.ch") (:keywords "tools") (:url . "https://github.com/andrmuel/mqtt-mode"))])
+ (msgpack . [(20200323 515) ((emacs (25 1))) "Read and write MessagePack object" single ((:commit . "90e3086f259549b1667a3c5b9aa2d70aaeaa4d3d") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:keywords "lisp") (:url . "https://github.com/xuchunyang/msgpack.el"))])
+ (msvc . [(20210503 1856) ((emacs (24)) (cl-lib (0 5)) (cedet (1 0)) (ac-clang (2 0 0))) "Microsoft Visual C/C++ mode" tar ((:commit . "122dc9cb7f145f12dac7b117a48fceb38b279432") (:authors ("yaruopooner [https://github.com/yaruopooner]")) (:maintainer "yaruopooner [https://github.com/yaruopooner]") (:keywords "languages" "completion" "syntax check" "mode" "intellisense") (:url . "https://github.com/yaruopooner/msvc"))])
+ (mtg-deck-mode . [(20180613 2010) ((emacs (25 1))) "Major mode to edit MTG decks" tar ((:commit . "8265b8ed17fcd4406760c19aa6ee9c76068b1ab0") (:authors ("Mattias Bengtsson" . "mattias.jc.bengtsson@gmail.com")) (:maintainer "Mattias Bengtsson" . "mattias.jc.bengtsson@gmail.com") (:keywords "data" "mtg" "magic") (:url . "https://github.com/mattiasb/mtg-deck-mode"))])
+ (mu-cite . [(20190803 439) ((flim (1 14 9))) "A library to provide MIME features." tar ((:commit . "b2c83bbce4646d100b942f0f0de0877a8d47298c") (:authors ("MORIOKA Tomohiko" . "tomo@m17n.org") ("Shuhei KOBAYASHI" . "shuhei@aqua.ocn.ne.jp")) (:maintainer "Katsumi Yamaoka" . "yamaoka@jpl.org") (:keywords "mail" "news" "citation"))])
+ (mu2tex . [(20200512 704) nil "Convert plain text molecule names and units to TeX" single ((:commit . "4b84cdac955cb36a8c44a2be48f3310252e3d3ad") (:authors ("Carsten Dominik" . "carsten.dominik@gmail.com")) (:maintainer "Carsten Dominik" . "carsten.dominik@gmail.com") (:keywords "tex") (:url . "https://github.com/cdominik/mu2tex"))])
+ (mu4e-alert . [(20220416 1840) ((alert (1 2)) (s (1 10 0)) (ht (2 0)) (emacs (24 4))) "Desktop notification for mu4e" single ((:commit . "b34d0ea7b75709cc25d842a783cebea855dc9f7d") (:authors ("Iqbal Ansari" . "iqbalansari02@yahoo.com")) (:maintainer "Mikhail Rudenko" . "mike.rudenko@gmail.com") (:keywords "mail" "convenience") (:url . "https://github.com/iqbalansari/mu4e-alert"))])
+ (mu4e-column-faces . [(20210927 1759) ((emacs (25 3))) "Faces for individual mu4e columns" single ((:commit . "b76a5989cafe88a263688488854187a015beef41") (:authors ("Alexander Miller" . "alexanderm@web.de")) (:maintainer "Alexander Miller" . "alexanderm@web.de") (:url . "https://github.com/Alexander-Miller/mu4e-column-faces"))])
+ (mu4e-conversation . [(20190609 812) ((emacs (25 1))) "Show a complete thread in a single buffer" single ((:commit . "ccf85002b18fee54051dbfaf8d3931ca2a07db24") (:authors ("Pierre Neidhardt" . "mail@ambrevar.xyz")) (:maintainer "Pierre Neidhardt" . "mail@ambrevar.xyz") (:keywords "mail" "convenience" "mu4e") (:url . "https://gitlab.com/Ambrevar/mu4e-conversation"))])
+ (mu4e-jump-to-list . [(20211030 2307) ((emacs (24 4)) (cl-lib (0 5))) "mu4e jump-to-list extension" single ((:commit . "4d362a668be4ae624ee96bf7806b25505b4bdf5c") (:authors ("Yuri D'Elia" . "wavexx@thregr.org")) (:maintainer "Yuri D'Elia" . "wavexx@thregr.org") (:keywords "mu4e" "mail" "convenience") (:url . "https://gitlab.com/wavexx/mu4e-jump-to-list.el"))])
+ (mu4e-maildirs-extension . [(20201028 921) ((dash (0 0 0))) "Show mu4e maildirs summary in mu4e-main-view" single ((:commit . "1167bc6e08996f866e73e9a02f563fd21ac317fd") (:authors ("Andreu Gil Pàmies" . "agpchil@gmail.com")) (:maintainer "Andreu Gil Pàmies" . "agpchil@gmail.com") (:url . "http://github.com/agpchil/mu4e-maildirs-extension"))])
+ (mu4e-marker-icons . [(20220225 1137) ((emacs (26 1)) (all-the-icons (4 0 0))) "Display icons for mu4e markers" single ((:commit . "66674ee00dbf953e7d8c1696fb12e9b5b4b272bd") (:keywords "mail") (:url . "https://repo.or.cz/mu4e-marker-icons.git"))])
+ (mu4e-overview . [(20200824 1549) ((emacs (26))) "Show overview of maildir" single ((:commit . "7daaa35a6d78feb83167e780a9c23da719c9051b") (:authors ("Michał Krzywkowski" . "k.michal@zoho.com")) (:maintainer "Michał Krzywkowski" . "k.michal@zoho.com") (:keywords "mail" "tools") (:url . "https://github.com/mkcms/mu4e-overview"))])
+ (mu4e-query-fragments . [(20211030 2307) ((emacs (24 4))) "mu4e query fragments extension" single ((:commit . "8d93ede3772353e2dbc307de03e06e37ea6a0b6c") (:authors ("Yuri D'Elia" . "wavexx@thregr.org")) (:maintainer "Yuri D'Elia" . "wavexx@thregr.org") (:keywords "mu4e" "mail" "convenience") (:url . "https://gitlab.com/wavexx/mu4e-query-fragments.el"))])
+ (mu4e-views . [(20220214 358) ((emacs (26 1)) (xwidgets-reuse (0 2)) (ht (2 2)) (esxml (20210323 1102))) "View emails in mu4e using xwidget-webkit" single ((:commit . "fa47f35e56edcc84f00d622e415ae970cc5df0dd") (:authors ("Boris Glavic" . "lordpretzel@gmail.com")) (:maintainer "Boris Glavic" . "lordpretzel@gmail.com") (:keywords "mail") (:url . "https://github.com/lordpretzel/mu4e-views"))])
+ (muban . [(20180415 1219) ((emacs (25))) "Lightweight template expansion tool" single ((:commit . "fd052645bcaa3cca8cede1c587a0b05ab5bd66b2") (:authors ("Jiahao Li" . "jiahaowork@gmail.com")) (:maintainer "Jiahao Li" . "jiahaowork@gmail.com") (:keywords "abbrev" "tools") (:url . "https://github.com/jiahaowork/muban.el"))])
+ (mugur . [(20210719 722) ((emacs (26 1)) (s (1 12 0)) (anaphora (1 0 4)) (dash (2 18 1)) (cl-lib (1 0))) "Configurator for QMK compatible keyboards" single ((:commit . "267e0594790a5f34e474a5b480015f0f216a6865") (:authors ("Mihai Olteanu" . "mihai_olteanu@fastmail.fm")) (:maintainer "Mihai Olteanu" . "mihai_olteanu@fastmail.fm") (:keywords "multimedia") (:url . "https://github.com/mihaiolteanu/mugur"))])
+ (multi . [(20131013 1544) ((emacs (24))) "Clojure-style multi-methods for emacs lisp" single ((:commit . "0987ab71692717ed457cb3984de184db9185806d") (:authors ("Christina Whyte" . "kurisu.whyte@gmail.com")) (:maintainer "Christina Whyte" . "kurisu.whyte@gmail.com") (:keywords "multimethod" "generic" "predicate" "dispatch") (:url . "http://github.com/kurisuwhyte/emacs-multi"))])
+ (multi-compile . [(20211113 2119) ((emacs (24 4)) (dash (2 12 1))) "Multi target interface to compile." single ((:commit . "5e1e63b6ae4bd94aab5902b14b2bf4238e502cfb") (:authors ("Kvashnin Vladimir" . "reangd@gmail.com")) (:maintainer "Kvashnin Vladimir" . "reangd@gmail.com") (:keywords "tools" "compile" "build") (:url . "https://github.com/ReanGD/emacs-multi-compile"))])
+ (multi-line . [(20220112 1744) ((emacs (24 3)) (s (1 9 0)) (cl-lib (0 5)) (dash (2 12 0)) (shut-up (0 3 2))) "multi-line statements" tar ((:commit . "625c608443f98bb34b4d5600d52c198509fb64d0") (:authors ("Ivan Malison" . "IvanMalison@gmail.com")) (:maintainer "Ivan Malison" . "IvanMalison@gmail.com") (:keywords "multi" "line" "length" "whitespace" "programming" "tools" "convenience" "files") (:url . "https://github.com/IvanMalison/multi-line"))])
+ (multi-project . [(20220415 2334) ((emacs (25))) "Find files, compile, and search for multiple projects." single ((:commit . "d51551296425b1febd102a38a46f2d3dc4548559") (:authors ("Shawn Ellis" . "shawn.ellis17@gmail.com")) (:maintainer "Shawn Ellis" . "shawn.ellis17@gmail.com") (:keywords "convenience" "project" "management") (:url . "https://hg.osdn.net/view/multi-project/multi-project"))])
+ (multi-run . [(20210108 336) ((emacs (24)) (window-layout (1 4))) "Efficiently manage multiple remote nodes" tar ((:commit . "13d4d923535b5e8482b13ff76185203075fb26a3") (:authors ("Sagar Jha")) (:maintainer "Sagar Jha") (:keywords "multiple shells" "multi-run" "remote nodes") (:url . "https://www.github.com/sagarjha/multi-run"))])
+ (multi-term . [(20200514 428) nil "Managing multiple terminal buffers in Emacs." single ((:commit . "017c77c550115936860e2ea71b88e585371475d5") (:authors ("Andy Stewart" . "lazycat.manatee@gmail.com")) (:maintainer "Andy Stewart" . "lazycat.manatee@gmail.com") (:keywords "term" "terminal" "multiple buffer") (:url . "http://www.emacswiki.org/emacs/download/multi-term.el"))])
+ (multi-vterm . [(20210727 1050) ((emacs (26 3)) (vterm (0 0)) (project (0 3 0))) "Like multi-term.el but for vterm" single ((:commit . "a3df7218c1ecadef779e2c47815201052283f9ea") (:keywords "terminals" "processes") (:url . "https://github.com/suonlight/multi-libvterm"))])
+ (multi-web-mode . [(20130824 354) nil "multiple major mode support for web editing" tar ((:commit . "ad1c8d1c870334052d244c7ae3636cb7b9357b7c") (:authors ("Fabián E. Gallina" . "fabian@anue.biz")) (:maintainer "Fabián E. Gallina" . "fabian@anue.biz") (:keywords "convenience" "languages" "wp") (:url . "https://github.com/fgallina/multi-web-mode"))])
+ (multicolumn . [(20150202 2251) nil "Creating and managing multiple side-by-side windows." single ((:commit . "c7a3afecd470859b2e60aa7c554d6e4d436df7fa") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:url . "https://github.com/Lindydancer/multicolumn"))])
+ (multifiles . [(20130615 2133) nil "View and edit parts of multiple files in one buffer" single ((:commit . "dddfe64b8e1c1cd1f9ccc1f03405477fc0d53897") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "multiple" "files"))])
+ (multiple-cursors . [(20220328 1724) ((cl-lib (0 5))) "Multiple cursors for Emacs." tar ((:commit . "aae47aebc0ae829211fa1e923232715d8e327b36") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "editing" "cursors") (:url . "https://github.com/magnars/multiple-cursors.el"))])
+ (multistate . [(20210124 2014) ((emacs (25 1)) (ht (2 3))) "Multistate mode" single ((:commit . "a7ab9dc7aac0b6d6d2f872de4e0d1b8550834a9b") (:authors ("Matsievskiy S.V.")) (:maintainer "Matsievskiy S.V.") (:keywords "convenience") (:url . "https://gitlab.com/matsievskiysv/multistate"))])
+ (multitran . [(20211027 1833) ((emacs (24)) (cl-lib (0 5))) "Interface to multitran" single ((:commit . "910f4c929e1d9c1844ddc467f72eef2e03aa3f97") (:authors ("Zajcev Evgeny" . "zevlg@yandex.ru")) (:maintainer "Zajcev Evgeny" . "zevlg@yandex.ru") (:keywords "dictionary" "hypermedia"))])
+ (mustache . [(20210224 710) ((ht (0 9)) (s (1 3 0)) (dash (1 2 0))) "Mustache templating library in emacs lisp" single ((:commit . "6fcb31f5075edc5fc70c63426b2aef91352ca80f") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:keywords "convenience" "mustache" "template") (:url . "https://github.com/Wilfred/mustache.el"))])
+ (mustache-mode . [(20141024 1432) nil "A major mode for editing Mustache files." single ((:commit . "bf9897eb287ca47ced65d7d4e07ea61ea0aec39f") (:authors ("Tony Gentilcore") ("Chris Wanstrath") ("Daniel Hackney")) (:maintainer "Tony Gentilcore"))])
+ (mustang-theme . [(20170719 946) nil "port of vim's mustang theme" single ((:commit . "dda6d04803f1c9b196b620ef564e7768fee15de2") (:authors ("martin haesler")) (:maintainer "martin haesler") (:url . "http://github.com/mswift42/mustang-theme"))])
+ (mustard-theme . [(20170808 1319) ((emacs (24 0))) "an Emacs 24 theme based on Mustard (tmTheme)" single ((:commit . "3b15d992c79590d7ea2503004e2a863b57e274b5") (:authors ("Jason Milkins")) (:maintainer "Jason Milkins") (:url . "https://github.com/emacsfodder/tmtheme-to-deftheme"))])
+ (mutant . [(20160124 1353) ((emacs (24 4)) (dash (2 1 0))) "An interface for the Mutant testing tool" single ((:commit . "de9cdefe48c880128a8f62c6699d7416e9c8ced1") (:authors ("Pedro Lambert")) (:maintainer "Pedro Lambert") (:keywords "mutant" "testing") (:url . "http://github.com/p-lambert/mutant.el"))])
+ (mutt-mode . [(20191102 2330) ((emacs (24))) "major mode for editing mutt configuration" single ((:commit . "1d495de49e6f536459b00d5396a2f5ce5ad4757b") (:authors ("Felix Weilbach" . "felix.weilbach@t-online.de")) (:maintainer "Felix Weilbach" . "felix.weilbach@t-online.de") (:keywords "languages") (:url . "https://gitlab.com/flexw/mutt-mode"))])
+ (mvn . [(20181002 1617) nil "helpers for compiling with maven" single ((:commit . "223723d9ceeb2878b884e83abb8ca74ad2e42081") (:authors ("Andrew Gwozdziewycz" . "git@apgwoz.com")) (:maintainer "Andrew Gwozdziewycz" . "git@apgwoz.com") (:keywords "compilation" "maven" "java") (:url . "https://github.com/apgwoz/mvn-el"))])
+ (mw-thesaurus . [(20210224 449) ((emacs (25)) (request (0 3 0)) (dash (2 16 0))) "Merriam-Webster Thesaurus" single ((:commit . "96f02694bc28f31c2a280a05d47e6ff589f525f3") (:authors ("Ag Ibragimov")) (:maintainer "Ag Ibragimov") (:keywords "wp" "matching") (:url . "https://github.com/agzam/mw-thesaurus.el"))])
+ (mwim . [(20181110 1900) nil "Switch between the beginning/end of line or code" single ((:commit . "b4f3edb4c0fb8f8b71cecbf8095c2c25a8ffbf85") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "convenience") (:url . "https://github.com/alezost/mwim.el"))])
+ (mxf-view . [(20180501 740) ((emacs (25))) "Simple MXF viewer" single ((:commit . "6ca3cc93d995fac5fc4d72275e1e984e9857ffcb") (:authors ("Tomotaka SUWA" . "tomotaka.suwa@gmail.com")) (:maintainer "Tomotaka SUWA" . "tomotaka.suwa@gmail.com") (:keywords "data" "multimedia") (:url . "https://github.com/t-suwa/mxf-view"))])
+ (myanmar-input-methods . [(20160106 1537) nil "Emacs Input Method for Myanmar" single ((:commit . "9d4e0d6358c61bde7a2274e430ef71683faea32e") (:authors ("Ye Lin Kyaw" . "yelinkyaw@gmail.com")) (:maintainer "Ye Lin Kyaw" . "yelinkyaw@gmail.com") (:keywords "myanmar" "unicode" "keyboard") (:url . "http://github.com/yelinkyaw/emacs-myanmar-input-methods"))])
+ (mybigword . [(20201030 1253) ((emacs (25 1))) "Vocabulary builder using Zipf to extract English big words" tar ((:commit . "4c1386252444df2ade734e02078069a06f3f0f97") (:authors ("Chen Bin <chenbin DOT sh AT gmail.com>")) (:maintainer "Chen Bin <chenbin DOT sh AT gmail.com>") (:keywords "convenience") (:url . "https://github.com/redguardtoo/mybigword"))])
+ (mykie . [(20150808 2205) ((emacs (24 3)) (cl-lib (0 5))) "Command multiplexer: Register multiple functions to a keybind" tar ((:commit . "7676f0e883af1d1054e404e97691f3c13aba196f") (:authors ("Yuta Yamada <cokesboy\"at\"gmail.com>")) (:maintainer "Yuta Yamada <cokesboy\"at\"gmail.com>") (:keywords "emacs" "configuration" "keybind") (:url . "https://github.com/yuutayamada/mykie-el"))])
+ (mynt-mode . [(20150512 2049) ((virtualenvwrapper (20131514))) "Minor mode to work with the mynt static site generator" single ((:commit . "23d4489167bfa899634548cb41ed32fdeb3600c9") (:authors ("Christian Brassat")) (:maintainer "Christian Brassat") (:keywords "convenience") (:url . "https://github.com/crshd/mynt-mode"))])
+ (myrddin-mode . [(20191225 2120) ((emacs (24 3))) "Major mode for editing Myrddin source files" single ((:commit . "51c0a2cb9dfc9526cd47e71313f5a745c99cadcc") (:authors ("Jakob L. Kreuze" . "zerodaysfordays@sdf.lonestar.org")) (:maintainer "Jakob L. Kreuze" . "zerodaysfordays@sdf.lonestar.org") (:keywords "languages") (:url . "https://git.sr.ht/~jakob/myrddin-mode"))])
+ (mysql-to-org . [(20210622 447) ((emacs (24 3)) (s (1 11 0))) "Minor mode to output the results of mysql queries to org tables" single ((:commit . "c5eefc71200f2e1d0d67a13ed897b3cdfa835117") (:authors ("Tijs Mallaerts" . "tijs.mallaerts@gmail.com")) (:maintainer "Tijs Mallaerts" . "tijs.mallaerts@gmail.com"))])
+ (myterminal-controls . [(20210904 516) ((emacs (24)) (cl-lib (0 5))) "Quick toggle controls at a key-stroke" single ((:commit . "c635868e13ee898ec77925d98b36421640e22aa4") (:authors ("Mohammed Ismail Ansari" . "team.terminal@gmail.com")) (:maintainer "Mohammed Ismail Ansari" . "team.terminal@gmail.com") (:keywords "convenience" "shortcuts") (:url . "http://ismail.teamfluxion.com"))])
+ (n4js . [(20150714 231) ((emacs (24)) (cypher-mode (0))) "Neo4j Shell" single ((:commit . "3991ed8975151d5e8d568e952362df810f7ffab7") (:authors ("TruongTx" . "me@truongtx.me")) (:maintainer "TruongTx" . "me@truongtx.me") (:keywords "neo4j" "shell" "comint") (:url . "https://github.com/tmtxt/n4js.el"))])
+ (name-this-color . [(20151014 2030) ((emacs (24)) (cl-lib (0 5)) (dash (2 11 0))) "Match RGB codes to names easily and precisely" single ((:commit . "e37cd1291d5d68d4c8d6386eab9cb9d94fd3bcfa") (:keywords "lisp" "color" "hex" "rgb" "shade" "name") (:url . "https://github.com/knl/name-this-color.el"))])
+ (named-timer . [(20181120 2224) ((emacs (24 4))) "Simplified timer management for Emacs Lisp" single ((:commit . "d8baeada19b56176c66aed5fa220751e3de11cb8") (:authors ("Ryan C. Thompson")) (:maintainer "Ryan C. Thompson") (:keywords "tools") (:url . "https://github.com/DarwinAwardWinner/emacs-named-timer"))])
+ (nameframe . [(20171107 56) nil "Manage frames by name." single ((:commit . "aafb8c5c5fbe0510e2f5d5b6b6b5dd0b73abe5d8") (:authors ("John Del Rosario" . "john2x@gmail.com")) (:maintainer "John Del Rosario" . "john2x@gmail.com") (:url . "https://github.com/john2x/nameframe"))])
+ (nameframe-perspective . [(20170406 119) ((nameframe (0 4 1 -2)) (perspective (1 12))) "Nameframe integration with perspective.el" single ((:commit . "aafb8c5c5fbe0510e2f5d5b6b6b5dd0b73abe5d8") (:authors ("John Del Rosario" . "john2x@gmail.com")) (:maintainer "John Del Rosario" . "john2x@gmail.com") (:url . "https://github.com/john2x/nameframe"))])
+ (nameframe-projectile . [(20160928 403) ((nameframe (0 4 1 -2)) (projectile (0 13 0))) "Nameframe integration with Projectile" single ((:commit . "aafb8c5c5fbe0510e2f5d5b6b6b5dd0b73abe5d8") (:authors ("John Del Rosario" . "john2x@gmail.com")) (:maintainer "John Del Rosario" . "john2x@gmail.com") (:url . "https://github.com/john2x/nameframe"))])
+ (nameless . [(20190429 1202) ((emacs (24 4))) "Hide package namespace in your emacs-lisp code" single ((:commit . "a3a1ce3ec0c5724bcbfe553d831bd4f6b3fe863a") (:authors ("Artur Malabarba" . "emacs@endlessparentheses.com")) (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com") (:keywords "convenience" "lisp") (:url . "https://github.com/Malabarba/nameless"))])
+ (names . [(20180321 1155) ((emacs (24 1)) (cl-lib (0 5))) "Namespaces for emacs-lisp. Avoid name clobbering without hiding symbols." tar ((:commit . "d8baba5360e5253938a25d3e005455b6d2d86971") (:authors ("Artur Malabarba" . "emacs@endlessparentheses.com")) (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com") (:keywords "extensions" "lisp") (:url . "https://github.com/Malabarba/names"))])
+ (namespaces . [(20130326 2250) nil "An implementation of namespaces for Elisp, with an emphasis on immutabilty." single ((:commit . "3d02525d9b9a5ae6e7be3adefd880121436e6270") (:authors ("Chris Barrett")) (:maintainer "Chris Barrett") (:url . "https://github.com/chrisbarrett/elisp-namespaces"))])
+ (nand2tetris . [(20171201 1813) ((emacs (24))) "Major mode for HDL files in the nand2tetris course" tar ((:commit . "33acee34d24b1c6a87db833b7d23449cf858f64f") (:authors ("Diego Berrocal" . "cestdiego@gmail.com")) (:maintainer "Diego Berrocal" . "cestdiego@gmail.com") (:keywords "nand2tetris" "hdl") (:url . "http://www.github.com/CestDiego/nand2tetris.el/"))])
+ (nand2tetris-assembler . [(20171201 1813) ((nand2tetris (1 1 0))) "Assembler For the Nand2tetris Course" single ((:commit . "33acee34d24b1c6a87db833b7d23449cf858f64f") (:authors ("Diego Berrocal" . "cestdiego@gmail.com")) (:maintainer "Diego Berrocal" . "cestdiego@gmail.com") (:keywords "nand2tetris-assembler" "hdl") (:url . "http://www.github.com/CestDiego/nand2tetris-assembler.el/"))])
+ (nanowrimo . [(20151105 228) nil "Track progress for nanowrimo" single ((:commit . "b1d41458926ccb39cefbb1bb74aefe4f02fd349f") (:authors ("Ivan Andrus <darthandrus at gmail.com>")) (:maintainer "Ivan Andrus <darthandrus at gmail.com>") (:url . "https://bitbucket.org/gvol/nanowrimo-mode"))])
+ (naquadah-theme . [(20190225 1427) nil "A theme based on Tango color set" single ((:commit . "430c3b7bd51922cb616b3f60301f4e2604816ed8"))])
+ (narrow-reindent . [(20150722 1906) ((emacs (24 4))) "Defines a minor mode to left-align narrowed regions." single ((:commit . "87466aac4dbeb79597124dd077bf5c704872fd3d") (:authors ("J David Smith" . "emallson@atlanis.net")) (:maintainer "J David Smith" . "emallson@atlanis.net") (:url . "https://github.com/emallson/narrow-reindent.el"))])
+ (narrowed-page-navigation . [(20150109 519) ((emacs (24)) (cl-lib (0 5))) "A minor mode for showing one page at a time" single ((:commit . "b215adbac4873f56fbab65772062f0f5be8058a1") (:authors ("David Raymond Christiansen" . "david@davidchristiansen.dk")) (:maintainer "David Raymond Christiansen" . "david@davidchristiansen.dk") (:keywords "outlines"))])
+ (narumi . [(20220228 243) ((emacs (26 1))) "A dashboard that displays a ramdom sampled image" single ((:commit . "5bfb114adc0e6a2d5aebcd6335d1e6850e3f9722") (:url . "https://github.com/nryotaro/narumi"))])
+ (nash-mode . [(20160830 1212) nil "Nash major mode" single ((:commit . "2cd96535eb7d669a94306183e95ee37333872c1a") (:authors ("Tiago Natel de Moura")) (:maintainer "Tiago Natel de Moura") (:keywords "nash" "languages") (:url . "https://github.com/tiago4orion/nash-mode.el"))])
+ (nasm-mode . [(20190410 342) ((emacs (24 3))) "NASM x86 assembly major mode" single ((:commit . "65ca6546fc395711fac5b3b4299e76c2303d43a8") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/nasm-mode"))])
+ (native-complete . [(20220124 1806) ((emacs (26 1))) "Shell completion using native complete mechanisms" single ((:commit . "01d8a2048e13f29dd3aa06281ac8cb466caddb64") (:authors ("Troy Hinckley" . "troy.hinckley@gmail.com")) (:maintainer "Troy Hinckley" . "troy.hinckley@gmail.com") (:url . "https://github.com/CeleritasCelery/emacs-native-shell-complete"))])
+ (nav . [(20120507 707) nil "Emacs mode for filesystem navigation" tar ((:commit . "c5eb234c063f435dbdcd1f8bdc46cfc68c973ebe") (:authors ("Issac Trotts" . "issactrotts@google.com")) (:maintainer "Issac Trotts" . "issactrotts@google.com"))])
+ (nav-flash . [(20210906 1942) nil "Briefly highlight the current line" single ((:commit . "2e31f32085757e1dfdd8ec78e9940fd1c88750de") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "extensions" "navigation" "interface") (:url . "http://github.com/rolandwalker/nav-flash"))])
+ (navi-mode . [(20201220 1727) ((outshine (2 0)) (outorg (2 0))) "major-mode for easy buffer-navigation" single ((:commit . "cf97e1e338815ad3a4d0bbbf4ff6dd1a4e322ca8") (:maintainer "Adam Porter" . "adam@alphapapa.net") (:url . "https://github.com/alphapapa/navi"))])
+ (navi2ch . [(20200130 36) nil "Navigator for 2ch for Emacsen" tar ((:commit . "7811dba052f679bd920a1f648d621a6fecace10f") (:authors ("Taiki SUGAWARA" . "taiki@users.sourceforge.net")) (:maintainer "Taiki SUGAWARA" . "taiki@users.sourceforge.net") (:keywords "network" "2ch"))])
+ (navigel . [(20200202 1214) ((emacs (25 1)) (tablist (1 0))) "Facilitate the creation of tabulated-list based UIs" single ((:commit . "0a2d624d6b49f8363badc5ba8699b7028ef85632") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:url . "https://gitlab.petton.fr/DamienCassou/navigel"))])
+ (navorski . [(20141203 1824) ((s (1 9 0)) (dash (1 5 0)) (multi-term (0 8 14))) "Helping you live in the terminal, like Viktor did." single ((:commit . "698c1c62da70164aebe9a7a5d034778fbc30ea5b") (:authors ("Roman Gonzalez <romanandreg@gmail.com>, Tavis Rudd" . "tavis@birdseye-sw.com")) (:maintainer "Roman Gonzalez" . "romanandreg@gmail.com") (:keywords "terminal"))])
+ (naysayer-theme . [(20200405 123) ((emacs (24))) "The naysayer color theme" single ((:commit . "9d0bef898f31368cd30e063d53d443dee29683b0") (:authors ("Nick Aversano" . "nickav@users.noreply.github.com")) (:maintainer "Nick Aversano" . "nickav@users.noreply.github.com") (:url . "https://github.com/nickav/naysayer-theme.el"))])
+ (ncl-mode . [(20180129 703) ((emacs (24))) "Major Mode for editing NCL scripts and other goodies" tar ((:commit . "602292712a9e6b7e7c25155978999e77d06b7338") (:authors ("Yagnesh Raghava Yakkala" . "hi@yagnesh.org")) (:maintainer "Yagnesh Raghava Yakkala" . "hi@yagnesh.org") (:keywords "ncl" "major mode" "ncl-mode" "atmospheric science.") (:url . "https://github.com/yyr/ncl-mode"))])
+ (nclip . [(20130617 2015) nil "Network (HTTP) Clipboard" tar ((:commit . "af88e38b1f04be02bf2e57affc662dbd0f828e67") (:authors ("Marian Schubert" . "marian.schubert@gmail.com")) (:maintainer "Marian Schubert" . "marian.schubert@gmail.com") (:keywords "nclip" "clipboard" "network") (:url . "http://www.github.com/maio/nclip.el"))])
+ (neato-graph-bar . [(20181130 1649) ((emacs (24 3))) "Neat-o graph bars CPU/memory etc." single ((:commit . "a7ae35afd67911e8924f36e646bce0d3e3c1bbe6") (:authors ("Robert Cochran" . "robert-git@cochranmail.com")) (:maintainer "Robert Cochran" . "robert-git@cochranmail.com") (:url . "https://gitlab.com/RobertCochran/neato-graph-bar"))])
+ (neil . [(20220501 2053) ((emacs (27 1))) "companion for Babashka Neil" single ((:commit . "239c16655431b27ee558bf250bece4f4b10a0e83") (:authors ("Ag Ibragimov" . "agzam.ibragimov@gmail.com")) (:maintainer "Ag Ibragimov" . "agzam.ibragimov@gmail.com") (:keywords "convenience" "tools") (:url . "https://github.com/babashka/neil"))])
+ (nemerle . [(20161029 2023) nil "major mode for editing nemerle programs" single ((:commit . "db4bc9078f1b6238da32df1519c1957e74b6834a") (:authors ("Jacek Sliwerski (rzyjontko)" . "rzyj@o2.pl")) (:maintainer "Jacek Sliwerski (rzyjontko)" . "rzyj@o2.pl") (:keywords "nemerle" "mode" "languages"))])
+ (neon-mode . [(20180406 1156) nil "Simple major mode for editing neon files" single ((:commit . "99d15e46beaf1e7d71e39a00cce810df1f33229d") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "conf"))])
+ (neotree . [(20200324 1946) ((cl-lib (0 5))) "A tree plugin like NerdTree for Vim" tar ((:commit . "98fe21334affaffe2334bf7c987edaf1980d2d0b") (:authors ("jaypei" . "jaypei97159@gmail.com")) (:maintainer "jaypei" . "jaypei97159@gmail.com") (:url . "https://github.com/jaypei/emacs-neotree"))])
+ (nerdtab . [(20180811 339) ((emacs (24 5))) "Keyboard-oriented tabs" single ((:commit . "74ccc14d7956712e477a34b4a733284e8b3832a6") (:authors ("Yuan Fu" . "casouri@gmail.com")) (:maintainer "Yuan Fu" . "casouri@gmail.com") (:keywords "convenience") (:url . "https://github.com/casouri/nerdtab"))])
+ (netease-cloud-music . [(20220305 1224) ((emacs (27 1)) (request (0 3 3))) "Netease Cloud Music client" tar ((:commit . "f238d1d45bbeee32e0a8d169f39de4360be908f4") (:authors ("SpringHan")) (:maintainer "SpringHan") (:keywords "multimedia") (:url . "https://github.com/SpringHan/netease-cloud-music.git"))])
+ (netease-music . [(20210411 603) ((names (0 5)) (emacs (25))) "listen netease music" single ((:commit . "db7f1eef2d8544983509db679be1cbe6a5678071") (:authors ("hiro方圆" . "wfy11235813@gmail.com")) (:maintainer "hiro方圆" . "wfy11235813@gmail.com") (:keywords "multimedia" "chinese" "music") (:url . "https://github.com/nicehiro/netease-music"))])
+ (netherlands-holidays . [(20150202 1617) nil "Netherlands holidays for Emacs calendar." single ((:commit . "26236178cdd650df9958bf5a086e184096559f00") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "calendar") (:url . "https://github.com/abo-abo/netherlands-holidays"))])
+ (netrunner . [(20160910 2332) ((popup (0 5 3)) (company (0 9 0)) (helm (1 9 5))) "Create Android: Netrunner decklists using Company, Helm and org-mode" single ((:commit . "c64672992175c8c1073c0f56c2e471839db71a0f") (:authors ("Erik Sjöstrand")) (:maintainer "Erik Sjöstrand") (:keywords "games") (:url . "http://github.com/Kungsgeten/netrunner"))])
+ (network-watch . [(20171123 1146) ((emacs (24 3))) "Support for intermittent network connectivity" single ((:commit . "958dd0d419e4f9402648a86b754091ba346e01b8") (:authors ("Juan Amiguet Vercher" . "jamiguet@gmail.com")) (:maintainer "Juan Amiguet Vercher" . "jamiguet@gmail.com") (:keywords "unix" "tools" "hardware" "lisp") (:url . "https://github.com/jamiguet/network-watch"))])
+ (neuron-mode . [(20210227 1737) ((emacs (26 3)) (f (0 20 0)) (s (1 12 0)) (markdown-mode (2 3)) (company (0 9 13))) "Major mode for editing zettelkasten notes using neuron" single ((:commit . "a968a923aad07ab15fb35deb79ac95581a427b4c") (:authors ("felko <http://github/felko>")) (:maintainer "felko <http://github/felko>") (:keywords "outlines") (:url . "https://github.com/felko/neuron-mode"))])
+ (never-comment . [(20140104 2207) nil "Never blocks are comment" single ((:commit . "74ded8f1e7f23240f5f6032d0451fb0a51733bc4") (:authors ("Scott Frazer")) (:maintainer "Toon Claes") (:url . "http://stackoverflow.com/a/4554658/89376"))])
+ (newlisp-mode . [(20160226 1545) nil "newLISP editing mode for Emacs" single ((:commit . "ac23be40c81a360988ab803d365f1510733f6db4") (:authors ("KOBAYASHI Shigeru <shigeru.kb[at]gmail.com>")) (:maintainer "KOBAYASHI Shigeru <shigeru.kb[at]gmail.com>") (:keywords "language" "lisp" "newlisp") (:url . "https://github.com/kosh04/newlisp-mode"))])
+ (newspeak-mode . [(20211011 1425) ((emacs (24 3))) "Major mode for the Newspeak programming language" single ((:commit . "7ae89edd0f72c2dc005933fada5ddaf48ec97dd6") (:authors ("Daniel Szmulewicz")) (:maintainer "Daniel Szmulewicz" . "daniel.szmulewicz@gmail.com") (:url . "https://github.com/danielsz/newspeak-mode"))])
+ (nexus . [(20210903 1743) nil "REST Client for Nexus Maven Repository servers" tar ((:commit . "9603fd3d8ef34d4b3dcad3292c4ac743500d4946") (:authors ("Juergen Hoetzel" . "juergen@archlinux.org")) (:maintainer "Juergen Hoetzel" . "juergen@archlinux.org") (:keywords "comm"))])
+ (ng2-mode . [(20201203 1925) ((typescript-mode (0 1))) "Major modes for editing Angular 2" tar ((:commit . "d341f177c6e4fb9d99b8639943ab5fc9184e2715") (:authors ("Adam Niederer" . "adam.niederer@gmail.com")) (:maintainer "Adam Niederer" . "adam.niederer@gmail.com") (:keywords "typescript" "angular" "angular2" "template") (:url . "http://github.com/AdamNiederer/ng2-mode"))])
+ (nginx-mode . [(20170612 437) nil "major mode for editing nginx config files" single ((:commit . "6e9d96f58eddd69f62f7fd443d9b9753e16e0e96") (:authors ("Andrew J Cosgriff" . "andrew@cosgriff.name")) (:maintainer "Andrew J Cosgriff" . "andrew@cosgriff.name") (:keywords "languages" "nginx"))])
+ (niceify-info . [(20160416 1244) nil "improve usability of Info pages" single ((:commit . "38df5062bc3b99d1074cab3e788b5ed66732111c"))])
+ (niconama . [(20170910 1501) ((emacs (24)) (request (20170131 1747)) (cl-lib (0 5))) "Tools for Niconico Live Broadcast" single ((:commit . "96e7553e50e6bf7b58aac50f52c9b0b8edb41c56") (:keywords "comm") (:url . "https://github.com/NOBUTOKA/niconama.el"))])
+ (night-owl-theme . [(20200622 1943) ((emacs (24))) "A color theme for the night owls out there" single ((:commit . "4b9b5cb4fead9c5f145ba399d172c7e6bf577121") (:authors ("Aaron Jensen" . "aaronjensen@gmail.com")) (:maintainer "Aaron Jensen" . "aaronjensen@gmail.com") (:url . "http://github.com/aaronjensen/night-owl-theme"))])
+ (nikki . [(20210227 1707) ((emacs (24 3))) "A simple diary mode" single ((:commit . "b2ea20d04a061df88d72bd8dd0412a6e7876458d") (:authors ("Taiki Harada" . "thdev994@gmail.com")) (:maintainer "Taiki Harada" . "thdev994@gmail.com") (:keywords "convenience") (:url . "https://github.com/th994/nikki"))])
+ (nikola . [(20170703 2021) ((async (1 5)) (emacs (24 3))) "Simple wrapper for nikola" single ((:commit . "964715ac30943c9d6976999cad208dc60d09def0") (:authors (": drymer <drymer [ AT ] autistici.org>")) (:maintainer ": drymer <drymer [ AT ] autistici.org>") (:keywords ":" "nikola") (:url . ": https://git.daemons.it/drymer/nikola.el"))])
+ (nim-mode . [(20211102 917) ((emacs (24 4)) (epc (0 1 1)) (let-alist (1 0 1)) (commenter (0 5 1)) (flycheck-nimsuggest (0 8 1))) "A major mode for the Nim programming language" tar ((:commit . "744e076f0bea1c5ddc49f92397d9aa98ffa7eff8") (:authors ("Simon Hafner")) (:maintainer "Simon Hafner" . "hafnersimon@gmail.com") (:keywords "nim" "languages"))])
+ (nimbus-theme . [(20220106 2017) ((emacs (24 1))) "An awesome dark theme" single ((:commit . "f9bcec4ce0f6cd656a56034ace7811dea769a7bb") (:authors ("Marcin Swieczkowski" . "marcin.swieczkowski@gmail.com") ("See README.md for full list of contributors.")) (:maintainer "Marcin Swieczkowski" . "marcin.swieczkowski@gmail.com") (:keywords "faces") (:url . "https://github.com/m-cat/nimbus-theme"))])
+ (ninja-mode . [(20181024 1439) ((emacs (24))) "Major mode for editing .ninja files" single ((:commit . "7905dee5ac62f7a1e0dfec4d936b97d96c7566d7"))])
+ (nix-buffer . [(20180212 1518) ((f (0 17 3)) (emacs (24 4))) "Set up buffer environments with nix" single ((:commit . "db57cda36e7477bdc7ef5a136357b971b1d4d099") (:authors ("Shea Levy")) (:maintainer "Shea Levy") (:url . "https://github.com/shlevy/nix-buffer/tree/master/"))])
+ (nix-env-install . [(20200812 1305) ((emacs (25 1))) "Install packages using nix-env" single ((:commit . "79c34bc117ba1cebeb67fab32c364951d2ec37a0") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:keywords "processes" "tools") (:url . "https://github.com/akirak/nix-env-install"))])
+ (nix-haskell-mode . [(20190615 135) ((emacs (25)) (haskell-mode (16 0)) (nix-mode (1 3 0))) "haskell-mode integrations for Nix" single ((:commit . "68efbcbf949a706ecca6409506968ed2ef928a20") (:authors ("Matthew Bauer" . "mjbauer95@gmail.com")) (:maintainer "Matthew Bauer" . "mjbauer95@gmail.com") (:keywords "nix" "haskell" "languages" "processes") (:url . "https://github.com/matthewbauer/nix-haskell"))])
+ (nix-mode . [(20220505 1706) ((emacs (25 1)) (magit-section (0)) (transient (0 3))) "Major mode for editing .nix files" tar ((:commit . "8fe2ccf0b01f694a77d2528e06c10f06057784f6") (:maintainer "Matthew Bauer" . "mjbauer95@gmail.com") (:keywords "nix" "languages" "tools" "unix") (:url . "https://github.com/NixOS/nix-mode"))])
+ (nix-modeline . [(20210405 742) ((emacs (25 1))) "Info about in-progress Nix evaluations on your modeline" single ((:commit . "ecda866b960321bb82deac26af45918e172ef0ba") (:authors ("Jordan Mulcahey" . "snhjordy@gmail.com")) (:maintainer "Jordan Mulcahey" . "snhjordy@gmail.com") (:keywords "processes" "unix" "tools") (:url . "https://github.com/ocelot-project/nix-modeline"))])
+ (nix-sandbox . [(20210325 1622) ((dash (2 12 1)) (s (1 10 0))) "Utility functions to work with nix-shell sandboxes" single ((:commit . "053a2d5110ce05b7f99bcc2ac4804b70cbe87916") (:authors ("Sven Keidel" . "svenkeidel@gmail.com")) (:maintainer "Sven Keidel" . "svenkeidel@gmail.com") (:url . "https://github.com/travisbhartwell/nix-emacs"))])
+ (nix-update . [(20190124 1935) ((emacs (25))) "Update \"fetch\" blocks in .nix expressions" single ((:commit . "fc6c39c2da3fcfa62f4796816c084a6389c8b6e7") (:authors ("John Wiegley" . "johnw@newartisans.com")) (:maintainer "John Wiegley" . "johnw@newartisans.com") (:keywords "nix") (:url . "https://github.com/jwiegley/nix-update-el"))])
+ (nixos-options . [(20160209 1841) ((emacs (24))) "Interface for browsing and completing NixOS options." single ((:commit . "053a2d5110ce05b7f99bcc2ac4804b70cbe87916") (:authors ("Diego Berrocal" . "cestdiego@gmail.com") ("Travis B. Hartwell" . "nafai@travishartwell.net")) (:maintainer "Diego Berrocal" . "cestdiego@gmail.com") (:keywords "unix") (:url . "http://www.github.com/travisbhartwell/nix-emacs/"))])
+ (nixpkgs-fmt . [(20200327 2302) ((emacs (24)) (reformatter (0 3))) "Reformat Nix using nixpkgs-fmt" single ((:commit . "487b8e26c1ea816894c590790978762daf2ee339") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "languages") (:url . "https://github.com/purcell/emacs-nixpkgs-fmt"))])
+ (nlinum-hl . [(20211112 1241) ((emacs (24 4)) (nlinum (1 7)) (cl-lib (0 5))) "heal nlinum's line numbers" single ((:commit . "22f8d75ecdaab67e0d6d0d2da4766358456ca4f5") (:authors ("Henrik Lissner <http://github/hlissner>")) (:maintainer "Henrik Lissner" . "git@henrik.io") (:keywords "nlinum" "highlight" "current" "line" "faces") (:url . "https://github.com/hlissner/emacs-nlinum-hl"))])
+ (nlinum-relative . [(20160526 708) ((emacs (24 4)) (nlinum (1 5))) "Relative line number with nlinum" single ((:commit . "5b9950c97ba79a6f0683e38b13da23f39e01031c") (:authors ("codefalling" . "code.falling@gmail.com")) (:maintainer "codefalling" . "code.falling@gmail.com") (:keywords "convenience"))])
+ (nndiscourse . [(20220210 1529) ((emacs (25 1)) (dash (2 18 1)) (anaphora (1 0 4)) (rbenv (0 0 3)) (json-rpc (0 0 1))) "Gnus backend for Discourse" tar ((:commit . "1b7d7bfc99b104b7c4948af9f3394b416105e9d9") (:keywords "news") (:url . "https://github.com/dickmao/nndiscourse"))])
+ (nnhackernews . [(20220107 1537) ((emacs (25 2)) (request (0 3 3)) (dash (2 18 1)) (anaphora (1 0 4))) "Gnus backend for Hacker News" single ((:commit . "6748065db2f12ae6ea07058e7d643f586fb4b3bc") (:keywords "news") (:url . "https://github.com/dickmao/nnhackernews"))])
+ (nnir-est . [(20180710 2103) nil "Gnus nnir interface for HyperEstraier" single ((:commit . "6d0d5c8e33f4e4ccbc22350324c0990d2676fb5a") (:authors ("KAWABATA, Taichi <kawabata.taichi_at_gmail.com>")) (:maintainer "KAWABATA, Taichi <kawabata.taichi_at_gmail.com>") (:keywords "mail") (:url . "https://github.com/kawabata/nnir-est"))])
+ (nnreddit . [(20220423 2302) ((emacs (25 1)) (request (0 3 3)) (anaphora (1 0 4)) (dash (2 18 1)) (json-rpc (0 0 1)) (virtualenvwrapper (20151123)) (s (1 6 1))) "Gnus Backend For Reddit" tar ((:commit . "8f247dce12bd10de37f0903f3027a1ddbc318eff") (:keywords "news") (:url . "https://github.com/dickmao/nnreddit"))])
+ (nntwitter . [(20220213 1654) ((emacs (25 1)) (dash (20190401)) (anaphora (20180618)) (request (20190819))) "Gnus Backend For Twitter" tar ((:commit . "354781f9d2da04649823a6923ad372d801f10ca7") (:keywords "news") (:url . "https://github.com/dickmao/nntwitter"))])
+ (no-emoji . [(20180515 1837) ((emacs (24))) "Show :emoji-name: instead of emoji characters" single ((:commit . "ebceeab50dbfe4d60235180a57633745dbc18c77") (:authors ("Peter" . "craven@gmx.net")) (:maintainer "Peter" . "craven@gmx.net") (:keywords "extensions") (:url . "https://github.com/ecraven/no-emoji"))])
+ (no-littering . [(20220509 1733) ((emacs (25 1)) (compat (28 1 1 0))) "Help keeping ~/.emacs.d clean" single ((:commit . "fed46eb7060aca624bfe1a18f13b73f94e70f013") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "convenience") (:url . "https://github.com/emacscollective/no-littering"))])
+ (no-spam . [(20190724 1854) ((emacs (25 1))) "Add repeat delays to commands" single ((:commit . "860860e4a0d59bd15c8e092dc42f5f7f769a428e") (:authors ("Daniel Phan" . "daniel.phan36@gmail.com")) (:maintainer "Daniel Phan" . "daniel.phan36@gmail.com") (:keywords "keyboard" "tools") (:url . "https://github.com/mamapanda/no-spam"))])
+ (noaa . [(20220509 1600) ((emacs (27 1)) (request (0 2 0)) (dash (2 14 1))) "Get NOAA weather data" single ((:commit . "507831164b09a2d769bd68d5a45608fc0de626dd") (:authors ("David Thompson")) (:maintainer "David Thompson") (:keywords "calendar") (:url . "https://github.com/thomp/noaa"))])
+ (noccur . [(20191015 719) nil "Run multi-occur on project/dired files" single ((:commit . "fa91647a305e89561d3dbe53da002fff49abe0bb") (:authors ("Nicolas Petton" . "petton.nicolas@gmail.com")) (:maintainer "Nicolas Petton" . "petton.nicolas@gmail.com") (:keywords "convenience"))])
+ (nocomments-mode . [(20170213 2037) nil "Minor mode that makes comments invisible." single ((:commit . "5a41a20cc44dfe4a9ea584354ed6dbc15dd92f46") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:url . "https://github.com/Lindydancer/nocomments-mode"))])
+ (noctilux-theme . [(20161113 1442) ((emacs (24))) "Dark theme inspired by LightTable" single ((:commit . "a3265a1be7f4d73f44acce6d968ca6f7add1f2ca") (:authors ("Simon Manning" . "simon@ecksdee.org")) (:maintainer "Simon Manning" . "simon@ecksdee.org") (:url . "https://github.com/sjrmanning/noctilux-theme"))])
+ (node-resolver . [(20140930 1723) ((cl-lib (0 5))) "hook to install node modules in background" single ((:commit . "ef9d0486907a746a80b02ffc6208a09c168a9f7c") (:authors ("Dave Justice")) (:maintainer "Dave Justice") (:keywords "convenience" "nodejs" "javascript" "npm") (:url . "https://github.com/meandavejustice/node-resolver.el"))])
+ (nodejs-repl . [(20200802 1310) nil "Run Node.js REPL" single ((:commit . "3b841055cad00f442e4a9159b1056f59411b6646") (:authors ("Takeshi Arabiki")) (:maintainer "Takeshi Arabiki"))])
+ (nodemcu-mode . [(20180501 2225) ((emacs (25))) "Minor mode for NodeMCU" single ((:commit . "8effd9f3df40b6b92a2f05e4d54750b624afc4a7") (:authors ("Andreas Müller" . "code@0x7.ch")) (:maintainer "Andreas Müller" . "code@0x7.ch") (:keywords "tools") (:url . "https://github.com/andrmuel/nodemcu-mode"))])
+ (noflet . [(20141102 1454) nil "locally override functions" single ((:commit . "7ae84dc3257637af7334101456dafe1759c6b68a") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "lisp") (:url . "https://github.com/nicferrier/emacs-noflet"))])
+ (nofrils-acme-theme . [(20180620 1248) ((emacs (24))) "Port of \"No Frils Acme\" Vim theme." tar ((:commit . "98ad7bfaff1d85b33dc162645670285b067c6f92") (:authors ("Eric Sessoms" . "esessoms@protonmail.com")) (:maintainer "Eric Sessoms" . "esessoms@protonmail.com") (:url . "https://gitlab.com/esessoms/nofrils-theme"))])
+ (nord-theme . [(20200620 1122) ((emacs (24))) "An arctic, north-bluish clean and elegant theme" single ((:commit . "4f5b64605709d5803285953026137e905756c35f") (:authors ("Arctic Ice Studio" . "development@arcticicestudio.com")) (:maintainer "Arctic Ice Studio" . "development@arcticicestudio.com") (:url . "https://github.com/arcticicestudio/nord-emacs"))])
+ (nordless-theme . [(20201222 1627) ((colorless-themes (0 2))) "A mostly colorless version of nord-theme" single ((:commit . "c1ed1e12541cf05cc6c558d23c089c07e10b54d7") (:authors ("Thomas Letan" . "lthms@soap.coffee")) (:maintainer "Thomas Letan" . "lthms@soap.coffee") (:keywords "faces" "theme") (:url . "https://git.sr.ht/~lthms/colorless-themes.el"))])
+ (norns . [(20220422 2152) ((emacs (27 1)) (dash (2 17 0)) (s (1 12 0)) (f (0 20 0)) (request (0 3 2)) (websocket (1 13))) "Interactive development environment for monome norns" single ((:commit . "0eb487e15cf4aaaa30efde9068e205f014fd1dd2") (:keywords "processes" "terminals") (:url . "https://github.com/p3r7/norns.el"))])
+ (northcode-theme . [(20180423 1649) ((emacs (24))) "A dark theme focused on blue and orange colors." single ((:commit . "4d3750461ba25ec45321318b5f1af4e8fdf16147") (:authors ("Andreas Larsen" . "andreas@northcode.no")) (:maintainer "Andreas Larsen" . "andreas@northcode.no") (:url . "https://github.com/Northcode/northcode-theme.el"))])
+ (nothing-theme . [(20200504 402) ((emacs (24 1))) "Monochrome theme" single ((:commit . "d2514bb9707f66dda0d60f40f465e79914c50946") (:authors ("Jared Gorski," . "jaredgorski6@gmail.com")) (:maintainer "Jared Gorski," . "jaredgorski6@gmail.com") (:url . "https://github.com/jaredgorski/nothing.el"))])
+ (notink-theme . [(20220114 1955) ((emacs (26 1))) "A custom theme inspired by e-ink displays" single ((:commit . "6115857fe75c1adbbce4165a2b77a11a271aaf31") (:authors ("MetroWind" . "chris.corsair@gmail.com")) (:maintainer "MetroWind" . "chris.corsair@gmail.com") (:keywords "faces") (:url . "https://github.com/MetroWind/notink-theme"))])
+ (notmuch . [(20220226 1200) nil "run notmuch within emacs" tar ((:commit . "37492858b61907e4728b2e68e67238c68e9a0d49") (:url . "https://notmuchmail.org"))])
+ (notmuch-addr . [(20220422 1618) ((emacs (27 1)) (compat (28 1 1 0)) (notmuch (0 32))) "An alternative to notmuch-address.el" single ((:commit . "dd852b09415e755cef6a345a2ee454a6cf1e1d06") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "mail") (:url . "https://git.sr.ht/~tarsius/notmuch-addr"))])
+ (notmuch-bookmarks . [(20200322 1925) ((seq (2 20)) (emacs (26 1)) (notmuch (0 29 3))) "Add bookmark handling for notmuch buffers" single ((:commit . "ec8edfdbd1ac475530591d73a570ded5c18ed86a") (:authors ("Jörg Volbers" . "joerg@joergvolbers.de")) (:maintainer "Jörg Volbers" . "joerg@joergvolbers.de") (:keywords "mail") (:url . "https://github.com/publicimageltd/notmuch-bookmarks"))])
+ (notmuch-labeler . [(20131230 1719) ((notmuch (0))) "Improve notmuch way of displaying labels" tar ((:commit . "d65d1129555d368243df4770ecc1e7ccb88efc58") (:authors ("Damien Cassou" . "damien.cassou@gmail.com")) (:maintainer "Damien Cassou" . "damien.cassou@gmail.com") (:keywords "emacs" "package" "elisp" "notmuch" "emails") (:url . "https://github.com/DamienCassou/notmuch-labeler"))])
+ (notmuch-maildir . [(20220422 1621) ((emacs (26 1)) (compat (28 1 1 0)) (notmuch (0 30))) "Visualize maildirs as a tree" single ((:commit . "b39cdeaec1afda6015cd0d5f4d851b3d59d0fd2b") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "mail") (:url . "https://git.sr.ht/~tarsius/notmuch-maildir"))])
+ (notmuch-transient . [(20220503 1117) ((emacs (27 1)) (compat (28 1 1 0)) (notmuch (0 31 4))) "Command dispatchers for Notmuch" single ((:commit . "4f64de401b8d955dce528f76575142edd9815dc7") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "mail") (:url . "https://git.sr.ht/~tarsius/notmuch-transient"))])
+ (nov . [(20220428 1417) ((esxml (0 3 6)) (emacs (25 1))) "Featureful EPUB reader mode" single ((:commit . "8f5b42e9d9f304b422c1a7918b43ee323a7d3532") (:authors ("Vasilij Schneidermann" . "mail@vasilij.de")) (:maintainer "Vasilij Schneidermann" . "mail@vasilij.de") (:keywords "hypermedia" "multimedia" "epub") (:url . "https://depp.brause.cc/nov.el"))])
+ (nova-theme . [(20210512 1802) ((emacs (24 3))) "A dark, pastel color theme" single ((:commit . "1498f756a4c1c9ea9740cd3208f74d071283b930") (:authors ("Muir Manders" . "muir+emacs@mnd.rs")) (:maintainer "Muir Manders" . "muir+emacs@mnd.rs") (:keywords "theme" "dark" "nova" "pastel" "faces") (:url . "https://github.com/muirmanders/emacs-nova-theme"))])
+ (noxml-fold . [(20170823 1357) nil "Fold away XML things." single ((:commit . "46c7f6a008672213238a9f8d7a416ce80916aa62") (:authors ("Patrick McAllister" . "pma@rdorte.org")) (:maintainer "Patrick McAllister" . "pma@rdorte.org") (:keywords "xml" "folding") (:url . "https://github.com/paddymcall/noxml-fold"))])
+ (npm . [(20220428 839) ((emacs (25 1)) (transient (0 1 0)) (jest (20200625))) "Run your npm workflows" tar ((:commit . "6eb0a58274870dd75bf848cf5a916a9f2c6ddae5") (:authors ("Shane Kennedy")) (:maintainer "Shane Kennedy") (:keywords "tools") (:url . "https://github.com/shaneikennedy/npm.el"))])
+ (npm-mode . [(20190616 2025) ((emacs (24 1))) "minor mode for working with npm projects" single ((:commit . "3ee7c0bad5b7a041d4739ef3aaa06a3dc764e5eb") (:authors ("Allen Gooch" . "allen.gooch@gmail.com")) (:maintainer "Allen Gooch" . "allen.gooch@gmail.com") (:keywords "convenience" "project" "javascript" "node" "npm") (:url . "https://github.com/mojochao/npm-mode"))])
+ (nrepl-eval-sexp-fu . [(20201007 2311) ((highlight (0 0 0)) (smartparens (0 0 0)) (thingatpt (0 0 0))) "Tiny functionality enhancements for evaluating sexps." single ((:commit . "2d6ad728b1ba290974a2ae1f232a5a96810a135b") (:authors ("Takeshi Banse" . "takebi@laafc.net")) (:maintainer "Takeshi Banse" . "takebi@laafc.net") (:keywords "lisp" "highlight" "convenience"))])
+ (nrepl-sync . [(20140807 1554) ((cider (0 6))) "connect to nrepl port and eval .sync.clj." single ((:commit . "bab53a2361526d63a24cda176d07a1247bf5b399") (:authors ("Phillip Lord" . "phillip.lord@newcastle.ac.uk")) (:maintainer "Phillip Lord" . "phillip.lord@newcastle.ac.uk") (:url . "https://github.com/phillord/lein-sync"))])
+ (ns-auto-titlebar . [(20181022 2154) ((emacs (24 4))) "Set the MacOS transparent titlebar to match theme" single ((:commit . "60273e764bf8d95abc40dd2fdc23af87ea9ee33b") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "frames") (:url . "https://github.com/purcell/ns-auto-titlebar"))])
+ (nsis-mode . [(20190615 1827) nil "NSIS-mode" tar ((:commit . "0a2e6ece2fe682dced4d31688b38bb472a877cdf") (:authors ("Matthew L. Fidler")) (:maintainer "Matthew L. Fidler") (:keywords "nsis") (:url . "http://github.com/mlf176f2/nsis-mode"))])
+ (nswbuff . [(20220426 2050) ((emacs (25 1))) "Quick switching between buffers." single ((:commit . "7633674c89e3dbfc0c07cd7fd8b1d206ed4859d3") (:authors ("David Ponce" . "david@dponce.com") ("Kahlil (Kal) HODGSON" . "dorge@tpg.com.au") ("Joost Kremers" . "joostkremers@fastmail.fm")) (:maintainer "Joost Kremers" . "joostkremers@fastmail.fm") (:keywords "extensions" "convenience") (:url . "https://github.com/joostkremers/nswbuff"))])
+ (nu-mode . [(20190404 2032) ((undo-tree (0 6 5)) (ace-window (0)) (lv (0)) (avy (0)) (which-key (0)) (transpose-frame (0))) "Modern Emacs Prompts Based Keybinding." tar ((:commit . "d5fb4d26d1b0bb383ea2827cc5af5dfb2a269d2b"))])
+ (nubox . [(20170619 910) nil "Nubox color theme (dark, light and tty versions)" tar ((:commit . "1ccb8035ae42727ba6bdd5c1106fbceddeeed370") (:authors ("Martijn Terpstra" . "bigmartijn@gmail.com")) (:maintainer "Martijn Terpstra" . "bigmartijn@gmail.com") (:keywords "faces"))])
+ (number . [(20170901 1312) nil "Working with numbers at point." single ((:commit . "bbc278d34dbcca83e70e3be855ec98b23debfb99"))])
+ (number-lock . [(20160830 200) nil "Enter symbols on your number keys without pressing shift" single ((:commit . "74417b1238953bf485961a0dd7d20f5c36ae25ea") (:authors ("Liu233w" . "wwwlsmcom@outlook.com")) (:maintainer "Liu233w" . "wwwlsmcom@outlook.com") (:keywords "convenience") (:url . "https://github.com/Liu233w/number-lock.el"))])
+ (numbers . [(20170802 1134) ((emacs (24))) "Display information and trivia about numbers" single ((:commit . "dd02508b788a13b7d4dbcc4923fa23134b783ab3") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "games" "trivia" "maths" "numbers") (:url . "https://github.com/davep/numbers.el"))])
+ (numbex . [(20220504 1329) ((emacs (26 1))) "Manage numbered examples" single ((:commit . "55d4977c74ca33d1ad4c10fea7369f4bcdfd3f86") (:authors ("Enrico Flor" . "enrico@eflor.net")) (:maintainer "Enrico Flor" . "enrico@eflor.net") (:url . "https://github.com/enricoflor/numbex"))])
+ (nummm-mode . [(20131117 1014) nil "Display the number of minor modes instead of their names" single ((:commit . "81951e12032274543c5f7a585b29bd93961e94e4") (:authors ("Andreu Gil" . "agpchil@gmail.com")) (:maintainer "Andreu Gil" . "agpchil@gmail.com") (:url . "http://github.com/agpchil/nummm-mode"))])
+ (numpydoc . [(20220304 1546) ((emacs (25 1)) (s (1 12 0)) (dash (2 18 0))) "NumPy style docstring insertion" single ((:commit . "1b8c5ef3301fed5e5c1941817dbb7435188ff417") (:authors ("Doug Davis" . "ddavis@ddavis.io")) (:maintainer "Doug Davis" . "ddavis@ddavis.io") (:keywords "convenience") (:url . "https://github.com/douglasdavis/numpydoc.el"))])
+ (nv-delete-back . [(20170224 1249) ((emacs (24))) "backward delete like modern text editors" single ((:commit . "b17cb826f14c18c2875d112574edb5e4f46f5296") (:authors ("Nicolas Vaughan <n.vaughan [at] oxon.org>")) (:maintainer "Nicolas Vaughan <n.vaughan [at] oxon.org>") (:keywords "lisp"))])
+ (nvm . [(20210826 1000) ((s (1 8 0)) (dash (2 18 0)) (f (0 14 0))) "Manage Node versions within Emacs" single ((:commit . "c214762fd6f539ec3e1fd8198cefbdb4b428b19c") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "node" "nvm") (:url . "http://github.com/rejeep/nvm.el"))])
+ (nxml-uxml . [(20220130 1405) ((emacs (25))) "MicroXML support for nXML" single ((:commit . "94440741f7e8b83504d53991f26f63b4855cce27") (:authors ("Daphne Preston-Kendal")) (:maintainer "Daphne Preston-Kendal") (:keywords "languages" "xml" "microxml") (:url . "https://gitlab.com/dpk/nxml-uxml"))])
+ (nyan-mode . [(20220408 2334) ((emacs (24 1))) "Nyan Cat shows position in current buffer in mode-line" tar ((:commit . "09904af23adb839c6a9c1175349a1fb67f5b4370") (:authors ("Jacek \"TeMPOraL\" Zlydach" . "temporal.pl@gmail.com")) (:maintainer "Jacek \"TeMPOraL\" Zlydach" . "temporal.pl@gmail.com") (:keywords "convenience" "games" "mouse" "multimedia") (:url . "https://github.com/TeMPOraL/nyan-mode/"))])
+ (nyx-theme . [(20170910 1307) ((emacs (24))) "Dark theme" single ((:commit . "afe2b8c3b5421b4c292d182dcf77079b278e93d8") (:authors ("Guido Schmidt")) (:maintainer "Guido Schmidt" . "guido.schmidt.2912@gmail.com") (:keywords "themes" "dark-theme") (:url . "https://github.com/GuidoSchmidt/emacs-nyx-theme"))])
+ (nz-holidays . [(20190415 703) nil "New Zealand public holidays for calendar." single ((:commit . "afc875cf40789fa45a4a811685b0a7c4f239392f") (:authors ("Sod Oscarfono" . "sod@oscarfono.com")) (:maintainer "Sod Oscarfono" . "sod@oscarfono.com") (:keywords "calendar") (:url . "https://github.com/techquila/nz-holidays"))])
+ (oauth . [(20130128 151) nil "Oauth library." tar ((:commit . "ee4744ad76a1560281b0c4944575a3bd598c6458") (:authors ("Peter Sanford <peter AT petersdanceparty.com>")) (:maintainer "Peter Sanford <peter AT petersdanceparty.com>") (:keywords "comm"))])
+ (oauth2-request . [(20210215 657) ((emacs (26 1)) (oauth2 (0 14)) (request (0 3))) "OAuth2 request package interface" single ((:commit . "86ff048635e002b00e23d6bed2ec6f36c17bca8e") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience") (:url . "https://github.com/conao3/oauth2-request.el"))])
+ (ob-ada-spark . [(20220401 926) ((emacs (26 1)) (f (0 20 0))) "Babel functions for Ada & SPARK" single ((:commit . "1213b877bc893ac5990a20052ea2bf2d8f086260") (:authors ("Francesc Rocher")) (:maintainer "Francesc Rocher") (:keywords "languages" "tools" "outlines") (:url . "https://github.com/rocher/ob-ada-spark"))])
+ (ob-applescript . [(20190709 1607) nil "Org-babel functions for AppleScript" single ((:commit . "2b07b77b75bd02f2102f62e6d52ffdd0f921439a") (:authors ("Stig Brautaset")) (:maintainer "Stig Brautaset") (:keywords "literate programming" "reproducible research" "mac") (:url . "http://github.com/stig/ob-applescript.el"))])
+ (ob-async . [(20210428 2052) ((async (1 9)) (org (9 0 1)) (emacs (24 4)) (dash (2 14 1))) "Asynchronous org-babel src block execution" single ((:commit . "9aac486073f5c356ada20e716571be33a350a982") (:authors ("Andrew Stahlman" . "andrewstahlman@gmail.com")) (:maintainer "Andrew Stahlman" . "andrewstahlman@gmail.com") (:keywords "tools") (:url . "https://github.com/astahlman/ob-async"))])
+ (ob-axiom . [(20190623 2052) ((emacs (24 2)) (axiom-environment (20171021))) "An org-babel backend for the axiom-environment system" single ((:commit . "e60de5ed107ffeb530a56d24d04f38988124d12b") (:authors ("Paul Onions")) (:maintainer "Paul Onions") (:keywords "axiom" "openaxiom" "fricas"))])
+ (ob-bitfield . [(20220401 600) ((emacs (24 4))) "Babel Functions for bitfield" single ((:commit . "28e01448ee66b8b6858294cad1b7dae0b9a85e6a") (:authors ("Gulshan Singh")) (:maintainer "Gulshan Singh") (:url . "https://github.com/gsingh93/ob-bitfield"))])
+ (ob-blockdiag . [(20210412 1541) nil "org-babel functions for blockdiag evaluation" single ((:commit . "c3794bf7bdb8fdb3db90db41619dda4e7d3dd7b9") (:authors ("Dmitry Moskowski")) (:maintainer "Dmitry Moskowski") (:keywords "tools" "convenience") (:url . "https://github.com/corpix/ob-blockdiag.el"))])
+ (ob-browser . [(20170720 1918) ((org (8))) "Render HTML in org-mode blocks." tar ((:commit . "a347d9df1c87b7eb660be8723982c7ad2563631a") (:authors ("Kris Jenkins" . "krisajenkins@gmail.com")) (:maintainer "Kris Jenkins" . "krisajenkins@gmail.com") (:keywords "org" "babel" "browser" "phantomjs") (:url . "https://github.com/krisajenkins/ob-browser"))])
+ (ob-cfengine3 . [(20191011 1721) nil "Org Babel functions for CFEngine 3" single ((:commit . "195ba4694a0ec18d3fb89342e8e0988b382a5b1a") (:authors ("Nick Anderson" . "nick@cmdln.org")) (:maintainer "Nick Anderson" . "nick@cmdln.org") (:keywords "tools" "convenience") (:url . "https://github.com/nickanderson/ob-cfengine3"))])
+ (ob-clojurescript . [(20180406 1828) ((emacs (24 4)) (org (9 0))) "org-babel functions for ClojureScript evaluation" single ((:commit . "17ee1558aa94c7b0246fd03f684884122806cfe7") (:authors ("Larry Staton Jr.")) (:maintainer "Larry Staton Jr.") (:keywords "literate programming" "reproducible research") (:url . "https://gitlab.com/statonjr/ob-clojurescript"))])
+ (ob-coffee . [(20170725 1424) ((org (8))) "org-babel functions for coffee-script evaluation" tar ((:commit . "7f0b330273e8af7777de87a75fe52a89798e4548") (:authors ("ZHOU Feng" . "zf.pascal@gmail.com")) (:maintainer "ZHOU Feng" . "zf.pascal@gmail.com") (:keywords "org" "babel" "coffee-script") (:url . "http://github.com/zweifisch/ob-coffee"))])
+ (ob-coffeescript . [(20180126 719) ((emacs (24 4))) "org-babel functions for coffee-script evaluation, and fully implementation!" single ((:commit . "5a5bb04aea9c2a6eab5b05f90f5c7cb6de7b4261") (:authors ("Brantou" . "brantou89@gmail.com")) (:maintainer "Brantou" . "brantou89@gmail.com") (:keywords "coffee-script" "literate programming" "reproducible research") (:url . "https://github.com/brantou/ob-coffeescript"))])
+ (ob-compile . [(20220413 228) ((emacs (24 4))) "Run compile by org-babel" single ((:commit . "eb4fca6dc728cdc1e73d5d7ca8cad0f4cb1ad36a") (:authors ("Giap Tran" . "txgvnn@gmail.com")) (:maintainer "Giap Tran" . "txgvnn@gmail.com") (:keywords "literate programming" "reproducible" "processes") (:url . "https://github.com/TxGVNN/ob-compile"))])
+ (ob-crystal . [(20180126 718) ((emacs (24 3))) "org-babel functions for Crystal evaluation" tar ((:commit . "d84c1adee4b269cdba06a97caedb8071561a09af") (:authors ("Brantou" . "brantou89@gmail.com")) (:maintainer "Brantou" . "brantou89@gmail.com") (:keywords "crystal" "literate programming" "reproducible research") (:url . "https://github.com/brantou/ob-crystal"))])
+ (ob-cypher . [(20200521 936) ((s (1 9 0)) (cypher-mode (0 0 6)) (dash (2 10 0)) (dash-functional (1 2 0))) "query neo4j using cypher in org-mode blocks" single ((:commit . "da9f97339474a48d759fc128cee610c0bc9ae6c0") (:authors ("ZHOU Feng" . "zf.pascal@gmail.com")) (:maintainer "ZHOU Feng" . "zf.pascal@gmail.com") (:keywords "org" "babel" "cypher" "neo4j") (:url . "http://github.com/zweifisch/ob-cypher"))])
+ (ob-dao . [(20170816 1558) ((org (8))) "Org Babel Functions for Dao" single ((:commit . "fa92f62a63c684d689f57e790e5dd614c5bba270") (:authors ("Chunyang Xu" . "mail@xuchunyang.me")) (:maintainer "Chunyang Xu" . "mail@xuchunyang.me") (:keywords "literate programming" "reproducible research" "org" "babel" "dao") (:url . "https://github.com/xuchunyang/ob-dao"))])
+ (ob-dart . [(20170106 1624) nil "org-babel functions for Dart evaluation" single ((:commit . "04d63b922a5469506560ca0c00678e57131e0269") (:authors ("Milan Zimmermann")) (:maintainer "Milan Zimmermann") (:keywords "literate programming" "reproducible research" "emacs" "org" "babel" "dart") (:url . "http://github.org/mzimmerm/ob-dart"))])
+ (ob-deno . [(20201019 101) ((emacs (26 1))) "Babel Functions for Javascript/TypeScript with Deno" single ((:commit . "f1129d20fe9931f1c0b62c4af781f5489abd957f") (:authors ("HIGASHI Taiju")) (:maintainer "HIGASHI Taiju") (:keywords "literate programming" "reproducible research" "javascript" "typescript" "tools") (:url . "https://github.com/taiju/ob-deno"))])
+ (ob-diagrams . [(20160407 1237) nil "org-babel functions for diagrams evaluation" single ((:commit . "ed6649616325ca5b2d2109f74aded8bcb8aa5186") (:authors ("Daniel Bergey")) (:maintainer "Daniel Bergey") (:keywords "literate programming" "reproducible research") (:url . "http://orgmode.org"))])
+ (ob-dsq . [(20220425 716) ((emacs (27 1))) "Babel functions for the `dsq` CLI tool by Multiprocess Labs" single ((:commit . "b8dbf53e5d9ed359fbf69e9d14adf68a7c08af10") (:authors ("Fritz Grabo" . "hello@fritzgrabo.com")) (:maintainer "Fritz Grabo" . "hello@fritzgrabo.com") (:keywords "data" "tools") (:url . "https://github.com/fritzgrabo/ob-dsq"))])
+ (ob-elixir . [(20170725 1419) ((org (8))) "org-babel functions for elixir evaluation" single ((:commit . "8990a8178b2f7bd93504a9ab136622aab6e82e32") (:authors ("ZHOU Feng" . "zf.pascal@gmail.com")) (:maintainer "ZHOU Feng" . "zf.pascal@gmail.com") (:keywords "org" "babel" "elixir") (:url . "http://github.com/zweifisch/ob-elixir"))])
+ (ob-elm . [(20200528 1857) ((emacs (26 1)) (org (9 3))) "Org-babel functions for elm evaluation" single ((:commit . "d3a9fbc2f56416894c9aed65ea9a20cc1d98f15d") (:authors ("Bonface M. K.")) (:maintainer "Bonface M. K.") (:keywords "languages" "tools") (:url . "https://www.bonfacemunyoki.com"))])
+ (ob-elvish . [(20180427 1900) nil "org-babel functions for Elvish shell" single ((:commit . "369181ceae1190bf971c71aebf9fc6133bd98c39") (:authors ("Diego Zamboni" . "diego@zzamboni.org")) (:maintainer "Diego Zamboni" . "diego@zzamboni.org") (:keywords "literate programming" "elvish" "shell" "languages" "processes" "tools") (:url . "https://github.com/zzamboni/ob-elvish"))])
+ (ob-ess-julia . [(20210414 1444) ((ess (20201004 1522)) (julia-mode (0 4))) "Org babel support for Julia language" tar ((:commit . "147e9e7fe55c41dd77171417e92af40db3530b84") (:authors ("Frédéric Santos")) (:maintainer "Frédéric Santos") (:keywords "languages") (:url . "https://github.com/frederic-santos/ob-ess-julia"))])
+ (ob-fsharp . [(20170618 1429) ((emacs (25)) (fsharp-mode (1 9 8))) "Org-Babel F#" single ((:commit . "0b2fdd9bb4f38af8b5cf4914627af52f5b43d9f7") (:authors ("Jürgen Hötzel" . "juergen@archlinux.org")) (:maintainer "Jürgen Hötzel" . "juergen@archlinux.org") (:keywords "literate programming" "reproducible research") (:url . "https://github.com/juergenhoetzel/ob-fsharp"))])
+ (ob-go . [(20190201 2040) nil "org-babel functions for go evaluation" tar ((:commit . "2067ed55f4c1d33a43cb3f6948609d240a8915f5") (:authors ("K. Adam Christensen")) (:maintainer "K. Adam Christensen") (:keywords "golang" "go" "literate programming" "reproducible research") (:url . "http://orgmode.org"))])
+ (ob-graphql . [(20201222 1515) ((emacs (24 4)) (graphql-mode (20191024 1221)) (request (0 3 2))) "Org-Babel execution backend for GraphQL source blocks" single ((:commit . "7c35419f9eec5dc44967cbcfa13c7135b9a96bfc") (:authors ("Jeremy Dormitzer" . "jeremy.dormitzer@gmail.com")) (:maintainer "Jeremy Dormitzer" . "jeremy.dormitzer@gmail.com") (:url . "https://github.com/jdormit/ob-graphql"))])
+ (ob-html-chrome . [(20181219 1042) ((emacs (24 4)) (f (0 20 0)) (s (1 7 0))) "HTML code blocks converted to PNG using Chrome" single ((:commit . "7af6e4a24ed0aaf67751bdf752c7ca0ba02bb8d4") (:authors (nil . "Nik Clayton nik@ngo.org.uk")) (:maintainer nil . "Nik Clayton nik@ngo.org.uk") (:keywords "languages" "org" "org-babel" "chrome" "html") (:url . "http://github.com/nikclayton/ob-html-chrome"))])
+ (ob-http . [(20180707 1448) ((s (1 9 0)) (cl-lib (0 5))) "http request in org-mode babel" tar ((:commit . "b1428ea2a63bcb510e7382a1bf5fe82b19c104a7") (:authors ("ZHOU Feng" . "zf.pascal@gmail.com")) (:maintainer "ZHOU Feng" . "zf.pascal@gmail.com") (:url . "http://github.com/zweifisch/ob-http"))])
+ (ob-hy . [(20180702 540) ((emacs (24 4))) "org-babel functions for Hy-lang evaluation" tar ((:commit . "a42ecaf440adc03e279afe43ee5ef6093ddd542a") (:authors ("Brantou" . "brantou89@gmail.com")) (:maintainer "Brantou" . "brantou89@gmail.com") (:keywords "hy" "literate programming" "reproducible research") (:url . "https://github.com/brantou/ob-hy"))])
+ (ob-ipython . [(20180224 953) ((s (1 9 0)) (dash (2 10 0)) (dash-functional (1 2 0)) (f (0 17 2)) (emacs (24))) "org-babel functions for IPython evaluation" tar ((:commit . "7147455230841744fb5b95dcbe03320313a77124") (:authors ("Greg Sexton" . "gregsexton@gmail.com")) (:maintainer "Greg Sexton" . "gregsexton@gmail.com") (:keywords "literate programming" "reproducible research") (:url . "http://www.gregsexton.org"))])
+ (ob-julia-vterm . [(20210418 2306) ((emacs (26 1)) (julia-vterm (0 10))) "Babel Functions for Julia in VTerm" single ((:commit . "e04ee53d67cbd715c2d84fe5bc367526edfadc74") (:authors ("Shigeaki Nishina")) (:maintainer "Shigeaki Nishina") (:keywords "julia" "org" "outlines" "literate programming" "reproducible research") (:url . "https://github.com/shg/ob-julia-vterm.el"))])
+ (ob-kotlin . [(20180823 1321) ((org (8))) "org-babel functions for kotlin evaluation" single ((:commit . "96e420cbd2e9ea8a77043e5dcaebdfc6da17492a") (:authors ("ZHOU Feng" . "zf.pascal@gmail.com")) (:maintainer "ZHOU Feng" . "zf.pascal@gmail.com") (:keywords "org" "babel" "kotlin") (:url . "http://github.com/zweifisch/ob-kotlin"))])
+ (ob-latex-as-png . [(20200629 1013) ((emacs (26 1)) (org (9 1))) "Org-babel functions for latex-as-png evaluation" single ((:commit . "a20e3fedbac4034de4ab01436673a0f8845de1df") (:authors ("Musa Al-hassy" . "alhassy@gmail.com")) (:maintainer "Musa Al-hassy" . "alhassy@gmail.com") (:keywords "literate programming" "reproducible research" "org" "convenience") (:url . "https://github.com/alhassy/ob-latex-as-png"))])
+ (ob-lfe . [(20170725 1420) ((org (8))) "org-babel functions for lfe evaluation" single ((:commit . "f7780f58e650b4d29dfd834c662b1d354b620a8e") (:authors ("ZHOU Feng" . "zf.pascal@gmail.com")) (:maintainer "ZHOU Feng" . "zf.pascal@gmail.com") (:keywords "org" "babel" "lfe" "lisp" "erlang") (:url . "http://github.com/zweifisch/ob-lfe"))])
+ (ob-mermaid . [(20200320 1504) nil "org-babel support for mermaid evaluation" single ((:commit . "b4ce25699e3ebff054f523375d1cf5a17bd0dbaf") (:authors ("Alexei Nunez" . "alexeirnunez@gmail.com")) (:maintainer "Alexei Nunez" . "alexeirnunez@gmail.com") (:keywords "lisp") (:url . "https://github.com/arnm/ob-mermaid"))])
+ (ob-ml-marklogic . [(20190312 1314) nil "org-babel functions for MarkLogic evaluation" tar ((:commit . "d5660ad14f29e17cd26ae92eeb585b24030e9570") (:authors ("Norman Walsh" . "ndw@nwalsh.com")) (:maintainer "Norman Walsh" . "ndw@nwalsh.com") (:keywords "marklogic" "xquery" "javascript" "sparql") (:url . "http://github.com/ndw/ob-ml-marklogic"))])
+ (ob-mongo . [(20170720 1919) ((org (8))) "Execute mongodb queries within org-mode blocks." single ((:commit . "371bf19c7c10eab2f86424f8db8ab685997eb5aa") (:authors ("Kris Jenkins" . "krisajenkins@gmail.com")) (:maintainer "Kris Jenkins" . "krisajenkins@gmail.com") (:keywords "org" "babel" "mongo" "mongodb") (:url . "https://github.com/krisajenkins/ob-mongo"))])
+ (ob-napkin . [(20200816 1245) ((emacs (26 1))) "Babel functions for Napkin" single ((:commit . "7af5e8af08da8455c489909afbd9528a61f570e7") (:authors ("Hans Jang")) (:maintainer "Hans Jang") (:keywords "tools" "literate programming" "reproducible research" "napkin" "plantuml") (:url . "https://github.com/pinetr2e/ob-napkin"))])
+ (ob-nim . [(20210601 1807) ((cl-lib (0 5))) "Babel Functions for nim" single ((:commit . "6fd060a3ecd38be37e4ec2261cd65760a3c35a91") (:authors ("Lompik")) (:maintainer "Lompik") (:keywords "literate programming" "reproducible research"))])
+ (ob-php . [(20220221 1254) ((org (8))) "Execute PHP within org-mode source blocks." single ((:commit . "6ebf7799e9ded1d5114094f46785960a50000614") (:authors ("stardiviner" . "numbchild@gmail.com")) (:maintainer "stardiviner" . "numbchild@gmail.com") (:keywords "org" "babel" "php") (:url . "https://repo.or.cz/ob-php.git"))])
+ (ob-powershell . [(20220314 1359) ((emacs (26 1))) "Run Powershell from org mode source blocks" single ((:commit . "f351429590ed68b26a9c8f9847066ca4205e524b") (:authors ("Rob Kiggen" . "robby.kiggen@essential-it.be")) (:maintainer "Mois Moshev" . "mois.moshev@bottleshipvfx.com") (:keywords "powershell" "shell" "execute" "outlines" "processes") (:url . "https://github.com/rkiggen/ob-powershell"))])
+ (ob-prolog . [(20190410 2130) nil "org-babel functions for prolog evaluation." single ((:commit . "331899cfe345c934026c70b78352d320f7d8e239") (:authors ("Bjarte Johansen")) (:maintainer "Bjarte Johansen") (:keywords "literate programming" "reproducible research") (:url . "https://github.com/ljos/ob-prolog"))])
+ (ob-redis . [(20220221 1249) ((org (8))) "Execute Redis queries within org-mode blocks." single ((:commit . "44c83636ccbea0b3e9838b0180471905c30224c5") (:authors ("stardiviner" . "numbchild@gmail.com")) (:maintainer "stardiviner" . "numbchild@gmail.com") (:keywords "org" "babel" "redis") (:url . "https://repo.or.cz/ob-redis.git"))])
+ (ob-restclient . [(20220202 1609) ((restclient (0))) "org-babel functions for restclient-mode" single ((:commit . "586f1fa07f76aaca13cb3f86945759f4b9fb8db7") (:authors ("Alf Lervåg")) (:maintainer "Alf Lervåg") (:keywords "literate programming" "reproducible research") (:url . "https://github.com/alf/ob-restclient.el"))])
+ (ob-reticulate . [(20210214 2229) ((org (9 4)) (emacs (24 4))) "Babel Functions for reticulate" single ((:commit . "8109fb02fb6339b1cf9290df29fc0c1109a33c04") (:authors ("Jack Kamm")) (:maintainer "Jack Kamm") (:keywords "literate programming" "reproducible research" "r" "python" "statistics" "languages" "outlines" "processes") (:url . "https://github.com/jackkamm/ob-reticulate"))])
+ (ob-rust . [(20210204 244) nil "Org-babel functions for Rust" tar ((:commit . "30fe7e7181f44443d02e905dda77f83ec4944e76") (:authors ("Mican Zhang")) (:maintainer "Mican Zhang") (:keywords "rust" "languages" "org" "babel") (:url . "https://github.com/micanzhang/ob-rust"))])
+ (ob-sagemath . [(20191106 828) ((sage-shell-mode (0 0 8)) (s (1 8 0)) (emacs (24))) "org-babel functions for SageMath evaluation" tar ((:commit . "79645bce0c25a650bae61e550434bed836995dce") (:authors ("Sho Takemori" . "stakemorii@gmail.com")) (:maintainer "Sho Takemori" . "stakemorii@gmail.com") (:keywords "sagemath" "org-babel") (:url . "https://github.com/stakemori/ob-sagemath"))])
+ (ob-smiles . [(20220221 1255) ((smiles-mode (0 0 1)) (org (8))) "Org-mode Babel support for SMILES." single ((:commit . "d178f3d4a7e3c1ca9910f0a063d2a3cfd97d8609") (:authors (nil . "John Kitchin [jkitchin@andrew.cmu.edu]")) (:maintainer nil . "stardiviner [numbchild@gmail.com]") (:keywords "org" "babel" "smiles") (:url . "https://repo.or.cz/ob-smiles.git"))])
+ (ob-sml . [(20130829 1843) ((sml-mode (6 4))) "org-babel functions for template evaluation" single ((:commit . "958165c92b6cff6cada5c85c8ae5887806b8451b") (:authors ("David Nolen")) (:maintainer "David Nolen") (:keywords "literate programming" "reproducible research") (:url . "http://orgmode.org"))])
+ (ob-solidity . [(20220213 1910) ((emacs (24 4)) (solidity-mode (0 1 10))) "Org-babel functions for solidity evaluation" single ((:commit . "7e3e6cb2d7ec9269514e80248c7ec85c04dbbf89") (:authors ("hrkrshnn")) (:maintainer "hrkrshnn") (:keywords "solidity" "literate programming" "reproducible research" "languages") (:url . "https://github.com/hrkrshnn/ob-solidity"))])
+ (ob-spice . [(20220210 1415) ((spice-mode (0 0 1)) (org (8))) "org-babel functions for spice evaluation" single ((:commit . "6dc2c6b9391ea8dd8123224f6c282b673b89dc94") (:authors ("Tiago Oliveira Weber")) (:maintainer "stardiviner" . "numbchild@gmail.com") (:url . "https://repo.or.cz/ob-spice.git"))])
+ (ob-sql-mode . [(20190421 1539) ((emacs (24 4))) "SQL code blocks evaluated by sql-mode" single ((:commit . "b31a016585324ad91f1742ff6205bcb76f3ece6e") (:authors (nil . "Nik Clayton nik@google.com")) (:maintainer nil . "Nik Clayton nik@google.com") (:keywords "languages" "org" "org-babel" "sql") (:url . "http://github.com/nikclayton/ob-sql-mode"))])
+ (ob-svgbob . [(20190911 300) ((emacs (24))) "Babel Functions for svgbob" single ((:commit . "5747f96fb4fdb8711546b3313df9412177eb3c1a") (:authors ("Marcio Giaxa" . "i@mgxm.me")) (:maintainer "Marcio Giaxa" . "i@mgxm.me") (:keywords "tools" "files") (:url . "https://github.com/mgxm/ob-svgbob"))])
+ (ob-swift . [(20170921 1325) ((org (8))) "org-babel functions for swift evaluation" single ((:commit . "ed478ddbbe41ce5373efde06b4dd0c3663c9055f") (:authors ("Feng Zhou" . "zf.pascal@gmail.com")) (:maintainer "Feng Zhou" . "zf.pascal@gmail.com") (:keywords "org" "babel" "swift") (:url . "http://github.com/zweifisch/ob-swift"))])
+ (ob-swiftui . [(20210618 856) ((emacs (25 1)) (swift-mode (8 2 0)) (org (9 2 0))) "Org babel functions for SwiftUI evaluation" single ((:commit . "31cfe991eb171bb0d2f53cf621be1b9d91573ac3") (:authors ("Alvaro Ramirez")) (:maintainer "Alvaro Ramirez") (:url . "https://github.com/xenodium/ob-swiftui"))])
+ (ob-tmux . [(20190708 1202) ((emacs (25 1)) (seq (2 3)) (s (1 9 0))) "Babel Support for Interactive Terminal" single ((:commit . "3687ed7b874bdfe14617f5d14492887cb0836a85") (:authors ("Allard Hendriksen")) (:maintainer "Allard Hendriksen") (:keywords "literate programming" "interactive shell" "tmux") (:url . "https://github.com/ahendriksen/ob-tmux"))])
+ (ob-translate . [(20170720 1919) ((google-translate (0 11)) (org (8))) "Translation of text blocks in org-mode." single ((:commit . "9d9054a51bafd5a29a8135964069b4fa3a80b169") (:authors ("Kris Jenkins" . "krisajenkins@gmail.com")) (:maintainer "Kris Jenkins" . "krisajenkins@gmail.com") (:keywords "org" "babel" "translate" "translation") (:url . "https://github.com/krisajenkins/ob-translate"))])
+ (ob-typescript . [(20190910 946) ((emacs (24)) (org (8 0))) "org-babel functions for typescript evaluation" single ((:commit . "0b2766b9d136cd6d81f4c15f1ad4b28542f484b9") (:authors ("KURASHIKI Satoru")) (:maintainer "KURASHIKI Satoru") (:keywords "literate programming" "reproducible research" "typescript") (:url . "https://github.com/lurdan/ob-typescript"))])
+ (ob-uart . [(20170521 858) nil "org-babel support for UART communication" single ((:commit . "90daeac90a9e75c20cdcf71234c67b812110c50e") (:authors ("Andreas Müller")) (:maintainer "Andreas Müller") (:keywords "tools" "comm" "org-mode" "uart" "literate programming" "reproducible development") (:url . "https://www.0x7.ch"))])
+ (oberon . [(20120715 909) nil "Major mode for editing Oberon/Oberon-2 program texts" single ((:commit . "fb57d18ce13835a8a69b6bafecdd9193ca9a59a3") (:authors ("Karl Landström" . "karl@karllandstrom.se")) (:maintainer "Karl Landström" . "karl@karllandstrom.se") (:keywords "oberon" "oberon-2" "languages" "oop"))])
+ (obfusurl . [(20170809 1524) ((cl-lib (0 5))) "Obfuscate URLs so they aren't spoilers" single ((:commit . "7a5a41905000ce2ec1fd72509a5567e5fd9f47e5") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "convenience" "web" "text") (:url . "https://github.com/davep/obfusurl.el"))])
+ (objc-font-lock . [(20141021 1822) nil "Highlight Objective-C method calls." single ((:commit . "34b457d577f97ca94b8792d025f9a909c7610612") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "languages" "faces") (:url . "https://github.com/Lindydancer/objc-font-lock"))])
+ (objed . [(20200911 1435) ((emacs (25)) (cl-lib (0 5))) "Navigate and edit text objects." tar ((:commit . "70f9fb5e0aa1627b0afc7c6b3d0aea9bac70a210") (:authors ("Clemens Radermacher" . "clemera@posteo.net")) (:maintainer "Clemens Radermacher" . "clemera@posteo.net") (:keywords "convenience") (:url . "https://github.com/clemera/objed"))])
+ (oblivion-theme . [(20220507 1118) ((emacs (24 1))) "A port of GEdit oblivion theme" single ((:commit . "4129672f60d55c820adf260002476d038ac18165") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://codeberg.com/ideasman42/emacs-oblivion-theme"))])
+ (obsidian-theme . [(20170719 948) nil "port of the eclipse obsidian theme" single ((:commit . "f45efb2ebe9942466c1db6abbe2d0e6847b785ea") (:authors ("martin haesler")) (:maintainer "martin haesler") (:url . "http://github.com/mswift42/obsidian-theme"))])
+ (ocamlformat . [(20220307 1315) ((emacs (24 3))) "Utility functions to format ocaml code" single ((:commit . "c490e5b7c4b5f5e5848a5cbdb1e669588dfeaae3") (:keywords "languages" "ocaml") (:url . "https://github.com/ocaml-ppx/ocamlformat"))])
+ (occidental-theme . [(20130312 1958) nil "Custom theme for faces based on Adwaita" single ((:commit . "fd2db7256d4f78c43d99c3cddb1c39106d479816") (:authors ("William Stevenson" . "yhvh2000@gmail.com") ("Erik Timan" . "dev@timan.info")) (:maintainer "William Stevenson" . "yhvh2000@gmail.com") (:url . "http://github.com/olcai/occidental-theme"))])
+ (occur-context-resize . [(20210121 50) nil "dynamically resize context around matches in occur-mode" single ((:commit . "9d62a5b5c39ab7921dfc12dd0ab139b38dd16582") (:authors ("Charles L.G. Comstock" . "dgtized@gmail.com")) (:maintainer "Charles L.G. Comstock" . "dgtized@gmail.com") (:keywords "matching") (:url . "https://github.com/dgtized/occur-context-resize.el"))])
+ (occur-x . [(20130610 1343) nil "Extra functionality for occur" single ((:commit . "352f5fab207d8a1d3dd048073ff127a83e97c82b") (:authors ("Juan-Leon Lahoz" . "juanleon1@gmail.com")) (:maintainer "Juan-Leon Lahoz" . "juanleon1@gmail.com") (:keywords "occur" "search" "convenience"))])
+ (oceanic-theme . [(20161015 819) nil "Oceanic theme." single ((:commit . "a92ee9b470843c923e6cdcafdd65106ff994d04d") (:authors ("Tengfei Guo")) (:maintainer "Tengfei Guo") (:keywords "oceanic" "color" "theme") (:url . "https://github.com/terry3/oceanic-theme"))])
+ (ocodo-svg-modelines . [(20150516 1419) ((svg-mode-line-themes (0))) "A collection of beautiful SVG modelines" tar ((:commit . "c7b0789a177219f117c4de5659ecfa8622958c40") (:authors ("ocodo" . "what.is.ocodo@gmail.com")) (:maintainer "ocodo" . "what.is.ocodo@gmail.com") (:url . "https://github.com/ocodo/ocodo-svg-modelines"))])
+ (ocp-indent . [(20211019 907) nil "automatic indentation with ocp-indent" single ((:commit . "7c4d434132cebc15a8213c8be9e7323692eb0a2b") (:keywords "ocaml" "languages") (:url . "http://www.typerex.org/ocp-indent.html"))])
+ (octicons . [(20151101 340) ((cl-lib (0 5))) "octicons utility" tar ((:commit . "a61e561966ffd8faa3b48ce5b3a4eec10c59708b") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-octicons"))])
+ (octo-mode . [(20161008 1229) ((emacs (24))) "Major mode for Octo assembly language" single ((:commit . "bd4db7e5e3275b24c74e6a23c11d04f54e9feca5") (:authors ("John Olsson" . "john@cryon.se")) (:maintainer "John Olsson" . "john@cryon.se") (:keywords "languages") (:url . "https://github.com/cryon/octo-mode"))])
+ (octopress . [(20190123 107) nil "A lightweight wrapper for Jekyll and Octopress." tar ((:commit . "f2c92d5420f14fc9167c7de1873836510e652de2") (:authors ("Aaron Bieber" . "aaron@aaronbieber.com")) (:maintainer "Aaron Bieber" . "aaron@aaronbieber.com") (:keywords "octopress" "blog") (:url . "https://github.com/aaronbieber/octopress.el"))])
+ (oer-reveal . [(20220402 1505) ((emacs (24 4)) (org-re-reveal (3 1 0))) "OER with reveal.js, plugins, and org-re-reveal" tar ((:commit . "df7180a8d75dedb2fd8878843a3d3cc654be508d") (:authors ("Jens Lechtenbörger")) (:maintainer "Jens Lechtenbörger") (:keywords "hypermedia" "tools" "slideshow" "presentation" "oer") (:url . "https://gitlab.com/oer/oer-reveal"))])
+ (offlineimap . [(20150916 1158) nil "Run OfflineIMAP from Emacs" single ((:commit . "cc3e067e6237a1eb7b21c575a41683b1febb47f1") (:authors ("Julien Danjou" . "julien@danjou.info")) (:maintainer "Julien Danjou" . "julien@danjou.info") (:url . "http://julien.danjou.info/offlineimap-el.html"))])
+ (oj . [(20200811 517) ((emacs (26 1)) (quickrun (2 2))) "Competitive programming tools client for AtCoder, Codeforces" single ((:commit . "2dd65324ac9833e07eaed5fb04acebafc6d5cbd2") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience") (:url . "https://github.com/conao3/oj.el"))])
+ (ol-notmuch . [(20220428 1337) ((emacs (25 1)) (compat (28 1 1 0)) (notmuch (0 32)) (org (9 4 5))) "Links to notmuch messages" single ((:commit . "1a53d6c707514784cabf33d865b577bf77f45913") (:authors ("Matthieu Lemerre" . "racin@free.fr")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "hypermedia" "mail") (:url . "https://git.sr.ht/~tarsius/ol-notmuch"))])
+ (olc . [(20200818 1221) ((emacs (25 1))) "Open location code library" tar ((:commit . "d2dc62dbc3cf6460cc12bd96857a988bc80ac37e") (:authors ("David Byers" . "david.byers@liu.se")) (:maintainer "David Byers" . "david.byers@liu.se") (:keywords "extensions" "lisp") (:url . "https://gitlab.liu.se/davby02/olc"))])
+ (old-norse-input . [(20170816 1842) ((emacs (24))) "An input method for Old Norse" single ((:commit . "c2e21ee72c3768e9152aff6baf12a19cde1d0c53") (:authors ("David Christiansen" . "david@davidchristiansen.dk")) (:maintainer "David Christiansen" . "david@davidchristiansen.dk") (:keywords "languages") (:url . "https://github.com/david-christiansen/emacs-old-norse-input"))])
+ (oldlace-theme . [(20150705 1300) ((emacs (24))) "Emacs 24 theme with an 'oldlace' background." single ((:commit . "5c6f437203b0783b36a7aff4a578de4a0c8c4ee6") (:authors ("martin haesler")) (:maintainer "martin haesler"))])
+ (olivetti . [(20220330 635) ((emacs (24 4))) "Minor mode for a nice writing environment" single ((:commit . "8d287a80c5e3d72ac01b56c8afe60b01f18500b4") (:authors ("Paul W. Rankin" . "pwr@bydasein.com")) (:maintainer "Paul W. Rankin" . "pwr@bydasein.com") (:keywords "wp" "text") (:url . "https://github.com/rnkn/olivetti"))])
+ (om-mode . [(20140915 2110) nil "Insert Om component template with life cycle." single ((:commit . "cdc0c2912321f8438b0f3449ba8aca50ec150bba") (:authors ("Daniel Szmulewicz" . "daniel.szmulewicz@gmail.com")) (:maintainer "Daniel Szmulewicz" . "daniel.szmulewicz@gmail.com") (:keywords "clojurescript"))])
+ (omni-kill . [(20171016 2140) nil "Kill all the things" single ((:commit . "904549c8fd6ac3cf22b5d7111ca8944e179cffea") (:authors ("Adrien Becchis" . "adriean.khisbe@live.fr")) (:maintainer "Adrien Becchis" . "adriean.khisbe@live.fr") (:keywords "convenience" "editing" "tools"))])
+ (omni-log . [(20200304 2229) ((emacs (24)) (ht (2 0)) (s (1 6 1)) (dash (2 13 0))) "Logging utilities" tar ((:commit . "0a240660ccdd0b6588b4e3c322743b5ab1161338") (:authors ("Adrien Becchis" . "adriean.khisbe@live.fr")) (:maintainer "Adrien Becchis" . "adriean.khisbe@live.fr") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/AdrieanKhisbe/omni-log.el"))])
+ (omni-quotes . [(20200304 2341) ((dash (2 8)) (omni-log (0 4 0)) (f (0 19 0)) (s (1 11 0)) (ht (2 1))) "Random quotes displayer" tar ((:commit . "cfc7b7f01628a5d57384820d1096de4541e67cdf") (:authors ("Adrien Becchis" . "adriean.khisbe@live.fr")) (:maintainer "Adrien Becchis" . "adriean.khisbe@live.fr") (:keywords "convenience") (:url . "https://github.com/AdrieanKhisbe/omni-quotes.el"))])
+ (omni-scratch . [(20171009 2151) nil "Easy and mode-specific draft buffers" single ((:commit . "9eee3161e5cb6df58618548a2173f4da7d194814") (:authors ("Adrien Becchis" . "adriean.khisbe@live.fr")) (:maintainer "Adrien Becchis" . "adriean.khisbe@live.fr") (:keywords "convenience" "languages" "tools") (:url . "https://github.com/AdrieanKhisbe/omni-scratch.el"))])
+ (omni-tags . [(20170426 2109) ((pcre2el (1 7)) (cl-lib (0 5))) "Highlight and Actions for 'Tags'" tar ((:commit . "8f0f6c302fab900b7681e5c039f90850cbbabd33") (:authors ("Adrien Becchis" . "adriean.khisbe@live.fr")) (:maintainer "Adrien Becchis" . "adriean.khisbe@live.fr") (:keywords "convenience") (:url . "http://github.com/AdrieanKhisbe/omni-tags.el"))])
+ (omnibox . [(20180423 49) ((emacs (26 1)) (dash (2 13)) (frame-local (0 0 1))) "Selection package" single ((:commit . "8ee75c71c20c438ebc43ba24ef6f543633d118f3") (:authors ("Sebastien Chapuis" . "sebastien@chapu.is")) (:maintainer "Sebastien Chapuis" . "sebastien@chapu.is") (:keywords "completion" "selection" "convenience" "frames") (:url . "https://github.com/sebastiencs/omnibox"))])
+ (omnisharp . [(20210725 1955) ((emacs (24 4)) (flycheck (30)) (dash (2 12 0)) (auto-complete (1 4)) (popup (0 5 1)) (csharp-mode (0 8 7)) (cl-lib (0 5)) (s (1 10 0)) (f (0 19 0))) "Omnicompletion (intellisense) and more for C#" tar ((:commit . "e276ff140666057c6d6848f9cfc84a82e3a7650c") (:authors ("Mika Vilpas and others")) (:maintainer "Mika Vilpas and others") (:keywords "languages" "csharp" "c#" "ide" "auto-complete" "intellisense") (:url . "https://github.com/Omnisharp/omnisharp-emacs"))])
+ (omtose-phellack-theme . [(20161111 2120) nil "A dark theme, with cold bluish touch." tar ((:commit . "66f99633e199e65bd28641626435e8e59246529a"))])
+ (on-parens . [(20210928 1913) ((dash (2 10 0)) (emacs (24)) (evil (1 1 6)) (smartparens (1 6 3))) "smartparens wrapper to fit with evil-mode/vim normal-state" single ((:commit . "b8ee8cea45c9b34820fcb951f522f13e3736d216") (:authors ("William G Hatch")) (:maintainer "William G Hatch") (:keywords "evil" "smartparens"))])
+ (on-screen . [(20160302 950) ((cl-lib (0))) "guide your eyes while scrolling" single ((:commit . "206468aa4de299ad26c2db12b757f5ad7290912f") (:authors ("Michael Heerdegen" . "michael_heerdegen@web.de")) (:maintainer "Michael Heerdegen" . "michael_heerdegen@web.de") (:keywords "convenience") (:url . "https://github.com/michael-heerdegen/on-screen.el"))])
+ (one-themes . [(20200720 1444) ((emacs (24))) "One Colorscheme" tar ((:commit . "0e77d31f9fc0cd55f3d92ec0db79513d616b2efd") (:authors ("Balaji Sivaraman" . "balaji@balajisivaraman.com")) (:maintainer "Balaji Sivaraman" . "balaji@balajisivaraman.com") (:url . "http://github.com/balajisivaraman/emacs-one-themes"))])
+ (one-time-pad-encrypt . [(20160329 1513) nil "One time pad encryption within file" single ((:commit . "87cc1f124024ce3d277299ca0ac703f182937d9f") (:authors ("Garvin Guan" . "garvin.guan@gmail.com")) (:maintainer "Garvin Guan" . "garvin.guan@gmail.com") (:keywords "convenience") (:url . "https://github.com/garvinguan/emacs-one-time-pad/"))])
+ (opam . [(20150719 1220) ((emacs (24 1))) "OPAM tools" single ((:commit . "4d589de5765728f56af7078fae328b6792de8600") (:authors ("Sebastian Wiesner" . "swiesner@lunaryorn.com")) (:maintainer "Sebastian Wiesner" . "swiesner@lunaryorn.com") (:keywords "convenience") (:url . "https://github.com/lunaryorn/opam.el"))])
+ (open-in-msvs . [(20170123 2228) nil "Open current file:line:column in Microsoft Visual Studio" tar ((:commit . "e0d071c83188ad5db8f3297d6ce784b4ed554a04") (:authors ("Evgeny Panasyuk")) (:maintainer "Evgeny Panasyuk") (:keywords "convenience" "usability" "integration" "visual studio" "msvs" "ide") (:url . "https://github.com/evgeny-panasyuk/open-in-msvs"))])
+ (open-junk-file . [(20161210 1114) nil "Open a junk (memo) file to try-and-error" single ((:commit . "558bec7372b0fed4c4cb6074ab906535fae615bd") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "convenience" "tools") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/open-junk-file.el"))])
+ (opencc . [(20170722 816) ((emacs (24 4))) "中文简繁转换 <-> 中文簡繁轉換 (Convert Chinese with OpenCC)" single ((:commit . "8c539f72669ba9a99d8b5198db5ea930897ad1b9") (:authors ("徐春阳" . "mail@xuchunyang.me")) (:maintainer "徐春阳" . "mail@xuchunyang.me") (:keywords "chinese") (:url . "https://github.com/xuchunyang/emacs-opencc"))])
+ (opencl-mode . [(20201025 1656) nil "Syntax coloring for opencl kernels" single ((:commit . "15091eff92c33ee0d1ece40eb99299ef79fee92d") (:authors ("Salmane Bah" . "salmane.bah@u-bordeaux.fr")) (:maintainer "Salmane Bah" . "salmane.bah@u-bordeaux.fr") (:keywords "c" "opencl") (:url . "https://github.com/salmanebah/opencl-mode"))])
+ (opener . [(20161207 1810) ((request (0 2 0)) (emacs (24)) (cl-lib (0 5))) "opening urls as buffers" tar ((:commit . "c384f67278046fdcd220275fdd212ab85672cbeb") (:authors ("Tim Reddehase" . "tr@rightsrestricted.com")) (:maintainer "Tim Reddehase" . "tr@rightsrestricted.com") (:keywords "url" "http" "files") (:url . "https://github.com/0robustus1/opener.el"))])
+ (openfoam . [(20210516 1015) ((emacs (25 1))) "OpenFOAM files and directories" single ((:commit . "e2c899009a9df412bf9f360492b1072eb6f1513f") (:authors ("Ralph Schleicher" . "rs@ralph-schleicher.de")) (:maintainer "Ralph Schleicher" . "rs@ralph-schleicher.de") (:keywords "languages") (:url . "https://github.com/ralph-schleicher/emacs-openfoam"))])
+ (opensource . [(20160926 1616) ((s (1 11 0)) (dash (2 12 1)) (pkg-info (0 6 0)) (request (0 2 0))) "Client for Opensource API" tar ((:commit . "4c15049079878fcd386cca5dba20b99296a1de84") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "opensource") (:url . "https://github.com/OpenSourceOrg/el-opensourceorg"))])
+ (openstack-cgit-browse-file . [(20130819 927) nil "Browse the current file in OpenStack cgit" single ((:commit . "244219288b9aef41155044697bb114b7af83ab8f") (:authors ("Chmouel Boudjnah" . "chmouel@chmouel.com")) (:maintainer "Chmouel Boudjnah" . "chmouel@chmouel.com") (:keywords "convenience" "vc" "git" "cgit" "gerrit" "openstack") (:url . "https://github.com/chmouel/openstack-cgit-browse-file"))])
+ (openwith . [(20120531 2136) nil "Open files with external programs" single ((:commit . "1dc89670822966fab6e656f6519fdd7f01e8301a") (:authors ("Markus Triska" . "markus.triska@gmx.at")) (:maintainer "Markus Triska" . "markus.triska@gmx.at") (:keywords "files" "processes") (:url . "https://bitbucket.org/jpkotta/openwith"))])
+ (operate-on-number . [(20150707 623) nil "Operate on number at point with arithmetic functions" single ((:commit . "ceb3be565a29326c1098244fac0c50606723a56e") (:authors ("Akinori MUSHA" . "knu@iDaemons.org")) (:maintainer "Akinori MUSHA" . "knu@iDaemons.org") (:keywords "editing") (:url . "https://github.com/knu/operate-on-number.el"))])
+ (orca . [(20210828 1639) ((emacs (24 3)) (zoutline (0 1 0))) "Org Capture" single ((:commit . "47c03af0c1df2b679d800f3708d675a4c2a3e722") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "org" "convenience") (:url . "https://github.com/abo-abo/orca"))])
+ (orderless . [(20220418 2119) ((emacs (26 1))) "Completion style for matching regexps in any order" tar ((:commit . "75eeae21971d86b51a712ed8ecd6434463b2d866") (:authors ("Omar Antolín Camarena" . "omar@matem.unam.mx")) (:maintainer "Omar Antolín Camarena" . "omar@matem.unam.mx") (:keywords "extensions") (:url . "https://github.com/oantolin/orderless"))])
+ (ordinal . [(20210519 1442) ((emacs (24 3))) "Convert number to ordinal number notation" single ((:commit . "a7f378306290b6807fb6b87cee3ef79b31cec711") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "lisp") (:url . "https://github.com/zonuexe/ordinal.el"))])
+ (org-ac . [(20170401 1307) ((auto-complete-pcmp (0 0 1)) (log4e (0 2 0)) (yaxception (0 1))) "Some auto-complete sources for org-mode" single ((:commit . "41e3ef8e4039619d0370c23c66730b3b2e9e32ed") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "org" "completion") (:url . "https://github.com/aki2o/org-ac"))])
+ (org-agenda-property . [(20140626 2116) ((emacs (24 2))) "Display org properties in the agenda buffer." single ((:commit . "3b469f3e93de0036547f3631cd0366d53f7584c8") (:authors ("Artur Malabarba" . "bruce.connor.am@gmail.com")) (:maintainer "Artur Malabarba" . "bruce.connor.am@gmail.com") (:keywords "calendar") (:url . "http://github.com/Bruce-Connor/org-agenda-property"))])
+ (org-alert . [(20210922 125) ((org (9 0)) (alert (1 2))) "Notify org deadlines via notify-send" single ((:commit . "c039d0121d21e4558c0f5433135c839679b556d7") (:authors ("Stephen Pegoraro" . "spegoraro@tutive.com")) (:maintainer "Stephen Pegoraro" . "spegoraro@tutive.com") (:keywords "org" "org-mode" "notify" "notifications" "calendar") (:url . "https://github.com/spegoraro/org-alert"))])
+ (org-analyzer . [(20191001 1717) nil "org-analyzer is a tool that extracts time tracking data from org files." tar ((:commit . "19da62aa4dcf1090be8f574f6f2d4c7e116163a8") (:authors ("Robert Krahn" . "robert@kra.hn")) (:maintainer "Robert Krahn" . "robert@kra.hn") (:keywords "calendar") (:url . "https://github.com/rksm/clj-org-analyzer"))])
+ (org-anki . [(20220302 1706) ((emacs (27 1)) (request (0 3 2)) (dash (2 17)) (promise (1 1))) "Synchronize org-mode entries to Anki" single ((:commit . "c1790b1cdd2e5733cf64c7507a89da0b6179cf7d") (:authors ("Markus Läll" . "markus.l2ll@gmail.com")) (:maintainer "Markus Läll" . "markus.l2ll@gmail.com") (:keywords "outlines" "flashcards" "memory") (:url . "https://github.com/eyeinsky/org-anki"))])
+ (org-appear . [(20220405 1146) ((emacs (25 1)) (org (9 3))) "Auto-toggle Org elements" single ((:commit . "8dd1e564153d8007ebc4bb4e14250bde84e26a34") (:authors ("Alice Istleyeva" . "awth13@gmail.com")) (:maintainer "Alice Istleyeva" . "awth13@gmail.com") (:url . "https://github.com/awth13/org-appear"))])
+ (org-arbeitszeit . [(20220328 1951) ((emacs (27 1))) "Calculate your worktime" single ((:commit . "60e6adfe457bcc4ee47e3e5805b6b40544f98ee0") (:authors ("Benjamin Kästner" . "benjamin.kaestner@gmail.com")) (:maintainer "Benjamin Kästner" . "benjamin.kaestner@gmail.com") (:keywords "tools" "org" "calendar" "convenience") (:url . "https://github.com/bkaestner/org-arbeitszeit"))])
+ (org-attach-screenshot . [(20210221 1336) ((emacs (24 3))) "Screenshots integrated with org attachment dirs" single ((:commit . "55fa23e69c8ac4c40f8600300301a9cdc5c6732f") (:authors ("Derek Feichtinger" . "derek.feichtinger@psi.ch")) (:maintainer "Derek Feichtinger" . "derek.feichtinger@psi.ch") (:keywords "org" "multimedia") (:url . "https://github.com/dfeich/org-screenshot"))])
+ (org-auto-expand . [(20210923 243) ((emacs (26 1))) "Automatically expand certain headings" single ((:commit . "edc27b155befab5626dcf6ceec7938126f7e31d4") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "convenience" "outlines" "org") (:url . "https://github.com/alphapapa/org-auto-expand"))])
+ (org-auto-tangle . [(20211115 543) ((emacs (24 1)) (async (1 9 3))) "Automatically and Asynchronously tangles org files on save" single ((:commit . "5d9f2734c96166722c5057f3a2641ff8e08184cc") (:authors ("Yilkal Argaw")) (:maintainer "Yilkal Argaw") (:keywords "outlines") (:url . "https://github.com/yilkalargaw/org-auto-tangle"))])
+ (org-autolist . [(20211225 658) nil "Improved list management in org-mode" single ((:commit . "48666001f9ae1fdf9e295410d5a494e79284e2f7") (:authors ("Calvin Young")) (:maintainer "Calvin Young") (:keywords "lists" "checklists" "org-mode") (:url . "https://github.com/calvinwyoung/org-autolist"))])
+ (org-babel-eval-in-repl . [(20201206 1540) ((eval-in-repl (0 9 2)) (matlab-mode (3 3 6)) (ess (16 10)) (emacs (24))) "Eval org-mode babel code blocks in various REPLs." tar ((:commit . "3591f062873de2d64cc6f83b3555d030506e6ee7") (:authors ("Takeshi Teshima" . "diadochos.developer@gmail.com")) (:maintainer "Takeshi Teshima" . "diadochos.developer@gmail.com") (:keywords "literate programming" "reproducible research" "async execution") (:url . "https://github.com/diadochos/org-babel-eval-in-repl"))])
+ (org-beautify-theme . [(20170908 2218) nil "A sub-theme to make org-mode more beautiful." single ((:commit . "df6a1114fda313e1689363e196c8284fbe2a2738") (:authors ("Jonathan Arkell" . "jonnay@jonnay.net")) (:maintainer "Jonathan Arkell" . "jonnay@jonnay.net") (:keywords "org" "theme"))])
+ (org-board . [(20200619 1016) nil "bookmarking and web archival system for Org mode." single ((:commit . "1393bd46d11a81328ed4fb8471831415a3efe224") (:authors ("Charles A. Roelli " . "charles@aurox.ch")) (:maintainer "Charles A. Roelli " . "charles@aurox.ch") (:keywords "org" "bookmarks" "archives") (:url . "https://github.com/scallywag/org-board"))])
+ (org-bookmark-heading . [(20200103 514) ((emacs (24 4)) (f (0 17 2))) "Emacs bookmark support for org-mode" single ((:commit . "38a2813f72ff65f3ae91e2ebb23e0bbb42a8d1df") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "hypermedia" "outlines") (:url . "http://github.com/alphapapa/org-bookmark-heading"))])
+ (org-books . [(20210408 1913) ((enlive (0 0 1)) (s (1 11 0)) (helm (2 9 2)) (helm-org (1 0)) (dash (2 14 1)) (org (9 3)) (emacs (25))) "Reading list management with Org mode and helm" single ((:commit . "9f4ec4a981bfc5eebff993c3ad49a4bed26aebd1") (:authors ("Abhinav Tushar" . "abhinav@lepisma.xyz")) (:maintainer "Abhinav Tushar" . "abhinav@lepisma.xyz") (:keywords "outlines") (:url . "https://github.com/lepisma/org-books"))])
+ (org-brain . [(20210706 1519) ((emacs (25 1)) (org (9 2))) "Org-mode concept mapping" single ((:commit . "46ca9f766322cff31279ecdf02251ff24a0e9431") (:authors ("Erik Sjöstrand" . "sjostrand.erik@gmail.com")) (:maintainer "Erik Sjöstrand" . "sjostrand.erik@gmail.com") (:keywords "outlines" "hypermedia") (:url . "http://github.com/Kungsgeten/org-brain"))])
+ (org-bullets . [(20200317 1740) nil "Show bullets in org-mode as UTF-8 characters" single ((:commit . "767f55feb58b840a5a04eabfc3fbbf0d257c4792") (:authors ("sabof")) (:maintainer "D. Williams" . "d.williams@posteo.net") (:url . "https://github.com/integral-dw/org-bullets"))])
+ (org-caldav . [(20200510 2030) ((org (7))) "Sync org files with external calendar through CalDAV" single ((:commit . "8569941a0a5a9393ba51afc8923fd7b77b73fa7a") (:authors ("David Engster" . "deng@randomsample.de")) (:maintainer "David Engster" . "deng@randomsample.de") (:keywords "calendar" "caldav"))])
+ (org-capture-pop-frame . [(20160518 1008) ((emacs (24 4))) "Run org-capture in a new pop frame" single ((:commit . "b16fd712de62cf0d1f9befd03be6ab5983cb3301") (:authors ("Feng Shu" . "tumashu@163.com")) (:maintainer "Feng Shu" . "tumashu@163.com") (:url . "https://github.com/tumashu/org-capture-pop-frame.git"))])
+ (org-category-capture . [(20220114 730) ((org (9 0 0)) (emacs (24))) "Contextualy capture of org-mode TODOs." single ((:commit . "642b39c698db00bc535c1c2335f425fb9f4855a9") (:authors ("Ivan Malison" . "IvanMalison@gmail.com")) (:maintainer "Ivan Malison" . "IvanMalison@gmail.com") (:keywords "org-mode" "todo" "tools" "outlines") (:url . "https://github.com/IvanMalison/org-projectile"))])
+ (org-chef . [(20220422 300) ((org (0)) (emacs (24))) "Cookbook and recipe management with org-mode." tar ((:commit . "6a786e77e67a715b3cd4f5128b59d501614928af") (:authors ("Calvin Beck" . "hobbes@ualberta.ca")) (:maintainer "Calvin Beck" . "hobbes@ualberta.ca") (:keywords "convenience" "abbrev" "outlines" "org" "food" "recipes" "cooking") (:url . "https://github.com/Chobbes/org-chef"))])
+ (org-cliplink . [(20201126 1020) ((emacs (24 4))) "insert org-mode links from the clipboard" tar ((:commit . "13e0940b65d22bec34e2de4bc8cba1412a7abfbc") (:authors ("Alexey Kutepov" . "reximkut@gmail.com")) (:maintainer "Alexey Kutepov" . "reximkut@gmail.com") (:url . "http://github.com/rexim/org-cliplink"))])
+ (org-clock-convenience . [(20220503 530) ((org (8)) (emacs (24 3))) "Convenience functions for org time tracking" single ((:commit . "988d4e3c9f0ae6df098b0ab1985b79eed2c5b808") (:authors ("Derek Feichtinger <dfeich.gmail.com>")) (:maintainer "Derek Feichtinger <dfeich.gmail.com>") (:keywords "convenience") (:url . "https://github.com/dfeich/org-clock-convenience"))])
+ (org-clock-csv . [(20201222 1506) ((org (8 3)) (s (1 0))) "Export `org-mode' clock entries to CSV format." single ((:commit . "af94b58c2e179a5bcc938f339e93de0eee3da99c") (:authors ("Aaron Jacobs" . "atheriel@gmail.com")) (:maintainer "Aaron Jacobs" . "atheriel@gmail.com") (:keywords "calendar" "data" "org") (:url . "https://github.com/atheriel/org-clock-csv"))])
+ (org-clock-reminder . [(20211010 2139) ((emacs (26 1))) "Notifications that remind you about clocked-in tasks" tar ((:commit . "9f9b88348ffbc6628f2286dcb4c064b520d0a638") (:authors ("Nikolay Brovko" . "i@nickey.ru")) (:maintainer "Nikolay Brovko" . "i@nickey.ru") (:keywords "calendar" "convenience") (:url . "https://github.com/inickey/org-clock-reminder"))])
+ (org-clock-split . [(20200331 526) ((emacs (24))) "Split clock entries" single ((:commit . "39e1d2912a7a7223e2356a5fc4dff03507ae084d") (:authors ("Justin Taft <https://github.com/justintaft>")) (:maintainer "Justin Taft <https://github.com/justintaft>") (:keywords "calendar") (:url . "https://github.com/justintaft/emacs-org-clock-split"))])
+ (org-clock-today . [(20191204 1558) ((emacs (25))) "Show total clocked time of the current day in the mode line" single ((:commit . "e326a45b60e0fd4ca057f1d1dc3e99a516a5aa2f") (:authors ("Tijs Mallaerts" . "tijs.mallaerts@gmail.com")) (:maintainer "Tijs Mallaerts" . "tijs.mallaerts@gmail.com") (:url . "https://github.com/mallt/org-clock-today-mode"))])
+ (org-commentary . [(20160802 637) ((dash (2 0)) (emacs (24 4)) (org (8 0))) "generate or update conventional library headers using Org mode files" tar ((:commit . "821ccb994811359c42f4e3d459e0e88849d42b75") (:authors ("Sergei Maximov" . "s.b.maximov@gmail.com")) (:maintainer "Sergei Maximov" . "s.b.maximov@gmail.com") (:keywords "convenience" "docs" "tools") (:url . "https://github.com/smaximov/org-commentary"))])
+ (org-context . [(20210216 1526) nil "Contextual capture and agenda commands for Org-mode" single ((:commit . "a08f1f607f819791b9b95ad4f91c5eaa9fdbb091") (:authors ("Sylvain Rousseau <thisirs at gmail dot com>")) (:maintainer "Sylvain Rousseau <thisirs at gmail dot com>") (:keywords "org" "capture" "agenda" "convenience") (:url . "https://github.com/thisirs/org-context"))])
+ (org-cua-dwim . [(20120203 534) nil "Org-mode and Cua mode compatibility layer" single ((:commit . "a55d6c7009fc0b22f1110c07de629acc955c85e4") (:authors ("Matthew L. Fidler")) (:maintainer "Matthew L. Fidler") (:keywords "org-mode" "cua-mode"))])
+ (org-d20 . [(20210212 139) ((s (1 11 0)) (seq (2 19)) (dash (2 12 0)) (emacs (24))) "minor mode for d20 tabletop roleplaying games" single ((:commit . "e6149dcfbb6302d10109dd792fd0ffae7bfe2595") (:authors ("Sean Whitton" . "spwhitton@spwhitton.name")) (:maintainer "Sean Whitton" . "spwhitton@spwhitton.name") (:keywords "outlines" "games") (:url . "https://spwhitton.name/tech/code/org-d20/"))])
+ (org-dashboard . [(20171223 1924) ((cl-lib (0 5))) "Visually summarize progress in org files" single ((:commit . "02c0699771d199075a286e4502340ca6e7c9e831") (:authors ("Massimiliano Mirra" . "hyperstruct@gmail.com")) (:maintainer "Massimiliano Mirra" . "hyperstruct@gmail.com") (:keywords "outlines" "calendar") (:url . "http://github.com/bard/org-dashboard"))])
+ (org-doing . [(20161017 1620) nil "Keep track of what you're doing" tar ((:commit . "07ddbfc238cba31e4990c9b52e9a2757b39111da") (:authors ("Rudolf Olah")) (:maintainer "Rudolf Olah") (:keywords "tools" "org") (:url . "https://github.com/omouse/org-doing"))])
+ (org-dotemacs . [(20211126 2038) ((org (7 9 3)) (cl-lib (0 5))) "Store your emacs config as an org file, and choose which bits to load." single ((:commit . "598759f4a139f94da62836e8f8064da6377536b2") (:authors ("Joe Bloggs" . "vapniks@yahoo.com")) (:maintainer "Joe Bloggs" . "vapniks@yahoo.com") (:keywords "local") (:url . "https://github.com/vapniks/org-dotemacs"))])
+ (org-download . [(20210118 958) ((emacs (24 3)) (async (1 2))) "Image drag-and-drop for Org-mode." single ((:commit . "947ca223643d28e189480e607df68449c15786cb") (:authors ("Oleh Krehel")) (:maintainer "Oleh Krehel") (:keywords "multimedia" "images" "screenshots" "download") (:url . "https://github.com/abo-abo/org-download"))])
+ (org-dp . [(20180311 923) ((cl-lib (0 5))) "Declarative Local Programming with Org Elements" tar ((:commit . "e720f1c155a795a5b65a04790ad195c413449716") (:authors ("Thorsten Jolitz <tjolitz AT gmail DOT com>")) (:maintainer "Thorsten Jolitz <tjolitz AT gmail DOT com>") (:url . "https://github.com/tj64/org-dp"))])
+ (org-drill . [(20210427 2003) ((emacs (25 3)) (seq (2 14)) (org (9 3)) (persist (0 3))) "Self-testing using spaced repetition" single ((:commit . "bf8fe812d44a3ce3e84361fb39b8ef28ca10fd0c") (:authors ("Paul Sexton" . "eeeickythump@gmail.com")) (:maintainer "Phillip Lord" . "phillip.lord@russet.org.uk") (:keywords "games" "outlines" "multimedia") (:url . "https://gitlab.com/phillord/org-drill/issues"))])
+ (org-drill-table . [(20180115 1009) ((s (1 7 0)) (dash (2 2 0)) (cl-lib (0 3)) (org (8 2)) (emacs (24 1))) "Generate drill cards from org tables" single ((:commit . "2729aaa42c1e2720d9bf7bcc125e92dcf48b7f7d") (:authors ("Chris Barrett" . "chris.d.barrett@me.com")) (:maintainer "Chris Barrett" . "chris.d.barrett@me.com"))])
+ (org-dropbox . [(20150114 509) ((dash (2 2)) (names (20150000)) (emacs (24))) "move Dropbox notes from phone into org-mode datetree" single ((:commit . "75dab6d6f0438a7a8a18ccf3a5d55f50bf531f6e") (:authors ("Heikki Lehvaslaiho" . "heikki.lehvaslaiho@gmail.com")) (:maintainer "Heikki Lehvaslaiho" . "heikki.lehvaslaiho@gmail.com") (:keywords "dropbox" "android" "notes" "org-mode") (:url . "https://github.com/heikkil/org-dropbox"))])
+ (org-easy-img-insert . [(20160915 2008) ((emacs (24 4))) "An easier way to add images from the web in org mode" single ((:commit . "9f8aaa7f68ff1f0d8d7b1e9b618abb15002f971e") (:authors ("Tashrif Sanil" . "tashrifsanil@kloke-source.com")) (:maintainer "Tashrif Sanil" . "tashrifsanil@kloke-source.com") (:keywords "convenience" "hypermedia" "files") (:url . "https://github.com/tashrifsanil/org-easy-img-insert"))])
+ (org-edit-latex . [(20170908 1522) ((emacs (24 4)) (auctex (11 90))) "Edit embedded LaTeX in a dedicated buffer" single ((:commit . "1f228310ef2f3f2959a527f6d99e42ce977384c8") (:authors ("James Wong" . "jianwang.academic@gmail.com")) (:maintainer "James Wong" . "jianwang.academic@gmail.com") (:keywords "org" "latex") (:url . "https://github.com/et2010/org-edit-latex"))])
+ (org-ehtml . [(20220216 2054) ((web-server (20140109 2200)) (emacs (24 3))) "Export Org-mode files as editable web pages" tar ((:commit . "419932d6dbce193b0d90b1ccf9bf643169d21f52") (:authors ("Eric Schulte" . "schulte.eric@gmail.com")) (:maintainer "Eric Schulte" . "schulte.eric@gmail.com") (:keywords "org" "web-server" "javascript" "html"))])
+ (org-elisp-help . [(20161122 55) ((cl-lib (0 5)) (org (9 0))) "org links to emacs-lisp documentation" single ((:commit . "3e33ab1a2933dd7f2782ef91d667a37f12d633ab") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "org" "remember" "lisp") (:url . "https://github.com/tarsius/org-elisp-help"))])
+ (org-elp . [(20210329 1535) ((emacs (27 1))) "Preview latex equations in org mode while editing" single ((:commit . "36b5ab2ed3fa3b5917f058e3acf8dff2df69efae") (:authors ("Yilun Guan")) (:maintainer "Yilun Guan") (:keywords "lisp" "tex" "org") (:url . "https://github.com/guanyilun/org-elp"))])
+ (org-emms . [(20181010 1114) ((emacs (24))) "Play multimedia files from org-mode" single ((:commit . "07a8917f3d628c32e5de1dbd118ac08203772533") (:authors ("Jonathan Gregory <jgrg at autistici dot org>")) (:maintainer "Jonathan Gregory <jgrg at autistici dot org>") (:keywords "multimedia") (:url . "https://gitlab.com/jagrg/org-emms"))])
+ (org-evil . [(20210809 1724) ((dash (2 19 0)) (evil (0)) (org (9 4 4))) "Evil extensions for Org." tar ((:commit . "981b0931d043d3b0eb61fcab6258b5a88cc74d15") (:authors ("Ben Moon" . "software@guiltydolphin.com")) (:maintainer "Ben Moon" . "software@guiltydolphin.com") (:keywords "convenience" "evil" "org") (:url . "https://github.com/guiltydolphin/org-evil"))])
+ (org-fancy-priorities . [(20210830 1657) nil "Display org priorities as custom strings" single ((:commit . "7f677c6c14ecf05eab8e0efbfe7f1b00ae68eb1d") (:authors ("Harry Bournis" . "harrybournis@gmail.com")) (:maintainer "Harry Bournis" . "harrybournis@gmail.com") (:keywords "convenience" "faces" "outlines") (:url . "https://github.com/harrybournis/org-fancy-priorities"))])
+ (org-fragtog . [(20220110 2211) ((emacs (27 1))) "Auto-toggle Org LaTeX fragments" single ((:commit . "680606189d5d28039e6f9301b55ec80517a24005") (:authors ("Benjamin Levy" . "blevy@protonmail.com")) (:maintainer "Benjamin Levy" . "blevy@protonmail.com") (:url . "https://github.com/io12/org-fragtog"))])
+ (org-gamedb . [(20210525 2338) ((emacs (25 1))) "Track video games in org-mode with giantbomb.com's API" single ((:commit . "f283b6f6a7e8ad090405be57202caa3d3c424447") (:authors ("repelliuss <https://github.com/repelliuss>")) (:maintainer "repelliuss" . "repelliuss@gmail.com") (:keywords "outlines" "org" "games" "convenience" "api") (:url . "https://github.com/repelliuss/org-gamedb"))])
+ (org-gcal . [(20220324 1852) ((request (20190901)) (request-deferred (20181129)) (alert (0)) (persist (0)) (emacs (26)) (org (9 3))) "Org sync with Google Calendar" tar ((:commit . "554c48fb57dc46877202028019197b0699961ca0") (:authors ("myuhe <yuhei.maeda_at_gmail.com>")) (:maintainer "Raimon Grau" . "raimonster@gmail.com") (:keywords "convenience") (:url . "https://github.com/kidd/org-gcal.el"))])
+ (org-generate . [(20200815 736) ((emacs (26 1)) (org (9 3)) (mustache (0 23))) "Generate template files/folders from org document" single ((:commit . "98825efb73c4537f05f653ce40e639a220d2ee5d") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience") (:url . "https://github.com/conao3/org-generate.el"))])
+ (org-gnome . [(20150614 1457) ((alert (1 2)) (telepathy (0 1)) (gnome-calendar (0 1))) "Orgmode integration with the GNOME desktop" single ((:commit . "122e14cf6f8104150a65246a9a7c10e1d7939862") (:authors ("Nicolas Petton" . "petton.nicolas@gmail.com")) (:maintainer "Nicolas Petton" . "petton.nicolas@gmail.com") (:keywords "org" "gnome"))])
+ (org-grep . [(20151202 1229) ((cl-lib (0 5))) "Kind of M-x rgrep adapted for Org mode." single ((:commit . "5bdd04c0f53b8a3d656f36ea17bba3df7f0cb684") (:authors ("François Pinard" . "pinard@iro.umontreal.ca")) (:maintainer "François Pinard" . "pinard@iro.umontreal.ca") (:url . "https://github.com/pinard/org-grep"))])
+ (org-gtd . [(20220213 41) ((emacs (27 1)) (org-edna (1 1 2)) (f (0 20 0)) (org (9 3 1)) (org-agenda-property (1 3 1)) (transient (0 3 7))) "An implementation of GTD." tar ((:commit . "4e0fcf9a440e463d395f8f37efe8f1e691ed07dc") (:authors ("Aldric Giacomoni" . "trevoke@gmail.com")) (:maintainer "Aldric Giacomoni" . "trevoke@gmail.com") (:url . "https://github.com/Trevoke/org-gtd.el"))])
+ (org-id-cleanup . [(20220228 1653) ((org (9 3)) (dash (2 12)) (emacs (26 3))) "Interactively find, present and maybe clean up unused IDs of org-id" single ((:commit . "b6bf79465cd31d66b547704903b8ba5fcd6dd108") (:authors ("Marc Ihm" . "marc@ihm.name")) (:maintainer "Marc Ihm" . "marc@ihm.name") (:url . "https://github.com/marcIhm/org-id-cleanup"))])
+ (org-if . [(20150920 1513) nil "Interactive Fiction Authoring System for Org-Mode." tar ((:commit . "fab602cc1bbee7a4e99c0083e129219d3f9ed2e8") (:authors ("Philip Woods" . "elzairthesorcerer@gmail.com")) (:maintainer "Philip Woods" . "elzairthesorcerer@gmail.com") (:keywords "if" "org-if" "org org-mode"))])
+ (org-index . [(20220228 1651) ((org (9 3)) (dash (2 12)) (s (1 12)) (emacs (26 3))) "A personal adaptive index for org" single ((:commit . "9671cf059b681fac39ce910dd8847b5c7bfad170") (:authors ("Marc Ihm" . "1@2484.de")) (:maintainer "Marc Ihm" . "1@2484.de") (:url . "https://github.com/marcIhm/org-index"))])
+ (org-inline-anim . [(20211101 413) ((emacs (25 3)) (org (9 4))) "Inline playback of animated GIF/PNG for Org" single ((:commit . "ea7feb924c991f3a2cdc4a70fb176eaceae87938") (:authors ("Shigeaki Nishina")) (:maintainer "Shigeaki Nishina") (:keywords "org" "outlines" "hypermedia" "multimedia") (:url . "https://github.com/shg/org-inline-anim.el"))])
+ (org-inline-pdf . [(20220429 1012) ((emacs (25 1)) (org (9 4))) "Inline PDF previewing for Org" single ((:commit . "b790818ecbb85cd6dee44754935eb12153a79679") (:authors ("Shigeaki Nishina")) (:maintainer "Shigeaki Nishina") (:keywords "org" "outlines" "hypermedia") (:url . "https://github.com/shg/org-inline-pdf.el"))])
+ (org-iv . [(20171001 1022) ((impatient-mode (1 0 0)) (org (8 0)) (cl-lib (0 5))) "a tool used to view html (in browser) generated by org-file once the org-file changes" tar ((:commit . "7f2bb1b32647655fd9d6684f6f09dcc66b61b0cd") (:authors ("kuangdash" . "kuangdash@163.com")) (:maintainer "kuangdash" . "kuangdash@163.com") (:url . "https://github.com/kuangdash/org-iv"))])
+ (org-jira . [(20220509 2058) ((emacs (24 5)) (cl-lib (0 5)) (request (0 2 0)) (dash (2 14 1))) "Syncing between Jira and Org-mode." tar ((:commit . "c0c0086419b4e68bb45bf609931916d6d8ae48a2") (:maintainer "Matthew Carter" . "m@ahungry.com") (:keywords "ahungry" "jira" "org" "bug" "tracker") (:url . "https://github.com/ahungry/org-jira"))])
+ (org-journal . [(20220408 629) ((emacs (25 1)) (org (9 1))) "a simple org-mode based journaling mode" single ((:commit . "839a2e19865a03bec30ef32431f981f33880a754") (:authors ("Bastian Bechtold") ("Christian Schwarzgruber")) (:maintainer "Bastian Bechtold") (:url . "http://github.com/bastibe/org-journal"))])
+ (org-journal-list . [(20190221 2052) ((emacs (25))) "Org mode Journal List" single ((:commit . "2b26d00181bb49bff64b31ad020490acd1b6ae02") (:authors ("Huy Tran" . "huytd189@gmail.com")) (:maintainer "Huy Tran" . "huytd189@gmail.com") (:url . "https://github.com/huytd/org-journal-list"))])
+ (org-journal-tags . [(20220416 1507) ((emacs (27 1)) (org-journal (2 1 2)) (magit-section (3 3 0)) (transient (0 3 7))) "Tagging and querying system of org-journal" single ((:commit . "ca6327161f4994ea0e98d7c6c3f662222e2650bf") (:authors ("Korytov Pavel" . "thexcloud@gmail.com")) (:maintainer "Korytov Pavel" . "thexcloud@gmail.com") (:url . "https://github.com/SqrtMinusOne/org-journal-tags"))])
+ (org-kanban . [(20220218 1845) ((s (0)) (dash (2 17 0)) (emacs (24 4)) (org (9 1))) "kanban dynamic block for org-mode." single ((:commit . "5310e208d151f460f9b7e3961b4796842e91a3ae") (:authors ("Christian Köstlin" . "christian.koestlin@gmail.com")) (:maintainer "Christian Köstlin" . "christian.koestlin@gmail.com") (:keywords "org-mode" "org" "kanban" "tools") (:url . "http://github.com/gizmomogwai/org-kanban"))])
+ (org-kindle . [(20220210 1408) ((emacs (25)) (cl-lib (0 5)) (seq (2 20))) "Send org link file to ebook reader." single ((:commit . "fadcfd62e254d0c45e87d63128a82a08ae21869a") (:keywords "org" "link" "ebook" "kindle" "epub" "azw3" "mobi") (:url . "https://repo.or.cz/org-kindle.git"))])
+ (org-latex-impatient . [(20210409 2251) ((emacs (26)) (s (1 8 0)) (posframe (0 8 0)) (org (9 3)) (dash (2 17 0))) "Preview org-latex Fragments Instantly via MathJax" single ((:commit . "832bbb9bbdee8b58170c984ead487f3ad612820c") (:authors ("Sheng Yang" . "styang@fastmail.com")) (:maintainer "Sheng Yang" . "styang@fastmail.com") (:keywords "tex" "tools") (:url . "https://github.com/yangsheng6810/org-latex-instant-preview"))])
+ (org-link-beautify . [(20220503 458) ((emacs (27 1)) (all-the-icons (4 0 0))) "Beautify Org Links" single ((:commit . "b20e296b497360de12d5d973aa273cab70c77126") (:keywords "hypermedia") (:url . "https://repo.or.cz/org-link-beautify.git"))])
+ (org-link-travis . [(20140405 2327) ((org (7))) "Insert/Export the link of Travis CI on org-mode" single ((:commit . "596615ad8373d9090bd4138da683524f0ad0bda5") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "org") (:url . "https://github.com/aki2o/org-link-travis"))])
+ (org-linkotron . [(20200112 2235) ((emacs (26 1)) (org (9 3))) "Org-mode link selector" tar ((:commit . "d0adc5247b205bc73d2f1a83d4a512d2be541eb5") (:authors ("Per Weijnitz" . "per.weijnitz@gmail.com")) (:maintainer "Per Weijnitz" . "per.weijnitz@gmail.com") (:keywords "hypermedia" "org") (:url . "https://gitlab.com/perweij/org-linkotron"))])
+ (org-listcruncher . [(20210706 1741) ((seq (2 3)) (emacs (26 1))) "Planning tool - Parse Org mode lists into table" single ((:commit . "075e0e6d36eb50406a608bc8a2f0dd359ec63938") (:authors ("Derek Feichtinger" . "dfeich@gmail.com")) (:maintainer "Derek Feichtinger" . "dfeich@gmail.com") (:keywords "convenience") (:url . "https://github.com/dfeich/org-listcruncher"))])
+ (org-make-toc . [(20200409 1436) ((emacs (26 1)) (dash (2 12)) (s (1 10 0)) (org (9 0))) "Automatic tables of contents for Org files" single ((:commit . "26fbd6a7e1e7f8e473fe3a5f74faec715c3a05aa") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "org" "convenience") (:url . "http://github.com/alphapapa/org-make-toc"))])
+ (org-mime . [(20220204 42) ((emacs (25 1))) "org html export for text/html MIME emails" single ((:commit . "98504d043c8421ac390b7358b146733c7c0b4479") (:authors ("Eric Schulte")) (:maintainer "Chen Bin (redguardtoo)") (:keywords "mime" "mail" "email" "html") (:url . "http://github.com/org-mime/org-mime"))])
+ (org-mind-map . [(20180826 2340) ((emacs (24)) (dash (1 8 0)) (org (8 2 10))) "Creates a directed graph from org-mode files" single ((:commit . "95347b2f9291f5c5eb6ebac8e726c03634c61de3") (:authors ("Ted Wiles" . "theodore.wiles@gmail.com")) (:maintainer "Ted Wiles" . "theodore.wiles@gmail.com") (:keywords "orgmode" "extensions" "graphviz" "dot") (:url . "https://github.com/theodorewiles/org-mind-map"))])
+ (org-ml . [(20211231 700) ((emacs (26 1)) (org (9 3)) (dash (2 17)) (s (1 12))) "Functional Org Mode API" tar ((:commit . "3974435bbf72722801f7ed78855381d77a773162") (:authors ("Nathan Dwarshuis" . "ndwar@yavin4.ch")) (:maintainer "Nathan Dwarshuis" . "ndwar@yavin4.ch") (:keywords "org-mode" "outlines") (:url . "https://github.com/ndwarshuis/org-ml"))])
+ (org-mobile-sync . [(20180606 524) ((emacs (24 3 50)) (org (8 0))) "automatically sync org-mobile on changes" single ((:commit . "06764b943a528827df1e2acc6bc7806cc2c1351f") (:authors ("steckerhalter")) (:maintainer "steckerhalter") (:keywords "org-mode" "org" "mobile" "sync" "todo") (:url . "https://framagit.org/steckerhalter/org-mobile-sync"))])
+ (org-modern . [(20220422 940) ((emacs (27 1))) "Modern looks for Org" single ((:commit . "ff1046705b3950b7a49da50bc34c11da86c6226d") (:authors ("Daniel Mendler" . "mail@daniel-mendler.de")) (:maintainer "Daniel Mendler" . "mail@daniel-mendler.de") (:url . "https://github.com/minad/org-modern"))])
+ (org-movies . [(20210920 101) ((emacs (26 1)) (org (9 0)) (request (0 3 0))) "Manage watchlist with Org mode" single ((:commit . "e96fecaffa2924de64a507aa31d2934e667ee1ea") (:authors ("Anh T Nguyen")) (:maintainer "Anh T Nguyen") (:keywords "hypermedia" "outlines" "org") (:url . "https://github.com/teeann/org-movies"))])
+ (org-mru-clock . [(20211029 1147) ((emacs (26 1))) "Clock in/out of tasks with completion and persistent history" single ((:commit . "a74322f0cfd6e52151f9bb8d4f90833330f69120") (:authors ("Kevin Brubeck Unhammer" . "unhammer@fsfe.org")) (:maintainer "Kevin Brubeck Unhammer" . "unhammer@fsfe.org") (:keywords "convenience" "calendar") (:url . "https://github.com/unhammer/org-mru-clock"))])
+ (org-msg . [(20220331 1707) ((emacs (24 4)) (htmlize (1 54))) "Org mode to send and reply to email in HTML." single ((:commit . "60e22e446325a9b3387396459d98be7c1c52579d") (:authors ("Jérémy Compostella" . "jeremy.compostella@gmail.com")) (:maintainer "Jérémy Compostella" . "jeremy.compostella@gmail.com") (:keywords "extensions" "mail") (:url . "https://github.com/jeremy-compostella/org-msg"))])
+ (org-multi-wiki . [(20210324 1820) ((emacs (26 1)) (dash (2 12)) (s (1 12)) (org-ql (0 5)) (org (9 3))) "Multiple wikis based on Org mode" single ((:commit . "bf8039aadddaf02569fab473f766071ef7e63563") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:keywords "org" "outlines" "files") (:url . "https://github.com/akirak/org-multi-wiki"))])
+ (org-multiple-keymap . [(20191017 1920) ((org (8 2 4)) (emacs (24)) (cl-lib (0 5))) "Set keymap to elements, such as timestamp and priority." single ((:commit . "4eb8aa0aada012b2346cc7f0c55e07783141a2c3") (:authors ("myuhe <yuhei.maeda_at_gmail.com>")) (:maintainer "myuhe") (:keywords "convenience" "org-mode") (:url . "https://github.com/myuhe/org-multiple-keymap.el"))])
+ (org-notebook . [(20170322 452) ((emacs (24)) (org (8)) (cl-lib (0 5))) "Ease the use of org-mode as a notebook" single ((:commit . "86042d866bf441e2c9bb51f995e5994141b78517") (:authors ("Paul Elder" . "paul.elder@amanokami.net")) (:maintainer "Paul Elder" . "paul.elder@amanokami.net") (:keywords "convenience" "tools"))])
+ (org-noter . [(20191020 1212) ((emacs (24 4)) (cl-lib (0 6)) (org (9 0))) "A synchronized, Org-mode, document annotator" single ((:commit . "9ead81d42dd4dd5074782d239b2efddf9b8b7b3d") (:authors (nil . "Gonçalo Santos (aka. weirdNox@GitHub)")) (:maintainer nil . "Gonçalo Santos (aka. weirdNox@GitHub)") (:keywords "lisp" "pdf" "interleave" "annotate" "external" "sync" "notes" "documents" "org-mode") (:url . "https://github.com/weirdNox/org-noter"))])
+ (org-noter-pdftools . [(20220320 300) ((emacs (26 1)) (org (9 4)) (pdf-tools (0 8)) (org-pdftools (1 0)) (org-noter (1 4 1))) "Integration between org-pdftools and org-noter" single ((:commit . "967f48fb5038bba32915ee9da8dc4e8b10ba3376") (:authors ("Alexander Fu Xi" . "fuxialexander@gmail.com")) (:maintainer "Alexander Fu Xi" . "fuxialexnader@gmail.com") (:keywords "convenience") (:url . "https://github.com/fuxialexander/org-pdftools"))])
+ (org-notifications . [(20210918 1827) ((emacs (25 1)) (org (9 0)) (sound-wav (0 2)) (alert (1 2)) (seq (2 21))) "Creates notifications for org-mode entries" tar ((:commit . "b8032f8adfbeb328962a5657c6dd173e64cc76e5") (:authors ("doppelc")) (:maintainer "doppelc") (:keywords "outlines") (:url . "https://github.com/doppelc/org-notifications"))])
+ (org-octopress . [(20170821 415) ((org (9 0)) (orglue (0 1)) (ctable (0 1 1))) "Compose octopress articles using org-mode." tar ((:commit . "38598ef98d04076a8eb78d549907ddfde8d3a652") (:authors ("Yoshinari Nomura" . "nom@quickhack.net")) (:maintainer "Yoshinari Nomura" . "nom@quickhack.net") (:keywords "org" "jekyll" "octopress" "blog"))])
+ (org-onenote . [(20171008 500) ((oauth2 (0 11)) (request (0 2 0)) (org (8 2 10))) "export org-mode document to onenote." single ((:commit . "5ce5cf4edb143180e0b185ac26826d39ae5bc929") (:authors ("Frei Zhang" . "ifree0@gmail.com")) (:maintainer "Frei Zhang" . "ifree0@gmail.com") (:keywords "tools" "docs" "org-mode" "onenote") (:url . "https://github.com/ifree/org-onenote"))])
+ (org-outline-numbering . [(20180705 1501) ((emacs (24)) (org (8 3)) (cl-lib (0 6)) (ov (1 0 6))) "Show outline numbering as overlays in org-mode" single ((:commit . "22014917dd7e751c46fa13e1e836c2d0265ce82f") (:authors ("Anders Johansson")) (:maintainer "Anders Johansson") (:keywords "wp" "convenience") (:url . "https://gitlab.com/andersjohansson/org-outline-numbering"))])
+ (org-outlook . [(20160705 1338) nil "Outlook org" tar ((:commit . "ec32d8d9d8ffd17e6de4de0b52fc3f5ad9b4cc0d") (:authors ("Matthew L. Fidler")) (:maintainer "Matthew L. Fidler") (:keywords "org-outlook") (:url . "https://github.com/mlf176f2/org-outlook.el"))])
+ (org-page . [(20170807 224) ((ht (1 5)) (simple-httpd (1 4 6)) (mustache (0 22)) (htmlize (1 47)) (org (8 0)) (dash (2 0 0)) (cl-lib (0 5)) (git (0 1 1))) "a static site generator based on org mode" tar ((:commit . "b25c3ef41da233306c157634c1f0b019d8b6adc0") (:authors ("Kelvin Hu <ini DOT kelvin AT gmail DOT com>")) (:maintainer "Kelvin Hu <ini DOT kelvin AT gmail DOT com>") (:keywords "org-mode" "convenience" "beautify") (:url . "https://github.com/kelvinh/org-page"))])
+ (org-parser . [(20200417 301) ((emacs (25 1)) (dash (2 12 0)) (ht (2 1))) "parse org files into structured datatypes." single ((:commit . "fd4cb7035ff649378cc968b1ec2c386b5c565706") (:keywords "files" "outlines" "tools") (:url . "https://hg.sr.ht/~zck/org-parser"))])
+ (org-pdftools . [(20220320 301) ((emacs (26 1)) (org (9 3 6)) (pdf-tools (0 8)) (org-noter (1 4 1))) "Support for links to documents in pdfview mode" single ((:commit . "967f48fb5038bba32915ee9da8dc4e8b10ba3376") (:authors ("Alexander Fu Xi" . "fuxialexander@gmail.com")) (:maintainer "Alexander Fu Xi" . "fuxialexnader@gmail.com") (:keywords "convenience") (:url . "https://github.com/fuxialexander/org-pdftools"))])
+ (org-picklink . [(20210210 516) ((emacs (24 4))) "Pick a headline link from org-agenda" single ((:commit . "bfdc22b436482752be41c5d6f6f37dca76b1c7c3") (:authors ("Feng Shu" . "tumashu@163.com")) (:maintainer "Feng Shu" . "tumashu@163.com") (:keywords "convenience") (:url . "https://github.com/tumashu/org-picklink"))])
+ (org-pivotal . [(20210705 408) ((a (0 1 1)) (dash (2 18 0)) (emacs (26 1)) (request (0 3 0))) "Sync Pivotal Tracker to org buffer" tar ((:commit . "6403cefb8440567fc593a8d267536138cd6165e2") (:authors ("Huy Duong" . "qhuyduong@hotmail.com")) (:maintainer "Huy Duong" . "qhuyduong@hotmail.com") (:url . "https://github.com/org-pivotal/org-pivotal"))])
+ (org-pomodoro . [(20220318 1618) ((alert (0 5 10)) (cl-lib (0 5))) "Pomodoro implementation for org-mode." tar ((:commit . "3f5bcfb80d61556d35fc29e5ddb09750df962cc6") (:authors ("Arthur Leonard Andersen" . "leoc.git@gmail.com")) (:maintainer "Arthur Leonard Andersen" . "leoc.git@gmail.com") (:url . "https://github.com/lolownia/org-pomodoro"))])
+ (org-present . [(20220108 1802) ((org (7))) "Minimalist presentation minor-mode for Emacs org-mode." single ((:commit . "c0f1f36b2384b58b00a2000f2e30895a6230bb6b") (:authors ("Ric Lister")) (:maintainer "Ric Lister") (:url . "https://github.com/rlister/org-present"))])
+ (org-pretty-tags . [(20211228 1546) ((emacs (25))) "Surrogates for tags" single ((:commit . "e127a1e08df8273b909a99594ffaad84960ff212") (:authors ("Marco Wahl" . "marcowahlsoft@gmail.com")) (:maintainer "Marco Wahl" . "marcowahlsoft@gmail.com") (:keywords "reading" "outlines") (:url . "https://gitlab.com/marcowahl/org-pretty-tags"))])
+ (org-preview-html . [(20220228 414) ((emacs (25 1)) (org (8 0))) "Automatically preview org-exported HTML files within Emacs" single ((:commit . "cb85524d5090b8189e965cc49d65be04650c17c4") (:authors ("Jake B" . "jakebox0@protonmail.com")) (:maintainer "Jake B" . "jakebox0@protonmail.com") (:keywords "org" "convenience" "outlines") (:url . "https://github.com/jakebox/org-preview-html"))])
+ (org-projectile . [(20220114 730) ((projectile (0 11 0)) (dash (2 10 0)) (emacs (24)) (s (1 9 0)) (org-category-capture (0 0 0))) "Repository todo management for org-mode" single ((:commit . "642b39c698db00bc535c1c2335f425fb9f4855a9") (:authors ("Ivan Malison" . "IvanMalison@gmail.com")) (:maintainer "Ivan Malison" . "IvanMalison@gmail.com") (:keywords "org-mode" "projectile" "todo" "tools" "outlines") (:url . "https://github.com/IvanMalison/org-projectile"))])
+ (org-projectile-helm . [(20180601 1822) ((org-projectile (1 0 0)) (helm (2 3 1)) (emacs (25))) "helm functions for org-projectile" single ((:commit . "642b39c698db00bc535c1c2335f425fb9f4855a9") (:authors ("Ivan Malison" . "IvanMalison@gmail.com")) (:maintainer "Ivan Malison" . "IvanMalison@gmail.com") (:keywords "org" "projectile" "todo" "helm" "outlines") (:url . "https://github.com/IvanMalison/org-projectile"))])
+ (org-protocol-jekyll . [(20170328 1639) ((cl-lib (0 5))) "Jekyll's handler for org-protocol" single ((:commit . "dec064a42d6dfe81dfde7ba59ece5ca103ac6334") (:authors ("Vladimir S. Ivanov" . "ivvl82@gmail.com")) (:maintainer "Vladimir S. Ivanov" . "ivvl82@gmail.com"))])
+ (org-ql . [(20220318 1534) ((emacs (26 1)) (dash (2 18 1)) (f (0 17 2)) (map (2 1)) (org (9 0)) (org-super-agenda (1 2)) (ov (1 0 6)) (peg (1 0)) (s (1 12 0)) (transient (0 1)) (ts (0 2 -1))) "Org Query Language, search command, and agenda-like view" tar ((:commit . "46f523d94a376b168176c75bbd0e3e0d00e61170") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "hypermedia" "outlines" "org" "agenda") (:url . "https://github.com/alphapapa/org-ql"))])
+ (org-radiobutton . [(20210519 1225) ((dash (2 13 0)) (emacs (24))) "Radiobutton for org-mode lists." single ((:commit . "86d7581202a37d2004589b8c8e9d8638806c6bcc") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "outlines") (:url . "https://github.com/Fuco1/org-radiobutton"))])
+ (org-random-todo . [(20190214 2057) ((emacs (24 3)) (alert (1 3))) "show a random TODO (with alert) every so often" single ((:commit . "a019c7186ec60c8c7c3657914cdce029811cf4e0") (:authors ("Kevin Brubeck Unhammer" . "unhammer@fsfe.org")) (:maintainer "Kevin Brubeck Unhammer" . "unhammer@fsfe.org") (:keywords "org" "todo" "notification" "calendar") (:url . "https://github.com/unhammer/org-random-todo"))])
+ (org-randomnote . [(20200110 1407) ((f (0 19 0)) (dash (2 12 0)) (org (0))) "Find a random note in your Org-Mode files" single ((:commit . "ea8cf4385970637efffff8f79e14576ba6d7ad13") (:authors ("Michael Fogleman" . "michaelwfogleman@gmail.com")) (:maintainer "Michael Fogleman" . "michaelwfogleman@gmail.com") (:url . "http://github.com/mwfogleman/org-randomnote"))])
+ (org-re-reveal . [(20220402 1456) ((emacs (24 4)) (org (8 3)) (htmlize (1 34))) "Org export to reveal.js presentations" tar ((:commit . "c787ebf93d51b63b8726df241e3e2fcda35d4ae1") (:keywords "tools" "outlines" "hypermedia" "slideshow" "presentation" "oer") (:url . "https://gitlab.com/oer/org-re-reveal"))])
+ (org-re-reveal-citeproc . [(20211028 1328) ((emacs (25 1)) (org (9 5)) (citeproc (0 9)) (org-re-reveal (3 0 0))) "Citations and bibliography for org-re-reveal" tar ((:commit . "faa9ea387917b20bd1499ad90199ff3d417c00c2") (:authors ("Jens Lechtenbörger")) (:maintainer "Jens Lechtenbörger") (:keywords "hypermedia" "tools" "slideshow" "presentation" "bibliography") (:url . "https://gitlab.com/oer/org-re-reveal-citeproc"))])
+ (org-re-reveal-ref . [(20211029 551) ((emacs (25 1)) (org-ref (1 1 1)) (org-re-reveal (0 9 3))) "Citations and bibliography for org-re-reveal" tar ((:commit . "ea9661864d5fbef87b12b78f516c13a40c683f24") (:authors ("Jens Lechtenbörger")) (:maintainer "Jens Lechtenbörger") (:keywords "hypermedia" "tools" "slideshow" "presentation" "bibliography") (:url . "https://gitlab.com/oer/org-re-reveal-ref"))])
+ (org-recent-headings . [(20211011 1519) ((emacs (26 1)) (org (9 0 5)) (dash (2 18 0)) (frecency (0 1)) (s (1 12 0))) "Jump to recently used Org headings" single ((:commit . "97418d581ea030f0718794e50b005e9bae44582e") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "hypermedia" "outlines" "org") (:url . "http://github.com/alphapapa/org-recent-headings"))])
+ (org-recur . [(20211007 238) ((emacs (24)) (org (9 0))) "Recurring org-mode tasks" single ((:commit . "2bdf71d79f11afa3777c6542f84cef4ad3fce916") (:authors ("Marcin Swieczkowski" . "marcin.swieczkowski@gmail.com")) (:maintainer "Marcin Swieczkowski" . "marcin.swieczkowski@gmail.com") (:url . "https://github.com/m-cat/org-recur"))])
+ (org-redmine . [(20160711 1114) nil "Redmine tools using Emacs OrgMode" single ((:commit . "e77d013bc3784947c46a5c53f03cd7d3c68552fc") (:authors ("Wataru MIYAGUNI" . "gonngo@gmail.com")) (:maintainer "Wataru MIYAGUNI" . "gonngo@gmail.com") (:keywords "redmine" "org") (:url . "https://github.com/gongo/org-redmine"))])
+ (org-ref . [(20220509 1414) ((org (9 4)) (dash (0)) (s (0)) (f (0)) (htmlize (0)) (hydra (0)) (avy (0)) (parsebib (0)) (bibtex-completion (0)) (citeproc (0))) "citations, cross-references and bibliographies in org-mode" tar ((:commit . "0d2355d1eb4dcac1095a03d885788a12fe566610") (:authors ("John Kitchin" . "jkitchin@andrew.cmu.edu")) (:maintainer "John Kitchin" . "jkitchin@andrew.cmu.edu") (:keywords "org-mode" "cite" "ref" "label") (:url . "https://github.com/jkitchin/org-ref"))])
+ (org-ref-prettify . [(20220507 649) ((emacs (24 3)) (org-ref (3 0)) (bibtex-completion (1 0 0))) "Prettify org-ref citation links" single ((:commit . "0ec3b6e398ee117c8b8a787a0422b95d9e95f7bb") (:authors ("Alex Kost" . "alezost@gmail.com") ("Vitus Schäfftlein" . "vitusschaefftlein@live.de")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "convenience") (:url . "https://github.com/alezost/org-ref-prettify.el"))])
+ (org-repo-todo . [(20171228 119) nil "Simple repository todo management with org-mode" single ((:commit . "f73ebd91399c5760ad52c6ad9033de1066042003") (:authors ("justin talbott" . "justin@waymondo.com")) (:maintainer "justin talbott" . "justin@waymondo.com") (:keywords "convenience") (:url . "https://github.com/waymondo/org-repo-todo"))])
+ (org-reverse-datetree . [(20220310 1646) ((emacs (26 1)) (dash (2 12)) (org (9 3))) "Create reverse date trees in org-mode" single ((:commit . "9ebd42b521e7adf26a35cbb17144113a83f73264") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:keywords "outlines") (:url . "https://github.com/akirak/org-reverse-datetree"))])
+ (org-review . [(20220411 1205) nil "schedule reviews for Org entries" single ((:commit . "466f7d8f183f226f1e665cf806cb094471903d9c") (:authors ("Alan Schmitt" . "alan.schmitt@polytechnique.org")) (:maintainer "Alan Schmitt" . "alan.schmitt@polytechnique.org") (:keywords "org" "review") (:url . "https://github.com/brabalan/org-review"))])
+ (org-rich-yank . [(20220227 2154) ((emacs (24 4))) "Paste with org-mode markup and link to source" single ((:commit . "4bcd030f0d736d77c647955739b61fae541417e9") (:authors ("Kevin Brubeck Unhammer" . "unhammer@fsfe.org")) (:maintainer "Kevin Brubeck Unhammer" . "unhammer@fsfe.org") (:keywords "convenience" "hypermedia" "org") (:url . "https://github.com/unhammer/org-rich-yank"))])
+ (org-roam . [(20220508 19) ((emacs (26 1)) (dash (2 13)) (org (9 4)) (emacsql (3 0 0)) (emacsql-sqlite (1 0 0)) (magit-section (3 0 0))) "A database abstraction layer for Org-mode" tar ((:commit . "c0871c42bec9fa836e1b2a8c7691f06694f99714") (:authors ("Jethro Kuan" . "jethrokuan95@gmail.com")) (:maintainer "Jethro Kuan" . "jethrokuan95@gmail.com") (:keywords "org-mode" "roam" "convenience") (:url . "https://github.com/org-roam/org-roam"))])
+ (org-roam-bibtex . [(20220213 1609) ((emacs (27 1)) (org-roam (2 2 0)) (bibtex-completion (2 0 0))) "Org Roam meets BibTeX" tar ((:commit . "efdac6fe4134c33f50b06a0a6d192003d0e5094c") (:authors ("Mykhailo Shevchuk" . "mail@mshevchuk.com") ("Leo Vivier" . "leo.vivier+dev@gmail.com")) (:maintainer "Mykhailo Shevchuk" . "mail@mshevchuk.com") (:keywords "bib" "hypermedia" "outlines" "wp") (:url . "https://github.com/org-roam/org-roam-bibtex"))])
+ (org-roam-timestamps . [(20220111 1755) ((emacs (26 1)) (org-roam (2 0 0))) "Keep track of modification times for org-roam" single ((:commit . "604fdad0feb61419751d3d6b828cc443a99f418f") (:authors ("Thomas F. K. Jorna <https://github.com/thomas>")) (:maintainer "Thomas F. K. Jorna" . "jorna@jtrialerror.com") (:keywords "calendar" "outlines" "files") (:url . "https://github.com/ThomasFKJorna/org-roam-timestamps/"))])
+ (org-roam-ui . [(20220225 2151) ((emacs (27 1)) (org-roam (2 0 0)) (simple-httpd (20191103 1446)) (websocket (1 13))) "User Interface for Org-roam" tar ((:commit . "9474a254390b1e42488a1801fed5826b32a8030b") (:authors ("Kirill Rogovoy, Thomas Jorna")) (:maintainer "Kirill Rogovoy, Thomas Jorna") (:keywords "files" "outlines") (:url . "https://github.com/org-roam/org-roam-ui"))])
+ (org-ros . [(20220320 1705) ((emacs (24 1))) "Rahul's Org-Mode Screenshot" single ((:commit . "70e0f33ee027ca1dce68351ad14a9e47a452fc17") (:authors ("Rahul Martim Juliato" . "rahul.juliato@gmail.com")) (:maintainer "Rahul Martim Juliato" . "rahul.juliato@gmail.com") (:url . "https://github.com/LionyxML/ros"))])
+ (org-rtm . [(20160214 1236) ((rtm (0 1))) "Simple import/export from rememberthemilk to org-mode" single ((:commit . "adc42ad1fbe92ab447ccc9553780f4456f2508d2") (:authors ("Philipp Middendorf" . "pmidden@secure.mailbox.org")) (:maintainer "Philipp Middendorf" . "pmidden@secure.mailbox.org") (:keywords "outlines" "data") (:url . "https://github.com/pmiddend/org-rtm"))])
+ (org-runbook . [(20220107 451) nil "Org mode for runbooks" tar ((:commit . "dd11d253d3ee94b70f0d2cc74c6e85c6f5ac189d") (:authors ("Tyler Dodge")) (:maintainer "Tyler Dodge") (:keywords "convenience" "processes" "terminals" "files") (:url . "https://github.com/tyler-dodge/org-runbook"))])
+ (org-scrum . [(20200131 1129) ((emacs (24 5)) (org (8 2)) (seq (2 3)) (cl-lib (1 0))) "org mode extensions for scrum planning and reporting" single ((:commit . "f7a46bc4bc85305f0c2b72565170ea0e007c42fd") (:authors ("Ian Martins" . "ianxm@jhu.edu")) (:maintainer "Ian Martins" . "ianxm@jhu.edu") (:url . "https://github.com/ianxm/emacs-scrum"))])
+ (org-seek . [(20161217 502) ((emacs (24 3)) (ag (0 48))) "Searching Org-mode files with search tools." single ((:commit . "1f51e6634e3b9a6a29d335d0d14370a6ffef2265") (:authors ("stardiviner" . "numbchild@gmail.com")) (:maintainer "stardiviner" . "numbchild@gmail.com") (:keywords "org" "search" "ag" "pt") (:url . "https://github.com/stardiviner/org-seek.el"))])
+ (org-shoplist . [(20210629 2157) ((emacs (25))) "Eat the world" single ((:commit . "71ea7643e66c97d21df49fb8b600578ca0464f83") (:authors ("lordnik22")) (:maintainer "lordnik22") (:keywords "extensions" "matching") (:url . "https://github.com/lordnik22"))])
+ (org-sidebar . [(20210912 1321) ((emacs (26 1)) (s (1 10 0)) (dash (2 18)) (org (9 0)) (org-ql (0 2)) (org-super-agenda (1 0))) "Helpful sidebar for Org buffers" single ((:commit . "288703b897449f5110c9c76e78eb9a928ffc0dcd") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "hypermedia" "outlines" "org" "agenda") (:url . "https://github.com/alphapapa/org-sidebar"))])
+ (org-snooze . [(20181229 1424) ((emacs (24 4))) "Snooze your code, doc and feed" single ((:commit . "8799adc14a20f3489063d279ff69312de3180bf9") (:authors ("Bill Xue")) (:maintainer "Bill Xue") (:keywords "extensions") (:url . "https://github.com/xueeinstein/org-snooze.el"))])
+ (org-special-block-extras . [(20220326 1432) ((s (1 12 0)) (dash (2 18 1)) (emacs (27 1)) (org (9 1)) (lf (1 0)) (dad-joke (1 4)) (seq (2 0)) (lolcat (0))) "30 new custom blocks & 34 link types for Org-mode" single ((:commit . "2e397dac372ff75ea6ee6eed9ae3a0540a082af8") (:authors ("Musa Al-hassy" . "alhassy@gmail.com")) (:maintainer "Musa Al-hassy" . "alhassy@gmail.com") (:keywords "org" "blocks" "colors" "convenience") (:url . "https://alhassy.github.io/org-special-block-extras"))])
+ (org-sql . [(20210404 1839) ((emacs (27 1)) (s (1 12)) (f (0 20 0)) (dash (2 17)) (org-ml (5 6 1))) "Org-Mode SQL converter" single ((:commit . "71b6e01ff94be4c68cfeb17a34518bf1f118cf95") (:authors ("Nathan Dwarshuis" . "natedwarshuis@gmail.com")) (:maintainer "Nathan Dwarshuis" . "natedwarshuis@gmail.com") (:keywords "org-mode" "data") (:url . "https://github.com/ndwarshuis/org-sql"))])
+ (org-starter . [(20220326 1106) ((emacs (25 1)) (dash (2 18))) "A basic configuration framework for org mode" single ((:commit . "cd9c5c0402de941299d1c8901f26a8f24d755022") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:url . "https://github.com/akirak/org-starter"))])
+ (org-starter-swiper . [(20201202 144) ((emacs (25 1)) (swiper (0 11)) (org-starter (0 2 4))) "Swiper for org-starter" single ((:commit . "cd9c5c0402de941299d1c8901f26a8f24d755022") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:url . "https://github.com/akirak/org-starter"))])
+ (org-static-blog . [(20220508 1410) ((emacs (24 3))) "a simple org-mode based static blog generator" single ((:commit . "a6cd8f651f971eaa68be1cbfd30cc775e3a7ee93") (:authors ("Bastian Bechtold")) (:maintainer "Bastian Bechtold") (:url . "https://github.com/bastibe/org-static-blog"))])
+ (org-sticky-header . [(20201223 143) ((emacs (24 4)) (org (8 3 5))) "Show off-screen Org heading at top of window" single ((:commit . "79136b8c54c48547ba8a07a72a9790cb8e23ecbd") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "hypermedia" "outlines" "org") (:url . "http://github.com/alphapapa/org-sticky-header"))])
+ (org-super-agenda . [(20210928 916) ((emacs (26 1)) (s (1 10 0)) (dash (2 13)) (org (9 0)) (ht (2 2)) (ts (0 2))) "Supercharge your agenda" tar ((:commit . "3108bc3f725818f0e868520d2c243abe9acbef4e") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "hypermedia" "outlines" "org" "agenda") (:url . "http://github.com/alphapapa/org-super-agenda"))])
+ (org-superstar . [(20210915 1934) ((org (9 1 9)) (emacs (26 1))) "Prettify headings and plain lists in Org mode" single ((:commit . "03be6c0a3081c46a59b108deb8479ee24a6d86c0") (:authors ("D. Williams" . "d.williams@posteo.net")) (:maintainer "D. Williams" . "d.williams@posteo.net") (:keywords "faces" "outlines") (:url . "https://github.com/integral-dw/org-superstar-mode"))])
+ (org-sync . [(20181204 23) ((cl-lib (0 5)) (org (8 2)) (emacs (24))) "Synchronize Org documents with External Issue Trackers" tar ((:commit . "e34a385fa9e658c8341a0a6e6bc3472d4d536bb8") (:authors ("Aurelien Aptel <aurelien dot aptel at gmail dot com>")) (:maintainer "Andrei Beliankou" . "arbox@yandex.ru") (:keywords "org" "synchronization" "issue tracking" "github" "redmine") (:url . "https://github.com/arbox/org-sync"))])
+ (org-sync-snippets . [(20210111 1726) ((org (8 3 5)) (emacs (24 3)) (f (0 17 3))) "Export snippets to org-mode and vice versa" single ((:commit . "88f995dea188b8a645a3388c42b62a2bb88953d3") (:authors ("Adrien Brochard")) (:maintainer "Adrien Brochard") (:keywords "snippet" "org-mode" "yasnippet" "tools") (:url . "https://github.com/abrochard/org-sync-snippets"))])
+ (org-table-color . [(20220311 1927) ((emacs (26 1))) "Add color to your org-mode table cells" single ((:commit . "2022f301ef323953c3a0e087a1b601da85e06da1") (:authors ("Colin Woodbury" . "colin@fosskers.ca")) (:maintainer "Colin Woodbury" . "colin@fosskers.ca") (:keywords "data" "faces" "lisp") (:url . "https://github.com/fosskers/org-table-color"))])
+ (org-table-comment . [(20120209 1851) nil "Org table comment modes." single ((:commit . "33b9966c33ecbc3e27cca67c2f2cdea04364d74e") (:authors ("Matthew L. Fidler <matthew dot fidler at gmail . com>")) (:maintainer "Matthew L. Fidler") (:keywords "org-mode" "orgtbl") (:url . "http://github.com/mlf176f2/org-table-comment.el"))])
+ (org-table-sticky-header . [(20190924 506) ((org (8 2 10)) (emacs (24 4))) "Sticky header for org-mode tables" single ((:commit . "b65442857128ab04724aaa301e60aa874a31a798") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions"))])
+ (org-tag-beautify . [(20220427 1552) ((emacs (26 1)) (org-pretty-tags (0 2 2)) (all-the-icons (4 0 0))) "Beautify Org Mode tags" single ((:commit . "88fde267441118836a5c4ed28bb5958fca37a800") (:keywords "hypermedia") (:url . "https://repo.or.cz/org-tag-beautify.git"))])
+ (org-tanglesync . [(20200127 1616) ((emacs (24 4))) "Syncing org src blocks with tangled external files" single ((:commit . "af83a73ae542d5cb3c9d433cbf2ce1d4f4259117") (:authors ("Mehmet Tekman")) (:maintainer "Mehmet Tekman") (:keywords "outlines") (:url . "https://github.com/mtekman/org-tanglesync.el"))])
+ (org-tfl . [(20170923 1218) ((org (0 16 2)) (cl-lib (0 5)) (emacs (24 1))) "Transport for London meets Orgmode" tar ((:commit . "f0d7d39106a1de5457f5160cddd98ab892b61066") (:authors ("storax (David Zuber), <zuber [dot] david [at] gmx [dot] de>")) (:maintainer "storax (David Zuber), <zuber [dot] david [at] gmx [dot] de>") (:keywords "org" "tfl") (:url . "https://github.com/storax/org-tfl"))])
+ (org-themis . [(20160122 404) ((cl-lib (0 4))) "Experimental project management mode for org-mode" single ((:commit . "78aadbbe22b1993be5c4accd0d3f91a4e85c9a3c") (:maintainer "Zachary Elliott" . "contact@zell.io") (:keywords "org-mode" "elisp" "project") (:url . "http://github.com/zellio/org-themis"))])
+ (org-time-budgets . [(20200715 1016) ((alert (0 5 10)) (cl-lib (0 5))) "Define time budgets and display clocked time." single ((:commit . "1d6bfc323013bbf725167842d9e097fad805de03") (:authors ("Arthur Leonard Andersen" . "leoc.git@gmail.com")) (:maintainer "Arthur Leonard Andersen" . "leoc.git@gmail.com"))])
+ (org-timeline . [(20211110 1952) ((dash (2 13 0)) (emacs (24 3))) "Add graphical view of agenda to agenda buffer." single ((:commit . "2b300abc8adc9955418fa2334f55e0610bff79f5") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "calendar") (:url . "https://github.com/Fuco1/org-timeline/"))])
+ (org-toodledo . [(20150301 1113) ((request-deferred (0 2 0)) (emacs (24)) (cl-lib (0 5))) "Toodledo integration for Emacs Org mode" tar ((:commit . "2c91a92bd07ae4a546771b018a6faa0e06399968") (:authors ("Christopher J. White" . "emacs@grierwhite.com")) (:maintainer "Christopher J. White" . "emacs@grierwhite.com") (:keywords "outlines" "data"))])
+ (org-tracktable . [(20161118 1329) ((emacs (24)) (cl-lib (0 5))) "Track your writing progress in an org-table" single ((:commit . "8e0e60a582a034bd66d5efb72d513140b7d4d90a") (:authors ("tty-tourist" . "andreasrasholm@protonmail.com")) (:maintainer "tty-tourist" . "andreasrasholm@protonmail.com") (:keywords "org" "writing") (:url . "https://github.com/tty-tourist/org-tracktable"))])
+ (org-transform-tree-table . [(20200413 1959) ((dash (2 10 0)) (s (1 3 0))) "Transform org-mode tree with properties to a table, and the other way around" single ((:commit . "d84e7fb87bf2d5fc2be252500de0cddf20facf4f") (:authors (nil . "Johan Lindstrom <buzzwordninja not_this_bit@googlemail.com>")) (:maintainer nil . "Johan Lindstrom <buzzwordninja not_this_bit@googlemail.com>") (:keywords "org-mode" "table" "org-table" "tree" "csv" "convert") (:url . "https://github.com/jplindstrom/emacs-org-transform-tree-table"))])
+ (org-tree-slide . [(20220112 142) ((emacs (24 4))) "A presentation tool for org-mode" single ((:commit . "3faa042393ebfe5699a3bffce775f039d7416ceb") (:authors ("Takaaki ISHIKAWA <takaxp at ieee dot org>")) (:maintainer "Takaaki ISHIKAWA <takaxp at ieee dot org>") (:keywords "convenience" "org-mode" "presentation" "narrowing") (:url . "https://github.com/takaxp/org-tree-slide"))])
+ (org-tree-slide-pauses . [(20201215 146) ((emacs (24 5)) (org-tree-slide (2 8 4))) "Bring the pause command from Beamer to org-tree-slide" single ((:commit . "f02af7102e9ecef7c3dac0d376d85bbb8c4de4cc") (:authors ("cnngimenez")) (:maintainer "cnngimenez") (:keywords "convenience" "org-mode" "presentation") (:url . "https://github.com/cnngimenez/org-tree-slide-pauses"))])
+ (org-treescope . [(20200503 1609) ((emacs (24 3)) (org (9 2 3)) (org-ql (0 5 -1)) (dash (2 17 0))) "Time scoping sparse trees within org" tar ((:commit . "905029a9e2ce6ed325bb8e10f59dc589c181d148") (:authors ("Mehmet Tekman")) (:maintainer "Mehmet Tekman") (:keywords "outlines") (:url . "https://github.com/mtekman/org-treescope.el"))])
+ (org-treeusage . [(20200418 1904) ((emacs (26 1)) (dash (2 17 0)) (org (9 1 6))) "Examine the usage of org headings in a tree-like manner" tar ((:commit . "fe4323bc500e2d949848c75e8f59340971b35562") (:authors ("Mehmet Tekman")) (:maintainer "Mehmet Tekman") (:keywords "outlines") (:url . "https://github.com/mtekman/org-treeusage.el"))])
+ (org-trello . [(20210314 1901) ((emacs (24 3)) (request-deferred (0 2 0)) (deferred (0 4 0)) (s (1 11 0)) (dash (2 18 0))) "Minor mode to synchronize org-mode buffer and trello board" tar ((:commit . "fc63ed580101e6160edfb6f43215fb3200ce1ea7") (:authors ("Antoine R. Dumont (@ardumont)" . "antoine.romain.dumont@gmail.com")) (:maintainer "Antoine R. Dumont (@ardumont)" . "antoine.romain.dumont@gmail.com") (:keywords "org-mode" "trello" "sync" "org-trello") (:url . "https://github.com/org-trello/org-trello"))])
+ (org-variable-pitch . [(20220220 1757) ((emacs (25))) "Minor mode for variable pitch text in org mode." single ((:commit . "350af0e5d53307c900e4f8b2617f3852f51a74d2") (:authors ("Göktuğ Kayaalp" . "self@gkayaalp.com")) (:maintainer "Göktuğ Kayaalp" . "self@gkayaalp.com") (:keywords "faces") (:url . "https://dev.gkayaalp.com/elisp/index.html#ovp"))])
+ (org-vcard . [(20220206 1209) nil "org-mode support for vCard export and import." tar ((:commit . "bdaebcb4ef44c155a92d9c89a21a1d29019ee026") (:authors ("Alexis" . "flexibeast@gmail.com") ("Will Dey" . "will123dey@gmail.com")) (:maintainer "Alexis" . "flexibeast@gmail.com") (:keywords "outlines" "org" "vcard") (:url . "https://github.com/flexibeast/org-vcard"))])
+ (org-view-mode . [(20220218 2106) ((emacs (25 1))) "Read-only viewer with less markup clutter in org mode files" single ((:commit . "88321917b095a8cbabfa8327c915bd46eb741750") (:authors ("Arthur Miller" . "arthur.miller@live.com")) (:maintainer "Arthur Miller" . "arthur.miller@live.com") (:keywords "convenience" "outlines" "tools") (:url . "https://github.com/amno1/org-view-mode"))])
+ (org-visibility . [(20220404 1502) ((emacs (27 1))) "Persistent org tree visibility" single ((:commit . "a3aef6573d23309f9a6f340b41fa103cca3c79a6") (:authors ("Kyle W T Sherman" . "kylewsherman@gmail.com")) (:maintainer "Kyle W T Sherman" . "kylewsherman@gmail.com") (:keywords "outlines" "convenience") (:url . "https://github.com/nullman/emacs-org-visibility"))])
+ (org-wc . [(20200731 2244) nil "Count words in org mode trees." single ((:commit . "dbbf794e4ec6c4080d945f43338185e34a4a582d") (:authors ("Simon Guest")) (:maintainer "Simon Guest"))])
+ (org-web-tools . [(20201212 1058) ((emacs (25 1)) (org (9 0)) (dash (2 12)) (esxml (0 3 4)) (s (1 10 0)) (request (0 3 0))) "Display and capture web content with Org-mode" tar ((:commit . "b94a07add8558ef7b0666173dbb8a2554f1d41a6") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "hypermedia" "outlines" "org" "web") (:url . "http://github.com/alphapapa/org-web-tools"))])
+ (org-wild-notifier . [(20220402 2331) ((alert (1 2)) (async (1 9 3)) (dash (2 18 0)) (emacs (24 4))) "Customizable org-agenda notifications" single ((:commit . "4b1d874aafdee90815136c308f1f3bd3577971ec") (:authors ("Artem Khramov" . "akhramov+emacs@pm.me")) (:maintainer "Artem Khramov" . "akhramov+emacs@pm.me") (:keywords "notification" "alert" "org" "org-agenda" "agenda") (:url . "https://github.com/akhramov/org-wild-notifier.el"))])
+ (org-working-set . [(20220414 1402) ((org (9 3)) (dash (2 12)) (s (1 12)) (emacs (26 3))) "Manage and visit a small set of org-nodes." single ((:commit . "6af54ed3a5d9bf90629223157803c42f5d3b152c") (:authors ("Marc Ihm" . "1@2484.de")) (:maintainer "Marc Ihm" . "1@2484.de") (:url . "https://github.com/marcIhm/org-working-set"))])
+ (org-wunderlist . [(20191017 1917) ((request-deferred (0 2 0)) (alert (1 1)) (emacs (24)) (cl-lib (0 5)) (org (8 2 4)) (s (1 9 0))) "Org sync with Wunderlist" single ((:commit . "1a084bb49be4b5a1066db9cd9b7da2f8efab293f") (:authors ("myuhe <yuhei.maeda_at_gmail.com>")) (:maintainer "myuhe") (:keywords "convenience") (:url . "https://github.com/myuhe/org-wunderlist.el"))])
+ (org-zettelkasten . [(20220503 1357) ((emacs (24 3)) (org (9 0))) "Helper functions to use Zettelkasten in org-mode" single ((:commit . "603a5b692a08340c1865a6f73cacf57c4fd64cb2") (:authors ("Yann Herklotz" . "yann@ymhg.org")) (:maintainer "Yann Herklotz" . "yann@ymhg.org") (:keywords "files" "hypermedia" "org" "notes") (:url . "https://github.com/ymherklotz/emacs-zettelkasten"))])
+ (org2blog . [(20210929 17) ((htmlize (1 54)) (hydra (0 15 0)) (xml-rpc (1 6 12)) (metaweblog (1 1 1))) "Blog from Org mode to WordPress" tar ((:commit . "68695ed0e012379556d57f9564ac5ad8cd68fbb8") (:authors ("Puneeth Chaganti" . "punchagan+org2blog@gmail.com")) (:maintainer "Grant Rettke" . "grant@wisdomandwonder.com") (:keywords "comm" "convenience" "outlines" "wp") (:url . "https://github.com/org2blog/org2blog"))])
+ (org2ctex . [(20200331 550) ((emacs (24 4))) "Export org to ctex (a latex macro for Chinese)" single ((:commit . "2e40aa5e78b0562516f46f689e7b74cdf451cc2a") (:authors ("Feng Shu" . "tumashu@163.com")) (:maintainer "Feng Shu" . "tumashu@163.com") (:url . "https://github.com/tumashu/org2ctex"))])
+ (org2elcomment . [(20170324 945) ((org (8 3 4))) "Convert Org file to Elisp comments" single ((:commit . "c88a75d9587c484ead18f7adf08592b09c1cceb0") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions"))])
+ (org2issue . [(20190531 941) ((org (8 0)) (emacs (24 4)) (ox-gfm (0 1)) (gh (0 1)) (s (20160405 920))) "export org to github issue" single ((:commit . "910b98c858762fd14b11d261626c5e979dde0833") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "convenience" "github" "org") (:url . "https://github.com/lujun9972/org2issue"))])
+ (org2jekyll . [(20210829 1113) ((dash (2 18 0)) (s (1 9 0))) "Minor mode to publish org-mode post to jekyll without specific yaml" tar ((:commit . "32f6cfc7265cf24ebb5361264e8c1b61a07e74df") (:authors ("Antoine R. Dumont (@ardumont)" . "antoine.romain.dumont@gmail.com")) (:maintainer "Antoine R. Dumont (@ardumont)" . "antoine.romain.dumont@gmail.com") (:keywords "org-mode" "jekyll" "blog" "publish") (:url . "https://github.com/ardumont/org2jekyll"))])
+ (org2web . [(20210203 324) ((cl-lib (1 0)) (ht (1 5)) (mustache (0 22)) (htmlize (1 47)) (org (8 0)) (dash (2 0 0)) (el2org (0 10)) (simple-httpd (0 1))) "A static site generator based on org mode." tar ((:commit . "6f5c5f0cc5c877ac3a383782bbe8751264d807b6") (:authors ("Feng Shu <tumashu AT 163.com>") ("Jorge Javier Araya Navarro <elcorreo AT deshackra.com>") ("Kelvin Hu <ini DOT kelvin AT gmail DOT com>")) (:maintainer "Feng Shu <tumashu AT 163.com>") (:keywords "org-mode" "convenience" "beautify") (:url . "https://github.com/tumashu/org2web"))])
+ (organic-green-theme . [(20201216 2240) nil "Low-contrast green color theme." single ((:commit . "0ed99a9c0cf14be0a1f491518821f0e9b7e88b88"))])
+ (organize-imports-java . [(20210715 1155) ((emacs (25 1)) (f (0 20 0)) (s (1 12 0)) (dash (2 14 1)) (ht (2 2))) "Automatically organize imports in Java code" tar ((:commit . "6fe53900ead434f3e18e63e9d22a8fa8380ccb37") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/organize-imports-java"))])
+ (orgbox . [(20180827 218) ((org (8 0)) (cl-lib (0 5))) "Mailbox-like task scheduling Org." single ((:commit . "3982f56efd67ec016389cad82ce5a44f619b36a9") (:authors ("Yasuhito Takamiya" . "yasuhito@gmail.com")) (:maintainer "Yasuhito Takamiya" . "yasuhito@gmail.com") (:keywords "org") (:url . "https://github.com/yasuhito/orgbox"))])
+ (orgit . [(20220425 1157) ((emacs (25 1)) (compat (28 1 1 0)) (magit (3 0)) (org (9 4))) "Support for Org links to Magit buffers" single ((:commit . "b33b916915db5f91d2c9da4cb1a2457ccbb09332") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "hypermedia" "vc") (:url . "https://github.com/magit/orgit"))])
+ (orgit-forge . [(20220422 1625) ((emacs (25 1)) (compat (28 1 1 0)) (forge (0 3)) (magit (3 3)) (org (9 5)) (orgit (1 8))) "Org links to Forge issue buffers" single ((:commit . "8baf1dee795f026d4555687022487fab89c9bcdf") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "hypermedia" "vc") (:url . "https://github.com/magit/orgit-forge"))])
+ (orglink . [(20220422 1626) ((emacs (25 1)) (compat (28 1 1 0)) (org (9 5)) (seq (2 23))) "Use Org Mode links in other modes" single ((:commit . "59bec36eb91e78d508e290b69c4383b27466513f") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "hypermedia") (:url . "https://github.com/tarsius/orglink"))])
+ (orglue . [(20200411 311) ((org (9 3)) (epic (0 2))) "more functionality to org-mode." tar ((:commit . "9d5a8e24be9acb8c55bb4d6aa8b98e30e2677401") (:authors ("Yoshinari Nomura" . "nom@quickhack.net")) (:maintainer "Yoshinari Nomura" . "nom@quickhack.net") (:keywords "org"))])
+ (orgnav . [(20170608 1713) ((helm (2 7 0)) (s (1 11 0)) (dash (1 11 0)) (emacs (24))) "Org tree navigation using helm" tar ((:commit . "9e2cac9c1a67af5f0080e60022e821bf7b70312d") (:authors ("Facet Framer" . "facet@facetframer.com")) (:maintainer "Facet Framer" . "facet@facetframer.com") (:keywords "convenience" "outlines") (:url . "http://github.com/facetframer/orgnav"))])
+ (orgstrap . [(20211126 2201) ((emacs (24 4))) "Bootstrap an Org file using file local variables" single ((:commit . "bc981b957967be8d872c08be9ba7f2dbde5caf1d") (:authors ("Tom Gillespie")) (:maintainer "Tom Gillespie") (:keywords "lisp" "org" "org-mode" "bootstrap") (:url . "https://github.com/tgbugs/orgstrap"))])
+ (orgtbl-aggregate . [(20220127 1502) nil "Create an aggregated Org table from another one" single ((:commit . "36d7aec5549655174467db45d1dba6647b9e19b1") (:keywords "org" "table" "aggregation" "filtering"))])
+ (orgtbl-ascii-plot . [(20200411 711) nil "ascii-art bar plots in org-mode tables" single ((:commit . "59618630205fc8c0fcc74fb34c4581d9712a5181") (:authors ("Thierry Banel tbanelwebmin at free dot fr") ("Michael Brand")) (:maintainer "Thierry Banel tbanelwebmin at free dot fr") (:keywords "org" "table" "ascii" "plot"))])
+ (orgtbl-join . [(20220127 1516) ((cl-lib (0 5))) "join columns from another table" single ((:commit . "f5254db6ae78e30c2786c53991e98e86ed344ac6") (:authors ("Thierry Banel tbanelwebmin at free dot fr")) (:maintainer "Thierry Banel tbanelwebmin at free dot fr") (:keywords "org" "table" "join" "filtering"))])
+ (orgtbl-show-header . [(20141023 837) nil "Show the header of the current column in the minibuffer" single ((:commit . "112d54a44682f065318ed0c9c89a8f5b8907342a") (:authors ("Damien Cassou" . "damien.cassou@gmail.com")) (:maintainer "Damien Cassou" . "damien.cassou@gmail.com"))])
+ (origami . [(20200331 1019) ((s (1 9 0)) (dash (2 5 0)) (emacs (24)) (cl-lib (0 5))) "Flexible text folding" tar ((:commit . "e558710a975e8511b9386edc81cd6bdd0a5bda74") (:authors ("Greg Sexton" . "gregsexton@gmail.com")) (:maintainer "Greg Sexton" . "gregsexton@gmail.com") (:keywords "folding") (:url . "https://github.com/gregsexton/origami.el"))])
+ (origami-predef . [(20200615 1044) ((emacs (24 3)) (origami (1 0))) "Apply folding when finding (opening) files" single ((:commit . "cc363f4b2fd20021ab330fc989369e2658457f93") (:authors ("Álvaro González Sotillo" . "alvarogonzalezsotillo@gmail.com")) (:maintainer "Álvaro González Sotillo" . "alvarogonzalezsotillo@gmail.com") (:keywords "convenience" "folding") (:url . "https://github.com/alvarogonzalezsotillo/origami-predef"))])
+ (ormolu . [(20211020 2229) ((emacs (24)) (reformatter (0 4))) "Format Haskell source code using the \"ormolu\" program" single ((:commit . "1941a8ce48027b5670d226bacc2fa10b00774b3a") (:authors ("Vasiliy Yorkin" . "vasiliy.yorkin@gmail.com")) (:maintainer "Vasiliy Yorkin") (:keywords "files" "tools") (:url . "https://github.com/vyorkin/ormolu.el"))])
+ (orthodox-christian-new-calendar-holidays . [(20210830 1657) nil "Feasts (NS)" single ((:commit . "6869024ecd45eefd0ec648979c6a59d7c79770e0") (:authors ("Carson Chittom" . "carson@wistly.net")) (:maintainer "Carson Chittom" . "carson@wistly.net") (:keywords "calendar") (:url . "https://github.com/cmchittom/orthodox-christian-new-calendar-holidays"))])
+ (osa . [(20200522 2103) ((emacs (25 1))) "OSA (JavaScript / AppleScript) bridge" tar ((:commit . "615ca9eef4131a23d9971691fa0d0f20fe59d01b") (:authors ("xristos" . "xristos@sdf.org")) (:maintainer "xristos" . "xristos@sdf.org") (:keywords "extensions") (:url . "https://github.com/atomontage/osa"))])
+ (osa-chrome . [(20201122 1639) ((emacs (25 1)) (osa (1 0))) "Google Chrome remote tab control" tar ((:commit . "9148e21cf2e91b357f5ea3a349975e8b89c8d5e4") (:authors ("xristos" . "xristos@sdf.org")) (:maintainer "xristos" . "xristos@sdf.org") (:keywords "comm") (:url . "https://github.com/atomontage/osa-chrome"))])
+ (osm . [(20220509 1109) ((emacs (27 1))) "OpenStreetMap viewer" tar ((:commit . "86610105769729eda4c2609b4b724903bcdabb88") (:authors ("Daniel Mendler" . "mail@daniel-mendler.de")) (:maintainer "Daniel Mendler" . "mail@daniel-mendler.de") (:url . "https://github.com/minad/osm"))])
+ (osx-browse . [(20140508 2041) ((string-utils (0 3 2)) (browse-url-dwim (0 6 6))) "Web browsing helpers for OS X" single ((:commit . "44ded7cc3a7ee426c1c3257fae534c121f7e752e") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "hypermedia" "external") (:url . "http://github.com/rolandwalker/osx-browse"))])
+ (osx-clipboard . [(20141012 717) nil "Use the OS X clipboard from terminal Emacs" single ((:commit . "e46dd31327a3f92f77b013b4c9b1e5fdd0e5c73d") (:authors ("Jon Oddie <jonxfield at gmail.com>")) (:maintainer "Jon Oddie <jonxfield at gmail.com>") (:url . "https://github.com/joddie/osx-clipboard-mode"))])
+ (osx-dictionary . [(20210703 1152) ((cl-lib (0 5))) "Interface for OSX Dictionary.app" tar ((:commit . "1a4479d9f44ef1e6e5f7643c172c32f6fe6cce21") (:authors ("Chunyang Xu" . "mail@xuchunyang.me")) (:maintainer "Chunyang Xu" . "mail@xuchunyang.me") (:keywords "mac" "dictionary") (:url . "https://github.com/xuchunyang/osx-dictionary.el"))])
+ (osx-lib . [(20211206 619) ((emacs (24 4))) "Basic functions for Apple/OSX" single ((:commit . "7afdb57edd5725e8a66f841a90fa571a4cbb81e7") (:authors ("Raghav Kumar Gautam" . "raghav@apache.org")) (:maintainer "Raghav Kumar Gautam" . "raghav@apache.org") (:keywords "apple" "applescript" "osx" "finder" "emacs" "elisp" "vpn" "speech") (:url . "https://github.com/raghavgautam/osx-lib"))])
+ (osx-location . [(20200304 2209) ((emacs (24 1))) "Watch and respond to changes in geographical location on OS X" tar ((:commit . "18fcc306caa575c5afdeaf091aa1a9b003daa52a") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "convenience" "calendar") (:url . "https://github.com/purcell/osx-location"))])
+ (osx-org-clock-menubar . [(20150205 2111) nil "simple menubar integration for org-clock" tar ((:commit . "9964d2a97cc2fb6570dc4116da44f73bd8eb7cb3") (:authors ("Jordon Biondo" . "jordonbiondo@gmail.com")) (:maintainer "Jordon Biondo" . "jordonbiondo@gmail.com") (:keywords "org" "osx") (:url . "https://github.com/jordonbiondo/osx-org-clock-menubar"))])
+ (osx-plist . [(20200212 1724) ((emacs (25 1))) "Apple plist file parser" single ((:commit . "46d52aa186ea50a35c1780977bf0aa261bd53922") (:authors ("Theresa O'Connor" . "tess@oconnor.cx")) (:maintainer "Neil Okamoto" . "neil.okamoto+melpa@gmail.com") (:keywords "convenience") (:url . "https://github.com/gonewest818/osx-plist"))])
+ (osx-pseudo-daemon . [(20200215 513) nil "Daemon mode that plays nice with OSX." single ((:commit . "94240ebb716f11af8427b6295c3f44c0c43419d3") (:authors ("Ryan C. Thompson")) (:maintainer "Ryan C. Thompson") (:keywords "convenience" "osx") (:url . "https://github.com/DarwinAwardWinner/osx-pseudo-daemon"))])
+ (osx-trash . [(20210419 2229) ((emacs (24 1))) "System trash for OS X" tar ((:commit . "af74a2055a15bf4182d8196600f7decd66eec634") (:authors ("Sebastian Wiesner" . "swiesner@lunaryorn.com")) (:maintainer "Sebastian Wiesner" . "swiesner@lunaryorn.com") (:keywords "files" "convenience" "tools" "unix") (:url . "https://github.com/lunaryorn/osx-trash.el"))])
+ (otama . [(20160404 1032) nil "Org-table Manipulator" single ((:commit . "c114fd8006762f891bc120a7c0ea213872e7ab31") (:authors ("Yoshinari Nomura" . "nom@quickhack.net")) (:maintainer "Yoshinari Nomura" . "nom@quickhack.net") (:keywords "database" "org-mode"))])
+ (other-emacs-eval . [(20180408 1348) ((emacs (25 1)) (async (1 9 2))) "Evaluate the Emacs Lisp expression in other Emacs" single ((:commit . "8ace5acafef65daabf0c6619eff60733d7f5d792") (:authors ("Xu Chunyang" . "mail@xuchunyang.me")) (:maintainer "Xu Chunyang" . "mail@xuchunyang.me") (:keywords "tools") (:url . "https://github.com/xuchunyang/other-emacs-eval"))])
+ (outline-magic . [(20180619 1819) nil "outline mode extensions for Emacs" single ((:commit . "2a5f07417b696cf7541d435c43bafcc64817636b") (:authors ("Carsten Dominik" . "dominik@science.uva.nl")) (:maintainer "Thorsten Jolitz <tjolitz AT gmail DOT com>") (:keywords "outlines"))])
+ (outline-minor-faces . [(20220424 1803) ((emacs (25 1)) (compat (28 1 1 0))) "Headings faces for outline-minor-mode" single ((:commit . "ff862866a2c5eb7b20aa96a97fa982e2db1b6640") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "faces" "outlines") (:url . "https://github.com/tarsius/outline-minor-faces"))])
+ (outline-toc . [(20200401 1208) nil "Sidebar showing a \"table of contents\"." single ((:commit . "81d373633b40628cc3a6b6fb534fd7730076bcdb") (:authors ("Austin Bingham" . "austin.bingham@gmail.com")) (:maintainer "Austin Bingham" . "austin.bingham@gmail.com") (:keywords "convenience" "outlines") (:url . "https://github.com/abingham/outline-toc.el"))])
+ (outlook . [(20180428 1430) ((emacs (24 4))) "send emails in MS Outlook style" tar ((:commit . "359683aff91b38bd1398a6ed4058a06f09a02d65") (:authors ("Andrew Savonichev")) (:maintainer "Andrew Savonichev") (:keywords "mail") (:url . "https://github.com/asavonic/outlook.el"))])
+ (outorg . [(20190720 2002) ((emacs (24 4))) "Org-style comment editing" single ((:commit . "ef0f86f4b893b30be8bcf8b43a5ec357a6c70f07") (:maintainer "Adam Porter" . "adam@alphapapa.net") (:url . "https://github.com/alphapapa/outorg"))])
+ (outrespace . [(20220218 1936) ((emacs (24 4))) "Some c++ namespace utility functions" single ((:commit . "4b6f8a103b2ce76bb0638eac9356c462402b0665") (:authors ("Dan Harms" . "danielrharms@gmail.com")) (:maintainer "Dan Harms" . "danielrharms@gmail.com") (:keywords "tools" "c++" "namespace") (:url . "https://github.com/articuluxe/outrespace.git"))])
+ (outshine . [(20220326 540) ((outorg (2 0)) (cl-lib (0 5))) "outline with outshine outshines outline" tar ((:commit . "bf1eed10dd7a89b63d0fc014944033db397c1e23") (:authors ("Thorsten Jolitz")) (:maintainer "Thibault Polge" . "thibault@thb.lt") (:keywords "convenience" "outlines" "org") (:url . "https://github.com/alphapapa/outshine"))])
+ (ov . [(20200326 1042) ((emacs (24 3))) "Overlay library for Emacs Lisp" single ((:commit . "c5b9aa4e1b00d702eb2caedd61c69a22a5fa1fab") (:authors ("Shingo Fukuyama - http://fukuyama.co")) (:maintainer "Shingo Fukuyama - http://fukuyama.co") (:keywords "convenience" "overlay") (:url . "https://github.com/ShingoFukuyama/ov.el"))])
+ (overcast-theme . [(20200425 1601) ((emacs (24))) "A dark but vibrant color theme for Emacs" single ((:commit . "e02b835a08919ead079d7221d513348ac02ba92e") (:authors ("Mohammed Ismail Ansari" . "team.terminal@gmail.com")) (:maintainer "Mohammed Ismail Ansari" . "team.terminal@gmail.com") (:keywords "theme") (:url . "http://ismail.teamfluxion.com"))])
+ (overseer . [(20180226 619) ((emacs (24)) (dash (2 10 0)) (pkg-info (0 4)) (f (0 18 1))) "Ert-runner Integration Into Emacs" single ((:commit . "02d49f582e80e36b4334c9187801c5ecfb027789") (:authors ("Samuel Tonini" . "tonini.samuel@gmail.com")) (:maintainer "Samuel Tonini" . "tonini.samuel@gmail.com") (:url . "http://www.github.com/tonini/overseer.el"))])
+ (ovpn-mode . [(20210403 440) ((emacs (25)) (cl-lib (0 5))) "an openvpn management mode" single ((:commit . "4492098c771d094dd0661a5bc6906f65fb530825") (:authors ("Bas Alberts" . "bas@anti.computer")) (:maintainer "Bas Alberts" . "bas@anti.computer") (:keywords "comm") (:url . "https://github.com/anticomputer/ovpn-mode"))])
+ (owcmd . [(20200517 2039) ((emacs (26 3))) "Run a single command in the other window" single ((:commit . "05fb8f8f81838b5888fdec8b3947096dd2222e61") (:authors ("Jacob First" . "jacob.first@member.fsf.org")) (:maintainer "Jacob First" . "jacob.first@member.fsf.org") (:keywords "convenience") (:url . "https://github.com/fishyfriend/owcmd"))])
+ (owdriver . [(20200410 1901) ((smartrep (0 0 3)) (log4e (0 2 0)) (yaxception (0 2 0))) "Quickly perform various actions on other windows" single ((:commit . "3c52a7b11c8275fdb2e4cf98f68f2a48ad09a3ae") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "convenience") (:url . "https://github.com/aki2o/owdriver"))])
+ (ox-750words . [(20210701 1950) ((emacs (24 4)) (750words (0 0 1))) "Org mode exporter for 750words.com" single ((:commit . "0fed7621c04debad64ea6455455494d4e6eb03fa") (:authors ("Diego Zamboni <https://github.com/zzamboni>")) (:maintainer "Diego Zamboni" . "diego@zzamboni.org") (:keywords "files" "org" "writing") (:url . "https://github.com/zzamboni/750words-client"))])
+ (ox-asciidoc . [(20220428 740) ((org (8 1))) "AsciiDoc Back-End for Org Export Engine" single ((:commit . "c8bc184f9088b76fdf1ce20e6e5d0a1588e1b327") (:authors ("Yasushi SHOJI" . "yasushi.shoji@gmail.com")) (:maintainer "Yasushi SHOJI" . "yasushi.shoji@gmail.com") (:keywords "org" "asciidoc") (:url . "https://github.com/yashi/org-asciidoc"))])
+ (ox-bb . [(20210222 2002) ((emacs (24 4)) (org (8 0))) "BBCode Back-End for Org Export Engine" single ((:commit . "545d2e1547fdc48a5757152d19233effa11d9ee2") (:authors ("Christian Garbs" . "mitch@cgarbs.de")) (:maintainer "Christian Garbs" . "mitch@cgarbs.de") (:keywords "bbcode" "org" "export" "outlines") (:url . "https://github.com/mmitch/ox-bb"))])
+ (ox-bibtex-chinese . [(20170723 309) ((emacs (24 4))) "Let ox-bibtex work well for Chinese users" tar ((:commit . "2ad2364399229144110db7ef6365ad0461d6a38c") (:authors ("Feng Shu" . "tumashu@163.com")) (:maintainer "Feng Shu" . "tumashu@163.com") (:url . "https://github.com/tumashu/ox-bibtex-chinese.git"))])
+ (ox-clip . [(20220117 1909) ((org (8 2)) (htmlize (0))) "Cross-platform formatted copying for org-mode" single ((:commit . "ff117cf3c619eef12eccc0ccbfa3f11adb73ea68") (:authors ("John Kitchin" . "jkitchin@andrew.cmu.edu")) (:maintainer "John Kitchin" . "jkitchin@andrew.cmu.edu") (:keywords "org-mode") (:url . "https://github.com/jkitchin/ox-clip"))])
+ (ox-epub . [(20181101 1854) ((emacs (24 3)) (org (9))) "Export org mode projects to EPUB" single ((:commit . "c9629ef4b4bc40d51afefd8c0bb2c683931e6409") (:authors ("Mark Meyer" . "mark@ofosos.org")) (:maintainer "Mark Meyer" . "mark@ofosos.org") (:keywords "hypermedia") (:url . "http://github.com/ofosos/org-epub"))])
+ (ox-gemini . [(20220418 1433) ((emacs (26 1))) "Output gemini formatted documents from org-mode" single ((:commit . "168f820ea401fb813435a3a55af295873a4c110b") (:authors ("Justin Abrahms" . "justin@abrah.ms")) (:maintainer "Justin Abrahms" . "justin@abrah.ms") (:keywords "lisp" "gemini") (:url . "https://git.sr.ht/~abrahms/ox-gemini"))])
+ (ox-gfm . [(20170628 2102) nil "Github Flavored Markdown Back-End for Org Export Engine" single ((:commit . "99f93011b069e02b37c9660b8fcb45dab086a07f") (:authors ("Lars Tveito")) (:maintainer "Lars Tveito") (:keywords "org" "wp" "markdown" "github"))])
+ (ox-gist . [(20220410 2034) ((emacs (26 1)) (gist (1 4 0)) (s (1 12 0))) "Export Org mode buffers and subtrees to GitHub gists" single ((:commit . "e9f1f11af0e97fee30c2b15b56c236b1f4e1f400") (:authors ("Puneeth Chaganti" . "punchagan+emacs@muse-amuse.in")) (:maintainer "Puneeth Chaganti" . "punchagan+emacs@muse-amuse.in") (:keywords "org" "lisp" "gist" "github") (:url . "https://github.com/punchagan/org2gist/"))])
+ (ox-haunt . [(20200202 229) ((emacs (24 3)) (org (9 0))) "Haunt-flavored HTML backend for the Org export engine" single ((:commit . "f3c8fda6fee78f45a259e5d218a519dfd11c00c7") (:authors ("Jakob L. Kreuze" . "zerodaysfordays@sdf.lonestar.org")) (:maintainer "Jakob L. Kreuze" . "zerodaysfordays@sdf.lonestar.org") (:keywords "convenience" "hypermedia" "wp") (:url . "https://git.sr.ht/~jakob/ox-haunt"))])
+ (ox-html5slide . [(20131228 606) ((org (8 0))) "Export org-mode to HTML5 slide." single ((:commit . "4703dfbd9d79161509def673d2c1e118d722a58f") (:authors ("coldnew" . "coldnew.tw@gmail.com")) (:maintainer "coldnew" . "coldnew.tw@gmail.com") (:keywords "html" "presentation") (:url . "http://github.com/coldnew/org-html5slide"))])
+ (ox-hugo . [(20220509 1259) ((emacs (26 3)) (tomelr (0 3 0))) "Hugo Markdown Back-End for Org Export Engine" tar ((:commit . "059f2b822cb95e1b9e84cbd37c266bccacdf56f4") (:authors ("Kaushal Modi" . "kaushal.modi@gmail.com") ("Matt Price" . "moptop99@gmail.com")) (:maintainer "Kaushal Modi" . "kaushal.modi@gmail.com") (:keywords "org" "markdown" "docs") (:url . "https://ox-hugo.scripter.co"))])
+ (ox-impress-js . [(20150412 1716) ((org (8))) "impress.js Back-End for Org Export Engine" tar ((:commit . "91c6d2af6af308ade352a03355c4fb551b238c6b") (:authors ("Takumi Kinjo <takumi dot kinjo at gmail dot org>")) (:maintainer "Takumi Kinjo <takumi dot kinjo at gmail dot org>") (:keywords "outlines" "hypermedia" "calendar" "wp") (:url . "https://github.com/kinjo/org-impress-js.el"))])
+ (ox-ioslide . [(20161015 1338) ((emacs (24 1)) (org (8 0)) (cl-lib (0 5)) (f (0 17 2)) (makey (0 3))) "Export org-mode to Google I/O HTML5 slide." tar ((:commit . "6555680be5364c8ddd2bf446865cb1a82adb6b9e") (:authors ("coldnew" . "coldnew.tw@gmail.com")) (:maintainer "coldnew" . "coldnew.tw@gmail.com") (:keywords "html" "presentation") (:url . "http://github.com/coldnew/org-ioslide"))])
+ (ox-jekyll-md . [(20211222 1718) nil "Export Jekyll on Markdown articles using org-mode." single ((:commit . "26edb3f4575bcb0f1a2aed56237cd89694284449") (:authors ("Elsa Gonsiorowski" . "gonsie@me.com")) (:maintainer "Elsa Gonsiorowski" . "gonsie@me.com") (:keywords "org" "jekyll"))])
+ (ox-jira . [(20220423 1403) ((org (8 3))) "JIRA Backend for Org Export Engine" single ((:commit . "00184f8fdef02a3a359a253712e8769cbfbea3ba") (:authors ("Stig Brautaset" . "stig@brautaset.org")) (:maintainer "Stig Brautaset" . "stig@brautaset.org") (:keywords "outlines" "hypermedia" "wp") (:url . "https://github.com/stig/ox-jira.el"))])
+ (ox-json . [(20210928 347) ((emacs (24)) (org (9 2)) (s (1 12))) "JSON export backend for Org mode" single ((:commit . "fc6b2594706c44d266d0863c323b1b58ab9d18ba") (:authors ("Jared Lumpe" . "mjlumpe@gmail.com")) (:maintainer "Jared Lumpe" . "mjlumpe@gmail.com") (:keywords "outlines") (:url . "https://github.com/jlumpe/ox-json"))])
+ (ox-latex-subfigure . [(20200326 919) ((emacs (24 4)) (org (9 0))) "Subfigure for latex export" single ((:commit . "c4487689309dddff3228603754b69ab381cfa5dc") (:authors ("Quang Linh LE" . "linktohack@gmail.com")) (:maintainer "Quang Linh LE" . "linktohack@gmail.com") (:keywords "convenience" "ox" "latex" "subfigure" "org" "org-mode") (:url . "http://github.com/linktohack/ox-latex-subfigure"))])
+ (ox-leanpub . [(20201129 2027) ((org (9 1)) (ox-gfm (1 0)) (emacs (26 1)) (s (1 12 0))) "Export Org documents to Leanpub book format" tar ((:commit . "4adf97dd195f0a777b952b97888b77cdd9479629") (:authors ("Diego Zamboni" . "diego@zzamboni.org")) (:maintainer "Diego Zamboni" . "diego@zzamboni.org") (:keywords "files" "org" "leanpub") (:url . "https://gitlab.com/zzamboni/ox-leanpub"))])
+ (ox-mdx-deck . [(20181115 1847) ((emacs (24)) (ox-hugo (0 7))) "org-mode to mdx-deck exporter" single ((:commit . "2e46ac76f7ac279c371474cbbf39634bbe40f4c7") (:authors ("Joshua Wolfe")) (:maintainer "Joshua Wolfe") (:keywords "lisp" "org" "ox" "mdx" "deck") (:url . "https://github.com/WolfeCub/ox-mdx-deck/"))])
+ (ox-mediawiki . [(20180105 2154) ((cl-lib (0 5)) (s (1 9 0))) "Mediawiki Back-End for Org Export Engine" single ((:commit . "a9327150293e370e500ba55bddfe5fc435c6bf9b") (:authors ("Tom Alexander" . "tomalexander@paphus.com")) (:maintainer "Tom Alexander" . "tomalexander@paphus.com") (:keywords "org" "wp" "mediawiki") (:url . "https://github.com/tomalexander/orgmode-mediawiki"))])
+ (ox-minutes . [(20180202 1734) ((emacs (24 4))) "Plain text backend for Org for Meeting Minutes" single ((:commit . "27c29f3fdb9181322ae56f8bace8d95e621230e5") (:authors ("Kaushal Modi" . "kaushal.modi@gmail.com")) (:maintainer "Kaushal Modi" . "kaushal.modi@gmail.com") (:keywords "org" "exporter" "notes") (:url . "https://github.com/kaushalmodi/ox-minutes"))])
+ (ox-nikola . [(20151114 1116) ((emacs (24 4)) (org (8 2 4)) (ox-rst (0 2))) "Export Nikola articles using org-mode." single ((:commit . "5bcbc1a38f6619f62294194f13ca0cd4ca14dd48") (:authors ("IGARASHI Masanao" . "syoux2@gmail.com")) (:maintainer "IGARASHI Masanao" . "syoux2@gmail.com") (:keywords "org" "nikola") (:url . "https://github.com/masayuko/ox-nikola"))])
+ (ox-pandoc . [(20220419 750) ((org (8 2)) (emacs (24 4)) (dash (2 8)) (ht (2 0))) "An Org-mode exporter using pandoc" single ((:commit . "0a35d0fbfa56bdd9ec5ba5bac2fe002b61c05c52") (:authors ("KAWABATA, Taichi" . "kawabata.taichi@gmail.com") ("FENTON, Alex" . "a-fent@github")) (:maintainer "FENTON, Alex" . "a-fent@github") (:keywords "tools") (:url . "https://github.com/a-fent/ox-pandoc"))])
+ (ox-pukiwiki . [(20150124 1716) ((org (8 1))) "Pukiwiki Back-End for Org Export Engine" single ((:commit . "bdbde2c294f5d3de11f08a3fe19f01175d2e011a") (:authors ("Yasushi SHOJI" . "yasushi.shoji@gmail.com")) (:maintainer "Yasushi SHOJI" . "yasushi.shoji@gmail.com") (:keywords "org" "pukiwiki") (:url . "https://github.com/yashi/org-pukiwiki"))])
+ (ox-qmd . [(20210826 1425) ((emacs (24 4))) "Qiita Markdown Back-End for Org Export Engine" single ((:commit . "ccabf6bd79ed87dd3bd57993321ee6d93c1818be") (:authors ("0x60DF" . "0x60DF@gmail.com")) (:maintainer "0x60DF" . "0x60DF@gmail.com") (:keywords "wp") (:url . "https://github.com/0x60df/ox-qmd"))])
+ (ox-report . [(20211226 2004) ((emacs (24 4)) (org-msg (3 9))) "Export your org file to minutes report PDF file" single ((:commit . "c6d8c2f4a0d762ea1732ffdb7bec2ba98aeecdd9") (:authors ("Matthias David" . "matthias@gnu.re")) (:maintainer "Matthias David" . "matthias@gnu.re") (:keywords "org" "outlines" "report" "exporter" "meeting" "minutes") (:url . "https://github.com/DarkBuffalo/ox-report"))])
+ (ox-reveal . [(20220410 1533) ((org (8 3))) "reveal.js Presentation Back-End for Org Export Engine" single ((:commit . "862b41df7734f57019543f6bd82ff7dad7183358") (:authors ("Yujie Wen <yjwen.ty at gmail dot com>")) (:maintainer "Yujie Wen <yjwen.ty at gmail dot com>") (:keywords "outlines" "hypermedia" "slideshow" "presentation"))])
+ (ox-review . [(20220502 1146) ((emacs (26 1)) (org (9))) "Re:VIEW Back-End for Org Export Engine" single ((:commit . "4abb1aa4665d246a38a9a53e5b365b3e57ec6d85") (:authors ("Masashi Fujimoto")) (:maintainer "Masashi Fujimoto") (:keywords "outlines" "hypermedia") (:url . "https://github.com/masfj/ox-review"))])
+ (ox-rfc . [(20220206 1046) ((emacs (24 3)) (org (8 3))) "RFC Back-End for Org Export Engine" single ((:commit . "0849028a2e4a274bfb0fc85d9538203ddf72a9e8") (:authors ("Christian Hopps" . "chopps@devhopps.com")) (:maintainer "Christian Hopps" . "chopps@devhopps.com") (:keywords "org" "rfc" "wp" "xml") (:url . "https://github.com/choppsv1/org-rfc-export"))])
+ (ox-rst . [(20200815 1511) ((emacs (25 1)) (org (8 3))) "Export reStructuredText using org-mode." single ((:commit . "99fa790da55b57a3f2e9aa187493ba434a64250e") (:authors ("Masanao Igarashi" . "syoux2@gmail.com")) (:maintainer "Masanao Igarashi" . "syoux2@gmail.com") (:keywords "org" "rst" "rest" "restructuredtext") (:url . "https://github.com/msnoigrs/ox-rst"))])
+ (ox-slack . [(20200108 1546) ((emacs (24)) (org (9 1 4)) (ox-gfm (1 0))) "Slack Exporter for org-mode" single ((:commit . "bd797dcc58851d5051dc3516c317706967a44721") (:authors ("Matt Price")) (:maintainer "Matt Price") (:keywords "org" "slack" "outlines") (:url . "https://github.com/titaniumbones/ox-slack"))])
+ (ox-spectacle . [(20181211 953) ((org (8 3))) "spectacle.js Presentation Back-End for Org Export Engine" single ((:commit . "9d3ec9a6326289074d8620e97d65e3105307ff51") (:authors ("imfine" . "lorniu@gmail.com")) (:maintainer "imfine" . "lorniu@gmail.com") (:keywords "presentation"))])
+ (ox-ssh . [(20210917 1517) ((emacs (24 4))) "SSH Config Backend for Org Export Engine" single ((:commit . "be3b39160da6ae37b1f1cd175ed854ac41d1cb63") (:authors ("Dante Catalfamo")) (:maintainer "Dante Catalfamo") (:keywords "outlines" "org" "ssh") (:url . "https://github.com/dantecatalfamo/ox-ssh"))])
+ (ox-textile . [(20210919 1738) ((org (8 1))) "Textile Back-End for Org Export Engine" single ((:commit . "5f2f61f572c24d702e922845c11a4c3da38ab261") (:authors ("Yasushi SHOJI" . "yasushi.shoji@gmail.com")) (:maintainer "Yasushi SHOJI" . "yasushi.shoji@gmail.com") (:keywords "org" "textile") (:url . "https://github.com/yashi/org-textile"))])
+ (ox-tiddly . [(20200927 857) ((org (8)) (emacs (24 4))) "Org TiddlyWiki exporter" single ((:commit . "3377d8732aa916e736ce5822c7a9a4fbdc894e37") (:authors ("Derek Feichtinger" . "derek.feichtinger@psi.ch")) (:maintainer "Derek Feichtinger" . "derek.feichtinger@psi.ch") (:keywords "org") (:url . "https://github.com/dfeich/org8-wikiexporters"))])
+ (ox-timeline . [(20220321 2115) ((emacs (24 4))) "HTML Timeline Back-End for Org Export Engine" single ((:commit . "b28bd4ccd5fa114c0f51b9766f0b9be7fe05fdd8") (:authors ("Joel Bryan Juliano <joelbryan dot juliano at gmail dot com>")) (:maintainer "Joel Bryan Juliano <joelbryan dot juliano at gmail dot com>") (:keywords "simple timeline" "timeline" "hypermedia" "html timeline") (:url . "https://github.com/jjuliano/org-simple-timeline"))])
+ (ox-trac . [(20171026 1823) ((org (9 0))) "Org Export Backend to Trac WikiFormat" single ((:commit . "03cc31efb1aa06991918f1071e250a9d58f96cfb") (:authors ("Brian J. Carlson <hacker (at) abutilize (dot) com>")) (:maintainer "Brian J. Carlson <hacker (at) abutilize (dot) com>") (:keywords "org-mode" "trac") (:url . "https://github.com/JalapenoGremlin/ox-trac"))])
+ (ox-tufte . [(20160926 1607) ((org (8 2)) (emacs (24))) "Tufte HTML org-mode export backend" single ((:commit . "49d7ea78fde063b407ce6fa57739f90c83500682") (:authors ("M. Lee Hinman")) (:maintainer "M. Lee Hinman") (:keywords "org" "tufte" "html") (:url . "https://github.com/dakrone/ox-tufte"))])
+ (ox-twbs . [(20200628 1949) nil "Bootstrap compatible HTML Back-End for Org" single ((:commit . "e8a27dc78b7be494d9918f26db7a3bbb6b45020b") (:authors ("Carsten Dominik <carsten at orgmode dot org>") ("Jambunathan K <kjambunathan at gmail dot com>") ("Brandon van Beekum <marsmining at gmail dot com>")) (:maintainer "Carsten Dominik <carsten at orgmode dot org>") (:keywords "org" "html" "publish" "twitter" "bootstrap") (:url . "https://github.com/marsmining/ox-twbs"))])
+ (ox-twiki . [(20200927 857) ((org (8)) (emacs (24 4))) "Org Twiki and Foswiki export" single ((:commit . "3377d8732aa916e736ce5822c7a9a4fbdc894e37") (:authors ("Derek Feichtinger" . "derek.feichtinger@psi.ch")) (:maintainer "Derek Feichtinger" . "derek.feichtinger@psi.ch") (:keywords "org") (:url . "https://github.com/dfeich/org8-wikiexporters"))])
+ (ox-wk . [(20191231 2058) ((emacs (24 4)) (org (8 3))) "Wiki Back-End for Org Export Engine" single ((:commit . "d34d1b72e4e940745a377bfa745dfb618900a09e") (:authors ("Vilibald Wanča" . "vilibald@wvi.cz")) (:maintainer "Vilibald Wanča" . "vilibald@wvi.cz") (:keywords "org" "wp" "wiki") (:url . "https://github.com/w-vi/ox-wk.el"))])
+ (ox-yaow . [(20220103 2307) ((emacs (27)) (f (0 2 0)) (s (1 12 0)) (dash (2 17 0))) "Generate html pages from org files" single ((:commit . "378eb55e39cbc06ead0f0c399351612dca22d716") (:authors ("Laurence Warne")) (:maintainer "Laurence Warne") (:keywords "outlines" "hypermedia") (:url . "https://github.com/LaurenceWarne/ox-yaow.el"))])
+ (ox-zenn . [(20200924 1607) ((emacs (27 1)) (org (9 0))) "Zenn flavored markdown backend for org export engine" single ((:commit . "b53bd82116c9f7dbb5b476d2cfcc8ed0f3bc9c78") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience") (:url . "https://github.com/conao3/ox-zenn.el"))])
+ (p4 . [(20150721 1937) nil "Simple Perforce-Emacs Integration" single ((:commit . "eff047caa75dbe4965defca9d1212454cdb755d5") (:authors ("Gareth Rees" . "gdr@garethrees.org")) (:maintainer "Gareth Rees" . "gdr@garethrees.org") (:url . "https://github.com/gareth-rees/p4.el"))])
+ (pabbrev . [(20160320 2101) nil "Predictive abbreviation expansion" single ((:commit . "56400d5d256b42ffe45c229ea9827f026b650cf5") (:authors ("Phillip Lord" . "phillip.lord@newcastle.ac.uk")) (:maintainer "Phillip Lord" . "phillip.lord@newcastle.ac.uk"))])
+ (pacfiles-mode . [(20200915 1815) ((emacs (26)) (cl-lib (0 5))) "pacnew and pacsave merging tool" tar ((:commit . "8d06f64abc98c3f3338560c8d6eb47719e034069") (:authors ("Carlos G. Cordero <http://github/UndeadKernel>")) (:maintainer "Carlos G. Cordero" . "pacfiles@binarycharly.com") (:keywords "files" "pacman" "arch" "pacnew" "pacsave" "update" "linux") (:url . "https://github.com/UndeadKernel/pacfiles-mode"))])
+ (pack . [(20191017 456) ((emacs (24)) (cl-lib (0 5))) "Pack and unpack archive files" single ((:commit . "85cd856fdc00a2365e88b50373b99f1b3d2227be") (:authors ("10sr" . "8.slashes@gmail.com")) (:maintainer "10sr" . "8.slashes@gmail.com") (:keywords "files" "dired") (:url . "https://github.com/10sr/pack-el"))])
+ (package+ . [(20210124 640) ((emacs (24 3))) "Extensions for the package library." tar ((:commit . "079da78f3be8364e964f5861a5f433ad61b6f654") (:authors ("Ryan Davis" . "ryand-ruby@zenspider.com")) (:maintainer "Ryan Davis" . "ryand-ruby@zenspider.com") (:keywords "extensions" "tools") (:url . "https://github.com/zenspider/package"))])
+ (package-build . [(20220210 1334) ((cl-lib (0 5)) (emacs (25 1))) "Tools for assembling a package archive" tar ((:commit . "032e9bd086029b2fdff09c3c2e606e29682e1fb1") (:authors ("Donald Ephraim Curtis" . "dcurtis@milkbox.net")) (:maintainer "Donald Ephraim Curtis" . "dcurtis@milkbox.net") (:keywords "tools") (:url . "https://github.com/melpa/package-build"))])
+ (package-filter . [(20161122 719) nil "package archive whitelist and blacklist" single ((:commit . "bc73b41aea1d65ca44ef1593ca13126df9bbb39e") (:authors ("Donald Ephraim Curtis" . "dcurtis@milkbox.net")) (:maintainer "Donald Ephraim Curtis" . "dcurtis@milkbox.net") (:url . "https://github.com/milkypostman/package-filter"))])
+ (package-lint . [(20220412 1648) ((cl-lib (0 5)) (emacs (24 1)) (let-alist (1 0 6))) "A linting library for elisp package authors" tar ((:commit . "80a9d9815ab2919c992ad29ae4846443dec43a35") (:authors ("Steve Purcell" . "steve@sanityinc.com") ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "lisp") (:url . "https://github.com/purcell/package-lint"))])
+ (package-lint-flymake . [(20210530 319) ((emacs (26 1)) (package-lint (0 5))) "A package-lint Flymake backend" single ((:commit . "80a9d9815ab2919c992ad29ae4846443dec43a35") (:url . "https://github.com/purcell/package-lint"))])
+ (package-loading-notifier . [(20220130 318) ((emacs (25))) "Notify a package is being loaded" single ((:commit . "bc06ba97a0537aa202f277e5597ac96ca39307ab") (:authors ("SeungKi Kim" . "tttuuu888@gmail.com")) (:maintainer "SeungKi Kim" . "tttuuu888@gmail.com") (:keywords "convenience" "faces" "config" "startup") (:url . "https://github.com/tttuuu888/package-loading-notifier"))])
+ (package-safe-delete . [(20150116 1607) ((emacs (24)) (epl (0 7 -4))) "Safely delete package.el packages" single ((:commit . "138171e4fc03c0ef05a8260cbb5cd2e114c1c194") (:authors ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Fanael Linithien" . "fanael4@gmail.com") (:url . "https://github.com/Fanael/package-safe-delete"))])
+ (package-utils . [(20210221 822) ((restart-emacs (0 1 1))) "Extensions for package.el" single ((:commit . "6a26accfdf9c0f1cbceb09d970bf9c25a72f562a") (:authors ("Philippe Vaucher" . "philippe.vaucher@gmail.com")) (:maintainer "Philippe Vaucher" . "philippe.vaucher@gmail.com") (:keywords "package" "convenience") (:url . "https://github.com/Silex/package-utils"))])
+ (packed . [(20220422 1626) ((emacs (25 1)) (compat (28 1 1 0))) "Package manager agnostic Emacs Lisp package utilities" single ((:commit . "6a427d9da742d78a8f6bd6ed9e31fbf241b2ea82") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "lisp") (:url . "https://github.com/emacscollective/packed"))])
+ (pacmacs . [(20220106 2248) ((emacs (24 4)) (dash (2 18 0)) (cl-lib (0 5)) (f (0 18 0))) "Pacman for Emacs" tar ((:commit . "25a8c30210f6bd94634a7ff743a2f8be391ed3b3") (:authors ("Codingteam" . "codingteam@conference.jabber.ru")) (:maintainer "Alexey Kutepov" . "reximkut@gmail.com") (:url . "http://github.com/codingteam/pacmacs.el"))])
+ (pact-mode . [(20201219 2223) ((emacs (24 3))) "Mode for Pact, a LISPlike smart contract language." single ((:commit . "f48a4faf5f8f8435423bda3888eca6ee67ee13a9") (:authors ("Stuart Popejoy")) (:maintainer "Stuart Popejoy" . "stuart@kadena.io") (:keywords "pact" "lisp" "languages" "blockchain" "smartcontracts" "tools" "mode") (:url . "https://github.com/kadena-io/pact-mode"))])
+ (paganini-theme . [(20180815 1921) ((emacs (24 0))) "A colorful, dark and warm theme." single ((:commit . "255c5a2a8abee9c5935465ec42b9c3604c178c3c") (:authors ("Onur Temizkan")) (:maintainer "Onur Temizkan") (:url . "https://github.com/onurtemizkan/paganini"))])
+ (page-break-lines . [(20210104 2224) ((emacs (24 4))) "Display ^L page breaks as tidy horizontal lines" single ((:commit . "cc283621c64e4f1133a63e0945658a4abecf42ef") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "convenience" "faces") (:url . "https://github.com/purcell/page-break-lines"))])
+ (pager . [(20151202 120) nil "windows-scroll commands" single ((:commit . "5c791ed23f1136e04040d6f4bc9b4ca5b6dc919f") (:authors (nil . "Mikael Sjödin -- mic@docs.uu.se")) (:maintainer nil . "Mikael Sjödin -- mic@docs.uu.se"))])
+ (pager-default-keybindings . [(20130719 2057) ((pager (1 0))) "Add the default keybindings suggested for pager.el" single ((:commit . "dbbd49c2ac5906d1dabf9e9c832bfebc1ab405b3") (:authors ("Nathaniel Flath" . "nflath@gmail.com")) (:maintainer "Nathaniel Flath" . "nflath@gmail.com") (:url . "http://github.com/nflath/pager-default-keybindings"))])
+ (paimon . [(20220326 2051) ((aio (1 0)) (closql (1 2 0)) (emacs (27 1)) (emacsql (3 0 0)) (emacsql-sqlite (3 0 0)) (f (0 20 0)) (ht (2 4)) (transient (0 3 7)) (request (0 3 3))) "A major mode for Splunk" tar ((:commit . "01675ff30ce0f29ad81f9275b4fc0797c0a7073f") (:authors ("r0man" . "roman@burningswell.com")) (:maintainer "r0man" . "roman@burningswell.com") (:keywords "paimon" "search" "tools") (:url . "https://github.com/r0man/paimon.el"))])
+ (pair-tree . [(20211219 1816) ((emacs (27 1)) (dash (2 17 0))) "Visualize a list" single ((:commit . "6fe6143954bb4025ce6b05aad41e777fcbf413d9") (:authors ("Zainab Ali <zainab @kebab-ca.se>")) (:maintainer "Zainab Ali <zainab @kebab-ca.se>") (:keywords "lisp" "tools") (:url . "https://github.com/zainab-ali/pair-tree"))])
+ (palimpsest . [(20200804 2308) nil "Various deletion strategies when editing" single ((:commit . "f474b3ad706373d9953abdc401d683a2a023d28e") (:authors ("Daniel Szmulewicz" . "daniel.szmulewicz@gmail.com")) (:maintainer "Daniel Szmulewicz" . "daniel.szmulewicz@gmail.com"))])
+ (pallet . [(20150512 702) ((dash (2 10 0)) (s (1 9 0)) (f (0 17 1)) (cask (0 7))) "A package management tool for Emacs, using Cask." tar ((:commit . "b8d0df1883224a371ac0a3bc9b9c1c4dc61e6ac0") (:authors ("Robert Dallas Gray")) (:maintainer "Robert Dallas Gray") (:keywords "elpa" "package") (:url . "https://github.com/rdallasgray/pallet"))])
+ (pamparam . [(20210105 1513) ((emacs (26 1)) (lispy (0 27 0)) (worf (0 1 0)) (ivy-posframe (0 5 5))) "Simple and fast flashcards." tar ((:commit . "0ba91149095bee8c43688c68f83f4d365fbe6771") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "outlines" "hypermedia" "flashcards" "memory") (:url . "https://github.com/abo-abo/pamparam"))])
+ (panda . [(20200715 338) ((emacs (25))) "Client for Bamboo's REST API." single ((:commit . "44beb80ac991e58231c05dc4afa1646fa768d573") (:authors ("Sebastian Monia" . "smonia@outlook.com")) (:maintainer "Sebastian Monia" . "smonia@outlook.com") (:keywords "maint" "tool") (:url . "https://github.com/sebasmonia/panda"))])
+ (panda-theme . [(20181128 1738) ((emacs (24))) "Panda Theme" single ((:commit . "60aa47c7a930377807da0d601351ad91e8ca446a") (:authors ("jamiecollinson" . "jamiecollinson@gmail.com")) (:maintainer "jamiecollinson" . "jamiecollinson@gmail.com") (:url . "https://github.com/jamiecollinson/emacs-panda-theme"))])
+ (pandoc . [(20161128 1157) ((emacs (24 4))) "Pandoc interface" single ((:commit . "198d262d09e30448f1672338b0b5a81cf75e1eaa") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "hypermedia" "documentation" "markup" "converter") (:url . "https://github.com/zonuexe/pandoc.el"))])
+ (pandoc-mode . [(20211208 2229) ((hydra (0 10 0)) (dash (2 10 0))) "Minor mode for interacting with Pandoc" tar ((:commit . "c1429887287b7ee9601196e26f97c908b6e4f5c0") (:authors ("Joost Kremers" . "joostkremers@fastmail.fm")) (:maintainer "Joost Kremers" . "joostkremers@fastmail.fm") (:keywords "text" "pandoc") (:url . "http://joostkremers.github.io/pandoc-mode/"))])
+ (pangu-spacing . [(20190823 401) nil "Minor-mode to add space between Chinese and English characters." single ((:commit . "f92898949ba3bf991fd229416f3bbb54e9c6c223") (:authors ("coldnew" . "coldnew.tw@gmail.com")) (:maintainer "coldnew" . "coldnew.tw@gmail.com") (:url . "http://github.com/coldnew/pangu-spacing"))])
+ (paper-theme . [(20200510 5) ((emacs (24))) "A minimal Emacs colour theme." single ((:commit . "350af0e5d53307c900e4f8b2617f3852f51a74d2") (:authors ("Göktuğ Kayaalp")) (:maintainer "Göktuğ Kayaalp") (:keywords "theme" "paper") (:url . "https://dev.gkayaalp.com/elisp/index.html#paper"))])
+ (paperless . [(20201130 1241) ((emacs (24 4)) (f (0 11 0)) (s (1 10 0)) (cl-lib (0 6 1))) "A major mode for sorting and filing PDF documents." tar ((:commit . "2db39586a2914f78f345379511d0e8cea4c96b86") (:authors ("Anthony Green" . "green@moxielogic.com")) (:maintainer "Anthony Green" . "green@moxielogic.com") (:keywords "pdf" "convenience") (:url . "http://github.com/atgreen/paperless"))])
+ (paradox . [(20191011 1111) ((emacs (24 4)) (seq (1 7)) (let-alist (1 0 3)) (spinner (1 7 3)) (hydra (0 13 2))) "A modern Packages Menu. Colored, with package ratings, and customizable." tar ((:commit . "339fe3518d1d102b2295670340e75caf4f01a29a") (:authors ("Artur Malabarba" . "emacs@endlessparentheses.com")) (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com") (:keywords "package" "packages") (:url . "https://github.com/Malabarba/paradox"))])
+ (parchment-theme . [(20200910 2310) ((autothemer (0 2))) "Light theme inspired by Acme and Leuven" single ((:commit . "95e8248edbdb01fedc7db4472bcce90d2d872106") (:authors ("Alex Griffin" . "a@ajgrf.com")) (:maintainer "Alex Griffin" . "a@ajgrf.com") (:url . "https://github.com/ajgrf/parchment"))])
+ (paredit . [(20191121 2328) nil "minor mode for editing parentheses" single ((:commit . "8330a41e8188fe18d3fa805bb9aa529f015318e8") (:authors ("Taylor R. Campbell" . "campbell+paredit@mumble.net")) (:maintainer "Taylor R. Campbell" . "campbell+paredit@mumble.net") (:keywords "lisp"))])
+ (paredit-everywhere . [(20210510 531) ((paredit (22))) "Enable some paredit features in non-lisp buffers" single ((:commit . "b81e5d5356c85001a71640941b469aea9cf2e309") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "languages" "convenience"))])
+ (paredit-menu . [(20160128 1733) ((paredit (25))) "Adds a menu to paredit.el as memory aid" single ((:commit . "cc0ae85bd819f9ebfa4f2a419ab3b2d70e39c9c8") (:authors ("Phillip Lord" . "phillip.lord@newcastle.ac.uk")) (:maintainer "Phillip Lord" . "phillip.lord@newcastle.ac.uk") (:keywords "paredit"))])
+ (paren-completer . [(20160501 1052) ((emacs (24 3))) "Automatically, language agnostically, fill in delimiters." single ((:commit . "74183a8e13fa1266271bdcbcb4bfb29a4f915f0a") (:authors ("Matthew Bregg")) (:maintainer "Matthew Bregg") (:keywords "convenience") (:url . "https://github.com/MatthewBregg/paren-completer"))])
+ (paren-face . [(20220422 1627) ((emacs (25 1)) (compat (28 1 1 0))) "A face for parentheses in lisp modes" single ((:commit . "2c5de87c494ccfbe92c3f1da45f1720d7ecf4acf") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "faces" "lisp") (:url . "https://github.com/tarsius/paren-face"))])
+ (parent-mode . [(20150824 2300) nil "get major mode's parent modes" single ((:commit . "db692cf08deff2f0e973e6e86e26662b44813d1b") (:authors ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Fanael Linithien" . "fanael4@gmail.com") (:url . "https://github.com/Fanael/parent-mode"))])
+ (parinfer-rust-mode . [(20210413 2) ((emacs (26 1))) "An interface for the parinfer-rust library" tar ((:commit . "c2c1bbec6cc7dad4f546868aa07609b8d58a78f8") (:authors ("Justin Barclay" . "justinbarclay@gmail.com")) (:maintainer "Justin Barclay" . "justinbarclay@gmail.com") (:keywords "lisp" "tools") (:url . "https://github.com/justinbarclay/parinfer-rust-mode"))])
+ (parrot . [(20220101 518) ((emacs (24 1))) "Party Parrot rotates gracefully in mode-line." tar ((:commit . "1d381f24d74242018e306d1a0c891bed9a465ac3") (:authors ("Daniel Ting" . "deep.paren.12@gmail.com")) (:maintainer "Daniel Ting" . "deep.paren.12@gmail.com") (:keywords "party" "parrot" "rotate" "sirocco" "kakapo" "games") (:url . "https://github.com/dp12/parrot.git"))])
+ (parse-csv . [(20160512 1723) nil "Parse strings with CSV fields into s-expressions" single ((:commit . "96bef1ffbc89ea12d13311c9fa239c5c3e864890") (:authors ("Edward Marco Baringer (Common Lisp)") ("Matt Curtis" . "matt.r.curtis@gmail.com")) (:maintainer "Matt Curtis" . "matt.r.curtis@gmail.com") (:keywords "csv") (:url . "https://github.com/mrc/el-csv"))])
+ (parse-it . [(20220214 1531) ((emacs (25 1)) (s (1 12 0))) "Basic Parser in Emacs Lisp" tar ((:commit . "c2bdc5ee1d1f029886245f9a5c409e47c1db2cb8") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/parse-it"))])
+ (parsebib . [(20220426 2049) ((emacs (25 1))) "A library for parsing bib files" single ((:commit . "dd4c5540fa6c2cd990cba324741d7abbc8ed2f23") (:authors ("Joost Kremers" . "joostkremers@fastmail.fm")) (:maintainer "Joost Kremers" . "joostkremers@fastmail.fm") (:keywords "text" "bibtex") (:url . "https://github.com/joostkremers/parsebib"))])
+ (parsec . [(20180730 16) ((emacs (24)) (cl-lib (0 5))) "Parser combinator library" single ((:commit . "2cbbbc2254aa7bcaa4fb5e07c8c1bf2f381dba26") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions") (:url . "https://github.com/cute-jumper/parsec.el"))])
+ (parseclj . [(20220422 936) ((emacs (25))) "Clojure/EDN parser" tar ((:commit . "4d0e780e00f1828b00c43099e6eebc6582998f72") (:authors ("Arne Brasseur" . "arne@arnebrasseur.net")) (:maintainer "Arne Brasseur" . "arne@arnebrasseur.net") (:keywords "lisp" "clojure" "edn" "parser"))])
+ (parseedn . [(20220422 936) ((emacs (26)) (parseclj (1 1 0)) (map (2))) "Clojure/EDN parser" single ((:commit . "dce2eed418ad21acf3d2d6d75c37dfa679b22359") (:authors ("Arne Brasseur" . "arne@arnebrasseur.net")) (:maintainer "Arne Brasseur" . "arne@arnebrasseur.net") (:keywords "lisp" "clojure" "edn" "parser"))])
+ (pasp-mode . [(20180404 1700) ((emacs (24 3))) "- A major mode for editing Answer Set Programs." single ((:commit . "59385eb0e8ebcfc8c11dd811fb145d4b0fa3cc92") (:authors ("Henrik Jürges" . "juerges.henrik@gmail.com")) (:maintainer "Henrik Jürges" . "juerges.henrik@gmail.com") (:keywords "asp" "pasp" "answer set programs" "potassco answer set programs" "major mode" "languages") (:url . "https://github.com/santifa/pasp-mode"))])
+ (pass . [(20210203 810) ((emacs (25)) (password-store (2 1 0)) (password-store-otp (0 1 5)) (f (0 17))) "Major mode for password-store.el" single ((:commit . "5651da53137db9adcb125b4897c2fe27eeb4368d") (:authors ("Nicolas Petton" . "petton.nicolas@gmail.com") ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Nicolas Petton" . "petton.nicolas@gmail.com") (:keywords "password-store" "password" "keychain"))])
+ (passmm . [(20210109 8) ((emacs (24 4)) (password-store (0))) "A minor mode for pass (Password Store)." single ((:commit . "d78d1bf4f397180d2256248df589f33aafb4c8b4") (:authors ("Peter Jones" . "pjones@devalot.com")) (:maintainer "Peter Jones" . "pjones@devalot.com") (:url . "https://github.com/pjones/passmm"))])
+ (password-generator . [(20210425 2227) nil "Password generator for humans. Good, Bad, Phonetic passwords included." single ((:commit . "c1da9790d594bc745cdbcc8003153e408aa92a5f") (:authors ("Vandrlexay")) (:maintainer "Vandrlexay") (:url . "http://github.com/vandrlexay/emacs-password-genarator"))])
+ (password-mode . [(20220222 1757) ((emacs (25 1))) "Hide password text using overlays" single ((:commit . "456a01e959140cb070e77bce5032a6885c7b7ae0") (:authors ("Jürgen Hötzel" . "juergen@archlinux.org")) (:maintainer "Jürgen Hötzel" . "juergen@archlinux.org") (:keywords "docs" "password" "passphrase") (:url . "https://github.com/juergenhoetzel/password-mode"))])
+ (password-store . [(20220306 2230) ((emacs (25)) (s (1 9 0)) (with-editor (2 5 11)) (auth-source-pass (5 0 0))) "Password store (pass) support" single ((:commit . "c4d8a1d815e79ddd89a85d3e36a41d29f0475771") (:authors ("Svend Sorensen" . "svend@svends.net")) (:maintainer "Tino Calancha" . "tino.calancha@gmail.com") (:keywords "tools" "pass" "password" "password-store") (:url . "https://www.passwordstore.org/"))])
+ (password-store-otp . [(20220128 1320) ((emacs (25)) (s (1 9 0)) (password-store (0 1))) "Password store (pass) OTP extension support" single ((:commit . "be3a00a981921ed1b2f78012944dc25eb5a0beca") (:authors ("Daniel Barreto")) (:maintainer "Daniel Barreto") (:keywords "tools" "pass") (:url . "https://github.com/volrath/password-store-otp.el"))])
+ (password-vault . [(20220321 1521) ((cl-lib (0 2)) (emacs (24))) "A Password manager for Emacs." single ((:commit . "763750e2fbdd3bc96dfd256215b5e49394b7bef3") (:authors ("Javier \"PuercoPop\" Olaechea" . "pirata@gmail.com")) (:maintainer "Javier \"PuercoPop\" Olaechea" . "pirata@gmail.com") (:keywords "password" "productivity") (:url . "http://github.com/PuercoPop/password-vault"))])
+ (paste-of-code . [(20170709 2355) ((emacs (24 3)) (request (0 2 0))) "paste code on https://paste.ofcode.org" single ((:commit . "92d258e8ec98598d847ecab82903f9224c7c2050") (:authors ("Bernhard Specht" . "bernhard@specht.net")) (:maintainer "Bernhard Specht" . "bernhard@specht.net") (:keywords "lisp"))])
+ (pastebin . [(20101125 2002) nil "A simple interface to the www.pastebin.com webservice" single ((:commit . "8e9a829298ce0f747ab80758aa26caeb2af6cb30"))])
+ (pastehub . [(20140615 620) nil "A client for the PasteHub cloud service" single ((:commit . "37b045c67659c078f1517d0fbd5282dab58dca23") (:authors ("Kiyoka Nishiyama")) (:maintainer "Kiyoka Nishiyama") (:url . "https://github.com/kiyoka/pastehub"))])
+ (pastelmac-theme . [(20151031 236) ((emacs (24 1))) "a soothing theme with a pastel color palette" single ((:commit . "bead21741e3f46f6506e8aef4469d4240a819389") (:authors ("Brian Mastenbrook" . "brian@mastenbrook.net")) (:maintainer "Brian Mastenbrook" . "brian@mastenbrook.net") (:keywords "themes") (:url . "https://github.com/bmastenbrook/pastelmac-theme-el"))])
+ (pastery . [(20171114 349) ((emacs (24 4)) (request (0 2 0))) "paste snippets to pastery.net." tar ((:commit . "4493be98b743b4d062cb4e00760125e394a55022") (:authors ("Bruno Dias" . "dias.h.bruno@gmail.com")) (:maintainer "Bruno Dias" . "dias.h.bruno@gmail.com") (:keywords "tools") (:url . "https://github.com/diasbruno/pastery.el"))])
+ (path-headerline-mode . [(20140423 1332) nil "Displaying file path on headerline." single ((:commit . "b5b2725c6a8b1cb592fc242b7dbbd54b4dff2e69") (:authors ("7696122")) (:maintainer "7696122") (:keywords "headerline") (:url . "https://github.com/7696122/path-headerline-mode"))])
+ (path-helper . [(20181208 2229) ((emacs (24))) "Set PATH environment variables from config files" single ((:commit . "34538affb3f341b3c56a875bb094ddb2b859a8ef") (:authors ("Arnaud Rouanet" . "arnaud@rouanet.org")) (:maintainer "Arnaud Rouanet" . "arnaud@rouanet.org") (:keywords "tools" "unix") (:url . "https://github.com/arouanet/path-helper"))])
+ (pathify . [(20160423 846) nil "Symlink your scripts into a PATH directory" single ((:commit . "401b184c743694a60b3bc4273fc43de05cd5ac4b") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "convenience") (:url . "https://gitlab.com/alezost-emacs/pathify"))])
+ (paxedit . [(20160730 1727) ((cl-lib (0 5)) (paredit (23))) "Structured, Context Driven LISP Editing and Refactoring" single ((:commit . "09f3d5aeb108937a801e77ef413e29eaa4ecc4be") (:authors ("Mustafa Shameem")) (:maintainer "Mustafa Shameem") (:keywords "lisp" "refactoring" "context") (:url . "https://github.com/promethial/paxedit"))])
+ (pbcopy . [(20150225 459) nil "Emacs Interface to pbcopy" single ((:commit . "338f7245746b5de1bb96c5cc2b32bfd9b5d83272") (:authors ("Daniel Nelson")) (:maintainer "Daniel Nelson") (:keywords "mac" "osx" "pbcopy") (:url . "https://github.com/jkp/pbcopy.el"))])
+ (pc-bufsw . [(20201011 1918) nil "PC style quick buffer switcher" single ((:commit . "a7295e4813d636d5a20605d134acd42e4e4fe8fa") (:authors ("Igor Bukanov" . "igor@mir2.org")) (:maintainer "Igor Bukanov" . "igor@mir2.org") (:keywords "buffer") (:url . "https://github.com/ibukanov/pc-bufsw"))])
+ (pcache . [(20201226 634) ((emacs (25 1))) "persistent caching for Emacs." single ((:commit . "893d2a637423bae2cc5e72c559e3a9d1518797c9") (:authors ("Yann Hodique" . "yann.hodique@gmail.com")) (:maintainer "Yann Hodique" . "yann.hodique@gmail.com") (:keywords "extensions"))])
+ (pcap-mode . [(20161025 1448) ((emacs (24 3))) "Major mode for working with PCAP files" single ((:commit . "52780669af0ade136f84d73f21b4dbb7ab655416") (:authors ("Aaron Conole" . "aconole@bytheb.org")) (:maintainer "Aaron Conole" . "aconole@bytheb.org") (:keywords "pcap" "packets" "tcpdump" "wireshark" "tshark"))])
+ (pcmpl-args . [(20220131 2316) ((emacs (25 1))) "Enhanced shell command completion" single ((:commit . "94a19b693a226aa11b15627e01f9f4c9af752bab") (:authors ("Jonathan Waltman" . "jonathan.waltman@gmail.com")) (:maintainer "Jonathan Waltman" . "jonathan.waltman@gmail.com") (:keywords "abbrev" "completion" "convenience" "processes" "terminals" "unix") (:url . "https://github.com/JonWaltman/pcmpl-args.el"))])
+ (pcmpl-git . [(20170121 59) nil "pcomplete for git" tar ((:commit . "9472ac70baeda025ef7becd1cf141d72aec93f32") (:authors ("Leo Liu" . "sdl.web@gmail.com")) (:maintainer "Leo Liu" . "sdl.web@gmail.com") (:keywords "tools"))])
+ (pcmpl-homebrew . [(20200911 742) nil "pcomplete for homebrew" single ((:commit . "a2044042dd498abad1dc06162a8ee0d70314ca40") (:authors ("zwild" . "judezhao@outlook.com")) (:maintainer "zwild" . "judezhao@outlook.com") (:keywords "pcomplete" "homebrew" "tools" "cask" "services"))])
+ (pcmpl-pip . [(20181229 1420) ((s (1 12 0)) (f (0 19 0)) (seq (2 15))) "pcomplete for pip" single ((:commit . "bc79228674ad5c1bc458c90dd8839790fb0a09e8") (:authors ("zwild" . "judezhao@outlook.com")) (:maintainer "zwild" . "judezhao@outlook.com") (:keywords "pcomplete" "pip" "python" "tools"))])
+ (pcomplete-extension . [(20190928 519) ((emacs (24)) (cl-lib (0 5))) "additional completion for pcomplete" single ((:commit . "bc5eb204fee659e0980056009409b44bc7655716") (:authors ("Thierry Volpiatto" . "thierry.volpiatto@gmail.com")) (:maintainer "Thierry Volpiatto" . "thierry.volpiatto@gmail.com") (:url . "https://github.com/thierryvolpiatto/pcomplete-extension"))])
+ (pcre2el . [(20161120 2103) ((emacs (24)) (cl-lib (0 3))) "regexp syntax converter" single ((:commit . "0b5b2a2c173aab3fd14aac6cf5e90ad3bf58fa7d") (:authors ("joddie <jonxfield at gmail.com>")) (:maintainer "joddie <jonxfield at gmail.com>") (:url . "https://github.com/joddie/pcre2el"))])
+ (pcsv . [(20150220 1131) nil "Parser of csv" single ((:commit . "798e0933f8d0818beb17aebf3b1056bbf74e03d0") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "data") (:url . "https://github.com/mhayashi1120/Emacs-pcsv/raw/master/pcsv.el"))])
+ (pdb-capf . [(20200419 1237) ((emacs (25 1))) "Completion-at-point function for python debugger" single ((:commit . "2f4099aa1330f87df4e9cd526de057ee9b71de6c") (:authors ("Andrii Kolomoiets" . "andreyk.mad@gmail.com")) (:maintainer "Andrii Kolomoiets" . "andreyk.mad@gmail.com") (:keywords "languages" "abbrev" "convenience") (:url . "https://github.com/muffinmad/emacs-pdb-capf"))])
+ (pdb-mode . [(20150128 1751) nil "Major mode for editing Protein Data Bank files" single ((:commit . "855fb18ebb73b5df30c8d7677c2bcd0f361b138a") (:authors (nil . "charles.bond@uwa.edu.au")) (:maintainer nil . "aix.bing@gmail.com") (:keywords "data" "pdb") (:url . "http://bondxray.org/software/pdb-mode/"))])
+ (pdf-tools . [(20220510 110) ((emacs (24 3)) (nadvice (0 3)) (tablist (1 0)) (let-alist (1 0 4))) "Support library for PDF documents" tar ((:commit . "ab61b0472980200f52e2e23782bc07255baebe72") (:authors ("Andreas Politz" . "mail@andreas-politz.de")) (:maintainer "Vedang Manerikar" . "vedang.manerikar@gmail.com") (:keywords "files" "multimedia") (:url . "http://github.com/vedang/pdf-tools/"))])
+ (pdf-view-restore . [(20190904 1708) ((pdf-tools (0 90)) (emacs (26 0))) "Support for opening last known pdf position in pdfview mode" single ((:commit . "5a1947c01a3edecc9e0fe7629041a2f53e0610c9") (:authors ("Kevin Kim" . "kevinkim1991@gmail.com")) (:maintainer "Kevin Kim" . "kevinkim1991@gmail.com") (:keywords "files" "convenience") (:url . "https://github.com/007kevin/pdf-view-restore"))])
+ (pdfgrep . [(20210203 1730) ((emacs (24 4))) "run `pdfgrep' and display the results." single ((:commit . "a4ca0a1e6521de93f28bb6736a5344b4974d144c") (:authors ("Jérémy Compostella" . "jeremy.compostella@gmail.com")) (:maintainer "Jérémy Compostella" . "jeremy.compostella@gmail.com") (:keywords "extensions" "mail" "pdf" "grep") (:url . "https://github.com/jeremy-compostella/pdfgrep"))])
+ (peacock-theme . [(20170808 1320) ((emacs (24 0))) "an Emacs 24 theme based on Peacock (tmTheme)" single ((:commit . "9e46fbfb562b6e26c6e3d6d618b044b3694da4c8") (:authors ("Jason Milkins")) (:maintainer "Jason Milkins") (:url . "https://github.com/emacsfodder/tmtheme-to-deftheme"))])
+ (peek-mode . [(20130620 1946) ((elnode (0 9 8 1))) "Serve buffers live over HTTP with elnode backend" tar ((:commit . "55a7dd011375330c7d57322257a5167516702c71") (:authors ("Erik Iverson" . "erik@sigmafield.org")) (:maintainer "Erik Iverson" . "erik@sigmafield.org") (:url . "https://github.com/erikriverson/peek-mode"))])
+ (peep-dired . [(20160321 2237) nil "Peep at files in another window from dired buffers" single ((:commit . "29f6e7058f635b0084880a1f890a6c92501e8c29") (:authors ("Adam Sokolnicki" . "adam.sokolnicki@gmail.com")) (:maintainer "Adam Sokolnicki" . "adam.sokolnicki@gmail.com") (:keywords "files" "convenience"))])
+ (peertube . [(20210101 1007) ((emacs (25 1)) (transmission (0 12 1))) "Query and download PeerTube videos" single ((:commit . "bb529db154596e86327829edbd7144b67cf72255") (:authors ("yoctocell" . "public@yoctocell.xyz")) (:maintainer "yoctocell" . "public@yoctocell.xyz") (:keywords "peertube" "multimedia") (:url . "https://git.sr.ht/~yoctocell/peertube"))])
+ (pelican-mode . [(20190124 2336) ((emacs (25))) "Minor mode for editing Pelican sites" single ((:commit . "65d7caf5d926599a5007eb7bc279215908aa5252") (:authors ("Joe Wreschnig" . "joe.wreschnig@gmail.com")) (:maintainer "Joe Wreschnig" . "joe.wreschnig@gmail.com") (:keywords "convenience" "editing") (:url . "https://git.korewanetadesu.com/pelican-mode.git"))])
+ (pepita . [(20200228 2257) ((emacs (25)) (csv (2 1))) "Run Splunk search commands, export results to CSV/HTML/JSON" single ((:commit . "c72c4a6f1e47ed5fe5103e0eaadad5a76deeec30") (:authors ("Sebastian Monia" . "smonia@outlook.com")) (:maintainer "Sebastian Monia" . "smonia@outlook.com") (:keywords "tools" "convenience" "matching") (:url . "https://github.com/sebasmonia/pepita.git"))])
+ (perfect-margin . [(20220426 1701) ((emacs (24 0)) (cl-lib (0 5))) "auto center windows, work with minimap and/or linum-mode" single ((:commit . "d5cb5f075264ff2e625099aebca3151f4f35019a") (:authors ("Randall Wang" . "randall.wjz@gmail.com")) (:maintainer "Randall Wang" . "randall.wjz@gmail.com") (:keywords "convenience" "frames") (:url . "https://github.com/mpwang/perfect-margin"))])
+ (perlbrew . [(20161109 709) nil "A perlbrew wrapper for Emacs" single ((:commit . "3a3406c3307c92aa30f9400d430925c434a3b6f0") (:authors ("Kentaro Kuribayashi" . "kentarok@gmail.com")) (:maintainer "Kentaro Kuribayashi" . "kentarok@gmail.com") (:keywords "emacs" "perl"))])
+ (persistent-overlays . [(20161128 700) nil "Minor mode to store selected overlays to be loaded later" tar ((:commit . "f563c8b966edc78c9d806661c4eb80e4781c4eab") (:authors ("Michael Neilly" . "mneilly@yahoo.com")) (:maintainer "Michael Neilly" . "mneilly@yahoo.com") (:keywords "overlays" "persistent") (:url . "https://github.com/mneilly/Emacs-Persistent-Overlays"))])
+ (persistent-scratch . [(20220218 810) ((emacs (24))) "Preserve the scratch buffer across Emacs sessions" single ((:commit . "4e159967801b75d07303221c4e5a2b89039c6a11") (:authors ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Fanael Linithien" . "fanael4@gmail.com") (:url . "https://github.com/Fanael/persistent-scratch"))])
+ (persistent-soft . [(20150223 1853) ((pcache (0 3 1)) (list-utils (0 4 2))) "Persistent storage, returning nil on failure" single ((:commit . "a1e0ddf2a12a6f18cab565dee250f070384cbe02") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "data" "extensions") (:url . "http://github.com/rolandwalker/persistent-soft"))])
+ (persp-fr . [(20191108 754) ((emacs (25 1)) (persp-mode (2 9 6)) (dash (2 13 0))) "In persp-mode, show perspective list in the GUI window title" single ((:commit . "1adbb6a9f9a4db580a9b7ed8b4091738e01345e6") (:authors ("Francesc Rocher" . "francesc.rocher@gmail.com")) (:maintainer "Francesc Rocher" . "francesc.rocher@gmail.com") (:keywords "perspectives" "workspace" "windows" "convenience") (:url . "http://github.com/rocher/persp-fr"))])
+ (persp-mode . [(20220206 1742) ((emacs (24 3))) "windows/buffers sets shared among frames + save/load." single ((:commit . "7a594a3d8f1c4ba9234dcd831a589e87f3f4ae86") (:authors ("Constantin Kulikov (Bad_ptr)" . "zxnotdead@gmail.com")) (:maintainer "Constantin Kulikov (Bad_ptr)" . "zxnotdead@gmail.com") (:keywords "perspectives" "session" "workspace" "persistence" "windows" "buffers" "convenience") (:url . "https://github.com/Bad-ptr/persp-mode.el"))])
+ (persp-mode-project-bridge . [(20220115 602) ((emacs (27 1)) (persp-mode (2 9))) "Integration of persp-mode + project.el" single ((:commit . "cacc22942ca5dffdfc3d16cf88576ce0bd9e3a68") (:authors ("Constantin Kulikov (Bad_ptr)" . "zxnotdead@gmail.com") ("Siavash Askari Nasr" . "siavash.askari.nasr@gmail.com")) (:maintainer "Siavash Askari Nasr" . "siavash.askari.nasr@gmail.com") (:keywords "vc" "persp-mode" "perspective" "project" "project.el") (:url . "https://github.com/CIAvash/persp-mode-project-bridge"))])
+ (persp-mode-projectile-bridge . [(20170315 1120) ((persp-mode (2 9)) (projectile (0 13 0)) (cl-lib (0 5))) "persp-mode + projectile integration." single ((:commit . "f6453cd7b8b4352c06e771706f2c5b7e2cdff1ce") (:authors ("Constantin Kulikov (Bad_ptr)" . "zxnotdead@gmail.com")) (:maintainer "Constantin Kulikov (Bad_ptr)" . "zxnotdead@gmail.com") (:keywords "persp-mode" "projectile") (:url . "https://github.com/Bad-ptr/persp-mode-projectile-bridge.el"))])
+ (persp-projectile . [(20210618 708) ((perspective (1 9)) (projectile (2 4)) (cl-lib (0 3))) "Perspective integration with Projectile" single ((:commit . "4e374d7650c7e041df5af5ac280a44d4a4ec705a") (:authors ("Daniel Wu")) (:maintainer "Daniel Wu") (:keywords "project" "convenience"))])
+ (perspective . [(20220420 1550) ((emacs (24 4)) (cl-lib (0 5))) "switch between named \"perspectives\" of the editor" single ((:commit . "4e38680793585a907ae46b148697030c2b552a00") (:authors ("Natalie Weizenbaum" . "nex342@gmail.com")) (:maintainer "Natalie Weizenbaum" . "nex342@gmail.com") (:keywords "workspace" "convenience" "frames") (:url . "http://github.com/nex3/perspective-el"))])
+ (perspective-exwm . [(20220125 1939) ((emacs (27 1)) (burly (0 2 -1)) (exwm (0 26)) (perspective (2 17))) "Better integration for perspective.el and EXWM" single ((:commit . "8afdbf894a888854ce9dfbe0ad2a5dc41f75ecb8") (:authors ("Korytov Pavel" . "thexcloud@gmail.com")) (:maintainer "Korytov Pavel" . "thexcloud@gmail.com") (:url . "https://github.com/SqrtMinusOne/perspective-exwm.el"))])
+ (perspeen . [(20171203 1021) ((emacs (25 0)) (powerline (2 4))) "An package for multi-workspace" tar ((:commit . "edb70c530bda50ff3d1756e32a703d5fef5e5480") (:authors ("Peng Li" . "seudut@gmail.com")) (:maintainer "Peng Li" . "seudut@gmail.com") (:keywords "lisp") (:url . "https://github.com/seudut/perspeen"))])
+ (pest-mode . [(20200321 504) ((emacs (26 3))) "Major mode for editing Pest files" single ((:commit . "43447a2c70f98edd1139005e32f437d3f142442b") (:authors ("ksqsf" . "i@ksqsf.moe")) (:maintainer "ksqsf" . "i@ksqsf.moe") (:keywords "languages") (:url . "https://github.com/ksqsf/pest-mode"))])
+ (pfuture . [(20220425 1242) ((emacs (25 2))) "a simple wrapper around asynchronous processes" single ((:commit . "f9e67bd7edbd5b4e033efd82c0acc4a85ff860a8") (:authors ("Alexander Miller" . "alexanderm@web.de")) (:maintainer "Alexander Miller" . "alexanderm@web.de") (:url . "https://github.com/Alexander-Miller/pfuture"))])
+ (pg . [(20130731 2142) nil "Emacs Lisp interface to the PostgreSQL RDBMS" single ((:commit . "4f6516ec3946d95dcef49abb6703cc89ecb5183d") (:authors ("Eric Marsden" . "emarsden@laas.fr")) (:maintainer "Helmut Eller" . "heller@common-lisp.net") (:keywords "data" "comm" "database" "postgresql"))])
+ (pgdevenv . [(20150105 2236) nil "Manage your PostgreSQL development envs" tar ((:commit . "7f1d5bc734750aca98cf67a9491cdbd5615fd132") (:authors ("Dimitri Fontaine" . "dim@tapoueh.org")) (:maintainer "Dimitri Fontaine" . "dim@tapoueh.org") (:keywords "emacs" "postgresql" "development" "environment" "shell" "debug" "gdb"))])
+ (ph . [(20161029 1522) ((emacs (24 3))) "A global minor mode for managing multiple projects." tar ((:commit . "ed80dad9211583ed0db633448b3624c99b7fac23") (:authors ("Alexander Gromnitsky" . "alexander.gromnitsky@gmail.com")) (:maintainer "Alexander Gromnitsky" . "alexander.gromnitsky@gmail.com"))])
+ (phabricator . [(20160510 1425) ((emacs (24 4)) (dash (1 0)) (projectile (0 13 0)) (s (1 10 0)) (f (0 17 2))) "Phabricator/Arcanist helpers for Emacs." single ((:commit . "d09d6f059aea92d3b11c68664a5e80c901182ab8") (:authors ("Andrew Tulloch")) (:maintainer "Andrew Tulloch") (:keywords "phabricator" "arcanist" "diffusion") (:url . "https://github.com/ajtulloch/phabricator.el"))])
+ (phan . [(20200805 356) ((emacs (24)) (composer (0 0 8)) (f (0 17))) "Utility functions for Phan (PHP static analizer)" single ((:commit . "b7d523630bb072c4dbcfa9995dc734b25b72a69f") (:authors ("USAMI Kenta" . "tadsan@pixiv.com")) (:maintainer "USAMI Kenta" . "tadsan@pixiv.com") (:keywords "tools" "php") (:url . "https://github.com/emacs-php/phan.el"))])
+ (phi-autopair . [(20210306 424) ((paredit (20))) "another simple-minded autopair implementation" single ((:commit . "6a67c37d31a3ff9261fc9f812547a0c86721fc90") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://zk-phi.gitub.io/"))])
+ (phi-grep . [(20210306 425) ((cl-lib (0 1)) (emacs (26 1))) "Interactively-editable recursive grep implementation in elisp" single ((:commit . "7e2804c7ab4e875c7511917692c4b192662aa1ae") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://github.com/zk-phi/phi-grep"))])
+ (phi-rectangle . [(20200911 204) nil "another rectangle-mark command (rewrite of rect-mark)" single ((:commit . "43ee8aea9998b34a9fdb28d7da2e4f75e4154030") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://zk-phi.github.io/"))])
+ (phi-search . [(20200510 906) nil "another incremental search & replace, compatible with \"multiple-cursors\"" tar ((:commit . "c34f5800968922d1f9e7b10092b8705d6640ad18") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://hins11.yu-yake.com/"))])
+ (phi-search-dired . [(20200816 1542) ((phi-search (2 2 0))) "interactive filtering for dired powered by phi-search" single ((:commit . "f014a9fb0b6a94af2df0e22f91ef79ce6996afd7") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://hins11.yu-yake.com/"))])
+ (phi-search-mc . [(20160324 1503) ((phi-search (2 0 0)) (multiple-cursors (1 2 1))) "multiple-cursors extension for phi-search" single ((:commit . "7aa671910f766437089aec26c3aa7814222d1356") (:authors ("Akinori MUSHA" . "knu@iDaemons.org")) (:maintainer "Akinori MUSHA" . "knu@iDaemons.org") (:keywords "search" "cursors") (:url . "https://github.com/knu/phi-search-mc.el"))])
+ (phi-search-migemo . [(20170618 921) ((phi-search (2 2 0)) (migemo (1 9 1))) "migemo extension for phi-search" single ((:commit . "308909ebfc8003d16673f97ca9eb26a667b72969") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://hins11.yu-yake.com/"))])
+ (phoenix-dark-mono-theme . [(20170729 1406) nil "Monochromatic version of the Phoenix theme" single ((:commit . "a54f515d162148bcb38676980bc2316adb3d7b8b") (:authors ("J Irving" . "j@lollyshouse.ca")) (:maintainer "J Irving" . "j@lollyshouse.ca") (:url . "http://github.com/j0ni/phoenix-dark-mono"))])
+ (phoenix-dark-pink-theme . [(20190821 48) nil "Originally a port of the Sublime Text 2 theme" single ((:commit . "ddd98a45775be105984ec598384e68df3d3e8046") (:authors ("J Irving" . "j@lollyshouse.ca")) (:maintainer "J Irving" . "j@lollyshouse.ca") (:url . "http://github.com/j0ni/phoenix-dark-pink"))])
+ (php-boris . [(20130527 821) nil "Run boris php REPL" single ((:commit . "f2faebf610c917f7091f7ec0cd97645629c4f819") (:authors ("Tom Regner")) (:maintainer "Tom Regner" . "tom@goochesa.de") (:keywords "php" "commint" "repl" "boris"))])
+ (php-boris-minor-mode . [(20140209 1835) ((php-boris (0 0 1)) (highlight (0))) "a minor mode to evaluate PHP code in the Boris repl" single ((:commit . "c70e176dd6545f2d42ca3427e87b469635616d8a") (:authors ("steckerhalter")) (:maintainer "steckerhalter") (:keywords "php" "repl" "eval") (:url . "https://github.com/steckerhalter/php-boris-minor-mode"))])
+ (php-cs-fixer . [(20210923 718) ((cl-lib (0 5))) "php-cs-fixer wrapper." single ((:commit . "7e12a1af5d65cd8a801eeb5564c6268a4e190c0c") (:authors ("Philippe Ivaldi for OVYA")) (:maintainer "Philippe Ivaldi for OVYA") (:keywords "languages" "php") (:url . "https://github.com/OVYA/php-cs-fixer"))])
+ (php-eldoc . [(20140202 1941) nil "eldoc backend for php" tar ((:commit . "df05064146b884d9081e10657e32dc480f070cfe") (:authors ("sabof")) (:maintainer "sabof") (:url . "https://github.com/sabof/php-eldoc"))])
+ (php-mode . [(20220120 1959) ((emacs (25 2))) "Major mode for editing PHP code" tar ((:commit . "4503672471b8fdaaea6c454344817a119c87fcc6") (:authors ("Eric James Michael Ritz")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "languages" "php") (:url . "https://github.com/emacs-php/php-mode"))])
+ (php-quickhelp . [(20210819 2025) ((emacs (25 1))) "Quickhelp at point for php" single ((:commit . "d5e11b7a6bad64550521e8822139a33218b8c9bb") (:authors ("Vincenzo Pupillo")) (:maintainer "Vincenzo Pupillo") (:url . "https://github.com/vpxyz/php-quickhelp"))])
+ (php-refactor-mode . [(20171124 635) nil "Minor mode to quickly and safely perform common refactorings" single ((:commit . "7a794b0618df2882b1bd586fdd698dba0bc5130d") (:authors ("Matthew M. Keeler" . "keelerm84@gmail.com")) (:maintainer "Matthew M. Keeler" . "keelerm84@gmail.com") (:keywords "php" "refactor") (:url . "https://github.com/keelerm84/php-refactor-mode.el"))])
+ (php-runtime . [(20181212 1825) ((emacs (25)) (cl-lib (0 5)) (f (0 20)) (s (1 7))) "Language binding bridge to PHP" single ((:commit . "017e0e70f07d6b25e37d5c5f4d271a914b677631") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "processes" "php") (:url . "https://github.com/emacs-php/php-runtime.el"))])
+ (php-scratch . [(20210706 459) ((emacs (24 3)) (s (1 11 0)) (php-mode (1 17 0))) "A scratch buffer to interactively evaluate php code" single ((:commit . "b6bfd279da8a8ac7fc30459485956f3fd5d02573") (:authors ("Tijs Mallaerts" . "tijs.mallaerts@gmail.com")) (:maintainer "Tijs Mallaerts" . "tijs.mallaerts@gmail.com") (:url . "https://github.com/mallt/php-scratch"))])
+ (phpactor . [(20220310 1511) ((emacs (25 1)) (f (0 17)) (php-runtime (0 2)) (composer (0 2 0)) (async (1 9 3))) "Interface to Phpactor" tar ((:commit . "34195f1533209e2ffd0f898a69c7db2bffd1eabe") (:authors ("USAMI Kenta" . "tadsan@zonu.me") ("Mikael Kermorgant" . "mikael@kgtech.fi")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "tools" "php") (:url . "https://github.com/emacs-php/phpactor.el"))])
+ (phpstan . [(20210714 1805) ((emacs (24 3)) (php-mode (1 22 3))) "Interface to PHPStan" single ((:commit . "0869b152f82a76138daa53e953285936b9d558bd") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "tools" "php") (:url . "https://github.com/emacs-php/phpstan.el"))])
+ (phpt-mode . [(20190512 1809) ((emacs (25)) (polymode (0 1 5)) (php-mode (1 21 2))) "Major mode for editing PHPT test code" single ((:commit . "deb386f1a81003074c476f15e1975d445ff6df01") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "languages" "php") (:url . "https://github.com/emacs-php/phpt-mode"))])
+ (phpunit . [(20180829 1438) ((s (1 12 0)) (f (0 19 0)) (pkg-info (0 6)) (cl-lib (0 5)) (emacs (24 3))) "Launch PHP unit tests using phpunit" tar ((:commit . "fe6bc91c3bd8b329c6d26ad883a025f06b5121ee") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com") ("Eric Hansen" . "hansen.c.eric@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "tools" "php" "tests" "phpunit") (:url . "https://github.com/nlamirault/phpunit.el"))])
+ (pianobar . [(20201002 1756) nil "thin wrapper for Pianobar, a Pandora Radio client" single ((:commit . "d708417608df4f09ee565fddaad03dfe181829a8") (:authors ("Aaron Griffith" . "aargri@gmail.com")) (:maintainer "Aaron Griffith" . "aargri@gmail.com") (:url . "http://github.com/agrif/pianobar.el"))])
+ (pickle . [(20190923 354) ((emacs (25 1)) (cl-lib (0 6 1))) "Major mode for editing cucumber gherkin files." single ((:commit . "3a0a717f2a24827667f34bc53830a3b81cd57460") (:authors ("Matthew Carter" . "m@ahungry.com")) (:maintainer "Matthew Carter" . "m@ahungry.com") (:keywords "ahungry" "languages" "cucumber" "gherkin") (:url . "https://github.com/ahungry/pickle-mode"))])
+ (picpocket . [(20210806 1135) ((emacs (25 1))) "Image viewer" single ((:commit . "7e30e96c26b1ff0d374612534c3e09d309426252") (:authors ("Johan Claesson" . "johanwclaesson@gmail.com")) (:maintainer "Johan Claesson" . "johanwclaesson@gmail.com") (:keywords "multimedia") (:url . "https://github.com/johanclaesson/picpocket"))])
+ (pig-mode . [(20180520 1400) nil "Major mode for Pig files" single ((:commit . "4c6c6e1b1bb719d8adc6c47cc24665f6fe558959") (:maintainer "David A. Shamma"))])
+ (pig-snippets . [(20130913 624) ((yasnippet (0 8 0))) "Snippets for pig-mode" tar ((:commit . "4c6c6e1b1bb719d8adc6c47cc24665f6fe558959") (:authors ("Peter Vasil" . "mail@petervasil.net")) (:maintainer "Peter Vasil" . "mail@petervasil.net") (:keywords "snippets") (:url . "https://github.com/motus/pig-mode"))])
+ (pikchr-mode . [(20210324 2125) ((emacs (27 1))) "A major mode for the pikchr diagram markup language" single ((:commit . "5d424c5c97ac854cc44c369e654e4f906fcae3c8") (:authors ("Johann Klähn" . "johann@jklaehn.de")) (:maintainer "Johann Klähn" . "johann@jklaehn.de") (:keywords "languages") (:url . "https://github.com/kljohann/pikchr-mode"))])
+ (pillar . [(20141112 1811) ((makey (0 3))) "Major mode for editing Pillar files" tar ((:commit . "13a7f676544cc66005ccd8e6fc1c25e4ccd6f909") (:authors ("Damien Cassou" . "damien.cassou@gmail.com")) (:maintainer "Damien Cassou" . "damien.cassou@gmail.com") (:keywords "markup" "major-mode") (:url . "http://github.com/DamienCassou/pillar-mode"))])
+ (pinboard . [(20200630 1544) ((emacs (25 1)) (cl-lib (0 5))) "A pinboard.in client" single ((:commit . "d426f9d2ebec5f907c8a89d6b38ccbcb13750d4f") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "hypermedia" "bookmarking" "reading" "pinboard") (:url . "https://github.com/davep/pinboard.el"))])
+ (pinboard-api . [(20140324 1148) nil "Rudimentary http://pinboard.in integration" single ((:commit . "b7b5214d0c35178f8dca08cf22d6ef3c21f0fce4") (:authors ("Danie Roux" . "danie@danieroux.com")) (:maintainer "Danie Roux" . "danie@danieroux.com") (:keywords "pinboard" "www") (:url . "https://github.com/danieroux/pinboard-api-el"))])
+ (pinboard-popular . [(20180511 1726) ((loop (1 4))) "Displays links from the pinboard.in popular page." single ((:commit . "c0bc76cd35f8ecf34723c64a702b82eec2751318") (:keywords "pinboard") (:url . "https://github.com/asimpson/pinboard-popular"))])
+ (pine-script-mode . [(20210629 1257) ((emacs (24))) "Trading View Pine Script major mode" single ((:commit . "d8ce5dc595a053e80debf6c1e330995c739a8b05") (:authors ("Eric Crosson" . "eric.s.crosson@utexas.edu")) (:maintainer "Eric Crosson" . "eric.s.crosson@utexas.edu") (:keywords "extensions") (:url . "https://github.com/ericcrosson/pine-script-mode"))])
+ (pinot . [(20140211 2026) nil "Emacs interface to pinot-search" tar ((:commit . "67fda555a155b22bb2ce44ba618b4bd6fc5f144a") (:authors ("Takafumi Arakaki <aka.tkf at gmail.com>")) (:maintainer "Takafumi Arakaki <aka.tkf at gmail.com>"))])
+ (pinyin . [(20180620 1241) ((cl-lib (0 5)) (emacs (24))) "Convert Hanzi to Pinyin (汉字转拼音)" tar ((:commit . "e5508e5aa1ad4cfa05a7f4d299e5a155b288ec4c") (:authors ("Xu Chunyang" . "mail@xuchunyang.me")) (:maintainer "Xu Chunyang" . "mail@xuchunyang.me") (:keywords "extensions") (:url . "https://github.com/xuchunyang/pinyin.el"))])
+ (pinyin-search . [(20160515 358) ((pinyinlib (0 1 0))) "Search Chinese by Pinyin" single ((:commit . "2e877a76851009d41bde66eb33182a03a7f04262") (:authors ("Chunyang Xu" . "xuchunyang56@gmail.com")) (:maintainer "Chunyang Xu" . "xuchunyang56@gmail.com") (:keywords "chinese" "search") (:url . "https://github.com/xuchunyang/pinyin-search.el"))])
+ (pinyinlib . [(20200911 1723) nil "Convert first letter of Pinyin to Simplified/Traditional Chinese characters" single ((:commit . "1772c79b6f319b26b6a394a8dda065be3ea4498d") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions"))])
+ (pip-requirements . [(20181027 1629) ((dash (2 8 0))) "A major mode for editing pip requirements files." single ((:commit . "216cd1690f80cc965d4ae47b8753fc185f778ff6") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk"))])
+ (pipenv . [(20210127 1444) ((emacs (25 1)) (s (1 12 0)) (pyvenv (1 20))) "A Pipenv porcelain" single ((:commit . "8f50c68d415307a2cbc65cc4df20df18e1776e9b") (:authors ("Paul Walsh" . "paulywalsh@gmail.com")) (:maintainer "Paul Walsh" . "paulywalsh@gmail.com") (:url . "https://github.com/pwalsh/pipenv.el"))])
+ (pippel . [(20220416 1743) ((emacs (25 1)) (s (1 11 0)) (dash (2 12 0))) "Frontend to python package manager pip" tar ((:commit . "cb194952ee150e77601d3233dabdb521b976ee79") (:authors ("Fritz Stelzer" . "brotzeitmacher@gmail.com")) (:maintainer "Arif Er" . "arifer612@protonmail.me") (:url . "https://github.com/arifer612/pippel"))])
+ (pixie-mode . [(20180626 541) ((clojure-mode (3 0 1)) (inf-clojure (1 0 0))) "Major mode for Pixie-lang" single ((:commit . "a40c2632cfbe948852a5cdcfd44e6a65db11834d") (:authors ("John Walker" . "john.lou.walker@gmail.com")) (:maintainer "John Walker" . "john.lou.walker@gmail.com") (:url . "https://github.com/johnwalker/pixie-mode"))])
+ (pixiv-novel-mode . [(20160220 1421) nil "Major mode for pixiv novel" single ((:commit . "0d1ca524d92b91f20a7105402a773bc21779b434") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "novel" "pixiv"))])
+ (pkg-info . [(20150517 1143) ((epl (0 8))) "Information about packages" single ((:commit . "76ba7415480687d05a4353b27fea2ae02b8d9d61") (:authors ("Sebastian Wiesner" . "swiesner@lunaryorn.com")) (:maintainer "Sebastian Wiesner" . "swiesner@lunaryorn.com") (:keywords "convenience") (:url . "https://github.com/lunaryorn/pkg-info.el"))])
+ (pkg-overview . [(20210802 1509) ((emacs (24 3))) "Make org documentation from elisp source file" single ((:commit . "9b2e416758a6c107bb8cc670ec4d2627f82d5590") (:authors ("Boruch Baum" . "boruch_baum@gmx.com")) (:maintainer "Boruch Baum" . "boruch_baum@gmx.com") (:keywords "docs" "help" "lisp" "maint" "outlines" "tools") (:url . "https://github.com/Boruch-Baum/emacs-pkg-overview"))])
+ (pkgbuild-mode . [(20220428 556) ((emacs (26 1))) "Interface to the ArchLinux package manager" single ((:commit . "8faee70e4640bd6ec1857651ec64e139e4dc2833") (:authors ("Juergen Hoetzel" . "juergen@hoetzel.info")) (:maintainer "Juergen Hoetzel" . "juergen@hoetzel.info") (:keywords "languages") (:url . "https://github.com/juergenhoetzel/pkgbuild-mode"))])
+ (plain-org-wiki . [(20201217 1027) ((emacs (24 3)) (ivy (0 12 0))) "Simple jump-to-org-files in a directory package" single ((:commit . "faeeb54ca808bbf0f4380a938e75805b7a78dbf7") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "convenience") (:url . "https://github.com/abo-abo/plain-org-wiki"))])
+ (plain-theme . [(20171124 410) ((emacs (24))) "Plain theme without syntax highlighting" single ((:commit . "48b37b9b19d8f1e0accbf930f30b5346cf7959fe"))])
+ (plan9-theme . [(20180804 1441) nil "A color theme for Emacs based on Plan9" single ((:commit . "c2da2fcb241e9800d931a1ff19ecd9fd84d30382") (:authors ("John Louis Del Rosario" . "john2x@gmail.com")) (:maintainer "John Louis Del Rosario" . "john2x@gmail.com") (:url . "https://github.com/john2x/plan9-theme.el"))])
+ (planemo-mode . [(20201216 1122) ((emacs (27 1)) (dash (2 17 0))) "Minor mode for editing Galaxy XML files" single ((:commit . "9a981f79a2727f87689ae5a07368c41d35902a67") (:authors ("Mehmet Tekman")) (:maintainer "Mehmet Tekman") (:keywords "outlines") (:url . "https://gitlab.com/mtekman/planemo-mode.el"))])
+ (planet-theme . [(20161031 217) ((emacs (24))) "A dark theme inspired by Gmail's 'Planets' theme of yore" single ((:commit . "b0a310ff36565fe22224c407cf59569986698a32") (:authors ("Charlie McMackin" . "charlie.mac@gmail.com")) (:maintainer "Charlie McMackin" . "charlie.mac@gmail.com") (:keywords "themes") (:url . "https://github.com/cmack/emacs-planet-theme"))])
+ (plantuml-mode . [(20191102 2056) ((dash (2 0 0)) (emacs (25 0))) "Major mode for PlantUML" single ((:commit . "ea45a13707abd2a70df183f1aec6447197fc9ccc") (:authors ("Zhang Weize (zwz)")) (:maintainer "Carlo Sciolla (skuro)") (:keywords "uml" "plantuml" "ascii"))])
+ (plaster . [(20180127 2050) ((emacs (24 3))) "Pasting to a plaster host with buffers." single ((:commit . "4d18c8bc3322668ac1695e25c556bda6771af1d5") (:authors ("Nicolas Hafner" . "shinmera@tymoon.eu")) (:maintainer "Nicolas Hafner" . "shinmera@tymoon.eu") (:keywords "convenience" "paste service") (:url . "http://github.com/shirakumo/plaster/"))])
+ (platformio-mode . [(20210511 957) ((emacs (25 1)) (async (1 9 0)) (projectile (0 13 0))) "PlatformIO integration" single ((:commit . "f4fd8932995a8aed80eab14e54232010c2889012") (:authors ("Zach Massia" . "zmassia@gmail.com") ("Dante Catalfamo" . "dante@lambda.cx")) (:maintainer "Zach Massia" . "zmassia@gmail.com") (:url . "https://github.com/zachmassia/platformio-mode"))])
+ (play-crystal . [(20180114 1024) ((emacs (24 4)) (dash (2 12 0)) (request (0 2 0))) "https://play.crystal-lang.org integration." single ((:commit . "0b4810a9025213bd11dbcbfd38b3ca928829e0a5") (:authors ("Vitalii Elenhaupt")) (:maintainer "Vitalii Elenhaupt") (:keywords "convenience") (:url . "https://github.com/veelenga/play-crystal.el"))])
+ (play-routes-mode . [(20170426 733) nil "Play Framework Routes File Support" single ((:commit . "22d7b87e0eaf0330f2b2283872f8dc08a3258771") (:authors ("M.Riehl <max@flatmap.ninja>, P.Haun" . "bomgar85@googlemail.com")) (:maintainer "M.Riehl <max@flatmap.ninja>, P.Haun" . "bomgar85@googlemail.com") (:keywords "play" "scala") (:url . "https://github.com/brocode/play-routes-mode/"))])
+ (playerctl . [(20211014 856) nil "Control your music player (e.g. Spotify) with playerctl" single ((:commit . "4c3a6132616fd28f902590bf6e63332e6055492b") (:authors ("Thomas Luquet" . "thomas@luquet.net")) (:maintainer "Thomas Luquet" . "thomas@luquet.net") (:keywords "multimedia" "playerctl" "music") (:url . "https://github.com/thomasluquet/playerctl.el"))])
+ (playground . [(20200812 1336) ((emacs (24 4))) "Manage sandboxes for alternative configurations" single ((:commit . "77d2faab0bc3f6e1f2c65c66644c52167304610d") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:keywords "maint") (:url . "https://github.com/akirak/emacs-playground"))])
+ (playonline . [(20200317 642) ((emacs (24 4)) (dash (2 1)) (request (0 2))) "Play code with online playgrounds" single ((:commit . "c75da1fdc1dfbd5d9aa274dc4e90ff631ea08e70") (:authors ("Gong Qijian" . "gongqijian@gmail.com")) (:maintainer "Gong Qijian" . "gongqijian@gmail.com") (:keywords "tools") (:url . "https://github.com/twlz0ne/playonline.el"))])
+ (plenv . [(20130707 616) nil "A plenv wrapper for Emacs" single ((:commit . "ee937d0f3a1a7ba2d035f45be896d3ed8fefaee2") (:authors ("Kenta Sato" . "karupa@cpan.org")) (:maintainer "Kenta Sato" . "karupa@cpan.org") (:keywords "emacs" "perl"))])
+ (plim-mode . [(20140813 13) nil "Major mode for editing Plim files" single ((:commit . "92e39190286f172567ceb02c80e1df3b81abfa2d") (:authors ("Dong Weiming")) (:maintainer "Dong Weiming") (:keywords "markup" "language") (:url . "http://github.com/dongweiming/plim-mode"))])
+ (plisp-mode . [(20200427 405) nil "Major mode for PicoLisp programming." tar ((:commit . "59e682d77569b04e9fc80af9c4b05e4a997dbcec") (:authors ("Alexis" . "flexibeast@gmail.com")) (:maintainer "Alexis" . "flexibeast@gmail.com") (:keywords "picolisp" "lisp" "programming") (:url . "https://github.com/flexibeast/plisp-mode"))])
+ (plsense . [(20151104 1445) ((auto-complete (1 4 0)) (log4e (0 2 0)) (yaxception (0 2 0))) "provide interface for PlSense that is a development tool for Perl." single ((:commit . "d50f9dccc98f42bdb42f1d1c8142246e03879218") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "perl" "completion") (:url . "https://github.com/aki2o/emacs-plsense"))])
+ (plsense-direx . [(20140520 2008) ((direx (0 1 -3)) (plsense (0 3 2)) (log4e (0 2 0)) (yaxception (0 3 2))) "Perl Package Explorer" single ((:commit . "8a2f465264c74e04524cc789cdad0190ace43f6c") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "perl" "convenience") (:url . "https://github.com/aki2o/plsense-direx"))])
+ (plur . [(20160504 924) ((emacs (24 4))) "Easily search and replace multiple variants of a word" single ((:commit . "5bdd3b9a2f0624414bd596e798644713cd1545f0") (:authors ("Chunyang Xu" . "xuchunyang.me@gmail.com")) (:maintainer "Chunyang Xu" . "xuchunyang.me@gmail.com") (:url . "https://github.com/xuchunyang/plur"))])
+ (pmdm . [(20191101 2346) nil "poor man's desktop-mode alternative." single ((:commit . "1f30adce8a23da94b3c2460b7248d5910592d8af") (:authors ("Iñigo Serna" . "inigoserna@gmx.com")) (:maintainer "Iñigo Serna" . "inigoserna@gmx.com") (:url . "https://hg.serna.eu/emacs/pmdm"))])
+ (pnpm-mode . [(20200527 557) ((emacs (24 1))) "Minor mode for working with pnpm projects" single ((:commit . "391207e6505948b0d0cb57b802ee4885e3292c21") (:authors ("Rajasegar Chandran" . "rajasegar.c@gmail.com")) (:maintainer "Rajasegar Chandran" . "rajasegar.c@gmail.com") (:keywords "convenience" "project" "javascript" "node" "npm" "pnpm") (:url . "https://github.com/rajasegar/pnpm-mode"))])
+ (po-mode . [(20200606 1404) nil "major mode for GNU gettext PO files" tar ((:commit . "25eb1bdca30ed25d2e5d51b9feeb28a3faff51ec") (:keywords "i18n" "gettext"))])
+ (pocket-api . [(20180403 109) ((emacs (24 4)) (request (0 2))) "another pocket api" single ((:commit . "3eb9430b9db90bc02e736e433eb86389f7655189") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "convenience" "pocket") (:url . "https://github.com/lujun9972/pocket-api.el"))])
+ (pocket-lib . [(20190720 1957) ((emacs (25 1)) (request (0 2)) (dash (2 13 0)) (kv (0 0 19)) (s (1 12 0))) "Library for accessing getpocket.com API" single ((:commit . "f794e3e619e1f6cad25bbfd5fe019a7e62820bf4") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "pocket") (:url . "https://github.com/alphapapa/pocket-lib.el"))])
+ (pocket-mode . [(20171201 1315) ((emacs (24 4)) (pocket-api (0 1))) "Manage your pocket" single ((:commit . "229de7d35b7e5605797591c46aa8200d7efc363c") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "convenience" "pocket"))])
+ (pocket-reader . [(20210824 658) ((emacs (25 1)) (dash (2 13 0)) (kv (0 0 19)) (pocket-lib (0 1)) (s (1 10)) (ov (1 0 6)) (rainbow-identifiers (0 2 2)) (org-web-tools (0 1)) (ht (2 2))) "Client for Pocket reading list" single ((:commit . "0a177d4a3b4b2532be7f0775e5cc41e6382a45d4") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "pocket") (:url . "https://github.com/alphapapa/pocket-reader.el"))])
+ (podcaster . [(20200607 1054) ((cl-lib (0 5))) "Podcast client" single ((:commit . "7a21173da0c57e6aa41dbdc33383047386b35eb5") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:url . "https://github.com/lujun9972/podcaster"))])
+ (poe-lootfilter-mode . [(20190330 1117) ((emacs (24 3))) "Major mode for editing Path of Exile lootfilters" single ((:commit . "5ef06684cb2b17b090ee1f303c2b789fa71bc106") (:authors ("Jeremiah Dodds" . "jeremiah.dodds@gmail.com")) (:maintainer "Jeremiah Dodds" . "jeremiah.dodds@gmail.com") (:keywords "languages" "games") (:url . "https://github.com/jdodds/poe-lootfilter-mode"))])
+ (poet-client . [(20190403 708) ((emacs (24 4)) (request (0 3 0))) "Client for po.et network api" single ((:commit . "38a9635cab4799224153f89ff47cf1b060fb3939") (:authors ("W.Yahia")) (:maintainer "W.Yahia") (:url . "https://github.com/wailo/emacs-poet"))])
+ (poet-theme . [(20200606 2343) ((emacs (24 1))) "A theme for prose" tar ((:commit . "16eb694f0755c04c4db98614d0eca1199fddad70") (:authors ("Kunal Bhalla" . "bhalla.kunal@gmail.com")) (:maintainer "Kunal Bhalla" . "bhalla.kunal@gmail.com") (:keywords "faces" "theme" "prose") (:url . "https://github.com/kunalb/poet/"))])
+ (poetry . [(20211016 834) ((transient (0 2 0)) (pyvenv (1 2)) (emacs (25 1))) "Interface to Poetry" single ((:commit . "5b9ef569d629d79820e73b5380e54e443ba90616") (:authors ("Gaby Launay" . "gaby.launay@protonmail.com")) (:maintainer "Gaby Launay" . "gaby.launay@protonmail.com") (:keywords "python" "tools") (:url . "https://github.com/galaunay/poetry.el"))])
+ (point-pos . [(20170421 1632) nil "Save and restore point positions" single ((:commit . "442bccb40791832cbc2d6f5c8f53be745aea2b73") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "tools" "convenience") (:url . "https://github.com/alezost/point-pos.el"))])
+ (point-stack . [(20200427 107) nil "Back and forward navigation through buffer locations" single ((:commit . "cddcea2c91038710c245819b3cda2dd739726134") (:authors ("Matt Harrison" . "matthewharrison@gmail.com") ("Dmitry Gutov" . "dgutov@yandex.ru")) (:maintainer "Matt Harrison" . "matthewharrison@gmail.com"))])
+ (poke-line . [(20201023 247) ((emacs (24 3))) "Minor mode to show position in a buffer using a Pokemon" tar ((:commit . "8d484dbaa1215d902fbd1e3c9163b39a43ec532a") (:authors ("Ryan Miller" . "ryan@devopsmachine.com")) (:maintainer "Ryan Miller" . "ryan@devopsmachine.com") (:keywords "pokemon" "fun" "mode-line" "mouse") (:url . "https://github.com/RyanMillerC/poke-line/"))])
+ (pollen-mode . [(20210120 422) ((emacs (24 3)) (cl-lib (0 5))) "major mode for editing pollen files" single ((:commit . "09a9dc48c468dcd385982b9629f325e70d569faf") (:authors ("Junsong Li <ljs.darkfish AT GMAIL>")) (:maintainer "Junsong Li") (:keywords "languages" "pollen" "pollenpub") (:url . "https://github.com/lijunsong/pollen-mode"))])
+ (poly-R . [(20210930 1921) ((emacs (25)) (polymode (0 2 2)) (poly-markdown (0 2 2)) (poly-noweb (0 2 2))) "Various polymodes for R language" single ((:commit . "e4a39caaf48e1c2e5afab3865644267b10610537") (:authors ("Vitalie Spinu")) (:maintainer "Vitalie Spinu") (:keywords "languages" "multi-modes") (:url . "https://github.com/polymode/poly-R"))])
+ (poly-ansible . [(20220113 1656) ((ansible (0 2)) (ansible-doc (0 4)) (jinja2-mode (0 2)) (polymode (0 1 5)) (yaml-mode (0 0 13))) "Polymode for Ansible: Jinja2 in YAML" tar ((:commit . "6d74fe80b7e61a35aa0fa36a520eaf5c9c027c51") (:authors ("Peter Oliver" . "poly-ansible@mavit.org.uk")) (:maintainer "Peter Oliver" . "poly-ansible@mavit.org.uk") (:keywords "languages") (:url . "https://gitlab.com/mavit/poly-ansible/"))])
+ (poly-erb . [(20200316 1314) ((emacs (25)) (polymode (0 2 2))) "Polymode for erb" single ((:commit . "56c744b8d87d8cbe0aba2696d4e8525afc4aa0e8") (:authors ("Siavash Sajjadi and Vitalie Spinu")) (:maintainer "Vitalie Spinu") (:keywords "emacs") (:url . "https://github.com/polymode/poly-erb"))])
+ (poly-markdown . [(20220117 2351) ((emacs (25)) (polymode (0 2 2)) (markdown-mode (2 3))) "Polymode for markdown-mode" single ((:commit . "d4ca396ec4a7d674ef0d671a6896f929ce5b504c") (:authors ("Vitalie Spinu")) (:maintainer "Vitalie Spinu") (:keywords "emacs") (:url . "https://github.com/polymode/poly-markdown"))])
+ (poly-noweb . [(20200316 1315) ((emacs (25)) (polymode (0 2 2))) "Polymode for noweb" single ((:commit . "3b0cd36ca9a707e8a09337a3468fa85d81fc461c") (:authors ("Vitalie Spinu")) (:maintainer "Vitalie Spinu") (:keywords "languages" "multi-modes") (:url . "https://github.com/polymode/poly-noweb"))])
+ (poly-org . [(20220201 1514) ((emacs (25)) (polymode (0 2 2))) "Polymode for org-mode" single ((:commit . "01fd0f4b7eaeabf070af831f4825993210f64f2e") (:authors ("Vitalie Spinu")) (:maintainer "Vitalie Spinu") (:keywords "languages" "multi-modes") (:url . "https://github.com/polymode/poly-org"))])
+ (poly-rst . [(20210418 1009) ((emacs (25)) (polymode (0 2 2))) "poly-rst-mode polymode" single ((:commit . "e71f2ae6a00683cdb8006f953e5db0673043e144") (:authors ("Gustaf Waldemarson, Vitalie Spinu")) (:maintainer "Gustaf Waldemarson, Vitalie Spinu") (:keywords "languages" "multi-modes") (:url . "https://github.com/polymode/poly-rst"))])
+ (poly-ruby . [(20180905 929) ((emacs (25)) (polymode (0 1 2))) "Provides poly-ruby-mode" single ((:commit . "794ebb926ace23e9c1398da934701951432dcea2") (:authors ("Akinori MUSHA" . "knu@iDaemons.org")) (:maintainer "Akinori MUSHA" . "knu@iDaemons.org") (:keywords "languages") (:url . "https://github.com/knu/poly-ruby.el"))])
+ (poly-slim . [(20200316 1316) ((emacs (25)) (polymode (0 2 2)) (slim-mode (1 1))) "Polymodes for slim" single ((:commit . "9e9b5164c68955974fd5f5d220aec5af9b5ba3ae") (:authors ("Siavash Sajjadi and Vitalie Spinu")) (:maintainer "Vitalie Spinu") (:keywords "emacs") (:url . "https://github.com/polymode/poly-slim"))])
+ (poly-wdl . [(20190712 529) ((emacs (25)) (polymode (0 2)) (wdl-mode (20170709))) "Polymode for WDL" single ((:commit . "963faa828d15d49cee5a63f619c3c30e162c2d0f") (:authors ("Jean Monlong" . "jean.monlong@gmail.com")) (:maintainer "Jean Monlong" . "jean.monlong@gmail.com") (:keywords "languages") (:url . "https://github.com/jmonlong/poly-wdl"))])
+ (polybar-sesman . [(20210901 1336) ((emacs (25 1)) (dash (2 19 1)) (sesman (0 3 0))) "Display active sesman connections in polybar" single ((:commit . "5175b8d641aad9576519717f69f858621892d5c7") (:authors ("Mark Dawson" . "markgdawson@gmail.com")) (:maintainer "Mark Dawson" . "markgdawson@gmail.com") (:keywords "project" "convenience") (:url . "https://github.com/markgdawson/polybar-sesman.el"))])
+ (polymode . [(20220322 824) ((emacs (25))) "Extensible framework for multiple major modes" tar ((:commit . "2094c92403fe395dfb2b8b2521da1012a966e9ab") (:authors ("Vitalie Spinu")) (:maintainer "Vitalie Spinu") (:keywords "languages" "multi-modes" "processes") (:url . "https://github.com/polymode/polymode"))])
+ (pomidor . [(20210111 919) ((emacs (24 3)) (alert (1 2)) (dash (2 17 0))) "Simple and cool pomodoro timer" tar ((:commit . "52134701fa76b12252b06c9d6fd4e8665596a95a") (:authors ("TatriX" . "tatrics@gmail.com")) (:maintainer "TatriX" . "tatrics@gmail.com") (:keywords "tools" "time" "applications" "pomodoro technique") (:url . "https://github.com/TatriX/pomidor"))])
+ (pomm . [(20220315 2038) ((emacs (27 1)) (alert (1 2)) (seq (2 22)) (transient (0 3 0))) "Yet another Pomodoro timer implementation" tar ((:commit . "2a2673bdc8e2c2af99040b14e97b39271806bf79") (:authors ("Korytov Pavel" . "thexcloud@gmail.com")) (:maintainer "Korytov Pavel" . "thexcloud@gmail.com") (:url . "https://github.com/SqrtMinusOne/pomm.el"))])
+ (pomodoro . [(20210225 2018) nil "A timer for the Pomodoro Technique" single ((:commit . "ed888b24d0b89a5dec6f5278b1064c530c827321") (:authors ("David Kerschner" . "dkerschner@gmail.com")) (:maintainer "David Kerschner" . "dkerschner@gmail.com"))])
+ (pony-mode . [(20170807 1522) nil "Minor mode for working with Django Projects" tar ((:commit . "760684d30b6c234d1b88c9a4673a808f36f7f341") (:authors ("David Miller" . "david@deadpansincerity.com")) (:maintainer "David Miller" . "david@deadpansincerity.com") (:keywords "python" "django") (:url . "https://github.com/davidmiller/pony-mode"))])
+ (pony-snippets . [(20200418 354) ((yasnippet (0 8 0))) "Yasnippets for Pony" tar ((:commit . "81a1348f81b0d8a3097d1ca3f2fb2f57964d56d6") (:keywords "snippets" "pony") (:url . "https://github.com/seantallen/pony-snippets"))])
+ (ponylang-mode . [(20211015 331) ((emacs (25 1)) (dash (2 17 0)) (hydra (0 15 0)) (hl-todo (3 1 2)) (yafolding (0 4 1)) (yasnippet (0 14 0)) (company-ctags (0 0 4)) (rainbow-delimiters (2 1 4)) (fill-column-indicator (1 90))) "A major mode for the Pony programming language" single ((:commit . "4bdffa94cd89da91b75e9edc56e9e2197ce072a3") (:keywords "languages" "programming") (:url . "https://github.com/ponylang/ponylang-mode"))])
+ (pophint . [(20200420 1429) ((log4e (0 3 3)) (yaxception (0 3))) "Provide navigation using pop-up tips, like Firefox's Vimperator Hint Mode" tar ((:commit . "5e13da4578ae7ba00e6f7bae31eb546d713cc19d") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "popup") (:url . "https://github.com/aki2o/emacs-pophint"))])
+ (poporg . [(20170403 751) nil "Pop a comment or string to an empty buffer for text editing" single ((:commit . "2c58d68c81ecca4140bf179f19ed153ec804b65a") (:authors ("François Pinard" . "pinard@iro.umontreal.ca") ("Joseph Rabinoff" . "rabinoff@post.harvard.edu")) (:maintainer "Joseph Rabinoff" . "rabinoff@post.harvard.edu") (:keywords "outlines" "tools") (:url . "https://github.com/QBobWatson/poporg"))])
+ (popper . [(20220406 336) ((emacs (26 1))) "Summon and dismiss buffers as popups" tar ((:commit . "6599c9b5a12b411c6cf1536bf200ae233fa24389") (:authors ("Karthik Chikmagalur" . "karthik.chikmagalur@gmail.com")) (:maintainer "Karthik Chikmagalur" . "karthik.chikmagalur@gmail.com") (:keywords "convenience") (:url . "https://github.com/karthink/popper"))])
+ (popup . [(20211231 1823) ((emacs (24 3))) "Visual Popup User Interface" single ((:commit . "114d646f0f4dd49de19dfedd78630018f71470e5") (:authors ("Tomohiro Matsuyama" . "m2ym.pub@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:keywords "lisp") (:url . "https://github.com/auto-complete/popup-el"))])
+ (popup-complete . [(20141109 308) ((popup (0 5 0))) "completion with popup" single ((:commit . "caa655a6d8472e9a4bfa1311126d90d7d1b07fca") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-popup-complete"))])
+ (popup-edit-menu . [(20170404 1425) ((emacs (24))) "a popup context edit menu package" single ((:commit . "925600a6e29183841199e866cf55e566a6a1b002") (:authors ("Debugfan Chin" . "debugfanchin@gmail.com")) (:maintainer "Debugfan Chin" . "debugfanchin@gmail.com") (:keywords "lisp" "pop-up" "context" "edit" "menu"))])
+ (popup-imenu . [(20210404 1153) ((dash (2 12 1)) (popup (0 5 3)) (flx-ido (0 6 1))) "imenu index popup" single ((:commit . "b00c4d503cbbaf01c136b1647329e6a6257d012c") (:authors ("Igor Shymko" . "igor.shimko@gmail.com")) (:maintainer "Igor Shymko" . "igor.shimko@gmail.com") (:keywords "popup" "imenu") (:url . "https://github.com/ancane/popup-imenu"))])
+ (popup-kill-ring . [(20131020 1854) ((popup (0 4)) (pos-tip (0 4))) "interactively insert item from kill-ring" single ((:commit . "5773dfadc104a906c088a3ec62e8cdd3e01e57fa") (:authors ("khiker" . "khiker.mail+elisp@gmail.com")) (:maintainer "khiker" . "khiker.mail+elisp@gmail.com") (:keywords "popup" "kill-ring" "pos-tip") (:url . "https://github.com/waymondo/popup-kill-ring"))])
+ (popup-switcher . [(20210402 1208) ((cl-lib (0 3)) (popup (0 5 3)) (dash (2 10 0))) "switch to other buffers and files via popup." single ((:commit . "94e01b9ea7970e86ed0f2fbeaa8cd320b60ae821") (:authors ("Kostafey" . "kostafey@gmail.com")) (:maintainer "Kostafey" . "kostafey@gmail.com") (:keywords "popup" "switch" "buffers" "functions") (:url . "https://github.com/kostafey/popup-switcher"))])
+ (popwin . [(20210215 1849) ((emacs (24 3))) "Popup Window Manager" single ((:commit . "f90f3a09622993bf34704bb11c24984f6b1f10e2") (:authors ("Tomohiro Matsuyama" . "m2ym.pub@gmail.com")) (:maintainer "Tomohiro Matsuyama" . "m2ym.pub@gmail.com") (:keywords "convenience") (:url . "https://github.com/emacsorphanage/popwin"))])
+ (portage-navi . [(20141208 1355) ((concurrent (0 3 1)) (ctable (0 1 2))) "portage viewer" single ((:commit . "8016c3e99fe6cef101d479a3d69185796b22ca2f") (:authors ("<m.sakurai at kiwanami.net>")) (:maintainer "<m.sakurai at kiwanami.net>") (:keywords "tools" "gentoo") (:url . "https://github.com/kiwanami/emacs-portage-navi"))])
+ (porthole . [(20200404 1454) ((emacs (26)) (web-server (0 1 2)) (f (0 19 0)) (json-rpc-server (0 1 2))) "RPC Servers in Emacs" single ((:commit . "21af54b2fc9fd8876664c8e6c2ff2e4ffbbad249") (:authors ("GitHub user \"Jcaw\"")) (:maintainer "GitHub user \"Jcaw\"") (:keywords "comm" "rpc" "http" "json") (:url . "https://github.com/jcaw/porthole"))])
+ (pos-tip . [(20191227 1356) nil "Show tooltip at point" single ((:commit . "179cc126b363f72ca12fab1e0dc462ce0ee79742") (:authors ("S. Irie")) (:maintainer "S. Irie") (:keywords "tooltip"))])
+ (posframe . [(20220124 859) ((emacs (26 1))) "Pop a posframe (just a frame) at point" tar ((:commit . "c91d4d53fa479ceb604071008ce0a901770eff57") (:authors ("Feng Shu" . "tumashu@163.com")) (:maintainer "Feng Shu" . "tumashu@163.com") (:keywords "convenience" "tooltip") (:url . "https://github.com/tumashu/posframe"))])
+ (posix-manual . [(20200301 1103) ((emacs (24))) "POSIX manual page lookup" tar ((:commit . "ebaacd7266ae7a66605317f57b9f42e9cfb2ce1e") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "languages" "util") (:url . "https://github.com/lassik/emacs-posix-manual"))])
+ (postcss-sorting . [(20180211 956) ((emacs (24))) "postcss-sorting interface" single ((:commit . "deb0c935d2904c11a965758a9aee5a0e905f21fc") (:authors ("Peiwen Lu" . "hi@peiwen.lu")) (:maintainer "Peiwen Lu" . "hi@peiwen.lu") (:url . "https://github.com/P233/postcss-sorting.el"))])
+ (pov-mode . [(20161115 743) nil "Major mode for editing POV-Ray scene files." tar ((:commit . "9fc1db3aab7c27155674dd1a87ec62606035d074") (:authors ("Peter Boettcher" . "pwb@andrew.cmu.edu")) (:maintainer "Marco Pessotto" . "melmothx@gmail.com") (:keywords "pov" "povray"))])
+ (pow . [(20140420 806) ((emacs (24)) (cl-lib (0 5))) "pow (http://pow.cx/) manager for emacs" tar ((:commit . "ea83986b8ca8e27cb996290d6463b111ec0966ce") (:authors ("yukihiro hara" . "yukihr@gmail.com")) (:maintainer "yukihiro hara" . "yukihr@gmail.com") (:keywords "develop" "web" "pow") (:url . "http://github.com/yukihr/emacs-pow"))])
+ (powerline . [(20220122 1904) ((cl-lib (0 2))) "Rewrite of Powerline" tar ((:commit . "566c77844f053cb39fa7acdfbc143a855450f0b5") (:authors ("Donald Ephraim Curtis" . "dcurtis@milkbox.net")) (:maintainer "Donald Ephraim Curtis" . "dcurtis@milkbox.net") (:keywords "mode-line") (:url . "http://github.com/milkypostman/powerline/"))])
+ (powerline-evil . [(20190603 340) ((evil (1 0 8)) (powerline (2 3))) "Utilities for better Evil support for Powerline" tar ((:commit . "b77e2cf571e9990734f2b30d826f3a362b559fd1") (:authors ("Chris Johnson" . "chris@christophermjohnson.net")) (:maintainer "Chris Johnson" . "chris@christophermjohnson.net") (:keywords "evil" "mode-line" "powerline") (:url . "http://github.com/johnson-christopher/powerline-evil/"))])
+ (powershell . [(20220402 643) ((emacs (24))) "Mode for editing PowerShell scripts" single ((:commit . "77b27faf8a292f1dc9f54c872241dc53b6791bf1") (:authors ("Frédéric Perrin <frederic (dot) perrin (arobas) resel (dot) fr>")) (:maintainer "Frédéric Perrin <frederic (dot) perrin (arobas) resel (dot) fr>") (:keywords "powershell" "languages") (:url . "http://github.com/jschaf/powershell.el"))])
+ (powerthesaurus . [(20220414 1453) ((emacs (24)) (request (0 3 0)) (s (1 12 0))) "Powerthesaurus integration" single ((:commit . "88bc5229cba1604c8f74db0a1456d99259d538cc") (:keywords "convenience" "writing") (:url . "http://github.com/SavchenkoValeriy/emacs-powerthesaurus"))])
+ (ppd-sr-speedbar . [(20151108 1224) ((sr-speedbar (20140914 2339)) (project-persist-drawer (0 0 4))) "Sr Speedbar adaptor for project-persist-drawer." tar ((:commit . "d88d7f63f695824c435dd996405454d1e46d2aa3") (:authors ("Robert Dallas Gray")) (:maintainer "Robert Dallas Gray") (:keywords "projects" "drawer") (:url . "https://github.com/rdallasgrayppd-sr-speedbar"))])
+ (ppp . [(20220211 1529) ((emacs (25 1))) "Extended pretty printer for Emacs Lisp" single ((:commit . "d5d854c3006dfd268e62c7f91c2aad6f86a505b5") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "tools") (:url . "https://github.com/conao3/ppp.el"))])
+ (pr-review . [(20220412 440) ((emacs (27 1)) (magit-section (3 2)) (magit (3 2)) (markdown-mode (2 5)) (ghub (3 5))) "Review github PR" tar ((:commit . "cfc5643c4ab66f17a31d82418465ae434486d8db") (:authors ("Yikai Zhao" . "yikai@z1k.dev")) (:maintainer "Yikai Zhao" . "yikai@z1k.dev") (:keywords "tools") (:url . "https://github.com/blahgeek/emacs-pr-review"))])
+ (prassee-theme . [(20180709 1004) ((emacs (24))) "A high contrast color theme for Emacs." single ((:commit . "81126f69cdbaab836c00ae7a49aaf89d4229fde1") (:authors ("Prassee " . "prassee.sathian@gmail.com")) (:maintainer "Prassee " . "prassee.sathian@gmail.com") (:keywords "dark" "high-contrast" "faces") (:url . "https://github.com/prassee/prassee-emacs-theme"))])
+ (prefab . [(20220403 1026) ((emacs (27 1)) (f (0 2 0)) (transient (0 3 7))) "Integration for project generation tools like cookiecutter" single ((:commit . "ffcf9c640c8c458a58b752ef2608e07a929a1104") (:authors ("Laurence Warne")) (:maintainer "Laurence Warne") (:url . "https://github.com/laurencewarne/prefab.el"))])
+ (preproc-font-lock . [(20151107 2018) nil "Highlight C-style preprocessor directives." single ((:commit . "565fda9f5fdeb0598986174a07e9fb09f7604397") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "c" "languages" "faces") (:url . "https://github.com/Lindydancer/preproc-font-lock"))])
+ (prescient . [(20220509 2300) ((emacs (25 1))) "Better sorting and filtering" single ((:commit . "c05f8a43c6ff07a8b5a3ba8df7a2ec35677b7484") (:authors ("Radian LLC" . "contact+prescient@radian.codes")) (:maintainer "Radian LLC" . "contact+prescient@radian.codes") (:keywords "extensions") (:url . "https://github.com/raxod502/prescient.el"))])
+ (preseed-generic-mode . [(20180210 500) nil "Debian preseed file major mode" single ((:commit . "3aa8806c4a659064baa01751400c53fbaf847f66") (:authors ("Tong Sun" . "suntong@users.sourceforge.net")) (:maintainer "Tong Sun" . "suntong@users.sourceforge.net") (:url . "https://github.com/suntong/preseed-generic-mode"))])
+ (presentation . [(20180427 224) ((emacs (24 4)) (cl-lib (0 5))) "Display large character for presentation" single ((:commit . "f53f67aeab97e8eea6d1f12df5f7ce3b1b03b879") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "environment" "faces" "frames") (:url . "https://github.com/zonuexe/emacs-presentation-mode"))])
+ (prettier . [(20211018 955) ((emacs (26 1)) (iter2 (0 9)) (nvm (0 2))) "Code formatting with Prettier" tar ((:commit . "485417c0677255249e944b1174225547e4c61c00") (:authors ("Julian Scheid" . "julians37@gmail.com")) (:maintainer "Julian Scheid" . "julians37@gmail.com") (:keywords "convenience" "languages" "files") (:url . "https://github.com/jscheid/prettier.el"))])
+ (prettier-js . [(20180109 726) nil "Minor mode to format JS code on file save" single ((:commit . "e9b73e81d3e1642aec682195f127a42dfb0b5774") (:authors ("James Long and contributors")) (:maintainer "James Long and contributors") (:keywords "convenience" "wp" "edit" "js") (:url . "https://github.com/prettier/prettier-emacs"))])
+ (prettier-rc . [(20220330 145) ((emacs (24 3)) (prettier-js (0 1 0))) "Use local rc rules with prettier" single ((:commit . "99e40a9783299e41911f6b37156626d53e43809e") (:authors ("Joel Bryan Juliano <joelbryan dot juliano at gmail dot com>")) (:maintainer "Joel Bryan Juliano <joelbryan dot juliano at gmail dot com>") (:keywords "convenience" "edit" "js" "ts" "rc" "prettierrc" "prettier-rc" "prettier" "prettier-js") (:url . "https://github.com/jjuliano/prettier-rc-emacs"))])
+ (prettify-greek . [(20160603 908) nil "Greek letters for prettify-symbols" single ((:commit . "698d07a6ffe85f6fb53f3bfec4f49380c25cfd90") (:keywords "faces") (:url . "https://gitlab.com/fommil/emacs-prettify-greek"))])
+ (prettify-math . [(20220101 549) ((emacs (27 1)) (dash (2 19 0)) (s (1 12 0)) (jsonrpc (1 0 9))) "Prettify math formula" tar ((:commit . "5bdb9a8af7593d3a38492a618aedc545278fe8a1") (:authors ("Shaq Xu" . "shaqxu@163.com")) (:maintainer "Shaq Xu" . "shaqxu@163.com") (:keywords "math" "asciimath" "tex" "latex" "prettify" "mathjax") (:url . "https://github.com/shaqxu/prettify-math"))])
+ (pretty-hydra . [(20210221 834) ((hydra (0 15 0)) (s (1 12 0)) (dash (2 18 0)) (emacs (24))) "A macro for creating nice-looking hydras" single ((:commit . "84c1929a5153be169ca5c36737439d51dffde505") (:authors ("Jerry Peng" . "pr2jerry@gmail.com")) (:maintainer "Jerry Peng" . "pr2jerry@gmail.com") (:url . "https://github.com/jerrypnz/major-mode-hydra.el"))])
+ (pretty-mode . [(20190615 2045) nil "Redisplay parts of the buffer as pretty Unicode symbols." single ((:commit . "5154355e90fdd70d3647257280a89eeb725ef084") (:authors ("Arthur Danskin" . "arthurdanskin@gmail.com")) (:maintainer "Grant Rettke" . "grant@wisdomandwonder.com") (:keywords "pretty" "unicode" "symbols") (:url . "https://github.com/akatov/pretty-mode"))])
+ (pretty-sha-path . [(20141105 1826) nil "Prettify Guix/Nix store paths" single ((:commit . "a2b43dd9de423a38d67cda2e3bd9412f7d363257") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "faces" "convenience") (:url . "https://gitorious.org/alezost-emacs/pretty-sha-path"))])
+ (pretty-speedbar . [(20220303 1726) ((emacs (27 1))) "Make speedbar pretty" single ((:commit . "56dc9f114fcc55843e182cde1fc9d7a14c261c6a") (:authors ("Kristle Chester" . "kcyarn7@gmail.com")) (:maintainer "Kristle Chester" . "kcyarn7@gmail.com") (:keywords "file" "tags" "tools") (:url . "https://github.com/kcyarn/pretty-speedbar"))])
+ (pretty-symbols . [(20140814 959) nil "Draw tokens as Unicode glyphs." single ((:commit . "582cbe51ecfe1cc0a5b185bc06113c8a661e3956") (:authors ("David Röthlisberger" . "david@rothlis.net")) (:maintainer "David Röthlisberger" . "david@rothlis.net") (:keywords "faces") (:url . "http://github.com/drothlis/pretty-symbols"))])
+ (preview-dvisvgm . [(20211225 635) ((emacs (27 1)) (auctex (13 0 12))) "SVG output for LaTeX preview" single ((:commit . "630e2f008c4a6c67a01824b7ad6b844977b28f87") (:authors ("Tobias Zawada" . "i@tn-home.de")) (:maintainer "Tobias Zawada" . "i@tn-home.de") (:keywords "tex") (:url . "https://github.com/TobiasZawada/preview-dvisvgm"))])
+ (prism . [(20210804 417) ((emacs (26 1)) (dash (2 14 1))) "Customizable, depth-based syntax coloring" single ((:commit . "b0cbdaf4916c1cf348a8f0e4f6158e040a627562") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "faces" "lisp") (:url . "https://github.com/alphapapa/prism.el"))])
+ (private . [(20150122 157) ((aes (0 6))) "take care of your private configuration files." single ((:commit . "9266d01c095895cc3ee9de95bc20511e88353755") (:authors ("Cheung Mou Wai" . "yeannylam@gmail.com")) (:maintainer "Cheung Mou Wai" . "yeannylam@gmail.com") (:keywords "private" "configuration" "backup" "recover") (:url . "https://github.com/cheunghy/private"))])
+ (private-comments-mode . [(20220330 1316) ((emacs (27 1))) "Minor mode for masukomi/private_comments" single ((:commit . "57eb1ba3812e44344b7d5336c3a3ad14a28e4f9e") (:keywords "tools") (:url . "https://github.com/masukomi/private-comments-mode"))])
+ (private-diary . [(20151216 1657) ((emacs (24 0))) "maintain a private diary in Emacs" single ((:commit . "0c86fb6150ad8ed14f94def3504f5a68f4147283") (:authors ("James P. Ascher" . "jpa4q@virginia.edu")) (:maintainer "James P. Ascher" . "jpa4q@virginia.edu") (:keywords "diary" "encryption") (:url . "https://github.com/cacology/private-diary"))])
+ (proc-net . [(20130322 12) nil "network process tools" single ((:commit . "10861112a1f3994c8e6374d6c5bb5d734cfeaf73") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "processes") (:url . "http://github.com/nicferrier/emacs-procnet"))])
+ (proced-narrow . [(20190911 1818) ((seq (2 20)) (emacs (24))) "Live-narrowing of search results for proced." single ((:commit . "0e2a4dfb072eb0369d0020b429e820ae620d325e") (:authors ("Travis Jeffery" . "tj@travisjeffery.com")) (:maintainer "Travis Jeffery" . "tj@travisjeffery.com") (:keywords "processes" "proced") (:url . "https://github.com/travisjeffery/proced-narrow"))])
+ (processing-mode . [(20171022 2302) nil "Major mode for Processing 2.0" single ((:commit . "448aba82970c98322629eaf2746e73be6c30c98e") (:authors ("Peter Vasil" . "mail@petervasil.net")) (:maintainer "Peter Vasil" . "mail@petervasil.net") (:keywords "languages" "snippets") (:url . "https://github.com/ptrv/processing2-emacs"))])
+ (processing-snippets . [(20140426 1428) ((yasnippet (0 8 0))) "Snippets for processing-mode" tar ((:commit . "448aba82970c98322629eaf2746e73be6c30c98e") (:authors ("Peter Vasil" . "mail@petervasil.net")) (:maintainer "Peter Vasil" . "mail@petervasil.net") (:keywords "snippets") (:url . "https://github.com/ptrv/processing2-emacs"))])
+ (prodigy . [(20220507 1753) ((s (1 8 0)) (dash (2 4 0)) (f (0 14 0)) (emacs (27 1))) "Manage external services" single ((:commit . "535789e32028133fa9dfb4c9135b6a65c199472f") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:url . "http://github.com/rejeep/prodigy.el"))])
+ (professional-theme . [(20150315 1100) nil "Emacs port of Vim's professional theme" single ((:commit . "0927d1474049a193f9f366bde5eb1887b9ba20ed") (:authors ("Juanjo Alvarez" . "juanjo@juanjoalvarez.net")) (:maintainer "Juanjo Alvarez" . "juanjo@juanjoalvarez.net") (:keywords "theme" "light" "professional") (:url . "https://github.com/juanjux/emacs-professional-theme"))])
+ (prog-fill . [(20180607 132) ((emacs (25 1)) (cl-lib (0 6 1))) "Smartly format lines to use vertical space." single ((:commit . "3fbf7da6dd826e95c9077d659566ee29814a31d8") (:authors ("Matthew Carter" . "m@ahungry.com")) (:maintainer "Matthew Carter" . "m@ahungry.com") (:keywords "ahungry" "convenience" "c" "formatting" "editing") (:url . "https://github.com/ahungry/prog-fill"))])
+ (prognth . [(20130920 1759) nil "Extend prog1 to arbitrary index" single ((:commit . "2f1ca4d34b1fd581163e1df122c85418137e8e62") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "lisp"))])
+ (programmer-dvorak . [(20150427 137) nil "Input method for Programmer Dvorak." single ((:commit . "3288a8f058eca4cab390a564babbbcb17cfa0350") (:authors ("Chenyun Yang" . "yangchenyun@gmail.com")) (:maintainer "Chenyun Yang" . "yangchenyun@gmail.com") (:keywords "dvorak" "programmer-dvorak" "input-method") (:url . "https://github.com/yangchenyun/programmer-dvorak"))])
+ (project-abbrev . [(20210715 1213) ((emacs (25 1))) "Customize abbreviation expansion in the project" single ((:commit . "d47f08f64cce595cbd4e9fbe3544986b3c4cee83") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/project-abbrev"))])
+ (project-explorer . [(20150504 14) ((cl-lib (0 3)) (es-lib (0 3)) (es-windows (0 1)) (emacs (24))) "A project explorer sidebar" single ((:commit . "589a09008706f5f4ef91393dc4306eede0d15ca9") (:authors ("sabof")) (:maintainer "sabof") (:url . "https://github.com/sabof/project-explorer"))])
+ (project-mode-line-tag . [(20211013 1954) ((emacs (25 1))) "Display a buffer's project in its mode line" single ((:commit . "69d44e5495185587ee8577f8b9d616063d6bd7f8") (:authors ("Fritz Grabo" . "hello@fritzgrabo.com")) (:maintainer "Fritz Grabo" . "hello@fritzgrabo.com") (:keywords "convenience") (:url . "https://github.com/fritzgrabo/project-mode-line-tag"))])
+ (project-persist . [(20180906 1302) nil "A minor mode to allow loading and saving of project settings." tar ((:commit . "26d9435bef44da2a1b0892eba822f9f487b98eec") (:authors ("Robert Dallas Gray")) (:maintainer "Robert Dallas Gray") (:keywords "project" "persistence") (:url . "https://github.com/rdallasgray/project-persist"))])
+ (project-persist-drawer . [(20151108 1222) ((project-persist (0 3))) "Use a project drawer with project-persist." tar ((:commit . "35bbe132a4fab6a0fec15ce6c0fd2fe6a4aa9626") (:authors ("Robert Dallas Gray" . "mail@robertdallasgray.com")) (:maintainer "Robert Dallas Gray" . "mail@robertdallasgray.com") (:keywords "defaults") (:url . "https://github.com/rdallasgray/project-persist-drawer.git"))])
+ (project-rootfile . [(20220509 1552) ((emacs (27 1))) "Extension of project.el to detect project with root file" single ((:commit . "fe2c8442ec501b0a0ef2f723bcbc41b2103011be") (:authors ("Taiki Sugawara" . "buzz.taiki@gmail.com")) (:maintainer "Taiki Sugawara" . "buzz.taiki@gmail.com") (:url . "https://github.com/buzztaiki/project-rootfile.el"))])
+ (project-shells . [(20210625 647) ((emacs (24 3)) (seq (2 19))) "Manage the shell buffers of each project" single ((:commit . "900369828f1a213c60a2207a71d46bc43fd5405c") (:authors ("\"Huang, Ying\"" . "huang.ying.caritas@gmail.com")) (:maintainer "\"Huang, Ying\"" . "huang.ying.caritas@gmail.com") (:keywords "processes" "terminals") (:url . "https://github.com/hying-caritas/project-shells"))])
+ (project-tab-groups . [(20220331 918) ((emacs (28))) "Support a \"one tab group per project\" workflow" single ((:commit . "837267a23fa57199599b96af94c2db2e80a859d3") (:authors ("Fritz Grabo" . "hello@fritzgrabo.com")) (:maintainer "Fritz Grabo" . "hello@fritzgrabo.com") (:keywords "convenience") (:url . "https://github.com/fritzgrabo/project-tab-groups"))])
+ (projectile . [(20220430 800) ((emacs (25 1))) "Manage and navigate projects in Emacs easily" single ((:commit . "a4f86f981c84a546530d5904253fa266431ef806") (:authors ("Bozhidar Batsov" . "bozhidar@batsov.dev")) (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev") (:keywords "project" "convenience") (:url . "https://github.com/bbatsov/projectile"))])
+ (projectile-codesearch . [(20180508 1522) ((codesearch (20171122 431)) (projectile (20150405 126))) "Integration of codesearch into projectile" single ((:commit . "f6eb96f034a925444412cfa03e45e0ccbbafe3f2") (:authors ("Austin Bingham" . "austin.bingham@gmail.com")) (:maintainer "Austin Bingham" . "austin.bingham@gmail.com") (:keywords "tools" "development" "search") (:url . "https://github.com/abingham/emacs-codesearch"))])
+ (projectile-git-autofetch . [(20200820 2028) ((emacs (25 1)) (projectile (0 14 0))) "automatically fetch git repositories" single ((:commit . "423ed5fa6508c4edc0a837bb585c7e77e99876be") (:authors ("Andreas Müller" . "code@0x7.ch")) (:maintainer "Andreas Müller" . "code@0x7.ch") (:keywords "tools" "vc") (:url . "https://github.com/andrmuel/projectile-git-autofetch"))])
+ (projectile-rails . [(20220403 1621) ((emacs (25 1)) (projectile (0 12 0)) (inflections (1 1)) (inf-ruby (2 2 6)) (f (0 13 0)) (rake (0 3 2)) (dash (2 18 1))) "Minor mode for Rails projects based on projectile-mode" single ((:commit . "2a0107e83d8320507e288c853e0762bec110cd15") (:authors ("Adam Sokolnicki" . "adam.sokolnicki@gmail.com")) (:maintainer "Adam Sokolnicki" . "adam.sokolnicki@gmail.com") (:keywords "rails" "projectile") (:url . "https://github.com/asok/projectile-rails"))])
+ (projectile-ripgrep . [(20180914 1500) ((ripgrep (0 3 0)) (projectile (0 14 0))) "Run ripgrep with Projectile" single ((:commit . "4ed5c741233a81d96115f556784269042070901e") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "ripgrep" "projectile") (:url . "https://github.com/nlamirault/ripgrep.el"))])
+ (projectile-sift . [(20160107 1015) ((sift (0 2 0)) (projectile (0 13 0))) "Run a sift with Projectile" single ((:commit . "cdddba2d183146c340915003f1b5d09d13712c22") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "sift" "projectile") (:url . "https://github.com/nlamirault/sift.el"))])
+ (projectile-speedbar . [(20190807 2010) ((projectile (0 11 0)) (sr-speedbar (0))) "projectile integration for speedbar" single ((:commit . "93320e467ee78772065e599a5dba94889a77db22") (:authors ("Anshul Verma" . "anshul.verma86@gmail.com")) (:maintainer "Anshul Verma" . "anshul.verma86@gmail.com") (:keywords "project" "convenience" "speedbar" "projectile") (:url . "https://github.com/anshulverma/projectile-speedbar"))])
+ (projectile-trailblazer . [(20170928 1624) ((emacs (24 4)) (projectile (0 12 0)) (inflections (1 1)) (inf-ruby (2 2 6)) (f (0 13 0)) (rake (0 3 2))) "Minor mode for Rails projects using trailblazer" single ((:commit . "a37a4f7b7f727d98e4c74c0256e059e84263553d") (:authors ("Michael Dahl" . "michael.dahl84@gmail.com")) (:maintainer "Michael Dahl" . "michael.dahl84@gmail.com") (:keywords "rails" "projectile" "trailblazer" "languages") (:url . "https://github.com/micdahl/projectile-trailblazer"))])
+ (projectile-variable . [(20170208 1718) ((emacs (24)) (cl-lib (0 5))) "Store project local variables." single ((:commit . "8d348ac70bdd6dc320c13a12941b32b38140e264") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "project" "convenience") (:url . "https://github.com/zonuexe/projectile-variable"))])
+ (projector . [(20211112 1514) ((alert (1 1)) (cl-lib (0 5))) "Lightweight library for managing project-aware shell and command buffers" single ((:commit . "1d0f2d307591ea50888d31dcae7e463e2ada1316") (:authors ("Justin Talbott" . "justin@waymondo.com")) (:maintainer "Justin Talbott" . "justin@waymondo.com") (:url . "https://github.com/waymondo/projector.el"))])
+ (projekt . [(20150324 848) ((emacs (24))) "some kind of staging for CVS" single ((:commit . "a65e554e5d8b0def08c5d06f3fe34fec40bebd83") (:authors ("Engelke Eschner" . "tekai@gmx.li")) (:maintainer "Engelke Eschner" . "tekai@gmx.li"))])
+ (projmake-mode . [(20161031 1715) ((dash (20150611 922)) (indicators (20130217 1405))) "Project oriented automatic builder and error highlighter, flymake for projects" tar ((:commit . "a897701f7e8f8cc11459ed44eb0e454db2a460c1"))])
+ (promise . [(20210307 727) ((emacs (25 1))) "Promises/A+" tar ((:commit . "cec51feb5f957e8febe6325335cf57dc2db6be30") (:authors ("chuntaro" . "chuntaro@sakura-games.jp")) (:maintainer "chuntaro" . "chuntaro@sakura-games.jp") (:keywords "async" "promise" "convenience") (:url . "https://github.com/chuntaro/emacs-promise"))])
+ (prompt-text . [(20190408 310) nil "Configure your minibuffer prompt" single ((:commit . "f51cf3d7f08ab8946e9869f7de2082536e45cc22") (:authors ("10sr <8slashes+el [at] gmail [dot] com>")) (:maintainer "10sr <8slashes+el [at] gmail [dot] com>") (:keywords "utility" "minibuffer") (:url . "https://github.com/10sr/prompt-text-el"))])
+ (prompts . [(20160916 1041) ((dash (2 13 0))) "utilities for working with text prompts." single ((:commit . "1cd5e732ff2a86b47836eb7252e5b59cd4b6ab26") (:authors ("Ben Moon" . "guiltydolphin@gmail.com")) (:maintainer "Ben Moon" . "guiltydolphin@gmail.com") (:keywords "input" "minibuffer") (:url . "https://github.com/guiltydolphin/prompts.el"))])
+ (pronto . [(20200218 1633) ((emacs (24))) "Compilation mode for pronto stylechecks" single ((:commit . "c2a2ec718c08de1fd2e681970456786cf4eac8fe") (:authors ("Julian Rubisch" . "julian@julianrubisch.at")) (:maintainer "Julian Rubisch" . "julian@julianrubisch.at") (:keywords "processes" "tools") (:url . "https://github.com/julianrubisch/pronto.el"))])
+ (proof-general . [(20220329 655) ((emacs (25 1))) "A generic Emacs interface for proof assistants" tar ((:commit . "2a8701209b273db5a35f15145ec62f32799e03b1") (:url . "https://proofgeneral.github.io/"))])
+ (prop-menu . [(20150728 1118) ((emacs (24 3)) (cl-lib (0 5))) "Create and display a context menu based on text and overlay properties" single ((:commit . "50b102c1c0935fd3e0c465feed7f27d66b21cdf3") (:authors ("David Christiansen" . "david@davidchristiansen.dk")) (:maintainer "David Christiansen" . "david@davidchristiansen.dk") (:keywords "convenience") (:url . "https://github.com/david-christiansen/prop-menu-el"))])
+ (propfont-mixed . [(20150113 2211) ((emacs (24)) (cl-lib (0 5))) "Use proportional fonts with space-based indentation." single ((:commit . "0b461ef4754a469610dba71874a34b6da42176bf") (:authors ("Kirill Ignatiev <github.com/ikirill>")) (:maintainer "Kirill Ignatiev <github.com/ikirill>") (:keywords "faces") (:url . "https://github.com/ikirill/propfont-mixed"))])
+ (proportional . [(20200309 1556) ((emacs (25 1))) "use a proportional font everywhere" single ((:commit . "0e4537af7ba2bc9dbb449c38350bce012b382f51") (:authors ("Johannes Goslar")) (:maintainer "Johannes Goslar") (:keywords "faces") (:url . "https://github.com/ksjogo/proportional"))])
+ (prosjekt . [(20151127 1416) ((dash (2 8 0))) "a software project tool for emacs" tar ((:commit . "a864a8be5842223043702395f311e3350c28e9db") (:authors ("Austin Bingham" . "austin.bingham@gmail.com")) (:maintainer "Austin Bingham" . "austin.bingham@gmail.com") (:url . "https://github.com/abingham/prosjekt"))])
+ (protobuf-mode . [(20220303 1716) nil "major mode for editing protocol buffers." single ((:commit . "354aba886e07c18a233dc33a9895c5d4f8f0bc08") (:authors ("Alexandre Vassalotti" . "alexandre@peadrop.com")) (:maintainer "Alexandre Vassalotti" . "alexandre@peadrop.com") (:keywords "google" "protobuf" "languages"))])
+ (protocols . [(20170802 1132) ((cl-lib (0 5))) "Protocol database access functions." single ((:commit . "d0f7c4acb05465f1a0d4be54363bbd2802647e77") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "convenience" "net" "protocols") (:url . "https://github.com/davep/protocols.el"))])
+ (proxy-mode . [(20220210 1410) ((emacs (25))) "A minor mode to toggle proxy." single ((:commit . "620e48c6afaf760d0ee9f5bdf583fd91cd9d0ec6") (:keywords "comm" "proxy") (:url . "https://repo.or.cz/proxy-mode.git"))])
+ (psalm . [(20211002 1552) ((emacs (24 3)) (php-mode (1 22 3))) "Interface to Psalm" single ((:commit . "28d546a79cb865a78b94cd7e929d66d720505faa") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "tools" "php") (:url . "https://github.com/emacs-php/psalm.el"))])
+ (psc-ide . [(20210219 2247) ((emacs (25)) (dash (2 18 0)) (company (0 8 7)) (s (1 10 0)) (flycheck (0 24)) (let-alist (1 0 4)) (seq (1 11))) "Minor mode for PureScript's IDE server." tar ((:commit . "ce97d719458ea099b40c02f05b6609601c727e66") (:authors ("Erik Post" . "erik@shinsetsu.nl") ("Dmitry Bushenko" . "d.bushenko@gmail.com") ("Christoph Hegemann" . "christoph.hegemann1337@gmail.com") ("Brian Sermons")) (:maintainer "Erik Post" . "erik@shinsetsu.nl") (:keywords "languages") (:url . "https://github.com/purescript-emacs/psc-ide-emacs"))])
+ (psci . [(20191025 830) ((emacs (24 4)) (purescript-mode (13 10)) (dash (2 9 0))) "Major mode for purescript repl psci" tar ((:commit . "95fb5d14033add8fe9c8c6b4379758beb88af1d0") (:authors ("Antoine R. Dumont <eniotna.t AT gmail.com>")) (:maintainer "Antoine R. Dumont <eniotna.t AT gmail.com>") (:keywords "languages" "purescript" "psci" "repl") (:url . "https://github.com/purescript-emacs/emacs-psci"))])
+ (psession . [(20220318 1129) ((emacs (24)) (cl-lib (0 5)) (async (1 9 3))) "Persistent save of elisp objects." single ((:commit . "328c64804c4c9e15b373c7ba3bc82bfdfb27971a") (:authors ("Thierry Volpiatto" . "thierry.volpiatto@gmail.com")) (:maintainer "Thierry Volpiatto" . "thierry.volpiatto@gmail.com") (:url . "https://github.com/thierryvolpiatto/psession"))])
+ (psysh . [(20190709 106) ((emacs (24 3)) (s (1 9 0)) (f (0 17)) (php-runtime (0 2))) "PsySH, PHP interactive shell (REPL)" single ((:commit . "21250984ad8137aa3440ac12e52475ef03f19fcb") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "processes" "php") (:url . "https://github.com/zonuexe/psysh.el"))])
+ (pt . [(20161226 1959) nil "A front-end for pt, The Platinum Searcher." single ((:commit . "6d99b2aaded3ece3db19a20f4b8f1d4abe382622") (:authors ("Bailey Ling")) (:maintainer "Bailey Ling") (:keywords "pt" "ack" "ag" "grep" "search") (:url . "https://github.com/bling/pt.el"))])
+ (ptemplate . [(20210324 1446) ((emacs (25 1)) (yasnippet (0 13 0))) "Project templates" single ((:commit . "b81cc7be8865745c3a60177a244d2a69729ab21b") (:authors ("Nikita Bloshchanevich" . "nikblos@outlook.com")) (:maintainer "Nikita Bloshchanevich" . "nikblos@outlook.com") (:url . "https://github.com/nbfalcon/ptemplate"))])
+ (ptemplate-templates . [(20210324 1443) ((emacs (25 1)) (ptemplate (2 0 0))) "Official templates" tar ((:commit . "3788387973dde3101f9a3f2064572be033c59ad6") (:authors ("Nikita Bloshchanevich" . "nikblos@outlook.com")) (:maintainer "Nikita Bloshchanevich" . "nikblos@outlook.com") (:url . "https://github.com/nbfalcon/ptemplate-templates"))])
+ (pubmed . [(20210927 1933) ((emacs (25 1)) (deferred (0 5 1)) (esxml (0 3 4)) (s (1 12 0)) (unidecode (0 2))) "Interface to PubMed" tar ((:commit . "e1ac5433daf966cf7c5e9178b037191e1eb3e4bd") (:authors ("Folkert van der Beek" . "folkertvanderbeek@gmail.com")) (:maintainer "Folkert van der Beek" . "folkertvanderbeek@gmail.com") (:keywords "pubmed" "hypermedia") (:url . "https://gitlab.com/fvdbeek/emacs-pubmed"))])
+ (pug-mode . [(20211114 1645) ((emacs (24 4)) (cl-lib (0 5))) "Major mode for jade/pug template files" single ((:commit . "73f8c2f95eba695f701df20c8436f49abadebdc1") (:authors ("Nathan Weizenbaum")) (:maintainer "Henrik Lissner" . "contact@henrik.io") (:keywords "markup" "language" "jade" "pug") (:url . "https://github.com/hlissner/emacs-pug-mode"))])
+ (pulseaudio-control . [(20220418 742) nil "Use `pactl' to manage PulseAudio volumes." single ((:commit . "22f54ae7282b37eaec0231a21e60213a5dbc7172") (:authors ("Alexis" . "flexibeast@gmail.com") ("Ellington Santos" . "ellingtonsantos@gmail.com") ("Sergey Trofimov" . "sarg@sarg.org.ru")) (:maintainer "Alexis" . "flexibeast@gmail.com") (:keywords "multimedia" "hardware" "sound" "pulseaudio") (:url . "https://github.com/flexibeast/pulseaudio-control"))])
+ (punctuality-logger . [(20141120 2031) nil "Punctuality logger for Emacs" single ((:commit . "e09e5dd37bc92289fa2f7dc44aed51a7b5e04bb0") (:authors ("Philip Woods" . "elzairthesorcerer@gmail.com")) (:maintainer "Philip Woods" . "elzairthesorcerer@gmail.com") (:keywords "reminder" "calendar") (:url . "https://gitlab.com/elzair/punctuality-logger"))])
+ (pungi . [(20150222 1246) ((jedi (0 2 0 -3 2)) (pyvenv (1 5))) "Integrates jedi with virtualenv and buildout python environments" single ((:commit . "a2d4d439ea371be0b064a12248288903b8a521a0") (:authors ("Matthew Russell" . "matthew.russell@horizon5.org")) (:maintainer "Matthew Russell" . "matthew.russell@horizon5.org") (:keywords "convenience"))])
+ (puni . [(20220405 1808) ((emacs (26 1))) "Parentheses Universalistic" single ((:commit . "bb9b1e271b51b3dfae984da15f0e40f5be5b2473") (:authors ("Hao Wang" . "amaikinono@gmail.com")) (:maintainer "Hao Wang" . "amaikinono@gmail.com") (:keywords "convenience" "lisp" "tools") (:url . "https://github.com/AmaiKinono/puni"))])
+ (punpun-theme . [(20210508 1635) ((emacs (24 1))) "A bleak theme" tar ((:commit . "7026684cd568cb691af3ced5de14c375fe6f5a1a"))])
+ (puppet-mode . [(20210305 645) ((emacs (24 1)) (pkg-info (0 4))) "Major mode for Puppet manifests" single ((:commit . "71bcd383f20a457e8ad34e0e08ec47f8e1b64263") (:authors ("Vox Pupuli" . "voxpupuli@groups.io") ("Bozhidar Batsov" . "bozhidar@batsov.com") ("Sebastian Wiesner" . "swiesner@lunaryorn.com") ("Russ Allbery" . "rra@stanford.edu")) (:maintainer "Vox Pupuli" . "voxpupuli@groups.io") (:keywords "languages") (:url . "https://github.com/voxpupuli/puppet-mode"))])
+ (purescript-mode . [(20210109 244) ((emacs (25 1))) "A PureScript editing mode" tar ((:commit . "9c37067e611b5253a095f03245c247aa97bd7614") (:authors ("1992 Simon Marlow") ("1997-1998 Graeme E Moss" . "gem@cs.york.ac.uk") ("Tommy Thorn" . "thorn@irisa.fr") ("2001-2002 Reuben Thomas (>=v1.4)") ("2003 Dave Love" . "fx@gnu.org") ("2014 Tim Dysinger" . "tim@dysinger.net")) (:maintainer "1992 Simon Marlow") (:keywords "faces" "files" "purescript") (:url . "https://github.com/purescript-emacs/purescript-mode"))])
+ (purp-theme . [(20210912 1940) nil "A dark color theme with few colors" tar ((:commit . "8d3510e1ed995b8323cd5205626ddde6386a76ca") (:authors ("Vincent Foley" . "vfoley@gmail.com")) (:maintainer "Vincent Foley" . "vfoley@gmail.com") (:keywords "faces") (:url . "https://github.com/gnuvince/purp"))])
+ (purple-haze-theme . [(20141015 229) ((emacs (24 0))) "an overtly purple color theme for Emacs24." single ((:commit . "3e245cbef7cd09e6b3ee124963e372a04e9a6485") (:authors ("Jason Milkins" . "jasonm23@gmail.com")) (:maintainer "Jason Milkins" . "jasonm23@gmail.com") (:url . "https://github.com/jasonm23/emacs-purple-haze-theme"))])
+ (purty-mode . [(20131004 2259) nil "Safely pretty-print greek letters, mathematical symbols, or anything else." single ((:commit . "8eef77317a3bab07ade212353a50fbd3f20f365a") (:authors ("James Atwood" . "jatwood@cs.umass.edu")) (:maintainer "James Atwood" . "jatwood@cs.umass.edu"))])
+ (pushbullet . [(20140809 1232) ((grapnel (0 5 2)) (json (1 2))) "Emacs client for the PushBullet Android app" single ((:commit . "73c59a0f1dc04875b3e5a2c8afbc26c32128e445") (:authors ("Abhishek L" . "abhishek.lekshmanan@gmail.com")) (:maintainer "Abhishek L" . "abhishek.lekshmanan@gmail.com") (:keywords "convenience") (:url . "http://www.github.com/theanalyst/revolver"))])
+ (pushover . [(20170818 2103) ((cl-lib (0 5))) "Pushover API Access" single ((:commit . "bbe3ac8df3c532a72da4552615af960b8a577588") (:authors ("Samuel W. Flint" . "swflint@flintfam.org")) (:maintainer "Samuel W. Flint" . "swflint@flintfam.org") (:keywords "notifications") (:url . "http://github.com/swflint/pushover.el"))])
+ (px . [(20170317 2330) nil "preview inline latex in any mode" single ((:commit . "0c52f7933eab3ca1642ab0df151db9950430c9e2") (:authors ("Aurélien Aptel" . "aurelien.aptel@gmail.com")) (:maintainer "Aurélien Aptel" . "aurelien.aptel@gmail.com") (:url . "http://github.com/aaptel/preview-latex"))])
+ (py-autopep8 . [(20220502 310) ((emacs (26 1))) "Use autopep8 to beautify a Python buffer" single ((:commit . "89c9ed8de2deab6bb891ae25c85cc6498e60b90a") (:authors ("Friedrich Paetzk" . "f.paetzke@gmail.com")) (:maintainer "Friedrich Paetzk" . "f.paetzke@gmail.com") (:keywords "convenience") (:url . "https://github.com/ideasman42/emacs-py-autopep8"))])
+ (py-gnitset . [(20170821 1732) nil "Run your Python tests any way you'd like" single ((:commit . "1e993cc29cbc31e06fe1e335dec198e21972fa55") (:authors ("Brandon W Maister" . "quodlibetor@gmail.com")) (:maintainer "Brandon W Maister" . "quodlibetor@gmail.com") (:url . "https://www.github.com/quodlibetor/py-gnitset"))])
+ (py-import-check . [(20130802 1111) nil "Finds the unused python imports using importchecker" single ((:commit . "9787f87745a4234cd9bed711860b707902bc8ae4") (:authors ("Sibi" . "sibi@psibi.in")) (:maintainer "Sibi" . "sibi@psibi.in") (:keywords "python" "import" "check") (:url . "https://github.com/psibi/emacs-py-import-check"))])
+ (py-isort . [(20160925 1018) nil "Use isort to sort the imports in a Python buffer" single ((:commit . "e67306f459c47c53a65604e4eea88a3914596560") (:authors ("Friedrich Paetzke" . "paetzke@fastmail.fm")) (:maintainer "Friedrich Paetzke" . "paetzke@fastmail.fm") (:url . "http://paetzke.me/project/py-isort.el"))])
+ (py-smart-operator . [(20170531 1209) ((s (1 9 0))) "smart-operator for python-mode" single ((:commit . "0c8a66faca4b35158d0b5885472cb75286039167") (:authors ("Rustem Muslimov" . "r.muslimov@gmail.com")) (:maintainer "Rustem Muslimov" . "r.muslimov@gmail.com") (:keywords "python" "convenience" "smart-operator"))])
+ (py-test . [(20151117 622) ((dash (2 9 0)) (f (0 17)) (emacs (24 4))) "A test runner for Python code." single ((:commit . "3b2a0bdaacb54df6f2bee8317423e5c0d159d5cf") (:authors ("Bogdan Paul Popa" . "popa.bogdanp@gmail.com")) (:maintainer "Bogdan Paul Popa" . "popa.bogdanp@gmail.com") (:keywords "python" "testing" "py.test") (:url . "https://github.com/Bogdanp/py-test.el"))])
+ (py-yapf . [(20160925 1122) nil "Use yapf to beautify a Python buffer" single ((:commit . "a878304202ad827a1f3de3dce1badd9ca8731146") (:authors ("Friedrich Paetzke" . "f.paetzke@gmail.com")) (:maintainer "Friedrich Paetzke" . "f.paetzke@gmail.com") (:url . "https://github.com/paetzke/py-yapf.el"))])
+ (pycarddavel . [(20150831 1216) ((helm (1 7 0)) (emacs (24 0))) "Integrate pycarddav" single ((:commit . "a6d81ee4eb8309cd82f6082aeca68c5a015702a3") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:keywords "helm" "pyccarddav" "carddav" "message" "mu4e" "contacts"))])
+ (pycoverage . [(20200513 2047) ((emacs (24 3))) "Support for coverage stats on Python 2.X and 3" tar ((:commit . "3c69ed312121368f1b24cc04d54a29ce4ed4f743") (:authors ("matt harrison")) (:maintainer "matt harrison") (:keywords "project" "convenience") (:url . "https://github.com/mattharrison/pycoverage.el"))])
+ (pydoc . [(20211119 2211) nil "functional, syntax highlighted pydoc navigation" single ((:commit . "3aaffe41e1c5a9d53fbc1de02686c386fd002890") (:authors ("John Kitchin" . "jkitchin@andrew.cmu.edu")) (:maintainer "Brian J. Lopes" . "statmobile@gmail.com") (:keywords "pydoc" "python") (:url . "https://github.com/statmobile/pydoc"))])
+ (pyenv-mode . [(20200518 1521) ((pythonic (0 1 0))) "Integrate pyenv with python-mode" single ((:commit . "b818901b8eac0e260ced66a6a5acabdbf6f5ba99") (:authors ("Artem Malyshev" . "proofit404@gmail.com")) (:maintainer "Artem Malyshev" . "proofit404@gmail.com") (:url . "https://github.com/proofit404/pyenv-mode"))])
+ (pyenv-mode-auto . [(20180620 1252) ((pyenv-mode (0 1 0)) (s (1 11 0)) (f (0 17 0))) "Automatically activates pyenv version if .python-version file exists." single ((:commit . "347b94cd5ad22e33cc41be661c102d4548767858") (:authors ("Sviatoslav Bulbakha" . "mail@ssbb.me")) (:maintainer "Sviatoslav Bulbakha" . "mail@ssbb.me") (:keywords "python" "pyenv") (:url . "https://github.com/ssbb/pyenv-mode-auto"))])
+ (pygen . [(20161121 506) ((elpy (1 12 0)) (python-mode (6 2 2)) (dash (2 13 0))) "Python code generation using Elpy and Python-mode." single ((:commit . "9019ff44ba49d7295b1476530feab91fdadb084b") (:authors ("Jack Crawley <http://www.github.com/jackcrawley>")) (:maintainer "Jack Crawley <http://www.github.com/jackcrawley>") (:keywords "python" "code generation") (:url . "https://github.com/JackCrawley/pygen/"))])
+ (pygn-mode . [(20211021 2325) ((emacs (26 1)) (tree-sitter (0 15 2)) (tree-sitter-langs (0 10 7)) (uci-mode (0 5 4)) (nav-flash (1 0 0)) (ivy (0 10 0))) "Major-mode for chess PGN files, powered by Python" tar ((:commit . "eb1da7e3eb5f5754b60d404b0e341206eebe19ca") (:authors ("Dodge Coates and Roland Walker")) (:maintainer "Dodge Coates and Roland Walker") (:keywords "data" "games" "chess") (:url . "https://github.com/dwcoates/pygn-mode"))])
+ (pyim . [(20220509 405) ((emacs (25 1)) (async (1 6)) (xr (1 13))) "A Chinese input method support quanpin, shuangpin, wubi, cangjie and rime." tar ((:commit . "3339ffac4bb116f09754f1ed262e8bede2df2bf1") (:authors ("Ye Wenbin" . "wenbinye@163.com") ("Feng Shu" . "tumashu@163.com")) (:maintainer "Feng Shu" . "tumashu@163.com") (:keywords "convenience" "chinese" "pinyin" "input-method") (:url . "https://github.com/tumashu/pyim"))])
+ (pyim-basedict . [(20210517 43) nil "The default pinyin dict of pyim" tar ((:commit . "86f6de3e3a1523eb278bd3afe7c4ceba2a0e2972") (:authors ("Feng Shu" . "tumashu@163.com")) (:maintainer "Feng Shu" . "tumashu@163.com") (:keywords "convenience" "chinese" "pinyin" "input-method" "complete") (:url . "https://github.com/tumashu/pyim-basedict"))])
+ (pyim-cangjiedict . [(20210617 934) ((pyim (3 7))) "Some cangjie dicts for pyim" tar ((:commit . "d17e3d32a6480939b350a91a915ebe8e6efad819") (:authors ("Yuanchen Xie" . "yuanchen.gm@gmail.com")) (:maintainer "Yuanchen Xie" . "yuanchen.gm@gmail.com") (:keywords "convenience" "chinese" "pinyin" "input-method" "complete") (:url . "https://github.com/p1uxtar/pyim-cangjiedict"))])
+ (pyim-smzmdict . [(20210505 1445) ((pyim (3 7))) "Sanma(triple) Zhengma dict for pyim" tar ((:commit . "fcddbde17a04d174c7353548056524687f7be8d2") (:authors ("Yue Shi (Zhizhi)")) (:maintainer "Yuanchen Xie") (:keywords "convenience" "i18n" "pyim" "chinese" "zhengma") (:url . "https://github.com/p1uxtar/pyim-smzmdict"))])
+ (pyim-wbdict . [(20210902 1714) ((pyim (3 7))) "Some wubi dicts for pyim" tar ((:commit . "4db1ca7fee75bd3aa394d620e5af2f42b3caf3c4") (:authors ("Feng Shu" . "tumashu@163.com")) (:maintainer "Feng Shu" . "tumashu@163.com") (:keywords "convenience" "chinese" "pinyin" "input-method" "complete") (:url . "https://github.com/tumashu/pyim-wbdict"))])
+ (pyimport . [(20180308 1752) ((dash (2 8 0)) (s (1 9 0)) (shut-up (0 3 2))) "Manage Python imports!" single ((:commit . "a6f63cf7ed93f0c0f7c207e6595813966f8852b9") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk"))])
+ (pyimpsort . [(20160130 453) ((emacs (24 3))) "Sort python imports." tar ((:commit . "d5c61d70896b642646dfd3c809c06174ae086c1a") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "convenience") (:url . "https://github.com/emacs-pe/pyimpsort.el"))])
+ (pyinspect . [(20211102 1415) ((emacs (27 1))) "Python object inspector" tar ((:commit . "36cf624236c8b4cce852dd52b64d058d4d4a32fd") (:authors ("Maor Kadosh" . "git@avocadosh.xyz")) (:maintainer "Maor Kadosh" . "git@avocadosh.xyz") (:keywords "tools") (:url . "https://github.com/it-is-wednesday/pyinspect.el"))])
+ (pylint . [(20210411 1931) nil "minor mode for running `pylint'" single ((:commit . "874cb4339aac8100806ac7ca9701f4f519080288") (:authors ("Ian Eure" . "ian.eure@gmail.com")) (:maintainer "Jonathan Kotta" . "jpkotta@gmail.com") (:keywords "languages" "python"))])
+ (pynt . [(20180710 726) ((emacs (24 4)) (ein (0 13 1)) (epc (0 1 1)) (deferred (0 5 1))) "Generate and scroll EIN buffers from python code" single ((:commit . "86cf9ce78d34f92bfd0764c9cbb75427ebd429e6") (:authors ("Edward Banner" . "edward.banner@gmail.com")) (:maintainer "Edward Banner" . "edward.banner@gmail.com") (:keywords "convenience") (:url . "https://github.com/ebanner/pynt"))])
+ (pyramid . [(20210427 1032) ((emacs (25 2)) (pythonic (0 1 1)) (tablist (0 70))) "Minor mode for working with pyramid projects" tar ((:commit . "66f54f4a9cc9fa81edf768ab433d5b3c5517363c") (:authors ("Daniel Kraus" . "daniel@kraus.my")) (:maintainer "Daniel Kraus" . "daniel@kraus.my") (:keywords "python" "pyramid" "pylons" "convenience" "tools" "processes") (:url . "https://github.com/dakra/pyramid.el"))])
+ (pytest . [(20200330 41) ((s (1 9 0))) "Easy Python test running in Emacs" single ((:commit . "6934047242db79b1c53e9fe3e0734cc9719ed1c4") (:keywords "pytest" "python" "testing") (:url . "https://github.com/ionrock/pytest-el"))])
+ (pytest-pdb-break . [(20200804 848) ((emacs (25))) "A pytest PDB launcher" tar ((:commit . "fe4a43299a926223634c3b104b751397bb818019") (:authors ("Jane Soko" . "poppyschmo@protonmail.com")) (:maintainer "Jane Soko" . "poppyschmo@protonmail.com") (:keywords "languages" "tools") (:url . "https://github.com/poppyschmo/pytest-pdb-break"))])
+ (python-black . [(20211217 2037) ((emacs (25)) (dash (2 16 0)) (reformatter (0 3))) "Reformat Python using python-black" single ((:commit . "cc6919e758b5845b201e1cb08a9b5d9a2598a7f1") (:authors ("wouter bolsterlee" . "wouter@bolsterl.ee")) (:maintainer "wouter bolsterlee" . "wouter@bolsterl.ee") (:keywords "languages") (:url . "https://github.com/wbolster/emacs-python-black"))])
+ (python-cell . [(20220105 2315) ((emacs (25 1))) "Support for MATLAB-like cells in python mode" single ((:commit . "9a111dcee0cbb5922662bfecb37b6983b740950a") (:authors ("Thomas Hisch" . "t.hisch@gmail.com")) (:maintainer "Thomas Hisch" . "t.hisch@gmail.com") (:keywords "extensions" "python" "matlab" "cell") (:url . "https://github.com/thisch/python-cell.el"))])
+ (python-coverage . [(20211224 1420) ((emacs (25 1)) (dash (2 18 0)) (s (1 12 0)) (xml+ (1))) "Show Python coverage via overlays or Flycheck" single ((:commit . "a341615af03dbe3ce0ac9b63cf43dc01c1ae5ebe") (:authors ("wouter bolsterlee" . "wouter@bolsterl.ee")) (:maintainer "wouter bolsterlee" . "wouter@bolsterl.ee") (:keywords "languages" "processes" "tools") (:url . "https://github.com/wbolster/emacs-python-coverage"))])
+ (python-django . [(20150822 404) nil "A Jazzy package for managing Django projects" single ((:commit . "fc54ad74f0309670359b939f64d0f1fff68aeac4") (:authors ("Fabián E. Gallina" . "fabian@anue.biz")) (:maintainer "FSF") (:keywords "languages") (:url . "https://github.com/fgallina/python-django.el"))])
+ (python-docstring . [(20220308 22) nil "Smart Python docstring formatting" tar ((:commit . "01d0470498d08ce9d99dd4ce709c567229f857d2"))])
+ (python-environment . [(20150310 853) ((deferred (0 3 1))) "virtualenv API for Emacs Lisp" tar ((:commit . "401006584e32864a10c69d29f14414828909362e") (:authors ("Takafumi Arakaki <aka.tkf at gmail.com>")) (:maintainer "Takafumi Arakaki <aka.tkf at gmail.com>") (:keywords "applications" "tools"))])
+ (python-info . [(20151228 1852) nil "Python info manual for Emacs" tar ((:commit . "306f15441b54b25757cdfd3b327b84024ea21ed7"))])
+ (python-insert-docstring . [(20211127 1232) ((emacs (25 1))) "Python Google docstring inserter" single ((:commit . "cd6419b74c99c06d5c48c1b289572acce1fd193b") (:authors ("Marco Vocialta" . "macurovc@tutanota.com")) (:maintainer "Marco Vocialta" . "macurovc@tutanota.com") (:url . "https://github.com/macurovc/insert-docstring"))])
+ (python-isort . [(20210603 2153) ((emacs (26)) (reformatter (0 6))) "Reformat python-mode buffer with isort" single ((:commit . "339814df22b87eebca02137e581f65d6283fce97") (:authors ("Jimmy Yuen Ho Wong" . "wyuenho@gmail.com")) (:maintainer "Jimmy Yuen Ho Wong" . "wyuenho@gmail.com") (:keywords "languages") (:url . "https://github.com/wyuenho/emacs-python-isort"))])
+ (python-mls . [(20220505 1523) ((emacs (27 1))) "Multi-line shell for (i)Python" single ((:commit . "6016c780865b3b9dcf90d9452367e0d39bbc1d1f") (:authors ("J.D. Smith")) (:maintainer "J.D. Smith") (:keywords "languages" "processes") (:url . "https://github.com/jdtsmith/python-mls"))])
+ (python-mode . [(20220509 1820) nil "Python major mode" tar ((:commit . "2933e707a09fb99942a062cfb41aa67a2bb64f8e") (:authors ("2015-2021 https://gitlab.com/groups/python-mode-devs") ("2003-2014 https://launchpad.net/python-mode") ("1995-2002 Barry A. Warsaw") ("1992-1994 Tim Peters")) (:maintainer nil . "python-mode@python.org") (:keywords "languages" "processes" "python" "oop") (:url . "https://gitlab.com/groups/python-mode-devs"))])
+ (python-pytest . [(20220502 1237) ((emacs (24 4)) (dash (2 18 0)) (transient (0 3 7)) (projectile (0 14 0)) (s (1 12 0))) "helpers to run pytest" single ((:commit . "5e72c343cb81866358e4437390c5eb84c3203440") (:authors ("wouter bolsterlee" . "wouter@bolsterl.ee")) (:maintainer "wouter bolsterlee" . "wouter@bolsterl.ee") (:keywords "pytest" "test" "python" "languages" "processes" "tools") (:url . "https://github.com/wbolster/emacs-python-pytest"))])
+ (python-switch-quotes . [(20161228 809) ((emacs (24 3))) "cycle between ' and \" quotes in python strings" single ((:commit . "93f1e9b40e061a6cea480139e8b1362b6404abd0") (:authors ("Vladimir Lagunov" . "lagunov.vladimir@gmail.com")) (:maintainer "Vladimir Lagunov" . "lagunov.vladimir@gmail.com") (:keywords "python" "tools" "convenience") (:url . "https://github.com/werehuman/python-switch-quotes"))])
+ (python-test . [(20181018 29) ((emacs (25 1))) "Python testing integration" single ((:commit . "f899975b133539e19ba822e4b0bfd1a28572967e") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "convenience" "tools" "processes") (:url . "https://github.com/emacs-pe/python-test.el"))])
+ (python-x . [(20190611 1303) ((python (0 24)) (folding (0)) (cl-lib (0 5))) "python.el extras for interactive evaluation" tar ((:commit . "b1f8eaccee210d7c0580dba6dc9bd361fcf3765d") (:authors ("Yuri D'Elia" . "wavexx@thregr.org")) (:maintainer "Yuri D'Elia" . "wavexx@thregr.org"))])
+ (pythonic . [(20210122 1247) ((emacs (25 1)) (s (1 9)) (f (0 17 2))) "Utility functions for writing pythonic emacs package." single ((:commit . "fe75bc17baae314bf8f5e0b12aad3fccfc6c5397") (:authors ("Artem Malyshev" . "proofit404@gmail.com")) (:maintainer "Artem Malyshev" . "proofit404@gmail.com") (:url . "https://github.com/proofit404/pythonic"))])
+ (pyvenv . [(20211014 707) nil "Python virtual environment interface" single ((:commit . "31ea715f2164dd611e7fc77b26390ef3ca93509b") (:authors ("Jorgen Schaefer" . "contact@jorgenschaefer.de")) (:maintainer "Jorgen Schaefer" . "contact@jorgenschaefer.de") (:keywords "python" "virtualenv" "tools") (:url . "http://github.com/jorgenschaefer/pyvenv"))])
+ (pyvenv-auto . [(20220315 1606) ((emacs (26 3)) (pyvenv (1 21))) "Automatically switch Python venvs" single ((:commit . "59ece8554bf249f30984c81c103a5704d2fb27bf") (:url . "https://github.com/nryotaro/pyvenv-auto"))])
+ (q-mode . [(20220306 1629) ((emacs (24))) "A q editing mode" single ((:commit . "3eac36d23131088e32057716a3241407fa8dc041") (:keywords "faces" "files" "q") (:url . "https://github.com/psaris/q-mode"))])
+ (qml-mode . [(20161016 31) nil "Major mode for editing QT Declarative (QML) code." single ((:commit . "6c5f33ba88ae010bf201a80ee8095e20a724558c") (:authors ("Yen-Chin Lee" . "coldnew.tw@gmail.com")) (:maintainer "Yen-Chin Lee" . "coldnew.tw@gmail.com") (:keywords "qml" "qt" "qt declarative") (:url . "https://github.com/coldnew/qml-mode"))])
+ (qrencode . [(20211010 1334) ((emacs (25 1))) "QRCode encoder" single ((:commit . "fe3a99ff8cbddcf5391458f356cecf2e8c3a2b84") (:authors ("Rüdiger Sonderfeld" . "ruediger@c-plusplus.net")) (:maintainer "Rüdiger Sonderfeld" . "ruediger@c-plusplus.net") (:keywords "qrcode" "comm") (:url . "https://github.com/ruediger/qrencode-el"))])
+ (qt-pro-mode . [(20170604 1841) ((emacs (24))) "Qt Pro/Pri major mode" single ((:commit . "7a2da323de834294b413cbbb3c92f42f54913643") (:authors ("Todd Neal" . "tolchz@gmail.com")) (:maintainer "Todd Neal" . "tolchz@gmail.com") (:keywords "extensions"))])
+ (qtcreator-theme . [(20201215 1523) ((emacs (24 3))) "A color theme that mimics Qt Creator IDE" single ((:commit . "515532b05063898459157d2ba5c10ec0d5a4b1bd") (:authors ("Lesley Lai" . "lesley@lesleylai.info")) (:maintainer "Lesley Lai" . "lesley@lesleylai.info") (:keywords "theme" "light" "faces") (:url . "https://github.com/LesleyLai/emacs-qtcreator-theme"))])
+ (quack . [(20181106 1301) nil "enhanced support for editing and running Scheme code" single ((:commit . "2146805ce2b5a9b155d73929986f11e713787e26"))])
+ (quarto-mode . [(20220405 1556) ((emacs (25 1)) (polymode (0 2 2)) (poly-markdown (0 2 2)) (markdown-mode (2 3)) (request (0 3 2))) "A (poly)mode for https://quarto.org" single ((:commit . "2a199735866dc34126a061c6f2990378b381e687") (:authors ("Carlos Scheidegger")) (:maintainer "Carlos Scheidegger") (:keywords "languages" "multi-modes") (:url . "https://github.com/quarto-dev/quarto-emacs"))])
+ (quasi-monochrome-theme . [(20200415 705) nil "Quasi Monochrome theme" tar ((:commit . "b38d71860fdea945e10e8a766ac9dfa1410ade67") (:authors ("Lorenzo Bolla" . "lbolla@gmail.com")) (:maintainer "Lorenzo Bolla" . "lbolla@gmail.com") (:keywords "color-theme" "monochrome" "high contrast") (:url . "https://github.com/lbolla/emacs-quasi-monochrome"))])
+ (quelpa . [(20211228 248) ((emacs (25 1))) "Emacs Lisp packages built directly from source" tar ((:commit . "54fc5b951f103fadba25dde38274964737815883") (:authors ("steckerhalter")) (:maintainer "steckerhalter") (:keywords "tools" "package" "management" "build" "source" "elpa") (:url . "https://github.com/quelpa/quelpa"))])
+ (quelpa-leaf . [(20210124 348) ((emacs (25 1)) (quelpa (1 0)) (leaf (4 1 0))) "Quelpa handler for leaf" single ((:commit . "e220893d29a095234076be1b255fade11f6410b8") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/quelpa/quelpa-leaf"))])
+ (quelpa-use-package . [(20201022 746) ((emacs (25 1)) (quelpa (1 0)) (use-package (2))) "quelpa handler for use-package" single ((:commit . "d985c0326b66aa19581918deccdc5edcacccf953") (:authors ("steckerhalter")) (:maintainer "steckerhalter") (:keywords "package" "management" "elpa" "use-package") (:url . "https://github.com/quelpa/quelpa-use-package"))])
+ (quick-buffer-switch . [(20201027 2307) nil "Quick switch to file or dir buffers." single ((:commit . "da82555f286588f171eed1de151325bbdd8cbd91") (:authors ("Sebastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>")) (:maintainer "Sebastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>") (:keywords "emacs" "configuration"))])
+ (quick-peek . [(20200130 2059) ((emacs (24 3))) "Inline quick-peek windows" single ((:commit . "03a276086795faad46a142454fc3e28cab058b70") (:authors ("Clément Pit-Claudel" . "clement.pitclaudel@live.com")) (:maintainer "Clément Pit-Claudel" . "clement.pitclaudel@live.com") (:keywords "tools" "help" "doc" "convenience"))])
+ (quick-preview . [(20191017 1920) nil "quick preview using GNOME sushi, gloobus or quick look" single ((:commit . "a312ab5539b9a362da9d305e4da814e17c5721c9") (:authors ("myuhe <yuhei.maeda_at_gmail.com>")) (:maintainer "myuhe") (:keywords "files" "hypermedia") (:url . "https://github.com/myuhe/quick-preview.el"))])
+ (quick-shell-keybind . [(20171023 613) ((emacs (24))) "Interactively bind a key to shell commands" single ((:commit . "5f4541a5a5554d108bf16b5fd1713e962161ca1b") (:authors ("eyeinsky" . "eyeinsky9@gmail.com")) (:maintainer "eyeinsky" . "eyeinsky9@gmail.com") (:keywords "maint" "convenience" "processes") (:url . "https://github.com/eyeinsky/quick-shell-keybind"))])
+ (quickref . [(20170817 1232) ((dash (1 0 3)) (s (1 0 0))) "Display relevant notes-to-self in the echo area" single ((:commit . "f368c8b8219bb90498c5ab84e26f00eedaa234cf") (:authors ("Kyle Hargraves")) (:maintainer "Kyle Hargraves") (:url . "https://github.com/pd/quickref.el"))])
+ (quickrun . [(20210904 1553) ((emacs (24 3))) "Run commands quickly" single ((:commit . "30e9a1333fe4a83424385df53ddaf7016df3679d") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-quickrun"))])
+ (quiet . [(20200211 721) nil "Disconnect from the online world for a while" single ((:commit . "f8a4ef0be086f97e7fb631df7060f29cc4025b98") (:authors ("nik gaffney" . "nik@fo.am")) (:maintainer "nik gaffney" . "nik@fo.am") (:keywords "convenience" "quiet" "distraction" "network" "detachment" "offline") (:url . "https://github.com/zzkt/quiet"))])
+ (quilt . [(20190828 506) ((emacs (26 0))) "Minor mode for working with files in quilt" single ((:commit . "b56a1f1acc46cdf8655710e4c8f24f5f31f22c6a") (:authors ("Matt Mackall" . "mpm@selenic.com")) (:maintainer "Jan Stranik" . "jan@stranik.org") (:keywords "extensions") (:url . "https://github.com/jstranik/emacs-quilt"))])
+ (quiz . [(20190525 1206) ((cl-lib (0 5)) (emacs (25))) "Multiple choice quiz game" single ((:commit . "570bf53926d89282cdb9653bd5aa8fe968f92bbd") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "games" "trivia" "quiz") (:url . "https://github.com/davep/quiz.el"))])
+ (r-autoyas . [(20140101 1510) ((ess (0)) (yasnippet (0 8 0))) "Provides automatically created yasnippets for R function argument lists." tar ((:commit . "b4020ee7f5f895e0065b8b26da8a49c51432d530") (:authors ("Sven Hartenstein & Matthew Fidler")) (:maintainer "Matthew Fidler") (:keywords "r" "yasnippet") (:url . "https://github.com/mlf176f2/r-autoyas.el"))])
+ (racer . [(20210307 243) ((emacs (25 1)) (rust-mode (0 2 0)) (dash (2 13 0)) (s (1 10 0)) (f (0 18 2)) (pos-tip (0 4 6))) "code completion, goto-definition and docs browsing for Rust via racer" single ((:commit . "1e63e98626737ea9b662d4a9b1ffd6842b1c648c") (:authors ("Phil Dawes")) (:maintainer "Phil Dawes") (:keywords "abbrev" "convenience" "matching" "rust" "tools") (:url . "https://github.com/racer-rust/emacs-racer"))])
+ (racket-mode . [(20220505 1350) ((emacs (25 1))) "Racket editing, REPL, and more" tar ((:commit . "fbb4a4664e2cc2b5d21eee62735f73b7f0272e60") (:authors ("Greg Hendershott")) (:maintainer "Greg Hendershott") (:url . "https://www.racket-mode.com/"))])
+ (rails-i18n . [(20220126 1643) ((emacs (27 2)) (yaml (0 1 0)) (dash (2 19 1))) "Seach and insert i18n on ruby code" single ((:commit . "8e87e4e48e31902b8259ded28a208c2e7efea6e9") (:authors ("Otávio Schwanck dos Santos" . "otavioschwanck@gmail.com")) (:maintainer "Otávio Schwanck dos Santos" . "otavioschwanck@gmail.com") (:keywords "tools" "languages") (:url . "https://github.com/otavioschwanck/rails-i18n.el"))])
+ (rails-log-mode . [(20140408 425) nil "Major mode for viewing Rails log files" single ((:commit . "ff440003ad7d47cb0ac3300f2a632f4cfd36a446") (:authors ("Anantha kumaran" . "ananthakumaran@gmail.com")) (:maintainer "Anantha kumaran" . "ananthakumaran@gmail.com") (:keywords "rails" "log"))])
+ (rails-routes . [(20220126 1631) ((emacs (27 2)) (inflections (1 1))) "Search for and insert rails routes" single ((:commit . "eab995a9297ca5bd9bd4f4c2737f2fecfc36def0") (:authors ("Otávio Schwanck" . "otavioschwanck@gmail.com")) (:maintainer "Otávio Schwanck" . "otavioschwanck@gmail.com") (:keywords "tools" "languages") (:url . "https://github.com/otavioschwanck/rails-routes"))])
+ (railscasts-reloaded-theme . [(20190308 759) nil "Railscasts Reloaded color theme" single ((:commit . "1c3850568e60a555d59cbb57bf2b6aa06e99d454") (:authors ("George Thomas" . "iamgeorgethomas@gmail.com")) (:maintainer "George Thomas" . "iamgeorgethomas@gmail.com") (:url . "https://github.com/thegeorgeous/railscasts-reloaded-theme"))])
+ (railscasts-theme . [(20150219 1525) nil "Railscasts color theme for GNU Emacs." single ((:commit . "1340c3f6c2717761cab95617cf8dcbd962b1095b") (:authors ("Oleg Shaldybin")) (:maintainer "Oleg Shaldybin") (:keywords "railscasts" "color" "theme") (:url . "https://github.com/mikenichols/railscasts-theme"))])
+ (rainbow-blocks . [(20210715 1518) nil "Block syntax highlighting for lisp code" single ((:commit . "83c4d6e77a1e25d3d2d124a4e90d5b084f3e15a5") (:authors ("istib")) (:maintainer "istib") (:url . "https://github.com/istib/rainbow-blocks"))])
+ (rainbow-delimiters . [(20210515 1254) nil "Highlight brackets according to their depth" single ((:commit . "a32b39bdfe6c61c322c37226d66e1b6d4f107ed0") (:authors ("Jeremy Rayman" . "opensource@jeremyrayman.com") ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Fanael Linithien" . "fanael4@gmail.com") (:keywords "faces" "convenience" "lisp" "tools") (:url . "https://github.com/Fanael/rainbow-delimiters"))])
+ (rainbow-fart . [(20220427 2227) ((emacs (25 1)) (flycheck (32 -4))) "Checks the keywords of code to play suitable sounds" tar ((:commit . "6504424707b6e9101dfbd9fdd4b7b963b9a4f323") (:keywords "tools") (:url . "https://repo.or.cz/emacs-rainbow-fart.git"))])
+ (rainbow-identifiers . [(20141102 1526) ((emacs (24))) "Highlight identifiers according to their names" single ((:commit . "19fbfded1baa98d12335f26f6d7b20e5ae44ce2e") (:authors ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Fanael Linithien" . "fanael4@gmail.com") (:url . "https://github.com/Fanael/rainbow-identifiers"))])
+ (rake . [(20220211 827) ((f (0 13 0)) (dash (1 5 0)) (cl-lib (0 5))) "Run rake commands" single ((:commit . "452ea0caca33376487103c64177c295ed2960cca") (:authors ("Adam Sokolnicki" . "adam.sokolnicki@gmail.com")) (:maintainer "Adam Sokolnicki" . "adam.sokolnicki@gmail.com") (:keywords "rake" "ruby") (:url . "https://github.com/asok/rake.el"))])
+ (raku-mode . [(20210927 1227) ((emacs (24 4))) "Major mode for editing Raku code" tar ((:commit . "977b14a7c1295ebf2aad2f807d3f8e7c27aeb47f") (:authors ("Hinrik Örn Sigurðsson" . "hinrik.sig@gmail.com")) (:maintainer "Hinrik Örn Sigurðsson" . "hinrik.sig@gmail.com") (:keywords "languages") (:url . "https://github.com/hinrik/perl6-mode"))])
+ (rally-mode . [(20161114 354) ((popwin (1 0 0))) "a mode to interact with the Rally Software web site." single ((:commit . "0f5e09a6abe2de7613f174b4f54863df93343134") (:authors ("Sean LeBlanc" . "seanleblanc@gmail.com")) (:maintainer "Sean LeBlanc" . "seanleblanc@gmail.com") (:keywords "rally" "ca" "agile") (:url . "https://pragcraft.wordpress.com/"))])
+ (rand-theme . [(20151219 2335) ((cl-lib (0 5))) "Random Emacs theme at start-up!" single ((:commit . "65a00e5c5150f857aa96803b68f50bc8da0215b7") (:authors ("Daniel Gopar")) (:maintainer "Daniel Gopar") (:url . "https://github.com/gopar/rand-theme"))])
+ (random-splash-image . [(20151003 130) nil "Randomly sets splash image to *GNU Emacs* buffer on startup." single ((:commit . "53a39ebfd8ac6be066a652a508a717870f94218a") (:authors ("kakakaya <kakakaya AT gmail.com>")) (:maintainer "kakakaya <kakakaya AT gmail.com>") (:keywords "games") (:url . "https://github.com/kakakaya/random-splash-image"))])
+ (ranger . [(20210125 330) ((emacs (24 4))) "Make dired more like ranger" single ((:commit . "2498519cb21dcd5791d240607a72a204d1761668") (:authors ("Rich Alesi <https://github.com/ralesi>")) (:maintainer "Rich Alesi <https://github.com/ralesi>") (:keywords "files" "convenience" "dired") (:url . "https://github.com/ralesi/ranger"))])
+ (rase . [(20120928 2045) nil "Run At Sun Event daemon" single ((:commit . "59b5f7e8102570b65040e8d55781c7ea28de7338") (:authors ("Andrey Kotlarski" . "m00naticus@gmail.com")) (:maintainer "Andrey Kotlarski" . "m00naticus@gmail.com") (:keywords "solar" "sunrise" "sunset" "midday" "midnight") (:url . "https://github.com/m00natic/rase/"))])
+ (rats . [(20170818 1013) ((s (1 10 0)) (go-mode (1 3 1)) (cl-lib (0 5))) "Rapid testing suite for Go" single ((:commit . "a6d55aebcc54f669c6c6ffedf84364c4097903cc") (:authors ("Antoine Kalmbach" . "ane@iki.fi")) (:maintainer "Antoine Kalmbach" . "ane@iki.fi") (:keywords "go"))])
+ (rbenv . [(20141120 749) nil "Emacs integration for rbenv" single ((:commit . "2ea1a5bdc1266caef1dd77700f2c8f42429b03f1") (:authors ("Yves Senn" . "yves.senn@gmail.com")) (:maintainer "Yves Senn" . "yves.senn@gmail.com") (:keywords "ruby" "rbenv") (:url . "https://github.com/senny/rbenv.el"))])
+ (rbs-mode . [(20210430 135) ((emacs (24 5))) "A major mode for RBS" single ((:commit . "fd766a943d5f1f0624e10ffce096b9aaba14a5f4") (:authors ("Masafumi Koba")) (:maintainer "Masafumi Koba") (:keywords "languages") (:url . "https://github.com/ybiquitous/rbs-mode"))])
+ (rbt . [(20170202 2302) ((popup (0 5 3)) (magit (20160128 1201))) "Integrate reviewboard with emacs." single ((:commit . "32bfba9062a014e375451cf4203c29535b5efc1e") (:authors ("Joe Heyming" . "joeheyming@gmail.com")) (:maintainer "Joe Heyming" . "joeheyming@gmail.com") (:keywords "reviewboard" "rbt"))])
+ (rbtagger . [(20211026 2318) ((emacs (25 1))) "Ruby tagging tools" tar ((:commit . "351c4006ddacc2f66e6ff8c79d981613e9a8bd22") (:authors ("Thiago Araújo" . "thiagoaraujos@gmail.com")) (:maintainer "Thiago Araújo" . "thiagoaraujos@gmail.com") (:keywords "languages" "tools") (:url . "https://www.github.com/thiagoa/rbtagger"))])
+ (rc-mode . [(20160913 1918) nil "Major mode for the Plan9 rc shell" single ((:commit . "fe2e0570bf9c19a292e16b18fd4b0a256df5d93f") (:authors ("Jordan Brown")) (:maintainer "Jordan Brown") (:keywords "rc" "plan9" "shell") (:url . "https://github.com/mrhmouse/rc-mode.el"))])
+ (rcirc-alert . [(20141127 1047) nil "Configurable alert messages on top of RCIRC" tar ((:commit . "0adf8ff9c47023fec578f678424be62b0f49057f") (:maintainer "Cayetano Santos") (:keywords "lisp" "rcirc" "irc" "alert" "awesome"))])
+ (rcirc-alertify . [(20140407 119) ((alert (20140406 1353))) "Cross platform notifications for rcirc" single ((:commit . "ea5cafc55893f375eccbe013d12dbaa94bf6e259") (:authors ("Fabián Ezequiel Gallina" . "fgallina@gnu.org")) (:maintainer "Fabián Ezequiel Gallina" . "fgallina@gnu.org") (:keywords "comm" "convenience"))])
+ (rcirc-groups . [(20170731 2101) nil "an emacs buffer in rcirc-groups major mode" single ((:commit . "b68ece9d219b909244d4e3c0d8bf6a746d6fead7") (:authors ("Dimitri Fontaine" . "dim@tapoueh.org")) (:maintainer "Dimitri Fontaine" . "dim@tapoueh.org") (:keywords "comm" "convenience") (:url . "http://tapoueh.org/emacs/rcirc-groups.html"))])
+ (rcirc-notify . [(20150219 2204) nil "libnotify popups" single ((:commit . "841a7b5a6cdb0c11a812df924d2c6a7d364fd455") (:authors ("Will Farrington, Alex Schroeder <alex@gnu.org>, Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "lisp" "rcirc" "irc" "notify" "growl"))])
+ (rcirc-styles . [(20210414 1712) ((cl-lib (0 5))) "support mIRC-style color and attribute codes" single ((:commit . "dd06ec5fa455131788bbc885fcfaaec16b08f13b"))])
+ (rdf-prefix . [(20211209 1952) nil "Prefix lookup for RDF" single ((:commit . "fa4b64bc3e0c1d5b8eed20df8d2daf0dffff2332") (:authors ("Simen Heggestøyl" . "simenheg@gmail.com")) (:maintainer "Simen Heggestøyl" . "simenheg@gmail.com") (:keywords "convenience" "abbrev") (:url . "https://github.com/simenheg/rdf-prefix"))])
+ (rdxmk . [(20170630 134) nil "A small set of tools for redox developments" tar ((:commit . "e78749fb29738365ffa4d863ffabeb969ebb0bcf") (:authors ("Jacob Salzberg" . "jsalzbergedu@yahoo.com")) (:maintainer "Jacob Salzberg" . "jsalzbergedu@yahoo.com") (:keywords "redox" "convenience" "tools") (:url . "https://github.com/jsalzbergedu/rdxmk"))])
+ (react-snippets . [(20210430 1510) ((yasnippet (0 7 0))) "Yasnippets for React" tar ((:commit . "969c21734dab638057fe9e284f6a51edcc3407c9") (:authors ("John Mastro" . "john.b.mastro@gmail.com")) (:maintainer "John Mastro" . "john.b.mastro@gmail.com") (:keywords "snippets"))])
+ (read-aloud . [(20160923 500) ((emacs (24 4))) "A simple interface to TTS engines" single ((:commit . "c662366226abfb07204ab442b4f853ed85438d8a") (:authors ("Alexander Gromnitsky" . "alexander.gromnitsky@gmail.com")) (:maintainer "Alexander Gromnitsky" . "alexander.gromnitsky@gmail.com") (:keywords "multimedia") (:url . "https://github.com/gromnitsky/read-aloud.el"))])
+ (read-only-cfg . [(20210717 205) ((emacs (24 3))) "Make files read-only based on user config" single ((:commit . "a4e50d4fbf48970e98b2464e13f46e51a4c43c37") (:authors ("pfchen" . "pfchen31@gmail.com")) (:maintainer "pfchen" . "pfchen31@gmail.com") (:keywords "tools" "convenience") (:url . "https://github.com/pfchen/read-only-cfg"))])
+ (readline-complete . [(20150708 1437) nil "offers completions in shell mode" single ((:commit . "30c020c37b2741160cc37e656e13c85d826a0ebf") (:authors ("Christopher Monsanto" . "chris@monsan.to")) (:maintainer "Christopher Monsanto" . "chris@monsan.to"))])
+ (real-auto-save . [(20200505 1537) ((emacs (24 4))) "Automatically save your buffers/files at regular intervals" single ((:commit . "481a2d1460ab5a9b6df3721dda76ad515923bfd1") (:authors ("Chaoji Li <lichaoji AT gmail DOT com>") ("Anand Reddy Pandikunta <anand21nanda AT gmail DOT com>")) (:maintainer "Chaoji Li <lichaoji AT gmail DOT com>") (:url . "https://github.com/ChillarAnand/real-auto-save"))])
+ (realgud . [(20211107 2210) ((load-relative (1 3 1)) (loc-changes (1 2)) (test-simple (1 3 0)) (emacs (25))) "A modular front-end for interacting with external debuggers" tar ((:commit . "3c88611c4ed59069093187c2a039b8d05cbe53e8") (:authors ("Rocky Bernstein" . "rocky@gnu.org")) (:maintainer "Rocky Bernstein" . "rocky@gnu.org") (:keywords "debugger" "gdb" "python" "perl" "go" "bash" "zsh" "bashdb" "zshdb" "remake" "trepan" "perldb" "pdb") (:url . "https://github.com/realgud/realgud/"))])
+ (realgud-byebug . [(20190520 1140) ((realgud (1 4 5)) (load-relative (1 2)) (cl-lib (0 5)) (emacs (24))) "Realgud front-end to the Ruby byebug debugger" tar ((:commit . "f8f20b92c6b13f75cc9797921c0e28d3def48b1c") (:authors ("Rocky Bernstein")) (:maintainer "Rocky Bernstein") (:url . "http://github.com/rocky/realgud-byebug"))])
+ (realgud-ipdb . [(20200722 1116) ((realgud (1 5 0)) (load-relative (1 3 1)) (emacs (25))) "Realgud front-end to ipdb" tar ((:commit . "f18f907aa4ddd3e59dc19ca296d4ee2dc5e436b0") (:authors ("Rocky Bernstein" . "rocky@gnu.org")) (:maintainer "Rocky Bernstein" . "rocky@gnu.org") (:url . "https://github.com/realgud/realgud-ipdb"))])
+ (realgud-jdb . [(20200722 1120) ((realgud (1 5 0)) (load-relative (1 3 1)) (emacs (25))) "Realgud front-end to Java's jdb debugger\"" tar ((:commit . "1c183b2f8aae0de60942ea01444b896bf182c66a") (:authors ("Rocky Bernstein" . "rocky@gnu.org")) (:maintainer "Rocky Bernstein" . "rocky@gnu.org") (:url . "https://github.com/realgud/realgud-jdb"))])
+ (realgud-lldb . [(20220419 2006) ((load-relative (1 3 1)) (realgud (1 5 0)) (emacs (25))) "Realgud front-end to lldb" tar ((:commit . "19a2c0a8b228af543338f3a8e51141a9e23484a5") (:authors ("Rocky Bernstein" . "rocky@gnu.org")) (:maintainer "Rocky Bernstein" . "rocky@gnu.org") (:url . "http://github.com/realgud/realgud-lldb"))])
+ (realgud-node-debug . [(20190525 1634) ((realgud (1 4 5)) (load-relative (1 2)) (cl-lib (0 5)) (emacs (25))) "Realgud front-end to older \"node debug\"" tar ((:commit . "72e786359ce9dace1796b0d81a00e9340e9c90ad") (:authors ("Rocky Bernstein" . "rocky@gnu.org")) (:maintainer "Rocky Bernstein" . "rocky@gnu.org") (:url . "http://github.com/realgud/realgud-node-debug"))])
+ (realgud-node-inspect . [(20190523 1251) ((realgud (1 4 5)) (load-relative (1 2)) (cl-lib (0 5)) (emacs (24))) "Realgud front-end to newer \"node inspect\"" tar ((:commit . "c3ed48cf3bc2b28f9fd23bcf60ea13a3cf019fc8") (:authors ("Rocky Bernstein" . "rocky@gnu.org")) (:maintainer "Rocky Bernstein" . "rocky@gnu.org") (:url . "http://github.com/realgud/realgud-node-inspect"))])
+ (realgud-old-debuggers . [(20190520 1150) ((realgud (1 4 5)) (load-relative (1 2)) (cl-lib (0 5)) (emacs (24))) "Realgud front-end to older lesser-used debuggers" tar ((:commit . "0fad38283e885c452160232e01adf3f6ae51983b") (:authors ("Rocky Bernstein")) (:maintainer "Rocky Bernstein") (:url . "http://github.com/rocky/realgud-old-debuggers"))])
+ (realgud-pry . [(20201011 1815) ((realgud (1 4 5)) (load-relative (1 2)) (cl-lib (0 5)) (emacs (25))) "Realgud front-end to the Ruby pry debugger" tar ((:commit . "264ca6811b0bef5de4decc54acfeacf0bce2f51f") (:authors ("Rocky Bernstein")) (:maintainer "Rocky Bernstein") (:url . "http://github.com/rocky/realgud-pry"))])
+ (realgud-rdb2 . [(20190520 1146) ((realgud (1 4 5)) (load-relative (1 2)) (cl-lib (0 5)) (emacs (24))) "Realgud front-end for interacting with Ruby debugger2" tar ((:commit . "3594aa74f7afda3c3251bb2af7fe0e8ec6d621ae") (:authors ("Rocky Bernstein")) (:maintainer "Rocky Bernstein") (:url . "http://github.com/rocky/realgud-ruby-debugger2"))])
+ (realgud-trepan-ni . [(20210513 2237) ((load-relative (1 2)) (realgud (1 5 0)) (emacs (25))) "Realgud front-end to trepan-ni" tar ((:commit . "0ec088ea343835e24ae73da09bea96bfb02a3130") (:authors ("Rocky Bernstein" . "rocky@gnu.org")) (:maintainer "Rocky Bernstein" . "rocky@gnu.org") (:url . "https://github.com/realgud/realgud-trepan-ni"))])
+ (reaper . [(20220426 2048) ((emacs (26 2))) "Interact with Harvest time tracking app" single ((:commit . "2cfe54e9f5470415ab5f59d3c0829bfce41525ad") (:authors ("Thomas Fini Hansen" . "xen@xen.dk")) (:maintainer "Thomas Fini Hansen" . "xen@xen.dk") (:keywords "tools") (:url . "https://github.com/xendk/reaper"))])
+ (reason-mode . [(20200929 1606) ((emacs (24 3))) "A major mode for editing ReasonML" tar ((:commit . "5690544a7091630e0ea0023bbbd57a733cea8bde") (:authors ("Mozilla")) (:maintainer "Mozilla") (:keywords "languages" "ocaml") (:url . "https://github.com/reasonml-editor/reason-mode"))])
+ (reazon . [(20211229 1733) ((emacs (26))) "miniKanren for Emacs" tar ((:commit . "f31c8b2e911c5885551d063c0a2b5de49a646eb1") (:authors ("Nick Drozd" . "nicholasdrozd@gmail.com")) (:maintainer "Nick Drozd" . "nicholasdrozd@gmail.com") (:keywords "languages" "extensions" "lisp") (:url . "https://github.com/nickdrozd/reazon"))])
+ (rebecca-theme . [(20180324 821) ((emacs (24))) "Rebecca Purple Theme" single ((:commit . "4b8b5aae9099185e07c2b4cac4943c7f66a3f003") (:authors ("vic" . "vborja@apache.org")) (:maintainer "vic" . "vborja@apache.org") (:keywords "theme" "dark") (:url . "https://github.com/vic/rebecca-theme"))])
+ (rebox2 . [(20121113 1300) nil "Handling of comment boxes in various styles." single ((:commit . "00634eca420cc48657b81e40e599ff8548083985") (:authors ("François Pinard") ("Le Wang")) (:maintainer "Le Wang (lewang.emacs!!!gmayo.com remove exclamations, correct host, hint: google mail)") (:url . "https://github.com/lewang/rebox2"))])
+ (recentf-ext . [(20170926 35) nil "Recentf extensions" single ((:commit . "450de5f8544ed6414e88d4924d7daa5caa55b7fe") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "convenience" "files") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/recentf-ext.el"))])
+ (recentf-remove-sudo-tramp-prefix . [(20210509 43) ((emacs (24 4))) "Normalise recentf history" single ((:commit . "c462344739867f35d39c8794c358b4c4b5af7dcc") (:authors ("ncaq" . "ncaq@ncaq.net")) (:maintainer "ncaq" . "ncaq@ncaq.net") (:url . "https://github.com/ncaq/recentf-remove-sudo-tramp-prefix"))])
+ (recently . [(20210930 159) ((cl-lib (0 5)) (emacs (24))) "Track recently opened files to visit them again" single ((:commit . "94b31f6bf1dab6af942948fec975e37424938a62") (:authors ("10sr <8.slashes [at] gmail [dot] com>")) (:maintainer "10sr <8.slashes [at] gmail [dot] com>") (:keywords "utility" "files") (:url . "https://github.com/10sr/recently-el"))])
+ (recompile-on-save . [(20151126 1446) ((dash (1 1 0)) (cl-lib (0 5))) "Trigger recompilation on file save." single ((:commit . "92e11446869d878803d4f3dec5d2101380c12bb2") (:authors ("Marian Schubert" . "marian.schubert@gmail.com")) (:maintainer "Marian Schubert" . "marian.schubert@gmail.com") (:keywords "convenience" "files" "processes" "tools") (:url . "https://github.com/maio/recompile-on-save.el"))])
+ (recomplete . [(20220507 1118) ((emacs (26 1))) "Immediately (re)complete actions" single ((:commit . "021ca9b047caadd4903aa6f417890d6497ae437a") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://codeberg.com/ideasman42/emacs-recomplete"))])
+ (recover-buffers . [(20171009 437) nil "revisit all buffers from an auto-save file" tar ((:commit . "81a5cb53099955ebc2a411a44cba5a394ee3f2d1") (:authors ("era eriksson <http://www.iki.fi/era>")) (:maintainer "era eriksson <http://www.iki.fi/era>"))])
+ (rect+ . [(20150621 44) nil "Extensions to rect.el" single ((:commit . "299b742faa0bc4448e0d5fe9cb98ab1eb93b8dcc") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "extensions" "data" "tools") (:url . "https://github.com/mhayashi1120/Emacs-rectplus"))])
+ (rectangle-utils . [(20190411 1757) ((emacs (24)) (cl-lib (0 5))) "Some useful rectangle functions." single ((:commit . "46f7e73340fee40c1ab9a4e766a08ae3fce83ebe") (:authors ("Thierry Volpiatto" . "thierry.volpiatto@gmail.com")) (:maintainer "Thierry Volpiatto" . "thierry.volpiatto@gmail.com") (:url . "https://github.com/thierryvolpiatto/rectangle-utils"))])
+ (recur . [(20211108 219) ((emacs (24 3))) "Tail call optimization" single ((:commit . "627d88f2695336245527fcc77f5728575ecf742b") (:authors ("ROCKTAKEY" . "rocktakey@gmail.com")) (:maintainer "ROCKTAKEY" . "rocktakey@gmail.com") (:keywords "lisp") (:url . "https://github.com/ROCKTAKEY/recur"))])
+ (recursion-indicator . [(20220403 1812) ((emacs (27 1))) "Recursion indicator" single ((:commit . "63d946c5cb11b81184151f1385efed325f6cac2d") (:authors ("Daniel Mendler")) (:maintainer "Daniel Mendler") (:url . "https://github.com/minad/recursion-indicator"))])
+ (recursive-narrow . [(20190306 1521) nil "narrow-to-region that operates recursively" single ((:commit . "5e3e2067d5a148d7e64e64e0355d3b6860e4c259") (:authors ("Nathaniel Flath" . "flat0103@gmail.com")) (:maintainer "Nathaniel Flath" . "flat0103@gmail.com") (:url . "http://github.com/nflath/recursive-narrow"))])
+ (redacted . [(20220108 1037) ((emacs (25 1))) "Obscure text in buffer" single ((:commit . "c4ea6cbffda9c67af112f25b2db2843aa4abce85") (:authors ("Benjamin Kästner" . "benjamin.kaestner@gmail.com")) (:maintainer "Benjamin Kästner" . "benjamin.kaestner@gmail.com") (:keywords "games") (:url . "https://github.com/bkaestner/redacted.el"))])
+ (reddigg . [(20220312 1339) ((emacs (26 3)) (promise (1 1)) (ht (2 3)) (request (0 3 0)) (org (9 2))) "A reader for redditt" single ((:commit . "911a1c6310b42226392fd03dc1746a4c6fc4eb95") (:authors ("Thanh Vuong" . "thanhvg@gmail.com")) (:maintainer "Thanh Vuong" . "thanhvg@gmail.com") (:url . "https://github.com/thanhvg/emacs-reddigg"))])
+ (redis . [(20220429 1758) ((emacs (24)) (cl-lib (0 5))) "Redis integration" single ((:commit . "a6ad30d6a43b7be083c13f8725b45571d623001a") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "convenience") (:url . "https://github.com/emacs-pe/redis.el"))])
+ (redpen-paragraph . [(20160625 1050) ((emacs (24)) (cl-lib (0 5)) (json (1 4))) "RedPen interface." single ((:commit . "0062f326106ce8be3c9b7d3fa0e88ed2c7bbfa5e") (:authors ("karronoli")) (:maintainer "karronoli") (:keywords "document" "proofreading" "help") (:url . "https://github.com/karronoli/redpen-paragraph.el"))])
+ (redprl . [(20180418 1434) ((emacs (24 3))) "Major mode for editing RedPRL proofs and interacting with RedPRL" single ((:commit . "c72190de76f7ed1cfbe1d2046c96e99ac5022b0c") (:authors ("Jonathan Sterling" . "jon@jonmsterling.com")) (:maintainer "Jonathan Sterling" . "jon@jonmsterling.com") (:keywords "languages"))])
+ (redshank . [(20180730 407) ((paredit (21))) "Common Lisp Editing Extensions" tar ((:commit . "d059c5841044aa163664f8bf87c1d981bf0a04fe") (:authors ("Michael Weber" . "michaelw@foldr.org")) (:maintainer "Michael Weber" . "michaelw@foldr.org") (:keywords "languages" "lisp"))])
+ (redtick . [(20180424 2136) ((emacs (24 4))) "Smallest pomodoro timer (1 char)" tar ((:commit . "94b4cd43ac20c64dcac96edac2c1a3b9fcc59bb9") (:authors ("F. Febles")) (:maintainer "F. Febles") (:keywords "calendar") (:url . "http://github.com/ferfebles/redtick"))])
+ (redtt . [(20181121 21) ((emacs (25 3))) "Major mode for editing redtt proofs" single ((:commit . "ae76658873a647eb43d8cf84365a9d68e9a3273c") (:authors ("Jonathan Sterling" . "jon@jonmsterling.com")) (:maintainer "Jonathan Sterling" . "jon@jonmsterling.com") (:keywords "languages") (:url . "http://github.com/RedPRL/redtt"))])
+ (refine . [(20200507 731) ((emacs (24 3)) (s (1 11 0)) (dash (2 12 0)) (list-utils (0 4 4)) (loop (1 2))) "interactive value editing" single ((:commit . "d72fa50910b86217a35bb1b7e56adea206052021") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:keywords "convenience"))])
+ (reformatter . [(20210831 1405) ((emacs (24 3))) "Define commands which run reformatters on the current buffer" single ((:commit . "452a99b556ebf1953f92fe3e16c20d10d1fed466") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "convenience" "tools") (:url . "https://github.com/purcell/emacs-reformatter"))])
+ (regex-dsl . [(20220125 506) nil "lisp syntax for regexps" single ((:commit . "8802555ecdab8b50bb64181798497c10cdb5034b") (:authors ("Aliaksey Kandratsenka" . "alk@tut.by")) (:maintainer "Aliaksey Kandratsenka" . "alk@tut.by"))])
+ (regex-tool . [(20170104 1918) nil "A regular expression evaluation tool for programmers" single ((:commit . "0b4a0111143c88ef94bec56624cb2e00c1a054e6") (:authors ("John Wiegley" . "johnw@newartisans.com")) (:maintainer "John Wiegley" . "johnw@newartisans.com") (:keywords "regex" "languages" "programming" "development") (:url . "http://www.newartisans.com/"))])
+ (region-bindings-mode . [(20140407 2214) nil "Enable custom bindings when mark is active." single ((:commit . "3fa5dbdbd7c000bebff6d9d14a4be326ec24b6fc") (:authors ("Fabián E. Gallina" . "fabian@anue.biz")) (:maintainer "Fabián E. Gallina" . "fabian@anue.biz") (:keywords "convenience") (:url . "https://github.com/fgallina/region-bindings-mode"))])
+ (region-convert . [(20210519 1655) ((emacs (24 3))) "Convert string in region by Lisp function" single ((:commit . "cb3ab0417d7b74e5edd34bf23a70737fc7bf1d3a") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "region" "convenience") (:url . "https://github.com/zonuexe/right-click-context"))])
+ (region-occurrences-highlighter . [(20200815 1555) ((emacs (24))) "Mark occurrences of current region (selection)." single ((:commit . "07e2201db7a88b246a63e868e711749e1465d3d6") (:authors ("Álvaro González Sotillo" . "alvarogonzalezsotillo@gmail.com")) (:maintainer "Álvaro González Sotillo" . "alvarogonzalezsotillo@gmail.com") (:keywords "convenience") (:url . "https://github.com/alvarogonzalezsotillo/region-occurrences-highlighter"))])
+ (region-state . [(20181205 1746) nil "Show the number of chars/lines or rows/columns in the region" single ((:commit . "8c636b655eef45e0015684699737d31e15450000") (:authors ("Chunyang Xu" . "mail@xuchunyang.me")) (:maintainer "Chunyang Xu" . "mail@xuchunyang.me") (:keywords "convenience") (:url . "https://github.com/xuchunyang/region-state.el"))])
+ (register-channel . [(20210120 1618) nil "Jump around fast using registers" single ((:commit . "ed7f563e92170b758dc878fcb5df88d46d5d44cc") (:authors ("Yang Zhao" . "YangZhao11@users.noreply.github.com")) (:maintainer "Yang Zhao" . "YangZhao11@users.noreply.github.com") (:keywords "convenience"))])
+ (register-quicknav . [(20200524 2006) ((emacs (25 3))) "Quickly jump to next/previous register" single ((:commit . "c15ea92b0946c28b3f14986d42b15b0b534aa6a2") (:authors ("tastytea" . "tastytea@tastytea.de")) (:maintainer "tastytea" . "tastytea@tastytea.de") (:keywords "convenience") (:url . "https://schlomp.space/tastytea/register-quicknav"))])
+ (rego-mode . [(20201102 1420) ((emacs (24 4)) (reformatter (0 3))) "A major mode for rego language" single ((:commit . "be110e6cef5d34eef0529a8739c68e619cf15310") (:authors ("Sibi Prabakaran" . "sibi@psibi.in")) (:maintainer "Sibi Prabakaran" . "sibi@psibi.in") (:keywords "languages") (:url . "https://github.com/psibi/rego-mode"))])
+ (related . [(20190327 1024) ((cl-lib (0 5))) "Switch back and forth between similarly named buffers." single ((:commit . "546c7e811b290470288b617f2c27106bd83ccd33") (:authors ("Julien Montmartin")) (:maintainer "Julien Montmartin") (:keywords "file" "buffer" "switch" "selection" "matching" "convenience") (:url . "https://github.com/julien-montmartin/related"))])
+ (remark-mode . [(20210504 1238) ((emacs (25 1)) (markdown-mode (2 0))) "Major mode for the remark slideshow tool" tar ((:commit . "9f15285445fdb53e720ffe72f5cf05231d340906") (:authors ("@torgeir")) (:maintainer "@torgeir") (:keywords "remark" "slideshow" "markdown" "hot reload"))])
+ (remember-last-theme . [(20170619 2133) ((emacs (24 4))) "Remember the last used theme between sessions." single ((:commit . "0973f1aa6b96355fa376fffe8b45733b6e963c51") (:authors ("Anler Hernández Peral" . "inbox+emacs@anler.me")) (:maintainer "Anler Hernández Peral" . "inbox+emacs@anler.me") (:keywords "convenience" "faces") (:url . "https://github.com/anler/remember-last-theme"))])
+ (remind-bindings . [(20200820 1723) ((emacs (25 1)) (omni-quotes (0 5)) (popwin (1 0)) (map (2 0))) "Reminders for your init bindings" single ((:commit . "c9a327bfd3c68a0c41b5b64df491bdee4c73ca39") (:authors ("Mehmet Tekman")) (:maintainer "Mehmet Tekman") (:keywords "outlines") (:url . "https://github.com/mtekman/remind-bindings.el"))])
+ (renpy . [(20200607 135) nil "silly walks for Renpy" single ((:commit . "f2f95a72a8c842f229f80999132e8ea8ee73f6fc") (:authors ("PyTom" . "pytom@bishoujo.us")) (:maintainer "Dave Love" . "fx@gnu.org") (:keywords "languages") (:url . "https://github.com/billywade/renpy-mode"))])
+ (repeatable-motion . [(20170620 1848) ((emacs (24))) "Make repeatable versions of motions" tar ((:commit . "f29effdc4121c2dc7e3fec9b3a62debce29cda9d") (:authors ("William Hatch" . "willghatch@gmail.com")) (:maintainer "William Hatch" . "willghatch@gmail.com") (:keywords "motion" "repeatable") (:url . "https://github.com/willghatch/emacs-repeatable-motion"))])
+ (repeater . [(20180418 1212) ((emacs (24 4))) "Repeat recent repeated commands" single ((:commit . "854b874542b186b2408cbc58ad0591fe8eb70b6c") (:authors ("Xu Chunyang" . "mail@xuchunyang.me")) (:maintainer "Xu Chunyang" . "mail@xuchunyang.me") (:keywords "convenience") (:url . "https://github.com/xuchunyang/repeater"))])
+ (repl-toggle . [(20210226 1055) ((fullframe (0 0 5))) "Switch to/from repl buffer for current major-mode" single ((:commit . "7028ae65f136215f8e07a43afc33a6b99fe82857") (:authors ("Tom Regner" . "tom@goochesa.de")) (:maintainer "Tom Regner" . "tom@goochesa.de") (:keywords "repl" "buffers" "toggle"))])
+ (replace-from-region . [(20170227 2316) nil "Replace commands whose query is from region" single ((:commit . "dc9318b9b2822da7b00ecc34d1dc965c8f96c9bb") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "replace" "search" "region") (:url . "http://www.emacswiki.org/emacs/download/replace-from-region.el"))])
+ (replace-pairs . [(20160207 1251) ((emacs (24 4))) "Query-replace pairs of things" single ((:commit . "acfb254dddffcee4250092fab9394ef2b42ffbc0") (:authors ("David Shepherd" . "davidshepherd7@gmail.com")) (:maintainer "David Shepherd" . "davidshepherd7@gmail.com") (:url . "https://github.com/davidshepherd7/replace-pairs"))])
+ (replace-symbol . [(20160518 12) nil "Rename symbols in expressions or buffers" single ((:commit . "baf949e528aee1881f455f9c84e67718bedcb3f6") (:authors ("Brian Mastenbrook" . "brian@mastenbrook.net")) (:maintainer "Brian Mastenbrook" . "brian@mastenbrook.net") (:url . "https://github.com/bmastenbrook/replace-symbol-el"))])
+ (replace-with-inflections . [(20180831 635) ((cl-lib (0 5)) (string-inflection (1 0 10)) (inflections (1 1))) "Inflection aware `query-replace'" single ((:commit . "d9201e047856492f282da65459b28aba25998dbb") (:authors ("Akinori MUSHA" . "knu@iDaemons.org")) (:maintainer "Akinori MUSHA" . "knu@iDaemons.org") (:keywords "matching") (:url . "https://github.com/knu/replace-with-inflections.el"))])
+ (repo . [(20191201 38) ((emacs (24 3))) "Running repo from Emacs" single ((:commit . "7b3ce731f1209d74113cb65a2d6aa6f54ce8ed27") (:authors ("Damien Merenne")) (:maintainer "Damien Merenne") (:keywords "convenience") (:url . "https://github.com/canatella/repo-el"))])
+ (req-package . [(20180605 1141) ((use-package (1 0)) (dash (2 7 0)) (log4e (0 2 0)) (ht (0))) "A use-package wrapper for package runtime dependencies management" tar ((:commit . "a77da72931914ac5f3f64dc61fe9dc3522b2817e") (:authors ("Edward Knyshov" . "edvorg@gmail.com")) (:maintainer "Edward Knyshov" . "edvorg@gmail.com") (:keywords "dotemacs" "startup" "speed" "config" "package") (:url . "https://github.com/edvorg/req-package"))])
+ (request . [(20211107 1907) ((emacs (24 4))) "Compatible layer for URL request" single ((:commit . "c769cf33f2ac0a1a9798b508935c4b260e856ab5") (:authors ("Takafumi Arakaki <aka.tkf at gmail.com>")) (:maintainer "Takafumi Arakaki <aka.tkf at gmail.com>") (:url . "https://github.com/tkf/emacs-request"))])
+ (request-deferred . [(20210214 37) ((emacs (24 1)) (deferred (0 3 1)) (request (0 3))) "Wrap request.el by deferred" single ((:commit . "c769cf33f2ac0a1a9798b508935c4b260e856ab5") (:authors ("Takafumi Arakaki <aka.tkf at gmail.com>")) (:maintainer "Takafumi Arakaki <aka.tkf at gmail.com>") (:url . "https://github.com/tkf/emacs-request"))])
+ (requirejs . [(20151204 719) ((js2-mode (20150713)) (popup (0 5 3)) (s (1 9 0)) (cl-lib (0 5)) (yasnippet (20151011 1823))) "Requirejs import manipulation and source traversal." tar ((:commit . "4ea2a5fcbc76e4cbb6a7461e6f05f019b75865b1") (:authors ("Joe Heyming" . "joeheyming@gmail.com")) (:maintainer "Joe Heyming" . "joeheyming@gmail.com") (:keywords "javascript" "requirejs") (:url . "https://github.com/joeheyming/requirejs-emacs"))])
+ (requirejs-mode . [(20130215 2104) nil "Improved AMD module management" single ((:commit . "bbb0c09f8eb2d6a33c17319be8137f68bb16bc92") (:authors ("Marc-Olivier Ricard" . "marco.ricard@gmail.com")) (:maintainer "Marc-Olivier Ricard" . "marco.ricard@gmail.com") (:keywords "javascript" "amd" "requirejs"))])
+ (rescript-mode . [(20210902 2140) ((emacs (26 1))) "A major mode for editing ReScript" tar ((:commit . "350d717f5c2564817179c4b6b1c615b10fd062e8") (:authors ("Karl Landstrom" . "karl.landstrom@brgeight.se") ("Daniel Colascione" . "dancol@dancol.org") ("John Lee" . "jjl@pobox.com")) (:maintainer "John Lee" . "jjl@pobox.com") (:keywords "languages" "rescript") (:url . "https://github.com/jjlee/rescript-mode"))])
+ (resize-window . [(20180918 538) ((emacs (24)) (cl-lib (0 5))) "easily resize windows" single ((:commit . "72018aa4d2401b60120588199d4cedd0dc1fbcfb") (:authors ("Dan Sutton " . "danielsutton01@gmail.com")) (:maintainer "Dan Sutton " . "danielsutton01@gmail.com") (:keywords "window" "resize") (:url . "https://github.com/dpsutton/resize-mode"))])
+ (restart-emacs . [(20201127 1425) nil "Restart emacs from within emacs" single ((:commit . "1607da2bc657fe05ae01f7fdf26f716eafead02c") (:authors ("Iqbal Ansari" . "iqbalansari02@yahoo.com")) (:maintainer "Iqbal Ansari" . "iqbalansari02@yahoo.com") (:keywords "convenience") (:url . "https://github.com/iqbalansari/restart-emacs"))])
+ (restclient . [(20220101 1239) nil "An interactive HTTP client for Emacs" single ((:commit . "ae79e7dd283890072da69b8f48aeec1afd0d9442") (:authors ("Pavel Kurnosov" . "pashky@gmail.com")) (:maintainer "Pavel Kurnosov" . "pashky@gmail.com") (:keywords "http"))])
+ (restclient-helm . [(20170314 1554) ((restclient (0)) (helm (1 9 4))) "helm interface for restclient.el" single ((:commit . "ae79e7dd283890072da69b8f48aeec1afd0d9442") (:authors ("Pavel Kurnosov" . "pashky@gmail.com")) (:maintainer "Pavel Kurnosov" . "pashky@gmail.com") (:keywords "http" "helm"))])
+ (restclient-jq . [(20220426 1734) ((restclient (20200502 831)) (jq-mode (0 4 1)) (emacs (24 4))) "Support for setting restclient vars from jq expressions" single ((:commit . "ae79e7dd283890072da69b8f48aeec1afd0d9442") (:authors ("Cameron Dorrat" . "cdorrat@gmail.com")) (:maintainer "Cameron Dorrat" . "cdorrat@gmail.com") (:keywords "tools" "comm" "http" "jq") (:url . "https://github.com/pashky/restclient.el"))])
+ (restclient-test . [(20210422 1815) ((emacs (26 1)) (restclient (0))) "Run tests with restclient.el" single ((:commit . "3c6661d087526510a04ea9de421c5869a1a1d061") (:authors ("Simen Heggestøyl" . "simenheg@runbox.com")) (:maintainer "Simen Heggestøyl" . "simenheg@runbox.com") (:url . "https://github.com/simenheg/restclient-test.el"))])
+ (retrie . [(20200519 551) ((emacs (24 5))) "Refactoring Haskell code with retrie" single ((:commit . "976d6f01a3e214917f16b82e750d825cb9bfcc59") (:authors ("Junyoung Clare Jang" . "jjc9310@gmail.com")) (:maintainer "Junyoung Clare Jang" . "jjc9310@gmail.com") (:keywords "files" "languages" "tools") (:url . "https://github.com/Ailrun/emacs-retrie"))])
+ (revbufs . [(20200907 2223) nil "Reverts all out-of-date buffers safely" single ((:commit . "df3c02d3063951582c693ae12547993cec8256e2") (:authors ("Neil Van Dyke" . "neil@neilvandyke.org")) (:maintainer "Sam Kleinman" . "sam@tychoish.com") (:keywords "convenience" "buffers") (:url . "http://www.neilvandyke.org/revbufs/"))])
+ (reveal-in-folder . [(20220110 1821) ((emacs (24 3)) (f (0 20 0)) (s (1 12 0))) "Reveal current file in folder" single ((:commit . "dd72004f6f7b0d554dbd979f22a31c350e211089") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/reveal-in-folder"))])
+ (reveal-in-osx-finder . [(20150802 1657) nil "Reveal file associated with buffer in OS X Finder" single ((:commit . "5710e5936e47139a610ec9a06899f72e77ddc7bc") (:authors ("Kazuki YOSHIDA")) (:maintainer "Kazuki YOSHIDA") (:keywords "os x" "finder") (:url . "https://github.com/kaz-yos/reveal-in-osx-finder"))])
+ (reverse-im . [(20220309 1919) ((emacs (25 1)) (seq (2 23))) "Reverse mapping for non-default system layouts" single ((:commit . "50b8376f152916bc200635a112db9439bc3cc9b5") (:keywords "i18n") (:url . "https://github.com/a13/reverse-im.el"))])
+ (reverse-theme . [(20141205 145) nil "Reverse theme for Emacs" single ((:commit . "8319d0d5342890a3530ffa4daafdb7c35feda1ca") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-reverse-theme"))])
+ (revert-buffer-all . [(20220509 1045) ((emacs (24 3))) "Revert all open buffers" single ((:commit . "91d0f4f7a0c0c3015887f4ed808537ebebd6385e") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://codeberg.com/ideasman42/emacs-buffer-revert-all"))])
+ (review-mode . [(20220215 842) nil "major mode for ReVIEW" single ((:commit . "f08ef20d9ff4f03a00a8c24dae9ce416da0d9d1c") (:authors ("Kenshi Muto" . "kmuto@kmuto.jp")) (:maintainer "Kenshi Muto" . "kmuto@kmuto.jp") (:url . "https://github.com/kmuto/review-el"))])
+ (reykjavik-theme . [(20201219 947) ((emacs (24))) "Theme with a dark background." single ((:commit . "f6d8e83946633603234cd1dac725e17447f40bce") (:authors ("martin haesler")) (:maintainer "martin haesler"))])
+ (rfc-mode . [(20210615 1721) ((emacs (25 1))) "RFC document browser and viewer" single ((:commit . "3ef663203b157e7c5b2cd3c425ec8fbe7977a24c") (:authors ("Nicolas Martyanoff" . "khaelin@gmail.com")) (:maintainer "Nicolas Martyanoff" . "khaelin@gmail.com") (:url . "https://github.com/galdor/rfc-mode"))])
+ (rg . [(20220427 1613) ((emacs (25 1)) (transient (0 3 0)) (wgrep (2 1 10))) "A search tool based on ripgrep" tar ((:commit . "a6411f98a695d8b3ef0db156d41b2a62ca36ee7a") (:authors ("David Landell" . "david.landell@sunnyhill.email") ("Roland McGrath" . "roland@gnu.org")) (:maintainer "David Landell" . "david.landell@sunnyhill.email") (:keywords "matching" "tools") (:url . "https://github.com/dajva/rg.el"))])
+ (rhq . [(20220329 1027) ((emacs (24 4))) "Client for rhq" single ((:commit . "46a3108436cc4a2c5343b010f2086088d7b9682b") (:authors ("ROCKTAKEY" . "rocktakey@gmail.com")) (:maintainer "ROCKTAKEY" . "rocktakey@gmail.com") (:keywords "tools" "extensions") (:url . "https://github.com/ROCKTAKEY/rhq"))])
+ (rhtml-mode . [(20130422 1311) nil "major mode for editing RHTML files" tar ((:commit . "a6d71b38a3db867ccf82999c99805db1a3a33c33"))])
+ (rib-mode . [(20170726 1448) ((emacs (24))) "RenderMan® Interface Bytestream (RIB) Major Mode" single ((:commit . "97470158784c3c212e22e2c20b8471ee65ba59af") (:authors ("Remik Ziemlinski and Daniel Blezek" . "daniel.blezek@gmail.com")) (:maintainer "Remik Ziemlinski and Daniel Blezek" . "daniel.blezek@gmail.com") (:url . "https://github.com/blezek/rib-mode"))])
+ (rich-minority . [(20190419 1136) ((cl-lib (0 5))) "Clean-up and Beautify the list of minor-modes." single ((:commit . "a03e693f6f9232cf75363aaaf1cb041f21675c19") (:authors ("Artur Malabarba" . "emacs@endlessparentheses.com")) (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com") (:keywords "mode-line" "faces") (:url . "https://github.com/Malabarba/rich-minority"))])
+ (right-click-context . [(20210519 1713) ((emacs (24 3)) (popup (0 5)) (ordinal (0 0 1))) "Right Click Context menu" single ((:commit . "c3c9d36ffbc9fb2bc7c2c4b75291dbcdb1c5f531") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "mouse" "menu" "rightclick") (:url . "https://github.com/zonuexe/right-click-context"))])
+ (rigid-tabs . [(20220416 2123) ((emacs (24 3))) "Fix TAB alignment in diff buffers" single ((:commit . "872a10c8751574c9610cba1800f541a6eda24997") (:authors ("Yuri D'Elia" . "wavexx@thregr.org")) (:maintainer "Yuri D'Elia" . "wavexx@thregr.org") (:keywords "diff" "whitespace" "version control" "magit") (:url . "https://gitlab.com/wavexx/rigid-tabs.el"))])
+ (rii . [(20210317 1330) ((emacs (24 3))) "Reversible input interface for multiple input" single ((:commit . "d0cc3599129db735c23abe74d0876286a2fd6b6a") (:authors ("ROCKTAKEY" . "rocktakey@gmail.com")) (:maintainer "ROCKTAKEY" . "rocktakey@gmail.com") (:keywords "extensions" "tools") (:url . "https://github.com/ROCKTAKEY/rii"))])
+ (rime . [(20220421 1811) ((emacs (26 3)) (dash (2 17 0)) (cl-lib (0 6 1)) (popup (0 5 3)) (posframe (0 1 0))) "Rime input method" tar ((:commit . "e6a89e9fa9eabc32063bffb2eacfcece46f7a049") (:authors ("Shi Tianshu")) (:maintainer "Shi Tianshu") (:keywords "convenience" "input-method") (:url . "https://www.github.com/DogLooksGood/emacs-rime"))])
+ (rimero-theme . [(20180901 1348) ((emacs (24))) "Theme with a dark background suitable for UI and terminal usage." single ((:commit . "a2e706c2b34f749019979a133f08a2d94a1104b3") (:authors ("Yves Zoundi" . "yveszoundi@users.sf.net")) (:maintainer "Yves Zoundi" . "yveszoundi@users.sf.net") (:keywords "faces" "theme" "dark" "light colors") (:url . "https://github.com/yveszoundi/emacs-rimero-theme"))])
+ (rinari . [(20150709 640) ((ruby-mode (1 0)) (inf-ruby (2 2 5)) (ruby-compilation (0 16)) (jump (2 0))) "Rinari Is Not A Rails IDE" single ((:commit . "134438af8fbdfa9c8077267c768d273a9792b484") (:authors ("Phil Hagelberg, Eric Schulte, Steve Purcell")) (:maintainer "Phil Hagelberg, Eric Schulte, Steve Purcell") (:keywords "ruby" "rails" "project" "convenience" "web") (:url . "https://github.com/eschulte/rinari"))])
+ (rings . [(20160531 2027) nil "Buffer rings. Like tabs, but better." single ((:commit . "3590b222eb80652cbd27866f066bd3571d86edfc") (:authors ("Konrad Scorciapino")) (:maintainer "Konrad Scorciapino") (:keywords "utilities" "productivity") (:url . "http://github.com/konr/rings"))])
+ (ripgrep . [(20220309 1746) nil "Front-end for ripgrep, a command line search tool" single ((:commit . "4ed5c741233a81d96115f556784269042070901e") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "ripgrep" "ack" "pt" "ag" "sift" "grep" "search") (:url . "https://github.com/nlamirault/ripgrep.el"))])
+ (riscv-mode . [(20170804 1521) ((emacs (24 4))) "Major-mode for RISC V assembly" single ((:commit . "99febf97d1fa9441e8dada94fe30c2aa439c9749") (:authors ("Adam Niederer <https://github.com/AdamNiederer>")) (:maintainer "Adam Niederer") (:keywords "riscv" "assembly") (:url . "https://github.com/AdamNiederer/riscv-mode"))])
+ (rivet-mode . [(20201013 1905) ((emacs (24)) (web-mode (16))) "A minor mode for editing Apache Rivet files" single ((:commit . "3dd4fc28f29e4d4f43a881ed5816dea41a912419") (:authors ("Jade Michael Thornton")) (:maintainer "Jade Michael Thornton") (:url . "https://gitlab.com/thornjad/rivet-mode"))])
+ (rjsx-mode . [(20200120 1446) ((emacs (24 4)) (js2-mode (20170504))) "Real support for JSX" single ((:commit . "b697fe4d92cc84fa99a7bcb476f815935ea0d919") (:authors ("Felipe Ochoa" . "felipe@fov.space")) (:maintainer "Felipe Ochoa" . "felipe@fov.space") (:keywords "languages") (:url . "https://github.com/felipeochoa/rjsx-mode/"))])
+ (rmsbolt . [(20220503 1708) ((emacs (25 1))) "A compiler output viewer" tar ((:commit . "de28f7903a3b895c3bf9628ac6d4db4378748fa8") (:authors ("Jay Kamat" . "jaygkamat@gmail.com")) (:maintainer "Jay Kamat" . "jaygkamat@gmail.com") (:keywords "compilation" "tools") (:url . "http://gitlab.com/jgkamat/rmsbolt"))])
+ (robe . [(20211208 205) ((inf-ruby (2 5 1)) (emacs (25 1))) "Code navigation, documentation lookup and completion for Ruby" tar ((:commit . "11207bd549a5a78e3a4d70265c3715990dcdab71") (:authors ("Dmitry Gutov")) (:maintainer "Dmitry Gutov") (:keywords "ruby" "convenience" "rails") (:url . "https://github.com/dgutov/robe"))])
+ (robot-mode . [(20210425 1925) ((emacs (26 1))) "Major-mode for Robot Framework files" single ((:commit . "e7e9c4d4750d048ad771fa735621ad813fa9c128") (:authors ("Kalle Kankare" . "kalle.kankare@iki.fi")) (:maintainer "Kalle Kankare" . "kalle.kankare@iki.fi") (:keywords "languages" "files") (:url . "https://github.com/kopoli/robot-mode"))])
+ (robots-txt-mode . [(20190812 1858) nil "Major mode for editing robots.txt" single ((:commit . "0d79161dfece3920600ad155ab1cc1a59da06964") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "languages" "comm" "web") (:url . "https://github.com/emacs-php/robots-txt-mode"))])
+ (roguel-ike . [(20160120 302) ((popup (0 5 0))) "A coffee-break roguelike" tar ((:commit . "706dcb0687e8016d7d776f9d9e5ace9fdbbca43c") (:authors ("Steven Rémot")) (:maintainer "Steven Rémot"))])
+ (ron-mode . [(20200830 1554) ((emacs (24 5 1))) "Rusty Object Notation mode" single ((:commit . "c5e0454b9916d6b73adc15dab8abbb0b0a68ea22") (:authors ("Daniel Hutzley" . "endergeryt@gmail.com")) (:maintainer "Daniel Hutzley" . "endergeryt@gmail.com") (:keywords "languages") (:url . "https://chiselapp.com/user/Hutzdog/repository/ron-mode/home"))])
+ (rope-read-mode . [(20211228 1126) ((emacs (24))) "Rearrange lines to read text smoothly" single ((:commit . "6aad44e006a2999980c138f608d28c8ecab92b35") (:authors ("Marco Wahl" . "marcowahlsoft@gmail.com")) (:maintainer "Marco Wahl" . "marcowahlsoft@gmail.com") (:keywords "reading" "convenience" "chill") (:url . "https://gitlab.com/marcowahl/rope-read-mode"))])
+ (ros . [(20220314 2026) ((emacs (25 1))) "Package to write code for ROS systems" single ((:commit . "5e2bcd808f301b1a92cd583f2799d520bd802480") (:authors ("Max Beutelspacher <https://github.com/mtb>")) (:maintainer "Max Beutelspacher" . "max@beutelspacher.eu") (:keywords "convenience" "tools") (:url . "https://github.com/DerBeutlin/ros.el"))])
+ (rotate . [(20210126 637) nil "Rotate the layout of emacs" single ((:commit . "4e9ac3ff800880bd9b705794ef0f7c99d72900a6") (:authors ("daichi.hirata <hirata.daichi at gmail.com>")) (:maintainer "daichi.hirata <hirata.daichi at gmail.com>") (:keywords "window" "layout") (:url . "https://github.com/daichirata/emacs-rotate"))])
+ (roy-mode . [(20121208 1158) nil "Roy major mode" single ((:commit . "0416f561edbc6b4a29fced8be84d2527a9613d65") (:authors ("Georgii Leontiev")) (:maintainer "Georgii Leontiev") (:keywords "extensions") (:url . "https://github.com/folone/roy-mode"))])
+ (rpm-spec-mode . [(20160710 1136) nil "RPM spec file editing commands for Emacs/XEmacs" single ((:commit . "c1c38050c48ea330c7cea632b8785d66daeefb2b") (:authors ("Stig Bjørlykke," . "stig@bjorlykke.org")) (:maintainer "Stig Bjørlykke," . "stig@bjorlykke.org") (:keywords "unix" "languages"))])
+ (rpn-calc . [(20210306 426) ((popup (0 4))) "quick RPN calculator for hackers" single ((:commit . "320123ede874a8fc6cde542baa0d106950318071") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "https://github.com/zk-phi/rpn-calc"))])
+ (rspec-mode . [(20220401 306) ((ruby-mode (1 0)) (cl-lib (0 4))) "Enhance ruby-mode for RSpec" tar ((:commit . "a54ac64097b6ccc6acc52a8b077ceb63766fc4d1") (:authors ("Peter Williams, et al.")) (:maintainer "Peter Williams, et al.") (:keywords "rspec" "ruby") (:url . "http://github.com/pezra/rspec-mode"))])
+ (rsync-mode . [(20210911 0) ((emacs (27 1)) (spinner (1 7 1))) "Rsync projects to remote machines" single ((:commit . "2bc76aa8c2d82bb08ef70e23813a653d66bf3195") (:authors ("Ryan Pilgrim" . "ryan.z.pilgrim@gmail.com")) (:maintainer "Ryan Pilgrim" . "ryan.z.pilgrim@gmail.com") (:keywords "comm") (:url . "https://github.com/r-zip/rsync-mode.el"))])
+ (rtags . [(20210313 1541) ((emacs (24 3))) "A front-end for rtags" single ((:commit . "db39790fda5c2443bc790b8971ac140914f7e9c2") (:authors ("Jan Erik Hanssen" . "jhanssen@gmail.com") ("Anders Bakken" . "agbakken@gmail.com")) (:maintainer "Jan Erik Hanssen" . "jhanssen@gmail.com") (:url . "https://github.com/Andersbakken/rtags"))])
+ (rtags-xref . [(20210721 2314) ((emacs (25 1)) (rtags (2 37))) "RTags backend for xref.el" single ((:commit . "db39790fda5c2443bc790b8971ac140914f7e9c2") (:authors ("Jörg Walter")) (:maintainer "RTags Team") (:url . "https://github.com/Andersbakken/rtags"))])
+ (rtm . [(20180329 1508) ((cl-lib (1 0))) "An elisp implementation of the Remember The Milk API" single ((:commit . "3e3d09387cb84801343ecca8fb02e82f213e7bbe") (:authors ("Friedrich Delgado Friedrichs" . "frie...@nomaden.org")) (:maintainer "Friedrich Delgado Friedrichs" . "frie...@nomaden.org") (:keywords "remember" "the" "milk" "productivity" "todo") (:url . "https://github.com/pmiddend/emacs-rtm"))])
+ (rubik . [(20180222 2014) ((cl-lib (1 0)) (emacs (25 3))) "Rubik's Cube" single ((:commit . "c8dab1726463dbc9042a0b00186e4a8df02eb868") (:authors ("Ivan 'Kurvivor' Truskov" . "trus19@gmail.com")) (:maintainer "Ivan 'Kurvivor' Truskov" . "trus19@gmail.com") (:keywords "games") (:url . "https://github.com/Kurvivor19/rubik-mode"))])
+ (rubocop . [(20210309 1241) ((emacs (24))) "An Emacs interface for RuboCop" single ((:commit . "f5fd18aa810c3d3269188cbbd731ddc09006f8f5") (:authors ("Bozhidar Batsov")) (:maintainer "Bozhidar Batsov") (:keywords "project" "convenience") (:url . "https://github.com/rubocop/rubocop-emacs"))])
+ (rubocopfmt . [(20200713 1144) ((cl-lib (0 5))) "Minor-mode to format Ruby code with RuboCop on save" single ((:commit . "b84810105940aa5e0bde20c9a89359c95c9b6917") (:authors ("Jim Myhrberg")) (:maintainer "Jim Myhrberg") (:keywords "convenience" "wp" "edit" "ruby" "rubocop") (:url . "https://github.com/jimeh/rubocopfmt.el"))])
+ (ruby-compilation . [(20150709 640) ((inf-ruby (2 2 1))) "run a ruby process in a compilation buffer" single ((:commit . "134438af8fbdfa9c8077267c768d273a9792b484") (:authors ("Eric Schulte")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "test" "convenience") (:url . "https://github.com/eschulte/rinari"))])
+ (ruby-electric . [(20200328 1528) nil "Minor mode for electrically editing ruby code" single ((:commit . "f2323cd9b5df3b34aa9810ba8109502824925d23") (:maintainer "Akinori MUSHA" . "knu@iDaemons.org") (:keywords "languages" "ruby") (:url . "https://github.com/ruby/elisp-ruby-electric"))])
+ (ruby-end . [(20141215 1223) nil "Automatic insertion of end blocks for Ruby" single ((:commit . "a136f75abb6d5577ce40d61dfeb778c2e9bb09c0") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "speed" "convenience" "ruby") (:url . "http://github.com/rejeep/ruby-end"))])
+ (ruby-extra-highlight . [(20171106 1933) nil "Highlight Ruby parameters." single ((:commit . "83942d18eae361998d24c1c523b308eea821f048") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "languages" "faces") (:url . "https://github.com/Lindydancer/ruby-extra-highlight"))])
+ (ruby-factory . [(20160102 721) ((inflections (1 1))) "Minor mode for Ruby test object generation libraries" tar ((:commit . "2bb7ccc2fccb5257376a989aa395bc7b9eb1d55d") (:authors ("Skye Shaw" . "skye.shaw@gmail.com")) (:maintainer "Skye Shaw" . "skye.shaw@gmail.com") (:keywords "ruby" "rails" "convenience") (:url . "http://github.com/sshaw/ruby-factory-mode"))])
+ (ruby-hash-syntax . [(20210106 224) ((emacs (24 1))) "Toggle ruby hash syntax between => and 1.9+ styles" single ((:commit . "d458fb5891e0da85271b1cba3ee0ee69ea66a374") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "languages") (:url . "https://github.com/purcell/ruby-hash-syntax"))])
+ (ruby-interpolation . [(20131112 1652) nil "Ruby string interpolation helpers" single ((:commit . "1978e337601222cedf00e117bf4b5cac15d1f203") (:authors ("Arthur Leonard Andersen" . "leoc.git@gmail.com")) (:maintainer "Arthur Leonard Andersen" . "leoc.git@gmail.com") (:url . "http://github.com/leoc/ruby-interpolation.el"))])
+ (ruby-json-to-hash . [(20211108 351) ((emacs (27 2)) (smartparens (1 11 0)) (string-inflection (1 0 16))) "Convert JSON to Hash and play with the keys" single ((:commit . "383b22bb2e007289ac0dba146787d02ff99d4415") (:authors ("Otávio Schwanck dos Santos" . "otavioschwanck@gmail.com")) (:maintainer "Otávio Schwanck dos Santos" . "otavioschwanck@gmail.com") (:keywords "tools" "languages") (:url . "https://github.com/otavioschwanck/ruby-json-to-hash.el"))])
+ (ruby-refactor . [(20160214 1650) ((ruby-mode (1 2))) "A minor mode which presents various Ruby refactoring helpers." single ((:commit . "e6b7125878a08518bffec6942df0c606f748e9ee") (:keywords "refactor" "ruby") (:url . "https://github.com/ajvargo/ruby-refactor"))])
+ (ruby-test-mode . [(20210205 1107) ((ruby-mode (1 0)) (pcre2el (1 8))) "Minor mode for Behaviour and Test Driven" single ((:commit . "d66db4aca6e6a246f65f7195ecfbc7581d35fb7a") (:authors ("Roman Scherer" . "roman.scherer@gmx.de") ("Caspar Florian Ebeling" . "florian.ebeling@gmail.com")) (:maintainer "Roman Scherer" . "roman.scherer@burningswell.com") (:keywords "ruby" "unit" "test" "rspec" "tools") (:url . "https://github.com/ruby-test-mode/ruby-test-mode"))])
+ (ruby-tools . [(20151209 1615) nil "Collection of handy functions for ruby-mode." tar ((:commit . "6b97066b58a4f82eb2ecea6434a0a7e981aa4c18") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "speed" "convenience" "ruby") (:url . "http://github.com/rejeep/ruby-tools"))])
+ (rufo . [(20170718 1416) ((emacs (24 3))) "use rufo to automatically format ruby files" single ((:commit . "020b02ed6e9ab49e79d2ddf63e4ee2684c1728f4") (:authors ("Daniel Ma" . "danielhgma@gmail.com")) (:maintainer "Daniel Ma" . "danielhgma@gmail.com") (:url . "https://github.com/danielma/rufo.el"))])
+ (ruled-switch-buffer . [(20211205 635) ((emacs (24 3))) "Rule based buffer switching" single ((:commit . "4ae1a722750f7ecb4db93c062ffdbe353e706bf0") (:authors ("Kazuki Nishikawa" . "kzkn@hey.com")) (:maintainer "Kazuki Nishikawa" . "kzkn@hey.com") (:keywords "convenience") (:url . "https://github.com/kzkn/ruled-switch-buffer"))])
+ (rum-mode . [(20180127 22) ((emacs (24))) "Major mode for Rum programming language" single ((:commit . "b69a3866e0299cae8c9c805d644e69b2c17b64de") (:keywords "rum" "languages" "lisp") (:url . "https://github.com/rumlang/rum-mode"))])
+ (run-command . [(20210529 1505) ((emacs (27 1))) "Run an external command from a context-dependent list" single ((:commit . "ce2d69feeffb9ef9815ef5b5e32f236763197a10") (:authors ("Massimiliano Mirra" . "hyperstruct@gmail.com")) (:maintainer "Massimiliano Mirra" . "hyperstruct@gmail.com") (:keywords "processes") (:url . "https://github.com/bard/emacs-run-command"))])
+ (run-command-recipes . [(20220301 2010) ((emacs (25 1)) (dash (2 18 0)) (f (0 20 0)) (run-command (0 1 0)) (s (1 12 0))) "This is collection of recipes to `run-command'" tar ((:commit . "02a4d366e309b7dd6a45f8a94669a25d6fe80ea1") (:authors ("semenInRussia" . "hrams205@gmail.com")) (:maintainer "semenInRussia" . "hrams205@gmail.com") (:keywords "extensions" "run-command") (:url . "https://github.com/semenInRussia/emacs-run-command-recipes"))])
+ (run-stuff . [(20220507 1118) ((emacs (25 1))) "Context based command execution" single ((:commit . "0aeabc7ef3f2a209c0c69300f6d61921ec448ffc") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:keywords "files" "lisp" "files" "convenience" "hypermedia") (:url . "https://codeberg.com/ideasman42/emacs-run-stuff"))])
+ (runner . [(20160524 743) nil "Improved \"open with\" suggestions for dired" single ((:commit . "a211d57ddc600410d07a8b534920ba905b093d87") (:authors ("Thamer Mahmoud" . "thamer.mahmoud@gmail.com")) (:maintainer "Thamer Mahmoud" . "thamer.mahmoud@gmail.com") (:keywords "shell command" "dired" "file extension" "open with") (:url . "https://github.com/thamer/runner"))])
+ (runtests . [(20150807 831) nil "Run unit tests from Emacs" single ((:commit . "ed90249f24cc48290018df48b9b9b7172440be3e") (:authors ("Sune Simonsen" . "sune@we-knowhow.dk")) (:maintainer "Sune Simonsen" . "sune@we-knowhow.dk") (:keywords "test") (:url . "https://github.com/sunesimonsen/emacs-runtests"))])
+ (russian-holidays . [(20170109 2140) nil "Russian holidays for the calendar" single ((:commit . "b285a30f29d85c48e3ea4eb93972d34a090c167b") (:authors ("Alexander I.Grafov" . "siberian@laika.name")) (:maintainer "Alexander I.Grafov" . "siberian@laika.name") (:url . "https://github.com/grafov/russian-holidays"))])
+ (rust-auto-use . [(20200608 1359) nil "Utility to automatically insert Rust use statements" single ((:commit . "d5205f7b9b9eae0f7d0893f87d3391464719f9c0") (:authors ("Rotem Yaari" . "rotemy@MBP.local")) (:maintainer "Rotem Yaari" . "rotemy@MBP.local") (:keywords "languages"))])
+ (rust-mode . [(20220217 2009) ((emacs (25 1))) "A major-mode for editing Rust source code" tar ((:commit . "d17be3051b22a06d7742178cd1367aed61807a66") (:authors ("Mozilla")) (:maintainer "Mozilla") (:keywords "languages") (:url . "https://github.com/rust-lang/rust-mode"))])
+ (rust-playground . [(20200116 1043) ((emacs (24 3))) "Local Rust playground for short code snippets." single ((:commit . "5a117781dcb66065bea7830dd73618008fc34949") (:authors ("Alexander I.Grafov" . "grafov@gmail.com")) (:maintainer "Alexander I.Grafov" . "grafov@gmail.com") (:keywords "tools" "rust") (:url . "https://github.com/grafov/rust-playground"))])
+ (rustic . [(20220509 716) ((emacs (26 1)) (rust-mode (1 0 3)) (dash (2 13 0)) (f (0 18 2)) (let-alist (1 0 4)) (markdown-mode (2 3)) (project (0 3 0)) (s (1 10 0)) (seq (2 3)) (spinner (1 7 3)) (xterm-color (1 6))) "Rust development environment" tar ((:commit . "3b379fc25b7a097a014147d9c8b83ec1a418cd76") (:authors ("Mozilla")) (:maintainer "Mozilla") (:keywords "languages"))])
+ (rutils . [(20210805 608) ((emacs (26 1)) (ess (18 10 1)) (transient (0 3 0))) "R utilities with transient" tar ((:commit . "e216db63a2ccd50fe5c80679fc5b929dd2c114e8") (:authors ("Shuguang Sun" . "shuguang79@qq.com")) (:maintainer "Shuguang Sun" . "shuguang79@qq.com") (:keywords "convenience") (:url . "https://github.com/ShuguangSun/rutils.el"))])
+ (rvm . [(20201222 17) nil "Emacs integration for rvm" single ((:commit . "c1f2642434b0f68d9baa0687127079ecd884ba12") (:authors ("Yves Senn" . "yves.senn@gmx.ch")) (:maintainer "Yves Senn" . "yves.senn@gmx.ch") (:keywords "ruby" "rvm") (:url . "http://www.emacswiki.org/emacs/RvmEl"))])
+ (ryo-modal . [(20220103 940) ((emacs (25 1))) "Roll your own modal mode" single ((:commit . "0a61eed4d2917422d6401b6abe2037c26dab658a") (:authors ("Erik Sjöstrand" . "sjostrand.erik@gmail.com")) (:maintainer "Erik Sjöstrand" . "sjostrand.erik@gmail.com") (:keywords "convenience" "modal" "keys") (:url . "http://github.com/Kungsgeten/ryo-modal"))])
+ (s . [(20210616 619) nil "The long lost Emacs string manipulation library." single ((:commit . "08661efb075d1c6b4fa812184c1e5e90c08795a9") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "strings"))])
+ (s-buffer . [(20130605 2124) ((s (1 6 0)) (noflet (0 0 3))) "s operations for buffers" single ((:commit . "f95d234282377f00a2c3a9846681080cb95bb1df") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "lisp") (:url . "http://github.com/nicferrier/emacs-s-buffer"))])
+ (s12cpuv2-mode . [(20171013 2051) ((emacs (24 3))) "Major-mode for S12CPUV2 assembly" single ((:commit . "b17d4cf848dec1e20e66458e5c7ff77a2c051a8c") (:authors ("Adam Niederer" . "adam.niederer@gmail.com")) (:maintainer "Adam Niederer" . "adam.niederer@gmail.com") (:keywords "s12cpuv2" "assembly" "languages") (:url . "https://github.com/AdamNiederer/s12cpuv2-mode"))])
+ (s3ed . [(20200929 1317) ((emacs (25 1)) (dash (2 17 0)) (s (1 12 0))) "Tramp-like access to s3" tar ((:commit . "2234444ead6c4c6fc3fea548958b36d2c29a9938") (:authors ("Matt Usifer" . "mattusifer@gmail.com")) (:maintainer "Matt Usifer" . "mattusifer@gmail.com") (:keywords "s3" "tools") (:url . "https://github.com/mattusifer/s3ed"))])
+ (sackspace . [(20130719 956) nil "A better backspace" single ((:commit . "fd0480eaaf6d3d11fd30ac5feb2da2f4f7572708") (:authors ("Michael Markert" . "markert.michael@googlemail.com")) (:maintainer "Michael Markert" . "markert.michael@googlemail.com") (:keywords "delete" "convenience") (:url . "http://github.com/cofi/sackspace.el"))])
+ (sage-shell-mode . [(20201225 1011) ((cl-lib (0 6 1)) (emacs (24 4)) (let-alist (1 0 5)) (deferred (0 5 1))) "A front-end for Sage Math" tar ((:commit . "7fc47d5eab0efac009d5a9316e3dfa223595ab5a") (:authors ("Sho Takemori" . "stakemorii@gmail.com")) (:maintainer "Sho Takemori" . "stakemorii@gmail.com") (:keywords "sage" "math") (:url . "https://github.com/sagemath/sage-shell-mode"))])
+ (sailfish-scratchbox . [(20171202 1332) nil "Sailfish OS scratchbox inside the emacs." single ((:commit . "65c6b04abadd2cdeb4cc2dc2a8b96b06e0f27ed8") (:authors ("V. V. Polevoy" . "fx@thefx.co")) (:maintainer "V. V. Polevoy" . "fx@thefx.co") (:keywords "sb2" "mb2" "building" "scratchbox" "sailfish") (:url . "https://github.com/vityafx/sailfish-scratchbox.el"))])
+ (salesforce-utils . [(20160814 154) ((cl-lib (0 5))) "simple utilities for Salesforce" single ((:commit . "73328baf0fb94ac0d0de645a8f6d42e5ae27f773") (:authors ("Sean McAfee")) (:maintainer "Sean McAfee") (:url . "https://github.com/grimnebulin/emacs-salesforce"))])
+ (salt-mode . [(20200210 1200) ((emacs (24 4)) (yaml-mode (0 0 12)) (mmm-mode (0 5 4)) (mmm-jinja2 (0 1))) "Major mode for Salt States" single ((:commit . "c46b24e7fdf4a46df5507dc9c533bbc0064a46fa") (:authors ("Ben Hayden" . "hayden767@gmail.com")) (:maintainer "Glynn Forrest" . "me@glynnforrest.com") (:keywords "languages") (:url . "https://github.com/glynnforrest/salt-mode"))])
+ (sane-term . [(20181130 101) ((emacs (24 1))) "Multi Term is crazy. This is not." single ((:commit . "369178c2dd0348250c2ec0019567688376c637f7") (:authors ("Adam Patterson" . "adam@adamrt.com")) (:maintainer "Adam Patterson" . "adam@adamrt.com") (:url . "http://github.com/adamrt/sane-term"))])
+ (sass-mode . [(20190502 53) ((haml-mode (3 0 15)) (cl-lib (0 5))) "Major mode for editing Sass files" single ((:commit . "247a0d4b509f10b28e4687cd8763492bca03599b") (:authors ("Natalie Weizenbaum")) (:maintainer "Natalie Weizenbaum") (:keywords "markup" "language" "css") (:url . "http://github.com/nex3/haml/tree/master"))])
+ (sauron . [(20201015 836) nil "Track (erc/org/dbus/...) events and react to them." tar ((:commit . "5daade4836da5b1b2ab26d84128d6c38328a5d52") (:authors ("Dirk-Jan C. Binnema" . "djcb@djcbsoftware.nl")) (:maintainer "Dirk-Jan C. Binnema" . "djcb@djcbsoftware.nl") (:keywords "comm" "frames"))])
+ (save-load-path . [(20140206 1214) nil "save load-path and reuse it to test" single ((:commit . "6cb763a37e2b8af505bff2bcd11fd49c9ea04d66") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "lisp") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/save-load-path.el"))])
+ (save-visited-files . [(20200212 414) nil "save opened files across sessions" single ((:commit . "8203a05a322324ec17b14437c8dfb38efdb53241") (:authors ("Nathaniel Flath" . "nflath@gmail.com")) (:maintainer "Nathaniel Flath" . "nflath@gmail.com") (:url . "http://github.com/nflath/save-visited-files"))])
+ (savekill . [(20140418 229) nil "Save kill ring to disk" single ((:commit . "67fc94e3d8fe8ce3ca16f90518f6a46479b63e34") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "tools") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/savekill.el"))])
+ (saveplace-pdf-view . [(20210217 1312) ((emacs (24 1))) "Save place in pdf-view buffers" single ((:commit . "54ed966b842501c3c092dbf57b372e37b033c578") (:authors ("Nicolai Singh <nicolaisingh at pm.me>")) (:maintainer "Nicolai Singh <nicolaisingh at pm.me>") (:keywords "files" "convenience") (:url . "https://github.com/nicolaisingh/saveplace-pdf-view"))])
+ (say-what-im-doing . [(20160706 1931) nil "dictate what you're doing with text to speech" single ((:commit . "5b2ce6783b02805bcac1107a149bfba3852cd9d5") (:authors ("Benaiah Mischenko")) (:maintainer "Benaiah Mischenko") (:keywords "text to speech" "dumb" "funny") (:url . "http://github.com/benaiah/say-what-im-doing"))])
+ (sayid . [(20220101 1357) ((cider (0 21 0))) "sayid nREPL middleware client" single ((:commit . "879aff586336a0ec4d46c0ed4720fb1de22082bd") (:authors ("Bill Piel" . "bill@billpiel.com")) (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev") (:keywords "clojure" "cider" "debugger") (:url . "https://github.com/clojure-emacs/sayid"))])
+ (sbt-mode . [(20211203 1148) ((emacs (24 4))) "Interactive support for sbt projects" tar ((:commit . "9fe1e8807c22cc1dc56a6233e000969518907f4d") (:keywords "languages") (:url . "https://github.com/hvesalai/emacs-sbt-mode"))])
+ (scad-mode . [(20200830 301) nil "A major mode for editing OpenSCAD code" single ((:commit . "b929e705e76e8ff47d170c5e9849f86002f3e09f") (:authors ("Len Trigg, Łukasz Stelmach")) (:maintainer "Len Trigg" . "lenbok@gmail.com") (:keywords "languages") (:url . "https://raw.github.com/openscad/openscad/master/contrib/scad-mode.el"))])
+ (scad-preview . [(20211212 1128) ((scad-mode (91 0)) (emacs (24 4))) "Preview SCAD models in real-time within Emacs" single ((:commit . "c5449b26c63f3e0a695905a7e4e84f8d844f761b") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "https://zk-phi.github.io/"))])
+ (scala-mode . [(20210414 1126) nil "Major mode for editing Scala" tar ((:commit . "598cb680f321d9609295aa9b4679040cc703b602") (:keywords "languages") (:url . "https://github.com/hvesalai/emacs-scala-mode"))])
+ (scf-mode . [(20151122 248) nil "shorten file-names in compilation type buffers" single ((:commit . "dbfcdcd89034f208d65e181af58e0d73ad09f8b2") (:authors ("Le Wang")) (:maintainer "Le Wang") (:keywords "compilation") (:url . "https://github.com/lewang/scf-mode"))])
+ (scheme-complete . [(20201112 442) nil "Smart auto completion for Scheme in Emacs" single ((:commit . "b9a1448c4696f117d9ea4e59b6162dc31112e71a") (:authors ("Alex Shinn")) (:maintainer "Alex Shinn"))])
+ (scholar-import . [(20220504 1101) ((emacs (26 1)) (org (9 0)) (request (0 3 0)) (s (1 10 0))) "Import Bibtex & PDF from Google Scholar" single ((:commit . "cd0b42e5026426af2bfad57b692760bcb5d05dbb") (:authors ("Anh T Nguyen <https://github.com/teeann>")) (:maintainer "Anh T Nguyen <https://github.com/teeann>") (:url . "https://github.com/teeann/scholar-import"))])
+ (schrute . [(20170521 1840) ((emacs (24 3))) "Help you remember there is a better way to do something." single ((:commit . "59faa6c4232ae183cea93237301acad8c0763997") (:authors ("Jorge Araya Navarro" . "elcorreo@deshackra.com")) (:maintainer "Jorge Araya Navarro" . "elcorreo@deshackra.com") (:keywords "convenience") (:url . "https://bitbucket.org/shackra/dwight-k.-schrute"))])
+ (scihub . [(20220423 421) ((emacs (27 1))) "Sci-Hub integration" single ((:commit . "57333c849bcd4953663cbf7c271e9f3a62179765") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "convenience") (:url . "https://github.com/emacs-pe/scihub.el"))])
+ (scion . [(20130315 1255) nil "Haskell Minor Mode for Interacting with the Scion Library" single ((:commit . "99b4589175665687181a932cd836850205625f71") (:url . "https://code.google.com/p/scion-lib/"))])
+ (sclang-extensions . [(20160509 338) ((auto-complete (1 4 0)) (s (1 3 1)) (dash (1 2 0)) (emacs (24 1))) "Extensions for the SuperCollider Emacs mode." tar ((:commit . "e9cc79732f16fdb582129303110c163dcc0d6da0") (:authors ("Chris Barrett" . "chris.d.barrett@me.com")) (:maintainer "Chris Barrett" . "chris.d.barrett@me.com") (:keywords "sclang" "supercollider" "languages" "tools"))])
+ (sclang-snippets . [(20130513 751) ((yasnippet (0 8 0))) "Snippets for the SuperCollider Emacs mode" tar ((:commit . "c840a416b96f83bdd70491e3d1fbe2f1ae8b3f58") (:authors ("ptrv" . "mail@petervasil.net")) (:maintainer "ptrv" . "mail@petervasil.net") (:keywords "snippets"))])
+ (scpaste . [(20210223 1902) ((htmlize (1 39))) "Paste to the web via scp." single ((:commit . "4ec352fb9fe261ffb8b78449dea986dc34d337b3") (:authors ("Phil Hagelberg")) (:maintainer "Phil Hagelberg") (:keywords "convenience" "hypermedia") (:url . "https://git.sr.ht/~technomancy/scpaste"))])
+ (scratch . [(20220319 1705) ((emacs (25 1))) "Mode-specific scratch buffers" single ((:commit . "f000648c9663833a76a8de9b1e78c99a9d698e48") (:authors ("Ian Eure" . "ian.eure@gmail.com")) (:maintainer "Ian Eure" . "ian.eure@gmail.com") (:keywords "convenience" "tools" "files") (:url . "https://github.com/ieure/scratch-el"))])
+ (scratch-comment . [(20200812 1025) ((emacs (26 1))) "Insert Elisp result as comment in scratch buffer" single ((:commit . "cf3e967b4def1308b6ef1cfeedd2cf15ee6e226c") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "convenience") (:url . "https://github.com/conao3/scratch-comment.el"))])
+ (scratch-ext . [(20140104 516) nil "Extensions for *scratch*" single ((:commit . "388c53cddd0466b451264894667ed64a6947ad67") (:authors ("Kouhei Yanagita" . "yanagi@shakenbu.org")) (:maintainer "Kouhei Yanagita" . "yanagi@shakenbu.org") (:url . "https://github.com/kyanagi/scratch-ext-el"))])
+ (scratch-log . [(20141115 743) nil "Utility for *scratch* buffer." single ((:commit . "1168f7f16d36ca0f4ddf2bb98881f8db62cc5dc0") (:authors ("kmori" . "morihenotegami@gmail.com")) (:maintainer "kmori" . "morihenotegami@gmail.com"))])
+ (scratch-message . [(20211221 1527) nil "Changing message in your scratch buffer" single ((:commit . "efb2db33e52e5d4a4f1bafbd8b459a3b91c3c87a") (:authors ("Sylvain Rousseau <thisirs at gmail dot com>")) (:maintainer "Sylvain Rousseau <thisirs at gmail dot com>") (:keywords "util" "scratch") (:url . "https://github.com/thisirs/scratch-message.git"))])
+ (scratch-palette . [(20210306 427) ((popwin (0 7 0 -3))) "make scratch buffer for each files" single ((:commit . "e4642ed8a2b744ba48a8e11ca83861f8e4b9c5b3") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://zk-phi.gitub.io/"))])
+ (scratch-pop . [(20200910 226) nil "Generate, popup (& optionally backup) scratch buffer(s)." single ((:commit . "cbe842fd78e4b742ece9fc493ebf43e69d872866") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://hins11.yu-yake.com/"))])
+ (scratches . [(20151006 416) ((dash (2 11 0)) (f (0 17 0))) "Multiple scratches in any language" single ((:commit . "9441afe6396ca38f08029123fab5d87429cbf315") (:authors ("Zhang Kai Yu" . "yeannylam@gmail.com")) (:maintainer "Zhang Kai Yu" . "yeannylam@gmail.com") (:keywords "scratch"))])
+ (scribble-mode . [(20190912 200) ((emacs (24))) "Major mode for editing Scribble documents" single ((:commit . "5c3ea3cc9bbad585476eee41ea76dc056c2012bb") (:authors ("Mario Rodas" . "marsam@users.noreply.github.com")) (:maintainer "Mario Rodas" . "marsam@users.noreply.github.com") (:keywords "convenience") (:url . "https://github.com/emacs-pe/scribble-mode"))])
+ (scroll-on-drag . [(20220507 1118) ((emacs (26 2))) "Interactive scrolling" single ((:commit . "fb9af984610f7ef83b031ff04efa32dbdf2eb741") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://codeberg.com/ideasman42/emacs-scroll-on-drag"))])
+ (scroll-on-jump . [(20220509 1046) ((emacs (26 2))) "Scroll when jumping to a new point" single ((:commit . "8fde237ae6d6a54730445b399513bc6d31d7daba") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://codeberg.com/ideasman42/emacs-scroll-on-jump"))])
+ (scrollable-quick-peek . [(20201224 329) ((quick-peek (1 0)) (emacs (24 4))) "Display scrollable overlays" single ((:commit . "3e3492145a61831661d6e97fdcb47b5b66c73287") (:authors ("Pablo Barrantes" . "xjpablobrx@gmail.com")) (:maintainer "Pablo Barrantes" . "xjpablobrx@gmail.com") (:keywords "convenience" "extensions" "help" "tools") (:url . "https://github.com/jpablobr/scrollable-quick-peek"))])
+ (scrollkeeper . [(20190109 629) ((emacs (25 1))) "Custom scrolling commands with visual guidelines" single ((:commit . "3c4ac6b6b44686d31c260ee0b19daaee59bdccd6") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "convenience") (:url . "https://github.com/alphapapa/scrollkeeper.el"))])
+ (scrooge . [(20180630 1022) ((emacs (24)) (cl-lib (0 5)) (dash (2 13 0)) (thrift (0 9 3))) "Major mode for Twitter Scrooge files" single ((:commit . "0a8c58e9e6708abe4ef7e415bc1e0472318bb1b0") (:authors ("Daniel McClanahan" . "danieldmcclanahan@gmail.com")) (:maintainer "Daniel McClanahan" . "danieldmcclanahan@gmail.com") (:keywords "scrooge" "thrift"))])
+ (scss-mode . [(20180123 1708) nil "Major mode for editing SCSS files" single ((:commit . "cf58dbec5394280503eb5502938f3b5445d1b53d") (:authors ("Anton Johansson" . "anton.johansson@gmail.com")) (:maintainer "Anton Johansson" . "anton.johansson@gmail.com") (:keywords "scss" "css" "mode") (:url . "https://github.com/antonj/scss-mode"))])
+ (sculpture-themes . [(20220406 2330) ((emacs (26 1))) "Themes with vivid colors" tar ((:commit . "a21871b75cc7cb575ceb43640d039307fbb412e1") (:authors ("t-e-r-m" . "newenewen@tutanota.com")) (:maintainer "t-e-r-m" . "newenewen@tutanota.com") (:url . "https://github.com/t-e-r-m/sculpture-theme"))])
+ (sdcv . [(20220210 1412) ((emacs (24 3)) (popup (0 5 3)) (showtip (0 1)) (pos-tip (0 4 6)) (cl-lib (0 3))) "Interface for sdcv (StartDict console version)." single ((:commit . "98e239c7380c63282845d5bc55ea6d605f5a33b8") (:authors ("Andy Stewart" . "lazycat.manatee@gmail.com")) (:maintainer "Andy Stewart" . "lazycat.manatee@gmail.com") (:keywords "startdict" "sdcv") (:url . "https://repo.or.cz/sdcv.el.git"))])
+ (sdlang-mode . [(20161201 711) ((emacs (24 3))) "Major mode for Simple Declarative Language files." single ((:commit . "7fdcf4ead88d451c0a4a6425b2e730818eaf610e") (:authors ("Vladimir Panteleev")) (:maintainer "Vladimir Panteleev") (:keywords "languages") (:url . "https://github.com/CyberShadow/sdlang-mode"))])
+ (search-web . [(20150312 1103) nil "Post web search queries using `browse-url'." single ((:commit . "c4ae86ac1acfc572b81f3d78764bd9a54034c331") (:authors ("Tomoya Otake" . "tomoya.ton@gmail.com")) (:maintainer "Tomoya Otake" . "tomoya.ton@gmail.com"))])
+ (searcher . [(20210124 1524) ((emacs (25 1)) (dash (2 10)) (f (0 20 0))) "Searcher in pure elisp" single ((:commit . "26ecae6a6d028fcbffc576a69ef8f787646bc12a") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/searcher"))])
+ (searchq . [(20150829 1211) ((emacs (24 3))) "Framework of queued search tasks using GREP, ACK, AG and more." tar ((:commit . "dd510d55ad66a82c6ef022cfe7c4a73ad5365f82") (:authors ("boyw165")) (:maintainer "boyw165"))])
+ (secretaria . [(20191128 250) ((emacs (24 4)) (alert (1 2)) (s (1 12)) (f (0 20 0)) (org (9))) "A personal assistant based on org-mode" single ((:commit . "03986130a2ada1fa952d45e83536729f20230fcf") (:authors ("Jorge Araya Navarro" . "jorge@esavara.cr")) (:maintainer "Jorge Araya Navarro" . "jorge@esavara.cr") (:keywords "org" "convenience") (:url . "https://gitlab.com/shackra/secretaria"))])
+ (see-mode . [(20180511 41) ((emacs (24 4)) (language-detection (0 1 0))) "Edit string in a separate buffer" single ((:commit . "b6e72ea90105b03816c334be9e43bb41dcc79abf") (:authors ("Marcelo Muñoz" . "ma.munoz.araya@gmail.com")) (:maintainer "Marcelo Muñoz" . "ma.munoz.araya@gmail.com") (:keywords "convenience") (:url . "https://github.com/marcelino-m/see-mode"))])
+ (seeing-is-believing . [(20170214 1320) nil "minor mode for running the seeing-is-believing ruby gem" single ((:commit . "fbbe246c0fda87bb26227bb826eebadb418a220f") (:authors ("John Cinnamond")) (:maintainer "John Cinnamond"))])
+ (seen-mode . [(20210311 1935) ((emacs (24 4))) "A syntax highlighting package for text/kepago" single ((:commit . "57c960d76ad3dc551ac5a57ebe8682ef9fdc6d31") (:authors ("Filipe da Silva Santos" . "contact@shiori.com.br")) (:maintainer "Filipe da Silva Santos" . "contact@shiori.com.br") (:keywords "languages") (:url . "https://git.sr.ht/~shiorid/seen.el"))])
+ (seethru . [(20150218 1829) ((shadchen (1 4))) "Easily change Emacs' transparency" single ((:commit . "d87e231f99313bea75b1e69e48c0f32968c82060") (:authors ("Benaiah Mischenko" . "benaiah@mischenko.com")) (:maintainer "Benaiah Mischenko" . "benaiah@mischenko.com") (:keywords "lisp" "tools" "alpha" "transparency") (:url . "http://github.com/benaiah/seethru"))])
+ (sekka . [(20170803 1247) ((cl-lib (0 3)) (concurrent (0 3 1)) (popup (0 5 2))) "A client for Sekka IME server" single ((:commit . "61840b57d9ae32bf8e297b175942590a1319c7e7") (:authors ("Kiyoka Nishiyama" . "kiyoka@sumibi.org")) (:maintainer "Kiyoka Nishiyama" . "kiyoka@sumibi.org") (:keywords "ime" "skk" "japanese") (:url . "https://github.com/kiyoka/sekka"))])
+ (select-themes . [(20160221 106) nil "Color theme selection with completing-read" single ((:commit . "236f54287519a3ea6dd7b3992d053e4f4ff5d0fe") (:authors ("Jason Milkins" . "jasonm23@gmail.com")) (:maintainer "Jason Milkins" . "jasonm23@gmail.com") (:url . "https://github.com/jasonm23/emacs-select-themes"))])
+ (selected . [(20220509 1810) nil "Keymap for when region is active" single ((:commit . "81cb32521a05ff2a9125e001b83608e108e480f6") (:authors ("Erik Sjöstrand")) (:maintainer "Erik Sjöstrand") (:keywords "convenience") (:url . "http://github.com/Kungsgeten/selected.el"))])
+ (selectric-mode . [(20200209 2107) nil "IBM Selectric mode for Emacs" tar ((:commit . "1840de71f7414b7cd6ce425747c8e26a413233aa") (:authors ("Ricardo Bánffy" . "rbanffy@gmail.com")) (:maintainer "Ricardo Banffy" . "rbanffy@gmail.com") (:keywords "multimedia" "convenience" "typewriter" "selectric") (:url . "https://github.com/rbanffy/selectric-mode"))])
+ (selectrum . [(20220323 10) ((emacs (26 1))) "Easily select item from list" single ((:commit . "7da932eeb89f1aa8060a73ddd040f95bbb127343") (:authors ("Radon Rosborough" . "radon.neon@gmail.com")) (:maintainer "Radon Rosborough" . "radon.neon@gmail.com") (:keywords "extensions") (:url . "https://github.com/raxod502/selectrum"))])
+ (selectrum-prescient . [(20220509 2300) ((emacs (25 1)) (prescient (5 2)) (selectrum (3 1))) "Selectrum integration" single ((:commit . "c05f8a43c6ff07a8b5a3ba8df7a2ec35677b7484") (:authors ("Radian LLC" . "contact+prescient@radian.codes")) (:maintainer "Radian LLC" . "contact+prescient@radian.codes") (:keywords "extensions") (:url . "https://github.com/raxod502/prescient.el"))])
+ (semaphore . [(20190607 1949) ((emacs (26))) "Semaphore based on condition variables" single ((:commit . "a069b69018b96d284ce7553cd63350a88ea3679c") (:authors ("Herwig Hochleitner" . "herwig@bendlas.net")) (:maintainer "Herwig Hochleitner" . "herwig@bendlas.net") (:keywords "processes" "unix") (:url . "http://github.com/webnf/semaphore.el"))])
+ (semaphore-promise . [(20190607 2115) ((emacs (26)) (semaphore (1)) (promise (1))) "semaphore integration with promise" single ((:commit . "a069b69018b96d284ce7553cd63350a88ea3679c") (:authors ("Herwig Hochleitner" . "herwig@bendlas.net")) (:maintainer "Herwig Hochleitner" . "herwig@bendlas.net") (:keywords "processes" "unix") (:url . "http://github.com/webnf/semaphore.el"))])
+ (semi . [(20220503 1449) ((emacs (24 5)) (apel (10 8)) (flim (1 14 9))) "A library to provide MIME features." tar ((:commit . "b1c245b81715b0430f7593cee2339e6264104f3d"))])
+ (seml-mode . [(20200812 1027) ((emacs (25 1)) (impatient-mode (1 1)) (htmlize (1 5)) (web-mode (16 0))) "Major-mode for SEML, S-Expression Markup Language, file" single ((:commit . "7a9a8305f7b54ee59e4c29b33ef5fd4058ba4219") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "lisp" "html") (:url . "https://github.com/conao3/seml-mode.el"))])
+ (sendto . [(20160425 1250) ((emacs (24 4))) "send the region content to a function" single ((:commit . "076b81d7a53f75b0a59b0ef3448f35570567054c") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "convenience" "region") (:url . "https://github.com/lujun9972/sendto.el"))])
+ (sensei . [(20220502 2012) ((emacs (27 1)) (projectile (2 5 0)) (request (0 3 2))) "A client for sensei" single ((:commit . "1294a96f544fd1be9ddaea3a85369fcf437403e9") (:authors ("Arnaud Bailly" . "arnaud@pankzsoft.com")) (:maintainer "Arnaud Bailly" . "arnaud@pankzsoft.com") (:keywords "hypermedia") (:url . "https://abailly.github.io/sensei"))])
+ (sensitive . [(20170818 1251) ((emacs (24)) (sequences (0 1 0))) "A dead simple way to load sensitive information" single ((:commit . "69dd6125a41d8b55f4b6ba61daa4d1aa1f716fa8") (:authors ("Tim Visher" . "tim.visher@gmail.com")) (:maintainer "Tim Visher" . "tim.visher@gmail.com") (:keywords "convenience"))])
+ (sentence-navigation . [(20180408 1619) ((ample-regexps (0 1)) (cl-lib (0 5)) (emacs (24 4))) "Commands to navigate one-spaced sentences." single ((:commit . "7c5d2edeaed01196aec25031782e89adeaa089f0") (:authors ("Fox Kiester" . "noct@openmailbox.org")) (:maintainer "Fox Kiester" . "noct@openmailbox.org") (:keywords "sentence" "evil") (:url . "https://github.com/noctuid/emacs-sentence-navigation"))])
+ (seoul256-theme . [(20180505 757) ((emacs (24 3))) "Low-contrast color scheme based on Seoul Colors." single ((:commit . "d28a9de73a5ffb1a1c9492db75a5c1efe5e9815f") (:authors ("Anand Iyer" . "anand.ucb@gmail.com")) (:maintainer "Anand Iyer" . "anand.ucb@gmail.com") (:keywords "theme") (:url . "http://github.com/anandpiyer/seoul256-emacs"))])
+ (separedit . [(20220501 1539) ((emacs (25 1)) (dash (2 18)) (edit-indirect (0 1 5))) "Edit comment/string/docstring/code block in separate buffer" single ((:commit . "454c9a3561acca3d57cce6ddb356f686b3d8cbee") (:authors ("Gong Qijian" . "gongqijian@gmail.com")) (:maintainer "Gong Qijian" . "gongqijian@gmail.com") (:keywords "tools" "languages" "docs") (:url . "https://github.com/twlz0ne/separedit.el"))])
+ (sequed . [(20220115 743) ((emacs (25 2))) "Major mode for FASTA format DNA alignments" single ((:commit . "3137bc32c8a6a84dbdb61b4ee029b0e382939adb") (:authors ("Bruce Rannala" . "brannala@ucdavis.edu")) (:maintainer "Bruce Rannala" . "brannala@ucdavis.edu") (:url . "https://github.com/brannala/sequed"))])
+ (sequences . [(20170818 1252) ((emacs (24))) "Ports of some Clojure sequence functions." single ((:commit . "564ebbd93b0beea4e75acfbf824350e90b5d5738") (:authors ("Tim Visher" . "tim.visher@gmail.com")) (:maintainer "Tim Visher" . "tim.visher@gmail.com") (:keywords "convenience"))])
+ (sequential-command . [(20170926 40) nil "Many commands into one command" tar ((:commit . "a48cbcbe273b33edd3ae56e68f44b4100fa3a48a") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "convenience" "lisp") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/sequential-command.el"))])
+ (seriestracker . [(20220212 304) ((dash (2 12 1)) (transient (0 3 2)) (emacs (27 1))) "Series tracker" single ((:commit . "4706db081bd214b272e0bcaabb66887e4b5b0968") (:authors ("Maxime Wack <contact at maximewack dot com>")) (:maintainer "Maxime Wack <contact at maximewack dot com>") (:keywords "multimedia") (:url . "https://www.github.com/MaximeWack/seriesTracker"))])
+ (servant . [(20140216 1219) ((s (1 8 0)) (dash (2 2 0)) (f (0 11 0)) (ansi (0 3 0)) (commander (0 5 0)) (epl (0 2)) (shut-up (0 2 1)) (web-server (0 0 1))) "ELPA server written in Emacs Lisp" tar ((:commit . "4d2aa8250b54b28e6e7ee4cd5ebd98a33db2c134") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com") ("Sebastian Wiesner" . "lunaryorn@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "elpa" "server") (:url . "http://github.com/rejeep/servant.el"))])
+ (serverspec . [(20150623 1155) ((dash (2 6 0)) (s (1 9 0)) (f (0 16 2)) (helm (1 6 1))) "Serverspec minor mode" tar ((:commit . "b6dfe82af9869438de5e5d860ced196641f372c0") (:authors ("k1LoW (Kenichirou Oyama), <k1lowxb [at] gmail [dot] com> <k1low [at] 101000lab [dot] org>")) (:maintainer "k1LoW (Kenichirou Oyama), <k1lowxb [at] gmail [dot] com> <k1low [at] 101000lab [dot] org>") (:url . "http://101000lab.org"))])
+ (services . [(20170802 1130) ((cl-lib (0 5))) "Services database access functions." single ((:commit . "04c7986041a33dfa0b0ae57c7d6fbd600548c596") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "convenience" "net" "services") (:url . "https://github.com/davep/services.el"))])
+ (sesman . [(20210901 1134) ((emacs (25))) "Generic Session Manager" tar ((:commit . "e0f555f963c9f02f8e4a50e06fc353eb4c15ee77") (:authors ("Vitalie Spinu")) (:maintainer "Vitalie Spinu") (:keywords "process") (:url . "https://github.com/vspinu/sesman"))])
+ (session . [(20120511 0) nil "use variables, registers and buffer places across sessions" single ((:commit . "19ea0806873daac3539a4b956e15655e99e3dd6c") (:authors ("Christoph Wedler" . "wedler@users.sourceforge.net")) (:maintainer "Christoph Wedler" . "wedler@users.sourceforge.net") (:keywords "session" "session management" "desktop" "data" "tools") (:url . "http://emacs-session.sourceforge.net/"))])
+ (session-async . [(20220302 2008) ((emacs (27 1)) (jsonrpc (1 0 9))) "Asynchronous processing in a forked process session" single ((:commit . "427238bdfde880106dd39cf5845b559975e52f4f") (:authors ("Felipe Lema" . "felipelema@mortemale.org")) (:maintainer "Felipe Lema" . "felipelema@mortemale.org") (:keywords "async" "comm" "data" "files" "internal" "maint" "processes" "tools") (:url . "https://codeberg.org/FelipeLema/session-async.el"))])
+ (seti-theme . [(20190201 1848) nil "A dark colored theme, inspired by Seti Atom Theme" single ((:commit . "9d76db0b91d4f574dd96ac80fad41da35bffa109") (:authors ("Vlad Piersec" . "vlad.piersec@gmail.com")) (:maintainer "Vlad Piersec" . "vlad.piersec@gmail.com") (:keywords "themes") (:url . "https://github.com/caisah/seti-theme"))])
+ (sexp-diff . [(20200314 2018) ((emacs (25))) "Diff sexps based on Levenshtein-like edit distance" single ((:commit . "7e8c988bea2af209e17b70fa51316ade55529acb") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:keywords "lisp") (:url . "https://github.com/xuchunyang/sexp-diff.el"))])
+ (sexp-move . [(20150915 1730) nil "Improved S-Expression Movement" single ((:commit . "117f7a91ab7c25e438413753e916570122011ce7") (:authors ("Philip Woods" . "elzairthesorcerer@gmail.com")) (:maintainer "Philip Woods" . "elzairthesorcerer@gmail.com") (:keywords "sexp") (:url . "https://gitlab.com/elzair/sexp-move"))])
+ (sexy-monochrome-theme . [(20200115 2146) nil "A sexy dark Emacs >= 24 theme for your sexy code" single ((:commit . "f3ad07d60c966ef34cb11026eaba053e114bb8f1") (:authors ("Volodymyr Yevtushenko" . "voloyev@vivaldi.net")) (:maintainer "Volodymyr Yevtushenko" . "voloyev@vivaldi.net") (:keywords "themes") (:url . "https://github.com/voloyev/sexy-monochrome-theme"))])
+ (sfz-mode . [(20200716 1023) ((emacs (25 1))) "Major mode for SFZ files" single ((:commit . "aaf31d1b68817251affed7da719dfcb2acd4b51a") (:authors ("Jean Pierre Cimalando" . "jp-dev@inbox.ru")) (:maintainer "Jean Pierre Cimalando" . "jp-dev@inbox.ru") (:keywords "languages") (:url . "https://github.com/sfztools/emacs-sfz-mode"))])
+ (shackle . [(20211118 1129) ((emacs (24 3)) (cl-lib (0 5))) "Enforce rules for popups" single ((:commit . "f1467db75a8fa5d51c676181fb308ccbf7b05e6f") (:authors ("Vasilij Schneidermann" . "mail@vasilij.de")) (:maintainer "Vasilij Schneidermann" . "mail@vasilij.de") (:keywords "convenience") (:url . "https://depp.brause.cc/shackle"))])
+ (shadchen . [(20141102 1839) nil "pattern matching for elisp" single ((:commit . "35f2b9c304eec990c16efbd557198289dc7cbb1f") (:authors ("Vincent Toups")) (:maintainer "Vincent Toups"))])
+ (shader-mode . [(20180518 1157) ((emacs (24))) "Major mode for shader" single ((:commit . "d7dc8d0d6fe8914e8b6d5cf2081ad61e6952359c") (:authors ("midnightSuyama" . "midnightSuyama@gmail.com")) (:maintainer "midnightSuyama" . "midnightSuyama@gmail.com") (:url . "https://github.com/midnightSuyama/shader-mode"))])
+ (shades-of-purple-theme . [(20210506 1448) nil "A theme with bold shades of purple" single ((:commit . "e9d2ac081ae657b1ad6a30b9f53e8572479deb80") (:authors ("Arturo Vergara" . "hello@dead.computer")) (:maintainer "Arturo Vergara" . "hello@dead.computer") (:url . "https://github.com/arturovm/shades-of-purple-emacs"))])
+ (shadowenv . [(20210512 1625) ((emacs (24 3))) "Shadowenv integration." single ((:commit . "dbcef650b906fec62608d5e4e3075bf251e675e1") (:authors ("Dante Catalfamo" . "dante.catalfamo@shopify.com")) (:maintainer "Dante Catalfamo" . "dante.catalfamo@shopify.com") (:keywords "shadowenv" "tools") (:url . "https://github.com/Shopify/shadowenv.el"))])
+ (shakespeare-mode . [(20180704 2138) nil "A major mode for editing Shakespearean templates." single ((:commit . "c442eeea9d585e1b1fbb8813e33d47feec348a57") (:authors ("Cody Reichert")) (:maintainer "Cody Reichert") (:keywords "shakespeare" "hamlet" "lucius" "julius" "mode") (:url . "http://github.com/CodyReichert/shakespeare-mode"))])
+ (shampoo . [(20131230 1019) nil "A remote Smalltalk development mode" tar ((:commit . "bc193c39636c30182159c5c91c37a9a4cb50fedf"))])
+ (shanty-themes . [(20220509 1656) ((emacs (27 2))) "The themes for digital workers" tar ((:commit . "14a0e9de08aa6412931b121ae97b700e10ccaa80") (:authors ("Philip Gaber" . "phga@posteo.de")) (:maintainer "Philip Gaber" . "phga@posteo.de") (:keywords "faces" "theme" "blue" "yellow" "gold" "dark" "light") (:url . "https://github.com/qhga/shanty-themes"))])
+ (share2computer . [(20200316 31) ((emacs (25 1))) "Elisp helper of android ShareToComputer" single ((:commit . "15da47625a800e3310b8dc714bd4e41e32966d6a") (:authors ("Feng Shu" . "tumashu@163.com")) (:maintainer "Feng Shu" . "tumashu@163.com") (:keywords "convenience" "comm") (:url . "https://github.com/tumashu/share2computer"))])
+ (sharper . [(20220321 422) ((emacs (27 1)) (transient (0 2 0))) "A dotnet CLI wrapper, using Transient" single ((:commit . "96edd4a1dbc267afdff0cb97298d1b05b7c2080c") (:authors ("Sebastian Monia" . "smonia@outlook.com")) (:maintainer "Sebastian Monia" . "smonia@outlook.com") (:keywords "maint" "tool") (:url . "https://github.com/sebasmonia/sharper"))])
+ (shell-current-directory . [(20140101 2354) nil "create new shell based on buffer directory" single ((:commit . "bf843771bf9a4aa05e054ade799eb8862f3be89a") (:authors ("Daniel Polani")) (:maintainer "Daniel Polani") (:keywords "shell" "comint"))])
+ (shell-here . [(20220102 1703) nil "Open a shell relative to the working directory" single ((:commit . "eeb437ff26d62a5009046b1b3b4503b768e3131a") (:authors ("Ian Eure" . "ian.eure@gmail.com")) (:maintainer "Ian Eure" . "ian.eure@gmail.com") (:keywords "unix" "tools" "processes"))])
+ (shell-history . [(20100505 839) nil "integration with shell history" single ((:commit . "ee371a81f2d2bf5a308344078329ca1e9b5ed38c") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "processes" "convenience") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/shell-history.el"))])
+ (shell-pop . [(20200315 1139) ((emacs (24)) (cl-lib (0 5))) "helps you to use shell easily on Emacs. Only one key action to work." single ((:commit . "4b4394037940a890a313d715d203d9ead2d156a6") (:authors ("Kazuo YAGI" . "kazuo.yagi@gmail.com")) (:maintainer "Kazuo YAGI" . "kazuo.yagi@gmail.com") (:keywords "shell" "terminal" "tools") (:url . "http://github.com/kyagi/shell-pop-el"))])
+ (shell-split-string . [(20151224 1008) nil "Split strings using shell-like syntax" single ((:commit . "19f6f999c33cc66a4c91bacdcc3697c25d97bf5a") (:authors ("10sr <8.slashes+el [at] gmail [dot] com>")) (:maintainer "10sr <8.slashes+el [at] gmail [dot] com>") (:keywords "utility" "library" "shell" "string") (:url . "https://github.com/10sr/shell-split-string-el"))])
+ (shell-switcher . [(20210509 1045) ((emacs (24))) "Provide fast switching between shell buffers." tar ((:commit . "ed74b20fa12935be0068765f5bc8de97b92a8020") (:authors ("Damien Cassou" . "damien.cassou@gmail.com")) (:maintainer "Damien Cassou" . "damien.cassou@gmail.com") (:keywords "emacs" "package" "elisp" "shell" "eshell" "term" "switcher") (:url . "https://github.com/DamienCassou/shell-switcher"))])
+ (shell-toggle . [(20150226 1411) nil "Toggle to and from the shell buffer" single ((:commit . "0d01bd9a780fdb7fe6609c552523f4498649a3b9") (:authors ("Mikael Sjödin" . "mic@docs.uu.se") ("Matthieu Moy") ("Akinori MUSHA" . "knu@iDaemons.org")) (:maintainer "Mikael Sjödin" . "mic@docs.uu.se") (:keywords "processes") (:url . "https://github.com/knu/shell-toggle.el"))])
+ (shellcop . [(20220414 530) ((emacs (25 1))) "Analyze info&error in shell-mode" single ((:commit . "327f5ac43e5d543149a772aef06cdb616477eb43") (:authors ("Chen Bin" . "chenbin.sh@gmail.com")) (:maintainer "Chen Bin" . "chenbin.sh@gmail.com") (:keywords "unix" "tools") (:url . "https://github.com/redguardtoo/shellcop"))])
+ (shelldoc . [(20200513 1206) ((cl-lib (0 3)) (s (1 9 0))) "shell command editing support with man page." single ((:commit . "fa69f67b6229fad3f31d936955ca8d1982009b77") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "applications") (:url . "http://github.com/mhayashi1120/Emacs-shelldoc"))])
+ (shelldon . [(20220325 1305) ((emacs (27 1))) "An enhanced shell interface" single ((:commit . "8d073ce580e7782ed863fc6e19dc33b4f73c0d79") (:authors ("overdr0ne" . "scmorris.dev@gmail.com")) (:maintainer "overdr0ne" . "scmorris.dev@gmail.com") (:keywords "tools" "convenience") (:url . "https://github.com/Overdr0ne/shelldon"))])
+ (shelltest-mode . [(20180501 141) nil "Major mode for shelltestrunner" single ((:commit . "5fea8c9394380e822971a171905b6b5ab9be812d") (:authors ("Dustin Fechner" . "dfe@rtrn.io")) (:maintainer "Dustin Fechner" . "dfe@rtrn.io") (:keywords "languages") (:url . "https://github.com/rtrn/shelltest-mode"))])
+ (shen-elisp . [(20210530 349) ((emacs (24 4))) "Shen implementation in Elisp" tar ((:commit . "dabb829d0d86f454ceb3b0846cdfc11af1f91cc7") (:authors ("Aditya Siram" . "aditya.siram@gmail.com")) (:maintainer "Aditya Siram" . "aditya.siram@gmail.com") (:url . "https://github.com/deech/shen-elisp"))])
+ (shenshou . [(20220324 1137) ((emacs (25 1))) "Download subtitles from opensubtitles.org" single ((:commit . "bc16a637edaaca831a5147b6f479ba1dbdc02454") (:authors ("Chen Bin <chenbin DOT sh AT gmail DOT com>")) (:maintainer "Chen Bin <chenbin DOT sh AT gmail DOT com>") (:keywords "convenience" "tools") (:url . "http://github.com/redguardtoo/shenshou"))])
+ (shfmt . [(20210803 222) ((emacs (24)) (reformatter (0 3))) "Reformat shell scripts using shfmt" single ((:commit . "ceb1ed4df3d7e198e4c5af0c2fd44c4d9d65832e") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "languages") (:url . "https://github.com/purcell/emacs-shfmt"))])
+ (shift-number . [(20170301 1459) nil "Increase/decrease the number at point" single ((:commit . "cd099a5582fc996b800ac7607f6c38a004ce9740") (:authors ("Alex Kost" . "alezost@gmail.com")) (:maintainer "Alex Kost" . "alezost@gmail.com") (:keywords "convenience") (:url . "https://github.com/alezost/shift-number.el"))])
+ (shift-text . [(20130831 1655) ((cl-lib (1 0)) (es-lib (0 3))) "Move the region in 4 directions, in a way similar to Eclipse's" single ((:commit . "1be9cbf994000022172ceb746fe1d597f57ea8ba") (:authors ("sabof")) (:maintainer "sabof") (:url . "https://github.com/sabof/shift-text"))])
+ (shimbun . [(20220426 715) nil "interfacing with web newspapers" tar ((:commit . "7baf17355289c29d18f993f383c5d6a187f33b35") (:authors ("TSUCHIYA Masatoshi" . "tsuchiya@namazu.org") ("Akihiro Arisawa " . "ari@mbf.sphere.ne.jp") ("Yuuichi Teranishi " . "teranisi@gohome.org") ("Katsumi Yamaoka " . "yamaoka@jpl.org")) (:maintainer "TSUCHIYA Masatoshi" . "tsuchiya@namazu.org") (:keywords "news"))])
+ (shm . [(20180327 57) nil "Structured Haskell Mode" tar ((:commit . "7f9df73f45d107017c18ce4835bbc190dfe6782e") (:authors ("Chris Done" . "chrisdone@gmail.com")) (:maintainer "Chris Done" . "chrisdone@gmail.com") (:keywords "development" "haskell" "structured"))])
+ (shoulda . [(20140616 1833) ((cl-lib (0 5))) "Shoulda test support for ruby" single ((:commit . "fbe8eb8efc6cfcca1713283a290882cfcdc8725e") (:authors ("Marcwebbie" . "marcwebbie@gmail.com")) (:maintainer "Marcwebbie" . "marcwebbie@gmail.com") (:keywords "ruby" "tests" "shoulda"))])
+ (show-css . [(20160210 1408) ((doom (1 3)) (s (1 10 0))) "Show the css of the html attribute the cursor is on" tar ((:commit . "771daeddd4df7a7c10f66419a837145649bab63b") (:authors ("Sheldon McGrandle" . "developer@rednemesis.com")) (:maintainer "Sheldon McGrandle" . "developer@rednemesis.com") (:keywords "hypermedia") (:url . "https://github.com/smmcg/showcss-mode"))])
+ (show-eol . [(20210715 1227) ((emacs (24 4))) "Show end of line symbol in buffer" single ((:commit . "09aaba23300b9fa3cfd15ceb0e62da4a3d53e7e5") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/show-eol"))])
+ (show-font-mode . [(20201225 2217) ((emacs (25 1))) "Show font at point on mode line" single ((:commit . "8503be7966d3bd8316039b5f49d3c37c7b97d10c") (:authors ("Melissa Boiko" . "melissa@namakajiri.net")) (:maintainer "Melissa Boiko" . "melissa@namakajiri.net") (:keywords "faces" "i18n" "unicode" "fonts" "fontsets") (:url . "https://github.com/melissaboiko/show-font-mode"))])
+ (showtip . [(20090830 1040) nil "Show tip at cursor" single ((:commit . "930da302809a4257e8d69425455b29e1cc91949b") (:authors ("Ye Wenbin" . "wenbinye@gmail.com")) (:maintainer "Ye Wenbin" . "wenbinye@gmail.com") (:keywords "help"))])
+ (shpec-mode . [(20150530 922) nil "Minor mode for shpec specification" single ((:commit . "146adc8281d0f115df39a3a3f982ac59ab61b754") (:authors ("AdrieanKhisbe" . "adriean.khisbe@live.fr")) (:maintainer "AdrieanKhisbe" . "adriean.khisbe@live.fr") (:keywords "languages" "tools") (:url . "http://github.com/shpec/shpec-mode"))])
+ (shr-tag-pre-highlight . [(20200626 1047) ((emacs (25 1)) (language-detection (0 1 0))) "Syntax highlighting code block in HTML" single ((:commit . "931c447bc0d6c134ddc9657c664eeee33afbc54d") (:authors ("Chunyang Xu" . "mail@xuchunyang.me")) (:maintainer "Chunyang Xu" . "mail@xuchunyang.me") (:keywords "html") (:url . "https://github.com/xuchunyang/shr-tag-pre-highlight.el"))])
+ (shrface . [(20210829 1013) ((emacs (25 1)) (org (9 0)) (language-detection (0 1 0))) "Extend shr/eww with org features and analysis capability" single ((:commit . "b8a23e097b25d6c7754f9aaf4de89259f8a0b17d") (:authors ("Damon Chan" . "elecming@gmail.com")) (:maintainer "Damon Chan" . "elecming@gmail.com") (:keywords "faces") (:url . "https://github.com/chenyanming/shrface"))])
+ (shrink-path . [(20190208 1335) ((emacs (24)) (s (1 6 1)) (dash (1 8 0)) (f (0 10 0))) "fish-style path" single ((:commit . "c14882c8599aec79a6e8ef2d06454254bb3e1e41") (:authors ("Benjamin Andresen")) (:maintainer "Benjamin Andresen") (:url . "https://gitlab.com/bennya/shrink-path.el"))])
+ (shrink-whitespace . [(20181003 321) nil "Whitespace removal DWIM key" single ((:commit . "0407b89c142bd17e65edb666f35e2c6755bd0867") (:authors ("Jean-Christophe Petkovich" . "jcpetkovich@gmail.com")) (:maintainer "Jean-Christophe Petkovich" . "jcpetkovich@gmail.com") (:keywords "convenience") (:url . "https://gitlab.com/jcpetkovich/shrink-whitespace.el"))])
+ (shroud . [(20210220 1952) ((emacs (25)) (epg (1 0 0)) (s (1 6 0)) (bui (1 2 0)) (dash (2 18 0))) "Shroud secrets" tar ((:commit . "2e6ff2bab4a1e798c090c9d7fbd90b7f3463d5c5") (:authors ("Amar Singh" . "nly@disroot.org")) (:maintainer "Amar Singh" . "nly@disroot.org") (:keywords "tools" "password") (:url . "https://github.com/o-nly/emacs-shroud"))])
+ (shut-up . [(20210403 1249) ((cl-lib (0 3)) (emacs (24))) "Shut up would you!" single ((:commit . "ff6f06f3b080ee833a25a22da8cb5b96e911dc77") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:url . "http://github.com/rejeep/shut-up.el"))])
+ (shx . [(20220424 2124) ((emacs (24 4))) "Extras for the comint-mode shell" single ((:commit . "15bbc0f89a4927792e2e791378de827ab698ed69") (:authors ("Chris Rayner and contributors")) (:maintainer "Chris Rayner" . "dchrisrayner@gmail.com") (:keywords "terminals" "processes" "comint" "shell" "repl") (:url . "https://github.com/riscy/shx-for-emacs"))])
+ (sibilant-mode . [(20151119 2145) nil "Support for the Sibilant programming language" single ((:commit . "bc1b5d8cd597918bafc9b2880ee49024740e54ab") (:authors ("Jacob Rothstein" . "hi@jbr.me")) (:maintainer "Jacob Rothstein" . "hi@jbr.me") (:keywords "languages") (:url . "http://sibilantjs.info"))])
+ (sicp . [(20200512 1137) nil "Structure and Interpretation of Computer Programs in info format" tar ((:commit . "4002d83083d520c6b5ede2df36cc2cee885d450a") (:authors ("Hal Abelson") ("Jerry Sussman") ("Julie Sussman")) (:maintainer "Hal Abelson") (:url . "https://mitpress.mit.edu/sicp"))])
+ (side-hustle . [(20210627 701) ((emacs (24 4)) (seq (2 20))) "Hustle through Imenu in a side window" single ((:commit . "1f4cd5e7cfbabb00c6d87e913770f21e3d16c957") (:authors ("Paul W. Rankin" . "pwr@bydasein.com")) (:maintainer "Paul W. Rankin" . "pwr@bydasein.com") (:keywords "convenience") (:url . "https://github.com/rnkn/side-hustle"))])
+ (side-notes . [(20210709 1403) ((emacs (24 4))) "Easy access to a directory notes file" single ((:commit . "41fe8544661a772f764a0924e04080f258053955") (:authors ("Paul W. Rankin" . "pwr@bydasein.com")) (:maintainer "Paul W. Rankin" . "pwr@bydasein.com") (:keywords "convenience") (:url . "https://github.com/rnkn/side-notes"))])
+ (sidecar-locals . [(20220510 413) ((emacs (27 1))) "A flexible alternative to built-in dir-locals" single ((:commit . "7fd5daec1e0a7a091b343948bbb5c77e73724776") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:keywords "convenience") (:url . "https://codeberg.com/ideasman42/emacs-sidecar-locals"))])
+ (sift . [(20200421 1423) nil "Front-end for sift, a fast and powerful grep alternative" single ((:commit . "cdddba2d183146c340915003f1b5d09d13712c22") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "sift" "ack" "pt" "ag" "grep" "search") (:url . "https://github.com/nlamirault/sift.el"))])
+ (signal . [(20160816 1438) ((emacs (24)) (cl-lib (0 5))) "Advanced hook" single ((:commit . "aa58327e2297df921d72a0370468b48663efd438") (:authors ("Mola-T" . "Mola@molamola.xyz")) (:maintainer "Mola-T" . "Mola@molamola.xyz") (:keywords "internal" "lisp" "processes" "tools") (:url . "https://github.com/mola-T/signal"))])
+ (silkworm-theme . [(20210215 1120) ((emacs (24))) "Light theme with pleasant, low contrast colors." single ((:commit . "ff80e9294da0fb093e15097ac62153ef4a64a889") (:authors ("Martin Haesler")) (:maintainer "Martin Haesler"))])
+ (simp . [(20180607 254) nil "Simple project definition, chiefly for file finding, and grepping" tar ((:commit . "d4d4b8547055347828bedccbeffdb4fd2d5a5d34") (:authors ("atom smith")) (:maintainer "atom smith") (:keywords "project" "grep" "find") (:url . "https://github.com/re5et/simp"))])
+ (simple-bookmarks . [(20190204 1426) ((cl-lib (0 5))) "Bookmark / functioncall manager" tar ((:commit . "54e8d771bcdb0eb235b31c0aa9642171369500e5") (:authors ("Julian T. Knabenschuh" . "jtkdevelopments@gmail.com")) (:maintainer "Julian T. Knabenschuh" . "jtkdevelopments@gmail.com") (:keywords "bookmark" "functioncall") (:url . "https://github.com/jtkDvlp/simple-bookmarks"))])
+ (simple-call-tree . [(20210625 2001) ((emacs (24 3)) (anaphora (1 0 0))) "analyze source code based on font-lock text-properties" single ((:commit . "26de24bcde0eae911a0185bb5a6b74b9864fcfc3") (:authors ("Joe Bloggs" . "vapniks@yahoo.com")) (:maintainer "Joe Bloggs" . "vapniks@yahoo.com") (:keywords "programming") (:url . "http://www.emacswiki.org/emacs/download/simple-call-tree.el"))])
+ (simple-httpd . [(20191103 1446) ((cl-lib (0 3))) "pure elisp HTTP server" single ((:commit . "22ce66ea43e0eadb9ec1d691a35d9695fc29cee6") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/emacs-http-server"))])
+ (simple-indentation . [(20220215 1745) ((emacs (24 3)) (dash (2 18 0)) (s (1 12 0))) "Simplify writing indentation functions, alternative to SMIE" tar ((:commit . "e7c8238af9e1a6b1fc4dab8014d779ac178fc249") (:authors ("Semen Khramtsov" . "hrams205@gmail.com")) (:maintainer "Semen Khramtsov" . "hrams205@gmail.com") (:url . "https://github.com/semenInRussia/simple-indentation.el"))])
+ (simple-modeline . [(20210312 1048) ((emacs (26 1))) "A simple mode-line configuration for Emacs" tar ((:commit . "119d8224a8ae0ee17b09ac1fed6cdb9cb1d048fd") (:authors ("Eder Elorriaga" . "gexplorer8@gmail.com")) (:maintainer "Eder Elorriaga" . "gexplorer8@gmail.com") (:keywords "mode-line" "faces") (:url . "https://github.com/gexplorer/simple-modeline"))])
+ (simple-mpc . [(20220216 102) ((s (1 10 0))) "provides a simple interface to mpc" tar ((:commit . "57ee14ada8aec477ddde5e4f632c8d3d99a66535") (:authors ("Joren Van Onder" . "joren@jvo.sh")) (:maintainer "Joren Van Onder" . "joren@jvo.sh") (:keywords "multimedia" "mpd" "mpc") (:url . "https://github.com/jorenvo/simple-mpc"))])
+ (simple-paren . [(20220207 2007) ((emacs (24)) (cl-lib (0 5))) "Non-electrical insert paired delimiter, wrap" single ((:commit . "a454901635dfe4142d8c4f0153e737ddc778d708") (:authors ("Andreas Röhler, Steve Purcell")) (:maintainer "Andreas Röhler, Steve Purcell") (:keywords "convenience") (:url . "https://github.com/andreas-roehler/simple-paren"))])
+ (simple-rtm . [(20160222 1534) ((rtm (0 1)) (dash (2 0 0))) "Interactive Emacs mode for Remember The Milk" single ((:commit . "8c7cd96cf66ef112be5c363e3378e304f8f83999") (:authors ("Moritz Bunkus" . "morit@bunkus.org")) (:maintainer "Moritz Bunkus" . "morit@bunkus.org") (:keywords "remember" "the" "milk" "productivity" "todo"))])
+ (simple-screen . [(20200926 109) nil "Simple screen configuration manager" single ((:commit . "3ce535755986f7c25890d11e42fa621a3a069a4f") (:authors ("Tadashi Watanabe" . "wac@umiushi.org")) (:maintainer "Tadashi Watanabe" . "wac@umiushi.org") (:keywords "tools") (:url . "https://github.com/wachikun/simple-screen"))])
+ (simpleclip . [(20210406 1221) nil "Simplified access to the system clipboard" single ((:commit . "67c8c17adbbe6d9407a5ce4159d097a8b8bf6adb") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "convenience") (:url . "http://github.com/rolandwalker/simpleclip"))])
+ (simplenote . [(20141118 1440) nil "Interact with simple-note.appspot.com" single ((:commit . "e836fcdb5a6497a9ffd6bceddd19b4bc52189078") (:authors ("Konstantinos Efstathiou" . "konstantinos@efstathiou.gr")) (:maintainer "Konstantinos Efstathiou" . "konstantinos@efstathiou.gr") (:keywords "simplenote"))])
+ (simplenote2 . [(20190321 933) ((request-deferred (0 2 0)) (uuidgen (20140918)) (unicode-escape (1 1))) "Interact with app.simplenote.com" tar ((:commit . "760ffecda63bd218876b623f46d332e3ef079be6") (:authors ("alpha22jp" . "alpha22jp@gmail.com")) (:maintainer "alpha22jp" . "alpha22jp@gmail.com") (:keywords "simplenote"))])
+ (simplezen . [(20130421 1000) ((s (1 4 0)) (dash (1 1 0))) "A simple subset of zencoding-mode for Emacs." single ((:commit . "119fdf2c6890a0c56045ae72cf4fce0071a81481") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com"))])
+ (simplicity-theme . [(20220217 1928) ((emacs (24 1))) "A minimalist dark theme" single ((:commit . "2a0aaf19cf1e99c50df0d2e6225a2d2931a203d2") (:authors ("Matthieu Petiteau" . "mpetiteau.pro@gmail.com")) (:maintainer "Matthieu Petiteau" . "mpetiteau.pro@gmail.com") (:keywords "faces" "theme" "minimal") (:url . "http://github.com/smallwat3r/emacs-simplicity-theme"))])
+ (siri-shortcuts . [(20211229 1833) ((emacs (25 2))) "Interact with Siri Shortcuts" single ((:commit . "190f242f71e071adfd89fa1f2f6ea22b62afd133") (:authors ("Daniils Petrovs" . "thedanpetrov@gmail.com")) (:maintainer "Daniils Petrovs" . "thedanpetrov@gmail.com") (:keywords "convenience" "multimedia") (:url . "https://github.com/DaniruKun/siri-shortcuts.el"))])
+ (sis . [(20220506 1606) ((emacs (25 1)) (terminal-focus-reporting (0 0))) "Less manual switch for native or OS input source (input method)." single ((:commit . "f26d25194c65e19b5473fa1a3cdf96be2b209e19") (:keywords "convenience") (:url . "https://github.com/laishulu/emacs-smart-input-source"))])
+ (sisyphus . [(20220506 1140) ((emacs (27)) (compat (28 1 1 0)) (magit (3 4 0))) "Create releases of Emacs packages" single ((:commit . "9626d9d26dc9f3cc57d41fa119a74e0cb1c4aab9") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "git" "tools" "vc") (:url . "https://github.com/magit/sisyphus"))])
+ (skeletor . [(20210129 239) ((s (1 7 0)) (f (0 14 0)) (dash (2 2 0)) (cl-lib (0 3)) (let-alist (1 0 3)) (emacs (24 1))) "Provides project skeletons for Emacs" tar ((:commit . "f6e560a0bfe459e0b8a268047920ce1148f2ebf6") (:authors ("Chris Barrett" . "chris.d.barrett@me.com")) (:maintainer "Chris Barrett" . "chris.d.barrett@me.com"))])
+ (skerrick . [(20220306 2139) ((emacs (27 1)) (request (0 3 2))) "REPL-driven development for NodeJS" single ((:commit . "fc88e82aa4b0a71b1fbe0217df4020538ebd8cd5") (:authors ("Rafael Nicdao <https://github.com/anonimitoraf>")) (:maintainer "Rafael Nicdao" . "nicdaoraf@gmail.com") (:keywords "languages" "javascript" "js" "repl" "repl-driven") (:url . "https://github.com/anonimitoraf/skerrick"))])
+ (sketch-themes . [(20220404 1741) ((emacs (26 1))) "Sketch color themes" tar ((:commit . "8a609ec8fbf12231ba67aab9fcbb6b3ad0420359") (:authors ("Daw-Ran Liou" . "hi@dawranliou.com")) (:maintainer "Daw-Ran Liou" . "hi@dawranliou.com") (:keywords "faces") (:url . "https://github.com/dawranliou/sketch-themes/"))])
+ (skewer-less . [(20210510 532) ((skewer-mode (1 5 3))) "Skewer support for live LESS stylesheet updates" single ((:commit . "baa973581c2ab7326db65803df97d1a7382b6564") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "languages" "tools"))])
+ (skewer-mode . [(20200304 1142) ((simple-httpd (1 4 0)) (js2-mode (20090723)) (emacs (24))) "live browser JavaScript, CSS, and HTML interaction" tar ((:commit . "e5bed351939c92a1f788f78398583c2f83f1bb3c") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/skewer-mode"))])
+ (skewer-reload-stylesheets . [(20160725 1220) ((skewer-mode (1 5 3))) "live-edit CSS, SCSS, Less, and friends." tar ((:commit . "b9cc5635230ac3c0603a6da690c6e632d0a7490a") (:authors ("Nate Eagleson" . "nate@nateeag.com")) (:maintainer "Nate Eagleson" . "nate@nateeag.com"))])
+ (skype . [(20160711 824) nil "skype UI for emacs users.." tar ((:commit . "8e3b33e620ed355522aa36434ff41e3ced080629") (:authors ("SAKURAI Masashi" . "m.sakurai@kiwanami.net")) (:maintainer "SAKURAI Masashi" . "m.sakurai@kiwanami.net") (:keywords "skype" "chat"))])
+ (sl . [(20161217 1404) ((cl-lib (0 5))) "An Emacs clone of sl(1)" tar ((:commit . "fceb2ae12a3065b2a265b921baca0891c5ea54dc") (:authors ("Chunyang Xu" . "mail@xuchunyang.me")) (:maintainer "Chunyang Xu" . "mail@xuchunyang.me") (:url . "https://github.com/xuchunyang/sl.el"))])
+ (slack . [(20211129 310) ((websocket (1 8)) (request (0 2 0)) (oauth2 (0 10)) (circe (2 2)) (alert (1 2)) (emojify (0 2))) "Slack client for Emacs" tar ((:commit . "ff46d88726482211e3ac3d0b9c95dd4fdffe11c2") (:authors ("yuya.minami" . "yuya.minami@yuyaminami-no-MacBook-Pro.local")) (:maintainer "yuya.minami" . "yuya.minami@yuyaminami-no-MacBook-Pro.local") (:keywords "tools") (:url . "https://github.com/yuya373/emacs-slack"))])
+ (slideview . [(20150324 2240) ((cl-lib (0 3))) "File slideshow" single ((:commit . "b6d170bda139aedf81b47dc55cbd1a3af512fb4c") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "files") (:url . "https://github.com/mhayashi1120/Emacs-slideview"))])
+ (slim-mode . [(20170728 1348) nil "Major mode for editing Slim files" single ((:commit . "3636d18ab1c8b316eea71c4732eb44743e2ded87") (:authors ("Nathan Weizenbaum")) (:maintainer "Nathan Weizenbaum") (:keywords "markup" "language") (:url . "http://github.com/slim-template/emacs-slim"))])
+ (slime . [(20220302 1215) ((cl-lib (0 5)) (macrostep (0 9))) "Superior Lisp Interaction Mode for Emacs" tar ((:commit . "6ef28864d4a6b4d9390dbd0cac64f2a56582682d") (:keywords "languages" "lisp" "slime") (:url . "https://github.com/slime/slime"))])
+ (slime-company . [(20210124 1627) ((emacs (24 4)) (slime (2 13)) (company (0 9 0))) "slime completion backend for company mode" single ((:commit . "f20ecc4104d4c35052696e7e760109fb02060e72") (:authors ("Ole Arndt" . "anwyn@sugarshark.com")) (:maintainer "Ole Arndt" . "anwyn@sugarshark.com") (:keywords "convenience" "lisp" "abbrev"))])
+ (slime-docker . [(20210426 1422) ((emacs (24 4)) (slime (2 16)) (docker-tramp (0 1))) "Integration of SLIME with Docker containers" tar ((:commit . "c7d073720f2bd8e9f72a20309fff2afa4c4e798d") (:keywords "docker" "lisp" "slime") (:url . "https://gitlab.common-lisp.net/cl-docker-images/slime-docker"))])
+ (slime-repl-ansi-color . [(20200712 1226) ((emacs (24)) (slime (2 3 1))) "Turn on ANSI colors in REPL output;" single ((:commit . "e38c7958d9657e41c426b4e96938b3f604238795") (:authors ("Max Mikhanosha" . "max@openchat.com")) (:maintainer "Augustin Fabre" . "augustin@augfab.fr") (:keywords "lisp") (:url . "https://gitlab.com/augfab/slime-repl-ansi-color"))])
+ (slime-theme . [(20170808 1322) ((emacs (24 0))) "an Emacs 24 theme based on Slime (tmTheme)" single ((:commit . "8e5880ac69e0b6a079103001cc3a90bdb688998f") (:authors ("Jason Milkins")) (:maintainer "Jason Milkins") (:url . "https://github.com/emacsfodder/tmtheme-to-deftheme"))])
+ (slime-volleyball . [(20190701 1624) nil "An SVG Slime Volleyball Game" tar ((:commit . "f36a84f3c503c46ba0d011874d387a34b01c6bf6") (:authors ("Thomas Fitzsimmons" . "fitzsim@fitzsim.org")) (:maintainer "Thomas Fitzsimmons" . "fitzsim@fitzsim.org") (:keywords "games"))])
+ (slirm . [(20160201 1425) ((emacs (24 4))) "Systematic Literature Review Mode for Emacs." single ((:commit . "9adfbe1fc67580e7d0d90f7e927a25d63a797464") (:authors ("Florian Biermann" . "fbie@itu.dk")) (:maintainer "Florian Biermann" . "fbie@itu.dk") (:url . "http://github.com/fbie/slirm"))])
+ (slovak-holidays . [(20211018 1754) nil "Adds a list of slovak holidays to Emacs calendar" single ((:commit . "bedd26dd45ca497c0028a11e94a905560fcdb2f1") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "calendar"))])
+ (slow-keys . [(20180831 459) ((emacs (24 1))) "Slow keys mode to avoid RSI" single ((:commit . "b93ad77f9fc1d14e080d7d64864fc9cb222248b6") (:authors ("Manuel Uberti" . "manuel.uberti@inventati.org")) (:maintainer "Manuel Uberti" . "manuel.uberti@inventati.org") (:keywords "convenience") (:url . "https://github.com/manuel-uberti/slow-keys"))])
+ (slstats . [(20170823 849) ((cl-lib (0 5)) (emacs (24))) "Acquire and display stats about Second Life" single ((:commit . "e9696066abf3f2b7b818a57c062530dfd9377033") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "games") (:url . "https://github.com/davep/slstats.el"))])
+ (slurm-mode . [(20210519 1109) nil "Interaction with the SLURM job scheduling system" tar ((:commit . "589826fbb07f625b23c322df1cc16377c4fe6f66") (:url . "https://github.com/ffevotte/slurm.el"))])
+ (sly . [(20220302 1053) ((emacs (24 3))) "Sylvester the Cat's Common Lisp IDE" tar ((:commit . "4513c382f07a2a2cedb3c046231b69eae2f5e6f0") (:keywords "languages" "lisp" "sly") (:url . "https://github.com/joaotavora/sly"))])
+ (sly-asdf . [(20220117 714) ((emacs (24 3)) (sly (1 0 0 -2 2)) (popup (0 5 3))) "ASDF system support for SLY" tar ((:commit . "89fff94868f01d000b8bb4dd9d7e4d6389e61259") (:maintainer "Matt George" . "mmge93@gmail.com") (:keywords "languages" "lisp" "sly" "asdf") (:url . "https://github.com/mmgeorge/sly-asdf"))])
+ (sly-hello-world . [(20200225 1755) ((sly (1 0 0 -2 2))) "A template SLY contrib" tar ((:commit . "d25acc1220a3ce066bd9908251c2f0f88b1781e9") (:authors ("João Távora" . "joaotavora@gmail.com")) (:maintainer "João Távora" . "joaotavora@gmail.com") (:keywords "languages" "lisp" "sly") (:url . "https://github.com/capitaomorte/sly-hello-world"))])
+ (sly-macrostep . [(20191211 1630) ((sly (1 0 0 -2 2)) (macrostep (0 9))) "fancy macro-expansion via macrostep.el" tar ((:commit . "5113e4e926cd752b1d0bcc1508b3ebad5def5fad") (:keywords "languages" "lisp" "sly") (:url . "https://github.com/capitaomorte/sly-macrostep"))])
+ (sly-named-readtables . [(20191013 2138) ((sly (1 0 0 -2 2))) "Support named readtables in Common Lisp files" tar ((:commit . "a5a42674ccffa97ccd5e4e9742beaf3ea719931f") (:authors ("João Távora" . "joaotavora@gmail.com")) (:maintainer "João Távora" . "joaotavora@gmail.com") (:keywords "languages" "lisp" "sly") (:url . "https://github.com/capitaomorte/sly-named-readtables"))])
+ (sly-quicklisp . [(20211206 948) ((sly (1 0 0 -2 2))) "Quicklisp support for SLY" tar ((:commit . "34c73d43dd9066262387c626c17a9b486db07b2d") (:authors ("João Távora" . "joaotavora@gmail.com")) (:maintainer "João Távora" . "joaotavora@gmail.com") (:keywords "languages" "lisp" "sly") (:url . "https://github.com/capitaomorte/sly-quicklisp"))])
+ (sly-repl-ansi-color . [(20171020 1516) ((sly (0)) (cl-lib (0 5))) "Add ANSI colors support to the sly mrepl." single ((:commit . "b9cd52d1cf927bf7e08582d46ab0bcf1d4fb5048") (:authors ("Javier \"PuercoPop\" Olaechea" . "pirata@gmail.com") ("Max Mikhanosha")) (:maintainer "Javier \"PuercoPop\" Olaechea" . "pirata@gmail.com") (:keywords "sly") (:url . "https://github.com/PuercoPop/sly-repl-ansi-color"))])
+ (smart-backspace . [(20171014 526) nil "intellj like backspace" single ((:commit . "a10ec44ff325ec8c4c98b1a6e44e89e60a9aa4ac") (:authors ("Takeshi Tsukamoto" . "t.t.itm.0403@gmail.com")) (:maintainer "Takeshi Tsukamoto" . "t.t.itm.0403@gmail.com") (:url . "https://github.com/itome/smart-backspace"))])
+ (smart-comment . [(20160322 1839) nil "smarter commenting" single ((:commit . "17ddbd83205818763e6d68aa7a1aa9aaf414cbd4") (:authors ("Simon Friis Vindum" . "simon@vindum.io")) (:maintainer "Simon Friis Vindum" . "simon@vindum.io") (:keywords "lisp"))])
+ (smart-compile . [(20211127 1702) nil "an interface to `compile'" single ((:commit . "df771e8cf0f7d5ed455c74bf7d9c1e366f47922f") (:authors ("Seiji Zenitani" . "zenitani@gmail.com")) (:maintainer "Seiji Zenitani" . "zenitani@gmail.com") (:keywords "tools" "unix"))])
+ (smart-cursor-color . [(20201207 2228) nil "Change cursor color dynamically" single ((:commit . "d532f0b27e37cbd3bfc0be09d0b54aa38f1648f1") (:authors ("7696122")) (:maintainer "7696122") (:keywords "cursor" "color" "face") (:url . "https://github.com/7696122/smart-cursor-color/"))])
+ (smart-dash . [(20210427 1709) nil "Smart-Dash minor mode" single ((:commit . "bc740889dd81e7dc8a90a33d1f075f21aba9b2d3") (:authors ("Dennis Lambe Jr." . "malsyned@malsyned.net")) (:maintainer "Dennis Lambe Jr." . "malsyned@malsyned.net"))])
+ (smart-forward . [(20140430 713) ((expand-region (0 8 0))) "Semantic navigation" single ((:commit . "7b6dbfdbd4b646376a567c70e1a161545431b72b") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "navigation"))])
+ (smart-hungry-delete . [(20211020 1822) ((emacs (24 3))) "smart hungry deletion of whitespace" single ((:commit . "78acd1f16fb99b66a6c9bd605a988c3c74280577") (:authors ("Hauke Rehfeld" . "emacs@haukerehfeld.de")) (:maintainer "Hauke Rehfeld" . "emacs@haukerehfeld.de") (:keywords "convenience") (:url . "https://github.com/hrehfeld/emacs-smart-hungry-delete"))])
+ (smart-indent-rigidly . [(20141206 15) nil "Smart rigid indenting" single ((:commit . "323d1fe4d0b81e598249aad01bc44adb180ece0e") (:authors ("atom smith")) (:maintainer "atom smith") (:keywords "indenting" "coffee-mode" "haml-mode" "sass-mode") (:url . "https://github.com/re5et/smart-indent-rigidly"))])
+ (smart-jump . [(20210304 844) ((emacs (25 1))) "Smart go to definition." tar ((:commit . "3392eb35e3cde37e6f5f2a48dc0db15ca535143c") (:authors ("James Nguyen" . "james@jojojames.com")) (:maintainer "James Nguyen" . "james@jojojames.com") (:keywords "tools") (:url . "https://github.com/jojojames/smart-jump"))])
+ (smart-mark . [(20150912 210) nil "Restore point after C-g when mark" single ((:commit . "04b522a23e3aae8381c6a976fc978532fcb2e7d0") (:authors ("Kai Yu" . "yeannylam@gmail.com")) (:maintainer "Kai Yu" . "yeannylam@gmail.com") (:keywords "mark" "restore"))])
+ (smart-mode-line . [(20211005 233) ((emacs (24 3)) (rich-minority (0 1 1))) "A color coded smart mode-line." tar ((:commit . "abcb0ab6f7110a03d6c7428bae67cf8731496433") (:authors ("Artur Malabarba" . "emacs@endlessparentheses.com")) (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com") (:keywords "mode-line" "faces" "themes") (:url . "http://github.com/Malabarba/smart-mode-line"))])
+ (smart-mode-line-atom-one-dark-theme . [(20220108 2110) ((emacs (24 3)) (smart-mode-line (2 10))) "Atom-one-dark theme for smart-mode-line" single ((:commit . "8ce6cca51b19395ccdd8f33a54419fa539f837f0") (:authors ("Davide Restivo" . "davide.restivo@yahoo.it")) (:maintainer "Davide Restivo" . "davide.restivo@yahoo.it") (:keywords "mode-line" "themes" "faces") (:url . "https://github.com/daviderestivo/smart-mode-line-atom-one-dark-theme"))])
+ (smart-mode-line-powerline-theme . [(20160706 38) ((emacs (24 3)) (powerline (2 2)) (smart-mode-line (2 5))) "smart-mode-line theme that mimics the powerline appearance." tar ((:commit . "abcb0ab6f7110a03d6c7428bae67cf8731496433") (:authors ("Artur Malabarba" . "bruce.connor.am@gmail.com")) (:maintainer "Artur Malabarba" . "bruce.connor.am@gmail.com") (:keywords "mode-line" "faces" "themes") (:url . "http://github.com/Bruce-Connor/smart-mode-line"))])
+ (smart-newline . [(20131208 340) nil "Provide smart newline for one keybind." single ((:commit . "0553a9e4be7188352de1a28f2eddfd28e7436f94") (:authors ("Satoshi Namai")) (:maintainer "Satoshi Namai"))])
+ (smart-region . [(20150903 1403) ((emacs (24 4)) (expand-region (0 10 0)) (multiple-cursors (1 3 0)) (cl-lib (0 5))) "Smartly select region, rectangle, multi cursors" single ((:commit . "5a8017fd8e8dc3483865951c4942cab3f96f69f6") (:authors ("Yuuki Arisawa" . "yuuki.ari@gmail.com")) (:maintainer "Yuuki Arisawa" . "yuuki.ari@gmail.com") (:keywords "marking" "region") (:url . "https://github.com/uk-ar/smart-region"))])
+ (smart-semicolon . [(20200909 1412) ((emacs (26))) "Insert semicolon smartly" single ((:commit . "2c140accd576062f69dbe7db1d43ba038b347b9b") (:authors ("Iku Iwasa" . "iku.iwasa@gmail.com")) (:maintainer "Iku Iwasa" . "iku.iwasa@gmail.com") (:url . "https://github.com/iquiw/smart-semicolon"))])
+ (smart-shift . [(20150203 725) nil "Smart shift text left/right." single ((:commit . "a26ab2b240137e62ec4bce1698ed9c5f7b6d13ae") (:authors ("Bin Huang" . "huangbin88@foxmail.com")) (:maintainer "Bin Huang" . "huangbin88@foxmail.com") (:keywords "convenience" "tools") (:url . "https://github.com/hbin/smart-shift"))])
+ (smart-tab . [(20210530 1743) ((emacs (24 3))) "Intelligent tab completion and indentation" single ((:commit . "2f1b4073904805c8454ebc9bc967b23836a2d577") (:authors ("John SJ Anderson" . "john@genehack.org") ("Sebastien Rocca Serra" . "sroccaserra@gmail.com") ("Daniel Hackney" . "dan@haxney.org")) (:maintainer "John SJ Anderson" . "john@genehack.org") (:keywords "extensions") (:url . "https://git.genehack.net/genehack/smart-tab"))])
+ (smart-tabs-mode . [(20200907 2025) nil "Intelligently indent with tabs, align with spaces!" single ((:commit . "1044c17e42479de943e69cdeb85e4d05ad9cca8c") (:authors ("John Croisant" . "jacius@gmail.com") ("Alan Pearce" . "alan@alanpearce.co.uk") ("Daniel Dehennin" . "daniel.dehennin@baby-gnu.org") ("Matt Renaud" . "mrenaud92@gmail.com")) (:maintainer "Joel C. Salomon" . "joelcsalomon@gmail.com") (:keywords "languages") (:url . "http://www.emacswiki.org/emacs/SmartTabs"))])
+ (smart-window . [(20160717 130) ((cl-lib (0 5))) "vim-like window controlling plugin" single ((:commit . "5996461b7cbc5ab4509ac48537916eb29a8e4c16") (:authors ("Felix Chern" . "idryman@gmail.com")) (:maintainer "Felix Chern" . "idryman@gmail.com") (:keywords "window") (:url . "https://github.com/dryman/smart-window.el"))])
+ (smartparens . [(20220204 1134) ((dash (2 13 0)) (cl-lib (0 3))) "Automatic insertion, wrapping and paredit-like navigation with user defined pairs." tar ((:commit . "37f77bf2e2199be9fe27e981317b02cfd0e8c70e") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "abbrev" "convenience" "editing") (:url . "https://github.com/Fuco1/smartparens"))])
+ (smartrep . [(20150509 230) nil "Support sequential operation which omitted prefix keys." single ((:commit . "f0ff5a6d7b8603603598ae3045c98b011e58d86e") (:authors ("myuhe <yuhei.maeda_at_gmail.com>")) (:maintainer "myuhe") (:keywords "convenience") (:url . "https://github.com/myuhe/smartrep.el"))])
+ (smartscan . [(20170211 2033) nil "Jumps between other symbols found at point" single ((:commit . "234e077145710a174c20742de792b97ed2f965f6") (:authors ("Mickey Petersen" . "mickey@masteringemacs.org")) (:maintainer "Mickey Petersen" . "mickey@masteringemacs.org") (:keywords "extensions"))])
+ (smarty-mode . [(20100703 1158) nil "major mode for editing smarty templates" single ((:commit . "3dfdfe1571f5e9ef55a29c51e5a80046d4cb7568") (:maintainer "Benj Carson") (:keywords "smarty" "php" "languages" "templates") (:url . "none yet"))])
+ (smbc . [(20171229 1808) nil "View SMBC from Emacs" single ((:commit . "10538e3d575ba6ef3c94d555af2744b42dfd36c7") (:authors ("Saksham Sharma" . "saksham0808@gmail.com")) (:maintainer "Saksham Sharma" . "saksham0808@gmail.com") (:keywords "smbc" "webcomic") (:url . "https://github.com/sakshamsharma/emacs-smbc"))])
+ (smblog . [(20200424 938) ((emacs (24 3))) "samba log viewer" single ((:commit . "fc949cff7051b31f0dbc7169774144533a27b92f") (:authors ("Aurélien Aptel" . "aaptel@suse.com")) (:maintainer "Aurélien Aptel" . "aaptel@suse.com") (:url . "http://github.com/aaptel/smblog-mode"))])
+ (smeargle . [(20200323 533) ((emacs (24 3))) "Highlighting region by last updated time" single ((:commit . "afe34e7e3ce811d44880bca11f9fe1e3d91e272f") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Neil Okamoto" . "neil.okamoto+melpa@gmail.com") (:url . "https://github.com/emacsorphanage/smeargle"))])
+ (smex . [(20151212 2209) ((emacs (24))) "M-x interface with Ido-style fuzzy matching." single ((:commit . "55aaebe3d793c2c990b39a302eb26c184281c42c") (:authors ("Cornelius Mika" . "cornelius.mika@gmail.com")) (:maintainer "Cornelius Mika" . "cornelius.mika@gmail.com") (:keywords "convenience" "usability") (:url . "http://github.com/nonsequitur/smex/"))])
+ (smiles-mode . [(20220210 1413) nil "Major mode for SMILES." single ((:commit . "950a8b3224f8f069c82faeb0282d041f872d5550") (:authors (nil . "John Kitchin [jkitchin@andrew.cmu.edu]")) (:maintainer nil . "John Kitchin [jkitchin@andrew.cmu.edu]") (:keywords "smiles") (:url . "https://repo.or.cz/smiles-mode.git"))])
+ (smithers . [(20210531 2232) ((emacs (26 1)) (dash (2 17 0)) (org (9 4 5))) "A startup message featuring Mr C.M. Burns" tar ((:commit . "db9ed12a8d2c131b6d37b4e7aff01b8e3cec81a6") (:authors ("Mehmet Tekman")) (:maintainer "Mehmet Tekman") (:keywords "games") (:url . "https://gitlab.com/mtekman/smithers.el"))])
+ (sml-basis . [(20210518 2040) ((emacs (24 5))) "Standard ML Basis Library lookup" tar ((:commit . "c048d575e30a20ec825fd0c5eb9c8a4428a43298") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "languages" "util") (:url . "https://github.com/lassik/emacs-sml-basis"))])
+ (sml-modeline . [(20170614 2111) nil "Show position in a scrollbar like way in mode-line" single ((:commit . "d2f9f70174c4cf68c67eb3bb8088235735e34d9a") (:authors ("Lennart Borgman (lennart O borgman A gmail O com)")) (:maintainer "Lennart Borgman (lennart O borgman A gmail O com)") (:url . "http://bazaar.launchpad.net/~nxhtml/nxhtml/main/annotate/head%3A/util/sml-modeline.el"))])
+ (smmry . [(20161024 901) nil "SMMRY client" single ((:commit . "986a1b0aec8ab1ef17dbfb7886f47e5558cf738a") (:authors ("james sangho nah" . "microamp@protonmail.com")) (:maintainer "james sangho nah" . "microamp@protonmail.com") (:keywords "api" "smmry") (:url . "https://github.com/microamp/smmry.el"))])
+ (smog . [(20220405 251) ((emacs (24 1)) (org (8 1))) "Analyse the writing style, word use and readability of prose" single ((:commit . "28b053198ff9c1b142789614d85d7d762d9b0fa3") (:authors ("nik gaffney" . "nik@fo.am")) (:maintainer "nik gaffney" . "nik@fo.am") (:keywords "tools" "style" "readability" "prose") (:url . "https://github.com/zzkt/smog"))])
+ (smooth-scroll . [(20130322 414) nil "Minor mode for smooth scrolling and in-place scrolling." single ((:commit . "02320f28abb5cae28b3a18f6b9ce93129bdbfc45") (:authors ("K-talo Miyazaki <Keitaro dot Miyazaki at gmail dot com>")) (:maintainer "K-talo Miyazaki <Keitaro dot Miyazaki at gmail dot com>") (:keywords "convenience" "emulations" "frames") (:url . "http://www.emacswiki.org/emacs/download/smooth-scroll.el"))])
+ (smooth-scrolling . [(20161002 1949) nil "Make emacs scroll smoothly" single ((:commit . "2462c13640aa4c75ab3ddad443fedc29acf68f84") (:authors ("Adam Spiers" . "emacs-ss@adamspiers.org") ("Jeremy Bondeson" . "jbondeson@gmail.com") ("Ryan C. Thompson" . "rct+github@thompsonclan.org")) (:maintainer "Adam Spiers" . "emacs-ss@adamspiers.org") (:keywords "convenience") (:url . "http://github.com/aspiers/smooth-scrolling/"))])
+ (smotitah . [(20150218 1030) nil "Modular emacs configuration framework" tar ((:commit . "f9ab562128a5460549d016913533778e8c94bcf3") (:authors ("Alessandro Piras" . "laynor@gmail.com")) (:maintainer "Alessandro Piras" . "laynor@gmail.com") (:keywords "configuration"))])
+ (smtpmail-multi . [(20160218 2349) nil "Use different smtp servers for sending mail" single ((:commit . "83fa9d7a02e000be95cb282c8b48446646896ea1") (:authors ("Joe Bloggs" . "vapniks@yahoo.com")) (:maintainer "Joe Bloggs" . "vapniks@yahoo.com") (:keywords "comm") (:url . "https://github.com/vapniks/smtpmail-multi"))])
+ (smudge . [(20210326 2222) ((emacs (27 1)) (simple-httpd (1 5)) (request (0 3)) (oauth2 (0 16))) "Control the Spotify app" tar ((:commit . "9e3488f485b7d7f3c97ebaad34ed552bb0cc228a") (:keywords "multimedia" "music" "spotify" "smudge") (:url . "https://github.com/danielfm/smudge"))])
+ (smyx-theme . [(20141127 828) nil "smyx Color Theme" single ((:commit . "6263f6b401bbabaed388c8efcfc0be2e58c51401") (:authors ("Uriel G Maldonado" . "uriel781@gmail.com")) (:maintainer "Uriel G Maldonado" . "uriel781@gmail.com") (:keywords "color" "theme" "smyx"))])
+ (snakemake-mode . [(20220223 218) ((emacs (26 1)) (transient (0 3 0))) "Major mode for editing Snakemake files" tar ((:commit . "0dfeaff6079558c39081c2c078c41369da01903b") (:authors ("Kyle Meyer" . "kyle@kyleam.com")) (:maintainer "Kyle Meyer" . "kyle@kyleam.com") (:keywords "tools") (:url . "https://git.kyleam.com/snakemake-mode/about"))])
+ (snapshot-timemachine . [(20161221 929) ((emacs (24 4))) "Step through (Btrfs, ZFS, ...) snapshots of files" single ((:commit . "99efcebab309b11ed512a8dc62555d3834df5efb") (:authors ("Thomas Winant" . "dewinant@gmail.com")) (:maintainer "Thomas Winant" . "dewinant@gmail.com") (:url . "https://github.com/mrBliss/snapshot-timemachine"))])
+ (snapshot-timemachine-rsnapshot . [(20170324 1213) ((snapshot-timemachine (20160222 132)) (seq (2 19))) "rsnapshot backend for snapshot-timemachine" single ((:commit . "72b0b700d80f1a0442e62bbbb6a0c8c59182f97f") (:authors ("Nicolas Petton" . "nicolas@petton.fr")) (:maintainer "Nicolas Petton" . "nicolas@petton.fr"))])
+ (snazzy-theme . [(20170823 1832) ((emacs (24)) (base16-theme (2 1))) "An elegant syntax theme with bright colors" single ((:commit . "57a1763b49b4a776084c16bc70c219246fa5b412") (:keywords "faces" "theme" "color" "snazzy") (:url . "https://github.com/weijiangan/emacs-snazzy/"))])
+ (sniem . [(20220404 307) ((emacs (27 1)) (s (2 12 0)) (dash (1 12 0))) "Hands-eased united editing method" tar ((:commit . "afe4286dec79ef45a42a343033f69d90dd308535") (:authors ("SpringHan")) (:maintainer "SpringHan") (:keywords "convenience" "united-editing-method") (:url . "https://github.com/SpringHan/sniem.git"))])
+ (snitch . [(20210202 1730) ((emacs (27 1))) "An Emacs firewall" tar ((:commit . "3b3e7f1bf612c4624764d1ec4b1a96e4d2850b05") (:authors ("Trevor Bentley" . "snitch.el@x.mrmekon.com")) (:maintainer "Trevor Bentley" . "snitch.el@x.mrmekon.com") (:keywords "processes" "comm") (:url . "https://github.com/mrmekon/snitch-el"))])
+ (snoopy . [(20171008 2004) ((emacs (24)) (cl-lib (0 6))) "minor mode for number row unshifted character insertion" single ((:commit . "ec4123bdebfe0bb7bf4feaac2dc02b59caffe386") (:authors ("António Nuno Monteiro" . "anmonteiro@gmail.com")) (:maintainer "António Nuno Monteiro" . "anmonteiro@gmail.com") (:keywords "lisp"))])
+ (snow . [(20210813 1902) ((emacs (26 3))) "Let it snow in Emacs!" single ((:commit . "4cd41a703b730a6b59827853f06b98d91405df5a") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "games") (:url . "https://github.com/alphapapa/snow.el"))])
+ (soar-mode . [(20190503 1843) nil "A major mode for the Soar language" single ((:commit . "13b6fca62ea6574d230516fddf359a61f6558ecd") (:keywords "languages" "soar") (:url . "https://github.com/adeschamps/soar-mode"))])
+ (soccer . [(20211207 1623) ((emacs (26 1)) (dash (2 19 1))) "Fixtures, results, table etc for soccer" tar ((:commit . "b5ba10fe43e43fa40617e2936572add10c72b865") (:authors ("Md Arif Shaikh" . "arifshaikh.astro@gmail.com")) (:maintainer "Md Arif Shaikh" . "arifshaikh.astro@gmail.com") (:keywords "games" "soccer" "football") (:url . "https://github.com/md-arif-shaikh/soccer"))])
+ (socyl . [(20170212 642) ((s (1 11 0)) (dash (2 12 0)) (pkg-info (0 5 0)) (cl-lib (0 5))) "Frontend for several search tools" tar ((:commit . "1ef2da42f66f3ab31a34131e51648f352416f0ba") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "ripgrep" "sift" "ack" "pt" "ag" "grep" "search") (:url . "https://github.com/nlamirault/socyl"))])
+ (soft-charcoal-theme . [(20140420 1643) nil "Dark charcoal theme with soft colors" single ((:commit . "5607ab977fae6638e78b1495e02da8955c9ba19f") (:authors ("Martin Haesler")) (:maintainer "Martin Haesler") (:url . "http://github.com/mswift42/soft-charcoal-theme"))])
+ (soft-morning-theme . [(20150918 2041) nil "Emacs24 theme with a light background." single ((:commit . "c0f9c70c97ef2be2a093cf839c4bfe27740a111c") (:authors ("Martin Haesler")) (:maintainer "Martin Haesler") (:url . "http://github.com/mswift42/soft-morning-theme"))])
+ (soft-stone-theme . [(20140614 835) ((emacs (24))) "Emacs 24 theme with a light background." single ((:commit . "fb475514cfb02cf30ce358a61c48e46614344d48") (:authors ("Martin Haesler")) (:maintainer "Martin Haesler") (:url . "http://github.com/mswift42/soft-stone-theme"))])
+ (solaire-mode . [(20211213 102) ((emacs (25 1)) (cl-lib (0 5))) "make certain buffers grossly incandescent" single ((:commit . "8af65fbdc50b25ed3214da949b8a484527c7cc14") (:authors ("Henrik Lissner <http://github/hlissner>")) (:maintainer "Henrik Lissner" . "contact@henrik.io") (:keywords "dim" "bright" "window" "buffer" "faces") (:url . "https://github.com/hlissner/emacs-solaire-mode"))])
+ (solarized-theme . [(20220324 445) ((emacs (24 1))) "The Solarized color theme" tar ((:commit . "86e5f94ea033c8b2a21084774063a493b62a4e81") (:authors ("Bozhidar Batsov" . "bozhidar@batsov.dev")) (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev") (:keywords "convenience" "themes" "solarized") (:url . "http://github.com/bbatsov/solarized-emacs"))])
+ (solidity-flycheck . [(20210411 758) ((flycheck (32 -4)) (solidity-mode (0 1 9)) (dash (2 17 0))) "Flycheck integration for solidity emacs mode" single ((:commit . "20fb77e089e10187b37ae1a94153017b82ed2a0a") (:authors ("Lefteris Karapetsas " . "lefteris@refu.co")) (:maintainer "Lefteris Karapetsas " . "lefteris@refu.co") (:keywords "languages" "solidity" "flycheck"))])
+ (solidity-mode . [(20220308 1517) nil "Major mode for ethereum's solidity language" tar ((:commit . "20fb77e089e10187b37ae1a94153017b82ed2a0a") (:authors ("Lefteris Karapetsas " . "lefteris@refu.co")) (:maintainer "Lefteris Karapetsas " . "lefteris@refu.co") (:keywords "languages" "solidity"))])
+ (solo-jazz-theme . [(20220117 2009) ((emacs (24 1))) "The Solo-Jazz color theme" single ((:commit . "51d63d8a2c855f4ea79eef9fc9c8a5c9702642c4") (:authors ("Carl Steib")) (:maintainer "Carl Steib") (:url . "https://github.com/cstby/solo-jazz-emacs-theme"))])
+ (somafm . [(20220402 2131) ((emacs (26 1)) (dash (2 12 0)) (request (0 3 2)) (cl-lib (0 6 1))) "A simple soma.fm interface" single ((:commit . "90b661fb1abc652feb6508eb61735919d02e9687") (:authors ("Arte Ebrahimi <>")) (:maintainer "Arte Ebrahimi <>") (:keywords "multimedia") (:url . "https://github.com/artenator/somafm.el"))])
+ (sonic-pi . [(20211214 1242) ((cl-lib (0 5)) (osc (0 1)) (dash (2 2 0)) (emacs (24)) (highlight (0))) "A Emacs client for SonicPi" tar ((:commit . "9ae16d0fd4cba77ae0bedac83f2cb46569be6ade") (:authors ("Joseph Wilk" . "joe@josephwilk.net")) (:maintainer "Joseph Wilk" . "joe@josephwilk.net") (:keywords "sonicpi" "ruby") (:url . "http://www.github.com/repl-electric/sonic-pi.el"))])
+ (soothe-theme . [(20141027 1441) ((emacs (24 1))) "a dark colorful theme for Emacs24." single ((:commit . "0786fe70c6c1b4ddcfb932fdc6862b9611cfc09b") (:authors ("Jason Milkins" . "jasonm23@gmail.com")) (:maintainer "Jason Milkins" . "jasonm23@gmail.com") (:url . "https://github.com/jasonm23/emacs-soothe-theme"))])
+ (sorcery-theme . [(20210101 1352) ((autothemer (0 2))) "A D&D (Dark and Dusty) Theme" single ((:commit . "5a1c4445b9e6e09589a299a9962a6973272a0c2f") (:authors ("Maxime Tréca" . "maxime@gmail.com")) (:maintainer "Maxime Tréca" . "maxime@gmail.com") (:url . "http://github.com/vxid/emacs-theme-sorcery"))])
+ (soria-theme . [(20220127 1004) ((emacs (25 1))) "A xoria256 theme with some colors from openSUSE" tar ((:commit . "2db1859743fe9fc58eab4e6f6c1e37825ad7b69c") (:authors ("Miquel Sabaté Solà" . "mikisabate@gmail.com")) (:maintainer "Miquel Sabaté Solà" . "mikisabate@gmail.com") (:keywords "faces") (:url . "https://github.com/mssola/soria"))])
+ (sort-words . [(20160929 1335) nil "Sort words in a selected region" single ((:commit . "7b6e108f80237363faf7ec28b2c58dec270b8601") (:authors ("\"Aleksandar Simic\"" . "asimic@gmail.com")) (:maintainer "\"Aleksandar Simic\"" . "asimic@gmail.com") (:keywords "tools") (:url . "http://github.org/dotemacs/sort-words.el"))])
+ (sotclojure . [(20170922 8) ((emacs (24 1)) (clojure-mode (4 0 0)) (cider (0 8)) (sotlisp (1 3))) "Write clojure at the speed of thought." tar ((:commit . "a480c887b53cb007b7b099c5ffcab89b9e59d7bc") (:authors ("Artur Malabarba" . "emacs@endlessparentheses.com")) (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com") (:keywords "convenience" "clojure") (:url . "https://github.com/Malabarba/speed-of-thought-clojure"))])
+ (sotlisp . [(20190211 2026) ((emacs (24 1))) "Write lisp at the speed of thought." single ((:commit . "ed2356a325c7a4a88ec1bd31381c8666e8997e97") (:authors ("Artur Malabarba" . "emacs@endlessparentheses.com")) (:maintainer "Artur Malabarba" . "emacs@endlessparentheses.com") (:keywords "convenience" "lisp") (:url . "https://github.com/Malabarba/speed-of-thought-lisp"))])
+ (sound-wav . [(20200323 728) ((deferred (0 3 1)) (cl-lib (0 5))) "Play wav file" single ((:commit . "112450888f3f90f0f2a0e43e49eb5a7e49b1b6db") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-sound-wav"))])
+ (soundcloud . [(20150502 326) ((emms (20131016)) (json (1 2)) (deferred (0 3 1)) (string-utils (0 3 2)) (request (20140316 417)) (request-deferred (20130526 1015))) "a SoundCloud client for Emacs" single ((:commit . "f998d4276ea90258909c698f6a5a51fccb667c08") (:authors ("Travis Thieman" . "travis.thieman@gmail.com")) (:maintainer "Travis Thieman" . "travis.thieman@gmail.com") (:keywords "soundcloud" "music" "audio"))])
+ (soundklaus . [(20191220 2112) ((dash (2 12 1)) (emacs (24)) (emms (4 0)) (s (1 11 0)) (pkg-info (0 4)) (cl-lib (0 5)) (request (0 2 0))) "Play music on SoundCloud with Emacs via EMMS" tar ((:commit . "15ce6e7f24a45e4f202d83cca9fa3bfdd94ca592") (:authors ("r0man" . "roman@burningswell.com")) (:maintainer "r0man" . "roman@burningswell.com") (:keywords "soundcloud" "music" "emms") (:url . "https://github.com/r0man/soundklaus.el"))])
+ (sourcekit . [(20210430 2155) ((emacs (24 3)) (dash (2 18 0)) (request (0 2 0))) "Library to interact with sourcekittendaemon" single ((:commit . "a1860ad4dd3a542acd2fa0dfac2a388cbdf4af0c") (:authors ("Nathan Kot" . "nk@nathankot.com")) (:maintainer "Nathan Kot" . "nk@nathankot.com") (:keywords "tools" "processes") (:url . "https://github.com/nathankot/company-sourcekit"))])
+ (sourcemap . [(20200315 1037) ((emacs (24 3))) "Sourcemap parser" single ((:commit . "bb2a56b2feb62b0c77d7f03ef2acd94f91be6b3f") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-sourcemap"))])
+ (sourcerer-theme . [(20161014 1625) nil "A version of sourcerer by xero" single ((:commit . "c7f8e665d53bb48fb72f95f706710d53d24bd407") (:authors ("Bryan Gilbert" . "gilbertw1@gmail.com")) (:maintainer "Bryan Gilbert" . "gilbertw1@gmail.com") (:keywords "themes") (:url . "http://github.com/gilbertw1/sourcerer-emacs"))])
+ (space-theming . [(20200502 1032) ((emacs (24))) "Easilly override theme faces" single ((:commit . "31dca6954df643255175f7df68a86892aa3c71a7") (:keywords "faces") (:url . "https://github.com/p3r7/space-theming"))])
+ (spacebar . [(20190719 334) ((eyebrowse (0 7 7)) (emacs (25 4 0))) "Workspaces Bar" single ((:commit . "2b2cd0e786877273103f048e62a06b0027deca2d") (:authors ("Matthias Margush" . "matthias.margush@gmail.com")) (:maintainer "Matthias Margush" . "matthias.margush@gmail.com") (:keywords "convenience") (:url . "https://github.com/matthias-margush/spacebar"))])
+ (spacegray-theme . [(20150719 1931) ((emacs (24 1))) "A Hyperminimal UI Theme" single ((:commit . "9826265c2bceb2ebc1c5e16a45021da0253ace97") (:authors ("Bruce Williams" . "brwcodes@gmail.com")) (:maintainer "Bruce Williams" . "brwcodes@gmail.com") (:keywords "themes") (:url . "http://github.com/bruce/emacs-spacegray-theme"))])
+ (spaceline . [(20211120 1636) ((emacs (24 4)) (cl-lib (0 5)) (powerline (2 3)) (dash (2 11 0)) (s (1 10 0))) "Modeline configuration library for powerline" tar ((:commit . "9a81afa52738544ad5e8b71308a37422ca7e25ba") (:authors ("Eivind Fonn" . "evfonn@gmail.com")) (:maintainer "Eivind Fonn" . "evfonn@gmail.com") (:keywords "mode-line" "powerline" "spacemacs") (:url . "https://github.com/TheBB/spaceline"))])
+ (spaceline-all-the-icons . [(20190325 1602) ((emacs (24 4)) (all-the-icons (2 6 0)) (spaceline (2 0 0)) (memoize (1 0 1))) "A Spaceline theme using All The Icons" tar ((:commit . "5afd48c10f1bd42d9b9648c5e64596b72f3e9042") (:authors ("Dominic Charlesworth" . "dgc336@gmail.com")) (:maintainer "Dominic Charlesworth" . "dgc336@gmail.com") (:keywords "convenience" "lisp" "tools") (:url . "https://github.com/domtronn/spaceline-all-the-icons.el"))])
+ (spacemacs-theme . [(20220430 2248) nil "Color theme with a dark and light versions" tar ((:commit . "bd376f705d6eb7afd9a1dfa0c1bd407e869d1e9f"))])
+ (spaces . [(20170809 2208) nil "Create and switch between named window configurations." single ((:commit . "6bdb51e9a346907d60a9625f6180bddd06be6674") (:authors ("Steven Thomas")) (:maintainer "Steven Thomas") (:keywords "frames" "convenience") (:url . "https://github.com/chumpage/chumpy-windows"))])
+ (spark . [(20211021 1832) ((emacs (24 3))) "sparkline generation" single ((:commit . "c9af24a169b1f1aeba175f1f8d51abda113639af") (:authors ("Alvin Francis Dumalus")) (:maintainer "Alvin Francis Dumalus") (:keywords "lisp" "data") (:url . "https://github.com/alvinfrancis/spark"))])
+ (sparkline . [(20150101 1319) ((cl-lib (0 3))) "Make sparkline images from a list of numbers" single ((:commit . "a2b5d817d272d6363b67ed8f8cc75499a19fa8d2") (:authors ("Willem Rein Oudshoorn" . "woudshoo@xs4all.nl")) (:maintainer "Willem Rein Oudshoorn" . "woudshoo@xs4all.nl") (:keywords "extensions"))])
+ (sparql-mode . [(20210701 1202) ((cl-lib (0 5)) (emacs (24 3))) "Edit and interactively evaluate SPARQL queries." tar ((:commit . "ceb370b3879841f8809cc3f9b1b87e898f10562f") (:authors ("Craig Andera <candera at wangdera dot com>")) (:maintainer "Bjarte Johansen <Bjarte dot Johansen at gmail dot com>") (:url . "https://github.com/ljos/sparql-mode"))])
+ (spatial-navigate . [(20220507 1118) ((emacs (26 2))) "Directional navigation between white-space blocks" single ((:commit . "09ebd2ba7779998c31296bf8b6ffebf854f3eb73") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://codeberg.com/ideasman42/emacs-spatial-navigate"))])
+ (spdx . [(20220509 141) ((emacs (24 4))) "Insert SPDX license and copyright headers" tar ((:commit . "9c054f6c86797ece9079e46662ea16b7ac6af790") (:authors ("Zhiwei Chen" . "condy0919@gmail.com")) (:maintainer "Zhiwei Chen" . "condy0919@gmail.com") (:keywords "license" "tools") (:url . "https://github.com/condy0919/spdx.el"))])
+ (speech-tagger . [(20170728 1829) ((cl-lib (0 5))) "tag parts of speech using coreNLP" tar ((:commit . "61955b40d4e8b09e66a3e8033e82893f81657c06") (:authors ("Danny McClanahan" . "danieldmcclanahan@gmail.com")) (:maintainer "Danny McClanahan" . "danieldmcclanahan@gmail.com") (:keywords "speech" "tag" "nlp" "language" "corenlp" "parsing" "natural") (:url . "https://github.com/cosmicexplorer/speech-tagger"))])
+ (speechd-el . [(20211231 758) nil "Client to speech synthesizers and Braille displays." tar ((:commit . "a4be22b5b62a6be1e749df6f64b06e16a6b09790") (:authors ("Milan Zamazal" . "pdm@zamazal.org")) (:maintainer "Milan Zamazal" . "pdm@zamazal.org"))])
+ (speed-type . [(20191204 1107) ((emacs (24 3)) (cl-lib (0 3))) "Practice touch and speed typing" single ((:commit . "5ef695f7159aa1f20c7c9e55f0c39bcdacce8d21") (:authors ("Gunther Hagleitner")) (:maintainer "Julien Pagès" . "j.parkouss@gmail.com") (:keywords "games") (:url . "https://github.com/parkouss/speed-type"))])
+ (speedbar-git-respect . [(20200901 246) ((f (0 8 0)) (emacs (25 1))) "Particular respect git repo in speedbar" single ((:commit . "dd8f0849fc1dd21b42380e1a8c28a9a29acd9511") (:authors ("Muromi Ukari" . "chendianbuji@gmail.com")) (:maintainer "Muromi Ukari" . "chendianbuji@gmail.com") (:url . "https://github.com/ukari/speedbar-git-respect"))])
+ (speeddating . [(20180319 723) ((emacs (25))) "Increase date and time at point" single ((:commit . "df69db0560f19636a66a74f3d88c793bbb18b21e") (:authors ("Xu Chunyang" . "mail@xuchunyang.me")) (:maintainer "Xu Chunyang" . "mail@xuchunyang.me") (:keywords "date" "time") (:url . "https://github.com/xuchunyang/emacs-speeddating"))])
+ (spell-fu . [(20220507 1118) ((emacs (26 2))) "Fast & light spelling highlighter" single ((:commit . "2f2fd6de0003edb1038b7c639cf23264d1406993") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:keywords "convenience") (:url . "https://codeberg.com/ideasman42/emacs-spell-fu"))])
+ (sphinx-doc . [(20210213 1250) ((s (1 9 0)) (cl-lib (0 5)) (dash (2 10 0))) "Sphinx friendly docstrings for Python functions" single ((:commit . "1eda612a44ef027e5229895daa77db99a21b8801") (:authors ("Vineet Naik" . "naikvin@gmail.com")) (:maintainer "Vineet Naik" . "naikvin@gmail.com") (:keywords "sphinx" "python") (:url . "https://github.com/naiquevin/sphinx-doc.el"))])
+ (sphinx-frontend . [(20161025 758) nil "Launch build process for rst documents via sphinx." single ((:commit . "0cbb03361c245382d3e679dded30c4fc1713c252") (:authors ("Kostafey" . "kostafey@gmail.com")) (:maintainer "Kostafey" . "kostafey@gmail.com") (:keywords "compile" "sphinx" "restructuredtext") (:url . "https://github.com/kostafey/sphinx-frontend"))])
+ (sphinx-mode . [(20220417 1552) ((f (0 20 0)) (dash (2 14 1))) "Minor mode providing sphinx support." tar ((:commit . "77ca51adf9ee877f3a8f43e744f59e650772f121") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "languages"))])
+ (spice-mode . [(20220210 1414) ((emacs (24 3))) "Major mode for SPICE" single ((:commit . "f55c2b6dd35caace0ec7250b5c7b5d119235a23d") (:authors ("Geert A. M. Van der Plas" . "geert_vanderplas@email.com") ("Emmanuel Rouat" . "emmanuel.rouat@wanadoo.fr") ("Carlin J. Vieri, MIT AI Lab" . "cvieri@ai.mit.edu")) (:maintainer "Geert A. M. Van der Plas" . "geert_vanderplas@email.com") (:keywords "spice" "spice2g6" "spice3" "eldo" "hspice" "layla" "mondriaan" "fasthenry" "cdl" "spectre compatibility" "netlist editing") (:url . "https://repo.or.cz/spice-mode.git"))])
+ (spiral . [(20180223 1140) ((emacs (25 1)) (a (0 1 0 -3 4)) (avy (0 4 0)) (clojure-mode (5 6 0)) (highlight (0)) (treepy (1 0 0))) "Clojure IDE based on UNREPL" tar ((:commit . "907b9792467139a942ba7b07ca0276b90770baf9") (:authors ("Daniel Barreto" . "daniel@barreto.tech")) (:maintainer "Daniel Barreto" . "daniel@barreto.tech") (:keywords "languages" "clojure") (:url . "https://github.com/Unrepl/spiral"))])
+ (splitjoin . [(20150505 1432) ((cl-lib (0 5))) "Transition between multiline and single-line code" single ((:commit . "e2945ee269e6e90f0243d6f2a33e067bb0a2873c") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-splitjoin"))])
+ (splitter . [(20170809 2208) nil "Manage window splits" single ((:commit . "6bdb51e9a346907d60a9625f6180bddd06be6674") (:authors ("Steven Thomas")) (:maintainer "Steven Thomas") (:keywords "frames" "convenience") (:url . "https://github.com/chumpage/chumpy-windows"))])
+ (spotify . [(20200615 1418) ((cl-lib (0 5))) "Control the spotify application from emacs" single ((:commit . "7e28ef0b4519c6a46fce6a89c0ff1ed775eda71a") (:authors ("R.W. van 't Veer")) (:maintainer "R.W. van 't Veer") (:keywords "convenience") (:url . "https://github.com/remvee/spotify-el"))])
+ (spotlight . [(20200109 2137) ((emacs (24 1)) (swiper (0 6 0)) (counsel (0 6 0))) "search files with Mac OS X spotlight" single ((:commit . "ea71f4fd380c51e50c47bb25855af4f40e4d8da0") (:authors ("Ben Maughan" . "benmaughan@gmail.com")) (:maintainer "Ben Maughan" . "benmaughan@gmail.com") (:keywords "search" "external") (:url . "http://www.pragmaticemacs.com"))])
+ (spray . [(20160304 2220) nil "a speed reading mode" single ((:commit . "74d9dcfa2e8b38f96a43de9ab0eb13364300cb46") (:authors ("Ian Kelling" . "ian@iankelling.org")) (:maintainer "Ian Kelling" . "ian@iankelling.org") (:keywords "convenience") (:url . "https://github.com/ian-kelling/spray"))])
+ (springboard . [(20170106 755) ((helm (1 6 9))) "Temporarily change default-directory for one command" single ((:commit . "687d1e5898a880878995dc9bffe93b4598366203") (:authors ("John Wiegley" . "jwiegley@gmail.com")) (:maintainer "John Wiegley" . "jwiegley@gmail.com") (:keywords "helm") (:url . "https://github.com/jwiegley/springboard"))])
+ (sprintly-mode . [(20121006 534) ((furl (0 0 2))) "Major mode for dealing with sprint.ly" single ((:commit . "6695892bae5860b5268bf3ae62be990ee9b63c11") (:authors ("Justin Lilly" . "justin@justinlilly.com")) (:maintainer "Justin Lilly" . "justin@justinlilly.com") (:url . "https://github.com/sprintly/sprintly-mode"))])
+ (sproto-mode . [(20151115 1805) nil "Major mode for editing sproto." single ((:commit . "0583a88273204dccd884b7edaa3590cefd31e7f7") (:authors ("m2q1n9")) (:maintainer "m2q1n9") (:keywords "sproto"))])
+ (sprunge . [(20160301 243) ((request (0 2 0)) (cl-lib (0 5))) "Upload pastes to sprunge.us" single ((:commit . "0fd386b8b29c4175022a04ad70ea5643185b6726") (:authors ("Tom Jakubowski")) (:maintainer "Tom Jakubowski") (:keywords "tools"))])
+ (spu . [(20161214 324) ((emacs (24 4)) (signal (1 0)) (timp (1 2 0))) "Silently upgrade package in the background" tar ((:commit . "41eec86b595816e3852e8ad1a8e07e51a27fd065") (:authors ("Mola-T" . "Mola@molamola.xyz")) (:maintainer "Mola-T" . "Mola@molamola.xyz") (:keywords "convenience" "package") (:url . "https://github.com/mola-T/spu"))])
+ (sql-clickhouse . [(20191209 1443) ((emacs (24))) "support ClickHouse as SQL interpreter" single ((:commit . "8403a4a5d332dbb6459b7fbce6ea95c36d390a5b") (:authors ("Robert Schwarz" . "mail@rschwarz.net")) (:maintainer "Robert Schwarz" . "mail@rschwarz.net") (:url . "https://github.com/leethargo/sql-clickhouse"))])
+ (sql-impala . [(20181218 410) nil "comint support for Cloudera Impala" single ((:commit . "466e7c0c789ec3e5e8a276c8f6754f91bb584c3e") (:authors ("Jason Terk" . "jason@goterkyourself.com")) (:maintainer "Jason Terk" . "jason@goterkyourself.com") (:keywords "sql" "impala") (:url . "https://github.com/jterk/sql-impala"))])
+ (sql-presto . [(20190113 1742) ((emacs (24 4))) "No description available." single ((:commit . "bcda455e300a1af75c7bb805882329bc844703b2") (:authors ("Katherine Cox-Buday" . "cox.katherine.e@gmail.com")) (:maintainer "Katherine Cox-Buday" . "cox.katherine.e@gmail.com") (:keywords "sql" "presto" "database"))])
+ (sql-sqlline . [(20201102 1508) ((emacs (24 4))) "Adds SQLLine support to SQLi mode" single ((:commit . "38baf140cae26f9d93fc45d5eaff7d5c7f050bff") (:authors ("Matteo Redaelli" . "matteo.redaelli@gmail.com")) (:maintainer "Matteo Redaelli" . "matteo.redaelli@gmail.com") (:keywords "languages") (:url . "https://gitlab.com/matteoredaelli/sql-sqlline"))])
+ (sqlformat . [(20210305 209) ((emacs (24 3)) (reformatter (0 3))) "Reformat SQL using sqlformat or pgformatter" single ((:commit . "5d3f776c7eaac0c353ad184b54ef17b2ebc58015") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "languages") (:url . "https://github.com/purcell/sqlformat"))])
+ (sqlite . [(20201227 1822) ((emacs (24 5))) "Use sqlite via ELisp" single ((:commit . "f3da716302c929b9df4ba0c281968f72a9d1d188") (:authors ("cnngimenez")) (:maintainer "cnngimenez") (:keywords "extensions" "lisp" "sqlite") (:url . "https://gitlab.com/cnngimenez/sqlite.el"))])
+ (sqlite3 . [(20220501 1217) ((emacs (25 1))) "Direct access to the core SQLite3 API" tar ((:commit . "68eda59d5f3d29d0a64d6256d58b8c1f93ba3583") (:authors ("Y. N. Lo" . "gordonynlo@yahoo.com")) (:maintainer "Y. N. Lo" . "gordonynlo@yahoo.com") (:keywords "comm" "data" "sql") (:url . "https://github.com/pekingduck/emacs-sqlite3-api"))])
+ (sqlup-mode . [(20170610 1537) nil "Upcase SQL words for you" single ((:commit . "3f9df9c88d6a7f9b1ae907e401cad8d3d7d63bbf") (:authors ("Aldric Giacomoni" . "trevoke@gmail.com")) (:maintainer "Aldric Giacomoni" . "trevoke@gmail.com") (:keywords "sql" "tools" "redis" "upcase") (:url . "https://github.com/trevoke/sqlup-mode.el"))])
+ (sr-speedbar . [(20161025 831) nil "Same frame speedbar" single ((:commit . "77a83fb50f763a465c021eca7343243f465b4a47") (:authors ("Sebastian Rose" . "sebastian_rose@gmx.de")) (:maintainer "Sebastian Rose" . "sebastian_rose@gmx.de") (:keywords "speedbar" "sr-speedbar.el") (:url . "http://www.emacswiki.org/emacs/download/sr-speedbar.el"))])
+ (srcery-theme . [(20210601 1247) ((emacs (24))) "Dark color theme" single ((:commit . "58dd21cd63e4a2eed15e0082c2547069363f107b") (:authors ("Daniel Berg")) (:maintainer "Daniel Berg") (:keywords "faces") (:url . "https://github.com/srcery-colors/srcery-emacs"))])
+ (srefactor . [(20180703 1810) ((emacs (24 4))) "A refactoring tool based on Semantic parser framework" tar ((:commit . "6f2c97d17fb70f4ca2112f5a2b99a8ec162004f5") (:authors ("Tu, Do Hoang" . "tuhdo1710@gmail.com")) (:maintainer "Tu, Do Hoang") (:keywords "c" "languages" "tools") (:url . "https://github.com/tuhdo/semantic-refactor"))])
+ (srfi . [(20220406 1831) ((emacs (25 1))) "Scheme Requests for Implementation browser" tar ((:commit . "dbcdc58d3ea9e0767b24bb0f05fc8de8849889fe") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "languages" "util") (:url . "https://github.com/srfi-explorations/emacs-srfi"))])
+ (srv . [(20180715 1959) ((emacs (24 3))) "perform SRV DNS requests" single ((:commit . "714387d5a5cf34d8d8cd96bdb1f9cb8ded823ff7") (:authors ("Magnus Henoch" . "magnus.henoch@gmail.com")) (:maintainer "Magnus Henoch" . "magnus.henoch@gmail.com") (:keywords "comm") (:url . "https://github.com/legoscia/srv.el"))])
+ (ssass-mode . [(20200211 132) ((emacs (24 3))) "Edit Sass without a Turing Machine" single ((:commit . "96f557887ad97a0066a60c54f92b7234b8407016") (:authors ("Adam Niederer" . "adam.niederer@gmail.com")) (:maintainer "Adam Niederer" . "adam.niederer@gmail.com") (:keywords "languages" "sass") (:url . "http://github.com/AdamNiederer/ssass-mode"))])
+ (ssh . [(20120904 2042) nil "Support for remote logins using ssh." single ((:commit . "812e27409d01c38d74906a1816640506d6e7e3ef") (:authors ("Noah Friedman" . "friedman@splode.com")) (:maintainer "Ian Eure" . "ian.eure@gmail.com") (:keywords "unix" "comm"))])
+ (ssh-agency . [(20200329 1558) ((emacs (24 4)) (dash (2 10 0))) "manage ssh-agent from Emacs" single ((:commit . "a5377e4317365a3d5442e06d5c255d4a7c7618db") (:authors ("Noam Postavsky" . "npostavs@user.sourceforge.net")) (:maintainer "Noam Postavsky" . "npostavs@user.sourceforge.net") (:url . "https://github.com/magit/ssh-agency"))])
+ (ssh-config-mode . [(20211003 2330) nil "Mode for fontification of ~/.ssh/config" tar ((:commit . "d560a0876a93ad4130baf33dae1b9405ad37a405") (:authors ("Harley Gorrell" . "harley@panix.com")) (:maintainer "Harley Gorrell" . "harley@panix.com") (:keywords "ssh" "config" "emacs") (:url . "https://github.com/jhgorrell/ssh-config-mode-el"))])
+ (ssh-deploy . [(20220126 658) ((emacs (25))) "Deployment via Tramp, global or per directory." tar ((:commit . "9311f9b4f8d25ce54fb7da9bf59d955fed366a4d") (:authors ("Christian Johansson" . "christian@cvj.se")) (:maintainer "Christian Johansson" . "christian@cvj.se") (:keywords "tools" "convenience") (:url . "https://github.com/cjohansson/emacs-ssh-deploy"))])
+ (ssh-tunnels . [(20220410 1424) ((cl-lib (0 5)) (emacs (24))) "Manage SSH tunnels" tar ((:commit . "a74488a71c2827dcaf42d9381d0d974aca96e27f") (:authors ("death <github.com/death>")) (:maintainer "death <github.com/death>") (:keywords "tools" "convenience") (:url . "http://github.com/death/ssh-tunnels"))])
+ (stack-mode . [(20150923 1523) ((haskell-mode (13 14)) (cl-lib (0 5)) (flycheck (0 23))) "A minor mode enabling various features based on stack-ide." tar ((:commit . "f3481e239dde9817152ec00e32bfc3ebf5aaf2cb") (:keywords "haskell" "stack") (:url . "https://github.com/commercialhaskell/stack-ide"))])
+ (stan-mode . [(20211129 2051) ((emacs (24 4))) "Major mode for editing Stan files" tar ((:commit . "150bbbe5fd3ad2b5a3dbfba9d291e66eeea1a581") (:authors ("Jeffrey Arnold" . "jeffrey.arnold@gmail.com") ("Daniel Lee" . "bearlee@alum.mit.edu") ("Kazuki Yoshida" . "kazukiyoshida@mail.harvard.edu")) (:maintainer "Kazuki Yoshida" . "kazukiyoshida@mail.harvard.edu") (:keywords "languages" "c") (:url . "https://github.com/stan-dev/stan-mode/tree/master/stan-mode"))])
+ (stan-snippets . [(20211129 2051) ((emacs (24 3)) (stan-mode (10 3 0)) (yasnippet (0 8 0))) "Yasnippets for Stan" tar ((:commit . "150bbbe5fd3ad2b5a3dbfba9d291e66eeea1a581") (:authors ("Jeffrey Arnold" . "jeffrey.arnold@gmail.com") ("Kazuki Yoshida" . "kazukiyoshida@mail.harvard.edu")) (:maintainer "Kazuki Yoshida" . "kazukiyoshida@mail.harvard.edu") (:keywords "languages" "tools") (:url . "https://github.com/stan-dev/stan-mode/tree/master/stan-snippets"))])
+ (standard-dirs . [(20200621 1603) ((emacs (26 1)) (f (0 20 0)) (s (1 7 0))) "Platform-specific paths for config, cache, and other data" single ((:commit . "92460e21f964cb7495d974c42acd0b726af3fbcb") (:authors ("Joseph M LaFreniere" . "joseph@lafreniere.xyz")) (:maintainer "Joseph M LaFreniere" . "joseph@lafreniere.xyz") (:keywords "files") (:url . "https://github.com/lafrenierejm/standard-dirs.el"))])
+ (standoff-mode . [(20210810 1814) nil "Create stand-off markup, also called external markup." tar ((:commit . "aa5bac257ebefd91f4b5dd787a835407bddd6fb2") (:authors ("Christian Lück" . "christian.lueck@ruhr-uni-bochum.de")) (:maintainer "Christian Lück" . "christian.lueck@ruhr-uni-bochum.de") (:keywords "text" "annotations" "ner" "humanities") (:url . "https://github.com/lueck/standoff-mode"))])
+ (starlit-theme . [(20220507 1833) ((emacs (25 1))) "Deep blue dark theme with bright colors from the starlit sky" single ((:commit . "f788903244778508891eba0da70ea9f287efc9ae") (:authors ("Jonas Jelten" . "jj@sft.lol")) (:maintainer "Jonas Jelten" . "jj@sft.lol") (:keywords "faces") (:url . "https://github.com/SFTtech/starlit-emacs"))])
+ (start-menu . [(20160426 1225) ((cl-lib (0 5)) (config-parser (0 1))) "start-menu for executing external program like in windows" single ((:commit . "f7d33fed7ad2dc61156f1c1cff9e1805366fbd69") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "convenience" "menu") (:url . "https://github.com/lujun9972/el-start-menu"))])
+ (stash . [(20151117 1427) nil "lightweight persistent caching" single ((:commit . "c2e494d20c752b80ebbdffbf66687b3cdfc425ad") (:authors ("Sean Allred" . "code@seanallred.com")) (:maintainer "Sean Allred" . "code@seanallred.com") (:keywords "extensions" "data" "internal" "lisp") (:url . "https://www.github.com/vermiculus/stash.el/"))])
+ (state . [(20200727 1227) ((emacs (24))) "Quick navigation between workspaces" single ((:commit . "8cd9210f17c1b134274a7352b996839aed9a7d8c") (:authors ("Sylvain Rousseau <thisirs at gmail dot com>")) (:maintainer "Sylvain Rousseau <thisirs at gmail dot com>") (:keywords "convenience" "workspaces") (:url . "https://github.com/thisirs/state.git"))])
+ (status . [(20151230 1408) nil "This package adds support for status icons to Emacs." tar ((:commit . "b62c74bf272566f82a68622f29fb9edafea0f241") (:authors ("Tom Tromey" . "tom@tromey.com")) (:maintainer "Tom Tromey" . "tom@tromey.com") (:keywords "frames" "multimedia"))])
+ (steam . [(20220218 1707) ((cl-lib (0 5))) "Organize and launch Steam games" single ((:commit . "20aa58c5ccd85f6c4f288a14e79adc66e691cd23") (:authors ("Erik Sjöstrand")) (:maintainer "Erik Sjöstrand") (:keywords "games") (:url . "http://github.com/Kungsgeten/steam.el"))])
+ (stem . [(20131102 1109) nil "Routines for stemming" single ((:commit . "d74e6611d6ba5025e0276a2cc7c8a90f46bfa9ac") (:authors ("Tsuchiya Masatoshi" . "tsuchiya@pine.kuee.kyoto-u.ac.jp")) (:maintainer "Tsuchiya Masatoshi" . "tsuchiya@pine.kuee.kyoto-u.ac.jp") (:keywords "stemming") (:url . "https://github.com/yuutayamada/stem"))])
+ (stem-english . [(20180109 358) ((emacs (24 3))) "- routines for stemming English word" single ((:commit . "c9fc4c6ed6bf82382e479dae80912f4ae17d31f4") (:authors ("Tsuchiya Masatoshi" . "tsuchiya@pine.kuee.kyoto-u.ac.jp")) (:maintainer "KAWABATA, Taichi <kawabata.taichi_at_gmail.com>") (:keywords "text") (:url . "http://github.com/kawabata/stem-english"))])
+ (stem-reading-mode . [(20220418 1136) ((emacs (25 1))) "Highlight word stems for speed-reading" single ((:commit . "a8bacd80fab6013c09e4e8d337fd88267cbe2ff8") (:authors ("Yuri D'Elia" . "wavexx@thregr.org")) (:maintainer "Yuri D'Elia" . "wavexx@thregr.org") (:keywords "convenience" "wp") (:url . "https://gitlab.com/wavexx/stem-reading-mode.el"))])
+ (stgit . [(20200606 1308) nil "major mode for StGit interaction" single ((:commit . "03fc757c4255bfd445cdbc2a62ca3b02a65beba5") (:authors ("David Kågedal" . "davidk@lysator.liu.se")) (:maintainer "David Kågedal" . "davidk@lysator.liu.se") (:url . "http://stacked-git.github.io"))])
+ (sticky . [(20170926 36) nil "Sticky key for capital letters" single ((:commit . "fec4e1af38f17f5cd80eca361d8e8ef8772db366") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "convenience") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/sticky.el"))])
+ (stickyfunc-enhance . [(20150429 1814) ((emacs (24 3))) "An enhancement to stock `semantic-stickyfunc-mode'" single ((:commit . "13bdba51fcd83ccbc3267959d23afc94d458dcb0") (:authors ("Tu, Do Hoang" . "tuhdo1710@gmail.com")) (:maintainer "Tu, Do Hoang") (:keywords "c" "languages" "tools") (:url . "https://github.com/tuhdo/semantic-stickyfunc-enhance"))])
+ (stimmung-themes . [(20220510 644) ((emacs (25))) "Themes tuned to inner harmonies" tar ((:commit . "67e3bc2e9fbc3564ea2884b999ebc66f9a29413c") (:authors ("Love Lagerkvist")) (:maintainer "Love Lagerkvist") (:keywords "faces") (:url . "https://github.com/motform/stimmung-themes"))])
+ (stock-ticker . [(20150204 1052) ((s (1 9 0)) (request (0 2 0))) "Show stock prices in mode line" single ((:commit . "f2e564142c9de84232839a5b01979cf95b04d6a9") (:authors ("Gunther Hagleitner")) (:maintainer "Gunther Hagleitner") (:keywords "comms") (:url . "https://github.com/hagleitn/stock-ticker"))])
+ (stock-tracker . [(20220430 1144) ((emacs (27 1)) (dash (2 16 0)) (async (1 9 5))) "Track stock price" single ((:commit . "58018a1747273df23dec08ec5d318da1960428c1") (:authors ("Huming Chen" . "chenhuming@gmail.com")) (:maintainer "Huming Chen" . "chenhuming@gmail.com") (:keywords "convenience" "stock" "finance") (:url . "https://github.com/beacoder/stock-tracker"))])
+ (strace-mode . [(20171116 2039) nil "strace output syntax highlighting" single ((:commit . "2901baa968d5180ab985ac40ca22cc20914d01f5") (:authors ("Preston Moore" . "prestonkmoore@gmail.com")) (:maintainer "Preston Moore" . "prestonkmoore@gmail.com") (:keywords "languages"))])
+ (streak . [(20220311 1929) ((emacs (27 1))) "Track a daily streak in your Mode Line" single ((:commit . "b2206de2fe43f97e754bbcb0abe9b078a419e787") (:authors ("Colin Woodbury <https://www.fosskers.ca>")) (:maintainer "Colin Woodbury" . "colin@fosskers.ca") (:keywords "calendar") (:url . "https://github.com/fosskers/streak"))])
+ (streamlink . [(20210811 1429) ((s (1 12 0))) "A major mode for streamlink output" single ((:commit . "c265dc61c02ad29ec01dfd8b5cbe3bac60fbf097") (:keywords "multimedia" "streamlink") (:url . "https://github.com/BenediktBroich/streamlink"))])
+ (strie . [(20160211 2222) ((cl-lib (0 5))) "A simple trie data structure implementation" single ((:commit . "eb7efb0cccc127c414f6a64db11454869d9c10a8") (:authors ("James Atwood" . "jatwood@cs.umass.edu")) (:maintainer "James Atwood" . "jatwood@cs.umass.edu"))])
+ (string-edit . [(20210405 1836) ((dash (1 2 0))) "Avoid escape nightmares by editing string in separate buffer" single ((:commit . "0e225df6f8740467231c787a50025e4552b3eddb") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com"))])
+ (string-inflection . [(20210918 419) nil "underscore -> UPCASE -> CamelCase -> lowerCamelCase conversion of names" single ((:commit . "fd7926ac17293e9124b31f706a4e8f38f6a9b855") (:authors ("akicho8" . "akicho8@gmail.com")) (:maintainer "akicho8" . "akicho8@gmail.com") (:keywords "elisp"))])
+ (string-utils . [(20140508 2041) ((list-utils (0 4 2))) "String-manipulation utilities" single ((:commit . "c2232d691617973ecf12a970c6008a161c21da14") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "extensions") (:url . "http://github.com/rolandwalker/string-utils"))])
+ (stripe-buffer . [(20141208 1508) ((cl-lib (1 0))) "Use a different background for even and odd lines" single ((:commit . "c252080f55cb78c951b19ebab9687f6d00237baf") (:authors ("Andy Stewart" . "lazycat.manatee@gmail.com")) (:maintainer "sabof" . "esabof@gmail.com") (:url . "https://github.com/sabof/stripe-buffer"))])
+ (stripes . [(20220310 2237) ((emacs (24 3))) "highlight alternating lines differently" single ((:commit . "618e40e0a9cf80decea32c8daecb1c9f6eae2991") (:authors ("Michael Schierl" . "schierlm-public@gmx.de") ("Štěpán Němec" . "stepnem@gmail.com")) (:maintainer "Štěpán Němec" . "stepnem@gmail.com") (:keywords "convenience" "faces") (:url . "https://gitlab.com/stepnem/stripes-el"))])
+ (stumpwm-mode . [(20140131 216) nil "special lisp mode for evaluating code into running stumpwm" single ((:commit . "61a7cf27e49e0779a53c018b2342f5f1c5cc70b4") (:maintainer "Shawn Betts") (:keywords "comm" "lisp" "tools"))])
+ (stupid-indent-mode . [(20170525 1117) nil "Plain stupid indentation minor mode" single ((:commit . "3295e7de5e2cfddc3bf0e462e852bf58972f5d70") (:authors ("Mihai Bazon" . "mihai.bazon@gmail.com")) (:maintainer "Mihai Bazon" . "mihai.bazon@gmail.com"))])
+ (stylefmt . [(20161025 824) nil "Stylefmt interface" single ((:commit . "7a38f26bf8ff947215f34f0a064c7ca80575ccbc") (:authors ("κeen")) (:maintainer "κeen") (:keywords "style" "code" "formatter") (:url . "https://github.com/KeenS/stylefmt.el"))])
+ (stylus-mode . [(20211019 2113) nil "Major mode for editing .styl files" single ((:commit . "1ad7c51f3c6a6ae64550d9510c5e4e8470014375") (:authors ("Brian M. Carlson and other contributors")) (:maintainer "Brian M. Carlson and other contributors") (:keywords "languages") (:url . "https://github.com/brianc/jade-mode"))])
+ (su . [(20210721 1816) ((emacs (26 1))) "Automatically read and write files using su or sudo" single ((:commit . "1ecf7a7bbf9d88708eb2215e940753f8d6bccc92") (:authors ("PythonNut" . "pythonnut@pythonnut.com")) (:maintainer "PythonNut" . "pythonnut@pythonnut.com") (:keywords "convenience" "helm" "fuzzy" "flx") (:url . "https://github.com/PythonNut/su.el"))])
+ (subatomic-theme . [(20220128 1615) nil "Low contrast bluish color theme" single ((:commit . "9d0ac6aa5272d0285965a48505eb35658c5472b0") (:authors ("John Olsson" . "john@cryon.se")) (:maintainer "John Olsson" . "john@cryon.se") (:keywords "color-theme" "blue" "low contrast") (:url . "https://github.com/cryon/subatomic"))])
+ (subatomic256-theme . [(20130621 210) nil "Fork of subatomic-theme for terminals." single ((:commit . "326177d6f99cd2b1d30df695e67ee3bc441cd96f") (:authors ("John Olsson" . "john@cryon.se")) (:maintainer "John Olsson" . "john@cryon.se") (:url . "https://github.com/cryon/subatomic256"))])
+ (subemacs . [(20170401 934) nil "Evaluating expressions in a fresh Emacs subprocess" single ((:commit . "18d53939fec8968c08dfc5aff7240ca07efb1aac") (:authors ("Klaus-Dieter Bauer" . "bauer.klaus.dieter@gmail.com")) (:maintainer "Klaus-Dieter Bauer" . "bauer.klaus.dieter@gmail.com") (:keywords "extensions" "lisp" "multiprocessing") (:url . "https://github.com/kbauer/subemacs"))])
+ (sublime-themes . [(20170606 1844) nil "A collection of themes based on Sublime Text" tar ((:commit . "60ee40af82eb55b79d5ed4026f1911326311603f") (:authors ("Owain Lewis" . "owain@owainlewis.com")) (:maintainer "Owain Lewis" . "owain@owainlewis.com") (:keywords "faces"))])
+ (sublimity . [(20200905 1730) ((emacs (26 1))) "smooth-scrolling, minimap and distraction-free mode" tar ((:commit . "8e2ffc4d62194106130014531e7b54fc9b4b9e6c") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "https://github.com/zk-phi/sublimity"))])
+ (subsonic . [(20220403 1208) ((emacs (27 1)) (transient (0 2))) "Browse and play music from subsonic servers with mpv" single ((:commit . "e9acece0f840bc6ea096ae56e77573939a2c510c") (:authors ("Alex McGrath" . "amk@amk.ie")) (:maintainer "Alex McGrath" . "amk@amk.ie") (:keywords "multimedia") (:url . "https://git.sr.ht/~amk/subsonic.el"))])
+ (sudo-edit . [(20210706 534) ((emacs (24)) (cl-lib (0 5))) "Open files as another user" single ((:commit . "23b78a39053088839f281bc0c3134203d7e04e50") (:authors ("Nathaniel Flath" . "flat0103@gmail.com")) (:maintainer "Nathaniel Flath" . "flat0103@gmail.com") (:keywords "convenience") (:url . "https://github.com/nflath/sudo-edit"))])
+ (sudo-ext . [(20170126 1214) nil "sudo support" single ((:commit . "9d4580f304121ce7b8104bd4bd3b64e4dfa3c9b3") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "unix") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/sudo-ext.el"))])
+ (sudo-utils . [(20210119 1930) ((emacs (25 1))) "Sudo utilities" single ((:commit . "089f7833fa256f293284a6286bf9cb2b78eff40d") (:authors ("Alpha Catharsis" . "alpha.catharsis@gmail.com")) (:maintainer "Alpha Catharsis" . "alpha.catharsis@gmail.com") (:keywords "processes" "unix") (:url . "https://github.com/alpha-catharsis/sudo-utils"))])
+ (sudoku . [(20191015 1315) ((emacs (24 4))) "Simple sudoku game, can download puzzles" single ((:commit . "b1924fd244a5fa284de9d67b66fbd69164b37318") (:authors ("Zajcev Evgeny" . "zevlg@yandex.ru")) (:maintainer "Zajcev Evgeny" . "zevlg@yandex.ru") (:keywords "games"))])
+ (suggest . [(20190807 851) ((emacs (24 4)) (loop (1 3)) (dash (2 13 0)) (s (1 11 0)) (f (0 18 2)) (spinner (1 7 3))) "suggest elisp functions that give the output requested" tar ((:commit . "7b1c7fd38cd9389e58f672bfe58d9e88aeb898c7") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:keywords "convenience") (:url . "https://github.com/Wilfred/suggest.el"))])
+ (suggestion-box . [(20170830 807) ((emacs (25 1)) (popup (0 5 3))) "show tooltip on the cursor" single ((:commit . "50af0776c8caf3c79c4d37fd51cbf304ea34b68e") (:authors ("Yuta Yamada <cokesboy\"at\"gmail.com>")) (:maintainer "Yuta Yamada <cokesboy\"at\"gmail.com>") (:keywords "convenience"))])
+ (sunburn-theme . [(20201216 1539) ((emacs (24))) "A low contrast color theme" single ((:commit . "6b5c14c76dcdfdb099102ef7a388b2f0c6f1951d") (:authors ("Martín Varela" . "martin@varela.fi")) (:maintainer "Martín Varela" . "martin@varela.fi") (:url . "http://github.com/mvarela/Sunburn-Theme"))])
+ (sunny-day-theme . [(20140413 2125) nil "Emacs24 theme with a light background." single ((:commit . "420e0a6eb33fcc9b75c2c9e88ab60a975d782a00") (:authors ("Martin Haesler")) (:maintainer "Martin Haesler") (:url . "http://github.com/mswift42/sunny-day-theme"))])
+ (sunshine . [(20200306 1711) ((cl-lib (0 5))) "Provide weather and forecast information." single ((:commit . "88256223539edcfe57017778a997a474c9c022f6") (:authors ("Aaron Bieber" . "aaron@aaronbieber.com")) (:maintainer "Aaron Bieber" . "aaron@aaronbieber.com") (:keywords "tools" "weather") (:url . "https://github.com/aaronbieber/sunshine.el"))])
+ (suomalainen-kalenteri . [(20220101 718) nil "Finnish national and Christian holidays for calendar" tar ((:commit . "30103e6c6fa5dcbae70a636b007afdaad2fbcac0") (:authors ("Teemu Likonen" . "tlikonen@iki.fi")) (:maintainer "Teemu Likonen" . "tlikonen@iki.fi") (:keywords "calendar" "holidays" "finnish") (:url . "https://github.com/tlikonen/suomalainen-kalenteri"))])
+ (super-save . [(20220426 1056) ((emacs (24 4))) "Auto-save buffers, based on your activity." single ((:commit . "71c26cbd47d993fff37e572523ea79c9c49f5caf") (:authors ("Bozhidar Batsov" . "bozhidar@batsov.com")) (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.com") (:keywords "convenience") (:url . "https://github.com/bbatsov/super-save"))])
+ (supergenpass . [(20130329 548) nil "SuperGenPass for Emacs" single ((:commit . "549072ef7b5b82913cadd4758e8a0a9926f0a04a") (:authors ("Jaime Fournier" . "jaimef@linbsd.org")) (:maintainer "Jaime Fournier" . "jaimef@linbsd.org") (:keywords "supergenpass"))])
+ (suscolors-theme . [(20190713 1009) nil "Colorful theme, inspired by Gruvbox." single ((:commit . "b4a979ee23e26e255b9a63525b0a28e810fab9ae") (:url . "https://github.com/TheSuspiciousWombat/SusColors-emacs"))])
+ (sv-kalender-namnsdagar . [(20190421 1521) nil "Swedish celebrated name of the day" single ((:commit . "fff970f49c77abfc69e37817f25a939818420971") (:authors ("Mats Lidell" . "mats.lidell@lidells.se")) (:maintainer "Mats Lidell" . "mats.lidell@lidells.se") (:keywords "calendar" "swedish" "localization") (:url . "https://github.com/matsl/sv-kalender-namnsdagar"))])
+ (svelte-mode . [(20211016 652) ((emacs (26 1))) "Emacs major mode for Svelte" single ((:commit . "6a1d4274af7f4c0f271f77bd96678c3dd1fa68e1") (:authors ("Leaf" . "leafvocation@gmail.com")) (:maintainer "Leaf" . "leafvocation@gmail.com") (:keywords "wp" "languages") (:url . "https://github.com/leafOfTree/svelte-mode"))])
+ (svg-mode-line-themes . [(20150425 2006) ((xmlgen (0 4))) "SVG-based themes for mode-line" tar ((:commit . "80a0e01839cafbd66899202e7764c33231974259") (:authors ("sabof")) (:maintainer "sabof") (:url . "https://github.com/sabof/svg-mode-line-themes"))])
+ (svg-tag-mode . [(20211229 920) ((emacs (27 1)) (svg-lib (0 2))) "Replace keywords with SVG tags" single ((:commit . "07640c97a1dcc305010a384fffdaa7788c342da7") (:authors ("Nicolas P. Rougier" . "Nicolas.Rougier@inria.fr")) (:maintainer "Nicolas P. Rougier" . "Nicolas.Rougier@inria.fr") (:keywords "convenience") (:url . "https://github.com/rougier/svg-tag-mode"))])
+ (svnwrapper . [(20180414 1843) ((e2ansi (0 1 1))) "Highlighting and paging for shell command `svn'" tar ((:commit . "de5069f5784e5d9e87a0af0159ba5f28a3716583") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "faces") (:url . "https://github.com/Lindydancer/svnwrapper"))])
+ (swagger-to-org . [(20160611 56) ((emacs (24)) (cl-lib (0 5)) (json (1 4))) "Convert a swagger.json file into an org-mode file" single ((:commit . "181357c71ea24bede263f5706d8781ad65e16877") (:authors ("Matthew Carter" . "m@ahungry.com")) (:maintainer "Matthew Carter" . "m@ahungry.com") (:keywords "ahungry" "emacs" "swagger" "openapi" "orgmode" "org" "export") (:url . "https://github.com/ahungry/swagger-to-org"))])
+ (swap-buffers . [(20150506 2139) nil "The quickest way to swap buffers between windows. Based on switch-window package." single ((:commit . "46ab31359b70d935add6c6e9533443116dc51103") (:authors ("Evgeniy Kazakov" . "evgeniy.kazakov@gmail.com")) (:maintainer "Evgeniy Kazakov" . "evgeniy.kazakov@gmail.com") (:keywords "window" "swap" "buffer" "exchange") (:url . "https://github.com/ekazakov/swap-buffers"))])
+ (swap-regions . [(20180915 1346) ((emacs (24 3))) "Swap text in two regions" single ((:commit . "f4fd9880cf690e003fcde88dcf2b46adbbbb03cd") (:authors ("Xu Chunyang" . "mail@xuchunyang.me")) (:maintainer "Xu Chunyang" . "mail@xuchunyang.me") (:keywords "convenience") (:url . "https://github.com/xuchunyang/swap-regions.el"))])
+ (sway . [(20211109 1601) ((emacs (27 1)) (dash (2 18 1))) "Communication with the Sway window manager" single ((:commit . "d84adab82ca5f84847702671dd60c0377c82ccd9") (:authors ("Thibault Polge" . "thibault@thb.lt")) (:maintainer "Thibault Polge" . "thibault@thb.lt") (:keywords "frames") (:url . "https://github.com/thblt/sway.el"))])
+ (sweet-theme . [(20200708 1202) ((emacs (24 1))) "Sweet-looking theme" single ((:commit . "78f741806ecebe01224bf54d09ad80e306652508") (:authors ("2bruh4me")) (:maintainer "2bruh4me") (:keywords "faces") (:url . "https://github.com/2bruh4me/sweet-theme"))])
+ (sweetgreen . [(20180605 335) ((dash (2 12 1)) (helm (1 5 6)) (request (0 2 0)) (cl-lib (0 5))) "Order Salads from sweetgreen.com" single ((:commit . "e933fe466b5ef0e976967e203f88bd7a012469d1") (:authors ("Diego Berrocal" . "cestdiego@gmail.com")) (:maintainer "Diego Berrocal" . "cestdiego@gmail.com") (:keywords "salad" "food" "sweetgreen" "request") (:url . "https://www.github.com/CestDiego/sweetgreen.el"))])
+ (swift-helpful . [(20220402 1433) ((emacs (25 1)) (dash (2 12 0)) (lsp-mode (6 0)) (swift-mode (8 0 0))) "Show documentation for Swift programs." tar ((:commit . "fe5c4a97fabbc89bd4761cfe4f8f8ce6f6d89703") (:authors ("Daniel Martín" . "mardani29@yahoo.es")) (:maintainer "Daniel Martín" . "mardani29@yahoo.es") (:keywords "help" "swift") (:url . "https://github.com/danielmartin/swift-helpful"))])
+ (swift-mode . [(20220313 542) ((emacs (24 4)) (seq (2 3))) "Major-mode for Apple's Swift programming language" tar ((:commit . "0d1ef0ef183398143b13fb8c76c1284df0d5e616") (:authors ("taku0 (http://github.com/taku0)") ("Chris Barrett" . "chris.d.barrett@me.com") ("Bozhidar Batsov" . "bozhidar@batsov.com") ("Arthur Evstifeev" . "lod@pisem.net")) (:maintainer "taku0 (http://github.com/taku0)") (:keywords "languages" "swift") (:url . "https://github.com/swift-emacs/swift-mode"))])
+ (swift-playground-mode . [(20190717 2223) ((emacs (24 4)) (seq (2 2 0))) "Run Apple's playgrounds in Swift buffers" tar ((:commit . "111cde906508824ee11d774b908df867142a8aec") (:keywords "languages" "swift") (:url . "https://gitlab.com/michael.sanders/swift-playground-mode"))])
+ (swift3-mode . [(20160918 1250) ((emacs (24 4))) "Major-mode for Apple's Swift programming language." tar ((:commit . "4e51265c6905e17d8910e35b0b37cf51e20ecdfe") (:keywords "languages" "swift") (:url . "https://github.com/taku0/swift3-mode"))])
+ (swiper . [(20220430 2247) ((emacs (24 5)) (ivy (0 13 4))) "Isearch with an overview. Oh, man!" single ((:commit . "8bf8027e4bd8c093bddb76a813952d2a0dcbf21d") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "matching") (:url . "https://github.com/abo-abo/swiper"))])
+ (swiper-helm . [(20180131 1744) ((emacs (24 1)) (swiper (0 1 0)) (helm (1 5 3))) "Helm version of Swiper." single ((:commit . "93fb6db87bc6a5967898b5fd3286954cc72a0008") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "matching") (:url . "https://github.com/abo-abo/swiper-helm"))])
+ (swiss-holidays . [(20200526 822) nil "Swiss holidays for the calendar" single ((:commit . "0995c9685033a09466f5b2dceb7316362bde997a") (:authors ("Christian Egli" . "christian.egli@alumni.ethz.ch")) (:maintainer "Christian Egli" . "christian.egli@alumni.ethz.ch") (:keywords "calendar") (:url . "https://github.com/egli/swiss-holidays"))])
+ (switch-buffer-functions . [(20200127 409) nil "Hook run when current buffer changed" single ((:commit . "95a846baa93bac4c3b3c028b9d53507f1042b23a") (:authors ("10sr <8slashes+el [at] gmail [dot] com>")) (:maintainer "10sr <8slashes+el [at] gmail [dot] com>") (:keywords "hook" "utility") (:url . "https://github.com/10sr/switch-buffer-functions-el"))])
+ (switch-window . [(20210808 742) ((emacs (24))) "A *visual* way to switch window" tar ((:commit . "8d9fe251d8d38b223d643df975876356ddfc1b98") (:authors ("Dimitri Fontaine" . "dim@tapoueh.org") ("Feng Shu" . "tumashu@163.com")) (:maintainer "Dimitri Fontaine" . "dim@tapoueh.org") (:keywords "convenience") (:url . "https://github.com/dimitri/switch-window"))])
+ (swoop . [(20200618 905) ((emacs (24 3)) (ht (2 0)) (pcre2el (1 5)) (async (1 1))) "Peculiar buffer navigation" tar ((:commit . "0c737a961970a2e61735545320367bafaa8dfc49") (:authors ("Shingo Fukuyama - http://fukuyama.co")) (:maintainer "Shingo Fukuyama - http://fukuyama.co") (:keywords "tools" "swoop" "inner" "buffer" "search" "navigation") (:url . "https://github.com/ShingoFukuyama/emacs-swoop"))])
+ (sws-mode . [(20210908 2121) nil "(S)ignificant (W)hite(S)pace mode" single ((:commit . "1ad7c51f3c6a6ae64550d9510c5e4e8470014375") (:authors ("Brian M. Carlson and other contributors")) (:maintainer "Brian M. Carlson and other contributors") (:keywords "languages") (:url . "https://github.com/brianc/jade-mode"))])
+ (sx . [(20191229 1746) ((emacs (24 1)) (cl-lib (0 5)) (json (1 3)) (markdown-mode (2 0)) (let-alist (1 0 3))) "StackExchange client. Ask and answer questions on Stack Overflow, Super User, and the likes" tar ((:commit . "e9d1093c97507a6d7b4f4710ef65200dae725e5f") (:authors ("Sean Allred" . "code@seanallred.com")) (:maintainer "Sean Allred" . "code@seanallred.com") (:keywords "help" "hypermedia" "tools") (:url . "https://github.com/vermiculus/sx.el/"))])
+ (sxiv . [(20210514 918) ((dash (2 16 0)) (emacs (25 1))) "Run the sxiv image viewer" single ((:commit . "028409c3a9ff7ba33a1cc2158abfc1793ed50717") (:authors ("contrapunctus" . "xmpp:contrapunctus@jabber.fr")) (:maintainer "contrapunctus" . "xmpp:contrapunctus@jabber.fr") (:keywords "multimedia") (:url . "https://gitlab.com/contrapunctus/sxiv.el"))])
+ (symbol-navigation-hydra . [(20211010 2353) ((auto-highlight-symbol (1 61)) (hydra (0 15 0)) (emacs (24 4)) (multiple-cursors (1 4 0))) "A symbol-aware, range-aware hydra" single ((:commit . "5675976cad4cbeee30f43e6c4b28c2e5904575a5") (:authors ("Brett Wines" . "bgwines@cs.stanford.edu")) (:maintainer "Brett Wines" . "bgwines@cs.stanford.edu") (:keywords "highlight" "face" "match" "convenience" "hydra" "symbol") (:url . "https://github.com/bgwines/symbol-navigation-hydra"))])
+ (symbol-overlay . [(20220304 917) ((emacs (24 3)) (seq (2 2))) "Highlight symbols with keymap-enabled overlays" single ((:commit . "c439b73a5f9713bb3dce98986b589bb901e22130") (:authors ("wolray" . "wolray@foxmail.com")) (:maintainer "wolray" . "wolray@foxmail.com") (:keywords "faces" "matching") (:url . "https://github.com/wolray/symbol-overlay/"))])
+ (symbolist . [(20211107 1615) ((emacs (24 5))) "List and interactively unbind Emacs Lisp symbols" single ((:commit . "92b712734941a45da7d47fd61b95e4013ff53481") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "lisp" "maint") (:url . "https://github.com/lassik/emacs-symbolist"))])
+ (symbolword-mode . [(20180401 1427) ((emacs (24)) (f (0 19 0))) "modify word split" single ((:commit . "c254ec56e83a5d9de04df0856248723cf6d4be50") (:authors ("ncaq" . "ncaq@ncaq.net")) (:maintainer "ncaq" . "ncaq@ncaq.net") (:url . "https://github.com/ncaq/symbolword-mode"))])
+ (symex . [(20220323 1808) ((emacs (25 1)) (lispy (0 26 0)) (paredit (24)) (evil-cleverparens (20170718 413)) (evil (1 2 14)) (evil-surround (1 0 4)) (hydra (0 15 0)) (seq (2 22)) (undo-tree (0 7 5))) "An evil way to edit Lisp symbolic expressions as trees" tar ((:commit . "8ab435c2866869977c92ad64c3706f626acfb4d3") (:authors ("Siddhartha Kasivajhula" . "sid@countvajhula.com")) (:maintainer "Siddhartha Kasivajhula" . "sid@countvajhula.com") (:keywords "lisp" "convenience" "languages") (:url . "https://github.com/countvajhula/symex.el"))])
+ (symon . [(20170224 833) nil "tiny graphical system monitor" single ((:commit . "8dd8b6df49b03cd7d31b85aedbe9dd08fb922335") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://hins11.yu-yake.com/"))])
+ (symon-lingr . [(20150719 1342) ((symon (1 1 2)) (cl-lib (0 5))) "A notification-based Lingr client powered by symon.el" single ((:commit . "056d1a473e36992ff5881e5ce6fdc331cead975f") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://hins11.yu-yake.com/"))])
+ (sync-recentf . [(20160326 2001) nil "Synchronize the recent files list between Emacs instances" single ((:commit . "0052561d5c5b5c2684faedc3eead776aec06c3ed") (:authors ("François Févotte" . "fevotte@gmail.com")) (:maintainer "François Févotte" . "fevotte@gmail.com") (:keywords "recentf") (:url . "https://github.com/ffevotte/sync-recentf"))])
+ (synonymous . [(20180325 1817) ((emacs (24)) (cl-lib (0 5)) (request (0 2 0))) "A thesaurus at your fingertips" single ((:commit . "2cb9a674d84fddf3f1b00c9d6b13a853576acb87") (:authors ("Katherine Whitlock" . "toroidalcode@gmail.com") ("Snippets adapted from FlySpell, authored by Manuel Serrano" . "Manuel.Serrano@inria.fr")) (:maintainer "Katherine Whitlock" . "toroidalcode@gmail.com") (:keywords "utility") (:url . "http://github.com/toroidal-code/synonymous.el"))])
+ (synosaurus . [(20191125 552) ((cl-lib (0 5))) "An extensible thesaurus supporting lookup and substitution." tar ((:commit . "14d34fc92a77c3a916b4d58400424c44ae99cd81") (:authors ("Hans-Peter Deifel" . "hpd@hpdeifel.de")) (:maintainer "Hans-Peter Deifel" . "hpd@hpdeifel.de") (:keywords "wp"))])
+ (synquid . [(20160930 1550) ((flycheck (27)) (emacs (24 3))) "Major mode for editing Synquid files" single ((:commit . "28701ce1a15437202f53ab93a14bcba1de83fd2c") (:authors ("Clément Pit-Claudel" . "clement.pitclaudel@live.com")) (:maintainer "Clément Pit-Claudel" . "clement.pitclaudel@live.com") (:keywords "languages") (:url . "https://github.com/cpitclaudel/synquid-mode"))])
+ (syntactic-close . [(20210105 1400) ((emacs (24)) (cl-lib (0 5))) "Insert closing delimiter" single ((:commit . "ffe8b28907973fda775254432f88b55c92b5ae1f") (:authors ("Emacs User Group Berlin" . "emacs-berlin@emacs-berlin.org")) (:maintainer "Emacs User Group Berlin" . "emacs-berlin@emacs-berlin.org") (:keywords "languages" "convenience") (:url . "https://github.com/emacs-berlin/syntactic-close"))])
+ (syntactic-sugar . [(20140508 2041) nil "Effect-free forms such as if/then/else" single ((:commit . "7ddc4502c831abe1c4ad4c7d1ca628a2c9e13968") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "extensions") (:url . "http://github.com/rolandwalker/syntactic-sugar"))])
+ (syntax-subword . [(20160205 2154) nil "make operations on words more fine-grained" single ((:commit . "9aa9b3f846bfe2474370642458a693ac4760d9fe") (:authors ("Jonathan Kotta" . "jpkotta@gmail.com")) (:maintainer "Jonathan Kotta" . "jpkotta@gmail.com"))])
+ (syntree . [(20220122 2341) ((emacs (27 1)) (transient (0 3 7))) "Draw plain text constituency trees" single ((:commit . "45d010b071c32cab4a3a5d336d6c01cde49657f8") (:authors ("Enrico Flor" . "enrico@eflor.net")) (:maintainer "Enrico Flor" . "enrico@eflor.net") (:url . "https://github.com/enricoflor/syntree"))])
+ (sysctl . [(20200615 1824) ((emacs (26))) "Manage sysctl though org-mode" single ((:commit . "d8c2e18de1d7a3b2999a4d5054c0bbf30cb10fed") (:authors ("Dante Catalfamo")) (:maintainer "Dante Catalfamo") (:keywords "sysctl" "tools" "unix") (:url . "https://github.com/dantecatalfamo/sysctl.el"))])
+ (syslog-mode . [(20210910 1952) ((hide-lines (20130623)) (ov (20150311)) (hsluv (20181127))) "Major-mode for viewing log files & strace output" tar ((:commit . "072664784dae41a573a9de8d178bf577b7526b82") (:authors ("Harley Gorrell" . "harley@panix.com")) (:maintainer "Joe Bloggs" . "vapniks@yahoo.com") (:keywords "unix") (:url . "https://github.com/vapniks/syslog-mode"))])
+ (system-packages . [(20220409 1023) ((emacs (24 3))) "functions to manage system packages" single ((:commit . "c087d2c6e598f85fc2760324dce20104ea442fa3") (:authors ("J. Alexander Branham" . "alex.branham@gmail.com")) (:maintainer "J. Alexander Branham" . "alex.branham@gmail.com") (:url . "https://gitlab.com/jabranham/system-packages"))])
+ (system-specific-settings . [(20140818 1457) nil "Apply settings only on certain systems" single ((:commit . "0050d85b2175095aa5ecf580a2fe43c069b0eef3") (:authors ("Ryan C. Thompson")) (:maintainer "Ryan C. Thompson") (:keywords "configuration") (:url . "https://github.com/DarwinAwardWinner/emacs-system-specific-settings"))])
+ (systemd . [(20210209 2052) ((emacs (24 4))) "Major mode for editing systemd units" tar ((:commit . "b6ae63a236605b1c5e1069f7d3afe06ae32a7bae") (:authors ("Mark Oteiza" . "mvoteiza@udel.edu")) (:maintainer "Mark Oteiza" . "mvoteiza@udel.edu") (:keywords "tools" "unix"))])
+ (systemtap-mode . [(20151122 1940) nil "A mode for SystemTap" single ((:commit . "1a968c2b1f3a054bebf91ac49739d3a81ce050a9") (:maintainer nil . "ruediger@c-plusplus.de") (:keywords "tools" "languages") (:url . "https://github.com/ruediger/systemtap-mode"))])
+ (ta . [(20160619 1645) ((emacs (24 3)) (cl-lib (0 5))) "A tool to deal with Chinese homophonic characters" single ((:commit . "668ad41e71f374f8c32c8d0532f3d8485b355d35") (:authors ("kuanyui" . "azazabc123@gmail.com")) (:maintainer "kuanyui" . "azazabc123@gmail.com") (:keywords "tools") (:url . "http://github.com/kuanyui/ta.el"))])
+ (tab-bar-echo-area . [(20211013 1942) ((emacs (27 1))) "Display tab names of the tab bar in the echo area" single ((:commit . "d0d51ecbc5929eb7752b387c5bdfe4d879e78224") (:authors ("Fritz Grabo" . "hello@fritzgrabo.com")) (:maintainer "Fritz Grabo" . "hello@fritzgrabo.com") (:keywords "convenience") (:url . "https://github.com/fritzgrabo/tab-bar-echo-area"))])
+ (tab-bar-groups . [(20211013 2012) ((emacs (27 1)) (s (1 12 0))) "Tab groups for the tab bar" single ((:commit . "a0389d87d2e793055dd74ae85b4593aa1d2720fd") (:authors ("Fritz Grabo" . "hello@fritzgrabo.com")) (:maintainer "Fritz Grabo" . "hello@fritzgrabo.com") (:keywords "convenience") (:url . "https://github.com/fritzgrabo/tab-bar-groups"))])
+ (tab-bar-lost-commands . [(20211013 1945) ((emacs (27 1))) "The \"lost commands\" of the tab bar" single ((:commit . "989e03dc3d1057264b21b9a5d241fcba86cd297a") (:authors ("Fritz Grabo" . "hello@fritzgrabo.com")) (:maintainer "Fritz Grabo" . "hello@fritzgrabo.com") (:keywords "convenience") (:url . "https://github.com/fritzgrabo/tab-bar-lost-commands"))])
+ (tab-group . [(20140306 1450) nil "Grouped tabs and their tabbar" single ((:commit . "5a290ec2608e4100fb188fd60ecb77affcc3465b") (:authors ("INA Lintaro <tarao.gnn at gmail.com>")) (:maintainer "INA Lintaro <tarao.gnn at gmail.com>") (:keywords "convenience" "tabs") (:url . "http://github.com/tarao/tab-group-el"))])
+ (tab-jump-out . [(20151006 130) ((dash (2 10)) (emacs (24 4))) "Use tab to jump out of delimiter pairs." single ((:commit . "1c3fec1826d2891177ea78e4e7cce1dc67e83e51") (:authors ("Zhang Kai Yu" . "yeannylam@gmail.com")) (:maintainer "Zhang Kai Yu" . "yeannylam@gmail.com") (:keywords "tab" "editing"))])
+ (tabbar . [(20180726 1735) nil "Display a tab bar in the header line" tar ((:commit . "82bbda31cbe8ef367dd6501c3aa14b7f2c835910") (:authors ("David Ponce" . "david@dponce.com")) (:maintainer "David Ponce" . "david@dponce.com") (:keywords "convenience"))])
+ (tabbar-ruler . [(20160802 307) ((tabbar (2 0 1)) (powerline (2 3)) (mode-icons (0 4 0)) (cl-lib (0 5))) "Pretty tabbar, autohide, use both tabbar/ruler" tar ((:commit . "535568189aa12a3eff7f977d2783e57b6a65ab6a") (:authors ("Matthew Fidler, Ta Quang Trung, Nathaniel Cunningham")) (:maintainer "Matthew L. Fidler") (:keywords "tabbar" "ruler mode" "menu" "tool bar.") (:url . "http://github.com/mlf176f2/tabbar-ruler.el"))])
+ (tablist . [(20200427 2205) ((emacs (24 3))) "Extended tabulated-list-mode" tar ((:commit . "faab7a035ef2258cc4ea2182f67e3aedab7e2af9") (:authors ("Andreas Politz" . "politza@fh-trier.de")) (:maintainer "Andreas Politz" . "politza@fh-trier.de") (:keywords "extensions" "lisp"))])
+ (tabspaces . [(20220507 607) ((emacs (27 1)) (project (0 8 1))) "Leverage tab-bar and project for buffer-isolated workspaces" single ((:commit . "24266c6c9a766261a8c8620692dfa4000f3e1d5d") (:authors ("Colin McLear" . "mclear@fastmail.com")) (:maintainer "Colin McLear") (:keywords "convenience" "frames") (:url . "https://github.com/mclear-tools/tabspaces"))])
+ (tabula-rasa . [(20141216 547) ((emacs (24 4))) "Distraction free writing mode" single ((:commit . "e85fff9de18dc31bc6a7aca726e34a95cc5459f5") (:authors ("Ido Magal" . "misc@satans.church")) (:maintainer "Ido Magal" . "misc@satans.church") (:keywords "distraction free" "writing") (:url . "https://github.com/idomagal/Tabula-Rasa/blob/master/tabula-rasa.el"))])
+ (tagedit . [(20161121 855) ((s (1 3 1)) (dash (1 0 3))) "Some paredit-like features for html-mode" single ((:commit . "b3a70101a0dcf85498c92b7fcfa7fdbac869746c") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com") (:keywords "convenience"))])
+ (take-off . [(20140531 917) ((emacs (24 3)) (web-server (0 1 0))) "Emacs remote web access" tar ((:commit . "aa9ea45566fc74febbb6ee9c409ecc4b59246215") (:authors ("Thomas Burette" . "burettethomas@gmail.com")) (:maintainer "Thomas Burette" . "burettethomas@gmail.com") (:url . "https://github.com/tburette/take-off"))])
+ (talonscript-mode . [(20220204 1441) ((emacs (24 3))) "Major mode for Talon Voice's .talon files" single ((:commit . "b6eb61f56349e0d47276270163ec611c2d5b188e") (:authors ("Jcaw" . "toastedjcaw@gmail.com")) (:maintainer "Jcaw" . "toastedjcaw@gmail.com") (:keywords "languages") (:url . "https://github.com/jcaw/talonscript-mode"))])
+ (tango-2-theme . [(20120312 2025) nil "Tango 2 color theme for GNU Emacs 24" single ((:commit . "64e44c98e41ebbe3b827d54280e3b9615787daaa") (:authors ("Nick Parker")) (:maintainer "Nick Parker"))])
+ (tango-plus-theme . [(20211222 1100) nil "A color theme based on the tango palette" single ((:commit . "774b03f932bbc336ce5f943af175d5faa651f2e0") (:authors ("Titus von der Malsburg" . "malsburg@posteo.de")) (:maintainer "Titus von der Malsburg" . "malsburg@posteo.de") (:url . "https://github.com/tmalsburg/tango-plus-theme"))])
+ (tangotango-theme . [(20220106 1039) nil "Tango Palette color theme for Emacs 24." single ((:commit . "9509035842c5ea44f594879199a74c9fc6d2a368") (:authors ("Julien Barnier")) (:maintainer "Julien Barnier") (:keywords "tango" "palette" "color" "theme" "emacs") (:url . "https://github.com/juba/color-theme-tangotango"))])
+ (tao-theme . [(20220414 354) nil "This package provides two parametrized uncoloured color themes for Emacs: tao-yin and tao-yang." tar ((:commit . "d6fe980783e22df310df1ae51ac249c28c83ac53") (:authors ("Peter Kosov" . "11111000000@email.com")) (:maintainer "Peter Kosov" . "11111000000@email.com") (:url . "http://github.com/11111000000/tao-theme-emacs"))])
+ (taskpaper-mode . [(20220410 1953) nil "Major mode for working with TaskPaper files" single ((:commit . "12c2f7e01a0e5cc9a57c9d8a8f3fecc8f8ddecb2") (:authors ("Dmitry Safronov" . "saf.dmitry@gmail.com")) (:maintainer "Dmitry Safronov" . "saf.dmitry@gmail.com") (:keywords "outlines" "notetaking" "task management" "productivity" "taskpaper") (:url . "https://github.com/saf-dmitry/taskpaper-mode"))])
+ (taskrunner . [(20190916 1608) ((emacs (25 1)) (projectile (2 0 0)) (async (1 9 3))) "Retrieve build system/taskrunner tasks" tar ((:commit . "716323aff410b4d864d137c9ebe4bbb5b8587f5e") (:authors ("Yavor Konstantinov <ykonstantinov1 AT gmail DOT com>")) (:maintainer "Yavor Konstantinov <ykonstantinov1 AT gmail DOT com>") (:keywords "build-system" "taskrunner" "build" "task-runner" "tasks" "convenience") (:url . "https://github.com/emacs-taskrunner/emacs-taskrunner"))])
+ (tawny-mode . [(20191108 1346) ((cider (0 12)) (emacs (25))) "Ontology Editing with Tawny-OWL" single ((:commit . "82f343bac637e62f31152d72086c7facd4dfea27") (:authors ("Phillip Lord" . "phillip.lord@newcastle.ac.uk")) (:maintainer "Phillip Lord" . "phillip.lord@newcastle.ac.uk"))])
+ (tblui . [(20161007 1912) ((dash (2 12 1)) (magit-popup (2 6 0)) (tablist (0 70)) (cl-lib (0 5))) "Define tabulated list UI easily" single ((:commit . "bb29323bb3e27093d50cb42db3a9329a096b6e4d") (:authors ("Yuki Inoue <inouetakahiroki _at_ gmail.com>")) (:maintainer "Yuki Inoue <inouetakahiroki _at_ gmail.com>") (:url . "https://github.com/Yuki-Inoue/tblui.el"))])
+ (tbx2org . [(20140224 1559) ((dash (2 5 0)) (s (1 8 0)) (cl-lib (0 4))) "Tinderbox to org-mode conversion" single ((:commit . "08e9816ba6066f56936050b58d07ceb2187ae6f7") (:authors ("istib")) (:maintainer "istib") (:keywords "org-mode") (:url . "https://github.com/istib/tbx2org"))])
+ (tc . [(20220122 1443) nil "a Japanese input method with T-Code on Emacs" tar ((:commit . "d0adf22f5aed4d9608778108b60a06c9ea58b289") (:authors ("Kaoru Maeda" . "maeda@src.ricoh.co.jp") ("Yasushi Saito" . "yasushi@cs.washington.edu") ("KITAJIMA Akira" . "kitajima@isc.osakac.ac.jp")) (:maintainer "KITAJIMA Akira"))])
+ (tco . [(20191129 2040) ((dash (1 2 0)) (emacs (24 3))) "Tail-call optimisation for Emacs lisp" single ((:commit . "d82478d56568f60b3a82fd010b3ca0bab2ef5dc9") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:url . "https://github.com/Wilfred/tco.el"))])
+ (tea-time . [(20120331 820) nil "Simple timer package, useful to make perfect tea." single ((:commit . "1f6cf0bdd27c5eb3508989c5095427781f858eca") (:authors ("konsty" . "antipin.konstantin@googlemail.com")) (:maintainer "Gabriel Saldana" . "gsaldana@gmail.com") (:keywords "timer" "tea-time"))])
+ (teacode-expand . [(20181231 640) ((emacs (24 4))) "Expansion of text by TeaCode program." single ((:commit . "2122e4b32ed4edd2d7ebc0ff8ebf407e29d6e910") (:authors ("Richard Guay" . "raguay@customct.com")) (:maintainer "Richard Guay" . "raguay@customct.com") (:keywords "lisp") (:url . "https://github.com/raguay/TeaCode-Expand"))])
+ (teco . [(20200707 2309) nil "Teco interpreter" single ((:commit . "61caf8f419659a0567a269f290c90427a215d77b") (:authors ("Dale R. Worley" . "worley@alum.mit.edu")) (:maintainer "Mark T. Kennedy" . "mtk@acm.org") (:keywords "convenience" "emulations" "files") (:url . "https://github.com/mtk/teco.git"))])
+ (telega . [(20220503 349) ((emacs (26 1)) (visual-fill-column (1 9)) (rainbow-identifiers (0 2 2))) "Telegram client (unofficial)" tar ((:commit . "29010616931f52e3a5aa9d155c14873c09c7306b") (:authors ("Zajcev Evgeny" . "zevlg@yandex.ru")) (:maintainer "Zajcev Evgeny" . "zevlg@yandex.ru") (:keywords "comm") (:url . "https://github.com/zevlg/telega.el"))])
+ (telepathy . [(20131209 1258) nil "Access Telepathy from Emacs" single ((:commit . "211d785b02a29ddc254422fdcc3db45262582f8c") (:authors ("Nicolas Petton" . "petton.nicolas@gmail.com")) (:maintainer "Nicolas Petton" . "petton.nicolas@gmail.com") (:keywords "telepathy" "tools"))])
+ (telephone-line . [(20220424 400) ((emacs (24 4)) (cl-lib (0 5)) (cl-generic (0 2)) (seq (1 8))) "Rewrite of Powerline" tar ((:commit . "6f3455a365912e8f0c45a2240ea79507dee45ade") (:authors ("Daniel Bordak" . "dbordak@fastmail.fm")) (:maintainer "Daniel Bordak" . "dbordak@fastmail.fm") (:keywords "mode-line") (:url . "https://github.com/dbordak/telephone-line"))])
+ (teletext . [(20211203 1111) ((emacs (24 3))) "Teletext broadcast viewer" single ((:commit . "6b003e9dab9bd0c27d188a81f5fff740d66a2282") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "comm" "help" "hypermedia") (:url . "https://github.com/lassik/emacs-teletext"))])
+ (teletext-yle . [(20210927 825) ((emacs (24 3)) (teletext (0 1))) "Teletext provider for Finnish national network YLE" single ((:commit . "9c8f4b503923c4ec688e2dcc9dff62d71bc55933") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "comm" "help" "hypermedia") (:url . "https://github.com/lassik/emacs-teletext-yle"))])
+ (tempel . [(20220509 2139) ((emacs (27 1))) "Tempo templates/snippets with in-buffer field editing" single ((:commit . "b88c58a89390cf3834de898109c5e69a5cf434cd") (:authors ("Daniel Mendler" . "mail@daniel-mendler.de")) (:maintainer "Daniel Mendler" . "mail@daniel-mendler.de") (:url . "https://github.com/minad/tempel"))])
+ (template-overlays . [(20180706 1132) ((emacs (24 4)) (ov (1 0 6))) "Display template regions using overlays" single ((:commit . "d32db58c044b2aca3720879003f55b1d57208b07") (:authors ("Mariano Montone" . "marianomontone@gmail.com")) (:maintainer "Mariano Montone" . "marianomontone@gmail.com") (:keywords "faces" "convenience" "templates" "overlays") (:url . "http://www.github.com/mmontone/template-overlays"))])
+ (templatel . [(20210902 228) ((emacs (25 1))) "Templating language;" single ((:commit . "b52349948b6927f7a5da4e54a89e01c794f2095a") (:authors ("Lincoln Clarete" . "lincoln@clarete.li")) (:maintainer "Lincoln Clarete" . "lincoln@clarete.li") (:url . "https://clarete.li/templatel"))])
+ (temporary-persistent . [(20200201 1719) ((emacs (24 3)) (names (20151201 0)) (dash (2 12 1)) (s (1 10 0))) "Keep temp notes buffers persistent" single ((:commit . "0080879b0257d350aeba1c4d6901613d7dc534de") (:authors ("Kostafey" . "kostafey@gmail.com")) (:maintainer "Kostafey" . "kostafey@gmail.com") (:keywords "temp" "buffers" "notes") (:url . "https://github.com/kostafey/temporary-persistent"))])
+ (ten-hundred-mode . [(20161028 2236) ((cl-lib (0 5))) "use only the ten hundred most usual words" tar ((:commit . "bdcfda49b1819e82d61fe90947e50bb948cf7933"))])
+ (term+ . [(20170509 17) ((emacs (24)) (cl-lib (0 5))) "term-mode enhancement" tar ((:commit . "c3c9239b339c127231860de43abfa08c44c0201a") (:authors ("INA Lintaro <tarao.gnn at gmail.com>")) (:maintainer "INA Lintaro <tarao.gnn at gmail.com>") (:keywords "terminal" "emulation") (:url . "https://github.com/tarao/term-plus-el"))])
+ (term+key-intercept . [(20140211 750) ((term+ (0 1)) (key-intercept (0 1))) "term+ intercept key mapping" single ((:commit . "fd0771fd66b8c7a909aaac972194485c79ba48c4") (:authors ("INA Lintaro <tarao.gnn at gmail.com>")) (:maintainer "INA Lintaro <tarao.gnn at gmail.com>") (:keywords "terminal" "emulation") (:url . "http://github.com/tarao/term+-el"))])
+ (term+mux . [(20140211 749) ((term+ (0 1)) (tab-group (0 1))) "term+ terminal multiplexer and session management" single ((:commit . "81b60e80cf008472bfd7fad9233af2ef722c208a") (:authors ("INA Lintaro <tarao.gnn at gmail.com>")) (:maintainer "INA Lintaro <tarao.gnn at gmail.com>") (:keywords "terminal" "emulation") (:url . "http://github.com/tarao/term+-el"))])
+ (term-alert . [(20210414 1638) ((emacs (24 0)) (term-cmd (1 1)) (alert (1 1)) (f (0 18 2))) "Notifications when commands complete in term.el." tar ((:commit . "ca1b48ad911bc972b049f48fe0531e702dbc553c") (:authors ("Callie Cameron" . "cjcameron7@gmail.com")) (:maintainer "Callie Cameron" . "cjcameron7@gmail.com") (:keywords "notifications" "processes") (:url . "https://github.com/calliecameron/term-alert"))])
+ (term-cmd . [(20210417 1447) ((emacs (27 2)) (dash (2 12 0)) (f (0 18 2))) "Send commands from programs running in term.el." tar ((:commit . "281b9a6d864ca85dc1451dc46baca98f48dc3f60") (:authors ("Callie Cameron" . "cjcameron7@gmail.com")) (:maintainer "Callie Cameron" . "cjcameron7@gmail.com") (:keywords "processes") (:url . "https://github.com/calliecameron/term-cmd"))])
+ (term-manager . [(20190610 2032) ((dash (2 12 0)) (emacs (24 4))) "Contextual terminal management" tar ((:commit . "eea7894350a4f31e1df0c666d3fb0bac822d34d2") (:authors ("Ivan Malison" . "IvanMalison@gmail.com")) (:maintainer "Ivan Malison" . "IvanMalison@gmail.com") (:keywords "terminals" "tools") (:url . "https://www.github.com/IvanMalison/term-manager"))])
+ (term-projectile . [(20190307 400) ((emacs (24)) (term-manager (0 1 0)) (projectile (0 13 0))) "projectile terminal management" single ((:commit . "eea7894350a4f31e1df0c666d3fb0bac822d34d2") (:authors ("Ivan Malison" . "IvanMalison@gmail.com")) (:maintainer "Ivan Malison" . "IvanMalison@gmail.com") (:keywords "projectile" "tools" "terminals" "vc") (:url . "https://www.github.com/IvanMalison/term-manager"))])
+ (term-run . [(20200128 702) nil "Run arbitrary command in terminal buffer" single ((:commit . "0fd135d55fcf864598b1fb8dd880833a1a322910") (:authors ("10sr <8slashes+el [at] gmail [dot] com>")) (:maintainer "10sr <8slashes+el [at] gmail [dot] com>") (:keywords "utility" "shell" "command" "term-mode") (:url . "https://github.com/10sr/term-run-el"))])
+ (termbright-theme . [(20151031 235) ((emacs (24 1))) "a more usable theme for white-on-black terminals" single ((:commit . "bec6ab14336c0611e85f45486276004f16d20607") (:authors ("Brian Mastenbrook" . "brian@mastenbrook.net")) (:maintainer "Brian Mastenbrook" . "brian@mastenbrook.net") (:keywords "themes") (:url . "https://github.com/bmastenbrook/termbright-theme-el"))])
+ (terminal-focus-reporting . [(20180830 719) ((emacs (24 4))) "Minor mode for terminal focus reporting." single ((:commit . "6b1dbb2e96b3ff680dbe88153c4c569adbbd64ce") (:authors ("Vitalii Elenhaupt")) (:maintainer "Vitalii Elenhaupt") (:keywords "convenience") (:url . "https://github.com/veelenga/terminal-focus-reporting.el"))])
+ (terminal-here . [(20210605 1453) ((emacs (25 1))) "Run an external terminal in current directory" single ((:commit . "e0e89344624fadf080f6770132ebdd7991355fdd") (:authors ("David Shepherd" . "davidshepherd7@gmail.com")) (:maintainer "David Shepherd" . "davidshepherd7@gmail.com") (:keywords "tools" "frames") (:url . "https://github.com/davidshepherd7/terminal-here"))])
+ (terminal-toggle . [(20190226 1510) ((emacs (24)) (popwin (1 0 0))) "simple pop-up terminal" single ((:commit . "f824d634aef3600cb7a8e2ddf9e8444c6607c160") (:authors ("Mehmet Tekman")) (:maintainer "Mehmet Tekman") (:keywords "outlines") (:url . "https://github.com/mtekman/terminal-toggle.el"))])
+ (tern . [(20181108 722) ((json (1 2)) (cl-lib (0 5)) (emacs (24))) "Tern-powered JavaScript integration" single ((:commit . "ef50c6f0269a6fd9ce742d0a87647d60a0ef850f") (:authors ("Marijn Haverbeke")) (:maintainer "Marijn Haverbeke") (:url . "http://ternjs.net/"))])
+ (tern-auto-complete . [(20170521 1935) ((tern (0 0 1)) (auto-complete (1 4)) (cl-lib (0 5)) (emacs (24))) "Tern Completion by auto-complete.el" single ((:commit . "ef50c6f0269a6fd9ce742d0a87647d60a0ef850f") (:authors ("<m.sakurai at kiwanami.net>")) (:maintainer "<m.sakurai at kiwanami.net>"))])
+ (tern-context-coloring . [(20161218 747) ((emacs (24 3)) (context-coloring (8 1 0)) (tern (0 0 1))) "Use Tern for context coloring" single ((:commit . "3a8e979d6cc83aabcb3dda3f5f31a6422532efba") (:authors ("Jackson Ray Hamilton" . "jackson@jacksonrayhamilton.com")) (:maintainer "Jackson Ray Hamilton" . "jackson@jacksonrayhamilton.com") (:keywords "convenience" "faces" "tools") (:url . "https://github.com/jacksonrayhamilton/tern-context-coloring"))])
+ (terraform-doc . [(20211003 1333) ((emacs (24 4))) "Look up terraform documentation on the fly" single ((:commit . "16179e57ce290190c222b27961900657a1981330") (:authors ("Giap Tran" . "txgvnn@gmail.com")) (:maintainer "Giap Tran" . "txgvnn@gmail.com") (:keywords "comm") (:url . "https://github.com/TxGVNN/terraform-doc"))])
+ (terraform-mode . [(20210621 1953) ((emacs (24 3)) (hcl-mode (0 3)) (dash (2 17 0))) "Major mode for terraform configuration file" single ((:commit . "e560caaa9d9a11b0868adf6d9dcae5ebb5055730") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-terraform-mode"))])
+ (test-c . [(20180423 1720) ((emacs (24 3))) "quickly test c code" single ((:commit . "761a576f62c7021ba941f178f153c51289df1553") (:authors ("Aurélien Aptel" . "aurelien.aptel@gmail.com")) (:maintainer "Aurélien Aptel" . "aurelien.aptel@gmail.com") (:url . "http://github.com/aaptel/test-c"))])
+ (test-case-mode . [(20130525 1434) ((fringe-helper (0 1 1))) "unit test front-end" single ((:commit . "6074df10ebc97ddfcc228c71c73db179e672dac3") (:authors ("Nikolaj Schumacher <bugs * nschum de>")) (:maintainer "Nikolaj Schumacher <bugs * nschum de>") (:keywords "tools") (:url . "http://nschum.de/src/emacs/test-case-mode/"))])
+ (test-kitchen . [(20171129 2035) nil "Run test-kitchen inside of emacs" single ((:commit . "0fc0ca4808425f03fbeb8125246043723e2a179a") (:authors ("JJ Asghar")) (:maintainer "JJ Asghar") (:keywords "chef" "ruby" "test-kitchen") (:url . "http://github.com/jjasghar/test-kitchen-el"))])
+ (test-simple . [(20200722 1121) ((cl-lib (0))) "Simple Unit Test Framework for Emacs Lisp" single ((:commit . "ce6de04636e8d19ec84a475c03c0142b20a63de0") (:authors ("Rocky Bernstein" . "rocky@gnu.org")) (:maintainer "Rocky Bernstein" . "rocky@gnu.org") (:keywords "unit-test") (:url . "https://github.com/rocky/emacs-test-simple"))])
+ (tex-smart-umlauts . [(20190316 2215) nil "Smart umlaut conversion for TeX." single ((:commit . "f15ed781b1fb38bf3e46c481dd602c3999920b99") (:authors ("Frank Fischer <frank-fischer at shadow-soft.de>")) (:maintainer "Frank Fischer <frank-fischer at shadow-soft.de>") (:keywords "tex" "wp") (:url . "http://hub.darcs.net/lyro/tex-smart-umlauts"))])
+ (texfrag . [(20220508 642) ((emacs (25)) (auctex (11 90 2))) "preview LaTeX fragments in alien major modes" single ((:commit . "bcceb82971c10b8c0b058b77b3764669900392aa") (:authors ("Tobias Zawada" . "i@tn-home.de")) (:maintainer "Tobias Zawada" . "i@tn-home.de") (:keywords "tex" "languages" "wp") (:url . "https://github.com/TobiasZawada/texfrag"))])
+ (text-categories . [(20220411 2150) ((emacs (26 2))) "Assign text categories to a buffer for mass deletion" single ((:commit . "44cf654a4da7907fb53c8783f1eefa69fce00b43") (:authors ("Dionisios Spiliopoulos" . "dennisspiliopoylos@gmail.com")) (:maintainer "Dionisios Spiliopoulos" . "dennisspiliopoylos@gmail.com") (:keywords "lisp") (:url . "https://github.com/Dspil/text-categories"))])
+ (textile-mode . [(20210912 906) nil "Textile markup editing major mode" single ((:commit . "a49d9bf42166584cca395a92311e9d0a199efc46") (:authors ("Julien Barnier" . "julien@nozav.org")) (:maintainer "Julien Barnier" . "julien@nozav.org") (:keywords "wp" "languages") (:url . "https://github.com/juba/textile-mode"))])
+ (textmate . [(20110816 2146) nil "TextMate minor mode for Emacs" single ((:commit . "350918b070148f0ace6d9d3cd4ebcaf15c1a8781") (:authors ("Chris Wanstrath" . "chris@ozmm.org")) (:maintainer "Chris Wanstrath" . "chris@ozmm.org") (:keywords "textmate" "osx" "mac"))])
+ (textmate-to-yas . [(20160409 1708) nil "Import Textmate macros into yasnippet syntax" tar ((:commit . "be3a768b7ac4c2e24b9d4aa6e9ac1d916cdc5a73") (:authors ("Matthew L. Fidler")) (:maintainer "Matthew L. Fidler") (:keywords "yasnippet" "textmate") (:url . "https://github.com/mlf176f2/textmate-to-yas.el/"))])
+ (textsize . [(20220427 1445) ((emacs (26 1))) "Configure frame text size automatically" single ((:commit . "df91392c3c928d7841631f5809716b9cf0f7309e") (:authors ("James Ferguson" . "james@faff.org")) (:maintainer "James Ferguson" . "james@faff.org") (:keywords "convenience") (:url . "https://github.com/WJCFerguson/textsize"))])
+ (textx-mode . [(20170516 911) ((emacs (24 3))) "Major mode for editing TextX files" single ((:commit . "72f9f0c5855b382024f0da8f56833c22a70a5cb3") (:authors ("Novak Boškov" . "gnovak.boskov@gmail.com")) (:maintainer "Novak Boškov" . "gnovak.boskov@gmail.com") (:keywords "textx") (:url . "https://github.com/novakboskov/textx-mode"))])
+ (tf2-conf-mode . [(20161209 1620) nil "TF2 Configuration files syntax highlighting" single ((:commit . "536950f64c071ffd8495fb2c7ac7c63a11e25f93") (:authors ("Guillermo Robles" . "guillerobles1995@gmail.com")) (:maintainer "Guillermo Robles" . "guillerobles1995@gmail.com") (:keywords "languages") (:url . "https://github.com/wynro/emacs-tf2-conf-mode"))])
+ (tfsmacs . [(20180911 2114) ((emacs (25)) (tablist (0 70))) "MS TFS source control interaction." single ((:commit . "6865d7bf772a6ecabacc868e45a0f5a5e197e1a5") (:authors ("Dino Chiesa <dpchiesa@outlook.com>, Sebastian Monia" . "smonia@outlook.com")) (:maintainer "Dino Chiesa <dpchiesa@outlook.com>, Sebastian Monia" . "smonia@outlook.com") (:keywords "tfs" "vc") (:url . "http://github.com/sebasmonia/tfsmacs/"))])
+ (the-matrix-theme . [(20220503 1325) ((emacs (26 1))) "Green-on-black dark theme inspired by \"The Matrix\" movie" single ((:commit . "f2f69c3aa9c76dc3c27e9bf3c965e66f8b7f61cc") (:authors ("Dan Dee" . "monkeyjunglejuice@pm.me")) (:maintainer "Dan Dee" . "monkeyjunglejuice@pm.me") (:keywords "faces" "theme") (:url . "https://github.com/monkeyjunglejuice/matrix-emacs-theme"))])
+ (theme-anchor . [(20220204 321) ((emacs (26))) "Apply theme in current buffer only" single ((:commit . "c6f715d4ccd30e83922e39cab856578ce19224bb") (:authors ("Liāu, Kiong-Gē" . "gliao.tw@pm.me")) (:maintainer "Liāu, Kiong-Gē" . "gliao.tw@pm.me") (:keywords "extensions" "lisp" "theme") (:url . "https://github.com/GongYiLiao/theme-anchor"))])
+ (theme-changer . [(20201226 2256) nil "Sunrise/Sunset Theme Changer for Emacs" single ((:commit . "57b8c579f134374a45bec9043feff6b29bb4f108") (:authors ("Joshua B. Griffith" . "josh.griffith@gmail.com")) (:maintainer "Joshua B. Griffith" . "josh.griffith@gmail.com") (:keywords "color-theme" "deftheme" "solar" "sunrise" "sunset") (:url . "https://github.com/hadronzoo/theme-changer"))])
+ (theme-looper . [(20210827 424) ((emacs (24)) (cl-lib (0 5))) "A package for switching themes in Emacs interactively" single ((:commit . "e6e8efd740df0b68db89805ba72492818dba61ab") (:authors ("Mohammed Ismail Ansari" . "team.terminal@gmail.com")) (:maintainer "Mohammed Ismail Ansari" . "team.terminal@gmail.com") (:keywords "convenience" "color-themes") (:url . "http://ismail.teamfluxion.com"))])
+ (theme-magic . [(20190711 2034) ((emacs (25)) (seq (1 8))) "Apply your Emacs theme to the rest of Linux" tar ((:commit . "844c4311bd26ebafd4b6a1d72ddcc65d87f074e3") (:authors ("GitHub user \"jcaw\"" . "40725916+jcaw@users.noreply.github.com")) (:maintainer "GitHub user \"jcaw\"" . "40725916+jcaw@users.noreply.github.com") (:keywords "unix" "faces" "terminals" "extensions") (:url . "https://github.com/jcaw/theme-magic.el"))])
+ (therapy . [(20151113 1953) ((emacs (24))) "Hooks for managing multiple Python major versions" single ((:commit . "775a92bb7b6b0fcc5b38c0b5198a9d0a1bef788a") (:authors ("Austin Bingham" . "austin.bingham@gmail.com")) (:maintainer "Austin Bingham" . "austin.bingham@gmail.com") (:url . "https://github.com/abingham/therapy"))])
+ (thingopt . [(20160520 2318) nil "Thing at Point optional utilities" single ((:commit . "5679815852652479f3b3c9f3a98affc927384b2c") (:authors ("Tomohiro Matsuyama" . "m2ym.pub@gmail.com")) (:maintainer "Tomohiro Matsuyama" . "m2ym.pub@gmail.com") (:keywords "convenience"))])
+ (thinks . [(20170802 1128) ((cl-lib (0 5))) "Insert text in a think bubble." single ((:commit . "c02f236abc8c2025d9f01460b09b89ebdc96e28d") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "convenience" "quoting") (:url . "https://github.com/davep/thinks.el"))])
+ (thread-dump . [(20170816 1850) nil "Java thread dump viewer" single ((:commit . "204c9600242756d4b514bb5ff6293e052bf4b49d") (:authors ("Dmitry Neverov")) (:maintainer "Dmitry Neverov") (:url . "http://github.com/nd/thread-dump.el"))])
+ (threes . [(20160820 1242) ((emacs (24)) (seq (1 11))) "A clone of Threes (a tiny puzzle game)" single ((:commit . "6981acb30b856c77cba6aba63fefbf102cbdfbb2") (:authors ("Chunyang Xu" . "xuchunyang.me@gmail.com")) (:maintainer "Chunyang Xu" . "xuchunyang.me@gmail.com") (:keywords "games") (:url . "https://github.com/xuchunyang/threes.el"))])
+ (thrift . [(20200212 1903) ((emacs (24))) "major mode for fbthrift and Apache Thrift files" single ((:commit . "a066e6c79778766adb0c60c894e916169ae28b1f") (:keywords "languages"))])
+ (thumb-through . [(20120119 534) nil "Plain text reader of HTML documents" single ((:commit . "08d8fb720f93c6172653e035191a8fa9c3305e63") (:keywords "html"))])
+ (tickscript-mode . [(20171219 203) ((emacs (24 1))) "A major mode for Tickscript files" single ((:commit . "f0579f38ff14954df5002ce30ae6d4a2c978d461") (:authors ("Marc Sherry" . "msherry@gmail.com")) (:maintainer "Marc Sherry" . "msherry@gmail.com") (:keywords "languages") (:url . "https://github.com/msherry/tickscript-mode"))])
+ (tidal . [(20210211 1531) ((haskell-mode (16)) (emacs (24))) "Interact with TidalCycles for live coding patterns" single ((:commit . "39389e4080144c6734dbe3020cc35185f025ebf0") (:authors (nil . "alex@slab.org")) (:maintainer nil . "alex@slab.org") (:keywords "tools") (:url . "https://github.com/tidalcycles/Tidal"))])
+ (tide . [(20220429 1501) ((emacs (25 1)) (dash (2 10 0)) (s (1 11 0)) (flycheck (27)) (typescript-mode (0 1)) (cl-lib (0 5))) "Typescript Interactive Development Environment" tar ((:commit . "83c34c636f47cb0c10c7d1a728fa308bfec40890") (:authors ("Anantha kumaran" . "ananthakumaran@gmail.com")) (:maintainer "Anantha kumaran" . "ananthakumaran@gmail.com") (:keywords "typescript") (:url . "http://github.com/ananthakumaran/tide"))])
+ (tikz . [(20210927 1704) ((emacs (24 1))) "A minor mode to edit TikZ pictures" tar ((:commit . "f9ea0793affa34be29e1861bfa559fd248b7d22e") (:authors ("Emilio Torres-Manzanera" . "torres@uniovi.es")) (:maintainer "Emilio Torres-Manzanera" . "torres@uniovi.es") (:keywords "tex") (:url . "https://github.com/emiliotorres/tikz"))])
+ (tile . [(20161225 357) ((emacs (25 1)) (s (1 9 0)) (dash (2 12 0)) (stream (2 2 3))) "Tile windows with layouts" single ((:commit . "22660f21f6e95de5aba55cd5d293d4841e9a4661") (:authors ("Ivan Malison" . "IvanMalison@gmail.com")) (:maintainer "Ivan Malison" . "IvanMalison@gmail.com") (:keywords "tile" "tiling" "window" "manager" "dynamic" "frames") (:url . "https://github.com/IvanMalison/tile"))])
+ (time-ext . [(20170126 1215) nil "more function for time/date" single ((:commit . "d128becf660fe3f30178eb1b05cd266741f4784a") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "lisp") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/time-ext.el"))])
+ (timecop . [(20160520 1052) ((cl-lib (0 5)) (datetime-format (0 0 1))) "Freeze Time for testing" single ((:commit . "e6427538b547cbe02e1bd6ed4b765c73620bdae8") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "datetime" "testing") (:url . "https://github.com/zonuexe/emacs-datetime"))])
+ (timer-revert . [(20150122 2032) nil "minor mode to revert buffer for a given time interval." tar ((:commit . "615c91dec8b440d2b9b7c725dd733d7432564e45") (:authors ("Yagnesh Raghava Yakkala. http://yagnesh.org")) (:maintainer nil . "hi@yagnesh.org") (:keywords "timer" "revert" "auto-revert.") (:url . "http://github.com/yyr/timer-revert"))])
+ (timesheet . [(20191024 151) ((s (1)) (org (7)) (auctex (11))) "Timesheet management add-on for org-mode" tar ((:commit . "5098dc87d3d4f289b6c1b6532070dacbfe6de9fd") (:authors ("Tom Marble")) (:maintainer "Tom Marble") (:keywords "org" "timesheet") (:url . "https://github.com/tmarble/timesheet.el"))])
+ (timonier . [(20170411 800) ((emacs (24 4)) (s (1 11 0)) (f (0 19 0)) (dash (2 12 0)) (pkg-info (0 5 0)) (hydra (0 13 6)) (request (0 2 0)) (all-the-icons (2 0 0))) "Manage Kubernetes Applications" tar ((:commit . "0a150ea87bf695b43cf1740dfd7e553e0ae7601c") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "kubernetes" "docker") (:url . "https://github.com/nlamirault/timonier"))])
+ (timp . [(20160618 803) ((emacs (24 4)) (cl-lib (0 5)) (fifo-class (1 0)) (signal (1 0))) "Multithreading library" tar ((:commit . "66b21934b1eb8ee428c06dd64b3562ad44776a35") (:authors ("Mola-T" . "Mola@molamola.xyz")) (:maintainer "Mola-T" . "Mola@molamola.xyz") (:keywords "internal" "lisp" "processes" "tools") (:url . "https://github.com/mola-T/timp"))])
+ (timu-rouge-theme . [(20220501 1753) ((emacs (27 1))) "Color theme inspired by the Rouge Theme for VSCode" single ((:commit . "935e4907f01fba2c7c2ecaab88eb7c4163955c3b") (:authors ("Aimé Bertrand" . "aime.bertrand@macowners.club")) (:maintainer "Aimé Bertrand" . "aime.bertrand@macowners.club") (:keywords "faces" "themes") (:url . "https://gitlab.com/aimebertrand/timu-rouge-theme"))])
+ (timu-spacegrey-theme . [(20220501 1509) ((emacs (25 1))) "Color theme inspired by the Spacegray theme in Sublime Text" single ((:commit . "1318c58a118c6c5a95a82e71da5eda6bfcf8f143") (:authors ("Aimé Bertrand" . "aime.bertrand@macowners.club")) (:maintainer "Aimé Bertrand" . "aime.bertrand@macowners.club") (:keywords "faces" "themes") (:url . "https://gitlab.com/aimebertrand/timu-spacegrey-theme"))])
+ (tinkerer . [(20200914 1756) ((s (1 2 0))) "Elisp wrapper for Tinkerer Blogging Engine." single ((:commit . "7cedeb264a44cd62bcd9c778dca52316d09e07e5") (:authors ("Yagnesh Raghava Yakkala" . "hi@yagnesh.org")) (:maintainer "Yagnesh Raghava Yakkala" . "hi@yagnesh.org") (:keywords "tinkerer" "blog" "wrapper") (:url . "https://github.com/yyr/tinkerer.el"))])
+ (tiny . [(20190722 1212) nil "Quickly generate linear ranges in Emacs" single ((:commit . "fd8a6b0b0c564d8242259e20e557ee6041f40908") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "convenience") (:url . "https://github.com/abo-abo/tiny"))])
+ (tiny-menu . [(20161213 1235) ((emacs (24 4))) "Display tiny menus." single ((:commit . "05563b94537b6eb22aeddedef2a6e59e3f88d073") (:authors ("Aaron Bieber" . "aaron@aaronbieber.com")) (:maintainer "Aaron Bieber" . "aaron@aaronbieber.com") (:keywords "menu" "tools") (:url . "https://github.com/aaronbieber/tiny-menu.el"))])
+ (tinypng . [(20200306 911) ((emacs (25 1))) "Compress PNG and JPEG with TinyPNG.com API" single ((:commit . "f7632e073ce13ef5ce30ae5584cb482a8bb9ffff") (:authors ("Xu Chunyang" . "mail@xuchunyang.me")) (:maintainer "Xu Chunyang" . "mail@xuchunyang.me") (:keywords "multimedia") (:url . "https://github.com/xuchunyang/tinypng.el"))])
+ (tinysegmenter . [(20141124 1013) ((cl-lib (0 5))) "Super compact Japanese tokenizer in Javascript ported to emacs lisp" single ((:commit . "872134704bd25c13a4c59552433da4c6881b5230") (:authors ("lugecy" . "lugecy@gmail.com")) (:maintainer "myuhe") (:keywords "convenience") (:url . "https://github.com/myuhe/tinysegmenter.el"))])
+ (titlecase . [(20220510 331) ((emacs (25 1))) "Title-case phrases" tar ((:commit . "8f609e46d4d0c06cd442352ca7d296e2ccb1b62a") (:authors ("Case Duckworth" . "acdw@acdw.net")) (:maintainer "Case Duckworth" . "acdw@acdw.net") (:url . "https://github.com/duckwork/titlecase.el"))])
+ (tj3-mode . [(20180519 1228) nil "major mode for editing TaskJuggler 3 files" single ((:commit . "1d98eb23f1606392f34ef1b80517cfc940fb9950") (:authors ("Christophe Rhodes" . "christophe@rhodes.io")) (:maintainer "Christophe Rhodes" . "christophe@rhodes.io") (:url . "https://github.com/csrhodes/tj3-mode"))])
+ (tldr . [(20210921 1715) ((emacs (24 3))) "tldr client for Emacs" single ((:commit . "d3fd2a809a266c005915026799121c78e8b358f0") (:authors ("Ono Hiroko" . "azazabc123@gmail.com")) (:maintainer "Ono Hiroko" . "azazabc123@gmail.com") (:keywords "tools" "docs") (:url . "https://github.com/kuanyui/tldr.el"))])
+ (tmmofl . [(20121025 1101) nil "Calls functions dependant on font lock highlighting at point" single ((:commit . "532aa6978e994e2b069ffe37aaf9a0011a07dadc") (:authors ("Phillip Lord" . "p.lord@hgmp.mrc.ac.uk")) (:maintainer "Phillip Lord" . "p.lord@hgmp.mrc.ac.uk") (:keywords "minor mode" "font lock" "toggling."))])
+ (tmux-pane . [(20200730 520) ((names (0 5)) (emacs (24)) (s (0))) "Provide integration between emacs window and tmux pane" single ((:commit . "92f67c6d270c7c923edcde81a235ed0b49a61a70") (:keywords "convenience" "terminals" "tmux" "window" "pane" "navigation" "integration") (:url . "https://github.com/laishulu/emacs-tmux-pane"))])
+ (toc-mode . [(20211229 1334) ((emacs (26 1))) "Manage outlines/table of contents of pdf and djvu documents" single ((:commit . "4c9ce0f54d1e3e0c7c75c7f3c2d9a4d50287ca18") (:authors ("Daniel Laurens Nicolai" . "dalanicolai@gmail.com")) (:maintainer "Daniel Laurens Nicolai" . "dalanicolai@gmail.com") (:keywords "tools" "outlines" "convenience") (:url . "https://github.com/dalanicolai/toc-mode"))])
+ (toc-org . [(20220110 1452) nil "add table of contents to org-mode files (formerly, org-toc)" single ((:commit . "bf2e4b358efbd860ecafe6e74776de0885d9d100") (:authors ("Sergei Nosov <sergei.nosov [at] gmail.com>")) (:maintainer "Sergei Nosov <sergei.nosov [at] gmail.com>") (:keywords "org-mode" "org-toc" "toc-org" "org" "toc" "table" "of" "contents") (:url . "https://github.com/snosov1/toc-org"))])
+ (todoist . [(20220412 2337) ((dash (2 15 0)) (transient (0 1 0)) (org (8 3 5)) (emacs (25 3))) "Extension for interacting and managing todoist tasks" single ((:commit . "f6906be346073f082a6d1f9ae14932ec2bfd99f5") (:authors ("Adrien Brochard")) (:maintainer "Adrien Brochard") (:keywords "todoist" "task" "todo" "comm") (:url . "https://github.com/abrochard/emacs-todoist"))])
+ (todotxt . [(20220204 1903) nil "A major mode for editing todo.txt files" single ((:commit . "ddb25fb931b4bbc1af14c4c712d412af454794c4") (:authors ("Rick Dillon" . "rpdillon@killring.org")) (:maintainer "Rick Dillon" . "rpdillon@killring.org") (:keywords "todo.txt" "todotxt" "todotxt.el") (:url . "https://github.com/rpdillon/todotxt.el"))])
+ (todotxt-mode . [(20200228 952) nil "Major mode for editing todo.txt files" single ((:commit . "8b616ce1cf3e18a60757450a0acf22996abb9b79") (:authors ("Adolfo Villafiorita" . "adolfo.villafiorita@me.com")) (:maintainer "Adolfo Villafiorita" . "adolfo.villafiorita@me.com") (:keywords "wp" "files"))])
+ (togetherly . [(20170426 616) ((cl-lib (0 3))) "allow multiple clients to edit a single buffer online" single ((:commit . "a6491bd5dd84f2aded0cd112ff06ae76ff78dfeb") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://hins11.yu-yake.com/"))])
+ (toggle . [(20180316 3) ((cl-lib (0 5))) "quickly open corresponding file (eg test vs impl)." single ((:commit . "09166f32d3ece2b297da036f0abbeba63329580e") (:authors ("Ryan Davis" . "ryand-ruby@zenspider.com")) (:maintainer "Ryan Davis" . "ryand-ruby@zenspider.com") (:keywords "files" "extensions" "convenience"))])
+ (toggle-quotes . [(20140710 926) nil "Toggle between single and double quoted string" single ((:commit . "33abc221d6887f0518337851318065cd86c34b03") (:authors ("Jim Tian" . "tianjin.sc@gmail.com")) (:maintainer "Jim Tian" . "tianjin.sc@gmail.com") (:keywords "convenience" "quotes") (:url . "https://github.com/toctan/toggle-quotes.el"))])
+ (toggle-test . [(20140723 537) nil "Toggle between source and test files in various programming languages" single ((:commit . "e969321f274903d705995a7d0345a257576ec5ff") (:authors ("Raghunandan Rao" . "r.raghunandan@gmail.com")) (:maintainer "Raghunandan Rao" . "r.raghunandan@gmail.com") (:keywords "tdd" "test" "toggle" "productivity") (:url . "https://github.com/rags/toggle-test"))])
+ (toggle-window . [(20141207 1548) nil "toggle current window size between half and full" single ((:commit . "e82c60e543933880402ede11e9423e48a17dde53") (:authors ("Kenny Liu")) (:maintainer "Kenny Liu") (:keywords "hide" "window") (:url . "https://github.com/deadghost/toggle-window"))])
+ (tok-theme . [(20220509 1324) ((emacs (26 1))) "Minimal theme with dark and yellow color scheme" single ((:commit . "a1a224d96665ee14c059eed63dc4b458f6b7a8d8") (:authors ("Topi Kettunen" . "topi@topikettunen.com")) (:maintainer "Topi Kettunen" . "topi@topikettunen.com") (:url . "https://github.com/topikettunen/tok-theme"))])
+ (tokei . [(20220422 2234) ((emacs (27 1)) (magit-section (3 3 0))) "Display codebase statistics" single ((:commit . "181021cd881eecd604a546d4a717866a81c7a511") (:authors ("Daniel Nagy <https://github.com/nagy>")) (:maintainer "Daniel Nagy" . "danielnagy@posteo.de") (:url . "https://github.com/nagy/tokei.el"))])
+ (tomatinho . [(20180621 1748) nil "Simple and beautiful pomodoro timer" tar ((:commit . "b53354b9b9f496c0388d6a573b06b7d6fc53d0bd") (:authors ("Konrad Scorciapino" . "scorciapino@gmail.com")) (:maintainer "Konrad Scorciapino" . "scorciapino@gmail.com") (:keywords "time" "productivity" "pomodoro technique"))])
+ (toml . [(20130903 1255) nil "TOML (Tom's Obvious, Minimal Language) parser" single ((:commit . "994644f9e68c383071eeee23389a7989b228c2d2") (:authors ("Wataru MIYAGUNI" . "gonngo@gmail.com")) (:maintainer "Wataru MIYAGUNI" . "gonngo@gmail.com") (:keywords "toml" "parser") (:url . "https://github.com/gongo/emacs-toml"))])
+ (toml-mode . [(20161107 1800) ((emacs (24)) (cl-lib (0 5))) "Major mode for editing TOML files" single ((:commit . "f6c61817b00f9c4a3cab1bae9c309e0fc45cdd06") (:authors ("Felix Chern" . "idryman@gmail.com")) (:maintainer "Felix Chern" . "idryman@gmail.com") (:keywords "data" "toml") (:url . "https://github.com/dryman/toml-mode.el"))])
+ (tommyh-theme . [(20131004 2330) nil "A bright, bold-colored theme for emacs" single ((:commit . "46d1c69ee0a1ca7c67b569b891a2f28fed89e7d5") (:authors ("William Glass" . "william.glass@gmail.com")) (:maintainer "William Glass" . "william.glass@gmail.com"))])
+ (tongbu . [(20200414 507) ((emacs (25 1)) (web-server (0 1 2))) "A web server to share text or files between two devices" single ((:commit . "6f6e5c5446f0c5735357ab520b249ab97295653e") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:keywords "tools") (:url . "https://github.com/xuchunyang/tongbu.el"))])
+ (topspace . [(20220504 2220) ((emacs (25 1))) "Scroll down & recenter top lines / get upper margins/padding" single ((:commit . "cbd1f7e8dad4284455488f759946d2f38deff2c6") (:authors ("Trevor Edwin Pogue" . "trevor.pogue@gmail.com")) (:maintainer "Trevor Edwin Pogue" . "trevor.pogue@gmail.com") (:keywords "convenience" "scrolling" "center" "cursor" "margin" "padding") (:url . "https://github.com/trevorpogue/topspace"))])
+ (topsy . [(20210831 133) ((emacs (26 3))) "Simple sticky header" single ((:commit . "8ae0976dfdbe4461c33ed44cf1dedc2c903b0bb0") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "convenience") (:url . "https://github.com/alphapapa/topsy.el"))])
+ (tornado-template-mode . [(20141128 1008) nil "A major mode for editing tornado templates" single ((:commit . "667c0663dbbd279b6c345446b9f2bc50eb52b747") (:authors ("Florian Mounier aka paradoxxxzero")) (:maintainer "Florian Mounier aka paradoxxxzero"))])
+ (torus . [(20190325 753) ((emacs (26))) "A buffer groups manager" single ((:commit . "b309da8c2eaee573a2e2572f25a08ce5da9e9990") (:authors ("Chimay")) (:maintainer "Chimay") (:keywords "files" "buffers" "groups" "persistent" "history" "layout" "tabs") (:url . "https://github.com/chimay/torus"))])
+ (total-lines . [(20171227 1239) ((emacs (24 3))) "Keep track of a buffer's total number of lines" single ((:commit . "473fa74a5416697ecd938866518bcad423f8fda6") (:authors ("Hinrik Örn Sigurðsson")) (:maintainer "Hinrik Örn Sigurðsson") (:keywords "convenience" "mode-line") (:url . "https://github.com/hinrik/total-lines"))])
+ (totd . [(20150519 1440) ((s (1 9 0)) (cl-lib (0 5))) "Display a random daily emacs command." single ((:commit . "ca47b618ea8290776cdb5b0f1c2c335691f69660") (:authors ("Erik Hetzner" . "egh@e6h.org")) (:maintainer "Erik Hetzner" . "egh@e6h.org") (:keywords "help"))])
+ (totp . [(20211018 1743) ((emacs (27 1))) "Time-based One-time Password (TOTP)" tar ((:commit . "680b2c969823b91e0b35afbe2a35a610cb2fa26a") (:authors ("Jürgen Hötzel" . "juergen@hoetzel.info")) (:maintainer "Jürgen Hötzel" . "juergen@hoetzel.info") (:keywords "tools" "pass" "password") (:url . "https://github.com/juergenhoetzel/emacs-totp"))])
+ (tox . [(20160810 1555) nil "Launch current python test with tox" single ((:commit . "7655eb254038d5e34433e8a9d66b3ffc9c72e40c") (:authors ("Chmouel Boudjnah" . "chmouel@chmouel.com")) (:maintainer "Chmouel Boudjnah" . "chmouel@chmouel.com") (:keywords "convenience" "tox" "python" "tests") (:url . "https://github.com/chmouel/tox.el"))])
+ (toxi-theme . [(20160424 2126) ((emacs (24))) "A dark color theme by toxi" single ((:commit . "90c8828b91025adf5adc96011a35d25682991b8a") (:authors ("Karsten Schmidt" . "info@postspectacular.com")) (:maintainer "Karsten Schmidt" . "info@postspectacular.com") (:url . "http://bitbucket.org/postspectacular/toxi-theme/"))])
+ (tql-mode . [(20170724 254) ((emacs (24))) "TQL mode" single ((:commit . "488add79eb3fc8ec02aedaa997fe1ed9e5c3e638") (:authors ("Sean McLaughlin" . "seanmcl@gmail.com")) (:maintainer "Sean McLaughlin" . "seanmcl@gmail.com") (:keywords "languages" "tql"))])
+ (tr-ime . [(20211120 718) ((emacs (27 1)) (w32-ime (0 0 1))) "Emulator of IME patch for Windows" tar ((:commit . "e6313639afb51d91efcc417bd0c81afd13bb079c") (:authors ("Masamichi Hosoda" . "trueroad@trueroad.jp")) (:maintainer "Masamichi Hosoda" . "trueroad@trueroad.jp") (:url . "https://github.com/trueroad/tr-emacs-ime-module"))])
+ (traad . [(20180730 48) ((dash (2 13 0)) (deferred (0 3 2)) (popup (0 5 0)) (request (0 2 0)) (request-deferred (0 2 0)) (virtualenvwrapper (20151123)) (f (0 20 0)) (bind-map (1 1 1))) "emacs interface to the traad refactoring server." single ((:commit . "98e23363b7e8a590a2f55976123a8c3da75c87a5") (:authors ("Austin Bingham" . "austin.bingham@gmail.com")) (:maintainer "Austin Bingham" . "austin.bingham@gmail.com") (:url . "https://github.com/abingham/traad"))])
+ (tracking . [(20210713 1609) nil "Buffer modification tracking" tar ((:commit . "710f057fedae6e9b820cce9336fef24b7d057e4c") (:authors ("Jorgen Schaefer" . "forcer@forcix.cx")) (:maintainer "Jorgen Schaefer" . "forcer@forcix.cx") (:url . "https://github.com/emacs-circe/circe/wiki/Tracking"))])
+ (tracwiki-mode . [(20150119 1621) ((xml-rpc (1 6 8))) "Emacs Major mode for working with Trac" single ((:commit . "6a620444d59b438f42383b48cd4c19c03105dba6") (:authors ("Matthew Erickson" . "peawee@peawee.net")) (:maintainer "Matthew Erickson" . "peawee@peawee.net") (:keywords "trac" "wiki" "tickets"))])
+ (tramp-auto-auth . [(20191027 1419) ((emacs (24 4)) (tramp (0 0))) "TRAMP automatic authentication library" single ((:commit . "f15a12dfab651aff60f4a9d70f868030a12344ac") (:authors ("Bruno Félix Rezende Ribeiro" . "oitofelix@gnu.org")) (:maintainer "Bruno Félix Rezende Ribeiro" . "oitofelix@gnu.org") (:keywords "comm" "processes") (:url . "https://github.com/oitofelix/tramp-auto-auth"))])
+ (tramp-hdfs . [(20210526 339) ((emacs (24 4))) "Tramp extension to access hadoop/hdfs file system in Emacs" single ((:commit . "aa93bdbb3d5619c262ce53af1981edcd2a0705e5") (:authors ("Raghav Kumar Gautam" . "raghav@apache.org")) (:maintainer "Raghav Kumar Gautam" . "raghav@apache.org") (:keywords "tramp" "emacs" "hdfs" "hadoop" "webhdfs" "rest"))])
+ (tramp-term . [(20220412 1546) nil "Automatic setup of directory tracking in ssh sessions" single ((:commit . "e2e5375a444d4eb5d144bef12e066c02befd1352") (:authors ("Randy Morris" . "randy.morris@archlinux.us")) (:maintainer "Randy Morris" . "randy.morris@archlinux.us") (:keywords "comm" "terminals") (:url . "https://github.com/randymorris/tramp-term.el"))])
+ (transfer-sh . [(20200601 1708) ((emacs (24 3)) (async (1 0))) "Simple interface for sending buffer contents to transfer.sh" single ((:commit . "0621a66d00ec91a209a542c10b158095088bd44d") (:keywords "comm" "convenience" "files") (:url . "https://gitlab.com/tuedachu/transfer-sh.el"))])
+ (transient . [(20220509 1943) ((emacs (25 1)) (compat (28 1 1 0))) "Transient commands" tar ((:commit . "6fc09a663e408ade0d1b88f47701c96a9b051e34") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "extensions") (:url . "https://github.com/magit/transient"))])
+ (transient-dwim . [(20220425 1331) ((emacs (26 1)) (transient (0 1))) "Useful preset transient commands" single ((:commit . "7b6e70fb49b9d18106748202011863ebc39b864a") (:authors ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Naoya Yamashita" . "conao3@gmail.com") (:keywords "tools") (:url . "https://github.com/conao3/transient-dwim.el"))])
+ (transient-posframe . [(20210102 130) ((emacs (26 0)) (posframe (0 4 3)) (transient (0 2 0))) "Using posframe to show transient" single ((:commit . "dcd898d1d35183a7d4f2c8f0ebcb43b4f8e70ebe") (:authors ("Yanghao Xie")) (:maintainer "Yanghao Xie" . "yhaoxie@gmail.com") (:keywords "convenience" "bindings" "tooltip") (:url . "https://github.com/yanghaoxie/transient-posframe"))])
+ (translate-mode . [(20220402 853) ((emacs (24 3))) "Paragraph-oriented side-by-side doc translation workflow" single ((:commit . "fb73b3d928a8011a21402e2c14aa4aab56bd05ae") (:authors ("Ray Wang" . "rayw.public@gmail.com")) (:maintainer "Ray Wang" . "rayw.public@gmail.com") (:keywords "translate" "convenience" "editing") (:url . "https://github.com/rayw000/translate-mode"))])
+ (transmission . [(20210705 2152) ((emacs (24 4)) (let-alist (1 0 5))) "Interface to a Transmission session" single ((:commit . "a03a6f5c7b133e0a37896b6d993dd6d6d4532cc2") (:authors ("Mark Oteiza" . "mvoteiza@udel.edu")) (:maintainer "Mark Oteiza" . "mvoteiza@udel.edu") (:keywords "comm" "tools"))])
+ (transpose-frame . [(20200307 2119) nil "Transpose windows arrangement in a frame" single ((:commit . "12e523d70ff78cc8868097b56120848befab5dbc") (:authors ("S. Irie")) (:maintainer "S. Irie") (:keywords "window"))])
+ (transpose-mark . [(20150405 716) nil "Transpose data using the Emacs mark" single ((:commit . "667327602004794de97214cf336ac61650ef75b7") (:authors ("Kevin W. van Rooijen" . "kevin.van.rooijen@attichacker.com")) (:maintainer "Kevin W. van Rooijen" . "kevin.van.rooijen@attichacker.com") (:keywords "transpose" "convenience"))])
+ (transwin . [(20200910 1636) ((emacs (24 3))) "Make window/frame transparent" single ((:commit . "1e151e5fc841688f1c4d68e9acc0f7b410cd754c") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/transwin"))])
+ (trashed . [(20220106 1358) ((emacs (25 1))) "Viewing/editing system trash can" single ((:commit . "ddf5830730544435a068f2dc9ac75a81ea69df1d") (:authors ("Shingo Tanaka" . "shingo.fg8@gmail.com")) (:maintainer "Shingo Tanaka" . "shingo.fg8@gmail.com") (:keywords "files" "convenience" "unix") (:url . "https://github.com/shingo256/trashed"))])
+ (travis . [(20150825 1138) ((s (1 9 0)) (dash (2 9 0)) (pkg-info (0 5 0)) (request (0 1 0))) "Emacs client for Travis" tar ((:commit . "754ef07c17fed17ab03664ad11e2b0b2ef5e78ed") (:authors ("Nicolas Lamirault" . "nicolas.lamirault@gmail.com")) (:maintainer "Nicolas Lamirault" . "nicolas.lamirault@gmail.com") (:keywords "travis") (:url . "https://github.com/nlamirault/emacs-travis"))])
+ (tray . [(20220422 1628) ((emacs (27 1)) (compat (28 1 1 0)) (transient (0 3 0))) "Various transient menus" single ((:commit . "1292530acd05956a2f1bd19c94ef6ab59f05ad8a") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "convenience") (:url . "https://git.sr.ht/~tarsius/tray"))])
+ (tree-edit . [(20220407 1629) ((emacs (27 1)) (tree-sitter (0 15 0)) (tsc (0 15 0)) (tree-sitter-langs (0 10 0)) (dash (2 19)) (reazon (0 4 0)) (s (0 0 0))) "A library for structural refactoring and editing" tar ((:commit . "eafee31ca4f532a9dbee326d3ec3bdd1e997223b") (:authors ("Ethan Leba" . "ethanleba5@gmail.com")) (:maintainer "Ethan Leba" . "ethanleba5@gmail.com") (:url . "https://github.com/ethan-leba/tree-edit"))])
+ (tree-mode . [(20151104 1331) nil "A mode to manage tree widgets" single ((:commit . "b06078826d5875d74b0e7b7ac47b0d0917610534") (:authors (nil . "wenbinye@163.com")) (:maintainer nil . "wenbinye@163.com") (:keywords "help" "convenience" "widget"))])
+ (tree-sitter . [(20220212 1632) ((emacs (25 1)) (tsc (0 18 0))) "Incremental parsing system" tar ((:commit . "3cfab8a0e945db9b3df84437f27945746a43cc71") (:authors ("Tuấn-Anh Nguyễn" . "ubolonton@gmail.com")) (:maintainer "Tuấn-Anh Nguyễn" . "ubolonton@gmail.com") (:keywords "languages" "tools" "parsers" "tree-sitter") (:url . "https://github.com/emacs-tree-sitter/elisp-tree-sitter"))])
+ (tree-sitter-indent . [(20220411 1439) ((emacs (26 1)) (tree-sitter (0 12 1)) (seq (2 20))) "Provide indentation with a Tree-sitter backend" single ((:commit . "4ef246db3e4ff99f672fe5e4b416c890f885c09e") (:authors ("Felipe Lema" . "felipelema@mortemale.org")) (:maintainer "Felipe Lema" . "felipelema@mortemale.org") (:keywords "convenience" "internal") (:url . "https://codeberg.org/FelipeLema/tree-sitter-indent.el"))])
+ (tree-sitter-langs . [(20220508 636) ((emacs (25 1)) (tree-sitter (0 15 0))) "Grammar bundle for tree-sitter" tar ((:commit . "deb2d8674be8f777ace50e15c7c041aeddb1d0b2") (:authors ("Tuấn-Anh Nguyễn" . "ubolonton@gmail.com")) (:maintainer "Tuấn-Anh Nguyễn" . "ubolonton@gmail.com") (:keywords "languages" "tools" "parsers" "tree-sitter") (:url . "https://github.com/emacs-tree-sitter/tree-sitter-langs"))])
+ (treefactor . [(20200516 1631) ((emacs (26 1)) (dash (2 16 0)) (f (0 20 0)) (org (9 2 6)) (avy (0 5 0))) "Restructure your messy Org documents" single ((:commit . "75357757022a4399ab772ff0d92065bd114dabe9") (:authors ("Leo Littlebook" . "Leo.Littlebook@gmail.com")) (:maintainer "Leo Littlebook" . "Leo.Littlebook@gmail.com") (:keywords "outlines" "files" "convenience") (:url . "https://github.com/cyberthal/treefactor"))])
+ (treemacs . [(20220506 1056) ((emacs (26 1)) (cl-lib (0 5)) (dash (2 11 0)) (s (1 12 0)) (ace-window (0 9 0)) (pfuture (1 7)) (hydra (0 13 2)) (ht (2 2)) (cfrs (1 3 2))) "A tree style file explorer package" tar ((:commit . "07706547a2a927e6787645538d8bdb6e9418fb62") (:authors ("Alexander Miller" . "alexanderm@web.de")) (:maintainer "Alexander Miller" . "alexanderm@web.de") (:url . "https://github.com/Alexander-Miller/treemacs"))])
+ (treemacs-all-the-icons . [(20220425 1124) ((emacs (26 1)) (all-the-icons (4 0 1)) (treemacs (0 0))) "all-the-icons integration for treemacs" single ((:commit . "07706547a2a927e6787645538d8bdb6e9418fb62") (:authors ("Eric Dallo" . "ercdll1337@gmail.com")) (:maintainer "Eric Dallo" . "ercdll1337@gmail.com") (:url . "https://github.com/Alexander-Miller/treemacs"))])
+ (treemacs-evil . [(20220427 1331) ((emacs (26 1)) (evil (1 2 12)) (treemacs (0 0))) "Evil mode integration for treemacs" single ((:commit . "07706547a2a927e6787645538d8bdb6e9418fb62") (:authors ("Alexander Miller" . "alexanderm@web.de")) (:maintainer "Alexander Miller" . "alexanderm@web.de") (:url . "https://github.com/Alexander-Miller/treemacs"))])
+ (treemacs-icons-dired . [(20211229 1448) ((treemacs (0 0)) (emacs (26 1))) "Treemacs icons for dired" single ((:commit . "07706547a2a927e6787645538d8bdb6e9418fb62") (:authors ("Alexander Miller" . "alexanderm@web.de")) (:maintainer "Alexander Miller" . "alexanderm@web.de") (:url . "https://github.com/Alexander-Miller/treemacs"))])
+ (treemacs-magit . [(20220502 1310) ((emacs (26 1)) (treemacs (0 0)) (pfuture (1 3)) (magit (2 90 0))) "Magit integration for treemacs" single ((:commit . "07706547a2a927e6787645538d8bdb6e9418fb62") (:authors ("Alexander Miller" . "alexanderm@web.de")) (:maintainer "Alexander Miller" . "alexanderm@web.de") (:url . "https://github.com/Alexander-Miller/treemacs"))])
+ (treemacs-persp . [(20220209 2117) ((emacs (26 1)) (treemacs (0 0)) (persp-mode (2 9 7)) (dash (2 11 0))) "Persp-mode integration for treemacs" single ((:commit . "07706547a2a927e6787645538d8bdb6e9418fb62") (:authors ("Alexander Miller" . "alexanderm@web.de")) (:maintainer "Alexander Miller" . "alexanderm@web.de") (:url . "https://github.com/Alexander-Miller/treemacs"))])
+ (treemacs-perspective . [(20220209 2117) ((emacs (26 1)) (treemacs (0 0)) (perspective (2 8)) (dash (2 11 0))) "Perspective integration for treemacs" single ((:commit . "07706547a2a927e6787645538d8bdb6e9418fb62") (:authors ("Alexander Miller" . "alexanderm@web.de") ("Jason Dufair" . "jase@dufair.org")) (:maintainer "Alexander Miller" . "alexanderm@web.de") (:url . "https://github.com/Alexander-Miller/treemacs"))])
+ (treemacs-projectile . [(20211223 1454) ((emacs (26 1)) (projectile (0 14 0)) (treemacs (0 0))) "Projectile integration for treemacs" single ((:commit . "07706547a2a927e6787645538d8bdb6e9418fb62") (:authors ("Alexander Miller" . "alexanderm@web.de")) (:maintainer "Alexander Miller" . "alexanderm@web.de") (:url . "https://github.com/Alexander-Miller/treemacs"))])
+ (treemacs-tab-bar . [(20220221 2038) ((emacs (27 1)) (treemacs (0 0)) (dash (2 11 0))) "Tab bar integration for treemacs" single ((:commit . "07706547a2a927e6787645538d8bdb6e9418fb62") (:authors ("Alexander Miller" . "alexanderm@web.de") ("Jason Dufair" . "jase@dufair.org") ("Aaron Jensen" . "aaronjensen@gmail.com")) (:maintainer "Alexander Miller" . "alexanderm@web.de") (:url . "https://github.com/Alexander-Miller/treemacs"))])
+ (treepy . [(20191108 2217) ((emacs (25 1))) "Generic tree traversal tools" single ((:commit . "3ac940e97f3d03e48ca9d7fcd74916a9b01c72f3") (:authors ("Daniel Barreto" . "daniel.barreto.n@gmail.com")) (:maintainer "Daniel Barreto" . "daniel.barreto.n@gmail.com") (:keywords "lisp" "maint" "tools") (:url . "https://github.com/volrath/treepy.el"))])
+ (treeview . [(20210723 2256) ((emacs (24 4))) "A generic tree navigation library" single ((:commit . "09c8c1d045c7c8eace61b10b6df9d2f9079de78e") (:authors ("Tilman Rassy" . "tilman.rassy@googlemail.com")) (:maintainer "Tilman Rassy" . "tilman.rassy@googlemail.com") (:keywords "lisp" "tools" "internal" "convenience") (:url . "https://github.com/tilmanrassy/emacs-treeview"))])
+ (trident-mode . [(20190410 2036) ((emacs (24)) (slime (20130526)) (skewer-mode (1 5 0)) (dash (1 0 3))) "Live Parenscript interaction" single ((:commit . "109a1bc10bd0c4b47679a6ca5c4cd27c7c8d4ccb") (:authors ("John Mastro" . "john.b.mastro@gmail.com")) (:maintainer "John Mastro" . "john.b.mastro@gmail.com") (:keywords "languages" "lisp" "processes" "tools") (:url . "https://github.com/johnmastro/trident-mode.el"))])
+ (trinary . [(20180904 2313) ((emacs (24))) "Trinary logic." single ((:commit . "f7cbd4f9283dbb0528445a3ea6d3b291d97065f6") (:authors ("Matúš Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matúš Goljer" . "matus.goljer@gmail.com") (:keywords "languages") (:url . "https://github.com/Fuco1/trinary-logic"))])
+ (tron-legacy-theme . [(20220312 1645) nil "An original retro-futuristic theme inspired by Tron: Legacy" single ((:commit . "d775d9f348a942230ea57b6520e1eb56a5d67569") (:authors ("Ian Y.E. Pan")) (:maintainer "Ian Y.E. Pan") (:url . "https://github.com/ianpan870102/tron-legacy-emacs-theme"))])
+ (trr . [(20191019 1403) nil "a type-writing training program on GNU Emacs." tar ((:commit . "f841173e11213ac6916b2d3394b28fb202543871") (:authors ("YAMAMOTO Hirotaka" . "ymmt@is.s.u-tokyo.ac.jp") ("KATO Kenji" . "kato@suri.co.jp") (" *Original Author") ("INAMURA You" . "inamura@icot.or.jp") (" *Original Author")) (:maintainer "YAMAMOTO Hirotaka" . "ymmt@is.s.u-tokyo.ac.jp") (:keywords "games" "faces"))])
+ (truthy . [(20140508 2041) ((list-utils (0 4 2))) "Test the content of a value" single ((:commit . "8ed8d07772aa8457554547eb17e264b5df2b4a69") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "extensions") (:url . "http://github.com/rolandwalker/truthy"))])
+ (try . [(20181204 236) ((emacs (24))) "Try out Emacs packages." single ((:commit . "8831ded1784df43a2bd56c25ad3d0650cdb9df1d") (:authors ("Lars Tveito" . "larstvei@ifi.uio.no")) (:maintainer "Lars Tveito" . "larstvei@ifi.uio.no") (:keywords "packages") (:url . "http://github.com/larstvei/try"))])
+ (ts . [(20210813 1617) ((emacs (26 1)) (dash (2 14 1)) (s (1 12 0))) "Timestamp and date/time library" single ((:commit . "3fee71ceefac71ba55eb34829d7e94bb3df37cee") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "calendar" "lisp") (:url . "http://github.com/alphapapa/ts.el"))])
+ (ts-comint . [(20181219 719) nil "Run a Typescript interpreter in an inferior process window." single ((:commit . "786b88fffc553e122868a1c4883f14136a040df6") (:authors ("Paul Huff" . "paul.huff@gmail.com")) (:maintainer "Paul Huff" . "paul.huff@gmail.com") (:keywords "typescript" "node" "inferior-mode" "convenience") (:url . "https://github.com/josteink/ts-comint"))])
+ (tsc . [(20220212 1632) ((emacs (25 1))) "Core Tree-sitter APIs" tar ((:commit . "3cfab8a0e945db9b3df84437f27945746a43cc71") (:authors ("Tuấn-Anh Nguyễn" . "ubolonton@gmail.com") ("Jorge Javier Araya Navarro" . "jorgejavieran@yahoo.com.mx")) (:maintainer "Tuấn-Anh Nguyễn" . "ubolonton@gmail.com") (:keywords "languages" "tools" "parsers" "dynamic-modules" "tree-sitter") (:url . "https://github.com/emacs-tree-sitter/elisp-tree-sitter"))])
+ (tss . [(20150913 1408) ((auto-complete (1 4 0)) (json-mode (1 1 0)) (log4e (0 2 0)) (yaxception (0 1))) "provide a interface for auto-complete.el/flymake.el on typescript-mode." tar ((:commit . "81ac6351a2ae258fd0ebf916dae9bd5a179fefd0") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "typescript" "completion") (:url . "https://github.com/aki2o/emacs-tss"))])
+ (tt-mode . [(20130804 1110) nil "Emacs major mode for editing Template Toolkit files." single ((:commit . "85ed3832e7eef391f7879d9990d59c7a3493c15e") (:authors ("Dave Cross" . "dave@dave.org.uk")) (:maintainer "Dave Cross" . "dave@dave.org.uk"))])
+ (tuareg . [(20220104 2039) ((emacs (24 4)) (caml (4 8))) "OCaml mode" tar ((:commit . "04f5ab6be9ae1c594bab359819dbaf708ae57fda") (:authors ("Albert Cohen" . "Albert.Cohen@inria.fr") ("Sam Steingold" . "sds@gnu.org") ("Christophe Troestler" . "Christophe.Troestler@umons.ac.be") ("Till Varoquaux" . "till@pps.jussieu.fr") ("Sean McLaughlin" . "seanmcl@gmail.com") ("Stefan Monnier" . "monnier@iro.umontreal.ca")) (:maintainer "Christophe Troestler" . "Christophe.Troestler@umons.ac.be") (:keywords "ocaml" "languages") (:url . "https://github.com/ocaml/tuareg"))])
+ (tubestatus . [(20220303 1736) ((emacs (26 1)) (request (0 3 2))) "Get the London Tube service status" single ((:commit . "c81373f1bc32cbd2e2d642ee10ee1cb31915acb0") (:authors ("Matthieu Petiteau" . "matt@smallwat3r.com")) (:maintainer "Matthieu Petiteau" . "matt@smallwat3r.com") (:url . "https://github.com/smallwat3r/tubestatus.el"))])
+ (tumble . [(20160112 729) ((http-post-simple (0)) (cl-lib (0 5))) "an Tumblr mode for Emacs" single ((:commit . "e8fd7643cccf2b6ea4170f0c5f1f87d007e7fa00") (:authors ("Federico Builes" . "federico.builes@gmail.com")) (:maintainer "Federico Builes" . "federico.builes@gmail.com") (:keywords "tumblr"))])
+ (tumblesocks . [(20191014 356) ((htmlize (1 39)) (oauth (1 0 3)) (markdown-mode (1 8 1))) "An Emacs tumblr client." tar ((:commit . "0e4c3847e31a59d405b9927107a23dde9531d744") (:authors ("gcr" . "gcr@sneakygcr.net")) (:maintainer "gcr" . "gcr@sneakygcr.net") (:url . "http://github.com/gcr/tumblesocks"))])
+ (turing-machine . [(20180222 438) ((emacs (24 4))) "Single-tape Turing machine simulator" single ((:commit . "fa60b76a5bac1f54b7a1b3dc55aae7602c7e385b") (:authors ("Diego A. Mundo" . "diegoamundo@gmail.com")) (:maintainer "Diego A. Mundo" . "diegoamundo@gmail.com") (:keywords "turing" "machine" "simulation") (:url . "http://github.com/therockmandolinist/turing-machine"))])
+ (turkish . [(20170910 1511) nil "Convert to Turkish characters on-the-fly" single ((:commit . "9831a316c176bb21a1b91226323ea4133163e00c") (:authors ("Deniz Yüret")) (:maintainer "Emre Sevinç" . "emre.sevinc@gmail.com") (:keywords "turkish" "languages" "automatic" "conversion") (:url . "http://www.denizyuret.com/2006/11/emacs-turkish-mode.html"))])
+ (turnip . [(20150309 629) ((dash (2 6 0)) (s (1 9 0))) "Interacting with tmux from Emacs" single ((:commit . "2fd32562fc6fc1cda6d91aa939cfb29f9b16e9de") (:authors ("Johann Klähn" . "kljohann@gmail.com")) (:maintainer "Johann Klähn" . "kljohann@gmail.com") (:keywords "terminals" "tools"))])
+ (twig-mode . [(20130220 1850) nil "A major mode for twig" single ((:commit . "2849f273a4855d3314a9c0cc84134f5b28ad5ea6") (:authors ("Bojan Matic aka moljac024")) (:maintainer "Bojan Matic aka moljac024"))])
+ (twilight-anti-bright-theme . [(20160622 848) nil "A soothing Emacs 24 light-on-dark theme" single ((:commit . "523b95fcdbf4a6a6483af314ad05354a3d80f23f") (:authors ("Jim Myhrberg" . "contact@jimeh.me")) (:maintainer "Jim Myhrberg" . "contact@jimeh.me") (:keywords "themes") (:url . "https://github.com/jimeh/twilight-anti-bright-theme.el"))])
+ (twilight-bright-theme . [(20130605 843) nil "A Emacs 24 faces port of the TextMate theme" single ((:commit . "322157cb2f3bf7920ecd209dafc31bc1c7959f49") (:authors ("Jim Myhrberg" . "contact@jimeh.me")) (:maintainer "Jim Myhrberg" . "contact@jimeh.me") (:keywords "themes") (:url . "https://github.com/jimeh/twilight-bright-theme.el"))])
+ (twilight-theme . [(20120412 1303) nil "Twilight theme for GNU Emacs 24 (deftheme)" single ((:commit . "77c4741cb3dcf16e53d06d6c2ffdc660c40afb5b") (:authors ("Nick Parker" . "nickp@developernotes.com")) (:maintainer "Nick Parker" . "nickp@developernotes.com"))])
+ (twitch-api . [(20220420 1547) ((emacs (27 1)) (dash (2 19 0))) "An elisp interface for the Twitch.tv API" single ((:commit . "181681097d1fc8d7b78928f8a5b38c61d0e20ef5") (:keywords "multimedia" "twitch-api") (:url . "https://github.com/BenediktBroich/twitch-api"))])
+ (twittering-mode . [(20181121 1402) nil "Major mode for Twitter" single ((:commit . "114891e8fdb4f06b1326a6cf795e49c205cf9e29") (:authors ("Tadashi MATSUO" . "tad@mymail.twin.ne.jp") ("Y. Hayamizu" . "y.hayamizu@gmail.com") ("Tsuyoshi CHO" . "Tsuyoshi.CHO+develop@Gmail.com") ("Alberto Garcia" . "agarcia@igalia.com") ("Xavier Maillard" . "xavier@maillard.im")) (:maintainer "Tadashi MATSUO" . "tad@mymail.twin.ne.jp") (:keywords "twitter" "web") (:url . "http://twmode.sf.net/"))])
+ (typescript-mode . [(20220506 827) ((emacs (24 3))) "Major mode for editing typescript" tar ((:commit . "4f056f6db77839dc8653afff68dfecf62d83ec70") (:keywords "typescript" "languages") (:url . "http://github.com/ananthakumaran/typescript.el"))])
+ (typing . [(20180830 2203) nil "The Typing Of Emacs" single ((:commit . "a2ef25dde2d8eb91bd9c0c6164cb5208208647fa") (:authors ("Alex Schroeder" . "alex@gnu.org")) (:maintainer "Alex Schroeder" . "alex@gnu.org") (:keywords "games") (:url . "http://www.emacswiki.org/emacs/TypingOfEmacs"))])
+ (typing-game . [(20160426 1220) nil "a simple typing game" single ((:commit . "616435a5270274f4c7b698697674dbb2039049a4") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "lisp" "game"))])
+ (typit . [(20220106 1722) ((emacs (24 4)) (f (0 18)) (mmt (0 1 1))) "Typing game similar to tests on 10 fast fingers" tar ((:commit . "61dba759f8178550bc067a360c42ce1089e99a66") (:authors ("Mark Karpov" . "markkarpov92@gmail.com")) (:maintainer "Mark Karpov" . "markkarpov92@gmail.com") (:keywords "games") (:url . "https://github.com/mrkkrp/typit"))])
+ (typo . [(20200706 1714) nil "Minor mode for typographic editing" single ((:commit . "173ebe4fc7ac38f344b16e6eaf41f79e38f20d57") (:authors ("Jorgen Schaefer" . "forcer@forcix.cx")) (:maintainer "Jorgen Schaefer" . "forcer@forcix.cx") (:keywords "convenience" "wp") (:url . "https://github.com/jorgenschaefer/typoel"))])
+ (typo-suggest . [(20200830 1143) ((emacs (24 3)) (helm (3 0)) (company (0 9 10)) (s (1 12 0)) (dash (2 13 0))) "Don't make typos with the help of helm and company" single ((:commit . "3014d18ae2f0b6b857bb613f373e034c743f4d2e") (:authors ("Kadir Can Çetin" . "kadircancetin@gmail.com")) (:maintainer "Kadir Can Çetin" . "kadircancetin@gmail.com") (:keywords "convenience" "wp") (:url . "https://github.com/kadircancetin/typo-suggest"))])
+ (tzc . [(20220126 604) ((emacs (27 1))) "Converts time between different time zones" single ((:commit . "3af821d2125a67786f93d50d532a71f681f381cc") (:authors ("Md Arif Shaikh" . "arifshaikh.astro@gmail.com")) (:maintainer "Md Arif Shaikh" . "arifshaikh.astro@gmail.com") (:keywords "convenience") (:url . "https://github.com/md-arif-shaikh/tzc"))])
+ (ubuntu-theme . [(20150805 1506) nil "A theme inspired by the default terminal colors in Ubuntu" single ((:commit . "88b0eefc75d4cbcde103057e1c5968d4c3052f69") (:authors ("Francesc Rocher" . "francesc.rocher@gmail.com")) (:maintainer "Francesc Rocher" . "francesc.rocher@gmail.com") (:url . "http://github.com/rocher/ubuntu-theme"))])
+ (uci-mode . [(20210626 1956) ((emacs (25 1))) "Major-mode for chess engine interaction" single ((:commit . "2cdf4de5af96d56108a0a5716416ef3c8ac7bb7c") (:authors ("Dodge Coates and Roland Walker")) (:maintainer "Dodge Coates and Roland Walker") (:keywords "data" "games" "chess") (:url . "https://github.com/dwcoates/uci-mode"))])
+ (ucs-utils . [(20150826 1414) ((persistent-soft (0 8 8)) (pcache (0 2 3)) (list-utils (0 4 2))) "Utilities for Unicode characters" tar ((:commit . "cbfd42f822bf5717934fa2d92060e6e24a813433") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "i18n" "extensions") (:url . "http://github.com/rolandwalker/ucs-utils"))])
+ (udev-mode . [(20200702 1536) ((emacs (24))) "Major mode for editing udev rules files" single ((:commit . "5ca236980662141518603672ebdbdf863756da5a") (:authors ("Benjamin Staffin" . "benley@gmail.com")) (:maintainer "Benjamin Staffin" . "benley@gmail.com") (:keywords "languages" "unix") (:url . "https://github.com/benley/emacs-udev-mode"))])
+ (ue . [(20210929 1258) ((emacs (26 1)) (projectile (2 5 0))) "Minor mode for Unreal Engine projects" tar ((:commit . "7819d5b78e5b52a09b36c634ce404dc8bc3711ef") (:authors ("Oleksandr Manenko" . "seidfzehsd@use.startmail.com")) (:maintainer "Oleksandr Manenko" . "seidfzehsd@use.startmail.com") (:keywords "unreal engine" "languages" "tools") (:url . "https://gitlab.com/unrealemacs/ue.el"))])
+ (uimage . [(20160901 1221) nil "An iimage like mode with the ability to display url images" single ((:commit . "9893d09160ef7e8c0ecdcd74fca99ffeb5f9d70d") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "lisp" "url" "image"))])
+ (ujelly-theme . [(20180214 1624) nil "Ujelly theme for GNU Emacs 24 (deftheme)" single ((:commit . "bf724ce7806a738d2043544061e5f9bbfc56e674") (:authors ("Mark Tran" . "mark.tran@gmail.com")) (:maintainer "Mark Tran" . "mark.tran@gmail.com") (:url . "http://github.com/marktran/color-theme-ujelly"))])
+ (ukrainian-holidays . [(20130720 1349) nil "Ukrainian holidays for Emacs calendar." single ((:commit . "e52b0c92843e9f4d0415a7ba3b8559785497d23d") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:url . "https://github.com/abo-abo/ukrainian-holidays"))])
+ (uml-mode . [(20200129 1147) ((emacs (24 4)) (seq (0))) "Minor mode for ascii uml sequence diagrams" single ((:commit . "4c37ac1c4424b2313cd8f16ba48a98a4cc214200") (:authors ("Ian Martins" . "ianxm@jhu.edu")) (:maintainer "Ian Martins" . "ianxm@jhu.edu") (:keywords "docs") (:url . "http://github.com/ianxm/emacs-uml"))])
+ (uncrustify-mode . [(20130707 1359) nil "Minor mode to automatically uncrustify." single ((:commit . "73893d000361e95784911e5ec268ad0ab2a1473c") (:authors ("Tabito Ohtani" . "koko1000ban@gmail.com")) (:maintainer "Tabito Ohtani" . "koko1000ban@gmail.com") (:keywords "uncrustify"))])
+ (undercover . [(20210602 2119) ((emacs (24)) (dash (2 0 0)) (shut-up (0 3 2))) "Test coverage library for Emacs Lisp" single ((:commit . "1d3587f1fad66a747688f36636b67b33b73447d3") (:authors ("Sviridov Alexander" . "sviridov.vmi@gmail.com")) (:maintainer "Sviridov Alexander" . "sviridov.vmi@gmail.com") (:keywords "lisp" "tests" "coverage" "tools") (:url . "https://github.com/sviridov/undercover.el"))])
+ (underline-with-char . [(20191128 2309) ((emacs (24))) "Underline with a char" single ((:commit . "36577e72aa4fbfa7f1abad01842359209f543751") (:maintainer nil . "marcowahlsoft@gmail.com") (:keywords "convenience") (:url . "https://gitlab.com/marcowahl/underline-with-char"))])
+ (undersea-theme . [(20200719 618) ((emacs (24 3))) "Theme styled after undersea imagery" single ((:commit . "b7b5bffe242fd15b9eb8fe5cb7c9b45e474babbc") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/undersea-theme"))])
+ (underwater-theme . [(20131118 2) nil "A gentle, deep blue color theme" single ((:commit . "4eb9ef014f580adc135d91d1cd68d37a310640b6") (:authors ("Jon-Michael Deldin" . "dev@jmdeldin.com")) (:maintainer "Jon-Michael Deldin" . "dev@jmdeldin.com") (:keywords "faces"))])
+ (undo-fu . [(20220509 1045) ((emacs (25 1))) "Undo helper with redo" single ((:commit . "97e7f4f6e0754fd1b01db9638b3f534b5b4941c2") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://codeberg.com/ideasman42/emacs-undo-fu"))])
+ (undo-fu-session . [(20220509 1044) ((emacs (28 1))) "Persistent undo, available between sessions" single ((:commit . "52c71b1cee2fe944e0013a2823e6fde10b26bc65") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:keywords "convenience") (:url . "https://codeberg.com/ideasman42/emacs-undo-fu-session"))])
+ (undo-propose . [(20210207 45) ((emacs (24 3))) "Simple and safe undo navigation" single ((:commit . "91a1dfe516d90dab69c368f6669bacb2458ec5e9") (:authors ("Jack Kamm")) (:maintainer "Jack Kamm") (:keywords "convenience" "files" "undo" "redo" "history") (:url . "https://github.com/jackkamm/undo-propose.el"))])
+ (undohist . [(20220219 634) ((cl-lib (1 0))) "Persistent undo history for GNU Emacs" single ((:commit . "ec95d5038425bca375865803701c971a9c748114") (:authors ("MATSUYAMA Tomohiro" . "m2ym.pub@gmail.com")) (:maintainer "MATSUYAMA Tomohiro" . "m2ym.pub@gmail.com") (:keywords "convenience"))])
+ (unfill . [(20210106 220) ((emacs (24 1))) "Do the opposite of fill-paragraph or fill-region" single ((:commit . "cd354ea1a74338760ac6f5872d573e3ecb6b4bd2") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "convenience") (:url . "https://github.com/purcell/unfill"))])
+ (unicad . [(20200914 1500) ((emacs (24)) (nadvice (0 3))) "An elisp port of Mozilla Universal Charset Auto Detector" single ((:commit . "a5fd4e326a0607acc3776c11f41826e60b6486c6") (:authors ("Qichen Huang" . "unicad.el@gmail.com")) (:maintainer "Qichen Huang" . "unicad.el@gmail.com") (:keywords "i18n") (:url . "https://github.com/ukari/unicad"))])
+ (unicode-emoticons . [(20150204 1108) nil "Shortcuts for common unicode emoticons" single ((:commit . "fb18631f342b0243cf77cf59ed2067c47aae5233") (:authors ("Gunther Hagleitner")) (:maintainer "Gunther Hagleitner") (:keywords "games" "entertainment" "comms") (:url . "https://github.com/hagleitn/unicode-emoticons"))])
+ (unicode-enbox . [(20140508 2041) ((string-utils (0 3 2)) (ucs-utils (0 7 6)) (list-utils (0 4 2)) (persistent-soft (0 8 8)) (pcache (0 2 3))) "Surround a string with box-drawing characters" single ((:commit . "77074fac1994a4236f111d6a1d0cf79ea3fca151") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "extensions" "interface") (:url . "http://github.com/rolandwalker/unicode-enbox"))])
+ (unicode-escape . [(20160614 1234) ((emacs (24)) (names (20151201 0)) (dash (2 12 1))) "Escape/Unescape unicode notations" single ((:commit . "fc69ec780d9e54c364a9252bd0cf1d2507f3fab7") (:authors ("KOBAYASHI Shigeru (kosh)" . "shigeru.kb@gmail.com")) (:maintainer "KOBAYASHI Shigeru (kosh)" . "shigeru.kb@gmail.com") (:keywords "i18n" "unicode") (:url . "https://github.com/kosh04/unicode-escape.el"))])
+ (unicode-fonts . [(20200803 1335) ((font-utils (0 7 8)) (ucs-utils (0 8 2)) (list-utils (0 4 2)) (persistent-soft (0 8 10)) (pcache (0 3 1))) "Configure Unicode fonts" single ((:commit . "47f2397ade28eba621baa865fd69e4efb71407a5") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "i18n" "faces" "frames" "wp" "interface") (:url . "http://github.com/rolandwalker/unicode-fonts"))])
+ (unicode-math-input . [(20220302 1231) ((emacs (25))) "Insert Unicode math symbols using TeX notation" single ((:commit . "06bf37d649fc3b41fcd5fa29c0b0eda555aaf8bb") (:authors ("Augusto Stoffel")) (:maintainer "Augusto Stoffel") (:url . "https://github.com/astoff/unicode-math-input.el"))])
+ (unicode-progress-reporter . [(20140508 2041) ((emacs (24 1 0)) (ucs-utils (0 7 6)) (list-utils (0 4 2)) (persistent-soft (0 8 8)) (pcache (0 2 3))) "Progress-reporter with fancy characters" single ((:commit . "5e66724fd7d15743213b082474d798117b194494") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "interface") (:url . "http://github.com/rolandwalker/unicode-progress-reporter"))])
+ (unicode-troll-stopper . [(20190209 411) nil "Minor mode for Highlighting Unicode homoglyphs" single ((:commit . "5e8be35a7bf6382384a701663f7438ee27e4b67c") (:authors ("Cam Saül" . "cammsaul@gmail.com")) (:maintainer "Cam Saül" . "cammsaul@gmail.com") (:keywords "unicode") (:url . "https://github.com/camsaul/emacs-unicode-troll-stopper"))])
+ (unicode-whitespace . [(20140508 2041) ((ucs-utils (0 7 6)) (list-utils (0 4 2)) (persistent-soft (0 8 8)) (pcache (0 2 3))) "teach whitespace-mode about fancy characters" single ((:commit . "a18c6b38d78b94f2eb1dcc4cb4fa91b6a17efabe") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "faces" "wp" "interface") (:url . "http://github.com/rolandwalker/unicode-whitespace"))])
+ (unidecode . [(20201213 1449) nil "Transliterate Unicode to ASCII" tar ((:commit . "525b51b38f5b0435642005957740fe22ecb2a53c") (:authors ("sindikat <sindikat at mail36 dot net>")) (:maintainer "John Mastro" . "john.b.mastro@gmail.com"))])
+ (unifdef . [(20200517 514) nil "Delete code guarded by processor directives" single ((:commit . "7a4b76f664c4375e3d98e8af0a29270752c13701") (:authors ("Anders Lindgren")) (:maintainer "Anders Lindgren") (:keywords "convenience" "languages") (:url . "https://github.com/Lindydancer/unifdef"))])
+ (unify-opening . [(20171122 2012) ((emacs (24 4))) "Unify the mechanism to open files" single ((:commit . "502469ddba6d8d52159f53976265f7d956b6b17c") (:authors ("Damien Cassou" . "damien.cassou@gmail.com")) (:maintainer "Damien Cassou" . "damien.cassou@gmail.com") (:url . "https://github.com/DamienCassou/unify-opening"))])
+ (unipoint . [(20140113 2224) nil "a simple way to insert unicode characters by TeX name" single ((:commit . "5da04aebac35a5c9e1d8704f2231808d42f4b36a") (:authors ("Andrew Gwozdziewycz" . "git@apgwoz.com")) (:maintainer "Andrew Gwozdziewycz" . "git@apgwoz.com") (:url . "https://github.com/apgwoz/unipoint"))])
+ (unison . [(20160704 740) ((emacs (24 1))) "sync with Unison" single ((:commit . "a78a04c0d1398d00f75a1bd4799622a65bcb0f28") (:authors ("Kevin Brubeck Unhammer" . "unhammer@fsfe.org")) (:maintainer "Kevin Brubeck Unhammer" . "unhammer@fsfe.org") (:keywords "sync") (:url . "http://github.com/unhammer/unison.el"))])
+ (unison-mode . [(20160513 1501) nil "Syntax highlighting for unison file synchronization program" single ((:commit . "0bd6a65c0d12f87fcf7bdff15fe54444959b93bf") (:authors ("Karl Fogelmark" . "karlfogel@gmail.com")) (:maintainer "Karl Fogelmark" . "karlfogel@gmail.com") (:keywords "symchronization" "unison") (:url . "https://github.com/impaktor/unison-mode"))])
+ (unisonlang-mode . [(20200803 808) ((emacs (25 1))) "Simple major mode for editing Unison" single ((:commit . "2b794adbe0b2a4edd40f350173a32b80bd2c5896") (:authors ("Dario Oddenino")) (:maintainer "Dario Oddenino") (:keywords "languages") (:url . "https://github.com/dariooddenino/unison-mode-emacs"))])
+ (universal-emotions-emoticons . [(20180729 1941) ((emacs (24 4))) "Emoticons For The Six Universal Expressions" single ((:commit . "9cedd09ee65cb9fa71f27b0ab46a8353bdc00902") (:authors ("Grant Rettke" . "gcr@wisdomandwonder.com")) (:maintainer nil . "<gcr@wisdomandwonder.com>") (:keywords "convenience" "docs" "languages") (:url . "https://github.com/grettke/universal-emotions-emoticons"))])
+ (unkillable-scratch . [(20190309 17) ((emacs (24))) "Disallow the \\*scratch\\* buffer from being killed" single ((:commit . "b24c2a760529833f230c14cb02ff6e7ec92288ab") (:authors ("Eric Crosson" . "eric.s.crosson@utexas.com")) (:maintainer "Eric Crosson" . "eric.s.crosson@utexas.com") (:keywords "convenience") (:url . "https://github.com/EricCrosson/unkillable-scratch"))])
+ (unmodified-buffer . [(20220129 2013) ((emacs (24 1))) "Auto revert modified buffer state" single ((:commit . "9095a3f870aa570804a11d75aba0952294199715") (:authors ("Arthur Colombini Gusmao")) (:maintainer "Arthur Colombini Gusmao") (:url . "https://github.com/arthurcgusmao/unmodified-buffer"))])
+ (unobtrusive-magit-theme . [(20200411 1349) ((emacs (24 1))) "An unobtrusive Magit theme" single ((:commit . "aede357009655d19d4468320b2b61b0f26a47593") (:authors ("Thomas A. Brown" . "tabsoftwareconsulting@gmail.com")) (:maintainer "Thomas A. Brown" . "tabsoftwareconsulting@gmail.com") (:keywords "faces" "vc" "magit") (:url . "https://github.com/tee3/unobtrusive-magit-theme"))])
+ (untappd . [(20210815 1544) ((emacs (26 1)) (request (0 3 2)) (emojify (1 2 1))) "Display your latest Untappd feed" single ((:commit . "493d1776d6456b00bf017e71fac9b0721d8cc912") (:authors ("Matthieu Petiteau" . "matt@smallwat3r.com")) (:maintainer "Matthieu Petiteau" . "matt@smallwat3r.com") (:url . "https://github.com/smallwat3r/untappd.el"))])
+ (untitled-new-buffer . [(20161212 1508) ((emacs (24 4)) (magic-filetype (0 2 0))) "Open untitled new buffer like other text editors." single ((:commit . "4eabc6937b0e83062ffce9de0d42110224063a6c") (:authors ("USAMI Kenta" . "tadsan@zonu.me")) (:maintainer "USAMI Kenta" . "tadsan@zonu.me") (:keywords "files" "convenience") (:url . "https://github.com/zonuexe/untitled-new-buffer.el"))])
+ (upbo . [(20180422 822) ((dash (2 12 0)) (emacs (24 4))) "Karma Test Runner Integration" single ((:commit . "1e4b1e7f44f242a6cdcce0c157d07efe667b7bef") (:authors ("Sungho Kim(shiren)")) (:maintainer "Sungho Kim(shiren)") (:keywords "javascript" "js" "test" "karma") (:url . "http://github.com/shiren"))])
+ (uptimes . [(20191121 1030) ((cl-lib (0 5)) (emacs (24))) "Track and display Emacs session uptimes." single ((:commit . "29ae6585eeed5a00719b2e52f5ae1082087c1778") (:authors ("Dave Pearson" . "davep@davep.org")) (:maintainer "Dave Pearson" . "davep@davep.org") (:keywords "processes" "uptime") (:url . "https://github.com/davep/uptimes.el"))])
+ (url-shortener . [(20170805 242) nil "shorten long url and expand tinyurl" single ((:commit . "06db8270213b9e352d6c335b0663059a1353d05e") (:authors ("Yu Yang" . "yy2012cn@NOSPAM.gmail.com")) (:maintainer "Yu Yang" . "yy2012cn@NOSPAM.gmail.com") (:url . "https://github.com/yuyang0/url-shortener"))])
+ (urlenc . [(20140116 1456) nil "URL encoding/decoding utility for Emacs." single ((:commit . "835a6dcb783bbe84714bae87a3464aa0b128bfac") (:authors ("Taiki SUGAWARA" . "buzz.taiki@gmail.com")) (:maintainer "Taiki SUGAWARA" . "buzz.taiki@gmail.com") (:keywords "url") (:url . "https://github.com/buzztaiki/urlenc-el"))])
+ (urscript-mode . [(20190219 1604) ((emacs (24 4))) "major mode for editing URScript." single ((:commit . "b341f96b129ead8fb74d680cb4f546985bf110a9") (:authors ("Guido Schmidt" . "git@guidoschmidt.cc")) (:maintainer "Guido Schmidt" . "git@guidoschmidt.cc") (:keywords "languages") (:url . "https://github.com/guidoschmidt/urscript-mode"))])
+ (usage-memo . [(20170926 37) nil "integration of Emacs help system and memo" single ((:commit . "88e15a9942a3e0a6e36e9c3e51e3edb746067b1a") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "convenience" "languages" "lisp" "help" "tools" "docs") (:url . "http://www.emacswiki.org/cgi-bin/wiki/download/usage-memo.el"))])
+ (use-package . [(20210207 1926) ((emacs (24 3)) (bind-key (2 4))) "A configuration macro for simplifying your .emacs" tar ((:commit . "a7422fb8ab1baee19adb2717b5b47b9c3812a84c") (:authors ("John Wiegley" . "johnw@newartisans.com")) (:maintainer "John Wiegley" . "johnw@newartisans.com") (:keywords "dotemacs" "startup" "speed" "config" "package") (:url . "https://github.com/jwiegley/use-package"))])
+ (use-package-chords . [(20181024 2322) ((use-package (2 1)) (bind-key (1 0)) (bind-chord (0 2)) (key-chord (0 6))) "key-chord keyword for use-package" single ((:commit . "a7422fb8ab1baee19adb2717b5b47b9c3812a84c") (:authors ("Justin Talbott" . "justin@waymondo.com")) (:maintainer "Justin Talbott" . "justin@waymondo.com") (:keywords "convenience" "tools" "extensions") (:url . "https://github.com/waymondo/use-package-chords"))])
+ (use-package-el-get . [(20180131 505) ((use-package (1 0))) "el-get support for use package" single ((:commit . "cba87c4e9a3a66b7c10962e3aefdf11c83d737bc") (:authors ("Edward Knyshov" . "edvorg@gmail.com")) (:maintainer "Edward Knyshov" . "edvorg@gmail.com") (:keywords "dotemacs" "startup" "speed" "config" "package" "tools") (:url . "https://github.com/edvorg/use-package-el-get"))])
+ (use-package-ensure-system-package . [(20180913 1501) ((use-package (2 1)) (system-packages (1 0 4))) "auto install system packages" single ((:commit . "a7422fb8ab1baee19adb2717b5b47b9c3812a84c") (:authors ("Justin Talbott" . "justin@waymondo.com")) (:maintainer "Justin Talbott" . "justin@waymondo.com") (:keywords "convenience" "tools" "extensions") (:url . "https://github.com/waymondo/use-package-ensure-system-package"))])
+ (use-package-hydra . [(20181228 745) ((emacs (24 3)) (use-package (2 4))) "Adds :hydra keyword to use-package macro" single ((:commit . "8cd55a1128fbdf6327bb38a199d206225896d146") (:authors ("Toon Claes" . "toon@iotcl.com")) (:maintainer "Toon Claes" . "toon@iotcl.com") (:keywords "convenience" "extensions" "tools") (:url . "https://gitlab.com/to1ne/use-package-hydra"))])
+ (use-proxy . [(20201209 853) ((exec-path-from-shell (1 12)) (emacs (26 2))) "Enable/Disable proxies respecting your HTTP/HTTPS env" single ((:commit . "b2995563f41c162a082cd4823a499887f807176e") (:authors ("Ray Wang" . "ray.hackmylife@gmail.com")) (:maintainer "Ray Wang" . "ray.hackmylife@gmail.com") (:keywords "proxy" "comm") (:url . "https://github.com/rayw000/use-proxy"))])
+ (use-ttf . [(20220220 150) ((emacs (24 4))) "Keep font consistency across different OSs" single ((:commit . "0cb20745e3889f4eb8ea49c4a748f34f9ddf1fa6") (:authors ("Shen, Jen-Chieh" . "jcs090218@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:url . "https://github.com/jcs-elpa/use-ttf"))])
+ (utimeclock . [(20220425 939) ((emacs (24 4))) "Simple utility for manual time tracking" single ((:commit . "cfd5109e004d3e2522f5e758b3ff7238fcf385d6") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://codeberg.org/ideasman42/emacs-utimeclock"))])
+ (utop . [(20210607 1941) ((emacs (24)) (tuareg (2 2 0))) "Universal toplevel for OCaml" single ((:commit . "42614160c20764b443d082083740e8dcc6cf2f78") (:authors ("Jeremie Dimino" . "jeremie@dimino.org")) (:maintainer "Jeremie Dimino" . "jeremie@dimino.org") (:keywords "ocaml" "languages") (:url . "https://github.com/diml/utop"))])
+ (uuid . [(20120910 851) nil "UUID's for EmacsLisp" single ((:commit . "1519bfeb0e31602b840bc8dd35d7c7e732c159fe") (:authors ("James Mastros")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "lisp"))])
+ (uuidgen . [(20220405 1345) nil "Provides various UUID generating functions" single ((:commit . "7b728c1d92e196c3acf87a004949335cfc18eab3") (:authors ("Kan-Ru Chen" . "kanru@kanru.info")) (:maintainer "Kan-Ru Chen" . "kanru@kanru.info") (:keywords "extensions" "lisp" "tools"))])
+ (uwu-theme . [(20220411 1904) ((emacs (24 1))) "An awesome dark color scheme" single ((:commit . "feef3e73dbcb3fbba431c62a99a3333959f6158e") (:authors ("Kevin Borling")) (:maintainer "Kevin Borling") (:keywords "custom themes" "dark" "faces") (:url . "https://github.com/kborling/uwu-theme"))])
+ (uxntal-mode . [(20220502 154) ((emacs (27 1))) "Major mode for Uxntal assembly" single ((:commit . "39cde87b15a98e0612e30b80e0676211236ac3e7") (:authors ("d_m" . "d_m@plastic-idolatry.com")) (:maintainer "d_m" . "d_m@plastic-idolatry.com") (:url . "https://github.com/non/uxntal-mode"))])
+ (v-mode . [(20220104 142) ((emacs (25 1)) (dash (2 17 0)) (hydra (0 15 0))) "A major mode for the V programming language" single ((:commit . "a701f4cedfff91cf4bcd17c9a2cd16a49f942743") (:keywords "languages" "programming") (:url . "https://github.com/damon-kwok/v-mode"))])
+ (v2ex-mode . [(20160720 345) ((cl-lib (0 5)) (request (0 2)) (let-alist (1 0 3))) "Major mode for visit http://v2ex.com/ site." single ((:commit . "b7d19bb594b43ea3824a6f215dd1e5d1d4c0e8ad") (:authors ("Aborn Jiang" . "aborn.jiang@gmail.com")) (:maintainer "Aborn Jiang" . "aborn.jiang@gmail.com") (:keywords "v2ex" "v2ex.com") (:url . "https://github.com/aborn/v2ex-mode"))])
+ (vagrant . [(20211206 1634) nil "Manage a vagrant box from emacs" single ((:commit . "a232b7385178d5b029ccc5274dfa9b56e5ba43a1") (:authors ("Robert Crim" . "rob@servermilk.com")) (:maintainer "Robert Crim" . "rob@servermilk.com") (:keywords "vagrant" "chef") (:url . "https://github.com/ottbot/vagrant.el"))])
+ (vagrant-tramp . [(20220508 52) ((dash (2 12 0))) "Vagrant method for TRAMP" tar ((:commit . "2b7a4fabd328961384da06e0e302250cd97edc47") (:authors ("Doug MacEachern" . "dougm@vmware.com") ("Ryan Prior " . "ryanprior@gmail.com")) (:maintainer "Doug MacEachern" . "dougm@vmware.com") (:keywords "vagrant") (:url . "https://github.com/dougm/vagrant-tramp"))])
+ (vala-mode . [(20201218 2109) nil "Vala mode derived mode" single ((:commit . "d696a8177e94c81ea557ad364a3b3dcc3abbc50f") (:authors ("2005 Dylan R. E. Moonfire") (" 2008 Étienne BERSAC")) (:maintainer "Étienne BERSAC" . "bersace03@laposte.net") (:keywords "vala" "languages" "oop"))])
+ (vala-snippets . [(20150429 352) ((yasnippet (0 8 0))) "Yasnippets for Vala" tar ((:commit . "671439501060449bd100b9fffd524a86064fbfbb") (:authors ("Daniel Gopar")) (:maintainer "Daniel Gopar") (:url . "https://github.com/gopar/vala-snippets"))])
+ (vale-mode . [(20190725 125) ((emacs (25))) "Major mode for writing Vale vaf files" single ((:commit . "48bbc4b4ee5bf0b1b73e52705c0fbc112b255cd0") (:authors ("Jay Bosamiya" . "jaybosamiya@gmail.com")) (:maintainer "Jay Bosamiya" . "jaybosamiya@gmail.com") (:keywords "convenience" "languages") (:url . "https://github.com/jaybosamiya/vale-mode.el"))])
+ (validate-html . [(20210420 2344) ((emacs (25 1))) "Compilation mode for W3C HTML Validator" single ((:commit . "748e874d50c3a95c61590ae293778e26de05c5f9") (:authors ("Arthur A. Gleckler" . "melpa4aag@speechcode.com")) (:maintainer "Arthur A. Gleckler" . "melpa4aag@speechcode.com") (:keywords "languages" "tools") (:url . "https://github.com/arthurgleckler/validate-html"))])
+ (vampyricdark-theme . [(20220405 2235) ((emacs (25 1))) "VampyricDark Theme" single ((:commit . "7b9ac67efd38466765b85b1dd131d6b64d8f71f9") (:url . "https://github.com/VampyricDark/emacs"))])
+ (vbasense . [(20140221 2353) ((auto-complete (1 4 0)) (log4e (0 2 0)) (yaxception (0 1))) "provide a environment like Visual Basic Editor." tar ((:commit . "8c61a492d7c15218ae1a96e2aebfe6f78bfff6db") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "vba" "completion") (:url . "https://github.com/aki2o/emacs-vbasense"))])
+ (vc-auto-commit . [(20210216 1517) nil "Auto-committing feature for your repository" tar ((:commit . "56f478016a541b395092a9d3cdc0da84a37b30a1") (:authors ("Sylvain Rousseau <thisirs at gmail dot com>")) (:maintainer "Sylvain Rousseau <thisirs at gmail dot com>") (:keywords "vc" "convenience") (:url . "http://github.com/thisirs/vc-auto-commit.git"))])
+ (vc-check-status . [(20210216 1525) nil "Warn you when quitting emacs and leaving repo dirty." tar ((:commit . "d95ef8f0799cd3dd83726ffa9b01b076f378ce34") (:authors ("Sylvain Rousseau <thisirs at gmail dot com>")) (:maintainer "Sylvain Rousseau <thisirs at gmail dot com>") (:keywords "vc" "convenience") (:url . "https://github.com/thisirs/vc-check-status"))])
+ (vc-darcs . [(20220406 659) ((emacs (24))) "a VC backend for darcs" single ((:commit . "56426a235b742618b48fad8538777a9b3ffb7240") (:authors ("Jorgen Schaefer" . "forcer@forcix.cx") ("Juliusz Chroboczek" . "jch@pps.univ-paris-diderot.fr")) (:maintainer "Libor Čapák" . "capak@inputwish.com") (:keywords "vc"))])
+ (vc-defer . [(20201116 701) ((emacs (25 1))) "Defer non-essential vc.el work" single ((:commit . "aeafc419c1788b3ac4f0590c635374eefd7c220c") (:authors ("Matt Armstrong" . "marmstrong@google.com")) (:maintainer "Tom Fitzhenry" . "tomfitzhenry@google.com") (:keywords "vc" "tools") (:url . "https://github.com/google/vc-defer"))])
+ (vc-fossil . [(20210928 737) nil "VC backend for the fossil sofware configuraiton management system" single ((:commit . "7815c30d739a01e1100961abb3f2b93e0ea9920f") (:authors ("Venkat Iyer" . "venkat@comit.com")) (:maintainer "Alfred M. Szmidt" . "ams@gnu.org"))])
+ (vc-hgcmd . [(20211021 1704) ((emacs (25 1))) "VC mercurial backend that uses hg command server" single ((:commit . "d044448965d31ca8214f8bca48487e4d9b9d9a0f") (:authors ("Andrii Kolomoiets" . "andreyk.mad@gmail.com")) (:maintainer "Andrii Kolomoiets" . "andreyk.mad@gmail.com") (:keywords "vc") (:url . "https://github.com/muffinmad/emacs-vc-hgcmd"))])
+ (vc-msg . [(20211224 1354) ((emacs (24 4)) (popup (0 5 0))) "Show commit information of current line" tar ((:commit . "3ad560afc1e0610acd1ce4b9509aedae66276b91") (:authors ("Chen Bin <chenbin DOT sh AT gmail DOT com>")) (:maintainer "Chen Bin <chenbin DOT sh AT gmail DOT com>") (:keywords "git" "vc" "svn" "hg" "messenger") (:url . "http://github.com/redguardtoo/vc-msg"))])
+ (vc-osc . [(20190402 2349) nil "non-resident support for osc version-control" single ((:commit . "bf5a515ed85f7d7cdfe66ed5bf4ef7554f8561e5") (:authors ("Adam Spiers (see vc.el for full credits)")) (:maintainer "Adam Spiers" . "aspiers@suse.com"))])
+ (vcomp . [(20190128 20) nil "compare version strings" single ((:commit . "f839b3b3257a564b19d7f9557dc8bcbbe0b95842") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "versions") (:url . "https://github.com/tarsius/vcomp"))])
+ (vcsh . [(20200226 1339) ((emacs (25 1))) "vcsh integration" single ((:commit . "7e376436b8f450a5571e19246136ccf77bbdd4f1") (:authors ("Štěpán Němec" . "stepnem@gmail.com")) (:maintainer "Štěpán Němec" . "stepnem@gmail.com") (:keywords "vc" "files") (:url . "https://gitlab.com/stepnem/vcsh-el"))])
+ (vdf-mode . [(20210303 714) ((emacs (24 3))) "Major mode for editing Valve VDF files." single ((:commit . "0910d4f847e9c817eb8da5434b3879048ec4ac92") (:authors ("Philipp Middendorf")) (:maintainer "Philipp Middendorf") (:url . "https://github.com/plapadoo/vdf-mode"))])
+ (vdiff . [(20210426 155) ((emacs (24 4)) (hydra (0 13 0))) "A diff tool similar to vimdiff" single ((:commit . "84b8243d9f5d8082b05794dbc998d43dbdd7676a") (:authors ("Justin Burkett" . "justin@burkett.cc")) (:maintainer "Justin Burkett" . "justin@burkett.cc") (:keywords "diff") (:url . "https://github.com/justbur/emacs-vdiff"))])
+ (vdiff-magit . [(20210908 135) ((emacs (24 4)) (vdiff (0 3)) (magit (2 10 0)) (transient (0 1 0))) "magit integration for vdiff" single ((:commit . "d3a39c3f8cb7ad9a6a769ce45f633b613b067490") (:authors ("Justin Burkett" . "justin@burkett.cc")) (:maintainer "Justin Burkett" . "justin@burkett.cc") (:keywords "diff") (:url . "https://github.com/justbur/emacs-vdiff-magit"))])
+ (vdirel . [(20220412 646) ((emacs (24 4)) (org-vcard (0 1 0)) (helm (1 7 0)) (seq (1 11))) "Manipulate vdir (i.e., vCard) repositories" single ((:commit . "4eebcf91bdb9ee10fbbba198c4995ae070442f26") (:authors ("Damien Cassou" . "damien@cassou.me")) (:maintainer "Damien Cassou" . "damien@cassou.me") (:url . "https://github.com/DamienCassou/vdirel"))])
+ (vdm-comint . [(20181127 2023) ((emacs (25)) (vdm-mode (0 0 4))) "REPL support for vdm-mode" single ((:commit . "56336930555df91787f196acac15680498d17d5e") (:authors ("Peter W. V. Tran-Jørgensen" . "peter.w.v.jorgensen@gmail.com")) (:maintainer "Peter W. V. Tran-Jørgensen" . "peter.w.v.jorgensen@gmail.com") (:keywords "languages") (:url . "https://github.com/peterwvj/vdm-mode"))])
+ (vdm-mode . [(20190328 1408) ((emacs (25))) "Major mode for the Vienna Development Method" tar ((:commit . "56336930555df91787f196acac15680498d17d5e") (:authors ("Peter W. V. Tran-Jørgensen" . "peter.w.v.jorgensen@gmail.com")) (:maintainer "Peter W. V. Tran-Jørgensen" . "peter.w.v.jorgensen@gmail.com") (:keywords "languages") (:url . "https://github.com/peterwvj/vdm-mode"))])
+ (vdm-snippets . [(20190313 1122) ((emacs (24)) (yasnippet (0 13 0))) "YASnippets for VDM mode" tar ((:commit . "56336930555df91787f196acac15680498d17d5e") (:authors ("Peter W. V. Tran-Jørgensen" . "peter.w.v.jorgensen@gmail.com")) (:maintainer "Peter W. V. Tran-Jørgensen" . "peter.w.v.jorgensen@gmail.com") (:keywords "languages") (:url . "https://github.com/peterwvj/vdm-mode"))])
+ (vector-utils . [(20140508 2041) nil "Vector-manipulation utility functions" single ((:commit . "c38ca1c6a23b2b51a6ac36c2c64e50e21cbe9d21") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "extensions") (:url . "http://github.com/rolandwalker/vector-utils"))])
+ (vega-view . [(20210401 1115) ((emacs (25)) (cider (0 24 0)) (parseedn (0 1))) "Vega visualization viewer" single ((:commit . "3793025a523a86acc6255b4183b12ebfc95e1116") (:authors ("Jack Rusher" . "jack@appliedscience.studio")) (:maintainer "Jack Rusher" . "jack@appliedscience.studio") (:keywords "multimedia") (:url . "https://www.github.com/applied-science/emacs-vega-view"))])
+ (verb . [(20220214 943) ((emacs (25 1))) "Organize and send HTTP requests" tar ((:commit . "f6fd85d913c39603695e52d258d02e6030e3d42d") (:authors ("Federico Tedin" . "federicotedin@gmail.com")) (:maintainer "Federico Tedin" . "federicotedin@gmail.com") (:keywords "tools") (:url . "https://github.com/federicotdn/verb"))])
+ (veri-kompass . [(20200213 934) ((emacs (25)) (cl-lib (0 5)) (org (8 2 0))) "verilog codebase navigation facility" single ((:commit . "271903cdf92db05898ee7cffb65641f30fa08280") (:maintainer nil . "andrea_corallo@yahoo.it") (:keywords "languages" "extensions" "verilog" "hardware" "rtl") (:url . "https://gitlab.com/koral/veri-kompass"))])
+ (verify-url . [(20160426 1228) ((cl-lib (0 5))) "find out invalid urls in the buffer or region" single ((:commit . "d6f3623cda8cd526a2d198619b137059cb1ba1ab") (:authors ("DarkSun" . "lujun9972@gmail.com")) (:maintainer "DarkSun" . "lujun9972@gmail.com") (:keywords "convenience" "usability" "url") (:url . "https://github.com/lujun9972/verify-url"))])
+ (verona-mode . [(20200823 536) ((emacs (25 1)) (dash (2 17 0)) (hydra (0 15 0))) "A major mode for the Verona programming language" single ((:commit . "72dd31ef847344d79409503f3c42169041eb3da4") (:keywords "languages" "programming") (:url . "https://github.com/damon-kwok/verona-mode"))])
+ (versuri . [(20211104 1301) ((emacs (26 1)) (dash (2 16 0)) (request (0 3 0)) (anaphora (1 0 4)) (esxml (0 1 0)) (s (1 12 0)) (esqlite (0 3 1))) "The lyrics package" single ((:commit . "c8ea562304194f3379ed8f9c6a785ce8ee72898e") (:authors ("Mihai Olteanu" . "mihai_olteanu@fastmail.fm")) (:maintainer "Mihai Olteanu" . "mihai_olteanu@fastmail.fm") (:keywords "multimedia") (:url . "https://github.com/mihaiolteanu/versuri/"))])
+ (vertica . [(20131217 1511) ((sql (3 0))) "Vertica SQL mode extension" single ((:commit . "3c9647b425c5c13c30bf0cba483646af18196588") (:authors ("Roman Scherer" . "roman@burningswell.com")) (:maintainer "Roman Scherer" . "roman@burningswell.com") (:keywords "sql" "vertica"))])
+ (vertica-snippets . [(20200423 1200) ((yasnippet (0 6 1))) "Yasnippets for Vertica" tar ((:commit . "6ced718d9120878878700592fab430a8542b748f") (:authors ("Andreas Gerler" . "baron@bundesbrandschatzamt.de")) (:maintainer "Andreas Gerler" . "baron@bundesbrandschatzamt.de") (:keywords "convenience" "snippets") (:url . "https://github.com/baron42bba/vertica-snippets"))])
+ (vertigo . [(20211224 1256) ((dash (2 11 0))) "Jump across lines using the home row." single ((:commit . "280b30518529242ee36cd436bd2349c34c35abb0") (:authors ("Fox Kiester" . "noct@posteo.net")) (:maintainer "Fox Kiester" . "noct@posteo.net") (:keywords "vim" "vertigo") (:url . "https://github.com/noctuid/vertigo.el"))])
+ (vhdl-capf . [(20160221 1734) nil "Completion at point function (capf) for vhdl-mode." single ((:commit . "290abe217050f33532bc9ccb04f894123402f414") (:authors ("sh-ow" . "sh-ow@users.noreply.github.com")) (:maintainer "sh-ow" . "sh-ow@users.noreply.github.com") (:keywords "convenience" "usability" "vhdl" "completion") (:url . "https://github.com/sh-ow/vhdl-capf"))])
+ (vhdl-tools . [(20200330 1819) ((ggtags (0 9 0)) (emacs (26 2)) (helm-rg (0 1)) (outshine (3 1 -1))) "Utilities for navigating vhdl sources" single ((:commit . "b5d1eec90bb43ba10178219245afbddb6601e85b") (:authors ("Cayetano Santos")) (:maintainer "Cayetano Santos") (:keywords "convenience" "languages" "vhdl") (:url . "https://gitlab.com/emacs-elisp/vhdl-tools/-/wikis/home"))])
+ (vi-tilde-fringe . [(20141028 242) ((emacs (24))) "Displays tildes in the fringe on empty lines a la Vi." single ((:commit . "f1597a8d54535bb1d84b442577b2024e6f910308") (:authors ("Sylvain Benner" . "sylvain.benner@gmail.com")) (:maintainer "Sylvain Benner" . "sylvain.benner@gmail.com") (:keywords "emulation") (:url . "https://github.com/syl20bnr/vi-tilde-fringe"))])
+ (viewer . [(20170107 202) nil "View-mode extension" single ((:commit . "6c8db025bf4021428f7f2c3ef9d74fb13f5d267a") (:authors ("rubikitch" . "rubikitch@ruby-lang.org")) (:maintainer "rubikitch" . "rubikitch@ruby-lang.org") (:keywords "view" "extensions") (:url . "http://github.com/rubikitch/viewer/"))])
+ (viking-mode . [(20160705 2027) nil "kill first, ask later" single ((:commit . "c76aa265d13ad91d6890d242e142d05e31f0340b") (:authors ("T.v.Dein" . "tlinden@cpan.org")) (:maintainer "T.v.Dein" . "tlinden@cpan.org") (:keywords "kill" "delete") (:url . "https://github.com/tlinden/viking-mode"))])
+ (vim-empty-lines-mode . [(20150111 426) ((emacs (23))) "Vim-like empty line indicator at end of files." single ((:commit . "d4a5034ca8ea0c962ad6e92c86c0fa2a74d2964b") (:authors ("Jonne Mickelin" . "jonne@ljhms.com")) (:maintainer "Jonne Mickelin" . "jonne@ljhms.com") (:keywords "emulations") (:url . "https://github.com/jmickelin/vim-empty-lines-mode"))])
+ (vim-region . [(20140329 1624) ((expand-region (20140127))) "Select region as vim" single ((:commit . "7c4a99ce3678fee40c83ab88e8ad075d2a935fdf") (:authors ("ongaeshi" . "ongaeshi0621@gmail.com")) (:maintainer "ongaeshi" . "ongaeshi0621@gmail.com") (:url . "https://github.com/ongaeshi/emacs-vim-region"))])
+ (vimgolf . [(20200205 1420) nil "VimGolf interface for the One True Editor" single ((:commit . "f565447ed294898588a19438d56c116555d8c628") (:authors ("Tim Visher" . "tim.visher@gmail.com")) (:maintainer "Tim Visher" . "tim.visher@gmail.com") (:keywords "games" "vimgolf" "vim") (:url . "https://github.com/timvisher/vimgolf.el"))])
+ (vimish-fold . [(20201205 1156) ((emacs (24 4)) (cl-lib (0 5)) (f (0 18 0))) "Fold text like in Vim" single ((:commit . "a6501cbfe3db791f9ca17fd986c7202a87f3adb8") (:authors ("Mark Karpov" . "markkarpov92@gmail.com")) (:maintainer "Mark Karpov" . "markkarpov92@gmail.com") (:keywords "convenience") (:url . "https://github.com/mrkkrp/vimish-fold"))])
+ (vimrc-mode . [(20181116 1919) nil "Major mode for vimrc files" single ((:commit . "13bc150a870d5d4a95f1111e4740e2b22813c30e") (:keywords "languages" "vim") (:url . "https://github.com/mcandre/vimrc-mode"))])
+ (virtual-auto-fill . [(20200906 2038) ((emacs (25 2)) (adaptive-wrap (0 7)) (visual-fill-column (1 9))) "Readably display text without adding line breaks" single ((:commit . "ac8bf947a1f87efe8967cb18166178f5fd93a8e1") (:authors ("Luis Gerhorst" . "virtual-auto-fill@luisgerhorst.de")) (:maintainer "Luis Gerhorst" . "virtual-auto-fill@luisgerhorst.de") (:keywords "convenience" "mail" "outlines" "files" "wp") (:url . "https://github.com/luisgerhorst/virtual-auto-fill"))])
+ (virtual-comment . [(20220405 229) ((emacs (26 1))) "Virtual Comments" single ((:commit . "d1f08e8bec3b52818d44ff06f719950b89204126") (:authors ("Thanh Vuong" . "thanhvg@gmail.com")) (:maintainer "Thanh Vuong" . "thanhvg@gmail.com") (:url . "https://github.com/thanhvg/emacs-virtual-comment"))])
+ (virtualenv . [(20140220 2301) nil "Virtualenv for Python" single ((:commit . "276c0f4d6493b402dc4d22ecdf17b2b072e911b3") (:authors ("Aaron Culich" . "aculich@gmail.com")) (:maintainer "Aaron Culich" . "aculich@gmail.com") (:keywords "python" "virtualenv"))])
+ (virtualenvwrapper . [(20190223 1919) ((dash (1 5 0)) (s (1 6 1))) "a featureful virtualenv tool for Emacs" single ((:commit . "c7e84505db4142fd1beebf38ffe37c3f42444ca3") (:authors ("James J Porter" . "porterjamesj@gmail.com")) (:maintainer "James J Porter" . "porterjamesj@gmail.com") (:keywords "python" "virtualenv" "virtualenvwrapper") (:url . "http://github.com/porterjamesj/virtualenvwrapper.el"))])
+ (visible-mark . [(20150624 450) nil "Make marks visible." single ((:commit . "a584db9bc88953b23a9648b3e14ade90767207f8") (:authors ("Ian Kelling" . "ian@iankelling.org")) (:maintainer "Ian Kelling" . "ian@iankelling.org") (:keywords "marking" "color" "faces") (:url . "https://gitlab.com/iankelling/visible-mark"))])
+ (visual-ascii-mode . [(20150129 1046) nil "Visualize ascii code (small integer) on buffer." single ((:commit . "99285a099a17472ddd9f1b4f74e9d092dd8c5947") (:authors ("Dewdrops" . "v_v_4474@126.com")) (:maintainer "Dewdrops" . "v_v_4474@126.com") (:keywords "presentation") (:url . "https://github.com/Dewdrops/visual-ascii-mode"))])
+ (visual-fill-column . [(20220426 2045) ((emacs (25 1))) "fill-column for visual-line-mode" single ((:commit . "cdfe574a51c4fc3519536fa3b169b01d5482d5df") (:authors ("Joost Kremers" . "joostkremers@fastmail.fm")) (:maintainer "Joost Kremers" . "joostkremers@fastmail.fm") (:url . "https://codeberg.org/joostkremers/visual-fill-column"))])
+ (visual-regexp . [(20210502 2019) ((cl-lib (0 2))) "A regexp/replace command for Emacs with interactive visual feedback" single ((:commit . "48457d42a5e0fe10fa3a9c15854f1f127ade09b5") (:authors ("Marko Bencun" . "mbencun@gmail.com")) (:maintainer "Marko Bencun" . "mbencun@gmail.com") (:keywords "regexp" "replace" "visual" "feedback") (:url . "https://github.com/benma/visual-regexp.el/"))])
+ (visual-regexp-steroids . [(20170222 253) ((visual-regexp (1 1))) "Extends visual-regexp to support other regexp engines" tar ((:commit . "a6420b25ec0fbba43bf57875827092e1196d8a9e") (:authors ("Marko Bencun" . "mbencun@gmail.com")) (:maintainer "Marko Bencun" . "mbencun@gmail.com") (:keywords "external" "foreign" "regexp" "replace" "python" "visual" "feedback") (:url . "https://github.com/benma/visual-regexp-steroids.el/"))])
+ (vlc . [(20200328 1143) ((emacs (25 1))) "VideoLAN VLC Media Player Control" single ((:commit . "932840f874e7510ee86e796bb5dc20d44514e31a") (:authors ("Xu Chunyang")) (:maintainer "Xu Chunyang") (:keywords "tools") (:url . "https://github.com/xuchunyang/vlc.el"))])
+ (vlf . [(20191126 2250) nil "View Large Files" tar ((:commit . "cc02f2533782d6b9b628cec7e2dcf25b2d05a27c") (:maintainer "Andrey Kotlarski" . "m00naticus@gmail.com") (:keywords "large files" "utilities") (:url . "https://github.com/m00natic/vlfi"))])
+ (vline . [(20210805 1528) ((emacs (24 3))) "Column highlighting (vertical line displaying) mode" single ((:commit . "f5d7b5743dceca75b81c8c95287cd5b0341debf9") (:authors ("Taiki SUGAWARA" . "buzz.taiki@gmail.com")) (:maintainer "Taiki SUGAWARA" . "buzz.taiki@gmail.com") (:keywords "faces" "editing" "emulating") (:url . "https://www.emacswiki.org/emacs/VlineMode"))])
+ (vmd-mode . [(20210524 27) ((emacs (24 3))) "Fast Github-flavored Markdown preview using a vmd subprocess." single ((:commit . "b2bdf2ab54f8fc37780e6b473e4ad69c0e9ff4a6") (:authors ("Blake Miller" . "blak3mill3r@gmail.com")) (:maintainer "Blake Miller" . "blak3mill3r@gmail.com") (:keywords "markdown" "preview" "live" "vmd") (:url . "https://github.com/blak3mill3r/vmd-mode"))])
+ (voca-builder . [(20161101 1645) ((popup (0 5 2))) "Helps you build up your vocabulary" single ((:commit . "51573beec8cd8308477b0faf453aad93e17f57c5") (:authors ("Yi Tang" . "yi.tang.uk@me.com")) (:maintainer "Yi Tang" . "yi.tang.uk@me.com") (:keywords "english" "vocabulary") (:url . "https://github.com/yitang/voca-builder"))])
+ (volatile-highlights . [(20160612 155) nil "Minor mode for visual feedback on some operations." single ((:commit . "9a20091f0ce7fc0a6b3e641a6a46d5f3ac4d8392") (:authors ("K-talo Miyazaki <Keitaro dot Miyazaki at gmail dot com>")) (:maintainer "K-talo Miyazaki <Keitaro dot Miyazaki at gmail dot com>") (:keywords "emulations" "convenience" "wp") (:url . "http://www.emacswiki.org/emacs/download/volatile-highlights.el"))])
+ (volume . [(20201002 1022) nil "tweak your sound card volume from Emacs" single ((:commit . "afb75a5f7fe41eb28c8dbb1378e80d103eea05c7") (:authors ("Daniel Brockman" . "daniel@brockman.se")) (:maintainer "Daniel Brockman" . "daniel@brockman.se") (:url . "http://www.brockman.se/software/volume-el/"))])
+ (vs-dark-theme . [(20220414 930) ((emacs (24 1))) "Visual Studio IDE dark theme" single ((:commit . "f5eb6387506b22ba7e21b4e335e689cf6768f18b") (:authors ("Jen-Chieh Shen")) (:maintainer "Jen-Chieh Shen") (:url . "https://github.com/emacs-vs/vs-dark-theme"))])
+ (vs-light-theme . [(20220414 931) ((emacs (24 1))) "Visual Studio IDE light theme" single ((:commit . "d585d0a3b87461b01dfad4ceaa7831668c6021d8") (:authors ("Jen-Chieh Shen")) (:maintainer "Jen-Chieh Shen") (:url . "https://github.com/emacs-vs/vs-light-theme"))])
+ (vscdark-theme . [(20191212 107) ((emacs (24 1))) "VS Code Dark+ like theme" single ((:commit . "8eba74059e8a9db974e4056ee024e52fe54da485") (:authors ("Alexander L. Belikoff")) (:maintainer "Alexander L. Belikoff") (:url . "https://github.com/abelikoff/vscdark-theme"))])
+ (vscode-dark-plus-theme . [(20220320 530) nil "Default Visual Studio Code Dark+ theme" single ((:commit . "cec18a9d816fef372a4e70f6ad1e16a42aa93b06") (:authors ("Ian Y.E. Pan")) (:maintainer "Ian Y.E. Pan") (:url . "https://github.com/ianpan870102/vscode-dark-plus-emacs-theme"))])
+ (vscode-icon . [(20201214 2227) ((emacs (25 1))) "Utility package to provide Vscode style icons" tar ((:commit . "909151c8105861aa300f5601e333909d36d0ebf5") (:authors ("James Nguyen" . "james@jojojames.com")) (:maintainer "James Nguyen" . "james@jojojames.com") (:keywords "files" "tools") (:url . "https://github.com/jojojames/vscode-icon-emacs"))])
+ (vterm . [(20220429 21) ((emacs (25 1))) "Fully-featured terminal emulator" tar ((:commit . "b44723552f86407d528c4a6c8057382c061b008e") (:authors ("Lukas Fürmetz" . "fuermetz@mailbox.org")) (:maintainer "Lukas Fürmetz" . "fuermetz@mailbox.org") (:keywords "terminals") (:url . "https://github.com/akermu/emacs-libvterm"))])
+ (vterm-toggle . [(20220416 1034) ((emacs (25 1)) (vterm (0 0 1))) "Toggles between the vterm buffer and other buffers." single ((:commit . "644e9df9f741c3338c248291799375a1778eb98b") (:authors (nil . "jixiuf jixiuf@qq.com")) (:maintainer nil . "jixiuf jixiuf@qq.com") (:keywords "vterm" "terminals") (:url . "https://github.com/jixiuf/vterm-toggle"))])
+ (vtm . [(20200921 338) nil "Manages vterm buffers with configuration files" tar ((:commit . "d770fd8cff7c24688199392ad93c01485c6a9569") (:keywords "convenience") (:url . "https://github.com/laishulu/emacs-vterm-manager"))])
+ (vue-html-mode . [(20180428 2035) nil "Major mode for editing Vue.js templates" single ((:commit . "1514939804bad558584feeb6298b38d22eadf64e") (:authors ("Adam Niederer" . "adam.niederer@gmail.com")) (:maintainer "Adam Niederer" . "adam.niederer@gmail.com") (:keywords "languages" "vue" "template") (:url . "http://github.com/AdamNiederer/vue-html-mode"))])
+ (vue-mode . [(20190415 231) ((mmm-mode (0 5 5)) (vue-html-mode (0 2)) (ssass-mode (0 2)) (edit-indirect (0 1 4))) "Major mode for vue component based on mmm-mode" single ((:commit . "031edd1f97db6e7d8d6c295c0e6d58dd128b9e71") (:authors ("codefalling" . "code.falling@gmail.com")) (:maintainer "codefalling" . "code.falling@gmail.com") (:keywords "languages"))])
+ (vuiet . [(20220218 1024) ((emacs (26 1)) (lastfm (1 1)) (versuri (1 0)) (s (1 12 0)) (bind-key (2 4)) (mpv (0 1 0))) "The music player and explorer for Emacs" single ((:commit . "aed3272b95fc73fd78712ff7dcfc05916f382fed") (:authors ("Mihai Olteanu" . "mihai_olteanu@fastmail.fm")) (:maintainer "Mihai Olteanu" . "mihai_olteanu@fastmail.fm") (:keywords "multimedia") (:url . "https://github.com/mihaiolteanu/vuiet"))])
+ (vulpea . [(20220204 936) ((emacs (27 2)) (org (9 4 4)) (org-roam (2 0 0)) (s (1 12))) "A collection of org-roam note-taking functions" tar ((:commit . "ba44342aea6a81c7b7ca6fcaae9a537701789b5e") (:authors ("Boris Buliga" . "boris@d12frosted.io")) (:maintainer "Boris Buliga" . "boris@d12frosted.io") (:url . "https://github.com/d12frosted/vulpea"))])
+ (vunit-mode . [(20220316 1812) ((hydra (0 14 0)) (emacs (24 3))) "VUnit Runner Interface" single ((:commit . "5643460a7011d6bc13c2d4762f329d19f6c7d46b") (:authors ("Lukas Lichtl" . "support@embed-me.com")) (:maintainer "Lukas Lichtl" . "support@embed-me.com") (:keywords "vunit" "python" "tools") (:url . "https://github.com/embed-me"))])
+ (vyper-mode . [(20180707 1935) ((emacs (24 3))) "Major mode for the Vyper programming language" single ((:commit . "323dfddfc38f0b11697e9ebaf04d1b53297e54e5") (:authors ("Alex Stokes" . "r.alex.stokes@gmail.com")) (:maintainer "Alex Stokes" . "r.alex.stokes@gmail.com") (:keywords "languages") (:url . "https://github.com/ralexstokes/vyper-mode"))])
+ (w32-browser . [(20170101 1954) nil "Run Windows application associated with a file." single ((:commit . "e5c60eafd8f8d3546a0fa295ad5af2414d36b4e6") (:authors ("Emacs Wiki, Drew Adams")) (:maintainer nil . "Drew Adams (concat \"drew.adams\" \"@\" \"oracle\" \".com\")") (:keywords "mouse" "dired" "w32" "explorer") (:url . "http://www.emacswiki.org/w32-browser.el"))])
+ (w32-ime . [(20201107 143) ((emacs (24 4))) "Windows IME UI/UX controler" single ((:commit . "9c62273dce0ba685a591577885b1e216ba832ec1") (:authors ("H.Miyashita") ("MIYOSHI Masanori") ("KOBAYASHI Yasuhiro") ("NTEmacsJP") ("ksugita (gnupack)") ("rzl24ozi") ("TANE") ("Masamichi Hosoda" . "trueroad@trueroad.jp") ("Naoya Yamashita" . "conao3@gmail.com")) (:maintainer "Masamichi Hosoda" . "trueroad@trueroad.jp") (:url . "https://github.com/trueroad/w32-ime.el"))])
+ (w3m . [(20220508 2259) nil "an Emacs interface to w3m" tar ((:commit . "7baf17355289c29d18f993f383c5d6a187f33b35") (:keywords "w3m" "www" "hypermedia"))])
+ (wacspace . [(20180311 2350) ((dash (1 2 0)) (cl-lib (0 2))) "The WACky WorkSPACE manager for emACS" tar ((:commit . "54d19aab6fd2bc5945b7ffc58104e695064927e2") (:authors ("Emanuel Evans" . "emanuel.evans@gmail.com")) (:maintainer "Emanuel Evans" . "emanuel.evans@gmail.com") (:keywords "workspace") (:url . "http://github.com/shosti/wacspace.el"))])
+ (waf-mode . [(20170403 1940) nil "Waf integration for Emacs" single ((:commit . "20c75eabd1d54fbce8e0dbef785c9fb68577ee4f") (:authors ("Denys Valchuk" . "dvalchuk@gmail.com")) (:maintainer "Denys Valchuk" . "dvalchuk@gmail.com") (:url . "https://bitbucket.org/dvalchuk/waf-mode"))])
+ (waher-theme . [(20141115 1230) ((emacs (24 1))) "Emacs 24 theme based on waher for st2 by dduckster" single ((:commit . "60d31519fcfd8e797723d47961b255ae2f2e2c0a") (:authors ("Jasonm23" . "jasonm23@gmail.com")) (:maintainer "Jasonm23" . "jasonm23@gmail.com") (:url . "https://github.com/jasonm23/emacs-waher-theme"))])
+ (wakatime-mode . [(20211104 1455) nil "Automatic time tracking extension for WakaTime" single ((:commit . "a53c0e819258ea9dbea3ad64b16e4c6c6201f5a5") (:authors ("Gabor Torok" . "gabor@20y.hu")) (:maintainer "Alan Hamlett" . "alan@wakatime.com") (:keywords "calendar" "comm"))])
+ (wakib-keys . [(20220211 1304) ((emacs (24 4))) "Minor Mode for Modern Keybindings" single ((:commit . "ed86134f91c532a38d2739dd15ea6cec879cbd8a") (:authors ("Abdulla Bubshait")) (:maintainer "Abdulla Bubshait") (:keywords "convenience" "keybindings" "keys") (:url . "https://github.com/darkstego/wakib-keys/"))])
+ (wal-mode . [(20220409 1214) ((emacs (25 1))) "A major mode for the WAL programming language" single ((:commit . "1daaf882824e8483419dc999c2d5507ad30cc929") (:authors ("Lucas Klemmer" . "lucas.klemmer@jku.at")) (:maintainer "Lucas Klemmer" . "lucas.klemmer@jku.at") (:keywords "languages") (:url . "https://github.com/LucasKl/wal-major-mode"))])
+ (walkclj . [(20220422 854) ((emacs (25)) (parseclj (0 1 0)) (treepy (0 1 0))) "Manipulate Clojure parse trees" single ((:commit . "ce4e7713d801b03f94f5da9898fce09718380ed4") (:authors ("Arne Brasseur")) (:maintainer "Arne Brasseur") (:keywords "languages") (:url . "https://github.com/plexus/walkclj"))])
+ (walkman . [(20220318 2122) ((transient (0 1 0)) (org (8 3 5)) (json-mode (1 6 0)) (emacs (26 3))) "Write HTTP requests in Org mode" single ((:commit . "3118dd4f493caffcc2849058833572dfc0c0e0a9") (:authors ("Adrien Brochard")) (:maintainer "Adrien Brochard") (:keywords "walkman" "http" "curl" "org" "comm") (:url . "https://github.com/abrochard/walkman"))])
+ (wallpaper . [(20201019 2123) ((emacs (25 1))) "Setting the wallpaper" single ((:commit . "cc0101726dd2fa2b4eda06924c7abfae54f663e2") (:authors ("Farlado" . "farlado@sdf.org")) (:maintainer "Farlado" . "farlado@sdf.org") (:keywords "unix" "wallpaper" "extensions") (:url . "https://github.com/farlado/emacs-wallpaper"))])
+ (wallpreview . [(20220220 427) ((emacs (24 4))) "Set wallpapers with image-dired" single ((:commit . "b1b8f19ae82b344a9577cea7b883ad513ec52222") (:url . "https://github.com/nryotaro/wallpreview"))])
+ (wand . [(20210511 725) ((dash (2 15 0)) (s (0 1 1))) "Magic wand for Emacs - Select and execute" tar ((:commit . "08c3d9156517a31dd98ea64bfc269fae730b643c") (:authors ("Ha-Duong Nguyen <cmpitgATgmail>")) (:maintainer "Ha-Duong Nguyen <cmpitgATgmail>") (:keywords "extensions" "tools") (:url . "https://github.com/cmpitg/wand"))])
+ (wandbox . [(20170603 1231) ((emacs (24)) (request (0 3 0)) (s (1 10 0))) "Wandbox client" tar ((:commit . "e002fe41f2cd9b4ce2b1dc80b83301176e9117f1") (:authors ("KOBAYASHI Shigeru (kosh)" . "shigeru.kb@gmail.com")) (:maintainer "KOBAYASHI Shigeru (kosh)" . "shigeru.kb@gmail.com") (:keywords "tools") (:url . "https://github.com/kosh04/emacs-wandbox"))])
+ (wanderlust . [(20220508 1540) ((emacs (24 5)) (apel (10 8)) (flim (1 14 9)) (semi (1 14 7))) "Yet Another Message Interface on Emacsen" tar ((:commit . "e3cd5e39454737c0b641e114ddcc550122288a2a"))])
+ (warm-night-theme . [(20161101 1428) ((emacs (24))) "Emacs 24 theme with a dark background." single ((:commit . "020f084d23409b5035150508ba6e57c2509edd64") (:authors ("martin haesler")) (:maintainer "martin haesler"))])
+ (watch-buffer . [(20120331 2044) nil "run a shell command when saving a buffer" single ((:commit . "761fd7252e6d7bf5148283c2a7ee935f087d9427") (:authors ("Michael Steger" . "mjsteger1@gmail.com")) (:maintainer "Michael Steger" . "mjsteger1@gmail.com") (:keywords "automation" "convenience") (:url . "https://github.com/mjsteger/watch-buffer"))])
+ (wavefront-obj-mode . [(20170808 1716) nil "Major mode for Wavefront obj files" single ((:commit . "34027915de6496460d8e68b5991dd24d47d54859") (:authors ("Sasha Kovar" . "sasha-emacs@arcocene.org")) (:maintainer "Sasha Kovar" . "sasha-emacs@arcocene.org") (:url . "http://github.com/abend/wavefront-obj-mode"))])
+ (wc-goal-mode . [(20140829 1359) nil "Running word count with goals (minor mode)" single ((:commit . "bf21ab9c5a449bcc20dd207a4915dcec218d2699") (:authors ("Benjamin Beckwith")) (:maintainer "Benjamin Beckwith") (:url . "https://github.com/bnbeckwith/wc-goal-mode"))])
+ (wc-mode . [(20210418 47) ((emacs (24 1))) "Running word count with goals (minor mode)" single ((:commit . "63be1433b8a63cdc3239cc751e36360429c42b51") (:authors ("Benjamin Beckwith")) (:maintainer "Benjamin Beckwith") (:url . "https://github.com/bnbeckwith/wc-mode"))])
+ (wdl-mode . [(20180831 1946) nil "WDL (Workflow Definition Language) major mode" single ((:commit . "cef86e5afc136ae5ad9324cd6e6d6f860b889bcf") (:authors ("Xiaowei Zhan" . "zhanxw@gmail.com")) (:maintainer "Xiaowei Zhan" . "zhanxw@gmail.com") (:keywords "languages") (:url . "http://github.com/zhanxw/wdl-mode"))])
+ (weak-ref . [(20200217 2200) ((emacs (24 3))) "Weak references for Emacs Lisp" single ((:commit . "24e8c37da6465e65ce9f866267bd3fa53c8899c6") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/elisp-weak-ref"))])
+ (weather-metno . [(20150901 107) ((emacs (24)) (cl-lib (0 3))) "Weather data from met.no in Emacs" tar ((:commit . "bfc7137095e0ee71aad70ac46f2af677f3c051b6") (:authors ("Rüdiger Sonderfeld" . "ruediger@c-plusplus.de")) (:maintainer "Rüdiger Sonderfeld" . "ruediger@c-plusplus.de") (:keywords "comm") (:url . "https://github.com/ruediger/weather-metno-el"))])
+ (web . [(20141231 2001) ((dash (2 9 0)) (s (1 5 0))) "useful HTTP client" single ((:commit . "483188dac4bc6b409b985c9dae45f3324a425efd") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "lisp" "http" "hypermedia") (:url . "http://github.com/nicferrier/emacs-web"))])
+ (web-beautify . [(20161115 2247) nil "Format HTML, CSS and JavaScript/JSON" single ((:commit . "e1b45321d8c11b404b12c8e55afe55eaa7c84ee9") (:authors ("Yasuyuki Oka" . "yasuyk@gmail.com")) (:maintainer "Yasuyuki Oka" . "yasuyk@gmail.com") (:url . "https://github.com/yasuyk/web-beautify"))])
+ (web-completion-data . [(20160318 848) nil "Shared completion data for ac-html and company-web" tar ((:commit . "c272c94e8a71b779c29653a532f619acad433a4f") (:authors ("Olexandr Sydorchuk" . "olexandr.syd@gmail.com")) (:maintainer "Olexandr Sydorchuk" . "olexandr.syd@gmail.com") (:keywords "html" "auto-complete" "company") (:url . "https://github.com/osv/web-completion-data"))])
+ (web-mode . [(20220319 653) ((emacs (23 1))) "major mode for editing web templates" single ((:commit . "efa853e5cfff8e0bcacbda9d1c6696b33da91b03") (:authors ("François-Xavier Bois")) (:maintainer "François-Xavier Bois" . "fxbois@gmail.com") (:keywords "languages") (:url . "https://web-mode.org"))])
+ (web-mode-edit-element . [(20190531 852) ((emacs (24 4)) (web-mode (14))) "Helper-functions for attribute- and element-handling" tar ((:commit . "ad5d7e4dc2420bdd00ce65d9adffbd38a5904afa") (:authors ("Julian T. Knabenschuh" . "jtkdevelopments@gmail.com")) (:maintainer "Julian T. Knabenschuh" . "jtkdevelopments@gmail.com") (:keywords "languages" "convenience") (:url . "https://github.com/jtkDvlp/web-mode-edit-element"))])
+ (web-narrow-mode . [(20170407 210) ((web-mode (14 0 27))) "quick narrow code block in web-mode" single ((:commit . "73bdcb7d0701abe65dab4fc295d944885e05ae33") (:authors ("Qquanwei" . "quanwei9958@126.com")) (:maintainer "Johan Andersson" . "quanwei9958@126.com") (:keywords "web-mode" "react" "narrow" "web") (:url . "https://github.com/Qquanwei/web-narrow-mode"))])
+ (web-search . [(20190620 602) ((emacs (24 3))) "Open a web search" tar ((:commit . "a22cbdc663a1895d5a5b69de91e1e3b9eb64b92f") (:authors ("Xu Chunyang" . "mail@xuchunyang.me")) (:maintainer "Xu Chunyang" . "mail@xuchunyang.me") (:keywords "web" "search") (:url . "https://github.com/xuchunyang/web-search.el"))])
+ (web-server . [(20210708 2242) ((emacs (24 1)) (cl-lib (0 6))) "Emacs Web Server" tar ((:commit . "6357a1c2d1718778503f7ee0909585094117525b") (:authors ("Eric Schulte" . "schulte.eric@gmail.com")) (:maintainer "Eric Schulte" . "schulte.eric@gmail.com") (:keywords "http" "server" "network") (:url . "https://github.com/eschulte/emacs-web-server"))])
+ (webkit-color-picker . [(20180325 736) ((emacs (26 0)) (posframe (0 1 0))) "Insert and adjust colors using Webkit Widgets" tar ((:commit . "765cac80144cad4bc0bf59025ea0199f0486f737") (:authors ("Ozan Sener" . "hi@ozan.email")) (:maintainer "Ozan Sener" . "hi@ozan.email") (:keywords "tools") (:url . "https://github.com/osener/emacs-webkit-color-picker"))])
+ (weblio . [(20210718 1410) ((request (0 3 3)) (emacs (25 1))) "Look up Japanese words on Weblio.jp" single ((:commit . "2b4b0c206440b5c63960214feacfceb0c26231c7") (:authors ("Simon Zelazny")) (:maintainer "Simon Zelazny") (:keywords "langauges" "i18n") (:url . "https://github.com/pzel/weblio"))])
+ (weblogger . [(20110926 1618) ((xml-rpc (1 6 8))) "Weblog maintenance via XML-RPC APIs" single ((:commit . "b3dd4aead9d3a87e6d85e7fef4f4f3bd40d87b53") (:keywords "weblog" "blogger" "cms" "movable" "type" "openweblog" "blog") (:url . "http://launchpad.net/weblogger-el"))])
+ (weblorg . [(20220312 2008) ((templatel (0 1 6)) (emacs (26 1))) "Static Site Generator for org-mode" tar ((:commit . "b2bb79ed2c532cad5b03455d8cae887ddb803db3") (:authors ("Lincoln Clarete" . "lincoln@clarete.li")) (:maintainer "Lincoln Clarete" . "lincoln@clarete.li") (:url . "https://emacs.love/weblorg"))])
+ (webpaste . [(20211211 658) ((emacs (24 4)) (request (0 2 0)) (cl-lib (0 5))) "Paste to pastebin-like services" single ((:commit . "78272662e6992b8614e79a571ff2395fa9630357") (:authors ("Elis \"etu\" Hirwing" . "elis@hirwing.se")) (:maintainer "Elis \"etu\" Hirwing" . "elis@hirwing.se") (:keywords "convenience" "comm" "paste") (:url . "https://github.com/etu/webpaste.el"))])
+ (websocket . [(20210110 17) ((cl-lib (0 5))) "Emacs WebSocket client and server" single ((:commit . "82b370602fa0158670b1c6c769f223159affce9b") (:authors ("Andrew Hyatt" . "ahyatt@gmail.com")) (:maintainer "Andrew Hyatt" . "ahyatt@gmail.com") (:keywords "communication" "websocket" "server") (:url . "https://github.com/ahyatt/emacs-websocket"))])
+ (wedge-ws . [(20140714 2149) nil "Wedge whitespace between columns in text" single ((:commit . "4669115f02d9c6fee067cc5369bb38c0f9db88b2") (:authors ("Anders Eurenius" . "aes@spotify.com")) (:maintainer "Anders Eurenius" . "aes@spotify.com") (:keywords "formatting" "indentation"))])
+ (weechat . [(20190520 1551) ((s (1 3 1)) (cl-lib (0 2)) (emacs (24)) (tracking (1 2))) "Chat via WeeChat's relay protocol in Emacs" tar ((:commit . "d9a13306ea8be27367f92e9202d116a88fa1f441") (:authors ("Moritz Ulrich" . "moritz@tarn-vedra.de") ("Rüdiger Sonderfeld" . "ruediger@c-plusplus.de") ("Aristid Breitkreuz" . "aristidb@gmail.com")) (:maintainer "Moritz Ulrich" . "moritz@tarn-vedra.de") (:keywords "irc" "chat" "network" "weechat") (:url . "https://github.com/the-kenny/weechat.el"))])
+ (weechat-alert . [(20160416 1248) ((weechat (0 3 1)) (cl-lib (0 5)) (alert (1 2))) "Weechat notifier using alerts" single ((:commit . "a8fd557c8f335322f132c1c6c08b6741d6394e2e") (:authors ("Andreas Klein" . "git@kungi.org")) (:maintainer "Andreas Klein" . "git@kungi.org") (:keywords "irc" "chat" "network" "weechat") (:url . "https://github.com/kungi/weechat-alert"))])
+ (weibo . [(20150307 2242) ((cl-lib (0 5))) "Weibo client for Emacs" tar ((:commit . "a8abb50b7602fe15fe2bc6400ac29780e956b390") (:authors ("Austin" . "austiny.cn@gmail.com")) (:maintainer "Austin" . "austiny.cn@gmail.com") (:keywords "weibo") (:url . "https://github.com/austin-----/weibo.emacs"))])
+ (weyland-yutani-theme . [(20210802 2251) ((emacs (24 1))) "Emacs theme based off Alien movie franchise" single ((:commit . "e89a63a62e071180c9cdd9067679fadc3f7bf796") (:authors ("Joe Staursky")) (:maintainer "Joe Staursky") (:url . "https://github.com/jstaursky/weyland-yutani-theme"))])
+ (wgrep . [(20210322 2207) nil "Writable grep buffer and apply the changes to files" single ((:commit . "f9687c28bbc2e84f87a479b6ce04407bb97cfb23") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "grep" "edit" "extensions") (:url . "http://github.com/mhayashi1120/Emacs-wgrep/raw/master/wgrep.el"))])
+ (wgrep-ack . [(20200128 109) ((wgrep (2 1 1))) "Writable ack-and-a-half buffer and apply the changes to files" single ((:commit . "f9687c28bbc2e84f87a479b6ce04407bb97cfb23") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "grep" "edit" "extensions") (:url . "http://github.com/mhayashi1120/Emacs-wgrep/raw/master/wgrep-ack.el"))])
+ (wgrep-ag . [(20200217 1028) ((wgrep (2 3 2))) "Writable ag buffer and apply the changes to files" single ((:commit . "f9687c28bbc2e84f87a479b6ce04407bb97cfb23") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "grep" "edit" "extensions") (:url . "http://github.com/mhayashi1120/Emacs-wgrep/raw/master/wgrep-ag.el"))])
+ (wgrep-helm . [(20210322 2148) ((wgrep (2 1 1))) "Writable helm-grep-mode buffer and apply the changes to files" single ((:commit . "f9687c28bbc2e84f87a479b6ce04407bb97cfb23") (:authors ("Masahiro Hayashi" . "mhayashi1120@gmail.com")) (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "grep" "edit" "extensions") (:url . "http://github.com/mhayashi1120/Emacs-wgrep/raw/master/wgrep-helm.el"))])
+ (wgrep-pt . [(20200128 109) ((wgrep (2 1 5))) "Writable pt buffer and apply the changes to files" single ((:commit . "f9687c28bbc2e84f87a479b6ce04407bb97cfb23") (:authors ("Masahiro Hayashi <mhayashi1120@gmail.com>, Bailey Ling" . "bling@live.ca")) (:maintainer "Masahiro Hayashi <mhayashi1120@gmail.com>, Bailey Ling" . "bling@live.ca") (:keywords "grep" "edit" "extensions") (:url . "http://github.com/mhayashi1120/Emacs-wgrep/raw/master/wgrep-pt.el"))])
+ (what-the-commit . [(20150901 1316) nil "Random commit message generator" single ((:commit . "868c80a1b8614bcbd2225cd0290142c72f2a7956") (:authors ("Dan Barbarito" . "dan@barbarito.me")) (:maintainer "Dan Barbarito" . "dan@barbarito.me") (:keywords "git" "commit" "message") (:url . "http://barbarito.me/"))])
+ (which-key . [(20220419 227) ((emacs (24 4))) "Display available keybindings in popup" single ((:commit . "129f4ebfc74f207ac82978f6d90d8b4bb1a55cf9") (:authors ("Justin Burkett" . "justin@burkett.cc")) (:maintainer "Justin Burkett" . "justin@burkett.cc") (:url . "https://github.com/justbur/emacs-which-key"))])
+ (which-key-posframe . [(20210615 944) ((emacs (26 0)) (posframe (0 4 3)) (which-key (3 3 2))) "Using posframe to show which-key" single ((:commit . "90e85d74899fc23d95798048cc0bbdb4bab9c1b7") (:authors ("Yanghao Xie")) (:maintainer "Yanghao Xie" . "yhaoxie@gmail.com") (:keywords "convenience" "bindings" "tooltip") (:url . "https://github.com/yanghaoxie/which-key-posframe"))])
+ (whiley-mode . [(20220501 2219) ((emacs (24 1))) "Major mode for Whiley language" single ((:commit . "69eb67cf41dad029f1456079aea62a4b61ca9b46") (:authors ("David J. Pearce" . "dave01001110@gmail.com")) (:maintainer "David J. Pearce" . "dave01001110@gmail.com") (:keywords "languages") (:url . "http://github.com/Whiley/WhileyEmacsMode"))])
+ (whitaker . [(20210203 1149) ((emacs (25))) "Comint interface for Whitaker's Words" single ((:commit . "a6fda24ccb69a18c0706633326d5cc4fcfaed83a") (:authors ("Matus Goljer" . "matus.goljer@gmail.com")) (:maintainer "Matus Goljer" . "matus.goljer@gmail.com") (:keywords "processes"))])
+ (white-sand-theme . [(20210131 813) ((emacs (24))) "Emacs theme with a light background." single ((:commit . "729dd52cc1936250183d6761eed406c4be514a71") (:authors ("Martin Haesler")) (:maintainer "Martin Haesler"))])
+ (white-theme . [(20160917 1743) ((emacs (24))) "Minimalistic light color theme inspired by basic-theme" single ((:commit . "e9e6d5b9d43da6eb15e86f5fbc8b1ba83abe8c78") (:authors ("Anler Hernandez Peral" . "inbox@anler.me")) (:maintainer "Anler Hernandez Peral" . "inbox@anler.me") (:keywords "color" "theme" "minimal" "basic" "simple" "white") (:url . "http://github.com/anler/white-theme.el"))])
+ (whitespace-cleanup-mode . [(20210510 533) ((emacs (24 1))) "Intelligently call whitespace-cleanup on save" single ((:commit . "b2e35321f03914cae90be4f942d911b7e7175899") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "convenience") (:url . "https://github.com/purcell/whitespace-cleanup-mode"))])
+ (whizzml-mode . [(20201013 239) ((emacs (24 4))) "Programming mode for editing WhizzML files" tar ((:commit . "3dce3be0c32b9b2d259e462b4b27c530af47466a") (:authors ("Jose Antonio Ortega Ruiz" . "jao@bigml.com")) (:maintainer "Jose Antonio Ortega Ruiz" . "jao@bigml.com") (:keywords "languages" "lisp"))])
+ (whois . [(20211104 812) ((emacs (24))) "Syntax highlighted domain name queries using system whois" single ((:commit . "f22244202fdac5064d5eff95c6f35ae887b01142") (:authors ("Lassi Kortela" . "lassi@lassi.io")) (:maintainer "Lassi Kortela" . "lassi@lassi.io") (:keywords "network" "comm") (:url . "https://github.com/lassik/emacs-whois"))])
+ (whole-line-or-region . [(20201214 650) ((emacs (24 1)) (cl-lib (0 6))) "Operate on current line if region undefined" single ((:commit . "500ad90695e8a5a0cefabb7500158eab0835a0ce") (:authors ("Joe Casadonte" . "emacs@northbound-train.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "convenience" "wp") (:url . "https://github.com/purcell/whole-line-or-region"))])
+ (why-this . [(20220429 1227) ((emacs (27 2))) "Why is this line here? Ask version control" single ((:commit . "b69263c66b63680e1db81f6da98de00c230c7384") (:authors ("Akib Azmain Turja" . "akib@disroot.org")) (:maintainer "Akib Azmain Turja" . "akib@disroot.org") (:keywords "tools" "convenience" "vc") (:url . "https://codeberg.org/akib/emacs-why-this"))])
+ (wide-column . [(20170925 1613) nil "Calls functions dependant on column position." single ((:commit . "ce9ef4675485a7bea381077866368ef875226b10") (:authors ("Phillip Lord" . "p.lord@russet.org.uk")) (:maintainer "Phillip Lord" . "p.lord@russet.org.uk") (:keywords "minor mode" "cursor colour" "column width"))])
+ (widget-mvc . [(20150102 406) nil "MVC framework for the emacs widgets" single ((:commit . "ff5a85880df7b87f9f480fe3c28438a0712b7b87") (:authors ("SAKURAI Masashi <m.sakurai at kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai at kiwanami.net>") (:keywords "lisp" "widget"))])
+ (wiki-nav . [(20200309 1323) ((button-lock (1 0 2)) (nav-flash (1 0 0))) "Simple file navigation using [[WikiStrings]]" single ((:commit . "9afe0f4d05910b0cccc94cb6d4d880119f3b0528") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "mouse" "button" "hypermedia" "navigation") (:url . "http://github.com/rolandwalker/button-lock"))])
+ (wiki-summary . [(20181010 1824) ((emacs (24))) "View Wikipedia summaries in Emacs easily." single ((:commit . "fa41ab6e50b3b80e54148af9d4bac18fd0405000") (:authors ("Danny Gratzer")) (:maintainer "Danny Gratzer") (:keywords "wikipedia" "utility") (:url . "https://github.com/jozefg/wiki-summary.el"))])
+ (wikinfo . [(20220121 2017) ((emacs (27 1))) "Scrape Wikipedia Infoboxes" single ((:commit . "b149228023d4abb29555ce69877df521887cafe9") (:authors ("Nicholas Vollmer" . "progfolio@protonmail.com")) (:maintainer "Nicholas Vollmer" . "progfolio@protonmail.com") (:keywords "org" "convenience") (:url . "https://github.com/progfolio/wikinfo"))])
+ (wikinforg . [(20220322 946) ((emacs (27 1)) (wikinfo (0 0 0)) (org (9 3))) "Org-mode wikinfo integration" single ((:commit . "9a5bfe36d59dc845b8da1951bed327f3a9071534") (:authors ("Nicholas Vollmer" . "progfolio@protonmail.com")) (:maintainer "Nicholas Vollmer" . "progfolio@protonmail.com") (:keywords "org" "convenience") (:url . "https://github.com/progfolio/wikinforg"))])
+ (wilt . [(20180220 854) ((emacs (24 3)) (dash (2 12 0)) (s (1 10 0))) "An extensions for calculating WILT in a buffer." single ((:commit . "04dbe37fa35d0b24c791421785d2c97a8cbfe2cc") (:authors ("Austin Bingham" . "austin@sixty-north.com")) (:maintainer "Austin Bingham" . "austin@sixty-north.com") (:url . "https://github.com/sixty-north/emacs-wilt"))])
+ (win-switch . [(20161009 1627) nil "fast, dynamic bindings for window-switching/resizing" single ((:commit . "954eb5e4c5737f0c06368c42a7f1c3dd374d782f") (:authors ("Christopher Genovese" . "genovese@cmu.edu")) (:maintainer "Christopher R. Genovese" . "genovese@cmu.edu") (:keywords "window" "switch" "key bindings" "ergonomic" "efficient") (:url . "http://www.stat.cmu.edu/~genovese/emacs/win-switch/"))])
+ (windata . [(20090830 1040) nil "convert window configuration to list" single ((:commit . "a723fc446ceaec23d5f29ecc8245d94c99d91625") (:authors (nil . "wenbinye@gmail.com")) (:maintainer nil . "wenbinye@gmail.com") (:keywords "convenience" "frames"))])
+ (window-end-visible . [(20140508 2041) nil "Find the last visible point in a window" single ((:commit . "525500fb2ebc08f3f9ea493972e5f2e1d79f89ef") (:authors ("Roland Walker" . "walker@pobox.com")) (:maintainer "Roland Walker" . "walker@pobox.com") (:keywords "extensions") (:url . "http://github.com/rolandwalker/window-end-visible"))])
+ (window-jump . [(20170809 2208) nil "Move left/right/up/down through your windows." single ((:commit . "6bdb51e9a346907d60a9625f6180bddd06be6674") (:authors ("Steven Thomas")) (:maintainer "Steven Thomas") (:keywords "frames" "convenience") (:url . "https://github.com/chumpage/chumpy-windows"))])
+ (window-layout . [(20170215 33) nil "window layout manager" single ((:commit . "cd2e4f967b610c2bbef53182829e47250d027056") (:authors ("SAKURAI Masashi <m.sakurai atmark kiwanami.net>")) (:maintainer "SAKURAI Masashi <m.sakurai atmark kiwanami.net>") (:keywords "window" "layout"))])
+ (window-number . [(20170801 151) nil "Select windows by numbers." single ((:commit . "d41722de646ffeb3f70d26e4a86a5a1ba5c6be87") (:authors ("Johann \"Myrkraverk\" Oskarsson" . "myrkraverk@users.sourceforge.net")) (:maintainer "Nik Nyby" . "niknyby@riseup.net") (:keywords "windows") (:url . "https://github.com/nikolas/window-number"))])
+ (window-numbering . [(20160809 1810) nil "Numbered window shortcuts" single ((:commit . "10809b3993a97c7b544240bf5d7ce9b1110a1b89") (:authors ("Nikolaj Schumacher <bugs * nschum de>")) (:maintainer "Nikolaj Schumacher <bugs * nschum de>") (:keywords "faces" "matching") (:url . "http://nschum.de/src/emacs/window-numbering-mode/"))])
+ (window-purpose . [(20210628 715) ((emacs (24 4)) (let-alist (1 0 3)) (imenu-list (0 1))) "Purpose-based window management for Emacs" tar ((:commit . "bb462f12f836414425edac32ebd069b4fd5b98d4") (:authors ("Bar Magal")) (:maintainer "Bar Magal") (:keywords "frames") (:url . "https://github.com/bmag/emacs-purpose"))])
+ (winds . [(20201121 123) ((emacs (25 1))) "Window configuration switcher grouped by workspaces" single ((:commit . "5827e890059d0ce67ebb4779da63c15afccf0973") (:authors ("Javier A. Pollak" . "javi.po.123@gmail.com")) (:maintainer "Javier A. Pollak" . "javi.po.123@gmail.com") (:keywords "convenience") (:url . "https://github.com/Javyre/winds.el"))])
+ (windsize . [(20181029 2257) nil "Simple, intuitive window resizing" single ((:commit . "62c2846bbe95b0a73e996c75e4a644d05f57aaaa") (:authors ("Chris Perkins" . "chrisperkins99@gmail.com")) (:maintainer "Chris Perkins" . "chrisperkins99@gmail.com") (:keywords "window" "resizing" "convenience") (:url . "http://github.com/grammati/windsize"))])
+ (windswap . [(20200722 411) ((emacs (24 3))) "Like windmove, but swaps buffers while moving point" single ((:commit . "1a334f6543e0a30c55ea1e6071e9732d948f9e4b") (:authors ("Steve Purcell" . "steve@sanityinc.com")) (:maintainer "Steve Purcell" . "steve@sanityinc.com") (:keywords "frames" "convenience") (:url . "https://github.com/purcell/windswap"))])
+ (windwow . [(20170816 148) ((dash (2 11 0)) (cl-lib (0 6 1)) (emacs (24))) "simple workspace management" single ((:commit . "77bad26f651744b68d31b389389147014d250f23") (:authors ("Viju Mathew" . "viju.jm@gmail.com")) (:maintainer "Viju Mathew" . "viju.jm@gmail.com") (:keywords "frames") (:url . "github.com/vijumathew/windwow"))])
+ (winnow . [(20210105 1919) ((emacs (24))) "winnow ag/grep results by matching/excluding lines" single ((:commit . "761b15bc31696a4f80c5fd508c84b1f5b4190ec2") (:authors ("Charles L.G. Comstock" . "dgtized@gmail.com")) (:maintainer "Charles L.G. Comstock" . "dgtized@gmail.com") (:keywords "matching") (:url . "https://github.com/dgtized/winnow.el"))])
+ (winpoint . [(20131023 1713) nil "Remember buffer positions per-window, not per buffer" single ((:commit . "e6050093c076308184566fa1d1012423d6934773") (:authors ("Jorgen Schaefer" . "forcer@forcix.cx")) (:maintainer "Jorgen Schaefer" . "forcer@forcix.cx") (:keywords "convenience") (:url . "https://github.com/jorgenschaefer/winpoint"))])
+ (winring . [(20180530 18) nil "Window configuration rings" single ((:commit . "f2d072bd446b73e93b127523f19ea82b99b9267f") (:authors ("1997-2018 Barry A. Warsaw")) (:maintainer "1997-2018 Barry A. Warsaw") (:keywords "frames" "tools") (:url . "https://gitlab.com/warsaw/winring"))])
+ (winum . [(20190911 1607) ((cl-lib (0 5)) (dash (2 13 0))) "Navigate windows and frames using numbers." single ((:commit . "c5455e866e8a5f7eab6a7263e2057aff5f1118b9") (:authors ("Thomas de Beauchêne" . "thomas.de.beauchene@gmail.com")) (:maintainer "Thomas de Beauchêne" . "thomas.de.beauchene@gmail.com") (:keywords "convenience" "frames" "windows" "multi-screen") (:url . "http://github.com/deb0ch/winum.el"))])
+ (wisp-mode . [(20220208 636) ((emacs (24 4))) "Tools for wisp: the Whitespace-to-Lisp preprocessor" single ((:commit . "d266109b95e73281ae3aa1ed9a023346b6d39d28") (:authors ("Arne Babenhauserheide" . "arne_bab@web.de")) (:maintainer "Arne Babenhauserheide" . "arne_bab@web.de") (:keywords "languages" "lisp" "scheme") (:url . "http://www.draketo.de/english/wisp"))])
+ (wispjs-mode . [(20170720 1919) ((clojure-mode (0))) "Major mode for Wisp code." single ((:commit . "60f9f5fd9d1556e2d008939f67eb1b1d0f325fa8") (:authors ("Kris Jenkins" . "krisajenkins@gmail.com")) (:maintainer "Kris Jenkins" . "krisajenkins@gmail.com") (:url . "https://github.com/krisajenkins/wispjs-mode"))])
+ (with-editor . [(20220506 420) ((emacs (25 1)) (compat (28 1 1 0))) "Use the Emacsclient as $EDITOR" tar ((:commit . "4ab8c6148bb2698ff793d4a8acdbd8d0d642e133") (:authors ("Jonas Bernoulli" . "jonas@bernoul.li")) (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li") (:keywords "processes" "terminals") (:url . "https://github.com/magit/with-editor"))])
+ (with-emacs . [(20200210 1543) ((emacs (24 4))) "Evaluate Emacs Lisp expressions in a separate Emacs process" single ((:commit . "9f99bec56f87e53deb9f33b364eda77677a17eb9") (:authors ("Gong Qijian" . "gongqijian@gmail.com")) (:maintainer "Gong Qijian" . "gongqijian@gmail.com") (:keywords "tools") (:url . "https://github.com/twlz0ne/with-emacs.el"))])
+ (with-namespace . [(20130407 1822) ((dash (1 1 0)) (loop (1 1))) "interoperable elisp namespaces" single ((:commit . "8ac52da3a09cf46087720e30cf730d00f140cde6") (:authors ("Wilfred Hughes" . "me@wilfred.me.uk")) (:maintainer "Wilfred Hughes" . "me@wilfred.me.uk") (:keywords "namespaces"))])
+ (with-proxy . [(20200510 414) ((emacs (24 4))) "Evaluate expressions with proxy" single ((:commit . "93b1ed2f3060f305009fa71f4fb5bb10173a10e3") (:authors ("Gong Qijian" . "gongqijian@gmail.com")) (:maintainer "Gong Qijian" . "gongqijian@gmail.com") (:keywords "comm") (:url . "https://github.com/twlz0ne/with-proxy.el"))])
+ (with-shell-interpreter . [(20200828 1217) ((emacs (25 1)) (cl-lib (0 6 1))) "Helper for shell command APIs" single ((:commit . "3fd1ea892e44f7fe6f86df2b5c0a0a1e0f3913fa") (:keywords "processes" "terminals") (:url . "https://github.com/p3r7/with-shell-interpreter"))])
+ (with-simulated-input . [(20210527 2320) ((emacs (24 4))) "A macro to simulate user input non-interactively" single ((:commit . "0f43fe46d4ab098c18a90b9df18cb96bab8e4a35") (:authors ("Ryan C. Thompson" . "rct@thompsonclan.org") ("Nikita Bloshchanevich" . "nikblos@outlook.com")) (:maintainer "Ryan C Thompson" . "rct@thompsonclan.org") (:keywords "lisp" "tools" "extensions") (:url . "https://github.com/DarwinAwardWinner/with-simulated-input"))])
+ (with-venv . [(20210925 2336) ((cl-lib (0 5)) (emacs (24 4))) "Execute with Python virtual environment activated" single ((:commit . "4a59ef8251f10ea772d4f504beeab08edf1f223e") (:authors ("10sr <8.slashes [at] gmail [dot] com>")) (:maintainer "10sr <8.slashes [at] gmail [dot] com>") (:keywords "processes" "python" "venv") (:url . "https://github.com/10sr/with-venv-el"))])
+ (wn-mode . [(20151110 552) ((emacs (24))) "numeric window switching shortcuts" single ((:commit . "f05c3151523e529af5a0a3fa8c948b61fb369f6e") (:authors ("Anonymous")) (:maintainer "Luís Oliveira" . "luismbo@gmail.com") (:keywords "buffers" "windows" "switching-windows") (:url . "https://github.com/luismbo/wn-mode"))])
+ (wolfram . [(20190805 1007) nil "Wolfram Alpha Integration" single ((:commit . "a172712d5045834f5434cca2843a7c3506805db8") (:authors ("Hans Sjunnesson" . "hans.sjunnesson@gmail.com")) (:maintainer "Hans Sjunnesson" . "hans.sjunnesson@gmail.com") (:keywords "math"))])
+ (wolfram-mode . [(20180307 13) ((emacs (24 3))) "Mathematica editing and inferior mode." single ((:commit . "be680190cac6ccf579dbce107deaae495928d1b3") (:authors ("Daichi Mochihashi <daichi at cslab.kecl.ntt.co.jp>")) (:maintainer "Daichi Mochihashi <daichi at cslab.kecl.ntt.co.jp>") (:keywords "languages" "processes" "tools") (:url . "https://github.com/kawabata/wolfram-mode/"))])
+ (wonderland . [(20130913 119) ((dash (2 0 0)) (dash-functional (1 0 0)) (multi (2 0 0)) (emacs (24))) "declarative configuration for Emacsen" single ((:commit . "89d274ad694b0e748efdac23ccd60b7d8b73d7c6") (:authors ("Christina Whyte" . "kurisu.whyte@gmail.com")) (:maintainer "Christina Whyte" . "kurisu.whyte@gmail.com") (:keywords "configuration" "profile" "wonderland") (:url . "http://github.com/kurisuwhyte/emacs-wonderland"))])
+ (wordel . [(20220508 1745) ((emacs (27 1))) "An Elisp implementation of \"Wordle\" (aka \"Lingo\")" tar ((:commit . "d37187bb5abb2fe4a8ba120fad9e52dd74cc220e") (:authors ("Nicholas Vollmer" . "iarchivedmywholelife@gmail.com")) (:maintainer "Nicholas Vollmer" . "iarchivedmywholelife@gmail.com") (:keywords "games") (:url . "https://github.com/progfolio/wordel"))])
+ (wordgen . [(20170803 1820) ((emacs (24)) (cl-lib (0 5))) "Random word generator" single ((:commit . "aacad928ae99a953e034a831dfd0ebdf7d52ac1d") (:authors ("Fanael Linithien" . "fanael4@gmail.com")) (:maintainer "Fanael Linithien" . "fanael4@gmail.com") (:url . "https://github.com/Fanael/wordgen.el"))])
+ (wordnut . [(20180313 443) ((emacs (24 4))) "Major mode interface to WordNet" tar ((:commit . "feac531404041855312c1a046bde7ea18c674915"))])
+ (wordreference . [(20220504 2021) ((emacs (27 1)) (s (1 12 0))) "Interface for wordreference.com" single ((:commit . "785a5d3245efdc3f32ce61fad1c7596230682f3a") (:authors ("Marty Hiatt <martianhiatus AT riseup.net>")) (:maintainer "Marty Hiatt <martianhiatus AT riseup.net>") (:keywords "convenience" "translate") (:url . "https://codeberg.org/martianh/wordreference.el"))])
+ (wordsmith-mode . [(20210715 1517) nil "Syntax analysis and NLP text-processing in Emacs (OSX-only)" single ((:commit . "5d40ceaa2b8d41ab3634ca377ceb6a74deeb2287") (:authors ("istib" . "istib@thebati.net")) (:maintainer "istib" . "istib@thebati.net"))])
+ (worf . [(20220102 835) ((swiper (0 11 0)) (ace-link (0 1 0)) (hydra (0 13 0)) (zoutline (0 1 0))) "A warrior does not press so many keys! (in org-mode)" tar ((:commit . "8681241e118585824cd256e5b026978bf06c7e58") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "lisp") (:url . "https://github.com/abo-abo/worf"))])
+ (workgroups . [(20110726 1641) nil "workgroups for windows (for Emacs)" single ((:commit . "9572b3492ee09054dc329f64ed846c962b395e39") (:authors ("tlh" . "thunkout@gmail.com")) (:maintainer "tlh" . "thunkout@gmail.com") (:keywords "session" "management" "window-configuration" "persistence"))])
+ (workgroups2 . [(20220423 1150) ((emacs (25 1))) "save&load multiple named workspaces (or \"workgroups\")" tar ((:commit . "ccd6948c92ea21d0dec56dff029b3f46df408de5") (:authors ("Sergey Pashinin <sergey at pashinin dot com>")) (:maintainer "Sergey Pashinin <sergey at pashinin dot com>") (:keywords "session" "management" "window-configuration" "persistence") (:url . "https://github.com/pashinin/workgroups2"))])
+ (workroom . [(20220501 1500) ((emacs (27 2))) "Named rooms for work without irrelevant distracting buffers" single ((:commit . "001fe2777f49ac73b6ab24401094a1c3c5efc887") (:authors ("Akib Azmain Turja" . "akib@disroot.org")) (:maintainer "Akib Azmain Turja" . "akib@disroot.org") (:keywords "tools" "convenience") (:url . "https://codeberg.org/akib/emacs-workroom"))])
+ (world-time-mode . [(20140627 807) nil "show whole days of world-time diffs" single ((:commit . "ce7a3b45c87eb24cfe61eee453175d64f741d7cc") (:authors ("Nic Ferrier" . "nferrier@ferrier.me.uk")) (:maintainer "Nic Ferrier" . "nferrier@ferrier.me.uk") (:keywords "tools" "calendar"))])
+ (wotd . [(20170328 1948) ((emacs (24 4)) (org (8 2 10))) "Fetch word-of-the-day from multiple online sources" single ((:commit . "d2937a3d91e014f8028a1f33d21c18cc0b065a64") (:authors ("Junpeng Qiu" . "qjpchmail@gmail.com")) (:maintainer "Junpeng Qiu" . "qjpchmail@gmail.com") (:keywords "extensions"))])
+ (wrap-region . [(20140117 720) ((dash (1 0 3))) "Wrap text with punctation or tag" single ((:commit . "fbae9b0f106187af19823f1a6260b5c68b7252e6") (:authors ("Johan Andersson" . "johan.rejeep@gmail.com")) (:maintainer "Johan Andersson" . "johan.rejeep@gmail.com") (:keywords "speed" "convenience") (:url . "http://github.com/rejeep/wrap-region"))])
+ (writefreely . [(20190628 1606) ((emacs (24 3)) (org (9 0)) (ox-gfm (0 0)) (request (0 3))) "Push your Org files as markdown to a writefreely instance" single ((:commit . "83a487e48e0d8342c372deb74d04c0b43474268c") (:authors ("Daniel Gomez <d.gomez at posteo dot org>")) (:maintainer "Daniel Gomez <d.gomez at posteo dot org>") (:keywords "convenience") (:url . "https://github.com/dangom/writefreely.el"))])
+ (writegood-mode . [(20220509 1817) nil "Polish up poor writing on the fly" single ((:commit . "2ae759944a7865ceef6f6049f5e26c1f60c6270c") (:authors ("Benjamin Beckwith")) (:maintainer "Benjamin Beckwith") (:keywords "writing" "weasel-words" "grammar") (:url . "http://github.com/bnbeckwith/writegood-mode"))])
+ (writeroom-mode . [(20220426 2046) ((emacs (25 1)) (visual-fill-column (2 2))) "Minor mode for distraction-free writing" tar ((:commit . "a736205c194d7525feb1e1f10f4186c7b2b62bef") (:authors ("Joost Kremers" . "joostkremers@fastmail.fm")) (:maintainer "Joost Kremers" . "joostkremers@fastmail.fm") (:keywords "text") (:url . "https://github.com/joostkremers/writeroom-mode"))])
+ (ws-butler . [(20201117 1528) nil "Unobtrusively remove trailing whitespace." single ((:commit . "e3a38d93e01014cd47bf5af4924459bd145fd7c4") (:authors ("Le Wang")) (:maintainer "Le Wang") (:url . "https://github.com/lewang/ws-butler"))])
+ (wsd-mode . [(20191031 1211) nil "Emacs major-mode for www.websequencediagrams.com" tar ((:commit . "53330a2a43c4875f8682457df1a869a4c9028660") (:authors ("Jostein Kjønigsen" . "jostein@gmail.com")) (:maintainer "Jostein Kjønigsen" . "jostein@gmail.com") (:keywords "wsd" "diagrams" "design" "process" "modelling" "uml") (:url . "https://github.com/josteink/wsd-mode"))])
+ (wttrin . [(20170614 1206) ((emacs (24 4)) (xterm-color (1 0))) "Emacs frontend for weather web service wttr.in" single ((:commit . "df5427ce2a5ad4dab652dbb1c4a1834d7ddc2abc") (:authors ("Carl X. Su" . "bcbcarl@gmail.com") ("ono hiroko (kuanyui)" . "azazabc123@gmail.com")) (:maintainer "Carl X. Su" . "bcbcarl@gmail.com") (:keywords "comm" "weather" "wttrin") (:url . "https://github.com/bcbcarl/emacs-wttrin"))])
+ (wucuo . [(20211201 1214) ((emacs (25 1))) "Fastest solution to spell check camel case code or plain text" tar ((:commit . "09fc58a02621b6c9615f8289c457e30ca6f63bcb") (:authors ("Chen Bin <chenbin DOT sh AT gmail DOT com>")) (:maintainer "Chen Bin <chenbin DOT sh AT gmail DOT com>") (:keywords "convenience") (:url . "http://github.com/redguardtoo/wucuo"))])
+ (wwg . [(20210614 1527) ((emacs (25 1))) "Writer word goals" single ((:commit . "46c8a7c71275ced2c662c1222d4b85319f80dd83") (:authors (nil . "Andrea andrea-dev@hotmail.com>")) (:maintainer nil . "Andrea andrea-dev@hotmail.com>") (:keywords "wp") (:url . "https://github.com/ag91/writer-word-goals"))])
+ (wwtime . [(20151122 1610) nil "Insert a time of day with appropriate world-wide localization" single ((:commit . "d04d8fa814b5d3644efaeb28f25520ada69acbbd") (:authors ("Norman Walsh" . "ndw@nwalsh.com")) (:maintainer "Norman Walsh" . "ndw@nwalsh.com") (:keywords "time"))])
+ (www-synonyms . [(20170128 2251) ((request (0 2 0)) (cl-lib (0 5))) "insert synonym for a word" single ((:commit . "7e37ea35064ff31c9945f0198a653647d408c936") (:authors ("Bernhard Specht" . "bernhard@specht.net")) (:maintainer "Bernhard Specht" . "bernhard@specht.net") (:keywords "lisp"))])
+ (x-path-walker . [(20201220 628) ((helm-core (1 9 2))) "Navigation feature for JSON/XML/HTML based on path (imenu like)" tar ((:commit . "e553968b6ddebe39ea00904a2e9ff4cff6096985") (:authors (nil . "<lompik@ArchOrion>")) (:maintainer nil . "<lompik@ArchOrion>") (:keywords "convenience"))])
+ (x509-mode . [(20210407 627) ((emacs (24 1)) (cl-lib (0 5))) "View certificates, CRLs and keys using OpenSSL." tar ((:commit . "470769edba111aed8eabce58a3f2a02da0767624") (:authors ("Fredrik Axelsson" . "f.axelsson@gmai.com")) (:maintainer "Fredrik Axelsson" . "f.axelsson@gmai.com") (:url . "https://github.com/jobbflykt/x509-mode"))])
+ (x86-lookup . [(20210412 2022) ((emacs (24 3)) (cl-lib (0 3))) "jump to x86 instruction documentation" single ((:commit . "1573d61cc4457737b94624598a891c837fb52c16") (:authors ("Christopher Wellons" . "wellons@nullprogram.com")) (:maintainer "Christopher Wellons" . "wellons@nullprogram.com") (:url . "https://github.com/skeeto/x86-lookup"))])
+ (xbm-life . [(20210508 1640) ((emacs (24 1))) "A XBM version of Conway's Game of Life" single ((:commit . "ec6abb0182068294a379cb49ad5346b1d757457d") (:authors ("Vasilij Schneidermann" . "mail@vasilij.de")) (:maintainer "Vasilij Schneidermann" . "mail@vasilij.de") (:keywords "games") (:url . "https://depp.brause.cc/xbm-life"))])
+ (xcode-mode . [(20160907 1208) ((emacs (24 4)) (s (1 10 0)) (dash (2 11 0)) (multiple-cursors (1 0 0))) "A minor mode for emacs to perform Xcode like actions." single ((:commit . "2ae4f512d6c601ea39d5ab785c2b5288eac24b59") (:authors ("Nickolas Lanasa" . "nick@nytekproductions.com")) (:maintainer "Nickolas Lanasa" . "nick@nytekproductions.com") (:keywords "conveniences"))])
+ (xcode-project . [(20200810 2010) ((emacs (25))) "A package for reading Xcode project files." tar ((:commit . "11743f0a2212c840a108e1b905b1f20afcff8156") (:authors ("John Buckley" . "john@olivetoast.com")) (:maintainer "John Buckley" . "john@olivetoast.com") (:keywords "languages" "tools") (:url . "https://github.com/nhojb/xcode-project.git"))])
+ (xcscope . [(20210719 828) nil "cscope interface for (X)Emacs" single ((:commit . "d228d7593d762e457340f678d14b663ef66d7cee") (:authors ("Darryl Okahata" . "darrylo@sonic.net") ("Dima Kogan" . "dima@secretsauce.net")) (:maintainer "Dima Kogan" . "dima@secretsauce.net") (:keywords "languages" "c") (:url . "https://github.com/dkogan/xcscope.el"))])
+ (xenops . [(20220421 1320) ((emacs (26 1)) (aio (1 0)) (auctex (12 2 0)) (avy (0 5 0)) (dash (2 18 0)) (f (0 20 0)) (s (1 12 0))) "A LaTeX editing environment for mathematical documents" tar ((:commit . "a2c685b3bb2257da49af771caa02325aa41fa699") (:authors ("Dan Davison" . "dandavison7@gmail.com")) (:maintainer "Dan Davison" . "dandavison7@gmail.com") (:url . "https://github.com/dandavison/xenops"))])
+ (xhair . [(20210801 222) ((emacs (24 3)) (vline (1 0))) "Highlight the current line and column" single ((:commit . "c7bd7c501c3545aa99dadac386c882fe7c5edd9c") (:keywords "convenience" "faces" "maint") (:url . "https://github.com/Boruch-Baum/emacs-xhair"))])
+ (xkcd . [(20220503 1109) ((json (1 3))) "View xkcd from Emacs" single ((:commit . "80011da2e7def8f65233d4e0d790ca60d287081d") (:authors ("Vibhav Pant" . "vibhavp@gmail.com")) (:maintainer "Vibhav Pant" . "vibhavp@gmail.com") (:keywords "xkcd" "webcomic") (:url . "https://github.com/vibhavp/emacs-xkcd"))])
+ (xmind-org . [(20201202 1605) ((emacs (27 1)) (org-ml (5 3)) (dash (2 12))) "Import XMind mindmaps into Org" single ((:commit . "ee09e382b3fefb67ccf3cd4db96a8dd2acc34045") (:authors ("Akira Komamura" . "akira.komamura@gmail.com")) (:maintainer "Akira Komamura" . "akira.komamura@gmail.com") (:keywords "outlines" "wp" "files") (:url . "https://github.com/akirak/xmind-org-el"))])
+ (xml+ . [(20170727 2351) ((emacs (24 4)) (dash (2 12 0))) "Utilities for xml and html trees" single ((:commit . "232fa863c08fc159b21dd58c39ea45dce3334895") (:authors ("Ben Dean" . "bendean837@gmail.com")) (:maintainer "Ben Dean" . "bendean837@gmail.com") (:keywords "xml" "html") (:url . "https://github.com/bddean/xml-plus"))])
+ (xml-format . [(20191011 1148) ((emacs (25)) (reformatter (0 4))) "XML reformatter using xmllint" single ((:commit . "2861c4e33e18b077112efa072316b031bca4236c") (:authors ("wouter bolsterlee" . "wouter@bolsterl.ee")) (:maintainer "wouter bolsterlee" . "wouter@bolsterl.ee") (:keywords "languages") (:url . "https://github.com/wbolster/emacs-xml-format"))])
+ (xml-quotes . [(20200301 1222) nil "read quotations from an XML document" tar ((:commit . "8fc21e43b45f9a50b24642412f05afcc3a316a1f") (:authors ("Norman Walsh" . "ndw@nwalsh.com")) (:maintainer "Norman Walsh" . "ndw@nwalsh.com") (:keywords "xml" "quotations") (:url . "https://github.com/ndw/xml-quotes"))])
+ (xml-rpc . [(20200907 42) nil "An elisp implementation of clientside XML-RPC" single ((:commit . "b8c9c3147095983d45532627171c2b2ad422ef10") (:maintainer "Mark A. Hershberger" . "mah@everybody.org") (:keywords "xml" "rpc" "network") (:url . "http://github.com/xml-rpc-el/xml-rpc-el"))])
+ (xmlgen . [(20170411 1317) nil "A DSL for generating XML." single ((:commit . "dba66681f0c5e621a9e70e8afb34903c9ffe93c4") (:authors ("Philip Jackson" . "phil@shellarchive.co.uk")) (:maintainer "Philip Jackson" . "phil@shellarchive.co.uk"))])
+ (xmlunicode . [(20210829 1631) nil "Unicode support for XML" tar ((:commit . "6e91a39114ae6ec98b26c9670db916a02c721b1f") (:authors ("Norman Walsh" . "ndw@nwalsh.com")) (:maintainer "Norman Walsh" . "ndw@nwalsh.com") (:keywords "utf-8" "unicode" "xml" "characters"))])
+ (xo . [(20160403 646) nil "XO linter integration with compilation mode" single ((:commit . "72fcd867cfa332fdb82f732925cf8977e690af78") (:authors ("J.A" . "jer.github@gmail.com")) (:maintainer "J.A" . "jer.github@gmail.com") (:keywords "processes"))])
+ (xonsh-mode . [(20201020 52) ((emacs (24 3))) "Major mode for editing xonshrc files" single ((:commit . "7fa581524533a9b6b770426e4445e571a69e469d") (:authors ("Sean Farley" . "sean@farley.io")) (:maintainer "Sean Farley" . "sean@farley.io") (:keywords "languages") (:url . "https://github.com/seanfarley/xonsh-mode"))])
+ (xquery-mode . [(20170214 1119) ((cl-lib (0 5))) "A simple mode for editing xquery programs" single ((:commit . "1b655ccf83d02a7bd473d2cf02359ed60bdf7369") (:url . "https://github.com/xquery-mode/xquery-mode"))])
+ (xquery-tool . [(20200907 811) nil "A simple interface to saxonb's xquery." single ((:commit . "885184298ce1b6eb5d18922ea331623973082a15") (:authors ("Patrick McAllister" . "pma@rdorte.org")) (:maintainer "Patrick McAllister" . "pma@rdorte.org") (:keywords "xml" "xquery" "emacs") (:url . "https://github.com/paddymcall/xquery-tool.el"))])
+ (xref-js2 . [(20210310 1238) ((emacs (25 1)) (js2-mode (20150909))) "Jump to references/definitions using ag & js2-mode's AST" single ((:commit . "fd6b723e7f1f9793d189a815e1904364dc026b03") (:authors ("Nicolas Petton" . "nicolas@petton.fr")) (:maintainer "Nicolas Petton" . "nicolas@petton.fr") (:keywords "javascript" "convenience" "tools") (:url . "https://github.com/NicolasPetton/xref-js2"))])
+ (xref-rst . [(20220406 2311) ((emacs (28 1))) "Lookup reStructuredText symbols" single ((:commit . "7964709276ff033cd138efabfafb4f2179e75c22") (:authors ("Campbell Barton" . "ideasman42@gmail.com")) (:maintainer "Campbell Barton" . "ideasman42@gmail.com") (:url . "https://gitlab.com/ideasman42/emacs-xref-rst"))])
+ (xresources-theme . [(20190108 1851) nil "Use your .Xresources as your emacs theme" single ((:commit . "5239acb51aa2dfa89a207e57012108d8fcf60562") (:authors ("Marten Lienen" . "marten.lienen@gmail.com")) (:maintainer "Marten Lienen" . "marten.lienen@gmail.com") (:keywords "xresources" "theme"))])
+ (xterm-color . [(20200605 2017) ((emacs (24 4))) "ANSI, XTERM 256 and Truecolor support" single ((:commit . "1a4012854c69a5cdaeb5a73d2ad705011892fca3") (:authors ("xristos" . "xristos@sdf.org")) (:maintainer "xristos" . "xristos@sdf.org") (:keywords "faces") (:url . "https://github.com/atomontage/xterm-color"))])
+ (xterm-keybinder . [(20160523 56) ((emacs (24 3)) (cl-lib (0 5)) (let-alist (1 0 1))) "Let you extra keybinds in xterm/urxvt" tar ((:commit . "b29c4f700b0fa0c9f627f6725b36462b8fab06d6") (:authors ("Yuta Yamada <cokesboy\"at\"gmail.com>")) (:maintainer "Yuta Yamada <cokesboy\"at\"gmail.com>") (:keywords "convenient"))])
+ (xtest . [(20141214 1706) ((cl-lib (0 5))) "Simple Testing with Emacs & ERT" single ((:commit . "2c2bdf32667506dd9ddf6eb311832add616bdf1c") (:authors ("Mustafa Shameem")) (:maintainer "Mustafa Shameem") (:keywords "testing" "ert") (:url . "https://github.com/promethial/xtest"))])
+ (xwidgete . [(20171118 2116) ((emacs (25))) "enhances usability of current xwidget browser" single ((:commit . "e4e8410fe32176df85b46234717824519443fb04") (:authors ("Tu, Do Hoang" . "tuhdo1710@gmail.com")) (:maintainer "Tu, Do Hoang") (:keywords "xwidgete" "tools") (:url . "https://github.com/tuhdo/xwidgete"))])
+ (xwidgets-reuse . [(20200817 147) ((emacs (26 1))) "Reuse xwidgets sessions to reduce resource consumption" single ((:commit . "5d56472dda53e43e0a11edcd373b44c0dbab47ce") (:authors ("Boris Glavic" . "lordpretzel@gmail.com")) (:maintainer "Boris Glavic" . "lordpretzel@gmail.com") (:keywords "hypermedia") (:url . "https://github.com/lordpretzel/xwidgets-reuse"))])
+ (xwiki-mode . [(20211112 511) ((emacs (27 1))) "Major mode for xwiki-formatted text" single ((:commit . "580e65296ca0ffb20270610ef16bfeb8850fc7c8") (:authors ("Ackerley Tng" . "ackerleytng@gmail.com")) (:maintainer "Ackerley Tng" . "ackerleytng@gmail.com") (:keywords "languages" "convenience" "tools") (:url . "https://github.com/ackerleytng/xwiki-mode"))])
+ (xwwp . [(20200917 643) ((emacs (26 1))) "Enhance xwidget webkit browser" tar ((:commit . "f67e070a6e1b233e60274deb717274b000923231") (:authors ("Damien Merenne")) (:maintainer "Damien Merenne") (:keywords "convenience") (:url . "https://github.com/canatella/xwwp"))])
+ (xwwp-follow-link-helm . [(20200917 642) ((emacs (26 1)) (xwwp (0 1))) "Link navigation in `xwidget-webkit' sessions using `helm'" single ((:commit . "f67e070a6e1b233e60274deb717274b000923231") (:authors ("Damien Merenne")) (:maintainer "Damien Merenne") (:keywords "convenience") (:url . "https://github.com/canatella/xwwp"))])
+ (xwwp-follow-link-ivy . [(20200917 642) ((emacs (26 1)) (xwwp (0 1))) "Link navigation in `xwidget-webkit' sessions using `ivy'" single ((:commit . "f67e070a6e1b233e60274deb717274b000923231") (:authors ("Damien Merenne")) (:maintainer "Damien Merenne") (:keywords "convenience") (:url . "https://github.com/canatella/xwwp"))])
+ (yabin . [(20140206 351) nil "Yet Another Bignum package (A thin wrapper of calc.el)." single ((:commit . "db8c404507560ef9147fcce2b94cd706fbfa03b5") (:authors ("Daisuke Kobayashi" . "d5884jp@gmail.com")) (:maintainer "Daisuke Kobayashi" . "d5884jp@gmail.com") (:keywords "data"))])
+ (yafolding . [(20200119 1353) nil "Folding code blocks based on indentation" single ((:commit . "4c1888ae45f9241516519ae0ae3a899f2efa05ba") (:authors ("Zeno Zeng" . "zenoofzeng@gmail.com")) (:maintainer "Zeno Zeng" . "zenoofzeng@gmail.com") (:keywords "folding"))])
+ (yagist . [(20160418 508) ((cl-lib (0 3))) "Yet Another Emacs integration for gist.github.com" single ((:commit . "dcdbd84f348414815d02f3da8a6ee0ac271632d4") (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com") (:keywords "tools") (:url . "https://github.com/mhayashi1120/yagist.el"))])
+ (yahtzee . [(20220221 803) ((emacs (24 3))) "The yahtzee game" single ((:commit . "9b42ba4612d3043464414c08a3d60f6ad594566c") (:authors ("Dimitar Dimitrov" . "mail.mitko@gmail.com")) (:maintainer "Dimitar Dimitrov" . "mail.mitko@gmail.com") (:keywords "games") (:url . "https://github.com/drdv/yahtzee"))])
+ (yalinum . [(20130217 1043) nil "yet another display line numbers." single ((:commit . "d3e0cbe3f4f5ca311e3298e684901d6fea3ad973") (:authors ("tm8st" . "tm8st@hotmail.co.jp")) (:maintainer "tm8st" . "tm8st@hotmail.co.jp") (:keywords "convenience" "tools"))])
+ (yaml . [(20220311 332) ((emacs (25 1))) "YAML parser for Elisp" single ((:commit . "34c300b08579b72c7c92aefee1f4b500913f0c85") (:authors ("Zachary Romero" . "zkry@posteo.org")) (:maintainer "Zachary Romero" . "zkry@posteo.org") (:keywords "tools") (:url . "https://github.com/zkry/yaml.el"))])
+ (yaml-imenu . [(20220406 1703) ((emacs (24 4)) (yaml-mode (0))) "Enhancement of the imenu support in yaml-mode." tar ((:commit . "c1fbba8b03a7bef4fc2b87404914fa9c6eb67b55") (:authors ("Akinori MUSHA" . "knu@iDaemons.org")) (:maintainer "Akinori MUSHA" . "knu@iDaemons.org") (:keywords "outlining" "convenience" "imenu") (:url . "https://github.com/knu/yaml-imenu.el"))])
+ (yaml-mode . [(20220104 1503) ((emacs (24 1))) "Major mode for editing YAML files" single ((:commit . "535273d5a1eb76999d20afbcf4d9f056d8ffd2da") (:authors ("Yoshiki Kurihara" . "clouder@gmail.com") ("Marshall T. Vandegrift" . "llasram@gmail.com")) (:maintainer "Vasilij Schneidermann" . "mail@vasilij.de") (:keywords "data" "yaml") (:url . "https://github.com/yoshiki/yaml-mode"))])
+ (yaml-tomato . [(20151123 753) ((s (1 9))) "copy or show the yaml path currently under cursor." single ((:commit . "f9df1c9bdfcec629b03031b2d2032f9dc533cb14") (:authors ("qrczeno")) (:maintainer "qrczeno") (:keywords "yaml"))])
+ (yang-mode . [(20190507 724) nil "major mode for editing YANG files" single ((:commit . "4b4ab4d4a79d37d6c31c6ea7cccbc425e0b1eded") (:authors ("Martin Bjorklund" . "mbj4668@gmail.com")) (:maintainer "Martin Bjorklund" . "mbj4668@gmail.com"))])
+ (yankpad . [(20220201 2104) ((emacs (25 1))) "Paste snippets from an org-mode file" single ((:commit . "927e6d26956ac7219b8a69d641acf486854fba16") (:authors ("Erik Sjöstrand")) (:maintainer "Erik Sjöstrand") (:keywords "abbrev" "convenience") (:url . "http://github.com/Kungsgeten/yankpad"))])
+ (yapfify . [(20210914 634) nil "(automatically) format python buffers using YAPF." single ((:commit . "c9347e3b1dec5fc8d34883e206fcdc8500d22368") (:authors ("Joris Engbers" . "info@jorisengbers.nl")) (:maintainer "Joris Engbers" . "info@jorisengbers.nl") (:url . "https://github.com/JorisE/yapfify"))])
+ (yara-mode . [(20220317 935) ((emacs (24))) "Major mode for editing yara rule file" single ((:commit . "4c959b300ce52665c92e04e524dda5ed051c34f3") (:authors (nil . "binjo.cn@gmail.com")) (:maintainer nil . "binjo.cn@gmail.com") (:keywords "yara") (:url . "not distributed yet"))])
+ (yard-mode . [(20170817 1237) nil "Minor mode for Ruby YARD comments" single ((:commit . "ba74a47463b0320ae152bd42a7dd7aeecd7b5748") (:authors ("Kyle Hargraves")) (:maintainer "Kyle Hargraves") (:url . "https://github.com/pd/yard-mode.el"))])
+ (yari . [(20151128 739) nil "Yet Another RI interface for Emacs" single ((:commit . "a2cb9656ee5dfe1fc2ee3854f3079a1c8e85dbe9") (:authors ("Aleksei Gusev" . "aleksei.gusev@gmail.com")) (:maintainer "Aleksei Gusev" . "aleksei.gusev@gmail.com") (:keywords "tools"))])
+ (yarn-mode . [(20200208 2332) ((emacs (24 3))) "Major mode for yarn.lock files." single ((:commit . "8239d4dc7d8a52fa1e3fa81bd32c904a359fcfc1") (:authors ("Nicolás Salas V." . "nikosalas@gmail.com")) (:maintainer "Nicolás Salas V." . "nikosalas@gmail.com") (:keywords "convenience") (:url . "https://github.com/anachronic/yarn-mode"))])
+ (yascroll . [(20220212 1742) ((emacs (26 1))) "Yet Another Scroll Bar Mode" single ((:commit . "25f6bf7415f6821a4097037a8decd03813d08722") (:authors ("Tomohiro Matsuyama" . "m2ym.pub@gmail.com")) (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com") (:keywords "convenience") (:url . "https://github.com/emacsorphanage/yascroll"))])
+ (yasnippet . [(20200604 246) ((cl-lib (0 5))) "Yet another snippet extension for Emacs" single ((:commit . "5cbdbf0d2015540c59ed8ee0fcf4788effdf75b6") (:maintainer "Noam Postavsky" . "npostavs@gmail.com") (:keywords "convenience" "emulation") (:url . "http://github.com/joaotavora/yasnippet"))])
+ (yasnippet-lean . [(20220105 2251) ((yasnippet (0 8 0))) "Collection of snippets for the Lean prover" tar ((:commit . "c75485757cc8675ad4f36c1eb028d9d54dc21733") (:maintainer "Simon Hudon" . "simon.hudon@gmail.com") (:keywords "convenience" "snippets" "leanprover") (:url . "https://github.com/leanprover-community/yasnippet-lean"))])
+ (yasnippet-snippets . [(20220401 1534) ((yasnippet (0 8 0))) "Collection of yasnippet snippets" tar ((:commit . "c5bf4c4085aa61b9c07563de89f7aacc2a357db5") (:authors ("Andrea Crotti" . "andrea.crotti.0@gmail.com")) (:maintainer "Andrea Crotti" . "andrea.crotti.0@gmail.com") (:keywords "snippets") (:url . "https://github.com/AndreaCrotti/yasnippet-snippets"))])
+ (yatemplate . [(20211115 1208) ((yasnippet (0 8 1)) (emacs (24 3))) "File templates with yasnippet" single ((:commit . "275745ce1482edc08efb0b7807bc86d832bcc734") (:authors ("Wieland Hoffmann" . "themineo+yatemplate@gmail.com")) (:maintainer "Wieland Hoffmann" . "themineo+yatemplate@gmail.com") (:keywords "files" "convenience") (:url . "https://github.com/mineo/yatemplate"))])
+ (yatex . [(20211203 2212) nil "Yet Another tex-mode for emacs //野鳥//" tar ((:commit . "907de32064c99c25fb49072438be7c1034892af3"))])
+ (yaxception . [(20150105 1452) nil "Provide framework about exception like Java for Elisp" single ((:commit . "4e94cf3e0b9b5631b0e90eb4b7de597ee7185875") (:authors ("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) (:maintainer "Hiroaki Otsu" . "ootsuhiroaki@gmail.com") (:keywords "exception" "error" "signal") (:url . "https://github.com/aki2o/yaxception"))])
+ (ycm . [(20150822 1836) nil "Emacs client for the YouCompleteMe auto-completion server." single ((:commit . "4da8a14abcd0f4fa3235042ade2e12b5068c0601") (:authors ("Ajay Gopinathan" . "ajay@gopinathan.net")) (:maintainer "Ajay Gopinathan" . "ajay@gopinathan.net") (:keywords "c" "abbrev"))])
+ (ycmd . [(20190416 807) ((emacs (24 4)) (dash (2 13 0)) (s (1 11 0)) (deferred (0 5 1)) (cl-lib (0 6 1)) (let-alist (1 0 5)) (request (0 3 0)) (request-deferred (0 3 0)) (pkg-info (0 6))) "emacs bindings to the ycmd completion server" tar ((:commit . "c17ff9e0250a9b39d23af37015a2b300e2f36fed") (:url . "https://github.com/abingham/emacs-ycmd"))])
+ (ydk-mode . [(20170113 921) nil "Language support for Yu-Gi-Oh! deck files" single ((:commit . "f3f125b29408e0b0a34fec27dcb7c02c5dbfd04e") (:authors ("Jackson Ray Hamilton" . "jackson@jacksonrayhamilton.com")) (:maintainer "Jackson Ray Hamilton" . "jackson@jacksonrayhamilton.com") (:keywords "faces" "games" "languages" "ydk" "yugioh" "yu-gi-oh") (:url . "https://github.com/jacksonrayhamilton/ydk-mode"))])
+ (yequake . [(20200219 2323) ((emacs (25 2)) (dash (2 14 1))) "Drop-down frames, like Yakuake" single ((:commit . "d18166e597414350117d0b82a29e509fc53c636d") (:authors ("Adam Porter" . "adam@alphapapa.net")) (:maintainer "Adam Porter" . "adam@alphapapa.net") (:keywords "convenience" "window-system" "frames") (:url . "http://github.com/alphapapa/yequake"))])
+ (yesql-ghosts . [(20150220 1237) ((s (1 9 0)) (dash (2 10 0)) (cider (0 8 0))) "Display ghostly yesql defqueries inline" single ((:commit . "8f1faf0137b85a5072d13e1240a463d9a35ce2bb") (:authors ("Magnar Sveen" . "magnars@gmail.com")) (:maintainer "Magnar Sveen" . "magnars@gmail.com"))])
+ (yesterbox . [(20200327 52) ((emacs (24 3))) "Count number of inbox messages by day" single ((:commit . "10591342f1759e25756f5865371a53c132d8b0a0") (:authors ("Stephen J. Eglen" . "sje30@cam.ac.uk")) (:maintainer "Stephen J. Eglen" . "sje30@cam.ac.uk") (:keywords "mail") (:url . "http://github.com/sje30/yesterbox"))])
+ (ynab . [(20200607 2008) ((emacs (26 3)) (cl-lib (0 5)) (ts (0 2))) "Major mode for YNAB (you need a budget)" single ((:commit . "2c6beb4d2c4996017f6b3c62c26db52a61e5c479") (:authors ("Jim Anders <https://github.com/janders223>")) (:maintainer "Jim Anders" . "jimanders223@gmail.com") (:keywords "ynab" "budget" "convenience") (:url . "https://github.com/janders223/ynab.el"))])
+ (yoficator . [(20190509 1620) nil "Interactively yoficate Russian texts" tar ((:commit . "fa914f9648515bca54b5e558ca57d2b65fa57491") (:authors ("Eugene Minkovskii" . "emin@mccme.ru") ("Alexander Krotov" . "ilabdsf@gmail.com")) (:maintainer "Eugene Minkovskii" . "emin@mccme.ru") (:url . "https://gitlab.com/link2xt/yoficator"))])
+ (yoshi-theme . [(20211031 456) nil "Theme named after my cat" single ((:commit . "787bb0a13c6e1b28e904e1b7f18564d5e97c9c93") (:authors ("Tom Willemse" . "tom@ryuslash.org")) (:maintainer "Tom Willemse" . "tom@ryuslash.org") (:keywords "faces") (:url . "http://projects.ryuslash.org/yoshi-theme/"))])
+ (youdao-dictionary . [(20200722 1705) ((popup (0 5 0)) (pos-tip (0 4 6)) (chinese-word-at-point (0 2)) (names (0 5)) (emacs (24))) "Youdao Dictionary interface for Emacs" single ((:commit . "8a4815a43565b9bfd257246e4895b8bfafb9d573") (:authors ("Chunyang Xu" . "xuchunyang56@gmail.com")) (:maintainer "Chunyang Xu" . "xuchunyang56@gmail.com") (:keywords "convenience" "chinese" "dictionary") (:url . "https://github.com/xuchunyang/youdao-dictionary.el"))])
+ (ytdious . [(20210228 2111) ((emacs (25 3))) "Query / Preview YouTube via Invidious" single ((:commit . "941460b51e43ef6764e15e2b9c4af54c3e56115f") (:authors ("Stefan Huchler") ("Gabriele Rastello")) (:maintainer "Stefan Huchler") (:keywords "youtube" "matching" "multimedia") (:url . "https://github.com/spiderbit/ytdious"))])
+ (ytdl . [(20210506 914) ((emacs (26 1)) (async (1 9 4)) (transient (0 2 0)) (dash (2 17 0))) "Emacs Interface for youtube-dl" single ((:commit . "23da64f5c38b8cb83dbbadf704171b86cc0fa937") (:authors ("Arnaud Hoffmann" . "tuedachu@gmail.com")) (:maintainer "Arnaud Hoffmann" . "tuedachu@gmail.com") (:keywords "comm" "multimedia") (:url . "https://gitlab.com/tuedachu/ytdl"))])
+ (ytel . [(20200725 1056) ((emacs (25 3))) "Query YouTube via Invidious" single ((:commit . "d40bc7ead8d4d7e4d16b03b66a93d63bef51cc5f") (:authors ("Gabriele Rastello")) (:maintainer "Gabriele Rastello") (:keywords "youtube" "matching" "multimedia") (:url . "https://github.com/grastello/ytel"))])
+ (z3-mode . [(20211116 138) ((flycheck (0 23)) (emacs (24))) "A z3/SMTLIBv2 interactive development environment" single ((:commit . "0356cbe1e1e2b780ba0ddb4aaa055fa246a67931") (:authors ("Zephyr Pellerin" . "zephyr.pellerin@gmail.com")) (:maintainer "Zephyr Pellerin" . "zephyr.pellerin@gmail.com") (:keywords "z3" "yices" "mathsat" "smt" "beaver") (:url . "https://github.com/zv/z3-mode"))])
+ (zeal-at-point . [(20180131 2354) nil "Search the word at point with Zeal" single ((:commit . "0fc3263f44e95acd3e9d91057677621ce4d297ee") (:authors ("Jinzhu" . "wosmvp@gmail.com")) (:maintainer "Jinzhu" . "wosmvp@gmail.com") (:url . "https://github.com/jinzhu/zeal-at-point"))])
+ (zel . [(20171014 832) ((emacs (25)) (frecency (0 1))) "Access frecent files easily" single ((:commit . "9dae2d212224d1deae1f62561fa8e4d689fd09f2") (:authors ("Sebastian Christ" . "rudolfo.christ@gmail.com")) (:maintainer "Sebastian Christ" . "rudolfo.christ@gmail.com") (:keywords "convenience" "files" "matching") (:url . "https://github.com/rudolfochrist/zel"))])
+ (zen-and-art-theme . [(20120622 1437) nil "zen and art color theme for GNU Emacs 24" single ((:commit . "a7226cbce0bca2501d69a620cb2aeabfc396c232") (:authors ("Nick Parker")) (:maintainer "Nick Parker"))])
+ (zen-mode . [(20200609 822) ((emacs (24 3))) "A major mode for the Zen programming language" single ((:commit . "c1b1806358f3cce6c04b30699987d82dc7d42559") (:authors ("Andrea Orru <andreaorru1991@gmail.com>, Andrew Kelley <superjoe30@gmail.com>, kristopher tate <kt@connectfree.co.jp>, Yoshitaka Takemoto" . "yt.3b8@connectfree.co.jp")) (:maintainer "Andrea Orru <andreaorru1991@gmail.com>, Andrew Kelley <superjoe30@gmail.com>, kristopher tate <kt@connectfree.co.jp>, Yoshitaka Takemoto" . "yt.3b8@connectfree.co.jp") (:keywords "zen" "languages") (:url . "https://github.com/zenlang/zen-mode"))])
+ (zenburn-theme . [(20220412 2023) nil "A low contrast color theme for Emacs." single ((:commit . "89c0e39317850d5ccf14dcbbaff06b0a193454a6") (:authors ("Bozhidar Batsov" . "bozhidar@batsov.com")) (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.com") (:url . "http://github.com/bbatsov/zenburn-emacs"))])
+ (zencoding-mode . [(20140213 822) nil "Unfold CSS-selector-like expressions to markup" single ((:commit . "58e42af182c98cb9941d27cd042d227fbf4e146c") (:authors ("Chris Done" . "chrisdone@gmail.com")) (:maintainer "Chris Done" . "chrisdone@gmail.com") (:keywords "convenience") (:url . "https://github.com/rooney/zencoding"))])
+ (zenity-color-picker . [(20160302 1154) ((emacs (24 4))) "Insert and adjust colors using Zenity" single ((:commit . "4f4f46676a461ebc881487fb70c8c181e323db5e") (:authors ("Samuel Laurén" . "samuel.lauren@iki.fi")) (:maintainer "Samuel Laurén" . "samuel.lauren@iki.fi") (:keywords "colors") (:url . "https://bitbucket.org/Soft/zenity-color-picker.el"))])
+ (zeno-theme . [(20211205 2148) ((emacs (24))) "A dark theme using different shades of blue" single ((:commit . "70fa7b7442f24ea25eab538b5a22da690745fef5") (:authors ("Bharat Joshi" . "jbharat@outlook.com")) (:maintainer "Bharat Joshi" . "jbharat@outlook.com") (:keywords "faces" "theme" "dark" "blue") (:url . "https://github.com/jbharat/zeno-theme"))])
+ (zenscript-mode . [(20210102 1350) ((emacs (25 1))) "Major mode for ZenScript" tar ((:commit . "c33b4525502459fe60dd76b383e19919d450aeb8") (:url . "https://github.com/eutropius225/zenscript-mode"))])
+ (zephir-mode . [(20200417 830) ((cl-lib (0 5)) (pkg-info (0 4)) (emacs (25 1))) "Major mode for editing Zephir code" tar ((:commit . "4e9618b77dff67c1c7b6fff78605a62311db88b8") (:authors ("Serghei Iakovlev" . "egrep@protonmail.ch")) (:maintainer "Serghei Iakovlev" . "egrep@protonmail.ch") (:keywords "languages") (:url . "https://github.com/zephir-lang/zephir-mode"))])
+ (zero-input . [(20200405 1220) ((emacs (24 3)) (s (1 2 0))) "Zero Chinese input method framework" single ((:commit . "729da9f4b99acb744ee6974ed7f3d4e252fd19da") (:url . "https://gitlab.emacsos.com/sylecn/zero-el"))])
+ (zerodark-theme . [(20211115 841) ((all-the-icons (2 0 0))) "A dark, medium contrast theme for Emacs" single ((:commit . "b463528704f6eb00684c0ee003fbd8e42901cde0") (:authors ("Nicolas Petton" . "nicolas@petton.fr")) (:maintainer "Nicolas Petton" . "nicolas@petton.fr") (:keywords "themes") (:url . "https://github.com/NicolasPetton/zerodark-theme"))])
+ (zetteldeft . [(20220429 2057) ((emacs (25 1)) (deft (0 8)) (ace-window (0 7 0))) "Turn deft into a zettelkasten system" tar ((:commit . "86dd346be4bdddd6ac8d47503355fea350098271") (:authors ("EFLS <Elias Storms>")) (:maintainer "EFLS <Elias Storms>") (:keywords "deft" "zettelkasten" "zetteldeft" "wp" "files") (:url . "https://efls.github.io/zetteldeft/"))])
+ (zettelkasten . [(20210830 1025) ((emacs (25 1)) (s (1 10 0))) "Helper functions to organise notes in a Zettelkasten style" single ((:commit . "603a5b692a08340c1865a6f73cacf57c4fd64cb2") (:authors ("Yann Herklotz" . "yann@ymhg.org")) (:maintainer "Yann Herklotz" . "yann@ymhg.org") (:keywords "files" "hypermedia" "notes") (:url . "https://github.com/ymherklotz/emacs-zettelkasten"))])
+ (zetz-mode . [(20200823 536) ((emacs (25 1)) (dash (2 17 0)) (hydra (0 15 0))) "A major mode for the ZetZ programming language" single ((:commit . "04da33f4ffa9db5b3556f423276f4fd1db13ec67") (:keywords "languages" "programming") (:url . "https://github.com/damon-kwok/zetz-mode"))])
+ (zig-mode . [(20211227 1108) ((emacs (24 3))) "A major mode for the Zig programming language" single ((:commit . "aa20d630b8c413dab8d6bd120ec3ed5db5c9da70") (:authors ("Andrea Orru <andreaorru1991@gmail.com>, Andrew Kelley" . "superjoe30@gmail.com")) (:maintainer "Andrea Orru <andreaorru1991@gmail.com>, Andrew Kelley" . "superjoe30@gmail.com") (:keywords "zig" "languages") (:url . "https://github.com/zig-lang/zig-mode"))])
+ (zim-wiki-mode . [(20211117 2000) ((emacs (25 1)) (helm-ag (0 58)) (helm-projectile (0 14 0)) (dokuwiki-mode (0 1 1)) (link-hint (0 1)) (pretty-hydra (0 2 2))) "Zim Desktop Wiki edit mode" single ((:commit . "aa906931f22c34d77c65bed31121edfef714e4e2") (:authors ("Will Foran" . "willforan+zim-wiki-mode@gmail.com")) (:maintainer "Will Foran" . "willforan+zim-wiki-mode@gmail.com") (:keywords "outlines") (:url . "https://github.com/WillForan/zim-wiki-mode"))])
+ (zimports . [(20211011 2059) ((emacs (26 1)) (projectile (2 1 0))) "Reformat python imports with zimports" single ((:commit . "76cf76bdc871cb0454a6fc555aeb1aa94f1b6e57") (:url . "https://github.com/schmir/zimports.el"))])
+ (zk . [(20220509 2156) ((emacs (24 4))) "Functions for working with Zettelkasten-style linked notes" single ((:commit . "9a3ed5e743c38725e7d9a7e4eaecfe624654c68d") (:authors ("Grant Rosson <https://github.com/localauthor>")) (:maintainer "Grant Rosson <https://github.com/localauthor>") (:url . "https://github.com/localauthor/zk"))])
+ (zk-index . [(20220509 802) ((emacs (26 1)) (zk (0 3))) "Index and Desktop for zk" single ((:commit . "9a3ed5e743c38725e7d9a7e4eaecfe624654c68d") (:authors ("Grant Rosson <https://github.com/localauthor>")) (:maintainer "Grant Rosson <https://github.com/localauthor>") (:url . "https://github.com/localauthor/zk"))])
+ (zlc . [(20151011 157) nil "Provides zsh like completion system to Emacs" single ((:commit . "4dd2ba267ecdeac845a7cbb3147294ee7daa25f4") (:authors ("mooz" . "stillpedant@gmail.com")) (:maintainer "mooz" . "stillpedant@gmail.com") (:keywords "matching" "convenience"))])
+ (zmq . [(20210613 343) ((cl-lib (0 5)) (emacs (26))) "ZMQ bindings in elisp" tar ((:commit . "38dc6c4119aee57666caf8f97c8a3d7f678823e0") (:authors ("Nathaniel Nicandro" . "nathanielnicandro@gmail.com")) (:maintainer "Nathaniel Nicandro" . "nathanielnicandro@gmail.com") (:keywords "comm") (:url . "https://github.com/nnicandro/emacs-zmq"))])
+ (znc . [(20210803 159) ((cl-lib (0 2))) "ZNC + ERC" single ((:commit . "6f0949c393b7778a96033716787d152ada32f705") (:authors ("Yaroslav Shirokov")) (:maintainer "Yaroslav Shirokov") (:url . "https://github.com/sshirokov/ZNC.el"))])
+ (zombie . [(20141222 1616) nil "major mode for editing ZOMBIE programs" single ((:commit . "ff8cd1b4cdbb4b0b9b8fd1ec8f6fb93eba249345") (:authors ("zk_phi")) (:maintainer "zk_phi") (:url . "http://hins11.yu-yake.com/"))])
+ (zombie-trellys-mode . [(20150304 1448) ((emacs (24)) (cl-lib (0 5)) (haskell-mode (1 5))) "A minor mode for interaction with Zombie Trellys" single ((:commit . "7f0c45fdda3a44c3b6d1762d116abb1421b8fba2") (:authors ("David Raymond Christiansen" . "david@davidchristiansen.dk")) (:maintainer "David Raymond Christiansen" . "david@davidchristiansen.dk") (:keywords "languages"))])
+ (zone-nyan . [(20210508 1642) ((emacs (24 3)) (esxml (0 3 1))) "Zone out with nyan cat" single ((:commit . "38b6e9f1f5871e9166b00a1db44680caa56773be") (:authors ("Vasilij Schneidermann" . "mail@vasilij.de")) (:maintainer "Vasilij Schneidermann" . "mail@vasilij.de") (:keywords "games") (:url . "https://depp.brause.cc/zone-nyan"))])
+ (zone-rainbow . [(20160120 1334) ((emacs (24 3))) "Zone out with rainbow." single ((:commit . "2ba4f1a87c69c4712124ebf12c1f3ea171e1af36") (:authors ("KAWABATA, Taichi <kawabata.taichi_at_gmail.com>")) (:maintainer "KAWABATA, Taichi <kawabata.taichi_at_gmail.com>") (:keywords "games") (:url . "https://github.com/kawabata/zone-rainbow"))])
+ (zone-select . [(20160118 1419) ((emacs (24 3)) (dash (2 8))) "Select zone programs." single ((:commit . "bf30da12f1625fe6563448fccf3c506acad10af7") (:authors ("KAWABATA, Taichi <kawabata.taichi_at_gmail.com>")) (:maintainer "KAWABATA, Taichi <kawabata.taichi_at_gmail.com>") (:keywords "games") (:url . "https://github.com/kawabata/zone-select"))])
+ (zone-sl . [(20160201 1210) ((emacs (24 3))) "Zone out with steam locomotives." single ((:commit . "7ec22e3661c6348382f9fc39a9d0063dbd2352ff") (:authors ("KAWABATA, Taichi <kawabata.taichi_at_gmail.com>")) (:maintainer "KAWABATA, Taichi <kawabata.taichi_at_gmail.com>") (:keywords "games") (:url . "https://github.com/kawabata/zone-sl"))])
+ (zoom . [(20220411 1126) ((emacs (24 4))) "Fixed and automatic balanced window layout" single ((:commit . "2104abb074682db79b9ff3a748e8e2e760a4d8cf") (:authors ("Andrea Cardaci" . "cyrus.and@gmail.com")) (:maintainer "Andrea Cardaci" . "cyrus.and@gmail.com") (:keywords "frames") (:url . "https://github.com/cyrus-and/zoom"))])
+ (zoom-window . [(20201205 1038) ((emacs (24 3))) "Zoom window like tmux" single ((:commit . "402f85f5d7d18e26289adcd452d42c73dc1df580") (:authors ("Syohei YOSHIDA" . "syohex@gmail.com")) (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com") (:url . "https://github.com/syohex/emacs-zoom-window"))])
+ (zop-to-char . [(20160212 1554) ((cl-lib (0 5))) "A replacement of zap-to-char." single ((:commit . "00152aa666354b27e56e20565f186b363afa0dce") (:authors ("Thierry Volpiatto" . "thierry.volpiatto@gmail.com")) (:maintainer "Thierry Volpiatto" . "thierry.volpiatto@gmail.com") (:url . "https://github.com/thierryvolpiatto/zop-to-char"))])
+ (zotelo . [(20160602 949) ((cl-lib (0 5))) "Manage Zotero collections from emacs" single ((:commit . "d9dc089b9adfcc70a63f2a84269a12eb7cb4c748") (:authors ("Spinu Vitalie")) (:maintainer "Spinu Vitalie") (:keywords "zotero" "emacs" "reftex" "bibtex" "mozrepl" "bibliography manager") (:url . "https://github.com/vitoshka/zotelo"))])
+ (zotero . [(20211008 2207) ((emacs (27 1)) (ht (2 2)) (oauth (1 0 4)) (s (1 12 0))) "Library for the Zotero API" tar ((:commit . "811bd1f14b38c3dde3f80cd8a13490c9900de888") (:authors ("Folkert van der Beek" . "folkertvanderbeek@gmail.com")) (:maintainer "Folkert van der Beek" . "folkertvanderbeek@gmail.com") (:keywords "zotero" "hypermedia") (:url . "https://gitlab.com/fvdbeek/emacs-zotero"))])
+ (zotxt . [(20210908 402) ((request (0 3 2)) (deferred (0 5 1))) "Tools to integrate emacs with Zotero via the zotxt plugin." tar ((:commit . "96a132d6b39f6bc19a58913b761d42efc198f8a4") (:authors ("Erik Hetzner" . "egh@e6h.org")) (:maintainer "Erik Hetzner" . "egh@e6h.org") (:keywords "bib"))])
+ (zoutline . [(20220102 835) nil "Simple outline library." single ((:commit . "32857c6c4b9b0bcbed14d825a10b91a98d5fed0a") (:authors ("Oleh Krehel" . "ohwoeowho@gmail.com")) (:maintainer "Oleh Krehel" . "ohwoeowho@gmail.com") (:keywords "outline") (:url . "https://github.com/abo-abo/zoutline"))])
+ (zoxide . [(20220302 522) ((emacs (25 1))) "Find file by zoxide" single ((:commit . "2133eb000b5239b08a1c2532629a19a19f8e6309") (:authors ("Ruoyu Feng" . "emacs@vonfry.name")) (:maintainer "Ruoyu Feng" . "emacs@vonfry.name") (:keywords "converience" "matching") (:url . "https://gitlab.com/Vonfry/zoxide.el"))])
+ (zpl-mode . [(20180906 1059) ((emacs (24 3))) "ZIMPL major mode" single ((:commit . "35e7e23c6baf31b5e65dd7405c8ab9b13c70637e") (:url . "https://github.com/ax487/zpl-mode.git"))])
+ (zpresent . [(20200417 309) ((emacs (25 1)) (org-parser (0 4)) (dash (2 12 0)) (request (0 3 0))) "Simple presentation mode based on org files." single ((:commit . "406967322b7692492a5942d901335d626cace4d0") (:keywords "comm") (:url . "https://hg.sr.ht/~zck/zpresent"))])
+ (zprint-format . [(20210602 146) ((emacs (24)) (reformatter (0 3))) "Reformat Clojure code using zprint" single ((:commit . "6051a5709ea6182974d7239f26e04c9731e04447") (:authors ("Derek Passen" . "dpassen1@gmail.com")) (:maintainer "Derek Passen" . "dpassen1@gmail.com") (:keywords "clojure" "zprint" "tools" "languages") (:url . "http://www.github.com/dpassen/zprint-format"))])
+ (zprint-mode . [(20200731 1238) ((emacs (24 3))) "Reformat Clojure(Script) code using zprint" tar ((:commit . "b9b72b4918156f2f44aa544be9e19ea391937c2a") (:authors ("Paulus Esterhazy" . "pesterhazy@gmail.com")) (:maintainer "Paulus Esterhazy" . "pesterhazy@gmail.com") (:keywords "tools") (:url . "https://github.com/pesterhazy/zprint-mode.el"))])
+ (ztree . [(20210415 1947) ((cl-lib (0))) "Text mode directory tree" tar ((:commit . "f05677f9696e573c8c607e8876fb4a0cccbc491f") (:authors ("Alexey Veretennikov" . "alexey.veretennikov@gmail.com")) (:maintainer "Alexey Veretennikov" . "alexey.veretennikov@gmail.com") (:keywords "files" "tools") (:url . "https://github.com/fourier/ztree"))])
+ (zweilight-theme . [(20170113 605) nil "A dark color theme for Emacs." single ((:commit . "7f45ab9e23164d65538edb2beb9692ecdc24c31e") (:authors ("Philip Arvidsson" . "contact@philiparvidsson.com")) (:maintainer "Philip Arvidsson" . "contact@philiparvidsson.com") (:url . "http://github.com/philiparvidsson/zweilight-emacs"))])
+ (zygospore . [(20140703 852) nil "reversible C-x 1 (delete-other-windows)" single ((:commit . "1af5ee663f5a7aa08d96a77cacff834dcdf55ea8") (:authors ("Louis Kottmann" . "louis.kottmann@gmail.com")) (:maintainer "Louis Kottmann" . "louis.kottmann@gmail.com") (:url . "https://github.com/louiskottmann/zygospore.el"))])
+ (zzz-to-char . [(20210321 1707) ((emacs (24 4)) (cl-lib (0 5)) (avy (0 3 0))) "Fancy version of `zap-to-char' command" single ((:commit . "fa87da4ac95a1d7fe8aa9198c5568debee8d5627") (:authors ("Mark Karpov" . "markkarpov92@gmail.com")) (:maintainer "Mark Karpov" . "markkarpov92@gmail.com") (:keywords "convenience") (:url . "https://github.com/mrkkrp/zzz-to-char"))])) \ No newline at end of file
diff --git a/elpa/archives/nongnu/archive-contents b/elpa/archives/nongnu/archive-contents
new file mode 100644
index 0000000..bf24829
--- /dev/null
+++ b/elpa/archives/nongnu/archive-contents
@@ -0,0 +1,1643 @@
+(1
+ (afternoon-theme .
+ [(0 1)
+ ((emacs
+ (24 1)))
+ "Dark color theme with a deep blue background" tar
+ ((:url . "http://github.com/osener/emacs-afternoon-theme")
+ (:keywords "themes")
+ (:maintainer "Ozan Sener" . "ozan@ozansener.com")
+ (:authors
+ ("Ozan Sener" . "ozan@ozansener.com")))])
+ (alect-themes .
+ [(0 10)
+ ((emacs
+ (24 0)))
+ "Configurable light, dark and black themes for Emacs 24 or later" tar
+ ((:url . "https://github.com/alezost/alect-themes")
+ (:keywords "color" "theme")
+ (:maintainer "Alex Kost" . "alezost@gmail.com")
+ (:authors
+ ("Alex Kost" . "alezost@gmail.com")))])
+ (ample-theme .
+ [(0 3 0)
+ nil "Calm Dark Theme for Emacs" tar
+ ((:url . "https://github.com/jordonbiondo/ample-theme")
+ (:keywords "theme" "dark")
+ (:maintainer "Jordon Biondo" . "jordonbiondo@gmail.com")
+ (:authors
+ ("Jordon Biondo" . "jordonbiondo@gmail.com")))])
+ (annotate .
+ [(1 5 4)
+ nil "annotate files without changing them" tar
+ ((:url . "https://github.com/bastibe/annotate.el")
+ (:maintainer "Bastian Bechtold <bastibe.dev@mailbox.org>, cage" . "cage-dev@twistfold.it")
+ (:authors
+ ("Bastian Bechtold"))
+ (:commit . "c00b6f49f779dc5caac7b37d1e35f87891e015d4"))])
+ (anti-zenburn-theme .
+ [(2 5 1)
+ nil "Low-contrast Zenburn-inverted theme" tar
+ ((:url . "https://github.com/m00natic/anti-zenburn-theme")
+ (:maintainer "Andrey Kotlarski" . "m00naticus@gmail.com")
+ (:authors
+ ("Andrey Kotlarski" . "m00naticus@gmail.com")))])
+ (anzu .
+ [(0 64)
+ ((emacs
+ (25 1)))
+ "Show number of matches in mode-line while searching" tar
+ ((:url . "https://github.com/emacsorphanage/anzu")
+ (:maintainer "Neil Okamoto" . "neil.okamoto+melpa@gmail.com")
+ (:authors
+ ("Syohei YOSHIDA" . "syohex@gmail.com")))])
+ (apache-mode .
+ [(2 2 0)
+ nil "Major mode for editing Apache httpd configuration files" tar
+ ((:url . "https://github.com/emacs-php/apache-mode")
+ (:maintainer "USAMI Kenta" . "tadsan@zonu.me")
+ (:authors
+ ("Karl Chen" . "quarl@nospam.quarl.org"))
+ (:keywords "languages" "faces"))])
+ (apropospriate-theme .
+ [(0 1 1)
+ nil "A light & dark theme set for Emacs." tar
+ ((:url . "http://github.com/waymondo/apropospriate-theme")
+ (:maintainer "Justin Talbott" . "justin@waymondo.com")
+ (:authors
+ ("Justin Talbott" . "justin@waymondo.com")))])
+ (arduino-mode .
+ [(1 3 0)
+ ((emacs
+ (25 1))
+ (spinner
+ (1 7 3)))
+ "Major mode for editing Arduino code" tar
+ ((:url . "https://github.com/stardiviner/arduino-mode")
+ (:maintainer "stardiviner" . "numbchild@gmail.com")
+ (:keywords "languages" "arduino"))])
+ (autothemer .
+ [(0 2 3)
+ ((dash
+ (2 10 0))
+ (emacs
+ (24))
+ (cl-lib
+ (0 5)))
+ "Conveniently define themes." tar
+ ((:url . "https://github.com/sebastiansturm/autothemer")
+ (:maintainer "Sebastian Sturm")
+ (:authors
+ ("Sebastian Sturm")))])
+ (better-jumper .
+ [(1 0 1)
+ ((emacs
+ (25 1)))
+ "configurable jump list" tar
+ ((:url . "https://github.com/gilbertw1/better-jumper")
+ (:keywords "convenience" "jump" "history" "evil")
+ (:maintainer "Bryan Gilbert" . "bryan@bryan.sh")
+ (:authors
+ ("Bryan Gilbert <http://github/gilbertw1>")))])
+ (bind-map .
+ [(1 1 2)
+ ((emacs
+ (24 3)))
+ "Bind personal keymaps in multiple locations" tar
+ ((:url . "https://github.com/justbur/emacs-bind-map")
+ (:maintainer "Justin Burkett" . "justin@burkett.cc")
+ (:authors
+ ("Justin Burkett" . "justin@burkett.cc"))
+ (:commit . "6977e0fec5c4a3c62a10503798c2a15194167046"))])
+ (bison-mode .
+ [(0 4)
+ nil "Major mode for editing bison, yacc and lex files." tar
+ ((:maintainer "Eric Beuscher" . "beuscher@eecs.tulane.edu")
+ (:authors
+ ("Eric Beuscher" . "beuscher@eecs.tulane.edu"))
+ (:keywords "bison-mode" "yacc-mode")
+ (:url . "https://elpa.nongnu.org/nongnu/bison-mode.html"))])
+ (boxquote .
+ [(2 2)
+ ((cl-lib
+ (0 5)))
+ "Quote text with a semi-box." tar
+ ((:url . "https://github.com/davep/boxquote.el")
+ (:keywords "quoting")
+ (:maintainer "Dave Pearson" . "davep@davep.org")
+ (:authors
+ ("Dave Pearson" . "davep@davep.org")))])
+ (buttercup .
+ [(1 25)
+ ((emacs
+ (24 3)))
+ "Behavior-Driven Emacs Lisp Testing" tar
+ ((:url . "https://github.com/jorgenschaefer/emacs-buttercup")
+ (:maintainer "Ola Nilsson" . "ola.nilsson@gmail.com")
+ (:authors
+ ("Jorgen Schaefer" . "contact@jorgenschaefer.de"))
+ (:commit . "ba62f80555d46faf49dc451c0ad20f39f6a170ab"))])
+ (caml .
+ [(4 9)
+ ((emacs
+ (24 3)))
+ "Caml mode for GNU Emacs" tar
+ ((:url . "https://github.com/ocaml/caml-mode")
+ (:maintainer "Christophe Troestler" . "Christophe.Troestler@umons.ac.be")
+ (:authors
+ ("Jacques Garrigue" . "garrigue@kurims.kyoto-u.ac.jp")
+ ("Ian T Zimmerman" . "itz@rahul.net")
+ ("Damien Doligez" . "damien.doligez@inria.fr"))
+ (:keywords "ocaml"))])
+ (cider .
+ [(1 4 0)
+ ((emacs
+ (26))
+ (clojure-mode
+ (5 14))
+ (parseedn
+ (1 0 6))
+ (queue
+ (0 2))
+ (spinner
+ (1 7))
+ (seq
+ (2 22))
+ (sesman
+ (0 3 2)))
+ "Clojure Interactive Development Environment that Rocks" tar
+ ((:url . "http://www.github.com/clojure-emacs/cider")
+ (:keywords "languages" "clojure" "cider")
+ (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev")
+ (:authors
+ ("Tim King" . "kingtim@gmail.com")
+ ("Phil Hagelberg" . "technomancy@gmail.com")
+ ("Bozhidar Batsov" . "bozhidar@batsov.dev")
+ ("Artur Malabarba" . "bruce.connor.am@gmail.com")
+ ("Hugo Duncan" . "hugo@hugoduncan.org")
+ ("Steve Purcell" . "steve@sanityinc.com"))
+ (:commit . "b2cee7fc301735b403920583cc2c23dcf70990a3"))])
+ (clojure-mode .
+ [(5 14 0)
+ ((emacs
+ (25 1)))
+ "Major mode for Clojure code" tar
+ ((:url . "http://github.com/clojure-emacs/clojure-mode")
+ (:keywords "languages" "clojure" "clojurescript" "lisp")
+ (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev")
+ (:commit . "b7d08b87f6a116ff47b33ee857926b60c66c3ab7"))])
+ (coffee-mode .
+ [(0 6 3)
+ ((emacs
+ (24 3)))
+ "Major mode for CoffeeScript code" tar
+ ((:url . "http://github.com/defunkt/coffee-mode")
+ (:keywords "coffeescript" "major" "mode")
+ (:maintainer "Chris Wanstrath" . "chris@ozmm.org")
+ (:authors
+ ("Chris Wanstrath" . "chris@ozmm.org"))
+ (:commit . "adfb7ae73d6ee2ef790c780dd3c967e62930e94a"))])
+ (color-theme-tangotango .
+ [(0 0 6)
+ ((color-theme
+ (6 6 1)))
+ "Tango Palette color theme for Emacs." tar
+ ((:url . "https://github.com/juba/color-theme-tangotango")
+ (:keywords "tango" "palette" "color" "theme" "emacs")
+ (:maintainer "Julien Barnier")
+ (:authors
+ ("Julien Barnier")))])
+ (crux .
+ [(0 4 0)
+ ((seq
+ (1 11)))
+ "A Collection of Ridiculously Useful eXtensions" tar
+ ((:url . "https://github.com/bbatsov/crux")
+ (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev")
+ (:authors
+ ("Bozhidar Batsov" . "bozhidar@batsov.dev"))
+ (:keywords "convenience"))])
+ (cyberpunk-theme .
+ [(1 22)
+ nil "Cyberpunk Color Theme" tar
+ ((:url . "https://github.com/n3mo/cyberpunk-theme.el")
+ (:keywords "color" "theme" "cyberpunk")
+ (:maintainer "Nicholas M. Van Horn" . "nvanhorn@protonmail.com")
+ (:authors
+ ("Nicholas M. Van Horn" . "nvanhorn@protonmail.com")))])
+ (d-mode .
+ [(202003130913)
+ ((emacs
+ (25 1)))
+ "D Programming Language major mode for (X)Emacs" tar
+ ((:maintainer "Russel Winder" . "russel@winder.org.uk")
+ (:authors
+ ("William Baxter"))
+ (:keywords "d" "programming" "language" "emacs" "cc-mode")
+ (:url . "https://elpa.nongnu.org/nongnu/d-mode.html"))])
+ (dart-mode .
+ [(1 0 7)
+ ((emacs
+ (24 3)))
+ "Major mode for editing Dart files" tar
+ ((:url . "https://github.com/bradyt/dart-mode")
+ (:maintainer "https://github.com/bradyt/dart-mode/issues")
+ (:authors
+ ("https://github.com/bradyt/dart-mode/issues"))
+ (:keywords "languages"))])
+ (dockerfile-mode .
+ [(1 5)
+ ((emacs
+ (24)))
+ "Major mode for editing Docker's Dockerfiles" tar
+ ((:url . "https://github.com/spotify/dockerfile-mode")
+ (:keywords "docker")
+ (:commit . "628315e2e4ab2f269548126444234caa057b2c75"))])
+ (dracula-theme .
+ [(1 7 0)
+ ((emacs
+ (24 3)))
+ "Dracula Theme" tar
+ ((:url . "https://github.com/dracula/emacs")
+ (:maintainer "Étienne Deparis" . "etienne@depar.is")
+ (:authors
+ ("film42")))])
+ (drupal-mode .
+ [(0 7 4)
+ ((php-mode
+ (1 5 0)))
+ "Advanced minor mode for Drupal development" tar
+ ((:url . "https://github.com/arnested/drupal-mode")
+ (:keywords "programming" "php" "drupal")
+ (:maintainer "Arne Jørgensen" . "arne@arnested.dk")
+ (:authors
+ ("Arne Jørgensen" . "arne@arnested.dk"))
+ (:commit . "ed90b0c4d808365e9ae9f16cc8a96eff17815621"))])
+ (editorconfig .
+ [(0 8 2)
+ ((cl-lib
+ (0 5))
+ (nadvice
+ (0 3))
+ (emacs
+ (24)))
+ "EditorConfig Emacs Plugin" tar
+ ((:url . "https://github.com/editorconfig/editorconfig-emacs#readme")
+ (:maintainer "EditorConfig Team" . "editorconfig@googlegroups.com")
+ (:authors
+ ("EditorConfig Team" . "editorconfig@googlegroups.com")))])
+ (elixir-mode .
+ [(2 4 0)
+ ((emacs
+ (25)))
+ "Major mode for editing Elixir files" tar
+ ((:url . "https://github.com/elixir-editors/emacs-elixir")
+ (:keywords "languages" "elixir")
+ (:commit . "1d94b525ddcc995b5a979de7b050c2309648ca6f"))])
+ (elpher .
+ [(3 4 1)
+ ((emacs
+ (27 1)))
+ "A friendly gopher and gemini client" tar
+ ((:url . "https://thelambdalab.xyz/elpher")
+ (:keywords "comm" "gopher")
+ (:maintainer "Tim Vaughan" . "plugd@thelambdalab.xyz")
+ (:authors
+ ("Tim Vaughan" . "plugd@thelambdalab.xyz"))
+ (:commit . "bf0dd36eb2f5b339c6b561dbe3ee9693565b484b"))])
+ (evil .
+ [(1 15 0)
+ nil "extensible vi layer" tar
+ ((:url . "https://github.com/emacs-evil/evil")
+ (:keywords "emulation" "vim")
+ (:maintainer "Tom Dalziel" . "tom.dalziel@gmail.com")
+ (:commit . "008a6cdb12f15e748979a7d1c2f26c34c84dedbf"))])
+ (evil-anzu .
+ [(0 2)
+ ((evil
+ (1 0 0))
+ (anzu
+ (0 46)))
+ "anzu for evil-mode" tar
+ ((:url . "https://github.com/syohex/emacs-evil-anzu")
+ (:maintainer "Syohei YOSHIDA" . "syohex@gmail.com")
+ (:authors
+ ("Syohei YOSHIDA" . "syohex@gmail.com")
+ ("Fredrik Bergroth" . "fbergroth@gmail.com")))])
+ (evil-args .
+ [(1 1)
+ ((evil
+ (1 0 8)))
+ "Motions and text objects for delimited arguments in Evil." tar
+ ((:url . "http://github.com/wcsmith/evil-args")
+ (:keywords "evil" "vim-emulation")
+ (:maintainer "Connor Smith" . "wconnorsmith@gmail.com")
+ (:authors
+ ("Connor Smith" . "wconnorsmith@gmail.com"))
+ (:commit . "2671071a4a57eaee7cc8c27b9e4b6fc60fd2ccd3"))])
+ (evil-exchange .
+ [(0 41)
+ ((evil
+ (1 2 8))
+ (cl-lib
+ (0 3)))
+ "Exchange text more easily within Evil" tar
+ ((:url . "http://github.com/Dewdrops/evil-exchange")
+ (:keywords "evil" "plugin")
+ (:maintainer "Dewdrops" . "v_v_4474@126.com")
+ (:authors
+ ("Dewdrops" . "v_v_4474@126.com")))])
+ (evil-goggles .
+ [(0 0 2)
+ ((emacs
+ (24 4))
+ (evil
+ (1 0 0)))
+ "Add a visual hint to evil operations" tar
+ ((:url . "http://github.com/edkolev/evil-goggles")
+ (:keywords "emulations" "evil" "vim" "visual")
+ (:maintainer "edkolev" . "evgenysw@gmail.com")
+ (:authors
+ ("edkolev" . "evgenysw@gmail.com"))
+ (:commit . "7801d9204cd57d5aec11ef43b15357a431cf025c"))])
+ (evil-indent-plus .
+ [(1 0 1)
+ ((evil
+ (0))
+ (cl-lib
+ (0 5)))
+ "Evil textobjects based on indentation" tar
+ ((:url . "http://github.com/TheBB/evil-indent-plus")
+ (:keywords "convenience" "evil")
+ (:maintainer "Eivind Fonn" . "evfonn@gmail.com")
+ (:authors
+ ("Eivind Fonn" . "evfonn@gmail.com")))])
+ (evil-lisp-state .
+ [(8 2)
+ ((evil
+ (1 0 9))
+ (bind-map
+ (0))
+ (smartparens
+ (1 6 1)))
+ "An evil state to edit Lisp code" tar
+ ((:url . "https://github.com/syl20bnr/evil-lisp-state")
+ (:keywords "convenience" "editing" "evil" "smartparens" "lisp" "mnemonic")
+ (:maintainer "Sylvain Benner" . "sylvain.benner@gmail.com")
+ (:authors
+ ("Sylvain Benner" . "sylvain.benner@gmail.com")))])
+ (evil-matchit .
+ [(2 4 4)
+ ((evil
+ (1 14 0))
+ (emacs
+ (25 1)))
+ "Vim matchit ported to Evil" tar
+ ((:url . "http://github.com/redguardtoo/evil-matchit")
+ (:keywords "matchit" "vim" "evil")
+ (:maintainer "Chen Bin" . "chenbin.sh@gmail.com")
+ (:authors
+ ("Chen Bin" . "chenbin.sh@gmail.com"))
+ (:commit . "b314e816bacfc01bb7df9b19a06b18638af5cdbe"))])
+ (evil-nerd-commenter .
+ [(3 5 7)
+ ((emacs
+ (25 1)))
+ "Comment/uncomment lines efficiently. Like Nerd Commenter in Vim" tar
+ ((:url . "http://github.com/redguardtoo/evil-nerd-commenter")
+ (:keywords "convenience" "evil")
+ (:maintainer "Chen Bin" . "chenbin.sh@gmail.com")
+ (:authors
+ ("Chen Bin" . "chenbin.sh@gmail.com"))
+ (:commit . "29ced6fda6a76771a8a054ef55c13a1330793d4d"))])
+ (evil-numbers .
+ [(0 6)
+ ((emacs
+ (24 1))
+ (evil
+ (1 2 0)))
+ "Increment/decrement numbers like in VIM" tar
+ ((:url . "http://github.com/juliapath/evil-numbers")
+ (:keywords "convenience" "tools")
+ (:maintainer "Julia Path" . "julia@jpath.de")
+ (:authors
+ ("Michael Markert" . "markert.michael@googlemail.com")))])
+ (evil-visualstar .
+ [(0 2 0)
+ ((evil
+ (0)))
+ "Starts a * or # search from the visual selection" tar
+ ((:url . "https://github.com/bling/evil-visualstar")
+ (:keywords "evil" "vim" "visualstar")
+ (:maintainer "Bailey Ling")
+ (:authors
+ ("Bailey Ling")))])
+ (flymake-kondor .
+ [(0 1 3)
+ ((emacs
+ (26 1)))
+ "Linter with clj-kondo" tar
+ ((:url . "https://github.com/turbo-cafe/flymake-kondor")
+ (:maintainer "https://turbocafe.keybase.pub")
+ (:authors
+ ("https://turbocafe.keybase.pub")))])
+ (forth-mode .
+ [(0 2)
+ nil "Programming language mode for Forth" tar
+ ((:url . "http://github.com/larsbrinkhoff/forth-mode")
+ (:keywords "languages" "forth")
+ (:maintainer "Lars Brinkhoff" . "lars@nocrew.org")
+ (:authors
+ ("Lars Brinkhoff" . "lars@nocrew.org"))
+ (:commit . "38d5152011ee67e0cff9d4a5ddfb1f908e5be013"))])
+ (free-keys .
+ [(1 0)
+ ((cl-lib
+ (0 3)))
+ "Show free keybindings for modkeys or prefixes" tar
+ ((:url . "https://github.com/Fuco1/free-keys")
+ (:keywords "convenience")
+ (:maintainer "Matus Goljer" . "matus.goljer@gmail.com")
+ (:authors
+ ("Matus Goljer" . "matus.goljer@gmail.com"))
+ (:commit . "6f9172376af4d399c7853cbdfdd7425348a878f9"))])
+ (geiser .
+ [(0 24)
+ ((emacs
+ (25 1))
+ (transient
+ (0 3))
+ (project
+ (0 8 1)))
+ "GNU Emacs and Scheme talk to each other" tar
+ ((:url . "https://gitlab.com/emacs-geiser/")
+ (:keywords "languages" "scheme" "geiser")
+ (:maintainer "Jose Antonio Ortega Ruiz" . "jao@gnu.org")
+ (:authors
+ ("Jose Antonio Ortega Ruiz" . "jao@gnu.org"))
+ (:commit . "d28d19b582347bffebbf0ca905297e744842a5f2"))])
+ (geiser-chez .
+ [(0 17)
+ ((emacs
+ (26 1))
+ (geiser
+ (0 19)))
+ "Chez Scheme's implementation of the geiser protocols" tar
+ ((:url . "https://gitlab.com/emacs-geiser/chez")
+ (:keywords "languages" "chez" "scheme" "geiser")
+ (:maintainer "Jose A Ortega Ruiz" . "jao@gnu.org")
+ (:authors
+ ("Peter" . "craven@gmx.net")))])
+ (geiser-chibi .
+ [(0 17)
+ ((emacs
+ (24 4))
+ (geiser
+ (0 18)))
+ "Chibi Scheme's implementation of the geiser protocols" tar
+ ((:url . "https://gitlab.com/emacs-geiser/chibi")
+ (:keywords "languages" "chibi" "scheme" "geiser")
+ (:maintainer "Jose A Ortega Ruiz" . "jao@gnu.org")
+ (:authors
+ ("Peter" . "craven@gmx.net")))])
+ (geiser-chicken .
+ [(0 17)
+ ((emacs
+ (24 4))
+ (geiser
+ (0 19)))
+ "Chicken's implementation of the geiser protocols" tar
+ ((:url . "https://gitlab.com/emacs-geiser/chicken")
+ (:keywords "languages" "chicken" "scheme" "geiser")
+ (:maintainer "Daniel Leslie")
+ (:authors
+ ("Daniel Leslie")))])
+ (geiser-gambit .
+ [(0 18 1)
+ ((emacs
+ (26 1))
+ (geiser
+ (0 18)))
+ "Gambit's implementation of the geiser protocols" tar
+ ((:url . "https://gitlab.com/emacs-geiser/gambit")
+ (:keywords "languages" "gambit" "scheme" "geiser")
+ (:maintainer "Jose A Ortega Ruiz" . "jao@gnu.org")
+ (:authors
+ ("Daniel Leslie"))
+ (:commit . "381d74ca5059b44fe3d8b5daf42214019c6d1a88"))])
+ (geiser-gauche .
+ [(0 0 2)
+ ((emacs
+ (26 1))
+ (geiser
+ (0 11 2)))
+ "Gauche scheme support for Geiser" tar
+ ((:url . "https://gitlab.com/emacs-geiser/gauche")
+ (:maintainer "András Simonyi" . "andras.simonyi@gmail.com")
+ (:authors
+ ("András Simonyi" . "andras.simonyi@gmail.com"))
+ (:keywords "languages" "gauche" "scheme" "geiser"))])
+ (geiser-guile .
+ [(0 23 2)
+ ((emacs
+ (25 1))
+ (geiser
+ (0 23 2)))
+ "Guile's implementation of the geiser protocols" tar
+ ((:url . "https://gitlab.com/emacs-geiser/guile")
+ (:keywords "languages" "guile" "scheme" "geiser")
+ (:maintainer "Jose Antonio Ortega Ruiz" . "jao@gnu.org")
+ (:authors
+ ("Jose Antonio Ortega Ruiz" . "jao@gnu.org"))
+ (:commit . "c641fcc50b6b86ca95743122b5206cdcd475f96e"))])
+ (geiser-kawa .
+ [(0 0 1)
+ ((emacs
+ (26 1))
+ (geiser
+ (0 16)))
+ "Kawa scheme support for Geiser" tar
+ ((:url . "https://gitlab.com/emacs-geiser/kawa")
+ (:maintainer "spellcard199" . "spellcard199@protonmail.com")
+ (:authors
+ ("spellcard199" . "spellcard199@protonmail.com"))
+ (:keywords "languages" "kawa" "scheme" "geiser"))])
+ (geiser-mit .
+ [(0 15)
+ ((emacs
+ (24 4))
+ (geiser
+ (0 18)))
+ "MIT/GNU Scheme's implementation of the geiser protocols" tar
+ ((:url . "https://gitlab.com/emacs-geiser/mit")
+ (:keywords "languages" "mit" "scheme" "geiser")
+ (:maintainer "Jose A Ortega Ruiz" . "jao@gnu.org")
+ (:authors
+ ("Peter" . "craven@gmx.net")))])
+ (geiser-racket .
+ [(0 16)
+ ((emacs
+ (26 1))
+ (geiser
+ (0 16)))
+ "Support for Racket in Geiser" tar
+ ((:url . "https://gitlab.com/emacs-geiser/racket")
+ (:maintainer "Jose Antonio Ortega Ruiz" . "jao@gnu.org")
+ (:authors
+ ("Jose Antonio Ortega Ruiz" . "jao@gnu.org"))
+ (:keywords "languages" "racket" "scheme" "geiser"))])
+ (geiser-stklos .
+ [(1 4)
+ ((emacs
+ (24 4))
+ (geiser
+ (0 16)))
+ "STklos Scheme implementation of the geiser protocols" tar
+ ((:url . "https://gitlab.com/emacs-geiser/stklos")
+ (:keywords "languages" "stklos" "scheme" "geiser")
+ (:maintainer "Jeronimo Pellegrini" . "j_p@aleph0.info")
+ (:authors
+ ("Jeronimo Pellegrini" . "j_p@aleph0.info")))])
+ (git-commit .
+ [(3 3 0)
+ ((emacs
+ (25 1))
+ (dash
+ (2 19 1))
+ (transient
+ (0 3 6))
+ (with-editor
+ (3 0 5)))
+ "Edit Git commit messages" tar
+ ((:url . "https://github.com/magit/magit")
+ (:keywords "git" "tools" "vc")
+ (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li")
+ (:authors
+ ("Jonas Bernoulli" . "jonas@bernoul.li")
+ ("Sebastian Wiesner" . "lunaryorn@gmail.com")
+ ("Florian Ragwitz" . "rafl@debian.org")
+ ("Marius Vollmer" . "marius.vollmer@gmail.com")))])
+ (git-modes .
+ [(1 4 0)
+ ((emacs
+ (24 3)))
+ "Major modes for editing Git configuration files" tar
+ ((:url . "https://github.com/magit/git-modes")
+ (:keywords "convenience" "vc" "git")
+ (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li")
+ (:authors
+ ("Sebastian Wiesner" . "lunaryorn@gmail.com")
+ ("Rüdiger Sonderfeld" . "ruediger@c-plusplus.net")
+ ("Jonas Bernoulli" . "jonas@bernoul.li")))])
+ (gnu-apl-mode .
+ [(1 5 1)
+ nil "Emacs mode for GNU APL" tar
+ ((:url . "http://www.gnu.org/software/apl/")
+ (:keywords "languages")
+ (:maintainer "Elias Mårtenson" . "lokedhs@gmail.com")
+ (:authors
+ ("Elias Mårtenson" . "lokedhs@gmail.com"))
+ (:commit . "deabf59d2375d4662221f8222e28caeb1be96428"))])
+ (gnuplot .
+ [(0 8 0)
+ ((emacs
+ (24 3)))
+ "Major-mode and interactive frontend for gnuplot" tar
+ ((:url . "https://github.com/emacsorphanage/gnuplot")
+ (:maintainer "Bruce Ravel" . "bruceravel1@gmail.com")
+ (:authors
+ ("Jon Oddie")
+ ("Bruce Ravel")
+ ("Phil Type"))
+ (:keywords "data" "gnuplot" "plotting"))])
+ (go-mode .
+ [(1 6 0)
+ ((emacs
+ (26 1)))
+ "Major mode for the Go programming language" tar
+ ((:url . "https://github.com/dominikh/go-mode.el")
+ (:keywords "languages" "go")
+ (:maintainer "The go-mode Authors")
+ (:authors
+ ("The go-mode Authors"))
+ (:commit . "3273fcece5d9ab7edd4f15b2d6bce61f4e5a0666"))])
+ (gotham-theme .
+ [(1 1 9)
+ ((emacs
+ (24 1)))
+ "A very dark Emacs color theme" tar
+ ((:url . "https://depp.brause.cc/gotham-theme")
+ (:maintainer "Vasilij Schneidermann" . "mail@vasilij.de")
+ (:authors
+ ("Vasilij Schneidermann" . "mail@vasilij.de")))])
+ (goto-chg .
+ [(1 7 5)
+ ((emacs
+ (24 1)))
+ "Go to last change" tar
+ ((:url . "https://github.com/emacs-evil/goto-chg")
+ (:keywords "convenience" "matching")
+ (:maintainer "Vasilij Schneidermann" . "mail@vasilij.de")
+ (:authors
+ ("David Andersson <l.david.andersson(at)sverige.nu>")))])
+ (graphql-mode .
+ [(1 0 0)
+ ((emacs
+ (24 3)))
+ "Major mode for editing GraphQL schemas" tar
+ ((:url . "https://github.com/davazp/graphql-mode")
+ (:keywords "languages")
+ (:maintainer "David Vazquez Pua" . "davazp@gmail.com")
+ (:authors
+ ("David Vazquez Pua" . "davazp@gmail.com"))
+ (:commit . "fe8d7e2db5581cd0cb7a69563bc44f0669f76322"))])
+ (gruvbox-theme .
+ [(1 26 0)
+ ((autothemer
+ (0 2)))
+ "A retro-groove colour theme for Emacs" tar
+ ((:url . "http://github.com/greduan/emacs-theme-gruvbox")
+ (:maintainer "Jason Milkins" . "jasonm23@gmail.com")
+ (:authors
+ ("Jason Milkins" . "jasonm23@gmail.com")))])
+ (guru-mode .
+ [(1 0)
+ nil "Become an Emacs guru" tar
+ ((:url . "https://github.com/bbatsov/guru-mode")
+ (:maintainer "Bozhidar Batsov")
+ (:authors
+ ("Bozhidar Batsov"))
+ (:keywords "convenience"))])
+ (haml-mode .
+ [(3 1 10)
+ ((emacs
+ (24))
+ (cl-lib
+ (0 5)))
+ "Major mode for editing Haml files" tar
+ ((:url . "https://github.com/nex3/haml-mode")
+ (:keywords "markup" "languages" "html")
+ (:maintainer "Natalie Weizenbaum")
+ (:authors
+ ("Natalie Weizenbaum")))])
+ (haskell-mode .
+ [(4 7 1)
+ nil "A Haskell editing mode" tar
+ ((:url . "https://github.com/haskell/haskell-mode")
+ (:maintainer "1992 Simon Marlow")
+ (:authors
+ ("1992 Simon Marlow")
+ ("1997-1998 Graeme E Moss" . "gem@cs.york.ac.uk")
+ ("Tommy Thorn" . "thorn@irisa.fr")
+ ("2001-2002 Reuben Thomas (>=v1.4)")
+ ("2003 Dave Love" . "fx@gnu.org")
+ ("2016 Arthur Fayzrakhmanov"))
+ (:keywords "faces" "files" "haskell"))])
+ (haskell-tng-mode .
+ [(0 0 1)
+ ((emacs
+ (27 1))
+ (popup
+ (0 5 3)))
+ "Major mode for editing Haskell" tar
+ ((:url . "https://gitlab.com/tseenshe/haskell-tng-mode")
+ (:keywords "languages"))])
+ (helm .
+ [(3 8 5)
+ ((helm-core
+ (3 8 4))
+ (popup
+ (0 5 3)))
+ "Helm is an Emacs incremental and narrowing framework" tar
+ ((:url . "https://emacs-helm.github.io/helm/")
+ (:maintainer "Thierry Volpiatto" . "thierry.volpiatto@gmail.com")
+ (:authors
+ ("Thierry Volpiatto" . "thierry.volpiatto@gmail.com"))
+ (:commit . "5e035c9193bf1e1d4bb709794a154957544dcfc7"))])
+ (helm-core .
+ [(3 8 5)
+ ((emacs
+ (25 1))
+ (async
+ (1 9 4)))
+ "Development files for Helm" tar
+ ((:url . "https://emacs-helm.github.io/helm/")
+ (:maintainer "Thierry Volpiatto" . "thierry.volpiatto@gmail.com")
+ (:authors
+ ("Thierry Volpiatto" . "thierry.volpiatto@gmail.com"))
+ (:commit . "5e035c9193bf1e1d4bb709794a154957544dcfc7"))])
+ (highlight-parentheses .
+ [(2 1 1)
+ ((emacs
+ (24 3)))
+ "Highlight surrounding parentheses" tar
+ ((:url . "https://sr.ht/~tsdh/highlight-parentheses.el/")
+ (:keywords "faces" "matching")
+ (:maintainer "Tassilo Horn" . "tsdh@gnu.org")
+ (:authors
+ ("Nikolaj Schumacher <bugs * nschum de>"))
+ (:commit . "438a1cb2563e2a2496be4678cc0df8d5b22caf5d"))])
+ (htmlize .
+ [(1 57)
+ nil "Convert buffer text and decorations to HTML." tar
+ ((:url . "https://github.com/hniksic/emacs-htmlize")
+ (:maintainer "Hrvoje Niksic" . "hniksic@gmail.com")
+ (:authors
+ ("Hrvoje Niksic" . "hniksic@gmail.com"))
+ (:keywords "hypermedia" "extensions"))])
+ (idris-mode .
+ [(1 1 0)
+ ((emacs
+ (24))
+ (prop-menu
+ (0 1))
+ (cl-lib
+ (0 5)))
+ "Major mode for editing Idris code" tar
+ ((:url . "https://github.com/idris-hackers/idris-mode")
+ (:keywords "languages"))])
+ (iedit .
+ [(0 9 9 9 9)
+ nil "Edit multiple regions in the same way simultaneously." tar
+ ((:url . "https://github.com/victorhge/iedit")
+ (:keywords "occurrence" "region" "simultaneous" "refactoring")
+ (:maintainer "Victor Ren" . "victorhge@gmail.com")
+ (:authors
+ ("Victor Ren" . "victorhge@gmail.com"))
+ (:commit . "699e179dac18c78698cba1a2052bee6f0bbc6bf7"))])
+ (inf-clojure .
+ [(3 1 0)
+ ((emacs
+ (25 1))
+ (clojure-mode
+ (5 11)))
+ "Run an external Clojure process in an Emacs buffer" tar
+ ((:url . "http://github.com/clojure-emacs/inf-clojure")
+ (:keywords "processes" "clojure"))])
+ (j-mode .
+ [(1 1 1)
+ nil "Major mode for editing J programs" tar
+ ((:url . "http://github.com/zellio/j-mode")
+ (:keywords "j" "languages"))])
+ (jade-mode .
+ [(1 0 1)
+ nil "Major mode for editing .jade files" tar
+ ((:url . "https://github.com/brianc/jade-mode")
+ (:keywords "languages")
+ (:maintainer "Brian M. Carlson and other contributors")
+ (:authors
+ ("Brian M. Carlson and other contributors"))
+ (:commit . "dad17dc86c93401646802a639a98dd2ec875db6f"))])
+ (jinja2-mode .
+ [(0 3)
+ nil "A major mode for jinja2" tar
+ ((:maintainer "Florian Mounier aka paradoxxxzero")
+ (:authors
+ ("Florian Mounier aka paradoxxxzero"))
+ (:url . "https://elpa.nongnu.org/nongnu/jinja2-mode.html")
+ (:commit . "a598357069a68b0ac2bf128c19edd8e899084cdc"))])
+ (julia-mode .
+ [(0 4)
+ ((emacs
+ (24 3)))
+ "Major mode for editing Julia source code" tar
+ ((:url . "https://github.com/JuliaEditorSupport/julia-emacs")
+ (:keywords "languages"))])
+ (keycast .
+ [(1 2 0)
+ ((emacs
+ (25 3)))
+ "Show current command and its key in the mode line" tar
+ ((:url . "https://github.com/tarsius/keycast")
+ (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li")
+ (:authors
+ ("Jonas Bernoulli" . "jonas@bernoul.li"))
+ (:commit . "98c2dda1a2ca0fc95f7425847a36abad5b31a4c7"))])
+ (kotlin-mode .
+ [(1 0 0)
+ ((emacs
+ (24 3)))
+ "Major mode for kotlin" tar
+ ((:keywords "languages")
+ (:maintainer "Shodai Yokoyama" . "quantumcars@gmail.com")
+ (:authors
+ ("Shodai Yokoyama" . "quantumcars@gmail.com"))
+ (:url . "https://elpa.nongnu.org/nongnu/kotlin-mode.html")
+ (:commit . "b9d03a769b91c6b15e99a9cadb8b1618e5205595"))])
+ (lua-mode .
+ [(20210802)
+ ((emacs
+ (24 3)))
+ "a major-mode for editing Lua scripts" tar
+ ((:url . "http://immerrr.github.com/lua-mode")
+ (:maintainer "2011-2013 immerrr" . "immerrr+lua@gmail.com")
+ (:authors
+ ("2011-2013 immerrr" . "immerrr+lua@gmail.com")
+ ("2010-2011 Reuben Thomas" . "rrt@sc3d.org")
+ ("2006 Juergen Hoetzel" . "juergen@hoetzel.info")
+ ("2004 various (support for Lua 5 and byte compilation)")
+ ("2001 Christian Vogler" . "cvogler@gradient.cis.upenn.edu")
+ ("1997 Bret Mogilefsky" . "mogul-lua@gelatinous.com")
+ ("tcl-mode by Gregor Schmid" . "schmid@fb3-s7.math.tu-berlin.de")
+ ("with tons of assistance from")
+ ("Paul Du Bois" . "pld-lua@gelatinous.com")
+ ("Aaron Smith" . "aaron-lua@gelatinous.com"))
+ (:keywords "languages" "processes" "tools"))])
+ (macrostep .
+ [(0 9)
+ ((cl-lib
+ (0 5)))
+ "interactive macro expander" tar
+ ((:url . "https://github.com/joddie/macrostep")
+ (:maintainer "joddie" . "j.j.oddie@gmail.com")
+ (:authors
+ ("joddie" . "j.j.oddie@gmail.com"))
+ (:keywords "lisp" "languages" "macro" "debugging"))])
+ (magit .
+ [(3 3 0)
+ ((emacs
+ (25 1))
+ (dash
+ (2 19 1))
+ (git-commit
+ (3 3 0))
+ (magit-section
+ (3 3 0))
+ (transient
+ (0 3 6))
+ (with-editor
+ (3 0 5)))
+ "A Git porcelain inside Emacs" tar
+ ((:url . "https://github.com/magit/magit")
+ (:keywords "git" "tools" "vc")
+ (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li")
+ (:authors
+ ("Marius Vollmer" . "marius.vollmer@gmail.com")
+ ("Jonas Bernoulli" . "jonas@bernoul.li")))])
+ (magit-section .
+ [(3 3 0)
+ ((emacs
+ (25 1))
+ (dash
+ (2 19 1)))
+ "Sections for read-only buffers" tar
+ ((:url . "https://github.com/magit/magit")
+ (:keywords "tools")
+ (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li")
+ (:authors
+ ("Jonas Bernoulli" . "jonas@bernoul.li")))])
+ (markdown-mode .
+ [(2 5)
+ ((emacs
+ (25 1)))
+ "Major mode for Markdown-formatted text" tar
+ ((:url . "https://jblevins.org/projects/markdown-mode/")
+ (:keywords "markdown" "github flavored markdown" "itex")
+ (:maintainer "Jason R. Blevins" . "jblevins@xbeta.org")
+ (:authors
+ ("Jason R. Blevins" . "jblevins@xbeta.org"))
+ (:commit . "eecf2f20b097f9e6a0eaf938af967122fbec35dd"))])
+ (material-theme .
+ [(2015)
+ ((emacs
+ (24 1)))
+ "A Theme based on the colors of the Google Material Design" tar
+ ((:url . "http://github.com/cpaulik/emacs-material-theme")
+ (:keywords "themes")
+ (:maintainer "Christoph Paulik" . "cpaulik@gmail.com")
+ (:authors
+ ("Christoph Paulik" . "cpaulik@gmail.com")))])
+ (mentor .
+ [(0 3 5)
+ ((emacs
+ (25 1))
+ (xml-rpc
+ (1 6 15))
+ (seq
+ (1 11))
+ (cl-lib
+ (0 5))
+ (async
+ (1 9 3)))
+ "Frontend for the rTorrent bittorrent client" tar
+ ((:keywords "comm" "processes" "bittorrent")
+ (:maintainer "Stefan Kangas" . "stefankangas@gmail.com")
+ (:authors
+ ("Stefan Kangas" . "stefankangas@gmail.com"))
+ (:url . "https://elpa.nongnu.org/nongnu/mentor.html"))])
+ (moe-theme .
+ [(1 0 2)
+ nil "A colorful eye-candy theme. Moe, moe, kyun!" tar
+ ((:url . "https://github.com/kuanyui/moe-theme.el")
+ (:keywords "themes")
+ (:maintainer "kuanyui" . "azazabc123@gmail.com")
+ (:authors
+ ("kuanyui" . "azazabc123@gmail.com")))])
+ (monokai-theme .
+ [(3 5 3)
+ nil "A fruity color theme for Emacs." tar
+ ((:url . "http://github.com/oneKelvinSmith/monokai-emacs")
+ (:maintainer "Kelvin Smith" . "oneKelvinSmith@gmail.com")
+ (:authors
+ ("Kelvin Smith" . "oneKelvinSmith@gmail.com")))])
+ (mpv .
+ [(0 2 0)
+ ((cl-lib
+ (0 5))
+ (emacs
+ (25 1))
+ (json
+ (1 3))
+ (org
+ (8 0)))
+ "control mpv for easy note-taking" tar
+ ((:url . "https://github.com/kljohann/mpv.el")
+ (:keywords "tools" "multimedia")
+ (:maintainer "Johann Klähn" . "johann@jklaehn.de")
+ (:authors
+ ("Johann Klähn" . "johann@jklaehn.de")))])
+ (multiple-cursors .
+ [(1 4 0)
+ nil "Multiple cursors for emacs." tar
+ ((:url . "https://github.com/magnars/multiple-cursors.el")
+ (:maintainer "Magnar Sveen" . "magnars@gmail.com")
+ (:authors
+ ("Magnar Sveen" . "magnars@gmail.com"))
+ (:keywords "editing" "cursors"))])
+ (nasm-mode .
+ [(1 1 1)
+ ((emacs
+ (24 3)))
+ "NASM x86 assembly major mode" tar
+ ((:url . "https://github.com/skeeto/nasm-mode")
+ (:maintainer "Christopher Wellons" . "wellons@nullprogram.com")
+ (:authors
+ ("Christopher Wellons" . "wellons@nullprogram.com")))])
+ (nginx-mode .
+ [(1 1 9)
+ nil "major mode for editing nginx config files" tar
+ ((:maintainer "Andrew J Cosgriff" . "andrew@cosgriff.name")
+ (:authors
+ ("Andrew J Cosgriff" . "andrew@cosgriff.name"))
+ (:keywords "languages" "nginx")
+ (:url . "https://elpa.nongnu.org/nongnu/nginx-mode.html"))])
+ (nix-mode .
+ [(1 4 4)
+ ((emacs
+ (25 1))
+ (magit-section
+ (0))
+ (transient
+ (0 3)))
+ "Major mode for editing .nix files" tar
+ ((:url . "https://github.com/NixOS/nix-mode")
+ (:keywords "nix" "languages" "tools" "unix")
+ (:maintainer "Matthew Bauer" . "mjbauer95@gmail.com")
+ (:commit . "e4e604ae3ac91748c4e7d51a591cb9ee60961b7c"))])
+ (org-contrib .
+ [(0 3)
+ ((emacs
+ (25 1))
+ (org
+ (9 4 6)))
+ "Unmaintained add-ons for Org-mode" tar
+ ((:url . "https://git.sr.ht/~bzg/org-contrib")
+ (:keywords "org")
+ (:maintainer "Bastien Guerry" . "bzg@gnu.org")
+ (:authors
+ ("Bastien Guerry" . "bzg@gnu.org")))])
+ (org-drill .
+ [(2 7 0)
+ ((emacs
+ (25 3))
+ (seq
+ (2 14))
+ (org
+ (9 3))
+ (persist
+ (0 3)))
+ "Self-testing using spaced repetition" tar
+ ((:url . "https://gitlab.com/phillord/org-drill/issues")
+ (:keywords "games" "outlines" "multimedia")
+ (:maintainer "Phillip Lord" . "phillip.lord@russet.org.uk")
+ (:authors
+ ("Paul Sexton" . "eeeickythump@gmail.com"))
+ (:commit . "4c114489e682e514e79701045d541ab6f3dc3fb4"))])
+ (org-journal .
+ [(2 1 2)
+ ((emacs
+ (25 1))
+ (org
+ (9 1)))
+ "a simple org-mode based journaling mode" tar
+ ((:url . "http://github.com/bastibe/org-journal")
+ (:maintainer "Bastian Bechtold")
+ (:authors
+ ("Bastian Bechtold")
+ ("Christian Schwarzgruber")))])
+ (org-mime .
+ [(0 2 6)
+ ((emacs
+ (25 1)))
+ "org html export for text/html MIME emails" tar
+ ((:url . "http://github.com/org-mime/org-mime")
+ (:keywords "mime" "mail" "email" "html")
+ (:maintainer "Chen Bin (redguardtoo)")
+ (:authors
+ ("Eric Schulte"))
+ (:commit . "3f1f3a38429da17811f61a7a5685224d79de9594"))])
+ (org-present .
+ [(0 1)
+ ((org
+ (7)))
+ "Minimalist presentation minor-mode for Emacs org-mode." tar
+ ((:url . "https://github.com/rlister/org-present")
+ (:maintainer "Ric Lister")
+ (:authors
+ ("Ric Lister")))])
+ (org-superstar .
+ [(1 5 1)
+ ((org
+ (9 1 9))
+ (emacs
+ (26 1)))
+ "Prettify headings and plain lists in Org mode" tar
+ ((:url . "https://github.com/integral-dw/org-superstar-mode")
+ (:keywords "faces" "outlines")
+ (:maintainer "D. Williams" . "d.williams@posteo.net")
+ (:authors
+ ("D. Williams" . "d.williams@posteo.net")))])
+ (org-tree-slide .
+ [(2 8 18)
+ ((emacs
+ (24 4)))
+ "A presentation tool for org-mode" tar
+ ((:url . "https://github.com/takaxp/org-tree-slide")
+ (:keywords "convenience" "org-mode" "presentation" "narrowing")
+ (:maintainer "Takaaki ISHIKAWA <takaxp at ieee dot org>")
+ (:authors
+ ("Takaaki ISHIKAWA <takaxp at ieee dot org>"))
+ (:commit . "1fb3ecb637d0baff40dff7965dcac63b9674377b"))])
+ (orgit .
+ [(1 8 0)
+ ((emacs
+ (25 1))
+ (magit
+ (3 0))
+ (org
+ (9 4)))
+ "support for Org links to Magit buffers" tar
+ ((:url . "https://github.com/magit/orgit")
+ (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li")
+ (:authors
+ ("Jonas Bernoulli" . "jonas@bernoul.li"))
+ (:commit . "0b49d7a869b8fef3537a75df4db693ca3e3935a3"))])
+ (pacmacs .
+ [(0 1 1)
+ ((emacs
+ (24 4))
+ (dash
+ (2 18 0)))
+ "Pacman for Emacs" tar
+ ((:url . "http://github.com/codingteam/pacmacs.el")
+ (:maintainer "Alexey Kutepov" . "reximkut@gmail.com")
+ (:authors
+ ("Codingteam" . "codingteam@conference.jabber.ru"))
+ (:commit . "071d008ebd734f469b87597cbdd34139a92e5308"))])
+ (parseclj .
+ [(1 1 0)
+ ((emacs
+ (25)))
+ "Clojure/EDN parser" tar
+ ((:keywords "lisp" "clojure" "edn" "parser")
+ (:maintainer "Arne Brasseur" . "arne@arnebrasseur.net")
+ (:authors
+ ("Arne Brasseur" . "arne@arnebrasseur.net"))
+ (:url . "https://elpa.nongnu.org/nongnu/parseclj.html")
+ (:commit . "90595049634549e6d8872f719b13e9555897d17b"))])
+ (parseedn .
+ [(1 1 0)
+ ((emacs
+ (26))
+ (parseclj
+ (1 1 0))
+ (map
+ (2)))
+ "Clojure/EDN parser" tar
+ ((:keywords "lisp" "clojure" "edn" "parser")
+ (:maintainer "Arne Brasseur" . "arne@arnebrasseur.net")
+ (:authors
+ ("Arne Brasseur" . "arne@arnebrasseur.net"))
+ (:url . "https://elpa.nongnu.org/nongnu/parseedn.html")
+ (:commit . "ea7b5281ec80aca0bd1cc93a348aebb302497339"))])
+ (pcmpl-args .
+ [(0 1 3)
+ ((emacs
+ (25 1)))
+ "Enhanced shell command completion" tar
+ ((:url . "https://github.com/JonWaltman/pcmpl-args.el")
+ (:keywords "abbrev" "completion" "convenience" "processes" "terminals" "unix")
+ (:maintainer "Jonathan Waltman" . "jonathan.waltman@gmail.com")
+ (:authors
+ ("Jonathan Waltman" . "jonathan.waltman@gmail.com"))
+ (:commit . "5f2943fd70d94065496c52d21f05eb89028637cc"))])
+ (pdf-tools .
+ [(1 0)
+ ((emacs
+ (24 3))
+ (tablist
+ (1 0))
+ (let-alist
+ (1 0 4)))
+ "Support library for PDF documents" tar
+ ((:url . "http://github.com/vedang/pdf-tools/")
+ (:keywords "files" "multimedia")
+ (:maintainer "Andreas Politz" . "politza@fh-trier.de")
+ (:authors
+ ("Andreas Politz" . "politza@fh-trier.de")))])
+ (php-mode .
+ [(1 24 0)
+ ((emacs
+ (25 2)))
+ "Major mode for editing PHP code" tar
+ ((:url . "https://github.com/emacs-php/php-mode")
+ (:maintainer "USAMI Kenta" . "tadsan@zonu.me")
+ (:authors
+ ("Eric James Michael Ritz"))
+ (:keywords "languages" "php"))])
+ (popup .
+ [(0 5 9)
+ ((emacs
+ (24 3)))
+ "Visual Popup User Interface" tar
+ ((:url . "https://github.com/auto-complete/popup-el")
+ (:keywords "lisp")
+ (:maintainer "Shen, Jen-Chieh" . "jcs090218@gmail.com")
+ (:authors
+ ("Tomohiro Matsuyama" . "m2ym.pub@gmail.com")))])
+ (projectile .
+ [(2 5 0)
+ ((emacs
+ (25 1)))
+ "Manage and navigate projects in Emacs easily" tar
+ ((:url . "https://github.com/bbatsov/projectile")
+ (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev")
+ (:authors
+ ("Bozhidar Batsov" . "bozhidar@batsov.dev"))
+ (:keywords "project" "convenience"))])
+ (prop-menu .
+ [(0 1 2)
+ ((emacs
+ (24 3))
+ (cl-lib
+ (0 5)))
+ "Create and display a context menu based on text and overlay properties" tar
+ ((:url . "https://github.com/david-christiansen/prop-menu-el")
+ (:maintainer "David Christiansen" . "david@davidchristiansen.dk")
+ (:authors
+ ("David Christiansen" . "david@davidchristiansen.dk"))
+ (:keywords "convenience"))])
+ (rainbow-delimiters .
+ [(2 1 5)
+ nil "Highlight brackets according to their depth" tar
+ ((:url . "https://github.com/Fanael/rainbow-delimiters")
+ (:keywords "faces" "convenience" "lisp" "tools")
+ (:maintainer "Fanael Linithien" . "fanael4@gmail.com")
+ (:authors
+ ("Jeremy Rayman" . "opensource@jeremyrayman.com")
+ ("Fanael Linithien" . "fanael4@gmail.com")))])
+ (raku-mode .
+ [(0 2 1)
+ ((emacs
+ (24 4)))
+ "Major mode for editing Raku code" tar
+ ((:url . "https://github.com/hinrik/perl6-mode")
+ (:keywords "languages")
+ (:maintainer "Hinrik Örn Sigurðsson" . "hinrik.sig@gmail.com")
+ (:authors
+ ("Hinrik Örn Sigurðsson" . "hinrik.sig@gmail.com"))
+ (:commit . "4ee9045eeb90f7831d7c0ee2e4adfcd957f712be"))])
+ (request .
+ [(0 3 3)
+ ((emacs
+ (24 4)))
+ "Compatible layer for URL request in Emacs" tar
+ ((:url . "https://github.com/tkf/emacs-request")
+ (:maintainer "Takafumi Arakaki <aka.tkf at gmail.com>")
+ (:authors
+ ("Takafumi Arakaki <aka.tkf at gmail.com>")))])
+ (rubocop .
+ [(0 6 0)
+ ((emacs
+ (24)))
+ "An Emacs interface for RuboCop" tar
+ ((:url . "https://github.com/rubocop/rubocop-emacs")
+ (:maintainer "Bozhidar Batsov")
+ (:authors
+ ("Bozhidar Batsov"))
+ (:keywords "project" "convenience"))])
+ (rust-mode .
+ [(1 0 4)
+ ((emacs
+ (25 1)))
+ "A major-mode for editing Rust source code" tar
+ ((:url . "https://github.com/rust-lang/rust-mode")
+ (:keywords "languages")
+ (:maintainer "Mozilla")
+ (:authors
+ ("Mozilla"))
+ (:commit . "e35a1800fc0f9ed178539d6fb82ed885c1014fb5"))])
+ (sass-mode .
+ [(3 0 16)
+ ((haml-mode
+ (3 0 15))
+ (cl-lib
+ (0 5)))
+ "Major mode for editing Sass files" tar
+ ((:url . "http://github.com/nex3/haml/tree/master")
+ (:maintainer "Natalie Weizenbaum")
+ (:authors
+ ("Natalie Weizenbaum"))
+ (:keywords "markup" "language" "css"))])
+ (scala-mode .
+ [(0 23)
+ nil "Major mode for editing Scala" tar
+ ((:url . "https://github.com/hvesalai/emacs-scala-mode")
+ (:keywords "languages"))])
+ (sesman .
+ [(0 3 2)
+ ((emacs
+ (25)))
+ "Generic Session Manager" tar
+ ((:url . "https://github.com/vspinu/sesman")
+ (:keywords "process")
+ (:maintainer "Vitalie Spinu")
+ (:authors
+ ("Vitalie Spinu")))])
+ (shellcop .
+ [(0 0 9)
+ ((emacs
+ (25 1)))
+ "Analyze info&error in shell-mode" tar
+ ((:url . "https://github.com/redguardtoo/shellcop")
+ (:keywords "unix" "tools")
+ (:maintainer "Chen Bin" . "chenbin.sh@gmail.com")
+ (:authors
+ ("Chen Bin" . "chenbin.sh@gmail.com"))
+ (:commit . "327f5ac43e5d543149a772aef06cdb616477eb43"))])
+ (slime .
+ [(2 26 1)
+ ((cl-lib
+ (0 5))
+ (macrostep
+ (0 9)))
+ "Superior Lisp Interaction Mode for Emacs" tar
+ ((:url . "https://github.com/slime/slime")
+ (:keywords "languages" "lisp" "slime"))])
+ (sly .
+ [(1 0 43)
+ ((emacs
+ (24 3)))
+ "Sylvester the Cat's Common Lisp IDE" tar
+ ((:url . "https://github.com/joaotavora/sly")
+ (:keywords "languages" "lisp" "sly"))])
+ (smartparens .
+ [(4 7 1)
+ nil "Automatic insertion, wrapping and paredit-like navigation with user defined pairs." tar
+ ((:url . "https://github.com/Fuco1/smartparens")
+ (:maintainer "Matus Goljer" . "matus.goljer@gmail.com")
+ (:authors
+ ("Matus Goljer" . "matus.goljer@gmail.com"))
+ (:keywords "abbrev" "convenience" "editing"))])
+ (solarized-theme .
+ [(1 3 0)
+ ((emacs
+ (24 1)))
+ "The Solarized color theme" tar
+ ((:url . "http://github.com/bbatsov/solarized-emacs")
+ (:keywords "convenience" "themes" "solarized")
+ (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev")
+ (:authors
+ ("Bozhidar Batsov" . "bozhidar@batsov.dev")))])
+ (spacemacs-theme .
+ [(0 2)
+ ((emacs
+ (24)))
+ "Color theme with a dark and light versions." tar
+ ((:url . "https://github.com/nashamri/spacemacs-theme")
+ (:keywords "color" "theme")
+ (:maintainer "Nasser Alshammari")
+ (:authors
+ ("Nasser Alshammari"))
+ (:commit . "4857e6eb7ea20be3a2631beee42d0644dff7eb1b"))])
+ (stylus-mode .
+ [(1 0 1)
+ nil "Major mode for editing .styl files" tar
+ ((:url . "https://github.com/brianc/jade-mode")
+ (:keywords "languages")
+ (:maintainer "Brian M. Carlson and other contributors")
+ (:authors
+ ("Brian M. Carlson and other contributors"))
+ (:commit . "dad17dc86c93401646802a639a98dd2ec875db6f"))])
+ (subatomic-theme .
+ [(1 8 2)
+ nil "Low contrast bluish color theme" tar
+ ((:url . "https://github.com/cryon/subatomic")
+ (:keywords "color-theme" "blue" "low contrast")
+ (:maintainer "John Olsson" . "john@cryon.se")
+ (:authors
+ ("John Olsson" . "john@cryon.se"))
+ (:commit . "2d5acd143a153e16372d59000e57d76291ab81dd"))])
+ (subed .
+ [(1 0 5)
+ ((emacs
+ (25 1)))
+ "A major mode for editing subtitles" tar
+ ((:url . "https://github.com/sachac/subed")
+ (:keywords "convenience" "files" "hypermedia" "multimedia")
+ (:maintainer "Sacha Chua" . "sacha@sachachua.com")
+ (:authors
+ ("Random User"))
+ (:commit . "7a0c36c808e107b5851ba48ec3825dfa3c1a902e"))])
+ (swift-mode .
+ [(8 4 2)
+ ((emacs
+ (24 4))
+ (seq
+ (2 3)))
+ "Major-mode for Apple's Swift programming language" tar
+ ((:url . "https://github.com/swift-emacs/swift-mode")
+ (:keywords "languages" "swift")
+ (:maintainer "taku0 (http://github.com/taku0)")
+ (:authors
+ ("taku0 (http://github.com/taku0)")
+ ("Chris Barrett" . "chris.d.barrett@me.com")
+ ("Bozhidar Batsov" . "bozhidar@batsov.com")
+ ("Arthur Evstifeev" . "lod@pisem.net")))])
+ (systemd .
+ [(1 6)
+ ((emacs
+ (24 4)))
+ "Major mode for editing systemd units" tar
+ ((:maintainer "Mark Oteiza" . "mvoteiza@udel.edu")
+ (:authors
+ ("Mark Oteiza" . "mvoteiza@udel.edu"))
+ (:keywords "tools" "unix")
+ (:url . "https://elpa.nongnu.org/nongnu/systemd.html"))])
+ (tablist .
+ [(1 0)
+ ((emacs
+ (24 3)))
+ "Extended tabulated-list-mode" tar
+ ((:keywords "extensions" "lisp")
+ (:maintainer "Andreas Politz" . "politza@fh-trier.de")
+ (:authors
+ ("Andreas Politz" . "politza@fh-trier.de"))
+ (:url . "https://elpa.nongnu.org/nongnu/tablist.html"))])
+ (tangotango-theme .
+ [(0 0 7)
+ nil "Tango Palette color theme for Emacs 24." tar
+ ((:url . "https://github.com/juba/color-theme-tangotango")
+ (:keywords "tango" "palette" "color" "theme" "emacs")
+ (:maintainer "Julien Barnier")
+ (:authors
+ ("Julien Barnier")))])
+ (telephone-line .
+ [(0 5)
+ ((emacs
+ (24 4))
+ (cl-lib
+ (0 5))
+ (cl-generic
+ (0 2))
+ (seq
+ (1 8)))
+ "Rewrite of Powerline" tar
+ ((:url . "https://github.com/dbordak/telephone-line")
+ (:keywords "mode-line")
+ (:maintainer "Daniel Bordak" . "dbordak@fastmail.fm")
+ (:authors
+ ("Daniel Bordak" . "dbordak@fastmail.fm")))])
+ (textile-mode .
+ [(1 0 0)
+ nil "Textile markup editing major mode" tar
+ ((:url . "https://github.com/juba/textile-mode")
+ (:keywords "wp" "languages")
+ (:maintainer "Julien Barnier" . "julien@nozav.org")
+ (:authors
+ ("Julien Barnier" . "julien@nozav.org"))
+ (:commit . "16ac26b5b4c9bb5c7a3c7aed6c6b3a6c5fb8c62c"))])
+ (toc-org .
+ [(1 1)
+ nil "add table of contents to org-mode files (formerly, org-toc)" tar
+ ((:url . "https://github.com/snosov1/toc-org")
+ (:keywords "org-mode" "org-toc" "toc-org" "org" "toc" "table" "of" "contents")
+ (:maintainer "Sergei Nosov <sergei.nosov [at] gmail.com>")
+ (:authors
+ ("Sergei Nosov <sergei.nosov [at] gmail.com>")))])
+ (tuareg .
+ [(2 3 0)
+ ((caml
+ (3 12 0 1))
+ (emacs
+ (24 4)))
+ "OCaml mode for Emacs." tar
+ ((:url . "https://github.com/ocaml/tuareg")
+ (:maintainer "Albert Cohen" . "Albert.Cohen@inria.fr")
+ (:authors
+ ("Albert Cohen" . "Albert.Cohen@inria.fr")
+ ("Sam Steingold" . "sds@gnu.org")
+ ("Christophe Troestler" . "Christophe.Troestler@umons.ac.be")
+ ("Till Varoquaux" . "till@pps.jussieu.fr")
+ ("Sean McLaughlin" . "seanmcl@gmail.com")
+ ("Stefan Monnier" . "monnier@iro.umontreal.ca"))
+ (:keywords "ocaml" "languages"))])
+ (typescript-mode .
+ [(0 4)
+ ((emacs
+ (24 3)))
+ "Major mode for editing typescript" tar
+ ((:url . "http://github.com/ananthakumaran/typescript.el")
+ (:keywords "typescript" "languages")
+ (:commit . "2a58631230fe2d176352af262a0efdecc21f90ac"))])
+ (ujelly-theme .
+ [(1 2 9)
+ nil "Ujelly theme for GNU Emacs 24 (deftheme)" tar
+ ((:url . "http://github.com/marktran/color-theme-ujelly")
+ (:maintainer "Mark Tran" . "mark.tran@gmail.com")
+ (:authors
+ ("Mark Tran" . "mark.tran@gmail.com")))])
+ (vc-fossil .
+ [(20210928)
+ nil "VC backend for the fossil sofware configuraiton management system" tar
+ ((:maintainer "Alfred M. Szmidt" . "ams@gnu.org")
+ (:authors
+ ("Venkat Iyer" . "venkat@comit.com"))
+ (:url . "https://elpa.nongnu.org/nongnu/vc-fossil.html"))])
+ (visual-fill-column .
+ [(2 4)
+ ((emacs
+ (25 1)))
+ "fill-column for visual-line-mode" tar
+ ((:url . "https://codeberg.org/joostkremers/visual-fill-column")
+ (:maintainer "Joost Kremers" . "joostkremers@fastmail.fm")
+ (:authors
+ ("Joost Kremers" . "joostkremers@fastmail.fm")))])
+ (web-mode .
+ [(17 2 0)
+ ((emacs
+ (23 1)))
+ "major mode for editing web templates" tar
+ ((:url . "https://web-mode.org")
+ (:keywords "languages")
+ (:maintainer "François-Xavier Bois" . "fxbois@gmail.com")
+ (:authors
+ ("François-Xavier Bois"))
+ (:commit . "f70277774a725e177774cc81ecbd228792cd6656"))])
+ (webpaste .
+ [(3 2 2)
+ ((emacs
+ (24 4))
+ (request
+ (0 2 0))
+ (cl-lib
+ (0 5)))
+ "Paste to pastebin-like services" tar
+ ((:url . "https://github.com/etu/webpaste.el")
+ (:keywords "convenience" "comm" "paste")
+ (:maintainer "Elis \"etu\" Hirwing" . "elis@hirwing.se")
+ (:authors
+ ("Elis \"etu\" Hirwing" . "elis@hirwing.se")))])
+ (wgrep .
+ [(2 3 3)
+ nil "Writable grep buffer and apply the changes to files" tar
+ ((:url . "http://github.com/mhayashi1120/Emacs-wgrep/raw/master/wgrep.el")
+ (:maintainer "Masahiro Hayashi" . "mhayashi1120@gmail.com")
+ (:authors
+ ("Masahiro Hayashi" . "mhayashi1120@gmail.com"))
+ (:keywords "grep" "edit" "extensions"))])
+ (with-editor .
+ [(3 2 0)
+ ((emacs
+ (24 4)))
+ "Use the Emacsclient as $EDITOR" tar
+ ((:url . "https://github.com/magit/with-editor")
+ (:keywords "tools")
+ (:maintainer "Jonas Bernoulli" . "jonas@bernoul.li")
+ (:authors
+ ("Jonas Bernoulli" . "jonas@bernoul.li"))
+ (:commit . "a762199d9bb8ee60311eaabf791b3dd64140effd"))])
+ (with-simulated-input .
+ [(3 0)
+ ((emacs
+ (24 4)))
+ "A macro to simulate user input non-interactively" tar
+ ((:url . "https://github.com/DarwinAwardWinner/with-simulated-input")
+ (:keywords "lisp" "tools" "extensions")
+ (:maintainer "Ryan C Thompson" . "rct@thompsonclan.org")
+ (:authors
+ ("Ryan C. Thompson" . "rct@thompsonclan.org")
+ ("Nikita Bloshchanevich" . "nikblos@outlook.com"))
+ (:commit . "07bdfbe9ab9eab4a04ad02e98b011649a4f4e6a2"))])
+ (ws-butler .
+ [(0 6)
+ nil "Unobtrusively remove trailing whitespace." tar
+ ((:url . "https://github.com/lewang/ws-butler")
+ (:maintainer "Le Wang")
+ (:authors
+ ("Le Wang")))])
+ (xah-fly-keys .
+ [(17 7 20220429090059)
+ ((emacs
+ (24 1)))
+ "ergonomic modal keybinding minor mode." tar
+ ((:url . "http://xahlee.info/emacs/misc/ergoemacs_vi_mode.html")
+ (:keywords "convenience" "emulations" "vim" "ergoemacs")
+ (:maintainer "Xah Lee" . "xah@xahlee.org")
+ (:authors
+ ("Xah Lee ( http://xahlee.info/ )"))
+ (:commit . "e4db51a90d13eb886b88bbba6a71846653a76e47"))])
+ (xml-rpc .
+ [(1 6 15)
+ nil "An elisp implementation of clientside XML-RPC" tar
+ ((:url . "http://github.com/xml-rpc-el/xml-rpc-el")
+ (:keywords "xml" "rpc" "network")
+ (:maintainer "Mark A. Hershberger" . "mah@everybody.org"))])
+ (yaml-mode .
+ [(0 0 15)
+ ((emacs
+ (24 1)))
+ "Major mode for editing YAML files" tar
+ ((:url . "https://github.com/yoshiki/yaml-mode")
+ (:maintainer "Vasilij Schneidermann" . "mail@vasilij.de")
+ (:authors
+ ("Yoshiki Kurihara" . "clouder@gmail.com")
+ ("Marshall T. Vandegrift" . "llasram@gmail.com"))
+ (:keywords "data" "yaml"))])
+ (yasnippet-snippets .
+ [(1 0)
+ ((yasnippet
+ (0 8 0)))
+ "Collection of yasnippet snippets" tar
+ ((:url . "https://github.com/AndreaCrotti/yasnippet-snippets")
+ (:maintainer "Andrea Crotti" . "andrea.crotti.0@gmail.com")
+ (:authors
+ ("Andrea Crotti" . "andrea.crotti.0@gmail.com"))
+ (:keywords "snippets"))])
+ (zenburn-theme .
+ [(2 7 0)
+ nil "A low contrast color theme for Emacs." tar
+ ((:url . "http://github.com/bbatsov/zenburn-emacs")
+ (:maintainer "Bozhidar Batsov" . "bozhidar@batsov.com")
+ (:authors
+ ("Bozhidar Batsov" . "bozhidar@batsov.com")))])
+ (zig-mode .
+ [(0 0 8)
+ ((emacs
+ (24 3)))
+ "A major mode for the Zig programming language" tar
+ ((:url . "https://github.com/zig-lang/zig-mode")
+ (:maintainer "Andrea Orru <andreaorru1991@gmail.com>, Andrew Kelley" . "superjoe30@gmail.com")
+ (:authors
+ ("Andrea Orru <andreaorru1991@gmail.com>, Andrew Kelley" . "superjoe30@gmail.com"))
+ (:keywords "zig" "languages"))]))
diff --git a/elpa/archives/nongnu/archive-contents.signed b/elpa/archives/nongnu/archive-contents.signed
new file mode 100644
index 0000000..3d5fa7e
--- /dev/null
+++ b/elpa/archives/nongnu/archive-contents.signed
@@ -0,0 +1 @@
+Good signature from 066DAFCB81E42C40 GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org> (trust undefined) created at 2022-05-07T05:15:05-0400 using RSA \ No newline at end of file
diff --git a/elpa/bind-key-20210210.1609/bind-key-autoloads.el b/elpa/bind-key-20210210.1609/bind-key-autoloads.el
new file mode 100644
index 0000000..18ae5b7
--- /dev/null
+++ b/elpa/bind-key-20210210.1609/bind-key-autoloads.el
@@ -0,0 +1,84 @@
+;;; bind-key-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "bind-key" "bind-key.el" (0 0 0 0))
+;;; Generated autoloads from bind-key.el
+
+(autoload 'bind-key "bind-key" "\
+Bind KEY-NAME to COMMAND in KEYMAP (`global-map' if not passed).
+
+KEY-NAME may be a vector, in which case it is passed straight to
+`define-key'. Or it may be a string to be interpreted as
+spelled-out keystrokes, e.g., \"C-c C-z\". See documentation of
+`edmacro-mode' for details.
+
+COMMAND must be an interactive function or lambda form.
+
+KEYMAP, if present, should be a keymap variable or symbol.
+For example:
+
+ (bind-key \"M-h\" #'some-interactive-function my-mode-map)
+
+ (bind-key \"M-h\" #'some-interactive-function 'my-mode-map)
+
+If PREDICATE is non-nil, it is a form evaluated to determine when
+a key should be bound. It must return non-nil in such cases.
+Emacs can evaluate this form at any time that it does redisplay
+or operates on menu data structures, so you should write it so it
+can safely be called at any time.
+
+\(fn KEY-NAME COMMAND &optional KEYMAP PREDICATE)" nil t)
+
+(autoload 'unbind-key "bind-key" "\
+Unbind the given KEY-NAME, within the KEYMAP (if specified).
+See `bind-key' for more details.
+
+\(fn KEY-NAME &optional KEYMAP)" nil t)
+
+(autoload 'bind-key* "bind-key" "\
+Similar to `bind-key', but overrides any mode-specific bindings.
+
+\(fn KEY-NAME COMMAND &optional PREDICATE)" nil t)
+
+(autoload 'bind-keys "bind-key" "\
+Bind multiple keys at once.
+
+Accepts keyword arguments:
+:map MAP - a keymap into which the keybindings should be
+ added
+:prefix KEY - prefix key for these bindings
+:prefix-map MAP - name of the prefix map that should be created
+ for these bindings
+:prefix-docstring STR - docstring for the prefix-map variable
+:menu-name NAME - optional menu string for prefix map
+:filter FORM - optional form to determine when bindings apply
+
+The rest of the arguments are conses of keybinding string and a
+function symbol (unquoted).
+
+\(fn &rest ARGS)" nil t)
+
+(autoload 'bind-keys* "bind-key" "\
+
+
+\(fn &rest ARGS)" nil t)
+
+(autoload 'describe-personal-keybindings "bind-key" "\
+Display all the personal keybindings defined by `bind-key'." t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "bind-key" '("bind-key" "compare-keybindings" "get-binding-description" "override-global-m" "personal-keybindings")))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; bind-key-autoloads.el ends here
diff --git a/elpa/bind-key-20210210.1609/bind-key-pkg.el b/elpa/bind-key-20210210.1609/bind-key-pkg.el
new file mode 100644
index 0000000..bf10ec7
--- /dev/null
+++ b/elpa/bind-key-20210210.1609/bind-key-pkg.el
@@ -0,0 +1,2 @@
+;;; Generated package description from bind-key.el -*- no-byte-compile: t -*-
+(define-package "bind-key" "20210210.1609" "A simple way to manage personal keybindings" 'nil :commit "a7422fb8ab1baee19adb2717b5b47b9c3812a84c" :authors '(("John Wiegley" . "johnw@newartisans.com")) :maintainer '("John Wiegley" . "johnw@newartisans.com") :keywords '("keys" "keybinding" "config" "dotemacs") :url "https://github.com/jwiegley/use-package")
diff --git a/elpa/bind-key-20210210.1609/bind-key.el b/elpa/bind-key-20210210.1609/bind-key.el
new file mode 100644
index 0000000..78c6478
--- /dev/null
+++ b/elpa/bind-key-20210210.1609/bind-key.el
@@ -0,0 +1,492 @@
+;;; bind-key.el --- A simple way to manage personal keybindings
+
+;; Copyright (c) 2012-2017 John Wiegley
+
+;; Author: John Wiegley <johnw@newartisans.com>
+;; Maintainer: John Wiegley <johnw@newartisans.com>
+;; Created: 16 Jun 2012
+;; Modified: 29 Nov 2017
+;; Version: 2.4
+;; Package-Version: 20210210.1609
+;; Package-Commit: a7422fb8ab1baee19adb2717b5b47b9c3812a84c
+;; Keywords: keys keybinding config dotemacs
+;; URL: https://github.com/jwiegley/use-package
+
+;; This program 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, or (at
+;; your option) any later version.
+
+;; This program 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; see the file copying. if not, write to the
+;; free software foundation, inc., 59 temple place - suite 330,
+;; boston, ma 02111-1307, usa.
+
+;;; Commentary:
+
+;; If you have lots of keybindings set in your .emacs file, it can be hard to
+;; know which ones you haven't set yet, and which may now be overriding some
+;; new default in a new emacs version. This module aims to solve that
+;; problem.
+;;
+;; Bind keys as follows in your .emacs:
+;;
+;; (require 'bind-key)
+;;
+;; (bind-key "C-c x" 'my-ctrl-c-x-command)
+;;
+;; If the keybinding argument is a vector, it is passed straight to
+;; `define-key', so remapping a key with `[remap COMMAND]' works as
+;; expected:
+;;
+;; (bind-key [remap original-ctrl-c-x-command] 'my-ctrl-c-x-command)
+;;
+;; If you want the keybinding to override all minor modes that may also bind
+;; the same key, use the `bind-key*' form:
+;;
+;; (bind-key* "<C-return>" 'other-window)
+;;
+;; If you want to rebind a key only in a particular keymap, use:
+;;
+;; (bind-key "C-c x" 'my-ctrl-c-x-command some-other-mode-map)
+;;
+;; To unbind a key within a keymap (for example, to stop your favorite major
+;; mode from changing a binding that you don't want to override everywhere),
+;; use `unbind-key':
+;;
+;; (unbind-key "C-c x" some-other-mode-map)
+;;
+;; To bind multiple keys at once, or set up a prefix map, a `bind-keys' macro
+;; is provided. It accepts keyword arguments, please see its documentation
+;; for a detailed description.
+;;
+;; To add keys into a specific map, use :map argument
+;;
+;; (bind-keys :map dired-mode-map
+;; ("o" . dired-omit-mode)
+;; ("a" . some-custom-dired-function))
+;;
+;; To set up a prefix map, use `:prefix-map' and `:prefix' arguments (both are
+;; required)
+;;
+;; (bind-keys :prefix-map my-customize-prefix-map
+;; :prefix "C-c c"
+;; ("f" . customize-face)
+;; ("v" . customize-variable))
+;;
+;; You can combine all the keywords together. Additionally,
+;; `:prefix-docstring' can be specified to set documentation of created
+;; `:prefix-map' variable.
+;;
+;; To bind multiple keys in a `bind-key*' way (to be sure that your bindings
+;; will not be overridden by other modes), you may use `bind-keys*' macro:
+;;
+;; (bind-keys*
+;; ("C-o" . other-window)
+;; ("C-M-n" . forward-page)
+;; ("C-M-p" . backward-page))
+;;
+;; After Emacs loads, you can see a summary of all your personal keybindings
+;; currently in effect with this command:
+;;
+;; M-x describe-personal-keybindings
+;;
+;; This display will tell you if you've overridden a default keybinding, and
+;; what the default was. Also, it will tell you if the key was rebound after
+;; your binding it with `bind-key', and what it was rebound it to.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'easy-mmode)
+
+(defgroup bind-key nil
+ "A simple way to manage personal keybindings"
+ :group 'emacs)
+
+(defcustom bind-key-column-widths '(18 . 40)
+ "Width of columns in `describe-personal-keybindings'."
+ :type '(cons integer integer)
+ :group 'bind-key)
+
+(defcustom bind-key-segregation-regexp
+ "\\`\\(\\(C-[chx] \\|M-[gso] \\)\\([CM]-\\)?\\|.+-\\)"
+ "Regular expression used to divide key sets in the output from
+\\[describe-personal-keybindings]."
+ :type 'regexp
+ :group 'bind-key)
+
+(defcustom bind-key-describe-special-forms nil
+ "If non-nil, extract docstrings from lambdas, closures and keymaps if possible."
+ :type 'boolean
+ :group 'bind-key)
+
+;; Create override-global-mode to force key remappings
+
+(defvar override-global-map (make-keymap)
+ "override-global-mode keymap")
+
+(define-minor-mode override-global-mode
+ "A minor mode so that keymap settings override other modes."
+ t "")
+
+;; the keymaps in `emulation-mode-map-alists' take precedence over
+;; `minor-mode-map-alist'
+(add-to-list 'emulation-mode-map-alists
+ `((override-global-mode . ,override-global-map)))
+
+(defvar personal-keybindings nil
+ "List of bindings performed by `bind-key'.
+
+Elements have the form ((KEY . [MAP]) CMD ORIGINAL-CMD)")
+
+;;;###autoload
+(defmacro bind-key (key-name command &optional keymap predicate)
+ "Bind KEY-NAME to COMMAND in KEYMAP (`global-map' if not passed).
+
+KEY-NAME may be a vector, in which case it is passed straight to
+`define-key'. Or it may be a string to be interpreted as
+spelled-out keystrokes, e.g., \"C-c C-z\". See documentation of
+`edmacro-mode' for details.
+
+COMMAND must be an interactive function or lambda form.
+
+KEYMAP, if present, should be a keymap variable or symbol.
+For example:
+
+ (bind-key \"M-h\" #'some-interactive-function my-mode-map)
+
+ (bind-key \"M-h\" #'some-interactive-function 'my-mode-map)
+
+If PREDICATE is non-nil, it is a form evaluated to determine when
+a key should be bound. It must return non-nil in such cases.
+Emacs can evaluate this form at any time that it does redisplay
+or operates on menu data structures, so you should write it so it
+can safely be called at any time."
+ (let ((namevar (make-symbol "name"))
+ (keyvar (make-symbol "key"))
+ (kmapvar (make-symbol "kmap"))
+ (kdescvar (make-symbol "kdesc"))
+ (bindingvar (make-symbol "binding")))
+ `(let* ((,namevar ,key-name)
+ (,keyvar (if (vectorp ,namevar) ,namevar
+ (read-kbd-macro ,namevar)))
+ (,kmapvar (or (if (and ,keymap (symbolp ,keymap))
+ (symbol-value ,keymap) ,keymap)
+ global-map))
+ (,kdescvar (cons (if (stringp ,namevar) ,namevar
+ (key-description ,namevar))
+ (if (symbolp ,keymap) ,keymap (quote ,keymap))))
+ (,bindingvar (lookup-key ,kmapvar ,keyvar)))
+ (let ((entry (assoc ,kdescvar personal-keybindings))
+ (details (list ,command
+ (unless (numberp ,bindingvar)
+ ,bindingvar))))
+ (if entry
+ (setcdr entry details)
+ (add-to-list 'personal-keybindings (cons ,kdescvar details))))
+ ,(if predicate
+ `(define-key ,kmapvar ,keyvar
+ '(menu-item "" nil :filter (lambda (&optional _)
+ (when ,predicate
+ ,command))))
+ `(define-key ,kmapvar ,keyvar ,command)))))
+
+;;;###autoload
+(defmacro unbind-key (key-name &optional keymap)
+ "Unbind the given KEY-NAME, within the KEYMAP (if specified).
+See `bind-key' for more details."
+ (let ((namevar (make-symbol "name"))
+ (kdescvar (make-symbol "kdesc")))
+ `(let* ((,namevar ,key-name)
+ (,kdescvar (cons (if (stringp ,namevar) ,namevar
+ (key-description ,namevar))
+ (if (symbolp ,keymap) ,keymap (quote ,keymap)))))
+ (bind-key--remove (if (vectorp ,namevar) ,namevar
+ (read-kbd-macro ,namevar))
+ (or (if (and ,keymap (symbolp ,keymap))
+ (symbol-value ,keymap) ,keymap)
+ global-map))
+ (setq personal-keybindings
+ (cl-delete-if (lambda (k) (equal (car k) ,kdescvar))
+ personal-keybindings))
+ nil)))
+
+(defun bind-key--remove (key keymap)
+ "Remove KEY from KEYMAP.
+
+In contrast to `define-key', this function removes the binding from the keymap."
+ (define-key keymap key nil)
+ ;; Split M-key in ESC key
+ (setq key (mapcan (lambda (k)
+ (if (and (integerp k) (/= (logand k ?\M-\0) 0))
+ (list ?\e (logxor k ?\M-\0))
+ (list k)))
+ key))
+ ;; Delete single keys directly
+ (if (= (length key) 1)
+ (delete key keymap)
+ ;; Lookup submap and delete key from there
+ (let* ((prefix (vconcat (butlast key)))
+ (submap (lookup-key keymap prefix)))
+ (unless (keymapp submap)
+ (error "Not a keymap for %s" key))
+ (when (symbolp submap)
+ (setq submap (symbol-function submap)))
+ (delete (last key) submap)
+ ;; Delete submap if it is empty
+ (when (= 1 (length submap))
+ (bind-key--remove prefix keymap)))))
+
+;;;###autoload
+(defmacro bind-key* (key-name command &optional predicate)
+ "Similar to `bind-key', but overrides any mode-specific bindings."
+ `(bind-key ,key-name ,command override-global-map ,predicate))
+
+(defun bind-keys-form (args keymap)
+ "Bind multiple keys at once.
+
+Accepts keyword arguments:
+:map MAP - a keymap into which the keybindings should be
+ added
+:prefix KEY - prefix key for these bindings
+:prefix-map MAP - name of the prefix map that should be created
+ for these bindings
+:prefix-docstring STR - docstring for the prefix-map variable
+:menu-name NAME - optional menu string for prefix map
+:filter FORM - optional form to determine when bindings apply
+
+The rest of the arguments are conses of keybinding string and a
+function symbol (unquoted)."
+ (let (map
+ doc
+ prefix-map
+ prefix
+ filter
+ menu-name
+ pkg)
+
+ ;; Process any initial keyword arguments
+ (let ((cont t))
+ (while (and cont args)
+ (if (cond ((and (eq :map (car args))
+ (not prefix-map))
+ (setq map (cadr args)))
+ ((eq :prefix-docstring (car args))
+ (setq doc (cadr args)))
+ ((and (eq :prefix-map (car args))
+ (not (memq map '(global-map
+ override-global-map))))
+ (setq prefix-map (cadr args)))
+ ((eq :prefix (car args))
+ (setq prefix (cadr args)))
+ ((eq :filter (car args))
+ (setq filter (cadr args)) t)
+ ((eq :menu-name (car args))
+ (setq menu-name (cadr args)))
+ ((eq :package (car args))
+ (setq pkg (cadr args))))
+ (setq args (cddr args))
+ (setq cont nil))))
+
+ (when (or (and prefix-map (not prefix))
+ (and prefix (not prefix-map)))
+ (error "Both :prefix-map and :prefix must be supplied"))
+
+ (when (and menu-name (not prefix))
+ (error "If :menu-name is supplied, :prefix must be too"))
+
+ (unless map (setq map keymap))
+
+ ;; Process key binding arguments
+ (let (first next)
+ (while args
+ (if (keywordp (car args))
+ (progn
+ (setq next args)
+ (setq args nil))
+ (if first
+ (nconc first (list (car args)))
+ (setq first (list (car args))))
+ (setq args (cdr args))))
+
+ (cl-flet
+ ((wrap (map bindings)
+ (if (and map pkg (not (memq map '(global-map
+ override-global-map))))
+ `((if (boundp ',map)
+ ,(macroexp-progn bindings)
+ (eval-after-load
+ ,(if (symbolp pkg) `',pkg pkg)
+ ',(macroexp-progn bindings))))
+ bindings)))
+
+ (append
+ (when prefix-map
+ `((defvar ,prefix-map)
+ ,@(when doc `((put ',prefix-map 'variable-documentation ,doc)))
+ ,@(if menu-name
+ `((define-prefix-command ',prefix-map nil ,menu-name))
+ `((define-prefix-command ',prefix-map)))
+ ,@(if (and map (not (eq map 'global-map)))
+ (wrap map `((bind-key ,prefix ',prefix-map ,map ,filter)))
+ `((bind-key ,prefix ',prefix-map nil ,filter)))))
+ (wrap map
+ (cl-mapcan
+ (lambda (form)
+ (let ((fun (and (cdr form) (list 'function (cdr form)))))
+ (if prefix-map
+ `((bind-key ,(car form) ,fun ,prefix-map ,filter))
+ (if (and map (not (eq map 'global-map)))
+ `((bind-key ,(car form) ,fun ,map ,filter))
+ `((bind-key ,(car form) ,fun nil ,filter))))))
+ first))
+ (when next
+ (bind-keys-form (if pkg
+ (cons :package (cons pkg next))
+ next) map)))))))
+
+;;;###autoload
+(defmacro bind-keys (&rest args)
+ "Bind multiple keys at once.
+
+Accepts keyword arguments:
+:map MAP - a keymap into which the keybindings should be
+ added
+:prefix KEY - prefix key for these bindings
+:prefix-map MAP - name of the prefix map that should be created
+ for these bindings
+:prefix-docstring STR - docstring for the prefix-map variable
+:menu-name NAME - optional menu string for prefix map
+:filter FORM - optional form to determine when bindings apply
+
+The rest of the arguments are conses of keybinding string and a
+function symbol (unquoted)."
+ (macroexp-progn (bind-keys-form args nil)))
+
+;;;###autoload
+(defmacro bind-keys* (&rest args)
+ (macroexp-progn (bind-keys-form args 'override-global-map)))
+
+(defun get-binding-description (elem)
+ (cond
+ ((listp elem)
+ (cond
+ ((memq (car elem) '(lambda function))
+ (if (and bind-key-describe-special-forms
+ (stringp (nth 2 elem)))
+ (nth 2 elem)
+ "#<lambda>"))
+ ((eq 'closure (car elem))
+ (if (and bind-key-describe-special-forms
+ (stringp (nth 3 elem)))
+ (nth 3 elem)
+ "#<closure>"))
+ ((eq 'keymap (car elem))
+ "#<keymap>")
+ (t
+ elem)))
+ ;; must be a symbol, non-symbol keymap case covered above
+ ((and bind-key-describe-special-forms (keymapp elem))
+ (let ((doc (get elem 'variable-documentation)))
+ (if (stringp doc) doc elem)))
+ ((symbolp elem)
+ elem)
+ (t
+ "#<byte-compiled lambda>")))
+
+(defun compare-keybindings (l r)
+ (let* ((regex bind-key-segregation-regexp)
+ (lgroup (and (string-match regex (caar l))
+ (match-string 0 (caar l))))
+ (rgroup (and (string-match regex (caar r))
+ (match-string 0 (caar r))))
+ (lkeymap (cdar l))
+ (rkeymap (cdar r)))
+ (cond
+ ((and (null lkeymap) rkeymap)
+ (cons t t))
+ ((and lkeymap (null rkeymap))
+ (cons nil t))
+ ((and lkeymap rkeymap
+ (not (string= (symbol-name lkeymap) (symbol-name rkeymap))))
+ (cons (string< (symbol-name lkeymap) (symbol-name rkeymap)) t))
+ ((and (null lgroup) rgroup)
+ (cons t t))
+ ((and lgroup (null rgroup))
+ (cons nil t))
+ ((and lgroup rgroup)
+ (if (string= lgroup rgroup)
+ (cons (string< (caar l) (caar r)) nil)
+ (cons (string< lgroup rgroup) t)))
+ (t
+ (cons (string< (caar l) (caar r)) nil)))))
+
+;;;###autoload
+(defun describe-personal-keybindings ()
+ "Display all the personal keybindings defined by `bind-key'."
+ (interactive)
+ (with-output-to-temp-buffer "*Personal Keybindings*"
+ (princ (format (concat "Key name%s Command%s Comments\n%s %s "
+ "---------------------\n")
+ (make-string (- (car bind-key-column-widths) 9) ? )
+ (make-string (- (cdr bind-key-column-widths) 8) ? )
+ (make-string (1- (car bind-key-column-widths)) ?-)
+ (make-string (1- (cdr bind-key-column-widths)) ?-)))
+ (let (last-binding)
+ (dolist (binding
+ (setq personal-keybindings
+ (sort personal-keybindings
+ (lambda (l r)
+ (car (compare-keybindings l r))))))
+
+ (if (not (eq (cdar last-binding) (cdar binding)))
+ (princ (format "\n\n%s: %s\n%s\n\n"
+ (cdar binding) (caar binding)
+ (make-string (+ 21 (car bind-key-column-widths)
+ (cdr bind-key-column-widths)) ?-)))
+ (if (and last-binding
+ (cdr (compare-keybindings last-binding binding)))
+ (princ "\n")))
+
+ (let* ((key-name (caar binding))
+ (at-present (lookup-key (or (symbol-value (cdar binding))
+ (current-global-map))
+ (read-kbd-macro key-name)))
+ (command (nth 1 binding))
+ (was-command (nth 2 binding))
+ (command-desc (get-binding-description command))
+ (was-command-desc (and was-command
+ (get-binding-description was-command)))
+ (at-present-desc (get-binding-description at-present))
+ )
+ (let ((line
+ (format
+ (format "%%-%ds%%-%ds%%s\n" (car bind-key-column-widths)
+ (cdr bind-key-column-widths))
+ key-name (format "`%s\'" command-desc)
+ (if (string= command-desc at-present-desc)
+ (if (or (null was-command)
+ (string= command-desc was-command-desc))
+ ""
+ (format "was `%s\'" was-command-desc))
+ (format "[now: `%s\']" at-present)))))
+ (princ (if (string-match "[ \t]+\n" line)
+ (replace-match "\n" t t line)
+ line))))
+
+ (setq last-binding binding)))))
+
+(provide 'bind-key)
+
+;; Local Variables:
+;; outline-regexp: ";;;\\(;* [^\s\t\n]\\|###autoload\\)\\|("
+;; indent-tabs-mode: nil
+;; End:
+
+;;; bind-key.el ends here
diff --git a/elpa/bind-key-20210210.1609/bind-key.elc b/elpa/bind-key-20210210.1609/bind-key.elc
new file mode 100644
index 0000000..0b536ff
--- /dev/null
+++ b/elpa/bind-key-20210210.1609/bind-key.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-abbrev.el b/elpa/company-20220326.48/company-abbrev.el
new file mode 100644
index 0000000..b8f81c4
--- /dev/null
+++ b/elpa/company-20220326.48/company-abbrev.el
@@ -0,0 +1,52 @@
+;;; company-abbrev.el --- company-mode completion backend for abbrev
+
+;; Copyright (C) 2009-2011, 2013-2015, 2021 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+(require 'abbrev)
+
+(defun company-abbrev-insert (match)
+ "Replace MATCH with the expanded abbrev."
+ (expand-abbrev))
+
+;;;###autoload
+(defun company-abbrev (command &optional arg &rest ignored)
+ "`company-mode' completion backend for abbrev."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-abbrev
+ 'company-abbrev-insert))
+ (prefix (company-grab-symbol))
+ (candidates (nconc
+ (delete "" (all-completions arg global-abbrev-table))
+ (delete "" (all-completions arg local-abbrev-table))))
+ (kind 'snippet)
+ (meta (abbrev-expansion arg))
+ (post-completion (expand-abbrev))))
+
+(provide 'company-abbrev)
+;;; company-abbrev.el ends here
diff --git a/elpa/company-20220326.48/company-abbrev.elc b/elpa/company-20220326.48/company-abbrev.elc
new file mode 100644
index 0000000..6b3db1a
--- /dev/null
+++ b/elpa/company-20220326.48/company-abbrev.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-autoloads.el b/elpa/company-20220326.48/company-autoloads.el
new file mode 100644
index 0000000..541366e
--- /dev/null
+++ b/elpa/company-20220326.48/company-autoloads.el
@@ -0,0 +1,384 @@
+;;; company-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "company" "company.el" (0 0 0 0))
+;;; Generated autoloads from company.el
+
+(autoload 'company-mode "company" "\
+\"complete anything\"; is an in-buffer completion framework.
+Completion starts automatically, depending on the values
+`company-idle-delay' and `company-minimum-prefix-length'.
+
+If called interactively, enable Company 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.
+
+Completion can be controlled with the commands:
+`company-complete-common', `company-complete-selection', `company-complete',
+`company-select-next', `company-select-previous'. If these commands are
+called before `company-idle-delay', completion will also start.
+
+Completions can be searched with `company-search-candidates' or
+`company-filter-candidates'. These can be used while completion is
+inactive, as well.
+
+The completion data is retrieved using `company-backends' and displayed
+using `company-frontends'. If you want to start a specific backend, call
+it interactively or use `company-begin-backend'.
+
+By default, the completions list is sorted alphabetically, unless the
+backend chooses otherwise, or `company-transformers' changes it later.
+
+regular keymap (`company-mode-map'):
+
+\\{company-mode-map}
+keymap during active completions (`company-active-map'):
+
+\\{company-active-map}
+
+\(fn &optional ARG)" t nil)
+
+(put 'global-company-mode 'globalized-minor-mode t)
+
+(defvar global-company-mode nil "\
+Non-nil if Global Company mode is enabled.
+See the `global-company-mode' command
+for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `global-company-mode'.")
+
+(custom-autoload 'global-company-mode "company" nil)
+
+(autoload 'global-company-mode "company" "\
+Toggle Company mode in all buffers.
+With prefix ARG, enable Global Company mode if ARG is positive;
+otherwise, disable it. If called from Lisp, enable the mode if
+ARG is omitted or nil.
+
+Company mode is enabled in all buffers where
+`company-mode-on' would do it.
+See `company-mode' for more information on Company mode.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'company-manual-begin "company" nil t nil)
+
+(autoload 'company-complete "company" "\
+Insert the common part of all candidates or the current selection.
+The first time this is called, the common part is inserted, the second
+time, or when the selection has been changed, the selected candidate is
+inserted." t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company" '("company-")))
+
+;;;***
+
+;;;### (autoloads nil "company-abbrev" "company-abbrev.el" (0 0 0
+;;;;;; 0))
+;;; Generated autoloads from company-abbrev.el
+
+(autoload 'company-abbrev "company-abbrev" "\
+`company-mode' completion backend for abbrev.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-abbrev" '("company-abbrev-insert")))
+
+;;;***
+
+;;;### (autoloads nil "company-bbdb" "company-bbdb.el" (0 0 0 0))
+;;; Generated autoloads from company-bbdb.el
+
+(autoload 'company-bbdb "company-bbdb" "\
+`company-mode' completion backend for BBDB.
+
+\(fn COMMAND &optional ARG &rest IGNORE)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-bbdb" '("company-bbdb-")))
+
+;;;***
+
+;;;### (autoloads nil "company-capf" "company-capf.el" (0 0 0 0))
+;;; Generated autoloads from company-capf.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-capf" '("company-")))
+
+;;;***
+
+;;;### (autoloads nil "company-clang" "company-clang.el" (0 0 0 0))
+;;; Generated autoloads from company-clang.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-clang" '("company-clang")))
+
+;;;***
+
+;;;### (autoloads nil "company-cmake" "company-cmake.el" (0 0 0 0))
+;;; Generated autoloads from company-cmake.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-cmake" '("company-cmake")))
+
+;;;***
+
+;;;### (autoloads nil "company-css" "company-css.el" (0 0 0 0))
+;;; Generated autoloads from company-css.el
+
+(autoload 'company-css "company-css" "\
+`company-mode' completion backend for `css-mode'.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-css" '("company-css-")))
+
+;;;***
+
+;;;### (autoloads nil "company-dabbrev" "company-dabbrev.el" (0 0
+;;;;;; 0 0))
+;;; Generated autoloads from company-dabbrev.el
+
+(autoload 'company-dabbrev "company-dabbrev" "\
+dabbrev-like `company-mode' completion backend.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-dabbrev" '("company-dabbrev-")))
+
+;;;***
+
+;;;### (autoloads nil "company-dabbrev-code" "company-dabbrev-code.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from company-dabbrev-code.el
+
+(autoload 'company-dabbrev-code "company-dabbrev-code" "\
+dabbrev-like `company-mode' backend for code.
+The backend looks for all symbols in the current buffer that aren't in
+comments or strings.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-dabbrev-code" '("company-dabbrev-code-")))
+
+;;;***
+
+;;;### (autoloads nil "company-elisp" "company-elisp.el" (0 0 0 0))
+;;; Generated autoloads from company-elisp.el
+
+(autoload 'company-elisp "company-elisp" "\
+`company-mode' completion backend for Emacs Lisp.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-elisp" '("company-elisp-")))
+
+;;;***
+
+;;;### (autoloads nil "company-etags" "company-etags.el" (0 0 0 0))
+;;; Generated autoloads from company-etags.el
+
+(autoload 'company-etags "company-etags" "\
+`company-mode' completion backend for etags.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-etags" '("company-etags-")))
+
+;;;***
+
+;;;### (autoloads nil "company-files" "company-files.el" (0 0 0 0))
+;;; Generated autoloads from company-files.el
+
+(autoload 'company-files "company-files" "\
+`company-mode' completion backend existing file names.
+Completions works for proper absolute and relative files paths.
+File paths with spaces are only supported inside strings.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-files" '("company-file")))
+
+;;;***
+
+;;;### (autoloads nil "company-gtags" "company-gtags.el" (0 0 0 0))
+;;; Generated autoloads from company-gtags.el
+
+(autoload 'company-gtags "company-gtags" "\
+`company-mode' completion backend for GNU Global.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-gtags" '("company-gtags-")))
+
+;;;***
+
+;;;### (autoloads nil "company-ispell" "company-ispell.el" (0 0 0
+;;;;;; 0))
+;;; Generated autoloads from company-ispell.el
+
+(autoload 'company-ispell "company-ispell" "\
+`company-mode' completion backend using Ispell.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-ispell" '("company-ispell-")))
+
+;;;***
+
+;;;### (autoloads nil "company-keywords" "company-keywords.el" (0
+;;;;;; 0 0 0))
+;;; Generated autoloads from company-keywords.el
+
+(autoload 'company-keywords "company-keywords" "\
+`company-mode' backend for programming language keywords.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-keywords" '("company-keywords-")))
+
+;;;***
+
+;;;### (autoloads nil "company-nxml" "company-nxml.el" (0 0 0 0))
+;;; Generated autoloads from company-nxml.el
+
+(autoload 'company-nxml "company-nxml" "\
+`company-mode' completion backend for `nxml-mode'.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-nxml" '("company-nxml-")))
+
+;;;***
+
+;;;### (autoloads nil "company-oddmuse" "company-oddmuse.el" (0 0
+;;;;;; 0 0))
+;;; Generated autoloads from company-oddmuse.el
+
+(autoload 'company-oddmuse "company-oddmuse" "\
+`company-mode' completion backend for `oddmuse-mode'.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-oddmuse" '("company-oddmuse-")))
+
+;;;***
+
+;;;### (autoloads nil "company-semantic" "company-semantic.el" (0
+;;;;;; 0 0 0))
+;;; Generated autoloads from company-semantic.el
+
+(autoload 'company-semantic "company-semantic" "\
+`company-mode' completion backend using CEDET Semantic.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-semantic" '("company-semantic-")))
+
+;;;***
+
+;;;### (autoloads nil "company-template" "company-template.el" (0
+;;;;;; 0 0 0))
+;;; Generated autoloads from company-template.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-template" '("company-template-")))
+
+;;;***
+
+;;;### (autoloads nil "company-tempo" "company-tempo.el" (0 0 0 0))
+;;; Generated autoloads from company-tempo.el
+
+(autoload 'company-tempo "company-tempo" "\
+`company-mode' completion backend for tempo.
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-tempo" '("company-tempo-")))
+
+;;;***
+
+;;;### (autoloads nil "company-tng" "company-tng.el" (0 0 0 0))
+;;; Generated autoloads from company-tng.el
+
+(autoload 'company-tng-frontend "company-tng" "\
+When the user changes the selection at least once, this
+frontend will display the candidate in the buffer as if it's
+already there and any key outside of `company-active-map' will
+confirm the selection and finish the completion.
+
+\(fn COMMAND)" nil nil)
+
+(define-obsolete-function-alias 'company-tng-configure-default 'company-tng-mode "0.9.14" "\
+Applies the default configuration to enable company-tng.")
+
+(defvar company-tng-mode nil "\
+Non-nil if Company-Tng mode is enabled.
+See the `company-tng-mode' command
+for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `company-tng-mode'.")
+
+(custom-autoload 'company-tng-mode "company-tng" nil)
+
+(autoload 'company-tng-mode "company-tng" "\
+This minor mode enables `company-tng-frontend'.
+
+If called interactively, enable Company-Tng 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.
+
+\(fn &optional ARG)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-tng" '("company-tng-")))
+
+;;;***
+
+;;;### (autoloads nil "company-yasnippet" "company-yasnippet.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from company-yasnippet.el
+
+(autoload 'company-yasnippet "company-yasnippet" "\
+`company-mode' backend for `yasnippet'.
+
+This backend should be used with care, because as long as there are
+snippets defined for the current major mode, this backend will always
+shadow backends that come after it. Recommended usages:
+
+* In a buffer-local value of `company-backends', grouped with a backend or
+ several that provide actual text completions.
+
+ (add-hook \\='js-mode-hook
+ (lambda ()
+ (set (make-local-variable \\='company-backends)
+ \\='((company-dabbrev-code company-yasnippet)))))
+
+* After keyword `:with', grouped with other backends.
+
+ (push \\='(company-semantic :with company-yasnippet) company-backends)
+
+* Not in `company-backends', just bound to a key.
+
+ (global-set-key (kbd \"C-c y\") \\='company-yasnippet)
+
+\(fn COMMAND &optional ARG &rest IGNORE)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-yasnippet" '("company-yasnippet-")))
+
+;;;***
+
+;;;### (autoloads nil nil ("company-pkg.el") (0 0 0 0))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; company-autoloads.el ends here
diff --git a/elpa/company-20220326.48/company-bbdb.el b/elpa/company-20220326.48/company-bbdb.el
new file mode 100644
index 0000000..1016e2a
--- /dev/null
+++ b/elpa/company-20220326.48/company-bbdb.el
@@ -0,0 +1,63 @@
+;;; company-bbdb.el --- company-mode completion backend for BBDB in message-mode
+
+;; Copyright (C) 2013-2016, 2020 Free Software Foundation, Inc.
+
+;; Author: Jan Tatarik <jan.tatarik@gmail.com>
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+(require 'company)
+(require 'cl-lib)
+
+(declare-function bbdb-record-get-field "bbdb")
+(declare-function bbdb-records "bbdb")
+(declare-function bbdb-dwim-mail "bbdb-com")
+(declare-function bbdb-search "bbdb-com")
+
+(defgroup company-bbdb nil
+ "Completion backend for BBDB."
+ :group 'company)
+
+(defcustom company-bbdb-modes '(message-mode)
+ "Major modes in which `company-bbdb' may complete."
+ :type '(repeat (symbol :tag "Major mode"))
+ :package-version '(company . "0.8.8"))
+
+(defun company-bbdb--candidates (arg)
+ (cl-mapcan (lambda (record)
+ (mapcar (lambda (mail) (bbdb-dwim-mail record mail))
+ (bbdb-record-get-field record 'mail)))
+ (eval '(bbdb-search (bbdb-records) arg nil arg))))
+
+;;;###autoload
+(defun company-bbdb (command &optional arg &rest ignore)
+ "`company-mode' completion backend for BBDB."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-bbdb))
+ (prefix (and (memq major-mode company-bbdb-modes)
+ (featurep 'bbdb-com)
+ (let ((case-fold-search t))
+ (looking-back
+ "^\\([^ :]*-\\)?\\(To\\|B?Cc\\|From\\):.*? *\\([^,;]*\\)"
+ (line-beginning-position)))
+ (match-string-no-properties 3)))
+ (candidates (company-bbdb--candidates arg))
+ (sorted t)
+ (no-cache t)))
+
+(provide 'company-bbdb)
+;;; company-bbdb.el ends here
diff --git a/elpa/company-20220326.48/company-bbdb.elc b/elpa/company-20220326.48/company-bbdb.elc
new file mode 100644
index 0000000..420f161
--- /dev/null
+++ b/elpa/company-20220326.48/company-bbdb.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-capf.el b/elpa/company-20220326.48/company-capf.el
new file mode 100644
index 0000000..52f677f
--- /dev/null
+++ b/elpa/company-20220326.48/company-capf.el
@@ -0,0 +1,225 @@
+;;; company-capf.el --- company-mode completion-at-point-functions backend -*- lexical-binding: t -*-
+
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
+
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+;; The CAPF back-end provides a bridge to the standard
+;; completion-at-point-functions facility, and thus can support any major mode
+;; that defines a proper completion function, including emacs-lisp-mode,
+;; css-mode and nxml-mode.
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+
+;; Amortizes several calls to a c-a-p-f from the same position.
+(defvar company--capf-cache nil)
+
+;; FIXME: Provide a way to save this info once in Company itself
+;; (https://github.com/company-mode/company-mode/pull/845).
+(defvar-local company-capf--current-completion-data nil
+ "Value last returned by `company-capf' when called with `candidates'.
+For most properties/actions, this is just what we need: the exact values
+that accompanied the completion table that's currently is use.
+
+`company-capf', however, could be called at some different positions during
+a completion session (most importantly, by `company-sort-by-occurrence'),
+so we can't just use the preceding variable instead.")
+
+(defun company--capf-data ()
+ (let ((cache company--capf-cache))
+ (if (and (equal (current-buffer) (car cache))
+ (equal (point) (car (setq cache (cdr cache))))
+ (equal (buffer-chars-modified-tick) (car (setq cache (cdr cache)))))
+ (cadr cache)
+ (let ((data (company--capf-data-real)))
+ (setq company--capf-cache
+ (list (current-buffer) (point) (buffer-chars-modified-tick) data))
+ data))))
+
+(defun company--capf-data-real ()
+ (cl-letf* (((default-value 'completion-at-point-functions)
+ ;; Ignore tags-completion-at-point-function because it subverts
+ ;; company-etags in the default value of company-backends, where
+ ;; the latter comes later.
+ (remove 'tags-completion-at-point-function
+ (default-value 'completion-at-point-functions)))
+ (completion-at-point-functions (company--capf-workaround))
+ (data (run-hook-wrapped 'completion-at-point-functions
+ ;; Ignore misbehaving functions.
+ #'completion--capf-wrapper 'optimist)))
+ (when (and (consp (cdr data)) (integer-or-marker-p (nth 1 data))) data)))
+
+(declare-function python-shell-get-process "python")
+
+(defun company--capf-workaround ()
+ ;; For http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18067
+ (if (or (not (listp completion-at-point-functions))
+ (not (memq 'python-completion-complete-at-point completion-at-point-functions))
+ (python-shell-get-process))
+ completion-at-point-functions
+ (remq 'python-completion-complete-at-point completion-at-point-functions)))
+
+(defun company-capf--save-current-data (data)
+ (setq company-capf--current-completion-data data)
+ (add-hook 'company-after-completion-hook
+ #'company-capf--clear-current-data nil t))
+
+(defun company-capf--clear-current-data (_ignored)
+ (setq company-capf--current-completion-data nil))
+
+(defvar-local company-capf--sorted nil)
+
+(defun company-capf (command &optional arg &rest _args)
+ "`company-mode' backend using `completion-at-point-functions'."
+ (interactive (list 'interactive))
+ (pcase command
+ (`interactive (company-begin-backend 'company-capf))
+ (`prefix
+ (let ((res (company--capf-data)))
+ (when res
+ (let ((length (plist-get (nthcdr 4 res) :company-prefix-length))
+ (prefix (buffer-substring-no-properties (nth 1 res) (point))))
+ (cond
+ ((> (nth 2 res) (point)) 'stop)
+ (length (cons prefix length))
+ (t prefix))))))
+ (`candidates
+ (company-capf--candidates arg))
+ (`sorted
+ company-capf--sorted)
+ (`match
+ ;; Ask the for the `:company-match' function. If that doesn't help,
+ ;; fallback to sniffing for face changes to get a suitable value.
+ (let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
+ :company-match)))
+ (if f (funcall f arg)
+ (let* ((match-start nil) (pos -1)
+ (prop-value nil) (faces nil)
+ (has-face-p nil) chunks
+ (limit (length arg)))
+ (while (< pos limit)
+ (setq pos
+ (if (< pos 0) 0 (next-property-change pos arg limit)))
+ (setq prop-value (or
+ (get-text-property pos 'face arg)
+ (get-text-property pos 'font-lock-face arg))
+ faces (if (listp prop-value) prop-value (list prop-value))
+ has-face-p (memq 'completions-common-part faces))
+ (cond ((and (not match-start) has-face-p)
+ (setq match-start pos))
+ ((and match-start (not has-face-p))
+ (push (cons match-start pos) chunks)
+ (setq match-start nil))))
+ (nreverse chunks)))))
+ (`duplicates t)
+ (`no-cache t) ;Not much can be done here, as long as we handle
+ ;non-prefix matches.
+ (`meta
+ (let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
+ :company-docsig)))
+ (when f (funcall f arg))))
+ (`doc-buffer
+ (let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
+ :company-doc-buffer)))
+ (when f (funcall f arg))))
+ (`location
+ (let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
+ :company-location)))
+ (when f (funcall f arg))))
+ (`annotation
+ (company-capf--annotation arg))
+ (`kind
+ (let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
+ :company-kind)))
+ (when f (funcall f arg))))
+ (`deprecated
+ (let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
+ :company-deprecated)))
+ (when f (funcall f arg))))
+ (`require-match
+ (plist-get (nthcdr 4 (company--capf-data)) :company-require-match))
+ (`init nil) ;Don't bother: plenty of other ways to initialize the code.
+ (`post-completion
+ (company--capf-post-completion arg))
+ ))
+
+(defun company-capf--annotation (arg)
+ (let* ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
+ :annotation-function))
+ (annotation (when f (funcall f arg))))
+ (if (and company-format-margin-function
+ (equal annotation " <f>") ; elisp-completion-at-point, pre-icons
+ (plist-get (nthcdr 4 company-capf--current-completion-data)
+ :company-kind))
+ nil
+ annotation)))
+
+(defun company-capf--candidates (input)
+ (let ((res (company--capf-data)))
+ (company-capf--save-current-data res)
+ (when res
+ (let* ((table (nth 3 res))
+ (pred (plist-get (nthcdr 4 res) :predicate))
+ (meta (completion-metadata
+ (buffer-substring (nth 1 res) (nth 2 res))
+ table pred))
+ (candidates (completion-all-completions input table pred
+ (length input)
+ meta))
+ (sortfun (cdr (assq 'display-sort-function meta)))
+ (last (last candidates))
+ (base-size (and (numberp (cdr last)) (cdr last))))
+ (when base-size
+ (setcdr last nil))
+ (setq company-capf--sorted (functionp sortfun))
+ (when sortfun
+ (setq candidates (funcall sortfun candidates)))
+ (if (not (zerop (or base-size 0)))
+ (let ((before (substring input 0 base-size)))
+ (mapcar (lambda (candidate)
+ (concat before candidate))
+ candidates))
+ candidates)))))
+
+(defun company--capf-post-completion (arg)
+ (let* ((res company-capf--current-completion-data)
+ (exit-function (plist-get (nthcdr 4 res) :exit-function))
+ (table (nth 3 res)))
+ (if exit-function
+ ;; We can more or less know when the user is done with completion,
+ ;; so we do something different than `completion--done'.
+ (funcall exit-function arg
+ ;; FIXME: Should probably use an additional heuristic:
+ ;; completion-at-point doesn't know when the user picked a
+ ;; particular candidate explicitly (it only checks whether
+ ;; further completions exist). Whereas company user can press
+ ;; RET (or use implicit completion with company-tng).
+ (if (= (car (completion-boundaries arg table nil ""))
+ (length arg))
+ 'sole
+ 'finished)))))
+
+(provide 'company-capf)
+
+;;; company-capf.el ends here
diff --git a/elpa/company-20220326.48/company-capf.elc b/elpa/company-20220326.48/company-capf.elc
new file mode 100644
index 0000000..2423daa
--- /dev/null
+++ b/elpa/company-20220326.48/company-capf.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-clang.el b/elpa/company-20220326.48/company-clang.el
new file mode 100644
index 0000000..5d8ca5a
--- /dev/null
+++ b/elpa/company-20220326.48/company-clang.el
@@ -0,0 +1,420 @@
+;;; company-clang.el --- company-mode completion backend for Clang -*- lexical-binding: t -*-
+
+;; Copyright (C) 2009-2011, 2013-2021 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+
+;;; Code:
+
+(require 'company)
+(require 'company-template)
+(require 'cl-lib)
+
+(defgroup company-clang nil
+ "Completion backend for Clang."
+ :group 'company)
+
+(defcustom company-clang-executable
+ (executable-find "clang")
+ "Location of clang executable."
+ :type 'file)
+
+(defcustom company-clang-begin-after-member-access t
+ "When non-nil, start automatic completion after member access operators.
+
+Automatic completion starts whenever the current symbol is preceded by
+\".\", \"->\" or \"::\", ignoring `company-minimum-prefix-length'.
+
+If `company-begin-commands' is a list, it should include `c-electric-lt-gt'
+and `c-electric-colon', for automatic completion right after \">\" and
+\":\"."
+ :type 'boolean)
+
+(defcustom company-clang-use-compile-flags-txt nil
+ "When non-nil, use flags from compile_flags.txt if present.
+
+The lines from that files will be appended to `company-clang-arguments'.
+
+And if such file is found, Clang is called from the directory containing
+it. That allows the flags use relative file names within the project."
+ :type 'boolean
+ :safe 'booleanp)
+
+(defcustom company-clang-arguments nil
+ "A list of additional arguments to pass to clang when completing.
+Prefix files (-include ...) can be selected with `company-clang-set-prefix'
+or automatically through a custom `company-clang-prefix-guesser'."
+ :type '(repeat (string :tag "Argument")))
+
+(defcustom company-clang-prefix-guesser 'company-clang-guess-prefix
+ "A function to determine the prefix file for the current buffer."
+ :type '(function :tag "Guesser function" nil))
+
+(defvar company-clang-modes '(c-mode c++-mode objc-mode)
+ "Major modes which clang may complete.")
+
+(defcustom company-clang-insert-arguments t
+ "When non-nil, insert function arguments as a template after completion."
+ :type 'boolean
+ :package-version '(company . "0.8.0"))
+
+;; prefix ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar company-clang--prefix nil)
+
+(defsubst company-clang--guess-pch-file (file)
+ (let ((dir (directory-file-name (file-name-directory file))))
+ (when (equal (file-name-nondirectory dir) "Classes")
+ (setq dir (file-name-directory dir)))
+ (car (directory-files dir t "\\([^.]h\\|[^h]\\).pch\\'" t))))
+
+(defsubst company-clang--file-substring (file beg end)
+ (with-temp-buffer
+ (insert-file-contents-literally file nil beg end)
+ (buffer-string)))
+
+(defun company-clang-guess-prefix ()
+ "Try to guess the prefix file for the current buffer."
+ ;; Prefixes seem to be called .pch. Pre-compiled headers do, too.
+ ;; So we look at the magic number to rule them out.
+ (let* ((file (company-clang--guess-pch-file buffer-file-name))
+ (magic-number (and file (company-clang--file-substring file 0 4))))
+ (unless (member magic-number '("CPCH" "gpch"))
+ file)))
+
+(defun company-clang-set-prefix (&optional prefix)
+ "Use PREFIX as a prefix (-include ...) file for clang completion."
+ (interactive (let ((def (funcall company-clang-prefix-guesser)))
+ (unless (stringp def)
+ (setq def default-directory))
+ (list (read-file-name "Prefix file: "
+ (when def (file-name-directory def))
+ def t (when def (file-name-nondirectory def))))))
+ ;; TODO: pre-compile?
+ (setq company-clang--prefix (and (stringp prefix)
+ (file-regular-p prefix)
+ prefix)))
+
+;; Clean-up on exit.
+(add-hook 'kill-emacs-hook 'company-clang-set-prefix)
+
+;; parsing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; TODO: Handle Pattern (syntactic hints would be neat).
+;; Do we ever see OVERLOAD (or OVERRIDE)?
+(defconst company-clang--completion-pattern
+ "^COMPLETION: \\_<\\(%s[a-zA-Z0-9_:]*\\)\\(?:\\(?: (InBase)\\)? : \\(.*\\)$\\)?$")
+
+(defconst company-clang--error-buffer-name "*clang-error*")
+
+(defun company-clang--lang-option ()
+ (if (eq major-mode 'objc-mode)
+ (if (string= "m" (file-name-extension buffer-file-name))
+ "objective-c" "objective-c++")
+ (substring (symbol-name major-mode) 0 -5)))
+
+(defun company-clang--parse-output (prefix _objc)
+ (goto-char (point-min))
+ (let ((pattern (format company-clang--completion-pattern
+ (regexp-quote prefix)))
+ (case-fold-search nil)
+ (results (make-hash-table :test 'equal :size (/ (point-max) 100)))
+ lines match)
+ (while (re-search-forward pattern nil t)
+ (setq match (match-string-no-properties 1))
+ (unless (equal match "Pattern")
+ (save-match-data
+ (when (string-match ":" match)
+ (setq match (substring match 0 (match-beginning 0)))))
+ (let ((meta (match-string-no-properties 2)))
+ ;; Avoiding duplicates:
+ ;; https://github.com/company-mode/company-mode/issues/841
+ (cond
+ ;; Either meta != completion (not a macro)
+ ((not (equal match meta))
+ (puthash match meta results))
+ ;; Or it's the first time we see this completion
+ ((eq (gethash match results 'none) 'none)
+ (puthash match nil results))))))
+ (maphash
+ (lambda (match meta)
+ (when meta
+ (put-text-property 0 1 'meta (company-clang--strip-formatting meta) match))
+ (push match lines))
+ results)
+ lines))
+
+(defun company-clang--meta (candidate)
+ (get-text-property 0 'meta candidate))
+
+(defun company-clang--annotation (candidate)
+ (let ((ann (company-clang--annotation-1 candidate)))
+ (if (not (and ann (string-prefix-p "(*)" ann)))
+ ann
+ (with-temp-buffer
+ (insert ann)
+ (search-backward ")")
+ (let ((pt (1+ (point))))
+ (re-search-forward ".\\_>" nil t)
+ (delete-region pt (point)))
+ (buffer-string)))))
+
+(defun company-clang--annotation-1 (candidate)
+ (let ((meta (company-clang--meta candidate)))
+ (cond
+ ((null meta) nil)
+ ((string-match "[^:]:[^:]" meta)
+ (substring meta (1+ (match-beginning 0))))
+ ((string-match "(anonymous)" meta) nil)
+ ((string-match "\\((.*)[ a-z]*\\'\\)" meta)
+ (let ((paren (match-beginning 1)))
+ (if (not (eq (aref meta (1- paren)) ?>))
+ (match-string 1 meta)
+ (with-temp-buffer
+ (insert meta)
+ (goto-char paren)
+ (substring meta (1- (search-backward "<"))))))))))
+
+(defun company-clang--strip-formatting (text)
+ (replace-regexp-in-string
+ "#]" " "
+ (replace-regexp-in-string "[<{[]#\\|#[>}]" "" text t)
+ t))
+
+(defun company-clang--handle-error (res args)
+ (goto-char (point-min))
+ (let* ((buf (get-buffer-create company-clang--error-buffer-name))
+ (cmd (concat company-clang-executable " " (mapconcat 'identity args " ")))
+ (pattern (format company-clang--completion-pattern ""))
+ (message-truncate-lines t)
+ (err (if (and (re-search-forward pattern nil t)
+ ;; Something in the Windows build?
+ ;; Looks like Clang doesn't always include the error text
+ ;; before completions (even if exited with error).
+ (> (match-beginning 0) (point-min)))
+ (buffer-substring-no-properties (point-min)
+ (1- (match-beginning 0)))
+ ;; Warn the user more aggressively if no match was found.
+ (message "clang failed with error %d: %s" res cmd)
+ (buffer-string))))
+
+ (with-current-buffer buf
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (insert (current-time-string)
+ (format "\nclang failed with error %d:\n" res)
+ cmd "\n\n")
+ (insert err)
+ (setq buffer-read-only t)
+ (goto-char (point-min))))))
+
+(defun company-clang--start-process (prefix callback &rest args)
+ (let* ((objc (derived-mode-p 'objc-mode))
+ (buf (get-buffer-create "*clang-output*"))
+ ;; Looks unnecessary in Emacs 25.1 and later.
+ ;; (Inconclusive, needs more testing):
+ ;; https://github.com/company-mode/company-mode/pull/288#issuecomment-72491808
+ (process-adaptive-read-buffering nil)
+ (existing-process (get-buffer-process buf)))
+ (when existing-process
+ (kill-process existing-process))
+ (with-current-buffer buf
+ (erase-buffer)
+ (setq buffer-undo-list t))
+ (let* ((process-connection-type nil)
+ (process (apply #'start-file-process "company-clang" buf
+ company-clang-executable args)))
+ (set-process-sentinel
+ process
+ (lambda (proc status)
+ (unless (string-match-p "hangup\\|killed" status)
+ (funcall
+ callback
+ (let ((res (process-exit-status proc)))
+ (with-current-buffer buf
+ (unless (eq 0 res)
+ (company-clang--handle-error res args))
+ ;; Still try to get any useful input.
+ (company-clang--parse-output prefix objc)))))))
+ (unless (company-clang--auto-save-p)
+ (send-region process (point-min) (point-max))
+ (send-string process "\n")
+ (process-send-eof process)))))
+
+(defsubst company-clang--build-location (pos)
+ (save-excursion
+ (goto-char pos)
+ (format "%s:%d:%d"
+ (if (company-clang--auto-save-p) buffer-file-name "-")
+ (line-number-at-pos)
+ (1+ (length
+ (encode-coding-region
+ (line-beginning-position)
+ (point)
+ 'utf-8
+ t))))))
+
+(defsubst company-clang--build-complete-args (pos)
+ (append '("-fsyntax-only" "-Xclang" "-code-completion-macros")
+ (unless (company-clang--auto-save-p)
+ (list "-x" (company-clang--lang-option)))
+ (company-clang--arguments)
+ (when (stringp company-clang--prefix)
+ (list "-include" (expand-file-name company-clang--prefix)))
+ (list "-Xclang" (format "-code-completion-at=%s"
+ (company-clang--build-location pos)))
+ (list (if (company-clang--auto-save-p) buffer-file-name "-"))))
+
+(defun company-clang--arguments ()
+ (let ((fname "compile_flags.txt")
+ (args company-clang-arguments)
+ current-dir-rel)
+ (when company-clang-use-compile-flags-txt
+ (let ((dir (locate-dominating-file default-directory fname)))
+ (when dir
+ (setq current-dir-rel (file-relative-name default-directory dir))
+ (setq default-directory dir)
+ (with-temp-buffer
+ (insert-file-contents fname)
+ (setq args
+ (append
+ args
+ (split-string (buffer-substring-no-properties
+ (point-min) (point-max))
+ "[\n\r]+"
+ t
+ "[ \t]+"))))
+ (unless (equal current-dir-rel "./")
+ (push (format "-I%s" current-dir-rel) args)))))
+ args))
+
+(defun company-clang--candidates (prefix callback)
+ (and (company-clang--auto-save-p)
+ (buffer-modified-p)
+ (basic-save-buffer))
+ (when (null company-clang--prefix)
+ (company-clang-set-prefix (or (funcall company-clang-prefix-guesser)
+ 'none)))
+ (let ((default-directory default-directory))
+ (apply 'company-clang--start-process
+ prefix
+ callback
+ (company-clang--build-complete-args
+ (if (company-clang--check-version 4.0 9.0)
+ (point)
+ (- (point) (length prefix)))))))
+
+(defun company-clang--prefix ()
+ (if company-clang-begin-after-member-access
+ (company-grab-symbol-cons "\\.\\|->\\|::" 2)
+ (company-grab-symbol)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defconst company-clang-required-version 1.1)
+
+(defvar company-clang--version nil)
+
+(defun company-clang--auto-save-p ()
+ (not
+ (company-clang--check-version 2.9 3.1)))
+
+(defun company-clang--check-version (min apple-min)
+ (pcase-exhaustive company-clang--version
+ (`(apple . ,ver) (>= ver apple-min))
+ (`(normal . ,ver) (>= ver min))))
+
+(defsubst company-clang-version ()
+ "Return the version of `company-clang-executable'."
+ (with-temp-buffer
+ (call-process company-clang-executable nil t nil "--version")
+ (goto-char (point-min))
+ (if (re-search-forward
+ "\\(clang\\|Apple LLVM\\|bcc32x\\|bcc64\\) version \\([0-9.]+\\)" nil t)
+ (cons
+ (if (equal (match-string-no-properties 1) "Apple LLVM")
+ 'apple
+ 'normal)
+ (string-to-number (match-string-no-properties 2)))
+ 0)))
+
+(defun company-clang (command &optional arg &rest ignored)
+ "`company-mode' completion backend for Clang.
+Clang is a parser for C and ObjC. Clang version 1.1 or newer is required.
+
+Additional command line arguments can be specified in
+`company-clang-arguments'. Prefix files (-include ...) can be selected
+with `company-clang-set-prefix' or automatically through a custom
+`company-clang-prefix-guesser'.
+
+With Clang versions before 2.9, we have to save the buffer before
+performing completion. With Clang 2.9 and later, buffer contents are
+passed via standard input."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-clang))
+ (init (when (memq major-mode company-clang-modes)
+ (unless company-clang-executable
+ (error "Company found no clang executable"))
+ (setq company-clang--version (company-clang-version))
+ (unless (company-clang--check-version
+ company-clang-required-version
+ company-clang-required-version)
+ (error "Company requires clang version %s"
+ company-clang-required-version))))
+ (prefix (and (memq major-mode company-clang-modes)
+ buffer-file-name
+ company-clang-executable
+ (not (company-in-string-or-comment))
+ (or (company-clang--prefix) 'stop)))
+ (candidates (cons :async
+ (lambda (cb) (company-clang--candidates arg cb))))
+ (meta (company-clang--meta arg))
+ (kind (company-clang--kind arg))
+ (annotation (company-clang--annotation arg))
+ (post-completion (let ((anno (company-clang--annotation arg)))
+ (when (and company-clang-insert-arguments anno)
+ (insert anno)
+ (if (string-match "\\`:[^:]" anno)
+ (company-template-objc-templatify anno)
+ (company-template-c-like-templatify
+ (concat arg anno))))))))
+
+(defun company-clang--kind (arg)
+ ;; XXX: Not very precise.
+ ;; E.g. it will say that an arg-less ObjC method is a variable (perhaps we
+ ;; could look around for brackets, etc, if there any actual users who's
+ ;; bothered by it).
+ ;; And we can't distinguish between local vars and struct fields.
+ ;; Or between keywords and macros.
+ (let ((meta (company-clang--meta arg)))
+ (cond
+ ((null meta) 'keyword)
+ ((string-match "(" meta)
+ (if (string-match-p (format "\\`%s *\\'" (regexp-quote arg))
+ (substring meta 0 (match-beginning 0)))
+ 'keyword ; Also macro, actually (no return type).
+ 'function))
+ (t 'variable))))
+
+(provide 'company-clang)
+;;; company-clang.el ends here
diff --git a/elpa/company-20220326.48/company-clang.elc b/elpa/company-20220326.48/company-clang.elc
new file mode 100644
index 0000000..02645b2
--- /dev/null
+++ b/elpa/company-20220326.48/company-clang.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-cmake.el b/elpa/company-20220326.48/company-cmake.el
new file mode 100644
index 0000000..a072be1
--- /dev/null
+++ b/elpa/company-20220326.48/company-cmake.el
@@ -0,0 +1,207 @@
+;;; company-cmake.el --- company-mode completion backend for CMake
+
+;; Copyright (C) 2013-2015, 2017-2018, 2020 Free Software Foundation, Inc.
+
+;; Author: Chen Bin <chenbin DOT sh AT gmail>
+;; Version: 0.2
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; company-cmake offers completions for module names, variable names and
+;; commands used by CMake. And their descriptions.
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+
+(defgroup company-cmake nil
+ "Completion backend for CMake."
+ :group 'company)
+
+(defcustom company-cmake-executable
+ (executable-find "cmake")
+ "Location of cmake executable."
+ :type 'file)
+
+(defvar company-cmake-executable-arguments
+ '("--help-command-list"
+ "--help-module-list"
+ "--help-property-list"
+ "--help-variable-list")
+ "The arguments we pass to cmake, separately.
+They affect which types of symbols we get completion candidates for.")
+
+(defvar company-cmake--completion-pattern
+ "^\\(%s[a-zA-Z0-9_<>]%s\\)$"
+ "Regexp to match the candidates.")
+
+(defvar company-cmake-modes '(cmake-mode)
+ "Major modes in which cmake may complete.")
+
+(defvar company-cmake--candidates-cache nil
+ "Cache for the raw candidates.")
+
+(defvar company-cmake--meta-command-cache nil
+ "Cache for command arguments to retrieve descriptions for the candidates.")
+
+(defun company-cmake--replace-tags (rlt)
+ (setq rlt (replace-regexp-in-string
+ "\\(.*?\\(IS_GNU\\)?\\)<LANG>\\(.*\\)"
+ (lambda (_match)
+ (mapconcat 'identity
+ (if (match-beginning 2)
+ '("\\1CXX\\3" "\\1C\\3" "\\1G77\\3")
+ '("\\1CXX\\3" "\\1C\\3" "\\1Fortran\\3"))
+ "\n"))
+ rlt t))
+ (setq rlt (replace-regexp-in-string
+ "\\(.*\\)<CONFIG>\\(.*\\)"
+ (mapconcat 'identity '("\\1DEBUG\\2" "\\1RELEASE\\2"
+ "\\1RELWITHDEBINFO\\2" "\\1MINSIZEREL\\2")
+ "\n")
+ rlt))
+ rlt)
+
+(defun company-cmake--fill-candidates-cache (arg)
+ "Fill candidates cache if needed."
+ (let (rlt)
+ (unless company-cmake--candidates-cache
+ (setq company-cmake--candidates-cache (make-hash-table :test 'equal)))
+
+ ;; If hash is empty, fill it.
+ (unless (gethash arg company-cmake--candidates-cache)
+ (with-temp-buffer
+ (let ((res (call-process company-cmake-executable nil t nil arg)))
+ (unless (zerop res)
+ (message "cmake executable exited with error=%d" res)))
+ (setq rlt (buffer-string)))
+ (setq rlt (company-cmake--replace-tags rlt))
+ (puthash arg rlt company-cmake--candidates-cache))
+ ))
+
+(defun company-cmake--parse (prefix content cmd)
+ (let ((start 0)
+ (pattern (format company-cmake--completion-pattern
+ (regexp-quote prefix)
+ (if (zerop (length prefix)) "+" "*")))
+ (lines (split-string content "\n"))
+ match
+ rlt)
+ (dolist (line lines)
+ (when (string-match pattern line)
+ (let ((match (match-string 1 line)))
+ (when match
+ (puthash match cmd company-cmake--meta-command-cache)
+ (push match rlt)))))
+ rlt))
+
+(defun company-cmake--candidates (prefix)
+ (let (results
+ cmd-opts
+ str)
+
+ (unless company-cmake--meta-command-cache
+ (setq company-cmake--meta-command-cache (make-hash-table :test 'equal)))
+
+ (dolist (arg company-cmake-executable-arguments)
+ (company-cmake--fill-candidates-cache arg)
+ (setq cmd-opts (replace-regexp-in-string "-list$" "" arg) )
+
+ (setq str (gethash arg company-cmake--candidates-cache))
+ (when str
+ (setq results (nconc results
+ (company-cmake--parse prefix str cmd-opts)))))
+ results))
+
+(defun company-cmake--unexpand-candidate (candidate)
+ (cond
+ ((string-match "^CMAKE_\\(C\\|CXX\\|Fortran\\)\\(_.*\\)$" candidate)
+ (setq candidate (concat "CMAKE_<LANG>" (match-string 2 candidate))))
+
+ ;; C flags
+ ((string-match "^\\(.*_\\)IS_GNU\\(C\\|CXX\\|G77\\)$" candidate)
+ (setq candidate (concat (match-string 1 candidate) "IS_GNU<LANG>")))
+
+ ;; C flags
+ ((string-match "^\\(.*_\\)OVERRIDE_\\(C\\|CXX\\|Fortran\\)$" candidate)
+ (setq candidate (concat (match-string 1 candidate) "OVERRIDE_<LANG>")))
+
+ ((string-match "^\\(.*\\)\\(_DEBUG\\|_RELEASE\\|_RELWITHDEBINFO\\|_MINSIZEREL\\)\\(.*\\)$" candidate)
+ (setq candidate (concat (match-string 1 candidate)
+ "_<CONFIG>"
+ (match-string 3 candidate)))))
+ candidate)
+
+(defun company-cmake--meta (candidate)
+ (let ((cmd-opts (gethash candidate company-cmake--meta-command-cache))
+ result)
+ (setq candidate (company-cmake--unexpand-candidate candidate))
+
+ ;; Don't cache the documentation of every candidate (command)
+ ;; Cache in this case will cost too much memory.
+ (with-temp-buffer
+ (call-process company-cmake-executable nil t nil cmd-opts candidate)
+ ;; Go to the third line, trim it and return the result.
+ ;; Tested with cmake 2.8.9.
+ (goto-char (point-min))
+ (forward-line 2)
+ (setq result (buffer-substring-no-properties (line-beginning-position)
+ (line-end-position)))
+ (setq result (replace-regexp-in-string "^[ \t\n\r]+" "" result))
+ result)))
+
+(defun company-cmake--doc-buffer (candidate)
+ (let ((cmd-opts (gethash candidate company-cmake--meta-command-cache)))
+
+ (setq candidate (company-cmake--unexpand-candidate candidate))
+ (with-temp-buffer
+ (call-process company-cmake-executable nil t nil cmd-opts candidate)
+ ;; Go to the third line, trim it and return the doc buffer.
+ ;; Tested with cmake 2.8.9.
+ (goto-char (point-min))
+ (forward-line 2)
+ (company-doc-buffer
+ (buffer-substring-no-properties (line-beginning-position)
+ (point-max))))))
+
+(defun company-cmake-prefix-dollar-brace-p ()
+ "Test if the current symbol follows ${."
+ (save-excursion
+ (skip-syntax-backward "w_")
+ (and (eq (char-before (point)) ?\{)
+ (eq (char-before (1- (point))) ?$))))
+
+(defun company-cmake (command &optional arg &rest ignored)
+ "`company-mode' completion backend for CMake.
+CMake is a cross-platform, open-source make system."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-cmake))
+ (init (when (memq major-mode company-cmake-modes)
+ (unless company-cmake-executable
+ (error "Company found no cmake executable"))))
+ (prefix (and (memq major-mode company-cmake-modes)
+ (or (not (company-in-string-or-comment))
+ (company-cmake-prefix-dollar-brace-p))
+ (company-grab-symbol)))
+ (candidates (company-cmake--candidates arg))
+ (meta (company-cmake--meta arg))
+ (doc-buffer (company-cmake--doc-buffer arg))
+ ))
+
+(provide 'company-cmake)
+;;; company-cmake.el ends here
diff --git a/elpa/company-20220326.48/company-cmake.elc b/elpa/company-20220326.48/company-cmake.elc
new file mode 100644
index 0000000..d2faf35
--- /dev/null
+++ b/elpa/company-20220326.48/company-cmake.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-css.el b/elpa/company-20220326.48/company-css.el
new file mode 100644
index 0000000..f5ac7c7
--- /dev/null
+++ b/elpa/company-20220326.48/company-css.el
@@ -0,0 +1,446 @@
+;;; company-css.el --- company-mode completion backend for css-mode -*- lexical-binding: t -*-
+
+;; Copyright (C) 2009-2011, 2013-2015, 2018 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; In Emacs >= 26, company-capf is used instead.
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+
+(declare-function web-mode-language-at-pos "web-mode" (&optional pos))
+
+(defconst company-css-property-alist
+ ;; see http://www.w3.org/TR/CSS21/propidx.html
+ '(("azimuth" angle "left-side" "far-left" "left" "center-left" "center"
+ "center-right" "right" "far-right" "right-side" "behind" "leftwards"
+ "rightwards")
+ ("background" background-color background-image background-repeat
+ background-attachment background-position
+ background-clip background-origin background-size)
+ ("background-attachment" "scroll" "fixed")
+ ("background-color" color "transparent")
+ ("background-image" uri "none")
+ ("background-position" percentage length "left" "center" "right" percentage
+ length "top" "center" "bottom" "left" "center" "right" "top" "center"
+ "bottom")
+ ("background-repeat" "repeat" "repeat-x" "repeat-y" "no-repeat")
+ ("border" border-width border-style border-color)
+ ("border-bottom" border)
+ ("border-bottom-color" border-color)
+ ("border-bottom-style" border-style)
+ ("border-bottom-width" border-width)
+ ("border-collapse" "collapse" "separate")
+ ("border-color" color "transparent")
+ ("border-left" border)
+ ("border-left-color" border-color)
+ ("border-left-style" border-style)
+ ("border-left-width" border-width)
+ ("border-right" border)
+ ("border-right-color" border-color)
+ ("border-right-style" border-style)
+ ("border-right-width" border-width)
+ ("border-spacing" length length)
+ ("border-style" border-style)
+ ("border-top" border)
+ ("border-top-color" border-color)
+ ("border-top-style" border-style)
+ ("border-top-width" border-width)
+ ("border-width" border-width)
+ ("bottom" length percentage "auto")
+ ("caption-side" "top" "bottom")
+ ("clear" "none" "left" "right" "both")
+ ("clip" shape "auto")
+ ("color" color)
+ ("content" "normal" "none" string uri counter "attr()" "open-quote"
+ "close-quote" "no-open-quote" "no-close-quote")
+ ("counter-increment" identifier integer "none")
+ ("counter-reset" identifier integer "none")
+ ("cue" cue-before cue-after)
+ ("cue-after" uri "none")
+ ("cue-before" uri "none")
+ ("cursor" uri "*" "auto" "crosshair" "default" "pointer" "move" "e-resize"
+ "ne-resize" "nw-resize" "n-resize" "se-resize" "sw-resize" "s-resize"
+ "w-resize" "text" "wait" "help" "progress")
+ ("direction" "ltr" "rtl")
+ ("display" "inline" "block" "list-item" "run-in" "inline-block" "table"
+ "inline-table" "table-row-group" "table-header-group" "table-footer-group"
+ "table-row" "table-column-group" "table-column" "table-cell"
+ "table-caption" "none")
+ ("elevation" angle "below" "level" "above" "higher" "lower")
+ ("empty-cells" "show" "hide")
+ ("float" "left" "right" "none")
+ ("font" font-style font-weight font-size "/" line-height
+ font-family "caption" "icon" "menu" "message-box" "small-caption"
+ "status-bar" "normal" "small-caps"
+ ;; CSS3
+ font-stretch)
+ ("font-family" family-name generic-family)
+ ("font-size" absolute-size relative-size length percentage)
+ ("font-style" "normal" "italic" "oblique")
+ ("font-weight" "normal" "bold" "bolder" "lighter" "100" "200" "300" "400"
+ "500" "600" "700" "800" "900")
+ ("height" length percentage "auto")
+ ("left" length percentage "auto")
+ ("letter-spacing" "normal" length)
+ ("line-height" "normal" number length percentage)
+ ("list-style" list-style-type list-style-position list-style-image)
+ ("list-style-image" uri "none")
+ ("list-style-position" "inside" "outside")
+ ("list-style-type" "disc" "circle" "square" "decimal" "decimal-leading-zero"
+ "lower-roman" "upper-roman" "lower-greek" "lower-latin" "upper-latin"
+ "armenian" "georgian" "lower-alpha" "upper-alpha" "none")
+ ("margin" margin-width)
+ ("margin-bottom" margin-width)
+ ("margin-left" margin-width)
+ ("margin-right" margin-width)
+ ("margin-top" margin-width)
+ ("max-height" length percentage "none")
+ ("max-width" length percentage "none")
+ ("min-height" length percentage)
+ ("min-width" length percentage)
+ ("orphans" integer)
+ ("outline" outline-color outline-style outline-width)
+ ("outline-color" color "invert")
+ ("outline-style" border-style)
+ ("outline-width" border-width)
+ ("overflow" "visible" "hidden" "scroll" "auto"
+ ;; CSS3:
+ "no-display" "no-content")
+ ("padding" padding-width)
+ ("padding-bottom" padding-width)
+ ("padding-left" padding-width)
+ ("padding-right" padding-width)
+ ("padding-top" padding-width)
+ ("page-break-after" "auto" "always" "avoid" "left" "right")
+ ("page-break-before" "auto" "always" "avoid" "left" "right")
+ ("page-break-inside" "avoid" "auto")
+ ("pause" time percentage)
+ ("pause-after" time percentage)
+ ("pause-before" time percentage)
+ ("pitch" frequency "x-low" "low" "medium" "high" "x-high")
+ ("pitch-range" number)
+ ("play-during" uri "mix" "repeat" "auto" "none")
+ ("position" "static" "relative" "absolute" "fixed")
+ ("quotes" string string "none")
+ ("richness" number)
+ ("right" length percentage "auto")
+ ("speak" "normal" "none" "spell-out")
+ ("speak-header" "once" "always")
+ ("speak-numeral" "digits" "continuous")
+ ("speak-punctuation" "code" "none")
+ ("speech-rate" number "x-slow" "slow" "medium" "fast" "x-fast" "faster"
+ "slower")
+ ("stress" number)
+ ("table-layout" "auto" "fixed")
+ ("text-align" "left" "right" "center" "justify")
+ ("text-indent" length percentage)
+ ("text-transform" "capitalize" "uppercase" "lowercase" "none")
+ ("top" length percentage "auto")
+ ("unicode-bidi" "normal" "embed" "bidi-override")
+ ("vertical-align" "baseline" "sub" "super" "top" "text-top" "middle"
+ "bottom" "text-bottom" percentage length)
+ ("visibility" "visible" "hidden" "collapse")
+ ("voice-family" specific-voice generic-voice "*" specific-voice
+ generic-voice)
+ ("volume" number percentage "silent" "x-soft" "soft" "medium" "loud"
+ "x-loud")
+ ("white-space" "normal" "pre" "nowrap" "pre-wrap" "pre-line")
+ ("widows" integer)
+ ("width" length percentage "auto")
+ ("word-spacing" "normal" length)
+ ("z-index" "auto" integer)
+ ;; CSS3
+ ("align-content" align-stretch "space-between" "space-around")
+ ("align-items" align-stretch "baseline")
+ ("align-self" align-items "auto")
+ ("animation" animation-name animation-duration animation-timing-function
+ animation-delay animation-iteration-count animation-direction
+ animation-fill-mode)
+ ("animation-delay" time)
+ ("animation-direction" "normal" "reverse" "alternate" "alternate-reverse")
+ ("animation-duration" time)
+ ("animation-fill-mode" "none" "forwards" "backwards" "both")
+ ("animation-iteration-count" integer "infinite")
+ ("animation-name" "none")
+ ("animation-play-state" "paused" "running")
+ ("animation-timing-function" transition-timing-function
+ "step-start" "step-end" "steps(,)")
+ ("backface-visibility" "visible" "hidden")
+ ("background-clip" background-origin)
+ ("background-origin" "border-box" "padding-box" "content-box")
+ ("background-size" length percentage "auto" "cover" "contain")
+ ("border-image" border-image-outset border-image-repeat border-image-source
+ border-image-slice border-image-width)
+ ("border-image-outset" length)
+ ("border-image-repeat" "stretch" "repeat" "round" "space")
+ ("border-image-source" uri "none")
+ ("border-image-slice" length)
+ ("border-image-width" length percentage)
+ ("border-radius" length)
+ ("border-top-left-radius" length)
+ ("border-top-right-radius" length)
+ ("border-bottom-left-radius" length)
+ ("border-bottom-right-radius" length)
+ ("box-decoration-break" "slice" "clone")
+ ("box-shadow" length color)
+ ("box-sizing" "content-box" "border-box")
+ ("break-after" "auto" "always" "avoid" "left" "right" "page" "column"
+ "avoid-page" "avoid-column")
+ ("break-before" break-after)
+ ("break-inside" "avoid" "auto")
+ ("columns" column-width column-count)
+ ("column-count" integer)
+ ("column-fill" "auto" "balance")
+ ("column-gap" length "normal")
+ ("column-rule" column-rule-width column-rule-style column-rule-color)
+ ("column-rule-color" color)
+ ("column-rule-style" border-style)
+ ("column-rule-width" border-width)
+ ("column-span" "all" "none")
+ ("column-width" length "auto")
+ ("filter" url "blur()" "brightness()" "contrast()" "drop-shadow()"
+ "grayscale()" "hue-rotate()" "invert()" "opacity()" "saturate()" "sepia()")
+ ("flex" flex-grow flex-shrink flex-basis)
+ ("flex-basis" percentage length "auto")
+ ("flex-direction" "row" "row-reverse" "column" "column-reverse")
+ ("flex-flow" flex-direction flex-wrap)
+ ("flex-grow" number)
+ ("flex-shrink" number)
+ ("flex-wrap" "nowrap" "wrap" "wrap-reverse")
+ ("font-feature-setting" normal string number)
+ ("font-kerning" "auto" "normal" "none")
+ ("font-language-override" "normal" string)
+ ("font-size-adjust" "none" number)
+ ("font-stretch" "normal" "ultra-condensed" "extra-condensed" "condensed"
+ "semi-condensed" "semi-expanded" "expanded" "extra-expanded" "ultra-expanded")
+ ("font-synthesis" "none" "weight" "style")
+ ("font-variant" font-variant-alternates font-variant-caps
+ font-variant-east-asian font-variant-ligatures font-variant-numeric
+ font-variant-position)
+ ("font-variant-alternates" "normal" "historical-forms" "stylistic()"
+ "styleset()" "character-variant()" "swash()" "ornaments()" "annotation()")
+ ("font-variant-caps" "normal" "small-caps" "all-small-caps" "petite-caps"
+ "all-petite-caps" "unicase" "titling-caps")
+ ("font-variant-east-asian" "jis78" "jis83" "jis90" "jis04" "simplified"
+ "traditional" "full-width" "proportional-width" "ruby")
+ ("font-variant-ligatures" "normal" "none" "common-ligatures"
+ "no-common-ligatures" "discretionary-ligatures" "no-discretionary-ligatures"
+ "historical-ligatures" "no-historical-ligatures" "contextual" "no-contextual")
+ ("font-variant-numeric" "normal" "ordinal" "slashed-zero"
+ "lining-nums" "oldstyle-nums" "proportional-nums" "tabular-nums"
+ "diagonal-fractions" "stacked-fractions")
+ ("font-variant-position" "normal" "sub" "super")
+ ("hyphens" "none" "manual" "auto")
+ ("justify-content" align-common "space-between" "space-around")
+ ("line-break" "auto" "loose" "normal" "strict")
+ ("marquee-direction" "forward" "reverse")
+ ("marquee-play-count" integer "infinite")
+ ("marquee-speed" "slow" "normal" "fast")
+ ("marquee-style" "scroll" "slide" "alternate")
+ ("opacity" number)
+ ("order" number)
+ ("outline-offset" length)
+ ("overflow-x" overflow)
+ ("overflow-y" overflow)
+ ("overflow-style" "auto" "marquee-line" "marquee-block")
+ ("overflow-wrap" "normal" "break-word")
+ ("perspective" "none" length)
+ ("perspective-origin" percentage length "left" "center" "right" "top" "bottom")
+ ("resize" "none" "both" "horizontal" "vertical")
+ ("tab-size" integer length)
+ ("text-align-last" "auto" "start" "end" "left" "right" "center" "justify")
+ ("text-decoration" text-decoration-color text-decoration-line text-decoration-style)
+ ("text-decoration-color" color)
+ ("text-decoration-line" "none" "underline" "overline" "line-through" "blink")
+ ("text-decoration-style" "solid" "double" "dotted" "dashed" "wavy")
+ ("text-overflow" "clip" "ellipsis")
+ ("text-shadow" color length)
+ ("text-underline-position" "auto" "under" "left" "right")
+ ("transform" "matrix(,,,,,)" "translate(,)" "translateX()" "translateY()"
+ "scale()" "scaleX()" "scaleY()" "rotate()" "skewX()" "skewY()" "none")
+ ("transform-origin" perspective-origin)
+ ("transform-style" "flat" "preserve-3d")
+ ("transition" transition-property transition-duration
+ transition-timing-function transition-delay)
+ ("transition-delay" time)
+ ("transition-duration" time)
+ ("transition-timing-function"
+ "ease" "linear" "ease-in" "ease-out" "ease-in-out" "cubic-bezier(,,,)")
+ ("transition-property" "none" "all" identifier)
+ ("word-wrap" overflow-wrap)
+ ("word-break" "normal" "break-all" "keep-all"))
+ "A list of CSS properties and their possible values.")
+
+(defconst company-css-value-classes
+ '((absolute-size "xx-small" "x-small" "small" "medium" "large" "x-large"
+ "xx-large")
+ (align-common "flex-start" "flex-end" "center")
+ (align-stretch align-common "stretch")
+ (border-style "none" "hidden" "dotted" "dashed" "solid" "double" "groove"
+ "ridge" "inset" "outset")
+ (border-width "thick" "medium" "thin")
+ (color "aqua" "black" "blue" "fuchsia" "gray" "green" "lime" "maroon" "navy"
+ "olive" "orange" "purple" "red" "silver" "teal" "white" "yellow")
+ (counter "counter(,)")
+ (family-name "Courier" "Helvetica" "Times")
+ (generic-family "serif" "sans-serif" "cursive" "fantasy" "monospace")
+ (generic-voice "male" "female" "child")
+ (margin-width "auto") ;; length percentage
+ (relative-size "larger" "smaller")
+ (shape "rect(,,,)")
+ (uri "url()"))
+ "A list of CSS property value classes and their contents.")
+;; missing, because not completable
+;; <angle><frequency><identifier><integer><length><number><padding-width>
+;; <percentage><specific-voice><string><time><uri>
+
+(defconst company-css-html-tags
+ '("a" "abbr" "acronym" "address" "applet" "area" "b" "base" "basefont" "bdo"
+ "big" "blockquote" "body" "br" "button" "caption" "center" "cite" "code"
+ "col" "colgroup" "dd" "del" "dfn" "dir" "div" "dl" "dt" "em" "fieldset"
+ "font" "form" "frame" "frameset" "h1" "h2" "h3" "h4" "h5" "h6" "head" "hr"
+ "html" "i" "iframe" "img" "input" "ins" "isindex" "kbd" "label" "legend"
+ "li" "link" "map" "menu" "meta" "noframes" "noscript" "object" "ol"
+ "optgroup" "option" "p" "param" "pre" "q" "s" "samp" "script" "select"
+ "small" "span" "strike" "strong" "style" "sub" "sup" "table" "tbody" "td"
+ "textarea" "tfoot" "th" "thead" "title" "tr" "tt" "u" "ul" "var"
+ ;; HTML5
+ "section" "article" "aside" "header" "footer" "nav" "figure" "figcaption"
+ "time" "mark" "main")
+ "A list of HTML tags for use in CSS completion.")
+
+(defconst company-css-pseudo-classes
+ '("active" "after" "before" "first" "first-child" "first-letter" "first-line"
+ "focus" "hover" "lang" "left" "link" "right" "visited")
+ "Identifiers for CSS pseudo-elements and pseudo-classes.")
+
+(defconst company-css-property-cache (make-hash-table :size 115 :test 'equal))
+
+(defun company-css-property-values (attribute)
+ "Access the `company-css-property-alist' cached and flattened."
+ (or (gethash attribute company-css-property-cache)
+ (let (results)
+ (dolist (value (cdr (assoc attribute company-css-property-alist)))
+ (if (symbolp value)
+ (dolist (child (or (cdr (assoc value company-css-value-classes))
+ (company-css-property-values
+ (symbol-name value))))
+ (push child results))
+ (push value results)))
+ (setq results (sort results 'string<))
+ (puthash attribute
+ (if (fboundp 'delete-consecutive-dups)
+ (delete-consecutive-dups results)
+ (delete-dups results))
+ company-css-property-cache)
+ results)))
+
+;;; bracket detection
+
+(defconst company-css-braces-syntax-table
+ (let ((table (make-syntax-table)))
+ (setf (aref table ?{) '(4 . 125))
+ (setf (aref table ?}) '(5 . 123))
+ table)
+ "A syntax table giving { and } paren syntax.")
+
+(defun company-css-inside-braces-p ()
+ "Return non-nil, if point is within matched { and }."
+ (ignore-errors
+ (with-syntax-table company-css-braces-syntax-table
+ (let ((parse-sexp-ignore-comments t))
+ (scan-lists (point) -1 1)))))
+
+;;; tags
+(defconst company-css-tag-regexp
+ (concat "\\(?:\\`\\|}\\)[[:space:]]*"
+ ;; multiple
+ "\\(?:"
+ ;; previous tags:
+ "\\(?:#\\|\\_<[[:alpha:]]\\)[[:alnum:]-#]*\\(?:\\[[^]]*\\]\\)?"
+ ;; space or selectors
+ "\\(?:[[:space:]]+\\|[[:space:]]*[+,>][[:space:]]*\\)"
+ "\\)*"
+ "\\(\\(?:#\\|\\_<[[:alpha:]]\\)\\(?:[[:alnum:]-#]*\\_>\\)?\\_>\\|\\)"
+ "\\=")
+ "A regular expression matching CSS tags.")
+
+;;; pseudo id
+(defconst company-css-pseudo-regexp
+ (concat "\\(?:\\`\\|}\\)[[:space:]]*"
+ ;; multiple
+ "\\(?:"
+ ;; previous tags:
+ "\\(?:#\\|\\_<[[:alpha:]]\\)[[:alnum:]-#]*\\(?:\\[[^]]*\\]\\)?"
+ ;; space or delimiters
+ "\\(?:[[:space:]]+\\|[[:space:]]*[+,>][[:space:]]*\\)"
+ "\\)*"
+ "\\(?:\\(?:\\#\\|\\_<[[:alpha:]]\\)[[:alnum:]-#]*\\):"
+ "\\([[:alpha:]-]+\\_>\\|\\)\\_>\\=")
+ "A regular expression matching CSS pseudo classes.")
+
+;;; properties
+
+(defun company-css-grab-property ()
+ "Return the CSS property before point, if any.
+Returns \"\" if no property found, but feasible at this position."
+ (when (company-css-inside-braces-p)
+ (company-grab-symbol)))
+
+;;; values
+(defconst company-css-property-value-regexp
+ "\\_<\\([[:alpha:]-]+\\):\\(?:[^{};]*[[:space:]]+\\)?\\([^{};]*\\_>\\|\\)\\="
+ "A regular expression matching CSS tags.")
+
+;;;###autoload
+(defun company-css (command &optional arg &rest ignored)
+ "`company-mode' completion backend for `css-mode'."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-css))
+ (prefix (and (or (derived-mode-p 'css-mode)
+ (and (derived-mode-p 'web-mode)
+ (string= (web-mode-language-at-pos) "css")))
+ (or (company-grab company-css-tag-regexp 1)
+ (company-grab company-css-pseudo-regexp 1)
+ (company-grab company-css-property-value-regexp 2
+ (line-beginning-position))
+ (company-css-grab-property))))
+ (candidates
+ (cond
+ ((company-grab company-css-tag-regexp 1)
+ (all-completions arg company-css-html-tags))
+ ((company-grab company-css-pseudo-regexp 1)
+ (all-completions arg company-css-pseudo-classes))
+ ((company-grab company-css-property-value-regexp 2
+ (line-beginning-position))
+ (all-completions arg
+ (company-css-property-values
+ (company-grab company-css-property-value-regexp 1))))
+ ((company-css-grab-property)
+ (all-completions arg company-css-property-alist))))
+ (sorted t)))
+
+(provide 'company-css)
+;;; company-css.el ends here
diff --git a/elpa/company-20220326.48/company-css.elc b/elpa/company-20220326.48/company-css.elc
new file mode 100644
index 0000000..115607b
--- /dev/null
+++ b/elpa/company-20220326.48/company-css.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-dabbrev-code.el b/elpa/company-20220326.48/company-dabbrev-code.el
new file mode 100644
index 0000000..e1d2bf0
--- /dev/null
+++ b/elpa/company-20220326.48/company-dabbrev-code.el
@@ -0,0 +1,105 @@
+;;; company-dabbrev-code.el --- dabbrev-like company-mode backend for code -*- lexical-binding: t -*-
+
+;; Copyright (C) 2009-2011, 2013-2016, 2021 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+
+;;; Code:
+
+(require 'company)
+(require 'company-dabbrev)
+(require 'cl-lib)
+
+(defgroup company-dabbrev-code nil
+ "dabbrev-like completion backend for code."
+ :group 'company)
+
+(defcustom company-dabbrev-code-modes
+ '(prog-mode
+ batch-file-mode csharp-mode css-mode erlang-mode haskell-mode jde-mode
+ lua-mode python-mode)
+ "Modes that use `company-dabbrev-code'.
+In all these modes (and their derivatives) `company-dabbrev-code' will
+complete only symbols, not text in comments or strings. In other modes
+`company-dabbrev-code' will pass control to other backends
+\(e.g. `company-dabbrev'\). Value t means complete in all modes."
+ :type '(choice (repeat :tag "Some modes" (symbol :tag "Major mode"))
+ (const :tag "All modes" t)))
+
+(defcustom company-dabbrev-code-other-buffers t
+ "Determines whether `company-dabbrev-code' should search other buffers.
+If `all', search all other buffers, except the ignored ones. If t, search
+buffers with the same major mode. If `code', search all buffers with major
+modes in `company-dabbrev-code-modes', or derived from one of them. See
+also `company-dabbrev-code-time-limit'."
+ :type '(choice (const :tag "Off" nil)
+ (const :tag "Same major mode" t)
+ (const :tag "Code major modes" code)
+ (const :tag "All" all)))
+
+(defcustom company-dabbrev-code-time-limit .1
+ "Determines how long `company-dabbrev-code' should look for matches."
+ :type '(choice (const :tag "Off" nil)
+ (number :tag "Seconds")))
+
+(defcustom company-dabbrev-code-everywhere nil
+ "Non-nil to offer completions in comments and strings."
+ :type 'boolean)
+
+(defcustom company-dabbrev-code-ignore-case nil
+ "Non-nil to ignore case when collecting completion candidates."
+ :type 'boolean)
+
+(defun company-dabbrev-code--make-regexp (prefix)
+ (concat "\\_<" (if (equal prefix "")
+ "\\([a-zA-Z]\\|\\s_\\)"
+ (regexp-quote prefix))
+ "\\(\\sw\\|\\s_\\)*\\_>"))
+
+;;;###autoload
+(defun company-dabbrev-code (command &optional arg &rest ignored)
+ "dabbrev-like `company-mode' backend for code.
+The backend looks for all symbols in the current buffer that aren't in
+comments or strings."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-dabbrev-code))
+ (prefix (and (or (eq t company-dabbrev-code-modes)
+ (apply #'derived-mode-p company-dabbrev-code-modes))
+ (or company-dabbrev-code-everywhere
+ (not (company-in-string-or-comment)))
+ (or (company-grab-symbol) 'stop)))
+ (candidates (let ((case-fold-search company-dabbrev-code-ignore-case))
+ (company-dabbrev--search
+ (company-dabbrev-code--make-regexp arg)
+ company-dabbrev-code-time-limit
+ (pcase company-dabbrev-code-other-buffers
+ (`t (list major-mode))
+ (`code company-dabbrev-code-modes)
+ (`all `all))
+ (not company-dabbrev-code-everywhere))))
+ (kind 'text)
+ (ignore-case company-dabbrev-code-ignore-case)
+ (duplicates t)))
+
+(provide 'company-dabbrev-code)
+;;; company-dabbrev-code.el ends here
diff --git a/elpa/company-20220326.48/company-dabbrev-code.elc b/elpa/company-20220326.48/company-dabbrev-code.elc
new file mode 100644
index 0000000..b8a7f83
--- /dev/null
+++ b/elpa/company-20220326.48/company-dabbrev-code.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-dabbrev.el b/elpa/company-20220326.48/company-dabbrev.el
new file mode 100644
index 0000000..3b8268c
--- /dev/null
+++ b/elpa/company-20220326.48/company-dabbrev.el
@@ -0,0 +1,207 @@
+;;; company-dabbrev.el --- dabbrev-like company-mode completion backend -*- lexical-binding: t -*-
+
+;; Copyright (C) 2009-2011, 2013-2018, 2021 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+
+(defgroup company-dabbrev nil
+ "dabbrev-like completion backend."
+ :group 'company)
+
+(defcustom company-dabbrev-other-buffers 'all
+ "Determines whether `company-dabbrev' should search other buffers.
+If `all', search all other buffers, except the ignored ones. If t, search
+buffers with the same major mode. See also `company-dabbrev-time-limit'."
+ :type '(choice (const :tag "Off" nil)
+ (const :tag "Same major mode" t)
+ (const :tag "All" all)))
+
+(defcustom company-dabbrev-ignore-buffers "\\`[ *]"
+ "Regexp matching the names of buffers to ignore.
+Or a function that returns non-nil for such buffers."
+ :type '(choice (regexp :tag "Regexp")
+ (function :tag "Predicate"))
+ :package-version '(company . "0.9.0"))
+
+(defcustom company-dabbrev-time-limit .1
+ "Determines how many seconds `company-dabbrev' should look for matches."
+ :type '(choice (const :tag "Off" nil)
+ (number :tag "Seconds")))
+
+(defcustom company-dabbrev-char-regexp "\\sw"
+ "A regular expression matching the characters `company-dabbrev' looks for."
+ :type 'regexp)
+
+(defcustom company-dabbrev-ignore-case 'keep-prefix
+ "Non-nil to ignore case when collecting completion candidates.
+When it's `keep-prefix', the text before point will remain unchanged after
+candidate is inserted, even some of its characters have different case."
+ :type '(choice
+ (const :tag "Don't ignore case" nil)
+ (const :tag "Ignore case" t)
+ (const :tag "Keep case before point" keep-prefix)))
+
+(defcustom company-dabbrev-downcase 'case-replace
+ "Whether to downcase the returned candidates.
+
+The value of nil means keep them as-is.
+`case-replace' means use the value of `case-replace'.
+Any other value means downcase.
+
+If you set this value to nil, you may also want to set
+`company-dabbrev-ignore-case' to any value other than `keep-prefix'."
+ :type '(choice
+ (const :tag "Keep as-is" nil)
+ (const :tag "Downcase" t)
+ (const :tag "Use case-replace" case-replace)))
+
+(defcustom company-dabbrev-minimum-length 4
+ "The minimum length for the completion candidate to be included.
+This variable affects both `company-dabbrev' and `company-dabbrev-code'."
+ :type 'integer
+ :package-version '(company . "0.8.3"))
+
+(defcustom company-dabbrev-ignore-invisible nil
+ "Non-nil to skip invisible text."
+ :type 'boolean
+ :package-version '(company . "0.9.0"))
+
+(defmacro company-dabbrev--time-limit-while (test start limit freq &rest body)
+ (declare (indent 3) (debug t))
+ `(let ((company-time-limit-while-counter 0))
+ (catch 'done
+ (while ,test
+ ,@body
+ (and ,limit
+ (= (cl-incf company-time-limit-while-counter) ,freq)
+ (setq company-time-limit-while-counter 0)
+ (> (float-time (time-since ,start)) ,limit)
+ (throw 'done 'company-time-out))))))
+
+(defun company-dabbrev--make-regexp ()
+ (concat "\\(?:" company-dabbrev-char-regexp "\\)+"))
+
+(defun company-dabbrev--search-buffer (regexp pos symbols start limit
+ ignore-comments)
+ (save-excursion
+ (cl-labels ((maybe-collect-match
+ ()
+ (let ((match (match-string-no-properties 0)))
+ (when (and (>= (length match) company-dabbrev-minimum-length)
+ (not (and company-dabbrev-ignore-invisible
+ (invisible-p (match-beginning 0)))))
+ (push match symbols)))))
+ (goto-char (if pos (1- pos) (point-min)))
+ ;; Search before pos.
+ (let ((tmp-end (point)))
+ (company-dabbrev--time-limit-while (and (not (input-pending-p))
+ (> tmp-end (point-min)))
+ start limit 1
+ (ignore-errors
+ (forward-char -10000))
+ (forward-line 0)
+ (save-excursion
+ ;; Before, we used backward search, but it matches non-greedily, and
+ ;; that forced us to use the "beginning/end of word" anchors in
+ ;; `company-dabbrev--make-regexp'. It's also about 2x slower.
+ (while (and (not (input-pending-p))
+ (re-search-forward regexp tmp-end t))
+ (if (and ignore-comments (save-match-data (company-in-string-or-comment)))
+ (re-search-forward "\\s>\\|\\s!\\|\\s\"" tmp-end t)
+ (maybe-collect-match))))
+ (setq tmp-end (point))))
+ (goto-char (or pos (point-min)))
+ ;; Search after pos.
+ (company-dabbrev--time-limit-while (and (not (input-pending-p))
+ (re-search-forward regexp nil t))
+ start limit 25
+ (if (and ignore-comments (save-match-data (company-in-string-or-comment)))
+ (re-search-forward "\\s>\\|\\s!\\|\\s\"" nil t)
+ (maybe-collect-match)))
+ symbols)))
+
+(defun company-dabbrev--search (regexp &optional limit other-buffer-modes
+ ignore-comments)
+ (let* ((start (current-time))
+ (symbols (company-dabbrev--search-buffer regexp (point) nil start limit
+ ignore-comments)))
+ (when other-buffer-modes
+ (cl-dolist (buffer (delq (current-buffer) (buffer-list)))
+ (unless (if (stringp company-dabbrev-ignore-buffers)
+ (string-match-p company-dabbrev-ignore-buffers
+ (buffer-name buffer))
+ (funcall company-dabbrev-ignore-buffers buffer))
+ (with-current-buffer buffer
+ (when (or (eq other-buffer-modes 'all)
+ (apply #'derived-mode-p other-buffer-modes))
+ (setq symbols
+ (company-dabbrev--search-buffer regexp nil symbols start
+ limit ignore-comments)))))
+ (and limit
+ (> (float-time (time-since start)) limit)
+ (cl-return))))
+ symbols))
+
+(defun company-dabbrev--prefix ()
+ ;; Not in the middle of a word.
+ (unless (looking-at company-dabbrev-char-regexp)
+ ;; Emacs can't do greedy backward-search.
+ (company-grab-line (format "\\(?:^\\| \\)[^ ]*?\\(\\(?:%s\\)*\\)"
+ company-dabbrev-char-regexp)
+ 1)))
+
+(defun company-dabbrev--filter (prefix candidates)
+ (let ((completion-ignore-case company-dabbrev-ignore-case))
+ (all-completions prefix candidates)))
+
+;;;###autoload
+(defun company-dabbrev (command &optional arg &rest ignored)
+ "dabbrev-like `company-mode' completion backend."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-dabbrev))
+ (prefix (company-dabbrev--prefix))
+ (candidates
+ (let* ((case-fold-search company-dabbrev-ignore-case)
+ (words (company-dabbrev--search (company-dabbrev--make-regexp)
+ company-dabbrev-time-limit
+ (pcase company-dabbrev-other-buffers
+ (`t (list major-mode))
+ (`all `all))))
+ (downcase-p (if (eq company-dabbrev-downcase 'case-replace)
+ case-replace
+ company-dabbrev-downcase)))
+ (setq words (company-dabbrev--filter arg words))
+ (if downcase-p
+ (mapcar 'downcase words)
+ words)))
+ (kind 'text)
+ (ignore-case company-dabbrev-ignore-case)
+ (duplicates t)))
+
+(provide 'company-dabbrev)
+;;; company-dabbrev.el ends here
diff --git a/elpa/company-20220326.48/company-dabbrev.elc b/elpa/company-20220326.48/company-dabbrev.elc
new file mode 100644
index 0000000..5b6864a
--- /dev/null
+++ b/elpa/company-20220326.48/company-dabbrev.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-elisp.el b/elpa/company-20220326.48/company-elisp.el
new file mode 100644
index 0000000..23fe6af
--- /dev/null
+++ b/elpa/company-20220326.48/company-elisp.el
@@ -0,0 +1,226 @@
+;;; company-elisp.el --- company-mode completion backend for Emacs Lisp -*- lexical-binding: t -*-
+
+;; Copyright (C) 2009-2015, 2017, 2020 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+;; In newer versions of Emacs, company-capf is used instead.
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+(require 'help-mode)
+(require 'find-func)
+
+(defgroup company-elisp nil
+ "Completion backend for Emacs Lisp."
+ :group 'company)
+
+(defcustom company-elisp-detect-function-context t
+ "If enabled, offer Lisp functions only in appropriate contexts.
+Functions are offered for completion only after \\=' and \(."
+ :type '(choice (const :tag "Off" nil)
+ (const :tag "On" t)))
+
+(defcustom company-elisp-show-locals-first t
+ "If enabled, locally bound variables and functions are displayed
+first in the candidates list."
+ :type '(choice (const :tag "Off" nil)
+ (const :tag "On" t)))
+
+(defun company-elisp--prefix ()
+ (let ((prefix (company-grab-symbol)))
+ (if prefix
+ (when (if (company-in-string-or-comment)
+ (= (char-before (- (point) (length prefix))) ?`)
+ (company-elisp--should-complete))
+ prefix)
+ 'stop)))
+
+(defun company-elisp--predicate (symbol)
+ (or (boundp symbol)
+ (fboundp symbol)
+ (facep symbol)
+ (featurep symbol)))
+
+(defun company-elisp--fns-regexp (&rest names)
+ (concat "\\_<\\(?:cl-\\)?" (regexp-opt names) "\\*?\\_>"))
+
+(defvar company-elisp-parse-limit 30)
+(defvar company-elisp-parse-depth 100)
+
+(defvar company-elisp-defun-names '("defun" "defmacro" "defsubst"))
+
+(defvar company-elisp-var-binding-regexp
+ (apply #'company-elisp--fns-regexp "let" "lambda" "lexical-let"
+ company-elisp-defun-names)
+ "Regular expression matching head of a multiple variable bindings form.")
+
+(defvar company-elisp-var-binding-regexp-1
+ (company-elisp--fns-regexp "dolist" "dotimes")
+ "Regular expression matching head of a form with one variable binding.")
+
+(defvar company-elisp-fun-binding-regexp
+ (company-elisp--fns-regexp "flet" "labels")
+ "Regular expression matching head of a function bindings form.")
+
+(defvar company-elisp-defuns-regexp
+ (concat "([ \t\n]*"
+ (apply #'company-elisp--fns-regexp company-elisp-defun-names)))
+
+(defun company-elisp--should-complete ()
+ (let ((start (point))
+ (depth (car (syntax-ppss))))
+ (not
+ (when (> depth 0)
+ (save-excursion
+ (up-list (- depth))
+ (when (looking-at company-elisp-defuns-regexp)
+ (forward-char)
+ (forward-sexp 1)
+ (unless (= (point) start)
+ (condition-case nil
+ (let ((args-end (scan-sexps (point) 2)))
+ (or (null args-end)
+ (> args-end start)))
+ (scan-error
+ t)))))))))
+
+(defun company-elisp--locals (prefix functions-p)
+ (let ((regexp (concat "[ \t\n]*\\(\\_<" (regexp-quote prefix)
+ "\\(?:\\sw\\|\\s_\\)*\\_>\\)"))
+ (pos (point))
+ res)
+ (condition-case nil
+ (save-excursion
+ (dotimes (_ company-elisp-parse-depth)
+ (up-list -1)
+ (save-excursion
+ (when (eq (char-after) ?\()
+ (forward-char 1)
+ (when (ignore-errors
+ (save-excursion (forward-list)
+ (<= (point) pos)))
+ (skip-chars-forward " \t\n")
+ (cond
+ ((looking-at (if functions-p
+ company-elisp-fun-binding-regexp
+ company-elisp-var-binding-regexp))
+ (down-list 1)
+ (condition-case nil
+ (dotimes (_ company-elisp-parse-limit)
+ (save-excursion
+ (when (looking-at "[ \t\n]*(")
+ (down-list 1))
+ (when (looking-at regexp)
+ (cl-pushnew (match-string-no-properties 1) res)))
+ (forward-sexp))
+ (scan-error nil)))
+ ((unless functions-p
+ (looking-at company-elisp-var-binding-regexp-1))
+ (down-list 1)
+ (when (looking-at regexp)
+ (cl-pushnew (match-string-no-properties 1) res)))))))))
+ (scan-error nil))
+ res))
+
+(defun company-elisp-candidates (prefix)
+ (let* ((predicate (company-elisp--candidates-predicate prefix))
+ (locals (company-elisp--locals prefix (eq predicate 'fboundp)))
+ (globals (company-elisp--globals prefix predicate))
+ (locals (cl-loop for local in locals
+ when (not (member local globals))
+ collect local)))
+ (if company-elisp-show-locals-first
+ (append (sort locals 'string<)
+ (sort globals 'string<))
+ (append locals globals))))
+
+(defun company-elisp--globals (prefix predicate)
+ (all-completions prefix obarray predicate))
+
+(defun company-elisp--candidates-predicate (prefix)
+ (let* ((completion-ignore-case nil)
+ (beg (- (point) (length prefix)))
+ (before (char-before beg)))
+ (if (and company-elisp-detect-function-context
+ (not (memq before '(?' ?`))))
+ (if (and (eq before ?\()
+ (not
+ (save-excursion
+ (ignore-errors
+ (goto-char (1- beg))
+ (or (company-elisp--before-binding-varlist-p)
+ (progn
+ (up-list -1)
+ (company-elisp--before-binding-varlist-p)))))))
+ 'fboundp
+ 'boundp)
+ 'company-elisp--predicate)))
+
+(defun company-elisp--before-binding-varlist-p ()
+ (save-excursion
+ (and (prog1 (search-backward "(")
+ (forward-char 1))
+ (looking-at company-elisp-var-binding-regexp))))
+
+(defun company-elisp--doc (symbol)
+ (let* ((symbol (intern symbol))
+ (doc (if (fboundp symbol)
+ (documentation symbol t)
+ (documentation-property symbol 'variable-documentation t))))
+ (and (stringp doc)
+ (string-match ".*$" doc)
+ (match-string 0 doc))))
+
+;;;###autoload
+(defun company-elisp (command &optional arg &rest ignored)
+ "`company-mode' completion backend for Emacs Lisp."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-elisp))
+ (prefix (and (derived-mode-p 'emacs-lisp-mode 'inferior-emacs-lisp-mode)
+ (company-elisp--prefix)))
+ (candidates (company-elisp-candidates arg))
+ (sorted company-elisp-show-locals-first)
+ (meta (company-elisp--doc arg))
+ (doc-buffer (let ((symbol (intern arg)))
+ (save-window-excursion
+ (ignore-errors
+ (cond
+ ((fboundp symbol) (describe-function symbol))
+ ((boundp symbol) (describe-variable symbol))
+ ((featurep symbol) (describe-package symbol))
+ ((facep symbol) (describe-face symbol))
+ (t (signal 'user-error nil)))
+ (help-buffer)))))
+ (location (let ((sym (intern arg)))
+ (cond
+ ((fboundp sym) (find-definition-noselect sym nil))
+ ((boundp sym) (find-definition-noselect sym 'defvar))
+ ((featurep sym) (cons (find-file-noselect (find-library-name
+ (symbol-name sym)))
+ 0))
+ ((facep sym) (find-definition-noselect sym 'defface)))))))
+
+(provide 'company-elisp)
+;;; company-elisp.el ends here
diff --git a/elpa/company-20220326.48/company-elisp.elc b/elpa/company-20220326.48/company-elisp.elc
new file mode 100644
index 0000000..aaecdb0
--- /dev/null
+++ b/elpa/company-20220326.48/company-elisp.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-etags.el b/elpa/company-20220326.48/company-etags.el
new file mode 100644
index 0000000..0bd093a
--- /dev/null
+++ b/elpa/company-20220326.48/company-etags.el
@@ -0,0 +1,108 @@
+;;; company-etags.el --- company-mode completion backend for etags
+
+;; Copyright (C) 2009-2011, 2013-2015, 2018-2019 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+(require 'etags)
+
+(defgroup company-etags nil
+ "Completion backend for etags."
+ :group 'company)
+
+(defcustom company-etags-use-main-table-list t
+ "Always search `tags-table-list' if set.
+If this is disabled, `company-etags' will try to find the one table for each
+buffer automatically."
+ :type '(choice (const :tag "off" nil)
+ (const :tag "on" t)))
+
+(defcustom company-etags-ignore-case nil
+ "Non-nil to ignore case in completion candidates."
+ :type 'boolean
+ :package-version '(company . "0.7.3"))
+
+(defcustom company-etags-everywhere nil
+ "Non-nil to offer completions in comments and strings.
+Set it to t or to a list of major modes."
+ :type '(choice (const :tag "Off" nil)
+ (const :tag "Any supported mode" t)
+ (repeat :tag "Some major modes"
+ (symbol :tag "Major mode")))
+ :package-version '(company . "0.9.0"))
+
+(defvar company-etags-modes '(prog-mode c-mode objc-mode c++-mode java-mode
+ jde-mode pascal-mode perl-mode python-mode))
+
+(defvar-local company-etags-buffer-table 'unknown)
+
+(defun company-etags-find-table ()
+ (let ((file (expand-file-name
+ "TAGS"
+ (locate-dominating-file (or buffer-file-name
+ default-directory)
+ "TAGS"))))
+ (when (and file (file-regular-p file))
+ (list file))))
+
+(defun company-etags-buffer-table ()
+ (or (and company-etags-use-main-table-list tags-table-list)
+ (if (eq company-etags-buffer-table 'unknown)
+ (setq company-etags-buffer-table (company-etags-find-table))
+ company-etags-buffer-table)))
+
+(defun company-etags--candidates (prefix)
+ (let ((tags-table-list (company-etags-buffer-table))
+ (tags-file-name tags-file-name)
+ (completion-ignore-case company-etags-ignore-case))
+ (and (or tags-file-name tags-table-list)
+ (fboundp 'tags-completion-table)
+ (save-excursion
+ (visit-tags-table-buffer)
+ (all-completions prefix (tags-completion-table))))))
+
+;;;###autoload
+(defun company-etags (command &optional arg &rest ignored)
+ "`company-mode' completion backend for etags."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-etags))
+ (prefix (and (apply #'derived-mode-p company-etags-modes)
+ (or (eq t company-etags-everywhere)
+ (apply #'derived-mode-p company-etags-everywhere)
+ (not (company-in-string-or-comment)))
+ (company-etags-buffer-table)
+ (or (company-grab-symbol) 'stop)))
+ (candidates (company-etags--candidates arg))
+ (location (let ((tags-table-list (company-etags-buffer-table)))
+ (when (fboundp 'find-tag-noselect)
+ (save-excursion
+ (let ((buffer (find-tag-noselect arg)))
+ (cons buffer (with-current-buffer buffer (point))))))))
+ (ignore-case company-etags-ignore-case)))
+
+(provide 'company-etags)
+;;; company-etags.el ends here
diff --git a/elpa/company-20220326.48/company-etags.elc b/elpa/company-20220326.48/company-etags.elc
new file mode 100644
index 0000000..5c5bb67
--- /dev/null
+++ b/elpa/company-20220326.48/company-etags.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-files.el b/elpa/company-20220326.48/company-files.el
new file mode 100644
index 0000000..0eb6cfe
--- /dev/null
+++ b/elpa/company-20220326.48/company-files.el
@@ -0,0 +1,161 @@
+;;; company-files.el --- company-mode completion backend for file names
+
+;; Copyright (C) 2009-2011, 2013-2021 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+
+(defgroup company-files nil
+ "Completion backend for file names."
+ :group 'company)
+
+(defcustom company-files-exclusions nil
+ "A list of file name extensions and directory names to ignore.
+The values should use the same format as `completion-ignored-extensions'."
+ :type '(repeat (string :tag "File extension or directory name"))
+ :package-version '(company . "0.9.1"))
+
+(defcustom company-files-chop-trailing-slash t
+ "Non-nil to remove the trailing slash after inserting directory name.
+
+This way it's easy to continue completion by typing `/' again.
+
+Set this to nil to disable that behavior."
+ :type 'boolean)
+
+(defun company-files--directory-files (dir prefix)
+ ;; Don't use directory-files. It produces directories without trailing /.
+ (condition-case err
+ (let ((comp (sort (file-name-all-completions prefix dir)
+ (lambda (s1 s2) (string-lessp (downcase s1) (downcase s2))))))
+ (when company-files-exclusions
+ (setq comp (company-files--exclusions-filtered comp)))
+ (if (equal prefix "")
+ (delete "../" (delete "./" comp))
+ comp))
+ (file-error nil)))
+
+(defun company-files--exclusions-filtered (completions)
+ (let* ((dir-exclusions (cl-remove-if-not #'company-files--trailing-slash-p
+ company-files-exclusions))
+ (file-exclusions (cl-set-difference company-files-exclusions
+ dir-exclusions)))
+ (cl-loop for c in completions
+ unless (if (company-files--trailing-slash-p c)
+ (member c dir-exclusions)
+ (cl-find-if (lambda (exclusion)
+ (string-suffix-p exclusion c))
+ file-exclusions))
+ collect c)))
+
+(defvar company-files--regexps
+ (let* ((root (if (eq system-type 'windows-nt)
+ "[a-zA-Z]:/"
+ "/"))
+ (begin (concat "\\(?:\\.\\{1,2\\}/\\|~/\\|" root "\\)")))
+ (list (concat "\"\\(" begin "[^\"\n]*\\)")
+ (concat "\'\\(" begin "[^\'\n]*\\)")
+ (concat "\\(?:[ \t=\[]\\|^\\)\\(" begin "[^ \t\n]*\\)"))))
+
+(defun company-files--grab-existing-name ()
+ ;; Grab the file name.
+ ;; When surrounded with quotes, it can include spaces.
+ (let (file dir)
+ (and (cl-dolist (regexp company-files--regexps)
+ (when (setq file (company-grab-line regexp 1))
+ (cl-return file)))
+ (company-files--connected-p file)
+ (setq dir (file-name-directory file))
+ (not (string-match "//" dir))
+ (file-exists-p dir)
+ file)))
+
+(defun company-files--connected-p (file)
+ (or (not (file-remote-p file))
+ (file-remote-p file nil t)))
+
+(defun company-files--trailing-slash-p (file)
+ ;; `file-directory-p' is very expensive on remotes. We are relying on
+ ;; `file-name-all-completions' returning directories with trailing / instead.
+ (let ((len (length file)))
+ (and (> len 0) (eq (aref file (1- len)) ?/))))
+
+(defvar company-files--completion-cache nil)
+
+(defun company-files--complete (prefix)
+ (let* ((dir (file-name-directory prefix))
+ (file (file-name-nondirectory prefix))
+ (key (list file
+ (expand-file-name dir)
+ (nth 5 (file-attributes dir))))
+ (completion-ignore-case read-file-name-completion-ignore-case))
+ (unless (company-file--keys-match-p key (car company-files--completion-cache))
+ (let* ((candidates (mapcar (lambda (f) (concat dir f))
+ (company-files--directory-files dir file)))
+ (directories (unless (file-remote-p dir)
+ (cl-remove-if-not (lambda (f)
+ (and (company-files--trailing-slash-p f)
+ (not (file-remote-p f))
+ (company-files--connected-p f)))
+ candidates)))
+ (children (and directories
+ (cl-mapcan (lambda (d)
+ (mapcar (lambda (c) (concat d c))
+ (company-files--directory-files d "")))
+ directories))))
+ (setq company-files--completion-cache
+ (cons key (append candidates children)))))
+ (all-completions prefix
+ (cdr company-files--completion-cache))))
+
+(defun company-file--keys-match-p (new old)
+ (and (equal (cdr old) (cdr new))
+ (string-prefix-p (car old) (car new))))
+
+(defun company-files--post-completion (arg)
+ (when (and company-files-chop-trailing-slash
+ (company-files--trailing-slash-p arg))
+ (delete-char -1)))
+
+;;;###autoload
+(defun company-files (command &optional arg &rest ignored)
+ "`company-mode' completion backend existing file names.
+Completions works for proper absolute and relative files paths.
+File paths with spaces are only supported inside strings."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-files))
+ (prefix (company-files--grab-existing-name))
+ (candidates (company-files--complete arg))
+ (location (cons (dired-noselect
+ (file-name-directory (directory-file-name arg))) 1))
+ (post-completion (company-files--post-completion arg))
+ (kind (if (string-suffix-p "/" arg) 'folder 'file))
+ (sorted t)
+ (no-cache t)))
+
+(provide 'company-files)
+;;; company-files.el ends here
diff --git a/elpa/company-20220326.48/company-files.elc b/elpa/company-20220326.48/company-files.elc
new file mode 100644
index 0000000..15156ef
--- /dev/null
+++ b/elpa/company-20220326.48/company-files.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-gtags.el b/elpa/company-20220326.48/company-gtags.el
new file mode 100644
index 0000000..8c08c83
--- /dev/null
+++ b/elpa/company-20220326.48/company-gtags.el
@@ -0,0 +1,161 @@
+;;; company-gtags.el --- company-mode completion backend for GNU Global
+
+;; Copyright (C) 2009-2011, 2013-2021 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+
+;;; Code:
+
+(require 'company)
+(require 'company-template)
+(require 'cl-lib)
+
+(defgroup company-gtags nil
+ "Completion backend for GNU Global."
+ :group 'company)
+
+(define-obsolete-variable-alias
+ 'company-gtags-gnu-global-program-name
+ 'company-gtags-executable "earlier")
+
+(defcustom company-gtags-executable
+ (executable-find "global")
+ "Location of GNU global executable."
+ :type 'string)
+
+(defcustom company-gtags-insert-arguments t
+ "When non-nil, insert function arguments as a template after completion."
+ :type 'boolean
+ :package-version '(company . "0.8.1"))
+
+(defvar-local company-gtags--tags-available-p 'unknown)
+(defvar-local company-gtags--executable 'unknown)
+
+(defcustom company-gtags-modes '(prog-mode jde-mode)
+ "Modes that use `company-gtags'.
+In all these modes (and their derivatives) `company-gtags' will perform
+completion."
+ :type '(repeat (symbol :tag "Major mode"))
+ :package-version '(company . "0.8.4"))
+
+(defun company-gtags--tags-available-p ()
+ (if (eq company-gtags--tags-available-p 'unknown)
+ (setq company-gtags--tags-available-p
+ (locate-dominating-file buffer-file-name "GTAGS"))
+ company-gtags--tags-available-p))
+
+;; Avoid byte-compilation warnings on Emacs < 27.
+(declare-function with-connection-local-variables "files-x")
+(declare-function connection-local-set-profile-variables "files-x")
+(declare-function connection-local-set-profiles "files-x")
+
+(defun company-gtags--executable ()
+ (cond
+ ((not (eq company-gtags--executable 'unknown)) ;; the value is already cached
+ company-gtags--executable)
+ ((and (version<= "27" emacs-version) ;; can search remotely to set
+ (file-remote-p default-directory))
+
+ (with-connection-local-variables
+ (if (boundp 'company-gtags--executable-connection)
+ (setq-local company-gtags--executable ;; use if defined as connection-local
+ company-gtags--executable-connection)
+
+ ;; Else search and set as connection local for next uses.
+ (setq-local company-gtags--executable
+ (with-no-warnings (executable-find "global" t)))
+ (let* ((host (file-remote-p default-directory 'host))
+ (symvars (intern (concat host "-vars")))) ;; profile name
+
+ (connection-local-set-profile-variables
+ symvars
+ `((company-gtags--executable-connection . ,company-gtags--executable)))
+
+ (connection-local-set-profiles `(:machine ,host) symvars))
+ company-gtags--executable)))
+ (t ;; use default value (searched locally)
+ company-gtags-executable)))
+
+(defun company-gtags--fetch-tags (prefix)
+ (with-temp-buffer
+ (let (tags)
+ ;; For some reason Global v 6.6.3 is prone to returning exit status 1
+ ;; even on successful searches when '-T' is used.
+ (when (/= 3 (process-file (company-gtags--executable) nil
+ ;; "-T" goes through all the tag files listed in GTAGSLIBPATH
+ (list (current-buffer) nil) nil "-xGqT" (concat "^" prefix)))
+ (goto-char (point-min))
+ (cl-loop while
+ (re-search-forward (concat
+ "^"
+ "\\([^ ]*\\)" ;; completion
+ "[ \t]+\\([[:digit:]]+\\)" ;; linum
+ "[ \t]+\\([^ \t]+\\)" ;; file
+ "[ \t]+\\(.*\\)" ;; definition
+ "$"
+ ) nil t)
+ collect
+ (propertize (match-string 1)
+ 'meta (match-string 4)
+ 'location (cons (expand-file-name (match-string 3))
+ (string-to-number (match-string 2)))
+ ))))))
+
+(defun company-gtags--annotation (arg)
+ (let ((meta (get-text-property 0 'meta arg)))
+ (when (string-match (concat (regexp-quote arg) " *(") meta)
+ (with-temp-buffer
+ (let ((start (match-end 0)))
+ (insert meta)
+ (goto-char start)
+ (condition-case nil
+ (forward-sexp)
+ (scan-error
+ (goto-char (point-max))))
+ (buffer-substring-no-properties
+ start (point)))))))
+
+;;;###autoload
+(defun company-gtags (command &optional arg &rest ignored)
+ "`company-mode' completion backend for GNU Global."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-gtags))
+ (prefix (and (company-gtags--executable)
+ buffer-file-name
+ (apply #'derived-mode-p company-gtags-modes)
+ (not (company-in-string-or-comment))
+ (company-gtags--tags-available-p)
+ (or (company-grab-symbol) 'stop)))
+ (candidates (company-gtags--fetch-tags arg))
+ (sorted t)
+ (duplicates t)
+ (annotation (company-gtags--annotation arg))
+ (meta (get-text-property 0 'meta arg))
+ (location (get-text-property 0 'location arg))
+ (post-completion (let ((anno (company-gtags--annotation arg)))
+ (when (and company-gtags-insert-arguments anno)
+ (insert anno)
+ (company-template-c-like-templatify anno))))))
+
+(provide 'company-gtags)
+;;; company-gtags.el ends here
diff --git a/elpa/company-20220326.48/company-gtags.elc b/elpa/company-20220326.48/company-gtags.elc
new file mode 100644
index 0000000..a976d21
--- /dev/null
+++ b/elpa/company-20220326.48/company-gtags.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-ispell.el b/elpa/company-20220326.48/company-ispell.el
new file mode 100644
index 0000000..3cb7c5d
--- /dev/null
+++ b/elpa/company-20220326.48/company-ispell.el
@@ -0,0 +1,83 @@
+;;; company-ispell.el --- company-mode completion backend using Ispell
+
+;; Copyright (C) 2009-2011, 2013-2016, 2018, 2021 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+(require 'ispell)
+
+(defgroup company-ispell nil
+ "Completion backend using Ispell."
+ :group 'company)
+
+(defcustom company-ispell-dictionary nil
+ "Dictionary to use for `company-ispell'.
+If nil, use `ispell-complete-word-dict'."
+ :type '(choice (const :tag "default (nil)" nil)
+ (file :tag "dictionary" t)))
+
+(defvar company-ispell-available 'unknown)
+
+(defalias 'company-ispell--lookup-words
+ (if (fboundp 'ispell-lookup-words)
+ 'ispell-lookup-words
+ 'lookup-words))
+
+(defun company-ispell-available ()
+ (when (eq company-ispell-available 'unknown)
+ (condition-case err
+ (progn
+ (company-ispell--lookup-words "WHATEVER")
+ (setq company-ispell-available t))
+ (error
+ (message "Company-Ispell: %s" (error-message-string err))
+ (setq company-ispell-available nil))))
+ company-ispell-available)
+
+;;;###autoload
+(defun company-ispell (command &optional arg &rest ignored)
+ "`company-mode' completion backend using Ispell."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-ispell))
+ (prefix (when (company-ispell-available)
+ (company-grab-word)))
+ (candidates
+ (let ((words (company-ispell--lookup-words
+ arg
+ (or company-ispell-dictionary ispell-complete-word-dict)))
+ (completion-ignore-case t))
+ (if (string= arg "")
+ ;; Small optimization.
+ words
+ ;; Work around issue #284.
+ (all-completions arg words))))
+ (kind 'text)
+ (sorted t)
+ (ignore-case 'keep-prefix)))
+
+(provide 'company-ispell)
+;;; company-ispell.el ends here
diff --git a/elpa/company-20220326.48/company-ispell.elc b/elpa/company-20220326.48/company-ispell.elc
new file mode 100644
index 0000000..52da41f
--- /dev/null
+++ b/elpa/company-20220326.48/company-ispell.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-keywords.el b/elpa/company-20220326.48/company-keywords.el
new file mode 100644
index 0000000..0065afb
--- /dev/null
+++ b/elpa/company-20220326.48/company-keywords.el
@@ -0,0 +1,354 @@
+;;; company-keywords.el --- A company backend for programming language keywords
+
+;; Copyright (C) 2009-2011, 2013-2018, 2020-2021 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+(eval-when-compile (require 'make-mode))
+
+(defgroup company-keywords nil
+ "Completion backend for keywords."
+ :group 'company)
+
+(defcustom company-keywords-ignore-case nil
+ "Non-nil to ignore case in completion candidates."
+ :type 'boolean)
+
+(defun company-keywords-upper-lower (&rest lst)
+ ;; Upcase order is different for _.
+ (nconc (sort (mapcar 'upcase lst) 'string<) lst))
+
+(defvar company-keywords-alist
+ ;; Please contribute corrections or additions.
+ `((c++-mode
+ ;; from https://en.cppreference.com/w/cpp/keyword
+ "alignas" "alignof" "and" "and_eq" "asm" "atomic_cancel" "atomic_commit"
+ "atomic_noexcept" "auto" "bitand" "bitor" "bool" "break" "case" "catch"
+ "char" "char16_t" "char32_t" "char8_t" "class" "co_await" "co_return"
+ "co_yield" "compl" "concept" "const" "const_cast" "consteval" "constexpr"
+ "constinit" "continue" "decltype" "default" "delete" "do" "double"
+ "dynamic_cast" "else" "enum" "explicit" "export" "extern" "false" "final"
+ "float" "for" "friend" "goto" "if" "import" "inline" "int" "long" "module"
+ "mutable" "namespace" "new" "noexcept" "not" "not_eq" "nullptr" "operator"
+ "or" "or_eq" "override" "private" "protected" "public" "reflexpr" "register"
+ "reinterpret_cast" "requires" "return" "short" "signed" "sizeof" "static"
+ "static_assert" "static_cast" "struct" "switch" "synchronized" "template"
+ "this" "thread_local" "throw" "true" "try" "typedef" "typeid" "typename"
+ "union" "unsigned" "using" "virtual" "void" "volatile" "wchar_t" "while"
+ "xor" "xor_eq")
+ (c-mode
+ ;; from https://en.cppreference.com/w/c/keyword
+ "_Alignas" "_Alignof" "_Atomic" "_Bool" "_Complex" "_Generic" "_Imaginary"
+ "_Noreturn" "_Static_assert" "_Thread_local"
+ "auto" "break" "case" "char" "const" "continue" "default" "do"
+ "double" "else" "enum" "extern" "float" "for" "goto" "if" "inline"
+ "int" "long" "register" "restrict" "return" "short" "signed" "sizeof"
+ "static" "struct" "switch" "typedef" "union" "unsigned" "void" "volatile"
+ "while")
+ (csharp-mode
+ "abstract" "add" "alias" "as" "base" "bool" "break" "byte" "case"
+ "catch" "char" "checked" "class" "const" "continue" "decimal" "default"
+ "delegate" "do" "double" "else" "enum" "event" "explicit" "extern"
+ "false" "finally" "fixed" "float" "for" "foreach" "get" "global" "goto"
+ "if" "implicit" "in" "int" "interface" "internal" "is" "lock" "long"
+ "namespace" "new" "null" "object" "operator" "out" "override" "params"
+ "partial" "private" "protected" "public" "readonly" "ref" "remove"
+ "return" "sbyte" "sealed" "set" "short" "sizeof" "stackalloc" "static"
+ "string" "struct" "switch" "this" "throw" "true" "try" "typeof" "uint"
+ "ulong" "unchecked" "unsafe" "ushort" "using" "value" "var" "virtual"
+ "void" "volatile" "where" "while" "yield")
+ (d-mode
+ ;; from http://www.digitalmars.com/d/2.0/lex.html
+ "abstract" "alias" "align" "asm"
+ "assert" "auto" "body" "bool" "break" "byte" "case" "cast" "catch"
+ "cdouble" "cent" "cfloat" "char" "class" "const" "continue" "creal"
+ "dchar" "debug" "default" "delegate" "delete" "deprecated" "do"
+ "double" "else" "enum" "export" "extern" "false" "final" "finally"
+ "float" "for" "foreach" "foreach_reverse" "function" "goto" "idouble"
+ "if" "ifloat" "import" "in" "inout" "int" "interface" "invariant"
+ "ireal" "is" "lazy" "long" "macro" "mixin" "module" "new" "nothrow"
+ "null" "out" "override" "package" "pragma" "private" "protected"
+ "public" "pure" "real" "ref" "return" "scope" "short" "static" "struct"
+ "super" "switch" "synchronized" "template" "this" "throw" "true" "try"
+ "typedef" "typeid" "typeof" "ubyte" "ucent" "uint" "ulong" "union"
+ "unittest" "ushort" "version" "void" "volatile" "wchar" "while" "with")
+ (f90-mode .
+ ;; from f90.el
+ ;; ".AND." ".GE." ".GT." ".LT." ".LE." ".NE." ".OR." ".TRUE." ".FALSE."
+ ,(company-keywords-upper-lower
+ "abs" "abstract" "achar" "acos" "adjustl" "adjustr" "aimag" "aint"
+ "align" "all" "all_prefix" "all_scatter" "all_suffix" "allocatable"
+ "allocate" "allocated" "and" "anint" "any" "any_prefix" "any_scatter"
+ "any_suffix" "asin" "assign" "assignment" "associate" "associated"
+ "asynchronous" "atan" "atan2" "backspace" "bind" "bit_size" "block"
+ "btest" "c_alert" "c_associated" "c_backspace" "c_bool"
+ "c_carriage_return" "c_char" "c_double" "c_double_complex" "c_f_pointer"
+ "c_f_procpointer" "c_float" "c_float_complex" "c_form_feed" "c_funloc"
+ "c_funptr" "c_horizontal_tab" "c_int" "c_int16_t" "c_int32_t" "c_int64_t"
+ "c_int8_t" "c_int_fast16_t" "c_int_fast32_t" "c_int_fast64_t"
+ "c_int_fast8_t" "c_int_least16_t" "c_int_least32_t" "c_int_least64_t"
+ "c_int_least8_t" "c_intmax_t" "c_intptr_t" "c_loc" "c_long"
+ "c_long_double" "c_long_double_complex" "c_long_long" "c_new_line"
+ "c_null_char" "c_null_funptr" "c_null_ptr" "c_ptr" "c_short"
+ "c_signed_char" "c_size_t" "c_vertical_tab" "call" "case" "ceiling"
+ "char" "character" "character_storage_size" "class" "close" "cmplx"
+ "command_argument_count" "common" "complex" "conjg" "contains" "continue"
+ "copy_prefix" "copy_scatter" "copy_suffix" "cos" "cosh" "count"
+ "count_prefix" "count_scatter" "count_suffix" "cpu_time" "cshift"
+ "cycle" "cyclic" "data" "date_and_time" "dble" "deallocate" "deferred"
+ "digits" "dim" "dimension" "distribute" "do" "dot_product" "double"
+ "dprod" "dynamic" "elemental" "else" "elseif" "elsewhere" "end" "enddo"
+ "endfile" "endif" "entry" "enum" "enumerator" "eoshift" "epsilon" "eq"
+ "equivalence" "eqv" "error_unit" "exit" "exp" "exponent" "extends"
+ "extends_type_of" "external" "extrinsic" "false" "file_storage_size"
+ "final" "floor" "flush" "forall" "format" "fraction" "function" "ge"
+ "generic" "get_command" "get_command_argument" "get_environment_variable"
+ "goto" "grade_down" "grade_up" "gt" "hpf_alignment" "hpf_distribution"
+ "hpf_template" "huge" "iachar" "iall" "iall_prefix" "iall_scatter"
+ "iall_suffix" "iand" "iany" "iany_prefix" "iany_scatter" "iany_suffix"
+ "ibclr" "ibits" "ibset" "ichar" "ieee_arithmetic" "ieee_exceptions"
+ "ieee_features" "ieee_get_underflow_mode" "ieee_set_underflow_mode"
+ "ieee_support_underflow_control" "ieor" "if" "ilen" "implicit"
+ "import" "include" "independent" "index" "inherit" "input_unit"
+ "inquire" "int" "integer" "intent" "interface" "intrinsic" "ior"
+ "iostat_end" "iostat_eor" "iparity" "iparity_prefix" "iparity_scatter"
+ "iparity_suffix" "ishft" "ishftc" "iso_c_binding" "iso_fortran_env"
+ "kind" "lbound" "le" "leadz" "len" "len_trim" "lge" "lgt" "lle" "llt"
+ "log" "log10" "logical" "lt" "matmul" "max" "maxexponent" "maxloc"
+ "maxval" "maxval_prefix" "maxval_scatter" "maxval_suffix" "merge"
+ "min" "minexponent" "minloc" "minval" "minval_prefix" "minval_scatter"
+ "minval_suffix" "mod" "module" "modulo" "move_alloc" "mvbits" "namelist"
+ "ne" "nearest" "neqv" "new" "new_line" "nint" "non_intrinsic"
+ "non_overridable" "none" "nopass" "not" "null" "nullify"
+ "number_of_processors" "numeric_storage_size" "only" "onto" "open"
+ "operator" "optional" "or" "output_unit" "pack" "parameter" "parity"
+ "parity_prefix" "parity_scatter" "parity_suffix" "pass" "pause"
+ "pointer" "popcnt" "poppar" "precision" "present" "print" "private"
+ "procedure" "processors" "processors_shape" "product" "product_prefix"
+ "product_scatter" "product_suffix" "program" "protected" "public"
+ "pure" "radix" "random_number" "random_seed" "range" "read" "real"
+ "realign" "recursive" "redistribute" "repeat" "reshape" "result"
+ "return" "rewind" "rrspacing" "same_type_as" "save" "scale" "scan"
+ "select" "selected_char_kind" "selected_int_kind" "selected_real_kind"
+ "sequence" "set_exponent" "shape" "sign" "sin" "sinh" "size" "spacing"
+ "spread" "sqrt" "stop" "subroutine" "sum" "sum_prefix" "sum_scatter"
+ "sum_suffix" "system_clock" "tan" "tanh" "target" "template" "then"
+ "tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpack"
+ "use" "value" "verify" "volatile" "wait" "where" "while" "with" "write"))
+ (go-mode
+ ;; 1. Keywords ref: https://golang.org/ref/spec#Keywords
+ ;; 2. Builtin functions and types ref: https://golang.org/pkg/builtin/
+ "append" "bool" "break" "byte" "cap" "case" "chan" "close" "complex" "complex128"
+ "complex64" "const" "continue" "copy" "default" "defer" "delete" "else" "error"
+ "fallthrough" "false" "float32" "float64" "for" "func" "go" "goto" "if" "imag"
+ "import" "int" "int16" "int32" "int64" "int8" "interface" "len" "make"
+ "map" "new" "nil" "package" "panic" "print" "println" "range" "real" "recover"
+ "return" "rune" "select" "string" "struct" "switch" "true" "type" "uint" "uint16"
+ "uint32" "uint64" "uint8" "uintptr" "var")
+ (java-mode
+ "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" "class"
+ "continue" "default" "do" "double" "else" "enum" "extends" "final"
+ "finally" "float" "for" "if" "implements" "import" "instanceof" "int"
+ "interface" "long" "native" "new" "package" "private" "protected" "public"
+ "return" "short" "static" "strictfp" "super" "switch" "synchronized"
+ "this" "throw" "throws" "transient" "try" "void" "volatile" "while")
+ (javascript-mode
+ ;; https://tc39.github.io/ecma262/ + async, static and undefined
+ "async" "await" "break" "case" "catch" "class" "const" "continue"
+ "debugger" "default" "delete" "do" "else" "enum" "export" "extends" "false"
+ "finally" "for" "function" "if" "import" "in" "instanceof" "let" "new"
+ "null" "return" "static" "super" "switch" "this" "throw" "true" "try"
+ "typeof" "undefined" "var" "void" "while" "with" "yield")
+ (kotlin-mode
+ "abstract" "annotation" "as" "break" "by" "catch" "class" "companion"
+ "const" "constructor" "continue" "data" "do" "else" "enum" "false" "final"
+ "finally" "for" "fun" "if" "import" "in" "init" "inner" "interface"
+ "internal" "is" "lateinit" "nested" "null" "object" "open" "out" "override"
+ "package" "private" "protected" "public" "return" "super" "this" "throw"
+ "trait" "true" "try" "typealias" "val" "var" "when" "while")
+ (lua-mode
+ ;; https://www.lua.org/manual/5.3/manual.html
+ "and" "break" "do" "else" "elseif" "end" "false" "for" "function" "goto" "if"
+ "in" "local" "nil" "not" "or" "repeat" "return" "then" "true" "until" "while")
+ (objc-mode
+ "@catch" "@class" "@encode" "@end" "@finally" "@implementation"
+ "@interface" "@private" "@protected" "@protocol" "@public"
+ "@selector" "@synchronized" "@throw" "@try" "alloc" "autorelease"
+ "bycopy" "byref" "in" "inout" "oneway" "out" "release" "retain")
+ (perl-mode
+ ;; from cperl.el
+ "AUTOLOAD" "BEGIN" "CHECK" "CORE" "DESTROY" "END" "INIT" "__END__"
+ "__FILE__" "__LINE__" "abs" "accept" "alarm" "and" "atan2" "bind"
+ "binmode" "bless" "caller" "chdir" "chmod" "chomp" "chop" "chown" "chr"
+ "chroot" "close" "closedir" "cmp" "connect" "continue" "cos"
+ "crypt" "dbmclose" "dbmopen" "defined" "delete" "die" "do" "dump" "each"
+ "else" "elsif" "endgrent" "endhostent" "endnetent" "endprotoent"
+ "endpwent" "endservent" "eof" "eq" "eval" "exec" "exists" "exit" "exp"
+ "fcntl" "fileno" "flock" "for" "foreach" "fork" "format" "formline"
+ "ge" "getc" "getgrent" "getgrgid" "getgrnam" "gethostbyaddr"
+ "gethostbyname" "gethostent" "getlogin" "getnetbyaddr" "getnetbyname"
+ "getnetent" "getpeername" "getpgrp" "getppid" "getpriority"
+ "getprotobyname" "getprotobynumber" "getprotoent" "getpwent" "getpwnam"
+ "getpwuid" "getservbyname" "getservbyport" "getservent" "getsockname"
+ "getsockopt" "glob" "gmtime" "goto" "grep" "gt" "hex" "if" "index" "int"
+ "ioctl" "join" "keys" "kill" "last" "lc" "lcfirst" "le" "length"
+ "link" "listen" "local" "localtime" "lock" "log" "lstat" "lt" "map"
+ "mkdir" "msgctl" "msgget" "msgrcv" "msgsnd" "my" "ne" "next" "no"
+ "not" "oct" "open" "opendir" "or" "ord" "our" "pack" "package" "pipe"
+ "pop" "pos" "print" "printf" "push" "q" "qq" "quotemeta" "qw" "qx"
+ "rand" "read" "readdir" "readline" "readlink" "readpipe" "recv" "redo"
+ "ref" "rename" "require" "reset" "return" "reverse" "rewinddir" "rindex"
+ "rmdir" "scalar" "seek" "seekdir" "select" "semctl" "semget" "semop"
+ "send" "setgrent" "sethostent" "setnetent" "setpgrp" "setpriority"
+ "setprotoent" "setpwent" "setservent" "setsockopt" "shift" "shmctl"
+ "shmget" "shmread" "shmwrite" "shutdown" "sin" "sleep" "socket"
+ "socketpair" "sort" "splice" "split" "sprintf" "sqrt" "srand" "stat"
+ "study" "sub" "substr" "symlink" "syscall" "sysopen" "sysread" "system"
+ "syswrite" "tell" "telldir" "tie" "time" "times" "tr" "truncate" "uc"
+ "ucfirst" "umask" "undef" "unless" "unlink" "unpack" "unshift" "untie"
+ "until" "use" "utime" "values" "vec" "wait" "waitpid"
+ "wantarray" "warn" "while" "write" "x" "xor" "y")
+ (php-mode ;; https://www.php.net/manual/reserved.php
+ "Closure" "Error" "Exception" "Generator" "Throwable"
+ "__CLASS__" "__DIR__" "__FILE__" "__FUNCTION__" "__LINE__" "__METHOD__"
+ "__NAMESPACE__" "__TRAIT__"
+ "abstract" "and" "array" "as" "bool" "break" "callable" "case" "catch"
+ "class" "clone" "const" "continue" "declare" "default" "die" "do" "echo"
+ "else" "elseif" "empty" "enddeclare" "endfor" "endforeach" "endif"
+ "endswitch" "endwhile" "enum" "eval" "exit" "extends" "false" "final" "finally"
+ "float" "fn" "for" "foreach" "function" "global" "goto" "if"
+ "implements" "include" "include_once" "instanceof" "insteadof" "interface"
+ "isset" "iterable" "list" "match" "namespace" "new" "null" "object" "or"
+ "print" "private" "protected" "public" "readonly" "require" "require_once"
+ "return" "self" "static" "string" "switch" "this" "throw" "trait" "true"
+ "try" "unset" "use" "var" "void" "while" "xor" "yield" "yield from")
+ (python-mode
+ ;; https://docs.python.org/3/reference/lexical_analysis.html#keywords
+ "False" "None" "True" "and" "as" "assert" "break" "class" "continue" "def"
+ "del" "elif" "else" "except" "exec" "finally" "for" "from" "global" "if"
+ "import" "in" "is" "lambda" "nonlocal" "not" "or" "pass" "print" "raise"
+ "return" "try" "while" "with" "yield")
+ (ruby-mode
+ "BEGIN" "END" "alias" "and" "begin" "break" "case" "class" "def" "defined?"
+ "do" "else" "elsif" "end" "ensure" "false" "for" "if" "in" "module"
+ "next" "nil" "not" "or" "redo" "rescue" "retry" "return" "self" "super"
+ "then" "true" "undef" "unless" "until" "when" "while" "yield")
+ ;; From https://doc.rust-lang.org/grammar.html#keywords
+ ;; but excluding unused reserved words: https://www.reddit.com/r/rust/comments/34fq0k/is_there_a_good_list_of_rusts_keywords/cqucvnj
+ (rust-mode
+ "Self"
+ "as" "box" "break" "const" "continue" "crate" "else" "enum" "extern"
+ "false" "fn" "for" "if" "impl" "in" "let" "loop" "macro" "match" "mod"
+ "move" "mut" "pub" "ref" "return" "self" "static" "struct" "super"
+ "trait" "true" "type" "unsafe" "use" "where" "while")
+ (scala-mode
+ "abstract" "case" "catch" "class" "def" "do" "else" "extends" "false"
+ "final" "finally" "for" "forSome" "if" "implicit" "import" "lazy" "match"
+ "new" "null" "object" "override" "package" "private" "protected"
+ "return" "sealed" "super" "this" "throw" "trait" "true" "try" "type" "val"
+ "var" "while" "with" "yield")
+ (swift-mode
+ "Protocol" "Self" "Type" "and" "as" "assignment" "associatedtype"
+ "associativity" "available" "break" "case" "catch" "class" "column" "continue"
+ "convenience" "default" "defer" "deinit" "didSet" "do" "dynamic" "dynamicType"
+ "else" "elseif" "endif" "enum" "extension" "fallthrough" "false" "file"
+ "fileprivate" "final" "for" "func" "function" "get" "guard" "higherThan" "if"
+ "import" "in" "indirect" "infix" "init" "inout" "internal" "is" "lazy" "left"
+ "let" "line" "lowerThan" "mutating" "nil" "none" "nonmutating" "open"
+ "operator" "optional" "override" "postfix" "precedence" "precedencegroup"
+ "prefix" "private" "protocol" "public" "repeat" "required" "rethrows" "return"
+ "right" "selector" "self" "set" "static" "struct" "subscript" "super" "switch"
+ "throw" "throws" "true" "try" "typealias" "unowned" "var" "weak" "where"
+ "while" "willSet")
+ (julia-mode
+ "abstract" "break" "case" "catch" "const" "continue" "do" "else" "elseif"
+ "end" "eval" "export" "false" "finally" "for" "function" "global" "if"
+ "ifelse" "immutable" "import" "importall" "in" "let" "macro" "module"
+ "otherwise" "quote" "return" "switch" "throw" "true" "try" "type"
+ "typealias" "using" "while"
+ )
+ ;; From https://github.com/apache/thrift/blob/master/contrib/thrift.el
+ (thrift-mode
+ "binary" "bool" "byte" "const" "double" "enum" "exception" "extends"
+ "i16" "i32" "i64" "include" "list" "map" "oneway" "optional" "required"
+ "service" "set" "string" "struct" "throws" "typedef" "void"
+ )
+ ;; aliases
+ (js2-mode . javascript-mode)
+ (js2-jsx-mode . javascript-mode)
+ (espresso-mode . javascript-mode)
+ (js-mode . javascript-mode)
+ (js-jsx-mode . javascript-mode)
+ (rjsx-mode . javascript-mode)
+ (cperl-mode . perl-mode)
+ (jde-mode . java-mode)
+ (ess-julia-mode . julia-mode)
+ (phps-mode . php-mode)
+ (enh-ruby-mode . ruby-mode))
+ "Alist mapping major-modes to sorted keywords for `company-keywords'.")
+
+(with-eval-after-load 'make-mode
+ (mapc
+ (lambda (mode-stmnts)
+ (setf (alist-get (car mode-stmnts) company-keywords-alist)
+ (cl-remove-duplicates
+ (sort (append makefile-special-targets-list
+ (cl-mapcan #'identity
+ (mapcar
+ #'split-string
+ (cl-remove-if-not
+ #'stringp
+ (symbol-value (cdr mode-stmnts))))))
+ #'string<)
+ :test #'string=)))
+ '((makefile-automake-mode . makefile-automake-statements)
+ (makefile-gmake-mode . makefile-gmake-statements)
+ (makefile-makepp-mode . makefile-makepp-statements)
+ (makefile-bsdmake-mode . makefile-bsdmake-statements)
+ (makefile-imake-mode . makefile-statements)
+ (makefile-mode . makefile-statements))))
+
+;;;###autoload
+(defun company-keywords (command &optional arg &rest ignored)
+ "`company-mode' backend for programming language keywords."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-keywords))
+ (prefix (and (assq major-mode company-keywords-alist)
+ (not (company-in-string-or-comment))
+ (or (company-grab-symbol) 'stop)))
+ (candidates
+ (let ((completion-ignore-case company-keywords-ignore-case)
+ (symbols (cdr (assq major-mode company-keywords-alist))))
+ (all-completions arg (if (consp symbols)
+ symbols
+ (cdr (assq symbols company-keywords-alist))))))
+ (kind 'keyword)
+ (sorted t)
+ (ignore-case company-keywords-ignore-case)))
+
+(provide 'company-keywords)
+;;; company-keywords.el ends here
diff --git a/elpa/company-20220326.48/company-keywords.elc b/elpa/company-20220326.48/company-keywords.elc
new file mode 100644
index 0000000..3491fbf
--- /dev/null
+++ b/elpa/company-20220326.48/company-keywords.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-nxml.el b/elpa/company-20220326.48/company-nxml.el
new file mode 100644
index 0000000..c72685c
--- /dev/null
+++ b/elpa/company-20220326.48/company-nxml.el
@@ -0,0 +1,143 @@
+;;; company-nxml.el --- company-mode completion backend for nxml-mode
+
+;; Copyright (C) 2009-2011, 2013-2015, 2017-2018 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+;; In Emacs >= 26, company-capf is used instead.
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+
+(defvar rng-open-elements)
+(defvar rng-validate-mode)
+(defvar rng-in-attribute-regex)
+(defvar rng-in-attribute-value-regex)
+(declare-function rng-set-state-after "rng-nxml")
+(declare-function rng-match-possible-start-tag-names "rng-match")
+(declare-function rng-adjust-state-for-attribute "rng-nxml")
+(declare-function rng-match-possible-attribute-names "rng-match")
+(declare-function rng-adjust-state-for-attribute-value "rng-nxml")
+(declare-function rng-match-possible-value-strings "rng-match")
+
+(defconst company-nxml-token-regexp
+ "\\(?:[_[:alpha:]][-._[:alnum:]]*\\_>\\)")
+
+(defvar company-nxml-in-attribute-value-regexp
+ (replace-regexp-in-string "w" company-nxml-token-regexp
+ "<w\\(?::w\\)?\
+\\(?:[ \t\r\n]+w\\(?::w\\)?[ \t\r\n]*=\
+\[ \t\r\n]*\\(?:\"[^\"]*\"\\|'[^']*'\\)\\)*\
+\[ \t\r\n]+\\(w\\(:w\\)?\\)[ \t\r\n]*=[ \t\r\n]*\
+\\(\"\\([^\"]*\\>\\)\\|'\\([^']*\\>\\)\\)\\="
+ t t))
+
+(defvar company-nxml-in-tag-name-regexp
+ (replace-regexp-in-string "w" company-nxml-token-regexp
+ "<\\(/?w\\(?::w?\\)?\\)?\\=" t t))
+
+(defun company-nxml-all-completions (prefix alist)
+ (let ((candidates (mapcar 'cdr alist))
+ (case-fold-search nil)
+ filtered)
+ (when (cdar rng-open-elements)
+ (push (concat "/" (cdar rng-open-elements)) candidates))
+ (setq candidates (sort (all-completions prefix candidates) 'string<))
+ (while candidates
+ (unless (equal (car candidates) (car filtered))
+ (push (car candidates) filtered))
+ (pop candidates))
+ (nreverse filtered)))
+
+(defmacro company-nxml-prepared (&rest body)
+ (declare (indent 0) (debug t))
+ `(let ((lt-pos (save-excursion (search-backward "<" nil t)))
+ xmltok-dtd)
+ (when (and lt-pos (= (rng-set-state-after lt-pos) lt-pos))
+ ,@body)))
+
+(defun company-nxml-tag (command &optional arg &rest ignored)
+ (cl-case command
+ (prefix (and (derived-mode-p 'nxml-mode)
+ rng-validate-mode
+ (company-grab company-nxml-in-tag-name-regexp 1)))
+ (candidates (company-nxml-prepared
+ (company-nxml-all-completions
+ arg (rng-match-possible-start-tag-names))))
+ (sorted t)))
+
+(defun company-nxml-attribute (command &optional arg &rest ignored)
+ (cl-case command
+ (prefix (and (derived-mode-p 'nxml-mode)
+ rng-validate-mode
+ (memq (char-after) '(?\ ?\t ?\n)) ;; outside word
+ (company-grab rng-in-attribute-regex 1)))
+ (candidates (company-nxml-prepared
+ (and (rng-adjust-state-for-attribute
+ lt-pos (- (point) (length arg)))
+ (company-nxml-all-completions
+ arg (rng-match-possible-attribute-names)))))
+ (sorted t)))
+
+(defun company-nxml-attribute-value (command &optional arg &rest ignored)
+ (cl-case command
+ (prefix (and (derived-mode-p 'nxml-mode)
+ rng-validate-mode
+ (and (memq (char-after) '(?' ?\" ?\ ?\t ?\n)) ;; outside word
+ (looking-back company-nxml-in-attribute-value-regexp nil)
+ (or (match-string-no-properties 4)
+ (match-string-no-properties 5)
+ ""))))
+ (candidates (company-nxml-prepared
+ (let (attr-start attr-end colon)
+ (and (looking-back rng-in-attribute-value-regex lt-pos)
+ (setq colon (match-beginning 2)
+ attr-start (match-beginning 1)
+ attr-end (match-end 1))
+ (rng-adjust-state-for-attribute lt-pos attr-start)
+ (rng-adjust-state-for-attribute-value
+ attr-start colon attr-end)
+ (all-completions
+ arg (rng-match-possible-value-strings))))))))
+
+;;;###autoload
+(defun company-nxml (command &optional arg &rest ignored)
+ "`company-mode' completion backend for `nxml-mode'."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-nxml))
+ (prefix (or (company-nxml-tag 'prefix)
+ (company-nxml-attribute 'prefix)
+ (company-nxml-attribute-value 'prefix)))
+ (candidates (cond
+ ((company-nxml-tag 'prefix)
+ (company-nxml-tag 'candidates arg))
+ ((company-nxml-attribute 'prefix)
+ (company-nxml-attribute 'candidates arg))
+ ((company-nxml-attribute-value 'prefix)
+ (sort (company-nxml-attribute-value 'candidates arg)
+ 'string<))))
+ (sorted t)))
+
+(provide 'company-nxml)
+;;; company-nxml.el ends here
diff --git a/elpa/company-20220326.48/company-nxml.elc b/elpa/company-20220326.48/company-nxml.elc
new file mode 100644
index 0000000..e59a28a
--- /dev/null
+++ b/elpa/company-20220326.48/company-nxml.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-oddmuse.el b/elpa/company-20220326.48/company-oddmuse.el
new file mode 100644
index 0000000..5b9780b
--- /dev/null
+++ b/elpa/company-20220326.48/company-oddmuse.el
@@ -0,0 +1,57 @@
+;;; company-oddmuse.el --- company-mode completion backend for oddmuse-mode
+
+;; Copyright (C) 2009-2011, 2013-2016 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+(eval-when-compile (require 'yaoddmuse nil t))
+(eval-when-compile (require 'oddmuse nil t))
+
+(defvar company-oddmuse-link-regexp
+ "\\(\\<[A-Z][[:alnum:]]*\\>\\)\\|\\[\\[\\([[:alnum:]]+\\>\\|\\)")
+
+(defun company-oddmuse-get-page-table ()
+ (cl-case major-mode
+ (yaoddmuse-mode (with-no-warnings
+ (yaoddmuse-get-pagename-table yaoddmuse-wikiname)))
+ (oddmuse-mode (with-no-warnings
+ (oddmuse-make-completion-table oddmuse-wiki)))))
+
+;;;###autoload
+(defun company-oddmuse (command &optional arg &rest ignored)
+ "`company-mode' completion backend for `oddmuse-mode'."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-oddmuse))
+ (prefix (let ((case-fold-search nil))
+ (and (memq major-mode '(oddmuse-mode yaoddmuse-mode))
+ (looking-back company-oddmuse-link-regexp (point-at-bol))
+ (or (match-string 1)
+ (match-string 2)))))
+ (candidates (all-completions arg (company-oddmuse-get-page-table)))))
+
+(provide 'company-oddmuse)
+;;; company-oddmuse.el ends here
diff --git a/elpa/company-20220326.48/company-oddmuse.elc b/elpa/company-20220326.48/company-oddmuse.elc
new file mode 100644
index 0000000..079469d
--- /dev/null
+++ b/elpa/company-20220326.48/company-oddmuse.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-pkg.el b/elpa/company-20220326.48/company-pkg.el
new file mode 100644
index 0000000..033da3f
--- /dev/null
+++ b/elpa/company-20220326.48/company-pkg.el
@@ -0,0 +1,12 @@
+(define-package "company" "20220326.48" "Modular text completion framework"
+ '((emacs "25.1"))
+ :commit "783287526a791590bea4f9a23992c2bfebdb4c8d" :authors
+ '(("Nikolaj Schumacher"))
+ :maintainer
+ '("Dmitry Gutov" . "dgutov@yandex.ru")
+ :keywords
+ '("abbrev" "convenience" "matching")
+ :url "http://company-mode.github.io/")
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/elpa/company-20220326.48/company-semantic.el b/elpa/company-20220326.48/company-semantic.el
new file mode 100644
index 0000000..cd56764
--- /dev/null
+++ b/elpa/company-20220326.48/company-semantic.el
@@ -0,0 +1,168 @@
+;;; company-semantic.el --- company-mode completion backend using Semantic
+
+;; Copyright (C) 2009-2011, 2013-2018 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+
+;;; Code:
+
+(require 'company)
+(require 'company-template)
+(require 'cl-lib)
+
+(defvar semantic-idle-summary-function)
+(declare-function semantic-documentation-for-tag "semantic/doc" )
+(declare-function semantic-analyze-current-context "semantic/analyze")
+(declare-function semantic-analyze-possible-completions "semantic/complete")
+(declare-function semantic-analyze-find-tags-by-prefix "semantic/analyze/fcn")
+(declare-function semantic-tag-class "semantic/tag")
+(declare-function semantic-tag-name "semantic/tag")
+(declare-function semantic-tag-start "semantic/tag")
+(declare-function semantic-tag-buffer "semantic/tag")
+(declare-function semantic-active-p "semantic")
+(declare-function semantic-format-tag-prototype "semantic/format")
+
+(defgroup company-semantic nil
+ "Completion backend using Semantic."
+ :group 'company)
+
+(defcustom company-semantic-metadata-function 'company-semantic-summary-and-doc
+ "The function turning a semantic tag into doc information."
+ :type 'function)
+
+(defcustom company-semantic-begin-after-member-access t
+ "When non-nil, automatic completion will start whenever the current
+symbol is preceded by \".\", \"->\" or \"::\", ignoring
+`company-minimum-prefix-length'.
+
+If `company-begin-commands' is a list, it should include `c-electric-lt-gt'
+and `c-electric-colon', for automatic completion right after \">\" and
+\":\"."
+ :type 'boolean)
+
+(defcustom company-semantic-insert-arguments t
+ "When non-nil, insert function arguments as a template after completion."
+ :type 'boolean
+ :package-version '(company . "0.9.0"))
+
+(defvar company-semantic-modes '(c-mode c++-mode jde-mode java-mode))
+
+(defvar-local company-semantic--current-tags nil
+ "Tags for the current context.")
+
+(defun company-semantic-documentation-for-tag (tag)
+ (when (semantic-tag-buffer tag)
+ ;; When TAG's buffer is unknown, the function below raises an error.
+ (semantic-documentation-for-tag tag)))
+
+(defun company-semantic-doc-or-summary (tag)
+ (or (company-semantic-documentation-for-tag tag)
+ (and (require 'semantic-idle nil t)
+ (require 'semantic/idle nil t)
+ (funcall semantic-idle-summary-function tag nil t))))
+
+(defun company-semantic-summary-and-doc (tag)
+ (let ((doc (company-semantic-documentation-for-tag tag))
+ (summary (funcall semantic-idle-summary-function tag nil t)))
+ (and (stringp doc)
+ (string-match "\n*\\(.*\\)$" doc)
+ (setq doc (match-string 1 doc)))
+ (concat summary
+ (when doc
+ (if (< (+ (length doc) (length summary) 4) (window-width))
+ " -- "
+ "\n"))
+ doc)))
+
+(defun company-semantic-doc-buffer (tag)
+ (let ((doc (company-semantic-documentation-for-tag tag)))
+ (when doc
+ (company-doc-buffer
+ (concat (funcall semantic-idle-summary-function tag nil t)
+ "\n"
+ doc)))))
+
+(defsubst company-semantic-completions (prefix)
+ (ignore-errors
+ (let ((completion-ignore-case nil)
+ (context (semantic-analyze-current-context)))
+ (setq company-semantic--current-tags
+ (semantic-analyze-possible-completions context 'no-unique))
+ (all-completions prefix company-semantic--current-tags))))
+
+(defun company-semantic-completions-raw (prefix)
+ (setq company-semantic--current-tags nil)
+ (dolist (tag (semantic-analyze-find-tags-by-prefix prefix))
+ (unless (eq (semantic-tag-class tag) 'include)
+ (push tag company-semantic--current-tags)))
+ (delete "" (mapcar 'semantic-tag-name company-semantic--current-tags)))
+
+(defun company-semantic-annotation (argument tags)
+ (let* ((tag (assq argument tags))
+ (kind (when tag (elt tag 1))))
+ (cl-case kind
+ (function (let* ((prototype (semantic-format-tag-prototype tag nil nil))
+ (par-pos (string-match "(" prototype)))
+ (when par-pos (substring prototype par-pos)))))))
+
+(defun company-semantic--prefix ()
+ (if company-semantic-begin-after-member-access
+ (company-grab-symbol-cons "\\.\\|->\\|::" 2)
+ (company-grab-symbol)))
+
+;;;###autoload
+(defun company-semantic (command &optional arg &rest ignored)
+ "`company-mode' completion backend using CEDET Semantic."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-semantic))
+ (prefix (and (featurep 'semantic)
+ (semantic-active-p)
+ (memq major-mode company-semantic-modes)
+ (not (company-in-string-or-comment))
+ (or (company-semantic--prefix) 'stop)))
+ (candidates (if (and (equal arg "")
+ (not (looking-back "->\\|\\.\\|::" (- (point) 2))))
+ (company-semantic-completions-raw arg)
+ (company-semantic-completions arg)))
+ (meta (funcall company-semantic-metadata-function
+ (assoc arg company-semantic--current-tags)))
+ (annotation (company-semantic-annotation arg
+ company-semantic--current-tags))
+ (doc-buffer (company-semantic-doc-buffer
+ (assoc arg company-semantic--current-tags)))
+ ;; Because "" is an empty context and doesn't return local variables.
+ (no-cache (equal arg ""))
+ (duplicates t)
+ (location (let ((tag (assoc arg company-semantic--current-tags)))
+ (when (buffer-live-p (semantic-tag-buffer tag))
+ (cons (semantic-tag-buffer tag)
+ (semantic-tag-start tag)))))
+ (post-completion (let ((anno (company-semantic-annotation
+ arg company-semantic--current-tags)))
+ (when (and company-semantic-insert-arguments anno)
+ (insert anno)
+ (company-template-c-like-templatify (concat arg anno)))
+ ))))
+
+(provide 'company-semantic)
+;;; company-semantic.el ends here
diff --git a/elpa/company-20220326.48/company-semantic.elc b/elpa/company-20220326.48/company-semantic.elc
new file mode 100644
index 0000000..0f4e9e9
--- /dev/null
+++ b/elpa/company-20220326.48/company-semantic.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-template.el b/elpa/company-20220326.48/company-template.el
new file mode 100644
index 0000000..57d5d48
--- /dev/null
+++ b/elpa/company-20220326.48/company-template.el
@@ -0,0 +1,272 @@
+;;; company-template.el --- utility library for template expansion
+
+;; Copyright (C) 2009-2010, 2013-2017, 2019 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'cl-lib)
+
+(defface company-template-field
+ '((((background dark)) (:background "yellow" :foreground "black"))
+ (((background light)) (:background "orange" :foreground "black")))
+ "Face used for editable text in template fields."
+ :group 'company-faces)
+
+(defvar company-template-forward-field-item
+ '(menu-item "" company-template-forward-field
+ :filter company-template--keymap-filter))
+
+(defvar company-template-nav-map
+ (let ((keymap (make-sparse-keymap)))
+ (define-key keymap [tab] company-template-forward-field-item)
+ (define-key keymap (kbd "TAB") company-template-forward-field-item)
+ keymap))
+
+(defvar company-template-clear-field-item
+ '(menu-item "" company-template-clear-field
+ :filter company-template--keymap-filter))
+
+(defvar company-template-field-map
+ (let ((keymap (make-sparse-keymap)))
+ (set-keymap-parent keymap company-template-nav-map)
+ (define-key keymap (kbd "C-d") company-template-clear-field-item)
+ keymap))
+
+(defvar-local company-template--buffer-templates nil)
+
+;; interactive ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun company-template-templates-at (pos)
+ (let (os)
+ (dolist (o (overlays-at pos))
+ ;; FIXME: Always return the whole list of templates?
+ ;; We remove templates not at point after every command.
+ (when (memq o company-template--buffer-templates)
+ (push o os)))
+ os))
+
+(defun company-template-move-to-first (templ)
+ (interactive)
+ (goto-char (overlay-start templ))
+ (company-template-forward-field))
+
+(defun company-template-forward-field ()
+ (interactive)
+ (let ((start (point))
+ (next-field-start (company-template-find-next-field)))
+ (push-mark)
+ (goto-char next-field-start)
+ (company-template-remove-field (company-template-field-at start))))
+
+(defun company-template-clear-field ()
+ "Clear the field at point."
+ (interactive)
+ (let ((ovl (company-template-field-at (point))))
+ (when ovl
+ (company-template-remove-field ovl t)
+ (let ((after-clear-fn
+ (overlay-get ovl 'company-template-after-clear)))
+ (when (functionp after-clear-fn)
+ (funcall after-clear-fn))))))
+
+(defun company-template--keymap-filter (cmd)
+ (unless (run-hook-with-args-until-success 'yas-keymap-disable-hook)
+ cmd))
+
+(defun company-template--after-clear-c-like-field ()
+ "Function that can be called after deleting a field of a c-like template.
+For c-like templates it is set as `after-post-fn' property on fields in
+`company-template-add-field'. If there is a next field, delete everything
+from point to it. If there is no field after point, remove preceding comma
+if present."
+ (let* ((pos (point))
+ (next-field-start (company-template-find-next-field))
+ (last-field-p (not (company-template-field-at next-field-start))))
+ (cond ((and (not last-field-p)
+ (< pos next-field-start)
+ (string-match "^[ ]*,+[ ]*$" (buffer-substring-no-properties
+ pos next-field-start)))
+ (delete-region pos next-field-start))
+ ((and last-field-p
+ (looking-back ",+[ ]*" (line-beginning-position)))
+ (delete-region (match-beginning 0) pos)))))
+
+(defun company-template-find-next-field ()
+ (let* ((start (point))
+ (templates (company-template-templates-at start))
+ (minimum (apply 'max (mapcar 'overlay-end templates)))
+ (fields (cl-loop for templ in templates
+ append (overlay-get templ 'company-template-fields))))
+ (dolist (pos (mapcar 'overlay-start fields) minimum)
+ (and pos
+ (> pos start)
+ (< pos minimum)
+ (setq minimum pos)))))
+
+(defun company-template-field-at (&optional point)
+ (cl-loop for ovl in (overlays-at (or point (point)))
+ when (overlay-get ovl 'company-template-parent)
+ return ovl))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun company-template-declare-template (beg end)
+ (let ((ov (make-overlay beg end)))
+ ;; (overlay-put ov 'face 'highlight)
+ (overlay-put ov 'keymap company-template-nav-map)
+ (overlay-put ov 'priority 101)
+ (overlay-put ov 'evaporate t)
+ (push ov company-template--buffer-templates)
+ (add-hook 'post-command-hook 'company-template-post-command nil t)
+ ov))
+
+(defun company-template-remove-template (templ)
+ (mapc 'company-template-remove-field
+ (overlay-get templ 'company-template-fields))
+ (setq company-template--buffer-templates
+ (delq templ company-template--buffer-templates))
+ (delete-overlay templ))
+
+(defun company-template-add-field (templ beg end &optional display after-clear-fn)
+ "Add new field to template TEMPL spanning from BEG to END.
+When DISPLAY is non-nil, set the respective property on the overlay.
+Leave point at the end of the field.
+AFTER-CLEAR-FN is a function that can be used to apply custom behavior
+after deleting a field in `company-template-remove-field'."
+ (cl-assert templ)
+ (when (> end (overlay-end templ))
+ (move-overlay templ (overlay-start templ) end))
+ (let ((ov (make-overlay beg end))
+ (siblings (overlay-get templ 'company-template-fields)))
+ ;; (overlay-put ov 'evaporate t)
+ (overlay-put ov 'intangible t)
+ (overlay-put ov 'face 'company-template-field)
+ (when display
+ (overlay-put ov 'display display))
+ (overlay-put ov 'company-template-parent templ)
+ (overlay-put ov 'insert-in-front-hooks '(company-template-insert-hook))
+ (when after-clear-fn
+ (overlay-put ov 'company-template-after-clear after-clear-fn))
+ (overlay-put ov 'keymap company-template-field-map)
+ (overlay-put ov 'priority 101)
+ (push ov siblings)
+ (overlay-put templ 'company-template-fields siblings)))
+
+(defun company-template-remove-field (ovl &optional clear)
+ (when (overlayp ovl)
+ (when (overlay-buffer ovl)
+ (when clear
+ (delete-region (overlay-start ovl) (overlay-end ovl)))
+ (delete-overlay ovl))
+ (let* ((templ (overlay-get ovl 'company-template-parent))
+ (siblings (overlay-get templ 'company-template-fields)))
+ (setq siblings (delq ovl siblings))
+ (overlay-put templ 'company-template-fields siblings))))
+
+(defun company-template-clean-up (&optional pos)
+ "Clean up all templates that don't contain POS."
+ (let ((local-ovs (overlays-at (or pos (point)))))
+ (dolist (templ company-template--buffer-templates)
+ (unless (memq templ local-ovs)
+ (company-template-remove-template templ)))))
+
+;; hooks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun company-template-insert-hook (ovl after-p &rest _ignore)
+ "Called when a snippet input prompt is modified."
+ (unless after-p
+ (company-template-remove-field ovl t)))
+
+(defun company-template-post-command ()
+ (company-template-clean-up)
+ (unless company-template--buffer-templates
+ (remove-hook 'post-command-hook 'company-template-post-command t)))
+
+;; common ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun company-template-c-like-templatify (call)
+ (let* ((end (point-marker))
+ (beg (- (point) (length call)))
+ (templ (company-template-declare-template beg end))
+ paren-open paren-close)
+ (with-syntax-table (make-syntax-table (syntax-table))
+ (modify-syntax-entry ?< "(")
+ (modify-syntax-entry ?> ")")
+ (when (search-backward ")" beg t)
+ (setq paren-close (point-marker))
+ (forward-char 1)
+ (delete-region (point) end)
+ (backward-sexp)
+ (forward-char 1)
+ (setq paren-open (point-marker)))
+ (when (search-backward ">" beg t)
+ (let ((angle-close (point-marker)))
+ (forward-char 1)
+ (backward-sexp)
+ (forward-char)
+ (company-template--c-like-args templ angle-close)))
+ (when (looking-back "\\((\\*)\\)(" (line-beginning-position))
+ (delete-region (match-beginning 1) (match-end 1)))
+ (when paren-open
+ (goto-char paren-open)
+ (company-template--c-like-args templ paren-close)))
+ (if (overlay-get templ 'company-template-fields)
+ (company-template-move-to-first templ)
+ (company-template-remove-template templ)
+ (goto-char end))))
+
+(defun company-template--c-like-args (templ end)
+ (let ((last-pos (point)))
+ (while (re-search-forward "\\([^,]+\\),?" end 'move)
+ (when (zerop (car (parse-partial-sexp last-pos (point))))
+ (company-template-add-field templ last-pos (match-end 1) nil
+ #'company-template--after-clear-c-like-field)
+ (skip-chars-forward " ")
+ (setq last-pos (point))))))
+
+;; objc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun company-template-objc-templatify (selector)
+ (let* ((end (point-marker))
+ (beg (- (point) (length selector) 1))
+ (templ (company-template-declare-template beg end))
+ (cnt 0))
+ (save-excursion
+ (goto-char beg)
+ (catch 'stop
+ (while (search-forward ":" end t)
+ (if (looking-at "\\(([^)]*)\\) ?")
+ (company-template-add-field templ (point) (match-end 1))
+ ;; Not sure which conditions this case manifests under, but
+ ;; apparently it did before, when I wrote the first test for this
+ ;; function. FIXME: Revisit it.
+ (company-template-add-field templ (point)
+ (progn
+ (insert (format "arg%d" cnt))
+ (point)))
+ (when (< (point) end)
+ (insert " "))
+ (cl-incf cnt))
+ (when (>= (point) end)
+ (throw 'stop t)))))
+ (company-template-move-to-first templ)))
+
+(provide 'company-template)
+;;; company-template.el ends here
diff --git a/elpa/company-20220326.48/company-template.elc b/elpa/company-20220326.48/company-template.elc
new file mode 100644
index 0000000..58936fe
--- /dev/null
+++ b/elpa/company-20220326.48/company-template.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-tempo.el b/elpa/company-20220326.48/company-tempo.el
new file mode 100644
index 0000000..ccf44e8
--- /dev/null
+++ b/elpa/company-20220326.48/company-tempo.el
@@ -0,0 +1,71 @@
+;;; company-tempo.el --- company-mode completion backend for tempo
+
+;; Copyright (C) 2009-2011, 2013-2016 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+(require 'tempo)
+
+(defgroup company-tempo nil
+ "Tempo completion backend."
+ :group 'company)
+
+(defcustom company-tempo-expand nil
+ "Whether to expand a tempo tag after completion."
+ :type '(choice (const :tag "Off" nil)
+ (const :tag "On" t)))
+
+(defsubst company-tempo-lookup (match)
+ (cdr (assoc match (tempo-build-collection))))
+
+(defun company-tempo-insert (match)
+ "Replace MATCH with the expanded tempo template."
+ (search-backward match)
+ (goto-char (match-beginning 0))
+ (replace-match "")
+ (call-interactively (company-tempo-lookup match)))
+
+(defsubst company-tempo-meta (match)
+ (let ((templ (company-tempo-lookup match))
+ doc)
+ (and templ
+ (setq doc (documentation templ t))
+ (car (split-string doc "\n" t)))))
+
+;;;###autoload
+(defun company-tempo (command &optional arg &rest ignored)
+ "`company-mode' completion backend for tempo."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-tempo))
+ (prefix (or (car (tempo-find-match-string tempo-match-finder)) ""))
+ (candidates (all-completions arg (tempo-build-collection)))
+ (meta (company-tempo-meta arg))
+ (post-completion (when company-tempo-expand (company-tempo-insert arg)))
+ (sorted t)))
+
+(provide 'company-tempo)
+;;; company-tempo.el ends here
diff --git a/elpa/company-20220326.48/company-tempo.elc b/elpa/company-20220326.48/company-tempo.elc
new file mode 100644
index 0000000..18e5dff
--- /dev/null
+++ b/elpa/company-20220326.48/company-tempo.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-tng.el b/elpa/company-20220326.48/company-tng.el
new file mode 100644
index 0000000..55124a3
--- /dev/null
+++ b/elpa/company-20220326.48/company-tng.el
@@ -0,0 +1,196 @@
+;;; company-tng.el --- company-mode configuration for single-button interaction
+
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
+
+;; Author: Nikita Leshenko
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+;; company-tng (Tab and Go) allows you to perform completion using just TAB.
+;; Pressing it will both select the next completion candidate in the list and
+;; insert it into the buffer (or make it look like it's inserted, in fact).
+;;
+;; It cycles the candidates like `yank-pop' or `dabbrev-expand' or Vim:
+;; Pressing TAB selects the first item in the completion menu and inserts it in
+;; the buffer. Pressing TAB again selects the second item and replaces the
+;; "inserted" item with the second one. This can continue as long as the user
+;; wishes to cycle through the menu. You can also press S-TAB to select the
+;; previous candidate, of course.
+;;
+;; The benefits are that you only have to use one shortcut key and there is no
+;; need to confirm the entry.
+;;
+;; Usage:
+;;
+;; Enable `company-tng-mode' with:
+;;
+;; (add-hook 'after-init-hook 'company-tng-mode)
+;;
+;; in your init script. It will set up the required frontend, as well as make a
+;; number of recommended configuration changes described below.
+;;
+;; To avoid these changes, if you want to tweak everything yourself, customize
+;;`company-tng-auto-configure' to nil.
+;;
+;; We recommend to bind TAB to `company-select-next', S-TAB to
+;; `company-select-previous', and unbind RET and other now-unnecessary
+;; keys from `company-active-map':
+;;
+;; (define-key company-active-map (kbd "TAB") 'company-select-next)
+;; (define-key company-active-map (kbd "<backtab>") 'company-select-previous)
+;; (define-key company-active-map (kbd "RET") nil)
+;;
+;; Note that it's not necessary to rebind keys to use this frontend,
+;; you can use the arrow keys or M-n/M-p to select and insert
+;; candidates. You also need to decide which keys to unbind, depending
+;; on whether you want them to do the Company action or the default
+;; Emacs action (for example C-s or C-w).
+;;
+;; We recommend to disable `company-require-match' to allow free typing at any
+;; point.
+;;
+;; By default, company-tng doesn't work well with backends that insert function
+;; arguments into the buffer and (optionally) expand them into a snippet
+;; (usually performed in `post-completion' using yasnippet or company-template).
+;; In company-tng, completion candidates
+;; are inserted into the buffer as the user selects them and the completion is
+;; finished implicitly when the user continues typing after selecting a
+;; candidate. Modifying the buffer (by expanding a snippet) when the user
+;; continues typing would be surprising and undesirable, since the candidate was
+;; already inserted into the buffer.
+;;
+;; For this reason `company-tng-mode' by default disables arguments insertion
+;; for a number of popular backends. If the backend you are using is not among
+;; them, you might have to configure it not to do that yourself.
+;;
+;; YASnippet and company-tng both use TAB, which causes conflicts. The
+;; recommended way to use YASnippet with company-tng is to choose a different
+;; key for expanding a snippet and moving to the next snippet field:
+;;
+;; (define-key yas-minor-mode-map "\C-j" 'yas-expand)
+;; (define-key yas-keymap "\C-j" 'yas-next-field-or-maybe-expand)
+;; (dolist (keymap (list yas-minor-mode-map yas-keymap))
+;; (define-key keymap (kbd "TAB") nil)
+;; (define-key keymap [(tab)] nil))
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+
+(defvar-local company-tng--overlay nil)
+
+;;;###autoload
+(defun company-tng-frontend (command)
+ "When the user changes the selection at least once, this
+frontend will display the candidate in the buffer as if it's
+already there and any key outside of `company-active-map' will
+confirm the selection and finish the completion."
+ (cl-case command
+ (show
+ (let ((ov (make-overlay (point) (point))))
+ (setq company-tng--overlay ov)
+ (overlay-put ov 'priority 2)))
+ (update
+ (let* ((ov company-tng--overlay)
+ (selected (and company-selection
+ (nth company-selection company-candidates)))
+ (prefix (length company-prefix)))
+ (move-overlay ov (- (point) prefix) (point))
+ (overlay-put ov
+ (if (= prefix 0) 'after-string 'display)
+ selected)))
+ (hide
+ (when company-tng--overlay
+ (delete-overlay company-tng--overlay)
+ (kill-local-variable 'company-tng--overlay)))
+ (pre-command
+ (when (and company-selection
+ (not (company--company-command-p (this-command-keys))))
+ (company--unread-this-command-keys)
+ (setq this-command 'company-complete-selection)))))
+
+(defvar company-clang-insert-arguments)
+(defvar company-semantic-insert-arguments)
+(defvar company-rtags-insert-arguments)
+(defvar lsp-enable-snippet)
+
+(defgroup company-tng nil
+ "Company Tab and Go."
+ :group 'company)
+
+(defcustom company-tng-auto-configure t
+ "Automatically apply default configure when enable `company-tng-mode'."
+ :type 'boolean)
+
+;;;###autoload
+(define-obsolete-function-alias 'company-tng-configure-default 'company-tng-mode "0.9.14"
+ "Applies the default configuration to enable company-tng.")
+
+(declare-function eglot--snippet-expansion-fn "eglot")
+
+(defvar company-tng-map
+ (let ((keymap (make-sparse-keymap)))
+ (set-keymap-parent keymap company-active-map)
+ (define-key keymap [return] nil)
+ (define-key keymap (kbd "RET") nil)
+ (define-key keymap [tab] 'company-select-next)
+ (define-key keymap (kbd "TAB") 'company-select-next)
+ (define-key keymap [backtab] 'company-select-previous)
+ (define-key keymap (kbd "S-TAB") 'company-select-previous)
+ keymap))
+
+;;;###autoload
+(define-minor-mode company-tng-mode
+ "This minor mode enables `company-tng-frontend'."
+ :init-value nil
+ :global t
+ (cond
+ (company-tng-mode
+ (setq company-frontends
+ (add-to-list 'company-frontends 'company-tng-frontend))
+ (when company-tng-auto-configure
+ (setq company-frontends '(company-tng-frontend
+ company-pseudo-tooltip-frontend
+ company-echo-metadata-frontend))
+ (setq company-require-match nil
+ company-clang-insert-arguments nil
+ company-semantic-insert-arguments nil
+ company-rtags-insert-arguments nil
+ lsp-enable-snippet nil)
+ (advice-add #'eglot--snippet-expansion-fn :override #'ignore)
+ (setq company-active-map company-tng-map))
+ (setq company-selection-default nil))
+ (t
+ (setq company-frontends
+ '(company-pseudo-tooltip-unless-just-one-frontend
+ company-preview-if-just-one-frontend
+ company-echo-metadata-frontend))
+ (when company-tng-auto-configure
+ (setq company-require-match 'company-explicit-action-p
+ company-clang-insert-arguments t
+ company-semantic-insert-arguments t
+ company-rtags-insert-arguments t
+ lsp-enable-snippet t)
+ (advice-remove #'eglot--snippet-expansion-fn #'ignore)
+ (setq company-active-map (keymap-parent company-tng-map)))
+ (setq company-selection-default 0))))
+
+(provide 'company-tng)
+;;; company-tng.el ends here
diff --git a/elpa/company-20220326.48/company-tng.elc b/elpa/company-20220326.48/company-tng.elc
new file mode 100644
index 0000000..b27cde5
--- /dev/null
+++ b/elpa/company-20220326.48/company-tng.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company-yasnippet.el b/elpa/company-20220326.48/company-yasnippet.el
new file mode 100644
index 0000000..2a84f1e
--- /dev/null
+++ b/elpa/company-20220326.48/company-yasnippet.el
@@ -0,0 +1,184 @@
+;;; company-yasnippet.el --- company-mode completion backend for Yasnippet
+
+;; Copyright (C) 2014-2015, 2020-2021 Free Software Foundation, Inc.
+
+;; Author: Dmitry Gutov
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;;
+
+;;; Code:
+
+(require 'company)
+(require 'cl-lib)
+
+(declare-function yas--table-hash "yasnippet")
+(declare-function yas--get-snippet-tables "yasnippet")
+(declare-function yas-expand-snippet "yasnippet")
+(declare-function yas--template-content "yasnippet")
+(declare-function yas--template-expand-env "yasnippet")
+(declare-function yas--warning "yasnippet")
+(declare-function yas-minor-mode "yasnippet")
+(declare-function yas--require-template-specific-condition-p "yasnippet")
+(declare-function yas--template-can-expand-p "yasnippet")
+(declare-function yas--template-condition "yasnippet")
+
+(defvar company-yasnippet-annotation-fn
+ (lambda (name)
+ (concat
+ (unless company-tooltip-align-annotations " -> ")
+ name))
+ "Function to format completion annotation.
+It has to accept one argument: the snippet's name.")
+
+(defun company-yasnippet--key-prefixes ()
+ ;; Mostly copied from `yas--templates-for-key-at-point'.
+ (defvar yas-key-syntaxes)
+ (save-excursion
+ (let ((original (point))
+ (methods yas-key-syntaxes)
+ prefixes
+ method)
+ (while methods
+ (unless (eq method (car methods))
+ (goto-char original))
+ (setq method (car methods))
+ (cond ((stringp method)
+ (skip-syntax-backward method)
+ (setq methods (cdr methods)))
+ ((functionp method)
+ (unless (eq (funcall method original)
+ 'again)
+ (setq methods (cdr methods))))
+ (t
+ (setq methods (cdr methods))
+ (yas--warning "Invalid element `%s' in `yas-key-syntaxes'" method)))
+ (let ((prefix (buffer-substring-no-properties (point) original)))
+ (unless (equal prefix (car prefixes))
+ (push prefix prefixes))))
+ prefixes)))
+
+(defun company-yasnippet--candidates (prefix)
+ ;; Process the prefixes in reverse: unlike Yasnippet, we look for prefix
+ ;; matches, so the longest prefix with any matches should be the most useful.
+ (cl-loop with tables = (yas--get-snippet-tables)
+ for key-prefix in (company-yasnippet--key-prefixes)
+ ;; Only consider keys at least as long as the symbol at point.
+ when (>= (length key-prefix) (length prefix))
+ thereis (company-yasnippet--completions-for-prefix prefix
+ key-prefix
+ tables)))
+
+(defun company-yasnippet--completions-for-prefix (prefix key-prefix tables)
+ (cl-mapcan
+ (lambda (table)
+ (let ((keyhash (yas--table-hash table))
+ (requirement (yas--require-template-specific-condition-p))
+ res)
+ (when keyhash
+ (maphash
+ (lambda (key value)
+ (when (and (stringp key)
+ (string-prefix-p key-prefix key))
+ (maphash
+ (lambda (name template)
+ (when (yas--template-can-expand-p
+ (yas--template-condition template) requirement)
+ (push
+ (propertize key
+ 'yas-annotation name
+ 'yas-template template
+ 'yas-prefix-offset (- (length key-prefix)
+ (length prefix)))
+ res)))
+ value)))
+ keyhash))
+ res))
+ tables))
+
+(defun company-yasnippet--doc (arg)
+ (let ((template (get-text-property 0 'yas-template arg))
+ (mode major-mode)
+ (file-name (buffer-file-name)))
+ (with-current-buffer (company-doc-buffer)
+ (let ((buffer-file-name file-name))
+ (yas-minor-mode 1)
+ (condition-case error
+ (yas-expand-snippet (yas--template-content template))
+ (error
+ (message "%s" (error-message-string error))))
+ (delay-mode-hooks
+ (let ((inhibit-message t))
+ (if (eq mode 'web-mode)
+ (progn
+ (setq mode 'html-mode)
+ (funcall mode))
+ (funcall mode)))
+ (ignore-errors (font-lock-ensure))))
+ (current-buffer))))
+
+;;;###autoload
+(defun company-yasnippet (command &optional arg &rest ignore)
+ "`company-mode' backend for `yasnippet'.
+
+This backend should be used with care, because as long as there are
+snippets defined for the current major mode, this backend will always
+shadow backends that come after it. Recommended usages:
+
+* In a buffer-local value of `company-backends', grouped with a backend or
+ several that provide actual text completions.
+
+ (add-hook \\='js-mode-hook
+ (lambda ()
+ (set (make-local-variable \\='company-backends)
+ \\='((company-dabbrev-code company-yasnippet)))))
+
+* After keyword `:with', grouped with other backends.
+
+ (push \\='(company-semantic :with company-yasnippet) company-backends)
+
+* Not in `company-backends', just bound to a key.
+
+ (global-set-key (kbd \"C-c y\") \\='company-yasnippet)
+"
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-yasnippet))
+ (prefix
+ ;; Should probably use `yas--current-key', but that's bound to be slower.
+ ;; How many trigger keys start with non-symbol characters anyway?
+ (and (bound-and-true-p yas-minor-mode)
+ (company-grab-symbol)))
+ (annotation
+ (funcall company-yasnippet-annotation-fn
+ (get-text-property 0 'yas-annotation arg)))
+ (candidates (company-yasnippet--candidates arg))
+ (doc-buffer (company-yasnippet--doc arg))
+ (no-cache t)
+ (kind 'snippet)
+ (post-completion
+ (let ((template (get-text-property 0 'yas-template arg))
+ (prefix-offset (get-text-property 0 'yas-prefix-offset arg)))
+ (yas-expand-snippet (yas--template-content template)
+ (- (point) (length arg) prefix-offset)
+ (point)
+ (yas--template-expand-env template))))))
+
+(provide 'company-yasnippet)
+;;; company-yasnippet.el ends here
diff --git a/elpa/company-20220326.48/company-yasnippet.elc b/elpa/company-20220326.48/company-yasnippet.elc
new file mode 100644
index 0000000..7c8deb8
--- /dev/null
+++ b/elpa/company-20220326.48/company-yasnippet.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company.el b/elpa/company-20220326.48/company.el
new file mode 100644
index 0000000..4c58707
--- /dev/null
+++ b/elpa/company-20220326.48/company.el
@@ -0,0 +1,3917 @@
+;;; company.el --- Modular text completion framework -*- lexical-binding: t -*-
+
+;; Copyright (C) 2009-2022 Free Software Foundation, Inc.
+
+;; Author: Nikolaj Schumacher
+;; Maintainer: Dmitry Gutov <dgutov@yandex.ru>
+;; URL: http://company-mode.github.io/
+;; Version: 0.9.13
+;; Keywords: abbrev, convenience, matching
+;; Package-Requires: ((emacs "25.1"))
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Company is a modular completion framework. Modules for retrieving completion
+;; candidates are called backends, modules for displaying them are frontends.
+;;
+;; Company comes with many backends, e.g. `company-etags'. These are
+;; distributed in separate files and can be used individually.
+;;
+;; Enable `company-mode' in all buffers with M-x global-company-mode. For
+;; further information look at the documentation for `company-mode' (C-h f
+;; company-mode RET).
+;;
+;; If you want to start a specific backend, call it interactively or use
+;; `company-begin-backend'. For example:
+;; M-x company-abbrev will prompt for and insert an abbrev.
+;;
+;; To write your own backend, look at the documentation for `company-backends'.
+;; Here is a simple example completing "foo":
+;;
+;; (defun company-my-backend (command &optional arg &rest ignored)
+;; (interactive (list 'interactive))
+;; (pcase command
+;; (`interactive (company-begin-backend 'company-my-backend))
+;; (`prefix (company-grab-symbol))
+;; (`candidates (list "foobar" "foobaz" "foobarbaz"))
+;; (`meta (format "This value is named %s" arg))))
+;;
+;; Sometimes it is a good idea to mix several backends together, for example to
+;; enrich gtags with dabbrev-code results (to emulate local variables). To do
+;; this, add a list with both backends as an element in `company-backends'.
+;;
+;;; Change Log:
+;;
+;; See NEWS.md in the repository.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'subr-x)
+(require 'pcase)
+
+(defgroup company nil
+ "Extensible inline text completion mechanism."
+ :group 'abbrev
+ :group 'convenience
+ :group 'matching
+ :link '(custom-manual "(company) Top"))
+
+(defgroup company-faces nil
+ "Faces used by Company."
+ :group 'company
+ :group 'faces)
+
+(defface company-tooltip
+ '((((class color) (min-colors 88) (background light))
+ (:foreground "black" :background "cornsilk"))
+ (((class color) (min-colors 88) (background dark))
+ (:background "gray26"))
+ (t (:foreground "black" :background "yellow")))
+ "Face used for the tooltip.")
+
+(defface company-tooltip-selection
+ '((((class color) (min-colors 88) (background light))
+ (:background "light blue"))
+ (((class color) (min-colors 88) (background dark))
+ (:background "gray31"))
+ (t (:background "green")))
+ "Face used for the selection in the tooltip.")
+
+(defface company-tooltip-deprecated
+ '((t (:strike-through t)))
+ "Face used for the deprecated items.")
+
+(defface company-tooltip-search
+ '((default :inherit highlight))
+ "Face used for the search string in the tooltip.")
+
+(defface company-tooltip-search-selection
+ '((default :inherit highlight))
+ "Face used for the search string inside the selection in the tooltip.")
+
+(defface company-tooltip-mouse
+ '((default :inherit highlight))
+ "Face used for the tooltip item under the mouse.")
+
+(defface company-tooltip-common
+ '((((background light))
+ :foreground "darkred")
+ (((background dark))
+ :foreground "pale turquoise"))
+ "Face used for the common completion in the tooltip.")
+
+(defface company-tooltip-common-selection
+ '((default :inherit company-tooltip-common))
+ "Face used for the selected common completion in the tooltip.")
+
+(defface company-tooltip-annotation
+ '((((background light))
+ :foreground "firebrick4")
+ (((background dark))
+ :foreground "LightCyan3"))
+ "Face used for the completion annotation in the tooltip.")
+
+(defface company-tooltip-annotation-selection
+ '((default :inherit company-tooltip-annotation))
+ "Face used for the selected completion annotation in the tooltip.")
+
+(defface company-tooltip-quick-access
+ '((default :inherit company-tooltip-annotation))
+ "Face used for the quick-access hints shown in the tooltip."
+ :package-version '(company . "0.9.14"))
+
+(defface company-tooltip-quick-access-selection
+ '((default :inherit company-tooltip-annotation-selection))
+ "Face used for the selected quick-access hints shown in the tooltip."
+ :package-version '(company . "0.9.14"))
+
+(define-obsolete-face-alias
+ 'company-scrollbar-fg
+ 'company-tooltip-scrollbar-thumb
+ "0.9.14")
+
+(defface company-tooltip-scrollbar-thumb
+ '((((background light))
+ :background "darkred")
+ (((background dark))
+ :background "gray33"))
+ "Face used for the tooltip scrollbar thumb (bar).")
+
+(define-obsolete-face-alias
+ 'company-scrollbar-bg
+ 'company-tooltip-scrollbar-track
+ "0.9.14")
+
+(defface company-tooltip-scrollbar-track
+ '((((background light))
+ :background "wheat")
+ (((background dark))
+ :background "gray28"))
+ "Face used for the tooltip scrollbar track (trough).")
+
+(defface company-preview
+ '((default :inherit (company-tooltip-selection company-tooltip)))
+ "Face used for the completion preview.")
+
+(defface company-preview-common
+ '((default :inherit company-tooltip-common-selection))
+ "Face used for the common part of the completion preview.")
+
+(defface company-preview-search
+ '((default :inherit company-tooltip-common-selection))
+ "Face used for the search string in the completion preview.")
+
+(defface company-echo nil
+ "Face used for completions in the echo area.")
+
+(defface company-echo-common
+ '((((background light)) (:foreground "firebrick4"))
+ (((background dark)) (:foreground "firebrick1")))
+ "Face used for the common part of completions in the echo area.")
+
+;; Too lazy to re-add :group to all defcustoms down below.
+(setcdr (assoc load-file-name custom-current-group-alist)
+ 'company)
+
+(defun company-frontends-set (variable value)
+ ;; Uniquify.
+ (let ((value (delete-dups (copy-sequence value))))
+ (and (or (and (memq 'company-pseudo-tooltip-unless-just-one-frontend value)
+ (memq 'company-pseudo-tooltip-frontend value))
+ (and (memq 'company-pseudo-tooltip-unless-just-one-frontend-with-delay value)
+ (memq 'company-pseudo-tooltip-frontend value))
+ (and (memq 'company-pseudo-tooltip-unless-just-one-frontend-with-delay value)
+ (memq 'company-pseudo-tooltip-unless-just-one-frontend value)))
+ (user-error "Pseudo tooltip frontend cannot be used more than once"))
+ (and (or (and (memq 'company-preview-if-just-one-frontend value)
+ (memq 'company-preview-frontend value))
+ (and (memq 'company-preview-if-just-one-frontend value)
+ (memq 'company-preview-common-frontend value))
+ (and (memq 'company-preview-frontend value)
+ (memq 'company-preview-common-frontend value))
+ )
+ (user-error "Preview frontend cannot be used twice"))
+ (and (memq 'company-echo value)
+ (memq 'company-echo-metadata-frontend value)
+ (user-error "Echo area cannot be used twice"))
+ ;; Preview must come last.
+ (dolist (f '(company-preview-if-just-one-frontend company-preview-frontend company-preview-common-frontend))
+ (when (cdr (memq f value))
+ (setq value (append (delq f value) (list f)))))
+ (set variable value)))
+
+(defcustom company-frontends '(company-pseudo-tooltip-unless-just-one-frontend
+ company-preview-if-just-one-frontend
+ company-echo-metadata-frontend)
+ "The list of active frontends (visualizations).
+Each frontend is a function that takes one argument. It is called with
+one of the following arguments:
+
+`show': When the visualization should start.
+
+`hide': When the visualization should end.
+
+`update': When the data has been updated.
+
+`pre-command': Before every command that is executed while the
+visualization is active.
+
+`post-command': After every command that is executed while the
+visualization is active.
+
+`unhide': When an asynchronous backend is waiting for its completions.
+Only needed in frontends which hide their visualizations in `pre-command'
+for technical reasons.
+
+The visualized data is stored in `company-prefix', `company-candidates',
+`company-common', `company-selection', `company-point' and
+`company-search-string'."
+ :set 'company-frontends-set
+ :type '(repeat (choice (const :tag "echo" company-echo-frontend)
+ (const :tag "echo, strip common"
+ company-echo-strip-common-frontend)
+ (const :tag "show echo meta-data in echo"
+ company-echo-metadata-frontend)
+ (const :tag "pseudo tooltip"
+ company-pseudo-tooltip-frontend)
+ (const :tag "pseudo tooltip, multiple only"
+ company-pseudo-tooltip-unless-just-one-frontend)
+ (const :tag "pseudo tooltip, multiple only, delayed"
+ company-pseudo-tooltip-unless-just-one-frontend-with-delay)
+ (const :tag "preview" company-preview-frontend)
+ (const :tag "preview, unique only"
+ company-preview-if-just-one-frontend)
+ (const :tag "preview, common"
+ company-preview-common-frontend)
+ (function :tag "custom function" nil))))
+
+(defcustom company-tooltip-limit 10
+ "The maximum number of candidates in the tooltip."
+ :type 'integer)
+
+(defcustom company-tooltip-minimum 6
+ "Ensure visibility of this number of candidates.
+When that many lines are not available between point and the bottom of the
+window, display the tooltip above point."
+ :type 'integer)
+
+(defcustom company-tooltip-minimum-width 0
+ "The minimum width of the tooltip's inner area.
+This doesn't include the margins and the scroll bar."
+ :type 'integer
+ :package-version '(company . "0.8.0"))
+
+(defcustom company-tooltip-maximum-width most-positive-fixnum
+ "The maximum width of the tooltip's inner area.
+This doesn't include the margins and the scroll bar."
+ :type 'integer
+ :package-version '(company . "0.9.5"))
+
+(defcustom company-tooltip-width-grow-only nil
+ "When non-nil, the tooltip width is not allowed to decrease."
+ :type 'boolean
+ :package-version '(company . "0.9.14"))
+
+(defcustom company-tooltip-margin 1
+ "Width of margin columns to show around the toolip."
+ :type 'integer)
+
+(defcustom company-tooltip-offset-display 'scrollbar
+ "Method using which the tooltip displays scrolling position.
+`scrollbar' means draw a scrollbar to the right of the items.
+`lines' means wrap items in lines with \"before\" and \"after\" counters."
+ :type '(choice (const :tag "Scrollbar" scrollbar)
+ (const :tag "Two lines" lines)))
+
+(defcustom company-tooltip-align-annotations nil
+ "When non-nil, align annotations to the right tooltip border."
+ :type 'boolean
+ :package-version '(company . "0.7.1"))
+
+(defcustom company-tooltip-flip-when-above nil
+ "Whether to flip the tooltip when it's above the current line."
+ :type 'boolean
+ :package-version '(company . "0.8.1"))
+
+(defvar company-safe-backends
+ '((company-abbrev . "Abbrev")
+ (company-bbdb . "BBDB")
+ (company-capf . "completion-at-point-functions")
+ (company-clang . "Clang")
+ (company-cmake . "CMake")
+ (company-css . "CSS (obsolete backend)")
+ (company-dabbrev . "dabbrev for plain text")
+ (company-dabbrev-code . "dabbrev for code")
+ (company-elisp . "Emacs Lisp (obsolete backend)")
+ (company-etags . "etags")
+ (company-files . "Files")
+ (company-gtags . "GNU Global")
+ (company-ispell . "Ispell")
+ (company-keywords . "Programming language keywords")
+ (company-nxml . "nxml (obsolete backend)")
+ (company-oddmuse . "Oddmuse")
+ (company-semantic . "Semantic")
+ (company-tempo . "Tempo templates")))
+(put 'company-safe-backends 'risky-local-variable t)
+
+(defun company-safe-backends-p (backends)
+ (and (consp backends)
+ (not (cl-dolist (backend backends)
+ (unless (if (consp backend)
+ (company-safe-backends-p backend)
+ (assq backend company-safe-backends))
+ (cl-return t))))))
+
+(defcustom company-backends `(company-bbdb
+ ,@(unless (version<= "26" emacs-version)
+ (list 'company-nxml))
+ ,@(unless (version<= "26" emacs-version)
+ (list 'company-css))
+ company-semantic
+ company-cmake
+ company-capf
+ company-clang
+ company-files
+ (company-dabbrev-code company-gtags company-etags
+ company-keywords)
+ company-oddmuse company-dabbrev)
+ "The list of active backends (completion engines).
+
+Only one backend is used at a time. The choice depends on the order of
+the items in this list, and on the values they return in response to the
+`prefix' command (see below). But a backend can also be a \"grouped\"
+one (see below).
+
+`company-begin-backend' can be used to start a specific backend,
+`company-other-backend' will skip to the next matching backend in the list.
+
+Each backend is a function that takes a variable number of arguments.
+The first argument is the command requested from the backend. It is one
+of the following:
+
+`prefix': The backend should return the text to be completed. It must be
+text immediately before point. Returning nil from this command passes
+control to the next backend. The function should return `stop' if it
+should complete but cannot (e.g. when in the middle of a symbol).
+Instead of a string, the backend may return a cons (PREFIX . LENGTH)
+where LENGTH is a number used in place of PREFIX's length when
+comparing against `company-minimum-prefix-length'. LENGTH can also
+be just t, and in the latter case the test automatically succeeds.
+
+`candidates': The second argument is the prefix to be completed. The
+return value should be a list of candidates that match the prefix.
+
+Non-prefix matches are also supported (candidates that don't start with the
+prefix, but match it in some backend-defined way). Backends that use this
+feature must disable cache (return t to `no-cache') and might also want to
+respond to `match'.
+
+Optional commands
+=================
+
+`sorted': Return t here to indicate that the candidates are sorted and will
+not need to be sorted again.
+
+`duplicates': If non-nil, company will take care of removing duplicates
+from the list.
+
+`no-cache': Usually company doesn't ask for candidates again as completion
+progresses, unless the backend returns t for this command. The second
+argument is the latest prefix.
+
+`ignore-case': Return t here if the backend returns case-insensitive
+matches. This value is used to determine the longest common prefix (as
+used in `company-complete-common'), and to filter completions when fetching
+them from cache.
+
+`meta': The second argument is a completion candidate. Return a (short)
+documentation string for it.
+
+`doc-buffer': The second argument is a completion candidate. Return a
+buffer with documentation for it. Preferably use `company-doc-buffer'. If
+not all buffer contents pertain to this candidate, return a cons of buffer
+and window start position.
+
+`location': The second argument is a completion candidate. Return a cons
+of buffer and buffer location, or of file and line number where the
+completion candidate was defined.
+
+`annotation': The second argument is a completion candidate. Return a
+string to be displayed inline with the candidate in the popup. If
+duplicates are removed by company, candidates with equal string values will
+be kept if they have different annotations. For that to work properly,
+backends should store the related information on candidates using text
+properties.
+
+`deprecated': The second argument is a completion candidate. Return
+non-nil if the completion candidate is deprecated.
+
+`match': The second argument is a completion candidate. Return a positive
+integer, the index after the end of text matching `prefix' within the
+candidate string. Alternatively, return a list of (CHUNK-START
+. CHUNK-END) elements, where CHUNK-START and CHUNK-END are indexes within
+the candidate string. The corresponding regions are be used when rendering
+the popup. This command only makes sense for backends that provide
+non-prefix completion.
+
+`require-match': If this returns t, the user is not allowed to enter
+anything not offered as a candidate. Please don't use that value in normal
+backends. The default value nil gives the user that choice with
+`company-require-match'. Return value `never' overrides that option the
+other way around (using that value will indicate that the returned set of
+completions is often incomplete, so this behavior will not be useful).
+
+`init': Called once for each buffer. The backend can check for external
+programs and files and load any required libraries. Raising an error here
+will show up in message log once, and the backend will not be used for
+completion.
+
+`post-completion': Called after a completion candidate has been inserted
+into the buffer. The second argument is the candidate. Can be used to
+modify it, e.g. to expand a snippet.
+
+`kind': The second argument is a completion candidate. Return a symbol
+describing the kind of the candidate. Refer to `company-vscode-icons-mapping'
+for the possible values.
+
+The backend should return nil for all commands it does not support or
+does not know about. It should also be callable interactively and use
+`company-begin-backend' to start itself in that case.
+
+Grouped backends
+================
+
+An element of `company-backends' can also be a list of backends. The
+completions from backends in such groups are merged, but only from those
+backends which return the same `prefix'.
+
+If a backend command takes a candidate as an argument (e.g. `meta'), the
+call is dispatched to the backend the candidate came from. In other
+cases (except for `duplicates' and `sorted'), the first non-nil value among
+all the backends is returned.
+
+The group can also contain keywords. Currently, `:with' and `:separate'
+keywords are defined. If the group contains keyword `:with', the backends
+listed after this keyword are ignored for the purpose of the `prefix'
+command. If the group contains keyword `:separate', the candidates that
+come from different backends are sorted separately in the combined list.
+
+Asynchronous backends
+=====================
+
+The return value of each command can also be a cons (:async . FETCHER)
+where FETCHER is a function of one argument, CALLBACK. When the data
+arrives, FETCHER must call CALLBACK and pass it the appropriate return
+value, as described above. That call must happen in the same buffer as
+where completion was initiated.
+
+True asynchronous operation is only supported for command `candidates', and
+only during idle completion. Other commands will block the user interface,
+even if the backend uses the asynchronous calling convention."
+ :type `(repeat
+ (choice
+ :tag "backend"
+ ,@(mapcar (lambda (b) `(const :tag ,(cdr b) ,(car b)))
+ company-safe-backends)
+ (symbol :tag "User defined")
+ (repeat :tag "Merged backends"
+ (choice :tag "backend"
+ ,@(mapcar (lambda (b)
+ `(const :tag ,(cdr b) ,(car b)))
+ company-safe-backends)
+ (const :tag "With" :with)
+ (symbol :tag "User defined"))))))
+
+(put 'company-backends 'safe-local-variable 'company-safe-backends-p)
+
+(defcustom company-transformers nil
+ "Functions to change the list of candidates received from backends.
+
+Each function gets called with the return value of the previous one.
+The first one gets passed the list of candidates, already sorted and
+without duplicates."
+ :type '(choice
+ (const :tag "None" nil)
+ (const :tag "Sort by occurrence" (company-sort-by-occurrence))
+ (const :tag "Sort by backend importance"
+ (company-sort-by-backend-importance))
+ (const :tag "Prefer case sensitive prefix"
+ (company-sort-prefer-same-case-prefix))
+ (repeat :tag "User defined" (function))))
+
+(defcustom company-completion-started-hook nil
+ "Hook run when company starts completing.
+The hook is called with one argument that is non-nil if the completion was
+started manually."
+ :type 'hook)
+
+(defcustom company-completion-cancelled-hook nil
+ "Hook run when company cancels completing.
+The hook is called with one argument that is non-nil if the completion was
+aborted manually."
+ :type 'hook)
+
+(defcustom company-completion-finished-hook nil
+ "Hook run when company successfully completes.
+The hook is called with the selected candidate as an argument.
+
+If you indend to use it to post-process candidates from a specific
+backend, consider using the `post-completion' command instead."
+ :type 'hook)
+
+(defcustom company-after-completion-hook nil
+ "Hook run at the end of completion, successful or not.
+The hook is called with one argument which is either a string or a symbol."
+ :type 'hook)
+
+(defcustom company-minimum-prefix-length 3
+ "The minimum prefix length for idle completion."
+ :type '(integer :tag "prefix length"))
+
+(defcustom company-abort-manual-when-too-short nil
+ "If enabled, cancel a manually started completion when the prefix gets
+shorter than both `company-minimum-prefix-length' and the length of the
+prefix it was started from."
+ :type 'boolean
+ :package-version '(company . "0.8.0"))
+
+(defcustom company-abort-on-unique-match t
+ "If non-nil, typing a full unique match aborts completion.
+
+You can still invoke `company-complete' manually to run the
+`post-completion' handler, though.
+
+If it's nil, completion will remain active until you type a prefix that
+doesn't match anything or finish it manually, e.g. with RET."
+ :type 'boolean)
+
+(defcustom company-require-match 'company-explicit-action-p
+ "If enabled, disallow non-matching input.
+This can be a function do determine if a match is required.
+
+This can be overridden by the backend, if it returns t or `never' to
+`require-match'. `company-insertion-on-trigger' also takes precedence over
+this."
+ :type '(choice (const :tag "Off" nil)
+ (function :tag "Predicate function")
+ (const :tag "On, if user interaction took place"
+ 'company-explicit-action-p)
+ (const :tag "On" t)))
+
+(define-obsolete-variable-alias
+ 'company-auto-complete
+ 'company-insertion-on-trigger
+ "0.9.14")
+
+(define-obsolete-variable-alias
+ 'company-auto-commit
+ 'company-insertion-on-trigger
+ "0.9.14")
+
+(defcustom company-insertion-on-trigger nil
+ "If enabled, allow triggering insertion of the selected candidate.
+This can also be a predicate function, for example,
+`company-explicit-action-p'.
+
+See `company-insertion-triggers' for more details on how to define
+triggers."
+ :type '(choice (const :tag "Off" nil)
+ (function :tag "Predicate function")
+ (const :tag "On, if user interaction took place"
+ 'company-explicit-action-p)
+ (const :tag "On" t))
+ :package-version '(company . "0.9.14"))
+
+(define-obsolete-variable-alias
+ 'company-auto-complete-chars
+ 'company-insertion-triggers
+ "0.9.14")
+
+(define-obsolete-variable-alias
+ 'company-auto-commit-chars
+ 'company-insertion-triggers
+ "0.9.14")
+
+(defcustom company-insertion-triggers '(?\ ?\) ?.)
+ "Determine triggers for `company-insertion-on-trigger'.
+
+If this is a string, then each character in it can trigger insertion of the
+selected candidate. If it is a list of syntax description characters (see
+`modify-syntax-entry'), then characters with any of those syntaxes can act
+as triggers.
+
+This can also be a function, which is called with the new input. To
+trigger insertion, the function should return a non-nil value.
+
+Note that a character that is part of a valid completion never triggers
+insertion."
+ :type '(choice (string :tag "Characters")
+ (set :tag "Syntax"
+ (const :tag "Whitespace" ?\ )
+ (const :tag "Symbol" ?_)
+ (const :tag "Opening parentheses" ?\()
+ (const :tag "Closing parentheses" ?\))
+ (const :tag "Word constituent" ?w)
+ (const :tag "Punctuation." ?.)
+ (const :tag "String quote." ?\")
+ (const :tag "Paired delimiter." ?$)
+ (const :tag "Expression quote or prefix operator." ?\')
+ (const :tag "Comment starter." ?<)
+ (const :tag "Comment ender." ?>)
+ (const :tag "Character-quote." ?/)
+ (const :tag "Generic string fence." ?|)
+ (const :tag "Generic comment fence." ?!))
+ (function :tag "Predicate function"))
+ :package-version '(company . "0.9.14"))
+
+(defcustom company-idle-delay .2
+ "The idle delay in seconds until completion starts automatically.
+The prefix still has to satisfy `company-minimum-prefix-length' before that
+happens. The value of nil means no idle completion."
+ :type '(choice (const :tag "never (nil)" nil)
+ (const :tag "immediate (0)" 0)
+ (function :tag "Predicate function")
+ (number :tag "seconds")))
+
+(defcustom company-tooltip-idle-delay .5
+ "The idle delay in seconds until tooltip is shown when using
+`company-pseudo-tooltip-unless-just-one-frontend-with-delay'."
+ :type '(choice (const :tag "never (nil)" nil)
+ (const :tag "immediate (0)" 0)
+ (number :tag "seconds")))
+
+(defcustom company-begin-commands '(self-insert-command
+ org-self-insert-command
+ orgtbl-self-insert-command
+ c-scope-operator
+ c-electric-colon
+ c-electric-lt-gt
+ c-electric-slash)
+ "A list of commands after which idle completion is allowed.
+If this is t, it can show completions after any command except a few from a
+pre-defined list. See `company-idle-delay'.
+
+Alternatively, any command with a non-nil `company-begin' property is
+treated as if it was on this list."
+ :type '(choice (const :tag "Any command" t)
+ (const :tag "Self insert command" '(self-insert-command))
+ (repeat :tag "Commands" function))
+ :package-version '(company . "0.8.4"))
+
+(defcustom company-continue-commands '(not save-buffer save-some-buffers
+ save-buffers-kill-terminal
+ save-buffers-kill-emacs
+ completion-at-point)
+ "A list of commands that are allowed during completion.
+If this is t, or if `company-begin-commands' is t, any command is allowed.
+Otherwise, the value must be a list of symbols. If it starts with `not',
+the cdr is the list of commands that abort completion. Otherwise, all
+commands except those in that list, or in `company-begin-commands', or
+commands in the `company-' namespace, abort completion."
+ :type '(choice (const :tag "Any command" t)
+ (cons :tag "Any except"
+ (const not)
+ (repeat :tag "Commands" function))
+ (repeat :tag "Commands" function)))
+
+(defun company-custom--set-quick-access (option value)
+ "Re-bind quick-access key sequences on OPTION VALUE change."
+ (when (boundp 'company-active-map)
+ (company-keymap--unbind-quick-access company-active-map))
+ (when (boundp 'company-search-map)
+ (company-keymap--unbind-quick-access company-search-map))
+ (custom-set-default option value)
+ (when (boundp 'company-active-map)
+ (company-keymap--bind-quick-access company-active-map))
+ (when (boundp 'company-search-map)
+ (company-keymap--bind-quick-access company-search-map)))
+
+(defcustom company-quick-access-keys '("1" "2" "3" "4" "5" "6" "7" "8" "9" "0")
+ "Character strings used as a part of quick-access key sequences.
+To change this value without Customize interface, use `customize-set-variable'.
+
+To change the quick-access key sequences modifier, customize
+`company-quick-access-modifier'.
+
+If `company-show-quick-access' is non-nil, show quick-access hints
+beside the candidates."
+ :set #'company-custom--set-quick-access
+ :type '(choice
+ (const :tag "Digits" ("1" "2" "3" "4" "5" "6" "7" "8" "9" "0"))
+ (const :tag "QWERTY home row" ("a" "s" "d" "f" "g" "h" "j" "k" "l" ";"))
+ ;; TODO un-comment on removal of `M-n' `company--select-next-and-warn'.
+ ;; (const :tag "Dvorak home row" ("a" "o" "e" "u" "i" "d" "h" "t" "n" "s"))
+ (repeat :tag "User defined" string))
+ :package-version '(company . "0.9.14"))
+
+(defcustom company-quick-access-modifier 'meta
+ "Modifier key used for quick-access keys sequences.
+To change this value without Customize interface, use `customize-set-variable'.
+See `company-quick-access-keys' for more details."
+ :set #'company-custom--set-quick-access
+ :type '(choice (const :tag "Meta key" meta)
+ (const :tag "Super key" super)
+ (const :tag "Hyper key" hyper)
+ (const :tag "Control key" control))
+ :package-version '(company . "0.9.14"))
+
+(defun company-keymap--quick-access-modifier ()
+ "Return string representation of the `company-quick-access-modifier'."
+ (if-let ((modifier (assoc-default company-quick-access-modifier
+ '((meta . "M")
+ (super . "s")
+ (hyper . "H")
+ (control . "C")))))
+ modifier
+ (warn "company-quick-access-modifier value unknown: %S"
+ company-quick-access-modifier)
+ "M"))
+
+(defun company-keymap--unbind-quick-access (keymap)
+ (let ((modifier (company-keymap--quick-access-modifier)))
+ (dolist (key company-quick-access-keys)
+ (let ((key-seq (company-keymap--kbd-quick-access modifier key)))
+ (when (equal (lookup-key keymap key-seq) 'company-complete-quick-access)
+ (define-key keymap key-seq nil))))))
+
+(defun company-keymap--bind-quick-access (keymap)
+ (let ((modifier (company-keymap--quick-access-modifier)))
+ (dolist (key company-quick-access-keys)
+ (let ((key-seq (company-keymap--kbd-quick-access modifier key)))
+ (if (lookup-key keymap key-seq)
+ (warn "Key sequence %s already bound" (key-description key-seq))
+ (define-key keymap key-seq #'company-complete-quick-access))))))
+
+(defun company-keymap--kbd-quick-access (modifier key)
+ (kbd (format "%s-%s" modifier key)))
+
+(define-obsolete-variable-alias
+ 'company-show-numbers
+ 'company-show-quick-access
+ "0.9.14")
+
+(defcustom company-show-quick-access nil
+ "If non-nil, show quick-access hints beside the candidates.
+
+For a tooltip frontend, non-nil value enables a column with the hints
+on the right side of the tooltip, unless the configured value is `left'.
+
+To change the quick-access key bindings, customize `company-quick-access-keys'
+and `company-quick-access-modifier'.
+
+To change the shown quick-access hints, customize
+`company-quick-access-hint-function'."
+ :type '(choice (const :tag "off" nil)
+ (const :tag "left" left)
+ (const :tag "on" t)))
+
+(defcustom company-show-numbers-function nil
+ "Function called to get quick-access numbers for the first ten candidates.
+
+The function receives the candidate number (starting from 1) and should
+return a string prefixed with one space."
+ :type 'function)
+(make-obsolete-variable
+ 'company-show-numbers-function
+ "use `company-quick-access-hint-function' instead,
+but adjust the expected values appropriately."
+ "0.9.14")
+
+(defcustom company-quick-access-hint-function #'company-quick-access-hint-key
+ "Function called to get quick-access hints for the candidates.
+
+The function receives a candidate's 0-based number
+and should return a string.
+See `company-show-quick-access' for more details."
+ :type 'function)
+
+(defun company-quick-access-hint-key (candidate)
+ "Return a quick-access key for the CANDIDATE number.
+This is a default value of `company-quick-access-hint-function'."
+ (if company-show-numbers-function
+ (funcall company-show-numbers-function (1+ candidate))
+ (format "%s"
+ (if (< candidate (length company-quick-access-keys))
+ (nth candidate company-quick-access-keys)
+ ""))))
+
+(defcustom company-selection-wrap-around nil
+ "If enabled, selecting item before first or after last wraps around."
+ :type '(choice (const :tag "off" nil)
+ (const :tag "on" t)))
+
+(defcustom company-async-redisplay-delay 0.005
+ "Delay before redisplay when fetching candidates asynchronously.
+
+You might want to set this to a higher value if your backends respond
+quickly, to avoid redisplaying twice per each typed character."
+ :type 'number)
+
+(defvar company-async-wait 0.03
+ "Pause between checks to see if the value's been set when turning an
+asynchronous call into synchronous.")
+
+(defvar company-async-timeout 2
+ "Maximum wait time for a value to be set during asynchronous call.")
+
+;;; mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar company-mode-map (make-sparse-keymap)
+ "Keymap used by `company-mode'.")
+
+(defvar company-active-map
+ (let ((keymap (make-sparse-keymap)))
+ (define-key keymap "\e\e\e" 'company-abort)
+ (define-key keymap "\C-g" 'company-abort)
+ (define-key keymap (kbd "M-n") 'company--select-next-and-warn)
+ (define-key keymap (kbd "M-p") 'company--select-previous-and-warn)
+ (define-key keymap (kbd "C-n") 'company-select-next-or-abort)
+ (define-key keymap (kbd "C-p") 'company-select-previous-or-abort)
+ (define-key keymap (kbd "<down>") 'company-select-next-or-abort)
+ (define-key keymap (kbd "<up>") 'company-select-previous-or-abort)
+ (define-key keymap [remap scroll-up-command] 'company-next-page)
+ (define-key keymap [remap scroll-down-command] 'company-previous-page)
+ (define-key keymap [down-mouse-1] 'ignore)
+ (define-key keymap [down-mouse-3] 'ignore)
+ (define-key keymap [mouse-1] 'company-complete-mouse)
+ (define-key keymap [mouse-3] 'company-select-mouse)
+ (define-key keymap [up-mouse-1] 'ignore)
+ (define-key keymap [up-mouse-3] 'ignore)
+ (define-key keymap [return] 'company-complete-selection)
+ (define-key keymap (kbd "RET") 'company-complete-selection)
+ (define-key keymap [tab] 'company-complete-common)
+ (define-key keymap (kbd "TAB") 'company-complete-common)
+ (define-key keymap (kbd "<f1>") 'company-show-doc-buffer)
+ (define-key keymap (kbd "C-h") 'company-show-doc-buffer)
+ (define-key keymap "\C-w" 'company-show-location)
+ (define-key keymap "\C-s" 'company-search-candidates)
+ (define-key keymap "\C-\M-s" 'company-filter-candidates)
+ (company-keymap--bind-quick-access keymap)
+ keymap)
+ "Keymap that is enabled during an active completion.")
+
+(defvar company--disabled-backends nil)
+
+(defun company--select-next-and-warn (&optional arg)
+ (interactive "p")
+ (company--warn-changed-binding)
+ (company-select-next arg))
+
+(defun company--select-previous-and-warn (&optional arg)
+ (interactive "p")
+ (company--warn-changed-binding)
+ (company-select-previous arg))
+
+(defun company--warn-changed-binding ()
+ (interactive)
+ (run-with-idle-timer
+ 0.01 nil
+ (lambda ()
+ (message "Warning: default bindings are being changed to C-n and C-p"))))
+
+(defun company-init-backend (backend)
+ (and (symbolp backend)
+ (not (fboundp backend))
+ (ignore-errors (require backend nil t)))
+ (cond
+ ((symbolp backend)
+ (condition-case err
+ (progn
+ (funcall backend 'init)
+ (put backend 'company-init t))
+ (error
+ (put backend 'company-init 'failed)
+ (unless (memq backend company--disabled-backends)
+ (message "Company backend '%s' could not be initialized:\n%s"
+ backend (error-message-string err)))
+ (cl-pushnew backend company--disabled-backends)
+ nil)))
+ ;; No initialization for lambdas.
+ ((functionp backend) t)
+ (t ;; Must be a list.
+ (cl-dolist (b backend)
+ (unless (keywordp b)
+ (company-init-backend b))))))
+
+(defun company--maybe-init-backend (backend)
+ (or (not (symbolp backend))
+ (eq t (get backend 'company-init))
+ (unless (get backend 'company-init)
+ (company-init-backend backend))))
+
+(defcustom company-lighter-base "company"
+ "Base string to use for the `company-mode' lighter."
+ :type 'string
+ :package-version '(company . "0.8.10"))
+
+(defvar company-lighter '(" "
+ (company-candidates
+ (:eval
+ (if (consp company-backend)
+ (when company-selection
+ (company--group-lighter (nth company-selection
+ company-candidates)
+ company-lighter-base))
+ (symbol-name company-backend)))
+ company-lighter-base))
+ "Mode line lighter for Company.
+
+The value of this variable is a mode line template as in
+`mode-line-format'.")
+
+(put 'company-lighter 'risky-local-variable t)
+
+;;;###autoload
+(define-minor-mode company-mode
+ "\"complete anything\"; is an in-buffer completion framework.
+Completion starts automatically, depending on the values
+`company-idle-delay' and `company-minimum-prefix-length'.
+
+Completion can be controlled with the commands:
+`company-complete-common', `company-complete-selection', `company-complete',
+`company-select-next', `company-select-previous'. If these commands are
+called before `company-idle-delay', completion will also start.
+
+Completions can be searched with `company-search-candidates' or
+`company-filter-candidates'. These can be used while completion is
+inactive, as well.
+
+The completion data is retrieved using `company-backends' and displayed
+using `company-frontends'. If you want to start a specific backend, call
+it interactively or use `company-begin-backend'.
+
+By default, the completions list is sorted alphabetically, unless the
+backend chooses otherwise, or `company-transformers' changes it later.
+
+regular keymap (`company-mode-map'):
+
+\\{company-mode-map}
+keymap during active completions (`company-active-map'):
+
+\\{company-active-map}"
+ :lighter company-lighter
+ (if company-mode
+ (progn
+ (add-hook 'pre-command-hook 'company-pre-command nil t)
+ (add-hook 'post-command-hook 'company-post-command nil t)
+ (add-hook 'yas-keymap-disable-hook 'company--active-p nil t)
+ (mapc 'company-init-backend company-backends))
+ (remove-hook 'pre-command-hook 'company-pre-command t)
+ (remove-hook 'post-command-hook 'company-post-command t)
+ (remove-hook 'yas-keymap-disable-hook 'company--active-p t)
+ (company-cancel)
+ (kill-local-variable 'company-point)))
+
+(defcustom company-global-modes t
+ "Modes for which `company-mode' mode is turned on by `global-company-mode'.
+If nil, means no modes. If t, then all major modes have it turned on.
+If a list, it should be a list of `major-mode' symbol names for which
+`company-mode' should be automatically turned on. The sense of the list is
+negated if it begins with `not'. For example:
+ (c-mode c++-mode)
+means that `company-mode' is turned on for buffers in C and C++ modes only.
+ (not message-mode)
+means that `company-mode' is always turned on except in `message-mode' buffers."
+ :type '(choice (const :tag "none" nil)
+ (const :tag "all" t)
+ (set :menu-tag "mode specific" :tag "modes"
+ :value (not)
+ (const :tag "Except" not)
+ (repeat :inline t (symbol :tag "mode")))))
+
+;;;###autoload
+(define-globalized-minor-mode global-company-mode company-mode company-mode-on)
+
+(defun company-mode-on ()
+ (when (and (not (or noninteractive (eq (aref (buffer-name) 0) ?\s)))
+ (cond ((eq company-global-modes t)
+ t)
+ ((eq (car-safe company-global-modes) 'not)
+ (not (memq major-mode (cdr company-global-modes))))
+ (t (memq major-mode company-global-modes))))
+ (company-mode 1)))
+
+(defsubst company-assert-enabled ()
+ (unless company-mode
+ (company-uninstall-map)
+ (user-error "Company not enabled")))
+
+;;; keymaps ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar-local company-my-keymap nil)
+
+(defvar company-emulation-alist '((t . nil)))
+
+(defun company-enable-overriding-keymap (keymap)
+ (company-uninstall-map)
+ (setq company-my-keymap keymap))
+
+(defun company-ensure-emulation-alist ()
+ (unless (eq 'company-emulation-alist (car emulation-mode-map-alists))
+ (setq emulation-mode-map-alists
+ (cons 'company-emulation-alist
+ (delq 'company-emulation-alist emulation-mode-map-alists)))))
+
+(defun company-install-map ()
+ (unless (or (cdar company-emulation-alist)
+ (null company-my-keymap))
+ (setf (cdar company-emulation-alist) company-my-keymap)))
+
+(defun company-uninstall-map ()
+ (setf (cdar company-emulation-alist) nil))
+
+(defun company--company-command-p (keys)
+ "Checks if the keys are part of company's overriding keymap"
+ (or (equal [company-dummy-event] keys)
+ (commandp (lookup-key company-my-keymap keys))))
+
+;; To avoid warnings in Emacs < 26.
+(declare-function line-number-display-width "indent.c")
+
+(defun company--posn-col-row (posn)
+ (let ((col (car (posn-col-row posn)))
+ ;; `posn-col-row' doesn't work well with lines of different height.
+ ;; `posn-actual-col-row' doesn't handle multiple-width characters.
+ (row (cdr (or (posn-actual-col-row posn)
+ ;; When position is non-visible for some reason.
+ (posn-col-row posn)))))
+ (when (bound-and-true-p display-line-numbers)
+ (cl-decf col (+ 2 (line-number-display-width))))
+ (cons (+ col (window-hscroll)) row)))
+
+(defun company--col-row (&optional pos)
+ (company--posn-col-row (posn-at-point pos)))
+
+(defun company--row (&optional pos)
+ (cdr (company--col-row pos)))
+
+;;; backends ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar-local company-backend nil)
+
+(defun company-grab (regexp &optional expression limit)
+ (when (looking-back regexp limit)
+ (or (match-string-no-properties (or expression 0)) "")))
+
+(defun company-grab-line (regexp &optional expression)
+ "Return a match string for REGEXP if it matches text before point.
+If EXPRESSION is non-nil, return the match string for the respective
+parenthesized expression in REGEXP.
+Matching is limited to the current line."
+ (let ((inhibit-field-text-motion t))
+ (company-grab regexp expression (point-at-bol))))
+
+(defun company-grab-symbol ()
+ "If point is at the end of a symbol, return it.
+Otherwise, if point is not inside a symbol, return an empty string."
+ (if (looking-at "\\_>")
+ (buffer-substring (point) (save-excursion (skip-syntax-backward "w_")
+ (point)))
+ (unless (and (char-after) (memq (char-syntax (char-after)) '(?w ?_)))
+ "")))
+
+(defun company-grab-word ()
+ "If point is at the end of a word, return it.
+Otherwise, if point is not inside a symbol, return an empty string."
+ (if (looking-at "\\>")
+ (buffer-substring (point) (save-excursion (skip-syntax-backward "w")
+ (point)))
+ (unless (and (char-after) (eq (char-syntax (char-after)) ?w))
+ "")))
+
+(defun company-grab-symbol-cons (idle-begin-after-re &optional max-len)
+ "Return a string SYMBOL or a cons (SYMBOL . t).
+SYMBOL is as returned by `company-grab-symbol'. If the text before point
+matches IDLE-BEGIN-AFTER-RE, return it wrapped in a cons."
+ (let ((symbol (company-grab-symbol)))
+ (when symbol
+ (save-excursion
+ (forward-char (- (length symbol)))
+ (if (looking-back idle-begin-after-re (if max-len
+ (- (point) max-len)
+ (line-beginning-position)))
+ (cons symbol t)
+ symbol)))))
+
+(defun company-in-string-or-comment ()
+ "Return non-nil if point is within a string or comment."
+ (let ((ppss (syntax-ppss)))
+ (or (car (setq ppss (nthcdr 3 ppss)))
+ (car (setq ppss (cdr ppss)))
+ (nth 3 ppss))))
+
+(defun company-call-backend (&rest args)
+ (company--force-sync #'company-call-backend-raw args company-backend))
+
+(defun company--force-sync (fun args backend)
+ (let ((value (apply fun args)))
+ (if (not (eq (car-safe value) :async))
+ value
+ (let ((res 'trash)
+ (start (time-to-seconds)))
+ (funcall (cdr value)
+ (lambda (result) (setq res result)))
+ (while (eq res 'trash)
+ (if (> (- (time-to-seconds) start) company-async-timeout)
+ (error "Company: backend %s async timeout with args %s"
+ backend args)
+ ;; XXX: Reusing the trick from company--fetch-candidates here
+ ;; doesn't work well: sit-for isn't a good fit when we want to
+ ;; ignore pending input (results in too many calls).
+ ;; FIXME: We should deal with this by standardizing on a kind of
+ ;; Future object that knows how to sync itself. In most cases (but
+ ;; not all), by calling accept-process-output, probably.
+ (sleep-for company-async-wait)))
+ res))))
+
+(defun company-call-backend-raw (&rest args)
+ (condition-case-unless-debug err
+ (if (functionp company-backend)
+ (apply company-backend args)
+ (apply #'company--multi-backend-adapter company-backend args))
+ (user-error (user-error
+ "Company: backend %s user-error: %s"
+ company-backend (error-message-string err)))
+ (error (error "Company: backend %s error \"%s\" with args %s"
+ company-backend (error-message-string err) args))))
+
+(defun company--multi-backend-adapter (backends command &rest args)
+ (let ((backends (cl-loop for b in backends
+ when (or (keywordp b)
+ (company--maybe-init-backend b))
+ collect b))
+ (separate (memq :separate backends)))
+
+ (when (eq command 'prefix)
+ (setq backends (butlast backends (length (member :with backends)))))
+
+ (setq backends (cl-delete-if #'keywordp backends))
+
+ (pcase command
+ (`candidates
+ (company--multi-backend-adapter-candidates backends (car args) separate))
+ (`sorted separate)
+ (`duplicates (not separate))
+ ((or `prefix `ignore-case `no-cache `require-match)
+ (let (value)
+ (cl-dolist (backend backends)
+ (when (setq value (company--force-sync
+ backend (cons command args) backend))
+ (when (and (eq command 'ignore-case)
+ (eq value 'keep-prefix))
+ (setq value t))
+ (cl-return value)))))
+ (_
+ (let ((arg (car args)))
+ (when (> (length arg) 0)
+ (let ((backend (or (get-text-property 0 'company-backend arg)
+ (car backends))))
+ (apply backend command args))))))))
+
+(defun company--multi-backend-adapter-candidates (backends prefix separate)
+ (let ((pairs (cl-loop for backend in backends
+ when (equal (company--prefix-str
+ (let ((company-backend backend))
+ (company-call-backend 'prefix)))
+ prefix)
+ collect (cons (funcall backend 'candidates prefix)
+ (company--multi-candidates-mapper
+ backend
+ separate
+ ;; Small perf optimization: don't tag the
+ ;; candidates received from the first
+ ;; backend in the group.
+ (not (eq backend (car backends))))))))
+ (company--merge-async pairs (lambda (values) (apply #'append values)))))
+
+(defun company--multi-candidates-mapper (backend separate tag)
+ (lambda (candidates)
+ (when separate
+ (let ((company-backend backend))
+ (setq candidates
+ (company--preprocess-candidates candidates))))
+ (when tag
+ (setq candidates
+ (mapcar
+ (lambda (str)
+ (propertize str 'company-backend backend))
+ candidates)))
+ candidates))
+
+(defun company--merge-async (pairs merger)
+ (let ((async (cl-loop for pair in pairs
+ thereis
+ (eq :async (car-safe (car pair))))))
+ (if (not async)
+ (funcall merger (cl-loop for (val . mapper) in pairs
+ collect (funcall mapper val)))
+ (cons
+ :async
+ (lambda (callback)
+ (let* (lst
+ (pending (mapcar #'car pairs))
+ (finisher (lambda ()
+ (unless pending
+ (funcall callback
+ (funcall merger
+ (nreverse lst)))))))
+ (dolist (pair pairs)
+ (push nil lst)
+ (let* ((cell lst)
+ (val (car pair))
+ (mapper (cdr pair))
+ (this-finisher (lambda (res)
+ (setq pending (delq val pending))
+ (setcar cell (funcall mapper res))
+ (funcall finisher))))
+ (if (not (eq :async (car-safe val)))
+ (funcall this-finisher val)
+ (let ((fetcher (cdr val)))
+ (funcall fetcher this-finisher)))))))))))
+
+(defun company--prefix-str (prefix)
+ (or (car-safe prefix) prefix))
+
+;;; completion mechanism ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar-local company-prefix nil)
+
+(defvar-local company-candidates nil)
+
+(defvar-local company-candidates-length nil)
+
+(defvar-local company-candidates-cache nil)
+
+(defvar-local company-candidates-predicate nil)
+
+(defvar-local company-common nil)
+
+(defvar company-selection-default 0
+ "The default value for `company-selection'.")
+(defvar-local company-selection company-selection-default)
+
+(defvar-local company-selection-changed nil)
+
+(defvar-local company--manual-action nil
+ "Non-nil, if manual completion took place.")
+
+(defvar-local company--manual-prefix nil)
+
+(defvar-local company--point-max nil)
+
+(defvar-local company-point nil)
+
+(defvar company-timer nil)
+(defvar company-tooltip-timer nil)
+
+(defsubst company-strip-prefix (str)
+ (substring str (length company-prefix)))
+
+(defun company--insert-candidate (candidate)
+ (when (> (length candidate) 0)
+ (setq candidate (substring-no-properties candidate))
+ ;; XXX: Return value we check here is subject to change.
+ (if (eq (company-call-backend 'ignore-case) 'keep-prefix)
+ (insert (company-strip-prefix candidate))
+ (unless (equal company-prefix candidate)
+ (delete-region (- (point) (length company-prefix)) (point))
+ (insert candidate)))))
+
+(defmacro company-with-candidate-inserted (candidate &rest body)
+ "Evaluate BODY with CANDIDATE temporarily inserted.
+This is a tool for backends that need candidates inserted before they
+can retrieve meta-data for them."
+ (declare (indent 1))
+ `(let ((inhibit-modification-hooks t)
+ (inhibit-point-motion-hooks t)
+ (modified-p (buffer-modified-p)))
+ (company--insert-candidate ,candidate)
+ (unwind-protect
+ (progn ,@body)
+ (delete-region company-point (point))
+ (set-buffer-modified-p modified-p))))
+
+(defun company-explicit-action-p ()
+ "Return whether explicit completion action was taken by the user."
+ (or company--manual-action
+ company-selection-changed))
+
+(defun company-reformat (candidate)
+ ;; company-ispell needs this, because the results are always lower-case
+ ;; It's mory efficient to fix it only when they are displayed.
+ ;; FIXME: Adopt the current text's capitalization instead?
+ (if (eq (company-call-backend 'ignore-case) 'keep-prefix)
+ (let ((prefix (company--clean-string company-prefix)))
+ (concat prefix (substring candidate (length prefix))))
+ candidate))
+
+(defun company--should-complete ()
+ (and (eq company-idle-delay 'now)
+ (not (or buffer-read-only
+ overriding-local-map))
+ ;; Check if in the middle of entering a key combination.
+ (or (equal (this-command-keys-vector) [])
+ (not (keymapp (key-binding (this-command-keys-vector)))))
+ (not (and transient-mark-mode mark-active))))
+
+(defun company--should-continue ()
+ (or (eq t company-begin-commands)
+ (eq t company-continue-commands)
+ (if (eq 'not (car company-continue-commands))
+ (not (memq this-command (cdr company-continue-commands)))
+ (or (memq this-command company-begin-commands)
+ (memq this-command company-continue-commands)
+ (and (symbolp this-command)
+ (string-match-p "\\`company-" (symbol-name this-command)))))))
+
+(defun company-call-frontends (command)
+ (cl-loop for frontend in company-frontends collect
+ (condition-case-unless-debug err
+ (funcall frontend command)
+ (error (error "Company: frontend %s error \"%s\" on command %s"
+ frontend (error-message-string err) command)))))
+
+(defun company-set-selection (selection &optional force-update)
+ "Set SELECTION for company candidates.
+This will update `company-selection' and related variable.
+Only update when the current selection is changed, but optionally always
+update if FORCE-UPDATE."
+ (when selection
+ (let* ((offset (if company-selection-default 0 1))
+ (company-candidates-length
+ (+ company-candidates-length offset)))
+ (setq selection (+ selection offset))
+ (setq selection
+ (if company-selection-wrap-around
+ (mod selection company-candidates-length)
+ (max 0 (min (1- company-candidates-length) selection))))
+ (setq selection (unless (< selection offset)
+ (- selection offset)))))
+ (when (or force-update (not (equal selection company-selection)))
+ (setq company-selection selection
+ company-selection-changed t)
+ (company-call-frontends 'update)))
+
+(defun company--group-lighter (candidate base)
+ (let ((backend (or (get-text-property 0 'company-backend candidate)
+ (cl-some (lambda (x) (and (not (keywordp x)) x))
+ company-backend))))
+ (when (and backend (symbolp backend))
+ (let ((name (replace-regexp-in-string "company-\\|-company" ""
+ (symbol-name backend))))
+ (format "%s-<%s>" base name)))))
+
+(defun company-update-candidates (candidates)
+ (setq company-candidates-length (length candidates))
+ (if company-selection-changed
+ ;; Try to restore the selection
+ (let ((selected (and company-selection
+ (nth company-selection company-candidates))))
+ (setq company-candidates candidates)
+ (when selected
+ (setq company-selection 0)
+ (catch 'found
+ (while candidates
+ (let ((candidate (pop candidates)))
+ (when (and (string= candidate selected)
+ (equal (company-call-backend 'annotation candidate)
+ (company-call-backend 'annotation selected)))
+ (throw 'found t)))
+ (cl-incf company-selection))
+ (setq company-selection company-selection-default
+ company-selection-changed nil))))
+ (setq company-selection company-selection-default
+ company-candidates candidates))
+ ;; Calculate common.
+ (let ((completion-ignore-case (company-call-backend 'ignore-case)))
+ ;; We want to support non-prefix completion, so filtering is the
+ ;; responsibility of each respective backend, not ours.
+ ;; On the other hand, we don't want to replace non-prefix input in
+ ;; `company-complete-common', unless there's only one candidate.
+ (setq company-common
+ (if (cdr company-candidates)
+ (let ((common (try-completion "" company-candidates)))
+ (when (string-prefix-p company-prefix common
+ completion-ignore-case)
+ common))
+ (car company-candidates)))))
+
+(defun company-calculate-candidates (prefix ignore-case)
+ (let ((candidates (cdr (assoc prefix company-candidates-cache))))
+ (or candidates
+ (when company-candidates-cache
+ (let ((len (length prefix))
+ (completion-ignore-case ignore-case)
+ prev)
+ (cl-dotimes (i (1+ len))
+ (when (setq prev (cdr (assoc (substring prefix 0 (- len i))
+ company-candidates-cache)))
+ (setq candidates (all-completions prefix prev))
+ (cl-return t)))))
+ ;; No cache match, call the backend.
+ (let ((refresh-timer (run-with-timer company-async-redisplay-delay
+ nil #'company--sneaky-refresh)))
+ (setq candidates (company--preprocess-candidates
+ (company--fetch-candidates prefix)))
+ ;; If the backend is synchronous, no chance for the timer to run.
+ (cancel-timer refresh-timer)
+ ;; Save in cache.
+ (push (cons prefix candidates) company-candidates-cache)))
+ ;; Only now apply the predicate and transformers.
+ (company--postprocess-candidates candidates)))
+
+(defun company--unique-match-p (candidates prefix ignore-case)
+ (and candidates
+ (not (cdr candidates))
+ (eq t (compare-strings (car candidates) nil nil
+ prefix nil nil ignore-case))))
+
+(defun company--fetch-candidates (prefix)
+ (let* ((non-essential (not (company-explicit-action-p)))
+ (inhibit-redisplay t)
+ (c (if (or company-selection-changed
+ ;; FIXME: This is not ideal, but we have not managed to deal
+ ;; with these situations in a better way yet.
+ (company-require-match-p))
+ (company-call-backend 'candidates prefix)
+ (company-call-backend-raw 'candidates prefix))))
+ (if (not (eq (car c) :async))
+ c
+ (let ((res 'none))
+ (funcall
+ (cdr c)
+ (lambda (candidates)
+ (when (eq res 'none)
+ (push 'company-foo unread-command-events))
+ (setq res candidates)))
+ (if (company--flyspell-workaround-p)
+ (while (and (eq res 'none)
+ (not (input-pending-p)))
+ (sleep-for company-async-wait))
+ (while (and (eq res 'none)
+ (sit-for 0.5 t))))
+ (while (member (car unread-command-events)
+ '(company-foo (t . company-foo)))
+ (pop unread-command-events))
+ (prog1
+ (and (consp res) res)
+ (setq res 'exited))))))
+
+(defun company--sneaky-refresh ()
+ (when company-candidates (company-call-frontends 'unhide))
+ (let (inhibit-redisplay)
+ (redisplay))
+ (when company-candidates (company-call-frontends 'pre-command)))
+
+(defun company--flyspell-workaround-p ()
+ ;; https://debbugs.gnu.org/23980
+ (and (bound-and-true-p flyspell-mode)
+ (version< emacs-version "27")))
+
+(defun company--preprocess-candidates (candidates)
+ (cl-assert (cl-every #'stringp candidates))
+ (unless (company-call-backend 'sorted)
+ (setq candidates (sort candidates 'string<)))
+ (when (company-call-backend 'duplicates)
+ (company--strip-duplicates candidates))
+ candidates)
+
+(defun company--postprocess-candidates (candidates)
+ (when (or company-candidates-predicate company-transformers)
+ (setq candidates (copy-sequence candidates)))
+ (when company-candidates-predicate
+ (setq candidates (cl-delete-if-not company-candidates-predicate candidates)))
+ (company--transform-candidates candidates))
+
+(defun company--strip-duplicates (candidates)
+ (let ((c2 candidates)
+ (extras 'unk))
+ (while c2
+ (setcdr c2
+ (let ((str (pop c2)))
+ (while (let ((str2 (car c2)))
+ (if (not (equal str str2))
+ (progn
+ (setq extras 'unk)
+ nil)
+ (when (eq extras 'unk)
+ (setq extras (list (cons (company-call-backend
+ 'annotation str)
+ (company-call-backend
+ 'kind str)))))
+ (let ((extra2 (cons (company-call-backend
+ 'annotation str2)
+ (company-call-backend
+ 'kind str2))))
+ (if (member extra2 extras)
+ t
+ (push extra2 extras)
+ nil))))
+ (pop c2))
+ c2)))))
+
+(defun company--transform-candidates (candidates)
+ (let ((c candidates))
+ (dolist (tr company-transformers)
+ (setq c (funcall tr c)))
+ c))
+
+(defcustom company-occurrence-weight-function
+ #'company-occurrence-prefer-closest-above
+ "Function to weigh matches in `company-sort-by-occurrence'.
+It's called with three arguments: cursor position, the beginning and the
+end of the match."
+ :type '(choice
+ (const :tag "First above point, then below point"
+ company-occurrence-prefer-closest-above)
+ (const :tag "Prefer closest in any direction"
+ company-occurrence-prefer-any-closest)))
+
+(defvar company-vscode-icons-mapping
+ '((array . "symbol-array.svg")
+ (boolean . "symbol-boolean.svg")
+ (class . "symbol-class.svg")
+ (color . "symbol-color.svg")
+ (constant . "symbol-constant.svg")
+ (constructor . "symbol-method.svg")
+ (enum-member . "symbol-enumerator-member.svg")
+ (enum . "symbol-enumerator.svg")
+ (event . "symbol-event.svg")
+ (field . "symbol-field.svg")
+ (file . "symbol-file.svg")
+ (folder . "folder.svg")
+ (interface . "symbol-interface.svg")
+ (keyword . "symbol-keyword.svg")
+ (method . "symbol-method.svg")
+ (function . "symbol-method.svg")
+ (module . "symbol-namespace.svg")
+ (numeric . "symbol-numeric.svg")
+ (operator . "symbol-operator.svg")
+ (property . "symbol-property.svg")
+ (reference . "references.svg")
+ (snippet . "symbol-snippet.svg")
+ (string . "symbol-string.svg")
+ (struct . "symbol-structure.svg")
+ (text . "symbol-key.svg")
+ (type-parameter . "symbol-parameter.svg")
+ (unit . "symbol-ruler.svg")
+ (value . "symbol-enumerator.svg")
+ (variable . "symbol-variable.svg")
+ (t . "symbol-misc.svg")))
+
+(defconst company-icons-root
+ (file-name-as-directory
+ (expand-file-name "icons"
+ (file-name-directory (or load-file-name buffer-file-name)))))
+
+(defcustom company-icon-size '(auto-scale . 16)
+ "Size of icons indicating completion kind in the popup."
+ :type '(choice (integer :tag "Size in pixels" :value 16)
+ (cons :tag "Size in pixels, scaled 2x on HiDPI screens"
+ (const auto-scale)
+ (integer :value 16))))
+
+(defcustom company-icon-margin 2
+ "Width of the margin that shows the icons, in characters."
+ :type 'integer)
+
+(defun company--render-icons-margin (icon-mapping root-dir candidate selected)
+ (if-let ((ws (window-system))
+ (candidate candidate)
+ (kind (company-call-backend 'kind candidate))
+ (icon-file (or (alist-get kind icon-mapping)
+ (alist-get t icon-mapping))))
+ (let* ((bkg (face-attribute (if selected
+ 'company-tooltip-selection
+ 'company-tooltip)
+ :background))
+ (dfw (default-font-width))
+ (icon-size (cond
+ ((integerp company-icon-size)
+ company-icon-size)
+ ;; XXX: Also consider smooth scaling, e.g. using
+ ;; (aref (font-info (face-font 'default)) 2)
+ ((and (consp company-icon-size)
+ (eq 'auto-scale (car company-icon-size)))
+ (let ((base-size (cdr company-icon-size))
+ (dfh (default-font-height)))
+ (min
+ (if (> dfh (* 2 base-size))
+ (* 2 base-size)
+ base-size)
+ (* company-icon-margin dfw))))))
+ (spec (list 'image
+ :file (expand-file-name icon-file root-dir)
+ :type 'svg
+ :width icon-size
+ :height icon-size
+ :ascent 'center
+ :background (unless (eq bkg 'unspecified)
+ bkg)))
+ (spacer-px-width (- (* company-icon-margin dfw) icon-size)))
+ (concat
+ (propertize " " 'display spec)
+ (propertize (company-space-string (1- company-icon-margin))
+ 'display `(space . (:width (,spacer-px-width))))))
+ nil))
+
+(defun company-vscode-dark-icons-margin (candidate selected)
+ "Margin function which returns icons from vscode's dark theme."
+ (company--render-icons-margin company-vscode-icons-mapping
+ (expand-file-name "vscode-dark" company-icons-root)
+ candidate
+ selected))
+
+(defun company-vscode-light-icons-margin (candidate selected)
+ "Margin function which returns icons from vscode's light theme."
+ (company--render-icons-margin company-vscode-icons-mapping
+ (expand-file-name "vscode-light" company-icons-root)
+ candidate
+ selected))
+
+(defcustom company-text-icons-mapping
+ '((array "a" font-lock-type-face)
+ (boolean "b" font-lock-builtin-face)
+ (class "c" font-lock-type-face)
+ (color "#" success)
+ (constant "c" font-lock-constant-face)
+ (constructor "c" font-lock-function-name-face)
+ (enum-member "e" font-lock-builtin-face)
+ (enum "e" font-lock-builtin-face)
+ (field "f" font-lock-variable-name-face)
+ (file "f" font-lock-string-face)
+ (folder "d" font-lock-doc-face)
+ (interface "i" font-lock-type-face)
+ (keyword "k" font-lock-keyword-face)
+ (method "m" font-lock-function-name-face)
+ (function "f" font-lock-function-name-face)
+ (module "{" font-lock-type-face)
+ (numeric "n" font-lock-builtin-face)
+ (operator "o" font-lock-comment-delimiter-face)
+ (property "p" font-lock-variable-name-face)
+ (reference "r" font-lock-doc-face)
+ (snippet "S" font-lock-string-face)
+ (string "s" font-lock-string-face)
+ (struct "%" font-lock-variable-name-face)
+ (text "w" shadow)
+ (type-parameter "p" font-lock-type-face)
+ (unit "u" shadow)
+ (value "v" font-lock-builtin-face)
+ (variable "v" font-lock-variable-name-face)
+ (t "." shadow))
+ "Mapping of the text icons.
+The format should be an alist of (KIND . CONF) where CONF is a list of the
+form (ICON FG BG) which is used to propertize the icon to be shown for a
+candidate of kind KIND. FG can either be color string or a face from which
+we can get a color string (using the :foreground face-property). BG must be
+of the same form as FG or a cons cell of (BG . BG-WHEN-SELECTED) which each
+should be of the same form as FG.
+
+The only mandatory element in CONF is ICON, you can omit both the FG and BG
+fields without issue.
+
+When BG is omitted and `company-text-icons-add-background' is non-nil, a BG
+color is generated using a gradient between the active tooltip color and
+the FG color."
+ :type 'list)
+
+(defcustom company-text-face-extra-attributes '(:weight bold)
+ "Additional attributes to add to text/dot icons faces.
+If non-nil, an anonymous face is generated.
+
+Affects `company-text-icons-margin' and `company-dot-icons-margin'."
+ :type 'list)
+
+(defcustom company-text-icons-format " %s "
+ "Format string for printing the text icons."
+ :type 'string)
+
+(defcustom company-text-icons-add-background nil
+ "Generate a background color for text/dot icons when none is given.
+See `company-text-icons-mapping'."
+ :type 'boolean)
+
+(defun company-text-icons-margin (candidate selected)
+ "Margin function which returns unicode icons."
+ (when-let ((candidate candidate)
+ (kind (company-call-backend 'kind candidate))
+ (conf (or (alist-get kind company-text-icons-mapping)
+ (alist-get t company-text-icons-mapping))))
+ (cl-destructuring-bind (icon &optional fg bg) conf
+ (propertize
+ (format company-text-icons-format icon)
+ 'face
+ (company-text-icons--face fg bg selected)))))
+
+(declare-function color-rgb-to-hex "color")
+(declare-function color-gradient "color")
+
+(defun company-text-icons--extract-property (face property)
+ "Try to extract PROPERTY from FACE.
+If FACE isn't a valid face return FACE as is. If FACE doesn't have
+PROPERTY return nil."
+ (if (facep face)
+ (let ((value (face-attribute face property)))
+ (unless (eq value 'unspecified)
+ value))
+ face))
+
+(defun company-text-icons--face (fg bg selected)
+ (let ((fg-color (company-text-icons--extract-property fg :foreground)))
+ `(,@company-text-face-extra-attributes
+ ,@(and fg-color
+ (list :foreground fg-color))
+ ,@(let* ((bg-is-cons (consp bg))
+ (bg (if bg-is-cons (if selected (cdr bg) (car bg)) bg))
+ (bg-color (company-text-icons--extract-property bg :background))
+ (tooltip-bg-color (company-text-icons--extract-property
+ (if selected
+ 'company-tooltip-selection
+ 'company-tooltip)
+ :background)))
+ (cond
+ ((and company-text-icons-add-background selected
+ (not bg-is-cons) bg-color tooltip-bg-color)
+ ;; Adjust the coloring of the background when *selected* but user hasn't
+ ;; specified an alternate background color for selected item icons.
+ (list :background
+ (apply #'color-rgb-to-hex
+ (nth 0 (color-gradient (color-name-to-rgb tooltip-bg-color)
+ (color-name-to-rgb bg-color)
+ 2)))))
+ (bg
+ ;; When background is configured we use it as is, even if it doesn't
+ ;; constrast well with other candidates when selected.
+ (and bg-color
+ (list :background bg-color)))
+ ((and company-text-icons-add-background fg-color tooltip-bg-color)
+ ;; Lastly attempt to generate a background from the foreground.
+ (list :background
+ (apply #'color-rgb-to-hex
+ (nth 0 (color-gradient (color-name-to-rgb tooltip-bg-color)
+ (color-name-to-rgb fg-color)
+ 10))))))))))
+
+(defcustom company-dot-icons-format "● "
+ "Format string for `company-dot-icons-margin'."
+ :type 'string)
+
+(defun company-dot-icons-margin (candidate selected)
+ "Margin function that uses a colored dot to display completion kind."
+ (when-let ((kind (company-call-backend 'kind candidate))
+ (conf (or (assoc-default kind company-text-icons-mapping)
+ (assoc-default t company-text-icons-mapping))))
+ (cl-destructuring-bind (_icon &optional fg bg) conf
+ (propertize company-dot-icons-format
+ 'face
+ (company-text-icons--face fg bg selected)))))
+
+(defun company-detect-icons-margin (candidate selected)
+ "Margin function which picks the appropriate icon set automatically."
+ (if (and (display-graphic-p)
+ (image-type-available-p 'svg))
+ (cl-case (frame-parameter nil 'background-mode)
+ ('light (company-vscode-light-icons-margin candidate selected))
+ (t (company-vscode-dark-icons-margin candidate selected)))
+ (company-text-icons-margin candidate selected)))
+
+(defcustom company-format-margin-function #'company-detect-icons-margin
+ "Function to format the margin.
+It accepts 2 params `candidate' and `selected' and can be used for
+inserting prefix/image before the completion items. Typically, the
+functions call the backends with `kind' and then insert the appropriate
+image for the returned kind image. Function is called with (nil nil) to get
+the default margin."
+ :type '(choice
+ (const :tag "Disabled" nil)
+ (const :tag "Detect icons theme base on conditions" company-detect-icons-margin)
+ (const :tag "Text characters as icons" company-text-icons-margin)
+ (const :tag "Colored dots as icons" company-dot-icons-margin)
+ (const :tag "VScode dark icons theme" company-vscode-dark-icons-margin)
+ (const :tag "VScode light icons theme" company-vscode-light-icons-margin)
+ (function :tag "Custom icon function.")))
+
+(defun company-occurrence-prefer-closest-above (pos match-beg match-end)
+ "Give priority to the matches above point, then those below point."
+ (if (< match-beg pos)
+ (- pos match-end)
+ (- match-beg (window-start))))
+
+(defun company-occurrence-prefer-any-closest (pos _match-beg match-end)
+ "Give priority to the matches closest to the point."
+ (abs (- pos match-end)))
+
+(defun company-sort-by-occurrence (candidates)
+ "Sort CANDIDATES according to their occurrences.
+Searches for each in the currently visible part of the current buffer and
+prioritizes the matches according to `company-occurrence-weight-function'.
+The rest of the list is appended unchanged.
+Keywords and function definition names are ignored."
+ (let* ((w-start (window-start))
+ (w-end (window-end))
+ (start-point (point))
+ occurs
+ (noccurs
+ (save-excursion
+ (cl-delete-if
+ (lambda (candidate)
+ (goto-char w-start)
+ (when (and (not (equal candidate ""))
+ (search-forward candidate w-end t)
+ ;; ^^^ optimize for large lists where most elements
+ ;; won't have a match.
+ (catch 'done
+ (goto-char (1- start-point))
+ (while (search-backward candidate w-start t)
+ (when (save-match-data
+ (company--occurrence-predicate))
+ (throw 'done t)))
+ (goto-char start-point)
+ (while (search-forward candidate w-end t)
+ (when (save-match-data
+ (company--occurrence-predicate))
+ (throw 'done t)))))
+ (push
+ (cons candidate
+ (funcall company-occurrence-weight-function
+ start-point
+ (match-beginning 0)
+ (match-end 0)))
+ occurs)
+ t))
+ candidates))))
+ (nconc
+ (mapcar #'car (sort occurs (lambda (e1 e2) (<= (cdr e1) (cdr e2)))))
+ noccurs)))
+
+(defun company--occurrence-predicate ()
+ (defvar comint-last-prompt)
+ (let ((beg (match-beginning 0))
+ (end (match-end 0))
+ (comint-last-prompt (bound-and-true-p comint-last-prompt)))
+ (save-excursion
+ (goto-char end)
+ ;; Workaround for python-shell-completion-at-point's behavior:
+ ;; https://github.com/company-mode/company-mode/issues/759
+ ;; https://github.com/company-mode/company-mode/issues/549
+ (when (derived-mode-p 'inferior-python-mode)
+ (let ((lbp (line-beginning-position)))
+ (setq comint-last-prompt (cons lbp lbp))))
+ (and (not (memq (get-text-property (1- (point)) 'face)
+ '(font-lock-function-name-face
+ font-lock-keyword-face)))
+ (let ((prefix (company--prefix-str
+ (company-call-backend 'prefix))))
+ (and (stringp prefix)
+ (= (length prefix) (- end beg))))))))
+
+(defun company-sort-by-backend-importance (candidates)
+ "Sort CANDIDATES as two priority groups.
+If `company-backend' is a function, do nothing. If it's a list, move
+candidates from backends before keyword `:with' to the front. Candidates
+from the rest of the backends in the group, if any, will be left at the end."
+ (if (functionp company-backend)
+ candidates
+ (let ((low-priority (cdr (memq :with company-backend))))
+ (if (null low-priority)
+ candidates
+ (sort candidates
+ (lambda (c1 c2)
+ (and
+ (let ((b2 (get-text-property 0 'company-backend c2)))
+ (and b2 (memq b2 low-priority)))
+ (let ((b1 (get-text-property 0 'company-backend c1)))
+ (or (not b1) (not (memq b1 low-priority)))))))))))
+
+(defun company-sort-prefer-same-case-prefix (candidates)
+ "Prefer CANDIDATES with the exact same prefix.
+If a backend returns case insensitive matches, candidates with the an exact
+prefix match (same case) will be prioritized."
+ (cl-loop for candidate in candidates
+ if (string-prefix-p company-prefix candidate)
+ collect candidate into same-case
+ else collect candidate into other-case
+ finally return (append same-case other-case)))
+
+(defun company-idle-begin (buf win tick pos)
+ (and (eq buf (current-buffer))
+ (eq win (selected-window))
+ (eq tick (buffer-chars-modified-tick))
+ (eq pos (point))
+ (let ((non-essential t))
+ (when (company-auto-begin)
+ (let ((this-command 'company-idle-begin))
+ (company-post-command))))))
+
+(defun company-auto-begin ()
+ (and company-mode
+ (not company-candidates)
+ (let ((company-idle-delay 'now))
+ (condition-case-unless-debug err
+ (let ((inhibit-quit nil))
+ (company--perform)
+ ;; Return non-nil if active.
+ company-candidates)
+ (error (message "Company: An error occurred in auto-begin")
+ (message "%s" (error-message-string err))
+ (company-cancel))
+ (quit (company-cancel))))))
+
+;;;###autoload
+(defun company-manual-begin ()
+ (interactive)
+ (company-assert-enabled)
+ (setq company--manual-action t)
+ (unwind-protect
+ (let ((company-minimum-prefix-length 0))
+ (or company-candidates
+ (company-auto-begin)))
+ (unless company-candidates
+ (setq company--manual-action nil))))
+
+(defun company-other-backend (&optional backward)
+ (interactive (list current-prefix-arg))
+ (company-assert-enabled)
+ (let* ((after (if company-backend
+ (cdr (member company-backend company-backends))
+ company-backends))
+ (before (cdr (member company-backend (reverse company-backends))))
+ (next (if backward
+ (append before (reverse after))
+ (append after (reverse before)))))
+ (company-cancel)
+ (cl-dolist (backend next)
+ (when (ignore-errors (company-begin-backend backend))
+ (cl-return t))))
+ (unless company-candidates
+ (user-error "No other backend")))
+
+(defun company-require-match-p ()
+ (let ((backend-value (company-call-backend 'require-match)))
+ (or (eq backend-value t)
+ (and (not (eq backend-value 'never))
+ (if (functionp company-require-match)
+ (funcall company-require-match)
+ (eq company-require-match t))))))
+
+(defun company-insertion-on-trigger-p (input)
+ "Return non-nil if INPUT should trigger insertion.
+For more details see `company-insertion-on-trigger' and
+`company-insertion-triggers'."
+ (and (if (functionp company-insertion-on-trigger)
+ (funcall company-insertion-on-trigger)
+ company-insertion-on-trigger)
+ (if (functionp company-insertion-triggers)
+ (funcall company-insertion-triggers input)
+ (if (consp company-insertion-triggers)
+ (memq (char-syntax (string-to-char input))
+ company-insertion-triggers)
+ (string-match (regexp-quote (substring input 0 1))
+ company-insertion-triggers)))))
+
+(defun company--incremental-p ()
+ (and (> (point) company-point)
+ (> (point-max) company--point-max)
+ (not (eq this-command 'backward-delete-char-untabify))
+ (equal (buffer-substring (- company-point (length company-prefix))
+ company-point)
+ company-prefix)))
+
+(defun company--continue-failed (new-prefix)
+ (cond
+ ((and (or (not (company-require-match-p))
+ ;; Don't require match if the new prefix
+ ;; doesn't continue the old one, and the latter was a match.
+ (not (stringp new-prefix))
+ (<= (length new-prefix) (length company-prefix)))
+ (member company-prefix company-candidates))
+ ;; Last input was a success,
+ ;; but we're treating it as an abort + input anyway,
+ ;; like the `unique' case below.
+ (company-cancel 'non-unique))
+ ((company-require-match-p)
+ ;; Wrong incremental input, but required match.
+ (delete-char (- company-point (point)))
+ (ding)
+ (message "Matching input is required")
+ company-candidates)
+ (t (company-cancel))))
+
+(defun company--good-prefix-p (prefix)
+ (and (stringp (company--prefix-str prefix)) ;excludes 'stop
+ (or (eq (cdr-safe prefix) t)
+ (let ((len (or (cdr-safe prefix) (length prefix))))
+ (if company--manual-prefix
+ (or (not company-abort-manual-when-too-short)
+ ;; Must not be less than minimum or initial length.
+ (>= len (min company-minimum-prefix-length
+ (length company--manual-prefix))))
+ (>= len company-minimum-prefix-length))))))
+
+(defun company--continue ()
+ (when (company-call-backend 'no-cache company-prefix)
+ ;; Don't complete existing candidates, fetch new ones.
+ (setq company-candidates-cache nil))
+ (let* ((new-prefix (company-call-backend 'prefix))
+ (ignore-case (company-call-backend 'ignore-case))
+ (c (when (and (company--good-prefix-p new-prefix)
+ (setq new-prefix (company--prefix-str new-prefix))
+ (= (- (point) (length new-prefix))
+ (- company-point (length company-prefix))))
+ (company-calculate-candidates new-prefix ignore-case))))
+ (cond
+ ((and company-abort-on-unique-match
+ (company--unique-match-p c new-prefix ignore-case))
+ ;; Handle it like completion was aborted, to differentiate from user
+ ;; calling one of Company's commands to insert the candidate,
+ ;; not to trigger template expansion, etc.
+ (company-cancel 'unique))
+ ((consp c)
+ ;; incremental match
+ (setq company-prefix new-prefix)
+ (company-update-candidates c)
+ c)
+ ((and (characterp last-command-event)
+ (company-insertion-on-trigger-p (string last-command-event)))
+ ;; Insertion on trigger.
+ (save-excursion
+ (goto-char company-point)
+ (company-complete-selection)
+ nil))
+ ((not (company--incremental-p))
+ (company-cancel))
+ (t (company--continue-failed new-prefix)))))
+
+(defun company--begin-new ()
+ (let (prefix c)
+ (cl-dolist (backend (if company-backend
+ ;; prefer manual override
+ (list company-backend)
+ company-backends))
+ (setq prefix
+ (if (or (symbolp backend)
+ (functionp backend))
+ (when (company--maybe-init-backend backend)
+ (let ((company-backend backend))
+ (company-call-backend 'prefix)))
+ (company--multi-backend-adapter backend 'prefix)))
+ (when prefix
+ (when (company--good-prefix-p prefix)
+ (let ((ignore-case (company-call-backend 'ignore-case)))
+ (setq company-prefix (company--prefix-str prefix)
+ company-backend backend
+ c (company-calculate-candidates company-prefix ignore-case))
+ (cond
+ ((and company-abort-on-unique-match
+ (company--unique-match-p c company-prefix ignore-case)
+ (if company--manual-action
+ ;; If `company-manual-begin' was called, the user
+ ;; really wants something to happen. Otherwise...
+ (ignore (message "Sole completion"))
+ t))
+ ;; ...abort and run the hooks, e.g. to clear the cache.
+ (company-cancel 'unique))
+ ((null c)
+ (when company--manual-action
+ (message "No completion found")))
+ (t ;; We got completions!
+ (when company--manual-action
+ (setq company--manual-prefix prefix))
+ (company-update-candidates c)
+ (run-hook-with-args 'company-completion-started-hook
+ (company-explicit-action-p))
+ (company-call-frontends 'show)))))
+ (cl-return c)))))
+
+(defun company--perform ()
+ (cond
+ (company-candidates
+ (company--continue))
+ ((company--should-complete)
+ (company--begin-new)))
+ (if (not company-candidates)
+ (setq company-backend nil)
+ (setq company-point (point)
+ company--point-max (point-max))
+ (company-ensure-emulation-alist)
+ (company-enable-overriding-keymap company-active-map)
+ (company-call-frontends 'update)))
+
+(defun company-cancel (&optional result)
+ (let ((prefix company-prefix)
+ (backend company-backend))
+ (setq company-backend nil
+ company-prefix nil
+ company-candidates nil
+ company-candidates-length nil
+ company-candidates-cache nil
+ company-candidates-predicate nil
+ company-common nil
+ company-selection company-selection-default
+ company-selection-changed nil
+ company--manual-action nil
+ company--manual-prefix nil
+ company--point-max nil
+ company-point nil)
+ (when company-timer
+ (cancel-timer company-timer))
+ (company-echo-cancel t)
+ (company-search-mode 0)
+ (company-call-frontends 'hide)
+ (company-enable-overriding-keymap nil)
+ (when prefix
+ (if (stringp result)
+ (let ((company-backend backend))
+ (run-hook-with-args 'company-completion-finished-hook result)
+ (company-call-backend 'post-completion result))
+ (run-hook-with-args 'company-completion-cancelled-hook result))
+ (run-hook-with-args 'company-after-completion-hook result)))
+ ;; Make return value explicit.
+ nil)
+
+(defun company-abort ()
+ (interactive)
+ (company-cancel 'abort))
+
+(defun company-finish (result)
+ (company--insert-candidate result)
+ (company-cancel result))
+
+(defsubst company-keep (command)
+ (and (symbolp command) (get command 'company-keep)))
+
+(defun company--active-p ()
+ company-candidates)
+
+(defun company-pre-command ()
+ (company--electric-restore-window-configuration)
+ (unless (company-keep this-command)
+ (condition-case-unless-debug err
+ (when company-candidates
+ (company-call-frontends 'pre-command)
+ (unless (company--should-continue)
+ (company-abort)))
+ (error (message "Company: An error occurred in pre-command")
+ (message "%s" (error-message-string err))
+ (company-cancel))))
+ (when company-timer
+ (cancel-timer company-timer)
+ (setq company-timer nil))
+ (company-echo-cancel t)
+ (company-uninstall-map))
+
+(defun company-post-command ()
+ (when (and company-candidates
+ (null this-command))
+ ;; Happens when the user presses `C-g' while inside
+ ;; `flyspell-post-command-hook', for example.
+ ;; Or any other `post-command-hook' function that can call `sit-for',
+ ;; or any quittable timer function.
+ (company-abort)
+ (setq this-command 'company-abort))
+ (unless (company-keep this-command)
+ (condition-case-unless-debug err
+ (progn
+ (unless (equal (point) company-point)
+ (let (company-idle-delay) ; Against misbehavior while debugging.
+ (company--perform)))
+ (if company-candidates
+ (company-call-frontends 'post-command)
+ (let ((delay (company--idle-delay)))
+ (and (numberp delay)
+ (not defining-kbd-macro)
+ (company--should-begin)
+ (setq company-timer
+ (run-with-timer delay nil
+ 'company-idle-begin
+ (current-buffer) (selected-window)
+ (buffer-chars-modified-tick) (point)))))))
+ (error (message "Company: An error occurred in post-command")
+ (message "%s" (error-message-string err))
+ (company-cancel))))
+ (company-install-map))
+
+(defun company--idle-delay ()
+ (let ((delay
+ (if (functionp company-idle-delay)
+ (funcall company-idle-delay)
+ company-idle-delay)))
+ (if (memql delay '(t 0 0.0))
+ 0.01
+ delay)))
+
+(defvar company--begin-inhibit-commands '(company-abort
+ company-complete-mouse
+ company-complete
+ company-complete-common
+ company-complete-selection
+ company-complete-tooltip-row)
+ "List of commands after which idle completion is (still) disabled when
+`company-begin-commands' is t.")
+
+(defun company--should-begin ()
+ (if (eq t company-begin-commands)
+ (not (memq this-command company--begin-inhibit-commands))
+ (or
+ (memq this-command company-begin-commands)
+ (and (symbolp this-command) (get this-command 'company-begin)))))
+
+;;; search ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defcustom company-search-regexp-function #'regexp-quote
+ "Function to construct the search regexp from input.
+It's called with one argument, the current search input. It must return
+either a regexp without groups, or one where groups don't intersect and
+each one wraps a part of the input string."
+ :type '(choice
+ (const :tag "Exact match" regexp-quote)
+ (const :tag "Words separated with spaces" company-search-words-regexp)
+ (const :tag "Words separated with spaces, in any order"
+ company-search-words-in-any-order-regexp)
+ (const :tag "All characters in given order, with anything in between"
+ company-search-flex-regexp)))
+
+(defvar-local company-search-string "")
+
+(defvar company-search-lighter '(" "
+ (company-search-filtering "Filter" "Search")
+ ": \""
+ company-search-string
+ "\""))
+
+(defvar-local company-search-filtering nil
+ "Non-nil to filter the completion candidates by the search string")
+
+(defvar-local company--search-old-selection 0)
+
+(defvar-local company--search-old-changed nil)
+
+(defun company-search-words-regexp (input)
+ (mapconcat (lambda (word) (format "\\(%s\\)" (regexp-quote word)))
+ (split-string input " +" t) ".*"))
+
+(defun company-search-words-in-any-order-regexp (input)
+ (let* ((words (mapcar (lambda (word) (format "\\(%s\\)" (regexp-quote word)))
+ (split-string input " +" t)))
+ (permutations (company--permutations words)))
+ (mapconcat (lambda (words)
+ (mapconcat #'identity words ".*"))
+ permutations
+ "\\|")))
+
+(defun company-search-flex-regexp (input)
+ (if (zerop (length input))
+ ""
+ (concat (regexp-quote (string (aref input 0)))
+ (mapconcat (lambda (c)
+ (concat "[^" (string c) "]*"
+ (regexp-quote (string c))))
+ (substring input 1) ""))))
+
+(defun company--permutations (lst)
+ (if (not lst)
+ '(nil)
+ ;; FIXME: Replace with `mapcan' in Emacs 26.
+ (cl-mapcan
+ (lambda (e)
+ (mapcar (lambda (perm) (cons e perm))
+ (company--permutations (cl-remove e lst :count 1))))
+ lst)))
+
+(defun company--search (text lines)
+ (let ((re (funcall company-search-regexp-function text))
+ (i 0))
+ (cl-dolist (line lines)
+ (when (string-match-p re line)
+ (cl-return i))
+ (cl-incf i))))
+
+(defun company-search-printing-char ()
+ (interactive)
+ (company--search-assert-enabled)
+ (let* ((event-type (event-basic-type last-command-event))
+ (event-string (if (characterp event-type)
+ (string last-command-event)
+ ;; Handle key press on the keypad.
+ (let ((name (symbol-name event-type)))
+ (if (string-match "kp-\\([0-9]\\)" name)
+ (match-string 1 name)
+ (error "Unexpected printing char input")))))
+ (ss (concat company-search-string event-string)))
+ (when company-search-filtering
+ (company--search-update-predicate ss))
+ (company--search-update-string ss)))
+
+(defun company--search-update-predicate (ss)
+ (let* ((re (funcall company-search-regexp-function ss))
+ (company-candidates-predicate
+ (and (not (string= re ""))
+ company-search-filtering
+ (lambda (candidate) (string-match re candidate))))
+ (cc (company-calculate-candidates company-prefix
+ (company-call-backend 'ignore-case))))
+ (unless cc (user-error "No match"))
+ (company-update-candidates cc)))
+
+(defun company--search-update-string (new)
+ (let* ((selection (or company-selection 0))
+ (pos (company--search new (nthcdr selection company-candidates))))
+ (if (null pos)
+ (ding)
+ (setq company-search-string new)
+ (company-set-selection (+ selection pos) t))))
+
+(defun company--search-assert-input ()
+ (company--search-assert-enabled)
+ (when (string= company-search-string "")
+ (user-error "Empty search string")))
+
+(defun company-search-repeat-forward ()
+ "Repeat the incremental search in completion candidates forward."
+ (interactive)
+ (company--search-assert-input)
+ (let* ((selection (or company-selection 0))
+ (pos (company--search company-search-string
+ (cdr (nthcdr selection company-candidates)))))
+ (if (null pos)
+ (ding)
+ (company-set-selection (+ selection pos 1) t))))
+
+(defun company-search-repeat-backward ()
+ "Repeat the incremental search in completion candidates backwards."
+ (interactive)
+ (company--search-assert-input)
+ (let* ((selection (or company-selection 0))
+ (pos (company--search company-search-string
+ (nthcdr (- company-candidates-length
+ selection)
+ (reverse company-candidates)))))
+ (if (null pos)
+ (ding)
+ (company-set-selection (- selection pos 1) t))))
+
+(defun company-search-toggle-filtering ()
+ "Toggle `company-search-filtering'."
+ (interactive)
+ (company--search-assert-enabled)
+ (setq company-search-filtering (not company-search-filtering))
+ (let ((ss company-search-string))
+ (company--search-update-predicate ss)
+ (company--search-update-string ss)))
+
+(defun company-search-abort ()
+ "Abort searching the completion candidates."
+ (interactive)
+ (company--search-assert-enabled)
+ (company-search-mode 0)
+ (company-set-selection company--search-old-selection t)
+ (setq company-selection-changed company--search-old-changed))
+
+(defun company-search-other-char ()
+ (interactive)
+ (company--search-assert-enabled)
+ (company-search-mode 0)
+ (company--unread-this-command-keys))
+
+(defun company-search-delete-char ()
+ (interactive)
+ (company--search-assert-enabled)
+ (if (string= company-search-string "")
+ (ding)
+ (let ((ss (substring company-search-string 0 -1)))
+ (when company-search-filtering
+ (company--search-update-predicate ss))
+ (company--search-update-string ss))))
+
+(defvar company-search-map
+ (let ((i 0)
+ (keymap (make-keymap)))
+ (if (fboundp 'max-char)
+ (set-char-table-range (nth 1 keymap) (cons #x100 (max-char))
+ 'company-search-printing-char)
+ (with-no-warnings
+ ;; obsolete in Emacs 23
+ (let ((l (generic-character-list))
+ (table (nth 1 keymap)))
+ (while l
+ (set-char-table-default table (car l) 'company-search-printing-char)
+ (setq l (cdr l))))))
+ (define-key keymap [t] 'company-search-other-char)
+ (while (< i ?\s)
+ (define-key keymap (make-string 1 i) 'company-search-other-char)
+ (cl-incf i))
+ (while (< i 256)
+ (define-key keymap (vector i) 'company-search-printing-char)
+ (cl-incf i))
+ (dotimes (i 10)
+ (define-key keymap (kbd (format "<kp-%d>" i)) 'company-search-printing-char))
+ (let ((meta-map (make-sparse-keymap)))
+ (define-key keymap (char-to-string meta-prefix-char) meta-map)
+ (define-key keymap [escape] meta-map))
+ (define-key keymap (vector meta-prefix-char t) 'company-search-other-char)
+ (define-key keymap (kbd "C-n") 'company-select-next-or-abort)
+ (define-key keymap (kbd "C-p") 'company-select-previous-or-abort)
+ (define-key keymap (kbd "M-n") 'company--select-next-and-warn)
+ (define-key keymap (kbd "M-p") 'company--select-previous-and-warn)
+ (define-key keymap (kbd "<down>") 'company-select-next-or-abort)
+ (define-key keymap (kbd "<up>") 'company-select-previous-or-abort)
+ (define-key keymap "\e\e\e" 'company-search-other-char)
+ (define-key keymap [escape escape escape] 'company-search-other-char)
+ (define-key keymap (kbd "DEL") 'company-search-delete-char)
+ (define-key keymap [backspace] 'company-search-delete-char)
+ (define-key keymap "\C-g" 'company-search-abort)
+ (define-key keymap "\C-s" 'company-search-repeat-forward)
+ (define-key keymap "\C-r" 'company-search-repeat-backward)
+ (define-key keymap "\C-o" 'company-search-toggle-filtering)
+ (company-keymap--bind-quick-access keymap)
+ keymap)
+ "Keymap used for incrementally searching the completion candidates.")
+
+(define-minor-mode company-search-mode
+ "Search mode for completion candidates.
+Don't start this directly, use `company-search-candidates' or
+`company-filter-candidates'."
+ :lighter company-search-lighter
+ (if company-search-mode
+ (if (company-manual-begin)
+ (progn
+ (setq company--search-old-selection company-selection
+ company--search-old-changed company-selection-changed)
+ (company-call-frontends 'update)
+ (company-enable-overriding-keymap company-search-map))
+ (setq company-search-mode nil))
+ (kill-local-variable 'company-search-string)
+ (kill-local-variable 'company-search-filtering)
+ (kill-local-variable 'company--search-old-selection)
+ (kill-local-variable 'company--search-old-changed)
+ (when company-backend
+ (company--search-update-predicate "")
+ (company-call-frontends 'update))
+ (company-enable-overriding-keymap company-active-map)))
+
+(defun company--search-assert-enabled ()
+ (company-assert-enabled)
+ (unless company-search-mode
+ (company-uninstall-map)
+ (user-error "Company not in search mode")))
+
+(defun company-search-candidates ()
+ "Start searching the completion candidates incrementally.
+
+\\<company-search-map>Search can be controlled with the commands:
+- `company-search-repeat-forward' (\\[company-search-repeat-forward])
+- `company-search-repeat-backward' (\\[company-search-repeat-backward])
+- `company-search-abort' (\\[company-search-abort])
+- `company-search-delete-char' (\\[company-search-delete-char])
+
+Regular characters are appended to the search string.
+
+Customize `company-search-regexp-function' to change how the input
+is interpreted when searching.
+
+The command `company-search-toggle-filtering' (\\[company-search-toggle-filtering])
+uses the search string to filter the completion candidates."
+ (interactive)
+ (company-search-mode 1))
+
+(defun company-filter-candidates ()
+ "Start filtering the completion candidates incrementally.
+This works the same way as `company-search-candidates' immediately
+followed by `company-search-toggle-filtering'."
+ (interactive)
+ (company-search-mode 1)
+ (setq company-search-filtering t))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun company-select-next (&optional arg)
+ "Select the next candidate in the list.
+
+With ARG, move by that many elements.
+When `company-selection-default' is nil, add a special pseudo candidates
+meant for no selection."
+ (interactive "p")
+ (when (company-manual-begin)
+ (let ((selection (+ (or arg 1)
+ (or company-selection
+ company-selection-default
+ -1))))
+ (company-set-selection selection))))
+
+(defun company-select-previous (&optional arg)
+ "Select the previous candidate in the list.
+
+With ARG, move by that many elements."
+ (interactive "p")
+ (company-select-next (if arg (- arg) -1)))
+
+(defun company-select-next-or-abort (&optional arg)
+ "Select the next candidate if more than one, else abort
+and invoke the normal binding.
+
+With ARG, move by that many elements."
+ (interactive "p")
+ (if (or (not company-selection)
+ (> company-candidates-length 1))
+ (company-select-next arg)
+ (company-abort)
+ (company--unread-this-command-keys)))
+
+(defun company-select-previous-or-abort (&optional arg)
+ "Select the previous candidate if more than one, else abort
+and invoke the normal binding.
+
+With ARG, move by that many elements."
+ (interactive "p")
+ (if (> company-candidates-length 1)
+ (company-select-previous arg)
+ (company-abort)
+ (company--unread-this-command-keys)))
+
+(defun company-select-first ()
+ "Select the first completion candidate."
+ (interactive)
+ (company-set-selection 0))
+
+(defun company-select-last ()
+ "Select the last completion candidate."
+ (interactive)
+ (company-set-selection (1- company-candidates-length)))
+
+(defun company-next-page ()
+ "Select the candidate one page further."
+ (interactive)
+ (when (company-manual-begin)
+ (if (and company-selection-wrap-around
+ (= company-selection (1- company-candidates-length)))
+ (company-set-selection 0)
+ (let (company-selection-wrap-around)
+ (company-set-selection (+ company-selection
+ company-tooltip-limit))))))
+
+(defun company-previous-page ()
+ "Select the candidate one page earlier."
+ (interactive)
+ (when (company-manual-begin)
+ (if (and company-selection-wrap-around
+ (zerop company-selection))
+ (company-set-selection (1- company-candidates-length))
+ (let (company-selection-wrap-around)
+ (company-set-selection (- company-selection
+ company-tooltip-limit))))))
+
+(defun company--event-col-row (event)
+ (company--posn-col-row (event-start event)))
+
+(defvar company-mouse-event nil
+ "Holds the mouse event from `company-select-mouse'.
+For use in the `select-mouse' frontend action. `let'-bound.")
+
+(defun company-select-mouse (event)
+ "Select the candidate picked by the mouse."
+ (interactive "e")
+ (or (let ((company-mouse-event event))
+ (cl-some #'identity (company-call-frontends 'select-mouse)))
+ (progn
+ (company-abort)
+ (company--unread-this-command-keys)
+ nil)))
+
+(defun company-complete-mouse (event)
+ "Insert the candidate picked by the mouse."
+ (interactive "e")
+ (when (company-select-mouse event)
+ (company-complete-selection)))
+
+(defun company-complete-selection ()
+ "Insert the selected candidate."
+ (interactive)
+ (when (and (company-manual-begin) company-selection)
+ (let ((result (nth company-selection company-candidates)))
+ (company-finish result))))
+
+(defun company-complete-common ()
+ "Insert the common part of all candidates."
+ (interactive)
+ (when (company-manual-begin)
+ (if (and (not (cdr company-candidates))
+ (equal company-common (car company-candidates)))
+ (company-complete-selection)
+ (company--insert-candidate company-common))))
+
+(defun company-complete-common-or-cycle (&optional arg)
+ "Insert the common part of all candidates, or select the next one.
+
+With ARG, move by that many elements."
+ (interactive "p")
+ (when (company-manual-begin)
+ (let ((tick (buffer-chars-modified-tick)))
+ (call-interactively 'company-complete-common)
+ (when (eq tick (buffer-chars-modified-tick))
+ (let ((company-selection-wrap-around t)
+ (current-prefix-arg arg))
+ (call-interactively 'company-select-next))))))
+
+(defun company-complete-common-or-show-delayed-tooltip ()
+ "Insert the common part of all candidates, or show a tooltip."
+ (interactive)
+ (when (company-manual-begin)
+ (let ((tick (buffer-chars-modified-tick)))
+ (call-interactively 'company-complete-common)
+ (when (eq tick (buffer-chars-modified-tick))
+ (let ((company-tooltip-idle-delay 0.0))
+ (company-complete)
+ (and company-candidates
+ (company-call-frontends 'post-command)))))))
+
+(defun company-indent-or-complete-common (arg)
+ "Indent the current line or region, or complete the common part."
+ (interactive "P")
+ (cond
+ ((use-region-p)
+ (indent-region (region-beginning) (region-end)))
+ ((memq indent-line-function
+ '(indent-relative indent-relative-maybe))
+ (company-complete-common))
+ ((let ((old-point (point))
+ (old-tick (buffer-chars-modified-tick))
+ (tab-always-indent t))
+ (indent-for-tab-command arg)
+ (when (and (eq old-point (point))
+ (eq old-tick (buffer-chars-modified-tick)))
+ (company-complete-common))))))
+
+(defun company-select-next-if-tooltip-visible-or-complete-selection ()
+ "Insert selection if appropriate, or select the next candidate.
+Insert selection if only preview is showing or only one candidate,
+otherwise select the next candidate."
+ (interactive)
+ (if (and (company-tooltip-visible-p) (> company-candidates-length 1))
+ (call-interactively 'company-select-next)
+ (call-interactively 'company-complete-selection)))
+
+;;;###autoload
+(defun company-complete ()
+ "Insert the common part of all candidates or the current selection.
+The first time this is called, the common part is inserted, the second
+time, or when the selection has been changed, the selected candidate is
+inserted."
+ (interactive)
+ (when (company-manual-begin)
+ (if (or company-selection-changed
+ (and (eq real-last-command 'company-complete)
+ (eq last-command 'company-complete-common)))
+ (call-interactively 'company-complete-selection)
+ (call-interactively 'company-complete-common)
+ (when company-candidates
+ (setq this-command 'company-complete-common)))))
+
+(define-obsolete-function-alias
+ 'company-complete-number
+ 'company-complete-tooltip-row
+ "0.9.14")
+
+(defun company-complete-tooltip-row (number)
+ "Insert a candidate visible on the tooltip's row NUMBER.
+
+Inserts one of the first ten candidates,
+numbered according to the current scrolling position starting with 1.
+
+When called interactively, uses the last typed digit, stripping the
+modifiers and translating 0 into 10, so `M-1' inserts the first visible
+candidate, and `M-0' insert to 10th one.
+
+To show hint numbers beside the candidates, enable `company-show-quick-access'."
+ (interactive
+ (list (let* ((type (event-basic-type last-command-event))
+ (char (if (characterp type)
+ ;; Number on the main row.
+ type
+ ;; Keypad number, if bound directly.
+ (car (last (string-to-list (symbol-name type))))))
+ (number (- char ?0)))
+ (if (zerop number) 10 number))))
+ (company--complete-nth (1- number)))
+
+(defun company-complete-quick-access (row)
+ "Insert a candidate visible on a ROW matched by a quick-access key binding.
+See `company-quick-access-keys' for more details."
+ (interactive
+ (list (let* ((event-type (event-basic-type last-command-event))
+ (event-string (if (characterp event-type)
+ (string event-type)
+ (error "Unexpected input"))))
+ (cl-position event-string company-quick-access-keys :test 'equal))))
+ (when row
+ (company--complete-nth row)))
+
+(defvar-local company-tooltip-offset 0
+ "Current scrolling state of the tooltip.
+Represented by the index of the first visible completion candidate
+from the candidates list.")
+
+(defun company--complete-nth (row)
+ "Insert a candidate visible on the tooltip's zero-based ROW."
+ (when (company-manual-begin)
+ (and (or (< row 0) (>= row (- company-candidates-length
+ company-tooltip-offset)))
+ (user-error "No candidate on the row number %d" row))
+ (company-finish (nth (+ row company-tooltip-offset)
+ company-candidates))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defconst company-space-strings-limit 100)
+
+(defconst company-space-strings
+ (let (lst)
+ (dotimes (i company-space-strings-limit)
+ (push (make-string (- company-space-strings-limit 1 i) ?\ ) lst))
+ (apply 'vector lst)))
+
+(defun company-space-string (len)
+ (if (< len company-space-strings-limit)
+ (aref company-space-strings len)
+ (make-string len ?\ )))
+
+(defun company-safe-substring (str from &optional to)
+ (let ((bis buffer-invisibility-spec))
+ (if (> from (string-width str))
+ ""
+ (with-temp-buffer
+ (setq buffer-invisibility-spec bis)
+ (insert str)
+ (move-to-column from)
+ (let ((beg (point)))
+ (if to
+ (progn
+ (move-to-column to)
+ (concat (buffer-substring beg (point))
+ (let ((padding (- to (current-column))))
+ (when (> padding 0)
+ (company-space-string padding)))))
+ (buffer-substring beg (point-max))))))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar-local company-last-metadata nil)
+
+(defun company-fetch-metadata ()
+ (let ((selected (nth (or company-selection 0) company-candidates)))
+ (unless (eq selected (car company-last-metadata))
+ (setq company-last-metadata
+ (cons selected (company-call-backend 'meta selected))))
+ (cdr company-last-metadata)))
+
+(defun company-doc-buffer (&optional string)
+ (with-current-buffer (get-buffer-create "*company-documentation*")
+ (erase-buffer)
+ (fundamental-mode)
+ (when string
+ (save-excursion
+ (insert string)
+ (visual-line-mode)))
+ (current-buffer)))
+
+(defvar company--electric-saved-window-configuration nil)
+
+(defvar company--electric-commands
+ '(scroll-other-window scroll-other-window-down mwheel-scroll)
+ "List of Commands that won't break out of electric commands.")
+
+(defun company--electric-restore-window-configuration ()
+ "Restore window configuration (after electric commands)."
+ (when (and company--electric-saved-window-configuration
+ (not (memq this-command company--electric-commands)))
+ (set-window-configuration company--electric-saved-window-configuration)
+ (setq company--electric-saved-window-configuration nil)))
+
+(defmacro company--electric-do (&rest body)
+ (declare (indent 0) (debug t))
+ `(when (company-manual-begin)
+ (cl-assert (null company--electric-saved-window-configuration))
+ (setq company--electric-saved-window-configuration (current-window-configuration))
+ (let ((height (window-height))
+ (row (company--row)))
+ ,@body
+ (and (< (window-height) height)
+ (< (- (window-height) row 2) company-tooltip-limit)
+ (recenter (- (window-height) row 2))))))
+
+(defun company--unread-this-command-keys ()
+ (when (> (length (this-command-keys)) 0)
+ (setq unread-command-events (nconc
+ (listify-key-sequence (this-command-keys))
+ unread-command-events))
+ (clear-this-command-keys t)))
+
+(defun company-show-doc-buffer ()
+ "Temporarily show the documentation buffer for the selection."
+ (interactive)
+ (let ((other-window-scroll-buffer)
+ (selection (or company-selection 0)))
+ (company--electric-do
+ (let* ((selected (nth selection company-candidates))
+ (doc-buffer (or (company-call-backend 'doc-buffer selected)
+ (user-error "No documentation available")))
+ start)
+ (when (consp doc-buffer)
+ (setq start (cdr doc-buffer)
+ doc-buffer (car doc-buffer)))
+ (setq other-window-scroll-buffer (get-buffer doc-buffer))
+ (let ((win (display-buffer doc-buffer t)))
+ (set-window-start win (if start start (point-min))))))))
+(put 'company-show-doc-buffer 'company-keep t)
+
+(defun company-show-location ()
+ "Temporarily display a buffer showing the selected candidate in context."
+ (interactive)
+ (let (other-window-scroll-buffer)
+ (company--electric-do
+ (let* ((selected (nth company-selection company-candidates))
+ (location (company-call-backend 'location selected))
+ (pos (or (cdr location) (user-error "No location available")))
+ (buffer (or (and (bufferp (car location)) (car location))
+ (find-file-noselect (car location) t))))
+ (setq other-window-scroll-buffer (get-buffer buffer))
+ (with-selected-window (display-buffer buffer t)
+ (save-restriction
+ (widen)
+ (if (bufferp (car location))
+ (goto-char pos)
+ (goto-char (point-min))
+ (forward-line (1- pos))))
+ (set-window-start nil (point)))))))
+(put 'company-show-location 'company-keep t)
+
+;;; package functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar-local company-callback nil)
+
+(defun company-remove-callback (&optional ignored)
+ (remove-hook 'company-completion-finished-hook company-callback t)
+ (remove-hook 'company-completion-cancelled-hook 'company-remove-callback t)
+ (remove-hook 'company-completion-finished-hook 'company-remove-callback t))
+
+(defun company-begin-backend (backend &optional callback)
+ "Start a completion at point using BACKEND."
+ (interactive (let ((val (completing-read "Company backend: "
+ obarray
+ 'functionp nil "company-")))
+ (when val
+ (list (intern val)))))
+ (when (setq company-callback callback)
+ (add-hook 'company-completion-finished-hook company-callback nil t))
+ (add-hook 'company-completion-cancelled-hook 'company-remove-callback nil t)
+ (add-hook 'company-completion-finished-hook 'company-remove-callback nil t)
+ (setq company-backend backend)
+ ;; Return non-nil if active.
+ (or (company-manual-begin)
+ (user-error "Cannot complete at point")))
+
+(defun company-begin-with (candidates
+ &optional prefix-length require-match callback)
+ "Start a completion at point.
+CANDIDATES is the list of candidates to use and PREFIX-LENGTH is the length
+of the prefix that already is in the buffer before point.
+It defaults to 0.
+
+CALLBACK is a function called with the selected result if the user
+successfully completes the input.
+
+Example: \(company-begin-with \\='\(\"foo\" \"foobar\" \"foobarbaz\"\)\)"
+ (let ((begin-marker (copy-marker (point) t)))
+ (company-begin-backend
+ (lambda (command &optional arg &rest ignored)
+ (pcase command
+ (`prefix
+ (when (equal (point) (marker-position begin-marker))
+ (buffer-substring (- (point) (or prefix-length 0)) (point))))
+ (`candidates
+ (all-completions arg candidates))
+ (`require-match
+ require-match)))
+ callback)))
+
+(declare-function find-library-name "find-func")
+(declare-function lm-version "lisp-mnt")
+
+(defun company-version (&optional show-version)
+ "Get the Company version as string.
+
+If SHOW-VERSION is non-nil, show the version in the echo area."
+ (interactive (list t))
+ (with-temp-buffer
+ (require 'find-func)
+ (insert-file-contents (find-library-name "company"))
+ (require 'lisp-mnt)
+ (if show-version
+ (message "Company version: %s" (lm-version))
+ (lm-version))))
+
+(defun company-diag ()
+ "Pop a buffer with information about completions at point."
+ (interactive)
+ (let* ((bb company-backends)
+ (mode (symbol-name major-mode))
+ backend
+ (prefix (cl-loop for b in bb
+ thereis (let ((company-backend b))
+ (setq backend b)
+ (company-call-backend 'prefix))))
+ (c-a-p-f completion-at-point-functions)
+ cc annotations)
+ (when (or (stringp prefix) (consp prefix))
+ (let ((company-backend backend))
+ (condition-case nil
+ (setq cc (company-call-backend 'candidates (company--prefix-str prefix))
+ annotations
+ (mapcar
+ (lambda (c) (cons c (company-call-backend 'annotation c)))
+ cc))
+ (error (setq annotations 'error)))))
+ (pop-to-buffer (get-buffer-create "*company-diag*"))
+ (setq buffer-read-only nil)
+ (erase-buffer)
+ (insert (format "Emacs %s (%s) of %s on %s"
+ emacs-version system-configuration
+ (format-time-string "%Y-%m-%d" emacs-build-time)
+ emacs-build-system))
+ (insert "\nCompany " (company-version) "\n\n")
+ (insert "company-backends: " (pp-to-string bb))
+ (insert "\n")
+ (insert "Used backend: " (pp-to-string backend))
+ (insert "\n")
+ (when (if (listp backend)
+ (memq 'company-capf backend)
+ (eq backend 'company-capf))
+ (insert "Value of c-a-p-f: "
+ (pp-to-string c-a-p-f)))
+ (insert "Major mode: " mode)
+ (insert "\n")
+ (insert "Prefix: " (pp-to-string prefix))
+ (insert "\n")
+ (insert "Completions:")
+ (unless cc (insert " none"))
+ (if (eq annotations 'error)
+ (insert "(error fetching)")
+ (save-excursion
+ (dolist (c annotations)
+ (insert "\n " (prin1-to-string (car c)))
+ (when (cdr c)
+ (insert " " (prin1-to-string (cdr c)))))))
+ (special-mode)))
+
+;;; pseudo-tooltip ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar-local company--tooltip-current-width 0)
+
+(defun company-tooltip--lines-update-offset (selection num-lines limit)
+ (cl-decf limit 2)
+ (setq company-tooltip-offset
+ (max (min selection company-tooltip-offset)
+ (- selection -1 limit)))
+
+ (when (<= company-tooltip-offset 1)
+ (cl-incf limit)
+ (setq company-tooltip-offset 0))
+
+ (when (>= company-tooltip-offset (- num-lines limit 1))
+ (cl-incf limit)
+ (when (= selection (1- num-lines))
+ (cl-decf company-tooltip-offset)
+ (when (<= company-tooltip-offset 1)
+ (setq company-tooltip-offset 0)
+ (cl-incf limit))))
+
+ limit)
+
+(defun company-tooltip--simple-update-offset (selection _num-lines limit)
+ (setq company-tooltip-offset
+ (if (< selection company-tooltip-offset)
+ selection
+ (max company-tooltip-offset
+ (- selection limit -1)))))
+
+;;; propertize
+
+(defun company-round-tab (arg)
+ (* (/ (+ arg tab-width) tab-width) tab-width))
+
+(defun company-plainify (str)
+ (let ((prefix (get-text-property 0 'line-prefix str)))
+ (when prefix ; Keep the original value unmodified, for no special reason.
+ (setq str (concat prefix str))
+ (remove-text-properties 0 (length str) '(line-prefix) str)))
+ (let* ((pieces (split-string str "\t"))
+ (copy pieces))
+ (while (cdr copy)
+ (setcar copy (company-safe-substring
+ (car copy) 0 (company-round-tab (string-width (car copy)))))
+ (pop copy))
+ (apply 'concat pieces)))
+
+(defun company--common-or-matches (value)
+ (let ((matches (company-call-backend 'match value)))
+ (when (and matches
+ company-common
+ (listp matches)
+ (= 1 (length matches))
+ (= 0 (caar matches))
+ (> (length company-common) (cdar matches)))
+ (setq matches nil))
+ (when (integerp matches)
+ (setq matches `((0 . ,matches))))
+ (or matches
+ (and company-common `((0 . ,(length company-common))))
+ nil)))
+
+(defun company-fill-propertize (value annotation width selected left right)
+ (let* ((margin (length left))
+ (company-common (and company-common (company--clean-string company-common)))
+ (common (company--common-or-matches value))
+ (_ (setq value (company-reformat (company--pre-render value))
+ annotation (and annotation (company--pre-render annotation t))))
+ (ann-ralign company-tooltip-align-annotations)
+ (ann-truncate (< width
+ (+ (length value) (length annotation)
+ (if ann-ralign 1 0))))
+ (ann-start (+ margin
+ (if ann-ralign
+ (if ann-truncate
+ (1+ (length value))
+ (- width (length annotation)))
+ (length value))))
+ (ann-end (min (+ ann-start (length annotation)) (+ margin width)))
+ (line (concat left
+ (if (or ann-truncate (not ann-ralign))
+ (company-safe-substring
+ (concat value
+ (when (and annotation ann-ralign) " ")
+ annotation)
+ 0 width)
+ (concat
+ (company-safe-substring value 0
+ (- width (length annotation)))
+ annotation))
+ right)))
+ (setq width (+ width margin (length right)))
+
+ (font-lock-append-text-property 0 width 'mouse-face
+ 'company-tooltip-mouse
+ line)
+ (when (< ann-start ann-end)
+ (add-face-text-property ann-start ann-end
+ (if selected
+ 'company-tooltip-annotation-selection
+ 'company-tooltip-annotation)
+ t line))
+ (cl-loop
+ with width = (- width (length right))
+ for (comp-beg . comp-end) in common
+ for inline-beg = (+ margin comp-beg)
+ for inline-end = (min (+ margin comp-end) width)
+ when (< inline-beg width)
+ do (add-face-text-property inline-beg inline-end
+ (if selected
+ 'company-tooltip-common-selection
+ 'company-tooltip-common)
+ nil line))
+ (when (let ((re (funcall company-search-regexp-function
+ company-search-string)))
+ (and (not (string= re ""))
+ (string-match re value)))
+ (pcase-dolist (`(,mbeg . ,mend) (company--search-chunks))
+ (let ((beg (+ margin mbeg))
+ (end (+ margin mend))
+ (width (- width (length right))))
+ (when (< beg width)
+ (add-face-text-property beg (min end width)
+ (if selected
+ 'company-tooltip-search-selection
+ 'company-tooltip-search)
+ nil line)))))
+ (when selected
+ (add-face-text-property 0 width 'company-tooltip-selection t line))
+
+ (when (company-call-backend 'deprecated value)
+ (add-face-text-property margin
+ (min
+ (+ margin (length value))
+ (- width (length right)))
+ 'company-tooltip-deprecated t line))
+
+ (add-face-text-property 0 width 'company-tooltip t line)
+ line))
+
+(defun company--search-chunks ()
+ (let ((md (match-data t))
+ res)
+ (if (<= (length md) 2)
+ (push (cons (nth 0 md) (nth 1 md)) res)
+ (while (setq md (nthcdr 2 md))
+ (when (car md)
+ (push (cons (car md) (cadr md)) res))))
+ res))
+
+(defun company--pre-render (str &optional annotation-p)
+ (or (company-call-backend 'pre-render str annotation-p)
+ (progn
+ (when (or (text-property-not-all 0 (length str) 'face nil str)
+ (text-property-not-all 0 (length str) 'mouse-face nil str))
+ (setq str (copy-sequence str))
+ (remove-text-properties 0 (length str)
+ '(face nil font-lock-face nil mouse-face nil)
+ str))
+ str)))
+
+(defun company--clean-string (str)
+ (replace-regexp-in-string
+ "\\([^[:graph:] ]\\)\\|\\(\ufeff\\)\\|[[:multibyte:]]"
+ (lambda (match)
+ (cond
+ ((match-beginning 1)
+ ;; FIXME: Better char for 'non-printable'?
+ ;; We shouldn't get any of these, but sometimes we might.
+ ;; The official "replacement character" is not supported by some fonts.
+ ;;"\ufffd"
+ "?"
+ )
+ ((match-beginning 2)
+ ;; Zero-width non-breakable space.
+ "")
+ ((> (string-width match) 1)
+ (concat
+ (make-string (1- (string-width match)) ?\ufeff)
+ match))
+ (t match)))
+ str))
+
+;;; replace
+
+(defun company-buffer-lines (beg end)
+ (goto-char beg)
+ (let (lines lines-moved)
+ (while (and (not (eobp)) ; http://debbugs.gnu.org/19553
+ (> (setq lines-moved (vertical-motion 1)) 0)
+ (<= (point) end))
+ (let ((bound (min end (point))))
+ ;; A visual line can contain several physical lines (e.g. with outline's
+ ;; folding overlay). Take only the first one.
+ (push (buffer-substring beg
+ (save-excursion
+ (goto-char beg)
+ (re-search-forward "$" bound 'move)
+ (point)))
+ lines))
+ ;; One physical line can be displayed as several visual ones as well:
+ ;; add empty strings to the list, to even the count.
+ (dotimes (_ (1- lines-moved))
+ (push "" lines))
+ (setq beg (point)))
+ (unless (eq beg end)
+ (push (buffer-substring beg end) lines))
+ (nreverse lines)))
+
+(defun company-modify-line (old new offset)
+ (concat (company-safe-substring old 0 offset)
+ new
+ (company-safe-substring old (+ offset (length new)))))
+
+(defun company--show-numbers (numbered)
+ (format " %s" (if (<= numbered 10)
+ (mod numbered 10)
+ " ")))
+(make-obsolete
+ 'company--show-numbers
+ "use `company-quick-access-hint-key' instead,
+but adjust the expected values appropriately."
+ "0.9.14")
+
+(defsubst company--window-height ()
+ (if (fboundp 'window-screen-lines)
+ (floor (window-screen-lines))
+ (window-body-height)))
+
+(defun company--window-width ()
+ (let ((ww (window-body-width)))
+ ;; Account for the line continuation column.
+ (when (zerop (cadr (window-fringes)))
+ (cl-decf ww))
+ (when (bound-and-true-p display-line-numbers)
+ (cl-decf ww (+ 2 (line-number-display-width))))
+ ;; whitespace-mode with newline-mark
+ (when (and buffer-display-table
+ (aref buffer-display-table ?\n))
+ (cl-decf ww (1- (length (aref buffer-display-table ?\n)))))
+ ww))
+
+(defun company--face-attribute (face attr)
+ ;; Like `face-attribute', but accounts for faces that have been remapped to
+ ;; another face, a list of faces, or a face spec.
+ (cond ((null face) nil)
+ ((symbolp face)
+ (let ((remap (cdr (assq face face-remapping-alist))))
+ (if remap
+ (company--face-attribute
+ ;; Faces can be remapped to their unremapped selves, but that
+ ;; would cause us infinite recursion.
+ (if (listp remap) (remq face remap) remap)
+ attr)
+ (face-attribute face attr nil t))))
+ ((keywordp (car-safe face))
+ (or (plist-get face attr)
+ (company--face-attribute (plist-get face :inherit) attr)))
+ ((listp face)
+ (cl-find-if #'stringp
+ (mapcar (lambda (f) (company--face-attribute f attr))
+ face)))))
+
+(defun company--replacement-string (lines column-offset old column nl &optional align-top)
+ (cl-decf column column-offset)
+
+ (when (< column 0) (setq column 0))
+
+ (when (and align-top company-tooltip-flip-when-above)
+ (setq lines (reverse lines)))
+
+ (let ((width (length (car lines)))
+ (remaining-cols (- (+ (company--window-width) (window-hscroll))
+ column)))
+ (when (> width remaining-cols)
+ (cl-decf column (- width remaining-cols))))
+
+ (let (new)
+ (when align-top
+ ;; untouched lines first
+ (dotimes (_ (- (length old) (length lines)))
+ (push (pop old) new)))
+ ;; length into old lines.
+ (while old
+ (push (company-modify-line (pop old) (pop lines) column)
+ new))
+ ;; Append whole new lines.
+ (while lines
+ (push (concat (company-space-string column) (pop lines))
+ new))
+
+ ;; XXX: Also see branch 'more-precise-extend'.
+ (let* ((nl-face `(,@(when (version<= "27" emacs-version)
+ '(:extend t))
+ :inverse-video nil
+ :background ,(or (company--face-attribute 'default :background)
+ (face-attribute 'default :background nil t))))
+ (str (apply #'concat
+ (when nl " \n")
+ (cl-mapcan
+ ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42552#23
+ (lambda (line) (list line (propertize "\n" 'face nl-face)))
+ (nreverse new)))))
+ ;; https://debbugs.gnu.org/38563
+ (add-face-text-property 0 (length str) 'default t str)
+ (when nl (put-text-property 0 1 'cursor t str))
+ str)))
+
+(defun company--create-lines (selection limit)
+ (let ((len company-candidates-length)
+ (window-width (company--window-width))
+ left-margins
+ left-margin-size
+ lines
+ width
+ lines-copy
+ items
+ previous
+ remainder
+ scrollbar-bounds)
+
+ ;; Maybe clear old offset.
+ (when (< len (+ company-tooltip-offset limit))
+ (setq company-tooltip-offset 0))
+
+ (let ((selection (or selection 0)))
+ ;; Scroll to offset.
+ (if (eq company-tooltip-offset-display 'lines)
+ (setq limit (company-tooltip--lines-update-offset selection len limit))
+ (company-tooltip--simple-update-offset selection len limit))
+
+ (cond
+ ((eq company-tooltip-offset-display 'scrollbar)
+ (setq scrollbar-bounds (company--scrollbar-bounds company-tooltip-offset
+ limit len)))
+ ((eq company-tooltip-offset-display 'lines)
+ (when (> company-tooltip-offset 0)
+ (setq previous (format "...(%d)" company-tooltip-offset)))
+ (setq remainder (- len limit company-tooltip-offset)
+ remainder (when (> remainder 0)
+ (setq remainder (format "...(%d)" remainder)))))))
+
+ (when selection
+ (cl-decf selection company-tooltip-offset))
+
+ (setq width (max (length previous) (length remainder))
+ lines (nthcdr company-tooltip-offset company-candidates)
+ len (min limit len)
+ lines-copy lines)
+
+ (when scrollbar-bounds (cl-decf window-width))
+
+ (when company-format-margin-function
+ (let ((lines-copy lines-copy)
+ res)
+ (dotimes (i len)
+ (push (funcall company-format-margin-function
+ (pop lines-copy)
+ (equal selection i))
+ res))
+ (setq left-margins (nreverse res))))
+
+ ;; XXX: format-function outputting shorter strings than the
+ ;; default margin is not supported (yet?).
+ (setq left-margin-size (apply #'max company-tooltip-margin
+ (mapcar #'length left-margins)))
+
+ (cl-decf window-width company-tooltip-margin)
+ (cl-decf window-width left-margin-size)
+
+ (dotimes (_ len)
+ (let* ((value (pop lines-copy))
+ (annotation (company-call-backend 'annotation value))
+ (left (or (pop left-margins)
+ (company-space-string left-margin-size))))
+ (setq value (company--clean-string value))
+ (when annotation
+ (setq annotation (company--clean-string annotation))
+ (when company-tooltip-align-annotations
+ ;; `lisp-completion-at-point' adds a space.
+ (setq annotation (string-trim-left annotation))))
+ (push (list value annotation left) items)
+ (setq width (max (+ (length value)
+ (if (and annotation company-tooltip-align-annotations)
+ (1+ (length annotation))
+ (length annotation)))
+ width))))
+
+ (setq width (min window-width
+ company-tooltip-maximum-width
+ (max company-tooltip-minimum-width
+ (if company-show-quick-access
+ (+ 2 width)
+ width))))
+
+ (when company-tooltip-width-grow-only
+ (setq width (max company--tooltip-current-width width))
+ (setq company--tooltip-current-width width))
+
+ (let ((items (nreverse items))
+ (row (if company-show-quick-access 0 99999))
+ new)
+ (when previous
+ (push (company--scrollpos-line previous width left-margin-size) new))
+
+ (dotimes (i len)
+ (let* ((item (pop items))
+ (str (car item))
+ (annotation (cadr item))
+ (left (nth 2 item))
+ (right (company-space-string company-tooltip-margin))
+ (width width)
+ (selected (equal selection i)))
+ (when company-show-quick-access
+ (let ((quick-access (gv-ref (if (eq company-show-quick-access 'left)
+ left right)))
+ (qa-hint (company-tooltip--format-quick-access-hint
+ row selected)))
+ (cl-decf width (string-width qa-hint))
+ (setf (gv-deref quick-access)
+ (concat qa-hint (gv-deref quick-access))))
+ (cl-incf row))
+ (push (concat
+ (company-fill-propertize str annotation
+ width selected
+ left
+ right)
+ (when scrollbar-bounds
+ (company--scrollbar i scrollbar-bounds)))
+ new)))
+
+ (when remainder
+ (push (company--scrollpos-line remainder width left-margin-size) new))
+
+ (cons
+ left-margin-size
+ (nreverse new)))))
+
+(defun company--scrollbar-bounds (offset limit length)
+ (when (> length limit)
+ (let* ((size (ceiling (* limit (float limit)) length))
+ (lower (floor (* limit (float offset)) length))
+ (upper (+ lower size -1)))
+ (cons lower upper))))
+
+(defun company--scrollbar (i bounds)
+ (propertize " " 'face
+ (if (and (>= i (car bounds)) (<= i (cdr bounds)))
+ 'company-tooltip-scrollbar-thumb
+ 'company-tooltip-scrollbar-track)))
+
+(defun company--scrollpos-line (text width fancy-margin-width)
+ (propertize (concat (company-space-string company-tooltip-margin)
+ (company-safe-substring text 0 width)
+ (company-space-string fancy-margin-width))
+ 'face 'company-tooltip))
+
+(defun company-tooltip--format-quick-access-hint (row selected)
+ "Format a quick-access hint for outputting on a tooltip's ROW.
+Value of SELECTED determines the added face."
+ (propertize (format "%2s" (funcall company-quick-access-hint-function row))
+ 'face
+ (if selected
+ 'company-tooltip-quick-access-selection
+ 'company-tooltip-quick-access)))
+
+;; show
+
+(defvar-local company-pseudo-tooltip-overlay nil)
+
+(defun company--inside-tooltip-p (event-col-row row height)
+ (let* ((ovl company-pseudo-tooltip-overlay)
+ (column (overlay-get ovl 'company-column))
+ (width (overlay-get ovl 'company-width))
+ (evt-col (car event-col-row))
+ (evt-row (cdr event-col-row)))
+ (and (>= evt-col column)
+ (< evt-col (+ column width))
+ (if (> height 0)
+ (and (> evt-row row)
+ (<= evt-row (+ row height) ))
+ (and (< evt-row row)
+ (>= evt-row (+ row height)))))))
+
+(defun company--pseudo-tooltip-height ()
+ "Calculate the appropriate tooltip height.
+Returns a negative number if the tooltip should be displayed above point."
+ (let* ((lines (company--row))
+ (below (- (company--window-height) 1 lines)))
+ (if (and (< below (min company-tooltip-minimum company-candidates-length))
+ (> lines below))
+ (- (max 3 (min company-tooltip-limit lines)))
+ (max 3 (min company-tooltip-limit below)))))
+
+(defun company-pseudo-tooltip-show (row column selection)
+ (company-pseudo-tooltip-hide)
+
+ (let* ((height (company--pseudo-tooltip-height))
+ above)
+
+ (when (< height 0)
+ (setq row (+ row height -1)
+ above t))
+
+ ;; This can happen in Emacs versions which allow arbitrary scrolling,
+ ;; such as Yamamoto's Mac Port.
+ (unless (pos-visible-in-window-p (window-start))
+ (cl-decf row))
+
+ (let (nl beg end ov args)
+ (save-excursion
+ (setq nl (< (move-to-window-line row) row)
+ beg (point)
+ end (save-excursion
+ (move-to-window-line (+ row (abs height)))
+ (point))
+ ov (make-overlay beg end nil t)
+ args (list (mapcar 'company-plainify
+ (company-buffer-lines beg end))
+ column nl above)))
+
+ (setq company-pseudo-tooltip-overlay ov)
+ (overlay-put ov 'company-replacement-args args)
+
+ (let* ((lines-and-offset (company--create-lines selection (abs height)))
+ (lines (cdr lines-and-offset))
+ (column-offset (car lines-and-offset)))
+ (overlay-put ov 'company-display
+ (apply 'company--replacement-string
+ lines column-offset args))
+ (overlay-put ov 'company-width (string-width (car lines))))
+
+ (overlay-put ov 'company-column column)
+ (overlay-put ov 'company-height height))))
+
+(defun company-pseudo-tooltip-show-at-point (pos column-offset)
+ (let* ((col-row (company--col-row pos))
+ (col (- (car col-row) column-offset)))
+ (when (< col 0) (setq col 0))
+ (company-pseudo-tooltip-show (1+ (cdr col-row)) col company-selection)))
+
+(defun company-pseudo-tooltip-edit (selection)
+ (let* ((height (overlay-get company-pseudo-tooltip-overlay 'company-height))
+ (lines-and-offset (company--create-lines selection (abs height)))
+ (lines (cdr lines-and-offset))
+ (column-offset (car lines-and-offset)))
+ (overlay-put company-pseudo-tooltip-overlay 'company-width
+ (string-width (car lines)))
+ (overlay-put company-pseudo-tooltip-overlay 'company-display
+ (apply 'company--replacement-string
+ lines column-offset
+ (overlay-get company-pseudo-tooltip-overlay
+ 'company-replacement-args)))))
+
+(defun company-pseudo-tooltip-hide ()
+ (when company-pseudo-tooltip-overlay
+ (delete-overlay company-pseudo-tooltip-overlay)
+ (setq company-pseudo-tooltip-overlay nil)))
+
+(defun company-pseudo-tooltip-hide-temporarily ()
+ (when (overlayp company-pseudo-tooltip-overlay)
+ (overlay-put company-pseudo-tooltip-overlay 'invisible nil)
+ (overlay-put company-pseudo-tooltip-overlay 'line-prefix nil)
+ (overlay-put company-pseudo-tooltip-overlay 'before-string nil)
+ (overlay-put company-pseudo-tooltip-overlay 'display nil)
+ (overlay-put company-pseudo-tooltip-overlay 'face nil)))
+
+(defun company-pseudo-tooltip-unhide ()
+ (when company-pseudo-tooltip-overlay
+ (let* ((ov company-pseudo-tooltip-overlay)
+ (disp (overlay-get ov 'company-display)))
+ ;; Beat outline's folding overlays.
+ ;; And Flymake (53). And Flycheck (110).
+ (overlay-put ov 'priority 111)
+ ;; visual-line-mode
+ (when (and (memq (char-before (overlay-start ov)) '(?\s ?\t))
+ ;; not eob
+ (not (nth 2 (overlay-get ov 'company-replacement-args))))
+ (setq disp (concat "\n" disp)))
+ ;; No (extra) prefix for the first line.
+ (overlay-put ov 'line-prefix "")
+ (overlay-put ov 'before-string disp)
+ ;; `display' is better than `invisible':
+ ;; https://debbugs.gnu.org/18285
+ ;; https://debbugs.gnu.org/20847
+ ;; https://debbugs.gnu.org/42521
+ (overlay-put ov 'display "")
+ (overlay-put ov 'window (selected-window)))))
+
+(defun company-pseudo-tooltip-guard ()
+ (list
+ (save-excursion (beginning-of-visual-line))
+ (window-width)
+ (let ((ov company-pseudo-tooltip-overlay)
+ (overhang (save-excursion (end-of-visual-line)
+ (- (line-end-position) (point)))))
+ (when (>= (overlay-get ov 'company-height) 0)
+ (cons
+ (buffer-substring-no-properties (point) (overlay-start ov))
+ (when (>= overhang 0) overhang))))))
+
+(defun company-pseudo-tooltip-frontend (command)
+ "`company-mode' frontend similar to a tooltip but based on overlays."
+ (cl-case command
+ (pre-command (company-pseudo-tooltip-hide-temporarily))
+ (unhide
+ (let ((ov company-pseudo-tooltip-overlay))
+ (when (> (overlay-get ov 'company-height) 0)
+ ;; Sleight of hand: if the current line wraps, we adjust the
+ ;; start of the overlay so that the popup does not zig-zag,
+ ;; but don't update the popup's background. This seems just
+ ;; non-annoying enough to avoid the work required for the latter.
+ (save-excursion
+ (vertical-motion 1)
+ (unless (= (point) (overlay-start ov))
+ (move-overlay ov (point) (overlay-end ov))))))
+ (company-pseudo-tooltip-unhide))
+ (post-command
+ (unless (when (overlayp company-pseudo-tooltip-overlay)
+ (let* ((ov company-pseudo-tooltip-overlay)
+ (old-height (overlay-get ov 'company-height))
+ (new-height (company--pseudo-tooltip-height)))
+ (and
+ (>= (* old-height new-height) 0)
+ (>= (abs old-height) (abs new-height))
+ (equal (company-pseudo-tooltip-guard)
+ (overlay-get ov 'company-guard)))))
+ ;; Redraw needed.
+ (company-pseudo-tooltip-show-at-point (point) (length company-prefix))
+ (overlay-put company-pseudo-tooltip-overlay
+ 'company-guard (company-pseudo-tooltip-guard)))
+ (company-pseudo-tooltip-unhide))
+ (show (setq company--tooltip-current-width 0))
+ (hide (company-pseudo-tooltip-hide)
+ (setq company-tooltip-offset 0))
+ (update (when (overlayp company-pseudo-tooltip-overlay)
+ (company-pseudo-tooltip-edit company-selection)))
+ (select-mouse
+ (let ((event-col-row (company--event-col-row company-mouse-event))
+ (ovl-row (company--row))
+ (ovl-height (and company-pseudo-tooltip-overlay
+ (min (overlay-get company-pseudo-tooltip-overlay
+ 'company-height)
+ company-candidates-length))))
+ (cond ((and ovl-height
+ (company--inside-tooltip-p event-col-row ovl-row ovl-height))
+ (company-set-selection (+ (cdr event-col-row)
+ (1- company-tooltip-offset)
+ (if (and (eq company-tooltip-offset-display 'lines)
+ (not (zerop company-tooltip-offset)))
+ -1 0)
+ (- ovl-row)
+ (if (< ovl-height 0)
+ (- 1 ovl-height)
+ 0)))
+ t))))))
+
+(defun company-pseudo-tooltip-unless-just-one-frontend (command)
+ "`company-pseudo-tooltip-frontend', but not shown for single candidates."
+ (unless (and (memq command '(post-command unhide))
+ (company--show-inline-p))
+ (company-pseudo-tooltip-frontend command)))
+
+(defun company-pseudo-tooltip--ujofwd-on-timer (command)
+ (when company-candidates
+ (company-pseudo-tooltip-unless-just-one-frontend-with-delay command)))
+
+(defun company-pseudo-tooltip-unless-just-one-frontend-with-delay (command)
+ "`compandy-pseudo-tooltip-frontend', but shown after a delay.
+Delay is determined by `company-tooltip-idle-delay'."
+ (defvar company-preview-overlay)
+ (when (and (memq command '(pre-command hide))
+ company-tooltip-timer)
+ (cancel-timer company-tooltip-timer)
+ (setq company-tooltip-timer nil))
+ (cl-case command
+ (post-command
+ (if (or company-tooltip-timer
+ (overlayp company-pseudo-tooltip-overlay))
+ (if (not (overlayp company-preview-overlay))
+ (company-pseudo-tooltip-unless-just-one-frontend command)
+ (let (company-tooltip-timer)
+ (company-call-frontends 'pre-command))
+ (company-call-frontends 'post-command))
+ (setq company-tooltip-timer
+ (run-with-timer company-tooltip-idle-delay nil
+ 'company-pseudo-tooltip--ujofwd-on-timer
+ 'post-command))))
+ (unhide
+ (when (overlayp company-pseudo-tooltip-overlay)
+ (company-pseudo-tooltip-unless-just-one-frontend command)))
+ (t
+ (company-pseudo-tooltip-unless-just-one-frontend command))))
+
+;;; overlay ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar-local company-preview-overlay nil)
+
+(defun company-preview-show-at-point (pos completion)
+ (company-preview-hide)
+
+ (let* ((company-common (and company-common
+ (string-prefix-p company-prefix company-common)
+ company-common))
+ (common (company--common-or-matches completion)))
+ (setq completion (copy-sequence (company--pre-render completion)))
+ (add-face-text-property 0 (length completion) 'company-preview
+ nil completion)
+
+ (cl-loop for (beg . end) in common
+ do (add-face-text-property beg end 'company-preview-common
+ nil completion))
+
+ ;; Add search string
+ (and (string-match (funcall company-search-regexp-function
+ company-search-string)
+ completion)
+ (pcase-dolist (`(,mbeg . ,mend) (company--search-chunks))
+ (add-face-text-property mbeg mend 'company-preview-search
+ nil completion)))
+
+ (setq completion (if (string-prefix-p company-prefix completion
+ (eq (company-call-backend 'ignore-case)
+ 'keep-prefix))
+ (company-strip-prefix completion)
+ completion))
+
+ (and (equal pos (point))
+ (not (equal completion ""))
+ (add-text-properties 0 1 '(cursor 1) completion))
+
+ (let* ((beg pos)
+ (pto company-pseudo-tooltip-overlay)
+ (ptf-workaround (and
+ pto
+ (char-before pos)
+ (eq pos (overlay-start pto)))))
+ ;; Try to accommodate for the pseudo-tooltip overlay,
+ ;; which may start at the same position if it's at eol.
+ (when ptf-workaround
+ (cl-decf beg)
+ (setq completion (concat (buffer-substring beg pos) completion)))
+
+ (setq company-preview-overlay (make-overlay beg pos))
+
+ (let ((ov company-preview-overlay))
+ (overlay-put ov (if ptf-workaround 'display 'after-string)
+ completion)
+ (overlay-put ov 'window (selected-window))))))
+
+(defun company-preview-hide ()
+ (when company-preview-overlay
+ (delete-overlay company-preview-overlay)
+ (setq company-preview-overlay nil)))
+
+(defun company-preview-frontend (command)
+ "`company-mode' frontend showing the selection as if it had been inserted."
+ (pcase command
+ (`pre-command (company-preview-hide))
+ (`unhide
+ (when company-selection
+ (let* ((current (nth company-selection company-candidates))
+ (company-prefix (if (equal current company-prefix)
+ ;; Would be more accurate to compare lengths,
+ ;; but this is shorter.
+ current
+ (buffer-substring
+ (- company-point (length company-prefix))
+ (point)))))
+ (company-preview-show-at-point (point) current))))
+ (`post-command
+ (when company-selection
+ (company-preview-show-at-point (point)
+ (nth company-selection company-candidates))))
+ (`hide (company-preview-hide))))
+
+(defun company-preview-if-just-one-frontend (command)
+ "`company-preview-frontend', but only shown for single candidates."
+ (when (or (not (memq command '(post-command unhide)))
+ (company--show-inline-p))
+ (company-preview-frontend command)))
+
+(defun company--show-inline-p ()
+ (and (not (cdr company-candidates))
+ company-common
+ (not (eq t (compare-strings company-prefix nil nil
+ (car company-candidates) nil nil
+ t)))
+ (or (eq (company-call-backend 'ignore-case) 'keep-prefix)
+ (string-prefix-p company-prefix company-common))))
+
+(defun company-tooltip-visible-p ()
+ "Returns whether the tooltip is visible."
+ (when (overlayp company-pseudo-tooltip-overlay)
+ (not (overlay-get company-pseudo-tooltip-overlay 'invisible))))
+
+(defun company-preview-common--show-p ()
+ "Returns whether the preview of common can be showed or not"
+ (and company-common
+ (or (eq (company-call-backend 'ignore-case) 'keep-prefix)
+ (string-prefix-p company-prefix company-common))))
+
+(defun company-preview-common-frontend (command)
+ "`company-mode' frontend preview the common part of candidates."
+ (when (or (not (memq command '(post-command unhide)))
+ (company-preview-common--show-p))
+ (pcase command
+ (`pre-command (company-preview-hide))
+ ((or 'post-command 'unhide)
+ (company-preview-show-at-point (point) company-common))
+ (`hide (company-preview-hide)))))
+
+;;; echo ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar-local company-echo-last-msg nil)
+
+(defvar company-echo-timer nil)
+
+(defvar company-echo-delay .01)
+
+(defcustom company-echo-truncate-lines t
+ "Whether frontend messages written to the echo area should be truncated."
+ :type 'boolean
+ :package-version '(company . "0.9.3"))
+
+(defun company-echo-show (&optional getter)
+ (when getter
+ (setq company-echo-last-msg (funcall getter)))
+ (let ((message-log-max nil)
+ (message-truncate-lines company-echo-truncate-lines))
+ (if company-echo-last-msg
+ (message "%s" company-echo-last-msg)
+ (message ""))))
+
+(defun company-echo-show-soon (&optional getter delay)
+ (company-echo-cancel)
+ (setq company-echo-timer (run-with-timer (or delay company-echo-delay)
+ nil
+ 'company-echo-show getter)))
+
+(defun company-echo-cancel (&optional unset)
+ (when company-echo-timer
+ (cancel-timer company-echo-timer))
+ (when unset
+ (setq company-echo-timer nil)))
+
+(defun company-echo-format ()
+ (let ((selection (or company-selection 0)))
+ (let ((limit (window-body-width (minibuffer-window)))
+ (len -1)
+ (candidates (nthcdr selection company-candidates))
+ (numbered (if company-show-quick-access selection 99999))
+ (qa-keys-len (length company-quick-access-keys))
+ comp msg)
+
+ (while candidates
+ (setq comp (propertize
+ (company-reformat (company--clean-string (pop candidates)))
+ 'face
+ 'company-echo)
+ len (+ len 1 (length comp)))
+ (let ((beg 0)
+ (end (string-width (or company-common ""))))
+ (when (< numbered qa-keys-len)
+ (let ((qa-hint
+ (format "%s: " (funcall
+ company-quick-access-hint-function
+ numbered))))
+ (setq beg (string-width qa-hint)
+ end (+ beg end))
+ (cl-incf len beg)
+ (setq comp (propertize (concat qa-hint comp) 'face 'company-echo)))
+ (cl-incf numbered))
+ ;; FIXME: Add support for the `match' backend action, and thus,
+ ;; non-prefix matches.
+ (add-text-properties beg end '(face company-echo-common) comp))
+ (if (>= len limit)
+ (setq candidates nil)
+ (push comp msg)))
+
+ (mapconcat 'identity (nreverse msg) " "))))
+
+(defun company-echo-strip-common-format ()
+ (let ((selection (or company-selection 0)))
+ (let ((limit (window-body-width (minibuffer-window)))
+ (len (+ (length company-prefix) 2))
+ (candidates (nthcdr selection company-candidates))
+ (numbered (if company-show-quick-access selection 99999))
+ (qa-keys-len (length company-quick-access-keys))
+ comp msg)
+
+ (while candidates
+ (setq comp (company-strip-prefix (pop candidates))
+ len (+ len 2 (length comp)))
+ (when (< numbered qa-keys-len)
+ (let ((qa-hint (format " (%s)"
+ (funcall company-quick-access-hint-function
+ numbered))))
+ (setq comp (concat comp qa-hint))
+ (cl-incf len (string-width qa-hint)))
+ (cl-incf numbered))
+ (if (>= len limit)
+ (setq candidates nil)
+ (push (propertize comp 'face 'company-echo) msg)))
+
+ (concat (propertize company-prefix 'face 'company-echo-common) "{"
+ (mapconcat 'identity (nreverse msg) ", ")
+ "}"))))
+
+(defun company-echo-hide ()
+ (unless (equal company-echo-last-msg "")
+ (setq company-echo-last-msg "")
+ (company-echo-show)))
+
+(defun company-echo-frontend (command)
+ "`company-mode' frontend showing the candidates in the echo area."
+ (pcase command
+ (`post-command (company-echo-show-soon 'company-echo-format 0))
+ (`hide (company-echo-hide))))
+
+(defun company-echo-strip-common-frontend (command)
+ "`company-mode' frontend showing the candidates in the echo area."
+ (pcase command
+ (`post-command (company-echo-show-soon 'company-echo-strip-common-format 0))
+ (`hide (company-echo-hide))))
+
+(defun company-echo-metadata-frontend (command)
+ "`company-mode' frontend showing the documentation in the echo area."
+ (pcase command
+ (`post-command (company-echo-show-soon 'company-fetch-metadata))
+ (`unhide (company-echo-show))
+ (`hide (company-echo-hide))))
+
+(provide 'company)
+;;; company.el ends here
diff --git a/elpa/company-20220326.48/company.elc b/elpa/company-20220326.48/company.elc
new file mode 100644
index 0000000..488bc83
--- /dev/null
+++ b/elpa/company-20220326.48/company.elc
Binary files differ
diff --git a/elpa/company-20220326.48/company.info b/elpa/company-20220326.48/company.info
new file mode 100644
index 0000000..c01ccb5
--- /dev/null
+++ b/elpa/company-20220326.48/company.info
@@ -0,0 +1,1695 @@
+This is company.info, produced by makeinfo version 6.7 from
+company.texi.
+
+This user manual is for Company version 0.9.14snapshot (8 January 2022).
+
+Copyright © 2021-2022 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.
+INFO-DIR-SECTION Emacs misc features
+START-INFO-DIR-ENTRY
+* Company: (company). A modular text completion framework.
+END-INFO-DIR-ENTRY
+
+
+File: company.info, Node: Top, Next: Overview, Up: (dir)
+
+Company
+*******
+
+Company is a modular text completion framework for GNU Emacs.
+
+The goal of this document is to lay out the foundational knowledge of
+the package, so that the readers of the manual could competently start
+adapting Company to their needs and preferences.
+
+This user manual is for Company version 0.9.14snapshot (8 January 2022).
+
+Copyright © 2021-2022 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.
+
+* Menu:
+
+* Overview:: Terminology and Structure
+* Getting Started:: Quick Start Guide
+* Customization:: User Options
+* Frontends:: Frontends Usage Instructions
+* Backends:: Backends Usage Instructions
+* Troubleshooting:: When Something Goes Wrong
+* Index::
+
+— The Detailed Node Listing —
+
+Overview
+
+* Terminology::
+* Structure::
+
+Getting Started
+
+* Installation::
+* Initial Setup::
+* Usage Basics::
+* Commands::
+
+Customization
+
+* Customization Interface::
+* Configuration File::
+
+Frontends
+
+* Tooltip Frontends::
+* Preview Frontends::
+* Echo Frontends::
+* Candidates Search::
+* Filter Candidates::
+* Quick Access a Candidate::
+
+Backends
+
+* Backends Usage Basics::
+* Grouped Backends::
+* Package Backends::
+* Candidates Post-Processing::
+
+
+
+File: company.info, Node: Overview, Next: Getting Started, Prev: Top, Up: Top
+
+1 Overview
+**********
+
+“Company” is a modular text completion framework for GNU Emacs.
+
+In other words, it is a package for retrieving, manipulating, and
+displaying text completion candidates. It aims to assist developers,
+writers, and scientists during code and text writing.
+
+* Menu:
+
+* Terminology::
+* Structure::
+
+
+File: company.info, Node: Terminology, Next: Structure, Up: Overview
+
+1.1 Terminology
+===============
+
+“Completion” is an act of intelligibly guessing possible variants of
+words based on already typed characters. To “complete” a word means to
+insert a correctly guessed variant into the buffer.
+
+Consequently, the “candidates” are the aforementioned guessed variants
+of words. Each of the candidates has the potential to be chosen for
+successful completion. And each of the candidates contains the
+initially typed characters: either only at the beginning (so-called
+“prefix matches”), or also inside (“non-prefix matches”) of a candidate
+(1).
+
+The package’s name “Company” is based on the combination of the two
+words: ‘Complete’ and ‘Anything’. These words reflect the package’s
+commitment to handling completion candidates and its extensible nature
+allowing it to cover a wide range of usage scenarios.
+
+ ---------- Footnotes ----------
+
+ (1) A good starting point to learn about types of matches is to play
+with the Emacs’s user option ‘completion-styles’. For illustrations on
+how Company visualizes the matches, *note Frontends::.
+
+
+File: company.info, Node: Structure, Prev: Terminology, Up: Overview
+
+1.2 Structure
+=============
+
+The Company is easily extensible because its significant building blocks
+are pluggable modules: backends (*note Backends::) and frontends (*note
+Frontends::).
+
+The “backends” are responsible for retrieving completion candidates;
+which are then outputted by the “frontends”. For an easy and quick
+initial setup, Company is supplied with the preconfigured sets of the
+backends and frontends. The default behavior of the modules can be
+adjusted per particular needs, goals, and preferences. It is also
+typical to utilize backends from a variety of third-party libraries
+(https://github.com/company-mode/company-mode/wiki/Third-Party-Packages),
+developed to be pluggable with Company.
+
+But Company consists not only of the backends and frontends.
+
+A core of the package plays the role of a controller, connecting the
+modules, making them work together; and exposing configurations and
+commands for a user to operate with. For more details, *note
+Customization:: and *note Commands::.
+
+Also, Company is bundled with an alternative workflow configuration
+“company-tng” — defining ‘company-tng-frontend’, ‘company-tng-mode’, and
+‘company-tng-map’ — that allows performing completion with just <TAB>.
+To enable this configuration, add the following line to the Emacs
+initialization file (*note (emacs)Init File::):
+
+ (add-hook 'after-init-hook 'company-tng-mode)
+
+
+File: company.info, Node: Getting Started, Next: Customization, Prev: Overview, Up: Top
+
+2 Getting Started
+*****************
+
+This chapter provides basic instructions for Company setup and usage.
+
+* Menu:
+
+* Installation::
+* Initial Setup::
+* Usage Basics::
+* Commands::
+
+
+File: company.info, Node: Installation, Next: Initial Setup, Up: Getting Started
+
+2.1 Installation
+================
+
+Company package is distributed via commonly used package archives in a
+form of both stable and development releases. To install Company, type
+‘M-x package-install <RET> company <RET>’.
+
+For more details on Emacs package archives, *note (emacs)Packages::.
+
+
+File: company.info, Node: Initial Setup, Next: Usage Basics, Prev: Installation, Up: Getting Started
+
+2.2 Initial Setup
+=================
+
+The package Company provides a minor mode “company-mode”.
+
+To activate the _company-mode_, execute the command ‘M-x company-mode’
+that toggles the mode on and off. When it is switched on, the mode line
+(*note (emacs)Mode line::) should indicate its presence with an
+indicator ‘company’.
+
+After _company-mode_ had been enabled, the package auto-starts
+suggesting completion candidates. The candidates are retrieved and
+shown according to the typed characters and the default (until a user
+specifies otherwise) configurations.
+
+To have Company always enabled for the following sessions, add the line
+‘(global-company-mode)’ to the Emacs configuration file
+(*note (emacs)Init File::).
+
+
+File: company.info, Node: Usage Basics, Next: Commands, Prev: Initial Setup, Up: Getting Started
+
+2.3 Usage Basics
+================
+
+By default — having _company-mode_ enabled (*note Initial Setup::) — a
+tooltip with completion candidates is shown when a user types in a few
+characters.
+
+To initiate completion manually, use the command ‘M-x company-complete’.
+
+To select next or previous of the shown completion candidates, use
+respectively key bindings ‘C-n’ and ‘C-p’, then do one of the following:
+
+ • Hit <RET> to choose a selected candidate for completion.
+
+ • Hit <TAB> to complete with the “common part”: characters present at
+ the beginning of all the candidates.
+
+ • Hit ‘C-g’ to stop activity of Company.
+
+
+File: company.info, Node: Commands, Prev: Usage Basics, Up: Getting Started
+
+2.4 Commands
+============
+
+Under the hood, mentioned in the previous section keys are bound to the
+commands of the out-of-the-box Company.
+
+‘C-n’
+‘M-n’
+ Select the next candidate (‘company-select-next-or-abort’,
+ ‘company-select-next’).
+
+‘C-p’
+‘M-p’
+ Select the previous candidate (‘company-select-previous-or-abort’,
+ ‘company-select-previous’).
+
+‘RET’
+‘<return>’
+ Insert the selected candidate (‘company-complete-selection’).
+
+‘TAB’
+‘<tab>’
+ Insert the common part of all the candidates
+ (‘company-complete-common’).
+
+‘C-g’
+‘<ESC ESC ESC>’
+ Cancel _company-mode_ activity (‘company-abort’).
+
+‘C-h’
+‘<f1>’
+ Display a buffer with the documentation for the selected candidate
+ (‘company-show-doc-buffer’).
+
+‘C-w’
+ Display a buffer with the definition of the selected candidate
+ (‘company-show-location’).
+
+The full list of the default key bindings is stored in the variables
+‘company-active-map’ and ‘company-search-map’ (1).
+
+Moreover, Company is bundled with a number of convenience commands that
+do not have default key bindings defined. The following examples
+illustrate how to assign key bindings to such commands.
+
+ (global-set-key (kbd "<tab>") #'company-indent-or-complete-common)
+
+ (with-eval-after-load 'company
+ (define-key company-active-map (kbd "M-/") #'company-complete))
+
+ (with-eval-after-load 'company
+ (define-key company-active-map
+ (kbd "TAB")
+ #'company-complete-common-or-cycle)
+ (define-key company-active-map
+ (kbd "<backtab>")
+ (lambda ()
+ (interactive)
+ (company-complete-common-or-cycle -1))))
+
+In the same manner, an additional key can be assigned to a command or a
+command can be unbound from a key. For instance:
+
+ (with-eval-after-load 'company
+ (define-key company-active-map (kbd "M-.") #'company-show-location)
+ (define-key company-active-map (kbd "RET") nil))
+
+ ---------- Footnotes ----------
+
+ (1) For a more user-friendly output of the pre-defined key bindings,
+utilize ‘M-x describe-keymap <RET> company-active-map’ or
+‘C-h f <RET> company-mode’.
+
+
+File: company.info, Node: Customization, Next: Frontends, Prev: Getting Started, Up: Top
+
+3 Customization
+***************
+
+Emacs provides two equally acceptable ways for user preferences
+configuration: via customization interface (for more details, *note
+(emacs)Easy Customization::) and a configuration file
+(*note (emacs)Init File::). Naturally, Company can be configured by
+both of these approaches.
+
+* Menu:
+
+* Customization Interface::
+* Configuration File::
+
+
+File: company.info, Node: Customization Interface, Next: Configuration File, Up: Customization
+
+3.1 Customization Interface
+===========================
+
+In order to employ the customization interface, run
+‘M-x customize-group <RET> company’.
+
+This interface outputs all the options available for user customization,
+so you may find it beneficial to review this list even if you are going
+to configure Company with the configuration file.
+
+For instructions on how to change the settings, *note (emacs)Changing a
+Variable::.
+
+
+File: company.info, Node: Configuration File, Prev: Customization Interface, Up: Customization
+
+3.2 Configuration File
+======================
+
+Company is a customization-rich package. This section lists some of the
+core settings that influence the overall behavior of the _company-mode_.
+
+ -- User Option: company-minimum-prefix-length
+ This is one of the values (together with ‘company-idle-delay’),
+ based on which Company auto-stars looking up completion candidates.
+ This option configures how many characters have to be typed in by a
+ user before candidates start to be collected and displayed. An
+ often choice nowadays is to configure this option to a lower number
+ than the default value of ‘3’.
+
+ -- User Option: company-idle-delay
+ This is the second of the options that configure Company’s
+ auto-start behavior (together with
+ ‘company-minimum-prefix-length’). The value of this option defines
+ how fast Company is going to react to the typed input, such that
+ setting ‘company-idle-delay’ to ‘0’ makes Company react
+ immediately, ‘nil’ disables auto-starting, and a larger value
+ postpones completion auto-start for that number of seconds. For an
+ even fancier setup, set this option value to a predicate function,
+ as shown in the following example:
+
+ (setq company-idle-delay
+ (lambda () (if (company-in-string-or-comment) nil 0.3)))
+
+ -- User Option: company-global-modes
+ This option allows to specify in which major modes _company-mode_
+ can be enabled by ‘(global-company-mode)’. *Note Initial Setup::.
+ The default value of ‘t’ enables Company in all major modes.
+ Setting ‘company-global-modes’ to ‘nil’ equal in action to toggling
+ off _global-company-mode_. Providing a list of major modes results
+ in having _company-mode_ enabled in the listed modes only. For the
+ opposite result, provide a list of major modes with ‘not’ being the
+ first element of the list, as shown in the following example:
+
+ (setq company-global-modes '(not erc-mode message-mode eshell-mode))
+
+ -- User Option: company-selection-wrap-around
+ Enable this option to loop (cycle) the candidates’ selection: after
+ selecting the last candidate on the list, a command to select the
+ next candidate does so with the first candidate. By default, this
+ option is disabled, which means the selection of the next candidate
+ stops on the last item. The selection of the previous candidate is
+ influenced by this option similarly.
+
+ -- User Option: company-require-match
+ To allow typing in characters that don’t match the candidates, set
+ the value of this option to ‘nil’. For an opposite behavior (that
+ is, to disallow non-matching input), set it to ‘t’. By default,
+ Company is configured to require a matching input only if a user
+ manually enables completion or selects a candidate; by having the
+ option configured to call the function ‘company-explicit-action-p’.
+
+ -- User Option: company-lighter-base
+ This user options allows to configure a string indicator of the
+ enabled _company-mode_ in the mode line. The default value is
+ ‘company’.
+
+ -- User Option: company-insertion-on-trigger
+ One more pair of the user options may instruct Company to complete
+ with the selected candidate by typing one of the
+ ‘company-insertion-triggers’. The user option
+ ‘company-insertion-on-trigger’ can be enabled or disabled by
+ setting its value to one of: ‘nil’, ‘t’, or a predicate function
+ name. *note Predicate: (eintr)Wrong Type of Argument.
+
+ -- User Option: company-insertion-triggers
+ This option has an effect only when ‘company-insertion-on-trigger’
+ is enabled. The value can be one of: a string of characters, a
+ list of syntax description characters (*note (elisp)Syntax Class
+ Table::), or a predicate function. By default, this user option is
+ set to the list of the syntax characters: ‘(?\ ?\) ?.)’, which
+ translates to the whitespaces, close parenthesis, and punctuation.
+ It is safe to configure the value to a character that can
+ potentially be part of a valid completion; in this case, Company
+ does not treat such characters as triggers.
+
+Hooks
+-----
+
+Company exposes the following life-cycle hooks:
+
+ -- User Option: company-completion-started-hook
+
+ -- User Option: company-completion-cancelled-hook
+
+ -- User Option: company-completion-finished-hook
+
+ -- User Option: company-after-completion-hook
+
+
+File: company.info, Node: Frontends, Next: Backends, Prev: Customization, Up: Top
+
+4 Frontends
+***********
+
+Company is packaged with several frontends and provides a predefined set
+of enabled frontends. A list of the enabled frontends can be changed by
+configuring the user option ‘company-frontends’.
+
+Each frontend is simply a function that receives a command and acts
+accordingly to it: outputs candidates, hides its output, refreshes
+displayed data, and so on.
+
+All of the Company frontends can be categorized by the type of the
+output into the three groups: “tooltip-”, “preview-”, and “echo-”
+frontends. We overview these groups in the first sections of this
+chapter. The sections that follow are dedicated to the ways the
+displayed candidates can be searched, filtered, and quick-accessed.
+
+* Menu:
+
+* Tooltip Frontends::
+* Preview Frontends::
+* Echo Frontends::
+* Candidates Search::
+* Filter Candidates::
+* Quick Access a Candidate::
+
+
+File: company.info, Node: Tooltip Frontends, Next: Preview Frontends, Up: Frontends
+
+4.1 Tooltip Frontends
+=====================
+
+This group of frontends displays completion candidates in an overlayed
+tooltip (aka pop-up). Company provides three _tooltip frontends_,
+listed below.
+
+ -- Function: company-pseudo-tooltip-unless-just-one-frontend
+ This is one of the default frontends. It starts displaying a
+ tooltip only if more than one completion candidate is available,
+ which nicely combines — and it is done so by default — with
+ ‘company-preview-if-just-one-frontend’, *note Preview Frontends::.
+
+ -- Function: company-pseudo-tooltip-frontend
+ This frontend outputs a tooltip for any number of completion
+ candidates.
+
+ -- Function: company-pseudo-tooltip-unless-just-one-frontend-with-delay
+ This is a peculiar frontend, that displays a tooltip only if more
+ than one candidate is available, and only after a delay. The delay
+ can be configured with the user option
+ ‘company-tooltip-idle-delay’. A typical use case for plugging in
+ this frontend would be displaying a tooltip only on a manual
+ request (when needed), as shown in the following example:
+
+ (setq company-idle-delay 0
+ company-tooltip-idle-delay 10
+ company-require-match nil
+ company-frontends
+ '(company-pseudo-tooltip-unless-just-one-frontend-with-delay
+ company-preview-frontend
+ company-echo-metadata-frontend)
+ company-backends '(company-capf))
+
+ (global-set-key (kbd "<tab>")
+ (lambda ()
+ (interactive)
+ (let ((company-tooltip-idle-delay 0.0))
+ (company-complete)
+ (and company-candidates
+ (company-call-frontends 'post-command)))))
+
+User Options
+------------
+
+To change the _tooltip frontends_ configuration, adjust the following
+user options.
+
+ -- User Option: company-tooltip-align-annotations
+ An “annotation” is a string that carries additional information
+ about a candidate; such as a data type, function arguments, or
+ whatever a backend appoints to be a valuable piece of information
+ about a candidate. By default, the annotations are shown right
+ beside the candidates. Setting the option value to ‘t’ aligns
+ annotations to the right side of the tooltip.
+
+ (setq company-tooltip-align-annotations t)
+
+
+
+ -- User Option: company-tooltip-limit
+ Controls the maximum number of the candidates shown simultaneously
+ in the tooltip (the default value is ‘10’). When the number of the
+ available candidates is larger than this option’s value, Company
+ paginates the results.
+
+ (setq company-tooltip-limit 4)
+
+
+
+ -- User Option: company-tooltip-offset-display
+ Use this option to choose in which way to output paginated results.
+ The default value is ‘scrollbar’. Another supported value is
+ ‘lines’; choose it to show the quantity of the candidates not
+ displayed by the current tooltip page.
+
+ (setq company-tooltip-offset-display 'lines)
+
+
+
+ -- User Option: company-tooltip-minimum
+ This user option acts only when a tooltip is shown close to the
+ bottom of a window. It guarantees visibility of this number of
+ completion candidates below point. When the number of lines
+ between point and the bottom of a window is less than
+ ‘company-tooltip-minimum’ value, the tooltip is displayed above
+ point.
+
+ (setq company-tooltip-minimum 4)
+
+
+
+
+
+
+ -- User Option: company-tooltip-flip-when-above
+ This is one of the fancy features Company has to suggest. When
+ this setting is enabled, no matter if a tooltip is shown above or
+ below point, the candidates are always listed starting near point.
+ (Putting it differently, the candidates are mirrored horizontally
+ if a tooltip changes its position, instead of being commonly listed
+ top-to-bottom.)
+
+ (setq company-tooltip-flip-when-above t)
+
+
+
+ -- User Option: company-tooltip-minimum-width
+ Sets the minimum width of a tooltip, excluding the margins and the
+ scroll bar. Changing this value especially makes sense if a user
+ navigates between tooltip pages. Keeping this value at the default
+ ‘0’ allows Company to always adapt the width of the tooltip to the
+ longest shown candidate. Enlarging ‘company-tooltip-minimum-width’
+ prevents possible significant shifts in the width of the tooltip
+ when navigating to the next/previous tooltip page. (For an
+ alternate solution, see ‘company-tooltip-width-grow-only’.)
+
+ -- User Option: company-tooltip-width-grow-only
+ This is another way to restrict auto-adaptation of the tooltip
+ width (another is by adjusting ‘company-tooltip-minimum-width’
+ value) when navigating between the tooltip pages.
+
+ -- User Option: company-tooltip-maximum-width
+ This user option controls the maximum width of the tooltip inner
+ area. By default, its value is pseudo-limitless, potentially
+ permitting the output of extremely long candidates. But if long
+ lines become an issue, set this option to a smaller number, such as
+ ‘60’ or ‘70’.
+
+ -- User Option: company-tooltip-margin
+ Controls the width of the “margin” on the sides of the tooltip
+ inner area. If ‘company-format-margin-function’ is set,
+ ‘company-tooltip-margin’ defines only the right margin.
+
+ (setq company-tooltip-margin 3)
+
+
+
+Candidates Icons
+----------------
+
+An “icon” is an image or a text that represents a candidate’s kind; it
+is displayed in front of a candidate. The term “kind” here stands for a
+high-level category a candidate fits into. (Such as ‘array’,
+‘function’, ‘file’, ‘string’, ‘color’, etc. For an extended list of the
+possible _kinds_, see the user option ‘company-text-icons-mapping’ or
+the variable ‘company-vscode-icons-mapping’.)
+
+ -- User Option: company-format-margin-function
+ Allows setting a function to format the left margin of a tooltip
+ inner area; namely, to output candidate’s _icons_. The predefined
+ formatting functions are listed below. A user may also set this
+ option to a custom function. To disable left margin formatting,
+ set the value of the option to ‘nil’ (this way control over the
+ size of the left margin returns to the user option
+ ‘company-tooltip-margin’).
+
+ -- Function: company-vscode-dark-icons-margin
+ -- Function: company-vscode-light-icons-margin
+ These functions utilize VSCode dark and light theme icon sets (1).
+ The related two user options are ‘company-icon-size’ and
+ ‘company-icon-margin’.
+
+
+
+ -- Function: company-text-icons-margin
+ This function produces letters and symbols formatted according to
+ the ‘company-text-icons-format’. The rest of the user options
+ affecting this function behavior are listed below.
+
+
+
+ -- Function: company-dot-icons-margin
+ This function produces a colored Unicode symbol of a circle
+ formatted according to the ‘company-dot-icons-format’. Other user
+ options that affect the resulting output are listed below.
+
+
+
+The following user options influence appearance of the _text_ and _dot_
+_icons_.
+
+ -- User Option: company-text-icons-mapping
+ Lists candidates’ _kinds_ with their corresponding _icons_
+ configurations.
+
+ -- User Option: company-text-face-extra-attributes
+ A list of face attributes to be applied to the _icons_.
+
+ (setq company-text-face-extra-attributes
+ '(:weight bold :slant italic))
+
+
+
+ -- User Option: company-text-icons-add-background
+ If this option is enabled, when an _icon_ doesn’t have a background
+ configured by ‘company-text-icons-mapping’, then a generated
+ background is applied.
+
+ (setq company-text-icons-add-background t)
+
+
+
+ -- Function: company-detect-icons-margin
+ This is the default margin formatting function, that applies one of
+ the ‘company-vscode-*-icons-margin’ functions if ‘vscode’ icons set
+ is supported; otherwise applies a ‘company-text-icons-margin’
+ function.
+
+Faces
+-----
+
+Out-of-the-box Company defines and configures distinguished faces (*note
+(emacs)Faces::) for light and dark themes. Moreover, some of the
+built-in and third-party themes fine-tune Company to fit their palettes.
+That is why there’s often no real need to make such adjustments on a
+user side. However, this chapter presents some hints on where to start
+customizing Company interface.
+
+Namely, the look of a tooltip is controlled by the ‘company-tooltip*’
+named faces.
+
+The following example hints how a user may approach tooltip faces
+customization:
+
+ (custom-set-faces
+ '(company-tooltip
+ ((t (:background "ivory" :foreground "MistyRose3"))))
+ '(company-tooltip-selection
+ ((t (:background "LemonChiffon1" :foreground "MistyRose4"))))
+ '(company-tooltip-common ((t (:weight bold :foreground "pink1"))))
+ '(company-scrollbar-fg ((t (:background "ivory3"))))
+ '(company-scrollbar-bg ((t (:background "ivory2"))))
+ '(company-tooltip-annotation ((t (:foreground "MistyRose2")))))
+
+
+
+ ---------- Footnotes ----------
+
+ (1) SVG images support has to be enabled in Emacs for these icons set
+to be used. The supported images types can be checked with ‘C-h v
+image-types’. Before compiling Emacs, make sure ‘librsvg’ is installed
+on your system.
+
+
+File: company.info, Node: Preview Frontends, Next: Echo Frontends, Prev: Tooltip Frontends, Up: Frontends
+
+4.2 Preview Frontends
+=====================
+
+Frontends in this group output a completion candidate or a common part
+of the candidates temporarily inline, as if a word had already been
+completed (1).
+
+ -- Function: company-preview-if-just-one-frontend
+ This is one of the frontends enabled by default. This frontend
+ outputs a preview if only one completion candidate is available; it
+ is a good suit to be combined with
+ ‘company-pseudo-tooltip-unless-just-one-frontend’, *note Tooltip
+ Frontends::.
+
+ -- Function: company-preview-frontend
+ This frontend outputs the first of the available completion
+ candidates inline for a preview.
+
+ -- Function: company-preview-common-frontend
+ As the name of this frontend suggests, it outputs for a preview
+ only a common part of the candidates.
+
+The look of the preview is controlled by the following faces:
+‘company-preview’, ‘company-preview-common’, and
+‘company-preview-search’.
+
+
+
+
+
+
+ ---------- Footnotes ----------
+
+ (1) The candidates retrieved according to ‘non-prefix’ matches (*note
+Terminology::) may be shown in full after point.
+
+
+File: company.info, Node: Echo Frontends, Next: Candidates Search, Prev: Preview Frontends, Up: Frontends
+
+4.3 Echo Frontends
+==================
+
+The frontends listed in this section display information in the Emacs’s
+echo area, *note (emacs)Echo Area::.
+
+ -- Function: company-echo-metadata-frontend
+ This frontend is a part of the predefined frontends set. Its
+ responsibility is to output a short documentation string for a
+ completion candidate in the echo area.
+
+
+
+
+The last pair of the built-in frontends isn’t that commonly used and not
+as full-featured as the previously reviewed _tooltip-_ and _preview-_
+frontends, but still, feel free to play with them and have some fun!
+
+ -- Function: company-echo-frontend
+ This frontend outputs all the available completion candidates in
+ the echo area.
+
+
+
+ -- Function: company-echo-strip-common-frontend
+ It acts similarly to the previous frontend but outputs a common
+ part of the candidates once for all of them.
+
+
+
+ -- User Option: company-echo-truncate-lines
+ This is the only _echo frontends_ targeted setting. When enabled,
+ the output is truncated to fit the echo area. This setting is set
+ to ‘t’ by default.
+
+To apply visual changes to the output of these frontends, configure the
+faces ‘company-echo’ and ‘company-echo-common’.
+
+
+File: company.info, Node: Candidates Search, Next: Filter Candidates, Prev: Echo Frontends, Up: Frontends
+
+4.4 Candidates Search
+=====================
+
+By default, when _company-mode_ is in action, a key binding ‘C-s’ starts
+looking for matches to additionally typed characters among the displayed
+candidates. When a search is initiated, an indicator
+‘Search: CHARACTERS’ is shown in the Emacs’s mode line.
+
+To quit the search mode, hit ‘C-g’.
+
+ -- User Option: company-search-regexp-function
+ The value of this user option must be a function that interprets
+ the search input. By default it is set to the function
+ ‘regexp-quote’, with looks for an exact match. Company defines
+ several more functions suitable for this option. They are listed
+ below.
+
+ -- Function: company-search-words-regexp
+ Searches for words separated with spaces in the given order.
+
+ -- Function: company-search-words-in-any-order-regexp
+ Searches for words separated with spaces in any order.
+
+ -- Function: company-search-flex-regexp
+ Searches for characters in the given order, with anything in
+ between.
+
+Search matches are distinguished by the ‘company-tooltip-search’ and
+‘company-tooltip-search-selection’ faces.
+
+
+
+
+File: company.info, Node: Filter Candidates, Next: Quick Access a Candidate, Prev: Candidates Search, Up: Frontends
+
+4.5 Filter Candidates
+=====================
+
+Candidates filtering is started by typing the default key binding
+‘C-M-s’. Filtering acts on a par with the search (*note Candidates
+Search::), indicating its activation by the text ‘Filter: CHARACTERS’ in
+the mode line and influencing the displayed candidates. The difference
+is that the filtering, as its name suggests, keeps displaying only the
+matching candidates (in addition to distinguishing the matches with a
+face).
+
+To quit the filtering, hit ‘C-g’. To toggle between search and filter
+states, use key binding ‘C-o’.
+
+
+
+
+File: company.info, Node: Quick Access a Candidate, Prev: Filter Candidates, Up: Frontends
+
+4.6 Quick Access a Candidate
+============================
+
+Company provides a way to choose a candidate for completion without
+having to navigate to that candidate: by hitting one of the quick-access
+keys. By default, quick-access key bindings utilize a modifier <META>
+and one of the digits, such that pressing ‘M-1’ completes with the first
+candidate on the list and ‘M-0’ with the tenth candidate.
+
+If ‘company-show-quick-access’ is enabled, _tooltip-_ and _echo-_
+frontends show quick-access hints.
+
+ (setq company-show-quick-access 'left)
+
+
+
+
+
+
+
+
+
+To customize the key bindings, either do it via Customization Interface
+(*note Customization Interface::) or use the following approach:
+
+ (custom-set-variables
+ '(company-quick-access-keys '("a" "o" "e" "u" "i"))
+ '(company-quick-access-modifier 'super))
+
+A modifier should be one of ‘meta’, ‘super’, ‘hyper’, ‘ control’.
+
+The following example applies a bit of customization and demonstrates
+how to change quick-access hints faces.
+
+ (setq company-show-quick-access t)
+
+ (custom-set-faces
+ '(company-tooltip-quick-access ((t (:foreground "pink1"))))
+ '(company-tooltip-quick-access-selection
+ ((t (:foreground "pink1" :slant italic)))))
+
+
+
+
+File: company.info, Node: Backends, Next: Troubleshooting, Prev: Frontends, Up: Top
+
+5 Backends
+**********
+
+We can metaphorically say that each backend is like an engine. (The
+reality is even better since backends are just functions.) Fueling such
+an engine with a command causes the production of material for Company
+to move further on. Typically, moving on means outputting that material
+to a user via one or several configured frontends, *note Frontends::.
+
+Just like Company provides a preconfigured list of the enabled
+frontends, it also defines a list of the backends to rely on by default.
+This list is stored in the user option ‘company-backends’. The
+docstring of this variable has been a source of valuable information for
+years. That’s why we’re going to stick to a tradition and suggest
+reading the output of ‘C-h v company-backends’ for insightful details
+about backends. Nevertheless, the fundamental concepts are described in
+this user manual too.
+
+* Menu:
+
+* Backends Usage Basics::
+* Grouped Backends::
+* Package Backends::
+* Candidates Post-Processing::
+
+
+File: company.info, Node: Backends Usage Basics, Next: Grouped Backends, Up: Backends
+
+5.1 Backends Usage Basics
+=========================
+
+One of the significant concepts to understand about Company is that the
+package relies on one backend at a time (1). The backends are invoked
+one by one, in the sequential order of the items on the
+‘company-backends’ list.
+
+The name of the currently active backend is shown in the mode line and
+in the output of the command ‘M-x company-diag’.
+
+In most cases (mainly to exclude false-positive results), the next
+backend is not invoked automatically. For the purpose of invoking the
+next backend, use the command ‘company-other-backend’: either by calling
+it with ‘M-x’ or by binding the command to the keys of your choice, such
+as:
+
+ (global-set-key (kbd "C-c C-/") #'company-other-backend)
+
+It is also possible to specifically start a backend with the command
+‘M-x company-begin-backend’ or by calling a backend by its name, for
+instance: ‘M-x company-capf’. As usual for Emacs, such backends calls
+can be assigned to key bindings, for example:
+
+ (global-set-key (kbd "C-c y") 'company-yasnippet)
+
+ ---------- Footnotes ----------
+
+ (1) The grouped backends act as one complex backend. *Note Grouped
+Backends::.
+
+
+File: company.info, Node: Grouped Backends, Next: Package Backends, Prev: Backends Usage Basics, Up: Backends
+
+5.2 Grouped Backends
+====================
+
+In many cases, it can be desirable to receive candidates from several
+backends simultaneously. This can be achieved by configuring “grouped
+backends”: a sub-list of backends in the ‘company-backends’ list, that
+is handled specifically by Company.
+
+The most important part of this handling is the merge of the completion
+candidates from the grouped backends. (But only from the backends that
+return the same _prefix_ value, see ‘C-h v company-backends’ for more
+details.)
+
+To keep the candidates organized in accordance with the grouped backends
+order, add the keyword ‘:separate’ to the list of the grouped backends.
+The following example illustrates this.
+
+ (defun my-text-mode-hook ()
+ (setq-local company-backends
+ '((company-dabbrev company-ispell :separate)
+ company-files)))
+
+ (add-hook 'text-mode-hook #'my-text-mode-hook)
+
+Another keyword ‘:with’ helps to make sure the results from major/minor
+mode agnostic backends (such as _company-yasnippet_,
+_company-dabbrev-code_) are returned without preventing results from
+context-aware backends (such as _company-capf_ or _company-clang_). For
+this feature to work, put backends dependent on a mode at the beginning
+of the grouped backends list, then put a keyword ‘:with’, and only then
+put context agnostic backend(s), as shown in the following concise
+example:
+
+ (setq company-backends '((company-capf :with company-yasnippet)))
+
+
+File: company.info, Node: Package Backends, Next: Candidates Post-Processing, Prev: Grouped Backends, Up: Backends
+
+5.3 Package Backends
+====================
+
+The following sections give a short overview of the commonly used
+backends bundled with Company. Each section is devoted to one of the
+roughly outlined groups of the backends.
+
+Some of the backends expose user options for customization; a few of
+these options are introduced below. For those who would like to fetch
+the full list of a backend’s user options, we suggest doing one of the
+following:
+
+ • Execute command ‘M-x customize-group <RET> <backend-name>’.
+
+ • Open the source file of the backend and run
+ ‘M-x occur <RET> ^(defcustom’.
+
+ − Optionally, search for the matches with
+ ‘M-x isearch <RET> (defcustom’.
+
+* Menu:
+
+* Code Completion::
+* Text Completion::
+* File Name Completion::
+* Template Expansion::
+
+
+File: company.info, Node: Code Completion, Next: Text Completion, Up: Package Backends
+
+5.3.1 Code Completion
+---------------------
+
+ -- Function: company-capf
+ In the Emacs’s world, the current tendency is to have the
+ completion logic provided by ‘completion-at-point-functions’ (CAPF)
+ implementations. [Among the other things, this is what the popular
+ packages that support language server protocol (LSP) also rely on.]
+
+ Since _company-capf_ works as a bridge to the standard CAPF
+ facility, it is probably the most often used and recommended
+ backend nowadays, including for Emacs Lisp coding.
+
+ Just to illustrate, the following minimal backends setup
+
+ (setq company-backends '((company-capf company-dabbrev-code)))
+
+ might cover a large number of basic use cases, especially so in
+ major modes that have CAPF support implemented.
+
+ For more details on CAPF, *note (elisp)Completion in Buffers::.
+
+ -- Function: company-dabbrev-code
+ This backend works similarly to the built-in Emacs package
+ _dabbrev_, searching for completion candidates inside the contents
+ of the open buffer(s). Internally, its based on the backend
+ _company-dabbrev_ (*note Text Completion::).
+
+ -- Function: company-keywords
+ This backend provides completions for many of the widely spread
+ programming languages _keywords_: words bearing specific meaning in
+ a language.
+
+ -- Function: company-clang
+ As the name suggests, use this backend to get completions from
+ _Clang_ compiler; that is, for the languages in the _C_ language
+ family: _C_, _C++_, _Objective-C_.
+
+ -- Function: company-semantic
+ This backend relies on a built-in Emacs package that provides
+ language-aware editing commands based on source code parsers, *note
+ (emacs)Semantic::. Having enabled _semantic-mode_ makes it to be
+ used by the CAPF mechanism (*note (emacs)Symbol Completion::),
+ hence a user may consider enabling _company-capf_ backend instead.
+
+ -- Function: company-etags
+ This backend works on top of a built-in Emacs package _etags_,
+ *note (emacs)Tags Tables::. Similarly to aforementioned _Semantic_
+ usage, tags-based completions now are a part of the Emacs’ CAPF
+ facility, therefore a user may consider switching to _company-capf_
+ backend.
+
+
+File: company.info, Node: Text Completion, Next: File Name Completion, Prev: Code Completion, Up: Package Backends
+
+5.3.2 Text Completion
+---------------------
+
+ -- Function: company-dabbrev
+ This backend works similarly to the built-in Emacs package
+ _dabbrev_, searching for completion candidates inside the contents
+ of the open buffer(s). It is one of the often used backends, and
+ it has several interesting options for configuration. Let’s review
+ a few of them.
+
+ -- User Option: company-dabbrev-minimum-length
+ This option sets the minimum length of a completion candidate
+ to collect from the text. The default value of ‘4’ is
+ intended to prevent potential performance issues. But in many
+ scenarios, it may be acceptable to lower this value. Note
+ that this option also affects the behavior of the
+ _company-dabbrev-code_ backend.
+
+ (setq company-dabbrev-minimum-length 2)
+
+ -- User Option: company-dabbrev-other-buffers
+ By default, _company-dabbrev_ collects completion candidates
+ from all not ignored buffers (see more on that below). This
+ behavior can be changed to collecting candidates from the
+ current buffer only (by setting the value to ‘nil’) or from
+ the buffers with the same major mode:
+
+ (setq company-dabbrev-other-buffers t)
+
+ -- User Option: company-dabbrev-ignore-buffers
+ The value of this option should be a regexp or a predicate
+ function that can be used to match a buffer name. The matched
+ buffers are omitted from the search for completion candidates.
+
+ The last two options described here relate to handling uppercase
+ and lowercase letters in completion candidates. The illustrative
+ examples given below can be reproduced in the ‘*scratch*’ buffer,
+ with the word ‘Enjoy’ typed in, and with this initial setup:
+
+ (setq-local company-backends '(company-dabbrev)
+ company-dabbrev-other-buffers nil
+ company-dabbrev-ignore-case nil
+ company-dabbrev-downcase nil)
+
+ -- User Option: company-dabbrev-ignore-case
+ This user option controls whether the case is ignored when
+ collecting completion candidates. When the option is set to
+ ‘nil’, ‘Enjoy’ is suggested as a completion candidate for the
+ typed ‘Enj’ letters, but not for ‘enj’. When the option is
+ set to ‘t’, ‘Enjoy’ is suggested as a candidate for both ‘Enj’
+ and ‘enj’ input; note that ‘enj’ prefix is “overwritten” by
+ completing with the ‘Enjoy’ candidate. The third, default,
+ type of behavior solves this issue, keeping the case of the
+ typed prefix (and still collecting candidates
+ case-insensitively):
+
+ (setq company-dabbrev-ignore-case 'keep-prefix)
+
+ Now we can type ‘enj’, complete it with the suggested ‘Enjoy’,
+ and _enjoy_ the result.
+
+ -- User Option: company-dabbrev-downcase
+ This user option controls whether completion candidates are
+ down-cased before their display. When the option is set to
+ ‘nil’, no transformation is performed; in the environment
+ described above, typing ‘Enj’ results in the candidate ‘Enjoy’
+ being suggested. When the option is set to ‘t’, the
+ down-cased candidate ‘enjoy’ is suggested. By default, this
+ option is set to ‘case-replace’, meaning taking a value of the
+ Emacs’s variable ‘case-replace’ (‘t’ is the current default).
+
+
+ -- Function: company-ispell
+ This backend returns completion candidates collected by _Ispell_, a
+ built-in Emacs package that performs spell-checking. *Note
+ Checking and Correcting Spelling: (emacs)Spelling. Note that
+ _Ispell_ uses only one dictionary at a time (combining several
+ dictionaries into one file is an accepted practice). By default,
+ _company-ispell_ suggests candidates from a dictionary specified by
+ the Emacs’s setting ‘ispell-complete-word-dict’.
+
+ -- User Option: company-ispell-dictionary
+ Optionally, set a file path for _company-ispell_ to use
+ another dictionary.
+
+
+File: company.info, Node: File Name Completion, Next: Template Expansion, Prev: Text Completion, Up: Package Backends
+
+5.3.3 File Name Completion
+--------------------------
+
+ -- Function: company-files
+ This backend can be used to retrieve completion candidates for the
+ absolute and relative paths in the directory structure of an
+ operating system. The behavior of the _company-files_ backend can
+ be adjusted with the two user options.
+
+ -- User Option: company-files-exclusions
+ It may be desirable to exclude directories or files from the
+ list of suggested completion candidates. For example,
+ someone’s setup might look this way:
+
+ (setq company-files-exclusions '(".git/" ".DS_Store"))
+
+ -- User Option: company-files-chop-trailing-slash
+ This setting is enabled by default, which results in stripping
+ off a trailing slash from an inserted directory name. On
+ typing a trailing slash, the process of completion gets
+ started again, from inside the just inserted directory.
+
+ Setting ‘company-files-chop-trailing-slash’ to ‘nil’ makes
+ directory names to be inserted as is, with a trailing slash.
+ In this case, the completion process can be continued, for
+ example, either by explicitly calling _company-files_ backend
+ (*note Backends Usage Basics::) or by starting typing a name
+ of a file/directory known to be located under the inserted
+ directory.
+
+
+File: company.info, Node: Template Expansion, Prev: File Name Completion, Up: Package Backends
+
+5.3.4 Template Expansion
+------------------------
+
+ -- Function: company-abbrev
+ This is a completion backend for a built-in word abbreviation mode
+ (*note (emacs)Abbrevs::), that allows completing abbreviations with
+ their expansions.
+
+ -- Function: company-tempo
+ A backend for users of Tempo
+ (https://www.lysator.liu.se/~davidk/elisp/), one more built-in
+ Emacs package for creating and inserting (expanding) templates.
+
+ -- Function: company-yasnippet
+ Used as a completion backend for the popular third-party template
+ system YASnippet (https://github.com/joaotavora/yasnippet).
+
+
+File: company.info, Node: Candidates Post-Processing, Prev: Package Backends, Up: Backends
+
+5.4 Candidates Post-Processing
+==============================
+
+A list of completion candidates, supplied by a backend, can be
+additionally manipulated (reorganized, reduced, sorted, etc) before its
+output. This is done by adding a processing function name to the user
+option ‘company-transformers’ list, for example:
+
+ (setq company-transformers '(delete-consecutive-dups
+ company-sort-by-occurrence))
+
+Company is bundled with several such transformer functions. They are
+listed below.
+
+ -- Function: company-sort-by-occurrence
+ Sorts candidates using ‘company-occurrence-weight-function’
+ algorithm.
+
+ -- User Option: company-occurrence-weight-function
+ Can be set to one of ‘company-occurrence-prefer-closest-above’
+ (default) or ‘company-occurrence-prefer-any-closest’. This user
+ option defines the behavior of the ‘company-sort-by-occurrence’
+ transformer function.
+
+ -- Function: company-sort-by-backend-importance
+ Sorts candidates as two priority groups, differentiated by the
+ keyword ‘:with’ (*note Grouped Backends::). Backends positioned in
+ the backends list before the keyword ‘:with’ are treated as more
+ important.
+
+ -- Function: company-sort-prefer-same-case-prefix
+ Gives preference to the candidates that match the prefix
+ case-insensitively.
+
+
+File: company.info, Node: Troubleshooting, Next: Index, Prev: Backends, Up: Top
+
+6 Troubleshooting
+*****************
+
+If something goes wrong, the first thing we recommend doing is to
+execute command ‘M-x company-diag’ and thoroughly study its output.
+
+This command outputs important details about the internal workings of
+Company at the moment of the ‘company-diag’ command execution, including
+a responsible backend and a list of completion candidates provided by
+it.
+
+Based on the value of the ‘Used backend’ in the output of the command
+‘M-x company-diag’, these possible actions may follow:
+
+ • If the used backend does not belong to the Company package, report
+ the issue to the corresponding third-party package maintainer(s).
+
+ • If the used backend is ‘company-capf’, then take a look at the line
+ starting with ‘Value of c-a-p-f:’. The issue could have been
+ caused by a function listed there. To identify to which package it
+ belongs, type ‘M-x find-function <RET> <function-name> <RET>’.
+
+If the aforementioned steps didn’t help to find the cause of the issue,
+then file a bug report to
+the Company Issue Tracker (https://github.com/company-mode/company-mode/issues),
+attaching the following information:
+
+ 1. Output of the ‘M-x company-diag’.
+
+ 2. The exact error message: you can find it in the ‘*Messages*’
+ buffer.
+
+ 3. The steps to reproduce the behavior. Ideally, if you can, starting
+ with a bare Emacs session: ‘emacs -Q’.
+
+ 4. The backtrace of the error, which you can get by running the
+ command: ‘M-x toggle-debug-on-error’ before reproducing the error.
+
+
+File: company.info, Node: Index, Prev: Troubleshooting, Up: Top
+
+Index
+*****
+
+* Menu:
+
+* Key Index::
+* Variable Index::
+* Function Index::
+* Concept Index::
+
+
+File: company.info, Node: Key Index, Next: Variable Index, Up: Index
+
+Key Index
+=========
+
+
+* Menu:
+
+* C-g: Usage Basics. (line 20)
+* C-g <1>: Commands. (line 30)
+* C-g <2>: Candidates Search. (line 11)
+* C-g <3>: Filter Candidates. (line 14)
+* C-h: Commands. (line 34)
+* C-M-s: Filter Candidates. (line 6)
+* C-n: Usage Basics. (line 12)
+* C-n <1>: Commands. (line 11)
+* C-o: Filter Candidates. (line 14)
+* C-p: Usage Basics. (line 12)
+* C-p <1>: Commands. (line 16)
+* C-s: Candidates Search. (line 6)
+* C-w: Commands. (line 39)
+* M-<digit>: Quick Access a Candidate.
+ (line 6)
+* RET: Usage Basics. (line 15)
+* RET <1>: Commands. (line 21)
+* TAB: Usage Basics. (line 17)
+* TAB <1>: Commands. (line 25)
+
+
+File: company.info, Node: Variable Index, Next: Function Index, Prev: Key Index, Up: Index
+
+Variable Index
+==============
+
+
+* Menu:
+
+* company-after-completion-hook: Configuration File. (line 94)
+* company-backends: Backends. (line 12)
+* company-backends <1>: Backends Usage Basics.
+ (line 6)
+* company-backends <2>: Grouped Backends. (line 6)
+* company-completion-cancelled-hook: Configuration File. (line 90)
+* company-completion-finished-hook: Configuration File. (line 92)
+* company-completion-started-hook: Configuration File. (line 88)
+* company-dabbrev-downcase: Text Completion. (line 64)
+* company-dabbrev-ignore-buffers: Text Completion. (line 32)
+* company-dabbrev-ignore-case: Text Completion. (line 47)
+* company-dabbrev-minimum-length: Text Completion. (line 13)
+* company-dabbrev-other-buffers: Text Completion. (line 23)
+* company-dot-icons-format: Tooltip Frontends. (line 179)
+* company-echo-truncate-lines: Echo Frontends. (line 33)
+* company-files-chop-trailing-slash: File Name Completion.
+ (line 19)
+* company-files-exclusions: File Name Completion.
+ (line 12)
+* company-format-margin-function: Tooltip Frontends. (line 153)
+* company-frontends: Frontends. (line 6)
+* company-global-modes: Configuration File. (line 31)
+* company-icon-margin: Tooltip Frontends. (line 164)
+* company-icon-size: Tooltip Frontends. (line 164)
+* company-idle-delay: Configuration File. (line 17)
+* company-insertion-on-trigger: Configuration File. (line 64)
+* company-insertion-triggers: Configuration File. (line 72)
+* company-ispell-dictionary: Text Completion. (line 84)
+* company-lighter-base: Configuration File. (line 59)
+* company-minimum-prefix-length: Configuration File. (line 9)
+* company-mode: Initial Setup. (line 6)
+* company-occurrence-weight-function: Candidates Post-Processing.
+ (line 21)
+* company-require-match: Configuration File. (line 51)
+* company-search-regexp-function: Candidates Search. (line 13)
+* company-selection-wrap-around: Configuration File. (line 43)
+* company-show-quick-access: Quick Access a Candidate.
+ (line 14)
+* company-text-face-extra-attributes: Tooltip Frontends. (line 192)
+* company-text-icons-add-background: Tooltip Frontends. (line 200)
+* company-text-icons-format: Tooltip Frontends. (line 171)
+* company-text-icons-mapping: Tooltip Frontends. (line 188)
+* company-tooltip-align-annotations: Tooltip Frontends. (line 52)
+* company-tooltip-flip-when-above: Tooltip Frontends. (line 99)
+* company-tooltip-idle-delay: Tooltip Frontends. (line 22)
+* company-tooltip-limit: Tooltip Frontends. (line 64)
+* company-tooltip-margin: Tooltip Frontends. (line 133)
+* company-tooltip-maximum-width: Tooltip Frontends. (line 126)
+* company-tooltip-minimum: Tooltip Frontends. (line 84)
+* company-tooltip-minimum-width: Tooltip Frontends. (line 111)
+* company-tooltip-offset-display: Tooltip Frontends. (line 74)
+* company-tooltip-width-grow-only: Tooltip Frontends. (line 121)
+* company-transformers: Candidates Post-Processing.
+ (line 6)
+
+
+File: company.info, Node: Function Index, Next: Concept Index, Prev: Variable Index, Up: Index
+
+Function Index
+==============
+
+
+* Menu:
+
+* company-abbrev: Template Expansion. (line 6)
+* company-abort: Commands. (line 30)
+* company-begin-backend: Backends Usage Basics.
+ (line 23)
+* company-capf: Code Completion. (line 6)
+* company-clang: Code Completion. (line 36)
+* company-complete: Usage Basics. (line 10)
+* company-complete-common: Commands. (line 25)
+* company-complete-selection: Commands. (line 21)
+* company-dabbrev: Text Completion. (line 6)
+* company-dabbrev-code: Code Completion. (line 25)
+* company-detect-icons-margin: Tooltip Frontends. (line 209)
+* company-diag: Backends Usage Basics.
+ (line 11)
+* company-diag <1>: Troubleshooting. (line 6)
+* company-dot-icons-margin: Tooltip Frontends. (line 178)
+* company-echo-frontend: Echo Frontends. (line 21)
+* company-echo-metadata-frontend: Echo Frontends. (line 9)
+* company-echo-strip-common-frontend: Echo Frontends. (line 27)
+* company-etags: Code Completion. (line 48)
+* company-files: File Name Completion.
+ (line 6)
+* company-ispell: Text Completion. (line 75)
+* company-keywords: Code Completion. (line 31)
+* company-mode: Initial Setup. (line 6)
+* company-other-backend: Backends Usage Basics.
+ (line 14)
+* company-preview-common-frontend: Preview Frontends. (line 21)
+* company-preview-frontend: Preview Frontends. (line 17)
+* company-preview-if-just-one-frontend: Preview Frontends. (line 10)
+* company-pseudo-tooltip-frontend: Tooltip Frontends. (line 17)
+* company-pseudo-tooltip-unless-just-one-frontend: Tooltip Frontends.
+ (line 11)
+* company-pseudo-tooltip-unless-just-one-frontend-with-delay: Tooltip Frontends.
+ (line 21)
+* company-search-flex-regexp: Candidates Search. (line 26)
+* company-search-words-in-any-order-regexp: Candidates Search.
+ (line 23)
+* company-search-words-regexp: Candidates Search. (line 20)
+* company-select-next: Commands. (line 11)
+* company-select-next-or-abort: Commands. (line 11)
+* company-select-previous: Commands. (line 16)
+* company-select-previous-or-abort: Commands. (line 16)
+* company-semantic: Code Completion. (line 41)
+* company-show-doc-buffer: Commands. (line 34)
+* company-show-location: Commands. (line 39)
+* company-sort-by-backend-importance: Candidates Post-Processing.
+ (line 28)
+* company-sort-by-occurrence: Candidates Post-Processing.
+ (line 17)
+* company-sort-prefer-same-case-prefix: Candidates Post-Processing.
+ (line 34)
+* company-tempo: Template Expansion. (line 11)
+* company-text-icons-margin: Tooltip Frontends. (line 170)
+* company-tng-frontend: Structure. (line 26)
+* company-tng-mode: Structure. (line 26)
+* company-vscode-dark-icons-margin: Tooltip Frontends. (line 162)
+* company-vscode-light-icons-margin: Tooltip Frontends. (line 163)
+* company-yasnippet: Template Expansion. (line 16)
+* global-company-mode: Initial Setup. (line 18)
+
+
+File: company.info, Node: Concept Index, Prev: Function Index, Up: Index
+
+Concept Index
+=============
+
+
+* Menu:
+
+* abbrev: Template Expansion. (line 6)
+* abort: Usage Basics. (line 20)
+* abort <1>: Commands. (line 30)
+* activate: Initial Setup. (line 8)
+* active backend: Backends Usage Basics.
+ (line 11)
+* active backend <1>: Troubleshooting. (line 15)
+* annotation: Tooltip Frontends. (line 53)
+* auto-start: Initial Setup. (line 13)
+* backend: Structure. (line 6)
+* backend <1>: Structure. (line 10)
+* backend <2>: Backends Usage Basics.
+ (line 11)
+* backend <3>: Backends Usage Basics.
+ (line 14)
+* backend <4>: Troubleshooting. (line 15)
+* backends: Backends. (line 6)
+* backends <1>: Backends Usage Basics.
+ (line 6)
+* backends <2>: Grouped Backends. (line 6)
+* backends <3>: Package Backends. (line 6)
+* basics: Usage Basics. (line 6)
+* bug: Troubleshooting. (line 6)
+* bug <1>: Troubleshooting. (line 27)
+* bundled backends: Package Backends. (line 6)
+* cancel: Usage Basics. (line 20)
+* cancel <1>: Commands. (line 30)
+* candidate: Terminology. (line 10)
+* candidate <1>: Usage Basics. (line 12)
+* candidate <2>: Usage Basics. (line 15)
+* candidate <3>: Preview Frontends. (line 6)
+* color: Tooltip Frontends. (line 219)
+* color <1>: Quick Access a Candidate.
+ (line 37)
+* common part: Usage Basics. (line 17)
+* common part <1>: Commands. (line 25)
+* common part <2>: Preview Frontends. (line 6)
+* company-echo: Echo Frontends. (line 6)
+* company-preview: Preview Frontends. (line 6)
+* company-tng: Structure. (line 26)
+* company-tooltip: Tooltip Frontends. (line 219)
+* company-tooltip-search: Candidates Search. (line 6)
+* complete: Terminology. (line 6)
+* complete <1>: Usage Basics. (line 12)
+* complete <2>: Usage Basics. (line 15)
+* complete <3>: Usage Basics. (line 17)
+* complete <4>: Commands. (line 21)
+* complete <5>: Preview Frontends. (line 6)
+* completion: Terminology. (line 6)
+* completion <1>: Usage Basics. (line 12)
+* completion <2>: Usage Basics. (line 15)
+* completion <3>: Usage Basics. (line 17)
+* configure: Customization. (line 6)
+* configure <1>: Customization Interface.
+ (line 6)
+* configure <2>: Configuration File. (line 6)
+* configure <3>: Tooltip Frontends. (line 49)
+* configure <4>: Tooltip Frontends. (line 219)
+* configure <5>: Preview Frontends. (line 25)
+* configure <6>: Echo Frontends. (line 38)
+* configure <7>: Candidates Search. (line 30)
+* configure <8>: Quick Access a Candidate.
+ (line 28)
+* configure <9>: Quick Access a Candidate.
+ (line 37)
+* custom: Customization. (line 6)
+* custom <1>: Customization Interface.
+ (line 6)
+* custom <2>: Configuration File. (line 6)
+* custom <3>: Tooltip Frontends. (line 49)
+* custom <4>: Tooltip Frontends. (line 219)
+* custom <5>: Preview Frontends. (line 25)
+* custom <6>: Echo Frontends. (line 38)
+* custom <7>: Candidates Search. (line 30)
+* custom <8>: Quick Access a Candidate.
+ (line 28)
+* custom <9>: Quick Access a Candidate.
+ (line 37)
+* definition: Commands. (line 39)
+* distribution: Installation. (line 6)
+* doc: Commands. (line 34)
+* duplicate: Candidates Post-Processing.
+ (line 6)
+* echo: Echo Frontends. (line 6)
+* enable: Initial Setup. (line 8)
+* error: Troubleshooting. (line 6)
+* error <1>: Troubleshooting. (line 27)
+* expansion: Template Expansion. (line 6)
+* extensible: Structure. (line 6)
+* face: Tooltip Frontends. (line 219)
+* face <1>: Preview Frontends. (line 6)
+* face <2>: Preview Frontends. (line 25)
+* face <3>: Echo Frontends. (line 6)
+* face <4>: Echo Frontends. (line 38)
+* face <5>: Candidates Search. (line 6)
+* face <6>: Candidates Search. (line 30)
+* face <7>: Filter Candidates. (line 6)
+* face <8>: Quick Access a Candidate.
+ (line 37)
+* filter: Filter Candidates. (line 6)
+* finish: Usage Basics. (line 20)
+* finish <1>: Commands. (line 30)
+* font: Tooltip Frontends. (line 219)
+* font <1>: Quick Access a Candidate.
+ (line 37)
+* frontend: Structure. (line 6)
+* frontend <1>: Structure. (line 10)
+* frontends: Frontends. (line 6)
+* grouped backends: Grouped Backends. (line 6)
+* icon: Tooltip Frontends. (line 145)
+* install: Installation. (line 6)
+* interface: Tooltip Frontends. (line 49)
+* interface <1>: Tooltip Frontends. (line 219)
+* interface <2>: Preview Frontends. (line 25)
+* interface <3>: Echo Frontends. (line 38)
+* interface <4>: Candidates Search. (line 30)
+* interface <5>: Quick Access a Candidate.
+ (line 37)
+* intro: Initial Setup. (line 6)
+* issue: Troubleshooting. (line 6)
+* issue tracker: Troubleshooting. (line 27)
+* kind: Tooltip Frontends. (line 145)
+* location: Commands. (line 39)
+* manual: Initial Setup. (line 8)
+* manual <1>: Usage Basics. (line 10)
+* margin: Tooltip Frontends. (line 134)
+* margin <1>: Tooltip Frontends. (line 154)
+* minor-mode: Initial Setup. (line 6)
+* module: Structure. (line 6)
+* module <1>: Structure. (line 10)
+* navigate: Usage Basics. (line 12)
+* next backend: Backends Usage Basics.
+ (line 14)
+* non-prefix matches: Terminology. (line 10)
+* package: Installation. (line 6)
+* package backends: Package Backends. (line 6)
+* pluggable: Structure. (line 6)
+* pop-up: Tooltip Frontends. (line 6)
+* prefix matches: Terminology. (line 10)
+* preview: Preview Frontends. (line 6)
+* quick start: Initial Setup. (line 6)
+* quick-access: Quick Access a Candidate.
+ (line 6)
+* quit: Usage Basics. (line 20)
+* quit <1>: Commands. (line 30)
+* search: Candidates Search. (line 6)
+* select: Usage Basics. (line 12)
+* select <1>: Commands. (line 11)
+* select <2>: Commands. (line 16)
+* snippet: Template Expansion. (line 6)
+* sort: Candidates Post-Processing.
+ (line 6)
+* stop: Usage Basics. (line 20)
+* stop <1>: Commands. (line 30)
+* TAB: Structure. (line 26)
+* Tab and Go: Structure. (line 26)
+* template: Template Expansion. (line 6)
+* third-party: Structure. (line 10)
+* third-party <1>: Troubleshooting. (line 18)
+* tooltip: Tooltip Frontends. (line 6)
+* troubleshoot: Troubleshooting. (line 6)
+* usage: Usage Basics. (line 6)
+
+
+
+Tag Table:
+Node: Top572
+Node: Overview2000
+Node: Terminology2408
+Ref: Terminology-Footnote-13395
+Node: Structure3601
+Node: Getting Started5097
+Node: Installation5375
+Node: Initial Setup5758
+Node: Usage Basics6604
+Node: Commands7367
+Ref: Commands-Footnote-19585
+Node: Customization9752
+Node: Customization Interface10224
+Node: Configuration File10757
+Node: Frontends15423
+Node: Tooltip Frontends16392
+Ref: Tooltip Frontends-Footnote-126761
+Node: Preview Frontends26998
+Ref: Preview Frontends-Footnote-128254
+Node: Echo Frontends28381
+Node: Candidates Search29914
+Node: Filter Candidates31248
+Node: Quick Access a Candidate32028
+Node: Backends33646
+Node: Backends Usage Basics34744
+Ref: Backends Usage Basics-Footnote-135959
+Node: Grouped Backends36043
+Node: Package Backends37672
+Node: Code Completion38601
+Node: Text Completion40970
+Node: File Name Completion45404
+Node: Template Expansion46952
+Node: Candidates Post-Processing47671
+Node: Troubleshooting49148
+Node: Index50821
+Node: Key Index50984
+Node: Variable Index52483
+Node: Function Index56533
+Node: Concept Index61014
+
+End Tag Table
+
+
+Local Variables:
+coding: utf-8
+End:
diff --git a/elpa/company-20220326.48/dir b/elpa/company-20220326.48/dir
new file mode 100644
index 0000000..a7ea2be
--- /dev/null
+++ b/elpa/company-20220326.48/dir
@@ -0,0 +1,18 @@
+This is the file .../info/dir, which contains the
+topmost node of the Info hierarchy, called (dir)Top.
+The first time you invoke Info you start off looking at this node.
+
+File: dir, Node: Top This is the top of the INFO tree
+
+ This (the Directory node) gives a menu of major topics.
+ Typing "q" exits, "H" lists all Info commands, "d" returns here,
+ "h" gives a primer for first-timers,
+ "mEmacs<Return>" visits the Emacs manual, etc.
+
+ In Emacs, you can click mouse button 2 on a menu item or cross reference
+ to select it.
+
+* Menu:
+
+Emacs misc features
+* Company: (company). A modular text completion framework.
diff --git a/elpa/company-20220326.48/icons/LICENSE b/elpa/company-20220326.48/icons/LICENSE
new file mode 100644
index 0000000..52bd145
--- /dev/null
+++ b/elpa/company-20220326.48/icons/LICENSE
@@ -0,0 +1,395 @@
+Attribution 4.0 International
+
+=======================================================================
+
+Creative Commons Corporation ("Creative Commons") is not a law firm and
+does not provide legal services or legal advice. Distribution of
+Creative Commons public licenses does not create a lawyer-client or
+other relationship. Creative Commons makes its licenses and related
+information available on an "as-is" basis. Creative Commons gives no
+warranties regarding its licenses, any material licensed under their
+terms and conditions, or any related information. Creative Commons
+disclaims all liability for damages resulting from their use to the
+fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and
+conditions that creators and other rights holders may use to share
+original works of authorship and other material subject to copyright
+and certain other rights specified in the public license below. The
+following considerations are for informational purposes only, are not
+exhaustive, and do not form part of our licenses.
+
+ Considerations for licensors: Our public licenses are
+ intended for use by those authorized to give the public
+ permission to use material in ways otherwise restricted by
+ copyright and certain other rights. Our licenses are
+ irrevocable. Licensors should read and understand the terms
+ and conditions of the license they choose before applying it.
+ Licensors should also secure all rights necessary before
+ applying our licenses so that the public can reuse the
+ material as expected. Licensors should clearly mark any
+ material not subject to the license. This includes other CC-
+ licensed material, or material used under an exception or
+ limitation to copyright. More considerations for licensors:
+ wiki.creativecommons.org/Considerations_for_licensors
+
+ Considerations for the public: By using one of our public
+ licenses, a licensor grants the public permission to use the
+ licensed material under specified terms and conditions. If
+ the licensor's permission is not necessary for any reason--for
+ example, because of any applicable exception or limitation to
+ copyright--then that use is not regulated by the license. Our
+ licenses grant only permissions under copyright and certain
+ other rights that a licensor has authority to grant. Use of
+ the licensed material may still be restricted for other
+ reasons, including because others have copyright or other
+ rights in the material. A licensor may make special requests,
+ such as asking that all changes be marked or described.
+ Although not required by our licenses, you are encouraged to
+ respect those requests where reasonable. More_considerations
+ for the public:
+ wiki.creativecommons.org/Considerations_for_licensees
+
+=======================================================================
+
+Creative Commons Attribution 4.0 International Public License
+
+By exercising the Licensed Rights (defined below), You accept and agree
+to be bound by the terms and conditions of this Creative Commons
+Attribution 4.0 International Public License ("Public License"). To the
+extent this Public License may be interpreted as a contract, You are
+granted the Licensed Rights in consideration of Your acceptance of
+these terms and conditions, and the Licensor grants You such rights in
+consideration of benefits the Licensor receives from making the
+Licensed Material available under these terms and conditions.
+
+
+Section 1 -- Definitions.
+
+ a. Adapted Material means material subject to Copyright and Similar
+ Rights that is derived from or based upon the Licensed Material
+ and in which the Licensed Material is translated, altered,
+ arranged, transformed, or otherwise modified in a manner requiring
+ permission under the Copyright and Similar Rights held by the
+ Licensor. For purposes of this Public License, where the Licensed
+ Material is a musical work, performance, or sound recording,
+ Adapted Material is always produced where the Licensed Material is
+ synched in timed relation with a moving image.
+
+ b. Adapter's License means the license You apply to Your Copyright
+ and Similar Rights in Your contributions to Adapted Material in
+ accordance with the terms and conditions of this Public License.
+
+ c. Copyright and Similar Rights means copyright and/or similar rights
+ closely related to copyright including, without limitation,
+ performance, broadcast, sound recording, and Sui Generis Database
+ Rights, without regard to how the rights are labeled or
+ categorized. For purposes of this Public License, the rights
+ specified in Section 2(b)(1)-(2) are not Copyright and Similar
+ Rights.
+
+ d. Effective Technological Measures means those measures that, in the
+ absence of proper authority, may not be circumvented under laws
+ fulfilling obligations under Article 11 of the WIPO Copyright
+ Treaty adopted on December 20, 1996, and/or similar international
+ agreements.
+
+ e. Exceptions and Limitations means fair use, fair dealing, and/or
+ any other exception or limitation to Copyright and Similar Rights
+ that applies to Your use of the Licensed Material.
+
+ f. Licensed Material means the artistic or literary work, database,
+ or other material to which the Licensor applied this Public
+ License.
+
+ g. Licensed Rights means the rights granted to You subject to the
+ terms and conditions of this Public License, which are limited to
+ all Copyright and Similar Rights that apply to Your use of the
+ Licensed Material and that the Licensor has authority to license.
+
+ h. Licensor means the individual(s) or entity(ies) granting rights
+ under this Public License.
+
+ i. Share means to provide material to the public by any means or
+ process that requires permission under the Licensed Rights, such
+ as reproduction, public display, public performance, distribution,
+ dissemination, communication, or importation, and to make material
+ available to the public including in ways that members of the
+ public may access the material from a place and at a time
+ individually chosen by them.
+
+ j. Sui Generis Database Rights means rights other than copyright
+ resulting from Directive 96/9/EC of the European Parliament and of
+ the Council of 11 March 1996 on the legal protection of databases,
+ as amended and/or succeeded, as well as other essentially
+ equivalent rights anywhere in the world.
+
+ k. You means the individual or entity exercising the Licensed Rights
+ under this Public License. Your has a corresponding meaning.
+
+
+Section 2 -- Scope.
+
+ a. License grant.
+
+ 1. Subject to the terms and conditions of this Public License,
+ the Licensor hereby grants You a worldwide, royalty-free,
+ non-sublicensable, non-exclusive, irrevocable license to
+ exercise the Licensed Rights in the Licensed Material to:
+
+ a. reproduce and Share the Licensed Material, in whole or
+ in part; and
+
+ b. produce, reproduce, and Share Adapted Material.
+
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
+ Exceptions and Limitations apply to Your use, this Public
+ License does not apply, and You do not need to comply with
+ its terms and conditions.
+
+ 3. Term. The term of this Public License is specified in Section
+ 6(a).
+
+ 4. Media and formats; technical modifications allowed. The
+ Licensor authorizes You to exercise the Licensed Rights in
+ all media and formats whether now known or hereafter created,
+ and to make technical modifications necessary to do so. The
+ Licensor waives and/or agrees not to assert any right or
+ authority to forbid You from making technical modifications
+ necessary to exercise the Licensed Rights, including
+ technical modifications necessary to circumvent Effective
+ Technological Measures. For purposes of this Public License,
+ simply making modifications authorized by this Section 2(a)
+ (4) never produces Adapted Material.
+
+ 5. Downstream recipients.
+
+ a. Offer from the Licensor -- Licensed Material. Every
+ recipient of the Licensed Material automatically
+ receives an offer from the Licensor to exercise the
+ Licensed Rights under the terms and conditions of this
+ Public License.
+
+ b. No downstream restrictions. You may not offer or impose
+ any additional or different terms or conditions on, or
+ apply any Effective Technological Measures to, the
+ Licensed Material if doing so restricts exercise of the
+ Licensed Rights by any recipient of the Licensed
+ Material.
+
+ 6. No endorsement. Nothing in this Public License constitutes or
+ may be construed as permission to assert or imply that You
+ are, or that Your use of the Licensed Material is, connected
+ with, or sponsored, endorsed, or granted official status by,
+ the Licensor or others designated to receive attribution as
+ provided in Section 3(a)(1)(A)(i).
+
+ b. Other rights.
+
+ 1. Moral rights, such as the right of integrity, are not
+ licensed under this Public License, nor are publicity,
+ privacy, and/or other similar personality rights; however, to
+ the extent possible, the Licensor waives and/or agrees not to
+ assert any such rights held by the Licensor to the limited
+ extent necessary to allow You to exercise the Licensed
+ Rights, but not otherwise.
+
+ 2. Patent and trademark rights are not licensed under this
+ Public License.
+
+ 3. To the extent possible, the Licensor waives any right to
+ collect royalties from You for the exercise of the Licensed
+ Rights, whether directly or through a collecting society
+ under any voluntary or waivable statutory or compulsory
+ licensing scheme. In all other cases the Licensor expressly
+ reserves any right to collect such royalties.
+
+
+Section 3 -- License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the
+following conditions.
+
+ a. Attribution.
+
+ 1. If You Share the Licensed Material (including in modified
+ form), You must:
+
+ a. retain the following if it is supplied by the Licensor
+ with the Licensed Material:
+
+ i. identification of the creator(s) of the Licensed
+ Material and any others designated to receive
+ attribution, in any reasonable manner requested by
+ the Licensor (including by pseudonym if
+ designated);
+
+ ii. a copyright notice;
+
+ iii. a notice that refers to this Public License;
+
+ iv. a notice that refers to the disclaimer of
+ warranties;
+
+ v. a URI or hyperlink to the Licensed Material to the
+ extent reasonably practicable;
+
+ b. indicate if You modified the Licensed Material and
+ retain an indication of any previous modifications; and
+
+ c. indicate the Licensed Material is licensed under this
+ Public License, and include the text of, or the URI or
+ hyperlink to, this Public License.
+
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
+ reasonable manner based on the medium, means, and context in
+ which You Share the Licensed Material. For example, it may be
+ reasonable to satisfy the conditions by providing a URI or
+ hyperlink to a resource that includes the required
+ information.
+
+ 3. If requested by the Licensor, You must remove any of the
+ information required by Section 3(a)(1)(A) to the extent
+ reasonably practicable.
+
+ 4. If You Share Adapted Material You produce, the Adapter's
+ License You apply must not prevent recipients of the Adapted
+ Material from complying with this Public License.
+
+
+Section 4 -- Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that
+apply to Your use of the Licensed Material:
+
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right
+ to extract, reuse, reproduce, and Share all or a substantial
+ portion of the contents of the database;
+
+ b. if You include all or a substantial portion of the database
+ contents in a database in which You have Sui Generis Database
+ Rights, then the database in which You have Sui Generis Database
+ Rights (but not its individual contents) is Adapted Material; and
+
+ c. You must comply with the conditions in Section 3(a) if You Share
+ all or a substantial portion of the contents of the database.
+
+For the avoidance of doubt, this Section 4 supplements and does not
+replace Your obligations under this Public License where the Licensed
+Rights include other Copyright and Similar Rights.
+
+
+Section 5 -- Disclaimer of Warranties and Limitation of Liability.
+
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
+
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
+
+ c. The disclaimer of warranties and limitation of liability provided
+ above shall be interpreted in a manner that, to the extent
+ possible, most closely approximates an absolute disclaimer and
+ waiver of all liability.
+
+
+Section 6 -- Term and Termination.
+
+ a. This Public License applies for the term of the Copyright and
+ Similar Rights licensed here. However, if You fail to comply with
+ this Public License, then Your rights under this Public License
+ terminate automatically.
+
+ b. Where Your right to use the Licensed Material has terminated under
+ Section 6(a), it reinstates:
+
+ 1. automatically as of the date the violation is cured, provided
+ it is cured within 30 days of Your discovery of the
+ violation; or
+
+ 2. upon express reinstatement by the Licensor.
+
+ For the avoidance of doubt, this Section 6(b) does not affect any
+ right the Licensor may have to seek remedies for Your violations
+ of this Public License.
+
+ c. For the avoidance of doubt, the Licensor may also offer the
+ Licensed Material under separate terms or conditions or stop
+ distributing the Licensed Material at any time; however, doing so
+ will not terminate this Public License.
+
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
+ License.
+
+
+Section 7 -- Other Terms and Conditions.
+
+ a. The Licensor shall not be bound by any additional or different
+ terms or conditions communicated by You unless expressly agreed.
+
+ b. Any arrangements, understandings, or agreements regarding the
+ Licensed Material not stated herein are separate from and
+ independent of the terms and conditions of this Public License.
+
+
+Section 8 -- Interpretation.
+
+ a. For the avoidance of doubt, this Public License does not, and
+ shall not be interpreted to, reduce, limit, restrict, or impose
+ conditions on any use of the Licensed Material that could lawfully
+ be made without permission under this Public License.
+
+ b. To the extent possible, if any provision of this Public License is
+ deemed unenforceable, it shall be automatically reformed to the
+ minimum extent necessary to make it enforceable. If the provision
+ cannot be reformed, it shall be severed from this Public License
+ without affecting the enforceability of the remaining terms and
+ conditions.
+
+ c. No term or condition of this Public License will be waived and no
+ failure to comply consented to unless expressly agreed to by the
+ Licensor.
+
+ d. Nothing in this Public License constitutes or may be interpreted
+ as a limitation upon, or waiver of, any privileges and immunities
+ that apply to the Licensor or You, including from the legal
+ processes of any jurisdiction or authority.
+
+
+=======================================================================
+
+Creative Commons is not a party to its public
+licenses. Notwithstanding, Creative Commons may elect to apply one of
+its public licenses to material it publishes and in those instances
+will be considered the “Licensor.” The text of the Creative Commons
+public licenses is dedicated to the public domain under the CC0 Public
+Domain Dedication. Except for the limited purpose of indicating that
+material is shared under a Creative Commons public license or as
+otherwise permitted by the Creative Commons policies published at
+creativecommons.org/policies, Creative Commons does not authorize the
+use of the trademark "Creative Commons" or any other trademark or logo
+of Creative Commons without its prior written consent including,
+without limitation, in connection with any unauthorized modifications
+to any of its public licenses or any other arrangements,
+understandings, or agreements concerning use of licensed material. For
+the avoidance of doubt, this paragraph does not form part of the
+public licenses.
+
+Creative Commons may be contacted at creativecommons.org. \ No newline at end of file
diff --git a/elpa/company-20220326.48/icons/attribution.md b/elpa/company-20220326.48/icons/attribution.md
new file mode 100644
index 0000000..33513fc
--- /dev/null
+++ b/elpa/company-20220326.48/icons/attribution.md
@@ -0,0 +1,5 @@
+The icons in this directory have been made by "Microsoft and any contributors",
+see the [development repository](https://github.com/microsoft/vscode-icons/).
+
+They are distributed under Creative Commons Attribution 4.0 International Public
+License, see the LICENSE file in this directory.
diff --git a/elpa/company-20220326.48/icons/vscode-dark/folder.svg b/elpa/company-20220326.48/icons/vscode-dark/folder.svg
new file mode 100644
index 0000000..7387525
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/folder.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M14.5 3H7.70996L6.85999 2.15002L6.51001 2H1.51001L1.01001 2.5V6.5V13.5L1.51001 14H14.51L15.01 13.5V9V3.5L14.5 3ZM13.99 11.49V13H1.98999V11.49V7.48999V7H6.47998L6.82996 6.84998L7.68994 5.98999H14V7.48999L13.99 11.49ZM13.99 5H7.48999L7.14001 5.15002L6.28003 6.01001H2V3.01001H6.29004L7.14001 3.85999L7.5 4.01001H14L13.99 5Z" fill="#C5C5C5"/>
+</svg> \ No newline at end of file
diff --git a/elpa/company-20220326.48/icons/vscode-dark/references.svg b/elpa/company-20220326.48/icons/vscode-dark/references.svg
new file mode 100644
index 0000000..9e4c78e
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/references.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M11.1052 4.5613L7.67505 7.98827L6.54072 6.86834L8.61098 4.78848H3.81131C3.17483 4.78848 2.56442 5.04132 2.11436 5.49138C1.6643 5.94144 1.41147 6.55184 1.41147 7.18832C1.41147 7.8248 1.6643 8.43521 2.11436 8.88527C2.56442 9.33532 3.17483 9.58816 3.81131 9.58816H4.70085V11.1881H3.8209C2.7921 11.142 1.8207 10.7009 1.10896 9.95661C0.397222 9.21231 0 8.22216 0 7.19232C0 6.16249 0.397222 5.17234 1.10896 4.42803C1.8207 3.68373 2.7921 3.24263 3.8209 3.19659H8.62058L6.54072 1.13112L7.67505 0L11.1052 3.43177V4.5613ZM16.6201 24H7.0207L6.22075 23.2V10.4121L7.0207 9.61215H16.6201L17.42 10.4121V23.2L16.6201 24ZM7.82064 22.4001H15.8201V11.212H7.82064V22.4001ZM13.4203 1.6015H23.0196L23.8196 2.40145V15.1878L23.0196 15.9877H19.0199V14.3878H22.2197V3.20139H14.2202V7.98828H12.6203V2.40145L13.4203 1.6015ZM14.2202 12.7879H9.42053V14.3878H14.2202V12.7879ZM9.42053 15.9877H14.2202V17.5876H9.42053V15.9877ZM14.2202 19.1875H9.42053V20.7874H14.2202V19.1875ZM15.8201 4.78848H20.6198V6.38838H15.8201V4.78848ZM20.6198 11.188H19.0199V12.7879H20.6198V11.188ZM17.2824 8.01228V7.98828H20.6198V9.58817H18.8583L17.2824 8.01228Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-array.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-array.svg
new file mode 100644
index 0000000..e92131d
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-array.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2L1 2.5V13.5L1.5 14H4V13H2V3H4V2H1.5ZM14.5 14L15 13.5L15 2.5L14.5 2H12V3L14 3L14 13H12V14H14.5Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-boolean.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-boolean.svg
new file mode 100644
index 0000000..e009568
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-boolean.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M1 3.5L1.5 3H14.5L15 3.5L15 12.5L14.5 13H1.5L1 12.5V3.5ZM14 4H8L8 7.49297L7.89793 7.49285L7.5 7.49225V7.49237L3.92614 7.48807L6.01638 5.39784L5.30927 4.69073L2.35356 7.64645L2.35356 8.35355L5.30927 11.3093L6.01638 10.6022L3.90228 8.48807L7.8976 8.49285L8 8.493V7.50702L11.9073 7.51222L9.79289 5.39784L10.5 4.69073L13.4557 7.64645V8.35355L10.5 11.3093L9.79289 10.6022L11.8828 8.51222L8 8.50702V12H14V4Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-class.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-class.svg
new file mode 100644
index 0000000..b35a6bb
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-class.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M11.34 9.70998H12.05L14.72 7.04005V6.32997L13.38 5.00001H12.68L10.86 6.81007H5.86V5.56007L7.71999 3.70997V3L5.71998 1H5.00001L1 5.00001V5.70997L3 7.70998H3.71003L4.84998 6.56007V12.35L5.34998 12.85H10V13.37L11.33 14.71H12.04L14.7101 12.0401V11.33L13.37 10H12.67L10.81 11.85H5.81001V7.84999H10V8.32997L11.34 9.70998ZM13.0301 6.06007L13.66 6.68995L11.66 8.68996L11.0301 8.06007L13.0301 6.06007ZM13.0301 11.0601L13.66 11.69L11.66 13.69L11.0301 13.0601L13.0301 11.0601ZM3.34998 6.65004L2.06 5.34998L5.34998 2.06006L6.65004 3.34998L3.34998 6.65004Z" fill="#EE9D28"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-color.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-color.svg
new file mode 100644
index 0000000..91469f9
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-color.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M8 1.00305C6.14348 1.00305 4.36299 1.74059 3.05023 3.05334C1.73748 4.3661 1 6.14654 1 8.00305V8.43311C1.09 9.94311 2.91 10.2231 4 9.13306C4.35648 8.81625 4.82054 8.64759 5.29724 8.66162C5.77395 8.67565 6.22729 8.87127 6.56451 9.2085C6.90174 9.54572 7.09736 9.99912 7.11139 10.4758C7.12542 10.9525 6.95682 11.4166 6.64001 11.7731C5.54001 12.9331 5.85 14.843 7.44 14.973H8.03998C9.89649 14.973 11.677 14.2356 12.9897 12.9229C14.3025 11.6101 15.04 9.82954 15.04 7.97302C15.04 6.11651 14.3025 4.33607 12.9897 3.02332C11.677 1.71056 9.89649 0.973022 8.03998 0.973022L8 1.00305ZM8 14.0031H7.47998C7.34751 13.9989 7.22047 13.9495 7.12 13.863C7.04052 13.7807 6.98815 13.6761 6.96997 13.5631C6.9381 13.3682 6.95328 13.1684 7.01416 12.9806C7.07504 12.7927 7.17989 12.6222 7.32001 12.483C7.84048 11.9474 8.13165 11.2299 8.13165 10.483C8.13165 9.73615 7.84048 9.0187 7.32001 8.48303C7.05348 8.21635 6.73699 8.00481 6.38867 7.86047C6.04036 7.71614 5.66702 7.64185 5.28998 7.64185C4.91294 7.64185 4.5396 7.71614 4.19128 7.86047C3.84297 8.00481 3.52654 8.21635 3.26001 8.48303C3.15068 8.61081 3.01089 8.709 2.85358 8.76843C2.69626 8.82786 2.52649 8.84657 2.35999 8.823C2.27593 8.80694 2.19903 8.76498 2.14001 8.703C2.07131 8.6224 2.03556 8.5189 2.03998 8.41309V8.04309C2.03998 6.8564 2.39192 5.69629 3.05121 4.70959C3.7105 3.7229 4.64754 2.95388 5.7439 2.49976C6.84025 2.04563 8.04669 1.92681 9.21057 2.15833C10.3745 2.38984 11.4435 2.9613 12.2827 3.80042C13.1218 4.63953 13.6932 5.70867 13.9247 6.87256C14.1562 8.03644 14.0374 9.24275 13.5833 10.3391C13.1291 11.4355 12.3601 12.3726 11.3734 13.0319C10.3867 13.6911 9.22667 14.0431 8.03998 14.0431L8 14.0031ZM9 3.99683C9 4.54911 8.55228 4.99683 8 4.99683C7.44771 4.99683 7 4.54911 7 3.99683C7 3.44454 7.44771 2.99683 8 2.99683C8.55228 2.99683 9 3.44454 9 3.99683ZM12 11.0037C12 11.5559 11.5523 12.0037 11 12.0037C10.4477 12.0037 10 11.5559 10 11.0037C10 10.4514 10.4477 10.0037 11 10.0037C11.5523 10.0037 12 10.4514 12 11.0037ZM5 6.00415C5.55229 6.00415 6 5.55644 6 5.00415C6 4.45187 5.55229 4.00415 5 4.00415C4.44772 4.00415 4 4.45187 4 5.00415C4 5.55644 4.44772 6.00415 5 6.00415ZM12 5.00415C12 5.55644 11.5523 6.00415 11 6.00415C10.4477 6.00415 10 5.55644 10 5.00415C10 4.45187 10.4477 4.00415 11 4.00415C11.5523 4.00415 12 4.45187 12 5.00415ZM13.0001 7.99939C13.0001 8.55167 12.5524 8.99939 12.0001 8.99939C11.4478 8.99939 11.0001 8.55167 11.0001 7.99939C11.0001 7.4471 11.4478 6.99939 12.0001 6.99939C12.5524 6.99939 13.0001 7.4471 13.0001 7.99939Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-constant.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-constant.svg
new file mode 100644
index 0000000..0e90eca
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-constant.svg
@@ -0,0 +1,4 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M4 6H12V7H4V6ZM12 9H4V10H12V9Z" fill="#C5C5C5"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M1 4L2 3H14L15 4V12L14 13H2L1 12V4ZM2 4V12H14V4H2Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-enumerator-member.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-enumerator-member.svg
new file mode 100644
index 0000000..53735c1
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-enumerator-member.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7 3L8 2H14L15 3V8L14 9H10V8H14V3H8V6H7V3ZM9 9V8L8 7H7H2L1 8V13L2 14H8L9 13V9ZM8 8V9V13H2V8H7H8ZM9.41421 7L9 6.58579V6H13V7H9.41421ZM9 4H13V5H9V4ZM7 10H3V11H7V10Z" fill="#75BEFF"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-enumerator.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-enumerator.svg
new file mode 100644
index 0000000..2197f66
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-enumerator.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M14 2H8L7 3V6H8V3H14V8H10V9H14L15 8V3L14 2ZM9 6H13V7H9.41L9 6.59V6ZM7 7H2L1 8V13L2 14H8L9 13V8L8 7H7ZM8 13H2V8H8V9V13ZM3 9H7V10H3V9ZM3 11H7V12H3V11ZM9 4H13V5H9V4Z" fill="#EE9D28"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-event.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-event.svg
new file mode 100644
index 0000000..051bef3
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-event.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7.41354 1.55996L8.31152 1H11.6056L12.424 2.57465L10.2356 6H12.0174L12.7363 7.69512L5.61943 15L4.01675 13.837L6.11943 10H4.89798L4 8.55996L7.41354 1.55996ZM7.78033 9L4.90054 14.3049L12.0174 7H8.31152L11.6056 2H8.31152L4.89798 9H7.78033Z" fill="#EE9D28"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-field.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-field.svg
new file mode 100644
index 0000000..f7b9e28
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-field.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M14.45 4.5L9.44995 2H8.55005L1.55005 5.5L1 6.39001V10.89L1.55005 11.79L6.55005 14.29H7.44995L14.45 10.79L15 9.89001V5.39001L14.45 4.5ZM6.44995 13.14L1.94995 10.89V7.17004L6.44995 9.17004V13.14ZM6.94995 8.33997L2.29004 6.22998L8.94995 2.89001L13.62 5.22998L6.94995 8.33997ZM13.95 9.89001L7.44995 13.14V9.20996L13.95 6.20996V9.89001Z" fill="#75BEFF"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-file.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-file.svg
new file mode 100644
index 0000000..c9b6a03
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-file.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M13.85 4.44L10.57 1.14L10.22 1H2.5L2 1.5V14.5L2.5 15H13.5L14 14.5V4.8L13.85 4.44ZM13 5H10V2L13 5ZM3 14V2H9V5.5L9.5 6H13V14H3Z" fill="#C5C5C5"/>
+</svg> \ No newline at end of file
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-interface.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-interface.svg
new file mode 100644
index 0000000..b8ff0ab
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-interface.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M11.4965 4C10.655 3.9989 9.84136 4.30189 9.20557 4.85315C8.56977 5.40442 8.15465 6.16684 8.0365 7H4.9364C4.8147 6.52867 4.52533 6.11794 4.12244 5.84473C3.71955 5.57152 3.23083 5.45466 2.74792 5.51599C2.26502 5.57733 1.82106 5.81261 1.49927 6.17786C1.17747 6.54311 1 7.01322 1 7.5C1 7.98679 1.17747 8.45689 1.49927 8.82215C1.82106 9.1874 2.26502 9.42267 2.74792 9.48401C3.23083 9.54535 3.71955 9.42848 4.12244 9.15528C4.52533 8.88207 4.8147 8.47133 4.9364 8H8.0365C8.13236 8.66418 8.41717 9.28683 8.85693 9.7937C9.2967 10.3006 9.87284 10.6703 10.5168 10.8589C11.1609 11.0475 11.8455 11.047 12.4893 10.8574C13.133 10.6679 13.7087 10.2973 14.1477 9.7898C14.5867 9.28227 14.8706 8.65919 14.9655 7.99488C15.0603 7.33056 14.9621 6.65298 14.6827 6.04285C14.4034 5.43272 13.9545 4.91578 13.3895 4.55359C12.8246 4.19141 12.1675 3.99922 11.4965 4V4ZM11.4965 10C11.002 10 10.5187 9.85332 10.1075 9.57862C9.69642 9.30391 9.37599 8.91348 9.18677 8.45667C8.99755 7.99985 8.94809 7.49728 9.04456 7.01233C9.14102 6.52738 9.37901 6.08181 9.72864 5.73218C10.0783 5.38255 10.5238 5.14456 11.0088 5.0481C11.4937 4.95164 11.9963 5.00109 12.4531 5.19031C12.9099 5.37953 13.3004 5.69996 13.5751 6.11109C13.8498 6.52221 13.9965 7.00555 13.9965 7.5C13.9965 8.16304 13.7331 8.79898 13.2643 9.26783C12.7954 9.73667 12.1595 10 11.4965 10V10Z" fill="#75BEFF"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-key.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-key.svg
new file mode 100644
index 0000000..80fb9d6
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-key.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7.22289 10.933C7.54863 11.1254 7.92163 11.2231 8.29989 11.215C8.63777 11.2218 8.97254 11.1492 9.27721 11.003C9.58188 10.8567 9.84792 10.6409 10.0539 10.373C10.5091 9.76519 10.7402 9.01867 10.7079 8.25998C10.7412 7.58622 10.5374 6.9221 10.1319 6.38298C9.93575 6.14161 9.68577 5.94957 9.402 5.82228C9.11824 5.69498 8.80858 5.63597 8.49789 5.64997C8.07522 5.64699 7.65994 5.76085 7.29789 5.97898C7.18304 6.04807 7.0749 6.12775 6.97489 6.21698V3.47498H5.98389V11.1H6.97889V10.756C7.05516 10.8217 7.13677 10.8809 7.22289 10.933ZM7.84981 6.70006C8.03598 6.62105 8.23807 6.58677 8.43989 6.59998C8.61257 6.59452 8.78404 6.63054 8.93994 6.70501C9.09583 6.77948 9.23161 6.89023 9.33589 7.02798C9.59253 7.39053 9.7184 7.82951 9.69289 8.27297C9.71972 8.79748 9.57969 9.31701 9.29289 9.75698C9.18822 9.91527 9.04546 10.0447 8.87773 10.1335C8.70999 10.2223 8.52264 10.2675 8.33289 10.265C8.14934 10.2732 7.9663 10.24 7.79734 10.1678C7.62838 10.0956 7.47784 9.98628 7.35689 9.84797C7.10152 9.55957 6.96501 9.18506 6.97489 8.79998V8.19998C6.96299 7.78332 7.10263 7.3765 7.36789 7.05498C7.49858 6.90064 7.66364 6.77908 7.84981 6.70006ZM3.28902 5.67499C2.97011 5.67933 2.65388 5.734 2.35202 5.83699C2.06417 5.92293 1.79347 6.05828 1.55202 6.23699L1.45202 6.31399V7.51399L1.87502 7.15499C2.24579 6.80478 2.73133 6.60146 3.24102 6.58299C3.36593 6.57164 3.4917 6.59147 3.60706 6.64068C3.72243 6.6899 3.82377 6.76697 3.90202 6.86499C4.0522 7.0971 4.13239 7.36754 4.13302 7.64399L2.90002 7.82499C2.39435 7.87781 1.91525 8.07772 1.52202 8.39999C1.36697 8.55181 1.24339 8.73271 1.15835 8.93235C1.07331 9.13199 1.02848 9.34644 1.02644 9.56343C1.0244 9.78042 1.06517 9.99568 1.14644 10.1969C1.2277 10.3981 1.34786 10.5813 1.50002 10.736C1.6687 10.8904 1.86622 11.01 2.08125 11.0879C2.29627 11.1659 2.52456 11.2005 2.75302 11.19C3.147 11.1931 3.53278 11.0774 3.86002 10.858C3.96153 10.7897 4.0572 10.7131 4.14602 10.629V11.073H5.08702V7.71499C5.12137 7.17422 4.9543 6.63988 4.61802 6.21499C4.44979 6.03285 4.24348 5.89003 4.01378 5.7967C3.78407 5.70336 3.53661 5.66181 3.28902 5.67499ZM4.14602 8.71599C4.16564 9.13435 4.02592 9.54459 3.75502 9.864C3.63689 10.0005 3.48998 10.1092 3.32486 10.1821C3.15973 10.2551 2.98049 10.2906 2.80002 10.286C2.69049 10.2945 2.58035 10.2812 2.47599 10.2469C2.37163 10.2125 2.27511 10.1579 2.19202 10.086C2.06079 9.93455 1.98856 9.74088 1.98856 9.54049C1.98856 9.34011 2.06079 9.14644 2.19202 8.99499C2.47322 8.82131 2.79233 8.71837 3.12202 8.69499L4.14202 8.54699L4.14602 8.71599ZM12.4588 11.0325C12.766 11.1638 13.0983 11.2261 13.4322 11.215C13.927 11.227 14.4153 11.1006 14.8422 10.85L14.9652 10.775L14.9782 10.768V9.61504L14.5322 9.93504C14.216 10.1592 13.8356 10.2747 13.4482 10.264C13.2497 10.2719 13.052 10.2342 12.8703 10.1538C12.6886 10.0733 12.5278 9.95232 12.4002 9.80004C12.1144 9.42453 11.9725 8.95911 12.0002 8.48804C11.9737 7.98732 12.1352 7.49475 12.4532 7.10704C12.5934 6.94105 12.7695 6.80914 12.9682 6.7213C13.167 6.63346 13.3831 6.592 13.6002 6.60004C13.9439 6.59844 14.2808 6.69525 14.5712 6.87904L15.0002 7.14404V5.97004L14.8312 5.89704C14.4626 5.73432 14.0641 5.6502 13.6612 5.65004C13.2999 5.63991 12.9406 5.70762 12.6078 5.84859C12.2749 5.98956 11.9763 6.20048 11.7322 6.46704C11.2261 7.02683 10.9581 7.76186 10.9852 8.51604C10.9567 9.22346 11.1955 9.91569 11.6542 10.455C11.8769 10.704 12.1516 10.9012 12.4588 11.0325Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-keyword.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-keyword.svg
new file mode 100644
index 0000000..70ba6ea
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-keyword.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M15 4H10V3H15V4ZM14 7H12V8H14V7ZM10 7H1V8H10V7ZM12 13H1V14H12V13ZM7 10H1V11H7V10ZM15 10H10V11H15V10ZM8 2V5H1V2H8ZM7 3H2V4H7V3Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-method.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-method.svg
new file mode 100644
index 0000000..cccf5a0
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-method.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M13.51 4L8.51001 1H7.51001L2.51001 4L2.02002 4.85999V10.86L2.51001 11.71L7.51001 14.71H8.51001L13.51 11.71L14 10.86V4.85999L13.51 4ZM7.51001 13.5601L3.01001 10.86V5.69995L7.51001 8.15002V13.5601ZM3.27002 4.69995L8.01001 1.85999L12.75 4.69995L8.01001 7.29004L3.27002 4.69995ZM13.01 10.86L8.51001 13.5601V8.15002L13.01 5.69995V10.86Z" fill="#B180D7"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-misc.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-misc.svg
new file mode 100644
index 0000000..8880923
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-misc.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M4 2H12V6C12.3415 6.03511 12.6774 6.11234 13 6.22998V1H3V9.47998L4 7.72998V2ZM6.14001 10L5 8L4 9.75L3.29004 11L1 15H9L6.70996 11L6.14001 10ZM2.71997 14L4.43994 11L5 10L5.56006 11L7.28003 14H2.71997ZM9.55552 7.58984C10.1311 7.20526 10.8077 7 11.5 7C12.4282 7 13.3185 7.36877 13.9748 8.02515C14.6312 8.68152 15 9.57174 15 10.5C15 11.1922 14.7947 11.8689 14.4101 12.4445C14.0256 13.02 13.4789 13.4686 12.8393 13.7335C12.1998 13.9984 11.4961 14.0678 10.8171 13.9327C10.1382 13.7977 9.51461 13.4643 9.02513 12.9749C8.53564 12.4854 8.20229 11.8618 8.06724 11.1829C7.93219 10.5039 8.00155 9.80019 8.26646 9.16064C8.53137 8.5211 8.97995 7.97443 9.55552 7.58984ZM10.1111 12.5786C10.5222 12.8533 11.0055 13 11.5 13C12.163 13 12.799 12.7367 13.2678 12.2678C13.7366 11.799 14 11.163 14 10.5C14 10.0055 13.8533 9.52221 13.5786 9.11108C13.3039 8.69996 12.9135 8.37953 12.4566 8.19031C11.9998 8.00109 11.4973 7.95163 11.0123 8.0481C10.5274 8.14456 10.0818 8.38255 9.73216 8.73218C9.38253 9.08181 9.14454 9.52738 9.04808 10.0123C8.95161 10.4973 9.00107 10.9998 9.19029 11.4567C9.37951 11.9135 9.69994 12.3039 10.1111 12.5786Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-namespace.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-namespace.svg
new file mode 100644
index 0000000..9a725bb
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-namespace.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M6 2.98361V2.97184V2H5.91083C5.59743 2 5.29407 2.06161 5.00128 2.18473C4.70818 2.30798 4.44942 2.48474 4.22578 2.71498C4.00311 2.94422 3.83792 3.19498 3.73282 3.46766L3.73233 3.46898C3.63382 3.7352 3.56814 4.01201 3.53533 4.29917L3.53519 4.30053C3.50678 4.5805 3.4987 4.86844 3.51084 5.16428C3.52272 5.45379 3.52866 5.74329 3.52866 6.03279C3.52866 6.23556 3.48974 6.42594 3.412 6.60507L3.4116 6.60601C3.33687 6.78296 3.23423 6.93866 3.10317 7.07359C2.97644 7.20405 2.82466 7.31055 2.64672 7.3925C2.4706 7.46954 2.28497 7.5082 2.08917 7.5082H2V7.6V8.4V8.4918H2.08917C2.28465 8.4918 2.47001 8.53238 2.64601 8.61334L2.64742 8.61396C2.82457 8.69157 2.97577 8.79762 3.10221 8.93161L3.10412 8.93352C3.23428 9.0637 3.33659 9.21871 3.41129 9.39942L3.41201 9.40108C3.48986 9.58047 3.52866 9.76883 3.52866 9.96721C3.52866 10.2567 3.52272 10.5462 3.51084 10.8357C3.4987 11.1316 3.50677 11.4215 3.53516 11.7055L3.53535 11.7072C3.56819 11.9903 3.63387 12.265 3.73232 12.531L3.73283 12.5323C3.83793 12.805 4.00311 13.0558 4.22578 13.285C4.44942 13.5153 4.70818 13.692 5.00128 13.8153C5.29407 13.9384 5.59743 14 5.91083 14H6V13.2V13.0164H5.91083C5.71095 13.0164 5.52346 12.9777 5.34763 12.9008C5.17396 12.8191 5.02194 12.7126 4.89086 12.5818C4.76386 12.4469 4.66104 12.2911 4.58223 12.1137C4.50838 11.9346 4.47134 11.744 4.47134 11.541C4.47134 11.3127 4.4753 11.0885 4.48321 10.8686C4.49125 10.6411 4.49127 10.4195 4.48324 10.2039C4.47914 9.98246 4.46084 9.76883 4.42823 9.56312C4.39513 9.35024 4.33921 9.14757 4.26039 8.95536C4.18091 8.76157 4.07258 8.57746 3.93616 8.40298C3.82345 8.25881 3.68538 8.12462 3.52283 8C3.68538 7.87538 3.82345 7.74119 3.93616 7.59702C4.07258 7.42254 4.18091 7.23843 4.26039 7.04464C4.33913 6.85263 4.39513 6.65175 4.42826 6.44285C4.46082 6.2333 4.47914 6.01973 4.48324 5.80219C4.49127 5.58262 4.49125 5.36105 4.48321 5.13749C4.4753 4.9134 4.47134 4.68725 4.47134 4.45902C4.47134 4.26019 4.50833 4.07152 4.58238 3.89205C4.66135 3.71034 4.76421 3.55475 4.89086 3.42437C5.02193 3.28942 5.17461 3.18275 5.34802 3.10513C5.5238 3.02427 5.71113 2.98361 5.91083 2.98361H6ZM10 13.0164V13.0282V14H10.0892C10.4026 14 10.7059 13.9384 10.9987 13.8153C11.2918 13.692 11.5506 13.5153 11.7742 13.285C11.9969 13.0558 12.1621 12.805 12.2672 12.5323L12.2677 12.531C12.3662 12.2648 12.4319 11.988 12.4647 11.7008L12.4648 11.6995C12.4932 11.4195 12.5013 11.1316 12.4892 10.8357C12.4773 10.5462 12.4713 10.2567 12.4713 9.96721C12.4713 9.76444 12.5103 9.57406 12.588 9.39493L12.5884 9.39399C12.6631 9.21704 12.7658 9.06134 12.8968 8.92642C13.0236 8.79595 13.1753 8.68945 13.3533 8.6075C13.5294 8.53046 13.715 8.4918 13.9108 8.4918H14V8.4V7.6V7.5082H13.9108C13.7153 7.5082 13.53 7.46762 13.354 7.38666L13.3526 7.38604C13.1754 7.30844 13.0242 7.20238 12.8978 7.06839L12.8959 7.06648C12.7657 6.9363 12.6634 6.78129 12.5887 6.60058L12.588 6.59892C12.5101 6.41953 12.4713 6.23117 12.4713 6.03279C12.4713 5.74329 12.4773 5.45379 12.4892 5.16428C12.5013 4.86842 12.4932 4.57848 12.4648 4.29454L12.4646 4.29285C12.4318 4.00971 12.3661 3.73502 12.2677 3.46897L12.2672 3.46766C12.1621 3.19499 11.9969 2.94422 11.7742 2.71498C11.5506 2.48474 11.2918 2.30798 10.9987 2.18473C10.7059 2.06161 10.4026 2 10.0892 2H10V2.8V2.98361H10.0892C10.2891 2.98361 10.4765 3.0223 10.6524 3.09917C10.826 3.18092 10.9781 3.28736 11.1091 3.41823C11.2361 3.55305 11.339 3.70889 11.4178 3.88628C11.4916 4.0654 11.5287 4.25596 11.5287 4.45902C11.5287 4.68727 11.5247 4.91145 11.5168 5.13142C11.5088 5.35894 11.5087 5.58049 11.5168 5.79605C11.5209 6.01754 11.5392 6.23117 11.5718 6.43688C11.6049 6.64976 11.6608 6.85243 11.7396 7.04464C11.8191 7.23843 11.9274 7.42254 12.0638 7.59702C12.1765 7.74119 12.3146 7.87538 12.4772 8C12.3146 8.12462 12.1765 8.25881 12.0638 8.40298C11.9274 8.57746 11.8191 8.76157 11.7396 8.95536C11.6609 9.14737 11.6049 9.34825 11.5717 9.55715C11.5392 9.7667 11.5209 9.98027 11.5168 10.1978C11.5087 10.4174 11.5087 10.6389 11.5168 10.8625C11.5247 11.0866 11.5287 11.3128 11.5287 11.541C11.5287 11.7398 11.4917 11.9285 11.4176 12.1079C11.3386 12.2897 11.2358 12.4452 11.1091 12.5756C10.9781 12.7106 10.8254 12.8173 10.652 12.8949C10.4762 12.9757 10.2889 13.0164 10.0892 13.0164H10Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-numeric.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-numeric.svg
new file mode 100644
index 0000000..a1573df
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-numeric.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M11 1V5H15V6H11L11 10H15V11H11V15H10V11H6V15H5L5 11H1V10H5L5 6H1V5H5L5 1H6V5H10V1H11ZM6 6L6 10H10L10 6H6Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-operator.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-operator.svg
new file mode 100644
index 0000000..957f5f4
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-operator.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2.87289 1.10023C3.20768 1.23579 3.47545 1.498 3.61802 1.82988C3.69032 1.99959 3.72675 2.18242 3.72502 2.36688C3.72617 2.54999 3.68975 2.7314 3.61802 2.89988C3.51299 3.14567 3.33782 3.35503 3.11442 3.50177C2.89102 3.64851 2.6293 3.72612 2.36202 3.72488C2.17924 3.72592 1.99818 3.68951 1.83002 3.61788C1.58298 3.51406 1.37227 3.33932 1.22453 3.11575C1.0768 2.89219 0.998666 2.62984 1.00002 2.36188C0.99913 2.17921 1.03519 1.99825 1.10602 1.82988C1.24337 1.50314 1.50328 1.24323 1.83002 1.10588C2.16332 0.966692 2.53809 0.964661 2.87289 1.10023ZM2.57502 2.86488C2.7054 2.80913 2.80927 2.70526 2.86502 2.57488C2.8929 2.50838 2.90718 2.43698 2.90702 2.36488C2.90813 2.2654 2.88215 2.1675 2.83185 2.08167C2.78156 1.99584 2.70884 1.92531 2.62151 1.87767C2.53418 1.83002 2.43553 1.80705 2.33614 1.81121C2.23674 1.81537 2.14035 1.8465 2.05731 1.90128C1.97426 1.95606 1.9077 2.03241 1.86475 2.12215C1.8218 2.21188 1.80409 2.31161 1.81352 2.41065C1.82294 2.50968 1.85915 2.60428 1.91825 2.6843C1.97736 2.76433 2.05713 2.82675 2.14902 2.86488C2.28549 2.92089 2.43854 2.92089 2.57502 2.86488ZM6.42995 1.1095L1.10967 6.42977L1.79557 7.11567L7.11584 1.7954L6.42995 1.1095ZM11.5 8.99999H12.5V11.5H15V12.5H12.5V15H11.5V12.5H9V11.5H11.5V8.99999ZM5.76777 9.52509L6.47487 10.2322L4.70711 12L6.47487 13.7677L5.76777 14.4748L4 12.7071L2.23223 14.4748L1.52513 13.7677L3.29289 12L1.52513 10.2322L2.23223 9.52509L4 11.2929L5.76777 9.52509ZM7.11802 5.32988C7.01442 5.08268 6.83973 4.87183 6.61612 4.72406C6.3925 4.57629 6.13004 4.49826 5.86202 4.49988C5.67935 4.49899 5.49839 4.53505 5.33002 4.60588C5.00328 4.74323 4.74337 5.00314 4.60602 5.32988C4.53588 5.49478 4.49897 5.67191 4.49741 5.8511C4.49586 6.0303 4.52967 6.20804 4.59693 6.37414C4.66419 6.54024 4.76356 6.69143 4.88936 6.81906C5.01516 6.94669 5.1649 7.04823 5.33002 7.11788C5.49867 7.18848 5.67968 7.22484 5.86252 7.22484C6.04535 7.22484 6.22636 7.18848 6.39502 7.11788C6.64201 7.01388 6.8527 6.83913 7.00058 6.61563C7.14845 6.39213 7.22689 6.12987 7.22602 5.86188C7.22655 5.67905 7.1898 5.49803 7.11802 5.32988ZM6.36502 6.07488C6.33766 6.13937 6.29829 6.19808 6.24902 6.24788C6.19908 6.29724 6.14042 6.33691 6.07602 6.36488C6.00854 6.39297 5.93611 6.40725 5.86302 6.40688C5.78991 6.40744 5.71744 6.39315 5.65002 6.36488C5.58541 6.33729 5.52668 6.29757 5.47702 6.24788C5.42691 6.19856 5.38713 6.13975 5.36002 6.07488C5.30401 5.9384 5.30401 5.78536 5.36002 5.64888C5.41536 5.51846 5.51941 5.41477 5.65002 5.35988C5.71737 5.33126 5.78984 5.31663 5.86302 5.31688C5.93618 5.31685 6.0086 5.33147 6.07602 5.35988C6.14037 5.38749 6.19904 5.42682 6.24902 5.47588C6.29786 5.52603 6.33717 5.58465 6.36502 5.64888C6.3934 5.7163 6.40802 5.78872 6.40802 5.86188C6.40802 5.93503 6.3934 6.00745 6.36502 6.07488ZM14 3H10V4H14V3Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-parameter.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-parameter.svg
new file mode 100644
index 0000000..425ced3
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-parameter.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M11 6H10V5.5C10 5.22386 9.77616 5 9.50001 5H8.47902V10.5C8.47902 10.7761 8.70288 11 8.97902 11H9.47902V12H6.47902V11H6.97902C7.25516 11 7.47902 10.7761 7.47902 10.5V5H6.50001C6.22387 5 6.00001 5.22386 6.00001 5.5V6H5.00001V4H11V6ZM13.9142 8.0481L12.4519 6.58581L13.159 5.87871L14.9749 7.69454V8.40165L13.2071 10.1694L12.5 9.46231L13.9142 8.0481ZM3.5481 9.4623L2.08581 8.00002L3.50002 6.58581L2.79291 5.8787L1.02515 7.64647V8.35357L2.841 10.1694L3.5481 9.4623Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-property.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-property.svg
new file mode 100644
index 0000000..7137a9d
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-property.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M2.80723 14.9754C2.57119 14.9721 2.33826 14.9211 2.12247 14.8254C1.90667 14.7297 1.71248 14.5913 1.55158 14.4186C1.2385 14.1334 1.04433 13.7408 1.00775 13.3189C0.966225 12.8828 1.09269 12.4473 1.36133 12.1013C2.56779 10.8289 4.9473 8.4494 6.67811 6.75479C6.30983 5.75887 6.32704 4.66127 6.72637 3.67739C7.05474 2.85876 7.63869 2.16805 8.39129 1.70807C8.9817 1.31706 9.66031 1.07944 10.3657 1.01673C11.0711 0.954022 11.7809 1.06819 12.4311 1.34892L13.0482 1.6162L10.1824 4.56738L11.4371 5.82582L14.3809 2.94887L14.6482 3.56788C14.8735 4.08976 14.993 4.65119 14.9997 5.21961C15.0064 5.78802 14.9002 6.35211 14.6872 6.87915C14.476 7.40029 14.1623 7.87368 13.7647 8.27122C13.5394 8.49169 13.2904 8.68653 13.0222 8.85218C12.4673 9.22275 11.8324 9.45636 11.1697 9.5338C10.5069 9.61124 9.83521 9.5303 9.20982 9.29764C8.11194 10.4113 5.37142 13.1704 3.89119 14.5522C3.59426 14.8219 3.20832 14.9726 2.80723 14.9754ZM10.7448 1.92802C10.087 1.92637 9.44359 2.12018 8.89614 2.48485C8.68265 2.6152 8.48437 2.76897 8.30498 2.9433C7.82789 3.42423 7.50926 4.03953 7.39182 4.70669C7.27438 5.37385 7.36374 6.06098 7.64792 6.67591L7.78342 6.97288L7.55048 7.20025C5.81224 8.89672 3.28146 11.4201 2.06479 12.7045C1.95646 12.8658 1.91012 13.0608 1.93435 13.2535C1.95857 13.4463 2.05171 13.6238 2.19657 13.7532C2.28005 13.8462 2.38177 13.9211 2.49541 13.9731C2.59557 14.0184 2.70383 14.043 2.81373 14.0455C2.98064 14.0413 3.14044 13.977 3.26383 13.8646C4.83687 12.3964 7.87622 9.32641 8.76807 8.42435L8.9973 8.19326L9.29242 8.32783C9.80617 8.56732 10.3731 8.66985 10.9382 8.62545C11.5033 8.58106 12.0473 8.39125 12.5174 8.07447C12.7313 7.9426 12.9296 7.78694 13.1085 7.61045C13.4183 7.30153 13.6631 6.93374 13.8286 6.52874C13.994 6.12375 14.0767 5.68974 14.0719 5.25228C14.0719 5.03662 14.0505 4.82148 14.0078 4.61007L11.4306 7.12508L8.87944 4.57759L11.3944 1.98834C11.1804 1.94674 10.9628 1.92653 10.7448 1.92802Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-ruler.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-ruler.svg
new file mode 100644
index 0000000..1957dba
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-ruler.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M4 1L3 2V14L4 15H12L13 14V2L12 1H4ZM4 3V2H12V14H4V13H6V12H4V10H8V9H4V7H6V6H4V4H8V3H4Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-snippet.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-snippet.svg
new file mode 100644
index 0000000..79799f9
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-snippet.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 1L2 1.5V13H3V2H14V13H15V1.5L14.5 1H2.5ZM2 15V14H3V15H2ZM5 14.0001H4V15.0001H5V14.0001ZM6 14.0001H7V15.0001H6V14.0001ZM9 14.0001H8V15.0001H9V14.0001ZM10 14.0001H11V15.0001H10V14.0001ZM15 15.0001V14.0001H14V15.0001H15ZM12 14.0001H13V15.0001H12V14.0001Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-string.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-string.svg
new file mode 100644
index 0000000..ef5f226
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-string.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2 2L1 3V12L2 13H14L15 12V3L14 2H2ZM2 12V3H14V12H2ZM5.3556 8.93017H6V7.22067C6 6.40689 5.68534 6 5.05603 6C4.92098 6 4.77083 6.02421 4.6056 6.07263C4.44181 6.12104 4.3125 6.17691 4.21767 6.24022V6.90503C4.45474 6.70205 4.70474 6.60056 4.96767 6.60056C5.22917 6.60056 5.35991 6.75698 5.35991 7.06983L4.76078 7.17318C4.25359 7.25885 4 7.57914 4 8.13408C4 8.39665 4.06106 8.60708 4.18319 8.76536C4.30675 8.92179 4.47557 9 4.68966 9C4.97989 9 5.19899 8.83985 5.34698 8.51955H5.3556V8.93017ZM5.35991 7.57542V7.76816C5.35991 7.9432 5.31968 8.08845 5.23922 8.20391C5.15876 8.3175 5.0546 8.3743 4.92672 8.3743C4.83477 8.3743 4.76149 8.34264 4.7069 8.27933C4.65374 8.21415 4.62716 8.13128 4.62716 8.03073C4.62716 7.80912 4.73779 7.6797 4.95905 7.64246L5.35991 7.57542ZM7.60094 8.62622H7.59343V8.93511H7V5H7.59343V6.67683H7.60094C7.74742 6.36708 7.95587 6.2122 8.22629 6.2122C8.47418 6.2122 8.6651 6.32987 8.79906 6.56522C8.93302 6.80056 9 7.12243 9 7.53082C9 7.97383 8.92175 8.32944 8.76526 8.59766C8.60876 8.86589 8.39969 9 8.13803 9C7.90141 9 7.72238 8.87541 7.60094 8.62622ZM7.58404 7.50487V7.77742C7.58404 7.94873 7.61972 8.09063 7.69108 8.20311C7.76244 8.3156 7.85383 8.37184 7.96526 8.37184C8.10047 8.37184 8.20501 8.30002 8.27887 8.15639C8.35399 8.01103 8.39155 7.80597 8.39155 7.54121C8.39155 7.32144 8.35712 7.15012 8.28826 7.02726C8.22066 6.90266 8.12363 6.84036 7.99718 6.84036C7.87825 6.84036 7.77934 6.9018 7.70047 7.02466C7.62285 7.14752 7.58404 7.30759 7.58404 7.50487ZM11.2616 9C11.5834 9 11.8295 8.94227 12 8.82682V8.11732C11.82 8.25512 11.636 8.32402 11.448 8.32402C11.2362 8.32402 11.0697 8.25233 10.9486 8.10894C10.8276 7.96369 10.767 7.76443 10.767 7.51117C10.767 7.25047 10.8299 7.04656 10.9558 6.89944C11.0832 6.75047 11.2553 6.67598 11.4719 6.67598C11.6663 6.67598 11.8423 6.74488 12 6.88268V6.13408C11.871 6.04469 11.6623 6 11.374 6C10.9566 6 10.6229 6.1406 10.3728 6.42179C10.1243 6.70112 10 7.0838 10 7.56983C10 7.99069 10.1163 8.33426 10.3489 8.60056C10.5814 8.86685 10.8857 9 11.2616 9Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-structure.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-structure.svg
new file mode 100644
index 0000000..13766a5
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-structure.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2 2L1 3V6L2 7H14L15 6V3L14 2H2ZM2 3H3H13H14V4V5V6H13H3H2V5V4V3ZM1 10L2 9H5L6 10V13L5 14H2L1 13V10ZM3 10H2V11V12V13H3H4H5V12V11V10H4H3ZM10 10L11 9H14L15 10V13L14 14H11L10 13V10ZM12 10H11V11V12V13H12H13H14V12V11V10H13H12Z" fill="#C5C5C5"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-dark/symbol-variable.svg b/elpa/company-20220326.48/icons/vscode-dark/symbol-variable.svg
new file mode 100644
index 0000000..5ee50e0
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-dark/symbol-variable.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2 5H4V4H1.5L1 4.5V12.5L1.5 13H4V12H2V5ZM14.5 4H12V5H14V12H12V13H14.5L15 12.5V4.5L14.5 4ZM11.76 6.56995L12 7V9.51001L11.7 9.95996L7.19995 11.96H6.73999L4.23999 10.46L4 10.03V7.53003L4.30005 7.06995L8.80005 5.06995H9.26001L11.76 6.56995ZM5 9.70996L6.5 10.61V9.28003L5 8.38V9.70996ZM5.57996 7.56006L7.03003 8.43005L10.42 6.93005L8.96997 6.06006L5.57996 7.56006ZM7.53003 10.73L11.03 9.17004V7.77002L7.53003 9.31995V10.73Z" fill="#75BEFF"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/folder.svg b/elpa/company-20220326.48/icons/vscode-light/folder.svg
new file mode 100644
index 0000000..c0939fe
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/folder.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M14.5002 3H7.71021L6.86023 2.15002L6.51025 2H1.51025L1.01025 2.5V6.5V13.5L1.51025 14H14.5103L15.0103 13.5V9V3.5L14.5002 3ZM13.9902 11.49V13H1.99023V11.49V7.48999V7H6.48022L6.8302 6.84998L7.69019 5.98999H14.0002V7.48999L13.9902 11.49ZM13.9902 5H7.49023L7.14026 5.15002L6.28027 6.01001H2.00024V3.01001H6.29028L7.14026 3.85999L7.50024 4.01001H14.0002L13.9902 5Z" fill="#424242"/>
+</svg> \ No newline at end of file
diff --git a/elpa/company-20220326.48/icons/vscode-light/references.svg b/elpa/company-20220326.48/icons/vscode-light/references.svg
new file mode 100644
index 0000000..eea62e0
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/references.svg
@@ -0,0 +1,10 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0)">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M11.1055 4.5613L7.67529 7.98827L6.54097 6.86834L8.61123 4.78848H3.81155C3.17507 4.78848 2.56466 5.04132 2.11461 5.49138C1.66455 5.94144 1.41171 6.55184 1.41171 7.18832C1.41171 7.8248 1.66455 8.43521 2.11461 8.88527C2.56466 9.33532 3.17507 9.58816 3.81155 9.58816H4.70109V11.1881H3.82115C2.79234 11.142 1.82094 10.7009 1.1092 9.95661C0.397467 9.21231 0.000244141 8.22216 0.000244141 7.19232C0.000244141 6.16249 0.397467 5.17234 1.1092 4.42803C1.82094 3.68373 2.79234 3.24263 3.82115 3.19659H8.62083L6.54097 1.13112L7.67529 0L11.1055 3.43177V4.5613ZM16.6203 24H7.02094L6.22099 23.2V10.4121L7.02094 9.61215H16.6203L17.4202 10.4121V23.2L16.6203 24ZM7.82089 22.4001H15.8204V11.212H7.82089V22.4001ZM13.4205 1.6015H23.0199L23.8198 2.40145V15.1878L23.0199 15.9877H19.0201V14.3878H22.2199V3.20139H14.2205V7.98828H12.6206V2.40145L13.4205 1.6015ZM14.2205 12.7879H9.42078V14.3878H14.2205V12.7879ZM9.42078 15.9877H14.2205V17.5876H9.42078V15.9877ZM14.2205 19.1875H9.42078V20.7874H14.2205V19.1875ZM15.8203 4.78848H20.62V6.38838H15.8203V4.78848ZM20.62 11.188H19.0201V12.7879H20.62V11.188ZM17.2827 8.01228V7.98828H20.62V9.58817H18.8585L17.2827 8.01228Z" fill="#424242"/>
+</g>
+<defs>
+<clipPath id="clip0">
+<rect width="24" height="24" fill="white" transform="translate(0.000244141)"/>
+</clipPath>
+</defs>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-array.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-array.svg
new file mode 100644
index 0000000..9d7a388
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-array.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M1.50024 2L1.00024 2.5V13.5L1.50024 14H4.00024V13H2.00024V3H4.00024V2H1.50024ZM14.5002 14L15.0002 13.5L15.0002 2.5L14.5002 2H12.0002V3L14.0002 3L14.0002 13H12.0002V14H14.5002Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-boolean.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-boolean.svg
new file mode 100644
index 0000000..8cee69d
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-boolean.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M1.00024 3.5L1.50024 3H14.5002L15.0002 3.5L15.0002 12.5L14.5002 13H1.50024L1.00024 12.5V3.5ZM14.0002 4H8.00024L8.00024 7.49297L7.89818 7.49285L7.50024 7.49225V7.49237L3.92639 7.48807L6.01662 5.39784L5.30951 4.69073L2.3538 7.64645L2.3538 8.35355L5.30951 11.3093L6.01662 10.6022L3.90253 8.48807L7.89785 8.49285L8.00024 8.493V7.50702L11.9075 7.51222L9.79313 5.39784L10.5002 4.69073L13.456 7.64645V8.35355L10.5002 11.3093L9.79313 10.6022L11.8831 8.51222L8.00024 8.50702V12H14.0002V4Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-class.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-class.svg
new file mode 100644
index 0000000..7b0c2b9
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-class.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M11.3403 9.70998H12.0503L14.7202 7.04005V6.32997L13.3803 5.00001H12.6803L10.8603 6.81007H5.86024V5.56007L7.72023 3.70997V3L5.72022 1H5.00025L1.00024 5.00001V5.70997L3.00025 7.70998H3.71027L4.85023 6.56007V12.35L5.35023 12.85H10.0003V13.37L11.3303 14.71H12.0402L14.7103 12.0401V11.33L13.3703 10H12.6703L10.8103 11.85H5.81025V7.84999H10.0003V8.32997L11.3403 9.70998ZM13.0303 6.06007L13.6602 6.68995L11.6602 8.68996L11.0303 8.06007L13.0303 6.06007ZM13.0303 11.0601L13.6602 11.69L11.6602 13.69L11.0303 13.0601L13.0303 11.0601ZM3.35022 6.65004L2.06024 5.34998L5.35023 2.06006L6.65028 3.34998L3.35022 6.65004Z" fill="#D67E00"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-color.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-color.svg
new file mode 100644
index 0000000..a67efd3
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-color.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M8.00024 1.00305C6.14373 1.00305 4.36323 1.74059 3.05048 3.05334C1.73772 4.3661 1.00024 6.14654 1.00024 8.00305V8.43311C1.09024 9.94311 2.91024 10.2231 4.00024 9.13306C4.35673 8.81625 4.82078 8.64759 5.29749 8.66162C5.77419 8.67565 6.22753 8.87127 6.56476 9.2085C6.90199 9.54572 7.0976 9.99912 7.11163 10.4758C7.12567 10.9525 6.95707 11.4166 6.64026 11.7731C5.54026 12.9331 5.85025 14.843 7.44025 14.973H8.04022C9.89674 14.973 11.6772 14.2356 12.99 12.9229C14.3027 11.6101 15.0402 9.82954 15.0402 7.97302C15.0402 6.11651 14.3027 4.33607 12.99 3.02332C11.6772 1.71056 9.89674 0.973022 8.04022 0.973022L8.00024 1.00305ZM8.00024 14.0031H7.48022C7.34775 13.9989 7.22072 13.9495 7.12024 13.863C7.04076 13.7807 6.98839 13.6761 6.97021 13.5631C6.93834 13.3682 6.95353 13.1684 7.0144 12.9806C7.07528 12.7927 7.18013 12.6222 7.32025 12.483C7.84072 11.9474 8.1319 11.2299 8.1319 10.483C8.1319 9.73615 7.84072 9.0187 7.32025 8.48303C7.05373 8.21635 6.73723 8.00481 6.38892 7.86047C6.0406 7.71614 5.66726 7.64185 5.29022 7.64185C4.91318 7.64185 4.53984 7.71614 4.19153 7.86047C3.84321 8.00481 3.52678 8.21635 3.26025 8.48303C3.15093 8.61081 3.01113 8.709 2.85382 8.76843C2.69651 8.82786 2.52673 8.84657 2.36023 8.823C2.27617 8.80694 2.19927 8.76498 2.14026 8.703C2.07155 8.6224 2.0358 8.5189 2.04022 8.41309V8.04309C2.04022 6.8564 2.39216 5.69629 3.05145 4.70959C3.71074 3.7229 4.64778 2.95388 5.74414 2.49976C6.8405 2.04563 8.04693 1.92681 9.21082 2.15833C10.3747 2.38984 11.4438 2.9613 12.2829 3.80042C13.122 4.63953 13.6934 5.70867 13.9249 6.87256C14.1564 8.03644 14.0376 9.24275 13.5835 10.3391C13.1294 11.4355 12.3604 12.3726 11.3737 13.0319C10.387 13.6911 9.22691 14.0431 8.04022 14.0431L8.00024 14.0031ZM9.00024 3.99683C9.00024 4.54911 8.55253 4.99683 8.00024 4.99683C7.44796 4.99683 7.00024 4.54911 7.00024 3.99683C7.00024 3.44454 7.44796 2.99683 8.00024 2.99683C8.55253 2.99683 9.00024 3.44454 9.00024 3.99683ZM12.0002 11.0037C12.0002 11.5559 11.5525 12.0037 11.0002 12.0037C10.448 12.0037 10.0002 11.5559 10.0002 11.0037C10.0002 10.4514 10.448 10.0037 11.0002 10.0037C11.5525 10.0037 12.0002 10.4514 12.0002 11.0037ZM5.00024 6.00415C5.55253 6.00415 6.00024 5.55644 6.00024 5.00415C6.00024 4.45187 5.55253 4.00415 5.00024 4.00415C4.44796 4.00415 4.00024 4.45187 4.00024 5.00415C4.00024 5.55644 4.44796 6.00415 5.00024 6.00415ZM12.0002 5.00415C12.0002 5.55644 11.5525 6.00415 11.0002 6.00415C10.448 6.00415 10.0002 5.55644 10.0002 5.00415C10.0002 4.45187 10.448 4.00415 11.0002 4.00415C11.5525 4.00415 12.0002 4.45187 12.0002 5.00415ZM13.0003 7.99939C13.0003 8.55167 12.5526 8.99939 12.0003 8.99939C11.448 8.99939 11.0003 8.55167 11.0003 7.99939C11.0003 7.4471 11.448 6.99939 12.0003 6.99939C12.5526 6.99939 13.0003 7.4471 13.0003 7.99939Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-constant.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-constant.svg
new file mode 100644
index 0000000..5f185bc
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-constant.svg
@@ -0,0 +1,4 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M4.00024 6H12.0002V7H4.00024V6ZM12.0002 9H4.00024V10H12.0002V9Z" fill="#424242"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M1.00024 4L2.00024 3H14.0002L15.0002 4V12L14.0002 13H2.00024L1.00024 12V4ZM2.00024 4V12H14.0002V4H2.00024Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-enumerator-member.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-enumerator-member.svg
new file mode 100644
index 0000000..31d1654
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-enumerator-member.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7.00024 3L8.00024 2H14.0002L15.0002 3V8L14.0002 9H10.0002V8H14.0002V3H8.00024V6H7.00024V3ZM9.00024 9V8L8.00024 7H7.00024H2.00024L1.00024 8V13L2.00024 14H8.00024L9.00024 13V9ZM8.00024 8V9V13H2.00024V8H7.00024H8.00024ZM9.41446 7L9.00024 6.58579V6H13.0002V7H9.41446ZM9.00024 4H13.0002V5H9.00024V4ZM7.00024 10H3.00024V11H7.00024V10Z" fill="#007ACC"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-enumerator.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-enumerator.svg
new file mode 100644
index 0000000..dbbc5fd
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-enumerator.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M14.0002 2H8.00024L7.00024 3V6H8.00024V3H14.0002V8H10.0002V9H14.0002L15.0002 8V3L14.0002 2ZM9.00024 6H13.0002V7H9.41024L9.00024 6.59V6ZM7.00024 7H2.00024L1.00024 8V13L2.00024 14H8.00024L9.00024 13V8L8.00024 7H7.00024ZM8.00024 13H2.00024V8H8.00024V9V13ZM3.00024 9H7.00024V10H3.00024V9ZM3.00024 11H7.00024V12H3.00024V11ZM9.00024 4H13.0002V5H9.00024V4Z" fill="#D67E00"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-event.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-event.svg
new file mode 100644
index 0000000..31e574b
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-event.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7.41379 1.55996L8.31177 1H11.6059L12.4243 2.57465L10.2358 6H12.0176L12.7365 7.69512L5.61967 15L4.01699 13.837L6.11967 10H4.89822L4.00024 8.55996L7.41379 1.55996ZM7.78058 9L4.90078 14.3049L12.0176 7H8.31177L11.6059 2H8.31177L4.89822 9H7.78058Z" fill="#D67E00"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-field.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-field.svg
new file mode 100644
index 0000000..5151b2a
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-field.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M14.4502 4.5L9.4502 2H8.55029L1.55029 5.5L1.00024 6.39001V10.89L1.55029 11.79L6.55029 14.29H7.4502L14.4502 10.79L15.0002 9.89001V5.39001L14.4502 4.5ZM6.4502 13.14L1.9502 10.89V7.17004L6.4502 9.17004V13.14ZM6.9502 8.33997L2.29028 6.22998L8.9502 2.89001L13.6202 5.22998L6.9502 8.33997ZM13.9502 9.89001L7.4502 13.14V9.20996L13.9502 6.20996V9.89001Z" fill="#007ACC"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-file.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-file.svg
new file mode 100644
index 0000000..781e39e
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-file.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M13.8502 4.44L10.5702 1.14L10.2202 1H2.50024L2.00024 1.5V14.5L2.50024 15H13.5002L14.0002 14.5V4.8L13.8502 4.44ZM13.0002 5H10.0002V2L13.0002 5ZM3.00024 14V2H9.00024V5.5L9.50024 6H13.0002V14H3.00024Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-interface.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-interface.svg
new file mode 100644
index 0000000..3b83725
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-interface.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M11.4967 4C10.6552 3.9989 9.8416 4.30189 9.20581 4.85315C8.57002 5.40442 8.15489 6.16684 8.03674 7H4.93665C4.81495 6.52867 4.52557 6.11794 4.12268 5.84473C3.71979 5.57152 3.23108 5.45466 2.74817 5.51599C2.26526 5.57733 1.82131 5.81261 1.49951 6.17786C1.17772 6.54311 1.00024 7.01322 1.00024 7.5C1.00024 7.98679 1.17772 8.45689 1.49951 8.82215C1.82131 9.1874 2.26526 9.42267 2.74817 9.48401C3.23108 9.54535 3.71979 9.42848 4.12268 9.15528C4.52557 8.88207 4.81495 8.47133 4.93665 8H8.03674C8.13261 8.66418 8.41741 9.28683 8.85718 9.7937C9.29695 10.3006 9.87308 10.6703 10.5171 10.8589C11.1611 11.0475 11.8458 11.047 12.4895 10.8574C13.1332 10.6679 13.7089 10.2973 14.1479 9.7898C14.587 9.28227 14.8708 8.65919 14.9657 7.99488C15.0606 7.33056 14.9624 6.65298 14.683 6.04285C14.4036 5.43272 13.9547 4.91578 13.3898 4.55359C12.8248 4.19141 12.1678 3.99922 11.4967 4V4ZM11.4967 10C11.0023 10 10.5189 9.85332 10.1078 9.57862C9.69667 9.30391 9.37623 8.91348 9.18701 8.45667C8.99779 7.99985 8.94834 7.49728 9.0448 7.01233C9.14126 6.52738 9.37925 6.08181 9.72888 5.73218C10.0785 5.38255 10.5241 5.14456 11.009 5.0481C11.494 4.95164 11.9966 5.00109 12.4534 5.19031C12.9102 5.37953 13.3006 5.69996 13.5753 6.11109C13.85 6.52221 13.9967 7.00555 13.9967 7.5C13.9967 8.16304 13.7334 8.79898 13.2645 9.26783C12.7957 9.73667 12.1597 10 11.4967 10V10Z" fill="#007ACC"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-key.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-key.svg
new file mode 100644
index 0000000..6af4c1a
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-key.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7.22313 10.933C7.54888 11.1254 7.92188 11.2231 8.30013 11.215C8.63802 11.2218 8.97279 11.1492 9.27746 11.003C9.58213 10.8567 9.84817 10.6409 10.0541 10.373C10.5094 9.76519 10.7404 9.01867 10.7081 8.25998C10.7414 7.58622 10.5376 6.9221 10.1321 6.38298C9.93599 6.14161 9.68601 5.94957 9.40225 5.82228C9.11848 5.69498 8.80883 5.63597 8.49813 5.64997C8.07546 5.64699 7.66018 5.76085 7.29813 5.97898C7.18328 6.04807 7.07515 6.12775 6.97513 6.21698V3.47498H5.98413V11.1H6.97913V10.756C7.0554 10.8217 7.13702 10.8809 7.22313 10.933ZM7.85005 6.70006C8.03622 6.62105 8.23832 6.58677 8.44013 6.59998C8.61281 6.59452 8.78429 6.63054 8.94018 6.70501C9.09608 6.77948 9.23185 6.89023 9.33613 7.02798C9.59277 7.39053 9.71865 7.82951 9.69313 8.27297C9.71996 8.79748 9.57993 9.31701 9.29313 9.75698C9.18846 9.91527 9.04571 10.0447 8.87797 10.1335C8.71023 10.2223 8.52289 10.2675 8.33313 10.265C8.14958 10.2732 7.96654 10.24 7.79758 10.1678C7.62862 10.0956 7.47809 9.98628 7.35713 9.84797C7.10176 9.55957 6.96525 9.18506 6.97513 8.79998V8.19998C6.96324 7.78332 7.10287 7.3765 7.36813 7.05498C7.49883 6.90064 7.66388 6.77908 7.85005 6.70006ZM3.28926 5.67499C2.97035 5.67933 2.65412 5.734 2.35226 5.83699C2.06442 5.92293 1.79372 6.05828 1.55226 6.23699L1.45226 6.31399V7.51399L1.87526 7.15499C2.24603 6.80478 2.73158 6.60146 3.24126 6.58299C3.36617 6.57164 3.49194 6.59147 3.60731 6.64068C3.72267 6.6899 3.82402 6.76697 3.90226 6.86499C4.05245 7.0971 4.13264 7.36754 4.13326 7.64399L2.90026 7.82499C2.39459 7.87781 1.9155 8.07772 1.52226 8.39999C1.36721 8.55181 1.24363 8.73271 1.15859 8.93235C1.07355 9.13199 1.02873 9.34644 1.02668 9.56343C1.02464 9.78042 1.06542 9.99568 1.14668 10.1969C1.22795 10.3981 1.3481 10.5813 1.50026 10.736C1.66895 10.8904 1.86647 11.01 2.08149 11.0879C2.29651 11.1659 2.5248 11.2005 2.75326 11.19C3.14725 11.1931 3.53302 11.0774 3.86026 10.858C3.96178 10.7897 4.05744 10.7131 4.14626 10.629V11.073H5.08726V7.71499C5.12161 7.17422 4.95454 6.63988 4.61826 6.21499C4.45004 6.03285 4.24373 5.89003 4.01402 5.7967C3.78431 5.70336 3.53686 5.66181 3.28926 5.67499ZM4.14626 8.71599C4.16588 9.13435 4.02616 9.54459 3.75526 9.864C3.63714 10.0005 3.49023 10.1092 3.3251 10.1821C3.15998 10.2551 2.98073 10.2906 2.80026 10.286C2.69073 10.2945 2.5806 10.2812 2.47624 10.2469C2.37187 10.2125 2.27536 10.1579 2.19226 10.086C2.06104 9.93455 1.9888 9.74088 1.9888 9.54049C1.9888 9.34011 2.06104 9.14644 2.19226 8.99499C2.47347 8.82131 2.79258 8.71837 3.12226 8.69499L4.14226 8.54699L4.14626 8.71599ZM12.459 11.0325C12.7663 11.1638 13.0985 11.2261 13.4324 11.215C13.9273 11.227 14.4156 11.1006 14.8424 10.85L14.9654 10.775L14.9784 10.768V9.61504L14.5324 9.93504C14.2163 10.1592 13.8359 10.2747 13.4484 10.264C13.2499 10.2719 13.0522 10.2342 12.8705 10.1538C12.6889 10.0733 12.5281 9.95232 12.4004 9.80004C12.1146 9.42453 11.9728 8.95911 12.0004 8.48804C11.9739 7.98732 12.1355 7.49475 12.4534 7.10704C12.5936 6.94105 12.7698 6.80914 12.9685 6.7213C13.1672 6.63346 13.3833 6.592 13.6004 6.60004C13.9441 6.59844 14.281 6.69525 14.5714 6.87904L15.0004 7.14404V5.97004L14.8314 5.89704C14.4628 5.73432 14.0644 5.6502 13.6614 5.65004C13.3001 5.63991 12.9409 5.70762 12.608 5.84859C12.2752 5.98956 11.9766 6.20048 11.7324 6.46704C11.2263 7.02683 10.9584 7.76186 10.9854 8.51604C10.9569 9.22346 11.1958 9.91569 11.6544 10.455C11.8772 10.704 12.1518 10.9012 12.459 11.0325Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-keyword.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-keyword.svg
new file mode 100644
index 0000000..e040064
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-keyword.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M15.0002 4H10.0002V3H15.0002V4ZM14.0002 7H12.0002V8H14.0002V7ZM10.0002 7H1.00024V8H10.0002V7ZM12.0002 13H1.00024V14H12.0002V13ZM7.00024 10H1.00024V11H7.00024V10ZM15.0002 10H10.0002V11H15.0002V10ZM8.00024 2V5H1.00024V2H8.00024ZM7.00024 3H2.00024V4H7.00024V3Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-method.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-method.svg
new file mode 100644
index 0000000..f922a9a
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-method.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M13.5103 4L8.51025 1H7.51025L2.51025 4L2.02026 4.85999V10.86L2.51025 11.71L7.51025 14.71H8.51025L13.5103 11.71L14.0002 10.86V4.85999L13.5103 4ZM7.51025 13.5601L3.01025 10.86V5.69995L7.51025 8.15002V13.5601ZM3.27026 4.69995L8.01025 1.85999L12.7502 4.69995L8.01025 7.29004L3.27026 4.69995ZM13.0103 10.86L8.51025 13.5601V8.15002L13.0103 5.69995V10.86Z" fill="#652D90"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-misc.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-misc.svg
new file mode 100644
index 0000000..57467b3
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-misc.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M4.00024 2H12.0002V6C12.3418 6.03511 12.6777 6.11234 13.0002 6.22998V1H3.00024V9.47998L4.00024 7.72998V2ZM6.14026 10L5.00024 8L4.00024 9.75L3.29028 11L1.00024 15H9.00024L6.71021 11L6.14026 10ZM2.72021 14L4.44019 11L5.00024 10L5.5603 11L7.28027 14H2.72021ZM9.55577 7.58984C10.1313 7.20526 10.808 7 11.5002 7C12.4285 7 13.3187 7.36877 13.9751 8.02515C14.6315 8.68152 15.0002 9.57174 15.0002 10.5C15.0002 11.1922 14.795 11.8689 14.4104 12.4445C14.0258 13.02 13.4791 13.4686 12.8396 13.7335C12.2 13.9984 11.4963 14.0678 10.8174 13.9327C10.1384 13.7977 9.51485 13.4643 9.02537 12.9749C8.53589 12.4854 8.20253 11.8618 8.06748 11.1829C7.93244 10.5039 8.0018 9.80019 8.2667 9.16064C8.53161 8.5211 8.98019 7.97443 9.55577 7.58984ZM10.1113 12.5786C10.5224 12.8533 11.0058 13 11.5002 13C12.1633 13 12.7992 12.7367 13.268 12.2678C13.7369 11.799 14.0002 11.163 14.0002 10.5C14.0002 10.0055 13.8535 9.52221 13.5788 9.11108C13.3041 8.69996 12.9137 8.37953 12.4569 8.19031C12.0001 8.00109 11.4975 7.95163 11.0126 8.0481C10.5276 8.14456 10.082 8.38255 9.7324 8.73218C9.38277 9.08181 9.14478 9.52738 9.04832 10.0123C8.95186 10.4973 9.00131 10.9998 9.19053 11.4567C9.37975 11.9135 9.70018 12.3039 10.1113 12.5786Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-namespace.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-namespace.svg
new file mode 100644
index 0000000..8d1c0f4
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-namespace.svg
@@ -0,0 +1,10 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0)">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M6.00024 2.98361V2.97184V2H5.91107C5.59767 2 5.29431 2.06161 5.00152 2.18473C4.70842 2.30798 4.44967 2.48474 4.22602 2.71498C4.00336 2.94422 3.83816 3.19498 3.73306 3.46766L3.73257 3.46898C3.63406 3.7352 3.56839 4.01201 3.53557 4.29917L3.53543 4.30053C3.50702 4.5805 3.49894 4.86844 3.51108 5.16428C3.52297 5.45379 3.52891 5.74329 3.52891 6.03279C3.52891 6.23556 3.48999 6.42594 3.41225 6.60507L3.41185 6.60601C3.33712 6.78296 3.23447 6.93866 3.10341 7.07359C2.97669 7.20405 2.8249 7.31055 2.64696 7.3925C2.47084 7.46954 2.28522 7.5082 2.08942 7.5082H2.00024V7.6V8.4V8.4918H2.08942C2.2849 8.4918 2.47026 8.53238 2.64625 8.61334L2.64766 8.61396C2.82482 8.69157 2.97602 8.79762 3.10245 8.93161L3.10436 8.93352C3.23452 9.0637 3.33684 9.21871 3.41153 9.39942L3.41225 9.40108C3.49011 9.58047 3.52891 9.76883 3.52891 9.96721C3.52891 10.2567 3.52297 10.5462 3.51108 10.8357C3.49894 11.1316 3.50701 11.4215 3.5354 11.7055L3.5356 11.7072C3.56844 11.9903 3.63412 12.265 3.73256 12.531L3.73307 12.5323C3.83817 12.805 4.00336 13.0558 4.22602 13.285C4.44967 13.5153 4.70842 13.692 5.00152 13.8153C5.29431 13.9384 5.59767 14 5.91107 14H6.00024V13.2V13.0164H5.91107C5.71119 13.0164 5.52371 12.9777 5.34787 12.9008C5.17421 12.8191 5.02218 12.7126 4.89111 12.5818C4.76411 12.4469 4.66128 12.2911 4.58247 12.1137C4.50862 11.9346 4.47158 11.744 4.47158 11.541C4.47158 11.3127 4.47554 11.0885 4.48346 10.8686C4.49149 10.6411 4.49151 10.4195 4.48349 10.2039C4.47938 9.98246 4.46109 9.76883 4.42847 9.56312C4.39537 9.35024 4.33946 9.14757 4.26063 8.95536C4.18115 8.76157 4.07282 8.57746 3.9364 8.40298C3.8237 8.25881 3.68563 8.12462 3.52307 8C3.68563 7.87538 3.8237 7.74119 3.9364 7.59702C4.07282 7.42254 4.18115 7.23843 4.26063 7.04464C4.33938 6.85263 4.39537 6.65175 4.4285 6.44285C4.46107 6.2333 4.47938 6.01973 4.48349 5.80219C4.49151 5.58262 4.4915 5.36105 4.48345 5.13749C4.47554 4.9134 4.47158 4.68725 4.47158 4.45902C4.47158 4.26019 4.50857 4.07152 4.58263 3.89205C4.6616 3.71034 4.76445 3.55475 4.8911 3.42437C5.02218 3.28942 5.17485 3.18275 5.34826 3.10513C5.52404 3.02427 5.71138 2.98361 5.91107 2.98361H6.00024ZM10.0002 13.0164V13.0282V14H10.0894C10.4028 14 10.7062 13.9384 10.999 13.8153C11.2921 13.692 11.5508 13.5153 11.7745 13.285C11.9971 13.0558 12.1623 12.805 12.2674 12.5323L12.2679 12.531C12.3664 12.2648 12.4321 11.988 12.4649 11.7008L12.4651 11.6995C12.4935 11.4195 12.5015 11.1316 12.4894 10.8357C12.4775 10.5462 12.4716 10.2567 12.4716 9.96721C12.4716 9.76444 12.5105 9.57406 12.5882 9.39493L12.5886 9.39399C12.6634 9.21704 12.766 9.06134 12.8971 8.92642C13.0238 8.79595 13.1756 8.68945 13.3535 8.6075C13.5296 8.53046 13.7153 8.4918 13.9111 8.4918H14.0002V8.4V7.6V7.5082H13.9111C13.7156 7.5082 13.5302 7.46762 13.3542 7.38666L13.3528 7.38604C13.1757 7.30844 13.0245 7.20238 12.898 7.06839L12.8961 7.06648C12.766 6.9363 12.6637 6.78129 12.589 6.60058L12.5882 6.59892C12.5104 6.41953 12.4716 6.23117 12.4716 6.03279C12.4716 5.74329 12.4775 5.45379 12.4894 5.16428C12.5015 4.86842 12.4935 4.57848 12.4651 4.29454L12.4649 4.29285C12.4321 4.00971 12.3664 3.73502 12.2679 3.46897L12.2674 3.46766C12.1623 3.19499 11.9971 2.94422 11.7745 2.71498C11.5508 2.48474 11.2921 2.30798 10.999 2.18473C10.7062 2.06161 10.4028 2 10.0894 2H10.0002V2.8V2.98361H10.0894C10.2893 2.98361 10.4768 3.0223 10.6526 3.09917C10.8263 3.18092 10.9783 3.28736 11.1094 3.41823C11.2364 3.55305 11.3392 3.70889 11.418 3.88628C11.4919 4.0654 11.5289 4.25596 11.5289 4.45902C11.5289 4.68727 11.5249 4.91145 11.517 5.13142C11.509 5.35894 11.509 5.58049 11.517 5.79605C11.5211 6.01754 11.5394 6.23117 11.572 6.43688C11.6051 6.64976 11.661 6.85243 11.7399 7.04464C11.8193 7.23843 11.9277 7.42254 12.0641 7.59702C12.1768 7.74119 12.3149 7.87538 12.4774 8C12.3149 8.12462 12.1768 8.25881 12.0641 8.40298C11.9277 8.57746 11.8193 8.76157 11.7399 8.95536C11.6611 9.14737 11.6051 9.34825 11.572 9.55715C11.5394 9.7667 11.5211 9.98027 11.517 10.1978C11.509 10.4174 11.509 10.6389 11.517 10.8625C11.5249 11.0866 11.5289 11.3128 11.5289 11.541C11.5289 11.7398 11.4919 11.9285 11.4179 12.1079C11.3389 12.2897 11.236 12.4452 11.1094 12.5756C10.9783 12.7106 10.8256 12.8173 10.6522 12.8949C10.4764 12.9757 10.2891 13.0164 10.0894 13.0164H10.0002Z" fill="#424242"/>
+</g>
+<defs>
+<clipPath id="clip0">
+<rect width="16" height="16" fill="white" transform="translate(0.000244141)"/>
+</clipPath>
+</defs>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-numeric.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-numeric.svg
new file mode 100644
index 0000000..0ab24fa
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-numeric.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M11.0002 1V5H15.0002V6H11.0002L11.0002 10H15.0002V11H11.0002V15H10.0002V11H6.00024V15H5.00024L5.00024 11H1.00024V10H5.00024L5.00024 6H1.00024V5H5.00024L5.00024 1H6.00024V5H10.0002V1H11.0002ZM6.00024 6L6.00024 10H10.0002L10.0002 6H6.00024Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-operator.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-operator.svg
new file mode 100644
index 0000000..23d0d19
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-operator.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2.87313 1.10023C3.20793 1.23579 3.4757 1.498 3.61826 1.82988C3.69056 1.99959 3.72699 2.18242 3.72526 2.36688C3.72642 2.54999 3.69 2.7314 3.61826 2.89988C3.51324 3.14567 3.33807 3.35503 3.11466 3.50177C2.89126 3.64851 2.62955 3.72612 2.36226 3.72488C2.17948 3.72592 1.99842 3.68951 1.83026 3.61788C1.58322 3.51406 1.37252 3.33932 1.22478 3.11575C1.07704 2.89219 0.99891 2.62984 1.00026 2.36188C0.999374 2.17921 1.03543 1.99825 1.10626 1.82988C1.24362 1.50314 1.50353 1.24323 1.83026 1.10588C2.16357 0.966692 2.53834 0.964661 2.87313 1.10023ZM2.57526 2.86488C2.70564 2.80913 2.80951 2.70526 2.86526 2.57488C2.89314 2.50838 2.90742 2.43698 2.90726 2.36488C2.90838 2.2654 2.88239 2.1675 2.8321 2.08167C2.7818 1.99584 2.70909 1.92531 2.62176 1.87767C2.53443 1.83002 2.43577 1.80705 2.33638 1.81121C2.23698 1.81537 2.1406 1.8465 2.05755 1.90128C1.97451 1.95606 1.90794 2.03241 1.865 2.12215C1.82205 2.21188 1.80434 2.31161 1.81376 2.41065C1.82319 2.50968 1.85939 2.60428 1.9185 2.6843C1.9776 2.76433 2.05738 2.82675 2.14926 2.86488C2.28574 2.92089 2.43878 2.92089 2.57526 2.86488ZM6.43019 1.1095L1.10992 6.42977L1.79581 7.11567L7.11608 1.7954L6.43019 1.1095ZM11.5002 8.99999H12.5002V11.5H15.0002V12.5H12.5002V15H11.5002V12.5H9.00024V11.5H11.5002V8.99999ZM5.76801 9.52509L6.47512 10.2322L4.70735 12L6.47512 13.7677L5.76801 14.4748L4.00024 12.7071L2.23248 14.4748L1.52537 13.7677L3.29314 12L1.52537 10.2322L2.23248 9.52509L4.00024 11.2929L5.76801 9.52509ZM7.11826 5.32988C7.01466 5.08268 6.83997 4.87183 6.61636 4.72406C6.39275 4.57629 6.13028 4.49826 5.86226 4.49988C5.6796 4.49899 5.49864 4.53505 5.33026 4.60588C5.00353 4.74323 4.74362 5.00314 4.60626 5.32988C4.53612 5.49478 4.49922 5.67191 4.49766 5.8511C4.4961 6.0303 4.52992 6.20804 4.59718 6.37414C4.66443 6.54024 4.76381 6.69143 4.88961 6.81906C5.0154 6.94669 5.16515 7.04823 5.33026 7.11788C5.49892 7.18848 5.67993 7.22484 5.86276 7.22484C6.0456 7.22484 6.22661 7.18848 6.39526 7.11788C6.64225 7.01388 6.85295 6.83913 7.00082 6.61563C7.1487 6.39213 7.22713 6.12987 7.22626 5.86188C7.22679 5.67905 7.19005 5.49803 7.11826 5.32988ZM6.36526 6.07488C6.3379 6.13937 6.29854 6.19808 6.24926 6.24788C6.19932 6.29724 6.14066 6.33691 6.07626 6.36488C6.00878 6.39297 5.93635 6.40725 5.86326 6.40688C5.79015 6.40744 5.71769 6.39315 5.65026 6.36488C5.58565 6.33729 5.52693 6.29757 5.47726 6.24788C5.42715 6.19856 5.38738 6.13975 5.36026 6.07488C5.30425 5.9384 5.30425 5.78536 5.36026 5.64888C5.41561 5.51846 5.51965 5.41477 5.65026 5.35988C5.71761 5.33126 5.79008 5.31663 5.86326 5.31688C5.93642 5.31685 6.00884 5.33147 6.07626 5.35988C6.14062 5.38749 6.19928 5.42682 6.24926 5.47588C6.2981 5.52603 6.33741 5.58465 6.36526 5.64888C6.39364 5.7163 6.40827 5.78872 6.40827 5.86188C6.40827 5.93503 6.39364 6.00745 6.36526 6.07488ZM14.0002 3H10.0002V4H14.0002V3Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-parameter.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-parameter.svg
new file mode 100644
index 0000000..940524d
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-parameter.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M11.0003 6H10.0003V5.5C10.0003 5.22386 9.7764 5 9.50026 5H8.47926V10.5C8.47926 10.7761 8.70312 11 8.97926 11H9.47926V12H6.47926V11H6.97926C7.2554 11 7.47926 10.7761 7.47926 10.5V5H6.50026C6.22412 5 6.00026 5.22386 6.00026 5.5V6H5.00026V4H11.0003V6ZM13.9145 8.0481L12.4522 6.58581L13.1593 5.87871L14.9751 7.69454V8.40165L13.2074 10.1694L12.5003 9.46231L13.9145 8.0481ZM3.54835 9.4623L2.08605 8.00002L3.50026 6.58581L2.79316 5.8787L1.02539 7.64647V8.35357L2.84124 10.1694L3.54835 9.4623Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-property.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-property.svg
new file mode 100644
index 0000000..efffad4
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-property.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M2.80747 14.9754C2.57144 14.9721 2.33851 14.9211 2.12271 14.8254C1.90692 14.7297 1.71273 14.5913 1.55183 14.4186C1.23875 14.1334 1.04458 13.7408 1.00799 13.3189C0.966469 12.8828 1.09293 12.4473 1.36158 12.1013C2.56804 10.8289 4.94755 8.4494 6.67836 6.75479C6.31007 5.75887 6.32729 4.66127 6.72661 3.67739C7.05499 2.85876 7.63893 2.16805 8.39153 1.70807C8.98195 1.31706 9.66055 1.07944 10.3659 1.01673C11.0713 0.954022 11.7812 1.06819 12.4313 1.34892L13.0485 1.6162L10.1827 4.56738L11.4374 5.82582L14.3811 2.94887L14.6484 3.56788C14.8738 4.08976 14.9933 4.65119 14.9999 5.21961C15.0066 5.78802 14.9004 6.35211 14.6874 6.87915C14.4763 7.40029 14.1626 7.87368 13.7649 8.27122C13.5396 8.49169 13.2907 8.68653 13.0225 8.85218C12.4676 9.22275 11.8327 9.45636 11.1699 9.5338C10.5071 9.61124 9.83546 9.5303 9.21007 9.29764C8.11219 10.4113 5.37167 13.1704 3.89143 14.5522C3.5945 14.8219 3.20856 14.9726 2.80747 14.9754ZM10.7451 1.92802C10.0873 1.92637 9.44383 2.12018 8.89639 2.48485C8.68289 2.6152 8.48461 2.76897 8.30522 2.9433C7.82813 3.42423 7.5095 4.03953 7.39206 4.70669C7.27462 5.37385 7.36398 6.06098 7.64816 6.67591L7.78366 6.97288L7.55072 7.20025C5.81249 8.89672 3.28171 11.4201 2.06504 12.7045C1.9567 12.8658 1.91037 13.0608 1.93459 13.2535C1.95881 13.4463 2.05195 13.6238 2.19682 13.7532C2.28029 13.8462 2.38201 13.9211 2.49565 13.9731C2.59581 14.0184 2.70408 14.043 2.81397 14.0455C2.98089 14.0413 3.14068 13.977 3.26407 13.8646C4.83711 12.3964 7.87646 9.32641 8.76832 8.42435L8.99754 8.19326L9.29266 8.32783C9.80642 8.56732 10.3734 8.66985 10.9385 8.62545C11.5036 8.58106 12.0476 8.39125 12.5176 8.07447C12.7316 7.9426 12.9299 7.78694 13.1088 7.61045C13.4186 7.30153 13.6634 6.93374 13.8288 6.52874C13.9943 6.12375 14.077 5.68974 14.0721 5.25228C14.0722 5.03662 14.0507 4.82148 14.0081 4.61007L11.4309 7.12508L8.87968 4.57759L11.3947 1.98834C11.1807 1.94674 10.9631 1.92653 10.7451 1.92802Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-ruler.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-ruler.svg
new file mode 100644
index 0000000..0a0b9a4
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-ruler.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M4.00024 1L3.00024 2V14L4.00024 15H12.0002L13.0002 14V2L12.0002 1H4.00024ZM4.00024 3V2H12.0002V14H4.00024V13H6.00024V12H4.00024V10H8.00024V9H4.00024V7H6.00024V6H4.00024V4H8.00024V3H4.00024Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-snippet.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-snippet.svg
new file mode 100644
index 0000000..ebb8a11
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-snippet.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2.50024 1L2.00024 1.5V13H3.00024V2H14.0002V13H15.0002V1.5L14.5002 1H2.50024ZM2.00024 15V14H3.00024V15H2.00024ZM5.00024 14.0001H4.00024V15.0001H5.00024V14.0001ZM6.00024 14.0001H7.00024V15.0001H6.00024V14.0001ZM9.00024 14.0001H8.00024V15.0001H9.00024V14.0001ZM10.0002 14.0001H11.0002V15.0001H10.0002V14.0001ZM15.0002 15.0001V14.0001H14.0002V15.0001H15.0002ZM12.0002 14.0001H13.0002V15.0001H12.0002V14.0001Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-string.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-string.svg
new file mode 100644
index 0000000..2fabca5
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-string.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2.00024 2L1.00024 3V12L2.00024 13H14.0002L15.0002 12V3L14.0002 2H2.00024ZM2.00024 12V3H14.0002V12H2.00024ZM5.35585 8.93017H6.00024V7.22067C6.00024 6.40689 5.68559 6 5.05628 6C4.92122 6 4.77108 6.02421 4.60585 6.07263C4.44205 6.12104 4.31274 6.17691 4.21792 6.24022V6.90503C4.45499 6.70205 4.70499 6.60056 4.96792 6.60056C5.22941 6.60056 5.36016 6.75698 5.36016 7.06983L4.76102 7.17318C4.25384 7.25885 4.00024 7.57914 4.00024 8.13408C4.00024 8.39665 4.06131 8.60708 4.18343 8.76536C4.307 8.92179 4.47582 9 4.6899 9C4.98013 9 5.19924 8.83985 5.34723 8.51955H5.35585V8.93017ZM5.36016 7.57542V7.76816C5.36016 7.9432 5.31993 8.08845 5.23947 8.20391C5.15901 8.3175 5.05484 8.3743 4.92697 8.3743C4.83501 8.3743 4.76174 8.34264 4.70714 8.27933C4.65398 8.21415 4.6274 8.13128 4.6274 8.03073C4.6274 7.80912 4.73803 7.6797 4.9593 7.64246L5.36016 7.57542ZM7.60118 8.62622H7.59367V8.93511H7.00024V5H7.59367V6.67683H7.60118C7.74766 6.36708 7.95611 6.2122 8.22653 6.2122C8.47442 6.2122 8.66535 6.32987 8.7993 6.56522C8.93326 6.80056 9.00024 7.12243 9.00024 7.53082C9.00024 7.97383 8.922 8.32944 8.7655 8.59766C8.60901 8.86589 8.39993 9 8.13827 9C7.90165 9 7.72262 8.87541 7.60118 8.62622ZM7.58428 7.50487V7.77742C7.58428 7.94873 7.61996 8.09063 7.69132 8.20311C7.76269 8.3156 7.85408 8.37184 7.9655 8.37184C8.10071 8.37184 8.20525 8.30002 8.27912 8.15639C8.35423 8.01103 8.39179 7.80597 8.39179 7.54121C8.39179 7.32144 8.35736 7.15012 8.28851 7.02726C8.2209 6.90266 8.12387 6.84036 7.99743 6.84036C7.87849 6.84036 7.77959 6.9018 7.70071 7.02466C7.62309 7.14752 7.58428 7.30759 7.58428 7.50487ZM11.2619 9C11.5837 9 11.8298 8.94227 12.0002 8.82682V8.11732C11.8202 8.25512 11.6362 8.32402 11.4483 8.32402C11.2364 8.32402 11.0699 8.25233 10.9489 8.10894C10.8278 7.96369 10.7673 7.76443 10.7673 7.51117C10.7673 7.25047 10.8302 7.04656 10.956 6.89944C11.0835 6.75047 11.2555 6.67598 11.4722 6.67598C11.6665 6.67598 11.8425 6.74488 12.0002 6.88268V6.13408C11.8712 6.04469 11.6625 6 11.3742 6C10.9568 6 10.6231 6.1406 10.373 6.42179C10.1245 6.70112 10.0002 7.0838 10.0002 7.56983C10.0002 7.99069 10.1165 8.33426 10.3491 8.60056C10.5817 8.86685 10.8859 9 11.2619 9Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-structure.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-structure.svg
new file mode 100644
index 0000000..2b8c0d9
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-structure.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2.00024 2L1.00024 3V6L2.00024 7H14.0002L15.0002 6V3L14.0002 2H2.00024ZM2.00024 3H3.00024H13.0002H14.0002V4V5V6H13.0002H3.00024H2.00024V5V4V3ZM1.00024 10L2.00024 9H5.00024L6.00024 10V13L5.00024 14H2.00024L1.00024 13V10ZM3.00024 10H2.00024V11V12V13H3.00024H4.00024H5.00024V12V11V10H4.00024H3.00024ZM10.0002 10L11.0002 9H14.0002L15.0002 10V13L14.0002 14H11.0002L10.0002 13V10ZM12.0002 10H11.0002V11V12V13H12.0002H13.0002H14.0002V12V11V10H13.0002H12.0002Z" fill="#424242"/>
+</svg>
diff --git a/elpa/company-20220326.48/icons/vscode-light/symbol-variable.svg b/elpa/company-20220326.48/icons/vscode-light/symbol-variable.svg
new file mode 100644
index 0000000..3656d9e
--- /dev/null
+++ b/elpa/company-20220326.48/icons/vscode-light/symbol-variable.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2.00024 5H4.00024V4H1.50024L1.00024 4.5V12.5L1.50024 13H4.00024V12H2.00024V5ZM14.5002 4H12.0002V5H14.0002V12H12.0002V13H14.5002L15.0002 12.5V4.5L14.5002 4ZM11.7603 6.56995L12.0002 7V9.51001L11.7002 9.95996L7.2002 11.96H6.74023L4.24023 10.46L4.00024 10.03V7.53003L4.30029 7.06995L8.80029 5.06995H9.26025L11.7603 6.56995ZM5.00024 9.70996L6.50024 10.61V9.28003L5.00024 8.38V9.70996ZM5.5802 7.56006L7.03027 8.43005L10.4203 6.93005L8.97021 6.06006L5.5802 7.56006ZM7.53027 10.73L11.0303 9.17004V7.77002L7.53027 9.31995V10.73Z" fill="#007ACC"/>
+</svg>
diff --git a/elpa/company-20220326.48/images/small/echo-meta.png b/elpa/company-20220326.48/images/small/echo-meta.png
new file mode 100755
index 0000000..7f4f079
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/echo-meta.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/echo-qa.png b/elpa/company-20220326.48/images/small/echo-qa.png
new file mode 100755
index 0000000..8d924a7
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/echo-qa.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/echo-strip-qa.png b/elpa/company-20220326.48/images/small/echo-strip-qa.png
new file mode 100755
index 0000000..3a4b986
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/echo-strip-qa.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/echo-strip.png b/elpa/company-20220326.48/images/small/echo-strip.png
new file mode 100755
index 0000000..7909842
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/echo-strip.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/echo.png b/elpa/company-20220326.48/images/small/echo.png
new file mode 100755
index 0000000..5150239
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/echo.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/preview-dark.png b/elpa/company-20220326.48/images/small/preview-dark.png
new file mode 100755
index 0000000..80c1701
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/preview-dark.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/preview-light.png b/elpa/company-20220326.48/images/small/preview-light.png
new file mode 100755
index 0000000..eb93189
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/preview-light.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-annotations.png b/elpa/company-20220326.48/images/small/tooltip-annotations.png
new file mode 100755
index 0000000..0a75fe8
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-annotations.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-faces-light.png b/elpa/company-20220326.48/images/small/tooltip-faces-light.png
new file mode 100755
index 0000000..165ba68
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-faces-light.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-filter.png b/elpa/company-20220326.48/images/small/tooltip-filter.png
new file mode 100755
index 0000000..a2a873d
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-filter.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-flip.png b/elpa/company-20220326.48/images/small/tooltip-flip.png
new file mode 100755
index 0000000..16d1f60
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-flip.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-icon-bg.png b/elpa/company-20220326.48/images/small/tooltip-icon-bg.png
new file mode 100755
index 0000000..57114cf
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-icon-bg.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-icon-face.png b/elpa/company-20220326.48/images/small/tooltip-icon-face.png
new file mode 100755
index 0000000..dcf2c9d
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-icon-face.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-icons-dot.png b/elpa/company-20220326.48/images/small/tooltip-icons-dot.png
new file mode 100755
index 0000000..b27d270
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-icons-dot.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-icons-text.png b/elpa/company-20220326.48/images/small/tooltip-icons-text.png
new file mode 100755
index 0000000..c2dfc19
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-icons-text.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-icons-vscode.png b/elpa/company-20220326.48/images/small/tooltip-icons-vscode.png
new file mode 100755
index 0000000..55acda1
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-icons-vscode.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-limit.png b/elpa/company-20220326.48/images/small/tooltip-limit.png
new file mode 100755
index 0000000..e52630d
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-limit.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-margin.png b/elpa/company-20220326.48/images/small/tooltip-margin.png
new file mode 100755
index 0000000..dd440ce
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-margin.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-minimum-above.png b/elpa/company-20220326.48/images/small/tooltip-minimum-above.png
new file mode 100644
index 0000000..0052ca5
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-minimum-above.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-minimum-below.png b/elpa/company-20220326.48/images/small/tooltip-minimum-below.png
new file mode 100644
index 0000000..c7b3f19
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-minimum-below.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-offset-display.png b/elpa/company-20220326.48/images/small/tooltip-offset-display.png
new file mode 100755
index 0000000..c70276c
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-offset-display.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-qa-faces-light.png b/elpa/company-20220326.48/images/small/tooltip-qa-faces-light.png
new file mode 100755
index 0000000..d089a56
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-qa-faces-light.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-quick-access.png b/elpa/company-20220326.48/images/small/tooltip-quick-access.png
new file mode 100755
index 0000000..f675cb0
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-quick-access.png
Binary files differ
diff --git a/elpa/company-20220326.48/images/small/tooltip-search.png b/elpa/company-20220326.48/images/small/tooltip-search.png
new file mode 100755
index 0000000..eda6726
--- /dev/null
+++ b/elpa/company-20220326.48/images/small/tooltip-search.png
Binary files differ
diff --git a/elpa/company-irony-20190124.2346/company-irony-autoloads.el b/elpa/company-irony-20190124.2346/company-irony-autoloads.el
new file mode 100644
index 0000000..9d180d1
--- /dev/null
+++ b/elpa/company-irony-20190124.2346/company-irony-autoloads.el
@@ -0,0 +1,36 @@
+;;; company-irony-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "company-irony" "company-irony.el" (0 0 0 0))
+;;; Generated autoloads from company-irony.el
+
+(autoload 'company-irony "company-irony" "\
+
+
+\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
+
+(autoload 'company-irony-setup-begin-commands "company-irony" "\
+Include irony trigger commands to `company-begin-commands'.
+
+This allow completion to be automatically triggered after member
+accesses (obj.|, obj->|, ...).
+
+This may be useful to company < `0.8.4', newer version of company
+include these commands by default." nil nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-irony" '("company-irony-")))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; company-irony-autoloads.el ends here
diff --git a/elpa/company-irony-20190124.2346/company-irony-pkg.el b/elpa/company-irony-20190124.2346/company-irony-pkg.el
new file mode 100644
index 0000000..c671865
--- /dev/null
+++ b/elpa/company-irony-20190124.2346/company-irony-pkg.el
@@ -0,0 +1,2 @@
+;;; Generated package description from company-irony.el -*- no-byte-compile: t -*-
+(define-package "company-irony" "20190124.2346" "company-mode completion back-end for irony-mode" '((emacs "24.1") (company "0.8.0") (irony "1.1.0") (cl-lib "0.5")) :commit "b44711dfce445610c1ffaec4951c6ff3882b216a" :authors '(("Guillaume Papin" . "guillaume.papin@epitech.eu")) :maintainer '("Guillaume Papin" . "guillaume.papin@epitech.eu") :keywords '("convenience") :url "https://github.com/Sarcasm/company-irony/")
diff --git a/elpa/company-irony-20190124.2346/company-irony.el b/elpa/company-irony-20190124.2346/company-irony.el
new file mode 100644
index 0000000..f25b0fd
--- /dev/null
+++ b/elpa/company-irony-20190124.2346/company-irony.el
@@ -0,0 +1,158 @@
+;;; company-irony.el --- company-mode completion back-end for irony-mode -*- lexical-binding: t -*-
+
+;; Copyright (C) 2014 Guillaume Papin
+
+;; Author: Guillaume Papin <guillaume.papin@epitech.eu>
+;; Keywords: convenience
+;; Package-Version: 20190124.2346
+;; Package-Commit: b44711dfce445610c1ffaec4951c6ff3882b216a
+;; Version: 1.1.0
+;; URL: https://github.com/Sarcasm/company-irony/
+;; Package-Requires: ((emacs "24.1") (company "0.8.0") (irony "1.1.0") (cl-lib "0.5"))
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Usage:
+;;
+;; (eval-after-load 'company
+;; '(add-to-list 'company-backends 'company-irony))
+
+;;; Code:
+
+(require 'irony-completion)
+
+(require 'company)
+(require 'company-template)
+
+(require 'cl-lib)
+
+(defgroup company-irony nil
+ "Company-mode completion back-end for Irony."
+ :group 'company
+ :group 'irony)
+
+(defcustom company-irony-ignore-case nil
+ "If t, ignore case when collecting completion candidates.
+If this value is `smart', ignore case only when there is no
+uppercase letters."
+ :type '(choice (const :tag "off" nil)
+ (const smart)
+ (other :tag "on" t)))
+
+(defsubst company-irony--irony-candidate (candidate)
+ (get-text-property 0 'company-irony candidate))
+
+(defun company-irony-prefix ()
+ (pcase-let ((`(,symbol-start . ,symbol-end) (irony-completion-symbol-bounds)))
+ (if (and symbol-end (> symbol-end (point)))
+ 'stop
+ (when symbol-start
+ (let ((prefix (buffer-substring-no-properties symbol-start (point))))
+ (save-excursion
+ (goto-char symbol-start)
+ (if (irony-completion-at-trigger-point-p)
+ (cons prefix t)
+ prefix)))))))
+
+(defun company-irony--make-candidates (candidates)
+ (cl-loop for candidate in candidates
+ collect (propertize (car candidate) 'company-irony candidate)))
+
+(defun company-irony--get-matching-style ()
+ (cl-case company-irony-ignore-case
+ (smart 'smart-case)
+ ((nil) 'exact)
+ (t 'case-insensitive)))
+
+(defun company-irony--candidates (prefix)
+ (cons :async
+ (lambda (callback)
+ (irony-completion-candidates-async
+ (lambda (candidates) ;; closure, lexically bound
+ (funcall callback
+ (company-irony--make-candidates candidates)))
+ prefix
+ (company-irony--get-matching-style)))))
+
+(defun company-irony--annotation (candidate)
+ (concat
+ (irony-completion-annotation candidate)
+ (let ((type (irony-completion-type candidate)))
+ (when (not (zerop (length type)))
+ (concat " -> " type)))))
+
+(defun company-irony--post-completion (candidate)
+ ;; This check is necessary because Company triggers a 'post-completion even if
+ ;; the candidate has just been typed without relying on the completion, but it
+ ;; doesn't provide the full candidate information.
+ (when candidate
+ (let ((point-before-post-complete (point)))
+ (if (irony-snippet-available-p)
+ (irony-completion-post-complete candidate)
+ (let ((str (irony-completion-post-comp-str candidate)))
+ (insert str)
+ (company-template-c-like-templatify str)))
+ ;; Here we set this-command to a `self-insert-command' so that company may
+ ;; retrigger idle completion after the snippet expansion
+ ;; (~`company-post-command'). This is a bit of a hack and maybe that will
+ ;; change in the future. This is useful for example when the completed
+ ;; candidate is a namespace and the annotation text (inserted snippet) is
+ ;; the scope operator.
+ ;;
+ ;; std| -> std:: (=> idle completion desired here)
+ ;; stderr
+ ;; ...
+ ;;
+ ;; See https://github.com/company-mode/company-mode/issues/143
+ (unless (eq (point) point-before-post-complete)
+ (setq this-command 'self-insert-command)))))
+
+;;;###autoload
+(defun company-irony (command &optional arg &rest ignored)
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive (company-begin-backend 'company-irony))
+ (prefix (and irony-mode (company-irony-prefix)))
+ (candidates (company-irony--candidates arg))
+ (annotation (company-irony--annotation
+ (company-irony--irony-candidate arg)))
+ (meta (irony-completion-brief
+ (company-irony--irony-candidate arg)))
+ (post-completion (company-irony--post-completion
+ (company-irony--irony-candidate arg)))
+ (ignore-case (eq company-irony-ignore-case t))
+ (no-cache (eq company-irony-ignore-case 'smart))
+ (sorted t)))
+
+;;;###autoload
+(defun company-irony-setup-begin-commands ()
+ "Include irony trigger commands to `company-begin-commands'.
+
+This allow completion to be automatically triggered after member
+accesses (obj.|, obj->|, ...).
+
+This may be useful to company < `0.8.4', newer version of company
+include these commands by default."
+ (if (listp company-begin-commands)
+ (set (make-local-variable 'company-begin-commands)
+ (delete-dups
+ (append company-begin-commands irony-completion-trigger-commands)))
+ (display-warning 'company-irony
+ "`company-irony-setup-begin-commands' expects \
+`company-begin-commands' to be a list!")))
+
+(provide 'company-irony)
+;;; company-irony.el ends here
diff --git a/elpa/company-irony-20190124.2346/company-irony.elc b/elpa/company-irony-20190124.2346/company-irony.elc
new file mode 100644
index 0000000..354942f
--- /dev/null
+++ b/elpa/company-irony-20190124.2346/company-irony.elc
Binary files differ
diff --git a/elpa/dash-20210826.1149/dash-autoloads.el b/elpa/dash-20210826.1149/dash-autoloads.el
new file mode 100644
index 0000000..3a96693
--- /dev/null
+++ b/elpa/dash-20210826.1149/dash-autoloads.el
@@ -0,0 +1,74 @@
+;;; dash-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "dash" "dash.el" (0 0 0 0))
+;;; Generated autoloads from dash.el
+
+(autoload 'dash-fontify-mode "dash" "\
+Toggle fontification of Dash special variables.
+
+If called interactively, enable Dash-Fontify 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.
+
+Dash-Fontify mode is a buffer-local minor mode intended for Emacs
+Lisp buffers. Enabling it causes the special variables bound in
+anaphoric Dash macros to be fontified. These anaphoras include
+`it', `it-index', `acc', and `other'. In older Emacs versions
+which do not dynamically detect macros, Dash-Fontify mode
+additionally fontifies Dash macro calls.
+
+See also `dash-fontify-mode-lighter' and
+`global-dash-fontify-mode'.
+
+\(fn &optional ARG)" t nil)
+
+(put 'global-dash-fontify-mode 'globalized-minor-mode t)
+
+(defvar global-dash-fontify-mode nil "\
+Non-nil if Global Dash-Fontify mode is enabled.
+See the `global-dash-fontify-mode' command
+for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `global-dash-fontify-mode'.")
+
+(custom-autoload 'global-dash-fontify-mode "dash" nil)
+
+(autoload 'global-dash-fontify-mode "dash" "\
+Toggle Dash-Fontify mode in all buffers.
+With prefix ARG, enable Global Dash-Fontify mode if ARG is positive;
+otherwise, disable it. If called from Lisp, enable the mode if
+ARG is omitted or nil.
+
+Dash-Fontify mode is enabled in all buffers where
+`dash--turn-on-fontify-mode' would do it.
+See `dash-fontify-mode' for more information on Dash-Fontify mode.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'dash-register-info-lookup "dash" "\
+Register the Dash Info manual with `info-lookup-symbol'.
+This allows Dash symbols to be looked up with \\[info-lookup-symbol]." t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "dash" '("!cdr" "!cons" "--" "->" "-a" "-butlast" "-c" "-d" "-e" "-f" "-gr" "-i" "-juxt" "-keep" "-l" "-m" "-no" "-o" "-p" "-r" "-s" "-t" "-u" "-value-to-list" "-when-let" "-zip" "dash-")))
+
+;;;***
+
+;;;### (autoloads nil nil ("dash-pkg.el") (0 0 0 0))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; dash-autoloads.el ends here
diff --git a/elpa/dash-20210826.1149/dash-pkg.el b/elpa/dash-20210826.1149/dash-pkg.el
new file mode 100644
index 0000000..7dc2d7a
--- /dev/null
+++ b/elpa/dash-20210826.1149/dash-pkg.el
@@ -0,0 +1,12 @@
+(define-package "dash" "20210826.1149" "A modern list library for Emacs"
+ '((emacs "24"))
+ :commit "da167c51e9fd167a48d06c7c0ee8e3ac7abd9718" :authors
+ '(("Magnar Sveen" . "magnars@gmail.com"))
+ :maintainer
+ '("Magnar Sveen" . "magnars@gmail.com")
+ :keywords
+ '("extensions" "lisp")
+ :url "https://github.com/magnars/dash.el")
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/elpa/dash-20210826.1149/dash.el b/elpa/dash-20210826.1149/dash.el
new file mode 100644
index 0000000..6386c5f
--- /dev/null
+++ b/elpa/dash-20210826.1149/dash.el
@@ -0,0 +1,3531 @@
+;;; dash.el --- A modern list library for Emacs -*- lexical-binding: t -*-
+
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
+
+;; Author: Magnar Sveen <magnars@gmail.com>
+;; Version: 2.19.1
+;; Package-Requires: ((emacs "24"))
+;; Keywords: extensions, lisp
+;; Homepage: https://github.com/magnars/dash.el
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; A modern list API for Emacs.
+;;
+;; See its overview at https://github.com/magnars/dash.el#functions.
+
+;;; Code:
+
+;; TODO: `gv' was introduced in Emacs 24.3, so remove this and all
+;; calls to `defsetf' when support for earlier versions is dropped.
+(eval-when-compile
+ (unless (fboundp 'gv-define-setter)
+ (require 'cl)))
+
+(defgroup dash ()
+ "Customize group for Dash, a modern list library."
+ :group 'extensions
+ :group 'lisp
+ :prefix "dash-")
+
+(defmacro !cons (car cdr)
+ "Destructive: Set CDR to the cons of CAR and CDR."
+ (declare (debug (form symbolp)))
+ `(setq ,cdr (cons ,car ,cdr)))
+
+(defmacro !cdr (list)
+ "Destructive: Set LIST to the cdr of LIST."
+ (declare (debug (symbolp)))
+ `(setq ,list (cdr ,list)))
+
+(defmacro --each (list &rest body)
+ "Evaluate BODY for each element of LIST and return nil.
+Each element of LIST in turn is bound to `it' and its index
+within LIST to `it-index' before evaluating BODY.
+This is the anaphoric counterpart to `-each'."
+ (declare (debug (form body)) (indent 1))
+ (let ((l (make-symbol "list"))
+ (i (make-symbol "i")))
+ `(let ((,l ,list)
+ (,i 0)
+ it it-index)
+ (ignore it it-index)
+ (while ,l
+ (setq it (pop ,l) it-index ,i ,i (1+ ,i))
+ ,@body))))
+
+(defun -each (list fn)
+ "Call FN on each element of LIST.
+Return nil; this function is intended for side effects.
+
+Its anaphoric counterpart is `--each'.
+
+For access to the current element's index in LIST, see
+`-each-indexed'."
+ (declare (indent 1))
+ (ignore (mapc fn list)))
+
+(defalias '--each-indexed '--each)
+
+(defun -each-indexed (list fn)
+ "Call FN on each index and element of LIST.
+For each ITEM at INDEX in LIST, call (funcall FN INDEX ITEM).
+Return nil; this function is intended for side effects.
+
+See also: `-map-indexed'."
+ (declare (indent 1))
+ (--each list (funcall fn it-index it)))
+
+(defmacro --each-while (list pred &rest body)
+ "Evaluate BODY for each item in LIST, while PRED evaluates to non-nil.
+Each element of LIST in turn is bound to `it' and its index
+within LIST to `it-index' before evaluating PRED or BODY. Once
+an element is reached for which PRED evaluates to nil, no further
+BODY is evaluated. The return value is always nil.
+This is the anaphoric counterpart to `-each-while'."
+ (declare (debug (form form body)) (indent 2))
+ (let ((l (make-symbol "list"))
+ (i (make-symbol "i"))
+ (elt (make-symbol "elt")))
+ `(let ((,l ,list)
+ (,i 0)
+ ,elt it it-index)
+ (ignore it it-index)
+ (while (and ,l (setq ,elt (pop ,l) it ,elt it-index ,i) ,pred)
+ (setq it ,elt it-index ,i ,i (1+ ,i))
+ ,@body))))
+
+(defun -each-while (list pred fn)
+ "Call FN on each ITEM in LIST, while (PRED ITEM) is non-nil.
+Once an ITEM is reached for which PRED returns nil, FN is no
+longer called. Return nil; this function is intended for side
+effects.
+
+Its anaphoric counterpart is `--each-while'."
+ (declare (indent 2))
+ (--each-while list (funcall pred it) (funcall fn it)))
+
+(defmacro --each-r (list &rest body)
+ "Evaluate BODY for each element of LIST in reversed order.
+Each element of LIST in turn, starting at its end, is bound to
+`it' and its index within LIST to `it-index' before evaluating
+BODY. The return value is always nil.
+This is the anaphoric counterpart to `-each-r'."
+ (declare (debug (form body)) (indent 1))
+ (let ((v (make-symbol "vector"))
+ (i (make-symbol "i")))
+ ;; Implementation note: building a vector is considerably faster
+ ;; than building a reversed list (vector takes less memory, so
+ ;; there is less GC), plus `length' comes naturally. In-place
+ ;; `nreverse' would be faster still, but BODY would be able to see
+ ;; that, even if the modification was undone before we return.
+ `(let* ((,v (vconcat ,list))
+ (,i (length ,v))
+ it it-index)
+ (ignore it it-index)
+ (while (> ,i 0)
+ (setq ,i (1- ,i) it-index ,i it (aref ,v ,i))
+ ,@body))))
+
+(defun -each-r (list fn)
+ "Call FN on each element of LIST in reversed order.
+Return nil; this function is intended for side effects.
+
+Its anaphoric counterpart is `--each-r'."
+ (--each-r list (funcall fn it)))
+
+(defmacro --each-r-while (list pred &rest body)
+ "Eval BODY for each item in reversed LIST, while PRED evals to non-nil.
+Each element of LIST in turn, starting at its end, is bound to
+`it' and its index within LIST to `it-index' before evaluating
+PRED or BODY. Once an element is reached for which PRED
+evaluates to nil, no further BODY is evaluated. The return value
+is always nil.
+This is the anaphoric counterpart to `-each-r-while'."
+ (declare (debug (form form body)) (indent 2))
+ (let ((v (make-symbol "vector"))
+ (i (make-symbol "i"))
+ (elt (make-symbol "elt")))
+ `(let* ((,v (vconcat ,list))
+ (,i (length ,v))
+ ,elt it it-index)
+ (ignore it it-index)
+ (while (when (> ,i 0)
+ (setq ,i (1- ,i) it-index ,i)
+ (setq ,elt (aref ,v ,i) it ,elt)
+ ,pred)
+ (setq it-index ,i it ,elt)
+ ,@body))))
+
+(defun -each-r-while (list pred fn)
+ "Call FN on each ITEM in reversed LIST, while (PRED ITEM) is non-nil.
+Once an ITEM is reached for which PRED returns nil, FN is no
+longer called. Return nil; this function is intended for side
+effects.
+
+Its anaphoric counterpart is `--each-r-while'."
+ (--each-r-while list (funcall pred it) (funcall fn it)))
+
+(defmacro --dotimes (num &rest body)
+ "Evaluate BODY NUM times, presumably for side effects.
+BODY is evaluated with the local variable `it' temporarily bound
+to successive integers running from 0, inclusive, to NUM,
+exclusive. BODY is not evaluated if NUM is less than 1.
+This is the anaphoric counterpart to `-dotimes'."
+ (declare (debug (form body)) (indent 1))
+ (let ((n (make-symbol "num"))
+ (i (make-symbol "i")))
+ `(let ((,n ,num)
+ (,i 0)
+ it)
+ (ignore it)
+ (while (< ,i ,n)
+ (setq it ,i ,i (1+ ,i))
+ ,@body))))
+
+(defun -dotimes (num fn)
+ "Call FN NUM times, presumably for side effects.
+FN is called with a single argument on successive integers
+running from 0, inclusive, to NUM, exclusive. FN is not called
+if NUM is less than 1.
+
+This function's anaphoric counterpart is `--dotimes'."
+ (declare (indent 1))
+ (--dotimes num (funcall fn it)))
+
+(defun -map (fn list)
+ "Apply FN to each item in LIST and return the list of results.
+
+This function's anaphoric counterpart is `--map'."
+ (mapcar fn list))
+
+(defmacro --map (form list)
+ "Eval FORM for each item in LIST and return the list of results.
+Each element of LIST in turn is bound to `it' before evaluating
+FORM.
+This is the anaphoric counterpart to `-map'."
+ (declare (debug (def-form form)))
+ `(mapcar (lambda (it) (ignore it) ,form) ,list))
+
+(defmacro --reduce-from (form init list)
+ "Accumulate a value by evaluating FORM across LIST.
+This macro is like `--each' (which see), but it additionally
+provides an accumulator variable `acc' which it successively
+binds to the result of evaluating FORM for the current LIST
+element before processing the next element. For the first
+element, `acc' is initialized with the result of evaluating INIT.
+The return value is the resulting value of `acc'. If LIST is
+empty, FORM is not evaluated, and the return value is the result
+of INIT.
+This is the anaphoric counterpart to `-reduce-from'."
+ (declare (debug (form form form)))
+ `(let ((acc ,init))
+ (--each ,list (setq acc ,form))
+ acc))
+
+(defun -reduce-from (fn init list)
+ "Reduce the function FN across LIST, starting with INIT.
+Return the result of applying FN to INIT and the first element of
+LIST, then applying FN to that result and the second element,
+etc. If LIST is empty, return INIT without calling FN.
+
+This function's anaphoric counterpart is `--reduce-from'.
+
+For other folds, see also `-reduce' and `-reduce-r'."
+ (--reduce-from (funcall fn acc it) init list))
+
+(defmacro --reduce (form list)
+ "Accumulate a value by evaluating FORM across LIST.
+This macro is like `--reduce-from' (which see), except the first
+element of LIST is taken as INIT. Thus if LIST contains a single
+item, it is returned without evaluating FORM. If LIST is empty,
+FORM is evaluated with `it' and `acc' bound to nil.
+This is the anaphoric counterpart to `-reduce'."
+ (declare (debug (form form)))
+ (let ((lv (make-symbol "list-value")))
+ `(let ((,lv ,list))
+ (if ,lv
+ (--reduce-from ,form (car ,lv) (cdr ,lv))
+ ;; Explicit nil binding pacifies lexical "variable left uninitialized"
+ ;; warning. See issue #377 and upstream https://bugs.gnu.org/47080.
+ (let ((acc nil) (it nil))
+ (ignore acc it)
+ ,form)))))
+
+(defun -reduce (fn list)
+ "Reduce the function FN across LIST.
+Return the result of applying FN to the first two elements of
+LIST, then applying FN to that result and the third element, etc.
+If LIST contains a single element, return it without calling FN.
+If LIST is empty, return the result of calling FN with no
+arguments.
+
+This function's anaphoric counterpart is `--reduce'.
+
+For other folds, see also `-reduce-from' and `-reduce-r'."
+ (if list
+ (-reduce-from fn (car list) (cdr list))
+ (funcall fn)))
+
+(defmacro --reduce-r-from (form init list)
+ "Accumulate a value by evaluating FORM across LIST in reverse.
+This macro is like `--reduce-from', except it starts from the end
+of LIST.
+This is the anaphoric counterpart to `-reduce-r-from'."
+ (declare (debug (form form form)))
+ `(let ((acc ,init))
+ (--each-r ,list (setq acc ,form))
+ acc))
+
+(defun -reduce-r-from (fn init list)
+ "Reduce the function FN across LIST in reverse, starting with INIT.
+Return the result of applying FN to the last element of LIST and
+INIT, then applying FN to the second-to-last element and the
+previous result of FN, etc. That is, the first argument of FN is
+the current element, and its second argument the accumulated
+value. If LIST is empty, return INIT without calling FN.
+
+This function is like `-reduce-from' but the operation associates
+from the right rather than left. In other words, it starts from
+the end of LIST and flips the arguments to FN. Conceptually, it
+is like replacing the conses in LIST with applications of FN, and
+its last link with INIT, and evaluating the resulting expression.
+
+This function's anaphoric counterpart is `--reduce-r-from'.
+
+For other folds, see also `-reduce-r' and `-reduce'."
+ (--reduce-r-from (funcall fn it acc) init list))
+
+(defmacro --reduce-r (form list)
+ "Accumulate a value by evaluating FORM across LIST in reverse order.
+This macro is like `--reduce', except it starts from the end of
+LIST.
+This is the anaphoric counterpart to `-reduce-r'."
+ (declare (debug (form form)))
+ `(--reduce ,form (reverse ,list)))
+
+(defun -reduce-r (fn list)
+ "Reduce the function FN across LIST in reverse.
+Return the result of applying FN to the last two elements of
+LIST, then applying FN to the third-to-last element and the
+previous result of FN, etc. That is, the first argument of FN is
+the current element, and its second argument the accumulated
+value. If LIST contains a single element, return it without
+calling FN. If LIST is empty, return the result of calling FN
+with no arguments.
+
+This function is like `-reduce' but the operation associates from
+the right rather than left. In other words, it starts from the
+end of LIST and flips the arguments to FN. Conceptually, it is
+like replacing the conses in LIST with applications of FN,
+ignoring its last link, and evaluating the resulting expression.
+
+This function's anaphoric counterpart is `--reduce-r'.
+
+For other folds, see also `-reduce-r-from' and `-reduce'."
+ (if list
+ (--reduce-r (funcall fn it acc) list)
+ (funcall fn)))
+
+(defmacro --reductions-from (form init list)
+ "Return a list of FORM's intermediate reductions across LIST.
+That is, a list of the intermediate values of the accumulator
+when `--reduce-from' (which see) is called with the same
+arguments.
+This is the anaphoric counterpart to `-reductions-from'."
+ (declare (debug (form form form)))
+ `(nreverse
+ (--reduce-from (cons (let ((acc (car acc))) (ignore acc) ,form) acc)
+ (list ,init)
+ ,list)))
+
+(defun -reductions-from (fn init list)
+ "Return a list of FN's intermediate reductions across LIST.
+That is, a list of the intermediate values of the accumulator
+when `-reduce-from' (which see) is called with the same
+arguments.
+
+This function's anaphoric counterpart is `--reductions-from'.
+
+For other folds, see also `-reductions' and `-reductions-r'."
+ (--reductions-from (funcall fn acc it) init list))
+
+(defmacro --reductions (form list)
+ "Return a list of FORM's intermediate reductions across LIST.
+That is, a list of the intermediate values of the accumulator
+when `--reduce' (which see) is called with the same arguments.
+This is the anaphoric counterpart to `-reductions'."
+ (declare (debug (form form)))
+ (let ((lv (make-symbol "list-value")))
+ `(let ((,lv ,list))
+ (if ,lv
+ (--reductions-from ,form (car ,lv) (cdr ,lv))
+ (let (acc it)
+ (ignore acc it)
+ (list ,form))))))
+
+(defun -reductions (fn list)
+ "Return a list of FN's intermediate reductions across LIST.
+That is, a list of the intermediate values of the accumulator
+when `-reduce' (which see) is called with the same arguments.
+
+This function's anaphoric counterpart is `--reductions'.
+
+For other folds, see also `-reductions' and `-reductions-r'."
+ (if list
+ (--reductions-from (funcall fn acc it) (car list) (cdr list))
+ (list (funcall fn))))
+
+(defmacro --reductions-r-from (form init list)
+ "Return a list of FORM's intermediate reductions across reversed LIST.
+That is, a list of the intermediate values of the accumulator
+when `--reduce-r-from' (which see) is called with the same
+arguments.
+This is the anaphoric counterpart to `-reductions-r-from'."
+ (declare (debug (form form form)))
+ `(--reduce-r-from (cons (let ((acc (car acc))) (ignore acc) ,form) acc)
+ (list ,init)
+ ,list))
+
+(defun -reductions-r-from (fn init list)
+ "Return a list of FN's intermediate reductions across reversed LIST.
+That is, a list of the intermediate values of the accumulator
+when `-reduce-r-from' (which see) is called with the same
+arguments.
+
+This function's anaphoric counterpart is `--reductions-r-from'.
+
+For other folds, see also `-reductions' and `-reductions-r'."
+ (--reductions-r-from (funcall fn it acc) init list))
+
+(defmacro --reductions-r (form list)
+ "Return a list of FORM's intermediate reductions across reversed LIST.
+That is, a list of the intermediate values of the accumulator
+when `--reduce-re' (which see) is called with the same arguments.
+This is the anaphoric counterpart to `-reductions-r'."
+ (declare (debug (form list)))
+ (let ((lv (make-symbol "list-value")))
+ `(let ((,lv (reverse ,list)))
+ (if ,lv
+ (--reduce-from (cons (let ((acc (car acc))) (ignore acc) ,form) acc)
+ (list (car ,lv))
+ (cdr ,lv))
+ ;; Explicit nil binding pacifies lexical "variable left uninitialized"
+ ;; warning. See issue #377 and upstream https://bugs.gnu.org/47080.
+ (let ((acc nil) (it nil))
+ (ignore acc it)
+ (list ,form))))))
+
+(defun -reductions-r (fn list)
+ "Return a list of FN's intermediate reductions across reversed LIST.
+That is, a list of the intermediate values of the accumulator
+when `-reduce-r' (which see) is called with the same arguments.
+
+This function's anaphoric counterpart is `--reductions-r'.
+
+For other folds, see also `-reductions-r-from' and
+`-reductions'."
+ (if list
+ (--reductions-r (funcall fn it acc) list)
+ (list (funcall fn))))
+
+(defmacro --filter (form list)
+ "Return a new list of the items in LIST for which FORM evals to non-nil.
+Each element of LIST in turn is bound to `it' and its index
+within LIST to `it-index' before evaluating FORM.
+This is the anaphoric counterpart to `-filter'.
+For the opposite operation, see also `--remove'."
+ (declare (debug (form form)))
+ (let ((r (make-symbol "result")))
+ `(let (,r)
+ (--each ,list (when ,form (push it ,r)))
+ (nreverse ,r))))
+
+(defun -filter (pred list)
+ "Return a new list of the items in LIST for which PRED returns non-nil.
+
+Alias: `-select'.
+
+This function's anaphoric counterpart is `--filter'.
+
+For similar operations, see also `-keep' and `-remove'."
+ (--filter (funcall pred it) list))
+
+(defalias '-select '-filter)
+(defalias '--select '--filter)
+
+(defmacro --remove (form list)
+ "Return a new list of the items in LIST for which FORM evals to nil.
+Each element of LIST in turn is bound to `it' and its index
+within LIST to `it-index' before evaluating FORM.
+This is the anaphoric counterpart to `-remove'.
+For the opposite operation, see also `--filter'."
+ (declare (debug (form form)))
+ `(--filter (not ,form) ,list))
+
+(defun -remove (pred list)
+ "Return a new list of the items in LIST for which PRED returns nil.
+
+Alias: `-reject'.
+
+This function's anaphoric counterpart is `--remove'.
+
+For similar operations, see also `-keep' and `-filter'."
+ (--remove (funcall pred it) list))
+
+(defalias '-reject '-remove)
+(defalias '--reject '--remove)
+
+(defmacro --remove-first (form list)
+ "Remove the first item from LIST for which FORM evals to non-nil.
+Each element of LIST in turn is bound to `it' and its index
+within LIST to `it-index' before evaluating FORM. This is a
+non-destructive operation, but only the front of LIST leading up
+to the removed item is a copy; the rest is LIST's original tail.
+If no item is removed, then the result is a complete copy.
+This is the anaphoric counterpart to `-remove-first'."
+ (declare (debug (form form)))
+ (let ((front (make-symbol "front"))
+ (tail (make-symbol "tail")))
+ `(let ((,tail ,list) ,front)
+ (--each-while ,tail (not ,form)
+ (push (pop ,tail) ,front))
+ (if ,tail
+ (nconc (nreverse ,front) (cdr ,tail))
+ (nreverse ,front)))))
+
+(defun -remove-first (pred list)
+ "Remove the first item from LIST for which PRED returns non-nil.
+This is a non-destructive operation, but only the front of LIST
+leading up to the removed item is a copy; the rest is LIST's
+original tail. If no item is removed, then the result is a
+complete copy.
+
+Alias: `-reject-first'.
+
+This function's anaphoric counterpart is `--remove-first'.
+
+See also `-map-first', `-remove-item', and `-remove-last'."
+ (--remove-first (funcall pred it) list))
+
+(defalias '-reject-first '-remove-first)
+(defalias '--reject-first '--remove-first)
+
+(defmacro --remove-last (form list)
+ "Remove the last item from LIST for which FORM evals to non-nil.
+Each element of LIST in turn is bound to `it' before evaluating
+FORM. The result is a copy of LIST regardless of whether an
+element is removed.
+This is the anaphoric counterpart to `-remove-last'."
+ (declare (debug (form form)))
+ `(nreverse (--remove-first ,form (reverse ,list))))
+
+(defun -remove-last (pred list)
+ "Remove the last item from LIST for which PRED returns non-nil.
+The result is a copy of LIST regardless of whether an element is
+removed.
+
+Alias: `-reject-last'.
+
+This function's anaphoric counterpart is `--remove-last'.
+
+See also `-map-last', `-remove-item', and `-remove-first'."
+ (--remove-last (funcall pred it) list))
+
+(defalias '-reject-last '-remove-last)
+(defalias '--reject-last '--remove-last)
+
+(defalias '-remove-item #'remove
+ "Return a copy of LIST with all occurrences of ITEM removed.
+The comparison is done with `equal'.
+\n(fn ITEM LIST)")
+
+(defmacro --keep (form list)
+ "Eval FORM for each item in LIST and return the non-nil results.
+Like `--filter', but returns the non-nil results of FORM instead
+of the corresponding elements of LIST. Each element of LIST in
+turn is bound to `it' and its index within LIST to `it-index'
+before evaluating FORM.
+This is the anaphoric counterpart to `-keep'."
+ (declare (debug (form form)))
+ (let ((r (make-symbol "result"))
+ (m (make-symbol "mapped")))
+ `(let (,r)
+ (--each ,list (let ((,m ,form)) (when ,m (push ,m ,r))))
+ (nreverse ,r))))
+
+(defun -keep (fn list)
+ "Return a new list of the non-nil results of applying FN to each item in LIST.
+Like `-filter', but returns the non-nil results of FN instead of
+the corresponding elements of LIST.
+
+Its anaphoric counterpart is `--keep'."
+ (--keep (funcall fn it) list))
+
+(defun -non-nil (list)
+ "Return a copy of LIST with all nil items removed."
+ (declare (pure t) (side-effect-free t))
+ (--filter it list))
+
+(defmacro --map-indexed (form list)
+ "Eval FORM for each item in LIST and return the list of results.
+Each element of LIST in turn is bound to `it' and its index
+within LIST to `it-index' before evaluating FORM. This is like
+`--map', but additionally makes `it-index' available to FORM.
+
+This is the anaphoric counterpart to `-map-indexed'."
+ (declare (debug (form form)))
+ (let ((r (make-symbol "result")))
+ `(let (,r)
+ (--each ,list
+ (push ,form ,r))
+ (nreverse ,r))))
+
+(defun -map-indexed (fn list)
+ "Apply FN to each index and item in LIST and return the list of results.
+This is like `-map', but FN takes two arguments: the index of the
+current element within LIST, and the element itself.
+
+This function's anaphoric counterpart is `--map-indexed'.
+
+For a side-effecting variant, see also `-each-indexed'."
+ (--map-indexed (funcall fn it-index it) list))
+
+(defmacro --map-when (pred rep list)
+ "Anaphoric form of `-map-when'."
+ (declare (debug (form form form)))
+ (let ((r (make-symbol "result")))
+ `(let (,r)
+ (--each ,list (!cons (if ,pred ,rep it) ,r))
+ (nreverse ,r))))
+
+(defun -map-when (pred rep list)
+ "Return a new list where the elements in LIST that do not match the PRED function
+are unchanged, and where the elements in LIST that do match the PRED function are mapped
+through the REP function.
+
+Alias: `-replace-where'
+
+See also: `-update-at'"
+ (--map-when (funcall pred it) (funcall rep it) list))
+
+(defalias '-replace-where '-map-when)
+(defalias '--replace-where '--map-when)
+
+(defun -map-first (pred rep list)
+ "Replace first item in LIST satisfying PRED with result of REP called on this item.
+
+See also: `-map-when', `-replace-first'"
+ (let (front)
+ (while (and list (not (funcall pred (car list))))
+ (push (car list) front)
+ (!cdr list))
+ (if list
+ (-concat (nreverse front) (cons (funcall rep (car list)) (cdr list)))
+ (nreverse front))))
+
+(defmacro --map-first (pred rep list)
+ "Anaphoric form of `-map-first'."
+ (declare (debug (def-form def-form form)))
+ `(-map-first (lambda (it) ,pred) (lambda (it) (ignore it) ,rep) ,list))
+
+(defun -map-last (pred rep list)
+ "Replace last item in LIST satisfying PRED with result of REP called on this item.
+
+See also: `-map-when', `-replace-last'"
+ (nreverse (-map-first pred rep (reverse list))))
+
+(defmacro --map-last (pred rep list)
+ "Anaphoric form of `-map-last'."
+ (declare (debug (def-form def-form form)))
+ `(-map-last (lambda (it) ,pred) (lambda (it) (ignore it) ,rep) ,list))
+
+(defun -replace (old new list)
+ "Replace all OLD items in LIST with NEW.
+
+Elements are compared using `equal'.
+
+See also: `-replace-at'"
+ (declare (pure t) (side-effect-free t))
+ (--map-when (equal it old) new list))
+
+(defun -replace-first (old new list)
+ "Replace the first occurrence of OLD with NEW in LIST.
+
+Elements are compared using `equal'.
+
+See also: `-map-first'"
+ (declare (pure t) (side-effect-free t))
+ (--map-first (equal old it) new list))
+
+(defun -replace-last (old new list)
+ "Replace the last occurrence of OLD with NEW in LIST.
+
+Elements are compared using `equal'.
+
+See also: `-map-last'"
+ (declare (pure t) (side-effect-free t))
+ (--map-last (equal old it) new list))
+
+(defmacro --mapcat (form list)
+ "Anaphoric form of `-mapcat'."
+ (declare (debug (form form)))
+ `(apply 'append (--map ,form ,list)))
+
+(defun -mapcat (fn list)
+ "Return the concatenation of the result of mapping FN over LIST.
+Thus function FN should return a list."
+ (--mapcat (funcall fn it) list))
+
+(defmacro --iterate (form init n)
+ "Anaphoric version of `-iterate'."
+ (declare (debug (form form form)))
+ (let ((res (make-symbol "result"))
+ (len (make-symbol "n")))
+ `(let ((,len ,n))
+ (when (> ,len 0)
+ (let* ((it ,init)
+ (,res (list it)))
+ (dotimes (_ (1- ,len))
+ (push (setq it ,form) ,res))
+ (nreverse ,res))))))
+
+(defun -iterate (fun init n)
+ "Return a list of iterated applications of FUN to INIT.
+
+This means a list of the form:
+
+ (INIT (FUN INIT) (FUN (FUN INIT)) ...)
+
+N is the length of the returned list."
+ (--iterate (funcall fun it) init n))
+
+(defun -flatten (l)
+ "Take a nested list L and return its contents as a single, flat list.
+
+Note that because `nil' represents a list of zero elements (an
+empty list), any mention of nil in L will disappear after
+flattening. If you need to preserve nils, consider `-flatten-n'
+or map them to some unique symbol and then map them back.
+
+Conses of two atoms are considered \"terminals\", that is, they
+aren't flattened further.
+
+See also: `-flatten-n'"
+ (declare (pure t) (side-effect-free t))
+ (if (and (listp l) (listp (cdr l)))
+ (-mapcat '-flatten l)
+ (list l)))
+
+(defun -flatten-n (num list)
+ "Flatten NUM levels of a nested LIST.
+
+See also: `-flatten'"
+ (declare (pure t) (side-effect-free t))
+ (dotimes (_ num)
+ (setq list (apply #'append (mapcar #'-list list))))
+ list)
+
+(defun -concat (&rest lists)
+ "Return a new list with the concatenation of the elements in the supplied LISTS."
+ (declare (pure t) (side-effect-free t))
+ (apply 'append lists))
+
+(defalias '-copy 'copy-sequence
+ "Create a shallow copy of LIST.
+
+\(fn LIST)")
+
+(defun -splice (pred fun list)
+ "Splice lists generated by FUN in place of elements matching PRED in LIST.
+
+FUN takes the element matching PRED as input.
+
+This function can be used as replacement for `,@' in case you
+need to splice several lists at marked positions (for example
+with keywords).
+
+See also: `-splice-list', `-insert-at'"
+ (let (r)
+ (--each list
+ (if (funcall pred it)
+ (let ((new (funcall fun it)))
+ (--each new (!cons it r)))
+ (!cons it r)))
+ (nreverse r)))
+
+(defmacro --splice (pred form list)
+ "Anaphoric form of `-splice'."
+ (declare (debug (def-form def-form form)))
+ `(-splice (lambda (it) ,pred) (lambda (it) ,form) ,list))
+
+(defun -splice-list (pred new-list list)
+ "Splice NEW-LIST in place of elements matching PRED in LIST.
+
+See also: `-splice', `-insert-at'"
+ (-splice pred (lambda (_) new-list) list))
+
+(defmacro --splice-list (pred new-list list)
+ "Anaphoric form of `-splice-list'."
+ (declare (debug (def-form form form)))
+ `(-splice-list (lambda (it) ,pred) ,new-list ,list))
+
+(defun -cons* (&rest args)
+ "Make a new list from the elements of ARGS.
+The last 2 elements of ARGS are used as the final cons of the
+result, so if the final element of ARGS is not a list, the result
+is a dotted list. With no ARGS, return nil."
+ (declare (pure t) (side-effect-free t))
+ (let* ((len (length args))
+ (tail (nthcdr (- len 2) args))
+ (last (cdr tail)))
+ (if (null last)
+ (car args)
+ (setcdr tail (car last))
+ args)))
+
+(defun -snoc (list elem &rest elements)
+ "Append ELEM to the end of the list.
+
+This is like `cons', but operates on the end of list.
+
+If ELEMENTS is non nil, append these to the list as well."
+ (-concat list (list elem) elements))
+
+(defmacro --first (form list)
+ "Return the first item in LIST for which FORM evals to non-nil.
+Return nil if no such element is found.
+Each element of LIST in turn is bound to `it' and its index
+within LIST to `it-index' before evaluating FORM.
+This is the anaphoric counterpart to `-first'."
+ (declare (debug (form form)))
+ (let ((n (make-symbol "needle")))
+ `(let (,n)
+ (--each-while ,list (or (not ,form)
+ (ignore (setq ,n it))))
+ ,n)))
+
+(defun -first (pred list)
+ "Return the first item in LIST for which PRED returns non-nil.
+Return nil if no such element is found.
+To get the first item in the list no questions asked, use `car'.
+
+Alias: `-find'.
+
+This function's anaphoric counterpart is `--first'."
+ (--first (funcall pred it) list))
+
+(defalias '-find '-first)
+(defalias '--find '--first)
+
+(defmacro --some (form list)
+ "Return non-nil if FORM evals to non-nil for at least one item in LIST.
+If so, return the first such result of FORM.
+Each element of LIST in turn is bound to `it' and its index
+within LIST to `it-index' before evaluating FORM.
+This is the anaphoric counterpart to `-some'."
+ (declare (debug (form form)))
+ (let ((n (make-symbol "needle")))
+ `(let (,n)
+ (--each-while ,list (not (setq ,n ,form)))
+ ,n)))
+
+(defun -some (pred list)
+ "Return (PRED x) for the first LIST item where (PRED x) is non-nil, else nil.
+
+Alias: `-any'.
+
+This function's anaphoric counterpart is `--some'."
+ (--some (funcall pred it) list))
+
+(defalias '-any '-some)
+(defalias '--any '--some)
+
+(defmacro --every (form list)
+ "Return non-nil if FORM evals to non-nil for all items in LIST.
+If so, return the last such result of FORM. Otherwise, once an
+item is reached for which FORM yields nil, return nil without
+evaluating FORM for any further LIST elements.
+Each element of LIST in turn is bound to `it' and its index
+within LIST to `it-index' before evaluating FORM.
+
+This macro is like `--every-p', but on success returns the last
+non-nil result of FORM instead of just t.
+
+This is the anaphoric counterpart to `-every'."
+ (declare (debug (form form)))
+ (let ((a (make-symbol "all")))
+ `(let ((,a t))
+ (--each-while ,list (setq ,a ,form))
+ ,a)))
+
+(defun -every (pred list)
+ "Return non-nil if PRED returns non-nil for all items in LIST.
+If so, return the last such result of PRED. Otherwise, once an
+item is reached for which PRED returns nil, return nil without
+calling PRED on any further LIST elements.
+
+This function is like `-every-p', but on success returns the last
+non-nil result of PRED instead of just t.
+
+This function's anaphoric counterpart is `--every'."
+ (--every (funcall pred it) list))
+
+(defmacro --last (form list)
+ "Anaphoric form of `-last'."
+ (declare (debug (form form)))
+ (let ((n (make-symbol "needle")))
+ `(let (,n)
+ (--each ,list
+ (when ,form (setq ,n it)))
+ ,n)))
+
+(defun -last (pred list)
+ "Return the last x in LIST where (PRED x) is non-nil, else nil."
+ (--last (funcall pred it) list))
+
+(defalias '-first-item 'car
+ "Return the first item of LIST, or nil on an empty list.
+
+See also: `-second-item', `-last-item'.
+
+\(fn LIST)")
+
+;; Ensure that calls to `-first-item' are compiled to a single opcode,
+;; just like `car'.
+(put '-first-item 'byte-opcode 'byte-car)
+(put '-first-item 'byte-compile 'byte-compile-one-arg)
+
+(defalias '-second-item 'cadr
+ "Return the second item of LIST, or nil if LIST is too short.
+
+See also: `-third-item'.
+
+\(fn LIST)")
+
+(defalias '-third-item
+ (if (fboundp 'caddr)
+ #'caddr
+ (lambda (list) (car (cddr list))))
+ "Return the third item of LIST, or nil if LIST is too short.
+
+See also: `-fourth-item'.
+
+\(fn LIST)")
+
+(defun -fourth-item (list)
+ "Return the fourth item of LIST, or nil if LIST is too short.
+
+See also: `-fifth-item'."
+ (declare (pure t) (side-effect-free t))
+ (car (cdr (cdr (cdr list)))))
+
+(defun -fifth-item (list)
+ "Return the fifth item of LIST, or nil if LIST is too short.
+
+See also: `-last-item'."
+ (declare (pure t) (side-effect-free t))
+ (car (cdr (cdr (cdr (cdr list))))))
+
+(defun -last-item (list)
+ "Return the last item of LIST, or nil on an empty list."
+ (declare (pure t) (side-effect-free t))
+ (car (last list)))
+
+;; Use `with-no-warnings' to suppress unbound `-last-item' or
+;; undefined `gv--defsetter' warnings arising from both
+;; `gv-define-setter' and `defsetf' in certain Emacs versions.
+(with-no-warnings
+ (if (fboundp 'gv-define-setter)
+ (gv-define-setter -last-item (val x) `(setcar (last ,x) ,val))
+ (defsetf -last-item (x) (val) `(setcar (last ,x) ,val))))
+
+(defun -butlast (list)
+ "Return a list of all items in list except for the last."
+ ;; no alias as we don't want magic optional argument
+ (declare (pure t) (side-effect-free t))
+ (butlast list))
+
+(defmacro --count (pred list)
+ "Anaphoric form of `-count'."
+ (declare (debug (form form)))
+ (let ((r (make-symbol "result")))
+ `(let ((,r 0))
+ (--each ,list (when ,pred (setq ,r (1+ ,r))))
+ ,r)))
+
+(defun -count (pred list)
+ "Counts the number of items in LIST where (PRED item) is non-nil."
+ (--count (funcall pred it) list))
+
+(defun ---truthy? (obj)
+ "Return OBJ as a boolean value (t or nil)."
+ (declare (pure t) (side-effect-free t))
+ (and obj t))
+
+(defmacro --any? (form list)
+ "Anaphoric form of `-any?'."
+ (declare (debug (form form)))
+ `(and (--some ,form ,list) t))
+
+(defun -any? (pred list)
+ "Return t if (PRED x) is non-nil for any x in LIST, else nil.
+
+Alias: `-any-p', `-some?', `-some-p'"
+ (--any? (funcall pred it) list))
+
+(defalias '-some? '-any?)
+(defalias '--some? '--any?)
+(defalias '-any-p '-any?)
+(defalias '--any-p '--any?)
+(defalias '-some-p '-any?)
+(defalias '--some-p '--any?)
+
+(defmacro --all? (form list)
+ "Return t if FORM evals to non-nil for all items in LIST.
+Otherwise, once an item is reached for which FORM yields nil,
+return nil without evaluating FORM for any further LIST elements.
+Each element of LIST in turn is bound to `it' and its index
+within LIST to `it-index' before evaluating FORM.
+
+The similar macro `--every' is more widely useful, since it
+returns the last non-nil result of FORM instead of just t on
+success.
+
+Alias: `--all-p', `--every-p', `--every?'.
+
+This is the anaphoric counterpart to `-all?'."
+ (declare (debug (form form)))
+ `(and (--every ,form ,list) t))
+
+(defun -all? (pred list)
+ "Return t if (PRED X) is non-nil for all X in LIST, else nil.
+In the latter case, stop after the first X for which (PRED X) is
+nil, without calling PRED on any subsequent elements of LIST.
+
+The similar function `-every' is more widely useful, since it
+returns the last non-nil result of PRED instead of just t on
+success.
+
+Alias: `-all-p', `-every-p', `-every?'.
+
+This function's anaphoric counterpart is `--all?'."
+ (--all? (funcall pred it) list))
+
+(defalias '-every? '-all?)
+(defalias '--every? '--all?)
+(defalias '-all-p '-all?)
+(defalias '--all-p '--all?)
+(defalias '-every-p '-all?)
+(defalias '--every-p '--all?)
+
+(defmacro --none? (form list)
+ "Anaphoric form of `-none?'."
+ (declare (debug (form form)))
+ `(--all? (not ,form) ,list))
+
+(defun -none? (pred list)
+ "Return t if (PRED x) is nil for all x in LIST, else nil.
+
+Alias: `-none-p'"
+ (--none? (funcall pred it) list))
+
+(defalias '-none-p '-none?)
+(defalias '--none-p '--none?)
+
+(defmacro --only-some? (form list)
+ "Anaphoric form of `-only-some?'."
+ (declare (debug (form form)))
+ (let ((y (make-symbol "yes"))
+ (n (make-symbol "no")))
+ `(let (,y ,n)
+ (--each-while ,list (not (and ,y ,n))
+ (if ,form (setq ,y t) (setq ,n t)))
+ (---truthy? (and ,y ,n)))))
+
+(defun -only-some? (pred list)
+ "Return `t` if at least one item of LIST matches PRED and at least one item of LIST does not match PRED.
+Return `nil` both if all items match the predicate or if none of the items match the predicate.
+
+Alias: `-only-some-p'"
+ (--only-some? (funcall pred it) list))
+
+(defalias '-only-some-p '-only-some?)
+(defalias '--only-some-p '--only-some?)
+
+(defun -slice (list from &optional to step)
+ "Return copy of LIST, starting from index FROM to index TO.
+
+FROM or TO may be negative. These values are then interpreted
+modulo the length of the list.
+
+If STEP is a number, only each STEPth item in the resulting
+section is returned. Defaults to 1."
+ (declare (pure t) (side-effect-free t))
+ (let ((length (length list))
+ (new-list nil))
+ ;; to defaults to the end of the list
+ (setq to (or to length))
+ (setq step (or step 1))
+ ;; handle negative indices
+ (when (< from 0)
+ (setq from (mod from length)))
+ (when (< to 0)
+ (setq to (mod to length)))
+
+ ;; iterate through the list, keeping the elements we want
+ (--each-while list (< it-index to)
+ (when (and (>= it-index from)
+ (= (mod (- from it-index) step) 0))
+ (push it new-list)))
+ (nreverse new-list)))
+
+(defmacro --take-while (form list)
+ "Take successive items from LIST for which FORM evals to non-nil.
+Each element of LIST in turn is bound to `it' and its index
+within LIST to `it-index' before evaluating FORM. Return a new
+list of the successive elements from the start of LIST for which
+FORM evaluates to non-nil.
+This is the anaphoric counterpart to `-take-while'."
+ (declare (debug (form form)))
+ (let ((r (make-symbol "result")))
+ `(let (,r)
+ (--each-while ,list ,form (push it ,r))
+ (nreverse ,r))))
+
+(defun -take-while (pred list)
+ "Take successive items from LIST for which PRED returns non-nil.
+PRED is a function of one argument. Return a new list of the
+successive elements from the start of LIST for which PRED returns
+non-nil.
+
+This function's anaphoric counterpart is `--take-while'.
+
+For another variant, see also `-drop-while'."
+ (--take-while (funcall pred it) list))
+
+(defmacro --drop-while (form list)
+ "Drop successive items from LIST for which FORM evals to non-nil.
+Each element of LIST in turn is bound to `it' and its index
+within LIST to `it-index' before evaluating FORM. Return the
+tail (not a copy) of LIST starting from its first element for
+which FORM evaluates to nil.
+This is the anaphoric counterpart to `-drop-while'."
+ (declare (debug (form form)))
+ (let ((l (make-symbol "list")))
+ `(let ((,l ,list))
+ (--each-while ,l ,form (pop ,l))
+ ,l)))
+
+(defun -drop-while (pred list)
+ "Drop successive items from LIST for which PRED returns non-nil.
+PRED is a function of one argument. Return the tail (not a copy)
+of LIST starting from its first element for which PRED returns
+nil.
+
+This function's anaphoric counterpart is `--drop-while'.
+
+For another variant, see also `-take-while'."
+ (--drop-while (funcall pred it) list))
+
+(defun -take (n list)
+ "Return a copy of the first N items in LIST.
+Return a copy of LIST if it contains N items or fewer.
+Return nil if N is zero or less.
+
+See also: `-take-last'."
+ (declare (pure t) (side-effect-free t))
+ (--take-while (< it-index n) list))
+
+(defun -take-last (n list)
+ "Return a copy of the last N items of LIST in order.
+Return a copy of LIST if it contains N items or fewer.
+Return nil if N is zero or less.
+
+See also: `-take'."
+ (declare (pure t) (side-effect-free t))
+ (copy-sequence (last list n)))
+
+(defalias '-drop #'nthcdr
+ "Return the tail (not a copy) of LIST without the first N items.
+Return nil if LIST contains N items or fewer.
+Return LIST if N is zero or less.
+
+For another variant, see also `-drop-last'.
+\n(fn N LIST)")
+
+(defun -drop-last (n list)
+ "Return a copy of LIST without its last N items.
+Return a copy of LIST if N is zero or less.
+Return nil if LIST contains N items or fewer.
+
+See also: `-drop'."
+ (declare (pure t) (side-effect-free t))
+ (nbutlast (copy-sequence list) n))
+
+(defun -split-at (n list)
+ "Split LIST into two sublists after the Nth element.
+The result is a list of two elements (TAKE DROP) where TAKE is a
+new list of the first N elements of LIST, and DROP is the
+remaining elements of LIST (not a copy). TAKE and DROP are like
+the results of `-take' and `-drop', respectively, but the split
+is done in a single list traversal."
+ (declare (pure t) (side-effect-free t))
+ (let (result)
+ (--each-while list (< it-index n)
+ (push (pop list) result))
+ (list (nreverse result) list)))
+
+(defun -rotate (n list)
+ "Rotate LIST N places to the right (left if N is negative).
+The time complexity is O(n)."
+ (declare (pure t) (side-effect-free t))
+ (cond ((null list) ())
+ ((zerop n) (copy-sequence list))
+ ((let* ((len (length list))
+ (n-mod-len (mod n len))
+ (new-tail-len (- len n-mod-len)))
+ (append (nthcdr new-tail-len list) (-take new-tail-len list))))))
+
+(defun -insert-at (n x list)
+ "Return a list with X inserted into LIST at position N.
+
+See also: `-splice', `-splice-list'"
+ (declare (pure t) (side-effect-free t))
+ (let ((split-list (-split-at n list)))
+ (nconc (car split-list) (cons x (cadr split-list)))))
+
+(defun -replace-at (n x list)
+ "Return a list with element at Nth position in LIST replaced with X.
+
+See also: `-replace'"
+ (declare (pure t) (side-effect-free t))
+ (let ((split-list (-split-at n list)))
+ (nconc (car split-list) (cons x (cdr (cadr split-list))))))
+
+(defun -update-at (n func list)
+ "Return a list with element at Nth position in LIST replaced with `(func (nth n list))`.
+
+See also: `-map-when'"
+ (let ((split-list (-split-at n list)))
+ (nconc (car split-list) (cons (funcall func (car (cadr split-list))) (cdr (cadr split-list))))))
+
+(defmacro --update-at (n form list)
+ "Anaphoric version of `-update-at'."
+ (declare (debug (form def-form form)))
+ `(-update-at ,n (lambda (it) ,form) ,list))
+
+(defun -remove-at (n list)
+ "Return a list with element at Nth position in LIST removed.
+
+See also: `-remove-at-indices', `-remove'"
+ (declare (pure t) (side-effect-free t))
+ (-remove-at-indices (list n) list))
+
+(defun -remove-at-indices (indices list)
+ "Return a list whose elements are elements from LIST without
+elements selected as `(nth i list)` for all i
+from INDICES.
+
+See also: `-remove-at', `-remove'"
+ (declare (pure t) (side-effect-free t))
+ (let* ((indices (-sort '< indices))
+ (diffs (cons (car indices) (-map '1- (-zip-with '- (cdr indices) indices))))
+ r)
+ (--each diffs
+ (let ((split (-split-at it list)))
+ (!cons (car split) r)
+ (setq list (cdr (cadr split)))))
+ (!cons list r)
+ (apply '-concat (nreverse r))))
+
+(defmacro --split-with (pred list)
+ "Anaphoric form of `-split-with'."
+ (declare (debug (form form)))
+ (let ((l (make-symbol "list"))
+ (r (make-symbol "result"))
+ (c (make-symbol "continue")))
+ `(let ((,l ,list)
+ (,r nil)
+ (,c t))
+ (while (and ,l ,c)
+ (let ((it (car ,l)))
+ (if (not ,pred)
+ (setq ,c nil)
+ (!cons it ,r)
+ (!cdr ,l))))
+ (list (nreverse ,r) ,l))))
+
+(defun -split-with (pred list)
+ "Return a list of ((-take-while PRED LIST) (-drop-while PRED LIST)), in no more than one pass through the list."
+ (--split-with (funcall pred it) list))
+
+(defmacro -split-on (item list)
+ "Split the LIST each time ITEM is found.
+
+Unlike `-partition-by', the ITEM is discarded from the results.
+Empty lists are also removed from the result.
+
+Comparison is done by `equal'.
+
+See also `-split-when'"
+ (declare (debug (def-form form)))
+ `(-split-when (lambda (it) (equal it ,item)) ,list))
+
+(defmacro --split-when (form list)
+ "Anaphoric version of `-split-when'."
+ (declare (debug (def-form form)))
+ `(-split-when (lambda (it) ,form) ,list))
+
+(defun -split-when (fn list)
+ "Split the LIST on each element where FN returns non-nil.
+
+Unlike `-partition-by', the \"matched\" element is discarded from
+the results. Empty lists are also removed from the result.
+
+This function can be thought of as a generalization of
+`split-string'."
+ (let (r s)
+ (while list
+ (if (not (funcall fn (car list)))
+ (push (car list) s)
+ (when s (push (nreverse s) r))
+ (setq s nil))
+ (!cdr list))
+ (when s (push (nreverse s) r))
+ (nreverse r)))
+
+(defmacro --separate (form list)
+ "Anaphoric form of `-separate'."
+ (declare (debug (form form)))
+ (let ((y (make-symbol "yes"))
+ (n (make-symbol "no")))
+ `(let (,y ,n)
+ (--each ,list (if ,form (!cons it ,y) (!cons it ,n)))
+ (list (nreverse ,y) (nreverse ,n)))))
+
+(defun -separate (pred list)
+ "Return a list of ((-filter PRED LIST) (-remove PRED LIST)), in one pass through the list."
+ (--separate (funcall pred it) list))
+
+(defun dash--partition-all-in-steps-reversed (n step list)
+ "Used by `-partition-all-in-steps' and `-partition-in-steps'."
+ (when (< step 1)
+ (signal 'wrong-type-argument
+ `("Step size < 1 results in juicy infinite loops" ,step)))
+ (let (result)
+ (while list
+ (push (-take n list) result)
+ (setq list (nthcdr step list)))
+ result))
+
+(defun -partition-all-in-steps (n step list)
+ "Return a new list with the items in LIST grouped into N-sized sublists at offsets STEP apart.
+The last groups may contain less than N items."
+ (declare (pure t) (side-effect-free t))
+ (nreverse (dash--partition-all-in-steps-reversed n step list)))
+
+(defun -partition-in-steps (n step list)
+ "Return a new list with the items in LIST grouped into N-sized sublists at offsets STEP apart.
+If there are not enough items to make the last group N-sized,
+those items are discarded."
+ (declare (pure t) (side-effect-free t))
+ (let ((result (dash--partition-all-in-steps-reversed n step list)))
+ (while (and result (< (length (car result)) n))
+ (!cdr result))
+ (nreverse result)))
+
+(defun -partition-all (n list)
+ "Return a new list with the items in LIST grouped into N-sized sublists.
+The last group may contain less than N items."
+ (declare (pure t) (side-effect-free t))
+ (-partition-all-in-steps n n list))
+
+(defun -partition (n list)
+ "Return a new list with the items in LIST grouped into N-sized sublists.
+If there are not enough items to make the last group N-sized,
+those items are discarded."
+ (declare (pure t) (side-effect-free t))
+ (-partition-in-steps n n list))
+
+(defmacro --partition-by (form list)
+ "Anaphoric form of `-partition-by'."
+ (declare (debug (form form)))
+ (let ((r (make-symbol "result"))
+ (s (make-symbol "sublist"))
+ (v (make-symbol "value"))
+ (n (make-symbol "new-value"))
+ (l (make-symbol "list")))
+ `(let ((,l ,list))
+ (when ,l
+ (let* ((,r nil)
+ (it (car ,l))
+ (,s (list it))
+ (,v ,form)
+ (,l (cdr ,l)))
+ (while ,l
+ (let* ((it (car ,l))
+ (,n ,form))
+ (unless (equal ,v ,n)
+ (!cons (nreverse ,s) ,r)
+ (setq ,s nil)
+ (setq ,v ,n))
+ (!cons it ,s)
+ (!cdr ,l)))
+ (!cons (nreverse ,s) ,r)
+ (nreverse ,r))))))
+
+(defun -partition-by (fn list)
+ "Apply FN to each item in LIST, splitting it each time FN returns a new value."
+ (--partition-by (funcall fn it) list))
+
+(defmacro --partition-by-header (form list)
+ "Anaphoric form of `-partition-by-header'."
+ (declare (debug (form form)))
+ (let ((r (make-symbol "result"))
+ (s (make-symbol "sublist"))
+ (h (make-symbol "header-value"))
+ (b (make-symbol "seen-body?"))
+ (n (make-symbol "new-value"))
+ (l (make-symbol "list")))
+ `(let ((,l ,list))
+ (when ,l
+ (let* ((,r nil)
+ (it (car ,l))
+ (,s (list it))
+ (,h ,form)
+ (,b nil)
+ (,l (cdr ,l)))
+ (while ,l
+ (let* ((it (car ,l))
+ (,n ,form))
+ (if (equal ,h ,n)
+ (when ,b
+ (!cons (nreverse ,s) ,r)
+ (setq ,s nil)
+ (setq ,b nil))
+ (setq ,b t))
+ (!cons it ,s)
+ (!cdr ,l)))
+ (!cons (nreverse ,s) ,r)
+ (nreverse ,r))))))
+
+(defun -partition-by-header (fn list)
+ "Apply FN to the first item in LIST. That is the header
+value. Apply FN to each item in LIST, splitting it each time FN
+returns the header value, but only after seeing at least one
+other value (the body)."
+ (--partition-by-header (funcall fn it) list))
+
+(defmacro --partition-after-pred (form list)
+ "Partition LIST after each element for which FORM evaluates to non-nil.
+Each element of LIST in turn is bound to `it' before evaluating
+FORM.
+
+This is the anaphoric counterpart to `-partition-after-pred'."
+ (let ((l (make-symbol "list"))
+ (r (make-symbol "result"))
+ (s (make-symbol "sublist")))
+ `(let ((,l ,list) ,r ,s)
+ (when ,l
+ (--each ,l
+ (push it ,s)
+ (when ,form
+ (push (nreverse ,s) ,r)
+ (setq ,s ())))
+ (when ,s
+ (push (nreverse ,s) ,r))
+ (nreverse ,r)))))
+
+(defun -partition-after-pred (pred list)
+ "Partition LIST after each element for which PRED returns non-nil.
+
+This function's anaphoric counterpart is `--partition-after-pred'."
+ (--partition-after-pred (funcall pred it) list))
+
+(defun -partition-before-pred (pred list)
+ "Partition directly before each time PRED is true on an element of LIST."
+ (nreverse (-map #'reverse
+ (-partition-after-pred pred (reverse list)))))
+
+(defun -partition-after-item (item list)
+ "Partition directly after each time ITEM appears in LIST."
+ (-partition-after-pred (lambda (ele) (equal ele item))
+ list))
+
+(defun -partition-before-item (item list)
+ "Partition directly before each time ITEM appears in LIST."
+ (-partition-before-pred (lambda (ele) (equal ele item))
+ list))
+
+(defmacro --group-by (form list)
+ "Anaphoric form of `-group-by'."
+ (declare (debug t))
+ (let ((n (make-symbol "n"))
+ (k (make-symbol "k"))
+ (grp (make-symbol "grp")))
+ `(nreverse
+ (-map
+ (lambda (,n)
+ (cons (car ,n)
+ (nreverse (cdr ,n))))
+ (--reduce-from
+ (let* ((,k (,@form))
+ (,grp (assoc ,k acc)))
+ (if ,grp
+ (setcdr ,grp (cons it (cdr ,grp)))
+ (push
+ (list ,k it)
+ acc))
+ acc)
+ nil ,list)))))
+
+(defun -group-by (fn list)
+ "Separate LIST into an alist whose keys are FN applied to the
+elements of LIST. Keys are compared by `equal'."
+ (--group-by (funcall fn it) list))
+
+(defun -interpose (sep list)
+ "Return a new list of all elements in LIST separated by SEP."
+ (declare (pure t) (side-effect-free t))
+ (let (result)
+ (when list
+ (!cons (car list) result)
+ (!cdr list))
+ (while list
+ (setq result (cons (car list) (cons sep result)))
+ (!cdr list))
+ (nreverse result)))
+
+(defun -interleave (&rest lists)
+ "Return a new list of the first item in each list, then the second etc."
+ (declare (pure t) (side-effect-free t))
+ (when lists
+ (let (result)
+ (while (-none? 'null lists)
+ (--each lists (!cons (car it) result))
+ (setq lists (-map 'cdr lists)))
+ (nreverse result))))
+
+(defmacro --zip-with (form list1 list2)
+ "Anaphoric form of `-zip-with'.
+
+The elements in list1 are bound as symbol `it', the elements in list2 as symbol `other'."
+ (declare (debug (form form form)))
+ (let ((r (make-symbol "result"))
+ (l1 (make-symbol "list1"))
+ (l2 (make-symbol "list2")))
+ `(let ((,r nil)
+ (,l1 ,list1)
+ (,l2 ,list2))
+ (while (and ,l1 ,l2)
+ (let ((it (car ,l1))
+ (other (car ,l2)))
+ (!cons ,form ,r)
+ (!cdr ,l1)
+ (!cdr ,l2)))
+ (nreverse ,r))))
+
+(defun -zip-with (fn list1 list2)
+ "Zip the two lists LIST1 and LIST2 using a function FN. This
+function is applied pairwise taking as first argument element of
+LIST1 and as second argument element of LIST2 at corresponding
+position.
+
+The anaphoric form `--zip-with' binds the elements from LIST1 as symbol `it',
+and the elements from LIST2 as symbol `other'."
+ (--zip-with (funcall fn it other) list1 list2))
+
+(defun -zip-lists (&rest lists)
+ "Zip LISTS together. Group the head of each list, followed by the
+second elements of each list, and so on. The lengths of the returned
+groupings are equal to the length of the shortest input list.
+
+The return value is always list of lists, which is a difference
+from `-zip-pair' which returns a cons-cell in case two input
+lists are provided.
+
+See also: `-zip'"
+ (declare (pure t) (side-effect-free t))
+ (when lists
+ (let (results)
+ (while (-none? 'null lists)
+ (setq results (cons (mapcar 'car lists) results))
+ (setq lists (mapcar 'cdr lists)))
+ (nreverse results))))
+
+(defun -zip (&rest lists)
+ "Zip LISTS together. Group the head of each list, followed by the
+second elements of each list, and so on. The lengths of the returned
+groupings are equal to the length of the shortest input list.
+
+If two lists are provided as arguments, return the groupings as a list
+of cons cells. Otherwise, return the groupings as a list of lists.
+
+Use `-zip-lists' if you need the return value to always be a list
+of lists.
+
+Alias: `-zip-pair'
+
+See also: `-zip-lists'"
+ (declare (pure t) (side-effect-free t))
+ (when lists
+ (let (results)
+ (while (-none? 'null lists)
+ (setq results (cons (mapcar 'car lists) results))
+ (setq lists (mapcar 'cdr lists)))
+ (setq results (nreverse results))
+ (if (= (length lists) 2)
+ ;; to support backward compatibility, return
+ ;; a cons cell if two lists were provided
+ (--map (cons (car it) (cadr it)) results)
+ results))))
+
+(defalias '-zip-pair '-zip)
+
+(defun -zip-fill (fill-value &rest lists)
+ "Zip LISTS, with FILL-VALUE padded onto the shorter lists. The
+lengths of the returned groupings are equal to the length of the
+longest input list."
+ (declare (pure t) (side-effect-free t))
+ (apply '-zip (apply '-pad (cons fill-value lists))))
+
+(defun -unzip (lists)
+ "Unzip LISTS.
+
+This works just like `-zip' but takes a list of lists instead of
+a variable number of arguments, such that
+
+ (-unzip (-zip L1 L2 L3 ...))
+
+is identity (given that the lists are the same length).
+
+Note in particular that calling this on a list of two lists will
+return a list of cons-cells such that the above identity works.
+
+See also: `-zip'"
+ (apply '-zip lists))
+
+(defun -cycle (list)
+ "Return an infinite circular copy of LIST.
+The returned list cycles through the elements of LIST and repeats
+from the beginning."
+ (declare (pure t) (side-effect-free t))
+ ;; Also works with sequences that aren't lists.
+ (let ((newlist (append list ())))
+ (nconc newlist newlist)))
+
+(defun -pad (fill-value &rest lists)
+ "Appends FILL-VALUE to the end of each list in LISTS such that they
+will all have the same length."
+ (let* ((annotations (-annotate 'length lists))
+ (n (-max (-map 'car annotations))))
+ (--map (append (cdr it) (-repeat (- n (car it)) fill-value)) annotations)))
+
+(defun -annotate (fn list)
+ "Return a list of cons cells where each cell is FN applied to each
+element of LIST paired with the unmodified element of LIST."
+ (-zip (-map fn list) list))
+
+(defmacro --annotate (form list)
+ "Anaphoric version of `-annotate'."
+ (declare (debug (def-form form)))
+ `(-annotate (lambda (it) ,form) ,list))
+
+(defun dash--table-carry (lists restore-lists &optional re)
+ "Helper for `-table' and `-table-flat'.
+
+If a list overflows, carry to the right and reset the list."
+ (while (not (or (car lists)
+ (equal lists '(nil))))
+ (setcar lists (car restore-lists))
+ (pop (cadr lists))
+ (!cdr lists)
+ (!cdr restore-lists)
+ (when re
+ (push (nreverse (car re)) (cadr re))
+ (setcar re nil)
+ (!cdr re))))
+
+(defun -table (fn &rest lists)
+ "Compute outer product of LISTS using function FN.
+
+The function FN should have the same arity as the number of
+supplied lists.
+
+The outer product is computed by applying fn to all possible
+combinations created by taking one element from each list in
+order. The dimension of the result is (length lists).
+
+See also: `-table-flat'"
+ (let ((restore-lists (copy-sequence lists))
+ (last-list (last lists))
+ (re (make-list (length lists) nil)))
+ (while (car last-list)
+ (let ((item (apply fn (-map 'car lists))))
+ (push item (car re))
+ (setcar lists (cdar lists)) ;; silence byte compiler
+ (dash--table-carry lists restore-lists re)))
+ (nreverse (car (last re)))))
+
+(defun -table-flat (fn &rest lists)
+ "Compute flat outer product of LISTS using function FN.
+
+The function FN should have the same arity as the number of
+supplied lists.
+
+The outer product is computed by applying fn to all possible
+combinations created by taking one element from each list in
+order. The results are flattened, ignoring the tensor structure
+of the result. This is equivalent to calling:
+
+ (-flatten-n (1- (length lists)) (apply \\='-table fn lists))
+
+but the implementation here is much more efficient.
+
+See also: `-flatten-n', `-table'"
+ (let ((restore-lists (copy-sequence lists))
+ (last-list (last lists))
+ re)
+ (while (car last-list)
+ (let ((item (apply fn (-map 'car lists))))
+ (push item re)
+ (setcar lists (cdar lists)) ;; silence byte compiler
+ (dash--table-carry lists restore-lists)))
+ (nreverse re)))
+
+(defun -elem-index (elem list)
+ "Return the index of the first element in the given LIST which
+is equal to the query element ELEM, or nil if there is no
+such element."
+ (declare (pure t) (side-effect-free t))
+ (car (-elem-indices elem list)))
+
+(defun -elem-indices (elem list)
+ "Return the indices of all elements in LIST equal to the query
+element ELEM, in ascending order."
+ (declare (pure t) (side-effect-free t))
+ (-find-indices (-partial 'equal elem) list))
+
+(defun -find-indices (pred list)
+ "Return the indices of all elements in LIST satisfying the
+predicate PRED, in ascending order."
+ (apply 'append (--map-indexed (when (funcall pred it) (list it-index)) list)))
+
+(defmacro --find-indices (form list)
+ "Anaphoric version of `-find-indices'."
+ (declare (debug (def-form form)))
+ `(-find-indices (lambda (it) ,form) ,list))
+
+(defun -find-index (pred list)
+ "Take a predicate PRED and a LIST and return the index of the
+first element in the list satisfying the predicate, or nil if
+there is no such element.
+
+See also `-first'."
+ (car (-find-indices pred list)))
+
+(defmacro --find-index (form list)
+ "Anaphoric version of `-find-index'."
+ (declare (debug (def-form form)))
+ `(-find-index (lambda (it) ,form) ,list))
+
+(defun -find-last-index (pred list)
+ "Take a predicate PRED and a LIST and return the index of the
+last element in the list satisfying the predicate, or nil if
+there is no such element.
+
+See also `-last'."
+ (-last-item (-find-indices pred list)))
+
+(defmacro --find-last-index (form list)
+ "Anaphoric version of `-find-last-index'."
+ (declare (debug (def-form form)))
+ `(-find-last-index (lambda (it) ,form) ,list))
+
+(defun -select-by-indices (indices list)
+ "Return a list whose elements are elements from LIST selected
+as `(nth i list)` for all i from INDICES."
+ (declare (pure t) (side-effect-free t))
+ (let (r)
+ (--each indices
+ (!cons (nth it list) r))
+ (nreverse r)))
+
+(defun -select-columns (columns table)
+ "Select COLUMNS from TABLE.
+
+TABLE is a list of lists where each element represents one row.
+It is assumed each row has the same length.
+
+Each row is transformed such that only the specified COLUMNS are
+selected.
+
+See also: `-select-column', `-select-by-indices'"
+ (declare (pure t) (side-effect-free t))
+ (--map (-select-by-indices columns it) table))
+
+(defun -select-column (column table)
+ "Select COLUMN from TABLE.
+
+TABLE is a list of lists where each element represents one row.
+It is assumed each row has the same length.
+
+The single selected column is returned as a list.
+
+See also: `-select-columns', `-select-by-indices'"
+ (declare (pure t) (side-effect-free t))
+ (--mapcat (-select-by-indices (list column) it) table))
+
+(defmacro -> (x &optional form &rest more)
+ "Thread the expr through the forms. Insert X as the second item
+in the first form, making a list of it if it is not a list
+already. If there are more forms, insert the first form as the
+second item in second form, etc."
+ (declare (debug (form &rest [&or symbolp (sexp &rest form)])))
+ (cond
+ ((null form) x)
+ ((null more) (if (listp form)
+ `(,(car form) ,x ,@(cdr form))
+ (list form x)))
+ (:else `(-> (-> ,x ,form) ,@more))))
+
+(defmacro ->> (x &optional form &rest more)
+ "Thread the expr through the forms. Insert X as the last item
+in the first form, making a list of it if it is not a list
+already. If there are more forms, insert the first form as the
+last item in second form, etc."
+ (declare (debug ->))
+ (cond
+ ((null form) x)
+ ((null more) (if (listp form)
+ `(,@form ,x)
+ (list form x)))
+ (:else `(->> (->> ,x ,form) ,@more))))
+
+(defmacro --> (x &rest forms)
+ "Starting with the value of X, thread each expression through FORMS.
+
+Insert X at the position signified by the symbol `it' in the first
+form. If there are more forms, insert the first form at the position
+signified by `it' in in second form, etc."
+ (declare (debug (form body)))
+ `(-as-> ,x it ,@forms))
+
+(defmacro -as-> (value variable &rest forms)
+ "Starting with VALUE, thread VARIABLE through FORMS.
+
+In the first form, bind VARIABLE to VALUE. In the second form, bind
+VARIABLE to the result of the first form, and so forth."
+ (declare (debug (form symbolp body)))
+ (if (null forms)
+ `,value
+ `(let ((,variable ,value))
+ (-as-> ,(if (symbolp (car forms))
+ (list (car forms) variable)
+ (car forms))
+ ,variable
+ ,@(cdr forms)))))
+
+(defmacro -some-> (x &optional form &rest more)
+ "When expr is non-nil, thread it through the first form (via `->'),
+and when that result is non-nil, through the next form, etc."
+ (declare (debug ->)
+ (indent 1))
+ (if (null form) x
+ (let ((result (make-symbol "result")))
+ `(-some-> (-when-let (,result ,x)
+ (-> ,result ,form))
+ ,@more))))
+
+(defmacro -some->> (x &optional form &rest more)
+ "When expr is non-nil, thread it through the first form (via `->>'),
+and when that result is non-nil, through the next form, etc."
+ (declare (debug ->)
+ (indent 1))
+ (if (null form) x
+ (let ((result (make-symbol "result")))
+ `(-some->> (-when-let (,result ,x)
+ (->> ,result ,form))
+ ,@more))))
+
+(defmacro -some--> (expr &rest forms)
+ "Thread EXPR through FORMS via `-->', while the result is non-nil.
+When EXPR evaluates to non-nil, thread the result through the
+first of FORMS, and when that result is non-nil, thread it
+through the next form, etc."
+ (declare (debug (form &rest &or symbolp consp)) (indent 1))
+ (if (null forms) expr
+ (let ((result (make-symbol "result")))
+ `(-some--> (-when-let (,result ,expr)
+ (--> ,result ,(car forms)))
+ ,@(cdr forms)))))
+
+(defmacro -doto (init &rest forms)
+ "Evaluate INIT and pass it as argument to FORMS with `->'.
+The RESULT of evaluating INIT is threaded through each of FORMS
+individually using `->', which see. The return value is RESULT,
+which FORMS may have modified by side effect."
+ (declare (debug (form &rest &or symbolp consp)) (indent 1))
+ (let ((retval (make-symbol "result")))
+ `(let ((,retval ,init))
+ ,@(mapcar (lambda (form) `(-> ,retval ,form)) forms)
+ ,retval)))
+
+(defmacro --doto (init &rest forms)
+ "Anaphoric form of `-doto'.
+This just evaluates INIT, binds the result to `it', evaluates
+FORMS, and returns the final value of `it'.
+Note: `it' need not be used in each form."
+ (declare (debug (form body)) (indent 1))
+ `(let ((it ,init))
+ ,@forms
+ it))
+
+(defun -grade-up (comparator list)
+ "Grade elements of LIST using COMPARATOR relation.
+This yields a permutation vector such that applying this
+permutation to LIST sorts it in ascending order."
+ (->> (--map-indexed (cons it it-index) list)
+ (-sort (lambda (it other) (funcall comparator (car it) (car other))))
+ (mapcar #'cdr)))
+
+(defun -grade-down (comparator list)
+ "Grade elements of LIST using COMPARATOR relation.
+This yields a permutation vector such that applying this
+permutation to LIST sorts it in descending order."
+ (->> (--map-indexed (cons it it-index) list)
+ (-sort (lambda (it other) (funcall comparator (car other) (car it))))
+ (mapcar #'cdr)))
+
+(defvar dash--source-counter 0
+ "Monotonic counter for generated symbols.")
+
+(defun dash--match-make-source-symbol ()
+ "Generate a new dash-source symbol.
+
+All returned symbols are guaranteed to be unique."
+ (prog1 (make-symbol (format "--dash-source-%d--" dash--source-counter))
+ (setq dash--source-counter (1+ dash--source-counter))))
+
+(defun dash--match-ignore-place-p (symbol)
+ "Return non-nil if SYMBOL is a symbol and starts with _."
+ (and (symbolp symbol)
+ (eq (aref (symbol-name symbol) 0) ?_)))
+
+(defun dash--match-cons-skip-cdr (skip-cdr source)
+ "Helper function generating idiomatic shifting code."
+ (cond
+ ((= skip-cdr 0)
+ `(pop ,source))
+ (t
+ `(prog1 ,(dash--match-cons-get-car skip-cdr source)
+ (setq ,source ,(dash--match-cons-get-cdr (1+ skip-cdr) source))))))
+
+(defun dash--match-cons-get-car (skip-cdr source)
+ "Helper function generating idiomatic code to get nth car."
+ (cond
+ ((= skip-cdr 0)
+ `(car ,source))
+ ((= skip-cdr 1)
+ `(cadr ,source))
+ (t
+ `(nth ,skip-cdr ,source))))
+
+(defun dash--match-cons-get-cdr (skip-cdr source)
+ "Helper function generating idiomatic code to get nth cdr."
+ (cond
+ ((= skip-cdr 0)
+ source)
+ ((= skip-cdr 1)
+ `(cdr ,source))
+ (t
+ `(nthcdr ,skip-cdr ,source))))
+
+(defun dash--match-cons (match-form source)
+ "Setup a cons matching environment and call the real matcher."
+ (let ((s (dash--match-make-source-symbol))
+ (n 0)
+ (m match-form))
+ (while (and (consp m)
+ (dash--match-ignore-place-p (car m)))
+ (setq n (1+ n)) (!cdr m))
+ (cond
+ ;; when we only have one pattern in the list, we don't have to
+ ;; create a temporary binding (--dash-source--) for the source
+ ;; and just use the input directly
+ ((and (consp m)
+ (not (cdr m)))
+ (dash--match (car m) (dash--match-cons-get-car n source)))
+ ;; handle other special types
+ ((> n 0)
+ (dash--match m (dash--match-cons-get-cdr n source)))
+ ;; this is the only entry-point for dash--match-cons-1, that's
+ ;; why we can't simply use the above branch, it would produce
+ ;; infinite recursion
+ (t
+ (cons (list s source) (dash--match-cons-1 match-form s))))))
+
+(defun dash--get-expand-function (type)
+ "Get expand function name for TYPE."
+ (intern-soft (format "dash-expand:%s" type)))
+
+(defun dash--match-cons-1 (match-form source &optional props)
+ "Match MATCH-FORM against SOURCE.
+
+MATCH-FORM is a proper or improper list. Each element of
+MATCH-FORM is either a symbol, which gets bound to the respective
+value in source or another match form which gets destructured
+recursively.
+
+If the cdr of last cons cell in the list is `nil', matching stops
+there.
+
+SOURCE is a proper or improper list."
+ (let ((skip-cdr (or (plist-get props :skip-cdr) 0)))
+ (cond
+ ((consp match-form)
+ (cond
+ ((cdr match-form)
+ (cond
+ ((and (symbolp (car match-form))
+ (functionp (dash--get-expand-function (car match-form))))
+ (dash--match-kv (dash--match-kv-normalize-match-form match-form) (dash--match-cons-get-cdr skip-cdr source)))
+ ((dash--match-ignore-place-p (car match-form))
+ (dash--match-cons-1 (cdr match-form) source
+ (plist-put props :skip-cdr (1+ skip-cdr))))
+ (t
+ (-concat (dash--match (car match-form) (dash--match-cons-skip-cdr skip-cdr source))
+ (dash--match-cons-1 (cdr match-form) source)))))
+ (t ;; Last matching place, no need for shift
+ (dash--match (car match-form) (dash--match-cons-get-car skip-cdr source)))))
+ ((eq match-form nil)
+ nil)
+ (t ;; Handle improper lists. Last matching place, no need for shift
+ (dash--match match-form (dash--match-cons-get-cdr skip-cdr source))))))
+
+(defun dash--match-vector (match-form source)
+ "Setup a vector matching environment and call the real matcher."
+ (let ((s (dash--match-make-source-symbol)))
+ (cond
+ ;; don't bind `s' if we only have one sub-pattern
+ ((= (length match-form) 1)
+ (dash--match (aref match-form 0) `(aref ,source 0)))
+ ;; if the source is a symbol, we don't need to re-bind it
+ ((symbolp source)
+ (dash--match-vector-1 match-form source))
+ ;; don't bind `s' if we only have one sub-pattern which is not ignored
+ ((let* ((ignored-places (mapcar 'dash--match-ignore-place-p match-form))
+ (ignored-places-n (length (-remove 'null ignored-places))))
+ (when (= ignored-places-n (1- (length match-form)))
+ (let ((n (-find-index 'null ignored-places)))
+ (dash--match (aref match-form n) `(aref ,source ,n))))))
+ (t
+ (cons (list s source) (dash--match-vector-1 match-form s))))))
+
+(defun dash--match-vector-1 (match-form source)
+ "Match MATCH-FORM against SOURCE.
+
+MATCH-FORM is a vector. Each element of MATCH-FORM is either a
+symbol, which gets bound to the respective value in source or
+another match form which gets destructured recursively.
+
+If second-from-last place in MATCH-FORM is the symbol &rest, the
+next element of the MATCH-FORM is matched against the tail of
+SOURCE, starting at index of the &rest symbol. This is
+conceptually the same as the (head . tail) match for improper
+lists, where dot plays the role of &rest.
+
+SOURCE is a vector.
+
+If the MATCH-FORM vector is shorter than SOURCE vector, only
+the (length MATCH-FORM) places are bound, the rest of the SOURCE
+is discarded."
+ (let ((i 0)
+ (l (length match-form))
+ (re))
+ (while (< i l)
+ (let ((m (aref match-form i)))
+ (push (cond
+ ((and (symbolp m)
+ (eq m '&rest))
+ (prog1 (dash--match
+ (aref match-form (1+ i))
+ `(substring ,source ,i))
+ (setq i l)))
+ ((and (symbolp m)
+ ;; do not match symbols starting with _
+ (not (eq (aref (symbol-name m) 0) ?_)))
+ (list (list m `(aref ,source ,i))))
+ ((not (symbolp m))
+ (dash--match m `(aref ,source ,i))))
+ re)
+ (setq i (1+ i))))
+ (-flatten-n 1 (nreverse re))))
+
+(defun dash--match-kv-normalize-match-form (pattern)
+ "Normalize kv PATTERN.
+
+This method normalizes PATTERN to the format expected by
+`dash--match-kv'. See `-let' for the specification."
+ (let ((normalized (list (car pattern)))
+ (skip nil)
+ (fill-placeholder (make-symbol "--dash-fill-placeholder--")))
+ (-each (apply '-zip (-pad fill-placeholder (cdr pattern) (cddr pattern)))
+ (lambda (pair)
+ (let ((current (car pair))
+ (next (cdr pair)))
+ (if skip
+ (setq skip nil)
+ (if (or (eq fill-placeholder next)
+ (not (or (and (symbolp next)
+ (not (keywordp next))
+ (not (eq next t))
+ (not (eq next nil)))
+ (and (consp next)
+ (not (eq (car next) 'quote)))
+ (vectorp next))))
+ (progn
+ (cond
+ ((keywordp current)
+ (push current normalized)
+ (push (intern (substring (symbol-name current) 1)) normalized))
+ ((stringp current)
+ (push current normalized)
+ (push (intern current) normalized))
+ ((and (consp current)
+ (eq (car current) 'quote))
+ (push current normalized)
+ (push (cadr current) normalized))
+ (t (error "-let: found key `%s' in kv destructuring but its pattern `%s' is invalid and can not be derived from the key" current next)))
+ (setq skip nil))
+ (push current normalized)
+ (push next normalized)
+ (setq skip t))))))
+ (nreverse normalized)))
+
+(defun dash--match-kv (match-form source)
+ "Setup a kv matching environment and call the real matcher.
+
+kv can be any key-value store, such as plist, alist or hash-table."
+ (let ((s (dash--match-make-source-symbol)))
+ (cond
+ ;; don't bind `s' if we only have one sub-pattern (&type key val)
+ ((= (length match-form) 3)
+ (dash--match-kv-1 (cdr match-form) source (car match-form)))
+ ;; if the source is a symbol, we don't need to re-bind it
+ ((symbolp source)
+ (dash--match-kv-1 (cdr match-form) source (car match-form)))
+ (t
+ (cons (list s source) (dash--match-kv-1 (cdr match-form) s (car match-form)))))))
+
+(defun dash-expand:&hash (key source)
+ "Generate extracting KEY from SOURCE for &hash destructuring."
+ `(gethash ,key ,source))
+
+(defun dash-expand:&plist (key source)
+ "Generate extracting KEY from SOURCE for &plist destructuring."
+ `(plist-get ,source ,key))
+
+(defun dash-expand:&alist (key source)
+ "Generate extracting KEY from SOURCE for &alist destructuring."
+ `(cdr (assoc ,key ,source)))
+
+(defun dash-expand:&hash? (key source)
+ "Generate extracting KEY from SOURCE for &hash? destructuring.
+Similar to &hash but check whether the map is not nil."
+ (let ((src (make-symbol "src")))
+ `(let ((,src ,source))
+ (when ,src (gethash ,key ,src)))))
+
+(defalias 'dash-expand:&keys 'dash-expand:&plist)
+
+(defun dash--match-kv-1 (match-form source type)
+ "Match MATCH-FORM against SOURCE of type TYPE.
+
+MATCH-FORM is a proper list of the form (key1 place1 ... keyN
+placeN). Each placeK is either a symbol, which gets bound to the
+value of keyK retrieved from the key-value store, or another
+match form which gets destructured recursively.
+
+SOURCE is a key-value store of type TYPE, which can be a plist,
+an alist or a hash table.
+
+TYPE is a token specifying the type of the key-value store.
+Valid values are &plist, &alist and &hash."
+ (-flatten-n 1 (-map
+ (lambda (kv)
+ (let* ((k (car kv))
+ (v (cadr kv))
+ (getter
+ (funcall (dash--get-expand-function type) k source)))
+ (cond
+ ((symbolp v)
+ (list (list v getter)))
+ (t (dash--match v getter)))))
+ (-partition 2 match-form))))
+
+(defun dash--match-symbol (match-form source)
+ "Bind a symbol.
+
+This works just like `let', there is no destructuring."
+ (list (list match-form source)))
+
+(defun dash--match (match-form source)
+ "Match MATCH-FORM against SOURCE.
+
+This function tests the MATCH-FORM and dispatches to specific
+matchers based on the type of the expression.
+
+Key-value stores are disambiguated by placing a token &plist,
+&alist or &hash as a first item in the MATCH-FORM."
+ (cond
+ ((symbolp match-form)
+ (dash--match-symbol match-form source))
+ ((consp match-form)
+ (cond
+ ;; Handle the "x &as" bindings first.
+ ((and (consp (cdr match-form))
+ (symbolp (car match-form))
+ (eq '&as (cadr match-form)))
+ (let ((s (car match-form)))
+ (cons (list s source)
+ (dash--match (cddr match-form) s))))
+ ((functionp (dash--get-expand-function (car match-form)))
+ (dash--match-kv (dash--match-kv-normalize-match-form match-form) source))
+ (t (dash--match-cons match-form source))))
+ ((vectorp match-form)
+ ;; We support the &as binding in vectors too
+ (cond
+ ((and (> (length match-form) 2)
+ (symbolp (aref match-form 0))
+ (eq '&as (aref match-form 1)))
+ (let ((s (aref match-form 0)))
+ (cons (list s source)
+ (dash--match (substring match-form 2) s))))
+ (t (dash--match-vector match-form source))))))
+
+(defun dash--normalize-let-varlist (varlist)
+ "Normalize VARLIST so that every binding is a list.
+
+`let' allows specifying a binding which is not a list but simply
+the place which is then automatically bound to nil, such that all
+three of the following are identical and evaluate to nil.
+
+ (let (a) a)
+ (let ((a)) a)
+ (let ((a nil)) a)
+
+This function normalizes all of these to the last form."
+ (--map (if (consp it) it (list it nil)) varlist))
+
+(defmacro -let* (varlist &rest body)
+ "Bind variables according to VARLIST then eval BODY.
+
+VARLIST is a list of lists of the form (PATTERN SOURCE). Each
+PATTERN is matched against the SOURCE structurally. SOURCE is
+only evaluated once for each PATTERN.
+
+Each SOURCE can refer to the symbols already bound by this
+VARLIST. This is useful if you want to destructure SOURCE
+recursively but also want to name the intermediate structures.
+
+See `-let' for the list of all possible patterns."
+ (declare (debug ((&rest [&or (sexp form) sexp]) body))
+ (indent 1))
+ (let* ((varlist (dash--normalize-let-varlist varlist))
+ (bindings (--mapcat (dash--match (car it) (cadr it)) varlist)))
+ `(let* ,bindings
+ ,@body)))
+
+(defmacro -let (varlist &rest body)
+ "Bind variables according to VARLIST then eval BODY.
+
+VARLIST is a list of lists of the form (PATTERN SOURCE). Each
+PATTERN is matched against the SOURCE \"structurally\". SOURCE
+is only evaluated once for each PATTERN. Each PATTERN is matched
+recursively, and can therefore contain sub-patterns which are
+matched against corresponding sub-expressions of SOURCE.
+
+All the SOURCEs are evalled before any symbols are
+bound (i.e. \"in parallel\").
+
+If VARLIST only contains one (PATTERN SOURCE) element, you can
+optionally specify it using a vector and discarding the
+outer-most parens. Thus
+
+ (-let ((PATTERN SOURCE)) ...)
+
+becomes
+
+ (-let [PATTERN SOURCE] ...).
+
+`-let' uses a convention of not binding places (symbols) starting
+with _ whenever it's possible. You can use this to skip over
+entries you don't care about. However, this is not *always*
+possible (as a result of implementation) and these symbols might
+get bound to undefined values.
+
+Following is the overview of supported patterns. Remember that
+patterns can be matched recursively, so every a, b, aK in the
+following can be a matching construct and not necessarily a
+symbol/variable.
+
+Symbol:
+
+ a - bind the SOURCE to A. This is just like regular `let'.
+
+Conses and lists:
+
+ (a) - bind `car' of cons/list to A
+
+ (a . b) - bind car of cons to A and `cdr' to B
+
+ (a b) - bind car of list to A and `cadr' to B
+
+ (a1 a2 a3 ...) - bind 0th car of list to A1, 1st to A2, 2nd to A3...
+
+ (a1 a2 a3 ... aN . rest) - as above, but bind the Nth cdr to REST.
+
+Vectors:
+
+ [a] - bind 0th element of a non-list sequence to A (works with
+ vectors, strings, bit arrays...)
+
+ [a1 a2 a3 ...] - bind 0th element of non-list sequence to A0, 1st to
+ A1, 2nd to A2, ...
+ If the PATTERN is shorter than SOURCE, the values at
+ places not in PATTERN are ignored.
+ If the PATTERN is longer than SOURCE, an `error' is
+ thrown.
+
+ [a1 a2 a3 ... &rest rest] - as above, but bind the rest of
+ the sequence to REST. This is
+ conceptually the same as improper list
+ matching (a1 a2 ... aN . rest)
+
+Key/value stores:
+
+ (&plist key0 a0 ... keyN aN) - bind value mapped by keyK in the
+ SOURCE plist to aK. If the
+ value is not found, aK is nil.
+ Uses `plist-get' to fetch values.
+
+ (&alist key0 a0 ... keyN aN) - bind value mapped by keyK in the
+ SOURCE alist to aK. If the
+ value is not found, aK is nil.
+ Uses `assoc' to fetch values.
+
+ (&hash key0 a0 ... keyN aN) - bind value mapped by keyK in the
+ SOURCE hash table to aK. If the
+ value is not found, aK is nil.
+ Uses `gethash' to fetch values.
+
+Further, special keyword &keys supports \"inline\" matching of
+plist-like key-value pairs, similarly to &keys keyword of
+`cl-defun'.
+
+ (a1 a2 ... aN &keys key1 b1 ... keyN bK)
+
+This binds N values from the list to a1 ... aN, then interprets
+the cdr as a plist (see key/value matching above).
+
+A shorthand notation for kv-destructuring exists which allows the
+patterns be optionally left out and derived from the key name in
+the following fashion:
+
+- a key :foo is converted into `foo' pattern,
+- a key 'bar is converted into `bar' pattern,
+- a key \"baz\" is converted into `baz' pattern.
+
+That is, the entire value under the key is bound to the derived
+variable without any further destructuring.
+
+This is possible only when the form following the key is not a
+valid pattern (i.e. not a symbol, a cons cell or a vector).
+Otherwise the matching proceeds as usual and in case of an
+invalid spec fails with an error.
+
+Thus the patterns are normalized as follows:
+
+ ;; derive all the missing patterns
+ (&plist :foo 'bar \"baz\") => (&plist :foo foo 'bar bar \"baz\" baz)
+
+ ;; we can specify some but not others
+ (&plist :foo 'bar explicit-bar) => (&plist :foo foo 'bar explicit-bar)
+
+ ;; nothing happens, we store :foo in x
+ (&plist :foo x) => (&plist :foo x)
+
+ ;; nothing happens, we match recursively
+ (&plist :foo (a b c)) => (&plist :foo (a b c))
+
+You can name the source using the syntax SYMBOL &as PATTERN.
+This syntax works with lists (proper or improper), vectors and
+all types of maps.
+
+ (list &as a b c) (list 1 2 3)
+
+binds A to 1, B to 2, C to 3 and LIST to (1 2 3).
+
+Similarly:
+
+ (bounds &as beg . end) (cons 1 2)
+
+binds BEG to 1, END to 2 and BOUNDS to (1 . 2).
+
+ (items &as first . rest) (list 1 2 3)
+
+binds FIRST to 1, REST to (2 3) and ITEMS to (1 2 3)
+
+ [vect &as _ b c] [1 2 3]
+
+binds B to 2, C to 3 and VECT to [1 2 3] (_ avoids binding as usual).
+
+ (plist &as &plist :b b) (list :a 1 :b 2 :c 3)
+
+binds B to 2 and PLIST to (:a 1 :b 2 :c 3). Same for &alist and &hash.
+
+This is especially useful when we want to capture the result of a
+computation and destructure at the same time. Consider the
+form (function-returning-complex-structure) returning a list of
+two vectors with two items each. We want to capture this entire
+result and pass it to another computation, but at the same time
+we want to get the second item from each vector. We can achieve
+it with pattern
+
+ (result &as [_ a] [_ b]) (function-returning-complex-structure)
+
+Note: Clojure programmers may know this feature as the \":as
+binding\". The difference is that we put the &as at the front
+because we need to support improper list binding."
+ (declare (debug ([&or (&rest [&or (sexp form) sexp])
+ (vector [&rest [sexp form]])]
+ body))
+ (indent 1))
+ (if (vectorp varlist)
+ `(let* ,(dash--match (aref varlist 0) (aref varlist 1))
+ ,@body)
+ (let* ((varlist (dash--normalize-let-varlist varlist))
+ (inputs (--map-indexed (list (make-symbol (format "input%d" it-index)) (cadr it)) varlist))
+ (new-varlist (--map (list (caar it) (cadr it)) (-zip varlist inputs))))
+ `(let ,inputs
+ (-let* ,new-varlist ,@body)))))
+
+(defmacro -lambda (match-form &rest body)
+ "Return a lambda which destructures its input as MATCH-FORM and executes BODY.
+
+Note that you have to enclose the MATCH-FORM in a pair of parens,
+such that:
+
+ (-lambda (x) body)
+ (-lambda (x y ...) body)
+
+has the usual semantics of `lambda'. Furthermore, these get
+translated into normal `lambda', so there is no performance
+penalty.
+
+See `-let' for a description of the destructuring mechanism."
+ (declare (doc-string 2) (indent defun)
+ (debug (&define sexp
+ [&optional stringp]
+ [&optional ("interactive" interactive)]
+ def-body)))
+ (cond
+ ((nlistp match-form)
+ (signal 'wrong-type-argument (list #'listp match-form)))
+ ;; No destructuring, so just return regular `lambda' for speed.
+ ((-all? #'symbolp match-form)
+ `(lambda ,match-form ,@body))
+ ((let ((inputs (--map-indexed
+ (list it (make-symbol (format "input%d" it-index)))
+ match-form)))
+ ;; TODO: because inputs to the `lambda' are evaluated only once,
+ ;; `-let*' need not create the extra bindings to ensure that.
+ ;; We should find a way to optimize that. Not critical however.
+ `(lambda ,(mapcar #'cadr inputs)
+ (-let* ,inputs ,@body))))))
+
+(defmacro -setq (&rest forms)
+ "Bind each MATCH-FORM to the value of its VAL.
+
+MATCH-FORM destructuring is done according to the rules of `-let'.
+
+This macro allows you to bind multiple variables by destructuring
+the value, so for example:
+
+ (-setq (a b) x
+ (&plist :c c) plist)
+
+expands roughly speaking to the following code
+
+ (setq a (car x)
+ b (cadr x)
+ c (plist-get plist :c))
+
+Care is taken to only evaluate each VAL once so that in case of
+multiple assignments it does not cause unexpected side effects.
+
+\(fn [MATCH-FORM VAL]...)"
+ (declare (debug (&rest sexp form))
+ (indent 1))
+ (when (= (mod (length forms) 2) 1)
+ (signal 'wrong-number-of-arguments (list '-setq (1+ (length forms)))))
+ (let* ((forms-and-sources
+ ;; First get all the necessary mappings with all the
+ ;; intermediate bindings.
+ (-map (lambda (x) (dash--match (car x) (cadr x)))
+ (-partition 2 forms)))
+ ;; To preserve the logic of dynamic scoping we must ensure
+ ;; that we `setq' the variables outside of the `let*' form
+ ;; which holds the destructured intermediate values. For
+ ;; this we generate for each variable a placeholder which is
+ ;; bound to (lexically) the result of the destructuring.
+ ;; Then outside of the helper `let*' form we bind all the
+ ;; original variables to their respective placeholders.
+ ;; TODO: There is a lot of room for possible optimization,
+ ;; for start playing with `special-variable-p' to eliminate
+ ;; unnecessary re-binding.
+ (variables-to-placeholders
+ (-mapcat
+ (lambda (bindings)
+ (-map
+ (lambda (binding)
+ (let ((var (car binding)))
+ (list var (make-symbol (concat "--dash-binding-" (symbol-name var) "--")))))
+ (--filter (not (string-prefix-p "--" (symbol-name (car it)))) bindings)))
+ forms-and-sources)))
+ `(let ,(-map 'cadr variables-to-placeholders)
+ (let* ,(-flatten-n 1 forms-and-sources)
+ (setq ,@(-flatten (-map 'reverse variables-to-placeholders))))
+ (setq ,@(-flatten variables-to-placeholders)))))
+
+(defmacro -if-let* (vars-vals then &rest else)
+ "If all VALS evaluate to true, bind them to their corresponding
+VARS and do THEN, otherwise do ELSE. VARS-VALS should be a list
+of (VAR VAL) pairs.
+
+Note: binding is done according to `-let*'. VALS are evaluated
+sequentially, and evaluation stops after the first nil VAL is
+encountered."
+ (declare (debug ((&rest (sexp form)) form body))
+ (indent 2))
+ (->> vars-vals
+ (--mapcat (dash--match (car it) (cadr it)))
+ (--reduce-r-from
+ (let ((var (car it))
+ (val (cadr it)))
+ `(let ((,var ,val))
+ (if ,var ,acc ,@else)))
+ then)))
+
+(defmacro -if-let (var-val then &rest else)
+ "If VAL evaluates to non-nil, bind it to VAR and do THEN,
+otherwise do ELSE.
+
+Note: binding is done according to `-let'.
+
+\(fn (VAR VAL) THEN &rest ELSE)"
+ (declare (debug ((sexp form) form body))
+ (indent 2))
+ `(-if-let* (,var-val) ,then ,@else))
+
+(defmacro --if-let (val then &rest else)
+ "If VAL evaluates to non-nil, bind it to symbol `it' and do THEN,
+otherwise do ELSE."
+ (declare (debug (form form body))
+ (indent 2))
+ `(-if-let (it ,val) ,then ,@else))
+
+(defmacro -when-let* (vars-vals &rest body)
+ "If all VALS evaluate to true, bind them to their corresponding
+VARS and execute body. VARS-VALS should be a list of (VAR VAL)
+pairs.
+
+Note: binding is done according to `-let*'. VALS are evaluated
+sequentially, and evaluation stops after the first nil VAL is
+encountered."
+ (declare (debug ((&rest (sexp form)) body))
+ (indent 1))
+ `(-if-let* ,vars-vals (progn ,@body)))
+
+(defmacro -when-let (var-val &rest body)
+ "If VAL evaluates to non-nil, bind it to VAR and execute body.
+
+Note: binding is done according to `-let'.
+
+\(fn (VAR VAL) &rest BODY)"
+ (declare (debug ((sexp form) body))
+ (indent 1))
+ `(-if-let ,var-val (progn ,@body)))
+
+(defmacro --when-let (val &rest body)
+ "If VAL evaluates to non-nil, bind it to symbol `it' and
+execute body."
+ (declare (debug (form body))
+ (indent 1))
+ `(--if-let ,val (progn ,@body)))
+
+(defvar -compare-fn nil
+ "Tests for equality use this function or `equal' if this is nil.
+It should only be set using dynamic scope with a let, like:
+
+ (let ((-compare-fn #\\='=)) (-union numbers1 numbers2 numbers3)")
+
+(defun -distinct (list)
+ "Return a new list with all duplicates removed.
+The test for equality is done with `equal',
+or with `-compare-fn' if that's non-nil.
+
+Alias: `-uniq'"
+ ;; Implementation note: The speedup gained from hash table lookup
+ ;; starts to outweigh its overhead for lists of length greater than
+ ;; 32. See discussion in PR #305.
+ (let* ((len (length list))
+ (lut (and (> len 32)
+ ;; Check that `-compare-fn' is a valid hash-table
+ ;; lookup function or `nil'.
+ (memq -compare-fn '(nil equal eq eql))
+ (make-hash-table :test (or -compare-fn #'equal)
+ :size len))))
+ (if lut
+ (--filter (unless (gethash it lut)
+ (puthash it t lut))
+ list)
+ (--each list (unless (-contains? lut it) (!cons it lut)))
+ (nreverse lut))))
+
+(defalias '-uniq '-distinct)
+
+(defun -union (list list2)
+ "Return a new list containing the elements of LIST and elements of LIST2 that are not in LIST.
+The test for equality is done with `equal',
+or with `-compare-fn' if that's non-nil."
+ ;; We fall back to iteration implementation if the comparison
+ ;; function isn't one of `eq', `eql' or `equal'.
+ (let* ((result (reverse list))
+ ;; TODO: get rid of this dynamic variable, pass it as an
+ ;; argument instead.
+ (-compare-fn (if (bound-and-true-p -compare-fn)
+ -compare-fn
+ 'equal)))
+ (if (memq -compare-fn '(eq eql equal))
+ (let ((ht (make-hash-table :test -compare-fn)))
+ (--each list (puthash it t ht))
+ (--each list2 (unless (gethash it ht) (!cons it result))))
+ (--each list2 (unless (-contains? result it) (!cons it result))))
+ (nreverse result)))
+
+(defun -intersection (list list2)
+ "Return a new list containing only the elements that are members of both LIST and LIST2.
+The test for equality is done with `equal',
+or with `-compare-fn' if that's non-nil."
+ (--filter (-contains? list2 it) list))
+
+(defun -difference (list list2)
+ "Return a new list with only the members of LIST that are not in LIST2.
+The test for equality is done with `equal',
+or with `-compare-fn' if that's non-nil."
+ (--filter (not (-contains? list2 it)) list))
+
+(defun -powerset (list)
+ "Return the power set of LIST."
+ (if (null list) '(())
+ (let ((last (-powerset (cdr list))))
+ (append (mapcar (lambda (x) (cons (car list) x)) last)
+ last))))
+
+(defun -permutations (list)
+ "Return the permutations of LIST."
+ (if (null list) '(())
+ (apply #'append
+ (mapcar (lambda (x)
+ (mapcar (lambda (perm) (cons x perm))
+ (-permutations (remove x list))))
+ list))))
+
+(defun -inits (list)
+ "Return all prefixes of LIST."
+ (let ((res (list list)))
+ (setq list (reverse list))
+ (while list
+ (push (reverse (!cdr list)) res))
+ res))
+
+(defun -tails (list)
+ "Return all suffixes of LIST"
+ (-reductions-r-from 'cons nil list))
+
+(defun -common-prefix (&rest lists)
+ "Return the longest common prefix of LISTS."
+ (declare (pure t) (side-effect-free t))
+ (--reduce (--take-while (and acc (equal (pop acc) it)) it)
+ lists))
+
+(defun -common-suffix (&rest lists)
+ "Return the longest common suffix of LISTS."
+ (nreverse (apply #'-common-prefix (mapcar #'reverse lists))))
+
+(defun -contains? (list element)
+ "Return non-nil if LIST contains ELEMENT.
+
+The test for equality is done with `equal', or with `-compare-fn'
+if that's non-nil.
+
+Alias: `-contains-p'"
+ (not
+ (null
+ (cond
+ ((null -compare-fn) (member element list))
+ ((eq -compare-fn 'eq) (memq element list))
+ ((eq -compare-fn 'eql) (memql element list))
+ (t
+ (let ((lst list))
+ (while (and lst
+ (not (funcall -compare-fn element (car lst))))
+ (setq lst (cdr lst)))
+ lst))))))
+
+(defalias '-contains-p '-contains?)
+
+(defun -same-items? (list list2)
+ "Return true if LIST and LIST2 has the same items.
+
+The order of the elements in the lists does not matter.
+
+Alias: `-same-items-p'"
+ (let ((length-a (length list))
+ (length-b (length list2)))
+ (and
+ (= length-a length-b)
+ (= length-a (length (-intersection list list2))))))
+
+(defalias '-same-items-p '-same-items?)
+
+(defun -is-prefix? (prefix list)
+ "Return non-nil if PREFIX is a prefix of LIST.
+
+Alias: `-is-prefix-p'."
+ (declare (pure t) (side-effect-free t))
+ (--each-while list (and (equal (car prefix) it)
+ (!cdr prefix)))
+ (null prefix))
+
+(defun -is-suffix? (suffix list)
+ "Return non-nil if SUFFIX is a suffix of LIST.
+
+Alias: `-is-suffix-p'."
+ (declare (pure t) (side-effect-free t))
+ (equal suffix (last list (length suffix))))
+
+(defun -is-infix? (infix list)
+ "Return non-nil if INFIX is infix of LIST.
+
+This operation runs in O(n^2) time
+
+Alias: `-is-infix-p'"
+ (declare (pure t) (side-effect-free t))
+ (let (done)
+ (while (and (not done) list)
+ (setq done (-is-prefix? infix list))
+ (!cdr list))
+ done))
+
+(defalias '-is-prefix-p '-is-prefix?)
+(defalias '-is-suffix-p '-is-suffix?)
+(defalias '-is-infix-p '-is-infix?)
+
+(defun -sort (comparator list)
+ "Sort LIST, stably, comparing elements using COMPARATOR.
+Return the sorted list. LIST is NOT modified by side effects.
+COMPARATOR is called with two elements of LIST, and should return non-nil
+if the first element should sort before the second."
+ (sort (copy-sequence list) comparator))
+
+(defmacro --sort (form list)
+ "Anaphoric form of `-sort'."
+ (declare (debug (def-form form)))
+ `(-sort (lambda (it other) ,form) ,list))
+
+(defun -list (&optional arg &rest args)
+ "Ensure ARG is a list.
+If ARG is already a list, return it as is (not a copy).
+Otherwise, return a new list with ARG as its only element.
+
+Another supported calling convention is (-list &rest ARGS).
+In this case, if ARG is not a list, a new list with all of
+ARGS as elements is returned. This use is supported for
+backward compatibility and is otherwise deprecated."
+ (declare (advertised-calling-convention (arg) "2.18.0")
+ (pure t) (side-effect-free t))
+ (if (listp arg) arg (cons arg args)))
+
+(defun -repeat (n x)
+ "Return a new list of length N with each element being X.
+Return nil if N is less than 1."
+ (declare (pure t) (side-effect-free t))
+ (and (natnump n) (make-list n x)))
+
+(defun -sum (list)
+ "Return the sum of LIST."
+ (declare (pure t) (side-effect-free t))
+ (apply '+ list))
+
+(defun -running-sum (list)
+ "Return a list with running sums of items in LIST.
+LIST must be non-empty."
+ (declare (pure t) (side-effect-free t))
+ (or list (signal 'wrong-type-argument (list #'consp list)))
+ (-reductions #'+ list))
+
+(defun -product (list)
+ "Return the product of LIST."
+ (declare (pure t) (side-effect-free t))
+ (apply '* list))
+
+(defun -running-product (list)
+ "Return a list with running products of items in LIST.
+LIST must be non-empty."
+ (declare (pure t) (side-effect-free t))
+ (or list (signal 'wrong-type-argument (list #'consp list)))
+ (-reductions #'* list))
+
+(defun -max (list)
+ "Return the largest value from LIST of numbers or markers."
+ (declare (pure t) (side-effect-free t))
+ (apply 'max list))
+
+(defun -min (list)
+ "Return the smallest value from LIST of numbers or markers."
+ (declare (pure t) (side-effect-free t))
+ (apply 'min list))
+
+(defun -max-by (comparator list)
+ "Take a comparison function COMPARATOR and a LIST and return
+the greatest element of the list by the comparison function.
+
+See also combinator `-on' which can transform the values before
+comparing them."
+ (--reduce (if (funcall comparator it acc) it acc) list))
+
+(defun -min-by (comparator list)
+ "Take a comparison function COMPARATOR and a LIST and return
+the least element of the list by the comparison function.
+
+See also combinator `-on' which can transform the values before
+comparing them."
+ (--reduce (if (funcall comparator it acc) acc it) list))
+
+(defmacro --max-by (form list)
+ "Anaphoric version of `-max-by'.
+
+The items for the comparator form are exposed as \"it\" and \"other\"."
+ (declare (debug (def-form form)))
+ `(-max-by (lambda (it other) ,form) ,list))
+
+(defmacro --min-by (form list)
+ "Anaphoric version of `-min-by'.
+
+The items for the comparator form are exposed as \"it\" and \"other\"."
+ (declare (debug (def-form form)))
+ `(-min-by (lambda (it other) ,form) ,list))
+
+(defun -iota (count &optional start step)
+ "Return a list containing COUNT numbers.
+Starts from START and adds STEP each time. The default START is
+zero, the default STEP is 1.
+This function takes its name from the corresponding primitive in
+the APL language."
+ (declare (pure t) (side-effect-free t))
+ (unless (natnump count)
+ (signal 'wrong-type-argument (list #'natnump count)))
+ (or start (setq start 0))
+ (or step (setq step 1))
+ (if (zerop step)
+ (make-list count start)
+ (--iterate (+ it step) start count)))
+
+(defun -fix (fn list)
+ "Compute the (least) fixpoint of FN with initial input LIST.
+
+FN is called at least once, results are compared with `equal'."
+ (let ((re (funcall fn list)))
+ (while (not (equal list re))
+ (setq list re)
+ (setq re (funcall fn re)))
+ re))
+
+(defmacro --fix (form list)
+ "Anaphoric form of `-fix'."
+ (declare (debug (def-form form)))
+ `(-fix (lambda (it) ,form) ,list))
+
+(defun -unfold (fun seed)
+ "Build a list from SEED using FUN.
+
+This is \"dual\" operation to `-reduce-r': while -reduce-r
+consumes a list to produce a single value, `-unfold' takes a
+seed value and builds a (potentially infinite!) list.
+
+FUN should return `nil' to stop the generating process, or a
+cons (A . B), where A will be prepended to the result and B is
+the new seed."
+ (let ((last (funcall fun seed)) r)
+ (while last
+ (push (car last) r)
+ (setq last (funcall fun (cdr last))))
+ (nreverse r)))
+
+(defmacro --unfold (form seed)
+ "Anaphoric version of `-unfold'."
+ (declare (debug (def-form form)))
+ `(-unfold (lambda (it) ,form) ,seed))
+
+(defun -cons-pair? (obj)
+ "Return non-nil if OBJ is a true cons pair.
+That is, a cons (A . B) where B is not a list.
+
+Alias: `-cons-pair-p'."
+ (declare (pure t) (side-effect-free t))
+ (nlistp (cdr-safe obj)))
+
+(defalias '-cons-pair-p '-cons-pair?)
+
+(defun -cons-to-list (con)
+ "Convert a cons pair to a list with `car' and `cdr' of the pair respectively."
+ (declare (pure t) (side-effect-free t))
+ (list (car con) (cdr con)))
+
+(defun -value-to-list (val)
+ "Convert a value to a list.
+
+If the value is a cons pair, make a list with two elements, `car'
+and `cdr' of the pair respectively.
+
+If the value is anything else, wrap it in a list."
+ (declare (pure t) (side-effect-free t))
+ (cond
+ ((-cons-pair? val) (-cons-to-list val))
+ (t (list val))))
+
+(defun -tree-mapreduce-from (fn folder init-value tree)
+ "Apply FN to each element of TREE, and make a list of the results.
+If elements of TREE are lists themselves, apply FN recursively to
+elements of these nested lists.
+
+Then reduce the resulting lists using FOLDER and initial value
+INIT-VALUE. See `-reduce-r-from'.
+
+This is the same as calling `-tree-reduce-from' after `-tree-map'
+but is twice as fast as it only traverse the structure once."
+ (cond
+ ((not tree) nil)
+ ((-cons-pair? tree) (funcall fn tree))
+ ((listp tree)
+ (-reduce-r-from folder init-value (mapcar (lambda (x) (-tree-mapreduce-from fn folder init-value x)) tree)))
+ (t (funcall fn tree))))
+
+(defmacro --tree-mapreduce-from (form folder init-value tree)
+ "Anaphoric form of `-tree-mapreduce-from'."
+ (declare (debug (def-form def-form form form)))
+ `(-tree-mapreduce-from (lambda (it) ,form) (lambda (it acc) ,folder) ,init-value ,tree))
+
+(defun -tree-mapreduce (fn folder tree)
+ "Apply FN to each element of TREE, and make a list of the results.
+If elements of TREE are lists themselves, apply FN recursively to
+elements of these nested lists.
+
+Then reduce the resulting lists using FOLDER and initial value
+INIT-VALUE. See `-reduce-r-from'.
+
+This is the same as calling `-tree-reduce' after `-tree-map'
+but is twice as fast as it only traverse the structure once."
+ (cond
+ ((not tree) nil)
+ ((-cons-pair? tree) (funcall fn tree))
+ ((listp tree)
+ (-reduce-r folder (mapcar (lambda (x) (-tree-mapreduce fn folder x)) tree)))
+ (t (funcall fn tree))))
+
+(defmacro --tree-mapreduce (form folder tree)
+ "Anaphoric form of `-tree-mapreduce'."
+ (declare (debug (def-form def-form form)))
+ `(-tree-mapreduce (lambda (it) ,form) (lambda (it acc) ,folder) ,tree))
+
+(defun -tree-map (fn tree)
+ "Apply FN to each element of TREE while preserving the tree structure."
+ (cond
+ ((not tree) nil)
+ ((-cons-pair? tree) (funcall fn tree))
+ ((listp tree)
+ (mapcar (lambda (x) (-tree-map fn x)) tree))
+ (t (funcall fn tree))))
+
+(defmacro --tree-map (form tree)
+ "Anaphoric form of `-tree-map'."
+ (declare (debug (def-form form)))
+ `(-tree-map (lambda (it) ,form) ,tree))
+
+(defun -tree-reduce-from (fn init-value tree)
+ "Use FN to reduce elements of list TREE.
+If elements of TREE are lists themselves, apply the reduction recursively.
+
+FN is first applied to INIT-VALUE and first element of the list,
+then on this result and second element from the list etc.
+
+The initial value is ignored on cons pairs as they always contain
+two elements."
+ (cond
+ ((not tree) nil)
+ ((-cons-pair? tree) tree)
+ ((listp tree)
+ (-reduce-r-from fn init-value (mapcar (lambda (x) (-tree-reduce-from fn init-value x)) tree)))
+ (t tree)))
+
+(defmacro --tree-reduce-from (form init-value tree)
+ "Anaphoric form of `-tree-reduce-from'."
+ (declare (debug (def-form form form)))
+ `(-tree-reduce-from (lambda (it acc) ,form) ,init-value ,tree))
+
+(defun -tree-reduce (fn tree)
+ "Use FN to reduce elements of list TREE.
+If elements of TREE are lists themselves, apply the reduction recursively.
+
+FN is first applied to first element of the list and second
+element, then on this result and third element from the list etc.
+
+See `-reduce-r' for how exactly are lists of zero or one element handled."
+ (cond
+ ((not tree) nil)
+ ((-cons-pair? tree) tree)
+ ((listp tree)
+ (-reduce-r fn (mapcar (lambda (x) (-tree-reduce fn x)) tree)))
+ (t tree)))
+
+(defmacro --tree-reduce (form tree)
+ "Anaphoric form of `-tree-reduce'."
+ (declare (debug (def-form form)))
+ `(-tree-reduce (lambda (it acc) ,form) ,tree))
+
+(defun -tree-map-nodes (pred fun tree)
+ "Call FUN on each node of TREE that satisfies PRED.
+
+If PRED returns nil, continue descending down this node. If PRED
+returns non-nil, apply FUN to this node and do not descend
+further."
+ (if (funcall pred tree)
+ (funcall fun tree)
+ (if (and (listp tree)
+ (not (-cons-pair? tree)))
+ (-map (lambda (x) (-tree-map-nodes pred fun x)) tree)
+ tree)))
+
+(defmacro --tree-map-nodes (pred form tree)
+ "Anaphoric form of `-tree-map-nodes'."
+ (declare (debug (def-form def-form form)))
+ `(-tree-map-nodes (lambda (it) ,pred) (lambda (it) ,form) ,tree))
+
+(defun -tree-seq (branch children tree)
+ "Return a sequence of the nodes in TREE, in depth-first search order.
+
+BRANCH is a predicate of one argument that returns non-nil if the
+passed argument is a branch, that is, a node that can have children.
+
+CHILDREN is a function of one argument that returns the children
+of the passed branch node.
+
+Non-branch nodes are simply copied."
+ (cons tree
+ (when (funcall branch tree)
+ (-mapcat (lambda (x) (-tree-seq branch children x))
+ (funcall children tree)))))
+
+(defmacro --tree-seq (branch children tree)
+ "Anaphoric form of `-tree-seq'."
+ (declare (debug (def-form def-form form)))
+ `(-tree-seq (lambda (it) ,branch) (lambda (it) ,children) ,tree))
+
+(defun -clone (list)
+ "Create a deep copy of LIST.
+The new list has the same elements and structure but all cons are
+replaced with new ones. This is useful when you need to clone a
+structure such as plist or alist."
+ (declare (pure t) (side-effect-free t))
+ (-tree-map 'identity list))
+
+;;; Combinators
+
+(defalias '-partial #'apply-partially)
+
+(defun -rpartial (fn &rest args)
+ "Return a function that is a partial application of FN to ARGS.
+ARGS is a list of the last N arguments to pass to FN. The result
+is a new function which does the same as FN, except that the last
+N arguments are fixed at the values with which this function was
+called. This is like `-partial', except the arguments are fixed
+starting from the right rather than the left."
+ (declare (pure t) (side-effect-free t))
+ (lambda (&rest args-before) (apply fn (append args-before args))))
+
+(defun -juxt (&rest fns)
+ "Return a function that is the juxtaposition of FNS.
+The returned function takes a variable number of ARGS, applies
+each of FNS in turn to ARGS, and returns the list of results."
+ (declare (pure t) (side-effect-free t))
+ (lambda (&rest args) (mapcar (lambda (x) (apply x args)) fns)))
+
+(defun -compose (&rest fns)
+ "Compose FNS into a single composite function.
+Return a function that takes a variable number of ARGS, applies
+the last function in FNS to ARGS, and returns the result of
+calling each remaining function on the result of the previous
+function, right-to-left. If no FNS are given, return a variadic
+`identity' function."
+ (declare (pure t) (side-effect-free t))
+ (let* ((fns (nreverse fns))
+ (head (car fns))
+ (tail (cdr fns)))
+ (cond (tail
+ (lambda (&rest args)
+ (--reduce-from (funcall it acc) (apply head args) tail)))
+ (fns head)
+ ((lambda (&optional arg &rest _) arg)))))
+
+(defun -applify (fn)
+ "Return a function that applies FN to a single list of args.
+This changes the arity of FN from taking N distinct arguments to
+taking 1 argument which is a list of N arguments."
+ (declare (pure t) (side-effect-free t))
+ (lambda (args) (apply fn args)))
+
+(defun -on (op trans)
+ "Return a function that calls TRANS on each arg and OP on the results.
+The returned function takes a variable number of arguments, calls
+the function TRANS on each one in turn, and then passes those
+results as the list of arguments to OP, in the same order.
+
+For example, the following pairs of expressions are morally
+equivalent:
+
+ (funcall (-on #\\='+ #\\='1+) 1 2 3) = (+ (1+ 1) (1+ 2) (1+ 3))
+ (funcall (-on #\\='+ #\\='1+)) = (+)"
+ (declare (pure t) (side-effect-free t))
+ (lambda (&rest args)
+ ;; This unrolling seems to be a relatively cheap way to keep the
+ ;; overhead of `mapcar' + `apply' in check.
+ (cond ((cddr args)
+ (apply op (mapcar trans args)))
+ ((cdr args)
+ (funcall op (funcall trans (car args)) (funcall trans (cadr args))))
+ (args
+ (funcall op (funcall trans (car args))))
+ ((funcall op)))))
+
+(defun -flip (fn)
+ "Return a function that calls FN with its arguments reversed.
+The returned function takes the same number of arguments as FN.
+
+For example, the following two expressions are morally
+equivalent:
+
+ (funcall (-flip #\\='-) 1 2) = (- 2 1)
+
+See also: `-rotate-args'."
+ (declare (pure t) (side-effect-free t))
+ (lambda (&rest args) ;; Open-code for speed.
+ (cond ((cddr args) (apply fn (nreverse args)))
+ ((cdr args) (funcall fn (cadr args) (car args)))
+ (args (funcall fn (car args)))
+ ((funcall fn)))))
+
+(defun -rotate-args (n fn)
+ "Return a function that calls FN with args rotated N places to the right.
+The returned function takes the same number of arguments as FN,
+rotates the list of arguments N places to the right (left if N is
+negative) just like `-rotate', and applies FN to the result.
+
+See also: `-flip'."
+ (declare (pure t) (side-effect-free t))
+ (if (zerop n)
+ fn
+ (let ((even (= (% n 2) 0)))
+ (lambda (&rest args)
+ (cond ((cddr args) ;; Open-code for speed.
+ (apply fn (-rotate n args)))
+ ((cdr args)
+ (let ((fst (car args))
+ (snd (cadr args)))
+ (funcall fn (if even fst snd) (if even snd fst))))
+ (args
+ (funcall fn (car args)))
+ ((funcall fn)))))))
+
+(defun -const (c)
+ "Return a function that returns C ignoring any additional arguments.
+
+In types: a -> b -> a"
+ (declare (pure t) (side-effect-free t))
+ (lambda (&rest _) c))
+
+(defmacro -cut (&rest params)
+ "Take n-ary function and n arguments and specialize some of them.
+Arguments denoted by <> will be left unspecialized.
+
+See SRFI-26 for detailed description."
+ (declare (debug (&optional sexp &rest &or "<>" form)))
+ (let* ((i 0)
+ (args (--keep (when (eq it '<>)
+ (setq i (1+ i))
+ (make-symbol (format "D%d" i)))
+ params)))
+ `(lambda ,args
+ ,(let ((body (--map (if (eq it '<>) (pop args) it) params)))
+ (if (eq (car params) '<>)
+ (cons #'funcall body)
+ body)))))
+
+(defun -not (pred)
+ "Return a predicate that negates the result of PRED.
+The returned predicate passes its arguments to PRED. If PRED
+returns nil, the result is non-nil; otherwise the result is nil.
+
+See also: `-andfn' and `-orfn'."
+ (declare (pure t) (side-effect-free t))
+ (lambda (&rest args) (not (apply pred args))))
+
+(defun -orfn (&rest preds)
+ "Return a predicate that returns the first non-nil result of PREDS.
+The returned predicate takes a variable number of arguments,
+passes them to each predicate in PREDS in turn until one of them
+returns non-nil, and returns that non-nil result without calling
+the remaining PREDS. If all PREDS return nil, or if no PREDS are
+given, the returned predicate returns nil.
+
+See also: `-andfn' and `-not'."
+ (declare (pure t) (side-effect-free t))
+ ;; Open-code for speed.
+ (cond ((cdr preds) (lambda (&rest args) (--some (apply it args) preds)))
+ (preds (car preds))
+ (#'ignore)))
+
+(defun -andfn (&rest preds)
+ "Return a predicate that returns non-nil if all PREDS do so.
+The returned predicate P takes a variable number of arguments and
+passes them to each predicate in PREDS in turn. If any one of
+PREDS returns nil, P also returns nil without calling the
+remaining PREDS. If all PREDS return non-nil, P returns the last
+such value. If no PREDS are given, P always returns non-nil.
+
+See also: `-orfn' and `-not'."
+ (declare (pure t) (side-effect-free t))
+ ;; Open-code for speed.
+ (cond ((cdr preds) (lambda (&rest args) (--every (apply it args) preds)))
+ (preds (car preds))
+ ;; As a `pure' function, this runtime check may generate
+ ;; backward-incompatible bytecode for `(-andfn)' at compile-time,
+ ;; but I doubt that's a problem in practice (famous last words).
+ ((fboundp 'always) #'always)
+ ((lambda (&rest _) t))))
+
+(defun -iteratefn (fn n)
+ "Return a function FN composed N times with itself.
+
+FN is a unary function. If you need to use a function of higher
+arity, use `-applify' first to turn it into a unary function.
+
+With n = 0, this acts as identity function.
+
+In types: (a -> a) -> Int -> a -> a.
+
+This function satisfies the following law:
+
+ (funcall (-iteratefn fn n) init) = (-last-item (-iterate fn init (1+ n)))."
+ (lambda (x) (--dotimes n (setq x (funcall fn x))) x))
+
+(defun -counter (&optional beg end inc)
+ "Return a closure that counts from BEG to END, with increment INC.
+
+The closure will return the next value in the counting sequence
+each time it is called, and nil after END is reached. BEG
+defaults to 0, INC defaults to 1, and if END is nil, the counter
+will increment indefinitely.
+
+The closure accepts any number of arguments, which are discarded."
+ (let ((inc (or inc 1))
+ (n (or beg 0)))
+ (lambda (&rest _)
+ (when (or (not end) (< n end))
+ (prog1 n
+ (setq n (+ n inc)))))))
+
+(defvar -fixfn-max-iterations 1000
+ "The default maximum number of iterations performed by `-fixfn'
+ unless otherwise specified.")
+
+(defun -fixfn (fn &optional equal-test halt-test)
+ "Return a function that computes the (least) fixpoint of FN.
+
+FN must be a unary function. The returned lambda takes a single
+argument, X, the initial value for the fixpoint iteration. The
+iteration halts when either of the following conditions is satisfied:
+
+ 1. Iteration converges to the fixpoint, with equality being
+ tested using EQUAL-TEST. If EQUAL-TEST is not specified,
+ `equal' is used. For functions over the floating point
+ numbers, it may be necessary to provide an appropriate
+ approximate comparison test.
+
+ 2. HALT-TEST returns a non-nil value. HALT-TEST defaults to a
+ simple counter that returns t after `-fixfn-max-iterations',
+ to guard against infinite iteration. Otherwise, HALT-TEST
+ must be a function that accepts a single argument, the
+ current value of X, and returns non-nil as long as iteration
+ should continue. In this way, a more sophisticated
+ convergence test may be supplied by the caller.
+
+The return value of the lambda is either the fixpoint or, if
+iteration halted before converging, a cons with car `halted' and
+cdr the final output from HALT-TEST.
+
+In types: (a -> a) -> a -> a."
+ (let ((eqfn (or equal-test 'equal))
+ (haltfn (or halt-test
+ (-not
+ (-counter 0 -fixfn-max-iterations)))))
+ (lambda (x)
+ (let ((re (funcall fn x))
+ (halt? (funcall haltfn x)))
+ (while (and (not halt?) (not (funcall eqfn x re)))
+ (setq x re
+ re (funcall fn re)
+ halt? (funcall haltfn re)))
+ (if halt? (cons 'halted halt?)
+ re)))))
+
+(defun -prodfn (&rest fns)
+ "Take a list of n functions and return a function that takes a
+list of length n, applying i-th function to i-th element of the
+input list. Returns a list of length n.
+
+In types (for n=2): ((a -> b), (c -> d)) -> (a, c) -> (b, d)
+
+This function satisfies the following laws:
+
+ (-compose (-prodfn f g ...) (-prodfn f\\=' g\\=' ...)) = (-prodfn (-compose f f\\=') (-compose g g\\=') ...)
+ (-prodfn f g ...) = (-juxt (-compose f (-partial \\='nth 0)) (-compose g (-partial \\='nth 1)) ...)
+ (-compose (-prodfn f g ...) (-juxt f\\=' g\\=' ...)) = (-juxt (-compose f f\\=') (-compose g g\\=') ...)
+ (-compose (-partial \\='nth n) (-prod f1 f2 ...)) = (-compose fn (-partial \\='nth n))"
+ (lambda (x) (-zip-with 'funcall fns x)))
+
+;;; Font lock
+
+(defvar dash--keywords
+ `(;; TODO: Do not fontify the following automatic variables
+ ;; globally; detect and limit to their local anaphoric scope.
+ (,(rx symbol-start (| "acc" "it" "it-index" "other") symbol-end)
+ 0 font-lock-variable-name-face)
+ ;; Macros in dev/examples.el. Based on `lisp-mode-symbol-regexp'.
+ (,(rx ?\( (group (| "defexamples" "def-example-group")) symbol-end
+ (+ (in "\t "))
+ (group (* (| (syntax word) (syntax symbol) (: ?\\ nonl)))))
+ (1 font-lock-keyword-face)
+ (2 font-lock-function-name-face))
+ ;; Symbols in dev/examples.el.
+ ,(rx symbol-start (| "=>" "~>" "!!>") symbol-end)
+ ;; Elisp macro fontification was static prior to Emacs 25.
+ ,@(when (< emacs-major-version 25)
+ (let ((macs '("!cdr"
+ "!cons"
+ "-->"
+ "--all?"
+ "--annotate"
+ "--any?"
+ "--count"
+ "--dotimes"
+ "--doto"
+ "--drop-while"
+ "--each"
+ "--each-r"
+ "--each-r-while"
+ "--each-while"
+ "--filter"
+ "--find-index"
+ "--find-indices"
+ "--find-last-index"
+ "--first"
+ "--fix"
+ "--group-by"
+ "--if-let"
+ "--iterate"
+ "--keep"
+ "--last"
+ "--map"
+ "--map-first"
+ "--map-indexed"
+ "--map-last"
+ "--map-when"
+ "--mapcat"
+ "--max-by"
+ "--min-by"
+ "--none?"
+ "--only-some?"
+ "--partition-by"
+ "--partition-by-header"
+ "--reduce"
+ "--reduce-from"
+ "--reduce-r"
+ "--reduce-r-from"
+ "--reductions"
+ "--reductions-from"
+ "--reductions-r"
+ "--reductions-r-from"
+ "--remove"
+ "--remove-first"
+ "--remove-last"
+ "--separate"
+ "--some"
+ "--sort"
+ "--splice"
+ "--splice-list"
+ "--split-when"
+ "--split-with"
+ "--take-while"
+ "--tree-map"
+ "--tree-map-nodes"
+ "--tree-mapreduce"
+ "--tree-mapreduce-from"
+ "--tree-reduce"
+ "--tree-reduce-from"
+ "--tree-seq"
+ "--unfold"
+ "--update-at"
+ "--when-let"
+ "--zip-with"
+ "->"
+ "->>"
+ "-as->"
+ "-doto"
+ "-if-let"
+ "-if-let*"
+ "-lambda"
+ "-let"
+ "-let*"
+ "-setq"
+ "-some-->"
+ "-some->"
+ "-some->>"
+ "-split-on"
+ "-when-let"
+ "-when-let*")))
+ `((,(concat "(" (regexp-opt macs 'symbols)) . 1)))))
+ "Font lock keywords for `dash-fontify-mode'.")
+
+(defcustom dash-fontify-mode-lighter nil
+ "Mode line lighter for `dash-fontify-mode'.
+Either a string to display in the mode line when
+`dash-fontify-mode' is on, or nil to display
+nothing (the default)."
+ :package-version '(dash . "2.18.0")
+ :group 'dash
+ :type '(choice (string :tag "Lighter" :value " Dash")
+ (const :tag "Nothing" nil)))
+
+;;;###autoload
+(define-minor-mode dash-fontify-mode
+ "Toggle fontification of Dash special variables.
+
+Dash-Fontify mode is a buffer-local minor mode intended for Emacs
+Lisp buffers. Enabling it causes the special variables bound in
+anaphoric Dash macros to be fontified. These anaphoras include
+`it', `it-index', `acc', and `other'. In older Emacs versions
+which do not dynamically detect macros, Dash-Fontify mode
+additionally fontifies Dash macro calls.
+
+See also `dash-fontify-mode-lighter' and
+`global-dash-fontify-mode'."
+ :group 'dash :lighter dash-fontify-mode-lighter
+ (if dash-fontify-mode
+ (font-lock-add-keywords nil dash--keywords t)
+ (font-lock-remove-keywords nil dash--keywords))
+ (cond ((fboundp 'font-lock-flush) ;; Added in Emacs 25.
+ (font-lock-flush))
+ ;; `font-lock-fontify-buffer' unconditionally enables
+ ;; `font-lock-mode' and is marked `interactive-only' in later
+ ;; Emacs versions which have `font-lock-flush', so we guard
+ ;; and pacify as needed, respectively.
+ (font-lock-mode
+ (with-no-warnings
+ (font-lock-fontify-buffer)))))
+
+(defun dash--turn-on-fontify-mode ()
+ "Enable `dash-fontify-mode' if in an Emacs Lisp buffer."
+ (when (derived-mode-p #'emacs-lisp-mode)
+ (dash-fontify-mode)))
+
+;;;###autoload
+(define-globalized-minor-mode global-dash-fontify-mode
+ dash-fontify-mode dash--turn-on-fontify-mode
+ :group 'dash)
+
+(defcustom dash-enable-fontlock nil
+ "If non-nil, fontify Dash macro calls and special variables."
+ :group 'dash
+ :set (lambda (sym val)
+ (set-default sym val)
+ (global-dash-fontify-mode (if val 1 0)))
+ :type 'boolean)
+
+(make-obsolete-variable
+ 'dash-enable-fontlock #'global-dash-fontify-mode "2.18.0")
+
+(define-obsolete-function-alias
+ 'dash-enable-font-lock #'global-dash-fontify-mode "2.18.0")
+
+;;; Info
+
+(defvar dash--info-doc-spec '("(dash) Index" nil "^ -+ .*: " "\\( \\|$\\)")
+ "The Dash :doc-spec entry for `info-lookup-alist'.
+It is based on that for `emacs-lisp-mode'.")
+
+(defun dash--info-elisp-docs ()
+ "Return the `emacs-lisp-mode' symbol docs from `info-lookup-alist'.
+Specifically, return the cons containing their
+`info-lookup->doc-spec' so that we can modify it."
+ (defvar info-lookup-alist)
+ (nthcdr 3 (assq #'emacs-lisp-mode (cdr (assq 'symbol info-lookup-alist)))))
+
+;;;###autoload
+(defun dash-register-info-lookup ()
+ "Register the Dash Info manual with `info-lookup-symbol'.
+This allows Dash symbols to be looked up with \\[info-lookup-symbol]."
+ (interactive)
+ (require 'info-look)
+ (let ((docs (dash--info-elisp-docs)))
+ (setcar docs (append (car docs) (list dash--info-doc-spec)))
+ (info-lookup-reset)))
+
+(defun dash-unload-function ()
+ "Remove Dash from `info-lookup-alist'.
+Used by `unload-feature', which see."
+ (let ((docs (and (featurep 'info-look)
+ (dash--info-elisp-docs))))
+ (when (member dash--info-doc-spec (car docs))
+ (setcar docs (remove dash--info-doc-spec (car docs)))
+ (info-lookup-reset)))
+ nil)
+
+(provide 'dash)
+;;; dash.el ends here
diff --git a/elpa/dash-20210826.1149/dash.elc b/elpa/dash-20210826.1149/dash.elc
new file mode 100644
index 0000000..c37e49e
--- /dev/null
+++ b/elpa/dash-20210826.1149/dash.elc
Binary files differ
diff --git a/elpa/dash-20210826.1149/dash.info b/elpa/dash-20210826.1149/dash.info
new file mode 100644
index 0000000..a6a2dc6
--- /dev/null
+++ b/elpa/dash-20210826.1149/dash.info
@@ -0,0 +1,4738 @@
+This is dash.info, produced by makeinfo version 6.7 from dash.texi.
+
+This manual is for Dash version 2.19.1.
+
+ Copyright © 2012–2021 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 the Invariant Sections being “GNU General Public
+ License,” and no Front-Cover Texts or Back-Cover Texts. A copy of
+ the license is included in the section entitled “GNU Free
+ Documentation License”.
+INFO-DIR-SECTION Emacs
+START-INFO-DIR-ENTRY
+* Dash: (dash.info). A modern list library for GNU Emacs.
+END-INFO-DIR-ENTRY
+
+
+File: dash.info, Node: Top, Next: Installation, Up: (dir)
+
+Dash
+****
+
+This manual is for Dash version 2.19.1.
+
+ Copyright © 2012–2021 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 the Invariant Sections being “GNU General Public
+ License,” and no Front-Cover Texts or Back-Cover Texts. A copy of
+ the license is included in the section entitled “GNU Free
+ Documentation License”.
+
+* Menu:
+
+* Installation:: Installing and configuring Dash.
+* Functions:: Dash API reference.
+* Development:: Contributing to Dash development.
+
+Appendices
+
+* FDL:: The license for this documentation.
+* GPL:: Conditions for copying and changing Dash.
+* Index:: Index including functions and macros.
+
+ — The Detailed Node Listing —
+
+Installation
+
+* Using in a package:: Listing Dash as a package dependency.
+* Fontification of special variables:: Font Lock of anaphoric macro variables.
+* Info symbol lookup:: Looking up Dash symbols in this manual.
+
+Functions
+
+* Maps::
+* Sublist selection::
+* List to list::
+* Reductions::
+* Unfolding::
+* Predicates::
+* Partitioning::
+* Indexing::
+* Set operations::
+* Other list operations::
+* Tree operations::
+* Threading macros::
+* Binding::
+* Side effects::
+* Destructive operations::
+* Function combinators::
+
+Development
+
+* Contribute:: How to contribute.
+* Contributors:: List of contributors.
+
+
+File: dash.info, Node: Installation, Next: Functions, Prev: Top, Up: Top
+
+1 Installation
+**************
+
+Dash is available on GNU ELPA (https://elpa.gnu.org/), GNU-devel ELPA
+(https://elpa.gnu.org/devel/), and MELPA (https://melpa.org/), and can
+be installed with the standard command ‘package-install’ (*note
+(emacs)Package Installation::).
+
+‘M-x package-install <RET> dash <RET>’
+ Install the Dash library.
+
+ Alternatively, you can just dump ‘dash.el’ in your ‘load-path’
+somewhere (*note (emacs)Lisp Libraries::).
+
+* Menu:
+
+* Using in a package:: Listing Dash as a package dependency.
+* Fontification of special variables:: Font Lock of anaphoric macro variables.
+* Info symbol lookup:: Looking up Dash symbols in this manual.
+
+
+File: dash.info, Node: Using in a package, Next: Fontification of special variables, Up: Installation
+
+1.1 Using in a package
+======================
+
+If you use Dash in your own package, be sure to list it as a dependency
+in the library’s headers as follows (*note (elisp)Library Headers::).
+
+ ;; Package-Requires: ((dash "2.19.1"))
+
+
+File: dash.info, Node: Fontification of special variables, Next: Info symbol lookup, Prev: Using in a package, Up: Installation
+
+1.2 Fontification of special variables
+======================================
+
+The autoloaded minor mode ‘dash-fontify-mode’ is provided for optional
+fontification of anaphoric Dash variables (‘it’, ‘acc’, etc.) in Emacs
+Lisp buffers using search-based Font Lock (*note (emacs)Font Lock::).
+In older Emacs versions which do not dynamically detect macros, the
+minor mode also fontifies calls to Dash macros.
+
+ To automatically enable the minor mode in all Emacs Lisp buffers,
+just call its autoloaded global counterpart ‘global-dash-fontify-mode’,
+either interactively or from your ‘user-init-file’:
+
+ (global-dash-fontify-mode)
+
+
+File: dash.info, Node: Info symbol lookup, Prev: Fontification of special variables, Up: Installation
+
+1.3 Info symbol lookup
+======================
+
+While editing Elisp files, you can use ‘C-h S’ (‘info-lookup-symbol’) to
+look up Elisp symbols in the relevant Info manuals (*note (emacs)Info
+Lookup::). To enable the same for Dash symbols, use the command
+‘dash-register-info-lookup’. It can be called directly when needed, or
+automatically from your ‘user-init-file’. For example:
+
+ (with-eval-after-load 'info-look
+ (dash-register-info-lookup))
+
+
+File: dash.info, Node: Functions, Next: Development, Prev: Installation, Up: Top
+
+2 Functions
+***********
+
+This chapter contains reference documentation for the Dash API
+(Application Programming Interface). The names of all public functions
+defined in the library are prefixed with a dash character (‘-’).
+
+ The library also provides anaphoric macro versions of functions where
+that makes sense. The names of these macros are prefixed with two
+dashes (‘--’) instead of one.
+
+ For instance, while the function ‘-map’ applies a function to each
+element of a list, its anaphoric counterpart ‘--map’ evaluates a form
+with the local variable ‘it’ temporarily bound to the current list
+element instead.
+
+ ;; Normal version.
+ (-map (lambda (n) (* n n)) '(1 2 3 4))
+ ⇒ (1 4 9 16)
+
+ ;; Anaphoric version.
+ (--map (* it it) '(1 2 3 4))
+ ⇒ (1 4 9 16)
+
+ The normal version can, of course, also be written as in the
+following example, which demonstrates the utility of both versions.
+
+ (defun my-square (n)
+ "Return N multiplied by itself."
+ (* n n))
+
+ (-map #'my-square '(1 2 3 4))
+ ⇒ (1 4 9 16)
+
+* Menu:
+
+* Maps::
+* Sublist selection::
+* List to list::
+* Reductions::
+* Unfolding::
+* Predicates::
+* Partitioning::
+* Indexing::
+* Set operations::
+* Other list operations::
+* Tree operations::
+* Threading macros::
+* Binding::
+* Side effects::
+* Destructive operations::
+* Function combinators::
+
+
+File: dash.info, Node: Maps, Next: Sublist selection, Up: Functions
+
+2.1 Maps
+========
+
+Functions in this category take a transforming function, which is then
+applied sequentially to each or selected elements of the input list.
+The results are collected in order and returned as a new list.
+
+ -- Function: -map (fn list)
+ Apply FN to each item in LIST and return the list of results.
+
+ This function’s anaphoric counterpart is ‘--map’.
+
+ (-map (lambda (num) (* num num)) '(1 2 3 4))
+ ⇒ (1 4 9 16)
+ (-map #'1+ '(1 2 3 4))
+ ⇒ (2 3 4 5)
+ (--map (* it it) '(1 2 3 4))
+ ⇒ (1 4 9 16)
+
+ -- Function: -map-when (pred rep list)
+ Return a new list where the elements in LIST that do not match the
+ PRED function are unchanged, and where the elements in LIST that do
+ match the PRED function are mapped through the REP function.
+
+ Alias: ‘-replace-where’
+
+ See also: ‘-update-at’ (*note -update-at::)
+
+ (-map-when 'even? 'square '(1 2 3 4))
+ ⇒ (1 4 3 16)
+ (--map-when (> it 2) (* it it) '(1 2 3 4))
+ ⇒ (1 2 9 16)
+ (--map-when (= it 2) 17 '(1 2 3 4))
+ ⇒ (1 17 3 4)
+
+ -- Function: -map-first (pred rep list)
+ Replace first item in LIST satisfying PRED with result of REP
+ called on this item.
+
+ See also: ‘-map-when’ (*note -map-when::), ‘-replace-first’ (*note
+ -replace-first::)
+
+ (-map-first 'even? 'square '(1 2 3 4))
+ ⇒ (1 4 3 4)
+ (--map-first (> it 2) (* it it) '(1 2 3 4))
+ ⇒ (1 2 9 4)
+ (--map-first (= it 2) 17 '(1 2 3 2))
+ ⇒ (1 17 3 2)
+
+ -- Function: -map-last (pred rep list)
+ Replace last item in LIST satisfying PRED with result of REP called
+ on this item.
+
+ See also: ‘-map-when’ (*note -map-when::), ‘-replace-last’ (*note
+ -replace-last::)
+
+ (-map-last 'even? 'square '(1 2 3 4))
+ ⇒ (1 2 3 16)
+ (--map-last (> it 2) (* it it) '(1 2 3 4))
+ ⇒ (1 2 3 16)
+ (--map-last (= it 2) 17 '(1 2 3 2))
+ ⇒ (1 2 3 17)
+
+ -- Function: -map-indexed (fn list)
+ Apply FN to each index and item in LIST and return the list of
+ results. This is like ‘-map’ (*note -map::), but FN takes two
+ arguments: the index of the current element within LIST, and the
+ element itself.
+
+ This function’s anaphoric counterpart is ‘--map-indexed’.
+
+ For a side-effecting variant, see also ‘-each-indexed’ (*note
+ -each-indexed::).
+
+ (-map-indexed (lambda (index item) (- item index)) '(1 2 3 4))
+ ⇒ (1 1 1 1)
+ (--map-indexed (- it it-index) '(1 2 3 4))
+ ⇒ (1 1 1 1)
+ (-map-indexed #'* '(1 2 3 4))
+ ⇒ (0 2 6 12)
+
+ -- Function: -annotate (fn list)
+ Return a list of cons cells where each cell is FN applied to each
+ element of LIST paired with the unmodified element of LIST.
+
+ (-annotate '1+ '(1 2 3))
+ ⇒ ((2 . 1) (3 . 2) (4 . 3))
+ (-annotate 'length '(("h" "e" "l" "l" "o") ("hello" "world")))
+ ⇒ ((5 "h" "e" "l" "l" "o") (2 "hello" "world"))
+ (--annotate (< 1 it) '(0 1 2 3))
+ ⇒ ((nil . 0) (nil . 1) (t . 2) (t . 3))
+
+ -- Function: -splice (pred fun list)
+ Splice lists generated by FUN in place of elements matching PRED in
+ LIST.
+
+ FUN takes the element matching PRED as input.
+
+ This function can be used as replacement for ‘,@’ in case you need
+ to splice several lists at marked positions (for example with
+ keywords).
+
+ See also: ‘-splice-list’ (*note -splice-list::), ‘-insert-at’
+ (*note -insert-at::)
+
+ (-splice 'even? (lambda (x) (list x x)) '(1 2 3 4))
+ ⇒ (1 2 2 3 4 4)
+ (--splice 't (list it it) '(1 2 3 4))
+ ⇒ (1 1 2 2 3 3 4 4)
+ (--splice (equal it :magic) '((list of) (magical) (code)) '((foo) (bar) :magic (baz)))
+ ⇒ ((foo) (bar) (list of) (magical) (code) (baz))
+
+ -- Function: -splice-list (pred new-list list)
+ Splice NEW-LIST in place of elements matching PRED in LIST.
+
+ See also: ‘-splice’ (*note -splice::), ‘-insert-at’ (*note
+ -insert-at::)
+
+ (-splice-list 'keywordp '(a b c) '(1 :foo 2))
+ ⇒ (1 a b c 2)
+ (-splice-list 'keywordp nil '(1 :foo 2))
+ ⇒ (1 2)
+ (--splice-list (keywordp it) '(a b c) '(1 :foo 2))
+ ⇒ (1 a b c 2)
+
+ -- Function: -mapcat (fn list)
+ Return the concatenation of the result of mapping FN over LIST.
+ Thus function FN should return a list.
+
+ (-mapcat 'list '(1 2 3))
+ ⇒ (1 2 3)
+ (-mapcat (lambda (item) (list 0 item)) '(1 2 3))
+ ⇒ (0 1 0 2 0 3)
+ (--mapcat (list 0 it) '(1 2 3))
+ ⇒ (0 1 0 2 0 3)
+
+ -- Function: -copy (list)
+ Create a shallow copy of LIST.
+
+ (-copy '(1 2 3))
+ ⇒ (1 2 3)
+ (let ((a '(1 2 3))) (eq a (-copy a)))
+ ⇒ nil
+
+
+File: dash.info, Node: Sublist selection, Next: List to list, Prev: Maps, Up: Functions
+
+2.2 Sublist selection
+=====================
+
+Functions returning a sublist of the original list.
+
+ -- Function: -filter (pred list)
+ Return a new list of the items in LIST for which PRED returns
+ non-nil.
+
+ Alias: ‘-select’.
+
+ This function’s anaphoric counterpart is ‘--filter’.
+
+ For similar operations, see also ‘-keep’ (*note -keep::) and
+ ‘-remove’ (*note -remove::).
+
+ (-filter (lambda (num) (= 0 (% num 2))) '(1 2 3 4))
+ ⇒ (2 4)
+ (-filter #'natnump '(-2 -1 0 1 2))
+ ⇒ (0 1 2)
+ (--filter (= 0 (% it 2)) '(1 2 3 4))
+ ⇒ (2 4)
+
+ -- Function: -remove (pred list)
+ Return a new list of the items in LIST for which PRED returns nil.
+
+ Alias: ‘-reject’.
+
+ This function’s anaphoric counterpart is ‘--remove’.
+
+ For similar operations, see also ‘-keep’ (*note -keep::) and
+ ‘-filter’ (*note -filter::).
+
+ (-remove (lambda (num) (= 0 (% num 2))) '(1 2 3 4))
+ ⇒ (1 3)
+ (-remove #'natnump '(-2 -1 0 1 2))
+ ⇒ (-2 -1)
+ (--remove (= 0 (% it 2)) '(1 2 3 4))
+ ⇒ (1 3)
+
+ -- Function: -remove-first (pred list)
+ Remove the first item from LIST for which PRED returns non-nil.
+ This is a non-destructive operation, but only the front of LIST
+ leading up to the removed item is a copy; the rest is LIST’s
+ original tail. If no item is removed, then the result is a
+ complete copy.
+
+ Alias: ‘-reject-first’.
+
+ This function’s anaphoric counterpart is ‘--remove-first’.
+
+ See also ‘-map-first’ (*note -map-first::), ‘-remove-item’ (*note
+ -remove-item::), and ‘-remove-last’ (*note -remove-last::).
+
+ (-remove-first #'natnump '(-2 -1 0 1 2))
+ ⇒ (-2 -1 1 2)
+ (-remove-first #'stringp '(1 2 "first" "second"))
+ ⇒ (1 2 "second")
+ (--remove-first (> it 3) '(1 2 3 4 5 6))
+ ⇒ (1 2 3 5 6)
+
+ -- Function: -remove-last (pred list)
+ Remove the last item from LIST for which PRED returns non-nil. The
+ result is a copy of LIST regardless of whether an element is
+ removed.
+
+ Alias: ‘-reject-last’.
+
+ This function’s anaphoric counterpart is ‘--remove-last’.
+
+ See also ‘-map-last’ (*note -map-last::), ‘-remove-item’ (*note
+ -remove-item::), and ‘-remove-first’ (*note -remove-first::).
+
+ (-remove-last #'natnump '(1 3 5 4 7 8 10 -11))
+ ⇒ (1 3 5 4 7 8 -11)
+ (-remove-last #'stringp '(1 2 "last" "second"))
+ ⇒ (1 2 "last")
+ (--remove-last (> it 3) '(1 2 3 4 5 6 7 8 9 10))
+ ⇒ (1 2 3 4 5 6 7 8 9)
+
+ -- Function: -remove-item (item list)
+ Return a copy of LIST with all occurrences of ITEM removed. The
+ comparison is done with ‘equal’.
+
+ (-remove-item 3 '(1 2 3 2 3 4 5 3))
+ ⇒ (1 2 2 4 5)
+ (-remove-item 'foo '(foo bar baz foo))
+ ⇒ (bar baz)
+ (-remove-item "bob" '("alice" "bob" "eve" "bob"))
+ ⇒ ("alice" "eve")
+
+ -- Function: -non-nil (list)
+ Return a copy of LIST with all nil items removed.
+
+ (-non-nil '(nil 1 nil 2 nil nil 3 4 nil 5 nil))
+ ⇒ (1 2 3 4 5)
+ (-non-nil '((nil)))
+ ⇒ ((nil))
+ (-non-nil ())
+ ⇒ ()
+
+ -- Function: -slice (list from &optional to step)
+ Return copy of LIST, starting from index FROM to index TO.
+
+ FROM or TO may be negative. These values are then interpreted
+ modulo the length of the list.
+
+ If STEP is a number, only each STEPth item in the resulting section
+ is returned. Defaults to 1.
+
+ (-slice '(1 2 3 4 5) 1)
+ ⇒ (2 3 4 5)
+ (-slice '(1 2 3 4 5) 0 3)
+ ⇒ (1 2 3)
+ (-slice '(1 2 3 4 5 6 7 8 9) 1 -1 2)
+ ⇒ (2 4 6 8)
+
+ -- Function: -take (n list)
+ Return a copy of the first N items in LIST. Return a copy of LIST
+ if it contains N items or fewer. Return nil if N is zero or less.
+
+ See also: ‘-take-last’ (*note -take-last::).
+
+ (-take 3 '(1 2 3 4 5))
+ ⇒ (1 2 3)
+ (-take 17 '(1 2 3 4 5))
+ ⇒ (1 2 3 4 5)
+ (-take 0 '(1 2 3 4 5))
+ ⇒ ()
+
+ -- Function: -take-last (n list)
+ Return a copy of the last N items of LIST in order. Return a copy
+ of LIST if it contains N items or fewer. Return nil if N is zero
+ or less.
+
+ See also: ‘-take’ (*note -take::).
+
+ (-take-last 3 '(1 2 3 4 5))
+ ⇒ (3 4 5)
+ (-take-last 17 '(1 2 3 4 5))
+ ⇒ (1 2 3 4 5)
+ (-take-last 1 '(1 2 3 4 5))
+ ⇒ (5)
+
+ -- Function: -drop (n list)
+ Return the tail (not a copy) of LIST without the first N items.
+ Return nil if LIST contains N items or fewer. Return LIST if N is
+ zero or less.
+
+ For another variant, see also ‘-drop-last’ (*note -drop-last::).
+
+ (-drop 3 '(1 2 3 4 5))
+ ⇒ (4 5)
+ (-drop 17 '(1 2 3 4 5))
+ ⇒ ()
+ (-drop 0 '(1 2 3 4 5))
+ ⇒ (1 2 3 4 5)
+
+ -- Function: -drop-last (n list)
+ Return a copy of LIST without its last N items. Return a copy of
+ LIST if N is zero or less. Return nil if LIST contains N items or
+ fewer.
+
+ See also: ‘-drop’ (*note -drop::).
+
+ (-drop-last 3 '(1 2 3 4 5))
+ ⇒ (1 2)
+ (-drop-last 17 '(1 2 3 4 5))
+ ⇒ ()
+ (-drop-last 0 '(1 2 3 4 5))
+ ⇒ (1 2 3 4 5)
+
+ -- Function: -take-while (pred list)
+ Take successive items from LIST for which PRED returns non-nil.
+ PRED is a function of one argument. Return a new list of the
+ successive elements from the start of LIST for which PRED returns
+ non-nil.
+
+ This function’s anaphoric counterpart is ‘--take-while’.
+
+ For another variant, see also ‘-drop-while’ (*note -drop-while::).
+
+ (-take-while #'even? '(1 2 3 4))
+ ⇒ ()
+ (-take-while #'even? '(2 4 5 6))
+ ⇒ (2 4)
+ (--take-while (< it 4) '(1 2 3 4 3 2 1))
+ ⇒ (1 2 3)
+
+ -- Function: -drop-while (pred list)
+ Drop successive items from LIST for which PRED returns non-nil.
+ PRED is a function of one argument. Return the tail (not a copy)
+ of LIST starting from its first element for which PRED returns nil.
+
+ This function’s anaphoric counterpart is ‘--drop-while’.
+
+ For another variant, see also ‘-take-while’ (*note -take-while::).
+
+ (-drop-while #'even? '(1 2 3 4))
+ ⇒ (1 2 3 4)
+ (-drop-while #'even? '(2 4 5 6))
+ ⇒ (5 6)
+ (--drop-while (< it 4) '(1 2 3 4 3 2 1))
+ ⇒ (4 3 2 1)
+
+ -- Function: -select-by-indices (indices list)
+ Return a list whose elements are elements from LIST selected as
+ ‘(nth i list)‘ for all i from INDICES.
+
+ (-select-by-indices '(4 10 2 3 6) '("v" "e" "l" "o" "c" "i" "r" "a" "p" "t" "o" "r"))
+ ⇒ ("c" "o" "l" "o" "r")
+ (-select-by-indices '(2 1 0) '("a" "b" "c"))
+ ⇒ ("c" "b" "a")
+ (-select-by-indices '(0 1 2 0 1 3 3 1) '("f" "a" "r" "l"))
+ ⇒ ("f" "a" "r" "f" "a" "l" "l" "a")
+
+ -- Function: -select-columns (columns table)
+ Select COLUMNS from TABLE.
+
+ TABLE is a list of lists where each element represents one row. It
+ is assumed each row has the same length.
+
+ Each row is transformed such that only the specified COLUMNS are
+ selected.
+
+ See also: ‘-select-column’ (*note -select-column::),
+ ‘-select-by-indices’ (*note -select-by-indices::)
+
+ (-select-columns '(0 2) '((1 2 3) (a b c) (:a :b :c)))
+ ⇒ ((1 3) (a c) (:a :c))
+ (-select-columns '(1) '((1 2 3) (a b c) (:a :b :c)))
+ ⇒ ((2) (b) (:b))
+ (-select-columns nil '((1 2 3) (a b c) (:a :b :c)))
+ ⇒ (nil nil nil)
+
+ -- Function: -select-column (column table)
+ Select COLUMN from TABLE.
+
+ TABLE is a list of lists where each element represents one row. It
+ is assumed each row has the same length.
+
+ The single selected column is returned as a list.
+
+ See also: ‘-select-columns’ (*note -select-columns::),
+ ‘-select-by-indices’ (*note -select-by-indices::)
+
+ (-select-column 1 '((1 2 3) (a b c) (:a :b :c)))
+ ⇒ (2 b :b)
+
+
+File: dash.info, Node: List to list, Next: Reductions, Prev: Sublist selection, Up: Functions
+
+2.3 List to list
+================
+
+Functions returning a modified copy of the input list.
+
+ -- Function: -keep (fn list)
+ Return a new list of the non-nil results of applying FN to each
+ item in LIST. Like ‘-filter’ (*note -filter::), but returns the
+ non-nil results of FN instead of the corresponding elements of
+ LIST.
+
+ Its anaphoric counterpart is ‘--keep’.
+
+ (-keep #'cdr '((1 2 3) (4 5) (6)))
+ ⇒ ((2 3) (5))
+ (-keep (lambda (n) (and (> n 3) (* 10 n))) '(1 2 3 4 5 6))
+ ⇒ (40 50 60)
+ (--keep (and (> it 3) (* 10 it)) '(1 2 3 4 5 6))
+ ⇒ (40 50 60)
+
+ -- Function: -concat (&rest lists)
+ Return a new list with the concatenation of the elements in the
+ supplied LISTS.
+
+ (-concat '(1))
+ ⇒ (1)
+ (-concat '(1) '(2))
+ ⇒ (1 2)
+ (-concat '(1) '(2 3) '(4))
+ ⇒ (1 2 3 4)
+
+ -- Function: -flatten (l)
+ Take a nested list L and return its contents as a single, flat
+ list.
+
+ Note that because ‘nil’ represents a list of zero elements (an
+ empty list), any mention of nil in L will disappear after
+ flattening. If you need to preserve nils, consider ‘-flatten-n’
+ (*note -flatten-n::) or map them to some unique symbol and then map
+ them back.
+
+ Conses of two atoms are considered "terminals", that is, they
+ aren’t flattened further.
+
+ See also: ‘-flatten-n’ (*note -flatten-n::)
+
+ (-flatten '((1)))
+ ⇒ (1)
+ (-flatten '((1 (2 3) (((4 (5)))))))
+ ⇒ (1 2 3 4 5)
+ (-flatten '(1 2 (3 . 4)))
+ ⇒ (1 2 (3 . 4))
+
+ -- Function: -flatten-n (num list)
+ Flatten NUM levels of a nested LIST.
+
+ See also: ‘-flatten’ (*note -flatten::)
+
+ (-flatten-n 1 '((1 2) ((3 4) ((5 6)))))
+ ⇒ (1 2 (3 4) ((5 6)))
+ (-flatten-n 2 '((1 2) ((3 4) ((5 6)))))
+ ⇒ (1 2 3 4 (5 6))
+ (-flatten-n 3 '((1 2) ((3 4) ((5 6)))))
+ ⇒ (1 2 3 4 5 6)
+
+ -- Function: -replace (old new list)
+ Replace all OLD items in LIST with NEW.
+
+ Elements are compared using ‘equal’.
+
+ See also: ‘-replace-at’ (*note -replace-at::)
+
+ (-replace 1 "1" '(1 2 3 4 3 2 1))
+ ⇒ ("1" 2 3 4 3 2 "1")
+ (-replace "foo" "bar" '("a" "nice" "foo" "sentence" "about" "foo"))
+ ⇒ ("a" "nice" "bar" "sentence" "about" "bar")
+ (-replace 1 2 nil)
+ ⇒ nil
+
+ -- Function: -replace-first (old new list)
+ Replace the first occurrence of OLD with NEW in LIST.
+
+ Elements are compared using ‘equal’.
+
+ See also: ‘-map-first’ (*note -map-first::)
+
+ (-replace-first 1 "1" '(1 2 3 4 3 2 1))
+ ⇒ ("1" 2 3 4 3 2 1)
+ (-replace-first "foo" "bar" '("a" "nice" "foo" "sentence" "about" "foo"))
+ ⇒ ("a" "nice" "bar" "sentence" "about" "foo")
+ (-replace-first 1 2 nil)
+ ⇒ nil
+
+ -- Function: -replace-last (old new list)
+ Replace the last occurrence of OLD with NEW in LIST.
+
+ Elements are compared using ‘equal’.
+
+ See also: ‘-map-last’ (*note -map-last::)
+
+ (-replace-last 1 "1" '(1 2 3 4 3 2 1))
+ ⇒ (1 2 3 4 3 2 "1")
+ (-replace-last "foo" "bar" '("a" "nice" "foo" "sentence" "about" "foo"))
+ ⇒ ("a" "nice" "foo" "sentence" "about" "bar")
+ (-replace-last 1 2 nil)
+ ⇒ nil
+
+ -- Function: -insert-at (n x list)
+ Return a list with X inserted into LIST at position N.
+
+ See also: ‘-splice’ (*note -splice::), ‘-splice-list’ (*note
+ -splice-list::)
+
+ (-insert-at 1 'x '(a b c))
+ ⇒ (a x b c)
+ (-insert-at 12 'x '(a b c))
+ ⇒ (a b c x)
+
+ -- Function: -replace-at (n x list)
+ Return a list with element at Nth position in LIST replaced with X.
+
+ See also: ‘-replace’ (*note -replace::)
+
+ (-replace-at 0 9 '(0 1 2 3 4 5))
+ ⇒ (9 1 2 3 4 5)
+ (-replace-at 1 9 '(0 1 2 3 4 5))
+ ⇒ (0 9 2 3 4 5)
+ (-replace-at 4 9 '(0 1 2 3 4 5))
+ ⇒ (0 1 2 3 9 5)
+
+ -- Function: -update-at (n func list)
+ Return a list with element at Nth position in LIST replaced with
+ ‘(func (nth n list))‘.
+
+ See also: ‘-map-when’ (*note -map-when::)
+
+ (-update-at 0 (lambda (x) (+ x 9)) '(0 1 2 3 4 5))
+ ⇒ (9 1 2 3 4 5)
+ (-update-at 1 (lambda (x) (+ x 8)) '(0 1 2 3 4 5))
+ ⇒ (0 9 2 3 4 5)
+ (--update-at 2 (length it) '("foo" "bar" "baz" "quux"))
+ ⇒ ("foo" "bar" 3 "quux")
+
+ -- Function: -remove-at (n list)
+ Return a list with element at Nth position in LIST removed.
+
+ See also: ‘-remove-at-indices’ (*note -remove-at-indices::),
+ ‘-remove’ (*note -remove::)
+
+ (-remove-at 0 '("0" "1" "2" "3" "4" "5"))
+ ⇒ ("1" "2" "3" "4" "5")
+ (-remove-at 1 '("0" "1" "2" "3" "4" "5"))
+ ⇒ ("0" "2" "3" "4" "5")
+ (-remove-at 2 '("0" "1" "2" "3" "4" "5"))
+ ⇒ ("0" "1" "3" "4" "5")
+
+ -- Function: -remove-at-indices (indices list)
+ Return a list whose elements are elements from LIST without
+ elements selected as ‘(nth i list)‘ for all i from INDICES.
+
+ See also: ‘-remove-at’ (*note -remove-at::), ‘-remove’ (*note
+ -remove::)
+
+ (-remove-at-indices '(0) '("0" "1" "2" "3" "4" "5"))
+ ⇒ ("1" "2" "3" "4" "5")
+ (-remove-at-indices '(0 2 4) '("0" "1" "2" "3" "4" "5"))
+ ⇒ ("1" "3" "5")
+ (-remove-at-indices '(0 5) '("0" "1" "2" "3" "4" "5"))
+ ⇒ ("1" "2" "3" "4")
+
+
+File: dash.info, Node: Reductions, Next: Unfolding, Prev: List to list, Up: Functions
+
+2.4 Reductions
+==============
+
+Functions reducing lists to a single value (which may also be a list).
+
+ -- Function: -reduce-from (fn init list)
+ Reduce the function FN across LIST, starting with INIT. Return the
+ result of applying FN to INIT and the first element of LIST, then
+ applying FN to that result and the second element, etc. If LIST is
+ empty, return INIT without calling FN.
+
+ This function’s anaphoric counterpart is ‘--reduce-from’.
+
+ For other folds, see also ‘-reduce’ (*note -reduce::) and
+ ‘-reduce-r’ (*note -reduce-r::).
+
+ (-reduce-from #'- 10 '(1 2 3))
+ ⇒ 4
+ (-reduce-from #'list 10 '(1 2 3))
+ ⇒ (((10 1) 2) 3)
+ (--reduce-from (concat acc " " it) "START" '("a" "b" "c"))
+ ⇒ "START a b c"
+
+ -- Function: -reduce-r-from (fn init list)
+ Reduce the function FN across LIST in reverse, starting with INIT.
+ Return the result of applying FN to the last element of LIST and
+ INIT, then applying FN to the second-to-last element and the
+ previous result of FN, etc. That is, the first argument of FN is
+ the current element, and its second argument the accumulated value.
+ If LIST is empty, return INIT without calling FN.
+
+ This function is like ‘-reduce-from’ (*note -reduce-from::) but the
+ operation associates from the right rather than left. In other
+ words, it starts from the end of LIST and flips the arguments to
+ FN. Conceptually, it is like replacing the conses in LIST with
+ applications of FN, and its last link with INIT, and evaluating the
+ resulting expression.
+
+ This function’s anaphoric counterpart is ‘--reduce-r-from’.
+
+ For other folds, see also ‘-reduce-r’ (*note -reduce-r::) and
+ ‘-reduce’ (*note -reduce::).
+
+ (-reduce-r-from #'- 10 '(1 2 3))
+ ⇒ -8
+ (-reduce-r-from #'list 10 '(1 2 3))
+ ⇒ (1 (2 (3 10)))
+ (--reduce-r-from (concat it " " acc) "END" '("a" "b" "c"))
+ ⇒ "a b c END"
+
+ -- Function: -reduce (fn list)
+ Reduce the function FN across LIST. Return the result of applying
+ FN to the first two elements of LIST, then applying FN to that
+ result and the third element, etc. If LIST contains a single
+ element, return it without calling FN. If LIST is empty, return
+ the result of calling FN with no arguments.
+
+ This function’s anaphoric counterpart is ‘--reduce’.
+
+ For other folds, see also ‘-reduce-from’ (*note -reduce-from::) and
+ ‘-reduce-r’ (*note -reduce-r::).
+
+ (-reduce #'- '(1 2 3 4))
+ ⇒ -8
+ (-reduce #'list '(1 2 3 4))
+ ⇒ (((1 2) 3) 4)
+ (--reduce (format "%s-%d" acc it) '(1 2 3))
+ ⇒ "1-2-3"
+
+ -- Function: -reduce-r (fn list)
+ Reduce the function FN across LIST in reverse. Return the result
+ of applying FN to the last two elements of LIST, then applying FN
+ to the third-to-last element and the previous result of FN, etc.
+ That is, the first argument of FN is the current element, and its
+ second argument the accumulated value. If LIST contains a single
+ element, return it without calling FN. If LIST is empty, return
+ the result of calling FN with no arguments.
+
+ This function is like ‘-reduce’ (*note -reduce::) but the operation
+ associates from the right rather than left. In other words, it
+ starts from the end of LIST and flips the arguments to FN.
+ Conceptually, it is like replacing the conses in LIST with
+ applications of FN, ignoring its last link, and evaluating the
+ resulting expression.
+
+ This function’s anaphoric counterpart is ‘--reduce-r’.
+
+ For other folds, see also ‘-reduce-r-from’ (*note -reduce-r-from::)
+ and ‘-reduce’ (*note -reduce::).
+
+ (-reduce-r #'- '(1 2 3 4))
+ ⇒ -2
+ (-reduce-r #'list '(1 2 3 4))
+ ⇒ (1 (2 (3 4)))
+ (--reduce-r (format "%s-%d" acc it) '(1 2 3))
+ ⇒ "3-2-1"
+
+ -- Function: -reductions-from (fn init list)
+ Return a list of FN’s intermediate reductions across LIST. That
+ is, a list of the intermediate values of the accumulator when
+ ‘-reduce-from’ (*note -reduce-from::) (which see) is called with
+ the same arguments.
+
+ This function’s anaphoric counterpart is ‘--reductions-from’.
+
+ For other folds, see also ‘-reductions’ (*note -reductions::) and
+ ‘-reductions-r’ (*note -reductions-r::).
+
+ (-reductions-from #'max 0 '(2 1 4 3))
+ ⇒ (0 2 2 4 4)
+ (-reductions-from #'* 1 '(1 2 3 4))
+ ⇒ (1 1 2 6 24)
+ (--reductions-from (format "(FN %s %d)" acc it) "INIT" '(1 2 3))
+ ⇒ ("INIT" "(FN INIT 1)" "(FN (FN INIT 1) 2)" "(FN (FN (FN INIT 1) 2) 3)")
+
+ -- Function: -reductions-r-from (fn init list)
+ Return a list of FN’s intermediate reductions across reversed LIST.
+ That is, a list of the intermediate values of the accumulator when
+ ‘-reduce-r-from’ (*note -reduce-r-from::) (which see) is called
+ with the same arguments.
+
+ This function’s anaphoric counterpart is ‘--reductions-r-from’.
+
+ For other folds, see also ‘-reductions’ (*note -reductions::) and
+ ‘-reductions-r’ (*note -reductions-r::).
+
+ (-reductions-r-from #'max 0 '(2 1 4 3))
+ ⇒ (4 4 4 3 0)
+ (-reductions-r-from #'* 1 '(1 2 3 4))
+ ⇒ (24 24 12 4 1)
+ (--reductions-r-from (format "(FN %d %s)" it acc) "INIT" '(1 2 3))
+ ⇒ ("(FN 1 (FN 2 (FN 3 INIT)))" "(FN 2 (FN 3 INIT))" "(FN 3 INIT)" "INIT")
+
+ -- Function: -reductions (fn list)
+ Return a list of FN’s intermediate reductions across LIST. That
+ is, a list of the intermediate values of the accumulator when
+ ‘-reduce’ (*note -reduce::) (which see) is called with the same
+ arguments.
+
+ This function’s anaphoric counterpart is ‘--reductions’.
+
+ For other folds, see also ‘-reductions’ (*note -reductions::) and
+ ‘-reductions-r’ (*note -reductions-r::).
+
+ (-reductions #'+ '(1 2 3 4))
+ ⇒ (1 3 6 10)
+ (-reductions #'* '(1 2 3 4))
+ ⇒ (1 2 6 24)
+ (--reductions (format "(FN %s %d)" acc it) '(1 2 3))
+ ⇒ (1 "(FN 1 2)" "(FN (FN 1 2) 3)")
+
+ -- Function: -reductions-r (fn list)
+ Return a list of FN’s intermediate reductions across reversed LIST.
+ That is, a list of the intermediate values of the accumulator when
+ ‘-reduce-r’ (*note -reduce-r::) (which see) is called with the same
+ arguments.
+
+ This function’s anaphoric counterpart is ‘--reductions-r’.
+
+ For other folds, see also ‘-reductions-r-from’ (*note
+ -reductions-r-from::) and ‘-reductions’ (*note -reductions::).
+
+ (-reductions-r #'+ '(1 2 3 4))
+ ⇒ (10 9 7 4)
+ (-reductions-r #'* '(1 2 3 4))
+ ⇒ (24 24 12 4)
+ (--reductions-r (format "(FN %d %s)" it acc) '(1 2 3))
+ ⇒ ("(FN 1 (FN 2 3))" "(FN 2 3)" 3)
+
+ -- Function: -count (pred list)
+ Counts the number of items in LIST where (PRED item) is non-nil.
+
+ (-count 'even? '(1 2 3 4 5))
+ ⇒ 2
+ (--count (< it 4) '(1 2 3 4))
+ ⇒ 3
+
+ -- Function: -sum (list)
+ Return the sum of LIST.
+
+ (-sum ())
+ ⇒ 0
+ (-sum '(1))
+ ⇒ 1
+ (-sum '(1 2 3 4))
+ ⇒ 10
+
+ -- Function: -running-sum (list)
+ Return a list with running sums of items in LIST. LIST must be
+ non-empty.
+
+ (-running-sum '(1 2 3 4))
+ ⇒ (1 3 6 10)
+ (-running-sum '(1))
+ ⇒ (1)
+ (-running-sum ())
+ error→ Wrong type argument: consp, nil
+
+ -- Function: -product (list)
+ Return the product of LIST.
+
+ (-product ())
+ ⇒ 1
+ (-product '(1))
+ ⇒ 1
+ (-product '(1 2 3 4))
+ ⇒ 24
+
+ -- Function: -running-product (list)
+ Return a list with running products of items in LIST. LIST must be
+ non-empty.
+
+ (-running-product '(1 2 3 4))
+ ⇒ (1 2 6 24)
+ (-running-product '(1))
+ ⇒ (1)
+ (-running-product ())
+ error→ Wrong type argument: consp, nil
+
+ -- Function: -inits (list)
+ Return all prefixes of LIST.
+
+ (-inits '(1 2 3 4))
+ ⇒ (nil (1) (1 2) (1 2 3) (1 2 3 4))
+ (-inits nil)
+ ⇒ (nil)
+ (-inits '(1))
+ ⇒ (nil (1))
+
+ -- Function: -tails (list)
+ Return all suffixes of LIST
+
+ (-tails '(1 2 3 4))
+ ⇒ ((1 2 3 4) (2 3 4) (3 4) (4) nil)
+ (-tails nil)
+ ⇒ (nil)
+ (-tails '(1))
+ ⇒ ((1) nil)
+
+ -- Function: -common-prefix (&rest lists)
+ Return the longest common prefix of LISTS.
+
+ (-common-prefix '(1))
+ ⇒ (1)
+ (-common-prefix '(1 2) '(3 4) '(1 2))
+ ⇒ ()
+ (-common-prefix '(1 2) '(1 2 3) '(1 2 3 4))
+ ⇒ (1 2)
+
+ -- Function: -common-suffix (&rest lists)
+ Return the longest common suffix of LISTS.
+
+ (-common-suffix '(1))
+ ⇒ (1)
+ (-common-suffix '(1 2) '(3 4) '(1 2))
+ ⇒ ()
+ (-common-suffix '(1 2 3 4) '(2 3 4) '(3 4))
+ ⇒ (3 4)
+
+ -- Function: -min (list)
+ Return the smallest value from LIST of numbers or markers.
+
+ (-min '(0))
+ ⇒ 0
+ (-min '(3 2 1))
+ ⇒ 1
+ (-min '(1 2 3))
+ ⇒ 1
+
+ -- Function: -min-by (comparator list)
+ Take a comparison function COMPARATOR and a LIST and return the
+ least element of the list by the comparison function.
+
+ See also combinator ‘-on’ (*note -on::) which can transform the
+ values before comparing them.
+
+ (-min-by '> '(4 3 6 1))
+ ⇒ 1
+ (--min-by (> (car it) (car other)) '((1 2 3) (2) (3 2)))
+ ⇒ (1 2 3)
+ (--min-by (> (length it) (length other)) '((1 2 3) (2) (3 2)))
+ ⇒ (2)
+
+ -- Function: -max (list)
+ Return the largest value from LIST of numbers or markers.
+
+ (-max '(0))
+ ⇒ 0
+ (-max '(3 2 1))
+ ⇒ 3
+ (-max '(1 2 3))
+ ⇒ 3
+
+ -- Function: -max-by (comparator list)
+ Take a comparison function COMPARATOR and a LIST and return the
+ greatest element of the list by the comparison function.
+
+ See also combinator ‘-on’ (*note -on::) which can transform the
+ values before comparing them.
+
+ (-max-by '> '(4 3 6 1))
+ ⇒ 6
+ (--max-by (> (car it) (car other)) '((1 2 3) (2) (3 2)))
+ ⇒ (3 2)
+ (--max-by (> (length it) (length other)) '((1 2 3) (2) (3 2)))
+ ⇒ (1 2 3)
+
+
+File: dash.info, Node: Unfolding, Next: Predicates, Prev: Reductions, Up: Functions
+
+2.5 Unfolding
+=============
+
+Operations dual to reductions, building lists from a seed value rather
+than consuming a list to produce a single value.
+
+ -- Function: -iterate (fun init n)
+ Return a list of iterated applications of FUN to INIT.
+
+ This means a list of the form:
+
+ (INIT (FUN INIT) (FUN (FUN INIT)) ...)
+
+ N is the length of the returned list.
+
+ (-iterate #'1+ 1 10)
+ ⇒ (1 2 3 4 5 6 7 8 9 10)
+ (-iterate (lambda (x) (+ x x)) 2 5)
+ ⇒ (2 4 8 16 32)
+ (--iterate (* it it) 2 5)
+ ⇒ (2 4 16 256 65536)
+
+ -- Function: -unfold (fun seed)
+ Build a list from SEED using FUN.
+
+ This is "dual" operation to ‘-reduce-r’ (*note -reduce-r::): while
+ -reduce-r consumes a list to produce a single value, ‘-unfold’
+ (*note -unfold::) takes a seed value and builds a (potentially
+ infinite!) list.
+
+ FUN should return ‘nil’ to stop the generating process, or a cons
+ (A . B), where A will be prepended to the result and B is the new
+ seed.
+
+ (-unfold (lambda (x) (unless (= x 0) (cons x (1- x)))) 10)
+ ⇒ (10 9 8 7 6 5 4 3 2 1)
+ (--unfold (when it (cons it (cdr it))) '(1 2 3 4))
+ ⇒ ((1 2 3 4) (2 3 4) (3 4) (4))
+ (--unfold (when it (cons it (butlast it))) '(1 2 3 4))
+ ⇒ ((1 2 3 4) (1 2 3) (1 2) (1))
+
+
+File: dash.info, Node: Predicates, Next: Partitioning, Prev: Unfolding, Up: Functions
+
+2.6 Predicates
+==============
+
+Reductions of one or more lists to a boolean value.
+
+ -- Function: -some (pred list)
+ Return (PRED x) for the first LIST item where (PRED x) is non-nil,
+ else nil.
+
+ Alias: ‘-any’.
+
+ This function’s anaphoric counterpart is ‘--some’.
+
+ (-some #'stringp '(1 "2" 3))
+ ⇒ t
+ (--some (string-match-p "x" it) '("foo" "axe" "xor"))
+ ⇒ 1
+ (--some (= it-index 3) '(0 1 2))
+ ⇒ nil
+
+ -- Function: -every (pred list)
+ Return non-nil if PRED returns non-nil for all items in LIST. If
+ so, return the last such result of PRED. Otherwise, once an item
+ is reached for which PRED returns nil, return nil without calling
+ PRED on any further LIST elements.
+
+ This function is like ‘-every-p’, but on success returns the last
+ non-nil result of PRED instead of just t.
+
+ This function’s anaphoric counterpart is ‘--every’.
+
+ (-every #'numberp '(1 2 3))
+ ⇒ t
+ (--every (string-match-p "x" it) '("axe" "xor"))
+ ⇒ 0
+ (--every (= it it-index) '(0 1 3))
+ ⇒ nil
+
+ -- Function: -any? (pred list)
+ Return t if (PRED x) is non-nil for any x in LIST, else nil.
+
+ Alias: ‘-any-p’, ‘-some?’, ‘-some-p’
+
+ (-any? #'numberp '(nil 0 t))
+ ⇒ t
+ (-any? #'numberp '(nil t t))
+ ⇒ nil
+ (-any? #'null '(1 3 5))
+ ⇒ nil
+
+ -- Function: -all? (pred list)
+ Return t if (PRED X) is non-nil for all X in LIST, else nil. In
+ the latter case, stop after the first X for which (PRED X) is nil,
+ without calling PRED on any subsequent elements of LIST.
+
+ The similar function ‘-every’ (*note -every::) is more widely
+ useful, since it returns the last non-nil result of PRED instead of
+ just t on success.
+
+ Alias: ‘-all-p’, ‘-every-p’, ‘-every?’.
+
+ This function’s anaphoric counterpart is ‘--all?’.
+
+ (-all? #'numberp '(1 2 3))
+ ⇒ t
+ (-all? #'numberp '(2 t 6))
+ ⇒ nil
+ (--all? (= 0 (% it 2)) '(2 4 6))
+ ⇒ t
+
+ -- Function: -none? (pred list)
+ Return t if (PRED x) is nil for all x in LIST, else nil.
+
+ Alias: ‘-none-p’
+
+ (-none? 'even? '(1 2 3))
+ ⇒ nil
+ (-none? 'even? '(1 3 5))
+ ⇒ t
+ (--none? (= 0 (% it 2)) '(1 2 3))
+ ⇒ nil
+
+ -- Function: -only-some? (pred list)
+ Return ‘t‘ if at least one item of LIST matches PRED and at least
+ one item of LIST does not match PRED. Return ‘nil‘ both if all
+ items match the predicate or if none of the items match the
+ predicate.
+
+ Alias: ‘-only-some-p’
+
+ (-only-some? 'even? '(1 2 3))
+ ⇒ t
+ (-only-some? 'even? '(1 3 5))
+ ⇒ nil
+ (-only-some? 'even? '(2 4 6))
+ ⇒ nil
+
+ -- Function: -contains? (list element)
+ Return non-nil if LIST contains ELEMENT.
+
+ The test for equality is done with ‘equal’, or with ‘-compare-fn’
+ if that’s non-nil.
+
+ Alias: ‘-contains-p’
+
+ (-contains? '(1 2 3) 1)
+ ⇒ t
+ (-contains? '(1 2 3) 2)
+ ⇒ t
+ (-contains? '(1 2 3) 4)
+ ⇒ nil
+
+ -- Function: -same-items? (list list2)
+ Return true if LIST and LIST2 has the same items.
+
+ The order of the elements in the lists does not matter.
+
+ Alias: ‘-same-items-p’
+
+ (-same-items? '(1 2 3) '(1 2 3))
+ ⇒ t
+ (-same-items? '(1 2 3) '(3 2 1))
+ ⇒ t
+ (-same-items? '(1 2 3) '(1 2 3 4))
+ ⇒ nil
+
+ -- Function: -is-prefix? (prefix list)
+ Return non-nil if PREFIX is a prefix of LIST.
+
+ Alias: ‘-is-prefix-p’.
+
+ (-is-prefix? '(1 2 3) '(1 2 3 4 5))
+ ⇒ t
+ (-is-prefix? '(1 2 3 4 5) '(1 2 3))
+ ⇒ nil
+ (-is-prefix? '(1 3) '(1 2 3 4 5))
+ ⇒ nil
+
+ -- Function: -is-suffix? (suffix list)
+ Return non-nil if SUFFIX is a suffix of LIST.
+
+ Alias: ‘-is-suffix-p’.
+
+ (-is-suffix? '(3 4 5) '(1 2 3 4 5))
+ ⇒ t
+ (-is-suffix? '(1 2 3 4 5) '(3 4 5))
+ ⇒ nil
+ (-is-suffix? '(3 5) '(1 2 3 4 5))
+ ⇒ nil
+
+ -- Function: -is-infix? (infix list)
+ Return non-nil if INFIX is infix of LIST.
+
+ This operation runs in O(n^2) time
+
+ Alias: ‘-is-infix-p’
+
+ (-is-infix? '(1 2 3) '(1 2 3 4 5))
+ ⇒ t
+ (-is-infix? '(2 3 4) '(1 2 3 4 5))
+ ⇒ t
+ (-is-infix? '(3 4 5) '(1 2 3 4 5))
+ ⇒ t
+
+ -- Function: -cons-pair? (obj)
+ Return non-nil if OBJ is a true cons pair. That is, a cons (A .
+ B) where B is not a list.
+
+ Alias: ‘-cons-pair-p’.
+
+ (-cons-pair? '(1 . 2))
+ ⇒ t
+ (-cons-pair? '(1 2))
+ ⇒ nil
+ (-cons-pair? '(1))
+ ⇒ nil
+
+
+File: dash.info, Node: Partitioning, Next: Indexing, Prev: Predicates, Up: Functions
+
+2.7 Partitioning
+================
+
+Functions partitioning the input list into a list of lists.
+
+ -- Function: -split-at (n list)
+ Split LIST into two sublists after the Nth element. The result is
+ a list of two elements (TAKE DROP) where TAKE is a new list of the
+ first N elements of LIST, and DROP is the remaining elements of
+ LIST (not a copy). TAKE and DROP are like the results of ‘-take’
+ (*note -take::) and ‘-drop’ (*note -drop::), respectively, but the
+ split is done in a single list traversal.
+
+ (-split-at 3 '(1 2 3 4 5))
+ ⇒ ((1 2 3) (4 5))
+ (-split-at 17 '(1 2 3 4 5))
+ ⇒ ((1 2 3 4 5) nil)
+ (-split-at 0 '(1 2 3 4 5))
+ ⇒ (nil (1 2 3 4 5))
+
+ -- Function: -split-with (pred list)
+ Return a list of ((-take-while PRED LIST) (-drop-while PRED LIST)),
+ in no more than one pass through the list.
+
+ (-split-with 'even? '(1 2 3 4))
+ ⇒ (nil (1 2 3 4))
+ (-split-with 'even? '(2 4 5 6))
+ ⇒ ((2 4) (5 6))
+ (--split-with (< it 4) '(1 2 3 4 3 2 1))
+ ⇒ ((1 2 3) (4 3 2 1))
+
+ -- Macro: -split-on (item list)
+ Split the LIST each time ITEM is found.
+
+ Unlike ‘-partition-by’ (*note -partition-by::), the ITEM is
+ discarded from the results. Empty lists are also removed from the
+ result.
+
+ Comparison is done by ‘equal’.
+
+ See also ‘-split-when’ (*note -split-when::)
+
+ (-split-on '| '(Nil | Leaf a | Node [Tree a]))
+ ⇒ ((Nil) (Leaf a) (Node [Tree a]))
+ (-split-on :endgroup '("a" "b" :endgroup "c" :endgroup "d" "e"))
+ ⇒ (("a" "b") ("c") ("d" "e"))
+ (-split-on :endgroup '("a" "b" :endgroup :endgroup "d" "e"))
+ ⇒ (("a" "b") ("d" "e"))
+
+ -- Function: -split-when (fn list)
+ Split the LIST on each element where FN returns non-nil.
+
+ Unlike ‘-partition-by’ (*note -partition-by::), the "matched"
+ element is discarded from the results. Empty lists are also
+ removed from the result.
+
+ This function can be thought of as a generalization of
+ ‘split-string’.
+
+ (-split-when 'even? '(1 2 3 4 5 6))
+ ⇒ ((1) (3) (5))
+ (-split-when 'even? '(1 2 3 4 6 8 9))
+ ⇒ ((1) (3) (9))
+ (--split-when (memq it '(&optional &rest)) '(a b &optional c d &rest args))
+ ⇒ ((a b) (c d) (args))
+
+ -- Function: -separate (pred list)
+ Return a list of ((-filter PRED LIST) (-remove PRED LIST)), in one
+ pass through the list.
+
+ (-separate (lambda (num) (= 0 (% num 2))) '(1 2 3 4 5 6 7))
+ ⇒ ((2 4 6) (1 3 5 7))
+ (--separate (< it 5) '(3 7 5 9 3 2 1 4 6))
+ ⇒ ((3 3 2 1 4) (7 5 9 6))
+ (-separate 'cdr '((1 2) (1) (1 2 3) (4)))
+ ⇒ (((1 2) (1 2 3)) ((1) (4)))
+
+ -- Function: -partition (n list)
+ Return a new list with the items in LIST grouped into N-sized
+ sublists. If there are not enough items to make the last group
+ N-sized, those items are discarded.
+
+ (-partition 2 '(1 2 3 4 5 6))
+ ⇒ ((1 2) (3 4) (5 6))
+ (-partition 2 '(1 2 3 4 5 6 7))
+ ⇒ ((1 2) (3 4) (5 6))
+ (-partition 3 '(1 2 3 4 5 6 7))
+ ⇒ ((1 2 3) (4 5 6))
+
+ -- Function: -partition-all (n list)
+ Return a new list with the items in LIST grouped into N-sized
+ sublists. The last group may contain less than N items.
+
+ (-partition-all 2 '(1 2 3 4 5 6))
+ ⇒ ((1 2) (3 4) (5 6))
+ (-partition-all 2 '(1 2 3 4 5 6 7))
+ ⇒ ((1 2) (3 4) (5 6) (7))
+ (-partition-all 3 '(1 2 3 4 5 6 7))
+ ⇒ ((1 2 3) (4 5 6) (7))
+
+ -- Function: -partition-in-steps (n step list)
+ Return a new list with the items in LIST grouped into N-sized
+ sublists at offsets STEP apart. If there are not enough items to
+ make the last group N-sized, those items are discarded.
+
+ (-partition-in-steps 2 1 '(1 2 3 4))
+ ⇒ ((1 2) (2 3) (3 4))
+ (-partition-in-steps 3 2 '(1 2 3 4))
+ ⇒ ((1 2 3))
+ (-partition-in-steps 3 2 '(1 2 3 4 5))
+ ⇒ ((1 2 3) (3 4 5))
+
+ -- Function: -partition-all-in-steps (n step list)
+ Return a new list with the items in LIST grouped into N-sized
+ sublists at offsets STEP apart. The last groups may contain less
+ than N items.
+
+ (-partition-all-in-steps 2 1 '(1 2 3 4))
+ ⇒ ((1 2) (2 3) (3 4) (4))
+ (-partition-all-in-steps 3 2 '(1 2 3 4))
+ ⇒ ((1 2 3) (3 4))
+ (-partition-all-in-steps 3 2 '(1 2 3 4 5))
+ ⇒ ((1 2 3) (3 4 5) (5))
+
+ -- Function: -partition-by (fn list)
+ Apply FN to each item in LIST, splitting it each time FN returns a
+ new value.
+
+ (-partition-by 'even? ())
+ ⇒ ()
+ (-partition-by 'even? '(1 1 2 2 2 3 4 6 8))
+ ⇒ ((1 1) (2 2 2) (3) (4 6 8))
+ (--partition-by (< it 3) '(1 2 3 4 3 2 1))
+ ⇒ ((1 2) (3 4 3) (2 1))
+
+ -- Function: -partition-by-header (fn list)
+ Apply FN to the first item in LIST. That is the header value.
+ Apply FN to each item in LIST, splitting it each time FN returns
+ the header value, but only after seeing at least one other value
+ (the body).
+
+ (--partition-by-header (= it 1) '(1 2 3 1 2 1 2 3 4))
+ ⇒ ((1 2 3) (1 2) (1 2 3 4))
+ (--partition-by-header (> it 0) '(1 2 0 1 0 1 2 3 0))
+ ⇒ ((1 2 0) (1 0) (1 2 3 0))
+ (-partition-by-header 'even? '(2 1 1 1 4 1 3 5 6 6 1))
+ ⇒ ((2 1 1 1) (4 1 3 5) (6 6 1))
+
+ -- Function: -partition-after-pred (pred list)
+ Partition LIST after each element for which PRED returns non-nil.
+
+ This function’s anaphoric counterpart is ‘--partition-after-pred’.
+
+ (-partition-after-pred #'booleanp ())
+ ⇒ ()
+ (-partition-after-pred #'booleanp '(t t))
+ ⇒ ((t) (t))
+ (-partition-after-pred #'booleanp '(0 0 t t 0 t))
+ ⇒ ((0 0 t) (t) (0 t))
+
+ -- Function: -partition-before-pred (pred list)
+ Partition directly before each time PRED is true on an element of
+ LIST.
+
+ (-partition-before-pred #'booleanp ())
+ ⇒ ()
+ (-partition-before-pred #'booleanp '(0 t))
+ ⇒ ((0) (t))
+ (-partition-before-pred #'booleanp '(0 0 t 0 t t))
+ ⇒ ((0 0) (t 0) (t) (t))
+
+ -- Function: -partition-before-item (item list)
+ Partition directly before each time ITEM appears in LIST.
+
+ (-partition-before-item 3 ())
+ ⇒ ()
+ (-partition-before-item 3 '(1))
+ ⇒ ((1))
+ (-partition-before-item 3 '(3))
+ ⇒ ((3))
+
+ -- Function: -partition-after-item (item list)
+ Partition directly after each time ITEM appears in LIST.
+
+ (-partition-after-item 3 ())
+ ⇒ ()
+ (-partition-after-item 3 '(1))
+ ⇒ ((1))
+ (-partition-after-item 3 '(3))
+ ⇒ ((3))
+
+ -- Function: -group-by (fn list)
+ Separate LIST into an alist whose keys are FN applied to the
+ elements of LIST. Keys are compared by ‘equal’.
+
+ (-group-by 'even? ())
+ ⇒ ()
+ (-group-by 'even? '(1 1 2 2 2 3 4 6 8))
+ ⇒ ((nil 1 1 3) (t 2 2 2 4 6 8))
+ (--group-by (car (split-string it "/")) '("a/b" "c/d" "a/e"))
+ ⇒ (("a" "a/b" "a/e") ("c" "c/d"))
+
+
+File: dash.info, Node: Indexing, Next: Set operations, Prev: Partitioning, Up: Functions
+
+2.8 Indexing
+============
+
+Functions retrieving or sorting based on list indices and related
+predicates.
+
+ -- Function: -elem-index (elem list)
+ Return the index of the first element in the given LIST which is
+ equal to the query element ELEM, or nil if there is no such
+ element.
+
+ (-elem-index 2 '(6 7 8 2 3 4))
+ ⇒ 3
+ (-elem-index "bar" '("foo" "bar" "baz"))
+ ⇒ 1
+ (-elem-index '(1 2) '((3) (5 6) (1 2) nil))
+ ⇒ 2
+
+ -- Function: -elem-indices (elem list)
+ Return the indices of all elements in LIST equal to the query
+ element ELEM, in ascending order.
+
+ (-elem-indices 2 '(6 7 8 2 3 4 2 1))
+ ⇒ (3 6)
+ (-elem-indices "bar" '("foo" "bar" "baz"))
+ ⇒ (1)
+ (-elem-indices '(1 2) '((3) (1 2) (5 6) (1 2) nil))
+ ⇒ (1 3)
+
+ -- Function: -find-index (pred list)
+ Take a predicate PRED and a LIST and return the index of the first
+ element in the list satisfying the predicate, or nil if there is no
+ such element.
+
+ See also ‘-first’ (*note -first::).
+
+ (-find-index 'even? '(2 4 1 6 3 3 5 8))
+ ⇒ 0
+ (--find-index (< 5 it) '(2 4 1 6 3 3 5 8))
+ ⇒ 3
+ (-find-index (-partial 'string-lessp "baz") '("bar" "foo" "baz"))
+ ⇒ 1
+
+ -- Function: -find-last-index (pred list)
+ Take a predicate PRED and a LIST and return the index of the last
+ element in the list satisfying the predicate, or nil if there is no
+ such element.
+
+ See also ‘-last’ (*note -last::).
+
+ (-find-last-index 'even? '(2 4 1 6 3 3 5 8))
+ ⇒ 7
+ (--find-last-index (< 5 it) '(2 7 1 6 3 8 5 2))
+ ⇒ 5
+ (-find-last-index (-partial 'string-lessp "baz") '("q" "foo" "baz"))
+ ⇒ 1
+
+ -- Function: -find-indices (pred list)
+ Return the indices of all elements in LIST satisfying the predicate
+ PRED, in ascending order.
+
+ (-find-indices 'even? '(2 4 1 6 3 3 5 8))
+ ⇒ (0 1 3 7)
+ (--find-indices (< 5 it) '(2 4 1 6 3 3 5 8))
+ ⇒ (3 7)
+ (-find-indices (-partial 'string-lessp "baz") '("bar" "foo" "baz"))
+ ⇒ (1)
+
+ -- Function: -grade-up (comparator list)
+ Grade elements of LIST using COMPARATOR relation. This yields a
+ permutation vector such that applying this permutation to LIST
+ sorts it in ascending order.
+
+ (-grade-up #'< '(3 1 4 2 1 3 3))
+ ⇒ (1 4 3 0 5 6 2)
+ (let ((l '(3 1 4 2 1 3 3))) (-select-by-indices (-grade-up #'< l) l))
+ ⇒ (1 1 2 3 3 3 4)
+
+ -- Function: -grade-down (comparator list)
+ Grade elements of LIST using COMPARATOR relation. This yields a
+ permutation vector such that applying this permutation to LIST
+ sorts it in descending order.
+
+ (-grade-down #'< '(3 1 4 2 1 3 3))
+ ⇒ (2 0 5 6 3 1 4)
+ (let ((l '(3 1 4 2 1 3 3))) (-select-by-indices (-grade-down #'< l) l))
+ ⇒ (4 3 3 3 2 1 1)
+
+
+File: dash.info, Node: Set operations, Next: Other list operations, Prev: Indexing, Up: Functions
+
+2.9 Set operations
+==================
+
+Operations pretending lists are sets.
+
+ -- Function: -union (list list2)
+ Return a new list containing the elements of LIST and elements of
+ LIST2 that are not in LIST. The test for equality is done with
+ ‘equal’, or with ‘-compare-fn’ if that’s non-nil.
+
+ (-union '(1 2 3) '(3 4 5))
+ ⇒ (1 2 3 4 5)
+ (-union '(1 2 3 4) ())
+ ⇒ (1 2 3 4)
+ (-union '(1 1 2 2) '(3 2 1))
+ ⇒ (1 1 2 2 3)
+
+ -- Function: -difference (list list2)
+ Return a new list with only the members of LIST that are not in
+ LIST2. The test for equality is done with ‘equal’, or with
+ ‘-compare-fn’ if that’s non-nil.
+
+ (-difference () ())
+ ⇒ ()
+ (-difference '(1 2 3) '(4 5 6))
+ ⇒ (1 2 3)
+ (-difference '(1 2 3 4) '(3 4 5 6))
+ ⇒ (1 2)
+
+ -- Function: -intersection (list list2)
+ Return a new list containing only the elements that are members of
+ both LIST and LIST2. The test for equality is done with ‘equal’,
+ or with ‘-compare-fn’ if that’s non-nil.
+
+ (-intersection () ())
+ ⇒ ()
+ (-intersection '(1 2 3) '(4 5 6))
+ ⇒ ()
+ (-intersection '(1 2 3 4) '(3 4 5 6))
+ ⇒ (3 4)
+
+ -- Function: -powerset (list)
+ Return the power set of LIST.
+
+ (-powerset ())
+ ⇒ (nil)
+ (-powerset '(x y z))
+ ⇒ ((x y z) (x y) (x z) (x) (y z) (y) (z) nil)
+
+ -- Function: -permutations (list)
+ Return the permutations of LIST.
+
+ (-permutations ())
+ ⇒ (nil)
+ (-permutations '(1 2))
+ ⇒ ((1 2) (2 1))
+ (-permutations '(a b c))
+ ⇒ ((a b c) (a c b) (b a c) (b c a) (c a b) (c b a))
+
+ -- Function: -distinct (list)
+ Return a new list with all duplicates removed. The test for
+ equality is done with ‘equal’, or with ‘-compare-fn’ if that’s
+ non-nil.
+
+ Alias: ‘-uniq’
+
+ (-distinct ())
+ ⇒ ()
+ (-distinct '(1 2 2 4))
+ ⇒ (1 2 4)
+ (-distinct '(t t t))
+ ⇒ (t)
+
+
+File: dash.info, Node: Other list operations, Next: Tree operations, Prev: Set operations, Up: Functions
+
+2.10 Other list operations
+==========================
+
+Other list functions not fit to be classified elsewhere.
+
+ -- Function: -rotate (n list)
+ Rotate LIST N places to the right (left if N is negative). The
+ time complexity is O(n).
+
+ (-rotate 3 '(1 2 3 4 5 6 7))
+ ⇒ (5 6 7 1 2 3 4)
+ (-rotate -3 '(1 2 3 4 5 6 7))
+ ⇒ (4 5 6 7 1 2 3)
+ (-rotate 16 '(1 2 3 4 5 6 7))
+ ⇒ (6 7 1 2 3 4 5)
+
+ -- Function: -repeat (n x)
+ Return a new list of length N with each element being X. Return
+ nil if N is less than 1.
+
+ (-repeat 3 :a)
+ ⇒ (:a :a :a)
+ (-repeat 1 :a)
+ ⇒ (:a)
+ (-repeat 0 :a)
+ ⇒ nil
+
+ -- Function: -cons* (&rest args)
+ Make a new list from the elements of ARGS. The last 2 elements of
+ ARGS are used as the final cons of the result, so if the final
+ element of ARGS is not a list, the result is a dotted list. With
+ no ARGS, return nil.
+
+ (-cons* 1 2)
+ ⇒ (1 . 2)
+ (-cons* 1 2 3)
+ ⇒ (1 2 . 3)
+ (-cons* 1)
+ ⇒ 1
+
+ -- Function: -snoc (list elem &rest elements)
+ Append ELEM to the end of the list.
+
+ This is like ‘cons’, but operates on the end of list.
+
+ If ELEMENTS is non nil, append these to the list as well.
+
+ (-snoc '(1 2 3) 4)
+ ⇒ (1 2 3 4)
+ (-snoc '(1 2 3) 4 5 6)
+ ⇒ (1 2 3 4 5 6)
+ (-snoc '(1 2 3) '(4 5 6))
+ ⇒ (1 2 3 (4 5 6))
+
+ -- Function: -interpose (sep list)
+ Return a new list of all elements in LIST separated by SEP.
+
+ (-interpose "-" ())
+ ⇒ ()
+ (-interpose "-" '("a"))
+ ⇒ ("a")
+ (-interpose "-" '("a" "b" "c"))
+ ⇒ ("a" "-" "b" "-" "c")
+
+ -- Function: -interleave (&rest lists)
+ Return a new list of the first item in each list, then the second
+ etc.
+
+ (-interleave '(1 2) '("a" "b"))
+ ⇒ (1 "a" 2 "b")
+ (-interleave '(1 2) '("a" "b") '("A" "B"))
+ ⇒ (1 "a" "A" 2 "b" "B")
+ (-interleave '(1 2 3) '("a" "b"))
+ ⇒ (1 "a" 2 "b")
+
+ -- Function: -iota (count &optional start step)
+ Return a list containing COUNT numbers. Starts from START and adds
+ STEP each time. The default START is zero, the default STEP is 1.
+ This function takes its name from the corresponding primitive in
+ the APL language.
+
+ (-iota 6)
+ ⇒ (0 1 2 3 4 5)
+ (-iota 4 2.5 -2)
+ ⇒ (2.5 0.5 -1.5 -3.5)
+ (-iota -1)
+ error→ Wrong type argument: natnump, -1
+
+ -- Function: -zip-with (fn list1 list2)
+ Zip the two lists LIST1 and LIST2 using a function FN. This
+ function is applied pairwise taking as first argument element of
+ LIST1 and as second argument element of LIST2 at corresponding
+ position.
+
+ The anaphoric form ‘--zip-with’ binds the elements from LIST1 as
+ symbol ‘it’, and the elements from LIST2 as symbol ‘other’.
+
+ (-zip-with '+ '(1 2 3) '(4 5 6))
+ ⇒ (5 7 9)
+ (-zip-with 'cons '(1 2 3) '(4 5 6))
+ ⇒ ((1 . 4) (2 . 5) (3 . 6))
+ (--zip-with (concat it " and " other) '("Batman" "Jekyll") '("Robin" "Hyde"))
+ ⇒ ("Batman and Robin" "Jekyll and Hyde")
+
+ -- Function: -zip (&rest lists)
+ Zip LISTS together. Group the head of each list, followed by the
+ second elements of each list, and so on. The lengths of the
+ returned groupings are equal to the length of the shortest input
+ list.
+
+ If two lists are provided as arguments, return the groupings as a
+ list of cons cells. Otherwise, return the groupings as a list of
+ lists.
+
+ Use ‘-zip-lists’ (*note -zip-lists::) if you need the return value
+ to always be a list of lists.
+
+ Alias: ‘-zip-pair’
+
+ See also: ‘-zip-lists’ (*note -zip-lists::)
+
+ (-zip '(1 2 3) '(4 5 6))
+ ⇒ ((1 . 4) (2 . 5) (3 . 6))
+ (-zip '(1 2 3) '(4 5 6 7))
+ ⇒ ((1 . 4) (2 . 5) (3 . 6))
+ (-zip '(1 2) '(3 4 5) '(6))
+ ⇒ ((1 3 6))
+
+ -- Function: -zip-lists (&rest lists)
+ Zip LISTS together. Group the head of each list, followed by the
+ second elements of each list, and so on. The lengths of the
+ returned groupings are equal to the length of the shortest input
+ list.
+
+ The return value is always list of lists, which is a difference
+ from ‘-zip-pair’ which returns a cons-cell in case two input lists
+ are provided.
+
+ See also: ‘-zip’ (*note -zip::)
+
+ (-zip-lists '(1 2 3) '(4 5 6))
+ ⇒ ((1 4) (2 5) (3 6))
+ (-zip-lists '(1 2 3) '(4 5 6 7))
+ ⇒ ((1 4) (2 5) (3 6))
+ (-zip-lists '(1 2) '(3 4 5) '(6))
+ ⇒ ((1 3 6))
+
+ -- Function: -zip-fill (fill-value &rest lists)
+ Zip LISTS, with FILL-VALUE padded onto the shorter lists. The
+ lengths of the returned groupings are equal to the length of the
+ longest input list.
+
+ (-zip-fill 0 '(1 2 3 4 5) '(6 7 8 9))
+ ⇒ ((1 . 6) (2 . 7) (3 . 8) (4 . 9) (5 . 0))
+
+ -- Function: -unzip (lists)
+ Unzip LISTS.
+
+ This works just like ‘-zip’ (*note -zip::) but takes a list of
+ lists instead of a variable number of arguments, such that
+
+ (-unzip (-zip L1 L2 L3 ...))
+
+ is identity (given that the lists are the same length).
+
+ Note in particular that calling this on a list of two lists will
+ return a list of cons-cells such that the above identity works.
+
+ See also: ‘-zip’ (*note -zip::)
+
+ (-unzip (-zip '(1 2 3) '(a b c) '("e" "f" "g")))
+ ⇒ ((1 2 3) (a b c) ("e" "f" "g"))
+ (-unzip '((1 2) (3 4) (5 6) (7 8) (9 10)))
+ ⇒ ((1 3 5 7 9) (2 4 6 8 10))
+ (-unzip '((1 2) (3 4)))
+ ⇒ ((1 . 3) (2 . 4))
+
+ -- Function: -cycle (list)
+ Return an infinite circular copy of LIST. The returned list cycles
+ through the elements of LIST and repeats from the beginning.
+
+ (-take 5 (-cycle '(1 2 3)))
+ ⇒ (1 2 3 1 2)
+ (-take 7 (-cycle '(1 "and" 3)))
+ ⇒ (1 "and" 3 1 "and" 3 1)
+ (-zip (-cycle '(1 2 3)) '(1 2))
+ ⇒ ((1 . 1) (2 . 2))
+
+ -- Function: -pad (fill-value &rest lists)
+ Appends FILL-VALUE to the end of each list in LISTS such that they
+ will all have the same length.
+
+ (-pad 0 ())
+ ⇒ (nil)
+ (-pad 0 '(1))
+ ⇒ ((1))
+ (-pad 0 '(1 2 3) '(4 5))
+ ⇒ ((1 2 3) (4 5 0))
+
+ -- Function: -table (fn &rest lists)
+ Compute outer product of LISTS using function FN.
+
+ The function FN should have the same arity as the number of
+ supplied lists.
+
+ The outer product is computed by applying fn to all possible
+ combinations created by taking one element from each list in order.
+ The dimension of the result is (length lists).
+
+ See also: ‘-table-flat’ (*note -table-flat::)
+
+ (-table '* '(1 2 3) '(1 2 3))
+ ⇒ ((1 2 3) (2 4 6) (3 6 9))
+ (-table (lambda (a b) (-sum (-zip-with '* a b))) '((1 2) (3 4)) '((1 3) (2 4)))
+ ⇒ ((7 15) (10 22))
+ (apply '-table 'list (-repeat 3 '(1 2)))
+ ⇒ ((((1 1 1) (2 1 1)) ((1 2 1) (2 2 1))) (((1 1 2) (2 1 2)) ((1 2 2) (2 2 2))))
+
+ -- Function: -table-flat (fn &rest lists)
+ Compute flat outer product of LISTS using function FN.
+
+ The function FN should have the same arity as the number of
+ supplied lists.
+
+ The outer product is computed by applying fn to all possible
+ combinations created by taking one element from each list in order.
+ The results are flattened, ignoring the tensor structure of the
+ result. This is equivalent to calling:
+
+ (-flatten-n (1- (length lists)) (apply ’-table fn lists))
+
+ but the implementation here is much more efficient.
+
+ See also: ‘-flatten-n’ (*note -flatten-n::), ‘-table’ (*note
+ -table::)
+
+ (-table-flat 'list '(1 2 3) '(a b c))
+ ⇒ ((1 a) (2 a) (3 a) (1 b) (2 b) (3 b) (1 c) (2 c) (3 c))
+ (-table-flat '* '(1 2 3) '(1 2 3))
+ ⇒ (1 2 3 2 4 6 3 6 9)
+ (apply '-table-flat 'list (-repeat 3 '(1 2)))
+ ⇒ ((1 1 1) (2 1 1) (1 2 1) (2 2 1) (1 1 2) (2 1 2) (1 2 2) (2 2 2))
+
+ -- Function: -first (pred list)
+ Return the first item in LIST for which PRED returns non-nil.
+ Return nil if no such element is found. To get the first item in
+ the list no questions asked, use ‘car’.
+
+ Alias: ‘-find’.
+
+ This function’s anaphoric counterpart is ‘--first’.
+
+ (-first #'natnump '(-1 0 1))
+ ⇒ 0
+ (-first #'null '(1 2 3))
+ ⇒ nil
+ (--first (> it 2) '(1 2 3))
+ ⇒ 3
+
+ -- Function: -last (pred list)
+ Return the last x in LIST where (PRED x) is non-nil, else nil.
+
+ (-last 'even? '(1 2 3 4 5 6 3 3 3))
+ ⇒ 6
+ (-last 'even? '(1 3 7 5 9))
+ ⇒ nil
+ (--last (> (length it) 3) '("a" "looong" "word" "and" "short" "one"))
+ ⇒ "short"
+
+ -- Function: -first-item (list)
+ Return the first item of LIST, or nil on an empty list.
+
+ See also: ‘-second-item’ (*note -second-item::), ‘-last-item’
+ (*note -last-item::).
+
+ (-first-item '(1 2 3))
+ ⇒ 1
+ (-first-item nil)
+ ⇒ nil
+ (let ((list (list 1 2 3))) (setf (-first-item list) 5) list)
+ ⇒ (5 2 3)
+
+ -- Function: -second-item (list)
+ Return the second item of LIST, or nil if LIST is too short.
+
+ See also: ‘-third-item’ (*note -third-item::).
+
+ (-second-item '(1 2 3))
+ ⇒ 2
+ (-second-item nil)
+ ⇒ nil
+
+ -- Function: -third-item (list)
+ Return the third item of LIST, or nil if LIST is too short.
+
+ See also: ‘-fourth-item’ (*note -fourth-item::).
+
+ (-third-item '(1 2 3))
+ ⇒ 3
+ (-third-item nil)
+ ⇒ nil
+
+ -- Function: -fourth-item (list)
+ Return the fourth item of LIST, or nil if LIST is too short.
+
+ See also: ‘-fifth-item’ (*note -fifth-item::).
+
+ (-fourth-item '(1 2 3 4))
+ ⇒ 4
+ (-fourth-item nil)
+ ⇒ nil
+
+ -- Function: -fifth-item (list)
+ Return the fifth item of LIST, or nil if LIST is too short.
+
+ See also: ‘-last-item’ (*note -last-item::).
+
+ (-fifth-item '(1 2 3 4 5))
+ ⇒ 5
+ (-fifth-item nil)
+ ⇒ nil
+
+ -- Function: -last-item (list)
+ Return the last item of LIST, or nil on an empty list.
+
+ (-last-item '(1 2 3))
+ ⇒ 3
+ (-last-item nil)
+ ⇒ nil
+ (let ((list (list 1 2 3))) (setf (-last-item list) 5) list)
+ ⇒ (1 2 5)
+
+ -- Function: -butlast (list)
+ Return a list of all items in list except for the last.
+
+ (-butlast '(1 2 3))
+ ⇒ (1 2)
+ (-butlast '(1 2))
+ ⇒ (1)
+ (-butlast '(1))
+ ⇒ nil
+
+ -- Function: -sort (comparator list)
+ Sort LIST, stably, comparing elements using COMPARATOR. Return the
+ sorted list. LIST is NOT modified by side effects. COMPARATOR is
+ called with two elements of LIST, and should return non-nil if the
+ first element should sort before the second.
+
+ (-sort '< '(3 1 2))
+ ⇒ (1 2 3)
+ (-sort '> '(3 1 2))
+ ⇒ (3 2 1)
+ (--sort (< it other) '(3 1 2))
+ ⇒ (1 2 3)
+
+ -- Function: -list (arg)
+ Ensure ARG is a list. If ARG is already a list, return it as is
+ (not a copy). Otherwise, return a new list with ARG as its only
+ element.
+
+ Another supported calling convention is (-list &rest ARGS). In
+ this case, if ARG is not a list, a new list with all of ARGS as
+ elements is returned. This use is supported for backward
+ compatibility and is otherwise deprecated.
+
+ (-list 1)
+ ⇒ (1)
+ (-list ())
+ ⇒ ()
+ (-list '(1 2 3))
+ ⇒ (1 2 3)
+
+ -- Function: -fix (fn list)
+ Compute the (least) fixpoint of FN with initial input LIST.
+
+ FN is called at least once, results are compared with ‘equal’.
+
+ (-fix (lambda (l) (-non-nil (--mapcat (-split-at (/ (length it) 2) it) l))) '((1 2 3)))
+ ⇒ ((1) (2) (3))
+ (let ((l '((starwars scifi) (jedi starwars warrior)))) (--fix (-uniq (--mapcat (cons it (cdr (assq it l))) it)) '(jedi book)))
+ ⇒ (jedi starwars warrior scifi book)
+
+
+File: dash.info, Node: Tree operations, Next: Threading macros, Prev: Other list operations, Up: Functions
+
+2.11 Tree operations
+====================
+
+Functions pretending lists are trees.
+
+ -- Function: -tree-seq (branch children tree)
+ Return a sequence of the nodes in TREE, in depth-first search
+ order.
+
+ BRANCH is a predicate of one argument that returns non-nil if the
+ passed argument is a branch, that is, a node that can have
+ children.
+
+ CHILDREN is a function of one argument that returns the children of
+ the passed branch node.
+
+ Non-branch nodes are simply copied.
+
+ (-tree-seq 'listp 'identity '(1 (2 3) 4 (5 (6 7))))
+ ⇒ ((1 (2 3) 4 (5 (6 7))) 1 (2 3) 2 3 4 (5 (6 7)) 5 (6 7) 6 7)
+ (-tree-seq 'listp 'reverse '(1 (2 3) 4 (5 (6 7))))
+ ⇒ ((1 (2 3) 4 (5 (6 7))) (5 (6 7)) (6 7) 7 6 5 4 (2 3) 3 2 1)
+ (--tree-seq (vectorp it) (append it nil) [1 [2 3] 4 [5 [6 7]]])
+ ⇒ ([1 [2 3] 4 [5 [6 7]]] 1 [2 3] 2 3 4 [5 [6 7]] 5 [6 7] 6 7)
+
+ -- Function: -tree-map (fn tree)
+ Apply FN to each element of TREE while preserving the tree
+ structure.
+
+ (-tree-map '1+ '(1 (2 3) (4 (5 6) 7)))
+ ⇒ (2 (3 4) (5 (6 7) 8))
+ (-tree-map '(lambda (x) (cons x (expt 2 x))) '(1 (2 3) 4))
+ ⇒ ((1 . 2) ((2 . 4) (3 . 8)) (4 . 16))
+ (--tree-map (length it) '("<body>" ("<p>" "text" "</p>") "</body>"))
+ ⇒ (6 (3 4 4) 7)
+
+ -- Function: -tree-map-nodes (pred fun tree)
+ Call FUN on each node of TREE that satisfies PRED.
+
+ If PRED returns nil, continue descending down this node. If PRED
+ returns non-nil, apply FUN to this node and do not descend further.
+
+ (-tree-map-nodes 'vectorp (lambda (x) (-sum (append x nil))) '(1 [2 3] 4 (5 [6 7] 8)))
+ ⇒ (1 5 4 (5 13 8))
+ (-tree-map-nodes 'keywordp (lambda (x) (symbol-name x)) '(1 :foo 4 ((5 6 :bar) :baz 8)))
+ ⇒ (1 ":foo" 4 ((5 6 ":bar") ":baz" 8))
+ (--tree-map-nodes (eq (car-safe it) 'add-mode) (-concat it (list :mode 'emacs-lisp-mode)) '(with-mode emacs-lisp-mode (foo bar) (add-mode a b) (baz (add-mode c d))))
+ ⇒ (with-mode emacs-lisp-mode (foo bar) (add-mode a b :mode emacs-lisp-mode) (baz (add-mode c d :mode emacs-lisp-mode)))
+
+ -- Function: -tree-reduce (fn tree)
+ Use FN to reduce elements of list TREE. If elements of TREE are
+ lists themselves, apply the reduction recursively.
+
+ FN is first applied to first element of the list and second
+ element, then on this result and third element from the list etc.
+
+ See ‘-reduce-r’ (*note -reduce-r::) for how exactly are lists of
+ zero or one element handled.
+
+ (-tree-reduce '+ '(1 (2 3) (4 5)))
+ ⇒ 15
+ (-tree-reduce 'concat '("strings" (" on" " various") ((" levels"))))
+ ⇒ "strings on various levels"
+ (--tree-reduce (cond ((stringp it) (concat it " " acc)) (t (let ((sn (symbol-name it))) (concat "<" sn ">" acc "</" sn ">")))) '(body (p "some words") (div "more" (b "bold") "words")))
+ ⇒ "<body><p>some words</p> <div>more <b>bold</b> words</div></body>"
+
+ -- Function: -tree-reduce-from (fn init-value tree)
+ Use FN to reduce elements of list TREE. If elements of TREE are
+ lists themselves, apply the reduction recursively.
+
+ FN is first applied to INIT-VALUE and first element of the list,
+ then on this result and second element from the list etc.
+
+ The initial value is ignored on cons pairs as they always contain
+ two elements.
+
+ (-tree-reduce-from '+ 1 '(1 (1 1) ((1))))
+ ⇒ 8
+ (--tree-reduce-from (-concat acc (list it)) nil '(1 (2 3 (4 5)) (6 7)))
+ ⇒ ((7 6) ((5 4) 3 2) 1)
+
+ -- Function: -tree-mapreduce (fn folder tree)
+ Apply FN to each element of TREE, and make a list of the results.
+ If elements of TREE are lists themselves, apply FN recursively to
+ elements of these nested lists.
+
+ Then reduce the resulting lists using FOLDER and initial value
+ INIT-VALUE. See ‘-reduce-r-from’ (*note -reduce-r-from::).
+
+ This is the same as calling ‘-tree-reduce’ (*note -tree-reduce::)
+ after ‘-tree-map’ (*note -tree-map::) but is twice as fast as it
+ only traverse the structure once.
+
+ (-tree-mapreduce 'list 'append '(1 (2 (3 4) (5 6)) (7 (8 9))))
+ ⇒ (1 2 3 4 5 6 7 8 9)
+ (--tree-mapreduce 1 (+ it acc) '(1 (2 (4 9) (2 1)) (7 (4 3))))
+ ⇒ 9
+ (--tree-mapreduce 0 (max acc (1+ it)) '(1 (2 (4 9) (2 1)) (7 (4 3))))
+ ⇒ 3
+
+ -- Function: -tree-mapreduce-from (fn folder init-value tree)
+ Apply FN to each element of TREE, and make a list of the results.
+ If elements of TREE are lists themselves, apply FN recursively to
+ elements of these nested lists.
+
+ Then reduce the resulting lists using FOLDER and initial value
+ INIT-VALUE. See ‘-reduce-r-from’ (*note -reduce-r-from::).
+
+ This is the same as calling ‘-tree-reduce-from’ (*note
+ -tree-reduce-from::) after ‘-tree-map’ (*note -tree-map::) but is
+ twice as fast as it only traverse the structure once.
+
+ (-tree-mapreduce-from 'identity '* 1 '(1 (2 (3 4) (5 6)) (7 (8 9))))
+ ⇒ 362880
+ (--tree-mapreduce-from (+ it it) (cons it acc) nil '(1 (2 (4 9) (2 1)) (7 (4 3))))
+ ⇒ (2 (4 (8 18) (4 2)) (14 (8 6)))
+ (concat "{" (--tree-mapreduce-from (cond ((-cons-pair? it) (concat (symbol-name (car it)) " -> " (symbol-name (cdr it)))) (t (concat (symbol-name it) " : {"))) (concat it (unless (or (equal acc "}") (equal (substring it (1- (length it))) "{")) ", ") acc) "}" '((elisp-mode (foo (bar . booze)) (baz . qux)) (c-mode (foo . bla) (bum . bam)))))
+ ⇒ "{elisp-mode : {foo : {bar -> booze}, baz -> qux}, c-mode : {foo -> bla, bum -> bam}}"
+
+ -- Function: -clone (list)
+ Create a deep copy of LIST. The new list has the same elements and
+ structure but all cons are replaced with new ones. This is useful
+ when you need to clone a structure such as plist or alist.
+
+ (let* ((a '(1 2 3)) (b (-clone a))) (nreverse a) b)
+ ⇒ (1 2 3)
+
+
+File: dash.info, Node: Threading macros, Next: Binding, Prev: Tree operations, Up: Functions
+
+2.12 Threading macros
+=====================
+
+Macros that conditionally combine sequential forms for brevity or
+readability.
+
+ -- Macro: -> (x &optional form &rest more)
+ Thread the expr through the forms. Insert X as the second item in
+ the first form, making a list of it if it is not a list already.
+ If there are more forms, insert the first form as the second item
+ in second form, etc.
+
+ (-> '(2 3 5))
+ ⇒ (2 3 5)
+ (-> '(2 3 5) (append '(8 13)))
+ ⇒ (2 3 5 8 13)
+ (-> '(2 3 5) (append '(8 13)) (-slice 1 -1))
+ ⇒ (3 5 8)
+
+ -- Macro: ->> (x &optional form &rest more)
+ Thread the expr through the forms. Insert X as the last item in
+ the first form, making a list of it if it is not a list already.
+ If there are more forms, insert the first form as the last item in
+ second form, etc.
+
+ (->> '(1 2 3) (-map 'square))
+ ⇒ (1 4 9)
+ (->> '(1 2 3) (-map 'square) (-remove 'even?))
+ ⇒ (1 9)
+ (->> '(1 2 3) (-map 'square) (-reduce '+))
+ ⇒ 14
+
+ -- Macro: --> (x &rest forms)
+ Starting with the value of X, thread each expression through FORMS.
+
+ Insert X at the position signified by the symbol ‘it’ in the first
+ form. If there are more forms, insert the first form at the
+ position signified by ‘it’ in in second form, etc.
+
+ (--> "def" (concat "abc" it "ghi"))
+ ⇒ "abcdefghi"
+ (--> "def" (concat "abc" it "ghi") (upcase it))
+ ⇒ "ABCDEFGHI"
+ (--> "def" (concat "abc" it "ghi") upcase)
+ ⇒ "ABCDEFGHI"
+
+ -- Macro: -as-> (value variable &rest forms)
+ Starting with VALUE, thread VARIABLE through FORMS.
+
+ In the first form, bind VARIABLE to VALUE. In the second form,
+ bind VARIABLE to the result of the first form, and so forth.
+
+ (-as-> 3 my-var (1+ my-var) (list my-var) (mapcar (lambda (ele) (* 2 ele)) my-var))
+ ⇒ (8)
+ (-as-> 3 my-var 1+)
+ ⇒ 4
+ (-as-> 3 my-var)
+ ⇒ 3
+
+ -- Macro: -some-> (x &optional form &rest more)
+ When expr is non-nil, thread it through the first form (via ‘->’
+ (*note ->::)), and when that result is non-nil, through the next
+ form, etc.
+
+ (-some-> '(2 3 5))
+ ⇒ (2 3 5)
+ (-some-> 5 square)
+ ⇒ 25
+ (-some-> 5 even? square)
+ ⇒ nil
+
+ -- Macro: -some->> (x &optional form &rest more)
+ When expr is non-nil, thread it through the first form (via ‘->>’
+ (*note ->>::)), and when that result is non-nil, through the next
+ form, etc.
+
+ (-some->> '(1 2 3) (-map 'square))
+ ⇒ (1 4 9)
+ (-some->> '(1 3 5) (-last 'even?) (+ 100))
+ ⇒ nil
+ (-some->> '(2 4 6) (-last 'even?) (+ 100))
+ ⇒ 106
+
+ -- Macro: -some--> (expr &rest forms)
+ Thread EXPR through FORMS via ‘-->’ (*note -->::), while the result
+ is non-nil. When EXPR evaluates to non-nil, thread the result
+ through the first of FORMS, and when that result is non-nil, thread
+ it through the next form, etc.
+
+ (-some--> "def" (concat "abc" it "ghi"))
+ ⇒ "abcdefghi"
+ (-some--> nil (concat "abc" it "ghi"))
+ ⇒ nil
+ (-some--> '(0 1) (-remove #'natnump it) (append it it) (-map #'1+ it))
+ ⇒ ()
+
+ -- Macro: -doto (init &rest forms)
+ Evaluate INIT and pass it as argument to FORMS with ‘->’ (*note
+ ->::). The RESULT of evaluating INIT is threaded through each of
+ FORMS individually using ‘->’ (*note ->::), which see. The return
+ value is RESULT, which FORMS may have modified by side effect.
+
+ (-doto (list 1 2 3) pop pop)
+ ⇒ (3)
+ (-doto (cons 1 2) (setcar 3) (setcdr 4))
+ ⇒ (3 . 4)
+ (gethash 'k (--doto (make-hash-table) (puthash 'k 'v it)))
+ ⇒ v
+
+
+File: dash.info, Node: Binding, Next: Side effects, Prev: Threading macros, Up: Functions
+
+2.13 Binding
+============
+
+Macros that combine ‘let’ and ‘let*’ with destructuring and flow
+control.
+
+ -- Macro: -when-let ((var val) &rest body)
+ If VAL evaluates to non-nil, bind it to VAR and execute body.
+
+ Note: binding is done according to ‘-let’ (*note -let::).
+
+ (-when-let (match-index (string-match "d" "abcd")) (+ match-index 2))
+ ⇒ 5
+ (-when-let ((&plist :foo foo) (list :foo "foo")) foo)
+ ⇒ "foo"
+ (-when-let ((&plist :foo foo) (list :bar "bar")) foo)
+ ⇒ nil
+
+ -- Macro: -when-let* (vars-vals &rest body)
+ If all VALS evaluate to true, bind them to their corresponding VARS
+ and execute body. VARS-VALS should be a list of (VAR VAL) pairs.
+
+ Note: binding is done according to ‘-let*’ (*note -let*::). VALS
+ are evaluated sequentially, and evaluation stops after the first
+ nil VAL is encountered.
+
+ (-when-let* ((x 5) (y 3) (z (+ y 4))) (+ x y z))
+ ⇒ 15
+ (-when-let* ((x 5) (y nil) (z 7)) (+ x y z))
+ ⇒ nil
+
+ -- Macro: -if-let ((var val) then &rest else)
+ If VAL evaluates to non-nil, bind it to VAR and do THEN, otherwise
+ do ELSE.
+
+ Note: binding is done according to ‘-let’ (*note -let::).
+
+ (-if-let (match-index (string-match "d" "abc")) (+ match-index 3) 7)
+ ⇒ 7
+ (--if-let (even? 4) it nil)
+ ⇒ t
+
+ -- Macro: -if-let* (vars-vals then &rest else)
+ If all VALS evaluate to true, bind them to their corresponding VARS
+ and do THEN, otherwise do ELSE. VARS-VALS should be a list of (VAR
+ VAL) pairs.
+
+ Note: binding is done according to ‘-let*’ (*note -let*::). VALS
+ are evaluated sequentially, and evaluation stops after the first
+ nil VAL is encountered.
+
+ (-if-let* ((x 5) (y 3) (z 7)) (+ x y z) "foo")
+ ⇒ 15
+ (-if-let* ((x 5) (y nil) (z 7)) (+ x y z) "foo")
+ ⇒ "foo"
+ (-if-let* (((_ _ x) '(nil nil 7))) x)
+ ⇒ 7
+
+ -- Macro: -let (varlist &rest body)
+ Bind variables according to VARLIST then eval BODY.
+
+ VARLIST is a list of lists of the form (PATTERN SOURCE). Each
+ PATTERN is matched against the SOURCE "structurally". SOURCE is
+ only evaluated once for each PATTERN. Each PATTERN is matched
+ recursively, and can therefore contain sub-patterns which are
+ matched against corresponding sub-expressions of SOURCE.
+
+ All the SOURCEs are evalled before any symbols are bound (i.e. "in
+ parallel").
+
+ If VARLIST only contains one (PATTERN SOURCE) element, you can
+ optionally specify it using a vector and discarding the outer-most
+ parens. Thus
+
+ (-let ((PATTERN SOURCE)) ...)
+
+ becomes
+
+ (-let [PATTERN SOURCE] ...).
+
+ ‘-let’ (*note -let::) uses a convention of not binding places
+ (symbols) starting with _ whenever it’s possible. You can use this
+ to skip over entries you don’t care about. However, this is not
+ *always* possible (as a result of implementation) and these symbols
+ might get bound to undefined values.
+
+ Following is the overview of supported patterns. Remember that
+ patterns can be matched recursively, so every a, b, aK in the
+ following can be a matching construct and not necessarily a
+ symbol/variable.
+
+ Symbol:
+
+ a - bind the SOURCE to A. This is just like regular ‘let’.
+
+ Conses and lists:
+
+ (a) - bind ‘car’ of cons/list to A
+
+ (a . b) - bind car of cons to A and ‘cdr’ to B
+
+ (a b) - bind car of list to A and ‘cadr’ to B
+
+ (a1 a2 a3 ...) - bind 0th car of list to A1, 1st to A2, 2nd to
+ A3...
+
+ (a1 a2 a3 ... aN . rest) - as above, but bind the Nth cdr to REST.
+
+ Vectors:
+
+ [a] - bind 0th element of a non-list sequence to A (works with
+ vectors, strings, bit arrays...)
+
+ [a1 a2 a3 ...] - bind 0th element of non-list sequence to A0, 1st
+ to A1, 2nd to A2, ... If the PATTERN is shorter than SOURCE, the
+ values at places not in PATTERN are ignored. If the PATTERN is
+ longer than SOURCE, an ‘error’ is thrown.
+
+ [a1 a2 a3 ... &rest rest] - as above, but bind the rest of the
+ sequence to REST. This is conceptually the same as improper list
+ matching (a1 a2 ... aN . rest)
+
+ Key/value stores:
+
+ (&plist key0 a0 ... keyN aN) - bind value mapped by keyK in the
+ SOURCE plist to aK. If the value is not found, aK is nil. Uses
+ ‘plist-get’ to fetch values.
+
+ (&alist key0 a0 ... keyN aN) - bind value mapped by keyK in the
+ SOURCE alist to aK. If the value is not found, aK is nil. Uses
+ ‘assoc’ to fetch values.
+
+ (&hash key0 a0 ... keyN aN) - bind value mapped by keyK in the
+ SOURCE hash table to aK. If the value is not found, aK is nil.
+ Uses ‘gethash’ to fetch values.
+
+ Further, special keyword &keys supports "inline" matching of
+ plist-like key-value pairs, similarly to &keys keyword of
+ ‘cl-defun’.
+
+ (a1 a2 ... aN &keys key1 b1 ... keyN bK)
+
+ This binds N values from the list to a1 ... aN, then interprets the
+ cdr as a plist (see key/value matching above).
+
+ A shorthand notation for kv-destructuring exists which allows the
+ patterns be optionally left out and derived from the key name in
+ the following fashion:
+
+ - a key :foo is converted into ‘foo’ pattern, - a key ’bar is
+ converted into ‘bar’ pattern, - a key "baz" is converted into ‘baz’
+ pattern.
+
+ That is, the entire value under the key is bound to the derived
+ variable without any further destructuring.
+
+ This is possible only when the form following the key is not a
+ valid pattern (i.e. not a symbol, a cons cell or a vector).
+ Otherwise the matching proceeds as usual and in case of an invalid
+ spec fails with an error.
+
+ Thus the patterns are normalized as follows:
+
+ ;; derive all the missing patterns (&plist :foo ’bar "baz") =>
+ (&plist :foo foo ’bar bar "baz" baz)
+
+ ;; we can specify some but not others (&plist :foo ’bar
+ explicit-bar) => (&plist :foo foo ’bar explicit-bar)
+
+ ;; nothing happens, we store :foo in x (&plist :foo x) => (&plist
+ :foo x)
+
+ ;; nothing happens, we match recursively (&plist :foo (a b c)) =>
+ (&plist :foo (a b c))
+
+ You can name the source using the syntax SYMBOL &as PATTERN. This
+ syntax works with lists (proper or improper), vectors and all types
+ of maps.
+
+ (list &as a b c) (list 1 2 3)
+
+ binds A to 1, B to 2, C to 3 and LIST to (1 2 3).
+
+ Similarly:
+
+ (bounds &as beg . end) (cons 1 2)
+
+ binds BEG to 1, END to 2 and BOUNDS to (1 . 2).
+
+ (items &as first . rest) (list 1 2 3)
+
+ binds FIRST to 1, REST to (2 3) and ITEMS to (1 2 3)
+
+ [vect &as _ b c] [1 2 3]
+
+ binds B to 2, C to 3 and VECT to [1 2 3] (_ avoids binding as
+ usual).
+
+ (plist &as &plist :b b) (list :a 1 :b 2 :c 3)
+
+ binds B to 2 and PLIST to (:a 1 :b 2 :c 3). Same for &alist and
+ &hash.
+
+ This is especially useful when we want to capture the result of a
+ computation and destructure at the same time. Consider the form
+ (function-returning-complex-structure) returning a list of two
+ vectors with two items each. We want to capture this entire result
+ and pass it to another computation, but at the same time we want to
+ get the second item from each vector. We can achieve it with
+ pattern
+
+ (result &as [_ a] [_ b]) (function-returning-complex-structure)
+
+ Note: Clojure programmers may know this feature as the ":as
+ binding". The difference is that we put the &as at the front
+ because we need to support improper list binding.
+
+ (-let (([a (b c) d] [1 (2 3) 4])) (list a b c d))
+ ⇒ (1 2 3 4)
+ (-let [(a b c . d) (list 1 2 3 4 5 6)] (list a b c d))
+ ⇒ (1 2 3 (4 5 6))
+ (-let [(&plist :foo foo :bar bar) (list :baz 3 :foo 1 :qux 4 :bar 2)] (list foo bar))
+ ⇒ (1 2)
+
+ -- Macro: -let* (varlist &rest body)
+ Bind variables according to VARLIST then eval BODY.
+
+ VARLIST is a list of lists of the form (PATTERN SOURCE). Each
+ PATTERN is matched against the SOURCE structurally. SOURCE is only
+ evaluated once for each PATTERN.
+
+ Each SOURCE can refer to the symbols already bound by this VARLIST.
+ This is useful if you want to destructure SOURCE recursively but
+ also want to name the intermediate structures.
+
+ See ‘-let’ (*note -let::) for the list of all possible patterns.
+
+ (-let* (((a . b) (cons 1 2)) ((c . d) (cons 3 4))) (list a b c d))
+ ⇒ (1 2 3 4)
+ (-let* (((a . b) (cons 1 (cons 2 3))) ((c . d) b)) (list a b c d))
+ ⇒ (1 (2 . 3) 2 3)
+ (-let* (((&alist "foo" foo "bar" bar) (list (cons "foo" 1) (cons "bar" (list 'a 'b 'c)))) ((a b c) bar)) (list foo a b c bar))
+ ⇒ (1 a b c (a b c))
+
+ -- Macro: -lambda (match-form &rest body)
+ Return a lambda which destructures its input as MATCH-FORM and
+ executes BODY.
+
+ Note that you have to enclose the MATCH-FORM in a pair of parens,
+ such that:
+
+ (-lambda (x) body) (-lambda (x y ...) body)
+
+ has the usual semantics of ‘lambda’. Furthermore, these get
+ translated into normal ‘lambda’, so there is no performance
+ penalty.
+
+ See ‘-let’ (*note -let::) for a description of the destructuring
+ mechanism.
+
+ (-map (-lambda ((x y)) (+ x y)) '((1 2) (3 4) (5 6)))
+ ⇒ (3 7 11)
+ (-map (-lambda ([x y]) (+ x y)) '([1 2] [3 4] [5 6]))
+ ⇒ (3 7 11)
+ (funcall (-lambda ((_ . a) (_ . b)) (-concat a b)) '(1 2 3) '(4 5 6))
+ ⇒ (2 3 5 6)
+
+ -- Macro: -setq ([match-form val] ...)
+ Bind each MATCH-FORM to the value of its VAL.
+
+ MATCH-FORM destructuring is done according to the rules of ‘-let’
+ (*note -let::).
+
+ This macro allows you to bind multiple variables by destructuring
+ the value, so for example:
+
+ (-setq (a b) x (&plist :c c) plist)
+
+ expands roughly speaking to the following code
+
+ (setq a (car x) b (cadr x) c (plist-get plist :c))
+
+ Care is taken to only evaluate each VAL once so that in case of
+ multiple assignments it does not cause unexpected side effects.
+
+ (let (a) (-setq a 1) a)
+ ⇒ 1
+ (let (a b) (-setq (a b) (list 1 2)) (list a b))
+ ⇒ (1 2)
+ (let (c) (-setq (&plist :c c) (list :c "c")) c)
+ ⇒ "c"
+
+
+File: dash.info, Node: Side effects, Next: Destructive operations, Prev: Binding, Up: Functions
+
+2.14 Side effects
+=================
+
+Functions iterating over lists for side effect only.
+
+ -- Function: -each (list fn)
+ Call FN on each element of LIST. Return nil; this function is
+ intended for side effects.
+
+ Its anaphoric counterpart is ‘--each’.
+
+ For access to the current element’s index in LIST, see
+ ‘-each-indexed’ (*note -each-indexed::).
+
+ (let (l) (-each '(1 2 3) (lambda (x) (push x l))) l)
+ ⇒ (3 2 1)
+ (let (l) (--each '(1 2 3) (push it l)) l)
+ ⇒ (3 2 1)
+ (-each '(1 2 3) #'identity)
+ ⇒ nil
+
+ -- Function: -each-while (list pred fn)
+ Call FN on each ITEM in LIST, while (PRED ITEM) is non-nil. Once
+ an ITEM is reached for which PRED returns nil, FN is no longer
+ called. Return nil; this function is intended for side effects.
+
+ Its anaphoric counterpart is ‘--each-while’.
+
+ (let (l) (-each-while '(2 4 5 6) #'even? (lambda (x) (push x l))) l)
+ ⇒ (4 2)
+ (let (l) (--each-while '(1 2 3 4) (< it 3) (push it l)) l)
+ ⇒ (2 1)
+ (let ((s 0)) (--each-while '(1 3 4 5) (< it 5) (setq s (+ s it))) s)
+ ⇒ 8
+
+ -- Function: -each-indexed (list fn)
+ Call FN on each index and element of LIST. For each ITEM at INDEX
+ in LIST, call (funcall FN INDEX ITEM). Return nil; this function
+ is intended for side effects.
+
+ See also: ‘-map-indexed’ (*note -map-indexed::).
+
+ (let (l) (-each-indexed '(a b c) (lambda (i x) (push (list x i) l))) l)
+ ⇒ ((c 2) (b 1) (a 0))
+ (let (l) (--each-indexed '(a b c) (push (list it it-index) l)) l)
+ ⇒ ((c 2) (b 1) (a 0))
+ (let (l) (--each-indexed () (push it l)) l)
+ ⇒ ()
+
+ -- Function: -each-r (list fn)
+ Call FN on each element of LIST in reversed order. Return nil;
+ this function is intended for side effects.
+
+ Its anaphoric counterpart is ‘--each-r’.
+
+ (let (l) (-each-r '(1 2 3) (lambda (x) (push x l))) l)
+ ⇒ (1 2 3)
+ (let (l) (--each-r '(1 2 3) (push it l)) l)
+ ⇒ (1 2 3)
+ (-each-r '(1 2 3) #'identity)
+ ⇒ nil
+
+ -- Function: -each-r-while (list pred fn)
+ Call FN on each ITEM in reversed LIST, while (PRED ITEM) is
+ non-nil. Once an ITEM is reached for which PRED returns nil, FN is
+ no longer called. Return nil; this function is intended for side
+ effects.
+
+ Its anaphoric counterpart is ‘--each-r-while’.
+
+ (let (l) (-each-r-while '(2 4 5 6) #'even? (lambda (x) (push x l))) l)
+ ⇒ (6)
+ (let (l) (--each-r-while '(1 2 3 4) (>= it 3) (push it l)) l)
+ ⇒ (3 4)
+ (let ((s 0)) (--each-r-while '(1 2 3 5) (> it 1) (setq s (+ s it))) s)
+ ⇒ 10
+
+ -- Function: -dotimes (num fn)
+ Call FN NUM times, presumably for side effects. FN is called with
+ a single argument on successive integers running from 0, inclusive,
+ to NUM, exclusive. FN is not called if NUM is less than 1.
+
+ This function’s anaphoric counterpart is ‘--dotimes’.
+
+ (let (s) (-dotimes 3 (lambda (n) (push n s))) s)
+ ⇒ (2 1 0)
+ (let (s) (-dotimes 0 (lambda (n) (push n s))) s)
+ ⇒ ()
+ (let (s) (--dotimes 5 (push it s)) s)
+ ⇒ (4 3 2 1 0)
+
+
+File: dash.info, Node: Destructive operations, Next: Function combinators, Prev: Side effects, Up: Functions
+
+2.15 Destructive operations
+===========================
+
+Macros that modify variables holding lists.
+
+ -- Macro: !cons (car cdr)
+ Destructive: Set CDR to the cons of CAR and CDR.
+
+ (let (l) (!cons 5 l) l)
+ ⇒ (5)
+ (let ((l '(3))) (!cons 5 l) l)
+ ⇒ (5 3)
+
+ -- Macro: !cdr (list)
+ Destructive: Set LIST to the cdr of LIST.
+
+ (let ((l '(3))) (!cdr l) l)
+ ⇒ ()
+ (let ((l '(3 5))) (!cdr l) l)
+ ⇒ (5)
+
+
+File: dash.info, Node: Function combinators, Prev: Destructive operations, Up: Functions
+
+2.16 Function combinators
+=========================
+
+Functions that manipulate and compose other functions.
+
+ -- Function: -partial (fun &rest args)
+ Return a function that is a partial application of FUN to ARGS.
+ ARGS is a list of the first N arguments to pass to FUN. The result
+ is a new function which does the same as FUN, except that the first
+ N arguments are fixed at the values with which this function was
+ called.
+
+ (funcall (-partial #'+ 5))
+ ⇒ 5
+ (funcall (-partial #'- 5) 3)
+ ⇒ 2
+ (funcall (-partial #'+ 5 2) 3)
+ ⇒ 10
+
+ -- Function: -rpartial (fn &rest args)
+ Return a function that is a partial application of FN to ARGS.
+ ARGS is a list of the last N arguments to pass to FN. The result
+ is a new function which does the same as FN, except that the last N
+ arguments are fixed at the values with which this function was
+ called. This is like ‘-partial’ (*note -partial::), except the
+ arguments are fixed starting from the right rather than the left.
+
+ (funcall (-rpartial #'- 5))
+ ⇒ -5
+ (funcall (-rpartial #'- 5) 8)
+ ⇒ 3
+ (funcall (-rpartial #'- 5 2) 10)
+ ⇒ 3
+
+ -- Function: -juxt (&rest fns)
+ Return a function that is the juxtaposition of FNS. The returned
+ function takes a variable number of ARGS, applies each of FNS in
+ turn to ARGS, and returns the list of results.
+
+ (funcall (-juxt) 1 2)
+ ⇒ ()
+ (funcall (-juxt #'+ #'- #'* #'/) 7 5)
+ ⇒ (12 2 35 1)
+ (mapcar (-juxt #'number-to-string #'1+) '(1 2))
+ ⇒ (("1" 2) ("2" 3))
+
+ -- Function: -compose (&rest fns)
+ Compose FNS into a single composite function. Return a function
+ that takes a variable number of ARGS, applies the last function in
+ FNS to ARGS, and returns the result of calling each remaining
+ function on the result of the previous function, right-to-left. If
+ no FNS are given, return a variadic ‘identity’ function.
+
+ (funcall (-compose #'- #'1+ #'+) 1 2 3)
+ ⇒ -7
+ (funcall (-compose #'identity #'1+) 3)
+ ⇒ 4
+ (mapcar (-compose #'not #'stringp) '(nil ""))
+ ⇒ (t nil)
+
+ -- Function: -applify (fn)
+ Return a function that applies FN to a single list of args. This
+ changes the arity of FN from taking N distinct arguments to taking
+ 1 argument which is a list of N arguments.
+
+ (funcall (-applify #'+) nil)
+ ⇒ 0
+ (mapcar (-applify #'+) '((1 1 1) (1 2 3) (5 5 5)))
+ ⇒ (3 6 15)
+ (funcall (-applify #'<) '(3 6))
+ ⇒ t
+
+ -- Function: -on (op trans)
+ Return a function that calls TRANS on each arg and OP on the
+ results. The returned function takes a variable number of
+ arguments, calls the function TRANS on each one in turn, and then
+ passes those results as the list of arguments to OP, in the same
+ order.
+
+ For example, the following pairs of expressions are morally
+ equivalent:
+
+ (funcall (-on #’+ #’1+) 1 2 3) = (+ (1+ 1) (1+ 2) (1+ 3)) (funcall
+ (-on #’+ #’1+)) = (+)
+
+ (-sort (-on #'< #'length) '((1 2 3) (1) (1 2)))
+ ⇒ ((1) (1 2) (1 2 3))
+ (funcall (-on #'min #'string-to-number) "22" "2" "1" "12")
+ ⇒ 1
+ (-min-by (-on #'> #'length) '((1 2 3) (4) (1 2)))
+ ⇒ (4)
+
+ -- Function: -flip (fn)
+ Return a function that calls FN with its arguments reversed. The
+ returned function takes the same number of arguments as FN.
+
+ For example, the following two expressions are morally equivalent:
+
+ (funcall (-flip #’-) 1 2) = (- 2 1)
+
+ See also: ‘-rotate-args’ (*note -rotate-args::).
+
+ (-sort (-flip #'<) '(4 3 6 1))
+ ⇒ (6 4 3 1)
+ (funcall (-flip #'-) 3 2 1 10)
+ ⇒ 4
+ (funcall (-flip #'1+) 1)
+ ⇒ 2
+
+ -- Function: -rotate-args (n fn)
+ Return a function that calls FN with args rotated N places to the
+ right. The returned function takes the same number of arguments as
+ FN, rotates the list of arguments N places to the right (left if N
+ is negative) just like ‘-rotate’ (*note -rotate::), and applies FN
+ to the result.
+
+ See also: ‘-flip’ (*note -flip::).
+
+ (funcall (-rotate-args -1 #'list) 1 2 3 4)
+ ⇒ (2 3 4 1)
+ (funcall (-rotate-args 1 #'-) 1 10 100)
+ ⇒ 89
+ (funcall (-rotate-args 2 #'list) 3 4 5 1 2)
+ ⇒ (1 2 3 4 5)
+
+ -- Function: -const (c)
+ Return a function that returns C ignoring any additional arguments.
+
+ In types: a -> b -> a
+
+ (funcall (-const 2) 1 3 "foo")
+ ⇒ 2
+ (mapcar (-const 1) '("a" "b" "c" "d"))
+ ⇒ (1 1 1 1)
+ (-sum (mapcar (-const 1) '("a" "b" "c" "d")))
+ ⇒ 4
+
+ -- Macro: -cut (&rest params)
+ Take n-ary function and n arguments and specialize some of them.
+ Arguments denoted by <> will be left unspecialized.
+
+ See SRFI-26 for detailed description.
+
+ (funcall (-cut list 1 <> 3 <> 5) 2 4)
+ ⇒ (1 2 3 4 5)
+ (-map (-cut funcall <> 5) `(1+ 1- ,(lambda (x) (/ 1.0 x))))
+ ⇒ (6 4 0.2)
+ (-map (-cut <> 1 2 3) '(list vector string))
+ ⇒ ((1 2 3) [1 2 3] "\1\2\3")
+
+ -- Function: -not (pred)
+ Return a predicate that negates the result of PRED. The returned
+ predicate passes its arguments to PRED. If PRED returns nil, the
+ result is non-nil; otherwise the result is nil.
+
+ See also: ‘-andfn’ (*note -andfn::) and ‘-orfn’ (*note -orfn::).
+
+ (funcall (-not #'numberp) "5")
+ ⇒ t
+ (-sort (-not #'<) '(5 2 1 0 6))
+ ⇒ (6 5 2 1 0)
+ (-filter (-not (-partial #'< 4)) '(1 2 3 4 5 6 7 8))
+ ⇒ (1 2 3 4)
+
+ -- Function: -orfn (&rest preds)
+ Return a predicate that returns the first non-nil result of PREDS.
+ The returned predicate takes a variable number of arguments, passes
+ them to each predicate in PREDS in turn until one of them returns
+ non-nil, and returns that non-nil result without calling the
+ remaining PREDS. If all PREDS return nil, or if no PREDS are
+ given, the returned predicate returns nil.
+
+ See also: ‘-andfn’ (*note -andfn::) and ‘-not’ (*note -not::).
+
+ (-filter (-orfn #'natnump #'booleanp) '(1 nil "a" -4 b c t))
+ ⇒ (1 nil t)
+ (funcall (-orfn #'symbolp (-cut string-match-p "x" <>)) "axe")
+ ⇒ 1
+ (funcall (-orfn #'= #'+) 1 1)
+ ⇒ t
+
+ -- Function: -andfn (&rest preds)
+ Return a predicate that returns non-nil if all PREDS do so. The
+ returned predicate P takes a variable number of arguments and
+ passes them to each predicate in PREDS in turn. If any one of
+ PREDS returns nil, P also returns nil without calling the remaining
+ PREDS. If all PREDS return non-nil, P returns the last such value.
+ If no PREDS are given, P always returns non-nil.
+
+ See also: ‘-orfn’ (*note -orfn::) and ‘-not’ (*note -not::).
+
+ (-filter (-andfn #'numberp (-cut < <> 5)) '(a 1 b 6 c 2))
+ ⇒ (1 2)
+ (mapcar (-andfn #'numberp #'1+) '(a 1 b 6))
+ ⇒ (nil 2 nil 7)
+ (funcall (-andfn #'= #'+) 1 1)
+ ⇒ 2
+
+ -- Function: -iteratefn (fn n)
+ Return a function FN composed N times with itself.
+
+ FN is a unary function. If you need to use a function of higher
+ arity, use ‘-applify’ (*note -applify::) first to turn it into a
+ unary function.
+
+ With n = 0, this acts as identity function.
+
+ In types: (a -> a) -> Int -> a -> a.
+
+ This function satisfies the following law:
+
+ (funcall (-iteratefn fn n) init) = (-last-item (-iterate fn init
+ (1+ n))).
+
+ (funcall (-iteratefn (lambda (x) (* x x)) 3) 2)
+ ⇒ 256
+ (funcall (-iteratefn '1+ 3) 1)
+ ⇒ 4
+ (funcall (-iteratefn 'cdr 3) '(1 2 3 4 5))
+ ⇒ (4 5)
+
+ -- Function: -fixfn (fn &optional equal-test halt-test)
+ Return a function that computes the (least) fixpoint of FN.
+
+ FN must be a unary function. The returned lambda takes a single
+ argument, X, the initial value for the fixpoint iteration. The
+ iteration halts when either of the following conditions is
+ satisfied:
+
+ 1. Iteration converges to the fixpoint, with equality being tested
+ using EQUAL-TEST. If EQUAL-TEST is not specified, ‘equal’ is used.
+ For functions over the floating point numbers, it may be necessary
+ to provide an appropriate approximate comparison test.
+
+ 2. HALT-TEST returns a non-nil value. HALT-TEST defaults to a
+ simple counter that returns t after ‘-fixfn-max-iterations’, to
+ guard against infinite iteration. Otherwise, HALT-TEST must be a
+ function that accepts a single argument, the current value of X,
+ and returns non-nil as long as iteration should continue. In this
+ way, a more sophisticated convergence test may be supplied by the
+ caller.
+
+ The return value of the lambda is either the fixpoint or, if
+ iteration halted before converging, a cons with car ‘halted’ and
+ cdr the final output from HALT-TEST.
+
+ In types: (a -> a) -> a -> a.
+
+ (funcall (-fixfn #'cos #'approx=) 0.7)
+ ⇒ 0.7390851332151607
+ (funcall (-fixfn (lambda (x) (expt (+ x 10) 0.25))) 2.0)
+ ⇒ 1.8555845286409378
+ (funcall (-fixfn #'sin #'approx=) 0.1)
+ ⇒ (halted . t)
+
+ -- Function: -prodfn (&rest fns)
+ Take a list of n functions and return a function that takes a list
+ of length n, applying i-th function to i-th element of the input
+ list. Returns a list of length n.
+
+ In types (for n=2): ((a -> b), (c -> d)) -> (a, c) -> (b, d)
+
+ This function satisfies the following laws:
+
+ (-compose (-prodfn f g ...) (-prodfn f’ g’ ...)) = (-prodfn
+ (-compose f f’) (-compose g g’) ...) (-prodfn f g ...) = (-juxt
+ (-compose f (-partial ’nth 0)) (-compose g (-partial ’nth 1)) ...)
+ (-compose (-prodfn f g ...) (-juxt f’ g’ ...)) = (-juxt (-compose f
+ f’) (-compose g g’) ...) (-compose (-partial ’nth n) (-prod f1 f2
+ ...)) = (-compose fn (-partial ’nth n))
+
+ (funcall (-prodfn '1+ '1- 'number-to-string) '(1 2 3))
+ ⇒ (2 1 "3")
+ (-map (-prodfn '1+ '1-) '((1 2) (3 4) (5 6) (7 8)))
+ ⇒ ((2 1) (4 3) (6 5) (8 7))
+ (apply '+ (funcall (-prodfn 'length 'string-to-number) '((1 2 3) "15")))
+ ⇒ 18
+
+
+File: dash.info, Node: Development, Next: FDL, Prev: Functions, Up: Top
+
+3 Development
+*************
+
+The Dash repository is hosted on GitHub at
+<https://github.com/magnars/dash.el>.
+
+* Menu:
+
+* Contribute:: How to contribute.
+* Contributors:: List of contributors.
+
+
+File: dash.info, Node: Contribute, Next: Contributors, Up: Development
+
+3.1 Contribute
+==============
+
+Yes, please do. Pure functions in the list manipulation realm only,
+please. There’s a suite of examples/tests in ‘dev/examples.el’, so
+remember to add tests for your additions, or they may get broken later.
+
+ Run the tests with ‘make check’. Regenerate the docs with ‘make
+docs’. Contributors are encouraged to install these commands as a Git
+pre-commit hook, so that the tests are always running and the docs are
+always in sync:
+
+ $ cp dev/pre-commit.sh .git/hooks/pre-commit
+
+ Oh, and don’t edit ‘README.md’ or ‘dash.texi’ directly, as they are
+auto-generated. Instead, change their respective templates
+‘readme-template.md’ or ‘dash-template.texi’.
+
+ To ensure that Dash can be distributed with GNU ELPA or Emacs, we
+require that all contributors assign copyright to the Free Software
+Foundation. For more on this, *note (emacs)Copyright Assignment::.
+
+
+File: dash.info, Node: Contributors, Prev: Contribute, Up: Development
+
+3.2 Contributors
+================
+
+ • Matus Goljer (https://github.com/Fuco1) contributed lots of
+ features and functions.
+ • Takafumi Arakaki (https://github.com/tkf) contributed ‘-group-by’.
+ • tali713 (https://github.com/tali713) is the author of ‘-applify’.
+ • Víctor M. Valenzuela (https://github.com/vemv) contributed
+ ‘-repeat’.
+ • Nic Ferrier (https://github.com/nicferrier) contributed ‘-cons*’.
+ • Wilfred Hughes (https://github.com/Wilfred) contributed ‘-slice’,
+ ‘-first-item’, and ‘-last-item’.
+ • Emanuel Evans (https://github.com/shosti) contributed ‘-if-let’,
+ ‘-when-let’, and ‘-insert-at’.
+ • Johan Andersson (https://github.com/rejeep) contributed ‘-sum’,
+ ‘-product’, and ‘-same-items?’.
+ • Christina Whyte (https://github.com/kurisuwhyte) contributed
+ ‘-compose’.
+ • Steve Lamb (https://github.com/steventlamb) contributed ‘-cycle’,
+ ‘-pad’, ‘-annotate’, ‘-zip-fill’, and a variadic version of ‘-zip’.
+ • Fredrik Bergroth (https://github.com/fbergroth) made the ‘-if-let’
+ family use ‘-let’ destructuring and improved the script for
+ generating documentation.
+ • Mark Oteiza (https://github.com/holomorph) contributed ‘-iota’ and
+ the script to create an Info manual.
+ • Vasilij Schneidermann (https://github.com/wasamasa) contributed
+ ‘-some’.
+ • William West (https://github.com/occidens) made ‘-fixfn’ more
+ robust at handling floats.
+ • Cam Saul (https://github.com/camsaul) contributed ‘-some->’,
+ ‘-some->>’, and ‘-some-->’.
+ • Basil L. Contovounesios (https://github.com/basil-conto)
+ contributed ‘-common-prefix’, ‘-common-suffix’, and various other
+ improvements.
+ • Paul Pogonyshev (https://github.com/doublep) contributed ‘-each-r’
+ and ‘-each-r-while’.
+
+ Thanks!
+
+ New contributors are very welcome. *Note Contribute::.
+
+
+File: dash.info, Node: FDL, Next: GPL, Prev: Development, Up: Top
+
+Appendix A GNU Free Documentation License
+*****************************************
+
+ Version 1.3, 3 November 2008
+
+ Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+ <https://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
+ <https://www.gnu.org/licenses/>.
+
+ 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: dash.info, Node: GPL, Next: Index, Prev: FDL, Up: Top
+
+Appendix B GNU General Public License
+*************************************
+
+ Version 3, 29 June 2007
+
+ Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
+
+ Everyone is permitted to copy and distribute verbatim copies of this
+ license document, but changing it is not allowed.
+
+Preamble
+========
+
+The GNU General Public License is a free, copyleft license for software
+and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program—to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers’ and authors’ protection, the GPL clearly explains
+that there is no warranty for this free software. For both users’ and
+authors’ sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users’ freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+TERMS AND CONDITIONS
+====================
+
+ 0. Definitions.
+
+ “This License” refers to version 3 of the GNU General Public
+ License.
+
+ “Copyright” also means copyright-like laws that apply to other
+ kinds of works, such as semiconductor masks.
+
+ “The Program” refers to any copyrightable work licensed under this
+ License. Each licensee is addressed as “you”. “Licensees” and
+ “recipients” may be individuals or organizations.
+
+ To “modify” a work means to copy from or adapt all or part of the
+ work in a fashion requiring copyright permission, other than the
+ making of an exact copy. The resulting work is called a “modified
+ version” of the earlier work or a work “based on” the earlier work.
+
+ A “covered work” means either the unmodified Program or a work
+ based on the Program.
+
+ To “propagate” a work means to do anything with it that, without
+ permission, would make you directly or secondarily liable for
+ infringement under applicable copyright law, except executing it on
+ a computer or modifying a private copy. Propagation includes
+ copying, distribution (with or without modification), making
+ available to the public, and in some countries other activities as
+ well.
+
+ To “convey” a work means any kind of propagation that enables other
+ parties to make or receive copies. Mere interaction with a user
+ through a computer network, with no transfer of a copy, is not
+ conveying.
+
+ An interactive user interface displays “Appropriate Legal Notices”
+ to the extent that it includes a convenient and prominently visible
+ feature that (1) displays an appropriate copyright notice, and (2)
+ tells the user that there is no warranty for the work (except to
+ the extent that warranties are provided), that licensees may convey
+ the work under this License, and how to view a copy of this
+ License. If the interface presents a list of user commands or
+ options, such as a menu, a prominent item in the list meets this
+ criterion.
+
+ 1. Source Code.
+
+ The “source code” for a work means the preferred form of the work
+ for making modifications to it. “Object code” means any non-source
+ form of a work.
+
+ A “Standard Interface” means an interface that either is an
+ official standard defined by a recognized standards body, or, in
+ the case of interfaces specified for a particular programming
+ language, one that is widely used among developers working in that
+ language.
+
+ The “System Libraries” of an executable work include anything,
+ other than the work as a whole, that (a) is included in the normal
+ form of packaging a Major Component, but which is not part of that
+ Major Component, and (b) serves only to enable use of the work with
+ that Major Component, or to implement a Standard Interface for
+ which an implementation is available to the public in source code
+ form. A “Major Component”, in this context, means a major
+ essential component (kernel, window system, and so on) of the
+ specific operating system (if any) on which the executable work
+ runs, or a compiler used to produce the work, or an object code
+ interpreter used to run it.
+
+ The “Corresponding Source” for a work in object code form means all
+ the source code needed to generate, install, and (for an executable
+ work) run the object code and to modify the work, including scripts
+ to control those activities. However, it does not include the
+ work’s System Libraries, or general-purpose tools or generally
+ available free programs which are used unmodified in performing
+ those activities but which are not part of the work. For example,
+ Corresponding Source includes interface definition files associated
+ with source files for the work, and the source code for shared
+ libraries and dynamically linked subprograms that the work is
+ specifically designed to require, such as by intimate data
+ communication or control flow between those subprograms and other
+ parts of the work.
+
+ The Corresponding Source need not include anything that users can
+ regenerate automatically from other parts of the Corresponding
+ Source.
+
+ The Corresponding Source for a work in source code form is that
+ same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+ copyright on the Program, and are irrevocable provided the stated
+ conditions are met. This License explicitly affirms your unlimited
+ permission to run the unmodified Program. The output from running
+ a covered work is covered by this License only if the output, given
+ its content, constitutes a covered work. This License acknowledges
+ your rights of fair use or other equivalent, as provided by
+ copyright law.
+
+ You may make, run and propagate covered works that you do not
+ convey, without conditions so long as your license otherwise
+ remains in force. You may convey covered works to others for the
+ sole purpose of having them make modifications exclusively for you,
+ or provide you with facilities for running those works, provided
+ that you comply with the terms of this License in conveying all
+ material for which you do not control copyright. Those thus making
+ or running the covered works for you must do so exclusively on your
+ behalf, under your direction and control, on terms that prohibit
+ them from making any copies of your copyrighted material outside
+ their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+ the conditions stated below. Sublicensing is not allowed; section
+ 10 makes it unnecessary.
+
+ 3. Protecting Users’ Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+ measure under any applicable law fulfilling obligations under
+ article 11 of the WIPO copyright treaty adopted on 20 December
+ 1996, or similar laws prohibiting or restricting circumvention of
+ such measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+ circumvention of technological measures to the extent such
+ circumvention is effected by exercising rights under this License
+ with respect to the covered work, and you disclaim any intention to
+ limit operation or modification of the work as a means of
+ enforcing, against the work’s users, your or third parties’ legal
+ rights to forbid circumvention of technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program’s source code as you
+ receive it, in any medium, provided that you conspicuously and
+ appropriately publish on each copy an appropriate copyright notice;
+ keep intact all notices stating that this License and any
+ non-permissive terms added in accord with section 7 apply to the
+ code; keep intact all notices of the absence of any warranty; and
+ give all recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+ and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+ produce it from the Program, in the form of source code under the
+ terms of section 4, provided that you also meet all of these
+ conditions:
+
+ a. The work must carry prominent notices stating that you
+ modified it, and giving a relevant date.
+
+ b. The work must carry prominent notices stating that it is
+ released under this License and any conditions added under
+ section 7. This requirement modifies the requirement in
+ section 4 to “keep intact all notices”.
+
+ c. You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable
+ section 7 additional terms, to the whole of the work, and all
+ its parts, regardless of how they are packaged. This License
+ gives no permission to license the work in any other way, but
+ it does not invalidate such permission if you have separately
+ received it.
+
+ d. If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has
+ interactive interfaces that do not display Appropriate Legal
+ Notices, your work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+ works, which are not by their nature extensions of the covered
+ work, and which are not combined with it such as to form a larger
+ program, in or on a volume of a storage or distribution medium, is
+ called an “aggregate” if the compilation and its resulting
+ copyright are not used to limit the access or legal rights of the
+ compilation’s users beyond what the individual works permit.
+ Inclusion of a covered work in an aggregate does not cause this
+ License to apply to the other parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+ of sections 4 and 5, provided that you also convey the
+ machine-readable Corresponding Source under the terms of this
+ License, in one of these ways:
+
+ a. Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b. Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that
+ product model, to give anyone who possesses the object code
+ either (1) a copy of the Corresponding Source for all the
+ software in the product that is covered by this License, on a
+ durable physical medium customarily used for software
+ interchange, for a price no more than your reasonable cost of
+ physically performing this conveying of source, or (2) access
+ to copy the Corresponding Source from a network server at no
+ charge.
+
+ c. Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially,
+ and only if you received the object code with such an offer,
+ in accord with subsection 6b.
+
+ d. Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to
+ the Corresponding Source in the same way through the same
+ place at no further charge. You need not require recipients
+ to copy the Corresponding Source along with the object code.
+ If the place to copy the object code is a network server, the
+ Corresponding Source may be on a different server (operated by
+ you or a third party) that supports equivalent copying
+ facilities, provided you maintain clear directions next to the
+ object code saying where to find the Corresponding Source.
+ Regardless of what server hosts the Corresponding Source, you
+ remain obligated to ensure that it is available for as long as
+ needed to satisfy these requirements.
+
+ e. Convey the object code using peer-to-peer transmission,
+ provided you inform other peers where the object code and
+ Corresponding Source of the work are being offered to the
+ general public at no charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is
+ excluded from the Corresponding Source as a System Library, need
+ not be included in conveying the object code work.
+
+ A “User Product” is either (1) a “consumer product”, which means
+ any tangible personal property which is normally used for personal,
+ family, or household purposes, or (2) anything designed or sold for
+ incorporation into a dwelling. In determining whether a product is
+ a consumer product, doubtful cases shall be resolved in favor of
+ coverage. For a particular product received by a particular user,
+ “normally used” refers to a typical or common use of that class of
+ product, regardless of the status of the particular user or of the
+ way in which the particular user actually uses, or expects or is
+ expected to use, the product. A product is a consumer product
+ regardless of whether the product has substantial commercial,
+ industrial or non-consumer uses, unless such uses represent the
+ only significant mode of use of the product.
+
+ “Installation Information” for a User Product means any methods,
+ procedures, authorization keys, or other information required to
+ install and execute modified versions of a covered work in that
+ User Product from a modified version of its Corresponding Source.
+ The information must suffice to ensure that the continued
+ functioning of the modified object code is in no case prevented or
+ interfered with solely because modification has been made.
+
+ If you convey an object code work under this section in, or with,
+ or specifically for use in, a User Product, and the conveying
+ occurs as part of a transaction in which the right of possession
+ and use of the User Product is transferred to the recipient in
+ perpetuity or for a fixed term (regardless of how the transaction
+ is characterized), the Corresponding Source conveyed under this
+ section must be accompanied by the Installation Information. But
+ this requirement does not apply if neither you nor any third party
+ retains the ability to install modified object code on the User
+ Product (for example, the work has been installed in ROM).
+
+ The requirement to provide Installation Information does not
+ include a requirement to continue to provide support service,
+ warranty, or updates for a work that has been modified or installed
+ by the recipient, or for the User Product in which it has been
+ modified or installed. Access to a network may be denied when the
+ modification itself materially and adversely affects the operation
+ of the network or violates the rules and protocols for
+ communication across the network.
+
+ Corresponding Source conveyed, and Installation Information
+ provided, in accord with this section must be in a format that is
+ publicly documented (and with an implementation available to the
+ public in source code form), and must require no special password
+ or key for unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ “Additional permissions” are terms that supplement the terms of
+ this License by making exceptions from one or more of its
+ conditions. Additional permissions that are applicable to the
+ entire Program shall be treated as though they were included in
+ this License, to the extent that they are valid under applicable
+ law. If additional permissions apply only to part of the Program,
+ that part may be used separately under those permissions, but the
+ entire Program remains governed by this License without regard to
+ the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+ remove any additional permissions from that copy, or from any part
+ of it. (Additional permissions may be written to require their own
+ removal in certain cases when you modify the work.) You may place
+ additional permissions on material, added by you to a covered work,
+ for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material
+ you add to a covered work, you may (if authorized by the copyright
+ holders of that material) supplement the terms of this License with
+ terms:
+
+ a. Disclaiming warranty or limiting liability differently from
+ the terms of sections 15 and 16 of this License; or
+
+ b. Requiring preservation of specified reasonable legal notices
+ or author attributions in that material or in the Appropriate
+ Legal Notices displayed by works containing it; or
+
+ c. Prohibiting misrepresentation of the origin of that material,
+ or requiring that modified versions of such material be marked
+ in reasonable ways as different from the original version; or
+
+ d. Limiting the use for publicity purposes of names of licensors
+ or authors of the material; or
+
+ e. Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f. Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified
+ versions of it) with contractual assumptions of liability to
+ the recipient, for any liability that these contractual
+ assumptions directly impose on those licensors and authors.
+
+ All other non-permissive additional terms are considered “further
+ restrictions” within the meaning of section 10. If the Program as
+ you received it, or any part of it, contains a notice stating that
+ it is governed by this License along with a term that is a further
+ restriction, you may remove that term. If a license document
+ contains a further restriction but permits relicensing or conveying
+ under this License, you may add to a covered work material governed
+ by the terms of that license document, provided that the further
+ restriction does not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+ must place, in the relevant source files, a statement of the
+ additional terms that apply to those files, or a notice indicating
+ where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in
+ the form of a separately written license, or stated as exceptions;
+ the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+ provided under this License. Any attempt otherwise to propagate or
+ modify it is void, and will automatically terminate your rights
+ under this License (including any patent licenses granted under the
+ third paragraph of section 11).
+
+ 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, you do not qualify to receive new licenses
+ for the same material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+ run a copy of the Program. Ancillary propagation of a covered work
+ occurring solely as a consequence of using peer-to-peer
+ transmission to receive a copy likewise does not require
+ acceptance. However, nothing other than this License grants you
+ permission to propagate or modify any covered work. These actions
+ infringe copyright if you do not accept this License. Therefore,
+ by modifying or propagating a covered work, you indicate your
+ acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+ receives a license from the original licensors, to run, modify and
+ propagate that work, subject to this License. You are not
+ responsible for enforcing compliance by third parties with this
+ License.
+
+ An “entity transaction” is a transaction transferring control of an
+ organization, or substantially all assets of one, or subdividing an
+ organization, or merging organizations. If propagation of a
+ covered work results from an entity transaction, each party to that
+ transaction who receives a copy of the work also receives whatever
+ licenses to the work the party’s predecessor in interest had or
+ could give under the previous paragraph, plus a right to possession
+ of the Corresponding Source of the work from the predecessor in
+ interest, if the predecessor has it or can get it with reasonable
+ efforts.
+
+ You may not impose any further restrictions on the exercise of the
+ rights granted or affirmed under this License. For example, you
+ may not impose a license fee, royalty, or other charge for exercise
+ of rights granted under this License, and you may not initiate
+ litigation (including a cross-claim or counterclaim in a lawsuit)
+ alleging that any patent claim is infringed by making, using,
+ selling, offering for sale, or importing the Program or any portion
+ of it.
+
+ 11. Patents.
+
+ A “contributor” is a copyright holder who authorizes use under this
+ License of the Program or a work on which the Program is based.
+ The work thus licensed is called the contributor’s “contributor
+ version”.
+
+ A contributor’s “essential patent claims” are all patent claims
+ owned or controlled by the contributor, whether already acquired or
+ hereafter acquired, that would be infringed by some manner,
+ permitted by this License, of making, using, or selling its
+ contributor version, but do not include claims that would be
+ infringed only as a consequence of further modification of the
+ contributor version. For purposes of this definition, “control”
+ includes the right to grant patent sublicenses in a manner
+ consistent with the requirements of this License.
+
+ Each contributor grants you a non-exclusive, worldwide,
+ royalty-free patent license under the contributor’s essential
+ patent claims, to make, use, sell, offer for sale, import and
+ otherwise run, modify and propagate the contents of its contributor
+ version.
+
+ In the following three paragraphs, a “patent license” is any
+ express agreement or commitment, however denominated, not to
+ enforce a patent (such as an express permission to practice a
+ patent or covenant not to sue for patent infringement). To “grant”
+ such a patent license to a party means to make such an agreement or
+ commitment not to enforce a patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent
+ license, and the Corresponding Source of the work is not available
+ for anyone to copy, free of charge and under the terms of this
+ License, through a publicly available network server or other
+ readily accessible means, then you must either (1) cause the
+ Corresponding Source to be so available, or (2) arrange to deprive
+ yourself of the benefit of the patent license for this particular
+ work, or (3) arrange, in a manner consistent with the requirements
+ of this License, to extend the patent license to downstream
+ recipients. “Knowingly relying” means you have actual knowledge
+ that, but for the patent license, your conveying the covered work
+ in a country, or your recipient’s use of the covered work in a
+ country, would infringe one or more identifiable patents in that
+ country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+ arrangement, you convey, or propagate by procuring conveyance of, a
+ covered work, and grant a patent license to some of the parties
+ receiving the covered work authorizing them to use, propagate,
+ modify or convey a specific copy of the covered work, then the
+ patent license you grant is automatically extended to all
+ recipients of the covered work and works based on it.
+
+ A patent license is “discriminatory” if it does not include within
+ the scope of its coverage, prohibits the exercise of, or is
+ conditioned on the non-exercise of one or more of the rights that
+ are specifically granted under this License. You may not convey a
+ covered work if you are a party to an arrangement with a third
+ party that is in the business of distributing software, under which
+ you make payment to the third party based on the extent of your
+ activity of conveying the work, and under which the third party
+ grants, to any of the parties who would receive the covered work
+ from you, a discriminatory patent license (a) in connection with
+ copies of the covered work conveyed by you (or copies made from
+ those copies), or (b) primarily for and in connection with specific
+ products or compilations that contain the covered work, unless you
+ entered into that arrangement, or that patent license was granted,
+ prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+ any implied license or other defenses to infringement that may
+ otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others’ Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement
+ or otherwise) that contradict the conditions of this License, they
+ do not excuse you from the conditions of this License. If you
+ cannot convey a covered work so as to satisfy simultaneously your
+ obligations under this License and any other pertinent obligations,
+ then as a consequence you may not convey it at all. For example,
+ if you agree to terms that obligate you to collect a royalty for
+ further conveying from those to whom you convey the Program, the
+ only way you could satisfy both those terms and this License would
+ be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+ permission to link or combine any covered work with a work licensed
+ under version 3 of the GNU Affero General Public License into a
+ single combined work, and to convey the resulting work. The terms
+ of this License will continue to apply to the part which is the
+ covered work, but the special requirements of the GNU Affero
+ General Public License, section 13, concerning interaction through
+ a network will apply to the combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new
+ versions of the GNU General Public 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.
+
+ Each version is given a distinguishing version number. If the
+ Program specifies that a certain numbered version of the GNU
+ General Public License “or any later version” applies to it, you
+ have the option of following the terms and conditions either of
+ that numbered version or of any later version published by the Free
+ Software Foundation. If the Program does not specify a version
+ number of the GNU General Public License, you may choose any
+ version ever published by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+ versions of the GNU General Public License can be used, that
+ proxy’s public statement of acceptance of a version permanently
+ authorizes you to choose that version for the Program.
+
+ Later license versions may give you additional or different
+ permissions. However, no additional obligations are imposed on any
+ author or copyright holder as a result of your choosing to follow a
+ later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
+ COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS”
+ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
+ RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
+ SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+ NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+ WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES
+ AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
+ DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+ CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
+ THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
+ BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
+ THE POSSIBILITY OF SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+ above cannot be given local legal effect according to their terms,
+ reviewing courts shall apply local law that most closely
+ approximates an absolute waiver of all civil liability in
+ connection with the Program, unless a warranty or assumption of
+ liability accompanies a copy of the Program in return for a fee.
+
+END OF TERMS AND CONDITIONS
+===========================
+
+How to Apply These Terms to Your New Programs
+=============================================
+
+If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least the
+“copyright” line and a pointer to where the full notice is found.
+
+ ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
+ Copyright (C) YEAR NAME OF AUTHOR
+
+ This program 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.
+
+ This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+
+ Also add information on how to contact you by electronic and paper
+mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ PROGRAM Copyright (C) YEAR NAME OF AUTHOR
+ This program comes with ABSOLUTELY NO WARRANTY; for details type ‘show w’.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type ‘show c’ for details.
+
+ The hypothetical commands ‘show w’ and ‘show c’ should show the
+appropriate parts of the General Public License. Of course, your
+program’s commands might be different; for a GUI interface, you would
+use an “about box”.
+
+ You should also get your employer (if you work as a programmer) or
+school, if any, to sign a “copyright disclaimer” for the program, if
+necessary. For more information on this, and how to apply and follow
+the GNU GPL, see <https://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your
+program into proprietary programs. If your program is a subroutine
+library, you may consider it more useful to permit linking proprietary
+applications with the library. If this is what you want to do, use the
+GNU Lesser General Public License instead of this License. But first,
+please read <https://www.gnu.org/licenses/why-not-lgpl.html>.
+
+
+File: dash.info, Node: Index, Prev: GPL, Up: Top
+
+Index
+*****
+
+
+* Menu:
+
+* !cdr: Destructive operations.
+ (line 16)
+* !cons: Destructive operations.
+ (line 8)
+* -->: Threading macros. (line 35)
+* ->: Threading macros. (line 9)
+* ->>: Threading macros. (line 22)
+* -all?: Predicates. (line 53)
+* -andfn: Function combinators.
+ (line 184)
+* -annotate: Maps. (line 84)
+* -any?: Predicates. (line 41)
+* -applify: Function combinators.
+ (line 63)
+* -as->: Threading macros. (line 49)
+* -butlast: Other list operations.
+ (line 335)
+* -clone: Tree operations. (line 122)
+* -common-prefix: Reductions. (line 242)
+* -common-suffix: Reductions. (line 252)
+* -compose: Function combinators.
+ (line 49)
+* -concat: List to list. (line 23)
+* -cons*: Other list operations.
+ (line 30)
+* -cons-pair?: Predicates. (line 167)
+* -const: Function combinators.
+ (line 128)
+* -contains?: Predicates. (line 100)
+* -copy: Maps. (line 139)
+* -count: Reductions. (line 172)
+* -cut: Function combinators.
+ (line 140)
+* -cycle: Other list operations.
+ (line 180)
+* -difference: Set operations. (line 20)
+* -distinct: Set operations. (line 62)
+* -dotimes: Side effects. (line 80)
+* -doto: Threading macros. (line 99)
+* -drop: Sublist selection. (line 147)
+* -drop-last: Sublist selection. (line 161)
+* -drop-while: Sublist selection. (line 192)
+* -each: Side effects. (line 8)
+* -each-indexed: Side effects. (line 38)
+* -each-r: Side effects. (line 52)
+* -each-r-while: Side effects. (line 65)
+* -each-while: Side effects. (line 24)
+* -elem-index: Indexing. (line 9)
+* -elem-indices: Indexing. (line 21)
+* -every: Predicates. (line 23)
+* -fifth-item: Other list operations.
+ (line 315)
+* -filter: Sublist selection. (line 8)
+* -find-index: Indexing. (line 32)
+* -find-indices: Indexing. (line 60)
+* -find-last-index: Indexing. (line 46)
+* -first: Other list operations.
+ (line 246)
+* -first-item: Other list operations.
+ (line 272)
+* -fix: Other list operations.
+ (line 375)
+* -fixfn: Function combinators.
+ (line 224)
+* -flatten: List to list. (line 34)
+* -flatten-n: List to list. (line 56)
+* -flip: Function combinators.
+ (line 95)
+* -fourth-item: Other list operations.
+ (line 305)
+* -grade-down: Indexing. (line 81)
+* -grade-up: Indexing. (line 71)
+* -group-by: Partitioning. (line 194)
+* -if-let: Binding. (line 34)
+* -if-let*: Binding. (line 45)
+* -inits: Reductions. (line 222)
+* -insert-at: List to list. (line 110)
+* -interleave: Other list operations.
+ (line 67)
+* -interpose: Other list operations.
+ (line 57)
+* -intersection: Set operations. (line 32)
+* -iota: Other list operations.
+ (line 78)
+* -is-infix?: Predicates. (line 153)
+* -is-prefix?: Predicates. (line 129)
+* -is-suffix?: Predicates. (line 141)
+* -iterate: Unfolding. (line 9)
+* -iteratefn: Function combinators.
+ (line 201)
+* -juxt: Function combinators.
+ (line 37)
+* -keep: List to list. (line 8)
+* -lambda: Binding. (line 247)
+* -last: Other list operations.
+ (line 262)
+* -last-item: Other list operations.
+ (line 325)
+* -let: Binding. (line 61)
+* -let*: Binding. (line 227)
+* -list: Other list operations.
+ (line 358)
+* -map: Maps. (line 10)
+* -map-first: Maps. (line 38)
+* -map-indexed: Maps. (line 66)
+* -map-last: Maps. (line 52)
+* -map-when: Maps. (line 22)
+* -mapcat: Maps. (line 128)
+* -max: Reductions. (line 286)
+* -max-by: Reductions. (line 296)
+* -min: Reductions. (line 262)
+* -min-by: Reductions. (line 272)
+* -non-nil: Sublist selection. (line 94)
+* -none?: Predicates. (line 73)
+* -not: Function combinators.
+ (line 153)
+* -on: Function combinators.
+ (line 75)
+* -only-some?: Predicates. (line 85)
+* -orfn: Function combinators.
+ (line 167)
+* -pad: Other list operations.
+ (line 191)
+* -partial: Function combinators.
+ (line 8)
+* -partition: Partitioning. (line 80)
+* -partition-after-item: Partitioning. (line 184)
+* -partition-after-pred: Partitioning. (line 151)
+* -partition-all: Partitioning. (line 92)
+* -partition-all-in-steps: Partitioning. (line 115)
+* -partition-before-item: Partitioning. (line 174)
+* -partition-before-pred: Partitioning. (line 163)
+* -partition-by: Partitioning. (line 127)
+* -partition-by-header: Partitioning. (line 138)
+* -partition-in-steps: Partitioning. (line 103)
+* -permutations: Set operations. (line 52)
+* -powerset: Set operations. (line 44)
+* -prodfn: Function combinators.
+ (line 258)
+* -product: Reductions. (line 201)
+* -reduce: Reductions. (line 53)
+* -reduce-from: Reductions. (line 8)
+* -reduce-r: Reductions. (line 72)
+* -reduce-r-from: Reductions. (line 26)
+* -reductions: Reductions. (line 136)
+* -reductions-from: Reductions. (line 100)
+* -reductions-r: Reductions. (line 154)
+* -reductions-r-from: Reductions. (line 118)
+* -remove: Sublist selection. (line 26)
+* -remove-at: List to list. (line 146)
+* -remove-at-indices: List to list. (line 159)
+* -remove-first: Sublist selection. (line 43)
+* -remove-item: Sublist selection. (line 83)
+* -remove-last: Sublist selection. (line 64)
+* -repeat: Other list operations.
+ (line 19)
+* -replace: List to list. (line 68)
+* -replace-at: List to list. (line 121)
+* -replace-first: List to list. (line 82)
+* -replace-last: List to list. (line 96)
+* -rotate: Other list operations.
+ (line 8)
+* -rotate-args: Function combinators.
+ (line 112)
+* -rpartial: Function combinators.
+ (line 22)
+* -running-product: Reductions. (line 211)
+* -running-sum: Reductions. (line 190)
+* -same-items?: Predicates. (line 115)
+* -second-item: Other list operations.
+ (line 285)
+* -select-by-indices: Sublist selection. (line 208)
+* -select-column: Sublist selection. (line 238)
+* -select-columns: Sublist selection. (line 219)
+* -separate: Partitioning. (line 69)
+* -setq: Binding. (line 270)
+* -slice: Sublist selection. (line 104)
+* -snoc: Other list operations.
+ (line 43)
+* -some: Predicates. (line 8)
+* -some-->: Threading macros. (line 86)
+* -some->: Threading macros. (line 62)
+* -some->>: Threading macros. (line 74)
+* -sort: Other list operations.
+ (line 345)
+* -splice: Maps. (line 95)
+* -splice-list: Maps. (line 115)
+* -split-at: Partitioning. (line 8)
+* -split-on: Partitioning. (line 34)
+* -split-when: Partitioning. (line 52)
+* -split-with: Partitioning. (line 23)
+* -sum: Reductions. (line 180)
+* -table: Other list operations.
+ (line 202)
+* -table-flat: Other list operations.
+ (line 221)
+* -tails: Reductions. (line 232)
+* -take: Sublist selection. (line 120)
+* -take-last: Sublist selection. (line 133)
+* -take-while: Sublist selection. (line 175)
+* -third-item: Other list operations.
+ (line 295)
+* -tree-map: Tree operations. (line 28)
+* -tree-map-nodes: Tree operations. (line 39)
+* -tree-mapreduce: Tree operations. (line 84)
+* -tree-mapreduce-from: Tree operations. (line 103)
+* -tree-reduce: Tree operations. (line 52)
+* -tree-reduce-from: Tree operations. (line 69)
+* -tree-seq: Tree operations. (line 8)
+* -unfold: Unfolding. (line 25)
+* -union: Set operations. (line 8)
+* -unzip: Other list operations.
+ (line 158)
+* -update-at: List to list. (line 133)
+* -when-let: Binding. (line 9)
+* -when-let*: Binding. (line 21)
+* -zip: Other list operations.
+ (line 107)
+* -zip-fill: Other list operations.
+ (line 150)
+* -zip-lists: Other list operations.
+ (line 131)
+* -zip-with: Other list operations.
+ (line 91)
+* dash-fontify-mode: Fontification of special variables.
+ (line 6)
+* dash-register-info-lookup: Info symbol lookup. (line 6)
+* global-dash-fontify-mode: Fontification of special variables.
+ (line 12)
+
+
+
+Tag Table:
+Node: Top742
+Node: Installation2397
+Node: Using in a package3159
+Node: Fontification of special variables3504
+Node: Info symbol lookup4294
+Node: Functions4877
+Node: Maps6361
+Ref: -map6658
+Ref: -map-when7031
+Ref: -map-first7606
+Ref: -map-last8081
+Ref: -map-indexed8551
+Ref: -annotate9237
+Ref: -splice9724
+Ref: -splice-list10502
+Ref: -mapcat10961
+Ref: -copy11334
+Node: Sublist selection11522
+Ref: -filter11715
+Ref: -remove12262
+Ref: -remove-first12800
+Ref: -remove-last13642
+Ref: -remove-item14367
+Ref: -non-nil14767
+Ref: -slice15043
+Ref: -take15572
+Ref: -take-last15979
+Ref: -drop16410
+Ref: -drop-last16851
+Ref: -take-while17277
+Ref: -drop-while17892
+Ref: -select-by-indices18508
+Ref: -select-columns19019
+Ref: -select-column19722
+Node: List to list20185
+Ref: -keep20377
+Ref: -concat20941
+Ref: -flatten21235
+Ref: -flatten-n21991
+Ref: -replace22375
+Ref: -replace-first22836
+Ref: -replace-last23331
+Ref: -insert-at23819
+Ref: -replace-at24144
+Ref: -update-at24531
+Ref: -remove-at25019
+Ref: -remove-at-indices25504
+Node: Reductions26083
+Ref: -reduce-from26279
+Ref: -reduce-r-from27003
+Ref: -reduce28266
+Ref: -reduce-r29017
+Ref: -reductions-from30295
+Ref: -reductions-r-from31101
+Ref: -reductions31931
+Ref: -reductions-r32642
+Ref: -count33387
+Ref: -sum33611
+Ref: -running-sum33799
+Ref: -product34120
+Ref: -running-product34328
+Ref: -inits34669
+Ref: -tails34914
+Ref: -common-prefix35158
+Ref: -common-suffix35452
+Ref: -min35746
+Ref: -min-by35972
+Ref: -max36493
+Ref: -max-by36718
+Node: Unfolding37244
+Ref: -iterate37485
+Ref: -unfold37932
+Node: Predicates38737
+Ref: -some38914
+Ref: -every39331
+Ref: -any?40010
+Ref: -all?40341
+Ref: -none?41048
+Ref: -only-some?41350
+Ref: -contains?41835
+Ref: -same-items?42224
+Ref: -is-prefix?42609
+Ref: -is-suffix?42935
+Ref: -is-infix?43261
+Ref: -cons-pair?43615
+Node: Partitioning43940
+Ref: -split-at44128
+Ref: -split-with44792
+Ref: -split-on45192
+Ref: -split-when45863
+Ref: -separate46500
+Ref: -partition46939
+Ref: -partition-all47388
+Ref: -partition-in-steps47813
+Ref: -partition-all-in-steps48307
+Ref: -partition-by48789
+Ref: -partition-by-header49167
+Ref: -partition-after-pred49768
+Ref: -partition-before-pred50215
+Ref: -partition-before-item50600
+Ref: -partition-after-item50907
+Ref: -group-by51209
+Node: Indexing51642
+Ref: -elem-index51844
+Ref: -elem-indices52239
+Ref: -find-index52619
+Ref: -find-last-index53108
+Ref: -find-indices53612
+Ref: -grade-up54017
+Ref: -grade-down54424
+Node: Set operations54838
+Ref: -union55021
+Ref: -difference55459
+Ref: -intersection55871
+Ref: -powerset56303
+Ref: -permutations56513
+Ref: -distinct56809
+Node: Other list operations57183
+Ref: -rotate57408
+Ref: -repeat57761
+Ref: -cons*58040
+Ref: -snoc58456
+Ref: -interpose58866
+Ref: -interleave59160
+Ref: -iota59526
+Ref: -zip-with60009
+Ref: -zip60723
+Ref: -zip-lists61552
+Ref: -zip-fill62250
+Ref: -unzip62572
+Ref: -cycle63314
+Ref: -pad63713
+Ref: -table64032
+Ref: -table-flat64818
+Ref: -first65823
+Ref: -last66309
+Ref: -first-item66643
+Ref: -second-item67042
+Ref: -third-item67306
+Ref: -fourth-item67568
+Ref: -fifth-item67834
+Ref: -last-item68096
+Ref: -butlast68387
+Ref: -sort68632
+Ref: -list69118
+Ref: -fix69687
+Node: Tree operations70176
+Ref: -tree-seq70372
+Ref: -tree-map71227
+Ref: -tree-map-nodes71667
+Ref: -tree-reduce72514
+Ref: -tree-reduce-from73396
+Ref: -tree-mapreduce73996
+Ref: -tree-mapreduce-from74855
+Ref: -clone76140
+Node: Threading macros76467
+Ref: ->76692
+Ref: ->>77180
+Ref: -->77683
+Ref: -as->78239
+Ref: -some->78693
+Ref: -some->>79066
+Ref: -some-->79501
+Ref: -doto80050
+Node: Binding80603
+Ref: -when-let80810
+Ref: -when-let*81265
+Ref: -if-let81788
+Ref: -if-let*82148
+Ref: -let82765
+Ref: -let*88837
+Ref: -lambda89774
+Ref: -setq90580
+Node: Side effects91381
+Ref: -each91575
+Ref: -each-while92096
+Ref: -each-indexed92698
+Ref: -each-r93284
+Ref: -each-r-while93720
+Ref: -dotimes94346
+Node: Destructive operations94899
+Ref: !cons95117
+Ref: !cdr95321
+Node: Function combinators95514
+Ref: -partial95718
+Ref: -rpartial96236
+Ref: -juxt96884
+Ref: -compose97336
+Ref: -applify97943
+Ref: -on98373
+Ref: -flip99145
+Ref: -rotate-args99669
+Ref: -const100298
+Ref: -cut100640
+Ref: -not101120
+Ref: -orfn101646
+Ref: -andfn102408
+Ref: -iteratefn103164
+Ref: -fixfn103866
+Ref: -prodfn105422
+Node: Development106480
+Node: Contribute106769
+Node: Contributors107781
+Node: FDL109874
+Node: GPL135194
+Node: Index172943
+
+End Tag Table
+
+
+Local Variables:
+coding: utf-8
+End:
diff --git a/elpa/dash-20210826.1149/dir b/elpa/dash-20210826.1149/dir
new file mode 100644
index 0000000..7d473f4
--- /dev/null
+++ b/elpa/dash-20210826.1149/dir
@@ -0,0 +1,18 @@
+This is the file .../info/dir, which contains the
+topmost node of the Info hierarchy, called (dir)Top.
+The first time you invoke Info you start off looking at this node.
+
+File: dir, Node: Top This is the top of the INFO tree
+
+ This (the Directory node) gives a menu of major topics.
+ Typing "q" exits, "H" lists all Info commands, "d" returns here,
+ "h" gives a primer for first-timers,
+ "mEmacs<Return>" visits the Emacs manual, etc.
+
+ In Emacs, you can click mouse button 2 on a menu item or cross reference
+ to select it.
+
+* Menu:
+
+Emacs
+* Dash: (dash.info). A modern list library for GNU Emacs.
diff --git a/elpa/epl-20180205.2049/epl-autoloads.el b/elpa/epl-20180205.2049/epl-autoloads.el
new file mode 100644
index 0000000..c6221c5
--- /dev/null
+++ b/elpa/epl-20180205.2049/epl-autoloads.el
@@ -0,0 +1,22 @@
+;;; epl-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "epl" "epl.el" (0 0 0 0))
+;;; Generated autoloads from epl.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "epl" '("epl-")))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; epl-autoloads.el ends here
diff --git a/elpa/epl-20180205.2049/epl-pkg.el b/elpa/epl-20180205.2049/epl-pkg.el
new file mode 100644
index 0000000..7ef07f3
--- /dev/null
+++ b/elpa/epl-20180205.2049/epl-pkg.el
@@ -0,0 +1,2 @@
+;;; Generated package description from epl.el -*- no-byte-compile: t -*-
+(define-package "epl" "20180205.2049" "Emacs Package Library" '((cl-lib "0.3")) :commit "78ab7a85c08222cd15582a298a364774e3282ce6" :authors '(("Sebastian Wiesner" . "swiesner@lunaryorn.com")) :maintainer '("Johan Andersson" . "johan.rejeep@gmail.com") :keywords '("convenience") :url "http://github.com/cask/epl")
diff --git a/elpa/epl-20180205.2049/epl.el b/elpa/epl-20180205.2049/epl.el
new file mode 100644
index 0000000..a660ba8
--- /dev/null
+++ b/elpa/epl-20180205.2049/epl.el
@@ -0,0 +1,712 @@
+;;; epl.el --- Emacs Package Library -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2013-2015 Sebastian Wiesner
+;; Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2015 Free Software
+
+;; Author: Sebastian Wiesner <swiesner@lunaryorn.com>
+;; Maintainer: Johan Andersson <johan.rejeep@gmail.com>
+;; Sebastian Wiesner <swiesner@lunaryorn.com>
+;; Version: 0.10-cvs
+;; Package-Version: 20180205.2049
+;; Package-Commit: 78ab7a85c08222cd15582a298a364774e3282ce6
+;; Package-Requires: ((cl-lib "0.3"))
+;; Keywords: convenience
+;; URL: http://github.com/cask/epl
+
+;; This file is NOT part of GNU Emacs.
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; A package management library for Emacs, based on package.el.
+
+;; The purpose of this library is to wrap all the quirks and hassle of
+;; package.el into a sane API.
+
+;; The following functions comprise the public interface of this library:
+
+;;; Package directory selection
+
+;; `epl-package-dir' gets the directory of packages.
+
+;; `epl-default-package-dir' gets the default package directory.
+
+;; `epl-change-package-dir' changes the directory of packages.
+
+;;; Package system management
+
+;; `epl-initialize' initializes the package system and activates all
+;; packages.
+
+;; `epl-reset' resets the package system.
+
+;; `epl-refresh' refreshes all package archives.
+
+;; `epl-add-archive' adds a new package archive.
+
+;;; Package objects
+
+;; Struct `epl-requirement' describes a requirement of a package with `name' and
+;; `version' slots.
+
+;; `epl-requirement-version-string' gets a requirement version as string.
+
+;; Struct `epl-package' describes an installed or installable package with a
+;; `name' and some internal `description'.
+
+;; `epl-package-version' gets the version of a package.
+
+;; `epl-package-version-string' gets the version of a package as string.
+
+;; `epl-package-summary' gets the summary of a package.
+
+;; `epl-package-requirements' gets the requirements of a package.
+
+;; `epl-package-directory' gets the installation directory of a package.
+
+;; `epl-package-from-buffer' creates a package object for the package contained
+;; in the current buffer.
+
+;; `epl-package-from-file' creates a package object for a package file, either
+;; plain lisp or tarball.
+
+;; `epl-package-from-descriptor-file' creates a package object for a package
+;; description (i.e. *-pkg.el) file.
+
+;;; Package database access
+
+;; `epl-package-installed-p' determines whether a package is installed, either
+;; built-in or explicitly installed.
+
+;; `epl-package-outdated-p' determines whether a package is outdated, that is,
+;; whether a package with a higher version number is available.
+
+;; `epl-built-in-packages', `epl-installed-packages', `epl-outdated-packages'
+;; and `epl-available-packages' get all packages built-in, installed, outdated,
+;; or available for installation respectively.
+
+;; `epl-find-built-in-package', `epl-find-installed-packages' and
+;; `epl-find-available-packages' find built-in, installed and available packages
+;; by name.
+
+;; `epl-find-upgrades' finds all upgradable packages.
+
+;; `epl-built-in-p' return true if package is built-in to Emacs.
+
+;;; Package operations
+
+;; `epl-install-file' installs a package file.
+
+;; `epl-package-install' installs a package.
+
+;; `epl-package-delete' deletes a package.
+
+;; `epl-upgrade' upgrades packages.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'package)
+
+
+(unless (fboundp #'define-error)
+ ;; `define-error' for 24.3 and earlier, copied from subr.el
+ (defun define-error (name message &optional parent)
+ "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'.
+PARENT is either a signal or a list of signals from which it inherits.
+Defaults to `error'."
+ (unless parent (setq parent 'error))
+ (let ((conditions
+ (if (consp parent)
+ (apply #'append
+ (mapcar (lambda (parent)
+ (cons parent
+ (or (get parent 'error-conditions)
+ (error "Unknown signal `%s'" parent))))
+ parent))
+ (cons parent (get parent 'error-conditions)))))
+ (put name 'error-conditions
+ (delete-dups (copy-sequence (cons name conditions))))
+ (when message (put name 'error-message message)))))
+
+(defsubst epl--package-desc-p (package)
+ "Whether PACKAGE is a `package-desc' object.
+
+Like `package-desc-p', but return nil, if `package-desc-p' is not
+defined as function."
+ (and (fboundp 'package-desc-p) (package-desc-p package)))
+
+
+;;; EPL errors
+(define-error 'epl-error "EPL error")
+
+(define-error 'epl-invalid-package "Invalid EPL package" 'epl-error)
+
+(define-error 'epl-invalid-package-file "Invalid EPL package file"
+ 'epl-invalid-package)
+
+
+;;; Package directory
+(defun epl-package-dir ()
+ "Get the directory of packages."
+ package-user-dir)
+
+(defun epl-default-package-dir ()
+ "Get the default directory of packages."
+ (eval (car (get 'package-user-dir 'standard-value))))
+
+(defun epl-change-package-dir (directory)
+ "Change the directory of packages to DIRECTORY."
+ (setq package-user-dir directory)
+ (epl-initialize))
+
+
+;;; Package system management
+(defvar epl--load-path-before-initialize nil
+ "Remember the load path for `epl-reset'.")
+
+(defun epl-initialize (&optional no-activate)
+ "Load Emacs Lisp packages and activate them.
+
+With NO-ACTIVATE non-nil, do not activate packages."
+ (setq epl--load-path-before-initialize load-path)
+ (package-initialize no-activate))
+
+(defalias 'epl-refresh 'package-refresh-contents)
+
+(defun epl-add-archive (name url)
+ "Add a package archive with NAME and URL."
+ (add-to-list 'package-archives (cons name url)))
+
+(defun epl-reset ()
+ "Reset the package system.
+
+Clear the list of installed and available packages, the list of
+package archives and reset the package directory."
+ (setq package-alist nil
+ package-archives nil
+ package-archive-contents nil
+ load-path epl--load-path-before-initialize)
+ (when (boundp 'package-obsolete-alist) ; Legacy package.el
+ (setq package-obsolete-alist nil))
+ (epl-change-package-dir (epl-default-package-dir)))
+
+
+;;; Package structures
+(cl-defstruct (epl-requirement
+ (:constructor epl-requirement-create))
+ "Structure describing a requirement.
+
+Slots:
+
+`name' The name of the required package, as symbol.
+
+`version' The version of the required package, as version list."
+ name
+ version)
+
+(defun epl-requirement-version-string (requirement)
+ "The version of a REQUIREMENT, as string."
+ (package-version-join (epl-requirement-version requirement)))
+
+(cl-defstruct (epl-package (:constructor epl-package-create))
+ "Structure representing a package.
+
+Slots:
+
+`name' The package name, as symbol.
+
+`description' The package description.
+
+The format package description varies between package.el
+variants. For `package-desc' variants, it is simply the
+corresponding `package-desc' object. For legacy variants, it is
+a vector `[VERSION REQS DOCSTRING]'.
+
+Do not access `description' directly, but instead use the
+`epl-package' accessors."
+ name
+ description)
+
+(defmacro epl-package-as-description (var &rest body)
+ "Cast VAR to a package description in BODY.
+
+VAR is a symbol, bound to an `epl-package' object. This macro
+casts this object to the `description' object, and binds the
+description to VAR in BODY."
+ (declare (indent 1))
+ (unless (symbolp var)
+ (signal 'wrong-type-argument (list #'symbolp var)))
+ `(if (epl-package-p ,var)
+ (let ((,var (epl-package-description ,var)))
+ ,@body)
+ (signal 'wrong-type-argument (list #'epl-package-p ,var))))
+
+(defsubst epl-package--package-desc-p (package)
+ "Whether the description of PACKAGE is a `package-desc'."
+ (epl--package-desc-p (epl-package-description package)))
+
+(defun epl-package-version (package)
+ "Get the version of PACKAGE, as version list."
+ (epl-package-as-description package
+ (cond
+ ((fboundp 'package-desc-version) (package-desc-version package))
+ ;; Legacy
+ ((fboundp 'package-desc-vers)
+ (let ((version (package-desc-vers package)))
+ (if (listp version) version (version-to-list version))))
+ (:else (error "Cannot get version from %S" package)))))
+
+(defun epl-package-version-string (package)
+ "Get the version from a PACKAGE, as string."
+ (package-version-join (epl-package-version package)))
+
+(defun epl-package-summary (package)
+ "Get the summary of PACKAGE, as string."
+ (epl-package-as-description package
+ (cond
+ ((fboundp 'package-desc-summary) (package-desc-summary package))
+ ((fboundp 'package-desc-doc) (package-desc-doc package)) ; Legacy
+ (:else (error "Cannot get summary from %S" package)))))
+
+(defsubst epl-requirement--from-req (req)
+ "Create a `epl-requirement' from a `package-desc' REQ."
+ (let ((version (cadr req)))
+ (epl-requirement-create :name (car req)
+ :version (if (listp version) version
+ (version-to-list version)))))
+
+(defun epl-package-requirements (package)
+ "Get the requirements of PACKAGE.
+
+The requirements are a list of `epl-requirement' objects."
+ (epl-package-as-description package
+ (mapcar #'epl-requirement--from-req (package-desc-reqs package))))
+
+(defun epl-package-directory (package)
+ "Get the directory PACKAGE is installed to.
+
+Return the absolute path of the installation directory of
+PACKAGE, or nil, if PACKAGE is not installed."
+ (cond
+ ((fboundp 'package-desc-dir)
+ (package-desc-dir (epl-package-description package)))
+ ((fboundp 'package--dir)
+ (package--dir (symbol-name (epl-package-name package))
+ (epl-package-version-string package)))
+ (:else (error "Cannot get package directory from %S" package))))
+
+(defun epl-package-->= (pkg1 pkg2)
+ "Determine whether PKG1 is before PKG2 by version."
+ (not (version-list-< (epl-package-version pkg1)
+ (epl-package-version pkg2))))
+
+(defun epl-package--from-package-desc (package-desc)
+ "Create an `epl-package' from a PACKAGE-DESC.
+
+PACKAGE-DESC is a `package-desc' object, from recent package.el
+variants."
+ (if (and (fboundp 'package-desc-name)
+ (epl--package-desc-p package-desc))
+ (epl-package-create :name (package-desc-name package-desc)
+ :description package-desc)
+ (signal 'wrong-type-argument (list 'epl--package-desc-p package-desc))))
+
+(defun epl-package--parse-info (info)
+ "Parse a package.el INFO."
+ (if (epl--package-desc-p info)
+ (epl-package--from-package-desc info)
+ ;; For legacy package.el, info is a vector [NAME REQUIRES DESCRIPTION
+ ;; VERSION COMMENTARY]. We need to re-shape this vector into the
+ ;; `package-alist' format [VERSION REQUIRES DESCRIPTION] to attach it to the
+ ;; new `epl-package'.
+ (let ((name (intern (aref info 0)))
+ (info (vector (aref info 3) (aref info 1) (aref info 2))))
+ (epl-package-create :name name :description info))))
+
+(defun epl-package-from-buffer (&optional buffer)
+ "Create an `epl-package' object from BUFFER.
+
+BUFFER defaults to the current buffer.
+
+Signal `epl-invalid-package' if the buffer does not contain a
+valid package file."
+ (let ((info (with-current-buffer (or buffer (current-buffer))
+ (condition-case err
+ (package-buffer-info)
+ (error (signal 'epl-invalid-package (cdr err)))))))
+ (epl-package--parse-info info)))
+
+(defun epl-package-from-lisp-file (file-name)
+ "Parse the package headers the file at FILE-NAME.
+
+Return an `epl-package' object with the header metadata."
+ (with-temp-buffer
+ (insert-file-contents file-name)
+ (condition-case err
+ (epl-package-from-buffer (current-buffer))
+ ;; Attach file names to invalid package errors
+ (epl-invalid-package
+ (signal 'epl-invalid-package-file (cons file-name (cdr err))))
+ ;; Forward other errors
+ (error (signal (car err) (cdr err))))))
+
+(defun epl-package-from-tar-file (file-name)
+ "Parse the package tarball at FILE-NAME.
+
+Return a `epl-package' object with the meta data of the tarball
+package in FILE-NAME."
+ (condition-case nil
+ ;; In legacy package.el, `package-tar-file-info' takes the name of the tar
+ ;; file to parse as argument. In modern package.el, it has no arguments
+ ;; and works on the current buffer. Hence, we just try to call the legacy
+ ;; version, and if that fails because of a mismatch between formal and
+ ;; actual arguments, we use the modern approach. To avoid spurious
+ ;; signature warnings by the byte compiler, we suppress warnings when
+ ;; calling the function.
+ (epl-package--parse-info (with-no-warnings
+ (package-tar-file-info file-name)))
+ (wrong-number-of-arguments
+ (with-temp-buffer
+ (insert-file-contents-literally file-name)
+ ;; Switch to `tar-mode' to enable extraction of the file. Modern
+ ;; `package-tar-file-info' relies on `tar-mode', and signals an error if
+ ;; called in a buffer with a different mode.
+ (tar-mode)
+ (epl-package--parse-info (with-no-warnings
+ (package-tar-file-info)))))))
+
+(defun epl-package-from-file (file-name)
+ "Parse the package at FILE-NAME.
+
+Return an `epl-package' object with the meta data of the package
+at FILE-NAME."
+ (if (string-match-p (rx ".tar" string-end) file-name)
+ (epl-package-from-tar-file file-name)
+ (epl-package-from-lisp-file file-name)))
+
+(defun epl-package--parse-descriptor-requirement (requirement)
+ "Parse a REQUIREMENT in a package descriptor."
+ ;; This function is only called on legacy package.el. On package-desc
+ ;; package.el, we just let package.el do the work.
+ (cl-destructuring-bind (name version-string) requirement
+ (list name (version-to-list version-string))))
+
+(defun epl-package-from-descriptor-file (descriptor-file)
+ "Load a `epl-package' from a package DESCRIPTOR-FILE.
+
+A package descriptor is a file defining a new package. Its name
+typically ends with -pkg.el."
+ (with-temp-buffer
+ (insert-file-contents descriptor-file)
+ (goto-char (point-min))
+ (let ((sexp (read (current-buffer))))
+ (unless (eq (car sexp) 'define-package)
+ (error "%S is no valid package descriptor" descriptor-file))
+ (if (and (fboundp 'package-desc-from-define)
+ (fboundp 'package-desc-name))
+ ;; In Emacs snapshot, we can conveniently call a function to parse the
+ ;; descriptor
+ (let ((desc (apply #'package-desc-from-define (cdr sexp))))
+ (epl-package-create :name (package-desc-name desc)
+ :description desc))
+ ;; In legacy package.el, we must manually deconstruct the descriptor,
+ ;; because the load function has eval's the descriptor and has a lot of
+ ;; global side-effects.
+ (cl-destructuring-bind
+ (name version-string summary requirements) (cdr sexp)
+ (epl-package-create
+ :name (intern name)
+ :description
+ (vector (version-to-list version-string)
+ (mapcar #'epl-package--parse-descriptor-requirement
+ ;; Strip the leading `quote' from the package list
+ (cadr requirements))
+ summary)))))))
+
+
+;;; Package database access
+(defun epl-package-installed-p (package &optional min-version)
+ "Determine whether a PACKAGE, of MIN-VERSION or newer, is installed.
+
+PACKAGE is either a package name as symbol, or a package object.
+When a explicit MIN-VERSION is provided it overwrites the version of the PACKAGE object."
+ (let ((name (if (epl-package-p package)
+ (epl-package-name package)
+ package))
+ (min-version (or min-version (and (epl-package-p package)
+ (epl-package-version package)))))
+ (package-installed-p name min-version)))
+
+(defun epl--parse-built-in-entry (entry)
+ "Parse an ENTRY from the list of built-in packages.
+
+Return the corresponding `epl-package' object."
+ (if (fboundp 'package--from-builtin)
+ ;; In package-desc package.el, convert the built-in package to a
+ ;; `package-desc' and convert that to an `epl-package'
+ (epl-package--from-package-desc (package--from-builtin entry))
+ (epl-package-create :name (car entry) :description (cdr entry))))
+
+(defun epl-built-in-packages ()
+ "Get all built-in packages.
+
+Return a list of `epl-package' objects."
+ ;; This looks mighty strange, but it's the only way to force package.el to
+ ;; build the list of built-in packages. Without this, `package--builtins'
+ ;; might be empty.
+ (package-built-in-p 'foo)
+ (mapcar #'epl--parse-built-in-entry package--builtins))
+
+(defun epl-find-built-in-package (name)
+ "Find a built-in package with NAME.
+
+NAME is a package name, as symbol.
+
+Return the built-in package as `epl-package' object, or nil if
+there is no built-in package with NAME."
+ (when (package-built-in-p name)
+ ;; We must call `package-built-in-p' *before* inspecting
+ ;; `package--builtins', because otherwise `package--builtins' might be
+ ;; empty.
+ (epl--parse-built-in-entry (assq name package--builtins))))
+
+(defun epl-package-outdated-p (package)
+ "Determine whether a PACKAGE is outdated.
+
+A package is outdated, if there is an available package with a
+higher version.
+
+PACKAGE is either a package name as symbol, or a package object.
+In the former case, test the installed or built-in package with
+the highest version number, in the later case, test the package
+object itself.
+
+Return t, if the package is outdated, or nil otherwise."
+ (let* ((package (if (epl-package-p package)
+ package
+ (or (car (epl-find-installed-packages package))
+ (epl-find-built-in-package package))))
+ (available (car (epl-find-available-packages
+ (epl-package-name package)))))
+ (and package available (version-list-< (epl-package-version package)
+ (epl-package-version available)))))
+
+(defun epl--parse-package-list-entry (entry)
+ "Parse a list of packages from ENTRY.
+
+ENTRY is a single entry in a package list, e.g. `package-alist',
+`package-archive-contents', etc. Typically it is a cons cell,
+but the exact format varies between package.el versions. This
+function tries to parse all known variants.
+
+Return a list of `epl-package' objects parsed from ENTRY."
+ (let ((descriptions (cdr entry)))
+ (cond
+ ((listp descriptions)
+ (sort (mapcar #'epl-package--from-package-desc descriptions)
+ #'epl-package-->=))
+ ;; Legacy package.el has just a single package in an entry, which is a
+ ;; standard description vector
+ ((vectorp descriptions)
+ (list (epl-package-create :name (car entry)
+ :description descriptions)))
+ (:else (error "Cannot parse entry %S" entry)))))
+
+(defun epl-installed-packages ()
+ "Get all installed packages.
+
+Return a list of package objects."
+ (apply #'append (mapcar #'epl--parse-package-list-entry package-alist)))
+
+(defsubst epl--filter-outdated-packages (packages)
+ "Filter outdated packages from PACKAGES."
+ (let (res)
+ (dolist (package packages)
+ (when (epl-package-outdated-p package)
+ (push package res)))
+ (nreverse res)))
+
+(defun epl-outdated-packages ()
+ "Get all outdated packages, as in `epl-package-outdated-p'.
+
+Return a list of package objects."
+ (epl--filter-outdated-packages (epl-installed-packages)))
+
+(defsubst epl--find-package-in-list (name list)
+ "Find a package by NAME in a package LIST.
+
+Return a list of corresponding `epl-package' objects."
+ (let ((entry (assq name list)))
+ (when entry
+ (epl--parse-package-list-entry entry))))
+
+(defun epl-find-installed-package (name)
+ "Find the latest installed package by NAME.
+
+NAME is a package name, as symbol.
+
+Return the installed package with the highest version number as
+`epl-package' object, or nil, if no package with NAME is
+installed."
+ (car (epl-find-installed-packages name)))
+(make-obsolete 'epl-find-installed-package 'epl-find-installed-packages "0.7")
+
+(defun epl-find-installed-packages (name)
+ "Find all installed packages by NAME.
+
+NAME is a package name, as symbol.
+
+Return a list of all installed packages with NAME, sorted by
+version number in descending order. Return nil, if there are no
+packages with NAME."
+ (epl--find-package-in-list name package-alist))
+
+(defun epl-available-packages ()
+ "Get all packages available for installation.
+
+Return a list of package objects."
+ (apply #'append (mapcar #'epl--parse-package-list-entry
+ package-archive-contents)))
+
+(defun epl-find-available-packages (name)
+ "Find available packages for NAME.
+
+NAME is a package name, as symbol.
+
+Return a list of available packages for NAME, sorted by version
+number in descending order. Return nil, if there are no packages
+for NAME."
+ (epl--find-package-in-list name package-archive-contents))
+
+(cl-defstruct (epl-upgrade
+ (:constructor epl-upgrade-create))
+ "Structure describing an upgradable package.
+Slots:
+
+`installed' The installed package
+
+`available' The package available for installation."
+ installed
+ available)
+
+(defun epl-find-upgrades (&optional packages)
+ "Find all upgradable PACKAGES.
+
+PACKAGES is a list of package objects to upgrade, defaulting to
+all installed packages.
+
+Return a list of `epl-upgrade' objects describing all upgradable
+packages."
+ (let ((packages (or packages (epl-installed-packages)))
+ upgrades)
+ (dolist (pkg packages)
+ (let* ((version (epl-package-version pkg))
+ (name (epl-package-name pkg))
+ ;; Find the latest available package for NAME
+ (available-pkg (car (epl-find-available-packages name)))
+ (available-version (when available-pkg
+ (epl-package-version available-pkg))))
+ (when (and available-version (version-list-< version available-version))
+ (push (epl-upgrade-create :installed pkg
+ :available available-pkg)
+ upgrades))))
+ (nreverse upgrades)))
+
+(defalias 'epl-built-in-p 'package-built-in-p)
+
+
+;;; Package operations
+
+(defun epl-install-file (file)
+ "Install a package from FILE, like `package-install-file'."
+ (interactive (advice-eval-interactive-spec
+ (cadr (interactive-form #'package-install-file))))
+ (apply #'package-install-file (list file))
+ (let ((package (epl-package-from-file file)))
+ (unless (epl-package--package-desc-p package)
+ (epl--kill-autoload-buffer package))))
+
+(defun epl--kill-autoload-buffer (package)
+ "Kill the buffer associated with autoloads for PACKAGE."
+ (let* ((auto-name (format "%s-autoloads.el" (epl-package-name package)))
+ (generated-autoload-file (expand-file-name auto-name (epl-package-directory package)))
+ (buf (find-buffer-visiting generated-autoload-file)))
+ (when buf (kill-buffer buf))))
+
+(defun epl-package-install (package &optional force)
+ "Install a PACKAGE.
+
+PACKAGE is a `epl-package' object. If FORCE is given and
+non-nil, install PACKAGE, even if it is already installed."
+ (when (or force (not (epl-package-installed-p package)))
+ (if (epl-package--package-desc-p package)
+ (package-install (epl-package-description package))
+ ;; The legacy API installs by name. We have no control over versioning,
+ ;; etc.
+ (package-install (epl-package-name package))
+ (epl--kill-autoload-buffer package))))
+
+(defun epl-package-delete (package)
+ "Delete a PACKAGE.
+
+PACKAGE is a `epl-package' object to delete."
+ ;; package-delete allows for packages being trashed instead of fully deleted.
+ ;; Let's prevent his silly behavior
+ (let ((delete-by-moving-to-trash nil))
+ ;; The byte compiler will warn us that we are calling `package-delete' with
+ ;; the wrong number of arguments, since it can't infer that we guarantee to
+ ;; always call the correct version. Thus we suppress all warnings when
+ ;; calling `package-delete'. I wish there was a more granular way to
+ ;; disable just that specific warning, but it is what it is.
+ (if (epl-package--package-desc-p package)
+ (with-no-warnings
+ (package-delete (epl-package-description package)))
+ ;; The legacy API deletes by name (as string!) and version instead by
+ ;; descriptor. Hence `package-delete' takes two arguments. For some
+ ;; insane reason, the arguments are strings here!
+ (let ((name (symbol-name (epl-package-name package)))
+ (version (epl-package-version-string package)))
+ (with-no-warnings
+ (package-delete name version))
+ ;; Legacy package.el does not remove the deleted package
+ ;; from the `package-alist', so we do it manually here.
+ (let ((pkg (assq (epl-package-name package) package-alist)))
+ (when pkg
+ (setq package-alist (delq pkg package-alist))))))))
+
+(defun epl-upgrade (&optional packages preserve-obsolete)
+ "Upgrade PACKAGES.
+
+PACKAGES is a list of package objects to upgrade, defaulting to
+all installed packages.
+
+The old versions of the updated packages are deleted, unless
+PRESERVE-OBSOLETE is non-nil.
+
+Return a list of all performed upgrades, as a list of
+`epl-upgrade' objects."
+ (let ((upgrades (epl-find-upgrades packages)))
+ (dolist (upgrade upgrades)
+ (epl-package-install (epl-upgrade-available upgrade) 'force)
+ (unless preserve-obsolete
+ (epl-package-delete (epl-upgrade-installed upgrade))))
+ upgrades))
+
+(provide 'epl)
+
+;;; epl.el ends here
diff --git a/elpa/epl-20180205.2049/epl.elc b/elpa/epl-20180205.2049/epl.elc
new file mode 100644
index 0000000..97abfb4
--- /dev/null
+++ b/elpa/epl-20180205.2049/epl.elc
Binary files differ
diff --git a/elpa/flycheck-20220314.27/flycheck-autoloads.el b/elpa/flycheck-20220314.27/flycheck-autoloads.el
new file mode 100644
index 0000000..4475a6f
--- /dev/null
+++ b/elpa/flycheck-20220314.27/flycheck-autoloads.el
@@ -0,0 +1,306 @@
+;;; flycheck-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "flycheck" "flycheck.el" (0 0 0 0))
+;;; Generated autoloads from flycheck.el
+
+(autoload 'flycheck-manual "flycheck" "\
+Open the Flycheck manual." t nil)
+
+(autoload 'flycheck-mode "flycheck" "\
+Flycheck is a minor mode for on-the-fly syntax checking.
+
+In `flycheck-mode' the buffer is automatically syntax-checked
+using the first suitable syntax checker from `flycheck-checkers'.
+Use `flycheck-select-checker' to select a checker for the current
+buffer manually.
+
+If you run into issues, use `\\[flycheck-verify-setup]' to get help.
+
+Flycheck supports many languages out of the box, and many
+additional ones are available on MELPA. Adding new ones is very
+easy. Complete documentation is available online at URL
+`https://www.flycheck.org/en/latest/'. Please report issues and
+request features at URL `https://github.com/flycheck/flycheck'.
+
+Flycheck displays its status in the mode line. In the default
+configuration, it looks like this:
+
+`FlyC' This buffer has not been checked yet.
+`FlyC-' Flycheck doesn't have a checker for this buffer.
+`FlyC*' Flycheck is running. Expect results soon!
+`FlyC:3|2' This buffer contains three warnings and two errors.
+ Use `\\[flycheck-list-errors]' to see the list.
+
+You may also see the following icons:
+`FlyC!' The checker crashed.
+`FlyC.' The last syntax check was manually interrupted.
+`FlyC?' The checker did something unexpected, like exiting with 1
+ but returning no errors.
+
+The following keybindings are available in `flycheck-mode':
+
+\\{flycheck-mode-map}
+\(you can change the prefix by customizing
+`flycheck-keymap-prefix')
+
+If called interactively, enable Flycheck 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.
+
+\(fn &optional ARG)" t nil)
+
+(put 'global-flycheck-mode 'globalized-minor-mode t)
+
+(defvar global-flycheck-mode nil "\
+Non-nil if Global Flycheck mode is enabled.
+See the `global-flycheck-mode' command
+for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `global-flycheck-mode'.")
+
+(custom-autoload 'global-flycheck-mode "flycheck" nil)
+
+(autoload 'global-flycheck-mode "flycheck" "\
+Toggle Flycheck mode in all buffers.
+With prefix ARG, enable Global Flycheck mode if ARG is positive;
+otherwise, disable it. If called from Lisp, enable the mode if
+ARG is omitted or nil.
+
+Flycheck mode is enabled in all buffers where
+`flycheck-mode-on-safe' would do it.
+See `flycheck-mode' for more information on Flycheck mode.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'flycheck-define-error-level "flycheck" "\
+Define a new error LEVEL with PROPERTIES.
+
+The following PROPERTIES constitute an error level:
+
+`:severity SEVERITY'
+ A number denoting the severity of this level. The higher
+ the number, the more severe is this level compared to other
+ levels. Defaults to 0; info is -10, warning is 10, and
+ error is 100.
+
+ The severity is used by `flycheck-error-level-<' to
+ determine the ordering of errors according to their levels.
+
+`:compilation-level LEVEL'
+
+ A number indicating the broad class of messages that errors
+ at this level belong to: one of 0 (info), 1 (warning), or
+ 2 or nil (error). Defaults to nil.
+
+ This is used by `flycheck-checker-pattern-to-error-regexp'
+ to map error levels into `compilation-mode''s hierarchy and
+ to get proper highlighting of errors in `compilation-mode'.
+
+`:overlay-category CATEGORY'
+ A symbol denoting the overlay category to use for error
+ highlight overlays for this level. See Info
+ node `(elisp)Overlay Properties' for more information about
+ overlay categories.
+
+ A category for an error level overlay should at least define
+ the `face' property, for error highlighting. Another useful
+ property for error level categories is `priority', to
+ influence the stacking of multiple error level overlays.
+
+`:fringe-bitmap BITMAPS'
+ A fringe bitmap symbol denoting the bitmap to use for fringe
+ indicators for this level, or a cons of two bitmaps (one for
+ narrow fringes and one for wide fringes). See Info node
+ `(elisp)Fringe Bitmaps' for more information about fringe
+ bitmaps, including a list of built-in fringe bitmaps.
+
+`:fringe-face FACE'
+ A face symbol denoting the face to use for fringe indicators
+ for this level.
+
+`:margin-spec SPEC'
+ A display specification indicating what to display in the
+ margin when `flycheck-indication-mode' is `left-margin' or
+ `right-margin'. See Info node `(elisp)Displaying in the
+ Margins'. If omitted, Flycheck generates an image spec from
+ the fringe bitmap.
+
+`:error-list-face FACE'
+ A face symbol denoting the face to use for messages of this
+ level in the error list. See `flycheck-list-errors'.
+
+\(fn LEVEL &rest PROPERTIES)" nil nil)
+
+(function-put 'flycheck-define-error-level 'lisp-indent-function '1)
+
+(autoload 'flycheck-define-command-checker "flycheck" "\
+Define SYMBOL as syntax checker to run a command.
+
+Define SYMBOL as generic syntax checker via
+`flycheck-define-generic-checker', which uses an external command
+to check the buffer. SYMBOL and DOCSTRING are the same as for
+`flycheck-define-generic-checker'.
+
+In addition to the properties understood by
+`flycheck-define-generic-checker', the following PROPERTIES
+constitute a command syntax checker. Unless otherwise noted, all
+properties are mandatory. Note that the default `:error-filter'
+of command checkers is `flycheck-sanitize-errors'.
+
+`:command COMMAND'
+ The command to run for syntax checking.
+
+ COMMAND is a list of the form `(EXECUTABLE [ARG ...])'.
+
+ EXECUTABLE is a string with the executable of this syntax
+ checker. It can be overridden with the variable
+ `flycheck-SYMBOL-executable'. Note that this variable is
+ NOT implicitly defined by this function. Use
+ `flycheck-def-executable-var' to define this variable.
+
+ Each ARG is an argument to the executable, either as string,
+ or as special symbol or form for
+ `flycheck-substitute-argument', which see.
+
+`:error-patterns PATTERNS'
+ A list of patterns to parse the output of the `:command'.
+
+ Each ITEM in PATTERNS is a list `(LEVEL SEXP ...)', where
+ LEVEL is a Flycheck error level (see
+ `flycheck-define-error-level'), followed by one or more RX
+ `SEXP's which parse an error of that level and extract line,
+ column, file name and the message.
+
+ See `rx' for general information about RX, and
+ `flycheck-rx-to-string' for some special RX forms provided
+ by Flycheck.
+
+ All patterns are applied in the order of declaration to the
+ whole output of the syntax checker. Output already matched
+ by a pattern will not be matched by subsequent patterns. In
+ other words, the first pattern wins.
+
+ This property is optional. If omitted, however, an
+ `:error-parser' is mandatory.
+
+`:error-parser FUNCTION'
+ A function to parse errors with.
+
+ The function shall accept three arguments OUTPUT CHECKER
+ BUFFER. OUTPUT is the syntax checker output as string,
+ CHECKER the syntax checker that was used, and BUFFER a
+ buffer object representing the checked buffer. The function
+ must return a list of `flycheck-error' objects parsed from
+ OUTPUT.
+
+ This property is optional. If omitted, it defaults to
+ `flycheck-parse-with-patterns'. In this case,
+ `:error-patterns' is mandatory.
+
+`:standard-input t'
+ Whether to send the buffer contents on standard input.
+
+ If this property is given and has a non-nil value, send the
+ contents of the buffer on standard input.
+
+ Defaults to nil.
+
+Note that you may not give `:start', `:interrupt', and
+`:print-doc' for a command checker. You can give a custom
+`:verify' function, though, whose results will be appended to the
+default `:verify' function of command checkers.
+
+\(fn SYMBOL DOCSTRING &rest PROPERTIES)" nil nil)
+
+(function-put 'flycheck-define-command-checker 'lisp-indent-function '1)
+
+(function-put 'flycheck-define-command-checker 'doc-string-elt '2)
+
+(autoload 'flycheck-def-config-file-var "flycheck" "\
+Define SYMBOL as config file variable for CHECKER, with default FILE-NAME.
+
+SYMBOL is declared as customizable variable using `defcustom', to
+provide configuration files for the given syntax CHECKER.
+CUSTOM-ARGS are forwarded to `defcustom'.
+
+FILE-NAME is the initial value of the new variable. If omitted,
+the default value is nil. It can be either a string or a list of
+strings.
+
+Use this together with the `config-file' form in the `:command'
+argument to `flycheck-define-checker'.
+
+\(fn SYMBOL CHECKER &optional FILE-NAME &rest CUSTOM-ARGS)" nil t)
+
+(function-put 'flycheck-def-config-file-var 'lisp-indent-function '3)
+
+(autoload 'flycheck-def-option-var "flycheck" "\
+Define SYMBOL as option variable with INIT-VALUE for CHECKER.
+
+SYMBOL is declared as customizable variable using `defcustom', to
+provide an option for the given syntax CHECKERS (a checker or a
+list of checkers). INIT-VALUE is the initial value of the
+variable, and DOCSTRING is its docstring. CUSTOM-ARGS are
+forwarded to `defcustom'.
+
+Use this together with the `option', `option-list' and
+`option-flag' forms in the `:command' argument to
+`flycheck-define-checker'.
+
+\(fn SYMBOL INIT-VALUE CHECKERS DOCSTRING &rest CUSTOM-ARGS)" nil t)
+
+(function-put 'flycheck-def-option-var 'lisp-indent-function '3)
+
+(function-put 'flycheck-def-option-var 'doc-string-elt '4)
+
+(autoload 'flycheck-define-checker "flycheck" "\
+Define SYMBOL as command syntax checker with DOCSTRING and PROPERTIES.
+
+Like `flycheck-define-command-checker', but PROPERTIES must not
+be quoted. Also, implicitly define the executable variable for
+SYMBOL with `flycheck-def-executable-var'.
+
+\(fn SYMBOL DOCSTRING &rest PROPERTIES)" nil t)
+
+(function-put 'flycheck-define-checker 'lisp-indent-function '1)
+
+(function-put 'flycheck-define-checker 'doc-string-elt '2)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "flycheck" '("flycheck-" "help-flycheck-checker-d" "list-flycheck-errors")))
+
+;;;***
+
+;;;### (autoloads nil "flycheck-buttercup" "flycheck-buttercup.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from flycheck-buttercup.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "flycheck-buttercup" '("flycheck-buttercup-format-error-list")))
+
+;;;***
+
+;;;### (autoloads nil "flycheck-ert" "flycheck-ert.el" (0 0 0 0))
+;;; Generated autoloads from flycheck-ert.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "flycheck-ert" '("flycheck-er")))
+
+;;;***
+
+;;;### (autoloads nil nil ("flycheck-pkg.el") (0 0 0 0))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; flycheck-autoloads.el ends here
diff --git a/elpa/flycheck-20220314.27/flycheck-buttercup.el b/elpa/flycheck-20220314.27/flycheck-buttercup.el
new file mode 100644
index 0000000..9802265
--- /dev/null
+++ b/elpa/flycheck-20220314.27/flycheck-buttercup.el
@@ -0,0 +1,157 @@
+;;; flycheck-buttercup.el --- Flycheck: Extensions to Buttercup -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2017 Flycheck contributors
+;; Copyright (C) 2016 Sebastian Wiesner and Flycheck contributors
+
+;; Author: Sebastian Wiesner <swiesner@lunaryorn.com>
+;; Maintainer: Clément Pit-Claudel <clement.pitclaudel@live.com>
+;; fmdkdd <fmdkdd@gmail.com>
+;; Keywords: lisp, tools
+
+;; This file is not part of GNU Emacs.
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Extensions to Buttercup to write BDD tests for Flycheck.
+;;
+;; Buttercup is a BDD testing framework for Emacs, see URL
+;; `https://github.com/jorgenschaefer/emacs-buttercup/'. Flycheck uses
+;; Buttercup extensively for new tests.
+;;
+;; This library provides extensions to Buttercup to write Specs for Flycheck.
+;;
+;; * Custom matchers
+;;
+;; (expect 'foo :to-be-local) - Is `foo' a local variable in the current buffer?
+
+;;; Code:
+
+(require 'buttercup)
+(require 'flycheck)
+(require 'seq)
+
+
+;;; Buttercup helpers
+
+(defun flycheck-buttercup-format-error-list (errors)
+ "Format ERRORS into a human-readable string."
+ (mapconcat (lambda (e) (flycheck-error-format e 'with-file-name))
+ errors "\n"))
+
+
+;;; Data matchers
+
+(buttercup-define-matcher :to-be-empty-string (s)
+ (let ((s (funcall s)))
+ (if (equal s "")
+ (cons t (format "Expected %S not be an empty string" s))
+ (cons nil (format "Expected %S to be an empty string" s)))))
+
+(buttercup-define-matcher :to-match-with-group (re s index match)
+ (let* ((re (funcall re))
+ (s (funcall s))
+ (index (funcall index))
+ (match (funcall match))
+ (matches? (string-match re s))
+ (result (and matches? (match-string index s))))
+ (if (and matches? (equal result match))
+ (cons t (format "Expected %S not to match %S with %S in group %s"
+ re s match index))
+
+ (cons nil (format "Expected %S to match %S with %S in group %s, %s"
+ re s match index
+ (if matches?
+ (format "but got %S" result)
+ "but did not match"))))))
+
+
+;;; Emacs feature matchers
+
+(buttercup-define-matcher :to-be-live (buffer)
+ (let ((buffer (get-buffer (funcall buffer))))
+ (if (buffer-live-p buffer)
+ (cons t (format "Expected %S not to be a live buffer, but it is"
+ buffer))
+ (cons nil (format "Expected %S to be a live buffer, but it is not"
+ buffer)))))
+
+(buttercup-define-matcher :to-be-visible (buffer)
+ (let ((buffer (get-buffer (funcall buffer))))
+ (cond
+ ((and buffer (get-buffer-window buffer))
+ (cons t (format "Expected %S not to be a visible buffer, but it is"
+ buffer)))
+ ((not (bufferp buffer))
+ (cons nil
+ (format "Expected %S to be a visible buffer, but it is not a buffer"
+ buffer)))
+ (t (cons
+ nil
+ (format "Expected %S to be a visible buffer, but it is not visible"
+ buffer))))))
+
+(buttercup-define-matcher :to-be-local (symbol)
+ (let ((symbol (funcall symbol)))
+ (if (local-variable-p symbol)
+ (cons t (format "Expected %S not to be a local variable, but it is"
+ symbol))
+ (cons nil (format "Expected %S to be a local variable, but it is not"
+ symbol)))))
+
+(buttercup-define-matcher :to-contain-match (buffer re)
+ (let ((buffer (funcall buffer))
+ (re (funcall re)))
+ (if (not (get-buffer buffer))
+ (cons nil (format "Expected %S to contain a match of %s, \
+but is not a buffer" buffer re))
+ (with-current-buffer buffer
+ (save-excursion
+ (goto-char (point-min))
+ (if (re-search-forward re nil 'noerror)
+ (cons t (format "Expected %S to contain a match \
+for %s, but it did not" buffer re))
+ (cons nil (format "Expected %S not to contain a match for \
+%s but it did not." buffer re))))))))
+
+
+;;; Flycheck matchers
+
+(buttercup-define-matcher :to-be-equal-flycheck-errors (a b)
+ (let* ((a (funcall a))
+ (b (funcall b))
+ (a-formatted (flycheck-buttercup-format-error-list a))
+ (b-formatted (flycheck-buttercup-format-error-list b)))
+ (if (equal a b)
+ (cons t (format "Expected
+%s
+not to be equal to
+%s" a-formatted b-formatted))
+ (cons nil (format "Expected
+%s
+to be equal to
+%s" a-formatted b-formatted)))))
+
+(provide 'flycheck-buttercup)
+
+;; Disable byte compilation for this library, to prevent package.el choking on a
+;; missing `buttercup' library. See
+;; https://github.com/flycheck/flycheck/issues/860
+
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
+
+;;; flycheck-buttercup.el ends here
diff --git a/elpa/flycheck-20220314.27/flycheck-ert.el b/elpa/flycheck-20220314.27/flycheck-ert.el
new file mode 100644
index 0000000..4d64a73
--- /dev/null
+++ b/elpa/flycheck-20220314.27/flycheck-ert.el
@@ -0,0 +1,507 @@
+;;; flycheck-ert.el --- Flycheck: ERT extensions -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2017-2018 Flycheck contributors
+;; Copyright (C) 2013-2016 Sebastian Wiesner and Flycheck contributors
+
+;; Author: Sebastian Wiesner <swiesner@lunaryorn.com>
+;; Maintainer: Clément Pit-Claudel <clement.pitclaudel@live.com>
+;; fmdkdd <fmdkdd@gmail.com>
+;; URL: https://github.com/flycheck/flycheck
+
+;; This file is not part of GNU Emacs.
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Unit testing library for Flycheck, the modern on-the-fly syntax checking
+;; extension for GNU Emacs.
+
+;; Provide various utility functions and unit test helpers to test Flycheck and
+;; Flycheck extensions.
+
+;;; Code:
+
+(require 'flycheck)
+(require 'ert)
+(require 'macroexp) ; For macro utilities
+
+
+;;; Compatibility
+
+(eval-and-compile
+ ;; Provide `ert-skip' and friends for Emacs 24.3
+ (defconst flycheck-ert-ert-can-skip (fboundp 'ert-skip)
+ "Whether ERT supports test skipping.")
+
+ (unless (fboundp 'define-error)
+ ;; from Emacs `subr.el'
+ (defun define-error (name message &optional parent)
+ "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'.
+PARENT is either a signal or a list of signals from which it inherits.
+Defaults to `error'."
+ (unless parent (setq parent 'error))
+ (let ((conditions
+ (if (consp parent)
+ (apply #'append
+ (mapcar
+ (lambda (parent)
+ (cons parent
+ (or (get parent 'error-conditions)
+ (error "Unknown signal `%s'" parent))))
+ parent))
+ (cons parent (get parent 'error-conditions)))))
+ (put name 'error-conditions
+ (delete-dups (copy-sequence (cons name conditions))))
+ (when message (put name 'error-message message)))))
+
+ (unless flycheck-ert-ert-can-skip
+ ;; Fake skipping
+
+ (define-error 'flycheck-ert-skipped "Test skipped")
+
+ (defun ert-skip (data)
+ (signal 'flycheck-ert-skipped data))
+
+ (defmacro skip-unless (form)
+ `(unless (ignore-errors ,form)
+ (signal 'flycheck-ert-skipped ',form)))
+
+ (defun ert-test-skipped-p (result)
+ (and (ert-test-failed-p result)
+ (eq (car (ert-test-failed-condition result))
+ 'flycheck-ert-skipped)))))
+
+
+;;; Internal variables
+
+(defvar flycheck-ert--resource-directory nil
+ "The directory to get resources from in this test suite.")
+
+
+;;; Resource management macros
+
+(defmacro flycheck-ert-with-temp-buffer (&rest body)
+ "Eval BODY within a temporary buffer.
+
+Like `with-temp-buffer', but resets the modification state of the
+temporary buffer to make sure that it is properly killed even if
+it has a backing file and is modified."
+ (declare (indent 0) (debug t))
+ `(with-temp-buffer
+ (unwind-protect
+ ,(macroexp-progn body)
+ ;; Reset modification state of the buffer, and unlink it from its backing
+ ;; file, if any, because Emacs refuses to kill modified buffers with
+ ;; backing files, even if they are temporary.
+ (set-buffer-modified-p nil)
+ (set-visited-file-name nil 'no-query))))
+
+(defmacro flycheck-ert-with-file-buffer (file-name &rest body)
+ "Create a buffer from FILE-NAME and eval BODY.
+
+BODY is evaluated with `current-buffer' being a buffer with the
+contents FILE-NAME."
+ (declare (indent 1) (debug t))
+ `(let ((file-name ,file-name))
+ (unless (file-exists-p file-name)
+ (error "%s does not exist" file-name))
+ (flycheck-ert-with-temp-buffer
+ (insert-file-contents file-name 'visit)
+ (set-visited-file-name file-name 'no-query)
+ (cd (file-name-directory file-name))
+ ;; Mark the buffer as not modified, because we just loaded the file up to
+ ;; now.
+ (set-buffer-modified-p nil)
+ ,@body)))
+
+(defmacro flycheck-ert-with-help-buffer (&rest body)
+ "Execute BODY and kill the help buffer afterwards.
+
+Use this macro to test functions that create a Help buffer."
+ (declare (indent 0))
+ `(unwind-protect
+ ,(macroexp-progn body)
+ (when (buffer-live-p (get-buffer (help-buffer)))
+ (kill-buffer (help-buffer)))))
+
+(defmacro flycheck-ert-with-global-mode (&rest body)
+ "Execute BODY with Global Flycheck Mode enabled.
+
+After BODY, restore the old state of Global Flycheck Mode."
+ (declare (indent 0))
+ `(let ((old-state global-flycheck-mode))
+ (unwind-protect
+ (progn
+ (global-flycheck-mode 1)
+ ,@body)
+ (global-flycheck-mode (if old-state 1 -1)))))
+
+(defmacro flycheck-ert-with-env (env &rest body)
+ "Add ENV to `process-environment' in BODY.
+
+Execute BODY with a `process-environment' which contains all
+variables from ENV added.
+
+ENV is an alist, where each cons cell `(VAR . VALUE)' is a
+environment variable VAR to be added to `process-environment'
+with VALUE."
+ (declare (indent 1))
+ `(let ((process-environment (copy-sequence process-environment)))
+ (pcase-dolist (`(,var . ,value) ,env)
+ (setenv var value))
+ ,@body))
+
+
+;;; Test resources
+(defun flycheck-ert-resource-filename (resource-file)
+ "Determine the absolute file name of a RESOURCE-FILE.
+
+Relative file names are expanded against
+`flycheck-ert--resource-directory'."
+ (expand-file-name resource-file flycheck-ert--resource-directory))
+
+(defmacro flycheck-ert-with-resource-buffer (resource-file &rest body)
+ "Create a temp buffer from a RESOURCE-FILE and execute BODY.
+
+The absolute file name of RESOURCE-FILE is determined with
+`flycheck-ert-resource-filename'."
+ (declare (indent 1))
+ `(flycheck-ert-with-file-buffer
+ (flycheck-ert-resource-filename ,resource-file)
+ ,@body))
+
+
+;;; Test suite initialization
+
+(defun flycheck-ert-initialize (resource-dir)
+ "Initialize a test suite with RESOURCE-DIR.
+
+RESOURCE-DIR is the directory, `flycheck-ert-resource-filename'
+should use to lookup resource files."
+ (when flycheck-ert--resource-directory
+ (error "Test suite already initialized"))
+ (let ((tests (ert-select-tests t t)))
+ ;; Select all tests
+ (unless tests
+ (error "No tests defined. \
+Call `flycheck-ert-initialize' after defining all tests!"))
+
+ (setq flycheck-ert--resource-directory resource-dir)
+
+ ;; Emacs 24.3 don't support skipped tests, so we add poor man's test
+ ;; skipping: We mark skipped tests as expected failures by adjusting the
+ ;; expected result of all test cases. Not particularly pretty, but works :)
+ (unless flycheck-ert-ert-can-skip
+ (dolist (test tests)
+ (let ((result (ert-test-expected-result-type test)))
+ (setf (ert-test-expected-result-type test)
+ `(or ,result (satisfies ert-test-skipped-p))))))))
+
+
+;;; Test case definitions
+(defmacro flycheck-ert-def-checker-test (checker language name
+ &rest keys-and-body)
+ "Define a test case for a syntax CHECKER for LANGUAGE.
+
+CHECKER is a symbol or a list of symbols denoting syntax checkers
+being tested by the test. The test case is skipped, if any of
+these checkers cannot be used. LANGUAGE is a symbol or a list of
+symbols denoting the programming languages supported by the
+syntax checkers. This is currently only used for tagging the
+test appropriately.
+
+NAME is a symbol denoting the local name of the test. The test
+itself is ultimately named
+`flycheck-define-checker/CHECKER/NAME'. If CHECKER is a list,
+the first checker in the list is used for naming the test.
+
+Optionally, the keyword arguments `:tags' and `:expected-result'
+may be given. They have the same meaning as in `ert-deftest.',
+and are added to the tags and result expectations set up by this
+macro.
+
+The remaining forms KEYS-AND-BODY denote the body of the test
+case, including assertions and setup code."
+ (declare (indent 3))
+ (unless checker
+ (error "No syntax checkers specified"))
+ (unless language
+ (error "No languages specified"))
+ (let* ((checkers (if (symbolp checker) (list checker) checker))
+ (checker (car checkers))
+ (languages (if (symbolp language) (list language) language))
+ (language-tags (mapcar (lambda (l) (intern (format "language-%s" l)))
+ languages))
+ (checker-tags (mapcar (lambda (c) (intern (format "checker-%s" c)))
+ checkers))
+ (local-name (or name 'default))
+ (full-name (intern (format "flycheck-define-checker/%s/%s"
+ checker local-name)))
+ (keys-and-body (ert--parse-keys-and-body keys-and-body))
+ (body (cadr keys-and-body))
+ (keys (car keys-and-body))
+ (default-tags '(syntax-checker external-tool)))
+ `(ert-deftest ,full-name ()
+ :expected-result ,(or (plist-get keys :expected-result) :passed)
+ :tags (append ',(append default-tags language-tags checker-tags)
+ ,(plist-get keys :tags))
+ ,@(mapcar (lambda (c)
+ `(skip-unless
+ ;; Ignore non-command checkers
+ (or (not (flycheck-checker-get ',c 'command))
+ (executable-find (flycheck-checker-executable ',c)))))
+ checkers)
+ ,@body)))
+
+
+;;; Test case results
+
+(defun flycheck-ert-syntax-check-timed-out-p (result)
+ "Whether RESULT denotes a timed-out test.
+
+RESULT is an ERT test result object."
+ (and (ert-test-failed-p result)
+ (eq (car (ert-test-failed-condition result))
+ 'flycheck-ert-syntax-check-timed-out)))
+
+
+;;; Syntax checking in tests
+
+(defvar-local flycheck-ert-syntax-checker-finished nil
+ "Non-nil if the current checker has finished.")
+
+(add-hook 'flycheck-after-syntax-check-hook
+ (lambda () (setq flycheck-ert-syntax-checker-finished t)))
+
+(defconst flycheck-ert-checker-wait-time 10
+ "Time to wait until a checker is finished in seconds.
+
+After this time has elapsed, the checker is considered to have
+failed, and the test aborted with failure.")
+
+(define-error 'flycheck-ert-syntax-check-timed-out "Syntax check timed out.")
+
+(defun flycheck-ert-wait-for-syntax-checker ()
+ "Wait until the syntax check in the current buffer is finished."
+ (let ((starttime (float-time)))
+ (while (and (not flycheck-ert-syntax-checker-finished)
+ (< (- (float-time) starttime) flycheck-ert-checker-wait-time))
+ (accept-process-output nil 0.02))
+ (unless (< (- (float-time) starttime) flycheck-ert-checker-wait-time)
+ (flycheck-stop)
+ (signal 'flycheck-ert-syntax-check-timed-out nil)))
+ (setq flycheck-ert-syntax-checker-finished nil))
+
+(defun flycheck-ert-buffer-sync ()
+ "Like `flycheck-buffer', but synchronously."
+ (setq flycheck-ert-syntax-checker-finished nil)
+ (should (not (flycheck-running-p)))
+ (flycheck-mode) ;; This will only start a deferred check,
+ (should (flycheck-get-checker-for-buffer))
+ (flycheck-buffer) ;; …so we need an explicit manual check
+ ;; After starting the check, the checker should either be running now, or
+ ;; already be finished (if it was fast).
+ (should (or flycheck-current-syntax-check
+ flycheck-ert-syntax-checker-finished))
+ ;; Also there should be no deferred check pending anymore
+ (should-not (flycheck-deferred-check-p))
+ (flycheck-ert-wait-for-syntax-checker))
+
+(defun flycheck-ert-ensure-clear ()
+ "Clear the current buffer.
+
+Raise an assertion error if the buffer is not clear afterwards."
+ (flycheck-clear)
+ (should (not flycheck-current-errors))
+ (should (not (-any? (lambda (ov) (overlay-get ov 'flycheck-overlay))
+ (overlays-in (point-min) (point-max))))))
+
+
+;;; Test assertions
+
+(defun flycheck-error-without-group (err)
+ "Return a copy ERR with the `group' property set to nil."
+ (let ((copy (copy-flycheck-error err)))
+ (setf (flycheck-error-group copy) nil)
+ copy))
+
+(defun flycheck-ert-should-overlay (error)
+ "Test that ERROR has a proper overlay in the current buffer.
+
+ERROR is a Flycheck error object."
+ (let* ((overlay (-first (lambda (ov)
+ (equal (flycheck-error-without-group
+ (overlay-get ov 'flycheck-error))
+ (flycheck-error-without-group error)))
+ (flycheck-overlays-in 0 (+ 1 (buffer-size)))))
+ (region
+ ;; Overlays of errors from other files are on the first line
+ (if (flycheck-relevant-error-other-file-p error)
+ (cons (point-min)
+ (save-excursion (goto-char (point-min)) (point-at-eol)))
+ (flycheck-error-region-for-mode error 'symbols)))
+ (level (flycheck-error-level error))
+ (category (flycheck-error-level-overlay-category level))
+ (face (get category 'face))
+ (fringe-bitmap (flycheck-error-level-fringe-bitmap level))
+ (fringe-face (flycheck-error-level-fringe-face level))
+ (fringe-icon (list 'left-fringe fringe-bitmap fringe-face)))
+ (should overlay)
+ (should (overlay-get overlay 'flycheck-overlay))
+ (should (= (overlay-start overlay) (car region)))
+ (should (= (overlay-end overlay) (cdr region)))
+ (should (eq (overlay-get overlay 'face) face))
+ (should (equal (get-char-property 0 'display
+ (overlay-get overlay 'before-string))
+ fringe-icon))
+ (should (eq (overlay-get overlay 'category) category))
+ (should (equal (flycheck-error-without-group (overlay-get overlay
+ 'flycheck-error))
+ (flycheck-error-without-group error)))))
+
+(defun flycheck-ert-sort-errors (errors)
+ "Sort ERRORS by `flycheck-error-<'."
+ (seq-sort #'flycheck-error-< errors))
+
+(defun flycheck-ert-should-errors (&rest errors)
+ "Test that the current buffers has ERRORS.
+
+ERRORS is a list of errors expected to be present in the current
+buffer. Each error is given as a list of arguments to
+`flycheck-error-new-at'.
+
+If ERRORS are omitted, test that there are no errors at all in
+the current buffer.
+
+With ERRORS, test that each error in ERRORS is present in the
+current buffer, and that the number of errors in the current
+buffer is equal to the number of given ERRORS. In other words,
+check that the buffer has all ERRORS, and no other errors."
+ (let ((expected (flycheck-ert-sort-errors
+ (mapcar (apply-partially #'apply #'flycheck-error-new-at)
+ errors)))
+ (current (flycheck-ert-sort-errors flycheck-current-errors)))
+ (should (equal (mapcar #'flycheck-error-without-group expected)
+ (mapcar #'flycheck-error-without-group current)))
+ ;; Check that related errors are the same
+ (cl-mapcar
+ (lambda (err1 err2)
+ (should (equal (flycheck-ert-sort-errors
+ (mapcar #'flycheck-error-without-group
+ (flycheck-related-errors err1 expected)))
+ (flycheck-ert-sort-errors
+ (mapcar #'flycheck-error-without-group
+ (flycheck-related-errors err2))))))
+ expected current)
+ (mapc #'flycheck-ert-should-overlay expected))
+ (should (= (length errors)
+ (length (flycheck-overlays-in (point-min) (point-max))))))
+
+(define-error 'flycheck-ert-suspicious-checker "Suspicious state from checker")
+
+(defun flycheck-ert-should-syntax-check-in-buffer (&rest errors)
+ "Test a syntax check in BUFFER, expecting ERRORS.
+
+This is like `flycheck-ert-should-syntax-check', but with a
+buffer in the right mode instead of a file."
+ ;; Load safe file-local variables because some tests depend on them
+ (let ((enable-local-variables :safe)
+ ;; Disable all hooks at this place, to prevent 3rd party packages
+ ;; from interfering
+ (hack-local-variables-hook))
+ (hack-local-variables))
+ ;; Configure config file locating for unit tests
+ (let ((process-hook-called 0)
+ (suspicious nil))
+ (add-hook 'flycheck-process-error-functions
+ (lambda (_err)
+ (setq process-hook-called (1+ process-hook-called))
+ nil)
+ nil :local)
+ (add-hook 'flycheck-status-changed-functions
+ (lambda (status)
+ (when (eq status 'suspicious)
+ (setq suspicious t)))
+ nil :local)
+ (flycheck-ert-buffer-sync)
+ (when suspicious
+ (signal 'flycheck-ert-suspicious-checker nil))
+ (apply #'flycheck-ert-should-errors errors)
+ (should (= process-hook-called (length errors))))
+ (flycheck-ert-ensure-clear))
+
+(defun flycheck-ert-should-syntax-check (resource-file modes &rest errors)
+ "Test a syntax check in RESOURCE-FILE with MODES.
+
+RESOURCE-FILE is the file to check. MODES is a single major mode
+symbol or a list thereof, specifying the major modes to syntax
+check with. If more than one major mode is specified, the test
+is run for each mode separately, so if you give three major
+modes, the entire test will run three times. ERRORS is the list
+of expected errors, as in `flycheck-ert-should-errors'. If
+omitted, the syntax check must not emit any errors. The errors
+are cleared after each test.
+
+The syntax checker is selected via standard syntax checker
+selection. To test a specific checker, you need to set
+`flycheck-checker' or `flycheck-disabled-checkers' accordingly
+before using this predicate, depending on whether you want to use
+manual or automatic checker selection.
+
+During the syntax check, configuration files of syntax checkers
+are also searched in the `config-files' sub-directory of the
+resource directory."
+ (when (symbolp modes)
+ (setq modes (list modes)))
+ (dolist (mode modes)
+ (unless (fboundp mode)
+ (ert-skip (format "%S missing" mode)))
+ (flycheck-ert-with-resource-buffer resource-file
+ (funcall mode)
+ (apply #'flycheck-ert-should-syntax-check-in-buffer errors))))
+
+(defun flycheck-ert-at-nth-error (n)
+ "Determine whether point is at the N'th Flycheck error.
+
+Return non-nil if the point is at the N'th Flycheck error in the
+current buffer. Otherwise return nil."
+ (let* ((error (nth (1- n) flycheck-current-errors))
+ (mode flycheck-highlighting-mode)
+ (region (flycheck-error-region-for-mode error mode)))
+ (and (member error (flycheck-overlay-errors-at (point)))
+ (= (point) (car region)))))
+
+(defun flycheck-ert-explain--at-nth-error (n)
+ "Explain a failed at-nth-error predicate at N."
+ (let ((errors (flycheck-overlay-errors-at (point))))
+ (if (null errors)
+ (format "Expected to be at error %s, but no error at point %s"
+ n (point))
+ (let ((pos (cl-position (car errors) flycheck-current-errors)))
+ (format "Expected to be at point %s and error %s, \
+but point %s is at error %s"
+ (car (flycheck-error-region-for-mode
+ (nth (1- n) flycheck-current-errors)
+ flycheck-highlighting-mode))
+ n (point) (1+ pos))))))
+
+(put 'flycheck-ert-at-nth-error 'ert-explainer
+ 'flycheck-ert-explain--at-nth-error)
+
+(provide 'flycheck-ert)
+
+;;; flycheck-ert.el ends here
diff --git a/elpa/flycheck-20220314.27/flycheck-ert.elc b/elpa/flycheck-20220314.27/flycheck-ert.elc
new file mode 100644
index 0000000..b5b0ba3
--- /dev/null
+++ b/elpa/flycheck-20220314.27/flycheck-ert.elc
Binary files differ
diff --git a/elpa/flycheck-20220314.27/flycheck-pkg.el b/elpa/flycheck-20220314.27/flycheck-pkg.el
new file mode 100644
index 0000000..ac77424
--- /dev/null
+++ b/elpa/flycheck-20220314.27/flycheck-pkg.el
@@ -0,0 +1,16 @@
+(define-package "flycheck" "20220314.27" "On-the-fly syntax checking"
+ '((dash "2.12.1")
+ (pkg-info "0.4")
+ (let-alist "1.0.4")
+ (seq "1.11")
+ (emacs "24.3"))
+ :commit "278d0810f05eb03600d835c2bdd67d6b55a58034" :authors
+ '(("Sebastian Wiesner" . "swiesner@lunaryorn.com"))
+ :maintainer
+ '("Clément Pit-Claudel" . "clement.pitclaudel@live.com")
+ :keywords
+ '("convenience" "languages" "tools")
+ :url "http://www.flycheck.org")
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/elpa/flycheck-20220314.27/flycheck.el b/elpa/flycheck-20220314.27/flycheck.el
new file mode 100644
index 0000000..732f39e
--- /dev/null
+++ b/elpa/flycheck-20220314.27/flycheck.el
@@ -0,0 +1,12465 @@
+;;; flycheck.el --- On-the-fly syntax checking -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2017-2020 Flycheck contributors
+;; Copyright (C) 2012-2016 Sebastian Wiesner and Flycheck contributors
+;; Copyright (C) 2013, 2014 Free Software Foundation, Inc.
+;;
+;; Author: Sebastian Wiesner <swiesner@lunaryorn.com>
+;; Maintainer: Clément Pit-Claudel <clement.pitclaudel@live.com>
+;; fmdkdd <fmdkdd@gmail.com>
+;; URL: http://www.flycheck.org
+;; Keywords: convenience, languages, tools
+;; Version: 32-cvs
+;; Package-Requires: ((dash "2.12.1") (pkg-info "0.4") (let-alist "1.0.4") (seq "1.11") (emacs "24.3"))
+
+;; This file is not part of GNU Emacs.
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; On-the-fly syntax checking for GNU Emacs 24.
+;;
+;; Flycheck is a modern on-the-fly syntax checking extension for GNU Emacs,
+;; intended as replacement for the older Flymake extension which is part of GNU
+;; Emacs.
+;;
+;; Flycheck automatically checks buffers for errors while you type, and reports
+;; warnings and errors directly in the buffer and in an optional IDE-like error
+;; list.
+;;
+;; It comes with a rich interface for custom syntax checkers and other
+;; extensions, and has already many 3rd party extensions adding new features.
+;;
+;; Please read the online manual at http://www.flycheck.org for more
+;; information. You can open the manual directly from Emacs with `M-x
+;; flycheck-manual'.
+;;
+;; # Setup
+;;
+;; Flycheck works best on Unix systems. It does not officially support Windows,
+;; but tries to maintain Windows compatibility and should generally work fine on
+;; Windows, too.
+;;
+;; To enable Flycheck add the following to your init file:
+;;
+;; (add-hook 'after-init-hook #'global-flycheck-mode)
+;;
+;; Flycheck will then automatically check buffers in supported languages, as
+;; long as all necessary tools are present. Use `flycheck-verify-setup' to
+;; troubleshoot your Flycheck setup.
+
+;;; Code:
+
+(eval-when-compile
+ (require 'let-alist) ; `let-alist'
+ (require 'compile) ; Compile Mode integration
+ (require 'jka-compr) ; To inhibit compression of temp files
+ (require 'pcase) ; `pcase-dolist' (`pcase' itself is autoloaded)
+ )
+
+(require 'dash)
+
+(require 'seq) ; Sequence functions
+(require 'subr-x nil 'no-error) ; Additional utilities, Emacs 24.4 and upwards
+(require 'cl-lib) ; `cl-defstruct' and CL utilities
+(require 'tabulated-list) ; To list errors
+(require 'easymenu) ; Flycheck Mode menu definition
+(require 'rx) ; Regexp fanciness in `flycheck-define-checker'
+(require 'help-mode) ; `define-button-type'
+(require 'find-func) ; `find-function-regexp-alist'
+(require 'json) ; `flycheck-parse-tslint'
+(require 'ansi-color) ; `flycheck-parse-with-patterns-without-color'
+
+
+;; Declare a bunch of dynamic variables that we need from other modes
+(defvar sh-shell) ; For shell script checker predicates
+(defvar ess-language) ; For r-lintr predicate
+(defvar markdown-hide-markup) ;
+(defvar markdown-fontify-code-block-default-mode) ; For rust-error-explainer
+(defvar markdown-fontify-code-blocks-natively) ;
+
+;; Tell the byte compiler about autoloaded functions from packages
+(declare-function pkg-info-version-info "pkg-info" (package))
+
+
+;;; Compatibility
+(eval-and-compile
+ (unless (fboundp 'string-suffix-p)
+ ;; TODO: Remove when dropping support for Emacs 24.3 and earlier
+ (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))))))
+
+ (defalias 'flycheck--format-message
+ (if (fboundp 'format-message) #'format-message #'format))
+
+ ;; TODO: Remove when dropping support for Emacs 24.3 and earlier
+ (unless (featurep 'subr-x)
+ ;; `subr-x' function for Emacs 24.3 and below
+ (defsubst string-join (strings &optional separator)
+ "Join all STRINGS using SEPARATOR."
+ (mapconcat 'identity strings separator))
+
+ (defsubst string-trim-left (string)
+ "Remove leading whitespace from STRING."
+ (if (string-match "\\`[ \t\n\r]+" string)
+ (replace-match "" t t string)
+ string))
+
+ (defsubst string-trim-right (string)
+ "Remove trailing whitespace from STRING."
+ (if (string-match "[ \t\n\r]+\\'" string)
+ (replace-match "" t t string)
+ string))
+
+ (defsubst string-trim (string)
+ "Remove leading and trailing whitespace from STRING."
+ (string-trim-left (string-trim-right string)))
+
+ (defsubst string-empty-p (string)
+ "Check whether STRING is empty."
+ (string= string ""))))
+
+
+;;; Customization
+(defgroup flycheck nil
+ "Modern on-the-fly syntax checking for GNU Emacs."
+ :prefix "flycheck-"
+ :group 'tools
+ :link '(url-link :tag "Website" "http://www.flycheck.org")
+ :link '(url-link :tag "Github" "https://github.com/flycheck/flycheck"))
+
+(defgroup flycheck-config-files nil
+ "Configuration files for on-the-fly syntax checkers."
+ :prefix "flycheck-"
+ :group 'flycheck)
+
+(defgroup flycheck-options nil
+ "Options for on-the-fly syntax checkers."
+ :prefix "flycheck-"
+ :group 'flycheck)
+
+(defgroup flycheck-executables nil
+ "Executables of syntax checkers."
+ :prefix "flycheck-"
+ :group 'flycheck)
+
+(defgroup flycheck-faces nil
+ "Faces used by on-the-fly syntax checking."
+ :prefix "flycheck-"
+ :group 'flycheck)
+
+(defcustom flycheck-checkers
+ '(ada-gnat
+ asciidoctor
+ asciidoc
+ awk-gawk
+ bazel-buildifier
+ c/c++-clang
+ c/c++-gcc
+ c/c++-cppcheck
+ cfengine
+ chef-foodcritic
+ coffee
+ coffee-coffeelint
+ coq
+ css-csslint
+ css-stylelint
+ cuda-nvcc
+ cwl
+ d-dmd
+ dockerfile-hadolint
+ elixir-credo
+ emacs-lisp
+ emacs-lisp-checkdoc
+ ember-template
+ erlang-rebar3
+ erlang
+ eruby-erubis
+ eruby-ruumba
+ fortran-gfortran
+ go-gofmt
+ go-golint
+ go-vet
+ go-build
+ go-test
+ go-errcheck
+ go-unconvert
+ go-staticcheck
+ groovy
+ haml
+ handlebars
+ haskell-stack-ghc
+ haskell-ghc
+ haskell-hlint
+ html-tidy
+ javascript-eslint
+ javascript-jshint
+ javascript-standard
+ json-jsonlint
+ json-python-json
+ json-jq
+ jsonnet
+ less
+ less-stylelint
+ llvm-llc
+ lua-luacheck
+ lua
+ markdown-markdownlint-cli
+ markdown-mdl
+ nix
+ nix-linter
+ opam
+ perl
+ perl-perlcritic
+ php
+ php-phpmd
+ php-phpcs
+ processing
+ proselint
+ protobuf-protoc
+ protobuf-prototool
+ pug
+ puppet-parser
+ puppet-lint
+ python-flake8
+ python-pylint
+ python-pycompile
+ python-pyright
+ python-mypy
+ r-lintr
+ racket
+ rpm-rpmlint
+ rst-sphinx
+ rst
+ ruby-rubocop
+ ruby-standard
+ ruby-reek
+ ruby-rubylint
+ ruby
+ ruby-jruby
+ rust-cargo
+ rust
+ rust-clippy
+ scala
+ scala-scalastyle
+ scheme-chicken
+ scss-lint
+ scss-stylelint
+ sass/scss-sass-lint
+ sass
+ scss
+ sh-bash
+ sh-posix-dash
+ sh-posix-bash
+ sh-zsh
+ sh-shellcheck
+ slim
+ slim-lint
+ sql-sqlint
+ systemd-analyze
+ tcl-nagelfar
+ terraform
+ terraform-tflint
+ tex-chktex
+ tex-lacheck
+ texinfo
+ textlint
+ typescript-tslint
+ verilog-verilator
+ vhdl-ghdl
+ xml-xmlstarlet
+ xml-xmllint
+ yaml-jsyaml
+ yaml-ruby
+ yaml-yamllint)
+ "Syntax checkers available for automatic selection.
+
+A list of Flycheck syntax checkers to choose from when syntax
+checking a buffer. Flycheck will automatically select a suitable
+syntax checker from this list, unless `flycheck-checker' is set,
+either directly or with `flycheck-select-checker'.
+
+You should not need to change this variable normally. In order
+to disable syntax checkers, please use
+`flycheck-disabled-checkers'. This variable is intended for 3rd
+party extensions to tell Flycheck about new syntax checkers.
+
+Syntax checkers in this list must be defined with
+`flycheck-define-checker'."
+ :group 'flycheck
+ :type '(repeat (symbol :tag "Checker"))
+ :risky t)
+
+(defcustom flycheck-disabled-checkers nil
+ "Syntax checkers excluded from automatic selection.
+
+A list of Flycheck syntax checkers to exclude from automatic
+selection. Flycheck will never automatically select a syntax
+checker in this list, regardless of the value of
+`flycheck-checkers'.
+
+However, syntax checkers in this list are still available for
+manual selection with `flycheck-select-checker'.
+
+Use this variable to disable syntax checkers, instead of removing
+the syntax checkers from `flycheck-checkers'. You may also use
+this option as a file or directory local variable to disable
+specific checkers in individual files and directories
+respectively."
+ :group 'flycheck
+ :type '(repeat (symbol :tag "Checker"))
+ :package-version '(flycheck . "0.16")
+ :safe #'flycheck-symbol-list-p)
+(make-variable-buffer-local 'flycheck-disabled-checkers)
+
+(defvar-local flycheck--automatically-disabled-checkers nil
+ "List of syntax checkers automatically disabled for this buffer.
+
+A checker can be automatically disabled in two cases:
+
+1. Its `:enabled' predicate returned false.
+2. It returned too many errors (see `flycheck-checker-error-threshold').
+
+To trigger a reverification from Emacs Lisp code, do not modify
+this variable: use `flycheck-reset-enabled-checker'.")
+
+(defvar-local flycheck-checker nil
+ "Syntax checker to use for the current buffer.
+
+If unset or nil, automatically select a suitable syntax checker
+from `flycheck-checkers' on every syntax check.
+
+If set to a syntax checker only use this syntax checker and never
+select one from `flycheck-checkers' automatically. The syntax
+checker is used regardless of whether it is contained in
+`flycheck-checkers' or `flycheck-disabled-checkers'. If the
+syntax checker is unusable in the current buffer an error is
+signaled.
+
+A syntax checker assigned to this variable must be defined with
+`flycheck-define-checker'.
+
+Use the command `flycheck-select-checker' to select a syntax
+checker for the current buffer, or set this variable as file
+local variable to always use a specific syntax checker for a
+file. See Info Node `(Emacs)Specifying File Variables' for more
+information about file variables.")
+(put 'flycheck-checker 'safe-local-variable 'flycheck-registered-checker-p)
+
+(defcustom flycheck-locate-config-file-functions nil
+ "Functions to locate syntax checker configuration files.
+
+Each function in this hook must accept two arguments: The value
+of the configuration file variable, and the syntax checker
+symbol. It must return either a string with an absolute path to
+the configuration file, or nil, if it cannot locate the
+configuration file.
+
+The functions in this hook are called in order of appearance, until a
+function returns non-nil. The configuration file returned by that
+function is then given to the syntax checker if it exists.
+
+This variable is an abnormal hook. See Info
+node `(elisp)Hooks'."
+ :group 'flycheck
+ :type 'hook
+ :risky t)
+
+(defcustom flycheck-checker-error-threshold 400
+ "Maximum errors allowed per syntax checker.
+
+The value of this variable is either an integer denoting the
+maximum number of errors per syntax checker and buffer, or nil to
+not limit the errors reported from a syntax checker.
+
+If this variable is a number and a syntax checker reports more
+errors than the value of this variable, its errors are not
+discarded, and not highlighted in the buffer or available in the
+error list. The affected syntax checker is also disabled for
+future syntax checks of the buffer."
+ :group 'flycheck
+ :type '(choice (const :tag "Do not limit reported errors" nil)
+ (integer :tag "Maximum number of errors"))
+ :risky t
+ :package-version '(flycheck . "0.22"))
+
+(defcustom flycheck-process-error-functions nil
+ "Functions to process errors.
+
+Each function in this hook must accept a single argument: A
+Flycheck error to process.
+
+All functions in this hook are called in order of appearance,
+until a function returns non-nil. Thus, a function in this hook
+may return nil, to allow for further processing of the error, or
+any non-nil value, to indicate that the error was fully processed
+and inhibit any further processing.
+
+The functions are called for each newly parsed error immediately
+after the corresponding syntax checker finished. At this stage,
+the overlays from the previous syntax checks are still present,
+and there may be further syntax checkers in the chain.
+
+This variable is an abnormal hook. See Info
+node `(elisp)Hooks'."
+ :group 'flycheck
+ :type 'hook
+ :package-version '(flycheck . "0.13")
+ :risky t)
+
+(defcustom flycheck-display-errors-delay 0.9
+ "Delay in seconds before displaying errors at point.
+
+Use floating point numbers to express fractions of seconds."
+ :group 'flycheck
+ :type 'number
+ :package-version '(flycheck . "0.15")
+ :safe #'numberp)
+
+(defcustom flycheck-display-errors-function #'flycheck-display-error-messages
+ "Function to display error messages.
+
+If set to a function, call the function with the list of errors
+to display as single argument. Each error is an instance of the
+`flycheck-error' struct.
+
+If set to nil, do not display errors at all."
+ :group 'flycheck
+ :type '(choice (const :tag "Display error messages"
+ flycheck-display-error-messages)
+ (const :tag "Display error messages only if no error list"
+ flycheck-display-error-messages-unless-error-list)
+ (function :tag "Error display function"))
+ :package-version '(flycheck . "0.13")
+ :risky t)
+
+(defcustom flycheck-help-echo-function #'flycheck-help-echo-all-error-messages
+ "Function to compute the contents of the error tooltips.
+
+If set to a function, call the function with the list of errors
+to display as single argument. Each error is an instance of the
+`flycheck-error' struct. The function is used to set the
+help-echo property of flycheck error overlays. It should return
+a string, which is displayed when the user hovers over an error
+or presses \\[display-local-help].
+
+If set to nil, do not show error tooltips."
+ :group 'flycheck
+ :type '(choice (const :tag "Concatenate error messages to form a tooltip"
+ flycheck-help-echo-all-error-messages)
+ (function :tag "Help echo function"))
+ :package-version '(flycheck . "0.25")
+ :risky t)
+
+(defcustom flycheck-command-wrapper-function #'identity
+ "Function to modify checker commands before execution.
+
+The value of this option is a function which is given a list
+containing the full command of a syntax checker after
+substitution through `flycheck-substitute-argument' but before
+execution. The function may return a new command for Flycheck to
+execute.
+
+The default value is `identity' which does not change the
+command. You may provide your own function to run Flycheck
+commands through `bundle exec', `nix-shell' or similar wrappers."
+ :group 'flycheck
+ :type '(choice (const :tag "Do not modify commands" identity)
+ (function :tag "Modify command with a custom function"))
+ :package-version '(flycheck . "0.25")
+ :risky t)
+
+(defcustom flycheck-executable-find #'flycheck-default-executable-find
+ "Function to search for executables.
+
+The value of this option is a function which is given the name or
+path of an executable and shall return the full path to the
+executable, or nil if the executable does not exit.
+
+The default is `flycheck-default-executable-find', which searches
+variable `exec-path' when given a command name, and resolves
+paths to absolute ones. You can customize this option to search
+for checkers in other environments such as bundle or NixOS
+sandboxes."
+ :group 'flycheck
+ :type '(choice
+ (const :tag "Search executables in `exec-path'"
+ flycheck-default-executable-find)
+ (function :tag "Search executables with a custom function"))
+ :package-version '(flycheck . "32")
+ :risky t)
+
+(defun flycheck-default-executable-find (executable)
+ "Resolve EXECUTABLE to a full path.
+
+Like `executable-find', but supports relative paths.
+
+Attempts invoking `executable-find' first; if that returns nil,
+and EXECUTABLE contains a directory component, expands to a full
+path and tries invoking `executable-find' again."
+ ;; file-name-directory returns non-nil iff the given path has a
+ ;; directory component.
+ (or
+ (executable-find executable)
+ (when (file-name-directory executable)
+ (executable-find (expand-file-name executable)))))
+
+(defcustom flycheck-indication-mode 'left-fringe
+ "The indication mode for Flycheck errors.
+
+This variable controls how Flycheck indicates errors in buffers.
+May be `left-fringe', `right-fringe', `left-margin',
+`right-margin', or nil.
+
+If set to `left-fringe' or `right-fringe', indicate errors via
+icons in the left and right fringe respectively. If set to
+`left-margin' or `right-margin', use the margins instead.
+
+If set to nil, do not indicate errors and warnings, but just
+highlight them according to `flycheck-highlighting-mode'."
+ :group 'flycheck
+ :type '(choice (const :tag "Indicate in the left fringe" left-fringe)
+ (const :tag "Indicate in the right fringe" right-fringe)
+ (const :tag "Indicate in the left margin" left-margin)
+ (const :tag "Indicate in the right margin" right-margin)
+ (const :tag "Do not indicate" nil))
+ :safe #'symbolp)
+
+(defcustom flycheck-highlighting-mode 'symbols
+ "The highlighting mode for Flycheck errors and warnings.
+
+The highlighting mode controls how Flycheck highlights errors in
+buffers when a checker only reports the starting position of an
+error. The following modes are known:
+
+`columns'
+ Highlight a single character. If the error does not have a column,
+ highlight the whole line.
+
+`symbols'
+ Highlight a full symbol if there is any, otherwise behave like `columns'.
+ This is the default.
+
+`sexps'
+ Highlight a full expression, if there is any, otherwise behave like
+ `columns'. Note that this mode can be *very* slow in some major modes.
+
+`lines'
+ Highlight the whole line.
+
+nil
+ Do not highlight errors at all. However, errors will still
+ be reported in the mode line and in error message popups,
+ and indicated according to `flycheck-indication-mode'."
+ :group 'flycheck
+ :type '(choice (const :tag "Highlight columns only" columns)
+ (const :tag "Highlight symbols" symbols)
+ (const :tag "Highlight expressions" sexps)
+ (const :tag "Highlight whole lines" lines)
+ (const :tag "Do not highlight errors" nil))
+ :package-version '(flycheck . "0.14")
+ :safe #'symbolp)
+
+(defvar flycheck-current-errors)
+(defun flycheck-refresh-fringes-and-margins ()
+ "Refresh fringes and margins of all windows displaying the current buffer.
+
+If any errors are currently shown, launch a new check, to adjust
+to a potential new indication mode."
+ (dolist (win (get-buffer-window-list))
+ (set-window-margins win left-margin-width right-margin-width)
+ (set-window-fringes win left-fringe-width right-fringe-width))
+ (when flycheck-current-errors
+ (flycheck-buffer)))
+
+(defun flycheck-set-indication-mode (&optional mode)
+ "Set `flycheck-indication-mode' to MODE and adjust margins and fringes.
+
+When MODE is nil, adjust window parameters without changing the
+mode. This function can be useful as a `flycheck-mode-hook',
+especially if you use margins only in Flycheck buffers.
+
+When MODE is `left-margin', the left fringe is reduced to 1 pixel
+to save space."
+ (interactive (list (intern (completing-read
+ "Mode: " '("left-fringe" "right-fringe"
+ "left-margin" "right-margin")
+ nil t nil nil
+ (prin1-to-string flycheck-indication-mode)))))
+ (setq mode (or mode flycheck-indication-mode))
+ (pcase mode
+ ((or `left-fringe `right-fringe)
+ (setq left-fringe-width 8 right-fringe-width 8
+ left-margin-width 0 right-margin-width 0))
+ (`left-margin
+ (setq left-fringe-width 1 right-fringe-width 8
+ left-margin-width 1 right-margin-width 0))
+ (`right-margin
+ (setq left-fringe-width 8 right-fringe-width 8
+ left-margin-width 0 right-margin-width 1))
+ (_ (user-error "Invalid indication mode")))
+ (setq-local flycheck-indication-mode mode)
+ (flycheck-refresh-fringes-and-margins))
+
+(define-widget 'flycheck-highlighting-style 'lazy
+ "A value for `flycheck-highlighting-style'."
+ :offset 2
+ :format "%t: Use %v"
+ :type '(choice
+ :format "%[Value Menu%] %v"
+ (const :tag "no highlighting" nil)
+ (const :tag "a face indicating the error level" level-face)
+ (list :tag "a pair of delimiters"
+ (const :format "" delimiters)
+ (string :tag "Before")
+ (string :tag "After"))
+ (list :tag "a conditional mix of styles"
+ (const :format "" conditional)
+ (integer :tag "Up to this many lines")
+ (flycheck-highlighting-style :format "Use %v")
+ (flycheck-highlighting-style :format "Otherwise, use %v"))))
+
+(defun flycheck--make-highlighting-delimiter (char)
+ "Make a highlighting bracket symbol by repeating CHAR twice."
+ (compose-chars ?\s
+ ;; '(Bl . Br) ?\s
+ '(Bc Br 30 0) char
+ '(Bc Bl -30 0) char))
+
+(defcustom flycheck-highlighting-style
+ `(conditional 4 level-face (delimiters "" ""))
+ "The highlighting style for Flycheck errors and warnings.
+
+The highlighting style controls how Flycheck highlights error
+regions in buffers. The following styles are supported:
+
+nil
+ Do not highlight errors. Same as setting
+ `flycheck-highlighting-mode' to nil.
+
+`level-face'
+ Chose a face depending on the severity of the error, and
+ apply it to the whole error text. See also the
+ `flycheck-define-error-level' and `flycheck-error',
+ `flycheck-warning', and `flycheck-info' faces.
+
+\(`delimiters' BEFORE AFTER)
+ Draw delimiters on each side of the error. BEFORE and AFTER
+ indicate which delimiters to use. If they are strings, they
+ are used as-is. If they are characters, they are repeated
+ twice and composed into a single character. Delimiters use
+ the fringe face corresponding to the severity of each error,
+ as well as the `flycheck-error-delimiter' face. Delimited
+ text has the `flycheck-delimited-error' face.
+
+\(`conditional' NLINES S1 S2)
+ Use style S1 for errors spanning up to NLINES lines, and
+ style S2 otherwise.
+
+See also `flycheck-highlighting-mode' and
+`flycheck-indication-mode'."
+ :group 'flycheck
+ :type 'flycheck-highlighting-style
+ :package-version '(flycheck . "32")
+ :safe t)
+
+(defcustom flycheck-check-syntax-automatically '(save
+ idle-change
+ new-line
+ mode-enabled)
+ "When Flycheck should check syntax automatically.
+
+This variable is a list of events that may trigger syntax checks.
+The following events are known:
+
+`save'
+ Check syntax immediately after the buffer was saved.
+
+`idle-change'
+ Check syntax a short time (see `flycheck-idle-change-delay')
+ after the last change to the buffer.
+
+`idle-buffer-switch'
+ Check syntax a short time (see `flycheck-idle-buffer-switch-delay')
+ after the user switches to a buffer.
+
+`new-line'
+ Check syntax immediately after a new line was inserted into
+ the buffer.
+
+`mode-enabled'
+ Check syntax immediately when variable `flycheck-mode' is
+ non-nil.
+
+Flycheck performs a syntax checks only on events, which are
+contained in this list. For instance, if the value of this
+variable is `(mode-enabled save)', Flycheck will only check if
+the mode is enabled or the buffer was saved, but never after
+changes to the buffer contents.
+
+If nil, never check syntax automatically. In this case, use
+`flycheck-buffer' to start a syntax check manually."
+ :group 'flycheck
+ :type '(set (const :tag "After the buffer was saved" save)
+ (const :tag "After the buffer was changed and idle" idle-change)
+ (const
+ :tag "After switching the current buffer" idle-buffer-switch)
+ (const :tag "After a new line was inserted" new-line)
+ (const :tag "After `flycheck-mode' was enabled" mode-enabled))
+ :package-version '(flycheck . "0.12")
+ :safe #'flycheck-symbol-list-p)
+
+(defcustom flycheck-idle-change-delay 0.5
+ "How many seconds to wait after a change before checking syntax.
+
+After the buffer was changed, Flycheck will wait as many seconds
+as the value of this variable before starting a syntax check. If
+the buffer is modified during this time, Flycheck will wait
+again.
+
+This variable has no effect, if `idle-change' is not contained in
+`flycheck-check-syntax-automatically'."
+ :group 'flycheck
+ :type 'number
+ :package-version '(flycheck . "0.13")
+ :safe #'numberp)
+
+(defcustom flycheck-idle-buffer-switch-delay 0.5
+ "How many seconds to wait after switching buffers before checking syntax.
+
+After the user switches to a new buffer, Flycheck will wait as
+many seconds as the value of this variable before starting a
+syntax check. If the user switches to another buffer during this
+time, whether a syntax check is still performed depends on the
+value of `flycheck-buffer-switch-check-intermediate-buffers'.
+
+This variable has no effect if `idle-buffer-switch' is not
+contained in `flycheck-check-syntax-automatically'."
+ :group 'flycheck
+ :type 'number
+ :package-version '(flycheck . "32")
+ :safe #'numberp)
+
+(defcustom flycheck-buffer-switch-check-intermediate-buffers nil
+ "Whether to check syntax in a buffer you only visit briefly.
+
+If nil, then when you switch to a buffer but switch to another
+buffer before the syntax check is performed, then the check is
+canceled. If non-nil, then syntax checks due to switching
+buffers are always performed. This only affects buffer switches
+that happen less than `flycheck-idle-buffer-switch-delay' seconds
+apart.
+
+This variable has no effect if `idle-buffer-switch' is not
+contained in `flycheck-check-syntax-automatically'."
+ :group 'flycheck
+ :type 'boolean
+ :package-version '(flycheck . "32")
+ :safe #'booleanp)
+
+(defcustom flycheck-standard-error-navigation t
+ "Whether to support error navigation with `next-error'.
+
+If non-nil, enable navigation of Flycheck errors with
+`next-error', `previous-error' and `first-error'. Otherwise,
+these functions just navigate errors from compilation modes.
+
+Flycheck error navigation with `flycheck-next-error',
+`flycheck-previous-error' and `flycheck-first-error' is always
+enabled, regardless of the value of this variable.
+
+Note that this setting only takes effect when variable
+`flycheck-mode' is non-nil. Changing it will not affect buffers
+where variable `flycheck-mode' is already non-nil."
+ :group 'flycheck
+ :type 'boolean
+ :package-version '(flycheck . "0.15")
+ :safe #'booleanp)
+
+(define-widget 'flycheck-minimum-level 'lazy
+ "A radio-type choice of minimum error levels.
+
+See `flycheck-navigation-minimum-level' and
+`flycheck-error-list-minimum-level'."
+ :type '(radio (const :tag "All locations" nil)
+ (const :tag "Informational messages" info)
+ (const :tag "Warnings" warning)
+ (const :tag "Errors" error)
+ (symbol :tag "Custom error level")))
+
+(defcustom flycheck-navigation-minimum-level nil
+ "The minimum level of errors to navigate.
+
+If set to an error level, only navigate errors whose error level
+is at least as severe as this one. If nil, navigate all errors."
+ :group 'flycheck
+ :type 'flycheck-minimum-level
+ :safe #'flycheck-error-level-p
+ :package-version '(flycheck . "0.21"))
+
+(defcustom flycheck-error-list-minimum-level nil
+ "The minimum level of errors to display in the error list.
+
+If set to an error level, only display errors whose error level
+is at least as severe as this one in the error list. If nil,
+display all errors.
+
+This is the default level, used when the error list is opened.
+You can temporarily change the level using
+\\[flycheck-error-list-set-filter], or reset it to this value
+using \\[flycheck-error-list-reset-filter]."
+ :group 'flycheck
+ :type 'flycheck-minimum-level
+ :safe #'flycheck-error-level-p
+ :package-version '(flycheck . "0.24"))
+
+(defcustom flycheck-relevant-error-other-file-minimum-level 'error
+ "The minimum level of errors from other files to display in this buffer.
+
+If set to an error level, only display errors from other files
+whose error level is at least as severe as this one. If nil,
+display all errors from other files."
+ :group 'flycheck
+ :type 'flycheck-minimum-level
+ :safe #'flycheck-error-level-p
+ :package-version '(flycheck . "32"))
+
+(defcustom flycheck-relevant-error-other-file-show t
+ "Whether to show errors from other files."
+ :group 'flycheck
+ :type 'boolean
+ :package-version '(flycheck . "32")
+ :safe #'booleanp)
+
+(defcustom flycheck-completing-read-function #'completing-read
+ "Function to read from minibuffer with completion.
+
+The function must be compatible to the built-in `completing-read'
+function."
+ :group 'flycheck
+ :type '(choice (const :tag "Default" completing-read)
+ (const :tag "IDO" ido-completing-read)
+ (function :tag "Custom function"))
+ :risky t
+ :package-version '(flycheck . "26"))
+
+(defcustom flycheck-temp-prefix "flycheck"
+ "Prefix for temporary files created by Flycheck."
+ :group 'flycheck
+ :type 'string
+ :package-version '(flycheck . "0.19")
+ :risky t)
+
+(defcustom flycheck-mode-hook nil
+ "Hooks to run after command `flycheck-mode' is toggled."
+ :group 'flycheck
+ :type 'hook
+ :risky t)
+
+(defcustom flycheck-after-syntax-check-hook nil
+ "Functions to run after each syntax check.
+
+This hook is run after a syntax check was finished.
+
+At this point, *all* chained checkers were run, and all errors
+were parsed, highlighted and reported. The variable
+`flycheck-current-errors' contains all errors from all syntax
+checkers run during the syntax check, so you can apply any error
+analysis functions.
+
+Note that this hook does *not* run after each individual syntax
+checker in the syntax checker chain, but only after the *last
+checker*.
+
+This variable is a normal hook. See Info node `(elisp)Hooks'."
+ :group 'flycheck
+ :type 'hook
+ :risky t)
+
+(defcustom flycheck-before-syntax-check-hook nil
+ "Functions to run before each syntax check.
+
+This hook is run right before a syntax check starts.
+
+Error information from the previous syntax check is *not*
+cleared before this hook runs.
+
+Note that this hook does *not* run before each individual syntax
+checker in the syntax checker chain, but only before the *first
+checker*.
+
+This variable is a normal hook. See Info node `(elisp)Hooks'."
+ :group 'flycheck
+ :type 'hook
+ :risky t)
+
+(defcustom flycheck-syntax-check-failed-hook nil
+ "Functions to run if a syntax check failed.
+
+This hook is run whenever an error occurs during Flycheck's
+internal processing. No information about the error is given to
+this hook.
+
+You should use this hook to conduct additional cleanup actions
+when Flycheck failed.
+
+This variable is a normal hook. See Info node `(elisp)Hooks'."
+ :group 'flycheck
+ :type 'hook
+ :risky t)
+
+(defcustom flycheck-status-changed-functions nil
+ "Functions to run if the Flycheck status changed.
+
+This hook is run whenever the status of Flycheck changes. Each
+hook function takes the status symbol as single argument, as
+given to `flycheck-report-status', which see.
+
+This variable is an abnormal hook. See Info
+node `(elisp)Hooks'."
+ :group 'flycheck
+ :type 'hook
+ :risky t
+ :package-version '(flycheck . "0.20"))
+
+(defcustom flycheck-error-list-after-refresh-hook nil
+ "Functions to run after the error list was refreshed.
+
+This hook is run whenever the error list is refreshed.
+
+This variable is a normal hook. See Info node `(elisp)Hooks'."
+ :group 'flycheck
+ :type 'hook
+ :risky t
+ :package-version '(flycheck . "0.21"))
+
+(defface flycheck-error-delimiter
+ `((t))
+ "Flycheck face for errors spanning multiple lines.
+
+See `flycheck-highlighting-style' for details on when this face
+is used."
+ :package-version '(flycheck . "32")
+ :group 'flycheck-faces)
+
+(defface flycheck-delimited-error
+ `((t))
+ "Flycheck face for errors spanning multiple lines.
+
+See `flycheck-highlighting-style' for details on when this face
+is used."
+ :package-version '(flycheck . "32")
+ :group 'flycheck-faces)
+
+(defface flycheck-error
+ '((((supports :underline (:style wave)))
+ :underline (:style wave :color "Red1"))
+ (t
+ :underline t :inherit error))
+ "Flycheck face for errors."
+ :package-version '(flycheck . "0.13")
+ :group 'flycheck-faces)
+
+(defface flycheck-warning
+ '((((supports :underline (:style wave)))
+ :underline (:style wave :color "DarkOrange"))
+ (t
+ :underline t :inherit warning))
+ "Flycheck face for warnings."
+ :package-version '(flycheck . "0.13")
+ :group 'flycheck-faces)
+
+(defface flycheck-info
+ '((((supports :underline (:style wave)))
+ :underline (:style wave :color "ForestGreen"))
+ (t
+ :underline t :inherit success))
+ "Flycheck face for informational messages."
+ :package-version '(flycheck . "0.15")
+ :group 'flycheck-faces)
+
+(defface flycheck-fringe-error
+ '((t :inherit error))
+ "Flycheck face for fringe error indicators."
+ :package-version '(flycheck . "0.13")
+ :group 'flycheck-faces)
+
+(defface flycheck-fringe-warning
+ '((t :inherit warning))
+ "Flycheck face for fringe warning indicators."
+ :package-version '(flycheck . "0.13")
+ :group 'flycheck-faces)
+
+(defface flycheck-fringe-info
+ ;; Semantically `success' is probably not the right face, but it looks nice as
+ ;; a base face
+ '((t :inherit success))
+ "Flycheck face for fringe info indicators."
+ :package-version '(flycheck . "0.15")
+ :group 'flycheck-faces)
+
+(defface flycheck-error-list-error
+ '((t :inherit error))
+ "Flycheck face for error messages in the error list."
+ :package-version '(flycheck . "0.16")
+ :group 'flycheck-faces)
+
+(defface flycheck-error-list-warning
+ '((t :inherit warning))
+ "Flycheck face for warning messages in the error list."
+ :package-version '(flycheck . "0.16")
+ :group 'flycheck-faces)
+
+(defface flycheck-error-list-info
+ '((t :inherit success))
+ "Flycheck face for info messages in the error list."
+ :package-version '(flycheck . "0.16")
+ :group 'flycheck-faces)
+
+(defface flycheck-error-list-line-number
+ '((t))
+ "Face for line numbers in the error list."
+ :group 'flycheck-faces
+ :package-version '(flycheck . "0.16"))
+
+(defface flycheck-error-list-column-number
+ '((t))
+ "Face for line numbers in the error list."
+ :group 'flycheck-faces
+ :package-version '(flycheck . "0.16"))
+
+(defface flycheck-error-list-filename
+ '((t :inherit mode-line-buffer-id :bold nil))
+ "Face for filenames in the error list."
+ :group 'flycheck-faces
+ :package-version '(flycheck . "32"))
+
+(defface flycheck-error-list-id
+ '((t :inherit font-lock-type-face))
+ "Face for the error ID in the error list."
+ :group 'flycheck-faces
+ :package-version '(flycheck . "0.22"))
+
+(defface flycheck-error-list-id-with-explainer
+ '((t :inherit flycheck-error-list-id
+ :box (:style released-button)))
+ "Face for the error ID in the error list, for errors that have an explainer."
+ :group 'flycheck-faces
+ :package-version '(flycheck . "30"))
+
+(defface flycheck-error-list-checker-name
+ '((t :inherit font-lock-function-name-face))
+ "Face for the syntax checker name in the error list."
+ :group 'flycheck-faces
+ :package-version '(flycheck . "0.21"))
+
+(defface flycheck-error-list-error-message
+ '((t))
+ "Face for the error message in the error list."
+ :group 'flycheck-faces
+ :package-version '(flycheck . "33"))
+
+(defface flycheck-error-list-highlight
+ '((t :bold t))
+ "Flycheck face to highlight errors in the error list."
+ :package-version '(flycheck . "0.15")
+ :group 'flycheck-faces)
+
+(defface flycheck-verify-select-checker
+ '((t :box (:style released-button)))
+ "Flycheck face for the 'select' button in the verify setup buffer."
+ :package-version '(flycheck . "32")
+ :group 'flycheck-faces)
+
+(defvar flycheck-command-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "c" #'flycheck-buffer)
+ (define-key map "C" #'flycheck-clear)
+ (define-key map (kbd "C-c") #'flycheck-compile)
+ (define-key map "n" #'flycheck-next-error)
+ (define-key map "p" #'flycheck-previous-error)
+ (define-key map "l" #'flycheck-list-errors)
+ (define-key map (kbd "C-w") #'flycheck-copy-errors-as-kill)
+ (define-key map "s" #'flycheck-select-checker)
+ (define-key map "?" #'flycheck-describe-checker)
+ (define-key map "h" #'flycheck-display-error-at-point)
+ (define-key map "e" #'flycheck-explain-error-at-point)
+ (define-key map "H" #'display-local-help)
+ (define-key map "i" #'flycheck-manual)
+ (define-key map "V" #'flycheck-version)
+ (define-key map "v" #'flycheck-verify-setup)
+ (define-key map "x" #'flycheck-disable-checker)
+ map)
+ "Keymap of Flycheck interactive commands.")
+
+(defcustom flycheck-keymap-prefix (kbd "C-c !")
+ "Prefix for key bindings of Flycheck.
+
+Changing this variable outside Customize does not have any
+effect. To change the keymap prefix from Lisp, you need to
+explicitly re-define the prefix key:
+
+ (define-key flycheck-mode-map flycheck-keymap-prefix nil)
+ (setq flycheck-keymap-prefix (kbd \"C-c f\"))
+ (define-key flycheck-mode-map flycheck-keymap-prefix
+ flycheck-command-map)
+
+Please note that Flycheck's manual documents the default
+keybindings. Changing this variable is at your own risk."
+ :group 'flycheck
+ :package-version '(flycheck . "0.19")
+ :type 'string
+ :risky t
+ :set
+ (lambda (variable key)
+ (when (and (boundp variable) (boundp 'flycheck-mode-map))
+ (define-key flycheck-mode-map (symbol-value variable) nil)
+ (define-key flycheck-mode-map key flycheck-command-map))
+ (set-default variable key)))
+
+(defcustom flycheck-mode-line '(:eval (flycheck-mode-line-status-text))
+ "Mode line lighter for Flycheck.
+
+The value of this variable is a mode line template as in
+`mode-line-format'. See Info Node `(elisp)Mode Line Format' for
+more information. Note that it should contain a _single_ mode
+line construct only.
+
+Customize this variable to change how Flycheck reports its status
+in the mode line. You may use `flycheck-mode-line-status-text'
+to obtain a human-readable status text, including an
+error/warning count.
+
+You may also assemble your own status text. The current status
+of Flycheck is available in `flycheck-last-status-change'. The
+errors in the current buffer are stored in
+`flycheck-current-errors', and the function
+`flycheck-count-errors' may be used to obtain the number of
+errors grouped by error level.
+
+Set this variable to nil to disable the mode line completely."
+ :group 'flycheck
+ :type 'sexp
+ :risky t
+ :package-version '(flycheck . "0.20"))
+
+(defcustom flycheck-mode-line-prefix "FlyC"
+ "Base mode line lighter for Flycheck.
+
+This will have an effect only with the default
+`flycheck-mode-line'.
+
+If you've customized `flycheck-mode-line' then the customized
+function must be updated to use this variable."
+ :group 'flycheck
+ :type 'string
+ :package-version '(flycheck . "26"))
+
+(defcustom flycheck-error-list-mode-line
+ `(,(propertized-buffer-identification "%12b")
+ " for buffer "
+ (:eval (flycheck-error-list-propertized-source-name))
+ (:eval (flycheck-error-list-mode-line-filter-indicator)))
+ "Mode line construct for Flycheck error list.
+
+The value of this variable is a mode line template as in
+`mode-line-format', to be used as
+`mode-line-buffer-identification' in `flycheck-error-list-mode'.
+See Info Node `(elisp)Mode Line Format' for more information.
+
+Customize this variable to change how the error list appears in
+the mode line. The default shows the name of the buffer and the
+name of the source buffer, i.e. the buffer whose errors are
+currently listed."
+ :group 'flycheck
+ :type 'sexp
+ :risky t
+ :package-version '(flycheck . "0.20"))
+
+(defcustom flycheck-global-modes t
+ "Modes for which option `flycheck-mode' is turned on.
+
+If t, Flycheck Mode is turned on for all major modes. If a list,
+Flycheck Mode is turned on for all `major-mode' symbols in that
+list. If the `car' of the list is `not', Flycheck Mode is turned
+on for all `major-mode' symbols _not_ in that list. If nil,
+Flycheck Mode is never turned on by command
+`global-flycheck-mode'.
+
+Note that Flycheck is never turned on for modes whose
+`mode-class' property is `special' (see Info node `(elisp)Major
+Mode Conventions'), regardless of the value of this option.
+
+Only has effect when variable `global-flycheck-mode' is non-nil."
+ :group 'flycheck
+ :type '(choice (const :tag "none" nil)
+ (const :tag "all" t)
+ (set :menu-tag "mode specific" :tag "modes"
+ :value (not)
+ (const :tag "Except" not)
+ (repeat :inline t (symbol :tag "mode"))))
+ :risky t
+ :package-version '(flycheck . "0.23"))
+
+;; Add built-in functions to our hooks, via `add-hook', to make sure that our
+;; functions are really present, even if the variable was implicitly defined by
+;; another call to `add-hook' that occurred before Flycheck was loaded. See
+;; http://lists.gnu.org/archive/html/emacs-devel/2015-02/msg01271.html for why
+;; we don't initialize the hook variables right away. We append our own
+;; functions, because a user likely expects that their functions come first,
+;; even if they added them before Flycheck was loaded.
+(dolist (hook (list #'flycheck-locate-config-file-by-path
+ #'flycheck-locate-config-file-ancestor-directories
+ #'flycheck-locate-config-file-home))
+ (add-hook 'flycheck-locate-config-file-functions hook 'append))
+
+(add-hook 'flycheck-process-error-functions #'flycheck-add-overlay 'append)
+
+
+;;; Global Flycheck menu
+(defvar flycheck-mode-menu-map
+ (easy-menu-create-menu
+ "Syntax Checking"
+ '(["Enable on-the-fly syntax checking" flycheck-mode
+ :style toggle :selected flycheck-mode
+ :enable (or flycheck-mode
+ ;; Don't let users toggle the mode if there is no syntax
+ ;; checker for this buffer
+ (seq-find #'flycheck-checker-supports-major-mode-p
+ flycheck-checkers))]
+ ["Check current buffer" flycheck-buffer flycheck-mode]
+ ["Clear errors in buffer" flycheck-clear t]
+ "---"
+ ["Go to next error" flycheck-next-error flycheck-mode]
+ ["Go to previous error" flycheck-previous-error flycheck-mode]
+ ["Show all errors" flycheck-list-errors flycheck-mode]
+ "---"
+ ["Copy messages at point" flycheck-copy-errors-as-kill
+ (flycheck-overlays-at (point))]
+ ["Explain error at point" flycheck-explain-error-at-point]
+ "---"
+ ["Select syntax checker" flycheck-select-checker flycheck-mode]
+ ["Disable syntax checker" flycheck-disable-checker flycheck-mode]
+ ["Set executable of syntax checker" flycheck-set-checker-executable
+ flycheck-mode]
+ "---"
+ ["Describe syntax checker" flycheck-describe-checker t]
+ ["Verify setup" flycheck-verify-setup t]
+ ["Show Flycheck version" flycheck-version t]
+ ["Read the Flycheck manual" flycheck-info t]))
+ "Menu of command `flycheck-mode'.")
+
+(easy-menu-add-item nil '("Tools") flycheck-mode-menu-map "Spell Checking")
+
+
+;;; Version information, manual and loading of Flycheck
+(defun flycheck-version (&optional show-version)
+ "Get the Flycheck version as string.
+
+If called interactively or if SHOW-VERSION is non-nil, show the
+version in the echo area and the messages buffer.
+
+The returned string includes both, the version from package.el
+and the library version, if both a present and different.
+
+If the version number could not be determined, signal an error,
+if called interactively, or if SHOW-VERSION is non-nil, otherwise
+just return nil."
+ (interactive (list t))
+ (let ((version (pkg-info-version-info 'flycheck)))
+ (when show-version
+ (message "Flycheck version: %s" version))
+ version))
+
+(defun flycheck-unload-function ()
+ "Unload function for Flycheck."
+ (global-flycheck-mode -1)
+ (easy-menu-remove-item nil '("Tools") (cadr flycheck-mode-menu-map))
+ (remove-hook 'kill-emacs-hook #'flycheck-global-teardown)
+ (setq find-function-regexp-alist
+ (assq-delete-all 'flycheck-checker find-function-regexp-alist)))
+
+;;;###autoload
+(defun flycheck-manual ()
+ "Open the Flycheck manual."
+ (interactive)
+ (browse-url "http://www.flycheck.org"))
+
+(define-obsolete-function-alias 'flycheck-info
+ 'flycheck-manual "Flycheck 26" "Open the Flycheck manual.")
+
+
+;;; Utility functions
+(defun flycheck-sexp-to-string (sexp)
+ "Convert SEXP to a string.
+
+Like `prin1-to-string' but ensure that the returned string
+is loadable."
+ (let ((print-quoted t)
+ (print-length nil)
+ (print-level nil))
+ (prin1-to-string sexp)))
+
+(defun flycheck-string-to-number-safe (string)
+ "Safely convert STRING to a number.
+
+If STRING is of string type and a numeric string, convert STRING
+to a number and return it. Otherwise return nil."
+ (let ((number-re (rx string-start (one-or-more (any digit)) string-end)))
+ (when (and (stringp string) (string-match-p number-re string))
+ (string-to-number string))))
+
+(defun flycheck-string-or-nil-p (obj)
+ "Determine if OBJ is a string or nil."
+ (or (null obj) (stringp obj)))
+
+(defun flycheck-string-list-p (obj)
+ "Determine if OBJ is a list of strings."
+ (and (listp obj) (seq-every-p #'stringp obj)))
+
+(defun flycheck-string-or-string-list-p (obj)
+ "Determine if OBJ is a string or a list of strings."
+ (or (stringp obj) (flycheck-string-list-p obj)))
+
+(defun flycheck-symbol-list-p (obj)
+ "Determine if OBJ is a list of symbols."
+ (and (listp obj) (seq-every-p #'symbolp obj)))
+
+(defvar-local flycheck--file-truename-cache nil)
+
+(defun flycheck--file-truename (file)
+ "Memoize the result of `file-truename' on (directory-file-name FILE)."
+ ;; `file-truename' is slow, but alternatives are incomplete, so memoizing is
+ ;; our best bet. See https://github.com/flycheck/flycheck/pull/1698.
+ (unless flycheck--file-truename-cache
+ (setq-local flycheck--file-truename-cache (make-hash-table :test 'equal)))
+ (or (gethash file flycheck--file-truename-cache)
+ (puthash file (file-truename (directory-file-name file))
+ flycheck--file-truename-cache)))
+
+(defun flycheck-same-files-p (file-a file-b)
+ "Determine whether FILE-A and FILE-B refer to the same file.
+
+Files are the same if (in the order checked) they are equal, or
+if they resolve to the same canonical paths."
+ (or (string= file-a file-b)
+ (string= (flycheck--file-truename file-a)
+ (flycheck--file-truename file-b))))
+
+(defvar-local flycheck-temporaries nil
+ "Temporary files and directories created by Flycheck.")
+
+(defun flycheck-temp-dir-system ()
+ "Create a unique temporary directory.
+
+Use `flycheck-temp-prefix' as prefix, and add the directory to
+`flycheck-temporaries'.
+
+Return the path of the directory"
+ (let* ((tempdir (make-temp-file flycheck-temp-prefix 'directory)))
+ (push tempdir flycheck-temporaries)
+ tempdir))
+
+(defun flycheck-temp-file-system (filename &optional suffix)
+ "Create a temporary file named after FILENAME.
+
+If FILENAME is non-nil, this function creates a temporary
+directory with `flycheck-temp-dir-system', and creates a file
+with the same name as FILENAME in this directory.
+
+Otherwise this function creates a temporary file starting with
+`flycheck-temp-prefix'. If present, SUFFIX is appended;
+otherwise, a random suffix is used. The path of the file is
+added to `flycheck-temporaries'.
+
+Return the path of the file."
+ (let ((tempfile (convert-standard-filename
+ (if filename
+ (expand-file-name (file-name-nondirectory filename)
+ (flycheck-temp-dir-system))
+ (make-temp-file flycheck-temp-prefix nil suffix)))))
+ (push tempfile flycheck-temporaries)
+ tempfile))
+
+(defun flycheck-temp-file-inplace (filename &optional suffix)
+ "Create an in-place copy of FILENAME.
+
+Prefix the file with `flycheck-temp-prefix' and add the path of
+the file to `flycheck-temporaries'.
+
+If FILENAME is nil, fall back to `flycheck-temp-file-system' with
+the specified SUFFIX.
+
+Return the path of the file."
+ (if filename
+ (let* ((tempname (format "%s_%s"
+ flycheck-temp-prefix
+ (file-name-nondirectory filename)))
+ (tempfile (convert-standard-filename
+ (expand-file-name tempname
+ (file-name-directory filename)))))
+ (push tempfile flycheck-temporaries)
+ tempfile)
+ (flycheck-temp-file-system filename suffix)))
+
+(defun flycheck-temp-directory (checker)
+ "Return the directory where CHECKER writes temporary files.
+
+Return nil if the CHECKER does not write temporary files."
+ (let ((args (flycheck-checker-arguments checker)))
+ (cond
+ ((memq 'source args) temporary-file-directory)
+ ((memq 'source-inplace args)
+ (if buffer-file-name (file-name-directory buffer-file-name)
+ temporary-file-directory))
+ (t nil))))
+
+(defun flycheck-temp-files-writable-p (checker)
+ "Whether CHECKER can write temporary files.
+
+If CHECKER has `source' or `source-inplace' in its `:command',
+return whether flycheck has the permissions to create the
+respective temporary files.
+
+Return t if CHECKER does not use temporary files."
+ (let ((dir (flycheck-temp-directory checker)))
+ (or (not dir) (file-writable-p dir))))
+
+(defun flycheck-save-buffer-to-file (file-name)
+ "Save the contents of the current buffer to FILE-NAME."
+ (make-directory (file-name-directory file-name) t)
+ (let ((jka-compr-inhibit t))
+ (write-region nil nil file-name nil 0)))
+
+(defun flycheck-save-buffer-to-temp (temp-file-fn)
+ "Save buffer to temp file returned by TEMP-FILE-FN.
+
+Return the name of the temporary file."
+ (let ((filename (funcall temp-file-fn (buffer-file-name))))
+ ;; Do not flush short-lived temporary files onto disk
+ (let ((write-region-inhibit-fsync t))
+ (flycheck-save-buffer-to-file filename))
+ filename))
+
+(defun flycheck-prepend-with-option (option items &optional prepend-fn)
+ "Prepend OPTION to each item in ITEMS, using PREPEND-FN.
+
+Prepend OPTION to each item in ITEMS.
+
+ITEMS is a list of strings to pass to the syntax checker. OPTION
+is the option, as string. PREPEND-FN is a function called to
+prepend OPTION to each item in ITEMS. It receives the option and
+a single item from ITEMS as argument, and must return a string or
+a list of strings with OPTION prepended to the item. If
+PREPEND-FN is nil or omitted, use `list'.
+
+Return a list of strings where OPTION is prepended to each item
+in ITEMS using PREPEND-FN. If PREPEND-FN returns a list, it is
+spliced into the resulting list."
+ (unless (stringp option)
+ (error "Option %S is not a string" option))
+ (unless prepend-fn
+ (setq prepend-fn #'list))
+ (let ((prepend
+ (lambda (item)
+ (let ((result (funcall prepend-fn option item)))
+ (cond
+ ((and (listp result) (seq-every-p #'stringp result)) result)
+ ((stringp result) (list result))
+ (t (error "Invalid result type for option: %S" result)))))))
+ (apply #'append (seq-map prepend items))))
+
+(defun flycheck-find-in-buffer (pattern)
+ "Find PATTERN in the current buffer.
+
+Return the result of the first matching group of PATTERN, or nil,
+if PATTERN did not match."
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (when (re-search-forward pattern nil 'no-error)
+ (match-string-no-properties 1)))))
+
+(defun flycheck-buffer-empty-p (&optional buffer)
+ "Check whether a BUFFER is empty, defaulting to the current one."
+ (= (buffer-size buffer) 0))
+
+(defun flycheck-buffer-nonempty-p (&optional buffer)
+ "Check whether a BUFFER is nonempty, defaulting to the current one."
+ (> (buffer-size buffer) 0))
+
+(defun flycheck-ephemeral-buffer-p ()
+ "Determine whether the current buffer is an ephemeral buffer.
+
+See Info node `(elisp)Buffer Names' for information about
+ephemeral buffers."
+ (string-prefix-p " " (buffer-name)))
+
+(defun flycheck-encrypted-buffer-p ()
+ "Determine whether the current buffer is an encrypted file.
+
+See Info node `(epa)Top' for Emacs' interface to encrypted
+files."
+ ;; The EPA file handler sets this variable locally to remember the recipients
+ ;; of the encrypted file for re-encryption. Hence, a local binding of this
+ ;; variable is a good indication that the buffer is encrypted. I haven't
+ ;; found any better indicator anyway.
+ (local-variable-p 'epa-file-encrypt-to))
+
+(defun flycheck-autoloads-file-p ()
+ "Determine whether the current buffer is an autoloads file.
+
+Autoloads are generated by package.el during installation."
+ (string-suffix-p "-autoloads.el" (buffer-name)))
+
+(defun flycheck-in-user-emacs-directory-p (filename)
+ "Whether FILENAME is in `user-emacs-directory'."
+ (string-prefix-p (file-name-as-directory
+ (flycheck--file-truename user-emacs-directory))
+ (flycheck--file-truename filename)))
+
+(defun flycheck-safe-delete (file-or-dir)
+ "Safely delete FILE-OR-DIR."
+ (ignore-errors
+ (if (file-directory-p file-or-dir)
+ (delete-directory file-or-dir 'recursive)
+ (delete-file file-or-dir))))
+
+(defun flycheck-safe-delete-temporaries ()
+ "Safely delete all temp files and directories of Flycheck.
+
+Safely delete all files and directories listed in
+`flycheck-temporaries' and set the variable's value to nil."
+ (seq-do #'flycheck-safe-delete flycheck-temporaries)
+ (setq flycheck-temporaries nil))
+
+(defun flycheck-rx-file-name (form)
+ "Translate the `(file-name)' FORM into a regular expression."
+ (let ((body (or (cdr form) '((minimal-match
+ (one-or-more not-newline))))))
+ (rx-to-string `(group-n 1 ,@body) t)))
+
+(defun flycheck-rx-message (form)
+ "Translate the `(message)' FORM into a regular expression."
+ (let ((body (or (cdr form) '((one-or-more not-newline)))))
+ (rx-to-string `(group-n 4 ,@body) t)))
+
+(defun flycheck-rx-id (form)
+ "Translate the `(id)' FORM into a regular expression."
+ (rx-to-string `(group-n 5 ,@(cdr form)) t))
+
+(defun flycheck-rx-to-string (form &optional no-group)
+ "Like `rx-to-string' for FORM, but with special keywords:
+
+`line'
+ matches the initial line number.
+
+`column'
+ matches the initial column number.
+
+`end-line'
+ matches the final line number.
+
+`end-column'
+ matches the final column number (exclusive).
+
+
+`(file-name SEXP ...)'
+ matches the file name. SEXP describes the file name. If no
+ SEXP is given, use a default body of `(minimal-match
+ (one-or-more not-newline))'.
+
+`(message SEXP ...)'
+ matches the message. SEXP constitutes the body of the
+ message. If no SEXP is given, use a default body
+ of `(one-or-more not-newline)'.
+
+`(id SEXP ...)'
+ matches an error ID. SEXP describes the ID.
+
+NO-GROUP is passed to `rx-to-string'.
+
+See `rx' for a complete list of all built-in `rx' forms."
+ (let ((rx-constituents
+ (append
+ `((file-name flycheck-rx-file-name 0 nil) ;; group 1
+ (line . ,(rx (group-n 2 (one-or-more digit))))
+ (column . ,(rx (group-n 3 (one-or-more digit))))
+ (message flycheck-rx-message 0 nil) ;; group 4
+ (id flycheck-rx-id 0 nil) ;; group 5
+ (end-line . ,(rx (group-n 6 (one-or-more digit))))
+ (end-column . ,(rx (group-n 7 (one-or-more digit)))))
+ rx-constituents nil)))
+ (rx-to-string form no-group)))
+
+(defun flycheck-current-load-file ()
+ "Get the source file currently being loaded.
+
+Always return the name of the corresponding source file, never
+any byte-compiled file.
+
+Return nil, if the currently loaded file cannot be determined."
+ (-when-let* ((this-file (cond
+ (load-in-progress load-file-name)
+ ((bound-and-true-p byte-compile-current-file))
+ (t (buffer-file-name))))
+ ;; A best guess for the source file of a compiled library. Works
+ ;; well in most cases, and especially for ELPA packages
+ (source-file (concat (file-name-sans-extension this-file)
+ ".el")))
+ (when (file-exists-p source-file)
+ source-file)))
+
+(defun flycheck-module-root-directory (module &optional file-name)
+ "Get the root directory for a MODULE in FILE-NAME.
+
+MODULE is a qualified module name, either a string with
+components separated by a dot, or as list of components.
+FILE-NAME is the name of the file or directory containing the
+module as string. When nil or omitted, defaults to the return
+value of function `buffer-file-name'.
+
+Return the root directory of the module, that is, the directory,
+from which FILE-NAME can be reached by descending directories
+along each part of MODULE.
+
+If the MODULE name does not match the directory hierarchy upwards
+from FILE-NAME, return the directory containing FILE-NAME. When
+FILE-NAME is nil, return `default-directory'."
+ (let ((file-name (or file-name (buffer-file-name)))
+ (module-components (if (stringp module)
+ (split-string module (rx "."))
+ (copy-sequence module))))
+ (if (and module-components file-name)
+ (let ((parts (nreverse module-components))
+ (base-directory (directory-file-name
+ (file-name-sans-extension file-name))))
+ (while (and parts
+ (string= (file-name-nondirectory base-directory)
+ (car parts)))
+ (pop parts)
+ (setq base-directory (directory-file-name
+ (file-name-directory base-directory))))
+ (file-name-as-directory base-directory))
+ (if file-name
+ (file-name-directory file-name)
+ (expand-file-name default-directory)))))
+
+(cl-defstruct (flycheck-line-cache
+ (:constructor flycheck-line-cache-new))
+ "Cache structure used to speed up `flycheck-goto-line'."
+ tick point line)
+
+(defvar-local flycheck--line-cache nil
+ "Cache used to speed ip `flycheck-goto-line'.")
+
+(defsubst flycheck--init-line-cache ()
+ "Initialize or reinitialize `flycheck--line-cache'."
+ (let ((tick (buffer-modified-tick)))
+ (if flycheck--line-cache
+ (unless (= (flycheck-line-cache-tick flycheck--line-cache) tick)
+ (setf (flycheck-line-cache-tick flycheck--line-cache) tick
+ (flycheck-line-cache-point flycheck--line-cache) 1
+ (flycheck-line-cache-line flycheck--line-cache) 1))
+ (setq-local flycheck--line-cache
+ (flycheck-line-cache-new :tick tick :point 1 :line 1)))))
+
+(defun flycheck-goto-line (line)
+ "Move point to beginning of line number LINE.
+
+This function assumes that the current buffer is not narrowed."
+ (flycheck--init-line-cache)
+ (goto-char (flycheck-line-cache-point flycheck--line-cache))
+ (let ((delta (- line (flycheck-line-cache-line flycheck--line-cache))))
+ (when (= 0 (forward-line delta))
+ (setf (flycheck-line-cache-point flycheck--line-cache) (point))
+ (setf (flycheck-line-cache-line flycheck--line-cache) line))))
+
+(defun flycheck-line-column-to-position (line column)
+ "Return the point closest to LINE, COLUMN on line LINE.
+
+COLUMN is one-based."
+ (save-excursion
+ (flycheck-goto-line line)
+ (min (+ (point) (1- column)) (line-end-position))))
+
+(defun flycheck-line-column-at-point ()
+ "Return the line and column number at point."
+ (cons (line-number-at-pos) (1+ (- (point) (line-beginning-position)))))
+
+(defun flycheck-line-column-at-pos (pos)
+ "Return the line and column number at position POS.
+
+COLUMN is one-based."
+ (let ((inhibit-field-text-motion t))
+ (save-excursion
+ (goto-char pos)
+ (flycheck-line-column-at-point))))
+
+
+;;; Minibuffer tools
+(defvar flycheck-read-checker-history nil
+ "`completing-read' history of `flycheck-read-checker'.")
+
+(defun flycheck-completing-read (prompt candidates default &optional history)
+ "Read a value from the minibuffer.
+
+Use `flycheck-completing-read-function' to read input from the
+minibuffer with completion.
+
+Show PROMPT and read one of CANDIDATES, defaulting to DEFAULT.
+HISTORY is passed to `flycheck-completing-read-function'.
+
+Note that `flycheck-completing-read-function' may return an empty
+string instead of nil, even when \"\" isn't among the candidates.
+See `completing-read' for more details."
+ (funcall flycheck-completing-read-function
+ prompt candidates nil 'require-match nil history default))
+
+(defun flycheck-read-checker (prompt &optional default property candidates)
+ "Read a flycheck checker from minibuffer with PROMPT and DEFAULT.
+
+PROMPT is a string to show in the minibuffer as prompt. It
+should end with a single space. DEFAULT is a symbol denoting the
+default checker to use, if the user did not select any checker.
+PROPERTY is a symbol denoting a syntax checker property. If
+non-nil, only complete syntax checkers which have a non-nil value
+for PROPERTY. CANDIDATES is an optional list of all syntax
+checkers available for completion, defaulting to all defined
+checkers. If given, PROPERTY is ignored.
+
+Return the checker as symbol, or DEFAULT if no checker was
+chosen. If DEFAULT is nil and no checker was chosen, signal a
+`user-error' if the underlying completion system does not provide
+a default on its own."
+ (when (and default (not (flycheck-valid-checker-p default)))
+ (error "%S is no valid Flycheck checker" default))
+ (let* ((candidates (seq-map #'symbol-name
+ (or candidates
+ (flycheck-defined-checkers property))))
+ (default (and default (symbol-name default)))
+ (input (flycheck-completing-read
+ prompt candidates default
+ 'flycheck-read-checker-history)))
+ (when (string-empty-p input)
+ (unless default
+ (user-error "No syntax checker selected"))
+ (setq input default))
+ (let ((checker (intern input)))
+ (unless (flycheck-valid-checker-p checker)
+ (error "%S is not a valid Flycheck syntax checker" checker))
+ checker)))
+
+(defun flycheck-read-error-level (prompt)
+ "Read an error level from the user with PROMPT.
+
+Only offers level for which errors currently exist, in addition
+to the default levels."
+ (let* ((levels (seq-map #'flycheck-error-level
+ (flycheck-error-list-current-errors)))
+ (levels-with-defaults (append '(info warning error) levels))
+ (uniq-levels (seq-uniq levels-with-defaults))
+ (level (flycheck-completing-read prompt uniq-levels nil)))
+ (when (string-empty-p level) (setq level nil))
+ (and level (intern level))))
+
+
+;;; Checker API
+(defun flycheck-defined-checkers (&optional property)
+ "Find all defined syntax checkers, optionally with PROPERTY.
+
+PROPERTY is a symbol. If given, only return syntax checkers with
+a non-nil value for PROPERTY.
+
+The returned list is sorted alphapetically by the symbol name of
+the syntax checkers."
+ (let (defined-checkers)
+ (mapatoms (lambda (symbol)
+ (when (and (flycheck-valid-checker-p symbol)
+ (or (null property)
+ (flycheck-checker-get symbol property)))
+ (push symbol defined-checkers))))
+ (sort defined-checkers #'string<)))
+
+(defun flycheck-registered-checker-p (checker)
+ "Determine whether CHECKER is registered.
+
+A checker is registered if it is contained in
+`flycheck-checkers'."
+ (and (flycheck-valid-checker-p checker)
+ (memq checker flycheck-checkers)))
+
+(defun flycheck-disabled-checker-p (checker)
+ "Determine whether CHECKER is disabled, manually or automatically."
+ (or (flycheck-manually-disabled-checker-p checker)
+ (flycheck-automatically-disabled-checker-p checker)))
+
+(defun flycheck-manually-disabled-checker-p (checker)
+ "Determine whether CHECKER has been manually disabled.
+
+A checker has been manually disabled if it is contained in
+`flycheck-disabled-checkers'."
+ (memq checker flycheck-disabled-checkers))
+
+(defun flycheck-automatically-disabled-checker-p (checker)
+ "Determine whether CHECKER has been automatically disabled.
+
+A checker has been automatically disabled if it is contained in
+`flycheck--automatically-disabled-checkers'."
+ (memq checker flycheck--automatically-disabled-checkers))
+
+
+;;; Generic syntax checkers
+(defconst flycheck-generic-checker-version 2
+ "The internal version of generic syntax checker declarations.
+
+Flycheck will not use syntax checkers whose generic version is
+less than this constant.")
+
+(defsubst flycheck--checker-property-name (property)
+ "Return the SYMBOL property for checker PROPERTY."
+ (intern (concat "flycheck-" (symbol-name property))))
+
+(defun flycheck-checker-get (checker property)
+ "Get the value of CHECKER's PROPERTY."
+ (get checker (flycheck--checker-property-name property)))
+
+(gv-define-setter flycheck-checker-get (value checker property)
+ `(setf (get ,checker (flycheck--checker-property-name ,property)) ,value))
+
+(defun flycheck-validate-next-checker (next &optional strict)
+ "Validate NEXT checker.
+
+With STRICT non-nil, also check whether the syntax checker and
+the error level in NEXT are valid. Otherwise just check whether
+these are symbols.
+
+Signal an error if NEXT is not a valid entry for
+`:next-checkers'."
+ (when (symbolp next)
+ (setq next (cons t next)))
+ (pcase next
+ (`(,level . ,checker)
+ (if strict
+ (progn
+ (unless (or (eq level t) (flycheck-error-level-p level))
+ (error "%S is not a valid Flycheck error level" level))
+ (unless (flycheck-valid-checker-p checker)
+ (error "%s is not a valid Flycheck syntax checker" checker)))
+ (unless (symbolp level)
+ (error "Error level %S must be a symbol" level))
+ (unless (symbolp checker)
+ (error "Checker %S must be a symbol" checker))))
+ (_ (error "%S must be a symbol or cons cell" next)))
+ t)
+
+(defun flycheck-define-generic-checker (symbol docstring &rest properties)
+ "Define SYMBOL as generic syntax checker.
+
+Any syntax checker defined with this macro is eligible for manual
+syntax checker selection with `flycheck-select-checker'. To make
+the new syntax checker available for automatic selection, it must
+be registered in `flycheck-checkers'.
+
+DOCSTRING is the documentation of the syntax checker, for
+`flycheck-describe-checker'. The following PROPERTIES constitute
+a generic syntax checker. Unless otherwise noted, all properties
+are mandatory.
+
+`:start FUNCTION'
+ A function to start the syntax checker.
+
+ FUNCTION shall take two arguments and return a context
+ object if the checker is started successfully. Otherwise it
+ shall signal an error.
+
+ The first argument is the syntax checker being started. The
+ second is a callback function to report state changes to
+ Flycheck. The callback takes two arguments STATUS DATA,
+ where STATUS is a symbol denoting the syntax checker status
+ and DATA an optional argument with additional data for the
+ status report. See `flycheck-report-buffer-checker-status'
+ for more information about STATUS and DATA.
+
+ FUNCTION may be synchronous or asynchronous, i.e. it may
+ call the given callback either immediately, or at some later
+ point (e.g. from a process sentinel).
+
+ A syntax checker _must_ call CALLBACK at least once with a
+ STATUS that finishes the current syntax checker. Otherwise
+ Flycheck gets stuck at the current syntax check with this
+ syntax checker.
+
+ The context object returned by FUNCTION is passed to
+ `:interrupt'.
+
+`:interrupt FUNCTION'
+ A function to interrupt the syntax check.
+
+ FUNCTION is called with the syntax checker and the context
+ object returned by the `:start' function and shall try to
+ interrupt the syntax check. The context may be nil, if the
+ syntax check is interrupted before actually started.
+ FUNCTION should handle this situation.
+
+ If it cannot interrupt the syntax check, it may either
+ signal an error or silently ignore the attempt to interrupt
+ the syntax checker, depending on the severity of the
+ situation.
+
+ If interrupting the syntax check failed, Flycheck will let
+ the syntax check continue, but ignore any status reports.
+ Notably, it won't highlight any errors reported by the
+ syntax check in the buffer.
+
+ This property is optional. If omitted, Flycheck won't
+ attempt to interrupt syntax checks with this syntax checker,
+ and simply ignore their results.
+
+`:print-doc FUNCTION'
+ A function to print additional documentation into the Help
+ buffer of this checker.
+
+ FUNCTION is called when creating the Help buffer for the
+ syntax checker, with the syntax checker as single argument,
+ after printing the name of the syntax checker and its modes
+ and predicate, but before printing DOCSTRING. It may insert
+ additional documentation into the current buffer.
+
+ The call occurs within `with-help-window'. Hence
+ `standard-output' points to the current buffer, so you may
+ use `princ' and friends to add content. Also, the current
+ buffer is put into Help mode afterwards, which automatically
+ turns symbols into references, if possible.
+
+ This property is optional. If omitted, no additional
+ documentation is printed for this syntax checker.
+
+:verify FUNCTION
+ A function to verify the checker for the current buffer.
+
+ FUNCTION is called with the syntax checker as single
+ argument, and shall return a list of
+ `flycheck-verification-result' objects indicating whether
+ the syntax checker could be used in the current buffer, and
+ highlighting potential setup problems.
+
+ This property is optional. If omitted, no additional
+ verification occurs for this syntax checker. It is however
+ absolutely recommended that you add a `:verify' function to
+ your syntax checker, because it will help users to spot
+ potential setup problems.
+
+`:modes MODES'
+ A major mode symbol or a list thereof, denoting major modes
+ to use this syntax checker in.
+
+ This syntax checker will only be used in buffers whose
+ `major-mode' is contained in MODES.
+
+ If `:predicate' is also given the syntax checker will only
+ be used in buffers for which the `:predicate' returns
+ non-nil.
+
+`:predicate FUNCTION'
+ A function to determine whether to use the syntax checker in
+ the current buffer.
+
+ FUNCTION is called without arguments and shall return
+ non-nil if this syntax checker shall be used to check the
+ current buffer. Otherwise it shall return nil.
+
+ If this checker has a `:working-directory' FUNCTION is
+ called with `default-directory' bound to the checker's
+ working directory.
+
+ FUNCTION is only called in matching major modes.
+
+ This property is optional.
+
+`:enabled FUNCTION'
+ A function to determine whether to use the syntax checker in
+ the current buffer.
+
+ This property behaves as `:predicate', except that it's only
+ called the first time a syntax checker is to be used in a buffer.
+
+ FUNCTION is called without arguments and shall return
+ non-nil if this syntax checker shall be used to check the
+ current buffer. Otherwise it shall return nil.
+
+ If FUNCTION returns a non-nil value the checker is put in a
+ whitelist in `flycheck--automatically-enabled-checkers' to
+ prevent further invocations of `:enabled'. Otherwise it is
+ disabled via `flycheck--automatically-disabled-checkers' to
+ prevent any further use of it.
+
+ If this checker has a `:working-directory' FUNCTION is
+ called with `default-directory' bound to the checker's
+ working directory.
+
+ FUNCTION is only called in matching major modes.
+
+ This property is optional.
+
+`:error-filter FUNCTION'
+ A function to filter the errors returned by this checker.
+
+ FUNCTION is called with the list of `flycheck-error' objects
+ returned by the syntax checker and shall return another list
+ of `flycheck-error' objects, which is considered the final
+ result of this syntax checker.
+
+ FUNCTION is free to add, remove or modify errors, whether in
+ place or by copying.
+
+ This property is optional. The default filter is
+ `identity'.
+
+`:error-explainer FUNCTION'
+ A function to return an explanation text for errors
+ generated by this checker.
+
+ FUNCTION is called with a `flycheck-error' object, in the
+ buffer of that error. It shall return an explanation
+ message for the error.
+
+ The message can take any of the following forms:
+ - A string, which will be displayed to the user
+ - A function (likely a closure), which will be called with
+ `standard-output' set to a `flycheck-explain-error-mode'
+ buffer, and should write to it.
+ - A cons `(url . ,URL), indicating that the explanation can
+ be found online at URL.
+ - nil if there is no explanation for this error.
+
+ If URL is provided by the checker, and cannot be composed
+ from other elements in the `flycheck-error' object, consider
+ passing the URL via text properties:
+
+ ;; During the error object creation
+ (put-text-property 0 1 'explainer-url .url .check_id)
+
+ ;; In the error-explainer FUNCTION
+ (let ((id (flycheck-error-id err)))
+ (and id `(url . ,(get-text-property 0 'explainer-url id))))
+
+ This property is optional.
+
+`:next-checkers NEXT-CHECKERS'
+ A list denoting syntax checkers to apply after this syntax
+ checker, in what we call \"chaining\" of syntax checkers.
+
+ Each ITEM is a cons cell `(LEVEL . CHECKER)'. CHECKER is a
+ syntax checker to run after this syntax checker. LEVEL is
+ an error level. CHECKER will only be used if there are no
+ current errors of at least LEVEL. LEVEL may also be t, in
+ which case CHECKER is used regardless of the current errors.
+
+ ITEM may also be a syntax checker symbol, which is
+ equivalent to `(t . ITEM)'.
+
+ Flycheck tries all items in order of declaration, and uses
+ the first whose LEVEL matches and whose CHECKER is
+ registered and can be used for the current buffer.
+
+ This feature is typically used to apply more than one syntax
+ checker to a buffer. For instance, you might first use a
+ compiler to check a buffer for syntax and type errors, and
+ then run a linting tool that checks for insecure code, or
+ questionable style.
+
+ This property is optional. If omitted, it defaults to the
+ nil, i.e. no other syntax checkers are applied after this
+ syntax checker.
+
+`:working-directory FUNCTION'
+ The value of `default-directory' when invoking `:start'.
+
+ FUNCTION is a function taking the syntax checker as sole
+ argument. It shall return the absolute path to an existing
+ directory to use as `default-directory' for `:start' or
+ nil to fall back to the `default-directory' of the current
+ buffer.
+
+ This property is optional. If omitted, invoke `:start'
+ from the `default-directory' of the buffer being checked.
+
+Signal an error, if any property has an invalid value."
+ (declare (indent 1)
+ (doc-string 2))
+ (let ((start (plist-get properties :start))
+ (interrupt (plist-get properties :interrupt))
+ (print-doc (plist-get properties :print-doc))
+ (modes (plist-get properties :modes))
+ (predicate (plist-get properties :predicate))
+ (verify (plist-get properties :verify))
+ (enabled (plist-get properties :enabled))
+ (filter (or (plist-get properties :error-filter) #'identity))
+ (explainer (plist-get properties :error-explainer))
+ (next-checkers (plist-get properties :next-checkers))
+ (file (flycheck-current-load-file))
+ (working-directory (plist-get properties :working-directory)))
+
+ (unless (listp modes)
+ (setq modes (list modes)))
+
+ (unless (functionp start)
+ (error ":start %S of syntax checker %s is not a function" start symbol))
+ (unless (or (null interrupt) (functionp interrupt))
+ (error ":interrupt %S of syntax checker %s is not a function"
+ interrupt symbol))
+ (unless (or (null print-doc) (functionp print-doc))
+ (error ":print-doc %S of syntax checker %s is not a function"
+ print-doc symbol))
+ (unless (or (null verify) (functionp verify))
+ (error ":verify %S of syntax checker %S is not a function"
+ verify symbol))
+ (unless (or (null enabled) (functionp enabled))
+ (error ":enabled %S of syntax checker %S is not a function"
+ enabled symbol))
+ (unless modes
+ (error "Missing :modes in syntax checker %s" symbol))
+ (dolist (mode modes)
+ (unless (symbolp mode)
+ (error "Invalid :modes %s in syntax checker %s, %s must be a symbol"
+ modes symbol mode)))
+ (unless (or (null predicate) (functionp predicate))
+ (error ":predicate %S of syntax checker %s is not a function"
+ predicate symbol))
+ (unless (functionp filter)
+ (error ":error-filter %S of syntax checker %s is not a function"
+ filter symbol))
+ (unless (or (null explainer) (functionp explainer))
+ (error ":error-explainer %S of syntax checker %S is not a function"
+ explainer symbol))
+ (dolist (checker next-checkers)
+ (flycheck-validate-next-checker checker))
+
+ (let ((real-predicate
+ (and predicate
+ (lambda ()
+ ;; Run predicate in the checker's default directory
+ (let ((default-directory
+ (flycheck-compute-working-directory symbol)))
+ (funcall predicate)))))
+ (real-enabled
+ (lambda ()
+ (if (flycheck-valid-checker-p symbol)
+ (or (null enabled)
+ ;; Run enabled in the checker's default directory
+ (let ((default-directory
+ (flycheck-compute-working-directory symbol)))
+ (funcall enabled)))
+ (lwarn 'flycheck
+ :warning "%S is no valid Flycheck syntax checker.
+Try to reinstall the package defining this syntax checker." symbol)
+ nil))))
+ (pcase-dolist (`(,prop . ,value)
+ `((start . ,start)
+ (interrupt . ,interrupt)
+ (print-doc . ,print-doc)
+ (modes . ,modes)
+ (predicate . ,real-predicate)
+ (verify . ,verify)
+ (enabled . ,real-enabled)
+ (error-filter . ,filter)
+ (error-explainer . ,explainer)
+ (next-checkers . ,next-checkers)
+ (documentation . ,docstring)
+ (file . ,file)
+ (working-directory . ,working-directory)))
+ (setf (flycheck-checker-get symbol prop) value)))
+
+ ;; Track the version, to avoid breakage if the internal format changes
+ (setf (flycheck-checker-get symbol 'generic-checker-version)
+ flycheck-generic-checker-version)))
+
+(defun flycheck-valid-checker-p (checker)
+ "Check whether a CHECKER is valid.
+
+A valid checker is a symbol defined as syntax checker with
+`flycheck-define-checker'."
+ (and (symbolp checker)
+ (= (or (get checker 'flycheck-generic-checker-version) 0)
+ flycheck-generic-checker-version)))
+
+(defun flycheck-checker-supports-major-mode-p (checker &optional mode)
+ "Whether CHECKER supports the given major MODE.
+
+CHECKER is a syntax checker symbol and MODE a major mode symbol.
+Look at the `modes' property of CHECKER to determine whether
+CHECKER supports buffers in the given major MODE.
+
+MODE defaults to the value of `major-mode' if omitted or nil.
+
+Return non-nil if CHECKER supports MODE and nil otherwise."
+ (let ((mode (or mode major-mode)))
+ (memq mode (flycheck-checker-get checker 'modes))))
+
+(define-obsolete-variable-alias 'flycheck-enabled-checkers
+ 'flycheck--automatically-enabled-checkers "32")
+
+(defvar flycheck--automatically-enabled-checkers nil
+ "Syntax checkers included in automatic selection.
+
+A list of Flycheck syntax checkers included in automatic
+selection for the current buffer.")
+(make-variable-buffer-local 'flycheck--automatically-enabled-checkers)
+
+(defun flycheck-may-enable-checker (checker)
+ "Whether a generic CHECKER may be enabled for current buffer.
+
+Return non-nil if CHECKER may be used for the current buffer, and
+nil otherwise. The result of the `:enabled' check, if any, is
+cached."
+ (and
+ ;; May only enable valid checkers
+ (flycheck-valid-checker-p checker)
+ ;; Don't run the :enabled check if the checker is already disabled…
+ (not (flycheck-disabled-checker-p checker))
+ (or
+ ;; …or if we've already cached the result
+ (memq checker flycheck--automatically-enabled-checkers)
+ (let* ((enabled (flycheck-checker-get checker 'enabled))
+ (may-enable (or (null enabled) (funcall enabled))))
+ ;; Cache the result
+ (if may-enable
+ (cl-pushnew checker flycheck--automatically-enabled-checkers)
+ (cl-pushnew checker flycheck--automatically-disabled-checkers))
+ may-enable))))
+
+(defun flycheck-reset-enabled-checker (checker)
+ "Reset the `:enabled' test of CHECKER.
+
+Forget that CHECKER has been enabled or automatically disabled
+from a previous `:enabled' test. The result of the `:enabled'
+test is cached in `flycheck-may-enable-checker': if you wish to
+test the `:enabled' predicate again, you must first reset its
+state using this function."
+ (when (memq checker flycheck--automatically-disabled-checkers)
+ (setq flycheck--automatically-disabled-checkers
+ (remq checker flycheck--automatically-disabled-checkers)))
+ (when (memq checker flycheck--automatically-enabled-checkers)
+ (setq flycheck--automatically-enabled-checkers
+ (remq checker flycheck--automatically-enabled-checkers)))
+ (flycheck-buffer))
+
+(defun flycheck-may-use-checker (checker)
+ "Whether a generic CHECKER may be used.
+
+Return non-nil if CHECKER may be used for the current buffer, and
+nil otherwise."
+ (let ((predicate (flycheck-checker-get checker 'predicate)))
+ (and (flycheck-valid-checker-p checker)
+ (flycheck-checker-supports-major-mode-p checker)
+ (flycheck-may-enable-checker checker)
+ (or (null predicate) (funcall predicate)))))
+
+(defun flycheck-may-use-next-checker (next-checker)
+ "Determine whether NEXT-CHECKER may be used."
+ (when (symbolp next-checker)
+ (push t next-checker))
+ (let ((level (car next-checker))
+ (next-checker (cdr next-checker)))
+ (and (or (eq level t)
+ (flycheck-has-max-current-errors-p level))
+ (flycheck-registered-checker-p next-checker)
+ (flycheck-may-use-checker next-checker))))
+
+
+;;; Help for generic syntax checkers
+(define-button-type 'help-flycheck-checker-def
+ :supertype 'help-xref
+ 'help-function #'flycheck-goto-checker-definition
+ 'help-echo "mouse-1, RET: find Flycheck checker definition")
+
+(defconst flycheck-find-checker-regexp
+ (rx line-start (zero-or-more (syntax whitespace))
+ "(" symbol-start
+ (or "flycheck-define-checker" "flycheck-define-command-checker")
+ symbol-end
+ (eval (list 'regexp find-function-space-re))
+ (? "'")
+ symbol-start "%s" symbol-end
+ (or (syntax whitespace) line-end))
+ "Regular expression to find a checker definition.")
+
+(add-to-list 'find-function-regexp-alist
+ '(flycheck-checker . flycheck-find-checker-regexp))
+
+(defun flycheck-goto-checker-definition (checker file)
+ "Go to to the definition of CHECKER in FILE."
+ (let ((location (find-function-search-for-symbol
+ checker 'flycheck-checker file)))
+ (pop-to-buffer (car location))
+ (if (cdr location)
+ (goto-char (cdr location))
+ (message "Unable to find checker location in file"))))
+
+(defun flycheck-checker-at-point ()
+ "Return the Flycheck checker found at or before point.
+
+Return nil if there is no checker."
+ (let ((symbol (variable-at-point 'any-symbol)))
+ (when (flycheck-valid-checker-p symbol)
+ symbol)))
+
+(defun flycheck-describe-checker (checker)
+ "Display the documentation of CHECKER.
+
+CHECKER is a checker symbol.
+
+Pop up a help buffer with the documentation of CHECKER."
+ (interactive
+ (let* ((enable-recursive-minibuffers t)
+ (default (or (flycheck-checker-at-point)
+ (ignore-errors (flycheck-get-checker-for-buffer))))
+ (prompt (if default
+ (format "Describe syntax checker (default %s): " default)
+ "Describe syntax checker: ")))
+ (list (flycheck-read-checker prompt default))))
+ (unless (flycheck-valid-checker-p checker)
+ (user-error "You didn't specify a Flycheck syntax checker"))
+ (let ((filename (flycheck-checker-get checker 'file))
+ (modes (flycheck-checker-get checker 'modes))
+ (predicate (flycheck-checker-get checker 'predicate))
+ (print-doc (flycheck-checker-get checker 'print-doc))
+ (next-checkers (flycheck-checker-get checker 'next-checkers))
+ (help-xref-following
+ ;; Ensure that we don't reuse buffers like `flycheck-verify-checker',
+ ;; and that we don't error out if a `help-flycheck-checker-doc' button
+ ;; is added outside of a documentation window.
+ (and help-xref-following (eq major-mode 'help-mode))))
+ (help-setup-xref (list #'flycheck-describe-checker checker)
+ (called-interactively-p 'interactive))
+ (save-excursion
+ (with-help-window (help-buffer)
+ (princ (format "%s is a Flycheck syntax checker" checker))
+ (when filename
+ (princ (format " in `%s'" (file-name-nondirectory filename)))
+ (with-current-buffer standard-output
+ (save-excursion
+ (re-search-backward "`\\([^`']+\\)'" nil t)
+ (help-xref-button 1 'help-flycheck-checker-def
+ checker filename))))
+ (princ ".\n\n")
+
+ (let ((modes-start (with-current-buffer standard-output (point-max))))
+ ;; Track the start of the modes documentation, to properly re-fill
+ ;; it later
+ (princ " This syntax checker checks syntax in the major mode(s) ")
+ (princ (string-join
+ (seq-map (apply-partially #'format "`%s'") modes)
+ ", "))
+ (when predicate
+ (princ ", and uses a custom predicate"))
+ (princ ".")
+ (when next-checkers
+ (princ " It runs the following checkers afterwards:"))
+ (with-current-buffer standard-output
+ (save-excursion
+ (fill-region-as-paragraph modes-start (point-max))))
+ (princ "\n")
+
+ ;; Print the list of next checkers
+ (when next-checkers
+ (princ "\n")
+ (let ((beg-checker-list (with-current-buffer standard-output
+ (point))))
+ (dolist (next-checker next-checkers)
+ (if (symbolp next-checker)
+ (princ (format " * `%s'\n" next-checker))
+ (princ (format " * `%s' (maximum level `%s')\n"
+ (cdr next-checker) (car next-checker)))))
+ ;;
+ (with-current-buffer standard-output
+ (save-excursion
+ (while (re-search-backward "`\\([^`']+\\)'"
+ beg-checker-list t)
+ (let ((checker (intern-soft (match-string 1))))
+ (when (flycheck-valid-checker-p checker)
+ (help-xref-button 1 'help-flycheck-checker-doc
+ checker)))))))))
+ ;; Call the custom print-doc function of the checker, if present
+ (when print-doc
+ (funcall print-doc checker))
+ ;; Ultimately, print the docstring
+ (princ "\nDocumentation:\n")
+ (princ (flycheck-checker-get checker 'documentation))))))
+
+
+;;; Syntax checker verification
+(cl-defstruct (flycheck-verification-result
+ (:constructor flycheck-verification-result-new))
+ "Structure for storing a single verification result.
+
+Slots:
+
+`label'
+ A label for this result, as string
+
+`message'
+ A message for this result, as string
+
+`face'
+ The face to use for the `message'.
+
+ You can either use a face symbol, or a list of face symbols."
+ label message face)
+
+(defun flycheck-verify-generic-checker (checker)
+ "Verify a generic CHECKER in the current buffer.
+
+Return a list of `flycheck-verification-result' objects."
+ (let (results
+ (predicate (flycheck-checker-get checker 'predicate))
+ (enabled (flycheck-checker-get checker 'enabled))
+ (verify (flycheck-checker-get checker 'verify)))
+ (when enabled
+ (let ((result (funcall enabled)))
+ (push (flycheck-verification-result-new
+ :label (propertize "may enable" 'help-echo ":enable")
+ :message (if result "yes" "no")
+ :face (if result 'success '(bold warning)))
+ results)))
+ (when predicate
+ (let ((result (funcall predicate)))
+ (push (flycheck-verification-result-new
+ :label (propertize "may run" 'help-echo ":predicate")
+ :message (prin1-to-string (not (null result)))
+ :face (if result 'success '(bold warning)))
+ results)))
+ (append (nreverse results)
+ (and verify (funcall verify checker)))))
+
+(define-button-type 'help-flycheck-checker-doc
+ :supertype 'help-xref
+ 'help-function #'flycheck-describe-checker
+ 'help-echo "mouse-1, RET: describe Flycheck checker")
+
+(define-button-type 'flycheck-button
+ 'follow-link t
+ 'action (lambda (pos)
+ (apply (get-text-property pos 'flycheck-action)
+ (get-text-property pos 'flycheck-data))
+ ;; Revert the verify-setup buffer since it is now stale
+ (revert-buffer))
+ 'face 'flycheck-verify-select-checker)
+
+(define-button-type 'flycheck-checker-select
+ :supertype 'flycheck-button
+ 'flycheck-action (lambda (buffer checker)
+ (with-current-buffer buffer
+ (flycheck-select-checker checker)))
+ 'help-echo "mouse-1, RET: select this checker")
+
+(define-button-type 'flycheck-checker-enable
+ :supertype 'flycheck-button
+ 'flycheck-action (lambda (buffer checker)
+ (interactive)
+ (with-current-buffer buffer
+ (flycheck--toggle-checker checker t)
+ (flycheck-buffer)))
+ 'help-echo "mouse-1, RET: re-enable this checker in this buffer")
+
+(define-button-type 'flycheck-checker-reset-enabled
+ :supertype 'flycheck-button
+ 'flycheck-action (lambda (buffer checker)
+ (with-current-buffer buffer
+ (flycheck-reset-enabled-checker checker)))
+ 'help-echo "mouse-1, RET: try to re-enable this checker")
+
+(defun flycheck--verify-princ-checker (checker buffer
+ &optional with-mm with-select)
+ "Print verification result of CHECKER for BUFFER.
+
+When WITH-MM is given and non-nil, also include the major mode
+into the verification results.
+
+When WITH-SELECT is non-nil, add a button to select this checker."
+ (princ " ")
+ (insert-button (symbol-name checker)
+ 'type 'help-flycheck-checker-doc
+ 'help-args (list checker))
+ (cond
+ ((with-current-buffer buffer
+ (flycheck-manually-disabled-checker-p checker))
+ (insert (propertize " (manually disabled) " 'face '(bold error)))
+ (insert-text-button "enable"
+ 'type 'flycheck-checker-enable
+ 'flycheck-data (list buffer checker)))
+ ((with-current-buffer buffer
+ (flycheck-automatically-disabled-checker-p checker))
+ (insert (propertize " (automatically disabled) " 'face '(bold error)))
+ (insert-text-button "reset"
+ 'type 'flycheck-checker-reset-enabled
+ 'flycheck-data (list buffer checker))))
+ (when (eq checker (buffer-local-value 'flycheck-checker buffer))
+ (insert (propertize " (explicitly selected)" 'face 'bold)))
+ (when with-select
+ (princ " ")
+ (insert-text-button "select"
+ 'type 'flycheck-checker-select
+ 'flycheck-data (list buffer checker)))
+ (princ "\n")
+ (let ((results (with-current-buffer buffer
+ (append (flycheck-verify-generic-checker checker)
+ (flycheck--verify-next-checkers checker)))))
+ (when with-mm
+ (with-current-buffer buffer
+ (let ((message-and-face
+ (if (flycheck-checker-supports-major-mode-p checker)
+ (cons (format "`%s' supported" major-mode) 'success)
+ (cons (format "`%s' not supported" major-mode) 'error))))
+ (push (flycheck-verification-result-new
+ :label "major mode"
+ :message (car message-and-face)
+ :face (cdr message-and-face))
+ results))))
+ (let* ((label-length
+ (seq-max (mapcar
+ (lambda (res)
+ (length (flycheck-verification-result-label res)))
+ results)))
+ (message-column (+ 8 label-length)))
+ (dolist (result results)
+ (princ " - ")
+ (princ (flycheck-verification-result-label result))
+ (princ ": ")
+ (princ (make-string (- message-column (current-column)) ?\ ))
+ (let ((message (flycheck-verification-result-message result))
+ (face (flycheck-verification-result-face result)))
+ ;; If face is nil, using propertize erases the face already contained
+ ;; by the message. We don't want that, since this would remove the
+ ;; button face from the checker chain result.
+ (insert (if face (propertize message 'face face) message)))
+ (princ "\n"))))
+ (princ "\n"))
+
+(defun flycheck--get-next-checker-symbol (next)
+ "Get the checker symmbol of NEXT checker.
+
+NEXT should be either a cons (NEXT-CHECKER . LEVEL) or a
+symbol."
+ (if (consp next) (cdr next) next))
+
+(defun flycheck-get-next-checkers (checker)
+ "Return the immediate next checkers of CHECKER.
+
+This is a list of checker symbols. The error levels of the
+`:next-checker' property are ignored."
+ (mapcar #'flycheck--get-next-checker-symbol
+ (flycheck-checker-get checker 'next-checkers)))
+
+(defun flycheck-all-next-checkers (checker)
+ "Return all checkers that may follow CHECKER.
+
+Return the transitive closure of the next-checker relation. The
+return value is a list of checkers, not including CHECKER."
+ (let ((next-checkers)
+ (visited)
+ (queue (list checker)))
+ (while queue
+ (let ((c (pop queue)))
+ (push c visited)
+ (dolist (n (flycheck-get-next-checkers c))
+ (push n next-checkers)
+ (unless (memq n visited)
+ (cl-pushnew n queue)))))
+ (seq-uniq next-checkers)))
+
+(defun flycheck--verify-next-checkers (checker)
+ "Return a verification result for the next checkers of CHECKER."
+ (-when-let (next (flycheck-get-next-checkers checker))
+ (list
+ (flycheck-verification-result-new
+ :label "next checkers"
+ ;; We use `make-text-button' to preserve the button properties in the
+ ;; string
+ :message (mapconcat
+ (lambda (checker)
+ (make-text-button (symbol-name checker) nil
+ 'type 'help-flycheck-checker-doc
+ 'help-args (list checker)))
+ next
+ ", ")))))
+
+(defun flycheck--verify-print-header (desc buffer)
+ "Print a title with DESC for BUFFER in the current buffer.
+
+DESC is an arbitrary string containing a description, and BUFFER
+is the buffer being verified. The name and the major mode mode
+of BUFFER are printed.
+
+DESC and information about BUFFER are printed in the current
+buffer."
+ (princ desc)
+ (insert (propertize (buffer-name buffer) 'face 'bold))
+ (princ " in ")
+ (let ((mode (buffer-local-value 'major-mode buffer)))
+ (insert-button (symbol-name mode)
+ 'type 'help-function
+ 'help-args (list mode)))
+ (princ ":\n\n"))
+
+(defun flycheck--verify-print-footer (buffer)
+ "Print a footer for BUFFER in the current buffer.
+
+BUFFER is the buffer being verified."
+ (princ "Flycheck Mode is ")
+ (let ((enabled (buffer-local-value 'flycheck-mode buffer)))
+ (insert (propertize (if enabled "enabled" "disabled")
+ 'face (if enabled 'success '(warning bold)))))
+ (princ
+ (with-current-buffer buffer
+ ;; Use key binding state in the verified buffer to print the help.
+ (substitute-command-keys
+ ". Use \\[universal-argument] \\[flycheck-disable-checker] \
+to enable disabled checkers.")))
+ (save-excursion
+ (let ((end (point)))
+ (backward-paragraph)
+ (fill-region-as-paragraph (point) end)))
+
+ (princ "\n\n--------------------\n\n")
+ (princ (format "Flycheck version: %s\n" (flycheck-version)))
+ (princ (format "Emacs version: %s\n" emacs-version))
+ (princ (format "System: %s\n" system-configuration))
+ (princ (format "Window system: %S\n" window-system)))
+
+(define-derived-mode flycheck-verify-mode help-mode
+ "Flycheck verification"
+ "Major mode to display Flycheck verification results."
+ ;; `help-mode-finish' will restore `buffer-read-only'
+ (setq buffer-read-only nil))
+
+(defun flycheck-verify-checker (checker)
+ "Check whether a CHECKER can be used in this buffer.
+
+Show a buffer listing possible problems that prevent CHECKER from
+being used for the current buffer.
+
+Note: Do not use this function to check whether a syntax checker
+is applicable from Emacs Lisp code. Use
+`flycheck-may-use-checker' instead."
+ (interactive (list (flycheck-read-checker "Checker to verify: ")))
+ (unless (flycheck-valid-checker-p checker)
+ (user-error "%s is not a syntax checker" checker))
+
+ ;; Save the buffer to make sure that all predicates are good
+ ;; FIXME: this may be surprising to users, with unintended side-effects.
+ (when (and (buffer-file-name) (buffer-modified-p))
+ (save-buffer))
+
+ (let ((buffer (current-buffer)))
+ (with-help-window "*Flycheck checker*"
+ (with-current-buffer standard-output
+ (flycheck-verify-mode)
+ (flycheck--verify-print-header "Syntax checker in buffer " buffer)
+ (flycheck--verify-princ-checker checker buffer 'with-mm)
+ (if (with-current-buffer buffer (flycheck-may-use-checker checker))
+ (insert (propertize
+ "Flycheck can use this syntax checker for this buffer.\n"
+ 'face 'success))
+ (insert (propertize
+ "Flycheck cannot use this syntax checker for this buffer.\n"
+ 'face 'error)))
+ (insert "\n")
+ (flycheck--verify-print-footer buffer)))))
+
+(defun flycheck-verify-setup ()
+ "Check whether Flycheck can be used in this buffer.
+
+Display a new buffer listing all syntax checkers that could be
+applicable in the current buffer. For each syntax checkers,
+possible problems are shown."
+ (interactive)
+ ;; Save to make sure checkers that only work on saved buffers will pass the
+ ;; verification
+ (when (and (buffer-file-name) (buffer-modified-p))
+ (save-buffer))
+
+ (let* ((buffer (current-buffer))
+ (first-checker (flycheck-get-checker-for-buffer))
+ (valid-checkers
+ (remq first-checker
+ (seq-filter #'flycheck-may-use-checker flycheck-checkers)))
+ (valid-next-checkers
+ (when first-checker
+ (seq-intersection valid-checkers
+ (flycheck-all-next-checkers first-checker))))
+ (valid-remaining (seq-difference valid-checkers valid-next-checkers))
+ (other-checkers
+ (seq-difference (seq-filter #'flycheck-checker-supports-major-mode-p
+ flycheck-checkers)
+ (cons first-checker valid-checkers))))
+
+ ;; Print all applicable checkers for this buffer
+ (with-help-window "*Flycheck checkers*"
+ (with-current-buffer standard-output
+ (flycheck-verify-mode)
+
+ (flycheck--verify-print-header "Syntax checkers for buffer " buffer)
+
+ (if first-checker
+ (progn
+ (princ "First checker to run:\n\n")
+ (flycheck--verify-princ-checker first-checker buffer))
+ (insert (propertize
+ "No checker to run in this buffer.\n\n"
+ 'face '(bold error))))
+
+ (when valid-next-checkers
+ (princ
+ "Checkers that may run as part of the first checker's chain:\n\n")
+ (dolist (checker valid-next-checkers)
+ (flycheck--verify-princ-checker checker buffer)))
+
+ (when valid-remaining
+ (princ "Checkers that could run if selected:\n\n")
+ (dolist (checker valid-remaining)
+ (flycheck--verify-princ-checker checker buffer nil 'with-select)))
+
+ (when other-checkers
+ (princ
+ "Checkers that are compatible with this mode, \
+but will not run until properly configured:\n\n")
+ (dolist (checker other-checkers)
+ (flycheck--verify-princ-checker checker buffer)))
+
+ ;; If we have no checkers at all, that's worth mentioning
+ (unless (or first-checker valid-checkers other-checkers)
+ (insert (propertize
+ "No checkers are available for this buffer.\n\n"
+ 'face '(bold error))))
+
+ (let ((unregistered-checkers
+ (seq-difference (flycheck-defined-checkers) flycheck-checkers)))
+ (when unregistered-checkers
+ (insert (propertize
+ "The following syntax checkers are not registered:\n"
+ 'face '(bold warning)))
+ (dolist (checker unregistered-checkers)
+ (princ " - ")
+ (princ checker)
+ (princ "\n"))
+ (princ
+ "Try adding these syntax checkers to `flycheck-checkers'.\n\n")))
+
+ (flycheck--verify-print-footer buffer)
+
+ (setq-local revert-buffer-function
+ (lambda (_ignore-auto _noconfirm)
+ (with-current-buffer buffer (flycheck-verify-setup))))))))
+
+
+;;; Predicates for generic syntax checkers
+(defun flycheck-buffer-saved-p (&optional buffer)
+ "Determine whether BUFFER is saved to a file.
+
+BUFFER is the buffer to check. If omitted or nil, use the
+current buffer as BUFFER.
+
+Return non-nil if the BUFFER is backed by a file, and not
+modified, or nil otherwise."
+ (let ((file-name (buffer-file-name buffer)))
+ (and file-name (file-exists-p file-name) (not (buffer-modified-p buffer)))))
+
+
+;;; Extending generic checkers
+(defun flycheck-remove-next-checker (checker next)
+ "After CHECKER remove a NEXT checker.
+
+CHECKER is a syntax checker symbol, from which to remove NEXT
+checker.
+
+NEXT is a cons or a symbol, as documented in
+`flycheck-add-next-checker'."
+ (unless (flycheck-valid-checker-p checker)
+ (error "%s is not a valid syntax checker" checker))
+ (let* ((next-symbol (flycheck--get-next-checker-symbol next)))
+ (setf
+ (flycheck-checker-get checker 'next-checkers)
+ (seq-remove
+ (lambda (next) (eq (flycheck--get-next-checker-symbol next) next-symbol))
+ (flycheck-checker-get checker 'next-checkers)))))
+
+(defun flycheck-add-next-checker (checker next &optional append)
+ "After CHECKER add a NEXT checker.
+
+CHECKER is a syntax checker symbol, to which to add NEXT checker.
+
+NEXT is a cons cell `(LEVEL . NEXT-CHECKER)'. NEXT-CHECKER is a
+symbol denoting the syntax checker to run after CHECKER. LEVEL
+is an error level. NEXT-CHECKER will only be used if there is no
+current error whose level is more severe than LEVEL. LEVEL may
+also be t, in which case NEXT-CHECKER is used regardless of the
+current errors.
+
+NEXT can also be a syntax checker symbol only, which is
+equivalent to `(t . NEXT)'.
+
+NEXT-CHECKER is prepended before other next checkers, unless
+APPEND is non-nil."
+ (unless (flycheck-valid-checker-p checker)
+ (error "%s is not a valid syntax checker" checker))
+ (flycheck-validate-next-checker next 'strict)
+ (flycheck-remove-next-checker checker next)
+ (let ((next-checkers (flycheck-checker-get checker 'next-checkers)))
+ (setf (flycheck-checker-get checker 'next-checkers)
+ (if append (append next-checkers (list next))
+ (cons next next-checkers)))))
+
+(defun flycheck-add-mode (checker mode)
+ "To CHECKER add a new major MODE.
+
+CHECKER and MODE are symbols denoting a syntax checker and a
+major mode respectively.
+
+Add MODE to the `:modes' property of CHECKER, so that CHECKER
+will be used in buffers with MODE."
+ (unless (flycheck-valid-checker-p checker)
+ (error "%s is not a valid syntax checker" checker))
+ (unless (symbolp mode)
+ (error "%s is not a symbol" mode))
+ (push mode (flycheck-checker-get checker 'modes)))
+
+
+;;; Generic syntax checks
+(cl-defstruct (flycheck-syntax-check
+ (:constructor flycheck-syntax-check-new))
+ "Structure for storing syntax check state.
+
+Slots:
+
+`buffer'
+ The buffer being checked.
+
+`checker'
+ The syntax checker being used.
+
+`context'
+ The context object.
+
+`working-directory'
+ Working directory for the syntax checker. Serve as a value for
+ `default-directory' for a checker."
+ buffer checker context working-directory)
+
+(defun flycheck-syntax-check-start (syntax-check callback)
+ "Start a SYNTAX-CHECK with CALLBACK."
+ (let ((checker (flycheck-syntax-check-checker syntax-check))
+ (default-directory
+ (flycheck-syntax-check-working-directory syntax-check)))
+ (setf (flycheck-syntax-check-context syntax-check)
+ (funcall (flycheck-checker-get checker 'start) checker callback))))
+
+(defun flycheck-syntax-check-interrupt (syntax-check)
+ "Interrupt a SYNTAX-CHECK."
+ (let* ((checker (flycheck-syntax-check-checker syntax-check))
+ (interrupt-fn (flycheck-checker-get checker 'interrupt))
+ (context (flycheck-syntax-check-context syntax-check)))
+ (when interrupt-fn
+ (funcall interrupt-fn checker context))))
+
+
+;;; Syntax checking mode
+
+(defvar flycheck-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map flycheck-keymap-prefix flycheck-command-map)
+ ;; We place the menu under a custom menu key. Since this menu key is not
+ ;; present in the menu of the global map, no top-level menu entry is added
+ ;; to the global menu bar. However, it still appears on the mode line
+ ;; lighter.
+ (define-key map [menu-bar flycheck] flycheck-mode-menu-map)
+ map)
+ "Keymap of command `flycheck-mode'.")
+
+(defvar-local flycheck-old-next-error-function nil
+ "Remember the old `next-error-function'.")
+
+(defconst flycheck-hooks-alist
+ '(
+ ;; Handle events that may start automatic syntax checks
+ (after-save-hook . flycheck-handle-save)
+ (after-change-functions . flycheck-handle-change)
+ ;; Handle events that may triggered pending deferred checks
+ (window-configuration-change-hook . flycheck-perform-deferred-syntax-check)
+ (post-command-hook . flycheck-perform-deferred-syntax-check)
+ ;; Teardown Flycheck whenever the buffer state is about to get lost, to
+ ;; clean up temporary files and directories.
+ (kill-buffer-hook . flycheck-teardown)
+ (change-major-mode-hook . flycheck-teardown)
+ (before-revert-hook . flycheck-teardown)
+ ;; Update the error list if necessary
+ (post-command-hook . flycheck-error-list-update-source)
+ (post-command-hook . flycheck-error-list-highlight-errors)
+ ;; Display errors. Show errors at point after commands (like movements) and
+ ;; when Emacs gets focus. Cancel the display timer when Emacs looses focus
+ ;; (as there's no need to display errors if the user can't see them), and
+ ;; hide the error buffer (for large error messages) if necessary. Note that
+ ;; the focus hooks only work on Emacs 24.4 and upwards, but since undefined
+ ;; hooks are perfectly ok we don't need a version guard here. They'll just
+ ;; not work silently.
+ (post-command-hook . flycheck-maybe-display-error-at-point-soon)
+ (focus-in-hook . flycheck-display-error-at-point-soon)
+ (focus-out-hook . flycheck-cancel-error-display-error-at-point-timer)
+ (post-command-hook . flycheck-hide-error-buffer)
+ ;; Immediately show error popups when navigating to an error
+ (next-error-hook . flycheck-display-error-at-point))
+ "Hooks which Flycheck needs to hook in.
+
+The `car' of each pair is a hook variable, the `cdr' a function
+to be added or removed from the hook variable if Flycheck mode is
+enabled and disabled respectively.")
+
+;;;###autoload
+(define-minor-mode flycheck-mode
+ "Flycheck is a minor mode for on-the-fly syntax checking.
+
+In `flycheck-mode' the buffer is automatically syntax-checked
+using the first suitable syntax checker from `flycheck-checkers'.
+Use `flycheck-select-checker' to select a checker for the current
+buffer manually.
+
+If you run into issues, use `\\[flycheck-verify-setup]' to get help.
+
+Flycheck supports many languages out of the box, and many
+additional ones are available on MELPA. Adding new ones is very
+easy. Complete documentation is available online at URL
+`https://www.flycheck.org/en/latest/'. Please report issues and
+request features at URL `https://github.com/flycheck/flycheck'.
+
+Flycheck displays its status in the mode line. In the default
+configuration, it looks like this:
+
+`FlyC' This buffer has not been checked yet.
+`FlyC-' Flycheck doesn't have a checker for this buffer.
+`FlyC*' Flycheck is running. Expect results soon!
+`FlyC:3|2' This buffer contains three warnings and two errors.
+ Use `\\[flycheck-list-errors]' to see the list.
+
+You may also see the following icons:
+`FlyC!' The checker crashed.
+`FlyC.' The last syntax check was manually interrupted.
+`FlyC?' The checker did something unexpected, like exiting with 1
+ but returning no errors.
+
+The following keybindings are available in `flycheck-mode':
+
+\\{flycheck-mode-map}
+\(you can change the prefix by customizing
+`flycheck-keymap-prefix')
+
+If called interactively, enable Flycheck 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."
+ :init-value nil
+ :keymap flycheck-mode-map
+ :lighter flycheck-mode-line
+ :after-hook (flycheck-buffer-automatically 'mode-enabled 'force-deferred)
+ (cond
+ (flycheck-mode
+ (flycheck-clear)
+
+ (pcase-dolist (`(,hook . ,fn) (reverse flycheck-hooks-alist))
+ (add-hook hook fn nil 'local))
+
+ (setq flycheck-old-next-error-function
+ (if flycheck-standard-error-navigation
+ next-error-function
+ :unset))
+ (when flycheck-standard-error-navigation
+ (setq next-error-function #'flycheck-next-error-function))
+
+ ;; This hook must be added globally since otherwise we cannot
+ ;; detect a change from a buffer where Flycheck is enabled to a
+ ;; buffer where Flycheck is not enabled, and therefore cannot
+ ;; notice that there has been any change when the user switches
+ ;; back to the buffer where Flycheck is enabled.
+ (add-hook 'buffer-list-update-hook #'flycheck-handle-buffer-switch))
+ (t
+ (unless (eq flycheck-old-next-error-function :unset)
+ (setq next-error-function flycheck-old-next-error-function))
+
+ (pcase-dolist (`(,hook . ,fn) flycheck-hooks-alist)
+ (remove-hook hook fn 'local))
+
+ (flycheck-teardown))))
+
+
+;;; Syntax checker selection for the current buffer
+(defun flycheck-get-checker-for-buffer ()
+ "Find the checker for the current buffer.
+
+Use the selected checker for the current buffer, if any,
+otherwise search for the best checker from `flycheck-checkers'.
+
+Return checker if there is a checker for the current buffer, or
+nil otherwise."
+ (if flycheck-checker
+ (when (flycheck-may-use-checker flycheck-checker)
+ flycheck-checker)
+ (seq-find #'flycheck-may-use-checker flycheck-checkers)))
+
+(defun flycheck-get-next-checker-for-buffer (checker)
+ "Get the checker to run after CHECKER for the current buffer."
+ (let ((next (seq-find #'flycheck-may-use-next-checker
+ (flycheck-checker-get checker 'next-checkers))))
+ (when next
+ (if (symbolp next) next (cdr next)))))
+
+(defun flycheck-select-checker (checker)
+ "Select CHECKER for the current buffer.
+
+CHECKER is a syntax checker symbol (see `flycheck-checkers') or
+nil. In the former case, use CHECKER for the current buffer,
+otherwise deselect the current syntax checker (if any) and use
+automatic checker selection via `flycheck-checkers'.
+
+If called interactively prompt for CHECKER. With prefix arg
+deselect the current syntax checker and enable automatic
+selection again.
+
+Set `flycheck-checker' to CHECKER and automatically start a new
+syntax check if the syntax checker changed.
+
+CHECKER will be used, even if it is not contained in
+`flycheck-checkers', or if it is disabled via
+`flycheck-disabled-checkers'."
+ (interactive
+ (if current-prefix-arg
+ (list nil)
+ (list (flycheck-read-checker "Select checker: "
+ (flycheck-get-checker-for-buffer)))))
+ (when (not (eq checker flycheck-checker))
+ (unless (or (not checker) (flycheck-may-use-checker checker))
+ (flycheck-verify-checker checker)
+ (user-error "Can't use syntax checker %S in this buffer" checker))
+ (setq flycheck-checker checker)
+ (when flycheck-mode
+ (flycheck-buffer))))
+
+(defun flycheck--toggle-checker (checker enable)
+ "Enable or disable CHECKER for the current buffer.
+
+If ENABLE, re-enable CHECKER by removing it from the buffer-local
+value of `flycheck-disabled-checkers'. Otherwise, add the syntax
+checker to the buffer-local value of `flycheck-disabled-checkers'."
+ (cond
+ (enable
+ ;; We must use `remq' instead of `delq', because we must _not_ modify the
+ ;; list. Otherwise we could potentially modify the global default value,
+ ;; in case the list is the global default.
+ (when (memq checker flycheck-disabled-checkers)
+ (setq flycheck-disabled-checkers
+ (remq checker flycheck-disabled-checkers)))
+ (when (memq checker flycheck--automatically-disabled-checkers)
+ (setq flycheck--automatically-disabled-checkers
+ (remq checker flycheck--automatically-disabled-checkers))))
+ (t (unless (memq checker flycheck-disabled-checkers)
+ (push checker flycheck-disabled-checkers)))))
+
+(defun flycheck-disable-checker (checker &optional enable)
+ "Interactively disable CHECKER for the current buffer.
+
+Prompt for a syntax checker to disable, and add the syntax
+checker to the buffer-local value of
+`flycheck-disabled-checkers'.
+
+With non-nil ENABLE or with prefix arg, prompt for a disabled
+syntax checker and re-enable it by removing it from the
+buffer-local value of `flycheck-disabled-checkers'."
+ (declare
+ (interactive-only "Directly set `flycheck-disabled-checkers' instead"))
+ (interactive
+ (let* ((enable current-prefix-arg)
+ (candidates (if enable
+ (append flycheck-disabled-checkers
+ flycheck--automatically-disabled-checkers)
+ flycheck-checkers))
+ (prompt (if enable "Enable syntax checker: "
+ "Disable syntax checker: ")))
+ (when (and enable (not candidates))
+ (user-error "No syntax checkers disabled in this buffer"))
+ (list (flycheck-read-checker prompt nil nil candidates) enable)))
+ (unless checker
+ (user-error "No syntax checker given"))
+ (flycheck--toggle-checker checker enable)
+ (flycheck-buffer))
+
+
+;;; Syntax checks for the current buffer
+(defvar-local flycheck-current-syntax-check nil
+ "The current syntax check in the this buffer.")
+(put 'flycheck-current-syntax-check 'permanent-local t)
+
+(defun flycheck-start-current-syntax-check (checker)
+ "Start a syntax check in the current buffer with CHECKER.
+
+Set `flycheck-current-syntax-check' accordingly."
+ ;; Allocate the current syntax check *before* starting it. This allows for
+ ;; synchronous checks, which call the status callback immediately in their
+ ;; start function.
+ (let* ((check
+ (flycheck-syntax-check-new
+ :buffer (current-buffer)
+ :checker checker
+ :context nil
+ :working-directory (flycheck-compute-working-directory checker)))
+ (callback (flycheck-buffer-status-callback check)))
+ (setq flycheck-current-syntax-check check)
+ (flycheck-report-status 'running)
+ (flycheck-syntax-check-start check callback)))
+
+(defun flycheck-running-p ()
+ "Determine whether a syntax check is running in the current buffer."
+ (not (null flycheck-current-syntax-check)))
+
+(defun flycheck-stop ()
+ "Stop any ongoing syntax check in the current buffer."
+ (when (flycheck-running-p)
+ (flycheck-syntax-check-interrupt flycheck-current-syntax-check)
+ ;; Remove the current syntax check, to reset Flycheck into a non-running
+ ;; state, and to make `flycheck-report-buffer-checker-status' ignore any
+ ;; status reports from the current syntax check.
+ (setq flycheck-current-syntax-check nil)
+ (flycheck-report-status 'interrupted)))
+
+(defun flycheck-buffer-status-callback (syntax-check)
+ "Create a status callback for SYNTAX-CHECK in the current buffer."
+ (lambda (&rest args)
+ (apply #'flycheck-report-buffer-checker-status
+ syntax-check args)))
+
+(defun flycheck-buffer ()
+ "Start checking syntax in the current buffer.
+
+Get a syntax checker for the current buffer with
+`flycheck-get-checker-for-buffer', and start it."
+ (interactive)
+ (flycheck-clean-deferred-check)
+ (if flycheck-mode
+ (unless (flycheck-running-p)
+ ;; Clear error list and mark all overlays for deletion. We do not
+ ;; delete all overlays immediately to avoid excessive re-displays and
+ ;; flickering, if the same errors gets highlighted again after the check
+ ;; completed.
+ (run-hooks 'flycheck-before-syntax-check-hook)
+ (flycheck-clear-errors)
+ (flycheck-mark-all-overlays-for-deletion)
+ (condition-case err
+ (let* ((checker (flycheck-get-checker-for-buffer)))
+ (if checker
+ (flycheck-start-current-syntax-check checker)
+ (flycheck-clear)
+ (flycheck-report-status 'no-checker)))
+ (error
+ (flycheck-report-failed-syntax-check)
+ (signal (car err) (cdr err)))))
+ (user-error "Flycheck mode disabled")))
+
+(defun flycheck-report-buffer-checker-status
+ (syntax-check status &optional data)
+ "In BUFFER, report a SYNTAX-CHECK STATUS with DATA.
+
+SYNTAX-CHECK is the `flycheck-syntax-check' which reported
+STATUS. STATUS denotes the status of CHECKER, with an optional
+DATA. STATUS may be one of the following symbols:
+
+`errored'
+ The syntax checker has errored. DATA is an optional error
+ message.
+
+ This report finishes the current syntax check.
+
+`interrupted'
+ The syntax checker was interrupted. DATA is ignored.
+
+ This report finishes the current syntax check.
+
+`finished'
+ The syntax checker has finished with a proper error report
+ for the current buffer. DATA is the (potentially empty)
+ list of `flycheck-error' objects reported by the syntax
+ check.
+
+ This report finishes the current syntax check.
+
+`suspicious'
+ The syntax checker encountered a suspicious state, which the
+ user needs to be informed about. DATA is an optional
+ message.
+
+A syntax checker _must_ report a status at least once with any
+symbol that finishes the current syntax checker. Otherwise
+Flycheck gets stuck with the current syntax check.
+
+If CHECKER is not the currently used syntax checker in
+`flycheck-current-syntax-check', the status report is largely
+ignored. Notably, any errors reported by the checker are
+discarded."
+ (let ((buffer (flycheck-syntax-check-buffer syntax-check)))
+ ;; Ignore the status report if the buffer is gone, or if this syntax check
+ ;; isn't the current one in buffer (which can happen if this is an old
+ ;; report of an interrupted syntax check, and a new syntax check was started
+ ;; since this check was interrupted)
+ (when (and (buffer-live-p buffer)
+ (eq syntax-check
+ (buffer-local-value 'flycheck-current-syntax-check buffer)))
+ (with-current-buffer buffer
+ (let ((checker (flycheck-syntax-check-checker syntax-check)))
+ (pcase status
+ ((or `errored `interrupted)
+ (flycheck-report-failed-syntax-check status)
+ (when (eq status 'errored)
+ ;; In case of error, show the error message
+ (message "Error from syntax checker %s: %s"
+ checker (or data "UNKNOWN!"))))
+ (`suspicious
+ (when flycheck-mode
+ (message "Suspicious state from syntax checker %s: %s"
+ checker (or data "UNKNOWN!")))
+ (flycheck-report-status 'suspicious))
+ (`finished
+ (when flycheck-mode
+ ;; Only report errors from the checker if Flycheck Mode is
+ ;; still enabled.
+ (flycheck-finish-current-syntax-check
+ data
+ (flycheck-syntax-check-working-directory syntax-check))))
+ (_
+ (error "Unknown status %s from syntax checker %s"
+ status checker))))))))
+
+(defun flycheck-finish-current-syntax-check (errors working-dir)
+ "Finish the current syntax-check in the current buffer with ERRORS.
+
+ERRORS is a list of `flycheck-error' objects reported by the
+current syntax check in `flycheck-current-syntax-check'.
+
+Report all ERRORS and potentially start any next syntax checkers.
+
+If the current syntax checker reported excessive errors, it is
+disabled via `flycheck-disable-excessive-checker' for subsequent
+syntax checks.
+
+Relative file names in ERRORS will be expanded relative to
+WORKING-DIR."
+ (let* ((syntax-check flycheck-current-syntax-check)
+ (checker (flycheck-syntax-check-checker syntax-check))
+ (errors (flycheck-relevant-errors
+ (flycheck-fill-and-expand-error-file-names
+ (flycheck-filter-errors
+ (flycheck-assert-error-list-p errors) checker)
+ working-dir))))
+ (unless (flycheck-disable-excessive-checker checker errors)
+ (flycheck-report-current-errors errors))
+ (let ((next-checker (flycheck-get-next-checker-for-buffer checker)))
+ (if next-checker
+ (flycheck-start-current-syntax-check next-checker)
+ (setq flycheck-current-syntax-check nil)
+ (flycheck-report-status 'finished)
+ ;; Delete overlays only after the very last checker has run, to avoid
+ ;; flickering on intermediate re-displays
+ (flycheck-delete-marked-overlays)
+ (flycheck-error-list-refresh)
+ (run-hooks 'flycheck-after-syntax-check-hook)
+ (when (eq (current-buffer) (window-buffer))
+ (flycheck-display-error-at-point))
+ ;; Immediately try to run any pending deferred syntax check, which
+ ;; were triggered by intermediate automatic check event, to make sure
+ ;; that we quickly refine outdated error information
+ (flycheck-perform-deferred-syntax-check)))))
+
+(defun flycheck-disable-excessive-checker (checker errors)
+ "Disable CHECKER if it reported excessive ERRORS.
+
+If ERRORS has more items than `flycheck-checker-error-threshold',
+add CHECKER to `flycheck--automatically-disabled-checkers', and
+show a warning.
+
+Return t when CHECKER was disabled, or nil otherwise."
+ (when (and flycheck-checker-error-threshold
+ (> (length errors) flycheck-checker-error-threshold))
+ ;; Disable CHECKER for this buffer
+ ;; (`flycheck--automatically-disabled-checkers' is a local variable).
+ (lwarn '(flycheck syntax-checker) :warning
+ (substitute-command-keys
+ "Syntax checker %s reported too many errors (%s) and is disabled.
+Use `\\[customize-variable] RET flycheck-checker-error-threshold' to
+change the threshold or `\\[universal-argument] \
+\\[flycheck-disable-checker]' to re-enable the checker.")
+ checker (length errors))
+ (push checker flycheck--automatically-disabled-checkers)
+ t))
+
+(defun flycheck-clear (&optional shall-interrupt)
+ "Clear all errors in the current buffer.
+
+With prefix arg or SHALL-INTERRUPT non-nil, also interrupt the
+current syntax check."
+ (interactive "P")
+ (when shall-interrupt
+ (flycheck-stop))
+ (flycheck-delete-all-overlays)
+ (flycheck-clear-errors)
+ (flycheck-error-list-refresh)
+ (flycheck-hide-error-buffer))
+
+(defun flycheck--empty-variables ()
+ "Empty variables used by Flycheck."
+ (kill-local-variable 'flycheck--file-truename-cache)
+ (kill-local-variable 'flycheck--idle-trigger-timer)
+ (kill-local-variable 'flycheck--idle-trigger-conditions)
+ (kill-local-variable 'flycheck--last-error-display-tick))
+
+(defun flycheck-teardown (&optional ignore-global)
+ "Teardown Flycheck in the current buffer.
+
+Completely clear the whole Flycheck state. Remove overlays, kill
+running checks, and empty all variables used by Flycheck.
+
+Unless optional argument IGNORE-GLOBAL is non-nil, check to see
+if no more Flycheck buffers remain (aside from the current
+buffer), and if so then clean up global hooks."
+ (flycheck-safe-delete-temporaries)
+ (flycheck-stop)
+ (flycheck-clean-deferred-check)
+ (flycheck-clear)
+ (flycheck-cancel-error-display-error-at-point-timer)
+ (flycheck--clear-idle-trigger-timer)
+ (flycheck--empty-variables)
+ (unless (or ignore-global
+ (seq-some (lambda (buf)
+ (and (not (equal buf (current-buffer)))
+ (buffer-local-value 'flycheck-mode buf)))
+ (buffer-list)))
+ (flycheck-global-teardown 'ignore-local)))
+
+
+;;; Automatic syntax checking in a buffer
+(defun flycheck-may-check-automatically (&rest conditions)
+ "Determine whether the buffer may be checked under one of CONDITIONS.
+
+Read-only buffers may never be checked automatically.
+
+If CONDITIONS are given, determine whether syntax may be checked
+under at least one of them, according to
+`flycheck-check-syntax-automatically'."
+ (and (not (or buffer-read-only (flycheck-ephemeral-buffer-p)))
+ (file-exists-p default-directory)
+ (or (not conditions)
+ (seq-some
+ (lambda (condition)
+ (memq condition flycheck-check-syntax-automatically))
+ conditions))))
+
+(defvar-local flycheck--idle-trigger-timer nil
+ "Timer used to trigger a syntax check after an idle delay.")
+
+(defvar-local flycheck--idle-trigger-conditions nil
+ "List of conditions under which an idle syntax check will be triggered.
+This will be some subset of the allowable values for
+`flycheck-check-syntax-automatically'.
+
+For example, if the user switches to a buffer and then makes an
+edit, this list will have the values `idle-change' and
+`idle-buffer-switch' in it, at least until the idle timer
+expires.")
+
+(defun flycheck-buffer-automatically (&optional condition force-deferred)
+ "Automatically check syntax at CONDITION.
+
+Syntax is not checked if `flycheck-may-check-automatically'
+returns nil for CONDITION. (CONDITION may be a single condition
+or a list of them.)
+
+The syntax check is deferred if FORCE-DEFERRED is non-nil, or if
+`flycheck-must-defer-check' returns t."
+ (when (and flycheck-mode (if (listp condition)
+ (apply #'flycheck-may-check-automatically
+ condition)
+ (flycheck-may-check-automatically condition)))
+ (flycheck--clear-idle-trigger-timer)
+ (setq flycheck--idle-trigger-conditions nil)
+ (if (or force-deferred (flycheck-must-defer-check))
+ (flycheck-buffer-deferred)
+ (with-demoted-errors "Error while checking syntax automatically: %S"
+ (flycheck-buffer)))))
+
+(defun flycheck--clear-idle-trigger-timer ()
+ "Clear the idle trigger timer."
+ (when flycheck--idle-trigger-timer
+ (cancel-timer flycheck--idle-trigger-timer)
+ (setq flycheck--idle-trigger-timer nil)))
+
+(defun flycheck--handle-idle-trigger (buffer)
+ "Run a syntax check in BUFFER if appropriate.
+This function is called by `flycheck--idle-trigger-timer'."
+ (let ((current-buffer (current-buffer)))
+ (when (buffer-live-p buffer)
+ (with-current-buffer buffer
+ (unless (or flycheck-buffer-switch-check-intermediate-buffers
+ (eq buffer current-buffer))
+ (setq flycheck--idle-trigger-conditions
+ (delq 'idle-buffer-switch
+ flycheck--idle-trigger-conditions)))
+ (when flycheck--idle-trigger-conditions
+ (flycheck-buffer-automatically flycheck--idle-trigger-conditions)
+ (setq flycheck--idle-trigger-conditions nil))))))
+
+(defun flycheck-handle-change (beg end _len)
+ "Handle a buffer change between BEG and END.
+
+BEG and END mark the beginning and end of the change text. _LEN
+is ignored.
+
+Start a syntax check if a new line has been inserted into the
+buffer."
+ ;; Save and restore the match data, as recommended in (elisp)Change Hooks
+ (save-match-data
+ (when flycheck-mode
+ (if (string-match-p (rx "\n") (buffer-substring beg end))
+ (flycheck-buffer-automatically 'new-line 'force-deferred)
+ (when (memq 'idle-change flycheck-check-syntax-automatically)
+ (flycheck--clear-idle-trigger-timer)
+ (cl-pushnew 'idle-change flycheck--idle-trigger-conditions)
+ (setq flycheck--idle-trigger-timer
+ (run-at-time flycheck-idle-change-delay nil
+ #'flycheck--handle-idle-trigger
+ (current-buffer))))))))
+
+(defvar flycheck--last-buffer (current-buffer)
+ "The current buffer or the buffer that was previously current.
+This is usually equal to the current buffer, unless the user just
+switched buffers. After a buffer switch, it is the previous
+buffer.")
+
+(defun flycheck-handle-buffer-switch ()
+ "Handle a possible switch to another buffer.
+
+If a buffer switch actually happened, schedule a syntax check."
+ ;; Switching buffers here is weird, but unfortunately necessary. It
+ ;; turns out that `with-temp-buffer' triggers
+ ;; `buffer-list-update-hook' twice, and the value of
+ ;; `current-buffer' is bogus in one of those triggers (the one just
+ ;; after the temp buffer is killed). If we rely on the bogus value,
+ ;; Flycheck will think that the user is switching back and forth
+ ;; between different buffers during the `with-temp-buffer' call
+ ;; (note: two different normal buffers, not the current buffer and
+ ;; the temp buffer!), and that would trigger spurious syntax checks.
+ ;; It seems that reading (window-buffer) gets us the correct current
+ ;; buffer in all important real-life situations (although it doesn't
+ ;; necessarily catch uses of `set-buffer').
+ (with-current-buffer (window-buffer)
+ (unless (or (equal flycheck--last-buffer (current-buffer))
+ ;; Don't bother keeping track of changes to and from
+ ;; the minibuffer, as they will never require us to
+ ;; run a syntax check.
+ (minibufferp))
+ (setq flycheck--last-buffer (current-buffer))
+ (when (and flycheck-mode
+ (memq 'idle-buffer-switch flycheck-check-syntax-automatically))
+ (flycheck--clear-idle-trigger-timer)
+ (cl-pushnew 'idle-buffer-switch flycheck--idle-trigger-conditions)
+ (setq flycheck--idle-trigger-timer
+ (run-at-time flycheck-idle-buffer-switch-delay nil
+ #'flycheck--handle-idle-trigger
+ (current-buffer)))))))
+
+(defun flycheck-handle-save ()
+ "Handle a save of the buffer."
+ (flycheck-buffer-automatically 'save))
+
+
+;;; Deferred syntax checking
+(defvar-local flycheck-deferred-syntax-check nil
+ "If non-nil, a deferred syntax check is pending.")
+
+(defun flycheck-must-defer-check ()
+ "Determine whether the syntax check has to be deferred.
+
+A check has to be deferred if the buffer is not visible, or if the buffer is
+currently being reverted.
+
+Return t if the check is to be deferred, or nil otherwise."
+ (or (not (get-buffer-window))
+ ;; We defer the syntax check if Flycheck is already running, to
+ ;; immediately start a new syntax check after the current one finished,
+ ;; because the result of the current check will most likely be outdated by
+ ;; the time it is finished.
+ (flycheck-running-p)
+ ;; We must defer checks while a buffer is being reverted, to avoid race
+ ;; conditions while the buffer contents are being restored.
+ revert-buffer-in-progress-p))
+
+(defun flycheck-deferred-check-p ()
+ "Determine whether the current buffer has a deferred check.
+
+Return t if so, or nil otherwise."
+ flycheck-deferred-syntax-check)
+
+(defun flycheck-buffer-deferred ()
+ "Defer syntax check for the current buffer."
+ (setq flycheck-deferred-syntax-check t))
+
+(defun flycheck-clean-deferred-check ()
+ "Clean a deferred syntax checking state."
+ (setq flycheck-deferred-syntax-check nil))
+
+(defun flycheck-perform-deferred-syntax-check ()
+ "Perform the deferred syntax check."
+ (when (flycheck-deferred-check-p)
+ (flycheck-clean-deferred-check)
+ (flycheck-buffer-automatically)))
+
+
+;;; Syntax checking in all buffers
+(defun flycheck-may-enable-mode ()
+ "Determine whether Flycheck mode may be enabled.
+
+Flycheck mode is not enabled for
+
+- the minibuffer,
+- `fundamental-mode'
+- major modes whose `mode-class' property is `special',
+- ephemeral buffers (see `flycheck-ephemeral-buffer-p'),
+- encrypted buffers (see `flycheck-encrypted-buffer-p'),
+- remote files (see `file-remote-p'),
+- and major modes excluded by `flycheck-global-modes'.
+
+Return non-nil if Flycheck mode may be enabled, and nil
+otherwise."
+ (and (pcase flycheck-global-modes
+ ;; Whether `major-mode' is disallowed by `flycheck-global-modes'
+ (`t t)
+ (`(not . ,modes) (not (memq major-mode modes)))
+ (modes (memq major-mode modes)))
+ (not (or (minibufferp)
+ (eq major-mode 'fundamental-mode)
+ (eq (get major-mode 'mode-class) 'special)
+ (flycheck-ephemeral-buffer-p)
+ (flycheck-encrypted-buffer-p)
+ (and (buffer-file-name)
+ (file-remote-p (buffer-file-name) 'method))))))
+
+(defun flycheck-mode-on-safe ()
+ "Enable command `flycheck-mode' if it is safe to do so.
+
+Command `flycheck-mode' is only enabled if
+`flycheck-may-enable-mode' returns a non-nil result."
+ (when (flycheck-may-enable-mode)
+ (flycheck-mode)))
+
+;;;###autoload
+(define-globalized-minor-mode global-flycheck-mode flycheck-mode
+ flycheck-mode-on-safe
+ :init-value nil
+ ;; Do not expose Global Flycheck Mode on customize interface, because the
+ ;; interaction between package.el and customize is currently broken. See
+ ;; https://github.com/flycheck/flycheck/issues/595
+
+ ;; :require 'flycheck :group
+ ;; 'flycheck
+ )
+
+(defun flycheck-global-teardown (&optional ignore-local)
+ "Teardown Flycheck in all buffers.
+
+Completely clear the whole Flycheck state in all buffers, stop
+all running checks, remove all temporary files, and empty all
+variables of Flycheck.
+
+Also remove global hooks. (If optional argument IGNORE-LOCAL is
+non-nil, then only do this and skip per-buffer teardown.)"
+ (unless ignore-local
+ (dolist (buffer (buffer-list))
+ (when (buffer-live-p buffer)
+ (with-current-buffer buffer
+ (when flycheck-mode
+ (flycheck-teardown 'ignore-global))))))
+ (remove-hook 'buffer-list-update-hook #'flycheck-handle-buffer-switch))
+
+;; Clean up the entire state of Flycheck when Emacs is killed, to get rid of any
+;; pending temporary files.
+(add-hook 'kill-emacs-hook #'flycheck-global-teardown)
+
+
+;;; Errors from syntax checks
+(cl-defstruct (flycheck-error
+ (:constructor nil)
+ (:constructor
+ flycheck-error-new
+ (&key
+ line column end-line end-column
+ buffer checker filename message level id group
+ &aux (-end-line end-line) (-end-column end-column)))
+ (:constructor
+ flycheck-error-new-at
+ (line
+ column
+ &optional level message
+ &key end-line end-column checker id group
+ (filename (buffer-file-name)) (buffer (current-buffer))
+ &aux (-end-line end-line) (-end-column end-column)))
+ (:constructor
+ flycheck-error-new-at-pos
+ (pos
+ &optional level message
+ &key end-pos checker id group
+ (filename (buffer-file-name)) (buffer (current-buffer))
+ &aux
+ ((line . column)
+ (if pos (flycheck-line-column-at-pos pos)
+ '(nil . nil)))
+ ((-end-line . -end-column)
+ (if end-pos (flycheck-line-column-at-pos end-pos)
+ '(nil . nil))))))
+ "Structure representing an error reported by a syntax checker.
+Slots:
+
+`buffer'
+ The buffer that the error was reported for, as buffer object.
+
+`checker'
+ The syntax checker which reported this error, as symbol.
+
+`filename'
+ The file name the error refers to, as string.
+
+`line'
+ The line on which the error starts, as number.
+
+`column' (optional)
+ The column at which the error starts, as number.
+
+ For compatibility with external tools and unlike Emacs
+ itself (e.g. in Compile Mode) Flycheck uses _1-based_
+ columns: The first character on a line is column 1.
+
+ Occasionally some tools try to proactively adapt to Emacs
+ and emit 0-based columns automatically. In these cases, the
+ columns must be adjusted for Flycheck, see
+ `flycheck-increment-error-columns'.
+
+ If nil, the whole line is highlighted.
+
+`end-line' (optional)
+ The line on which the error ends. If nil, this is computed according to
+ `flycheck-highlighting-mode'.
+
+`end-column'
+ The column at which the error ends. If nil, this is computed according to
+ `flycheck-highlighting-mode'. Error intervals are right-open: the
+ end-column points to the first character not included in the error. For
+ example, 1:1 is an empty range. and in \"line-number-at-pos\", the range
+ 6:12 covers the word \"number\".
+
+`message' (optional)
+ The error message as a string, if any.
+
+`level'
+ The error level, as either `info', `warning' or `error'.
+
+`id' (optional)
+ An ID identifying the kind of error.
+
+`group' (optional)
+ A symbol identifying the group the error belongs to.
+
+ Some tools will emit multiple errors that relate to the same
+ issue (e.g., lifetime errors in Rust). All related errors
+ collected by a checker should have the same `group` value,
+ in order to be able to present them to the user.
+
+ See `flycheck-related-errors`."
+ buffer checker filename line column message level id group
+ ;; The fields below are at the end of the record to preserve backwards
+ ;; compatibility; see https://github.com/flycheck/flycheck/pull/1400 and
+ ;; https://lists.gnu.org/archive/html/emacs-devel/2018-07/msg00436.html
+ -end-line -end-column)
+
+;; These accessors are defined for backwards compatibility
+;; FIXME: Clean up once package.el learns how to recompile dependencies.
+
+(defun flycheck-error-end-line (err)
+ "Return the end line of a Flycheck error ERR."
+ (condition-case nil (flycheck-error--end-line err)
+ (args-out-of-range nil)))
+
+(defun flycheck-error-end-column (err)
+ "Return the end column of a Flycheck error ERR."
+ (condition-case nil (flycheck-error--end-column err)
+ (args-out-of-range nil)))
+
+(defun flycheck-error--set-end-line (err line)
+ "Set the end line of a Flycheck error ERR to LINE."
+ (condition-case nil (setf (flycheck-error--end-line err) line)
+ (args-out-of-range nil)))
+
+(defun flycheck-error--set-end-column (err column)
+ "Set the end column of a Flycheck error ERR to COLUMN."
+ (condition-case nil (setf (flycheck-error--end-column err) column)
+ (args-out-of-range nil)))
+
+(gv-define-simple-setter flycheck-error-end-line
+ flycheck-error--set-end-line)
+(gv-define-simple-setter flycheck-error-end-column
+ flycheck-error--set-end-column)
+
+(defmacro flycheck-error-with-buffer (err &rest forms)
+ "Switch to the buffer of ERR and evaluate FORMS.
+
+If the buffer of ERR is not live, FORMS are not evaluated."
+ (declare (indent 1) (debug t))
+ `(when (buffer-live-p (flycheck-error-buffer ,err))
+ (with-current-buffer (flycheck-error-buffer ,err)
+ ,@forms)))
+
+(defun flycheck--exact-region (err)
+ "Get the region of ERR, if ERR specifies a range.
+
+Return a cons cell `(BEG . END)'. If the input range is empty,
+it is expanded to cover at least one character so that END is
+always greater than BEG. If ERR doesn't specify an end-column
+return nil."
+ (-if-let* ((line (flycheck-error-line err))
+ (column (flycheck-error-column err))
+ (end-line (or (flycheck-error-end-line err) line))
+ (end-column (flycheck-error-end-column err)))
+ ;; Ignoring fields speeds up calls to `line-end-position'.
+ (let* ((inhibit-field-text-motion t)
+ (beg (flycheck-line-column-to-position line column))
+ (end (flycheck-line-column-to-position end-line end-column)))
+ (cond
+ ((< beg end) (cons beg end))
+ ((= end (point-max)) (cons (1- end) end))
+ (t (cons end (1+ end)))))))
+
+(defun flycheck--line-region (pos)
+ "Get the line region of position POS.
+
+Return a cons cell `(BEG . END)' where BEG is the first
+non-whitespace character on the line ERR refers to, and END the
+end of the line."
+ (save-excursion
+ (goto-char pos)
+ (forward-line 0)
+ (let ((bol (point))
+ (end (line-end-position)))
+ ;; Move to the beginning of this line's indentation, similar to
+ ;; `back-to-indentation'
+ (skip-syntax-forward " " end)
+ (backward-prefix-chars)
+ ;; If the current line is blank, highlight it in full; if it's
+ ;; empty, include the previous line break character(s) to have
+ ;; any region at all (when called with 0, `line-end-position'
+ ;; gives us the end of the previous line).
+ (cons (if (eolp) (if (= bol end) (line-end-position 0) bol) (point))
+ end))))
+
+(defun flycheck--column-region (pos)
+ "Get the column region of position POS.
+
+Return a cons cell `(BEG . END)' where BEG is the character
+before the column, and END the actual column."
+ (save-excursion
+ (goto-char pos)
+ ;; (eobp): No enough lines in the buffer
+ (if (eobp) (cons (1- (point-max)) (point-max))
+ (cons pos (1+ pos)))))
+
+(defun flycheck-bounds-of-thing-at-point (thing pos)
+ "Get the region of THING at position POS.
+
+THING is a understood by `thing-at-point'.
+
+Return a cons cell `(BEG . END)' where BEG is the beginning of
+the THING at the column, and END the end of the THING."
+ (save-excursion
+ (goto-char pos)
+ (bounds-of-thing-at-point thing)))
+
+(defun flycheck--approximate-region (err mode)
+ "Compute the region of ERR based on MODE and ERR's line and column."
+ ;; Ignoring fields speeds up calls to `line-end-position'.
+ (let* ((inhibit-field-text-motion t)
+ (line (flycheck-error-line err))
+ (column (flycheck-error-column err))
+ (beg (flycheck-line-column-to-position line (or column 1))))
+ (if (or (null column)
+ (eq mode 'lines))
+ (flycheck--line-region beg)
+ (or (pcase mode
+ (`symbols
+ ;; Ensure that we're on a word or symbol. See
+ ;; https://github.com/flycheck/flycheck/issues/1519
+ (and (<= (point-min) beg) (< beg (point-max))
+ (memq (char-syntax (char-after beg)) '(?w ?_))
+ (flycheck-bounds-of-thing-at-point 'symbol beg)))
+ (`sexps
+ (flycheck-bounds-of-thing-at-point 'sexp beg)))
+ (flycheck--column-region beg)))))
+
+(defun flycheck-error-region-for-mode (err mode)
+ "Get the region of ERR for the highlighting MODE.
+
+ERR is a Flycheck error. If its position is fully specified, use
+that to compute a region; otherwise, use MODE, as documented in
+`flycheck-highlighting-mode'. If MODE is nil, signal an error."
+ (flycheck-error-with-buffer err
+ (save-restriction
+ (widen)
+ (or (flycheck--exact-region err)
+ (flycheck--approximate-region err mode)))))
+
+(defun flycheck-error-pos (err)
+ "Get the buffer position of ERR.
+
+ERR is a Flycheck error whose position to get.
+
+The error position is the error column, or the first
+non-whitespace character of the error line, if ERR has no error column."
+ (car (flycheck-error-region-for-mode
+ err flycheck-highlighting-mode)))
+
+(defun flycheck-error-format-snippet (err &optional max-length)
+ "Extract the text that ERR refers to from the buffer.
+
+Newlines and blanks are replaced by single spaces. If ERR
+doesn't include an end-position, return nil.
+
+MAX-LENGTH is how many characters to read from the buffer, at
+most. It defaults to 20."
+ (flycheck-error-with-buffer err
+ (save-restriction
+ (widen)
+ (pcase (flycheck--exact-region err)
+ (`(,beg . ,end)
+ (truncate-string-to-width
+ (replace-regexp-in-string
+ "\\s-+" " " (buffer-substring beg (min end (point-max))))
+ (or max-length 20) nil nil t))))))
+
+(defun flycheck-error-format-message-and-id (err &optional include-snippet)
+ "Format the message and id of ERR as human-readable string.
+
+If INCLUDE-SNIPPET is non-nil, prepend the message with a snippet
+of the text that the error applies to (such text can only be
+determined if the error contains a full span, not just a
+beginning position)."
+ (let* ((id (flycheck-error-id err))
+ (fname (flycheck-error-filename err))
+ (other-file-p (and fname (not (equal fname (buffer-file-name))))))
+ (concat (and other-file-p (format "In %S:\n" (file-relative-name fname)))
+ (and include-snippet
+ (-when-let* ((snippet (flycheck-error-format-snippet err)))
+ (flycheck--format-message "`%s': " snippet)))
+ (or (flycheck-error-message err)
+ (format "Unknown %S" (flycheck-error-level err)))
+ (and id (format " [%s]" id)))))
+
+(defun flycheck-error-format-position (err)
+ "Format the position of ERR as a human-readable string."
+ (let ((line (flycheck-error-line err))
+ (column (flycheck-error-column err))
+ (end-line (flycheck-error-end-line err))
+ (end-column (flycheck-error-end-column err)))
+ (if (and line column)
+ (if (or (null end-line) (equal line end-line))
+ (if (or (null end-column) (equal column (1- end-column)))
+ (format "%d:%d" line column)
+ (format "%d:%d-%d" line column end-column))
+ (format "(%d:%d)-(%d:%d)" line column end-line end-column))
+ (if (or (null end-line) (equal line end-line))
+ (format "%d" line)
+ (format "%d-%d" line end-line)))))
+
+(defun flycheck-error-format (err &optional with-file-name)
+ "Format ERR as human-readable string, optionally WITH-FILE-NAME.
+
+Return a string that represents the given ERR. If WITH-FILE-NAME
+is given and non-nil, include the file-name as well, otherwise
+omit it."
+ (let* ((level (symbol-name (flycheck-error-level err)))
+ (checker (symbol-name (flycheck-error-checker err)))
+ (format `(,@(when with-file-name
+ (list (flycheck-error-filename err) ":"))
+ ,(flycheck-error-format-position err) ":"
+ ,level ": "
+ ,(flycheck-error-format-message-and-id err)
+ " (" ,checker ")")))
+ (apply #'concat format)))
+
+(defun flycheck-error-< (err1 err2)
+ "Determine whether ERR1 is less than ERR2 by location."
+ (let ((l1 (flycheck-error-line err1))
+ (l2 (flycheck-error-line err2)))
+ (if (/= l1 l2)
+ (< l1 l2)
+ (let ((c1 (or (flycheck-error-column err1) 1))
+ (c2 (or (flycheck-error-column err2) 1)))
+ (if (/= c1 c2)
+ (< c1 c2)
+ (let ((el1 (or (flycheck-error-end-line err1) l1))
+ (el2 (or (flycheck-error-end-line err2) l2)))
+ (if (/= el1 el2)
+ (< el1 el2)
+ (let ((cl1 (or (flycheck-error-end-column err1) 1))
+ (cl2 (or (flycheck-error-end-column err2) 1)))
+ (< cl1 cl2)))))))))
+
+(defun flycheck-error-level-< (err1 err2)
+ "Determine whether ERR1 is less than ERR2 by error level.
+
+Like `flycheck-error-<', but compares by error level severity
+first. Levels of the same severity are compared by name."
+ (let* ((level1 (flycheck-error-level err1))
+ (level2 (flycheck-error-level err2))
+ (severity1 (flycheck-error-level-severity level1))
+ (severity2 (flycheck-error-level-severity level2)))
+ (cond
+ ((= severity1 severity2)
+ (if (string= level1 level2)
+ (flycheck-error-< err1 err2)
+ (string< level1 level2)))
+ (t (< severity1 severity2)))))
+
+(defun flycheck-assert-error-list-p (errors)
+ "Assert that all items in ERRORS are of `flycheck-error' type.
+
+Signal an error if any item in ERRORS is not a `flycheck-error'
+object, as by `flycheck-error-p'. Otherwise return ERRORS
+again."
+ (unless (listp errors)
+ (signal 'wrong-type-argument (list 'listp errors)))
+ (dolist (err errors)
+ (unless (flycheck-error-p err)
+ (signal 'wrong-type-argument (list 'flycheck-error-p err))))
+ errors)
+
+
+;;; Errors in the current buffer
+(defvar-local flycheck-current-errors nil
+ "A list of all errors and warnings in the current buffer.")
+
+(defun flycheck-report-current-errors (errors)
+ "Report ERRORS in the current buffer.
+
+Add ERRORS to `flycheck-current-errors' and process each error
+with `flycheck-process-error-functions'."
+ (setq flycheck-current-errors (append errors flycheck-current-errors))
+ (overlay-recenter (point-max))
+ ;; We can't use `seq-sort-by' because it's not in Emacs 25's built-in `seq',
+ ;; and installing an updated version doesn't help (this is a package.el bug;
+ ;; see https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg01974.html).
+ (seq-do (lambda (err)
+ (run-hook-with-args-until-success 'flycheck-process-error-functions
+ err))
+ (seq-sort (lambda (e1 e2)
+ (< (flycheck-error-line e1) (flycheck-error-line e2)))
+ errors)))
+
+(defun flycheck-clear-errors ()
+ "Remove all error information from the current buffer."
+ (setq flycheck-current-errors nil)
+ (flycheck-report-status 'not-checked))
+
+(defun flycheck-fill-and-expand-error-file-names (errors directory)
+ "Fill and expand file names in ERRORS relative to DIRECTORY.
+
+Expand all file names of ERRORS against DIRECTORY. If the file
+name of an error is nil fill in the result of function
+`buffer-file-name' in the current buffer.
+
+Return ERRORS, modified in-place."
+ (seq-do (lambda (err)
+ (setf (flycheck-error-filename err)
+ (-if-let (filename (flycheck-error-filename err))
+ (expand-file-name filename directory)
+ (buffer-file-name))))
+ errors)
+ errors)
+
+(defun flycheck-relevant-error-other-file-p (err)
+ "Determine whether ERR is a relevant error for another file."
+ (let ((file-name (flycheck-error-filename err)))
+ (and file-name
+ flycheck-relevant-error-other-file-show
+ (or (null buffer-file-name)
+ (not (flycheck-same-files-p buffer-file-name file-name)))
+ (<= (flycheck-error-level-severity
+ flycheck-relevant-error-other-file-minimum-level)
+ (flycheck-error-level-severity (flycheck-error-level err))))))
+
+(defun flycheck-relevant-error-p (err)
+ "Determine whether ERR is relevant for the current buffer.
+
+Return t if ERR may be shown for the current buffer, or nil
+otherwise."
+ (flycheck-error-with-buffer err
+ (let ((file-name (flycheck-error-filename err))
+ (message (flycheck-error-message err)))
+ (and
+ (or
+ ;; Neither the error nor buffer have a file name
+ (and (not file-name) (not buffer-file-name))
+ ;; Both have files, and they match
+ (and buffer-file-name file-name
+ (flycheck-same-files-p file-name buffer-file-name))
+ ;; This is a significant error from another file
+ (flycheck-relevant-error-other-file-p err))
+ message
+ (not (string-empty-p message))
+ ;; Errors without line numbers are discarded. If a linter
+ ;; reports relevant errors without line numbers, use
+ ;; `flycheck-fill-empty-line-numbers' as the checker's
+ ;; `:error-filter' to set them to line 0.
+ (flycheck-error-line err)))))
+
+(defun flycheck-relevant-errors (errors)
+ "Filter the relevant errors from ERRORS.
+
+Return a list of all errors that are relevant for their
+corresponding buffer."
+ (seq-filter #'flycheck-relevant-error-p errors))
+
+(defun flycheck-related-errors (err &optional error-set)
+ "Get all the errors that are in the same group as ERR.
+
+Return a list of all errors (from ERROR-SET) that have the same
+`flycheck-error-group' as ERR, including ERR itself.
+
+If ERROR-SET is nil, `flycheck-current-errors' is used instead."
+ (let ((group (flycheck-error-group err))
+ (checker (flycheck-error-checker err)))
+ (if group
+ (seq-filter (lambda (e)
+ (and (eq (flycheck-error-checker e) checker)
+ (eq (flycheck-error-group e) group)))
+ (or error-set flycheck-current-errors))
+ (list err))))
+
+
+;;; Status reporting for the current buffer
+(defvar-local flycheck-last-status-change 'not-checked
+ "The last status change in the current buffer.")
+
+(defun flycheck-report-failed-syntax-check (&optional status)
+ "Report a failed Flycheck syntax check with STATUS.
+
+STATUS is a status symbol for `flycheck-report-status',
+defaulting to `errored'.
+
+Clear Flycheck state, run `flycheck-syntax-check-failed-hook' and
+report an error STATUS."
+ (flycheck-clear)
+ (setq flycheck-current-syntax-check nil)
+ (run-hooks 'flycheck-syntax-check-failed-hook)
+ (flycheck-report-status (or status 'errored)))
+
+(defun flycheck-report-status (status)
+ "Report Flycheck STATUS.
+
+STATUS is one of the following symbols:
+
+`not-checked'
+ The current buffer was not checked.
+
+`no-checker'
+ Automatic syntax checker selection did not find a suitable
+ syntax checker.
+
+`running'
+ A syntax check is now running in the current buffer.
+
+`errored'
+ The current syntax check has errored.
+
+`finished'
+ The current syntax check was finished normally.
+
+`interrupted'
+ The current syntax check was interrupted.
+
+`suspicious'
+ The last syntax check had a suspicious result.
+
+Set `flycheck-last-status-change' and call
+`flycheck-status-changed-functions' with STATUS. Afterwards
+refresh the mode line."
+ (setq flycheck-last-status-change status)
+ (run-hook-with-args 'flycheck-status-changed-functions status)
+ (force-mode-line-update))
+
+(defun flycheck-mode-line-status-text (&optional status)
+ "Get a text describing STATUS for use in the mode line.
+
+STATUS defaults to `flycheck-last-status-change' if omitted or
+nil."
+ (let ((text (pcase (or status flycheck-last-status-change)
+ (`not-checked "")
+ (`no-checker "-")
+ (`running "*")
+ (`errored "!")
+ (`finished
+ (let-alist (flycheck-count-errors flycheck-current-errors)
+ (if (or .error .warning)
+ (format ":%s|%s" (or .error 0) (or .warning 0))
+ "")))
+ (`interrupted ".")
+ (`suspicious "?"))))
+ (concat " " flycheck-mode-line-prefix text)))
+
+
+;;; Error levels
+(defun flycheck-make-margin-spec (margin-str face)
+ "Make a display spec to indicate errors in the margins.
+
+Returns MARGIN-STR with FACE applied."
+ (propertize margin-str 'face `(,face default)))
+
+(defconst flycheck-default-margin-str "»"
+ "String used to indicate errors in the margins.")
+
+(defconst flycheck-default-margin-continuation-str "⋮"
+ "String used to indicate continuation lines in the margins.")
+
+;;;###autoload
+(defun flycheck-define-error-level (level &rest properties)
+ "Define a new error LEVEL with PROPERTIES.
+
+The following PROPERTIES constitute an error level:
+
+`:severity SEVERITY'
+ A number denoting the severity of this level. The higher
+ the number, the more severe is this level compared to other
+ levels. Defaults to 0; info is -10, warning is 10, and
+ error is 100.
+
+ The severity is used by `flycheck-error-level-<' to
+ determine the ordering of errors according to their levels.
+
+`:compilation-level LEVEL'
+
+ A number indicating the broad class of messages that errors
+ at this level belong to: one of 0 (info), 1 (warning), or
+ 2 or nil (error). Defaults to nil.
+
+ This is used by `flycheck-checker-pattern-to-error-regexp'
+ to map error levels into `compilation-mode''s hierarchy and
+ to get proper highlighting of errors in `compilation-mode'.
+
+`:overlay-category CATEGORY'
+ A symbol denoting the overlay category to use for error
+ highlight overlays for this level. See Info
+ node `(elisp)Overlay Properties' for more information about
+ overlay categories.
+
+ A category for an error level overlay should at least define
+ the `face' property, for error highlighting. Another useful
+ property for error level categories is `priority', to
+ influence the stacking of multiple error level overlays.
+
+`:fringe-bitmap BITMAPS'
+ A fringe bitmap symbol denoting the bitmap to use for fringe
+ indicators for this level, or a cons of two bitmaps (one for
+ narrow fringes and one for wide fringes). See Info node
+ `(elisp)Fringe Bitmaps' for more information about fringe
+ bitmaps, including a list of built-in fringe bitmaps.
+
+`:fringe-face FACE'
+ A face symbol denoting the face to use for fringe indicators
+ for this level.
+
+`:margin-spec SPEC'
+ A display specification indicating what to display in the
+ margin when `flycheck-indication-mode' is `left-margin' or
+ `right-margin'. See Info node `(elisp)Displaying in the
+ Margins'. If omitted, Flycheck generates an image spec from
+ the fringe bitmap.
+
+`:error-list-face FACE'
+ A face symbol denoting the face to use for messages of this
+ level in the error list. See `flycheck-list-errors'."
+ (declare (indent 1))
+ (setf (get level 'flycheck-error-level) t)
+ (setf (get level 'flycheck-error-severity)
+ (or (plist-get properties :severity) 0))
+ (setf (get level 'flycheck-compilation-level)
+ (plist-get properties :compilation-level))
+ (setf (get level 'flycheck-overlay-category)
+ (plist-get properties :overlay-category))
+ (setf (get level 'flycheck-fringe-bitmaps)
+ (let ((bitmap (plist-get properties :fringe-bitmap)))
+ (if (consp bitmap) bitmap (cons bitmap bitmap))))
+ ;; Kept for compatibility
+ (setf (get level 'flycheck-fringe-bitmap-double-arrow)
+ (car (get level 'flycheck-fringe-bitmaps)))
+ (setf (get level 'flycheck-fringe-face)
+ (plist-get properties :fringe-face))
+ (setf (get level 'flycheck-margin-spec)
+ (or (plist-get properties :margin-spec)
+ (flycheck-make-margin-spec
+ flycheck-default-margin-str
+ (or (get level 'flycheck-fringe-face) 'default))))
+ (setf (get level 'flycheck-margin-continuation)
+ (flycheck-make-margin-spec
+ flycheck-default-margin-continuation-str
+ (or (get level 'flycheck-fringe-face) 'default)))
+ (setf (get level 'flycheck-error-list-face)
+ (plist-get properties :error-list-face)))
+
+(defun flycheck-error-level-p (level)
+ "Determine whether LEVEL is a Flycheck error level."
+ (get level 'flycheck-error-level))
+
+(defun flycheck-error-level-severity (level)
+ "Get the numeric severity of LEVEL."
+ (or (get level 'flycheck-error-severity) 0))
+
+(defun flycheck-error-level-compilation-level (level)
+ "Get the compilation level for LEVEL."
+ (get level 'flycheck-compilation-level))
+
+(defun flycheck-error-level-overlay-category (level)
+ "Get the overlay category for LEVEL."
+ (get level 'flycheck-overlay-category))
+
+(defun flycheck-error-level-margin-spec (level)
+ "Get the margin spec for LEVEL."
+ (get level 'flycheck-margin-spec))
+
+(defun flycheck-error-level-margin-continuation-spec (level)
+ "Get the margin continuation spec for LEVEL."
+ (get level 'flycheck-margin-continuation))
+
+(defun flycheck-error-level-fringe-bitmap (level &optional hi-res)
+ "Get the fringe bitmap for LEVEL.
+
+Optional argument HI-RES non-nil means that the returned bitmap
+will be the high resolution version."
+ (let ((bitmaps (get level 'flycheck-fringe-bitmaps)))
+ (if hi-res (cdr bitmaps) (car bitmaps))))
+
+(defun flycheck-error-level-fringe-face (level)
+ "Get the fringe face for LEVEL."
+ (get level 'flycheck-fringe-face))
+
+(defun flycheck-error-level-error-list-face (level)
+ "Get the error list face for LEVEL."
+ (get level 'flycheck-error-list-face))
+
+(defun flycheck-error-level-make-indicator (level side &optional continuation)
+ "Create the fringe or margin icon for LEVEL at SIDE.
+
+Return a propertized string that shows an indicator according
+to LEVEL and the given fringe or margin SIDE.
+
+LEVEL is a Flycheck error level defined with
+`flycheck-define-error-level', and SIDE is either `left-fringe',
+`right-fringe', `left-margin', or `right-margin'.
+
+CONTINUATION indicates which fringe bitmap or margin spec to use:
+either the `:fringe-bitmap' and `:margin-spec' properties of
+LEVEL when CONTINUATION is nil or omitted, or bitmaps and specs
+indicating an error spanning more than one line.
+
+Return a propertized string representing the fringe icon,
+intended for use as `before-string' of an overlay to actually
+show the indicator."
+ (propertize
+ "!" 'display
+ (pcase side
+ ((or `left-fringe `right-fringe)
+ (list side
+ (if continuation 'flycheck-fringe-bitmap-continuation
+ (let* ((fringe-width
+ (pcase side
+ (`left-fringe (car (window-fringes)))
+ (`right-fringe (cadr (window-fringes)))))
+ (high-res (>= fringe-width 16)))
+ (flycheck-error-level-fringe-bitmap level high-res)))
+ (flycheck-error-level-fringe-face level)))
+ ((or `left-margin `right-margin)
+ `((margin ,side)
+ ,(or (if continuation
+ (flycheck-error-level-margin-continuation-spec level)
+ (flycheck-error-level-margin-spec level))
+ "")))
+ (_ (error "Invalid fringe side: %S" side)))))
+
+(define-obsolete-function-alias
+ 'flycheck-error-level-make-fringe-icon
+ 'flycheck-error-level-make-indicator
+ "33")
+
+
+;;; Built-in error levels
+(defconst flycheck-fringe-bitmap-double-arrow
+ [#b11011000
+ #b01101100
+ #b00110110
+ #b00011011
+ #b00110110
+ #b01101100
+ #b11011000]
+ "Bitmaps used to indicate errors in the fringes.")
+
+(defconst flycheck-fringe-bitmap-double-arrow-hi-res
+ [#b1111001111000000
+ #b0111100111100000
+ #b0011110011110000
+ #b0001111001111000
+ #b0000111100111100
+ #b0000011110011110
+ #b0000011110011110
+ #b0000111100111100
+ #b0001111001111000
+ #b0011110011110000
+ #b0111100111100000
+ #b1111001111000000]
+ "High-resolution bitmap used to indicate errors in the fringes.")
+
+(defconst flycheck-fringe-bitmap-continuation
+ [#b1000000010000000
+ #b0010000000100000
+ #b0000100000001000
+ #b0000001000000010]
+ "Bitmap used to indicate continuation lines in the fringes.")
+
+(when (fboundp 'define-fringe-bitmap) ;; #ifdef HAVE_WINDOW_SYSTEM
+ (define-fringe-bitmap
+ 'flycheck-fringe-bitmap-double-arrow
+ flycheck-fringe-bitmap-double-arrow)
+ (define-fringe-bitmap
+ 'flycheck-fringe-bitmap-double-arrow-hi-res
+ flycheck-fringe-bitmap-double-arrow-hi-res
+ nil 16)
+ (define-fringe-bitmap
+ 'flycheck-fringe-bitmap-continuation
+ flycheck-fringe-bitmap-continuation
+ nil 16 '(top repeat)))
+
+(defun flycheck-redefine-standard-error-levels
+ (&optional margin-str fringe-bitmap)
+ "Redefine Flycheck's standard error levels.
+
+This is useful to change the character drawn in the
+margins (MARGIN-STR, a string) or the bitmap drawn in the
+fringes (FRINGE-BITMAP, a fringe bitmap symbol or a cons of such
+symbols, as in `flycheck-define-error-level')."
+ (unless margin-str
+ (setq margin-str flycheck-default-margin-str))
+
+ (unless fringe-bitmap
+ (setq fringe-bitmap
+ (cons 'flycheck-fringe-bitmap-double-arrow
+ 'flycheck-fringe-bitmap-double-arrow-hi-res)))
+
+ (setf (get 'flycheck-error-overlay 'face) 'flycheck-error)
+ (setf (get 'flycheck-error-overlay 'priority) 110)
+
+ (flycheck-define-error-level 'error
+ :severity 100
+ :compilation-level 2
+ :overlay-category 'flycheck-error-overlay
+ :margin-spec (flycheck-make-margin-spec margin-str 'flycheck-fringe-error)
+ :fringe-bitmap fringe-bitmap
+ :fringe-face 'flycheck-fringe-error
+ :error-list-face 'flycheck-error-list-error)
+
+ (setf (get 'flycheck-warning-overlay 'face) 'flycheck-warning)
+ (setf (get 'flycheck-warning-overlay 'priority) 100)
+
+ (flycheck-define-error-level 'warning
+ :severity 10
+ :compilation-level 1
+ :overlay-category 'flycheck-warning-overlay
+ :margin-spec (flycheck-make-margin-spec margin-str 'flycheck-fringe-warning)
+ :fringe-bitmap fringe-bitmap
+ :fringe-face 'flycheck-fringe-warning
+ :error-list-face 'flycheck-error-list-warning)
+
+ (setf (get 'flycheck-info-overlay 'face) 'flycheck-info)
+ (setf (get 'flycheck-info-overlay 'priority) 90)
+
+ (flycheck-define-error-level 'info
+ :severity -10
+ :compilation-level 0
+ :overlay-category 'flycheck-info-overlay
+ :margin-spec (flycheck-make-margin-spec margin-str 'flycheck-fringe-info)
+ :fringe-bitmap fringe-bitmap
+ :fringe-face 'flycheck-fringe-info
+ :error-list-face 'flycheck-error-list-info))
+
+(flycheck-redefine-standard-error-levels)
+
+
+;;; Error filtering
+(defun flycheck-filter-errors (errors checker)
+ "Filter ERRORS from CHECKER.
+
+Apply the error filter of CHECKER to ERRORs and return the
+result. If CHECKER has no error filter, fall back to
+`flycheck-sanitize-errors'."
+ (let ((filter (or (flycheck-checker-get checker 'error-filter)
+ #'flycheck-sanitize-errors)))
+ (funcall filter errors)))
+
+(defun flycheck-sanitize-errors (errors)
+ "Sanitize ERRORS.
+
+Sanitize ERRORS by trimming leading and trailing whitespace in
+all error messages, and by replacing 0 columns and empty error
+messages with nil.
+
+Returns sanitized ERRORS."
+ (dolist (err errors)
+ (flycheck-error-with-buffer err
+ (let ((message (flycheck-error-message err))
+ (id (flycheck-error-id err)))
+ (when message
+ (setq message (string-trim message))
+ (setf (flycheck-error-message err)
+ (if (string-empty-p message) nil message)))
+ (when (and id (string-empty-p id))
+ (setf (flycheck-error-id err) nil))
+ (when (eq (flycheck-error-column err) 0)
+ (setf (flycheck-error-column err) nil))
+ (when (eq (flycheck-error-end-column err) 0)
+ (setf (flycheck-error-end-column err) nil)))))
+ errors)
+
+(defun flycheck-remove-error-file-names (file-name errors)
+ "Remove matching FILE-NAME from ERRORS.
+
+Use as `:error-filter' for syntax checkers that output faulty
+filenames. Flycheck will later fill in the buffer file name.
+
+Return ERRORS."
+ (seq-do (lambda (err)
+ (when (and (flycheck-error-filename err)
+ (string= (flycheck-error-filename err) file-name))
+ (setf (flycheck-error-filename err) nil)))
+ errors)
+ errors)
+
+(defun flycheck-increment-error-columns (errors &optional offset)
+ "Increment all columns of ERRORS by OFFSET (default: 1).
+
+ Use this as `:error-filter' if a syntax checker outputs 0-based
+ columns."
+ (setq offset (or offset 1)) ;; Emacs bug #31715
+ (seq-do (lambda (err)
+ (when (flycheck-error-column err)
+ (cl-incf (flycheck-error-column err) offset))
+ (when (flycheck-error-end-column err)
+ (cl-incf (flycheck-error-end-column err) offset)))
+ errors)
+ errors)
+
+(defun flycheck-collapse-error-message-whitespace (errors)
+ "Collapse whitespace in all messages of ERRORS.
+
+Return ERRORS."
+ (dolist (err errors)
+ (-when-let (message (flycheck-error-message err))
+ (setf (flycheck-error-message err)
+ (replace-regexp-in-string (rx (one-or-more (any space "\n" "\r")))
+ " " message 'fixed-case 'literal))))
+ errors)
+
+(defun flycheck-dedent-error-messages (errors)
+ "Dedent all messages of ERRORS.
+
+For each error in ERRORS, determine the indentation offset from
+the leading whitespace of the first line, and dedent all further
+lines accordingly.
+
+Return ERRORS, with in-place modifications."
+ (dolist (err errors)
+ (-when-let (message (flycheck-error-message err))
+ (with-temp-buffer
+ (insert message)
+ ;; Determine the indentation offset
+ (goto-char (point-min))
+ (back-to-indentation)
+ (let* ((indent-offset (- (point) (point-min))))
+ ;; Now iterate over all lines and dedent each according to
+ ;; `indent-offset'
+ (while (not (eobp))
+ (back-to-indentation)
+ ;; If the current line starts with sufficient whitespace, delete the
+ ;; indentation offset. Otherwise keep the line intact, as we might
+ ;; loose valuable information
+ (when (>= (- (point) (line-beginning-position)) indent-offset)
+ (delete-char (- indent-offset)))
+ (forward-line 1)))
+ (delete-trailing-whitespace (point-min) (point-max))
+ (setf (flycheck-error-message err)
+ (buffer-substring-no-properties (point-min) (point-max))))))
+ errors)
+
+(defun flycheck-fold-include-levels (errors sentinel-message)
+ "Fold levels of ERRORS from included files.
+
+ERRORS is a list of `flycheck-error' objects. SENTINEL-MESSAGE
+is a regular expression matched against the error message to
+determine whether the error denotes errors from an included
+file. Alternatively, it is a function that is given an error and
+shall return non-nil, if the error denotes errors from an
+included file."
+ (unless (or (stringp sentinel-message) (functionp sentinel-message))
+ (error "Sentinel must be string or function: %S" sentinel-message))
+ (let ((sentinel (if (functionp sentinel-message)
+ sentinel-message
+ (lambda (err)
+ (string-match-p sentinel-message
+ (flycheck-error-message err)))))
+ (remaining-errors errors))
+ (while remaining-errors
+ (let* ((current-error (pop remaining-errors)))
+ (when (funcall sentinel current-error)
+ ;; We found an error denoting errors in the included file:
+ ;; 1. process all subsequent errors until faulty include file is found
+ ;; 2. process again all subsequent errors until an error has the
+ ;; current file name again
+ ;; 3. find the most severe error level
+ (let ((current-filename (flycheck-error-filename current-error))
+ (current-level nil)
+ (faulty-include-filename nil)
+ (filename nil)
+ (done (null remaining-errors)))
+
+ (while (not done)
+ (setq filename (flycheck-error-filename (car remaining-errors)))
+ (unless faulty-include-filename
+ (unless (string= filename current-filename)
+ (setq faulty-include-filename filename)))
+
+ (let* ((error-in-include (pop remaining-errors))
+ (in-include-level (flycheck-error-level error-in-include)))
+ (unless (funcall sentinel error-in-include)
+ ;; Ignore nested "included file" errors, we are only
+ ;; interested in real errors because these define our level
+ (when (or (not current-level)
+ (> (flycheck-error-level-severity in-include-level)
+ (flycheck-error-level-severity current-level)))
+ (setq current-level in-include-level))))
+
+ (setq done (or (null remaining-errors)
+ (and faulty-include-filename
+ (string= filename current-filename)))))
+
+ (setf (flycheck-error-level current-error) current-level
+ (flycheck-error-message current-error)
+ (format "In include %s" faulty-include-filename))))))
+ errors))
+
+(defun flycheck-dequalify-error-ids (errors)
+ "De-qualify error ids in ERRORS.
+
+Remove all qualifications from error ids in ERRORS, by stripping
+all leading dotted components from error IDs. For instance, if
+the error ID is com.foo.E100, replace it with E100.
+
+This error filter is mainly useful to simplify error IDs obtained
+from parsing Checkstyle XML, which frequently has very verbose
+IDs, that include the name of the tool."
+ (seq-do (lambda (err)
+ (let ((id (flycheck-error-id err)))
+ (when id
+ (setf (flycheck-error-id err)
+ (replace-regexp-in-string
+ (rx string-start
+ (group
+ (optional (zero-or-more not-newline) "."))
+ (one-or-more (not (any ".")))
+ string-end)
+ "" id 'fixedcase 'literal 1)))))
+ errors)
+ errors)
+
+(defun flycheck-remove-error-ids (errors)
+ "Remove all error ids from ERRORS."
+ (seq-do (lambda (err) (setf (flycheck-error-id err) nil)) errors)
+ errors)
+
+(defun flycheck-fill-empty-line-numbers (errors)
+ "Set ERRORS without lines to line 0.
+
+Use as `:error-filter' for syntax checkers that output errors
+without line numbers.
+
+Return ERRORS."
+ (seq-do (lambda (err)
+ (unless (flycheck-error-line err)
+ (setf (flycheck-error-line err) 0)))
+ errors)
+ errors)
+
+
+;;; Error analysis
+(defun flycheck-count-errors (errors)
+ "Count the number of ERRORS, grouped by level.
+
+Return an alist, where each ITEM is a cons cell whose `car' is an
+error level, and whose `cdr' is the number of errors of that
+level."
+ (let (counts-by-level)
+ (dolist (err errors)
+ (let* ((level (flycheck-error-level err))
+ (item (assq level counts-by-level)))
+ (if item
+ (cl-incf (cdr item))
+ (push (cons level 1) counts-by-level))))
+ counts-by-level))
+
+(defun flycheck-has-max-errors-p (errors level)
+ "Check if there is no error in ERRORS more severe than LEVEL."
+ (let ((severity (flycheck-error-level-severity level)))
+ (seq-every-p (lambda (e) (<= (flycheck-error-level-severity
+ (flycheck-error-level e))
+ severity))
+ errors)))
+
+(defun flycheck-has-max-current-errors-p (level)
+ "Check if there is no current error more severe than LEVEL."
+ (flycheck-has-max-errors-p flycheck-current-errors level))
+
+(defun flycheck-has-errors-p (errors level)
+ "Determine if there are any ERRORS with LEVEL."
+ (seq-some (lambda (e) (eq (flycheck-error-level e) level)) errors))
+
+(defun flycheck-has-current-errors-p (&optional level)
+ "Determine if the current buffer has errors with LEVEL.
+
+If LEVEL is omitted if the current buffer has any errors at all."
+ (if level
+ (flycheck-has-errors-p flycheck-current-errors level)
+ (and flycheck-current-errors t)))
+
+
+;;; Error overlays in the current buffer
+(defvar-local flycheck--last-overlay-index 0
+ "Last index given to a Flycheck overlay.
+
+These indices are used to preserve error order (Emacs doesn't
+preserve overlay order when calling `overlays-at').")
+
+(defun flycheck--next-overlay-index ()
+ "Compute the index to assign to a new Flycheck overlay."
+ (cl-incf flycheck--last-overlay-index))
+
+(defun flycheck--highlighting-style (err)
+ "Determine the highlighting style to apply to ERR.
+
+Styles are documented in `flycheck-highlighting-style'; this
+functions resolves `conditional' style specifications."
+ (let* ((style flycheck-highlighting-style)
+ (first-line (flycheck-error-line err))
+ (end-line (or (flycheck-error-end-line err) first-line))
+ (nlines (- end-line first-line)))
+ (while (eq (car-safe style) 'conditional)
+ (pcase-let ((`(,threshold ,s1 ,s2) (cdr style)))
+ (setq style (if (< nlines threshold) s1 s2))))
+ (pcase style
+ (`(delimiters ,before ,after)
+ (when (characterp before)
+ (setq before (flycheck--make-highlighting-delimiter before)))
+ (when (characterp after)
+ (setq after (flycheck--make-highlighting-delimiter after)))
+ (setq style `(delimiters ,before ,after))))
+ style))
+
+(defun flycheck--setup-highlighting (err overlay)
+ "Apply properties to OVERLAY to highlight ERR."
+ (let ((level (flycheck-error-level err)))
+ (unless flycheck-highlighting-mode
+ ;; Erase the highlighting from the overlay if requested by the user
+ (setf (overlay-get overlay 'face) nil))
+ (when flycheck-indication-mode
+ (setf (overlay-get overlay 'before-string)
+ (flycheck-error-level-make-indicator
+ level flycheck-indication-mode))
+ (setf (overlay-get overlay 'line-prefix)
+ (flycheck-error-level-make-indicator
+ level flycheck-indication-mode t)))
+ (pcase (flycheck--highlighting-style err)
+ ((or `nil (guard (null flycheck-highlighting-mode)))
+ ;; Erase the highlighting
+ (setf (overlay-get overlay 'face) nil))
+ (`level-face)
+ (`(delimiters ,before ,after)
+ ;; Replace the highlighting with delimiters
+ (let* ((fringe-face (flycheck-error-level-fringe-face level))
+ (delim-face `(flycheck-error-delimiter ,fringe-face)))
+ (setf (overlay-get overlay 'face) 'flycheck-delimited-error)
+ (setf (overlay-get overlay 'before-string)
+ (concat (propertize before 'face delim-face)
+ (or (overlay-get overlay 'before-string) "")))
+ (setf (overlay-get overlay 'after-string)
+ (propertize after 'face delim-face))))
+ (other (error "Unsupported highlighting style: %S" other)))))
+
+(defun flycheck-add-overlay (err)
+ "Add overlay for ERR.
+
+Return the created overlay."
+ ;; We must have a proper error region for the sake of fringe indication,
+ ;; error display and error navigation, even if the highlighting is disabled.
+ ;; We erase the highlighting later on in this case
+ (pcase-let* ((`(,beg . ,end)
+ (if (flycheck-relevant-error-other-file-p err)
+ ;; Display overlays for other-file errors on the first line
+ (cons (point-min)
+ (save-excursion (goto-char (point-min))
+ (point-at-eol)))
+ (flycheck-error-region-for-mode
+ err (or flycheck-highlighting-mode 'lines))))
+ (overlay (make-overlay beg end))
+ (level (flycheck-error-level err))
+ (category (flycheck-error-level-overlay-category level))
+ (index (flycheck--next-overlay-index)))
+ (unless (flycheck-error-level-p level)
+ (error "Undefined error level: %S" level))
+ (setf (overlay-get overlay 'flycheck-error-index) index)
+ (setf (overlay-get overlay 'flycheck-overlay) t)
+ (setf (overlay-get overlay 'flycheck-error) err)
+ (setf (overlay-get overlay 'category) category)
+ (setf (overlay-get overlay 'help-echo) #'flycheck-help-echo)
+ (flycheck--setup-highlighting err overlay)
+ overlay))
+
+(defun flycheck-help-echo (_window object pos)
+ "Construct a tooltip message.
+
+Most of the actual work is done by calling
+`flycheck-help-echo-function' with the appropriate list of
+errors. Arguments WINDOW, OBJECT and POS are as described in
+info node `(elisp)Special properties', as this function is
+intended to be used as the 'help-echo property of flycheck error
+overlays."
+ (-when-let (buf (cond ((bufferp object) object)
+ ((overlayp object) (overlay-buffer object))))
+ (with-current-buffer buf
+ (-when-let* ((fn flycheck-help-echo-function)
+ (errs (flycheck-overlay-errors-at pos)))
+ (propertize (funcall fn errs) 'help-echo-inhibit-substitution t)))))
+
+(defun flycheck-help-echo-all-error-messages (errs)
+ "Concatenate error messages and ids from ERRS."
+ (pcase (delq nil errs) ;; FIXME why would errors be nil here?
+ (`(,err) ;; A single error
+ (flycheck-error-format-message-and-id err))
+ (_ ;; Zero or multiple errors
+ (mapconcat
+ (lambda (err)
+ (flycheck-error-format-message-and-id err 'include-snippet))
+ errs "\n"))))
+
+(defun flycheck-filter-overlays (overlays)
+ "Get all Flycheck overlays from OVERLAYS, in original order."
+ ;; The order of errors returned from overlays is not stable, so we sort
+ ;; them again using the internal index to guarantee errors are always
+ ;; displayed in the same order.
+ (seq-sort
+ ;; We can't use `seq-sort-by' here; see above
+ (lambda (o1 o2) (< (overlay-get o1 'flycheck-error-index)
+ (overlay-get o2 'flycheck-error-index)))
+ (seq-filter (lambda (o) (overlay-get o 'flycheck-overlay)) overlays)))
+
+(defun flycheck-overlays-at (pos)
+ "Get all Flycheck overlays at POS."
+ (flycheck-filter-overlays (overlays-at pos)))
+
+(defun flycheck-overlays-in (beg end)
+ "Get all Flycheck overlays between BEG and END."
+ (flycheck-filter-overlays (overlays-in beg end)))
+
+(defun flycheck-overlay-errors-at (pos)
+ "Return a list of all flycheck errors overlaid at POS."
+ (seq-map (lambda (o) (overlay-get o 'flycheck-error))
+ (flycheck-overlays-at pos)))
+
+(defun flycheck-overlay-errors-in (beg end)
+ "Return a list of all flycheck errors overlaid between BEG and END."
+ (seq-map (lambda (o) (overlay-get o 'flycheck-error))
+ (flycheck-overlays-in beg end)))
+
+(defvar-local flycheck-overlays-to-delete nil
+ "Overlays mark for deletion after all syntax checks completed.")
+(put 'flycheck-overlays-to-delete 'permanent-local t)
+
+(defun flycheck-delete-all-overlays ()
+ "Remove all flycheck overlays in the current buffer."
+ (overlay-recenter (point-max))
+ (flycheck-delete-marked-overlays)
+ (setq flycheck--last-overlay-index 0)
+ (save-restriction
+ (widen)
+ (seq-do #'delete-overlay (flycheck-overlays-in (point-min) (point-max)))))
+
+(defun flycheck-mark-all-overlays-for-deletion ()
+ "Mark all current overlays for deletion."
+ (setq flycheck-overlays-to-delete
+ (append (flycheck-overlays-in (point-min) (point-max))
+ flycheck-overlays-to-delete)))
+
+(defun flycheck-delete-marked-overlays ()
+ "Delete all overlays marked for deletion."
+ (overlay-recenter (point-max))
+ (seq-do #'delete-overlay flycheck-overlays-to-delete)
+ (setq flycheck-overlays-to-delete nil))
+
+
+;;; Error navigation in the current buffer
+(defun flycheck-error-level-interesting-at-pos-p (pos)
+ "Check if error severity at POS passes `flycheck-error-level-interesting-p'."
+ (flycheck-error-level-interesting-p (get-char-property pos 'flycheck-error)))
+
+(defun flycheck-error-level-interesting-p (err)
+ "Check if ERR severity is >= `flycheck-navigation-minimum-level'.
+
+ERR is also interesting (the function returns true) if there are
+no errors as or more severe than `flycheck-navigation-minimum-level'."
+ (when (flycheck-error-p err)
+ (-if-let (min-level flycheck-navigation-minimum-level)
+ (or (<= (flycheck-error-level-severity min-level)
+ (flycheck-error-level-severity (flycheck-error-level err)))
+ (not (flycheck-has-current-errors-p min-level)))
+ t)))
+
+(defun flycheck-next-error-pos (n &optional reset)
+ "Get the position of the N-th next error.
+
+With negative N, get the position of the (-N)-th previous error
+instead. With non-nil RESET, search from `point-min', otherwise
+search from the current point.
+
+Return the position of the next or previous error, or nil if
+there is none. If N is zero, return `point', or `point-min' if
+RESET is non-nil."
+ (let ((n (or n 1))
+ (pos (if reset (point-min) (point))))
+ (if (>= n 0)
+ ;; Search forwards
+ (while (and pos (> n 0))
+ (setq n (1- n))
+ (when (get-char-property pos 'flycheck-error)
+ ;; Move beyond from the current error if any
+ (setq pos (next-single-char-property-change pos 'flycheck-error)))
+ (while (not (or (= pos (point-max))
+ (flycheck-error-level-interesting-at-pos-p pos)))
+ ;; Scan for the next error
+ (setq pos (next-single-char-property-change pos 'flycheck-error)))
+ (when (and (= pos (point-max))
+ (not (flycheck-error-level-interesting-at-pos-p pos)))
+ ;; If we reached the end of the buffer, but no error, we didn't find
+ ;; any
+ (setq pos nil)))
+ ;; Search backwards
+ (while (and pos (< n 0))
+ (setq n (1+ n))
+ ;; Loop until we find an error. We need to check the position *before*
+ ;; the current one, because `previous-single-char-property-change'
+ ;; always moves to the position *of* the change.
+ (while (not (or (= pos (point-min))
+ (flycheck-error-level-interesting-at-pos-p (1- pos))))
+ (setq pos (previous-single-char-property-change pos 'flycheck-error)))
+ (when (and (= pos (point-min))
+ (not (flycheck-error-level-interesting-at-pos-p pos)))
+ ;; We didn't find any error.
+ (setq pos nil))
+ (when pos
+ ;; We found an error, so move to its beginning
+ (setq pos (previous-single-char-property-change pos
+ 'flycheck-error)))))
+ pos))
+
+(defun flycheck-next-error-function (n reset)
+ "Visit the N-th error from the current point.
+
+N is the number of errors to advance by, where a negative N
+advances backwards. With non-nil RESET, advance from the
+beginning of the buffer, otherwise advance from the current
+position.
+
+Intended for use with `next-error-function'."
+ (-if-let* ((pos (flycheck-next-error-pos n reset))
+ (err (get-char-property pos 'flycheck-error)))
+ (flycheck-jump-to-error err)
+ (user-error "No more Flycheck errors")))
+
+(defun flycheck-next-error (&optional n reset)
+ "Visit the N-th error from the current point.
+
+N is the number of errors to advance by, where a negative N
+advances backwards. With non-nil RESET, advance from the
+beginning of the buffer, otherwise advance from the current
+position."
+ (interactive "P")
+ (when (consp n)
+ ;; Universal prefix argument means reset
+ (setq reset t n nil))
+ (flycheck-next-error-function n reset)
+ (flycheck-display-error-at-point))
+
+(defun flycheck-previous-error (&optional n)
+ "Visit the N-th previous error.
+
+If given, N specifies the number of errors to move backwards by.
+If N is negative, move forwards instead."
+ (interactive "P")
+ (flycheck-next-error (- (or n 1))))
+
+(defun flycheck-first-error (&optional n)
+ "Visit the N-th error from beginning of the buffer.
+
+If given, N specifies the number of errors to move forward from
+the beginning of the buffer."
+ (interactive "P")
+ (flycheck-next-error n 'reset))
+
+
+;;; Listing errors in buffers
+(defconst flycheck-error-list-buffer "*Flycheck errors*"
+ "The name of the buffer to show error lists.")
+
+(defmacro flycheck-error-list-with-buffer (&rest body)
+ "Evaluate BODY in flycheck-error-list-buffer, if it exists."
+ (declare (indent 0) (debug t))
+ `(when (get-buffer flycheck-error-list-buffer)
+ (with-current-buffer flycheck-error-list-buffer
+ ,@body)))
+
+(defvar flycheck-error-list-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map (kbd "f") #'flycheck-error-list-set-filter)
+ (define-key map (kbd "F") #'flycheck-error-list-reset-filter)
+ (define-key map (kbd "n") #'flycheck-error-list-next-error)
+ (define-key map (kbd "p") #'flycheck-error-list-previous-error)
+ (define-key map (kbd "g") #'flycheck-error-list-check-source)
+ (define-key map (kbd "e") #'flycheck-error-list-explain-error)
+ (define-key map (kbd "RET") #'flycheck-error-list-goto-error)
+ map)
+ "The keymap of `flycheck-error-list-mode'.")
+
+(defun flycheck-error-list-make-last-column (message checker)
+ "Compute contents of the last error list cell.
+
+MESSAGE and CHECKER are displayed in a single column to allow the
+message to stretch arbitrarily far."
+ (let ((checker-name (propertize (symbol-name checker)
+ 'face 'flycheck-error-list-checker-name))
+ (message (propertize message
+ 'face 'flycheck-error-list-error-message)))
+ (format "%s (%s)" message checker-name)))
+
+(defconst flycheck-error-list-format
+ `[("File" 6)
+ ("Line" 5 flycheck-error-list-entry-< :right-align t)
+ ("Col" 3 nil :right-align t)
+ ("Level" 8 flycheck-error-list-entry-level-<)
+ ("ID" 6 t)
+ (,(flycheck-error-list-make-last-column "Message" 'Checker) 0 t)]
+ "Table format for the error list.")
+
+(defconst flycheck-error-list-padding 1
+ "Padding used in error list.")
+
+(defconst flycheck--error-list-msg-offset
+ (seq-reduce
+ (lambda (offset fmt)
+ (pcase-let* ((`(,_ ,width ,_ . ,props) fmt)
+ (padding (or (plist-get props :pad-right) 1)))
+ (+ offset width padding)))
+ (seq-subseq flycheck-error-list-format 0 -1)
+ flycheck-error-list-padding)
+ "Amount of space to use in `flycheck-flush-multiline-message'.")
+
+(define-derived-mode flycheck-error-list-mode tabulated-list-mode
+ "Flycheck errors"
+ "Major mode for listing Flycheck errors.
+
+\\{flycheck-error-list-mode-map}"
+ (setq tabulated-list-format flycheck-error-list-format
+ ;; Sort by location initially
+ tabulated-list-sort-key (cons "Line" nil)
+ tabulated-list-padding flycheck-error-list-padding
+ tabulated-list-entries #'flycheck-error-list-entries
+ ;; `revert-buffer' updates the mode line for us, so all we need to do is
+ ;; set the corresponding mode line construct.
+ mode-line-buffer-identification flycheck-error-list-mode-line)
+ ;; Guard `truncate-string-ellipsis' for Emacs 24.
+ ;; TODO: Remove when dropping Emacs 24 compatibility
+ (when (boundp 'truncate-string-ellipsis)
+ ;; See https://github.com/flycheck/flycheck/issues/1101
+ (setq-local truncate-string-ellipsis "…"))
+ (tabulated-list-init-header))
+
+(defvar-local flycheck-error-list-source-buffer nil
+ "The current source buffer of the error list.")
+;; Needs to permanently local to preserve the source buffer across buffer
+;; reversions
+(put 'flycheck-error-list-source-buffer 'permanent-local t)
+
+(defun flycheck-error-list-set-source (buffer)
+ "Set BUFFER as the source buffer of the error list."
+ (flycheck-error-list-with-buffer
+ (setq flycheck-error-list-source-buffer buffer)
+ (flycheck-error-list-refresh)))
+
+(defun flycheck-error-list-update-source ()
+ "Make the error list display errors from the current buffer.
+
+The update is skipped if the current buffer is the error list or
+if the error list is already pointing to the current buffer."
+ (unless (memq (current-buffer)
+ (list (get-buffer flycheck-error-list-buffer)
+ (flycheck-error-list-with-buffer
+ flycheck-error-list-source-buffer)))
+ (flycheck-error-list-set-source (current-buffer))))
+
+(defun flycheck-error-list-check-source ()
+ "Trigger a syntax check in the source buffer of the error list."
+ (interactive)
+ (let ((buffer (get-buffer flycheck-error-list-source-buffer)))
+ (when (buffer-live-p buffer)
+ (with-current-buffer buffer
+ (flycheck-buffer)))))
+
+(define-button-type 'flycheck-error-list
+ 'action #'flycheck-error-list-goto-error
+ 'help-echo "mouse-1, RET: goto error"
+ 'face nil)
+
+(define-button-type 'flycheck-error-list-explain-error
+ 'action #'flycheck-error-list-explain-error
+ 'help-echo "mouse-1, RET: explain error")
+
+(defsubst flycheck-error-list-make-cell (text &optional face help-echo type)
+ "Make an error list cell with TEXT and FACE.
+
+If FACE is nil don't set a FACE on TEXT. If TEXT already has
+face properties, do not specify a FACE. Note though, that if
+TEXT gets truncated it will not inherit any previous face
+properties. If you expect TEXT to be truncated in the error
+list, do specify a FACE explicitly!
+
+If HELP-ECHO is non-nil, set a help-echo property on TEXT, with
+value HELP-ECHO. This is convenient if you expect TEXT to be
+truncated.
+
+The cell will have the type TYPE unless TYPE is nil, and the
+default type `flycheck-error-list' will be used instead."
+ (append (list text 'type (if type type
+ 'flycheck-error-list))
+ (and face (list 'face face))
+ (and help-echo (list 'help-echo help-echo))))
+
+(defsubst flycheck-error-list-make-number-cell (number face)
+ "Make a table cell for a NUMBER with FACE.
+
+Convert NUMBER to string, fontify it with FACE and return the
+string with attached text properties."
+ (flycheck-error-list-make-cell
+ (if (numberp number) (number-to-string number) "")
+ face))
+
+(defun flycheck-error-list-make-entry (error)
+ "Make a table cell for the given ERROR.
+
+Return a list with the contents of the table cell."
+ (let* ((level (flycheck-error-level error))
+ (level-face (flycheck-error-level-error-list-face level))
+ (filename (flycheck-error-filename error))
+ (line (flycheck-error-line error))
+ (column (flycheck-error-column error))
+ (message (or (flycheck-error-message error)
+ (format "Unknown %S" level)))
+ (flushed-msg (flycheck-flush-multiline-message message))
+ (id (flycheck-error-id error))
+ (id-str (if id (format "%s" id) ""))
+ (checker (flycheck-error-checker error))
+ (msg-and-checker
+ (flycheck-error-list-make-last-column flushed-msg checker))
+ (explainer (flycheck-checker-get checker 'error-explainer)))
+ (list error
+ (vector (flycheck-error-list-make-cell
+ (if filename
+ (file-name-nondirectory filename)
+ "")
+ 'flycheck-error-list-filename)
+ (flycheck-error-list-make-number-cell
+ line 'flycheck-error-list-line-number)
+ (flycheck-error-list-make-number-cell
+ column 'flycheck-error-list-column-number)
+ (flycheck-error-list-make-cell
+ (symbol-name (flycheck-error-level error)) level-face)
+ ;; Error ID use a different face when an error-explainer is
+ ;; present
+ (flycheck-error-list-make-cell
+ id-str (if explainer 'flycheck-error-list-id-with-explainer
+ 'flycheck-error-list-id)
+ id-str 'flycheck-error-list-explain-error)
+ (flycheck-error-list-make-cell
+ msg-and-checker nil msg-and-checker)))))
+
+(defun flycheck-flush-multiline-message (msg)
+ "Prepare error message MSG for display in the error list.
+
+Prepend all lines of MSG except the first with enough space to
+ensure that they line up properly once the message is displayed."
+ (let* ((spc-spec `(space . (:width ,flycheck--error-list-msg-offset)))
+ (spc (propertize " " 'display spc-spec))
+ (rep (concat "\\1" spc "\\2")))
+ (replace-regexp-in-string "\\([\r\n]+\\)\\(.\\)" rep msg)))
+
+(defun flycheck-error-list-current-errors ()
+ "Read the list of errors in `flycheck-error-list-source-buffer'."
+ (when (buffer-live-p flycheck-error-list-source-buffer)
+ (buffer-local-value 'flycheck-current-errors
+ flycheck-error-list-source-buffer)))
+
+(defun flycheck-error-list-entries ()
+ "Create the entries for the error list."
+ (-when-let* ((errors (flycheck-error-list-current-errors))
+ (filtered (flycheck-error-list-apply-filter errors)))
+ (seq-map #'flycheck-error-list-make-entry filtered)))
+
+(defun flycheck-error-list-entry-< (entry1 entry2)
+ "Determine whether ENTRY1 is before ENTRY2 by location.
+
+See `flycheck-error-<'."
+ (flycheck-error-< (car entry1) (car entry2)))
+
+(defun flycheck-error-list-entry-level-< (entry1 entry2)
+ "Determine whether ENTRY1 is before ENTRY2 by level.
+
+See `flycheck-error-level-<'."
+ (not (flycheck-error-level-< (car entry1) (car entry2))))
+
+(defvar flycheck-error-list-mode-line-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map [mode-line mouse-1]
+ #'flycheck-error-list-mouse-switch-to-source)
+ map)
+ "Keymap for error list mode line.")
+
+(defun flycheck-error-list-propertized-source-name ()
+ "Get the name of the current source buffer for the mode line.
+
+Propertize the name of the current source buffer for use in the
+mode line indication of `flycheck-error-list-mode'."
+ (let ((name (replace-regexp-in-string
+ (rx "%") "%%"
+ (buffer-name flycheck-error-list-source-buffer)
+ 'fixed-case 'literal)))
+ (propertize name 'face 'mode-line-buffer-id
+ 'mouse-face 'mode-line-highlight
+ 'help-echo "mouse-1: switch to source"
+ 'local-map flycheck-error-list-mode-line-map)))
+
+(defun flycheck-error-list-mouse-switch-to-source (event)
+ "Switch to the error list source buffer of the EVENT window."
+ (interactive "e")
+ (save-selected-window
+ (when (eventp event)
+ (select-window (posn-window (event-start event))))
+ (when (buffer-live-p flycheck-error-list-source-buffer)
+ (switch-to-buffer flycheck-error-list-source-buffer))))
+
+(defun flycheck-get-error-list-window-list (&optional all-frames)
+ "Get all windows displaying the error list.
+
+ALL-FRAMES specifies the frames to consider, as in
+`get-buffer-window-list'."
+ (-when-let (buf (get-buffer flycheck-error-list-buffer))
+ (get-buffer-window-list buf nil all-frames)))
+
+(defun flycheck-get-error-list-window (&optional all-frames)
+ "Get a window displaying the error list, or nil if none.
+
+ALL-FRAMES specifies the frames to consider, as in
+`get-buffer-window'."
+ (-when-let (buf (get-buffer flycheck-error-list-buffer))
+ (get-buffer-window buf all-frames)))
+
+(defun flycheck-error-list-recenter-at (pos)
+ "Recenter the error list at POS."
+ (dolist (window (flycheck-get-error-list-window-list t))
+ (with-selected-window window
+ (goto-char pos)
+ (let ((recenter-redisplay nil))
+ (recenter)))))
+
+(defun flycheck-error-list-refresh ()
+ "Refresh the current error list.
+
+Add all errors currently reported for the current
+`flycheck-error-list-source-buffer', and recenter the error
+list."
+ ;; We only refresh the error list, when it is visible in a window, and we
+ ;; select this window while reverting, because Tabulated List mode attempts to
+ ;; recenter the error at the old location, so it must have the proper window
+ ;; selected.
+ (-when-let (window (flycheck-get-error-list-window t))
+ (with-selected-window window
+ (revert-buffer))
+ (run-hooks 'flycheck-error-list-after-refresh-hook)
+ (let ((preserve-pos (eq (current-buffer)
+ (get-buffer flycheck-error-list-buffer))))
+ ;; If the error list is the current buffer, don't recenter when
+ ;; highlighting
+ (flycheck-error-list-highlight-errors preserve-pos))))
+
+(defun flycheck-error-list-mode-line-filter-indicator ()
+ "Create a string representing the current error list filter."
+ (if flycheck-error-list-minimum-level
+ (format " [>= %s]" flycheck-error-list-minimum-level)
+ ""))
+
+(defun flycheck-error-list-set-filter (level)
+ "Restrict the error list to errors at level LEVEL or higher.
+
+LEVEL is either an error level symbol, or nil, to remove the filter."
+ (interactive
+ (list (flycheck-read-error-level
+ "Minimum error level (errors at lower levels will be hidden): ")))
+ (when (and level (not (flycheck-error-level-p level)))
+ (user-error "Invalid level: %s" level))
+ (flycheck-error-list-with-buffer
+ (setq-local flycheck-error-list-minimum-level level)
+ (force-mode-line-update)
+ (flycheck-error-list-refresh)
+ (flycheck-error-list-recenter-at (point-min))))
+
+(defun flycheck-error-list-reset-filter (&optional refresh)
+ "Remove local error filters and reset to the default filter.
+
+Interactively, or with non-nil REFRESH, refresh the error list."
+ (interactive '(t))
+ (flycheck-error-list-with-buffer
+ (kill-local-variable 'flycheck-error-list-minimum-level)
+ (when refresh
+ (flycheck-error-list-refresh)
+ (flycheck-error-list-recenter-at (point-min))
+ (force-mode-line-update))))
+
+(defun flycheck-error-list-apply-filter (errors)
+ "Filter ERRORS according to `flycheck-error-list-minimum-level'."
+ (-if-let* ((min-level flycheck-error-list-minimum-level)
+ (min-severity (flycheck-error-level-severity min-level)))
+ (seq-filter (lambda (err) (>= (flycheck-error-level-severity
+ (flycheck-error-level err))
+ min-severity))
+ errors)
+ errors))
+
+(defun flycheck-error-list-goto-error (&optional pos)
+ "Go to the location of the error at POS in the error list.
+
+POS defaults to `point'."
+ (interactive)
+ (-when-let* ((error (tabulated-list-get-id pos)))
+ (flycheck-jump-to-error error)))
+
+(defun flycheck-jump-to-error (error)
+ "Go to the location of ERROR."
+ (let* ((error-copy (copy-flycheck-error error))
+ (filename (flycheck-error-filename error))
+ (other-file-error (flycheck-relevant-error-other-file-p error))
+ (buffer (if filename
+ (find-file-noselect filename)
+ (flycheck-error-buffer error))))
+ (when (buffer-live-p buffer)
+ (setf (flycheck-error-buffer error-copy) buffer)
+ (flycheck-jump-in-buffer buffer error-copy)
+ ;; When jumping to an error in another file, it may not have
+ ;; this error available for highlighting yet, so we trigger a check
+ ;; if necessary.
+ (when other-file-error
+ (with-current-buffer buffer
+ ;; `seq-contains-p' is only in seq >= 2.21
+ (unless (with-no-warnings
+ (seq-contains flycheck-current-errors error-copy 'equal))
+ (when flycheck-mode
+ (flycheck-buffer))))))))
+
+(defun flycheck-jump-in-buffer (buffer error)
+ "In BUFFER, jump to ERROR."
+ ;; FIXME: we assume BUFFER and the buffer of ERROR are the same. We don't
+ ;; need the first argument then.
+ (if (eq (window-buffer) (get-buffer flycheck-error-list-buffer))
+ ;; When called from within the error list, keep the error list,
+ ;; otherwise replace the current buffer.
+ (pop-to-buffer buffer 'other-window)
+ (switch-to-buffer buffer))
+ (let ((pos (flycheck-error-pos error)))
+ (unless (eq (goto-char pos) (point))
+ ;; If widening gets in the way of moving to the right place, remove it
+ ;; and try again
+ (widen)
+ (goto-char pos)))
+ ;; Re-highlight the errors. We have post-command-hook for that, but calls to
+ ;; `flycheck-jump-in-buffer' that come from other buffers (e.g. from the error
+ ;; list) won't trigger it.
+ (flycheck-error-list-highlight-errors 'preserve-pos))
+
+(defun flycheck-error-list-explain-error (&optional pos)
+ "Explain the error at POS in the error list.
+
+POS defaults to `point'."
+ (interactive)
+ (-when-let* ((error (tabulated-list-get-id pos))
+ (explainer (flycheck-checker-get (flycheck-error-checker error)
+ 'error-explainer)))
+ (flycheck-error-with-buffer error
+ (-when-let (explanation (funcall explainer error))
+ (flycheck-display-error-explanation explanation)))))
+
+(defun flycheck-error-list-next-error-pos (pos &optional n)
+ "Starting from POS get the N'th next error in the error list.
+
+N defaults to 1. If N is negative, search for the previous error
+instead.
+
+Get the beginning position of the N'th next error from POS, or
+nil, if there is no next error."
+ (let ((n (or n 1)))
+ (if (>= n 0)
+ ;; Search forward
+ (while (and pos (/= n 0))
+ (setq n (1- n))
+ (setq pos (next-single-property-change pos 'tabulated-list-id)))
+ ;; Search backwards
+ (while (/= n 0)
+ (setq n (1+ n))
+ ;; We explicitly give the limit here to explicitly have the minimum
+ ;; point returned, to be able to move to the first error (which starts
+ ;; at `point-min')
+ (setq pos (previous-single-property-change pos 'tabulated-list-id
+ nil (point-min)))))
+ pos))
+
+(defun flycheck-error-list-previous-error (n)
+ "Go to the N'th previous error in the error list."
+ (interactive "P")
+ (flycheck-error-list-next-error (- (or n 1))))
+
+(defun flycheck-error-list-next-error (n)
+ "Go to the N'th next error in the error list."
+ (interactive "P")
+ (let ((pos (flycheck-error-list-next-error-pos (point) n)))
+ (when (and pos (/= pos (point)))
+ (goto-char pos)
+ (save-selected-window
+ ;; Keep the error list selected, so that the user can navigate errors by
+ ;; repeatedly pressing n/p, without having to re-select the error list
+ ;; window.
+ (flycheck-error-list-goto-error)))))
+
+(defvar-local flycheck-error-list-highlight-overlays nil
+ "Error highlight overlays in the error list buffer.")
+(put 'flycheck-error-list-highlight-overlays 'permanent-local t)
+
+(defun flycheck-error-list-highlight-errors (&optional preserve-pos)
+ "Highlight errors in the error list.
+
+Highlight all errors in the error list that are at point in the
+source buffer, and on the same line as point. Then recenter the
+error list to the highlighted error, unless PRESERVE-POS is
+non-nil."
+ (when (get-buffer flycheck-error-list-buffer)
+ (with-current-buffer flycheck-error-list-buffer
+ (let ((current-errors
+ (when (buffer-live-p flycheck-error-list-source-buffer)
+ (with-current-buffer flycheck-error-list-source-buffer
+ (flycheck-overlay-errors-in (line-beginning-position)
+ (line-end-position))))))
+ (let ((old-overlays flycheck-error-list-highlight-overlays)
+ (min-point (point-max))
+ (max-point (point-min)))
+ ;; Display the new overlays first, to avoid re-display flickering
+ (setq flycheck-error-list-highlight-overlays nil)
+ (when current-errors
+ (let ((next-error-pos (point-min)))
+ (while next-error-pos
+ (let* ((beg next-error-pos)
+ (end (flycheck-error-list-next-error-pos beg))
+ (err (tabulated-list-get-id beg)))
+ (when (member err current-errors)
+ (setq min-point (min min-point beg)
+ max-point (max max-point beg))
+ (let ((ov (make-overlay beg
+ ;; Extend overlay to the beginning
+ ;; of the next line, to highlight
+ ;; the whole line
+ (or end (point-max)))))
+ (push ov flycheck-error-list-highlight-overlays)
+ (setf (overlay-get ov 'flycheck-error-highlight-overlay)
+ t)
+ (setf (overlay-get ov 'face)
+ 'flycheck-error-list-highlight)))
+ (setq next-error-pos end)))))
+ ;; Delete the old overlays
+ (seq-do #'delete-overlay old-overlays)
+ (when (and (not preserve-pos) current-errors)
+ ;; Move point to the middle error
+ (goto-char (+ min-point (/ (- max-point min-point) 2)))
+ (beginning-of-line)
+ ;; And recenter the error list at this position
+ (flycheck-error-list-recenter-at (point))))))))
+
+(defun flycheck-list-errors ()
+ "Show the error list for the current buffer."
+ (interactive)
+ (unless flycheck-mode
+ (user-error "Flycheck mode not enabled"))
+ ;; Create and initialize the error list
+ (unless (get-buffer flycheck-error-list-buffer)
+ (with-current-buffer (get-buffer-create flycheck-error-list-buffer)
+ (flycheck-error-list-mode)))
+ ;; Reset the error filter
+ (flycheck-error-list-reset-filter)
+ (let ((source (current-buffer)))
+ ;; Show the error list in a side window. Under some configurations of
+ ;; `display-buffer', this may select `flycheck-error-list-buffer' (see URL
+ ;; `https://github.com/flycheck/flycheck/issues/1776').
+ (display-buffer flycheck-error-list-buffer)
+ ;; Adjust the source, causing a refresh
+ (flycheck-error-list-set-source source)))
+
+(defalias 'list-flycheck-errors 'flycheck-list-errors)
+
+
+;;; Displaying errors in the current buffer
+(defun flycheck-display-errors (errors)
+ "Display ERRORS using `flycheck-display-errors-function'."
+ (when flycheck-display-errors-function
+ (funcall flycheck-display-errors-function errors)))
+
+(defvar-local flycheck-display-error-at-point-timer nil
+ "Timer to automatically show errors.")
+
+(defun flycheck-cancel-error-display-error-at-point-timer ()
+ "Cancel the error display timer for the current buffer."
+ (when flycheck-display-error-at-point-timer
+ (cancel-timer flycheck-display-error-at-point-timer)
+ (setq flycheck-display-error-at-point-timer nil)))
+
+(defun flycheck--error-display-tick ()
+ "Return point and tick counter of current buffer."
+ (cons (point) (buffer-modified-tick)))
+
+(defvar-local flycheck--last-error-display-tick nil
+ "Value of `flycheck--error-display-tick' when errors were last displayed.")
+
+(defun flycheck-display-error-at-point ()
+ "Display all the error messages at point."
+ (interactive)
+ ;; This function runs from a timer, so we must take care to not ignore any
+ ;; errors
+ (with-demoted-errors "Flycheck error display error: %s"
+ (flycheck-cancel-error-display-error-at-point-timer)
+ (setq flycheck--last-error-display-tick (flycheck--error-display-tick))
+ (when flycheck-mode
+ (-when-let (errors (flycheck-overlay-errors-at (point)))
+ (flycheck-display-errors errors)))))
+
+(defun flycheck-display-error-at-point-soon ()
+ "Display error messages at point, with a delay."
+ (setq flycheck--last-error-display-tick nil)
+ (flycheck-maybe-display-error-at-point-soon))
+
+(defun flycheck-maybe-display-error-at-point-soon ()
+ "Display error message at point with a delay, unless already displayed."
+ (flycheck-cancel-error-display-error-at-point-timer)
+ (when (and (not (equal flycheck--last-error-display-tick
+ (setq flycheck--last-error-display-tick
+ (flycheck--error-display-tick))))
+ (flycheck-overlays-at (point)))
+ (setq flycheck-display-error-at-point-timer
+ (run-at-time flycheck-display-errors-delay nil
+ 'flycheck-display-error-at-point))))
+
+
+;;; Functions to display errors
+(defconst flycheck-error-message-buffer "*Flycheck error messages*"
+ "The name of the buffer to show long error messages in.")
+
+(defun flycheck-error-message-buffer ()
+ "Get the buffer object to show long error messages in.
+
+Get the buffer named by variable `flycheck-error-message-buffer',
+or nil if the buffer does not exist."
+ (get-buffer flycheck-error-message-buffer))
+
+(defun flycheck-may-use-echo-area-p ()
+ "Determine whether the echo area may be used.
+
+The echo area may be used if the cursor is not in the echo area,
+and if the echo area is not occupied by minibuffer input."
+ (not (or cursor-in-echo-area (active-minibuffer-window))))
+
+(define-derived-mode flycheck-error-message-mode text-mode
+ "Flycheck error messages"
+ "Major mode for extended error messages.")
+
+(defun flycheck-display-error-messages (errors)
+ "Display the messages of ERRORS.
+
+Concatenate all non-nil messages of ERRORS as with
+`flycheck-help-echo-all-error-messages', and display them with
+`display-message-or-buffer', which shows the messages either in
+the echo area or in a separate buffer, depending on the number of
+lines. See Info node `(elisp)Displaying Messages' for more
+information.
+
+In the latter case, show messages in the buffer denoted by
+variable `flycheck-error-message-buffer'."
+ (when (and errors (flycheck-may-use-echo-area-p))
+ (let ((message (flycheck-help-echo-all-error-messages errors)))
+ (display-message-or-buffer
+ message flycheck-error-message-buffer 'not-this-window)
+ ;; We cannot rely on `display-message-or-buffer' returning the right
+ ;; window. See URL `https://github.com/flycheck/flycheck/issues/1643'.
+ (-when-let (buf (get-buffer flycheck-error-message-buffer))
+ (with-current-buffer buf
+ (unless (derived-mode-p 'flycheck-error-message-mode)
+ (flycheck-error-message-mode)))))))
+
+(defun flycheck-display-error-messages-unless-error-list (errors)
+ "Show messages of ERRORS unless the error list is visible.
+
+Like `flycheck-display-error-messages', but only if the error
+list (see `flycheck-list-errors') is not visible in any window in
+the current frame."
+ (unless (flycheck-get-error-list-window 'current-frame)
+ (flycheck-display-error-messages errors)))
+
+(defun flycheck-hide-error-buffer ()
+ "Hide the Flycheck error buffer if necessary.
+
+Hide the error buffer if there is no error under point."
+ (-when-let* ((buffer (flycheck-error-message-buffer))
+ (window (get-buffer-window buffer)))
+ (unless (flycheck-overlays-at (point))
+ ;; save-selected-window prevents `quit-window' from changing the current
+ ;; buffer (see https://github.com/flycheck/flycheck/issues/648).
+ (save-selected-window
+ (quit-window nil window)))))
+
+
+;;; Working with errors
+(defun flycheck-copy-errors-as-kill (pos &optional formatter)
+ "Copy each error at POS into kill ring, using FORMATTER.
+
+FORMATTER is a function to turn an error into a string,
+defaulting to `flycheck-error-message'.
+
+Interactively, use `flycheck-error-format-message-and-id' as
+FORMATTER with universal prefix arg, and `flycheck-error-id' with
+normal prefix arg, i.e. copy the message and the ID with
+universal prefix arg, and only the id with normal prefix arg."
+ (interactive (list (point)
+ (pcase current-prefix-arg
+ ((pred not) #'flycheck-error-message)
+ ((pred consp) #'flycheck-error-format-message-and-id)
+ (_ #'flycheck-error-id))))
+ (let ((messages (delq nil (seq-map (or formatter #'flycheck-error-message)
+ (flycheck-overlay-errors-at pos)))))
+ (when messages
+ (seq-do #'kill-new (reverse messages))
+ (message (string-join messages "\n")))))
+
+(defun flycheck-explain-error-at-point ()
+ "Display an explanation for the first explainable error at point.
+
+The first explainable error at point is the first error at point
+with a non-nil `:error-explainer' function defined in its
+checker. The `:error-explainer' function is then called with
+this error to produce the explanation to display."
+ (interactive)
+ (-when-let* ((first-error
+ ;; Get the first error at point that has an `error-explainer'.
+ (seq-find (lambda (error)
+ (flycheck-checker-get
+ (flycheck-error-checker error) 'error-explainer))
+ (flycheck-overlay-errors-at (point))))
+ (explainer
+ (flycheck-checker-get (flycheck-error-checker first-error)
+ 'error-explainer))
+ (explanation (funcall explainer first-error)))
+ (flycheck-display-error-explanation explanation)))
+
+(defconst flycheck-explain-error-buffer "*Flycheck error explanation*"
+ "The name of the buffer to show error explanations.")
+
+(define-derived-mode flycheck-explain-error-mode help-mode
+ "Error explanation"
+ "Major mode for displaying error explanations."
+ (setq buffer-read-only t))
+
+(defun flycheck-display-error-explanation (explanation)
+ "Display the EXPLANATION for an error."
+ (pcase explanation
+ (`nil)
+ (`(url . ,url) (browse-url url))
+ (_ (let ((inhibit-read-only t)
+ (standard-output (temp-buffer-window-setup
+ flycheck-explain-error-buffer)))
+ (with-current-buffer standard-output
+ (flycheck-explain-error-mode))
+ (cond
+ ((functionp explanation) (funcall explanation))
+ ((stringp explanation) (princ explanation))
+ (t (error "Unsupported error explanation: %S" explanation)))
+ (display-message-or-buffer standard-output nil 'not-this-window)))))
+
+
+;;; Syntax checkers using external commands
+(defun flycheck-command-argument-p (arg)
+ "Check whether ARG is a valid command argument."
+ (pcase arg
+ ((pred stringp) t)
+ ((or `source `source-inplace `source-original) t)
+ (`(,(or `source `source-inplace) ,suffix)
+ (stringp suffix))
+ ((or `temporary-directory `temporary-file-name) t)
+ (`null-device t)
+ (`(config-file ,option-name ,config-file-var)
+ (and (stringp option-name)
+ (symbolp config-file-var)))
+ (`(config-file ,option-name ,config-file-var ,prepender)
+ (and (stringp option-name)
+ (symbolp config-file-var)
+ (symbolp prepender)))
+ (`(,(or `option `option-list) ,option-name ,option-var)
+ (and (stringp option-name)
+ (symbolp option-var)))
+ (`(,(or `option `option-list) ,option-name ,option-var ,prepender)
+ (and (stringp option-name)
+ (symbolp option-var)
+ (symbolp prepender)))
+ (`(,(or `option `option-list) ,option-name ,option-var ,prepender ,filter)
+ (and (stringp option-name)
+ (symbolp option-var)
+ (symbolp prepender)
+ (symbolp filter)))
+ (`(option-flag ,option-name ,option-var)
+ (and (stringp option-name)
+ (symbolp option-var)))
+ (`(eval ,_) t)
+ (_ nil)))
+
+(defun flycheck-compute-working-directory (checker)
+ "Get the default working directory for CHECKER.
+
+Compute the value of `default-directory' for the invocation of
+the syntax checker command, by calling the function in the
+`working-directory' property of CHECKER, with CHECKER as sole
+argument, and returning its value. Signal an error if the
+function returns a non-existing working directory.
+
+If the property is undefined or if the function returns nil
+return the `default-directory' of the current buffer."
+ (let* ((def-directory-fn (flycheck-checker-get checker 'working-directory))
+ (directory (or (and def-directory-fn
+ (funcall def-directory-fn checker))
+ ;; Default to the `default-directory' of the current
+ ;; buffer
+ default-directory)))
+ (unless (file-exists-p directory)
+ (error ":working-directory %s of syntax checker %S does not exist"
+ directory checker))
+ directory))
+
+;;;###autoload
+(defun flycheck-define-command-checker (symbol docstring &rest properties)
+ "Define SYMBOL as syntax checker to run a command.
+
+Define SYMBOL as generic syntax checker via
+`flycheck-define-generic-checker', which uses an external command
+to check the buffer. SYMBOL and DOCSTRING are the same as for
+`flycheck-define-generic-checker'.
+
+In addition to the properties understood by
+`flycheck-define-generic-checker', the following PROPERTIES
+constitute a command syntax checker. Unless otherwise noted, all
+properties are mandatory. Note that the default `:error-filter'
+of command checkers is `flycheck-sanitize-errors'.
+
+`:command COMMAND'
+ The command to run for syntax checking.
+
+ COMMAND is a list of the form `(EXECUTABLE [ARG ...])'.
+
+ EXECUTABLE is a string with the executable of this syntax
+ checker. It can be overridden with the variable
+ `flycheck-SYMBOL-executable'. Note that this variable is
+ NOT implicitly defined by this function. Use
+ `flycheck-def-executable-var' to define this variable.
+
+ Each ARG is an argument to the executable, either as string,
+ or as special symbol or form for
+ `flycheck-substitute-argument', which see.
+
+`:error-patterns PATTERNS'
+ A list of patterns to parse the output of the `:command'.
+
+ Each ITEM in PATTERNS is a list `(LEVEL SEXP ...)', where
+ LEVEL is a Flycheck error level (see
+ `flycheck-define-error-level'), followed by one or more RX
+ `SEXP's which parse an error of that level and extract line,
+ column, file name and the message.
+
+ See `rx' for general information about RX, and
+ `flycheck-rx-to-string' for some special RX forms provided
+ by Flycheck.
+
+ All patterns are applied in the order of declaration to the
+ whole output of the syntax checker. Output already matched
+ by a pattern will not be matched by subsequent patterns. In
+ other words, the first pattern wins.
+
+ This property is optional. If omitted, however, an
+ `:error-parser' is mandatory.
+
+`:error-parser FUNCTION'
+ A function to parse errors with.
+
+ The function shall accept three arguments OUTPUT CHECKER
+ BUFFER. OUTPUT is the syntax checker output as string,
+ CHECKER the syntax checker that was used, and BUFFER a
+ buffer object representing the checked buffer. The function
+ must return a list of `flycheck-error' objects parsed from
+ OUTPUT.
+
+ This property is optional. If omitted, it defaults to
+ `flycheck-parse-with-patterns'. In this case,
+ `:error-patterns' is mandatory.
+
+`:standard-input t'
+ Whether to send the buffer contents on standard input.
+
+ If this property is given and has a non-nil value, send the
+ contents of the buffer on standard input.
+
+ Defaults to nil.
+
+Note that you may not give `:start', `:interrupt', and
+`:print-doc' for a command checker. You can give a custom
+`:verify' function, though, whose results will be appended to the
+default `:verify' function of command checkers."
+ (declare (indent 1)
+ (doc-string 2))
+ (dolist (prop '(:start :interrupt :print-doc))
+ (when (plist-get properties prop)
+ (error "%s not allowed in definition of command syntax checker %s"
+ prop symbol)))
+
+ (unless (plist-get properties :error-filter)
+ ;; Default to `flycheck-sanitize-errors' as error filter
+ (setq properties (plist-put properties :error-filter
+ #'flycheck-sanitize-errors)))
+ (let ((verify-fn (plist-get properties :verify)))
+ (setq properties
+ (plist-put properties :verify
+ (lambda (checker)
+ (append (flycheck-verify-command-checker checker)
+ (and verify-fn
+ (funcall verify-fn checker)))))))
+
+ (let ((command (plist-get properties :command))
+ (patterns (plist-get properties :error-patterns))
+ (parser (or (plist-get properties :error-parser)
+ #'flycheck-parse-with-patterns))
+ (enabled (plist-get properties :enabled))
+ (standard-input (plist-get properties :standard-input)))
+ (unless command
+ (error "Missing :command in syntax checker %s" symbol))
+ (unless (stringp (car command))
+ (error "Command executable for syntax checker %s must be a string: %S"
+ symbol (car command)))
+ (dolist (arg (cdr command))
+ (unless (flycheck-command-argument-p arg)
+ (error "Invalid command argument %S in syntax checker %s" arg symbol)))
+ (when (and (eq parser 'flycheck-parse-with-patterns)
+ (not patterns))
+ (error "Missing :error-patterns in syntax checker %s" symbol))
+
+ (setq properties
+ ;; Automatically disable command checkers if the executable does not
+ ;; exist.
+ (plist-put properties :enabled
+ (lambda ()
+ (and (flycheck-find-checker-executable symbol)
+ (flycheck-temp-files-writable-p symbol)
+ (or (not enabled) (funcall enabled))))))
+
+ (apply #'flycheck-define-generic-checker symbol docstring
+ :start #'flycheck-start-command-checker
+ :interrupt #'flycheck-interrupt-command-checker
+ :print-doc #'flycheck-command-checker-print-doc
+ properties)
+
+ ;; Pre-compile all errors patterns into strings, so that we don't need to do
+ ;; that on each error parse
+ (let ((patterns (seq-map (lambda (p)
+ (cons (flycheck-rx-to-string `(and ,@(cdr p))
+ 'no-group)
+ (car p)))
+ patterns)))
+ (pcase-dolist (`(,prop . ,value)
+ `((command . ,command)
+ (error-parser . ,parser)
+ (error-patterns . ,patterns)
+ (standard-input . ,standard-input)))
+ (setf (flycheck-checker-get symbol prop) value)))))
+
+(eval-and-compile
+ ;; Make this function available during byte-compilation, since we need it
+ ;; at macro expansion of `flycheck-def-executable-var'.
+ (defun flycheck-checker-executable-variable (checker)
+ "Get the executable variable of CHECKER.
+
+The executable variable is named `flycheck-CHECKER-executable'."
+ (intern (format "flycheck-%s-executable" checker))))
+
+(defun flycheck-checker-default-executable (checker)
+ "Get the default executable of CHECKER."
+ (car (flycheck-checker-get checker 'command)))
+
+(defun flycheck-checker-executable (checker)
+ "Get the command executable of CHECKER.
+
+The executable is either the value of the variable
+`flycheck-CHECKER-executable', or the default executable given in
+the syntax checker definition, if the variable is nil."
+ (let ((var (flycheck-checker-executable-variable checker)))
+ (or (and (boundp var) (symbol-value var))
+ (flycheck-checker-default-executable checker))))
+
+(defun flycheck-find-checker-executable (checker)
+ "Get the full path of the executable of CHECKER.
+
+Return the full absolute path to the executable of CHECKER, or
+nil if the executable does not exist."
+ (funcall flycheck-executable-find (flycheck-checker-executable checker)))
+
+(defun flycheck-call-checker-process
+ (checker infile destination error &rest args)
+ "Call CHECKER's executable with ARGS.
+
+Return nil (or raise an error if ERROR is non-nil) when CHECKER's
+executable cannot be found, and return a numeric exit status or a
+signal description string otherwise. CHECKER's input is taken
+from INFILE, and its output is sent to DESTINATION, as in
+`call-process'."
+ (-if-let (executable (flycheck-find-checker-executable checker))
+ (condition-case err
+ (apply #'call-process executable infile destination nil args)
+ (error (when error (signal (car err) (cdr err)))))
+ (when error
+ (user-error "Cannot find `%s' using `flycheck-executable-find'"
+ (flycheck-checker-executable checker)))))
+
+(defun flycheck-call-checker-process-for-output
+ (checker infile error &rest args)
+ "Call CHECKER's executable with ARGS and return its output.
+
+Call `flycheck-call-checker-process' with INFILE, ERROR, and
+ARGS. If it returns 0, return the process' output. Otherwise,
+return nil or throw an error.
+
+This function is similar to `flycheck-call-checker-process'
+called in a `with-output-to-string' block, but it takes care of
+the error checking automatically."
+ (let ((temp (generate-new-buffer " *temp*")))
+ (unwind-protect
+ ;; We need to call the checker process in the right buffer, so that it
+ ;; uses the right exec-path, checker executable, etc. See URL
+ ;; `https://github.com/flycheck/flycheck/issues/1770'.
+ (let ((exit-code (apply #'flycheck-call-checker-process
+ checker infile temp error args))
+ (output (with-current-buffer temp (buffer-string))))
+ (if (eql 0 exit-code) output
+ (when error
+ (error "Process %s failed with %S (%s)"
+ checker exit-code output))))
+ (kill-buffer temp))))
+
+(defun flycheck-checker-arguments (checker)
+ "Get the command arguments of CHECKER."
+ (cdr (flycheck-checker-get checker 'command)))
+
+(defun flycheck-substitute-argument (arg checker)
+ "Substitute ARG for CHECKER.
+
+Return a list of real arguments for the executable of CHECKER,
+substituted for the symbolic argument ARG. Single arguments,
+e.g. if ARG is a literal strings, are wrapped in a list.
+
+ARG may be one of the following forms:
+
+STRING
+ Return ARG unchanged.
+
+`source', `source-inplace'
+ Create a temporary file to check and return its path. With
+ `source-inplace' create the temporary file in the same
+ directory as the original file. The value of
+ `flycheck-temp-prefix' is used as prefix of the file name.
+
+ With `source', try to retain the non-directory component of
+ the buffer's file name in the temporary file.
+
+ `source' is the preferred way to pass the input file to a
+ syntax checker. `source-inplace' should only be used if the
+ syntax checker needs other files from the source directory,
+ such as include files in C.
+
+`(source SUFFIX)', `(source-inplace SUFFIX)'
+ Like `source' and `source-inplace', but ensure generated
+ file names end with the given suffix. Use this when the
+ checker requires that file names on its command line have a
+ certain suffix (file extension).
+
+`source-original'
+ Return the path of the actual file to check, or an empty
+ string if the buffer has no file name.
+
+ Note that the contents of the file may not be up to date
+ with the contents of the buffer to check. Do not use this
+ as primary input to a checker, unless absolutely necessary.
+
+ When using this symbol as primary input to the syntax
+ checker, add `flycheck-buffer-saved-p' to the `:predicate'.
+
+`temporary-directory'
+ Create a unique temporary directory and return its path.
+
+`temporary-file-name'
+ Return a unique temporary filename. The file is *not*
+ created.
+
+ To ignore the output of syntax checkers, try symbol
+ `null-device' first.
+
+symbol `null-device'
+ Return the value of variable `null-device', i.e the system
+ null device.
+
+ Use this option to ignore the output of a syntax checker.
+ If the syntax checker cannot handle the null device, or
+ won't write to an existing file, try `temporary-file-name'
+ instead.
+
+`(config-file OPTION VARIABLE [PREPEND-FN])'
+ Search the configuration file bound to VARIABLE with
+ `flycheck-locate-config-file' and return a list of arguments
+ that pass this configuration file to the syntax checker, or
+ nil if the configuration file was not found.
+
+ PREPEND-FN is called with the OPTION and the located
+ configuration file, and should return OPTION prepended
+ before the file, either a string or as list. If omitted,
+ PREPEND-FN defaults to `list'.
+
+`(option OPTION VARIABLE [PREPEND-FN [FILTER]])'
+ Retrieve the value of VARIABLE and return a list of
+ arguments that pass this value as value for OPTION to the
+ syntax checker.
+
+ PREPEND-FN is called with the OPTION and the value of
+ VARIABLE, and should return OPTION prepended before the
+ file, either a string or as list. If omitted, PREPEND-FN
+ defaults to `list'.
+
+ FILTER is an optional function to be applied to the value of
+ VARIABLE before prepending. This function must return nil
+ or a string. In the former case, return nil. In the latter
+ case, return a list of arguments as described above.
+
+`(option-list OPTION VARIABLE [PREPEND-FN [FILTER]])'
+ Retrieve the value of VARIABLE, which must be a list,
+ and prepend OPTION before each item in this list, using
+ PREPEND-FN.
+
+ PREPEND-FN is called with the OPTION and each item of the
+ list as second argument, and should return OPTION prepended
+ before the item, either as string or as list. If omitted,
+ PREPEND-FN defaults to `list'.
+
+ FILTER is an optional function to be applied to each item in
+ the list before prepending OPTION. It shall return the
+ option value for each item as string, or nil, if the item is
+ to be ignored.
+
+`(option-flag OPTION VARIABLE)'
+ Retrieve the value of VARIABLE and return OPTION, if the
+ value is non-nil. Otherwise return nil.
+
+`(eval FORM)'
+ Return the result of evaluating FORM in the buffer to be
+ checked. FORM must either return a string or a list of
+ strings, or nil to indicate that nothing should be
+ substituted for CELL. For all other return types, signal an
+ error
+
+ _No_ further substitutions are performed, neither in FORM
+ before it is evaluated, nor in the result of evaluating
+ FORM.
+
+In all other cases, signal an error.
+
+Note that substitution is *not* recursive. No symbols or cells
+are substituted within the body of cells!"
+ (pcase arg
+ ((pred stringp) (list arg))
+ (`source
+ (list (flycheck-save-buffer-to-temp #'flycheck-temp-file-system)))
+ (`source-inplace
+ (list (flycheck-save-buffer-to-temp #'flycheck-temp-file-inplace)))
+ (`(source ,suffix)
+ (list (flycheck-save-buffer-to-temp
+ (lambda (filename) (flycheck-temp-file-system filename suffix)))))
+ (`(source-inplace ,suffix)
+ (list (flycheck-save-buffer-to-temp
+ (lambda (filename) (flycheck-temp-file-inplace filename suffix)))))
+ (`source-original (list (or (buffer-file-name) "")))
+ (`temporary-directory (list (flycheck-temp-dir-system)))
+ (`temporary-file-name
+ (let ((directory (flycheck-temp-dir-system)))
+ (list (make-temp-name (expand-file-name "flycheck" directory)))))
+ (`null-device (list null-device))
+ (`(config-file ,option-name ,file-name-var)
+ (-when-let* ((value (symbol-value file-name-var))
+ (file-name (flycheck-locate-config-file value checker)))
+ (flycheck-prepend-with-option option-name (list file-name))))
+ (`(config-file ,option-name ,file-name-var ,prepend-fn)
+ (-when-let* ((value (symbol-value file-name-var))
+ (file-name (flycheck-locate-config-file value checker)))
+ (flycheck-prepend-with-option option-name (list file-name) prepend-fn)))
+ (`(option ,option-name ,variable)
+ (-when-let (value (symbol-value variable))
+ (unless (stringp value)
+ (error "Value %S of %S for option %s is not a string"
+ value variable option-name))
+ (flycheck-prepend-with-option option-name (list value))))
+ (`(option ,option-name ,variable ,prepend-fn)
+ (-when-let (value (symbol-value variable))
+ (unless (stringp value)
+ (error "Value %S of %S for option %s is not a string"
+ value variable option-name))
+ (flycheck-prepend-with-option option-name (list value) prepend-fn)))
+ (`(option ,option-name ,variable ,prepend-fn ,filter)
+ (-when-let (value (funcall filter (symbol-value variable)))
+ (unless (stringp value)
+ (error "Value %S of %S (filter: %S) for option %s is not a string"
+ value variable filter option-name))
+ (flycheck-prepend-with-option option-name (list value) prepend-fn)))
+ (`(option-list ,option-name ,variable)
+ (let ((value (symbol-value variable)))
+ (unless (and (listp value) (seq-every-p #'stringp value))
+ (error "Value %S of %S for option %S is not a list of strings"
+ value variable option-name))
+ (flycheck-prepend-with-option option-name value)))
+ (`(option-list ,option-name ,variable ,prepend-fn)
+ (let ((value (symbol-value variable)))
+ (unless (and (listp value) (seq-every-p #'stringp value))
+ (error "Value %S of %S for option %S is not a list of strings"
+ value variable option-name))
+ (flycheck-prepend-with-option option-name value prepend-fn)))
+ (`(option-list ,option-name ,variable ,prepend-fn ,filter)
+ (let ((value (delq nil (seq-map filter (symbol-value variable)))))
+ (unless (and (listp value) (seq-every-p #'stringp value))
+ (error "Value %S of %S for option %S is not a list of strings"
+ value variable option-name))
+ (flycheck-prepend-with-option option-name value prepend-fn)))
+ (`(option-flag ,option-name ,variable)
+ (when (symbol-value variable)
+ (list option-name)))
+ (`(eval ,form)
+ (let ((result (eval form)))
+ (cond
+ ((and (listp result) (seq-every-p #'stringp result)) result)
+ ((stringp result) (list result))
+ (t (error "Invalid result from evaluation of %S: %S" form result)))))
+ (_ (error "Unsupported argument %S" arg))))
+
+(defun flycheck-checker-substituted-arguments (checker)
+ "Get the substituted arguments of a CHECKER.
+
+Substitute each argument of CHECKER using
+`flycheck-substitute-argument'. This replaces any special
+symbols in the command."
+ (apply #'append
+ (seq-map (lambda (arg) (flycheck-substitute-argument arg checker))
+ (flycheck-checker-arguments checker))))
+
+(defun flycheck--process-send-buffer-contents-chunked (process)
+ "Send contents of current buffer to PROCESS in small batches.
+
+Send the entire buffer to the standard input of PROCESS in chunks
+of 4096 characters. Chunking is done in Emacs Lisp, hence this
+function is probably far less efficient than
+`send-process-region'. Use only when required."
+ (let ((from (point-min)))
+ (while (< from (point-max))
+ (let ((to (min (+ from 4096) (point-max))))
+ (process-send-region process from to)
+ (setq from to)))))
+
+(defvar flycheck-chunked-process-input
+ ;; Chunk process output on Windows to work around
+ ;; https://github.com/flycheck/flycheck/issues/794 and
+ ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22344. The presence of
+ ;; `w32-pipe-buffer-size' denotes an Emacs version (> Emacs 25.1) where pipe
+ ;; writes on Windows are fixed.
+ ;;
+ ;; TODO: Remove option and chunking when dropping Emacs 24 support, see
+ ;; https://github.com/flycheck/flycheck/issues/856
+ (and (eq system-type 'windows-nt) (not (boundp 'w32-pipe-buffer-size)))
+ "If non-nil send process input in small chunks.
+
+If this variable is non-nil `flycheck-process-send-buffer' sends
+buffer contents in small chunks.
+
+Defaults to nil, except on Windows to work around Emacs bug
+#22344.")
+
+(defun flycheck-process-send-buffer (process)
+ "Send all contents of current buffer to PROCESS.
+
+Sends all contents of the current buffer to the standard input of
+PROCESS, and terminates standard input with EOF.
+
+If `flycheck-chunked-process-input' is non-nil, send buffer
+contents in chunks via
+`flycheck--process-send-buffer-contents-chunked', which see.
+Otherwise use `process-send-region' to send all contents at once
+and rely on Emacs' own buffering and chunking."
+ (save-restriction
+ (widen)
+ (if flycheck-chunked-process-input
+ (flycheck--process-send-buffer-contents-chunked process)
+ (process-send-region process (point-min) (point-max))))
+ (process-send-eof process))
+
+(defun flycheck--wrap-command (prog args)
+ "Wrap PROG and ARGS using `flycheck-command-wrapper-function'."
+ ;; We don't call `flycheck-executable-find' on the output of the wrapper
+ ;; function, since it might not expect it (an executable-find function
+ ;; designed to find binaries in a sandbox could get confused if we asked it
+ ;; about the sandboxing program itself).
+ (funcall flycheck-command-wrapper-function (cons prog args)))
+
+(defun flycheck-start-command-checker (checker callback)
+ "Start a command CHECKER with CALLBACK."
+ (let (process)
+ (condition-case err
+ (let* ((program (flycheck-find-checker-executable checker))
+ (args (flycheck-checker-substituted-arguments checker))
+ (command (flycheck--wrap-command program args))
+ (sentinel-events nil)
+ ;; Use pipes to receive output from the syntax checker. They are
+ ;; more efficient and more robust than PTYs, which Emacs uses by
+ ;; default, and since we don't need any job control features, we
+ ;; can easily use pipes.
+ (process-connection-type nil))
+ ;; We pass do not associate the process with any buffer, by
+ ;; passing nil for the BUFFER argument of `start-process'.
+ ;; Instead, we just remember the buffer being checked in a
+ ;; process property (see below). This neatly avoids all
+ ;; side-effects implied by attached a process to a buffer, which
+ ;; may cause conflicts with other packages.
+ ;;
+ ;; See https://github.com/flycheck/flycheck/issues/298 for an
+ ;; example for such a conflict.
+ (setq process (apply 'start-process (format "flycheck-%s" checker)
+ nil command))
+ ;; Process sentinels can be called while sending input to the process.
+ ;; We want to record errors raised by process-send before calling
+ ;; `flycheck-handle-signal', so initially just accumulate events.
+ (setf (process-sentinel process)
+ (lambda (_ event) (push event sentinel-events)))
+ (setf (process-filter process) #'flycheck-receive-checker-output)
+ (set-process-query-on-exit-flag process nil)
+ ;; Remember the syntax checker, the buffer and the callback
+ (process-put process 'flycheck-checker checker)
+ (process-put process 'flycheck-callback callback)
+ (process-put process 'flycheck-buffer (current-buffer))
+ ;; The default directory is bound in the `flycheck-syntax-check-start'
+ ;; function.
+ (process-put process 'flycheck-working-directory default-directory)
+ ;; Track the temporaries created by argument substitution in the
+ ;; process itself, to get rid of the global state ASAP.
+ (process-put process 'flycheck-temporaries flycheck-temporaries)
+ (setq flycheck-temporaries nil)
+ ;; Send the buffer to the process on standard input, if enabled.
+ (when (flycheck-checker-get checker 'standard-input)
+ (condition-case err
+ (flycheck-process-send-buffer process)
+ ;; Some checkers exit before reading all input, causing errors
+ ;; such as a `file-error' for a closed pipe, or a plain “no longer
+ ;; connected to pipe; closed it” error for a disconnection. We
+ ;; report them if needed in `flycheck-finish-checker-process' (see
+ ;; `https://github.com/flycheck/flycheck/issues/1278').
+ (error (process-put process 'flycheck-error err))))
+ ;; Set the actual sentinel and process any events that might have
+ ;; happened while we were sending input.
+ (setf (process-sentinel process) #'flycheck-handle-signal)
+ (dolist (event (nreverse sentinel-events))
+ (flycheck-handle-signal process event))
+ ;; Return the process.
+ process)
+ (error
+ ;; In case of error, clean up our resources, and report the error back to
+ ;; Flycheck.
+ (flycheck-safe-delete-temporaries)
+ (when process
+ ;; No need to explicitly delete the temporary files of the process,
+ ;; because deleting runs the sentinel, which will delete them anyway.
+ (delete-process process))
+ (signal (car err) (cdr err))))))
+
+(defun flycheck-interrupt-command-checker (_checker process)
+ "Interrupt a PROCESS."
+ ;; Deleting the process always triggers the sentinel, which does the cleanup
+ (when process
+ (delete-process process)))
+
+(defun flycheck-command-checker-print-doc (checker)
+ "Print additional documentation for a command CHECKER."
+ (let ((executable (flycheck-checker-default-executable checker))
+ (config-file-var (flycheck-checker-get checker 'config-file-var))
+ (option-vars (seq-sort #'string<
+ (flycheck-checker-get checker 'option-vars))))
+ (princ "\n")
+
+ (let ((doc-start (with-current-buffer standard-output (point-max))))
+ ;; Track the start of our documentation so that we can re-indent it
+ ;; properly
+ (princ " This syntax checker executes \"")
+ (princ executable)
+ (princ "\"")
+ (when config-file-var
+ (princ ", using a configuration file from `")
+ (princ (symbol-name config-file-var))
+ (princ "'"))
+ (princ ". The executable can be overridden with `")
+ (princ (symbol-name (flycheck-checker-executable-variable checker)))
+ (princ "'.")
+
+ (with-current-buffer standard-output
+ (save-excursion
+ (fill-region-as-paragraph doc-start (point-max)))))
+ (princ "\n")
+ (when option-vars
+ (princ
+ "\n This syntax checker can be configured with these options:\n\n")
+ (dolist (var option-vars)
+ (princ (format " * `%s'\n" var))))))
+
+(defun flycheck-verify-command-checker (checker)
+ "Verify a command CHECKER in the current buffer.
+
+Return a list of `flycheck-verification-result' objects for
+CHECKER."
+ (let ((executable (flycheck-find-checker-executable checker))
+ (config-file-var (flycheck-checker-get checker 'config-file-var)))
+ `(
+ ,(flycheck-verification-result-new
+ :label "executable"
+ :message (if executable (format "Found at %s" executable) "Not found")
+ :face (if executable 'success '(bold error)))
+ ,@(when config-file-var
+ (let* ((value (symbol-value config-file-var))
+ (path (and value (flycheck-locate-config-file value checker))))
+ (list (flycheck-verification-result-new
+ :label "configuration file"
+ :message (if path (format "Found at %S" path) "Not found")
+ :face (if path 'success 'warning)))))
+ ,@(when (not (flycheck-temp-files-writable-p checker))
+ (list (flycheck-verification-result-new
+ :label "temp directory"
+ :message (format "%s is not writable"
+ (flycheck-temp-directory checker))
+ :face 'error))))))
+
+
+;;; Process management for command syntax checkers
+(defun flycheck-receive-checker-output (process output)
+ "Receive a syntax checking PROCESS OUTPUT."
+ (push output (process-get process 'flycheck-pending-output)))
+
+(defun flycheck-get-output (process)
+ "Get the complete output of PROCESS."
+ (with-demoted-errors "Error while retrieving process output: %S"
+ (let ((pending-output (process-get process 'flycheck-pending-output)))
+ (apply #'concat (nreverse pending-output)))))
+
+(defun flycheck-handle-signal (process _event)
+ "Handle a signal from the syntax checking PROCESS.
+
+_EVENT is ignored."
+ (when (memq (process-status process) '(signal exit))
+ (let ((files (process-get process 'flycheck-temporaries))
+ (buffer (process-get process 'flycheck-buffer))
+ (callback (process-get process 'flycheck-callback))
+ (cwd (process-get process 'flycheck-working-directory))
+ (err (process-get process 'flycheck-error)))
+ ;; Delete the temporary files
+ (seq-do #'flycheck-safe-delete files)
+ (when (buffer-live-p buffer)
+ (with-current-buffer buffer
+ (condition-case err
+ (pcase (process-status process)
+ (`signal
+ (funcall callback 'interrupted))
+ (`exit
+ (flycheck-finish-checker-process
+ (process-get process 'flycheck-checker)
+ (or err (process-exit-status process))
+ files
+ (flycheck-get-output process) callback cwd)))
+ ((debug error)
+ (funcall callback 'errored (error-message-string err)))))))))
+
+(defun flycheck-finish-checker-process
+ (checker exit-status files output callback cwd)
+ "Finish a checker process from CHECKER with EXIT-STATUS.
+
+EXIT-STATUS can be a number or an arbitrary form (if it is not 0,
+a `suspicious' status is reported to CALLBACK).
+
+FILES is a list of files given as input to the checker. OUTPUT
+is the output of the syntax checker. CALLBACK is the status
+callback to use for reporting.
+
+Parse the OUTPUT and report an appropriate error status.
+
+Resolve all errors in OUTPUT using CWD as working directory."
+ (let ((errors (flycheck-parse-output output checker (current-buffer))))
+ (when (and (not (equal exit-status 0)) (null errors))
+ ;; Warn about a suspicious result from the syntax checker. We do right
+ ;; after parsing the errors, before filtering, because a syntax checker
+ ;; might report errors from other files (e.g. includes) even if there
+ ;; are no errors in the file being checked.
+ (funcall callback 'suspicious
+ (format "Flycheck checker %S returned %S, but \
+its output contained no errors: %s\nTry installing a more \
+recent version of %S, and please open a bug report if the issue \
+persists in the latest release. Thanks!" checker exit-status
+output checker)))
+ (funcall callback 'finished
+ ;; Fix error file names, by substituting them backwards from the
+ ;; temporaries.
+ (seq-map (lambda (e) (flycheck-fix-error-filename e files cwd))
+ errors))))
+
+
+;;; Executables of command checkers.
+(defmacro flycheck-def-executable-var (checker default-executable)
+ "Define the executable variable for CHECKER.
+
+DEFAULT-EXECUTABLE is the default executable. It is only used in
+the docstring of the variable.
+
+The variable is defined with `defcustom' in the
+`flycheck-executables' group. It's also defined to be risky as
+file-local variable, to avoid arbitrary executables being used
+for syntax checking."
+ (let ((executable-var (flycheck-checker-executable-variable checker)))
+ `(progn
+ (defcustom ,executable-var nil
+ ,(format "The executable of the %s syntax checker.
+
+Either a string containing the name or the path of the
+executable, or nil to use the default executable from the syntax
+checker declaration.
+
+The default executable is %S." checker default-executable)
+ :type '(choice (const :tag "Default executable" nil)
+ (string :tag "Name or path"))
+ :group 'flycheck-executables
+ :risky t))))
+
+(defun flycheck-set-checker-executable (checker &optional executable)
+ "Set the executable of CHECKER in the current buffer.
+
+CHECKER is a syntax checker symbol. EXECUTABLE is a string with
+the name of an executable or the path to an executable file, which
+is to be used as executable for CHECKER. If omitted or nil,
+reset the executable of CHECKER.
+
+Interactively, prompt for a syntax checker and an executable
+file, and set the executable of the selected syntax checker.
+With prefix arg, prompt for a syntax checker only, and reset the
+executable of the select checker to the default.
+
+Set the executable variable of CHECKER, that is,
+`flycheck-CHECKER-executable' to EXECUTABLE. Signal
+`user-error', if EXECUTABLE does not denote a command or an
+executable file.
+
+This command is intended for interactive use only. In Lisp, just
+`let'-bind the corresponding variable, or set it directly. Use
+`flycheck-checker-executable-variable' to obtain the executable
+variable symbol for a syntax checker."
+ (declare (interactive-only "Set the executable variable directly instead"))
+ (interactive
+ (let* ((checker (flycheck-read-checker "Syntax checker: "))
+ (default-executable (flycheck-checker-default-executable checker))
+ (executable (if current-prefix-arg
+ nil
+ (read-file-name "Executable: " nil default-executable
+ nil nil flycheck-executable-find))))
+ (list checker executable)))
+ (when (and executable (not (funcall flycheck-executable-find executable)))
+ (user-error "%s is no executable" executable))
+ (let ((variable (flycheck-checker-executable-variable checker)))
+ (set (make-local-variable variable) executable)))
+
+
+;;; Configuration files and options for command checkers
+(defun flycheck-register-config-file-var (var checkers)
+ "Register VAR as config file var for CHECKERS.
+
+CHECKERS is a single syntax checker or a list thereof."
+ (when (symbolp checkers)
+ (setq checkers (list checkers)))
+ (dolist (checker checkers)
+ (setf (flycheck-checker-get checker 'config-file-var) var)))
+
+;;;###autoload
+(defmacro flycheck-def-config-file-var (symbol checker &optional file-name
+ &rest custom-args)
+ "Define SYMBOL as config file variable for CHECKER, with default FILE-NAME.
+
+SYMBOL is declared as customizable variable using `defcustom', to
+provide configuration files for the given syntax CHECKER.
+CUSTOM-ARGS are forwarded to `defcustom'.
+
+FILE-NAME is the initial value of the new variable. If omitted,
+the default value is nil. It can be either a string or a list of
+strings.
+
+Use this together with the `config-file' form in the `:command'
+argument to `flycheck-define-checker'."
+ (declare (indent 3))
+ `(progn
+ (defcustom ,symbol ,file-name
+ ,(format "Configuration file for `%s'.
+
+If set to a string, locate the configuration file using the
+functions from `flycheck-locate-config-file-functions'. If the
+file is found pass it to the syntax checker as configuration
+file.
+
+If no configuration file is found, or if this variable is set to
+nil, invoke the syntax checker without a configuration file.
+
+Use this variable as file-local variable if you need a specific
+configuration file for a buffer." checker)
+ :type '(choice (const :tag "No configuration file" nil)
+ (string :tag "File name or path")
+ (repeat :tag "File names or paths" string))
+ :safe #'flycheck-string-or-string-list-p
+ :group 'flycheck-config-files
+ ,@custom-args)
+ (flycheck-register-config-file-var ',symbol ',checker)))
+
+(defun flycheck-locate-config-file (filenames checker)
+ "Locate the configuration file for CHECKER, based on FILENAMES.
+
+FILENAMES can be either a single file, or a list. Each filename
+is passed to all `flycheck-locate-config-file-functions', until
+one returns non-nil.
+
+Return the absolute path of the configuration file, or nil if no
+configuration file was found."
+ (when (stringp filenames)
+ (setq filenames (list filenames)))
+ (let ((config-file nil))
+ (while (and filenames (null config-file))
+ (setq config-file (run-hook-with-args-until-success
+ 'flycheck-locate-config-file-functions
+ (pop filenames) checker)))
+ (when (and config-file (file-exists-p config-file))
+ config-file)))
+
+(defun flycheck-locate-config-file-by-path (filepath _checker)
+ "Locate a configuration file by a FILEPATH.
+
+If FILEPATH is a contains a path separator, expand it against the
+default directory and return it if it points to an existing file.
+Otherwise return nil.
+
+_CHECKER is ignored."
+ ;; If the path is just a plain file name, skip it.
+ (unless (string= (file-name-nondirectory filepath) filepath)
+ (let ((file-name (expand-file-name filepath)))
+ (and (file-exists-p file-name) file-name))))
+
+(defun flycheck-locate-config-file-ancestor-directories (filename _checker)
+ "Locate a configuration FILENAME in ancestor directories.
+
+If the current buffer has a file name, search FILENAME in the
+directory of the current buffer and all ancestors thereof (see
+`locate-dominating-file'). If the file is found, return its
+absolute path. Otherwise return nil.
+
+_CHECKER is ignored."
+ (-when-let* ((basefile (buffer-file-name))
+ (directory (locate-dominating-file basefile filename)))
+ (expand-file-name filename directory)))
+
+(defun flycheck-locate-config-file-home (filename _checker)
+ "Locate a configuration FILENAME in the home directory.
+
+Return the absolute path, if FILENAME exists in the user's home
+directory, or nil otherwise."
+ (let ((path (expand-file-name filename "~")))
+ (when (file-exists-p path)
+ path)))
+
+(seq-do (apply-partially #'custom-add-frequent-value
+ 'flycheck-locate-config-file-functions)
+ '(flycheck-locate-config-file-by-path
+ flycheck-locate-config-file-ancestor-directories
+ flycheck-locate-config-file-home))
+
+(defun flycheck-register-option-var (var checkers)
+ "Register an option VAR with CHECKERS.
+
+VAR is an option symbol, and CHECKERS a syntax checker symbol or
+a list thereof. Register VAR with all CHECKERS so that it
+appears in the help output."
+ (when (symbolp checkers)
+ (setq checkers (list checkers)))
+ (dolist (checker checkers)
+ (cl-pushnew var (flycheck-checker-get checker 'option-vars))))
+
+;;;###autoload
+(defmacro flycheck-def-option-var (symbol init-value checkers docstring
+ &rest custom-args)
+ "Define SYMBOL as option variable with INIT-VALUE for CHECKER.
+
+SYMBOL is declared as customizable variable using `defcustom', to
+provide an option for the given syntax CHECKERS (a checker or a
+list of checkers). INIT-VALUE is the initial value of the
+variable, and DOCSTRING is its docstring. CUSTOM-ARGS are
+forwarded to `defcustom'.
+
+Use this together with the `option', `option-list' and
+`option-flag' forms in the `:command' argument to
+`flycheck-define-checker'."
+ (declare (indent 3)
+ (doc-string 4))
+ `(progn
+ (defcustom ,symbol ,init-value
+ ,(concat docstring "
+
+This variable is an option for the following syntax checkers:
+
+"
+ (mapconcat (lambda (c) (format " - `%s'" c))
+ (if (symbolp checkers) (list checkers) checkers)
+ "\n"))
+ :group 'flycheck-options
+ ,@custom-args)
+ (flycheck-register-option-var ',symbol ',checkers)))
+
+(defun flycheck-option-int (value)
+ "Convert an integral option VALUE to a string.
+
+If VALUE is nil, return nil. Otherwise return VALUE converted to
+a string."
+ (and value (number-to-string value)))
+
+(defun flycheck-option-symbol (value)
+ "Convert a symbol option VALUE to string.
+
+If VALUE is nil return nil. Otherwise return VALUE converted to
+a string."
+ (and value (symbol-name value)))
+
+(defun flycheck-option-comma-separated-list (value &optional separator filter)
+ "Convert VALUE into a list separated by SEPARATOR.
+
+SEPARATOR is a string to separate items in VALUE, defaulting to
+\",\". FILTER is an optional function, which takes a single
+argument and returns either a string or nil.
+
+If VALUE is a list, apply FILTER to each item in VALUE, remove
+all nil items, and return a single string of all remaining items
+separated by SEPARATOR.
+
+Otherwise, apply FILTER to VALUE and return the result.
+SEPARATOR is ignored in this case."
+ (let ((filter (or filter #'identity))
+ (separator (or separator ",")))
+ (if (listp value)
+ (-when-let (value (delq nil (seq-map filter value)))
+ (string-join value separator))
+ (funcall filter value))))
+
+(defmacro flycheck-def-args-var (symbol checkers &rest custom-args)
+ "Define SYMBOL as argument variable for CHECKERS.
+
+SYMBOL is declared as customizable, risky and buffer-local
+variable using `defcustom' to provide an option for arbitrary
+arguments for the given syntax CHECKERS (either a single checker
+or a list of checkers). CUSTOM-ARGS is forwarded to `defcustom'.
+
+Use the `eval' form to splice this variable into the
+`:command'."
+ (declare (indent 2))
+ `(flycheck-def-option-var ,symbol nil ,checkers
+ "A list of additional command line arguments.
+
+The value of this variable is a list of strings with additional
+command line arguments."
+ :risky t
+ :type '(repeat (string :tag "Argument"))
+ ,@custom-args))
+
+
+;;; Command syntax checkers as compile commands
+(defun flycheck-checker-pattern-to-error-regexp (pattern)
+ "Convert PATTERN into an error regexp for compile.el.
+
+Return a list representing PATTERN, suitable as element in
+`compilation-error-regexp-alist'."
+ (let* ((regexp (car pattern))
+ (level (cdr pattern))
+ (level-no (flycheck-error-level-compilation-level level)))
+ `(,regexp 1 (2 . 6) (3 . 7) ,level-no)))
+
+(defun flycheck-checker-compilation-error-regexp-alist (checker)
+ "Convert error patterns of CHECKER for use with compile.el.
+
+Return an alist of all error patterns of CHECKER, suitable for
+use with `compilation-error-regexp-alist'."
+ (seq-map #'flycheck-checker-pattern-to-error-regexp
+ (flycheck-checker-get checker 'error-patterns)))
+
+(defun flycheck--substitute-shell-command-argument (arg checker)
+ "Substitute ARG for CHECKER.
+
+Like `flycheck-substitute-argument', except for source,
+source-inplace, and source-original."
+ (if (memq arg '(source source-inplace source-original))
+ (list buffer-file-name)
+ (flycheck-substitute-argument arg checker)))
+
+(defun flycheck--checker-substituted-shell-command-arguments (checker)
+ "Get the substituted arguments of a CHECKER to run as a shell command.
+
+Substitute each argument of CHECKER using
+`flycheck-substitute-shell-command-argument'."
+ (apply #'append
+ (seq-map (lambda (arg)
+ (flycheck--substitute-shell-command-argument arg checker))
+ (flycheck-checker-arguments checker))))
+
+(defun flycheck-checker-shell-command (checker)
+ "Get a shell command for CHECKER.
+
+Perform substitution in the arguments of CHECKER, but with
+`flycheck--substitute-shell-command-argument'.
+
+Return the command of CHECKER as single string, suitable for
+shell execution."
+ ;; Note: Do NOT use `combine-and-quote-strings' here. Despite it's name it
+ ;; does not properly quote shell arguments, and actually breaks for special
+ ;; characters. See https://github.com/flycheck/flycheck/pull/522
+ (let* ((args (flycheck--checker-substituted-shell-command-arguments checker))
+ (program
+ (or (flycheck-find-checker-executable checker)
+ (user-error "Cannot find `%s' using `flycheck-executable-find'"
+ (flycheck-checker-executable checker))))
+ (wrapped (flycheck--wrap-command program args))
+ (abs-prog
+ ;; The executable path returned by `flycheck-command-wrapper-function'
+ ;; may not be absolute, so expand it here. See URL
+ ;; `https://github.com/flycheck/flycheck/issues/1461'.
+ (or (executable-find (car wrapped))
+ (user-error "Cannot find `%s' using `executable-find'"
+ (car wrapped))))
+ (command (mapconcat #'shell-quote-argument
+ (cons abs-prog (cdr wrapped)) " ")))
+ (if (flycheck-checker-get checker 'standard-input)
+ ;; If the syntax checker expects the source from standard input add an
+ ;; appropriate shell redirection
+ (concat command " < " (shell-quote-argument (buffer-file-name)))
+ command)))
+
+(defun flycheck-compile-name (_name)
+ "Get a name for a Flycheck compilation buffer.
+
+_NAME is ignored."
+ (format "*Flycheck %s*" (buffer-file-name)))
+
+(defun flycheck-compile (checker)
+ "Run CHECKER via `compile'.
+
+CHECKER must be a valid syntax checker. Interactively, prompt
+for a syntax checker to run.
+
+Instead of highlighting errors in the buffer, this command pops
+up a separate buffer with the entire output of the syntax checker
+tool, just like `compile' (\\[compile])."
+ (interactive
+ (let ((default (flycheck-get-checker-for-buffer)))
+ (list (flycheck-read-checker "Run syntax checker as compile command: "
+ (when (flycheck-checker-get default 'command)
+ default)
+ 'command))))
+ (unless (flycheck-valid-checker-p checker)
+ (user-error "%S is not a valid syntax checker" checker))
+ (unless (buffer-file-name)
+ (user-error "Cannot compile a buffer without a backing file"))
+ (unless (flycheck-may-use-checker checker)
+ (user-error "Cannot use syntax checker %S in this buffer" checker))
+ (unless (flycheck-checker-executable checker)
+ (user-error "Cannot run checker %S as shell command" checker))
+ (save-some-buffers)
+ (let* ((default-directory (flycheck-compute-working-directory checker))
+ (command (flycheck-checker-shell-command checker))
+ (buffer (compilation-start command nil #'flycheck-compile-name)))
+ (with-current-buffer buffer
+ (setq-local compilation-error-regexp-alist
+ (flycheck-checker-compilation-error-regexp-alist checker)))))
+
+
+;;; General error parsing for command checkers
+(defun flycheck-parse-output (output checker buffer)
+ "Parse OUTPUT from CHECKER in BUFFER.
+
+OUTPUT is a string with the output from the checker symbol
+CHECKER. BUFFER is the buffer which was checked.
+
+Return the errors parsed with the error patterns of CHECKER."
+ (funcall (flycheck-checker-get checker 'error-parser) output checker buffer))
+
+(defun flycheck-fix-error-filename (err buffer-files cwd)
+ "Fix the file name of ERR from BUFFER-FILES.
+
+Resolves error file names relative to CWD directory.
+
+Make the file name of ERR absolute. If the absolute file name of
+ERR is in BUFFER-FILES, replace it with the value of variable
+`buffer-file-name'."
+ (flycheck-error-with-buffer err
+ (-when-let (filename (flycheck-error-filename err))
+ (when (seq-some (apply-partially #'flycheck-same-files-p
+ (expand-file-name filename cwd))
+ buffer-files)
+ (setf (flycheck-error-filename err) buffer-file-name)
+ (when (and buffer-file-name (flycheck-error-message err))
+ (setf (flycheck-error-message err)
+ (replace-regexp-in-string
+ (regexp-quote filename) buffer-file-name
+ (flycheck-error-message err) 'fixed-case 'literal))))))
+ err)
+
+
+;;; Error parsers for command syntax checkers
+(defun flycheck-parse-xml-region (beg end)
+ "Parse the xml region between BEG and END.
+
+Wrapper around `xml-parse-region' which transforms the return
+value of this function into one compatible to
+`libxml-parse-xml-region' by simply returning the first element
+from the node list."
+ (ignore-errors (car (xml-parse-region beg end))))
+
+(defun flycheck-parse-xml-region-with-fallback (beg end)
+ "Parse the xml region between BEG and END.
+
+Try parsing with libxml first; if that fails, revert to
+`flycheck-parse-xml-region'. Failures can be caused by incorrect
+XML (see URL `https://github.com/flycheck/flycheck/issues/1298'),
+or on Windows by a missing libxml DLL with a libxml-enabled Emacs
+\(see URL `https://github.com/flycheck/flycheck/issues/1330')."
+ ;; FIXME use `libxml-available-p' when it gets implemented.
+ (or (and (fboundp 'libxml-parse-xml-region)
+ (libxml-parse-xml-region beg end))
+ (flycheck-parse-xml-region beg end)))
+
+(defvar flycheck-xml-parser 'flycheck-parse-xml-region-with-fallback
+ "Function used to parse an xml string from a region.
+
+The default uses libxml if available, and falls back to
+`flycheck-parse-xml-region' otherwise.")
+
+(defun flycheck-parse-xml-string (xml)
+ "Parse an XML string.
+
+Return the document tree parsed from XML in the form `(ROOT ATTRS
+BODY...)'. ROOT is a symbol identifying the name of the root
+element. ATTRS is an alist of the attributes of the root node.
+BODY is zero or more body elements, either as strings (in case of
+text nodes) or as XML nodes, in the same for as the root node."
+ (with-temp-buffer
+ (insert xml)
+ (funcall flycheck-xml-parser (point-min) (point-max))))
+
+(defun flycheck-parse-checkstyle (output checker buffer)
+ "Parse Checkstyle errors from OUTPUT.
+
+Parse Checkstyle-like XML output. Use this error parser for
+checkers that have an option to output errors in this format.
+
+CHECKER and BUFFER denoted the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively.
+
+See URL `http://checkstyle.sourceforge.net/' for information
+about Checkstyle."
+ (pcase (flycheck-parse-xml-string output)
+ (`(checkstyle ,_ . ,file-nodes)
+ (let (errors)
+ (dolist (node file-nodes)
+ (pcase node
+ (`(file ,file-attrs . ,error-nodes)
+ (dolist (node error-nodes)
+ (pcase node
+ (`(error ,error-attrs . ,_)
+ (let-alist error-attrs
+ (push (flycheck-error-new-at
+ (flycheck-string-to-number-safe .line)
+ (flycheck-string-to-number-safe .column)
+ (pcase .severity
+ (`"error" 'error)
+ (`"warning" 'warning)
+ (`"info" 'info)
+ ;; Default to error for unknown .severity
+ (_ 'error))
+ .message
+ :checker checker :id .source
+ :buffer buffer
+ :filename (cdr (assq 'name file-attrs)))
+ errors))))))))
+ (nreverse errors)))))
+
+(defun flycheck-parse-cppcheck (output checker buffer)
+ "Parse Cppcheck errors from OUTPUT.
+
+Parse Cppcheck XML v2 output.
+
+CHECKER and BUFFER denoted the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively.
+
+See URL `http://cppcheck.sourceforge.net/' for more information
+about Cppcheck."
+ (pcase (flycheck-parse-xml-string output)
+ (`(results ,_ . ,body)
+ (let (errors)
+ (dolist (node body)
+ (pcase node
+ (`(errors ,_ . ,error-nodes)
+ (dolist (node error-nodes)
+ (pcase node
+ (`(error ,error-attrs . ,loc-nodes)
+ (let ((id (cdr (assq 'id error-attrs)))
+ (message (cdr (assq 'verbose error-attrs)))
+ (level (pcase (cdr (assq 'severity error-attrs))
+ (`"error" 'error)
+ (`"style" 'info)
+ (`"information" 'info)
+ (_ 'warning))))
+ (dolist (node loc-nodes)
+ (pcase node
+ (`(location ,loc-attrs . ,_)
+ (let-alist loc-attrs
+ (push (flycheck-error-new-at
+ (flycheck-string-to-number-safe .line)
+ nil
+ level
+ ;; cppcheck return newline characters as "\012"
+ (replace-regexp-in-string "\\\\012" "\n"
+ message)
+ :id id
+ :checker checker
+ :buffer buffer
+ :filename .file)
+ errors))))))))))))
+ (nreverse errors)))))
+
+(defun flycheck-parse-phpmd (output checker buffer)
+ "Parse phpmd errors from OUTPUT.
+
+CHECKER and BUFFER denoted the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively.
+
+See URL `http://phpmd.org/' for more information about phpmd."
+ (pcase (flycheck-parse-xml-string output)
+ (`(pmd ,_ . ,body)
+ (let (errors)
+ (dolist (node body)
+ (pcase node
+ (`(file ,file-attrs . ,violation-nodes)
+ (let ((filename (cdr (assq 'name file-attrs))))
+ (dolist (node violation-nodes)
+ (pcase node
+ (`(violation ,vio-attrs ,(and message (pred stringp)))
+ (let-alist vio-attrs
+ (push
+ (flycheck-error-new-at
+ (flycheck-string-to-number-safe .beginline)
+ nil
+ 'warning (string-trim message)
+ ;; Ignore .endline (phpmd marks giant spans as errors)
+ ;; :end-line (flycheck-string-to-number-safe .endline)
+ :id .rule
+ :checker checker
+ :buffer buffer
+ :filename filename)
+ errors)))))))))
+ (nreverse errors)))))
+
+(defun flycheck-parse-reek (output checker buffer)
+ "Parse Reek warnings from JSON OUTPUT.
+
+CHECKER and BUFFER denote the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively.
+
+See URL `https://github.com/troessner/reek' for more information
+about Reek."
+ (let ((errors nil))
+ (dolist (message (car (flycheck-parse-json output)))
+ (let-alist message
+ (dolist (line (delete-dups .lines))
+ (push
+ (flycheck-error-new-at
+ line
+ nil
+ 'warning (concat .context " " .message)
+ :id .smell_type
+ :checker checker
+ :buffer buffer
+ :filename .source)
+ errors))))
+ (nreverse errors)))
+
+(defun flycheck-parse-go-staticcheck (output checker buffer)
+ "Parse staticheck warnings from JSON OUTPUT.
+
+CHECKER and BUFFER denote the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively.
+
+See URL `https://staticcheck.io/docs/formatters' for more
+information about staticheck."
+ (let ((errors nil))
+ (dolist (msg (flycheck-parse-json output))
+ (let-alist msg
+ (push
+ (flycheck-error-new-at
+ .location.line
+ .location.column
+ (pcase .severity
+ (`"error" 'error)
+ (`"warning" 'warning)
+ (`"ignored" 'info)
+ ;; Default to warning for unknown .severity
+ (_ 'warning))
+ .message
+ :id .code
+ :checker checker
+ :buffer buffer
+ :filename .location.file)
+ errors)))
+ (nreverse errors)))
+
+(defun flycheck-parse-tslint (output checker buffer)
+ "Parse TSLint errors from JSON OUTPUT.
+
+CHECKER and BUFFER denoted the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively.
+
+See URL `https://palantir.github.io/tslint/' for more information
+about TSLint."
+ (seq-map (lambda (message)
+ (let-alist message
+ (flycheck-error-new-at
+ (+ 1 .startPosition.line)
+ (+ 1 .startPosition.character)
+ (pcase .ruleSeverity
+ ("ERROR" 'error)
+ ("WARNING" 'warning)
+ (_ 'warning))
+ .failure
+ :id .ruleName
+ :checker checker
+ :buffer buffer
+ :filename .name
+ :end-line (+ 1 .endPosition.line)
+ :end-column (+ 1 .endPosition.character))))
+ (car (flycheck-parse-json output))))
+
+(defun flycheck-parse-rust-collect-spans (span)
+ "Return a list of spans contained in a SPAN object."
+ (let ((spans))
+ (let-alist span
+ ;; With macro expansion errors, some spans will point to phony file names
+ ;; to indicate an error inside the std rust lib. We skip these spans as
+ ;; they won't appear in flycheck anyway.
+ (unless (string= .file_name "<std macros>")
+ (push span spans))
+
+ ;; Macro expansion errors will have a span in the 'expansion' field, so we
+ ;; recursively collect it.
+ (if .expansion.span
+ (append (flycheck-parse-rust-collect-spans .expansion.span)
+ spans)
+ spans))))
+
+(defun flycheck-parse-rustc-diagnostic (diagnostic checker buffer)
+ "Turn a rustc DIAGNOSTIC into a `flycheck-error'.
+
+CHECKER and BUFFER denote the CHECKER that returned DIAGNOSTIC
+and the BUFFER that was checked respectively.
+
+DIAGNOSTIC should be a parsed JSON object describing a rustc
+diagnostic, following the format described there:
+
+https://github.com/rust-lang/rust/blob/master/src/librustc_errors/json.rs#L154"
+ (let ((error-message)
+ (error-level)
+ (error-code)
+ (primary-filename)
+ (primary-line)
+ (primary-column)
+ (primary-end-line)
+ (primary-end-column)
+ (group (make-symbol "group"))
+ (spans)
+ (children)
+ (errors))
+ ;; The diagnostic format is described in the link above. The gist of it is
+ ;; that a diagnostic can have several causes in the source text; these
+ ;; causes are represented by spans. The diagnostic has a message and a
+ ;; level (error, warning), while the spans have a filename, line, column,
+ ;; and an optional label. The primary span points to the root cause of the
+ ;; error in the source text, while non-primary spans point to related
+ ;; causes. Spans may have an 'expansion' field for macro expansion errors;
+ ;; these expansion fields will contain another span (and so on). In
+ ;; addition, a diagnostic can also have children diagnostics that are used
+ ;; to provide additional information through their message field, but do not
+ ;; seem to contain any spans (yet).
+ ;;
+ ;; We first gather spans in order to turn every span into a flycheck error
+ ;; object, that we collect into the `errors' list.
+
+ ;; Nested `let-alist' cause compilation warnings, hence we `setq' all
+ ;; these values here first to avoid nesting.
+ (let-alist diagnostic
+ (setq error-message .message
+ error-level (pcase .level
+ (`"error" 'error)
+ (`"warning" 'warning)
+ (`"note" 'info)
+ (_ 'error))
+ ;; The 'code' field of the diagnostic contains the actual error
+ ;; code and an optional explanation that we ignore
+ error-code .code.code
+ ;; Collect all spans recursively
+ spans (seq-mapcat #'flycheck-parse-rust-collect-spans .spans)
+ children .children))
+
+ ;; Turn each span into a flycheck error
+ (dolist (span spans)
+ (let-alist span
+ ;; Children may not have filename/line/column information, so we use
+ ;; those from the primary span
+ (when .is_primary
+ (setq primary-filename .file_name
+ primary-line .line_start
+ primary-column .column_start
+ primary-end-line .line_end
+ primary-end-column .column_end))
+ (push
+ (flycheck-error-new-at
+ .line_start
+ .column_start
+ ;; Non-primary spans are used for notes
+ (if .is_primary error-level 'info)
+ (if .is_primary
+ ;; Primary spans may have labels with additional information
+ (concat error-message (when .label
+ (format " (%s)" .label)))
+ ;; If the label is empty, fallback on the error message,
+ ;; otherwise we won't be able to display anything
+ (or .label error-message))
+ :id error-code
+ :checker checker
+ :buffer buffer
+ :filename .file_name
+ :group group
+ :end-line .line_end
+ :end-column .column_end)
+ errors)))
+
+ ;; Then we turn children messages into flycheck errors pointing to the
+ ;; location of the primary span.
+ (dolist (child children)
+ (let ((message (let-alist child .message)))
+ (let-alist (car (let-alist child .spans))
+ (push
+ (flycheck-error-new-at
+ ;; Use the line/column from the first span if there is one, or
+ ;; fallback to the line/column information from the primary span of
+ ;; the diagnostic.
+ (or .line_start primary-line)
+ (or .column_start primary-column)
+ 'info
+ ;; Messages from `cargo clippy' may suggest replacement code. In
+ ;; these cases, the `message' field itself is an unhelpful `try' or
+ ;; `change this to'. We add the `suggested_replacement' field in
+ ;; these cases.
+ (if .suggested_replacement
+ (format "%s: `%s`" message .suggested_replacement)
+ message)
+ :id error-code
+ :checker checker
+ :buffer buffer
+ :filename primary-filename
+ :group group
+ :end-line (or .line_end primary-end-line)
+ :end-column (or .column_end primary-end-column))
+ errors))))
+
+ ;; If there are no spans, the error is not associated with a specific
+ ;; file but with the project as a whole. We still need to report it to
+ ;; the user by emitting a corresponding flycheck-error object.
+ ;; Check whether the code is non-nil because Rust≥1.44 includes the
+ ;; warning count upon completion.
+ (when (and error-code (not spans))
+ (push (flycheck-error-new-at
+ ;; We have no specific position to attach the error to, so
+ ;; let's use the top of the file.
+ 1 1
+ error-level
+ error-message
+ :id error-code
+ :checker checker
+ :buffer buffer
+ :group group)
+ errors))
+ (nreverse errors)))
+
+(defconst flycheck--json-parser
+ (if (and (functionp 'json-parse-buffer)
+ ;; json-parse-buffer only supports keyword arguments in Emacs 27+
+ (>= emacs-major-version 27))
+ (lambda ()
+ (json-parse-buffer
+ :object-type 'alist :array-type 'list
+ :null-object nil :false-object nil))
+ #'json-read)
+ "Function to use to parse JSON strings.")
+
+(defun flycheck-parse-json (output)
+ "Return parsed JSON data from OUTPUT.
+
+OUTPUT is a string that contains JSON data. Each line of OUTPUT
+may be either plain text, a JSON array (starting with `['), or a
+JSON object (starting with `{').
+
+This function ignores the plain text lines, parses the JSON
+lines, and returns the parsed JSON lines in a list."
+ (let ((objects nil)
+ (json-array-type 'list)
+ (json-false nil))
+ (with-temp-buffer
+ (insert output)
+ (goto-char (point-min))
+ (while (not (eobp))
+ (when (memq (char-after) '(?\{ ?\[))
+ (push (funcall flycheck--json-parser) objects))
+ (forward-line)))
+ (nreverse objects)))
+
+(defun flycheck-parse-rustc (output checker buffer)
+ "Parse rustc errors from OUTPUT and return a list of `flycheck-error'.
+
+CHECKER and BUFFER denote the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively.
+
+The expected format for OUTPUT is a mix of plain text lines and
+JSON lines. This function ignores the plain text lines and
+parses only JSON lines. Each JSON line is expected to be a JSON
+object that corresponds to a diagnostic from the compiler. The
+expected diagnostic format is described there:
+
+https://github.com/rust-lang/rust/blob/master/src/libsyntax/json.rs#L67-L139"
+ (seq-mapcat (lambda (msg)
+ (flycheck-parse-rustc-diagnostic msg checker buffer))
+ (flycheck-parse-json output)))
+
+(defun flycheck-parse-cargo-rustc (output checker buffer)
+ "Parse Cargo errors from OUTPUT and return a list of `flycheck-error'.
+
+CHECKER and BUFFER denote the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively.
+
+The expected format for OUTPUT is a mix of plain text lines and
+JSON lines. This function ignores the plain text lines and
+parses only JSON lines. Each JSON line is expected to be a JSON
+object that represents a message from Cargo. The format of
+messages emitted by Cargo is described in cargo's
+machine_message.rs at URL `https://git.io/vh24R'."
+ (let ((errors))
+ (dolist (msg (flycheck-parse-json output))
+ (let-alist msg
+ ;; Errors and warnings from rustc are wrapped by cargo, so we filter and
+ ;; unwrap them, and delegate the actual construction of `flycheck-error'
+ ;; objects to `flycheck-parse-rustc-diagnostic'.
+ ;; We put the error record with nil code since flycheck regards
+ ;; the case of nonzero return code without any error report
+ ;; as abnormal result.
+ (when (string= .reason "compiler-message")
+ (push (flycheck-parse-rustc-diagnostic .message checker buffer)
+ errors))))
+ (apply #'nconc errors)))
+
+;; Some checkers output ANSI terminal colors, which don't match up
+;; with :error-patterns, so we strip those color codes from the output
+;; here before passing it along to the default behavior. This is
+;; originally only used in the rebar3 checker, but the systemd checker
+;; now also makes use of it.
+;;
+;; The relevant discussion can be found at
+;; https://github.com/flycheck/flycheck/pull/1144
+(defun flycheck-parse-with-patterns-without-color (output checker buffer)
+ "Strip color codes from OUTPUT before passing it to the default behavior.
+
+CHECKER and BUFFER are passed along as well."
+ (flycheck-parse-with-patterns
+ (and (fboundp 'ansi-color-filter-apply) (ansi-color-filter-apply output))
+ checker buffer))
+
+
+;;; Error parsing with regular expressions
+(defun flycheck-get-regexp (patterns)
+ "Create a single regular expression from PATTERNS."
+ (rx-to-string `(or ,@(seq-map (lambda (p) (list 'regexp (car p))) patterns))
+ 'no-group))
+
+(defun flycheck-tokenize-output-with-patterns (output patterns)
+ "Tokenize OUTPUT with PATTERNS.
+
+Split the output into error tokens, using all regular expressions
+from the error PATTERNS. An error token is simply a string
+containing a single error from OUTPUT. Such a token can then be
+parsed into a structured error by applying the PATTERNS again,
+see `flycheck-parse-errors-with-patterns'.
+
+Return a list of error tokens."
+ (let ((regexp (flycheck-get-regexp patterns))
+ (last-match 0)
+ errors)
+ (while (string-match regexp output last-match)
+ (push (match-string 0 output) errors)
+ (setq last-match (match-end 0)))
+ (reverse errors)))
+
+(defun flycheck-try-parse-error-with-pattern (err pattern checker)
+ "Try to parse a single ERR with a PATTERN for CHECKER.
+
+Return the parsed error if PATTERN matched ERR, or nil
+otherwise.
+
+`end-line' defaults to the value of `line' when `end-column' is
+set, since checkers often omit redundant end lines (as in
+<file>:<line>:<column>-<end-column>)."
+ (let ((regexp (car pattern))
+ (level (cdr pattern)))
+ (when (string-match regexp err)
+ (let ((filename (match-string 1 err))
+ (line (flycheck-string-to-number-safe (match-string 2 err)))
+ (column (flycheck-string-to-number-safe (match-string 3 err)))
+ (message (match-string 4 err))
+ (id (match-string 5 err))
+ (end-line (flycheck-string-to-number-safe (match-string 6 err)))
+ (end-column (flycheck-string-to-number-safe (match-string 7 err))))
+ (flycheck-error-new-at
+ line
+ column
+ level
+ (unless (string-empty-p message) message)
+ :id (unless (string-empty-p id) id)
+ :checker checker
+ :filename (if (or (null filename) (string-empty-p filename))
+ (buffer-file-name)
+ filename)
+ :end-line (or end-line (and end-column line))
+ :end-column end-column)))))
+
+(defun flycheck-parse-error-with-patterns (err patterns checker)
+ "Parse a single ERR with error PATTERNS for CHECKER.
+
+Apply each pattern in PATTERNS to ERR, in the given order, and
+return the first parsed error."
+ ;; Try to parse patterns in the order of declaration to make sure that the
+ ;; first match wins.
+ (let (parsed-error)
+ (while (and patterns
+ (not (setq parsed-error
+ (flycheck-try-parse-error-with-pattern
+ err (car patterns) checker))))
+ (setq patterns (cdr patterns)))
+ parsed-error))
+
+(defun flycheck-parse-with-patterns (output checker buffer)
+ "Parse OUTPUT from CHECKER with error patterns.
+
+Uses the error patterns of CHECKER to tokenize the output and
+tries to parse each error token with all patterns, in the order
+of declaration. Hence an error is never matched twice by two
+different patterns. The pattern declared first always wins.
+
+_BUFFER is ignored.
+
+Return a list of parsed errors and warnings (as `flycheck-error'
+objects)."
+ (with-current-buffer buffer
+ (let ((patterns (flycheck-checker-get checker 'error-patterns)))
+ (seq-map (lambda (err)
+ (flycheck-parse-error-with-patterns err patterns checker))
+ (flycheck-tokenize-output-with-patterns output patterns)))))
+
+
+;;; Convenience definition of command-syntax checkers
+
+;; This macro is autoloaded to prevent `with-eval-after-load' from expanding its
+;; arguments. See https://github.com/flycheck/flycheck/issues/1398.
+;;;###autoload
+(defmacro flycheck-define-checker (symbol docstring &rest properties)
+ "Define SYMBOL as command syntax checker with DOCSTRING and PROPERTIES.
+
+Like `flycheck-define-command-checker', but PROPERTIES must not
+be quoted. Also, implicitly define the executable variable for
+SYMBOL with `flycheck-def-executable-var'."
+ (declare (indent 1)
+ (doc-string 2))
+ (let ((command (plist-get properties :command))
+ (parser (plist-get properties :error-parser))
+ (filter (plist-get properties :error-filter))
+ (explainer (plist-get properties :error-explainer))
+ (predicate (plist-get properties :predicate))
+ (enabled-fn (plist-get properties :enabled))
+ (verify-fn (plist-get properties :verify)))
+
+ `(progn
+ (flycheck-def-executable-var ,symbol ,(car command))
+
+ (flycheck-define-command-checker ',symbol
+ ,docstring
+ :command ',command
+ ,@(when parser
+ `(:error-parser #',parser))
+ :error-patterns ',(plist-get properties :error-patterns)
+ ,@(when filter
+ `(:error-filter #',filter))
+ ,@(when explainer
+ `(:error-explainer #',explainer))
+ :modes ',(plist-get properties :modes)
+ ,@(when predicate
+ `(:predicate #',predicate))
+ :next-checkers ',(plist-get properties :next-checkers)
+ ,@(when enabled-fn
+ `(:enabled #',enabled-fn))
+ ,@(when verify-fn
+ `(:verify #',verify-fn))
+ :standard-input ',(plist-get properties :standard-input)
+ :working-directory ',(plist-get properties :working-directory)))))
+
+
+;;; Built-in checkers
+(flycheck-def-args-var flycheck-gnat-args ada-gnat
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-def-option-var flycheck-gnat-include-path nil ada-gnat
+ "A list of include directories for GNAT.
+
+The value of this variable is a list of strings, where each
+string is a directory to add to the include path of gcc.
+Relative paths are relative to the file being checked."
+ :type '(repeat (directory :tag "Include directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-def-option-var flycheck-gnat-language-standard "2012" ada-gnat
+ "The language standard to use in GNAT.
+
+The value of this variable is either a string denoting a language
+standard, or nil, to use the default standard. When non-nil, pass
+the language standard via the `-std' option."
+ :type '(choice (const :tag "Default standard" nil)
+ (string :tag "Language standard"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-def-option-var flycheck-gnat-warnings
+ '("wa") ada-gnat
+ "A list of additional Ada warnings to enable in GNAT.
+
+The value of this variable is a list of strings, where each
+string is the name of a warning category to enable. By default,
+most optional warnings are recommended, as in `-gnata'.
+
+Refer to Info Node `(gnat_ugn_unw)Warning Message Control' for
+more information about GNAT warnings."
+ :type '(repeat :tag "Warnings" (string :tag "Warning name"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-define-checker ada-gnat
+ "An Ada syntax checker using GNAT.
+
+Uses the GNAT compiler from GCC. See URL
+`https://www.adacore.com/community/'."
+ :command ("gnatmake"
+ "-c" ; Just compile, don't bind
+ "-f" ; Force re-compilation
+ "-u" ; Compile the main file only
+ "-gnatf" ; Full error information
+ "-gnatef" ; Full source file name
+ "-D" temporary-directory
+ (option-list "-gnat" flycheck-gnat-warnings concat)
+ (option-list "-I" flycheck-gnat-include-path concat)
+ (option "-gnat" flycheck-gnat-language-standard concat)
+ (eval flycheck-gnat-args)
+ source)
+ :error-patterns
+ ((error line-start
+ (message "In file included from") " " (file-name) ":" line ":"
+ column ":"
+ line-end)
+ (info line-start (file-name) ":" line ":" column
+ ": note: " (message) line-end)
+ (warning line-start (file-name) ":" line ":" column
+ ": warning: " (message) line-end)
+ ;; no specific error prefix in Ada
+ (error line-start (file-name) ":" line ":" column
+ ": " (message) line-end))
+ :modes ada-mode)
+
+(flycheck-define-checker asciidoc
+ "A AsciiDoc syntax checker using the AsciiDoc compiler.
+
+See URL `http://www.methods.co.nz/asciidoc'."
+ :command ("asciidoc" "-o" null-device "-")
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ "asciidoc: ERROR: <stdin>: Line " line ": " (message)
+ line-end)
+ (warning line-start
+ "asciidoc: WARNING: <stdin>: Line " line ": " (message)
+ line-end)
+ (info line-start
+ "asciidoc: DEPRECATED: <stdin>: Line " line ": " (message)
+ line-end))
+ :modes adoc-mode)
+
+(flycheck-define-checker asciidoctor
+ "An AsciiDoc syntax checker using the Asciidoctor compiler.
+
+See URL `http://asciidoctor.org'."
+ :command ("asciidoctor" "-o" null-device "-")
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ "asciidoctor: ERROR: <stdin>: Line " line ": " (message)
+ line-end)
+ (warning line-start
+ "asciidoctor: WARNING: <stdin>: Line " line ": " (message)
+ line-end))
+ :modes adoc-mode)
+
+(defun flycheck-awk-gawk-fix-message (err)
+ "Remove the repeated file-name/line from the error message of ERR."
+ (setf (flycheck-error-message err)
+ (replace-regexp-in-string
+ (rx line-start
+ (group (zero-or-more (any " " "\t")))
+ (group (zero-or-more nonl) "\n")
+ (backref 1))
+ "\\2"
+ (replace-regexp-in-string
+ (rx "\ngawk: " (zero-or-more (not (any " "))) ":")
+ "\n"
+ (flycheck-error-message err))))
+ err)
+
+(defun flycheck-awk-gawk-error-filter (errors)
+ "Remove repeated file-name/line from ERRORS."
+ (seq-do #'flycheck-awk-gawk-fix-message errors)
+ errors)
+
+(flycheck-define-checker awk-gawk
+ "GNU awk's built-in --lint checker."
+ :command ("gawk"
+ ;; Avoid code execution. See https://github.com/w0rp/ale/pull/1411
+ "--source" "'BEGIN{exit} END{exit 1}'"
+ "-f" source
+ "--lint"
+ "/dev/null")
+ :standard-input nil
+ :error-patterns
+ ((warning line-start
+ "gawk: "
+ (file-name) ":" line ":" (optional column ":")
+ (message (one-or-more not-newline)
+ (optional "\n"
+ (one-or-more not-newline)
+ " ^ "
+ (one-or-more not-newline)))
+ line-end))
+ :error-filter flycheck-awk-gawk-error-filter
+ :modes awk-mode)
+
+(flycheck-define-checker bazel-buildifier
+ "An Bazel checker using the buildifier.
+
+See URL `https://github.com/bazelbuild/buildtools/blob/master/buildifier'."
+ :command ("buildifier" "-lint=warn")
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ "<stdin>:" line ":" column ": " (message)
+ line-end)
+ (warning line-start
+ "<stdin>:" line ": " (id (one-or-more (in word "-"))) ": " (message)
+ line-end))
+ :modes bazel-mode)
+
+(flycheck-def-args-var flycheck-clang-args c/c++-clang
+ :package-version '(flycheck . "0.22"))
+
+(flycheck-def-option-var flycheck-clang-blocks nil c/c++-clang
+ "Enable blocks in Clang.
+
+When non-nil, enable blocks in Clang with `-fblocks'. See URL
+`http://clang.llvm.org/docs/BlockLanguageSpec.html' for more
+information about blocks."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-def-option-var flycheck-clang-definitions nil c/c++-clang
+ "Additional preprocessor definitions for Clang.
+
+The value of this variable is a list of strings, where each
+string is an additional definition to pass to Clang, via the `-D'
+option."
+ :type '(repeat (string :tag "Definition"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.15"))
+
+(flycheck-def-option-var flycheck-clang-include-path nil c/c++-clang
+ "A list of include directories for Clang.
+
+The value of this variable is a list of strings, where each
+string is a directory to add to the include path of Clang.
+Relative paths are relative to the file being checked."
+ :type '(repeat (directory :tag "Include directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.14"))
+
+(flycheck-def-option-var flycheck-clang-includes nil c/c++-clang
+ "A list of additional include files for Clang.
+
+The value of this variable is a list of strings, where each
+string is a file to include before syntax checking. Relative
+paths are relative to the file being checked."
+ :type '(repeat (file :tag "Include file"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.15"))
+
+(flycheck-def-option-var flycheck-clang-language-standard nil c/c++-clang
+ "The language standard to use in Clang.
+
+The value of this variable is either a string denoting a language
+standard, or nil, to use the default standard. When non-nil,
+pass the language standard via the `-std' option."
+ :type '(choice (const :tag "Default standard" nil)
+ (string :tag "Language standard"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "0.15"))
+(make-variable-buffer-local 'flycheck-clang-language-standard)
+
+(flycheck-def-option-var flycheck-clang-ms-extensions nil c/c++-clang
+ "Whether to enable Microsoft extensions to C/C++ in Clang.
+
+When non-nil, enable Microsoft extensions to C/C++ via
+`-fms-extensions'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.16"))
+
+(flycheck-def-option-var flycheck-clang-no-exceptions nil c/c++-clang
+ "Whether to disable exceptions in Clang.
+
+When non-nil, disable exceptions for syntax checks, via
+`-fno-exceptions'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-def-option-var flycheck-clang-no-rtti nil c/c++-clang
+ "Whether to disable RTTI in Clang.
+
+When non-nil, disable RTTI for syntax checks, via `-fno-rtti'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.15"))
+
+(flycheck-def-option-var flycheck-clang-pedantic nil c/c++-clang
+ "Whether to warn about language extensions in Clang.
+
+For ISO C, follows the version specified by any -std option used.
+When non-nil, disable non-ISO extensions to C/C++ via
+`-pedantic'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.23"))
+
+(flycheck-def-option-var flycheck-clang-pedantic-errors nil c/c++-clang
+ "Whether to error on language extensions in Clang.
+
+For ISO C, follows the version specified by any -std option used.
+When non-nil, disable non-ISO extensions to C/C++ via
+`-pedantic-errors'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.23"))
+
+(flycheck-def-option-var flycheck-clang-standard-library nil c/c++-clang
+ "The standard library to use for Clang.
+
+The value of this variable is the name of a standard library as
+string, or nil to use the default standard library.
+
+Refer to the Clang manual at URL
+`http://clang.llvm.org/docs/UsersManual.html' for more
+information about the standard library."
+ :type '(choice (const :tag "Default standard library" nil)
+ (const "libc++")
+ (const :tag "GNU libstdc++" "libstdc++")
+ (string :tag "Library name"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "0.15"))
+
+(flycheck-def-option-var flycheck-clang-warnings '("all" "extra") c/c++-clang
+ "A list of additional warnings to enable in Clang.
+
+The value of this variable is a list of strings, where each string
+is the name of a warning category to enable. By default, all
+recommended warnings and some extra warnings are enabled (as by
+`-Wall' and `-Wextra' respectively).
+
+Refer to the Clang manual at URL
+`http://clang.llvm.org/docs/UsersManual.html' for more
+information about warnings."
+ :type '(choice (const :tag "No additional warnings" nil)
+ (repeat :tag "Additional warnings"
+ (string :tag "Warning name")))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.14"))
+
+(defun flycheck-c/c++-quoted-include-directory ()
+ "Get the directory for quoted includes.
+
+C/C++ compilers typically look up includes with quotation marks
+in the directory of the file being compiled. However, since
+Flycheck uses temporary copies for syntax checking, it needs to
+explicitly determine the directory for quoted includes.
+
+This function determines the directory by looking at function
+`buffer-file-name', or if that is nil, at `default-directory'."
+ (-if-let (fn (buffer-file-name))
+ (file-name-directory fn)
+ ;; If the buffer has no file name, fall back to its default directory
+ default-directory))
+
+(flycheck-define-checker c/c++-clang
+ "A C/C++ syntax checker using Clang.
+
+See URL `http://clang.llvm.org/'."
+ :command ("clang"
+ "-fsyntax-only"
+ "-fno-color-diagnostics" ; Do not include color codes in output
+ "-fno-caret-diagnostics" ; Do not visually indicate the source
+ ; location
+ "-fno-diagnostics-show-option" ; Do not show the corresponding
+ ; warning group
+ "-iquote" (eval (flycheck-c/c++-quoted-include-directory))
+ (option "-std=" flycheck-clang-language-standard concat)
+ (option-flag "-pedantic" flycheck-clang-pedantic)
+ (option-flag "-pedantic-errors" flycheck-clang-pedantic-errors)
+ (option "-stdlib=" flycheck-clang-standard-library concat)
+ (option-flag "-fms-extensions" flycheck-clang-ms-extensions)
+ (option-flag "-fno-exceptions" flycheck-clang-no-exceptions)
+ (option-flag "-fno-rtti" flycheck-clang-no-rtti)
+ (option-flag "-fblocks" flycheck-clang-blocks)
+ (option-list "-include" flycheck-clang-includes)
+ (option-list "-W" flycheck-clang-warnings concat)
+ (option-list "-D" flycheck-clang-definitions concat)
+ (option-list "-I" flycheck-clang-include-path)
+ (eval flycheck-clang-args)
+ "-x" (eval
+ (pcase major-mode
+ (`c++-mode "c++")
+ (`c-mode "c")))
+ ;; Read from standard input
+ "-")
+ :standard-input t
+ :error-patterns
+ ((info line-start (or "<stdin>" (file-name)) ":" line ":" column
+ ": note: " (optional (message)) line-end)
+ (warning line-start (or "<stdin>" (file-name)) ":" line ":" column
+ ": warning: " (optional (message)) line-end)
+ (error line-start (or "<stdin>" (file-name)) ":" line ":" column
+ ": " (or "fatal error" "error") ": " (optional (message)) line-end))
+ :error-filter
+ (lambda (errors)
+ (let ((errors (flycheck-sanitize-errors errors)))
+ (dolist (err errors)
+ ;; Clang will output empty messages for #error/#warning pragmas without
+ ;; messages. We fill these empty errors with a dummy message to get
+ ;; them past our error filtering
+ (setf (flycheck-error-message err)
+ (or (flycheck-error-message err) "no message")))
+ errors))
+ :modes (c-mode c++-mode)
+ :next-checkers ((warning . c/c++-cppcheck)))
+
+(flycheck-def-args-var flycheck-gcc-args c/c++-gcc
+ :package-version '(flycheck . "0.22"))
+
+(flycheck-def-option-var flycheck-gcc-definitions nil c/c++-gcc
+ "Additional preprocessor definitions for GCC.
+
+The value of this variable is a list of strings, where each
+string is an additional definition to pass to GCC, via the `-D'
+option."
+ :type '(repeat (string :tag "Definition"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-def-option-var flycheck-gcc-include-path nil c/c++-gcc
+ "A list of include directories for GCC.
+
+The value of this variable is a list of strings, where each
+string is a directory to add to the include path of gcc.
+Relative paths are relative to the file being checked."
+ :type '(repeat (directory :tag "Include directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-def-option-var flycheck-gcc-includes nil c/c++-gcc
+ "A list of additional include files for GCC.
+
+The value of this variable is a list of strings, where each
+string is a file to include before syntax checking. Relative
+paths are relative to the file being checked."
+ :type '(repeat (file :tag "Include file"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-def-option-var flycheck-gcc-language-standard nil c/c++-gcc
+ "The language standard to use in GCC.
+
+The value of this variable is either a string denoting a language
+standard, or nil, to use the default standard. When non-nil,
+pass the language standard via the `-std' option."
+ :type '(choice (const :tag "Default standard" nil)
+ (string :tag "Language standard"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "0.20"))
+(make-variable-buffer-local 'flycheck-gcc-language-standard)
+
+(flycheck-def-option-var flycheck-gcc-no-exceptions nil c/c++-gcc
+ "Whether to disable exceptions in GCC.
+
+When non-nil, disable exceptions for syntax checks, via
+`-fno-exceptions'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-def-option-var flycheck-gcc-no-rtti nil c/c++-gcc
+ "Whether to disable RTTI in GCC.
+
+When non-nil, disable RTTI for syntax checks, via `-fno-rtti'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-def-option-var flycheck-gcc-openmp nil c/c++-gcc
+ "Whether to enable OpenMP in GCC.
+
+When non-nil, enable OpenMP for syntax checkers, via
+`-fopenmp'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.21"))
+
+(flycheck-def-option-var flycheck-gcc-pedantic nil c/c++-gcc
+ "Whether to warn about language extensions in GCC.
+
+For ISO C, follows the version specified by any -std option used.
+When non-nil, disable non-ISO extensions to C/C++ via
+`-pedantic'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.23"))
+
+(flycheck-def-option-var flycheck-gcc-pedantic-errors nil c/c++-gcc
+ "Whether to error on language extensions in GCC.
+
+For ISO C, follows the version specified by any -std option used.
+When non-nil, disable non-ISO extensions to C/C++ via
+`-pedantic-errors'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.23"))
+
+(flycheck-def-option-var flycheck-gcc-warnings '("all" "extra") c/c++-gcc
+ "A list of additional warnings to enable in GCC.
+
+The value of this variable is a list of strings, where each string
+is the name of a warning category to enable. By default, all
+recommended warnings and some extra warnings are enabled (as by
+`-Wall' and `-Wextra' respectively).
+
+Refer to the gcc manual at URL
+`https://gcc.gnu.org/onlinedocs/gcc/' for more information about
+warnings."
+ :type '(choice (const :tag "No additional warnings" nil)
+ (repeat :tag "Additional warnings"
+ (string :tag "Warning name")))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-define-checker c/c++-gcc
+ "A C/C++ syntax checker using GCC.
+
+Requires GCC 4.4 or newer. See URL `https://gcc.gnu.org/'."
+ :command ("gcc"
+ "-fshow-column"
+ "-iquote" (eval (flycheck-c/c++-quoted-include-directory))
+ (option "-std=" flycheck-gcc-language-standard concat)
+ (option-flag "-pedantic" flycheck-gcc-pedantic)
+ (option-flag "-pedantic-errors" flycheck-gcc-pedantic-errors)
+ (option-flag "-fno-exceptions" flycheck-gcc-no-exceptions)
+ (option-flag "-fno-rtti" flycheck-gcc-no-rtti)
+ (option-flag "-fopenmp" flycheck-gcc-openmp)
+ (option-list "-include" flycheck-gcc-includes)
+ (option-list "-W" flycheck-gcc-warnings concat)
+ (option-list "-D" flycheck-gcc-definitions concat)
+ (option-list "-I" flycheck-gcc-include-path)
+ (eval flycheck-gcc-args)
+ "-x" (eval
+ (pcase major-mode
+ (`c++-mode "c++")
+ (`c-mode "c")))
+ ;; GCC performs full checking only when actually compiling, so
+ ;; `-fsyntax-only' is not enough. Just let it generate assembly
+ ;; code.
+ "-S" "-o" null-device
+ ;; Read from standard input
+ "-")
+ :standard-input t
+ :error-patterns
+ ((info line-start (or "<stdin>" (file-name))
+ ":" line (optional ":" column)
+ ": note: " (message) line-end)
+ (warning line-start (or "<stdin>" (file-name))
+ ":" line (optional ":" column)
+ ": warning: " (message (one-or-more (not (any "\n["))))
+ (optional "[" (id (one-or-more not-newline)) "]") line-end)
+ (error line-start (or "<stdin>" (file-name))
+ ":" line (optional ":" column)
+ ": " (or "fatal error" "error") ": " (message) line-end))
+ :modes (c-mode c++-mode)
+ :next-checkers ((warning . c/c++-cppcheck)))
+
+(flycheck-def-option-var flycheck-cppcheck-checks '("style") c/c++-cppcheck
+ "Enabled checks for Cppcheck.
+
+The value of this variable is a list of strings, where each
+string is the name of an additional check to enable. By default,
+all coding style checks are enabled.
+
+See section \"Enable message\" in the Cppcheck manual at URL
+`http://cppcheck.sourceforge.net/manual.pdf', and the
+documentation of the `--enable' option for more information,
+including a list of supported checks."
+ :type '(repeat :tag "Additional checks"
+ (string :tag "Check name"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.14"))
+
+(flycheck-def-option-var flycheck-cppcheck-standards nil c/c++-cppcheck
+ "The standards to use in cppcheck.
+
+The value of this variable is either a list of strings denoting
+the standards to use, or nil to pass nothing to cppcheck. When
+non-nil, pass the standards via one or more `--std=' options."
+ :type '(choice (const :tag "Default" nil)
+ (repeat :tag "Custom standards"
+ (string :tag "Standard name")))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "28"))
+(make-variable-buffer-local 'flycheck-cppcheck-standards)
+
+(flycheck-def-option-var flycheck-cppcheck-suppressions-file nil c/c++-cppcheck
+ "The suppressions file to use in cppcheck.
+
+The value of this variable is a file with the suppressions to
+use, or nil to pass nothing to cppcheck. When non-nil, pass the
+suppressions file via the `--suppressions-list=' option."
+ :type '(choice (const :tag "Default" nil)
+ (file :tag "Suppressions file"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "32"))
+(make-variable-buffer-local 'flycheck-cppcheck-suppressions-file)
+
+(flycheck-def-option-var flycheck-cppcheck-suppressions nil c/c++-cppcheck
+ "The suppressions to use in cppcheck.
+
+The value of this variable is either a list of strings denoting
+the suppressions to use, or nil to pass nothing to cppcheck.
+When non-nil, pass the suppressions via one or more `--suppress='
+options."
+ :type '(choice (const :tag "Default" nil)
+ (repeat :tag "Additional suppressions"
+ (string :tag "Suppression")))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "28"))
+
+(flycheck-def-option-var flycheck-cppcheck-inconclusive nil c/c++-cppcheck
+ "Whether to enable Cppcheck inconclusive checks.
+
+When non-nil, enable Cppcheck inconclusive checks. This allows Cppcheck to
+report warnings it's not certain of, but it may result in false positives.
+
+This will have no effect when using Cppcheck 1.53 and older."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.19"))
+
+(flycheck-def-option-var flycheck-cppcheck-include-path nil c/c++-cppcheck
+ "A list of include directories for cppcheck.
+
+The value of this variable is a list of strings, where each
+string is a directory to add to the include path of cppcheck.
+Relative paths are relative to the file being checked."
+ :type '(repeat (directory :tag "Include directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.24"))
+
+(flycheck-define-checker c/c++-cppcheck
+ "A C/C++ checker using cppcheck.
+
+See URL `http://cppcheck.sourceforge.net/'."
+ :command ("cppcheck" "--quiet" "--xml-version=2" "--inline-suppr"
+ (option "--enable=" flycheck-cppcheck-checks concat
+ flycheck-option-comma-separated-list)
+ (option-flag "--inconclusive" flycheck-cppcheck-inconclusive)
+ (option-list "-I" flycheck-cppcheck-include-path)
+ (option-list "--std=" flycheck-cppcheck-standards concat)
+ (option-list "--suppress=" flycheck-cppcheck-suppressions concat)
+ (option "--suppressions-list="
+ flycheck-cppcheck-suppressions-file concat)
+ "-x" (eval
+ (pcase major-mode
+ (`c++-mode "c++")
+ (`c-mode "c")))
+ source)
+ :error-parser flycheck-parse-cppcheck
+ :modes (c-mode c++-mode))
+
+(flycheck-define-checker cfengine
+ "A CFEngine syntax checker using cf-promises.
+
+See URL `https://cfengine.com/'."
+ :command ("cf-promises" "-Wall" "-f"
+ ;; We must stay in the same directory to resolve @include
+ source-inplace)
+ :error-patterns
+ ((warning line-start (file-name) ":" line ":" column
+ ": warning: " (message) line-end)
+ (error line-start (file-name) ":" line ":" column
+ ": error: " (message) line-end))
+ :modes (cfengine-mode cfengine3-mode))
+
+(flycheck-def-option-var flycheck-foodcritic-tags nil chef-foodcritic
+ "A list of tags to select for Foodcritic.
+
+The value of this variable is a list of strings where each string
+is a tag expression describing Foodcritic rules to enable or
+disable, via the `--tags' option. To disable a tag, prefix it
+with `~'."
+ :type '(repeat :tag "Tags" (string :tag "Tag expression"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.23"))
+
+(flycheck-define-checker chef-foodcritic
+ "A Chef cookbooks syntax checker using Foodcritic.
+
+See URL `http://www.foodcritic.io'."
+ ;; Use `source-inplace' to allow resource discovery with relative paths.
+ ;; foodcritic interprets these as relative to the source file, so we need to
+ ;; stay within the source tree. See
+ ;; https://github.com/flycheck/flycheck/pull/556
+ :command ("foodcritic"
+ (option-list "--tags" flycheck-foodcritic-tags)
+ source-inplace)
+ :error-patterns
+ ((error line-start (id (one-or-more alnum)) ": "
+ (message) ": " (file-name) ":" line line-end))
+ :modes (enh-ruby-mode ruby-mode)
+ :predicate
+ (lambda ()
+ (let ((parent-dir (file-name-directory
+ (directory-file-name
+ (expand-file-name default-directory)))))
+ (or
+ ;; Chef CookBook
+ ;; http://docs.opscode.com/chef/knife.html#id38
+ (locate-dominating-file parent-dir "recipes")
+ ;; Knife Solo
+ ;; http://matschaffer.github.io/knife-solo/#label-Init+command
+ (locate-dominating-file parent-dir "cookbooks")))))
+
+(flycheck-define-checker coffee
+ "A CoffeeScript syntax checker using coffee.
+
+See URL `https://coffeescript.org/'."
+ ;; --print suppresses generation of compiled .js files
+ :command ("coffee" "--compile" "--print" "--stdio")
+ :standard-input t
+ :error-patterns
+ ((error line-start "[stdin]:" line ":" column
+ ": error: " (message) line-end))
+ :modes coffee-mode
+ :next-checkers ((warning . coffee-coffeelint)))
+
+(flycheck-def-config-file-var flycheck-coffeelintrc coffee-coffeelint
+ ".coffeelint.json")
+
+(flycheck-define-checker coffee-coffeelint
+ "A CoffeeScript style checker using coffeelint.
+
+See URL `http://www.coffeelint.org/'."
+ :command
+ ("coffeelint"
+ (config-file "--file" flycheck-coffeelintrc)
+ "--stdin" "--reporter" "checkstyle")
+ :standard-input t
+ :error-parser flycheck-parse-checkstyle
+ :error-filter (lambda (errors)
+ (flycheck-remove-error-file-names
+ "stdin" (flycheck-remove-error-ids
+ (flycheck-sanitize-errors errors))))
+ :modes coffee-mode)
+
+(defun flycheck-coq-error-filter (errors)
+ "Sanitize Coq ERRORS and compute end-lines and end-columns."
+ (flycheck-increment-error-columns errors)
+ (dolist (err errors)
+ (setf (flycheck-error-message err)
+ (replace-regexp-in-string (rx (1+ (syntax whitespace)) line-end)
+ "" (flycheck-error-message err)
+ 'fixedcase 'literal))
+ (-when-let* ((end-col (flycheck-error-end-column err)))
+ ;; Coq reports an offset (potentially past eol), not an end column
+ (let* ((line (flycheck-error-line err))
+ (end-lc (save-excursion
+ (flycheck-goto-line line)
+ (goto-char (+ (point) (1- end-col)))
+ (flycheck-line-column-at-point))))
+ (setf (flycheck-error-end-line err) (car end-lc))
+ (setf (flycheck-error-end-column err) (cdr end-lc)))))
+ (flycheck-sanitize-errors errors))
+
+(flycheck-define-checker coq
+ "A Coq syntax checker using the Coq compiler.
+
+See URL `https://coq.inria.fr/'."
+ ;; We use coqtop in batch mode, because coqc is picky about file names.
+ :command ("coqtop" "-batch" "-load-vernac-source" source)
+ :error-patterns
+ ((error line-start "File \"" (file-name) "\", line " line
+ ", characters " column "-" end-column ":\n"
+ (or "Syntax error:" "Error:")
+ ;; Most Coq error messages span multiple lines, and end with a dot.
+ ;; There are simple one-line messages, too, though.
+ (message (or (and (one-or-more (or not-newline "\n")) ".")
+ (one-or-more not-newline)))
+ line-end))
+ :error-filter flycheck-coq-error-filter
+ :modes coq-mode)
+
+(flycheck-define-checker css-csslint
+ "A CSS syntax and style checker using csslint.
+
+See URL `https://github.com/CSSLint/csslint'."
+ :command ("csslint" "--format=checkstyle-xml" source)
+ :error-parser flycheck-parse-checkstyle
+ :error-filter flycheck-dequalify-error-ids
+ :modes css-mode)
+
+(defconst flycheck-stylelint-args '("--formatter" "json")
+ "Common arguments to stylelint invocations.")
+
+(flycheck-def-config-file-var flycheck-stylelintrc
+ (css-stylelint scss-stylelint less-stylelint) nil)
+
+(flycheck-def-option-var flycheck-stylelint-quiet
+ nil (css-stylelint scss-stylelint less-stylelint)
+ "Whether to run stylelint in quiet mode.
+
+When non-nil, enable quiet mode, via `--quiet'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . 26))
+
+(defconst flycheck-stylelint-error-re
+ (flycheck-rx-to-string
+ '(: line-start (id (one-or-more word)) ": " (message) line-end)))
+
+(defun flycheck-parse-stylelint (output checker buffer)
+ "Parse stylelint errors from OUTPUT.
+
+CHECKER and BUFFER denoted the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively.
+
+The CHECKER usually returns the errors as JSON.
+
+If the CHECKER throws an Error it returns an Error message with a stacktrace."
+ (condition-case nil
+ (flycheck-parse-stylelint-json output checker buffer)
+
+ ;; The output could not be parsed as JSON
+ (json-error
+
+ ;; Extract a flycheck error from the output (with a regular expression)
+ ;; For match-string 4/5 see flycheck-rx-message/flycheck-rx-id
+ (when (string-match flycheck-stylelint-error-re output)
+ (list (flycheck-error-new-at
+ 1 nil 'error
+ (match-string 4 output)
+ :id (match-string 5 output)
+ :checker checker
+ :buffer buffer
+ :filename (buffer-file-name buffer)))))))
+
+(defun flycheck-parse-stylelint-json (output checker buffer)
+ "Parse stylelint JSON errors from OUTPUT.
+
+CHECKER and BUFFER denoted the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively.
+
+See URL `http://stylelint.io/developer-guide/formatters/' for information
+about the JSON format of stylelint."
+ (let ((json-object-type 'plist))
+
+ ;; stylelint returns a vector of result objects
+ ;; Since we only passed one file, the first element is enough
+ (let* ((stylelint-output (elt (json-read-from-string output) 0))
+ (filename (buffer-file-name buffer))
+
+ ;; Turn all deprecations into warnings
+ (deprecations
+ (mapcar (lambda (d)
+ (flycheck-error-new-at
+ 1 nil 'warning
+ (plist-get d :text)
+ :id "Deprecation Warning"
+ :checker checker
+ :buffer buffer
+ :filename filename))
+ (plist-get stylelint-output :deprecations)))
+
+ ;; Turn all invalid options into errors
+ (invalid-options
+ (mapcar (lambda (io)
+ (flycheck-error-new-at
+ 1 nil 'error
+ (plist-get io :text)
+ :id "Invalid Option"
+ :checker checker
+ :buffer buffer
+ :filename filename))
+ (plist-get stylelint-output :invalidOptionWarnings)))
+
+ ;; Read all linting warnings
+ (warnings
+ (mapcar (lambda (w)
+ (flycheck-error-new-at
+ (plist-get w :line) (plist-get w :column)
+ (pcase (plist-get w :severity)
+ (`"error" 'error)
+ (`"warning" 'warning)
+ ;; Default to info for unknown .severity
+ (_ 'info))
+ (plist-get w :text)
+ :id (plist-get w :rule)
+ :checker checker
+ :buffer buffer
+ :filename filename))
+ (plist-get stylelint-output :warnings))))
+
+ ;; Return the combined errors (deprecations, invalid options, warnings)
+ (append deprecations invalid-options warnings))))
+
+(flycheck-define-checker css-stylelint
+ "A CSS syntax and style checker using stylelint.
+
+See URL `http://stylelint.io/'."
+ :command ("stylelint"
+ (eval flycheck-stylelint-args)
+ (option-flag "--quiet" flycheck-stylelint-quiet)
+ (config-file "--config" flycheck-stylelintrc)
+ "--stdin-filename" (eval (or (buffer-file-name) "style.css")))
+ :standard-input t
+ :error-parser flycheck-parse-stylelint
+ :predicate flycheck-buffer-nonempty-p
+ :modes (css-mode))
+
+(flycheck-def-option-var flycheck-cuda-language-standard nil cuda-nvcc
+ "Our CUDA Language Standard."
+ :type '(choice (const :tag "Default standard" nil)
+ (string :tag "Language standard"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "32"))
+(make-variable-buffer-local 'flycheck-cuda-language-standard)
+
+(flycheck-def-option-var flycheck-cuda-includes nil cuda-nvcc
+ "Our include directories to pass to nvcc."
+ :type '(repeat (file :tag "Include file"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "32"))
+
+(flycheck-def-option-var flycheck-cuda-definitions nil cuda-nvcc
+ "Additional preprocessor definitions for nvcc.
+A list of strings to pass to cuda, a la flycheck-clang"
+ :type '(repeat (string :tag "Definitions"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "32"))
+
+(flycheck-def-option-var flycheck-cuda-include-path nil cuda-nvcc
+ "A list of include directories for nvcc."
+ :type '(repeat (directory :tag "Include directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "32"))
+
+(flycheck-define-checker cuda-nvcc
+ "A CUDA C/C++ syntax checker using nvcc.
+
+See URL `https://developer.nvidia.com/cuda-llvm-compiler'."
+ :command ("nvcc"
+ "-c" ;; Compile Only
+ "--output-file" "/dev/null" ;; avoid creating output .o
+ "--x=cu" ;; explicitly specify it's a CUDA language file
+ (option "-std=" flycheck-cuda-language-standard concat)
+ (option-list "-include" flycheck-cuda-includes)
+ (option-list "-D" flycheck-cuda-definitions concat)
+ (option-list "-I" flycheck-cuda-include-path)
+ source)
+ :error-patterns
+ ((error line-start
+ (message "In file included from")
+ " " (or "<stdin>" (file-name))
+ ":" line ":" line-end)
+ (error line-start (or "<stdin>" (file-name))
+ "(" line "): error: " (message) line-end)
+ (error line-start (or "<stdin>" (file-name))
+ ":" line ":" column
+ ": fatal error: " (optional (message)) line-end)
+ (warning line-start (or "<stdin>" (file-name))
+ "(" line "): warning: " (message) line-end))
+ :modes cuda-mode)
+
+
+(flycheck-def-option-var flycheck-cwl-schema-path nil cwl
+ "A path for the schema file for Common Workflow Language.
+
+The value of this variable is a string that denotes a path for
+the schema file of Common Workflow Language."
+ :type '(choice (const :tag "None" nil)
+ (file :tag "Schema file"))
+ :safe #'flycheck-string-or-nil-p)
+
+(flycheck-define-checker cwl
+ "A CWL syntax checker using Schema Salad validator.
+
+Requires Schema Salad 2.6.20171101113912 or newer.
+See URL `https://www.commonwl.org/v1.0/SchemaSalad.html'."
+ :command ("schema-salad-tool"
+ "--quiet"
+ "--print-oneline"
+ (eval flycheck-cwl-schema-path)
+ source-inplace)
+ :error-patterns
+ ((error line-start
+ (file-name) ":" line ":" column ":" (zero-or-more blank)
+ (message (one-or-more not-newline))
+ line-end))
+ :modes cwl-mode)
+
+(defconst flycheck-d-module-re
+ (rx "module" (one-or-more (syntax whitespace))
+ (group (one-or-more (not (syntax whitespace))))
+ (zero-or-more (syntax whitespace))
+ ";")
+ "Regular expression to match a D module declaration.")
+
+(defun flycheck-d-base-directory ()
+ "Get the relative base directory path for this module."
+ (let* ((file-name (buffer-file-name))
+ (module-file (if (and file-name
+ (string= (file-name-nondirectory file-name)
+ "package.d"))
+ (directory-file-name (file-name-directory file-name))
+ file-name)))
+ (flycheck-module-root-directory
+ (flycheck-find-in-buffer flycheck-d-module-re)
+ module-file)))
+
+(flycheck-def-option-var flycheck-dmd-include-path nil d-dmd
+ "A list of include directories for dmd.
+
+The value of this variable is a list of strings, where each
+string is a directory to add to the include path of dmd.
+Relative paths are relative to the file being checked."
+ :type '(repeat (directory :tag "Include directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.18"))
+
+(flycheck-def-args-var flycheck-dmd-args d-dmd
+ :package-version '(flycheck . "0.24"))
+
+(flycheck-define-checker d-dmd
+ "A D syntax checker using the DMD compiler.
+
+Requires DMD 2.066 or newer. See URL `https://dlang.org/'."
+ :command ("dmd"
+ "-debug" ; Compile in debug mode
+ "-o-" ; Don't generate an object file
+ "-vcolumns" ; Add columns in output
+ "-wi" ; Compilation will continue even if there are warnings
+ (eval (concat "-I" (flycheck-d-base-directory)))
+ (option-list "-I" flycheck-dmd-include-path concat)
+ (eval flycheck-dmd-args)
+ (source ".d"))
+ :error-patterns
+ ((error line-start
+ (file-name) "(" line "," column "): Error: " (message)
+ line-end)
+ (warning line-start (file-name) "(" line "," column "): "
+ (or "Warning" "Deprecation") ": " (message) line-end)
+ (info line-start (file-name) "(" line "," column "): "
+ (one-or-more " ") (message) line-end))
+ :modes d-mode)
+
+(flycheck-define-checker dockerfile-hadolint
+ "A Dockerfile syntax checker using the hadolint.
+
+See URL `http://github.com/hadolint/hadolint/'."
+ :command ("hadolint" "--no-color" "-")
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ (file-name) ":" line " " (id (one-or-more alnum)) " error: " (message)
+ line-end)
+ (warning line-start
+ (file-name) ":" line " " (id (one-or-more alnum))
+ " warning: " (message) line-end)
+ (info line-start
+ (file-name) ":" line " " (id (one-or-more alnum)) " info: " (message)
+ line-end)
+ (error line-start
+ (file-name) ":" line ":" column " " (message)
+ line-end))
+ :error-filter
+ (lambda (errors)
+ (flycheck-sanitize-errors
+ (flycheck-remove-error-file-names "/dev/stdin" errors)))
+ :modes dockerfile-mode)
+
+(defun flycheck-credo--working-directory (&rest _ignored)
+ "Check if `credo' is installed as dependency in the application."
+ (and buffer-file-name
+ (locate-dominating-file buffer-file-name "deps/credo")))
+
+(flycheck-def-option-var flycheck-elixir-credo-strict nil elixir-credo
+ "Enable strict mode in `credo'.
+
+When non-nil, pass the `--strict' flag to credo."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "32"))
+
+(flycheck-define-checker elixir-credo
+ "An Elixir checker for static code analysis using Credo.
+
+See `http://credo-ci.org/'."
+ :command ("mix" "credo"
+ (option-flag "--strict" flycheck-elixir-credo-strict)
+ "--format" "flycheck"
+ "--read-from-stdin" source-original)
+ :standard-input t
+ :working-directory flycheck-credo--working-directory
+ :enabled flycheck-credo--working-directory
+ :error-patterns
+ ((info line-start
+ (file-name) ":" line (optional ":" column) ": "
+ (or "F" "R" "C") ": " (message) line-end)
+ (warning line-start
+ (file-name) ":" line (optional ":" column) ": "
+ (or "D" "W") ": " (message) line-end))
+ :modes elixir-mode)
+
+(defconst flycheck-this-emacs-executable
+ (concat invocation-directory invocation-name)
+ "The path to the currently running Emacs executable.")
+
+(defconst flycheck-emacs-args '("-Q" "--batch")
+ "Common arguments to Emacs invocations.")
+
+(defmacro flycheck-prepare-emacs-lisp-form (&rest body)
+ "Prepare BODY for use as check form in a subprocess."
+ (declare (indent 0))
+ `(flycheck-sexp-to-string
+ '(progn
+ (defvar jka-compr-inhibit)
+ (unwind-protect
+ ;; Flycheck inhibits compression of temporary files, thus we
+ ;; must not attempt to decompress.
+ (let ((jka-compr-inhibit t))
+ ;; Strip option-argument separator from arguments, if present
+ (when (equal (car command-line-args-left) "--")
+ (setq command-line-args-left (cdr command-line-args-left)))
+ ,@body)
+ ;; Prevent Emacs from processing the arguments on its own, see
+ ;; https://github.com/flycheck/flycheck/issues/319
+ (setq command-line-args-left nil)))))
+
+(defun flycheck-emacs-lisp-bytecomp-config-form ()
+ "Prepare an Emacs Lisp form to set byte-compiler variables."
+ (flycheck-sexp-to-string
+ `(progn
+ (require 'bytecomp)
+ (setq byte-compile-root-dir
+ ,(if buffer-file-name
+ (file-name-directory buffer-file-name)
+ default-directory)))))
+
+(defconst flycheck-emacs-lisp-check-form
+ (flycheck-prepare-emacs-lisp-form
+ ;; Keep track of the generated bytecode files, to delete them after byte
+ ;; compilation.
+ (require 'bytecomp)
+ (defvar flycheck-byte-compiled-files nil)
+ (let ((byte-compile-dest-file-function
+ (lambda (source)
+ (let ((temp-file (make-temp-file (file-name-nondirectory source))))
+ (push temp-file flycheck-byte-compiled-files)
+ temp-file))))
+ (unwind-protect
+ (byte-compile-file (car command-line-args-left))
+ (mapc (lambda (f) (ignore-errors (delete-file f)))
+ flycheck-byte-compiled-files))
+ (when (bound-and-true-p flycheck-emacs-lisp-check-declare)
+ (check-declare-file (car command-line-args-left))))))
+
+(flycheck-def-option-var flycheck-emacs-lisp-load-path nil emacs-lisp
+ "Load path to use in the Emacs Lisp syntax checker.
+
+When set to `inherit', use the `load-path' of the current Emacs
+session during syntax checking.
+
+When set to a list of strings, add each directory in this list to
+the `load-path' before invoking the byte compiler. Relative
+paths in this list are expanded against the `default-directory'
+of the buffer to check.
+
+When nil, do not explicitly set the `load-path' during syntax
+checking. The syntax check only uses the built-in `load-path' of
+Emacs in this case.
+
+Note that changing this variable can lead to wrong results of the
+syntax check, e.g. if an unexpected version of a required library
+is used."
+ :type '(choice (const :tag "Inherit current `load-path'" inherit)
+ (repeat :tag "Load path" directory))
+ :risky t
+ :package-version '(flycheck . "0.14"))
+
+(flycheck-def-option-var flycheck-emacs-lisp-initialize-packages
+ 'auto emacs-lisp
+ "Whether to initialize packages in the Emacs Lisp syntax checker.
+
+When nil, never initialize packages. When `auto', initialize
+packages only when checking `user-init-file' or files from
+`user-emacs-directory'. For any other non-nil value, always
+initialize packages.
+
+When initializing packages is enabled the `emacs-lisp' syntax
+checker calls `package-initialize' before byte-compiling the file
+to be checked. It also sets `package-user-dir' according to
+`flycheck-emacs-lisp-package-user-dir'."
+ :type '(choice (const :tag "Do not initialize packages" nil)
+ (const :tag "Initialize packages for configuration only" auto)
+ (const :tag "Always initialize packages" t))
+ :risky t
+ :package-version '(flycheck . "0.14"))
+
+(defconst flycheck-emacs-lisp-package-initialize-form
+ (flycheck-sexp-to-string
+ '(with-demoted-errors "Error during package initialization: %S"
+ (package-initialize)))
+ "Form used to initialize packages.")
+
+(defun flycheck-option-emacs-lisp-package-initialize (value)
+ "Option VALUE filter for `flycheck-emacs-lisp-initialize-packages'."
+ (let ((shall-initialize
+ (if (eq value 'auto)
+ (or (flycheck-in-user-emacs-directory-p
+ (or buffer-file-name default-directory))
+ ;; `user-init-file' is nil in non-interactive sessions. Now,
+ ;; no user would possibly use Flycheck in a non-interactive
+ ;; session, but our unit tests run non-interactively, so we
+ ;; have to handle this case anyway
+ (and user-init-file buffer-file-name
+ (flycheck-same-files-p buffer-file-name user-init-file)))
+ value)))
+ (when shall-initialize
+ ;; If packages shall be initialized, return the corresponding form,
+ ;; otherwise make Flycheck ignore the option by returning nil.
+ flycheck-emacs-lisp-package-initialize-form)))
+
+(flycheck-def-option-var flycheck-emacs-lisp-package-user-dir nil emacs-lisp
+ "Package directory for the Emacs Lisp syntax checker.
+
+If set to a string set `package-user-dir' to the value of this
+variable before initializing packages. If set to nil just inherit
+the value of `package-user-dir' from the running Emacs session.
+
+This variable has no effect, if
+`flycheck-emacs-lisp-initialize-packages' is nil."
+ :type '(choice (const :tag "Default package directory" nil)
+ (directory :tag "Custom package directory"))
+ :risky t
+ :package-version '(flycheck . "0.14"))
+
+(defun flycheck-option-emacs-lisp-package-user-dir (value)
+ "Option VALUE filter for `flycheck-emacs-lisp-package-user-dir'."
+ ;; Inherit the package directory from our Emacs session
+ (let ((value (or value (bound-and-true-p package-user-dir))))
+ (when value
+ (flycheck-sexp-to-string `(setq package-user-dir ,value)))))
+
+(flycheck-def-option-var flycheck-emacs-lisp-check-declare nil emacs-lisp
+ "If non-nil, check ‘declare-function’ forms using ‘check-declare-file’."
+ :type '(choice (const :tag "Do not check declare forms" nil)
+ (const :tag "Check declare forms" t))
+ :risky t
+ :package-version '(flycheck . "31"))
+
+(defun flycheck-option-emacs-lisp-check-declare (value)
+ "Option VALUE filter for `flycheck-emacs-lisp-check-declare'."
+ (when value
+ (flycheck-sexp-to-string
+ `(progn
+ (defvar flycheck-emacs-lisp-check-declare)
+ (setq flycheck-emacs-lisp-check-declare ,value)))))
+
+(defun flycheck--emacs-lisp-enabled-p ()
+ "Check whether to enable Emacs Lisp checker in the current buffer."
+ (not
+ (or
+ ;; Do not check buffers used for autoloads generation during package
+ ;; installation. These buffers are too short-lived for being checked, and
+ ;; doing so causes spurious errors. See
+ ;; https://github.com/flycheck/flycheck/issues/45 and
+ ;; https://github.com/bbatsov/prelude/issues/248. We must also not check
+ ;; compilation buffers, but as these are ephemeral, Flycheck won't check
+ ;; them anyway.
+ (flycheck-autoloads-file-p)
+ ;; Cask/Carton and dir-locals files contain data, not code, and don't need
+ ;; to follow Checkdoc conventions either.
+ (and (buffer-file-name)
+ (member (file-name-nondirectory (buffer-file-name))
+ '("Cask" "Carton" ".dir-locals.el" ".dir-locals-2.el"))))))
+
+(defun flycheck--emacs-lisp-checkdoc-enabled-p ()
+ "Check whether to enable Emacs Lisp Checkdoc in the current buffer."
+ (and (flycheck--emacs-lisp-enabled-p)
+ ;; These files are valid Lisp, but don't contain "standard" comments.
+ (not (member (buffer-file-name) '("Eldev" "Eldev-local")))))
+
+(flycheck-define-checker emacs-lisp
+ "An Emacs Lisp syntax checker using the Emacs Lisp Byte compiler.
+
+See Info Node `(elisp)Byte Compilation'."
+ :command ("emacs" (eval flycheck-emacs-args)
+ (eval
+ (let ((path (pcase flycheck-emacs-lisp-load-path
+ (`inherit load-path)
+ (p (seq-map #'expand-file-name p)))))
+ (flycheck-prepend-with-option "--directory" path)))
+ (option "--eval" flycheck-emacs-lisp-package-user-dir nil
+ flycheck-option-emacs-lisp-package-user-dir)
+ (option "--eval" flycheck-emacs-lisp-initialize-packages nil
+ flycheck-option-emacs-lisp-package-initialize)
+ (option "--eval" flycheck-emacs-lisp-check-declare nil
+ flycheck-option-emacs-lisp-check-declare)
+ "--eval" (eval (flycheck-emacs-lisp-bytecomp-config-form))
+ "--eval" (eval flycheck-emacs-lisp-check-form)
+ "--"
+ source-inplace)
+ :error-patterns
+ ((error line-start (file-name) ":" line ":" column ":"
+ (zero-or-more whitespace) "Error:" (zero-or-more whitespace)
+ (message (zero-or-more not-newline)
+ (zero-or-more "\n " (zero-or-more not-newline)))
+ line-end)
+ (warning line-start (file-name) ":" line ":" column ":"
+ (zero-or-more whitespace) "Warning:" (zero-or-more whitespace)
+ (message (zero-or-more not-newline)
+ (zero-or-more "\n " (zero-or-more not-newline)))
+ line-end)
+ (warning line-start (file-name) ":" line (optional ":" column) ":"
+ (zero-or-more whitespace) "Warning (check-declare): said\n"
+ (message (zero-or-more " " (zero-or-more not-newline))
+ (zero-or-more "\n " (zero-or-more not-newline)))
+ line-end)
+ ;; The following is for Emacs 24 ‘check-declare-file’, which uses a
+ ;; less informative format.
+ (warning line-start "Warning (check-declare): " (file-name) " said "
+ (message (zero-or-more not-newline))
+ line-end))
+ :error-filter
+ (lambda (errors)
+ (flycheck-fill-empty-line-numbers
+ (flycheck-collapse-error-message-whitespace
+ (flycheck-sanitize-errors errors))))
+ :modes (emacs-lisp-mode lisp-interaction-mode)
+ :enabled flycheck--emacs-lisp-enabled-p
+ :predicate
+ (lambda ()
+ ;; Do not check buffers that should not be byte-compiled. The checker
+ ;; process will refuse to compile these, which would confuse Flycheck
+ (not (bound-and-true-p no-byte-compile)))
+ :next-checkers (emacs-lisp-checkdoc))
+
+(defconst flycheck-emacs-lisp-checkdoc-form
+ (flycheck-prepare-emacs-lisp-form
+ (unless (require 'elisp-mode nil 'no-error)
+ ;; TODO: Fallback for Emacs 24, remove when dropping support for 24
+ (require 'lisp-mode))
+ (require 'checkdoc)
+
+ (let ((source (car command-line-args-left))
+ ;; Remember the default directory of the process
+ (process-default-directory default-directory))
+ ;; Note that we deliberately use our custom approach even despite of
+ ;; `checkdoc-file' which was added to Emacs 25.1. While it's conceptually
+ ;; the better thing, its implementation has too many flaws to be of use
+ ;; for us.
+ (with-temp-buffer
+ (insert-file-contents source 'visit)
+ (setq buffer-file-name source)
+ ;; And change back to the process default directory to make file-name
+ ;; back-substutition work
+ (setq default-directory process-default-directory)
+ (with-demoted-errors "Error in checkdoc: %S"
+ ;; Checkdoc needs the Emacs Lisp syntax table and comment syntax to
+ ;; parse sexps and identify docstrings correctly; see
+ ;; https://github.com/flycheck/flycheck/issues/833
+ (delay-mode-hooks (emacs-lisp-mode))
+ (setq delayed-mode-hooks nil)
+ (checkdoc-current-buffer t)
+ (with-current-buffer checkdoc-diagnostic-buffer
+ (princ (buffer-substring-no-properties (point-min) (point-max)))
+ (kill-buffer)))))))
+
+(defconst flycheck-emacs-lisp-checkdoc-variables
+ '(checkdoc-symbol-words
+ checkdoc-arguments-in-order-flag
+ checkdoc-force-history-flag
+ checkdoc-permit-comma-termination-flag
+ checkdoc-force-docstrings-flag
+ checkdoc-package-keywords-flag
+ checkdoc-spellcheck-documentation-flag
+ checkdoc-verb-check-experimental-flag
+ checkdoc-max-keyref-before-warn
+ sentence-end-double-space)
+ "Variables inherited by the checkdoc subprocess.")
+
+(defun flycheck-emacs-lisp-checkdoc-variables-form ()
+ "Make a sexp to pass relevant variables to a checkdoc subprocess.
+
+Variables are taken from `flycheck-emacs-lisp-checkdoc-variables'."
+ `(progn
+ ,@(seq-map (lambda (opt) `(setq-default ,opt ',(symbol-value opt)))
+ (seq-filter #'boundp flycheck-emacs-lisp-checkdoc-variables))))
+
+(flycheck-define-checker emacs-lisp-checkdoc
+ "An Emacs Lisp style checker using CheckDoc.
+
+The checker runs `checkdoc-current-buffer'."
+ :command ("emacs" (eval flycheck-emacs-args)
+ "--eval" (eval (flycheck-sexp-to-string
+ (flycheck-emacs-lisp-checkdoc-variables-form)))
+ "--eval" (eval flycheck-emacs-lisp-checkdoc-form)
+ "--" source)
+ :error-patterns
+ ((info line-start (file-name) ":" line ": " (message) line-end))
+ :modes (emacs-lisp-mode)
+ :enabled flycheck--emacs-lisp-checkdoc-enabled-p)
+
+(dolist (checker '(emacs-lisp emacs-lisp-checkdoc))
+ (setf (car (flycheck-checker-get checker 'command))
+ flycheck-this-emacs-executable))
+
+(defun flycheck-ember-template--check-for-config (&rest _ignored)
+ "Check the required config file is available up the file system."
+ (and buffer-file-name
+ (locate-dominating-file buffer-file-name ".template-lintrc.js")))
+
+(defun flycheck-ember-template--parse-error (output checker buffer)
+ "Parse Ember-template-lint errors/warnings from JSON OUTPUT.
+CHECKER and BUFFER denote the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively."
+ (mapcar (lambda (err)
+ (let-alist err
+ (flycheck-error-new-at
+ .line
+ .column
+ (pcase .severity
+ (2 'error)
+ (1 'warning)
+ (_ 'warning))
+ .message
+ :id .rule
+ :checker checker
+ :buffer buffer
+ :filename (buffer-file-name buffer))))
+ (cdr (car (car (flycheck-parse-json output))))))
+
+(flycheck-def-config-file-var flycheck-ember-template-lintrc
+ ember-template
+ ".template-lintrc.js")
+
+(flycheck-define-checker ember-template
+ "An Ember template checker using ember-template-lint."
+ :command ("ember-template-lint"
+ (config-file "--config-path" flycheck-ember-template-lintrc)
+ "--filename" source-original
+ "--json")
+ :standard-input t
+ :error-parser flycheck-ember-template--parse-error
+ :modes web-mode
+ :enabled flycheck-ember-template--check-for-config
+ :working-directory flycheck-ember-template--check-for-config)
+
+(flycheck-def-option-var flycheck-erlang-include-path nil erlang
+ "A list of include directories for Erlang.
+
+The value of this variable is a list of strings, where each
+string is a directory to add to the include path of erlc.
+Relative paths are relative to the file being checked."
+ :type '(repeat (directory :tag "Include directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.24"))
+
+(flycheck-def-option-var flycheck-erlang-library-path nil erlang
+ "A list of library directories for Erlang.
+
+The value of this variable is a list of strings, where each
+string is a directory to add to the library path of erlc.
+Relative paths are relative to the file being checked."
+ :type '(repeat (directory :tag "Library directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.24"))
+
+(flycheck-define-checker erlang
+ "An Erlang syntax checker using the Erlang interpreter.
+
+See URL `http://www.erlang.org/'."
+ :command ("erlc"
+ "-o" temporary-directory
+ (option-list "-I" flycheck-erlang-include-path)
+ (option-list "-pa" flycheck-erlang-library-path)
+ "-Wall"
+ source)
+ :error-patterns
+ ((warning line-start (file-name) ":" line ": Warning:" (message) line-end)
+ (error line-start (file-name) ":" line ": " (message) line-end))
+ :modes erlang-mode
+ :enabled (lambda () (string-suffix-p ".erl" (buffer-file-name))))
+
+(defun flycheck--contains-rebar-config (dir-name)
+ "Return DIR-NAME if rebar config file exists in DIR-NAME, nil otherwise."
+ (when (or (file-exists-p (expand-file-name "rebar.config" dir-name))
+ (file-exists-p (expand-file-name "rebar.config.script" dir-name)))
+ dir-name))
+
+(defun flycheck--locate-rebar3-project-root
+ (file-name &optional prev-file-name acc)
+ "Find the top-most rebar project root for source FILE-NAME.
+
+A project root directory is any directory containing a
+rebar.config file. Find the top-most directory to move out of any
+nested dependencies.
+
+FILE-NAME is a source file for which to find the project.
+
+PREV-FILE-NAME helps us prevent infinite looping
+
+ACC is an accumulator that keeps the list of results, the first
+non-nil of which will be our project root.
+
+Return the absolute path to the directory"
+ (if (string= file-name prev-file-name)
+ (car (remove nil acc))
+ (let ((current-dir (file-name-directory file-name)))
+ (flycheck--locate-rebar3-project-root
+ (directory-file-name current-dir)
+ file-name
+ (cons (flycheck--contains-rebar-config current-dir) acc)))))
+
+(defun flycheck-rebar3-project-root (&optional _checker)
+ "Return directory where rebar.config is located."
+ (flycheck--locate-rebar3-project-root buffer-file-name))
+
+(flycheck-def-option-var flycheck-erlang-rebar3-profile nil erlang-rebar3
+ "The rebar3 profile to use.
+
+The profile used when compiling, if VALUE is nil \"test\" will be used
+when the file is located in test directory, otherwise \"default\" will be
+used as profile."
+ :type '(choice (const :tag "Automatic" nil)
+ (string :tag "Profile"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "32"))
+
+(defun flycheck-erlang-rebar3-get-profile ()
+ "Return rebar3 profile.
+
+Use flycheck-erlang-rebar3-profile if set, otherwise use test or eqc profile if
+directory name is \"test\" or \"eqc\", or else \"default\"."
+ (or
+ flycheck-erlang-rebar3-profile
+ (with-no-warnings
+ ;; `seq-contains-p' is only in seq >= 2.21
+ (seq-contains '("test" "eqc")
+ (and buffer-file-name
+ (file-name-base
+ (directory-file-name
+ (file-name-directory buffer-file-name))))))
+ "default"))
+
+(flycheck-define-checker erlang-rebar3
+ "An Erlang syntax checker using the rebar3 build tool."
+ :command ("rebar3" "as" (eval (flycheck-erlang-rebar3-get-profile)) "compile")
+ :error-parser flycheck-parse-with-patterns-without-color
+ :error-patterns
+ ((warning line-start
+ (file-name) ":" line ": Warning:" (message) line-end)
+ (error line-start
+ (file-name) ":" line ": " (message) line-end))
+ :modes erlang-mode
+ :enabled flycheck-rebar3-project-root
+ :predicate flycheck-buffer-saved-p
+ :working-directory flycheck-rebar3-project-root)
+
+(flycheck-define-checker eruby-erubis
+ "An eRuby syntax checker using the `erubis' command.
+
+See URL `http://www.kuwata-lab.com/erubis/'."
+ :command ("erubis" "-z" source)
+ :error-patterns
+ ((error line-start (file-name) ":" line ": " (message) line-end))
+ :modes (html-erb-mode rhtml-mode)
+ :next-checkers ((warning . eruby-ruumba)))
+
+(flycheck-def-config-file-var flycheck-ruumbarc eruby-ruumba ".ruumba.yml")
+
+(flycheck-def-option-var flycheck-ruumba-lint-only nil eruby-ruumba
+ "Whether to only report code issues in Ruumba.
+
+When non-nil, only report code issues in Ruumba, via `--lint'.
+Otherwise report style issues as well."
+ :safe #'booleanp
+ :type 'boolean
+ :package-version '(flycheck . "32"))
+
+(flycheck-define-checker eruby-ruumba
+ "An eRuby syntax and style checker using the Ruumba tool.
+
+You need at least Ruumba 0.1.7 for this syntax checker.
+
+See URL `https://github.com/ericqweinstein/ruumba'."
+ :command ("ruumba"
+ "--display-cop-names"
+ "--force-exclusion"
+ "--format" "emacs"
+ "--cache" "false"
+ (config-file "--config" flycheck-ruumbarc)
+ (option-flag "--lint" flycheck-ruumba-lint-only)
+ ;; Ruumba takes the original file name as argument when reading
+ ;; from standard input
+ "--stdin" source-original)
+ :standard-input t
+ :working-directory flycheck-ruby--find-project-root
+ :error-patterns
+ ((info line-start (file-name) ":" line ":" column ": C: "
+ (optional (id (one-or-more (not (any ":")))) ": ") (message) line-end)
+ (warning line-start (file-name) ":" line ":" column ": W: "
+ (optional (id (one-or-more (not (any ":")))) ": ") (message)
+ line-end)
+ (error line-start (file-name) ":" line ":" column ": " (or "E" "F") ": "
+ (optional (id (one-or-more (not (any ":")))) ": ") (message)
+ line-end))
+ :modes (html-erb-mode rhtml-mode))
+
+(flycheck-def-args-var flycheck-gfortran-args fortran-gfortran
+ :package-version '(flycheck . "0.22"))
+
+(flycheck-def-option-var flycheck-gfortran-include-path nil fortran-gfortran
+ "A list of include directories for GCC Fortran.
+
+The value of this variable is a list of strings, where each
+string is a directory to add to the include path of gcc.
+Relative paths are relative to the file being checked."
+ :type '(repeat (directory :tag "Include directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-def-option-var flycheck-gfortran-language-standard "f95"
+ fortran-gfortran
+ "The language standard to use in GFortran.
+
+The value of this variable is either a string denoting a language
+standard, or nil, to use the default standard. When non-nil,
+pass the language standard via the `-std' option."
+ :type '(choice (const :tag "Default standard" nil)
+ (string :tag "Language standard"))
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-def-option-var flycheck-gfortran-layout nil fortran-gfortran
+ "The source code layout to use in GFortran.
+
+The value of this variable is one of the following symbols:
+
+nil
+ Let gfortran determine the layout from the extension
+
+`free'
+ Use free form layout
+
+
+`fixed'
+ Use fixed form layout
+
+In any other case, an error is signaled."
+ :type '(choice (const :tag "Guess layout from extension" nil)
+ (const :tag "Free form layout" free)
+ (const :tag "Fixed form layout" fixed))
+ :safe (lambda (value) (or (not value) (memq value '(free fixed))))
+ :package-version '(flycheck . "0.20"))
+
+(defun flycheck-option-gfortran-layout (value)
+ "Option VALUE filter for `flycheck-gfortran-layout'."
+ (pcase value
+ (`nil nil)
+ (`free "free-form")
+ (`fixed "fixed-form")
+ (_ (error "Invalid value for flycheck-gfortran-layout: %S" value))))
+
+(flycheck-def-option-var flycheck-gfortran-warnings '("all" "extra")
+ fortran-gfortran
+ "A list of warnings for GCC Fortran.
+
+The value of this variable is a list of strings, where each string
+is the name of a warning category to enable. By default, all
+recommended warnings and some extra warnings are enabled (as by
+`-Wall' and `-Wextra' respectively).
+
+Refer to the gfortran manual at URL
+`https://gcc.gnu.org/onlinedocs/gfortran/' for more information
+about warnings"
+ :type '(choice (const :tag "No additional warnings" nil)
+ (repeat :tag "Additional warnings"
+ (string :tag "Warning name")))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-define-checker fortran-gfortran
+ "An Fortran syntax checker using GCC.
+
+Uses GCC's Fortran compiler gfortran. See URL
+`https://gcc.gnu.org/onlinedocs/gfortran/'."
+ :command ("gfortran"
+ "-fsyntax-only"
+ "-fshow-column"
+ ;; Do not visually indicate the source location
+ "-fno-diagnostics-show-caret"
+ ;; Do not show the corresponding warning group
+ "-fno-diagnostics-show-option"
+ ;; Fortran has similar include processing as C/C++
+ "-iquote" (eval (flycheck-c/c++-quoted-include-directory))
+ (option "-std=" flycheck-gfortran-language-standard concat)
+ (option "-f" flycheck-gfortran-layout concat
+ flycheck-option-gfortran-layout)
+ (option-list "-W" flycheck-gfortran-warnings concat)
+ (option-list "-I" flycheck-gfortran-include-path concat)
+ (eval flycheck-gfortran-args)
+ source)
+ :error-patterns
+ ((error line-start (file-name) ":" line (or ":" ".") column (or ": " ":\n")
+ (or (= 3 (zero-or-more not-newline) "\n") "")
+ (or "Error" "Fatal Error") ": "
+ (message) line-end)
+ (warning line-start (file-name) ":" line (or ":" ".") column (or ": " ":\n")
+ (or (= 3 (zero-or-more not-newline) "\n") "")
+ "Warning: " (message) line-end))
+ :modes (fortran-mode f90-mode))
+
+(flycheck-define-checker go-gofmt
+ "A Go syntax and style checker using the gofmt utility.
+
+See URL `https://golang.org/cmd/gofmt/'."
+ :command ("gofmt")
+ :standard-input t
+ :error-patterns
+ ((error line-start "<standard input>:" line ":" column ": "
+ (message) line-end))
+ :modes go-mode
+ :next-checkers ((warning . go-golint)
+ ;; Fall back, if go-golint doesn't exist
+ (warning . go-vet)
+ ;; Fall back, if go-vet doesn't exist
+ (warning . go-build) (warning . go-test)
+ (warning . go-errcheck)
+ (warning . go-unconvert)
+ (warning . go-staticcheck)))
+
+(flycheck-define-checker go-golint
+ "A Go style checker using Golint.
+
+See URL `https://github.com/golang/lint'."
+ :command ("golint" source)
+ :error-patterns
+ ((warning line-start (file-name) ":" line ":" column ": " (message) line-end))
+ :modes go-mode
+ :next-checkers (go-vet
+ ;; Fall back, if go-vet doesn't exist
+ go-build go-test go-errcheck go-unconvert))
+
+(flycheck-def-option-var flycheck-go-vet-print-functions nil go-vet
+ "A list of print-like functions for `go vet'.
+
+Go vet will check these functions for format string problems and
+issues, such as a mismatch between the number of formats used,
+and the number of arguments given.
+
+Each entry is in the form Name:N where N is the zero-based
+argument position of the first argument involved in the print:
+either the format or the first print argument for non-formatted
+prints. For example, if you have Warn and Warnf functions that
+take an io.Writer as their first argument, like Fprintf,
+-printfuncs=Warn:1,Warnf:1 "
+ :type '(repeat :tag "print-like functions"
+ (string :tag "function"))
+ :safe #'flycheck-string-list-p)
+
+(flycheck-define-checker go-vet
+ "A Go syntax checker using the `go vet' command.
+
+See URL `https://golang.org/cmd/go/' and URL
+`https://golang.org/cmd/vet/'."
+ :command ("go" "vet"
+ (option "-printf.funcs=" flycheck-go-vet-print-functions concat
+ flycheck-option-comma-separated-list)
+ (source ".go"))
+ :error-patterns
+ ((warning line-start (file-name) ":" line ": " (message) line-end))
+ :modes go-mode
+ :next-checkers (go-build
+ go-test
+ ;; Fall back if `go build' or `go test' can be used
+ go-errcheck
+ go-unconvert
+ go-staticcheck)
+ :verify (lambda (_)
+ (let* ((go (flycheck-checker-executable 'go-vet))
+ (have-vet (member "vet" (ignore-errors
+ (process-lines go "tool")))))
+ (list
+ (flycheck-verification-result-new
+ :label "go tool vet"
+ :message (if have-vet "present" "missing")
+ :face (if have-vet 'success '(bold error)))))))
+
+(flycheck-def-option-var flycheck-go-build-install-deps nil (go-build go-test)
+ "Whether to install dependencies in `go build' and `go test'.
+
+If non-nil automatically install dependencies with `go build'
+while syntax checking."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.25"))
+
+(flycheck-def-option-var flycheck-go-build-tags nil
+ (go-build go-test go-errcheck go-staticcheck)
+ "A list of tags for `go build'.
+
+Each item is a string with a tag to be given to `go build'."
+ :type '(repeat (string :tag "Tag"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.25"))
+
+
+(flycheck-def-option-var flycheck-go-version nil go-staticcheck
+ "The version of go that should be targeted by `staticcheck'.
+
+Should be a string representing a version, like 1.6 or 1.11.4.
+See `https://staticcheck.io/docs/#targeting-go-versions' for
+details."
+ :type '(choice (const :tag "Unspecified" nil)
+ (string :tag "Version"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "0.32"))
+
+(flycheck-define-checker go-build
+ "A Go syntax and type checker using the `go build' command.
+
+Requires Go 1.6 or newer. See URL `https://golang.org/cmd/go'."
+ :command ("go" "build"
+ (option-flag "-i" flycheck-go-build-install-deps)
+ ;; multiple tags are listed as "dev debug ..."
+ (option-list "-tags=" flycheck-go-build-tags concat)
+ "-o" null-device)
+ :error-patterns
+ ((error line-start (file-name) ":" line ":"
+ (optional column ":") " "
+ (message (one-or-more not-newline)
+ (zero-or-more "\n\t" (one-or-more not-newline)))
+ line-end)
+ ;; Catch error message about multiple packages in a directory, which doesn't
+ ;; follow the standard error message format.
+ (info line-start
+ (message "can't load package: package "
+ (one-or-more (not (any ?: ?\n)))
+ ": found packages "
+ (one-or-more not-newline))
+ line-end))
+ :error-filter
+ (lambda (errors)
+ (dolist (error errors)
+ (unless (flycheck-error-line error)
+ ;; Flycheck ignores errors without line numbers, but the error
+ ;; message about multiple packages in a directory doesn't come with a
+ ;; line number, so inject a fake one.
+ (setf (flycheck-error-line error) 1)))
+ errors)
+ :modes go-mode
+ :predicate (lambda ()
+ (and (flycheck-buffer-saved-p)
+ (not (string-suffix-p "_test.go" (buffer-file-name)))))
+ :next-checkers ((warning . go-errcheck)
+ (warning . go-unconvert)
+ (warning . go-staticcheck)))
+
+(flycheck-define-checker go-test
+ "A Go syntax and type checker using the `go test' command.
+
+Requires Go 1.6 or newer. See URL `https://golang.org/cmd/go'."
+ :command ("go" "test"
+ (option-flag "-i" flycheck-go-build-install-deps)
+ (option-list "-tags=" flycheck-go-build-tags concat)
+ "-c" "-o" null-device)
+ :error-patterns
+ ((error line-start (file-name) ":" line ":"
+ (optional column ":") " "
+ (message (one-or-more not-newline)
+ (zero-or-more "\n\t" (one-or-more not-newline)))
+ line-end))
+ :modes go-mode
+ :predicate
+ (lambda () (and (flycheck-buffer-saved-p)
+ (string-suffix-p "_test.go" (buffer-file-name))))
+ :next-checkers ((warning . go-errcheck)
+ (warning . go-unconvert)
+ (warning . go-staticcheck)))
+
+(flycheck-define-checker go-errcheck
+ "A Go checker for unchecked errors.
+
+Requires errcheck newer than commit 8515d34 (Aug 28th, 2015).
+
+See URL `https://github.com/kisielk/errcheck'."
+ :command ("errcheck"
+ "-abspath"
+ (option-list "-tags=" flycheck-go-build-tags concat)
+ ".")
+ :error-patterns
+ ((warning line-start
+ (file-name) ":" line ":" column (or (one-or-more "\t") ": " ":\t")
+ (message)
+ line-end))
+ :error-filter
+ (lambda (errors)
+ (let ((errors (flycheck-sanitize-errors errors)))
+ (dolist (err errors)
+ (-when-let (message (flycheck-error-message err))
+ ;; Improve the messages reported by errcheck to make them more clear.
+ (setf (flycheck-error-message err)
+ (format "Ignored `error` returned from `%s`" message)))))
+ errors)
+ :modes go-mode
+ :predicate (lambda () (flycheck-buffer-saved-p))
+ :next-checkers ((warning . go-unconvert)
+ (warning . go-staticcheck)))
+
+(flycheck-define-checker go-unconvert
+ "A Go checker looking for unnecessary type conversions.
+
+See URL `https://github.com/mdempsky/unconvert'."
+ :command ("unconvert" ".")
+ :error-patterns
+ ((warning line-start (file-name) ":" line ":" column ": " (message) line-end))
+ :modes go-mode
+ :predicate (lambda () (flycheck-buffer-saved-p)))
+
+(flycheck-define-checker go-staticcheck
+ "A Go checker that performs static analysis and linting using
+the `staticcheck' command.
+
+`staticcheck' is explicitly fully compatible with \"the last two
+versions of go\". `staticheck' can target earlier versions (with
+limited features) if `flycheck-go-version' is set. See URL
+`https://staticcheck.io/'."
+ :command ("staticcheck" "-f" "json"
+ (option-list "-tags" flycheck-go-build-tags concat)
+ (option "-go" flycheck-go-version))
+
+ :error-parser flycheck-parse-go-staticcheck
+ :modes go-mode)
+
+(flycheck-define-checker groovy
+ "A groovy syntax checker using groovy compiler API.
+
+See URL `http://www.groovy-lang.org'."
+ :command ("groovy" "-e"
+ "import org.codehaus.groovy.control.*
+
+unit = new CompilationUnit()
+unit.addSource(\"input\", System.in)
+
+try {
+ unit.compile(Phases.CONVERSION)
+} catch (MultipleCompilationErrorsException e) {
+ e.errorCollector.write(new PrintWriter(System.out, true), null)
+}")
+ :standard-input t
+ :error-patterns
+ ((error line-start "input: " line ":" (message)
+ " @ line " line ", column " column "." line-end))
+ :modes groovy-mode)
+
+(flycheck-define-checker haml
+ "A Haml syntax checker using the Haml compiler.
+
+See URL `http://haml.info'."
+ :command ("haml" "-c" "--stdin")
+ :standard-input t
+ :error-patterns
+ ((error line-start "Syntax error on line " line ": " (message) line-end)
+ (error line-start ":" line ": syntax error, " (message) line-end))
+ :modes haml-mode)
+
+(flycheck-define-checker handlebars
+ "A Handlebars syntax checker using the Handlebars compiler.
+
+See URL `http://handlebarsjs.com/'."
+ :command ("handlebars" "-i-")
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ "Error: Parse error on line " line ":" (optional "\r") "\n"
+ (zero-or-more not-newline) "\n" (zero-or-more not-newline) "\n"
+ (message) line-end))
+ :modes (handlebars-mode handlebars-sgml-mode web-mode)
+ :predicate
+ (lambda ()
+ (if (eq major-mode 'web-mode)
+ ;; Check if this is a handlebars file since web-mode does not store the
+ ;; non-canonical engine name
+ (let* ((regexp-alist (bound-and-true-p web-mode-engine-file-regexps))
+ (pattern (cdr (assoc "handlebars" regexp-alist))))
+ (and pattern (buffer-file-name)
+ (string-match-p pattern (buffer-file-name))))
+ t)))
+
+(defconst flycheck-haskell-module-re
+ (rx line-start (zero-or-more (or "\n" (any space)))
+ "module" (one-or-more (or "\n" (any space)))
+ (group (one-or-more (not (any space "(" "\n")))))
+ "Regular expression for a Haskell module name.")
+
+(flycheck-def-args-var flycheck-ghc-args (haskell-stack-ghc haskell-ghc)
+ :package-version '(flycheck . "0.22"))
+
+(flycheck-def-option-var flycheck-ghc-stack-use-nix nil haskell-stack-ghc
+ "Whether to enable nix support in stack.
+
+When non-nil, stack will append '--nix' flag to any call."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "26"))
+
+(flycheck-def-option-var flycheck-ghc-stack-project-file nil haskell-stack-ghc
+ "Override project stack.yaml file.
+
+The value of this variable is a file path that refers to a yaml
+file for the current stack project. Relative file paths are
+resolved against the checker's working directory. When non-nil,
+stack will get overridden value via `--stack-yaml'."
+ :type '(choice (const :tag "Unspecified" nil)
+ (file :tag "Project file"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "32"))
+
+(flycheck-def-option-var flycheck-ghc-no-user-package-database nil haskell-ghc
+ "Whether to disable the user package database in GHC.
+
+When non-nil, disable the user package database in GHC, via
+`-no-user-package-db'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.16"))
+
+(flycheck-def-option-var flycheck-ghc-package-databases nil haskell-ghc
+ "Additional module databases for GHC.
+
+The value of this variable is a list of strings, where each
+string is a directory of a package database. Each package
+database is given to GHC via `-package-db'."
+ :type '(repeat (directory :tag "Package database"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.16"))
+
+(flycheck-def-option-var flycheck-ghc-search-path nil
+ (haskell-stack-ghc haskell-ghc)
+ "Module search path for (Stack) GHC.
+
+The value of this variable is a list of strings, where each
+string is a directory containing Haskell modules. Each directory
+is added to the GHC search path via `-i'."
+ :type '(repeat (directory :tag "Module directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.16"))
+
+(flycheck-def-option-var flycheck-ghc-language-extensions nil
+ (haskell-stack-ghc haskell-ghc)
+ "Language extensions for (Stack) GHC.
+
+The value of this variable is a list of strings, where each
+string is a Haskell language extension, as in the LANGUAGE
+pragma. Each extension is enabled via `-X'."
+ :type '(repeat (string :tag "Language extension"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.19"))
+
+(defvar flycheck-haskell-ghc-cache-directory nil
+ "The cache directory for `ghc' output.")
+
+(defun flycheck-haskell-ghc-cache-directory ()
+ "Get the cache location for `ghc' output.
+
+If no cache directory exists yet, create one and return it.
+Otherwise return the previously used cache directory."
+ (setq flycheck-haskell-ghc-cache-directory
+ (or flycheck-haskell-ghc-cache-directory
+ (make-temp-file "flycheck-haskell-ghc-cache" 'directory))))
+
+(defun flycheck--locate-dominating-file-matching (directory regexp)
+ "Search for a file in directory hierarchy starting at DIRECTORY.
+
+Look up the directory hierarchy from DIRECTORY for a directory
+containing a file that matches REGEXP."
+ (locate-dominating-file
+ directory
+ (lambda (dir)
+ (directory-files dir nil regexp t))))
+
+(defun flycheck-haskell--find-stack-default-directory ()
+ "Find a directory to run haskell-stack-ghc.
+
+Return a parent directory with a stack*.y[a]ml file, or the
+directory returned by \"stack path --project-root\"."
+ (or
+ (when (buffer-file-name)
+ (flycheck--locate-dominating-file-matching
+ (file-name-directory (buffer-file-name))
+ (rx "stack" (* any) "." (or "yml" "yaml") eos)))
+ (-when-let* ((stack (funcall flycheck-executable-find "stack"))
+ (output (ignore-errors
+ (process-lines stack
+ "--no-install-ghc"
+ "path" "--project-root")))
+ (stack-dir (car output)))
+ (and (file-directory-p stack-dir) stack-dir))))
+
+(defun flycheck-haskell--ghc-find-default-directory (_checker)
+ "Find a parent directory containing a cabal or package.yaml file."
+ (when (buffer-file-name)
+ (flycheck--locate-dominating-file-matching
+ (file-name-directory (buffer-file-name))
+ "\\.cabal\\'\\|\\`package\\.yaml\\'")))
+
+(flycheck-define-checker haskell-stack-ghc
+ "A Haskell syntax and type checker using `stack ghc'.
+
+See URL `https://github.com/commercialhaskell/stack'."
+ :command ("stack"
+ "--no-install-ghc"
+ (option "--stack-yaml" flycheck-ghc-stack-project-file)
+ (option-flag "--nix" flycheck-ghc-stack-use-nix)
+ "ghc" "--" "-Wall" "-no-link"
+ "-outputdir" (eval (flycheck-haskell-ghc-cache-directory))
+ (option-list "-X" flycheck-ghc-language-extensions concat)
+ (option-list "-i" flycheck-ghc-search-path concat)
+ (eval (concat
+ "-i"
+ (flycheck-module-root-directory
+ (flycheck-find-in-buffer flycheck-haskell-module-re))))
+ (eval flycheck-ghc-args)
+ "-x" (eval
+ (pcase major-mode
+ (`haskell-mode "hs")
+ (`haskell-literate-mode "lhs")))
+ source)
+ :error-patterns
+ ((warning line-start (file-name) ":" line ":" column ":"
+ (or " " "\n ") (in "Ww") "arning:"
+ (optional " " "[" (id (one-or-more not-newline)) "]")
+ (optional "\n")
+ (message
+ (one-or-more " ") (one-or-more not-newline)
+ (zero-or-more "\n"
+ (one-or-more " ")
+ (one-or-more (not (any ?\n ?|)))))
+ line-end)
+ (error line-start (file-name) ":" line ":" column ":" (optional " error:")
+ (or (message (one-or-more not-newline))
+ (and "\n"
+ (message
+ (one-or-more " ") (one-or-more not-newline)
+ (zero-or-more "\n"
+ (one-or-more " ")
+ (one-or-more (not (any ?\n ?|)))))))
+ line-end))
+ :error-filter
+ (lambda (errors)
+ (flycheck-sanitize-errors (flycheck-dedent-error-messages errors)))
+ :modes (haskell-mode haskell-literate-mode)
+ :next-checkers ((warning . haskell-hlint))
+ :working-directory (lambda (_)
+ (flycheck-haskell--find-stack-default-directory))
+ :enabled flycheck-haskell--find-stack-default-directory
+ :verify (lambda (_)
+ (let* ((stack (flycheck-haskell--find-stack-default-directory)))
+ (list
+ (flycheck-verification-result-new
+ :label "stack config"
+ :message (or stack "Not found")
+ :face (if stack 'success '(bold error)))))))
+
+(flycheck-define-checker haskell-ghc
+ "A Haskell syntax and type checker using ghc.
+
+See URL `https://www.haskell.org/ghc/'."
+ :command ("ghc" "-Wall" "-no-link"
+ "-outputdir" (eval (flycheck-haskell-ghc-cache-directory))
+ (option-flag "-no-user-package-db"
+ flycheck-ghc-no-user-package-database)
+ (option-list "-package-db" flycheck-ghc-package-databases)
+ (option-list "-i" flycheck-ghc-search-path concat)
+ ;; Include the parent directory of the current module tree, to
+ ;; properly resolve local imports
+ (eval (concat
+ "-i"
+ (flycheck-module-root-directory
+ (flycheck-find-in-buffer flycheck-haskell-module-re))))
+ (option-list "-X" flycheck-ghc-language-extensions concat)
+ (eval flycheck-ghc-args)
+ "-x" (eval
+ (pcase major-mode
+ (`haskell-mode "hs")
+ (`haskell-literate-mode "lhs")))
+ source)
+ :error-patterns
+ ((warning line-start (file-name) ":" line ":" column ":"
+ (or " " "\n ") (in "Ww") "arning:"
+ (optional " " "[" (id (one-or-more not-newline)) "]")
+ (optional "\n")
+ (message
+ (one-or-more " ") (one-or-more not-newline)
+ (zero-or-more "\n"
+ (one-or-more " ")
+ (one-or-more (not (any ?\n ?|)))))
+ line-end)
+ (error line-start (file-name) ":" line ":" column ":" (optional " error:")
+ (or (message (one-or-more not-newline))
+ (and "\n"
+ (message
+ (one-or-more " ") (one-or-more not-newline)
+ (zero-or-more "\n"
+ (one-or-more " ")
+ (one-or-more (not (any ?\n ?|)))))))
+ line-end))
+ :error-filter
+ (lambda (errors)
+ (flycheck-sanitize-errors (flycheck-dedent-error-messages errors)))
+ :modes (haskell-mode haskell-literate-mode)
+ :next-checkers ((warning . haskell-hlint))
+ :working-directory flycheck-haskell--ghc-find-default-directory)
+
+(flycheck-def-config-file-var flycheck-hlintrc haskell-hlint "HLint.hs")
+
+(flycheck-def-args-var flycheck-hlint-args haskell-hlint
+ :package-version '(flycheck . "0.25"))
+
+(flycheck-def-option-var flycheck-hlint-language-extensions
+ nil haskell-hlint
+ "Extensions list to enable for hlint.
+
+The value of this variable is a list of strings, where each
+string is a name of extension to enable in
+hlint (e.g. \"QuasiQuotes\")."
+ :type '(repeat :tag "Extensions" (string :tag "Extension"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.24"))
+
+(flycheck-def-option-var flycheck-hlint-ignore-rules
+ nil haskell-hlint
+ "Ignore rules list for hlint checks.
+
+The value of this variable is a list of strings, where each
+string is an ignore rule (e.g. \"Use fmap\")."
+ :type '(repeat :tag "Ignore rules" (string :tag "Ignore rule"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.24"))
+
+(flycheck-def-option-var flycheck-hlint-hint-packages
+ nil haskell-hlint
+ "Hint packages to include for hlint checks.
+
+The value of this variable is a list of strings, where each
+string is a default hint package (e.g. (\"Generalise\"
+\"Default\" \"Dollar\"))."
+ :type '(repeat :tag "Hint packages" (string :tag "Hint package"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.24"))
+
+(flycheck-define-checker haskell-hlint
+ "A Haskell style checker using hlint.
+
+See URL `https://github.com/ndmitchell/hlint'."
+ :command ("hlint"
+ (option-list "-X" flycheck-hlint-language-extensions concat)
+ (option-list "-i=" flycheck-hlint-ignore-rules concat)
+ (option-list "-h" flycheck-hlint-hint-packages concat)
+ (config-file "-h" flycheck-hlintrc)
+ (eval flycheck-hlint-args)
+ source-inplace)
+ :error-patterns
+ ((info line-start
+ (file-name) ":" line ":" column (optional "-" end-column)
+ ": Suggestion: "
+ (message (one-or-more (and (one-or-more (not (any ?\n))) ?\n)))
+ line-end)
+ (warning line-start
+ (file-name) ":" line ":" column (optional "-" end-column)
+ ": Warning: "
+ (message (one-or-more (and (one-or-more (not (any ?\n))) ?\n)))
+ line-end)
+ (error line-start
+ (file-name) ":" line ":" column (optional "-" end-column)
+ ": Error: "
+ (message (one-or-more (and (one-or-more (not (any ?\n))) ?\n)))
+ line-end))
+ :modes (haskell-mode haskell-literate-mode))
+
+(flycheck-def-config-file-var flycheck-tidyrc html-tidy ".tidyrc")
+
+(flycheck-define-checker html-tidy
+ "A HTML syntax and style checker using Tidy.
+
+See URL `https://github.com/htacg/tidy-html5'."
+ :command ("tidy" (config-file "-config" flycheck-tidyrc)
+ "-lang" "en"
+ "-e" "-q")
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ "line " line
+ " column " column
+ " - Error: " (message) line-end)
+ (warning line-start
+ "line " line
+ " column " column
+ " - Warning: " (message) line-end))
+ :modes (html-mode mhtml-mode nxhtml-mode))
+
+(flycheck-def-config-file-var flycheck-jshintrc javascript-jshint ".jshintrc")
+
+(flycheck-def-option-var flycheck-jshint-extract-javascript nil
+ javascript-jshint
+ "Whether jshint should extract Javascript from HTML.
+
+If nil no extract rule is given to jshint. If `auto' only
+extract Javascript if a HTML file is detected. If `always' or
+`never' extract Javascript always or never respectively.
+
+Refer to the jshint manual at the URL
+`http://jshint.com/docs/cli/#flags' for more information."
+ :type
+ '(choice (const :tag "No extraction rule" nil)
+ (const :tag "Try to extract Javascript when detecting HTML files"
+ auto)
+ (const :tag "Always try to extract Javascript" always)
+ (const :tag "Never try to extract Javascript" never))
+ :safe #'symbolp
+ :package-version '(flycheck . "26"))
+
+(flycheck-define-checker javascript-jshint
+ "A Javascript syntax and style checker using jshint.
+
+See URL `http://www.jshint.com'."
+ :command ("jshint" "--reporter=checkstyle"
+ "--filename" source-original
+ (config-file "--config" flycheck-jshintrc)
+ (option "--extract=" flycheck-jshint-extract-javascript
+ concat flycheck-option-symbol)
+ "-")
+ :standard-input t
+ :error-parser flycheck-parse-checkstyle
+ :error-filter
+ (lambda (errors)
+ (flycheck-remove-error-file-names
+ "stdin" (flycheck-dequalify-error-ids errors)))
+ :modes (js-mode js2-mode js3-mode rjsx-mode))
+
+(flycheck-def-args-var flycheck-eslint-args javascript-eslint
+ :package-version '(flycheck . "32"))
+
+(flycheck-def-option-var flycheck-eslint-rules-directories nil javascript-eslint
+ "A list of directories with custom rules for ESLint.
+
+The value of this variable is a list of strings, where each
+string is a directory with custom rules for ESLint.
+
+Refer to the ESLint manual at URL
+`http://eslint.org/docs/user-guide/command-line-interface#--rulesdir'
+for more information about the custom directories."
+ :type '(repeat (directory :tag "Custom rules directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "29"))
+
+(defun flycheck-eslint-config-exists-p ()
+ "Whether there is a valid eslint config for the current buffer."
+ (eql 0 (flycheck-call-checker-process
+ 'javascript-eslint nil nil nil
+ "--print-config" (or buffer-file-name "index.js"))))
+
+(defun flycheck-parse-eslint (output checker buffer)
+ "Parse ESLint errors/warnings from JSON OUTPUT.
+
+CHECKER and BUFFER denote the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively.
+
+See URL `https://eslint.org' for more information about ESLint."
+ (mapcar (lambda (err)
+ (let-alist err
+ (flycheck-error-new-at
+ .line
+ .column
+ (pcase .severity
+ (2 'error)
+ (1 'warning)
+ (_ 'warning))
+ .message
+ :id .ruleId
+ :checker checker
+ :buffer buffer
+ :filename (buffer-file-name buffer)
+ :end-line .endLine
+ :end-column .endColumn)))
+ (let-alist (caar (flycheck-parse-json output))
+ .messages)))
+
+(defun flycheck-eslint--find-working-directory (_checker)
+ "Look for a working directory to run ESLint CHECKER in.
+
+This will be the directory that contains the `node_modules'
+directory. If no such directory is found in the directory
+hierarchy, it looks first for `.eslintignore' and then for
+`.eslintrc' files to detect the project root."
+ (let* ((regex-config (concat "\\`\\.eslintrc"
+ "\\(\\.\\(js\\|ya?ml\\|json\\)\\)?\\'")))
+ (when buffer-file-name
+ (or (locate-dominating-file buffer-file-name "node_modules")
+ (locate-dominating-file buffer-file-name ".eslintignore")
+ (locate-dominating-file
+ (file-name-directory buffer-file-name)
+ (lambda (directory)
+ (> (length (directory-files directory nil regex-config t)) 0)))))))
+
+(flycheck-define-checker javascript-eslint
+ "A Javascript syntax and style checker using eslint.
+
+See URL `https://eslint.org/'."
+ :command ("eslint" "--format=json"
+ (option-list "--rulesdir" flycheck-eslint-rules-directories)
+ (eval flycheck-eslint-args)
+ "--stdin" "--stdin-filename" source-original)
+ :standard-input t
+ :error-parser flycheck-parse-eslint
+ :enabled (lambda () (flycheck-eslint-config-exists-p))
+ :modes (js-mode js-jsx-mode js2-mode js2-jsx-mode js3-mode rjsx-mode
+ typescript-mode)
+ :working-directory flycheck-eslint--find-working-directory
+ :verify
+ (lambda (_)
+ (let* ((default-directory
+ (flycheck-compute-working-directory 'javascript-eslint))
+ (have-config (flycheck-eslint-config-exists-p)))
+ (list
+ (flycheck-verification-result-new
+ :label "config file"
+ :message (if have-config "found" "missing or incorrect")
+ :face (if have-config 'success '(bold error))))))
+ :error-explainer
+ (lambda (err)
+ (let ((error-code (flycheck-error-id err))
+ (url "https://eslint.org/docs/rules/%s"))
+ (and error-code
+ ;; skip non-builtin rules
+ (not ;; `seq-contains-p' is only in seq >= 2.21
+ (with-no-warnings (seq-contains error-code ?/)))
+ `(url . ,(format url error-code))))))
+
+(flycheck-define-checker javascript-standard
+ "A Javascript code and style checker for the (Semi-)Standard Style.
+
+This checker works with `standard' and `semistandard', defaulting
+to the former. To use it with the latter, set
+`flycheck-javascript-standard-executable' to `semistandard'.
+
+See URL `https://github.com/standard/standard' and URL
+`https://github.com/Flet/semistandard'."
+ :command ("standard" "--stdin")
+ :standard-input t
+ :error-patterns
+ ((error line-start " <text>:" line ":" column ":" (message) line-end))
+ :modes (js-mode js-jsx-mode js2-mode js2-jsx-mode js3-mode rjsx-mode))
+
+(flycheck-define-checker json-jsonlint
+ "A JSON syntax and style checker using jsonlint.
+
+See URL `https://github.com/zaach/jsonlint'."
+ ;; We can't use standard input for jsonlint, because it doesn't output errors
+ ;; anymore when using -c -q with standard input :/
+ :command ("jsonlint" "-c" "-q" source)
+ :error-patterns
+ ((error line-start
+ (file-name)
+ ": line " line
+ ", col " column ", "
+ (message) line-end))
+ :error-filter
+ (lambda (errors)
+ (flycheck-sanitize-errors (flycheck-increment-error-columns errors)))
+ :modes json-mode)
+
+(flycheck-define-checker json-python-json
+ "A JSON syntax checker using Python json.tool module.
+
+See URL `https://docs.python.org/3.5/library/json.html#command-line-interface'."
+ :command ("python3" "-m" "json.tool" source
+ ;; Send the pretty-printed output to the null device
+ null-device)
+ :error-patterns
+ ((error line-start
+ (message) ": line " line " column " column
+ ;; Ignore the rest of the line which shows the char position.
+ (one-or-more not-newline)
+ line-end))
+ :modes json-mode
+ ;; The JSON parser chokes if the buffer is empty and has no JSON inside
+ :predicate flycheck-buffer-nonempty-p)
+
+(flycheck-define-checker json-jq
+ "JSON checker using the jq tool.
+
+This checker accepts multiple consecutive JSON values in a
+single input, which is useful for jsonlines data.
+
+See URL `https://stedolan.github.io/jq/'."
+ :command ("jq" "." source null-device)
+ ;; Example error message:
+ ;; parse error: Expected another key-value pair at line 3, column 1
+ :error-patterns
+ ((error line-start
+ (optional "parse error: ")
+ (message) "at line " line ", column " column
+ (zero-or-more not-newline) line-end))
+ :modes json-mode)
+
+(flycheck-define-checker jsonnet
+ "A Jsonnet syntax checker using the jsonnet binary.
+
+See URL `https://jsonnet.org'."
+ :command ("jsonnet" source-inplace)
+ :error-patterns
+ ((error line-start "STATIC ERROR: " (file-name) ":"
+ (or (seq line ":" column (zero-or-one (seq "-" end-column)))
+ (seq "(" line ":" column ")" "-"
+ "(" end-line ":" end-column ")"))
+ ": " (message) line-end)
+ (error line-start "RUNTIME ERROR: " (message) "\n"
+ (? "\t" (file-name) ":" ;; first line of the backtrace
+ (or (seq line ":" column (zero-or-one (seq "-" end-column)))
+ (seq "(" line ":" column ")" "-"
+ "(" end-line ":" end-column ")")))))
+ :error-filter
+ (lambda (errs)
+ ;; Some errors are missing line numbers. See URL
+ ;; `https://github.com/google/jsonnet/issues/786'.
+ (dolist (err errs)
+ (unless (flycheck-error-line err)
+ (setf (flycheck-error-line err) 1)))
+ (flycheck-sanitize-errors errs))
+ :modes jsonnet-mode)
+
+(flycheck-define-checker less
+ "A LESS syntax checker using lessc.
+
+Requires lessc 1.4 or newer.
+
+See URL `http://lesscss.org'."
+ :command ("lessc" "--lint" "--no-color"
+ "-")
+ :standard-input t
+ :error-patterns
+ ((error line-start (one-or-more word) ":"
+ (message)
+ " in - on line " line
+ ", column " column ":"
+ line-end))
+ :modes less-css-mode)
+
+(flycheck-define-checker less-stylelint
+ "A LESS syntax and style checker using stylelint.
+
+See URL `http://stylelint.io/'."
+ :command ("stylelint"
+ (eval flycheck-stylelint-args)
+ "--syntax" "less"
+ (option-flag "--quiet" flycheck-stylelint-quiet)
+ (config-file "--config" flycheck-stylelintrc))
+ :standard-input t
+ :error-parser flycheck-parse-stylelint
+ :predicate flycheck-buffer-nonempty-p
+ :modes (less-css-mode))
+
+(flycheck-define-checker llvm-llc
+ "Flycheck LLVM IR checker using llc.
+
+See URL `http://llvm.org/docs/CommandGuide/llc.html'."
+ :command ("llc" "-o" null-device source)
+ :error-patterns
+ ((error line-start
+ ;; llc prints the executable path
+ (zero-or-one (minimal-match (one-or-more not-newline)) ": ")
+ (file-name) ":" line ":" column ": error: " (message)
+ line-end))
+ :error-filter
+ (lambda (errors)
+ ;; sanitize errors occurring in inline assembly
+ (flycheck-sanitize-errors
+ (flycheck-remove-error-file-names "<inline asm>" errors)))
+ :modes llvm-mode)
+
+(flycheck-def-config-file-var flycheck-luacheckrc lua-luacheck ".luacheckrc")
+
+(flycheck-def-option-var flycheck-luacheck-standards nil lua-luacheck
+ "The standards to use in luacheck.
+
+The value of this variable is either a list of strings denoting
+the standards to use, or nil to pass nothing to luacheck. When
+non-nil, pass the standards via one or more `--std' options."
+ :type '(choice (const :tag "Default" nil)
+ (repeat :tag "Custom standards"
+ (string :tag "Standard name")))
+ :safe #'flycheck-string-list-p)
+(make-variable-buffer-local 'flycheck-luacheck-standards)
+
+(flycheck-define-checker lua-luacheck
+ "A Lua syntax checker using luacheck.
+
+See URL `https://github.com/mpeterv/luacheck'."
+ :command ("luacheck"
+ "--formatter" "plain"
+ "--codes" ; Show warning codes
+ "--no-color"
+ (option-list "--std" flycheck-luacheck-standards)
+ (config-file "--config" flycheck-luacheckrc)
+ "--filename" source-original
+ ;; Read from standard input
+ "-")
+ :standard-input t
+ :error-patterns
+ ((warning line-start
+ (optional (file-name))
+ ":" line ":" column
+ ": (" (id "W" (one-or-more digit)) ") "
+ (message) line-end)
+ (error line-start
+ (optional (file-name))
+ ":" line ":" column ":"
+ ;; `luacheck' before 0.11.0 did not output codes for errors, hence
+ ;; the ID is optional here
+ (optional " (" (id "E" (one-or-more digit)) ") ")
+ (message) line-end))
+ :modes lua-mode)
+
+(flycheck-define-checker lua
+ "A Lua syntax checker using the Lua compiler.
+
+See URL `http://www.lua.org/'."
+ :command ("luac" "-p" "-")
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ ;; Skip the name of the luac executable.
+ (minimal-match (zero-or-more not-newline))
+ ": stdin:" line ": " (message) line-end))
+ :modes lua-mode)
+
+(flycheck-define-checker opam
+ "A Opam syntax and style checker using opam lint.
+
+See URL `https://opam.ocaml.org/doc/man/opam-lint.html'."
+ :command ("opam" "lint" "-")
+ :standard-input t
+ :error-patterns
+ ((error line-start ; syntax error
+ (one-or-more space) "error " (id ?2)
+ ": File format error"
+ (or (and " at line " line ", column " column ": " (message))
+ (and ": " (message)))
+ line-end)
+ (error line-start
+ (one-or-more space) "error " (id ?3)
+ (minimal-match (zero-or-more not-newline))
+ "at line " line ", column " column ": " (message)
+ line-end)
+ (error line-start
+ (one-or-more space) "error " (id (one-or-more num))
+ ": " (message (one-or-more not-newline))
+ line-end)
+ (warning line-start
+ (one-or-more space) "warning " (id (one-or-more num))
+ ": " (message)
+ line-end))
+ :error-filter
+ (lambda (errors)
+ (flycheck-increment-error-columns
+ (flycheck-fill-empty-line-numbers errors)))
+ :modes tuareg-opam-mode)
+
+(flycheck-def-option-var flycheck-perl-include-path nil perl
+ "A list of include directories for Perl.
+
+The value of this variable is a list of strings, where each
+string is a directory to add to the include path of Perl.
+Relative paths are relative to the file being checked."
+ :type '(repeat (directory :tag "Include directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.24"))
+
+(flycheck-def-option-var flycheck-perl-module-list nil perl
+ "A list of modules to use for Perl.
+
+The value of this variable is a list of strings, where each
+string is a module to 'use' in Perl."
+ :type '(repeat :tag "Module")
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "32"))
+
+(flycheck-define-checker perl
+ "A Perl syntax checker using the Perl interpreter.
+
+See URL `https://www.perl.org'."
+ :command ("perl" "-w" "-c"
+ (option-list "-I" flycheck-perl-include-path)
+ (option-list "-M" flycheck-perl-module-list concat))
+ :standard-input t
+ :error-patterns
+ ((error line-start (minimal-match (message))
+ " at - line " line
+ (or "." (and ", " (zero-or-more not-newline))) line-end))
+ :modes (perl-mode cperl-mode)
+ :next-checkers (perl-perlcritic))
+
+(flycheck-def-option-var flycheck-perlcritic-severity nil perl-perlcritic
+ "The message severity for Perl Critic.
+
+The value of this variable is a severity level as integer, for
+the `--severity' option to Perl Critic."
+ :type '(integer :tag "Severity level")
+ :safe #'integerp
+ :package-version '(flycheck . "0.18"))
+
+(flycheck-def-option-var flycheck-perlcritic-theme nil perl-perlcritic
+ "The theme expression for Perl Critic.
+
+The value of this variable is passed as the `--theme' option to
+`Perl::Critic'. See the documentation of `Perl::Critic' for
+details."
+ :type '(choice (const :tag "None" nil)
+ (string :tag "Theme expression"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "32-csv"))
+
+(flycheck-def-config-file-var flycheck-perlcriticrc perl-perlcritic
+ ".perlcriticrc"
+ :package-version '(flycheck . "26"))
+
+(flycheck-define-checker perl-perlcritic
+ "A Perl syntax checker using Perl::Critic.
+
+See URL `https://metacpan.org/pod/Perl::Critic'."
+ :command ("perlcritic" "--no-color" "--verbose" "%f/%l/%c/%s/%p/%m (%e)\n"
+ (config-file "--profile" flycheck-perlcriticrc)
+ (option "--severity" flycheck-perlcritic-severity nil
+ flycheck-option-int)
+ (option "--theme" flycheck-perlcritic-theme))
+ :standard-input t
+ :error-patterns
+ ((info line-start
+ "STDIN/" line "/" column "/" (any "1") "/"
+ (id (one-or-more (not (any "/")))) "/" (message)
+ line-end)
+ (warning line-start
+ "STDIN/" line "/" column "/" (any "234") "/"
+ (id (one-or-more (not (any "/")))) "/" (message)
+ line-end)
+ (error line-start
+ "STDIN/" line "/" column "/" (any "5") "/"
+ (id (one-or-more (not (any "/")))) "/" (message)
+ line-end))
+ :modes (cperl-mode perl-mode))
+
+(flycheck-define-checker php
+ "A PHP syntax checker using the PHP command line interpreter.
+
+See URL `http://php.net/manual/en/features.commandline.php'."
+ :command ("php" "-l" "-d" "error_reporting=E_ALL" "-d" "display_errors=1"
+ "-d" "log_errors=0" source)
+ :error-patterns
+ ((error line-start (or "Parse" "Fatal" "syntax") " error" (any ":" ",") " "
+ (message) " in " (file-name) " on line " line line-end))
+ :modes (php-mode php+-mode)
+ :next-checkers ((warning . php-phpmd)
+ (warning . php-phpcs)))
+
+(flycheck-def-option-var flycheck-phpmd-rulesets
+ '("cleancode" "codesize" "controversial" "design" "naming" "unusedcode")
+ php-phpmd
+ "The rule sets for PHP Mess Detector.
+
+Set default rule sets and custom rule set files.
+
+See section \"Using multiple rule sets\" in the PHP Mess Detector
+manual at URL `https://phpmd.org/documentation/index.html'."
+ :type '(repeat :tag "rule sets"
+ (string :tag "A filename or rule set"))
+ :safe #'flycheck-string-list-p)
+
+(flycheck-define-checker php-phpmd
+ "A PHP style checker using PHP Mess Detector.
+
+See URL `https://phpmd.org/'."
+ :command ("phpmd" source "xml"
+ (eval (flycheck-option-comma-separated-list
+ flycheck-phpmd-rulesets)))
+ :error-parser flycheck-parse-phpmd
+ :modes (php-mode php+-mode)
+ :next-checkers (php-phpcs))
+
+(flycheck-def-option-var flycheck-phpcs-standard nil php-phpcs
+ "The coding standard for PHP CodeSniffer.
+
+When nil, use the default standard from the global PHP
+CodeSniffer configuration. When set to a string, pass the string
+to PHP CodeSniffer which will interpret it as name as a standard,
+or as path to a standard specification."
+ :type '(choice (const :tag "Default standard" nil)
+ (string :tag "Standard name or file"))
+ :safe #'flycheck-string-or-nil-p)
+
+(flycheck-define-checker php-phpcs
+ "A PHP style checker using PHP Code Sniffer.
+
+Needs PHP Code Sniffer 2.6 or newer.
+
+See URL `http://pear.php.net/package/PHP_CodeSniffer/'."
+ :command ("phpcs" "--report=checkstyle"
+ ;; Use -q flag to force quiet mode
+ ;; Quiet mode prevents errors from extra output when phpcs has
+ ;; been configured with show_progress enabled
+ "-q"
+ (option "--standard=" flycheck-phpcs-standard concat)
+ ;; Some files are not detected correctly
+ ;; so it is necessary to pass the extension.
+ (eval
+ (-when-let* ((fname buffer-file-name)
+ (ext (file-name-extension fname)))
+ (concat "--extensions=" ext)))
+
+ ;; Pass original file name to phpcs. We need to concat explicitly
+ ;; here, because phpcs really insists to get option and argument as
+ ;; a single command line argument :|
+ (eval (when (buffer-file-name)
+ (concat "--stdin-path=" (buffer-file-name))))
+ ;; Read from standard input
+ "-")
+ :standard-input t
+ :error-parser flycheck-parse-checkstyle
+ :error-filter
+ (lambda (errors)
+ (flycheck-sanitize-errors
+ (flycheck-remove-error-file-names "STDIN" errors)))
+ :modes (php-mode php+-mode)
+ ;; phpcs seems to choke on empty standard input, hence skip phpcs if the
+ ;; buffer is empty, see https://github.com/flycheck/flycheck/issues/907
+ :predicate flycheck-buffer-nonempty-p)
+
+(flycheck-define-checker processing
+ "Processing command line tool.
+
+See https://github.com/processing/processing/wiki/Command-Line"
+ :command ("processing-java" "--force"
+ ;; Don't change the order of these arguments, processing is pretty
+ ;; picky
+ (eval (concat "--sketch=" (file-name-directory (buffer-file-name))))
+ (eval (concat "--output=" (flycheck-temp-dir-system)))
+ "--build")
+ :error-patterns
+ ((error line-start (file-name) ":" line ":" column
+ (zero-or-more (or digit ":")) (message) line-end))
+ :modes processing-mode
+ ;; This syntax checker needs a file name
+ :predicate (lambda () (buffer-file-name)))
+
+(defun flycheck-proselint-parse-errors (output checker buffer)
+ "Parse proselint json output errors from OUTPUT.
+
+CHECKER and BUFFER denoted the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively.
+
+See URL `http://proselint.com/' for more information about proselint."
+ (mapcar (lambda (err)
+ (let-alist err
+ (flycheck-error-new-at-pos
+ .start
+ (pcase .severity
+ (`"suggestion" 'info)
+ (`"warning" 'warning)
+ (`"error" 'error)
+ ;; Default to error
+ (_ 'error))
+ .message
+ :id .check
+ :buffer buffer
+ :checker checker
+ ;; See https://github.com/amperser/proselint/issues/1048
+ :end-pos .end)))
+ (let-alist (car (flycheck-parse-json output))
+ .data.errors)))
+
+(flycheck-define-checker proselint
+ "Flycheck checker using Proselint.
+
+See URL `http://proselint.com/'."
+ :command ("proselint" "--json" "-")
+ :standard-input t
+ :error-parser flycheck-proselint-parse-errors
+ :modes (text-mode markdown-mode gfm-mode message-mode org-mode))
+
+(flycheck-def-option-var flycheck-protoc-import-path nil protobuf-protoc
+ "A list of directories to resolve import directives.
+
+The value of this variable is a list of strings, where each
+string is a directory to add to the import path. Relative paths
+are relative to the file being checked."
+ :type '(repeat (directory :tag "Import directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "32"))
+
+(flycheck-define-checker protobuf-protoc
+ "A protobuf syntax checker using the protoc compiler.
+
+See URL `https://developers.google.com/protocol-buffers/'."
+ :command ("protoc" "--error_format" "gcc"
+ (eval (concat "--java_out=" (flycheck-temp-dir-system)))
+ ;; Add the current directory to resolve imports
+ (eval (concat "--proto_path="
+ (file-name-directory (buffer-file-name))))
+ ;; Add other import paths; this needs to be after the current
+ ;; directory to produce the right output. See URL
+ ;; `https://github.com/flycheck/flycheck/pull/1655'
+ (option-list "--proto_path=" flycheck-protoc-import-path concat)
+ source-inplace)
+ :error-patterns
+ ((info line-start (file-name) ":" line ":" column
+ ": note: " (message) line-end)
+ (error line-start (file-name) ":" line ":" column
+ ": " (message) line-end)
+ (error line-start
+ (message "In file included from") " " (file-name) ":" line ":"
+ column ":" line-end))
+ :modes protobuf-mode
+ :predicate (lambda () (buffer-file-name)))
+
+(defun flycheck-prototool-project-root (&optional _checker)
+ "Return the nearest directory holding the prototool.yaml configuration."
+ (and buffer-file-name
+ (locate-dominating-file buffer-file-name "prototool.yaml")))
+
+(flycheck-define-checker protobuf-prototool
+ "A protobuf syntax checker using prototool.
+
+See URL `https://github.com/uber/prototool'."
+ :command ("prototool" "lint" source-original)
+ :error-patterns
+ ((warning line-start (file-name) ":" line ":" column ":" (message) line-end))
+ :modes protobuf-mode
+ :enabled flycheck-prototool-project-root
+ :predicate flycheck-buffer-saved-p)
+
+(flycheck-define-checker pug
+ "A Pug syntax checker using the pug compiler.
+
+See URL `https://pugjs.org/'."
+ :command ("pug" "-p" (eval (expand-file-name (buffer-file-name))))
+ :standard-input t
+ :error-patterns
+ ;; errors with includes/extends (e.g. missing files)
+ ((error "Error: " (message) (zero-or-more not-newline) "\n"
+ (zero-or-more not-newline) "at "
+ (zero-or-more not-newline) " line " line)
+ ;; error when placing anything other than a mixin or
+ ;; block at the top-level of an extended template
+ ;; also unknown filters
+ (error line-start "Error: " (file-name) ":"
+ line ":" column "\n\n" (message) line-end)
+ ;; syntax/runtime errors (e.g. type errors, bad indentation, etc.)
+ (error line-start
+ (optional "Type") "Error: " (file-name) ":"
+ line (optional ":" column)
+ (zero-or-more not-newline) "\n"
+ (one-or-more (or (zero-or-more not-newline) "|"
+ (zero-or-more not-newline) "\n")
+ (zero-or-more "-") (zero-or-more not-newline) "|"
+ (zero-or-more not-newline) "\n")
+ (zero-or-more not-newline) "\n"
+ (one-or-more
+ (zero-or-more not-newline) "|"
+ (zero-or-more not-newline) "\n")
+ (zero-or-more not-newline) "\n"
+ (message)
+ line-end))
+ :modes pug-mode)
+
+(flycheck-define-checker puppet-parser
+ "A Puppet DSL syntax checker using puppet's own parser.
+
+See URL `https://puppet.com/'."
+ :command ("puppet" "parser" "validate" "--color=false")
+ :standard-input t
+ :error-patterns
+ (
+ ;; Patterns for Puppet 4
+ (error line-start "Error: Could not parse for environment "
+ (one-or-more (in "a-z" "0-9" "_")) ":"
+ (message) "(line: " line ", column: " column ")" line-end)
+ ;; Errors from Puppet < 4
+ (error line-start "Error: Could not parse for environment "
+ (one-or-more (in "a-z" "0-9" "_")) ":"
+ (message (minimal-match (one-or-more anything)))
+ " at line " line line-end)
+ (error line-start
+ ;; Skip over the path of the Puppet executable
+ (minimal-match (zero-or-more not-newline))
+ ": Could not parse for environment " (one-or-more word)
+ ": " (message (minimal-match (zero-or-more anything)))
+ " at " (file-name "/" (zero-or-more not-newline)) ":" line line-end))
+ :modes puppet-mode
+ :next-checkers ((warning . puppet-lint)))
+
+(flycheck-def-config-file-var flycheck-puppet-lint-rc puppet-lint
+ ".puppet-lint.rc"
+ :package-version '(flycheck . "26"))
+
+(flycheck-def-option-var flycheck-puppet-lint-disabled-checks nil puppet-lint
+ "Disabled checkers for `puppet-lint'.
+
+The value of this variable is a list of strings, where each
+string is the name of a check to disable (e.g. \"80chars\" or
+\"double_quoted_strings\").
+
+See URL `http://puppet-lint.com/checks/' for a list of all checks
+and their names."
+ :type '(repeat (string :tag "Check Name"))
+ :package-version '(flycheck . "26"))
+
+(defun flycheck-puppet-lint-disabled-arg-name (check)
+ "Create an argument to disable a puppetlint CHECK."
+ (concat "--no-" check "-check"))
+
+(flycheck-define-checker puppet-lint
+ "A Puppet DSL style checker using puppet-lint.
+
+See URL `http://puppet-lint.com/'."
+ ;; We must check the original file, because Puppetlint is quite picky on the
+ ;; names of files and there place in the directory structure, to comply with
+ ;; Puppet's autoload directory layout. For instance, a class foo::bar is
+ ;; required to be in a file foo/bar.pp. Any other place, such as a Flycheck
+ ;; temporary file will cause an error.
+ :command ("puppet-lint"
+ (config-file "--config" flycheck-puppet-lint-rc)
+ "--log-format"
+ "%{path}:%{line}:%{kind}: %{message} (%{check})"
+ (option-list "" flycheck-puppet-lint-disabled-checks concat
+ flycheck-puppet-lint-disabled-arg-name)
+ source-original)
+ :error-patterns
+ ((warning line-start (file-name) ":" line ":warning: " (message) line-end)
+ (error line-start (file-name) ":" line ":error: " (message) line-end))
+ :modes puppet-mode
+ ;; Since we check the original file, we can only use this syntax checker if
+ ;; the buffer is actually linked to a file, and if it is not modified.
+ :predicate flycheck-buffer-saved-p)
+
+(defun flycheck-python-run-snippet (checker snippet)
+ "Run a python SNIPPET and return the output.
+
+CHECKER's executable is assumed to be a Python REPL."
+ (-when-let (output (flycheck-call-checker-process-for-output
+ checker nil nil "-c" snippet))
+ (string-trim output)))
+
+(defun flycheck-python-get-path (checker)
+ "Compute the current Python path (CHECKER is a Python REPL) ."
+ (flycheck-python-run-snippet checker "import sys; print(sys.path[1:])"))
+
+(defun flycheck-python-find-module (checker module)
+ "Check if a Python MODULE is available (CHECKER is a Python REPL)."
+ (flycheck-python-run-snippet
+ checker (concat "import sys; sys.path.pop(0);"
+ (format "import %s; print(%s.__file__)" module module))))
+
+(defun flycheck-python-needs-module-p (checker)
+ "Determines whether CHECKER needs to be invoked through Python.
+
+Previous versions of Flycheck called pylint and flake8 directly,
+while new version call them through `python -c'. This check
+ensures that we don't break existing code; it also allows people
+who use virtualenvs to run globally-installed checkers."
+ (not (string-match-p (rx (or "pylint" "pylint3" "flake8")
+ (or "-script.pyw" ".exe" ".bat" "")
+ eos)
+ (flycheck-checker-executable checker))))
+
+(defun flycheck-python-verify-module (checker module)
+ "Verify that a Python MODULE is available.
+
+Return nil if CHECKER's executable is not a Python REPL. This
+function's is suitable for a checker's :verify."
+ (when (flycheck-python-needs-module-p checker)
+ (let ((mod-path (flycheck-python-find-module checker module)))
+ (list (flycheck-verification-result-new
+ :label (format "`%s' module" module)
+ :message (if mod-path (format "Found at %S" mod-path)
+ (format "Missing; sys.path is %s"
+ (flycheck-python-get-path checker)))
+ :face (if mod-path 'success '(bold error)))))))
+
+(defun flycheck-python-module-args (checker module-name)
+ "Compute arguments to pass to CHECKER's executable to run MODULE-NAME.
+
+Return nil if CHECKER's executable is not a Python REPL.
+Otherwise, return a list starting with -c (-m is not enough
+because it adds the current directory to Python's path)."
+ (when (flycheck-python-needs-module-p checker)
+ `("-c" ,(concat "import sys;sys.path.pop(0);import runpy;"
+ (format "runpy.run_module(%S)" module-name)))))
+
+(defcustom flycheck-python-project-files
+ '("pyproject.toml" "setup.cfg" "mypy.ini" "pyrightconfig.json")
+ "Files used to find where to run Python checkers from.
+Currently used for pylint, flake8, and pyright.
+
+The presence of one in these files indicates the root of the
+current project; `.pylintrc' is not part of the list because it
+is commonly found in ~/."
+ :group 'flycheck
+ :type '(repeat (string :tag "File name"))
+ :package-version '(flycheck . "0.33")
+ :safe #'flycheck-string-list-p)
+
+(defun flycheck-python-find-project-root (_checker)
+ "Find the root directory of a Python project.
+
+The root directory is assumed to be the nearest parent directory
+that contains one of `flycheck-python-project-files'. If no such
+file is found, we use the same heuristic as epylint: the nearest
+parent directory that doesn't have a __init__.py file."
+ (let ((start (if buffer-file-name
+ (file-name-directory buffer-file-name)
+ default-directory)))
+ (or (flycheck--locate-dominating-file-matching
+ start (regexp-opt flycheck-python-project-files))
+ (locate-dominating-file
+ start (lambda (dir)
+ (not (file-exists-p (expand-file-name "__init__.py" dir))))))))
+
+(flycheck-def-config-file-var flycheck-flake8rc python-flake8 ".flake8rc")
+
+(flycheck-def-option-var flycheck-flake8-error-level-alist
+ '(("^E9.*$" . error) ; Syntax errors from pep8
+ ("^F82.*$" . error) ; undefined variables from pyflakes
+ ("^F83.*$" . error) ; Duplicate arguments from flake8
+ ("^D.*$" . info) ; Docstring issues from flake8-pep257
+ ("^N.*$" . info) ; Naming issues from pep8-naming
+ )
+ python-flake8
+ "An alist mapping flake8 error IDs to Flycheck error levels.
+
+Each item in this list is a cons cell `(PATTERN . LEVEL)' where
+PATTERN is a regular expression matched against the error ID, and
+LEVEL is a Flycheck error level symbol.
+
+Each PATTERN is matched in the order of appearance in this list
+against the error ID. If it matches the ID, the level of the
+corresponding error is set to LEVEL. An error that is not
+matched by any PATTERN defaults to warning level.
+
+The default value of this option matches errors from flake8
+itself and from the following flake8 plugins:
+
+- pep8-naming
+- flake8-pep257
+
+You may add your own mappings to this option in order to support
+further flake8 plugins."
+ :type '(repeat (cons (regexp :tag "Error ID pattern")
+ (symbol :tag "Error level")))
+ :package-version '(flycheck . "0.22"))
+
+(flycheck-def-option-var flycheck-flake8-maximum-complexity nil python-flake8
+ "The maximum McCabe complexity of methods.
+
+If nil, do not check the complexity of methods. If set to an
+integer, report any complexity greater than the value of this
+variable as warning.
+
+If set to an integer, this variable overrules any similar setting
+in the configuration file denoted by `flycheck-flake8rc'."
+ :type '(choice (const :tag "Do not check McCabe complexity" nil)
+ (integer :tag "Maximum complexity"))
+ :safe #'integerp)
+
+(flycheck-def-option-var flycheck-flake8-maximum-line-length nil python-flake8
+ "The maximum length of lines.
+
+If set to an integer, the value of this variable denotes the
+maximum length of lines, overruling any similar setting in the
+configuration file denoted by `flycheck-flake8rc'. An error will
+be reported for any line longer than the value of this variable.
+
+If set to nil, use the maximum line length from the configuration
+file denoted by `flycheck-flake8rc', or the PEP 8 recommendation
+of 79 characters if there is no configuration with this setting."
+ :type '(choice (const :tag "Default value")
+ (integer :tag "Maximum line length in characters"))
+ :safe #'integerp)
+
+(defun flycheck-flake8-fix-error-level (err)
+ "Fix the error level of ERR.
+
+Update the error level of ERR according to
+`flycheck-flake8-error-level-alist'."
+ (pcase-dolist (`(,pattern . ,level) flycheck-flake8-error-level-alist)
+ (when (string-match-p pattern (flycheck-error-id err))
+ (setf (flycheck-error-level err) level)))
+ err)
+
+(defun flycheck-flake8--find-project-root (_checker)
+ "Find setup.cfg in a parent directory of the current buffer."
+ ;; This is a workaround for `https://gitlab.com/pycqa/flake8/issues/517'; see
+ ;; also `https://github.com/flycheck/flycheck/issues/1722'
+ (locate-dominating-file (or buffer-file-name default-directory) "setup.cfg"))
+
+(flycheck-define-checker python-flake8
+ "A Python syntax and style checker using Flake8.
+
+Requires Flake8 3.0 or newer. See URL
+`https://flake8.readthedocs.io/'."
+ ;; Not calling flake8 directly makes it easier to switch between different
+ ;; Python versions; see https://github.com/flycheck/flycheck/issues/1055.
+ :command ("python3"
+ (eval (flycheck-python-module-args 'python-flake8 "flake8"))
+ "--format=default"
+ (config-file "--append-config" flycheck-flake8rc)
+ (option "--max-complexity" flycheck-flake8-maximum-complexity nil
+ flycheck-option-int)
+ (option "--max-line-length" flycheck-flake8-maximum-line-length nil
+ flycheck-option-int)
+ (eval (when buffer-file-name
+ (concat "--stdin-display-name=" buffer-file-name)))
+ "-")
+ :standard-input t
+ :working-directory flycheck-python-find-project-root
+ :error-filter (lambda (errors)
+ (let ((errors (flycheck-sanitize-errors errors)))
+ (seq-map #'flycheck-flake8-fix-error-level errors)))
+ :error-patterns
+ ((warning line-start
+ (file-name) ":" line ":" (optional column ":") " "
+ (id (one-or-more (any alpha)) (one-or-more digit)) " "
+ (message (one-or-more not-newline))
+ line-end))
+ :enabled (lambda ()
+ (or (not (flycheck-python-needs-module-p 'python-flake8))
+ (flycheck-python-find-module 'python-flake8 "flake8")))
+ :verify (lambda (_) (flycheck-python-verify-module 'python-flake8 "flake8"))
+ :modes python-mode
+ :next-checkers ((warning . python-pylint)
+ (warning . python-mypy)))
+
+(flycheck-def-config-file-var
+ flycheck-pylintrc python-pylint
+ '("pylintrc" ".pylintrc" "pyproject.toml" "setup.cfg"))
+
+(flycheck-def-option-var flycheck-pylint-use-symbolic-id t python-pylint
+ "Whether to use pylint message symbols or message codes.
+
+A pylint message has both an opaque identifying code (such as `F0401') and a
+more meaningful symbolic code (such as `import-error'). This option governs
+which should be used and reported to the user."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.25"))
+
+(defun flycheck-parse-pylint (output checker buffer)
+ "Parse JSON OUTPUT of CHECKER on BUFFER as Pylint errors."
+ (mapcar (lambda (err)
+ (let-alist err
+ ;; Pylint can return -1 as a line or a column, hence the call to
+ ;; `max'. See `https://github.com/flycheck/flycheck/issues/1383'.
+ (flycheck-error-new-at
+ (and .line (max .line 1))
+ (and .column (max (1+ .column) 1))
+ (pcase .type
+ ;; See "pylint/utils.py"
+ ((or "fatal" "error") 'error)
+ ((or "info" "convention") 'info)
+ ((or "warning" "refactor" _) 'warning))
+ ;; Drop lines showing the error in context
+ (and (string-match (rx (*? nonl) eol) .message)
+ (match-string 0 .message))
+ :id (if flycheck-pylint-use-symbolic-id .symbol .message-id)
+ :checker checker
+ :buffer buffer
+ :filename .path)))
+ (car (flycheck-parse-json output))))
+
+(flycheck-define-checker python-pylint
+ "A Python syntax and style checker using Pylint.
+
+This syntax checker requires Pylint 1.0 or newer.
+
+See URL `https://www.pylint.org/'."
+ ;; --reports=n disables the scoring report.
+ ;; Not calling pylint directly makes it easier to switch between different
+ ;; Python versions; see https://github.com/flycheck/flycheck/issues/1055.
+ :command ("python3"
+ (eval (flycheck-python-module-args 'python-pylint "pylint"))
+ "--reports=n"
+ "--output-format=json"
+ (config-file "--rcfile=" flycheck-pylintrc concat)
+ ;; Need `source-inplace' for relative imports (e.g. `from .foo
+ ;; import bar'), see https://github.com/flycheck/flycheck/issues/280
+ source-inplace)
+ :error-parser flycheck-parse-pylint
+ :working-directory flycheck-python-find-project-root
+ :enabled (lambda ()
+ (or (not (flycheck-python-needs-module-p 'python-pylint))
+ (flycheck-python-find-module 'python-pylint "pylint")))
+ :verify (lambda (_) (flycheck-python-verify-module 'python-pylint "pylint"))
+ :error-explainer (lambda (err)
+ (-when-let (id (flycheck-error-id err))
+ (apply
+ #'flycheck-call-checker-process-for-output
+ 'python-pylint nil t
+ (append
+ (flycheck-python-module-args 'python-pylint "pylint")
+ (list (format "--help-msg=%s" id))))))
+ :modes python-mode
+ :next-checkers ((warning . python-mypy)))
+
+(flycheck-define-checker python-pycompile
+ "A Python syntax checker using Python's builtin compiler.
+
+See URL `https://docs.python.org/3.4/library/py_compile.html'."
+ :command ("python3" "-m" "py_compile" source)
+ :error-patterns
+ ;; Python 2.7
+ ((error line-start " File \"" (file-name) "\", line " line "\n"
+ (>= 2 (zero-or-more not-newline) "\n")
+ "SyntaxError: " (message) line-end)
+ (error line-start "Sorry: IndentationError: "
+ (message) "(" (file-name) ", line " line ")"
+ line-end)
+ ;; 2.6
+ (error line-start "SyntaxError: ('" (message (one-or-more (not (any "'"))))
+ "', ('" (file-name (one-or-more (not (any "'")))) "', "
+ line ", " column ", " (one-or-more not-newline) line-end))
+ :working-directory flycheck-python-find-project-root
+ :modes python-mode
+ :next-checkers ((warning . python-mypy)))
+
+(defun flycheck-pyright--parse-error (output checker buffer)
+ "Parse pyright errors/warnings from JSON OUTPUT.
+CHECKER and BUFFER denote the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively."
+ (seq-map
+ (lambda (err)
+ (let-alist err
+ (flycheck-error-new-at
+ (+ 1 .range.start.line)
+ (+ 1 .range.start.character)
+ (pcase .severity
+ ("error" 'error)
+ ("warning" 'warning)
+ (_ 'warning))
+ .message
+ :end-line (+ 1 .range.end.line)
+ :end-column (+ 1 .range.end.character)
+ :checker checker
+ :buffer buffer
+ :filename (buffer-file-name buffer))))
+ (cdr (nth 2 (car (flycheck-parse-json output))))))
+
+(flycheck-define-checker python-pyright
+ "Static type checker for Python
+
+See URL https://github.com/microsoft/pyright."
+ :command ("pyright"
+ "--outputjson"
+ source-inplace)
+ :working-directory flycheck-python-find-project-root
+ :error-parser flycheck-pyright--parse-error
+ :modes python-mode)
+
+(define-obsolete-variable-alias 'flycheck-python-mypy-ini
+ 'flycheck-python-mypy-config "32")
+
+(flycheck-def-config-file-var flycheck-python-mypy-config python-mypy
+ '("mypy.ini" "pyproject.toml" "setup.cfg"))
+
+(flycheck-def-option-var flycheck-python-mypy-cache-dir nil python-mypy
+ "Directory used to write .mypy_cache directories."
+ :type '(choice
+ (const :tag "Write to the working directory" nil)
+ (const :tag "Never write .mypy_cache directories" null-device)
+ (string :tag "Path"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "32"))
+
+(flycheck-define-checker python-mypy
+ "Mypy syntax and type checker. Requires mypy>=0.580.
+
+See URL `http://mypy-lang.org/'."
+ :command ("mypy"
+ "--show-column-numbers"
+ (config-file "--config-file" flycheck-python-mypy-config)
+ (option "--cache-dir" flycheck-python-mypy-cache-dir)
+ source-original)
+ :error-patterns
+ ((error line-start (file-name) ":" line (optional ":" column)
+ ": error:" (message) line-end)
+ (warning line-start (file-name) ":" line (optional ":" column)
+ ": warning:" (message) line-end)
+ (info line-start (file-name) ":" line (optional ":" column)
+ ": note:" (message) line-end))
+ :working-directory flycheck-python-find-project-root
+ :modes python-mode
+ ;; Ensure the file is saved, to work around
+ ;; https://github.com/python/mypy/issues/4746.
+ :predicate flycheck-buffer-saved-p)
+
+(flycheck-def-option-var flycheck-lintr-caching t r-lintr
+ "Whether to enable caching in lintr.
+
+By default, lintr caches all expressions in a file and re-checks
+only those that have changed. Setting this option to nil
+disables caching in case there are problems."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.23"))
+
+(flycheck-def-option-var flycheck-lintr-linters "default_linters" r-lintr
+ "Linters to use with lintr.
+
+The value of this variable is a string containing an R
+expression, which selects linters for lintr."
+ :type 'string
+ :risky t
+ :package-version '(flycheck . "0.23"))
+
+(defun flycheck-r-has-lintr (checker)
+ "Whether CHECKER (R) has installed the `lintr' library."
+ (eql 0 (flycheck-call-checker-process
+ checker nil nil nil
+ "--slave" "--no-restore" "--no-save" "-e"
+ "library('lintr')")))
+
+(flycheck-define-checker r-lintr
+ "An R style and syntax checker using the lintr package.
+
+See URL `https://github.com/jimhester/lintr'."
+ :command ("R" "--slave" "--no-restore" "--no-save" "-e"
+ (eval (concat
+ "library(lintr);"
+ "try(lint(commandArgs(TRUE)"
+ ", cache=" (if flycheck-lintr-caching "TRUE" "FALSE")
+ ", " flycheck-lintr-linters
+ "))"))
+ "--args" source)
+ :error-patterns
+ ((info line-start (file-name) ":" line ":" column ": style: " (message)
+ line-end)
+ (warning line-start (file-name) ":" line ":" column ": warning: " (message)
+ line-end)
+ (error line-start (file-name) ":" line ":" column ": error: " (message)
+ line-end))
+ :modes (ess-mode ess-r-mode)
+ :predicate
+ ;; Don't check ESS files which do not contain R, and make sure that lintr is
+ ;; actually available
+ (lambda ()
+ (and (equal ess-language "S")
+ (flycheck-r-has-lintr 'r-lintr)))
+ :verify (lambda (checker)
+ (let ((has-lintr (flycheck-r-has-lintr checker)))
+ (list
+ (flycheck-verification-result-new
+ :label "lintr library"
+ :message (if has-lintr "present" "missing")
+ :face (if has-lintr 'success '(bold error)))))))
+
+(defun flycheck-racket-has-expand-p (checker)
+ "Whether the executable of CHECKER provides the `expand' command."
+ (eql 0 (flycheck-call-checker-process checker nil nil nil "expand")))
+
+(flycheck-define-checker racket
+ "A Racket syntax checker with `raco expand'.
+
+The `compiler-lib' racket package is required for this syntax
+checker.
+
+See URL `https://racket-lang.org/'."
+ :command ("raco" "expand" source-inplace)
+ :predicate
+ (lambda ()
+ (and (or (not (eq major-mode 'scheme-mode))
+ ;; In `scheme-mode' we must check the current Scheme implementation
+ ;; being used
+ (and (boundp 'geiser-impl--implementation)
+ (eq geiser-impl--implementation 'racket)))
+ (flycheck-racket-has-expand-p 'racket)))
+ :verify
+ (lambda (checker)
+ (let ((has-expand (flycheck-racket-has-expand-p checker))
+ (in-scheme-mode (eq major-mode 'scheme-mode))
+ (geiser-impl (bound-and-true-p geiser-impl--implementation)))
+ (list
+ (flycheck-verification-result-new
+ :label "compiler-lib package"
+ :message (if has-expand "present" "missing")
+ :face (if has-expand 'success '(bold error)))
+ (flycheck-verification-result-new
+ :label "Geiser Implementation"
+ :message (cond
+ ((not in-scheme-mode) "Using Racket Mode")
+ ((eq geiser-impl 'racket) "Racket")
+ (geiser-impl (format "Other: %s" geiser-impl))
+ (t "Geiser not active"))
+ :face (cond
+ ((or (not in-scheme-mode) (eq geiser-impl 'racket)) 'success)
+ (t '(bold error)))))))
+ :error-filter
+ (lambda (errors)
+ (flycheck-sanitize-errors
+ (flycheck-increment-error-columns
+ (seq-remove
+ (lambda (err)
+ (string-suffix-p
+ "/share/racket/pkgs/compiler-lib/compiler/commands/expand.rkt"
+ (flycheck-error-filename err)))
+ errors))))
+ :error-patterns
+ ((error line-start (zero-or-more space)
+ (file-name) ":" line ":" column ":" (message) line-end))
+ :modes (racket-mode scheme-mode))
+
+(flycheck-define-checker rpm-rpmlint
+ "A RPM SPEC file syntax checker using rpmlint.
+
+See URL `https://github.com/rpm-software-management/rpmlint'."
+ :command ("rpmlint" source)
+ :error-patterns
+ ((error line-start
+ (file-name) ":" (optional line ":") " E: " (message)
+ line-end)
+ (warning line-start
+ (file-name) ":" (optional line ":") " W: " (message)
+ line-end))
+ :error-filter
+ ;; rpmlint 1.1 outputs a spurious error for the temp file created by flycheck
+ (lambda (errors)
+ (dolist (err (seq-remove
+ (lambda (err)
+ (string-suffix-p "(none)" (flycheck-error-filename err)))
+ errors))
+ ;; Add fake line numbers if they are missing in the lint output
+ (unless (flycheck-error-line err)
+ (setf (flycheck-error-line err) 1)))
+ errors)
+ :error-explainer
+ (lambda (error)
+ (-when-let* ((error-message (flycheck-error-message error))
+ (message-id (save-match-data
+ (string-match "\\([^ ]+\\)" error-message)
+ (match-string 1 error-message))))
+ (flycheck-call-checker-process-for-output
+ 'rpm-rpmlint nil t "-I" message-id)))
+ :modes (sh-mode rpm-spec-mode)
+ :predicate (lambda () (or (not (eq major-mode 'sh-mode))
+ ;; In `sh-mode', we need the proper shell
+ (eq sh-shell 'rpm))))
+
+(flycheck-def-config-file-var flycheck-markdown-markdownlint-cli-config
+ markdown-markdownlint-cli nil
+ :package-version '(flycheck . "32"))
+
+(flycheck-define-checker markdown-markdownlint-cli
+ "Markdown checker using markdownlint-cli.
+
+See URL `https://github.com/igorshubovych/markdownlint-cli'."
+ :command ("markdownlint"
+ (config-file "--config" flycheck-markdown-markdownlint-cli-config)
+ source)
+ :error-patterns
+ ((error line-start
+ (file-name) ":" line
+ (? ":" column) " " (id (one-or-more (not (any space))))
+ " " (message) line-end))
+ :error-filter
+ (lambda (errors)
+ (flycheck-sanitize-errors
+ (flycheck-remove-error-file-names "(string)" errors)))
+ :modes (markdown-mode gfm-mode))
+
+(flycheck-def-option-var flycheck-markdown-mdl-rules nil markdown-mdl
+ "Rules to enable for mdl.
+
+The value of this variable is a list of strings each of which is
+the name of a rule to enable.
+
+By default all rules are enabled.
+
+See URL `https://git.io/vhi2t'."
+ :type '(repeat :tag "Enabled rules"
+ (string :tag "rule name"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "27"))
+
+(flycheck-def-option-var flycheck-markdown-mdl-tags nil markdown-mdl
+ "Rule tags to enable for mdl.
+
+The value of this variable is a list of strings each of which is
+the name of a rule tag. Only rules with these tags are enabled.
+
+By default all rules are enabled.
+
+See URL `https://git.io/vhi2t'."
+ :type '(repeat :tag "Enabled tags"
+ (string :tag "tag name"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "27"))
+
+(flycheck-def-config-file-var flycheck-markdown-mdl-style markdown-mdl nil
+ :package-version '(flycheck . "27"))
+
+(flycheck-define-checker markdown-mdl
+ "Markdown checker using mdl.
+
+See URL `https://github.com/markdownlint/markdownlint'."
+ :command ("mdl"
+ (config-file "--style" flycheck-markdown-mdl-style)
+ (option "--tags=" flycheck-markdown-mdl-tags concat
+ flycheck-option-comma-separated-list)
+ (option "--rules=" flycheck-markdown-mdl-rules concat
+ flycheck-option-comma-separated-list))
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ (file-name) ":" line ": " (id (one-or-more alnum)) " " (message)
+ line-end))
+ :error-filter
+ (lambda (errors)
+ (flycheck-sanitize-errors
+ (flycheck-remove-error-file-names "(stdin)" errors)))
+ :modes (markdown-mode gfm-mode))
+
+(flycheck-define-checker nix
+ "Nix checker using nix-instantiate.
+
+See URL `https://nixos.org/nix/manual/#sec-nix-instantiate'."
+ :command ("nix-instantiate" "--parse" "-")
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ "error: " (message)
+ (one-or-more "\n")
+ (zero-or-more space) "at «stdin»:" line ":" column ":" line-end)
+ (error line-start
+ "at: (" line ":" column ") from stdin"
+ (one-or-more "\n" (zero-or-more space (one-or-more not-newline)))
+ (message) line-end)
+ (error line-start
+ "error: " (message) " at " (file-name) ":" line ":" column
+ line-end))
+ :error-filter
+ (lambda (errors)
+ (flycheck-sanitize-errors
+ (flycheck-remove-error-file-names "(string)" errors)))
+ :next-checkers ((warning . nix-linter))
+ :modes nix-mode)
+
+(defun flycheck-parse-nix-linter (output checker buffer)
+ "Parse nix-linter warnings from JSON OUTPUT.
+
+CHECKER and BUFFER denote the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively.
+
+See URL `https://github.com/Synthetica9/nix-linter' for more
+information about nix-linter."
+ (mapcar (lambda (err)
+ (let-alist err
+ (flycheck-error-new-at
+ .pos.spanBegin.sourceLine
+ .pos.spanBegin.sourceColumn
+ 'warning
+ .description
+ :id .offense
+ :checker checker
+ :buffer buffer
+ :filename (buffer-file-name buffer)
+ :end-line .pos.spanEnd.sourceLine
+ :end-column .pos.spanEnd.sourceColumn)))
+ (flycheck-parse-json output)))
+
+(flycheck-define-checker nix-linter
+ "Nix checker using nix-linter.
+
+See URL `https://github.com/Synthetica9/nix-linter'."
+ :command ("nix-linter" "--json-stream" "-")
+ :standard-input t
+ :error-parser flycheck-parse-nix-linter
+ :error-explainer
+ (lambda (error)
+ (-when-let (error-code (flycheck-error-id error))
+ (flycheck-call-checker-process-for-output
+ 'nix-linter nil t "--help-for" error-code)))
+ :modes nix-mode)
+
+(defun flycheck-locate-sphinx-source-directory ()
+ "Locate the Sphinx source directory for the current buffer.
+
+Return the source directory, or nil, if the current buffer is not
+part of a Sphinx project."
+ (-when-let* ((filename (buffer-file-name))
+ (dir (locate-dominating-file filename "conf.py")))
+ (expand-file-name dir)))
+
+(flycheck-define-checker rst
+ "A ReStructuredText (RST) syntax checker using Docutils.
+
+See URL `http://docutils.sourceforge.net/'."
+ ;; include:: directives
+ :command ("rst2pseudoxml.py" "--report=2" "--halt=5"
+ ;; Read from standard input and throw output away
+ "-" null-device)
+ :standard-input t
+ :error-patterns
+ ((warning line-start "<stdin>:" line ": (WARNING/2) " (message) line-end)
+ (error line-start "<stdin>:" line
+ ": (" (or "ERROR/3" "SEVERE/4") ") "
+ (message) line-end))
+ :modes rst-mode)
+
+(flycheck-def-option-var flycheck-sphinx-warn-on-missing-references t rst-sphinx
+ "Whether to warn about missing references in Sphinx.
+
+When non-nil (the default), warn about all missing references in
+Sphinx via `-n'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.17"))
+
+(flycheck-define-checker rst-sphinx
+ "A ReStructuredText (RST) syntax checker using Sphinx.
+
+Requires Sphinx 1.2 or newer. See URL `http://sphinx-doc.org'."
+ :command ("sphinx-build" "-b" "pseudoxml"
+ "-q" "-N" ; Reduced output and no colors
+ (option-flag "-n" flycheck-sphinx-warn-on-missing-references)
+ (eval (flycheck-locate-sphinx-source-directory))
+ temporary-directory ; Redirect the output to a temporary
+ ; directory
+ source-original) ; Sphinx needs the original document
+ :error-patterns
+ ((warning line-start (file-name) ":" line ": WARNING: " (message) line-end)
+ (error line-start
+ (file-name) ":" line
+ ": " (or "ERROR" "SEVERE") ": "
+ (message) line-end))
+ :modes rst-mode
+ :predicate (lambda () (and (flycheck-buffer-saved-p)
+ (flycheck-locate-sphinx-source-directory))))
+
+(defun flycheck-ruby--find-project-root (_checker)
+ "Compute an appropriate working-directory for flycheck-ruby.
+
+This is either a parent directory containing a Gemfile, or nil."
+ (and
+ buffer-file-name
+ (locate-dominating-file buffer-file-name "Gemfile")))
+
+(flycheck-def-config-file-var flycheck-rubocoprc ruby-rubocop ".rubocop.yml")
+
+(flycheck-def-option-var flycheck-rubocop-lint-only nil
+ (ruby-rubocop ruby-standard)
+ "Whether to only report code issues in Rubocop and Standard.
+
+When non-nil, only report code issues, via `--lint'. Otherwise
+report style issues as well."
+ :safe #'booleanp
+ :type 'boolean
+ :package-version '(flycheck . "0.16"))
+
+(defconst flycheck-ruby-rubocop-error-patterns
+ '((info line-start (file-name) ":" line ":" column ": C: "
+ (optional (id (one-or-more (not (any ":")))) ": ") (message) line-end)
+ (warning line-start (file-name) ":" line ":" column ": W: "
+ (optional (id (one-or-more (not (any ":")))) ": ") (message)
+ line-end)
+ (error line-start (file-name) ":" line ":" column ": " (or "E" "F") ": "
+ (optional (id (one-or-more (not (any ":")))) ": ") (message)
+ line-end)))
+
+(flycheck-def-executable-var ruby-rubocop "rubocop")
+(flycheck-define-command-checker 'ruby-rubocop
+ "A Ruby syntax and style checker using the RuboCop tool.
+
+You need at least RuboCop 0.34 for this syntax checker.
+
+See URL `https://rubocop.org/'."
+ ;; ruby-standard is defined based on this checker
+ :command '("rubocop"
+ "--display-cop-names"
+ "--force-exclusion"
+ "--format" "emacs"
+ ;; Explicitly disable caching to prevent Rubocop 0.35.1 and earlier
+ ;; from caching standard input. Later versions of Rubocop
+ ;; automatically disable caching with --stdin, see
+ ;; https://github.com/flycheck/flycheck/issues/844 and
+ ;; https://github.com/bbatsov/rubocop/issues/2576
+ "--cache" "false"
+ (config-file "--config" flycheck-rubocoprc)
+ (option-flag "--lint" flycheck-rubocop-lint-only)
+ ;; Rubocop takes the original file name as argument when reading
+ ;; from standard input
+ "--stdin" source-original)
+ :standard-input t
+ :working-directory #'flycheck-ruby--find-project-root
+ :error-patterns flycheck-ruby-rubocop-error-patterns
+ :modes '(enh-ruby-mode ruby-mode)
+ :next-checkers '((warning . ruby-reek)
+ (warning . ruby-rubylint)))
+
+(flycheck-def-config-file-var flycheck-ruby-standardrc ruby-standard
+ ".standard.yml")
+
+(flycheck-def-executable-var ruby-standard "standardrb")
+(flycheck-define-command-checker 'ruby-standard
+ "A Ruby syntax and style checker using the StandardRB gem.
+
+See URL `https://github.com/testdouble/standard' for more information."
+ ;; This checker is derived from ruby-rubocop; see above
+ :command '("standardrb"
+ "--display-cop-names"
+ "--force-exclusion"
+ "--format" "emacs"
+ "--cache" "false"
+ (config-file "--config" flycheck-ruby-standardrc)
+ (option-flag "--lint" flycheck-rubocop-lint-only)
+ "--stdin" source-original)
+ :standard-input t
+ :working-directory #'flycheck-ruby--find-project-root
+ :error-patterns flycheck-ruby-rubocop-error-patterns
+ :modes '(enh-ruby-mode ruby-mode)
+ :next-checkers '((warning . ruby-reek)
+ (warning . ruby-rubylint)))
+
+(flycheck-def-config-file-var flycheck-reekrc ruby-reek ".reek.yml"
+ :safe #'string-or-null-p
+ :package-version '(flycheck . "30"))
+
+(flycheck-define-checker ruby-reek
+ "A Ruby smell checker using reek.
+
+See URL `https://github.com/troessner/reek'."
+ :command ("reek" "--format" "json"
+ (config-file "--config" flycheck-reekrc)
+ source)
+ :error-parser flycheck-parse-reek
+ :modes (enh-ruby-mode ruby-mode)
+ :next-checkers ((warning . ruby-rubylint)))
+
+;; Default to `nil' to let Rubylint find its configuration file by itself, and
+;; to maintain backwards compatibility with older Rubylint and Flycheck releases
+(flycheck-def-config-file-var flycheck-rubylintrc ruby-rubylint nil)
+
+(flycheck-define-checker ruby-rubylint
+ "A Ruby syntax and code analysis checker using ruby-lint.
+
+Requires ruby-lint 2.0.2 or newer. See URL
+`https://github.com/YorickPeterse/ruby-lint'."
+ :command ("ruby-lint" "--presenter=syntastic"
+ (config-file "--config" flycheck-rubylintrc)
+ source)
+ ;; Ruby Lint can't read from standard input
+ :error-patterns
+ ((info line-start
+ (file-name) ":I:" line ":" column ": " (message) line-end)
+ (warning line-start
+ (file-name) ":W:" line ":" column ": " (message) line-end)
+ (error line-start
+ (file-name) ":E:" line ":" column ": " (message) line-end))
+ :modes (enh-ruby-mode ruby-mode))
+
+(flycheck-define-checker ruby
+ "A Ruby syntax checker using the standard Ruby interpreter.
+
+Please note that the output of different Ruby versions and
+implementations varies wildly. This syntax checker supports
+current versions of MRI and JRuby, but may break when used with
+other implementations or future versions of these
+implementations.
+
+Please consider using `ruby-rubocop' or `ruby-reek' instead.
+
+See URL `https://www.ruby-lang.org/'."
+ :command ("ruby" "-w" "-c")
+ :standard-input t
+ :error-patterns
+ ;; These patterns support output from JRuby, too, to deal with RVM or Rbenv
+ ((error line-start "SyntaxError in -:" line ": " (message) line-end)
+ (warning line-start "-:" line ":" (optional column ":")
+ " warning: " (message) line-end)
+ (error line-start "-:" line ": " (message) line-end))
+ :modes (enh-ruby-mode ruby-mode)
+ :next-checkers ((warning . ruby-rubylint)))
+
+(flycheck-define-checker ruby-jruby
+ "A Ruby syntax checker using the JRuby interpreter.
+
+This syntax checker is very primitive, and may break on future
+versions of JRuby.
+
+Please consider using `ruby-rubocop' or `ruby-rubylint' instead.
+
+See URL `http://jruby.org/'."
+ :command ("jruby" "-w" "-c")
+ :standard-input t
+ :error-patterns
+ ((error line-start "SyntaxError in -:" line ": " (message) line-end)
+ (warning line-start "-:" line ": warning: " (message) line-end)
+ (error line-start "-:" line ": " (message) line-end))
+ :modes (enh-ruby-mode ruby-mode)
+ :next-checkers ((warning . ruby-rubylint)))
+
+(flycheck-def-args-var flycheck-cargo-check-args (rust-cargo)
+ :package-version '(flycheck . "32"))
+
+(flycheck-def-args-var flycheck-rust-args (rust)
+ :package-version '(flycheck . "0.24"))
+
+(flycheck-def-option-var flycheck-rust-check-tests t (rust-cargo rust)
+ "Whether to check test code in Rust.
+
+For the `rust' checker: When non-nil, `rustc' is passed the
+`--test' flag, which will check any code marked with the
+`#[cfg(test)]' attribute and any functions marked with
+`#[test]'. Otherwise, `rustc' is not passed `--test' and test
+code will not be checked. Skipping `--test' is necessary when
+using `#![no_std]', because compiling the test runner requires
+`std'.
+
+For the `rust-cargo' checker: When non-nil, calls `cargo test
+--no-run' instead of `cargo check'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '("flycheck" . "0.19"))
+
+(flycheck-def-option-var flycheck-rust-crate-root nil rust
+ "A path to the crate root for the current buffer.
+
+The value of this variable is either a string with the path to
+the crate root for the current buffer, or nil if the current buffer
+is a crate. A relative path is relative to the current buffer.
+
+If this variable is non nil the current buffer will only be checked
+if it is not modified, i.e. after it has been saved."
+ :type '(choice (const :tag "Unspecified" nil)
+ (file :tag "Root"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "0.20"))
+(make-variable-buffer-local 'flycheck-rust-crate-root)
+
+(flycheck-def-option-var flycheck-rust-crate-type "lib" (rust-cargo rust)
+ "The type of the Rust Crate to check.
+
+For `rust-cargo', the value should be a string denoting the
+target type passed to Cargo. See
+`flycheck-rust-valid-crate-type-p' for the list of allowed
+values.
+
+For `rust', the value should be a string denoting the crate type
+for the `--crate-type' flag of rustc."
+ :type '(choice (const :tag "nil (rust/rust-cargo)" nil)
+ (const :tag "lib (rust/rust-cargo)" "lib")
+ (const :tag "bin (rust/rust-cargo)" "bin")
+ (const :tag "example (rust-cargo)" "example")
+ (const :tag "test (rust-cargo)" "test")
+ (const :tag "bench (rust-cargo)" "bench")
+ (const :tag "rlib (rust)" "rlib")
+ (const :tag "dylib (rust)" "dylib")
+ (const :tag "cdylib (rust)" "cdylib")
+ (const :tag "staticlib (rust)" "staticlib")
+ (const :tag "metadata (rust)" "metadata"))
+ :safe #'stringp
+ :package-version '(flycheck . "0.20"))
+(make-variable-buffer-local 'flycheck-rust-crate-type)
+
+(flycheck-def-option-var flycheck-rust-binary-name nil rust-cargo
+ "The name of the binary to pass to `cargo check --CRATE-TYPE'.
+
+The value of this variable is a string denoting the name of the
+target to check: usually the name of the crate, or the name of
+one of the files under `src/bin', `tests', `examples' or
+`benches'.
+
+This always requires a non-nil value, unless
+`flycheck-rust-crate-type' is `lib' or nil, in which case it is
+ignored."
+ :type '(choice (const :tag "Unspecified" nil)
+ (string :tag "Binary name"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "28"))
+(make-variable-buffer-local 'flycheck-rust-binary-name)
+
+(flycheck-def-option-var flycheck-rust-features nil rust-cargo
+ "List of features to activate during build or check.
+
+The value of this variable is a list of strings denoting features
+that will be activated to build the target to check. Features will
+be passed to `cargo check --features=FEATURES'."
+ :type '(repeat :tag "Features to activate"
+ (string :tag "Feature"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "32"))
+(make-variable-buffer-local 'flycheck-rust-features)
+
+(flycheck-def-option-var flycheck-rust-library-path nil rust
+ "A list of library directories for Rust.
+
+The value of this variable is a list of strings, where each
+string is a directory to add to the library path of Rust.
+Relative paths are relative to the file being checked."
+ :type '(repeat (directory :tag "Library directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.18"))
+
+(defun flycheck--fontify-as-markdown ()
+ "Place current buffer in `markdown-view-mode' and fontify it."
+ (when (fboundp 'markdown-view-mode)
+ (let ((markdown-fontify-code-block-default-mode 'rust-mode)
+ (markdown-fontify-code-blocks-natively t)
+ (markdown-hide-markup t))
+ (markdown-view-mode)
+ (font-lock-flush)
+ (font-lock-ensure))))
+
+(defun flycheck-rust-error-explainer (error)
+ "Return an explanation for the given `flycheck-error' ERROR."
+ (-when-let (error-code (flycheck-error-id error))
+ (lambda ()
+ (flycheck-call-checker-process
+ 'rust nil standard-output t "--explain" error-code)
+ (with-current-buffer standard-output
+ (flycheck--fontify-as-markdown)))))
+
+(defun flycheck-rust-error-filter (errors)
+ "Filter ERRORS from rustc output that have no explanatory value."
+ (seq-remove
+ (lambda (err)
+ (or
+ ;; Macro errors emit a diagnostic in a phony file,
+ ;; e.g. "<println macros>".
+ (-when-let (filename (flycheck-error-filename err))
+ (string-match-p (rx "macros>" line-end) filename))
+ ;; Redundant message giving the number of failed errors
+ (-when-let (msg (flycheck-error-message err))
+ (string-match-p
+ (rx
+ (or (: "aborting due to " (optional (one-or-more num) " ")
+ "previous error")
+ (: "For more information about this error, try `rustc --explain "
+ (one-or-more alnum) "`.")))
+ msg))))
+ errors))
+
+(defun flycheck-rust-manifest-directory ()
+ "Return the nearest directory holding the Cargo manifest.
+
+Return the nearest directory containing the `Cargo.toml' manifest
+file, starting from the current buffer and using
+`locate-dominating-file'. Return nil if there is no such file,
+or if the current buffer has no file name."
+ (and buffer-file-name
+ (locate-dominating-file buffer-file-name "Cargo.toml")))
+
+(defun flycheck-rust-cargo-metadata ()
+ "Run 'cargo metadata' and return the result as parsed JSON object."
+ (car (flycheck-parse-json
+ (flycheck-call-checker-process-for-output
+ 'rust-cargo nil t
+ "metadata" "--no-deps" "--format-version" "1"))))
+
+(defun flycheck-rust-cargo-workspace-root ()
+ "Return the path to the workspace root of a Rust Cargo project.
+
+Return nil if the workspace root does not exist (for Rust
+versions inferior to 1.25)."
+ (let-alist (flycheck-rust-cargo-metadata)
+ .workspace_root))
+
+(defun flycheck-rust-cargo-has-command-p (command)
+ "Whether Cargo has COMMAND in its list of commands.
+
+Execute `cargo --list' to find out whether COMMAND is present."
+ (let ((cargo (funcall flycheck-executable-find "cargo")))
+ (member command (mapcar #'string-trim-left
+ (ignore-errors (process-lines cargo "--list"))))))
+
+(defun flycheck-rust-valid-crate-type-p (crate-type)
+ "Whether CRATE-TYPE is a valid target type for Cargo.
+
+A valid Cargo target type is one of `lib', `bin', `example',
+`test' or `bench'."
+ (member crate-type '(nil "lib" "bin" "example" "test" "bench")))
+
+(flycheck-define-checker rust-cargo
+ "A Rust syntax checker using Cargo.
+
+This syntax checker requires Rust 1.17 or newer. See URL
+`https://www.rust-lang.org'."
+ :command ("cargo"
+ (eval (if flycheck-rust-check-tests
+ "test"
+ "check"))
+ (eval (when flycheck-rust-check-tests
+ "--no-run"))
+ (eval (when flycheck-rust-crate-type
+ (concat "--" flycheck-rust-crate-type)))
+ ;; All crate targets except "lib" need a binary name
+ (eval (when (and flycheck-rust-crate-type
+ (not (string= flycheck-rust-crate-type "lib")))
+ flycheck-rust-binary-name))
+ (option "--features=" flycheck-rust-features concat
+ flycheck-option-comma-separated-list)
+ (eval flycheck-cargo-check-args)
+ "--message-format=json")
+ :error-parser flycheck-parse-cargo-rustc
+ :error-filter (lambda (errors)
+ ;; In Rust 1.25+, filenames are relative to the workspace
+ ;; root.
+ (let ((root (flycheck-rust-cargo-workspace-root)))
+ (seq-do (lambda (err)
+ ;; Some errors are crate level and do not have a
+ ;; filename
+ (when (flycheck-error-filename err)
+ (setf (flycheck-error-filename err)
+ (expand-file-name
+ (flycheck-error-filename err) root))))
+ (flycheck-rust-error-filter errors))))
+ :error-explainer flycheck-rust-error-explainer
+ :modes rust-mode
+ :predicate flycheck-buffer-saved-p
+ :enabled flycheck-rust-manifest-directory
+ :working-directory (lambda (_) (flycheck-rust-manifest-directory))
+ :verify
+ (lambda (_)
+ (and buffer-file-name
+ (let* ((has-toml (flycheck-rust-manifest-directory))
+ (valid-crate-type (flycheck-rust-valid-crate-type-p
+ flycheck-rust-crate-type))
+ (need-binary-name
+ (and flycheck-rust-crate-type
+ (not (string= flycheck-rust-crate-type "lib")))))
+ (list
+ (flycheck-verification-result-new
+ :label "Cargo.toml"
+ :message (if has-toml "Found" "Missing")
+ :face (if has-toml 'success '(bold warning)))
+ (flycheck-verification-result-new
+ :label "Crate type"
+ :message (if valid-crate-type
+ (format "%s" flycheck-rust-crate-type)
+ (format "%s (invalid, should be one of 'lib', 'bin', \
+'test', 'example' or 'bench')"
+ flycheck-rust-crate-type))
+ :face (if valid-crate-type 'success '(bold error)))
+ (flycheck-verification-result-new
+ :label "Binary name"
+ :message (cond
+ ((not need-binary-name) "Not required")
+ ((not flycheck-rust-binary-name) "Required")
+ (t (format "%s" flycheck-rust-binary-name)))
+ :face (cond
+ ((not need-binary-name) 'success)
+ ((not flycheck-rust-binary-name) '(bold error))
+ (t 'success))))))))
+
+(flycheck-define-checker rust
+ "A Rust syntax checker using Rust compiler.
+
+This syntax checker needs Rust 1.18 or newer. See URL
+`https://www.rust-lang.org'."
+ :command ("rustc"
+ (option "--crate-type" flycheck-rust-crate-type)
+ "--emit=mir" "-o" "/dev/null" ; avoid creating binaries
+ "--error-format=json"
+ (option-flag "--test" flycheck-rust-check-tests)
+ (option-list "-L" flycheck-rust-library-path concat)
+ (eval flycheck-rust-args)
+ (eval (or flycheck-rust-crate-root
+ (flycheck-substitute-argument 'source-original 'rust))))
+ :error-parser flycheck-parse-rustc
+ :error-filter flycheck-rust-error-filter
+ :error-explainer flycheck-rust-error-explainer
+ :modes rust-mode
+ :predicate flycheck-buffer-saved-p)
+
+(flycheck-define-checker rust-clippy
+ "A Rust syntax checker using clippy.
+
+See URL `https://github.com/rust-lang-nursery/rust-clippy'."
+ :command ("cargo" "clippy" "--message-format=json")
+ :error-parser flycheck-parse-cargo-rustc
+ :error-filter flycheck-rust-error-filter
+ :error-explainer flycheck-rust-error-explainer
+ :modes rust-mode
+ :predicate flycheck-buffer-saved-p
+ :enabled (lambda ()
+ (and (flycheck-rust-cargo-has-command-p "clippy")
+ (flycheck-rust-manifest-directory)))
+ :working-directory (lambda (_) (flycheck-rust-manifest-directory))
+ :verify
+ (lambda (_)
+ (and buffer-file-name
+ (let ((has-toml (flycheck-rust-manifest-directory))
+ (has-clippy (flycheck-rust-cargo-has-command-p "clippy")))
+ (list
+ (flycheck-verification-result-new
+ :label "Clippy"
+ :message (if has-clippy "Found"
+ "Cannot find the `cargo clippy' command")
+ :face (if has-clippy 'success '(bold warning)))
+ (flycheck-verification-result-new
+ :label "Cargo.toml"
+ :message (if has-toml "Found" "Missing")
+ :face (if has-toml 'success '(bold warning))))))))
+
+(defvar flycheck-sass-scss-cache-directory nil
+ "The cache directory for `sass' and `scss'.")
+
+(defun flycheck-sass-scss-cache-location ()
+ "Get the cache location for `sass' and `scss'.
+
+If no cache directory exists yet, create one and return it.
+Otherwise return the previously used cache directory."
+ (setq flycheck-sass-scss-cache-directory
+ (or flycheck-sass-scss-cache-directory
+ (make-temp-file "flycheck-sass-scss-cache" 'directory))))
+
+(flycheck-def-option-var flycheck-sass-compass nil sass
+ "Whether to enable the Compass CSS framework.
+
+When non-nil, enable the Compass CSS framework, via `--compass'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.16"))
+
+(flycheck-define-checker sass
+ "A Sass syntax checker using the Sass compiler.
+
+See URL `http://sass-lang.com'."
+ :command ("sass"
+ "--cache-location" (eval (flycheck-sass-scss-cache-location))
+ (option-flag "--compass" flycheck-sass-compass)
+ "--check" "--stdin")
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ (or "Syntax error: " "Error: ")
+ (message (one-or-more not-newline)
+ (zero-or-more "\n"
+ (one-or-more " ")
+ (one-or-more not-newline)))
+ (optional "\r") "\n" (one-or-more " ") "on line " line
+ " of standard input"
+ line-end)
+ (warning line-start
+ "WARNING: "
+ (message (one-or-more not-newline)
+ (zero-or-more "\n"
+ (one-or-more " ")
+ (one-or-more not-newline)))
+ (optional "\r") "\n" (one-or-more " ") "on line " line
+ " of " (one-or-more not-newline)
+ line-end))
+ :modes sass-mode)
+
+(flycheck-def-config-file-var flycheck-sass-lintrc sass/scss-sass-lint
+ ".sass-lint.yml"
+ :package-version '(flycheck . "30"))
+
+(flycheck-define-checker sass/scss-sass-lint
+ "A SASS/SCSS syntax checker using sass-Lint.
+
+See URL `https://github.com/sasstools/sass-lint'."
+ :command ("sass-lint"
+ "--verbose"
+ "--no-exit"
+ "--format" "Checkstyle"
+ (config-file "--config" flycheck-sass-lintrc)
+ source)
+ :error-parser flycheck-parse-checkstyle
+ :modes (sass-mode scss-mode))
+
+(flycheck-define-checker scala
+ "A Scala syntax checker using the Scala compiler.
+
+See URL `https://www.scala-lang.org/'."
+ :command ("scalac" "-Ystop-after:parser" source)
+ :error-patterns
+ ((error line-start (file-name) ":" line ": error: " (message) line-end))
+ :modes scala-mode
+ :next-checkers ((warning . scala-scalastyle)))
+
+(flycheck-def-config-file-var flycheck-scalastylerc scala-scalastyle nil
+ :package-version '(flycheck . "0.20"))
+
+(flycheck-define-checker scala-scalastyle
+ "A Scala style checker using scalastyle.
+
+Note that this syntax checker is not used if
+`flycheck-scalastylerc' is nil or refers to a non-existing file.
+
+See URL `http://www.scalastyle.org'."
+ :command ("scalastyle"
+ (config-file "-c" flycheck-scalastylerc)
+ source)
+ :error-patterns
+ ((error line-start "error file=" (file-name) " message="
+ (message) " line=" line (optional " column=" column) line-end)
+ (warning line-start "warning file=" (file-name) " message="
+ (message) " line=" line (optional " column=" column) line-end))
+ :error-filter (lambda (errors)
+ (flycheck-sanitize-errors
+ (flycheck-increment-error-columns errors)))
+ :modes scala-mode
+ :predicate
+ ;; Inhibit this syntax checker if the JAR or the configuration are unset or
+ ;; missing
+ (lambda () (and flycheck-scalastylerc
+ (flycheck-locate-config-file flycheck-scalastylerc
+ 'scala-scalastyle)))
+ :verify (lambda (checker)
+ (let ((config-file (and flycheck-scalastylerc
+ (flycheck-locate-config-file
+ flycheck-scalastylerc checker))))
+ (list
+ (flycheck-verification-result-new
+ :label "Configuration file"
+ :message (cond
+ ((not flycheck-scalastylerc)
+ "`flycheck-scalastyletrc' not set")
+ ((not config-file)
+ (format "file %s not found" flycheck-scalastylerc))
+ (t (format "found at %s" config-file)))
+ :face (cond
+ ((not flycheck-scalastylerc) '(bold warning))
+ ((not config-file) '(bold error))
+ (t 'success)))))))
+
+(flycheck-def-args-var flycheck-scheme-chicken-args scheme-chicken
+ :package-version '(flycheck . "32"))
+
+(flycheck-define-checker scheme-chicken
+ "A CHICKEN Scheme syntax checker using the CHICKEN compiler `csc'.
+
+See URL `http://call-cc.org/'."
+ :command ("csc" "-analyze-only" "-local"
+ (eval flycheck-scheme-chicken-args)
+ source)
+ :error-patterns
+ ((info line-start
+ "Note: " (zero-or-more not-newline) ":\n"
+ (one-or-more (any space)) "(" (file-name) ":" line ") " (message)
+ line-end)
+ (warning line-start
+ "Warning: " (zero-or-more not-newline) ",\n"
+ (one-or-more (any space)) (zero-or-more not-newline) ":\n"
+ (one-or-more (any space)) "(" (file-name) ":" line ") " (message)
+ line-end)
+ (warning line-start
+ "Warning: " (zero-or-more not-newline) ":\n"
+ (one-or-more (any space)) "(" (file-name) ":" line ") " (message)
+ line-end)
+ (error line-start "Error: (line " line ") " (message) line-end)
+ (error line-start "Syntax error: (" (file-name) ":" line ")"
+ (zero-or-more not-newline) " - "
+ (message (one-or-more not-newline)
+ (zero-or-more "\n"
+ (zero-or-more space)
+ (zero-or-more not-newline))
+ (one-or-more space) "<--")
+ line-end)
+ ;; A of version 4.12.0, the chicken compiler doesn't provide a
+ ;; line number for this error.
+ (error line-start "Syntax error: "
+ (message (one-or-more not-newline)
+ (zero-or-more "\n"
+ (zero-or-more space)
+ (zero-or-more not-newline))
+ (one-or-more space) "<--")
+ line-end)
+ (error line-start
+ "Error: " (zero-or-more not-newline) ":\n"
+ (one-or-more (any space)) "(" (file-name) ":" line ") " (message)
+ line-end)
+ ;; A of version 4.12.0, the chicken compiler doesn't provide a
+ ;; line number for this error.
+ (error line-start "Error: "
+ (message (one-or-more not-newline)
+ (zero-or-more "\n"
+ (zero-or-more space)
+ (zero-or-more not-newline))
+ (one-or-more space) "<--")))
+ :error-filter flycheck-fill-empty-line-numbers
+ :predicate
+ (lambda ()
+ ;; In `scheme-mode' we must check the current Scheme implementation
+ ;; being used
+ (and (boundp 'geiser-impl--implementation)
+ (eq geiser-impl--implementation 'chicken)))
+ :verify
+ (lambda (_checker)
+ (let ((geiser-impl (bound-and-true-p geiser-impl--implementation)))
+ (list
+ (flycheck-verification-result-new
+ :label "Geiser Implementation"
+ :message (cond
+ ((eq geiser-impl 'chicken) "Chicken Scheme")
+ (geiser-impl (format "Other: %s" geiser-impl))
+ (t "Geiser not active"))
+ :face (cond
+ ((eq geiser-impl 'chicken) 'success)
+ (t '(bold error)))))))
+ :modes scheme-mode)
+
+(defconst flycheck-scss-lint-checkstyle-re
+ (rx "cannot load such file" (1+ not-newline) "scss_lint_reporter_checkstyle")
+ "Regular expression to parse missing checkstyle error.")
+
+(defun flycheck-parse-scss-lint (output checker buffer)
+ "Parse SCSS-Lint OUTPUT from CHECKER and BUFFER.
+
+Like `flycheck-parse-checkstyle', but catches errors about
+missing checkstyle reporter from SCSS-Lint."
+ (if (string-match-p flycheck-scss-lint-checkstyle-re output)
+ (list (flycheck-error-new-at
+ 1 nil 'error "Checkstyle reporter for SCSS-Lint missing.
+Please run gem install scss_lint_reporter_checkstyle"
+ :checker checker
+ :buffer buffer
+ :filename (buffer-file-name buffer)))
+ (flycheck-parse-checkstyle output checker buffer)))
+
+(flycheck-def-config-file-var flycheck-scss-lintrc scss-lint ".scss-lint.yml"
+ :package-version '(flycheck . "0.23"))
+
+(flycheck-define-checker scss-lint
+ "A SCSS syntax checker using SCSS-Lint.
+
+Needs SCSS-Lint 0.43.2 or newer.
+
+See URL `https://github.com/brigade/scss-lint'."
+ :command ("scss-lint"
+ "--require=scss_lint_reporter_checkstyle"
+ "--format=Checkstyle"
+ (config-file "--config" flycheck-scss-lintrc)
+ "--stdin-file-path" source-original "-")
+ :standard-input t
+ ;; We cannot directly parse Checkstyle XML, since for some mysterious reason
+ ;; SCSS-Lint doesn't have a built-in Checkstyle reporter, and instead ships it
+ ;; as an addon which might not be installed. We use a custom error parser to
+ ;; check whether the addon is missing and turn that into a special kind of
+ ;; Flycheck error.
+ :error-parser flycheck-parse-scss-lint
+ :modes scss-mode
+ :verify
+ (lambda (checker)
+ (-when-let
+ (output (flycheck-call-checker-process-for-output
+ checker nil nil "--require=scss_lint_reporter_checkstyle"))
+ (let ((reporter-missing
+ (string-match-p flycheck-scss-lint-checkstyle-re output)))
+ (list
+ (flycheck-verification-result-new
+ :label "checkstyle reporter"
+ :message (if reporter-missing
+ "scss_lint_reporter_checkstyle plugin missing"
+ "present")
+ :face (if reporter-missing
+ '(bold error)
+ 'success)))))))
+
+(flycheck-define-checker scss-stylelint
+ "A SCSS syntax and style checker using stylelint.
+
+See URL `http://stylelint.io/'."
+ :command ("stylelint"
+ (eval flycheck-stylelint-args)
+ "--syntax" "scss"
+ (option-flag "--quiet" flycheck-stylelint-quiet)
+ (config-file "--config" flycheck-stylelintrc))
+ :standard-input t
+ :error-parser flycheck-parse-stylelint
+ :predicate flycheck-buffer-nonempty-p
+ :modes (scss-mode))
+
+(flycheck-def-option-var flycheck-scss-compass nil scss
+ "Whether to enable the Compass CSS framework.
+
+When non-nil, enable the Compass CSS framework, via `--compass'."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "0.16"))
+
+(flycheck-define-checker scss
+ "A SCSS syntax checker using the SCSS compiler.
+
+See URL `http://sass-lang.com'."
+ :command ("scss"
+ "--cache-location" (eval (flycheck-sass-scss-cache-location))
+ (option-flag "--compass" flycheck-scss-compass)
+ "--check" "--stdin")
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ (or "Syntax error: " "Error: ")
+ (message (one-or-more not-newline)
+ (zero-or-more "\n"
+ (one-or-more " ")
+ (one-or-more not-newline)))
+ (optional "\r") "\n" (one-or-more " ") "on line " line
+ " of standard input"
+ line-end)
+ (warning line-start
+ "WARNING: "
+ (message (one-or-more not-newline)
+ (zero-or-more "\n"
+ (one-or-more " ")
+ (one-or-more not-newline)))
+ (optional "\r") "\n" (one-or-more " ") "on line " line
+ " of an unknown file"
+ line-end))
+ :modes scss-mode)
+
+(flycheck-def-args-var flycheck-sh-bash-args (sh-bash)
+ :package-version '(flycheck . "32"))
+
+(flycheck-define-checker sh-bash
+ "A Bash syntax checker using the Bash shell.
+
+See URL `http://www.gnu.org/software/bash/'."
+ :command ("bash" "--norc" "-n"
+ (eval flycheck-sh-bash-args)
+ "--")
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ ;; The name/path of the bash executable
+ (one-or-more (not (any ":"))) ":"
+ ;; A label "line", possibly localized
+ (one-or-more (not (any digit)))
+ line (zero-or-more " ") ":" (zero-or-more " ")
+ (message) line-end))
+ :modes sh-mode
+ :predicate (lambda () (eq sh-shell 'bash))
+ :next-checkers ((warning . sh-shellcheck)))
+
+(flycheck-define-checker sh-posix-dash
+ "A POSIX Shell syntax checker using the Dash shell.
+
+See URL `http://gondor.apana.org.au/~herbert/dash/'."
+ :command ("dash" "-n")
+ :standard-input t
+ :error-patterns
+ ((error line-start (one-or-more (not (any ":"))) ": " line ": " (message)))
+ :modes sh-mode
+ :predicate (lambda () (eq sh-shell 'sh))
+ :next-checkers ((warning . sh-shellcheck)))
+
+(flycheck-define-checker sh-posix-bash
+ "A POSIX Shell syntax checker using the Bash shell.
+
+See URL `http://www.gnu.org/software/bash/'."
+ :command ("bash" "--posix" "--norc" "-n" "--")
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ ;; The name/path of the bash executable
+ (one-or-more (not (any ":"))) ":"
+ ;; A label "line", possibly localized
+ (one-or-more (not (any digit)))
+ line (zero-or-more " ") ":" (zero-or-more " ")
+ (message) line-end))
+ :modes sh-mode
+ :predicate (lambda () (eq sh-shell 'sh))
+ :next-checkers ((warning . sh-shellcheck)))
+
+(flycheck-define-checker sh-zsh
+ "A Zsh syntax checker using the Zsh shell.
+
+See URL `http://www.zsh.org/'."
+ :command ("zsh" "--no-exec" "--no-globalrcs" "--no-rcs" source)
+ :error-patterns
+ ((error line-start (file-name) ":" line ": " (message) line-end))
+ :modes sh-mode
+ :predicate (lambda () (eq sh-shell 'zsh))
+ :next-checkers ((warning . sh-shellcheck)))
+
+(defconst flycheck-shellcheck-supported-shells '(bash ksh88 sh)
+ "Shells supported by ShellCheck.")
+
+(flycheck-def-option-var flycheck-shellcheck-excluded-warnings nil sh-shellcheck
+ "A list of excluded warnings for ShellCheck.
+
+The value of this variable is a list of strings, where each
+string is a warning code to be excluded from ShellCheck reports.
+By default, no warnings are excluded."
+ :type '(repeat :tag "Excluded warnings"
+ (string :tag "Warning code"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.21"))
+
+(flycheck-def-option-var flycheck-shellcheck-follow-sources t sh-shellcheck
+ "Whether to follow external sourced files in scripts.
+
+Shellcheck will follow and parse sourced files so long as a
+pre-runtime resolvable path to the file is present. This can
+either be part of the source command itself:
+ source /full/path/to/file.txt
+or added as a shellcheck directive before the source command:
+ # shellcheck source=/full/path/to/file.txt."
+ :type 'boolean
+ :safe #'booleanp
+ :package-version '(flycheck . "31"))
+
+(flycheck-define-checker sh-shellcheck
+ "A shell script syntax and style checker using Shellcheck.
+
+See URL `https://github.com/koalaman/shellcheck/'."
+ :command ("shellcheck"
+ "--format" "checkstyle"
+ "--shell" (eval (symbol-name sh-shell))
+ (option-flag "--external-sources"
+ flycheck-shellcheck-follow-sources)
+ (option "--exclude" flycheck-shellcheck-excluded-warnings list
+ flycheck-option-comma-separated-list)
+ "-")
+ :standard-input t
+ :error-parser flycheck-parse-checkstyle
+ :error-filter
+ (lambda (errors)
+ (flycheck-remove-error-file-names
+ "-" (flycheck-dequalify-error-ids errors)))
+ :modes sh-mode
+ :predicate (lambda () (memq sh-shell flycheck-shellcheck-supported-shells))
+ :verify (lambda (_)
+ (let ((supports-shell (memq sh-shell
+ flycheck-shellcheck-supported-shells)))
+ (list
+ (flycheck-verification-result-new
+ :label (format "Shell %s supported" sh-shell)
+ :message (if supports-shell "yes" "no")
+ :face (if supports-shell 'success '(bold warning))))))
+ :error-explainer
+ (lambda (err)
+ (let ((error-code (flycheck-error-id err))
+ (url "https://github.com/koalaman/shellcheck/wiki/%s"))
+ (and error-code `(url . ,(format url error-code))))))
+
+(flycheck-define-checker slim
+ "A Slim syntax checker using the Slim compiler.
+
+See URL `http://slim-lang.com'."
+ :command ("slimrb" "--compile")
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ "Slim::Parser::SyntaxError:" (message) (optional "\r") "\n "
+ "STDIN, Line " line (optional ", Column " column)
+ line-end))
+ :modes slim-mode
+ :next-checkers ((warning . slim-lint)))
+
+(flycheck-define-checker slim-lint
+ "A Slim linter.
+
+See URL `https://github.com/sds/slim-lint'."
+ :command ("slim-lint" "--reporter=checkstyle" source)
+ :error-parser flycheck-parse-checkstyle
+ :modes slim-mode)
+
+(flycheck-define-checker sql-sqlint
+ "A SQL syntax checker using the sqlint tool.
+
+See URL `https://github.com/purcell/sqlint'."
+ :command ("sqlint")
+ :standard-input t
+ :error-patterns
+ ((warning line-start "stdin:" line ":" column ":WARNING "
+ (message (one-or-more not-newline)
+ (zero-or-more "\n"
+ (one-or-more " ")
+ (one-or-more not-newline)))
+ line-end)
+ (error line-start "stdin:" line ":" column ":ERROR "
+ (message (one-or-more not-newline)
+ (zero-or-more "\n"
+ (one-or-more " ")
+ (one-or-more not-newline)))
+ line-end))
+ :modes (sql-mode))
+
+(flycheck-define-checker systemd-analyze
+ "A systemd unit checker using systemd-analyze(1).
+
+See URL
+`https://www.freedesktop.org/software/systemd/man/systemd-analyze.html'."
+ :command ("systemd-analyze" "verify" source)
+ :error-parser flycheck-parse-with-patterns-without-color
+ :error-patterns
+ ((error line-start (file-name) ":" (optional line ":") (message) line-end)
+ (error line-start "[" (file-name) ":" line "]" (message) line-end))
+ :error-filter (lambda (errors)
+ (flycheck-sanitize-errors
+ (flycheck-fill-empty-line-numbers errors)))
+ :modes (systemd-mode))
+
+(flycheck-def-config-file-var flycheck-chktexrc tex-chktex ".chktexrc")
+
+(flycheck-define-checker tcl-nagelfar
+ "An extensible tcl syntax checker
+
+See URL `http://nagelfar.sourceforge.net/'."
+ :command ("nagelfar" "-H" source)
+ :error-patterns
+ ;; foo.tcl: 29: E Wrong number of arguments (4) to "set"
+ ;; foo.tcl: 29: W Expr without braces
+ ((info line-start (file-name) ": " line ": N " (message) line-end)
+ (warning line-start (file-name) ": " line ": W " (message) line-end)
+ (error line-start (file-name) ": " line ": E " (message) line-end))
+ :modes tcl-mode)
+
+(flycheck-define-checker terraform
+ "A Terraform syntax checker with `terraform fmt'.
+
+See URL `https://www.terraform.io/docs/commands/fmt.html'."
+ :command ("terraform" "fmt" "-no-color" "-")
+ :standard-input t
+ :error-patterns
+ ((error line-start "Error: " (one-or-more not-newline)
+ "\n\n on <stdin> line " line ", in " (one-or-more not-newline) ":"
+ (one-or-more "\n" (zero-or-more space (one-or-more not-newline)))
+ (message (one-or-more (and (one-or-more (not (any ?\n))) ?\n)))
+ line-end)
+ (error line-start "Error: " (one-or-more not-newline)
+ "\n\n on <stdin> line " line ":\n (source code not available)\n\n"
+ (message (one-or-more (and (one-or-more (not (any ?\n))) ?\n)))
+ line-end))
+ :next-checkers ((warning . terraform-tflint))
+ :modes terraform-mode)
+
+(flycheck-def-option-var flycheck-tflint-variable-files nil terraform-tflint
+ "A list of files to resolve terraform variables.
+
+The value of this variable is a list of strings, where each
+string is a file to add to the terraform variables files.
+Relative files are relative to the file being checked."
+ :type '(repeat (directory :tag "Variable file"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "32"))
+
+(defun flycheck-parse-tflint-linter (output checker buffer)
+ "Parse tflint warnings from JSON OUTPUT.
+
+CHECKER and BUFFER denote the CHECKER that returned OUTPUT and
+the BUFFER that was checked respectively.
+
+See URL `https://github.com/wata727/tflint' for more
+information about tflint."
+ (mapcar (lambda (err)
+ (let-alist err
+ (flycheck-error-new-at
+ .range.start.line
+ .range.start.column
+ (pcase .rule.severity
+ ("error" 'error)
+ ("warning" 'warning)
+ (_ 'error))
+ .message
+ :end-line .range.end.line
+ :end-column .range.end.column
+ :id .rule.name
+ :checker checker
+ :buffer buffer
+ :filename (buffer-file-name buffer))))
+ (cdr (assq 'issues (car (flycheck-parse-json output))))))
+
+(flycheck-define-checker terraform-tflint
+ "A Terraform checker using tflint.
+
+See URL `https://github.com/wata727/tflint'."
+ :command ("tflint" "--format=json"
+ (option-list "--var-file=" flycheck-tflint-variable-files concat)
+ source-original)
+ :error-parser flycheck-parse-tflint-linter
+ :predicate flycheck-buffer-saved-p
+ :modes terraform-mode)
+
+(flycheck-define-checker tex-chktex
+ "A TeX and LaTeX syntax and style checker using chktex.
+
+See URL `http://www.nongnu.org/chktex/'."
+ :command ("chktex"
+ (config-file "--localrc" flycheck-chktexrc)
+ ;; Compact error messages, and no version information, and execute
+ ;; \input statements
+ "--verbosity=0" "--quiet" "--inputfiles")
+ :standard-input t
+ :error-patterns
+ ((warning line-start "stdin:" line ":" column ":"
+ (id (one-or-more digit)) ":" (message) line-end))
+ :error-filter
+ (lambda (errors)
+ (flycheck-sanitize-errors (flycheck-increment-error-columns errors)))
+ :modes (latex-mode plain-tex-mode))
+
+(flycheck-define-checker tex-lacheck
+ "A LaTeX syntax and style checker using lacheck.
+
+See URL `http://www.ctan.org/pkg/lacheck'."
+ :command ("lacheck" source-inplace)
+ :error-patterns
+ ((warning line-start
+ "\"" (file-name) "\", line " line ": " (message)
+ line-end))
+ :modes latex-mode)
+
+(flycheck-define-checker texinfo
+ "A Texinfo syntax checker using makeinfo.
+
+See URL `http://www.gnu.org/software/texinfo/'."
+ :command ("makeinfo" "-o" null-device "-")
+ :standard-input t
+ :error-patterns
+ ((warning line-start
+ "-:" line (optional ":" column) ": " "warning: " (message)
+ line-end)
+ (error line-start
+ "-:" line (optional ":" column) ": " (message)
+ line-end))
+ :modes texinfo-mode)
+
+(flycheck-def-config-file-var flycheck-textlint-config
+ textlint "textlintrc.json")
+
+;; This needs to be set because textlint plugins are installed separately,
+;; and there is no way to check their installation status -- textlint simply
+;; prints a backtrace.
+(flycheck-def-option-var flycheck-textlint-plugin-alist
+ '((markdown-mode . "@textlint/markdown")
+ (gfm-mode . "@textlint/markdown")
+ (t . "@textlint/text"))
+ textlint
+ "An alist mapping major modes to textlint plugins.
+
+Each item is a cons cell `(MAJOR-MODE . PLUGIN)', where MAJOR-MODE is a mode
+`flycheck-textlint' supports and PLUGIN is a textlint plugin. As a catch-all,
+when MAJOR-MODE is t, that PLUGIN will be used for any supported mode that
+isn't specified.
+
+See URL `https://npms.io/search?q=textlint-plugin' for all textlint plugins
+published on NPM."
+ :type '(repeat (choice (cons symbol string)
+ (cons (const t) string))))
+
+(defun flycheck--textlint-get-plugin ()
+ "Return the textlint plugin for the current mode."
+ (cdr (-first
+ (lambda (arg)
+ (pcase-let ((`(,mode . _) arg))
+ (or (and (booleanp mode) mode) ; mode is t
+ (derived-mode-p mode))))
+ flycheck-textlint-plugin-alist)))
+
+(flycheck-define-checker textlint
+ "A text prose linter using textlint.
+
+See URL `https://textlint.github.io/'."
+ :command ("textlint"
+ (config-file "--config" flycheck-textlint-config)
+ "--format" "json"
+ ;; get the first matching plugin from plugin-alist
+ "--plugin"
+ (eval (flycheck--textlint-get-plugin))
+ source)
+ ;; textlint seems to say that its json output is compatible with ESLint.
+ ;; https://textlint.github.io/docs/formatter.html
+ :error-parser flycheck-parse-eslint
+ ;; textlint can support different formats with textlint plugins, but
+ ;; only text and markdown formats are installed by default. Ask the
+ ;; user to add mode->plugin mappings manually in
+ ;; `flycheck-textlint-plugin-alist'.
+ :modes
+ (text-mode markdown-mode gfm-mode message-mode adoc-mode
+ mhtml-mode latex-mode org-mode rst-mode)
+ :enabled
+ (lambda () (flycheck--textlint-get-plugin))
+ :verify
+ (lambda (_)
+ (let ((plugin (flycheck--textlint-get-plugin)))
+ (list
+ (flycheck-verification-result-new
+ :label "textlint plugin"
+ :message plugin
+ :face 'success)))))
+
+(flycheck-def-config-file-var flycheck-typescript-tslint-config
+ typescript-tslint "tslint.json"
+ :package-version '(flycheck . "27"))
+
+(flycheck-def-option-var flycheck-typescript-tslint-rulesdir
+ nil typescript-tslint
+ "The directory of custom rules for TSLint.
+
+The value of this variable is either a string containing the path
+to a directory with custom rules, or nil, to not give any custom
+rules to TSLint.
+
+Refer to the TSLint manual at URL
+`http://palantir.github.io/tslint/usage/cli/'
+for more information about the custom directory."
+ :type '(choice (const :tag "No custom rules directory" nil)
+ (directory :tag "Custom rules directory"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "27"))
+
+(flycheck-def-args-var flycheck-tslint-args (typescript-tslint)
+ :package-version '(flycheck . "31"))
+
+(flycheck-define-checker typescript-tslint
+ "TypeScript style checker using TSLint.
+
+Note that this syntax checker is not used if
+`flycheck-typescript-tslint-config' is nil or refers to a
+non-existing file.
+
+See URL `https://github.com/palantir/tslint'."
+ :command ("tslint" "--format" "json"
+ (config-file "--config" flycheck-typescript-tslint-config)
+ (option "--rules-dir" flycheck-typescript-tslint-rulesdir)
+ (eval flycheck-tslint-args)
+ source-inplace)
+ :error-parser flycheck-parse-tslint
+ :modes (typescript-mode))
+
+(flycheck-def-option-var flycheck-verilator-include-path nil verilog-verilator
+ "A list of include directories for Verilator.
+
+The value of this variable is a list of strings, where each
+string is a directory to add to the include path of Verilator.
+Relative paths are relative to the file being checked."
+ :type '(repeat (directory :tag "Include directory"))
+ :safe #'flycheck-string-list-p
+ :package-version '(flycheck . "0.24"))
+
+(flycheck-define-checker verilog-verilator
+ "A Verilog syntax checker using the Verilator Verilog HDL simulator.
+
+See URL `https://www.veripool.org/wiki/verilator'."
+ :command ("verilator" "--lint-only" "-Wall"
+ (option-list "-I" flycheck-verilator-include-path concat)
+ source)
+ :error-patterns
+ ((warning line-start "%Warning-" (zero-or-more not-newline) ": "
+ (file-name) ":" line ": " (message) line-end)
+ (error line-start "%Error: " (file-name) ":"
+ line ": " (message) line-end))
+ :modes verilog-mode)
+
+(flycheck-def-option-var flycheck-ghdl-language-standard nil vhdl-ghdl
+ "The language standard to use in GHDL.
+
+The value of this variable is either a string denoting a language
+standard, or nil, to use the default standard. When non-nil,
+pass the language standard via the `--std' option."
+ :type '(choice (const :tag "Default standard" nil)
+ (string :tag "Language standard"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "32"))
+(make-variable-buffer-local 'flycheck-ghdl-language-standard)
+
+(flycheck-def-option-var flycheck-ghdl-workdir nil vhdl-ghdl
+ "The directory to use for the file library.
+
+The value of this variable is either a string with the directory
+to use for the file library, or nil, to use the default value.
+When non-nil, pass the directory via the `--workdir' option."
+ :type '(choice (const :tag "Default directory" nil)
+ (string :tag "Directory for the file library"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "32"))
+(make-variable-buffer-local 'flycheck-ghdl-workdir)
+
+(flycheck-def-option-var flycheck-ghdl-ieee-library nil vhdl-ghdl
+ "The standard to use for the IEEE library.
+
+The value of this variable is either a string denoting an ieee library
+standard, or nil, to use the default standard. When non-nil,
+pass the ieee library standard via the `--ieee' option."
+ :type '(choice (const :tag "Default standard" nil)
+ (const :tag "No IEEE Library" "none")
+ (const :tag "IEEE standard" "standard")
+ (const :tag "Synopsys standard" "synopsys")
+ (const :tag "Mentor standard" "mentor"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "32"))
+(make-variable-buffer-local 'flycheck-ghdl-ieee-library)
+
+(flycheck-define-checker vhdl-ghdl
+ "A VHDL syntax checker using GHDL.
+
+See URL `https://github.com/ghdl/ghdl'."
+ :command ("ghdl"
+ "-s" ; only do the syntax checking
+ (option "--std=" flycheck-ghdl-language-standard concat)
+ (option "--workdir=" flycheck-ghdl-workdir concat)
+ (option "--ieee=" flycheck-ghdl-ieee-library concat)
+ source)
+ :error-patterns
+ ((error line-start (file-name) ":" line ":" column ": " (message) line-end))
+ :modes vhdl-mode)
+
+(flycheck-def-option-var flycheck-xml-xmlstarlet-xsd-path nil xml-xmlstarlet
+ "An XSD schema to validate against."
+ :type '(choice (const :tag "None" nil)
+ (file :tag "XSD schema"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "31"))
+
+(flycheck-define-checker xml-xmlstarlet
+ "A XML syntax checker and validator using the xmlstarlet utility.
+
+See URL `http://xmlstar.sourceforge.net/'."
+ ;; Validate standard input with verbose error messages, and do not dump
+ ;; contents to standard output
+ :command ("xmlstarlet" "val" "--err" "--quiet"
+ (option "--xsd" flycheck-xml-xmlstarlet-xsd-path)
+ "-")
+ :standard-input t
+ :error-patterns
+ ((error line-start "-:" line "." column ": " (message) line-end))
+ :modes (xml-mode nxml-mode))
+
+(flycheck-def-option-var flycheck-xml-xmllint-xsd-path nil xml-xmllint
+ "An XSD schema to validate against."
+ :type '(choice (const :tag "None" nil)
+ (file :tag "XSD schema"))
+ :safe #'flycheck-string-or-nil-p
+ :package-version '(flycheck . "31"))
+
+(flycheck-define-checker xml-xmllint
+ "A XML syntax checker and validator using the xmllint utility.
+
+The xmllint is part of libxml2, see URL
+`http://www.xmlsoft.org/'."
+ :command ("xmllint" "--noout"
+ (option "--schema" flycheck-xml-xmllint-xsd-path)
+ "-")
+ :standard-input t
+ :error-patterns
+ ((error line-start "-:" line ": " (message) line-end))
+ :modes (xml-mode nxml-mode))
+
+(flycheck-define-checker yaml-jsyaml
+ "A YAML syntax checker using JS-YAML.
+
+See URL `https://github.com/nodeca/js-yaml'."
+ :command ("js-yaml")
+ :standard-input t
+ :error-patterns
+ ((error line-start
+ (or "JS-YAML" "YAMLException") ": "
+ (message) " at line " line ", column " column ":"
+ line-end)
+ (error line-start
+ (or "JS-YAML" "YAMLException") ": "
+ (message) " (" line ":" column ")"
+ line-end))
+ :modes yaml-mode
+ :next-checkers ((warning . yaml-yamllint)
+ (warning . cwl)))
+
+(flycheck-define-checker yaml-ruby
+ "A YAML syntax checker using Ruby's YAML parser.
+
+This syntax checker uses the YAML parser from Ruby's standard
+library.
+
+See URL `http://www.ruby-doc.org/stdlib-2.0.0/libdoc/yaml/rdoc/YAML.html'."
+ :command ("ruby" "-ryaml" "-e" "begin;
+ YAML.load(STDIN); \
+ rescue Exception => e; \
+ STDERR.puts \"stdin:#{e}\"; \
+ end")
+ :standard-input t
+ :error-patterns
+ ((error line-start "stdin:" (zero-or-more not-newline) ":" (message)
+ "at line " line " column " column line-end))
+ :modes yaml-mode
+ :next-checkers ((warning . yaml-yamllint)
+ (warning . cwl)))
+
+(flycheck-def-config-file-var flycheck-yamllintrc yaml-yamllint ".yamllint")
+
+(flycheck-define-checker yaml-yamllint
+ "A YAML syntax checker using YAMLLint.
+See URL `https://github.com/adrienverge/yamllint'."
+ :standard-input t
+ :command ("yamllint" "-f" "parsable" "-"
+ (config-file "-c" flycheck-yamllintrc))
+ :error-patterns
+ ((error line-start
+ "stdin:" line ":" column ": [error] " (message) line-end)
+ (warning line-start
+ "stdin:" line ":" column ": [warning] " (message) line-end))
+ :modes yaml-mode
+ :next-checkers ((warning . cwl)))
+
+(provide 'flycheck)
+
+;; Local Variables:
+;; coding: utf-8
+;; indent-tabs-mode: nil
+;; End:
+
+;;; flycheck.el ends here
diff --git a/elpa/flycheck-20220314.27/flycheck.elc b/elpa/flycheck-20220314.27/flycheck.elc
new file mode 100644
index 0000000..a2909bd
--- /dev/null
+++ b/elpa/flycheck-20220314.27/flycheck.elc
Binary files differ
diff --git a/elpa/flycheck-irony-20180604.2152/flycheck-irony-autoloads.el b/elpa/flycheck-irony-20180604.2152/flycheck-irony-autoloads.el
new file mode 100644
index 0000000..05909d3
--- /dev/null
+++ b/elpa/flycheck-irony-20180604.2152/flycheck-irony-autoloads.el
@@ -0,0 +1,28 @@
+;;; flycheck-irony-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "flycheck-irony" "flycheck-irony.el" (0 0 0
+;;;;;; 0))
+;;; Generated autoloads from flycheck-irony.el
+
+(autoload 'flycheck-irony-setup "flycheck-irony" "\
+Setup Flycheck Irony.
+
+Add `irony' to `flycheck-checkers'." t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "flycheck-irony" '("flycheck-irony-")))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; flycheck-irony-autoloads.el ends here
diff --git a/elpa/flycheck-irony-20180604.2152/flycheck-irony-pkg.el b/elpa/flycheck-irony-20180604.2152/flycheck-irony-pkg.el
new file mode 100644
index 0000000..98dbf82
--- /dev/null
+++ b/elpa/flycheck-irony-20180604.2152/flycheck-irony-pkg.el
@@ -0,0 +1,2 @@
+;;; Generated package description from flycheck-irony.el -*- no-byte-compile: t -*-
+(define-package "flycheck-irony" "20180604.2152" "Flycheck: C/C++ support via Irony" '((emacs "24.1") (flycheck "0.22") (irony "0.2.0")) :commit "42dbecd4a865cabeb301193bb4d660e26ae3befe" :authors '(("Guillaume Papin" . "guillaume.papin@epitech.eu")) :maintainer '("Guillaume Papin" . "guillaume.papin@epitech.eu") :keywords '("convenience" "tools" "c") :url "https://github.com/Sarcasm/flycheck-irony/")
diff --git a/elpa/flycheck-irony-20180604.2152/flycheck-irony.el b/elpa/flycheck-irony-20180604.2152/flycheck-irony.el
new file mode 100644
index 0000000..bc82e2c
--- /dev/null
+++ b/elpa/flycheck-irony-20180604.2152/flycheck-irony.el
@@ -0,0 +1,121 @@
+;;; flycheck-irony.el --- Flycheck: C/C++ support via Irony -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2014-2015 Guillaume Papin
+
+;; Author: Guillaume Papin <guillaume.papin@epitech.eu>
+;; Keywords: convenience, tools, c
+;; Package-Version: 20180604.2152
+;; Package-Commit: 42dbecd4a865cabeb301193bb4d660e26ae3befe
+;; Version: 0.1.0
+;; URL: https://github.com/Sarcasm/flycheck-irony/
+;; Package-Requires: ((emacs "24.1") (flycheck "0.22") (irony "0.2.0"))
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; C, C++ and Objective-C support for Flycheck, using Irony Mode.
+;;
+;; Usage:
+;;
+;; (eval-after-load 'flycheck
+;; '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup))
+
+;;; Code:
+
+(require 'irony-diagnostics)
+
+(require 'flycheck)
+
+(eval-when-compile
+ (require 'pcase))
+
+(defgroup flycheck-irony nil
+ "Irony-Mode's flycheck checker."
+ :group 'irony)
+
+(defcustom flycheck-irony-error-filter #'identity
+ "A function to filter the errors returned by this checker.
+
+See :error-filter description in `flycheck-define-generic-checker'.
+For an example, take a look at `flycheck-dequalify-error-ids'."
+ :type 'function
+ :group 'flycheck-irony)
+
+(defun flycheck-irony--build-error (checker buffer diagnostic)
+ (let ((severity (irony-diagnostics-severity diagnostic)))
+ (if (memq severity '(note warning error fatal))
+ (flycheck-error-new-at
+ (irony-diagnostics-line diagnostic)
+ (irony-diagnostics-column diagnostic)
+ (pcase severity
+ (`note 'info)
+ (`warning 'warning)
+ ((or `error `fatal) 'error))
+ (irony-diagnostics-message diagnostic)
+ :checker checker
+ :buffer buffer
+ :filename (irony-diagnostics-file diagnostic)))))
+
+(defun flycheck-irony--start (checker callback)
+ (let ((buffer (current-buffer)))
+ (irony-diagnostics-async
+ #'(lambda (status &rest args) ;; closure, lexically bound
+ (pcase status
+ (`error (funcall callback 'errored (car args)))
+ (`cancelled (funcall callback 'finished nil))
+ (`success
+ (let* ((diagnostics (car args))
+ (errors (mapcar #'(lambda (diagnostic)
+ (flycheck-irony--build-error checker buffer diagnostic))
+ diagnostics)))
+ (funcall callback 'finished (delq nil errors)))))))))
+
+(defun flycheck-irony--verify (_checker)
+ "Verify the Flycheck Irony syntax checker."
+ (list
+ (flycheck-verification-result-new
+ :label "Irony Mode"
+ :message (if irony-mode "enabled" "disabled")
+ :face (if irony-mode 'success '(bold warning)))
+
+ ;; FIXME: the logic of `irony--locate-server-executable' could be extracted
+ ;; into something very useful for this verification
+ (let* ((server-path (executable-find (expand-file-name "bin/irony-server"
+ irony-server-install-prefix))))
+ (flycheck-verification-result-new
+ :label "irony-server"
+ :message (if server-path (format "Found at %s" server-path) "Not found")
+ :face (if server-path 'success '(bold error))))))
+
+(flycheck-define-generic-checker 'irony
+ "A syntax checker for C, C++ and Objective-C, using Irony Mode."
+ :start #'flycheck-irony--start
+ :verify #'flycheck-irony--verify
+ :modes irony-supported-major-modes
+ :error-filter flycheck-irony-error-filter
+ :predicate #'(lambda ()
+ irony-mode))
+
+;;;###autoload
+(defun flycheck-irony-setup ()
+ "Setup Flycheck Irony.
+
+Add `irony' to `flycheck-checkers'."
+ (interactive)
+ (add-to-list 'flycheck-checkers 'irony))
+
+(provide 'flycheck-irony)
+
+;;; flycheck-irony.el ends here
diff --git a/elpa/flycheck-irony-20180604.2152/flycheck-irony.elc b/elpa/flycheck-irony-20180604.2152/flycheck-irony.elc
new file mode 100644
index 0000000..370b629
--- /dev/null
+++ b/elpa/flycheck-irony-20180604.2152/flycheck-irony.elc
Binary files differ
diff --git a/elpa/gnupg/pubring.kbx b/elpa/gnupg/pubring.kbx
new file mode 100644
index 0000000..39c049f
--- /dev/null
+++ b/elpa/gnupg/pubring.kbx
Binary files differ
diff --git a/elpa/gnupg/trustdb.gpg b/elpa/gnupg/trustdb.gpg
new file mode 100644
index 0000000..c5e8ee9
--- /dev/null
+++ b/elpa/gnupg/trustdb.gpg
Binary files differ
diff --git a/elpa/ht-20210119.741/ht-autoloads.el b/elpa/ht-20210119.741/ht-autoloads.el
new file mode 100644
index 0000000..c860d46
--- /dev/null
+++ b/elpa/ht-20210119.741/ht-autoloads.el
@@ -0,0 +1,22 @@
+;;; ht-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "ht" "ht.el" (0 0 0 0))
+;;; Generated autoloads from ht.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ht" 'nil))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; ht-autoloads.el ends here
diff --git a/elpa/ht-20210119.741/ht-pkg.el b/elpa/ht-20210119.741/ht-pkg.el
new file mode 100644
index 0000000..91d3285
--- /dev/null
+++ b/elpa/ht-20210119.741/ht-pkg.el
@@ -0,0 +1,2 @@
+;;; Generated package description from ht.el -*- no-byte-compile: t -*-
+(define-package "ht" "20210119.741" "The missing hash table library for Emacs" '((dash "2.12.0")) :commit "c4c1be487d6ecb353d07881526db05d7fc90ea87" :authors '(("Wilfred Hughes" . "me@wilfred.me.uk")) :maintainer '("Wilfred Hughes" . "me@wilfred.me.uk") :keywords '("hash table" "hash map" "hash"))
diff --git a/elpa/ht-20210119.741/ht.el b/elpa/ht-20210119.741/ht.el
new file mode 100644
index 0000000..0809ef1
--- /dev/null
+++ b/elpa/ht-20210119.741/ht.el
@@ -0,0 +1,337 @@
+;;; ht.el --- The missing hash table library for Emacs -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2013 Wilfred Hughes
+
+;; Author: Wilfred Hughes <me@wilfred.me.uk>
+;; Version: 2.4
+;; Package-Version: 20210119.741
+;; Package-Commit: c4c1be487d6ecb353d07881526db05d7fc90ea87
+;; Keywords: hash table, hash map, hash
+;; Package-Requires: ((dash "2.12.0"))
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; The missing hash table library for Emacs.
+;;
+;; See documentation at https://github.com/Wilfred/ht.el
+
+;;; Code:
+
+(require 'dash)
+(require 'gv)
+(eval-when-compile
+ (require 'inline))
+
+(defmacro ht (&rest pairs)
+ "Create a hash table with the key-value pairs given.
+Keys are compared with `equal'.
+
+\(fn (KEY-1 VALUE-1) (KEY-2 VALUE-2) ...)"
+ (let* ((table-symbol (make-symbol "ht-temp"))
+ (assignments
+ (mapcar
+ (lambda (pair) `(ht-set! ,table-symbol ,@pair))
+ pairs)))
+ `(let ((,table-symbol (ht-create)))
+ ,@assignments
+ ,table-symbol)))
+
+(define-inline ht-set! (table key value)
+ "Associate KEY in TABLE with VALUE."
+ (inline-quote
+ (prog1 nil
+ (puthash ,key ,value ,table))))
+
+(defalias 'ht-set 'ht-set!)
+
+(define-inline ht-create (&optional test)
+ "Create an empty hash table.
+
+TEST indicates the function used to compare the hash
+keys. Default is `equal'. It can be `eq', `eql', `equal' or a
+user-supplied test created via `define-hash-table-test'."
+ (declare (side-effect-free t))
+ (inline-quote (make-hash-table :test (or ,test 'equal))))
+
+(defun ht<-alist (alist &optional test)
+ "Create a hash table with initial values according to ALIST.
+
+TEST indicates the function used to compare the hash
+keys. Default is `equal'. It can be `eq', `eql', `equal' or a
+user-supplied test created via `define-hash-table-test'."
+ (declare (side-effect-free t))
+ (let ((h (ht-create test)))
+ ;; the first key-value pair in an alist gets precedence, so we
+ ;; start from the end of the list:
+ (dolist (pair (reverse alist) h)
+ (let ((key (car pair))
+ (value (cdr pair)))
+ (ht-set! h key value)))))
+
+(defalias 'ht-from-alist 'ht<-alist)
+
+(defun ht<-plist (plist &optional test)
+ "Create a hash table with initial values according to PLIST.
+
+TEST indicates the function used to compare the hash
+keys. Default is `equal'. It can be `eq', `eql', `equal' or a
+user-supplied test created via `define-hash-table-test'."
+ (declare (side-effect-free t))
+ (let ((h (ht-create test)))
+ (dolist (pair (nreverse (-partition 2 plist)) h)
+ (let ((key (car pair))
+ (value (cadr pair)))
+ (ht-set! h key value)))))
+
+(defalias 'ht-from-plist 'ht<-plist)
+
+(define-inline ht-get (table key &optional default)
+ "Look up KEY in TABLE, and return the matching value.
+If KEY isn't present, return DEFAULT (nil if not specified)."
+ (declare (side-effect-free t))
+ (inline-quote
+ (gethash ,key ,table ,default)))
+
+;; Don't use `ht-set!' here, gv setter was assumed to return the value
+;; to be set.
+(gv-define-setter ht-get (value table key) `(puthash ,key ,value ,table))
+
+(define-inline ht-get* (table &rest keys)
+ "Look up KEYS in nested hash tables, starting with TABLE.
+The lookup for each key should return another hash table, except
+for the final key, which may return any value."
+ (declare (side-effect-free t))
+ (inline-letevals (table keys)
+ (inline-quote
+ (progn
+ (while ,keys
+ (setf ,table (ht-get ,table (pop ,keys))))
+ ,table))))
+
+(put 'ht-get* 'compiler-macro
+ (lambda (_ table &rest keys)
+ (--reduce-from `(ht-get ,acc ,it) table keys)))
+
+(defun ht-update! (table from-table)
+ "Update TABLE according to every key-value pair in FROM-TABLE."
+ (maphash
+ (lambda (key value) (puthash key value table))
+ from-table)
+ nil)
+
+(defalias 'ht-update 'ht-update!)
+
+(defun ht-merge (&rest tables)
+ "Crete a new tables that includes all the key-value pairs from TABLES.
+If multiple have tables have the same key, the value in the last
+table is used."
+ (let ((merged (ht-create)))
+ (mapc (lambda (table) (ht-update! merged table)) tables)
+ merged))
+
+(define-inline ht-remove! (table key)
+ "Remove KEY from TABLE."
+ (inline-quote (remhash ,key ,table)))
+
+(defalias 'ht-remove 'ht-remove!)
+
+(define-inline ht-clear! (table)
+ "Remove all keys from TABLE."
+ (inline-quote
+ (prog1 nil
+ (clrhash ,table))))
+
+(defalias 'ht-clear 'ht-clear!)
+
+(defun ht-map (function table)
+ "Apply FUNCTION to each key-value pair of TABLE, and make a list of the results.
+FUNCTION is called with two arguments, KEY and VALUE."
+ (let (results)
+ (maphash
+ (lambda (key value)
+ (push (funcall function key value) results))
+ table)
+ results))
+
+(defmacro ht-amap (form table)
+ "Anaphoric version of `ht-map'.
+For every key-value pair in TABLE, evaluate FORM with the
+variables KEY and VALUE bound. If you don't use both of
+these variables, then use `ht-map' to avoid warnings."
+ `(ht-map (lambda (key value) ,form) ,table))
+
+(defun ht-keys (table)
+ "Return a list of all the keys in TABLE."
+ (declare (side-effect-free t))
+ (ht-map (lambda (key _value) key) table))
+
+(defun ht-values (table)
+ "Return a list of all the values in TABLE."
+ (declare (side-effect-free t))
+ (ht-map (lambda (_key value) value) table))
+
+(defun ht-items (table)
+ "Return a list of two-element lists '(key value) from TABLE."
+ (declare (side-effect-free t))
+ (ht-amap (list key value) table))
+
+(defalias 'ht-each 'maphash
+ "Apply FUNCTION to each key-value pair of TABLE.
+Returns nil, used for side-effects only.")
+
+(defmacro ht-aeach (form table)
+ "Anaphoric version of `ht-each'.
+For every key-value pair in TABLE, evaluate FORM with the
+variables key and value bound."
+ `(ht-each (lambda (key value) ,form) ,table))
+
+(defun ht-select-keys (table keys)
+ "Return a copy of TABLE with only the specified KEYS."
+ (declare (side-effect-free t))
+ (let (result)
+ (setq result (make-hash-table :test (hash-table-test table)))
+ (dolist (key keys result)
+ (if (not (equal (gethash key table 'key-not-found) 'key-not-found))
+ (puthash key (gethash key table) result)))))
+
+(defun ht->plist (table)
+ "Return a flat list '(key1 value1 key2 value2...) from TABLE.
+
+Note that hash tables are unordered, so this cannot be an exact
+inverse of `ht<-plist'. The following is not guaranteed:
+
+\(let ((data '(a b c d)))
+ (equalp data
+ (ht->plist (ht<-plist data))))"
+ (declare (side-effect-free t))
+ (apply 'append (ht-items table)))
+
+(defalias 'ht-to-plist 'ht->plist)
+
+(define-inline ht-copy (table)
+ "Return a shallow copy of TABLE (keys and values are shared)."
+ (declare (side-effect-free t))
+ (inline-quote (copy-hash-table ,table)))
+
+(defun ht->alist (table)
+ "Return a list of two-element lists '(key . value) from TABLE.
+
+Note that hash tables are unordered, so this cannot be an exact
+inverse of `ht<-alist'. The following is not guaranteed:
+
+\(let ((data '((a . b) (c . d))))
+ (equalp data
+ (ht->alist (ht<-alist data))))"
+ (declare (side-effect-free t))
+ (ht-amap (cons key value) table))
+
+(defalias 'ht-to-alist 'ht->alist)
+
+(defalias 'ht? 'hash-table-p)
+
+(defalias 'ht-p 'hash-table-p)
+
+(define-inline ht-contains? (table key)
+ "Return 't if TABLE contains KEY."
+ (declare (side-effect-free t))
+ (inline-quote
+ (let ((not-found-symbol (make-symbol "ht--not-found")))
+ (not (eq (ht-get ,table ,key not-found-symbol) not-found-symbol)))))
+
+(defalias 'ht-contains-p 'ht-contains?)
+
+(define-inline ht-size (table)
+ "Return the actual number of entries in TABLE."
+ (declare (side-effect-free t))
+ (inline-quote
+ (hash-table-count ,table)))
+
+(define-inline ht-empty? (table)
+ "Return true if the actual number of entries in TABLE is zero."
+ (declare (side-effect-free t))
+ (inline-quote
+ (zerop (ht-size ,table))))
+
+(defalias 'ht-empty-p 'ht-empty?)
+
+(defun ht-select (function table)
+ "Return a hash table containing all entries in TABLE for which
+FUNCTION returns a truthy value.
+
+FUNCTION is called with two arguments, KEY and VALUE."
+ (let ((results (ht-create)))
+ (ht-each
+ (lambda (key value)
+ (when (funcall function key value)
+ (ht-set! results key value)))
+ table)
+ results))
+
+(defun ht-reject (function table)
+ "Return a hash table containing all entries in TABLE for which
+FUNCTION returns a falsy value.
+
+FUNCTION is called with two arguments, KEY and VALUE."
+ (let ((results (ht-create)))
+ (ht-each
+ (lambda (key value)
+ (unless (funcall function key value)
+ (ht-set! results key value)))
+ table)
+ results))
+
+(defun ht-reject! (function table)
+ "Delete entries from TABLE for which FUNCTION returns a falsy value.
+
+FUNCTION is called with two arguments, KEY and VALUE."
+ (ht-each
+ (lambda (key value)
+ (when (funcall function key value)
+ (remhash key table)))
+ table)
+ nil)
+
+(defalias 'ht-delete-if 'ht-reject!)
+
+(defun ht-find (function table)
+ "Return (key, value) from TABLE for which FUNCTION returns a truthy value.
+Return nil otherwise.
+
+FUNCTION is called with two arguments, KEY and VALUE."
+ (catch 'break
+ (ht-each
+ (lambda (key value)
+ (when (funcall function key value)
+ (throw 'break (list key value))))
+ table)))
+
+(defun ht-equal? (table1 table2)
+ "Return t if TABLE1 and TABLE2 have the same keys and values.
+Does not compare equality predicates."
+ (declare (side-effect-free t))
+ (let ((keys1 (ht-keys table1))
+ (keys2 (ht-keys table2))
+ (sentinel (make-symbol "ht-sentinel")))
+ (and (equal (length keys1) (length keys2))
+ (--all?
+ (equal (ht-get table1 it)
+ (ht-get table2 it sentinel))
+ keys1))))
+
+(defalias 'ht-equal-p 'ht-equal?)
+
+(provide 'ht)
+;;; ht.el ends here
diff --git a/elpa/ht-20210119.741/ht.elc b/elpa/ht-20210119.741/ht.elc
new file mode 100644
index 0000000..d40adfd
--- /dev/null
+++ b/elpa/ht-20210119.741/ht.elc
Binary files differ
diff --git a/elpa/irony-20220110.849/.dir-locals.el b/elpa/irony-20220110.849/.dir-locals.el
new file mode 100644
index 0000000..5e9bd93
--- /dev/null
+++ b/elpa/irony-20220110.849/.dir-locals.el
@@ -0,0 +1,10 @@
+((nil
+ (indent-tabs-mode . nil))
+ (c++-mode
+ (c-basic-offset . 2)
+ (c-file-style . "gnu")
+ (eval . (c-set-offset 'innamespace 0))))
+
+;; Local Variables:
+;; no-byte-compile: t
+;; End
diff --git a/elpa/irony-20220110.849/irony-autoloads.el b/elpa/irony-20220110.849/irony-autoloads.el
new file mode 100644
index 0000000..8e7cf2b
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-autoloads.el
@@ -0,0 +1,169 @@
+;;; irony-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "irony" "irony.el" (0 0 0 0))
+;;; Generated autoloads from irony.el
+
+(defvar irony-additional-clang-options nil "\
+Additional command line options to pass down to libclang.
+
+Please, do NOT use this variable to add header search paths, only
+additional warnings or compiler options.
+
+These compiler options will be prepended to the command line, in
+order to not override the value coming from a compilation
+database.")
+
+(custom-autoload 'irony-additional-clang-options "irony" t)
+
+(autoload 'irony-mode "irony" "\
+Minor mode for C, C++ and Objective-C, powered by libclang.
+
+If called interactively, enable Irony 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.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'irony-version "irony" "\
+Return the version number of the file irony.el.
+
+If called interactively display the version in the echo area.
+
+\(fn &optional SHOW-VERSION)" t nil)
+
+(autoload 'irony-server-kill "irony" "\
+Kill the running irony-server process, if any." t nil)
+
+(autoload 'irony-get-type "irony" "\
+Get the type of symbol under cursor." t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "irony" '("irony-")))
+
+;;;***
+
+;;;### (autoloads nil "irony-cdb" "irony-cdb.el" (0 0 0 0))
+;;; Generated autoloads from irony-cdb.el
+
+(autoload 'irony-cdb-autosetup-compile-options "irony-cdb" nil t nil)
+
+(autoload 'irony-cdb-menu "irony-cdb" nil t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "irony-cdb" '("irony-cdb-")))
+
+;;;***
+
+;;;### (autoloads nil "irony-cdb-clang-complete" "irony-cdb-clang-complete.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from irony-cdb-clang-complete.el
+
+(autoload 'irony-cdb-clang-complete "irony-cdb-clang-complete" "\
+
+
+\(fn COMMAND &rest ARGS)" nil nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "irony-cdb-clang-complete" '("irony-cdb-clang-complete--")))
+
+;;;***
+
+;;;### (autoloads nil "irony-cdb-json" "irony-cdb-json.el" (0 0 0
+;;;;;; 0))
+;;; Generated autoloads from irony-cdb-json.el
+
+(autoload 'irony-cdb-json "irony-cdb-json" "\
+
+
+\(fn COMMAND &rest ARGS)" nil nil)
+
+(autoload 'irony-cdb-json-add-compile-commands-path "irony-cdb-json" "\
+Add an out-of-source compilation database.
+
+Files below the PROJECT-ROOT directory will use the JSON
+Compilation Database as specified by COMPILE-COMMANDS-PATH.
+
+The JSON Compilation Database are often generated in the build
+directory. This functions helps mapping out-of-source build
+directories to project directory.
+
+\(fn PROJECT-ROOT COMPILE-COMMANDS-PATH)" t nil)
+
+(autoload 'irony-cdb-json-select "irony-cdb-json" "\
+Select CDB to use with a prompt.
+
+It is useful when you have several CDBs with the same project
+root.
+
+The completion function used internally is `completing-read' so
+it could easily be used with other completion functions by
+temporarily using a let-bind on `completing-read-function'. Or
+even helm by enabling `helm-mode' before calling the function." t nil)
+
+(autoload 'irony-cdb-json-select-most-recent "irony-cdb-json" "\
+Select CDB that is most recently modified." t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "irony-cdb-json" '("irony-cdb-json--")))
+
+;;;***
+
+;;;### (autoloads nil "irony-cdb-libclang" "irony-cdb-libclang.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from irony-cdb-libclang.el
+
+(autoload 'irony-cdb-libclang "irony-cdb-libclang" "\
+
+
+\(fn COMMAND &rest ARGS)" nil nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "irony-cdb-libclang" '("irony-cdb-libclang--")))
+
+;;;***
+
+;;;### (autoloads nil "irony-completion" "irony-completion.el" (0
+;;;;;; 0 0 0))
+;;; Generated autoloads from irony-completion.el
+
+(autoload 'irony-completion-at-point "irony-completion" nil nil nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "irony-completion" '("irony-")))
+
+;;;***
+
+;;;### (autoloads nil "irony-diagnostics" "irony-diagnostics.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from irony-diagnostics.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "irony-diagnostics" '("irony-diagnostics-")))
+
+;;;***
+
+;;;### (autoloads nil "irony-iotask" "irony-iotask.el" (0 0 0 0))
+;;; Generated autoloads from irony-iotask.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "irony-iotask" '("irony-iotask-")))
+
+;;;***
+
+;;;### (autoloads nil "irony-snippet" "irony-snippet.el" (0 0 0 0))
+;;; Generated autoloads from irony-snippet.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "irony-snippet" '("irony-snippet-")))
+
+;;;***
+
+;;;### (autoloads nil nil ("irony-pkg.el") (0 0 0 0))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; irony-autoloads.el ends here
diff --git a/elpa/irony-20220110.849/irony-cdb-clang-complete.el b/elpa/irony-20220110.849/irony-cdb-clang-complete.el
new file mode 100644
index 0000000..a9143a8
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-cdb-clang-complete.el
@@ -0,0 +1,79 @@
+;;; irony-cdb-clang-complete.el --- .clang_complete compilation database
+
+;; Copyright (C) 2014 Guillaume Papin
+
+;; Author: Guillaume Papin <guillaume.papin@epitech.eu>
+;; Keywords: c, convenience, tools
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; This file defines a compilation database for .clang_complete and
+;; compile_flags.txt, both of which have the same format.
+;;
+
+;;; Code:
+
+(require 'irony-cdb)
+
+(require 'cl-lib)
+
+;;;###autoload
+(defun irony-cdb-clang-complete (command &rest args)
+ (cl-case command
+ (get-compile-options (irony-cdb-clang-complete--get-compile-options))))
+
+(defun irony-cdb-clang-complete--get-compile-options ()
+ (irony--awhen (irony-cdb-clang-complete--locate-db)
+ (irony-cdb-clang-complete--load-db it)))
+
+(defun irony-cdb-clang-complete--locate-db ()
+ (when buffer-file-name
+ (catch 'fname
+ (locate-dominating-file
+ buffer-file-name
+ ;; locate-dominating-file will invoke the lambda on suitable
+ ;; directories, and if we have either of our files there, we
+ ;; return its filename, by throwing it.
+ (lambda (d)
+ (let ((cfname (concat (file-name-as-directory d) "compile_flags.txt"))
+ (ccname (concat (file-name-as-directory d) ".clang_complete")))
+ (if (file-exists-p cfname)
+ (throw 'fname cfname)
+ (if (file-exists-p ccname)
+ (throw 'fname ccname)
+ nil))))))))
+
+(defun irony-cdb-clang-complete--load-db (cc-file)
+ (with-temp-buffer
+ (insert-file-contents cc-file)
+ (list
+ (cons
+ ;; compile options with trailing whitespaces removed
+ (mapcar #'(lambda (line)
+ (if (string-match "[ \t]+$" line)
+ (replace-match "" t t line)
+ line))
+ (split-string (buffer-string) "\n" t))
+ ;; working directory
+ (expand-file-name (file-name-directory cc-file))))))
+
+(provide 'irony-cdb-clang-complete)
+
+;; Local Variables:
+;; byte-compile-warnings: (not cl-functions)
+;; End:
+
+;;; irony-cdb-clang-complete ends here
diff --git a/elpa/irony-20220110.849/irony-cdb-clang-complete.elc b/elpa/irony-20220110.849/irony-cdb-clang-complete.elc
new file mode 100644
index 0000000..841def6
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-cdb-clang-complete.elc
Binary files differ
diff --git a/elpa/irony-20220110.849/irony-cdb-json.el b/elpa/irony-20220110.849/irony-cdb-json.el
new file mode 100644
index 0000000..f24e144
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-cdb-json.el
@@ -0,0 +1,336 @@
+;;; irony-cdb-json.el --- JSON Compilation Database support for irony
+
+;; Copyright (C) 2014 Guillaume Papin
+
+;; Author: Guillaume Papin <guillaume.papin@epitech.eu>
+;; Keywords: c, convenience, tools
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; JSON Compilation Database support for Irony, see
+;; http://clang.llvm.org/docs/JSONCompilationDatabase.html.
+;;
+
+;;; Code:
+
+(require 'irony-cdb)
+
+(require 'cl-lib)
+
+(require 'json)
+(require 'pp)
+
+(defvar irony-cdb-json--project-alist nil
+ "Alist of source directory and compile_commands.json locations.
+
+Note, the compile_commands.json location may be relative to the
+source directory.")
+
+(defconst irony-cdb-json--project-alist-file
+ (concat irony-user-dir "cdb-json-projects"))
+
+;;;###autoload
+(defun irony-cdb-json (command &rest args)
+ (cl-case command
+ (get-compile-options (irony-cdb-json--get-compile-options))))
+
+;;;###autoload
+(defun irony-cdb-json-add-compile-commands-path (project-root
+ compile-commands-path)
+ "Add an out-of-source compilation database.
+
+Files below the PROJECT-ROOT directory will use the JSON
+Compilation Database as specified by COMPILE-COMMANDS-PATH.
+
+The JSON Compilation Database are often generated in the build
+directory. This functions helps mapping out-of-source build
+directories to project directory."
+ (interactive
+ (progn
+ (let ((proot (read-directory-name "Project root:" nil nil t)))
+ (list proot (read-file-name "Compile commands:" proot nil t
+ "compile_commands.json")))))
+ (add-to-list 'irony-cdb-json--project-alist
+ (cons (expand-file-name project-root)
+ (expand-file-name compile-commands-path)))
+ (irony-cdb-json--save-project-alist)
+
+ ; and tell irony to load it now
+ (irony-cdb-autosetup-compile-options))
+
+(defun irony-cdb-json--put-first (pos target-list)
+ (if (>= pos (length target-list))
+ target-list
+ (let ((elm (nth pos target-list)))
+ (append (list elm) (delete elm target-list)))))
+
+(defun irony-cdb-json--choose-cdb ()
+ "Prompt to select CDB from current project root."
+ (let* ((proot (irony-cdb-json--find-best-prefix-path
+ (irony-cdb-json--target-path)
+ (mapcar 'car irony-cdb-json--project-alist)))
+ (cdbs (mapcar 'cdr
+ (cl-remove-if-not (lambda (x) (string-equal proot (car x)))
+ irony-cdb-json--project-alist))))
+ (completing-read "Choose Irony CDB: " cdbs nil 'require-match nil)))
+
+;;;###autoload
+(defun irony-cdb-json-select ()
+ "Select CDB to use with a prompt.
+
+It is useful when you have several CDBs with the same project
+root.
+
+The completion function used internally is `completing-read' so
+it could easily be used with other completion functions by
+temporarily using a let-bind on `completing-read-function'. Or
+even helm by enabling `helm-mode' before calling the function."
+ (interactive)
+ (let ((pos (cl-position (irony-cdb-json--choose-cdb)
+ irony-cdb-json--project-alist
+ :test (lambda (x y) (string-equal x (cdr y))))))
+ (setq irony-cdb-json--project-alist
+ (irony-cdb-json--put-first pos irony-cdb-json--project-alist))
+ (irony-cdb-json--save-project-alist)
+ (irony-cdb-autosetup-compile-options)))
+
+(defun irony-cdb-json--last-mod (file)
+ "File modification time or null time if file doesn't exist."
+ (or (nth 5 (file-attributes file))
+ '(0 0 0 0)))
+
+;;;###autoload
+(defun irony-cdb-json-select-most-recent ()
+ "Select CDB that is most recently modified."
+ (interactive)
+ (setq irony-cdb-json--project-alist
+ (sort irony-cdb-json--project-alist
+ (lambda (x y)
+ (time-less-p (irony-cdb-json--last-mod (cdr y))
+ (irony-cdb-json--last-mod (cdr x))))))
+ (irony-cdb-json--save-project-alist)
+ (irony-cdb-autosetup-compile-options))
+
+(defun irony-cdb-json--get-compile-options ()
+ (irony--awhen (irony-cdb-json--locate-db)
+ (let ((db (irony-cdb-json--load-db it)))
+ (irony--aif (irony-cdb-json--exact-flags db)
+ it
+ (let ((dir-cdb (irony-cdb-json--compute-directory-cdb db)))
+ (irony-cdb-json--guess-flags dir-cdb))))))
+
+(defsubst irony-cdb-json--target-path ()
+ (or buffer-file-name (expand-file-name default-directory)))
+
+(defun irony-cdb-json--ensure-project-alist-loaded ()
+ (unless irony-cdb-json--project-alist
+ (irony-cdb-json--load-project-alist)))
+
+(defun irony-cdb-json--save-project-alist ()
+ (with-temp-file irony-cdb-json--project-alist-file
+ (insert ";; -*- emacs-lisp -*-\n\
+;;\n\
+;; JSON Compilation Database project list.\n\
+;;\n\
+;; File auto-generated by irony-cdb-json.\n\
+;;\n")
+ (pp irony-cdb-json--project-alist (current-buffer))
+ (insert "\n")))
+
+(defun irony-cdb-json--load-project-alist ()
+ (when (file-exists-p irony-cdb-json--project-alist-file)
+ (setq irony-cdb-json--project-alist
+ (with-temp-buffer
+ (insert-file-contents irony-cdb-json--project-alist-file)
+ (read (current-buffer))))))
+
+(defun irony-cdb-json--find-best-prefix-path (file prefixes)
+ (cl-loop for prefix in prefixes
+ with found = nil
+ ;; keep the closest directory
+ if (and (string-prefix-p prefix file)
+ (> (length prefix) (length found)))
+ do (setq found prefix)
+ finally return found))
+
+(defun irony-cdb-json--locate-db ()
+ (irony-cdb-json--ensure-project-alist-loaded)
+ (irony--aif (irony-cdb-json--find-best-prefix-path
+ (irony-cdb-json--target-path)
+ (mapcar 'car irony-cdb-json--project-alist))
+ (expand-file-name
+ (cdr (assoc it irony-cdb-json--project-alist))
+ it)
+ ;; If not in the project table, look in the dominating directories
+ (irony--awhen (irony-cdb--locate-dominating-file-with-dirs
+ (irony-cdb-json--target-path)
+ "compile_commands.json"
+ irony-cdb-search-directory-list)
+ (expand-file-name it))))
+
+(defvar irony-cdb-json--cache-key nil
+ "The name of the last loaded JSON file and its modification time.")
+(defvar irony-cdb-json--cache-cdb nil
+ "The last loaded compilation database.")
+
+(defun irony-cdb-json--make-cache-key (file)
+ (irony--aif (file-attributes file)
+ (cons file (nth 5 it))))
+
+(defun irony-cdb-json--load-db (json-file)
+ (let ((cache-key (irony-cdb-json--make-cache-key json-file)))
+ (unless (and cache-key (equal irony-cdb-json--cache-key cache-key))
+ (setq irony-cdb-json--cache-cdb
+ (delq nil (mapcar #'irony-cdb-json--transform-compile-command
+ ;; JSON read may throw
+ (json-read-file json-file))))
+ (setq irony-cdb-json--cache-key cache-key)))
+ irony-cdb-json--cache-cdb)
+
+(defun irony-cdb-json--exact-flags (file-cdb)
+ (when buffer-file-name
+ (mapcar #'(lambda (e)
+ (cons (nth 1 e) (nth 2 e)))
+ (irony--assoc-all buffer-file-name file-cdb))))
+
+(defun irony-cdb-json--guess-flags (dir-cdb)
+ (cl-loop for e in dir-cdb
+ with buf-path = (irony-cdb-json--target-path)
+ with found = nil
+ for dir = (car e)
+ ;; keep the closest directory
+ if (and (string-prefix-p dir buf-path)
+ (> (length dir) (length (car found))))
+ do (setq found e)
+ finally return (list (cons (nth 1 found) (nth 2 found)))))
+
+(defsubst irony-cdb-json--compile-command-directory (compile-command)
+ (cdr (assq 'directory compile-command)))
+
+(defsubst irony-cdb-json--compile-command-file (compile-command)
+ (cdr (assq 'file compile-command)))
+
+(defun irony-cdb-json--compile-command-options (compile-command)
+ "Return the compile options of COMPILE-COMMAND as a list."
+ (let ((command (assq 'command compile-command))
+ (arguments (assq 'arguments compile-command)))
+ (irony-cdb--remove-compiler-from-flags
+ (cond (command (irony--split-command-line (cdr command)))
+ (arguments (append (cdr arguments) nil))))))
+
+(defun irony-cdb-json--adjust-compile-options (compile-options file default-dir)
+ "Adjust COMPILE-OPTIONS to only use options useful for parsing.
+
+COMPILE-OPTIONS is modified by side effects but the returned list
+should be used since elements can change at the head.
+
+Removes the input file, the output file, ...
+
+Relative paths are relative to DEFAULT-DIR."
+ ;; compute the truename of the absolute path for FILE only once
+ (setq file (file-truename (expand-file-name file default-dir)))
+ (let* ((head (cons 'nah compile-options))
+ (it head)
+ opt)
+ (while (setq opt (cadr it))
+ (cond
+ ;; end of options, skip all positional arguments (source files)
+ ((string= opt "--")
+ (setcdr it nil))
+ ;; strip -c
+ ((string= "-c" opt)
+ (setcdr it (nthcdr 2 it)))
+ ;; strip -o <output-file> and -o<output-file>
+ ((string-prefix-p "-o" opt)
+ (if (string= opt "-o")
+ (setcdr it (nthcdr 3 it))
+ (setcdr it (nthcdr 2 it))))
+ ;; skip input file; avoid invoking file commands if an option argument
+ ((and (not (string-prefix-p "-" opt)) (string= file (file-truename (expand-file-name opt default-dir))))
+ (setcdr it (nthcdr 2 it)))
+ (t
+ ;; if head of cdr hasn't been skipped, iterate, otherwise check if the
+ ;; new cdr need skipping
+ (setq it (cdr it)))))
+ (cdr head)))
+
+(defun irony-cdb-json--transform-compile-command (compile-command)
+ "Transform a compile command in the JSON compilation database
+into a friendlier format.
+
+The returned value is a list composed of the following elements:
+0. The absolute path to the file.
+1. The compile options.
+2. The invocation directory. Relative paths in the compile
+ options elements are relative to this directory.
+
+Return nil if the compile command is invalid or the compile
+options are empty."
+ (let* ((directory (irony-cdb-json--compile-command-directory compile-command))
+ (path (expand-file-name
+ (irony-cdb-json--compile-command-file compile-command) directory))
+ (options (irony-cdb-json--compile-command-options compile-command)))
+ (when (and path directory options)
+ (list path
+ (irony-cdb-json--adjust-compile-options options path directory)
+ directory))))
+
+(defun irony-cdb-json--compute-directory-cdb (file-cdb)
+ ;; collect flags by directory, e.g: for headers in source directories or
+ ;; new files that are not yet present in the compilation database
+ (let ((dir-cdb (irony-cdb-json--collect-compile-options-by-dir file-cdb)))
+ (nconc dir-cdb
+ ;; collect flags for header search paths too
+ (irony-cdb-json--collect-compile-options-for-include-dirs dir-cdb))))
+
+(defun irony-cdb-json--collect-compile-options-by-dir (file-cdb)
+ "Collect the compile options per directory from a file compilation database.
+
+The returned value similar to
+`irony-cdb-json--transform-compile-command' except for the first
+argument which represents a whole directory (ending with slash on
+Unix, `file-name-as-directory') instead of a single file."
+ (let ((dir-cdb (delete-dups
+ (mapcar #'(lambda (e)
+ (cons (file-name-directory (car e)) (cdr e)))
+ file-cdb))))
+ ;; TODO: remove directories when a parent directory has the same flags, for
+ ;; example, writing the following in CMake:
+ ;; add_executable(exe foo.cpp sub/bar.cpp)
+ ;; will result in duplicated compile options for the subdirectory 'sub/'.
+ dir-cdb))
+
+(defun irony-cdb-json--collect-compile-options-for-include-dirs (dir-cdb)
+ "Guess the compile options to use for directories in the search path.
+
+The returned value is in the same format as the input value, see
+`irony-cdb-json--collect-compile-options-for-include-dirs'."
+ (let ((include-dirs (delete-dups (mapcar 'car dir-cdb)))
+ out)
+ (dolist (e dir-cdb)
+ (dolist (dir (irony--extract-user-search-paths (nth 1 e) (nth 2 e)))
+ (unless (member dir include-dirs)
+ (setq include-dirs (cons dir include-dirs)
+ out (cons (cons dir (cdr e)) out)))))
+ out))
+
+(provide 'irony-cdb-json)
+
+;; Local Variables:
+;; byte-compile-warnings: (not cl-functions)
+;; End:
+
+;;; irony-cdb-json ends here
diff --git a/elpa/irony-20220110.849/irony-cdb-json.elc b/elpa/irony-20220110.849/irony-cdb-json.elc
new file mode 100644
index 0000000..d43d948
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-cdb-json.elc
Binary files differ
diff --git a/elpa/irony-20220110.849/irony-cdb-libclang.el b/elpa/irony-20220110.849/irony-cdb-libclang.el
new file mode 100644
index 0000000..79d5849
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-cdb-libclang.el
@@ -0,0 +1,73 @@
+;;; irony-cdb-libclang.el --- Compilation Database for irony using libclang
+
+;; Copyright (C) 2015 Karl Hylén
+
+;; Author: Karl Hylén <karl.hylen@gmail.com>
+;; Keywords: c, convenience, tools
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Compilation Database support for Irony using libclangs CXCompilationDatabase,
+;; http://clang.llvm.org/doxygen/group__COMPILATIONDB.html
+
+;;; Code:
+
+(require 'irony-cdb)
+(require 'irony-cdb-json)
+
+(require 'cl-lib)
+
+;;;###autoload
+(defun irony-cdb-libclang (command &rest args)
+ (cl-case command
+ (get-compile-options (irony-cdb-libclang--get-compile-options))))
+
+(defun irony-cdb-libclang--get-compile-options ()
+ (irony--awhen (irony-cdb-json--locate-db)
+ (irony-cdb-libclang--server-exact-flags it)))
+
+(defun irony-cdb-libclang--server-exact-flags (db-file)
+ "Get compilation options from irony-server.
+
+The parameter DB-FILE is the database file."
+ (when buffer-file-name
+ (let* ((build-dir (file-name-directory db-file))
+ (file buffer-file-name)
+ (task (irony--get-compile-options-task build-dir file))
+ (compile-options (irony--run-task task)))
+ (irony-cdb-libclang--adjust-options-and-remove-compiler
+ file compile-options))))
+
+(defun irony-cdb-libclang--adjust-options-and-remove-compiler (file cmds)
+ "Remove compiler, target file FILE and output file from CMDS.
+
+The parameter CMDS is a list of conses. In each cons, the car holds the options
+and the cdr holds the working directory where the compile command was issued."
+ (mapcar (lambda (cmd)
+ (let ((opt (irony-cdb--remove-compiler-from-flags (car cmd)))
+ (wdir (cdr cmd)))
+ (cons
+ (irony-cdb-json--adjust-compile-options opt file wdir)
+ wdir)))
+ cmds))
+
+(provide 'irony-cdb-libclang)
+
+;; Local Variables:
+;; byte-compile-warnings: (not cl-functions)
+;; End:
+
+;;; irony-cdb-libclang ends here
diff --git a/elpa/irony-20220110.849/irony-cdb-libclang.elc b/elpa/irony-20220110.849/irony-cdb-libclang.elc
new file mode 100644
index 0000000..da23bf2
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-cdb-libclang.elc
Binary files differ
diff --git a/elpa/irony-20220110.849/irony-cdb.el b/elpa/irony-20220110.849/irony-cdb.el
new file mode 100644
index 0000000..e7d678b
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-cdb.el
@@ -0,0 +1,218 @@
+;;; irony-cdb.el --- compilation databases support for irony
+
+;; Copyright (C) 2012-2014 Guillaume Papin
+
+;; Author: Guillaume Papin <guillaume.papin@epitech.eu>
+;; Keywords: c, convenience, tools
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; This file defines the compilation database interface of irony-mode.
+;;
+;; Note:For compilation database that looks for a specific file, such as
+;; .clang_complete or compile_commands.json, favor `locate-dominating-file' to a
+;; handwritten logic if possible as it may be configured by the user to do "the
+;; Right Thing (TM)". See `locate-dominating-stop-dir-regexp'.
+;;
+
+;;; Code:
+
+(require 'irony)
+
+(require 'cl-lib)
+
+(autoload 'irony-cdb-clang-complete "irony-cdb-clang-complete")
+(autoload 'irony-cdb-json "irony-cdb-json")
+(autoload 'irony-cdb-libclang "irony-cdb-libclang")
+
+
+;;
+;; Customizable variables
+;;
+
+(defgroup irony-cdb nil
+ "Irony's compilation database interface."
+ :group 'irony)
+
+(defcustom irony-cdb-compilation-databases '(irony-cdb-clang-complete
+ irony-cdb-libclang
+ irony-cdb-json)
+ "List of active compilation databases.
+
+The compilation database should respond for the following commands:
+
+`get-compile-options': Takes no argument. This function finds the
+compile options used for the current buffer. It must return a
+list of cons where the first element is a set of compile options
+and the second element the working directory expected for these
+commands. The compilation database should return an empty list
+for files that it cannot handle."
+ :type '(repeat function)
+ :group 'irony-cdb)
+
+(defcustom irony-cdb-search-directory-list '("." "build")
+ "List of relative subdirectory paths to be searched for cdb files
+
+Irony looks for cdb files in any of the supported format by checking
+each directory from the currently loaded file and recursively through
+parent directories until it hits the root directory or a cdb is
+found. At each level of the search irony looks at the subdirectories
+listed in `irony-cdb-search-directory-list' for the files. Customize this
+list if your cdb is held in a custom directory within you project,
+such as a custom named build directory.
+"
+ :type '(repeat string)
+ :group 'irony-cdb)
+
+
+;;
+;; Internal variables
+;;
+
+(defvar-local irony-cdb--compilation-database nil)
+
+
+;;
+;; Irony Compilation Database Interface
+;;
+
+;;;###autoload
+(defun irony-cdb-autosetup-compile-options ()
+ (interactive)
+ (irony--awhen (irony-cdb--autodetect-compile-options)
+ (setq irony-cdb--compilation-database (nth 0 it))
+ (irony-cdb--update-compile-options (nth 1 it) (nth 2 it))))
+
+;;;###autoload
+(defun irony-cdb-menu ()
+ (interactive)
+ (let ((compilation-database irony-cdb--compilation-database)
+ (working-directory irony--working-directory)
+ (compile-options irony--compile-options))
+ (save-excursion
+ (save-window-excursion
+ (delete-other-windows)
+ (let ((buffer (get-buffer-create "*Irony/Compilation DB Menu*")))
+ (with-current-buffer buffer
+ (erase-buffer)
+ (if (null compilation-database)
+ (insert "No compilation database in use.\n")
+ (insert (format "Compilation Database: %s\n\n"
+ (symbol-name compilation-database)))
+ (insert (format " Working Directory: %s\n" working-directory))
+ (insert (format " Compile Options: %s\n"
+ (mapconcat 'identity compile-options " "))))
+ (insert "\n[q] to quit"))
+ (let ((pop-up-windows t))
+ (display-buffer buffer t))
+ (fit-window-to-buffer (get-buffer-window buffer))
+ (irony--read-char-choice "Irony CDB Buffer" (list ?q)))))
+ ;; clear `read-char-choice' prompt
+ (message "")))
+
+
+;;
+;; Functions
+;;
+
+(defun irony-cdb--choose-closest-path (file paths)
+ "Find the \"best\" path in PATHS matching FILE
+
+If any paths in PATHS is belongs to the same directory
+or a subdirectory of file, we disregard other candidates.
+
+For remaining candidates, \"nearest\" is measured as abs. difference
+in path depth.
+- We prefer deeper paths at level +N to those at level -N.
+- If multiple paths are equally good, we return the last one.
+
+Returns nil if paths isn't a list of at least one element.
+"
+ (when (listp paths)
+ (let ((paths (or
+ ;; if we find a cdb in cwd or below, don't consider other candidates
+ (cl-remove-if-not (lambda (x) (string-prefix-p (file-name-directory file) x)) paths)
+ paths)))
+ (cl-loop for path in paths
+ with best-depth-delta = 999999 ; start at +inf
+ with best-path = nil ; we keep the best so far here
+ ;; all candidates have their depth compared to that of target file
+ with file-depth = (length (split-string (expand-file-name file) "/")) ;
+ for candidate-depth = (length (split-string (expand-file-name path) "/"))
+ ;; Our metric. We use signum as a tie-breaker to choose deeper candidates
+ for depth-delta = (+ (abs (- file-depth candidate-depth))
+ (* 0.1 (- file-depth candidate-depth)))
+ do (when (< depth-delta best-depth-delta)
+ (progn
+ (setq best-depth-delta depth-delta)
+ (setq best-path path)))
+ finally return best-path))))
+
+(defun irony-cdb--locate-dominating-file-with-dirs (file
+ name
+ subdirectories)
+ "Convenience wrapper around `locate-dominating-file'
+
+Looks up the directory hierarchy from FILE for to locate any directory
+in `subdirectories` which contains NAME. If multiple files are found,
+chooses the one located at the nearest directory level. if multiple
+files are found at the same level, picks the first one encountered.
+returns the full path to file if found, or nil otherwise."
+ (let ((candidates
+ (cl-loop for subdir in subdirectories
+ for relpath = (concat (file-name-as-directory subdir) name)
+ for match-maybe = (locate-dominating-file file relpath)
+ when match-maybe collect (expand-file-name (concat match-maybe relpath)))))
+ (irony-cdb--choose-closest-path file candidates)))
+
+
+(defun irony-cdb--update-compile-options (compile-options
+ &optional working-directory)
+ (setq irony--compile-options compile-options
+ irony--working-directory working-directory))
+
+(defun irony-cdb--autodetect-compile-options ()
+ (catch 'found
+ (dolist (compilation-database irony-cdb-compilation-databases)
+ (with-demoted-errors "Irony CDB: error in compilation database: %S"
+ (irony--awhen (funcall compilation-database 'get-compile-options)
+ (throw 'found (list compilation-database
+ (caar it)
+ (cdar it))))))))
+
+(defun irony-cdb--string-suffix-p (suffix string &optional ignore-case)
+ "Return non-nil if SUFFIX is a suffix of STRING."
+ (let ((start-pos (- (length string) (length suffix))))
+ (and (>= start-pos 0)
+ (eq t (compare-strings suffix nil nil
+ string start-pos nil ignore-case)))))
+
+(defun irony-cdb--remove-compiler-from-flags (flags)
+ "Remove the compiler from FLAGS read from a compilation database.
+
+When using ccache, the compiler might be present in FLAGS since
+the compiler is `ccache compiler'."
+ (let* ((first (car flags))
+ (flags (cdr flags)))
+ (if (irony-cdb--string-suffix-p "ccache" first) (cdr flags) flags)))
+
+(provide 'irony-cdb)
+
+;; Local Variables:
+;; byte-compile-warnings: (not cl-functions)
+;; End:
+
+;;; irony-cdb.el ends here
diff --git a/elpa/irony-20220110.849/irony-cdb.elc b/elpa/irony-20220110.849/irony-cdb.elc
new file mode 100644
index 0000000..dca07a8
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-cdb.elc
Binary files differ
diff --git a/elpa/irony-20220110.849/irony-completion.el b/elpa/irony-20220110.849/irony-completion.el
new file mode 100644
index 0000000..a994c32
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-completion.el
@@ -0,0 +1,426 @@
+;;; irony-completion.el --- irony-mode completion interface -*- lexical-binding: t -*-
+
+;; Copyright (C) 2012-2014 Guillaume Papin
+
+;; Author: Guillaume Papin <guillaume.papin@epitech.eu>
+;; Keywords: c, convenience, tools
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Handle the search of completion points, the triggering of the
+;; completion when needed and the "parsing" of completion results.
+
+;;; Code:
+
+(require 'irony)
+(require 'irony-snippet)
+
+(require 'cl-lib)
+
+
+;;
+;; Customizable variables
+;;
+
+(defgroup irony-completion nil
+ "Irony's completion interface."
+ :group 'irony)
+
+(defcustom irony-completion-trigger-commands '(self-insert-command
+ newline-and-indent
+ c-context-line-break
+ c-scope-operator
+ ;; electric commands
+ c-electric-backspace
+ c-electric-brace
+ c-electric-colon
+ c-electric-lt-gt
+ c-electric-paren
+ c-electric-pound
+ c-electric-semi&comma
+ c-electric-slash
+ c-electric-star)
+ "List of commands to watch for asynchronous completion triggering."
+ :type '(repeat function)
+ :group 'irony-completion)
+
+(defcustom irony-duplicate-candidates-filter nil
+ "Remove duplicate candidates.
+
+If non-nil, the completion candidate list will not contain
+duplicate entries. As an example, duplicate candidates are
+displayed when a derived class overrides virtual methods."
+ :type 'boolean
+ :group 'irony-completion)
+
+
+;;
+;; Utility functions
+;;
+
+(defun irony-completion-symbol-bounds ()
+ (let ((pt (point))
+ (syntax (syntax-ppss)))
+ ;; no prefix for strings or comments
+ ;; TODO: Use fontlock faces instead? at least
+ ;; #warning In the middle of a warning|
+ ;; will be handled properly but things like links when
+ ;; `goto-address-prog-mode' is enabled will mess up things:
+ ;; #error see bug report XY: http://example.com/XY
+ (unless (or (nth 3 syntax) ;skip strings
+ (nth 4 syntax)) ;skip comments
+ (save-excursion
+ (skip-chars-backward "_a-zA-Z0-9")
+ (let ((ch (char-after)))
+ (unless (and ch (>= ch ?0) (<= ch ?9)) ;skip numbers
+ (when (eq (char-before) ?~)
+ (backward-char))
+ (setq pt (point))
+ (skip-chars-forward "_a-zA-Z0-9~")
+ (cons pt (point))))))))
+
+(defun irony-completion-beginning-of-symbol ()
+ (car (irony-completion-symbol-bounds)))
+
+(defun irony-completion-end-of-symbol ()
+ (cdr (irony-completion-symbol-bounds)))
+
+(defsubst irony-completion--skip-whitespaces-backward ()
+ ;;(skip-syntax-backward "-") doesn't seem to care about newlines
+ (skip-chars-backward " \t\n\r"))
+
+(defun irony-completion--parse-context-position (&optional pos)
+ (save-excursion
+ (when pos
+ (goto-char pos))
+ (irony-completion--skip-whitespaces-backward)
+ (point)))
+
+(defun irony--completion-line-column (&optional pos)
+ (save-excursion
+ (when pos
+ (goto-char pos))
+ ;; `position-bytes' to handle multibytes and 'multicolumns' (i.e
+ ;; tabulations) characters properly
+ (irony--without-narrowing
+ (cons
+ (line-number-at-pos)
+ (1+ (- (position-bytes (point))
+ (position-bytes (point-at-bol))))))))
+
+
+;;
+;; Functions
+;;
+
+(defun irony-completion--enter ()
+ (add-hook 'completion-at-point-functions 'irony-completion-at-point nil t))
+
+(defun irony-completion--exit ()
+ (remove-hook 'completion-at-point-functions 'irony-completion-at-point t))
+
+(defun irony-completion--post-complete-yas-snippet (str placeholders)
+ (let ((ph-count 0)
+ (from 0)
+ to snippet)
+ (while
+ (setq to (car placeholders)
+ snippet (concat
+ snippet
+ (substring str from to)
+ (format "${%d:%s}"
+ (cl-incf ph-count)
+ (substring str
+ (car placeholders)
+ (cadr placeholders))))
+ from (cadr placeholders)
+ placeholders (cddr placeholders)))
+ ;; handle the remaining non-snippet string, if any.
+ (concat snippet (substring str from) "$0")))
+
+
+;;
+;; Interface with irony-server
+;;
+
+(irony-iotask-define-task irony--t-complete
+ "`complete' server command."
+ :start (lambda (file line column compile-options)
+ (apply #'irony--server-send-command "complete" file line column "--"
+ compile-options))
+ :update irony--server-command-update)
+
+(defun irony--complete-task-1 (&optional buffer pos)
+ (with-current-buffer (or buffer (current-buffer))
+ (let ((line-column (irony--completion-line-column pos)))
+ (irony-iotask-package-task irony--t-complete
+ (irony--get-buffer-path-for-server)
+ (car line-column)
+ (cdr line-column)
+ (irony--adjust-compile-options)))))
+
+(defun irony--complete-task (&optional buffer pos)
+ (let ((unsaved-tasks (irony--unsaved-buffers-tasks))
+ (complete-task (irony--complete-task-1 buffer pos)))
+ (if unsaved-tasks
+ (irony-iotask-chain unsaved-tasks complete-task)
+ complete-task)))
+
+(irony-iotask-define-task irony--t-candidates
+ "`candidates' server command."
+ :start (lambda (prefix style)
+ (irony--server-send-command
+ "candidates" prefix
+ (cl-case style
+ (case-insensitive "case-insensitive")
+ (smart-case "smart-case")
+ (t "exact"))))
+ :update irony--server-query-update)
+
+(defun irony--candidates-task (&optional buffer pos prefix style)
+ (irony-iotask-chain
+ (irony--complete-task buffer pos)
+ (irony-iotask-package-task irony--t-candidates prefix style)))
+
+
+;;
+;; Irony Completion Interface
+;;
+
+(defun irony-completion-typed-text (candidate)
+ (nth 0 candidate))
+
+(defun irony-completion-priority (candidate)
+ (nth 1 candidate))
+
+(defun irony-completion-type (candidate)
+ (nth 2 candidate))
+
+(defun irony-completion-brief (candidate)
+ (nth 3 candidate))
+
+(defun irony-completion-annotation (candidate)
+ (substring (nth 4 candidate) (nth 5 candidate)))
+
+(defun irony-completion-post-comp-str (candidate)
+ (car (nth 6 candidate)))
+
+(defun irony-completion-post-comp-placeholders (candidate)
+ (cdr (nth 6 candidate)))
+
+(defun irony-completion--filter-candidates (candidates)
+ "Filter candidates by removing duplicates if
+`irony-duplicate-candidates-filter' is non nil; Duplicate
+candidates are those that have the same
+`irony-completion-typed-text', `irony-completion-annotation' and
+`irony-completion-type'. An example of when this is useful is
+when there are many derived classes that override a virtual
+method resulting in redundant duplicate entries being displayed
+in the list of completions."
+ (let (unique-candidates)
+ (cl-remove-if-not
+ (lambda (candidate)
+ (or (not irony-duplicate-candidates-filter)
+ (let ((unique-key (list (irony-completion-typed-text candidate)
+ (irony-completion-annotation candidate)
+ (irony-completion-type candidate))))
+ (and (not (member unique-key unique-candidates))
+ (push unique-key unique-candidates)))))
+ candidates)))
+
+(defun irony-completion-candidates (&optional prefix style)
+ "Return the list of candidates at point.
+
+A candidate is composed of the following elements:
+ 0. The typed text. Multiple candidates can share the same string
+ because of overloaded functions, default arguments, etc.
+ 1. The priority.
+ 2. The [result-]type of the candidate, if any.
+ 3. If non-nil, contains the Doxygen brief documentation of the
+ candidate.
+ 4. The signature of the candidate excluding the result-type
+ which is available separately.
+ Example: \"foo(int a, int b) const\"
+ 5. The annotation start, a 0-based index in the prototype string.
+ 6. Post-completion data. The text to insert followed by 0 or
+ more indices. These indices work by pairs and describe ranges
+ of placeholder text.
+ Example: (\"(int a, int b)\" 1 6 8 13)"
+ (irony--awhen (irony-completion-symbol-bounds)
+ (irony-completion--filter-candidates
+ (irony--run-task
+ (irony--candidates-task nil (car it) prefix style)))))
+
+(defun irony-completion-candidates-async (callback &optional prefix style)
+ (irony--aif (irony-completion-symbol-bounds)
+ (irony--run-task-asynchronously
+ (irony--candidates-task nil (car it) prefix style)
+ (lambda (candidates-result)
+ (funcall callback (irony-completion--filter-candidates
+ (irony-iotask-result-get candidates-result)))))
+ (funcall callback nil)))
+
+(defun irony-completion-post-complete (candidate)
+ (let ((str (irony-completion-post-comp-str candidate))
+ (placeholders (irony-completion-post-comp-placeholders candidate)))
+ (if (and placeholders (irony-snippet-available-p))
+ (irony-snippet-expand
+ (irony-completion--post-complete-yas-snippet str placeholders))
+ (insert (substring str 0 (car placeholders))))))
+
+(defun irony-completion-at-trigger-point-p ()
+ (when (eq (point) (irony-completion-beginning-of-symbol))
+ (save-excursion
+ (cond
+ ;; use `re-search-backward' so that the cursor is moved just before the
+ ;; member access, if any
+ ((re-search-backward
+ (format "%s\\=" (regexp-opt '("." ;object member access
+ "->" ;pointer member access
+ "::"))) ;scope operator
+ (point-at-bol) t)
+ (unless
+ ;; ignore most common uses of '.' where it's not a member access
+ (and (eq (char-after) ?.)
+ (or
+ ;; include statements: #include <foo.|>
+ (looking-back "^#\\s-*include\\s-+[<\"][^>\"]*"
+ (point-at-bol))
+ ;; floating point numbers (not thorough, see:
+ ;; http://en.cppreference.com/w/cpp/language/floating_literal)
+ (looking-back "[^_a-zA-Z0-9][[:digit:]]+" (point-at-bol))))
+ ;; except the above exceptions we use a "whitelist" for the places
+ ;; where it looks like a member access
+ (irony-completion--skip-whitespaces-backward)
+ (or
+ ;; after brackets consider it's a member access so things like
+ ;; 'getFoo().|' match
+ (memq (char-before) (list ?\) ?\] ?} ?>))
+ ;; identifiers but ignoring some keywords
+ ;;
+ ;; handle only a subset of template parameter packs, where the
+ ;; ellipsis is preceded by a keyword, in situation like:
+ ;; template<typename ... Args> class X {...};
+ ;; template<typename .|
+ ;; or just look if the face is: font-lock-keyword-face?
+ (save-excursion
+ (and (re-search-backward "\\b\\([_a-zA-Z][_a-zA-Z0-9]*\\)\\="
+ (point-at-bol) t)
+ (not (member (match-string 0)
+ '("class" "sizeof" "typename"))))))))))))
+
+
+;;
+;; Irony CAPF
+;;
+
+(defsubst irony-completion--capf-candidate (candidate)
+ (get-text-property 0 'irony-capf candidate))
+
+(defun irony-completion--capf-annotate (candidate)
+ (irony-completion-annotation
+ (irony-completion--capf-candidate candidate)))
+
+(defun irony-completion--capf-postcomp-commonprefix (candidates)
+ (let ((prefixes (mapcar
+ (lambda (candidate)
+ (let ((str (irony-completion-post-comp-str candidate))
+ (phs (irony-completion-post-comp-placeholders
+ candidate)))
+ (substring str 0 (car phs))))
+ candidates)))
+ (cl-loop for i from 0 below (apply #'min (mapcar #'length prefixes))
+ while (apply #'= (mapcar (lambda (string) (aref string i))
+ prefixes))
+ finally (return (cl-subseq (first prefixes) 0 i)))))
+
+(defun irony-completion--capf-postcomp-all-equal-p (candidates)
+ (when (cdr candidates)
+ (let ((expected-str (irony-completion-post-comp-str (car candidates)))
+ (expected-phs (irony-completion-post-comp-placeholders
+ (car candidates))))
+ (while (and (setq candidates (cdr candidates))
+ (string= expected-str (irony-completion-post-comp-str (car candidates)))
+ (equal expected-phs (irony-completion-post-comp-placeholders (car candidates))))))
+ (null candidates)))
+
+(defun irony-completion--capf-exit-function (candidates str status)
+ "Insert post completion string or snippet after STR has been completed."
+ ;; according to `pcomplete-completions-at-point',
+ ;; react on `finished' but not `sole',
+ ;; because it does not work properly when cycling completions
+ (when (eq status 'finished)
+ (let ((candidate (irony-completion--capf-candidate str))
+ matches)
+ ;; `completion-at-point' doesn't provides the propertized string created
+ ;; with the `irony-capf' text property
+ ;; but `company-capf' does, and maybe `completion-at-point' some day.
+ ;; So if the candidate data is found use it,
+ ;; otherwise try to find the candidate in the completion list
+ ;; at the risk of dealing with overloaded functions and not being able to
+ ;; make the right decision
+ (setq matches
+ (if candidate
+ (list candidate)
+ (cl-remove-if-not (lambda (candidate)
+ (string= (car candidate) str))
+ candidates)))
+ ;; all equals can happen with when the difference in the annotation
+ ;; is the return type and constness attributes,
+ ;; for example `std::string' `at(n)' function is overloaded that way:
+ ;; const char & at(size_type n) const;
+ ;; char & at(size_type n);
+ (if (or (= (length matches) 1)
+ (irony-completion--capf-postcomp-all-equal-p matches))
+ ;; with a perfect match we are able to give complete post-completion
+ (irony-completion-post-complete (car matches))
+ ;; more than one candidates possible,
+ ;; provide the beginning of the post-completion data as a best effort.
+ ;; For overloaded functions this inserts the opening parenthesis.
+ (irony--awhen (irony-completion--capf-postcomp-commonprefix matches)
+ (insert it))))))
+
+;;;###autoload
+(defun irony-completion-at-point ()
+ (irony--awhen (and irony-mode (irony-completion-symbol-bounds))
+ (let ((candidates (irony-completion--filter-candidates
+ (irony--run-task
+ (irony--candidates-task
+ nil
+ (car it)
+ (buffer-substring-no-properties
+ (car it) (cdr it))
+ (if completion-ignore-case
+ 'case-insensitive
+ 'exact))))))
+ (list
+ (car it) ;start
+ (cdr it) ;end
+ (mapcar (lambda (candidate) ;completion table
+ (propertize (car candidate) 'irony-capf candidate))
+ candidates)
+ :annotation-function #'irony-completion--capf-annotate
+ :exit-function
+ (lambda (str status)
+ (irony-completion--capf-exit-function candidates str status))))))
+
+(provide 'irony-completion)
+
+;; Local Variables:
+;; byte-compile-warnings: (not cl-functions)
+;; End:
+
+;;; irony-completion.el ends here
diff --git a/elpa/irony-20220110.849/irony-completion.elc b/elpa/irony-20220110.849/irony-completion.elc
new file mode 100644
index 0000000..20adb70
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-completion.elc
Binary files differ
diff --git a/elpa/irony-20220110.849/irony-diagnostics.el b/elpa/irony-20220110.849/irony-diagnostics.el
new file mode 100644
index 0000000..76c268d
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-diagnostics.el
@@ -0,0 +1,90 @@
+;;; irony-diagnostics.el --- irony-mode diagnostic reporting
+
+;; Copyright (C) 2014 Guillaume Papin
+
+;; Author: Guillaume Papin <guillaume.papin@epitech.eu>
+;; Keywords: c, convenience, tools
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Interface libclang's "Diagnostic Reporting", see
+;; http://clang.llvm.org/doxygen/group__CINDEX__DIAG.html
+
+;;; Code:
+
+(require 'irony)
+(require 'irony-iotask)
+
+(eval-when-compile
+ (require 'cl)) ;for lexical-let macro
+
+
+;;
+;; Irony Diagnostics Interface
+;;
+
+(defun irony-diagnostics-file (diagnostic)
+ (nth 0 diagnostic))
+
+(defun irony-diagnostics-line (diagnostic)
+ (nth 1 diagnostic))
+
+(defun irony-diagnostics-column (diagnostic)
+ (nth 2 diagnostic))
+
+(defun irony-diagnostics-severity (diagnostic)
+ (nth 4 diagnostic))
+
+(defun irony-diagnostics-message (diagnostic)
+ (nth 5 diagnostic))
+
+(defun irony-diagnostics-async (callback)
+ "Perform an asynchronous diagnostic request for the current
+buffer.
+
+CALLBACK is called with at least one argument, a symbol
+representing the status of the request. Depending on the status
+more argument are provided. Possible values are explained below:
+
+- success
+
+ When quering the diagnostics work, the additional argument is a
+ list of diagnostic object, diagnostics fields can be queried
+ with the functions `irony-diagnostics-<xxx>'.
+
+- error
+
+ Retrieving the diagnostics wasn't possible. A string explaining
+ the reason is passed as a second argument.
+
+- cancelled
+
+ Retrieving the diagnostics was cancelled, e.g: because the
+ buffer has changed since the beginning of the request, and as
+ such the diagnostics are considered no longer relevant. A
+ reason string is passed as a second argument."
+ (lexical-let ((cb callback))
+ (irony--run-task-asynchronously
+ (irony--diagnostics-task)
+ (lambda (diagnostics-result)
+ (condition-case err
+ (funcall cb 'success (irony-iotask-result-get diagnostics-result))
+ (error
+ (funcall cb 'error (error-message-string err))))))))
+
+(provide 'irony-diagnostics)
+
+;;; irony-diagnostics.el ends here
diff --git a/elpa/irony-20220110.849/irony-diagnostics.elc b/elpa/irony-20220110.849/irony-diagnostics.elc
new file mode 100644
index 0000000..dfcae2a
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-diagnostics.elc
Binary files differ
diff --git a/elpa/irony-20220110.849/irony-iotask.el b/elpa/irony-20220110.849/irony-iotask.el
new file mode 100644
index 0000000..2226a69
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-iotask.el
@@ -0,0 +1,441 @@
+;;; irony-iotask.el --- Abstraction for I/O-based tasks
+
+;; Copyright (C) 2015 Guillaume Papin
+
+;; Author: Guillaume Papin <guillaume.papin@epitech.eu>
+;; Keywords: processes, convenience
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Purpose is to work with both processes and network streams.
+;;
+;; Unlike tq.el we want tasks to be composed of 0, 1-1, or n-n communications.
+;; tq.el only supports 1-1.
+;;
+;; 0 is useful if a server command has been cached, it means there is no need
+;; for communication. We may only know if a task is still cached when the
+;; callback is called (maybe after some other asynchronous tasks, so the context
+;; may have changed since the task was initially posted)
+;;
+;; n-n is useful if the number of request depends on the answer to a previous
+;; request but we still want to be able to push new tasks.
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl)) ;for lexical-let macro
+
+(require 'cl-lib)
+
+
+;;
+;; Error conditions
+;;
+
+;; `define-error' breaks backward compatibility with Emacs < 24.4
+(defun irony-iotask--define-error (name message &optional parent)
+ "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'.
+PARENT is either a signal or a list of signals from which it inherits.
+Defaults to `error'."
+ (unless parent (setq parent 'error))
+ (let ((conditions
+ (if (consp parent)
+ (apply #'nconc
+ (mapcar (lambda (parent)
+ (cons parent
+ (or (get parent 'error-conditions)
+ (error "Unknown signal `%s'" parent))))
+ parent))
+ (cons parent (get parent 'error-conditions)))))
+ (put name 'error-conditions
+ (delete-dups (copy-sequence (cons name conditions))))
+ (when message (put name 'error-message message))))
+
+(irony-iotask--define-error 'irony-iotask-error "I/O task error")
+(irony-iotask--define-error 'irony-iotask-filter-error "I/O task filter error")
+(irony-iotask--define-error 'irony-iotask-bad-task "Bad I/O task")
+(irony-iotask--define-error 'irony-iotask-bad-data "Bad I/O task data")
+
+
+;;
+;; Structures
+;;
+
+(cl-defstruct (irony-iotask-result (:constructor irony-iotask-result-create))
+ -tag ;; 'value or 'error, or nil when unset
+ -value
+ -error -error-data
+ )
+
+(defun irony-iotask-result-valid-p (result)
+ (and (irony-iotask-result--tag result) t))
+
+(defun irony-iotask-result-value-p (result)
+ (eq (irony-iotask-result--tag result) 'value))
+
+(defun irony-iotask-result-error-p (result)
+ (eq (irony-iotask-result--tag result) 'error))
+
+(defun irony-iotask-result-set-value (result value)
+ (setf (irony-iotask-result--tag result) 'value)
+ (setf (irony-iotask-result--value result) value))
+
+(defun irony-iotask-result-set-error (result error &rest error-data)
+ (setf (irony-iotask-result--tag result) 'error)
+ (setf (irony-iotask-result--error result) error)
+ (setf (irony-iotask-result--error-data result) error-data))
+
+(irony-iotask--define-error 'irony-iotask-result-get-error
+ "Result not set before call to get")
+
+(defun irony-iotask-result-get (result)
+ (cl-case (irony-iotask-result--tag result)
+ ('value (irony-iotask-result--value result))
+ ('error (signal (irony-iotask-result--error result)
+ (irony-iotask-result--error-data result)))
+ (t
+ (signal 'irony-iotask-result-get-error (list result)))))
+
+;; FIXME: quoting issues? I cannot write "#'(lambda ()...)" as property value
+(defmacro irony-iotask-define-task (var docstring &rest properties)
+ "A task is simply a property list.
+
+Each of these function are called in the buffer they were
+originally created (at schedule time).
+
+The functions `irony-iotask-put', `irony-iotask-get',
+`irony-iotask-set-result' and `irony-iotask-set-error' are
+available to the task's functions to set the task's result.
+
+Properties:
+
+`:start' (mandatory)
+ Function to call to launch the task.
+
+ Usually the function sends a string/command/message to the
+ execution context. If the task do some caching it's possible
+ that nothing is send, instead the execution context result
+ should be set to indicate that the task is ready.
+
+ The following additional functions are available to call
+ inside the `:start' function to communicate with the
+ underlying process:
+
+ - `irony-iotask-send-string'
+ - `irony-iotask-send-region'
+ - `irony-iotask-send-eof'
+
+`:update' (mandatory)
+ Function to call when some process output is available.
+
+ The function should determine whether a message is complete
+ and set the result when it is. It should also detect if the
+ message is invalid and throw the 'invalid-msg tag with a
+ value of t in this case. If the message is incomplete, the
+ function should do nothing.
+
+ The process output is the current buffer.
+
+`:finish' (optional)
+
+ Function to call after the result has been set but before
+ the callback is called.
+
+ Usually performs some kind of cleanup operation.
+
+ Note: it makes no sense to set a result or error in this
+ function as it is necessarily been set beforehand.
+
+`:on-success' (optional)
+
+ Same as `:finish' but called only if the result IS NOT an error.
+
+`:on-error' (optional)
+
+ Same as `:finish' but called only if the result IS an error."
+ (declare (indent 1)
+ (doc-string 2))
+ `(progn
+ (defvar ,var nil ,docstring)
+ ;; Use `setq' to reset the var every time the macro is called.
+ ;; This is useful, for example when evaluating using C-M-x (`eval-defun').
+ ;; Trick stolen from auto-complete's `ac-define-source'
+ (setq ,var '(,@properties))))
+
+(cl-defstruct (irony-iotask-packaged-task
+ (:constructor irony-iotask-packaged-task--create))
+ task
+ args
+ result
+ plist
+ continuation)
+
+(defun irony-iotask-package-task (task &rest args)
+ (irony-iotask-packaged-task--create :task task
+ :result (irony-iotask-result-create)
+ :args args))
+
+(defvar irony-iotask--current-packaged-task) ;dynamically bound
+(defun irony-iotask-package-task-invoke (packaged-task prop-fn
+ &optional ignore-missing
+ &rest leading-args)
+ (let* ((task (irony-iotask-packaged-task-task packaged-task))
+ (args (irony-iotask-packaged-task-args packaged-task))
+ (fn (plist-get task prop-fn)))
+ (condition-case err
+ (if fn
+ ;; let binding for irony-iotask-{get,put}
+ ;; and irony-iotask-set-{result,error}
+ (let ((irony-iotask--current-packaged-task packaged-task))
+ (apply fn (append leading-args args)))
+ (unless ignore-missing
+ (signal 'irony-iotask-bad-task
+ (list task (format "no %s function" prop-fn)))))
+ (error
+ (apply #'irony-iotask-result-set-error
+ (irony-iotask-packaged-task-result packaged-task)
+ (car err) (cdr err))))))
+
+(defun irony-iotask--chain-1 (packaged-task-1 packaged-task-2)
+ (while (irony-iotask-packaged-task-continuation packaged-task-1)
+ (setq packaged-task-1
+ (irony-iotask-packaged-task-continuation packaged-task-1)))
+ (setf (irony-iotask-packaged-task-continuation packaged-task-1)
+ packaged-task-2))
+
+(defun irony-iotask-chain (packaged-task-1 packaged-task-2 &rest others)
+ (setq others (cons packaged-task-2 others))
+ (while others
+ (irony-iotask--chain-1 packaged-task-1 (car others))
+ (setq others (cdr others)))
+ packaged-task-1)
+
+(cl-defstruct (irony-iotask-ectx
+ (:constructor irony-iotask-ectx--create))
+ started
+ packaged-task
+ callback
+ schedule-buffer)
+
+(defun irony-iotask-ectx-call-callback (ectx result)
+ (let ((cb-buffer (irony-iotask-ectx-schedule-buffer ectx)))
+ (when (buffer-live-p cb-buffer) ;[GH-427]
+ (with-demoted-errors "Irony I/O task: error in callback: %S"
+ (with-current-buffer cb-buffer
+ (funcall (irony-iotask-ectx-callback ectx) result))))))
+
+(defvar irony-iotask--process)
+
+(defun irony-iotask--start-next (process)
+ (let* ((ectx (car (process-get process :ectx-q)))
+ (packaged-task (irony-iotask-ectx-packaged-task ectx)))
+ (setf (irony-iotask-ectx-started ectx) t)
+ ;; erase the buffer before we call :start so the next :update starts anew
+ (erase-buffer)
+ ;; for `irony-iotask-send-string', `irony-iotask-send-region' and
+ ;; `irony-iotask-send-eof'
+ (let ((irony-iotask--process process))
+ (save-current-buffer
+ (irony-iotask-package-task-invoke packaged-task :start)))
+ (irony-iotask--check-result process)))
+
+(defun irony-iotask--start-next-safe (process)
+ "Run the next task, if any."
+ (let ((ectx-q (process-get process :ectx-q)))
+ (when (and ectx-q (not (irony-iotask-ectx-started (car ectx-q))))
+ (irony-iotask--start-next process))))
+
+(defun irony-iotask--check-result (process)
+ (let* ((ectx (car (process-get process :ectx-q)))
+ (packaged-task (irony-iotask-ectx-packaged-task ectx))
+ (result (irony-iotask-packaged-task-result packaged-task)))
+ (when (irony-iotask-result-valid-p result)
+ (save-current-buffer
+ (if (irony-iotask-result-value-p result)
+ (irony-iotask-package-task-invoke packaged-task :on-success t)
+ (irony-iotask-package-task-invoke packaged-task :on-error t)))
+ (save-current-buffer
+ (irony-iotask-package-task-invoke packaged-task :finish t))
+ (if (and (irony-iotask-packaged-task-continuation packaged-task)
+ (irony-iotask-result-value-p result))
+ ;; we got a non-error, we can chain to the next continuation
+ (progn
+ (setf (irony-iotask-ectx-packaged-task ectx)
+ (irony-iotask-packaged-task-continuation packaged-task))
+ (irony-iotask--start-next process))
+ ;; no continuation or an error, call the callback
+ ;; and skip any potential continuation
+ (setq ectx (pop (process-get process :ectx-q)))
+ (irony-iotask-ectx-call-callback ectx result)
+ (irony-iotask--start-next-safe process)))))
+
+(irony-iotask--define-error 'irony-iotask-aborted "I/O task aborted")
+
+(defun irony-iotask--abort-all (process &rest reasons)
+ (let ((result (irony-iotask-result-create))
+ ectx)
+ (apply #'irony-iotask-result-set-error result 'irony-iotask-aborted reasons)
+ (while (setq ectx (pop (process-get process :ectx-q)))
+ (irony-iotask-ectx-call-callback ectx result))))
+
+
+;;
+;; Implementation details, internal mechanic
+;;
+
+(defun irony-iotask-process-filter (process output)
+ (when (buffer-live-p (process-buffer process))
+ (with-current-buffer (process-buffer process)
+ (let ((ectx (car (process-get process :ectx-q)))
+ packaged-task
+ result)
+ ;; if no task this is an error, a spurious message is an error
+ (unless ectx
+ (signal 'irony-iotask-filter-error (list "spurious output" output)))
+ (setq packaged-task (irony-iotask-ectx-packaged-task ectx))
+ (setq result (irony-iotask-packaged-task-result packaged-task))
+ (goto-char (process-mark process))
+ (insert output)
+ (set-marker (process-mark process) (point))
+ ;; go to the first char, so the `:update' function is called at the
+ ;; beginning of the buffer, it is more convenient
+ (goto-char (point-min))
+ (when (catch 'invalid-msg
+ (save-current-buffer
+ (irony-iotask-package-task-invoke packaged-task :update))
+ nil)
+ (irony-iotask-result-set-error result
+ 'irony-iotask-bad-data
+ packaged-task
+ (buffer-string)))
+ (irony-iotask--check-result process)))))
+
+(defun irony-iotask-process-sentinel (process event)
+ ;; events usually ends with a newline, we don't want it
+ (setq event (replace-regexp-in-string "\n\\'" "" event))
+ (unless (process-live-p process)
+ (irony-iotask--abort-all process "process stopped running" event)
+ (message "%s process stopped!" (process-name process))))
+
+(defun irony-iotask-check-process (process)
+ (let ((pfilter (process-filter process))
+ (psentinel (process-sentinel process)))
+ (unless (eq pfilter 'irony-iotask-process-filter)
+ (signal 'irony-iotask-error
+ (list "invalid process filter" pfilter
+ "did you call `irony-iotask-setup-process'?")))
+ (unless (eq psentinel 'irony-iotask-process-sentinel)
+ (signal 'irony-iotask-error
+ (list "invalid process sentinel" psentinel
+ "did you call `irony-iotask-setup-process'?"))))
+ (unless (process-live-p process)
+ (signal 'irony-iotask-error (list "Process ain't running!")))
+ (unless (buffer-live-p (process-buffer process))
+ (signal 'irony-iotask-error (list "Process' buffer dead!"))))
+
+
+;;
+;; Public API
+;;
+
+(defun irony-iotask-setup-process (process)
+ "Call after creating the asynchronous process to let
+irony-iotask setup the PROCESS filter and anything else that may
+be needed."
+ (with-current-buffer (process-buffer process)
+ (set-process-filter process #'irony-iotask-process-filter)
+ (set-process-sentinel process #'irony-iotask-process-sentinel)
+ (buffer-disable-undo)))
+
+(defun irony-iotask-schedule (process packaged-task callback)
+ (let ((ectx (irony-iotask-ectx--create :packaged-task packaged-task
+ :callback callback
+ :schedule-buffer (current-buffer))))
+ (irony-iotask-check-process process)
+ (with-current-buffer (process-buffer process)
+ ;; append the new task to the queue
+ (process-put process :ectx-q (append (process-get process :ectx-q)
+ (list ectx)))
+ ;; run task if none were running
+ (unless (cdr (process-get process :ectx-q))
+ (irony-iotask--start-next process)))))
+
+(defun irony-iotask-run (process packaged-task)
+ "Blocking/waiting counterpart of `irony-iotask-schedule'.
+
+Return the result (or signal the stored error) instead of passing
+it to a callback.
+
+Returns nil when quitting.
+
+This function isn't reentrant, do not call it from another task."
+ (lexical-let (run-result)
+ ;; schedule an asynchronous task that set result when done
+ (irony-iotask-schedule process
+ packaged-task
+ (lambda (result)
+ (setq run-result result)))
+
+ ;; wait for the task to complete
+ ;; quitting is allowed, in this case the task will still run but
+ ;; asynchronously, it won't block the user interface but the result will be
+ ;; lost
+ (if (with-local-quit
+ (while (not run-result)
+ (accept-process-output process 0.05))
+ t)
+ ;; didn't quit, task was completed
+ (irony-iotask-result-get run-result)
+ ;; C-g was used
+ ;; TODO: We cannot abort the task because that may break the other tasks,
+ ;; the process will be in an unpredictable state. Howewer we can cancel
+ ;; the continuations.
+ )))
+
+(defun irony-iotask-get (propname)
+ (plist-get (irony-iotask-packaged-task-plist
+ irony-iotask--current-packaged-task)
+ propname))
+
+(defun irony-iotask-put (propname value)
+ (setf (irony-iotask-packaged-task-plist irony-iotask--current-packaged-task)
+ (plist-put (irony-iotask-packaged-task-plist
+ irony-iotask--current-packaged-task)
+ propname
+ value)))
+
+(defun irony-iotask--result ()
+ (irony-iotask-packaged-task-result irony-iotask--current-packaged-task))
+
+(defun irony-iotask-set-result (value)
+ (irony-iotask-result-set-value (irony-iotask--result) value))
+
+(defun irony-iotask-set-error (err &rest error-data)
+ (apply #'irony-iotask-result-set-error (irony-iotask--result) err error-data))
+
+(defun irony-iotask-send-string (string)
+ (process-send-string irony-iotask--process string))
+
+(defun irony-iotask-send-region (start end)
+ (process-send-region irony-iotask--process start end))
+
+(defun irony-iotask-send-eof (string)
+ (process-send-eof irony-iotask--process))
+
+(provide 'irony-iotask)
+;;; irony-iotask.el ends here
diff --git a/elpa/irony-20220110.849/irony-iotask.elc b/elpa/irony-20220110.849/irony-iotask.elc
new file mode 100644
index 0000000..b575c2d
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-iotask.elc
Binary files differ
diff --git a/elpa/irony-20220110.849/irony-pkg.el b/elpa/irony-20220110.849/irony-pkg.el
new file mode 100644
index 0000000..d685cdf
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-pkg.el
@@ -0,0 +1,13 @@
+(define-package "irony" "20220110.849" "C/C++ minor mode powered by libclang"
+ '((cl-lib "0.5")
+ (json "1.2"))
+ :commit "870d1576fb279bb93f776a71e65f45283c423a9e" :authors
+ '(("Guillaume Papin" . "guillaume.papin@epitech.eu"))
+ :maintainer
+ '("Guillaume Papin" . "guillaume.papin@epitech.eu")
+ :keywords
+ '("c" "convenience" "tools")
+ :url "https://github.com/Sarcasm/irony-mode")
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/elpa/irony-20220110.849/irony-snippet.el b/elpa/irony-20220110.849/irony-snippet.el
new file mode 100644
index 0000000..b12b587
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-snippet.el
@@ -0,0 +1,135 @@
+;;; irony-snippet.el --- Snippet support for Irony-Mode
+
+;; Copyright (C) 2013-2014 Guillaume Papin
+
+;; Author: Guillaume Papin <guillaume.papin@epitech.eu>
+;; Keywords: c, convenience
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Snippet support functions, support all version of YASnippet and
+;; maybe further frameworks later.
+;;
+;; It is possible to check snippet support by calling
+;; `irony-snippet-available-p'.
+;;
+;; Note: Some YASnippet versions require to have
+;; `yas/minor-mode' or `yas-minor-mode' enabled to work.
+
+;;; Code:
+
+
+;; Private variables
+;;
+(defvar irony-snippet--expand-function nil
+ "Function to expand a snippet at a given point (by default to
+the current position).
+
+e.g: (defun my-expand-snippet (snippet-str &optional pos)
+ (do-stuff (or pos (point)))
+
+Will be set to nil if no snippet expansion function is found.")
+
+
+;;
+;; "Public" functions
+;;
+(defun irony-snippet-available-p ()
+ "Return t if snippets are supported."
+ (and (irony-snippet--get-expand-function)
+ (not (irony-snippet--yas-disabled-p))))
+
+(defun irony-snippet-expand (snippet-str &optional pos)
+ "Expand SNIPPET-STR starting at POS.
+
+If `irony-snippet-available-p' return t then"
+ (let ((expand-func (irony-snippet--get-expand-function)))
+ (funcall expand-func snippet-str pos)))
+
+
+;; Private functions
+;;
+(defun irony-snippet--get-expand-function ()
+ (unless irony-snippet--expand-function
+ (irony-snippet--init-yas))
+ irony-snippet--expand-function)
+
+(defun irony-snippet--init-yas ()
+ ;; find the snippet expand function
+ (when (require 'yasnippet nil t)
+ (let ((yas-version (or (and (boundp 'yas--version) yas--version)
+ (and (boundp 'yas/version) yas/version)))) ;for old versions
+ (when (stringp yas-version)
+ (setq yas-version (replace-regexp-in-string "(\\|)" "" yas-version))
+ (setq irony-snippet--expand-function
+ ;; (string= ... "0.6.0c"), the 'c' suffix is not supported by
+ ;; `version-to-list' in emacs versions < 24, treat this one
+ ;; specifically.
+ (cond
+ ((or (string= yas-version "0.6.0c")
+ (version<= yas-version "0.6.0b"))
+ 'irony-snippet--expand-yas-1)
+ ;; `version<' thinks "0.8beta" < "0.8", we want to consider
+ ;; anything starting with "0.8" as "0.8" and more.
+ ((and (version< yas-version "0.8")
+ (not (string-prefix-p "0.8" yas-version)))
+ 'irony-snippet--expand-yas-2)
+ (t
+ 'irony-snippet--expand-yas-3)))))))
+
+(defun irony-snippet--yas-disabled-p ()
+ "If the current yasnippet version offers a minor-mode, check if
+this mode is disable by returning t, otherwise returns nil and
+it's partially safe to assume that yasnippet expansion can be
+used."
+ ;; XXX: work only when yasnippet is enabled, otherwise some
+ ;; variables used for the snippet expansion are not set and it
+ ;; causes some errors.
+ (if (boundp 'yas-minor-mode)
+ (not yas-minor-mode)
+ (if (boundp 'yas/minor-mode)
+ (not yas/minor-mode))))
+
+(defun irony-snippet--expand-yas-1 (snippet-str &optional pos)
+ "Expand snippets for YASnippet version <= 0.6.0c."
+ (declare-function yas/expand-snippet "ext:yasnippet" t nil)
+ (unless (irony-snippet--yas-disabled-p)
+ (yas/expand-snippet (or pos (point))
+ (or pos (point))
+ snippet-str)))
+
+(defun irony-snippet--expand-yas-2 (snippet-str &optional pos)
+ "Expand snippets for YASnippet version < 0.8.
+
+See also `irony-snippet--expand-yas-1'."
+ (declare-function yas/expand-snippet "ext:yasnippet" t nil)
+ (unless (irony-snippet--yas-disabled-p)
+ (when pos
+ (goto-char pos))
+ (yas/expand-snippet snippet-str)))
+
+(defun irony-snippet--expand-yas-3 (snippet-str &optional pos)
+ "Expand snippets for YASnippet version >= 0.8.
+
+See also `irony-snippet--expand-yas-2'."
+ (declare-function yas-expand-snippet "ext:yasnippet" t nil)
+ (unless (irony-snippet--yas-disabled-p)
+ (when pos
+ (goto-char pos))
+ (yas-expand-snippet snippet-str)))
+
+(provide 'irony-snippet)
+;;; irony-snippet.el ends here
diff --git a/elpa/irony-20220110.849/irony-snippet.elc b/elpa/irony-20220110.849/irony-snippet.elc
new file mode 100644
index 0000000..a5762f6
--- /dev/null
+++ b/elpa/irony-20220110.849/irony-snippet.elc
Binary files differ
diff --git a/elpa/irony-20220110.849/irony.el b/elpa/irony-20220110.849/irony.el
new file mode 100644
index 0000000..f70eca3
--- /dev/null
+++ b/elpa/irony-20220110.849/irony.el
@@ -0,0 +1,917 @@
+;;; irony.el --- C/C++ minor mode powered by libclang
+
+;; Copyright (C) 2011-2016 Guillaume Papin
+
+;; Author: Guillaume Papin <guillaume.papin@epitech.eu>
+;; Version: 1.5.0
+;; URL: https://github.com/Sarcasm/irony-mode
+;; Compatibility: GNU Emacs 24.x
+;; Keywords: c, convenience, tools
+;; Package-Requires: ((cl-lib "0.5") (json "1.2"))
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; This file provides `irony-mode', a minor mode for C, C++ and Objective-C.
+;;
+;; Usage:
+;; (add-hook 'c++-mode-hook 'irony-mode)
+;; (add-hook 'c-mode-hook 'irony-mode)
+;; (add-hook 'objc-mode-hook 'irony-mode)
+;;
+;; ;; Windows performance tweaks
+;; ;;
+;; (when (boundp 'w32-pipe-read-delay)
+;; (setq w32-pipe-read-delay 0))
+;; ;; Set the buffer size to 64K on Windows (from the original 4K)
+;; (when (boundp 'w32-pipe-buffer-size)
+;; (setq irony-server-w32-pipe-buffer-size (* 64 1024)))
+;;
+;; See also:
+;; - https://github.com/Sarcasm/company-irony
+;; - https://github.com/Sarcasm/flycheck-irony
+;; - https://github.com/Sarcasm/ac-irony
+
+;;; Code:
+
+(require 'irony-iotask)
+
+(autoload 'irony-completion--enter "irony-completion")
+(autoload 'irony-completion--exit "irony-completion")
+
+(require 'cl-lib)
+
+(autoload 'find-library-name "find-func")
+(autoload 'lm-version "lisp-mnt")
+
+
+;;
+;; Compatibility
+;;
+
+(eval-and-compile
+
+ ;; As seen in flycheck/magit
+ ;;
+ ;; Added in Emacs 24.3 (mirrors/emacs@b335efc3).
+ (unless (fboundp 'setq-local)
+ (defmacro setq-local (var val)
+ "Set variable VAR to value VAL in current buffer."
+ (list 'set (list 'make-local-variable (list 'quote var)) val)))
+
+ ;; Added in Emacs 24.3 (mirrors/emacs@b335efc3).
+ (unless (fboundp 'defvar-local)
+ (defmacro defvar-local (var val &optional docstring)
+ "Define VAR as a buffer-local variable with default value VAL.
+Like `defvar' but additionally marks the variable as being
+automatically buffer-local wherever it is set."
+ (declare (debug defvar) (doc-string 3))
+ (list 'progn (list 'defvar var val docstring)
+ (list 'make-variable-buffer-local (list 'quote var)))))
+
+ ) ;; eval-and-compile
+
+
+;;
+;; Customizable variables
+;;
+
+(defgroup irony nil
+ "C/C++ minor mode powered by libclang."
+ :group 'c)
+
+(defcustom irony-lighter " Irony"
+ "Text to display in the mode line when irony mode is on."
+ :type 'string
+ :group 'irony)
+
+(defcustom irony-extra-cmake-args nil
+ "Extra arguments to CMake when compiling the server."
+ :type '(repeat string)
+ :group 'irony)
+
+(defcustom irony-user-dir (locate-user-emacs-file "irony/")
+ "Directory containing the Irony generated files.
+
+The slash is expected at the end."
+ :type 'directory
+ :risky t
+ :group 'irony)
+
+(defcustom irony-supported-major-modes '(c++-mode
+ c-mode
+ objc-mode)
+ "List of modes known to be compatible with Irony."
+ :type '(repeat symbol)
+ :group 'irony)
+
+;;;###autoload
+(defcustom irony-additional-clang-options nil
+ "Additional command line options to pass down to libclang.
+
+Please, do NOT use this variable to add header search paths, only
+additional warnings or compiler options.
+
+These compiler options will be prepended to the command line, in
+order to not override the value coming from a compilation
+database."
+ :type '(repeat string)
+ :options '("-Wdocumentation")
+ :group 'irony)
+
+(defcustom irony-lang-compile-option-alist
+ '((c++-mode . "c++")
+ (c-mode . "c")
+ (objc-mode . "objective-c"))
+ "Alist to decide the language option to used based on the `major-mode'."
+ :type '(alist :key-type symbol :value-type string)
+ :group 'irony)
+
+(defcustom irony-cmake-executable "cmake"
+ "Name or path of the CMake executable."
+ :type 'string
+ :group 'irony)
+
+(defcustom irony-server-source-dir nil
+ "Points to the irony-server source directory.
+
+This should point to the directory that contains the top-most
+CMakeLists.txt used to build the server.
+
+By default it will find the directory based on the irony.el directory."
+ :type 'directory
+ :group 'irony
+ :package-version '(irony . "1.2.0"))
+
+(defcustom irony-server-build-dir nil
+ "Build directory for irony-server.
+
+If set to nil the default is to create a build directory in
+`temporary-file-directory'/build-irony-server-`(irony-version)'."
+ :type 'directory
+ :group 'irony)
+
+(defcustom irony-server-install-prefix irony-user-dir
+ "Installation prefix used to install irony-server.
+
+The irony-server executable is expected to be in
+`irony-server-install-prefix'/bin/."
+ :type 'directory
+ :group 'irony)
+
+(defcustom irony-server-w32-pipe-buffer-size nil
+ "Windows-only setting,
+the buffer size to use for the irony-server process pipe on Windows.
+
+Larger values can improve performances on large buffers.
+
+If non-nil, `w32-pipe-buffer-size' will be let-bound to this value
+during the creation of the irony-server process.")
+
+
+;;
+;; Public/API variables
+;;
+;; Non-customizable variables provided by Irony that can be useful to other
+;; packages.
+;;
+;; Note that they shouldn't be modified directly by external packages, just
+;; read.
+;;
+
+;; TODO: make this variable public when the CDB API stabilizes.
+(defvar-local irony--compile-options nil
+ "Compile options for the current file.
+
+The compile options used by the compiler to build the current
+buffer file.")
+
+;; TODO: make this variable public when the CDB API stabilizes.
+(defvar-local irony--working-directory nil
+ "The working directory to pass to libclang, if any.")
+
+
+;;
+;; Internal variables
+;;
+;; The prefix `irony--' is used when something can completely change (or
+;; disappear) from one release to the other.
+;;
+;; -- https://lists.gnu.org/archive/html/emacs-devel/2013-06/msg01129.html
+
+(defconst irony--eot "\n;;EOT\n"
+ "String sent by the server to signal the end of a response.")
+
+
+;;
+;; Error conditions
+;;
+
+;; `define-error' breaks backward compatibility with Emacs < 24.4
+(defun irony--define-error (name message &optional parent)
+ "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'.
+PARENT is either a signal or a list of signals from which it inherits.
+Defaults to `error'."
+ (unless parent (setq parent 'error))
+ (let ((conditions
+ (if (consp parent)
+ (apply #'nconc
+ (mapcar (lambda (parent)
+ (cons parent
+ (or (get parent 'error-conditions)
+ (error "Unknown signal `%s'" parent))))
+ parent))
+ (cons parent (get parent 'error-conditions)))))
+ (put name 'error-conditions
+ (delete-dups (copy-sequence (cons name conditions))))
+ (when message (put name 'error-message message))))
+
+(irony--define-error 'irony-error "Irony-Mode error")
+(irony--define-error 'irony-parse-error "Irony-Mode parsing error" 'irony-error)
+(irony--define-error 'irony-server-error "Irony-Mode server error" 'irony-error)
+
+
+;;
+;; Utility functions & macros
+;;
+
+;; TODO: remove and use `if-let' when supported version jumps to Emacs 25.1
+(defmacro irony--aif (test if-expr &rest else-body)
+ (declare (indent 2))
+ `(let ((it ,test))
+ (if it
+ ,if-expr
+ (progn ,@else-body))))
+
+;; TODO: remove and use `when-let' when supported version jumps to Emacs 25.1
+(defmacro irony--awhen (test &rest body)
+ (declare (indent 1))
+ `(let ((it ,test))
+ (when it
+ (progn ,@body))))
+
+(defun irony--assoc-all (key list)
+ (delq nil (mapcar (lambda (c)
+ (when (equal (car c) key)
+ c))
+ list)))
+
+(defmacro irony--without-narrowing (&rest body)
+ "Remove the effect of narrowing for the current buffer.
+
+Note: If `save-excursion' is needed for BODY, it should be used
+before calling this macro."
+ (declare (indent 0) (debug t))
+ `(save-restriction
+ (widen)
+ (progn ,@body)))
+
+(defun irony--buffer-size-in-bytes ()
+ "Return the buffer size, in bytes."
+ (1- (position-bytes (point-max))))
+
+(defun irony--read-char-choice (prompt chars)
+ "Wrapper around `read-char-choice', available since Emacs 24."
+ (setq prompt (concat prompt " [" chars "]: "))
+ (if (fboundp 'read-char-choice)
+ (read-char-choice prompt chars)
+ (setq prompt (propertize prompt 'face 'minibuffer-prompt))
+ (let ((cursor-in-echo-area t)
+ k)
+ (while (not (member k chars))
+ (setq k (read-char-exclusive prompt)))
+ k)))
+
+(defun irony--shorten-path (path)
+ "Make PATH as short as possible.
+
+The given path can be considered understandable by human but not
+necessary a valid path string to use in code. Its only purpose is
+to be displayed to the user."
+ (let ((relative (file-relative-name path))
+ (abbreviated (abbreviate-file-name path)))
+ (if (< (string-width relative) (string-width abbreviated))
+ relative
+ abbreviated)))
+
+(defun irony--split-command-line-1 (quoted-str)
+ "Remove the escaped quotes and backlash from a QUOTED-STR.
+
+Return a list of the final characters in the reverse order.
+
+Only to be consumed by `irony--split-command-line'."
+ (let ((len (length quoted-str))
+ (i 0)
+ ch next-ch
+ result)
+ (while (< i len)
+ (setq ch (aref quoted-str i))
+ (when (eq ch ?\\)
+ (let ((next-ch (and (< (1+ i) len)
+ (aref quoted-str (1+ i)))))
+ (when (member next-ch '(?\\ ?\"))
+ (setq ch next-ch)
+ (cl-incf i))))
+ (push ch result)
+ (cl-incf i))
+ result))
+
+;; TODO: rewrite the function correctly to handle things like the following:
+;;
+;; "/usr/bin/clang++ -Irelative -DSOMEDEF=\"With spaces, quotes and \\-es.\" <args...>"
+(defun irony--split-command-line (cmd-line)
+ "Split CMD-LINE into a list of arguments.
+
+Takes care of double quotes as well as backslash.
+
+Sadly I had to write this because `split-string-and-unquote'
+breaks with escaped quotes in compile_commands.json, such as in:
+
+ /usr/bin/c++ -DLLVM_VERSION_INFO=\\\\\\\"3.2svn\\\\\\\" <args>"
+ ;; everytime I write a function like this one, it makes me feel bad
+ (let* ((len (length cmd-line))
+ (spaces (string-to-list " \f\t\n\r\v"))
+ (first-not-spaces-re (concat "[^" spaces "]"))
+ (i 0)
+ ch
+ args cur-arg)
+ (while (< i len)
+ (setq ch (aref cmd-line i))
+ (cond
+ ((member ch spaces) ;spaces
+ (when cur-arg
+ (setq args (cons (apply 'string (nreverse cur-arg)) args)
+ cur-arg nil))
+ ;; move to the next char
+ (setq i (or (string-match-p first-not-spaces-re cmd-line i)
+ len)))
+ ((eq ch ?\") ;quoted string
+ (let ((endq (string-match-p "[^\\]\"" cmd-line i)))
+ (unless endq
+ (signal 'irony-parse-error (list "ill formed command line" cmd-line)))
+ (let ((quoted-str (substring cmd-line (1+ i) (1+ endq))))
+ (setq cur-arg (append (irony--split-command-line-1 quoted-str)
+ cur-arg)
+ i (+ endq 2)))))
+ (t ;a valid char
+ ;; if it's an escape of: a backslash, a quote or a space push
+ ;; only the following char.
+ (when (eq ch ?\\)
+ (let ((next-ch (and (< (1+ i) len)
+ (aref cmd-line (1+ i)))))
+ (when (or (member next-ch '(?\\ ?\"))
+ (member next-ch spaces))
+ (setq ch next-ch)
+ (cl-incf i))))
+ (push ch cur-arg)
+ (cl-incf i))))
+ (when cur-arg
+ (setq args (cons (apply 'string (nreverse cur-arg)) args)))
+ (nreverse args)))
+
+(defun irony--get-buffer-path-for-server (&optional buffer)
+ "Get the path of the current buffer to send to irony-server.
+
+If no such file exists on the filesystem the special file '-' is
+ returned instead."
+ (let ((file (buffer-file-name buffer)))
+ (if (and file (file-exists-p file))
+ file
+ "-")))
+
+
+;;
+;; Mode
+;;
+
+(defvar irony-mode-map (make-sparse-keymap)
+ "Keymap used in `irony-mode' buffers.")
+
+;;;###autoload
+(define-minor-mode irony-mode
+ "Minor mode for C, C++ and Objective-C, powered by libclang."
+ nil
+ irony-lighter
+ irony-mode-map
+ :group 'irony
+ (if irony-mode
+ (irony--mode-enter)
+ (irony--mode-exit)))
+
+(defun irony--mode-enter ()
+ ;; warn the user about modes such as php-mode who inherits c-mode
+ (when (not (memq major-mode irony-supported-major-modes))
+ (display-warning 'irony "Major mode is unknown to Irony,\
+ see `irony-supported-major-modes'."))
+ ;; warn the user about Windows-specific issues
+ (when (eq system-type 'windows-nt)
+ (cond
+ ((version< emacs-version "24.4")
+ (display-warning 'irony "Emacs >= 24.4 expected on Windows."))
+ ((and (boundp 'w32-pipe-read-delay) (> w32-pipe-read-delay 0))
+ (display-warning 'irony "Performance will be bad because a\
+ pipe delay is set for this platform (see variable\
+ `w32-pipe-read-delay')."))))
+ (irony-completion--enter))
+
+(defun irony--mode-exit ()
+ (irony-completion--exit))
+
+;;;###autoload
+(defun irony-version (&optional show-version)
+ "Return the version number of the file irony.el.
+
+If called interactively display the version in the echo area."
+ (interactive (list t))
+ ;; Shamelessly stolen from `company-mode'.
+ (with-temp-buffer
+ (insert-file-contents (find-library-name "irony"))
+ (let ((v (lm-version)))
+ (when show-version
+ (message "irony version: %s" v))
+ v)))
+
+
+;;
+;; Compile options handling
+;;
+
+(defun irony--lang-compile-option ()
+ (irony--awhen (cdr-safe (assq major-mode irony-lang-compile-option-alist))
+ (list "-x" it)))
+
+(defun irony--extract-working-directory-option (flags)
+ "Return working directory specified on the command line, if
+any."
+ (catch 'found
+ (while flags
+ (let ((flag (car flags)))
+ (cond
+ ((string= "-working-directory" flag)
+ (throw 'found (cadr flags)))
+ ((string-prefix-p "-working-directory=" flag)
+ (throw 'found (substring flag (length "-working-directory="))))
+ (t
+ (setq flags (cdr flags))))))))
+
+(defun irony--adjust-compile-options ()
+ "The compile options to send to libclang."
+ ;; TODO: if current buffer has no associated file (will be sent as '-') but is
+ ;; in an existing directory, we will want to add -I (directory-file-name
+ ;; buffer-file-name) to find the relative headers
+ (append
+ (irony--lang-compile-option)
+ (irony--awhen irony--working-directory
+ (unless (irony--extract-working-directory-option irony--compile-options)
+ (list "-working-directory" it)))
+ irony-additional-clang-options
+ irony--compile-options))
+
+(defun irony--extract-user-search-paths (compile-options work-dir)
+ "Retrieve the user search paths present in COMPILE-OPTIONS.
+
+Relative paths are expanded to be relative to WORK-DIR.
+
+The returned paths are returned as
+directory (`file-name-as-directory').
+
+Note: WORK-DIR is not used when the compile option
+'-working-directory=<directory>' is detected in COMPILE-OPTIONS."
+ (setq work-dir (or (irony--extract-working-directory-option compile-options)
+ work-dir))
+ (let (include-dirs opt)
+ (while (setq opt (car compile-options))
+ (cond
+ ((string= "-I" opt)
+ (add-to-list 'include-dirs (nth 1 compile-options) t)
+ (setq compile-options (cddr compile-options)))
+ ((string-prefix-p "-I" opt)
+ (add-to-list 'include-dirs (substring opt 2) t)
+ (setq compile-options (cdr compile-options)))
+ (t
+ (setq compile-options (cdr compile-options)))))
+ (delete-dups (mapcar #'(lambda (path)
+ (file-name-as-directory
+ (expand-file-name path work-dir)))
+ include-dirs))))
+
+
+;;
+;; Irony-Server setup
+;;
+
+(defvar irony--server-install-command-history nil)
+(defun irony--install-server-read-command (command)
+ (read-shell-command
+ "Install command: " command
+ (if (equal (car irony--server-install-command-history) command)
+ '(irony--server-install-command-history . 1)
+ 'irony--server-install-command-history)))
+
+(defun irony-install-server (command)
+ "Install or reinstall the Irony server.
+
+The installation requires CMake and the libclang development package."
+ (interactive
+ (list (let ((command
+ (format
+ (concat "%s %s %s %s && %s --build . "
+ "--use-stderr --config Release --target install")
+ (shell-quote-argument irony-cmake-executable)
+ (shell-quote-argument (concat "-DCMAKE_INSTALL_PREFIX="
+ (expand-file-name
+ irony-server-install-prefix)))
+ (mapconcat 'shell-quote-argument irony-extra-cmake-args " ")
+ (shell-quote-argument
+ (or irony-server-source-dir
+ (expand-file-name "server"
+ (file-name-directory
+ (find-library-name "irony")))))
+ (shell-quote-argument irony-cmake-executable))))
+ (irony--install-server-read-command command))))
+ (let ((build-dir (or irony-server-build-dir
+ (concat
+ (file-name-as-directory temporary-file-directory)
+ (file-name-as-directory (format "build-irony-server-%s"
+ (irony-version)))))))
+ (make-directory build-dir t)
+ (let ((default-directory build-dir))
+ ;; we need to kill the process to be able to install a new one,
+ ;; at least on Windows
+ (irony-server-kill)
+ (with-current-buffer (compilation-start command nil
+ #'(lambda (maj-mode)
+ "*irony-server build*"))
+ (setq-local compilation-finish-functions
+ '(irony--server-install-finish-function))))))
+
+(defun irony--server-install-finish-function (buffer msg)
+ (if (string= "finished\n" msg)
+ (message "irony-server installed successfully!")
+ (message "Failed to build irony-server, you are on your own buddy!")))
+
+(defun irony--find-server-executable ()
+ "Return the path to the irony-server executable.
+
+Throw an `irony-server-error' if a proper executable cannot be
+found."
+ (let* ((exec-path (cons (expand-file-name "bin" irony-server-install-prefix)
+ exec-path))
+ (exe (executable-find "irony-server")))
+ (condition-case err
+ (let ((version (car (process-lines exe "--version"))))
+ (if (and (string-match "^irony-server version " version)
+ (version= (irony-version)
+ (substring version
+ (length "irony-server version "))))
+ ;; irony-server is working and up-to-date!
+ exe
+ (signal 'irony-server-error
+ (list
+ (format "irony-server version mismatch: %s"
+ (substitute-command-keys
+ "type `\\[irony-install-server]' to reinstall"))))))
+ (irony-server-error
+ (signal (car err) (cdr err)))
+ (error
+ (signal 'irony-server-error
+ (if (and exe
+ (file-executable-p exe))
+ ;; failed to execute due to a runtime problem, i.e:
+ ;; libclang.so isn't in the ld paths
+ (list (format "irony-server is broken! %s"
+ (error-message-string err)))
+ ;; irony-server doesn't exists, first time irony-mode is used?
+ ;; inform the user about how to build the executable
+ (list
+ (format "irony-server not installed! %s"
+ (substitute-command-keys
+ "Type `\\[irony-install-server]' to install")))))))))
+
+
+;;
+;; irony-server process management.
+;;
+
+(defvar irony--server-executable nil)
+(defvar irony--server-process nil)
+(defvar irony--server-buffer " *Irony*"
+ "The name of the buffer for the irony process to run in.
+
+When using a leading space, the buffer is hidden from the buffer
+list (and undo information is not kept).")
+
+(defun irony--start-server-process ()
+ (unless irony--server-executable
+ ;; if not found, an `irony-server-error' error is signaled
+ (setq irony--server-executable (irony--find-server-executable)))
+ (let ((process-connection-type nil)
+ (process-adaptive-read-buffering nil)
+ (w32-pipe-buffer-size (when (boundp 'w32-pipe-buffer-size)
+ (or irony-server-w32-pipe-buffer-size
+ w32-pipe-buffer-size)))
+ process)
+ (setq process
+ (start-process-shell-command
+ "Irony" ;process name
+ irony--server-buffer ;buffer
+ (format "%s -i 2> %s" ;command
+ (shell-quote-argument irony--server-executable)
+ (expand-file-name
+ (format-time-string "irony.%Y-%m-%d_%Hh-%Mm-%Ss.log")
+ temporary-file-directory))))
+ (set-process-query-on-exit-flag process nil)
+ (irony-iotask-setup-process process)
+ process))
+
+;;;###autoload
+(defun irony-server-kill ()
+ "Kill the running irony-server process, if any."
+ (interactive)
+ (when (process-live-p irony--server-process)
+ (kill-process irony--server-process)
+ (setq irony--server-process nil)))
+
+(defun irony--get-server-process-create ()
+ (unless (process-live-p irony--server-process)
+ (setq irony--server-process (irony--start-server-process)))
+ irony--server-process)
+
+(defun irony--run-task (task)
+ (irony-iotask-run (irony--get-server-process-create) task))
+
+(defun irony--run-task-asynchronously (task callback)
+ (irony-iotask-schedule (irony--get-server-process-create) task callback))
+
+(defun irony--quote-strings (strings &optional separator)
+ "Like `combine-and-quote-strings', but when the string is \"\" or nil,
+`irony--quote-strings' will convert it to \"\" instead of <SPC>.
+That is:
+
+ (irony--quote-strings \'(\"a\" \"\" \"b\")) => \"a \\\"\\\" b\"
+ (combine-and-quote-strings \'(\"a\" \"\" \"b\")) => \"a b\"
+"
+ (let* ((sep (or separator " "))
+ (re (concat "[\\\"]" "\\|" (regexp-quote sep))))
+ (mapconcat
+ (lambda (str)
+ (cond
+ ((or (not str) (string= str ""))
+ "\"\"")
+ ((string-match re str)
+ (concat "\"" (replace-regexp-in-string "[\\\"]" "\\\\\\&" str) "\""))
+ (t str)))
+ strings sep)))
+
+(defun irony--server-send-command (command &rest args)
+ (let ((command-line (concat (irony--quote-strings
+ (mapcar (lambda (arg)
+ (if (numberp arg)
+ (number-to-string arg)
+ arg))
+ (cons command args)))
+ "\n")))
+ (irony-iotask-send-string command-line)))
+
+;; XXX: this code can run in very tight very sensitive on big inputs,
+;; every change should be measured
+(defun irony--server-command-update (&rest _args)
+ (when (and (>= (buffer-size) (length irony--eot))
+ (string-equal (buffer-substring-no-properties
+ (- (point-max) (length irony--eot)) (point-max))
+ irony--eot))
+ (condition-case-unless-debug nil
+ (let ((result (read (current-buffer))))
+ (cl-case (car result)
+ (success
+ (irony-iotask-set-result (cdr result)))
+ (error
+ (apply #'irony-iotask-set-error 'irony-server-error
+ (cdr result)))))
+ (error
+ (throw 'invalid-msg t)))))
+
+;; FIXME: code duplication with `irony--server-command-update'
+;; XXX: this code can run in very tight very sensitive on big inputs,
+;; every change should be measured
+(defun irony--server-query-update (&rest _args)
+ (when (and (>= (buffer-size) (length irony--eot))
+ (string-equal (buffer-substring-no-properties
+ (- (point-max) (length irony--eot)) (point-max))
+ irony--eot))
+ (condition-case-unless-debug nil
+ (irony-iotask-set-result (read (current-buffer)))
+ (error
+ (throw 'invalid-msg t)))))
+
+
+;;
+;; Server commands
+;;
+
+(irony-iotask-define-task irony--t-get-compile-options
+ "`get-compile-options' server command."
+ :start (lambda (build-dir file)
+ (irony--server-send-command "get-compile-options" build-dir file))
+ :update irony--server-command-update)
+
+(defun irony--get-compile-options-task (build-dir file)
+ (irony-iotask-package-task irony--t-get-compile-options build-dir file))
+
+(cl-defstruct (irony--buffer-state
+ (:constructor irony--buffer-state-create-1))
+ file
+ exists
+ modified
+ tick)
+
+(defun irony--buffer-state-create (buffer)
+ (let ((file (buffer-file-name buffer)))
+ (irony--buffer-state-create-1 :file file
+ :exists (and file (file-exists-p file))
+ :modified (buffer-modified-p buffer)
+ :tick (buffer-chars-modified-tick buffer))))
+
+(defun irony--buffer-state-compare (old new)
+ (unless (equal old new)
+ (cond
+ ((irony--buffer-state-modified new) 'set-unsaved)
+ ((null old) nil) ;noop
+ ((and
+ (irony--buffer-state-modified old)
+ (irony--buffer-state-exists old)) 'reset-unsaved))))
+
+(irony-iotask-define-task irony--t-set-unsaved
+ "`set-unsaved' server command."
+ :start (lambda (process buffer buf-state)
+ (let ((elem (assq buffer (process-get process :unsaved-buffers)))
+ temp-file)
+ (if (eq (cdr elem) buf-state)
+ ;; early exit if already cached
+ (irony-iotask-set-result t)
+ (setq temp-file (make-temp-file "irony-unsaved-"))
+ (irony-iotask-put :temp-file temp-file)
+ (irony-iotask-put :buffer-state buf-state)
+ (process-put process :buffer-state buf-state)
+ (with-current-buffer buffer
+ (irony--without-narrowing
+ (let ((write-region-inhibit-fsync t))
+ (write-region nil nil temp-file nil 0)))
+ (irony--server-send-command "set-unsaved"
+ (irony--get-buffer-path-for-server)
+ temp-file)))))
+ :update irony--server-command-update
+ :finish (lambda (&rest _args)
+ (delete-file (irony-iotask-get :temp-file)))
+ :on-success
+ (lambda (process buffer &rest _args)
+ (let* ((unsaved-buffers (process-get process :unsaved-buffers))
+ (elem (assq buffer unsaved-buffers))
+ (buf-state (irony-iotask-get :buffer-state)))
+ (if elem
+ (setcdr elem buf-state)
+ (process-put process :unsaved-buffers (cons (cons buffer buf-state)
+ unsaved-buffers))))))
+
+(defun irony--set-unsaved-task (process buffer buf-state)
+ (irony-iotask-package-task irony--t-set-unsaved process buffer buf-state))
+
+(irony-iotask-define-task irony--t-reset-unsaved
+ "`reset-unsaved' server command."
+ :start (lambda (process buffer)
+ (if (assq buffer (process-get process :unsaved-buffers))
+ (irony--server-send-command "reset-unsaved"
+ (irony--get-buffer-path-for-server
+ buffer))
+ ;; exit early if already reset
+ (irony-iotask-set-result t)))
+ :update irony--server-command-update
+ :finish (lambda (process buffer)
+ (process-put
+ process
+ :unsaved-buffers
+ (assq-delete-all buffer (process-get process :unsaved-buffers)))))
+
+(defun irony--reset-unsaved-task (process buffer)
+ (irony-iotask-package-task irony--t-reset-unsaved process buffer))
+
+(defun irony--list-unsaved-irony-mode-buffers (&optional ignore-list)
+ (delq nil (mapcar (lambda (buf)
+ (unless (memq buf ignore-list)
+ (when (buffer-modified-p buf)
+ (with-current-buffer buf
+ (and irony-mode buf)))))
+ (buffer-list))))
+
+(defun irony--get-buffer-change-alist (process)
+ "Return a list of (buffer . old-state).
+
+old-state can be nil if the old state isn't known."
+ (let ((unsaved-list (process-get process :unsaved-buffers)))
+ (append unsaved-list
+ (mapcar (lambda (buf)
+ (cons buf nil))
+ (irony--list-unsaved-irony-mode-buffers
+ (mapcar #'car unsaved-list))))))
+
+(defun irony--unsaved-buffers-tasks ()
+ (let ((process (irony--get-server-process-create))
+ result)
+ (dolist (buffer-old-state-cons (irony--get-buffer-change-alist process)
+ result)
+ (let* ((buffer (car buffer-old-state-cons))
+ (old-state (cdr buffer-old-state-cons))
+ (new-state (irony--buffer-state-create buffer))
+ (task
+ (cl-case (irony--buffer-state-compare old-state new-state)
+ (set-unsaved
+ (irony--set-unsaved-task process buffer new-state))
+ (reset-unsaved
+ (irony--reset-unsaved-task process buffer)))))
+ (when task
+ (setq result (if result
+ (irony-iotask-chain result task)
+ task)))))))
+
+(irony-iotask-define-task irony--t-parse
+ "`parse' server command."
+ :start (lambda (file compile-options)
+ (apply #'irony--server-send-command "parse" file "--"
+ compile-options))
+ :update irony--server-command-update)
+
+(defun irony--parse-task-1 (&optional buffer)
+ (with-current-buffer (or buffer (current-buffer))
+ (irony-iotask-package-task irony--t-parse
+ (irony--get-buffer-path-for-server)
+ (irony--adjust-compile-options))))
+
+(defun irony--parse-task (&optional buffer)
+ (let ((unsaved-tasks (irony--unsaved-buffers-tasks))
+ (parse-task (irony--parse-task-1 buffer)))
+ (if unsaved-tasks
+ (irony-iotask-chain unsaved-tasks parse-task)
+ parse-task)))
+
+(irony-iotask-define-task irony--t-diagnostics
+ "`parse' server command."
+ :start (lambda ()
+ (irony--server-send-command "diagnostics"))
+ :update irony--server-query-update)
+
+(defun irony--diagnostics-task (&optional buffer)
+ (irony-iotask-chain
+ (irony--parse-task buffer)
+ (irony-iotask-package-task irony--t-diagnostics)))
+
+(irony-iotask-define-task irony--t-get-type
+ "`get-type' server command."
+ :start (lambda (line col)
+ (irony--server-send-command "get-type" line col))
+ :update irony--server-query-update)
+
+(defun irony--get-type-task (&optional buffer pos)
+ (let ((line-column (irony--completion-line-column pos)))
+ (irony-iotask-chain
+ (irony--parse-task buffer)
+ (irony-iotask-package-task irony--t-get-type
+ (car line-column) (cdr line-column)))))
+
+;;;###autoload
+(defun irony-get-type ()
+ "Get the type of symbol under cursor."
+ (interactive)
+ (let ((types (irony--run-task (irony--get-type-task))))
+ (unless types
+ (user-error "Type not found"))
+ (if (and (cdr types) (not (string= (car types) (cadr types))))
+ (message "%s (aka '%s')" (car types) (cadr types))
+ (message "%s" (car types)))))
+
+(defun irony-parse-buffer-async (&optional callback)
+ "Parse the current buffer sending results to an optional
+ CALLBACK function."
+ (irony--run-task-asynchronously (irony--parse-task)
+ (or callback #'ignore)))
+
+(provide 'irony)
+
+;; Local Variables:
+;; byte-compile-warnings: (not cl-functions)
+;; End:
+
+;;; irony.el ends here
diff --git a/elpa/irony-20220110.849/irony.elc b/elpa/irony-20220110.849/irony.elc
new file mode 100644
index 0000000..1e85f29
--- /dev/null
+++ b/elpa/irony-20220110.849/irony.elc
Binary files differ
diff --git a/elpa/irony-20220110.849/server/.clang-format b/elpa/irony-20220110.849/server/.clang-format
new file mode 100644
index 0000000..68e7062
--- /dev/null
+++ b/elpa/irony-20220110.849/server/.clang-format
@@ -0,0 +1,8 @@
+BasedOnStyle: LLVM
+AllowShortFunctionsOnASingleLine: false
+AlwaysBreakTemplateDeclarations: true
+BinPackParameters: false
+BreakConstructorInitializersBeforeComma: true
+ConstructorInitializerAllOnOneLineOrOnePerLine: true
+ConstructorInitializerIndentWidth: 2
+IndentFunctionDeclarationAfterType: false
diff --git a/elpa/irony-20220110.849/server/.clang-tidy b/elpa/irony-20220110.849/server/.clang-tidy
new file mode 100644
index 0000000..57e038a
--- /dev/null
+++ b/elpa/irony-20220110.849/server/.clang-tidy
@@ -0,0 +1,24 @@
+Checks: '-*,readability-identifier-naming,misc-assert-side-effect,readability-container-size-empty'
+CheckOptions:
+ - key: readability-identifier-naming.TypedefCase
+ value: CamelCase
+ - key: readability-identifier-naming.StructCase
+ value: CamelCase
+ - key: readability-identifier-naming.ClassCase
+ value: CamelCase
+ - key: readability-identifier-naming.VariableCase
+ value: camelBack
+ - key: readability-identifier-naming.ParameterCase
+ value: camelBack
+ - key: readability-identifier-naming.FunctionCase
+ value: camelBack
+ - key: readability-identifier-naming.NamespaceCase
+ value: lower_case
+ - key: readability-identifier-naming.GlobalConstantCase
+ value: UPPER_CASE
+ - key: readability-identifier-naming.PrivateMemberSuffix
+ value: _
+ - key: misc-assert-side-effect.CheckFunctionCalls
+ value: 1
+ - key: misc-assert-side-effect.AssertMacros
+ value: 'assert'
diff --git a/elpa/irony-20220110.849/server/CMakeLists.txt b/elpa/irony-20220110.849/server/CMakeLists.txt
new file mode 100644
index 0000000..21f9c9f
--- /dev/null
+++ b/elpa/irony-20220110.849/server/CMakeLists.txt
@@ -0,0 +1,33 @@
+cmake_minimum_required(VERSION 3.0.2)
+
+project(IronyMode)
+
+set(CMAKE_MODULE_PATH
+ ${PROJECT_SOURCE_DIR}/cmake
+ ${PROJECT_SOURCE_DIR}/cmake/modules
+ ${CMAKE_MODULE_PATH})
+
+include(CTest)
+include(GNUInstallDirs)
+
+# Starting from CMake >= 3.1, if a specific standard is required,
+# it can be set from the command line with:
+# cmake -DCMAKE_CXX_STANDARD=[11|14|17]
+function(irony_target_set_cxx_standard target)
+ set(cxx_standard 11)
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
+ target_compile_options(${target} PRIVATE -std=c++${cxx_standard})
+ endif()
+ elseif (CMAKE_VERSION VERSION_LESS "3.8")
+ set_property(TARGET ${target} PROPERTY CXX_STANDARD ${cxx_standard})
+ else()
+ target_compile_features(${target} PUBLIC cxx_std_${cxx_standard})
+ endif()
+endfunction()
+
+add_subdirectory(src)
+
+if (BUILD_TESTING)
+ add_subdirectory(test)
+endif()
diff --git a/elpa/irony-20220110.849/server/build-aux/run-clang-tidy/LICENSE.TXT b/elpa/irony-20220110.849/server/build-aux/run-clang-tidy/LICENSE.TXT
new file mode 100644
index 0000000..a7f579f
--- /dev/null
+++ b/elpa/irony-20220110.849/server/build-aux/run-clang-tidy/LICENSE.TXT
@@ -0,0 +1,43 @@
+==============================================================================
+LLVM Release License
+==============================================================================
+University of Illinois/NCSA
+Open Source License
+
+Copyright (c) 2007-2016 University of Illinois at Urbana-Champaign.
+All rights reserved.
+
+Developed by:
+
+ LLVM Team
+
+ University of Illinois at Urbana-Champaign
+
+ http://llvm.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal with
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimers.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimers in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the names of the LLVM Team, University of Illinois at
+ Urbana-Champaign, nor the names of its contributors may be used to
+ endorse or promote products derived from this Software without specific
+ prior written permission.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+SOFTWARE.
diff --git a/elpa/irony-20220110.849/server/build-aux/run-clang-tidy/README b/elpa/irony-20220110.849/server/build-aux/run-clang-tidy/README
new file mode 100644
index 0000000..ed43509
--- /dev/null
+++ b/elpa/irony-20220110.849/server/build-aux/run-clang-tidy/README
@@ -0,0 +1,12 @@
+Origin:
+- http://llvm.org/svn/llvm-project/clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py?p=294607
+- https://github.com/llvm-mirror/clang-tools-extra/blob/c2e903ec98385b82e35bdb303e411854a2e8c032/clang-tidy/tool/run-clang-tidy.py
+
+Modifications:
+- the python version has been frozen to python2,
+ as the script is not python3-compatible
+- added -warnings-as-errors option
+- the run-clang-tidy.py script has been modified
+ to return a sensible exit code when running on Travis CI,
+ i.e. it honors exit code of the underlying processes
+ causing build failures on pull requests
diff --git a/elpa/irony-20220110.849/server/build-aux/run-clang-tidy/run-clang-tidy.py b/elpa/irony-20220110.849/server/build-aux/run-clang-tidy/run-clang-tidy.py
new file mode 100755
index 0000000..17db708
--- /dev/null
+++ b/elpa/irony-20220110.849/server/build-aux/run-clang-tidy/run-clang-tidy.py
@@ -0,0 +1,236 @@
+#!/usr/bin/env python2
+#
+#===- run-clang-tidy.py - Parallel clang-tidy runner ---------*- python -*--===#
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+#===------------------------------------------------------------------------===#
+# FIXME: Integrate with clang-tidy-diff.py
+
+"""
+Parallel clang-tidy runner
+==========================
+
+Runs clang-tidy over all files in a compilation database. Requires clang-tidy
+and clang-apply-replacements in $PATH.
+
+Example invocations.
+- Run clang-tidy on all files in the current working directory with a default
+ set of checks and show warnings in the cpp files and all project headers.
+ run-clang-tidy.py $PWD
+
+- Fix all header guards.
+ run-clang-tidy.py -fix -checks=-*,llvm-header-guard
+
+- Fix all header guards included from clang-tidy and header guards
+ for clang-tidy headers.
+ run-clang-tidy.py -fix -checks=-*,llvm-header-guard extra/clang-tidy \
+ -header-filter=extra/clang-tidy
+
+Compilation database setup:
+http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html
+"""
+
+import argparse
+import json
+import multiprocessing
+import os
+import Queue
+import re
+import shutil
+import subprocess
+import sys
+import tempfile
+import threading
+
+
+def find_compilation_database(path):
+ """Adjusts the directory until a compilation database is found."""
+ result = './'
+ while not os.path.isfile(os.path.join(result, path)):
+ if os.path.realpath(result) == '/':
+ print 'Error: could not find compilation database.'
+ sys.exit(1)
+ result += '../'
+ return os.path.realpath(result)
+
+
+def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path,
+ header_filter, extra_arg, extra_arg_before, quiet,
+ warnings_as_errors):
+ """Gets a command line for clang-tidy."""
+ start = [clang_tidy_binary]
+ if header_filter is not None:
+ start.append('-header-filter=' + header_filter)
+ else:
+ # Show warnings in all in-project headers by default.
+ start.append('-header-filter=^' + build_path + '/.*')
+ if checks:
+ start.append('-checks=' + checks)
+ if tmpdir is not None:
+ start.append('-export-fixes')
+ # Get a temporary file. We immediately close the handle so clang-tidy can
+ # overwrite it.
+ (handle, name) = tempfile.mkstemp(suffix='.yaml', dir=tmpdir)
+ os.close(handle)
+ start.append(name)
+ for arg in extra_arg:
+ start.append('-extra-arg=%s' % arg)
+ for arg in extra_arg_before:
+ start.append('-extra-arg-before=%s' % arg)
+ start.append('-p=' + build_path)
+ if quiet:
+ start.append('-quiet')
+ if warnings_as_errors is not None:
+ start.append('-warnings-as-errors=%s' % warnings_as_errors)
+ start.append(f)
+ return start
+
+
+def apply_fixes(args, tmpdir):
+ """Calls clang-apply-fixes on a given directory. Deletes the dir when done."""
+ invocation = [args.clang_apply_replacements_binary]
+ if args.format:
+ invocation.append('-format')
+ invocation.append(tmpdir)
+ ret = subprocess.call(invocation)
+ shutil.rmtree(tmpdir)
+ return ret
+
+
+def run_tidy(args, tmpdir, build_path, queue, results, i):
+ """Takes filenames out of queue and runs clang-tidy on them."""
+ results[i] = 0
+ while True:
+ name = queue.get()
+ invocation = get_tidy_invocation(name, args.clang_tidy_binary, args.checks,
+ tmpdir, build_path, args.header_filter,
+ args.extra_arg, args.extra_arg_before,
+ args.quiet, args.warnings_as_errors)
+ sys.stdout.write(' '.join(invocation) + '\n')
+ if subprocess.call(invocation) != 0:
+ results[i] = 1
+ queue.task_done()
+
+
+def main():
+ parser = argparse.ArgumentParser(description='Runs clang-tidy over all files '
+ 'in a compilation database. Requires '
+ 'clang-tidy and clang-apply-replacements in '
+ '$PATH.')
+ parser.add_argument('-clang-tidy-binary', metavar='PATH',
+ default='clang-tidy',
+ help='path to clang-tidy binary')
+ parser.add_argument('-clang-apply-replacements-binary', metavar='PATH',
+ default='clang-apply-replacements',
+ help='path to clang-apply-replacements binary')
+ parser.add_argument('-checks', default=None,
+ help='checks filter, when not specified, use clang-tidy '
+ 'default')
+ parser.add_argument('-header-filter', default=None,
+ help='regular expression matching the names of the '
+ 'headers to output diagnostics from. Diagnostics from '
+ 'the main file of each translation unit are always '
+ 'displayed.')
+ parser.add_argument('-warnings-as-errors', default=None, metavar='STRING',
+ help='Upgrades warnings to errors. '
+ 'Same format as "-checks".'
+ "This option's value is appended to the value of "
+ "the 'WarningsAsErrors' option in .clang-tidy "
+ "file, if any.'")
+ parser.add_argument('-j', type=int, default=0,
+ help='number of tidy instances to be run in parallel.')
+ parser.add_argument('files', nargs='*', default=['.*'],
+ help='files to be processed (regex on path)')
+ parser.add_argument('-fix', action='store_true', help='apply fix-its')
+ parser.add_argument('-format', action='store_true', help='Reformat code '
+ 'after applying fixes')
+ parser.add_argument('-p', dest='build_path',
+ help='Path used to read a compile command database.')
+ parser.add_argument('-extra-arg', dest='extra_arg',
+ action='append', default=[],
+ help='Additional argument to append to the compiler '
+ 'command line.')
+ parser.add_argument('-extra-arg-before', dest='extra_arg_before',
+ action='append', default=[],
+ help='Additional argument to prepend to the compiler '
+ 'command line.')
+ parser.add_argument('-quiet', action='store_true',
+ help='Run clang-tidy in quiet mode')
+ args = parser.parse_args()
+
+ db_path = 'compile_commands.json'
+
+ if args.build_path is not None:
+ build_path = args.build_path
+ else:
+ # Find our database
+ build_path = find_compilation_database(db_path)
+
+ try:
+ invocation = [args.clang_tidy_binary, '-list-checks']
+ invocation.append('-p=' + build_path)
+ if args.checks:
+ invocation.append('-checks=' + args.checks)
+ invocation.append('-')
+ print subprocess.check_output(invocation)
+ except:
+ print >>sys.stderr, "Unable to run clang-tidy."
+ sys.exit(1)
+
+ # Load the database and extract all files.
+ database = json.load(open(os.path.join(build_path, db_path)))
+ files = [entry['file'] for entry in database]
+
+ max_task = args.j
+ if max_task == 0:
+ max_task = multiprocessing.cpu_count()
+
+ tmpdir = None
+ if args.fix:
+ tmpdir = tempfile.mkdtemp()
+
+ # Build up a big regexy filter from all command line arguments.
+ file_name_re = re.compile('(' + ')|('.join(args.files) + ')')
+
+ try:
+ # Spin up a bunch of tidy-launching threads.
+ results = [None] * max_task
+ queue = Queue.Queue(max_task)
+ for i in range(max_task):
+ t = threading.Thread(target=run_tidy,
+ args=(args, tmpdir, build_path, queue, results, i))
+ t.daemon = True
+ t.start()
+
+ # Fill the queue with files.
+ for name in files:
+ if file_name_re.search(name):
+ queue.put(name)
+
+ # Wait for all threads to be done.
+ queue.join()
+
+ except KeyboardInterrupt:
+ # This is a sad hack. Unfortunately subprocess goes
+ # bonkers with ctrl-c and we start forking merrily.
+ print '\nCtrl-C detected, goodbye.'
+ if args.fix:
+ shutil.rmtree(tmpdir)
+ os.kill(0, 9)
+
+ for ret in results:
+ if ret != 0:
+ sys.exit(ret)
+
+ if args.fix:
+ print 'Applying fixes ...'
+ ret = apply_fixes(args, tmpdir)
+ if ret != 0:
+ sys.exit(ret)
+
+if __name__ == '__main__':
+ main()
diff --git a/elpa/irony-20220110.849/server/cmake/CheckClangResourceDir.cmake b/elpa/irony-20220110.849/server/cmake/CheckClangResourceDir.cmake
new file mode 100644
index 0000000..20bcda9
--- /dev/null
+++ b/elpa/irony-20220110.849/server/cmake/CheckClangResourceDir.cmake
@@ -0,0 +1,90 @@
+#
+# Get the Clang resource directory.
+#
+# If found the following variable will be set:
+# - CLANG_RESOURCE_DIR
+#
+set(CHECK_CLANG_RESOURCE_DIR_CHECKER_CODE_IN
+ ${CMAKE_CURRENT_LIST_DIR}/LibClangDiagnosticsChecker.cpp)
+
+function(check_clang_resource_dir)
+ if (CLANG_RESOURCE_DIR)
+ return() # already in cache
+ endif()
+
+ message(STATUS "Detecting Clang resource directory")
+ find_package (LibClang REQUIRED)
+
+ set(checker_code
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/LibClangDiagnosticsChecker.cpp)
+ set(checked_file
+ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check-libclang-stddef.cpp")
+
+ configure_file(${CHECK_CLANG_RESOURCE_DIR_CHECKER_CODE_IN}
+ ${checker_code} COPYONLY)
+ file(WRITE "${checked_file}" "#include <stddef.h>\n")
+
+ # Paths stolen from Rip-Rip/clang_complete#getBuiltinHeaderPath()
+ find_path(CHECK_CLANG_RESOURCE_DIR include/stddef.h
+ NO_DEFAULT_PATH
+ # the default path, favor this one over the other, in case a specific
+ # libclang has been chosen.
+ HINTS "${LIBCLANG_LIBRARY_DIR}/../lib/clang"
+ # other, distribution specific, paths
+ PATHS
+ "${LIBCLANG_LIBRARY_DIR}/../clang" # Gentoo
+ "${LIBCLANG_LIBRARY_DIR}/clang" # openSUSE, Windows
+ "${LIBCLANG_LIBRARY_DIR}/" # Google
+ "/usr/lib64/clang" # x86_64 (openSUSE, Fedora)
+ "/usr/lib/clang"
+ PATH_SUFFIXES ${LIBCLANG_KNOWN_LLVM_VERSIONS})
+
+ if (CHECK_CLANG_RESOURCE_DIR)
+ # On Windows the paths weren't escaped correctly, similar to:
+ # http://public.kitware.com/pipermail/cmake/2006-February/008473.html
+ list(APPEND run_args -resource-dir \"${CHECK_CLANG_RESOURCE_DIR}\")
+ endif()
+
+ list(APPEND run_args ${checked_file})
+
+ try_run(
+ CHECK_CLANG_RESOURCE_DIR_NUM_DIAGNOSTICS
+ CHECK_CLANG_RESOURCE_DIR_COMPILE_RESULT
+ ${CMAKE_BINARY_DIR}
+ ${checker_code}
+ CMAKE_FLAGS
+ "-DINCLUDE_DIRECTORIES:STRING=${LIBCLANG_INCLUDE_DIRS}"
+ "-DLINK_LIBRARIES:STRING=${LIBCLANG_LIBRARIES}"
+ COMPILE_OUTPUT_VARIABLE compile_output
+ RUN_OUTPUT_VARIABLE run_output
+ ARGS ${run_args}
+ )
+
+ if (NOT CHECK_CLANG_RESOURCE_DIR_COMPILE_RESULT)
+ set(CHECK_CLANG_RESOURCE_DIR_NUM_DIAGNOSTICS 1)
+ endif()
+
+ if (CHECK_CLANG_RESOURCE_DIR_NUM_DIAGNOSTICS EQUAL 0)
+ message(STATUS "Detecting libclang builtin headers directory -- success")
+ if (CHECK_CLANG_RESOURCE_DIR)
+ set(CLANG_RESOURCE_DIR "${CHECK_CLANG_RESOURCE_DIR}"
+ CACHE INTERNAL "Clang resource directory.")
+ endif()
+ else()
+ message(STATUS "Detecting Clang resource directory -- fail")
+
+ if (NOT CHECK_CLANG_RESOURCE_DIR_COMPILE_RESULT)
+ message(WARNING "CheckClangResourceDir: failed to compile checker, please report.
+ Compile output:
+ ${compile_output}
+")
+ else()
+ message(WARNING "CheckClangResourceDir: unsupported configuration, please report.
+
+ Check with args: ${run_args}
+ Check output:
+ ${run_output}
+")
+ endif()
+ endif()
+endfunction()
diff --git a/elpa/irony-20220110.849/server/cmake/LibClangDiagnosticsChecker.cpp b/elpa/irony-20220110.849/server/cmake/LibClangDiagnosticsChecker.cpp
new file mode 100644
index 0000000..64ea7aa
--- /dev/null
+++ b/elpa/irony-20220110.849/server/cmake/LibClangDiagnosticsChecker.cpp
@@ -0,0 +1,47 @@
+/*
+ This program takes some forward its command line arguments to libclang and
+ returns the number of diagnostics that occured during the parsing.
+
+ It is used during CMake generation to adjust the default parameters to
+ libclang.
+*/
+
+#include <clang-c/Index.h>
+
+#include <stdio.h>
+
+int main(int argc, const char *argv[]) {
+ for (int i = 1; i < argc; ++i) {
+ fprintf(stdout, "argv[%d]: %s\n", i, argv[i]);
+ }
+
+ CXIndex Idx = clang_createIndex(0, 0);
+ CXTranslationUnit TU = clang_parseTranslationUnit(
+ Idx, NULL, &argv[1], argc - 1, 0, 0, CXTranslationUnit_None);
+ int NumDiagnostics;
+
+ if (TU == NULL) {
+ NumDiagnostics = 1;
+ fprintf(stderr, "failed to create translation unit!\n");
+ } else {
+ int i;
+
+ NumDiagnostics = clang_getNumDiagnostics(TU);
+
+ for (i = 0; i < NumDiagnostics; ++i) {
+ CXDiagnostic Diag = clang_getDiagnostic(TU, i);
+ CXString DiagStr =
+ clang_formatDiagnostic(Diag, clang_defaultDiagnosticDisplayOptions());
+
+ fprintf(stderr, "%s\n", clang_getCString(DiagStr));
+
+ clang_disposeString(DiagStr);
+ clang_disposeDiagnostic(Diag);
+ }
+
+ clang_disposeTranslationUnit(TU);
+ }
+
+ clang_disposeIndex(Idx);
+ return NumDiagnostics;
+}
diff --git a/elpa/irony-20220110.849/server/cmake/modules/FindLibClang.cmake b/elpa/irony-20220110.849/server/cmake/modules/FindLibClang.cmake
new file mode 100644
index 0000000..edc786d
--- /dev/null
+++ b/elpa/irony-20220110.849/server/cmake/modules/FindLibClang.cmake
@@ -0,0 +1,106 @@
+# Find libclang.
+#
+# This module defines the following variables:
+# LIBCLANG_FOUND - true if libclang has been found and can be used
+# LIBCLANG_KNOWN_LLVM_VERSIONS - known LLVM release numbers
+# LIBCLANG_INCLUDE_DIRS - the libclang include directories
+# LIBCLANG_LIBRARIES - the libraries needed to use libclang
+# LIBCLANG_LIBRARY_DIR - the path to the directory containing libclang
+#
+# This module defines the following IMPORTED target:
+# - irony_libclang
+
+# most recent versions come first
+# http://llvm.org/apt/
+set(LIBCLANG_KNOWN_LLVM_VERSIONS 9.0.0 9.0 9
+ 8.0.0 8.0 8
+ 7.0.1 7.0.0 7.0 7
+ 6.0.1 6.0.0 6.0 6
+ 5.0.2 5.0.1 5.0.0 5.0 5
+ 4.0.1 4.0.0 4.0 4
+ 3.9.1 3.9.0 3.9
+ 3.8.1 3.8.0 3.8
+ 3.7.1 3.7.0 3.7
+ 3.6.2 3.6.1 3.6.0 3.6
+ 3.5.2 3.5.1 3.5.0 3.5
+ 3.4.2 3.4.1 3.4
+ 3.3
+ 3.2
+ 3.1)
+
+set(libclang_llvm_header_search_paths)
+set(libclang_llvm_lib_search_paths
+ # LLVM Fedora
+ /usr/lib/llvm
+ )
+
+foreach (version ${LIBCLANG_KNOWN_LLVM_VERSIONS})
+ string(REPLACE "." "" undotted_version "${version}")
+ list(APPEND libclang_llvm_header_search_paths
+ # LLVM Debian/Ubuntu nightly packages: http://llvm.org/apt/
+ "/usr/lib/llvm-${version}/include/"
+ # LLVM MacPorts
+ "/opt/local/libexec/llvm-${version}/include"
+ # LLVM Homebrew
+ "/usr/local/Cellar/llvm/${version}/include"
+ # LLVM Homebrew/versions
+ "/usr/local/lib/llvm-${version}/include"
+ # FreeBSD ports versions
+ "/usr/local/llvm${undotted_version}/include"
+ # Gentoo clang-4
+ "/usr/lib/llvm/${version}/include"
+ )
+
+ list(APPEND libclang_llvm_lib_search_paths
+ # LLVM Debian/Ubuntu nightly packages: http://llvm.org/apt/
+ "/usr/lib/llvm-${version}/lib/"
+ # LLVM MacPorts
+ "/opt/local/libexec/llvm-${version}/lib"
+ # LLVM Homebrew
+ "/usr/local/Cellar/llvm/${version}/lib"
+ # LLVM Homebrew/versions
+ "/usr/local/lib/llvm-${version}/lib"
+ # FreeBSD ports versions
+ "/usr/local/llvm${undotted_version}/lib"
+ # Gentoo clang-4
+ "/usr/lib/llvm/${version}/lib"
+ )
+endforeach()
+
+find_path(LIBCLANG_INCLUDE_DIR clang-c/Index.h
+ PATHS ${libclang_llvm_header_search_paths}
+ PATH_SUFFIXES LLVM/include #Windows package from http://llvm.org/releases/
+ DOC "The path to the directory that contains clang-c/Index.h")
+
+find_library(LIBCLANG_LIBRARY
+ NAMES
+ # On Windows with MSVC, the import library uses the ".imp" file extension
+ # instead of the comon ".lib"
+ libclang.imp
+ libclang
+ clang
+ PATHS ${libclang_llvm_lib_search_paths}
+ PATH_SUFFIXES LLVM/lib #Windows package from http://llvm.org/releases/
+ DOC "The file that corresponds to the libclang library.")
+
+get_filename_component(LIBCLANG_LIBRARY_DIR ${LIBCLANG_LIBRARY} PATH)
+
+set(LIBCLANG_LIBRARIES ${LIBCLANG_LIBRARY})
+set(LIBCLANG_INCLUDE_DIRS ${LIBCLANG_INCLUDE_DIR})
+
+include(FindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set LIBCLANG_FOUND to TRUE if
+# all listed variables are TRUE
+find_package_handle_standard_args(LibClang DEFAULT_MSG
+ LIBCLANG_LIBRARY LIBCLANG_INCLUDE_DIR)
+
+mark_as_advanced(LIBCLANG_INCLUDE_DIR LIBCLANG_LIBRARY)
+
+if (LIBCLANG_FOUND AND NOT TARGET irony_libclang)
+ add_library(irony_libclang UNKNOWN IMPORTED)
+ set_target_properties(irony_libclang PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ IMPORTED_LOCATION "${LIBCLANG_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${LIBCLANG_INCLUDE_DIR}"
+ )
+endif()
diff --git a/elpa/irony-20220110.849/server/src/CMakeLists.txt b/elpa/irony-20220110.849/server/src/CMakeLists.txt
new file mode 100644
index 0000000..c516e70
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/CMakeLists.txt
@@ -0,0 +1,111 @@
+# XXX: if there are issues
+# due to https://reviews.llvm.org/D30911 / SVN Revision 298424
+# then use the fallback when LLVM_VERSION VERSION_LESS 5.0.1
+find_package(Clang)
+
+if (Clang_FOUND)
+ # XXX: at least since Clang 8.0.0
+ # it's looks like the 'libclang' IMPORTED target
+ # does not specify the following target property:
+ # INTERFACE_INCLUDE_DIRECTORIES ${CLANG_INCLUDE_DIRS}
+ # which is confirmed by https://github.com/Sarcasm/irony-mode/issues/530
+ # so we work around this,
+ # but ideally Clang upstream should export fully usable IMPORTED targets
+ add_library(irony_libclang INTERFACE)
+ target_link_libraries(irony_libclang INTERFACE libclang)
+ target_include_directories(irony_libclang INTERFACE ${CLANG_INCLUDE_DIRS})
+
+ get_property(IRONY_CLANG_EXECUTABLE TARGET clang PROPERTY LOCATION)
+ execute_process(
+ COMMAND "${IRONY_CLANG_EXECUTABLE}" -print-resource-dir
+ OUTPUT_VARIABLE CLANG_RESOURCE_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+else()
+ # fallback to historically FindLibClang.cmake
+ # and -resource-dir guess mecanism
+ include(CheckClangResourceDir)
+ find_package(LibClang REQUIRED)
+ check_clang_resource_dir()
+endif()
+
+# not to be taken as a module-definition file to link on Windows
+set_source_files_properties(Commands.def PROPERTIES HEADER_FILE_ONLY TRUE)
+
+if(MSVC)
+ # irony-server uses some code that breaks when iterator debugging is enabled
+ #
+ # The culprit is CommandLineArgumentParser who initialize its member
+ # 'Position', of type 'std::string::const_iterator', to 'Input.begin() - 1'.
+ # With checked iterator the begin() - 1 breaks in debug build.
+ add_definitions(/D_ITERATOR_DEBUG_LEVEL=0)
+endif()
+
+add_executable(irony-server
+ support/CommandLineParser.cpp
+ support/CommandLineParser.h
+ support/iomanip_quoted.h
+ support/NonCopyable.h
+ support/CIndex.h
+ support/TemporaryFile.cpp
+ support/TemporaryFile.h
+
+ Command.cpp
+ Commands.def
+ Command.h
+ CompDBCache.h
+ CompDBCache.cpp
+ Irony.cpp
+ Irony.h
+ TUManager.cpp
+ TUManager.h
+
+ main.cpp)
+
+irony_target_set_cxx_standard(irony-server)
+
+target_include_directories(irony-server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+
+# retrieve the package version from irony.el
+function(irony_find_package_version OUTPUT_VAR)
+ # this is a hack that force CMake to reconfigure, it is necessary to see if
+ # the version in irony.el has changed, this is not possible to add the
+ # definitions at build time
+ configure_file(${PROJECT_SOURCE_DIR}/../irony.el
+ ${CMAKE_CURRENT_BINARY_DIR}/irony.el
+ COPYONLY)
+
+ set(version_header "\;\; Version: ")
+ file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/irony.el version
+ LIMIT_COUNT 1
+ REGEX "^${version_header}*")
+
+ if (NOT version)
+ message (FATAL_ERROR "couldn't find irony.el's version header!")
+ endif()
+
+ string(LENGTH ${version_header} version_header_length)
+ string(SUBSTRING ${version} ${version_header_length} -1 package_version)
+ set(${OUTPUT_VAR} ${package_version} PARENT_SCOPE)
+endfunction()
+
+irony_find_package_version(IRONY_PACKAGE_VERSION)
+message(STATUS "Irony package version is '${IRONY_PACKAGE_VERSION}'")
+
+set_source_files_properties(main.cpp
+ PROPERTIES
+ COMPILE_DEFINITIONS IRONY_PACKAGE_VERSION=\"${IRONY_PACKAGE_VERSION}\")
+
+if (CLANG_RESOURCE_DIR)
+ # look for CLANG_RESOURCE_DIR_DIR usage in the code for an explanation
+ set_source_files_properties(TUManager.cpp
+ PROPERTIES
+ COMPILE_DEFINITIONS CLANG_RESOURCE_DIR=\"${CLANG_RESOURCE_DIR}\")
+endif()
+
+target_link_libraries(irony-server irony_libclang)
+
+set_target_properties(irony-server
+ PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
+
+install(TARGETS irony-server DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/elpa/irony-20220110.849/server/src/Command.cpp b/elpa/irony-20220110.849/server/src/Command.cpp
new file mode 100644
index 0000000..363b6cb
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/Command.cpp
@@ -0,0 +1,278 @@
+/**
+ * \file
+ * \author Guillaume Papin <guillaume.papin@epitech.eu>
+ *
+ * \brief Command parser definitions.
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+
+#include "Command.h"
+
+#include "support/CommandLineParser.h"
+
+#include <algorithm>
+#include <cstdlib>
+#include <functional>
+#include <iostream>
+#include <limits>
+#include <map>
+
+
+namespace {
+
+struct StringConverter {
+ StringConverter(std::string *dest) : dest_(dest) {
+ }
+
+ bool operator()(const std::string &str) {
+ *dest_ = str;
+ return true;
+ }
+
+private:
+ std::string *dest_;
+};
+
+struct UnsignedIntConverter {
+ UnsignedIntConverter(unsigned *dest) : dest_(dest) {
+ }
+
+ bool operator()(const std::string &str) {
+ char *end;
+ long num = std::strtol(str.c_str(), &end, 10);
+
+ if (end != (str.c_str() + str.size()))
+ return false;
+
+ if (errno == ERANGE)
+ return false;
+
+ if (num < 0)
+ return false;
+
+ unsigned long unum = static_cast<unsigned long>(num);
+ if (unum > std::numeric_limits<unsigned>::max())
+ return false;
+
+ *dest_ = unum;
+ return true;
+ }
+
+private:
+ unsigned *dest_;
+};
+
+/// Convert "on" and "off" to a boolean
+struct OptionConverter {
+ OptionConverter(bool *dest) : dest_(dest) {
+ }
+
+ bool operator()(const std::string &str) {
+ if (str == "on") {
+ *dest_ = true;
+ } else if (str == "off") {
+ *dest_ = false;
+ } else {
+ return false;
+ }
+ return true;
+ }
+
+private:
+ bool *dest_;
+};
+
+const std::map<std::string, PrefixMatchStyle> PREFIX_MATCH_STYLE_MAP = {
+ { "exact", PrefixMatchStyle::Exact },
+ { "case-insensitive", PrefixMatchStyle::CaseInsensitive },
+ { "smart-case", PrefixMatchStyle::SmartCase},
+};
+
+/// Convert style to a PrefixMatchStyle
+struct PrefixMatchStyleConverter {
+ PrefixMatchStyleConverter(PrefixMatchStyle *dest) : dest_(dest) {
+ }
+
+ bool operator()(const std::string &str) {
+ auto res = PREFIX_MATCH_STYLE_MAP.find(str);
+
+ if (res == PREFIX_MATCH_STYLE_MAP.cend()) {
+ return false;
+ }
+ *dest_ = res->second;
+ return true;
+ }
+
+private:
+ PrefixMatchStyle *dest_;
+};
+
+std::ostream &operator<<(std::ostream &os, PrefixMatchStyle style) {
+ for (auto it : PREFIX_MATCH_STYLE_MAP) {
+ if (it.second == style) {
+ os << it.first;
+ return os;
+ }
+ }
+ os << "UnknownStyle";
+ return os;
+}
+
+
+} // unnamed namespace
+
+std::ostream &operator<<(std::ostream &os, const Command::Action &action) {
+ os << "Command::";
+
+ switch (action) {
+#define X(sym, str, help) \
+ case Command::sym: \
+ os << #sym; \
+ break;
+#include "Commands.def"
+ }
+ return os;
+}
+
+std::ostream &operator<<(std::ostream &os, const Command &command) {
+ os << "Command{action=" << command.action << ", "
+ << "file='" << command.file << "', "
+ << "unsavedFile='" << command.unsavedFile << "', "
+ << "dir='" << command.dir << "', "
+ << "line=" << command.line << ", "
+ << "column=" << command.column << ", "
+ << "prefix='" << command.prefix << "', "
+ << "caseStyle='" << command.style << "', "
+ << "flags=[";
+ bool first = true;
+ for (const std::string &flag : command.flags) {
+ if (!first)
+ os << ", ";
+ os << "'" << flag << "'";
+ first = false;
+ }
+ os << "], "
+ << "opt=" << (command.opt ? "on" : "off");
+
+ return os << "}";
+}
+
+static Command::Action actionFromString(const std::string &actionStr) {
+#define X(sym, str, help) \
+ if (actionStr == str) \
+ return Command::sym;
+
+#include "Commands.def"
+
+ return Command::Unknown;
+}
+
+CommandParser::CommandParser() : tempFile_("irony-server") {
+}
+
+Command *CommandParser::parse(const std::vector<std::string> &argv) {
+ command_.clear();
+
+ if (argv.begin() == argv.end()) {
+ std::clog << "error: no command specified.\n"
+ "See 'irony-server help' to list available commands\n";
+ return 0;
+ }
+
+ const std::string &actionStr = argv[0];
+
+ command_.action = actionFromString(actionStr);
+
+ bool readCompileOptions = false;
+ std::vector<std::function<bool(const std::string &)>> positionalArgs;
+
+ switch (command_.action) {
+ case Command::SetDebug:
+ positionalArgs.push_back(OptionConverter(&command_.opt));
+ break;
+
+ case Command::Parse:
+ positionalArgs.push_back(StringConverter(&command_.file));
+ readCompileOptions = true;
+ break;
+
+ case Command::Complete:
+ positionalArgs.push_back(StringConverter(&command_.file));
+ positionalArgs.push_back(UnsignedIntConverter(&command_.line));
+ positionalArgs.push_back(UnsignedIntConverter(&command_.column));
+ readCompileOptions = true;
+ break;
+
+ case Command::GetType:
+ positionalArgs.push_back(UnsignedIntConverter(&command_.line));
+ positionalArgs.push_back(UnsignedIntConverter(&command_.column));
+ break;
+
+ case Command::SetUnsaved:
+ positionalArgs.push_back(StringConverter(&command_.file));
+ positionalArgs.push_back(StringConverter(&command_.unsavedFile));
+ break;
+
+ case Command::ResetUnsaved:
+ positionalArgs.push_back(StringConverter(&command_.file));
+ break;
+
+ case Command::Candidates:
+ positionalArgs.push_back(StringConverter(&command_.prefix));
+ positionalArgs.push_back(PrefixMatchStyleConverter(&command_.style));
+ break;
+ case Command::CompletionDiagnostics:
+ case Command::Diagnostics:
+ case Command::Help:
+ case Command::Exit:
+ // no-arguments commands
+ break;
+
+ case Command::GetCompileOptions:
+ positionalArgs.push_back(StringConverter(&command_.dir));
+ positionalArgs.push_back(StringConverter(&command_.file));
+ break;
+
+ case Command::Unknown:
+ std::clog << "error: invalid command specified: " << actionStr << "\n";
+ return 0;
+ }
+
+ auto argsBegin = argv.begin() + 1;
+ const auto argsEnd = std::find(argsBegin, argv.end(), "--");
+ const int argCount = std::distance(argsBegin, argsEnd);
+
+ // compile options are provided after '--'
+ if (readCompileOptions && argsEnd != argv.end()) {
+ command_.flags.assign(std::next(argsEnd), argv.end());
+ }
+
+ if (argCount != static_cast<int>(positionalArgs.size())) {
+ std::clog << "error: invalid number of arguments for '" << actionStr
+ << "' (requires " << positionalArgs.size() << " got " << argCount
+ << ")\n";
+ return 0;
+ }
+
+ for (auto fn : positionalArgs) {
+ if (!fn(*argsBegin)) {
+ std::clog << "error: parsing command '" << actionStr
+ << "': invalid argument '" << *argsBegin << "'\n";
+ return 0;
+ }
+ ++argsBegin;
+ }
+
+ // '-' is used as a special file to inform that the buffer hasn't been saved
+ // on disk and only the buffer content is available. libclang needs a file, so
+ // this is treated as a special value for irony-server to create a temporary
+ // file for this. note that libclang will gladly accept '-' as a filename but
+ // we don't want to let this happen since irony already reads stdin.
+ if (command_.file == "-") {
+ command_.file = tempFile_.getPath();
+ }
+
+ return &command_;
+}
diff --git a/elpa/irony-20220110.849/server/src/Command.h b/elpa/irony-20220110.849/server/src/Command.h
new file mode 100644
index 0000000..9f36aa4
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/Command.h
@@ -0,0 +1,73 @@
+/**-*-C++-*-
+ * \file
+ * \author Guillaume Papin <guillaume.papin@epitech.eu>
+ *
+ * \brief Command parser declarations.
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+
+#ifndef IRONY_MODE_SERVER_COMMAND_H_
+#define IRONY_MODE_SERVER_COMMAND_H_
+
+#include "support/CIndex.h"
+#include "support/TemporaryFile.h"
+#include "Style.h"
+
+#include <iosfwd>
+#include <string>
+#include <vector>
+
+class TemporaryFile;
+
+// TODO: a tagged union?
+struct Command {
+ Command() {
+ clear();
+ }
+
+ void clear() {
+ action = Unknown;
+ flags.clear();
+ file.clear();
+ unsavedFile.clear();
+ dir.clear();
+ prefix.clear();
+ style = PrefixMatchStyle::Exact;
+ line = 0;
+ column = 0;
+ opt = false;
+ }
+
+#define X(sym, str, desc) sym,
+ enum Action {
+#include "Commands.def"
+ } action;
+
+ std::vector<std::string> flags;
+ std::string file;
+ std::string unsavedFile;
+ std::string dir;
+ std::string prefix;
+ PrefixMatchStyle style;
+ unsigned line;
+ unsigned column;
+ bool opt;
+};
+
+std::ostream &operator<<(std::ostream &os, const Command::Action &action);
+std::ostream &operator<<(std::ostream &os, const Command &command);
+
+class CommandParser {
+public:
+ CommandParser();
+
+ Command *parse(const std::vector<std::string> &argv);
+
+private:
+ Command command_;
+ TemporaryFile tempFile_;
+};
+
+#endif // IRONY_MODE_SERVER_COMMAND_H_
diff --git a/elpa/irony-20220110.849/server/src/Commands.def b/elpa/irony-20220110.849/server/src/Commands.def
new file mode 100644
index 0000000..f99d8af
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/Commands.def
@@ -0,0 +1,39 @@
+/**-*-C++-*-
+ * \file
+ * \author Guillaume Papin <guillaume.papin@epitech.eu>
+ *
+ * \brief Command list.
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+
+#ifndef X
+#error Please define the 'X(id, command, description)' macro before inclusion!
+#endif
+
+X(Candidates, "candidates",
+ "PREFIX STYLE - print completion candidates (require previous complete). "
+ "STYLE is \"exact\", \"case-insensitive\" or \"smart-case\"")
+X(Complete, "complete",
+ "FILE LINE COL [-- [COMPILE_OPTIONS...]] - perform code completion at a given location")
+X(CompletionDiagnostics, "completion-diagnostics",
+ "print the diagnostics generated during complete")
+X(Diagnostics, "diagnostics", "print the diagnostics of the last parse")
+X(Exit, "exit", "exit interactive mode, print nothing")
+X(GetCompileOptions, "get-compile-options", "BUILD_DIR FILE - "
+ "get compile options for FILE from JSON database in BUILD_DIR")
+X(GetType, "get-type", "LINE COL - get type of symbol at a given location")
+X(Help, "help", "show this message")
+X(Parse, "parse", "FILE [-- [COMPILE_OPTIONS...]] - parse the given file")
+X(ResetUnsaved, "reset-unsaved", "FILE - reset FILE, its content is up to date")
+X(SetDebug, "set-debug", "ON|OFF - enable or disable verbose logging")
+X(SetUnsaved,
+ "set-unsaved",
+ "FILE UNSAVED-CONTENT-FILE - tell irony-server that "
+ "UNSAVED-CONTENT-FILE contains the effective content of FILE")
+
+// sentinel value, should be the last one
+X(Unknown, "<unkown>", "<unspecified>")
+
+#undef X
diff --git a/elpa/irony-20220110.849/server/src/CompDBCache.cpp b/elpa/irony-20220110.849/server/src/CompDBCache.cpp
new file mode 100644
index 0000000..f79ec8c
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/CompDBCache.cpp
@@ -0,0 +1,71 @@
+#include "CompDBCache.h"
+
+#include <sys/stat.h>
+
+#include <cassert>
+
+CompDBCache::CompDBCache()
+ : db_(nullptr), mtime_(0) {
+}
+
+CompDBCache::~CompDBCache() {
+ clear();
+}
+
+CXCompilationDatabase CompDBCache::fromDirectory(const std::string &buildDir,
+ CXCompilationDatabase_Error *error) {
+ assert(error != nullptr);
+
+ const std::string jsonFilename = constructJsonDbFilename(buildDir);
+ const time_t mtime = modificationTime(jsonFilename);
+
+ if (jsonFilename == filename_ && mtime != 0 && mtime == mtime_) {
+ // Using the cached compilation database.
+ // Just set the provided error code to indicate success.
+ *error = CXCompilationDatabase_NoError;
+ } else {
+ clear();
+
+ db_ = clang_CompilationDatabase_fromDirectory(buildDir.c_str(), error);
+
+ if (mtime != 0 && *error == CXCompilationDatabase_NoError) {
+ // Successfully loaded a JSON compilation database.
+ // Cache the result.
+ filename_ = jsonFilename;
+ mtime_ = mtime;
+ }
+ }
+
+ return db_;
+}
+
+void CompDBCache::clear() {
+ if (db_) {
+ clang_CompilationDatabase_dispose(db_);
+ db_ = nullptr;
+ filename_.clear();
+ mtime_ = 0;
+ }
+}
+
+std::string CompDBCache::constructJsonDbFilename(const std::string &buildDir) const {
+ std::string ret = buildDir;
+ if (!buildDir.empty() && buildDir.back() != '/')
+ ret += '/';
+ ret += "compile_commands.json";
+ return ret;
+}
+
+time_t CompDBCache::modificationTime(const std::string &filename) const {
+ time_t mtime = 0;
+#ifdef _WIN32
+ struct _stat st;
+ const int statRes = _stat(filename.c_str(), &st);
+#else
+ struct stat st;
+ const int statRes = stat(filename.c_str(), &st);
+#endif
+ if (statRes == 0)
+ mtime = st.st_mtime;
+ return mtime;
+}
diff --git a/elpa/irony-20220110.849/server/src/CompDBCache.h b/elpa/irony-20220110.849/server/src/CompDBCache.h
new file mode 100644
index 0000000..568b790
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/CompDBCache.h
@@ -0,0 +1,86 @@
+/**-*-C++-*-
+ * \file
+ * \author Idar Tollefsen <idart@hotmail.com>
+ *
+ * \brief Creates a compilation database and caches it.
+ *
+ * Keeps a cache of the loaded compilation database, only creating a new
+ * one when needed.
+ *
+ * This file is distributed under the GNU General Public License.
+ * See COPYING for details.
+ */
+
+#ifndef IRONY_MODE_COMPDBCACHE_H_
+#define IRONY_MODE_COMPDBCACHE_H_
+
+#include "support/CIndex.h"
+#include "support/NonCopyable.h"
+
+#include <ctime>
+#include <string>
+
+class CompDBCache : public util::NonCopyable {
+public:
+ CompDBCache();
+ ~CompDBCache();
+
+ /**
+ * \brief Get a compilation database from a database found in a directory.
+ *
+ * This in essence a wrapper around
+ * \c clang_CompilationDatabase_fromDirectory() with added caching.
+ * It will either create a new compilation database or return the
+ * already loaded one (if any).
+ *
+ * This class owns the resulting compilation database.
+ * Therefore, unlike \c clang_CompilationDatabase_fromDirectory(),
+ * callers must NOT call \c clang_CompilationDatabase_dispose() on the
+ * returned compilation database. This class will handle that internally.
+ *
+ * \param buildDir Directory containing the database (such as
+ * "compile_commands.json") to create a compilation
+ * database from.
+ * \param error Error code from attempting to create a compilation
+ * database (\c CXCompilationDatabase_NoError on success).
+ *
+ * \return The compilation database or nullptr.
+ */
+ CXCompilationDatabase fromDirectory(const std::string &buildDir,
+ CXCompilationDatabase_Error *error);
+
+private:
+ /**
+ * \brief Clear the cache.
+ *
+ * This will dispose the currently loaded compilation database (if any) by
+ * calling \c clang_CompilationDatabase_dispose() on it. And it will reset
+ * other internal housekeeping variables related to the caching of the
+ * compilation database.
+ */
+ void clear();
+
+ /**
+ * \brief Construct JSON compilation database filename.
+ *
+ * \param buildDir Directory that might contain "compile_commands.json".
+ *
+ * \return Path to "compilation_commands.json" in \c buildDir.
+ */
+ std::string constructJsonDbFilename(const std::string &buildDir) const;
+
+ /**
+ * \brief Get modification time of a file.
+ *
+ * \param filename The file to get last modification time of.
+ *
+ * \return The modification time of \c filename or 0.
+ */
+ time_t modificationTime(const std::string &filename) const;
+
+ CXCompilationDatabase db_;
+ std::string filename_;
+ time_t mtime_;
+};
+
+#endif
diff --git a/elpa/irony-20220110.849/server/src/Irony.cpp b/elpa/irony-20220110.849/server/src/Irony.cpp
new file mode 100644
index 0000000..2157b32
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/Irony.cpp
@@ -0,0 +1,638 @@
+/**
+ * \file
+ * \author Guillaume Papin <guillaume.papin@epitech.eu>
+ *
+ * \brief irony-server "API" definitions.
+ *
+ * \sa Irony.h for more information.
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+
+#include "Irony.h"
+
+#include "support/iomanip_quoted.h"
+
+#include <algorithm>
+#include <cassert>
+#include <iostream>
+#include <fstream>
+#include <cctype>
+
+namespace {
+
+std::string cxStringToStd(CXString cxString) {
+ std::string stdStr;
+
+ if (const char *cstr = clang_getCString(cxString)) {
+ stdStr = cstr;
+ }
+
+ clang_disposeString(cxString);
+ return stdStr;
+}
+
+const char *diagnosticSeverity(const CXDiagnostic &diagnostic) {
+ switch (clang_getDiagnosticSeverity(diagnostic)) {
+ case CXDiagnostic_Ignored:
+ return "ignored";
+ case CXDiagnostic_Note:
+ return "note";
+ case CXDiagnostic_Warning:
+ return "warning";
+ case CXDiagnostic_Error:
+ return "error";
+ case CXDiagnostic_Fatal:
+ return "fatal";
+ }
+
+ return "unknown";
+}
+
+void dumpDiagnostic(const CXDiagnostic &diagnostic) {
+ std::string file;
+ unsigned line = 0, column = 0, offset = 0;
+ CXSourceLocation location = clang_getDiagnosticLocation(diagnostic);
+ if (!clang_equalLocations(location, clang_getNullLocation())) {
+ CXFile cxFile;
+
+// clang_getInstantiationLocation() has been marked deprecated and
+// is aimed to be replaced by clang_getExpansionLocation().
+#if CINDEX_VERSION >= 6
+ clang_getExpansionLocation(location, &cxFile, &line, &column, &offset);
+#else
+ clang_getInstantiationLocation(location, &cxFile, &line, &column, &offset);
+#endif
+
+ file = cxStringToStd(clang_getFileName(cxFile));
+ }
+
+ const char *severity = diagnosticSeverity(diagnostic);
+
+ std::string message = cxStringToStd(clang_getDiagnosticSpelling(diagnostic));
+
+ std::cout << '(' << support::quoted(file) //
+ << ' ' << line //
+ << ' ' << column //
+ << ' ' << offset //
+ << ' ' << severity //
+ << ' ' << support::quoted(message) //
+ << ")\n";
+}
+
+bool readFileContent(const std::string &filename,
+ Irony::UnsavedBuffer &outBuf) {
+ std::ifstream ifs(filename.c_str(),
+ std::ios::in | std::ios::binary | std::ios::ate);
+
+ if (!ifs.is_open()) {
+ return false;
+ }
+
+ // FIXME: it's possible that this method of reading the file is 100% reliable,
+ // I can't confirm that tellg() is guaranteed to return a byte count.
+ // std::streamoff does not mention 'byte'.
+ // In practice it seems to work but this may be just luck.
+ // See also this discussion:
+ // - http://stackoverflow.com/questions/22984956/tellg-function-give-wrong-size-of-file/22986486#22986486
+ auto nbytes = ifs.tellg();
+
+ if (nbytes == std::ifstream::pos_type(-1)) {
+ return false;
+ }
+
+ outBuf.resize(nbytes);
+ ifs.seekg(0, std::ios::beg);
+
+ ifs.read(&outBuf[0], outBuf.size());
+
+ if (!ifs){
+ outBuf.clear();
+ return false;
+ }
+
+ return true;
+}
+
+} // unnamed namespace
+
+Irony::Irony()
+ : activeTu_(nullptr), activeCompletionResults_(nullptr), debug_(false) {
+}
+
+void Irony::parse(const std::string &file,
+ const std::vector<std::string> &flags) {
+ resetCache();
+ activeTu_ = tuManager_.parse(file, flags, cxUnsavedFiles_);
+ file_ = file;
+
+ if (activeTu_ == nullptr) {
+ std::cout << "(error . ("
+ << "parse-error"
+ << " \"failed to parse file\""
+ << " " << support::quoted(file) << "))\n";
+ return;
+ }
+
+ std::cout << "(success . t)\n";
+}
+
+void Irony::diagnostics() const {
+ unsigned diagnosticCount;
+
+ if (activeTu_ == nullptr) {
+ diagnosticCount = 0;
+ } else {
+ diagnosticCount = clang_getNumDiagnostics(activeTu_);
+ }
+
+ std::cout << "(\n";
+
+ for (unsigned i = 0; i < diagnosticCount; ++i) {
+ CXDiagnostic diagnostic = clang_getDiagnostic(activeTu_, i);
+
+ dumpDiagnostic(diagnostic);
+
+ clang_disposeDiagnostic(diagnostic);
+ }
+
+ std::cout << ")\n";
+}
+
+void Irony::resetCache() {
+ activeTu_ = nullptr;
+
+ if (activeCompletionResults_ != nullptr) {
+ clang_disposeCodeCompleteResults(activeCompletionResults_);
+ activeCompletionResults_ = nullptr;
+ }
+}
+
+void Irony::getType(unsigned line, unsigned col) const {
+ if (activeTu_ == nullptr) {
+ std::clog << "W: get-type - parse wasn't called\n";
+
+ std::cout << "nil\n";
+ return;
+ }
+
+ CXFile cxFile = clang_getFile(activeTu_, file_.c_str());
+ CXSourceLocation sourceLoc = clang_getLocation(activeTu_, cxFile, line, col);
+ CXCursor cursor = clang_getCursor(activeTu_, sourceLoc);
+
+ if (clang_Cursor_isNull(cursor)) {
+ // TODO: "error: no type at point"?
+ std::cout << "nil";
+ return;
+ }
+
+ CXType cxTypes[2];
+ cxTypes[0] = clang_getCursorType(cursor);
+ cxTypes[1] = clang_getCanonicalType(cxTypes[0]);
+
+ std::cout << "(";
+
+ for (const CXType &cxType : cxTypes) {
+ CXString typeDescr = clang_getTypeSpelling(cxType);
+ std::string typeStr = clang_getCString(typeDescr);
+ clang_disposeString(typeDescr);
+
+ if (typeStr.empty())
+ break;
+
+ std::cout << support::quoted(typeStr) << " ";
+ }
+
+ std::cout << ")\n";
+}
+
+namespace {
+
+class CompletionChunk {
+public:
+ explicit CompletionChunk(CXCompletionString completionString)
+ : completionString_(completionString)
+ , numChunks_(clang_getNumCompletionChunks(completionString_))
+ , chunkIdx_(0) {
+ }
+
+ bool hasNext() const {
+ return chunkIdx_ < numChunks_;
+ }
+
+ void next() {
+ if (!hasNext()) {
+ assert(0 && "out of range completion chunk");
+ abort();
+ }
+
+ ++chunkIdx_;
+ }
+
+ CXCompletionChunkKind kind() const {
+ return clang_getCompletionChunkKind(completionString_, chunkIdx_);
+ }
+
+ // TODO: operator>> so that one can re-use string allocated buffer
+ std::string text() const {
+ return cxStringToStd(
+ clang_getCompletionChunkText(completionString_, chunkIdx_));
+ }
+
+private:
+ CXCompletionString completionString_;
+ unsigned int numChunks_;
+ unsigned chunkIdx_;
+};
+
+} // unnamed namespace
+
+void Irony::complete(const std::string &file,
+ unsigned line,
+ unsigned col,
+ const std::vector<std::string> &flags) {
+ resetCache();
+
+ if (CXTranslationUnit tu =
+ tuManager_.getOrCreateTU(file, flags, cxUnsavedFiles_)) {
+ activeCompletionResults_ =
+ clang_codeCompleteAt(tu,
+ file.c_str(),
+ line,
+ col,
+ const_cast<CXUnsavedFile *>(cxUnsavedFiles_.data()),
+ cxUnsavedFiles_.size(),
+ (clang_defaultCodeCompleteOptions() &
+ ~CXCodeComplete_IncludeCodePatterns)
+#if HAS_BRIEF_COMMENTS_IN_COMPLETION
+ |
+ CXCodeComplete_IncludeBriefComments
+#endif
+ );
+ }
+
+ if (activeCompletionResults_ == nullptr) {
+ std::cout << "(error . ("
+ << "complete-error"
+ << " \"failed to perform code completion\""
+ << " " << support::quoted(file) << " " << line << " " << col
+ << "))\n";
+ return;
+ }
+
+ clang_sortCodeCompletionResults(activeCompletionResults_->Results,
+ activeCompletionResults_->NumResults);
+
+ std::cout << "(success . t)\n";
+}
+
+namespace {
+
+bool hasUppercase(const std::string &prefix)
+{
+ for (char c : prefix) {
+ if (std::isupper(c)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool isEqual(const bool insensitive, const char a, const char b)
+{
+ if (insensitive) {
+ return std::tolower(a) == std::tolower(b);
+ } else {
+ return a == b;
+ }
+}
+
+bool startsWith(const std::string& str, const std::string &prefix, bool caseInsensitive)
+{
+ if (str.length() < prefix.length()) {
+ return false;
+ }
+
+ const auto charCmp = [&](const char a, const char b) {
+ return isEqual(caseInsensitive, a, b);
+ };
+
+ auto res = std::mismatch(prefix.begin(), prefix.end(), str.begin(), charCmp);
+ return res.first == prefix.end();
+}
+
+bool isStyleCaseInsensitive(const std::string &prefix, PrefixMatchStyle style)
+{
+ if (style == PrefixMatchStyle::SmartCase) {
+ // For SmartCase style, do case insensitive matching only there isn't upper
+ // case letter.
+ if (!hasUppercase(prefix)) {
+ style = PrefixMatchStyle::CaseInsensitive;
+ }
+ }
+ return style == PrefixMatchStyle::CaseInsensitive;
+}
+
+} // unnamed namespace
+
+void Irony::completionDiagnostics() const {
+ unsigned diagnosticCount;
+
+ if (activeCompletionResults_ == nullptr) {
+ diagnosticCount = 0;
+ } else {
+ diagnosticCount =
+ clang_codeCompleteGetNumDiagnostics(activeCompletionResults_);
+ }
+
+ std::cout << "(\n";
+
+ for (unsigned i = 0; i < diagnosticCount; ++i) {
+ CXDiagnostic diagnostic =
+ clang_codeCompleteGetDiagnostic(activeCompletionResults_, i);
+
+ dumpDiagnostic(diagnostic);
+ clang_disposeDiagnostic(diagnostic);
+ }
+
+ std::cout << ")\n";
+}
+
+void Irony::candidates(const std::string &prefix, PrefixMatchStyle style) const {
+ if (activeCompletionResults_ == nullptr) {
+ std::cout << "nil\n";
+ return;
+ }
+
+ bool caseInsensitive = isStyleCaseInsensitive(prefix, style);
+
+ CXCodeCompleteResults *completions = activeCompletionResults_;
+
+ std::cout << "(\n";
+
+ // re-use the same buffers to avoid unnecessary allocations
+ std::string typedtext, brief, resultType, prototype, postCompCar;
+
+ std::vector<unsigned> postCompCdr;
+
+ for (unsigned i = 0; i < completions->NumResults; ++i) {
+ CXCompletionResult candidate = completions->Results[i];
+ CXAvailabilityKind availability =
+ clang_getCompletionAvailability(candidate.CompletionString);
+
+ unsigned priority =
+ clang_getCompletionPriority(candidate.CompletionString);
+ unsigned annotationStart = 0;
+ bool typedTextSet = false;
+ bool hasPrefix = true;
+
+
+ if (availability == CXAvailability_NotAccessible ||
+ availability == CXAvailability_NotAvailable) {
+ continue;
+ }
+
+ typedtext.clear();
+ brief.clear();
+ resultType.clear();
+ prototype.clear();
+ postCompCar.clear();
+ postCompCdr.clear();
+
+ for (CompletionChunk chunk(candidate.CompletionString); chunk.hasNext();
+ chunk.next()) {
+ char ch = 0;
+
+ auto chunkKind = chunk.kind();
+
+ switch (chunkKind) {
+ case CXCompletionChunk_ResultType:
+ resultType = chunk.text();
+ break;
+
+ case CXCompletionChunk_TypedText:
+ case CXCompletionChunk_Text:
+ case CXCompletionChunk_Placeholder:
+ case CXCompletionChunk_Informative:
+ case CXCompletionChunk_CurrentParameter:
+ prototype += chunk.text();
+ break;
+
+ case CXCompletionChunk_LeftParen: ch = '('; break;
+ case CXCompletionChunk_RightParen: ch = ')'; break;
+ case CXCompletionChunk_LeftBracket: ch = '['; break;
+ case CXCompletionChunk_RightBracket: ch = ']'; break;
+ case CXCompletionChunk_LeftBrace: ch = '{'; break;
+ case CXCompletionChunk_RightBrace: ch = '}'; break;
+ case CXCompletionChunk_LeftAngle: ch = '<'; break;
+ case CXCompletionChunk_RightAngle: ch = '>'; break;
+ case CXCompletionChunk_Comma: ch = ','; break;
+ case CXCompletionChunk_Colon: ch = ':'; break;
+ case CXCompletionChunk_SemiColon: ch = ';'; break;
+ case CXCompletionChunk_Equal: ch = '='; break;
+ case CXCompletionChunk_HorizontalSpace: ch = ' '; break;
+ case CXCompletionChunk_VerticalSpace: ch = '\n'; break;
+
+ case CXCompletionChunk_Optional:
+ // ignored for now
+ break;
+ }
+
+ if (ch != 0) {
+ prototype += ch;
+ // commas look better followed by a space
+ if (ch == ',') {
+ prototype += ' ';
+ }
+ }
+
+ if (typedTextSet) {
+ if (ch != 0) {
+ postCompCar += ch;
+ if (ch == ',') {
+ postCompCar += ' ';
+ }
+ } else if (chunkKind == CXCompletionChunk_Text ||
+ chunkKind == CXCompletionChunk_TypedText) {
+ postCompCar += chunk.text();
+ } else if (chunkKind == CXCompletionChunk_Placeholder ||
+ chunkKind == CXCompletionChunk_CurrentParameter) {
+ postCompCdr.push_back(postCompCar.size());
+ postCompCar += chunk.text();
+ postCompCdr.push_back(postCompCar.size());
+ }
+ }
+
+ // Consider only the first typed text. The CXCompletionChunk_TypedText
+ // doc suggests that exactly one typed text will be given but at least
+ // in Objective-C it seems that more than one can appear, see:
+ // https://github.com/Sarcasm/irony-mode/pull/78#issuecomment-37115538
+ if (chunkKind == CXCompletionChunk_TypedText && !typedTextSet) {
+ typedtext = chunk.text();
+ if (!startsWith(typedtext, prefix, caseInsensitive)) {
+ hasPrefix = false;
+ break;
+ }
+ // annotation is what comes after the typedtext
+ annotationStart = prototype.size();
+ typedTextSet = true;
+ }
+ }
+
+ if (!hasPrefix) {
+ continue;
+ }
+ if (!typedTextSet) {
+ // clang may generate candidates without any typedText, and we may
+ // generate some output like:
+ // ("" 1 "bool" "" "hasUppercase(const std::string &prefix)"
+ // 0 ("") available)
+ // That will cause infinite completion in irony.el
+ continue;
+ }
+
+#if HAS_BRIEF_COMMENTS_IN_COMPLETION
+ brief = cxStringToStd(
+ clang_getCompletionBriefComment(candidate.CompletionString));
+#endif
+
+ // see irony-completion.el#irony-completion-candidates
+ std::cout << '(' << support::quoted(typedtext)
+ << ' ' << priority
+ << ' ' << support::quoted(resultType)
+ << ' ' << support::quoted(brief)
+ << ' ' << support::quoted(prototype)
+ << ' ' << annotationStart
+ << " (" << support::quoted(postCompCar);
+ for (unsigned index : postCompCdr)
+ std::cout << ' ' << index;
+ std::cout << ")"
+ << ")\n";
+ }
+
+ std::cout << ")\n";
+}
+
+void Irony::computeCxUnsaved() {
+ cxUnsavedFiles_.clear();
+
+ for (const auto &p : filenameToContent_) {
+ CXUnsavedFile cxUnsavedFile;
+
+ cxUnsavedFile.Filename = p.first.c_str();
+ cxUnsavedFile.Contents = p.second.data();
+ cxUnsavedFile.Length = p.second.size();
+ cxUnsavedFiles_.push_back(cxUnsavedFile);
+ }
+}
+
+void Irony::setUnsaved(const std::string &file,
+ const std::string &unsavedContentFile) {
+ resetCache();
+
+ UnsavedBuffer content;
+ if (!readFileContent(unsavedContentFile, content)) {
+ filenameToContent_.erase(file);
+ std::cout << "(error . ("
+ << "file-read-error"
+ << " \"failed to read unsaved buffer\""
+ << " " << support::quoted(file) << " "
+ << support::quoted(unsavedContentFile) << ")\n";
+ } else {
+ filenameToContent_[file] = content;
+ std::cout << "(success . t)\n";
+ }
+
+ computeCxUnsaved();
+}
+
+void Irony::resetUnsaved(const std::string &file) {
+ resetCache();
+
+ const auto erasedCount = filenameToContent_.erase(file);
+
+ if (erasedCount == 0) {
+ std::cout << "(error . ("
+ << "no-such-entry"
+ << " \"failed reset unsaved buffer\""
+ << " " << support::quoted(file) << ")\n";
+ } else {
+ std::cout << "(success . t)\n";
+ }
+
+ computeCxUnsaved();
+}
+
+void Irony::getCompileOptions(const std::string &buildDir,
+ const std::string &file) const {
+#if !(HAS_COMPILATION_DATABASE)
+
+ (void)buildDir;
+ (void)file;
+
+ CXString cxVersionString = clang_getClangVersion();
+
+ std::cout << "(error . ("
+ << "unsupported"
+ << " \"compilation database requires Clang >= 3.2\""
+ << " " << support::quoted(clang_getCString(cxVersionString))
+ << "))\n";
+
+ clang_disposeString(cxVersionString);
+
+ return;
+
+#else
+ CXCompilationDatabase_Error error;
+ CXCompilationDatabase db =
+ compDBCache_.fromDirectory(buildDir.c_str(), &error);
+
+ switch (error) {
+ case CXCompilationDatabase_CanNotLoadDatabase:
+ std::cout << "(error . ("
+ << "cannot-load-database"
+ << " \"failed to load compilation database from directory\""
+ << " " << support::quoted(buildDir) << "))\n";
+ return;
+
+ case CXCompilationDatabase_NoError:
+ break;
+ }
+
+ CXCompileCommands compileCommands =
+ clang_CompilationDatabase_getCompileCommands(db, file.c_str());
+
+ std::cout << "(success . (\n";
+
+ for (unsigned i = 0, numCompileCommands =
+ clang_CompileCommands_getSize(compileCommands);
+ i < numCompileCommands; ++i) {
+ CXCompileCommand compileCommand =
+ clang_CompileCommands_getCommand(compileCommands, i);
+
+ std::cout << "("
+ << "(";
+ for (unsigned j = 0,
+ numArgs = clang_CompileCommand_getNumArgs(compileCommand);
+ j < numArgs; ++j) {
+ CXString arg = clang_CompileCommand_getArg(compileCommand, j);
+ std::cout << support::quoted(clang_getCString(arg)) << " ";
+ clang_disposeString(arg);
+ }
+
+ std::cout << ")"
+ << " . ";
+
+ CXString directory = clang_CompileCommand_getDirectory(compileCommand);
+ std::cout << support::quoted(clang_getCString(directory));
+ clang_disposeString(directory);
+
+ std::cout << ")\n";
+ }
+
+ std::cout << "))\n";
+
+ clang_CompileCommands_dispose(compileCommands);
+#endif
+}
diff --git a/elpa/irony-20220110.849/server/src/Irony.h b/elpa/irony-20220110.849/server/src/Irony.h
new file mode 100644
index 0000000..66968f5
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/Irony.h
@@ -0,0 +1,147 @@
+/**-*-C++-*-
+ * \file
+ * \author Guillaume Papin <guillaume.papin@epitech.eu>
+ *
+ * \brief irony-server "API" declarations.
+ *
+ * Contains the commands that the Emacs package relies on. These commands are
+ * mostly wrappers around a subset of the features provided by libclang. Command
+ * results are printed to \c std::cout as s-expr, in order to make it easy for
+ * Emacs to consume.
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+
+#ifndef IRONY_MODE_SERVER_IRONY_H_
+#define IRONY_MODE_SERVER_IRONY_H_
+
+#include "TUManager.h"
+
+#include "CompDBCache.h"
+#include "Style.h"
+
+#include <string>
+#include <vector>
+
+class Irony {
+public:
+ // use std::string over std::vector<char> because I have some doubts
+ // that libclang expect unsaved buffers to be a null terminated C strings
+ typedef std::string UnsavedBuffer;
+
+public:
+ Irony();
+
+ bool isDebugEnabled() const {
+ return debug_;
+ }
+
+ /// \name Command
+ /// \{
+
+ /// \brief Set or unset debugging of commands.
+ void setDebug(bool enable) {
+ debug_ = enable;
+ }
+
+ /// Parse or reparse the given file and compile options.
+ ///
+ /// If the compile options have changed, the translation unit is re-created to
+ /// take this into account.
+ ///
+ /// Output \c nil or \c t, whether or not parsing the translation unit
+ /// succeeded.
+ ///
+ /// \sa diagnostics(), getType()
+ void parse(const std::string &file, const std::vector<std::string> &flags);
+
+ /// Parse the given file for code completion.
+ ///
+ /// Shares the same semantics and output as \c parse().
+ ///
+ /// \sa candidates(), completionDiagnostics()
+ void complete(const std::string &file,
+ unsigned line,
+ unsigned col,
+ const std::vector<std::string> &flags);
+
+ void setUnsaved(const std::string &file,
+ const std::string &unsavedContentFile);
+
+ void resetUnsaved(const std::string &file);
+
+ /// \}
+
+ /// \name Queries
+ /// \{
+
+ /// \brief Retrieve the last parse diagnostics for the given file.
+ ///
+ /// \pre parse() was called.
+ void diagnostics() const;
+
+ /// \brief Get types of symbol at a given location.
+ ///
+ /// Example:
+ ///
+ /// \code
+ /// typedef int MyType;
+ /// MyType a;
+ /// \endcode
+ ///
+ /// Type of cursor location for 'a' is:
+ ///
+ /// \code{.el}
+ /// ("MyType" "int")
+ /// \endcode
+ ///
+ /// TODO: test with CXString(), seems to be twice the same string
+ ///
+ void getType(unsigned line, unsigned col) const;
+
+ /// Get all the completion candidates.
+ ///
+ /// \pre complete() was called.
+ void candidates(const std::string &prefix, PrefixMatchStyle style) const;
+
+ /// Get the diagnostics produced by the last \c complete().
+ ///
+ /// \pre complete() was called.
+ void completionDiagnostics() const;
+
+ /// \brief Get compile options from JSON database.
+ ///
+ /// \param buildDir Directory containing compile_commands.json
+ /// \param file File to obtain compile commands for.
+ ///
+ /// Example output:
+ ///
+ /// \code{.el}
+ /// (
+ /// (("-Wfoo" "-DBAR" "-Iqux") . "/path/to/working/directory")
+ /// (("-Wfoo-alt" "-DBAR_ALT" "-Iqux/alt") . "/alt/working/directory")
+ /// )
+ /// \endcode
+ ///
+ void getCompileOptions(const std::string &buildDir,
+ const std::string &file) const;
+
+ /// \}
+
+private:
+ void resetCache();
+ void computeCxUnsaved();
+
+private:
+ mutable CompDBCache compDBCache_;
+ TUManager tuManager_;
+ std::map<std::string, UnsavedBuffer> filenameToContent_;
+ CXTranslationUnit activeTu_;
+ std::string file_;
+ std::vector<CXUnsavedFile> cxUnsavedFiles_;
+ CXCodeCompleteResults *activeCompletionResults_;
+ bool debug_;
+};
+
+#endif // IRONY_MODE_SERVER_IRONY_H_
diff --git a/elpa/irony-20220110.849/server/src/Style.h b/elpa/irony-20220110.849/server/src/Style.h
new file mode 100644
index 0000000..52adb5e
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/Style.h
@@ -0,0 +1,17 @@
+/**-*-C++-*-
+ * \file
+ *
+ * \brief Style definition.
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+#ifndef IRONY_MODE_SERVER_STYLE_H_
+#define IRONY_MODE_SERVER_STYLE_H_
+
+enum class PrefixMatchStyle {
+ Exact, CaseInsensitive, SmartCase,
+};
+
+
+#endif //IRONY_MODE_SERVER_STYLE_H_
diff --git a/elpa/irony-20220110.849/server/src/TUManager.cpp b/elpa/irony-20220110.849/server/src/TUManager.cpp
new file mode 100644
index 0000000..afbdc82
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/TUManager.cpp
@@ -0,0 +1,182 @@
+/**
+ * \file
+ * \author Guillaume Papin <guillaume.papin@epitech.eu>
+ *
+ * \brief See TUManager.hh
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ *
+ */
+
+#include "TUManager.h"
+
+#include <iostream>
+
+TUManager::TUManager()
+ : index_(clang_createIndex(0, 0))
+ , translationUnits_()
+ , parseTUOptions_(clang_defaultEditingTranslationUnitOptions()) {
+
+ // this seems necessary to trigger "correct" reparse (/codeCompleteAt)
+ // clang_reparseTranslationUnit documentation states:
+ //
+ // > * \param TU The translation unit whose contents will be re-parsed. The
+ // > * translation unit must originally have been built with
+ // > * \c clang_createTranslationUnitFromSourceFile().
+ //
+ // clang_createTranslationUnitFromSourceFile() is just a call to
+ // clang_parseTranslationUnit() with
+ // CXTranslationUnit_DetailedPreprocessingRecord enabled but because we want
+ // some other flags to be set we can't just call
+ // clang_createTranslationUnitFromSourceFile()
+ parseTUOptions_ |= CXTranslationUnit_DetailedPreprocessingRecord;
+
+#if HAS_BRIEF_COMMENTS_IN_COMPLETION
+ parseTUOptions_ |= CXTranslationUnit_IncludeBriefCommentsInCodeCompletion;
+#endif
+
+ // XXX: A bug in old version of Clang (at least '3.1-8') caused the completion
+ // to fail on the standard library types when
+ // CXTranslationUnit_PrecompiledPreamble is used. We disable this option for
+ // old versions of libclang. As a result the completion will work but
+ // significantly slower.
+ //
+ // -- https://github.com/Sarcasm/irony-mode/issues/4
+ if (CINDEX_VERSION < 6) {
+ parseTUOptions_ &= ~CXTranslationUnit_PrecompiledPreamble;
+ }
+
+#if CINDEX_VERSION >= 34
+ // Keep going even after fatal errors, or syntax checking will stop after the
+ // first error. For instance unused variables will not be reported until the
+ // error has been fixed.
+ parseTUOptions_ |= CXTranslationUnit_KeepGoing;
+#endif
+}
+
+TUManager::~TUManager() {
+ clang_disposeIndex(index_);
+}
+
+CXTranslationUnit &TUManager::tuRef(const std::string &filename,
+ const std::vector<std::string> &flags) {
+ CXTranslationUnit &tu = translationUnits_[filename];
+
+ // if the flags changed since the last time, invalidate the translation unit
+ auto &flagsCache = flagsPerFileCache_[filename];
+ if (flagsCache.size() != flags.size() ||
+ !std::equal(flagsCache.begin(), flagsCache.end(), flags.begin())) {
+ if (tu) {
+ clang_disposeTranslationUnit(tu);
+ tu = nullptr;
+ }
+ // remember the flags for the next parse
+ flagsCache = flags;
+ }
+ return tu;
+}
+
+CXTranslationUnit
+TUManager::parse(const std::string &filename,
+ const std::vector<std::string> &flags,
+ const std::vector<CXUnsavedFile> &unsavedFiles) {
+ CXTranslationUnit &tu = tuRef(filename, flags);
+
+ if (tu == nullptr) {
+ std::vector<const char *> argv;
+
+#ifdef CLANG_RESOURCE_DIR
+ // Make sure libclang find its builtin headers, this is a known issue with
+ // libclang, see:
+ // - http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-July/022893.html
+ //
+ // > Make sure that Clang is using its own . It will be in a directory
+ // > ending in clang/3.2/include/ where 3.2 is the version of clang that you
+ // > are using. You may need to explicitly add it to your header search.
+ // > Usually clang finds this directory relative to the executable with
+ // > CompilerInvocation::GetResourcesPath(Argv0, MainAddr), but using just
+ // > the libraries, it can't automatically find it.
+ argv.push_back("-resource-dir");
+ argv.push_back(CLANG_RESOURCE_DIR);
+#endif
+
+ for (auto &flag : flags) {
+ argv.push_back(flag.c_str());
+ }
+
+ tu = clang_parseTranslationUnit(
+ index_,
+ filename.c_str(),
+ argv.data(),
+ static_cast<int>(argv.size()),
+ const_cast<CXUnsavedFile *>(unsavedFiles.data()),
+ unsavedFiles.size(),
+ parseTUOptions_);
+ }
+
+ if (tu == nullptr) {
+ std::clog << "error: libclang couldn't parse '" << filename << "'\n";
+ return nullptr;
+ }
+
+ // Reparsing is necessary to enable optimizations.
+ //
+ // From the clang mailing list (cfe-dev):
+ // From: Douglas Gregor
+ // Subject: Re: Clang indexing library performance
+ // ...
+ // You want to use the "default editing options" when parsing the translation
+ // unit
+ // clang_defaultEditingTranslationUnitOptions()
+ // and then reparse at least once. That will enable the various
+ // code-completion optimizations that should bring this time down
+ // significantly.
+ if (clang_reparseTranslationUnit(
+ tu,
+ unsavedFiles.size(),
+ const_cast<CXUnsavedFile *>(unsavedFiles.data()),
+ clang_defaultReparseOptions(tu))) {
+ // a 'fatal' error occured (even a diagnostic is impossible)
+ clang_disposeTranslationUnit(tu);
+ std::clog << "error: libclang couldn't reparse '" << filename << "'\n";
+ tu = 0;
+ return nullptr;
+ }
+
+ return tu;
+}
+
+CXTranslationUnit
+TUManager::getOrCreateTU(const std::string &filename,
+ const std::vector<std::string> &flags,
+ const std::vector<CXUnsavedFile> &unsavedFiles) {
+ if (auto tu = tuRef(filename, flags))
+ return tu;
+
+ return parse(filename, flags, unsavedFiles);
+}
+
+void TUManager::invalidateCachedTU(const std::string &filename) {
+ TranslationUnitsMap::iterator it = translationUnits_.find(filename);
+
+ if (it != translationUnits_.end()) {
+ if (CXTranslationUnit &tu = it->second)
+ clang_disposeTranslationUnit(tu);
+
+ translationUnits_.erase(it);
+ }
+}
+
+void TUManager::invalidateAllCachedTUs() {
+ TranslationUnitsMap::iterator it = translationUnits_.begin();
+
+ while (it != translationUnits_.end()) {
+ if (CXTranslationUnit &tu = it->second) {
+ clang_disposeTranslationUnit(tu);
+ translationUnits_.erase(it++); // post-increment keeps the iterator valid
+ } else {
+ ++it;
+ }
+ }
+}
diff --git a/elpa/irony-20220110.849/server/src/TUManager.h b/elpa/irony-20220110.849/server/src/TUManager.h
new file mode 100644
index 0000000..bd7730d
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/TUManager.h
@@ -0,0 +1,109 @@
+/**-*-C++-*-
+ * \file
+ * \author Guillaume Papin <guillaume.papin@epitech.eu>
+ *
+ * \brief Translation Unit manager.
+ *
+ * Keeps a cache of translation units, reparsing or recreating them as
+ * necessary.
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+
+#ifndef IRONY_MODE_SERVER_TUMANAGER_H_
+#define IRONY_MODE_SERVER_TUMANAGER_H_
+
+#include "support/CIndex.h"
+#include "support/NonCopyable.h"
+
+#include <map>
+#include <string>
+#include <vector>
+
+class TUManager : public util::NonCopyable {
+public:
+ TUManager();
+ ~TUManager();
+
+ /**
+ * \brief Parse \p filename with flag \p flags.
+ *
+ * The first time call \c clang_parseTranslationUnit() and save the TU in the
+ * member \c translationUnits_, The next call with the same \p filename will
+ * call \c clang_reparseTranslationUnit().
+ *
+ * usage:
+ * \code
+ * std::vector<std::string> flags;
+ * flags.push_back("-I../utils");
+ * CXTranslationUnit tu = tuManager.parse("file.cpp", flags);
+ *
+ * if (! tu)
+ * std::cerr << "parsing translation unit failed\n";
+ * \endcode
+ *
+ * \return The translation unit, if the parsing failed the translation unit
+ * will be \c NULL.
+ */
+ CXTranslationUnit parse(const std::string &filename,
+ const std::vector<std::string> &flags,
+ const std::vector<CXUnsavedFile> &unsavedFiles);
+
+ /**
+ * \brief Retrieve, creating it if necessary the TU associated to filename.
+ *
+ * \return The translation unit. Will be NULL if the translation unit couldn't
+ * be created.
+ */
+ CXTranslationUnit getOrCreateTU(const std::string &filename,
+ const std::vector<std::string> &flags,
+ const std::vector<CXUnsavedFile> &unsavedFiles);
+
+ /**
+ * \brief Invalidate a given cached TU, the next use of a TU will require
+ * reparsing.
+ *
+ * This can be useful for example: when the flags used to compile a file have
+ * changed.
+ *
+ * \param filename The filename for which the associated
+ * translation unit flags need to be invalidated.
+ *
+ * \sa invalidateAllCachedTUs()
+ */
+ void invalidateCachedTU(const std::string &filename);
+
+ /**
+ * \brief Invalidate all cached TU, the next use of a TU will require
+ * reparsing.
+ *
+ * \sa invalidateCachedTU()
+ */
+ void invalidateAllCachedTUs();
+
+private:
+ /**
+ * \brief Get a reference to the translation unit that matches \p filename
+ * with the given set of flags.
+ *
+ * The TU will be null if it has never been parsed or if the flags have
+ * changed.
+ *
+ * \todo Find a proper name.
+ */
+ CXTranslationUnit &tuRef(const std::string &filename,
+ const std::vector<std::string> &flags);
+
+private:
+ typedef std::map<const std::string, CXTranslationUnit> TranslationUnitsMap;
+ typedef std::map<const std::string, std::vector<std::string>> FilenameFlagsMap;
+
+private:
+ CXIndex index_;
+ TranslationUnitsMap translationUnits_; // cache variable
+ FilenameFlagsMap flagsPerFileCache_;
+ unsigned parseTUOptions_;
+};
+
+#endif /* !IRONY_MODE_SERVER_TUMANAGER_H_ */
diff --git a/elpa/irony-20220110.849/server/src/main.cpp b/elpa/irony-20220110.849/server/src/main.cpp
new file mode 100644
index 0000000..7797528
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/main.cpp
@@ -0,0 +1,235 @@
+/**
+ * \file
+ * \author Guillaume Papin <guillaume.papin@epitech.eu>
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+
+#include "Irony.h"
+#include "Command.h"
+
+#include "support/CIndex.h"
+#include "support/CommandLineParser.h"
+
+#include <cassert>
+#include <cstdlib>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <iterator>
+#include <memory>
+#include <vector>
+
+static void printHelp() {
+ std::cout << "usage: irony-server [OPTIONS...] [COMMAND] [ARGS...]\n"
+ "\n"
+ "Options:\n"
+ " -v, --version\n"
+ " -h, --help\n"
+ " -i, --interactive\n"
+ " -d, --debug\n"
+ " --log-file PATH\n"
+ "\n"
+ "Commands:\n";
+
+#define X(sym, str, desc) \
+ if (Command::sym != Command::Unknown) \
+ std::cout << std::left << std::setw(25) << " " str << desc << "\n";
+#include "Commands.def"
+}
+
+static void printVersion() {
+ // do not change the format for the first line, external programs should be
+ // able to rely on it
+ std::cout << "irony-server version " IRONY_PACKAGE_VERSION "\n";
+
+ CXString cxVersionString = clang_getClangVersion();
+ std::cout << clang_getCString(cxVersionString) << "\n";
+ clang_disposeString(cxVersionString);
+}
+
+struct CommandProviderInterface {
+ virtual ~CommandProviderInterface() { }
+
+ virtual std::vector<std::string> nextCommand() = 0;
+};
+
+struct CommandLineCommandProvider : CommandProviderInterface {
+ CommandLineCommandProvider(const std::vector<std::string> &argv)
+ : argv_(argv), firstCall_(true) {
+ }
+
+ std::vector<std::string> nextCommand() {
+ if (firstCall_) {
+ firstCall_ = false;
+ return argv_;
+ }
+
+ return std::vector<std::string>(1, "exit");
+ }
+
+private:
+ std::vector<std::string> argv_;
+ bool firstCall_;
+};
+
+struct InteractiveCommandProvider : CommandProviderInterface {
+ std::vector<std::string> nextCommand() {
+ std::string line;
+
+ if (std::getline(std::cin, line)) {
+ return unescapeCommandLine(line);
+ }
+
+ return std::vector<std::string>(1, "exit");
+ }
+};
+
+struct RestoreClogOnExit {
+ RestoreClogOnExit() : rdbuf_(std::clog.rdbuf()) {
+ }
+
+ ~RestoreClogOnExit() {
+ std::clog.rdbuf(rdbuf_);
+ }
+
+private:
+ RestoreClogOnExit(const RestoreClogOnExit &);
+ RestoreClogOnExit &operator=(const RestoreClogOnExit &);
+
+private:
+ std::streambuf *rdbuf_;
+};
+
+int main(int ac, const char *av[]) {
+ std::vector<std::string> argv(&av[1], &av[ac]);
+
+ // stick to STL streams, no mix of C and C++ for IO operations
+ std::ios_base::sync_with_stdio(false);
+
+ bool interactiveMode = false;
+
+ Irony irony;
+
+ if (ac == 1) {
+ printHelp();
+ return 1;
+ }
+
+ std::ofstream logFile;
+
+ // When logging to a specific file, std::clog.rdbuf() is replaced by the log
+ // file's one. When we return from the main, this buffer is deleted (at the
+ // same time as logFile) but std::clog is still active, and will try to
+ // release the rdbuf() which has already been released in logFile's
+ // destructor. To avoid this we restore std::clog()'s original rdbuf on exit.
+ RestoreClogOnExit clogBufferRestorer;
+
+ unsigned optCount = 0;
+ while (optCount < argv.size()) {
+ const std::string &opt = argv[optCount];
+
+ if (opt.c_str()[0] != '-')
+ break;
+
+ if (opt == "--help" || opt == "-h") {
+ printHelp();
+ return 0;
+ }
+
+ if (opt == "--version" || opt == "-v") {
+ printVersion();
+ return 0;
+ }
+
+ if (opt == "--interactive" || opt == "-i") {
+ interactiveMode = true;
+ } else if (opt == "--debug" || opt == "-d") {
+ irony.setDebug(true);
+ } else if (opt == "--log-file" && (optCount + 1) < argv.size()) {
+ ++optCount;
+ logFile.open(argv[optCount]);
+ std::clog.rdbuf(logFile.rdbuf());
+ } else {
+ std::cerr << "error: invalid option '" << opt << "'\n";
+ return 1;
+ }
+
+ ++optCount;
+ }
+
+ argv.erase(argv.begin(), argv.begin() + optCount);
+
+ CommandParser commandParser;
+ std::unique_ptr<CommandProviderInterface> commandProvider;
+
+ if (interactiveMode) {
+ commandProvider.reset(new InteractiveCommandProvider());
+ } else {
+ commandProvider.reset(new CommandLineCommandProvider(argv));
+ }
+
+ while (Command *c = commandParser.parse(commandProvider->nextCommand())) {
+ if (c->action != Command::Exit) {
+ std::clog << "execute: " << *c << std::endl;
+ }
+
+ switch (c->action) {
+ case Command::Help:
+ printHelp();
+ break;
+
+ case Command::Candidates:
+ irony.candidates(c->prefix, c->style);
+ break;
+
+ case Command::CompletionDiagnostics:
+ irony.completionDiagnostics();
+ break;
+
+ case Command::Complete:
+ irony.complete(c->file, c->line, c->column, c->flags);
+ break;
+
+ case Command::Diagnostics:
+ irony.diagnostics();
+ break;
+
+ case Command::Exit:
+ return 0;
+
+ case Command::GetCompileOptions:
+ irony.getCompileOptions(c->dir, c->file);
+ break;
+
+ case Command::GetType:
+ irony.getType(c->line, c->column);
+ break;
+
+ case Command::Parse:
+ irony.parse(c->file, c->flags);
+ break;
+
+ case Command::SetDebug:
+ irony.setDebug(c->opt);
+ break;
+
+ case Command::SetUnsaved:
+ irony.setUnsaved(c->file, c->unsavedFile);
+ break;
+
+ case Command::ResetUnsaved:
+ irony.resetUnsaved(c->file);
+ break;
+
+ case Command::Unknown:
+ assert(0 && "unreacheable code...reached!");
+ break;
+ }
+
+ std::cout << "\n;;EOT\n" << std::flush;
+ }
+
+ return 1;
+}
diff --git a/elpa/irony-20220110.849/server/src/support/CIndex.h b/elpa/irony-20220110.849/server/src/support/CIndex.h
new file mode 100644
index 0000000..89d3f62
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/support/CIndex.h
@@ -0,0 +1,33 @@
+/**
+ * \file
+ * \brief Wrapper around Clang Indexing Public C Interface header.
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+
+#ifndef IRONY_MODE_SERVER_SUPPORT_CINDEXVERSION_H_
+#define IRONY_MODE_SERVER_SUPPORT_CINDEXVERSION_H_
+
+#include <clang-c/Index.h>
+
+/// Use <tt>\#if CINDEX_VERSION_VERSION > 10047</tt> to test for
+/// CINDEX_VERSION_MAJOR = 1 and CINDEX_VERSION_MINOR = 47.
+#ifndef CINDEX_VERSION
+#define CINDEX_VERSION 0 // pre-clang 3.2 support
+#endif
+
+#if CINDEX_VERSION >= 6
+#define HAS_BRIEF_COMMENTS_IN_COMPLETION 1
+#else
+#define HAS_BRIEF_COMMENTS_IN_COMPLETION 0
+#endif
+
+#if CINDEX_VERSION >= 6
+#define HAS_COMPILATION_DATABASE 1
+#include <clang-c/CXCompilationDatabase.h>
+#else
+#define HAS_COMPILATION_DATABASE 0
+#endif
+
+#endif /* !IRONY_MODE_SERVER_SUPPORT_CINDEXVERSION_H_ */
diff --git a/elpa/irony-20220110.849/server/src/support/CommandLineParser.cpp b/elpa/irony-20220110.849/server/src/support/CommandLineParser.cpp
new file mode 100644
index 0000000..a838092
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/support/CommandLineParser.cpp
@@ -0,0 +1,119 @@
+/**
+ * \file
+ * \author Guillaume Papin <guillaume.papin@epitech.eu>
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+
+#include "CommandLineParser.h"
+
+namespace {
+
+/// \brief A parser for escaped strings of command line arguments.
+///
+/// Assumes \-escaping for quoted arguments (see the documentation of
+/// unescapeCommandLine(...)).
+class CommandLineArgumentParser {
+public:
+ CommandLineArgumentParser(const std::string &commandLine)
+ : input_(commandLine), position_(input_.begin() - 1) {
+ }
+
+ std::vector<std::string> parse() {
+ bool hasMoreInput = true;
+ while (hasMoreInput && nextNonWhitespace()) {
+ std::string argument;
+ hasMoreInput = parseStringInto(argument);
+ commandLine_.push_back(argument);
+ }
+ return commandLine_;
+ }
+
+private:
+ // All private methods return true if there is more input available.
+
+ bool parseStringInto(std::string &string) {
+ do {
+ if (*position_ == '"') {
+ if (!parseDoubleQuotedStringInto(string))
+ return false;
+ } else if (*position_ == '\'') {
+ if (!parseSingleQuotedStringInto(string))
+ return false;
+ } else {
+ if (!parseFreeStringInto(string))
+ return false;
+ }
+ } while (*position_ != ' ');
+ return true;
+ }
+
+ bool parseDoubleQuotedStringInto(std::string &string) {
+ if (!next())
+ return false;
+ while (*position_ != '"') {
+ if (!skipEscapeCharacter())
+ return false;
+ string.push_back(*position_);
+ if (!next())
+ return false;
+ }
+ return next();
+ }
+
+ bool parseSingleQuotedStringInto(std::string &string) {
+ if (!next())
+ return false;
+ while (*position_ != '\'') {
+ string.push_back(*position_);
+ if (!next())
+ return false;
+ }
+ return next();
+ }
+
+ bool parseFreeStringInto(std::string &string) {
+ do {
+ if (!skipEscapeCharacter())
+ return false;
+ string.push_back(*position_);
+ if (!next())
+ return false;
+ } while (*position_ != ' ' && *position_ != '"' && *position_ != '\'');
+ return true;
+ }
+
+ bool skipEscapeCharacter() {
+ if (*position_ == '\\') {
+ return next();
+ }
+ return true;
+ }
+
+ bool nextNonWhitespace() {
+ do {
+ if (!next())
+ return false;
+ } while (*position_ == ' ');
+ return true;
+ }
+
+ bool next() {
+ ++position_;
+ return position_ != input_.end();
+ }
+
+private:
+ const std::string input_;
+ std::string::const_iterator position_;
+ std::vector<std::string> commandLine_;
+};
+
+} // unnamed namespace
+
+std::vector<std::string>
+unescapeCommandLine(const std::string &escapedCommandLine) {
+ CommandLineArgumentParser parser(escapedCommandLine);
+ return parser.parse();
+}
diff --git a/elpa/irony-20220110.849/server/src/support/CommandLineParser.h b/elpa/irony-20220110.849/server/src/support/CommandLineParser.h
new file mode 100644
index 0000000..b764797
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/support/CommandLineParser.h
@@ -0,0 +1,21 @@
+/**
+ * \file
+ * \brief Facility to parse a command line into a string array.
+ *
+ * \note Please note that the code borrowed from the Clang,
+ * lib/Tooling/JSONCompilationDatabase.cpp.
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+
+#ifndef IRONY_MODE_SERVER_SUPPORT_COMMAND_LINE_PARSER_H_
+#define IRONY_MODE_SERVER_SUPPORT_COMMAND_LINE_PARSER_H_
+
+#include <string>
+#include <vector>
+
+std::vector<std::string>
+unescapeCommandLine(const std::string &escapedCommandLine);
+
+#endif // IRONY_MODE_SERVER_SUPPORT_COMMAND_LINE_PARSER_H_
diff --git a/elpa/irony-20220110.849/server/src/support/NonCopyable.h b/elpa/irony-20220110.849/server/src/support/NonCopyable.h
new file mode 100644
index 0000000..d30a5b2
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/support/NonCopyable.h
@@ -0,0 +1,34 @@
+/**-*-C++-*-
+ * \file
+ * \author Guillaume Papin <guillaume.papin@epitech.eu>
+ *
+ * \brief NonCopyable class like in Boost.
+ *
+ * \see http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Non-copyable_Mixin
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+
+#ifndef IRONY_MODE_SERVER_SUPPORT_NONCOPYABLE_H_
+#define IRONY_MODE_SERVER_SUPPORT_NONCOPYABLE_H_
+
+namespace util {
+
+class NonCopyable {
+protected:
+ NonCopyable() {
+ }
+
+ // Protected non-virtual destructor
+ ~NonCopyable() {
+ }
+
+private:
+ NonCopyable(const NonCopyable &);
+ NonCopyable &operator=(const NonCopyable &);
+};
+
+} // ! namespace util
+
+#endif /* !IRONY_MODE_SERVER_SUPPORT_NONCOPYABLE_H_ */
diff --git a/elpa/irony-20220110.849/server/src/support/TemporaryFile.cpp b/elpa/irony-20220110.849/server/src/support/TemporaryFile.cpp
new file mode 100644
index 0000000..e7393e1
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/support/TemporaryFile.cpp
@@ -0,0 +1,74 @@
+/**
+ * \file
+ * \author Guillaume Papin <guillaume.papin@epitech.eu>
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+
+#include "TemporaryFile.h"
+
+#include <algorithm>
+#include <cstdio>
+#include <cstdlib>
+#include <fstream>
+#include <iostream>
+#include <random>
+
+static std::string getTemporaryFileDirectory() {
+ const char *temporaryDirEnvVars[] = {"TMPDIR", "TMP", "TEMP", "TEMPDIR"};
+
+ for (const char *envVar : temporaryDirEnvVars) {
+ if (const char *dir = std::getenv(envVar))
+ return dir;
+ }
+
+ return "/tmp";
+}
+
+TemporaryFile::TemporaryFile(const std::string &prefix,
+ const std::string &suffix)
+ : pathOrPattern_(prefix + "-%%%%%%" + suffix) {
+}
+
+TemporaryFile::~TemporaryFile() {
+ if (openedFile_) {
+ openedFile_.reset();
+ std::remove(pathOrPattern_.c_str());
+ }
+}
+
+const std::string &TemporaryFile::getPath() {
+ if (!openedFile_) {
+ openedFile_.reset(new std::fstream);
+
+ std::random_device rd;
+ std::default_random_engine e(rd());
+ std::uniform_int_distribution<int> dist(0, 15);
+ std::string pattern = pathOrPattern_;
+ std::string tmpDir = getTemporaryFileDirectory() + "/";
+ int i = 0;
+
+ do {
+ // exiting is better than infinite loop
+ if (++i > TemporaryFile::MAX_ATTEMPS) {
+ std::cerr << "error: couldn't create temporary file, please check your "
+ "temporary file directory (" << tmpDir << ")\n";
+ exit(EXIT_FAILURE);
+ }
+
+ // make the filename based on the pattern
+ std::transform(pattern.begin(),
+ pattern.end(),
+ pathOrPattern_.begin(),
+ [&e, &dist](char ch) {
+ return ch == '%' ? "0123456789abcdef"[dist(e)] : ch;
+ });
+ // create the file
+ openedFile_->open(tmpDir + pathOrPattern_, std::ios_base::out);
+ } while (!openedFile_->is_open());
+ pathOrPattern_ = tmpDir + pathOrPattern_;
+ }
+
+ return pathOrPattern_;
+}
diff --git a/elpa/irony-20220110.849/server/src/support/TemporaryFile.h b/elpa/irony-20220110.849/server/src/support/TemporaryFile.h
new file mode 100644
index 0000000..5bf77f4
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/support/TemporaryFile.h
@@ -0,0 +1,36 @@
+/**-*-C++-*-
+ * \file
+ * \author Guillaume Papin <guillaume.papin@epitech.eu>
+ *
+ * \brief Not the best piece of code out there.
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+
+#ifndef IRONY_MODE_SERVER_SUPPORT_TEMPORARY_FILE_H_
+#define IRONY_MODE_SERVER_SUPPORT_TEMPORARY_FILE_H_
+
+#include <iosfwd>
+#include <memory>
+#include <string>
+
+class TemporaryFile {
+ enum {
+ // if we can't create the temp file, exits.
+ MAX_ATTEMPS = 25
+ };
+
+public:
+ TemporaryFile(const std::string &prefix, const std::string &suffix = "");
+ ~TemporaryFile();
+
+ /// Returns the path of this temporary filename
+ const std::string &getPath();
+
+private:
+ std::string pathOrPattern_;
+ std::unique_ptr<std::fstream> openedFile_;
+};
+
+#endif // IRONY_MODE_SERVER_SUPPORT_TEMPORARY_FILE_H_
diff --git a/elpa/irony-20220110.849/server/src/support/iomanip_quoted.h b/elpa/irony-20220110.849/server/src/support/iomanip_quoted.h
new file mode 100644
index 0000000..a8ca38b
--- /dev/null
+++ b/elpa/irony-20220110.849/server/src/support/iomanip_quoted.h
@@ -0,0 +1,52 @@
+/**-*-C++-*-
+ * \file
+ * \brief Dumb implementation of something that might look like C++14
+ * std::quoted.
+ *
+ * This file is distributed under the GNU General Public License. See
+ * COPYING for details.
+ */
+
+#ifndef IRONY_MODE_SERVER_SUPPORT_IOMANIP_QUOTED_H_
+#define IRONY_MODE_SERVER_SUPPORT_IOMANIP_QUOTED_H_
+
+#include <ostream>
+#include <string>
+
+namespace support {
+namespace detail {
+
+struct QuotedStringProxy {
+ QuotedStringProxy(const std::string &s) : s(s) {
+ }
+
+ std::string s;
+};
+
+std::ostream &operator<<(std::ostream &os, const QuotedStringProxy &q) {
+ const std::string &s = q.s;
+
+ os << '"';
+ if (s.find_first_of("\"\\") == std::string::npos) {
+ os << s;
+ } else {
+ for (auto ch : s) {
+ if (ch == '\\' || ch == '"')
+ os << '\\';
+
+ os << ch;
+ }
+ }
+ os << '"';
+ return os;
+}
+
+} // namespace detail
+
+detail::QuotedStringProxy quoted(const std::string &s) {
+ return detail::QuotedStringProxy(s);
+}
+
+} // namespace support
+
+#endif // IRONY_MODE_SERVER_SUPPORT_IOMANIP_QUOTED_H_
diff --git a/elpa/irony-20220110.849/server/test/CMakeLists.txt b/elpa/irony-20220110.849/server/test/CMakeLists.txt
new file mode 100644
index 0000000..078b69a
--- /dev/null
+++ b/elpa/irony-20220110.849/server/test/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
+
+add_subdirectory (elisp)
diff --git a/elpa/irony-20220110.849/server/test/elisp/CMakeLists.txt b/elpa/irony-20220110.849/server/test/elisp/CMakeLists.txt
new file mode 100644
index 0000000..8877a89
--- /dev/null
+++ b/elpa/irony-20220110.849/server/test/elisp/CMakeLists.txt
@@ -0,0 +1,47 @@
+# On MS-Windows, emacs_dir is a special environment variable, which
+# indicates the full path of the directory in which Emacs is
+# installed.
+#
+# There is no standard location that I know of for Emacs on Windows so
+# using this special environment variable will at least help people
+# who build the server from inside Emacs.
+if(DEFINED ENV{emacs_dir})
+ list(APPEND EMACS_EXECUTABLE_HINTS $ENV{emacs_dir}/bin)
+endif()
+
+find_program(EMACS_EXECUTABLE emacs
+ HINTS ${EMACS_EXECUTABLE_HINTS})
+
+if (EMACS_EXECUTABLE)
+ message(STATUS "Found emacs: ${EMACS_EXECUTABLE}")
+else()
+ message(WARNING "emacs not found: elisp tests will be skipped!")
+ return()
+endif()
+
+#
+# add_ert_test(<FileName>)
+#
+# Create a test which run the given Elisp script using the Emacs ERT testing
+# framework.
+#
+# The target is deduced from the ``FileName`` argument, e.g: the file foo.el
+# will be the target 'check-foo-el'.
+#
+# FIXME: assumes MELPA is configured...
+function(add_ert_test test_file)
+ get_filename_component(name ${test_file} NAME_WE)
+ add_test(check-${name}-el
+ ${EMACS_EXECUTABLE} -Q --batch
+ -l package
+ --eval "(package-initialize)"
+ --eval "(unless (require 'cl-lib nil t) (package-refresh-contents) (package-install 'cl-lib))"
+ -l ${CMAKE_CURRENT_SOURCE_DIR}/${test_file}
+ -f ert-run-tests-batch-and-exit)
+
+ set_tests_properties(check-${name}-el PROPERTIES TIMEOUT 15)
+endfunction()
+
+add_ert_test(irony.el)
+add_ert_test(irony-iotask.el)
+add_ert_test(irony-cdb-json.el)
diff --git a/elpa/irony-20220110.849/server/test/elisp/irony-cdb-json.el b/elpa/irony-20220110.849/server/test/elisp/irony-cdb-json.el
new file mode 100644
index 0000000..a810dae
--- /dev/null
+++ b/elpa/irony-20220110.849/server/test/elisp/irony-cdb-json.el
@@ -0,0 +1,87 @@
+;; -*-no-byte-compile: t; -*-
+(load
+ (concat (file-name-directory (or load-file-name buffer-file-name))
+ "test-config"))
+
+(require 'irony-cdb-json)
+(require 'cl-lib)
+
+(defconst irony-cdb/compile-command
+ '((file . "../src/file.cc")
+ (directory . "/home/user/project/build")
+ (command . "/usr/bin/clang++ -DSOMEDEF=1 -c -o file.o /home/user/project/src/file.cc")))
+
+(ert-deftest cdb/parse/simple/path-is-absolute ()
+ (should
+ (equal "/home/user/project/src/file.cc"
+ (nth 0 (irony-cdb-json--transform-compile-command
+ irony-cdb/compile-command)))))
+
+(ert-deftest cdb/parse/simple/compile-options ()
+ (should
+ (equal '("-DSOMEDEF=1")
+ (nth 1 (irony-cdb-json--transform-compile-command
+ irony-cdb/compile-command)))))
+
+(ert-deftest cdb/parse/simple/invocation-directory ()
+ (should
+ (equal "/home/user/project/build"
+ (nth 2 (irony-cdb-json--transform-compile-command
+ irony-cdb/compile-command)))))
+
+(ert-deftest cdb/choose-closest-path/chooses-closest ()
+ (should
+ (equal "/tmp/a/cdb"
+ (irony-cdb--choose-closest-path "/tmp/a/1"
+ '("/tmp/a/cdb" "/tmp/cdb")))))
+
+(ert-deftest cdb/choose-closest-path/chooses-closest2 ()
+ (should
+ (equal "/tmp/a/cdb"
+ (irony-cdb--choose-closest-path "/tmp/a/1"
+ '("/tmp/cdb" "/tmp/a/cdb")))))
+
+(ert-deftest cdb/choose-closest-path/prefers-deeper ()
+ (should
+ (equal "/tmp/a/build/cdb"
+ (irony-cdb--choose-closest-path "/tmp/a/1"
+ '("/tmp/a/build/cdb" "/tmp/cdb")))))
+
+(ert-deftest cdb/choose-closest-path/prefers-deeper2 ()
+ (should
+ (equal "/tmp/a/build/cdb"
+ (irony-cdb--choose-closest-path "/tmp/a/1"
+ '("/tmp/cdb" "/tmp/a/build/cdb")))))
+
+(ert-deftest cdb/choose-closest-path/will-survive-garbage ()
+ (should
+ (equal nil
+ (irony-cdb--choose-closest-path "/tmp/a/1"
+ 'ordures))))
+
+; http://endlessparentheses.com/understanding-letf-and-how-it-replaces-flet.html
+(ert-deftest cdb/locate-db/choose-among-candidates ()
+ (should
+ (equal "/foo/build/cdb"
+ (cl-letf (((symbol-function 'locate-dominating-file)
+ (lambda (file name)
+ (cond
+ ((string= name "./cdb") "/") ; found /cdb
+ ((string= name "build/cdb") "/foo/") ; found /foo/build/cdb
+ ))))
+ (irony-cdb--locate-dominating-file-with-dirs "/foo/bar/qux.cpp"
+ "cdb"
+ '("." "build" "out/x86_64"))))))
+
+(ert-deftest cdb/locate-dominating-file-with-dirs/children-first ()
+ (should
+ (equal "/tmp/foo/bar/out/x86_64/cdb"
+ (cl-letf (((symbol-function 'locate-dominating-file)
+ (lambda (file name)
+ (cond
+ ((string= name "./cdb") "/tmp/foo/") ; found /tmp/foo/cdb
+ ((string= name "out/x86_64/cdb") "/tmp/foo/bar/") ;found /tmp/foo/bar/out/x86_64/cdb
+ ))))
+ (irony-cdb--locate-dominating-file-with-dirs "/tmp/foo/bar/qux.cpp"
+ "cdb"
+ '("." "out/x86_64" ))))))
diff --git a/elpa/irony-20220110.849/server/test/elisp/irony-iotask.el b/elpa/irony-20220110.849/server/test/elisp/irony-iotask.el
new file mode 100644
index 0000000..7ef213b
--- /dev/null
+++ b/elpa/irony-20220110.849/server/test/elisp/irony-iotask.el
@@ -0,0 +1,249 @@
+;; -*-no-byte-compile: t; -*-
+(load (concat (file-name-directory (or load-file-name
+ buffer-file-name))
+ "test-config"))
+
+;; load irony-iotask
+;;
+;; XXX: No idea why this is necessary, test-config already adds the directory to
+;; the load-path so irony is found...
+(unless (require 'irony-iotask nil t)
+ (let ((irony-iotask-dir (expand-file-name "../../.." test-dir)))
+ (add-to-list 'load-path irony-iotask-dir)
+ (require 'irony-iotask)))
+
+(defun irony-iotask-echo-process-exit-filter (process output)
+ (when (buffer-live-p (process-buffer process))
+ (with-current-buffer (process-buffer process)
+ (goto-char (process-mark process))
+ (insert output)
+ (set-marker (process-mark process) (point))
+ (when (>= (buffer-size) (length "exit\n"))
+ (should (string= (buffer-string) "exit\n"))
+ (erase-buffer)))))
+
+;; Note: these tests use process communication with the standard I/O streams.
+;; The subprocess used for this communication is Emacs.
+;;
+;; The following article provides useful information for using Elisp as a
+;; scripting language, Emacs as an interpreter, it details how the standard I/O
+;; streams works in Elisp scripts:
+;; - http://www.lunaryorn.com/2014/08/12/emacs-script-pitfalls.html
+
+(defmacro irony-iotask/with-echo-process (&rest body)
+ "Start an Emacs process that runs the given PROCESS-SCRIPT.
+
+The process is setup with `irony-iotask-setup-process'.
+
+It's possible to schedule some iotasks in the BODY for testing.
+
+There is an exposed variable named `process' available for use in
+BODY.
+
+Elisp is used as a scripting language because it should be
+available on all OSes irony-iotask support."
+ (declare (indent 1))
+ `(let ((process-connection-type nil)
+ (process-adaptive-read-buffering nil)
+ process)
+ (setq process
+ (start-process "emacs-irony-test"
+ "*emacs-irony-test*"
+ (expand-file-name invocation-name
+ invocation-directory)
+ "-Q"
+ "--batch"
+ "--eval"
+ (prin1-to-string
+ '(let ((msg))
+ (while (not (equal msg "exit"))
+ (setq msg (read-from-minibuffer ""))
+ (message msg))))))
+ (unwind-protect
+ (progn
+ (irony-iotask-setup-process process)
+ ,@body)
+ ;; the iotask process filter does not clean the process buffer
+ ;; at the end of a request, but at the begining of a new one
+ (with-current-buffer (process-buffer process)
+ (erase-buffer))
+ (set-process-filter process #'irony-iotask-echo-process-exit-filter)
+ (process-send-string process "exit\n")
+ ;; wait for the process to finish normally, or kill it if it doesn't
+ (with-timeout (1 (kill-process process))
+ (while (process-live-p process)
+ (sit-for 0.05)))
+ ;; start with a clean buffer,
+ ;; Emacs 24.3 seems to keep some
+ (kill-buffer (process-buffer process))
+ (delete-process process))))
+
+;; irony-iotask-result
+
+(ert-deftest irony-iotask-result/ready-p-value ()
+ (let ((result (irony-iotask-result-create)))
+ (should-not (irony-iotask-result-valid-p result))
+ (irony-iotask-result-set-value result 1)
+ (should (irony-iotask-result-valid-p result))))
+
+(ert-deftest irony-iotask-result/ready-p-error ()
+ (let ((result (irony-iotask-result-create)))
+ (should-not (irony-iotask-result-valid-p result))
+ (irony-iotask-result-set-error result 'irony-iotask-error (list "blah"))
+ (should (irony-iotask-result-valid-p result))))
+
+(ert-deftest irony-iotask-result/set-value ()
+ (let ((result (irony-iotask-result-create)))
+ (irony-iotask-result-set-value result 'blah)
+ (should (eq (irony-iotask-result-get result) 'blah))))
+
+(irony--define-error 'irony-iotask-result/test-error
+ "Irony I/O task sample error")
+
+(ert-deftest irony-iotask-result/set-error ()
+ (let ((result (irony-iotask-result-create)))
+ (irony-iotask-result-set-error result 'irony-iotask-result/test-error)
+ (should-error (irony-iotask-result-get result)
+ :type 'irony-iotask-result/test-error)))
+
+(ert-deftest irony-iotask-result/set-error-data ()
+ (let ((result (irony-iotask-result-create)))
+ (irony-iotask-result-set-error result
+ 'irony-iotask-result/test-error
+ 'foo 'bar 'baz 'qux)
+ (condition-case err
+ (irony-iotask-result-get result)
+ (irony-iotask-result/test-error
+ (should (equal (cdr err) '(foo bar baz qux)))))))
+
+(ert-deftest irony-iotask-result/get-empty ()
+ (let ((result (irony-iotask-result-create)))
+ (should-error (irony-iotask-result-get result)
+ :type 'irony-iotask-result-get-error)))
+
+;; task
+
+(irony-iotask-define-task irony-iotask/task-start-t
+ "doc"
+ :start (lambda (&optional value)
+ (irony-iotask-set-result (or value 42))))
+
+(ert-deftest irony-iotask/task-start/simple ()
+ (let ((task (irony-iotask-package-task irony-iotask/task-start-t)))
+ (irony-iotask/with-echo-process
+ (should (equal 42 (irony-iotask-run process task))))))
+
+(ert-deftest irony-iotask/task-start/with-arguments ()
+ (let ((task (irony-iotask-package-task irony-iotask/task-start-t 43)))
+ (irony-iotask/with-echo-process
+ (should (equal 43 (irony-iotask-run process task))))))
+
+(irony-iotask-define-task irony-iotask/task-update-t
+ "doc"
+ :start (lambda (&optional hello)
+ (irony-iotask-send-string (format "%s\n" (or hello "hello"))))
+ :update (lambda (&optional hello)
+ (setq hello (or hello "hello"))
+ (when (string= (buffer-string) (format "%s\n" hello))
+ (irony-iotask-set-result (format "%s ok" hello)))))
+
+(ert-deftest irony-iotask-schedule/task-update/simple ()
+ (let ((task (irony-iotask-package-task irony-iotask/task-update-t)))
+ (irony-iotask/with-echo-process
+ (should (string= "hello ok" (irony-iotask-run process task))))))
+
+(ert-deftest irony-iotask-schedule/task-update/with-arguments ()
+ (let ((task (irony-iotask-package-task irony-iotask/task-update-t "bonjour")))
+ (irony-iotask/with-echo-process
+ (should (string= "bonjour ok" (irony-iotask-run process task))))))
+
+(irony-iotask-define-task irony-iotask/task-invalid-msg-t
+ "doc"
+ :start (lambda ()
+ (irony-iotask-send-string "ping\n"))
+ :update (lambda ()
+ (when (string= (buffer-string) "ping\n")
+ (throw 'invalid-msg t))))
+
+(ert-deftest irony-iotask-schedule/task-update/invalid-msg ()
+ (let ((task (irony-iotask-package-task irony-iotask/task-invalid-msg-t)))
+ (irony-iotask/with-echo-process
+ (should-error (irony-iotask-run process task)
+ :type 'irony-iotask-bad-data))))
+
+(ert-deftest irony-iotask-chain/simple ()
+ (let ((task (irony-iotask-chain
+ (irony-iotask-package-task irony-iotask/task-update-t "hi")
+ (irony-iotask-package-task irony-iotask/task-update-t "hej"))))
+ (irony-iotask/with-echo-process
+ (should (equal "hej ok" (irony-iotask-run process task))))))
+
+(defvar irony-iotask/task-finish-var nil)
+(defvar irony-iotask/task-on-var nil)
+(irony-iotask-define-task irony-iotask/task-finish-t
+ "doc"
+ :start (lambda ()
+ (irony-iotask-put :text "how")
+ (irony-iotask-send-string "hello\n"))
+ :update (lambda ()
+ (cond
+ ((string= (buffer-string) "hello\n")
+ (irony-iotask-put :text (concat (irony-iotask-get :text) " are"))
+ (irony-iotask-set-result t))
+ ((>= (buffer-size) (1+ (length "hello\n")))
+ (throw 'invalid-msg t))))
+ :on-success (lambda ()
+ (setq irony-iotask/task-on-var "success"))
+ :finish (lambda ()
+ (setq irony-iotask/task-finish-var (concat (irony-iotask-get :text)
+ " you?"))))
+
+(ert-deftest irony-iotask-schedule/task-finish/simple ()
+ (let ((task (irony-iotask-package-task irony-iotask/task-finish-t)))
+ (irony-iotask/with-echo-process
+ (setq irony-iotask/task-finish-var nil)
+ (irony-iotask-run process task)
+ (should (equal "how are you?" irony-iotask/task-finish-var)))))
+
+(ert-deftest irony-iotask-schedule/task-on-success/simple ()
+ (let ((task (irony-iotask-package-task irony-iotask/task-finish-t)))
+ (irony-iotask/with-echo-process
+ (setq irony-iotask/task-on-var nil)
+ (irony-iotask-run process task)
+ (should (equal "success" irony-iotask/task-on-var)))))
+
+(irony-iotask-define-task irony-iotask/task-on-error-t
+ "doc"
+ :start (lambda ()
+ (irony-iotask-set-error 'irony-iotask-error))
+ :on-error (lambda ()
+ (setq irony-iotask/task-on-var "error")))
+
+(ert-deftest irony-iotask-schedule/task-on-error/simple ()
+ (let ((task (irony-iotask-package-task irony-iotask/task-on-error-t)))
+ (irony-iotask/with-echo-process
+ (setq irony-iotask/task-on-var nil)
+ (ignore-errors
+ (irony-iotask-run process task))
+ (should (equal "error" irony-iotask/task-on-var)))))
+
+(ert-deftest irony-iotask-schedule/callback/recalls-schedule ()
+ (let ((task (irony-iotask-package-task irony-iotask/task-update-t "a")))
+ (irony-iotask/with-echo-process
+ (lexical-let ((run-process process)
+ results)
+ (irony-iotask-schedule process task
+ (lambda (result)
+ (setq results (list result))
+ (irony-iotask-schedule
+ run-process
+ (irony-iotask-package-task
+ irony-iotask/task-update-t "b")
+ (lambda (result)
+ (setq results (append results (list result)))))))
+ (should (with-local-quit
+ (while (< (length results) 2)
+ (accept-process-output process 0.05))
+ t))
+ (should (string= "a ok" (irony-iotask-result-get (nth 0 results))))
+ (should (string= "b ok" (irony-iotask-result-get (nth 1 results))))))))
diff --git a/elpa/irony-20220110.849/server/test/elisp/irony.el b/elpa/irony-20220110.849/server/test/elisp/irony.el
new file mode 100644
index 0000000..fe2378b
--- /dev/null
+++ b/elpa/irony-20220110.849/server/test/elisp/irony.el
@@ -0,0 +1,121 @@
+;; -*-no-byte-compile: t; -*-
+(load (concat (file-name-directory (or load-file-name
+ buffer-file-name))
+ "test-config"))
+
+(ert-deftest irony/buffer-size-in-bytes ()
+ (with-temp-buffer
+ ;; this smiley takes 3 bytes apparently
+ (insert "☺")
+ (should (equal 3 (irony--buffer-size-in-bytes)))
+ (erase-buffer)
+ (insert "☺\n")
+ (should (equal 4 (irony--buffer-size-in-bytes)))
+ (erase-buffer)
+ (insert "\t")
+ (should (equal 1 (irony--buffer-size-in-bytes)))))
+
+(ert-deftest irony/find-server-executable/does-not-exists ()
+ (let ((irony-server-install-prefix "/does/not/exists")
+ (exec-path nil))
+ (should-error (irony--find-server-executable)
+ :type 'irony-server-error)))
+
+(ert-deftest irony/split-command-line/just-spaces ()
+ (let ((cmd-line "clang -Wall -Wextra"))
+ (should (equal
+ '("clang" "-Wall" "-Wextra")
+ (irony--split-command-line cmd-line)))))
+
+(ert-deftest irony/split-command-line/start-with-space ()
+ (let ((cmd-line " clang -Wall -Wextra"))
+ (should (equal
+ '("clang" "-Wall" "-Wextra")
+ (irony--split-command-line cmd-line)))))
+
+(ert-deftest irony/split-command-line/end-with-space ()
+ (let ((cmd-line "clang -Wall -Wextra "))
+ (should (equal
+ '("clang" "-Wall" "-Wextra")
+ (irony--split-command-line cmd-line)))))
+
+(ert-deftest irony/split-command-line/space-everywhere ()
+ (let ((cmd-line " \t clang \t -Wall \t -Wextra\t"))
+ (should (equal
+ '("clang" "-Wall" "-Wextra")
+ (irony--split-command-line cmd-line)))))
+
+(ert-deftest irony/split-command-line/with-quotes ()
+ (let ((cmd-line "clang -Wall -Wextra \"-I/tmp/dir with spaces\""))
+ (should (equal
+ '("clang" "-Wall" "-Wextra" "-I/tmp/dir with spaces")
+ (irony--split-command-line cmd-line)))))
+
+(ert-deftest irony/split-command-line/with-quotes ()
+ "Test if files are removed from the arguments list.
+
+https://github.com/Sarcasm/irony-mode/issues/101"
+ (let ((cmd-line "g++ -DFOO=\\\"\\\""))
+ (should (equal
+ '("g++" "-DFOO=\"\"")
+ (irony--split-command-line cmd-line)))))
+
+(ert-deftest irony/split-command-line/start-with-quotes ()
+ (let ((cmd-line "\"cl ang\" -Wall -Wextra \"-I/tmp/dir with spaces\""))
+ (should (equal
+ '("cl ang" "-Wall" "-Wextra" "-I/tmp/dir with spaces")
+ (irony--split-command-line cmd-line)))))
+
+(ert-deftest irony/split-command-line/quotes-in-word ()
+ (let ((cmd-line "clang -Wall -Wextra -I\"/tmp/dir with spaces\""))
+ (should (equal
+ '("clang" "-Wall" "-Wextra" "-I/tmp/dir with spaces")
+ (irony--split-command-line cmd-line)))))
+
+(ert-deftest irony/split-command-line/ill-end-quote ()
+ (let ((cmd-line "clang -Wall -Wextra\""))
+ (should-error (irony--split-command-line cmd-line)
+ :type 'irony-parse-error)))
+
+(ert-deftest irony/split-command-line/backslash-1 ()
+ (let ((cmd-line "clang\\ -Wall"))
+ (should (equal
+ '("clang -Wall")
+ (irony--split-command-line cmd-line)))))
+
+(ert-deftest irony/split-command-line/backslash-2 ()
+ (let ((cmd-line "\\\\\\ clang\\ -Wall\\"))
+ (should (equal
+ '("\\ clang -Wall\\")
+ (irony--split-command-line cmd-line)))))
+
+(ert-deftest irony/extract-working-directory-option/not-specified ()
+ (let ((compile-flags '("-Wall")))
+ (should
+ (not (irony--extract-working-directory-option compile-flags)))))
+
+(ert-deftest irony/extract-working-directory-option/specified-1 ()
+ (let ((compile-flags '("-working-directory" "/tmp/lol")))
+ (should (equal "/tmp/lol"
+ (irony--extract-working-directory-option compile-flags)))))
+
+(ert-deftest irony/extract-working-directory-option/specified-2 ()
+ (let ((compile-flags '("-Wall" "-working-directory=/tmp/lol" "-Wshadow")))
+ (should (equal "/tmp/lol"
+ (irony--extract-working-directory-option compile-flags)))))
+
+;; TODO: restore functionality
+;; (ert-deftest irony/include-directories-1 ()
+;; (let ((irony-compile-flags '("-Iinclude" "-I/tmp/foo"))
+;; (irony-compile-flags-work-dir "/tmp/blah/"))
+;; (should (equal
+;; '("/tmp/blah/include" "/tmp/foo")
+;; (irony-user-search-paths)))))
+
+;; (ert-deftest irony/include-directories-2 ()
+;; (let ((irony-compile-flags '("-Wextra" "-Iinclude" "-I" "foo" "-Wall"))
+;; (irony-compile-flags-work-dir "/tmp/blah/"))
+;; (should (equal
+;; '("/tmp/blah/include"
+;; "/tmp/blah/foo")
+;; (irony-user-search-paths)))))
diff --git a/elpa/irony-20220110.849/server/test/elisp/test-config.el b/elpa/irony-20220110.849/server/test/elisp/test-config.el
new file mode 100644
index 0000000..224cdd0
--- /dev/null
+++ b/elpa/irony-20220110.849/server/test/elisp/test-config.el
@@ -0,0 +1,14 @@
+;; -*-no-byte-compile: t; -*-
+(defvar test-dir (if load-file-name
+ (file-name-as-directory
+ (expand-file-name (concat (file-name-directory
+ load-file-name)))))
+ "Elisp test directory path.")
+
+;; load irony
+(unless (require 'irony nil t)
+ (let ((irony-dir (expand-file-name "../../.." test-dir)))
+ (add-to-list 'load-path irony-dir)
+ (require 'irony)))
+
+(require 'ert)
diff --git a/elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars-autoloads.el b/elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars-autoloads.el
new file mode 100644
index 0000000..e2aa213
--- /dev/null
+++ b/elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars-autoloads.el
@@ -0,0 +1,44 @@
+;;; js2-highlight-vars-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*-
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "js2-highlight-vars" "js2-highlight-vars.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from js2-highlight-vars.el
+
+(autoload 'js2-highlight-vars-mode "js2-highlight-vars" "\
+Minor mode that highlights occurrences of the variable under
+cursor in js2-mode buffers
+
+This is a minor mode. If called interactively, toggle the
+`Js2-Highlight-vars mode' mode. If the prefix argument is
+positive, enable the mode, and if it is zero or negative, disable
+the mode.
+
+If called from Lisp, toggle the mode if ARG is `toggle'. Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+To check whether the minor mode is enabled in the current buffer,
+evaluate `js2-highlight-vars-mode'.
+
+The mode's hook is called both when the mode is enabled and when
+it is disabled.
+
+\(fn &optional ARG)" t nil)
+
+(register-definition-prefixes "js2-highlight-vars" '("js2-"))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; js2-highlight-vars-autoloads.el ends here
diff --git a/elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars-pkg.el b/elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars-pkg.el
new file mode 100644
index 0000000..aac467c
--- /dev/null
+++ b/elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars-pkg.el
@@ -0,0 +1,2 @@
+;;; Generated package description from js2-highlight-vars.el -*- no-byte-compile: t -*-
+(define-package "js2-highlight-vars" "20170418.1829" "highlight occurrences of the variable under cursor" '((emacs "24.4") (js2-mode "20150908")) :commit "e3bb177e50f76b272e8073a94d4f46be6512a163" :authors '(("Mihai Bazon" . "mihai.bazon@gmail.com")) :maintainer '("Mihai Bazon" . "mihai.bazon@gmail.com") :url "http://mihai.bazon.net/projects/editing-javascript-with-emacs-js2-mode/js2-highlight-vars-mode")
diff --git a/elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars.el b/elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars.el
new file mode 100644
index 0000000..5eb754c
--- /dev/null
+++ b/elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars.el
@@ -0,0 +1,210 @@
+;;; js2-highlight-vars.el --- highlight occurrences of the variable under cursor
+
+;; Copyright (C) 2009 Free Software Foundation, Inc.
+;; Author: Mihai Bazon <mihai.bazon@gmail.com>
+;; Version: 0.1.0
+;; Package-Version: 20170418.1829
+;; Package-Commit: e3bb177e50f76b272e8073a94d4f46be6512a163
+;; URL: http://mihai.bazon.net/projects/editing-javascript-with-emacs-js2-mode/js2-highlight-vars-mode
+;; Package-Requires: ((emacs "24.4") (js2-mode "20150908"))
+
+;;; Commentary:
+;;
+;; This is a minor mode on top of js2-mode which highlights all
+;; occurrences of the variable under the cursor within its defining
+;; scope.
+
+;;; Installation:
+;;
+;; Install this package from MELPA using `M-x install-package` and put
+;; the following in your ~/.emacs.d/init.el:
+;; (eval-after-load "js2-highlight-vars-autoloads"
+;; '(add-hook 'js2-mode-hook (lambda () (js2-highlight-vars-mode))))
+;;
+;; If you aren't already using MELPA, see:
+;; http://melpa.milkbox.net/#/getting-started
+
+;; 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 <http://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'js2-mode)
+
+(js2-deflocal js2-highlight-vars-mode nil)
+
+(defface js2-highlight-vars-face
+ `((((class color) (background light))
+ (:background "light green"))
+ (((class color) (background dark))
+ (:background "royal blue")))
+ "Face for highlighting variables"
+ :group 'js2-mode)
+
+(defface js2-highlight-vars-second-face
+ `((((class color) (background light))
+ (:background "light pink"))
+ (((class color) (background dark))
+ (:background "blue violet")))
+ "Face for highlighting variables"
+ :group 'js2-mode)
+
+(defvar js2-highlight-vars-local-keymap
+ (let ((map (make-sparse-keymap)))
+ (define-key map (kbd "M-n") 'js2-highlight-vars-next)
+ (define-key map (kbd "C-<down>") 'js2-highlight-vars-next)
+ (define-key map (kbd "M-p") 'js2-highlight-vars-prev)
+ (define-key map (kbd "C-<up>") 'js2-highlight-vars-prev)
+ (define-key map (kbd "M-r") 'js2-highlight-vars-rename)
+ map))
+
+(js2-deflocal js2--highlight-vars-tokens nil)
+(js2-deflocal js2--highlight-vars-current-token nil)
+(js2-deflocal js2--highlight-vars-current-token-name nil)
+(js2-deflocal js2--highlight-vars-post-command-timer nil)
+
+(defun js2--do-highlight-vars ()
+ "Highlight variable under cursor within the defining scope"
+ (interactive)
+ (setq js2--highlight-vars-post-command-timer nil)
+ (unless js2--highlight-vars-tokens
+ (let ((node (js2-node-at-point))
+ (tokens nil)
+ name
+ scope)
+ (unless (js2-name-node-p node)
+ (setq node (js2-node-at-point (- (point) 1))))
+ (when (and node (js2-name-node-p node))
+ (setq scope (js2-node-get-enclosing-scope node)
+ name (js2-name-node-name node)
+ js2--highlight-vars-current-token (js2-node-abs-pos node)
+ js2--highlight-vars-current-token-name name)
+ (setq scope (js2-get-defining-scope scope name))
+ (with-silent-modifications
+ (js2-visit-ast
+ scope
+ (lambda (node end-p)
+ (when (and (not end-p)
+ (js2-name-node-p node)
+ (string= name (js2-name-node-name node)))
+ (let* ((beg (js2-node-abs-pos node))
+ (end (+ beg (js2-node-len node)))
+ (new-scope (js2-node-get-enclosing-scope node))
+ (new-scope (js2-get-defining-scope new-scope name))
+ (ovl (make-overlay beg end)))
+ (add-to-list 'tokens beg t)
+ (overlay-put ovl 'keymap js2-highlight-vars-local-keymap)
+ (overlay-put ovl 'face
+ (if (eq new-scope scope)
+ 'js2-highlight-vars-face
+ 'js2-highlight-vars-second-face))
+ (overlay-put ovl 'evaporate t)
+ (overlay-put ovl 'js2-highlight-vars t)))
+ t)))
+ (setq js2--highlight-vars-tokens tokens)))))
+
+(defun js2-highlight-vars-next ()
+ (interactive)
+ (let ((inhibit-point-motion-hooks t)
+ (diff (- (point) js2--highlight-vars-current-token))
+ (next (catch 'done
+ (dolist (pos js2--highlight-vars-tokens)
+ (when (> pos (point))
+ (throw 'done pos))))))
+ (when next
+ (setq js2--highlight-vars-current-token next)
+ (goto-char next)
+ (forward-char diff))))
+
+(defun js2-highlight-vars-prev ()
+ (interactive)
+ (let ((inhibit-point-motion-hooks t)
+ (diff (- (point) js2--highlight-vars-current-token))
+ (prev (catch 'done
+ (dolist (pos (reverse js2--highlight-vars-tokens))
+ (when (and (< pos (point))
+ (not (= pos js2--highlight-vars-current-token)))
+ (throw 'done pos))))))
+ (when prev
+ (setq js2--highlight-vars-current-token prev)
+ (goto-char prev)
+ (forward-char diff))))
+
+(defun js2-highlight-vars-rename (new-name)
+ (interactive "*sRename variable to: ")
+ (let ((len (length js2--highlight-vars-current-token-name))
+ (inhibit-point-motion-hooks t)
+ (ovl (make-overlay 1 1))
+ (all nil)
+ doit)
+ (unwind-protect
+ (progn
+ (overlay-put ovl 'face 'highlight)
+ (dolist (pos (mapcar (lambda(pos)
+ (let ((m (make-marker)))
+ (set-marker m pos))) js2--highlight-vars-tokens))
+ (goto-char pos)
+ (move-overlay ovl pos (+ pos len))
+ (setq doit (if all
+ ?y
+ (read-char "Replace this occurrence? (y/n/!)")))
+ (when (= doit ?!)
+ (setq all t
+ doit ?y))
+ (when (= doit ?y)
+ (insert new-name)
+ (delete-char len))))
+ (delete-overlay ovl))))
+
+(defun js2--unhighlight-vars (&rest ignore)
+ (setq js2--highlight-vars-tokens nil
+ js2--highlight-vars-current-token nil)
+ (remove-overlays (point-min) (point-max)
+ 'js2-highlight-vars t))
+
+(defun js2-highlight-vars-post-command-hook ()
+ (ignore-errors
+ (let* ((overlays (overlays-at (point)))
+ (ovl (and overlays
+ (catch 'found
+ (dolist (ovl overlays)
+ (when (overlay-get ovl 'js2-highlight-vars)
+ (throw 'found ovl)))
+ nil))))
+ (if (and ovl
+ (string= js2--highlight-vars-current-token-name
+ (buffer-substring (overlay-start ovl)
+ (overlay-end ovl))))
+ (setq js2--highlight-vars-current-token (overlay-start ovl))
+ (js2--unhighlight-vars)
+ (when js2--highlight-vars-post-command-timer
+ (cancel-timer js2--highlight-vars-post-command-timer))
+ (setq js2--highlight-vars-post-command-timer
+ (run-with-timer 0.5 nil 'js2--do-highlight-vars))))))
+
+;;;###autoload
+(define-minor-mode js2-highlight-vars-mode
+ "Minor mode that highlights occurrences of the variable under
+cursor in js2-mode buffers"
+ nil " vars" nil
+ (if js2-highlight-vars-mode
+ (progn
+ (add-hook 'post-command-hook 'js2-highlight-vars-post-command-hook nil t))
+ (remove-hook 'post-command-hook 'js2-highlight-vars-post-command-hook t)
+ (js2--unhighlight-vars)
+ (kill-local-variable js2--highlight-vars-tokens)
+ (kill-local-variable js2--highlight-vars-current-token)))
+
+(provide 'js2-highlight-vars)
+
+;;; js2-highlight-vars.el ends here
diff --git a/elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars.elc b/elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars.elc
new file mode 100644
index 0000000..ab4a560
--- /dev/null
+++ b/elpa/js2-highlight-vars-20170418.1829/js2-highlight-vars.elc
Binary files differ
diff --git a/elpa/js2-mode-20220402.2211/js2-imenu-extras.el b/elpa/js2-mode-20220402.2211/js2-imenu-extras.el
new file mode 100644
index 0000000..3ec1ba8
--- /dev/null
+++ b/elpa/js2-mode-20220402.2211/js2-imenu-extras.el
@@ -0,0 +1,518 @@
+;;; js2-imenu-extras.el --- Imenu support for additional constructs -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2014 Free Software Foundation, Inc.
+
+;; Author: Dmitry Gutov <dgutov@yandex.ru>
+;; Keywords: languages, javascript, imenu
+
+;; 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 <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This package adds Imenu support for additional framework constructs and
+;; structural patterns to `js2-mode'.
+
+;; Usage:
+
+;; (add-hook 'js2-mode-hook 'js2-imenu-extras-mode)
+
+;; To customize how it works:
+;; M-x customize-group RET js2-imenu RET
+
+(require 'cl-lib)
+(require 'js2-mode)
+
+(eval-when-compile
+ (when (<= emacs-major-version 26)
+ (require 'subr-x)))
+
+(defvar js2-imenu-extension-styles
+ `((:framework jquery
+ :call-re "\\_<\\(?:jQuery\\|\\$\\|_\\)\\.extend\\s-*("
+ :recorder js2-imenu-record-jquery-extend)
+
+ (:framework jquery-ui
+ :call-re "^\\s-*\\(?:jQuery\\|\\$\\)\\.widget\\s-*("
+ :recorder js2-imenu-record-string-declare)
+
+ (:framework dojo
+ :call-re "^\\s-*dojo.declare\\s-*("
+ :recorder js2-imenu-record-string-declare)
+
+ (:framework backbone
+ :call-re ,(concat "\\_<" js2-mode-identifier-re "\\.extend\\s-*(")
+ :recorder js2-imenu-record-backbone-extend)
+
+ (:framework enyo
+ :call-re "\\_<enyo\\.kind\\s-*("
+ :recorder js2-imenu-record-enyo-kind)
+
+ (:framework react
+ :call-re "\\_<React\\.createClass\\s-*("
+ :recorder js2-imenu-record-react-class)
+
+ (:framework mocha
+ :call-re ,(rx line-start
+ (* (syntax whitespace))
+ (or "describe" "fdescribe" "describe.only")
+ (* (syntax whitespace))
+ "(")
+ :recorder js2-imenu-record-mocha-describe)
+
+ (:framework sencha
+ :call-re "^\\s-*Ext\\.define\\s-*("
+ :recorder js2-imenu-record-sencha-class))
+ "List of JavaScript class definition or extension styles.
+
+:framework is a valid value in `js2-imenu-enabled-frameworks'.
+
+:call-re is a regular expression that has no capturing groups.
+
+:recorder is a function name that will be called when the regular
+expression matches some text in the buffer. When it's called, point will be
+at the end of the match. The function must keep the point position.")
+
+(defconst js2-imenu-available-frameworks
+ (mapcar (lambda (style) (plist-get style :framework)) js2-imenu-extension-styles)
+ "List of available JavaScript framework symbols.")
+
+(defcustom js2-imenu-enabled-frameworks js2-imenu-available-frameworks
+ "Frameworks to be recognized by `js2-mode'."
+ :type (cons 'set (mapcar (lambda (x) (list 'const x))
+ js2-imenu-available-frameworks))
+ :group 'js2-imenu)
+
+(defcustom js2-imenu-show-other-functions t
+ "Non-nil to show functions not recognized by other mechanisms,
+in a shared namespace."
+ :type 'boolean
+ :group 'js2-imenu)
+
+(defcustom js2-imenu-other-functions-ns "?"
+ "Namespace name to use for other functions."
+ :type 'string
+ :group 'js2-imenu)
+
+(defcustom js2-imenu-show-module-pattern t
+ "Non-nil to recognize the module pattern:
+
+var foobs = (function(a) {
+ return {fib: function() {}, fub: function() {}};
+})(b);
+
+We record the returned hash as belonging to the named module, and
+prefix any functions defined inside the IIFE with the module name."
+ :type 'boolean
+ :group 'js2-imenu)
+
+(defcustom js2-imenu-split-string-identifiers t
+ "When non-nil, split string identifiers on dots.
+Currently used for jQuery widgets, Dojo and Enyo declarations."
+ :type 'boolean
+ :group 'js2-imenu)
+
+(defcustom js2-imenu-mocha-describe-node-names '("describe" "describe.only" "fdescribe")
+ "List of strings starting a describe() node."
+ :type '(repeat string)
+ :group 'js2-imenu)
+
+(defcustom js2-imenu-mocha-it-node-names '("it" "it.only" "fit")
+ "List of strings starting a it() node."
+ :type '(repeat string)
+ :group 'js2-imenu)
+
+(defcustom js2-imenu-mocha-hook-node-names '("beforeEach" "afterEach" "beforeAll" "afterAll")
+ "List of strings starting a hook node (e.g., before and after hooks)."
+ :type '(repeat string)
+ :group 'js2-imenu)
+
+;;;###autoload
+(defun js2-imenu-extras-setup ()
+ (when js2-imenu-enabled-frameworks
+ (add-hook 'js2-build-imenu-callbacks 'js2-imenu-record-declarations t t))
+ (when (or js2-imenu-show-other-functions js2-imenu-show-module-pattern)
+ (add-hook 'js2-build-imenu-callbacks 'js2-imenu-walk-ast t t)))
+
+(defun js2-imenu-extras-remove ()
+ (remove-hook 'js2-build-imenu-callbacks 'js2-imenu-record-declarations t)
+ (remove-hook 'js2-build-imenu-callbacks 'js2-imenu-walk-ast t))
+
+(defun js2-imenu-record-declarations ()
+ (let* ((styles (cl-loop for style in js2-imenu-extension-styles
+ when (memq (plist-get style :framework)
+ js2-imenu-enabled-frameworks)
+ collect style))
+ (re (mapconcat (lambda (style)
+ (concat "\\(" (plist-get style :call-re) "\\)"))
+ styles "\\|")))
+ (goto-char (point-min))
+ (while (js2-re-search-forward re nil t)
+ (cl-loop for i from 0 to (1- (length styles))
+ when (match-beginning (1+ i))
+ return (funcall (plist-get (nth i styles) :recorder))))))
+
+(defun js2-imenu-record-jquery-extend ()
+ (let ((pred (lambda (subject)
+ (and
+ (js2-prop-get-node-p subject)
+ (string= (js2-name-node-name (js2-prop-get-node-right subject))
+ "prototype")))))
+ (js2-imenu-record-extend-first-arg (1- (point)) pred
+ 'js2-compute-nested-prop-get)))
+
+(defun js2-imenu-record-string-declare ()
+ (js2-imenu-record-extend-first-arg
+ (1- (point)) 'js2-string-node-p
+ (lambda (node)
+ (if js2-imenu-split-string-identifiers
+ (split-string (js2-string-node-value node) "\\." t)
+ (list (js2-string-node-value node))))))
+
+(defun js2-imenu-record-extend-first-arg (point pred qname-fn)
+ (let* ((node (js2-node-at-point point))
+ (args (js2-call-node-args node))
+ (subject (cl-first args)))
+ (when (funcall pred subject)
+ (cl-loop for arg in (cdr args)
+ when (js2-object-node-p arg)
+ do (js2-record-object-literal
+ arg (funcall qname-fn subject) (js2-node-abs-pos arg))))))
+
+(defun js2-imenu-record-backbone-or-react ()
+ (let* ((node (js2-node-at-point (1- (point))))
+ (args (js2-call-node-args node))
+ (methods (cl-first args))
+ (parent (js2-node-parent node)))
+ (when (js2-object-node-p methods)
+ (let ((subject (cond ((js2-var-init-node-p parent)
+ (js2-var-init-node-target parent))
+ ((js2-assign-node-p parent)
+ (js2-assign-node-left parent)))))
+ (when subject
+ (js2-record-object-literal methods
+ (js2-compute-nested-prop-get subject)
+ (js2-node-abs-pos methods)))))))
+
+(defalias 'js2-imenu-record-backbone-extend 'js2-imenu-record-backbone-or-react)
+
+(defalias 'js2-imenu-record-react-class 'js2-imenu-record-backbone-or-react)
+
+(defun js2-imenu-record-enyo-kind ()
+ (let* ((node (js2-node-at-point (1- (point))))
+ (args (js2-call-node-args node))
+ (options (cl-first args)))
+ (when (js2-object-node-p options)
+ (let ((name-value
+ (cl-loop for elem in (js2-object-node-elems options)
+ thereis
+ (let ((key (js2-object-prop-node-left elem))
+ (value (js2-object-prop-node-right elem)))
+ (when (and (equal
+ (cond ((js2-name-node-p key)
+ (js2-name-node-name key))
+ ((js2-string-node-p key)
+ (js2-string-node-value key)))
+ "name")
+ (js2-string-node-p value))
+ (js2-string-node-value value))))))
+ (when name-value
+ (js2-record-object-literal options
+ (if js2-imenu-split-string-identifiers
+ (split-string name-value "\\.")
+ (list name-value))
+ (js2-node-abs-pos options)))))))
+
+(defun js2-imenu-record-sencha-class ()
+ (let* ((node (js2-node-at-point (1- (point))))
+ (args (js2-call-node-args node))
+ (name (cl-first args))
+ (methods (cl-second args)))
+ (when (and (js2-string-node-p name) (js2-object-node-p methods))
+ (let ((name-value (js2-string-node-value name)))
+ (js2-record-object-literal methods
+ (if js2-imenu-split-string-identifiers
+ (split-string name-value "\\." t)
+ (list name-value))
+ (js2-node-abs-pos methods))))))
+
+(defun js2-imenu-record-mocha-describe ()
+ "Populate `js2-imenu-recorder' with mocha-like describe/it/beforeEach/… nodes."
+ (let ((node (js2-node-at-point (1- (point)))))
+ (when (js2-imenu-extras--mocha-top-level-describe-p node)
+ (js2-imenu-extras--mocha-visit-node node (list)))))
+
+(defun js2-imenu-extras--mocha-visit-node (node qname)
+ "Search NODE and its children for mocha test blocks.
+
+If mocha test blocks are found (e.g., a describe() or it() block)
+they are added to `js2-imenu-recorder' with QNAME as prefix.
+
+QNAME is a list of nodes representing the qualified name of
+NODE's parent. If NODE has no parent, QNAME is the empty list.
+The last item of QNAME is NODE's parent name while the item
+before that is NODE's grandparent name etc."
+ (js2-visit-ast
+ node
+ (lambda (child end-p)
+ (when (not end-p)
+ (js2-imenu-extras--mocha-check-unknown-node child qname)))))
+
+(defun js2-imenu-extras--mocha-check-unknown-node (node qname)
+ "If NODE is a mocha test block, populate `js2-imenu-recorder'.
+
+QNAME is the same as described in
+`js2-imenu-extras--mocha-visit-node'."
+ (cond
+ ((js2-imenu-extras--mocha-describe-node-p node)
+ (progn
+ (js2-imenu-extras--mocha-visit-describe-node node qname)
+ nil))
+ ((js2-imenu-extras--mocha-it-node-p node)
+ (progn
+ (js2-imenu-extras--mocha-visit-it-node node qname)
+ nil))
+ ((js2-imenu-extras--mocha-before-after-node-p node)
+ (progn
+ (js2-imenu-extras--mocha-visit-before-after-node node qname)
+ nil))
+ ((js2-imenu-extras--mocha-named-function-node-p node)
+ (progn
+ (js2-imenu-extras--mocha-visit-named-function-node node qname)
+ nil))
+ (t t)))
+
+(defun js2-imenu-extras--mocha-top-level-describe-p (node)
+ "Return non-nil if NODE is a top-level mocha describe() block.
+
+A top-level block is one which isn't included in another mocha
+describe() block."
+ (and (js2-imenu-extras--mocha-describe-node-p node)
+ (not (js2-imenu-extras--mocha-is-or-within-describe-block-p (js2-node-parent node)))))
+
+(defun js2-imenu-extras--mocha-within-describe-block-p (node)
+ "Return non-nil if NODE is within a mocha describe() block."
+ (js2-imenu-extras--mocha-is-or-within-describe-block-p (js2-node-parent node)))
+
+(defun js2-imenu-extras--mocha-is-or-within-describe-block-p (node)
+ "Return non-nil if NODE is a or within a mocha describe() block."
+ (when node
+ (or (js2-imenu-extras--mocha-describe-node-p node)
+ (js2-imenu-extras--mocha-within-describe-block-p node))))
+
+(defun js2-imenu-extras--mocha-describe-node-p (node)
+ "Return non-nil if NODE is a mocha describe() block."
+ (when-let ((name (js2-imenu-extras--call-target-name node)))
+ (member name js2-imenu-mocha-describe-node-names)))
+
+(defun js2-imenu-extras--mocha-it-node-p (node)
+ "Return non-nil if NODE is a mocha it() block."
+ (when-let ((name (js2-imenu-extras--call-target-name node)))
+ (member name js2-imenu-mocha-it-node-names)))
+
+(defun js2-imenu-extras--mocha-before-after-node-p (node)
+ "Return non-nil if NODE is a `{before,after}{Each,All}' block."
+ (when-let ((name (js2-imenu-extras--call-target-name node)))
+ (member name js2-imenu-mocha-hook-node-names)))
+
+(defun js2-imenu-extras--mocha-named-function-node-p (node)
+ "Return non-nil if NODE is a function definition."
+ (and (js2-function-node-p node)
+ (js2-function-name node)))
+
+(defun js2-imenu-extras--mocha-visit-describe-node (node qname)
+ "Record NODE, a mocha describe() block, in imenu.
+Also search and record other mocha blocks within NODE's body.
+
+QNAME is the same as described in
+`js2-imenu-extras--mocha-visit-node'."
+ (let* ((args (js2-call-node-args node))
+ (name (cl-first args))
+ (qname (append qname (list name)))
+ (body (car (last args)))
+ (position (js2-node-abs-pos node)))
+ (js2-record-imenu-entry body qname position)
+ (js2-imenu-extras--mocha-visit-node body qname)))
+
+(defun js2-imenu-extras--mocha-visit-it-node (node qname)
+ "Record NODE, a mocha it() block, in imenu.
+
+QNAME is the same as described in
+`js2-imenu-extras--mocha-visit-node'."
+ (let* ((args (js2-call-node-args node))
+ (name (cl-first args))
+ (qname (append qname (list name)))
+ (body (car (last args)))
+ (position (js2-node-abs-pos node)))
+ (js2-record-imenu-entry body qname position)))
+
+(defun js2-imenu-extras--mocha-visit-before-after-node (node qname)
+ "Record NODE, a mocha {before,after}{Each,All}() block, in imenu.
+
+QNAME is the same as described in
+`js2-imenu-extras--mocha-visit-node'."
+ (let* ((args (js2-call-node-args node))
+ (qname (append qname (list (js2-imenu-extras--call-target-name node))))
+ (body (car (last args)))
+ (position (js2-node-abs-pos node)))
+ (js2-record-imenu-entry body qname position)))
+
+(defun js2-imenu-extras--mocha-visit-named-function-node (node qname)
+ "Record NODE, a function declaration, in imenu.
+
+QNAME is the same as described in
+`js2-imenu-extras--mocha-visit-node'."
+ (let* ((qname (append qname (list (js2-function-name node))))
+ (position (js2-node-abs-pos node)))
+ (js2-record-imenu-entry node qname position)))
+
+(defun js2-imenu-extras--call-target-name (node)
+ "Return the function name, as string, called by NODE.
+If node is not a function call, return nil."
+ (when (js2-call-node-p node)
+ (js2-imenu-extras--string-content (js2-call-node-target node))))
+
+(defun js2-imenu-extras--string-content (node)
+ "Return a string representing the value of NODE."
+ (if (js2-string-node-p node)
+ (js2-string-node-value node)
+ (let ((start (js2-node-abs-pos node)))
+ (buffer-substring-no-properties
+ start
+ (+ start (js2-node-len node))))))
+
+(defun js2-imenu-walk-ast ()
+ (js2-visit-ast
+ js2-mode-ast
+ (lambda (node end-p)
+ (unless end-p
+ (cond
+ ((and js2-imenu-show-other-functions
+ (js2-object-prop-node-p node))
+ (js2-imenu-record-orphan-prop-node-function node))
+ ((js2-assign-node-p node)
+ (cond
+ ((and js2-imenu-show-other-functions
+ (js2-function-node-p
+ (js2-assign-node-right node)))
+ (js2-imenu-record-orphan-assign-node-function
+ (js2-assign-node-left node)
+ (js2-assign-node-right node)))
+ ((and js2-imenu-show-module-pattern
+ (js2-call-node-p
+ (js2-assign-node-right node)))
+ (js2-imenu-record-module-pattern
+ (js2-assign-node-left node)
+ (js2-assign-node-right node)))))
+ ((js2-var-init-node-p node)
+ (cond
+ ((and js2-imenu-show-other-functions
+ (js2-function-node-p
+ (js2-var-init-node-initializer node)))
+ (js2-imenu-record-orphan-assign-node-function
+ (js2-var-init-node-target node)
+ (js2-var-init-node-initializer node)))
+ ((and js2-imenu-show-module-pattern
+ (js2-call-node-p
+ (js2-var-init-node-initializer node)))
+ (js2-imenu-record-module-pattern
+ (js2-var-init-node-target node)
+ (js2-var-init-node-initializer node))))))
+ t))))
+
+(defun js2-imenu-parent-key-names (node)
+ "Get the list of parent key names of NODE.
+
+For example, for code
+
+ {rules: {password: {required: function() {}}}}
+
+when NODE is the inner `js2-object-prop-mode',
+it returns (\"rules\" \"password\")."
+ (let (rlt (n node))
+ (while (setq n (js2-imenu-parent-prop-node n))
+ (push (js2-prop-node-name (js2-object-prop-node-left n)) rlt))
+ rlt))
+
+(defun js2-imenu-parent-prop-node (node)
+ "When the parent of NODE is `js2-object-node',
+and the grandparent is `js2-object-prop-node',
+return the grandparent."
+ ;; Suppose the code is:
+ ;; {parent-key: {required: function() {}}}
+ ;; NODE is `required: function() {}'.
+ (let (p2 p3)
+ ;; Parent is `{required: function() {}}'.
+ (setq p2 (js2-node-parent node))
+ ;; GP is `parent-key: {required: function() {}}'.
+ (when (and p2 (js2-object-node-p p2))
+ (setq p3 (js2-node-parent p2))
+ (if (and p3 (js2-object-prop-node-p p3)) p3))))
+
+(defun js2-imenu-record-orphan-prop-node-function (node)
+ "Record orphan function when it's the value of NODE.
+NODE must be `js2-object-prop-node'."
+ (when (js2-function-node-p (js2-object-prop-node-right node))
+ (let ((fn-node (js2-object-prop-node-right node)))
+ (unless (and js2-imenu-function-map
+ (gethash fn-node js2-imenu-function-map))
+ (let ((key-node (js2-object-prop-node-left node))
+ chain)
+ (setq chain (nconc (js2-imenu-parent-key-names node)
+ (list (js2-prop-node-name key-node))))
+ (push js2-imenu-other-functions-ns chain)
+ (js2-record-imenu-entry fn-node chain
+ (js2-node-abs-pos key-node)))))))
+
+(defun js2-imenu-record-orphan-assign-node-function (target-node fn-node)
+ "Record orphan function FN-NODE assigned to node TARGET."
+ (when (or (not js2-imenu-function-map)
+ (eq 'skip
+ (gethash fn-node js2-imenu-function-map 'skip)))
+ (let ((chain (js2-compute-nested-prop-get target-node)))
+ (when chain
+ (push js2-imenu-other-functions-ns chain)
+ (js2-record-imenu-entry fn-node chain (js2-node-abs-pos fn-node))))))
+
+(defun js2-imenu-record-module-pattern (target init)
+ "Recognize and record module pattern use instance.
+INIT must be `js2-call-node'."
+ (let ((callt (js2-call-node-target init)))
+ ;; Just basic call form: (function() {...})();
+ ;; TODO: Handle variations without duplicating `js2-wrapper-function-p'?
+ (when (and (js2-paren-node-p callt)
+ (js2-function-node-p (js2-paren-node-expr callt)))
+ (let* ((fn (js2-paren-node-expr callt))
+ (blk (js2-function-node-body fn))
+ (ret (car (last (js2-block-node-kids blk)))))
+ (when (and (js2-return-node-p ret)
+ (js2-object-node-p (js2-return-node-retval ret)))
+ ;; TODO: Map function names when revealing module pattern is used.
+ (let ((retval (js2-return-node-retval ret))
+ (target-qname (js2-compute-nested-prop-get target)))
+ (js2-record-object-literal retval target-qname
+ (js2-node-abs-pos retval))
+ (js2-record-imenu-entry fn target-qname
+ (js2-node-abs-pos target))))))))
+
+;;;###autoload
+(define-minor-mode js2-imenu-extras-mode
+ "Toggle Imenu support for frameworks and structural patterns."
+ :lighter ""
+ (if js2-imenu-extras-mode
+ (js2-imenu-extras-setup)
+ (js2-imenu-extras-remove)))
+
+(provide 'js2-imenu-extras)
diff --git a/elpa/js2-mode-20220402.2211/js2-imenu-extras.elc b/elpa/js2-mode-20220402.2211/js2-imenu-extras.elc
new file mode 100644
index 0000000..88b0bb7
--- /dev/null
+++ b/elpa/js2-mode-20220402.2211/js2-imenu-extras.elc
Binary files differ
diff --git a/elpa/js2-mode-20220402.2211/js2-mode-autoloads.el b/elpa/js2-mode-20220402.2211/js2-mode-autoloads.el
new file mode 100644
index 0000000..92c6661
--- /dev/null
+++ b/elpa/js2-mode-20220402.2211/js2-mode-autoloads.el
@@ -0,0 +1,126 @@
+;;; js2-mode-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*-
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "js2-imenu-extras" "js2-imenu-extras.el" (0
+;;;;;; 0 0 0))
+;;; Generated autoloads from js2-imenu-extras.el
+
+(autoload 'js2-imenu-extras-setup "js2-imenu-extras" nil nil nil)
+
+(autoload 'js2-imenu-extras-mode "js2-imenu-extras" "\
+Toggle Imenu support for frameworks and structural patterns.
+
+This is a minor mode. If called interactively, toggle the
+`Js2-Imenu-Extras mode' mode. If the prefix argument is
+positive, enable the mode, and if it is zero or negative, disable
+the mode.
+
+If called from Lisp, toggle the mode if ARG is `toggle'. Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+To check whether the minor mode is enabled in the current buffer,
+evaluate `js2-imenu-extras-mode'.
+
+The mode's hook is called both when the mode is enabled and when
+it is disabled.
+
+\(fn &optional ARG)" t nil)
+
+(register-definition-prefixes "js2-imenu-extras" '("js2-imenu-"))
+
+;;;***
+
+;;;### (autoloads nil "js2-mode" "js2-mode.el" (0 0 0 0))
+;;; Generated autoloads from js2-mode.el
+
+(autoload 'js2-highlight-unused-variables-mode "js2-mode" "\
+Toggle highlight of unused variables.
+
+This is a minor mode. If called interactively, toggle the
+`Js2-Highlight-Unused-Variables mode' mode. If the prefix
+argument is positive, enable the mode, and if it is zero or
+negative, disable the mode.
+
+If called from Lisp, toggle the mode if ARG is `toggle'. Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+To check whether the minor mode is enabled in the current buffer,
+evaluate `js2-highlight-unused-variables-mode'.
+
+The mode's hook is called both when the mode is enabled and when
+it is disabled.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'js2-minor-mode "js2-mode" "\
+Minor mode for running js2 as a background linter.
+This allows you to use a different major mode for JavaScript editing,
+such as `js-mode', while retaining the asynchronous error/warning
+highlighting features of `js2-mode'.
+
+This is a minor mode. If called interactively, toggle the `Js2
+minor mode' mode. If the prefix argument is positive, enable the
+mode, and if it is zero or negative, disable the mode.
+
+If called from Lisp, toggle the mode if ARG is `toggle'. Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+To check whether the minor mode is enabled in the current buffer,
+evaluate `js2-minor-mode'.
+
+The mode's hook is called both when the mode is enabled and when
+it is disabled.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'js2-mode "js2-mode" "\
+Major mode for editing JavaScript code.
+
+\(fn)" t nil)
+
+(autoload 'js2-jsx-mode "js2-mode" "\
+Major mode for editing JSX code in Emacs 26 and earlier.
+
+To edit JSX code in Emacs 27, use `js-mode' as your major mode
+with `js2-minor-mode' enabled.
+
+To customize the indentation for this mode, set the SGML offset
+variables (`sgml-basic-offset' et al) locally, like so:
+
+ (defun set-jsx-indentation ()
+ (setq-local sgml-basic-offset js2-basic-offset))
+ (add-hook \\='js2-jsx-mode-hook #\\='set-jsx-indentation)
+
+\(fn)" t nil)
+
+(register-definition-prefixes "js2-mode" '("js2-"))
+
+;;;***
+
+;;;### (autoloads nil "js2-old-indent" "js2-old-indent.el" (0 0 0
+;;;;;; 0))
+;;; Generated autoloads from js2-old-indent.el
+
+(register-definition-prefixes "js2-old-indent" '("js2-"))
+
+;;;***
+
+;;;### (autoloads nil nil ("js2-mode-pkg.el") (0 0 0 0))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; js2-mode-autoloads.el ends here
diff --git a/elpa/js2-mode-20220402.2211/js2-mode-pkg.el b/elpa/js2-mode-20220402.2211/js2-mode-pkg.el
new file mode 100644
index 0000000..daaa4a8
--- /dev/null
+++ b/elpa/js2-mode-20220402.2211/js2-mode-pkg.el
@@ -0,0 +1,15 @@
+(define-package "js2-mode" "20220402.2211" "Improved JavaScript editing mode"
+ '((emacs "24.1")
+ (cl-lib "0.5"))
+ :commit "fed41615b26404e0bfd7e4f64643981ca798a34b" :authors
+ '(("Steve Yegge" . "steve.yegge@gmail.com")
+ ("mooz" . "stillpedant@gmail.com")
+ ("Dmitry Gutov" . "dgutov@yandex.ru"))
+ :maintainer
+ '("Steve Yegge" . "steve.yegge@gmail.com")
+ :keywords
+ '("languages" "javascript")
+ :url "https://github.com/mooz/js2-mode/")
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/elpa/js2-mode-20220402.2211/js2-mode.el b/elpa/js2-mode-20220402.2211/js2-mode.el
new file mode 100644
index 0000000..65241ad
--- /dev/null
+++ b/elpa/js2-mode-20220402.2211/js2-mode.el
@@ -0,0 +1,13090 @@
+;;; js2-mode.el --- Improved JavaScript editing mode -*- lexical-binding: t -*-
+
+;; Copyright (C) 2009, 2011-2021 Free Software Foundation, Inc.
+
+;; Author: Steve Yegge <steve.yegge@gmail.com>
+;; mooz <stillpedant@gmail.com>
+;; Dmitry Gutov <dgutov@yandex.ru>
+;; URL: https://github.com/mooz/js2-mode/
+;; http://code.google.com/p/js2-mode/
+;; Version: 20211229
+;; Keywords: languages, javascript
+;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
+
+;; 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 <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This JavaScript editing mode supports:
+
+;; - strict recognition of the Ecma-262 language standard
+;; - support for most Rhino and SpiderMonkey extensions from 1.5 and up
+;; - parsing support for ECMAScript for XML (E4X, ECMA-357)
+;; - accurate syntax highlighting using a recursive-descent parser
+;; - on-the-fly reporting of syntax errors and strict-mode warnings
+;; - undeclared-variable warnings using a configurable externs framework
+;; - "bouncing" line indentation to choose among alternate indentation points
+;; - smart line-wrapping within comments and strings
+;; - code folding:
+;; - show some or all function bodies as {...}
+;; - show some or all block comments as /*...*/
+;; - context-sensitive menu bar and popup menus
+;; - code browsing using the `imenu' package
+;; - many customization options
+
+;; Installation:
+;;
+;; To install it as your major mode for JavaScript editing:
+
+;; (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
+
+;; Alternatively, to install it as a minor mode just for JavaScript linting,
+;; you must add it to the appropriate major-mode hook. Normally this would be:
+
+;; (add-hook 'js-mode-hook 'js2-minor-mode)
+
+;; You may also want to hook it in for shell scripts running via node.js:
+
+;; (add-to-list 'interpreter-mode-alist '("node" . js2-mode))
+
+;; Use Emacs 27 and want to write JSX? Then use `js2-minor-mode' as described
+;; above. Use Emacs 26 or earlier? Then use `js2-jsx-mode':
+
+;; (add-to-list 'auto-mode-alist '("\\.jsx?\\'" . js2-jsx-mode))
+;; (add-to-list 'interpreter-mode-alist '("node" . js2-jsx-mode))
+
+;; Note that linting of JSX code may fail in both modes.
+
+;; To customize how it works:
+;; M-x customize-group RET js2-mode RET
+
+;; Notes:
+
+;; This mode includes a port of Mozilla Rhino's scanner, parser and
+;; symbol table. Ideally it should stay in sync with Rhino, keeping
+;; `js2-mode' current as the EcmaScript language standard evolves.
+
+;; Unlike cc-engine based language modes, js2-mode's line-indentation is not
+;; customizable. It is a surprising amount of work to support customizable
+;; indentation. The current compromise is that the tab key lets you cycle among
+;; various likely indentation points, similar to the behavior of python-mode.
+
+;; This mode does not yet work with "multi-mode" modes such as `mmm-mode'
+;; and `mumamo', although it could be made to do so with some effort.
+;; This means that `js2-mode' is currently only useful for editing JavaScript
+;; files, and not for editing JavaScript within <script> tags or templates.
+
+;; The project page on GitHub is used for development and issue tracking.
+;; The original homepage at Google Code has outdated information and is mostly
+;; unmaintained.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'imenu)
+(require 'js)
+(require 'etags)
+
+(eval-and-compile
+ (if (version< emacs-version "25.0")
+ (require 'js2-old-indent)
+ (defvaralias 'js2-basic-offset 'js-indent-level nil)
+ (defalias 'js2-proper-indentation 'js--proper-indentation)
+ (defalias 'js2-jsx-indent-line 'js-jsx-indent-line)
+ (defalias 'js2-indent-line 'js-indent-line)
+ (defalias 'js2-re-search-forward 'js--re-search-forward)))
+
+;;; Externs (variables presumed to be defined by the host system)
+
+(defvar js2-ecma-262-externs
+ (mapcar 'symbol-name
+ '(Array Boolean Date Error EvalError Function Infinity JSON
+ Math NaN Number Object RangeError ReferenceError RegExp
+ String SyntaxError TypeError URIError
+ decodeURI decodeURIComponent encodeURI
+ encodeURIComponent escape eval isFinite isNaN
+ parseFloat parseInt undefined unescape))
+"Ecma-262 externs. Never highlighted as undeclared variables.")
+
+(defvar js2-browser-externs
+ (mapcar 'symbol-name
+ '(;; DOM level 1
+ Attr CDATASection CharacterData Comment DOMException
+ DOMImplementation Document DocumentFragment
+ DocumentType Element Entity EntityReference
+ ExceptionCode NamedNodeMap Node NodeList Notation
+ ProcessingInstruction Text
+
+ ;; DOM level 2
+ HTMLAnchorElement HTMLAppletElement HTMLAreaElement
+ HTMLBRElement HTMLBaseElement HTMLBaseFontElement
+ HTMLBodyElement HTMLButtonElement HTMLCollection
+ HTMLDListElement HTMLDirectoryElement HTMLDivElement
+ HTMLDocument HTMLElement HTMLFieldSetElement
+ HTMLFontElement HTMLFormElement HTMLFrameElement
+ HTMLFrameSetElement HTMLHRElement HTMLHeadElement
+ HTMLHeadingElement HTMLHtmlElement HTMLIFrameElement
+ HTMLImageElement HTMLInputElement HTMLIsIndexElement
+ HTMLLIElement HTMLLabelElement HTMLLegendElement
+ HTMLLinkElement HTMLMapElement HTMLMenuElement
+ HTMLMetaElement HTMLModElement HTMLOListElement
+ HTMLObjectElement HTMLOptGroupElement
+ HTMLOptionElement HTMLOptionsCollection
+ HTMLParagraphElement HTMLParamElement HTMLPreElement
+ HTMLQuoteElement HTMLScriptElement HTMLSelectElement
+ HTMLStyleElement HTMLTableCaptionElement
+ HTMLTableCellElement HTMLTableColElement
+ HTMLTableElement HTMLTableRowElement
+ HTMLTableSectionElement HTMLTextAreaElement
+ HTMLTitleElement HTMLUListElement
+
+ ;; DOM level 3
+ DOMConfiguration DOMError DOMException
+ DOMImplementationList DOMImplementationSource
+ DOMLocator DOMStringList NameList TypeInfo
+ UserDataHandler
+
+ ;; Window
+ window alert confirm document java navigator prompt screen
+ self top requestAnimationFrame cancelAnimationFrame
+
+ ;; Window or WorkerGlobalScope with support in Chromium and Firefox:
+ ;; https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope
+ ;; properties
+ caches indexedDB isSecureContext origin
+ ;; methods
+ atob btoa clearInterval clearTimeout
+ createImageBitmap fetch queueMicrotask setInterval
+ setTimeout
+
+ ;; from jslint "browser"
+ history location
+
+ ;; HTML element constructors
+ Audio Image Option
+
+ ;; W3C CSS
+ CSSCharsetRule CSSFontFace CSSFontFaceRule
+ CSSImportRule CSSMediaRule CSSPageRule
+ CSSPrimitiveValue CSSProperties CSSRule CSSRuleList
+ CSSStyleDeclaration CSSStyleRule CSSStyleSheet
+ CSSValue CSSValueList Counter DOMImplementationCSS
+ DocumentCSS DocumentStyle ElementCSSInlineStyle
+ LinkStyle MediaList RGBColor Rect StyleSheet
+ StyleSheetList ViewCSS
+
+ ;; W3C Event
+ EventListener EventTarget Event DocumentEvent UIEvent
+ MouseEvent MutationEvent KeyboardEvent
+
+ ;; W3C Range
+ DocumentRange Range RangeException
+
+ ;; W3C XML
+ XPathResult XMLHttpRequest
+
+ ;; console object. Provided by at least Chrome and Firefox.
+ console))
+ "Browser externs.
+You can cause these to be included or excluded with the custom
+variable `js2-include-browser-externs'.")
+
+(defvar js2-rhino-externs
+ (mapcar 'symbol-name
+ '(Packages importClass importPackage com org java
+ ;; Global object (shell) externs.
+ defineClass deserialize doctest gc help load
+ loadClass print quit readFile readUrl runCommand seal
+ serialize spawn sync toint32 version))
+ "Mozilla Rhino externs.
+Set `js2-include-rhino-externs' to t to include them.")
+
+(defvar js2-node-externs
+ (mapcar 'symbol-name
+ '(__dirname __filename Buffer clearInterval clearTimeout require
+ console exports global module process setInterval setTimeout
+ querystring setImmediate clearImmediate))
+ "Node.js externs.
+Set `js2-include-node-externs' to t to include them.")
+
+(defvar js2-typed-array-externs
+ (mapcar 'symbol-name
+ '(ArrayBuffer Uint8ClampedArray DataView
+ Int8Array Uint8Array Int16Array Uint16Array Int32Array Uint32Array
+ Float32Array Float64Array))
+ "Khronos typed array externs. Available in most modern browsers and
+in node.js >= 0.6. If `js2-include-node-externs' or `js2-include-browser-externs'
+are enabled, these will also be included.")
+
+(defvar js2-harmony-externs
+ (mapcar 'symbol-name
+ '(Map Promise Proxy Reflect Set Symbol WeakMap WeakSet))
+ "ES6 externs. If `js2-include-browser-externs' is enabled and
+`js2-language-version' is sufficiently high, these will be included.")
+
+;;; Variables
+
+(defcustom js2-ignored-warnings nil
+ "A list of warning message types that will not be reported.
+
+Possible values are the keys of `js2-message-table'."
+ :group 'js2-mode
+ :type '(repeat string))
+
+(defcustom js2-highlight-level 2
+ "Amount of syntax highlighting to perform.
+0 or a negative value means none.
+1 adds basic syntax highlighting.
+2 adds highlighting of some Ecma built-in properties.
+3 adds highlighting of many Ecma built-in functions."
+ :group 'js2-mode
+ :type '(choice (const :tag "None" 0)
+ (const :tag "Basic" 1)
+ (const :tag "Include Properties" 2)
+ (const :tag "Include Functions" 3)))
+
+(defvar js2-mode-dev-mode-p nil
+ "Non-nil if running in development mode. Normally nil.")
+
+(defgroup js2-mode nil
+ "An improved JavaScript mode."
+ :group 'languages)
+
+(defcustom js2-idle-timer-delay 0.2
+ "Delay in secs before re-parsing after user makes changes.
+Multiplied by `js2-dynamic-idle-timer-adjust', which see."
+ :type 'number
+ :group 'js2-mode)
+(make-variable-buffer-local 'js2-idle-timer-delay)
+
+(defcustom js2-dynamic-idle-timer-adjust 0
+ "Positive to adjust `js2-idle-timer-delay' based on file size.
+The idea is that for short files, parsing is faster so we can be
+more responsive to user edits without interfering with editing.
+The buffer length in characters (typically bytes) is divided by
+this value and used to multiply `js2-idle-timer-delay' for the
+buffer. For example, a 21k file and 10k adjust yields 21k/10k
+== 2, so js2-idle-timer-delay is multiplied by 2.
+If `js2-dynamic-idle-timer-adjust' is 0 or negative,
+`js2-idle-timer-delay' is not dependent on the file size."
+ :type 'number
+ :group 'js2-mode)
+
+(defcustom js2-concat-multiline-strings t
+ "When non-nil, `js2-line-break' in mid-string will make it a
+string concatenation. When `eol', the `+' will be inserted at the
+end of the line, otherwise, at the beginning of the next line."
+ :type '(choice (const t) (const eol) (const nil))
+ :group 'js2-mode)
+
+(defcustom js2-mode-show-parse-errors t
+ "True to highlight parse errors."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-mode-assume-strict nil
+ "Non-nil to start files in strict mode automatically."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-mode-show-strict-warnings t
+ "Non-nil to emit Ecma strict-mode warnings.
+Some of the warnings can be individually disabled by other flags,
+even if this flag is non-nil."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-strict-trailing-comma-warning nil
+ "Non-nil to warn about trailing commas in array literals.
+Ecma-262-5.1 allows them, but older versions of IE raise an error."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-strict-missing-semi-warning t
+ "Non-nil to warn about semicolon auto-insertion after statement.
+Technically this is legal per Ecma-262, but some style guides disallow
+depending on it."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-missing-semi-one-line-override nil
+ "Non-nil to permit missing semicolons in one-line functions.
+In one-liner functions such as `function identity(x) {return x}'
+people often omit the semicolon for a cleaner look. If you are
+such a person, you can suppress the missing-semicolon warning
+by setting this variable to t."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-strict-inconsistent-return-warning t
+ "Non-nil to warn about mixing returns with value-returns.
+It's perfectly legal to have a `return' and a `return foo' in the
+same function, but it's often an indicator of a bug, and it also
+interferes with type inference (in systems that support it.)"
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-strict-cond-assign-warning t
+ "Non-nil to warn about usage like `if (a = b)'.
+This often should have been `==' instead of `='. If the warning
+is enabled, you can suppress it on a per-expression basis by
+parenthesizing the expression, e.g., `if ((a = b)) ...'."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-strict-var-redeclaration-warning t
+ "Non-nil to warn about redeclaring variables in a script or function."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-strict-var-hides-function-arg-warning t
+ "Non-nil to warn about a var decl hiding a function argument."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-skip-preprocessor-directives nil
+ "Non-nil to treat lines beginning with # as comments.
+Useful for viewing Mozilla JavaScript source code."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-language-version 200
+ "Configures what JavaScript language version to recognize.
+Currently versions 150, 160, 170, 180 and 200 are supported,
+corresponding to JavaScript 1.5, 1.6, 1.7, 1.8 and 2.0 (Harmony),
+respectively. In a nutshell, 1.6 adds E4X support, 1.7 adds let,
+yield, and Array comprehensions, and 1.8 adds function closures."
+ :type 'integer
+ :group 'js2-mode)
+
+(defcustom js2-instanceof-has-side-effects nil
+ "If non-nil, treats the instanceof operator as having side effects.
+This is useful for xulrunner apps."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-getprop-has-side-effects nil
+ "If non-nil, treats the getprop operator as having side effects.
+This is useful for testing libraries with nontrivial getters and for
+compilers that use empty getprops to declare interface properties."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-move-point-on-right-click t
+ "Non-nil to move insertion point when you right-click.
+This makes right-click context menu behavior a bit more intuitive,
+since menu operations generally apply to the point. The exception
+is if there is a region selection, in which case the point does -not-
+move, so cut/copy/paste can work properly.
+
+Note that IntelliJ moves the point, and Eclipse leaves it alone,
+so this behavior is customizable."
+ :group 'js2-mode
+ :type 'boolean)
+
+(defcustom js2-allow-rhino-new-expr-initializer t
+ "Non-nil to support a Rhino's experimental syntactic construct.
+
+Rhino supports the ability to follow a `new' expression with an object
+literal, which is used to set additional properties on the new object
+after calling its constructor. Syntax:
+
+ new <expr> [ ( arglist ) ] [initializer]
+
+Hence, this expression:
+
+ new Object {a: 1, b: 2}
+
+results in an Object with properties a=1 and b=2. This syntax is
+apparently not configurable in Rhino - it's currently always enabled,
+as of Rhino version 1.7R2."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-allow-member-expr-as-function-name nil
+ "Non-nil to support experimental Rhino syntax for function names.
+
+Rhino supports an experimental syntax configured via the Rhino Context
+setting `allowMemberExprAsFunctionName'. The experimental syntax is:
+
+ function <member-expr> ( [ arg-list ] ) { <body> }
+
+Where member-expr is a non-parenthesized `member expression', which
+is anything at the grammar level of a new-expression or lower, meaning
+any expression that does not involve infix or unary operators.
+
+When <member-expr> is not a simple identifier, then it is syntactic
+sugar for assigning the anonymous function to the <member-expr>. Hence,
+this code:
+
+ function a.b().c[2] (x, y) { ... }
+
+is rewritten as:
+
+ a.b().c[2] = function(x, y) {...}
+
+which doesn't seem particularly useful, but Rhino permits it."
+ :type 'boolean
+ :group 'js2-mode)
+
+;; scanner variables
+
+(defmacro js2-deflocal (name value &optional comment)
+ "Define a buffer-local variable NAME with VALUE and COMMENT."
+ (declare (debug defvar) (doc-string 3))
+ `(progn
+ (defvar ,name ,value ,comment)
+ (make-variable-buffer-local ',name)))
+
+(defvar js2-EOF_CHAR -1
+ "Represents end of stream. Distinct from js2-EOF token type.")
+
+;; I originally used symbols to represent tokens, but Rhino uses
+;; ints and then sets various flag bits in them, so ints it is.
+;; The upshot is that we need a `js2-' prefix in front of each name.
+(defvar js2-ERROR -1)
+(defvar js2-EOF 0)
+(defvar js2-EOL 1)
+(defvar js2-ENTERWITH 2) ; begin interpreter bytecodes
+(defvar js2-LEAVEWITH 3)
+(defvar js2-RETURN 4)
+(defvar js2-GOTO 5)
+(defvar js2-IFEQ 6)
+(defvar js2-IFNE 7)
+(defvar js2-SETNAME 8)
+(defvar js2-BITOR 9)
+(defvar js2-BITXOR 10)
+(defvar js2-BITAND 11)
+(defvar js2-EQ 12)
+(defvar js2-NE 13)
+(defvar js2-LT 14)
+(defvar js2-LE 15)
+(defvar js2-GT 16)
+(defvar js2-GE 17)
+(defvar js2-LSH 18)
+(defvar js2-RSH 19)
+(defvar js2-URSH 20)
+(defvar js2-ADD 21) ; infix plus
+(defvar js2-SUB 22) ; infix minus
+(defvar js2-MUL 23)
+(defvar js2-DIV 24)
+(defvar js2-MOD 25)
+(defvar js2-NOT 26)
+(defvar js2-BITNOT 27)
+(defvar js2-POS 28) ; unary plus
+(defvar js2-NEG 29) ; unary minus
+(defvar js2-NEW 30)
+(defvar js2-DELPROP 31)
+(defvar js2-TYPEOF 32)
+(defvar js2-GETPROP 33)
+(defvar js2-GETPROPNOWARN 34)
+(defvar js2-SETPROP 35)
+(defvar js2-GETELEM 36)
+(defvar js2-SETELEM 37)
+(defvar js2-CALL 38)
+(defvar js2-NAME 39) ; an identifier
+(defvar js2-NUMBER 40)
+(defvar js2-STRING 41)
+(defvar js2-NULL 42)
+(defvar js2-THIS 43)
+(defvar js2-FALSE 44)
+(defvar js2-TRUE 45)
+(defvar js2-SHEQ 46) ; shallow equality (===)
+(defvar js2-SHNE 47) ; shallow inequality (!==)
+(defvar js2-REGEXP 48)
+(defvar js2-BINDNAME 49)
+(defvar js2-THROW 50)
+(defvar js2-RETHROW 51) ; rethrow caught exception: catch (e if ) uses it
+(defvar js2-IN 52)
+(defvar js2-INSTANCEOF 53)
+(defvar js2-LOCAL_LOAD 54)
+(defvar js2-GETVAR 55)
+(defvar js2-SETVAR 56)
+(defvar js2-CATCH_SCOPE 57)
+(defvar js2-ENUM_INIT_KEYS 58) ; FIXME: what are these?
+(defvar js2-ENUM_INIT_VALUES 59)
+(defvar js2-ENUM_INIT_ARRAY 60)
+(defvar js2-ENUM_NEXT 61)
+(defvar js2-ENUM_ID 62)
+(defvar js2-THISFN 63)
+(defvar js2-RETURN_RESULT 64) ; to return previously stored return result
+(defvar js2-ARRAYLIT 65) ; array literal
+(defvar js2-OBJECTLIT 66) ; object literal
+(defvar js2-GET_REF 67) ; *reference
+(defvar js2-SET_REF 68) ; *reference = something
+(defvar js2-DEL_REF 69) ; delete reference
+(defvar js2-REF_CALL 70) ; f(args) = something or f(args)++
+(defvar js2-REF_SPECIAL 71) ; reference for special properties like __proto
+(defvar js2-YIELD 72) ; JS 1.7 yield pseudo keyword
+
+;; XML support
+(defvar js2-DEFAULTNAMESPACE 73)
+(defvar js2-ESCXMLATTR 74)
+(defvar js2-ESCXMLTEXT 75)
+(defvar js2-REF_MEMBER 76) ; Reference for x.@y, x..y etc.
+(defvar js2-REF_NS_MEMBER 77) ; Reference for x.ns::y, x..ns::y etc.
+(defvar js2-REF_NAME 78) ; Reference for @y, @[y] etc.
+(defvar js2-REF_NS_NAME 79) ; Reference for ns::y, @ns::y@[y] etc.
+
+(defvar js2-first-bytecode js2-ENTERWITH)
+(defvar js2-last-bytecode js2-REF_NS_NAME)
+
+(defvar js2-TRY 80)
+(defvar js2-SEMI 81) ; semicolon
+(defvar js2-LB 82) ; left and right brackets
+(defvar js2-RB 83)
+(defvar js2-LC 84) ; left and right curly-braces
+(defvar js2-RC 85)
+(defvar js2-LP 86) ; left and right parens
+(defvar js2-RP 87)
+(defvar js2-COMMA 88) ; comma operator
+
+(defvar js2-ASSIGN 89) ; simple assignment (=)
+(defvar js2-ASSIGN_BITOR 90) ; |=
+(defvar js2-ASSIGN_BITXOR 91) ; ^=
+(defvar js2-ASSIGN_BITAND 92) ; &=
+(defvar js2-ASSIGN_LSH 93) ; <<=
+(defvar js2-ASSIGN_RSH 94) ; >>=
+(defvar js2-ASSIGN_URSH 95) ; >>>=
+(defvar js2-ASSIGN_ADD 96) ; +=
+(defvar js2-ASSIGN_SUB 97) ; -=
+(defvar js2-ASSIGN_MUL 98) ; *=
+(defvar js2-ASSIGN_DIV 99) ; /=
+(defvar js2-ASSIGN_MOD 100) ; %=
+(defvar js2-ASSIGN_EXPON 101) ; **=
+(defvar js2-ASSIGN_AND 102) ; &&=
+(defvar js2-ASSIGN_OR 103) ; ||=
+(defvar js2-ASSIGN_NULLISH 104) ; ??=
+
+(defvar js2-first-assign js2-ASSIGN)
+(defvar js2-last-assign js2-ASSIGN_NULLISH)
+
+(defvar js2-COLON 105)
+(defvar js2-OR 106) ; logical or (||)
+(defvar js2-AND 107) ; logical and (&&)
+(defvar js2-INC 108) ; increment/decrement (++ --)
+(defvar js2-DEC 109)
+(defvar js2-DOT 110) ; member operator (.)
+(defvar js2-FUNCTION 111) ; function keyword
+(defvar js2-EXPORT 112) ; export keyword
+(defvar js2-IMPORT 113) ; import keyword
+(defvar js2-IF 114) ; if keyword
+(defvar js2-ELSE 115) ; else keyword
+(defvar js2-SWITCH 116) ; switch keyword
+(defvar js2-CASE 117) ; case keyword
+(defvar js2-DEFAULT 118) ; default keyword
+(defvar js2-WHILE 119) ; while keyword
+(defvar js2-DO 120) ; do keyword
+(defvar js2-FOR 121) ; for keyword
+(defvar js2-BREAK 122) ; break keyword
+(defvar js2-CONTINUE 123) ; continue keyword
+(defvar js2-VAR 124) ; var keyword
+(defvar js2-WITH 125) ; with keyword
+(defvar js2-CATCH 126) ; catch keyword
+(defvar js2-FINALLY 127) ; finally keyword
+(defvar js2-VOID 128) ; void keyword
+(defvar js2-RESERVED 129) ; reserved keywords
+
+(defvar js2-EMPTY 130)
+
+;; Types used for the parse tree - never returned by scanner.
+
+(defvar js2-BLOCK 131) ; statement block
+(defvar js2-LABEL 132) ; label
+(defvar js2-TARGET 133)
+(defvar js2-LOOP 134)
+(defvar js2-EXPR_VOID 135) ; expression statement in functions
+(defvar js2-EXPR_RESULT 136) ; expression statement in scripts
+(defvar js2-JSR 137)
+(defvar js2-SCRIPT 138) ; top-level node for entire script
+(defvar js2-TYPEOFNAME 139) ; for typeof(simple-name)
+(defvar js2-USE_STACK 140)
+(defvar js2-SETPROP_OP 141) ; x.y op= something
+(defvar js2-SETELEM_OP 142) ; x[y] op= something
+(defvar js2-LOCAL_BLOCK 143)
+(defvar js2-SET_REF_OP 144) ; *reference op= something
+
+;; For XML support:
+(defvar js2-DOTDOT 145) ; member operator (..)
+(defvar js2-COLONCOLON 146) ; namespace::name
+(defvar js2-XML 147) ; XML type
+(defvar js2-DOTQUERY 148) ; .() -- e.g., x.emps.emp.(name == "terry")
+(defvar js2-XMLATTR 149) ; @
+(defvar js2-XMLEND 150)
+
+;; Optimizer-only tokens
+(defvar js2-TO_OBJECT 151)
+(defvar js2-TO_DOUBLE 152)
+
+(defvar js2-GET 153) ; JS 1.5 get pseudo keyword
+(defvar js2-SET 154) ; JS 1.5 set pseudo keyword
+(defvar js2-LET 155) ; JS 1.7 let pseudo keyword
+(defvar js2-CONST 156)
+(defvar js2-SETCONST 157)
+(defvar js2-SETCONSTVAR 158)
+(defvar js2-ARRAYCOMP 159)
+(defvar js2-LETEXPR 160)
+(defvar js2-WITHEXPR 161)
+(defvar js2-DEBUGGER 162)
+
+(defvar js2-COMMENT 163)
+(defvar js2-TRIPLEDOT 164) ; for rest parameter
+(defvar js2-ARROW 165) ; function arrow (=>)
+(defvar js2-CLASS 166)
+(defvar js2-EXTENDS 167)
+(defvar js2-SUPER 168)
+(defvar js2-TEMPLATE_HEAD 169) ; part of template literal before substitution
+(defvar js2-NO_SUBS_TEMPLATE 170) ; template literal without substitutions
+(defvar js2-TAGGED_TEMPLATE 171) ; tagged template literal
+
+(defvar js2-AWAIT 172) ; await (pseudo keyword)
+
+(defvar js2-HOOK 173) ; conditional (?:)
+(defvar js2-OPTIONAL-CHAINING 174) ; optional chaining (?.prop obj?.[expr] func?.())
+(defvar js2-EXPON 175)
+(defvar js2-NULLISH-COALESCING 176) ; nullish coalescing (obj.value ?? obj.defaultValue ?? 0))
+
+(defvar js2-PRIVATE_NAME 177) ; this.#bar();
+
+(defconst js2-num-tokens (1+ js2-PRIVATE_NAME))
+
+(defconst js2-debug-print-trees nil)
+
+;; Rhino accepts any string or stream as input. Emacs character
+;; processing works best in buffers, so we'll assume the input is a
+;; buffer. JavaScript strings can be copied into temp buffers before
+;; scanning them.
+
+;; Buffer-local variables yield much cleaner code than using `defstruct'.
+;; They're the Emacs equivalent of instance variables, more or less.
+
+(js2-deflocal js2-ts-dirty-line nil
+ "Token stream buffer-local variable.
+Indicates stuff other than whitespace since start of line.")
+
+(js2-deflocal js2-ts-hit-eof nil
+ "Token stream buffer-local variable.")
+
+;; FIXME: Unused.
+(js2-deflocal js2-ts-line-start 0
+ "Token stream buffer-local variable.")
+
+(js2-deflocal js2-ts-lineno 1
+ "Token stream buffer-local variable.")
+
+;; FIXME: Unused.
+(js2-deflocal js2-ts-line-end-char -1
+ "Token stream buffer-local variable.")
+
+(js2-deflocal js2-ts-cursor 1 ; emacs buffers are 1-indexed
+ "Token stream buffer-local variable.
+Current scan position.")
+
+;; FIXME: Unused.
+(js2-deflocal js2-ts-is-xml-attribute nil
+ "Token stream buffer-local variable.")
+
+(js2-deflocal js2-ts-xml-is-tag-content nil
+ "Token stream buffer-local variable.")
+
+(js2-deflocal js2-ts-xml-open-tags-count 0
+ "Token stream buffer-local variable.")
+
+(js2-deflocal js2-ts-string-buffer nil
+ "Token stream buffer-local variable.
+List of chars built up while scanning various tokens.")
+
+(cl-defstruct (js2-token
+ (:constructor make-js2-token (beg)))
+ "Value returned from the token stream."
+ (type js2-EOF)
+ (beg 1)
+ (end -1)
+ (string "")
+ number
+ number-base
+ number-legacy-octal-p
+ regexp-flags
+ comment-type
+ follows-eol-p)
+
+;; Have to call `js2-init-scanner' to initialize the values.
+(js2-deflocal js2-ti-tokens nil)
+(js2-deflocal js2-ti-tokens-cursor nil)
+(js2-deflocal js2-ti-lookahead nil)
+
+(cl-defstruct (js2-ts-state
+ (:constructor make-js2-ts-state (&key (lineno js2-ts-lineno)
+ (cursor js2-ts-cursor)
+ (tokens (copy-sequence js2-ti-tokens))
+ (tokens-cursor js2-ti-tokens-cursor)
+ (lookahead js2-ti-lookahead))))
+ lineno
+ cursor
+ tokens
+ tokens-cursor
+ lookahead)
+
+;;; Parser variables
+
+(js2-deflocal js2-parsed-errors nil
+ "List of errors produced during scanning/parsing.")
+
+(js2-deflocal js2-parsed-warnings nil
+ "List of warnings produced during scanning/parsing.")
+
+(js2-deflocal js2-recover-from-parse-errors t
+ "Non-nil to continue parsing after a syntax error.
+
+In recovery mode, the AST will be built in full, and any error
+nodes will be flagged with appropriate error information. If
+this flag is nil, a syntax error will result in an error being
+signaled.
+
+The variable is automatically buffer-local, because different
+modes that use the parser will need different settings.")
+
+(js2-deflocal js2-parse-hook nil
+ "List of callbacks for receiving parsing progress.")
+
+(defvar js2-parse-finished-hook nil
+ "List of callbacks to notify when parsing finishes.
+Not called if parsing was interrupted.")
+
+(js2-deflocal js2-is-eval-code nil
+ "True if we're evaluating code in a string.
+If non-nil, the tokenizer will record the token text, and the AST nodes
+will record their source text. Off by default for IDE modes, since the
+text is available in the buffer.")
+
+(defvar js2-parse-ide-mode t
+ "Non-nil if the parser is being used for `js2-mode'.
+If non-nil, the parser will set text properties for fontification
+and the syntax table. The value should be nil when using the
+parser as a frontend to an interpreter or byte compiler.")
+
+;;; Parser instance variables (buffer-local vars for js2-parse)
+
+(defconst js2-ti-after-eol (lsh 1 16)
+ "Flag: first token of the source line.")
+
+;; Inline Rhino's CompilerEnvirons vars as buffer-locals.
+
+(js2-deflocal js2-compiler-generate-debug-info t)
+(js2-deflocal js2-compiler-use-dynamic-scope nil)
+(js2-deflocal js2-compiler-reserved-keywords-as-identifier nil)
+(js2-deflocal js2-compiler-xml-available t)
+(js2-deflocal js2-compiler-optimization-level 0)
+(js2-deflocal js2-compiler-generating-source t)
+(js2-deflocal js2-compiler-strict-mode nil)
+(js2-deflocal js2-compiler-report-warning-as-error nil)
+(js2-deflocal js2-compiler-generate-observer-count nil)
+(js2-deflocal js2-compiler-activation-names nil)
+
+;; SKIP: sourceURI
+
+;; There's a compileFunction method in Context.java - may need it.
+(js2-deflocal js2-called-by-compile-function nil
+ "True if `js2-parse' was called by `js2-compile-function'.
+Will only be used when we finish implementing the interpreter.")
+
+;; SKIP: ts (we just call `js2-init-scanner' and use its vars)
+
+;; SKIP: node factory - we're going to just call functions directly,
+;; and eventually go to a unified AST format.
+
+(js2-deflocal js2-nesting-of-function 0)
+
+(js2-deflocal js2-recorded-identifiers nil
+ "Tracks identifiers found during parsing.")
+
+(js2-deflocal js2-is-in-destructuring nil
+ "True while parsing destructuring expression.")
+
+(js2-deflocal js2-in-use-strict-directive nil
+ "True while inside a script or function under strict mode.")
+
+(defcustom js2-global-externs nil
+ "A list of any extern names you'd like to consider always declared.
+This list is global and is used by all `js2-mode' files.
+You can create buffer-local externs list using `js2-additional-externs'."
+ :type 'list
+ :group 'js2-mode)
+
+(defcustom js2-include-browser-externs t
+ "Non-nil to include browser externs in the master externs list.
+If you work on JavaScript files that are not intended for browsers,
+such as Mozilla Rhino server-side JavaScript, set this to nil.
+See `js2-additional-externs' for more information about externs."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-include-rhino-externs nil
+ "Non-nil to include Mozilla Rhino externs in the master externs list.
+See `js2-additional-externs' for more information about externs."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-include-node-externs nil
+ "Non-nil to include Node.js externs in the master externs list.
+See `js2-additional-externs' for more information about externs."
+ :type 'boolean
+ :group 'js2-mode)
+
+(js2-deflocal js2-additional-externs nil
+ "A buffer-local list of additional external declarations.
+It is used to decide whether variables are considered undeclared
+for purposes of highlighting. See `js2-highlight-undeclared-vars'.
+
+Each entry is a Lisp string. The string should be the fully qualified
+name of an external entity. All externs should be added to this list,
+so that as js2-mode's processing improves it can take advantage of them.
+
+You may want to declare your externs in three ways.
+First, you can add externs that are valid for all your JavaScript files.
+You should probably do this by adding them to `js2-global-externs', which
+is a global list used for all js2-mode files.
+
+Next, you can add a function to `js2-init-hook' that adds additional
+externs appropriate for the specific file, perhaps based on its path.
+These should go in `js2-additional-externs', which is buffer-local.
+
+Third, you can use JSLint's global declaration, as long as
+`js2-include-jslint-globals' is non-nil, which see.
+
+Finally, you can add a function to `js2-post-parse-callbacks',
+which is called after parsing completes, and `js2-mode-ast' is bound to
+the root of the parse tree. At this stage you can set up an AST
+node visitor using `js2-visit-ast' and examine the parse tree
+for specific import patterns that may imply the existence of
+other externs, possibly tied to your build system. These should also
+be added to `js2-additional-externs'.
+
+Your post-parse callback may of course also use the simpler and
+faster (but perhaps less robust) approach of simply scanning the
+buffer text for your imports, using regular expressions.")
+
+(put 'js2-additional-externs 'safe-local-variable
+ (lambda (val) (cl-every #'stringp val)))
+
+;; SKIP: decompiler
+;; SKIP: encoded-source
+
+;;; The following variables are per-function and should be saved/restored
+;;; during function parsing...
+
+(js2-deflocal js2-current-script-or-fn nil)
+(js2-deflocal js2-current-scope nil)
+(js2-deflocal js2-nesting-of-with 0)
+(js2-deflocal js2-label-set nil
+ "An alist mapping label names to nodes.")
+
+(js2-deflocal js2-loop-set nil)
+(js2-deflocal js2-loop-and-switch-set nil)
+(js2-deflocal js2-has-return-value nil)
+(js2-deflocal js2-end-flags 0)
+
+;;; ...end of per function variables
+
+;; These flags enumerate the possible ways a statement/function can
+;; terminate. These flags are used by endCheck() and by the Parser to
+;; detect inconsistent return usage.
+;;
+;; END_UNREACHED is reserved for code paths that are assumed to always be
+;; able to execute (example: throw, continue)
+;;
+;; END_DROPS_OFF indicates if the statement can transfer control to the
+;; next one. Statement such as return dont. A compound statement may have
+;; some branch that drops off control to the next statement.
+;;
+;; END_RETURNS indicates that the statement can return (without arguments)
+;; END_RETURNS_VALUE indicates that the statement can return a value.
+;;
+;; A compound statement such as
+;; if (condition) {
+;; return value;
+;; }
+;; Will be detected as (END_DROPS_OFF | END_RETURN_VALUE) by endCheck()
+
+(defconst js2-end-unreached #x0)
+(defconst js2-end-drops-off #x1)
+(defconst js2-end-returns #x2)
+(defconst js2-end-returns-value #x4)
+
+;; Rhino awkwardly passes a statementLabel parameter to the
+;; statementHelper() function, the main statement parser, which
+;; is then used by quite a few of the sub-parsers. We just make
+;; it a buffer-local variable and make sure it's cleaned up properly.
+(js2-deflocal js2-labeled-stmt nil) ; type `js2-labeled-stmt-node'
+
+;; Similarly, Rhino passes an inForInit boolean through about half
+;; the expression parsers. We use a dynamically-scoped variable,
+;; which makes it easier to funcall the parsers individually without
+;; worrying about whether they take the parameter or not.
+(js2-deflocal js2-in-for-init nil)
+(js2-deflocal js2-temp-name-counter 0)
+(js2-deflocal js2-parse-stmt-count 0)
+
+(defsubst js2-get-next-temp-name ()
+ (format "$%d" (cl-incf js2-temp-name-counter)))
+
+(defvar js2-parse-interruptable-p t
+ "Set this to nil to force parse to continue until finished.
+This will mostly be useful for interpreters.")
+
+(defvar js2-statements-per-pause 50
+ "Pause after this many statements to check for user input.
+If user input is pending, stop the parse and discard the tree.
+This makes for a smoother user experience for large files.
+You may have to wait a second or two before the highlighting
+and error-reporting appear, but you can always type ahead if
+you wish. This appears to be more or less how Eclipse, IntelliJ
+and other editors work.")
+
+(js2-deflocal js2-record-comments t
+ "Instructs the scanner to record comments in `js2-scanned-comments'.")
+
+(js2-deflocal js2-scanned-comments nil
+ "List of all comments from the current parse.")
+
+(defcustom js2-mode-indent-inhibit-undo nil
+ "Non-nil to disable collection of Undo information when indenting lines.
+Some users have requested this behavior. It's nil by default because
+other Emacs modes don't work this way."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-mode-indent-ignore-first-tab nil
+ "If non-nil, ignore first TAB keypress if we look indented properly.
+It's fairly common for users to navigate to an already-indented line
+and press TAB for reassurance that it's been indented. For this class
+of users, we want the first TAB press on a line to be ignored if the
+line is already indented to one of the precomputed alternatives.
+
+This behavior is only partly implemented. If you TAB-indent a line,
+navigate to another line, and then navigate back, it fails to clear
+the last-indented variable, so it thinks you've already hit TAB once,
+and performs the indent. A full solution would involve getting on the
+point-motion hooks for the entire buffer. If we come across another
+use cases that requires watching point motion, I'll consider doing it.
+
+If you set this variable to nil, then the TAB key will always change
+the indentation of the current line, if more than one alternative
+indentation spot exists."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defvar js2-indent-hook nil
+ "A hook for user-defined indentation rules.
+
+Functions on this hook should expect two arguments: (LIST INDEX)
+The LIST argument is the list of computed indentation points for
+the current line. INDEX is the list index of the indentation point
+that `js2-bounce-indent' plans to use. If INDEX is nil, then the
+indent function is not going to change the current line indentation.
+
+If a hook function on this list returns a non-nil value, then
+`js2-bounce-indent' assumes the hook function has performed its own
+indentation, and will do nothing. If all hook functions on the list
+return nil, then `js2-bounce-indent' will use its computed indentation
+and reindent the line.
+
+When hook functions on this hook list are called, the variable
+`js2-mode-ast' may or may not be set, depending on whether the
+parse tree is available. If the variable is nil, you can pass a
+callback to `js2-mode-wait-for-parse', and your callback will be
+called after the new parse tree is built. This can take some time
+in large files.")
+
+(defface js2-warning
+ `((((class color) (background light))
+ (:underline "orange"))
+ (((class color) (background dark))
+ (:underline "orange"))
+ (t (:underline t)))
+ "Face for JavaScript warnings."
+ :group 'js2-mode)
+
+(defface js2-error
+ `((((class color) (background light))
+ (:foreground "red"))
+ (((class color) (background dark))
+ (:foreground "red"))
+ (t (:foreground "red")))
+ "Face for JavaScript errors."
+ :group 'js2-mode)
+
+(defface js2-jsdoc-tag
+ '((t :foreground "SlateGray"))
+ "Face used to highlight @whatever tags in jsdoc comments."
+ :group 'js2-mode)
+
+(defface js2-jsdoc-type
+ '((t :foreground "SteelBlue"))
+ "Face used to highlight {FooBar} types in jsdoc comments."
+ :group 'js2-mode)
+
+(defface js2-jsdoc-value
+ '((t :foreground "PeachPuff3"))
+ "Face used to highlight tag values in jsdoc comments."
+ :group 'js2-mode)
+
+(defface js2-function-param
+ '((t :foreground "SeaGreen"))
+ "Face used to highlight function parameters in javascript."
+ :group 'js2-mode)
+
+(defface js2-function-call
+ '((t :inherit default))
+ "Face used to highlight function name in calls."
+ :group 'js2-mode)
+
+(defface js2-object-property
+ '((t :inherit default))
+ "Face used to highlight named property in object literal."
+ :group 'js2-mode)
+
+(defface js2-object-property-access
+ '((t :inherit js2-object-property))
+ "Face used to highlight property access with dot on an object."
+ :group 'js2-mode)
+
+(defface js2-instance-member
+ '((t :foreground "DarkOrchid"))
+ "Face used to highlight instance variables in javascript.
+Not currently used."
+ :group 'js2-mode)
+
+(defface js2-private-member
+ '((t :foreground "PeachPuff3"))
+ "Face used to highlight calls to private methods in javascript.
+Not currently used."
+ :group 'js2-mode)
+
+(defface js2-private-function-call
+ '((t :foreground "goldenrod"))
+ "Face used to highlight calls to private functions in javascript.
+Not currently used."
+ :group 'js2-mode)
+
+(defface js2-jsdoc-html-tag-name
+ '((((class color) (min-colors 88) (background light))
+ (:foreground "rosybrown"))
+ (((class color) (min-colors 8) (background dark))
+ (:foreground "yellow"))
+ (((class color) (min-colors 8) (background light))
+ (:foreground "magenta")))
+ "Face used to highlight jsdoc html tag names"
+ :group 'js2-mode)
+
+(defface js2-jsdoc-html-tag-delimiter
+ '((((class color) (min-colors 88) (background light))
+ (:foreground "dark khaki"))
+ (((class color) (min-colors 8) (background dark))
+ (:foreground "green"))
+ (((class color) (min-colors 8) (background light))
+ (:foreground "green")))
+ "Face used to highlight brackets in jsdoc html tags."
+ :group 'js2-mode)
+
+(defface js2-external-variable
+ '((t :foreground "orange"))
+ "Face used to highlight undeclared variable identifiers.")
+
+(defcustom js2-init-hook nil
+ ;; FIXME: We don't really need this anymore.
+ "List of functions to be called after `js2-mode' or
+`js2-minor-mode' has initialized all variables, before parsing
+the buffer for the first time."
+ :type 'hook
+ :group 'js2-mode
+ :version "20130608")
+
+(defcustom js2-post-parse-callbacks nil
+ "List of callback functions invoked after parsing finishes.
+Currently, the main use for this function is to add synthetic
+declarations to `js2-recorded-identifiers', which see."
+ :type 'hook
+ :group 'js2-mode)
+
+(defcustom js2-build-imenu-callbacks nil
+ "List of functions called during Imenu index generation.
+It's a good place to add additional entries to it, using
+`js2-record-imenu-entry'."
+ :type 'hook
+ :group 'js2-mode)
+
+(defcustom js2-highlight-external-variables t
+ "Non-nil to highlight undeclared variable identifiers.
+An undeclared variable is any variable not declared with var or let
+in the current scope or any lexically enclosing scope. If you use
+such a variable, then you are either expecting it to originate from
+another file, or you've got a potential bug."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-warn-about-unused-function-arguments nil
+ "Non-nil to treat function arguments like declared-but-unused variables."
+ :type 'booleanp
+ :group 'js2-mode)
+
+(defcustom js2-include-jslint-globals t
+ "Non-nil to include the identifiers from JSLint global
+declaration (see http://www.jslint.com/help.html#global) in the
+buffer-local externs list. See `js2-additional-externs' for more
+information."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defcustom js2-include-jslint-declaration-externs t
+ "Non-nil to include the identifiers JSLint assumes to be there
+under certain declarations in the buffer-local externs list. See
+`js2-additional-externs' for more information."
+ :type 'boolean
+ :group 'js2-mode)
+
+(defvar js2-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map [remap indent-new-comment-line] #'js2-line-break)
+ (define-key map (kbd "C-c C-e") #'js2-mode-hide-element)
+ (define-key map (kbd "C-c C-s") #'js2-mode-show-element)
+ (define-key map (kbd "C-c C-a") #'js2-mode-show-all)
+ (define-key map (kbd "C-c C-f") #'js2-mode-toggle-hide-functions)
+ (define-key map (kbd "C-c C-t") #'js2-mode-toggle-hide-comments)
+ (define-key map (kbd "C-c C-o") #'js2-mode-toggle-element)
+ (define-key map (kbd "C-c C-w") #'js2-mode-toggle-warnings-and-errors)
+ (define-key map [down-mouse-3] #'js2-down-mouse-3)
+ (define-key map [remap js-find-symbol] #'js2-jump-to-definition)
+
+ (define-key map [menu-bar javascript]
+ (cons "JavaScript" (make-sparse-keymap "JavaScript")))
+
+ (define-key map [menu-bar javascript customize-js2-mode]
+ '(menu-item "Customize js2-mode" js2-mode-customize
+ :help "Customize the behavior of this mode"))
+
+ (define-key map [menu-bar javascript js2-force-refresh]
+ '(menu-item "Force buffer refresh" js2-mode-reset
+ :help "Re-parse the buffer from scratch"))
+
+ (define-key map [menu-bar javascript separator-2]
+ '("--"))
+
+ (define-key map [menu-bar javascript next-error]
+ '(menu-item "Next warning or error" next-error
+ :enabled (and js2-mode-ast
+ (or (js2-ast-root-errors js2-mode-ast)
+ (js2-ast-root-warnings js2-mode-ast)))
+ :help "Move to next warning or error"))
+
+ (define-key map [menu-bar javascript display-errors]
+ '(menu-item "Show errors and warnings" js2-mode-display-warnings-and-errors
+ :visible (not js2-mode-show-parse-errors)
+ :help "Turn on display of warnings and errors"))
+
+ (define-key map [menu-bar javascript hide-errors]
+ '(menu-item "Hide errors and warnings" js2-mode-hide-warnings-and-errors
+ :visible js2-mode-show-parse-errors
+ :help "Turn off display of warnings and errors"))
+
+ (define-key map [menu-bar javascript separator-1]
+ '("--"))
+
+ (define-key map [menu-bar javascript js2-toggle-function]
+ '(menu-item "Show/collapse element" js2-mode-toggle-element
+ :help "Hide or show function body or comment"))
+
+ (define-key map [menu-bar javascript show-comments]
+ '(menu-item "Show block comments" js2-mode-toggle-hide-comments
+ :visible js2-mode-comments-hidden
+ :help "Expand all hidden block comments"))
+
+ (define-key map [menu-bar javascript hide-comments]
+ '(menu-item "Hide block comments" js2-mode-toggle-hide-comments
+ :visible (not js2-mode-comments-hidden)
+ :help "Show block comments as /*...*/"))
+
+ (define-key map [menu-bar javascript show-all-functions]
+ '(menu-item "Show function bodies" js2-mode-toggle-hide-functions
+ :visible js2-mode-functions-hidden
+ :help "Expand all hidden function bodies"))
+
+ (define-key map [menu-bar javascript hide-all-functions]
+ '(menu-item "Hide function bodies" js2-mode-toggle-hide-functions
+ :visible (not js2-mode-functions-hidden)
+ :help "Show {...} for all top-level function bodies"))
+
+ map)
+ "Keymap used in `js2-mode' buffers.")
+
+(defcustom js2-bounce-indent-p nil
+ "Non-nil to bind `js2-indent-bounce' and `js2-indent-bounce-backward'.
+They will augment the default indent-line behavior with cycling
+among several computed alternatives. See the function
+`js2-bounce-indent' for details. The above commands will be
+bound to TAB and backtab."
+ :type 'boolean
+ :group 'js2-mode
+ :set (lambda (sym value)
+ (set-default sym value)
+ (let ((map js2-mode-map))
+ (if (not value)
+ (progn
+ (define-key map "\t" nil)
+ (define-key map (kbd "<backtab>") nil))
+ (define-key map "\t" #'js2-indent-bounce)
+ (define-key map (kbd "<backtab>") #'js2-indent-bounce-backward)))))
+
+(defconst js2-mode-identifier-re "[[:alpha:]_$][[:alnum:]_$]*")
+
+(defvar js2-mode-//-comment-re "^\\(\\s-*\\)//.+"
+ "Matches a //-comment line. Must be first non-whitespace on line.
+First match-group is the leading whitespace.")
+
+(defvar js2-mode-hook nil)
+
+(js2-deflocal js2-mode-ast nil "Private variable.")
+(js2-deflocal js2-mode-parse-timer nil "Private variable.")
+(js2-deflocal js2-mode-buffer-dirty-p nil "Private variable.")
+(js2-deflocal js2-mode-parsing nil "Private variable.")
+(js2-deflocal js2-mode-node-overlay nil)
+
+(defvar js2-mode-show-overlay js2-mode-dev-mode-p
+ "Debug: Non-nil to highlight AST nodes on mouse-down.")
+
+(js2-deflocal js2-mode-fontifications nil "Private variable")
+(js2-deflocal js2-mode-deferred-properties nil "Private variable")
+(js2-deflocal js2-imenu-recorder nil "Private variable")
+(js2-deflocal js2-imenu-function-map nil "Private variable")
+
+(defvar js2-mode-verbose-parse-p js2-mode-dev-mode-p
+ "Non-nil to emit status messages during parsing.")
+
+(defvar js2-mode-change-syntax-p t
+ "Non-nil to set the syntax-table text property on certain literals.")
+
+(defvar js2-mode-functions-hidden nil "Private variable.")
+(defvar js2-mode-comments-hidden nil "Private variable.")
+
+(defvar js2-mode-syntax-table
+ (let ((table (make-syntax-table)))
+ (c-populate-syntax-table table)
+ (modify-syntax-entry ?` "\"" table)
+ table)
+ "Syntax table used in `js2-mode' buffers.")
+
+(defvar js2-mode-abbrev-table nil
+ "Abbrev table in use in `js2-mode' buffers.")
+(define-abbrev-table 'js2-mode-abbrev-table ())
+
+(defvar js2-mode-pending-parse-callbacks nil
+ "List of functions waiting to be notified that parse is finished.")
+
+(defvar js2-mode-last-indented-line -1)
+
+;;; Localizable error and warning messages
+
+;; Messages are copied from Rhino's Messages.properties.
+;; Many of the Java-specific messages have been elided.
+;; Add any js2-specific ones at the end, so we can keep
+;; this file synced with changes to Rhino's.
+
+(defvar js2-message-table
+ (make-hash-table :test 'equal :size 250)
+ "Contains localized messages for `js2-mode'.")
+
+;; TODO(stevey): construct this table at compile-time.
+(defmacro js2-msg (key &rest strings)
+ `(puthash ,key (concat ,@strings)
+ js2-message-table))
+
+(defun js2-get-msg (msg-key)
+ "Look up a localized message.
+MSG-KEY is a list of (MSG ARGS). If the message takes parameters,
+the correct number of ARGS must be provided."
+ (let* ((key (if (listp msg-key) (car msg-key) msg-key))
+ (args (if (listp msg-key) (cdr msg-key)))
+ (msg (gethash key js2-message-table)))
+ (if msg
+ (apply #'format msg args)
+ key))) ; default to showing the key
+
+(js2-msg "msg.dup.parms"
+ "Duplicate parameter name '%s'.")
+
+(js2-msg "msg.too.big.jump"
+ "Program too complex: jump offset too big.")
+
+(js2-msg "msg.too.big.index"
+ "Program too complex: internal index exceeds 64K limit.")
+
+(js2-msg "msg.while.compiling.fn"
+ "Encountered code generation error while compiling function '%s': %s")
+
+(js2-msg "msg.while.compiling.script"
+ "Encountered code generation error while compiling script: %s")
+
+;; Context
+(js2-msg "msg.ctor.not.found"
+ "Constructor for '%s' not found.")
+
+(js2-msg "msg.not.ctor"
+ "'%s' is not a constructor.")
+
+;; FunctionObject
+(js2-msg "msg.varargs.ctor"
+ "Method or constructor '%s' must be static "
+ "with the signature (Context cx, Object[] args, "
+ "Function ctorObj, boolean inNewExpr) "
+ "to define a variable arguments constructor.")
+
+(js2-msg "msg.varargs.fun"
+ "Method '%s' must be static with the signature "
+ "(Context cx, Scriptable thisObj, Object[] args, Function funObj) "
+ "to define a variable arguments function.")
+
+(js2-msg "msg.incompat.call"
+ "Method '%s' called on incompatible object.")
+
+(js2-msg "msg.bad.parms"
+ "Unsupported parameter type '%s' in method '%s'.")
+
+(js2-msg "msg.bad.method.return"
+ "Unsupported return type '%s' in method '%s'.")
+
+(js2-msg "msg.bad.ctor.return"
+ "Construction of objects of type '%s' is not supported.")
+
+(js2-msg "msg.no.overload"
+ "Method '%s' occurs multiple times in class '%s'.")
+
+(js2-msg "msg.method.not.found"
+ "Method '%s' not found in '%s'.")
+
+;; IRFactory
+
+(js2-msg "msg.bad.for.in.lhs"
+ "Invalid left-hand side of for..in loop.")
+
+(js2-msg "msg.mult.index"
+ "Only one variable allowed in for..in loop.")
+
+(js2-msg "msg.bad.for.in.destruct"
+ "Left hand side of for..in loop must be an array of "
+ "length 2 to accept key/value pair.")
+
+(js2-msg "msg.cant.convert"
+ "Can't convert to type '%s'.")
+
+(js2-msg "msg.bad.assign.left"
+ "Invalid assignment left-hand side.")
+
+(js2-msg "msg.bad.decr"
+ "Invalid decrement operand.")
+
+(js2-msg "msg.bad.incr"
+ "Invalid increment operand.")
+
+(js2-msg "msg.bad.yield"
+ "yield must be in a function.")
+
+(js2-msg "msg.bad.await"
+ "await must be in async functions.")
+
+;; NativeGlobal
+(js2-msg "msg.cant.call.indirect"
+ "Function '%s' must be called directly, and not by way of a "
+ "function of another name.")
+
+(js2-msg "msg.eval.nonstring"
+ "Calling eval() with anything other than a primitive "
+ "string value will simply return the value. "
+ "Is this what you intended?")
+
+(js2-msg "msg.eval.nonstring.strict"
+ "Calling eval() with anything other than a primitive "
+ "string value is not allowed in strict mode.")
+
+(js2-msg "msg.bad.destruct.op"
+ "Invalid destructuring assignment operator")
+
+;; NativeCall
+(js2-msg "msg.only.from.new"
+ "'%s' may only be invoked from a `new' expression.")
+
+(js2-msg "msg.deprec.ctor"
+ "The '%s' constructor is deprecated.")
+
+;; NativeFunction
+(js2-msg "msg.no.function.ref.found"
+ "no source found to decompile function reference %s")
+
+(js2-msg "msg.arg.isnt.array"
+ "second argument to Function.prototype.apply must be an array")
+
+;; NativeGlobal
+(js2-msg "msg.bad.esc.mask"
+ "invalid string escape mask")
+
+;; NativeRegExp
+(js2-msg "msg.bad.quant"
+ "Invalid quantifier %s")
+
+(js2-msg "msg.overlarge.backref"
+ "Overly large back reference %s")
+
+(js2-msg "msg.overlarge.min"
+ "Overly large minimum %s")
+
+(js2-msg "msg.overlarge.max"
+ "Overly large maximum %s")
+
+(js2-msg "msg.zero.quant"
+ "Zero quantifier %s")
+
+(js2-msg "msg.max.lt.min"
+ "Maximum %s less than minimum")
+
+(js2-msg "msg.unterm.quant"
+ "Unterminated quantifier %s")
+
+(js2-msg "msg.unterm.paren"
+ "Unterminated parenthetical %s")
+
+(js2-msg "msg.unterm.class"
+ "Unterminated character class %s")
+
+(js2-msg "msg.bad.range"
+ "Invalid range in character class.")
+
+(js2-msg "msg.trail.backslash"
+ "Trailing \\ in regular expression.")
+
+(js2-msg "msg.re.unmatched.right.paren"
+ "unmatched ) in regular expression.")
+
+(js2-msg "msg.no.regexp"
+ "Regular expressions are not available.")
+
+(js2-msg "msg.bad.backref"
+ "back-reference exceeds number of capturing parentheses.")
+
+(js2-msg "msg.bad.regexp.compile"
+ "Only one argument may be specified if the first "
+ "argument to RegExp.prototype.compile is a RegExp object.")
+
+;; Parser
+(js2-msg "msg.got.syntax.errors"
+ "Compilation produced %s syntax errors.")
+
+(js2-msg "msg.var.redecl"
+ "Redeclaration of var %s.")
+
+(js2-msg "msg.const.redecl"
+ "TypeError: redeclaration of const %s.")
+
+(js2-msg "msg.let.redecl"
+ "TypeError: redeclaration of variable %s.")
+
+(js2-msg "msg.parm.redecl"
+ "TypeError: redeclaration of formal parameter %s.")
+
+(js2-msg "msg.fn.redecl"
+ "TypeError: redeclaration of function %s.")
+
+(js2-msg "msg.let.decl.not.in.block"
+ "SyntaxError: let declaration not directly within block")
+
+(js2-msg "msg.mod.import.decl.at.top.level"
+ "SyntaxError: import declarations may only appear at the top level")
+
+(js2-msg "msg.mod.as.after.reserved.word"
+ "SyntaxError: missing keyword 'as' after reserved word %s")
+
+(js2-msg "msg.mod.rc.after.import.spec.list"
+ "SyntaxError: missing '}' after module specifier list")
+
+(js2-msg "msg.mod.from.after.import.spec.set"
+ "SyntaxError: missing keyword 'from' after import specifier set")
+
+(js2-msg "msg.mod.declaration.after.import"
+ "SyntaxError: missing declaration after 'import' keyword")
+
+(js2-msg "msg.mod.spec.after.from"
+ "SyntaxError: missing module specifier after 'from' keyword")
+
+(js2-msg "msg.mod.export.decl.at.top.level"
+ "SyntaxError: export declarations may only appear at top level")
+
+(js2-msg "msg.mod.rc.after.export.spec.list"
+ "SyntaxError: missing '}' after export specifier list")
+
+;; NodeTransformer
+(js2-msg "msg.dup.label"
+ "duplicated label")
+
+(js2-msg "msg.undef.label"
+ "undefined label")
+
+(js2-msg "msg.bad.break"
+ "unlabelled break must be inside loop or switch")
+
+(js2-msg "msg.continue.outside"
+ "continue must be inside loop")
+
+(js2-msg "msg.continue.nonloop"
+ "continue can only use labels of iteration statements")
+
+(js2-msg "msg.bad.throw.eol"
+ "Line terminator is not allowed between the throw "
+ "keyword and throw expression.")
+
+(js2-msg "msg.unnamed.function.stmt" ; added by js2-mode
+ "function statement requires a name")
+
+(js2-msg "msg.no.paren.parms"
+ "missing ( before function parameters.")
+
+(js2-msg "msg.no.parm"
+ "missing formal parameter")
+
+(js2-msg "msg.no.paren.after.parms"
+ "missing ) after formal parameters")
+
+(js2-msg "msg.no.default.after.default.param" ; added by js2-mode
+ "parameter without default follows parameter with default")
+
+(js2-msg "msg.param.after.rest" ; added by js2-mode
+ "parameter after rest parameter")
+
+(js2-msg "msg.bad.arrow.args" ; added by js2-mode
+ "invalid arrow-function arguments (parentheses around the arrow-function may help)")
+
+(js2-msg "msg.no.brace.body"
+ "missing '{' before function body")
+
+(js2-msg "msg.no.brace.after.body"
+ "missing } after function body")
+
+(js2-msg "msg.no.paren.cond"
+ "missing ( before condition")
+
+(js2-msg "msg.no.paren.after.cond"
+ "missing ) after condition")
+
+(js2-msg "msg.no.semi.stmt"
+ "missing ; before statement")
+
+(js2-msg "msg.missing.semi"
+ "missing ; after statement")
+
+(js2-msg "msg.no.name.after.dot"
+ "missing name after . operator")
+
+(js2-msg "msg.no.name.after.coloncolon"
+ "missing name after :: operator")
+
+(js2-msg "msg.no.name.after.dotdot"
+ "missing name after .. operator")
+
+(js2-msg "msg.no.name.after.xmlAttr"
+ "missing name after .@")
+
+(js2-msg "msg.no.bracket.index"
+ "missing ] in index expression")
+
+(js2-msg "msg.no.paren.switch"
+ "missing ( before switch expression")
+
+(js2-msg "msg.no.paren.after.switch"
+ "missing ) after switch expression")
+
+(js2-msg "msg.no.brace.switch"
+ "missing '{' before switch body")
+
+(js2-msg "msg.bad.switch"
+ "invalid switch statement")
+
+(js2-msg "msg.no.colon.case"
+ "missing : after case expression")
+
+(js2-msg "msg.double.switch.default"
+ "double default label in the switch statement")
+
+(js2-msg "msg.no.while.do"
+ "missing while after do-loop body")
+
+(js2-msg "msg.no.paren.for"
+ "missing ( after for")
+
+(js2-msg "msg.no.semi.for"
+ "missing ; after for-loop initializer")
+
+(js2-msg "msg.no.semi.for.cond"
+ "missing ; after for-loop condition")
+
+(js2-msg "msg.in.after.for.name"
+ "missing in or of after for")
+
+(js2-msg "msg.no.paren.for.ctrl"
+ "missing ) after for-loop control")
+
+(js2-msg "msg.no.paren.with"
+ "missing ( before with-statement object")
+
+(js2-msg "msg.no.paren.after.with"
+ "missing ) after with-statement object")
+
+(js2-msg "msg.no.with.strict"
+ "with statements not allowed in strict mode")
+
+(js2-msg "msg.no.paren.after.let"
+ "missing ( after let")
+
+(js2-msg "msg.no.paren.let"
+ "missing ) after variable list")
+
+(js2-msg "msg.no.curly.let"
+ "missing } after let statement")
+
+(js2-msg "msg.bad.return"
+ "invalid return")
+
+(js2-msg "msg.no.brace.block"
+ "missing } in compound statement")
+
+(js2-msg "msg.bad.label"
+ "invalid label")
+
+(js2-msg "msg.bad.var"
+ "missing variable name")
+
+(js2-msg "msg.bad.var.init"
+ "invalid variable initialization")
+
+(js2-msg "msg.no.colon.cond"
+ "missing : in conditional expression")
+
+(js2-msg "msg.bad.optional.chaining"
+ "missing property name or [ or ( after optional chaining operator")
+
+(js2-msg "msg.no.paren.arg"
+ "missing ) after argument list")
+
+(js2-msg "msg.no.bracket.arg"
+ "missing ] after element list")
+
+(js2-msg "msg.bad.prop"
+ "invalid property id")
+
+(js2-msg "msg.no.colon.prop"
+ "missing : after property id")
+
+(js2-msg "msg.no.brace.prop"
+ "missing } after property list")
+
+(js2-msg "msg.no.paren"
+ "missing ) in parenthetical")
+
+(js2-msg "msg.reserved.id"
+ "'%s' is a reserved identifier")
+
+(js2-msg "msg.no.paren.catch"
+ "missing ( before catch-block condition")
+
+(js2-msg "msg.bad.catchcond"
+ "invalid catch block condition")
+
+(js2-msg "msg.catch.unreachable"
+ "any catch clauses following an unqualified catch are unreachable")
+
+(js2-msg "msg.no.brace.try"
+ "missing '{' before try block")
+
+(js2-msg "msg.no.brace.catchblock"
+ "missing '{' before catch-block body")
+
+(js2-msg "msg.try.no.catchfinally"
+ "'try' without 'catch' or 'finally'")
+
+(js2-msg "msg.no.return.value"
+ "function %s does not always return a value")
+
+(js2-msg "msg.anon.no.return.value"
+ "anonymous function does not always return a value")
+
+(js2-msg "msg.return.inconsistent"
+ "return statement is inconsistent with previous usage")
+
+(js2-msg "msg.generator.returns"
+ "TypeError: legacy generator function '%s' returns a value")
+
+(js2-msg "msg.anon.generator.returns"
+ "TypeError: anonymous legacy generator function returns a value")
+
+(js2-msg "msg.syntax"
+ "syntax error")
+
+(js2-msg "msg.unexpected.eof"
+ "Unexpected end of file")
+
+(js2-msg "msg.XML.bad.form"
+ "illegally formed XML syntax")
+
+(js2-msg "msg.XML.not.available"
+ "XML runtime not available")
+
+(js2-msg "msg.too.deep.parser.recursion"
+ "Too deep recursion while parsing")
+
+(js2-msg "msg.no.side.effects"
+ "Code has no side effects")
+
+(js2-msg "msg.extra.trailing.comma"
+ "Trailing comma is not supported in some browsers")
+
+(js2-msg "msg.array.trailing.comma"
+ "Trailing comma yields different behavior across browsers")
+
+(js2-msg "msg.equal.as.assign"
+ (concat "Test for equality (==) mistyped as assignment (=)?"
+ " (parenthesize to suppress warning)"))
+
+(js2-msg "msg.var.hides.arg"
+ "Variable %s hides argument")
+
+(js2-msg "msg.destruct.assign.no.init"
+ "Missing = in destructuring declaration")
+
+(js2-msg "msg.init.no.destruct"
+ "Binding initializer not in destructuring assignment")
+
+(js2-msg "msg.no.octal.strict"
+ "Octal numbers prohibited in strict mode.")
+
+(js2-msg "msg.dup.obj.lit.prop.strict"
+ "Property '%s' already defined in this object literal.")
+
+(js2-msg "msg.dup.param.strict"
+ "Parameter '%s' already declared in this function.")
+
+(js2-msg "msg.bad.id.strict"
+ "'%s' is not a valid identifier for this use in strict mode.")
+
+;; ScriptRuntime
+(js2-msg "msg.no.properties"
+ "%s has no properties.")
+
+(js2-msg "msg.invalid.iterator"
+ "Invalid iterator value")
+
+(js2-msg "msg.iterator.primitive"
+ "__iterator__ returned a primitive value")
+
+(js2-msg "msg.assn.create.strict"
+ "Assignment to undeclared variable %s")
+
+(js2-msg "msg.undeclared.variable" ; added by js2-mode
+ "Undeclared variable or function '%s'")
+
+(js2-msg "msg.unused.variable" ; added by js2-mode
+ "Unused variable or function '%s'")
+
+(js2-msg "msg.uninitialized.variable" ; added by js2-mode
+ "Variable '%s' referenced but never initialized")
+
+(js2-msg "msg.ref.undefined.prop"
+ "Reference to undefined property '%s'")
+
+(js2-msg "msg.prop.not.found"
+ "Property %s not found.")
+
+(js2-msg "msg.invalid.type"
+ "Invalid JavaScript value of type %s")
+
+(js2-msg "msg.primitive.expected"
+ "Primitive type expected (had %s instead)")
+
+(js2-msg "msg.namespace.expected"
+ "Namespace object expected to left of :: (found %s instead)")
+
+(js2-msg "msg.null.to.object"
+ "Cannot convert null to an object.")
+
+(js2-msg "msg.undef.to.object"
+ "Cannot convert undefined to an object.")
+
+(js2-msg "msg.cyclic.value"
+ "Cyclic %s value not allowed.")
+
+(js2-msg "msg.is.not.defined"
+ "'%s' is not defined.")
+
+(js2-msg "msg.undef.prop.read"
+ "Cannot read property '%s' from %s")
+
+(js2-msg "msg.undef.prop.write"
+ "Cannot set property '%s' of %s to '%s'")
+
+(js2-msg "msg.undef.prop.delete"
+ "Cannot delete property '%s' of %s")
+
+(js2-msg "msg.undef.method.call"
+ "Cannot call method '%s' of %s")
+
+(js2-msg "msg.undef.with"
+ "Cannot apply 'with' to %s")
+
+(js2-msg "msg.isnt.function"
+ "%s is not a function, it is %s.")
+
+(js2-msg "msg.isnt.function.in"
+ "Cannot call property %s in object %s. "
+ "It is not a function, it is '%s'.")
+
+(js2-msg "msg.function.not.found"
+ "Cannot find function %s.")
+
+(js2-msg "msg.function.not.found.in"
+ "Cannot find function %s in object %s.")
+
+(js2-msg "msg.isnt.xml.object"
+ "%s is not an xml object.")
+
+(js2-msg "msg.no.ref.to.get"
+ "%s is not a reference to read reference value.")
+
+(js2-msg "msg.no.ref.to.set"
+ "%s is not a reference to set reference value to %s.")
+
+(js2-msg "msg.no.ref.from.function"
+ "Function %s can not be used as the left-hand "
+ "side of assignment or as an operand of ++ or -- operator.")
+
+(js2-msg "msg.bad.default.value"
+ "Object's getDefaultValue() method returned an object.")
+
+(js2-msg "msg.instanceof.not.object"
+ "Can't use instanceof on a non-object.")
+
+(js2-msg "msg.instanceof.bad.prototype"
+ "'prototype' property of %s is not an object.")
+
+(js2-msg "msg.bad.radix"
+ "illegal radix %s.")
+
+;; ScriptableObject
+(js2-msg "msg.default.value"
+ "Cannot find default value for object.")
+
+(js2-msg "msg.zero.arg.ctor"
+ "Cannot load class '%s' which has no zero-parameter constructor.")
+
+(js2-msg "msg.ctor.multiple.parms"
+ "Can't define constructor or class %s since more than "
+ "one constructor has multiple parameters.")
+
+(js2-msg "msg.extend.scriptable"
+ "%s must extend ScriptableObject in order to define property %s.")
+
+(js2-msg "msg.bad.getter.parms"
+ "In order to define a property, getter %s must have zero "
+ "parameters or a single ScriptableObject parameter.")
+
+(js2-msg "msg.obj.getter.parms"
+ "Expected static or delegated getter %s to take "
+ "a ScriptableObject parameter.")
+
+(js2-msg "msg.getter.static"
+ "Getter and setter must both be static or neither be static.")
+
+(js2-msg "msg.setter.return"
+ "Setter must have void return type: %s")
+
+(js2-msg "msg.setter2.parms"
+ "Two-parameter setter must take a ScriptableObject as "
+ "its first parameter.")
+
+(js2-msg "msg.setter1.parms"
+ "Expected single parameter setter for %s")
+
+(js2-msg "msg.setter2.expected"
+ "Expected static or delegated setter %s to take two parameters.")
+
+(js2-msg "msg.setter.parms"
+ "Expected either one or two parameters for setter.")
+
+(js2-msg "msg.setter.bad.type"
+ "Unsupported parameter type '%s' in setter '%s'.")
+
+(js2-msg "msg.add.sealed"
+ "Cannot add a property to a sealed object: %s.")
+
+(js2-msg "msg.remove.sealed"
+ "Cannot remove a property from a sealed object: %s.")
+
+(js2-msg "msg.modify.sealed"
+ "Cannot modify a property of a sealed object: %s.")
+
+(js2-msg "msg.modify.readonly"
+ "Cannot modify readonly property: %s.")
+
+;; TokenStream
+(js2-msg "msg.missing.exponent"
+ "missing exponent")
+
+(js2-msg "msg.caught.nfe"
+ "number format error")
+
+(js2-msg "msg.unterminated.string.lit"
+ "unterminated string literal")
+
+(js2-msg "msg.unterminated.comment"
+ "unterminated comment")
+
+(js2-msg "msg.unterminated.re.lit"
+ "unterminated regular expression literal")
+
+(js2-msg "msg.invalid.re.flag"
+ "invalid flag after regular expression")
+
+(js2-msg "msg.no.re.input.for"
+ "no input for %s")
+
+(js2-msg "msg.illegal.character"
+ "illegal character")
+
+(js2-msg "msg.invalid.escape"
+ "invalid Unicode escape sequence")
+
+(js2-msg "msg.bad.namespace"
+ "not a valid default namespace statement. "
+ "Syntax is: default xml namespace = EXPRESSION;")
+
+(js2-msg "msg.no.trailing.numeric.literal"
+ "underscore cannot appear after last digit")
+
+(js2-msg "msg.no.consecutive.numeric.literal"
+ "underscores cannot be next to each other")
+
+(js2-msg "msg.no.numeric.separator.after.leading.zero"
+ "underscore cannot appear after leading zero")
+
+;; TokensStream warnings
+(js2-msg "msg.bad.octal.literal"
+ "illegal octal literal digit %s; "
+ "interpreting it as a decimal digit")
+
+(js2-msg "msg.missing.hex.digits"
+ "missing hexadecimal digits after '0x'")
+
+(js2-msg "msg.missing.binary.digits"
+ "missing binary digits after '0b'")
+
+(js2-msg "msg.missing.octal.digits"
+ "missing octal digits after '0o'")
+
+(js2-msg "msg.script.is.not.constructor"
+ "Script objects are not constructors.")
+
+;; Arrays
+(js2-msg "msg.arraylength.bad"
+ "Inappropriate array length.")
+
+;; Arrays
+(js2-msg "msg.arraylength.too.big"
+ "Array length %s exceeds supported capacity limit.")
+
+;; URI
+(js2-msg "msg.bad.uri"
+ "Malformed URI sequence.")
+
+;; Number
+(js2-msg "msg.bad.precision"
+ "Precision %s out of range.")
+
+;; NativeGenerator
+(js2-msg "msg.send.newborn"
+ "Attempt to send value to newborn generator")
+
+(js2-msg "msg.already.exec.gen"
+ "Already executing generator")
+
+(js2-msg "msg.StopIteration.invalid"
+ "StopIteration may not be changed to an arbitrary object.")
+
+;; Interpreter
+(js2-msg "msg.yield.closing"
+ "Yield from closing generator")
+
+;; Classes
+(js2-msg "msg.unnamed.class.stmt" ; added by js2-mode
+ "class statement requires a name")
+
+(js2-msg "msg.class.unexpected.comma" ; added by js2-mode
+ "unexpected ',' between class properties")
+
+(js2-msg "msg.unexpected.static" ; added by js2-mode
+ "unexpected 'static'")
+
+(js2-msg "msg.missing.extends" ; added by js2-mode
+ "name is required after extends")
+
+(js2-msg "msg.no.brace.class" ; added by js2-mode
+ "missing '{' before class body")
+
+(js2-msg "msg.missing.computed.rb" ; added by js2-mode
+ "missing ']' after computed property expression")
+
+;;; Tokens Buffer
+
+(defconst js2-ti-max-lookahead 2)
+(defconst js2-ti-ntokens (1+ js2-ti-max-lookahead))
+
+(defun js2-new-token (offset)
+ (let ((token (make-js2-token (+ offset js2-ts-cursor))))
+ (setq js2-ti-tokens-cursor (mod (1+ js2-ti-tokens-cursor) js2-ti-ntokens))
+ (aset js2-ti-tokens js2-ti-tokens-cursor token)
+ token))
+
+(defsubst js2-current-token ()
+ (aref js2-ti-tokens js2-ti-tokens-cursor))
+
+(defsubst js2-current-token-string ()
+ (js2-token-string (js2-current-token)))
+
+(defsubst js2-current-token-type ()
+ (js2-token-type (js2-current-token)))
+
+(defsubst js2-current-token-beg ()
+ (js2-token-beg (js2-current-token)))
+
+(defsubst js2-current-token-end ()
+ (js2-token-end (js2-current-token)))
+
+(defun js2-current-token-len ()
+ (let ((token (js2-current-token)))
+ (- (js2-token-end token)
+ (js2-token-beg token))))
+
+(defun js2-ts-seek (state)
+ (setq js2-ts-lineno (js2-ts-state-lineno state)
+ js2-ts-cursor (js2-ts-state-cursor state)
+ js2-ti-tokens (js2-ts-state-tokens state)
+ js2-ti-tokens-cursor (js2-ts-state-tokens-cursor state)
+ js2-ti-lookahead (js2-ts-state-lookahead state)))
+
+;;; Utilities
+
+(defun js2-delete-if (predicate list)
+ "Remove all items satisfying PREDICATE in LIST."
+ (cl-loop for item in list
+ if (not (funcall predicate item))
+ collect item))
+
+(defun js2-position (element list)
+ "Find 0-indexed position of ELEMENT in LIST comparing with `eq'.
+Returns nil if element is not found in the list."
+ (let ((count 0)
+ found)
+ (while (and list (not found))
+ (if (eq element (car list))
+ (setq found t)
+ (setq count (1+ count)
+ list (cdr list))))
+ (if found count)))
+
+(defun js2-find-if (predicate list)
+ "Find first item satisfying PREDICATE in LIST."
+ (let (result)
+ (while (and list (not result))
+ (if (funcall predicate (car list))
+ (setq result (car list)))
+ (setq list (cdr list)))
+ result))
+
+(defmacro js2-time (form)
+ "Evaluate FORM, discard result, and return elapsed time in sec."
+ (declare (debug t))
+ (let ((beg (make-symbol "--js2-time-beg--")))
+ `(let ((,beg (current-time)))
+ ,form
+ (/ (truncate (* (- (float-time (current-time))
+ (float-time ,beg))
+ 10000))
+ 10000.0))))
+
+(defsubst js2-same-line (pos)
+ "Return t if POS is on the same line as current point."
+ (and (>= pos (point-at-bol))
+ (<= pos (point-at-eol))))
+
+(defun js2-code-bug ()
+ "Signal an error when we encounter an unexpected code path."
+ (error "failed assertion"))
+
+(defsubst js2-record-text-property (beg end prop value)
+ "Record a text property to set when parsing finishes."
+ (push (list beg end prop value) js2-mode-deferred-properties))
+
+;; I'd like to associate errors with nodes, but for now the
+;; easiest thing to do is get the context info from the last token.
+(defun js2-record-parse-error (msg &optional arg pos len)
+ (push (list (list msg arg)
+ (or pos (js2-current-token-beg))
+ (or len (js2-current-token-len)))
+ js2-parsed-errors))
+
+(defun js2-report-error (msg &optional msg-arg pos len)
+ "Signal a syntax error or record a parse error."
+ (if js2-recover-from-parse-errors
+ (js2-record-parse-error msg msg-arg pos len)
+ (signal 'js2-syntax-error
+ (list msg
+ js2-ts-lineno
+ (save-excursion
+ (goto-char js2-ts-cursor)
+ (current-column))
+ js2-ts-hit-eof))))
+
+(defun js2-report-warning (msg &optional msg-arg pos len face)
+ (if js2-compiler-report-warning-as-error
+ (js2-report-error msg msg-arg pos len)
+ (push (list (list msg msg-arg)
+ (or pos (js2-current-token-beg))
+ (or len (js2-current-token-len))
+ face)
+ js2-parsed-warnings)))
+
+(defun js2-add-strict-warning (msg-id &optional msg-arg beg end)
+ (if js2-compiler-strict-mode
+ (js2-report-warning msg-id msg-arg beg
+ (and beg end (- end beg)))))
+
+(put 'js2-syntax-error 'error-conditions
+ '(error syntax-error js2-syntax-error))
+(put 'js2-syntax-error 'error-message "Syntax error")
+
+(put 'js2-parse-error 'error-conditions
+ '(error parse-error js2-parse-error))
+(put 'js2-parse-error 'error-message "Parse error")
+
+(defmacro js2-clear-flag (flags flag)
+ `(setq ,flags (logand ,flags (lognot ,flag))))
+
+(defmacro js2-set-flag (flags flag)
+ "Logical-or FLAG into FLAGS."
+ `(setq ,flags (logior ,flags ,flag)))
+
+(defsubst js2-flag-set-p (flags flag)
+ (/= 0 (logand flags flag)))
+
+(defsubst js2-flag-not-set-p (flags flag)
+ (zerop (logand flags flag)))
+
+;;; AST struct and function definitions
+
+;; flags for ast node property 'member-type (used for e4x operators)
+(defvar js2-property-flag #x1 "Property access: element is valid name.")
+(defvar js2-attribute-flag #x2 "x.@y or x..@y.")
+(defvar js2-descendants-flag #x4 "x..y or x..@i.")
+
+(defsubst js2-relpos (pos anchor)
+ "Convert POS to be relative to ANCHOR.
+If POS is nil, returns nil."
+ (and pos (- pos anchor)))
+
+(defun js2-make-pad (indent)
+ (if (zerop indent)
+ ""
+ (make-string (* indent js2-basic-offset) ? )))
+
+(defun js2-visit-ast (node callback)
+ "Visit every node in ast NODE with visitor CALLBACK.
+
+CALLBACK is a function that takes two arguments: (NODE END-P). It is
+called twice: once to visit the node, and again after all the node's
+children have been processed. The END-P argument is nil on the first
+call and non-nil on the second call. The return value of the callback
+affects the traversal: if non-nil, the children of NODE are processed.
+If the callback returns nil, or if the node has no children, then the
+callback is called immediately with a non-nil END-P argument.
+
+The node traversal is approximately lexical-order, although there
+are currently no guarantees around this."
+ (when node
+ (let ((vfunc (get (aref node 0) 'js2-visitor)))
+ ;; visit the node
+ (when (funcall callback node nil)
+ ;; visit the kids
+ (cond
+ ((eq vfunc 'js2-visit-none)
+ nil) ; don't even bother calling it
+ ;; Each AST node type has to define a `js2-visitor' function
+ ;; that takes a node and a callback, and calls `js2-visit-ast'
+ ;; on each child of the node.
+ (vfunc
+ (funcall vfunc node callback))
+ (t
+ (error "%s does not define a visitor-traversal function"
+ (aref node 0)))))
+ ;; call the end-visit
+ (funcall callback node t))))
+
+(cl-defstruct (js2-node
+ (:constructor nil)) ; abstract
+ "Base AST node type."
+ (type -1) ; token type
+ (pos -1) ; start position of this AST node in parsed input
+ (len 1) ; num characters spanned by the node
+ props ; optional node property list (an alist)
+ parent) ; link to parent node; null for root
+
+(defsubst js2-node-get-prop (node prop &optional default)
+ (or (cadr (assoc prop (js2-node-props node))) default))
+
+(defsubst js2-node-set-prop (node prop value)
+ (setf (js2-node-props node)
+ (cons (list prop value) (js2-node-props node))))
+
+(defun js2-fixup-starts (n nodes)
+ "Adjust the start positions of NODES to be relative to N.
+Any node in the list may be nil, for convenience."
+ (dolist (node nodes)
+ (when node
+ (setf (js2-node-pos node) (- (js2-node-pos node)
+ (js2-node-pos n))))))
+
+(defun js2-node-add-children (parent &rest nodes)
+ "Set parent node of NODES to PARENT, and return PARENT.
+Does nothing if we're not recording parent links.
+If any given node in NODES is nil, doesn't record that link."
+ (js2-fixup-starts parent nodes)
+ (dolist (node nodes)
+ (and node
+ (setf (js2-node-parent node) parent))))
+
+;; Non-recursive since it's called a frightening number of times.
+(defun js2-node-abs-pos (n)
+ (let ((pos (js2-node-pos n)))
+ (while (setq n (js2-node-parent n))
+ (setq pos (+ pos (js2-node-pos n))))
+ pos))
+
+(defsubst js2-node-abs-end (n)
+ "Return absolute buffer position of end of N."
+ (+ (js2-node-abs-pos n) (js2-node-len n)))
+
+(defun js2--struct-put (name key value)
+ (put name key value)
+ (put (intern (format "cl-struct-%s" name)) key value))
+
+;; It's important to make sure block nodes have a Lisp list for the
+;; child nodes, to limit printing recursion depth in an AST that
+;; otherwise consists of defstruct vectors. Emacs will crash printing
+;; a sufficiently large vector tree.
+
+(cl-defstruct (js2-block-node
+ (:include js2-node)
+ (:constructor make-js2-block-node (&key (type js2-BLOCK)
+ (pos (js2-current-token-beg))
+ len
+ props
+ kids)))
+ "A block of statements."
+ kids) ; a Lisp list of the child statement nodes
+
+(js2--struct-put 'js2-block-node 'js2-visitor 'js2-visit-block)
+(js2--struct-put 'js2-block-node 'js2-printer 'js2-print-block)
+
+(defun js2-visit-block (ast callback)
+ "Visit the `js2-block-node' children of AST."
+ (dolist (kid (js2-block-node-kids ast))
+ (js2-visit-ast kid callback)))
+
+(defun js2-print-block (n i)
+ (let ((pad (js2-make-pad i)))
+ (insert pad "{\n")
+ (dolist (kid (js2-block-node-kids n))
+ (js2-print-ast kid (1+ i)))
+ (insert pad "}")))
+
+(cl-defstruct (js2-scope
+ (:include js2-block-node)
+ (:constructor make-js2-scope (&key (type js2-BLOCK)
+ (pos (js2-current-token-beg))
+ len
+ kids)))
+ ;; The symbol-table is a LinkedHashMap<String,Symbol> in Rhino.
+ ;; I don't have one of those handy, so I'll use an alist for now.
+ ;; It's as fast as an emacs hashtable for up to about 50 elements,
+ ;; and is much lighter-weight to construct (both CPU and mem).
+ ;; The keys are interned strings (symbols) for faster lookup.
+ ;; Should switch to hybrid alist/hashtable eventually.
+ symbol-table ; an alist of (symbol . js2-symbol)
+ parent-scope ; a `js2-scope'
+ top) ; top-level `js2-scope' (script/function)
+
+(js2--struct-put 'js2-scope 'js2-visitor 'js2-visit-block)
+(js2--struct-put 'js2-scope 'js2-printer 'js2-print-none)
+
+(defun js2-node-get-enclosing-scope (node)
+ "Return the innermost `js2-scope' node surrounding NODE.
+Returns nil if there is no enclosing scope node."
+ (while (and (setq node (js2-node-parent node))
+ (not (js2-scope-p node))))
+ node)
+
+(defun js2-get-defining-scope (scope name &optional point)
+ "Search up scope chain from SCOPE looking for NAME, a string or symbol.
+Returns `js2-scope' in which NAME is defined, or nil if not found.
+
+If POINT is non-nil, and if the found declaration type is
+`js2-LET', also check that the declaration node is before POINT."
+ (let ((sym (if (symbolp name)
+ name
+ (intern name)))
+ result
+ (continue t))
+ (while (and scope continue)
+ (if (or
+ (let ((entry (cdr (assq sym (js2-scope-symbol-table scope)))))
+ (and entry
+ (or (not point)
+ (not (eq js2-LET (js2-symbol-decl-type entry)))
+ (>= point
+ (js2-node-abs-pos (js2-symbol-ast-node entry))))))
+ (and (eq sym 'arguments)
+ (js2-function-node-p scope)))
+ (setq continue nil
+ result scope)
+ (setq scope (js2-scope-parent-scope scope))))
+ result))
+
+(defun js2-scope-get-symbol (scope name)
+ "Return symbol table entry for NAME in SCOPE.
+NAME can be a string or symbol. Returns a `js2-symbol' or nil if not found."
+ (and (js2-scope-symbol-table scope)
+ (cdr (assq (if (symbolp name)
+ name
+ (intern name))
+ (js2-scope-symbol-table scope)))))
+
+(defun js2-scope-put-symbol (scope name symbol)
+ "Enter SYMBOL into symbol-table for SCOPE under NAME.
+NAME can be a Lisp symbol or string. SYMBOL is a `js2-symbol'."
+ (let* ((table (js2-scope-symbol-table scope))
+ (sym (if (symbolp name) name (intern name)))
+ (entry (assq sym table)))
+ (if entry
+ (setcdr entry symbol)
+ (push (cons sym symbol)
+ (js2-scope-symbol-table scope)))))
+
+(cl-defstruct (js2-symbol
+ (:constructor make-js2-symbol (decl-type name &optional ast-node)))
+ "A symbol table entry."
+ ;; One of js2-FUNCTION, js2-LP (for parameters), js2-VAR,
+ ;; js2-LET, or js2-CONST
+ decl-type
+ name ; string
+ ast-node) ; a `js2-node'
+
+(cl-defstruct (js2-error-node
+ (:include js2-node)
+ (:constructor make-js2-error-node (&key (type js2-ERROR)
+ (pos (js2-current-token-beg))
+ len)))
+ "AST node representing a parse error.")
+
+(js2--struct-put 'js2-error-node 'js2-visitor 'js2-visit-none)
+(js2--struct-put 'js2-error-node 'js2-printer 'js2-print-none)
+
+(cl-defstruct (js2-script-node
+ (:include js2-scope)
+ (:constructor make-js2-script-node (&key (type js2-SCRIPT)
+ (pos (js2-current-token-beg))
+ len)))
+ functions ; Lisp list of nested functions
+ regexps ; Lisp list of (string . flags)
+ symbols ; alist (every symbol gets unique index)
+ (param-count 0)
+ var-names ; vector of string names
+ consts ; bool-vector matching var-decls
+ (temp-number 0)) ; for generating temp variables
+
+(js2--struct-put 'js2-script-node 'js2-visitor 'js2-visit-block)
+(js2--struct-put 'js2-script-node 'js2-printer 'js2-print-script)
+
+(defun js2-print-script (node indent)
+ (dolist (kid (js2-block-node-kids node))
+ (js2-print-ast kid indent)))
+
+(cl-defstruct (js2-ast-root
+ (:include js2-script-node)
+ (:constructor make-js2-ast-root (&key (type js2-SCRIPT)
+ (pos (js2-current-token-beg))
+ len
+ buffer)))
+ "The root node of a js2 AST."
+ buffer ; the source buffer from which the code was parsed
+ comments ; a Lisp list of comments, ordered by start position
+ errors ; a Lisp list of errors found during parsing
+ warnings ; a Lisp list of warnings found during parsing
+ node-count) ; number of nodes in the tree, including the root
+
+(js2--struct-put 'js2-ast-root 'js2-visitor 'js2-visit-ast-root)
+(js2--struct-put 'js2-ast-root 'js2-printer 'js2-print-script)
+
+(defun js2-visit-ast-root (ast callback)
+ (dolist (kid (js2-ast-root-kids ast))
+ (js2-visit-ast kid callback))
+ (dolist (comment (js2-ast-root-comments ast))
+ (js2-visit-ast comment callback)))
+
+(cl-defstruct (js2-comment-node
+ (:include js2-node)
+ (:constructor make-js2-comment-node (&key (type js2-COMMENT)
+ (pos (js2-current-token-beg))
+ len
+ format)))
+ format) ; 'line, 'block, 'jsdoc or 'html
+
+(js2--struct-put 'js2-comment-node 'js2-visitor 'js2-visit-none)
+(js2--struct-put 'js2-comment-node 'js2-printer 'js2-print-comment)
+
+(defun js2-print-comment (n i)
+ ;; We really ought to link end-of-line comments to their nodes.
+ ;; Or maybe we could add a new comment type, 'endline.
+ (insert (js2-make-pad i)
+ (js2-node-string n)))
+
+(cl-defstruct (js2-expr-stmt-node
+ (:include js2-node)
+ (:constructor make-js2-expr-stmt-node (&key (type js2-EXPR_VOID)
+ (pos js2-ts-cursor)
+ len
+ expr)))
+ "An expression statement."
+ expr)
+
+(defsubst js2-expr-stmt-node-set-has-result (node)
+ "Change NODE type to `js2-EXPR_RESULT'. Used for code generation."
+ (setf (js2-node-type node) js2-EXPR_RESULT))
+
+(js2--struct-put 'js2-expr-stmt-node 'js2-visitor 'js2-visit-expr-stmt-node)
+(js2--struct-put 'js2-expr-stmt-node 'js2-printer 'js2-print-expr-stmt-node)
+
+(defun js2-visit-expr-stmt-node (n v)
+ (js2-visit-ast (js2-expr-stmt-node-expr n) v))
+
+(defun js2-print-expr-stmt-node (n indent)
+ (js2-print-ast (js2-expr-stmt-node-expr n) indent)
+ (insert ";\n"))
+
+(cl-defstruct (js2-loop-node
+ (:include js2-scope)
+ (:constructor nil))
+ "Abstract supertype of loop nodes."
+ body ; a `js2-block-node'
+ lp ; position of left-paren, nil if omitted
+ rp) ; position of right-paren, nil if omitted
+
+(cl-defstruct (js2-do-node
+ (:include js2-loop-node)
+ (:constructor make-js2-do-node (&key (type js2-DO)
+ (pos (js2-current-token-beg))
+ len
+ body
+ condition
+ while-pos
+ lp
+ rp)))
+ "AST node for do-loop."
+ condition ; while (expression)
+ while-pos) ; buffer position of 'while' keyword
+
+(js2--struct-put 'js2-do-node 'js2-visitor 'js2-visit-do-node)
+(js2--struct-put 'js2-do-node 'js2-printer 'js2-print-do-node)
+
+(defun js2-visit-do-node (n v)
+ (js2-visit-ast (js2-do-node-body n) v)
+ (js2-visit-ast (js2-do-node-condition n) v))
+
+(defun js2-print-do-node (n i)
+ (let ((pad (js2-make-pad i)))
+ (insert pad "do {\n")
+ (dolist (kid (js2-block-node-kids (js2-do-node-body n)))
+ (js2-print-ast kid (1+ i)))
+ (insert pad "} while (")
+ (js2-print-ast (js2-do-node-condition n) 0)
+ (insert ");\n")))
+
+(cl-defstruct (js2-export-node
+ (:include js2-node)
+ (:constructor make-js2-export-node (&key (type js2-EXPORT)
+ (pos (js2-current-token-beg))
+ len
+ exports-list
+ from-clause
+ declaration
+ default)))
+ "AST node for an export statement. There are many things that can be exported,
+so many of its properties will be nil.
+"
+ exports-list ; lisp list of js2-export-binding-node to export
+ from-clause ; js2-from-clause-node for re-exporting symbols from another module
+ declaration ; js2-var-decl-node (var, let, const) or js2-class-node
+ default) ; js2-function-node or js2-assign-node
+
+(js2--struct-put 'js2-export-node 'js2-visitor 'js2-visit-export-node)
+(js2--struct-put 'js2-export-node 'js2-printer 'js2-print-export-node)
+
+(defun js2-visit-export-node (n v)
+ (let ((exports-list (js2-export-node-exports-list n))
+ (from (js2-export-node-from-clause n))
+ (declaration (js2-export-node-declaration n))
+ (default (js2-export-node-default n)))
+ (when exports-list
+ (dolist (export exports-list)
+ (js2-visit-ast export v)))
+ (when from
+ (js2-visit-ast from v))
+ (when declaration
+ (js2-visit-ast declaration v))
+ (when default
+ (js2-visit-ast default v))))
+
+(defun js2-print-export-node (n i)
+ (let ((pad (js2-make-pad i))
+ (exports-list (js2-export-node-exports-list n))
+ (from (js2-export-node-from-clause n))
+ (declaration (js2-export-node-declaration n))
+ (default (js2-export-node-default n)))
+ (insert pad "export ")
+ (cond
+ (default
+ (insert "default ")
+ (js2-print-ast default i))
+ (declaration
+ (js2-print-ast declaration i))
+ ((and exports-list from)
+ (js2-print-named-imports exports-list)
+ (insert " ")
+ (js2-print-from-clause from))
+ (from
+ (insert "* ")
+ (js2-print-from-clause from))
+ (exports-list
+ (js2-print-named-imports exports-list)))
+ (unless (or (and default (not (js2-assign-node-p default)))
+ (and declaration (or (js2-function-node-p declaration)
+ (js2-class-node-p declaration))))
+ (insert ";\n"))))
+
+(cl-defstruct (js2-while-node
+ (:include js2-loop-node)
+ (:constructor make-js2-while-node (&key (type js2-WHILE)
+ (pos (js2-current-token-beg))
+ len body
+ condition lp
+ rp)))
+ "AST node for while-loop."
+ condition) ; while-condition
+
+(js2--struct-put 'js2-while-node 'js2-visitor 'js2-visit-while-node)
+(js2--struct-put 'js2-while-node 'js2-printer 'js2-print-while-node)
+
+(defun js2-visit-while-node (n v)
+ (js2-visit-ast (js2-while-node-condition n) v)
+ (js2-visit-ast (js2-while-node-body n) v))
+
+(defun js2-print-while-node (n i)
+ (let ((pad (js2-make-pad i)))
+ (insert pad "while (")
+ (js2-print-ast (js2-while-node-condition n) 0)
+ (insert ") {\n")
+ (js2-print-body (js2-while-node-body n) (1+ i))
+ (insert pad "}\n")))
+
+(cl-defstruct (js2-for-node
+ (:include js2-loop-node)
+ (:constructor make-js2-for-node (&key (type js2-FOR)
+ (pos js2-ts-cursor)
+ len body init
+ condition
+ update lp rp)))
+ "AST node for a C-style for-loop."
+ init ; initialization expression
+ condition ; loop condition
+ update) ; update clause
+
+(js2--struct-put 'js2-for-node 'js2-visitor 'js2-visit-for-node)
+(js2--struct-put 'js2-for-node 'js2-printer 'js2-print-for-node)
+
+(defun js2-visit-for-node (n v)
+ (js2-visit-ast (js2-for-node-init n) v)
+ (js2-visit-ast (js2-for-node-condition n) v)
+ (js2-visit-ast (js2-for-node-update n) v)
+ (js2-visit-ast (js2-for-node-body n) v))
+
+(defun js2-print-for-node (n i)
+ (let ((pad (js2-make-pad i)))
+ (insert pad "for (")
+ (js2-print-ast (js2-for-node-init n) 0)
+ (insert "; ")
+ (js2-print-ast (js2-for-node-condition n) 0)
+ (insert "; ")
+ (js2-print-ast (js2-for-node-update n) 0)
+ (insert ") {\n")
+ (js2-print-body (js2-for-node-body n) (1+ i))
+ (insert pad "}\n")))
+
+(cl-defstruct (js2-for-in-node
+ (:include js2-loop-node)
+ (:constructor make-js2-for-in-node (&key (type js2-FOR)
+ (pos js2-ts-cursor)
+ len body
+ iterator
+ object
+ in-pos
+ each-pos
+ await-pos
+ foreach-p forof-p forawait-p
+ lp rp)))
+ "AST node for a for..in loop."
+ iterator ; [var] foo in ...
+ object ; object over which we're iterating
+ in-pos ; buffer position of 'in' keyword
+ each-pos ; buffer position of 'each' keyword, if foreach-p
+ await-pos ; buffer position of 'await' keyword, if forawait-p
+ foreach-p ; t if it's a for-each loop
+ forawait-p ; t if it's a for-await loop
+ forof-p) ; t if it's a for-of loop
+
+(js2--struct-put 'js2-for-in-node 'js2-visitor 'js2-visit-for-in-node)
+(js2--struct-put 'js2-for-in-node 'js2-printer 'js2-print-for-in-node)
+
+(defun js2-visit-for-in-node (n v)
+ (js2-visit-ast (js2-for-in-node-iterator n) v)
+ (js2-visit-ast (js2-for-in-node-object n) v)
+ (js2-visit-ast (js2-for-in-node-body n) v))
+
+(defun js2-print-for-in-node (n i)
+ (let ((pad (js2-make-pad i))
+ (foreach (js2-for-in-node-foreach-p n))
+ (forawait (js2-for-in-node-forawait-p n))
+ (forof (js2-for-in-node-forof-p n)))
+ (insert pad "for ")
+ (if foreach
+ (insert "each "))
+ (if forawait
+ (insert "await "))
+ (insert "(")
+ (js2-print-ast (js2-for-in-node-iterator n) 0)
+ (insert (if forof " of " " in "))
+ (js2-print-ast (js2-for-in-node-object n) 0)
+ (insert ") {\n")
+ (js2-print-body (js2-for-in-node-body n) (1+ i))
+ (insert pad "}\n")))
+
+(cl-defstruct (js2-return-node
+ (:include js2-node)
+ (:constructor make-js2-return-node (&key (type js2-RETURN)
+ (pos js2-ts-cursor)
+ len
+ retval)))
+ "AST node for a return statement."
+ retval) ; expression to return, or 'undefined
+
+(js2--struct-put 'js2-return-node 'js2-visitor 'js2-visit-return-node)
+(js2--struct-put 'js2-return-node 'js2-printer 'js2-print-return-node)
+
+(defun js2-visit-return-node (n v)
+ (js2-visit-ast (js2-return-node-retval n) v))
+
+(defun js2-print-return-node (n i)
+ (insert (js2-make-pad i) "return")
+ (when (js2-return-node-retval n)
+ (insert " ")
+ (js2-print-ast (js2-return-node-retval n) 0))
+ (insert ";\n"))
+
+(cl-defstruct (js2-if-node
+ (:include js2-node)
+ (:constructor make-js2-if-node (&key (type js2-IF)
+ (pos js2-ts-cursor)
+ len condition
+ then-part
+ else-pos
+ else-part lp
+ rp)))
+ "AST node for an if-statement."
+ condition ; expression
+ then-part ; statement or block
+ else-pos ; optional buffer position of 'else' keyword
+ else-part ; optional statement or block
+ lp ; position of left-paren, nil if omitted
+ rp) ; position of right-paren, nil if omitted
+
+(js2--struct-put 'js2-if-node 'js2-visitor 'js2-visit-if-node)
+(js2--struct-put 'js2-if-node 'js2-printer 'js2-print-if-node)
+
+(defun js2-visit-if-node (n v)
+ (js2-visit-ast (js2-if-node-condition n) v)
+ (js2-visit-ast (js2-if-node-then-part n) v)
+ (js2-visit-ast (js2-if-node-else-part n) v))
+
+(defun js2-print-if-node (n i)
+ (let ((pad (js2-make-pad i))
+ (then-part (js2-if-node-then-part n))
+ (else-part (js2-if-node-else-part n)))
+ (insert pad "if (")
+ (js2-print-ast (js2-if-node-condition n) 0)
+ (insert ") {\n")
+ (js2-print-body then-part (1+ i))
+ (insert pad "}")
+ (cond
+ ((not else-part)
+ (insert "\n"))
+ ((js2-if-node-p else-part)
+ (insert " else ")
+ (js2-print-body else-part i))
+ (t
+ (insert " else {\n")
+ (js2-print-body else-part (1+ i))
+ (insert pad "}\n")))))
+
+(cl-defstruct (js2-export-binding-node
+ (:include js2-node)
+ (:constructor make-js2-export-binding-node (&key (type -1)
+ pos
+ len
+ local-name
+ extern-name)))
+ "AST node for an external symbol binding.
+It contains a local-name node which is the name of the value in the
+current scope, and extern-name which is the name of the value in the
+imported or exported scope. By default these are the same, but if the
+name is aliased as in {foo as bar}, it would have an extern-name node
+containing `foo' and a local-name node containing `bar'."
+ local-name ; js2-name-node with the variable name in this scope
+ extern-name) ; js2-name-node with the value name in the exporting module
+
+(js2--struct-put 'js2-export-binding-node 'js2-printer 'js2-print-extern-binding)
+(js2--struct-put 'js2-export-binding-node 'js2-visitor 'js2-visit-extern-binding)
+
+(defun js2-visit-extern-binding (n v)
+ "Visit an extern binding node. First visit the local-name, and, if
+different, visit the extern-name."
+ (let ((local-name (js2-export-binding-node-local-name n))
+ (extern-name (js2-export-binding-node-extern-name n)))
+ (when local-name
+ (js2-visit-ast local-name v))
+ (when (not (equal local-name extern-name))
+ (js2-visit-ast extern-name v))))
+
+(defun js2-print-extern-binding (n _i)
+ "Print a representation of a single extern binding. E.g. `foo' or
+`foo as bar'."
+ (let ((local-name (js2-export-binding-node-local-name n))
+ (extern-name (js2-export-binding-node-extern-name n)))
+ (insert (js2-name-node-name extern-name))
+ (when (not (equal local-name extern-name))
+ (insert " as ")
+ (insert (js2-name-node-name local-name)))))
+
+
+(cl-defstruct (js2-import-node
+ (:include js2-node)
+ (:constructor make-js2-import-node (&key (type js2-IMPORT)
+ (pos (js2-current-token-beg))
+ len
+ import
+ from
+ module-id)))
+ "AST node for an import statement. It follows the form
+
+import ModuleSpecifier;
+import ImportClause FromClause;"
+ import ; js2-import-clause-node specifying which names are to imported.
+ from ; js2-from-clause-node indicating the module from which to import.
+ module-id) ; module-id of the import. E.g. 'src/mylib'.
+
+(js2--struct-put 'js2-import-node 'js2-printer 'js2-print-import)
+(js2--struct-put 'js2-import-node 'js2-visitor 'js2-visit-import)
+
+(defun js2-visit-import (n v)
+ (let ((import-clause (js2-import-node-import n))
+ (from-clause (js2-import-node-from n)))
+ (when import-clause
+ (js2-visit-ast import-clause v))
+ (when from-clause
+ (js2-visit-ast from-clause v))))
+
+(defun js2-print-import (n i)
+ "Prints a representation of the import node"
+ (let ((pad (js2-make-pad i))
+ (import-clause (js2-import-node-import n))
+ (from-clause (js2-import-node-from n))
+ (module-id (js2-import-node-module-id n)))
+ (insert pad "import ")
+ (if import-clause
+ (progn
+ (js2-print-import-clause import-clause)
+ (insert " ")
+ (js2-print-from-clause from-clause))
+ (insert "'")
+ (insert module-id)
+ (insert "'"))
+ (insert ";\n")))
+
+(cl-defstruct (js2-import-clause-node
+ (:include js2-node)
+ (:constructor make-js2-import-clause-node (&key (type -1)
+ pos
+ len
+ namespace-import
+ named-imports
+ default-binding)))
+ "AST node corresponding to the import clause of an import statement. This is
+the portion of the import that bindings names from the external context to the
+local context."
+ namespace-import ; js2-namespace-import-node. E.g. '* as lib'
+ named-imports ; lisp list of js2-export-binding-node for all named imports.
+ default-binding) ; js2-export-binding-node for the default import binding
+
+(js2--struct-put 'js2-import-clause-node 'js2-visitor 'js2-visit-import-clause)
+(js2--struct-put 'js2-import-clause-node 'js2-printer 'js2-print-import-clause)
+
+(defun js2-visit-import-clause (n v)
+ (let ((ns-import (js2-import-clause-node-namespace-import n))
+ (named-imports (js2-import-clause-node-named-imports n))
+ (default (js2-import-clause-node-default-binding n)))
+ (when default
+ (js2-visit-ast default v))
+ (when ns-import
+ (js2-visit-ast ns-import v))
+ (when named-imports
+ (dolist (import named-imports)
+ (js2-visit-ast import v)))))
+
+(defun js2-print-import-clause (n)
+ (let ((ns-import (js2-import-clause-node-namespace-import n))
+ (named-imports (js2-import-clause-node-named-imports n))
+ (default (js2-import-clause-node-default-binding n)))
+ (cond
+ ((and default ns-import)
+ (js2-print-ast default)
+ (insert ", ")
+ (js2-print-namespace-import ns-import))
+ ((and default named-imports)
+ (js2-print-ast default)
+ (insert ", ")
+ (js2-print-named-imports named-imports))
+ (default
+ (js2-print-ast default))
+ (ns-import
+ (js2-print-namespace-import ns-import))
+ (named-imports
+ (js2-print-named-imports named-imports)))))
+
+(defun js2-print-namespace-import (node)
+ (insert "* as ")
+ (insert (js2-name-node-name (js2-namespace-import-node-name node))))
+
+(defun js2-print-named-imports (imports)
+ (insert "{")
+ (let ((len (length imports))
+ (n 0))
+ (while (< n len)
+ (js2-print-extern-binding (nth n imports) 0)
+ (unless (= n (- len 1))
+ (insert ", "))
+ (setq n (+ n 1))))
+ (insert "}"))
+
+(cl-defstruct (js2-namespace-import-node
+ (:include js2-node)
+ (:constructor make-js2-namespace-import-node (&key (type -1)
+ pos
+ len
+ name)))
+ "AST node for a complete namespace import.
+E.g. the `* as lib' expression in:
+
+import * as lib from \\='src/lib\\='
+
+It contains a single name node referring to the bound name."
+ name) ; js2-name-node of the bound name.
+
+(defun js2-visit-namespace-import (n v)
+ (js2-visit-ast (js2-namespace-import-node-name n) v))
+
+(js2--struct-put 'js2-namespace-import-node 'js2-visitor 'js2-visit-namespace-import)
+(js2--struct-put 'js2-namespace-import-node 'js2-printer 'js2-print-namespace-import)
+
+(cl-defstruct (js2-from-clause-node
+ (:include js2-node)
+ (:constructor make-js2-from-clause-node (&key (type js2-NAME)
+ pos
+ len
+ module-id
+ metadata-p)))
+ "AST node for the from clause in an import or export statement.
+E.g. from \\='my/module\\='. It can refere to either an external module, or to the
+modules metadata itself."
+ module-id ; string containing the module specifier.
+ metadata-p) ; true if this clause refers to the module's metadata
+
+(js2--struct-put 'js2-from-clause-node 'js2-visitor 'js2-visit-none)
+(js2--struct-put 'js2-from-clause-node 'js2-printer 'js2-print-from-clause)
+
+(defun js2-print-from-clause (n)
+ (insert "from ")
+ (if (js2-from-clause-node-metadata-p n)
+ (insert "this module")
+ (insert "'")
+ (insert (js2-from-clause-node-module-id n))
+ (insert "'")))
+
+(cl-defstruct (js2-try-node
+ (:include js2-node)
+ (:constructor make-js2-try-node (&key (type js2-TRY)
+ (pos js2-ts-cursor)
+ len
+ try-block
+ catch-clauses
+ finally-block)))
+ "AST node for a try-statement."
+ try-block
+ catch-clauses ; a Lisp list of `js2-catch-node'
+ finally-block) ; a `js2-finally-node'
+
+(js2--struct-put 'js2-try-node 'js2-visitor 'js2-visit-try-node)
+(js2--struct-put 'js2-try-node 'js2-printer 'js2-print-try-node)
+
+(defun js2-visit-try-node (n v)
+ (js2-visit-ast (js2-try-node-try-block n) v)
+ (dolist (clause (js2-try-node-catch-clauses n))
+ (js2-visit-ast clause v))
+ (js2-visit-ast (js2-try-node-finally-block n) v))
+
+(defun js2-print-try-node (n i)
+ (let ((pad (js2-make-pad i))
+ (catches (js2-try-node-catch-clauses n))
+ (finally (js2-try-node-finally-block n)))
+ (insert pad "try {\n")
+ (js2-print-body (js2-try-node-try-block n) (1+ i))
+ (insert pad "}")
+ (when catches
+ (dolist (catch catches)
+ (js2-print-ast catch i)))
+ (if finally
+ (js2-print-ast finally i)
+ (insert "\n"))))
+
+(cl-defstruct (js2-catch-node
+ (:include js2-scope)
+ (:constructor make-js2-catch-node (&key (type js2-CATCH)
+ (pos js2-ts-cursor)
+ len
+ param
+ guard-kwd
+ guard-expr
+ lp rp)))
+ "AST node for a catch clause."
+ param ; destructuring form or simple name node
+ guard-kwd ; relative buffer position of "if" in "catch (x if ...)"
+ guard-expr ; catch condition, a `js2-node'
+ lp ; buffer position of left-paren, nil if omitted
+ rp) ; buffer position of right-paren, nil if omitted
+
+(js2--struct-put 'js2-catch-node 'js2-visitor 'js2-visit-catch-node)
+(js2--struct-put 'js2-catch-node 'js2-printer 'js2-print-catch-node)
+
+(defun js2-visit-catch-node (n v)
+ (js2-visit-ast (js2-catch-node-param n) v)
+ (when (js2-catch-node-guard-kwd n)
+ (js2-visit-ast (js2-catch-node-guard-expr n) v))
+ (js2-visit-block n v))
+
+(defun js2-print-catch-node (n i)
+ (let ((pad (js2-make-pad i))
+ (guard-kwd (js2-catch-node-guard-kwd n))
+ (guard-expr (js2-catch-node-guard-expr n)))
+ (insert " catch ")
+ (when (js2-catch-node-lp n)
+ (insert "(")
+ (js2-print-ast (js2-catch-node-param n) 0)
+ (when guard-kwd
+ (insert " if ")
+ (js2-print-ast guard-expr 0))
+ (insert ") "))
+ (insert "{\n")
+ (js2-print-body n (1+ i))
+ (insert pad "}")))
+
+(cl-defstruct (js2-finally-node
+ (:include js2-node)
+ (:constructor make-js2-finally-node (&key (type js2-FINALLY)
+ (pos js2-ts-cursor)
+ len body)))
+ "AST node for a finally clause."
+ body) ; a `js2-node', often but not always a block node
+
+(js2--struct-put 'js2-finally-node 'js2-visitor 'js2-visit-finally-node)
+(js2--struct-put 'js2-finally-node 'js2-printer 'js2-print-finally-node)
+
+(defun js2-visit-finally-node (n v)
+ (js2-visit-ast (js2-finally-node-body n) v))
+
+(defun js2-print-finally-node (n i)
+ (let ((pad (js2-make-pad i)))
+ (insert " finally {\n")
+ (js2-print-body (js2-finally-node-body n) (1+ i))
+ (insert pad "}\n")))
+
+(cl-defstruct (js2-switch-node
+ (:include js2-scope)
+ (:constructor make-js2-switch-node (&key (type js2-SWITCH)
+ (pos js2-ts-cursor)
+ len
+ discriminant
+ cases lp
+ rp)))
+ "AST node for a switch statement."
+ discriminant ; a `js2-node' (switch expression)
+ cases ; a Lisp list of `js2-case-node'
+ lp ; position of open-paren for discriminant, nil if omitted
+ rp) ; position of close-paren for discriminant, nil if omitted
+
+(js2--struct-put 'js2-switch-node 'js2-visitor 'js2-visit-switch-node)
+(js2--struct-put 'js2-switch-node 'js2-printer 'js2-print-switch-node)
+
+(defun js2-visit-switch-node (n v)
+ (js2-visit-ast (js2-switch-node-discriminant n) v)
+ (dolist (c (js2-switch-node-cases n))
+ (js2-visit-ast c v)))
+
+(defun js2-print-switch-node (n i)
+ (let ((pad (js2-make-pad i))
+ (cases (js2-switch-node-cases n)))
+ (insert pad "switch (")
+ (js2-print-ast (js2-switch-node-discriminant n) 0)
+ (insert ") {\n")
+ (dolist (case cases)
+ (js2-print-ast case i))
+ (insert pad "}\n")))
+
+(cl-defstruct (js2-case-node
+ (:include js2-block-node)
+ (:constructor make-js2-case-node (&key (type js2-CASE)
+ (pos js2-ts-cursor)
+ len kids expr)))
+ "AST node for a case clause of a switch statement."
+ expr) ; the case expression (nil for default)
+
+(js2--struct-put 'js2-case-node 'js2-visitor 'js2-visit-case-node)
+(js2--struct-put 'js2-case-node 'js2-printer 'js2-print-case-node)
+
+(defun js2-visit-case-node (n v)
+ (js2-visit-ast (js2-case-node-expr n) v)
+ (js2-visit-block n v))
+
+(defun js2-print-case-node (n i)
+ (let ((pad (js2-make-pad i))
+ (expr (js2-case-node-expr n)))
+ (insert pad)
+ (if (null expr)
+ (insert "default:\n")
+ (insert "case ")
+ (js2-print-ast expr 0)
+ (insert ":\n"))
+ (dolist (kid (js2-case-node-kids n))
+ (js2-print-ast kid (1+ i)))))
+
+(cl-defstruct (js2-throw-node
+ (:include js2-node)
+ (:constructor make-js2-throw-node (&key (type js2-THROW)
+ (pos js2-ts-cursor)
+ len expr)))
+ "AST node for a throw statement."
+ expr) ; the expression to throw
+
+(js2--struct-put 'js2-throw-node 'js2-visitor 'js2-visit-throw-node)
+(js2--struct-put 'js2-throw-node 'js2-printer 'js2-print-throw-node)
+
+(defun js2-visit-throw-node (n v)
+ (js2-visit-ast (js2-throw-node-expr n) v))
+
+(defun js2-print-throw-node (n i)
+ (insert (js2-make-pad i) "throw ")
+ (js2-print-ast (js2-throw-node-expr n) 0)
+ (insert ";\n"))
+
+(cl-defstruct (js2-with-node
+ (:include js2-node)
+ (:constructor make-js2-with-node (&key (type js2-WITH)
+ (pos js2-ts-cursor)
+ len object
+ body lp rp)))
+ "AST node for a with-statement."
+ object
+ body
+ lp ; buffer position of left-paren around object, nil if omitted
+ rp) ; buffer position of right-paren around object, nil if omitted
+
+(js2--struct-put 'js2-with-node 'js2-visitor 'js2-visit-with-node)
+(js2--struct-put 'js2-with-node 'js2-printer 'js2-print-with-node)
+
+(defun js2-visit-with-node (n v)
+ (js2-visit-ast (js2-with-node-object n) v)
+ (js2-visit-ast (js2-with-node-body n) v))
+
+(defun js2-print-with-node (n i)
+ (let ((pad (js2-make-pad i)))
+ (insert pad "with (")
+ (js2-print-ast (js2-with-node-object n) 0)
+ (insert ") {\n")
+ (js2-print-body (js2-with-node-body n) (1+ i))
+ (insert pad "}\n")))
+
+(cl-defstruct (js2-label-node
+ (:include js2-node)
+ (:constructor make-js2-label-node (&key (type js2-LABEL)
+ (pos js2-ts-cursor)
+ len name)))
+ "AST node for a statement label or case label."
+ name ; a string
+ loop) ; for validating and code-generating continue-to-label
+
+(js2--struct-put 'js2-label-node 'js2-visitor 'js2-visit-none)
+(js2--struct-put 'js2-label-node 'js2-printer 'js2-print-label)
+
+(defun js2-print-label (n i)
+ (insert (js2-make-pad i)
+ (js2-label-node-name n)
+ ":\n"))
+
+(cl-defstruct (js2-labeled-stmt-node
+ (:include js2-node)
+ ;; type needs to be in `js2-side-effecting-tokens' to avoid spurious
+ ;; no-side-effects warnings, hence js2-EXPR_RESULT.
+ (:constructor make-js2-labeled-stmt-node (&key (type js2-EXPR_RESULT)
+ (pos js2-ts-cursor)
+ len labels stmt)))
+ "AST node for a statement with one or more labels.
+Multiple labels for a statement are collapsed into the labels field."
+ labels ; Lisp list of `js2-label-node'
+ stmt) ; the statement these labels are for
+
+(js2--struct-put 'js2-labeled-stmt-node 'js2-visitor 'js2-visit-labeled-stmt)
+(js2--struct-put 'js2-labeled-stmt-node 'js2-printer 'js2-print-labeled-stmt)
+
+(defun js2-get-label-by-name (lbl-stmt name)
+ "Return a `js2-label-node' by NAME from LBL-STMT's labels list.
+Returns nil if no such label is in the list."
+ (let ((label-list (js2-labeled-stmt-node-labels lbl-stmt))
+ result)
+ (while (and label-list (not result))
+ (if (string= (js2-label-node-name (car label-list)) name)
+ (setq result (car label-list))
+ (setq label-list (cdr label-list))))
+ result))
+
+(defun js2-visit-labeled-stmt (n v)
+ (dolist (label (js2-labeled-stmt-node-labels n))
+ (js2-visit-ast label v))
+ (js2-visit-ast (js2-labeled-stmt-node-stmt n) v))
+
+(defun js2-print-labeled-stmt (n i)
+ (dolist (label (js2-labeled-stmt-node-labels n))
+ (js2-print-ast label i))
+ (js2-print-ast (js2-labeled-stmt-node-stmt n) i))
+
+(defun js2-labeled-stmt-node-contains (node label)
+ "Return t if NODE contains LABEL in its label set.
+NODE is a `js2-labels-node'. LABEL is an identifier."
+ (cl-loop for nl in (js2-labeled-stmt-node-labels node)
+ if (string= label (js2-label-node-name nl))
+ return t
+ finally return nil))
+
+(defsubst js2-labeled-stmt-node-add-label (node label)
+ "Add a `js2-label-node' to the label set for this statement."
+ (setf (js2-labeled-stmt-node-labels node)
+ (nconc (js2-labeled-stmt-node-labels node) (list label))))
+
+(cl-defstruct (js2-jump-node
+ (:include js2-node)
+ (:constructor nil))
+ "Abstract supertype of break and continue nodes."
+ label ; `js2-name-node' for location of label identifier, if present
+ target) ; target js2-labels-node or loop/switch statement
+
+(defun js2-visit-jump-node (n v)
+ ;; We don't visit the target, since it's a back-link.
+ (js2-visit-ast (js2-jump-node-label n) v))
+
+(cl-defstruct (js2-break-node
+ (:include js2-jump-node)
+ (:constructor make-js2-break-node (&key (type js2-BREAK)
+ (pos js2-ts-cursor)
+ len label target)))
+ "AST node for a break statement.
+The label field is a `js2-name-node', possibly nil, for the named label
+if provided. E.g. in `break foo', it represents `foo'. The target field
+is the target of the break - a label node or enclosing loop/switch statement.")
+
+(js2--struct-put 'js2-break-node 'js2-visitor 'js2-visit-jump-node)
+(js2--struct-put 'js2-break-node 'js2-printer 'js2-print-break-node)
+
+(defun js2-print-break-node (n i)
+ (insert (js2-make-pad i) "break")
+ (when (js2-break-node-label n)
+ (insert " ")
+ (js2-print-ast (js2-break-node-label n) 0))
+ (insert ";\n"))
+
+(cl-defstruct (js2-continue-node
+ (:include js2-jump-node)
+ (:constructor make-js2-continue-node (&key (type js2-CONTINUE)
+ (pos js2-ts-cursor)
+ len label target)))
+ "AST node for a continue statement.
+The label field is the user-supplied enclosing label name, a `js2-name-node'.
+It is nil if continue specifies no label. The target field is the jump target:
+a `js2-label-node' or the innermost enclosing loop.")
+
+(js2--struct-put 'js2-continue-node 'js2-visitor 'js2-visit-jump-node)
+(js2--struct-put 'js2-continue-node 'js2-printer 'js2-print-continue-node)
+
+(defun js2-print-continue-node (n i)
+ (insert (js2-make-pad i) "continue")
+ (when (js2-continue-node-label n)
+ (insert " ")
+ (js2-print-ast (js2-continue-node-label n) 0))
+ (insert ";\n"))
+
+(cl-defstruct (js2-function-node
+ (:include js2-script-node)
+ (:constructor make-js2-function-node (&key (type js2-FUNCTION)
+ (pos js2-ts-cursor)
+ len
+ (ftype 'FUNCTION)
+ (form 'FUNCTION_STATEMENT)
+ (name "")
+ params rest-p
+ body
+ generator-type
+ async
+ lp rp)))
+ "AST node for a function declaration.
+The `params' field is a Lisp list of nodes. Each node is either a simple
+`js2-name-node', or if it's a destructuring-assignment parameter, a
+`js2-array-node' or `js2-object-node'."
+ ftype ; FUNCTION, GETTER or SETTER
+ form ; FUNCTION_{STATEMENT|EXPRESSION|ARROW}
+ name ; function name (a `js2-name-node', or nil if anonymous)
+ params ; a Lisp list of destructuring forms or simple name nodes
+ rest-p ; if t, the last parameter is rest parameter
+ body ; a `js2-block-node' or expression node (1.8 only)
+ lp ; position of arg-list open-paren, or nil if omitted
+ rp ; position of arg-list close-paren, or nil if omitted
+ ignore-dynamic ; ignore value of the dynamic-scope flag (interpreter only)
+ needs-activation ; t if we need an activation object for this frame
+ generator-type ; STAR, LEGACY, COMPREHENSION or nil
+ async ; t if the function is defined as `async function`
+ member-expr) ; nonstandard Ecma extension from Rhino
+
+(js2--struct-put 'js2-function-node 'js2-visitor 'js2-visit-function-node)
+(js2--struct-put 'js2-function-node 'js2-printer 'js2-print-function-node)
+
+(defun js2-visit-function-node (n v)
+ (js2-visit-ast (js2-function-node-name n) v)
+ (dolist (p (js2-function-node-params n))
+ (js2-visit-ast p v))
+ (js2-visit-ast (js2-function-node-body n) v))
+
+(defun js2-print-function-node (n i)
+ (let* ((pad (js2-make-pad i))
+ (method (js2-node-get-prop n 'METHOD_TYPE))
+ (name (or (js2-function-node-name n)
+ (js2-function-node-member-expr n)))
+ (params (js2-function-node-params n))
+ (arrow (eq (js2-function-node-form n) 'FUNCTION_ARROW))
+ (rest-p (js2-function-node-rest-p n))
+ (body (js2-function-node-body n))
+ (expr (not (eq (js2-function-node-form n) 'FUNCTION_STATEMENT))))
+ (unless method
+ (insert pad)
+ (when (js2-function-node-async n) (insert "async "))
+ (unless arrow (insert "function"))
+ (when (eq (js2-function-node-generator-type n) 'STAR)
+ (insert "*")))
+ (when name
+ (insert " ")
+ (js2-print-ast name 0))
+ (insert "(")
+ (cl-loop with len = (length params)
+ for param in params
+ for count from 1
+ do
+ (when (and rest-p (= count len))
+ (insert "..."))
+ (js2-print-ast param 0)
+ (when (< count len)
+ (insert ", ")))
+ (insert ") ")
+ (when arrow
+ (insert "=> "))
+ (insert "{")
+ ;; TODO: fix this to be smarter about indenting, etc.
+ (unless expr
+ (insert "\n"))
+ (if (js2-block-node-p body)
+ (js2-print-body body (1+ i))
+ (js2-print-ast body 0))
+ (insert pad "}")
+ (unless expr
+ (insert "\n"))))
+
+(defun js2-function-name (node)
+ "Return function name for NODE, a `js2-function-node', or nil if anonymous."
+ (and (js2-function-node-name node)
+ (js2-name-node-name (js2-function-node-name node))))
+
+;; Having this be an expression node makes it more flexible.
+;; There are IDE contexts, such as indentation in a for-loop initializer,
+;; that work better if you assume it's an expression. Whenever we have
+;; a standalone var/const declaration, we just wrap with an expr stmt.
+;; Eclipse apparently screwed this up and now has two versions, expr and stmt.
+(cl-defstruct (js2-var-decl-node
+ (:include js2-node)
+ (:constructor make-js2-var-decl-node (&key (type js2-VAR)
+ (pos (js2-current-token-beg))
+ len kids
+ decl-type)))
+ "AST node for a variable declaration list (VAR, CONST or LET).
+The node bounds differ depending on the declaration type. For VAR or
+CONST declarations, the bounds include the var/const keyword. For LET
+declarations, the node begins at the position of the first child."
+ kids ; a Lisp list of `js2-var-init-node' structs.
+ decl-type) ; js2-VAR, js2-CONST or js2-LET
+
+(js2--struct-put 'js2-var-decl-node 'js2-visitor 'js2-visit-var-decl)
+(js2--struct-put 'js2-var-decl-node 'js2-printer 'js2-print-var-decl)
+
+(defun js2-visit-var-decl (n v)
+ (dolist (kid (js2-var-decl-node-kids n))
+ (js2-visit-ast kid v)))
+
+(defun js2-print-var-decl (n i)
+ (let ((pad (js2-make-pad i))
+ (tt (js2-var-decl-node-decl-type n)))
+ (insert pad)
+ (insert (cond
+ ((= tt js2-VAR) "var ")
+ ((= tt js2-LET) "let ")
+ ((= tt js2-CONST) "const ")
+ (t
+ (error "malformed var-decl node"))))
+ (cl-loop with kids = (js2-var-decl-node-kids n)
+ with len = (length kids)
+ for kid in kids
+ for count from 1
+ do
+ (js2-print-ast kid 0)
+ (if (< count len)
+ (insert ", ")))))
+
+(cl-defstruct (js2-var-init-node
+ (:include js2-node)
+ (:constructor make-js2-var-init-node (&key (type js2-VAR)
+ (pos js2-ts-cursor)
+ len target
+ initializer)))
+ "AST node for a variable declaration.
+The type field will be js2-CONST for a const decl."
+ target ; `js2-name-node', `js2-object-node', or `js2-array-node'
+ initializer) ; initializer expression, a `js2-node'
+
+(js2--struct-put 'js2-var-init-node 'js2-visitor 'js2-visit-var-init-node)
+(js2--struct-put 'js2-var-init-node 'js2-printer 'js2-print-var-init-node)
+
+(defun js2-visit-var-init-node (n v)
+ (js2-visit-ast (js2-var-init-node-target n) v)
+ (js2-visit-ast (js2-var-init-node-initializer n) v))
+
+(defun js2-print-var-init-node (n i)
+ (let ((pad (js2-make-pad i))
+ (name (js2-var-init-node-target n))
+ (init (js2-var-init-node-initializer n)))
+ (insert pad)
+ (js2-print-ast name 0)
+ (when init
+ (insert " = ")
+ (js2-print-ast init 0))))
+
+(cl-defstruct (js2-cond-node
+ (:include js2-node)
+ (:constructor make-js2-cond-node (&key (type js2-HOOK)
+ (pos js2-ts-cursor)
+ len
+ test-expr
+ true-expr
+ false-expr
+ q-pos c-pos)))
+ "AST node for the ternary operator"
+ test-expr
+ true-expr
+ false-expr
+ q-pos ; buffer position of ?
+ c-pos) ; buffer position of :
+
+(js2--struct-put 'js2-cond-node 'js2-visitor 'js2-visit-cond-node)
+(js2--struct-put 'js2-cond-node 'js2-printer 'js2-print-cond-node)
+
+(defun js2-visit-cond-node (n v)
+ (js2-visit-ast (js2-cond-node-test-expr n) v)
+ (js2-visit-ast (js2-cond-node-true-expr n) v)
+ (js2-visit-ast (js2-cond-node-false-expr n) v))
+
+(defun js2-print-cond-node (n i)
+ (let ((pad (js2-make-pad i)))
+ (insert pad)
+ (js2-print-ast (js2-cond-node-test-expr n) 0)
+ (insert " ? ")
+ (js2-print-ast (js2-cond-node-true-expr n) 0)
+ (insert " : ")
+ (js2-print-ast (js2-cond-node-false-expr n) 0)))
+
+(cl-defstruct (js2-infix-node
+ (:include js2-node)
+ (:constructor make-js2-infix-node (&key type
+ (pos js2-ts-cursor)
+ len op-pos
+ left right)))
+ "Represents infix expressions.
+Includes assignment ops like `|=', and the comma operator.
+The type field inherited from `js2-node' holds the operator."
+ op-pos ; buffer position where operator begins
+ left ; any `js2-node'
+ right) ; any `js2-node'
+
+(js2--struct-put 'js2-infix-node 'js2-visitor 'js2-visit-infix-node)
+(js2--struct-put 'js2-infix-node 'js2-printer 'js2-print-infix-node)
+
+(defun js2-visit-infix-node (n v)
+ (js2-visit-ast (js2-infix-node-left n) v)
+ (js2-visit-ast (js2-infix-node-right n) v))
+
+(defconst js2-operator-tokens
+ (let ((table (make-hash-table :test 'eq))
+ (tokens
+ (list (cons js2-IN "in")
+ (cons js2-TYPEOF "typeof")
+ (cons js2-INSTANCEOF "instanceof")
+ (cons js2-DELPROP "delete")
+ (cons js2-AWAIT "await")
+ (cons js2-VOID "void")
+ (cons js2-COMMA ",")
+ (cons js2-COLON ":")
+ (cons js2-OR "||")
+ (cons js2-AND "&&")
+ (cons js2-NULLISH-COALESCING "??")
+ (cons js2-INC "++")
+ (cons js2-DEC "--")
+ (cons js2-BITOR "|")
+ (cons js2-BITXOR "^")
+ (cons js2-BITAND "&")
+ (cons js2-EQ "==")
+ (cons js2-NE "!=")
+ (cons js2-LT "<")
+ (cons js2-LE "<=")
+ (cons js2-GT ">")
+ (cons js2-GE ">=")
+ (cons js2-LSH "<<")
+ (cons js2-RSH ">>")
+ (cons js2-URSH ">>>")
+ (cons js2-ADD "+") ; infix plus
+ (cons js2-SUB "-") ; infix minus
+ (cons js2-MUL "*")
+ (cons js2-EXPON "**")
+ (cons js2-DIV "/")
+ (cons js2-MOD "%")
+ (cons js2-NOT "!")
+ (cons js2-BITNOT "~")
+ (cons js2-POS "+") ; unary plus
+ (cons js2-NEG "-") ; unary minus
+ (cons js2-TRIPLEDOT "...")
+ (cons js2-SHEQ "===") ; shallow equality
+ (cons js2-SHNE "!==") ; shallow inequality
+ (cons js2-ASSIGN "=")
+ (cons js2-ASSIGN_BITOR "|=")
+ (cons js2-ASSIGN_BITXOR "^=")
+ (cons js2-ASSIGN_BITAND "&=")
+ (cons js2-ASSIGN_LSH "<<=")
+ (cons js2-ASSIGN_RSH ">>=")
+ (cons js2-ASSIGN_URSH ">>>=")
+ (cons js2-ASSIGN_ADD "+=")
+ (cons js2-ASSIGN_SUB "-=")
+ (cons js2-ASSIGN_MUL "*=")
+ (cons js2-ASSIGN_EXPON "**=")
+ (cons js2-ASSIGN_DIV "/=")
+ (cons js2-ASSIGN_MOD "%=")
+ (cons js2-ASSIGN_AND "&&=")
+ (cons js2-ASSIGN_OR "||=")
+ (cons js2-ASSIGN_NULLISH "??="))))
+ (cl-loop for (k . v) in tokens do
+ (puthash k v table))
+ table))
+
+(defun js2-print-infix-node (n i)
+ (let* ((tt (js2-node-type n))
+ (op (gethash tt js2-operator-tokens)))
+ (unless op
+ (error "unrecognized infix operator %s" (js2-node-type n)))
+ (insert (js2-make-pad i))
+ (js2-print-ast (js2-infix-node-left n) 0)
+ (unless (= tt js2-COMMA)
+ (insert " "))
+ (insert op)
+ (insert " ")
+ (js2-print-ast (js2-infix-node-right n) 0)))
+
+(cl-defstruct (js2-assign-node
+ (:include js2-infix-node)
+ (:constructor make-js2-assign-node (&key type
+ (pos js2-ts-cursor)
+ len op-pos
+ left right)))
+ "Represents any assignment.
+The type field holds the actual assignment operator.")
+
+(js2--struct-put 'js2-assign-node 'js2-visitor 'js2-visit-infix-node)
+(js2--struct-put 'js2-assign-node 'js2-printer 'js2-print-infix-node)
+
+(cl-defstruct (js2-unary-node
+ (:include js2-node)
+ (:constructor make-js2-unary-node (&key type ; required
+ (pos js2-ts-cursor)
+ len operand)))
+ "AST node type for unary operator nodes.
+The type field can be NOT, BITNOT, POS, NEG, INC, DEC,
+TYPEOF, DELPROP, TRIPLEDOT or AWAIT. For INC or DEC, a 'postfix node
+property is added if the operator follows the operand."
+ operand) ; a `js2-node' expression
+
+(js2--struct-put 'js2-unary-node 'js2-visitor 'js2-visit-unary-node)
+(js2--struct-put 'js2-unary-node 'js2-printer 'js2-print-unary-node)
+
+(defun js2-visit-unary-node (n v)
+ (js2-visit-ast (js2-unary-node-operand n) v))
+
+(defun js2-print-unary-node (n i)
+ (let* ((tt (js2-node-type n))
+ (op (gethash tt js2-operator-tokens))
+ (postfix (js2-node-get-prop n 'postfix)))
+ (unless op
+ (error "unrecognized unary operator %s" tt))
+ (insert (js2-make-pad i))
+ (unless postfix
+ (insert op))
+ (if (or (= tt js2-TYPEOF)
+ (= tt js2-DELPROP)
+ (= tt js2-AWAIT)
+ (= tt js2-VOID))
+ (insert " "))
+ (js2-print-ast (js2-unary-node-operand n) 0)
+ (when postfix
+ (insert op))))
+
+(cl-defstruct (js2-let-node
+ (:include js2-scope)
+ (:constructor make-js2-let-node (&key (type js2-LETEXPR)
+ (pos (js2-current-token-beg))
+ len vars body
+ lp rp)))
+ "AST node for a let expression or a let statement.
+Note that a let declaration such as let x=6, y=7 is a `js2-var-decl-node'."
+ vars ; a `js2-var-decl-node'
+ body ; a `js2-node' representing the expression or body block
+ lp
+ rp)
+
+(js2--struct-put 'js2-let-node 'js2-visitor 'js2-visit-let-node)
+(js2--struct-put 'js2-let-node 'js2-printer 'js2-print-let-node)
+
+(defun js2-visit-let-node (n v)
+ (js2-visit-ast (js2-let-node-vars n) v)
+ (js2-visit-ast (js2-let-node-body n) v))
+
+(defun js2-print-let-node (n i)
+ (insert (js2-make-pad i) "let (")
+ (let ((p (point)))
+ (js2-print-ast (js2-let-node-vars n) 0)
+ (delete-region p (+ p 4)))
+ (insert ") ")
+ (js2-print-ast (js2-let-node-body n) i))
+
+(cl-defstruct (js2-keyword-node
+ (:include js2-node)
+ (:constructor make-js2-keyword-node (&key type
+ (pos (js2-current-token-beg))
+ (len (- js2-ts-cursor pos)))))
+ "AST node representing a literal keyword such as `null'.
+Used for `null', `this', `true', `false' and `debugger'.
+The node type is set to js2-NULL, js2-THIS, etc.")
+
+(js2--struct-put 'js2-keyword-node 'js2-visitor 'js2-visit-none)
+(js2--struct-put 'js2-keyword-node 'js2-printer 'js2-print-keyword-node)
+
+(defun js2-print-keyword-node (n i)
+ (insert (js2-make-pad i)
+ (let ((tt (js2-node-type n)))
+ (cond
+ ((= tt js2-THIS) "this")
+ ((= tt js2-SUPER) "super")
+ ((= tt js2-NULL) "null")
+ ((= tt js2-TRUE) "true")
+ ((= tt js2-FALSE) "false")
+ ((= tt js2-DEBUGGER) "debugger")
+ (t (error "Invalid keyword literal type: %d" tt))))))
+
+(defsubst js2-this-or-super-node-p (node)
+ "Return t if NODE is a `js2-literal-node' of type js2-THIS or js2-SUPER."
+ (let ((type (js2-node-type node)))
+ (or (eq type js2-THIS) (eq type js2-SUPER))))
+
+(cl-defstruct (js2-new-node
+ (:include js2-node)
+ (:constructor make-js2-new-node (&key (type js2-NEW)
+ (pos (js2-current-token-beg))
+ len target
+ args initializer
+ lp rp)))
+ "AST node for new-expression such as new Foo()."
+ target ; an identifier or reference
+ args ; a Lisp list of argument nodes
+ lp ; position of left-paren, nil if omitted
+ rp ; position of right-paren, nil if omitted
+ initializer) ; experimental Rhino syntax: optional `js2-object-node'
+
+(js2--struct-put 'js2-new-node 'js2-visitor 'js2-visit-new-node)
+(js2--struct-put 'js2-new-node 'js2-printer 'js2-print-new-node)
+
+(defun js2-visit-new-node (n v)
+ (js2-visit-ast (js2-new-node-target n) v)
+ (dolist (arg (js2-new-node-args n))
+ (js2-visit-ast arg v))
+ (js2-visit-ast (js2-new-node-initializer n) v))
+
+(defun js2-print-new-node (n i)
+ (insert (js2-make-pad i) "new ")
+ (js2-print-ast (js2-new-node-target n))
+ (insert "(")
+ (js2-print-list (js2-new-node-args n))
+ (insert ")")
+ (when (js2-new-node-initializer n)
+ (insert " ")
+ (js2-print-ast (js2-new-node-initializer n))))
+
+(cl-defstruct (js2-name-node
+ (:include js2-node)
+ (:constructor make-js2-name-node (&key (type js2-NAME)
+ (pos (js2-current-token-beg))
+ (len (- js2-ts-cursor
+ (js2-current-token-beg)))
+ (name (js2-current-token-string)))))
+ "AST node for a JavaScript identifier"
+ name ; a string
+ scope) ; a `js2-scope' (optional, used for codegen)
+
+(js2--struct-put 'js2-name-node 'js2-visitor 'js2-visit-none)
+(js2--struct-put 'js2-name-node 'js2-printer 'js2-print-name-node)
+
+(defun js2-print-name-node (n i)
+ (insert (js2-make-pad i)
+ (js2-name-node-name n)))
+
+(defsubst js2-name-node-length (node)
+ "Return identifier length of NODE, a `js2-name-node'.
+Returns 0 if NODE is nil or its identifier field is nil."
+ (if node
+ (length (js2-name-node-name node))
+ 0))
+
+(cl-defstruct (js2-number-node
+ (:include js2-node)
+ (:constructor make-js2-number-node (&key (type js2-NUMBER)
+ (pos (js2-current-token-beg))
+ (len (- js2-ts-cursor
+ (js2-current-token-beg)))
+ (value (js2-current-token-string))
+ (num-value (js2-token-number
+ (js2-current-token)))
+ (num-base (js2-token-number-base
+ (js2-current-token)))
+ (legacy-octal-p (js2-token-number-legacy-octal-p
+ (js2-current-token))))))
+ "AST node for a number literal."
+ value ; the original string, e.g. "6.02e23"
+ num-value ; the parsed number value
+ num-base ; the number's base
+ legacy-octal-p) ; whether the number is a legacy octal (0123 instead of 0o123)
+
+(js2--struct-put 'js2-number-node 'js2-visitor 'js2-visit-none)
+(js2--struct-put 'js2-number-node 'js2-printer 'js2-print-number-node)
+
+(defun js2-print-number-node (n i)
+ (insert (js2-make-pad i)
+ (number-to-string (js2-number-node-num-value n))))
+
+(cl-defstruct (js2-regexp-node
+ (:include js2-node)
+ (:constructor make-js2-regexp-node (&key (type js2-REGEXP)
+ (pos (js2-current-token-beg))
+ (len (- js2-ts-cursor
+ (js2-current-token-beg)))
+ value flags)))
+ "AST node for a regular expression literal."
+ value ; the regexp string, without // delimiters
+ flags) ; a string of flags, e.g. `mi'.
+
+(js2--struct-put 'js2-regexp-node 'js2-visitor 'js2-visit-none)
+(js2--struct-put 'js2-regexp-node 'js2-printer 'js2-print-regexp)
+
+(defun js2-print-regexp (n i)
+ (insert (js2-make-pad i)
+ "/"
+ (js2-regexp-node-value n)
+ "/")
+ (if (js2-regexp-node-flags n)
+ (insert (js2-regexp-node-flags n))))
+
+(cl-defstruct (js2-string-node
+ (:include js2-node)
+ (:constructor make-js2-string-node (&key (type js2-STRING)
+ (pos (js2-current-token-beg))
+ (len (- js2-ts-cursor
+ (js2-current-token-beg)))
+ (value (js2-current-token-string)))))
+ "String literal.
+Escape characters are not evaluated; e.g. \n is 2 chars in value field.
+You can tell the quote type by looking at the first character."
+ value) ; the characters of the string, including the quotes
+
+(js2--struct-put 'js2-string-node 'js2-visitor 'js2-visit-none)
+(js2--struct-put 'js2-string-node 'js2-printer 'js2-print-string-node)
+
+(defun js2-print-string-node (n i)
+ (insert (js2-make-pad i)
+ (js2-node-string n)))
+
+(cl-defstruct (js2-template-node
+ (:include js2-node)
+ (:constructor make-js2-template-node (&key (type js2-TEMPLATE_HEAD)
+ pos len kids)))
+ "Template literal."
+ kids) ; `js2-string-node' is used for string segments, other nodes
+ ; for substitutions inside.
+
+(js2--struct-put 'js2-template-node 'js2-visitor 'js2-visit-template)
+(js2--struct-put 'js2-template-node 'js2-printer 'js2-print-template)
+
+(defun js2-visit-template (n callback)
+ (dolist (kid (js2-template-node-kids n))
+ (js2-visit-ast kid callback)))
+
+(defun js2-print-template (n i)
+ (insert (js2-make-pad i))
+ (dolist (kid (js2-template-node-kids n))
+ (if (js2-string-node-p kid)
+ (insert (js2-node-string kid))
+ (js2-print-ast kid))))
+
+(cl-defstruct (js2-tagged-template-node
+ (:include js2-node)
+ (:constructor make-js2-tagged-template-node (&key (type js2-TAGGED_TEMPLATE)
+ pos len tag template)))
+ "Tagged template literal."
+ tag ; `js2-node' with the tag expression.
+ template) ; `js2-template-node' with the template.
+
+(js2--struct-put 'js2-tagged-template-node 'js2-visitor 'js2-visit-tagged-template)
+(js2--struct-put 'js2-tagged-template-node 'js2-printer 'js2-print-tagged-template)
+
+(defun js2-visit-tagged-template (n callback)
+ (js2-visit-ast (js2-tagged-template-node-tag n) callback)
+ (js2-visit-ast (js2-tagged-template-node-template n) callback))
+
+(defun js2-print-tagged-template (n i)
+ (insert (js2-make-pad i))
+ (js2-print-ast (js2-tagged-template-node-tag n))
+ (js2-print-ast (js2-tagged-template-node-template n)))
+
+(cl-defstruct (js2-array-node
+ (:include js2-node)
+ (:constructor make-js2-array-node (&key (type js2-ARRAYLIT)
+ (pos js2-ts-cursor)
+ len elems)))
+ "AST node for an array literal."
+ elems) ; list of expressions. [foo,,bar] yields a nil middle element.
+
+(js2--struct-put 'js2-array-node 'js2-visitor 'js2-visit-array-node)
+(js2--struct-put 'js2-array-node 'js2-printer 'js2-print-array-node)
+
+(defun js2-visit-array-node (n v)
+ (dolist (e (js2-array-node-elems n))
+ (js2-visit-ast e v))) ; Can be nil; e.g. [a, ,b].
+
+(defun js2-print-array-node (n i)
+ (insert (js2-make-pad i) "[")
+ (let ((elems (js2-array-node-elems n)))
+ (js2-print-list elems)
+ (when (and elems (null (car (last elems))))
+ (insert ",")))
+ (insert "]"))
+
+(cl-defstruct (js2-object-node
+ (:include js2-node)
+ (:constructor make-js2-object-node (&key (type js2-OBJECTLIT)
+ (pos js2-ts-cursor)
+ len
+ elems)))
+ "AST node for an object literal expression.
+`elems' is a list of `js2-object-prop-node'."
+ elems)
+
+(js2--struct-put 'js2-object-node 'js2-visitor 'js2-visit-object-node)
+(js2--struct-put 'js2-object-node 'js2-printer 'js2-print-object-node)
+
+(defun js2-visit-object-node (n v)
+ (dolist (e (js2-object-node-elems n))
+ (js2-visit-ast e v)))
+
+(defun js2-print-object-node (n i)
+ (insert (js2-make-pad i) "{")
+ (js2-print-list (js2-object-node-elems n))
+ (insert "}"))
+
+(cl-defstruct (js2-class-node
+ (:include js2-object-node)
+ (:constructor make-js2-class-node (&key (type js2-CLASS)
+ (pos js2-ts-cursor)
+ (form 'CLASS_STATEMENT)
+ (name "")
+ extends len elems)))
+ "AST node for an class expression.
+`elems' is a list of `js2-object-prop-node', and `extends' is an
+optional `js2-expr-node'"
+ form ; CLASS_{STATEMENT|EXPRESSION}
+ name ; class name (a `js2-node-name', or nil if anonymous)
+ extends ; class heritage (a `js2-expr-node', or nil if none)
+ )
+
+(js2--struct-put 'js2-class-node 'js2-visitor 'js2-visit-class-node)
+(js2--struct-put 'js2-class-node 'js2-printer 'js2-print-class-node)
+
+(defun js2-visit-class-node (n v)
+ (js2-visit-ast (js2-class-node-name n) v)
+ (js2-visit-ast (js2-class-node-extends n) v)
+ (dolist (e (js2-class-node-elems n))
+ (js2-visit-ast e v)))
+
+(defun js2-print-class-node (n i)
+ (let* ((pad (js2-make-pad i))
+ (name (js2-class-node-name n))
+ (extends (js2-class-node-extends n))
+ (elems (js2-class-node-elems n)))
+ (insert pad "class")
+ (when name
+ (insert " ")
+ (js2-print-ast name 0))
+ (when extends
+ (insert " extends ")
+ (js2-print-ast extends))
+ (insert " {")
+ (dolist (elem elems)
+ (insert "\n")
+ (if (js2-node-get-prop elem 'STATIC)
+ (progn (insert (js2-make-pad (1+ i)) "static ")
+ (js2-print-ast elem 0)) ;; TODO(sdh): indentation isn't quite right
+ (js2-print-ast elem (1+ i))))
+ (insert "\n" pad "}")))
+
+(cl-defstruct (js2-computed-prop-name-node
+ (:include js2-node)
+ (:constructor make-js2-computed-prop-name-node
+ (&key
+ (type js2-LB)
+ expr
+ (pos (js2-current-token-beg))
+ (len (- js2-ts-cursor
+ (js2-current-token-beg))))))
+ "AST node for a `ComputedPropertyName'."
+ expr)
+
+(js2--struct-put 'js2-computed-prop-name-node 'js2-visitor 'js2-visit-computed-prop-name-node)
+(js2--struct-put 'js2-computed-prop-name-node 'js2-printer 'js2-print-computed-prop-name-node)
+
+(defun js2-visit-computed-prop-name-node (n v)
+ (js2-visit-ast (js2-computed-prop-name-node-expr n) v))
+
+(defun js2-print-computed-prop-name-node (n i)
+ (insert (js2-make-pad i) "[")
+ (js2-print-ast (js2-computed-prop-name-node-expr n) 0)
+ (insert "]"))
+
+(cl-defstruct (js2-object-prop-node
+ (:include js2-infix-node)
+ (:constructor make-js2-object-prop-node (&key (type js2-COLON)
+ (pos js2-ts-cursor)
+ len left
+ right op-pos)))
+ "AST node for an object literal prop:value entry.
+The `left' field is the property: a name node, string node,
+number node or expression node. The `right' field is a
+`js2-node' representing the initializer value. If the property
+is abbreviated, the node's `SHORTHAND' property is non-nil and
+both fields have the same value.")
+
+(js2--struct-put 'js2-object-prop-node 'js2-visitor 'js2-visit-infix-node)
+(js2--struct-put 'js2-object-prop-node 'js2-printer 'js2-print-object-prop-node)
+
+(defun js2-print-object-prop-node (n i)
+ (let* ((left (js2-object-prop-node-left n))
+ (right (js2-object-prop-node-right n)))
+ (js2-print-ast left i)
+ (if (not (js2-node-get-prop n 'SHORTHAND))
+ (progn
+ (insert ": ")
+ (js2-print-ast right 0)))))
+
+(cl-defstruct (js2-method-node
+ (:include js2-infix-node)
+ (:constructor make-js2-method-node (&key (pos js2-ts-cursor)
+ len left right)))
+ "AST node for a method in an object literal or a class body.
+The `left' field is the `js2-name-node' naming the method.
+The `right' field is always an anonymous `js2-function-node' with a node
+property `METHOD_TYPE' set to 'GET or 'SET. ")
+
+(js2--struct-put 'js2-method-node 'js2-visitor 'js2-visit-infix-node)
+(js2--struct-put 'js2-method-node 'js2-printer 'js2-print-method)
+
+(defun js2-print-method (n i)
+ (let* ((pad (js2-make-pad i))
+ (left (js2-method-node-left n))
+ (right (js2-method-node-right n))
+ (type (js2-node-get-prop right 'METHOD_TYPE)))
+ (insert pad)
+ (when type
+ (insert (cdr (assoc type '((GET . "get ")
+ (SET . "set ")
+ (ASYNC . "async ")
+ (FUNCTION . ""))))))
+ (when (and (js2-function-node-p right)
+ (eq 'STAR (js2-function-node-generator-type right)))
+ (insert "*"))
+ (js2-print-ast left 0)
+ (js2-print-ast right 0)))
+
+(cl-defstruct (js2-prop-get-node
+ (:include js2-infix-node)
+ (:constructor make-js2-prop-get-node (&key (type js2-GETPROP)
+ (pos js2-ts-cursor)
+ len left right)))
+ "AST node for a dotted property reference, e.g. foo.bar or foo().bar")
+
+(js2--struct-put 'js2-prop-get-node 'js2-visitor 'js2-visit-prop-get-node)
+(js2--struct-put 'js2-prop-get-node 'js2-printer 'js2-print-prop-get-node)
+
+(defun js2-visit-prop-get-node (n v)
+ (js2-visit-ast (js2-prop-get-node-left n) v)
+ (js2-visit-ast (js2-prop-get-node-right n) v))
+
+(defun js2-print-prop-get-node (n i)
+ (insert (js2-make-pad i))
+ (js2-print-ast (js2-prop-get-node-left n) 0)
+ (insert ".")
+ (js2-print-ast (js2-prop-get-node-right n) 0))
+
+(cl-defstruct (js2-elem-get-node
+ (:include js2-node)
+ (:constructor make-js2-elem-get-node (&key (type js2-GETELEM)
+ (pos js2-ts-cursor)
+ len target element
+ lb rb)))
+ "AST node for an array index expression such as foo[bar]."
+ target ; a `js2-node' - the expression preceding the "."
+ element ; a `js2-node' - the expression in brackets
+ lb ; position of left-bracket, nil if omitted
+ rb) ; position of right-bracket, nil if omitted
+
+(js2--struct-put 'js2-elem-get-node 'js2-visitor 'js2-visit-elem-get-node)
+(js2--struct-put 'js2-elem-get-node 'js2-printer 'js2-print-elem-get-node)
+
+(defun js2-visit-elem-get-node (n v)
+ (js2-visit-ast (js2-elem-get-node-target n) v)
+ (js2-visit-ast (js2-elem-get-node-element n) v))
+
+(defun js2-print-elem-get-node (n i)
+ (insert (js2-make-pad i))
+ (js2-print-ast (js2-elem-get-node-target n) 0)
+ (insert "[")
+ (js2-print-ast (js2-elem-get-node-element n) 0)
+ (insert "]"))
+
+(cl-defstruct (js2-call-node
+ (:include js2-node)
+ (:constructor make-js2-call-node (&key (type js2-CALL)
+ (pos js2-ts-cursor)
+ len target args
+ lp rp)))
+ "AST node for a JavaScript function call."
+ target ; a `js2-node' evaluating to the function to call
+ args ; a Lisp list of `js2-node' arguments
+ lp ; position of open-paren, or nil if missing
+ rp) ; position of close-paren, or nil if missing
+
+(js2--struct-put 'js2-call-node 'js2-visitor 'js2-visit-call-node)
+(js2--struct-put 'js2-call-node 'js2-printer 'js2-print-call-node)
+
+(defun js2-visit-call-node (n v)
+ (js2-visit-ast (js2-call-node-target n) v)
+ (dolist (arg (js2-call-node-args n))
+ (js2-visit-ast arg v)))
+
+(defun js2-print-call-node (n i)
+ (insert (js2-make-pad i))
+ (js2-print-ast (js2-call-node-target n) 0)
+ (insert "(")
+ (js2-print-list (js2-call-node-args n))
+ (insert ")"))
+
+(cl-defstruct (js2-yield-node
+ (:include js2-node)
+ (:constructor make-js2-yield-node (&key (type js2-YIELD)
+ (pos js2-ts-cursor)
+ len value star-p)))
+ "AST node for yield statement or expression."
+ star-p ; whether it's yield*
+ value) ; optional: value to be yielded
+
+(js2--struct-put 'js2-yield-node 'js2-visitor 'js2-visit-yield-node)
+(js2--struct-put 'js2-yield-node 'js2-printer 'js2-print-yield-node)
+
+(defun js2-visit-yield-node (n v)
+ (js2-visit-ast (js2-yield-node-value n) v))
+
+(defun js2-print-yield-node (n i)
+ (insert (js2-make-pad i))
+ (insert "yield")
+ (when (js2-yield-node-star-p n)
+ (insert "*"))
+ (when (js2-yield-node-value n)
+ (insert " ")
+ (js2-print-ast (js2-yield-node-value n) 0)))
+
+(cl-defstruct (js2-paren-node
+ (:include js2-node)
+ (:constructor make-js2-paren-node (&key (type js2-LP)
+ (pos js2-ts-cursor)
+ len expr)))
+ "AST node for a parenthesized expression.
+In particular, used when the parens are syntactically optional,
+as opposed to required parens such as those enclosing an if-conditional."
+ expr) ; `js2-node'
+
+(js2--struct-put 'js2-paren-node 'js2-visitor 'js2-visit-paren-node)
+(js2--struct-put 'js2-paren-node 'js2-printer 'js2-print-paren-node)
+
+(defun js2-visit-paren-node (n v)
+ (js2-visit-ast (js2-paren-node-expr n) v))
+
+(defun js2-print-paren-node (n i)
+ (insert (js2-make-pad i))
+ (insert "(")
+ (js2-print-ast (js2-paren-node-expr n) 0)
+ (insert ")"))
+
+(cl-defstruct (js2-comp-node
+ (:include js2-scope)
+ (:constructor make-js2-comp-node (&key (type js2-ARRAYCOMP)
+ (pos js2-ts-cursor)
+ len result
+ loops filters
+ form)))
+ "AST node for an Array comprehension such as [[x,y] for (x in foo) for (y in bar)]."
+ result ; result expression (just after left-bracket)
+ loops ; a Lisp list of `js2-comp-loop-node'
+ filters ; a Lisp list of guard/filter expressions
+ form ; ARRAY, LEGACY_ARRAY or STAR_GENERATOR
+ ; SpiderMonkey also supports "legacy generator expressions", but we dont.
+ )
+
+(js2--struct-put 'js2-comp-node 'js2-visitor 'js2-visit-comp-node)
+(js2--struct-put 'js2-comp-node 'js2-printer 'js2-print-comp-node)
+
+(defun js2-visit-comp-node (n v)
+ (js2-visit-ast (js2-comp-node-result n) v)
+ (dolist (l (js2-comp-node-loops n))
+ (js2-visit-ast l v))
+ (dolist (f (js2-comp-node-filters n))
+ (js2-visit-ast f v)))
+
+(defun js2-print-comp-node (n i)
+ (let ((pad (js2-make-pad i))
+ (result (js2-comp-node-result n))
+ (loops (js2-comp-node-loops n))
+ (filters (js2-comp-node-filters n))
+ (legacy-p (eq (js2-comp-node-form n) 'LEGACY_ARRAY))
+ (gen-p (eq (js2-comp-node-form n) 'STAR_GENERATOR)))
+ (insert pad (if gen-p "(" "["))
+ (when legacy-p
+ (js2-print-ast result 0))
+ (dolist (l loops)
+ (when legacy-p
+ (insert " "))
+ (js2-print-ast l 0)
+ (unless legacy-p
+ (insert " ")))
+ (dolist (f filters)
+ (when legacy-p
+ (insert " "))
+ (insert "if (")
+ (js2-print-ast f 0)
+ (insert ")")
+ (unless legacy-p
+ (insert " ")))
+ (unless legacy-p
+ (js2-print-ast result 0))
+ (insert (if gen-p ")" "]"))))
+
+(cl-defstruct (js2-comp-loop-node
+ (:include js2-for-in-node)
+ (:constructor make-js2-comp-loop-node (&key (type js2-FOR)
+ (pos js2-ts-cursor)
+ len iterator
+ object in-pos
+ foreach-p
+ each-pos
+ forof-p
+ lp rp)))
+ "AST subtree for each 'for (foo in bar)' loop in an array comprehension.")
+
+(js2--struct-put 'js2-comp-loop-node 'js2-visitor 'js2-visit-comp-loop)
+(js2--struct-put 'js2-comp-loop-node 'js2-printer 'js2-print-comp-loop)
+
+(defun js2-visit-comp-loop (n v)
+ (js2-visit-ast (js2-comp-loop-node-iterator n) v)
+ (js2-visit-ast (js2-comp-loop-node-object n) v))
+
+(defun js2-print-comp-loop (n _i)
+ (insert "for ")
+ (when (js2-comp-loop-node-foreach-p n) (insert "each "))
+ (insert "(")
+ (js2-print-ast (js2-comp-loop-node-iterator n) 0)
+ (insert (if (js2-comp-loop-node-forof-p n)
+ " of " " in "))
+ (js2-print-ast (js2-comp-loop-node-object n) 0)
+ (insert ")"))
+
+(cl-defstruct (js2-empty-expr-node
+ (:include js2-node)
+ (:constructor make-js2-empty-expr-node (&key (type js2-EMPTY)
+ (pos (js2-current-token-beg))
+ len)))
+ "AST node for an empty expression.")
+
+(js2--struct-put 'js2-empty-expr-node 'js2-visitor 'js2-visit-none)
+(js2--struct-put 'js2-empty-expr-node 'js2-printer 'js2-print-none)
+
+(cl-defstruct (js2-xml-node
+ (:include js2-block-node)
+ (:constructor make-js2-xml-node (&key (type js2-XML)
+ (pos (js2-current-token-beg))
+ len kids)))
+ "AST node for initial parse of E4X literals.
+The kids field is a list of XML fragments, each a `js2-string-node' or
+a `js2-xml-js-expr-node'. Equivalent to Rhino's XmlLiteral node.")
+
+(js2--struct-put 'js2-xml-node 'js2-visitor 'js2-visit-block)
+(js2--struct-put 'js2-xml-node 'js2-printer 'js2-print-xml-node)
+
+(defun js2-print-xml-node (n i)
+ (dolist (kid (js2-xml-node-kids n))
+ (js2-print-ast kid i)))
+
+(cl-defstruct (js2-xml-js-expr-node
+ (:include js2-xml-node)
+ (:constructor make-js2-xml-js-expr-node (&key (type js2-XML)
+ (pos js2-ts-cursor)
+ len expr)))
+ "AST node for an embedded JavaScript {expression} in an E4X literal.
+The start and end fields correspond to the curly-braces."
+ expr) ; a `js2-expr-node' of some sort
+
+(js2--struct-put 'js2-xml-js-expr-node 'js2-visitor 'js2-visit-xml-js-expr)
+(js2--struct-put 'js2-xml-js-expr-node 'js2-printer 'js2-print-xml-js-expr)
+
+(defun js2-visit-xml-js-expr (n v)
+ (js2-visit-ast (js2-xml-js-expr-node-expr n) v))
+
+(defun js2-print-xml-js-expr (n i)
+ (insert (js2-make-pad i))
+ (insert "{")
+ (js2-print-ast (js2-xml-js-expr-node-expr n) 0)
+ (insert "}"))
+
+(cl-defstruct (js2-xml-dot-query-node
+ (:include js2-infix-node)
+ (:constructor make-js2-xml-dot-query-node (&key (type js2-DOTQUERY)
+ (pos js2-ts-cursor)
+ op-pos len left
+ right rp)))
+ "AST node for an E4X foo.(bar) filter expression.
+Note that the left-paren is automatically the character immediately
+following the dot (.) in the operator. No whitespace is permitted
+between the dot and the lp by the scanner."
+ rp)
+
+(js2--struct-put 'js2-xml-dot-query-node 'js2-visitor 'js2-visit-infix-node)
+(js2--struct-put 'js2-xml-dot-query-node 'js2-printer 'js2-print-xml-dot-query)
+
+(defun js2-print-xml-dot-query (n i)
+ (insert (js2-make-pad i))
+ (js2-print-ast (js2-xml-dot-query-node-left n) 0)
+ (insert ".(")
+ (js2-print-ast (js2-xml-dot-query-node-right n) 0)
+ (insert ")"))
+
+(cl-defstruct (js2-xml-ref-node
+ (:include js2-node)
+ (:constructor nil)) ; abstract
+ "Base type for E4X XML attribute-access or property-get expressions.
+Such expressions can take a variety of forms. The general syntax has
+three parts:
+
+ - (optional) an @ (specifying an attribute access)
+ - (optional) a namespace (a `js2-name-node') and double-colon
+ - (required) either a `js2-name-node' or a bracketed [expression]
+
+The property-name expressions (examples: ns::name, @name) are
+represented as `js2-xml-prop-ref' nodes. The bracketed-expression
+versions (examples: ns::[name], @[name]) become `js2-xml-elem-ref' nodes.
+
+This node type (or more specifically, its subclasses) will sometimes
+be the right-hand child of a `js2-prop-get-node' or a
+`js2-infix-node' of type `js2-DOTDOT', the .. xml-descendants operator.
+The `js2-xml-ref-node' may also be a standalone primary expression with
+no explicit target, which is valid in certain expression contexts such as
+
+ company..employee.(@id < 100)
+
+in this case, the @id is a `js2-xml-ref' that is part of an infix `<'
+expression whose parent is a `js2-xml-dot-query-node'."
+ namespace
+ at-pos
+ colon-pos)
+
+(defsubst js2-xml-ref-node-attr-access-p (node)
+ "Return non-nil if this expression began with an @-token."
+ (and (numberp (js2-xml-ref-node-at-pos node))
+ (cl-plusp (js2-xml-ref-node-at-pos node))))
+
+(cl-defstruct (js2-xml-prop-ref-node
+ (:include js2-xml-ref-node)
+ (:constructor make-js2-xml-prop-ref-node (&key (type js2-REF_NAME)
+ (pos (js2-current-token-beg))
+ len propname
+ namespace at-pos
+ colon-pos)))
+ "AST node for an E4X XML [expr] property-ref expression.
+The JavaScript syntax is an optional @, an optional ns::, and a name.
+
+ [ `@' ] [ name `::' ] name
+
+Examples include name, ns::name, ns::*, *::name, *::*, @attr, @ns::attr,
+@ns::*, @*::attr, @*::*, and @*.
+
+The node starts at the @ token, if present. Otherwise it starts at the
+namespace name. The node bounds extend through the closing right-bracket,
+or if it is missing due to a syntax error, through the end of the index
+expression."
+ propname)
+
+(js2--struct-put 'js2-xml-prop-ref-node 'js2-visitor 'js2-visit-xml-prop-ref-node)
+(js2--struct-put 'js2-xml-prop-ref-node 'js2-printer 'js2-print-xml-prop-ref-node)
+
+(defun js2-visit-xml-prop-ref-node (n v)
+ (js2-visit-ast (js2-xml-prop-ref-node-namespace n) v)
+ (js2-visit-ast (js2-xml-prop-ref-node-propname n) v))
+
+(defun js2-print-xml-prop-ref-node (n i)
+ (insert (js2-make-pad i))
+ (if (js2-xml-ref-node-attr-access-p n)
+ (insert "@"))
+ (when (js2-xml-prop-ref-node-namespace n)
+ (js2-print-ast (js2-xml-prop-ref-node-namespace n) 0)
+ (insert "::"))
+ (if (js2-xml-prop-ref-node-propname n)
+ (js2-print-ast (js2-xml-prop-ref-node-propname n) 0)))
+
+(cl-defstruct (js2-xml-elem-ref-node
+ (:include js2-xml-ref-node)
+ (:constructor make-js2-xml-elem-ref-node (&key (type js2-REF_MEMBER)
+ (pos (js2-current-token-beg))
+ len expr lb rb
+ namespace at-pos
+ colon-pos)))
+ "AST node for an E4X XML [expr] member-ref expression.
+Syntax:
+
+ [ `@' ] [ name `::' ] `[' expr `]'
+
+Examples include ns::[expr], @ns::[expr], @[expr], *::[expr] and @*::[expr].
+
+Note that the form [expr] (i.e. no namespace or attribute-qualifier)
+is not a legal E4X XML element-ref expression, since it's already used
+for standard JavaScript element-get array indexing. Hence, a
+`js2-xml-elem-ref-node' always has either the attribute-qualifier, a
+non-nil namespace node, or both.
+
+The node starts at the @ token, if present. Otherwise it starts
+at the namespace name. The node bounds extend through the closing
+right-bracket, or if it is missing due to a syntax error, through the
+end of the index expression."
+ expr ; the bracketed index expression
+ lb
+ rb)
+
+(js2--struct-put 'js2-xml-elem-ref-node 'js2-visitor 'js2-visit-xml-elem-ref-node)
+(js2--struct-put 'js2-xml-elem-ref-node 'js2-printer 'js2-print-xml-elem-ref-node)
+
+(defun js2-visit-xml-elem-ref-node (n v)
+ (js2-visit-ast (js2-xml-elem-ref-node-namespace n) v)
+ (js2-visit-ast (js2-xml-elem-ref-node-expr n) v))
+
+(defun js2-print-xml-elem-ref-node (n i)
+ (insert (js2-make-pad i))
+ (if (js2-xml-ref-node-attr-access-p n)
+ (insert "@"))
+ (when (js2-xml-elem-ref-node-namespace n)
+ (js2-print-ast (js2-xml-elem-ref-node-namespace n) 0)
+ (insert "::"))
+ (insert "[")
+ (if (js2-xml-elem-ref-node-expr n)
+ (js2-print-ast (js2-xml-elem-ref-node-expr n) 0))
+ (insert "]"))
+
+;;; Placeholder nodes for when we try parsing the XML literals structurally.
+
+(cl-defstruct (js2-xml-start-tag-node
+ (:include js2-xml-node)
+ (:constructor make-js2-xml-start-tag-node (&key (type js2-XML)
+ (pos js2-ts-cursor)
+ len name attrs kids
+ empty-p)))
+ "AST node for an XML start-tag. Not currently used.
+The `kids' field is a Lisp list of child content nodes."
+ name ; a `js2-xml-name-node'
+ attrs ; a Lisp list of `js2-xml-attr-node'
+ empty-p) ; t if this is an empty element such as <foo bar="baz"/>
+
+(js2--struct-put 'js2-xml-start-tag-node 'js2-visitor 'js2-visit-xml-start-tag)
+(js2--struct-put 'js2-xml-start-tag-node 'js2-printer 'js2-print-xml-start-tag)
+
+(defun js2-visit-xml-start-tag (n v)
+ (js2-visit-ast (js2-xml-start-tag-node-name n) v)
+ (dolist (attr (js2-xml-start-tag-node-attrs n))
+ (js2-visit-ast attr v))
+ (js2-visit-block n v))
+
+(defun js2-print-xml-start-tag (n i)
+ (insert (js2-make-pad i) "<")
+ (js2-print-ast (js2-xml-start-tag-node-name n) 0)
+ (when (js2-xml-start-tag-node-attrs n)
+ (insert " ")
+ (js2-print-list (js2-xml-start-tag-node-attrs n) " "))
+ (insert ">"))
+
+;; I -think- I'm going to make the parent node the corresponding start-tag,
+;; and add the end-tag to the kids list of the parent as well.
+(cl-defstruct (js2-xml-end-tag-node
+ (:include js2-xml-node)
+ (:constructor make-js2-xml-end-tag-node (&key (type js2-XML)
+ (pos js2-ts-cursor)
+ len name)))
+ "AST node for an XML end-tag. Not currently used."
+ name) ; a `js2-xml-name-node'
+
+(js2--struct-put 'js2-xml-end-tag-node 'js2-visitor 'js2-visit-xml-end-tag)
+(js2--struct-put 'js2-xml-end-tag-node 'js2-printer 'js2-print-xml-end-tag)
+
+(defun js2-visit-xml-end-tag (n v)
+ (js2-visit-ast (js2-xml-end-tag-node-name n) v))
+
+(defun js2-print-xml-end-tag (n i)
+ (insert (js2-make-pad i))
+ (insert "</")
+ (js2-print-ast (js2-xml-end-tag-node-name n) 0)
+ (insert ">"))
+
+(cl-defstruct (js2-xml-name-node
+ (:include js2-xml-node)
+ (:constructor make-js2-xml-name-node (&key (type js2-XML)
+ (pos js2-ts-cursor)
+ len namespace kids)))
+ "AST node for an E4X XML name. Not currently used.
+Any XML name can be qualified with a namespace, hence the namespace field.
+Further, any E4X name can be comprised of arbitrary JavaScript {} expressions.
+The kids field is a list of `js2-name-node' and `js2-xml-js-expr-node'.
+For a simple name, the kids list has exactly one node, a `js2-name-node'."
+ namespace) ; a `js2-string-node'
+
+(js2--struct-put 'js2-xml-name-node 'js2-visitor 'js2-visit-xml-name-node)
+(js2--struct-put 'js2-xml-name-node 'js2-printer 'js2-print-xml-name-node)
+
+(defun js2-visit-xml-name-node (n v)
+ (js2-visit-ast (js2-xml-name-node-namespace n) v))
+
+(defun js2-print-xml-name-node (n i)
+ (insert (js2-make-pad i))
+ (when (js2-xml-name-node-namespace n)
+ (js2-print-ast (js2-xml-name-node-namespace n) 0)
+ (insert "::"))
+ (dolist (kid (js2-xml-name-node-kids n))
+ (js2-print-ast kid 0)))
+
+(cl-defstruct (js2-xml-pi-node
+ (:include js2-xml-node)
+ (:constructor make-js2-xml-pi-node (&key (type js2-XML)
+ (pos js2-ts-cursor)
+ len name attrs)))
+ "AST node for an E4X XML processing instruction. Not currently used."
+ name ; a `js2-xml-name-node'
+ attrs) ; a list of `js2-xml-attr-node'
+
+(js2--struct-put 'js2-xml-pi-node 'js2-visitor 'js2-visit-xml-pi-node)
+(js2--struct-put 'js2-xml-pi-node 'js2-printer 'js2-print-xml-pi-node)
+
+(defun js2-visit-xml-pi-node (n v)
+ (js2-visit-ast (js2-xml-pi-node-name n) v)
+ (dolist (attr (js2-xml-pi-node-attrs n))
+ (js2-visit-ast attr v)))
+
+(defun js2-print-xml-pi-node (n i)
+ (insert (js2-make-pad i) "<?")
+ (js2-print-ast (js2-xml-pi-node-name n))
+ (when (js2-xml-pi-node-attrs n)
+ (insert " ")
+ (js2-print-list (js2-xml-pi-node-attrs n)))
+ (insert "?>"))
+
+(cl-defstruct (js2-xml-cdata-node
+ (:include js2-xml-node)
+ (:constructor make-js2-xml-cdata-node (&key (type js2-XML)
+ (pos js2-ts-cursor)
+ len content)))
+ "AST node for a CDATA escape section. Not currently used."
+ content) ; a `js2-string-node' with node-property 'quote-type 'cdata
+
+(js2--struct-put 'js2-xml-cdata-node 'js2-visitor 'js2-visit-xml-cdata-node)
+(js2--struct-put 'js2-xml-cdata-node 'js2-printer 'js2-print-xml-cdata-node)
+
+(defun js2-visit-xml-cdata-node (n v)
+ (js2-visit-ast (js2-xml-cdata-node-content n) v))
+
+(defun js2-print-xml-cdata-node (n i)
+ (insert (js2-make-pad i))
+ (js2-print-ast (js2-xml-cdata-node-content n)))
+
+(cl-defstruct (js2-xml-attr-node
+ (:include js2-xml-node)
+ (:constructor make-js2-attr-node (&key (type js2-XML)
+ (pos js2-ts-cursor)
+ len name value
+ eq-pos quote-type)))
+ "AST node representing a foo=\\='bar\\=' XML attribute value. Not yet used."
+ name ; a `js2-xml-name-node'
+ value ; a `js2-xml-name-node'
+ eq-pos ; buffer position of "=" sign
+ quote-type) ; 'single or 'double
+
+(js2--struct-put 'js2-xml-attr-node 'js2-visitor 'js2-visit-xml-attr-node)
+(js2--struct-put 'js2-xml-attr-node 'js2-printer 'js2-print-xml-attr-node)
+
+(defun js2-visit-xml-attr-node (n v)
+ (js2-visit-ast (js2-xml-attr-node-name n) v)
+ (js2-visit-ast (js2-xml-attr-node-value n) v))
+
+(defun js2-print-xml-attr-node (n i)
+ (let ((quote (if (eq (js2-xml-attr-node-quote-type n) 'single)
+ "'"
+ "\"")))
+ (insert (js2-make-pad i))
+ (js2-print-ast (js2-xml-attr-node-name n) 0)
+ (insert "=" quote)
+ (js2-print-ast (js2-xml-attr-node-value n) 0)
+ (insert quote)))
+
+(cl-defstruct (js2-xml-text-node
+ (:include js2-xml-node)
+ (:constructor make-js2-text-node (&key (type js2-XML)
+ (pos js2-ts-cursor)
+ len content)))
+ "AST node for an E4X XML text node. Not currently used."
+ content) ; a Lisp list of `js2-string-node' and `js2-xml-js-expr-node'
+
+(js2--struct-put 'js2-xml-text-node 'js2-visitor 'js2-visit-xml-text-node)
+(js2--struct-put 'js2-xml-text-node 'js2-printer 'js2-print-xml-text-node)
+
+(defun js2-visit-xml-text-node (n v)
+ (js2-visit-ast (js2-xml-text-node-content n) v))
+
+(defun js2-print-xml-text-node (n i)
+ (insert (js2-make-pad i))
+ (dolist (kid (js2-xml-text-node-content n))
+ (js2-print-ast kid)))
+
+(cl-defstruct (js2-xml-comment-node
+ (:include js2-xml-node)
+ (:constructor make-js2-xml-comment-node (&key (type js2-XML)
+ (pos js2-ts-cursor)
+ len)))
+ "AST node for E4X XML comment. Not currently used.")
+
+(js2--struct-put 'js2-xml-comment-node 'js2-visitor 'js2-visit-none)
+(js2--struct-put 'js2-xml-comment-node 'js2-printer 'js2-print-xml-comment)
+
+(defun js2-print-xml-comment (n i)
+ (insert (js2-make-pad i)
+ (js2-node-string n)))
+
+;;; Node utilities
+
+(defsubst js2-node-line (n)
+ "Fetch the source line number at the start of node N.
+This is O(n) in the length of the source buffer; use prudently."
+ (1+ (count-lines (point-min) (js2-node-abs-pos n))))
+
+(defsubst js2-block-node-kid (n i)
+ "Return child I of node N, or nil if there aren't that many."
+ (nth i (js2-block-node-kids n)))
+
+(defsubst js2-block-node-first (n)
+ "Return first child of block node N, or nil if there is none."
+ (cl-first (js2-block-node-kids n)))
+
+(defun js2-node-root (n)
+ "Return the root of the AST containing N.
+If N has no parent pointer, returns N."
+ (let ((parent (js2-node-parent n)))
+ (if parent
+ (js2-node-root parent)
+ n)))
+
+(defsubst js2-node-short-name (n)
+ "Return the short name of node N as a string, e.g. `js2-if-node'."
+ (let ((name (symbol-name (aref n 0))))
+ (if (string-prefix-p "cl-struct-" name)
+ (substring (symbol-name (aref n 0))
+ (length "cl-struct-"))
+ name)))
+
+(defun js2-node-child-list (node)
+ "Return the child list for NODE, a Lisp list of nodes.
+Works for block nodes, array nodes, obj literals, funarg lists,
+var decls and try nodes (for catch clauses). Note that you should call
+`js2-block-node-kids' on the function body for the body statements.
+Returns nil for zero-length child lists or unsupported nodes."
+ (cond
+ ((js2-function-node-p node)
+ (js2-function-node-params node))
+ ((js2-block-node-p node)
+ (js2-block-node-kids node))
+ ((js2-try-node-p node)
+ (js2-try-node-catch-clauses node))
+ ((js2-array-node-p node)
+ (js2-array-node-elems node))
+ ((js2-object-node-p node)
+ (js2-object-node-elems node))
+ ((js2-call-node-p node)
+ (js2-call-node-args node))
+ ((js2-new-node-p node)
+ (js2-new-node-args node))
+ ((js2-var-decl-node-p node)
+ (js2-var-decl-node-kids node))
+ (t
+ nil)))
+
+(defun js2-node-set-child-list (node kids)
+ "Set the child list for NODE to KIDS."
+ (cond
+ ((js2-function-node-p node)
+ (setf (js2-function-node-params node) kids))
+ ((js2-block-node-p node)
+ (setf (js2-block-node-kids node) kids))
+ ((js2-try-node-p node)
+ (setf (js2-try-node-catch-clauses node) kids))
+ ((js2-array-node-p node)
+ (setf (js2-array-node-elems node) kids))
+ ((js2-object-node-p node)
+ (setf (js2-object-node-elems node) kids))
+ ((js2-call-node-p node)
+ (setf (js2-call-node-args node) kids))
+ ((js2-new-node-p node)
+ (setf (js2-new-node-args node) kids))
+ ((js2-var-decl-node-p node)
+ (setf (js2-var-decl-node-kids node) kids))
+ (t
+ (error "Unsupported node type: %s" (js2-node-short-name node))))
+ kids)
+
+;; All because Common Lisp doesn't support multiple inheritance for defstructs.
+(defconst js2-paren-expr-nodes
+ '(cl-struct-js2-comp-loop-node
+ cl-struct-js2-comp-node
+ cl-struct-js2-call-node
+ cl-struct-js2-catch-node
+ cl-struct-js2-do-node
+ cl-struct-js2-elem-get-node
+ cl-struct-js2-for-in-node
+ cl-struct-js2-for-node
+ cl-struct-js2-function-node
+ cl-struct-js2-if-node
+ cl-struct-js2-let-node
+ cl-struct-js2-new-node
+ cl-struct-js2-paren-node
+ cl-struct-js2-switch-node
+ cl-struct-js2-while-node
+ cl-struct-js2-with-node
+ cl-struct-js2-xml-dot-query-node)
+ "Node types that can have a parenthesized child expression.
+In particular, nodes that respond to `js2-node-lp' and `js2-node-rp'.")
+
+(defsubst js2-paren-expr-node-p (node)
+ "Return t for nodes that typically have a parenthesized child expression.
+Useful for computing the indentation anchors for arg-lists and conditions.
+Note that it may return a false positive, for instance when NODE is
+a `js2-new-node' and there are no arguments or parentheses."
+ (memq (aref node 0) js2-paren-expr-nodes))
+
+;; Fake polymorphism... yech.
+(defun js2-node-lp (node)
+ "Return relative left-paren position for NODE, if applicable.
+For `js2-elem-get-node' structs, returns left-bracket position.
+Note that the position may be nil in the case of a parse error."
+ (cond
+ ((js2-elem-get-node-p node)
+ (js2-elem-get-node-lb node))
+ ((js2-loop-node-p node)
+ (js2-loop-node-lp node))
+ ((js2-function-node-p node)
+ (js2-function-node-lp node))
+ ((js2-if-node-p node)
+ (js2-if-node-lp node))
+ ((js2-new-node-p node)
+ (js2-new-node-lp node))
+ ((js2-call-node-p node)
+ (js2-call-node-lp node))
+ ((js2-paren-node-p node)
+ 0)
+ ((js2-switch-node-p node)
+ (js2-switch-node-lp node))
+ ((js2-catch-node-p node)
+ (js2-catch-node-lp node))
+ ((js2-let-node-p node)
+ (js2-let-node-lp node))
+ ((js2-comp-node-p node)
+ 0)
+ ((js2-with-node-p node)
+ (js2-with-node-lp node))
+ ((js2-xml-dot-query-node-p node)
+ (1+ (js2-infix-node-op-pos node)))
+ (t
+ (error "Unsupported node type: %s" (js2-node-short-name node)))))
+
+;; Fake polymorphism... blech.
+(defun js2-node-rp (node)
+ "Return relative right-paren position for NODE, if applicable.
+For `js2-elem-get-node' structs, returns right-bracket position.
+Note that the position may be nil in the case of a parse error."
+ (cond
+ ((js2-elem-get-node-p node)
+ (js2-elem-get-node-rb node))
+ ((js2-loop-node-p node)
+ (js2-loop-node-rp node))
+ ((js2-function-node-p node)
+ (js2-function-node-rp node))
+ ((js2-if-node-p node)
+ (js2-if-node-rp node))
+ ((js2-new-node-p node)
+ (js2-new-node-rp node))
+ ((js2-call-node-p node)
+ (js2-call-node-rp node))
+ ((js2-paren-node-p node)
+ (1- (js2-node-len node)))
+ ((js2-switch-node-p node)
+ (js2-switch-node-rp node))
+ ((js2-catch-node-p node)
+ (js2-catch-node-rp node))
+ ((js2-let-node-p node)
+ (js2-let-node-rp node))
+ ((js2-comp-node-p node)
+ (1- (js2-node-len node)))
+ ((js2-with-node-p node)
+ (js2-with-node-rp node))
+ ((js2-xml-dot-query-node-p node)
+ (1+ (js2-xml-dot-query-node-rp node)))
+ (t
+ (error "Unsupported node type: %s" (js2-node-short-name node)))))
+
+(defsubst js2-node-first-child (node)
+ "Return the first element of `js2-node-child-list' for NODE."
+ (car (js2-node-child-list node)))
+
+(defsubst js2-node-last-child (node)
+ "Return the last element of `js2-node-last-child' for NODE."
+ (car (last (js2-node-child-list node))))
+
+(defun js2-node-prev-sibling (node)
+ "Return the previous statement in parent.
+Works for parents supported by `js2-node-child-list'.
+Returns nil if NODE is not in the parent, or PARENT is
+not a supported node, or if NODE is the first child."
+ (let* ((p (js2-node-parent node))
+ (kids (js2-node-child-list p))
+ (sib (car kids)))
+ (while (and kids
+ (not (eq node (cadr kids))))
+ (setq kids (cdr kids)
+ sib (car kids)))
+ sib))
+
+(defun js2-node-next-sibling (node)
+ "Return the next statement in parent block.
+Returns nil if NODE is not in the block, or PARENT is not
+a block node, or if NODE is the last statement."
+ (let* ((p (js2-node-parent node))
+ (kids (js2-node-child-list p)))
+ (while (and kids
+ (not (eq node (car kids))))
+ (setq kids (cdr kids)))
+ (cadr kids)))
+
+(defun js2-node-find-child-before (pos parent &optional after)
+ "Find the last child that starts before POS in parent.
+If AFTER is non-nil, returns first child starting after POS.
+POS is an absolute buffer position. PARENT is any node
+supported by `js2-node-child-list'.
+Returns nil if no applicable child is found."
+ (let ((kids (if (js2-function-node-p parent)
+ (js2-block-node-kids (js2-function-node-body parent))
+ (js2-node-child-list parent)))
+ (beg (js2-node-abs-pos (if (js2-function-node-p parent)
+ (js2-function-node-body parent)
+ parent)))
+ kid result fn
+ (continue t))
+ (setq fn (if after '>= '<))
+ (while (and kids continue)
+ (setq kid (car kids))
+ (if (funcall fn (+ beg (js2-node-pos kid)) pos)
+ (setq result kid
+ continue (not after))
+ (setq continue after))
+ (setq kids (cdr kids)))
+ result))
+
+(defun js2-node-find-child-after (pos parent)
+ "Find first child that starts after POS in parent.
+POS is an absolute buffer position. PARENT is any node
+supported by `js2-node-child-list'.
+Returns nil if no applicable child is found."
+ (js2-node-find-child-before pos parent 'after))
+
+(defun js2-node-replace-child (pos parent new-node)
+ "Replace node at index POS in PARENT with NEW-NODE.
+Only works for parents supported by `js2-node-child-list'."
+ (let ((kids (js2-node-child-list parent))
+ (i 0))
+ (while (< i pos)
+ (setq kids (cdr kids)
+ i (1+ i)))
+ (setcar kids new-node)
+ (js2-node-add-children parent new-node)))
+
+(defun js2-node-buffer (n)
+ "Return the buffer associated with AST N.
+Returns nil if the buffer is not set as a property on the root
+node, or if parent links were not recorded during parsing."
+ (let ((root (js2-node-root n)))
+ (and root
+ (js2-ast-root-p root)
+ (js2-ast-root-buffer root))))
+
+(defun js2-block-node-push (n kid)
+ "Push js2-node KID onto the end of js2-block-node N's child list.
+KID is always added to the -end- of the kids list.
+Function also calls `js2-node-add-children' to add the parent link."
+ (let ((kids (js2-node-child-list n)))
+ (if kids
+ (setcdr kids (nconc (cdr kids) (list kid)))
+ (js2-node-set-child-list n (list kid)))
+ (js2-node-add-children n kid)))
+
+(defun js2-node-string (node)
+ (with-current-buffer (or (js2-node-buffer node)
+ (error "No buffer available for node %s" node))
+ (let ((pos (js2-node-abs-pos node)))
+ (buffer-substring-no-properties pos (+ pos (js2-node-len node))))))
+
+;; Container for storing the node we're looking for in a traversal.
+(js2-deflocal js2-discovered-node nil)
+
+;; Keep track of absolute node position during traversals.
+(js2-deflocal js2-visitor-offset nil)
+
+(js2-deflocal js2-node-search-point nil)
+
+(when js2-mode-dev-mode-p
+ (defun js2-find-node-at-point ()
+ (interactive)
+ (let ((node (js2-node-at-point)))
+ (message "%s" (or node "No node found at point"))))
+ (defun js2-node-name-at-point ()
+ (interactive)
+ (let ((node (js2-node-at-point)))
+ (message "%s" (if node
+ (js2-node-short-name node)
+ "No node found at point.")))))
+
+(defun js2-node-at-point (&optional pos skip-comments)
+ "Return AST node at POS, a buffer position, defaulting to current point.
+The `js2-mode-ast' variable must be set to the current parse tree.
+Signals an error if the AST (`js2-mode-ast') is nil.
+Always returns a node - if it can't find one, it returns the root.
+If SKIP-COMMENTS is non-nil, comment nodes are ignored."
+ (let ((ast js2-mode-ast)
+ result)
+ (unless ast
+ (error "No JavaScript AST available"))
+ ;; Look through comments first, since they may be inside nodes that
+ ;; would otherwise report a match.
+ (setq pos (or pos (point))
+ result (if (> pos (js2-node-abs-end ast))
+ ast
+ (if (not skip-comments)
+ (js2-comment-at-point pos))))
+ (unless result
+ (setq js2-discovered-node nil
+ js2-visitor-offset 0
+ js2-node-search-point pos)
+ (unwind-protect
+ (catch 'js2-visit-done
+ (js2-visit-ast ast #'js2-node-at-point-visitor))
+ (setq js2-visitor-offset nil
+ js2-node-search-point nil))
+ (setq result js2-discovered-node))
+ ;; may have found a comment beyond end of last child node,
+ ;; since visiting the ast-root looks at the comment-list last.
+ (if (and skip-comments
+ (js2-comment-node-p result))
+ (setq result nil))
+ (or result js2-mode-ast)))
+
+(defun js2-node-at-point-visitor (node end-p)
+ (let ((rel-pos (js2-node-pos node))
+ abs-pos
+ abs-end
+ (point js2-node-search-point))
+ (cond
+ (end-p
+ ;; this evaluates to a non-nil return value, even if it's zero
+ (cl-decf js2-visitor-offset rel-pos))
+ ;; we already looked for comments before visiting, and don't want them now
+ ((js2-comment-node-p node)
+ nil)
+ (t
+ (setq abs-pos (cl-incf js2-visitor-offset rel-pos)
+ ;; we only want to use the node if the point is before
+ ;; the last character position in the node, so we decrement
+ ;; the absolute end by 1.
+ abs-end (+ abs-pos (js2-node-len node) -1))
+ (cond
+ ;; If this node starts after search-point, stop the search.
+ ((> abs-pos point)
+ (throw 'js2-visit-done nil))
+ ;; If this node ends before the search-point, don't check kids.
+ ((> point abs-end)
+ nil)
+ (t
+ ;; Otherwise point is within this node, possibly in a child.
+ (setq js2-discovered-node node)
+ t)))))) ; keep processing kids to look for more specific match
+
+(defsubst js2-block-comment-p (node)
+ "Return non-nil if NODE is a comment node of format `jsdoc' or `block'."
+ (and (js2-comment-node-p node)
+ (memq (js2-comment-node-format node) '(jsdoc block))))
+
+;; TODO: put the comments in a vector and binary-search them instead
+(defun js2-comment-at-point (&optional pos)
+ "Look through scanned comment nodes for one containing POS.
+POS is a buffer position that defaults to current point.
+Function returns nil if POS was not in any comment node."
+ (let ((ast js2-mode-ast)
+ (x (or pos (point)))
+ beg end)
+ (unless ast
+ (error "No JavaScript AST available"))
+ (catch 'done
+ ;; Comments are stored in lexical order.
+ (dolist (comment (js2-ast-root-comments ast) nil)
+ (setq beg (js2-node-abs-pos comment)
+ end (+ beg (js2-node-len comment)))
+ (if (and (>= x beg)
+ (<= x end))
+ (throw 'done comment))))))
+
+(defun js2-comments-between (start end comments-list)
+ "Return comment nodes between START and END, nil if not found.
+START and END are absolute positions in current buffer.
+COMMENTS-LIST is the comments list to check."
+ (let (comments c-start c-end)
+ (nreverse
+ (dolist (comment comments-list comments)
+ (setq c-start (js2-node-abs-pos comment)
+ c-end (1- (+ c-start (js2-node-len comment))))
+ (unless (or (< c-end start)
+ (> c-start end))
+ (push comment comments))))))
+
+(defun js2-mode-find-parent-fn (node)
+ "Find function enclosing NODE.
+Returns nil if NODE is not inside a function."
+ (setq node (js2-node-parent node))
+ (while (and node (not (js2-function-node-p node)))
+ (setq node (js2-node-parent node)))
+ (and (js2-function-node-p node) node))
+
+(defun js2-mode-find-enclosing-fn (node)
+ "Find function or root enclosing NODE."
+ (if (js2-ast-root-p node)
+ node
+ (setq node (js2-node-parent node))
+ (while (not (or (js2-ast-root-p node)
+ (js2-function-node-p node)))
+ (setq node (js2-node-parent node)))
+ node))
+
+ (defun js2-mode-find-enclosing-node (beg end)
+ "Find node fully enclosing BEG and END."
+ (let ((node (js2-node-at-point beg))
+ pos
+ (continue t))
+ (while continue
+ (if (or (js2-ast-root-p node)
+ (and
+ (<= (setq pos (js2-node-abs-pos node)) beg)
+ (>= (+ pos (js2-node-len node)) end)))
+ (setq continue nil)
+ (setq node (js2-node-parent node))))
+ node))
+
+(defun js2-node-parent-script-or-fn (node)
+ "Find script or function immediately enclosing NODE.
+If NODE is the ast-root, returns nil."
+ (if (js2-ast-root-p node)
+ nil
+ (setq node (js2-node-parent node))
+ (while (and node (not (or (js2-function-node-p node)
+ (js2-script-node-p node))))
+ (setq node (js2-node-parent node)))
+ node))
+
+(defun js2-node-is-descendant (node ancestor)
+ "Return t if NODE is a descendant of ANCESTOR."
+ (while (and node
+ (not (eq node ancestor)))
+ (setq node (js2-node-parent node)))
+ node)
+
+;;; visitor infrastructure
+
+(defun js2-visit-none (_node _callback)
+ "Visitor for AST node that have no node children."
+ nil)
+
+(defun js2-print-none (_node _indent)
+ "Visitor for AST node with no printed representation.")
+
+(defun js2-print-body (node indent)
+ "Print a statement, or a block without braces."
+ (if (js2-block-node-p node)
+ (dolist (kid (js2-block-node-kids node))
+ (js2-print-ast kid indent))
+ (js2-print-ast node indent)))
+
+(defun js2-print-list (args &optional delimiter)
+ (cl-loop with len = (length args)
+ for arg in args
+ for count from 1
+ do
+ (when arg (js2-print-ast arg 0))
+ (if (< count len)
+ (insert (or delimiter ", ")))))
+
+(defun js2-print-tree (ast)
+ "Prints an AST to the current buffer.
+Makes `js2-ast-parent-nodes' available to the printer functions."
+ (let ((max-lisp-eval-depth (max max-lisp-eval-depth 1500)))
+ (js2-print-ast ast)))
+
+(defun js2-print-ast (node &optional indent)
+ "Helper function for printing AST nodes.
+Requires `js2-ast-parent-nodes' to be non-nil.
+You should use `js2-print-tree' instead of this function."
+ (let ((printer (get (aref node 0) 'js2-printer))
+ (i (or indent 0)))
+ ;; TODO: wedge comments in here somewhere
+ (if printer
+ (funcall printer node i))))
+
+(defconst js2-side-effecting-tokens
+ (let ((tokens (make-bool-vector js2-num-tokens nil)))
+ (dolist (tt (list js2-ASSIGN
+ js2-ASSIGN_ADD
+ js2-ASSIGN_BITAND
+ js2-ASSIGN_BITOR
+ js2-ASSIGN_BITXOR
+ js2-ASSIGN_DIV
+ js2-ASSIGN_LSH
+ js2-ASSIGN_MOD
+ js2-ASSIGN_MUL
+ js2-ASSIGN_RSH
+ js2-ASSIGN_SUB
+ js2-ASSIGN_URSH
+ js2-ASSIGN_EXPON
+ js2-ASSIGN_AND
+ js2-ASSIGN_OR
+ js2-ASSIGN_NULLISH
+ js2-BLOCK
+ js2-BREAK
+ js2-CALL
+ js2-CATCH
+ js2-CATCH_SCOPE
+ js2-CLASS
+ js2-CONST
+ js2-CONTINUE
+ js2-DEBUGGER
+ js2-DEC
+ js2-DELPROP
+ js2-DEL_REF
+ js2-DO
+ js2-ELSE
+ js2-EMPTY
+ js2-ENTERWITH
+ js2-EXPORT
+ js2-EXPR_RESULT
+ js2-FINALLY
+ js2-FOR
+ js2-FUNCTION
+ js2-GOTO
+ js2-IF
+ js2-IFEQ
+ js2-IFNE
+ js2-IMPORT
+ js2-INC
+ js2-JSR
+ js2-LABEL
+ js2-LEAVEWITH
+ js2-LET
+ js2-LETEXPR
+ js2-LOCAL_BLOCK
+ js2-LOOP
+ js2-NEW
+ js2-REF_CALL
+ js2-RETHROW
+ js2-RETURN
+ js2-RETURN_RESULT
+ js2-SEMI
+ js2-SETELEM
+ js2-SETELEM_OP
+ js2-SETNAME
+ js2-SETPROP
+ js2-SETPROP_OP
+ js2-SETVAR
+ js2-SET_REF
+ js2-SET_REF_OP
+ js2-SWITCH
+ js2-TARGET
+ js2-THROW
+ js2-TRY
+ js2-VAR
+ js2-WHILE
+ js2-WITH
+ js2-WITHEXPR
+ js2-YIELD))
+ (aset tokens tt t))
+ tokens))
+
+(defun js2-node-has-side-effects (node)
+ "Return t if NODE has side effects."
+ (when node ; makes it easier to handle malformed expressions
+ (let ((tt (js2-node-type node)))
+ (cond
+ ;; This doubtless needs some work, since EXPR_VOID is used
+ ;; in several ways in Rhino and I may not have caught them all.
+ ;; I'll wait for people to notice incorrect warnings.
+ ((and (= tt js2-EXPR_VOID)
+ (js2-expr-stmt-node-p node)) ; but not if EXPR_RESULT
+ (let ((expr (js2-expr-stmt-node-expr node)))
+ (or (js2-node-has-side-effects expr)
+ (when (js2-string-node-p expr)
+ (member (js2-string-node-value expr) '("use strict" "use asm"))))))
+ ((= tt js2-AWAIT) t)
+ ((= tt js2-COMMA)
+ (js2-node-has-side-effects (js2-infix-node-right node)))
+ ((or (= tt js2-AND)
+ (= tt js2-OR)
+ (= tt js2-NULLISH-COALESCING))
+ (or (js2-node-has-side-effects (js2-infix-node-right node))
+ (js2-node-has-side-effects (js2-infix-node-left node))))
+ ((= tt js2-HOOK)
+ (and (js2-node-has-side-effects (js2-cond-node-true-expr node))
+ (js2-node-has-side-effects (js2-cond-node-false-expr node))))
+ ((js2-paren-node-p node)
+ (js2-node-has-side-effects (js2-paren-node-expr node)))
+ ((= tt js2-ERROR) ; avoid cascaded error messages
+ nil)
+ ((or (and js2-instanceof-has-side-effects (= tt js2-INSTANCEOF))
+ (and js2-getprop-has-side-effects (= tt js2-GETPROP)))
+ t)
+ (t
+ (aref js2-side-effecting-tokens tt))))))
+
+(defconst js2-stmt-node-types
+ (list js2-BLOCK
+ js2-BREAK
+ js2-CONTINUE
+ js2-DEFAULT ; e4x "default xml namespace" statement
+ js2-DO
+ js2-EXPORT
+ js2-EXPR_RESULT
+ js2-EXPR_VOID
+ js2-FOR
+ js2-IF
+ js2-IMPORT
+ js2-RETURN
+ js2-SWITCH
+ js2-THROW
+ js2-TRY
+ js2-WHILE
+ js2-WITH)
+ "Node types that only appear in statement contexts.
+The list does not include nodes that always appear as the child
+of another specific statement type, such as switch-cases,
+catch and finally blocks, and else-clauses. The list also excludes
+nodes like yield, let and var, which may appear in either expression
+or statement context, and in the latter context always have a
+`js2-expr-stmt-node' parent. Finally, the list does not include
+functions or scripts, which are treated separately from statements
+by the JavaScript parser and runtime.")
+
+(defun js2-stmt-node-p (node)
+ "Heuristic for figuring out if NODE is a statement.
+Some node types can appear in either an expression context or a
+statement context, e.g. let-nodes, yield-nodes, and var-decl nodes.
+For these node types in a statement context, the parent will be a
+`js2-expr-stmt-node'.
+Functions aren't included in the check."
+ (memq (js2-node-type node) js2-stmt-node-types))
+
+(defun js2-mode-find-first-stmt (node)
+ "Search upward starting from NODE looking for a statement.
+For purposes of this function, a `js2-function-node' counts."
+ (while (not (or (js2-stmt-node-p node)
+ (js2-function-node-p node)))
+ (setq node (js2-node-parent node)))
+ node)
+
+(defun js2-node-parent-stmt (node)
+ "Return the node's first ancestor that is a statement.
+Returns nil if NODE is a `js2-ast-root'. Note that any expression
+appearing in a statement context will have a parent that is a
+`js2-expr-stmt-node' that will be returned by this function."
+ (let ((parent (js2-node-parent node)))
+ (if (or (null parent)
+ (js2-stmt-node-p parent)
+ (and (js2-function-node-p parent)
+ (eq (js2-function-node-form parent) 'FUNCTION_STATEMENT)))
+ parent
+ (js2-node-parent-stmt parent))))
+
+;; In the Mozilla Rhino sources, Roshan James writes:
+;; Does consistent-return analysis on the function body when strict mode is
+;; enabled.
+;;
+;; function (x) { return (x+1) }
+;;
+;; is ok, but
+;;
+;; function (x) { if (x < 0) return (x+1); }
+;;
+;; is not because the function can potentially return a value when the
+;; condition is satisfied and if not, the function does not explicitly
+;; return a value.
+;;
+;; This extends to checking mismatches such as "return" and "return <value>"
+;; used in the same function. Warnings are not emitted if inconsistent
+;; returns exist in code that can be statically shown to be unreachable.
+;; Ex.
+;; function (x) { while (true) { ... if (..) { return value } ... } }
+;;
+;; emits no warning. However if the loop had a break statement, then a
+;; warning would be emitted.
+;;
+;; The consistency analysis looks at control structures such as loops, ifs,
+;; switch, try-catch-finally blocks, examines the reachable code paths and
+;; warns the user about an inconsistent set of termination possibilities.
+;;
+;; These flags enumerate the possible ways a statement/function can
+;; terminate. These flags are used by endCheck() and by the Parser to
+;; detect inconsistent return usage.
+;;
+;; END_UNREACHED is reserved for code paths that are assumed to always be
+;; able to execute (example: throw, continue)
+;;
+;; END_DROPS_OFF indicates if the statement can transfer control to the
+;; next one. Statement such as return dont. A compound statement may have
+;; some branch that drops off control to the next statement.
+;;
+;; END_RETURNS indicates that the statement can return with no value.
+;; END_RETURNS_VALUE indicates that the statement can return a value.
+;;
+;; A compound statement such as
+;; if (condition) {
+;; return value;
+;; }
+;; Will be detected as (END_DROPS_OFF | END_RETURN_VALUE) by endCheck()
+
+(defconst js2-END_UNREACHED 0)
+(defconst js2-END_DROPS_OFF 1)
+(defconst js2-END_RETURNS 2)
+(defconst js2-END_RETURNS_VALUE 4)
+(defconst js2-END_YIELDS 8)
+
+(defun js2-has-consistent-return-usage (node)
+ "Check that every return usage in a function body is consistent.
+Returns t if the function satisfies strict mode requirement."
+ (let ((n (js2-end-check node)))
+ ;; either it doesn't return a value in any branch...
+ (or (js2-flag-not-set-p n js2-END_RETURNS_VALUE)
+ ;; or it returns a value (or is unreached) at every branch
+ (js2-flag-not-set-p n (logior js2-END_DROPS_OFF
+ js2-END_RETURNS
+ js2-END_YIELDS)))))
+
+(defun js2-end-check-if (node)
+ "Ensure that return usage in then/else blocks is consistent.
+If there is no else block, then the return statement can fall through.
+Returns logical OR of END_* flags"
+ (let ((th (js2-if-node-then-part node))
+ (el (js2-if-node-else-part node)))
+ (if (null th)
+ js2-END_UNREACHED
+ (logior (js2-end-check th) (if el
+ (js2-end-check el)
+ js2-END_DROPS_OFF)))))
+
+(defun js2-end-check-switch (node)
+ "Consistency of return statements is checked between the case statements.
+If there is no default, then the switch can fall through. If there is a
+default, we check to see if all code paths in the default return or if
+there is a code path that can fall through.
+Returns logical OR of END_* flags."
+ (let ((rv js2-END_UNREACHED)
+ default-case)
+ ;; examine the cases
+ (catch 'break
+ (dolist (c (js2-switch-node-cases node))
+ (if (js2-case-node-expr c)
+ (js2-set-flag rv (js2-end-check-block c))
+ (setq default-case c)
+ (throw 'break nil))))
+ ;; we don't care how the cases drop into each other
+ (js2-clear-flag rv js2-END_DROPS_OFF)
+ ;; examine the default
+ (js2-set-flag rv (if default-case
+ (js2-end-check default-case)
+ js2-END_DROPS_OFF))
+ rv))
+
+(defun js2-end-check-try (node)
+ "If the block has a finally, return consistency is checked in the
+finally block. If all code paths in the finally return, then the
+returns in the try-catch blocks don't matter. If there is a code path
+that does not return or if there is no finally block, the returns
+of the try and catch blocks are checked for mismatch.
+Returns logical OR of END_* flags."
+ (let ((finally (js2-try-node-finally-block node))
+ rv)
+ ;; check the finally if it exists
+ (setq rv (if finally
+ (js2-end-check (js2-finally-node-body finally))
+ js2-END_DROPS_OFF))
+ ;; If the finally block always returns, then none of the returns
+ ;; in the try or catch blocks matter.
+ (when (js2-flag-set-p rv js2-END_DROPS_OFF)
+ (js2-clear-flag rv js2-END_DROPS_OFF)
+ ;; examine the try block
+ (js2-set-flag rv (js2-end-check (js2-try-node-try-block node)))
+ ;; check each catch block
+ (dolist (cb (js2-try-node-catch-clauses node))
+ (js2-set-flag rv (js2-end-check cb))))
+ rv))
+
+(defun js2-end-check-loop (node)
+ "Return statement in the loop body must be consistent.
+The default assumption for any kind of a loop is that it will eventually
+terminate. The only exception is a loop with a constant true condition.
+Code that follows such a loop is examined only if one can determine
+statically that there is a break out of the loop.
+
+ for(... ; ... ; ...) {}
+ for(... in ... ) {}
+ while(...) { }
+ do { } while(...)
+
+Returns logical OR of END_* flags."
+ (let ((rv (js2-end-check (js2-loop-node-body node)))
+ (condition (cond
+ ((js2-while-node-p node)
+ (js2-while-node-condition node))
+ ((js2-do-node-p node)
+ (js2-do-node-condition node))
+ ((js2-for-node-p node)
+ (js2-for-node-condition node)))))
+
+ ;; check to see if the loop condition is always true
+ (if (and condition
+ (eq (js2-always-defined-boolean-p condition) 'ALWAYS_TRUE))
+ (js2-clear-flag rv js2-END_DROPS_OFF))
+
+ ;; look for effect of breaks
+ (js2-set-flag rv (js2-node-get-prop node
+ 'CONTROL_BLOCK_PROP
+ js2-END_UNREACHED))
+ rv))
+
+(defun js2-end-check-block (node)
+ "A general block of code is examined statement by statement.
+If any statement (even a compound one) returns in all branches, then
+subsequent statements are not examined.
+Returns logical OR of END_* flags."
+ (let* ((rv js2-END_DROPS_OFF)
+ (kids (js2-block-node-kids node))
+ (n (car kids)))
+ ;; Check each statement. If the statement can continue onto the next
+ ;; one (i.e. END_DROPS_OFF is set), then check the next statement.
+ (while (and n (js2-flag-set-p rv js2-END_DROPS_OFF))
+ (js2-clear-flag rv js2-END_DROPS_OFF)
+ (js2-set-flag rv (js2-end-check n))
+ (setq kids (cdr kids)
+ n (car kids)))
+ rv))
+
+(defun js2-end-check-label (node)
+ "A labeled statement implies that there may be a break to the label.
+The function processes the labeled statement and then checks the
+CONTROL_BLOCK_PROP property to see if there is ever a break to the
+particular label.
+Returns logical OR of END_* flags."
+ (let ((rv (js2-end-check (js2-labeled-stmt-node-stmt node))))
+ (logior rv (js2-node-get-prop node
+ 'CONTROL_BLOCK_PROP
+ js2-END_UNREACHED))))
+
+(defun js2-end-check-break (node)
+ "When a break is encountered annotate the statement being broken
+out of by setting its CONTROL_BLOCK_PROP property.
+Returns logical OR of END_* flags."
+ (and (js2-break-node-target node)
+ (js2-node-set-prop (js2-break-node-target node)
+ 'CONTROL_BLOCK_PROP
+ js2-END_DROPS_OFF))
+ js2-END_UNREACHED)
+
+(defun js2-end-check (node)
+ "Examine the body of a function, doing a basic reachability analysis.
+Returns a combination of flags END_* flags that indicate
+how the function execution can terminate. These constitute only the
+pessimistic set of termination conditions. It is possible that at
+runtime certain code paths will never be actually taken. Hence this
+analysis will flag errors in cases where there may not be errors.
+Returns logical OR of END_* flags"
+ (let (kid)
+ (cond
+ ((js2-break-node-p node)
+ (js2-end-check-break node))
+ ((js2-expr-stmt-node-p node)
+ (if (setq kid (js2-expr-stmt-node-expr node))
+ (js2-end-check kid)
+ js2-END_DROPS_OFF))
+ ((or (js2-continue-node-p node)
+ (js2-throw-node-p node))
+ js2-END_UNREACHED)
+ ((js2-return-node-p node)
+ (if (setq kid (js2-return-node-retval node))
+ js2-END_RETURNS_VALUE
+ js2-END_RETURNS))
+ ((js2-loop-node-p node)
+ (js2-end-check-loop node))
+ ((js2-switch-node-p node)
+ (js2-end-check-switch node))
+ ((js2-labeled-stmt-node-p node)
+ (js2-end-check-label node))
+ ((js2-if-node-p node)
+ (js2-end-check-if node))
+ ((js2-try-node-p node)
+ (js2-end-check-try node))
+ ((js2-block-node-p node)
+ (if (null (js2-block-node-kids node))
+ js2-END_DROPS_OFF
+ (js2-end-check-block node)))
+ ((js2-yield-node-p node)
+ js2-END_YIELDS)
+ (t
+ js2-END_DROPS_OFF))))
+
+(defun js2-always-defined-boolean-p (node)
+ "Check if NODE always evaluates to true or false in boolean context.
+Returns `ALWAYS_TRUE', `ALWAYS_FALSE', or nil if it's neither always true
+nor always false."
+ (let ((tt (js2-node-type node))
+ num)
+ (cond
+ ((or (= tt js2-FALSE) (= tt js2-NULL))
+ 'ALWAYS_FALSE)
+ ((= tt js2-TRUE)
+ 'ALWAYS_TRUE)
+ ((= tt js2-NUMBER)
+ (setq num (js2-number-node-num-value node))
+ (if (and (not (eq num 0.0e+NaN))
+ (not (zerop num)))
+ 'ALWAYS_TRUE
+ 'ALWAYS_FALSE))
+ (t
+ nil))))
+
+;;; Scanner -- a port of Mozilla Rhino's lexer.
+;; Corresponds to Rhino files Token.java and TokenStream.java.
+
+(defvar js2-tokens nil
+ "List of all defined token names.") ; initialized in `js2-token-names'
+
+(defconst js2-token-names
+ (let* ((names (make-vector js2-num-tokens -1))
+ (case-fold-search nil) ; only match js2-UPPER_CASE
+ (syms (apropos-internal "^js2-\\(?:[[:upper:]_]+\\)")))
+ (cl-loop for sym in syms
+ for i from 0
+ do
+ (unless (or (memq sym '(js2-EOF_CHAR js2-ERROR))
+ (not (boundp sym)))
+ (aset names (symbol-value sym) ; code, e.g. 152
+ (downcase
+ (substring (symbol-name sym) 4))) ; name, e.g. "let"
+ (push sym js2-tokens)))
+ names)
+ "Vector mapping int values to token string names, sans `js2-' prefix.")
+
+(defun js2-tt-name (tok)
+ "Return a string name for TOK, a token symbol or code.
+Signals an error if it's not a recognized token."
+ (let ((code tok))
+ (if (symbolp tok)
+ (setq code (symbol-value tok)))
+ (if (eq code -1)
+ "ERROR"
+ (if (and (numberp code)
+ (not (cl-minusp code))
+ (< code js2-num-tokens))
+ (aref js2-token-names code)
+ (error "Invalid token: %s" code)))))
+
+(defsubst js2-tt-sym (tok)
+ "Return symbol for TOK given its code, e.g. `js2-LP' for code 86."
+ (intern (js2-tt-name tok)))
+
+(defconst js2-token-codes
+ (let ((table (make-hash-table :test 'eq :size 256)))
+ (cl-loop for name across js2-token-names
+ for sym = (intern (concat "js2-" (upcase name)))
+ do
+ (puthash sym (symbol-value sym) table))
+ ;; clean up a few that are "wrong" in Rhino's token codes
+ (puthash 'js2-DELETE js2-DELPROP table)
+ table)
+ "Hashtable mapping token type symbols to their bytecodes.")
+
+(defsubst js2-tt-code (sym)
+ "Return code for token symbol SYM, e.g. 86 for `js2-LP'."
+ (or (gethash sym js2-token-codes)
+ (error "Invalid token symbol: %s " sym))) ; signal code bug
+
+(defun js2-report-scan-error (msg &optional no-throw beg len)
+ (setf (js2-token-end (js2-current-token)) js2-ts-cursor)
+ (js2-report-error msg nil
+ (or beg (js2-current-token-beg))
+ (or len (js2-current-token-len)))
+ (unless no-throw
+ (throw 'return js2-ERROR)))
+
+(defun js2-set-string-from-buffer (token)
+ "Set `string' and `end' slots for TOKEN, return the string."
+ (setf (js2-token-end token) js2-ts-cursor
+ (js2-token-string token) (js2-collect-string js2-ts-string-buffer)))
+
+;; TODO: could potentially avoid a lot of consing by allocating a
+;; char buffer the way Rhino does.
+(defsubst js2-add-to-string (c)
+ (push c js2-ts-string-buffer))
+
+;; Note that when we "read" the end-of-file, we advance js2-ts-cursor
+;; to (1+ (point-max)), which lets the scanner treat end-of-file like
+;; any other character: when it's not part of the current token, we
+;; unget it, allowing it to be read again by the following call.
+(defsubst js2-unget-char ()
+ (cl-decf js2-ts-cursor))
+
+;; Rhino distinguishes \r and \n line endings. We don't need to
+;; because we only scan from Emacs buffers, which always use \n.
+(defun js2-get-char ()
+ "Read and return the next character from the input buffer.
+Increments `js2-ts-lineno' if the return value is a newline char.
+Updates `js2-ts-cursor' to the point after the returned char.
+Returns `js2-EOF_CHAR' if we hit the end of the buffer.
+Also updates `js2-ts-hit-eof' and `js2-ts-line-start' as needed."
+ (let (c)
+ ;; check for end of buffer
+ (if (>= js2-ts-cursor (point-max))
+ (setq js2-ts-hit-eof t
+ js2-ts-cursor (1+ js2-ts-cursor)
+ c js2-EOF_CHAR) ; return value
+ ;; otherwise read next char
+ (setq c (char-before (cl-incf js2-ts-cursor)))
+ ;; if we read a newline, update counters
+ (if (= c ?\n)
+ (setq js2-ts-line-start js2-ts-cursor
+ js2-ts-lineno (1+ js2-ts-lineno)))
+ ;; TODO: skip over format characters
+ c)))
+
+(defun js2-read-unicode-escape ()
+ "Read a \\uNNNN sequence from the input.
+Assumes the ?\\ and ?u have already been read.
+Returns the unicode character, or nil if it wasn't a valid character.
+Doesn't change the values of any scanner variables."
+ ;; I really wish I knew a better way to do this, but I can't
+ ;; find the Emacs function that takes a 16-bit int and converts
+ ;; it to a Unicode/utf-8 character. So I basically eval it with (read).
+ ;; Have to first check that it's 4 hex characters or it may stop
+ ;; the read early.
+ (ignore-errors
+ (let ((s (buffer-substring-no-properties js2-ts-cursor
+ (+ 4 js2-ts-cursor))))
+ (if (string-match "[0-9a-fA-F]\\{4\\}" s)
+ (read (concat "?\\u" s))))))
+
+(defun js2-match-char (test)
+ "Consume and return next character if it matches TEST, a character.
+Returns nil and consumes nothing if TEST is not the next character."
+ (let ((c (js2-get-char)))
+ (if (eq c test)
+ t
+ (js2-unget-char)
+ nil)))
+
+(defun js2-peek-char ()
+ (prog1
+ (js2-get-char)
+ (js2-unget-char)))
+
+(defun js2-identifier-start-p (c)
+ "Is C a valid start to an ES5 Identifier?
+See http://es5.github.io/#x7.6"
+ (or
+ (memq c '(?$ ?_))
+ (memq (get-char-code-property c 'general-category)
+ ;; Letters
+ '(Lu Ll Lt Lm Lo Nl))))
+
+(defun js2-identifier-part-p (c)
+ "Is C a valid part of an ES5 Identifier?
+See http://es5.github.io/#x7.6"
+ (or
+ (memq c '(?$ ?_ ?\u200c ?\u200d))
+ (memq (get-char-code-property c 'general-category)
+ '(;; Letters
+ Lu Ll Lt Lm Lo Nl
+ ;; Combining Marks
+ Mn Mc
+ ;; Digits
+ Nd
+ ;; Connector Punctuation
+ Pc))))
+
+(defun js2-alpha-p (c)
+ (cond ((and (<= ?A c) (<= c ?Z)) t)
+ ((and (<= ?a c) (<= c ?z)) t)
+ (t nil)))
+
+(defsubst js2-digit-p (c)
+ (and (<= ?0 c) (<= c ?9)))
+
+(defun js2-js-space-p (c)
+ (if (<= c 127)
+ (memq c '(#x20 #x9 #xB #xC #xD))
+ (or
+ (eq c #xA0)
+ ;; TODO: change this nil to check for Unicode space character
+ nil)))
+
+(defconst js2-eol-chars (list js2-EOF_CHAR ?\n ?\r))
+
+(defun js2-skip-line ()
+ "Skip to end of line."
+ (while (not (memq (js2-get-char) js2-eol-chars)))
+ (js2-unget-char)
+ (setf (js2-token-end (js2-current-token)) js2-ts-cursor))
+
+(defun js2-init-scanner (&optional buf line)
+ "Create token stream for BUF starting on LINE.
+BUF defaults to `current-buffer' and LINE defaults to 1.
+
+A buffer can only have one scanner active at a time, which yields
+dramatically simpler code than using a defstruct. If you need to
+have simultaneous scanners in a buffer, copy the regions to scan
+into temp buffers."
+ (save-excursion
+ (and buf (set-buffer buf))
+ (goto-char (point-min))
+ (when (looking-at "#!/")
+ (forward-line 1))
+ (setq js2-ts-dirty-line nil
+ js2-ts-hit-eof nil
+ js2-ts-line-start 0
+ js2-ts-lineno (or line 1)
+ js2-ts-line-end-char -1
+ js2-ts-cursor (point)
+ js2-ti-tokens (make-vector js2-ti-ntokens nil)
+ js2-ti-tokens-cursor 0
+ js2-ti-lookahead 0
+ js2-ts-is-xml-attribute nil
+ js2-ts-xml-is-tag-content nil
+ js2-ts-xml-open-tags-count 0
+ js2-ts-string-buffer nil)))
+
+;; This function uses the cached op, string and number fields in
+;; TokenStream; if getToken has been called since the passed token
+;; was scanned, the op or string printed may be incorrect.
+(defun js2-token-to-string (token)
+ ;; Not sure where this function is used in Rhino. Not tested.
+ (if (not js2-debug-print-trees)
+ ""
+ (let ((name (js2-tt-name token)))
+ (cond
+ ((memq token '(js2-STRING js2-REGEXP js2-NAME
+ js2-TEMPLATE_HEAD js2-NO_SUBS_TEMPLATE))
+ (concat name " `" (js2-current-token-string) "'"))
+ ((eq token js2-NUMBER)
+ (format "NUMBER %g" (js2-token-number (js2-current-token))))
+ (t
+ name)))))
+
+(defconst js2-keywords
+ '(break
+ case catch class const continue
+ debugger default delete do
+ else extends export
+ false finally for function
+ if in instanceof import
+ let
+ new null
+ return
+ super switch
+ this throw true try typeof
+ var void
+ while with
+ yield))
+
+;; Token names aren't exactly the same as the keywords, unfortunately.
+;; E.g. delete is js2-DELPROP.
+(defconst js2-kwd-tokens
+ (let ((table (make-vector js2-num-tokens nil))
+ (tokens
+ (list js2-BREAK
+ js2-CASE js2-CATCH js2-CLASS js2-CONST js2-CONTINUE
+ js2-DEBUGGER js2-DEFAULT js2-DELPROP js2-DO
+ js2-ELSE js2-EXPORT
+ js2-ELSE js2-EXTENDS js2-EXPORT
+ js2-FALSE js2-FINALLY js2-FOR js2-FUNCTION
+ js2-IF js2-IN js2-INSTANCEOF js2-IMPORT
+ js2-LET
+ js2-NEW js2-NULL
+ js2-RETURN
+ js2-SUPER js2-SWITCH
+ js2-THIS js2-THROW js2-TRUE js2-TRY js2-TYPEOF
+ js2-VAR
+ js2-WHILE js2-WITH
+ js2-YIELD)))
+ (dolist (i tokens)
+ (aset table i 'font-lock-keyword-face))
+ (aset table js2-STRING 'font-lock-string-face)
+ (aset table js2-REGEXP 'font-lock-string-face)
+ (aset table js2-NO_SUBS_TEMPLATE 'font-lock-string-face)
+ (aset table js2-TEMPLATE_HEAD 'font-lock-string-face)
+ (aset table js2-COMMENT 'font-lock-comment-face)
+ (aset table js2-THIS 'font-lock-builtin-face)
+ (aset table js2-SUPER 'font-lock-builtin-face)
+ (aset table js2-VOID 'font-lock-constant-face)
+ (aset table js2-NULL 'font-lock-constant-face)
+ (aset table js2-TRUE 'font-lock-constant-face)
+ (aset table js2-FALSE 'font-lock-constant-face)
+ (aset table js2-NOT 'font-lock-negation-char-face)
+ table)
+ "Vector whose values are non-nil for tokens that are keywords.
+The values are default faces to use for highlighting the keywords.")
+
+;; FIXME: Support strict mode-only future reserved words, after we know
+;; which parts scopes are in strict mode, and which are not.
+(defconst js2-reserved-words '(class enum export extends import static super)
+ "Future reserved keywords in ECMAScript 5.1.")
+
+(defconst js2-keyword-names
+ (let ((table (make-hash-table :test 'equal)))
+ (cl-loop for k in js2-keywords
+ do (puthash
+ (symbol-name k) ; instanceof
+ (intern (concat "js2-"
+ (upcase (symbol-name k)))) ; js2-INSTANCEOF
+ table))
+ table)
+ "JavaScript keywords by name, mapped to their symbols.")
+
+(defconst js2-reserved-word-names
+ (let ((table (make-hash-table :test 'equal)))
+ (cl-loop for k in js2-reserved-words
+ do
+ (puthash (symbol-name k) 'js2-RESERVED table))
+ table)
+ "JavaScript reserved words by name, mapped to `js2-RESERVED'.")
+
+(defun js2-collect-string (buf)
+ "Convert BUF, a list of chars, to a string.
+Reverses BUF before converting."
+ (if buf
+ (apply #'string (nreverse buf))
+ ""))
+
+(defun js2-string-to-keyword (s)
+ "Return token for S, a string, if S is a keyword or reserved word.
+Returns a symbol such as `js2-BREAK', or nil if not keyword/reserved."
+ (or (gethash s js2-keyword-names)
+ (gethash s js2-reserved-word-names)))
+
+(defsubst js2-ts-set-char-token-bounds (token)
+ "Used when next token is one character."
+ (setf (js2-token-beg token) (1- js2-ts-cursor)
+ (js2-token-end token) js2-ts-cursor))
+
+(defsubst js2-ts-return (token type)
+ "Update the `end' and `type' slots of TOKEN,
+then throw `return' with value TYPE."
+ (setf (js2-token-end token) js2-ts-cursor
+ (js2-token-type token) type)
+ (throw 'return type))
+
+(defun js2-x-digit-to-int (c accumulator)
+ "Build up a hex number.
+If C is a hexadecimal digit, return ACCUMULATOR * 16 plus
+corresponding number. Otherwise return -1."
+ (catch 'return
+ (catch 'check
+ ;; Use 0..9 < A..Z < a..z
+ (cond
+ ((<= c ?9)
+ (cl-decf c ?0)
+ (if (<= 0 c)
+ (throw 'check nil)))
+ ((<= c ?F)
+ (when (<= ?A c)
+ (cl-decf c (- ?A 10))
+ (throw 'check nil)))
+ ((<= c ?f)
+ (when (<= ?a c)
+ (cl-decf c (- ?a 10))
+ (throw 'check nil))))
+ (throw 'return -1))
+ (logior c (lsh accumulator 4))))
+
+(defun js2-get-token (&optional modifier)
+ "If `js2-ti-lookahead' is zero, call scanner to get new token.
+Otherwise, move `js2-ti-tokens-cursor' and return the type of
+next saved token.
+
+This function will not return a newline (js2-EOL) - instead, it
+gobbles newlines until it finds a non-newline token. Call
+`js2-peek-token-or-eol' when you care about newlines.
+
+This function will also not return a js2-COMMENT. Instead, it
+records comments found in `js2-scanned-comments'. If the token
+returned by this function immediately follows a jsdoc comment,
+the token is flagged as such."
+ (if (zerop js2-ti-lookahead)
+ (js2-get-token-internal modifier)
+ (cl-decf js2-ti-lookahead)
+ (setq js2-ti-tokens-cursor (mod (1+ js2-ti-tokens-cursor) js2-ti-ntokens))
+ (let ((tt (js2-current-token-type)))
+ (cl-assert (not (= tt js2-EOL)))
+ tt)))
+
+(defun js2-unget-token ()
+ (cl-assert (< js2-ti-lookahead js2-ti-max-lookahead))
+ (cl-incf js2-ti-lookahead)
+ (setq js2-ti-tokens-cursor (mod (1- js2-ti-tokens-cursor) js2-ti-ntokens)))
+
+(defun js2-get-token-internal (modifier)
+ (let* ((token (js2-get-token-internal-1 modifier)) ; call scanner
+ (tt (js2-token-type token))
+ saw-eol
+ face)
+ ;; process comments
+ (while (or (= tt js2-EOL) (= tt js2-COMMENT))
+ (if (= tt js2-EOL)
+ (setq saw-eol t)
+ (setq saw-eol nil)
+ (when js2-record-comments
+ (js2-record-comment token)))
+ (setq js2-ti-tokens-cursor (mod (1- js2-ti-tokens-cursor) js2-ti-ntokens))
+ (setq token (js2-get-token-internal-1 modifier) ; call scanner again
+ tt (js2-token-type token)))
+
+ (when saw-eol
+ (setf (js2-token-follows-eol-p token) t))
+
+ ;; perform lexical fontification as soon as token is scanned
+ (when js2-parse-ide-mode
+ (cond
+ ((cl-minusp tt)
+ (js2-record-face 'js2-error token))
+ ((setq face (aref js2-kwd-tokens tt))
+ (js2-record-face face token))
+ ((and (= tt js2-NAME)
+ (equal (js2-token-string token) "undefined"))
+ (js2-record-face 'font-lock-constant-face token))))
+ tt))
+
+(defsubst js2-string-to-number (str base)
+ ;; TODO: Maybe port ScriptRuntime.stringToNumber.
+ (condition-case nil
+ (string-to-number str base)
+ (overflow-error -1)))
+
+(defun js2-handle-numeric-separator ()
+ "Detect and handle numeric separator ?_."
+ (let ((buffer (nreverse js2-ts-string-buffer))
+ (res nil))
+ (while (> (length buffer) 0)
+ (let ((current-c (car buffer))
+ (next-c (cadr buffer)))
+ (if (eq current-c ?_)
+ (if (or (= (length buffer) 1) (memq next-c '(?. ?e ?E)))
+ (js2-report-scan-error "msg.no.trailing.numeric.literal")
+ (when (= (cadr buffer) ?_)
+ (js2-report-scan-error "msg.no.consecutive.numeric.literal")))
+ (push (car buffer) res)))
+ (setq buffer (cdr buffer)))
+ (setq js2-ts-string-buffer res)))
+
+(defun js2-get-token-internal-1 (modifier)
+ "Return next JavaScript token type, an int such as js2-RETURN.
+During operation, creates an instance of `js2-token' struct, sets
+its relevant fields and puts it into `js2-ti-tokens'."
+ (let (identifier-start
+ identifier-private
+ is-unicode-escape-start c
+ contains-escape escape-val str result base
+ look-for-slash continue tt legacy-octal
+ (token (js2-new-token 0)))
+ (setq
+ tt
+ (catch 'return
+ (when (eq modifier 'TEMPLATE_TAIL)
+ (setf (js2-token-beg token) (1- js2-ts-cursor))
+ (throw 'return (js2-get-string-or-template-token ?` token)))
+ (while t
+ ;; Eat whitespace, possibly sensitive to newlines.
+ (setq continue t)
+ (while continue
+ (setq c (js2-get-char))
+ (cond
+ ((eq c js2-EOF_CHAR)
+ (js2-unget-char)
+ (js2-ts-set-char-token-bounds token)
+ (throw 'return js2-EOF))
+ ((eq c ?\n)
+ (js2-ts-set-char-token-bounds token)
+ (setq js2-ts-dirty-line nil)
+ (throw 'return js2-EOL))
+ ((not (js2-js-space-p c))
+ (if (/= c ?-) ; in case end of HTML comment
+ (setq js2-ts-dirty-line t))
+ (setq continue nil))))
+ ;; Assume the token will be 1 char - fixed up below.
+ (js2-ts-set-char-token-bounds token)
+ (when (eq c ?@)
+ (throw 'return js2-XMLATTR))
+ ;; identifier/keyword/instanceof?
+ ;; watch out for starting with a <backslash>
+ (cond
+ ((eq c ?\\)
+ (setq c (js2-get-char))
+ (if (eq c ?u)
+ (setq identifier-start t
+ is-unicode-escape-start t
+ js2-ts-string-buffer nil)
+ (setq identifier-start nil)
+ (js2-unget-char)
+ (setq c ?\\)))
+ (t
+ (when (setq identifier-start (or (js2-identifier-start-p c)
+ (and
+ (eq c ?#)
+ (setq identifier-private t))))
+ (setq js2-ts-string-buffer nil)
+ (js2-add-to-string c))))
+ (when identifier-start
+ (setq contains-escape is-unicode-escape-start)
+ (catch 'break
+ (while t
+ (if is-unicode-escape-start
+ ;; strictly speaking we should probably push-back
+ ;; all the bad characters if the <backslash>uXXXX
+ ;; sequence is malformed. But since there isn't a
+ ;; correct context(is there?) for a bad Unicode
+ ;; escape sequence in an identifier, we can report
+ ;; an error here.
+ (progn
+ (setq escape-val 0)
+ (dotimes (_ 4)
+ (setq c (js2-get-char)
+ escape-val (js2-x-digit-to-int c escape-val))
+ ;; Next check takes care of c < 0 and bad escape
+ (if (cl-minusp escape-val)
+ (throw 'break nil)))
+ (if (cl-minusp escape-val)
+ (js2-report-scan-error "msg.invalid.escape" t))
+ (js2-add-to-string escape-val)
+ (setq is-unicode-escape-start nil))
+ (setq c (js2-get-char))
+ (cond
+ ((eq c ?\\)
+ (setq c (js2-get-char))
+ (if (eq c ?u)
+ (setq is-unicode-escape-start t
+ contains-escape t)
+ (js2-report-scan-error "msg.illegal.character" t)))
+ (t
+ (if (or (eq c js2-EOF_CHAR)
+ (not (js2-identifier-part-p c)))
+ (throw 'break nil))
+ (js2-add-to-string c))))))
+ (js2-unget-char)
+ (setf str (js2-collect-string js2-ts-string-buffer)
+ (js2-token-end token) js2-ts-cursor)
+ ;; FIXME: Invalid in ES5 and ES6, see
+ ;; https://bugzilla.mozilla.org/show_bug.cgi?id=694360
+ ;; Probably should just drop this conditional.
+ (unless contains-escape
+ ;; OPT we shouldn't have to make a string (object!) to
+ ;; check if it's a keyword.
+ ;; Return the corresponding token if it's a keyword
+ (when (and (not (eq modifier 'KEYWORD_IS_NAME))
+ (setq result (js2-string-to-keyword str)))
+ (if (and (< js2-language-version 170)
+ (memq result '(js2-LET js2-YIELD)))
+ ;; LET and YIELD are tokens only in 1.7 and later
+ (setq result 'js2-NAME))
+ (when (eq result 'js2-RESERVED)
+ (setf (js2-token-string token) str))
+ (throw 'return (js2-tt-code result))))
+ ;; If we want to intern these as Rhino does, just use (intern str)
+ (setf (js2-token-string token) str)
+ (throw 'return
+ (if identifier-private
+ js2-PRIVATE_NAME
+ js2-NAME)
+ )) ; end identifier/kwd check
+ ;; is it a number?
+ (when (or (js2-digit-p c)
+ (and (eq c ?.) (js2-digit-p (js2-peek-char))))
+ (setq js2-ts-string-buffer nil
+ base 10)
+ (when (eq c ?0)
+ (setq c (js2-get-char))
+ (cond
+ ((eq c ?_) (js2-report-scan-error "msg.no.numeric.separator.after.leading.zero"))
+ ((or (eq c ?x) (eq c ?X))
+ (setq base 16)
+ (setq c (js2-get-char)))
+ ((and (or (eq c ?b) (eq c ?B))
+ (>= js2-language-version 200))
+ (setq base 2)
+ (setq c (js2-get-char)))
+ ((and (or (eq c ?o) (eq c ?O))
+ (>= js2-language-version 200))
+ (setq base 8)
+ (setq legacy-octal nil)
+ (setq c (js2-get-char)))
+ ((js2-digit-p c)
+ (setq base 'maybe-8))
+ (t
+ (js2-add-to-string ?0))))
+ (cond
+ ((eq base 16)
+ (if (> 0 (js2-x-digit-to-int c 0))
+ (js2-report-scan-error "msg.missing.hex.digits")
+ (while (or (<= 0 (js2-x-digit-to-int c 0)) (= c ?_))
+ (js2-add-to-string c)
+ (setq c (js2-get-char)))))
+ ((eq base 2)
+ (if (not (memq c '(?0 ?1)))
+ (js2-report-scan-error "msg.missing.binary.digits")
+ (while (memq c '(?0 ?1 ?_))
+ (js2-add-to-string c)
+ (setq c (js2-get-char)))))
+ ((eq base 8)
+ (if (or (> ?0 c) (< ?7 c))
+ (js2-report-scan-error "msg.missing.octal.digits")
+ (while (or (and (<= ?0 c) (>= ?7 c)) (= c ?_))
+ (js2-add-to-string c)
+ (setq c (js2-get-char)))))
+ (t
+ (while (or (and (<= ?0 c) (<= c ?9)) (= c ?_))
+ ;; We permit 08 and 09 as decimal numbers, which
+ ;; makes our behavior a superset of the ECMA
+ ;; numeric grammar. We might not always be so
+ ;; permissive, so we warn about it.
+ (when (and (eq base 'maybe-8) (>= c ?8))
+ (js2-report-warning "msg.bad.octal.literal"
+ (if (eq c ?8) "8" "9"))
+ (setq base 10))
+ (js2-add-to-string c)
+ (setq c (js2-get-char)))
+ (when (eq base 'maybe-8)
+ (setq base 8
+ legacy-octal t))))
+ (when (and (eq base 10) (memq c '(?. ?e ?E)))
+ (when (eq c ?.)
+ (cl-loop do
+ (js2-add-to-string c)
+ (setq c (js2-get-char))
+ while (or (js2-digit-p c) (= c ?_))))
+ (when (memq c '(?e ?E))
+ (js2-add-to-string c)
+ (setq c (js2-get-char))
+ (when (memq c '(?+ ?-))
+ (js2-add-to-string c)
+ (setq c (js2-get-char)))
+ (unless (js2-digit-p c)
+ (js2-report-scan-error "msg.missing.exponent" t))
+ (cl-loop do
+ (js2-add-to-string c)
+ (setq c (js2-get-char))
+ while (or (js2-digit-p c) (= c ?_)))))
+ (js2-unget-char)
+ (js2-handle-numeric-separator)
+ (let ((string js2-ts-string-buffer))
+ (while (> (length string) 0)
+ (when (and (eq (car string) ?_))
+ (if (= (length string) 1)
+ (js2-report-scan-error "msg.no.trailing.numeric.literal")))
+ (setq string (cdr string))))
+ (let ((str (js2-set-string-from-buffer token)))
+ (setf (js2-token-number token) (js2-string-to-number str base)
+ (js2-token-number-base token) base
+ (js2-token-number-legacy-octal-p token) (and (= base 8) legacy-octal)))
+ (throw 'return js2-NUMBER))
+ ;; is it a string?
+ (when (or (memq c '(?\" ?\'))
+ (and (>= js2-language-version 200)
+ (= c ?`)))
+ (throw 'return
+ (js2-get-string-or-template-token c token)))
+ (js2-ts-return token
+ (cl-case c
+ (?\;
+ (throw 'return js2-SEMI))
+ (?\[
+ (throw 'return js2-LB))
+ (?\]
+ (throw 'return js2-RB))
+ (?{
+ (throw 'return js2-LC))
+ (?}
+ (throw 'return js2-RC))
+ (?\(
+ (throw 'return js2-LP))
+ (?\)
+ (throw 'return js2-RP))
+ (?,
+ (throw 'return js2-COMMA))
+ (??
+ (if (js2-match-char ??)
+ (if (js2-match-char ?=)
+ js2-ASSIGN_NULLISH
+ (throw 'return js2-NULLISH-COALESCING))
+ (if (js2-match-char ?.)
+ (throw 'return js2-OPTIONAL-CHAINING)
+ (throw 'return js2-HOOK))))
+ (?:
+ (if (js2-match-char ?:)
+ js2-COLONCOLON
+ (throw 'return js2-COLON)))
+ (?.
+ (if (js2-match-char ?.)
+ (if (js2-match-char ?.)
+ js2-TRIPLEDOT js2-DOTDOT)
+ (if (js2-match-char ?\()
+ js2-DOTQUERY
+ (throw 'return js2-DOT))))
+ (?|
+ (if (js2-match-char ?|)
+ (if (js2-match-char ?=)
+ js2-ASSIGN_OR
+ (throw 'return js2-OR))
+ (if (js2-match-char ?=)
+ js2-ASSIGN_BITOR
+ (throw 'return js2-BITOR))))
+ (?^
+ (if (js2-match-char ?=)
+ js2-ASSIGN_BITOR
+ (throw 'return js2-BITXOR)))
+ (?&
+ (if (js2-match-char ?&)
+ (if (js2-match-char ?=)
+ js2-ASSIGN_AND
+ (throw 'return js2-AND))
+ (if (js2-match-char ?=)
+ js2-ASSIGN_BITAND
+ (throw 'return js2-BITAND))))
+ (?=
+ (if (js2-match-char ?=)
+ (if (js2-match-char ?=)
+ js2-SHEQ
+ (throw 'return js2-EQ))
+ (if (js2-match-char ?>)
+ (js2-ts-return token js2-ARROW)
+ (throw 'return js2-ASSIGN))))
+ (?!
+ (if (js2-match-char ?=)
+ (if (js2-match-char ?=)
+ js2-SHNE
+ js2-NE)
+ (throw 'return js2-NOT)))
+ (?<
+ ;; NB:treat HTML begin-comment as comment-till-eol
+ (when (js2-match-char ?!)
+ (when (js2-match-char ?-)
+ (when (js2-match-char ?-)
+ (js2-skip-line)
+ (setf (js2-token-comment-type (js2-current-token)) 'html)
+ (throw 'return js2-COMMENT)))
+ (js2-unget-char))
+ (if (js2-match-char ?<)
+ (if (js2-match-char ?=)
+ js2-ASSIGN_LSH
+ js2-LSH)
+ (if (js2-match-char ?=)
+ js2-LE
+ (throw 'return js2-LT))))
+ (?>
+ (if (js2-match-char ?>)
+ (if (js2-match-char ?>)
+ (if (js2-match-char ?=)
+ js2-ASSIGN_URSH
+ js2-URSH)
+ (if (js2-match-char ?=)
+ js2-ASSIGN_RSH
+ js2-RSH))
+ (if (js2-match-char ?=)
+ js2-GE
+ (throw 'return js2-GT))))
+ (?*
+ (if (js2-match-char ?=)
+ js2-ASSIGN_MUL
+ (if (js2-match-char ?*)
+ (if (js2-match-char ?=)
+ js2-ASSIGN_EXPON
+ js2-EXPON)
+ (throw 'return js2-MUL))))
+ (?/
+ ;; is it a // comment?
+ (when (js2-match-char ?/)
+ (setf (js2-token-beg token) (- js2-ts-cursor 2))
+ (js2-skip-line)
+ (setf (js2-token-comment-type token) 'line)
+ ;; include newline so highlighting goes to end of
+ ;; window, if there actually is a newline; if we
+ ;; hit eof, then implicitly there isn't
+ (unless js2-ts-hit-eof
+ (cl-incf (js2-token-end token)))
+ (throw 'return js2-COMMENT))
+ ;; is it a /* comment?
+ (when (js2-match-char ?*)
+ (setf look-for-slash nil
+ (js2-token-beg token) (- js2-ts-cursor 2)
+ (js2-token-comment-type token)
+ (if (js2-match-char ?*)
+ (progn
+ (setq look-for-slash t)
+ 'jsdoc)
+ 'block))
+ (while t
+ (setq c (js2-get-char))
+ (cond
+ ((eq c js2-EOF_CHAR)
+ (setf (js2-token-end token) (1- js2-ts-cursor))
+ (js2-report-error "msg.unterminated.comment")
+ (throw 'return js2-COMMENT))
+ ((eq c ?*)
+ (setq look-for-slash t))
+ ((eq c ?/)
+ (if look-for-slash
+ (js2-ts-return token js2-COMMENT)))
+ (t
+ (setf look-for-slash nil
+ (js2-token-end token) js2-ts-cursor)))))
+ (if (js2-match-char ?=)
+ js2-ASSIGN_DIV
+ (throw 'return js2-DIV)))
+ (?#
+ (when js2-skip-preprocessor-directives
+ (js2-skip-line)
+ (setf (js2-token-comment-type token) 'preprocessor
+ (js2-token-end token) js2-ts-cursor)
+ (throw 'return js2-COMMENT))
+ (throw 'return js2-ERROR))
+ (?%
+ (if (js2-match-char ?=)
+ js2-ASSIGN_MOD
+ (throw 'return js2-MOD)))
+ (?~
+ (throw 'return js2-BITNOT))
+ (?+
+ (if (js2-match-char ?=)
+ js2-ASSIGN_ADD
+ (if (js2-match-char ?+)
+ js2-INC
+ (throw 'return js2-ADD))))
+ (?-
+ (cond
+ ((js2-match-char ?=)
+ (setq c js2-ASSIGN_SUB))
+ ((js2-match-char ?-)
+ (unless js2-ts-dirty-line
+ ;; treat HTML end-comment after possible whitespace
+ ;; after line start as comment-until-eol
+ (when (js2-match-char ?>)
+ (js2-skip-line)
+ (setf (js2-token-comment-type (js2-current-token)) 'html)
+ (throw 'return js2-COMMENT)))
+ (setq c js2-DEC))
+ (t
+ (setq c js2-SUB)))
+ (setq js2-ts-dirty-line t)
+ c)
+ (otherwise
+ (js2-report-scan-error "msg.illegal.character")))))))
+ (setf (js2-token-type token) tt)
+ token))
+
+(defun js2-get-string-or-template-token (quote-char token)
+ ;; We attempt to accumulate a string the fast way, by
+ ;; building it directly out of the reader. But if there
+ ;; are any escaped characters in the string, we revert to
+ ;; building it out of a string buffer.
+ (let ((c (js2-get-char))
+ js2-ts-string-buffer
+ nc c1 val escape-val)
+ (catch 'break
+ (while (/= c quote-char)
+ (catch 'continue
+ (when (eq c js2-EOF_CHAR)
+ (js2-unget-char)
+ (js2-report-error "msg.unterminated.string.lit")
+ (throw 'break nil))
+ (when (and (eq c ?\n) (not (eq quote-char ?`)))
+ (js2-unget-char)
+ (js2-report-error "msg.unterminated.string.lit")
+ (throw 'break nil))
+ (when (eq c ?\\)
+ ;; We've hit an escaped character
+ (setq c (js2-get-char))
+ (cl-case c
+ (?b (setq c ?\b))
+ (?f (setq c ?\f))
+ (?n (setq c ?\n))
+ (?r (setq c ?\r))
+ (?t (setq c ?\t))
+ (?v (setq c ?\v))
+ (?u
+ (setq c1 (js2-read-unicode-escape))
+ (if js2-parse-ide-mode
+ (if c1
+ (progn
+ ;; just copy the string in IDE-mode
+ (js2-add-to-string ?\\)
+ (js2-add-to-string ?u)
+ (dotimes (_ 3)
+ (js2-add-to-string (js2-get-char)))
+ (setq c (js2-get-char))) ; added at end of loop
+ ;; flag it as an invalid escape
+ (js2-report-warning "msg.invalid.escape"
+ nil (- js2-ts-cursor 2) 6))
+ ;; Get 4 hex digits; if the u escape is not
+ ;; followed by 4 hex digits, use 'u' + the
+ ;; literal character sequence that follows.
+ (js2-add-to-string ?u)
+ (setq escape-val 0)
+ (dotimes (_ 4)
+ (setq c (js2-get-char)
+ escape-val (js2-x-digit-to-int c escape-val))
+ (if (cl-minusp escape-val)
+ (throw 'continue nil))
+ (js2-add-to-string c))
+ ;; prepare for replace of stored 'u' sequence by escape value
+ (setq js2-ts-string-buffer (nthcdr 5 js2-ts-string-buffer)
+ c escape-val)))
+ (?x
+ ;; Get 2 hex digits, defaulting to 'x'+literal
+ ;; sequence, as above.
+ (setq c (js2-get-char)
+ escape-val (js2-x-digit-to-int c 0))
+ (if (cl-minusp escape-val)
+ (progn
+ (js2-add-to-string ?x)
+ (throw 'continue nil))
+ (setq c1 c
+ c (js2-get-char)
+ escape-val (js2-x-digit-to-int c escape-val))
+ (if (cl-minusp escape-val)
+ (progn
+ (js2-add-to-string ?x)
+ (js2-add-to-string c1)
+ (throw 'continue nil))
+ ;; got 2 hex digits
+ (setq c escape-val))))
+ (?\n
+ ;; Remove line terminator after escape to follow
+ ;; SpiderMonkey and C/C++
+ (setq c (js2-get-char))
+ (throw 'continue nil))
+ (t
+ (when (and (<= ?0 c) (< c ?8))
+ (setq val (- c ?0)
+ c (js2-get-char))
+ (when (and (<= ?0 c) (< c ?8))
+ (setq val (- (+ (* 8 val) c) ?0)
+ c (js2-get-char))
+ (when (and (<= ?0 c)
+ (< c ?8)
+ (< val #o37))
+ ;; c is 3rd char of octal sequence only
+ ;; if the resulting val <= 0377
+ (setq val (- (+ (* 8 val) c) ?0)
+ c (js2-get-char))))
+ (js2-unget-char)
+ (setq c val)))))
+ (when (and (eq quote-char ?`) (eq c ?$))
+ (when (eq (setq nc (js2-get-char)) ?\{)
+ (throw 'break nil))
+ (js2-unget-char))
+ (js2-add-to-string c)
+ (setq c (js2-get-char)))))
+ (js2-set-string-from-buffer token)
+ (if (not (eq quote-char ?`))
+ js2-STRING
+ (if (and (eq c ?$) (eq nc ?\{))
+ js2-TEMPLATE_HEAD
+ js2-NO_SUBS_TEMPLATE))))
+
+(defun js2-read-regexp (start-tt start-pos)
+ "Called by parser when it gets / or /= in literal context."
+ (let (c err
+ in-class ; inside a '[' .. ']' character-class
+ flags
+ (continue t)
+ (token (js2-new-token 0)))
+ (when js2-mode-change-syntax-p
+ (js2-record-text-property start-pos (1+ start-pos)
+ 'syntax-table (string-to-syntax "\"/")))
+ (setq js2-ts-string-buffer nil)
+ (if (eq start-tt js2-ASSIGN_DIV)
+ ;; mis-scanned /=
+ (js2-add-to-string ?=)
+ (if (not (eq start-tt js2-DIV))
+ (error "failed assertion")))
+ (while (and (not err)
+ (or (/= (setq c (js2-get-char)) ?/)
+ in-class))
+ (cond
+ ((or (= c ?\n)
+ (= c js2-EOF_CHAR))
+ (setf (js2-token-end token) (1- js2-ts-cursor)
+ err t
+ (js2-token-string token) (js2-collect-string js2-ts-string-buffer))
+ (js2-report-error "msg.unterminated.re.lit"))
+ (t (cond
+ ((= c ?\\)
+ (js2-add-to-string c)
+ (setq c (js2-get-char)))
+ ((= c ?\[)
+ (setq in-class t))
+ ((= c ?\])
+ (setq in-class nil)))
+ (js2-add-to-string c))))
+ (unless err
+ (when js2-mode-change-syntax-p
+ (js2-record-text-property (1- js2-ts-cursor) js2-ts-cursor
+ 'syntax-table (string-to-syntax "\"/")))
+ (while continue
+ (cond
+ ((js2-match-char ?g)
+ (push ?g flags))
+ ((js2-match-char ?i)
+ (push ?i flags))
+ ((js2-match-char ?m)
+ (push ?m flags))
+ ((and (js2-match-char ?u)
+ (>= js2-language-version 200))
+ (push ?u flags))
+ ((and (js2-match-char ?y)
+ (>= js2-language-version 200))
+ (push ?y flags))
+ (t
+ (setq continue nil))))
+ (if (js2-alpha-p (js2-peek-char))
+ (js2-report-scan-error "msg.invalid.re.flag" t
+ js2-ts-cursor 1))
+ (js2-set-string-from-buffer token))
+ (js2-collect-string flags)))
+
+(defun js2-get-first-xml-token ()
+ (setq js2-ts-xml-open-tags-count 0
+ js2-ts-is-xml-attribute nil
+ js2-ts-xml-is-tag-content nil)
+ (js2-unget-char)
+ (js2-get-next-xml-token))
+
+(defun js2-xml-discard-string (token)
+ "Throw away the string in progress and flag an XML parse error."
+ (setf js2-ts-string-buffer nil
+ (js2-token-string token) nil)
+ (js2-report-scan-error "msg.XML.bad.form" t))
+
+(defun js2-get-next-xml-token ()
+ (setq js2-ts-string-buffer nil) ; for recording the XML
+ (let ((token (js2-new-token 0))
+ c result)
+ (setq result
+ (catch 'return
+ (while t
+ (setq c (js2-get-char))
+ (cond
+ ((= c js2-EOF_CHAR)
+ (throw 'return js2-ERROR))
+ (js2-ts-xml-is-tag-content
+ (cl-case c
+ (?>
+ (js2-add-to-string c)
+ (setq js2-ts-xml-is-tag-content nil
+ js2-ts-is-xml-attribute nil))
+ (?/
+ (js2-add-to-string c)
+ (when (eq ?> (js2-peek-char))
+ (setq c (js2-get-char))
+ (js2-add-to-string c)
+ (setq js2-ts-xml-is-tag-content nil)
+ (cl-decf js2-ts-xml-open-tags-count)))
+ (?{
+ (js2-unget-char)
+ (js2-set-string-from-buffer token)
+ (throw 'return js2-XML))
+ ((?\' ?\")
+ (js2-add-to-string c)
+ (unless (js2-read-quoted-string c token)
+ (throw 'return js2-ERROR)))
+ (?=
+ (js2-add-to-string c)
+ (setq js2-ts-is-xml-attribute t))
+ ((? ?\t ?\r ?\n)
+ (js2-add-to-string c))
+ (t
+ (js2-add-to-string c)
+ (setq js2-ts-is-xml-attribute nil)))
+ (when (and (not js2-ts-xml-is-tag-content)
+ (zerop js2-ts-xml-open-tags-count))
+ (js2-set-string-from-buffer token)
+ (throw 'return js2-XMLEND)))
+ (t
+ ;; else not tag content
+ (cl-case c
+ (?<
+ (js2-add-to-string c)
+ (setq c (js2-peek-char))
+ (cl-case c
+ (?!
+ (setq c (js2-get-char)) ;; skip !
+ (js2-add-to-string c)
+ (setq c (js2-peek-char))
+ (cl-case c
+ (?-
+ (setq c (js2-get-char)) ;; skip -
+ (js2-add-to-string c)
+ (if (eq c ?-)
+ (progn
+ (js2-add-to-string c)
+ (unless (js2-read-xml-comment token)
+ (throw 'return js2-ERROR)))
+ (js2-xml-discard-string token)
+ (throw 'return js2-ERROR)))
+ (?\[
+ (setq c (js2-get-char)) ;; skip [
+ (js2-add-to-string c)
+ (if (and (= (js2-get-char) ?C)
+ (= (js2-get-char) ?D)
+ (= (js2-get-char) ?A)
+ (= (js2-get-char) ?T)
+ (= (js2-get-char) ?A)
+ (= (js2-get-char) ?\[))
+ (progn
+ (js2-add-to-string ?C)
+ (js2-add-to-string ?D)
+ (js2-add-to-string ?A)
+ (js2-add-to-string ?T)
+ (js2-add-to-string ?A)
+ (js2-add-to-string ?\[)
+ (unless (js2-read-cdata token)
+ (throw 'return js2-ERROR)))
+ (js2-xml-discard-string token)
+ (throw 'return js2-ERROR)))
+ (t
+ (unless (js2-read-entity token)
+ (throw 'return js2-ERROR))))
+ ;; Allow bare CDATA section, e.g.:
+ ;; let xml = <![CDATA[ foo bar baz ]]>;
+ (when (zerop js2-ts-xml-open-tags-count)
+ (throw 'return js2-XMLEND)))
+ (??
+ (setq c (js2-get-char)) ;; skip ?
+ (js2-add-to-string c)
+ (unless (js2-read-PI token)
+ (throw 'return js2-ERROR)))
+ (?/
+ ;; end tag
+ (setq c (js2-get-char)) ;; skip /
+ (js2-add-to-string c)
+ (when (zerop js2-ts-xml-open-tags-count)
+ (js2-xml-discard-string token)
+ (throw 'return js2-ERROR))
+ (setq js2-ts-xml-is-tag-content t)
+ (cl-decf js2-ts-xml-open-tags-count))
+ (t
+ ;; start tag
+ (setq js2-ts-xml-is-tag-content t)
+ (cl-incf js2-ts-xml-open-tags-count))))
+ (?{
+ (js2-unget-char)
+ (js2-set-string-from-buffer token)
+ (throw 'return js2-XML))
+ (t
+ (js2-add-to-string c))))))))
+ (setf (js2-token-end token) js2-ts-cursor)
+ (setf (js2-token-type token) result)
+ result))
+
+(defun js2-read-quoted-string (quote token)
+ (let (c)
+ (catch 'return
+ (while (/= (setq c (js2-get-char)) js2-EOF_CHAR)
+ (js2-add-to-string c)
+ (if (eq c quote)
+ (throw 'return t)))
+ (js2-xml-discard-string token) ;; throw away string in progress
+ nil)))
+
+(defun js2-read-xml-comment (token)
+ (let ((c (js2-get-char)))
+ (catch 'return
+ (while (/= c js2-EOF_CHAR)
+ (catch 'continue
+ (js2-add-to-string c)
+ (when (and (eq c ?-) (eq ?- (js2-peek-char)))
+ (setq c (js2-get-char))
+ (js2-add-to-string c)
+ (if (eq (js2-peek-char) ?>)
+ (progn
+ (setq c (js2-get-char)) ;; skip >
+ (js2-add-to-string c)
+ (throw 'return t))
+ (throw 'continue nil)))
+ (setq c (js2-get-char))))
+ (js2-xml-discard-string token)
+ nil)))
+
+(defun js2-read-cdata (token)
+ (let ((c (js2-get-char)))
+ (catch 'return
+ (while (/= c js2-EOF_CHAR)
+ (catch 'continue
+ (js2-add-to-string c)
+ (when (and (eq c ?\]) (eq (js2-peek-char) ?\]))
+ (setq c (js2-get-char))
+ (js2-add-to-string c)
+ (if (eq (js2-peek-char) ?>)
+ (progn
+ (setq c (js2-get-char)) ;; Skip >
+ (js2-add-to-string c)
+ (throw 'return t))
+ (throw 'continue nil)))
+ (setq c (js2-get-char))))
+ (js2-xml-discard-string token)
+ nil)))
+
+(defun js2-read-entity (token)
+ (let ((decl-tags 1)
+ c)
+ (catch 'return
+ (while (/= js2-EOF_CHAR (setq c (js2-get-char)))
+ (js2-add-to-string c)
+ (cl-case c
+ (?<
+ (cl-incf decl-tags))
+ (?>
+ (cl-decf decl-tags)
+ (if (zerop decl-tags)
+ (throw 'return t)))))
+ (js2-xml-discard-string token)
+ nil)))
+
+(defun js2-read-PI (token)
+ "Scan an XML processing instruction."
+ (let (c)
+ (catch 'return
+ (while (/= js2-EOF_CHAR (setq c (js2-get-char)))
+ (js2-add-to-string c)
+ (when (and (eq c ??) (eq (js2-peek-char) ?>))
+ (setq c (js2-get-char)) ;; Skip >
+ (js2-add-to-string c)
+ (throw 'return t)))
+ (js2-xml-discard-string token)
+ nil)))
+
+;;; Highlighting
+
+(defun js2-set-face (beg end face &optional record)
+ "Fontify a region. If RECORD is non-nil, record for later."
+ (when (cl-plusp js2-highlight-level)
+ (setq beg (min (point-max) beg)
+ beg (max (point-min) beg)
+ end (min (point-max) end)
+ end (max (point-min) end))
+ (if record
+ (push (list beg end face) js2-mode-fontifications)
+ (put-text-property beg end 'font-lock-face face))))
+
+(defsubst js2-clear-face (beg end)
+ (remove-text-properties beg end '(font-lock-face nil
+ help-echo nil
+ point-entered nil
+ cursor-sensor-functions nil
+ c-in-sws nil)))
+
+(defconst js2-ecma-global-props
+ (concat "^"
+ (regexp-opt
+ '("Infinity" "NaN" "undefined" "arguments") t)
+ "$")
+ "Value properties of the Ecma-262 Global Object.
+Shown at or above `js2-highlight-level' 2.")
+
+;; might want to add the name "arguments" to this list?
+(defconst js2-ecma-object-props
+ (concat "^"
+ (regexp-opt
+ '("prototype" "__proto__" "__parent__") t)
+ "$")
+ "Value properties of the Ecma-262 Object constructor.
+Shown at or above `js2-highlight-level' 2.")
+
+(defconst js2-ecma-global-funcs
+ (concat
+ "^"
+ (regexp-opt
+ '("decodeURI" "decodeURIComponent" "encodeURI" "encodeURIComponent"
+ "eval" "isFinite" "isNaN" "parseFloat" "parseInt") t)
+ "$")
+ "Function properties of the Ecma-262 Global object.
+Shown at or above `js2-highlight-level' 2.")
+
+(defconst js2-ecma-number-props
+ (concat "^"
+ (regexp-opt '("MAX_VALUE" "MIN_VALUE" "NaN"
+ "NEGATIVE_INFINITY"
+ "POSITIVE_INFINITY") t)
+ "$")
+ "Properties of the Ecma-262 Number constructor.
+Shown at or above `js2-highlight-level' 2.")
+
+(defconst js2-ecma-date-props "^\\(parse\\|UTC\\)$"
+ "Properties of the Ecma-262 Date constructor.
+Shown at or above `js2-highlight-level' 2.")
+
+(defconst js2-ecma-math-props
+ (concat "^"
+ (regexp-opt
+ '("E" "LN10" "LN2" "LOG2E" "LOG10E" "PI" "SQRT1_2" "SQRT2")
+ t)
+ "$")
+ "Properties of the Ecma-262 Math object.
+Shown at or above `js2-highlight-level' 2.")
+
+(defconst js2-ecma-math-funcs
+ (concat "^"
+ (regexp-opt
+ '("abs" "acos" "asin" "atan" "atan2" "ceil" "cos" "exp" "floor"
+ "log" "max" "min" "pow" "random" "round" "sin" "sqrt" "tan") t)
+ "$")
+ "Function properties of the Ecma-262 Math object.
+Shown at or above `js2-highlight-level' 2.")
+
+(defconst js2-ecma-function-props
+ (concat
+ "^"
+ (regexp-opt
+ '(;; properties of the Object prototype object
+ "hasOwnProperty" "isPrototypeOf" "propertyIsEnumerable"
+ "toLocaleString" "toString" "valueOf"
+ ;; properties of the Function prototype object
+ "apply" "call"
+ ;; properties of the Array prototype object
+ "concat" "join" "pop" "push" "reverse" "shift" "slice" "sort"
+ "splice" "unshift"
+ ;; properties of the String prototype object
+ "charAt" "charCodeAt" "fromCharCode" "indexOf" "lastIndexOf"
+ "localeCompare" "match" "replace" "search" "split" "substring"
+ "toLocaleLowerCase" "toLocaleUpperCase" "toLowerCase"
+ "toUpperCase"
+ ;; properties of the Number prototype object
+ "toExponential" "toFixed" "toPrecision"
+ ;; properties of the Date prototype object
+ "getDate" "getDay" "getFullYear" "getHours" "getMilliseconds"
+ "getMinutes" "getMonth" "getSeconds" "getTime"
+ "getTimezoneOffset" "getUTCDate" "getUTCDay" "getUTCFullYear"
+ "getUTCHours" "getUTCMilliseconds" "getUTCMinutes" "getUTCMonth"
+ "getUTCSeconds" "setDate" "setFullYear" "setHours"
+ "setMilliseconds" "setMinutes" "setMonth" "setSeconds" "setTime"
+ "setUTCDate" "setUTCFullYear" "setUTCHours" "setUTCMilliseconds"
+ "setUTCMinutes" "setUTCMonth" "setUTCSeconds" "toDateString"
+ "toLocaleDateString" "toLocaleString" "toLocaleTimeString"
+ "toTimeString" "toUTCString"
+ ;; properties of the RegExp prototype object
+ "exec" "test"
+ ;; properties of the JSON prototype object
+ "parse" "stringify"
+ ;; SpiderMonkey/Rhino extensions, versions 1.5+
+ "toSource" "__defineGetter__" "__defineSetter__"
+ "__lookupGetter__" "__lookupSetter__" "__noSuchMethod__"
+ "every" "filter" "forEach" "lastIndexOf" "map" "some")
+ t)
+ "$")
+ "Built-in functions defined by Ecma-262 and SpiderMonkey extensions.
+Shown at or above `js2-highlight-level' 3.")
+
+(defun js2-parse-highlight-prop-get (parent target prop call-p)
+ (let ((target-name (and target
+ (js2-name-node-p target)
+ (js2-name-node-name target)))
+ (prop-name (if prop (js2-name-node-name prop)))
+ (level2 (>= js2-highlight-level 2))
+ (level3 (>= js2-highlight-level 3)))
+ (when level2
+ (let ((face
+ (if call-p
+ (cond
+ ((and target prop)
+ (cond
+ ((and level3 (string-match js2-ecma-function-props prop-name))
+ 'font-lock-builtin-face)
+ ((and target-name prop)
+ (cond
+ ((string= target-name "Date")
+ (if (string-match js2-ecma-date-props prop-name)
+ 'font-lock-builtin-face))
+ ((string= target-name "Math")
+ (if (string-match js2-ecma-math-funcs prop-name)
+ 'font-lock-builtin-face))))))
+ (prop
+ (if (string-match js2-ecma-global-funcs prop-name)
+ 'font-lock-builtin-face)))
+ (cond
+ ((and target prop)
+ (cond
+ ((string= target-name "Number")
+ (if (string-match js2-ecma-number-props prop-name)
+ 'font-lock-constant-face))
+ ((string= target-name "Math")
+ (if (string-match js2-ecma-math-props prop-name)
+ 'font-lock-constant-face))))
+ (prop
+ (if (string-match js2-ecma-object-props prop-name)
+ 'font-lock-constant-face))))))
+ (when (and (not face) target (not call-p) prop-name)
+ (setq face 'js2-object-property-access))
+ (when face
+ (let ((pos (+ (js2-node-pos parent) ; absolute
+ (js2-node-pos prop)))) ; relative
+ (js2-set-face pos
+ (+ pos (js2-node-len prop))
+ face 'record)))))))
+
+(defun js2-parse-highlight-member-expr-node (node)
+ "Perform syntax highlighting of EcmaScript built-in properties.
+The variable `js2-highlight-level' governs this highlighting."
+ (let (face target prop name pos end parent call-p callee)
+ (cond
+ ;; case 1: simple name, e.g. foo
+ ((js2-name-node-p node)
+ (setq name (js2-name-node-name node))
+ ;; possible for name to be nil in rare cases - saw it when
+ ;; running js2-mode on an elisp buffer. Might as well try to
+ ;; make it so js2-mode never barfs.
+ (when name
+ (setq face (if (string-match js2-ecma-global-props name)
+ 'font-lock-constant-face))
+ (when face
+ (setq pos (js2-node-pos node)
+ end (+ pos (js2-node-len node)))
+ (js2-set-face pos end face 'record))))
+ ;; case 2: property access or function call
+ ((or (js2-prop-get-node-p node)
+ ;; highlight function call if expr is a prop-get node
+ ;; or a plain name (i.e. unqualified function call)
+ (and (setq call-p (js2-call-node-p node))
+ (setq callee (js2-call-node-target node)) ; separate setq!
+ (or (js2-prop-get-node-p callee)
+ (js2-name-node-p callee))))
+ (setq parent node
+ node (if call-p callee node))
+ (if (and call-p (js2-name-node-p callee))
+ (setq prop callee)
+ (setq target (js2-prop-get-node-left node)
+ prop (js2-prop-get-node-right node)))
+ (cond
+ ((js2-name-node-p prop)
+ ;; case 2(a&c): simple or complex target, simple name, e.g. x[y].bar
+ (js2-parse-highlight-prop-get parent target prop call-p))
+ ((js2-name-node-p target)
+ ;; case 2b: simple target, complex name, e.g. foo.x[y]
+ (js2-parse-highlight-prop-get parent target nil call-p)))))))
+
+(defun js2-parse-highlight-member-expr-fn-name (expr)
+ "Highlight the `baz' in function foo.bar.baz(args) {...}.
+This is experimental Rhino syntax. EXPR is the foo.bar.baz member expr.
+We currently only handle the case where the last component is a prop-get
+of a simple name. Called before EXPR has a parent node."
+ (let (pos
+ (name (and (js2-prop-get-node-p expr)
+ (js2-prop-get-node-right expr))))
+ (when (js2-name-node-p name)
+ (js2-set-face (setq pos (+ (js2-node-pos expr) ; parent is absolute
+ (js2-node-pos name)))
+ (+ pos (js2-node-len name))
+ 'font-lock-function-name-face
+ 'record))))
+
+;; source: http://jsdoc.sourceforge.net/
+;; Note - this syntax is for Google's enhanced jsdoc parser that
+;; allows type specifications, and needs work before entering the wild.
+
+(defconst js2-jsdoc-param-tag-regexp
+ (concat "^\\s-*\\*+\\s-*\\(@"
+ (regexp-opt '("param" "arg" "argument" "prop" "property" "typedef"))
+ "\\)"
+ "\\s-*\\({[^}]+}\\)?" ; optional type
+ "\\s-*\\[?\\([[:alnum:]_$\.]+\\)?\\]?" ; name
+ "\\_>")
+ "Matches jsdoc tags with optional type and optional param name.")
+
+(defconst js2-jsdoc-typed-tag-regexp
+ (concat "^\\s-*\\*+\\s-*\\(@\\(?:"
+ (regexp-opt
+ '("enum"
+ "extends"
+ "field"
+ "id"
+ "implements"
+ "lends"
+ "mods"
+ "requires"
+ "return"
+ "returns"
+ "yield"
+ "yields"
+ "type"
+ "throw"
+ "throws"))
+ "\\)\\)\\s-*\\({[^}]+}\\)?")
+ "Matches jsdoc tags with optional type.")
+
+(defconst js2-jsdoc-arg-tag-regexp
+ (concat "^\\s-*\\*+\\s-*\\(@\\(?:"
+ (regexp-opt
+ '("alias"
+ "augments"
+ "borrows"
+ "callback"
+ "bug"
+ "base"
+ "config"
+ "default"
+ "define"
+ "exception"
+ "func"
+ "function"
+ "member"
+ "memberOf"
+ "method"
+ "module"
+ "name"
+ "namespace"
+ "since"
+ "suppress"
+ "this"
+ "throws"
+ "version"))
+ "\\)\\)\\s-+\\([^ \t\n]+\\)")
+ "Matches jsdoc tags with a single argument.")
+
+(defconst js2-jsdoc-empty-tag-regexp
+ (concat "^\\s-*\\*+\\s-*\\(@\\(?:"
+ (regexp-opt
+ '("abstract"
+ "addon"
+ "author"
+ "class"
+ "const"
+ "constant"
+ "constructor"
+ "constructs"
+ "deprecated"
+ "desc"
+ "description"
+ "event"
+ "example"
+ "exec"
+ "export"
+ "fileoverview"
+ "final"
+ "func"
+ "function"
+ "hidden"
+ "ignore"
+ "implicitCast"
+ "inheritDoc"
+ "inner"
+ "interface"
+ "license"
+ "method"
+ "noalias"
+ "noshadow"
+ "notypecheck"
+ "override"
+ "owner"
+ "preserve"
+ "preserveTry"
+ "private"
+ "protected"
+ "public"
+ "static"
+ "supported"
+ "virtual"
+ ))
+ "\\)\\)\\s-*")
+ "Matches empty jsdoc tags.")
+
+(defconst js2-jsdoc-link-tag-regexp
+ "{\\(@\\(?:link\\|code\\)\\)\\s-+\\([^#}\n]+\\)\\(#.+\\)?}"
+ "Matches a jsdoc link or code tag.")
+
+(defconst js2-jsdoc-see-tag-regexp
+ "^\\s-*\\*+\\s-*\\(@see\\)\\s-+\\([^#}\n]+\\)\\(#.+\\)?"
+ "Matches a jsdoc @see tag.")
+
+(defconst js2-jsdoc-html-tag-regexp
+ "\\(</?\\)\\([[:alpha:]]+\\)\\s-*\\(/?>\\)"
+ "Matches a simple (no attributes) html start- or end-tag.")
+
+(defun js2-jsdoc-highlight-helper ()
+ (js2-set-face (match-beginning 1)
+ (match-end 1)
+ 'js2-jsdoc-tag)
+ (if (match-beginning 2)
+ (if (save-excursion
+ (goto-char (match-beginning 2))
+ (= (char-after) ?{))
+ (js2-set-face (1+ (match-beginning 2))
+ (1- (match-end 2))
+ 'js2-jsdoc-type)
+ (js2-set-face (match-beginning 2)
+ (match-end 2)
+ 'js2-jsdoc-value)))
+ (if (match-beginning 3)
+ (js2-set-face (match-beginning 3)
+ (match-end 3)
+ 'js2-jsdoc-value)))
+
+(defun js2-highlight-jsdoc (ast)
+ "Highlight doc comment tags."
+ (let ((comments (js2-ast-root-comments ast))
+ beg end)
+ (save-excursion
+ (dolist (node comments)
+ (when (eq (js2-comment-node-format node) 'jsdoc)
+ ;; Slice off the leading /* and trailing */ in case there
+ ;; are tags on the first line
+ (setq beg (+ 2 (js2-node-abs-pos node))
+ end (+ beg -4 (js2-node-len node)))
+ (save-restriction
+ (narrow-to-region beg end)
+ (dolist (re (list js2-jsdoc-param-tag-regexp
+ js2-jsdoc-typed-tag-regexp
+ js2-jsdoc-arg-tag-regexp
+ js2-jsdoc-link-tag-regexp
+ js2-jsdoc-see-tag-regexp
+ js2-jsdoc-empty-tag-regexp))
+ (goto-char beg)
+ (while (re-search-forward re nil t)
+ (js2-jsdoc-highlight-helper)))
+ ;; simple highlighting for html tags
+ (goto-char beg)
+ (while (re-search-forward js2-jsdoc-html-tag-regexp nil t)
+ (js2-set-face (match-beginning 1)
+ (match-end 1)
+ 'js2-jsdoc-html-tag-delimiter)
+ (js2-set-face (match-beginning 2)
+ (match-end 2)
+ 'js2-jsdoc-html-tag-name)
+ (js2-set-face (match-beginning 3)
+ (match-end 3)
+ 'js2-jsdoc-html-tag-delimiter))))))))
+
+(defun js2-highlight-assign-targets (_node left right)
+ "Highlight function properties and external variables."
+ (let (leftpos name)
+ ;; highlight vars and props assigned function values
+ (when (or (js2-function-node-p right)
+ (js2-class-node-p right))
+ (cond
+ ;; var foo = function() {...}
+ ((js2-name-node-p left)
+ (setq name left))
+ ;; foo.bar.baz = function() {...}
+ ((and (js2-prop-get-node-p left)
+ (js2-name-node-p (js2-prop-get-node-right left)))
+ (setq name (js2-prop-get-node-right left))))
+ (when name
+ (js2-set-face (setq leftpos (js2-node-abs-pos name))
+ (+ leftpos (js2-node-len name))
+ 'font-lock-function-name-face
+ 'record)))))
+
+(defun js2-record-name-node (node)
+ "Saves NODE to `js2-recorded-identifiers' to check for undeclared variables
+later. NODE must be a name node."
+ (let ((leftpos (js2-node-abs-pos node)))
+ (push (list node js2-current-scope
+ leftpos
+ (+ leftpos (js2-node-len node)))
+ js2-recorded-identifiers)))
+
+(defun js2-highlight-undeclared-vars ()
+ "After entire parse is finished, look for undeclared variable references.
+We have to wait until entire buffer is parsed, since JavaScript permits var
+declarations to occur after they're used.
+
+Some identifiers may be assumed to be externally defined.
+These externs are not highlighted, even if there is no declaration
+for them in the source code (in the current file).
+
+The list of externs consists of the following:
+
+ - `js2-ecma262-externs' for basic names from the ECMAScript language standard.
+ - Depending on the buffer-local variables `js2-include-*-externs'
+ the corresponding `js2-*-externs' to add names for certain environments
+ like the browser, Node or Rhino.
+ - Two customizable lists `js2-global-externs' and `js2-additional-externs',
+ the latter of which should be set per-buffer.
+
+See especially `js2-additional-externs' for further details about externs."
+ (let ((default-externs
+ (append js2-ecma-262-externs
+ (if (and js2-include-browser-externs
+ (>= js2-language-version 200)) js2-harmony-externs)
+ (if js2-include-rhino-externs js2-rhino-externs)
+ (if js2-include-node-externs js2-node-externs)
+ (if (or js2-include-browser-externs js2-include-node-externs)
+ js2-typed-array-externs)
+ (if js2-include-browser-externs js2-browser-externs)))
+ name)
+ (dolist (entry js2-recorded-identifiers)
+ (cl-destructuring-bind (name-node scope pos end) entry
+ (setq name (js2-name-node-name name-node))
+ (unless (or (member name js2-global-externs)
+ (member name default-externs)
+ (member name js2-additional-externs)
+ (js2-get-defining-scope scope name pos))
+ (js2-report-warning "msg.undeclared.variable" name pos (- end pos)
+ 'js2-external-variable))))))
+
+(defun js2--add-or-update-symbol (symbol inition used vars)
+ "Add or update SYMBOL entry in VARS, an hash table.
+SYMBOL is a js2-name-node, INITION either nil, t, or ?P,
+respectively meaning that SYMBOL is a mere declaration, an
+assignment or a function parameter; when USED is t, the symbol
+node is assumed to be an usage and thus added to the list stored
+in the cdr of the entry.
+"
+ (let* ((nm (js2-name-node-name symbol))
+ (es (js2-node-get-enclosing-scope symbol))
+ (ds (js2-get-defining-scope es nm)))
+ (when (and ds (not (equal nm "arguments")))
+ (let* ((sym (js2-scope-get-symbol ds nm))
+ (var (gethash sym vars))
+ (err-var-p (js2-catch-node-p ds)))
+ (unless inition
+ (setq inition err-var-p))
+ (if var
+ (progn
+ (when (and inition (not (equal (car var) ?P)))
+ (setcar var inition))
+ (when (and used (not (memq symbol (cdr var))))
+ (push symbol (cdr var))))
+ ;; do not consider the declaration of catch parameter as an usage
+ (when (and err-var-p used)
+ (setq used nil))
+ (puthash sym (cons inition (if used (list symbol))) vars))))))
+
+(defun js2--collect-target-symbols (node strict)
+ "Collect the `js-name-node' symbols declared in NODE and return a list of them.
+NODE is either `js2-array-node', `js2-object-node', or `js2-name-node'.
+When STRICT, signal an error if NODE is not one of the expected types."
+ (let (targets)
+ (cond
+ ((js2-name-node-p node)
+ (push node targets))
+ ((js2-array-node-p node)
+ (dolist (elt (js2-array-node-elems node))
+ (when elt
+ (setq elt (cond ((js2-infix-node-p elt) ;; default (=)
+ (js2-infix-node-left elt))
+ ((js2-unary-node-p elt) ;; rest (...)
+ (js2-unary-node-operand elt))
+ (t elt)))
+ (setq targets (append (js2--collect-target-symbols elt strict)
+ targets)))))
+ ((js2-object-node-p node)
+ (dolist (elt (js2-object-node-elems node))
+ (let ((subexpr (cond
+ ((and (js2-infix-node-p elt)
+ (= js2-ASSIGN (js2-infix-node-type elt)))
+ ;; Destructuring with default argument.
+ (js2-infix-node-left elt))
+ ((and (js2-infix-node-p elt)
+ (= js2-COLON (js2-infix-node-type elt)))
+ ;; In regular destructuring {a: aa, b: bb},
+ ;; the var is on the right. In abbreviated
+ ;; destructuring {a, b}, right == left.
+ (js2-infix-node-right elt))
+ ((and (js2-unary-node-p elt)
+ (= js2-TRIPLEDOT (js2-unary-node-type elt)))
+ ;; Destructuring with spread.
+ (js2-unary-node-operand elt)))))
+ (when subexpr
+ (setq targets (append
+ (js2--collect-target-symbols subexpr strict)
+ targets))))))
+ ((js2-assign-node-p node)
+ (setq targets (append (js2--collect-target-symbols
+ (js2-assign-node-left node) strict)
+ targets)))
+ (strict
+ (js2-report-error "msg.no.parm" nil (js2-node-abs-pos node)
+ (js2-node-len node))
+ nil))
+ targets))
+
+(defun js2--examine-variable (parent node var-init-node)
+ "Examine the usage of the variable NODE, a js2-name-node.
+PARENT is its direct ancestor and VAR-INIT-NODE is the node to be
+examined: return a list of three values, respectively if the
+variable is declared and/or assigned or whether it is simply a
+key of a literal object."
+ (let ((target (js2-var-init-node-target var-init-node))
+ declared assigned object-key)
+ (setq declared (memq node (js2--collect-target-symbols target nil)))
+ ;; Is there an initializer for the declared variable?
+ (when (js2-var-init-node-initializer var-init-node)
+ (setq assigned declared)
+ ;; Determine if the name is actually a literal object key that we shall
+ ;; ignore later
+ (when (and (not declared)
+ (js2-object-prop-node-p parent)
+ (eq node (js2-object-prop-node-left parent))
+ (not (eq node (js2-object-prop-node-right parent))))
+ (setq object-key t)))
+ ;; Maybe this is a for loop and the variable is one of its iterators?
+ (unless assigned
+ (let* ((gp (js2-node-parent parent))
+ (ggp (if gp (js2-node-parent gp))))
+ (when (and ggp (js2-for-in-node-p ggp))
+ (setq assigned (memq node
+ (cl-loop
+ for kid in (js2-var-decl-node-kids
+ (js2-for-in-node-iterator ggp))
+ with syms = '()
+ do
+ (setq syms (append syms
+ (js2--collect-target-symbols
+ (js2-var-init-node-target kid)
+ nil)))
+ finally return syms))))))
+ (list declared assigned object-key)))
+
+(defun js2--is-param (var-node params)
+ "Recursively determine whether VAR-NODE is contained in PARAMS."
+ (cond ((js2-object-prop-node-p params)
+ (eq var-node (js2-object-prop-node-left params)))
+ ((js2-name-node-p params)
+ (eq var-node params))
+ (t
+ (let ((isparam (if (listp params)
+ (memq var-node params)
+ (cl-loop with found = nil
+ for p in (js2-node-child-list params)
+ while (null found)
+ do (setq found (eq var-node p))))))
+ (unless isparam
+ (let ((kids (if (listp params)
+ params
+ (js2-node-child-list params))))
+ (cl-loop for p in kids
+ while (null isparam)
+ do (setq isparam (js2--is-param var-node p)))))
+ isparam))))
+
+(defun js2--is-function-param (parent var-node)
+ "Determine whether VAR-NODE is a function parameter."
+ (while (and parent (not (js2-function-node-p parent)))
+ (if (or (js2-var-init-node-p parent)
+ (js2-assign-node-p parent))
+ (setq parent nil)
+ (setq parent (js2-node-parent parent))))
+ (when parent
+ (js2--is-param var-node (js2-function-node-params parent))))
+
+(defun js2--classify-variable (parent node vars)
+ "Classify the single variable NODE, a js2-name-node, updating the VARS collection."
+ (let ((function-param (js2--is-function-param parent node)))
+ (if (js2-prop-get-node-p parent)
+ ;; If we are within a prop-get, e.g. the "bar" in "foo.bar",
+ ;; just mark "foo" as used
+ (let ((left (js2-prop-get-node-left parent)))
+ (when (js2-name-node-p left)
+ (js2--add-or-update-symbol left nil t vars)))
+ ;; If the node is the external name of an export-binding-node, and
+ ;; it is different from the local name, ignore it
+ (when (or (not (js2-export-binding-node-p parent))
+ (not (and (eq (js2-export-binding-node-extern-name parent) node)
+ (not (eq (js2-export-binding-node-local-name parent) node)))))
+ (let ((granparent parent)
+ var-init-node
+ assign-node
+ object-key ; is name actually an object prop key?
+ declared ; is it declared in narrowest scope?
+ assigned ; does it get assigned or initialized?
+ (used (null function-param)))
+ ;; Determine the closest var-init-node and assign-node: this
+ ;; is needed because the name may be within a "destructured"
+ ;; declaration/assignment, so we cannot just take its parent
+ (while (and granparent (not (js2-scope-p granparent)))
+ (cond
+ ((js2-var-init-node-p granparent)
+ (when (null var-init-node)
+ (setq var-init-node granparent)))
+ ((js2-assign-node-p granparent)
+ (when (null assign-node)
+ (setq assign-node granparent))))
+ (setq granparent (js2-node-parent granparent)))
+
+ ;; If we are within a var-init-node, determine if the name is
+ ;; declared and initialized
+ (when var-init-node
+ (let ((result (js2--examine-variable parent node var-init-node)))
+ (setq declared (car result)
+ assigned (cadr result)
+ object-key (car (cddr result)))))
+
+ ;; Ignore literal object keys, which are not really variables
+ (unless object-key
+ (when function-param
+ (setq assigned ?P))
+
+ (when (null assigned)
+ (cond
+ ((js2-for-in-node-p parent)
+ (setq assigned (eq node (js2-for-in-node-iterator parent))
+ used (not assigned)))
+ ((js2-function-node-p parent)
+ (setq assigned t
+ used (js2-wrapper-function-p parent)))
+ ((js2-export-binding-node-p parent)
+ (if (js2-import-clause-node-p (js2-node-parent parent))
+ (setq declared t
+ assigned t)
+ (setq used t)))
+ ((js2-namespace-import-node-p parent)
+ (setq assigned t
+ used nil))
+ ((js2-class-node-p parent)
+ (setq declared t
+ assigned t))
+ (assign-node
+ (setq assigned (memq node
+ (js2--collect-target-symbols
+ (js2-assign-node-left assign-node)
+ nil))
+ used (not assigned)))))
+
+ (when declared
+ (setq used nil))
+
+ (js2--add-or-update-symbol node assigned used vars)))))))
+
+(defun js2--classify-variables ()
+ "Collect and classify variables declared or used within js2-mode-ast.
+Traverse the whole ast tree returning a summary of the variables
+usage as an hash-table, keyed by their corresponding symbol table
+entry.
+Each variable is described by a tuple where the car is a flag
+indicating whether the variable has been initialized and the cdr
+is a possibly empty list of name nodes where it is used. External
+symbols, i.e. those not present in the whole scopes hierarchy,
+are ignored."
+ (let ((vars (make-hash-table :test #'eq :size 100)))
+ (js2-visit-ast
+ js2-mode-ast
+ (lambda (node end-p)
+ (when (and (null end-p) (js2-name-node-p node))
+ (let ((parent (js2-node-parent node)))
+ (when parent
+ (js2--classify-variable parent node vars))))
+ t))
+ vars))
+
+(defun js2--get-name-node (node)
+ (cond
+ ((js2-name-node-p node) node)
+ ((js2-function-node-p node)
+ (js2-function-node-name node))
+ ((js2-class-node-p node)
+ (js2-class-node-name node))
+ ((js2-comp-loop-node-p node)
+ (js2-comp-loop-node-iterator node))
+ (t node)))
+
+(defun js2--highlight-unused-variable (symbol info)
+ (let ((name (js2-symbol-name symbol))
+ (inited (car info))
+ (refs (cdr info))
+ pos len)
+ (unless (and inited refs)
+ (if refs
+ (dolist (ref refs)
+ (setq pos (js2-node-abs-pos ref))
+ (setq len (js2-name-node-len ref))
+ (js2-report-warning "msg.uninitialized.variable" name pos len
+ 'js2-warning))
+ (when (or js2-warn-about-unused-function-arguments
+ (not (eq inited ?P)))
+ (let* ((symn (js2-symbol-ast-node symbol))
+ (namen (js2--get-name-node symn)))
+ (unless (js2-node-top-level-decl-p namen)
+ (setq pos (js2-node-abs-pos namen))
+ (setq len (js2-name-node-len namen))
+ (js2-report-warning "msg.unused.variable" name pos len
+ 'js2-warning))))))))
+
+(defun js2-highlight-unused-variables ()
+ "Highlight unused variables."
+ (let ((vars (js2--classify-variables)))
+ (maphash #'js2--highlight-unused-variable vars)))
+
+;;;###autoload
+(define-minor-mode js2-highlight-unused-variables-mode
+ "Toggle highlight of unused variables."
+ :lighter ""
+ (if js2-highlight-unused-variables-mode
+ (add-hook 'js2-post-parse-callbacks
+ #'js2-highlight-unused-variables nil t)
+ (remove-hook 'js2-post-parse-callbacks
+ #'js2-highlight-unused-variables t)))
+
+(defun js2-add-additional-externs (externs)
+ (setq js2-additional-externs
+ (nconc externs
+ js2-additional-externs)))
+
+(defun js2-get-jslint-comment-identifiers (comment)
+ (js2-reparse)
+ (cl-loop for node in (js2-ast-root-comments js2-mode-ast)
+ when (and (eq 'block (js2-comment-node-format node))
+ (save-excursion
+ (goto-char (js2-node-abs-pos node))
+ (looking-at (concat "/\\* *" comment "\\(?: \\|$\\)"))))
+ append (js2-get-jslint-comment-identifiers-in
+ (match-end 0)
+ (js2-node-abs-end node))))
+
+(defun js2-get-jslint-comment-identifiers-in (beg end)
+ (let (res)
+ (save-excursion
+ (goto-char beg)
+ (while (re-search-forward js2-mode-identifier-re end t)
+ (let ((match (match-string 0)))
+ (unless (member match '("true" "false"))
+ (push match res)))))
+ (nreverse res)))
+
+(defun js2-apply-jslint-globals ()
+ (js2-add-additional-externs (js2-get-jslint-globals)))
+
+(defun js2-get-jslint-globals ()
+ (js2-get-jslint-comment-identifiers "global"))
+
+(defun js2-apply-jslint-declaration-externs ()
+ (js2-add-additional-externs (js2-get-jslint-declaration-externs)))
+
+(defvar js2-jslint-declaration-externs
+ `(("browser" . ,(mapcar 'symbol-name
+ '(Audio clearInterval clearTimeout document
+ event history Image location name
+ navigator Option screen setInterval
+ setTimeout XMLHttpRequest)))
+ ("node" . ,(mapcar 'symbol-name
+ '(Buffer clearImmediate clearInterval
+ clearTimeout console exports global module
+ process querystring require setImmediate
+ setInterval setTimeout __dirname
+ __filename)))
+ ("es6" . ,(mapcar 'symbol-name
+ '(ArrayBuffer DataView Float32Array
+ Float64Array Int8Array Int16Array Int32Array
+ Intl Map Promise Proxy Reflect Set Symbol
+ System Uint8Array Uint8ClampedArray
+ Uint16Array Uint32Array WeakMap WeakSet)))
+ ("couch" . ,(mapcar 'symbol-name
+ '(emit getRow isArray log provides
+ registerType require send start sum
+ toJSON)))
+ ("devel" . ,(mapcar 'symbol-name
+ '(alert confirm console Debug opera prompt
+ WSH)))))
+
+(defun js2-get-jslint-declaration-externs ()
+ (apply 'append
+ (mapcar (lambda (identifier)
+ (cdr (assoc identifier
+ js2-jslint-declaration-externs)))
+ (js2-get-jslint-comment-identifiers "jslint"))))
+
+;;; IMenu support
+
+;; We currently only support imenu, but eventually should support speedbar and
+;; possibly other browsing mechanisms.
+
+;; The basic strategy is to identify function assignment targets of the form
+;; `foo.bar.baz', convert them to (list fn foo bar baz <position>), and push the
+;; list into `js2-imenu-recorder'. The lists are merged into a trie-like tree
+;; for imenu after parsing is finished.
+
+;; A `foo.bar.baz' assignment target may be expressed in many ways in
+;; JavaScript, and the general problem is undecidable. However, several forms
+;; are readily recognizable at parse-time; the forms we attempt to recognize
+;; include:
+
+;; function foo() -- function declaration
+;; foo = function() -- function expression assigned to variable
+;; foo.bar.baz = function() -- function expr assigned to nested property-get
+;; foo = {bar: function()} -- fun prop in object literal assigned to var
+;; foo = {bar: {baz: function()}} -- inside nested object literal
+;; foo.bar = {baz: function()}} -- obj lit assigned to nested prop get
+;; a.b = {c: {d: function()}} -- nested obj lit assigned to nested prop get
+;; foo = {get bar() {...}} -- getter/setter in obj literal
+;; function foo() {function bar() {...}} -- nested function
+;; foo['a'] = function() -- fun expr assigned to deterministic element-get
+
+;; This list boils down to a few forms that can be combined recursively.
+;; Top-level named function declarations include both the left-hand (name)
+;; and the right-hand (function value) expressions needed to produce an imenu
+;; entry. The other "right-hand" forms we need to look for are:
+;; - functions declared as props/getters/setters in object literals
+;; - nested named function declarations
+;; The "left-hand" expressions that functions can be assigned to include:
+;; - local/global variables
+;; - nested property-get expressions like a.b.c.d
+;; - element gets like foo[10] or foo['bar'] where the index
+;; expression can be trivially converted to a property name. They
+;; effectively then become property gets.
+
+;; All the different definition types are canonicalized into the form
+;; foo.bar.baz = position-of-function-keyword
+
+;; We need to build a trie-like structure for imenu. As an example,
+;; consider the following JavaScript code:
+
+;; a = function() {...} // function at position 5
+;; b = function() {...} // function at position 25
+;; foo = function() {...} // function at position 100
+;; foo.bar = function() {...} // function at position 200
+;; foo.bar.baz = function() {...} // function at position 300
+;; foo.bar.zab = function() {...} // function at position 400
+
+;; During parsing we accumulate an entry for each definition in
+;; the variable `js2-imenu-recorder', like so:
+
+;; '((fn a 5)
+;; (fn b 25)
+;; (fn foo 100)
+;; (fn foo bar 200)
+;; (fn foo bar baz 300)
+;; (fn foo bar zab 400))
+
+;; Where 'fn' is the respective function node.
+;; After parsing these entries are merged into this alist-trie:
+
+;; '((a . 1)
+;; (b . 2)
+;; (foo (<definition> . 3)
+;; (bar (<definition> . 6)
+;; (baz . 100)
+;; (zab . 200))))
+
+;; Note the wacky need for a <definition> name. The token can be anything
+;; that isn't a valid JavaScript identifier, because you might make foo
+;; a function and then start setting properties on it that are also functions.
+
+(defun js2-prop-node-name (node)
+ "Return the name of a node that may be a property-get/property-name.
+If NODE is not a valid name-node, string-node or integral number-node,
+returns nil. Otherwise returns the string name/value of the node."
+ (cond
+ ((js2-name-node-p node)
+ (js2-name-node-name node))
+ ((js2-string-node-p node)
+ (js2-string-node-value node))
+ ((and (js2-number-node-p node)
+ (string-match "^[0-9]+$" (js2-number-node-value node)))
+ (js2-number-node-value node))
+ ((eq (js2-node-type node) js2-THIS)
+ "this")
+ ((eq (js2-node-type node) js2-SUPER)
+ "super")))
+
+(defun js2-node-qname-component (node)
+ "Return the name of this node, if it contributes to a qname.
+Returns nil if the node doesn't contribute."
+ (copy-sequence
+ (or (js2-prop-node-name node)
+ (cond
+ ((and (js2-function-node-p node)
+ (js2-function-node-name node))
+ (js2-name-node-name (js2-function-node-name node)))
+ ((js2-computed-prop-name-node-p node)
+ "[computed]")))))
+
+(defun js2-record-imenu-entry (fn-node qname pos)
+ "Add an entry to `js2-imenu-recorder'.
+FN-NODE should be the current item's function node.
+
+Associate FN-NODE with its QNAME for later lookup.
+This is used in postprocessing the chain list. For each chain, we find
+the parent function, look up its qname, then prepend a copy of it to the chain."
+ (push (cons fn-node (append qname (list pos))) js2-imenu-recorder)
+ (unless js2-imenu-function-map
+ (setq js2-imenu-function-map (make-hash-table :test 'eq)))
+ (puthash fn-node qname js2-imenu-function-map))
+
+(defun js2-record-imenu-functions (node &optional var)
+ "Record function definitions for imenu.
+NODE is a function node or an object literal.
+VAR, if non-nil, is the expression that NODE is being assigned to.
+When passed arguments of wrong type, does nothing."
+ (when js2-parse-ide-mode
+ (let ((fun-p (js2-function-node-p node))
+ qname fname-node)
+ (cond
+ ;; non-anonymous function declaration?
+ ((and fun-p
+ (not var)
+ (setq fname-node (js2-function-node-name node)))
+ (js2-record-imenu-entry node (list fname-node) (js2-node-pos node)))
+ ;; for remaining forms, compute left-side tree branch first
+ ((and var (setq qname (js2-compute-nested-prop-get var)))
+ (cond
+ ;; foo.bar.baz = function
+ (fun-p
+ (js2-record-imenu-entry node qname (js2-node-pos node)))
+ ;; foo.bar.baz = object-literal
+ ;; look for nested functions: {a: {b: function() {...} }}
+ ((js2-object-node-p node)
+ ;; Node position here is still absolute, since the parser
+ ;; passes the assignment target and value expressions
+ ;; to us before they are added as children of the assignment node.
+ (js2-record-object-literal node qname (js2-node-pos node)))))))))
+
+(defun js2-compute-nested-prop-get (node)
+ "If NODE is of form foo.bar, foo[\\='bar\\='], or any nested combination, return
+component nodes as a list. Otherwise return nil. Element-gets are treated
+as property-gets if the index expression is a string, or a positive integer."
+ (let (left right head)
+ (cond
+ ((or (js2-name-node-p node)
+ (js2-this-or-super-node-p node))
+ (list node))
+ ;; foo.bar.baz is parenthesized as (foo.bar).baz => right operand is a leaf
+ ((js2-prop-get-node-p node) ; foo.bar
+ (setq left (js2-prop-get-node-left node)
+ right (js2-prop-get-node-right node))
+ (if (setq head (js2-compute-nested-prop-get left))
+ (nconc head (list right))))
+ ((js2-elem-get-node-p node) ; foo['bar'] or foo[101]
+ (setq left (js2-elem-get-node-target node)
+ right (js2-elem-get-node-element node))
+ (if (or (js2-string-node-p right) ; ['bar']
+ (and (js2-number-node-p right) ; [10]
+ (string-match "^[0-9]+$"
+ (js2-number-node-value right))))
+ (if (setq head (js2-compute-nested-prop-get left))
+ (nconc head (list right))))))))
+
+(defun js2-record-object-literal (node qname pos)
+ "Recursively process an object literal looking for functions.
+NODE is an object literal that is the right-hand child of an assignment
+expression. QNAME is a list of nodes representing the assignment target,
+e.g. for foo.bar.baz = {...}, QNAME is (foo-node bar-node baz-node).
+POS is the absolute position of the node.
+We do a depth-first traversal of NODE. For any functions we find,
+we append the property name to QNAME, then call `js2-record-imenu-entry'."
+ (let (right)
+ (dolist (e (js2-object-node-elems node)) ; e is a `js2-object-prop-node'
+ (when (js2-infix-node-p e)
+ (let ((left (js2-infix-node-left e))
+ ;; Element positions are relative to the parent position.
+ (pos (+ pos (js2-node-pos e))))
+ (cond
+ ;; foo: function() {...}
+ ((js2-function-node-p (setq right (js2-infix-node-right e)))
+ (when (js2-prop-node-name left)
+ ;; As a policy decision, we record the position of the property,
+ ;; not the position of the `function' keyword, since the property
+ ;; is effectively the name of the function.
+ (js2-record-imenu-entry right (append qname (list left)) pos)))
+ ;; foo: {object-literal} -- add foo to qname, offset position, and recurse
+ ((js2-object-node-p right)
+ (js2-record-object-literal right
+ (append qname (list (js2-infix-node-left e)))
+ (+ pos (js2-node-pos right))))))))))
+
+(defun js2-node-top-level-decl-p (node)
+ "Return t if NODE's name is defined in the top-level scope.
+Also returns t if NODE's name is not defined in any scope, since it implies
+that it's an external variable, which must also be in the top-level scope."
+ (let* ((name (js2-prop-node-name node))
+ (this-scope (js2-node-get-enclosing-scope node))
+ defining-scope)
+ (cond
+ ((js2-this-or-super-node-p node)
+ nil)
+ ((null this-scope)
+ t)
+ ((setq defining-scope (js2-get-defining-scope this-scope name))
+ (js2-ast-root-p defining-scope))
+ (t t))))
+
+(defun js2-wrapper-function-p (node)
+ "Return t if NODE is a function expression that's immediately invoked.
+NODE must be `js2-function-node'."
+ (let ((parent (js2-node-parent node)))
+ (or
+ ;; function(){...}();
+ (and (js2-call-node-p parent)
+ (eq node (js2-call-node-target parent)))
+ (and (js2-paren-node-p parent)
+ ;; (function(){...})();
+ (or (js2-call-node-p (setq parent (js2-node-parent parent)))
+ ;; (function(){...}).call(this);
+ (and (js2-prop-get-node-p parent)
+ (member (js2-name-node-name (js2-prop-get-node-right parent))
+ '("call" "apply"))
+ (js2-call-node-p (js2-node-parent parent))))))))
+
+(defun js2-browse-postprocess-chains ()
+ "Modify function-declaration name chains after parsing finishes.
+Some of the information is only available after the parse tree is complete.
+For instance, processing a nested scope requires a parent function node."
+ (let (result fn parent-qname p elem)
+ (dolist (entry js2-imenu-recorder)
+ ;; function node goes first
+ (cl-destructuring-bind
+ (current-fn &rest (&whole chain head &rest rest)) entry
+ ;; Examine head's defining scope:
+ ;; Pre-processed chain, or top-level/external, keep as-is.
+ (if (or (stringp head) (js2-node-top-level-decl-p head))
+ (push chain result)
+ (when (js2-this-or-super-node-p head)
+ (setq chain (cdr chain))) ; discard this-node
+ (when (setq fn (js2-node-parent-script-or-fn current-fn))
+ (setq parent-qname (gethash fn js2-imenu-function-map 'not-found))
+ (when (eq parent-qname 'not-found)
+ ;; anonymous function expressions are not recorded
+ ;; during the parse, so we need to handle this case here
+ (setq parent-qname
+ (if (js2-wrapper-function-p fn)
+ (let ((grandparent (js2-node-parent-script-or-fn fn)))
+ (if (js2-ast-root-p grandparent)
+ nil
+ (gethash grandparent js2-imenu-function-map 'skip)))
+ 'skip))
+ (puthash fn parent-qname js2-imenu-function-map))
+ (if (eq parent-qname 'skip)
+ ;; We don't show it, let's record that fact.
+ (remhash current-fn js2-imenu-function-map)
+ ;; Prepend parent fn qname to this chain.
+ (let ((qname (append parent-qname chain)))
+ (puthash current-fn (butlast qname) js2-imenu-function-map)
+ (push qname result)))))))
+ ;; Collect chains obtained by third-party code.
+ (let (js2-imenu-recorder)
+ (run-hooks 'js2-build-imenu-callbacks)
+ (dolist (entry js2-imenu-recorder)
+ (push (cdr entry) result)))
+ ;; Finally replace each node in each chain with its name.
+ (dolist (chain result)
+ (setq p chain)
+ (while p
+ (if (js2-node-p (setq elem (car p)))
+ (setcar p (js2-node-qname-component elem)))
+ (setq p (cdr p))))
+ result))
+
+;; Merge name chains into a trie-like tree structure of nested lists.
+;; To simplify construction of the trie, we first build it out using the rule
+;; that the trie consists of lists of pairs. Each pair is a 2-element array:
+;; [key, num-or-list]. The second element can be a number; if so, this key
+;; is a leaf-node with only one value. (I.e. there is only one declaration
+;; associated with the key at this level.) Otherwise the second element is
+;; a list of pairs, with the rule applied recursively. This symmetry permits
+;; a simple recursive formulation.
+;;
+;; js2-mode is building the data structure for imenu. The imenu documentation
+;; claims that it's the structure above, but in practice it wants the children
+;; at the same list level as the key for that level, which is how I've drawn
+;; the "Expected final result" above. We'll postprocess the trie to remove the
+;; list wrapper around the children at each level.
+;;
+;; A completed nested imenu-alist entry looks like this:
+;; '(("foo"
+;; ("<definition>" . 7)
+;; ("bar"
+;; ("a" . 40)
+;; ("b" . 60))))
+;;
+;; In particular, the documentation for `imenu--index-alist' says that
+;; a nested sub-alist element looks like (INDEX-NAME SUB-ALIST).
+;; The sub-alist entries immediately follow INDEX-NAME, the head of the list.
+
+(defun js2-treeify (lst)
+ "Convert (a b c d) to (a ((b ((c d)))))."
+ (if (null (cddr lst)) ; list length <= 2
+ lst
+ (list (car lst) (list (js2-treeify (cdr lst))))))
+
+(defun js2-build-alist-trie (chains trie)
+ "Merge declaration name chains into a trie-like alist structure for imenu.
+CHAINS is the qname chain list produced during parsing. TRIE is a
+list of elements built up so far."
+ (let (head tail pos branch kids)
+ (dolist (chain chains)
+ (setq head (car chain)
+ tail (cdr chain)
+ pos (if (numberp (car tail)) (car tail))
+ branch (js2-find-if (lambda (n)
+ (string= (car n) head))
+ trie)
+ kids (cl-second branch))
+ (cond
+ ;; case 1: this key isn't in the trie yet
+ ((null branch)
+ (if trie
+ (setcdr (last trie) (list (js2-treeify chain)))
+ (setq trie (list (js2-treeify chain)))))
+ ;; case 2: key is present with a single number entry: replace w/ list
+ ;; ("a1" 10) + ("a1" 20) => ("a1" (("<definition>" 10)
+ ;; ("<definition>" 20)))
+ ((numberp kids)
+ (setcar (cdr branch)
+ (list (list "<definition-1>" kids)
+ (if pos
+ (list "<definition-2>" pos)
+ (js2-treeify tail)))))
+ ;; case 3: key is there (with kids), and we're a number entry
+ (pos
+ (setcdr (last kids)
+ (list
+ (list (format "<definition-%d>"
+ (1+ (cl-loop for kid in kids
+ count (eq ?< (aref (car kid) 0)))))
+ pos))))
+ ;; case 4: key is there with kids, need to merge in our chain
+ (t
+ (js2-build-alist-trie (list tail) kids))))
+ trie))
+
+(defun js2-flatten-trie (trie)
+ "Convert TRIE to imenu-format.
+Recurses through nodes, and for each one whose second element is a list,
+appends the list's flattened elements to the current element. Also
+changes the tails into conses. For instance, this pre-flattened trie
+
+ (a ((b 20)
+ (c ((d 30)
+ (e 40)))))
+
+becomes
+
+ (a (b . 20)
+ (c (d . 30)
+ (e . 40)))
+
+Note that the root of the trie has no key, just a list of chains.
+This is also true for the value of any key with multiple children,
+e.g. key `c' in the example above."
+ (cond
+ ((listp (car trie))
+ (mapcar #'js2-flatten-trie trie))
+ (t
+ (if (numberp (cl-second trie))
+ (cons (car trie) (cl-second trie))
+ ;; else pop list and append its kids
+ (apply #'append (list (car trie)) (js2-flatten-trie (cdr trie)))))))
+
+(defun js2-build-imenu-index ()
+ "Turn `js2-imenu-recorder' into an imenu data structure."
+ (when (eq js2-imenu-recorder 'empty)
+ (setq js2-imenu-recorder nil))
+ (let* ((chains (js2-browse-postprocess-chains))
+ (result (js2-build-alist-trie chains nil)))
+ (js2-flatten-trie result)))
+
+(defun js2-test-print-chains (chains)
+ "Print a list of qname chains.
+Each element of CHAINS is a list of the form (NODE [NODE *] pos);
+i.e. one or more nodes, and an integer position as the list tail."
+ (mapconcat (lambda (chain)
+ (concat "("
+ (mapconcat (lambda (elem)
+ (if (js2-node-p elem)
+ (or (js2-node-qname-component elem)
+ "nil")
+ (number-to-string elem)))
+ chain
+ " ")
+ ")"))
+ chains
+ "\n"))
+
+;;; Parser
+
+(defconst js2-version "1.8.5"
+ "Version of JavaScript supported.")
+
+(defun js2-record-face (face &optional token)
+ "Record a style run of FACE for TOKEN or the current token."
+ (unless token (setq token (js2-current-token)))
+ (js2-set-face (js2-token-beg token) (js2-token-end token) face 'record))
+
+(defsubst js2-node-end (n)
+ "Computes the absolute end of node N.
+Use with caution! Assumes `js2-node-pos' is -absolute-, which
+is only true until the node is added to its parent; i.e., while parsing."
+ (+ (js2-node-pos n)
+ (js2-node-len n)))
+
+(defun js2-record-comment (token)
+ "Record a comment in `js2-scanned-comments'."
+ (let ((ct (js2-token-comment-type token))
+ (beg (js2-token-beg token))
+ (end (js2-token-end token)))
+ (push (make-js2-comment-node :len (- end beg)
+ :format ct)
+ js2-scanned-comments)
+ (when js2-parse-ide-mode
+ (js2-record-face (if (eq ct 'jsdoc)
+ 'font-lock-doc-face
+ 'font-lock-comment-face)
+ token)
+ (when (memq ct '(html preprocessor))
+ ;; Tell cc-engine the bounds of the comment.
+ (js2-record-text-property beg (1- end) 'c-in-sws t)))))
+
+(defun js2-peek-token (&optional modifier)
+ "Return the next token type without consuming it.
+If `js2-ti-lookahead' is positive, return the type of next token
+from `js2-ti-tokens'. Otherwise, call `js2-get-token'."
+ (if (not (zerop js2-ti-lookahead))
+ (js2-token-type
+ (aref js2-ti-tokens (mod (1+ js2-ti-tokens-cursor) js2-ti-ntokens)))
+ (let ((tt (js2-get-token-internal modifier)))
+ (js2-unget-token)
+ tt)))
+
+(defalias 'js2-next-token 'js2-get-token)
+
+(defun js2-match-token (match &optional dont-unget)
+ "Get next token and return t if it matches MATCH, a bytecode.
+Returns nil and consumes nothing if MATCH is not the next token."
+ (if (/= (js2-get-token) match)
+ (ignore (unless dont-unget (js2-unget-token)))
+ t))
+
+(defun js2-match-contextual-kwd (name)
+ "Consume and return t if next token is `js2-NAME', and its
+string is NAME. Returns nil and keeps current token otherwise."
+ (if (js2-contextual-kwd-p (progn (js2-get-token)
+ (js2-current-token))
+ name)
+ (progn (js2-record-face 'font-lock-keyword-face) t)
+ (js2-unget-token)
+ nil))
+
+(defun js2-contextual-kwd-p (token name)
+ "Return t if TOKEN is `js2-NAME', and its string is NAME."
+ (and (= (js2-token-type token) js2-NAME)
+ (string= (js2-token-string token) name)))
+
+(defun js2-match-async-function ()
+ (when (and (js2-contextual-kwd-p (js2-current-token) "async")
+ (= (js2-peek-token) js2-FUNCTION))
+ (js2-record-face 'font-lock-keyword-face)
+ (js2-get-token)
+ t))
+
+(defun js2-match-async-arrow-function ()
+ (and (js2-contextual-kwd-p (js2-current-token) "async")
+ (/= (js2-peek-token) js2-FUNCTION)))
+
+(defsubst js2-inside-function ()
+ (cl-plusp js2-nesting-of-function))
+
+(defsubst js2-inside-async-function ()
+ (and (js2-inside-function)
+ (js2-function-node-async js2-current-script-or-fn)))
+
+(defun js2-parse-await-maybe (tt)
+ "Parse \"await\" as an AwaitExpression, if it is one."
+ (and (= tt js2-NAME)
+ (js2-contextual-kwd-p (js2-current-token) "await")
+ ;; Per the proposal, AwaitExpression consists of "await"
+ ;; followed by a UnaryExpression. So look ahead for one.
+ (let ((ts-state (make-js2-ts-state))
+ (recorded-identifiers js2-recorded-identifiers)
+ (parsed-errors js2-parsed-errors)
+ (current-token (js2-current-token))
+ (beg (js2-current-token-beg))
+ (end (js2-current-token-end))
+ pn)
+ (js2-get-token)
+ (setq pn (js2-make-unary beg js2-AWAIT 'js2-parse-unary-expr))
+ (if (= (js2-node-type (js2-unary-node-operand pn)) js2-ERROR)
+ ;; The parse failed, so pretend like nothing happened and restore
+ ;; the previous parsing state.
+ (progn
+ (js2-ts-seek ts-state)
+ (setq js2-recorded-identifiers recorded-identifiers
+ js2-parsed-errors parsed-errors)
+ ;; And ensure the caller knows about the failure.
+ nil)
+ ;; The parse was successful, so process and return the "await".
+ (js2-record-face 'font-lock-keyword-face current-token)
+ (unless (js2-inside-async-function)
+ (js2-report-error "msg.bad.await" nil
+ beg (- end beg)))
+ pn))))
+
+(defun js2-get-prop-name-token ()
+ (js2-get-token (and (>= js2-language-version 170) 'KEYWORD_IS_NAME)))
+
+(defun js2-match-prop-name ()
+ "Consume token and return t if next token is a valid property name.
+If `js2-language-version' is >= 180, a keyword or reserved word
+is considered valid name as well."
+ (if (memq (js2-get-prop-name-token) `(,js2-NAME ,js2-PRIVATE_NAME))
+ t
+ (js2-unget-token)
+ nil))
+
+(defun js2-must-match-prop-name (msg-id &optional pos len)
+ (if (js2-match-prop-name)
+ t
+ (js2-report-error msg-id nil pos len)
+ nil))
+
+(defun js2-peek-token-or-eol ()
+ "Return js2-EOL if the next token immediately follows a newline.
+Else returns the next token. Used in situations where we don't
+consider certain token types valid if they are preceded by a newline.
+One example is the postfix ++ or -- operator, which has to be on the
+same line as its operand."
+ (let ((tt (js2-get-token))
+ (follows-eol (js2-token-follows-eol-p (js2-current-token))))
+ (js2-unget-token)
+ (if follows-eol
+ js2-EOL
+ tt)))
+
+(defun js2-must-match (token msg-id &optional pos len)
+ "Match next token to token code TOKEN, or record a syntax error.
+MSG-ID is the error message to report if the match fails.
+Returns t on match, nil if no match."
+ (if (js2-match-token token t)
+ t
+ (js2-report-error msg-id nil pos len)
+ (js2-unget-token)
+ nil))
+
+(defun js2-must-match-name (msg-id)
+ (if (js2-match-token js2-NAME t)
+ t
+ (if (eq (js2-current-token-type) js2-RESERVED)
+ (js2-report-error "msg.reserved.id" (js2-current-token-string))
+ (js2-report-error msg-id)
+ (js2-unget-token))
+ nil))
+
+(defun js2-set-requires-activation ()
+ (if (js2-function-node-p js2-current-script-or-fn)
+ (setf (js2-function-node-needs-activation js2-current-script-or-fn) t)))
+
+(defun js2-check-activation-name (name _token)
+ (when (js2-inside-function)
+ ;; skip language-version 1.2 check from Rhino
+ (if (or (string= "arguments" name)
+ (and js2-compiler-activation-names ; only used in codegen
+ (gethash name js2-compiler-activation-names)))
+ (js2-set-requires-activation))))
+
+(defun js2-set-is-generator ()
+ (let ((fn-node js2-current-script-or-fn))
+ (when (and (js2-function-node-p fn-node)
+ (not (js2-function-node-generator-type fn-node)))
+ (setf (js2-function-node-generator-type js2-current-script-or-fn) 'LEGACY))))
+
+(defun js2-must-have-xml ()
+ (unless js2-compiler-xml-available
+ (js2-report-error "msg.XML.not.available")))
+
+(defun js2-push-scope (scope)
+ "Push SCOPE, a `js2-scope', onto the lexical scope chain."
+ (cl-assert (js2-scope-p scope))
+ (cl-assert (null (js2-scope-parent-scope scope)))
+ (cl-assert (not (eq js2-current-scope scope)))
+ (setf (js2-scope-parent-scope scope) js2-current-scope
+ js2-current-scope scope))
+
+(defsubst js2-pop-scope ()
+ (setq js2-current-scope
+ (js2-scope-parent-scope js2-current-scope)))
+
+(defun js2-enter-loop (loop-node)
+ (push loop-node js2-loop-set)
+ (push loop-node js2-loop-and-switch-set)
+ (js2-push-scope loop-node)
+ ;; Tell the current labeled statement (if any) its statement,
+ ;; and set the jump target of the first label to the loop.
+ ;; These are used in `js2-parse-continue' to verify that the
+ ;; continue target is an actual labeled loop. (And for codegen.)
+ (when js2-labeled-stmt
+ (setf (js2-labeled-stmt-node-stmt js2-labeled-stmt) loop-node
+ (js2-label-node-loop (car (js2-labeled-stmt-node-labels
+ js2-labeled-stmt))) loop-node)))
+
+(defun js2-exit-loop ()
+ (pop js2-loop-set)
+ (pop js2-loop-and-switch-set)
+ (js2-pop-scope))
+
+(defsubst js2-enter-switch (switch-node)
+ (js2-push-scope switch-node)
+ (push switch-node js2-loop-and-switch-set))
+
+(defsubst js2-exit-switch ()
+ (js2-pop-scope)
+ (pop js2-loop-and-switch-set))
+
+(defsubst js2-get-directive (node)
+ "Return NODE's value if it is a directive, nil otherwise.
+
+A directive is an otherwise-meaningless expression statement
+consisting of a string literal, such as \"use strict\"."
+ (and (js2-expr-stmt-node-p node)
+ (js2-string-node-p (setq node (js2-expr-stmt-node-expr node)))
+ (js2-string-node-value node)))
+
+(defun js2-parse (&optional buf cb)
+ "Tell the js2 parser to parse a region of JavaScript.
+
+BUF is a buffer or buffer name containing the code to parse.
+Call `narrow-to-region' first to parse only part of the buffer.
+
+The returned AST root node is given some additional properties:
+ `node-count' - total number of nodes in the AST
+ `buffer' - BUF. The buffer it refers to may change or be killed,
+ so the value is not necessarily reliable.
+
+An optional callback CB can be specified to report parsing
+progress. If (functionp CB) returns t, it will be called with
+the current line number once before parsing begins, then again
+each time the lexer reaches a new line number.
+
+CB can also be a list of the form (symbol cb ...) to specify
+multiple callbacks with different criteria. Each symbol is a
+criterion keyword, and the following element is the callback to
+call
+
+ :line - called whenever the line number changes
+ :token - called for each new token consumed
+
+The list of criteria could be extended to include entering or
+leaving a statement, an expression, or a function definition."
+ (if (and cb (not (functionp cb)))
+ (error "criteria callbacks not yet implemented"))
+ (let ((inhibit-point-motion-hooks t)
+ (js2-compiler-xml-available (>= js2-language-version 160))
+ ;; This is a recursive-descent parser, so give it a big stack.
+ (max-lisp-eval-depth (max max-lisp-eval-depth 3000))
+ (max-specpdl-size (max max-specpdl-size 3000))
+ (case-fold-search nil)
+ ast)
+ (with-current-buffer (or buf (current-buffer))
+ (setq js2-scanned-comments nil
+ js2-parsed-errors nil
+ js2-parsed-warnings nil
+ js2-imenu-recorder nil
+ js2-imenu-function-map nil
+ js2-label-set nil)
+ (js2-init-scanner)
+ (setq ast (js2-do-parse))
+ (unless js2-ts-hit-eof
+ (js2-report-error "msg.got.syntax.errors" (length js2-parsed-errors)))
+ (setf (js2-ast-root-errors ast) js2-parsed-errors
+ (js2-ast-root-warnings ast) js2-parsed-warnings)
+ ;; if we didn't find any declarations, put a dummy in this list so we
+ ;; don't end up re-parsing the buffer in `js2-mode-create-imenu-index'
+ (unless js2-imenu-recorder
+ (setq js2-imenu-recorder 'empty))
+ (run-hooks 'js2-parse-finished-hook)
+ ast)))
+
+;; Corresponds to Rhino's Parser.parse() method.
+(defun js2-do-parse ()
+ "Parse current buffer starting from current point.
+Scanner should be initialized."
+ (let ((pos js2-ts-cursor)
+ (end js2-ts-cursor) ; in case file is empty
+ root n tt
+ (in-directive-prologue t)
+ (js2-in-use-strict-directive js2-in-use-strict-directive)
+ directive)
+ ;; initialize buffer-local parsing vars
+ (setf root (make-js2-ast-root :buffer (buffer-name) :pos pos)
+ js2-current-script-or-fn root
+ js2-current-scope root
+ js2-nesting-of-function 0
+ js2-labeled-stmt nil
+ js2-recorded-identifiers nil ; for js2-highlight
+ js2-in-use-strict-directive js2-mode-assume-strict)
+ (while (/= (setq tt (js2-get-token)) js2-EOF)
+ (if (= tt js2-FUNCTION)
+ (progn
+ (setq n (if js2-called-by-compile-function
+ (js2-parse-function-expr)
+ (js2-parse-function-stmt))))
+ ;; not a function - parse a statement
+ (js2-unget-token)
+ (setq n (js2-parse-statement))
+ (when in-directive-prologue
+ (setq directive (js2-get-directive n))
+ (cond
+ ((null directive)
+ (setq in-directive-prologue nil))
+ ((string= directive "use strict")
+ (setq js2-in-use-strict-directive t)))))
+ ;; add function or statement to script
+ (setq end (js2-node-end n))
+ (js2-block-node-push root n))
+ ;; add comments to root in lexical order
+ (when js2-scanned-comments
+ ;; if we find a comment beyond end of normal kids, use its end
+ (setq end (max end (js2-node-end (cl-first js2-scanned-comments))))
+ (dolist (comment js2-scanned-comments)
+ (push comment (js2-ast-root-comments root))
+ (js2-node-add-children root comment)))
+ (setf (js2-node-len root) (- end pos))
+ (setq js2-mode-ast root) ; Make sure this is available for callbacks.
+ ;; Give extensions a chance to muck with things before highlighting starts.
+ (let ((js2-additional-externs js2-additional-externs))
+ (js2-filter-parsed-warnings)
+ (save-excursion
+ (run-hooks 'js2-post-parse-callbacks))
+ (js2-highlight-undeclared-vars))
+ root))
+
+(defun js2-filter-parsed-warnings ()
+ "Remove `js2-parsed-warnings' elements that match `js2-ignored-warnings'."
+ (when js2-ignored-warnings
+ (setq js2-parsed-warnings
+ (cl-remove-if
+ (lambda (warning)
+ (let ((msg (caar warning)))
+ (member msg js2-ignored-warnings)))
+ js2-parsed-warnings)))
+ js2-parsed-warnings)
+
+(defun js2-parse-function-closure-body (fn-node)
+ "Parse a JavaScript 1.8 function closure body."
+ (let ((js2-nesting-of-function (1+ js2-nesting-of-function)))
+ (if js2-ts-hit-eof
+ (js2-report-error "msg.no.brace.body" nil
+ (js2-node-pos fn-node)
+ (- js2-ts-cursor (js2-node-pos fn-node)))
+ (js2-node-add-children fn-node
+ (setf (js2-function-node-body fn-node)
+ (js2-parse-expr t))))))
+
+(defun js2-parse-function-body (fn-node)
+ (js2-must-match js2-LC "msg.no.brace.body"
+ (js2-node-pos fn-node)
+ (- js2-ts-cursor (js2-node-pos fn-node)))
+ (let ((pos (js2-current-token-beg)) ; LC position
+ (pn (make-js2-block-node)) ; starts at LC position
+ tt
+ end
+ not-in-directive-prologue
+ node
+ directive)
+ (cl-incf js2-nesting-of-function)
+ (unwind-protect
+ (while (not (or (= (setq tt (js2-peek-token)) js2-ERROR)
+ (= tt js2-EOF)
+ (= tt js2-RC)))
+ (js2-block-node-push
+ pn
+ (if (/= tt js2-FUNCTION)
+ (if not-in-directive-prologue
+ (js2-parse-statement)
+ (setq node (js2-parse-statement)
+ directive (js2-get-directive node))
+ (cond
+ ((null directive)
+ (setq not-in-directive-prologue t))
+ ((string= directive "use strict")
+ ;; Back up and reparse the function, because new rules apply
+ ;; to the function name and parameters.
+ (when (not js2-in-use-strict-directive)
+ (setq js2-in-use-strict-directive t)
+ (throw 'reparse t))))
+ node)
+ (js2-get-token)
+ (js2-parse-function-stmt))))
+ (cl-decf js2-nesting-of-function))
+ (setq end (js2-current-token-end)) ; assume no curly and leave at current token
+ (if (js2-must-match js2-RC "msg.no.brace.after.body" pos)
+ (setq end (js2-current-token-end)))
+ (setf (js2-node-pos pn) pos
+ (js2-node-len pn) (- end pos))
+ (setf (js2-function-node-body fn-node) pn)
+ (js2-node-add-children fn-node pn)
+ pn))
+
+(defun js2-define-destruct-symbols (node decl-type face &optional ignore-not-in-block)
+ "Declare and fontify destructuring parameters inside NODE.
+NODE is either `js2-array-node', `js2-object-node', or `js2-name-node'.
+
+Return a list of `js2-name-node' nodes representing the symbols
+declared; probably to check them for errors."
+ (let ((name-nodes (js2--collect-target-symbols node t)))
+ (dolist (node name-nodes)
+ (let (leftpos)
+ (js2-define-symbol decl-type (js2-name-node-name node)
+ node ignore-not-in-block)
+ (when face
+ (js2-set-face (setq leftpos (js2-node-abs-pos node))
+ (+ leftpos (js2-node-len node))
+ face 'record))))
+ name-nodes))
+
+(defvar js2-illegal-strict-identifiers
+ '("eval" "arguments")
+ "Identifiers not allowed as variables in strict mode.")
+
+(defun js2-check-strict-identifier (name-node)
+ "Check that NAME-NODE makes a legal strict mode identifier."
+ (when js2-in-use-strict-directive
+ (let ((param-name (js2-name-node-name name-node)))
+ (when (member param-name js2-illegal-strict-identifiers)
+ (js2-report-error "msg.bad.id.strict" param-name
+ (js2-node-abs-pos name-node) (js2-node-len name-node))))))
+
+(defun js2-check-strict-function-params (preceding-params params)
+ "Given PRECEDING-PARAMS in a function's parameter list, check
+for strict mode errors caused by PARAMS."
+ (when js2-in-use-strict-directive
+ (dolist (param params)
+ (let ((param-name (js2-name-node-name param)))
+ (js2-check-strict-identifier param)
+ (when (cl-some (lambda (param)
+ (string= (js2-name-node-name param) param-name))
+ preceding-params)
+ (js2-report-error "msg.dup.param.strict" param-name
+ (js2-node-abs-pos param) (js2-node-len param)))))))
+
+(defun js2-parse-function-params (function-type fn-node pos)
+ "Parse the parameters of a function of FUNCTION-TYPE
+represented by FN-NODE at POS."
+ (if (js2-match-token js2-RP)
+ (setf (js2-function-node-rp fn-node) (- (js2-current-token-beg) pos))
+ (let ((paren-free-arrow (and (eq function-type 'FUNCTION_ARROW)
+ (eq (js2-current-token-type) js2-NAME)))
+ params param
+ param-name-nodes new-param-name-nodes
+ rest-param-at)
+ (when paren-free-arrow
+ (js2-unget-token))
+ (cl-loop for tt = (js2-peek-token)
+ do
+ (cond
+ ;; destructuring param
+ ((and (not paren-free-arrow)
+ (or (= tt js2-LB) (= tt js2-LC)))
+ (js2-get-token)
+ (setq param (js2-parse-destruct-primary-expr)
+ new-param-name-nodes (js2-define-destruct-symbols
+ param js2-LP 'js2-function-param))
+ (js2-check-strict-function-params param-name-nodes new-param-name-nodes)
+ (setq param-name-nodes (append param-name-nodes new-param-name-nodes)))
+ ;; variable name
+ (t
+ (when (and (>= js2-language-version 200)
+ (not paren-free-arrow)
+ (js2-match-token js2-TRIPLEDOT)
+ (not rest-param-at))
+ ;; to report errors if there are more parameters
+ (setq rest-param-at (length params)))
+ (js2-must-match-name "msg.no.parm")
+ (js2-record-face 'js2-function-param)
+ (setq param (js2-create-name-node))
+ (js2-define-symbol js2-LP (js2-current-token-string) param)
+ (js2-check-strict-function-params param-name-nodes (list param))
+ (setq param-name-nodes (append param-name-nodes (list param)))))
+ ;; default parameter value
+ (when (and (not rest-param-at)
+ (>= js2-language-version 200)
+ (js2-match-token js2-ASSIGN))
+ (cl-assert (not paren-free-arrow))
+ (let* ((pos (js2-node-pos param))
+ (tt (js2-current-token-type))
+ (op-pos (- (js2-current-token-beg) pos))
+ (left param)
+ (right (js2-parse-assign-expr))
+ (len (- (js2-node-end right) pos)))
+ (setq param (make-js2-assign-node
+ :type tt :pos pos :len len :op-pos op-pos
+ :left left :right right))
+ (js2-node-add-children param left right)))
+ (push param params)
+ (when (and rest-param-at (> (length params) (1+ rest-param-at)))
+ (js2-report-error "msg.param.after.rest" nil
+ (js2-node-pos param) (js2-node-len param)))
+ while
+ (and (js2-match-token js2-COMMA)
+ (or (< js2-language-version 200)
+ (not (= js2-RP (js2-peek-token))))))
+ (when (and (not paren-free-arrow)
+ (js2-must-match js2-RP "msg.no.paren.after.parms"))
+ (setf (js2-function-node-rp fn-node) (- (js2-current-token-beg) pos)))
+ (when rest-param-at
+ (setf (js2-function-node-rest-p fn-node) t))
+ (dolist (p params)
+ (js2-node-add-children fn-node p)
+ (push p (js2-function-node-params fn-node))))))
+
+(defun js2-check-inconsistent-return-warning (fn-node name)
+ "Possibly show inconsistent-return warning.
+Last token scanned is the close-curly for the function body."
+ (when (and js2-mode-show-strict-warnings
+ js2-strict-inconsistent-return-warning
+ (not (js2-has-consistent-return-usage
+ (js2-function-node-body fn-node))))
+ ;; Have it extend from close-curly to bol or beginning of block.
+ (let ((pos (save-excursion
+ (goto-char (js2-current-token-end))
+ (max (js2-node-abs-pos (js2-function-node-body fn-node))
+ (point-at-bol))))
+ (end (js2-current-token-end)))
+ (if (cl-plusp (js2-name-node-length name))
+ (js2-add-strict-warning "msg.no.return.value"
+ (js2-name-node-name name) pos end)
+ (js2-add-strict-warning "msg.anon.no.return.value" nil pos end)))))
+
+(defun js2-parse-function-stmt (&optional async-p)
+ (let ((pos (js2-current-token-beg))
+ (star-p (js2-match-token js2-MUL)))
+ (js2-must-match-name "msg.unnamed.function.stmt")
+ (let ((name (js2-create-name-node t))
+ pn member-expr)
+ (cond
+ ((js2-match-token js2-LP)
+ (js2-parse-function 'FUNCTION_STATEMENT pos star-p async-p name))
+ (js2-allow-member-expr-as-function-name
+ (setq member-expr (js2-parse-member-expr-tail nil name))
+ (js2-parse-highlight-member-expr-fn-name member-expr)
+ (js2-must-match js2-LP "msg.no.paren.parms")
+ (setf pn (js2-parse-function 'FUNCTION_STATEMENT pos star-p async-p)
+ (js2-function-node-member-expr pn) member-expr)
+ pn)
+ (t
+ (js2-report-error "msg.no.paren.parms")
+ (make-js2-error-node))))))
+
+(defun js2-parse-async-function-stmt ()
+ (js2-parse-function-stmt t))
+
+(defun js2-parse-function-expr (&optional async-p)
+ (let ((pos (js2-current-token-beg))
+ (star-p (js2-match-token js2-MUL))
+ name)
+ (when (js2-match-token js2-NAME)
+ (setq name (js2-create-name-node t)))
+ (js2-must-match js2-LP "msg.no.paren.parms")
+ (js2-parse-function 'FUNCTION_EXPRESSION pos star-p async-p name)))
+
+(defun js2-parse-function-internal (function-type pos star-p &optional async-p name)
+ (let (fn-node lp)
+ (if (= (js2-current-token-type) js2-LP) ; eventually matched LP?
+ (setq lp (js2-current-token-beg)))
+ (setf fn-node (make-js2-function-node :pos pos
+ :name name
+ :form function-type
+ :lp (if lp (- lp pos))
+ :generator-type (and star-p 'STAR)
+ :async async-p))
+ (when name
+ (js2-set-face (js2-node-pos name) (js2-node-end name)
+ 'font-lock-function-name-face 'record)
+ (when (and (eq function-type 'FUNCTION_STATEMENT)
+ (cl-plusp (js2-name-node-length name)))
+ ;; Function statements define a symbol in the enclosing scope
+ (js2-define-symbol js2-FUNCTION (js2-name-node-name name) fn-node))
+ (when js2-in-use-strict-directive
+ (js2-check-strict-identifier name)))
+ (if (or (js2-inside-function) (cl-plusp js2-nesting-of-with))
+ ;; 1. Nested functions are not affected by the dynamic scope flag
+ ;; as dynamic scope is already a parent of their scope.
+ ;; 2. Functions defined under the with statement also immune to
+ ;; this setup, in which case dynamic scope is ignored in favor
+ ;; of the with object.
+ (setf (js2-function-node-ignore-dynamic fn-node) t))
+ ;; dynamically bind all the per-function variables
+ (let ((js2-current-script-or-fn fn-node)
+ (js2-current-scope fn-node)
+ (js2-nesting-of-with 0)
+ (js2-end-flags 0)
+ js2-label-set
+ js2-loop-set
+ js2-loop-and-switch-set)
+ (js2-parse-function-params function-type fn-node pos)
+ (when (eq function-type 'FUNCTION_ARROW)
+ (js2-must-match js2-ARROW "msg.bad.arrow.args"))
+ (if (and (>= js2-language-version 180)
+ (/= (js2-peek-token) js2-LC))
+ (js2-parse-function-closure-body fn-node)
+ (js2-parse-function-body fn-node))
+ (js2-check-inconsistent-return-warning fn-node name)
+
+ (when name
+ (js2-node-add-children fn-node name)
+ ;; Function expressions define a name only in the body of the
+ ;; function, and only if not hidden by a parameter name
+ (when (and (eq function-type 'FUNCTION_EXPRESSION)
+ (null (js2-scope-get-symbol js2-current-scope
+ (js2-name-node-name name))))
+ (js2-define-symbol js2-FUNCTION
+ (js2-name-node-name name)
+ fn-node))
+ (when (eq function-type 'FUNCTION_STATEMENT)
+ (js2-record-imenu-functions fn-node))))
+
+ (setf (js2-node-len fn-node) (- (js2-current-token-end) pos))
+ ;; Rhino doesn't do this, but we need it for finding undeclared vars.
+ ;; We wait until after parsing the function to set its parent scope,
+ ;; since `js2-define-symbol' needs the defining-scope check to stop
+ ;; at the function boundary when checking for redeclarations.
+ (setf (js2-scope-parent-scope fn-node) js2-current-scope)
+ fn-node))
+
+(defun js2-parse-function (function-type pos star-p &optional async-p name)
+ "Function parser. FUNCTION-TYPE is a symbol, POS is the
+beginning of the first token (function keyword, unless it's an
+arrow function), NAME is js2-name-node."
+ (let ((continue t)
+ ts-state
+ fn-node
+ ;; Preserve strict state outside this function.
+ (js2-in-use-strict-directive js2-in-use-strict-directive))
+ ;; Parse multiple times if a new strict mode directive is discovered in the
+ ;; function body, as new rules will be retroactively applied to the legality
+ ;; of function names and parameters.
+ (while continue
+ (setq ts-state (make-js2-ts-state))
+ (setq continue (catch 'reparse
+ (setq fn-node (js2-parse-function-internal
+ function-type pos star-p async-p name))
+ ;; Don't continue.
+ nil))
+ (when continue
+ (js2-ts-seek ts-state)))
+ fn-node))
+
+(defun js2-parse-statements (&optional parent)
+ "Parse a statement list. Last token consumed must be js2-LC.
+
+PARENT can be a `js2-block-node', in which case the statements are
+appended to PARENT. Otherwise a new `js2-block-node' is created
+and returned.
+
+This function does not match the closing js2-RC: the caller
+matches the RC so it can provide a suitable error message if not
+matched. This means it's up to the caller to set the length of
+the node to include the closing RC. The node start pos is set to
+the absolute buffer start position, and the caller should fix it
+up to be relative to the parent node. All children of this block
+node are given relative start positions and correct lengths."
+ (let ((pn (or parent (make-js2-block-node)))
+ tt)
+ (while (and (> (setq tt (js2-peek-token)) js2-EOF)
+ (/= tt js2-RC))
+ (js2-block-node-push pn (js2-parse-statement)))
+ pn))
+
+(defun js2-parse-statement ()
+ (let (pn beg end)
+ ;; coarse-grained user-interrupt check - needs work
+ (and js2-parse-interruptable-p
+ (zerop (% (cl-incf js2-parse-stmt-count)
+ js2-statements-per-pause))
+ (input-pending-p)
+ (throw 'interrupted t))
+ (setq pn (js2-statement-helper))
+ ;; no-side-effects warning check
+ (unless (js2-node-has-side-effects pn)
+ (setq end (js2-node-end pn))
+ (save-excursion
+ (goto-char end)
+ (setq beg (max (js2-node-pos pn) (point-at-bol))))
+ (js2-add-strict-warning "msg.no.side.effects" nil beg end))
+ pn))
+
+;; These correspond to the switch cases in Parser.statementHelper
+(defconst js2-parsers
+ (let ((parsers (make-vector js2-num-tokens
+ #'js2-parse-expr-stmt)))
+ (aset parsers js2-BREAK #'js2-parse-break)
+ (aset parsers js2-CLASS #'js2-parse-class-stmt)
+ (aset parsers js2-CONST #'js2-parse-const-var)
+ (aset parsers js2-CONTINUE #'js2-parse-continue)
+ (aset parsers js2-DEBUGGER #'js2-parse-debugger)
+ (aset parsers js2-DEFAULT #'js2-parse-default-xml-namespace)
+ (aset parsers js2-DO #'js2-parse-do)
+ (aset parsers js2-EXPORT #'js2-parse-export)
+ (aset parsers js2-FOR #'js2-parse-for)
+ (aset parsers js2-FUNCTION #'js2-parse-function-stmt)
+ (aset parsers js2-IF #'js2-parse-if)
+ (aset parsers js2-IMPORT #'js2-parse-import-declaration-or-expr)
+ (aset parsers js2-LC #'js2-parse-block)
+ (aset parsers js2-LET #'js2-parse-let-stmt)
+ (aset parsers js2-NAME #'js2-parse-name-or-label)
+ (aset parsers js2-RETURN #'js2-parse-ret-yield)
+ (aset parsers js2-SEMI #'js2-parse-semi)
+ (aset parsers js2-SWITCH #'js2-parse-switch)
+ (aset parsers js2-THROW #'js2-parse-throw)
+ (aset parsers js2-TRY #'js2-parse-try)
+ (aset parsers js2-VAR #'js2-parse-const-var)
+ (aset parsers js2-WHILE #'js2-parse-while)
+ (aset parsers js2-WITH #'js2-parse-with)
+ (aset parsers js2-YIELD #'js2-parse-ret-yield)
+ parsers)
+ "A vector mapping token types to parser functions.")
+
+(defun js2-parse-warn-missing-semi (beg end)
+ (and js2-mode-show-strict-warnings
+ js2-strict-missing-semi-warning
+ (js2-add-strict-warning
+ "msg.missing.semi" nil
+ ;; back up to beginning of statement or line
+ (max beg (save-excursion
+ (goto-char end)
+ (point-at-bol)))
+ end)))
+
+(defconst js2-no-semi-insertion
+ (list js2-IF
+ js2-SWITCH
+ js2-WHILE
+ js2-DO
+ js2-FOR
+ js2-TRY
+ js2-WITH
+ js2-LC
+ js2-ERROR
+ js2-SEMI
+ js2-CLASS
+ js2-FUNCTION
+ js2-EXPORT)
+ "List of tokens that don't do automatic semicolon insertion.")
+
+(defconst js2-autoinsert-semi-and-warn
+ (list js2-ERROR js2-EOF js2-RC))
+
+(defun js2-statement-helper ()
+ (let* ((tt (js2-get-token))
+ (first-tt tt)
+ (async-stmt (js2-match-async-function))
+ (parser (if (= tt js2-ERROR)
+ #'js2-parse-semi
+ (if async-stmt
+ #'js2-parse-async-function-stmt
+ (aref js2-parsers tt))))
+ pn)
+ ;; If the statement is set, then it's been told its label by now.
+ (and js2-labeled-stmt
+ (js2-labeled-stmt-node-stmt js2-labeled-stmt)
+ (setq js2-labeled-stmt nil))
+ (setq pn (funcall parser))
+ ;; Don't do auto semi insertion for certain statement types.
+ (unless (or (memq first-tt js2-no-semi-insertion)
+ (js2-labeled-stmt-node-p pn)
+ async-stmt)
+ (js2-auto-insert-semicolon pn))
+ pn))
+
+(defun js2-auto-insert-semicolon (pn)
+ (let* ((tt (js2-get-token))
+ (pos (js2-node-pos pn)))
+ (cond
+ ((= tt js2-SEMI)
+ ;; extend the node bounds to include the semicolon.
+ (setf (js2-node-len pn) (- (js2-current-token-end) pos)))
+ ((memq tt js2-autoinsert-semi-and-warn)
+ (js2-unget-token) ; Not ';', do not consume.
+ ;; Autoinsert ;
+ (js2-parse-warn-missing-semi pos (js2-node-end pn)))
+ (t
+ (if (not (js2-token-follows-eol-p (js2-current-token)))
+ ;; Report error if no EOL or autoinsert ';' otherwise
+ (js2-report-error "msg.no.semi.stmt")
+ (js2-parse-warn-missing-semi pos (js2-node-end pn)))
+ (js2-unget-token) ; Not ';', do not consume.
+ ))))
+
+(defun js2-parse-condition ()
+ "Parse a parenthesized boolean expression, e.g. in an if- or while-stmt.
+The parens are discarded and the expression node is returned.
+The `pos' field of the return value is set to an absolute position
+that must be fixed up by the caller.
+Return value is a list (EXPR LP RP), with absolute paren positions."
+ (let (pn lp rp)
+ (if (js2-must-match js2-LP "msg.no.paren.cond")
+ (setq lp (js2-current-token-beg)))
+ (setq pn (js2-parse-expr))
+ (if (js2-must-match js2-RP "msg.no.paren.after.cond")
+ (setq rp (js2-current-token-beg)))
+ ;; Report strict warning on code like "if (a = 7) ..."
+ (if (and js2-strict-cond-assign-warning
+ (js2-assign-node-p pn))
+ (js2-add-strict-warning "msg.equal.as.assign" nil
+ (js2-node-pos pn)
+ (+ (js2-node-pos pn)
+ (js2-node-len pn))))
+ (list pn lp rp)))
+
+(defun js2-parse-if ()
+ "Parser for if-statement. Last matched token must be js2-IF."
+ (let ((pos (js2-current-token-beg))
+ cond if-true if-false else-pos end pn)
+ (setq cond (js2-parse-condition)
+ if-true (js2-parse-statement)
+ if-false (if (js2-match-token js2-ELSE)
+ (progn
+ (setq else-pos (- (js2-current-token-beg) pos))
+ (js2-parse-statement)))
+ end (js2-node-end (or if-false if-true))
+ pn (make-js2-if-node :pos pos
+ :len (- end pos)
+ :condition (car cond)
+ :then-part if-true
+ :else-part if-false
+ :else-pos else-pos
+ :lp (js2-relpos (cl-second cond) pos)
+ :rp (js2-relpos (cl-third cond) pos)))
+ (js2-node-add-children pn (car cond) if-true if-false)
+ pn))
+
+(defun js2-parse-import-declaration-or-expr ()
+ (if (memq (js2-peek-token) `(,js2-LP ,js2-DOT))
+ (js2-parse-expr-stmt)
+ (js2-parse-import)))
+
+(defun js2-parse-import ()
+ "Parse import statement. The current token must be js2-IMPORT."
+ (unless (js2-ast-root-p js2-current-scope)
+ (js2-report-error "msg.mod.import.decl.at.top.level"))
+ (let ((beg (js2-current-token-beg)))
+ (cond ((js2-match-token js2-STRING)
+ (make-js2-import-node
+ :pos beg
+ :len (- (js2-current-token-end) beg)
+ :module-id (js2-current-token-string)))
+ (t
+ (let* ((import-clause (js2-parse-import-clause))
+ (from-clause (and import-clause (js2-parse-from-clause)))
+ (module-id (when from-clause (js2-from-clause-node-module-id from-clause)))
+ (node (make-js2-import-node
+ :pos beg
+ :len (- (js2-current-token-end) beg)
+ :import import-clause
+ :from from-clause
+ :module-id module-id)))
+ (when import-clause
+ (js2-node-add-children node import-clause))
+ (when from-clause
+ (js2-node-add-children node from-clause))
+ node)))))
+
+(defun js2-parse-import-clause ()
+ "Parse the bindings in an import statement.
+This can take many forms:
+
+ImportedDefaultBinding -> `foo'
+NameSpaceImport -> `* as lib'
+NamedImports -> `{foo as bar, bang}'
+ImportedDefaultBinding , NameSpaceImport -> `foo, * as lib'
+ImportedDefaultBinding , NamedImports -> `foo, {bar, baz as bif}'
+
+Try to match namespace imports and named imports first because nothing can
+come after them. If it is an imported default binding, then it could have named
+imports or a namespace import that follows it.
+"
+ (let* ((beg (js2-current-token-beg))
+ (clause (make-js2-import-clause-node
+ :pos beg))
+ (children (list)))
+ (cond
+ ((js2-match-token js2-MUL)
+ (let ((ns-import (js2-parse-namespace-import)))
+ (when ns-import
+ (let ((name-node (js2-namespace-import-node-name ns-import)))
+ (js2-define-symbol
+ js2-LET (js2-name-node-name name-node) name-node t))
+ (setf (js2-import-clause-node-namespace-import clause) ns-import)
+ (push ns-import children))))
+ ((js2-match-token js2-LC)
+ (let ((imports (js2-parse-export-bindings t)))
+ (setf (js2-import-clause-node-named-imports clause) imports)
+ (dolist (import imports)
+ (push import children)
+ (let ((name-node (js2-export-binding-node-local-name import)))
+ (when name-node
+ (js2-define-symbol
+ js2-LET (js2-name-node-name name-node) name-node t))))))
+ ((= (js2-peek-token) js2-NAME)
+ (let ((binding (js2-maybe-parse-export-binding t)))
+ (let ((node-name (js2-export-binding-node-local-name binding)))
+ (js2-define-symbol js2-LET (js2-name-node-name node-name) node-name t))
+ (setf (js2-import-clause-node-default-binding clause) binding)
+ (push binding children))
+ (when (js2-match-token js2-COMMA)
+ (cond
+ ((js2-match-token js2-MUL)
+ (let ((ns-import (js2-parse-namespace-import)))
+ (let ((name-node (js2-namespace-import-node-name ns-import)))
+ (js2-define-symbol
+ js2-LET (js2-name-node-name name-node) name-node t))
+ (setf (js2-import-clause-node-namespace-import clause) ns-import)
+ (push ns-import children)))
+ ((js2-match-token js2-LC)
+ (let ((imports (js2-parse-export-bindings t)))
+ (setf (js2-import-clause-node-named-imports clause) imports)
+ (dolist (import imports)
+ (push import children)
+ (let ((name-node (js2-export-binding-node-local-name import)))
+ (when name-node
+ (js2-define-symbol
+ js2-LET (js2-name-node-name name-node) name-node t))))))
+ (t (js2-report-error "msg.syntax")))))
+ (t (js2-report-error "msg.mod.declaration.after.import")))
+ (setf (js2-node-len clause) (- (js2-current-token-end) beg))
+ (apply #'js2-node-add-children clause children)
+ clause))
+
+(defun js2-parse-namespace-import ()
+ "Parse a namespace import expression such as `* as bar'.
+The current token must be js2-MUL."
+ (let ((beg (js2-current-token-beg)))
+ (cond
+ ((js2-match-contextual-kwd "as")
+ (when (js2-must-match-prop-name "msg.syntax")
+ (let ((node (make-js2-namespace-import-node
+ :pos beg
+ :len (- (js2-current-token-end) beg)
+ :name (make-js2-name-node
+ :pos (js2-current-token-beg)
+ :len (- (js2-current-token-end)
+ (js2-current-token-beg))
+ :name (js2-current-token-string)))))
+ (js2-node-add-children node (js2-namespace-import-node-name node))
+ node)))
+ (t
+ (js2-unget-token)
+ (js2-report-error "msg.syntax")
+ nil))))
+
+
+(defun js2-parse-from-clause ()
+ "Parse the from clause in an import or export statement.
+E.g., \"from \\='src/lib\\='\"."
+ (if (js2-match-contextual-kwd "from")
+ (let ((beg (js2-current-token-beg)))
+ (cond
+ ((js2-match-token js2-STRING)
+ (make-js2-from-clause-node
+ :pos beg
+ :len (- (js2-current-token-end) beg)
+ :module-id (js2-current-token-string)
+ :metadata-p nil))
+ ((js2-match-token js2-THIS)
+ (when (js2-must-match-name "msg.mod.spec.after.from")
+ (if (equal "module" (js2-current-token-string))
+ (make-js2-from-clause-node
+ :pos beg
+ :len (- (js2-current-token-end) beg)
+ :module-id "this"
+ :metadata-p t)
+ (js2-unget-token)
+ (js2-unget-token)
+ (js2-report-error "msg.mod.spec.after.from")
+ nil)))
+ (t (js2-report-error "msg.mod.spec.after.from") nil)))
+ (js2-report-error "msg.mod.from.after.import.spec.set")
+ nil))
+
+(defun js2-parse-export-bindings (&optional import-p)
+ "Parse a list of export binding expressions such as {}, {foo, bar}, and
+{foo as bar, baz as bang}. The current token must be
+js2-LC. Return a lisp list of js2-export-binding-node"
+ (let ((bindings (list)))
+ (while
+ (let ((binding (js2-maybe-parse-export-binding import-p)))
+ (when binding
+ (push binding bindings))
+ (js2-match-token js2-COMMA)))
+ (when (js2-must-match js2-RC (if import-p
+ "msg.mod.rc.after.import.spec.list"
+ "msg.mod.rc.after.export.spec.list"))
+ (reverse bindings))))
+
+(defun js2-maybe-parse-export-binding (&optional import-p)
+ "Attempt to parse a binding expression found inside an import/export statement.
+This can take the form of either as single js2-NAME token as in `foo' or as in a
+rebinding expression `bar as foo'. If it matches, it will return an instance of
+js2-export-binding-node and consume all the tokens. If it does not match, it
+consumes no tokens."
+ (let ((extern-name (when (js2-match-prop-name) (js2-current-token-string)))
+ (beg (js2-current-token-beg))
+ (extern-name-len (js2-current-token-len))
+ (is-reserved-name (or (= (js2-current-token-type) js2-RESERVED)
+ (aref js2-kwd-tokens (js2-current-token-type)))))
+ (if extern-name
+ (if (js2-match-contextual-kwd "as")
+ (let ((name
+ (or
+ (and (js2-match-token js2-DEFAULT) "default")
+ (and (js2-match-token js2-NAME) (js2-current-token-string)))))
+ (if name
+ (let ((node (make-js2-export-binding-node
+ :pos beg
+ :len (- (js2-current-token-end) beg)
+ :local-name (make-js2-name-node
+ :name name
+ :pos (js2-current-token-beg)
+ :len (js2-current-token-len))
+ :extern-name (make-js2-name-node
+ :name extern-name
+ :pos beg
+ :len extern-name-len))))
+ (js2-node-add-children
+ node
+ (js2-export-binding-node-local-name node)
+ (js2-export-binding-node-extern-name node))
+ (if import-p
+ (js2-set-face (js2-current-token-beg) (js2-current-token-end)
+ 'font-lock-variable-name-face 'record))
+ node)
+ (js2-unget-token)
+ nil))
+ (let* ((name-node (make-js2-name-node
+ :name (js2-current-token-string)
+ :pos (js2-current-token-beg)
+ :len (js2-current-token-len)))
+ (node (make-js2-export-binding-node
+ :pos (js2-current-token-beg)
+ :len (js2-current-token-len)
+ :local-name name-node
+ :extern-name name-node)))
+ (when is-reserved-name
+ (js2-report-error "msg.mod.as.after.reserved.word" extern-name))
+ (js2-node-add-children node name-node)
+ (if import-p
+ (js2-set-face (js2-current-token-beg) (js2-current-token-end)
+ 'font-lock-variable-name-face 'record))
+ node))
+ nil)))
+
+(defun js2-parse-switch ()
+ "Parser for switch-statement. Last matched token must be js2-SWITCH."
+ (let ((pos (js2-current-token-beg))
+ tt pn discriminant has-default case-expr case-node
+ case-pos cases stmt lp)
+ (if (js2-must-match js2-LP "msg.no.paren.switch")
+ (setq lp (js2-current-token-beg)))
+ (setq discriminant (js2-parse-expr)
+ pn (make-js2-switch-node :discriminant discriminant
+ :pos pos
+ :lp (js2-relpos lp pos)))
+ (js2-node-add-children pn discriminant)
+ (js2-enter-switch pn)
+ (unwind-protect
+ (progn
+ (if (js2-must-match js2-RP "msg.no.paren.after.switch")
+ (setf (js2-switch-node-rp pn) (- (js2-current-token-beg) pos)))
+ (js2-must-match js2-LC "msg.no.brace.switch")
+ (catch 'break
+ (while t
+ (setq tt (js2-next-token)
+ case-pos (js2-current-token-beg))
+ (cond
+ ((= tt js2-RC)
+ (setf (js2-node-len pn) (- (js2-current-token-end) pos))
+ (throw 'break nil)) ; done
+ ((= tt js2-CASE)
+ (setq case-expr (js2-parse-expr))
+ (js2-must-match js2-COLON "msg.no.colon.case"))
+ ((= tt js2-DEFAULT)
+ (if has-default
+ (js2-report-error "msg.double.switch.default"))
+ (setq has-default t
+ case-expr nil)
+ (js2-must-match js2-COLON "msg.no.colon.case"))
+ (t
+ (js2-report-error "msg.bad.switch")
+ (throw 'break nil)))
+ (setq case-node (make-js2-case-node :pos case-pos
+ :len (- (js2-current-token-end) case-pos)
+ :expr case-expr))
+ (js2-node-add-children case-node case-expr)
+ (while (and (/= (setq tt (js2-peek-token)) js2-RC)
+ (/= tt js2-CASE)
+ (/= tt js2-DEFAULT)
+ (/= tt js2-EOF))
+ (setf stmt (js2-parse-statement)
+ (js2-node-len case-node) (- (js2-node-end stmt) case-pos))
+ (js2-block-node-push case-node stmt))
+ (push case-node cases)))
+ ;; add cases last, as pushing reverses the order to be correct
+ (dolist (kid cases)
+ (js2-node-add-children pn kid)
+ (push kid (js2-switch-node-cases pn)))
+ pn) ; return value
+ (js2-exit-switch))))
+
+(defun js2-parse-while ()
+ "Parser for while-statement. Last matched token must be js2-WHILE."
+ (let ((pos (js2-current-token-beg))
+ (pn (make-js2-while-node))
+ cond body)
+ (js2-enter-loop pn)
+ (unwind-protect
+ (progn
+ (setf cond (js2-parse-condition)
+ (js2-while-node-condition pn) (car cond)
+ body (js2-parse-statement)
+ (js2-while-node-body pn) body
+ (js2-node-len pn) (- (js2-node-end body) pos)
+ (js2-while-node-lp pn) (js2-relpos (cl-second cond) pos)
+ (js2-while-node-rp pn) (js2-relpos (cl-third cond) pos))
+ (js2-node-add-children pn body (car cond)))
+ (js2-exit-loop))
+ pn))
+
+(defun js2-parse-do ()
+ "Parser for do-statement. Last matched token must be js2-DO."
+ (let ((pos (js2-current-token-beg))
+ (pn (make-js2-do-node))
+ cond body end)
+ (js2-enter-loop pn)
+ (unwind-protect
+ (progn
+ (setq body (js2-parse-statement))
+ (js2-must-match js2-WHILE "msg.no.while.do")
+ (setf (js2-do-node-while-pos pn) (- (js2-current-token-beg) pos)
+ cond (js2-parse-condition)
+ (js2-do-node-condition pn) (car cond)
+ (js2-do-node-body pn) body
+ end js2-ts-cursor
+ (js2-do-node-lp pn) (js2-relpos (cl-second cond) pos)
+ (js2-do-node-rp pn) (js2-relpos (cl-third cond) pos))
+ (js2-node-add-children pn (car cond) body))
+ (js2-exit-loop))
+ ;; Always auto-insert semicolon to follow SpiderMonkey:
+ ;; It is required by ECMAScript but is ignored by the rest of
+ ;; world; see bug 238945
+ (if (js2-match-token js2-SEMI)
+ (setq end js2-ts-cursor))
+ (setf (js2-node-len pn) (- end pos))
+ pn))
+
+(defun js2-parse-export ()
+ "Parse an export statement.
+The Last matched token must be js2-EXPORT. Currently, the `default' and `expr'
+expressions should only be either hoistable expressions (function or generator)
+or assignment expressions, but there is no checking to enforce that and so it
+will parse without error a small subset of
+invalid export statements."
+ (unless (js2-ast-root-p js2-current-scope)
+ (js2-report-error "msg.mod.export.decl.at.top.level"))
+ (let ((beg (js2-current-token-beg))
+ (children (list))
+ exports-list from-clause declaration default)
+ (cond
+ ((js2-match-token js2-MUL)
+ (setq from-clause (js2-parse-from-clause))
+ (when from-clause
+ (push from-clause children)))
+ ((js2-match-token js2-LC)
+ (setq exports-list (js2-parse-export-bindings))
+ (when exports-list
+ (dolist (export exports-list)
+ (push export children)))
+ (when (js2-match-contextual-kwd "from")
+ (js2-unget-token)
+ (setq from-clause (js2-parse-from-clause))))
+ ((js2-match-token js2-DEFAULT)
+ (setq default (cond ((js2-match-token js2-CLASS)
+ (if (eq (js2-peek-token) js2-NAME)
+ (js2-parse-class-stmt)
+ (js2-parse-class-expr)))
+ ((js2-match-token js2-NAME)
+ (if (js2-match-async-function)
+ (if (eq (js2-peek-token) js2-NAME)
+ (js2-parse-async-function-stmt)
+ (js2-parse-function-expr t))
+ (js2-unget-token)
+ (js2-parse-expr)))
+ ((js2-match-token js2-FUNCTION)
+ (if (eq (js2-peek-token) js2-NAME)
+ (js2-parse-function-stmt)
+ (js2-parse-function-expr)))
+ (t (js2-parse-expr)))))
+ ((or (js2-match-token js2-VAR) (js2-match-token js2-CONST) (js2-match-token js2-LET))
+ (setq declaration (js2-parse-variables (js2-current-token-type) (js2-current-token-beg))))
+ ((js2-match-token js2-CLASS)
+ (setq declaration (js2-parse-class-stmt)))
+ ((js2-match-token js2-NAME)
+ (setq declaration
+ (if (js2-match-async-function)
+ (js2-parse-async-function-stmt)
+ (js2-unget-token)
+ (js2-parse-expr))))
+ ((js2-match-token js2-FUNCTION)
+ (setq declaration (js2-parse-function-stmt)))
+ (t
+ (setq declaration (js2-parse-expr))))
+ (when from-clause
+ (push from-clause children))
+ (when declaration
+ (push declaration children)
+ (when (not (or (js2-function-node-p declaration)
+ (js2-class-node-p declaration)))
+ (js2-auto-insert-semicolon declaration)))
+ (when default
+ (push default children)
+ (when (not (or (js2-function-node-p default)
+ (js2-class-node-p default)))
+ (js2-auto-insert-semicolon default)))
+ (let ((node (make-js2-export-node
+ :pos beg
+ :len (- (js2-current-token-end) beg)
+ :exports-list exports-list
+ :from-clause from-clause
+ :declaration declaration
+ :default default)))
+ (apply #'js2-node-add-children node children)
+ node)))
+
+(defun js2-parse-for ()
+ "Parse a for, for-in, for each-in or for await-in statement.
+Last matched token must be js2-FOR."
+ (let ((for-pos (js2-current-token-beg))
+ (tmp-scope (make-js2-scope))
+ pn is-for-each is-for-in-or-of is-for-of is-for-await
+ in-pos each-pos tmp-pos await-pos
+ init ; Node init is also foo in 'foo in object'.
+ cond ; Node cond is also object in 'foo in object'.
+ incr ; 3rd section of for-loop initializer.
+ body tt lp rp)
+ (when (js2-match-token js2-NAME)
+ (cond
+ ;; See if this is a for each () instead of just a for ()
+ ((string= "each" (js2-current-token-string))
+ (progn
+ (setq is-for-each t
+ each-pos (- (js2-current-token-beg) for-pos)) ; relative
+ (js2-record-face 'font-lock-keyword-face)))
+ ;; See if this is a for await () instead of just a for ()
+ ((string= "await" (js2-current-token-string))
+ (progn
+ (setq is-for-await t
+ await-pos (- (js2-current-token-beg) for-pos)) ; relative
+ (js2-record-face 'font-lock-keyword-face)))
+ (t (js2-report-error "msg.no.paren.for"))))
+ (if (js2-must-match js2-LP "msg.no.paren.for")
+ (setq lp (- (js2-current-token-beg) for-pos)))
+ (setq tt (js2-get-token))
+ ;; Capture identifiers inside parens. We can't create the node
+ ;; (and use it as the current scope) until we know its type.
+ (js2-push-scope tmp-scope)
+ (unwind-protect
+ (progn
+ ;; parse init clause
+ (let ((js2-in-for-init t)) ; set as dynamic variable
+ (cond
+ ((= tt js2-SEMI)
+ (js2-unget-token)
+ (setq init (make-js2-empty-expr-node)))
+ ((or (= tt js2-VAR) (= tt js2-LET) (= tt js2-CONST))
+ (setq init (js2-parse-variables tt (js2-current-token-beg))))
+ (t
+ (js2-unget-token)
+ (setq init (js2-parse-expr)))))
+ (if (or (js2-match-token js2-IN)
+ (and (>= js2-language-version 200)
+ (js2-match-contextual-kwd "of")
+ (setq is-for-of t)))
+ (setq is-for-in-or-of t
+ in-pos (- (js2-current-token-beg) for-pos)
+ ;; scope of iteration target object is not the scope we've created above.
+ ;; stash current scope temporary.
+ cond (let ((js2-current-scope (js2-scope-parent-scope js2-current-scope)))
+ (js2-parse-expr))) ; object over which we're iterating
+ ;; else ordinary for loop - parse cond and incr
+ (js2-must-match js2-SEMI "msg.no.semi.for")
+ (setq cond (if (= (js2-peek-token) js2-SEMI)
+ (make-js2-empty-expr-node) ; no loop condition
+ (js2-parse-expr)))
+ (js2-must-match js2-SEMI "msg.no.semi.for.cond")
+ (setq tmp-pos (js2-current-token-end)
+ incr (if (= (js2-peek-token) js2-RP)
+ (make-js2-empty-expr-node :pos tmp-pos)
+ (js2-parse-expr)))))
+ (js2-pop-scope))
+ (if (js2-must-match js2-RP "msg.no.paren.for.ctrl")
+ (setq rp (- (js2-current-token-beg) for-pos)))
+ (if (not is-for-in-or-of)
+ (setq pn (make-js2-for-node :init init
+ :condition cond
+ :update incr
+ :lp lp
+ :rp rp))
+ ;; cond could be null if 'in obj' got eaten by the init node.
+ (if (js2-infix-node-p init)
+ ;; it was (foo in bar) instead of (var foo in bar)
+ (setq cond (js2-infix-node-right init)
+ init (js2-infix-node-left init))
+ (if (and (js2-var-decl-node-p init)
+ (> (length (js2-var-decl-node-kids init)) 1))
+ (js2-report-error "msg.mult.index")))
+ (setq pn (make-js2-for-in-node :iterator init
+ :object cond
+ :in-pos in-pos
+ :foreach-p is-for-each
+ :each-pos each-pos
+ :forawait-p is-for-await
+ :await-pos await-pos
+ :forof-p is-for-of
+ :lp lp
+ :rp rp)))
+ ;; Transplant the declarations.
+ (setf (js2-scope-symbol-table pn)
+ (js2-scope-symbol-table tmp-scope))
+ (unwind-protect
+ (progn
+ (js2-enter-loop pn)
+ ;; We have to parse the body -after- creating the loop node,
+ ;; so that the loop node appears in the js2-loop-set, allowing
+ ;; break/continue statements to find the enclosing loop.
+ (setf body (js2-parse-statement)
+ (js2-loop-node-body pn) body
+ (js2-node-pos pn) for-pos
+ (js2-node-len pn) (- (js2-node-end body) for-pos))
+ (js2-node-add-children pn init cond incr body))
+ ;; finally
+ (js2-exit-loop))
+ pn))
+
+(defun js2-parse-try ()
+ "Parse a try statement. Last matched token must be js2-TRY."
+ (let ((try-pos (js2-current-token-beg))
+ try-end
+ try-block
+ catch-blocks
+ finally-block
+ saw-default-catch
+ peek)
+ (if (/= (js2-peek-token) js2-LC)
+ (js2-report-error "msg.no.brace.try"))
+ (setq try-block (js2-parse-statement)
+ try-end (js2-node-end try-block)
+ peek (js2-peek-token))
+ (cond
+ ((= peek js2-CATCH)
+ (while (js2-match-token js2-CATCH)
+ (let* ((catch-pos (js2-current-token-beg))
+ (catch-node (make-js2-catch-node :pos catch-pos))
+ param
+ guard-kwd
+ catch-cond
+ lp rp)
+ (if saw-default-catch
+ (js2-report-error "msg.catch.unreachable"))
+ (js2-push-scope catch-node)
+ (when (js2-match-token js2-LP)
+ (setq lp (- (js2-current-token-beg) catch-pos))
+ (let ((tt (js2-peek-token)))
+ (cond
+ ;; Destructuring pattern:
+ ;; catch ({ message, file }) { ... }
+ ((or (= tt js2-LB) (= tt js2-LC))
+ (js2-get-token)
+ (setq param (js2-parse-destruct-primary-expr))
+ (js2-define-destruct-symbols param js2-LET nil))
+ ;; Simple name.
+ (t
+ (js2-must-match-name "msg.bad.catchcond")
+ (setq param (js2-create-name-node))
+ (js2-define-symbol js2-LET (js2-current-token-string) param)
+ (js2-check-strict-identifier param))))
+ ;; Catch condition.
+ (if (js2-match-token js2-IF)
+ (setq guard-kwd (- (js2-current-token-beg) catch-pos)
+ catch-cond (js2-parse-expr))
+ (setq saw-default-catch t))
+ (if (js2-must-match js2-RP "msg.bad.catchcond")
+ (setq rp (- (js2-current-token-beg) catch-pos))))
+ (js2-must-match js2-LC "msg.no.brace.catchblock")
+ (js2-parse-statements catch-node)
+ (if (js2-must-match js2-RC "msg.no.brace.after.body")
+ (setq try-end (js2-current-token-end)))
+ (js2-pop-scope)
+ (setf (js2-node-len catch-node) (- try-end catch-pos)
+ (js2-catch-node-param catch-node) param
+ (js2-catch-node-guard-expr catch-node) catch-cond
+ (js2-catch-node-guard-kwd catch-node) guard-kwd
+ (js2-catch-node-lp catch-node) lp
+ (js2-catch-node-rp catch-node) rp)
+ (js2-node-add-children catch-node param catch-cond)
+ (push catch-node catch-blocks))))
+ ((/= peek js2-FINALLY)
+ (js2-must-match js2-FINALLY "msg.try.no.catchfinally"
+ (js2-node-pos try-block)
+ (- (setq try-end (js2-node-end try-block))
+ (js2-node-pos try-block)))))
+ (when (js2-match-token js2-FINALLY)
+ (let ((finally-pos (js2-current-token-beg))
+ (block (js2-parse-statement)))
+ (setq try-end (js2-node-end block)
+ finally-block (make-js2-finally-node :pos finally-pos
+ :len (- try-end finally-pos)
+ :body block))
+ (js2-node-add-children finally-block block)))
+ (let ((pn (make-js2-try-node :pos try-pos
+ :len (- try-end try-pos)
+ :try-block try-block
+ :finally-block finally-block)))
+ (js2-node-add-children pn try-block finally-block)
+ ;; Push them onto the try-node, which reverses and corrects their order.
+ (dolist (cb catch-blocks)
+ (js2-node-add-children pn cb)
+ (push cb (js2-try-node-catch-clauses pn)))
+ pn)))
+
+(defun js2-parse-throw ()
+ "Parser for throw-statement. Last matched token must be js2-THROW."
+ (let ((pos (js2-current-token-beg))
+ expr pn)
+ (if (= (js2-peek-token-or-eol) js2-EOL)
+ ;; ECMAScript does not allow new lines before throw expression,
+ ;; see bug 256617
+ (js2-report-error "msg.bad.throw.eol"))
+ (setq expr (js2-parse-expr)
+ pn (make-js2-throw-node :pos pos
+ :len (- (js2-node-end expr) pos)
+ :expr expr))
+ (js2-node-add-children pn expr)
+ pn))
+
+(defun js2-match-jump-label-name (label-name)
+ "If break/continue specified a label, return that label's labeled stmt.
+Returns the corresponding `js2-labeled-stmt-node', or if LABEL-NAME
+does not match an existing label, reports an error and returns nil."
+ (let ((bundle (cdr (assoc label-name js2-label-set))))
+ (if (null bundle)
+ (js2-report-error "msg.undef.label"))
+ bundle))
+
+(defun js2-parse-break ()
+ "Parser for break-statement. Last matched token must be js2-BREAK."
+ (let ((pos (js2-current-token-beg))
+ (end (js2-current-token-end))
+ break-target ; statement to break from
+ break-label ; in "break foo", name-node representing the foo
+ labels ; matching labeled statement to break to
+ pn)
+ (when (eq (js2-peek-token-or-eol) js2-NAME)
+ (js2-get-token)
+ (setq break-label (js2-create-name-node)
+ end (js2-node-end break-label)
+ ;; matchJumpLabelName only matches if there is one
+ labels (js2-match-jump-label-name (js2-current-token-string))
+ break-target (if labels (car (js2-labeled-stmt-node-labels labels)))))
+ (unless (or break-target break-label)
+ ;; no break target specified - try for innermost enclosing loop/switch
+ (if (null js2-loop-and-switch-set)
+ (unless break-label
+ (js2-report-error "msg.bad.break" nil pos (length "break")))
+ (setq break-target (car js2-loop-and-switch-set))))
+ (setq pn (make-js2-break-node :pos pos
+ :len (- end pos)
+ :label break-label
+ :target break-target))
+ (js2-node-add-children pn break-label) ; but not break-target
+ pn))
+
+(defun js2-parse-continue ()
+ "Parser for continue-statement. Last matched token must be js2-CONTINUE."
+ (let ((pos (js2-current-token-beg))
+ (end (js2-current-token-end))
+ label ; optional user-specified label, a `js2-name-node'
+ labels ; current matching labeled stmt, if any
+ target ; the `js2-loop-node' target of this continue stmt
+ pn)
+ (when (= (js2-peek-token-or-eol) js2-NAME)
+ (js2-get-token)
+ (setq label (js2-create-name-node)
+ end (js2-node-end label)
+ ;; matchJumpLabelName only matches if there is one
+ labels (js2-match-jump-label-name (js2-current-token-string))))
+ (cond
+ ((null labels) ; no current label to go to
+ (if (null js2-loop-set) ; no loop to continue to
+ (js2-report-error "msg.continue.outside" nil pos
+ (length "continue"))
+ (setq target (car js2-loop-set)))) ; innermost enclosing loop
+ (t
+ (if (js2-loop-node-p (js2-labeled-stmt-node-stmt labels))
+ (setq target (js2-labeled-stmt-node-stmt labels))
+ (js2-report-error "msg.continue.nonloop" nil pos (- end pos)))))
+ (setq pn (make-js2-continue-node :pos pos
+ :len (- end pos)
+ :label label
+ :target target))
+ (js2-node-add-children pn label) ; but not target - it's not our child
+ pn))
+
+(defun js2-parse-with ()
+ "Parser for with-statement. Last matched token must be js2-WITH."
+ (when js2-in-use-strict-directive
+ (js2-report-error "msg.no.with.strict"))
+ (let ((pos (js2-current-token-beg))
+ obj body pn lp rp)
+ (if (js2-must-match js2-LP "msg.no.paren.with")
+ (setq lp (js2-current-token-beg)))
+ (setq obj (js2-parse-expr))
+ (if (js2-must-match js2-RP "msg.no.paren.after.with")
+ (setq rp (js2-current-token-beg)))
+ (let ((js2-nesting-of-with (1+ js2-nesting-of-with)))
+ (setq body (js2-parse-statement)))
+ (setq pn (make-js2-with-node :pos pos
+ :len (- (js2-node-end body) pos)
+ :object obj
+ :body body
+ :lp (js2-relpos lp pos)
+ :rp (js2-relpos rp pos)))
+ (js2-node-add-children pn obj body)
+ pn))
+
+(defun js2-parse-const-var ()
+ "Parser for var- or const-statement.
+Last matched token must be js2-CONST or js2-VAR."
+ (let ((tt (js2-current-token-type))
+ (pos (js2-current-token-beg))
+ expr pn)
+ (setq expr (js2-parse-variables tt (js2-current-token-beg))
+ pn (make-js2-expr-stmt-node :pos pos
+ :len (- (js2-node-end expr) pos)
+ :expr expr))
+ (js2-node-add-children pn expr)
+ pn))
+
+(defun js2-wrap-with-expr-stmt (pos expr &optional add-child)
+ (let ((pn (make-js2-expr-stmt-node :pos pos
+ :len (js2-node-len expr)
+ :type (if (js2-inside-function)
+ js2-EXPR_VOID
+ js2-EXPR_RESULT)
+ :expr expr)))
+ (if add-child
+ (js2-node-add-children pn expr))
+ pn))
+
+(defun js2-parse-let-stmt ()
+ "Parser for let-statement. Last matched token must be js2-LET."
+ (let ((pos (js2-current-token-beg))
+ expr pn)
+ (if (= (js2-peek-token) js2-LP)
+ ;; let expression in statement context
+ (setq expr (js2-parse-let pos 'statement)
+ pn (js2-wrap-with-expr-stmt pos expr t))
+ ;; else we're looking at a statement like let x=6, y=7;
+ (setf expr (js2-parse-variables js2-LET pos)
+ pn (js2-wrap-with-expr-stmt pos expr t)
+ (js2-node-type pn) js2-EXPR_RESULT))
+ pn))
+
+(defun js2-parse-ret-yield ()
+ (js2-parse-return-or-yield (js2-current-token-type) nil))
+
+(defconst js2-parse-return-stmt-enders
+ (list js2-SEMI js2-RC js2-EOF js2-EOL js2-ERROR js2-RB js2-RP))
+
+(defsubst js2-now-all-set (before after mask)
+ "Return whether or not the bits in the mask have changed to all set.
+BEFORE is bits before change, AFTER is bits after change, and MASK is
+the mask for bits. Returns t if all the bits in the mask are set in AFTER
+but not BEFORE."
+ (and (/= (logand before mask) mask)
+ (= (logand after mask) mask)))
+
+(defun js2-parse-return-or-yield (tt expr-context)
+ (let* ((pos (js2-current-token-beg))
+ (end (js2-current-token-end))
+ (before js2-end-flags)
+ (inside-function (js2-inside-function))
+ (gen-type (and inside-function (js2-function-node-generator-type
+ js2-current-script-or-fn)))
+ e ret name yield-star-p)
+ (unless inside-function
+ (js2-report-error (if (eq tt js2-RETURN)
+ "msg.bad.return"
+ "msg.bad.yield")))
+ (when (and inside-function
+ (eq gen-type 'STAR)
+ (js2-match-token js2-MUL))
+ (setq yield-star-p t))
+ ;; This is ugly, but we don't want to require a semicolon.
+ (unless (memq (js2-peek-token-or-eol) js2-parse-return-stmt-enders)
+ (setq e (if (eq gen-type 'STAR)
+ (js2-parse-assign-expr)
+ (js2-parse-expr))
+ end (js2-node-end e)))
+ (cond
+ ((eq tt js2-RETURN)
+ (js2-set-flag js2-end-flags (if (null e)
+ js2-end-returns
+ js2-end-returns-value))
+ (setq ret (make-js2-return-node :pos pos
+ :len (- end pos)
+ :retval e))
+ (js2-node-add-children ret e)
+ ;; See if we need a strict mode warning.
+ ;; TODO: The analysis done by `js2-has-consistent-return-usage' is
+ ;; more thorough and accurate than this before/after flag check.
+ ;; E.g. if there's a finally-block that always returns, we shouldn't
+ ;; show a warning generated by inconsistent returns in the catch blocks.
+ ;; Basically `js2-has-consistent-return-usage' needs to keep more state,
+ ;; so we know which returns/yields to highlight, and we should get rid of
+ ;; all the checking in `js2-parse-return-or-yield'.
+ (if (and js2-strict-inconsistent-return-warning
+ (js2-now-all-set before js2-end-flags
+ (logior js2-end-returns js2-end-returns-value)))
+ (js2-add-strict-warning "msg.return.inconsistent" nil pos end)))
+ ((eq gen-type 'COMPREHENSION)
+ ;; FIXME: We should probably switch to saving and using lastYieldOffset,
+ ;; like SpiderMonkey does.
+ (js2-report-error "msg.syntax" nil pos 5))
+ (t
+ (setq ret (make-js2-yield-node :pos pos
+ :len (- end pos)
+ :value e
+ :star-p yield-star-p))
+ (js2-node-add-children ret e)
+ (unless expr-context
+ (setq e ret
+ ret (js2-wrap-with-expr-stmt pos e t))
+ (js2-set-requires-activation)
+ (js2-set-is-generator))))
+ ;; see if we are mixing yields and value returns.
+ (when (and inside-function
+ (js2-flag-set-p js2-end-flags js2-end-returns-value)
+ (eq (js2-function-node-generator-type js2-current-script-or-fn)
+ 'LEGACY))
+ (setq name (js2-function-name js2-current-script-or-fn))
+ (if (zerop (length name))
+ (js2-report-error "msg.anon.generator.returns" nil pos (- end pos))
+ (js2-report-error "msg.generator.returns" name pos (- end pos))))
+ ret))
+
+(defun js2-parse-debugger ()
+ (make-js2-keyword-node :type js2-DEBUGGER))
+
+(defun js2-parse-block ()
+ "Parser for a curly-delimited statement block.
+Last token matched must be `js2-LC'."
+ (let ((pos (js2-current-token-beg))
+ (pn (make-js2-scope)))
+ (js2-push-scope pn)
+ (unwind-protect
+ (progn
+ (js2-parse-statements pn)
+ (js2-must-match js2-RC "msg.no.brace.block")
+ (setf (js2-node-len pn) (- (js2-current-token-end) pos)))
+ (js2-pop-scope))
+ pn))
+
+;; For `js2-ERROR' too, to have a node for error recovery to work on.
+(defun js2-parse-semi ()
+ "Parse a statement or handle an error.
+Current token type is `js2-SEMI' or `js2-ERROR'."
+ (let ((tt (js2-current-token-type)) pos len)
+ (if (eq tt js2-SEMI)
+ (make-js2-empty-expr-node :len 1)
+ (setq pos (js2-current-token-beg)
+ len (- (js2-current-token-end) pos))
+ (js2-report-error "msg.syntax" nil pos len)
+ (make-js2-error-node :pos pos :len len))))
+
+(defun js2-parse-default-xml-namespace ()
+ "Parse a `default xml namespace = <expr>' e4x statement."
+ (let ((pos (js2-current-token-beg))
+ end len expr unary)
+ (js2-must-have-xml)
+ (js2-set-requires-activation)
+ (setq len (- js2-ts-cursor pos))
+ (unless (and (js2-match-token js2-NAME)
+ (string= (js2-current-token-string) "xml"))
+ (js2-report-error "msg.bad.namespace" nil pos len))
+ (unless (and (js2-match-token js2-NAME)
+ (string= (js2-current-token-string) "namespace"))
+ (js2-report-error "msg.bad.namespace" nil pos len))
+ (unless (js2-match-token js2-ASSIGN)
+ (js2-report-error "msg.bad.namespace" nil pos len))
+ (setq expr (js2-parse-expr)
+ end (js2-node-end expr)
+ unary (make-js2-unary-node :type js2-DEFAULTNAMESPACE
+ :pos pos
+ :len (- end pos)
+ :operand expr))
+ (js2-node-add-children unary expr)
+ (make-js2-expr-stmt-node :pos pos
+ :len (- end pos)
+ :expr unary)))
+
+(defun js2-record-label (label bundle)
+ ;; current token should be colon that `js2-parse-primary-expr' left untouched
+ (js2-get-token)
+ (let ((name (js2-label-node-name label))
+ labeled-stmt
+ dup)
+ (when (setq labeled-stmt (cdr (assoc name js2-label-set)))
+ ;; flag both labels if possible when used in editing mode
+ (if (and js2-parse-ide-mode
+ (setq dup (js2-get-label-by-name labeled-stmt name)))
+ (js2-report-error "msg.dup.label" nil
+ (js2-node-abs-pos dup) (js2-node-len dup)))
+ (js2-report-error "msg.dup.label" nil
+ (js2-node-pos label) (js2-node-len label)))
+ (js2-labeled-stmt-node-add-label bundle label)
+ (js2-node-add-children bundle label)
+ ;; Add one reference to the bundle per label in `js2-label-set'
+ (push (cons name bundle) js2-label-set)))
+
+(defun js2-parse-name-or-label ()
+ "Parser for identifier or label. Last token matched must be js2-NAME.
+Called when we found a name in a statement context. If it's a label, we gather
+up any following labels and the next non-label statement into a
+`js2-labeled-stmt-node' bundle and return that. Otherwise we parse an
+expression and return it wrapped in a `js2-expr-stmt-node'."
+ (let ((pos (js2-current-token-beg))
+ expr stmt bundle
+ (continue t))
+ ;; set check for label and call down to `js2-parse-primary-expr'
+ (setq expr (js2-maybe-parse-label))
+ (if (null expr)
+ ;; Parse the non-label expression and wrap with expression stmt.
+ (js2-wrap-with-expr-stmt pos (js2-parse-expr) t)
+ ;; else parsed a label
+ (setq bundle (make-js2-labeled-stmt-node :pos pos))
+ (js2-record-label expr bundle)
+ ;; look for more labels
+ (while (and continue (= (js2-get-token) js2-NAME))
+ (if (setq expr (js2-maybe-parse-label))
+ (js2-record-label expr bundle)
+ (setq expr (js2-parse-expr)
+ stmt (js2-wrap-with-expr-stmt (js2-node-pos expr) expr t)
+ continue nil)
+ (js2-auto-insert-semicolon stmt)))
+ ;; no more labels; now parse the labeled statement
+ (unwind-protect
+ (unless stmt
+ (let ((js2-labeled-stmt bundle)) ; bind dynamically
+ (js2-unget-token)
+ (setq stmt (js2-statement-helper))))
+ ;; remove the labels for this statement from the global set
+ (dolist (label (js2-labeled-stmt-node-labels bundle))
+ (setq js2-label-set (remove label js2-label-set))))
+ (setf (js2-labeled-stmt-node-stmt bundle) stmt
+ (js2-node-len bundle) (- (js2-node-end stmt) pos))
+ (js2-node-add-children bundle stmt)
+ bundle)))
+
+(defun js2-maybe-parse-label ()
+ (cl-assert (= (js2-current-token-type) js2-NAME))
+ (let (label-pos
+ (next-tt (js2-get-token))
+ (label-end (js2-current-token-end)))
+ ;; Do not consume colon, it is used as unwind indicator
+ ;; to return to statementHelper.
+ (js2-unget-token)
+ (if (= next-tt js2-COLON)
+ (prog2
+ (setq label-pos (js2-current-token-beg))
+ (make-js2-label-node :pos label-pos
+ :len (- label-end label-pos)
+ :name (js2-current-token-string))
+ (js2-set-face label-pos
+ label-end
+ 'font-lock-variable-name-face 'record))
+ ;; Backtrack from the name token, too.
+ (js2-unget-token)
+ nil)))
+
+(defun js2-parse-expr-stmt ()
+ "Default parser in statement context, if no recognized statement found."
+ (js2-wrap-with-expr-stmt (js2-current-token-beg)
+ (progn
+ (js2-unget-token)
+ (js2-parse-expr)) t))
+
+(defun js2-parse-variables (decl-type pos)
+ "Parse a comma-separated list of variable declarations.
+Could be a `var', `const' or `let' expression, possibly in a for-loop initializer.
+
+DECL-TYPE is a token value: either VAR, CONST, or LET depending on context.
+For `var' or `const', the keyword should be the token last scanned.
+
+POS is the position where the node should start. It's sometimes the
+var/const/let keyword, and other times the beginning of the first token
+in the first variable declaration.
+
+Returns the parsed `js2-var-decl-node' expression node."
+ (let* ((result (make-js2-var-decl-node :decl-type decl-type
+ :pos pos))
+ destructuring kid-pos tt init name end nbeg nend vi
+ (continue t))
+ ;; Example:
+ ;; var foo = {a: 1, b: 2}, bar = [3, 4];
+ ;; var {b: s2, a: s1} = foo, x = 6, y, [s3, s4] = bar;
+ ;; var {a, b} = baz;
+ (while continue
+ (setq destructuring nil
+ name nil
+ tt (js2-get-token)
+ kid-pos (js2-current-token-beg)
+ end (js2-current-token-end)
+ init nil)
+ (if (or (= tt js2-LB) (= tt js2-LC))
+ ;; Destructuring assignment, e.g., var [a, b] = ...
+ (setq destructuring (js2-parse-destruct-primary-expr)
+ end (js2-node-end destructuring))
+ ;; Simple variable name
+ (js2-unget-token)
+ (when (js2-must-match-name "msg.bad.var")
+ (setq name (js2-create-name-node)
+ nbeg (js2-current-token-beg)
+ nend (js2-current-token-end)
+ end nend)
+ (js2-define-symbol decl-type (js2-current-token-string) name js2-in-for-init)
+ (js2-check-strict-identifier name)))
+ (when (js2-match-token js2-ASSIGN)
+ (setq init (js2-parse-assign-expr)
+ end (js2-node-end init))
+ (js2-record-imenu-functions init name))
+ (when name
+ (js2-set-face nbeg nend (if (js2-function-node-p init)
+ 'font-lock-function-name-face
+ 'font-lock-variable-name-face)
+ 'record))
+ (setq vi (make-js2-var-init-node :pos kid-pos
+ :len (- end kid-pos)
+ :type decl-type))
+ (if destructuring
+ (progn
+ (if (and (null init) (not js2-in-for-init))
+ (js2-report-error "msg.destruct.assign.no.init"))
+ (js2-define-destruct-symbols destructuring
+ decl-type
+ 'font-lock-variable-name-face)
+ (setf (js2-var-init-node-target vi) destructuring))
+ (setf (js2-var-init-node-target vi) name))
+ (setf (js2-var-init-node-initializer vi) init)
+ (js2-node-add-children vi name destructuring init)
+ (js2-block-node-push result vi)
+ (unless (js2-match-token js2-COMMA)
+ (setq continue nil)))
+ (setf (js2-node-len result) (- end pos))
+ result))
+
+(defun js2-parse-let (pos &optional stmt-p)
+ "Parse a let expression or statement.
+A let-expression is of the form `let (vars) expr'.
+A let-statement is of the form `let (vars) {statements}'.
+The third form of let is a variable declaration list, handled
+by `js2-parse-variables'."
+ (let ((pn (make-js2-let-node :pos pos))
+ beg vars body)
+ (if (js2-must-match js2-LP "msg.no.paren.after.let")
+ (setf (js2-let-node-lp pn) (- (js2-current-token-beg) pos)))
+ (js2-push-scope pn)
+ (unwind-protect
+ (progn
+ (setq vars (js2-parse-variables js2-LET (js2-current-token-beg)))
+ (if (js2-must-match js2-RP "msg.no.paren.let")
+ (setf (js2-let-node-rp pn) (- (js2-current-token-beg) pos)))
+ (if (and stmt-p (js2-match-token js2-LC))
+ ;; let statement
+ (progn
+ (setf beg (js2-current-token-beg) ; position stmt at LC
+ body (js2-parse-statements))
+ (js2-must-match js2-RC "msg.no.curly.let")
+ (setf (js2-node-len body) (- (js2-current-token-end) beg)
+ (js2-node-len pn) (- (js2-current-token-end) pos)
+ (js2-let-node-body pn) body
+ (js2-node-type pn) js2-LET))
+ ;; let expression
+ (setf body (js2-parse-expr)
+ (js2-node-len pn) (- (js2-node-end body) pos)
+ (js2-let-node-body pn) body))
+ (setf (js2-let-node-vars pn) vars)
+ (js2-node-add-children pn vars body))
+ (js2-pop-scope))
+ pn))
+
+(defun js2-define-new-symbol (decl-type name node &optional scope)
+ (js2-scope-put-symbol (or scope js2-current-scope)
+ name
+ (make-js2-symbol decl-type name node)))
+
+(defun js2-define-symbol (decl-type name &optional node ignore-not-in-block)
+ "Define a symbol in the current scope.
+If NODE is non-nil, it is the AST node associated with the symbol."
+ (let* ((defining-scope (js2-get-defining-scope js2-current-scope name))
+ (symbol (if defining-scope
+ (js2-scope-get-symbol defining-scope name)))
+ (sdt (if symbol (js2-symbol-decl-type symbol) -1))
+ (pos (if node (js2-node-abs-pos node)))
+ (len (if node (js2-node-len node))))
+ (cond
+ ((and symbol ; already defined in this block
+ (or (= sdt js2-LET)
+ (= sdt js2-CONST))
+ (eq defining-scope js2-current-scope))
+ (js2-report-error
+ (cond
+ ((= sdt js2-CONST) "msg.const.redecl")
+ ((= sdt js2-LET) "msg.let.redecl")
+ ((= sdt js2-VAR) "msg.var.redecl")
+ ((= sdt js2-FUNCTION) "msg.function.redecl")
+ (t "msg.parm.redecl"))
+ name pos len))
+ ((or (= decl-type js2-LET)
+ (= decl-type js2-CONST))
+ (if (and (= decl-type js2-LET)
+ (not ignore-not-in-block)
+ (or (= (js2-node-type js2-current-scope) js2-IF)
+ (js2-loop-node-p js2-current-scope)))
+ (js2-report-error "msg.let.decl.not.in.block")
+ (js2-define-new-symbol decl-type name node)))
+ ((or (= decl-type js2-VAR)
+ (= decl-type js2-FUNCTION))
+ (if symbol
+ (if (and js2-strict-var-redeclaration-warning (= sdt js2-VAR))
+ (js2-add-strict-warning "msg.var.redecl" name)
+ (if (and js2-strict-var-hides-function-arg-warning (= sdt js2-LP))
+ (js2-add-strict-warning "msg.var.hides.arg" name)))
+ (js2-define-new-symbol decl-type name node
+ js2-current-script-or-fn)))
+ ((= decl-type js2-LP)
+ (if symbol
+ ;; must be duplicate parameter. Second parameter hides the
+ ;; first, so go ahead and add the second pararameter
+ (js2-report-warning "msg.dup.parms" name))
+ (js2-define-new-symbol decl-type name node))
+ (t (js2-code-bug)))))
+
+(defun js2-parse-paren-expr-or-generator-comp ()
+ (let ((px-pos (js2-current-token-beg)))
+ (cond
+ ((and (>= js2-language-version 200)
+ (js2-match-token js2-FOR))
+ (js2-parse-generator-comp px-pos))
+ ((and (>= js2-language-version 200)
+ (js2-match-token js2-RP))
+ ;; Not valid expression syntax, but this is valid in an arrow
+ ;; function with no params: () => body.
+ (if (eq (js2-peek-token) js2-ARROW)
+ ;; Return whatever, it will hopefully be rewinded and
+ ;; reparsed when we reach the =>.
+ (make-js2-keyword-node :type js2-NULL)
+ (js2-report-error "msg.syntax")
+ (make-js2-error-node)))
+ (t
+ (let* ((js2-in-for-init nil)
+ (expr (js2-parse-expr))
+ (pn (make-js2-paren-node :pos px-pos
+ :expr expr)))
+ (js2-node-add-children pn (js2-paren-node-expr pn))
+ (js2-must-match js2-RP "msg.no.paren")
+ (setf (js2-node-len pn) (- (js2-current-token-end) px-pos))
+ pn)))))
+
+(defun js2-parse-expr (&optional oneshot)
+ (let* ((pn (js2-parse-assign-expr))
+ (pos (js2-node-pos pn))
+ left
+ right
+ op-pos)
+ (while (and (not oneshot)
+ (js2-match-token js2-COMMA))
+ (setq op-pos (- (js2-current-token-beg) pos)) ; relative
+ (if (eq (js2-peek-token) js2-RP)
+ ;; Stop the parser from scanning too far: it's actually
+ ;; valid syntax in arrow fun arguments, and we don't want
+ ;; the RP token to get consumed.
+ (js2-report-error "msg.syntax")
+ (setq right (js2-parse-assign-expr)
+ left pn
+ pn (make-js2-infix-node :type js2-COMMA
+ :pos pos
+ :len (- js2-ts-cursor pos)
+ :op-pos op-pos
+ :left left
+ :right right))
+ (js2-node-add-children pn left right)))
+ pn))
+
+(defun js2-parse-assign-expr ()
+ (let ((tt (js2-get-token))
+ (pos (js2-current-token-beg))
+ pn left right op-pos
+ ts-state recorded-identifiers parsed-errors
+ async-p)
+ (if (= tt js2-YIELD)
+ (js2-parse-return-or-yield tt t)
+ ;; TODO(mooz): Bit confusing.
+ ;; If we meet `async` token and it's not part of `async
+ ;; function`, then this `async` is for a succeeding async arrow
+ ;; function.
+ ;; Since arrow function parsing doesn't rely on neither
+ ;; `js2-parse-function-stmt' nor `js2-parse-function-expr' that
+ ;; interpret `async` token, we trash `async` and just remember
+ ;; we met `async` keyword to `async-p'.
+ (when (js2-match-async-arrow-function)
+ (setq async-p t))
+ ;; Save the tokenizer state in case we find an arrow function
+ ;; and have to rewind.
+ (setq ts-state (make-js2-ts-state)
+ recorded-identifiers js2-recorded-identifiers
+ parsed-errors js2-parsed-errors)
+ ;; not yield - parse assignment expression
+ (setq pn (js2-parse-cond-expr)
+ tt (js2-get-token))
+ (cond
+ ((and (<= js2-first-assign tt)
+ (<= tt js2-last-assign))
+ ;; tt express assignment (=, |=, ^=, ..., %=)
+ (setq op-pos (- (js2-current-token-beg) pos) ; relative
+ left pn)
+ ;; The assigned node could be a js2-prop-get-node (foo.bar = 0), we only
+ ;; care about assignment to strict variable names.
+ (when (js2-name-node-p left)
+ (js2-check-strict-identifier left))
+ (setq right (js2-parse-assign-expr)
+ pn (make-js2-assign-node :type tt
+ :pos pos
+ :len (- (js2-node-end right) pos)
+ :op-pos op-pos
+ :left left
+ :right right))
+ (when js2-parse-ide-mode
+ (js2-highlight-assign-targets pn left right)
+ (js2-record-imenu-functions right left))
+ ;; do this last so ide checks above can use absolute positions
+ (js2-node-add-children pn left right))
+ ((and (>= js2-language-version 200)
+ (or
+ (= tt js2-ARROW)
+ (and async-p
+ (= (js2-peek-token) js2-ARROW))))
+ (js2-ts-seek ts-state)
+ (when async-p
+ (js2-record-face 'font-lock-keyword-face)
+ (js2-get-token))
+ (setq js2-recorded-identifiers recorded-identifiers
+ js2-parsed-errors parsed-errors)
+ (setq pn (js2-parse-function 'FUNCTION_ARROW (js2-current-token-beg) nil async-p)))
+ (t
+ (js2-unget-token)))
+ pn)))
+
+(defun js2-parse-cond-expr ()
+ (let ((pos (js2-current-token-beg))
+ (pn (js2-parse-nullish-coalescing-expr))
+ test-expr
+ if-true
+ if-false
+ q-pos
+ c-pos)
+ (when (js2-match-token js2-HOOK)
+ (setq q-pos (- (js2-current-token-beg) pos)
+ if-true (let (js2-in-for-init) (js2-parse-assign-expr)))
+ (js2-must-match js2-COLON "msg.no.colon.cond")
+ (setq c-pos (- (js2-current-token-beg) pos)
+ if-false (js2-parse-assign-expr)
+ test-expr pn
+ pn (make-js2-cond-node :pos pos
+ :len (- (js2-node-end if-false) pos)
+ :test-expr test-expr
+ :true-expr if-true
+ :false-expr if-false
+ :q-pos q-pos
+ :c-pos c-pos))
+ (js2-node-add-children pn test-expr if-true if-false))
+ pn))
+
+(defun js2-make-binary (type left parser &optional no-get)
+ "Helper for constructing a binary-operator AST node.
+LEFT is the left-side-expression, already parsed, and the
+binary operator should have just been matched.
+PARSER is a function to call to parse the right operand,
+or a `js2-node' struct if it has already been parsed.
+FIXME: The latter option is unused?"
+ (let* ((pos (js2-node-pos left))
+ (op-pos (- (js2-current-token-beg) pos))
+ (right (if (js2-node-p parser)
+ parser
+ (unless no-get (js2-get-token))
+ (funcall parser)))
+ (pn (make-js2-infix-node :type type
+ :pos pos
+ :len (- (js2-node-end right) pos)
+ :op-pos op-pos
+ :left left
+ :right right)))
+ (js2-node-add-children pn left right)
+ pn))
+
+(defun js2-parse-or-expr ()
+ (let ((pn (js2-parse-and-expr)))
+ (when (js2-match-token js2-OR)
+ (setq pn (js2-make-binary js2-OR
+ pn
+ 'js2-parse-or-expr)))
+ pn))
+
+(defun js2-parse-and-expr ()
+ (let ((pn (js2-parse-bit-or-expr)))
+ (when (js2-match-token js2-AND)
+ (setq pn (js2-make-binary js2-AND
+ pn
+ 'js2-parse-and-expr)))
+ pn))
+
+(defun js2-parse-bit-or-expr ()
+ (let ((pn (js2-parse-bit-xor-expr)))
+ (while (js2-match-token js2-BITOR)
+ (setq pn (js2-make-binary js2-BITOR
+ pn
+ 'js2-parse-bit-xor-expr)))
+ pn))
+
+(defun js2-parse-bit-xor-expr ()
+ (let ((pn (js2-parse-bit-and-expr)))
+ (while (js2-match-token js2-BITXOR)
+ (setq pn (js2-make-binary js2-BITXOR
+ pn
+ 'js2-parse-bit-and-expr)))
+ pn))
+
+(defun js2-parse-bit-and-expr ()
+ (let ((pn (js2-parse-eq-expr)))
+ (while (js2-match-token js2-BITAND)
+ (setq pn (js2-make-binary js2-BITAND
+ pn
+ 'js2-parse-eq-expr)))
+ pn))
+
+
+(defun js2-parse-nullish-coalescing-expr ()
+ (let ((pn (js2-parse-or-expr)))
+ (when (js2-match-token js2-NULLISH-COALESCING)
+ (setq pn (js2-make-binary js2-NULLISH-COALESCING
+ pn
+ 'js2-parse-nullish-coalescing-expr)))
+ pn))
+
+(defconst js2-parse-eq-ops
+ (list js2-EQ js2-NE js2-SHEQ js2-SHNE))
+
+(defun js2-parse-eq-expr ()
+ (let ((pn (js2-parse-rel-expr))
+ tt)
+ (while (memq (setq tt (js2-get-token)) js2-parse-eq-ops)
+ (setq pn (js2-make-binary tt
+ pn
+ 'js2-parse-rel-expr)))
+ (js2-unget-token)
+ pn))
+
+(defconst js2-parse-rel-ops
+ (list js2-IN js2-INSTANCEOF js2-LE js2-LT js2-GE js2-GT))
+
+(defun js2-parse-rel-expr ()
+ (let ((pn (js2-parse-shift-expr))
+ (continue t)
+ tt)
+ (while continue
+ (setq tt (js2-get-token))
+ (cond
+ ((and js2-in-for-init (= tt js2-IN))
+ (js2-unget-token)
+ (setq continue nil))
+ ((memq tt js2-parse-rel-ops)
+ (setq pn (js2-make-binary tt pn 'js2-parse-shift-expr)))
+ (t
+ (js2-unget-token)
+ (setq continue nil))))
+ pn))
+
+(defconst js2-parse-shift-ops
+ (list js2-LSH js2-URSH js2-RSH))
+
+(defun js2-parse-shift-expr ()
+ (let ((pn (js2-parse-add-expr))
+ tt
+ (continue t))
+ (while continue
+ (setq tt (js2-get-token))
+ (if (memq tt js2-parse-shift-ops)
+ (setq pn (js2-make-binary tt pn 'js2-parse-add-expr))
+ (js2-unget-token)
+ (setq continue nil)))
+ pn))
+
+(defun js2-parse-add-expr ()
+ (let ((pn (js2-parse-mul-expr))
+ tt
+ (continue t))
+ (while continue
+ (setq tt (js2-get-token))
+ (if (or (= tt js2-ADD) (= tt js2-SUB))
+ (setq pn (js2-make-binary tt pn 'js2-parse-mul-expr))
+ (js2-unget-token)
+ (setq continue nil)))
+ pn))
+
+(defconst js2-parse-mul-ops
+ (list js2-MUL js2-DIV js2-MOD))
+
+(defun js2-parse-mul-expr ()
+ (let ((pn (js2-parse-expon-expr))
+ tt
+ (continue t))
+ (while continue
+ (setq tt (js2-get-token))
+ (if (memq tt js2-parse-mul-ops)
+ (setq pn (js2-make-binary tt pn 'js2-parse-expon-expr))
+ (js2-unget-token)
+ (setq continue nil)))
+ pn))
+
+(defun js2-parse-expon-expr ()
+ (let ((pn (js2-parse-unary-expr)))
+ (when (>= js2-language-version 200)
+ (while (js2-match-token js2-EXPON)
+ (when (and (js2-unary-node-p pn)
+ (not (memq (js2-node-type pn) '(js2-INC js2-DEC))))
+ (js2-report-error "msg.syntax" nil
+ (js2-node-abs-pos pn) (js2-node-len pn)))
+ ;; Make it right-associative.
+ (setq pn (js2-make-binary js2-EXPON pn 'js2-parse-expon-expr))))
+ pn))
+
+(defun js2-make-unary (beg type parser &rest args)
+ "Make a unary node starting at BEG of type TYPE.
+If BEG is nil, `(js2-current-token-beg)' is used for the node
+start position. PARSER is either a node (for postfix operators)
+or a function to call to parse the operand (for prefix
+operators)."
+ (let* ((pos (or beg (js2-current-token-beg)))
+ (postfix (js2-node-p parser))
+ (expr (if postfix
+ parser
+ (apply parser args)))
+ end
+ pn)
+ (if postfix ; e.g. i++
+ (setq pos (js2-node-pos expr)
+ end (js2-current-token-end))
+ (setq end (js2-node-end expr)))
+ (setq pn (make-js2-unary-node :type type
+ :pos pos
+ :len (- end pos)
+ :operand expr))
+ (js2-node-add-children pn expr)
+ pn))
+
+(defconst js2-incrementable-node-types
+ (list js2-NAME js2-GETPROP js2-GETELEM js2-GET_REF js2-CALL)
+ "Node types that can be the operand of a ++ or -- operator.")
+
+(defun js2-check-bad-inc-dec (tt beg end unary)
+ (unless (memq (js2-node-type (js2-unary-node-operand unary))
+ js2-incrementable-node-types)
+ (js2-report-error (if (= tt js2-INC)
+ "msg.bad.incr"
+ "msg.bad.decr")
+ nil beg (- end beg))))
+
+(defun js2-parse-unary-expr ()
+ (let ((tt (js2-current-token-type))
+ (beg (js2-current-token-beg)))
+ (cond
+ ((or (= tt js2-VOID)
+ (= tt js2-NOT)
+ (= tt js2-BITNOT)
+ (= tt js2-TYPEOF))
+ (js2-get-token)
+ (js2-make-unary beg tt 'js2-parse-unary-expr))
+ ((= tt js2-ADD)
+ (js2-get-token)
+ ;; Convert to special POS token in decompiler and parse tree
+ (js2-make-unary beg js2-POS 'js2-parse-unary-expr))
+ ((= tt js2-SUB)
+ (js2-get-token)
+ ;; Convert to special NEG token in decompiler and parse tree
+ (js2-make-unary beg js2-NEG 'js2-parse-unary-expr))
+ ((or (= tt js2-INC)
+ (= tt js2-DEC))
+ (js2-get-token)
+ (let ((beg2 (js2-current-token-beg))
+ (end (js2-current-token-end))
+ (expr (js2-make-unary beg tt 'js2-parse-member-expr t)))
+ (js2-check-bad-inc-dec tt beg2 end expr)
+ expr))
+ ((= tt js2-DELPROP)
+ (js2-get-token)
+ (js2-make-unary beg js2-DELPROP 'js2-parse-unary-expr))
+ ((js2-parse-await-maybe tt))
+ ((= tt js2-ERROR)
+ (js2-get-token)
+ (make-js2-error-node)) ; try to continue
+ ((and (= tt js2-LT)
+ js2-compiler-xml-available)
+ ;; XML stream encountered in expression.
+ (js2-parse-member-expr-tail t (js2-parse-xml-initializer)))
+ (t
+ (let ((pn (js2-parse-member-expr t))
+ ;; Don't look across a newline boundary for a postfix incop.
+ (tt (js2-peek-token-or-eol))
+ expr)
+ (when (or (= tt js2-INC) (= tt js2-DEC))
+ (js2-get-token)
+ (setf expr pn
+ pn (js2-make-unary (js2-node-pos expr) tt expr))
+ (js2-node-set-prop pn 'postfix t)
+ (js2-check-bad-inc-dec tt (js2-current-token-beg) (js2-current-token-end) pn))
+ pn)))))
+
+(defun js2-parse-xml-initializer ()
+ "Parse an E4X XML initializer.
+I'm parsing it the way Rhino parses it, but without the tree-rewriting.
+Then I'll postprocess the result, depending on whether we're in IDE
+mode or codegen mode, and generate the appropriate rewritten AST.
+IDE mode uses a rich AST that models the XML structure. Codegen mode
+just concatenates everything and makes a new XML or XMLList out of it."
+ (let ((tt (js2-get-first-xml-token))
+ pn-xml pn expr kids expr-pos
+ (continue t)
+ (first-token t))
+ (when (not (or (= tt js2-XML) (= tt js2-XMLEND)))
+ (js2-report-error "msg.syntax"))
+ (setq pn-xml (make-js2-xml-node))
+ (while continue
+ (if first-token
+ (setq first-token nil)
+ (setq tt (js2-get-next-xml-token)))
+ (cond
+ ;; js2-XML means we found a {expr} in the XML stream.
+ ;; The token string is the XML up to the left-curly.
+ ((= tt js2-XML)
+ (push (make-js2-string-node :pos (js2-current-token-beg)
+ :len (- js2-ts-cursor (js2-current-token-beg)))
+ kids)
+ (js2-must-match js2-LC "msg.syntax")
+ (setq expr-pos js2-ts-cursor
+ expr (if (eq (js2-peek-token) js2-RC)
+ (make-js2-empty-expr-node :pos expr-pos)
+ (js2-parse-expr)))
+ (js2-must-match js2-RC "msg.syntax")
+ (setq pn (make-js2-xml-js-expr-node :pos (js2-node-pos expr)
+ :len (js2-node-len expr)
+ :expr expr))
+ (js2-node-add-children pn expr)
+ (push pn kids))
+ ;; a js2-XMLEND token means we hit the final close-tag.
+ ((= tt js2-XMLEND)
+ (push (make-js2-string-node :pos (js2-current-token-beg)
+ :len (- js2-ts-cursor (js2-current-token-beg)))
+ kids)
+ (dolist (kid (nreverse kids))
+ (js2-block-node-push pn-xml kid))
+ (setf (js2-node-len pn-xml) (- js2-ts-cursor
+ (js2-node-pos pn-xml))
+ continue nil))
+ (t
+ (js2-report-error "msg.syntax")
+ (setq continue nil))))
+ pn-xml))
+
+
+(defun js2-parse-argument-list ()
+ "Parse an argument list and return it as a Lisp list of nodes.
+Returns the list in reverse order. Consumes the right-paren token."
+ (let (result)
+ (unless (js2-match-token js2-RP)
+ (cl-loop do
+ (let ((tt (js2-get-token))
+ (beg (js2-current-token-beg)))
+ (if (and (= tt js2-TRIPLEDOT)
+ (>= js2-language-version 200))
+ (push (js2-make-unary beg tt 'js2-parse-assign-expr) result)
+ (js2-unget-token)
+ (push (js2-parse-assign-expr) result)))
+ while
+ (and (js2-match-token js2-COMMA)
+ (or (< js2-language-version 200)
+ (not (= js2-RP (js2-peek-token))))))
+ (js2-must-match js2-RP "msg.no.paren.arg")
+ result)))
+
+(defun js2-parse-member-expr (&optional allow-call-syntax)
+ (let ((tt (js2-current-token-type))
+ pn pos target args beg end init)
+ (if (/= tt js2-NEW)
+ (setq pn (js2-parse-primary-expr))
+ ;; parse a 'new' expression
+ (js2-get-token)
+ (setq pos (js2-current-token-beg)
+ beg pos
+ target (js2-parse-member-expr)
+ end (js2-node-end target)
+ pn (make-js2-new-node :pos pos
+ :target target
+ :len (- end pos)))
+ (js2-highlight-function-call (js2-current-token))
+ (js2-node-add-children pn target)
+ (when (js2-match-token js2-LP)
+ ;; Add the arguments to pn, if any are supplied.
+ (setf beg pos ; start of "new" keyword
+ pos (js2-current-token-beg)
+ args (nreverse (js2-parse-argument-list))
+ (js2-new-node-args pn) args
+ end (js2-current-token-end)
+ (js2-new-node-lp pn) (- pos beg)
+ (js2-new-node-rp pn) (- end 1 beg))
+ (apply #'js2-node-add-children pn args))
+ (when (and js2-allow-rhino-new-expr-initializer
+ (js2-match-token js2-LC))
+ (setf init (js2-parse-object-literal)
+ end (js2-node-end init)
+ (js2-new-node-initializer pn) init)
+ (js2-node-add-children pn init))
+ (setf (js2-node-len pn) (- end beg))) ; end outer if
+ (js2-parse-member-expr-tail allow-call-syntax pn)))
+
+(defun js2-parse-optional-chaining-operator (allow-call-syntax pn)
+ (let ((tt (js2-peek-token)))
+ (cond
+ ((eq tt js2-NAME)
+ (setq pn (js2-parse-property-access js2-DOT pn)))
+ ((eq tt js2-LB)
+ ;; skip left bracket token
+ (js2-get-token)
+ (setq pn (js2-parse-element-get pn)))
+ ((and (eq tt js2-LP) allow-call-syntax)
+ ;; unget optional chaining operator
+ ;; so current token is function name and could be highlighted
+ (js2-unget-token)
+ (setq pn (js2-parse-function-call pn t)))
+ (t
+ (js2-report-error "msg.bad.optional.chaining")))
+ pn))
+
+(defun js2-parse-member-expr-tail (allow-call-syntax pn)
+ "Parse a chain of property/array accesses or function calls.
+Includes parsing for E4X operators like `..' and `.@'.
+If ALLOW-CALL-SYNTAX is nil, stops when we encounter a left-paren.
+Returns an expression tree that includes PN, the parent node."
+ (let (tt
+ (continue t))
+ (while continue
+ (setq tt (js2-get-token))
+ (cond
+ ((or (= tt js2-DOT) (= tt js2-DOTDOT))
+ (setq pn (js2-parse-property-access tt pn)))
+ ((= tt js2-OPTIONAL-CHAINING)
+ (setq pn (js2-parse-optional-chaining-operator allow-call-syntax pn))
+ (unless pn (setq continue nil)))
+ ((= tt js2-DOTQUERY)
+ (setq pn (js2-parse-dot-query pn)))
+ ((= tt js2-LB)
+ (setq pn (js2-parse-element-get pn)))
+ ((= tt js2-LP)
+ (js2-unget-token)
+ (if allow-call-syntax
+ (setq pn (js2-parse-function-call pn))
+ (setq continue nil)))
+ ((= tt js2-TEMPLATE_HEAD)
+ (setq pn (js2-parse-tagged-template pn (js2-parse-template-literal))))
+ ((= tt js2-NO_SUBS_TEMPLATE)
+ (setq pn (js2-parse-tagged-template pn (make-js2-string-node :type tt))))
+ (t
+ (js2-unget-token)
+ (setq continue nil)))
+ (if (>= js2-highlight-level 2)
+ (js2-parse-highlight-member-expr-node pn)))
+ pn))
+
+(defun js2-parse-tagged-template (tag-node tpl-node)
+ "Parse tagged template expression."
+ (let* ((pos (js2-node-pos tag-node))
+ (pn (make-js2-tagged-template-node :pos pos
+ :len (- (js2-current-token-end) pos)
+ :tag tag-node
+ :template tpl-node)))
+ (js2-node-add-children pn tag-node tpl-node)
+ pn))
+
+(defun js2-parse-dot-query (pn)
+ "Parse a dot-query expression, e.g. foo.bar.(@name == 2)
+Last token parsed must be `js2-DOTQUERY'."
+ (let ((pos (js2-node-pos pn))
+ op-pos expr end)
+ (js2-must-have-xml)
+ (js2-set-requires-activation)
+ (setq op-pos (js2-current-token-beg)
+ expr (js2-parse-expr)
+ end (js2-node-end expr)
+ pn (make-js2-xml-dot-query-node :left pn
+ :pos pos
+ :op-pos op-pos
+ :right expr))
+ (js2-node-add-children pn
+ (js2-xml-dot-query-node-left pn)
+ (js2-xml-dot-query-node-right pn))
+ (if (js2-must-match js2-RP "msg.no.paren")
+ (setf (js2-xml-dot-query-node-rp pn) (js2-current-token-beg)
+ end (js2-current-token-end)))
+ (setf (js2-node-len pn) (- end pos))
+ pn))
+
+(defun js2-parse-element-get (pn)
+ "Parse an element-get expression, e.g. foo[bar].
+Last token parsed must be `js2-RB'."
+ (let ((lb (js2-current-token-beg))
+ (pos (js2-node-pos pn))
+ rb expr)
+ (setq expr (js2-parse-expr))
+ (if (js2-must-match js2-RB "msg.no.bracket.index")
+ (setq rb (js2-current-token-beg)))
+ (setq pn (make-js2-elem-get-node :target pn
+ :pos pos
+ :element expr
+ :lb (js2-relpos lb pos)
+ :rb (js2-relpos rb pos)
+ :len (- (js2-current-token-end) pos)))
+ (js2-node-add-children pn
+ (js2-elem-get-node-target pn)
+ (js2-elem-get-node-element pn))
+ pn))
+
+(defun js2-highlight-function-call (token)
+ (when (eq (js2-token-type token) js2-NAME)
+ (js2-record-face 'js2-function-call token)))
+
+(defun js2-parse-function-call (pn &optional use-optional-chaining-p)
+ (js2-highlight-function-call (js2-current-token))
+ (js2-get-token)
+ (let (args
+ (pos (js2-node-pos pn)))
+ (when use-optional-chaining-p
+ ;; skip optional chaining operator
+ (js2-get-token))
+ (setq pn (make-js2-call-node :pos pos
+ :target pn
+ :lp (- (js2-current-token-beg) pos)))
+ (js2-node-add-children pn (js2-call-node-target pn))
+ ;; Add the arguments to pn, if any are supplied.
+ (setf args (nreverse (js2-parse-argument-list))
+ (js2-call-node-rp pn) (- (js2-current-token-beg) pos)
+ (js2-call-node-args pn) args)
+ (apply #'js2-node-add-children pn args)
+ (setf (js2-node-len pn) (- js2-ts-cursor pos))
+ pn))
+
+(defun js2-parse-property-access (tt pn)
+ "Parse a property access, XML descendants access, or XML attr access."
+ (let ((member-type-flags 0)
+ (dot-pos (js2-current-token-beg))
+ (dot-len (if (= tt js2-DOTDOT) 2 1))
+ name
+ ref ; right side of . or .. operator
+ result)
+ (when (= tt js2-DOTDOT)
+ (js2-must-have-xml)
+ (setq member-type-flags js2-descendants-flag))
+ (if (not js2-compiler-xml-available)
+ (progn
+ (js2-must-match-prop-name "msg.no.name.after.dot")
+ (setq name (js2-create-name-node t js2-GETPROP)
+ result (make-js2-prop-get-node :left pn
+ :pos (js2-current-token-beg)
+ :right name
+ :len (js2-current-token-len)))
+ (js2-node-add-children result pn name)
+ result)
+ ;; otherwise look for XML operators
+ (setf result (if (= tt js2-DOT)
+ (make-js2-prop-get-node)
+ (make-js2-infix-node :type js2-DOTDOT))
+ (js2-node-pos result) (js2-node-pos pn)
+ (js2-infix-node-op-pos result) dot-pos
+ (js2-infix-node-left result) pn ; do this after setting position
+ tt (js2-get-prop-name-token))
+ (cond
+ ;; handles: name, ns::name, ns::*, ns::[expr]
+ ((or (= tt js2-NAME) (= tt js2-PRIVATE_NAME))
+ (setq ref (js2-parse-property-name -1 nil member-type-flags)))
+ ;; handles: *, *::name, *::*, *::[expr]
+ ((= tt js2-MUL)
+ (setq ref (js2-parse-property-name nil "*" member-type-flags)))
+ ;; handles: '@attr', '@ns::attr', '@ns::*', '@ns::[expr]', etc.
+ ((= tt js2-XMLATTR)
+ (setq result (js2-parse-attribute-access)))
+ (t
+ (js2-report-error "msg.no.name.after.dot" nil dot-pos dot-len)))
+ (if ref
+ (setf (js2-node-len result) (- (js2-node-end ref)
+ (js2-node-pos result))
+ (js2-infix-node-right result) ref))
+ (if (js2-infix-node-p result)
+ (js2-node-add-children result
+ (js2-infix-node-left result)
+ (js2-infix-node-right result)))
+ result)))
+
+(defun js2-parse-attribute-access ()
+ "Parse an E4X XML attribute expression.
+This includes expressions of the forms:
+
+ @attr @ns::attr @ns::*
+ @* @*::attr @*::*
+ @[expr] @*::[expr] @ns::[expr]
+
+Called if we peeked an `@' token."
+ (let ((tt (js2-get-prop-name-token))
+ (at-pos (js2-current-token-beg)))
+ (cond
+ ;; handles: @name, @ns::name, @ns::*, @ns::[expr]
+ ((= tt js2-NAME)
+ (js2-parse-property-name at-pos nil 0))
+ ;; handles: @*, @*::name, @*::*, @*::[expr]
+ ((= tt js2-MUL)
+ (js2-parse-property-name (js2-current-token-beg) "*" 0))
+ ;; handles @[expr]
+ ((= tt js2-LB)
+ (js2-parse-xml-elem-ref at-pos))
+ (t
+ (js2-report-error "msg.no.name.after.xmlAttr")
+ ;; Avoid cascaded errors that happen if we make an error node here.
+ (js2-parse-property-name (js2-current-token-beg) "" 0)))))
+
+(defun js2-parse-property-name (at-pos s member-type-flags)
+ "Check if :: follows name in which case it becomes qualified name.
+
+AT-POS is a natural number if we just read an `@' token, else nil.
+S is the name or string that was matched: an identifier, `throw' or `*'.
+MEMBER-TYPE-FLAGS is a bit set tracking whether we're a `.' or `..' child.
+
+Returns a `js2-xml-ref-node' if it's an attribute access, a child of a `..'
+operator, or the name is followed by ::. For a plain name, returns a
+`js2-name-node'. Returns a `js2-error-node' for malformed XML expressions."
+ (let ((pos (or at-pos (js2-current-token-beg)))
+ colon-pos
+ (name (js2-create-name-node t (js2-current-token-type) s))
+ ns tt pn)
+ (catch 'return
+ (when (js2-match-token js2-COLONCOLON)
+ (setq ns name
+ colon-pos (js2-current-token-beg)
+ tt (js2-get-prop-name-token))
+ (cond
+ ;; handles name::name
+ ((= tt js2-NAME)
+ (setq name (js2-create-name-node)))
+ ;; handles name::*
+ ((= tt js2-MUL)
+ (setq name (js2-create-name-node nil nil "*")))
+ ;; handles name::[expr]
+ ((= tt js2-LB)
+ (throw 'return (js2-parse-xml-elem-ref at-pos ns colon-pos)))
+ (t
+ (js2-report-error "msg.no.name.after.coloncolon"))))
+ (if (and (null ns) (zerop member-type-flags))
+ name
+ (prog1
+ (setq pn
+ (make-js2-xml-prop-ref-node :pos pos
+ :len (- (js2-node-end name) pos)
+ :at-pos at-pos
+ :colon-pos colon-pos
+ :propname name))
+ (js2-node-add-children pn name))))))
+
+(defun js2-parse-xml-elem-ref (at-pos &optional namespace colon-pos)
+ "Parse the [expr] portion of an xml element reference.
+For instance, @[expr], @*::[expr], or ns::[expr]."
+ (let* ((lb (js2-current-token-beg))
+ (pos (or at-pos lb))
+ rb
+ (expr (js2-parse-expr))
+ (end (js2-node-end expr))
+ pn)
+ (if (js2-must-match js2-RB "msg.no.bracket.index")
+ (setq rb (js2-current-token-beg)
+ end (js2-current-token-end)))
+ (prog1
+ (setq pn
+ (make-js2-xml-elem-ref-node :pos pos
+ :len (- end pos)
+ :namespace namespace
+ :colon-pos colon-pos
+ :at-pos at-pos
+ :expr expr
+ :lb (js2-relpos lb pos)
+ :rb (js2-relpos rb pos)))
+ (js2-node-add-children pn namespace expr))))
+
+(defun js2-parse-destruct-primary-expr ()
+ (let ((js2-is-in-destructuring t))
+ (js2-parse-primary-expr)))
+
+(defun js2-parse-primary-expr ()
+ "Parse a literal (leaf) expression of some sort.
+Includes complex literals such as functions, object-literals,
+array-literals, array comprehensions and regular expressions."
+ (let (tt node)
+ (setq tt (js2-current-token-type))
+ (cond
+ ((= tt js2-CLASS)
+ (js2-parse-class-expr))
+ ((= tt js2-FUNCTION)
+ (js2-parse-function-expr))
+ ((js2-match-async-function)
+ (js2-parse-function-expr t))
+ ((= tt js2-LB)
+ (js2-parse-array-comp-or-literal))
+ ((= tt js2-LC)
+ (js2-parse-object-literal))
+ ((= tt js2-LET)
+ (js2-parse-let (js2-current-token-beg)))
+ ((= tt js2-LP)
+ (js2-parse-paren-expr-or-generator-comp))
+ ((= tt js2-XMLATTR)
+ (js2-must-have-xml)
+ (js2-parse-attribute-access))
+ ((= tt js2-NAME)
+ (js2-parse-name tt))
+ ((= tt js2-IMPORT)
+ (js2-create-name-node nil nil "import"))
+ ((= tt js2-NUMBER)
+ (setq node (make-js2-number-node))
+ (when (and js2-in-use-strict-directive
+ (= (js2-number-node-num-base node) 8)
+ (js2-number-node-legacy-octal-p node))
+ (js2-report-error "msg.no.octal.strict"))
+ node)
+ ((or (= tt js2-STRING) (= tt js2-NO_SUBS_TEMPLATE))
+ (make-js2-string-node :type tt))
+ ((= tt js2-TEMPLATE_HEAD)
+ (js2-parse-template-literal))
+ ((or (= tt js2-DIV) (= tt js2-ASSIGN_DIV))
+ ;; Got / or /= which in this context means a regexp literal
+ (let* ((px-pos (js2-current-token-beg))
+ (flags (js2-read-regexp tt px-pos))
+ (end (js2-current-token-end)))
+ (prog1
+ (make-js2-regexp-node :pos px-pos
+ :len (- end px-pos)
+ :value (js2-current-token-string)
+ :flags flags)
+ (js2-set-face px-pos end 'font-lock-string-face 'record))))
+ ((or (= tt js2-NULL)
+ (= tt js2-THIS)
+ (= tt js2-SUPER)
+ (= tt js2-FALSE)
+ (= tt js2-TRUE))
+ (make-js2-keyword-node :type tt))
+ ((= tt js2-TRIPLEDOT)
+ ;; Likewise, only valid in an arrow function with a rest param.
+ (if (and (js2-match-token js2-NAME)
+ (js2-match-token js2-RP)
+ (eq (js2-peek-token) js2-ARROW))
+ (progn
+ (js2-unget-token) ; Put back the right paren.
+ ;; See the previous case.
+ (make-js2-keyword-node :type js2-NULL))
+ (js2-report-error "msg.syntax")
+ (make-js2-error-node)))
+ ((= tt js2-RESERVED)
+ (js2-report-error "msg.reserved.id")
+ (make-js2-name-node))
+ ((= tt js2-ERROR)
+ ;; the scanner or one of its subroutines reported the error.
+ (make-js2-error-node))
+ ((= tt js2-EOF)
+ (let* ((px-pos (point-at-bol))
+ (len (- js2-ts-cursor px-pos)))
+ (js2-report-error "msg.unexpected.eof" nil px-pos len))
+ (make-js2-error-node :pos (1- js2-ts-cursor)))
+ (t
+ (js2-report-error "msg.syntax")
+ (make-js2-error-node)))))
+
+(defun js2-parse-template-literal ()
+ (let ((beg (js2-current-token-beg))
+ (kids (list (make-js2-string-node :type js2-TEMPLATE_HEAD)))
+ (tt js2-TEMPLATE_HEAD))
+ (while (eq tt js2-TEMPLATE_HEAD)
+ (push (js2-parse-expr) kids)
+ (js2-must-match js2-RC "msg.syntax")
+ (setq tt (js2-get-token 'TEMPLATE_TAIL))
+ (push (make-js2-string-node :type tt) kids))
+ (setq kids (nreverse kids))
+ (let ((tpl (make-js2-template-node :pos beg
+ :len (- (js2-current-token-end) beg)
+ :kids kids)))
+ (apply #'js2-node-add-children tpl kids)
+ tpl)))
+
+(defun js2-parse-name (_tt)
+ (let ((name (js2-current-token-string))
+ node)
+ (setq node (if js2-compiler-xml-available
+ (js2-parse-property-name nil name 0)
+ (js2-create-name-node 'check-activation nil name)))
+ (if (and js2-highlight-external-variables
+ ;; FIXME: What's TRT for `js2-xml-ref-node'?
+ (js2-name-node-p node))
+ (js2-record-name-node node))
+ node))
+
+(defun js2-parse-warn-trailing-comma (msg pos elems comma-pos)
+ (js2-add-strict-warning
+ msg nil
+ ;; back up from comma to beginning of line or array/objlit
+ (max (if elems
+ (js2-node-pos (car elems))
+ pos)
+ (save-excursion
+ (goto-char comma-pos)
+ (back-to-indentation)
+ (point)))
+ comma-pos))
+
+(defun js2-parse-array-comp-or-literal ()
+ (let ((pos (js2-current-token-beg)))
+ (if (and (>= js2-language-version 200)
+ (js2-match-token js2-FOR))
+ (js2-parse-array-comp pos)
+ (js2-parse-array-literal pos))))
+
+(defun js2-parse-array-literal (pos)
+ (let ((after-lb-or-comma t)
+ after-comma tt elems pn was-rest
+ (continue t))
+ (unless js2-is-in-destructuring
+ (js2-push-scope (make-js2-scope))) ; for the legacy array comp
+ (while continue
+ (setq tt (js2-get-token))
+ (cond
+ ;; end of array
+ ((or (= tt js2-RB)
+ (= tt js2-EOF)) ; prevent infinite loop
+ (if (= tt js2-EOF)
+ (js2-report-error "msg.no.bracket.arg" nil pos))
+ (when (and after-comma (< js2-language-version 170))
+ (js2-parse-warn-trailing-comma "msg.array.trailing.comma"
+ pos (remove nil elems) after-comma))
+ (setq continue nil
+ pn (make-js2-array-node :pos pos
+ :len (- js2-ts-cursor pos)
+ :elems (nreverse elems)))
+ (apply #'js2-node-add-children pn (js2-array-node-elems pn)))
+ ;; anything after rest element (...foo)
+ (was-rest
+ (js2-report-error "msg.param.after.rest"))
+ ;; comma
+ ((= tt js2-COMMA)
+ (setq after-comma (js2-current-token-end))
+ (if (not after-lb-or-comma)
+ (setq after-lb-or-comma t)
+ (push nil elems)))
+ ;; array comp
+ ((and (>= js2-language-version 170)
+ (not js2-is-in-destructuring)
+ (= tt js2-FOR) ; check for array comprehension
+ (not after-lb-or-comma) ; "for" can't follow a comma
+ elems ; must have at least 1 element
+ (not (cdr elems))) ; but no 2nd element
+ (js2-unget-token)
+ (setf continue nil
+ pn (js2-parse-legacy-array-comp (car elems) pos)))
+ ;; another element
+ (t
+ (unless after-lb-or-comma
+ (js2-report-error "msg.no.bracket.arg"))
+ (if (and (= tt js2-TRIPLEDOT)
+ (>= js2-language-version 200))
+ ;; rest/spread operator
+ (progn
+ (push (js2-make-unary nil tt 'js2-parse-assign-expr)
+ elems)
+ (if js2-is-in-destructuring
+ (setq was-rest t)))
+ (js2-unget-token)
+ (push (js2-parse-assign-expr) elems))
+ (setq after-lb-or-comma nil
+ after-comma nil))))
+ (unless js2-is-in-destructuring
+ (js2-pop-scope))
+ pn))
+
+(defun js2-parse-legacy-array-comp (expr pos)
+ "Parse a legacy array comprehension (JavaScript 1.7).
+EXPR is the first expression after the opening left-bracket.
+POS is the beginning of the LB token preceding EXPR.
+We should have just parsed the `for' keyword before calling this function."
+ (let ((current-scope js2-current-scope)
+ loops first filter result)
+ (unwind-protect
+ (progn
+ (while (js2-match-token js2-FOR)
+ (let ((loop (make-js2-comp-loop-node)))
+ (js2-push-scope loop)
+ (push loop loops)
+ (js2-parse-comp-loop loop)))
+ ;; First loop takes expr scope's parent.
+ (setf (js2-scope-parent-scope (setq first (car (last loops))))
+ (js2-scope-parent-scope current-scope))
+ ;; Set expr scope's parent to the last loop.
+ (setf (js2-scope-parent-scope current-scope) (car loops))
+ (if (/= (js2-get-token) js2-IF)
+ (js2-unget-token)
+ (setq filter (js2-parse-condition))))
+ (dotimes (_ (1- (length loops)))
+ (js2-pop-scope)))
+ (js2-must-match js2-RB "msg.no.bracket.arg" pos)
+ (setq result (make-js2-comp-node :pos pos
+ :len (- js2-ts-cursor pos)
+ :result expr
+ :loops (nreverse loops)
+ :filters (and filter (list (car filter)))
+ :form 'LEGACY_ARRAY))
+ ;; Set comp loop's parent to the last loop.
+ ;; TODO: Get rid of the bogus expr scope.
+ (setf (js2-scope-parent-scope result) first)
+ (apply #'js2-node-add-children result expr (car filter)
+ (js2-comp-node-loops result))
+ result))
+
+(defun js2-parse-array-comp (pos)
+ "Parse an ES6 array comprehension.
+POS is the beginning of the LB token.
+We should have just parsed the `for' keyword before calling this function."
+ (let ((pn (js2-parse-comprehension pos 'ARRAY)))
+ (js2-must-match js2-RB "msg.no.bracket.arg" pos)
+ pn))
+
+(defun js2-parse-generator-comp (pos)
+ (let* ((js2-nesting-of-function (1+ js2-nesting-of-function))
+ (js2-current-script-or-fn
+ (make-js2-function-node :generator-type 'COMPREHENSION))
+ (pn (js2-parse-comprehension pos 'STAR_GENERATOR)))
+ (js2-must-match js2-RP "msg.no.paren" pos)
+ pn))
+
+(defun js2-parse-comprehension (pos form)
+ (let (loops filters expr result last)
+ (unwind-protect
+ (progn
+ (js2-unget-token)
+ (while (js2-match-token js2-FOR)
+ (let ((loop (make-js2-comp-loop-node)))
+ (js2-push-scope loop)
+ (push loop loops)
+ (js2-parse-comp-loop loop)))
+ (while (js2-match-token js2-IF)
+ (push (car (js2-parse-condition)) filters))
+ (setq expr (js2-parse-assign-expr))
+ (setq last (car loops)))
+ (dolist (_ loops)
+ (js2-pop-scope)))
+ (setq result (make-js2-comp-node :pos pos
+ :len (- js2-ts-cursor pos)
+ :result expr
+ :loops (nreverse loops)
+ :filters (nreverse filters)
+ :form form))
+ (apply #'js2-node-add-children result (js2-comp-node-loops result))
+ (apply #'js2-node-add-children result expr (js2-comp-node-filters result))
+ (setf (js2-scope-parent-scope result) last)
+ result))
+
+(defun js2-parse-comp-loop (pn &optional only-of-p)
+ "Parse a `for [each] (foo [in|of] bar)' expression in an Array comprehension.
+The current token should be the initial FOR.
+If ONLY-OF-P is non-nil, only the `for (foo of bar)' form is allowed."
+ (let ((pos (js2-comp-loop-node-pos pn))
+ tt iter obj foreach-p forof-p in-pos each-pos lp rp)
+ (when (and (not only-of-p) (js2-match-token js2-NAME))
+ (if (string= (js2-current-token-string) "each")
+ (progn
+ (setq foreach-p t
+ each-pos (- (js2-current-token-beg) pos)) ; relative
+ (js2-record-face 'font-lock-keyword-face))
+ (js2-report-error "msg.no.paren.for")))
+ (if (js2-must-match js2-LP "msg.no.paren.for")
+ (setq lp (- (js2-current-token-beg) pos)))
+ (setq tt (js2-peek-token))
+ (cond
+ ((or (= tt js2-LB)
+ (= tt js2-LC))
+ (js2-get-token)
+ (setq iter (js2-parse-destruct-primary-expr))
+ (js2-define-destruct-symbols iter js2-LET
+ 'font-lock-variable-name-face t))
+ ((js2-match-token js2-NAME)
+ (setq iter (js2-create-name-node)))
+ (t
+ (js2-report-error "msg.bad.var")))
+ ;; Define as a let since we want the scope of the variable to
+ ;; be restricted to the array comprehension
+ (if (js2-name-node-p iter)
+ (js2-define-symbol js2-LET (js2-name-node-name iter) pn t))
+ (if (or (and (not only-of-p) (js2-match-token js2-IN))
+ (and (>= js2-language-version 200)
+ (js2-match-contextual-kwd "of")
+ (setq forof-p t)))
+ (setq in-pos (- (js2-current-token-beg) pos))
+ (js2-report-error "msg.in.after.for.name"))
+ (setq obj (js2-parse-expr))
+ (if (js2-must-match js2-RP "msg.no.paren.for.ctrl")
+ (setq rp (- (js2-current-token-beg) pos)))
+ (setf (js2-node-pos pn) pos
+ (js2-node-len pn) (- js2-ts-cursor pos)
+ (js2-comp-loop-node-iterator pn) iter
+ (js2-comp-loop-node-object pn) obj
+ (js2-comp-loop-node-in-pos pn) in-pos
+ (js2-comp-loop-node-each-pos pn) each-pos
+ (js2-comp-loop-node-foreach-p pn) foreach-p
+ (js2-comp-loop-node-forof-p pn) forof-p
+ (js2-comp-loop-node-lp pn) lp
+ (js2-comp-loop-node-rp pn) rp)
+ (js2-node-add-children pn iter obj)
+ pn))
+
+(defun js2-parse-class-stmt ()
+ (let ((pos (js2-current-token-beg))
+ (_ (js2-must-match-name "msg.unnamed.class.stmt"))
+ (name (js2-create-name-node t)))
+ (js2-set-face (js2-node-pos name) (js2-node-end name)
+ 'font-lock-type-face 'record)
+ (let ((node (js2-parse-class pos 'CLASS_STATEMENT name)))
+ (js2-record-imenu-functions node name)
+ (js2-define-symbol js2-FUNCTION
+ (js2-name-node-name name)
+ node)
+ node)))
+
+(defun js2-parse-class-expr ()
+ (let ((pos (js2-current-token-beg))
+ name)
+ (when (js2-match-token js2-NAME)
+ (setq name (js2-create-name-node t)))
+ (js2-parse-class pos 'CLASS_EXPRESSION name)))
+
+(defun js2-parse-class (pos form name)
+ ;; class X [extends ...] {
+ (let (pn elems extends)
+ (if (js2-match-token js2-EXTENDS)
+ (if (= (js2-peek-token) js2-LC)
+ (js2-report-error "msg.missing.extends")
+ ;; TODO(sdh): this should be left-hand-side-expr, not assign-expr
+ (setq extends (js2-parse-assign-expr))
+ (if (not extends)
+ (js2-report-error "msg.bad.extends"))))
+ (js2-must-match js2-LC "msg.no.brace.class")
+ (setq elems (js2-parse-object-literal-elems t)
+ pn (make-js2-class-node :pos pos
+ :len (- js2-ts-cursor pos)
+ :form form
+ :name name
+ :extends extends
+ :elems elems))
+ (apply #'js2-node-add-children
+ pn name extends (js2-class-node-elems pn))
+ pn))
+
+(defun js2-parse-object-literal ()
+ (let* ((pos (js2-current-token-beg))
+ (elems (js2-parse-object-literal-elems))
+ (result (make-js2-object-node :pos pos
+ :len (- js2-ts-cursor pos)
+ :elems elems)))
+ (apply #'js2-node-add-children result (js2-object-node-elems result))
+ result))
+
+(defun js2-property-key-string (property-node)
+ "Return the key of PROPERTY-NODE (a `js2-object-prop-node' or
+`js2-method-node') as a string, or nil if it can't be
+represented as a string (e.g., the key is computed by an
+expression)."
+ (cond
+ ((js2-unary-node-p property-node) nil) ;; {...foo}
+ (t
+ (let ((key (js2-infix-node-left property-node)))
+ (when (js2-computed-prop-name-node-p key)
+ (setq key (js2-computed-prop-name-node-expr key)))
+ (cond
+ ((js2-name-node-p key)
+ (js2-name-node-name key))
+ ((js2-string-node-p key)
+ (js2-string-node-value key))
+ ((js2-number-node-p key)
+ (js2-number-node-value key)))))))
+
+(defun js2-parse-object-literal-elems (&optional class-p)
+ (let ((pos (js2-current-token-beg))
+ (static nil)
+ (continue t)
+ tt elems elem
+ elem-key-string previous-elem-key-string
+ after-comma previous-token)
+ (while continue
+ ;; Clear out any lookahead tokens (possibly wrong modifier).
+ ;; FIXME: Deal with this problem in a more systematic fashion.
+ ;; Perhaps by making this modifier affect not how the token
+ ;; struct value is constructed, but what js2-get-token returns
+ ;; based on it.
+ (when (> js2-ti-lookahead 0)
+ (setq js2-ti-lookahead 0)
+ (setq js2-ts-cursor (js2-current-token-end)))
+ (setq tt (js2-get-prop-name-token)
+ static nil
+ elem nil
+ previous-token nil)
+ ;; Handle 'static' keyword only if we're in a class
+ (when (and class-p (= js2-NAME tt)
+ (string= "static" (js2-current-token-string)))
+ (js2-record-face 'font-lock-keyword-face)
+ (setq static t
+ tt (js2-get-prop-name-token)))
+ ;; Handle generator * before the property name for in-line functions
+ (when (and (>= js2-language-version 200)
+ (= js2-MUL tt))
+ (setq previous-token (js2-current-token)
+ tt (js2-get-prop-name-token)))
+ ;; Handle getter, setter and async methods
+ (let ((prop (js2-current-token-string)))
+ (when (and (>= js2-language-version 200)
+ (= js2-NAME tt)
+ (member prop '("get" "set" "async"))
+ (memq (js2-peek-token 'KEYWORD_IS_NAME)
+ `(,js2-NAME ,js2-PRIVATE_NAME ,js2-STRING ,js2-NUMBER ,js2-LB)))
+ (setq previous-token (js2-current-token)
+ tt (js2-get-prop-name-token))))
+ (cond
+ ;; Rest/spread (...expr)
+ ((and (>= js2-language-version 200)
+ (not class-p) (not static) (not previous-token)
+ (= js2-TRIPLEDOT tt))
+ (setq after-comma nil
+ elem (js2-make-unary nil js2-TRIPLEDOT 'js2-parse-assign-expr)))
+ ;; Found a key/value property (of any sort)
+ ((memq tt `(,js2-NAME ,js2-PRIVATE_NAME ,js2-STRING ,js2-NUMBER ,js2-LB))
+ (setq after-comma nil
+ elem (js2-parse-named-prop tt previous-token class-p))
+ (if (and (null elem)
+ (not js2-recover-from-parse-errors))
+ (setq continue nil)))
+ ;; Break out of loop, and handle trailing commas.
+ ((or (= tt js2-RC)
+ (= tt js2-EOF))
+ (js2-unget-token)
+ (setq continue nil)
+ (if after-comma
+ (js2-parse-warn-trailing-comma "msg.extra.trailing.comma"
+ pos elems after-comma)))
+ ;; Skip semicolons in a class body
+ ((and class-p
+ (= tt js2-SEMI))
+ nil)
+ (t
+ (js2-report-error "msg.bad.prop")
+ (unless js2-recover-from-parse-errors
+ (setq continue nil)))) ; end switch
+ ;; Handle static for classes' codegen.
+ (if static
+ (if elem (js2-node-set-prop elem 'STATIC t)
+ (js2-report-error "msg.unexpected.static")))
+ ;; Handle commas, depending on class-p.
+ (let ((tok (js2-get-prop-name-token)))
+ (if (eq tok js2-COMMA)
+ (if class-p
+ (js2-report-error "msg.class.unexpected.comma")
+ (setq after-comma (js2-current-token-end)))
+ (js2-unget-token)
+ (unless class-p (setq continue nil))))
+ (when elem
+ (when (and js2-in-use-strict-directive
+ (setq elem-key-string (js2-property-key-string elem))
+ (cl-some
+ (lambda (previous-elem)
+ (and (setq previous-elem-key-string
+ (js2-property-key-string previous-elem))
+ ;; Check if the property is a duplicate.
+ (string= previous-elem-key-string elem-key-string)
+ ;; But make an exception for getter / setter pairs.
+ (not (and (js2-method-node-p elem)
+ (js2-method-node-p previous-elem)
+ (let ((type (js2-node-get-prop (js2-method-node-right elem) 'METHOD_TYPE))
+ (previous-type (js2-node-get-prop (js2-method-node-right previous-elem) 'METHOD_TYPE)))
+ (and (member type '(GET SET))
+ (member previous-type '(GET SET))
+ (not (eq type previous-type))))))))
+ elems))
+ (js2-report-error "msg.dup.obj.lit.prop.strict"
+ elem-key-string
+ (js2-node-abs-pos (js2-infix-node-left elem))
+ (js2-node-len (js2-infix-node-left elem))))
+ ;; Append any parsed element.
+ (push elem elems))) ; end loop
+ (js2-must-match js2-RC "msg.no.brace.prop")
+ (nreverse elems)))
+
+(defun js2-parse-named-prop (tt previous-token &optional class-p)
+ "Parse a name, string, or getter/setter object property.
+When `js2-is-in-destructuring' is t, forms like {a, b, c} will be permitted."
+ (let ((key (js2-parse-prop-name tt class-p))
+ (prop (and previous-token (js2-token-string previous-token)))
+ (property-type (when previous-token
+ (if (= (js2-token-type previous-token) js2-MUL)
+ "*"
+ (js2-token-string previous-token))))
+ pos)
+ (when (member prop '("get" "set" "async"))
+ (setq pos (js2-token-beg previous-token))
+ (js2-set-face (js2-token-beg previous-token)
+ (js2-token-end previous-token)
+ 'font-lock-keyword-face 'record)) ; get/set/async
+ (cond
+ ;; method definition: {f() {...}}
+ ((and (= (js2-peek-token) js2-LP)
+ (>= js2-language-version 200))
+ (when (or (js2-name-node-p key) (js2-string-node-p key))
+ ;; highlight function name properties
+ (js2-record-face 'font-lock-function-name-face))
+ (js2-parse-method-prop pos key property-type))
+ ;; class field or binding element with initializer
+ ((and (= (js2-peek-token) js2-ASSIGN)
+ (>= js2-language-version 200))
+ (if (not (or class-p
+ js2-is-in-destructuring))
+ (js2-report-error "msg.init.no.destruct"))
+ (js2-parse-initialized-binding key))
+ ;; regular prop
+ (t
+ (let ((beg (js2-current-token-beg))
+ (end (js2-current-token-end))
+ (expr (js2-parse-plain-property key class-p)))
+ (when (and (= tt js2-NAME)
+ (not js2-is-in-destructuring)
+ js2-highlight-external-variables
+ (js2-node-get-prop expr 'SHORTHAND))
+ (js2-record-name-node key))
+ (js2-set-face beg end
+ (if (js2-function-node-p
+ (js2-object-prop-node-right expr))
+ 'font-lock-function-name-face
+ 'js2-object-property)
+ 'record)
+ expr)))))
+
+(defun js2-parse-initialized-binding (name)
+ "Parse a `SingleNameBinding' with initializer.
+
+`name' is the `BindingIdentifier'."
+ (when (js2-match-token js2-ASSIGN)
+ (js2-make-binary js2-ASSIGN name 'js2-parse-assign-expr t)))
+
+(defun js2-parse-prop-name (tt allow-private)
+ (cond
+ ;; Literal string keys: {'foo': 'bar'}
+ ((= tt js2-STRING)
+ (make-js2-string-node))
+ ;; Handle computed keys: {[Symbol.iterator]: ...}, *[1+2]() {...}},
+ ;; {[foo + bar]() { ... }}, {[get ['x' + 1]() {...}}
+ ((and (= tt js2-LB)
+ (>= js2-language-version 200))
+ (make-js2-computed-prop-name-node
+ :expr (prog1 (js2-parse-assign-expr)
+ (js2-must-match js2-RB "msg.missing.computed.rb"))))
+ ;; Numeric keys: {12: 'foo'}, {10.7: 'bar'}
+ ((= tt js2-NUMBER)
+ (make-js2-number-node))
+ ;; Unquoted names: {foo: 12}
+ ((= tt js2-NAME)
+ (js2-create-name-node))
+ ((and allow-private
+ (= tt js2-PRIVATE_NAME))
+ (js2-create-name-node))
+ ;; Anything else is an error
+ (t (js2-report-error "msg.bad.prop"))))
+
+(defun js2-parse-plain-property (prop &optional class-p)
+ "Parse a non-getter/setter property in an object literal.
+PROP is the node representing the property: a number, name,
+string or expression."
+ (let* (tt
+ (pos (js2-node-pos prop))
+ colon expr result)
+ (cond
+ ;; Abbreviated property, as in {foo, bar} or class {a; b}
+ ((and (>= js2-language-version 200)
+ (if class-p
+ (and (setq tt (js2-peek-token-or-eol))
+ (memq tt `(,js2-EOL ,js2-RC ,js2-SEMI)))
+ (and (setq tt (js2-peek-token))
+ (memq tt `(,js2-COMMA ,js2-RC))
+ (js2-name-node-p prop))))
+ (setq result (make-js2-object-prop-node
+ :pos pos
+ :len (js2-node-len prop)
+ :left prop
+ :right prop
+ :op-pos (- (js2-current-token-beg) pos)))
+ (js2-node-add-children result prop)
+ (js2-node-set-prop result 'SHORTHAND t)
+ result)
+ ;; Normal property
+ (t
+ (setq tt (js2-get-token))
+ (if (= tt js2-COLON)
+ (setq colon (- (js2-current-token-beg) pos)
+ expr (js2-parse-assign-expr))
+ (js2-report-error "msg.no.colon.prop")
+ (setq expr (make-js2-error-node)))
+ (setq result (make-js2-object-prop-node
+ :pos pos
+ ;; don't include last consumed token in length
+ :len (- (+ (js2-node-pos expr)
+ (js2-node-len expr))
+ pos)
+ :left prop
+ :right expr
+ :op-pos colon))
+ (js2-node-add-children result prop expr)
+ result))))
+
+(defun js2-parse-method-prop (pos prop type-string)
+ "Parse method property in an object literal or a class body.
+JavaScript syntax is:
+
+ { foo(...) {...}, get foo() {...}, set foo(x) {...}, *foo(...) {...},
+ async foo(...) {...} }
+
+and expression closure style is also supported
+
+ { get foo() x, set foo(x) _x = x }
+
+POS is the start position of the `get' or `set' keyword, if any.
+PROP is the `js2-name-node' representing the property name.
+TYPE-STRING is a string `get', `set', `*', or nil, indicating a found keyword."
+ (let* ((type (or (cdr (assoc type-string '(("get" . GET)
+ ("set" . SET)
+ ("async" . ASYNC))))
+ 'FUNCTION))
+ result end
+ (pos (or pos (js2-current-token-beg)))
+ (_ (js2-must-match js2-LP "msg.no.paren.parms"))
+ (fn (js2-parse-function 'FUNCTION_EXPRESSION pos
+ (string= type-string "*")
+ (eq type 'ASYNC)
+ nil)))
+ (js2-node-set-prop fn 'METHOD_TYPE type) ; for codegen
+ (unless pos (setq pos (js2-node-pos prop)))
+ (setq end (js2-node-end fn)
+ result (make-js2-method-node :pos pos
+ :len (- end pos)
+ :left prop
+ :right fn))
+ (js2-node-add-children result prop fn)
+ result))
+
+(defun js2-create-name-node (&optional check-activation-p token string)
+ "Create a name node using the current token and, optionally, STRING.
+And, if CHECK-ACTIVATION-P is non-nil, use the value of TOKEN."
+ (let* ((beg (js2-current-token-beg))
+ (tt (js2-current-token-type))
+ (s (or string
+ (if (or (= js2-NAME tt) (= js2-PRIVATE_NAME tt))
+ (js2-current-token-string)
+ (js2-tt-name tt))))
+ name)
+ (setq name (make-js2-name-node :pos beg
+ :name s
+ :len (length s)))
+ (if check-activation-p
+ (js2-check-activation-name s (or token js2-NAME)))
+ name))
+
+;;; Use AST to extract semantic information
+
+(defun js2-get-element-index-from-array-node (elem array-node &optional hardcoded-array-index)
+ "Get index of ELEM from ARRAY-NODE or 0 and return it as string."
+ (let ((idx 0) elems (rlt hardcoded-array-index))
+ (setq elems (js2-array-node-elems array-node))
+ (if (and elem (not hardcoded-array-index))
+ (setq rlt (catch 'nth-elt
+ (dolist (x elems)
+ ;; We know the ELEM does belong to ARRAY-NODE,
+ (if (eq elem x) (throw 'nth-elt idx))
+ (setq idx (1+ idx)))
+ 0)))
+ (format "[%s]" rlt)))
+
+(defun js2-print-json-path (&optional hardcoded-array-index)
+ "Print the path to the JSON value under point, and save it in the kill ring.
+If HARDCODED-ARRAY-INDEX provided, array index in JSON path is replaced with it."
+ (interactive "P")
+ (js2-reparse)
+ (let (previous-node current-node
+ key-name
+ rlt)
+
+ ;; The `js2-node-at-point' starts scanning from AST root node.
+ ;; So there is no way to optimize it.
+ (setq current-node (js2-node-at-point))
+
+ (while (not (js2-ast-root-p current-node))
+ (cond
+ ;; JSON property node
+ ((js2-object-prop-node-p current-node)
+ (setq key-name (js2-prop-node-name (js2-object-prop-node-left current-node)))
+ (if rlt (setq rlt (concat "." key-name rlt))
+ (setq rlt (concat "." key-name))))
+
+ ;; Array node
+ ((or (js2-array-node-p current-node))
+ (setq rlt (concat (js2-get-element-index-from-array-node previous-node
+ current-node
+ hardcoded-array-index)
+ rlt)))
+
+ ;; Other nodes are ignored
+ (t))
+
+ ;; current node is archived
+ (setq previous-node current-node)
+ ;; Get parent node and continue the loop
+ (setq current-node (js2-node-parent current-node)))
+
+ (cond
+ (rlt
+ ;; Clean the final result
+ (setq rlt (replace-regexp-in-string "^\\." "" rlt))
+ (kill-new rlt)
+ (message "%s => kill-ring" rlt))
+ (t
+ (message "No JSON path found!")))
+
+ rlt))
+
+;;; Indentation support (bouncing)
+
+;; In recent-enough Emacs, we reuse the indentation code from
+;; `js-mode'. To continue support for the older versions, some code
+;; that was here previously was moved to `js2-old-indent.el'.
+
+;; Whichever indenter is used, it's often "wrong", however, and needs
+;; to be overridden. The right long-term solution is probably to
+;; emulate (or integrate with) cc-engine, but it's a nontrivial amount
+;; of coding. Even when a parse tree from `js2-parse' is present,
+;; which is not true at the moment the user is typing, computing
+;; indentation is still thousands of lines of code to handle every
+;; possible syntactic edge case.
+
+;; In the meantime, the compromise solution is that we offer a "bounce
+;; indenter", configured with `js2-bounce-indent-p', which cycles the
+;; current line indent among various likely guess points. This approach
+;; is far from perfect, but should at least make it slightly easier to
+;; move the line towards its desired indentation when manually
+;; overriding Karl's heuristic nesting guesser.
+
+(defun js2-backward-sws ()
+ "Move backward through whitespace and comments."
+ (interactive)
+ (while (forward-comment -1)))
+
+(defun js2-forward-sws ()
+ "Move forward through whitespace and comments."
+ (interactive)
+ (while (forward-comment 1)))
+
+(defun js2-arglist-close ()
+ "Return non-nil if we're on a line beginning with a close-paren/brace."
+ (save-excursion
+ (goto-char (point-at-bol))
+ (js2-forward-sws)
+ (looking-at "[])}]")))
+
+(defun js2-indent-looks-like-label-p ()
+ (goto-char (point-at-bol))
+ (js2-forward-sws)
+ (looking-at (concat js2-mode-identifier-re ":")))
+
+(defun js2-indent-in-objlit-p (parse-status)
+ "Return non-nil if this looks like an object-literal entry."
+ (let ((start (nth 1 parse-status)))
+ (and
+ start
+ (save-excursion
+ (and (zerop (forward-line -1))
+ (not (< (point) start)) ; crossed a {} boundary
+ (js2-indent-looks-like-label-p)))
+ (save-excursion
+ (js2-indent-looks-like-label-p)))))
+
+;; If prev line looks like foobar({ then we're passing an object
+;; literal to a function call, and people pretty much always want to
+;; de-dent back to the previous line, so move the 'basic-offset'
+;; position to the front.
+(defun js2-indent-objlit-arg-p (parse-status)
+ (save-excursion
+ (back-to-indentation)
+ (js2-backward-sws)
+ (and (eq (1- (point)) (nth 1 parse-status))
+ (eq (char-before) ?{)
+ (progn
+ (forward-char -1)
+ (skip-chars-backward " \t")
+ (eq (char-before) ?\()))))
+
+(defun js2-indent-case-block-p ()
+ (save-excursion
+ (back-to-indentation)
+ (js2-backward-sws)
+ (goto-char (point-at-bol))
+ (skip-chars-forward " \t")
+ (looking-at "case\\s-.+:")))
+
+(defun js2-bounce-indent (normal-col parse-status &optional backward)
+ "Cycle among alternate computed indentation positions.
+PARSE-STATUS is the result of `parse-partial-sexp' from the beginning
+of the buffer to the current point. NORMAL-COL is the indentation
+column computed by the heuristic guesser based on current paren,
+bracket, brace and statement nesting. If BACKWARDS, cycle positions
+in reverse."
+ (let ((cur-indent (current-indentation))
+ (old-buffer-undo-list buffer-undo-list)
+ ;; Emacs 21 only has `count-lines', not `line-number-at-pos'
+ (current-line (save-excursion
+ (forward-line 0) ; move to bol
+ (1+ (count-lines (point-min) (point)))))
+ positions pos main-pos anchor arglist-cont same-indent
+ basic-offset computed-pos)
+ ;; temporarily don't record undo info, if user requested this
+ (when js2-mode-indent-inhibit-undo
+ (setq buffer-undo-list t))
+ (unwind-protect
+ (progn
+ ;; First likely point: indent from beginning of previous code line
+ (push (setq basic-offset
+ (+ (save-excursion
+ (back-to-indentation)
+ (js2-backward-sws)
+ (back-to-indentation)
+ (current-column))
+ js2-basic-offset))
+ positions)
+
+ ;; (First + epsilon) likely point: indent 2x from beginning of
+ ;; previous code line. Google does it this way.
+ (push (setq basic-offset
+ (+ (save-excursion
+ (back-to-indentation)
+ (js2-backward-sws)
+ (back-to-indentation)
+ (current-column))
+ (* 2 js2-basic-offset)))
+ positions)
+
+ ;; Second likely point: indent from assign-expr RHS. This
+ ;; is just a crude guess based on finding " = " on the previous
+ ;; line containing actual code.
+ (setq pos (save-excursion
+ (forward-line -1)
+ (goto-char (point-at-bol))
+ (when (re-search-forward "\\s-+\\(=\\)\\s-+"
+ (point-at-eol) t)
+ (goto-char (match-end 1))
+ (skip-chars-forward " \t\r\n")
+ (current-column))))
+ (when pos
+ (cl-incf pos js2-basic-offset)
+ (push pos positions))
+
+ ;; Third likely point: same indent as previous line of code.
+ ;; Make it the first likely point if we're not on an
+ ;; arglist-close line and previous line ends in a comma, or
+ ;; both this line and prev line look like object-literal
+ ;; elements.
+ (setq pos (save-excursion
+ (goto-char (point-at-bol))
+ (js2-backward-sws)
+ (back-to-indentation)
+ (prog1
+ (current-column)
+ ;; while we're here, look for trailing comma
+ (if (save-excursion
+ (goto-char (point-at-eol))
+ (js2-backward-sws)
+ (eq (char-before) ?,))
+ (setq arglist-cont (1- (point)))))))
+ (when pos
+ (if (and (or arglist-cont
+ (js2-indent-in-objlit-p parse-status))
+ (not (js2-arglist-close)))
+ (setq same-indent pos))
+ (push pos positions))
+
+ ;; Fourth likely point: first preceding code with less indentation.
+ ;; than the immediately preceding code line.
+ (setq pos (save-excursion
+ (back-to-indentation)
+ (js2-backward-sws)
+ (back-to-indentation)
+ (setq anchor (current-column))
+ (while (and (zerop (forward-line -1))
+ (>= (progn
+ (back-to-indentation)
+ (current-column))
+ anchor)))
+ (setq pos (current-column))))
+ (push pos positions)
+
+ ;; nesting-heuristic position, main by default
+ (push (setq main-pos normal-col) positions)
+
+ ;; delete duplicates and sort positions list
+ (setq positions (sort (delete-dups positions) '<))
+
+ ;; comma-list continuation lines: prev line indent takes precedence
+ (if same-indent
+ (setq main-pos same-indent))
+
+ ;; common special cases where we want to indent in from previous line
+ (if (or (js2-indent-case-block-p)
+ (js2-indent-objlit-arg-p parse-status))
+ (setq main-pos basic-offset))
+
+ ;; if bouncing backward, reverse positions list
+ (if backward
+ (setq positions (reverse positions)))
+
+ ;; record whether we're already sitting on one of the alternatives
+ (setq pos (member cur-indent positions))
+
+ (cond
+ ;; case 0: we're one one of the alternatives and this is the
+ ;; first time they've pressed TAB on this line (best-guess).
+ ((and js2-mode-indent-ignore-first-tab
+ pos
+ ;; first time pressing TAB on this line?
+ (not (eq js2-mode-last-indented-line current-line)))
+ ;; do nothing
+ (setq computed-pos nil))
+ ;; case 1: only one computed position => use it
+ ((null (cdr positions))
+ (setq computed-pos 0))
+ ;; case 2: not on any of the computed spots => use main spot
+ ((not pos)
+ (setq computed-pos (js2-position main-pos positions)))
+ ;; case 3: on last position: cycle to first position
+ ((null (cdr pos))
+ (setq computed-pos 0))
+ ;; case 4: on intermediate position: cycle to next position
+ (t
+ (setq computed-pos (js2-position (cl-second pos) positions))))
+
+ ;; see if any hooks want to indent; otherwise we do it
+ (cl-loop with result = nil
+ for hook in js2-indent-hook
+ while (null result)
+ do
+ (setq result (funcall hook positions computed-pos))
+ finally do
+ (unless (or result (null computed-pos))
+ (indent-line-to (nth computed-pos positions)))))
+
+ ;; finally
+ (if js2-mode-indent-inhibit-undo
+ (setq buffer-undo-list old-buffer-undo-list))
+ ;; see commentary for `js2-mode-last-indented-line'
+ (setq js2-mode-last-indented-line current-line))))
+
+(defun js2-1-line-comment-continuation-p ()
+ "Return t if we're in a 1-line comment continuation.
+If so, we don't ever want to use bounce-indent."
+ (save-excursion
+ (and (progn
+ (forward-line 0)
+ (looking-at "\\s-*//"))
+ (progn
+ (forward-line -1)
+ (forward-line 0)
+ (when (looking-at "\\s-*$")
+ (js2-backward-sws)
+ (forward-line 0))
+ (looking-at "\\s-*//")))))
+
+(defun js2-indent-bounce (&optional backward)
+ "Indent the current line, bouncing between several positions."
+ (interactive)
+ (let (parse-status offset indent-col
+ ;; Don't whine about errors/warnings when we're indenting.
+ ;; This has to be set before calling parse-partial-sexp below.
+ (inhibit-point-motion-hooks t))
+ (setq parse-status (save-excursion
+ (syntax-ppss (point-at-bol)))
+ offset (- (point) (save-excursion
+ (back-to-indentation)
+ (point))))
+ ;; Don't touch multiline strings.
+ (unless (nth 3 parse-status)
+ (setq indent-col (js2-proper-indentation parse-status))
+ (cond
+ ;; It doesn't work well on first line of buffer.
+ ((and (not (nth 4 parse-status))
+ (not (js2-same-line (point-min)))
+ (not (js2-1-line-comment-continuation-p)))
+ (js2-bounce-indent indent-col parse-status backward))
+ ;; just indent to the guesser's likely spot
+ (t (indent-line-to indent-col)))
+ (when (cl-plusp offset)
+ (forward-char offset)))))
+
+(defun js2-indent-bounce-backward ()
+ "Indent the current line, bouncing between positions in reverse."
+ (interactive)
+ (js2-indent-bounce t))
+
+(defun js2-indent-region (start end)
+ "Indent the region, but don't use bounce indenting."
+ (let ((js2-bounce-indent-p nil)
+ (indent-region-function nil)
+ (after-change-functions (remq 'js2-mode-edit
+ after-change-functions)))
+ (indent-region start end nil) ; nil for byte-compiler
+ (js2-mode-edit start end (- end start))))
+
+(defvar js2-minor-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map (kbd "C-c C-`") #'js2-next-error)
+ map)
+ "Keymap used when `js2-minor-mode' is active.")
+
+;;;###autoload
+(define-minor-mode js2-minor-mode
+ "Minor mode for running js2 as a background linter.
+This allows you to use a different major mode for JavaScript editing,
+such as `js-mode', while retaining the asynchronous error/warning
+highlighting features of `js2-mode'."
+ :group 'js2-mode
+ :lighter " js-lint"
+ (if (derived-mode-p 'js2-mode)
+ (setq js2-minor-mode nil)
+ (if js2-minor-mode
+ (js2-minor-mode-enter)
+ (js2-minor-mode-exit))))
+
+(defun js2-minor-mode-enter ()
+ "Initialization for `js2-minor-mode'."
+ (set (make-local-variable 'max-lisp-eval-depth)
+ (max max-lisp-eval-depth 3000))
+ (setq next-error-function #'js2-next-error)
+ ;; Experiment: make reparse-delay longer for longer files.
+ (if (cl-plusp js2-dynamic-idle-timer-adjust)
+ (setq js2-idle-timer-delay
+ (* js2-idle-timer-delay
+ (/ (point-max) js2-dynamic-idle-timer-adjust))))
+ (setq js2-mode-buffer-dirty-p t
+ js2-mode-parsing nil)
+ (set (make-local-variable 'js2-highlight-level) 0) ; no syntax highlighting
+ (set (make-local-variable 'js2-mode-change-syntax-p) nil)
+ (add-hook 'after-change-functions #'js2-minor-mode-edit nil t)
+ (add-hook 'change-major-mode-hook #'js2-minor-mode-exit nil t)
+ (when js2-include-jslint-globals
+ (add-hook 'js2-post-parse-callbacks 'js2-apply-jslint-globals nil t))
+ (when js2-include-jslint-declaration-externs
+ (add-hook 'js2-post-parse-callbacks 'js2-apply-jslint-declaration-externs nil t))
+ (run-hooks 'js2-init-hook)
+ (js2-reparse))
+
+(defun js2-minor-mode-exit ()
+ "Turn off `js2-minor-mode'."
+ (setq next-error-function nil)
+ (remove-hook 'after-change-functions #'js2-mode-edit t)
+ (remove-hook 'change-major-mode-hook #'js2-minor-mode-exit t)
+ (when js2-mode-node-overlay
+ (delete-overlay js2-mode-node-overlay)
+ (setq js2-mode-node-overlay nil))
+ (js2-remove-overlays)
+ (remove-hook 'js2-post-parse-callbacks 'js2-apply-jslint-globals t)
+ (remove-hook 'js2-post-parse-callbacks 'js2-apply-jslint-declaration-externs t)
+ (setq js2-mode-ast nil))
+
+(defvar js2-source-buffer nil "Linked source buffer for diagnostics view")
+(make-variable-buffer-local 'js2-source-buffer)
+
+(cl-defun js2-display-error-list ()
+ "Display a navigable buffer listing parse errors/warnings."
+ (interactive)
+ (unless (js2-have-errors-p)
+ (message "No errors")
+ (cl-return-from js2-display-error-list))
+ (cl-labels ((annotate-list
+ (lst type)
+ "Add diagnostic TYPE and line number to errs list"
+ (mapcar (lambda (err)
+ (list err type (line-number-at-pos (nth 1 err))))
+ lst)))
+ (let* ((srcbuf (current-buffer))
+ (errbuf (get-buffer-create "*js-lint*"))
+ (errors (annotate-list
+ (when js2-mode-ast (js2-ast-root-errors js2-mode-ast))
+ 'js2-error)) ; must be a valid face name
+ (warnings (annotate-list
+ (when js2-mode-ast (js2-ast-root-warnings js2-mode-ast))
+ 'js2-warning)) ; must be a valid face name
+ (all-errs (sort (append errors warnings)
+ (lambda (e1 e2) (< (cl-cadar e1) (cl-cadar e2))))))
+ (with-current-buffer errbuf
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (dolist (err all-errs)
+ (cl-destructuring-bind ((msg-key beg _end &rest rest) type line) err
+ (insert-text-button
+ (format "line %d: %s" line (js2-get-msg msg-key))
+ 'face type
+ 'follow-link "\C-m"
+ 'action 'js2-error-buffer-jump
+ 'js2-msg (js2-get-msg msg-key)
+ 'js2-pos beg)
+ (insert "\n"))))
+ (js2-error-buffer-mode)
+ (setq js2-source-buffer srcbuf)
+ (pop-to-buffer errbuf)
+ (goto-char (point-min))
+ (unless (eobp)
+ (js2-error-buffer-view))))))
+
+(defvar js2-error-buffer-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "n" #'js2-error-buffer-next)
+ (define-key map "p" #'js2-error-buffer-prev)
+ (define-key map (kbd "RET") #'js2-error-buffer-jump)
+ (define-key map "o" #'js2-error-buffer-view)
+ (define-key map "q" #'js2-error-buffer-quit)
+ map)
+ "Keymap used for js2 diagnostics buffers.")
+
+(define-derived-mode js2-error-buffer-mode special-mode "JS Lint Diagnostics"
+ "Major mode for js2 diagnostics buffers.
+Selecting an error will jump it to the corresponding source-buffer error.
+\\{js2-error-buffer-mode-map}"
+ (setq truncate-lines t)
+ (set-buffer-modified-p nil)
+ (setq buffer-read-only t))
+
+(defun js2-error-buffer-next ()
+ "Move to next error and view it."
+ (interactive)
+ (when (zerop (forward-line 1))
+ (js2-error-buffer-view)))
+
+(defun js2-error-buffer-prev ()
+ "Move to previous error and view it."
+ (interactive)
+ (when (zerop (forward-line -1))
+ (js2-error-buffer-view)))
+
+(defun js2-error-buffer-quit ()
+ "Kill the current buffer."
+ (interactive)
+ (kill-buffer))
+
+(defun js2-error-buffer-jump (&rest ignored)
+ "Jump cursor to current error in source buffer."
+ (interactive)
+ (when (js2-error-buffer-view)
+ (pop-to-buffer js2-source-buffer)))
+
+(defun js2-error-buffer-view ()
+ "Scroll source buffer to show error at current line."
+ (interactive)
+ (cond
+ ((not (derived-mode-p 'js2-error-buffer-mode))
+ (message "Not in a js2 errors buffer"))
+ ((not (buffer-live-p js2-source-buffer))
+ (message "Source buffer has been killed"))
+ ((not (wholenump (get-text-property (point) 'js2-pos)))
+ (message "There does not seem to be an error here"))
+ (t
+ (let ((pos (get-text-property (point) 'js2-pos))
+ (msg (get-text-property (point) 'js2-msg)))
+ (save-selected-window
+ (pop-to-buffer js2-source-buffer)
+ (goto-char pos)
+ (message msg))))))
+
+;;;###autoload
+(define-derived-mode js2-mode js-mode "Javascript-IDE"
+ "Major mode for editing JavaScript code."
+ (set (make-local-variable 'max-lisp-eval-depth)
+ (max max-lisp-eval-depth 3000))
+ (set (make-local-variable 'indent-line-function) #'js2-indent-line)
+ (set (make-local-variable 'indent-region-function) #'js2-indent-region)
+ (set (make-local-variable 'syntax-propertize-function) nil)
+ (set (make-local-variable 'comment-line-break-function) #'js2-line-break)
+ (set (make-local-variable 'beginning-of-defun-function) #'js2-beginning-of-defun)
+ (set (make-local-variable 'end-of-defun-function) #'js2-end-of-defun)
+ ;; We un-confuse `parse-partial-sexp' by setting syntax-table properties
+ ;; for characters inside regexp literals.
+ (set (make-local-variable 'parse-sexp-lookup-properties) t)
+ ;; this is necessary to make `show-paren-function' work properly
+ (set (make-local-variable 'parse-sexp-ignore-comments) t)
+ ;; needed for M-x rgrep, among other things
+ (put 'js2-mode 'find-tag-default-function #'js2-mode-find-tag)
+
+ (setq font-lock-defaults '(nil t))
+
+ ;; Experiment: make reparse-delay longer for longer files.
+ (when (cl-plusp js2-dynamic-idle-timer-adjust)
+ (setq js2-idle-timer-delay
+ (* js2-idle-timer-delay
+ (/ (point-max) js2-dynamic-idle-timer-adjust))))
+
+ (add-hook 'change-major-mode-hook #'js2-mode-exit nil t)
+ (add-hook 'after-change-functions #'js2-mode-edit nil t)
+ (setq imenu-create-index-function #'js2-mode-create-imenu-index)
+ (setq next-error-function #'js2-next-error)
+ (imenu-add-to-menubar (concat "IM-" mode-name))
+ (add-to-invisibility-spec '(js2-outline . t))
+ (set (make-local-variable 'line-move-ignore-invisible) t)
+ (set (make-local-variable 'forward-sexp-function) #'js2-mode-forward-sexp)
+ (when (fboundp 'cursor-sensor-mode) (cursor-sensor-mode 1))
+
+ (setq js2-mode-functions-hidden nil
+ js2-mode-comments-hidden nil
+ js2-mode-buffer-dirty-p t
+ js2-mode-parsing nil)
+
+ (when js2-include-jslint-globals
+ (add-hook 'js2-post-parse-callbacks 'js2-apply-jslint-globals nil t))
+ (when js2-include-jslint-declaration-externs
+ (add-hook 'js2-post-parse-callbacks 'js2-apply-jslint-declaration-externs nil t))
+
+ (run-hooks 'js2-init-hook)
+
+ (let ((js2-idle-timer-delay 0))
+ ;; Schedule parsing for after when the mode hooks run.
+ (js2-mode-reset-timer)))
+
+;;;###autoload
+(define-derived-mode js2-jsx-mode js2-mode "JSX-IDE"
+ "Major mode for editing JSX code in Emacs 26 and earlier.
+
+To edit JSX code in Emacs 27, use `js-mode' as your major mode
+with `js2-minor-mode' enabled.
+
+To customize the indentation for this mode, set the SGML offset
+variables (`sgml-basic-offset' et al) locally, like so:
+
+ (defun set-jsx-indentation ()
+ (setq-local sgml-basic-offset js2-basic-offset))
+ (add-hook \\='js2-jsx-mode-hook #\\='set-jsx-indentation)"
+ (unless (version< emacs-version "27.0")
+ ;; Emacs 27 causes a regression in this mode since JSX indentation
+ ;; begins to rely on js-mode’s `syntax-propertize-function', which
+ ;; JS2 is not currently using.
+ ;; https://github.com/mooz/js2-mode/issues/529 should address
+ ;; this. https://github.com/mooz/js2-mode/issues/530 also has a
+ ;; piece related to the design of `js2-jsx-mode'. Until these
+ ;; issues are addressed, ward Emacs 27 users away from this mode.
+ (display-warning 'js2-mode "For JSX support, use js-mode with js2-minor-mode"))
+ (set (make-local-variable 'indent-line-function) #'js2-jsx-indent-line))
+
+(defun js2-mode-exit ()
+ "Exit `js2-mode' and clean up."
+ (interactive)
+ (when js2-mode-node-overlay
+ (delete-overlay js2-mode-node-overlay)
+ (setq js2-mode-node-overlay nil))
+ (js2-remove-overlays)
+ (setq js2-mode-ast nil)
+ (remove-hook 'change-major-mode-hook #'js2-mode-exit t)
+ (remove-from-invisibility-spec '(js2-outline . t))
+ (js2-mode-show-all)
+ (with-silent-modifications
+ (js2-clear-face (point-min) (point-max))))
+
+(defun js2-mode-reset-timer ()
+ "Cancel any existing parse timer and schedule a new one."
+ (if js2-mode-parse-timer
+ (cancel-timer js2-mode-parse-timer))
+ (setq js2-mode-parsing nil)
+ (let ((timer (timer-create)))
+ (setq js2-mode-parse-timer timer)
+ (timer-set-function timer 'js2-mode-idle-reparse (list (current-buffer)))
+ (timer-set-idle-time timer js2-idle-timer-delay)
+ ;; http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12326
+ (timer-activate-when-idle timer nil)))
+
+(defun js2-mode-idle-reparse (buffer)
+ "Run `js2-reparse' if BUFFER is the current buffer, or schedule
+it to be reparsed when the buffer is selected."
+ (cond ((eq buffer (current-buffer))
+ (js2-reparse))
+ ((buffer-live-p buffer)
+ ;; reparse when the buffer is selected again
+ (with-current-buffer buffer
+ (add-hook 'window-configuration-change-hook
+ #'js2-mode-idle-reparse-inner
+ nil t)))))
+
+(defun js2-mode-idle-reparse-inner ()
+ (remove-hook 'window-configuration-change-hook
+ #'js2-mode-idle-reparse-inner
+ t)
+ (js2-reparse))
+
+(defun js2-mode-edit (_beg _end _len)
+ "Schedule a new parse after buffer is edited.
+Buffer edit spans from BEG to END and is of length LEN."
+ (setq js2-mode-buffer-dirty-p t)
+ (js2-mode-hide-overlay)
+ (js2-mode-reset-timer))
+
+(defun js2-minor-mode-edit (_beg _end _len)
+ "Callback for buffer edits in `js2-mode'.
+Schedules a new parse after buffer is edited.
+Buffer edit spans from BEG to END and is of length LEN."
+ (setq js2-mode-buffer-dirty-p t)
+ (js2-mode-hide-overlay)
+ (js2-mode-reset-timer))
+
+(defun js2-reparse (&optional force)
+ "Re-parse current buffer after user finishes some data entry.
+If we get any user input while parsing, including cursor motion,
+we discard the parse and reschedule it. If FORCE is nil, then the
+buffer will only rebuild its `js2-mode-ast' if the buffer is dirty."
+ (let (time
+ interrupted-p
+ (js2-compiler-strict-mode js2-mode-show-strict-warnings))
+ (unless js2-mode-parsing
+ (setq js2-mode-parsing t)
+ (unwind-protect
+ (when (or js2-mode-buffer-dirty-p force)
+ (js2-remove-overlays)
+ (setq js2-mode-buffer-dirty-p nil
+ js2-mode-fontifications nil
+ js2-mode-deferred-properties nil)
+ (if js2-mode-verbose-parse-p
+ (message "parsing..."))
+ (setq time
+ (js2-time
+ (setq interrupted-p
+ (catch 'interrupted
+ (js2-parse)
+ (with-silent-modifications
+ ;; if parsing is interrupted, comments and regex
+ ;; literals stay ignored by `parse-partial-sexp'
+ (when js2-mode-change-syntax-p
+ (remove-text-properties (point-min) (point-max)
+ '(syntax-table)))
+ (js2-mode-apply-deferred-properties)
+ (js2-mode-remove-suppressed-warnings)
+ (js2-mode-show-warnings)
+ (js2-mode-show-errors)
+ (if (>= js2-highlight-level 1)
+ (js2-highlight-jsdoc js2-mode-ast)))
+ nil))))
+ (if interrupted-p
+ (progn
+ ;; unfinished parse => try again
+ (setq js2-mode-buffer-dirty-p t)
+ (js2-mode-reset-timer))
+ (if js2-mode-verbose-parse-p
+ (message "Parse time: %s" time))))
+ (setq js2-mode-parsing nil)
+ (unless interrupted-p
+ (setq js2-mode-parse-timer nil))))))
+
+;; We bound it to [mouse-1] previously. But the signature of
+;; mouse-set-point changed around 24.4, so it's kind of hard to keep
+;; it working in 24.1-24.3. Since the command is not hugely
+;; important, we removed the binding (#356). Maybe we'll bring it
+;; back when supporting <24.4 is not a goal anymore.
+(defun js2-mode-show-node (event &optional promote-to-region)
+ "Debugging aid: highlight selected AST node on mouse click."
+ (interactive "e\np")
+ (mouse-set-point event promote-to-region)
+ (when js2-mode-show-overlay
+ (let ((node (js2-node-at-point))
+ beg end)
+ (if (null node)
+ (message "No node found at location %s" (point))
+ (setq beg (js2-node-abs-pos node)
+ end (+ beg (js2-node-len node)))
+ (if js2-mode-node-overlay
+ (move-overlay js2-mode-node-overlay beg end)
+ (setq js2-mode-node-overlay (make-overlay beg end))
+ (overlay-put js2-mode-node-overlay 'font-lock-face 'highlight))
+ (with-silent-modifications
+ (if (fboundp 'cursor-sensor-mode)
+ (put-text-property beg end 'cursor-sensor-functions
+ '(js2-mode-hide-overlay))
+ (put-text-property beg end 'point-left #'js2-mode-hide-overlay)))
+ (message "%s, parent: %s"
+ (js2-node-short-name node)
+ (if (js2-node-parent node)
+ (js2-node-short-name (js2-node-parent node))
+ "nil"))))))
+
+(defun js2-mode-hide-overlay (&optional arg1 arg2 _arg3)
+ "Remove the debugging overlay when point moves.
+ARG1, ARG2 and ARG3 have different values depending on whether this function
+was found on `point-left' or in `cursor-sensor-functions'."
+ (when js2-mode-node-overlay
+ (let ((beg (overlay-start js2-mode-node-overlay))
+ (end (overlay-end js2-mode-node-overlay))
+ (p2 (if (windowp arg1)
+ ;; Called from cursor-sensor-functions.
+ (window-point arg1)
+ ;; Called from point-left.
+ arg2)))
+ ;; Sometimes we're called spuriously.
+ (unless (and p2
+ (>= p2 beg)
+ (<= p2 end))
+ (with-silent-modifications
+ (remove-text-properties beg end
+ '(point-left nil cursor-sensor-functions)))
+ (delete-overlay js2-mode-node-overlay)
+ (setq js2-mode-node-overlay nil)))))
+
+(defun js2-mode-reset ()
+ "Debugging helper: reset everything."
+ (interactive)
+ (js2-mode-exit)
+ (js2-mode))
+
+(defun js2-mode-show-warn-or-err (e face)
+ "Highlight a warning or error E with FACE.
+E is a list of ((MSG-KEY MSG-ARG) BEG LEN OVERRIDE-FACE).
+The last element is optional. When present, use instead of FACE."
+ (let* ((key (cl-first e))
+ (beg (cl-second e))
+ (end (+ beg (cl-third e)))
+ ;; Don't inadvertently go out of bounds.
+ (beg (max (point-min) (min beg (point-max))))
+ (end (max (point-min) (min end (point-max))))
+ (ovl (make-overlay beg end)))
+ ;; FIXME: Why a mix of overlays and text-properties?
+ (overlay-put ovl 'font-lock-face (or (cl-fourth e) face))
+ (overlay-put ovl 'js2-error t)
+ (put-text-property beg end 'help-echo (js2-get-msg key))
+ (if (fboundp 'cursor-sensor-mode)
+ (put-text-property beg end 'cursor-sensor-functions '(js2-echo-error))
+ (put-text-property beg end 'point-entered #'js2-echo-error))))
+
+(defun js2-remove-overlays ()
+ "Remove overlays from buffer that have a `js2-error' property."
+ (let ((beg (point-min))
+ (end (point-max)))
+ (save-excursion
+ (dolist (o (overlays-in beg end))
+ (when (overlay-get o 'js2-error)
+ (delete-overlay o))))))
+
+(defun js2-mode-apply-deferred-properties ()
+ "Apply fontifications and other text properties recorded during parsing."
+ (when (cl-plusp js2-highlight-level)
+ ;; We defer clearing faces as long as possible to eliminate flashing.
+ (js2-clear-face (point-min) (point-max))
+ ;; Have to reverse the recorded fontifications list so that errors
+ ;; and warnings overwrite the normal fontifications.
+ (dolist (f (nreverse js2-mode-fontifications))
+ (put-text-property (cl-first f) (cl-second f) 'font-lock-face (cl-third f)))
+ (setq js2-mode-fontifications nil))
+ (dolist (p js2-mode-deferred-properties)
+ (apply #'put-text-property p))
+ (setq js2-mode-deferred-properties nil))
+
+(defun js2-mode-show-errors ()
+ "Highlight syntax errors."
+ (when js2-mode-show-parse-errors
+ (dolist (e (js2-ast-root-errors js2-mode-ast))
+ (js2-mode-show-warn-or-err e 'js2-error))))
+
+(defun js2-mode-remove-suppressed-warnings ()
+ "Take suppressed warnings out of the AST warnings list.
+This ensures that the counts and `next-error' are correct."
+ (setf (js2-ast-root-warnings js2-mode-ast)
+ (js2-delete-if
+ (lambda (e)
+ (let ((key (caar e)))
+ (or
+ (and (not js2-strict-trailing-comma-warning)
+ (string-match "trailing\\.comma" key))
+ (and (not js2-strict-cond-assign-warning)
+ (string= key "msg.equal.as.assign"))
+ (and js2-missing-semi-one-line-override
+ (string= key "msg.missing.semi")
+ (let* ((beg (cl-second e))
+ (node (js2-node-at-point beg))
+ (fn (js2-mode-find-parent-fn node))
+ (body (and fn (js2-function-node-body fn)))
+ (lc (and body (js2-node-abs-pos body)))
+ (rc (and lc (+ lc (js2-node-len body)))))
+ (and fn
+ (or (null body)
+ (save-excursion
+ (goto-char beg)
+ (and (js2-same-line lc)
+ (js2-same-line rc))))))))))
+ (js2-ast-root-warnings js2-mode-ast))))
+
+(defun js2-mode-show-warnings ()
+ "Highlight strict-mode warnings."
+ (when js2-mode-show-strict-warnings
+ (dolist (e (js2-ast-root-warnings js2-mode-ast))
+ (js2-mode-show-warn-or-err e 'js2-warning))))
+
+(defun js2-echo-error (arg1 arg2 &optional _arg3)
+ "Called by point-motion hooks.
+ARG1, ARG2 and ARG3 have different values depending on whether this function
+was found on `point-entered' or in `cursor-sensor-functions'."
+ (let* ((new-point (if (windowp arg1)
+ ;; Called from cursor-sensor-functions.
+ (window-point arg1)
+ ;; Called from point-left.
+ arg2))
+ (msg (get-text-property new-point 'help-echo)))
+ (when (and (stringp msg)
+ (not (active-minibuffer-window))
+ (not (current-message)))
+ (message msg))))
+
+(defun js2-line-break (&optional _soft)
+ "Break line at point and indent, continuing comment if within one.
+If inside a string, and `js2-concat-multiline-strings' is not
+nil, turn it into concatenation."
+ (interactive)
+ (let ((parse-status (syntax-ppss)))
+ (cond
+ ;; Check if we're inside a string.
+ ((nth 3 parse-status)
+ (if js2-concat-multiline-strings
+ (js2-mode-split-string parse-status)
+ (insert "\n")))
+ ;; Check if inside a block comment.
+ ((nth 4 parse-status)
+ (js2-mode-extend-comment (nth 8 parse-status)))
+ (t
+ (newline-and-indent)))))
+
+(defun js2-mode-split-string (parse-status)
+ "Turn a newline in mid-string into a string concatenation.
+PARSE-STATUS is as documented in `parse-partial-sexp'."
+ (let* ((quote-char (nth 3 parse-status))
+ (at-eol (eq js2-concat-multiline-strings 'eol)))
+ (insert quote-char)
+ (insert (if at-eol " +\n" "\n"))
+ (unless at-eol
+ (insert "+ "))
+ (js2-indent-line)
+ (insert quote-char)
+ (when (eolp)
+ (insert quote-char)
+ (backward-char 1))))
+
+(defun js2-mode-extend-comment (start-pos)
+ "Indent the line and, when inside a comment block, add comment prefix."
+ (let (star single col first-line needs-close)
+ (save-excursion
+ (back-to-indentation)
+ (when (< (point) start-pos)
+ (goto-char start-pos))
+ (cond
+ ((looking-at "\\*[^/]")
+ (setq star t
+ col (current-column)))
+ ((looking-at "/\\*")
+ (setq star t
+ first-line t
+ col (1+ (current-column))))
+ ((looking-at "//")
+ (setq single t
+ col (current-column)))))
+ ;; Heuristic for whether we need to close the comment:
+ ;; if we've got a parse error here, assume it's an unterminated
+ ;; comment.
+ (setq needs-close
+ (or
+ (get-char-property (1- (point)) 'js2-error)
+ ;; The heuristic above doesn't work well when we're
+ ;; creating a comment and there's another one downstream,
+ ;; as our parser thinks this one ends at the end of the
+ ;; next one. (You can have a /* inside a js block comment.)
+ ;; So just close it if the next non-ws char isn't a *.
+ (and first-line
+ (eolp)
+ (save-excursion
+ (skip-chars-forward " \t\r\n")
+ (not (eq (char-after) ?*))))))
+ (delete-horizontal-space)
+ (insert "\n")
+ (cond
+ (star
+ (indent-to col)
+ (insert "* ")
+ (if (and first-line needs-close)
+ (save-excursion
+ (insert "\n")
+ (indent-to col)
+ (insert "*/"))))
+ (single
+ (indent-to col)
+ (insert "// ")))
+ ;; Don't need to extend the comment after all.
+ (js2-indent-line)))
+
+(defun js2-beginning-of-line ()
+ "Toggle point between bol and first non-whitespace char in line.
+Also moves past comment delimiters when inside comments."
+ (interactive)
+ (let (node)
+ (cond
+ ((bolp)
+ (back-to-indentation))
+ ((looking-at "//")
+ (skip-chars-forward "/ \t"))
+ ((and (eq (char-after) ?*)
+ (setq node (js2-comment-at-point))
+ (memq (js2-comment-node-format node) '(jsdoc block))
+ (save-excursion
+ (skip-chars-backward " \t")
+ (bolp)))
+ (skip-chars-forward "\* \t"))
+ (t
+ (goto-char (point-at-bol))))))
+
+(defun js2-end-of-line ()
+ "Toggle point between eol and last non-whitespace char in line."
+ (interactive)
+ (if (eolp)
+ (skip-chars-backward " \t")
+ (goto-char (point-at-eol))))
+
+(defun js2-mode-wait-for-parse (callback)
+ "Invoke CALLBACK when parsing is finished.
+If parsing is already finished, calls CALLBACK immediately."
+ (if (not js2-mode-buffer-dirty-p)
+ (funcall callback)
+ (push callback js2-mode-pending-parse-callbacks)
+ (add-hook 'js2-parse-finished-hook #'js2-mode-parse-finished)))
+
+(defun js2-mode-parse-finished ()
+ "Invoke callbacks in `js2-mode-pending-parse-callbacks'."
+ ;; We can't let errors propagate up, since it prevents the
+ ;; `js2-parse' method from completing normally and returning
+ ;; the ast, which makes things mysteriously not work right.
+ (unwind-protect
+ (dolist (cb js2-mode-pending-parse-callbacks)
+ (condition-case err
+ (funcall cb)
+ (error (message "%s" err))))
+ (setq js2-mode-pending-parse-callbacks nil)))
+
+(defun js2-mode-flag-region (from to flag)
+ "Hide or show text from FROM to TO, according to FLAG.
+If FLAG is nil then text is shown, while if FLAG is t the text is hidden.
+Returns the created overlay if FLAG is non-nil."
+ (remove-overlays from to 'invisible 'js2-outline)
+ (when flag
+ (let ((o (make-overlay from to)))
+ (overlay-put o 'invisible 'js2-outline)
+ (overlay-put o 'isearch-open-invisible
+ 'js2-isearch-open-invisible)
+ o)))
+
+;; Function to be set as an outline-isearch-open-invisible' property
+;; to the overlay that makes the outline invisible (see
+;; `js2-mode-flag-region').
+(defun js2-isearch-open-invisible (_overlay)
+ ;; We rely on the fact that isearch places point on the matched text.
+ (js2-mode-show-element))
+
+(defun js2-mode-invisible-overlay-bounds (&optional pos)
+ "Return cons cell of bounds of folding overlay at POS.
+Returns nil if not found."
+ (let ((overlays (overlays-at (or pos (point))))
+ o)
+ (while (and overlays
+ (not o))
+ (if (overlay-get (car overlays) 'invisible)
+ (setq o (car overlays))
+ (setq overlays (cdr overlays))))
+ (if o
+ (cons (overlay-start o) (overlay-end o)))))
+
+(defun js2-mode-function-at-point (&optional pos)
+ "Return the innermost function node enclosing current point.
+Returns nil if point is not in a function."
+ (let ((node (js2-node-at-point pos)))
+ (while (and node (not (js2-function-node-p node)))
+ (setq node (js2-node-parent node)))
+ (if (js2-function-node-p node)
+ node)))
+
+(defun js2-mode-toggle-element ()
+ "Hide or show the foldable element at the point."
+ (interactive)
+ (let (comment fn pos)
+ (save-excursion
+ (cond
+ ;; /* ... */ comment?
+ ((js2-block-comment-p (setq comment (js2-comment-at-point)))
+ (if (js2-mode-invisible-overlay-bounds
+ (setq pos (+ 3 (js2-node-abs-pos comment))))
+ (progn
+ (goto-char pos)
+ (js2-mode-show-element))
+ (js2-mode-hide-element)))
+ ;; //-comment?
+ ((save-excursion
+ (back-to-indentation)
+ (looking-at js2-mode-//-comment-re))
+ (js2-mode-toggle-//-comment))
+ ;; function?
+ ((setq fn (js2-mode-function-at-point))
+ (setq pos (and (js2-function-node-body fn)
+ (js2-node-abs-pos (js2-function-node-body fn))))
+ (goto-char (1+ pos))
+ (if (js2-mode-invisible-overlay-bounds)
+ (js2-mode-show-element)
+ (js2-mode-hide-element)))
+ (t
+ (message "Nothing at point to hide or show"))))))
+
+(defun js2-mode-hide-element ()
+ "Fold/hide contents of a block, showing ellipses.
+Show the hidden text with \\[js2-mode-show-element]."
+ (interactive)
+ (if js2-mode-buffer-dirty-p
+ (js2-mode-wait-for-parse #'js2-mode-hide-element))
+ (let (node body beg end)
+ (cond
+ ((js2-mode-invisible-overlay-bounds)
+ (message "already hidden"))
+ (t
+ (setq node (js2-node-at-point))
+ (cond
+ ((js2-block-comment-p node)
+ (js2-mode-hide-comment node))
+ (t
+ (while (and node (not (js2-function-node-p node)))
+ (setq node (js2-node-parent node)))
+ (if (and node
+ (setq body (js2-function-node-body node)))
+ (progn
+ (setq beg (js2-node-abs-pos body)
+ end (+ beg (js2-node-len body)))
+ (js2-mode-flag-region (1+ beg) (1- end) 'hide))
+ (message "No collapsable element found at point"))))))))
+
+(defun js2-mode-show-element ()
+ "Show the hidden element at current point."
+ (interactive)
+ (let ((bounds (js2-mode-invisible-overlay-bounds)))
+ (if bounds
+ (js2-mode-flag-region (car bounds) (cdr bounds) nil)
+ (message "Nothing to un-hide"))))
+
+(defun js2-mode-show-all ()
+ "Show all of the text in the buffer."
+ (interactive)
+ (js2-mode-flag-region (point-min) (point-max) nil))
+
+(defun js2-mode-toggle-hide-functions ()
+ (interactive)
+ (if js2-mode-functions-hidden
+ (js2-mode-show-functions)
+ (js2-mode-hide-functions)))
+
+(defun js2-mode-hide-functions ()
+ "Hides all non-nested function bodies in the buffer.
+Use \\[js2-mode-show-all] to reveal them, or \\[js2-mode-show-element]
+to open an individual entry."
+ (interactive)
+ (if js2-mode-buffer-dirty-p
+ (js2-mode-wait-for-parse #'js2-mode-hide-functions))
+ (if (null js2-mode-ast)
+ (message "Oops - parsing failed")
+ (setq js2-mode-functions-hidden t)
+ (js2-visit-ast js2-mode-ast #'js2-mode-function-hider)))
+
+(defun js2-mode-function-hider (n endp)
+ (when (not endp)
+ (let ((tt (js2-node-type n))
+ body beg end)
+ (cond
+ ((and (= tt js2-FUNCTION)
+ (setq body (js2-function-node-body n)))
+ (setq beg (js2-node-abs-pos body)
+ end (+ beg (js2-node-len body)))
+ (js2-mode-flag-region (1+ beg) (1- end) 'hide)
+ nil) ; don't process children of function
+ (t
+ t))))) ; keep processing other AST nodes
+
+(defun js2-mode-show-functions ()
+ "Un-hide any folded function bodies in the buffer."
+ (interactive)
+ (setq js2-mode-functions-hidden nil)
+ (save-excursion
+ (goto-char (point-min))
+ (while (/= (goto-char (next-overlay-change (point)))
+ (point-max))
+ (dolist (o (overlays-at (point)))
+ (when (and (overlay-get o 'invisible)
+ (not (overlay-get o 'comment)))
+ (js2-mode-flag-region (overlay-start o) (overlay-end o) nil))))))
+
+(defun js2-mode-hide-comment (n)
+ (let* ((head (if (eq (js2-comment-node-format n) 'jsdoc)
+ 3 ; /**
+ 2)) ; /*
+ (beg (+ (js2-node-abs-pos n) head))
+ (end (- (+ beg (js2-node-len n)) head 2))
+ (o (js2-mode-flag-region beg end 'hide)))
+ (overlay-put o 'comment t)))
+
+(defun js2-mode-toggle-hide-comments ()
+ "Folds all block comments in the buffer.
+Use \\[js2-mode-show-all] to reveal them, or \\[js2-mode-show-element]
+to open an individual entry."
+ (interactive)
+ (if js2-mode-comments-hidden
+ (js2-mode-show-comments)
+ (js2-mode-hide-comments)))
+
+(defun js2-mode-hide-comments ()
+ (interactive)
+ (if js2-mode-buffer-dirty-p
+ (js2-mode-wait-for-parse #'js2-mode-hide-comments))
+ (if (null js2-mode-ast)
+ (message "Oops - parsing failed")
+ (setq js2-mode-comments-hidden t)
+ (dolist (n (js2-ast-root-comments js2-mode-ast))
+ (when (js2-block-comment-p n)
+ (js2-mode-hide-comment n)))
+ (js2-mode-hide-//-comments)))
+
+(defun js2-mode-extend-//-comment (direction)
+ "Find start or end of a block of similar //-comment lines.
+DIRECTION is -1 to look back, 1 to look forward.
+INDENT is the indentation level to match.
+Returns the end-of-line position of the furthest adjacent
+//-comment line with the same indentation as the current line.
+If there is no such matching line, returns current end of line."
+ (let ((pos (point-at-eol))
+ (indent (current-indentation)))
+ (save-excursion
+ (while (and (zerop (forward-line direction))
+ (looking-at js2-mode-//-comment-re)
+ (eq indent (length (match-string 1))))
+ (setq pos (point-at-eol)))
+ pos)))
+
+(defun js2-mode-hide-//-comments ()
+ "Fold adjacent 1-line comments, showing only snippet of first one."
+ (let (beg end)
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward js2-mode-//-comment-re nil t)
+ (setq beg (point)
+ end (js2-mode-extend-//-comment 1))
+ (unless (eq beg end)
+ (overlay-put (js2-mode-flag-region beg end 'hide)
+ 'comment t))
+ (goto-char end)
+ (forward-char 1)))))
+
+(defun js2-mode-toggle-//-comment ()
+ "Fold or un-fold any multi-line //-comment at point.
+Caller should have determined that this line starts with a //-comment."
+ (let* ((beg (point-at-eol))
+ (end beg))
+ (save-excursion
+ (goto-char end)
+ (if (js2-mode-invisible-overlay-bounds)
+ (js2-mode-show-element)
+ ;; else hide the comment
+ (setq beg (js2-mode-extend-//-comment -1)
+ end (js2-mode-extend-//-comment 1))
+ (unless (eq beg end)
+ (overlay-put (js2-mode-flag-region beg end 'hide)
+ 'comment t))))))
+
+(defun js2-mode-show-comments ()
+ "Un-hide any hidden comments, leaving other hidden elements alone."
+ (interactive)
+ (setq js2-mode-comments-hidden nil)
+ (save-excursion
+ (goto-char (point-min))
+ (while (/= (goto-char (next-overlay-change (point)))
+ (point-max))
+ (dolist (o (overlays-at (point)))
+ (when (overlay-get o 'comment)
+ (js2-mode-flag-region (overlay-start o) (overlay-end o) nil))))))
+
+(defun js2-mode-display-warnings-and-errors ()
+ "Turn on display of warnings and errors."
+ (interactive)
+ (setq js2-mode-show-parse-errors t
+ js2-mode-show-strict-warnings t)
+ (js2-reparse 'force))
+
+(defun js2-mode-hide-warnings-and-errors ()
+ "Turn off display of warnings and errors."
+ (interactive)
+ (setq js2-mode-show-parse-errors nil
+ js2-mode-show-strict-warnings nil)
+ (js2-reparse 'force))
+
+(defun js2-mode-toggle-warnings-and-errors ()
+ "Toggle the display of warnings and errors.
+Some users don't like having warnings/errors reported while they type."
+ (interactive)
+ (setq js2-mode-show-parse-errors (not js2-mode-show-parse-errors)
+ js2-mode-show-strict-warnings (not js2-mode-show-strict-warnings))
+ (if (called-interactively-p 'any)
+ (message "warnings and errors %s"
+ (if js2-mode-show-parse-errors
+ "enabled"
+ "disabled")))
+ (js2-reparse 'force))
+
+(defun js2-mode-customize ()
+ (interactive)
+ (customize-group 'js2-mode))
+
+(defun js2-mode-forward-sexp (&optional arg)
+ "Move forward across one statement or balanced expression.
+With ARG, do it that many times. Negative arg -N means
+move backward across N balanced expressions."
+ (interactive "p")
+ (setq arg (or arg 1))
+ (save-restriction
+ (widen) ;; `blink-matching-open' calls `narrow-to-region'
+ (js2-reparse)
+ (let (forward-sexp-function
+ node (start (point)) pos lp rp child)
+ (cond
+ ((js2-string-node-p (js2-node-at-point))
+ (forward-sexp arg))
+ ;; backward-sexp
+ ;; could probably make this better for some cases:
+ ;; - if in statement block (e.g. function body), go to parent
+ ;; - infix exprs like (foo in bar) - maybe go to beginning
+ ;; of infix expr if in the right-side expression?
+ ((and arg (cl-minusp arg))
+ (dotimes (_ (- arg))
+ (js2-backward-sws)
+ (forward-char -1) ; Enter the node we backed up to.
+ (when (setq node (js2-node-at-point (point) t))
+ (setq pos (js2-node-abs-pos node))
+ (let ((parens (js2-mode-forward-sexp-parens node pos)))
+ (setq lp (car parens)
+ rp (cdr parens)))
+ (when (and lp (> start lp))
+ (if (and rp (<= start rp))
+ ;; Between parens, check if there's a child node we can jump.
+ (when (setq child (js2-node-closest-child node (point) lp t))
+ (setq pos (js2-node-abs-pos child)))
+ ;; Before both parens.
+ (setq pos lp)))
+ (let ((state (parse-partial-sexp pos start)))
+ (goto-char (if (not (zerop (car state)))
+ ;; Stumble at the unbalanced paren if < 0, or
+ ;; jump a bit further if > 0.
+ (scan-sexps start -1)
+ pos))))
+ (unless pos (goto-char (point-min)))))
+ (t
+ ;; forward-sexp
+ (dotimes (_ arg)
+ (js2-forward-sws)
+ (when (setq node (js2-node-at-point (point) t))
+ (setq pos (js2-node-abs-pos node))
+ (let ((parens (js2-mode-forward-sexp-parens node pos)))
+ (setq lp (car parens)
+ rp (cdr parens)))
+ (or
+ (when (and rp (<= start rp))
+ (if (> start lp)
+ (when (setq child (js2-node-closest-child node (point) rp))
+ (setq pos (js2-node-abs-end child)))
+ (setq pos (1+ rp))))
+ ;; No parens or child nodes, looks for the end of the current node.
+ (cl-incf pos (js2-node-len
+ (if (js2-expr-stmt-node-p (js2-node-parent node))
+ ;; Stop after the semicolon.
+ (js2-node-parent node)
+ node))))
+ (let ((state (save-excursion (parse-partial-sexp start pos))))
+ (goto-char (if (not (zerop (car state)))
+ (scan-sexps start 1)
+ pos))))
+ (unless pos (goto-char (point-max)))))))))
+
+(defun js2-mode-forward-sexp-parens (node abs-pos)
+ "Return a cons cell with positions of main parens in NODE."
+ (cond
+ ((or (js2-array-node-p node)
+ (js2-object-node-p node)
+ (js2-comp-node-p node)
+ (memq (aref node 0) '(cl-struct-js2-block-node cl-struct-js2-scope)))
+ (cons abs-pos (+ abs-pos (js2-node-len node) -1)))
+ ((js2-paren-expr-node-p node)
+ (let ((lp (js2-node-lp node))
+ (rp (js2-node-rp node)))
+ (cons (when lp (+ abs-pos lp))
+ (when rp (+ abs-pos rp)))))))
+
+(defun js2-node-closest-child (parent point limit &optional before)
+ (let* ((parent-pos (js2-node-abs-pos parent))
+ (rpoint (- point parent-pos))
+ (rlimit (- limit parent-pos))
+ (min (min rpoint rlimit))
+ (max (max rpoint rlimit))
+ found)
+ (catch 'done
+ (js2-visit-ast
+ parent
+ (lambda (node _end-p)
+ (if (eq node parent)
+ t
+ (let ((pos (js2-node-pos node)) ;; Both relative values.
+ (end (+ (js2-node-pos node) (js2-node-len node))))
+ (when (and (>= pos min) (<= end max)
+ (if before (< pos rpoint) (> end rpoint)))
+ (setq found node))
+ (when (> end rpoint)
+ (throw 'done nil)))
+ nil))))
+ found))
+
+(defun js2-errors ()
+ "Return a list of errors found."
+ (and js2-mode-ast
+ (js2-ast-root-errors js2-mode-ast)))
+
+(defun js2-warnings ()
+ "Return a list of warnings found."
+ (and js2-mode-ast
+ (js2-ast-root-warnings js2-mode-ast)))
+
+(defun js2-have-errors-p ()
+ "Return non-nil if any parse errors or warnings were found."
+ (or (js2-errors) (js2-warnings)))
+
+(defun js2-errors-and-warnings ()
+ "Return a copy of the concatenated errors and warnings lists.
+They are appended: first the errors, then the warnings.
+Entries are of the form (MSG BEG END)."
+ (when js2-mode-ast
+ (append (js2-ast-root-errors js2-mode-ast)
+ (copy-sequence (js2-ast-root-warnings js2-mode-ast)))))
+
+(defun js2-next-error (&optional arg reset)
+ "Move to next parse error.
+Typically invoked via \\[next-error].
+ARG is the number of errors, forward or backward, to move.
+RESET means start over from the beginning."
+ (interactive "p")
+ (if (not (or (js2-errors) (js2-warnings)))
+ (message "No errors")
+ (when reset
+ (goto-char (point-min)))
+ (let* ((errs (js2-errors-and-warnings))
+ (continue t)
+ (start (point))
+ (count (or arg 1))
+ (backward (cl-minusp count))
+ (sorter (if backward '> '<))
+ (stopper (if backward '< '>))
+ (count (abs count))
+ all-errs err)
+ ;; Sort by start position.
+ (setq errs (sort errs (lambda (e1 e2)
+ (funcall sorter (cl-second e1) (cl-second e2))))
+ all-errs errs)
+ ;; Find nth error with pos > start.
+ (while (and errs continue)
+ (when (funcall stopper (cl-cadar errs) start)
+ (setq err (car errs))
+ (if (zerop (cl-decf count))
+ (setq continue nil)))
+ (setq errs (cdr errs)))
+ ;; Clear for `js2-echo-error'.
+ (message nil)
+ (if err
+ (goto-char (cl-second err))
+ ;; Wrap around to first error.
+ (goto-char (cl-second (car all-errs)))
+ ;; If we were already on it, echo msg again.
+ (if (= (point) start)
+ (js2-echo-error (point) (point)))))))
+
+(defun js2-down-mouse-3 ()
+ "Make right-click move the point to the click location.
+This makes right-click context menu operations a bit more intuitive.
+The point will not move if the region is active, however, to avoid
+destroying the region selection."
+ (interactive)
+ (when (and js2-move-point-on-right-click
+ (not mark-active))
+ (let ((e last-input-event))
+ (ignore-errors
+ (goto-char (cl-cadadr e))))))
+
+(defun js2-mode-create-imenu-index ()
+ "Returns an alist for `imenu--index-alist'. Returns nil on first
+scan if buffer size > `imenu-auto-rescan-maxout'."
+ (when (and (not js2-mode-ast)
+ (<= (buffer-size) imenu-auto-rescan-maxout))
+ (js2-reparse))
+ (when js2-mode-ast
+ ;; if we have an ast but no recorder, they're requesting a rescan
+ (unless js2-imenu-recorder
+ (js2-reparse 'force))
+ (prog1
+ (js2-build-imenu-index)
+ (setq js2-imenu-recorder nil
+ js2-imenu-function-map nil))))
+
+(defun js2-mode-find-tag ()
+ "Replacement for `find-tag-default'.
+`find-tag-default' returns a ridiculous answer inside comments."
+ (let (beg end)
+ (save-excursion
+ (if (looking-at "\\_>")
+ (setq beg (progn (forward-symbol -1) (point))
+ end (progn (forward-symbol 1) (point)))
+ (setq beg (progn (forward-symbol 1) (point))
+ end (progn (forward-symbol -1) (point))))
+ (replace-regexp-in-string
+ "[\"']" ""
+ (buffer-substring-no-properties beg end)))))
+
+(defun js2-mode-forward-sibling ()
+ "Move to the end of the sibling following point in parent.
+Returns non-nil if successful, or nil if there was no following sibling."
+ (let* ((node (js2-node-at-point))
+ (parent (js2-mode-find-enclosing-fn node))
+ sib)
+ (when (setq sib (js2-node-find-child-after (point) parent))
+ (goto-char (+ (js2-node-abs-pos sib)
+ (js2-node-len sib))))))
+
+(defun js2-mode-backward-sibling ()
+ "Move to the beginning of the sibling node preceding point in parent.
+Parent is defined as the enclosing script or function."
+ (let* ((node (js2-node-at-point))
+ (parent (js2-mode-find-enclosing-fn node))
+ sib)
+ (when (setq sib (js2-node-find-child-before (point) parent))
+ (goto-char (js2-node-abs-pos sib)))))
+
+(defun js2-beginning-of-defun (&optional arg)
+ "Go to line on which current function starts, and return t on success.
+If we're not in a function or already at the beginning of one, go
+to beginning of previous script-level element.
+With ARG N, do that N times. If N is negative, move forward."
+ (setq arg (or arg 1))
+ (if (cl-plusp arg)
+ (let ((parent (js2-node-parent-script-or-fn (js2-node-at-point))))
+ (when (cond
+ ((js2-function-node-p parent)
+ (goto-char (js2-node-abs-pos parent)))
+ (t
+ (js2-mode-backward-sibling)))
+ (if (> arg 1)
+ (js2-beginning-of-defun (1- arg))
+ t)))
+ (when (js2-end-of-defun)
+ (js2-beginning-of-defun (if (>= arg -1) 1 (1+ arg))))))
+
+(defun js2-end-of-defun ()
+ "Go to the char after the last position of the current function
+or script-level element."
+ (let* ((node (js2-node-at-point))
+ (parent (or (and (js2-function-node-p node) node)
+ (js2-node-parent-script-or-fn node)))
+ script)
+ (unless (js2-function-node-p parent)
+ ;; Use current script-level node, or, if none, the next one.
+ (setq script (or parent node)
+ parent (js2-node-find-child-before (point) script))
+ (when (or (null parent)
+ (>= (point) (+ (js2-node-abs-pos parent)
+ (js2-node-len parent))))
+ (setq parent (js2-node-find-child-after (point) script))))
+ (when parent
+ (goto-char (+ (js2-node-abs-pos parent)
+ (js2-node-len parent))))))
+
+(defun js2-mark-defun (&optional allow-extend)
+ "Put mark at end of this function, point at beginning.
+The function marked is the one that contains point.
+
+Interactively, if this command is repeated,
+or (in Transient Mark mode) if the mark is active,
+it marks the next defun after the ones already marked."
+ (interactive "p")
+ (let (extended)
+ (when (and allow-extend
+ (or (and (eq last-command this-command) (mark t))
+ (and transient-mark-mode mark-active)))
+ (let ((sib (save-excursion
+ (goto-char (mark))
+ (if (js2-mode-forward-sibling)
+ (point)))))
+ (if sib
+ (progn
+ (set-mark sib)
+ (setq extended t))
+ ;; no more siblings - try extending to enclosing node
+ (goto-char (mark t)))))
+ (when (not extended)
+ (let ((node (js2-node-at-point (point) t)) ; skip comments
+ ast fn stmt parent beg end)
+ (when (js2-ast-root-p node)
+ (setq ast node
+ node (or (js2-node-find-child-after (point) node)
+ (js2-node-find-child-before (point) node))))
+ ;; only mark whole buffer if we can't find any children
+ (if (null node)
+ (setq node ast))
+ (if (js2-function-node-p node)
+ (setq parent node)
+ (setq fn (js2-mode-find-enclosing-fn node)
+ stmt (if (or (null fn)
+ (js2-ast-root-p fn))
+ (js2-mode-find-first-stmt node))
+ parent (or stmt fn)))
+ (setq beg (js2-node-abs-pos parent)
+ end (+ beg (js2-node-len parent)))
+ (push-mark beg)
+ (goto-char end)
+ (exchange-point-and-mark)))))
+
+(defun js2-narrow-to-defun ()
+ "Narrow to the function enclosing point."
+ (interactive)
+ (let* ((node (js2-node-at-point (point) t)) ; skip comments
+ (fn (if (js2-script-node-p node)
+ node
+ (js2-mode-find-enclosing-fn node)))
+ (beg (js2-node-abs-pos fn)))
+ (unless (js2-ast-root-p fn)
+ (narrow-to-region beg (+ beg (js2-node-len fn))))))
+
+(defun js2-jump-to-definition (&optional arg)
+ "Jump to the definition of an object's property, variable or function."
+ (interactive "P")
+ (if (eval-when-compile (fboundp 'xref-push-marker-stack))
+ (xref-push-marker-stack)
+ (ring-insert find-tag-marker-ring (point-marker)))
+ (js2-reparse)
+ (let* ((node (js2-node-at-point))
+ (parent (js2-node-parent node))
+ (names (if (js2-prop-get-node-p parent)
+ (reverse (let ((temp (js2-compute-nested-prop-get parent)))
+ (cl-loop for n in temp
+ with result = '()
+ do (push n result)
+ until (equal node n)
+ finally return result)))))
+ node-init)
+ (unless (and (js2-name-node-p node)
+ (not (js2-var-init-node-p parent))
+ (not (js2-function-node-p parent)))
+ (error "Node is not a supported jump node"))
+ (push (or (and names (pop names))
+ (unless (and (js2-object-prop-node-p parent)
+ (eq node (js2-object-prop-node-left parent))
+ (not (js2-node-get-prop parent 'SHORTHAND)))
+ node)
+ (error "Node is not a supported jump node")) names)
+ (setq node-init (js2-search-scope node names))
+
+ ;; todo: display list of results in buffer
+ ;; todo: group found references by buffer
+ (unless node-init
+ (switch-to-buffer
+ (catch 'found
+ (unless arg
+ (mapc (lambda (b)
+ (with-current-buffer b
+ (when (derived-mode-p 'js2-mode)
+ (setq node-init (js2-search-scope js2-mode-ast names))
+ (if node-init
+ (throw 'found b)))))
+ (buffer-list)))
+ nil)))
+ (setq node-init (if (listp node-init) (car node-init) node-init))
+ (unless node-init
+ (pop-tag-mark)
+ (error "No jump location found"))
+ (goto-char (js2-node-abs-pos node-init))))
+
+(defun js2-search-object (node name-node)
+ "Check if object NODE contains element with NAME-NODE."
+ (cl-assert (js2-object-node-p node))
+ ;; Only support name-node and nodes for the time being
+ (cl-loop for elem in (js2-object-node-elems node)
+ for left = (js2-infix-node-left elem)
+ if (or (and (js2-name-node-p left)
+ (equal (js2-name-node-name name-node)
+ (js2-name-node-name left)))
+ (and (js2-string-node-p left)
+ (string= (js2-name-node-name name-node)
+ (js2-string-node-value left))))
+ return elem))
+
+(defun js2-search-object-for-prop (object prop-names)
+ "Return node in OBJECT that matches PROP-NAMES or nil.
+PROP-NAMES is a list of values representing a path to a value in OBJECT.
+i.e. (\\='name\\=' \\='value\\=') = {name : { value: 3}}"
+ (let (node
+ (temp-object object)
+ (temp t) ;temporay node
+ (names prop-names))
+ (while (and temp names (js2-object-node-p temp-object))
+ (setq temp (js2-search-object temp-object (pop names)))
+ (and (setq node temp)
+ (setq temp-object (js2-infix-node-right temp))))
+ (unless names node)))
+
+(defun js2-search-scope (node names)
+ "Searches NODE scope for jump location matching NAMES.
+NAMES is a list of property values to search for. For functions
+and variables NAMES will contain one element."
+ (let (node-init val)
+ (cond
+ ((js2-name-node-p (car names))
+ (setq val (js2-name-node-name (car names)))
+ (setq node-init (js2-get-symbol-declaration node val)))
+ ((and (js2-keyword-node-p (car names))
+ (equal (js2-keyword-node-type (car names))
+ js2-THIS))
+ (let* ((scope (js2-node-get-enclosing-scope node))
+ (parent (js2-node-parent scope)))
+ (when (or (js2-method-node-p parent)
+ (js2-object-prop-node-p parent))
+ ;; class or object
+ (setq node-init (js2-node-parent parent))))))
+
+ (when (> (length names) 1)
+ (when node-init
+ (cond
+ ((js2-name-node-p (car names))
+ ;; Check var declarations
+ (when (string= val (js2-name-node-name node-init))
+ (let ((parent (js2-node-parent node-init)))
+ (setq node-init (when (js2-var-init-node-p parent)
+ (js2-search-object-for-prop
+ (js2-var-init-node-initializer parent)
+ (cdr names)))))))
+ ((js2-object-node-p node-init)
+ (setq node-init (js2-search-object-for-prop
+ node-init
+ (cdr names))))))
+
+ ;; Check all assign nodes
+ (js2-visit-ast
+ js2-mode-ast
+ (lambda (node endp)
+ (unless endp
+ (if (js2-assign-node-p node)
+ (let ((left (js2-assign-node-left node))
+ (right (js2-assign-node-right node))
+ (temp-names names))
+ (when (js2-prop-get-node-p left)
+ (let* ((prop-list (js2-compute-nested-prop-get left))
+ ;; 'this' or 'super'
+ (target-is-keyword (js2-keyword-node-p (car temp-names)))
+ (_ (when target-is-keyword
+ (pop temp-names)))
+ (found (unless target-is-keyword
+ (cl-loop for prop in prop-list
+ until (not (string= (js2-name-node-name
+ (pop temp-names))
+ (and (js2-name-node-p prop)
+ (js2-name-node-name prop))))
+ if (not temp-names) return prop)))
+ (found-node (or found
+ (when (js2-object-node-p right)
+ (js2-search-object-for-prop right
+ temp-names)))))
+ (if found-node (push found-node node-init))))))
+ t))))
+ node-init))
+
+(defun js2-get-symbol-declaration (node name)
+ "Find scope for NAME from NODE."
+ (let ((scope (js2-get-defining-scope
+ (or (js2-node-get-enclosing-scope node)
+ node) name)))
+ (if scope (js2-symbol-ast-node (js2-scope-get-symbol scope name)))))
+
+(provide 'js2-mode)
+
+;;; js2-mode.el ends here
diff --git a/elpa/js2-mode-20220402.2211/js2-mode.elc b/elpa/js2-mode-20220402.2211/js2-mode.elc
new file mode 100644
index 0000000..9b30bbc
--- /dev/null
+++ b/elpa/js2-mode-20220402.2211/js2-mode.elc
Binary files differ
diff --git a/elpa/js2-mode-20220402.2211/js2-old-indent.el b/elpa/js2-mode-20220402.2211/js2-old-indent.el
new file mode 100644
index 0000000..3f10a4d
--- /dev/null
+++ b/elpa/js2-mode-20220402.2211/js2-old-indent.el
@@ -0,0 +1,712 @@
+;;; js2-old-indent.el --- Indentation code kept for compatibility -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; 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 <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; All features of this indentation code have been ported to Emacs's
+;; built-in `js-mode' by now, so we derive from it. An older
+;; commentary follows.
+
+;; This code is kept for Emacs 24.5 and ealier.
+
+;; This indenter is based on Karl Landström's "javascript.el" indenter.
+;; Karl cleverly deduces that the desired indentation level is often a
+;; function of paren/bracket/brace nesting depth, which can be determined
+;; quickly via the built-in `parse-partial-sexp' function. His indenter
+;; then does some equally clever checks to see if we're in the context of a
+;; substatement of a possibly braceless statement keyword such as if, while,
+;; or finally. This approach yields pretty good results.
+
+;; The indenter is often "wrong", however, and needs to be overridden.
+;; The right long-term solution is probably to emulate (or integrate
+;; with) cc-engine, but it's a nontrivial amount of coding. Even when a
+;; parse tree from `js2-parse' is present, which is not true at the
+;; moment the user is typing, computing indentation is still thousands
+;; of lines of code to handle every possible syntactic edge case.
+
+;; In the meantime, the compromise solution is that we offer a "bounce
+;; indenter", configured with `js2-bounce-indent-p', which cycles the
+;; current line indent among various likely guess points. This approach
+;; is far from perfect, but should at least make it slightly easier to
+;; move the line towards its desired indentation when manually
+;; overriding Karl's heuristic nesting guesser.
+
+;; I've made miscellaneous tweaks to Karl's code to handle some Ecma
+;; extensions such as `let' and Array comprehensions. Major kudos to
+;; Karl for coming up with the initial approach, which packs a lot of
+;; punch for so little code. -- Steve
+
+;;; Code:
+
+(require 'sgml-mode)
+
+(defvar js2-language-version)
+
+(declare-function js2-backward-sws "js2-mode")
+(declare-function js2-forward-sws "js2-mode")
+(declare-function js2-same-line "js2-mode")
+
+(defcustom js2-basic-offset (if (and (boundp 'c-basic-offset)
+ (numberp c-basic-offset))
+ c-basic-offset
+ 4)
+ "Number of spaces to indent nested statements.
+Similar to `c-basic-offset'."
+ :group 'js2-mode
+ :safe 'integerp
+ :type 'integer)
+
+(defcustom js2-pretty-multiline-declarations t
+ "Non-nil to line up multiline declarations vertically:
+
+ var a = 10,
+ b = 20,
+ c = 30;
+
+If the value is t, and the first assigned value in the
+declaration is a function/array/object literal spanning several
+lines, it won't be indented additionally:
+
+ var o = { var bar = 2,
+ foo: 3 vs. o = {
+ }, foo: 3
+ bar = 2; };
+
+If the value is `all', it will always be indented additionally:
+
+ var o = {
+ foo: 3
+ };
+
+ var o = {
+ foo: 3
+ },
+ bar = 2;
+
+If the value is `dynamic', it will be indented additionally only
+if the declaration contains more than one variable:
+
+ var o = {
+ foo: 3
+ };
+
+ var o = {
+ foo: 3
+ },
+ bar = 2;"
+ :group 'js2-mode
+ :safe 'symbolp
+ :type 'symbol)
+
+(defcustom js2-indent-switch-body nil
+ "When nil, case labels are indented on the same level as the
+containing switch statement. Otherwise, all lines inside
+switch statement body are indented one additional level."
+ :type 'boolean
+ :safe 'booleanp
+ :group 'js2-mode)
+
+(defconst js2-possibly-braceless-keywords-re
+ (concat "else[ \t]+if\\|for[ \t]+each\\|"
+ (regexp-opt '("catch" "do" "else" "finally" "for" "if"
+ "try" "while" "with" "let")))
+ "Regular expression matching keywords that are optionally
+followed by an opening brace.")
+
+(defconst js2-indent-operator-re
+ (concat "[-+*/%<>&^|?:.]\\([^-+*/.]\\|$\\)\\|!?=\\|"
+ (regexp-opt '("in" "instanceof") 'symbols))
+ "Regular expression matching operators that affect indentation
+of continued expressions.")
+
+(defconst js2-declaration-keyword-re
+ (regexp-opt '("var" "let" "const") 'symbols)
+ "Regular expression matching variable declaration keywords.")
+
+(defun js2-re-search-forward-inner (regexp &optional bound count)
+ "Auxiliary function for `js2-re-search-forward'."
+ (let (parse saved-point)
+ (while (> count 0)
+ (re-search-forward regexp bound)
+ (setq parse (if saved-point
+ (parse-partial-sexp saved-point (point))
+ (syntax-ppss (point))))
+ (cond ((nth 3 parse)
+ (re-search-forward
+ (concat "\\(\\=\\|[^\\]\\|^\\)" (string (nth 3 parse)))
+ (save-excursion (end-of-line) (point)) t))
+ ((nth 7 parse)
+ (forward-line))
+ ((or (nth 4 parse)
+ (and (eq (char-before) ?\/) (eq (char-after) ?\*)))
+ (re-search-forward "\\*/"))
+ (t
+ (setq count (1- count))))
+ (setq saved-point (point))))
+ (point))
+
+(defun js2-re-search-forward (regexp &optional bound noerror count)
+ "Search forward but ignore strings and comments.
+Invokes `re-search-forward' but treats the buffer as if strings
+and comments have been removed."
+ (let ((saved-point (point)))
+ (condition-case err
+ (cond ((null count)
+ (js2-re-search-forward-inner regexp bound 1))
+ ((< count 0)
+ (js2-re-search-backward-inner regexp bound (- count)))
+ ((> count 0)
+ (js2-re-search-forward-inner regexp bound count)))
+ (search-failed
+ (goto-char saved-point)
+ (unless noerror
+ (error (error-message-string err)))))))
+
+(defun js2-re-search-backward-inner (regexp &optional bound count)
+ "Auxiliary function for `js2-re-search-backward'."
+ (let (parse)
+ (while (> count 0)
+ (re-search-backward regexp bound)
+ (setq parse (syntax-ppss (point)))
+ (cond ((nth 3 parse)
+ (re-search-backward
+ (concat "\\([^\\]\\|^\\)" (string (nth 3 parse)))
+ (line-beginning-position) t))
+ ((nth 7 parse)
+ (goto-char (nth 8 parse)))
+ ((or (nth 4 parse)
+ (and (eq (char-before) ?/) (eq (char-after) ?*)))
+ (re-search-backward "/\\*"))
+ (t
+ (setq count (1- count))))))
+ (point))
+
+(defun js2-re-search-backward (regexp &optional bound noerror count)
+ "Search backward but ignore strings and comments.
+Invokes `re-search-backward' but treats the buffer as if strings
+and comments have been removed."
+ (let ((saved-point (point)))
+ (condition-case err
+ (cond ((null count)
+ (js2-re-search-backward-inner regexp bound 1))
+ ((< count 0)
+ (js2-re-search-forward-inner regexp bound (- count)))
+ ((> count 0)
+ (js2-re-search-backward-inner regexp bound count)))
+ (search-failed
+ (goto-char saved-point)
+ (unless noerror
+ (error (error-message-string err)))))))
+
+(defun js2-looking-at-operator-p ()
+ "Return non-nil if text after point is a non-comma operator."
+ (defvar js2-mode-identifier-re)
+ (and (looking-at js2-indent-operator-re)
+ (or (not (eq (char-after) ?:))
+ (save-excursion
+ (and (js2-re-search-backward "[?:{]\\|\\_<case\\_>" nil t)
+ (eq (char-after) ??))))
+ (not (and
+ (eq (char-after) ?/)
+ (save-excursion
+ (eq (nth 3 (syntax-ppss)) ?/))))
+ (not (and
+ (eq (char-after) ?*)
+ ;; Generator method (possibly using computed property).
+ (looking-at (concat "\\* *\\(?:\\[\\|"
+ js2-mode-identifier-re
+ " *(\\)"))
+ (save-excursion
+ (js2-backward-sws)
+ ;; We might misindent some expressions that would
+ ;; return NaN anyway. Shouldn't be a problem.
+ (memq (char-before) '(?, ?} ?{)))))))
+
+(defun js2-continued-expression-p ()
+ "Return non-nil if the current line continues an expression."
+ (save-excursion
+ (back-to-indentation)
+ (if (js2-looking-at-operator-p)
+ (or (not (memq (char-after) '(?- ?+)))
+ (progn
+ (forward-comment (- (point)))
+ (not (memq (char-before) '(?, ?\[ ?\()))))
+ (forward-comment (- (point)))
+ (or (bobp) (backward-char))
+ (when (js2-looking-at-operator-p)
+ (backward-char)
+ (not (looking-at "\\*\\|\\+\\+\\|--\\|/[/*]"))))))
+
+(defun js2-end-of-do-while-loop-p ()
+ "Return non-nil if word after point is `while' of a do-while
+statement, else returns nil. A braceless do-while statement
+spanning several lines requires that the start of the loop is
+indented to the same column as the current line."
+ (interactive)
+ (save-excursion
+ (when (looking-at "\\s-*\\_<while\\_>")
+ (if (save-excursion
+ (skip-chars-backward "[ \t\n]*}")
+ (looking-at "[ \t\n]*}"))
+ (save-excursion
+ (backward-list) (backward-word 1) (looking-at "\\_<do\\_>"))
+ (js2-re-search-backward "\\_<do\\_>" (point-at-bol) t)
+ (or (looking-at "\\_<do\\_>")
+ (let ((saved-indent (current-indentation)))
+ (while (and (js2-re-search-backward "^[ \t]*\\_<" nil t)
+ (/= (current-indentation) saved-indent)))
+ (and (looking-at "[ \t]*\\_<do\\_>")
+ (not (js2-re-search-forward
+ "\\_<while\\_>" (point-at-eol) t))
+ (= (current-indentation) saved-indent))))))))
+
+(defun js2-multiline-decl-indentation ()
+ "Return the declaration indentation column if the current line belongs
+to a multiline declaration statement. See `js2-pretty-multiline-declarations'."
+ (let (forward-sexp-function ; use Lisp version
+ at-opening-bracket)
+ (save-excursion
+ (back-to-indentation)
+ (when (not (looking-at js2-declaration-keyword-re))
+ (when (looking-at js2-indent-operator-re)
+ (goto-char (match-end 0))) ; continued expressions are ok
+ (while (and (not at-opening-bracket)
+ (not (bobp))
+ (let ((pos (point)))
+ (save-excursion
+ (js2-backward-sws)
+ (or (eq (char-before) ?,)
+ (and (not (eq (char-before) ?\;))
+ (prog2 (skip-syntax-backward ".")
+ (looking-at js2-indent-operator-re)
+ (js2-backward-sws))
+ (not (eq (char-before) ?\;)))
+ (js2-same-line pos)))))
+ (condition-case _
+ (backward-sexp)
+ (scan-error (setq at-opening-bracket t))))
+ (when (looking-at js2-declaration-keyword-re)
+ (goto-char (match-end 0))
+ (1+ (current-column)))))))
+
+(defun js2-ctrl-statement-indentation ()
+ "Return the proper indentation of current line if it is a control statement.
+Returns an indentation if this line starts the body of a control
+statement without braces, else returns nil."
+ (let (forward-sexp-function)
+ (save-excursion
+ (back-to-indentation)
+ (when (and (not (js2-same-line (point-min)))
+ (not (looking-at "{"))
+ (js2-re-search-backward "[[:graph:]]" nil t)
+ (not (looking-at "[{([]"))
+ (progn
+ (forward-char)
+ (when (= (char-before) ?\))
+ ;; scan-sexps sometimes throws an error
+ (ignore-errors (backward-sexp))
+ (skip-chars-backward " \t" (point-at-bol)))
+ (let ((pt (point)))
+ (back-to-indentation)
+ (when (looking-at "}[ \t]*")
+ (goto-char (match-end 0)))
+ (and (looking-at js2-possibly-braceless-keywords-re)
+ (= (match-end 0) pt)
+ (not (js2-end-of-do-while-loop-p))))))
+ (+ (current-indentation) js2-basic-offset)))))
+
+(defun js2-indent-in-array-comp (parse-status)
+ "Return non-nil if we think we're in an array comprehension.
+In particular, return the buffer position of the first `for' kwd."
+ (let ((bracket (nth 1 parse-status))
+ (end (point)))
+ (when bracket
+ (save-excursion
+ (goto-char bracket)
+ (when (looking-at "\\[")
+ (forward-char 1)
+ (js2-forward-sws)
+ (if (looking-at "[[{]")
+ (let (forward-sexp-function) ; use Lisp version
+ (forward-sexp) ; skip destructuring form
+ (js2-forward-sws)
+ (if (and (/= (char-after) ?,) ; regular array
+ (looking-at "for"))
+ (match-beginning 0)))
+ ;; to skip arbitrary expressions we need the parser,
+ ;; so we'll just guess at it.
+ (if (and (> end (point)) ; not empty literal
+ (re-search-forward "[^,]]* \\(for\\) " end t)
+ ;; not inside comment or string literal
+ (let ((state (parse-partial-sexp bracket (point))))
+ (and (= 1 (car state))
+ (not (nth 8 state)))))
+ (match-beginning 1))))))))
+
+(defun js2-array-comp-indentation (parse-status for-kwd)
+ (if (js2-same-line for-kwd)
+ ;; first continuation line
+ (save-excursion
+ (goto-char (nth 1 parse-status))
+ (forward-char 1)
+ (skip-chars-forward " \t")
+ (current-column))
+ (save-excursion
+ (goto-char for-kwd)
+ (current-column))))
+
+(defun js2-maybe-goto-declaration-keyword-end (bracket)
+ "Helper function for `js2-proper-indentation'.
+Depending on the value of `js2-pretty-multiline-declarations',
+move point to the end of a variable declaration keyword so that
+indentation is aligned to that column."
+ (cond
+ ((eq js2-pretty-multiline-declarations 'all)
+ (when (looking-at js2-declaration-keyword-re)
+ (goto-char (1+ (match-end 0)))))
+ ((eq js2-pretty-multiline-declarations 'dynamic)
+ (let (declaration-keyword-end
+ at-closing-bracket-p
+ comma-p)
+ (when (looking-at js2-declaration-keyword-re)
+ ;; Preserve the match data lest it somehow be overridden.
+ (setq declaration-keyword-end (match-end 0))
+ (save-excursion
+ (goto-char bracket)
+ (setq at-closing-bracket-p
+ ;; Handle scan errors gracefully.
+ (condition-case nil
+ (progn
+ ;; Use the regular `forward-sexp-function' because the
+ ;; normal one for this mode uses the AST.
+ (let (forward-sexp-function)
+ (forward-sexp))
+ t)
+ (error nil)))
+ (when at-closing-bracket-p
+ (js2-forward-sws)
+ (setq comma-p (looking-at-p ","))))
+ (when comma-p
+ (goto-char (1+ declaration-keyword-end))))))))
+
+(cl-defun js2-proper-indentation (parse-status)
+ "Return the proper indentation for the current line."
+ (save-excursion
+ (back-to-indentation)
+ (when (nth 4 parse-status)
+ (cl-return-from js2-proper-indentation (js2--comment-indent parse-status)))
+ (let* ((at-closing-bracket (looking-at "[]})]"))
+ (same-indent-p (or at-closing-bracket
+ (looking-at "\\_<case\\_>[^:]")
+ (and (looking-at "\\_<default:")
+ (save-excursion
+ (js2-backward-sws)
+ (not (memq (char-before) '(?, ?{)))))))
+ (continued-expr-p (js2-continued-expression-p))
+ (declaration-indent (and js2-pretty-multiline-declarations
+ (js2-multiline-decl-indentation)))
+ (bracket (nth 1 parse-status))
+ beg indent)
+ (cond
+ ;; indent array comprehension continuation lines specially
+ ((and bracket
+ (>= js2-language-version 170)
+ (not (js2-same-line bracket))
+ (setq beg (js2-indent-in-array-comp parse-status))
+ (>= (point) (save-excursion
+ (goto-char beg)
+ (point-at-bol)))) ; at or after first loop?
+ (js2-array-comp-indentation parse-status beg))
+
+ ((js2-ctrl-statement-indentation))
+
+ ((and declaration-indent continued-expr-p)
+ (+ declaration-indent js2-basic-offset))
+
+ (declaration-indent)
+
+ (bracket
+ (goto-char bracket)
+ (cond
+ ((looking-at "[({[][ \t]*\\(/[/*]\\|$\\)")
+ (when (save-excursion (skip-chars-backward " \t\n)")
+ (looking-at ")"))
+ (backward-list))
+ (back-to-indentation)
+ (js2-maybe-goto-declaration-keyword-end bracket)
+ (setq indent
+ (cond (same-indent-p
+ (current-column))
+ (continued-expr-p
+ (+ (current-column) (* 2 js2-basic-offset)))
+ (t
+ (+ (current-column) js2-basic-offset))))
+ (if (and js2-indent-switch-body
+ (not at-closing-bracket)
+ (looking-at "\\_<switch\\_>"))
+ (+ indent js2-basic-offset)
+ indent))
+ (t
+ (unless same-indent-p
+ (forward-char)
+ (skip-chars-forward " \t"))
+ (current-column))))
+
+ (continued-expr-p js2-basic-offset)
+
+ (t 0)))))
+
+(defun js2--comment-indent (parse-status)
+ "Indentation inside a multi-line block comment continuation line."
+ (save-excursion
+ (goto-char (nth 8 parse-status))
+ (if (looking-at "/\\*")
+ (+ 1 (current-column))
+ 0)))
+
+(defun js2-indent-line (&optional _bounce-backwards)
+ "Indent the current line as JavaScript source text."
+ (interactive)
+ (let (parse-status offset
+ ;; Don't whine about errors/warnings when we're indenting.
+ ;; This has to be set before calling parse-partial-sexp below.
+ (inhibit-point-motion-hooks t))
+ (setq parse-status (save-excursion
+ (syntax-ppss (point-at-bol)))
+ offset (- (point) (save-excursion
+ (back-to-indentation)
+ (point))))
+ ;; Don't touch multiline strings.
+ (unless (nth 3 parse-status)
+ (indent-line-to (js2-proper-indentation parse-status))
+ (when (cl-plusp offset)
+ (forward-char offset)))))
+
+;;; JSX Indentation
+
+;; The following JSX indentation code is copied basically verbatim from js.el at
+;; 958da7f, except that the prefixes on the functions/variables are changed.
+
+(defsubst js2--jsx-find-before-tag ()
+ "Find where JSX starts.
+
+Assume JSX appears in the following instances:
+- Inside parentheses, when returned or as the first argument
+ to a function, and after a newline
+- When assigned to variables or object properties, but only
+ on a single line
+- As the N+1th argument to a function
+
+This is an optimized version of (re-search-backward \"[(,]\n\"
+nil t), except set point to the end of the match. This logic
+executes up to the number of lines in the file, so it should be
+really fast to reduce that impact."
+ (let (pos)
+ (while (and (> (point) (point-min))
+ (not (progn
+ (end-of-line 0)
+ (when (or (eq (char-before) 40) ; (
+ (eq (char-before) 44)) ; ,
+ (setq pos (1- (point))))))))
+ pos))
+
+(defconst js2--jsx-end-tag-re
+ (concat "</" sgml-name-re ">\\|/>")
+ "Find the end of a JSX element.")
+
+(defconst js2--jsx-after-tag-re "[),]"
+ "Find where JSX ends.
+This complements the assumption of where JSX appears from
+`js--jsx-before-tag-re', which see.")
+
+(defun js2--jsx-indented-element-p ()
+ "Determine if/how the current line should be indented as JSX.
+
+Return `first' for the first JSXElement on its own line.
+Return `nth' for subsequent lines of the first JSXElement.
+Return `expression' for an embedded JS expression.
+Return `after' for anything after the last JSXElement.
+Return nil for non-JSX lines.
+
+Currently, JSX indentation supports the following styles:
+
+- Single-line elements (indented like normal JS):
+
+ var element = <div></div>;
+
+- Multi-line elements (enclosed in parentheses):
+
+ function () {
+ return (
+ <div>
+ <div></div>
+ </div>
+ );
+ }
+
+- Function arguments:
+
+ React.render(
+ <div></div>,
+ document.querySelector(\\='.root\\=')
+ );"
+ (let ((current-pos (point))
+ (current-line (line-number-at-pos))
+ last-pos
+ before-tag-pos before-tag-line
+ tag-start-pos tag-start-line
+ tag-end-pos tag-end-line
+ after-tag-line
+ parens paren type)
+ (save-excursion
+ (and
+ ;; Determine if we're inside a jsx element
+ (progn
+ (end-of-line)
+ (while (and (not tag-start-pos)
+ (setq last-pos (js2--jsx-find-before-tag)))
+ (while (forward-comment 1))
+ (when (= (char-after) 60) ; <
+ (setq before-tag-pos last-pos
+ tag-start-pos (point)))
+ (goto-char last-pos))
+ tag-start-pos)
+ (progn
+ (setq before-tag-line (line-number-at-pos before-tag-pos)
+ tag-start-line (line-number-at-pos tag-start-pos))
+ (and
+ ;; A "before" line which also starts an element begins with js, so
+ ;; indent it like js
+ (> current-line before-tag-line)
+ ;; Only indent the jsx lines like jsx
+ (>= current-line tag-start-line)))
+ (cond
+ ;; Analyze bounds if there are any
+ ((progn
+ (while (and (not tag-end-pos)
+ (setq last-pos (re-search-forward js2--jsx-end-tag-re nil t)))
+ (while (forward-comment 1))
+ (when (looking-at js2--jsx-after-tag-re)
+ (setq tag-end-pos last-pos)))
+ tag-end-pos)
+ (setq tag-end-line (line-number-at-pos tag-end-pos)
+ after-tag-line (line-number-at-pos after-tag-line))
+ (or (and
+ ;; Ensure we're actually within the bounds of the jsx
+ (<= current-line tag-end-line)
+ ;; An "after" line which does not end an element begins with
+ ;; js, so indent it like js
+ (<= current-line after-tag-line))
+ (and
+ ;; Handle another case where there could be e.g. comments after
+ ;; the element
+ (> current-line tag-end-line)
+ (< current-line after-tag-line)
+ (setq type 'after))))
+ ;; They may not be any bounds (yet)
+ (t))
+ ;; Check if we're inside an embedded multi-line js expression
+ (cond
+ ((not type)
+ (goto-char current-pos)
+ (end-of-line)
+ (setq parens (nth 9 (syntax-ppss)))
+ (while (and parens (not type))
+ (setq paren (car parens))
+ (cond
+ ((and (>= paren tag-start-pos)
+ ;; Curly bracket indicates the start of an embedded expression
+ (= (char-after paren) 123) ; {
+ ;; The first line of the expression is indented like sgml
+ (> current-line (line-number-at-pos paren))
+ ;; Check if within a closing curly bracket (if any)
+ ;; (exclusive, as the closing bracket is indented like sgml)
+ (cond
+ ((progn
+ (goto-char paren)
+ (ignore-errors (let (forward-sexp-function)
+ (forward-sexp))))
+ (< current-line (line-number-at-pos)))
+ (t)))
+ ;; Indicate this guy will be indented specially
+ (setq type 'expression))
+ (t (setq parens (cdr parens)))))
+ t)
+ (t))
+ (cond
+ (type)
+ ;; Indent the first jsx thing like js so we can indent future jsx things
+ ;; like sgml relative to the first thing
+ ((= current-line tag-start-line) 'first)
+ ('nth))))))
+
+(defmacro js2--as-sgml (&rest body)
+ "Execute BODY as if in sgml-mode."
+ `(with-syntax-table sgml-mode-syntax-table
+ (let (forward-sexp-function
+ parse-sexp-lookup-properties)
+ ,@body)))
+
+(defun js2--expression-in-sgml-indent-line ()
+ "Indent the current line as JavaScript or SGML (whichever is farther)."
+ (let* (indent-col
+ (savep (point))
+ ;; Don't whine about errors/warnings when we're indenting.
+ ;; This has to be set before calling parse-partial-sexp below.
+ (inhibit-point-motion-hooks t)
+ (parse-status (save-excursion
+ (syntax-ppss (point-at-bol)))))
+ ;; Don't touch multiline strings.
+ (unless (nth 3 parse-status)
+ (setq indent-col (save-excursion
+ (back-to-indentation)
+ (if (>= (point) savep) (setq savep nil))
+ (js2--as-sgml (sgml-calculate-indent))))
+ (if (null indent-col)
+ 'noindent
+ ;; Use whichever indentation column is greater, such that the sgml
+ ;; column is effectively a minimum
+ (setq indent-col (max (js2-proper-indentation parse-status)
+ (+ indent-col js2-basic-offset)))
+ (if savep
+ (save-excursion (indent-line-to indent-col))
+ (indent-line-to indent-col))))))
+
+(defun js2-jsx-indent-line ()
+ "Indent the current line as JSX (with SGML offsets).
+i.e., customize JSX element indentation with `sgml-basic-offset'
+et al."
+ (interactive)
+ (let ((indentation-type (js2--jsx-indented-element-p)))
+ (cond
+ ((eq indentation-type 'expression)
+ (js2--expression-in-sgml-indent-line))
+ ((or (eq indentation-type 'first)
+ (eq indentation-type 'after))
+ ;; Don't treat this first thing as a continued expression (often a "<" or
+ ;; ">" causes this misinterpretation)
+ (cl-letf (((symbol-function #'js2-continued-expression-p) 'ignore))
+ (js2-indent-line)))
+ ((eq indentation-type 'nth)
+ (js2--as-sgml (sgml-indent-line)))
+ (t (js2-indent-line)))))
+
+(provide 'js2-old-indent)
+
+;;; js2-old-indent.el ends here
diff --git a/elpa/js2-mode-20220402.2211/js2-old-indent.elc b/elpa/js2-mode-20220402.2211/js2-old-indent.elc
new file mode 100644
index 0000000..49853c6
--- /dev/null
+++ b/elpa/js2-mode-20220402.2211/js2-old-indent.elc
Binary files differ
diff --git a/elpa/js2-refactor-20210306.2003/js2-refactor-autoloads.el b/elpa/js2-refactor-20210306.2003/js2-refactor-autoloads.el
new file mode 100644
index 0000000..cae75d6
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2-refactor-autoloads.el
@@ -0,0 +1,131 @@
+;;; js2-refactor-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*-
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "js2-refactor" "js2-refactor.el" (0 0 0 0))
+;;; Generated autoloads from js2-refactor.el
+
+(autoload 'js2-refactor-mode "js2-refactor" "\
+Minor mode providing JavaScript refactorings.
+
+This is a minor mode. If called interactively, toggle the
+`Js2-Refactor mode' mode. If the prefix argument is positive,
+enable the mode, and if it is zero or negative, disable the mode.
+
+If called from Lisp, toggle the mode if ARG is `toggle'. Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+To check whether the minor mode is enabled in the current buffer,
+evaluate `js2-refactor-mode'.
+
+The mode's hook is called both when the mode is enabled and when
+it is disabled.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'js2r-add-keybindings-with-prefix "js2-refactor" "\
+Add js2r keybindings using the prefix PREFIX.
+
+\(fn PREFIX)" nil nil)
+
+(autoload 'js2r-add-keybindings-with-modifier "js2-refactor" "\
+Add js2r keybindings using the modifier MODIFIER.
+
+\(fn MODIFIER)" nil nil)
+
+(register-definition-prefixes "js2-refactor" '("js2"))
+
+;;;***
+
+;;;### (autoloads nil "js2r-conditionals" "js2r-conditionals.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from js2r-conditionals.el
+
+(register-definition-prefixes "js2r-conditionals" '("js2r-ternary-to-if"))
+
+;;;***
+
+;;;### (autoloads nil "js2r-conveniences" "js2r-conveniences.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from js2r-conveniences.el
+
+(register-definition-prefixes "js2r-conveniences" '("js2r-" "move-line-"))
+
+;;;***
+
+;;;### (autoloads nil "js2r-formatting" "js2r-formatting.el" (0 0
+;;;;;; 0 0))
+;;; Generated autoloads from js2r-formatting.el
+
+(register-definition-prefixes "js2r-formatting" '("js2r-"))
+
+;;;***
+
+;;;### (autoloads nil "js2r-functions" "js2r-functions.el" (0 0 0
+;;;;;; 0))
+;;; Generated autoloads from js2r-functions.el
+
+(register-definition-prefixes "js2r-functions" '("js2r-"))
+
+;;;***
+
+;;;### (autoloads nil "js2r-helpers" "js2r-helpers.el" (0 0 0 0))
+;;; Generated autoloads from js2r-helpers.el
+
+(register-definition-prefixes "js2r-helpers" '("js2r--"))
+
+;;;***
+
+;;;### (autoloads nil "js2r-iife" "js2r-iife.el" (0 0 0 0))
+;;; Generated autoloads from js2r-iife.el
+
+(register-definition-prefixes "js2r-iife" '("js2r-"))
+
+;;;***
+
+;;;### (autoloads nil "js2r-paredit" "js2r-paredit.el" (0 0 0 0))
+;;; Generated autoloads from js2r-paredit.el
+
+(register-definition-prefixes "js2r-paredit" '("js2r-"))
+
+;;;***
+
+;;;### (autoloads nil "js2r-vars" "js2r-vars.el" (0 0 0 0))
+;;; Generated autoloads from js2r-vars.el
+
+(autoload 'js2r-rename-var "js2r-vars" "\
+Renames the variable on point and all occurrences in its lexical scope." t nil)
+
+(autoload 'js2r-extract-var "js2r-vars" nil t nil)
+
+(autoload 'js2r-extract-let "js2r-vars" nil t nil)
+
+(autoload 'js2r-extract-const "js2r-vars" nil t nil)
+
+(register-definition-prefixes "js2r-vars" '("current-line-contents" "js2r-"))
+
+;;;***
+
+;;;### (autoloads nil "js2r-wrapping" "js2r-wrapping.el" (0 0 0 0))
+;;; Generated autoloads from js2r-wrapping.el
+
+(register-definition-prefixes "js2r-wrapping" '("js2r-"))
+
+;;;***
+
+;;;### (autoloads nil nil ("js2-refactor-pkg.el") (0 0 0 0))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; js2-refactor-autoloads.el ends here
diff --git a/elpa/js2-refactor-20210306.2003/js2-refactor-pkg.el b/elpa/js2-refactor-20210306.2003/js2-refactor-pkg.el
new file mode 100644
index 0000000..db355ff
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2-refactor-pkg.el
@@ -0,0 +1,17 @@
+(define-package "js2-refactor" "20210306.2003" "A JavaScript refactoring library for emacs."
+ '((js2-mode "20101228")
+ (s "1.9.0")
+ (multiple-cursors "1.0.0")
+ (dash "1.0.0")
+ (s "1.0.0")
+ (yasnippet "0.9.0.1"))
+ :commit "a0977c4ce1918cc266db9d6cd7a2ab63f3a76b9a" :authors
+ '(("Magnar Sveen" . "magnars@gmail.com")
+ ("Nicolas Petton" . "nicolas@petton.fr"))
+ :maintainer
+ '("Magnar Sveen" . "magnars@gmail.com")
+ :keywords
+ '("conveniences"))
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/elpa/js2-refactor-20210306.2003/js2-refactor.el b/elpa/js2-refactor-20210306.2003/js2-refactor.el
new file mode 100644
index 0000000..1ef60b4
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2-refactor.el
@@ -0,0 +1,248 @@
+;;; js2-refactor.el --- The beginnings of a JavaScript refactoring library in emacs. -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2014 Magnar Sveen
+;; Copyright (C) 2015-2016 Magnar Sveen and Nicolas Petton
+
+;; Author: Magnar Sveen <magnars@gmail.com>,
+;; Nicolas Petton <nicolas@petton.fr>
+;; Keywords: conveniences
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This is a collection of small refactoring functions to further the idea of a
+;; JavaScript IDE in Emacs that started with js2-mode.
+
+;; ## Installation
+
+;; Start by installing the dependencies:
+
+;; * js2-mode https://github.com/mooz/js2-mode/
+;; * dash https://github.com/magnars/dash.el
+;; * multiple-cursors https://github.com/magnars/multiple-cursors.el
+
+;; It is also recommended to get
+;; [expand-region](https://github.com/magnars/expand-region.el) to more easily mark
+;; vars, method calls and functions for refactorings.
+
+;; Then add this to your Emacs settings:
+
+;; (require 'js2-refactor)
+;; (add-hook 'js2-mode-hook #'js2-refactor-mode)
+;; (js2r-add-keybindings-with-prefix "C-c C-m")
+
+;; Note: I am working on a smoother installation path through package.el,
+;; but I haven't had the time to whip this project into that sort of
+;; structure - yet.
+
+;; ## Usage
+
+;; All refactorings start with `C-c C-m` and then a two-letter mnemonic shortcut.
+
+;; * `ee` is `expand-node-at-point`: Expand bracketed list according to node type at point (array, object, function, call args).
+;; * `cc` is `contract-node-at-point`: Contract bracketed list according to node type at point (array, object, function, call args).
+;; * `ef` is `extract-function`: Extracts the marked expressions out into a new named function.
+;; * `em` is `extract-method`: Extracts the marked expressions out into a new named method in an object literal.
+;; * `tf` is `toggle-function-expression-and-declaration`: Toggle between function name() {} and var name = function ();
+;; * `ta` is `toggle-arrow-function-and-expression`: Toggle between function expression to arrow function.
+;; * `ts` is `toggle-function-async`: Toggle between an async and a regular function.
+;; * `ip` is `introduce-parameter`: Changes the marked expression to a parameter in a local function.
+;; * `lp` is `localize-parameter`: Changes a parameter to a local var in a local function.
+;; * `wi` is `wrap-buffer-in-iife`: Wraps the entire buffer in an immediately invoked function expression
+;; * `ig` is `inject-global-in-iife`: Creates a shortcut for a marked global by injecting it in the wrapping immediately invoked function expression
+;; * `ag` is `add-to-globals-annotation`: Creates a `/*global */` annotation if it is missing, and adds the var at point to it.
+;; * `ev` is `extract-var`: Takes a marked expression and replaces it with a var.
+;; * `el` is `extract-var`: Takes a marked expression and replaces it with a let.
+;; * `ec` is `extract-var`: Takes a marked expression and replaces it with a const.
+;; * `iv` is `inline-var`: Replaces all instances of a variable with its initial value.
+;; * `rv` is `rename-var`: Renames the variable on point and all occurrences in its lexical scope.
+;; * `vt` is `var-to-this`: Changes local `var a` to be `this.a` instead.
+;; * `ao` is `arguments-to-object`: Replaces arguments to a function call with an object literal of named arguments.
+;; * `3i` is `ternary-to-if`: Converts ternary operator to if-statement.
+;; * `sv` is `split-var-declaration`: Splits a `var` with multiple vars declared, into several `var` statements.
+;; * `ss` is `split-string`: Splits a `string`.
+;; * `st` is `string-to-template`: Converts a `string` into a template string.
+;; * `uw` is `unwrap`: Replaces the parent statement with the selected region.
+;; * `lt` is `log-this`: Adds a console.log() statement for what is at point (or region). With a prefix argument, use JSON pretty-printing.
+;; * `dt` is `debug-this`: Adds a debug() statement for what is at point (or region).
+;; * `sl` is `forward-slurp`: Moves the next statement into current function, if-statement, for-loop or while-loop.
+;; * `ba` is `forward-barf`: Moves the last child out of current function, if-statement, for-loop or while-loop.
+;; * `k` is `kill`: Kills to the end of the line, but does not cross semantic boundaries.
+
+;; There are also some minor conveniences bundled:
+
+;; * `C-S-down` and `C-S-up` moves the current line up or down. If the line is an
+;; element in an object or array literal, it makes sure that the commas are
+;; still correctly placed.
+;; * `k` `kill-line`: Like `kill-line` but respecting the AST.
+
+;; ## Todo
+
+;; A list of some wanted improvements for the current refactorings.
+
+;; * expand- and contract-array: should work recursively with nested object literals and nested arrays.
+;; * expand- and contract-function: should deal better with nested object literals, array declarations, and statements terminated only by EOLs (without semicolons).
+;; * wrap-buffer-in-iife: should skip comments and namespace initializations at buffer start.
+;; * extract-variable: could end with a query-replace of the expression in its scope.
+
+;; ## Contributions
+
+;; * [Matt Briggs](https://github.com/mbriggs) contributed `js2r-add-to-globals-annotation`
+;; * [Alex Chamberlain](https://github.com/apchamberlain) contributed contracting and expanding arrays and functions.
+;; * [Nicolas Petton](https://github.com/NicolasPetton) contributed `js2r-kill`
+;; Thanks!
+
+;; ## Contribute
+
+;; This project is still in its infancy, and everything isn't quite sorted out
+;; yet. If you're eager to contribute, please add an issue here on github and we
+;; can discuss your changes a little before diving into the elisp :-).
+
+;; To fetch the test dependencies:
+
+;; $ cd /path/to/multiple-cursors
+;; $ git submodule init
+;; $ git submodule update
+
+;; Run the tests with:
+
+;; $ ./util/ecukes/ecukes features
+
+;;; Code:
+
+(require 'js2-mode)
+(require 'js2r-helpers)
+(require 'js2r-formatting)
+(require 'js2r-iife)
+(require 'js2r-vars)
+(require 'js2r-functions)
+(require 'js2r-wrapping)
+(require 'js2r-conditionals)
+(require 'js2r-conveniences)
+(require 'js2r-paredit)
+
+(defvar js2-refactor-mode-map
+ (make-sparse-keymap)
+ "Keymap for js2-refactor.")
+
+(defvar js2-refactor-keybinding-prefix
+ nil
+ "Store keybinding prefix used by js2-refactor.")
+
+;;;###autoload
+(define-minor-mode js2-refactor-mode
+ "Minor mode providing JavaScript refactorings."
+ :lighter " js2r"
+ :keymap js2-refactor-mode-map
+ (when js2-refactor-mode
+ (yas-minor-mode-on)))
+
+;;; Settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defgroup js2-refactor nil
+ "Minor mode providing JavaScript refactorings."
+ :group 'tools
+ :prefix "js2r-"
+ :link '(url-link :tag "Repository" "https://github.com/magnars/js2-refactor.el"))
+
+(defcustom js2r-use-strict nil
+ "When non-nil, js2r inserts strict declarations in IIFEs."
+ :group 'js2-refactor
+ :type 'boolean)
+
+(defcustom js2r-iife-style 'function
+ "The type of function to use for IIFEs.
+Can be either `function', yielding (function () {})(),
+`function-inner' for (function () {} ()), or `lambda',
+for (() => {})()."
+ :group 'js2-refactor
+ :type '(choice (const function :tag "(function () {})()")
+ (const function-inner :tag "(function () {}())")
+ (const lambda :tag "(() => {})()")))
+
+(defcustom js2r-prefered-quote-type 1
+ "The prefered quote style for strings."
+ :group 'js2-refactor
+ :type '(choice (const :tag "Double" 1)
+ (const :tag "Single" 2)))
+
+(defcustom js2r-always-insert-parens-around-arrow-function-params nil
+ "When non-nil, js2r always inserts parenthesis around arrow function params.
+This only affects arrow functions with one parameter."
+ :group 'js2-refactor
+ :type 'boolean)
+
+(defcustom js2r-prefer-let-over-var nil
+ "When non-nil, js2r uses let constructs over var when performing refactorings."
+ :group 'js2-refactor
+ :type 'boolean)
+
+(defcustom js2r-log-before-point nil
+ "When non-nil, js2r inserts logging and debug statements before point.
+When nil, logging and debug statements are inserted after point,
+unless point is in a return statement."
+ :group 'js2-refactor
+ :type 'boolean)
+
+;;; Keybindings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun js2r--add-keybindings (key-fn)
+ "Add js2r refactoring keybindings to `js2-mode-map' using KEY-FN to create each keybinding."
+ (define-key js2-refactor-mode-map (funcall key-fn "ee") #'js2r-expand-node-at-point)
+ (define-key js2-refactor-mode-map (funcall key-fn "cc") #'js2r-contract-node-at-point)
+ (define-key js2-refactor-mode-map (funcall key-fn "wi") #'js2r-wrap-buffer-in-iife)
+ (define-key js2-refactor-mode-map (funcall key-fn "ig") #'js2r-inject-global-in-iife)
+ (define-key js2-refactor-mode-map (funcall key-fn "ev") #'js2r-extract-var)
+ (define-key js2-refactor-mode-map (funcall key-fn "el") #'js2r-extract-let)
+ (define-key js2-refactor-mode-map (funcall key-fn "ec") #'js2r-extract-const)
+ (define-key js2-refactor-mode-map (funcall key-fn "iv") #'js2r-inline-var)
+ (define-key js2-refactor-mode-map (funcall key-fn "rv") #'js2r-rename-var)
+ (define-key js2-refactor-mode-map (funcall key-fn "vt") #'js2r-var-to-this)
+ (define-key js2-refactor-mode-map (funcall key-fn "ag") #'js2r-add-to-globals-annotation)
+ (define-key js2-refactor-mode-map (funcall key-fn "sv") #'js2r-split-var-declaration)
+ (define-key js2-refactor-mode-map (funcall key-fn "ss") #'js2r-split-string)
+ (define-key js2-refactor-mode-map (funcall key-fn "st") #'js2r-string-to-template)
+ (define-key js2-refactor-mode-map (funcall key-fn "ef") #'js2r-extract-function)
+ (define-key js2-refactor-mode-map (funcall key-fn "em") #'js2r-extract-method)
+ (define-key js2-refactor-mode-map (funcall key-fn "ip") #'js2r-introduce-parameter)
+ (define-key js2-refactor-mode-map (funcall key-fn "lp") #'js2r-localize-parameter)
+ (define-key js2-refactor-mode-map (funcall key-fn "tf") #'js2r-toggle-function-expression-and-declaration)
+ (define-key js2-refactor-mode-map (funcall key-fn "ta") #'js2r-toggle-arrow-function-and-expression)
+ (define-key js2-refactor-mode-map (funcall key-fn "ts") #'js2r-toggle-function-async)
+ (define-key js2-refactor-mode-map (funcall key-fn "ao") #'js2r-arguments-to-object)
+ (define-key js2-refactor-mode-map (funcall key-fn "uw") #'js2r-unwrap)
+ (define-key js2-refactor-mode-map (funcall key-fn "wl") #'js2r-wrap-in-for-loop)
+ (define-key js2-refactor-mode-map (funcall key-fn "3i") #'js2r-ternary-to-if)
+ (define-key js2-refactor-mode-map (funcall key-fn "lt") #'js2r-log-this)
+ (define-key js2-refactor-mode-map (funcall key-fn "dt") #'js2r-debug-this)
+ (define-key js2-refactor-mode-map (funcall key-fn "sl") #'js2r-forward-slurp)
+ (define-key js2-refactor-mode-map (funcall key-fn "ba") #'js2r-forward-barf)
+ (define-key js2-refactor-mode-map (funcall key-fn "k") #'js2r-kill)
+ (define-key js2-refactor-mode-map (kbd "<C-S-down>") #'js2r-move-line-down)
+ (define-key js2-refactor-mode-map (kbd "<C-S-up>") #'js2r-move-line-up))
+
+;;;###autoload
+(defun js2r-add-keybindings-with-prefix (prefix)
+ "Add js2r keybindings using the prefix PREFIX."
+ (setq js2-refactor-keybinding-prefix (read-kbd-macro prefix))
+ (js2r--add-keybindings (-partial #'js2r--key-pairs-with-prefix prefix)))
+
+;;;###autoload
+(defun js2r-add-keybindings-with-modifier (modifier)
+ "Add js2r keybindings using the modifier MODIFIER."
+ (js2r--add-keybindings (-partial #'js2r--key-pairs-with-modifier modifier)))
+
+(provide 'js2-refactor)
+;;; js2-refactor.el ends here
diff --git a/elpa/js2-refactor-20210306.2003/js2-refactor.elc b/elpa/js2-refactor-20210306.2003/js2-refactor.elc
new file mode 100644
index 0000000..d3071fb
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2-refactor.elc
Binary files differ
diff --git a/elpa/js2-refactor-20210306.2003/js2r-conditionals.el b/elpa/js2-refactor-20210306.2003/js2r-conditionals.el
new file mode 100644
index 0000000..cd984eb
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-conditionals.el
@@ -0,0 +1,57 @@
+;;; js2r-conditionals.el --- Conditional refactoring functions for js2-refactor -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2014 Magnar Sveen
+;; Copyright (C) 2015-2016 Magnar Sveen and Nicolas Petton
+
+;; Author: Magnar Sveen <magnars@gmail.com>,
+;; Nicolas Petton <nicolas@petton.fr>
+;; Keywords: conveniences
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 's)
+
+(require 'js2r-helpers)
+
+(defun js2r-ternary-to-if ()
+ "Convert a ternary operator to an if-statement."
+ (interactive)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (save-excursion
+ (let* ((ternary (js2r--closest 'js2-cond-node-p))
+ (test-expr (js2-node-string (js2-cond-node-test-expr ternary)))
+ (true-expr (js2-node-string (js2-cond-node-true-expr ternary)))
+ (false-expr (js2-node-string (js2-cond-node-false-expr ternary)))
+ (stmt (js2-node-parent-stmt ternary))
+ (stmt-pre (buffer-substring (js2-node-abs-pos stmt) (js2-node-abs-pos ternary)))
+ (stmt-post (s-trim (buffer-substring (js2-node-abs-end ternary) (js2-node-abs-end stmt))))
+ (beg (js2-node-abs-pos stmt)))
+ (goto-char beg)
+ (delete-char (js2-node-len stmt))
+ (insert "if (" test-expr ") {")
+ (newline)
+ (insert stmt-pre true-expr stmt-post)
+ (newline)
+ (insert "} else {")
+ (newline)
+ (insert stmt-pre false-expr stmt-post)
+ (newline)
+ (insert "}")
+ (indent-region beg (point))))))
+
+(provide 'js2r-conditionals)
+;;; js2r-conditionals ends here
diff --git a/elpa/js2-refactor-20210306.2003/js2r-conditionals.elc b/elpa/js2-refactor-20210306.2003/js2r-conditionals.elc
new file mode 100644
index 0000000..b9f2517
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-conditionals.elc
Binary files differ
diff --git a/elpa/js2-refactor-20210306.2003/js2r-conveniences.el b/elpa/js2-refactor-20210306.2003/js2r-conveniences.el
new file mode 100644
index 0000000..e5fa3da
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-conveniences.el
@@ -0,0 +1,242 @@
+;;; js2r-conveniences.el --- Convenience functions for js2-refactor -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2014 Magnar Sveen
+;; Copyright (C) 2015-2016 Magnar Sveen and Nicolas Petton
+
+;; Author: Magnar Sveen <magnars@gmail.com>,
+;; Nicolas Petton <nicolas@petton.fr>
+;; Keywords: conveniences
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Convenience functions for logging statements by inserting
+;; `console.log' statements and moving lines respecting object
+;; literal syntax.
+
+;;; Code:
+
+(require 'js2r-helpers)
+
+(defun js2r-log-this (arg)
+ "Log of the node at point, adding a 'console.log()' statement.
+With a prefix argument ARG, use JSON pretty-printing for logging."
+ (interactive "P")
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (let* ((log-info (js2r--figure-out-what-to-log-where))
+ (stmt (car log-info))
+ (pos (cdr log-info)))
+ (save-excursion
+ (goto-char pos)
+ (when (looking-at "[;{]")
+ (forward-char 1))
+ (newline-and-indent)
+ (if arg
+ (progn (insert "console.log(\"" stmt " = \");")
+ (newline-and-indent)
+ (insert "console.dir(" stmt ", { depth:null, colors: true });"))
+ (insert "console.log(\"" stmt " = \", " stmt ");"))))))
+
+(defun js2r-debug-this ()
+ "Debug the node at point, adding a 'debug()' statement."
+ (interactive)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (let* ((log-info (js2r--figure-out-what-to-log-where))
+ (stmt (car log-info))
+ (pos (cdr log-info)))
+ (save-excursion
+ (goto-char pos)
+ (when (looking-at "[;{]")
+ (forward-char 1))
+ (newline-and-indent)
+ (insert "debug(" (js2r--wrap-text stmt " = %s") ", " stmt ");")))))
+
+(defun js2r--figure-out-what-to-log-where ()
+ "Return a dotted pair containing the statement to log and the
+position where the log should be inserted."
+ (let ((parent-stmt (js2-node-parent-stmt (js2-node-at-point))))
+
+ (if (use-region-p)
+ (cons (buffer-substring (region-beginning) (region-end))
+ (js2r--find-suitable-log-position-around parent-stmt))
+
+ (let* ((node (js2r--name-node-at-point))
+ (parent (js2-node-parent node)))
+
+ (cond
+
+ ((js2-function-node-p parent)
+ (cons (js2-name-node-name node)
+ (js2-node-abs-pos (js2-function-node-body parent))))
+
+ ((js2-prop-get-node-p parent)
+ (cons (buffer-substring (js2-node-abs-pos parent) (js2-node-abs-end parent))
+ (js2r--find-suitable-log-position-around parent-stmt)))
+
+ (:else
+ (cons (js2-name-node-name node)
+ (js2r--find-suitable-log-position-around parent-stmt))))))))
+
+(defun js2r--find-suitable-log-position-around (parent-stmt)
+ "Return the position close to PARENT-STMT where the log statement should be inserted."
+ (if (or js2r-log-before-point (js2-return-node-p parent-stmt))
+ (save-excursion
+ (goto-char (js2-node-abs-pos parent-stmt))
+ (skip-chars-backward " \t\n\r") ; Can't use skip-syntax-backward since \n is end-comment
+ (point))
+ (js2-node-abs-end parent-stmt)))
+
+(defun js2r-split-string ()
+ "Split the string node at point. If the string is already split, join it instead."
+ (interactive)
+ (when (js2r--point-inside-string-p)
+ (let ((delimiter (js2r--string-delimiter (js2-node-at-point))))
+ (if (looking-back " \"")
+ (progn
+ (forward-char -2)
+ (insert " +")
+ (forward-char -2))
+ (if (looking-at (regexp-quote (format "%s + %s" delimiter delimiter)))
+ (delete-char 5)
+ (insert (format "%s + %s" delimiter delimiter)))))))
+
+(defun js2r-string-to-template ()
+ "Convert the string at point into a template string."
+ (interactive)
+ (let ((node (js2-node-at-point)))
+ (when (js2-string-node-p node)
+ (let* ((start (js2-node-abs-pos node))
+ (end (+ start (js2-node-len node))))
+ (when (memq (char-after start) '(?' ?\"))
+ (save-excursion
+ (goto-char end) (delete-char -1) (insert "`")
+ (goto-char start) (delete-char 1) (insert "`")
+ (perform-replace "`" "\\`" nil nil nil nil nil (1+ start) (1- end))))))))
+
+(defun js2r--string-delimiter (node)
+ "Return the delimiter character of the string node NODE.
+It can be a single or double quote."
+ (save-excursion
+ (goto-char (js2-node-abs-pos node))
+ (char-to-string (following-char))))
+
+(defun move-line-down ()
+ "Move the current line down one line."
+ (interactive)
+ (let ((col (current-column)))
+ (save-excursion
+ (forward-line)
+ (transpose-lines 1))
+ (forward-line)
+ (move-to-column col)))
+
+(defun move-line-up ()
+ "Move the current line up one line."
+ (interactive)
+ (let ((col (current-column)))
+ (transpose-lines 1)
+ (forward-line -2)
+ (move-to-column col)))
+
+(defun js2r-move-line-down ()
+ "Move the current line down one line.
+Make sure commas are placed correctly when moving a line up or
+down in an object or array literal."
+ (interactive)
+ (if (and (js2r--current-line-is-a-list-item)
+ (js2r--next-line-is-a-list-item))
+ (js2r--move-line-down-as-list-item)
+ (move-line-down))
+ (funcall indent-line-function))
+
+(defun js2r-move-line-up ()
+ "Move the current line up one line.
+Make sure commas are placed correctly when moving a line up or
+down in an object or array literal."
+ (interactive)
+ (if (and (js2r--current-line-is-a-list-item)
+ (js2r--previous-line-is-a-list-item))
+ (js2r--move-line-up-as-list-item)
+ (move-line-up))
+ (funcall indent-line-function))
+
+(defun js2r--current-line-is-prefixed-with-list-item-start ()
+ "Return whether the current line is prefixed with '{' or '['."
+ (save-excursion
+ (back-to-indentation)
+ (looking-back "\\({\\|\\[\\|,\\)\\(\s\\|\n\\|\t\\)*")))
+
+(defun js2r--current-line-is-postfixed-with-list-item-end ()
+ "Return whether the current line is postfixed with '{' or '['."
+ (save-excursion
+ (end-of-line)
+ (or (looking-back ",\s*") ; line ends in comma
+ (looking-at "\\(\s\\|\n\\|\t\\)*\\(\\]\\|}\\)"))))
+
+(defun js2r--current-line-is-a-list-item ()
+ "Return whether the current line contain an array or object literal."
+ (and (js2r--current-line-is-prefixed-with-list-item-start)
+ (js2r--current-line-is-postfixed-with-list-item-end)))
+
+(defun js2r--next-line-is-a-list-item ()
+ "Return whether the current line contain an array or object literal."
+ (save-excursion
+ (forward-line)
+ (js2r--current-line-is-a-list-item)))
+
+(defun js2r--previous-line-is-a-list-item ()
+ "Return whether the previous line contain an array or object literal, and only that."
+ (save-excursion
+ (forward-line -1)
+ (js2r--current-line-is-a-list-item)))
+
+(defun js2r--current-line-has-comma ()
+ "Return whether the current line ends with a comma."
+ (save-excursion
+ (end-of-line)
+ (looking-back ",\s*")))
+
+(defun js2r--previous-line-has-comma ()
+ "Return whether the previous line ends with a comma."
+ (save-excursion
+ (forward-line -1)
+ (js2r--current-line-has-comma)))
+
+(defun js2r--move-line-down-as-list-item ()
+ "Move the current line containing a list literal down one line, and also move the comma."
+ (move-line-down)
+ (if (not (js2r--previous-line-has-comma))
+ (save-excursion
+ (end-of-line)
+ (delete-char -1)
+ (forward-line -1)
+ (end-of-line)
+ (insert ","))))
+
+(defun js2r--move-line-up-as-list-item ()
+ "Move the current line containing a list literal up one line, and also move the comma."
+ (move-line-up)
+ (if (not (js2r--current-line-has-comma))
+ (save-excursion
+ (end-of-line)
+ (insert ",")
+ (forward-line)
+ (end-of-line)
+ (delete-char -1))))
+
+(provide 'js2r-conveniences)
+;;; js2r-conveniences.el ends here
diff --git a/elpa/js2-refactor-20210306.2003/js2r-conveniences.elc b/elpa/js2-refactor-20210306.2003/js2r-conveniences.elc
new file mode 100644
index 0000000..3c52a58
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-conveniences.elc
Binary files differ
diff --git a/elpa/js2-refactor-20210306.2003/js2r-formatting.el b/elpa/js2-refactor-20210306.2003/js2r-formatting.el
new file mode 100644
index 0000000..a9137c3
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-formatting.el
@@ -0,0 +1,251 @@
+;;; js2r-formatting.el --- Private helper functions for formatting -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2014 Magnar Sveen
+;; Copyright (C) 2015-2016 Magnar Sveen and Nicolas Petton
+
+;; Author: Magnar Sveen <magnars@gmail.com>,
+;; Nicolas Petton <nicolas@petton.fr>
+;; Keywords: conveniences
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Code:
+
+
+(defun js2r--ensure-newline ()
+ (if (and (not (looking-at "\s*\n"))
+ (not (looking-back "\n\s*")))
+ (newline-and-indent)))
+
+(defun js2r--ensure-just-one-space ()
+ (interactive)
+ (while (or (looking-at "\s*\n")
+ (looking-back "\n\s*"))
+ (when (looking-at "\n")
+ (delete-char 1))
+ (when (looking-back "\n\s")
+ (backward-char)
+ (delete-char -1))
+ (just-one-space))
+ (just-one-space))
+
+(defmacro js2r--create-bracketed-whitespace-traverser
+ (name ws-fix-func looking-at-start-func
+ goto-closest-start-func subexpr-str)
+ "Build a function to expand or contract a given type of
+ bracketed expression, i.e., function body, object literal, or
+ array (any of which may be nested).
+ Parameters:
+ name: name of the function to be built
+ ws-fix-func: function to adjust whitespace at point
+ looking-at-start-func: returns t if point is at
+ the start of the bracketed
+ thing we want to act on
+ goto-closest-start-func: moves point if necessary
+ until looking-at-start-func
+ is true
+ subexpr-str: literal delimiter of parts of the
+ thing to be expanded or contracted"
+ `(defun ,name ()
+ (interactive)
+ (save-excursion
+ (if (not ,looking-at-start-func)
+ ,goto-closest-start-func)
+ (let ((end (make-marker)))
+ (set-marker end (save-excursion
+ (forward-list)
+ (point)))
+ (forward-char)
+ ,ws-fix-func
+ (while (< (point) end)
+ (while (js2r--point-inside-string-p)
+ (forward-char))
+ (when (looking-at ,subexpr-str)
+ (forward-char)
+ (unless (js2-comment-node-p (js2-node-at-point))
+ ,ws-fix-func))
+ (if (looking-at "\\s(")
+ (forward-list)
+ (forward-char)))
+ (backward-char)
+ ,ws-fix-func))))
+
+(defun js2r--looking-at-object-start ()
+ (and (looking-at "{")
+ (not (looking-back ")[\s\n]*"))))
+
+(defun js2r--goto-closest-object-start ()
+ (while (not (js2r--looking-at-object-start))
+ (if (eq (car (syntax-ppss)) 0)
+ (error "Cursor is not on an object")
+ (goto-char (nth 1 (syntax-ppss))))))
+
+(js2r--create-bracketed-whitespace-traverser js2r-expand-object
+ (js2r--ensure-newline)
+ (js2r--looking-at-object-start)
+ (js2r--goto-closest-object-start)
+ ",")
+
+(js2r--create-bracketed-whitespace-traverser js2r-contract-object
+ (js2r--ensure-just-one-space)
+ (js2r--looking-at-object-start)
+ (js2r--goto-closest-object-start)
+ ",")
+
+(defun js2r--looking-at-array-start ()
+ (looking-at "\\["))
+
+(defun js2r--goto-closest-array-start ()
+ (while (not (js2r--looking-at-array-start))
+ (if (eq (car (syntax-ppss)) 0)
+ (error "Cursor is not on an array")
+ (goto-char (nth 1 (syntax-ppss))))))
+
+(js2r--create-bracketed-whitespace-traverser js2r-expand-array
+ (js2r--ensure-newline)
+ (js2r--looking-at-array-start)
+ (js2r--goto-closest-array-start)
+ ",")
+
+(js2r--create-bracketed-whitespace-traverser js2r-contract-array
+ (js2r--ensure-just-one-space)
+ (js2r--looking-at-array-start)
+ (js2r--goto-closest-array-start)
+ ",")
+
+;; (defun js2r--looking-at-function-start ()
+;; (or
+;; (and (looking-at "{")
+;; (looking-back
+;; ;; This horrible-looking regexp is actually pretty simple. It
+;; ;; matches "function <optional_name> (<optional_parameters,...>)"
+;; ;; allowing for whitespace. TODO: support Unicode in function and
+;; ;; parameter names.
+;; (concat "function[\s\n]*"
+;; "\\\([a-zA-Z_$][a-zA-Z_$0-9]*[\s\n]*\\\)?"
+;; "\(\\\([a-zA-Z_$][a-zA-Z_$0-9]*"
+;; "[\s\n]*,[\s\n]*\\\)*[\s\n]*"
+;; "\\\([a-zA-Z_$][a-zA-Z_$0-9]*[\s\n]*\\\)*"
+;; "[\s\n]*\)[\s\n]*")))
+;; ;; arrow functions
+;; (and (looking-at "{")
+;; (looking-back "=>[\s\n]*")
+;; (not (js2r--point-inside-string-p)))))
+
+(defun js2r--looking-at-function-start ()
+ "Return non-nil if the point is at the start of a function body."
+ (let* ((node (js2-node-at-point))
+ (parent (js2-node-parent node)))
+ (and (looking-at "{")
+ (js2-block-node-p node)
+ (js2-function-node-p parent))))
+
+(defun js2r--goto-closest-function-start ()
+ (while (not (js2r--looking-at-function-start))
+ (if (eq (car (syntax-ppss)) 0)
+ (error "Cursor is not on a function body")
+ (goto-char (nth 1 (syntax-ppss))))))
+
+(js2r--create-bracketed-whitespace-traverser js2r-expand-function
+ (js2r--ensure-newline)
+ (js2r--looking-at-function-start)
+ (js2r--goto-closest-function-start)
+ ";")
+
+;; TODO: It'd be great if js2r-contract-function could recognize
+;; newlines that are implied statement terminators and insert
+;; semicolons correctly, but that would probably mean not using the
+;; same macro as the other "contract" function definitions.
+(js2r--create-bracketed-whitespace-traverser js2r-contract-function
+ (js2r--ensure-just-one-space)
+ (js2r--looking-at-function-start)
+ (js2r--goto-closest-function-start)
+ ";")
+
+(defun js2r--looking-at-call-start ()
+ (looking-at "("))
+
+(defun js2r--goto-closest-call-start ()
+ (while (not (js2r--looking-at-call-start))
+ (if (eq (car (syntax-ppss)) 0)
+ (error "Cursor is not on a call")
+ (goto-char (nth 1 (syntax-ppss))))))
+
+(js2r--create-bracketed-whitespace-traverser js2r-expand-call-args
+ (js2r--ensure-newline)
+ (js2r--looking-at-call-start)
+ (js2r--goto-closest-call-start)
+ ",")
+
+(js2r--create-bracketed-whitespace-traverser js2r-contract-call-args
+ (js2r--ensure-just-one-space)
+ (js2r--looking-at-call-start)
+ (js2r--goto-closest-call-start)
+ ",")
+
+(defun js2r--expand-contract-node-at-point (&optional is-contract)
+ "Expand or contract bracketed list according to node type in point.
+Currently working on array, object, function and call args node types.
+With argument, contract closest expression, otherwise expand."
+ (let ((pos (point))
+ (array-start (point-max))
+ (object-start (point-max))
+ (function-start (point-max))
+ (call-start (point-max)))
+ (save-excursion
+ (ignore-errors
+ (js2r--goto-closest-array-start)
+ (setq array-start (- pos (point)))))
+ (save-excursion
+ (ignore-errors
+ (js2r--goto-closest-object-start)
+ (setq object-start (- pos (point)))))
+ (save-excursion
+ (ignore-errors
+ (js2r--goto-closest-function-start)
+ (setq function-start (- pos (point)))))
+ (save-excursion
+ (ignore-errors
+ (js2r--goto-closest-call-start)
+ (setq call-start (- pos (point)))))
+ (setq pos (-min (list array-start object-start function-start call-start)))
+ (when (= pos array-start)
+ (if is-contract
+ (js2r-contract-array)
+ (js2r-expand-array)))
+ (when (= pos object-start)
+ (if is-contract
+ (js2r-contract-object)
+ (js2r-expand-object)))
+ (when (= pos function-start)
+ (if is-contract
+ (js2r-contract-function)
+ (js2r-expand-function)))
+ (when (= pos call-start)
+ (if is-contract
+ (js2r-contract-call-args)
+ (js2r-expand-call-args)))))
+
+(defun js2r-expand-node-at-point ()
+ "Expand bracketed list according to node type at point."
+ (interactive)
+ (js2r--expand-contract-node-at-point))
+
+(defun js2r-contract-node-at-point ()
+ "Contract bracketed list according to node type at point."
+ (interactive)
+ (js2r--expand-contract-node-at-point t))
+
+(provide 'js2r-formatting)
+;;; js2-formatting.el ends here
diff --git a/elpa/js2-refactor-20210306.2003/js2r-formatting.elc b/elpa/js2-refactor-20210306.2003/js2r-formatting.elc
new file mode 100644
index 0000000..06c3d98
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-formatting.elc
Binary files differ
diff --git a/elpa/js2-refactor-20210306.2003/js2r-functions.el b/elpa/js2-refactor-20210306.2003/js2r-functions.el
new file mode 100644
index 0000000..31e331a
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-functions.el
@@ -0,0 +1,537 @@
+;;; js2r-functions.el --- Function manipulation functions for js2-refactor -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2014 Magnar Sveen
+;; Copyright (C) 2015-2016 Magnar Sveen and Nicolas Petton
+
+;; Author: Magnar Sveen <magnars@gmail.com>,
+;; Nicolas Petton <nicolas@petton.fr>
+;; Keywords: conveniences
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'dash)
+(require 'yasnippet)
+
+(require 'js2r-helpers)
+
+(defun js2r-localize-parameter ()
+ "Turn parameter into local var in local function."
+ (interactive)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (if (js2-name-node-p (js2-node-at-point))
+ (js2r--localize-parameter-pull)
+ (js2r--localize-parameter-push))))
+
+(defun js2r--localize-parameter-push ()
+ (let* ((node (js2-node-at-point))
+ (arg-node (or (js2r--closest-node-where 'js2r--parent-is-call-node node)
+ (error "Place cursor on argument to localize")))
+ (call-node (js2-node-parent arg-node))
+ (value (js2-node-string arg-node))
+ (target (js2-call-node-target call-node))
+ (fn (if (js2-name-node-p target)
+ (js2r--local-fn-from-name-node target)
+ (error "Can only localize parameter for local functions")))
+ (usages (js2r--function-usages fn))
+ (index (car (--keep (when (eq arg-node it) it-index)
+ (js2-call-node-args call-node))))
+ (name (js2-name-node-name (nth index (js2-function-node-params fn)))))
+ (js2r--localize-parameter fn usages index name value)))
+
+(defun js2r--localize-parameter-pull ()
+ (let* ((name-node (js2-node-at-point))
+ (name (if (js2-name-node-p name-node)
+ (js2-name-node-name name-node)
+ (error "Place cursor on parameter to localize")))
+ (fn (or (js2r--closest-node-where #'js2r--is-local-function name-node)
+ (error "Can only localize parameter in local functions")))
+ (index (or (js2r--param-index-for name fn)
+ (error "%S isn't a parameter to this function" name)))
+ (usages (js2r--function-usages fn))
+ (examples (-distinct (--map (js2r--argument index it) usages)))
+ (value (js2r--choose-one "Value: " examples)))
+ (js2r--localize-parameter fn usages index name value)))
+
+(defun js2r--localize-parameter (fn usages index name value)
+ (save-excursion
+ (js2r--goto-fn-body-beg fn)
+ (save-excursion
+ (--each usages (js2r--remove-argument-at-index index it)))
+ (newline-and-indent)
+ (insert "var " name " = " value ";")
+ (js2r--remove-parameter-at-index index fn)))
+
+(defun js2r--parent-is-call-node (node)
+ (js2-call-node-p (js2-node-parent node)))
+
+(defun js2r--local-fn-from-name-node (name-node)
+ (->> name-node
+ (js2r--local-usages-of-name-node)
+ (-map #'js2-node-parent)
+ (-first #'js2-function-node-p)))
+
+(defun js2r--param-index-for (name fn)
+ (car (--keep (when (equal name (js2-name-node-name it)) it-index)
+ (js2-function-node-params fn))))
+
+(defun js2r--argument (index call-node)
+ (js2-node-string (nth index (js2-call-node-args call-node))))
+
+(defun js2r--remove-parameter-at-index (index fn)
+ (js2r--delete-node-in-params (nth index (js2-function-node-params fn))))
+
+(defun js2r--remove-argument-at-index (index call-node)
+ (js2r--delete-node-in-params (nth index (js2-call-node-args call-node))))
+
+(defun js2r--delete-node-in-params (node)
+ (goto-char (js2-node-abs-pos node))
+ (delete-char (js2-node-len node))
+ (if (and (looking-back "(")
+ (looking-at ", "))
+ (delete-char 2)
+ (when (looking-back ", ")
+ (delete-char -2))))
+
+(defun js2r--choose-one (prompt options)
+ (when options
+ (if (cdr options)
+ (completing-read prompt options)
+ (car options))))
+
+(defun js2r-introduce-parameter ()
+ "Introduce a parameter in a local function."
+ (interactive)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (if (use-region-p)
+ (js2r--introduce-parameter-between (region-beginning) (region-end))
+ (let ((node (js2r--closest-extractable-node)))
+ (js2r--introduce-parameter-between (js2-node-abs-pos node)
+ (js2-node-abs-end node))))))
+
+(defun js2r--introduce-parameter-between (beg end)
+ (unless (js2r--single-complete-expression-between-p beg end)
+ (error "Can only introduce single, complete expressions as parameter"))
+
+ (let ((fn (js2r--closest-node-where #'js2r--is-local-function (js2-node-at-point))))
+ (unless fn
+ (error "Can only introduce parameter in local functions"))
+ (save-excursion
+ (let ((name (read-string "Parameter name: "))
+ (val (buffer-substring beg end))
+ (usages (js2r--function-usages fn)))
+ (goto-char beg)
+ (save-excursion
+ (-each usages (-partial #'js2r--add-parameter val)))
+ (delete-char (- end beg))
+ (insert name)
+ (js2r--add-parameter name fn)
+ (query-replace val name nil (js2-node-abs-pos fn) (js2r--fn-body-end fn))))))
+
+(defun js2r--function-usages (fn)
+ (-map #'js2-node-parent (js2r--function-usages-name-nodes fn)))
+
+(defun js2r--function-usages-name-nodes (fn)
+ (let ((name-node (or (js2-function-node-name fn)
+ (js2-var-init-node-target (js2-node-parent fn)))))
+ (remove name-node (js2r--local-usages-of-name-node name-node))))
+
+(defun js2r--add-parameter (name node)
+ (save-excursion
+ (js2r--goto-closing-paren node)
+ (unless (looking-back "(")
+ (insert ", "))
+ (insert name)))
+
+(defun js2r--goto-closing-paren (node)
+ (goto-char (js2-node-abs-pos node))
+ (search-forward "(")
+ (forward-char -1)
+ (forward-list)
+ (forward-char -1))
+
+(defun js2r--goto-fn-body-beg (fn)
+ (goto-char (js2-node-abs-pos fn))
+ (search-forward "{"))
+
+(defun js2r--fn-body-end (fn)
+ (save-excursion
+ (js2r--goto-fn-body-beg fn)
+ (forward-char -1)
+ (forward-list)
+ (point)))
+
+(defun js2r--is-local-function (node)
+ (or (js2r--is-var-function-expression node)
+ (js2r--is-function-declaration node)))
+
+(defun js2r--is-method (node)
+ (and (js2-function-node-p node)
+ (js2-object-prop-node-p (js2-node-parent node))))
+
+(defun js2r--is-var-function-expression (node)
+ (and (js2-function-node-p node)
+ (js2-var-init-node-p (js2-node-parent node))))
+
+(defun js2r--is-assigned-function-expression (node)
+ (and (js2-function-node-p node)
+ (js2-assign-node-p (js2-node-parent node))))
+
+(defun js2r--is-function-declaration (node)
+ (let ((parent (js2-node-parent node)))
+ (and (js2-function-node-p node)
+ (not (js2-assign-node-p parent))
+ (not (js2-var-init-node-p parent))
+ (not (js2-object-prop-node-p parent)))))
+
+(defun js2r-arguments-to-object ()
+ "Change from a list of arguments to a parameter object."
+ (interactive)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (let ((node (js2-node-at-point)))
+ (unless (and (looking-at "(")
+ (or (js2-function-node-p node)
+ (js2-call-node-p node)
+ (js2-new-node-p node)))
+ (error "Place point right before the opening paren in the call or function"))
+
+ (-when-let* ((target (js2r--node-target node))
+ (fn (and (js2-name-node-p target)
+ (js2r--local-fn-from-name-node target))))
+ (setq node fn))
+ (if (js2-function-node-p node)
+ (js2r--arguments-to-object-for-function node)
+ (js2r--arguments-to-object-for-args-with-unknown-function (js2r--node-args node))))))
+
+(defun js2r--arguments-to-object-for-function (function-node)
+ (let ((params (js2-function-node-params function-node)))
+ (when (null params)
+ (error "No params to convert"))
+ (save-excursion
+ (js2r--execute-changes
+ (-concat
+ ;; change parameter list to just (params)
+ (list
+ (list :beg (+ (js2-node-abs-pos function-node) (js2-function-node-lp function-node))
+ :end (+ (js2-node-abs-pos function-node) (js2-function-node-rp function-node) 1)
+ :contents "(params)"))
+
+ ;; add params. in front of function local param usages
+ (let* ((local-param-name-nodes (--mapcat (-> it
+ (js2-node-abs-pos)
+ (js2r--local-name-node-at-point)
+ (js2r--local-usages-of-name-node))
+ params))
+ (local-param-name-usages (--remove (js2-function-node-p (js2-node-parent it))
+ local-param-name-nodes))
+ (local-param-name-positions (-map #'js2-node-abs-pos local-param-name-usages)))
+ (--map
+ (list :beg it :end it :contents "params.")
+ local-param-name-positions))
+
+ ;; update usages of function
+ (let ((names (-map #'js2-name-node-name params))
+ (usages (js2r--function-usages function-node)))
+ (--map
+ (js2r--changes/arguments-to-object it names)
+ usages)))))))
+
+(defun js2r--changes/arguments-to-object (node names)
+ (let ((args (js2r--node-args node)))
+ (list :beg (+ (js2-node-abs-pos node) (js2r--node-lp node))
+ :end (+ (js2-node-abs-pos node) (js2r--node-rp node) 1)
+ :contents (js2r--create-object-with-arguments names args))))
+
+(defun js2r--arguments-to-object-for-args-with-unknown-function (args)
+ (when (null args)
+ (error "No arguments to convert"))
+ (let ((names (--map-indexed
+ (format "${%d:%s}"
+ (1+ it-index)
+ (if (js2-name-node-p it)
+ (js2-name-node-name it)
+ "key"))
+ args)))
+ (yas-expand-snippet (js2r--create-object-with-arguments names args)
+ (point)
+ (save-excursion (forward-list) (point)))))
+
+(defun js2r--create-object-with-arguments (names args)
+ (let (arg key result)
+ (--dotimes (length args)
+ (setq arg (nth it args))
+ (setq key (nth it names))
+ (setq result
+ (concat result
+ (format " %s: %s,\n"
+ key
+ (buffer-substring (js2-node-abs-pos arg)
+ (js2-node-abs-end arg))))))
+ (concat "({\n" (substring result 0 -2) "\n})")))
+
+(defun js2r-extract-function (name)
+ "Extract a function from the closest statement expression from the point."
+ (interactive "sName of new function: ")
+ (js2r--extract-fn
+ name
+ (lambda ()
+ (unless (js2r--looking-at-function-declaration)
+ (goto-char (js2-node-abs-pos (js2r--closest #'js2-expr-stmt-node-p)))))
+ "%s(%s);"
+ "function %s(%s) {\n%s\n}\n\n"))
+
+(defun js2r-extract-method (name)
+ "Extract a method from the closest statement expression from the point."
+ (interactive "sName of new method: ")
+ (let ((class-node (js2r--closest #'js2-class-node-p)))
+ (js2r--extract-fn
+ name
+ (unless class-node
+ (lambda ()
+ (goto-char (js2-node-abs-pos (js2r--closest #'js2-object-prop-node-p)))))
+ "this.%s(%s);"
+ (if class-node
+ "%s(%s) {\n%s\n}\n\n"
+ "%s: function (%s) {\n%s\n},\n\n"))))
+
+(defun js2r--extract-fn (name goto-position call-template function-template)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (unless (use-region-p)
+ (error "Mark the expressions to extract first"))
+ (save-excursion
+ (let* ((parent (js2r--first-common-ancestor-in-region (region-beginning) (region-end)))
+ (block (js2r--closest-node-where #'js2-block-node-p parent))
+ (fn (js2r--closest-node-where #'js2-function-node-p block))
+ (exprs (js2r--marked-expressions-in-block block))
+ (vars (-mapcat #'js2r--name-node-decendants exprs))
+ (local (--filter (js2r--local-to-fn-p fn it) vars))
+ (names (-distinct (-map 'js2-name-node-name local)))
+ (declared-in-exprs (-map #'js2r--var-init-node-target-name (-mapcat #'js2r--var-init-node-decendants exprs)))
+ (outside-exprs (-difference (js2-block-node-kids block) exprs))
+ (outside-var-uses (-map #'js2-name-node-name (-mapcat #'js2r--name-node-decendants outside-exprs)))
+ (declared-in-but-used-outside (-intersection declared-in-exprs outside-var-uses))
+ (export-var (car declared-in-but-used-outside))
+ (params (-difference names declared-in-exprs))
+ (params-string (mapconcat #'identity (reverse params) ", "))
+ (first (car exprs))
+ (last (car (last exprs)))
+ (beg (js2-node-abs-pos (car exprs)))
+ (end (js2-node-abs-end last))
+ (contents (buffer-substring beg end)))
+ (goto-char beg)
+ (delete-region beg end)
+ (when (js2-return-node-p last)
+ (insert "return "))
+ (when export-var
+ (setq contents (concat contents "\nreturn " export-var ";"))
+ (insert "var " export-var " = "))
+ (insert (format call-template name params-string))
+ (goto-char (js2-node-abs-pos fn))
+ (when goto-position (funcall goto-position))
+ (let ((start (point)))
+ (insert (format function-template name params-string contents))
+ (indent-region start (1+ (point))))))))
+
+(defun js2r--var-init-node-target-name (node)
+ (js2-name-node-name
+ (js2-var-init-node-target node)))
+
+(defun js2r--function-around-region ()
+ (or
+ (js2r--closest-node-where #'js2-function-node-p
+ (js2r--first-common-ancestor-in-region
+ (region-beginning)
+ (region-end)))
+ (error "This only works when you mark stuff inside a function")))
+
+(defun js2r--marked-expressions-in-block (fn)
+ (-select #'js2r--node-is-marked (js2-block-node-kids fn)))
+
+(defun js2r--node-is-marked (node)
+ (and
+ (<= (region-beginning) (js2-node-abs-end node))
+ (>= (region-end) (js2-node-abs-pos node))))
+
+(defun js2r--name-node-decendants (node)
+ (-select #'js2-name-node-p (js2r--decendants node)))
+
+(defun js2r--var-init-node-decendants (node)
+ (-select #'js2-var-init-node-p (js2r--decendants node)))
+
+(defun js2r--decendants (node)
+ (let (vars)
+ (js2-visit-ast node
+ (lambda (node end-p)
+ (unless end-p
+ (setq vars (cons node vars)))))
+ vars))
+
+(defun js2r--local-to-fn-p (fn name-node)
+ (let* ((name (js2-name-node-name name-node))
+ (scope (js2-node-get-enclosing-scope name-node))
+ (scope (js2-get-defining-scope scope name)))
+ (eq fn scope)))
+
+
+(defun js2r-toggle-arrow-function-and-expression ()
+ "Toggle between function expression to arrow function."
+ (interactive)
+ (save-excursion
+ (js2r--find-closest-function)
+ (cond ((js2r--arrow-function-p)
+ (js2r--transform-arrow-function-to-expression))
+ ((and (js2r--function-start-p) (not (js2r--looking-at-function-declaration)))
+ (js2r--transform-function-expression-to-arrow))
+ (t (error "Can only toggle between function expressions and arrow function")))))
+
+
+;; Toggle between function name() {} and var name = function ();
+
+(defun js2r-toggle-function-expression-and-declaration ()
+ (interactive)
+ (save-excursion
+ (js2r--find-closest-function)
+ (cond
+ ((js2r--looking-at-var-function-expression)
+ (when (js2r--arrow-function-p) (js2r--transform-arrow-function-to-expression))
+ (js2r--transform-function-expression-to-declaration))
+ ((js2r--looking-at-function-declaration)
+ (js2r--transform-function-declaration-to-expression))
+ (t (error "Can only toggle between function declarations and free standing function expressions")))))
+
+
+(defun js2r--arrow-function-p ()
+ (interactive)
+ (save-excursion
+ (ignore-errors
+ (js2r--find-closest-function)
+ (and (looking-at "(?[,[:space:][:word:]]*)?[[:space:]]*=>")
+ (not (js2r--point-inside-string-p))))))
+
+(defun js2r--transform-arrow-function-to-expression ()
+ (when (js2r--arrow-function-p)
+ (let (has-parenthesis)
+ (save-excursion
+ (js2r--find-closest-function)
+ (let ((end (make-marker)))
+ (save-excursion
+ (search-forward "=>")
+ (set-marker end (js2-node-abs-end (js2-node-at-point))))
+ (setq has-parenthesis (looking-at "\\s-*("))
+ (insert "function ")
+ (if has-parenthesis
+ (forward-list)
+ (insert "("))
+ (search-forward "=>")
+ (delete-char -2)
+ (js2r--ensure-just-one-space)
+ (unless has-parenthesis
+ (backward-char 1)
+ (insert ")"))
+ (unless (looking-at "\\s-*{")
+ (js2r--ensure-just-one-space)
+ (insert "{ return ")
+ (js2r--ensure-just-one-space)
+ (goto-char (marker-position end))
+ (insert "; }")))))))
+
+(defun js2r--transform-function-expression-to-arrow ()
+ (when (not (js2r--arrow-function-p))
+ (save-excursion
+ (js2r--find-closest-function)
+ (let ((pos (point))
+ (params
+ (js2-function-node-params (js2-node-at-point)))
+ parenthesis-start
+ parenthesis-end)
+ (when (js2r--looking-at-function-declaration)
+ (error "Can not convert function declarations to arrow function"))
+ (search-forward "(")
+ (backward-char 1)
+ (delete-region pos (point))
+ (setq parenthesis-start (point))
+ (forward-list)
+ (setq parenthesis-end (point))
+ (insert " => ")
+ (js2r--ensure-just-one-space)
+ (when (and (= 1 (length params))
+ (not js2r-always-insert-parens-around-arrow-function-params))
+ (goto-char parenthesis-end)
+ (backward-delete-char 1)
+ (goto-char parenthesis-start)
+ (delete-char 1))))))
+
+
+(defun js2r--function-start-p()
+ (let* ((fn (js2r--closest #'js2-function-node-p)))
+ (and fn
+ (= (js2-node-abs-pos fn) (point)))))
+
+(defun js2r--find-closest-function ()
+ (when (not (js2r--function-start-p))
+ (let* ((fn (js2r--closest #'js2-function-node-p)))
+ (goto-char (js2-node-abs-pos fn)))))
+
+(defun js2r--looking-at-method ()
+ (and (js2r--function-start-p)
+ (looking-back ": ?")))
+
+(defun js2r--looking-at-function-declaration ()
+ (and (js2r--function-start-p)
+ (looking-back "^ *")))
+
+(defun js2r--looking-at-var-function-expression ()
+ (and (js2r--function-start-p)
+ (looking-back "^ *var[\s\n]*[a-z_$]+[\s\n]*=[\s\n]*")))
+
+(defun js2r--transform-function-expression-to-declaration ()
+ (when (js2r--looking-at-var-function-expression)
+ (delete-char 9)
+ (forward-list)
+ (forward-list)
+ (delete-char 1)
+ (backward-list)
+ (backward-list)
+ (delete-backward-char 3)
+ (back-to-indentation)
+ (delete-char 4)
+ (insert "function ")))
+
+(defun js2r--transform-function-declaration-to-expression ()
+ (when (js2r--looking-at-function-declaration)
+ (delete-char 9)
+ (insert "var ")
+ (search-forward "(")
+ (backward-char 1)
+ (insert " = function ")
+ (forward-list)
+ (forward-list)
+ (insert ";")))
+
+(defun js2r-toggle-function-async ()
+ "Toggle the innermost function from sync to async."
+ (interactive)
+ (save-excursion
+ (js2r--find-closest-function)
+ (if (looking-back "async[[:space:]\n]+")
+ (delete-region (match-beginning 0) (match-end 0))
+ (insert "async "))))
+
+(provide 'js2r-functions)
+;;; js2-functions.el ends here
diff --git a/elpa/js2-refactor-20210306.2003/js2r-functions.elc b/elpa/js2-refactor-20210306.2003/js2r-functions.elc
new file mode 100644
index 0000000..5671c23
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-functions.elc
Binary files differ
diff --git a/elpa/js2-refactor-20210306.2003/js2r-helpers.el b/elpa/js2-refactor-20210306.2003/js2r-helpers.el
new file mode 100644
index 0000000..8f600fe
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-helpers.el
@@ -0,0 +1,221 @@
+;;; js2r-helpers.el --- Private helper functions for js2-refactor -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2014 Magnar Sveen
+;; Copyright (C) 2015-2016 Magnar Sveen and Nicolas Petton
+
+;; Author: Magnar Sveen <magnars@gmail.com>,
+;; Nicolas Petton <nicolas@petton.fr>
+;; Keywords: conveniences
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'dash)
+(require 's)
+(require 'js2-mode)
+
+(defmacro js2r--wait-for-parse (&rest body)
+ "Evaluate BODY once the current buffer has been parsed."
+ (declare (debug def-body))
+ `(js2-mode-wait-for-parse (lambda () ,@body)))
+
+(defun js2r--wrap-text (&rest text)
+ "Wrap TEXT with the prefered quotes. The prefered quotes is set with `js2r-prefered-quote-type'."
+ (let ((prefered-quotes "\""))
+ (when (= 2 js2r-prefered-quote-type)
+ (setq prefered-quotes "'"))
+ (concat prefered-quotes (apply 'concat text) prefered-quotes)))
+
+(defun js2r--fix-special-modifier-combinations (key)
+ (case key
+ ("C-s-i" "s-TAB")
+ ("C-s-m" "s-RET")
+ (otherwise key)))
+
+(defun js2r--key-pairs-with-modifier (modifier keys)
+ (->> (string-to-list keys)
+ (--map (js2r--fix-special-modifier-combinations
+ (concat modifier (char-to-string it))))
+ (s-join " ")
+ (read-kbd-macro)))
+
+(defun js2r--key-pairs-with-prefix (prefix keys)
+ (read-kbd-macro (concat prefix " " keys)))
+
+(defun js2r--guard ()
+ (when js2-parsed-errors
+ (error "Can't refactor while buffer has parse errors")))
+
+(defun js2r--current-quotes-char ()
+ "The char that is the current quote delimiter"
+ (nth 3 (syntax-ppss)))
+
+(defalias 'js2r--point-inside-string-p 'js2r--current-quotes-char)
+
+(defun js2r--closest-node-where (p node)
+ (if (or (null node)
+ (apply p node nil))
+ node
+ (js2r--closest-node-where p (js2-node-parent node))))
+
+(defun js2r--closest (p)
+ (save-excursion
+ (cond
+ ((bolp) (back-to-indentation))
+ ((looking-at ";") (forward-char -1))
+ ((looking-back ";") (forward-char -2))
+ ((looking-back "}") (forward-char -1)))
+ (js2r--closest-node-where p (js2-node-at-point))))
+
+(defun js2r--goto-and-delete-node (node)
+ (goto-char (js2-node-abs-pos node))
+ (delete-char (js2-node-len node)))
+
+
+(defun js2r--path-to-root (node)
+ (when node
+ (cons node (js2r--path-to-root (js2-node-parent node)))))
+
+(defun js2r--first-common-ancestor (node1 node2)
+ (if (eq node1 node2)
+ node1
+ (let ((path1 (reverse (js2r--path-to-root node1)))
+ (path2 (reverse (js2r--path-to-root node2)))
+ (last-common nil))
+ (while (eq (car path1) (car path2))
+ (setq last-common (car path1))
+ (setq path1 (cdr path1))
+ (setq path2 (cdr path2)))
+ last-common)))
+
+(defun js2r--first-common-ancestor-in-region (beg end)
+ (js2r--first-common-ancestor (js2-node-at-point beg)
+ (js2-node-at-point end)))
+
+;; abstract away node type on some common property getters
+(defun js2r--node-target (node)
+ (cond
+ ((js2-call-node-p node) (js2-call-node-target node))
+ ((js2-new-node-p node) (js2-new-node-target node))
+ (:else nil)))
+
+(defun js2r--node-args (node)
+ (cond
+ ((js2-call-node-p node) (js2-call-node-args node))
+ ((js2-new-node-p node) (js2-new-node-args node))
+ (:else nil)))
+
+(defun js2r--node-lp (node)
+ (cond
+ ((js2-call-node-p node) (js2-call-node-lp node))
+ ((js2-new-node-p node) (js2-new-node-lp node))
+ (:else nil)))
+
+(defun js2r--node-rp (node)
+ (cond
+ ((js2-call-node-p node) (js2-call-node-rp node))
+ ((js2-new-node-p node) (js2-new-node-rp node))
+ (:else nil)))
+
+(defun js2r--node-kids (node)
+ (cond
+ ((js2-function-node-p node) (js2-block-node-kids (js2-function-node-body node)))
+ ((js2-if-node-p node) (js2-scope-kids (js2-if-node-then-part node)))
+ ((js2-for-node-p node) (js2-block-node-kids (js2-for-node-body node)))
+ ((js2-while-node-p node) (js2-block-node-kids (js2-while-node-body node)))))
+
+;; finding expressions and arguments
+
+(defun js2r--closest-extractable-node ()
+ "Return the most appropriate node the be extracted into a variable or paramter.
+Lookup the closest expression node from the point, or the closest literal node instead.
+If no node is found, signal an error."
+ (or (or (js2r--closest #'js2r--expression-p)
+ (js2r--closest #'js2r--literal-node-p))
+ (error "Cannot perform refactoring: Nothing to extract at point")))
+
+(defun js2r--closest-stmt-node ()
+ "Return the closest standalone statement node.
+Special care is taken for if branch nodes: if a statement node is
+part of an if branch node (like 'else if' nodes), return the
+parent node."
+ (let* ((node (js2-node-parent-stmt (js2-node-at-point)))
+ (parent (js2-node-parent node)))
+ (if (and (js2-if-node-p node)
+ (js2-if-node-p parent))
+ parent
+ node)))
+
+(defun js2r--argument-p (node)
+ (let ((parent (js2-node-parent node)))
+ (and (js2-call-node-p parent)
+ (member node (js2-call-node-args parent)))))
+
+(defun js2r--expression-p (node)
+ (or (js2-call-node-p node)
+ (js2r--argument-p node)
+ (and (js2-prop-get-node-p node)
+ (not (js2-call-node-p (js2-node-parent node))))))
+
+(defun js2r--literal-node-p (node)
+ (or (js2-object-node-p node)
+ (js2-string-node-p node)
+ (js2-number-node-p node)
+ (js2r--boolean-node-p node)))
+
+(defun js2r--boolean-node-p (node)
+ (let* ((beg (js2-node-abs-pos node))
+ (end (js2-node-abs-end node))
+ (content (buffer-substring beg end)))
+ (and (js2-keyword-node-p node)
+ (member content '("true" "false")))))
+
+(defun js2r--single-complete-expression-between-p (beg end)
+ (let ((ancestor (js2r--first-common-ancestor-in-region beg (- end 1))))
+ (and (= beg (js2-node-abs-pos ancestor))
+ (= end (js2-node-abs-end ancestor)))))
+
+
+;; executing a list of changes
+;; ensures changes are executed from last to first
+
+(defun js2r--by-end-descending (change1 change2)
+ (> (plist-get change1 :end)
+ (plist-get change2 :end)))
+
+(defun js2r--any-overlapping-changes (sorted-changes)
+ (--any?
+ (let ((one (car it))
+ (two (cadr it)))
+ (< (plist-get one :beg)
+ (plist-get two :end)))
+ (-partition-in-steps 2 1 sorted-changes)))
+
+(defun js2r--execute-changes (changes)
+ (when changes
+ (let ((sorted-changes (sort changes 'js2r--by-end-descending)))
+ (when (js2r--any-overlapping-changes sorted-changes)
+ (error "These changes overlap, cannot execute properly."))
+ (let ((abs-end (set-marker (make-marker) (1+ (plist-get (car sorted-changes) :end))))
+ (abs-beg (plist-get (car (last sorted-changes)) :beg)))
+ (--each sorted-changes
+ (goto-char (plist-get it :beg))
+ (delete-char (- (plist-get it :end) (plist-get it :beg)))
+ (insert (plist-get it :contents)))
+ (indent-region abs-beg abs-end)
+ (set-marker abs-end nil)))))
+
+(provide 'js2r-helpers)
+;;; js2-helpers.el ends here
diff --git a/elpa/js2-refactor-20210306.2003/js2r-helpers.elc b/elpa/js2-refactor-20210306.2003/js2r-helpers.elc
new file mode 100644
index 0000000..abb18d8
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-helpers.elc
Binary files differ
diff --git a/elpa/js2-refactor-20210306.2003/js2r-iife.el b/elpa/js2-refactor-20210306.2003/js2r-iife.el
new file mode 100644
index 0000000..40e123a
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-iife.el
@@ -0,0 +1,174 @@
+;;; js2r-iife.el --- IIFE wrapping functions for js2-refactor -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2014 Magnar Sveen
+;; Copyright (C) 2015-2016 Magnar Sveen and Nicolas Petton
+
+;; Author: Magnar Sveen <magnars@gmail.com>,
+;; Nicolas Petton <nicolas@petton.fr>
+;; Keywords: conveniences
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'js2r-helpers)
+(require 'cl-lib)
+
+(defconst js2r--iife-regexp "[[:space:]]*(\\(?:function ([^)]*)\\|([^)]*) => {\\)")
+(defconst js2r--use-strict-regexp "[[:space:]]*\\(['\"]\\)use strict\\1")
+
+(defun js2r-looking-at-iife-p ()
+ "Check if `point' is `looking-at' an IIFE."
+ (looking-at-p js2r--iife-regexp))
+
+(defun js2r-wrap-in-iife (beg end)
+ "Wrap the current region in an iife.
+BEG and END are the start and end of the region, respectively."
+ (interactive "r")
+ (cl-assert (memq js2r-iife-style '(function-inner function lambda))
+ nil "`js2r-iife-style' invalid")
+ (let ((end-marker (copy-marker end t))
+ (strict js2r-use-strict))
+ (save-excursion
+ (goto-char beg)
+ (when (js2r-looking-at-iife-p)
+ (user-error "Region is already an immediately invoked function expression"))
+ (when (looking-at-p js2r--use-strict-regexp)
+ (setq strict nil))
+ (insert "(" (pcase js2r-iife-style
+ ((or `function `function-inner) "function ()")
+ (`lambda "() =>"))
+ " {\n")
+ (when strict (insert (pcase js2r-prefered-quote-type
+ (1 "\"use strict\"")
+ (2 "'use strict'"))
+ ";\n"))
+ (goto-char end-marker)
+ (unless (eq (char-before) ?\n)
+ (insert "\n"))
+ (insert "}" (pcase js2r-iife-style
+ ((or `function `lambda) ")()")
+ (`function-inner "())"))
+ ";\n")
+ (indent-region beg (point)))
+ (back-to-indentation)
+ (set-marker end-marker nil)))
+
+(defun js2r-wrap-buffer-in-iife ()
+ "Wrap the entire buffer in an immediately invoked function expression"
+ (interactive)
+ (let ((eob-nl? (eq (char-before (point-max)) ?\n)))
+ (js2r-wrap-in-iife (point-min) (point-max))
+ (unless eob-nl?
+ (save-excursion
+ (goto-char (point-max))
+ ;; `backward-delete-char' is advised in DOOM
+ (delete-char -1)))))
+
+(defun js2r--selected-name-positions ()
+ "Returns the (beginning . end) of the name at cursor, or active region."
+ (let ((current-node (js2-node-at-point))
+ beg end)
+ (unless (js2-name-node-p current-node)
+ (setq current-node (js2-node-at-point (- (point) 1))))
+ (if (not (and current-node (js2-name-node-p current-node)))
+ (error "Point is not on an identifier."))
+ (if (use-region-p)
+ (cons (region-beginning) (region-end))
+ (progn
+ (setq end (+ (js2-node-abs-pos current-node)
+ (js2-node-len current-node)))
+ (skip-syntax-backward ".w_")
+ (cons (point) end)))))
+
+(defun js2r--read-iife-short-name (name)
+ "Read an iife short name for NAME.
+See `js2r-add-global-to-iife'."
+ (read-string "Short name (%s): " (substring name 0 1) nil name))
+
+(defun js2r-add-global-to-iife (global short)
+ "Add GLOBAL under the name SHORT to the current IIFE."
+ (interactive
+ (let ((global (read-string "Global: " (thing-at-point 'symbol))))
+ (list global (js2r--read-iife-short-name global))))
+ (save-excursion
+ (save-match-data
+ (atomic-change-group
+ (let* (beg end)
+ (unless (search-backward-regexp js2r--iife-regexp)
+ (error "No immediately invoked function expression found"))
+ (goto-char (match-end 0))
+ (save-excursion
+ (search-backward ")")
+ (unless (= (char-before) ?\()
+ (insert ", "))
+ (insert short))
+ (setq beg (point))
+ (backward-char)
+ (forward-list)
+ (setq end (point))
+ (unless (search-forward "(" (+ 3 (point)) t)
+ (user-error "IIFE not called"))
+ (forward-char -1)
+ (forward-list)
+ (forward-char -1)
+ (unless (eq (char-before) ?\()
+ (insert ", "))
+ (insert global)
+ (goto-char beg)
+ (while (search-forward-regexp (format "\\_<%s\\_>" global) end t)
+ (replace-match short t t)))))))
+
+(defun js2r-inject-global-in-iife ()
+ "Create shortcut for marked global by injecting it in the wrapping IIFE"
+ (interactive)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (cl-destructuring-bind (beg . end) (js2r--selected-name-positions)
+ (deactivate-mark)
+ (let ((name (buffer-substring beg end)))
+ (js2r-add-global-to-iife name (js2r--read-iife-short-name name))))))
+
+(defun js2r-unwrap-iife ()
+ "Unwrap the IIFE at `point'."
+ (interactive)
+ (save-match-data
+ (unless (looking-at js2r--iife-regexp)
+ (user-error "`point' is not on an IIFE"))
+ (let ((body (save-excursion
+ (goto-char (match-end 0))
+ (forward-char -1)
+ (let ((start (1+ (point))))
+ (forward-list)
+ (forward-char -1)
+ (buffer-substring-no-properties start (point))))))
+ (let ((start (point)))
+ (forward-list)
+ (delete-region start (point))
+
+ (when (looking-at "\\(([^)]*)\\)?;$?")
+ (delete-region (match-beginning 0) (match-end 0)))
+
+ (insert (string-trim body))
+ (indent-region start (point))
+ (back-to-indentation)))))
+
+(defun js2r-unwrap-iife-in-buffer ()
+ "Unwrap the first IIFE in the current buffer.
+See `js2r-wrap-buffer-in-iife'."
+ (search-forward-regexp js2r--iife-regexp)
+ (js2r-unwrap-iife))
+
+(provide 'js2r-iife)
+;;; js2-iife.el ends here
diff --git a/elpa/js2-refactor-20210306.2003/js2r-iife.elc b/elpa/js2-refactor-20210306.2003/js2r-iife.elc
new file mode 100644
index 0000000..34e73eb
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-iife.elc
Binary files differ
diff --git a/elpa/js2-refactor-20210306.2003/js2r-paredit.el b/elpa/js2-refactor-20210306.2003/js2r-paredit.el
new file mode 100644
index 0000000..3907558
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-paredit.el
@@ -0,0 +1,227 @@
+;;; js2r-paredit.el --- Paredit-like extensions for js2-refactor -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2014 Magnar Sveen
+;; Copyright (C) 2015-2016 Magnar Sveen and Nicolas Petton
+
+;; Author: Magnar Sveen <magnars@gmail.com>,
+;; Nicolas Petton <nicolas@petton.fr>
+;; Keywords: conveniences
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'dash)
+
+(require 'js2r-helpers)
+
+(defun js2r--nesting-node-p (node)
+ (or (js2-function-node-p node)
+ (js2-if-node-p node)
+ (js2-for-node-p node)
+ (js2-while-node-p node)))
+
+(defun js2r--standalone-node-p (node)
+ (or (js2-stmt-node-p node)
+ (and (js2-function-node-p node)
+ (eq 'FUNCTION_STATEMENT (js2-function-node-form node)))))
+
+(defun js2r-kill ()
+ "Kill a line like `kill-line' but tries to respect node boundaries.
+Falls back to `kill-line' if the buffer has parse errors.
+
+if(|foo) {bar();} -> if() {bar();}
+
+function foo() {|2 + 3} -> function foo() {}
+
+// some |comment -> // some
+
+'this is a| string' -> 'this is a'
+"
+ (interactive)
+ (if js2-parsed-errors
+ (progn
+ (message "Buffer has parse errors. Killing the line")
+ (kill-line))
+ (condition-case error
+ (js2r--kill-line)
+ (progn
+ (message "Error occured while trying to kill AST node. Killing the line.")
+ (kill-line)))))
+
+(defun js2r--kill-line ()
+ "Kill a line, but respecting node boundaries."
+ (let ((node (js2r--next-node)))
+ (cond
+ ((js2-comment-node-p node) (kill-line))
+ ((js2-string-node-p node) (js2r--kill-line-in-string))
+ (t (js2r--kill-line-in-sexp)))))
+
+(defun js2r--next-node ()
+ "Return the node at point, or the node after the point if the
+ point is at the exact end of a node."
+ (save-excursion
+ (when (= (js2-node-abs-end (js2-node-at-point))
+ (point))
+ (forward-char 1))
+ (js2-node-at-point)))
+
+(defun js2r--kill-line-in-sexp ()
+ "Kill a line, but only kills until the closest outer sexp on
+ the current line, delimited with \")}]\". If no sexp is found
+ on the current line, falls back to
+ `js2r--kill-line-with-inner-sexp'."
+ (condition-case error
+ (let* ((beg (point))
+ (end (save-excursion
+ (up-list)
+ (forward-char -1)
+ (point))))
+ (if (js2-same-line end)
+ (kill-region beg end)
+ (js2r--kill-line-with-inner-sexp)))
+ (scan-error
+ (js2r--kill-line-with-inner-sexp))))
+
+(defun js2r--kill-line-with-inner-sexp ()
+ "Kill a line, but respecting inner killed sexps, ensuring that
+we kill up to the end to the next inner sexp if it starts in
+the current line.
+
+If the parentheses are unbalanced, fallback to `kill-line' and
+warn the user."
+ (condition-case error
+ (let* ((beg (point))
+ (end (save-excursion
+ (forward-visible-line 1)
+ (point)))
+ (beg-of-sexp (save-excursion
+ (js2r--goto-last-sexp-on-line)
+ (point)))
+ (end-of-sexp (save-excursion
+ (goto-char beg-of-sexp)
+ (forward-list)
+ ;; Kill all remaining semi-colons as well
+ (while (looking-at ";")
+ (forward-char))
+ (point))))
+ (if (js2-same-line beg-of-sexp)
+ (kill-region beg (max end end-of-sexp))
+ (kill-line)))
+ (scan-error
+ (message "Unbalanced parentheses. Killing the line.")
+ (kill-line))))
+
+(defun js2r--goto-last-sexp-on-line ()
+ "Move the cursor to the opening of the last sexp on the current
+line, or to the end of the line if no sexp is found."
+ (let ((pos (point)))
+ (down-list)
+ (backward-char 1)
+ (forward-list)
+ (if (js2-same-line pos)
+ (js2r--goto-last-sexp-on-line)
+ (backward-list))))
+
+(defun js2r--kill-line-in-string ()
+ "Kill a line in a string node, respecting the node boundaries.
+When at the beginning of the node, kill from outside of it."
+ (let* ((node (js2-node-at-point))
+ (beg (point))
+ (node-start (js2-node-abs-pos node))
+ (node-end (js2-node-abs-end node)))
+ (if (= beg node-start)
+ (js2r--kill-line-in-sexp)
+ (kill-region beg (1- node-end)))))
+
+(defun js2r-forward-slurp (&optional arg)
+ "Add the expression following the current function into it.
+
+The addition is performed by moving the closing brace of the
+function down.
+
+When called with a prefix argument ARG, slurp ARG expressions
+following the current function."
+ (interactive "p")
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (let* ((nesting (js2r--closest 'js2r--nesting-node-p))
+ (standalone (if (js2r--standalone-node-p nesting)
+ nesting
+ (js2-node-parent-stmt nesting)))
+ (next-sibling (js2-node-next-sibling standalone))
+ (beg (js2-node-abs-pos next-sibling))
+ (last-sibling (if (wholenump arg)
+ (let ((num arg)
+ (iter-sibling next-sibling))
+ (while (> num 1) ;; Do next-sibling arg nbr of times
+ (setq iter-sibling (js2-node-next-sibling iter-sibling))
+ (setq num (1- num)))
+ iter-sibling)
+ next-sibling)) ;; No optional arg. Just use next-sibling
+ (end (js2-node-abs-end last-sibling))
+ (text (buffer-substring beg end)))
+ (save-excursion
+ (delete-region beg end)
+ ;; Delete newline character if the deleted AST node was at the end of the line
+ (goto-char beg)
+ (when (and (eolp)
+ (not (eobp)))
+ (delete-char 1))
+ (goto-char (js2-node-abs-end nesting))
+ (forward-char -1)
+ (when (looking-back "{ *")
+ (newline))
+ (setq beg (point))
+ (insert text)
+ (when (looking-at " *}")
+ (newline))
+ (setq end (point))
+ (indent-region beg end)))))
+
+(defun js2r-forward-barf (&optional arg)
+ (interactive "p")
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (let* ((nesting (js2r--closest 'js2r--nesting-node-p))
+ (standalone (if (js2r--standalone-node-p nesting)
+ nesting
+ (js2-node-parent-stmt nesting)))
+ (standalone-end (js2-node-abs-end standalone))
+ (last-child (car (last (if (js2-if-node-p nesting)
+ (js2-scope-kids (js2r--closest 'js2-scope-p))
+ (js2r--node-kids nesting)))))
+ (first-barf-child (if (wholenump arg)
+ (let ((num arg)
+ (iter-child last-child))
+ (while (> num 1) ;; Do prev-sibling arg nbr of times
+ (setq iter-child (js2-node-prev-sibling iter-child))
+ (setq num (1- num)))
+ iter-child)
+ last-child)) ; No optional arg. Just use last-child
+ (last-child-beg (save-excursion
+ (goto-char (js2-node-abs-pos first-barf-child))
+ (skip-syntax-backward " ")
+ (while (looking-back "\n") (backward-char))
+ (point)))
+ (last-child-end (js2-node-abs-end last-child))
+ (text (buffer-substring last-child-beg last-child-end)))
+ (save-excursion
+ (js2r--execute-changes
+ (list
+ (list :beg last-child-beg :end last-child-end :contents "")
+ (list :beg standalone-end :end standalone-end :contents text)))))))
+
+(provide 'js2r-paredit)
+;;; js2r-paredit.el ends here
diff --git a/elpa/js2-refactor-20210306.2003/js2r-paredit.elc b/elpa/js2-refactor-20210306.2003/js2r-paredit.elc
new file mode 100644
index 0000000..274f36a
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-paredit.elc
Binary files differ
diff --git a/elpa/js2-refactor-20210306.2003/js2r-vars.el b/elpa/js2-refactor-20210306.2003/js2r-vars.el
new file mode 100644
index 0000000..fc27eae
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-vars.el
@@ -0,0 +1,376 @@
+;;; js2r-vars.el --- Variable declaration manipulation functions for js2-refactor -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2014 Magnar Sveen
+;; Copyright (C) 2015-2016 Magnar Sveen and Nicolas Petton
+
+;; Author: Magnar Sveen <magnars@gmail.com>,
+;; Nicolas Petton <nicolas@petton.fr>
+;; Keywords: conveniences
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'multiple-cursors-core)
+(require 'dash)
+
+(require 'js2r-helpers)
+
+;; Helpers
+
+(defun js2r--name-node-at-point (&optional pos)
+ (setq pos (or pos (point)))
+ (let ((current-node (js2-node-at-point pos)))
+ (unless (js2-name-node-p current-node)
+ (setq current-node (js2-node-at-point (- (point) 1))))
+ (if (not (and current-node (js2-name-node-p current-node)))
+ (error "Point is not on an identifier.")
+ current-node)))
+
+(defun js2r--local-name-node-at-point (&optional pos)
+ (setq pos (or pos (point)))
+ (let ((current-node (js2r--name-node-at-point pos)))
+ (unless (js2r--local-name-node-p current-node)
+ (error "Point is not on a local identifier"))
+ current-node))
+
+(defun js2r--local-name-node-p (node)
+ (let ((parent (js2-node-parent node)))
+ (and parent (js2-name-node-p node)
+ ;; is not foo in { foo: 1 }
+ (not (and (js2-object-prop-node-p parent)
+ (eq node (js2-object-prop-node-left parent))
+ ;; could be { foo } though, in which case the node
+ ;; is parent's both left and right.
+ (not (eq node (js2-object-prop-node-right parent)))))
+ ;; is not foo in x.foo
+ (not (and (js2-prop-get-node-p parent)
+ (eq node (js2-prop-get-node-right parent))))
+ ;; is not foo in import { foo as bar } from ...
+ ;; could be bar, though.
+ (not (and (js2-export-binding-node-p parent)
+ (eq node (js2-export-binding-node-extern-name parent))
+ (not (eq node (js2-export-binding-node-local-name parent))))))))
+
+(defun js2r--name-node-defining-scope (name-node)
+ (unless (js2r--local-name-node-p name-node)
+ (error "Node is not on a local identifier"))
+ (js2-get-defining-scope
+ (js2-node-get-enclosing-scope name-node)
+ (js2-name-node-name name-node)))
+
+(defun js2r--local-usages-of-name-node (name-node)
+ (unless (js2r--local-name-node-p name-node)
+ (error "Node is not on a local identifier"))
+ (let* ((name (js2-name-node-name name-node))
+ (scope (js2r--name-node-defining-scope name-node))
+ (result nil))
+ (js2-visit-ast
+ scope
+ (lambda (node end-p)
+ (when (and (not end-p)
+ (js2r--local-name-node-p node)
+ (string= name (js2-name-node-name node))
+ (eq scope (js2r--name-node-defining-scope node)))
+ (add-to-list 'result node))
+ t))
+ result))
+
+(defun js2r--local-var-positions (name-node)
+ (-map 'js2-node-abs-pos (js2r--local-usages-of-name-node name-node)))
+
+(defun js2r--var-defining-node (var-node)
+ (unless (js2r--local-name-node-p var-node)
+ (error "Node is not on a local identifier"))
+ (let* ((name (js2-name-node-name var-node))
+ (scope (js2r--name-node-defining-scope var-node)))
+ (js2-symbol-ast-node
+ (js2-scope-get-symbol scope name))))
+
+
+;; Add to jslint globals annotation
+
+(defun current-line-contents ()
+ "Find the contents of the current line, minus indentation."
+ (buffer-substring (save-excursion (back-to-indentation) (point))
+ (save-excursion (end-of-line) (point))))
+
+(require 'thingatpt)
+
+(defun js2r-add-to-globals-annotation ()
+ (interactive)
+ (let ((var (thing-at-point 'symbol)))
+ (save-excursion
+ (beginning-of-buffer)
+ (when (not (string-match "^/\\* *global " (current-line-contents)))
+ (newline)
+ (forward-line -1)
+ (insert "/* global */")
+ (newline)
+ (forward-line -1))
+ (while (not (string-match "*/" (current-line-contents)))
+ (forward-line))
+ (end-of-line)
+ (delete-char -2)
+ (unless (looking-back "global ")
+ (while (looking-back " ")
+ (delete-char -1))
+ (insert ", "))
+ (insert (concat var " */")))))
+
+
+;; Rename variable
+
+;;;###autoload
+(defun js2r-rename-var ()
+ "Renames the variable on point and all occurrences in its lexical scope."
+ (interactive)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (let* ((current-node (js2r--local-name-node-at-point))
+ (len (js2-node-len current-node))
+ (current-start (js2-node-abs-pos current-node))
+ (current-end (+ current-start len))
+ (delta (- (point) current-start)))
+ (save-excursion
+ (mapc (lambda (beg)
+ (when (not (= beg current-start))
+ (goto-char (+ beg delta))
+ (set-mark (+ beg len))
+ (mc/create-fake-cursor-at-point)))
+ (js2r--local-var-positions current-node)))
+ (push-mark current-end)
+ (activate-mark))
+ (mc/maybe-multiple-cursors-mode)))
+
+(add-to-list 'mc--default-cmds-to-run-once 'js2r-rename-var)
+
+;; Change local variable to use this. instead
+
+(defun js2r-var-to-this ()
+ "Changes the variable on point to use this.var instead."
+ (interactive)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (save-excursion
+ (let ((node (js2-node-at-point)))
+ (when (js2-var-decl-node-p node)
+ (let ((kids (js2-var-decl-node-kids node)))
+ (when (cdr kids)
+ (error "Currently does not support converting multivar statements."))
+ (goto-char (js2-node-abs-pos (car kids))))))
+ (--each (js2r--local-var-positions (js2r--local-name-node-at-point))
+ (goto-char it)
+ (cond ((looking-back "var ") (delete-char -4))
+ ((looking-back "let ") (delete-char -4))
+ ((looking-back "const ") (delete-char -6)))
+ (insert "this.")))))
+
+;; Inline var
+
+(defun js2r-inline-var ()
+ (interactive)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (save-excursion
+ (let* ((current-node (js2r--local-name-node-at-point))
+ (definer (js2r--var-defining-node current-node))
+ (definer-start (js2-node-abs-pos definer))
+ (var-init (js2-node-parent definer))
+ (initializer (js2-var-init-node-initializer
+ var-init)))
+ (unless initializer
+ (error "Var is not initialized when defined."))
+ (let* ((var-len (js2-node-len current-node))
+ (init-beg (js2-node-abs-pos initializer))
+ (init-end (+ init-beg (js2-node-len initializer)))
+ (var-init-beg (copy-marker (js2-node-abs-pos var-init)))
+ (var-init-end (copy-marker (+ var-init-beg (js2-node-len var-init))))
+ (contents (buffer-substring init-beg init-end)))
+ (mapc (lambda (beg)
+ (when (not (= beg definer-start))
+ (goto-char beg)
+ (delete-char var-len)
+ (insert contents)))
+ (js2r--local-var-positions current-node))
+ (js2r--delete-var-init var-init-beg var-init-end))))))
+
+
+(defun js2r--was-single-var ()
+ (save-excursion
+ (goto-char (point-at-bol))
+ (or (looking-at "^[[:space:]]*\\(var\\|const\\|let\\)[[:space:]]?;?$")
+ (looking-at "^[[:space:]]*,[[:space:]]*$"))))
+
+(defun js2r--was-starting-var ()
+ (or (looking-back "var ")
+ (looking-back "const ")
+ (looking-back "let ")))
+
+(defun js2r--was-ending-var ()
+ (looking-at ";"))
+
+(defun js2r--delete-var-init (beg end)
+ (goto-char beg)
+ (delete-char (- end beg))
+ (cond
+ ((js2r--was-single-var)
+ (delete-region (point-at-bol) (point-at-eol))
+ (delete-blank-lines))
+
+ ((js2r--was-starting-var)
+ (delete-char 1)
+ (if (looking-at " ")
+ (delete-char 1)
+ (join-line -1)))
+
+ ((js2r--was-ending-var)
+ (if (looking-back ", ")
+ (delete-char -1)
+ (join-line)
+ (delete-char 1))
+ (delete-char -1))
+
+ (t (delete-char 2))))
+
+;; two cases
+;; - it's the only var -> remove the line
+;; - there are several vars -> remove the node then clean up commas
+
+
+;; Extract variable
+
+(defun js2r--start-of-parent-stmt ()
+ (js2-node-abs-pos (js2r--closest-stmt-node)))
+
+(defun js2r--object-literal-key-behind (pos)
+ (save-excursion
+ (goto-char pos)
+ (when (looking-back "\\sw: ?")
+ (backward-char 2)
+ (js2-name-node-name (js2r--name-node-at-point)))))
+
+(defun js2r--line-above-is-blank ()
+ (save-excursion
+ (forward-line -1)
+ (string= "" (current-line-contents))))
+
+;;;###autoload
+(defun js2r-extract-var ()
+ (interactive)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (let ((keyword (if js2r-prefer-let-over-var "let" "var")))
+ (if (use-region-p)
+ (js2r--extract-var-between (region-beginning) (region-end) keyword)
+ (let ((node (js2r--closest-extractable-node)))
+ (js2r--extract-var-between (js2-node-abs-pos node)
+ (js2-node-abs-end node) keyword))))))
+
+;;;###autoload
+(defun js2r-extract-let ()
+ (interactive)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (if (use-region-p)
+ (js2r--extract-var-between (region-beginning) (region-end) "let")
+ (let ((node (js2r--closest-extractable-node)))
+ (js2r--extract-var-between (js2-node-abs-pos node)
+ (js2-node-abs-end node) "let")))))
+
+;;;###autoload
+(defun js2r-extract-const ()
+ (interactive)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (if (use-region-p)
+ (js2r--extract-var-between (region-beginning) (region-end) "const")
+ (let ((node (js2r--closest-extractable-node)))
+ (js2r--extract-var-between (js2-node-abs-pos node)
+ (js2-node-abs-end node) "const")))))
+
+(add-to-list 'mc--default-cmds-to-run-once 'js2r-extract-var)
+(add-to-list 'mc--default-cmds-to-run-once 'js2r-extract-let)
+(add-to-list 'mc--default-cmds-to-run-once 'js2r-extract-const)
+
+(defun js2r--extract-var-between (beg end keyword)
+ (interactive "r")
+ (unless (js2r--single-complete-expression-between-p beg end)
+ (error "Can only extract single, complete expressions to var"))
+
+ (let ((deactivate-mark nil)
+ (expression (buffer-substring beg end))
+ (orig-var-end (make-marker))
+ (new-var-end (make-marker))
+ (name (or (js2r--object-literal-key-behind beg) "name")))
+
+ (delete-region beg end)
+ (insert name)
+ (set-marker orig-var-end (point))
+
+ (goto-char (js2r--start-of-parent-stmt))
+ (js2r--insert-var name keyword)
+ (set-marker new-var-end (point))
+ (insert " = " expression ";")
+ (when (or (js2r--line-above-is-blank)
+ (string-match-p "^function " expression))
+ (newline))
+ (newline)
+ (indent-region new-var-end orig-var-end)
+ (save-excursion
+ (goto-char new-var-end)
+ (set-mark (- (point) (length name)))
+ (mc/create-fake-cursor-at-point))
+ (goto-char orig-var-end)
+ (set-mark (- (point) (length name)))
+ (set-marker orig-var-end nil)
+ (set-marker new-var-end nil))
+ (mc/maybe-multiple-cursors-mode))
+
+(defun js2r--insert-var (name keyword)
+ "Insert a var definition for NAME."
+ (insert (format "%s %s" keyword name)))
+
+(defun js2r-split-var-declaration ()
+ "Split a variable declaration into separate variable
+declarations for each declared variable."
+ (interactive)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (save-excursion
+ (let* ((declaration (or (js2r--closest #'js2-var-decl-node-p) (error "No var declaration at point.")))
+ (kids (js2-var-decl-node-kids declaration))
+ (stmt (js2-node-parent-stmt declaration))
+ (tt (js2-var-decl-node-decl-type declaration))
+ (keyword (cond
+ ((= tt js2-VAR) "var")
+ ((= tt js2-LET) "let")
+ ((= tt js2-CONST) "const"))))
+ (goto-char (js2-node-abs-end stmt))
+ (mapc (lambda (kid)
+ (js2r--insert-var (js2-node-string kid) keyword)
+ (insert ";")
+ (newline)
+ (if (save-excursion
+ (goto-char (js2-node-abs-end kid))
+ (looking-at ", *\n *\n"))
+ (newline)))
+ kids)
+ (delete-char -1) ;; delete final newline
+ (let ((end (point)))
+ (js2r--goto-and-delete-node stmt)
+ (indent-region (point) end))))))
+
+(provide 'js2r-vars)
+;;; js2-vars.el ends here
diff --git a/elpa/js2-refactor-20210306.2003/js2r-vars.elc b/elpa/js2-refactor-20210306.2003/js2r-vars.elc
new file mode 100644
index 0000000..4e8cd3d
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-vars.elc
Binary files differ
diff --git a/elpa/js2-refactor-20210306.2003/js2r-wrapping.el b/elpa/js2-refactor-20210306.2003/js2r-wrapping.el
new file mode 100644
index 0000000..9e43780
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-wrapping.el
@@ -0,0 +1,76 @@
+;;; js2r-wrapping.el --- Helper functions for wrapping/unwrapping -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2017 Nicolas Petton
+
+;; Author: Nicolas Petton
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+
+(require 'yasnippet)
+
+(require 'js2r-helpers)
+
+(defvar js2r--space-str " \t\n")
+
+(defun js2r--skip-region-whitespace ()
+ (let ((p-first (< (point) (mark))))
+ (unless p-first
+ (exchange-point-and-mark))
+ (skip-chars-forward js2r--space-str)
+ (exchange-point-and-mark)
+ (skip-chars-backward js2r--space-str)
+ (when p-first
+ (exchange-point-and-mark))))
+
+(defun js2r-unwrap ()
+ (interactive)
+ (js2r--guard)
+ (js2r--wait-for-parse
+ (let (beg end)
+ (if (use-region-p)
+ (progn
+ (js2r--skip-region-whitespace)
+ (setq beg (min (point) (mark)))
+ (setq end (max (point) (mark))))
+ (let ((stmt (js2-node-parent-stmt (js2-node-at-point))))
+ (setq beg (js2-node-abs-pos stmt))
+ (setq end (js2-node-abs-end stmt))))
+ (let* ((ancestor (js2-node-parent-stmt
+ (js2r--first-common-ancestor-in-region beg end)))
+ (abeg (js2-node-abs-pos ancestor))
+ (aend (js2-node-abs-end ancestor)))
+ (save-excursion
+ (goto-char end)
+ (delete-char (- aend end))
+ (goto-char abeg)
+ (delete-char (- beg abeg)))
+ (indent-region (point-min) (point-max))))))
+
+(defun js2r-wrap-in-for-loop (beg end)
+ (interactive "r")
+ (js2r--skip-region-whitespace)
+ (setq beg (min (point) (mark)))
+ (setq end (max (point) (mark)))
+ (let ((yas-wrap-around-region t))
+ (yas-expand-snippet "for (var i = 0, l = ${1:length}; i < l; i++) {\n$0\n}"
+ beg end)))
+
+(provide 'js2r-wrapping)
+;;; js2r-wrapping.el ends here
diff --git a/elpa/js2-refactor-20210306.2003/js2r-wrapping.elc b/elpa/js2-refactor-20210306.2003/js2r-wrapping.elc
new file mode 100644
index 0000000..de558ca
--- /dev/null
+++ b/elpa/js2-refactor-20210306.2003/js2r-wrapping.elc
Binary files differ
diff --git a/elpa/log4e-20211019.948/log4e-autoloads.el b/elpa/log4e-20211019.948/log4e-autoloads.el
new file mode 100644
index 0000000..0a7282e
--- /dev/null
+++ b/elpa/log4e-20211019.948/log4e-autoloads.el
@@ -0,0 +1,33 @@
+;;; log4e-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "log4e" "log4e.el" (0 0 0 0))
+;;; Generated autoloads from log4e.el
+
+(autoload 'log4e-mode "log4e" "\
+Major mode for browsing a buffer made by log4e.
+
+\\<log4e-mode-map>
+\\{log4e-mode-map}
+
+\(fn)" t nil)
+
+(autoload 'log4e:insert-start-log-quickly "log4e" "\
+Insert logging statment for trace level log at start of current function/macro." t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "log4e" '("log4e")))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; log4e-autoloads.el ends here
diff --git a/elpa/log4e-20211019.948/log4e-pkg.el b/elpa/log4e-20211019.948/log4e-pkg.el
new file mode 100644
index 0000000..928765c
--- /dev/null
+++ b/elpa/log4e-20211019.948/log4e-pkg.el
@@ -0,0 +1,2 @@
+;;; Generated package description from log4e.el -*- no-byte-compile: t -*-
+(define-package "log4e" "20211019.948" "provide logging framework for elisp" 'nil :commit "737d275eac28dbdfb0b26d28e99da148bfce9d16" :authors '(("Hiroaki Otsu" . "ootsuhiroaki@gmail.com")) :maintainer '("Hiroaki Otsu" . "ootsuhiroaki@gmail.com") :keywords '("log") :url "https://github.com/aki2o/log4e")
diff --git a/elpa/log4e-20211019.948/log4e.el b/elpa/log4e-20211019.948/log4e.el
new file mode 100644
index 0000000..a90f9e4
--- /dev/null
+++ b/elpa/log4e-20211019.948/log4e.el
@@ -0,0 +1,592 @@
+;;; log4e.el --- provide logging framework for elisp
+
+;; Copyright (C) 2013 Hiroaki Otsu
+
+;; Author: Hiroaki Otsu <ootsuhiroaki@gmail.com>
+;; Keywords: log
+;; Package-Version: 20211019.948
+;; Package-Commit: 737d275eac28dbdfb0b26d28e99da148bfce9d16
+;; URL: https://github.com/aki2o/log4e
+;; Version: 0.3.3
+
+;; This program 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.
+
+;; This file 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; This extension provides logging framework for elisp.
+
+;;; Dependency:
+;;
+;; Nothing.
+
+;;; Installation:
+;;
+;; Put this to your load-path.
+;; And put the following lines in your elisp file.
+;;
+;; (require 'log4e)
+
+;;; Configuration:
+;;
+;; See <https://github.com/aki2o/log4e/blob/master/README.md>
+;; Otherwise, eval following sexp.
+;; (describe-function 'log4e:deflogger)
+
+;;; API:
+;;
+;; [EVAL] (autodoc-document-lisp-buffer :type 'command :prefix "log4e:" :docstring t)
+;; `log4e:next-log'
+;; Move to start of next log on log4e-mode.
+;; `log4e:previous-log'
+;; Move to start of previous log on log4e-mode.
+;; `log4e:insert-start-log-quickly'
+;; Insert logging statment for trace level log at start of current function/macro.
+;;
+;; *** END auto-documentation
+;;
+;; For detail, see <https://github.com/aki2o/log4e/blob/master/README.md>
+;;
+;; [Note] Other than listed above, Those specifications may be changed without notice.
+
+;;; Tested On:
+;;
+;; - Emacs ... GNU Emacs 23.3.1 (i386-mingw-nt5.1.2600) of 2011-08-15 on GNUPACK
+
+
+;; Enjoy!!!
+
+
+;;; Code:
+(eval-when-compile (require 'cl-lib))
+(require 'rx)
+
+
+(defconst log4e-log-level-alist '((fatal . 6)
+ (error . 5)
+ (warn . 4)
+ (info . 3)
+ (debug . 2)
+ (trace . 1))
+ "Alist of log level value.")
+
+(defconst log4e-default-logging-function-name-alist '((fatal . "log-fatal")
+ (error . "log-error")
+ (warn . "log-warn")
+ (info . "log-info")
+ (debug . "log-debug")
+ (trace . "log-trace"))
+ "Alist of logging function name at default.")
+
+
+(defmacro log4e--def-symmaker (symnm)
+ `(progn
+ (defsubst ,(intern (concat "log4e--make-symbol-" symnm)) (prefix)
+ (intern (concat ,(format "log4e--%s-" symnm) prefix)))))
+
+(log4e--def-symmaker "log-buffer")
+(log4e--def-symmaker "msg-buffer")
+(log4e--def-symmaker "log-template")
+(log4e--def-symmaker "time-template")
+(log4e--def-symmaker "min-level")
+(log4e--def-symmaker "max-level")
+(log4e--def-symmaker "toggle-logging")
+(log4e--def-symmaker "toggle-debugging")
+(log4e--def-symmaker "buffer-coding-system")
+(log4e--def-symmaker "author-mail-address")
+
+(defmacro log4e--def-level-logger (prefix suffix level)
+ (let ((argform (if suffix
+ '(msg &rest msgargs)
+ '(level msg &rest msgargs)))
+ (buff (log4e--make-symbol-log-buffer prefix))
+ (msgbuff (log4e--make-symbol-msg-buffer prefix))
+ (codsys (log4e--make-symbol-buffer-coding-system prefix))
+ (logtmpl (log4e--make-symbol-log-template prefix))
+ (timetmpl (log4e--make-symbol-time-template prefix))
+ (minlvl (log4e--make-symbol-min-level prefix))
+ (maxlvl (log4e--make-symbol-max-level prefix))
+ (logging-p (log4e--make-symbol-toggle-logging prefix)))
+ `(progn
+
+ ;; Define logging function
+ (defun ,(intern (concat prefix "--" (or suffix "log"))) ,argform
+ ,(format "Do logging for %s level log.
+%sMSG/MSGARGS are passed to `format'."
+ (if suffix level "any")
+ (if suffix "" "LEVEL is symbol as a log level in '(trace debug info warn error fatal).\n"))
+ (let ((log4e--current-msg-buffer ,msgbuff))
+ (apply 'log4e--logging ,buff ,codsys ,logtmpl ,timetmpl ,minlvl ,maxlvl ,logging-p ,(if suffix level 'level) msg msgargs)))
+
+ ;; Define logging macro
+ (defmacro ,(intern (concat prefix "--" (or suffix "log") "*")) ,argform
+ ,(format "Do logging for %s level log.
+%sMSG/MSGARGS are passed to `format'.
+Evaluation of MSGARGS is invoked only if %s level log should be printed."
+ (if suffix level "any")
+ (if suffix "" "LEVEL is symbol as a log level in '(trace debug info warn error fatal).\n")
+ (if suffix level "the"))
+ (let (,@(if suffix (list `(level ',level)) '())
+ (buff (log4e--make-symbol-log-buffer ,prefix))
+ (msgbuff (log4e--make-symbol-msg-buffer ,prefix))
+ (codsys (log4e--make-symbol-buffer-coding-system ,prefix))
+ (logtmpl (log4e--make-symbol-log-template ,prefix))
+ (timetmpl (log4e--make-symbol-time-template ,prefix))
+ (minlvl (log4e--make-symbol-min-level ,prefix))
+ (maxlvl (log4e--make-symbol-max-level ,prefix))
+ (logging-p (log4e--make-symbol-toggle-logging ,prefix)))
+ `(let ((log4e--current-msg-buffer ,msgbuff))
+ (when (and ,logging-p
+ (log4e--logging-level-p ,minlvl ,maxlvl ,level))
+ (log4e--logging ,buff ,codsys ,logtmpl ,timetmpl ,minlvl ,maxlvl ,logging-p ,level ,msg ,@msgargs)))))
+
+ )))
+
+(defsubst log4e--logging-level-p (minlevel maxlevel currlevel)
+ (let ((minlvlvalue (or (assoc-default minlevel log4e-log-level-alist)
+ 1))
+ (maxlvlvalue (or (assoc-default maxlevel log4e-log-level-alist)
+ 6))
+ (currlvlvalue (or (assoc-default currlevel log4e-log-level-alist)
+ 0)))
+ (and (>= currlvlvalue minlvlvalue)
+ (<= currlvlvalue maxlvlvalue))))
+
+(defsubst log4e--get-or-create-log-buffer (buffnm &optional codesys)
+ (or (get-buffer buffnm)
+ (let ((buff (get-buffer-create buffnm)))
+ (with-current-buffer buff
+ (log4e-mode)
+ (when codesys
+ (setq buffer-file-coding-system codesys)))
+ buff)))
+
+(defvar log4e--regexp-msg-format
+ (rx-to-string `(and "%"
+ (* (any "+#-0")) ; flags
+ (* (any "0-9")) ; width
+ (? "." (+ (any "0-9"))) ; precision
+ (any "a-zA-Z"))))
+
+(defsubst log4e--insert-log (logtmpl timetmpl level msg msgargs propertize-p)
+ (let ((timetext (format-time-string timetmpl))
+ (lvltext (format "%-05s" (upcase (symbol-name level))))
+ (buffer-read-only nil))
+ (when propertize-p
+ (put-text-property 0 (length timetext) 'face 'font-lock-doc-face timetext)
+ (put-text-property 0 (length lvltext) 'face 'font-lock-keyword-face lvltext))
+ (let* ((logtext logtmpl)
+ (logtext (replace-regexp-in-string "%t" timetext logtext))
+ (logtext (replace-regexp-in-string "%l" lvltext logtext))
+ (logtext (replace-regexp-in-string "%m" msg logtext))
+ (begin (point)))
+ (insert logtext "\n")
+ (when propertize-p
+ (put-text-property begin (+ begin 1) 'log4e--level level))
+ (cl-loop initially (goto-char begin)
+ while (and msgargs
+ (re-search-forward log4e--regexp-msg-format nil t))
+ do (let* ((currtype (match-string-no-properties 0))
+ (currarg (pop msgargs))
+ (failfmt nil)
+ (currtext (condition-case e
+ (format currtype currarg)
+ (error (setq failfmt t)
+ (format "=%s=" (error-message-string e))))))
+ (save-match-data
+ (when propertize-p
+ (ignore-errors
+ (cond (failfmt (put-text-property 0 (length currtext) 'face 'font-lock-warning-face currtext))
+ (t (put-text-property 0 (length currtext) 'face 'font-lock-string-face currtext))))))
+ (replace-match currtext t t)))
+ (goto-char begin))))
+
+(defvar log4e--current-msg-buffer nil)
+
+;; We needs this signature be stay for other compiled plugins using old version
+(defun log4e--logging (buffnm codsys logtmpl timetmpl minlevel maxlevel logging-p level msg &rest msgargs)
+ (when (and logging-p
+ (log4e--logging-level-p minlevel maxlevel level))
+ (save-match-data
+ (with-current-buffer (log4e--get-or-create-log-buffer buffnm codsys)
+ (goto-char (point-max))
+ (let* ((buffer-read-only nil)
+ (begin (point))
+ (currlog (progn
+ (log4e--insert-log logtmpl timetmpl level msg msgargs t)
+ (goto-char (point-max))
+ (buffer-substring-no-properties begin (point))))
+ (msgbuf (or (when (and log4e--current-msg-buffer
+ (not (eq log4e--current-msg-buffer t)))
+ (ignore-errors (get-buffer log4e--current-msg-buffer)))
+ log4e--current-msg-buffer)))
+ (when msgbuf
+ (let ((standard-output (if (buffer-live-p msgbuf)
+ msgbuf
+ standard-output)))
+ (princ currlog))))
+ nil))))
+
+(defun log4e--get-current-log-line-level ()
+ (save-excursion
+ (beginning-of-line)
+ (get-text-property (point) 'log4e--level)))
+
+;; We needs this signature be stay for other plugins compiled with this old version
+(defun log4e--clear-log (buffnm)
+ (with-current-buffer (log4e--get-or-create-log-buffer buffnm)
+ (setq buffer-read-only nil)
+ (erase-buffer)))
+
+;; We needs this signature be stay for other plugins compiled with this old version
+(defun log4e--open-log (buffnm)
+ (let* ((buff (get-buffer buffnm)))
+ (if (not (buffer-live-p buff))
+ (message "[Log4E] Not exist log buffer.")
+ (with-current-buffer buff
+ (setq buffer-read-only t))
+ (pop-to-buffer buff))))
+
+;; We needs this signature be stay for other plugins compiled with this old version
+(defun log4e--open-log-if-debug (buffnm dbg)
+ (when dbg
+ (log4e--open-log buffnm)))
+
+;; (defun log4e--send-report-if-not-debug (buffnm dbg addr prefix)
+;; (let* ((buff (get-buffer buffnm)))
+;; (when (and (not dbg)
+;; (stringp addr)
+;; (buffer-live-p buff))
+;; (reporter-submit-bug-report addr prefix nil nil nil nil))))
+
+
+(defmacro log4e:deflogger (prefix msgtmpl timetmpl &optional log-function-name-custom-alist)
+ "Define the functions of logging for your elisp.
+
+Specification:
+ After eval this, you can use the functions for supporting about logging. They are the following ...
+ - do logging for each log level. Log level are trace, debug, info, warn, error and fatal.
+ - set max and min log level.
+ - switch logging.
+ - switch debugging.
+ - open and clear log buffer.
+ - send bug report for you.
+ For details, see Functions section.
+
+Argument:
+ - PREFIX is string as your elisp prefix.
+ - MSGTMPL is string as format of log. The following words has a special meaning.
+ - %t ... Replaced with time string. About it, see TIMETMPL argument.
+ - %l ... Replaced with log level. They are 'TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL'.
+ - %m ... Replaced with log message that passed by you.
+ - TIMETMPL is string as format of time. This value is passed to `format-time-string'.
+ - LOG-FUNCTION-NAME-CUSTOM-ALIST is alist as the function name of logging.
+ - If this value is nil, define the following functions.
+ yourprefix--log-trace
+ yourprefix--log-debug
+ ...
+ yourprefix--log-fatal
+ - If you want to custom the name of them, give like the following value.
+ '((fatal . \"fatal\")
+ (error . \"error\")
+ (warn . \"warn\")
+ (info . \"info\")
+ (debug . \"debug\")
+ (trace . \"trace\"))
+ Then, define the following functions.
+ yourprefix--trace
+ yourprefix--debug
+ ...
+ yourprefix--fatal
+
+Functions:
+ List all functions defined below. PREFIX is your prefix.
+ - PREFIX--log-fatal ... #1
+ - PREFIX--log-error ... #1
+ - PREFIX--log-warn ... #1
+ - PREFIX--log-info ... #1
+ - PREFIX--log-debug ... #1
+ - PREFIX--log-trace ... #1
+ - PREFIX--log-fatal* ... #2
+ - PREFIX--log-error* ... #2
+ - PREFIX--log-warn* ... #2
+ - PREFIX--log-info* ... #2
+ - PREFIX--log-debug* ... #2
+ - PREFIX--log-trace* ... #2
+ - PREFIX--log
+ - PREFIX--log-set-level
+ - PREFIX--log-enable-logging ... #3
+ - PREFIX--log-disable-logging ... #3
+ - PREFIX--log-enable-messaging ... #3
+ - PREFIX--log-disable-messaging ... #3
+ - PREFIX--log-enable-debugging ... #3
+ - PREFIX--log-disable-debugging ... #3
+ - PREFIX--log-debugging-p
+ - PREFIX--log-set-coding-system
+ - PREFIX--log-set-author-mail-address
+ - PREFIX--log-clear-log ... #3
+ - PREFIX--log-open-log ... #3
+ - PREFIX--log-open-log-if-debug
+
+ #1 : You can customize this name
+ #2 : Name is a #1 name + \"*\"
+ #3 : This is command
+
+Example:
+;; If you develop elisp that has prefix \"hoge\", write and eval the following sexp in your elisp file.
+
+ (require 'log4e)
+ (log4e:deflogger \"hoge\" \"%t [%l] %m\" \"%H:%M:%S\")
+
+;; Eval the following
+ (hoge--log-enable-logging)
+
+;; Then, write the following
+
+ (defun hoge-do-hoge (hoge)
+ (if (not (stringp hoge))
+ (hoge--log-fatal \"failed do hoge : hoge is '%s'\" hoge)
+ (hoge--log-debug \"start do hoge about '%s'\" hoge)
+ (message \"hoge!\")
+ (hoge--log-info \"done hoge about '%s'\" hoge)))
+
+;; Eval the following
+ (hoge-do-hoge \"HOGEGE\")
+
+;; Do M-x hoge--log-open-log
+;; Open the buffer which name is \" *log4e-hoge*\". The buffer string is below
+12:34:56 [INFO ] done hoge about 'HOGEGE'
+
+;; Eval the following
+ (hoge--log-set-level 'trace)
+ (hoge-do-hoge \"FUGAGA\")
+
+;; Do M-x hoge--log-open-log
+;; Open the buffer. its string is below
+12:34:56 [INFO ] done hoge about 'HOGEGE'
+12:35:43 [DEBUG] start do hoge about 'FUGAGA'
+12:35:43 [INFO ] done hoge about 'FUGAGA'
+
+"
+ (declare (indent 0))
+ (if (or (not (stringp prefix)) (string= prefix "")
+ (not (stringp msgtmpl)) (string= msgtmpl "")
+ (not (stringp timetmpl)) (string= timetmpl ""))
+ (message "[LOG4E] invalid argument of deflogger")
+ (let* ((bufsym (log4e--make-symbol-log-buffer prefix))
+ (msgbufsym (log4e--make-symbol-msg-buffer prefix))
+ (logtmplsym (log4e--make-symbol-log-template prefix))
+ (timetmplsym (log4e--make-symbol-time-template prefix))
+ (minlvlsym (log4e--make-symbol-min-level prefix))
+ (maxlvlsym (log4e--make-symbol-max-level prefix))
+ (tglsym (log4e--make-symbol-toggle-logging prefix))
+ (dbgsym (log4e--make-symbol-toggle-debugging prefix))
+ (codsyssym (log4e--make-symbol-buffer-coding-system prefix))
+ (addrsym (log4e--make-symbol-author-mail-address prefix))
+ (funcnm-alist (cl-loop with custom-alist = (car (cdr log-function-name-custom-alist))
+ for lvl in '(fatal error warn info debug trace)
+ for lvlpair = (assq lvl custom-alist)
+ for fname = (or (cdr-safe lvlpair) "")
+ collect (or (if (string-match "\*" fname)
+ (progn
+ (message "[LOG4E] ignore %s level name in log-function-name-custom-alist. can't use '*' for the name." lvl)
+ nil)
+ lvlpair)
+ (assq lvl log4e-default-logging-function-name-alist)))))
+ `(progn
+
+ ;; Define variable for prefix
+ (defvar ,bufsym (format " *log4e-%s*" ,prefix))
+ (defvar ,logtmplsym ,msgtmpl)
+ (defvar ,timetmplsym ,timetmpl)
+ (defvar ,minlvlsym 'info)
+ (defvar ,maxlvlsym 'fatal)
+ (defvar ,tglsym nil)
+ (defvar ,msgbufsym nil)
+ (defvar ,dbgsym nil)
+ (defvar ,codsyssym nil)
+ (defvar ,addrsym nil)
+
+ ;; Define level set function
+ (defun ,(intern (concat prefix "--log-set-level")) (minlevel &optional maxlevel)
+ "Set range for doing logging.
+
+MINLEVEL is symbol of lowest level for doing logging. its default is 'info.
+MAXLEVEL is symbol of highest level for doing logging. its default is 'fatal."
+ (setq ,minlvlsym minlevel)
+ (setq ,maxlvlsym maxlevel))
+
+ ;; Define logging toggle function
+ (defun ,(intern (concat prefix "--log-enable-logging")) ()
+ "Enable logging by logging functions."
+ (interactive)
+ (setq ,tglsym t))
+ (defun ,(intern (concat prefix "--log-disable-logging")) ()
+ "Disable logging by logging functions."
+ (interactive)
+ (setq ,tglsym nil))
+
+ ;; Define messaging toggle function
+ (defun ,(intern (concat prefix "--log-enable-messaging")) (&optional buffer)
+ "Enable dump the log into other buffer by logging functions.
+
+BUFFER is a buffer dumped log into. nil means *Messages* buffer."
+ (interactive)
+ (setq ,msgbufsym (or buffer t)))
+ (defun ,(intern (concat prefix "--log-disable-messaging")) ()
+ "Disable dump the log into other buffer by logging functions."
+ (interactive)
+ (setq ,msgbufsym nil))
+
+ ;; Define debugging toggle function
+ (defun ,(intern (concat prefix "--log-enable-debugging")) ()
+ "Enable debugging and logging.
+
+`PREFIX--log-debugging-p' will return t."
+ (interactive)
+ (setq ,tglsym t)
+ (setq ,dbgsym t))
+ (defun ,(intern (concat prefix "--log-disable-debugging")) ()
+ "Disable debugging.
+
+`PREFIX--log-debugging-p' will return nil."
+ (interactive)
+ (setq ,dbgsym nil))
+ (defun ,(intern (concat prefix "--log-debugging-p")) ()
+ ,dbgsym)
+
+ ;; Define coding system set funtion
+ (defun ,(intern (concat prefix "--log-set-coding-system")) (coding-system)
+ "Set charset and linefeed of LOG-BUFFER.
+
+CODING-SYSTEM is symbol for setting to `buffer-file-coding-system'.
+LOG-BUFFER is a buffer which name is \" *log4e-PREFIX*\"."
+ (setq ,codsyssym coding-system))
+
+ ;; ;; Define author mail set function
+ ;; (defun ,(intern (concat prefix "--log-set-author-mail-address")) (before-atmark after-atmark)
+ ;; "Set mail address of author for elisp that has PREFIX. This value is used SEND-REPORT.
+
+ ;; BEFORE-ATMARK is string as part of mail address. If your address is \"hoge@example.co.jp\", it is \"hoge\".
+ ;; AFTER-ATMARK is string as part of mail address. If your address is \"hoge@example.co.jp\", it is \"example.co.jp\".
+ ;; SEND-REPORT is `PREFIX--log-send-report-if-not-debug'."
+ ;; (setq ,addrsym (concat before-atmark "@" after-atmark)))
+
+ ;; Define log buffer handle function
+ (defun ,(intern (concat prefix "--log-clear-log")) ()
+ "Clear buffer string of buffer which name is \" *log4e-PREFIX*\"."
+ (interactive)
+ (log4e--clear-log ,bufsym))
+ (defun ,(intern (concat prefix "--log-open-log")) ()
+ "Open buffer which name is \" *log4e-PREFIX*\"."
+ (interactive)
+ (log4e--open-log ,bufsym))
+ (defun ,(intern (concat prefix "--log-open-log-if-debug")) ()
+ "Open buffer which name is \" *log4e-PREFIX*\" if debugging is enabled."
+ (log4e--open-log-if-debug ,bufsym ,dbgsym))
+
+ ;; ;; Define report send function
+ ;; (defun ,(intern (concat prefix "--log-send-report-if-not-debug")) ()
+ ;; "Send bug report to author if debugging is disabled.
+
+ ;; The author mailaddress is set by `PREFIX--log-set-author-mail-address'.
+ ;; About the way of sending bug report, see `reporter-submit-bug-report'."
+ ;; (log4e--send-report-if-not-debug ,bufsym ,dbgsym ,addrsym ,prefix))
+
+ ;; Define each level logging function
+ (log4e--def-level-logger ,prefix nil nil)
+ (log4e--def-level-logger ,prefix ,(assoc-default 'fatal funcnm-alist) 'fatal)
+ (log4e--def-level-logger ,prefix ,(assoc-default 'error funcnm-alist) 'error)
+ (log4e--def-level-logger ,prefix ,(assoc-default 'warn funcnm-alist) 'warn)
+ (log4e--def-level-logger ,prefix ,(assoc-default 'info funcnm-alist) 'info)
+ (log4e--def-level-logger ,prefix ,(assoc-default 'debug funcnm-alist) 'debug)
+ (log4e--def-level-logger ,prefix ,(assoc-default 'trace funcnm-alist) 'trace)
+
+ ))))
+
+
+;;;###autoload
+(define-derived-mode log4e-mode view-mode "Log4E"
+ "Major mode for browsing a buffer made by log4e.
+
+\\<log4e-mode-map>
+\\{log4e-mode-map}"
+ (define-key log4e-mode-map (kbd "J") 'log4e:next-log)
+ (define-key log4e-mode-map (kbd "K") 'log4e:previous-log))
+
+(defun log4e:next-log ()
+ "Move to start of next log on log4e-mode."
+ (interactive)
+ (let* ((level))
+ (while (and (not level)
+ (< (point) (point-max)))
+ (forward-line 1)
+ (setq level (log4e--get-current-log-line-level)))
+ level))
+
+(defun log4e:previous-log ()
+ "Move to start of previous log on log4e-mode."
+ (interactive)
+ (let* ((level))
+ (while (and (not level)
+ (> (point) (point-min)))
+ (forward-line -1)
+ (setq level (log4e--get-current-log-line-level)))
+ level))
+
+;;;###autoload
+(defun log4e:insert-start-log-quickly ()
+ "Insert logging statment for trace level log at start of current function/macro."
+ (interactive)
+ (let* ((fstartpt (when (re-search-backward "(\\(?:defun\\|defmacro\\|defsubst\\)\\*? +\\([^ ]+\\) +(\\([^)]*\\))" nil t)
+ (point)))
+ (fncnm (when fstartpt (match-string-no-properties 1)))
+ (argtext (when fstartpt (match-string-no-properties 2)))
+ (prefix (save-excursion
+ (goto-char (point-min))
+ (cl-loop while (re-search-forward "(log4e:deflogger[ \n]+\"\\([^\"]+\\)\"" nil t)
+ for prefix = (match-string-no-properties 1)
+ for currface = (get-text-property (match-beginning 0) 'face)
+ if (not (eq currface 'font-lock-comment-face))
+ return prefix))))
+ (when (and fstartpt prefix)
+ (let* ((fncnm (replace-regexp-in-string (concat "\\`" prefix "[^a-zA-Z0-9]+") "" fncnm))
+ (fncnm (replace-regexp-in-string "-" " " fncnm))
+ (argtext (replace-regexp-in-string "\n" " " argtext))
+ (argtext (replace-regexp-in-string "^ +" "" argtext))
+ (argtext (replace-regexp-in-string " +$" "" argtext))
+ (args (split-string argtext " +"))
+ (args (cl-loop for arg in args
+ if (and (not (string= arg ""))
+ (not (string-match "\\`&" arg)))
+ collect arg))
+ (logtext (cl-loop with ret = (format "start %s." fncnm)
+ for arg in args
+ do (setq ret (concat ret " " arg "[%s]"))
+ finally return ret))
+ (sexpformat (cl-loop with ret = "(%s--log 'trace \"%s\""
+ for arg in args
+ do (setq ret (concat ret " %s"))
+ finally return (concat ret ")")))
+ (inserttext (apply 'format sexpformat prefix logtext args)))
+ (forward-char)
+ (forward-sexp 3)
+ (when (re-search-forward "\\=[ \n]+\"" nil t)
+ (forward-char -1)
+ (forward-sexp))
+ (newline-and-indent)
+ (insert inserttext)))))
+
+
+(provide 'log4e)
+;;; log4e.el ends here
diff --git a/elpa/log4e-20211019.948/log4e.elc b/elpa/log4e-20211019.948/log4e.elc
new file mode 100644
index 0000000..1059b11
--- /dev/null
+++ b/elpa/log4e-20211019.948/log4e.elc
Binary files differ
diff --git a/elpa/multiple-cursors-20220328.1724/mc-cycle-cursors.el b/elpa/multiple-cursors-20220328.1724/mc-cycle-cursors.el
new file mode 100644
index 0000000..0248b9c
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/mc-cycle-cursors.el
@@ -0,0 +1,123 @@
+;;; mc-cycle-cursors.el
+
+;; Copyright (C) 2012-2016 Magnar Sveen
+
+;; Author: Magnar Sveen <magnars@gmail.com>
+;; Keywords: editing cursors
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This scrolls the buffer to center each cursor in turn.
+;; Scroll down with C-v, scroll up with M-v
+;; This is nice when you have cursors that's outside of your view.
+
+;;; Code:
+
+(require 'multiple-cursors-core)
+
+(defun mc/next-fake-cursor-after-point ()
+ (let ((pos (point))
+ (next-pos (1+ (point-max)))
+ next)
+ (mc/for-each-fake-cursor
+ (let ((cursor-pos (overlay-get cursor 'point)))
+ (when (and (< pos cursor-pos)
+ (< cursor-pos next-pos))
+ (setq next-pos cursor-pos)
+ (setq next cursor))))
+ next))
+
+(defun mc/prev-fake-cursor-before-point ()
+ (let ((pos (point))
+ (prev-pos (1- (point-min)))
+ prev)
+ (mc/for-each-fake-cursor
+ (let ((cursor-pos (overlay-get cursor 'point)))
+ (when (and (> pos cursor-pos)
+ (> cursor-pos prev-pos))
+ (setq prev-pos cursor-pos)
+ (setq prev cursor))))
+ prev))
+
+(defcustom mc/cycle-looping-behaviour 'continue
+ "What to do if asked to cycle beyond the last cursor or before the first cursor."
+ :type '(radio (const :tag "Loop around to beginning/end of document." continue)
+ (const :tag "Warn and then loop around." warn)
+ (const :tag "Signal an error." error)
+ (const :tag "Don't loop." stop))
+ :group 'multiple-cursors)
+
+(defun mc/handle-loop-condition (error-message)
+ (cl-ecase mc/cycle-looping-behaviour
+ (error (error error-message))
+ (warn (message error-message))
+ (continue 'continue)
+ (stop 'stop)))
+
+(defun mc/first-fake-cursor-after (point)
+ "Very similar to mc/furthest-cursor-before-point, but ignores (mark) and (point)."
+ (let* ((cursors (mc/all-fake-cursors))
+ (cursors-after-point (cl-remove-if (lambda (cursor)
+ (< (mc/cursor-beg cursor) point))
+ cursors))
+ (cursors-in-order (cl-sort cursors-after-point '< :key 'mc/cursor-beg)))
+ (car cursors-in-order)))
+
+(defun mc/last-fake-cursor-before (point)
+ "Very similar to mc/furthest-cursor-before-point, but ignores (mark) and (point)."
+ (let* ((cursors (mc/all-fake-cursors))
+ (cursors-before-point (cl-remove-if (lambda (cursor)
+ (> (mc/cursor-end cursor) point))
+ cursors))
+ (cursors-in-order (cl-sort cursors-before-point '> :key 'mc/cursor-end)))
+ (car cursors-in-order)))
+
+(cl-defun mc/cycle (next-cursor fallback-cursor loop-message)
+ (when (null next-cursor)
+ (when (eql 'stop (mc/handle-loop-condition loop-message))
+ (cond
+ ((fboundp 'cl-return-from)
+ (cl-return-from mc/cycle nil))
+ ((fboundp 'return-from)
+ (cl-return-from mc/cycle nil))))
+ (setf next-cursor fallback-cursor))
+ (mc/create-fake-cursor-at-point)
+ (mc/pop-state-from-overlay next-cursor)
+ (recenter))
+
+(defun mc/cycle-forward ()
+ (interactive)
+ (mc/cycle (mc/next-fake-cursor-after-point)
+ (mc/first-fake-cursor-after (point-min))
+ "We're already at the last cursor."))
+
+(defun mc/cycle-backward ()
+ (interactive)
+ (mc/cycle (mc/prev-fake-cursor-before-point)
+ (mc/last-fake-cursor-before (point-max))
+ "We're already at the last cursor"))
+
+(define-key mc/keymap (kbd "C-v") 'mc/cycle-forward)
+(define-key mc/keymap (kbd "M-v") 'mc/cycle-backward)
+
+(provide 'mc-cycle-cursors)
+
+
+;; Local Variables:
+;; coding: utf-8
+;; End:
+
+;;; mc-cycle-cursors.el ends here
diff --git a/elpa/multiple-cursors-20220328.1724/mc-cycle-cursors.elc b/elpa/multiple-cursors-20220328.1724/mc-cycle-cursors.elc
new file mode 100644
index 0000000..5a54073
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/mc-cycle-cursors.elc
Binary files differ
diff --git a/elpa/multiple-cursors-20220328.1724/mc-edit-lines.el b/elpa/multiple-cursors-20220328.1724/mc-edit-lines.el
new file mode 100644
index 0000000..55772af
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/mc-edit-lines.el
@@ -0,0 +1,110 @@
+;;; mc-edit-lines.el
+
+;; Copyright (C) 2012-2016 Magnar Sveen
+
+;; Author: Magnar Sveen <magnars@gmail.com>
+;; Keywords: editing cursors
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file contains functions to add multiple cursors to consecutive lines
+;; given an active region.
+
+;; Please see multiple-cursors.el for more commentary.
+
+;;; Code:
+
+(require 'multiple-cursors-core)
+
+(defcustom mc/edit-lines-empty-lines nil
+ "What should be done by `mc/edit-lines' when a line is not long enough."
+ :type '(radio (const :tag "Pad the line with spaces." pad)
+ (const :tag "Ignore the line." ignore)
+ (const :tag "Signal an error." error)
+ (const :tag "Nothing. Cursor is at end of line." nil))
+ :group 'multiple-cursors)
+
+;;;###autoload
+(defun mc/edit-lines (&optional arg)
+ "Add one cursor to each line of the active region.
+Starts from mark and moves in straight down or up towards the
+line point is on.
+
+What is done with lines which are not long enough is governed by
+`mc/edit-lines-empty-lines'. The prefix argument ARG can be used
+to override this. If ARG is a symbol (when called from Lisp),
+that symbol is used instead of `mc/edit-lines-empty-lines'.
+Otherwise, if ARG negative, short lines will be ignored. Any
+other non-nil value will cause short lines to be padded."
+ (interactive "P")
+ (when (not (and mark-active (/= (point) (mark))))
+ (error "Mark a set of lines first"))
+ (mc/remove-fake-cursors)
+ (let* ((col (current-column))
+ (point-line (mc/line-number-at-pos))
+ (mark-line (progn (exchange-point-and-mark) (mc/line-number-at-pos)))
+ (direction (if (< point-line mark-line) :up :down))
+ (style (cond
+ ;; called from lisp
+ ((and arg (symbolp arg))
+ arg)
+ ;; negative argument
+ ((< (prefix-numeric-value arg) 0)
+ 'ignore)
+ (arg 'pad)
+ (t mc/edit-lines-empty-lines))))
+ (deactivate-mark)
+ (when (and (eq direction :up) (bolp))
+ (previous-logical-line 1 nil)
+ (move-to-column col))
+ ;; Add the cursors
+ (while (not (eq (mc/line-number-at-pos) point-line))
+ ;; Pad the line
+ (when (eq style 'pad)
+ (while (< (current-column) col)
+ (insert " ")))
+ ;; Error
+ (when (and (eq style 'error)
+ (not (equal col (current-column))))
+ (error "Short line encountered in `mc/edit-lines'"))
+ ;; create the cursor
+ (unless (and (eq style 'ignore)
+ (not (equal col (current-column))))
+ (mc/create-fake-cursor-at-point))
+ ;; proceed to next
+ (if (eq direction :up)
+ (previous-logical-line 1 nil)
+ (next-logical-line 1 nil))
+ (move-to-column col))
+ (multiple-cursors-mode)))
+
+;;;###autoload
+(defun mc/edit-ends-of-lines ()
+ "Add one cursor to the end of each line in the active region."
+ (interactive)
+ (mc/edit-lines)
+ (mc/execute-command-for-all-cursors 'end-of-line))
+
+;;;###autoload
+(defun mc/edit-beginnings-of-lines ()
+ "Add one cursor to the beginning of each line in the active region."
+ (interactive)
+ (mc/edit-lines)
+ (mc/execute-command-for-all-cursors 'beginning-of-line))
+
+(provide 'mc-edit-lines)
+
+;;; mc-edit-lines.el ends here
diff --git a/elpa/multiple-cursors-20220328.1724/mc-edit-lines.elc b/elpa/multiple-cursors-20220328.1724/mc-edit-lines.elc
new file mode 100644
index 0000000..c61e36e
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/mc-edit-lines.elc
Binary files differ
diff --git a/elpa/multiple-cursors-20220328.1724/mc-hide-unmatched-lines-mode.el b/elpa/multiple-cursors-20220328.1724/mc-hide-unmatched-lines-mode.el
new file mode 100644
index 0000000..7565c0b
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/mc-hide-unmatched-lines-mode.el
@@ -0,0 +1,109 @@
+;;; mc-hide-unmatched-lines-mode.el
+
+;; Copyright (C) 2014 Aleksey Fedotov
+
+;; Author: Aleksey Fedotov <lexa@cfotr.com>
+;; Keywords: editing cursors
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This minor mode when enabled hides all lines where no cursors (and
+;; also hum/lines-to-expand below and above) To make use of this mode
+;; press "C-'" while multiple-cursor-mode is active. You can still
+;; edit lines while you are in mc-hide-unmatched-lines mode. To leave
+;; this mode press "<return>" or "C-g"
+;;
+
+;;; Code:
+
+(require 'multiple-cursors-core)
+(require 'mc-mark-more)
+
+(defvar hum/hide-unmatched-lines-mode-map (make-sparse-keymap)
+ "Keymap for hide unmatched lines is mainly for rebinding C-g")
+
+(define-key hum/hide-unmatched-lines-mode-map (kbd "C-g") 'hum/keyboard-quit)
+(define-key hum/hide-unmatched-lines-mode-map (kbd "<return>") 'hum/keyboard-quit)
+
+(defun hum/keyboard-quit ()
+ "Leave hide-unmatched-lines mode"
+ (interactive)
+ (mc-hide-unmatched-lines-mode 0))
+
+;; used only in in multiple-cursors-mode-disabled-hook
+(defun hum/disable-hum-mode ()
+ (mc-hide-unmatched-lines-mode 0))
+
+;;;###autoload
+(define-minor-mode mc-hide-unmatched-lines-mode
+ "Minor mode when enabled hides all lines where no cursors (and
+also hum/lines-to-expand below and above) To make use of this
+mode press \"C-'\" while multiple-cursor-mode is active. You can
+still edit lines while you are in mc-hide-unmatched-lines
+mode. To leave this mode press <return> or \"C-g\""
+ :init-value nil
+ :lighter " hu"
+ :keymap hum/hide-unmatched-lines-mode-map
+ (if mc-hide-unmatched-lines-mode
+ ;;just in case if mc mode will be disabled while hide-unmatched-lines is active
+ (progn
+ (hum/hide-unmatched-lines)
+ (add-hook 'multiple-cursors-mode-disabled-hook 'hum/disable-hum-mode t t))
+ (progn
+ (hum/unhide-unmatched-lines)
+ (remove-hook 'multiple-cursors-mode-disabled-hook 'hum/disable-hum-mode))))
+
+(defconst hum/invisible-overlay-name 'hum/invisible-overlay-name)
+
+(defcustom hum/lines-to-expand 2
+ "How many lines below and above cursor to show"
+ :type '(integer)
+ :group 'multiple-cursors)
+
+(defcustom hum/placeholder "..."
+ "Placeholder which will be placed instead of hidden text"
+ :type '(string)
+ :group 'multiple-cursors)
+
+(defun hum/add-invisible-overlay (begin end)
+ (let ((overlay (make-overlay begin
+ end
+ (current-buffer)
+ t
+ nil
+ )))
+ (overlay-put overlay hum/invisible-overlay-name t)
+ (overlay-put overlay 'invisible t)
+ (overlay-put overlay 'intangible t)
+ (overlay-put overlay 'evaporate t)
+ (overlay-put overlay 'after-string hum/placeholder)))
+
+(defun hum/hide-unmatched-lines ()
+ (let ((begin (point-min)))
+ (mc/for-each-cursor-ordered
+ (save-excursion
+ (goto-char (mc/cursor-beg cursor))
+ (if (< begin (line-beginning-position (- hum/lines-to-expand)))
+ (hum/add-invisible-overlay begin (line-end-position (- hum/lines-to-expand))))
+ (setq begin (line-beginning-position (+ 2 hum/lines-to-expand)))))
+ (hum/add-invisible-overlay begin (point-max))))
+
+(defun hum/unhide-unmatched-lines ()
+ (remove-overlays nil nil hum/invisible-overlay-name t))
+
+(define-key mc/keymap (kbd "C-'") 'mc-hide-unmatched-lines-mode)
+
+(provide 'mc-hide-unmatched-lines-mode)
diff --git a/elpa/multiple-cursors-20220328.1724/mc-hide-unmatched-lines-mode.elc b/elpa/multiple-cursors-20220328.1724/mc-hide-unmatched-lines-mode.elc
new file mode 100644
index 0000000..5019d6c
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/mc-hide-unmatched-lines-mode.elc
Binary files differ
diff --git a/elpa/multiple-cursors-20220328.1724/mc-mark-more.el b/elpa/multiple-cursors-20220328.1724/mc-mark-more.el
new file mode 100644
index 0000000..635e012
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/mc-mark-more.el
@@ -0,0 +1,737 @@
+;;; mc-mark-more.el
+
+;; Copyright (C) 2012-2016 Magnar Sveen
+
+;; Author: Magnar Sveen <magnars@gmail.com>
+;; Keywords: editing cursors
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file contains functions to mark more parts of the buffer.
+;; See ./features/mark-more.feature for examples.
+
+;; Please see multiple-cursors.el for more commentary.
+
+;;; Code:
+
+(require 'multiple-cursors-core)
+(require 'thingatpt)
+
+(defun mc/cursor-end (cursor)
+ (if (overlay-get cursor 'mark-active)
+ (max (overlay-get cursor 'point)
+ (overlay-get cursor 'mark))
+ (overlay-get cursor 'point)))
+
+(defun mc/cursor-beg (cursor)
+ (if (overlay-get cursor 'mark-active)
+ (min (overlay-get cursor 'point)
+ (overlay-get cursor 'mark))
+ (overlay-get cursor 'point)))
+
+(defun mc/furthest-region-end ()
+ (let ((end (max (mark) (point))))
+ (mc/for-each-fake-cursor
+ (setq end (max end (mc/cursor-end cursor))))
+ end))
+
+(defun mc/first-region-start ()
+ (let ((beg (min (mark) (point))))
+ (mc/for-each-fake-cursor
+ (setq beg (min beg (mc/cursor-beg cursor))))
+ beg))
+
+(defun mc/furthest-cursor-before-point ()
+ (let ((beg (if mark-active (min (mark) (point)) (point)))
+ furthest)
+ (mc/for-each-fake-cursor
+ (when (< (mc/cursor-beg cursor) beg)
+ (setq beg (mc/cursor-beg cursor))
+ (setq furthest cursor)))
+ furthest))
+
+(defun mc/furthest-cursor-after-point ()
+ (let ((end (if mark-active (max (mark) (point)) (point)))
+ furthest)
+ (mc/for-each-fake-cursor
+ (when (> (mc/cursor-end cursor) end)
+ (setq end (mc/cursor-end cursor))
+ (setq furthest cursor)))
+ furthest))
+
+(defun mc/fake-cursor-at-point (&optional point)
+ "Return the fake cursor with its point right at POINT (defaults
+to (point)), or nil."
+ (setq point (or point (point)))
+ (let ((cursors (mc/all-fake-cursors))
+ (c nil))
+ (catch 'found
+ (while (setq c (pop cursors))
+ (when (eq (marker-position (overlay-get c 'point))
+ point)
+ (throw 'found c))))))
+
+(defun mc/region-strings ()
+ (let ((strings (list (buffer-substring-no-properties (point) (mark)))))
+ (mc/for-each-fake-cursor
+ (add-to-list 'strings (buffer-substring-no-properties
+ (mc/cursor-beg cursor)
+ (mc/cursor-end cursor))))
+ strings))
+
+(defvar mc/enclose-search-term nil
+ "How should mc/mark-more-* search for more matches?
+
+Match everything: nil
+Match only whole words: 'words
+Match only whole symbols: 'symbols
+
+Use like case-fold-search, don't recommend setting it globally.")
+
+(defun mc/mark-more-like-this (skip-last direction)
+ (let ((case-fold-search nil)
+ (re (regexp-opt (mc/region-strings) mc/enclose-search-term))
+ (point-out-of-order (cl-ecase direction
+ (forwards (< (point) (mark)))
+ (backwards (not (< (point) (mark))))))
+ (furthest-cursor (cl-ecase direction
+ (forwards (mc/furthest-cursor-after-point))
+ (backwards (mc/furthest-cursor-before-point))))
+ (start-char (cl-ecase direction
+ (forwards (mc/furthest-region-end))
+ (backwards (mc/first-region-start))))
+ (search-function (cl-ecase direction
+ (forwards 'search-forward-regexp)
+ (backwards 'search-backward-regexp)))
+ (match-point-getter (cl-ecase direction
+ (forwards 'match-beginning)
+ (backwards 'match-end))))
+ (if (and skip-last (not furthest-cursor))
+ (error "No cursors to be skipped")
+ (mc/save-excursion
+ (goto-char start-char)
+ (when skip-last
+ (mc/remove-fake-cursor furthest-cursor))
+ (if (funcall search-function re nil t)
+ (progn
+ (push-mark (funcall match-point-getter 0))
+ (when point-out-of-order
+ (exchange-point-and-mark))
+ (mc/create-fake-cursor-at-point))
+ (user-error "no more matches found."))))))
+
+;;;###autoload
+(defun mc/mark-next-like-this (arg)
+ "Find and mark the next part of the buffer matching the currently active region
+If no region is active add a cursor on the next line
+With negative ARG, delete the last one instead.
+With zero ARG, skip the last one and mark next."
+ (interactive "p")
+ (if (< arg 0)
+ (let ((cursor (mc/furthest-cursor-after-point)))
+ (if cursor
+ (mc/remove-fake-cursor cursor)
+ (error "No cursors to be unmarked")))
+ (if (region-active-p)
+ (mc/mark-more-like-this (= arg 0) 'forwards)
+ (mc/mark-lines arg 'forwards)))
+ (mc/maybe-multiple-cursors-mode))
+
+;;;###autoload
+(defun mc/mark-next-like-this-word (arg)
+ "Find and mark the next part of the buffer matching the currently active region
+If no region is active, mark the word at the point and find the next match
+With negative ARG, delete the last one instead.
+With zero ARG, skip the last one and mark next."
+ (interactive "p")
+ (if (< arg 0)
+ (let ((cursor (mc/furthest-cursor-after-point)))
+ (if cursor
+ (mc/remove-fake-cursor cursor)
+ (error "No cursors to be unmarked")))
+ (if (region-active-p)
+ (mc/mark-more-like-this (= arg 0) 'forwards)
+ (mc--select-thing-at-point 'word)
+ (mc/mark-more-like-this (= arg 0) 'forwards)))
+ (mc/maybe-multiple-cursors-mode))
+
+(defun mc/mark-next-like-this-symbol (arg)
+ "Find and mark the next part of the buffer matching the currently active region
+If no region is active, mark the symbol at the point and find the next match
+With negative ARG, delete the last one instead.
+With zero ARG, skip the last one and mark next."
+ (interactive "p")
+ (if (< arg 0)
+ (let ((cursor (mc/furthest-cursor-after-point)))
+ (if cursor
+ (mc/remove-fake-cursor cursor)
+ (error "No cursors to be unmarked")))
+ (if (region-active-p)
+ (mc/mark-more-like-this (= arg 0) 'forwards)
+ (mc--select-thing-at-point 'symbol)
+ (mc/mark-more-like-this (= arg 0) 'forwards)))
+ (mc/maybe-multiple-cursors-mode))
+
+
+;;;###autoload
+(defun mc/mark-next-word-like-this (arg)
+ "Find and mark the next word of the buffer matching the currently active region
+The matching region must be a whole word to be a match
+If no region is active add a cursor on the next line
+With negative ARG, delete the last one instead.
+With zero ARG, skip the last one and mark next."
+ (interactive "p")
+ (let ((mc/enclose-search-term 'words))
+ (mc/mark-next-like-this arg)))
+
+;;;###autoload
+(defun mc/mark-next-symbol-like-this (arg)
+ "Find and mark the next symbol of the buffer matching the currently active region
+The matching region must be a whole symbol to be a match
+If no region is active add a cursor on the next line
+With negative ARG, delete the last one instead.
+With zero ARG, skip the last one and mark next."
+ (interactive "p")
+ (let ((mc/enclose-search-term 'symbols))
+ (mc/mark-next-like-this arg)))
+
+;;;###autoload
+(defun mc/mark-previous-like-this (arg)
+ "Find and mark the previous part of the buffer matching the
+currently active region.
+
+If no region is active ,add a cursor on the previous line.
+
+With negative ARG, delete the last one instead.
+
+With zero ARG, skip the last one and mark next."
+ (interactive "p")
+ (if (< arg 0)
+ (let ((cursor (mc/furthest-cursor-before-point)))
+ (if cursor
+ (mc/remove-fake-cursor cursor)
+ (error "No cursors to be unmarked")))
+ (if (region-active-p)
+ (mc/mark-more-like-this (= arg 0) 'backwards)
+ (mc/mark-lines arg 'backwards)))
+ (mc/maybe-multiple-cursors-mode))
+
+;;;###autoload
+(defun mc/mark-previous-like-this-word (arg)
+ "Find and mark the previous part of the buffer matching the
+currently active region.
+
+If no region is active, mark the word at the point and find the
+previous match.
+
+With negative ARG, delete the last one instead.
+
+With zero ARG, skip the last one and mark previous."
+ (interactive "p")
+ (if (< arg 0)
+ (let ((cursor (mc/furthest-cursor-after-point)))
+ (if cursor
+ (mc/remove-fake-cursor cursor)
+ (error "No cursors to be unmarked")))
+ (if (region-active-p)
+ (mc/mark-more-like-this (= arg 0) 'backwards)
+ (mc--select-thing-at-point 'word)
+ (mc/mark-more-like-this (= arg 0) 'backwards)))
+ (mc/maybe-multiple-cursors-mode))
+
+(defun mc/mark-previous-like-this-symbol (arg)
+ "Find and mark the previous part of the buffer matching the
+currently active region.
+
+If no region is active, mark the symbol at the point and find the
+previous match.
+
+With negative ARG, delete the last one instead.
+
+With zero ARG, skip the last one and mark previous."
+ (interactive "p")
+ (if (< arg 0)
+ (let ((cursor (mc/furthest-cursor-after-point)))
+ (if cursor
+ (mc/remove-fake-cursor cursor)
+ (error "No cursors to be unmarked")))
+ (if (region-active-p)
+ (mc/mark-more-like-this (= arg 0) 'backwards)
+ (mc--select-thing-at-point 'symbol)
+ (mc/mark-more-like-this (= arg 0) 'backwards)))
+ (mc/maybe-multiple-cursors-mode))
+
+
+;;;###autoload
+(defun mc/mark-previous-word-like-this (arg)
+ "Find and mark the previous part of the buffer matching the
+currently active region.
+
+The matching region must be a whole word to be a match.
+
+If no region is active, add a cursor on the previous line.
+
+With negative ARG, delete the last one instead.
+
+With zero ARG, skip the last one and mark next."
+ (interactive "p")
+ (let ((mc/enclose-search-term 'words))
+ (mc/mark-previous-like-this arg)))
+
+;;;###autoload
+(defun mc/mark-previous-symbol-like-this (arg)
+ "Find and mark the previous part of the buffer matching
+the currently active region.
+
+The matching region must be a whole symbol to be a match.
+
+If no region is active add a cursor on the previous line.
+
+With negative ARG, delete the last one instead.
+
+With zero ARG, skip the last one and mark next."
+ (interactive "p")
+ (let ((mc/enclose-search-term 'symbols))
+ (mc/mark-previous-like-this arg)))
+
+(defun mc/mark-lines (num-lines direction)
+ (dotimes (i (if (= num-lines 0) 1 num-lines))
+ (mc/save-excursion
+ (let ((furthest-cursor (cl-ecase direction
+ (forwards (mc/furthest-cursor-after-point))
+ (backwards (mc/furthest-cursor-before-point)))))
+ (when (overlayp furthest-cursor)
+ (goto-char (overlay-get furthest-cursor 'point))
+ (when (= num-lines 0)
+ (mc/remove-fake-cursor furthest-cursor))))
+ (cl-ecase direction
+ (forwards (next-logical-line 1 nil))
+ (backwards (previous-logical-line 1 nil)))
+ (mc/create-fake-cursor-at-point))))
+
+;;;###autoload
+(defun mc/mark-next-lines (arg)
+ (interactive "p")
+ (mc/mark-lines arg 'forwards)
+ (mc/maybe-multiple-cursors-mode))
+
+;;;###autoload
+(defun mc/mark-previous-lines (arg)
+ (interactive "p")
+ (mc/mark-lines arg 'backwards)
+ (mc/maybe-multiple-cursors-mode))
+
+;;;###autoload
+(defun mc/unmark-next-like-this ()
+ "Deselect next part of the buffer matching the currently active region."
+ (interactive)
+ (mc/mark-next-like-this -1))
+
+;;;###autoload
+(defun mc/unmark-previous-like-this ()
+ "Deselect prev part of the buffer matching the currently active region."
+ (interactive)
+ (mc/mark-previous-like-this -1))
+
+;;;###autoload
+(defun mc/skip-to-next-like-this ()
+ "Skip the current one and select the next part of the buffer
+matching the currently active region."
+ (interactive)
+ (mc/mark-next-like-this 0))
+
+;;;###autoload
+(defun mc/skip-to-previous-like-this ()
+ "Skip the current one and select the prev part of the buffer
+matching the currently active region."
+ (interactive)
+ (mc/mark-previous-like-this 0))
+
+;;;###autoload
+(defun mc/mark-all-like-this ()
+ "Find and mark all the parts of the buffer matching the currently active region"
+ (interactive)
+ (unless (region-active-p)
+ (error "Mark a region to match first."))
+ (mc/remove-fake-cursors)
+ (let ((master (point))
+ (case-fold-search nil)
+ (point-first (< (point) (mark)))
+ (re (regexp-opt (mc/region-strings) mc/enclose-search-term)))
+ (mc/save-excursion
+ (goto-char 0)
+ (while (search-forward-regexp re nil t)
+ (push-mark (match-beginning 0))
+ (when point-first (exchange-point-and-mark))
+ (unless (= master (point))
+ (mc/create-fake-cursor-at-point))
+ (when point-first (exchange-point-and-mark)))))
+ (if (> (mc/num-cursors) 1)
+ (multiple-cursors-mode 1)
+ (mc/disable-multiple-cursors-mode)))
+
+(defun mc--select-thing-at-point (thing)
+ (let ((bound (bounds-of-thing-at-point thing)))
+ (when bound
+ (set-mark (car bound))
+ (goto-char (cdr bound))
+ bound)))
+
+(defun mc--select-thing-at-point-or-bark (thing)
+ (unless (or (region-active-p) (mc--select-thing-at-point thing))
+ (error "Mark a region or set cursor on a %s." thing)))
+
+;;;###autoload
+(defun mc/mark-all-words-like-this ()
+ (interactive)
+ (mc--select-thing-at-point-or-bark 'word)
+ (let ((mc/enclose-search-term 'words))
+ (mc/mark-all-like-this)))
+
+;;;###autoload
+(defun mc/mark-all-symbols-like-this ()
+ (interactive)
+ (mc--select-thing-at-point-or-bark 'symbol)
+ (let ((mc/enclose-search-term 'symbols))
+ (mc/mark-all-like-this)))
+
+;;;###autoload
+(defun mc/mark-all-in-region (beg end &optional search)
+ "Find and mark all the parts in the region matching the given search"
+ (interactive "r")
+ (let ((search (or search (read-from-minibuffer "Mark all in region: ")))
+ (case-fold-search nil))
+ (if (string= search "")
+ (message "Mark aborted")
+ (progn
+ (mc/remove-fake-cursors)
+ (goto-char beg)
+ (while (search-forward search end t)
+ (push-mark (match-beginning 0))
+ (mc/create-fake-cursor-at-point))
+ (let ((first (mc/furthest-cursor-before-point)))
+ (if (not first)
+ (error "Search failed for %S" search)
+ (mc/pop-state-from-overlay first)))
+ (if (> (mc/num-cursors) 1)
+ (multiple-cursors-mode 1)
+ (mc/disable-multiple-cursors-mode))))))
+
+;;;###autoload
+(defun mc/mark-all-in-region-regexp (beg end)
+ "Find and mark all the parts in the region matching the given regexp."
+ (interactive "r")
+ (let ((search (read-regexp "Mark regexp in region: "))
+ (case-fold-search nil))
+ (if (string= search "")
+ (message "Mark aborted")
+ (progn
+ (mc/remove-fake-cursors)
+ (goto-char beg)
+ (let ((lastmatch))
+ (while (and (< (point) end) ; can happen because of (forward-char)
+ (search-forward-regexp search end t))
+ (push-mark (match-beginning 0))
+ (mc/create-fake-cursor-at-point)
+ (setq lastmatch (point))
+ (when (= (point) (match-beginning 0))
+ (forward-char)))
+ (unless lastmatch
+ (error "Search failed for %S" search)))
+ (goto-char (match-end 0))
+ (if (< (mc/num-cursors) 3)
+ (mc/disable-multiple-cursors-mode)
+ (mc/pop-state-from-overlay (mc/furthest-cursor-before-point))
+ (multiple-cursors-mode 1))))))
+
+(when (not (fboundp 'set-temporary-overlay-map))
+ ;; Backport this function from newer emacs versions
+ (defun set-temporary-overlay-map (map &optional keep-pred)
+ "Set a new keymap that will only exist for a short period of time.
+The new keymap to use must be given in the MAP variable. When to
+remove the keymap depends on user input and KEEP-PRED:
+
+- if KEEP-PRED is nil (the default), the keymap disappears as
+ soon as any key is pressed, whether or not the key is in MAP;
+
+- if KEEP-PRED is t, the keymap disappears as soon as a key *not*
+ in MAP is pressed;
+
+- otherwise, KEEP-PRED must be a 0-arguments predicate that will
+ decide if the keymap should be removed (if predicate returns
+ nil) or kept (otherwise). The predicate will be called after
+ each key sequence."
+
+ (let* ((clearfunsym (make-symbol "clear-temporary-overlay-map"))
+ (overlaysym (make-symbol "t"))
+ (alist (list (cons overlaysym map)))
+ (clearfun
+ `(lambda ()
+ (unless ,(cond ((null keep-pred) nil)
+ ((eq t keep-pred)
+ `(eq this-command
+ (lookup-key ',map
+ (this-command-keys-vector))))
+ (t `(funcall ',keep-pred)))
+ (remove-hook 'pre-command-hook ',clearfunsym)
+ (setq emulation-mode-map-alists
+ (delq ',alist emulation-mode-map-alists))))))
+ (set overlaysym overlaysym)
+ (fset clearfunsym clearfun)
+ (add-hook 'pre-command-hook clearfunsym)
+
+ (push alist emulation-mode-map-alists))))
+
+;;;###autoload
+(defun mc/mark-more-like-this-extended ()
+ "Like mark-more-like-this, but then lets you adjust with arrow keys.
+The adjustments work like this:
+
+ <up> Mark previous like this and set direction to 'up
+ <down> Mark next like this and set direction to 'down
+
+If direction is 'up:
+
+ <left> Skip past the cursor furthest up
+ <right> Remove the cursor furthest up
+
+If direction is 'down:
+
+ <left> Remove the cursor furthest down
+ <right> Skip past the cursor furthest down
+
+The bindings for these commands can be changed.
+See `mc/mark-more-like-this-extended-keymap'."
+ (interactive)
+ (mc/mmlte--down)
+ (set-transient-map mc/mark-more-like-this-extended-keymap t))
+
+(defvar mc/mark-more-like-this-extended-direction nil
+ "When using mc/mark-more-like-this-extended
+are we working on the next or previous cursors?")
+
+(make-variable-buffer-local 'mc/mark-more-like-this-extended)
+
+(defun mc/mmlte--message ()
+ (if (eq mc/mark-more-like-this-extended-direction 'up)
+ (message "<up> to mark previous, <left> to skip, <right> to remove, <down> to mark next")
+ (message "<down> to mark next, <right> to skip, <left> to remove, <up> to mark previous")))
+
+(defun mc/mmlte--up ()
+ (interactive)
+ (mc/mark-previous-like-this 1)
+ (setq mc/mark-more-like-this-extended-direction 'up)
+ (mc/mmlte--message))
+
+(defun mc/mmlte--down ()
+ (interactive)
+ (mc/mark-next-like-this 1)
+ (setq mc/mark-more-like-this-extended-direction 'down)
+ (mc/mmlte--message))
+
+(defun mc/mmlte--left ()
+ (interactive)
+ (if (eq mc/mark-more-like-this-extended-direction 'down)
+ (mc/unmark-next-like-this)
+ (mc/skip-to-previous-like-this))
+ (mc/mmlte--message))
+
+(defun mc/mmlte--right ()
+ (interactive)
+ (if (eq mc/mark-more-like-this-extended-direction 'up)
+ (mc/unmark-previous-like-this)
+ (mc/skip-to-next-like-this))
+ (mc/mmlte--message))
+
+(defvar mc/mark-more-like-this-extended-keymap (make-sparse-keymap))
+
+(define-key mc/mark-more-like-this-extended-keymap (kbd "<up>") 'mc/mmlte--up)
+(define-key mc/mark-more-like-this-extended-keymap (kbd "<down>") 'mc/mmlte--down)
+(define-key mc/mark-more-like-this-extended-keymap (kbd "<left>") 'mc/mmlte--left)
+(define-key mc/mark-more-like-this-extended-keymap (kbd "<right>") 'mc/mmlte--right)
+
+(defvar mc--restrict-mark-all-to-symbols nil)
+
+;;;###autoload
+(defun mc/mark-all-like-this-dwim (arg)
+ "Tries to guess what you want to mark all of.
+Can be pressed multiple times to increase selection.
+
+With prefix, it behaves the same as original `mc/mark-all-like-this'"
+ (interactive "P")
+ (if arg
+ (mc/mark-all-like-this)
+ (if (and (not (use-region-p))
+ (derived-mode-p 'sgml-mode)
+ (mc--on-tag-name-p))
+ (mc/mark-sgml-tag-pair)
+ (let ((before (mc/num-cursors)))
+ (unless (eq last-command 'mc/mark-all-like-this-dwim)
+ (setq mc--restrict-mark-all-to-symbols nil))
+ (unless (use-region-p)
+ (mc--mark-symbol-at-point)
+ (setq mc--restrict-mark-all-to-symbols t))
+ (if mc--restrict-mark-all-to-symbols
+ (mc/mark-all-symbols-like-this-in-defun)
+ (mc/mark-all-like-this-in-defun))
+ (when (<= (mc/num-cursors) before)
+ (if mc--restrict-mark-all-to-symbols
+ (mc/mark-all-symbols-like-this)
+ (mc/mark-all-like-this)))
+ (when (<= (mc/num-cursors) before)
+ (mc/mark-all-like-this))))))
+
+;;;###autoload
+(defun mc/mark-all-dwim (arg)
+ "Tries even harder to guess what you want to mark all of.
+
+If the region is active and spans multiple lines, it will behave
+as if `mc/mark-all-in-region'. With the prefix ARG, it will call
+`mc/edit-lines' instead.
+
+If the region is inactive or on a single line, it will behave like
+`mc/mark-all-like-this-dwim'."
+ (interactive "P")
+ (if (and (use-region-p)
+ (not (> (mc/num-cursors) 1))
+ (not (= (mc/line-number-at-pos (region-beginning))
+ (mc/line-number-at-pos (region-end)))))
+ (if arg
+ (call-interactively 'mc/edit-lines)
+ (call-interactively 'mc/mark-all-in-region))
+ (progn
+ (setq this-command 'mc/mark-all-like-this-dwim)
+ (mc/mark-all-like-this-dwim arg))))
+
+(defun mc--in-defun ()
+ (bounds-of-thing-at-point 'defun))
+
+;;;###autoload
+(defun mc/mark-all-like-this-in-defun ()
+ "Mark all like this in defun."
+ (interactive)
+ (if (mc--in-defun)
+ (save-restriction
+ (widen)
+ (narrow-to-defun)
+ (mc/mark-all-like-this))
+ (mc/mark-all-like-this)))
+
+;;;###autoload
+(defun mc/mark-all-words-like-this-in-defun ()
+ "Mark all words like this in defun."
+ (interactive)
+ (mc--select-thing-at-point-or-bark 'word)
+ (if (mc--in-defun)
+ (save-restriction
+ (widen)
+ (narrow-to-defun)
+ (mc/mark-all-words-like-this))
+ (mc/mark-all-words-like-this)))
+
+;;;###autoload
+(defun mc/mark-all-symbols-like-this-in-defun ()
+ "Mark all symbols like this in defun."
+ (interactive)
+ (mc--select-thing-at-point-or-bark 'symbol)
+ (if (mc--in-defun)
+ (save-restriction
+ (widen)
+ (narrow-to-defun)
+ (mc/mark-all-symbols-like-this))
+ (mc/mark-all-symbols-like-this)))
+
+(defun mc--mark-symbol-at-point ()
+ "Select the symbol under cursor"
+ (interactive)
+ (when (not (use-region-p))
+ (let ((b (bounds-of-thing-at-point 'symbol)))
+ (goto-char (car b))
+ (set-mark (cdr b)))))
+
+(defun mc--get-nice-sgml-context ()
+ (car
+ (last
+ (progn
+ (when (looking-at "<") (forward-char 1))
+ (when (looking-back ">" 100) (forward-char -1))
+ (sgml-get-context)))))
+
+(defun mc--on-tag-name-p ()
+ (let* ((context (save-excursion (mc--get-nice-sgml-context)))
+ (tag-name-len (length (aref context 4)))
+ (beg (aref context 2))
+ (end (+ beg tag-name-len (if (eq 'open (aref context 1)) 1 3))))
+ (and context
+ (>= (point) beg)
+ (<= (point) end))))
+
+;;;###autoload
+(defun mc/toggle-cursor-on-click (event)
+ "Add a cursor where you click, or remove a fake cursor that is
+already there."
+ (interactive "e")
+ (mouse-minibuffer-check event)
+ ;; Use event-end in case called from mouse-drag-region.
+ ;; If EVENT is a click, event-end and event-start give same value.
+ (let ((position (event-end event)))
+ (if (not (windowp (posn-window position)))
+ (error "Position not in text area of window"))
+ (select-window (posn-window position))
+ (let ((pt (posn-point position)))
+ (if (numberp pt)
+ ;; is there a fake cursor with the actual *point* right where we are?
+ (let ((existing (mc/fake-cursor-at-point pt)))
+ (if existing
+ (mc/remove-fake-cursor existing)
+ (save-excursion
+ (goto-char pt)
+ (mc/create-fake-cursor-at-point))))))
+ (mc/maybe-multiple-cursors-mode)))
+
+;;;###autoload
+(defalias 'mc/add-cursor-on-click 'mc/toggle-cursor-on-click)
+
+;;;###autoload
+(defun mc/mark-sgml-tag-pair ()
+ "Mark the tag we're in and its pair for renaming."
+ (interactive)
+ (when (not (mc--inside-tag-p))
+ (error "Place point inside tag to rename."))
+ (let ((context (mc--get-nice-sgml-context)))
+ (if (looking-at "</")
+ (setq context (car (last (sgml-get-context)))))
+ (goto-char (aref context 2))
+ (let* ((tag-name (aref context 4))
+ (num-chars (length tag-name))
+ (master-start (1+ (point)))
+ (mirror-end (save-excursion
+ (sgml-skip-tag-forward 1)
+ (1- (point)))))
+ (goto-char (- mirror-end num-chars))
+ (set-mark mirror-end)
+ (mc/create-fake-cursor-at-point)
+ (goto-char master-start)
+ (set-mark (+ (point) num-chars))))
+ (mc/maybe-multiple-cursors-mode))
+
+(defun mc--inside-tag-p ()
+ (save-excursion
+ (not (null (sgml-get-context)))))
+
+(provide 'mc-mark-more)
+
+;;; mc-mark-more.el ends here
diff --git a/elpa/multiple-cursors-20220328.1724/mc-mark-more.elc b/elpa/multiple-cursors-20220328.1724/mc-mark-more.elc
new file mode 100644
index 0000000..c5faaf1
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/mc-mark-more.elc
Binary files differ
diff --git a/elpa/multiple-cursors-20220328.1724/mc-mark-pop.el b/elpa/multiple-cursors-20220328.1724/mc-mark-pop.el
new file mode 100644
index 0000000..8a18381
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/mc-mark-pop.el
@@ -0,0 +1,22 @@
+;;; mc-mark-pop.el --- Pop cursors off of the mark stack
+
+(require 'multiple-cursors-core)
+
+;;;###autoload
+(defun mc/mark-pop ()
+ "Add a cursor at the current point, pop off mark ring and jump
+to the popped mark."
+ (interactive)
+ ;; If the mark happens to be at the current point, just pop that one off.
+ (while (eql (mark) (point))
+ (pop-mark))
+ (mc/create-fake-cursor-at-point)
+ (exchange-point-and-mark)
+ (pop-mark)
+ (mc/maybe-multiple-cursors-mode))
+
+;; A good key binding for this feature is perhaps "C-S-p" ('p' for pop).
+
+(provide 'mc-mark-pop)
+
+;;; mc-mark-pop.el ends here
diff --git a/elpa/multiple-cursors-20220328.1724/mc-mark-pop.elc b/elpa/multiple-cursors-20220328.1724/mc-mark-pop.elc
new file mode 100644
index 0000000..fbd7a1d
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/mc-mark-pop.elc
Binary files differ
diff --git a/elpa/multiple-cursors-20220328.1724/mc-separate-operations.el b/elpa/multiple-cursors-20220328.1724/mc-separate-operations.el
new file mode 100644
index 0000000..ddc7395
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/mc-separate-operations.el
@@ -0,0 +1,151 @@
+;;; mc-separate-operations.el - functions that work differently on each cursor
+
+;; Copyright (C) 2012-2016 Magnar Sveen
+
+;; Author: Magnar Sveen <magnars@gmail.com>
+;; Keywords: editing cursors
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file contains functions that work differently on each cursor,
+;; instead of treating all of them the same.
+
+;; Please see multiple-cursors.el for more commentary.
+
+;;; Code:
+
+(require 'multiple-cursors-core)
+
+(defcustom mc/insert-numbers-default 0
+ "The default number at which to start counting for
+`mc/insert-numbers'"
+ :type 'integer
+ :group 'multiple-cursors)
+
+(defvar mc--insert-numbers-number 0)
+
+;;;###autoload
+(defun mc/insert-numbers (arg)
+ "Insert increasing numbers for each cursor, starting at
+`mc/insert-numbers-default' or ARG."
+ (interactive "P")
+ (setq mc--insert-numbers-number (or (and arg (prefix-numeric-value arg))
+ mc/insert-numbers-default))
+ (mc/for-each-cursor-ordered
+ (mc/execute-command-for-fake-cursor 'mc--insert-number-and-increase cursor)))
+
+(defun mc--insert-number-and-increase ()
+ (interactive)
+ (insert (number-to-string mc--insert-numbers-number))
+ (setq mc--insert-numbers-number (1+ mc--insert-numbers-number)))
+
+(defun mc--ordered-region-strings ()
+ (let (strings)
+ (save-excursion
+ (mc/for-each-cursor-ordered
+ (setq strings (cons (buffer-substring-no-properties
+ (mc/cursor-beg cursor)
+ (mc/cursor-end cursor)) strings))))
+ (nreverse strings)))
+
+(defvar mc--insert-letters-number 0)
+
+;;;###autoload
+(defun mc/insert-letters (arg)
+ "Insert increasing letters for each cursor, starting at 0 or ARG.
+ Where letter[0]=a letter[2]=c letter[26]=aa"
+ (interactive "P")
+ (setq mc--insert-letters-number (or (and arg (prefix-numeric-value arg))
+ 0))
+ (mc/for-each-cursor-ordered
+ (mc/execute-command-for-fake-cursor 'mc--insert-letter-and-increase cursor)))
+
+(defun mc--number-to-letters (number)
+ (let ((letter
+ (char-to-string
+ (+ (mod number 26) ?a)))
+ (number2 (/ number 26)))
+ (if (> number2 0)
+ (concat (mc--number-to-letters (- number2 1)) letter)
+ letter)))
+
+(defun mc--insert-letter-and-increase ()
+ (interactive)
+ (insert (mc--number-to-letters mc--insert-letters-number))
+ (setq mc--insert-letters-number (1+ mc--insert-letters-number)))
+
+(defvar mc--strings-to-replace nil)
+
+(defun mc--replace-region-strings-1 ()
+ (interactive)
+ (delete-region (region-beginning) (region-end))
+ (save-excursion (insert (car mc--strings-to-replace)))
+ (setq mc--strings-to-replace (cdr mc--strings-to-replace)))
+
+(defun mc--replace-region-strings ()
+ (mc/for-each-cursor-ordered
+ (mc/execute-command-for-fake-cursor 'mc--replace-region-strings-1 cursor)))
+
+;;;###autoload
+(defun mc/reverse-regions ()
+ (interactive)
+ (if (not multiple-cursors-mode)
+ (progn
+ (mc/mark-next-lines 1)
+ (mc/reverse-regions)
+ (mc/disable-multiple-cursors-mode)
+ )
+ (unless (use-region-p)
+ (mc/execute-command-for-all-cursors 'mark-sexp))
+ (setq mc--strings-to-replace (nreverse (mc--ordered-region-strings)))
+ (mc--replace-region-strings)))
+
+;;;###autoload
+(defun mc/sort-regions ()
+ (interactive)
+ (unless (use-region-p)
+ (mc/execute-command-for-all-cursors 'mark-sexp))
+ (setq mc--strings-to-replace (sort (mc--ordered-region-strings) 'string<))
+ (mc--replace-region-strings))
+
+
+;;;###autoload
+(defun mc/vertical-align (character)
+ "Aligns all cursors vertically with a given CHARACTER to the one with the
+highest column number (the rightest).
+Might not behave as intended if more than one cursors are on the same line."
+ (interactive "c")
+ (let ((rightest-column (current-column)))
+ (mc/execute-command-for-all-cursors
+ (lambda () "get the rightest cursor"
+ (interactive)
+ (setq rightest-column (max (current-column) rightest-column))
+ ))
+ (mc/execute-command-for-all-cursors
+ (lambda ()
+ (interactive)
+ (let ((missing-spaces (- rightest-column (current-column))))
+ (save-excursion (insert (make-string missing-spaces character)))
+ (forward-char missing-spaces))))))
+
+;;;###autoload
+(defun mc/vertical-align-with-space ()
+ "Aligns all cursors with whitespace like `mc/vertical-align' does"
+ (interactive)
+ (mc/vertical-align 32))
+
+(provide 'mc-separate-operations)
+;;; mc-separate-operations.el ends here
diff --git a/elpa/multiple-cursors-20220328.1724/mc-separate-operations.elc b/elpa/multiple-cursors-20220328.1724/mc-separate-operations.elc
new file mode 100644
index 0000000..c8e7388
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/mc-separate-operations.elc
Binary files differ
diff --git a/elpa/multiple-cursors-20220328.1724/multiple-cursors-autoloads.el b/elpa/multiple-cursors-20220328.1724/multiple-cursors-autoloads.el
new file mode 100644
index 0000000..cebc696
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/multiple-cursors-autoloads.el
@@ -0,0 +1,388 @@
+;;; multiple-cursors-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*-
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "mc-cycle-cursors" "mc-cycle-cursors.el" (0
+;;;;;; 0 0 0))
+;;; Generated autoloads from mc-cycle-cursors.el
+
+(register-definition-prefixes "mc-cycle-cursors" '("mc/"))
+
+;;;***
+
+;;;### (autoloads nil "mc-edit-lines" "mc-edit-lines.el" (0 0 0 0))
+;;; Generated autoloads from mc-edit-lines.el
+
+(autoload 'mc/edit-lines "mc-edit-lines" "\
+Add one cursor to each line of the active region.
+Starts from mark and moves in straight down or up towards the
+line point is on.
+
+What is done with lines which are not long enough is governed by
+`mc/edit-lines-empty-lines'. The prefix argument ARG can be used
+to override this. If ARG is a symbol (when called from Lisp),
+that symbol is used instead of `mc/edit-lines-empty-lines'.
+Otherwise, if ARG negative, short lines will be ignored. Any
+other non-nil value will cause short lines to be padded.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'mc/edit-ends-of-lines "mc-edit-lines" "\
+Add one cursor to the end of each line in the active region." t nil)
+
+(autoload 'mc/edit-beginnings-of-lines "mc-edit-lines" "\
+Add one cursor to the beginning of each line in the active region." t nil)
+
+(register-definition-prefixes "mc-edit-lines" '("mc/edit-lines-empty-lines"))
+
+;;;***
+
+;;;### (autoloads nil "mc-hide-unmatched-lines-mode" "mc-hide-unmatched-lines-mode.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from mc-hide-unmatched-lines-mode.el
+
+(autoload 'mc-hide-unmatched-lines-mode "mc-hide-unmatched-lines-mode" "\
+Minor mode when enabled hides all lines where no cursors (and
+also hum/lines-to-expand below and above) To make use of this
+mode press \"C-'\" while multiple-cursor-mode is active. You can
+still edit lines while you are in mc-hide-unmatched-lines
+mode. To leave this mode press <return> or \"C-g\"
+
+This is a minor mode. If called interactively, toggle the
+`Mc-Hide-Unmatched-Lines mode' mode. If the prefix argument is
+positive, enable the mode, and if it is zero or negative, disable
+the mode.
+
+If called from Lisp, toggle the mode if ARG is `toggle'. Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+To check whether the minor mode is enabled in the current buffer,
+evaluate `mc-hide-unmatched-lines-mode'.
+
+The mode's hook is called both when the mode is enabled and when
+it is disabled.
+
+\(fn &optional ARG)" t nil)
+
+(register-definition-prefixes "mc-hide-unmatched-lines-mode" '("hum/"))
+
+;;;***
+
+;;;### (autoloads nil "mc-mark-more" "mc-mark-more.el" (0 0 0 0))
+;;; Generated autoloads from mc-mark-more.el
+
+(autoload 'mc/mark-next-like-this "mc-mark-more" "\
+Find and mark the next part of the buffer matching the currently active region
+If no region is active add a cursor on the next line
+With negative ARG, delete the last one instead.
+With zero ARG, skip the last one and mark next.
+
+\(fn ARG)" t nil)
+
+(autoload 'mc/mark-next-like-this-word "mc-mark-more" "\
+Find and mark the next part of the buffer matching the currently active region
+If no region is active, mark the word at the point and find the next match
+With negative ARG, delete the last one instead.
+With zero ARG, skip the last one and mark next.
+
+\(fn ARG)" t nil)
+
+(autoload 'mc/mark-next-word-like-this "mc-mark-more" "\
+Find and mark the next word of the buffer matching the currently active region
+The matching region must be a whole word to be a match
+If no region is active add a cursor on the next line
+With negative ARG, delete the last one instead.
+With zero ARG, skip the last one and mark next.
+
+\(fn ARG)" t nil)
+
+(autoload 'mc/mark-next-symbol-like-this "mc-mark-more" "\
+Find and mark the next symbol of the buffer matching the currently active region
+The matching region must be a whole symbol to be a match
+If no region is active add a cursor on the next line
+With negative ARG, delete the last one instead.
+With zero ARG, skip the last one and mark next.
+
+\(fn ARG)" t nil)
+
+(autoload 'mc/mark-previous-like-this "mc-mark-more" "\
+Find and mark the previous part of the buffer matching the
+currently active region.
+
+If no region is active ,add a cursor on the previous line.
+
+With negative ARG, delete the last one instead.
+
+With zero ARG, skip the last one and mark next.
+
+\(fn ARG)" t nil)
+
+(autoload 'mc/mark-previous-like-this-word "mc-mark-more" "\
+Find and mark the previous part of the buffer matching the
+currently active region.
+
+If no region is active, mark the word at the point and find the
+previous match.
+
+With negative ARG, delete the last one instead.
+
+With zero ARG, skip the last one and mark previous.
+
+\(fn ARG)" t nil)
+
+(autoload 'mc/mark-previous-word-like-this "mc-mark-more" "\
+Find and mark the previous part of the buffer matching the
+currently active region.
+
+The matching region must be a whole word to be a match.
+
+If no region is active, add a cursor on the previous line.
+
+With negative ARG, delete the last one instead.
+
+With zero ARG, skip the last one and mark next.
+
+\(fn ARG)" t nil)
+
+(autoload 'mc/mark-previous-symbol-like-this "mc-mark-more" "\
+Find and mark the previous part of the buffer matching
+the currently active region.
+
+The matching region must be a whole symbol to be a match.
+
+If no region is active add a cursor on the previous line.
+
+With negative ARG, delete the last one instead.
+
+With zero ARG, skip the last one and mark next.
+
+\(fn ARG)" t nil)
+
+(autoload 'mc/mark-next-lines "mc-mark-more" "\
+
+
+\(fn ARG)" t nil)
+
+(autoload 'mc/mark-previous-lines "mc-mark-more" "\
+
+
+\(fn ARG)" t nil)
+
+(autoload 'mc/unmark-next-like-this "mc-mark-more" "\
+Deselect next part of the buffer matching the currently active region." t nil)
+
+(autoload 'mc/unmark-previous-like-this "mc-mark-more" "\
+Deselect prev part of the buffer matching the currently active region." t nil)
+
+(autoload 'mc/skip-to-next-like-this "mc-mark-more" "\
+Skip the current one and select the next part of the buffer
+matching the currently active region." t nil)
+
+(autoload 'mc/skip-to-previous-like-this "mc-mark-more" "\
+Skip the current one and select the prev part of the buffer
+matching the currently active region." t nil)
+
+(autoload 'mc/mark-all-like-this "mc-mark-more" "\
+Find and mark all the parts of the buffer matching the currently active region" t nil)
+
+(autoload 'mc/mark-all-words-like-this "mc-mark-more" nil t nil)
+
+(autoload 'mc/mark-all-symbols-like-this "mc-mark-more" nil t nil)
+
+(autoload 'mc/mark-all-in-region "mc-mark-more" "\
+Find and mark all the parts in the region matching the given search
+
+\(fn BEG END &optional SEARCH)" t nil)
+
+(autoload 'mc/mark-all-in-region-regexp "mc-mark-more" "\
+Find and mark all the parts in the region matching the given regexp.
+
+\(fn BEG END)" t nil)
+
+(autoload 'mc/mark-more-like-this-extended "mc-mark-more" "\
+Like mark-more-like-this, but then lets you adjust with arrow keys.
+The adjustments work like this:
+
+ <up> Mark previous like this and set direction to 'up
+ <down> Mark next like this and set direction to 'down
+
+If direction is 'up:
+
+ <left> Skip past the cursor furthest up
+ <right> Remove the cursor furthest up
+
+If direction is 'down:
+
+ <left> Remove the cursor furthest down
+ <right> Skip past the cursor furthest down
+
+The bindings for these commands can be changed.
+See `mc/mark-more-like-this-extended-keymap'." t nil)
+
+(autoload 'mc/mark-all-like-this-dwim "mc-mark-more" "\
+Tries to guess what you want to mark all of.
+Can be pressed multiple times to increase selection.
+
+With prefix, it behaves the same as original `mc/mark-all-like-this'
+
+\(fn ARG)" t nil)
+
+(autoload 'mc/mark-all-dwim "mc-mark-more" "\
+Tries even harder to guess what you want to mark all of.
+
+If the region is active and spans multiple lines, it will behave
+as if `mc/mark-all-in-region'. With the prefix ARG, it will call
+`mc/edit-lines' instead.
+
+If the region is inactive or on a single line, it will behave like
+`mc/mark-all-like-this-dwim'.
+
+\(fn ARG)" t nil)
+
+(autoload 'mc/mark-all-like-this-in-defun "mc-mark-more" "\
+Mark all like this in defun." t nil)
+
+(autoload 'mc/mark-all-words-like-this-in-defun "mc-mark-more" "\
+Mark all words like this in defun." t nil)
+
+(autoload 'mc/mark-all-symbols-like-this-in-defun "mc-mark-more" "\
+Mark all symbols like this in defun." t nil)
+
+(autoload 'mc/toggle-cursor-on-click "mc-mark-more" "\
+Add a cursor where you click, or remove a fake cursor that is
+already there.
+
+\(fn EVENT)" t nil)
+
+(defalias 'mc/add-cursor-on-click 'mc/toggle-cursor-on-click)
+
+(autoload 'mc/mark-sgml-tag-pair "mc-mark-more" "\
+Mark the tag we're in and its pair for renaming." t nil)
+
+(register-definition-prefixes "mc-mark-more" '("mc--" "mc/"))
+
+;;;***
+
+;;;### (autoloads nil "mc-mark-pop" "mc-mark-pop.el" (0 0 0 0))
+;;; Generated autoloads from mc-mark-pop.el
+
+(autoload 'mc/mark-pop "mc-mark-pop" "\
+Add a cursor at the current point, pop off mark ring and jump
+to the popped mark." t nil)
+
+;;;***
+
+;;;### (autoloads nil "mc-separate-operations" "mc-separate-operations.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from mc-separate-operations.el
+
+(autoload 'mc/insert-numbers "mc-separate-operations" "\
+Insert increasing numbers for each cursor, starting at
+`mc/insert-numbers-default' or ARG.
+
+\(fn ARG)" t nil)
+
+(autoload 'mc/insert-letters "mc-separate-operations" "\
+Insert increasing letters for each cursor, starting at 0 or ARG.
+ Where letter[0]=a letter[2]=c letter[26]=aa
+
+\(fn ARG)" t nil)
+
+(autoload 'mc/reverse-regions "mc-separate-operations" nil t nil)
+
+(autoload 'mc/sort-regions "mc-separate-operations" nil t nil)
+
+(autoload 'mc/vertical-align "mc-separate-operations" "\
+Aligns all cursors vertically with a given CHARACTER to the one with the
+highest column number (the rightest).
+Might not behave as intended if more than one cursors are on the same line.
+
+\(fn CHARACTER)" t nil)
+
+(autoload 'mc/vertical-align-with-space "mc-separate-operations" "\
+Aligns all cursors with whitespace like `mc/vertical-align' does" t nil)
+
+(register-definition-prefixes "mc-separate-operations" '("mc--" "mc/insert-numbers-default"))
+
+;;;***
+
+;;;### (autoloads nil "multiple-cursors-core" "multiple-cursors-core.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from multiple-cursors-core.el
+
+(autoload 'multiple-cursors-mode "multiple-cursors-core" "\
+Mode while multiple cursors are active.
+
+This is a minor mode. If called interactively, toggle the
+`Multiple-Cursors mode' mode. If the prefix argument is
+positive, enable the mode, and if it is zero or negative, disable
+the mode.
+
+If called from Lisp, toggle the mode if ARG is `toggle'. Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+To check whether the minor mode is enabled in the current buffer,
+evaluate `multiple-cursors-mode'.
+
+The mode's hook is called both when the mode is enabled and when
+it is disabled.
+
+\(fn &optional ARG)" t nil)
+
+(register-definition-prefixes "multiple-cursors-core" '("activate-cursor-for-undo" "deactivate-cursor-after-undo" "multiple-cursors-mode" "unsupported-cmd"))
+
+;;;***
+
+;;;### (autoloads nil "rectangular-region-mode" "rectangular-region-mode.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from rectangular-region-mode.el
+
+(autoload 'set-rectangular-region-anchor "rectangular-region-mode" "\
+Anchors the rectangular region at point.
+
+Think of this one as `set-mark' except you're marking a
+rectangular region. It is an exceedingly quick way of adding
+multiple cursors to multiple lines." t nil)
+
+(autoload 'rectangular-region-mode "rectangular-region-mode" "\
+A mode for creating a rectangular region to edit
+
+This is a minor mode. If called interactively, toggle the
+`Rectangular-Region mode' mode. If the prefix argument is
+positive, enable the mode, and if it is zero or negative, disable
+the mode.
+
+If called from Lisp, toggle the mode if ARG is `toggle'. Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+To check whether the minor mode is enabled in the current buffer,
+evaluate `rectangular-region-mode'.
+
+The mode's hook is called both when the mode is enabled and when
+it is disabled.
+
+\(fn &optional ARG)" t nil)
+
+(register-definition-prefixes "rectangular-region-mode" '("rectangular-region-mode" "rrm/"))
+
+;;;***
+
+;;;### (autoloads nil nil ("multiple-cursors-pkg.el" "multiple-cursors.el")
+;;;;;; (0 0 0 0))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; multiple-cursors-autoloads.el ends here
diff --git a/elpa/multiple-cursors-20220328.1724/multiple-cursors-core.el b/elpa/multiple-cursors-20220328.1724/multiple-cursors-core.el
new file mode 100644
index 0000000..5103e6d
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/multiple-cursors-core.el
@@ -0,0 +1,879 @@
+;;; multiple-cursors-core.el --- An experiment in multiple cursors for emacs.
+
+;; Copyright (C) 2012-2016 Magnar Sveen
+
+;; Author: Magnar Sveen <magnars@gmail.com>
+;; Keywords: editing cursors
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file contains the core functionality of multiple-cursors.
+;; Please see multiple-cursors.el for more commentary.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'rect)
+
+(defvar mc--read-char)
+
+(defface mc/cursor-face
+ '((t (:inverse-video t)))
+ "The face used for fake cursors"
+ :group 'multiple-cursors)
+
+(defface mc/cursor-bar-face
+ `((t (:height 1 :background ,(face-attribute 'cursor :background))))
+ "The face used for fake cursors if the cursor-type is bar"
+ :group 'multiple-cursors)
+
+(defcustom mc/match-cursor-style t
+ "If non-nil, attempt to match the cursor style that the user
+has selected. Namely, use vertical bars the user has configured
+Emacs to use that cursor.
+
+If nil, just use standard rectangle cursors for all fake cursors.
+
+In some modes/themes, the bar fake cursors are either not
+rendered or shift text."
+ :type '(boolean)
+ :group 'multiple-cursors)
+
+(defface mc/region-face
+ '((t :inherit region))
+ "The face used for fake regions"
+ :group 'multiple-cursors)
+
+(defmacro mc/add-fake-cursor-to-undo-list (&rest forms)
+ "Make sure point is in the right place when undoing"
+ (let ((uc (make-symbol "undo-cleaner")))
+ `(let ((,uc (cons 'apply (cons 'deactivate-cursor-after-undo (list id)))))
+ (setq buffer-undo-list (cons ,uc buffer-undo-list))
+ ,@forms
+ (if (eq ,uc (car buffer-undo-list)) ;; if nothing has been added to the undo-list
+ (setq buffer-undo-list (cdr buffer-undo-list)) ;; then pop the cleaner right off again
+ (setq buffer-undo-list ;; otherwise add a function to activate this cursor
+ (cons (cons 'apply (cons 'activate-cursor-for-undo (list id))) buffer-undo-list))))))
+
+(defun mc/all-fake-cursors (&optional start end)
+ (cl-remove-if-not 'mc/fake-cursor-p
+ (overlays-in (or start (point-min))
+ (or end (point-max)))))
+
+(defmacro mc/for-each-fake-cursor (&rest forms)
+ "Runs the body for each fake cursor, bound to the name cursor"
+ `(mapc #'(lambda (cursor) ,@forms)
+ (mc/all-fake-cursors)))
+
+(defmacro mc/save-excursion (&rest forms)
+ "Saves and restores all the state that multiple-cursors cares about."
+ (let ((cs (make-symbol "current-state")))
+ `(let ((,cs (mc/store-current-state-in-overlay
+ (make-overlay (point) (point) nil nil t))))
+ (overlay-put ,cs 'type 'original-cursor)
+ (save-excursion ,@forms)
+ (mc/pop-state-from-overlay ,cs))))
+
+(defun mc--compare-by-overlay-start (o1 o2)
+ (< (overlay-start o1) (overlay-start o2)))
+
+(defmacro mc/for-each-cursor-ordered (&rest forms)
+ "Runs the body for each cursor, fake and real, bound to the name cursor"
+ (let ((rci (make-symbol "real-cursor-id")))
+ `(let ((,rci (overlay-get (mc/create-fake-cursor-at-point) 'mc-id)))
+ (mapc #'(lambda (cursor)
+ (when (mc/fake-cursor-p cursor)
+ ,@forms))
+ (sort (overlays-in (point-min) (point-max)) 'mc--compare-by-overlay-start))
+ (mc/pop-state-from-overlay (mc/cursor-with-id ,rci)))))
+
+(defmacro mc/save-window-scroll (&rest forms)
+ "Saves and restores the window scroll position"
+ (let ((p (make-symbol "p"))
+ (s (make-symbol "start"))
+ (h (make-symbol "hscroll")))
+ `(let ((,p (set-marker (make-marker) (point)))
+ (,s (set-marker (make-marker) (window-start)))
+ (,h (window-hscroll)))
+ ,@forms
+ (goto-char ,p)
+ (set-window-start nil ,s t)
+ (set-window-hscroll nil ,h)
+ (set-marker ,p nil)
+ (set-marker ,s nil))))
+
+(defun mc/cursor-is-bar ()
+ "Return non-nil if the cursor is a bar."
+ (or (eq cursor-type 'bar)
+ (and (listp cursor-type)
+ (eq (car cursor-type) 'bar))))
+
+(defun mc/line-number-at-pos (&optional pos absolute)
+ "Faster implementation of `line-number-at-pos'."
+ (if pos
+ (save-excursion
+ (if absolute
+ (save-restriction
+ (widen)
+ (goto-char pos)
+ (string-to-number (format-mode-line "%l")))
+ (goto-char pos)
+ (string-to-number (format-mode-line "%l"))))
+ (string-to-number (format-mode-line "%l"))))
+
+(defun mc/make-cursor-overlay-at-eol (pos)
+ "Create overlay to look like cursor at end of line."
+ (let ((overlay (make-overlay pos pos nil nil nil)))
+ (if (and mc/match-cursor-style (mc/cursor-is-bar))
+ (overlay-put overlay 'before-string (propertize "|" 'face 'mc/cursor-bar-face))
+ (overlay-put overlay 'after-string (propertize " " 'face 'mc/cursor-face)))
+ overlay))
+
+(defun mc/make-cursor-overlay-inline (pos)
+ "Create overlay to look like cursor inside text."
+ (let ((overlay (make-overlay pos (1+ pos) nil nil nil)))
+ (if (and mc/match-cursor-style (mc/cursor-is-bar))
+ (overlay-put overlay 'before-string (propertize "|" 'face 'mc/cursor-bar-face))
+ (overlay-put overlay 'face 'mc/cursor-face))
+ overlay))
+
+(defun mc/make-cursor-overlay-at-point ()
+ "Create overlay to look like cursor.
+Special case for end of line, because overlay over a newline
+highlights the entire width of the window."
+ (if (eolp)
+ (mc/make-cursor-overlay-at-eol (point))
+ (mc/make-cursor-overlay-inline (point))))
+
+(defun mc/make-region-overlay-between-point-and-mark ()
+ "Create overlay to look like active region."
+ (let ((overlay (make-overlay (mark) (point) nil nil t)))
+ (overlay-put overlay 'face 'mc/region-face)
+ (overlay-put overlay 'type 'additional-region)
+ overlay))
+
+(defvar mc/cursor-specific-vars '(transient-mark-mode
+ kill-ring
+ kill-ring-yank-pointer
+ mark-ring
+ mark-active
+ yank-undo-function
+ autopair-action
+ autopair-wrap-action
+ temporary-goal-column
+ er/history
+ dabbrev--abbrev-char-regexp
+ dabbrev--check-other-buffers
+ dabbrev--friend-buffer-list
+ dabbrev--last-abbrev-location
+ dabbrev--last-abbreviation
+ dabbrev--last-buffer
+ dabbrev--last-buffer-found
+ dabbrev--last-direction
+ dabbrev--last-expansion
+ dabbrev--last-expansion-location
+ dabbrev--last-table)
+ "A list of vars that need to be tracked on a per-cursor basis.")
+
+(defun mc/store-current-state-in-overlay (o)
+ "Store relevant info about point and mark in the given overlay."
+ (overlay-put o 'point (set-marker (make-marker) (point)))
+ (overlay-put o 'mark (set-marker (make-marker)
+ (let ((mark-even-if-inactive t))
+ (mark))))
+ (dolist (var mc/cursor-specific-vars)
+ (when (boundp var) (overlay-put o var (symbol-value var))))
+ o)
+
+(defun mc/restore-state-from-overlay (o)
+ "Restore point and mark from stored info in the given overlay."
+ (goto-char (overlay-get o 'point))
+ (set-marker (mark-marker) (overlay-get o 'mark))
+ (dolist (var mc/cursor-specific-vars)
+ (when (boundp var) (set var (overlay-get o var)))))
+
+(defun mc/remove-fake-cursor (o)
+ "Delete overlay with state, including dependent overlays and markers."
+ (set-marker (overlay-get o 'point) nil)
+ (set-marker (overlay-get o 'mark) nil)
+ (mc/delete-region-overlay o)
+ (delete-overlay o))
+
+(defun mc/pop-state-from-overlay (o)
+ "Restore the state stored in given overlay and then remove the overlay."
+ (mc/restore-state-from-overlay o)
+ (mc/remove-fake-cursor o))
+
+(defun mc/delete-region-overlay (o)
+ "Remove the dependent region overlay for a given cursor overlay."
+ (ignore-errors
+ (delete-overlay (overlay-get o 'region-overlay))))
+
+(defvar mc--current-cursor-id 0
+ "Var to store increasing id of fake cursors, used to keep track of them for undo.")
+
+(defun mc/create-cursor-id ()
+ "Returns a unique cursor id"
+ (cl-incf mc--current-cursor-id))
+
+(defvar mc--max-cursors-original nil
+ "This variable maintains the original maximum number of cursors.
+When `mc/create-fake-cursor-at-point' is called and
+`mc/max-cursors' is overridden, this value serves as a backup so
+that `mc/max-cursors' can take on a new value. When
+`mc/remove-fake-cursors' is called, the values are reset.")
+
+(defcustom mc/max-cursors nil
+ "Safety ceiling for the number of active cursors.
+If your emacs slows down or freezes when using too many cursors,
+customize this value appropriately.
+
+Cursors will be added until this value is reached, at which point
+you can either temporarily override the value or abort the
+operation entirely.
+
+If this value is nil, there is no ceiling."
+ :type '(integer)
+ :group 'multiple-cursors)
+
+(defun mc/create-fake-cursor-at-point (&optional id)
+ "Add a fake cursor and possibly a fake active region overlay
+based on point and mark.
+
+Saves the current state in the overlay
+to be restored later."
+ (unless mc--max-cursors-original
+ (setq mc--max-cursors-original mc/max-cursors))
+ (when mc/max-cursors
+ (unless (< (mc/num-cursors) mc/max-cursors)
+ (if (yes-or-no-p (format "%d active cursors. Continue? " (mc/num-cursors)))
+ (setq mc/max-cursors (read-number "Enter a new, temporary maximum: "))
+ (mc/remove-fake-cursors)
+ (error "Aborted: too many cursors"))))
+ (let ((overlay (mc/make-cursor-overlay-at-point)))
+ (overlay-put overlay 'mc-id (or id (mc/create-cursor-id)))
+ (overlay-put overlay 'type 'fake-cursor)
+ (overlay-put overlay 'priority 100)
+ (mc/store-current-state-in-overlay overlay)
+ (when (use-region-p)
+ (overlay-put overlay 'region-overlay
+ (mc/make-region-overlay-between-point-and-mark)))
+ overlay))
+
+(defun mc/execute-command (cmd)
+ "Run command, simulating the parts of the command loop that
+makes sense for fake cursors."
+ (setq this-command cmd)
+ (run-hooks 'pre-command-hook)
+ (unless (eq this-command 'ignore)
+ (call-interactively cmd))
+ (run-hooks 'post-command-hook)
+ (when deactivate-mark (deactivate-mark)))
+
+(defvar mc--executing-command-for-fake-cursor nil)
+
+(defun mc/execute-command-for-fake-cursor (cmd cursor)
+ (let ((mc--executing-command-for-fake-cursor t)
+ (id (overlay-get cursor 'mc-id))
+ (annoying-arrows-mode nil)
+ (smooth-scroll-margin 0))
+ (mc/add-fake-cursor-to-undo-list
+ (mc/pop-state-from-overlay cursor)
+ (ignore-errors
+ (mc/execute-command cmd)
+ (mc/create-fake-cursor-at-point id)))))
+
+(defun mc/execute-command-for-all-fake-cursors (cmd)
+ "Calls CMD interactively for each cursor.
+It works by moving point to the fake cursor, setting
+up the proper environment, and then removing the cursor.
+After executing the command, it sets up a new fake
+cursor with updated info."
+ (mc/save-excursion
+ (mc/save-window-scroll
+ (mc/for-each-fake-cursor
+ (save-excursion
+ (mc/execute-command-for-fake-cursor cmd cursor)))))
+ (mc--reset-read-prompts))
+
+(defun mc/execute-command-for-all-cursors (cmd)
+ "Calls CMD interactively for the real cursor and all fakes."
+ (call-interactively cmd)
+ (mc/execute-command-for-all-fake-cursors cmd))
+
+;; Intercept some reading commands so you won't have to
+;; answer them for every single cursor
+
+(defvar mc--read-char nil)
+(defvar multiple-cursors-mode nil)
+(defadvice read-char (around mc-support activate)
+ (if (not multiple-cursors-mode)
+ ad-do-it
+ (unless mc--read-char
+ (setq mc--read-char ad-do-it))
+ (setq ad-return-value mc--read-char)))
+
+(defvar mc--read-quoted-char nil)
+(defadvice read-quoted-char (around mc-support activate)
+ (if (not multiple-cursors-mode)
+ ad-do-it
+ (unless mc--read-quoted-char
+ (setq mc--read-quoted-char ad-do-it))
+ (setq ad-return-value mc--read-quoted-char)))
+
+(defun mc--reset-read-prompts ()
+ (setq mc--read-char nil)
+ (setq mc--read-quoted-char nil))
+
+(mc--reset-read-prompts)
+
+(defun mc/fake-cursor-p (o)
+ "Predicate to check if an overlay is a fake cursor"
+ (eq (overlay-get o 'type) 'fake-cursor))
+
+(defun mc/cursor-with-id (id)
+ "Find the first cursor with the given id, or nil"
+ (cl-find-if #'(lambda (o) (and (mc/fake-cursor-p o)
+ (= id (overlay-get o 'mc-id))))
+ (overlays-in (point-min) (point-max))))
+
+(defvar mc--stored-state-for-undo nil
+ "Variable to keep the state of the real cursor while undoing a fake one")
+
+(defun activate-cursor-for-undo (id)
+ "Called when undoing to temporarily activate the fake cursor
+which action is being undone."
+ (let ((cursor (mc/cursor-with-id id)))
+ (when cursor
+ (setq mc--stored-state-for-undo (mc/store-current-state-in-overlay
+ (make-overlay (point) (point) nil nil t)))
+ (mc/pop-state-from-overlay cursor))))
+
+(defun deactivate-cursor-after-undo (id)
+ "Called when undoing to reinstate the real cursor after undoing a fake one."
+ (when mc--stored-state-for-undo
+ (mc/create-fake-cursor-at-point id)
+ (mc/pop-state-from-overlay mc--stored-state-for-undo)
+ (setq mc--stored-state-for-undo nil)))
+
+(defcustom mc/always-run-for-all nil
+ "Disables whitelisting and always executes commands for every fake cursor."
+ :type '(boolean)
+ :group 'multiple-cursors)
+
+(defcustom mc/always-repeat-command nil
+ "Disables confirmation for `mc/repeat-command' command."
+ :type '(boolean)
+ :group 'multiple-cursors)
+
+(defun mc/prompt-for-inclusion-in-whitelist (original-command)
+ "Asks the user, then adds the command either to the once-list or the all-list."
+ (let ((all-p (y-or-n-p (format "Do %S for all cursors?" original-command))))
+ (if all-p
+ (add-to-list 'mc/cmds-to-run-for-all original-command)
+ (add-to-list 'mc/cmds-to-run-once original-command))
+ (mc/save-lists)
+ all-p))
+
+(defun mc/num-cursors ()
+ "The number of cursors (real and fake) in the buffer."
+ (1+ (cl-count-if 'mc/fake-cursor-p
+ (overlays-in (point-min) (point-max)))))
+
+(defvar mc--this-command nil
+ "Used to store the original command being run.")
+(make-variable-buffer-local 'mc--this-command)
+
+(defun mc/make-a-note-of-the-command-being-run ()
+ "Used with pre-command-hook to store the original command being run.
+Since that cannot be reliably determined in the post-command-hook.
+
+Specifically, this-original-command isn't always right, because it could have
+been remapped. And certain modes (cua comes to mind) will change their
+remapping based on state. So a command that changes the state will afterwards
+not be recognized through the command-remapping lookup."
+ (unless mc--executing-command-for-fake-cursor
+ (let ((cmd (or (command-remapping this-original-command)
+ this-original-command)))
+ (setq mc--this-command (and (not (eq cmd 'god-mode-self-insert))
+ cmd)))))
+
+(defun mc/execute-this-command-for-all-cursors ()
+ "Wrap around `mc/execute-this-command-for-all-cursors-1' to protect hook."
+ (condition-case error
+ (mc/execute-this-command-for-all-cursors-1)
+ (error
+ (message "[mc] problem in `mc/execute-this-command-for-all-cursors': %s"
+ (error-message-string error)))))
+
+;; execute-kbd-macro should never be run for fake cursors. The real cursor will
+;; execute the keyboard macro, resulting in new commands in the command loop,
+;; and the fake cursors can pick up on those instead.
+(defadvice execute-kbd-macro (around skip-fake-cursors activate)
+ (unless mc--executing-command-for-fake-cursor
+ ad-do-it))
+
+(defun mc/execute-this-command-for-all-cursors-1 ()
+ "Used with post-command-hook to execute supported commands for all cursors.
+
+It uses two lists of commands to know what to do: the run-once
+list and the run-for-all list. If a command is in neither of these lists,
+it will prompt for the proper action and then save that preference.
+
+Some commands are so unsupported that they are even prevented for
+the original cursor, to inform about the lack of support."
+ (unless mc--executing-command-for-fake-cursor
+
+ (if (eq 1 (mc/num-cursors)) ;; no fake cursors? disable mc-mode
+ (mc/disable-multiple-cursors-mode)
+ (when this-original-command
+ (let ((original-command (or mc--this-command
+ (command-remapping this-original-command)
+ this-original-command)))
+
+ ;; skip keyboard macros, since they will generate actual commands that are
+ ;; also run in the command loop - we'll handle those later instead.
+ (when (functionp original-command)
+
+ ;; if it's a lambda, we can't know if it's supported or not
+ ;; - so go ahead and assume it's ok, because we're just optimistic like that
+ (if (or (not (symbolp original-command))
+ ;; lambda registered by smartrep
+ (string-prefix-p "(" (symbol-name original-command)))
+ (mc/execute-command-for-all-fake-cursors original-command)
+
+ ;; smartrep `intern's commands into own obarray to help
+ ;; `describe-bindings'. So, let's re-`intern' here to
+ ;; make the command comparable by `eq'.
+ (setq original-command (intern (symbol-name original-command)))
+
+ ;; otherwise it's a symbol, and we can be more thorough
+ (if (get original-command 'mc--unsupported)
+ (message "%S is not supported with multiple cursors%s"
+ original-command
+ (get original-command 'mc--unsupported))
+
+ ;; lazy-load the user's list file
+ (mc/load-lists)
+
+ (when (and original-command
+ (not (memq original-command mc--default-cmds-to-run-once))
+ (not (memq original-command mc/cmds-to-run-once))
+ (or mc/always-run-for-all
+ (memq original-command mc--default-cmds-to-run-for-all)
+ (memq original-command mc/cmds-to-run-for-all)
+ (mc/prompt-for-inclusion-in-whitelist original-command)))
+ (mc/execute-command-for-all-fake-cursors original-command))))))))))
+
+(defun mc/remove-fake-cursors ()
+ "Remove all fake cursors.
+Do not use to conclude editing with multiple cursors. For that
+you should disable multiple-cursors-mode."
+ (mc/for-each-fake-cursor
+ (mc/remove-fake-cursor cursor))
+ (when mc--max-cursors-original
+ (setq mc/max-cursors mc--max-cursors-original))
+ (setq mc--max-cursors-original nil))
+
+(defun mc/keyboard-quit ()
+ "Deactivate mark if there are any active, otherwise exit multiple-cursors-mode."
+ (interactive)
+ (if (not (use-region-p))
+ (mc/disable-multiple-cursors-mode)
+ (deactivate-mark)))
+
+(defun mc/repeat-command ()
+ "Run last command from `command-history' for every fake cursor."
+ (interactive)
+ (when (or mc/always-repeat-command
+ (y-or-n-p (format "[mc] repeat complex command: %s? " (caar command-history))))
+ (mc/execute-command-for-all-fake-cursors
+ (lambda () (interactive)
+ (cl-letf (((symbol-function 'read-from-minibuffer)
+ (lambda (p &optional i k r h d m) (read i))))
+ (repeat-complex-command 0))))))
+
+(defvar mc/keymap nil
+ "Keymap while multiple cursors are active.
+Main goal of the keymap is to rebind C-g and <return> to conclude
+multiple cursors editing.")
+(unless mc/keymap
+ (setq mc/keymap (make-sparse-keymap))
+ (define-key mc/keymap (kbd "C-g") 'mc/keyboard-quit)
+ (define-key mc/keymap (kbd "<return>") 'multiple-cursors-mode)
+ (define-key mc/keymap (kbd "C-:") 'mc/repeat-command)
+ (when (fboundp 'phi-search)
+ (define-key mc/keymap (kbd "C-s") 'phi-search))
+ (when (fboundp 'phi-search-backward)
+ (define-key mc/keymap (kbd "C-r") 'phi-search-backward)))
+
+(defun mc--all-equal (list)
+ "Are all the items in LIST equal?"
+ (let ((first (car list))
+ (all-equal t))
+ (while (and all-equal list)
+ (setq all-equal (equal first (car list)))
+ (setq list (cdr list)))
+ all-equal))
+
+(defun mc--kill-ring-entries ()
+ "Return the latest kill-ring entry for each cursor.
+The entries are returned in the order they are found in the buffer."
+ (let (entries)
+ (mc/for-each-cursor-ordered
+ (setq entries (cons (car (overlay-get cursor 'kill-ring)) entries)))
+ (reverse entries)))
+
+(defun mc--maybe-set-killed-rectangle ()
+ "Add the latest kill-ring entry for each cursor to killed-rectangle.
+So you can paste it in later with `yank-rectangle'."
+ (let ((entries (let (mc/max-cursors) (mc--kill-ring-entries))))
+ (unless (mc--all-equal entries)
+ (setq killed-rectangle entries))))
+
+(defvar mc/unsupported-minor-modes '(company-mode auto-complete-mode flyspell-mode jedi-mode)
+ "List of minor-modes that does not play well with multiple-cursors.
+They are temporarily disabled when multiple-cursors are active.")
+
+(defvar mc/temporarily-disabled-minor-modes nil
+ "The list of temporarily disabled minor-modes.")
+(make-variable-buffer-local 'mc/temporarily-disabled-minor-modes)
+
+(defun mc/temporarily-disable-minor-mode (mode)
+ "If MODE is available and turned on, remember that and turn it off."
+ (when (and (boundp mode) (eval mode))
+ (add-to-list 'mc/temporarily-disabled-minor-modes mode)
+ (funcall mode -1)))
+
+(defun mc/temporarily-disable-unsupported-minor-modes ()
+ (mapc 'mc/temporarily-disable-minor-mode mc/unsupported-minor-modes))
+
+(defun mc/enable-minor-mode (mode)
+ (funcall mode 1))
+
+(defun mc/enable-temporarily-disabled-minor-modes ()
+ (mapc 'mc/enable-minor-mode mc/temporarily-disabled-minor-modes)
+ (setq mc/temporarily-disabled-minor-modes nil))
+
+(defcustom mc/mode-line
+ `(" mc:" (:eval (format ,(propertize "%d" 'face 'font-lock-warning-face)
+ (mc/num-cursors))))
+ "What to display in the mode line while multiple-cursors-mode is active."
+ :type '(sexp)
+ :group 'multiple-cursors)
+(put 'mc/mode-line 'risky-local-variable t)
+
+;;;###autoload
+(define-minor-mode multiple-cursors-mode
+ "Mode while multiple cursors are active."
+ :init-value nil
+ :lighter mc/mode-line
+ :keymap mc/keymap
+ (if multiple-cursors-mode
+ (progn
+ (mc/temporarily-disable-unsupported-minor-modes)
+ (add-hook 'pre-command-hook 'mc/make-a-note-of-the-command-being-run nil t)
+ (add-hook 'post-command-hook 'mc/execute-this-command-for-all-cursors t t)
+ (run-hooks 'multiple-cursors-mode-enabled-hook))
+ (remove-hook 'post-command-hook 'mc/execute-this-command-for-all-cursors t)
+ (remove-hook 'pre-command-hook 'mc/make-a-note-of-the-command-being-run t)
+ (setq mc--this-command nil)
+ (mc--maybe-set-killed-rectangle)
+ (mc/remove-fake-cursors)
+ (mc/enable-temporarily-disabled-minor-modes)
+ (run-hooks 'multiple-cursors-mode-disabled-hook)))
+
+(defun mc/disable-multiple-cursors-mode ()
+ "Disable multiple-cursors-mode and run the corresponding hook."
+ (multiple-cursors-mode 0)
+ (run-hooks 'multiple-cursors-mode-disabled-hook))
+
+(add-hook 'after-revert-hook 'mc/disable-multiple-cursors-mode)
+
+(defun mc/maybe-multiple-cursors-mode ()
+ "Enable multiple-cursors-mode if there is more than one currently active cursor."
+ (if (> (mc/num-cursors) 1)
+ (multiple-cursors-mode 1)
+ (mc/disable-multiple-cursors-mode)))
+
+(defmacro unsupported-cmd (cmd msg)
+ "Adds command to list of unsupported commands and prevents it
+from being executed if in multiple-cursors-mode."
+ `(progn
+ (put (quote ,cmd) 'mc--unsupported ,msg)
+ (defadvice ,cmd (around unsupported-advice activate)
+ "command isn't supported with multiple cursors"
+ (unless (and multiple-cursors-mode (called-interactively-p 'any))
+ ad-do-it))))
+
+;; Commands that does not work with multiple-cursors
+(unsupported-cmd isearch-forward ". Feel free to add a compatible version.")
+(unsupported-cmd isearch-backward ". Feel free to add a compatible version.")
+
+;; Make sure pastes from other programs are added to all kill-rings when yanking
+(defadvice current-kill (before interprogram-paste-for-all-cursors
+ (n &optional do-not-move) activate)
+ (let ((interprogram-paste (and (= n 0)
+ interprogram-paste-function
+ (funcall interprogram-paste-function))))
+ (when interprogram-paste
+ ;; Add interprogram-paste to normal kill ring, just
+ ;; like current-kill usually does for itself.
+ ;; We have to do the work for it though, since the funcall only returns
+ ;; something once. It is not a pure function.
+ (let ((interprogram-cut-function nil))
+ (if (listp interprogram-paste)
+ (mapc 'kill-new (nreverse interprogram-paste))
+ (kill-new interprogram-paste))
+ ;; And then add interprogram-paste to the kill-rings
+ ;; of all the other cursors too.
+ (mc/for-each-fake-cursor
+ (let ((kill-ring (overlay-get cursor 'kill-ring))
+ (kill-ring-yank-pointer (overlay-get cursor 'kill-ring-yank-pointer)))
+ (if (listp interprogram-paste)
+ (mapc 'kill-new (nreverse interprogram-paste))
+ (kill-new interprogram-paste))
+ (overlay-put cursor 'kill-ring kill-ring)
+ (overlay-put cursor 'kill-ring-yank-pointer kill-ring-yank-pointer)))))))
+
+(defcustom mc/list-file (locate-user-emacs-file ".mc-lists.el")
+ "The position of the file that keeps track of your preferences
+for running commands with multiple cursors."
+ :type 'file
+ :group 'multiple-cursors)
+
+(defvar mc--list-file-loaded nil
+ "Whether the list file has already been loaded.")
+
+(defun mc/load-lists ()
+ "Loads preferences for running commands with multiple cursors from `mc/list-file'"
+ (unless mc--list-file-loaded
+ (load mc/list-file 'noerror 'nomessage)
+ (setq mc--list-file-loaded t)))
+
+(defun mc/dump-list (list-symbol)
+ "Insert (setq 'LIST-SYMBOL LIST-VALUE) to current buffer."
+ (cl-symbol-macrolet ((value (symbol-value list-symbol)))
+ (insert "(setq " (symbol-name list-symbol) "\n"
+ " '(")
+ (newline-and-indent)
+ (set list-symbol
+ (sort value (lambda (x y) (string-lessp (symbol-name x)
+ (symbol-name y)))))
+ (mapc #'(lambda (cmd) (insert (format "%S" cmd)) (newline-and-indent))
+ value)
+ (insert "))")
+ (newline)))
+
+(defun mc/save-lists ()
+ "Saves preferences for running commands with multiple cursors to `mc/list-file'"
+ (with-temp-file mc/list-file
+ (emacs-lisp-mode)
+ (insert ";; This file is automatically generated by the multiple-cursors extension.")
+ (newline)
+ (insert ";; It keeps track of your preferences for running commands with multiple cursors.")
+ (newline)
+ (newline)
+ (mc/dump-list 'mc/cmds-to-run-for-all)
+ (newline)
+ (mc/dump-list 'mc/cmds-to-run-once)))
+
+(defvar mc/cmds-to-run-once nil
+ "Commands to run only once in multiple-cursors-mode.")
+
+(defvar mc--default-cmds-to-run-once nil
+ "Default set of commands to run only once in multiple-cursors-mode.")
+
+(setq mc--default-cmds-to-run-once '(mc/edit-lines
+ mc/edit-ends-of-lines
+ mc/edit-beginnings-of-lines
+ mc/mark-next-like-this
+ mc/mark-next-like-this-word
+ mc/mark-next-like-this-symbol
+ mc/mark-next-word-like-this
+ mc/mark-next-symbol-like-this
+ mc/mark-previous-like-this
+ mc/mark-previous-like-this-word
+ mc/mark-previous-like-this-symbol
+ mc/mark-previous-word-like-this
+ mc/mark-previous-symbol-like-this
+ mc/mark-all-like-this
+ mc/mark-all-words-like-this
+ mc/mark-all-symbols-like-this
+ mc/mark-more-like-this-extended
+ mc/mark-all-like-this-in-defun
+ mc/mark-all-words-like-this-in-defun
+ mc/mark-all-symbols-like-this-in-defun
+ mc/mark-all-like-this-dwim
+ mc/mark-all-dwim
+ mc/mark-sgml-tag-pair
+ mc/insert-numbers
+ mc/insert-letters
+ mc/sort-regions
+ mc/reverse-regions
+ mc/cycle-forward
+ mc/cycle-backward
+ mc/add-cursor-on-click
+ mc/mark-pop
+ mc/add-cursors-to-all-matches
+ mc/mmlte--left
+ mc/mmlte--right
+ mc/mmlte--up
+ mc/mmlte--down
+ mc/unmark-next-like-this
+ mc/unmark-previous-like-this
+ mc/skip-to-next-like-this
+ mc/skip-to-previous-like-this
+ rrm/switch-to-multiple-cursors
+ mc-hide-unmatched-lines-mode
+ mc/repeat-command
+ hum/keyboard-quit
+ hum/unhide-invisible-overlays
+ save-buffer
+ ido-exit-minibuffer
+ ivy-done
+ exit-minibuffer
+ minibuffer-complete-and-exit
+ execute-extended-command
+ eval-expression
+ undo
+ redo
+ undo-tree-undo
+ undo-tree-redo
+ universal-argument
+ universal-argument-more
+ universal-argument-other-key
+ negative-argument
+ digit-argument
+ top-level
+ recenter-top-bottom
+ describe-mode
+ describe-key-1
+ describe-function
+ describe-bindings
+ describe-prefix-bindings
+ view-echo-area-messages
+ other-window
+ kill-buffer-and-window
+ split-window-right
+ split-window-below
+ delete-other-windows
+ toggle-window-split
+ mwheel-scroll
+ scroll-up-command
+ scroll-down-command
+ mouse-set-point
+ mouse-drag-region
+ quit-window
+ toggle-read-only
+ windmove-left
+ windmove-right
+ windmove-up
+ windmove-down
+ repeat-complex-command))
+
+(defvar mc--default-cmds-to-run-for-all nil
+ "Default set of commands that should be mirrored by all cursors")
+
+(setq mc--default-cmds-to-run-for-all '(mc/keyboard-quit
+ self-insert-command
+ quoted-insert
+ previous-line
+ next-line
+ newline
+ newline-and-indent
+ open-line
+ delete-blank-lines
+ transpose-chars
+ transpose-lines
+ transpose-paragraphs
+ transpose-regions
+ join-line
+ right-char
+ right-word
+ forward-char
+ forward-word
+ left-char
+ left-word
+ backward-char
+ backward-word
+ forward-paragraph
+ backward-paragraph
+ upcase-word
+ downcase-word
+ capitalize-word
+ forward-list
+ backward-list
+ hippie-expand
+ hippie-expand-lines
+ yank
+ yank-pop
+ append-next-kill
+ kill-word
+ kill-line
+ kill-whole-line
+ backward-kill-word
+ backward-delete-char-untabify
+ delete-char delete-forward-char
+ delete-backward-char
+ py-electric-backspace
+ c-electric-backspace
+ org-delete-backward-char
+ cperl-electric-backspace
+ python-indent-dedent-line-backspace
+ paredit-backward-delete
+ autopair-backspace
+ just-one-space
+ zap-to-char
+ end-of-line
+ set-mark-command
+ exchange-point-and-mark
+ cua-set-mark
+ cua-replace-region
+ cua-delete-region
+ move-end-of-line
+ beginning-of-line
+ move-beginning-of-line
+ kill-ring-save
+ back-to-indentation
+ subword-forward
+ subword-backward
+ subword-mark
+ subword-kill
+ subword-backward-kill
+ subword-transpose
+ subword-capitalize
+ subword-upcase
+ subword-downcase
+ er/expand-region
+ er/contract-region
+ smart-forward
+ smart-backward
+ smart-up
+ smart-down))
+
+(defvar mc/cmds-to-run-for-all nil
+ "Commands to run for all cursors in multiple-cursors-mode")
+
+(provide 'multiple-cursors-core)
+(require 'mc-cycle-cursors)
+(require 'mc-hide-unmatched-lines-mode)
+
+;; Local Variables:
+;; coding: utf-8
+;; End:
+
+;;; multiple-cursors-core.el ends here
diff --git a/elpa/multiple-cursors-20220328.1724/multiple-cursors-core.elc b/elpa/multiple-cursors-20220328.1724/multiple-cursors-core.elc
new file mode 100644
index 0000000..77f4fcb
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/multiple-cursors-core.elc
Binary files differ
diff --git a/elpa/multiple-cursors-20220328.1724/multiple-cursors-pkg.el b/elpa/multiple-cursors-20220328.1724/multiple-cursors-pkg.el
new file mode 100644
index 0000000..06504de
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/multiple-cursors-pkg.el
@@ -0,0 +1,12 @@
+(define-package "multiple-cursors" "20220328.1724" "Multiple cursors for Emacs."
+ '((cl-lib "0.5"))
+ :commit "aae47aebc0ae829211fa1e923232715d8e327b36" :authors
+ '(("Magnar Sveen" . "magnars@gmail.com"))
+ :maintainer
+ '("Magnar Sveen" . "magnars@gmail.com")
+ :keywords
+ '("editing" "cursors")
+ :url "https://github.com/magnars/multiple-cursors.el")
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/elpa/multiple-cursors-20220328.1724/multiple-cursors.el b/elpa/multiple-cursors-20220328.1724/multiple-cursors.el
new file mode 100644
index 0000000..22430a5
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/multiple-cursors.el
@@ -0,0 +1,202 @@
+;;; multiple-cursors.el --- Multiple cursors for emacs.
+
+;; Copyright (C) 2012-2016 Magnar Sveen
+
+;; Author: Magnar Sveen <magnars@gmail.com>
+;; Version: 1.4.0
+;; Keywords: editing cursors
+;; Homepage: https://github.com/magnars/multiple-cursors.el
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Multiple cursors for Emacs. This is some pretty crazy functionality, so yes,
+;; there are kinks. Don't be afraid though, I've been using it since 2011 with
+;; great success and much merriment.
+
+;; ## Basic usage
+
+;; Start out with:
+
+;; (require 'multiple-cursors)
+
+;; Then you have to set up your keybindings - multiple-cursors doesn't presume to
+;; know how you'd like them laid out. Here are some examples:
+
+;; When you have an active region that spans multiple lines, the following will
+;; add a cursor to each line:
+
+;; (global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
+
+;; When you want to add multiple cursors not based on continuous lines, but based on
+;; keywords in the buffer, use:
+
+;; (global-set-key (kbd "C->") 'mc/mark-next-like-this)
+;; (global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
+;; (global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
+
+;; First mark the word, then add more cursors.
+
+;; To get out of multiple-cursors-mode, press `<return>` or `C-g`. The latter will
+;; first disable multiple regions before disabling multiple cursors. If you want to
+;; insert a newline in multiple-cursors-mode, use `C-j`.
+
+;; ## Video
+
+;; You can [watch an intro to multiple-cursors at Emacs Rocks](http://emacsrocks.com/e13.html).
+
+;; ## Command overview
+
+;; ### Mark one more occurrence
+
+;; - `mc/mark-next-like-this`: Adds a cursor and region at the next part of the buffer forwards that matches the current region.
+;; - `mc/mark-next-like-this-word`: Adds a cursor and region at the next part of the buffer forwards that matches the current region, if no region is selected it selects the word at the point.
+;; - `mc/mark-next-like-this-symbol`: Adds a cursor and region at the next part of the buffer forwards that matches the current region, if no region is selected it selects the symbol at the point.
+;; - `mc/mark-next-word-like-this`: Like `mc/mark-next-like-this` but only for whole words.
+;; - `mc/mark-next-symbol-like-this`: Like `mc/mark-next-like-this` but only for whole symbols.
+;; - `mc/mark-previous-like-this`: Adds a cursor and region at the next part of the buffer backwards that matches the current region.
+;; - `mc/mark-previous-word-like-this`: Like `mc/mark-previous-like-this` but only for whole words.
+;; - `mc/mark-previous-symbol-like-this`: Like `mc/mark-previous-like-this` but only for whole symbols.
+;; - `mc/mark-more-like-this-extended`: Use arrow keys to quickly mark/skip next/previous occurrences.
+;; - `mc/add-cursor-on-click`: Bind to a mouse event to add cursors by clicking. See tips-section.
+
+;; ### Mark many occurrences
+
+;; - `mc/mark-all-like-this`: Marks all parts of the buffer that matches the current region.
+;; - `mc/mark-all-words-like-this`: Like `mc/mark-all-like-this` but only for whole words.
+;; - `mc/mark-all-symbols-like-this`: Like `mc/mark-all-like-this` but only for whole symbols.
+;; - `mc/mark-all-in-region`: Prompts for a string to match in the region, adding cursors to all of them.
+;; - `mc/mark-all-like-this-in-defun`: Marks all parts of the current defun that matches the current region.
+;; - `mc/mark-all-words-like-this-in-defun`: Like `mc/mark-all-like-this-in-defun` but only for whole words.
+;; - `mc/mark-all-symbols-like-this-in-defun`: Like `mc/mark-all-like-this-in-defun` but only for whole symbols.
+;; - `mc/mark-all-like-this-dwim`: Tries to be smart about marking everything you want. Can be pressed multiple times.
+
+;; ### Special
+
+;; - `set-rectangular-region-anchor`: Think of this one as `set-mark` except you're marking a rectangular region.
+;; - `mc/mark-sgml-tag-pair`: Mark the current opening and closing tag.
+;; - `mc/insert-numbers`: Insert increasing numbers for each cursor, top to bottom.
+;; - `mc/insert-letters`: Insert increasing letters for each cursor, top to bottom.
+;; - `mc/sort-regions`: Sort the marked regions alphabetically.
+;; - `mc/reverse-regions`: Reverse the order of the marked regions.
+
+;; ## Tips and tricks
+
+;; - To get out of multiple-cursors-mode, press `<return>` or `C-g`. The latter will
+;; first disable multiple regions before disabling multiple cursors. If you want to
+;; insert a newline in multiple-cursors-mode, use `C-j`.
+;;
+;; - Sometimes you end up with cursors outside of your view. You can
+;; scroll the screen to center on each cursor with `C-v` and `M-v`.
+;;
+;; - Try pressing `mc/mark-next-like-this` with no region selected. It will just add a cursor
+;; on the next line.
+;;
+;; - Try pressing `mc/mark-next-like-this-word` or
+;; `mc/mark-next-like-this-symbol` with no region selected. It will
+;; mark the symbol and add a cursor at the next occurrence
+;;
+;; - Try pressing `mc/mark-all-like-this-dwim` on a tagname in html-mode.
+;;
+;; - Notice that the number of cursors active can be seen in the modeline.
+;;
+;; - If you get out of multiple-cursors-mode and yank - it will yank only
+;; from the kill-ring of main cursor. To yank from the kill-rings of
+;; every cursor use yank-rectangle, normally found at C-x r y.
+;;
+;; - You can use `mc/reverse-regions` with nothing selected and just one cursor.
+;; It will then flip the sexp at point and the one below it.
+;;
+;; - If you would like to keep the global bindings clean, and get custom keybindings
+;; when the region is active, you can try [region-bindings-mode](https://github.com/fgallina/region-bindings-mode).
+;;
+;; BTW, I highly recommend adding `mc/mark-next-like-this` to a key binding that's
+;; right next to the key for `er/expand-region`.
+
+;; ### Binding mouse events
+
+;; To override a mouse event, you will likely have to also unbind the
+;; `down-mouse` part of the event. Like this:
+;;
+;; (global-unset-key (kbd "M-<down-mouse-1>"))
+;; (global-set-key (kbd "M-<mouse-1>") 'mc/add-cursor-on-click)
+;;
+;; Or you can do like me and find an unused, but less convenient, binding:
+;;
+;; (global-set-key (kbd "C-S-<mouse-1>") 'mc/add-cursor-on-click)
+
+;; ## Unknown commands
+
+;; Multiple-cursors uses two lists of commands to know what to do: the run-once list
+;; and the run-for-all list. It comes with a set of defaults, but it would be beyond silly
+;; to try and include all the known Emacs commands.
+
+;; So that's why multiple-cursors occasionally asks what to do about a command. It will
+;; then remember your choice by saving it in `~/.emacs.d/.mc-lists.el`. You can change
+;; the location with:
+
+;; (setq mc/list-file "/my/preferred/file")
+
+;; ## Known limitations
+
+;; * isearch-forward and isearch-backward aren't supported with multiple cursors.
+;; You should feel free to add a simplified version that can work with it.
+;; * Commands run with `M-x` won't be repeated for all cursors.
+;; * All key bindings that refer to lambdas are always run for all cursors. If you
+;; need to limit it, you will have to give it a name.
+;; * Redo might screw with your cursors. Undo works very well.
+
+;; ## Contribute
+
+;; Yes, please do. There's a suite of tests, so remember to add tests for your
+;; specific feature, or I might break it later.
+
+;; You'll find the repo at:
+
+;; https://github.com/magnars/multiple-cursors.el
+
+;; To fetch the test dependencies:
+
+;; $ cd /path/to/multiple-cursors
+;; $ git submodule update --init
+
+;; Run the tests with:
+
+;; $ ./util/ecukes/ecukes --graphical
+
+;; ## Contributors
+
+;; * [Takafumi Arakaki](https://github.com/tkf) made .mc-lists.el diff friendly
+;; * [Marco Baringer](https://github.com/segv) contributed looping to mc/cycle and adding cursors without region for mark-more.
+;; * [Ivan Andrus](https://github.com/gvol) added showing number of cursors in mode-line
+;; * [Fuco](https://github.com/Fuco1) added the first version of `mc/mark-all-like-this-dwim`
+
+;; Thanks!
+
+;;; Code:
+
+(defgroup multiple-cursors nil
+ "Multiple cursors for emacs."
+ :group 'editing)
+
+(require 'mc-edit-lines)
+(require 'mc-mark-more)
+(require 'mc-mark-pop)
+(require 'rectangular-region-mode)
+(require 'mc-separate-operations)
+
+(provide 'multiple-cursors)
+
+;;; multiple-cursors.el ends here
diff --git a/elpa/multiple-cursors-20220328.1724/multiple-cursors.elc b/elpa/multiple-cursors-20220328.1724/multiple-cursors.elc
new file mode 100644
index 0000000..ff27808
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/multiple-cursors.elc
Binary files differ
diff --git a/elpa/multiple-cursors-20220328.1724/rectangular-region-mode.el b/elpa/multiple-cursors-20220328.1724/rectangular-region-mode.el
new file mode 100644
index 0000000..e4683cf
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/rectangular-region-mode.el
@@ -0,0 +1,128 @@
+;;; rectangular-region-mode.el
+
+;; Copyright (C) 2012-2016 Magnar Sveen
+
+;; Author: Magnar Sveen <magnars@gmail.com>
+;; Keywords: editing cursors
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; (global-set-key (kbd "H-SPC") 'set-rectangular-region-anchor)
+
+;; Think of this one as `set-mark` except you're marking a rectangular region. It is
+;; an exceedingly quick way of adding multiple cursors to multiple lines.
+
+;;; Code:
+
+(require 'multiple-cursors-core)
+
+(defvar rrm/anchor (make-marker)
+ "The position in the buffer that anchors the rectangular region.")
+
+(defvar rectangular-region-mode-map (make-sparse-keymap)
+ "Keymap for rectangular region is mainly for rebinding C-g")
+
+(define-key rectangular-region-mode-map (kbd "C-g") 'rrm/keyboard-quit)
+(define-key rectangular-region-mode-map (kbd "<return>") 'rrm/switch-to-multiple-cursors)
+
+(defvar rectangular-region-mode nil)
+
+(defun rrm/keyboard-quit ()
+ "Exit rectangular-region-mode."
+ (interactive)
+ (rectangular-region-mode 0)
+ (rrm/remove-rectangular-region-overlays)
+ (deactivate-mark))
+
+;; Bind this to a key (for instance H-SPC) to start rectangular-region-mode
+;;;###autoload
+(defun set-rectangular-region-anchor ()
+ "Anchors the rectangular region at point.
+
+Think of this one as `set-mark' except you're marking a
+rectangular region. It is an exceedingly quick way of adding
+multiple cursors to multiple lines."
+ (interactive)
+ (set-marker rrm/anchor (point))
+ (push-mark (point))
+ (rectangular-region-mode 1))
+
+(defun rrm/remove-rectangular-region-overlays ()
+ "Remove all rectangular-region overlays."
+ (mc/remove-fake-cursors)
+ (mapc #'(lambda (o)
+ (when (eq (overlay-get o 'type) 'additional-region)
+ (delete-overlay o)))
+ (overlays-in (point-min) (point-max))))
+
+(defun rrm/repaint ()
+ "Start from the anchor and draw a rectangle between it and point."
+ (if (not rectangular-region-mode)
+ (remove-hook 'post-command-hook 'rrm/repaint t)
+ ;; else
+ (rrm/remove-rectangular-region-overlays)
+ (let* ((annoying-arrows-mode nil)
+ (point-column (current-column))
+ (point-line (mc/line-number-at-pos))
+ (anchor-column (save-excursion (goto-char rrm/anchor) (current-column)))
+ (anchor-line (save-excursion (goto-char rrm/anchor) (mc/line-number-at-pos)))
+ (left-column (if (< point-column anchor-column) point-column anchor-column))
+ (right-column (if (> point-column anchor-column) point-column anchor-column))
+ (navigation-step (if (< point-line anchor-line) 1 -1)))
+ (move-to-column anchor-column)
+ (set-mark (point))
+ (move-to-column point-column)
+ (mc/save-excursion
+ (while (not (= anchor-line (mc/line-number-at-pos)))
+ (forward-line navigation-step)
+ (move-to-column anchor-column)
+ (when (= anchor-column (current-column))
+ (set-mark (point))
+ (move-to-column point-column)
+ (when (= point-column (current-column))
+ (mc/create-fake-cursor-at-point))))))))
+
+(defun rrm/switch-to-multiple-cursors (&rest forms)
+ "Switch from rectangular-region-mode to multiple-cursors-mode."
+ (interactive)
+ (rectangular-region-mode 0)
+ (multiple-cursors-mode 1))
+
+(defadvice er/expand-region (before switch-from-rrm-to-mc activate)
+ (when rectangular-region-mode
+ (rrm/switch-to-multiple-cursors)))
+
+(defadvice kill-ring-save (before switch-from-rrm-to-mc activate)
+ (when rectangular-region-mode
+ (rrm/switch-to-multiple-cursors)))
+
+;;;###autoload
+(define-minor-mode rectangular-region-mode
+ "A mode for creating a rectangular region to edit"
+ :init-value nil
+ :lighter " rr"
+ :keymap rectangular-region-mode-map
+ (if rectangular-region-mode
+ (progn
+ (add-hook 'after-change-functions 'rrm/switch-to-multiple-cursors t t)
+ (add-hook 'post-command-hook 'rrm/repaint t t))
+ (remove-hook 'after-change-functions 'rrm/switch-to-multiple-cursors t)
+ (remove-hook 'post-command-hook 'rrm/repaint t)
+ (set-marker rrm/anchor nil)))
+
+(provide 'rectangular-region-mode)
+
+;;; rectangular-region-mode.el ends here
diff --git a/elpa/multiple-cursors-20220328.1724/rectangular-region-mode.elc b/elpa/multiple-cursors-20220328.1724/rectangular-region-mode.elc
new file mode 100644
index 0000000..79c963b
--- /dev/null
+++ b/elpa/multiple-cursors-20220328.1724/rectangular-region-mode.elc
Binary files differ
diff --git a/elpa/org-9.5.2.signed b/elpa/org-9.5.2.signed
new file mode 100644
index 0000000..406f593
--- /dev/null
+++ b/elpa/org-9.5.2.signed
@@ -0,0 +1 @@
+Good signature from 066DAFCB81E42C40 GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org> (trust undefined) created at 2021-12-24T17:15:02-0500 using RSA \ No newline at end of file
diff --git a/elpa/org-9.5.2/.dir-locals.el b/elpa/org-9.5.2/.dir-locals.el
new file mode 100644
index 0000000..9df10df
--- /dev/null
+++ b/elpa/org-9.5.2/.dir-locals.el
@@ -0,0 +1,22 @@
+;;; Directory Local Variables
+;;; For more information see (info "(emacs) Directory Variables")
+
+((nil
+ (indent-tabs-mode . t)
+ (tab-width . 8)
+ (fill-column . 70)
+ (sentence-end-double-space . t))
+ (emacs-lisp-mode
+ (indent-tabs-mode))
+ (org-mode
+ (indent-tabs-mode)
+ (org-adapt-indentation)
+ (org-edit-src-content-indentation . 0)
+ (org-footnote-auto-adjust . t)
+ (org-footnote-auto-label . t)
+ (org-footnote-define-inline . nil)
+ (org-footnote-section . "Footnotes")
+ (org-hide-emphasis-markers . nil)))
+
+
+
diff --git a/elpa/org-9.5.2/CONTRIBUTE b/elpa/org-9.5.2/CONTRIBUTE
new file mode 100644
index 0000000..94d471a
--- /dev/null
+++ b/elpa/org-9.5.2/CONTRIBUTE
@@ -0,0 +1,71 @@
+-*- mode: org; fill-column:70 -*-
+
+The text below explains the rules for participating in Org mode
+development.
+
+* Org maintenance
+
+Org maintenance is detailed on Worg: see [[https://orgmode.org/worg/org-maintenance.html][org-maintenance]].
+
+* Main contribution rules
+
+1. The master git repository is hosted publicly on [[https://savannah.gnu.org][savannah.gnu.org]].
+
+ : git clone https://git.savannah.gnu.org/git/emacs/org-mode.git
+
+ This is sufficient to start hacking and to produce patches that can
+ easily and consistently be applied to the main repository.
+
+2. People who want to participate to the Org mode development can send
+ patches to this address:
+
+ : emacs-orgmode@gnu.org
+
+3. If you are a regular contributor, you can request push access to
+ the repository by creating an account on [[https://savannah.gnu.org/account/register.php][savannah.gnu.org]] and by
+ [[https://savannah.gnu.org/git/?group=emacs][joining the Emacs group]].
+
+ After you have been added as a user with push privileges, you can
+ clone the repository like this:
+
+ : git clone USERNAME@git.savannah.gnu.org:/srv/git/emacs/org-mode.git
+
+ Replace =USERNAME= with your Savannah username.
+
+4. By requesting push access, you acknowledge that you have read and
+ agreed with the following rules:
+
+ - Org mode is part of GNU Emacs. Therefore, we need to be very
+ conscious about changes moving into the Org mode core. These can
+ originate only from people who have signed the appropriate papers
+ with the Free Software Foundation. The files to which this
+ applies are:
+
+ - all *.el files in the lisp directory of the repository
+ - orgcard.tex and all *.org files in the doc/ directory
+
+ - Before making any significant changes, please explain and discuss
+ them on the mailing list [[mailto:emacs-orgmode@gnu.org][emacs-orgmode@gnu.org]].
+
+ This does obviously not apply to people who are maintaining their
+ own contributions to Org mode. Please just use the new mechanism
+ to make sure all changes end up in the right place.
+
+ We value a nice tone in our discussions: please check and respect
+ the [[https://www.gnu.org/philosophy/kind-communication.en.html][GNU Kind Communications Guidelines]].
+
+ - Org mode no longer uses ChangeLog entries to document changes.
+ Instead, special commit messages are used, as described in the
+ `CONTRIBUTE' file in the main Emacs repository.
+
+ - Among other things, Org mode is widely appreciated because of its
+ simplicity, cleanness and consistency. We should try to preserve
+ them and ask everyone to keep this in mind when posting changes.
+
+See [[https://orgmode.org/worg/org-contribute.html][worg/org-contribute]] for guidance on how to contribute effectively.
+
+* The =contrib/= directory
+
+The git repository used to contain a =contrib/= directory. Files in
+this directory were moved to a new [[https://git.sr.ht/~bzg/org-contrib][org-contrib]] repository before Org
+9.5. You can install the new =org-contrib= from [[https://elpa.nongnu.org/nongnu/][NonGNU ELPA]].
diff --git a/elpa/org-9.5.2/COPYING b/elpa/org-9.5.2/COPYING
new file mode 100644
index 0000000..e600086
--- /dev/null
+++ b/elpa/org-9.5.2/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ 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, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public 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.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program 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.
+
+ This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<https://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<https://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/elpa/org-9.5.2/Makefile b/elpa/org-9.5.2/Makefile
new file mode 100644
index 0000000..f2a14b5
--- /dev/null
+++ b/elpa/org-9.5.2/Makefile
@@ -0,0 +1,93 @@
+.NOTPARALLEL: # always run this make serially
+.SUFFIXES: # we don't need default suffix rules
+ifeq ($(MAKELEVEL), 0)
+ $(error This make needs to be started as a sub-make from the toplevel directory.)
+endif
+
+ifneq ($(ORG_ADD_CONTRIB),)
+ _ORG_ADD_EL_ := \
+ $(notdir \
+ $(wildcard \
+ $(addsuffix .el, \
+ $(addprefix ../contrib/lisp/, \
+ $(basename \
+ $(notdir $(ORG_ADD_CONTRIB)))))))
+endif
+
+LISPV := org-version.el
+LISPI := org-loaddefs.el
+LISPA := $(LISPV) $(LISPI)
+LISPB := $(LISPA:%el=%elc) org-install.elc
+LISPF := $(filter-out $(LISPA),$(sort $(wildcard *.el) $(_ORG_ADD_EL_)))
+LISPC := $(filter-out $(LISPB) $(LISPN:%el=%elc),$(LISPF:%el=%elc))
+_ORGCM_ := dirall single source slint1 slint2
+-include local.mk
+
+.PHONY: all compile compile-dirty \
+ $(_ORGCM_) $(_ORGCM_:%=compile-%) \
+ autoloads addcontrib \
+ install clean cleanauto cleanall cleanelc clean-install
+
+# do not clean here, done in toplevel make
+all compile compile-dirty:: autoloads
+ifeq ($(filter-out $(_ORGCM_),$(ORGCM)),)
+ $(MAKE) compile-$(ORGCM)
+else
+ $(error ORGCM has illegal value $(ORGCM) (valid: $(_ORGCM_)))
+endif
+
+compile-dirall: dirall
+compile-single: single $(LISPC)
+compile-source: source dirall
+compile-slint1: dirall slint1
+compile-slint2: source dirall slint1
+
+# internal
+dirall:
+ @$(info ==================== $@ ====================)
+ @$(ELCDIR)
+single:
+ @$(info ==================== $@ ====================)
+source: cleanelc
+ @$(info ==================== $@ ====================)
+ @$(foreach elc,$(LISPC),$(MAKE) $(elc) && $(RM) $(elc);)
+slint1:
+ @$(info ==================== $@ ====================)
+ @$(foreach elc,$(LISPC),$(RM) $(elc); $(MAKE) $(elc);)
+
+%.elc: %.el
+ @$(info Compiling single $(abspath $<)...)
+ -@$(ELC) $<
+
+addcontrib:
+ifneq ($(ORG_ADD_CONTRIB),)
+ $(CP) $(addprefix ../contrib/lisp/,$(_ORG_ADD_EL_)) .
+endif
+
+autoloads: cleanauto addcontrib $(LISPI) $(LISPV)
+
+$(LISPV): $(LISPF)
+ @echo "org-version: $(ORGVERSION) ($(GITVERSION))"
+ @$(RM) $(@)
+ @$(MAKE_ORG_VERSION)
+
+$(LISPI): $(LISPV) $(LISPF)
+ @echo "org-loaddefs: $(ORGVERSION) ($(GITVERSION))"
+ @$(RM) $(@)
+ @$(MAKE_ORG_INSTALL)
+
+install: compile $(LISPF)
+ if [ ! -d $(DESTDIR)$(lispdir) ] ; then \
+ $(MKDIR) $(DESTDIR)$(lispdir) ; \
+ fi ;
+ $(CP) $(LISPC) $(LISPF) $(LISPA) $(DESTDIR)$(lispdir)
+
+cleanauto clean cleanall::
+ $(RM) $(LISPA) $(LISPB)
+clean cleanall cleanelc::
+ $(RM) *.elc
+
+clean-install:
+ if [ -d $(DESTDIR)$(lispdir) ] ; then \
+ $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* $(DESTDIR)$(lispdir)/ol*.el* $(DESTDIR)$(lispdir)/ox*.el* ; \
+ fi ;
diff --git a/elpa/org-9.5.2/README b/elpa/org-9.5.2/README
new file mode 100644
index 0000000..b0e39b9
--- /dev/null
+++ b/elpa/org-9.5.2/README
@@ -0,0 +1,66 @@
+-*- mode: org; fill-column:70 -*-
+
+This is a distribution of Org, a plain text notes and project planning
+tool for Emacs.
+
+Check the [[https://orgmode.org][homepage of Org]] and the [[https://orgmode.org/org.html#Installation][installations instructions]].
+
+* Contents of this distribution
+
+- README :: This file.
+
+- COPYING :: The GNU General Public License.
+
+- Makefile :: The makefile to compile and install Org. For
+ installation instructions, see [[https://orgmode.org/org.html#Installation][the manual]] or [[https://orgmode.org/worg/dev/org-build-system.html][this more detailed
+ procedure on Worg]].
+
+- mk/ :: Files needed for building Org.
+
+- lisp/ :: Directory with all the Emacs Lisp files that make up Org.
+
+- doc/ :: The documentation files. org.texi is the source of the
+ documentation, org.html and org.pdf are formatted versions of it.
+
+- etc/ :: Files needed for the ODT exporter.
+
+- testing/ :: Testing suite for Org.
+
+- request-assign-future.txt :: The form that contributors have to sign
+ and get processed with the FSF before contributed changes can be
+ integrated into the Org core. All files in this distribution have
+ copyright assigned to the FSF.
+
+* Join the GNU Project
+
+Org is part of GNU Emacs and GNU Emacs is part of the GNU Operating
+System, developed by the GNU Project.
+
+If you are the author of an awesome program and want to join us in
+writing Free (libre) Software, please consider making it an official
+GNU program and become a GNU Maintainer. Instructions on how to do
+this are here http://www.gnu.org/help/evaluation
+
+Don't have a program to contribute? Look at all the other ways to
+help: https://www.gnu.org/help/help.html
+
+And to learn more about Free (libre) Software in general, please
+read and share this page: https://gnu.org/philosophy/free-sw.html
+
+* License
+
+Org-mode is published under [[https://www.gnu.org/licenses/gpl-3.0.html][the GNU GPLv3 license]] or any later
+version, the same as GNU Emacs.
+
+Org-mode 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 Org mode. If not, see <https://www.gnu.org/licenses/>.
diff --git a/elpa/org-9.5.2/README_ELPA b/elpa/org-9.5.2/README_ELPA
new file mode 100644
index 0000000..c1ff5e2
--- /dev/null
+++ b/elpa/org-9.5.2/README_ELPA
@@ -0,0 +1,38 @@
+This is the Emacs Org project, an Emacs library for organizing your life.
+
+The homepage of Org is at:
+ https://orgmode.org
+
+Installations instructions are at:
+ https://orgmode.org/org.html#Installation
+
+This distribution contains an ELPA packaged version of Org.
+"ELPA" stands for the "Emacs Lisp Package Archive".
+
+The GNU ELPA is at:
+ https://elpa.gnu.org
+
+It contains the org-*.tar package, containing only the org files
+that are also part of GNU Emacs.
+
+There are other ELPA online, offering more packages.
+
+All ELPA packages of Org contain:
+
+README_ELPA
+ This file.
+
+*.el
+ Elisp files.
+
+org
+ The Org info manual.
+
+orgcard.pdf
+ The Org reference card.
+
+etc/
+ Libraries for the ODT exporter.
+
+org-*-pkg.el
+ The name of the package, requested GNU Emacs packaging system.
diff --git a/elpa/org-9.5.2/dir b/elpa/org-9.5.2/dir
new file mode 100644
index 0000000..d54db65
--- /dev/null
+++ b/elpa/org-9.5.2/dir
@@ -0,0 +1,19 @@
+This is the file .../info/dir, which contains the
+topmost node of the Info hierarchy, called (dir)Top.
+The first time you invoke Info you start off looking at this node.
+
+File: dir, Node: Top This is the top of the INFO tree
+
+ This (the Directory node) gives a menu of major topics.
+ Typing "q" exits, "H" lists all Info commands, "d" returns here,
+ "h" gives a primer for first-timers,
+ "mEmacs<Return>" visits the Emacs manual, etc.
+
+ In Emacs, you can click mouse button 2 on a menu item or cross reference
+ to select it.
+
+* Menu:
+
+Emacs editing modes
+* Org Guide: (orgguide). Abbreviated Org mode manual.
+* Org Mode: (org). Outline-based notes management and organizer.
diff --git a/elpa/org-9.5.2/doc/.aspell.org.conf b/elpa/org-9.5.2/doc/.aspell.org.conf
new file mode 100644
index 0000000..dd8601d
--- /dev/null
+++ b/elpa/org-9.5.2/doc/.aspell.org.conf
@@ -0,0 +1,81 @@
+# Aspell configuration for proof reading Org documentation.
+
+# Org documentation is written in American...
+
+master en_US-w_accents
+lang en_US
+
+# Assume the Org specific word and replacement lists are in the doc
+# directory and that any spell check is also run from there. Specify
+# this file when running aspell by some command like:
+#
+# $ aspell check --per-conf=".aspell.org.conf" org.texi
+
+personal ./.aspell.org.pws
+repl ./.aspell.org.prepl
+
+# Checking options. See man aspell.
+
+save-repl true
+sug-mode normal
+ignore-case false
+ignore-accents false
+
+# Filters
+
+# For some reason the following doesn't seem to work which stuffs up
+# trying to use Ispell mode from an Emacs buffer (at least I cannot
+# make it work) but aspell seems abot to recognise texinfo files
+# automatically when checking from the command line so it doesn't
+# matter much.
+
+# mode texinfo
+
+lset-filter tex:url
+
+# Let's be clear about what we choose to ignore.
+
+clear-f-texinfo-ignore
+
+add-f-texinfo-ignore c
+add-f-texinfo-ignore code
+add-f-texinfo-ignore command
+add-f-texinfo-ignore documentencoding
+add-f-texinfo-ignore email
+add-f-texinfo-ignore env
+add-f-texinfo-ignore file
+add-f-texinfo-ignore kbd
+add-f-texinfo-ignore macro
+add-f-texinfo-ignore option
+add-f-texinfo-ignore printindex
+add-f-texinfo-ignore samp
+add-f-texinfo-ignore set
+add-f-texinfo-ignore setfilename
+add-f-texinfo-ignore syncode
+add-f-texinfo-ignore url
+add-f-texinfo-ignore value
+add-f-texinfo-ignore var
+add-f-texinfo-ignore verb
+add-f-texinfo-ignore verbatiminclude
+add-f-texinfo-ignore vskip
+
+# Utility options
+
+backup true
+guess true
+suggest true
+
+# Miscellaneous
+#
+# Org documentation uses a lot of compound words. Try and ignore them
+# rather than including them in a specific word list.
+
+run-together-limit 2
+run-together-min 2
+
+#
+
+# Local variables:
+# fill-column: 72
+# mode: conf
+# End:
diff --git a/elpa/org-9.5.2/doc/.nosearch b/elpa/org-9.5.2/doc/.nosearch
new file mode 100644
index 0000000..50a914b
--- /dev/null
+++ b/elpa/org-9.5.2/doc/.nosearch
@@ -0,0 +1 @@
+No search
diff --git a/elpa/org-9.5.2/doc/Documentation_Standards.org b/elpa/org-9.5.2/doc/Documentation_Standards.org
new file mode 100644
index 0000000..c4dd862
--- /dev/null
+++ b/elpa/org-9.5.2/doc/Documentation_Standards.org
@@ -0,0 +1,171 @@
+#+TITLE: Notes on documenting Org
+#+AUTHOR: Phil Rooke
+#+EMAIL: phil@yax.org.uk
+#+LANGUAGE: en
+#+STARTUP: showall
+#+TEXT: Notes to myself justifying the conventions and standards in my
+#+TEXT: set of recent doc patches.
+#+OPTIONS: H:3 num:t toc:t \n:nil @:t ::t |:t ^:nil *:t TeX:t
+
+* Background
+
+I think it is an express objective of Carsten's that Org should be
+readily accessible to all users of Emacs and not just those who might
+happen to read or hack on the code of this particular package. To
+that end significant effort has been made and continues to be made by
+the Org community to ensure that high quality, user focused,
+documentation is readily available to everyone.
+
+Org itself contains a comprehensive guide to using all aspects of the
+system, how to extend it yourself, and highlights some of the many
+burgeoning number of add-on packages that others are contributing.
+This guide, [[info:org:Top][The Org Manual]], concentrates on the facts of working with
+the system. Supplementing this, the [[Org web pages]] contain pointers to
+many tutorials and how-to's which capture much of spirit and
+imagination people show when using Org as a basis for building broader
+organizational systems that help them help themselves.
+
+I use Org, but it is a big system, and so I happen to think that
+improving the consistency, clarity and accuracy of Org documents helps
+both me and all other users of the system. In support of this and by
+way of justification and clarification, this short note attempts to
+capture some of the existing guidelines and standards that have been
+used in the patches I am submitting and, which I hope, may be adopted
+by others when making their own contributions.
+
+* Referencing systems, packages, modes and much else
+
+Originally Org was a single mode and there was no ambiguity about what
+Org mode could refer to. Things have changed rapidly though and it
+seems that Carsten now thinks of Org as the system encompassing the
+major mode, some minor modes, and an increasing number of additional
+packages and plug-ins that build on the core Org functionality. It is
+really hard to find a consistent way to refer to all these things, but
+what I am trying to do is follow these guidelines (which are not
+perfect, merely a start):
+
+- In general write "Org" as much as possible and, in particular, when
+ discussing concepts, features and functions that are generally
+ applicable to Org as a whole.
+
+- Be more specific and write, for example, "the Orgtbl minor mode"
+ when referring to something unique to that feature. It may be, for
+ example, a command is only available when you are actually editing a
+ file using just that mode, add-on package or plug-in.
+
+- Prefer "Org mode" to "Org-mode" or "org-mode". This is simply
+ because it reflects an existing convention in [[info:emacs:Top][The Emacs Manual]] which
+ consistently documents mode names in this form - "Text mode",
+ "Outline mode", "Mail mode", etc.
+
+- Likewise refer, if at all possible, to "Org file or "Org buffer"
+ meaning with, great generality, any file or buffer which requires
+ use of some part of Org to edit it properly.
+
+- Org uses "org-..." to ring fence a name space for itself in the
+ Emacs code base. This is obviously retained in code snippets.
+
+* Other Org specific conventions
+
+Unless there is a good reason to do otherwise, then try and adopt the
+following conventions. (I think all can be justified by reference to
+Carsten or precedent in other significant Emacs documentation, unless
+I have made them up of course).
+
+- Org has *lots* of commands and a /lot/ of them take prefix arguments of
+ one sort or another. Write in full "prefix argument", "numeric
+ prefix argument" or, maybe, "a numeric prefix argument N" when you
+ want to refer to the argument again.
+
+- Org lives in various states of harmony and discord with other Emacs
+ packages. Try and write the names of those packages as their
+ authors and maintainers write them. So it should be (I think) BBDB,
+ MH-E, Rmail, VM, Gnus, CDLaTeX etc.
+
+- TODO keywords, whether Org or user defined, are written in capitals.
+
+- Built-in tags with a special meaning (e.g. ARCHIVE) are written in
+ uppercase. User defined tags (e.g. boss, home) are written in
+ lowercase.
+
+- Built-in properties (e.g. PRIORITY) are written in uppercase. User
+ defined properties (e.g. Release) are written in lowercase.
+
+- Entries in the concept index are normally all lower case unless some
+ other rule dictates otherwise.
+
+* org-manual.org specific conventions
+
+Org git repository comes with an .org version of the manual in the
+=doc/= directory. Here are indications that are specific to this
+version of the manual.
+
+- Five of the standard Texinfo indexes are used in the Org manual:
+
+ + #+cindex: :: concept index, for general concepts
+ + #+findex: :: function index, for function and function-like names
+ + #+kindex: :: keystroke index, for keyboard commands
+ + #+pindex: :: program index, for names of programs
+ + #+vindex: :: variable index, for variable names
+
+- Use fixed-width area for one-line examples.
+
+- Use example blocks for Org syntax instead of "begin_src org".
+
+- Internal links to headlines always start with a star.
+
+- Tags, node properties, are not shown with the surrounding colons.
+
+- When to use = ... = or ~ ... ~ markup:
+
+ + files or extensions use = ... =,
+ + anything that is meant to be written in the Org buffer uses = ... =,
+ + any meaningful token in a programming language uses ~ ... ~.
+
+* Miscellaneous
+
+ - Only two of the standard Texinfo indexes are used; those for
+ concepts and keys. This has some implications:
+
+ + The preference is to document commands by key rather than by name
+
+ + Texinfo commands such as @var and @defoption are not used. The
+ preference for this type of thing is that the user browses the
+ customize groups. If you want or need to refer to, say, a
+ variable then document it as "the variable
+ @code{org-startup-folded}"
+
+ + Entries in the concept index are normally all lower case unless
+ some other rule dictates otherwise.
+
+ - Org documentation is written in American English, which is somewhat
+ foreign as far as I am concerned, but live with it anyway.
+
+ - Org uses a number of compound words, words that I wouldn't
+ necessarily run together. Instead of worrying about whether these
+ should be separate, hyphenated or compound I have simply gone with
+ the majority case as originally written and then tried to make sure
+ the spell checker knows what this chosen standard should be so that
+ I do not worry about it anymore.
+
+ - I have run a spell checker periodically. Aspell works well and has
+ a useful Texinfo filter (although, annoyingly, I cannot make this
+ work with ispell.el and so I run it from the command line). I have
+ an Org specific Aspell configuration file (which sets an American
+ dictionary, rules for compound words etc) and which, along with the
+ associated word and replacement files, captures some of the more
+ detailed and somewhat arbitrary rules I have used.
+
+ - Org has really low entry barriers. Requirements seem simply to be:
+
+ + You can use Text mode or, pretty much, any derivative of it
+ + You have some motivation to become slightly better organized.
+
+ Therefore, try and write the documentation so that it is relevant
+ to, and can be read by such a diverse audience.
+
+# Local variables:
+# mode: org
+# ispell-local-dictionary: "en_US-w_accents"
+# ispell-local-pdict: "./.aspell.org.pws"
+# End:
diff --git a/elpa/org-9.5.2/doc/Makefile b/elpa/org-9.5.2/doc/Makefile
new file mode 100644
index 0000000..cb6d72b
--- /dev/null
+++ b/elpa/org-9.5.2/doc/Makefile
@@ -0,0 +1,102 @@
+.SUFFIXES: # we don't need default suffix rules
+ifeq ($(MAKELEVEL), 0)
+ $(error This make needs to be started as a sub-make from the toplevel directory.)
+endif
+.PHONY: all info html pdf card manual guide install \
+ clean cleanall clean-install
+
+all: $(ORG_MAKE_DOC)
+
+info: org orgguide
+
+html: org.html orgguide.html
+
+pdf: org.pdf orgguide.pdf
+
+card: orgcard.pdf orgcard_letter.pdf orgguide.pdf
+
+ifneq ($(SERVERMK),)
+manual guide::
+ -$(RMR) $@
+ $(MKDIR) $@
+manual:: org.texi org-version.inc
+ $(TEXI2HTML) -o $@ $<
+ ../mk/mansplit.pl $@/*
+guide:: orgguide.texi org-version.inc
+ $(TEXI2HTML) -o $@ $<
+ ../mk/guidesplit.pl $@/*
+endif
+
+org.texi: org-manual.org
+ $(BATCH) \
+ --eval '(add-to-list `load-path "../lisp")' \
+ --eval '(load "../mk/org-fixup.el")' \
+ --eval '(org-make-manual)'
+
+orgguide.texi: org-guide.org
+ $(BATCH) \
+ --eval '(add-to-list `load-path "../lisp")' \
+ --eval '(load "../mk/org-fixup.el")' \
+ --eval '(org-make-guide)'
+
+org-version.inc: org.texi
+ @echo "org-version: $(ORGVERSION) ($(GITVERSION))"
+ @echo "@c automatically generated, do not edit" > org-version.inc
+ @echo "@set VERSION $(ORGVERSION) ($(GITVERSION))" >> org-version.inc
+ @echo "@set DATE $(DATE)" >> org-version.inc
+
+org-version.tex: orgcard.tex
+ @printf "org-version: $(ORGVERSION) ($(GITVERSION))\n"
+ @printf "%% automatically generated, do not edit\n" > org-version.tex
+ @printf "\def\orgversionnumber{$(ORGVERSION)}\n" >> org-version.tex
+ @printf "\def\\\\versionyear{$(YEAR)}\n" >> org-version.tex
+ @printf "\def\year{$(YEAR)}\n" >> org-version.tex
+
+install: org orgguide
+ if [ ! -d $(DESTDIR)$(infodir) ]; then $(MKDIR) $(DESTDIR)$(infodir); else true; fi ;
+ $(CP) org.info $(DESTDIR)$(infodir)
+ $(CP) orgguide.info $(DESTDIR)$(infodir)
+ $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) org.info
+ $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) orgguide.info
+
+clean:
+ $(RM) *.pdf *.html *.info *_letter.tex org-version.inc org-version.tex \
+ *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs *.toc \
+ *.tp *.tps *.vr *.vrs *.log *.ps
+cleanall: clean
+ $(RM) org.texi orgguide.texi
+ $(RMR) guide manual
+
+clean-install:
+ $(RM) $(DESTDIR)$(infodir)/org*
+ $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) --remove org
+ $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) --remove orgguide
+
+.SUFFIXES: .texi .tex .txt _letter.tex
+
+%: %.texi org-version.inc
+ $(MAKEINFO) --no-split $< -o $@.info
+
+# the following two lines work around a bug in some versions of texi2dvi
+%.pdf: LC_ALL=C
+%.pdf: LANG=C
+%.pdf: %.texi org-version.inc
+ $(TEXI2PDF) $<
+%.pdf: %.tex org-version.tex
+ PDFLATEX=$(PDFTEX) $(TEXI2PDF) $<
+
+%.html: %.texi org-version.inc
+ $(TEXI2HTML) --no-split -o $@ $<
+ifneq ($(SERVERMK),)
+ ../mk/manfull.pl $@
+
+%.txt: %.tex
+ perl ../mk/orgcard2txt.pl $< > $@
+endif
+
+%_letter.tex: %.tex
+ $(BATCH) \
+ --eval '(add-to-list `load-path "../lisp")' \
+ --eval '(load "org-compat.el")' \
+ --eval '(load "../mk/org-fixup.el")' \
+ --eval '(org-make-letterformat "$(<F)" "$(@F)")'
diff --git a/elpa/org-9.5.2/doc/dir b/elpa/org-9.5.2/doc/dir
new file mode 100644
index 0000000..6c75b5d
--- /dev/null
+++ b/elpa/org-9.5.2/doc/dir
@@ -0,0 +1,19 @@
+This is the file .../info/dir, which contains the
+topmost node of the Info hierarchy, called (dir)Top.
+The first time you invoke Info you start off looking at this node.
+
+File: dir, Node: Top This is the top of the INFO tree
+
+ This (the Directory node) gives a menu of major topics.
+ Typing "q" exits, "?" lists all Info commands, "d" returns here,
+ "h" gives a primer for first-timers,
+ "mEmacs<Return>" visits the Emacs manual, etc.
+
+ In Emacs, you can click mouse button 2 on a menu item or cross reference
+ to select it.
+
+* Menu:
+
+Emacs
+* Org Mode: (org). Outline-based notes management and organizer.
+* Org Guide: (orgguide). Abbreviated Org mode manual.
diff --git a/elpa/org-9.5.2/doc/doc-setup.org b/elpa/org-9.5.2/doc/doc-setup.org
new file mode 100644
index 0000000..f59660e
--- /dev/null
+++ b/elpa/org-9.5.2/doc/doc-setup.org
@@ -0,0 +1,53 @@
+# SETUPFILE for Org manual
+
+# Copyright (C) 2021 Free Software Foundation, Inc.
+#
+# 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 <https://www.gnu.org/licenses/>.
+
+# XXX: We cannot use TODO keyword as a node starts with "TODO".
+#+todo: REVIEW FIXME | DONE
+#+property: header-args :eval no
+#+startup: overview nologdone
+
+# Use proper quote and backtick for code sections in PDF output
+# Cf. Texinfo manual 14.2
+#+texinfo_header: @set txicodequoteundirected
+#+texinfo_header: @set txicodequotebacktick
+
+# Contact Info
+#+texinfo_header: @set MAINTAINERSITE @uref{https://orgmode.org,maintainers webpage}
+#+texinfo_header: @set MAINTAINER Bastien Guerry
+#+texinfo_header: @set MAINTAINEREMAIL @email{bzg@gnu.org}
+#+texinfo_header: @set MAINTAINERCONTACT @uref{mailto:bzg@gnu.org,contact the maintainer}
+
+#+options: H:4 num:t toc:t author:t \n:nil ::t |:t ^:nil -:t f:t *:t <:t e:t ':t
+#+options: d:nil todo:nil pri:nil tags:not-in-toc stat:nil broken-links:mark
+#+select_tags: export
+#+exclude_tags: noexport
+
+#+macro: cite @@texinfo:@cite{@@$1@@texinfo:}@@
+#+macro: var @@texinfo:@var{@@$1@@texinfo:}@@
+
+# The "version" macro extracts "Version" keyword from "org.el". It
+# returns major.minor version number. This is sufficient since bugfix
+# releases are not expected to add features and therefore imply manual
+# modifications.
+#+macro: version (eval (with-current-buffer (find-file-noselect "../lisp/org.el") (org-with-point-at 1 (if (re-search-forward "Version: +\\([0-9.]+\\)" nil t) (mapconcat #'identity (cl-subseq (split-string (match-string-no-properties 1) "\\.") 0 2) ".") (error "Missing \"Version\" keyword in \"org.el\"")))))
+
+# The "kbd" macro turns KBD into @kbd{KBD}. Additionally, it
+# encloses case-sensitive special keys (SPC, RET...) within @key{...}.
+#+macro: kbd (eval (let ((case-fold-search nil) (regexp (regexp-opt '("SPC" "RET" "LFD" "TAB" "BS" "ESC" "DELETE" "SHIFT" "Ctrl" "Meta" "Alt" "Cmd" "Super" "UP" "LEFT" "RIGHT" "DOWN") 'words))) (format "@@texinfo:@kbd{@@%s@@texinfo:}@@" (replace-regexp-in-string regexp "@@texinfo:@key{@@\\&@@texinfo:}@@" $1 t))))
+
diff --git a/elpa/org-9.5.2/doc/fdl.org b/elpa/org-9.5.2/doc/fdl.org
new file mode 100644
index 0000000..2cc082b
--- /dev/null
+++ b/elpa/org-9.5.2/doc/fdl.org
@@ -0,0 +1,490 @@
+# The GNU Free Documentation License.
+#+begin_center
+Version 1.3, 3 November 2008
+#+end_center
+
+# This file is intended to be included within another document.
+
+#+begin_verse
+Copyright \copy{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+https://fsf.org/
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+#+end_verse
+
+0. [@0] PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document @@texinfo:@dfn{@@free@@texinfo:}@@
+ 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:
+
+ #+attr_texinfo: :enum A
+ 1. 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.
+
+ 2. 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.
+
+ 3. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+ 4. Preserve all the copyright notices of the Document.
+
+ 5. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+ 6. 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.
+
+ 7. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+
+ 8. Include an unaltered copy of this License.
+
+ 9. 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.
+
+ 10. 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.
+
+ 11. 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.
+
+ 12. 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.
+
+ 13. Delete any section Entitled "Endorsements". Such a section may
+ not be included in the Modified Version.
+
+ 14. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ 15. 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
+ https://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.
+
+#+texinfo: @page
+
+* ADDENDUM: How to use this License for your documents
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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:
+
+#+begin_example
+ 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''.
+#+end_example
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts."\nbsp{}line with this:
+
+#+begin_example
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+#+end_example
+
+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.
+
diff --git a/elpa/org-9.5.2/doc/htmlxref.cnf b/elpa/org-9.5.2/doc/htmlxref.cnf
new file mode 100644
index 0000000..a5eb584
--- /dev/null
+++ b/elpa/org-9.5.2/doc/htmlxref.cnf
@@ -0,0 +1,2 @@
+calc mono https://www.gnu.org/software/emacs/manual/html_mono/calc.html
+calc node https://www.gnu.org/software/emacs/manual/html_node/calc/
diff --git a/elpa/org-9.5.2/doc/org-guide.org b/elpa/org-9.5.2/doc/org-guide.org
new file mode 100644
index 0000000..aa793f1
--- /dev/null
+++ b/elpa/org-9.5.2/doc/org-guide.org
@@ -0,0 +1,2654 @@
+#+title: Org Mode Compact Guide
+#+subtitle: Release {{{version}}}
+#+author: The Org Mode Developers
+#+language: en
+
+#+texinfo: @insertcopying
+
+* Copying
+:PROPERTIES:
+:copying: t
+:END:
+
+Copyright \copy 2004--2021 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 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."
+in the full Org manual, which is distributed together with this
+compact guide.
+
+(a) The FSF's Back-Cover Text is: "You have the freedom to copy and
+modify this GNU manual."
+#+end_quote
+
+* Introduction
+:PROPERTIES:
+:DESCRIPTION: Welcome!
+:END:
+
+Org is a mode for keeping notes, maintaining TODO lists, and doing
+project planning with a fast and effective plain-text system. It is
+also an authoring and publishing system, and it supports working with
+source code for literal programming and reproducible research.
+
+This document is a much compressed derivative of the [[info:org][comprehensive Org
+mode manual]]. It contains all basic features and commands, along with
+important hints for customization. It is intended for beginners who
+would shy back from a 200 pages manual because of sheer size.
+
+** Installation
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+attr_texinfo: :tag Important
+#+begin_quote
+If you are using a version of Org that is part of the Emacs
+distribution, please skip this section and go directly to [[*Activation]].
+#+end_quote
+
+If you have downloaded Org from the web, either as a distribution
+=.zip= or =.tar= file, or as a Git archive, it is best to run it
+directly from the distribution directory. You need to add the =lisp/=
+subdirectories to the Emacs load path. To do this, add the following
+line to your Emacs init file:
+
+: (add-to-list 'load-path "~/path/to/orgdir/lisp")
+
+#+texinfo: @noindent
+If you have been using git or a tar ball to get Org, you need to run
+the following command to generate autoload information.
+
+: make autoloads
+
+** Activation
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+Add the following lines to your Emacs init file to define /global/
+keys for three commands that are useful in any Emacs buffer, not just
+Org buffers. Please choose suitable keys yourself.
+
+#+begin_src emacs-lisp
+(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)
+#+end_src
+
+Files with extension =.org= will be put into Org mode automatically.
+
+** Feedback
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+If you find problems with Org, or if you have questions, remarks, or
+ideas about it, please mail to the Org mailing list
+mailto:emacs-orgmode@gnu.org. For information on how to submit bug
+reports, see the main manual.
+
+* Document Structure
+:PROPERTIES:
+:DESCRIPTION: A tree works like your brain.
+:END:
+
+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 {{{kbd(TAB)}}} key.
+
+** Headlines
+:PROPERTIES:
+:DESCRIPTION: How to typeset Org tree nodes.
+:END:
+
+Headlines define the structure of an outline tree. The headlines in
+Org start on the left margin[fn:1] with one or more stars followed by
+a space. For example:
+
+#+begin_example
+,* Top level headline
+,** Second level
+,*** Third level
+ some text
+,*** Third level
+ more text
+,* Another top level headline
+#+end_example
+
+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.
+See [[*Miscellaneous]] for a setup to realize this.
+
+** Visibility Cycling
+:PROPERTIES:
+:DESCRIPTION: Show and hide, much simplified.
+:END:
+
+Outlines make it possible to hide parts of the text in the buffer.
+Org uses just two commands, bound to {{{kbd(TAB)}}} and
+{{{kbd{S-TAB)}}} to change the visibility in the buffer.
+
+#+attr_texinfo: :sep ,
+- {{{kbd(TAB)}}} ::
+
+ /Subtree cycling/: Rotate current subtree among the states
+
+ : ,-> FOLDED -> CHILDREN -> SUBTREE --.
+ : '-----------------------------------'
+
+ When called with a prefix argument ({{{kbd(C-u TAB)}}}), or with the
+ Shift key, global cycling is invoked.
+
+- {{{kbd(S-TAB)}}}, {{{kbd(C-u TAB)}}} ::
+
+ /Global cycling/: Rotate the entire buffer among the states
+
+ : ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
+ : '--------------------------------------'
+
+- {{{kbd(C-u C-u C-u TAB)}}} ::
+
+ Show all, including drawers.
+
+When Emacs first visits an Org file, the global state is set to
+OVERVIEW, i.e., only the top level headlines are visible. This can be
+configured through the variable ~org-startup-folded~, or on a per-file
+basis by adding a =STARTUP= keyword to =overview=, =content=,
+=showall=, =showeverything= or =show<n>levels= (n = 2..5) like this:
+
+: #+STARTUP: content
+
+** Motion
+:PROPERTIES:
+:DESCRIPTION: Jumping to other headlines.
+:END:
+
+The following commands jump to other headlines in the buffer.
+
+- {{{kbd(C-c C-n)}}} :: Next heading.
+
+- {{{kbd(C-c C-p)}}} :: Previous heading.
+
+- {{{kbd(C-c C-f)}}} :: Next heading same level.
+
+- {{{kbd(C-c C-b)}}} :: Previous heading same level.
+
+- {{{kbd(C-c C-u)}}} :: Backward to higher level heading.
+
+** Structure Editing
+:PROPERTIES:
+:DESCRIPTION: Changing sequence and level of headlines.
+:END:
+
+#+attr_texinfo: :sep ,
+- {{{kbd(M-RET)}}} ::
+
+ Insert new heading with same level as current. If point is in
+ a plain list item, a new item is created (see [[Plain Lists]]). When
+ this command is used in the middle of a line, the line is split and
+ the rest of the line becomes the new headline[fn:2].
+
+- {{{kbd(M-S-RET)}}} ::
+
+ Insert new TODO entry with same level as current heading.
+
+- {{{kbd(TAB)}}} in new, empty entry ::
+
+ In a new entry with no text yet, {{{kbd(TAB)}}} cycles through
+ reasonable levels.
+
+- {{{kbd(M-LEFT)}}}, {{{kbd(M-RIGHT)}}} ::
+
+ Promote or demote current heading by one level.
+
+- {{{kbd(M-UP)}}}, {{{kbd(M-DOWN)}}} ::
+
+ Move subtree up or down, i.e., swap with previous or next subtree of
+ same level.
+
+- {{{kbd(C-c C-w)}}} ::
+
+ Refile entry or region to a different location. See [[*Refile and
+ Copy]].
+
+- {{{kbd(C-x n s)}}}, {{{kbd(C-x n w)}}} ::
+
+ Narrow buffer to current subtree and widen it again.
+
+When there is an active region (Transient Mark mode), promotion and
+demotion work on all headlines in the region.
+
+** Sparse Trees
+:PROPERTIES:
+:DESCRIPTION: Matches embedded in context.
+:END:
+
+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[fn:3].
+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:
+
+- {{{kbd(C-c /)}}} ::
+
+ This prompts for an extra key to select a sparse-tree creating
+ command.
+
+- {{{kbd(C-c / r)}}} ::
+
+ Occur. Prompts for a regexp and shows a sparse tree with all
+ matches. Each match is also highlighted; the highlights disappear
+ by pressing {{{kbd(C-c C-c)}}}.
+
+ The other sparse tree commands select headings based on TODO
+ keywords, tags, or properties and will be discussed later in this
+ manual.
+
+** Plain Lists
+:PROPERTIES:
+:DESCRIPTION: Additional structure within an entry.
+:END:
+
+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 [[*Checkboxes]]). Org supports editing such lists, and
+every exporter (see [[*Exporting]]) can parse and format them.
+
+Org knows ordered lists, unordered lists, and description lists.
+
+#+attr_texinfo: :indic @bullet
+- /Unordered/ list items start with =-=, =+=, or =*= as bullets.
+
+- /Ordered/ list items start with =1.=, or =1)=.
+
+- /Description/ list use =::= to separate the /term/ from the
+ description.
+
+Items belonging to the same list must have the same indentation on the
+first line. An item ends before the next line that is indented like
+its bullet/number, or less. A list ends when all items are closed, or
+before two blank lines. An example:
+
+#+begin_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.
+ Important actors in this film are:
+ - Elijah Wood :: He plays Frodo
+ - Sean Astin :: He plays Sam, Frodo's friend.
+#+end_example
+
+The following commands act on items when point is in the first line of
+an item (the line with the bullet or number).
+
+#+attr_texinfo: :sep ,
+- {{{kbd(TAB)}}} ::
+
+ Items can be folded just like headline levels.
+
+- {{{kbd(M-RET)}}} ::
+
+ Insert new item at current level. With a prefix argument, force
+ a new heading (see [[*Structure Editing]]).
+
+- {{{kbd(M-S-RET)}}} ::
+
+ Insert a new item with a checkbox (see [[*Checkboxes]]).
+
+- {{{kbd(M-S-UP)}}}, {{{kbd(M-S-DOWN)}}} ::
+
+ Move the item including subitems up/down (swap with previous/next
+ item of same indentation). If the list is ordered, renumbering is
+ automatic.
+
+- {{{kbd(M-LEFT)}}}, {{{kbd(M-RIGHT)}}} ::
+
+ Decrease/increase the indentation of an item, leaving children
+ alone.
+
+- {{{kbd(M-S-LEFT)}}}, {{{kbd(M-S-RIGHT)}}} ::
+
+ Decrease/increase the indentation of the item, including subitems.
+
+- {{{kbd(C-c C-c)}}} ::
+
+ If there is a checkbox (see [[*Checkboxes]]) in the item line, toggle
+ the state of the checkbox. Also verify bullets and indentation
+ consistency in the whole list.
+
+- {{{kbd(C-c -)}}} ::
+
+ Cycle the entire list level through the different itemize/enumerate
+ bullets (=-=, =+=, =*=, =1.=, =1)=).
+
+* Tables
+:PROPERTIES:
+:DESCRIPTION: Pure magic for quick formatting.
+:END:
+
+Org comes with a fast and intuitive table editor. Spreadsheet-like
+calculations are supported in connection with the Emacs Calc package
+(see [[info:calc][GNU Emacs Calculator Manual]]).
+
+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. A table might look like this:
+
+#+begin_example
+| Name | Phone | Age |
+|-------+-------+-----|
+| Peter | 1234 | 17 |
+| Anna | 4321 | 25 |
+#+end_example
+
+A table is re-aligned automatically each time you press {{{kbd(TAB)}}}
+or {{{kbd(RET)}}} or {{{kbd(C-c C-c)}}} inside the table.
+{{{kbd(TAB)}}} also moves to the next field ({{{kbd(RET)}}} 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|
+: |-
+
+#+texinfo: @noindent
+and then press {{{kbd(TAB)}}} to align the table and start filling in
+fields. Even faster would be to type =|Name|Phone|Age= followed by
+{{{kbd(C-c RET)}}}.
+
+When typing text into a field, Org treats {{{kbd(DEL)}}},
+{{{kbd(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
+{{{kbd(TAB)}}}, {{{kbd(S-TAB)}}} or {{{kbd(RET)}}}/, the field is
+automatically made blank.
+
+** Creation and conversion
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(C-c |)}}} ::
+
+ Convert the active region to table. If every line contains at least
+ one {{{kbd(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.
+
+ If there is no active region, this command creates an empty Org
+ table. But it is easier just to start typing, like {{{kbd(|
+ N a m e | P h o n e | A g e RET | - TAB)}}}.
+
+** Re-aligning and field motion
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+attr_texinfo: :sep ,
+- {{{kbd(C-c C-c)}}} ::
+
+ Re-align the table without moving point.
+
+- {{{kbd(TAB)}}} ::
+
+ Re-align the table, move to the next field. Creates a new row if
+ necessary.
+
+- {{{kbd(S-TAB)}}} ::
+
+ Re-align, move to previous field.
+
+- {{{kbd(RET)}}} ::
+
+ Re-align the table and move down to next row. Creates a new row if
+ necessary.
+
+- {{{kbd(S-UP)}}}, {{{kbd(S-DOWN)}}}, {{{kbd(S-LEFT)}}}, {{{kbd(S-RIGHT)}}} ::
+
+ Move a cell up, down, left, and right by swapping with adjacent
+ cell.
+
+** Column and row editing
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(M-LEFT)}}}, {{{kbd(M-RIGHT)}}} ::
+
+ Move the current column left/right.
+
+- {{{kbd(M-S-LEFT)}}} ::
+
+ Kill the current column.
+
+- {{{kbd(M-S-RIGHT)}}} ::
+
+ Insert a new column to the left of point position.
+
+- {{{kbd(M-UP)}}}, {{{kbd(M-DOWN)}}} ::
+
+ Move the current row up/down.
+
+- {{{kbd(M-S-UP)}}} ::
+
+ Kill the current row or horizontal line.
+
+- {{{kbd(M-S-DOWN)}}} ::
+
+ Insert a new row above the current row. With a prefix argument, the
+ line is created below the current one.
+
+- {{{kbd(C-c -)}}} ::
+
+ Insert a horizontal line below current row. With a prefix argument,
+ the line is created above the current line.
+
+- {{{kbd(C-c RET)}}} ::
+
+ Insert a horizontal line below current row, and move the point into
+ the row below that line.
+
+- {{{kbd(C-c ^)}}} ::
+
+ 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.
+
+* Hyperlinks
+:PROPERTIES:
+:DESCRIPTION: Notes in context.
+:END:
+
+Like HTML, Org provides links inside a file, external links to other
+files, Usenet articles, emails, and much more.
+
+Org recognizes plain URIs, possibly wrapped within angle brackets, and
+activate them as clickable links. The general link format, however,
+looks like this:
+
+: [[LINK][DESCRIPTION]]
+
+#+texinfo: @noindent
+or alternatively
+
+: [[LINK]]
+
+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]]=.
+To edit the invisible {{{var(LINK)}}} part, use {{{kbd(C-c C-l)}}}
+with the point on the link.
+
+** Internal links
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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=.
+
+Links such as =[[My Target]]= or =[[My Target][Find my target]]= lead
+to a text search in the current file for the corresponding target,
+which looks like =<<My Target>>=.
+
+** External Links
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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. Here are some examples:
+
+| =http://www.astro.uva.nl/=dominik= | on the web |
+| =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:projects.org= | another Org file |
+| =docview:papers/last.pdf::NNN= | open in DocView mode at page {{{var(NNN)}}} |
+| =id:B7423F4D-2E8A-471B-8810-C40F074717E9= | link to heading by ID |
+| =news:comp.emacs= | Usenet link |
+| =mailto:adent@galaxy.net= | mail link |
+| =mhe:folder#id= | MH-E message link |
+| =rmail:folder#id= | Rmail message link |
+| =gnus:group#id= | Gnus article link |
+| =bbdb:R.*Stallman= | BBDB link (with regexp) |
+| =irc:/irc.com/#emacs/bob= | IRC link |
+| =info:org#Hyperlinks= | Info node link |
+
+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. Here are a few
+examples,, together with an explanation:
+
+| =file:~/code/main.c::255= | Find line 255 |
+| =file:~/xx.org::My Target= | Find =<<My Target>>= |
+| =[[file:~/xx.org::#my-custom-id]]= | Find entry with a custom ID |
+
+** Handling Links
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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 {{{kbd(M-x
+org-store-link)}}}. Because of its importance, we suggest to bind it
+to a widely available key (see [[*Activation]]). It stores a link to the
+current location. The link is stored for later insertion into an Org
+buffer---see below.
+
+From an Org buffer, the following commands create, navigate or, more
+generally, act on links.
+
+#+attr_texinfo: :sep ,
+- {{{kbd(C-c C-l)}}} ::
+
+ Insert a link. This prompts for a link to be inserted into the
+ buffer. You can just type a link, or use history keys {{{kbd(UP)}}}
+ and {{{kbd(DOWN)}}} to access stored links. You will be prompted
+ for the description part of the link.
+
+ When called with a {{{kbd(C-u)}}} prefix argument, file name
+ completion is used to link to a file.
+
+- {{{kbd(C-c C-l)}}} (with point on existing link) ::
+
+ When point is on an existing link, {{{kbd(C-c C-l)}}} allows you to
+ edit the link and description parts of the link.
+
+- {{{kbd(C-c C-o)}}} ::
+
+ Open link at point.
+
+- {{{kbd(C-c &)}}} ::
+
+ Jump back to a recorded position. A position is recorded by the
+ commands following internal links, and by {{{kbd(C-c %)}}}. Using
+ this command several times in direct succession moves through a ring
+ of previously recorded positions.
+
+* TODO Items
+:PROPERTIES:
+:DESCRIPTION: Every tree branch can be a TODO item.
+:END:
+
+Org mode does not require TODO lists to live in separate documents.
+Instead, TODO items are part of a 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 TODO items remain in the context from which they
+emerged.
+
+Org mode provides methods to give you an overview of all the things
+that you have to do, collected from many files.
+
+** Basic TODO Functionality
+:PROPERTIES:
+:DESCRIPTION: Marking and displaying TODO entries.
+:ALT_TITLE: TODO Basics
+:END:
+
+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:
+
+#+attr_texinfo: :sep ,
+- {{{kbd(C-c C-t)}}} ::
+
+ Rotate the TODO state of the current item among
+
+ : ,-> (unmarked) -> TODO -> DONE --.
+ : '--------------------------------'
+
+ The same rotation can also be done "remotely" from the agenda buffer
+ with the {{{kbd(t)}}} command key (see [[*Commands in the Agenda
+ Buffer]]).
+
+- {{{kbd(S-RIGHT)}}}, {{{kbd(S-LEFT)}}} ::
+
+ Select the following/preceding TODO state, similar to cycling.
+
+- {{{kbd(C-c / t)}}} ::
+
+ View TODO items in a /sparse tree/ (see [[*Sparse Trees]]). Folds the
+ entire buffer, but shows all TODO items---with not-DONE state---and
+ the headings hierarchy above them.
+
+- {{{kbd(M-x org-agenda t)}}} ::
+
+ Show the global TODO list. Collects the TODO items (with not-DONE
+ states) from all agenda files (see [[*Agenda Views]]) into a single
+ buffer. See [[*The Global TODO List]], for more information.
+
+- {{{kbd(S-M-RET)}}} ::
+
+ 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.
+
+** Multi-state Workflow
+:PROPERTIES:
+:DESCRIPTION: More than just on/off.
+:END:
+
+You can use TODO keywords to indicate @emph{sequential} working progress
+states:
+
+#+begin_src emacs-lisp
+(setq org-todo-keywords
+ '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
+#+end_src
+
+#+texinfo: @noindent
+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 {{{kbd(C-c C-t)}}} cycles
+an entry from =TODO= to =FEEDBACK=, then to =VERIFY=, and finally to
+=DONE= and =DELEGATED=.
+
+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. Your setup would then look like
+this:
+
+#+begin_src emacs-lisp
+(setq org-todo-keywords
+ '((sequence "TODO(t)" "|" "DONE(d)")
+ (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")))
+#+end_src
+
+#+texinfo: @noindent
+The keywords should all be different, this helps Org mode to keep
+track of which subsequence should be used for a given entry. The
+example also shows how to define keys for fast access of a particular
+state, by adding a letter in parenthesis after each keyword---you will
+be prompted for the key after {{{kbd(C-c C-t)}}}.
+
+To define TODO keywords that are valid only in a single file, use the
+following text anywhere in the file.
+
+#+begin_example
+,#+TODO: TODO(t) | DONE(d)
+,#+TODO: REPORT(r) BUG(b) KNOWNCAUSE(k) | FIXED(f)
+,#+TODO: | CANCELED(c)
+#+end_example
+
+After changing one of these lines, use {{{kbd(C-c C-c)}}} with the
+cursor still in the line to make the changes known to Org mode.
+
+** Progress Logging
+:PROPERTIES:
+:DESCRIPTION: Dates and notes for progress.
+:END:
+
+To record a timestamp and a note when changing a TODO state, call the
+command ~org-todo~ with a prefix argument.
+
+#+attr_texinfo: :sep ,
+- {{{kbd(C-u C-c C-t)}}} ::
+ Prompt for a note and record a the time of the TODO state change.
+
+Org mode can also 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 [[*Clocking Work Time]].
+
+*** Closing items
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+The most basic logging is to keep track of /when/ a certain TODO item
+was marked as done. This can be achieved with[fn:4]
+
+#+begin_src emacs-lisp
+(setq org-log-done 'time)
+#+end_src
+
+#+texinfo: @noindent
+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 want to record a note along with the timestamp, use[fn:5]
+
+#+begin_src emacs-lisp
+(setq org-log-done 'note)
+#+end_src
+
+#+texinfo: @noindent
+You are then be prompted for a note, and that note is stored below the
+entry with a =Closing Note= heading.
+
+*** Tracking TODO state changes
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+You might want to keep track of TODO state changes. You can either
+record just a timestamp, or a time-stamped note for a change. These
+records are inserted after the headline as an itemized list. When
+taking a lot of notes, you might want to get the notes out of the way
+into a drawer. Customize the variable ~org-log-into-drawer~ to get
+this behavior.
+
+For state logging, Org mode expects configuration on a per-keyword
+basis. This is achieved by adding special markers =!= (for
+a timestamp) and =@= (for a note) in parentheses after each keyword.
+For example:
+
+: #+TODO: TODO(t) WAIT(w@/!) | DONE(d!) CANCELED(c@)
+
+#+texinfo: @noindent
+defines TODO keywords and fast access keys, and 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=. The same syntax
+works also when setting ~org-todo-keywords~.
+
+** Priorities
+:PROPERTIES:
+:DESCRIPTION: Some things are more important than others.
+:END:
+
+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
+
+Org mode supports three priorities: =A=, =B=, and =C=. =A= is the
+highest, =B= the default if none is given. Priorities make
+a difference only in the agenda.
+
+#+attr_texinfo: :sep ;
+- {{{kbd(C-c \,)}}} ::
+
+ Set the priority of the current headline. Press {{{kbd(A)}}},
+ {{{kbd(B)}}} or {{{kbd(C)}}} to select a priority, or {{{kbd(SPC)}}}
+ to remove the cookie.
+
+- {{{kbd(S-UP)}}} (~org-priority-up~); {{{kbd(S-DOWN)}}} (~org-priority-down~) ::
+
+ Increase/decrease the priority of the current headline.
+
+** Breaking Tasks Down into Subtasks
+:PROPERTIES:
+:DESCRIPTION: Splitting a task into manageable pieces.
+:ALT_TITLE: Breaking Down Tasks
+:END:
+
+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. To keep an
+overview of the fraction of subtasks that have already been marked
+as done, insert either =[/]= or =[%]= anywhere in the headline. These
+cookies are updated each time the TODO status of a child changes, or
+when pressing {{{kbd(C-c C-c)}}} on the cookie. For example:
+
+#+begin_example
+,* Organize Party [33%]
+,** TODO Call people [1/2]
+,*** TODO Peter
+,*** DONE Sarah
+,** TODO Buy food
+,** DONE Talk to neighbor
+#+end_example
+
+** Checkboxes
+:PROPERTIES:
+:DESCRIPTION: Tick-off lists.
+:END:
+
+Every item in a plain list (see [[*Plain Lists]]) can be made into
+a checkbox by starting it with the string =[ ]=. Checkboxes are not
+included into the global TODO list, so they are often great to split
+a task into a number of simple steps.
+
+Here is an example of a checkbox list.
+
+#+begin_example
+,* TODO Organize party [2/4]
+ - [-] call people [1/2]
+ - [ ] Peter
+ - [X] Sarah
+ - [X] order food
+#+end_example
+
+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 following commands work with checkboxes:
+
+- {{{kbd(C-c C-c)}}} ::
+
+ Toggle checkbox status or---with prefix argument---checkbox presence
+ at point.
+
+- {{{kbd(M-S-RET)}}} ::
+
+ Insert a new item with a checkbox. This works only if point is
+ already in a plain list item (see [[*Plain Lists]]).
+
+* Tags
+:PROPERTIES:
+:DESCRIPTION: Tagging headlines and matching sets of tags.
+:END:
+
+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.
+
+** Tag inheritance
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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
+
+#+begin_example
+,* Meeting with the French group :work:
+,** Summary by Frank :boss:notes:
+,*** TODO Prepare slides for him :action:
+#+end_example
+
+#+texinfo: @noindent
+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[fn:6]:
+
+: #+FILETAGS: :Peter:Boss:Secret:
+
+** Setting tags
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+Tags can simply be typed into the buffer at the end of a headline.
+After a colon, {{{kbd(M-TAB)}}} offers completion on tags. There is
+also a special command for inserting tags:
+
+- {{{kbd(C-c C-q)}}} ::
+
+ Enter new tags for the current headline. Org mode either offers
+ completion or a special single-key interface for setting tags, see
+ below.
+
+- {{{kbd(C-c C-c)}}} ::
+
+ When point is in a headline, this does the same as {{{kbd(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 using the =TAGS= keyword, like
+
+: #+TAGS: @work @home @tennisclub
+: #+TAGS: laptop car pc sailboat
+
+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:
+
+#+begin_src emacs-lisp
+(setq org-tag-alist '(("@work" . ?w) ("@home" . ?h) ("laptop" . ?l)))
+#+end_src
+
+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)
+
+** Tag groups
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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.
+
+You can set group tags by using brackets and inserting a colon between
+the group tag and its related tags:
+
+: #+TAGS: [ GTD : Control Persp ]
+
+#+texinfo: @noindent
+or, if tags in the group should be mutually exclusive:
+
+: #+TAGS: { Context : @Home @Work }
+
+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.
+
+If you want to ignore group tags temporarily, toggle group tags
+support with ~org-toggle-tags-groups~, bound to {{{kbd(C-c C-x q)}}}.
+
+** Tag searches
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(C-c / m)}}} or {{{kbd(C-c \)}}} ::
+
+ Create a sparse tree with all headlines matching a tags search.
+ With a {{{kbd(C-u)}}} prefix argument, ignore headlines that are not
+ a TODO line.
+
+- {{{kbd(M-x org-agenda m)}}} ::
+
+ Create a global list of tag matches from all agenda files. See
+ [[*Matching Tags and Properties]].
+
+- {{{kbd(M-x org-agenda M)}}} ::
+
+ 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 more detailed description
+with many examples, see [[*Matching Tags and Properties]].
+
+* Properties
+:PROPERTIES:
+:DESCRIPTION: Storing information about an entry.
+:END:
+
+Properties are key-value pairs associated with an entry. They live in
+a special drawer with the name =PROPERTIES=. Each property is
+specified on a single line, with the key (surrounded by colons) first,
+and the value after it:
+
+#+begin_example
+,* CD collection
+,** Classic
+,*** Goldberg Variations
+ :PROPERTIES:
+ :Title: Goldberg Variations
+ :Composer: J.S. Bach
+ :Publisher: Deutsche Grammophon
+ :NDisks: 1
+ :END:
+#+end_example
+
+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:
+
+#+begin_example
+,* CD collection
+ :PROPERTIES:
+ :NDisks_ALL: 1 2 3 4
+ :Publisher_ALL: "Deutsche Grammophon" Philips EMI
+ :END:
+#+end_example
+
+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
+
+The following commands help to work with properties:
+
+- {{{kbd(C-c C-x p)}}} ::
+
+ Set a property. This prompts for a property name and a value.
+
+- {{{kbd(C-c C-c d)}}} ::
+
+ Remove a property from the current entry.
+
+To create sparse trees and special lists with selection based on
+properties, the same commands are used as for tag searches (see
+[[*Tags]]). The syntax for the search string is described in [[*Matching
+Tags and Properties]].
+
+* Dates and Times
+:PROPERTIES:
+:DESCRIPTION: Making items useful for planning.
+:END:
+
+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.
+
+** Timestamps
+:PROPERTIES:
+:DESCRIPTION: Assigning a time to a tree entry.
+:END:
+
+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>=.
+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 [[*The 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.
+
+ #+begin_example
+ ,* Meet Peter at the movies
+ <2006-11-01 Wed 19:15>
+ ,* Discussion on climate change
+ <2006-11-02 Thu 20:00-22:00>
+ #+end_example
+
+- 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:
+
+ #+begin_example
+ ,* Pick up Sam at school
+ <2007-05-16 Wed 12:30 +1w>
+ #+end_example
+
+- Diary-style expression entries ::
+
+ #+cindex: diary style timestamps
+ #+cindex: sexp timestamps
+ For more complex date specifications, Org mode supports using the
+ special expression diary entries implemented in the Emacs Calendar
+ package. For example, with optional time:
+
+ #+begin_example
+ ,* 22:00-23:00 The nerd meeting on every 2nd Thursday of the month
+ <%%(diary-float t 4 2)>
+ #+end_example
+
+- Time/Date range ::
+
+ Two timestamps connected by =--= denote a range.
+
+ #+begin_example
+ ,** Meeting in Amsterdam
+ <2004-08-23 Mon>--<2004-08-26 Thu>
+ #+end_example
+
+- 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.
+
+ #+begin_example
+ ,* Gillian comes late for the fifth time
+ [2006-11-01 Wed]
+ #+end_example
+
+** Creating Timestamps
+:PROPERTIES:
+:DESCRIPTION: Commands that insert timestamps.
+:END:
+
+For Org mode to recognize timestamps, they need to be in the specific
+format. All commands listed below produce timestamps in the correct
+format.
+
+#+attr_texinfo: :sep ,
+- {{{kbd(C-c .)}}} ::
+
+ 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. With
+ a prefix argument, it also adds the current time.
+
+- {{{kbd(C-c !)}}} ::
+
+ Like {{{kbd(C-c .)}}}, but insert an inactive timestamp that does
+ not cause an agenda entry.
+
+- {{{kbd(S-LEFT)}}}, {{{kbd(S-RIGHT)}}} ::
+
+ Change date at point by one day.
+
+- {{{kbd(S-UP)}}}, {{{kbd(S-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.
+
+
+When Org mode prompts for a date/time, it accepts any string
+containing some date and/or time information, and intelligently
+interprets the string, deriving defaults for unspecified information
+from the current date and time. You can also select a date in the
+pop-up calendar. See the manual for more information on how exactly
+the date/time prompt works.
+
+** Deadlines and Scheduling
+:PROPERTIES:
+:DESCRIPTION: Planning your work.
+:END:
+
+A timestamp may be preceded by special keywords to facilitate
+planning:
+
+- {{{kbd(C-c C-d)}}} ::
+
+ Insert =DEADLINE= keyword along with a time stamp, in the line
+ following the headline.
+
+ 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 as
+ done. An example:
+
+ #+begin_example
+ ,*** TODO write article about the Earth for the Guide
+ DEADLINE: <2004-02-29 Sun>
+ The editor in charge is [[bbdb:Ford Prefect]]
+ #+end_example
+
+- {{{kbd(C-c C-s)}}} ::
+
+ Insert =SCHEDULED= keyword along with a stamp, in the line following
+ the headline.
+
+ Meaning: you are planning to start working on that task on the given
+ date[fn:7].
+
+ The headline is listed under the given date[fn:8]. In addition,
+ a reminder that the scheduled date has passed is present in the
+ compilation for /today/, until the entry is marked as done, i.e.,
+ the task is automatically forwarded until completed.
+
+ #+begin_example
+ ,*** TODO Call Trillian for a date on New Years Eve.
+ SCHEDULED: <2004-12-25 Sat>
+ #+end_example
+
+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. In the following example:
+
+#+begin_example
+,** TODO Pay the rent
+ DEADLINE: <2005-10-01 Sat +1m>
+#+end_example
+
+#+texinfo: @noindent
+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.
+
+** Clocking Work Time
+:PROPERTIES:
+:DESCRIPTION: Tracking how long you spent on a task.
+:END:
+
+Org mode allows you to clock the time you spend on specific tasks in
+a project.
+
+#+attr_texinfo: :sep ,
+- {{{kbd(C-c C-x C-i)}}} ::
+
+ Start the clock on the current item (clock-in). This inserts the
+ =CLOCK= keyword together with a timestamp. When called with
+ a {{{kbd(C-u)}}} prefix argument, select the task from a list of
+ recently clocked tasks.
+
+- {{{kbd(C-c C-x C-o)}}} ::
+
+ 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=.
+
+- {{{kbd(C-c C-x C-e)}}} ::
+
+ Update the effort estimate for the current clock task.
+
+- {{{kbd(C-c C-x C-q)}}} ::
+
+ Cancel the current clock. This is useful if a clock was started by
+ mistake, or if you ended up working on something else.
+
+- {{{kbd(C-c C-x C-j)}}} ::
+
+ Jump to the headline of the currently clocked in task. With
+ a {{{kbd(C-u)}}} prefix argument, select the target task from a list
+ of recently clocked tasks.
+
+The {{{kbd(l)}}} key may be used in the agenda (see [[*The Weekly/daily
+Agenda]]) to show which tasks have been worked on or closed during
+a day.
+
+* Capture, Refile, Archive
+:PROPERTIES:
+:DESCRIPTION: The ins and outs for projects.
+:END:
+
+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.
+
+** Capture
+:PROPERTIES:
+:DESCRIPTION: Capturing new stuff.
+:END:
+
+Capture lets you quickly store notes with little interruption of your
+work flow. You can define templates for new entries and associate
+them with different targets for storing notes.
+
+*** Setting up capture
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+The following customization sets a default target[fn:9] file for notes.
+
+#+begin_src emacs-lisp
+(setq org-default-notes-file (concat org-directory "/notes.org"))
+#+end_src
+
+You may also define a global key for capturing new material (see
+[[*Activation]]).
+
+*** Using capture
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(M-x org-capture)}}} ::
+
+ Start a capture process, placing you into a narrowed indirect buffer
+ to edit.
+
+- {{{kbd(C-c C-c)}}} ::
+
+ Once you have finished entering information into the capture buffer,
+ {{{kbd(C-c C-c)}}} returns you to the window configuration before
+ the capture process, so that you can resume your work without
+ further distraction.
+
+- {{{kbd(C-c C-w)}}} ::
+
+ Finalize the capture process by refiling the note to a different
+ place (see [[*Refile and Copy]]).
+
+- {{{kbd(C-c C-k)}}} ::
+
+ Abort the capture process and return to the previous state.
+
+*** Capture templates
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+You can use templates for different types of capture items, and for
+different target locations. 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:
+
+#+begin_src emacs-lisp
+(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")))
+#+end_src
+
+If you then press {{{kbd(t)}}} from the capture menu, Org will prepare
+the template for you like this:
+
+: * TODO
+: [[file:LINK TO WHERE YOU INITIATED CAPTURE]]
+
+#+texinfo: @noindent
+During expansion of the template, special %-escapes[fn:10] allow
+dynamic insertion of content. Here is a small selection of the
+possibilities, consult the manual for more.
+
+| =%a= | annotation, normally the link created with ~org-store-link~ |
+| =%i= | initial content, the region when capture is called with {{{kbd(C-u)}}} |
+| =%t=, =%T= | timestamp, date only, or date and time |
+| =%u=, =%U= | like above, but inactive timestamps |
+| =%?= | after completing the template, position point here |
+
+** Refile and Copy
+:PROPERTIES:
+:DESCRIPTION: Moving/copying a tree from one place to another.
+:END:
+
+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:
+
+- {{{kbd(C-c C-w)}}} ::
+
+ 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.
+
+ 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.
+
+- {{{kbd(C-u C-c C-w)}}} ::
+
+ Use the refile interface to jump to a heading.
+
+- {{{kbd(C-u C-u C-c C-w)}}} ::
+
+ Jump to the location where ~org-refile~ last moved a tree to.
+
+- {{{kbd(C-c M-w)}}} ::
+
+ Copying works like refiling, except that the original note is not
+ deleted.
+
+** Archiving
+:PROPERTIES:
+:DESCRIPTION: What to do with finished products.
+:END:
+
+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.
+
+The most common archiving action is to move a project tree to another
+file, the archive file.
+
+- {{{kbd(C-c C-x C-a)}}} ::
+
+ Archive the current entry using the command specified in the
+ variable ~org-archive-default-command~.
+
+- {{{kbd(C-c C-x C-s)}}} or short {{{kbd(C-c $)}}} ::
+
+ Archive the subtree starting at point position to the location given
+ by ~org-archive-location~.
+
+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::
+
+* Agenda Views
+:PROPERTIES:
+:DESCRIPTION: Collecting information into views.
+:END:
+
+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.
+
+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. Remote editing from the agenda buffer means,
+for example, that you can change the dates of deadlines and
+appointments from the agenda buffer. For commands available in the
+Agenda buffer, see [[*Commands in the Agenda Buffer]].
+
+** Agenda Files
+:PROPERTIES:
+:DESCRIPTION: Files being searched for agenda information.
+:END:
+
+The information to be shown is normally collected from all /agenda
+files/, the files listed in the variable ~org-agenda-files~.
+
+#+attr_texinfo: :sep or
+- {{{kbd(C-c [)}}} ::
+
+ 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.
+
+- {{{kbd(C-c ])}}} ::
+
+ Remove current file from the list of agenda files.
+
+- {{{kbd(C-')}}} or {{{kbd(C-\,)}}} ::
+
+ Cycle through agenda file list, visiting one file after the other.
+
+** The Agenda Dispatcher
+:PROPERTIES:
+:DESCRIPTION: Keyboard access to agenda views.
+:ALT_TITLE: Agenda Dispatcher
+:END:
+
+The views are created through a dispatcher, accessible with {{{kbd(M-x
+org-agenda)}}}, or, better, bound to a global key (see [[*Activation]]).
+It displays a menu from which an additional letter is required to
+execute a command. The dispatcher offers the following default
+commands:
+
+#+attr_texinfo: :sep ,
+- {{{kbd(a)}}} ::
+
+ Create the calendar-like agenda (see [[*The Weekly/daily Agenda]]).
+
+- {{{kbd(t)}}}, {{{kbd(T)}}} ::
+
+ Create a list of all TODO items (see [[*The Global TODO List]]).
+
+- {{{kbd(m)}}}, {{{kbd(M)}}} ::
+
+ Create a list of headlines matching a given expression (see
+ [[*Matching Tags and Properties]]).
+
+- {{{kbd(s)}}} ::
+
+ #+kindex: s @r{(Agenda dispatcher)}
+ 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.
+
+** The Weekly/Daily Agenda
+:PROPERTIES:
+:DESCRIPTION: What is available out of the box?
+:ALT_TITLE: Built-in Agenda Views
+:END:
+
+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.
+
+- {{{kbd(M-x org-agenda a)}}} ::
+
+ Compile an agenda for the current week from a list of Org files.
+ The agenda shows the entries for each day.
+
+Org mode understands the syntax of the diary and allows you to use
+diary expression entries directly in Org files:
+
+#+begin_example
+,* 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
+#+end_example
+
+Org can interact with Emacs appointments notification facility. To
+add the appointments of your agenda files, use the command
+~org-agenda-to-appt~.
+
+** The Global TODO List
+:PROPERTIES:
+:DESCRIPTION: All unfinished action items.
+:ALT_TITLE: Global TODO List
+:END:
+
+The global TODO list contains all unfinished TODO items formatted and
+collected into a single place. Remote editing of TODO items lets you
+can change the state of a TODO entry with a single key press. For
+commands available in the TODO list, see [[*Commands in the Agenda
+Buffer]].
+
+- {{{kbd(M-x org-agenda t)}}} ::
+
+ Show the global TODO list. This collects the TODO items from all
+ agenda files (see [[*Agenda Views]]) into a single buffer.
+
+- {{{kbd(M-x org-agenda T)}}} ::
+
+ Like the above, but allows selection of a specific TODO keyword.
+
+** Matching Tags and Properties
+:PROPERTIES:
+:DESCRIPTION: Structured information with fine-tuned search.
+:END:
+
+If headlines in the agenda files are marked with /tags/ (see [[*Tags]]),
+or have properties (see [[*Properties]]), 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
+{{{kbd(C-c / m)}}}.
+
+- {{{kbd(M-x org-agenda m)}}} ::
+
+ 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 [[*Tags]]). If you often need a specific search, define a custom
+ command for it (see [[*The Agenda Dispatcher]]).
+
+- {{{kbd(M-x org-agenda M)}}} ::
+
+ Like {{{kbd(m)}}}, but only select headlines that are also TODO
+ items.
+
+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=.
+
+You may also test for properties at the same time as matching tags,
+see the manual for more information.
+
+** Search View
+:PROPERTIES:
+:DESCRIPTION: Find entries by searching for text.
+:END:
+
+This agenda view is a general text search facility for Org mode
+entries. It is particularly useful to find notes.
+
+- {{{kbd(M-x org-agenda s)}}} (~org-search-view~) ::
+
+ #+kindex: s @r{(Agenda dispatcher)}
+ #+findex: 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.
+
+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=.
+
+Note that in addition to the agenda files, this command also searches
+the files listed in ~org-agenda-text-search-extra-files~.
+
+** Commands in the Agenda Buffer
+:PROPERTIES:
+:DESCRIPTION: Remote editing of Org trees.
+:ALT_TITLE: Agenda Commands
+:END:
+
+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. This is just a selection of the many commands, explore
+the agenda menu and the manual for a complete list.
+
+*** Motion
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(n)}}} ::
+
+ Next line (same as {{{kbd(DOWN)}}} and {{{kbd(C-n)}}}).
+
+- {{{kbd(p)}}} ::
+
+ Previous line (same as {{{kbd(UP)}}} and {{{kbd(C-p)}}}).
+
+*** View/Go to Org file
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(SPC)}}} ::
+
+ Display the original location of the item in another window.
+ With a prefix argument, make sure that drawers stay folded.
+
+- {{{kbd(TAB)}}} ::
+
+ Go to the original location of the item in another window.
+
+- {{{kbd(RET)}}} ::
+
+ Go to the original location of the item and delete other windows.
+
+*** Change display
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+attr_texinfo: :sep ,
+- {{{kbd(o)}}} ::
+
+ Delete other windows.
+
+- {{{kbd(v d)}}} or short {{{kbd(d)}}} ::
+
+ Switch to day view.
+
+- {{{kbd(v w)}}} or short {{{kbd(w)}}} ::
+
+ Switch to week view.
+
+- {{{kbd(f)}}} ::
+
+ 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.
+
+- {{{kbd(b)}}} ::
+
+ Go backward in time to display earlier dates.
+
+- {{{kbd(.)}}} ::
+
+ Go to today.
+
+- {{{kbd(j)}}} ::
+
+ Prompt for a date and go there.
+
+- {{{kbd(v l)}}} or {{{kbd(v L)}}} or short {{{kbd(l)}}} ::
+
+ Toggle Logbook mode. In Logbook mode, entries that were marked as
+ 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. When called with a {{{kbd(C-u)}}} prefix argument, show all
+ possible logbook entries, including state changes.
+
+- {{{kbd(r)}}}, {{{kbd(g)}}} ::
+
+ Recreate the agenda buffer, for example to reflect the changes after
+ modification of the timestamps of items.
+
+- {{{kbd(s)}}} ::
+
+ #+kindex: C-x C-s
+ #+findex: org-save-all-org-buffers
+ #+kindex: s
+ Save all Org buffers in the current Emacs session, and also the
+ locations of IDs.
+
+*** Remote editing
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(0--9)}}} ::
+
+ Digit argument.
+
+- {{{kbd(t)}}} ::
+
+ Change the TODO state of the item, both in the agenda and in the
+ original Org file.
+
+- {{{kbd(C-k)}}} ::
+
+ Delete the current agenda item along with the entire subtree
+ belonging to it in the original Org file.
+
+- {{{kbd(C-c C-w)}}} ::
+
+ Refile the entry at point.
+
+- {{{kbd(a)}}} ::
+
+ Archive the subtree corresponding to the entry at point using the
+ default archiving command set in ~org-archive-default-command~.
+
+- {{{kbd($)}}} ::
+
+ Archive the subtree corresponding to the current headline.
+
+- {{{kbd(C-c C-s)}}} ::
+
+ Schedule this item. With a prefix argument, remove the
+ scheduling timestamp
+
+- {{{kbd(C-c C-d)}}} ::
+
+ Set a deadline for this item. With a prefix argument, remove the
+ deadline.
+
+- {{{kbd(S-RIGHT)}}} ::
+
+ Change the timestamp associated with the current line by one day
+ into the future.
+
+- {{{kbd(S-LEFT)}}} ::
+
+ Change the timestamp associated with the current line by one day
+ into the past.
+
+- {{{kbd(I)}}} ::
+
+ Start the clock on the current item.
+
+- {{{kbd(O)}}} ::
+
+ Stop the previously started clock.
+
+- {{{kbd(X)}}} ::
+
+ Cancel the currently running clock.
+
+- {{{kbd(J)}}} ::
+
+ Jump to the running clock in another window.
+
+*** Quit and exit
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(q)}}} ::
+
+ Quit agenda, remove the agenda buffer.
+
+- {{{kbd(x)}}} ::
+
+ Exit agenda, remove the agenda buffer and all buffers loaded by
+ Emacs for the compilation of the agenda.
+
+** Custom Agenda Views
+:PROPERTIES:
+:DESCRIPTION: Defining special searches and views.
+:END:
+
+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 {{{kbd(C)}}} from the agenda dispatcher (see [[*The
+Agenda Dispatcher]]). You can also directly set it with Emacs Lisp in
+the Emacs init file. The following example contains all valid agenda
+views:
+
+#+begin_src emacs-lisp
+(setq org-agenda-custom-commands
+ '(("w" todo "WAITING")
+ ("u" tags "+boss-urgent")
+ ("v" tags-todo "+boss-urgent")))
+#+end_src
+
+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 is just a single character. 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:
+
+- {{{kbd(w)}}} ::
+
+ as a global search for TODO entries with =WAITING= as the TODO
+ keyword.
+
+- {{{kbd(u)}}} ::
+
+ as a global tags search for headlines tagged =boss= but not
+ =urgent=.
+
+- {{{kbd(v)}}} ::
+
+ The same search, but limiting it to headlines that are also TODO
+ items.
+
+* Markup for Rich Contents
+:PROPERTIES:
+:DESCRIPTION: Compose beautiful documents.
+:ALT_TITLE: Markup
+:END:
+
+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. Used in
+conjunction with the export framework (see [[*Exporting]]), you can author
+beautiful documents in Org.
+
+** Paragraphs
+:PROPERTIES:
+:DESCRIPTION: The basic unit of text.
+:END:
+
+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_example
+,#+BEGIN_VERSE
+ Great clouds overhead
+ Tiny black birds rise and fall
+ Snow covers Emacs
+
+ ---AlexSchroeder
+,#+END_VERSE
+#+end_example
+
+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_example
+,#+BEGIN_QUOTE
+Everything should be made as simple as possible,
+but not any simpler ---Albert Einstein
+,#+END_QUOTE
+#+end_example
+
+If you would like to center some text, do it like this:
+
+#+begin_example
+,#+BEGIN_CENTER
+Everything should be made as simple as possible, \\
+but not any simpler
+,#+END_CENTER
+#+end_example
+
+** Emphasis and Monospace
+:PROPERTIES:
+:DESCRIPTION: Bold, italic, etc.
+:END:
+
+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 specific syntax; it is
+exported verbatim.
+
+** Embedded LaTeX
+:PROPERTIES:
+:DESCRIPTION: LaTeX can be freely used inside Org documents.
+:END:
+
+For scientific notes which need to be able to contain mathematical
+symbols and the occasional formula, Org mode supports embedding LaTeX
+code into its files. You can directly use TeX-like syntax for special
+symbols, enter formulas and entire LaTeX environments.
+
+#+begin_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}.
+
+\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} \].
+#+end_example
+
+** Literal examples
+:PROPERTIES:
+:DESCRIPTION: Source code examples with special formatting.
+:END:
+
+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
+,#+BEGIN_EXAMPLE
+ Some example from a text file.
+,#+END_EXAMPLE
+#+end_example
+
+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:
+
+#+begin_example
+Here is an example
+ : Some example from a text file.
+#+end_example
+
+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.
+
+#+begin_example
+,#+BEGIN_SRC emacs-lisp
+ (defun org-xor (a b)
+ "Exclusive or."
+ (if a (not b) b))
+ ,#+END_SRC
+#+end_example
+
+To edit the example in a special buffer supporting this language, use
+{{{kbd(C-c ')}}} to both enter and leave the editing buffer.
+
+** Images
+:PROPERTIES:
+:DESCRIPTION: Display an image.
+:END:
+
+An image is a link to an image file that does not have a description
+part, for example
+
+: ./img/cat.jpg
+
+If you wish to define a caption for the image and maybe a label for
+internal cross references (see [[*Hyperlinks]]), make sure that the
+link is on a line by itself and precede it with =CAPTION= and =NAME=
+keywords as follows:
+
+#+begin_example
+,#+CAPTION: This is the caption for the next figure link (or table)
+,#+NAME: fig:SED-HR4049
+[[./img/a.jpg]]
+#+end_example
+
+** Creating Footnotes
+:PROPERTIES:
+:DESCRIPTION: Edit and read footnotes.
+:END:
+
+A footnote is defined in a paragraph that is started by a footnote
+marker in square brackets in column 0, no indentation allowed. The
+footnote reference is simply the marker in square brackets, inside
+text. For example:
+
+#+begin_example
+The Org homepage[fn:1] now looks a lot better than it used to.
+...
+[fn:1] The link is: https://orgmode.org
+#+end_example
+
+The following commands handle footnotes:
+
+- {{{kbd(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. When this
+ command is called with a prefix argument, a menu of additional
+ options including renumbering is offered.
+
+- {{{kbd(C-c C-c)}}} ::
+
+ Jump between definition and reference.
+
+* Exporting
+:PROPERTIES:
+:DESCRIPTION: Sharing and publishing notes.
+:END:
+
+Org can convert and export documents to a variety of other formats
+while retaining as much structure (see [[*Document Structure]]) and markup
+(see [[*Markup for Rich Contents]]) as possible.
+
+** The Export Dispatcher
+:PROPERTIES:
+:DESCRIPTION: The main interface.
+:END:
+
+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.
+
+- {{{kbd(C-c C-e)}}} ::
+
+ Invokes the export dispatcher interface.
+
+Org exports the entire buffer by default. If the Org buffer has an
+active region, then Org exports just that region.
+
+** Export Settings
+:PROPERTIES:
+:DESCRIPTION: Common export settings.
+:END:
+
+The exporter recognizes special lines in the buffer which provide
+additional information. These lines may be put anywhere in the file:
+
+: #+TITLE: I'm in the Mood for Org
+
+Most proeminent export options include:
+
+| =TITLE= | the title to be shown |
+| =AUTHOR= | the author (default taken from ~user-full-name~) |
+| =DATE= | a date, fixed, or an Org timestamp |
+| =EMAIL= | email address (default from ~user-mail-address~) |
+| =LANGUAGE= | language code, e.g., =en= |
+
+Option keyword sets can be inserted from the export dispatcher (see
+[[*The Export Dispatcher]]) using the =Insert template= command by
+pressing {{{kbd(#)}}}.
+
+** Table of Contents
+:PROPERTIES:
+:DESCRIPTION: The if and where of the table of contents.
+:END:
+
+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:
+
+#+begin_example
+,#+OPTIONS: toc:2 (only include two levels in TOC)
+,#+OPTIONS: toc:nil (no default TOC at all)
+#+end_example
+
+Org normally inserts the table of contents directly before the first
+headline of the file.
+
+** Include Files
+:PROPERTIES:
+:DESCRIPTION: Include additional files into a document.
+:END:
+
+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
+
+#+texinfo: @noindent
+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.
+
+You can visit the included file with {{{kbd(C-c ')}}}.
+
+** Comment Lines
+:PROPERTIES:
+:DESCRIPTION: What will not be exported.
+:END:
+
+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.
+The command below helps changing the comment status of a headline.
+
+- {{{kbd(C-c ;)}}} ::
+
+ Toggle the =COMMENT= keyword at the beginning of an entry.
+
+** ASCII/UTF-8 Export
+:PROPERTIES:
+:DESCRIPTION: Exporting to flat files with encoding.
+:END:
+
+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. UTF-8 export uses additional
+characters and symbols available in this encoding standards.
+
+#+attr_texinfo: :sep ,
+- {{{kbd(C-c C-e t a)}}}, {{{kbd(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.
+
+** HTML Export
+:PROPERTIES:
+:DESCRIPTION: Exporting to HTML.
+:END:
+
+Org mode contains an HTML exporter with extensive HTML formatting
+compatible with XHTML 1.0 strict standard.
+
+- {{{kbd(C-c C-e h h)}}} ::
+
+ 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.
+
+The HTML export back-end transforms =<= and =>= to =&lt;= and =&gt;=.
+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:<b>@@bold text@@html:</b>@@
+
+For larger raw HTML code blocks, use these HTML export code blocks:
+
+#+begin_example
+,#+HTML: Literal HTML code for export
+
+,#+BEGIN_EXPORT html
+ All lines between these markers are exported literally
+,#+END_EXPORT
+#+end_example
+
+** LaTeX Export
+:PROPERTIES:
+:DESCRIPTION: Exporting to @LaTeX{} and processing to PDF.
+:END:
+
+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.
+
+By default, the LaTeX output uses the /article/ class. You can change
+this by adding an option like =#+LATEX_CLASS: myclass= in your file.
+The class must be listed in ~org-latex-classes~.
+
+- {{{kbd(C-c C-e l l)}}} ::
+
+ Export to a LaTeX file with a =.tex= extension. For =myfile.org=,
+ Org exports to =myfile.tex=, overwriting without warning.
+
+- {{{kbd(C-c C-e l p)}}} ::
+
+ Export as LaTeX file and convert it to PDF file.
+
+- {{{kbd(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 insert any arbitrary LaTeX code, see
+[[*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_example
+,#+BEGIN_EXPORT latex
+ any arbitrary LaTeX code
+,#+END_EXPORT
+#+end_example
+
+** iCalendar Export
+:PROPERTIES:
+:DESCRIPTION: Exporting to iCalendar.
+:END:
+
+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.
+
+- {{{kbd(C-c C-e c f)}}} ::
+
+ Create iCalendar entries from the current Org buffer and store them
+ in the same directory, using a file extension =.ics=.
+
+- {{{kbd(C-c C-e c c)}}} ::
+
+ Create a combined iCalendar file from Org files in
+ ~org-agenda-files~ and write it to
+ ~org-icalendar-combined-agenda-file~ file name.
+
+* Publishing
+:PROPERTIES:
+:DESCRIPTION: Create a web site of linked Org files.
+:END:
+
+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.
+
+For detailed instructions about setup, see the manual. Here is an
+example:
+
+#+begin_src emacs-lisp
+(setq org-publish-project-alist
+ '(("org"
+ :base-directory "~/org/"
+ :publishing-function org-html-publish-to-html
+ :publishing-directory "~/public_html"
+ :section-numbers nil
+ :with-toc nil
+ :html-head "<link rel=\"stylesheet\"
+ href=\"../other/mystyle.css\"
+ type=\"text/css\"/>")))
+#+end_src
+
+- {{{kbd(C-c C-e P x)}}} ::
+
+ Prompt for a specific project and publish all files that belong to
+ it.
+
+- {{{kbd(C-c C-e P p)}}} ::
+
+ Publish the project containing the current file.
+
+- {{{kbd(C-c C-e P f)}}} ::
+
+ Publish only the current file.
+
+- {{{kbd(C-c C-e P a)}}} ::
+
+ 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.
+
+* Working with Source Code
+:PROPERTIES:
+:DESCRIPTION: Export, evaluate, and tangle code blocks.
+:END:
+
+Org mode provides a number of features for working with source code,
+including editing of code blocks in their native major mode,
+evaluation of code blocks, tangling of code blocks, and exporting code
+blocks and their results in several formats.
+
+A source code block conforms to this structure:
+
+#+begin_example
+,#+NAME: <name>
+,#+BEGIN_SRC <language> <switches> <header arguments>
+ <body>
+,#+END_SRC
+#+end_example
+
+#+texinfo: @noindent
+where:
+
+- =<name>= is a string used to uniquely name the code block,
+
+- =<language>= specifies the language of the code block, e.g.,
+ =emacs-lisp=, =shell=, =R=, =python=, etc.,
+
+- =<switches>= can be used to control export of the code block,
+
+- =<header arguments>= can be used to control many aspects of code
+ block behavior as demonstrated below,
+
+- =<body>= contains the actual source code.
+
+Use {{{kbd(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 {{{kbd(C-c ')}}} again to close the buffer
+and return to the Org buffer.
+
+** Using header arguments
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+A header argument is specified with an initial colon followed by the
+argument's name in lowercase.
+
+Header arguments can be set in several ways; Org prioritizes them in
+case of overlaps or conflicts by giving local settings a higher
+priority.
+
+- System-wide header arguments ::
+
+ Those are specified by customizing ~org-babel-default-header-args~
+ variable, or, for a specific language {{{var(LANG)}}}
+ ~org-babel-default-header-args:LANG~.
+
+- Header arguments in properties ::
+
+ You can set them using =header-args= property (see [[*Properties]])---or
+ =header-args:LANG= for language {{{var(LANG)}}}. Header arguments
+ set through properties drawers apply at the sub-tree level on down.
+
+- Header arguments in code blocks ::
+
+ Header arguments are most commonly set at the source code block
+ level, on the =BEGIN_SRC= line:
+
+ #+begin_example
+ ,#+NAME: factorial
+ ,#+BEGIN_SRC haskell :results silent :exports code :var n=0
+ fac 0 = 1
+ fac n = n * fac (n-1)
+ ,#+END_SRC
+ #+end_example
+
+ Code block header arguments can span multiple lines using =HEADER=
+ keyword on each line.
+
+** Evaluating code blocks
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+Use {{{kbd(C-c C-c)}}} to evaluate the current code block and insert
+its results in the Org document. By default, evaluation is only
+turned on for =emacs-lisp= code blocks, however support exists for
+evaluating blocks in many languages. For a complete list of supported
+languages see the manual. The following shows a code block and its
+results.
+
+#+begin_example
+,#+BEGIN_SRC emacs-lisp
+ (+ 1 2 3 4)
+,#+END_SRC
+
+,#+RESULTS:
+: 10
+#+end_example
+
+The following syntax is used to pass arguments to code blocks using
+the =var= header argument.
+
+: :var NAME=ASSIGN
+
+#+texinfo: @noindent
+{{{var(NAME)}}} is the name of the variable bound in the code block
+body. {{{var(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.
+
+** Results of evaluation
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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 controls the /collection/,
+/type/, /format/, and /handling/ of code block results.
+
+- Collection ::
+
+ How the results should be collected from the code block. You may
+ choose either =output= or =value= (the default).
+
+- Type ::
+
+ What result types to expect from the execution of the code block.
+ You may choose among =table=, =list=, =scalar=, and =file=. Org
+ tries to guess it if you do not provide it.
+
+- Format ::
+
+ How Org processes results. Some possible values are =code=,
+ =drawer=, =html=, =latex=, =link=, and =raw=.
+
+- Handling ::
+
+ How to insert the results once properly formatted. Allowed values
+ are =silent=, =replace= (the default), =append=, or =prepend=.
+
+Code blocks which output results to files---e.g.: graphs, diagrams and
+figures---can accept a =:file FILENAME= header argument, in which case
+the results are saved to the named file, and a link to the file is
+inserted into the buffer.
+
+** Exporting code blocks
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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.
+
+The =exports= header argument is to specify if that part of the Org
+file is exported to, say, HTML or LaTeX formats. It can be set to
+either =code=, =results=, =both= or =none=.
+
+** Extracting source code
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+Use {{{kbd(C-c C-v t)}}} to create pure source code files by
+extracting code from source blocks in the current buffer. This is
+referred to as "tangling"---a term adopted from the literate
+programming community. During tangling of code blocks their bodies
+are expanded using ~org-babel-expand-src-block~, which can expand both
+variable and "Noweb" style references. In order to tangle a code
+block it must have a =tangle= header argument, see the manual for
+details.
+
+* Miscellaneous
+:PROPERTIES:
+:DESCRIPTION: All the rest which did not fit elsewhere.
+:END:
+
+** Completion
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+Org has in-buffer completions with {{{kbd(M-TAB)}}}. No minibuffer is
+involved. Type one or more letters and invoke the hot key to complete
+the text in-place.
+
+For example, this command will complete TeX symbols after =\=, TODO
+keywords at the beginning of a headline, and tags after =:= in
+a headline.
+
+
+** Structure Templates
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+To quickly insert empty structural blocks, such as =#+BEGIN_SRC=
+... =#+END_SRC=, or to wrap existing text in such a block, use
+
+- {{{kbd(C-c C-\,)}}} ::
+
+ Prompt for a type of block structure, and insert the block at point.
+ If the region is active, it is wrapped in the block.
+
+** Clean view
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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:
+
+#+begin_example
+,* 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
+#+end_example
+
+This kind of view can be achieved dynamically at display time using
+Org Indent mode ({{{kbd(M-x org-indent-mode RET)}}}), which prepends
+intangible space to each line. You can turn on Org Indent mode for
+all files by customizing the variable ~org-startup-indented~, or you
+can turn it on for individual files using
+
+: #+STARTUP: indent
+
+If you want the indentation to be hard space characters so that the
+plain text file looks as similar as possible to the Emacs display, Org
+supports you by helping to indent (with {{{kbd(TAB)}}}) text below
+each headline, by hiding leading stars, and by only using levels 1, 3,
+etc to get two characters indentation for each level. To get this
+support in a file, use
+
+: #+STARTUP: hidestars odd
+
+* Export Setup :noexport:
+
+#+setupfile: doc-setup.org
+
+#+export_file_name: orgguide.texi
+
+#+texinfo_dir_category: Emacs editing modes
+#+texinfo_dir_title: Org Guide: (orgguide)
+#+texinfo_dir_desc: Abbreviated Org mode manual
+
+* Footnotes
+
+[fn:1] See the variable ~org-special-ctrl-a/e~ to configure special
+behavior of {{{kbd(C-a)}}} and {{{kbd(C-e)}}} in headlines.
+
+[fn:2] If you do not want the line to be split, customize the variable
+~org-M-RET-may-split-line~.
+
+[fn:3] See also the variable ~org-show-context-detail~ to decide how
+much context is shown around each match.
+
+[fn:4] The corresponding in-buffer setting is =#+STARTUP: logdone=.
+
+[fn:5] The corresponding in-buffer setting is =#+STARTUP:
+logenotedone=.
+
+[fn:6] As with all these in-buffer settings, pressing {{{kbd(C-c
+C-c)}}} activates any changes in the line.
+
+[fn:7] This is quite different from what is normally understood by
+/scheduling a meeting/, which is done in Org by just inserting a time
+stamp without keyword.
+
+[fn:8] It will still be listed on that date after it has been marked
+as done. If you do not like this, set the variable
+~org-agenda-skip-scheduled-if-done~.
+
+[fn:9] Using capture templates, you get finer control over capture
+locations. See [[*Capture templates]].
+
+[fn:10] If you need one of these sequences literally, escape the =%=
+with a backslash.
diff --git a/elpa/org-9.5.2/doc/org-manual.org b/elpa/org-9.5.2/doc/org-manual.org
new file mode 100644
index 0000000..5c9bf43
--- /dev/null
+++ b/elpa/org-9.5.2/doc/org-manual.org
@@ -0,0 +1,22234 @@
+#+title: The Org Manual
+#+subtitle: Release {{{version}}}
+#+author: The Org Mode Developers
+#+language: en
+
+
+#+texinfo: @insertcopying
+
+* Introduction
+:PROPERTIES:
+:DESCRIPTION: Getting started.
+:END:
+#+cindex: introduction
+
+** Summary
+:PROPERTIES:
+:DESCRIPTION: Brief summary of what Org does.
+:END:
+#+cindex: 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.
+
+#+cindex: FAQ
+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
+[[https://orgmode.org]].
+
+#+cindex: print edition
+An earlier version (7.3) of this manual is available as a [[http://www.network-theory.co.uk/org/manual/][paperback
+book from Network Theory Ltd.]].
+
+** Installation
+:PROPERTIES:
+:DESCRIPTION: Installing Org.
+:END:
+#+cindex: 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, you can use the Emacs package system or clone
+Org's git repository.
+
+We *strongly recommend* sticking to a single installation method.
+
+*** Using Emacs packaging system
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+Recent Emacs distributions include a packaging system which lets you
+install Elisp libraries. You can install Org from the "package menu",
+with {{{kbd(M-x list-packages)}}}. See [[info:emacs::Package Menu][Package Menu]].
+
+#+attr_texinfo: :tag Important
+#+begin_quote
+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.
+#+end_quote
+
+*** Using Org's git repository
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+You can clone Org's repository and install Org like this:
+
+#+begin_example
+$ cd ~/src/
+$ git clone https://git.savannah.gnu.org/git/emacs/org-mode.git
+$ cd org-mode/
+$ make autoloads
+#+end_example
+
+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 [[https://orgmode.org/worg/dev/org-build-system.html][Worg]].
+
+*** Installing Org's contributed packages
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+Org's repository used to contain =contrib/= directory for add-ons
+contributed by others. As of Org 9.5, the directory has bee moved to
+this new dedicated [[https://git.sr.ht/~bzg/org-contrib][org-contrib]] repository, which you can install
+separately.
+
+** Activation
+:PROPERTIES:
+:DESCRIPTION: How to activate Org for certain buffers.
+:END:
+#+cindex: activation
+#+cindex: autoload
+#+cindex: ELPA
+#+cindex: global key bindings
+#+cindex: key bindings, global
+
+Org mode buffers need Font Lock to be turned on: this is the default
+in Emacs[fn:1].
+
+There are compatibility issues between Org mode and some other Elisp
+packages (see [[*Packages that conflict with Org mode]]). Please take the
+time to check the list.
+
+#+findex: org-agenda
+#+findex: org-capture
+#+findex: org-store-link
+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
+[[info:elisp::Key Binding Conventions]]). Here are suggested bindings,
+please modify the keys to your own liking.
+
+#+begin_src emacs-lisp
+(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)
+#+end_src
+
+#+cindex: Org mode, turning on
+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; -*-
+
+#+vindex: org-insert-mode-line-in-empty-file
+#+texinfo: @noindent
+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 it, you can create an active
+region by using the mouse to select a region, or pressing
+{{{kbd(C-SPC)}}} twice before moving point.
+
+** Feedback
+:PROPERTIES:
+:DESCRIPTION: Bug reports, ideas, patches, etc.
+:END:
+#+cindex: feedback
+#+cindex: bug reports
+#+cindex: reporting a bug
+#+cindex: maintainer
+#+cindex: author
+
+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
+[[mailto:emacs-orgmode@gnu.org]]. You can subscribe to the list [[https://lists.gnu.org/mailman/listinfo/emacs-orgmode][from this
+web page]]. If you are not a member of the mailing list, your mail will
+be passed to the list after a moderator has approved it[fn:2]. We ask
+you to read and respect the [[https://www.gnu.org/philosophy/kind-communication.html][GNU Kind Communications Guidelines]] when
+sending messages on this mailing list.
+
+#+findex: org-version
+#+findex: org-submit-bug-report
+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 ({{{kbd(M-x
+emacs-version)}}}) and Org ({{{kbd(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 <RET>
+
+#+texinfo: @noindent
+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.
+
+#+begin_src emacs-lisp
+;;; 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"))
+#+end_src
+
+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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: backtrace of an error
+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 <RET>
+
+ #+texinfo: @noindent
+ or, from the menu: Org \rarr Refresh/Reload \rarr Reload Org uncompiled.
+
+2. Then, activate the debugger:
+
+ : M-x toggle-debug-on-error <RET>
+
+ #+texinfo: @noindent
+ or, from the menu: Options \rarr 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 {{{kbd(C-x
+ C-w)}}}---and attach it to your bug report.
+
+** Typesetting Conventions Used in this Manual
+:PROPERTIES:
+:DESCRIPTION: Typesetting conventions used in this manual.
+:ALT_TITLE: Conventions
+:END:
+
+*** TODO keywords, tags, properties, etc.
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+Org uses various syntactical elements: TODO keywords, tags, property
+names, keywords, blocks, etc. In this manual we use the following
+conventions:
+
+#+attr_texinfo: :sep ,
+- =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 usually 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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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, {{{kbd(M-RIGHT)}}} 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~.
+
+* Document Structure
+:PROPERTIES:
+:DESCRIPTION: A tree works like your brain.
+:END:
+
+#+cindex: document structure
+#+cindex: structure of document
+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 {{{kbd(TAB)}}} key.
+
+** Headlines
+:PROPERTIES:
+:DESCRIPTION: How to typeset Org tree headlines.
+:END:
+#+cindex: headlines
+#+cindex: outline tree
+#+vindex: org-special-ctrl-a/e
+#+vindex: org-special-ctrl-k
+#+vindex: org-ctrl-k-protect-subtree
+
+Headlines define the structure of an outline tree. Org headlines
+start on the left margin[fn:3] with one or more stars followed by
+a space. For example:
+
+#+begin_example
+,* Top level headline
+,** Second level
+,*** Third level
+ some text
+,*** Third level
+ more text
+,* Another top level headline
+#+end_example
+
+#+vindex: org-footnote-section
+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.
+This can be achieved using a Org Indent minor mode. See [[*A Cleaner
+Outline View]] for more information.
+
+Headlines are not numbered. However, you may want to dynamically
+number some, or all, of them. See [[*Dynamic Headline Numbering]].
+
+#+vindex: org-cycle-separator-lines
+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.
+
+** Visibility Cycling
+:PROPERTIES:
+:DESCRIPTION: Show and hide, much simplified.
+:END:
+#+cindex: cycling, visibility
+#+cindex: visibility cycling
+#+cindex: trees, visibility
+#+cindex: show hidden text
+#+cindex: hide text
+
+*** Global and local cycling
+:PROPERTIES:
+:DESCRIPTION: Cycling through various visibility states.
+:END:
+#+cindex: subtree visibility states
+#+cindex: subtree cycling
+#+cindex: folded, subtree visibility state
+#+cindex: children, subtree visibility state
+#+cindex: subtree, subtree visibility state
+
+Outlines make it possible to hide parts of the text in the buffer.
+Org uses just two commands, bound to {{{kbd(TAB)}}} and
+{{{kbd(S-TAB)}}} to change the visibility in the buffer.
+
+#+attr_texinfo: :sep ,
+- {{{kbd(TAB)}}} (~org-cycle~) ::
+
+ #+kindex: TAB
+ #+findex: org-cycle
+ /Subtree cycling/: Rotate current subtree among the states
+
+ #+begin_example
+ ,-> FOLDED -> CHILDREN -> SUBTREE --.
+ '-----------------------------------'
+ #+end_example
+
+ #+vindex: org-cycle-emulate-tab
+ Point must be on a headline for this to work[fn:4].
+
+- {{{kbd(S-TAB)}}} (~org-global-cycle~), {{{kbd(C-u TAB)}}} ::
+
+ #+cindex: global visibility states
+ #+cindex: global cycling
+ #+cindex: overview, global visibility state
+ #+cindex: contents, global visibility state
+ #+cindex: show all, global visibility state
+ #+kindex: C-u TAB
+ #+kindex: S-TAB
+ #+findex: org-global-cycle
+ /Global cycling/: Rotate the entire buffer among the states
+
+ #+begin_example
+ ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
+ '--------------------------------------'
+ #+end_example
+
+ When {{{kbd(S-TAB)}}} is called with a numeric prefix argument
+ {{{var(N)}}}, view contents only up to headlines of level
+ {{{var(N)}}}.
+
+ Note that inside tables (see [[*Tables]]), {{{kbd(S-TAB)}}} jumps to the
+ previous field instead.
+
+ #+vindex: org-cycle-global-at-bob
+ You can run global cycling using {{{kbd(TAB)}}} 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.
+
+- {{{kbd(C-u C-u TAB)}}} (~org-set-startup-visibility~) ::
+
+ #+cindex: startup visibility
+ #+kindex: C-u C-u TAB
+ #+findex: org-set-startup-visibility
+ Switch back to the startup visibility of the buffer (see [[*Initial
+ visibility]]).
+
+- {{{kbd(C-u C-u C-u TAB)}}} (~outline-show-all~) ::
+
+ #+cindex: show all, command
+ #+kindex: C-u C-u C-u TAB
+ #+findex: outline-show-all
+ Show all, including drawers.
+
+- {{{kbd(C-c C-r)}}} (~org-reveal~) ::
+
+ #+cindex: revealing context
+ #+kindex: C-c C-r
+ #+findex: org-reveal
+ Reveal context around point, showing the current entry, the
+ following heading and the hierarchy above. It is useful for working
+ near a location that has been exposed by a sparse tree command (see
+ [[*Sparse Trees]]) or an agenda command (see [[*Commands in the Agenda
+ Buffer]]). With a prefix argument, show, on each level, all sibling
+ headings. With a double prefix argument, also show the entire
+ subtree of the parent.
+
+- {{{kbd(C-c C-k)}}} (~outline-show-branches~) ::
+
+ #+cindex: show branches, command
+ #+kindex: C-c C-k
+ #+findex: outline-show-branches
+ Expose all the headings of the subtree, but not their bodies.
+
+- {{{kbd(C-c TAB)}}} (~outline-show-children~) ::
+
+ #+cindex: show children, command
+ #+kindex: C-c TAB
+ #+findex: outline-show-children
+ Expose all direct children of the subtree. With a numeric prefix
+ argument {{{var(N)}}}, expose all children down to level
+ {{{var(N)}}}.
+
+- {{{kbd(C-c C-x b)}}} (~org-tree-to-indirect-buffer~) ::
+
+ #+kindex: C-c C-x b
+ #+findex: org-tree-to-indirect-buffer
+ Show the current subtree in an indirect buffer[fn:5]. With
+ a numeric prefix argument {{{var(N)}}}, go up to level {{{var(N)}}}
+ and then take that tree. If {{{var(N)}}} is negative then go up
+ that many levels. With a {{{kbd(C-u)}}} prefix, do not remove the
+ previously used indirect buffer.
+
+- {{{kbd(C-c C-x v)}}} (~org-copy-visible~) ::
+
+ #+kindex: C-c C-x v
+ #+findex: org-copy-visible
+ Copy the /visible/ text in the region into the kill ring.
+
+*** Initial visibility
+:PROPERTIES:
+:DESCRIPTION: Setting the initial visibility state.
+:END:
+
+#+vindex: org-startup-folded
+When Emacs first visits an Org file, the global state is set to
+~showeverything~, i.e., all file content is visible[fn:6]. 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:
+
+#+cindex: @samp{STARTUP}, keyword
+#+begin_example
+,#+STARTUP: overview
+,#+STARTUP: content
+,#+STARTUP: showall
+,#+STARTUP: show2levels
+,#+STARTUP: show3levels
+,#+STARTUP: show4levels
+,#+STARTUP: show5levels
+,#+STARTUP: showeverything
+#+end_example
+
+#+cindex: @samp{VISIBILITY}, property
+Furthermore, any entries with a =VISIBILITY= property (see [[*Properties
+and Columns]]) get their visibility adapted accordingly. Allowed values
+for this property are =folded=, =children=, =content=, and =all=.
+
+- {{{kbd(C-u C-u TAB)}}} (~org-set-startup-visibility~) ::
+
+ #+kindex: C-u C-u TAB
+ #+findex: 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.
+
+*** Catching invisible edits
+:PROPERTIES:
+:DESCRIPTION: Preventing mistakes when editing invisible parts.
+:END:
+#+cindex: edits, catching invisible
+
+#+vindex: org-catch-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.
+
+** Motion
+:PROPERTIES:
+:DESCRIPTION: Jumping to other headlines.
+:END:
+#+cindex: motion, between headlines
+#+cindex: jumping, to headlines
+#+cindex: headline navigation
+
+The following commands jump to other headlines in the buffer.
+
+- {{{kbd(C-c C-n)}}} (~org-next-visible-heading~) ::
+
+ #+kindex: C-c C-n
+ #+findex: org-next-visible-heading
+ Next heading.
+
+- {{{kbd(C-c C-p)}}} (~org-previous-visible-heading~) ::
+
+ #+kindex: C-c C-p
+ #+findex: org-previous-visible-heading
+ Previous heading.
+
+- {{{kbd(C-c C-f)}}} (~org-forward-heading-same-level~) ::
+
+ #+kindex: C-c C-f
+ #+findex: org-forward-heading-same-level
+ Next heading same level.
+
+- {{{kbd(C-c C-b)}}} (~org-backward-heading-same-level~) ::
+
+ #+kindex: C-c C-b
+ #+findex: org-backward-heading-same-level
+ Previous heading same level.
+
+- {{{kbd(C-c C-u)}}} (~outline-up-heading~) ::
+
+ #+kindex: C-c C-u
+ #+findex: outline-up-heading
+ Backward to higher level heading.
+
+- {{{kbd(C-c C-j)}}} (~org-goto~) ::
+
+ #+kindex: C-c C-j
+ #+findex: org-goto
+ #+vindex: org-goto-auto-isearch
+ 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:
+
+ #+attr_texinfo: :columns 0.3 0.7
+ | {{{kbd(TAB)}}} | Cycle visibility. |
+ | {{{kbd(DOWN)}}} / {{{kbd(UP)}}} | Next/previous visible headline. |
+ | {{{kbd(RET)}}} | Select this location. |
+ | {{{kbd(/)}}} | Do a Sparse-tree search |
+
+ #+texinfo: @noindent
+ The following keys work if you turn off ~org-goto-auto-isearch~
+
+ #+attr_texinfo: :columns 0.3 0.7
+ | {{{kbd(n)}}} / {{{kbd(p)}}} | Next/previous visible headline. |
+ | {{{kbd(f)}}} / {{{kbd(b)}}} | Next/previous headline same level. |
+ | {{{kbd(u)}}} | One level up. |
+ | {{{kbd(0)}}} ... {{{kbd(9)}}} | Digit argument. |
+ | {{{kbd(q)}}} | Quit. |
+
+ #+vindex: org-goto-interface
+ #+texinfo: @noindent
+ See also the variable ~org-goto-interface~.
+
+** Structure Editing
+:PROPERTIES:
+:DESCRIPTION: Changing sequence and level of headlines.
+:END:
+#+cindex: structure editing
+#+cindex: headline, promotion and demotion
+#+cindex: promotion, of subtrees
+#+cindex: demotion, of subtrees
+#+cindex: subtree, cut and paste
+#+cindex: pasting, of subtrees
+#+cindex: cutting, of subtrees
+#+cindex: copying, of subtrees
+#+cindex: sorting, of subtrees
+#+cindex: subtrees, cut and paste
+
+#+attr_texinfo: :sep ,
+- {{{kbd(M-RET)}}} (~org-meta-return~) ::
+
+ #+kindex: M-RET
+ #+findex: org-meta-return
+ #+vindex: org-M-RET-may-split-line
+ 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 [[*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 {{{kbd(C-u)}}} prefix unconditionally
+ inserts a new heading at the end of the current subtree, thus
+ preserving its contents. With a double {{{kbd(C-u C-u)}}} prefix,
+ the new heading is created at the end of the parent subtree instead.
+
+- {{{kbd(C-RET)}}} (~org-insert-heading-respect-content~) ::
+
+ #+kindex: C-RET
+ #+findex: org-insert-heading-respect-content
+ Insert a new heading at the end of the current subtree.
+
+- {{{kbd(M-S-RET)}}} (~org-insert-todo-heading~) ::
+
+ #+kindex: M-S-RET
+ #+findex: org-insert-todo-heading
+ #+vindex: org-treat-insert-todo-heading-as-state-change
+ Insert new TODO entry with same level as current heading. See also
+ the variable ~org-treat-insert-todo-heading-as-state-change~.
+
+- {{{kbd(C-S-RET)}}} (~org-insert-todo-heading-respect-content~) ::
+
+ #+kindex: C-S-RET
+ #+findex: org-insert-todo-heading-respect-content
+ Insert new TODO entry with same level as current heading. Like
+ {{{kbd(C-RET)}}}, the new headline is inserted after the current
+ subtree.
+
+- {{{kbd(TAB)}}} (~org-cycle~) ::
+
+ #+kindex: TAB
+ #+findex: org-cycle
+ In a new entry with no text yet, the first {{{kbd(TAB)}}} demotes
+ the entry to become a child of the previous one. The next
+ {{{kbd(TAB)}}} makes it a parent, and so on, all the way to top
+ level. Yet another {{{kbd(TAB)}}}, and you are back to the initial
+ level.
+
+- {{{kbd(M-LEFT)}}} (~org-do-promote~), {{{kbd(M-RIGHT)}}} (~org-do-demote~) ::
+
+ #+kindex: M-LEFT
+ #+findex: org-do-promote
+ #+kindex: M-RIGHT
+ #+findex: org-do-demote
+ Promote or demote current heading by one level.
+
+ #+cindex: region, active
+ #+cindex: active region
+ #+cindex: transient mark mode
+ 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.
+
+- {{{kbd(M-S-LEFT)}}} (~org-promote-subtree~) ::
+
+ #+kindex: M-S-LEFT
+ #+findex: org-promote-subtree
+ Promote the current subtree by one level.
+
+- {{{kbd(M-S-RIGHT)}}} (~org-demote-subtree~) ::
+
+ #+kindex: M-S-RIGHT
+ #+findex: org-demote-subtree
+ Demote the current subtree by one level.
+
+- {{{kbd(M-UP)}}} (~org-move-subtree-up~) ::
+
+ #+kindex: M-UP
+ #+findex: org-move-subtree-up
+ Move subtree up, i.e., swap with previous subtree of same level.
+
+- {{{kbd(M-DOWN)}}} (~org-move-subtree-down~) ::
+
+ #+kindex: M-DOWN
+ #+findex: org-move-subtree-down
+ Move subtree down, i.e., swap with next subtree of same level.
+
+- {{{kbd(C-c @)}}} (~org-mark-subtree~) ::
+
+ #+kindex: C-c @@
+ #+findex: org-mark-subtree
+ Mark the subtree at point. Hitting repeatedly marks subsequent
+ subtrees of the same level as the marked subtree.
+
+- {{{kbd(C-c C-x C-w)}}} (~org-cut-subtree~) ::
+
+ #+kindex: C-c C-x C-w
+ #+findex: 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.
+
+- {{{kbd(C-c C-x M-w)}}} (~org-copy-subtree~) ::
+
+ #+kindex: C-c C-x M-w
+ #+findex: org-copy-subtree
+ Copy subtree to kill ring. With a numeric prefix argument N, copy
+ the N sequential subtrees.
+
+- {{{kbd(C-c C-x C-y)}}} (~org-paste-subtree~) ::
+
+ #+kindex: C-c C-x C-y
+ #+findex: 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 =****=.
+
+- {{{kbd(C-y)}}} (~org-yank~) ::
+
+ #+kindex: C-y
+ #+findex: org-yank
+ #+vindex: org-yank-adjusted-subtrees
+ #+vindex: org-yank-folded-subtrees
+ 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
+ {{{kbd(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 {{{kbd(C-u
+ C-y)}}}. If you use ~yank-pop~ after a yank, it yanks previous kill
+ items plainly, without adjustment and folding.
+
+- {{{kbd(C-c C-x c)}}} (~org-clone-subtree-with-time-shift~) ::
+
+ #+kindex: C-c C-x c
+ #+findex: 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~.
+
+- {{{kbd(C-c C-w)}}} (~org-refile~) ::
+
+ #+kindex: C-c C-w
+ #+findex: org-refile
+ Refile entry or region to a different location. See [[*Refile and
+ Copy]].
+
+- {{{kbd(C-c ^)}}} (~org-sort~) ::
+
+ #+kindex: C-c ^
+ #+findex: 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 {{{kbd(C-u)}}} prefix, sorting is case-sensitive.
+
+- {{{kbd(C-x n s)}}} (~org-narrow-to-subtree~) ::
+
+ #+kindex: C-x n s
+ #+findex: org-narrow-to-subtree
+ Narrow buffer to current subtree.
+
+- {{{kbd(C-x n b)}}} (~org-narrow-to-block~) ::
+
+ #+kindex: C-x n b
+ #+findex: org-narrow-to-block
+ Narrow buffer to current block.
+
+- {{{kbd(C-x n w)}}} (~widen~) ::
+
+ #+kindex: C-x n w
+ #+findex: widen
+ Widen buffer to remove narrowing.
+
+- {{{kbd(C-c *)}}} (~org-toggle-heading~) ::
+
+ #+kindex: C-c *
+ #+findex: 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.
+
+Note that when point is inside a table (see [[*Tables]]), the Meta-Cursor
+keys have different functionality.
+
+** Sparse Trees
+:PROPERTIES:
+:DESCRIPTION: Matches embedded in context.
+:END:
+#+cindex: sparse trees
+#+cindex: trees, sparse
+#+cindex: folding, sparse trees
+#+cindex: occur, command
+
+#+vindex: org-show-context-detail
+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[fn:7].
+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:
+
+- {{{kbd(C-c /)}}} (~org-sparse-tree~) ::
+
+ #+kindex: C-c /
+ #+findex: org-sparse-tree
+ This prompts for an extra key to select a sparse-tree creating
+ command.
+
+- {{{kbd(C-c / r)}}} or {{{kbd(C-c / /)}}} (~org-occur~) ::
+
+ #+kindex: C-c / r
+ #+kindex: C-c / /
+ #+findex: org-occur
+ #+vindex: org-remove-highlights-with-change
+ Prompts for a regexp (see [[*Regular Expressions]]) 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 {{{kbd(C-c C-c)}}}[fn:8]. When
+ called with a {{{kbd(C-u)}}} prefix argument, previous highlights
+ are kept, so several calls to this command can be stacked.
+
+- {{{kbd(M-g n)}}} or {{{kbd(M-g M-n)}}} (~next-error~) ::
+
+ #+kindex: M-g n
+ #+kindex: M-g M-n
+ #+findex: next-error
+ Jump to the next sparse tree match in this buffer.
+
+- {{{kbd(M-g p)}}} or {{{kbd(M-g M-p)}}} (~previous-error~) ::
+
+ #+kindex: M-g p
+ #+kindex: M-g M-p
+ #+findex: previous-error
+ Jump to the previous sparse tree match in this buffer.
+
+#+vindex: org-agenda-custom-commands
+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 [[*The Agenda Dispatcher]]).
+For example:
+
+#+begin_src emacs-lisp
+(setq org-agenda-custom-commands
+ '(("f" occur-tree "FIXME")))
+#+end_src
+
+#+texinfo: @noindent
+defines the key {{{kbd(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.
+
+#+kindex: C-c C-e C-v
+#+cindex: printing sparse trees
+#+cindex: visible text, printing
+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 {{{kbd(C-c C-e C-v)}}} to
+export only the visible part of the document and print the resulting
+file.
+
+** Plain Lists
+:PROPERTIES:
+:DESCRIPTION: Additional structure within an entry.
+:END:
+#+cindex: plain lists
+#+cindex: lists, plain
+#+cindex: lists, ordered
+#+cindex: ordered 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 [[*Checkboxes]]). Org supports editing such lists, and
+every exporter (see [[*Exporting]]) can parse and format them.
+
+Org knows ordered lists, unordered lists, and description lists.
+
+#+attr_texinfo: :indic @bullet
+- /Unordered/ list items start with =-=, =+=, or =*=[fn:9] as bullets.
+
+-
+ #+vindex: org-plain-list-ordered-item-terminator
+ #+vindex: org-alphabetical-lists
+ /Ordered/ list items start with a numeral followed by either
+ a period or a right parenthesis[fn:10], such as =1.= or =1)=[fn:11]
+ If you want a list to start with a different value---e.g.,
+ 20---start the text of the item with =[@20]=[fn:12]. 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:
+
+#+begin_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/.
+#+end_example
+
+Org supports these lists by tuning filling and wrapping commands to
+deal with them correctly, and by exporting them properly (see
+[[*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.
+
+#+vindex: org-list-demote-modify-bullet
+#+vindex: org-list-indent-offset
+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~.
+
+#+vindex: org-list-automatic-rules
+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.
+
+#+attr_texinfo: :sep ,
+- {{{kbd(TAB)}}} (~org-cycle~) ::
+
+ #+cindex: cycling, in plain lists
+ #+kindex: TAB
+ #+findex: org-cycle
+ #+vindex: org-cycle-include-plain-lists
+ 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 {{{kbd(TAB)}}} demotes the item to
+ become a child of the previous one. Subsequent {{{kbd(TAB)}}}s move
+ the item to meaningful levels in the list and eventually get it back
+ to its initial position.
+
+- {{{kbd(M-RET)}}} (~org-insert-heading~) ::
+
+ #+kindex: M-RET
+ #+findex: org-insert-heading
+ #+vindex: org-M-RET-may-split-line
+ Insert new item at current level. With a prefix argument, force
+ a new heading (see [[*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[fn:13]. If this command is executed
+ /before item's body/, the new item is created /before/ the current
+ one.
+
+- {{{kbd(M-S-RET)}}} ::
+
+ #+kindex: M-S-RET
+ Insert a new item with a checkbox (see [[*Checkboxes]]).
+
+- {{{kbd(S-UP)}}}, {{{kbd(S-DOWN)}}} ::
+
+ #+kindex: S-UP
+ #+kindex: S-DOWN
+ #+cindex: shift-selection-mode
+ #+vindex: org-support-shift-select
+ #+vindex: org-list-use-circular-motion
+ Jump to the previous/next item in the current list, but only if
+ ~org-support-shift-select~ is off[fn:14]. If not, you can still use
+ paragraph jumping commands like {{{kbd(C-UP)}}} and
+ {{{kbd(C-DOWN)}}} to quite similar effect.
+
+- {{{kbd(M-UP)}}}, {{{kbd(M-DOWN)}}} ::
+
+ #+kindex: M-UP
+ #+kindex: M-DOWN
+ Move the item including subitems up/down[fn:15], i.e., swap with
+ previous/next item of same indentation. If the list is ordered,
+ renumbering is automatic.
+
+- {{{kbd(M-LEFT)}}}, {{{kbd(M-RIGHT)}}} ::
+
+ #+kindex: M-LEFT
+ #+kindex: M-RIGHT
+ Decrease/increase the indentation of an item, leaving children
+ alone.
+
+- {{{kbd(M-S-LEFT)}}}, {{{kbd(M-S-RIGHT)}}} ::
+
+ #+kindex: M-S-LEFT
+ #+kindex: M-S-RIGHT
+ 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.
+
+- {{{kbd(C-c C-c)}}} ::
+
+ #+kindex: C-c C-c
+ If there is a checkbox (see [[*Checkboxes]]) in the item line, toggle
+ the state of the checkbox. In any case, verify bullets and
+ indentation consistency in the whole list.
+
+- {{{kbd(C-c -)}}} ::
+
+ #+kindex: C-c -
+ #+vindex: org-plain-list-ordered-item-terminator
+ 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 lines are converted to list items. With a prefix
+ argument, the selected text is changed into a single item. 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.
+
+- {{{kbd(C-c *)}}} ::
+
+ #+kindex: C-c *
+ Turn a plain list item into a headline---so that it becomes
+ a subheading at its location. See [[*Structure Editing]], for
+ a detailed explanation.
+
+- {{{kbd(C-c C-*)}}} ::
+
+ #+kindex: C-c C-*
+ Turn the whole plain list into a subtree of the current heading.
+ Checkboxes (see [[*Checkboxes]]) become =TODO=, respectively =DONE=,
+ keywords when unchecked, respectively checked.
+
+- {{{kbd(S-LEFT)}}}, {{{kbd(S-RIGHT)}}} ::
+
+ #+vindex: org-support-shift-select
+ #+kindex: S-LEFT
+ #+kindex: S-RIGHT
+ 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~.
+
+- {{{kbd(C-c ^)}}} ::
+
+ #+kindex: C-c ^
+ #+cindex: sorting, of plain list
+ Sort the plain list. Prompt for the sorting method: numerically,
+ alphabetically, by time, or by custom function.
+
+** Drawers
+:PROPERTIES:
+:DESCRIPTION: Tucking stuff away.
+:END:
+#+cindex: drawers
+#+cindex: visibility cycling, 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:
+
+#+begin_example
+,** This is a headline
+Still outside the drawer
+:DRAWERNAME:
+This is inside the drawer.
+:END:
+After the drawer.
+#+end_example
+
+#+kindex: C-c C-x d
+#+findex: org-insert-drawer
+You can interactively insert a drawer at point by calling
+~org-insert-drawer~, which is bound to {{{kbd(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
+[[*Properties and Columns]]). You cannot use it for anything else.
+
+Completion over drawer keywords is also possible using
+{{{kbd(M-TAB)}}}[fn:16].
+
+Visibility cycling (see [[*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 {{{kbd(TAB)}}} there.
+
+You can also arrange for state change notes (see [[Tracking TODO state
+changes]]) and clock times (see [[*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
+
+- {{{kbd(C-c C-z)}}} ::
+
+ #+kindex: C-c C-z
+ Add a time-stamped note to the =LOGBOOK= drawer.
+
+** Blocks
+:PROPERTIES:
+:DESCRIPTION: Folding blocks.
+:END:
+#+vindex: org-hide-block-startup
+#+cindex: blocks, folding
+
+Org mode uses =#+BEGIN= ... =#+END= blocks for various purposes from
+including source code examples (see [[*Literal Examples]]) to capturing
+time logging information (see [[*Clocking Work Time]]). These blocks can
+be folded and unfolded by pressing {{{kbd(TAB)}}} 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
+
+#+cindex: STARTUP, keyword
+#+begin_example
+,#+STARTUP: hideblocks
+,#+STARTUP: nohideblocks
+#+end_example
+
+* Tables
+:PROPERTIES:
+:DESCRIPTION: Pure magic for quick formatting.
+:END:
+#+cindex: tables
+#+cindex: editing tables
+
+Org comes with a fast and intuitive table editor. Spreadsheet-like
+calculations are supported using the Emacs Calc package (see [[info:calc][GNU Emacs
+Calculator Manual]]).
+
+** Built-in Table Editor
+:PROPERTIES:
+:DESCRIPTION: Simple tables.
+:END:
+#+cindex: table editor, built-in
+
+#+cindex: header lines, in tables
+#+cindex: horizontal rule, in tables
+#+cindex: row separator, in tables
+#+cindex: table syntax
+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[fn:17]. Moreover, a line starting
+with =|-= is a horizontal rule. It separates rows explicitly. Rows
+before the first horizontal rule are header lines. A table might look
+like this:
+
+#+begin_example
+| Name | Phone | Age |
+|-------+-------+-----|
+| Peter | 1234 | 17 |
+| Anna | 4321 | 25 |
+#+end_example
+
+A table is re-aligned automatically each time you press
+{{{kbd(TAB)}}}, {{{kbd(RET)}}} or {{{kbd(C-c C-c)}}} inside the table.
+{{{kbd(TAB)}}} also moves to the next field---{{{kbd(RET)}}} 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
+
+#+begin_example
+|Name|Phone|Age|
+|-
+#+end_example
+
+#+texinfo: @noindent
+and then press {{{kbd(TAB)}}} to align the table and start filling in
+fields. Even faster would be to type =|Name|Phone|Age= followed by
+{{{kbd(C-c RET)}}}.
+
+When typing text into a field, Org treats {{{kbd(DEL)}}},
+{{{kbd(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
+{{{kbd(TAB)}}}, {{{kbd(S-TAB)}}} or {{{kbd(RET)}}}, 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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(C-c |)}}} (~org-table-create-or-convert-from-region~) ::
+
+ #+kindex: C-c |
+ #+findex: org-table-create-or-convert-from-region
+ Convert the active region to table. If every line contains at least
+ one {{{kbd(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: {{{kbd(C-u)}}} forces CSV, {{{kbd(C-u C-u)}}} forces
+ {{{kbd(TAB)}}}, {{{kbd(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 {{{kbd(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 {{{kbd(|
+ N a m e | P h o n e | A g e RET | - TAB)}}}.
+
+*** Re-aligning and field motion
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(C-c C-c)}}} (~org-table-align~) ::
+
+ #+kindex: C-c C-c
+ #+findex: org-table-align
+ Re-align the table without moving point.
+
+- {{{kbd(TAB)}}} (~org-table-next-field~) ::
+
+ #+kindex: TAB
+ #+findex: org-table-next-field
+ Re-align the table, move to the next field. Creates a new row if
+ necessary.
+
+- {{{kbd(M-x org-table-blank-field)}}} ::
+
+ #+findex: org-table-blank-field
+ Blank the field at point.
+
+- {{{kbd(S-TAB)}}} (~org-table-previous-field~) ::
+
+ #+kindex: S-TAB
+ #+findex: org-table-previous-field
+ Re-align, move to previous field.
+
+- {{{kbd(RET)}}} (~org-table-next-row~) ::
+
+ #+kindex: RET
+ #+findex: 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, {{{kbd(RET)}}} still
+ inserts a new line, so it can be used to split a table.
+
+- {{{kbd(M-a)}}} (~org-table-beginning-of-field~) ::
+
+ #+kindex: M-a
+ #+findex: org-table-beginning-of-field
+ Move to beginning of the current table field, or on to the previous
+ field.
+
+- {{{kbd(M-e)}}} (~org-table-end-of-field~) ::
+
+ #+kindex: M-e
+ #+findex: org-table-end-of-field
+ Move to end of the current table field, or on to the next field.
+
+*** Column and row editing
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(M-LEFT)}}} (~org-table-move-column-left~) ::
+
+ #+kindex: M-LEFT
+ #+findex: org-table-move-column-left
+ Move the current column left.
+
+- {{{kbd(M-RIGHT)}}} (~org-table-move-column-right~) ::
+
+ #+kindex: M-RIGHT
+ #+findex: org-table-move-column-right
+ Move the current column right.
+
+- {{{kbd(M-S-LEFT)}}} (~org-table-delete-column~) ::
+
+ #+kindex: M-S-LEFT
+ #+findex: org-table-delete-column
+ Kill the current column.
+
+- {{{kbd(M-S-RIGHT)}}} (~org-table-insert-column~) ::
+
+ #+kindex: M-S-RIGHT
+ #+findex: org-table-insert-column
+ Insert a new column at point position. Move the recent column and
+ all cells to the right of this column to the right.
+
+- {{{kbd(M-UP)}}} (~org-table-move-row-up~) ::
+
+ #+kindex: M-UP
+ #+findex: org-table-move-row-up
+ Move the current row up.
+
+- {{{kbd(M-DOWN)}}} (~org-table-move-row-down~) ::
+
+ #+kindex: M-DOWN
+ #+findex: org-table-move-row-down
+ Move the current row down.
+
+- {{{kbd(M-S-UP)}}} (~org-table-kill-row~) ::
+
+ #+kindex: M-S-UP
+ #+findex: org-table-kill-row
+ Kill the current row or horizontal line.
+
+- {{{kbd(S-UP)}}} (~org-table-move-cell-up~) ::
+
+ #+kindex: S-UP
+ #+findex: org-table-move-cell-up
+ Move cell up by swapping with adjacent cell.
+
+- {{{kbd(S-DOWN)}}} (~org-table-move-cell-down~) ::
+
+ #+kindex: S-DOWN
+ #+findex: org-table-move-cell-down
+ Move cell down by swapping with adjacent cell.
+
+- {{{kbd(S-LEFT)}}} (~org-table-move-cell-left~) ::
+
+ #+kindex: S-LEFT
+ #+findex: org-table-move-cell-left
+ Move cell left by swapping with adjacent cell.
+
+- {{{kbd(S-RIGHT)}}} (~org-table-move-cell-right~) ::
+
+ #+kindex: S-RIGHT
+ #+findex: org-table-move-cell-right
+ Move cell right by swapping with adjacent cell.
+
+- {{{kbd(M-S-DOWN)}}} (~org-table-insert-row~) ::
+
+ #+kindex: M-S-DOWN
+ #+findex: org-table-insert-row
+ Insert a new row above the current row. With a prefix argument, the
+ line is created below the current one.
+
+- {{{kbd(C-c -)}}} (~org-table-insert-hline~) ::
+
+ #+kindex: C-c -
+ #+findex: org-table-insert-hline
+ Insert a horizontal line below current row. With a prefix argument,
+ the line is created above the current line.
+
+- {{{kbd(C-c RET)}}} (~org-table-hline-and-move~) ::
+
+ #+kindex: C-c RET
+ #+findex: org-table-hline-and-move
+ Insert a horizontal line below current row, and move point into the
+ row below that line.
+
+- {{{kbd(C-c ^)}}} (~org-table-sort-lines~) ::
+
+ #+kindex: C-c ^
+ #+findex: 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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(C-c C-x M-w)}}} (~org-table-copy-region~) ::
+
+ #+kindex: C-c C-x M-w
+ #+findex: 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.
+
+- {{{kbd(C-c C-x C-w)}}} (~org-table-cut-region~) ::
+
+ #+kindex: C-c C-x C-w
+ #+findex: 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.
+
+- {{{kbd(C-c C-x C-y)}}} (~org-table-paste-rectangle~) ::
+
+ #+kindex: C-c C-x C-y
+ #+findex: 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.
+
+- {{{kbd(M-RET)}}} (~org-table-wrap-region~) ::
+
+ #+kindex: M-RET
+ #+findex: 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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: formula, in tables
+#+cindex: calculations, in tables
+
+- {{{kbd(C-c +)}}} (~org-table-sum~) ::
+
+ #+kindex: C-c +
+ #+findex: 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 {{{kbd(C-y)}}}.
+
+- {{{kbd(S-RET)}}} (~org-table-copy-down~) ::
+
+ #+kindex: S-RET
+ #+findex: org-table-copy-down
+ #+vindex: org-table-copy-increment
+ 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 and
+ time stamp field values, and fields prefixed or suffixed with
+ a whole number, can be incremented during copy. Also, a ~0~ prefix
+ argument temporarily disables the increment.
+
+ This key is also used by shift-selection and related modes (see
+ [[*Packages that conflict with Org mode]]).
+
+*** Miscellaneous
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(C-c `)}}} (~org-table-edit-field~) ::
+
+ #+kindex: C-c `
+ #+findex: org-table-edit-field
+ Edit the current field in a separate window. This is useful for
+ fields that are not fully visible (see [[*Column Width and Alignment]]).
+ When called with a {{{kbd(C-u)}}} prefix, just make the full field
+ visible, so that it can be edited in place. When called with two
+ {{{kbd(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 {{{kbd(C-u C-u C-c `)}}}.
+
+- {{{kbd(M-x org-table-import)}}} ::
+
+ #+findex: 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.
+
+- {{{kbd(C-c |)}}} (~org-table-create-or-convert-from-region~) ::
+
+ #+kindex: C-c |
+ #+findex: 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 {{{kbd(C-x C-x)}}} and then
+ using the {{{kbd(C-c |)}}} command (see [[*Creation and conversion]]).
+
+- {{{kbd(M-x org-table-export)}}} ::
+
+ #+findex: org-table-export
+ #+vindex: org-table-export-default-format
+ 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 [[*Translator
+ functions]], for a detailed description.
+
+- {{{kbd(M-x org-table-header-line-mode)}}} ::
+
+ #+findex: org-table-header-line-mode
+ #+vindex: org-table-header-line-p
+ Turn on the display of the first data row of the table at point in
+ the window header line when this first row is not visible anymore in
+ the buffer. You can activate this minor mode by default by setting
+ the option ~org-table-header-line-p~ to ~t~.
+
+- {{{kbd(M-x org-table-transpose-table-at-point)}}} ::
+
+ #+findex: org-table-transpose-table-at-point
+ Transpose the table at point and eliminate hlines.
+
+** Column Width and Alignment
+:PROPERTIES:
+:DESCRIPTION: Overrule the automatic settings.
+:END:
+#+cindex: narrow columns in tables
+#+cindex: alignment in tables
+
+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.
+
+#+vindex: org-table-automatic-realign
+Editing a field may modify alignment of the table. Moving
+a contiguous row or column---i.e., using {{{kbd(TAB)}}} or
+{{{kbd(RET)}}}---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:
+
+- {{{kbd(C-c C-c)}}} (~org-table-align~) ::
+
+ #+kindex: C-c C-c
+ #+findex: org-table-align
+ Align the current table.
+
+#+vindex: org-startup-align-all-tables
+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:
+
+#+begin_example
+,#+STARTUP: align
+,#+STARTUP: noalign
+#+end_example
+
+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.
+
+#+begin_example
+|---+---------------------+--------| |---+-------…+…|
+| | <6> | | | | <6> …|…|
+| 1 | one | some | ----\ | 1 | one …|…|
+| 2 | two | boring | ----/ | 2 | two …|…|
+| 3 | This is a long text | column | | 3 | This i…|…|
+|---+---------------------+--------| |---+-------…+…|
+#+end_example
+
+To set the width of a column, one field anywhere in the column may
+contain just the string =<N>= where {{{var(N)}}} specifies the width
+as a number of characters. You control displayed width of columns
+with the following tools:
+
+- {{{kbd(C-c TAB)}}} (~org-table-toggle-column-width~) ::
+
+ #+kindex: C-c TAB
+ #+findex: 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.
+
+- {{{kbd(C-u C-c TAB)}}} (~org-table-shrink~) ::
+
+ #+kindex: C-u C-c TAB
+ #+findex: org-table-shrink
+ Shrink all columns with a column width. Expand the others.
+
+- {{{kbd(C-u C-u C-c TAB)}}} (~org-table-expand~) ::
+
+ #+kindex: C-u C-u C-c TAB
+ #+findex: 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, {{{kbd(C-h .)}}} (~display-local-help~) reveals them,
+too. For convenience, any change near the shrunk part of a column
+expands it.
+
+#+vindex: org-startup-shrink-all-tables
+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 =<r>=, =<c>= or =<l>= in a similar fashion. You may also combine
+alignment and field width like this: =<r10>=.
+
+Lines which only contain these formatting cookies are removed
+automatically upon exporting the document.
+
+** Column Groups
+:PROPERTIES:
+:DESCRIPTION: Grouping to trigger vertical lines.
+:END:
+#+cindex: grouping columns in tables
+
+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:
+
+#+begin_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)))
+#+end_example
+
+It is also sufficient to just insert the column group starters after
+every vertical line you would like to have:
+
+#+begin_example
+| N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
+|---+-----+-----+-----+---------+------------|
+| / | < | | | < | |
+#+end_example
+
+** The Orgtbl Minor Mode
+:PROPERTIES:
+:DESCRIPTION: The table editor as minor mode.
+:ALT_TITLE: Orgtbl Mode
+:END:
+#+cindex: Orgtbl mode
+#+cindex: minor mode for tables
+
+#+findex: orgtbl-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 {{{kbd(M-x orgtbl-mode)}}}. To turn it on by default, for
+example in Message mode, use
+
+#+begin_src emacs-lisp
+(add-hook 'message-mode-hook #'turn-on-orgtbl)
+#+end_src
+
+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
+[[*Tables in Arbitrary Syntax]].
+
+** The Spreadsheet
+:PROPERTIES:
+:DESCRIPTION: The table editor has spreadsheet capabilities.
+:END:
+#+cindex: calculations, in tables
+#+cindex: spreadsheet capabilities
+#+cindex: Calc package
+
+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.
+
+*** References
+:PROPERTIES:
+:DESCRIPTION: How to refer to another field or range.
+:END:
+#+cindex: 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 {{{kbd(C-c ?)}}} in
+that field, or press {{{kbd(C-c })}}} to toggle the display of a grid.
+
+**** Field references
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: field references
+#+cindex: references, to fields
+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:[fn:18]
+
+: @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:
+
+#+attr_texinfo: :columns 0.2 0.8
+| =@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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: range references
+#+cindex: references, to ranges
+You may reference a rectangular range of fields by specifying two
+field references connected by two dots =..=. The ends are included in
+the range. 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:
+
+#+attr_texinfo: :columns 0.2 0.8
+| =$1..$3= | first three fields in the current row |
+| =$P..$Q= | range, using column names (see [[*Advanced features]]) |
+| =$<<<..$>>= | start in third column, continue to the last but one |
+| =@2$1..@4$3= | nine 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= |
+
+#+texinfo: @noindent
+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 [[*Formula syntax for
+Calc]].
+
+**** Field coordinates in formulas
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: field coordinates
+#+cindex: coordinates, of field
+#+cindex: row, of field coordinates
+#+cindex: column, of field coordinates
+#+vindex: org-table-current-column
+#+vindex: org-table-current-dline
+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
+ {{{var(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 {{{var(FOO)}}} into row 3 of the current table.
+
+#+texinfo: @noindent
+For the second and third examples, table {{{var(FOO)}}} must have at
+least as many rows or columns as the current table. Note that this is
+inefficient[fn:19] for large number of rows.
+
+**** Named references
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: named references
+#+cindex: references, named
+#+cindex: name, of column or field
+#+cindex: constants, in calculations
+#+cindex: @samp{CONSTANTS}, keyword
+#+vindex: org-table-formula-constants
+
+=$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
+
+#+vindex: constants-unit-system
+#+pindex: constants.el
+Also, properties (see [[*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[fn:20]. Column names and parameters can be specified in
+special table lines. These are described below, see [[*Advanced
+features]]. All names must start with a letter, and further consist
+of letters and numbers.
+
+**** Remote references
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: remote references
+#+cindex: references, remote
+#+cindex: references, to a different table
+#+cindex: name, of column or field
+#+cindex: @samp{NAME}, keyword
+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)
+
+#+texinfo: @noindent
+where {{{var(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. {{{var(REF)}}} is an absolute field or
+range reference as described above for example =@3$3= or =$somename=,
+valid in the referenced table.
+
+#+cindex: table indirection
+When {{{var(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)= \Rightarrow =remote(year_2013, @@>$1)=. The format
+=B3= is not supported because it can not be distinguished from a plain
+table name or ID.
+
+*** Formula syntax for Calc
+:PROPERTIES:
+:DESCRIPTION: Using Calc to compute stuff.
+:END:
+#+cindex: formula syntax, Calc
+#+cindex: syntax, of formulas
+
+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 [[info:calc#Calling Calc from Your Programs][Calling Calc from
+Your Lisp Programs]]), variable substitution takes place according to
+the rules described above.
+
+#+cindex: vectors, in table calculations
+The range vectors can be directly fed into the Calc vector functions
+like ~vmean~ and ~vsum~.
+
+#+cindex: format specifier, in spreadsheet
+#+cindex: mode, for Calc
+#+vindex: org-calc-default-modes
+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.
+
+- =u= ::
+
+ Units simplification mode of Calc. Calc is also a symbolic
+ calculator and is capable of working with values having a unit,
+ represented with numerals followed by a unit string in Org table
+ cells. This mode instructs Calc to simplify the units in the
+ computed expression before returning the result.
+
+- =T=, =t=, =U= ::
+
+ Duration computations in Calc or Lisp, [[*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[fn:21]. 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 \to C conversion |
+| =$c/$1/$cm= | Hz \to 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 [[info:calc#Logical Operations][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.
+
+*** Emacs Lisp forms as formulas
+:PROPERTIES:
+:DESCRIPTION: Writing formulas in Emacs Lisp.
+:ALT_TITLE: Formula syntax for Lisp
+:END:
+#+cindex: Lisp forms, as table 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.
+
+A formula is evaluated as a Lisp form when it starts with a
+single-quote followed by an opening parenthesis. Cell table
+references are interpolated into the Lisp form before execution. The
+evaluation should return either a string or a number. Evaluation
+modes and a ~printf~ format used to render the returned values can be
+specified after a semicolon.
+
+By default, references are interpolated as literal Lisp strings: the
+field content is replaced in the Lisp form stripped of leading and
+trailing white space and surrounded in double-quotes. For example:
+
+: '(concat $1 $2)
+
+#+texinfo: @noindent
+concatenates the content of columns 1 and column 2.
+
+When the =N= flag is used, all referenced elements are parsed as
+numbers and interpolated as Lisp numbers, without quotes. Fields that
+cannot be parsed as numbers are interpolated as zeros. For example:
+
+: '(+ $1 $2);N
+
+#+texinfo: @noindent
+adds columns 1 and 2, equivalent to Calc's =$1+$2=. Ranges are
+inserted as space-separated fields, so they can be embedded in list or
+vector syntax. For example:
+
+: '(apply '+ '($1..$4));N
+
+#+texinfo: @noindent
+computes the sum of columns 1 to 4, like Calc's =vsum($1..$4)=.
+
+When the =L= flag is used, all fields are interpolated literally: the
+cell content is replaced in the Lisp form stripped of leading and
+trailing white space and without quotes. If a reference is intended
+to be interpreted as a string by the Lisp form, the reference operator
+itself should be enclosed in double-quotes, like ="$3"=. The =L= flag
+is useful when strings and numbers are used in the same Lisp form. For
+example:
+
+: '(substring "$1" $2 $3);L
+
+#+texinfo: @noindent
+extracts the part of the string in column 1 between the character
+positions specified in the integers in column 2 and 3 and it is easier
+to read than the equivalent:
+
+: '(substring $1 (string-to-number $2) (string-to-number $3))
+
+*** Durations and time values
+:PROPERTIES:
+:DESCRIPTION: How to compute durations and time values.
+:END:
+#+cindex: duration, computing
+#+cindex: time, computing
+#+vindex: org-table-duration-custom-format
+
+If you want to compute time values use the =T=, =t=, or =U= flag,
+either in Calc formulas or Elisp formulas:
+
+#+begin_example
+| 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
+#+end_example
+
+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.
+
+*** Field and range formulas
+:PROPERTIES:
+:DESCRIPTION: Formula for specific (ranges of) fields.
+:END:
+#+cindex: field formula
+#+cindex: range formula
+#+cindex: formula, for individual table field
+#+cindex: formula, for range of fields
+
+To assign a formula to a particular field, type it directly into the
+field, preceded by =:==, for example =vsum(@II..III)=. When you press
+{{{kbd(TAB)}}} or {{{kbd(RET)}}} or {{{kbd(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.
+
+#+cindex: @samp{TBLFM}, keyword
+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
+
+- {{{kbd(C-u C-c =)}}} (~org-table-eval-formula~) ::
+
+ #+kindex: C-u C-c =
+ #+findex: 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 [[*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 [[*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 [[*Advanced features]].
+
+*** Column formulas
+:PROPERTIES:
+:DESCRIPTION: Formulas valid for an entire column.
+:END:
+#+cindex: column formula
+#+cindex: formula, for table column
+
+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
+{{{kbd(TAB)}}} or {{{kbd(RET)}}} or {{{kbd(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:
+
+- {{{kbd(C-c =)}}} (~org-table-eval-formula~) ::
+
+ #+kindex: C-c =
+ #+findex: 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., {{{kbd(C-5 C-c =)}}}, the command applies it to that many
+ consecutive fields in the current column.
+
+*** Lookup functions
+:PROPERTIES:
+:DESCRIPTION: Lookup functions for searching tables.
+:END:
+#+cindex: lookup functions in tables
+#+cindex: table lookup functions
+
+Org has three predefined Emacs Lisp functions for lookups in tables.
+
+- =(org-lookup-first VAL S-LIST R-LIST &optional PREDICATE)= ::
+
+ #+findex: org-lookup-first
+ Searches for the first element {{{var(S)}}} in list
+ {{{var(S-LIST)}}} for which
+ #+begin_src emacs-lisp
+ (PREDICATE VAL S)
+ #+end_src
+ is non-~nil~; returns the value from the corresponding position in
+ list {{{var(R-LIST)}}}. The default {{{var(PREDICATE)}}} is
+ ~equal~. Note that the parameters {{{var(VAL)}}} and {{{var(S)}}}
+ are passed to {{{var(PREDICATE)}}} in the same order as the
+ corresponding parameters are in the call to ~org-lookup-first~,
+ where {{{var(VAL)}}} precedes {{{var(S-LIST)}}}. If
+ {{{var(R-LIST)}}} is ~nil~, the matching element {{{var(S)}}} of
+ {{{var(S-LIST)}}} is returned.
+
+- =(org-lookup-last VAL S-LIST R-LIST &optional PREDICATE)= ::
+
+ #+findex: org-lookup-last
+ Similar to ~org-lookup-first~ above, but searches for the /last/
+ element for which {{{var(PREDICATE)}}} is non-~nil~.
+
+- =(org-lookup-all VAL S-LIST R-LIST &optional PREDICATE)= ::
+
+ #+findex: org-lookup-all
+ Similar to ~org-lookup-first~, but searches for /all/ elements for
+ which {{{var(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 {{{var(S-LIST)}}} and/or {{{var(R-LIST)}}}
+which can, for example, result in an incorrect mapping from an element
+of {{{var(S-LIST)}}} to the corresponding element of
+{{{var(R-LIST)}}}.
+
+These three functions can be used to implement associative arrays,
+count matching cells, rank results, group data, etc. For practical
+examples see [[https://orgmode.org/worg/org-tutorials/org-lookups.html][this tutorial on Worg]].
+
+*** Editing and debugging formulas
+:PROPERTIES:
+:DESCRIPTION: Fixing formulas.
+:END:
+#+cindex: formula editing
+#+cindex: editing, of table formulas
+
+#+vindex: org-table-use-standard-references
+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~.
+
+- {{{kbd(C-c =)}}} or {{{kbd(C-u C-c =)}}} (~org-table-eval-formula~) ::
+
+ #+kindex: C-c =
+ #+kindex: C-u C-c =
+ #+findex: org-table-eval-formula
+ Edit the formula associated with the current column/field in the
+ minibuffer. See [[*Column formulas]], and [[*Field and range formulas]].
+
+- {{{kbd(C-u C-u C-c =)}}} (~org-table-eval-formula~) ::
+
+ #+kindex: C-u C-u C-c =
+ #+findex: 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 {{{kbd(C-c ?)}}}.
+
+- {{{kbd(C-c ?)}}} (~org-table-field-info~) ::
+
+ #+kindex: C-c ?
+ #+findex: 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.
+
+- {{{kbd(C-c })}}} (~org-table-toggle-coordinate-overlays~) ::
+
+ #+kindex: C-c @}
+ #+findex: 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 {{{kbd(C-c C-c)}}}.
+
+- {{{kbd(C-c {)}}} (~org-table-toggle-formula-debugger~) ::
+
+ #+kindex: C-c @{
+ #+findex: org-table-toggle-formula-debugger
+ Toggle the formula debugger on and off. See below.
+
+- {{{kbd(C-c ')}}} (~org-table-edit-formulas~) ::
+
+ #+kindex: C-c '
+ #+findex: 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:
+
+ - {{{kbd(C-c C-c)}}} or {{{kbd(C-x C-s)}}} (~org-table-fedit-finish~) ::
+
+ #+kindex: C-x C-s
+ #+kindex: C-c C-c
+ #+findex: org-table-fedit-finish
+ Exit the formula editor and store the modified formulas. With
+ {{{kbd(C-u)}}} prefix, also apply the new formulas to the
+ entire table.
+
+ - {{{kbd(C-c C-q)}}} (~org-table-fedit-abort~) ::
+
+ #+kindex: C-c C-q
+ #+findex: org-table-fedit-abort
+ Exit the formula editor without installing changes.
+
+ - {{{kbd(C-c C-r)}}} (~org-table-fedit-toggle-ref-type~) ::
+
+ #+kindex: C-c C-r
+ #+findex: org-table-fedit-toggle-ref-type
+ Toggle all references in the formula editor between standard (like
+ =B3=) and internal (like =@3$2=).
+
+ - {{{kbd(TAB)}}} (~org-table-fedit-lisp-indent~) ::
+
+ #+kindex: TAB
+ #+findex: 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 {{{kbd(TAB)}}} collapses the formula back
+ again. In the open formula, {{{kbd(TAB)}}} re-indents just like
+ in Emacs Lisp mode.
+
+ - {{{kbd(M-TAB)}}} (~lisp-complete-symbol~) ::
+
+ #+kindex: M-TAB
+ #+findex: lisp-complete-symbol
+ Complete Lisp symbols, just like in Emacs Lisp mode.
+
+ - {{{kbd(S-UP)}}}, {{{kbd(S-DOWN)}}}, {{{kbd(S-LEFT)}}}, {{{kbd(S-RIGHT)}}} ::
+
+ #+kindex: S-UP
+ #+kindex: S-DOWN
+ #+kindex: S-LEFT
+ #+kindex: S-RIGHT
+ #+findex: org-table-fedit-ref-up
+ #+findex: org-table-fedit-ref-down
+ #+findex: org-table-fedit-ref-left
+ #+findex: org-table-fedit-ref-right
+ Shift the reference at point. For example, if the reference is
+ =B3= and you press {{{kbd(S-RIGHT)}}}, it becomes =C3=. This also
+ works for relative references and for hline references.
+
+ - {{{kbd(M-S-UP)}}} (~org-table-fedit-line-up~) ::
+
+ #+kindex: M-S-UP
+ #+findex: org-table-fedit-line-up
+ Move the test line for column formulas up in the Org buffer.
+
+ - {{{kbd(M-S-DOWN)}}} (~org-table-fedit-line-down~) ::
+
+ #+kindex: M-S-DOWN
+ #+findex: org-table-fedit-line-down
+ Move the test line for column formulas down in the Org buffer.
+
+ - {{{kbd(M-UP)}}} (~org-table-fedit-scroll-up~) ::
+
+ #+kindex: M-UP
+ #+findex: org-table-fedit-scroll-up
+ Scroll up the window displaying the table.
+
+ - {{{kbd(M-DOWN)}}} (~org-table-fedit-scroll-down~) ::
+
+ #+kindex: M-DOWN
+ #+findex: org-table-fedit-scroll-down
+ Scroll down the window displaying the table.
+
+ - {{{kbd(C-c })}}} ::
+
+ #+kindex: C-c @}
+ #+findex: org-table-toggle-coordinate-overlays
+ 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.
+
+#+kindex: C-c C-c
+You may edit the =TBLFM= keyword directly and re-apply the changed
+equations with {{{kbd(C-c C-c)}}} in that line or with the normal
+recalculation commands in the table.
+
+**** Using multiple =TBLFM= lines
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: multiple formula lines
+#+cindex: @samp{TBLFM} keywords, multiple
+#+cindex: @samp{TBLFM}, switching
+
+#+kindex: C-c C-c
+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 {{{kbd(C-c C-c)}}} on
+the formula to apply. Here is an example:
+
+#+begin_example
+| x | y |
+|---+---|
+| 1 | |
+| 2 | |
+,#+TBLFM: $2=$1*1
+,#+TBLFM: $2=$1*2
+#+end_example
+
+#+texinfo: @noindent
+Pressing {{{kbd(C-c C-c)}}} in the line of =#+TBLFM: $2=$1*2= yields:
+
+#+begin_example
+| x | y |
+|---+---|
+| 1 | 2 |
+| 2 | 4 |
+,#+TBLFM: $2=$1*1
+,#+TBLFM: $2=$1*2
+#+end_example
+
+#+texinfo: @noindent
+If you recalculate this table, with {{{kbd(C-u C-c *)}}}, for example,
+you get the following result from applying only the first =TBLFM=
+keyword.
+
+#+begin_example
+| x | y |
+|---+---|
+| 1 | 1 |
+| 2 | 2 |
+,#+TBLFM: $2=$1*1
+,#+TBLFM: $2=$1*2
+#+end_example
+
+**** Debugging formulas
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: formula debugging
+#+cindex: debugging, of table 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 {{{kbd(C-u C-u C-c = RET)}}} in
+a field. Detailed information are displayed.
+
+*** Updating the table
+:PROPERTIES:
+:DESCRIPTION: Recomputing all dependent fields.
+:END:
+#+cindex: recomputing table fields
+#+cindex: updating, 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 [[*Advanced features]].
+
+In order to recalculate a line of a table or the entire table, use the
+following commands:
+
+- {{{kbd(C-c *)}}} (~org-table-recalculate~) ::
+
+ #+kindex: C-c *
+ #+findex: 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.
+
+- {{{kbd(C-u C-c *)}}} or {{{kbd(C-u C-c C-c)}}} ::
+
+ #+kindex: C-u C-c *
+ #+kindex: 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.
+
+- {{{kbd(C-u C-u C-c *)}}} or {{{kbd(C-u C-u C-c C-c)}}} (~org-table-iterate~) ::
+
+ #+kindex: C-u C-u C-c *
+ #+kindex: C-u C-u C-c C-c
+ #+findex: 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.
+
+- {{{kbd(M-x org-table-recalculate-buffer-tables)}}} ::
+
+ #+findex: org-table-recalculate-buffer-tables
+ Recompute all tables in the current buffer.
+
+- {{{kbd(M-x org-table-iterate-buffer-tables)}}} ::
+
+ #+findex: org-table-iterate-buffer-tables
+ Iterate all tables in the current buffer, in order to converge
+ table-to-table dependencies.
+
+*** Advanced features
+:PROPERTIES:
+:DESCRIPTION: Field and column names, automatic recalculation...
+:END:
+
+If you want the recalculation of fields to happen automatically, or if
+you want to be able to assign /names/[fn:22] to fields and columns,
+you need to reserve the first column of the table for special marking
+characters.
+
+- {{{kbd(C-#)}}} (~org-table-rotate-recalc-marks~) ::
+
+ #+kindex: C-#
+ #+findex: 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:
+
+#+begin_example
+|---+---------+--------+--------+--------+-------+------|
+| | 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
+#+end_example
+
+#+attr_texinfo: :tag Important
+#+begin_quote
+Please note that for these special tables, recalculating the table
+with {{{kbd(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.
+#+end_quote
+
+#+cindex: marking characters, tables
+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
+ {{{kbd(TAB)}}} or {{{kbd(RET)}}} or {{{kbd(S-TAB)}}} in this row.
+ Also, this row is selected for a global recalculation with
+ {{{kbd(C-u C-c *)}}}. Unmarked lines are left alone by this
+ command.
+
+- =*= ::
+
+ Selects this line for global recalculation with {{{kbd(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 =<N>= 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.
+
+#+begin_example
+|---+-------------+---+-----+--------------------------------------|
+| | 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
+#+end_example
+
+** Org Plot
+:PROPERTIES:
+:DESCRIPTION: Plotting from Org tables.
+:END:
+#+cindex: graph, in tables
+#+cindex: plot tables using Gnuplot
+
+Org Plot can produce graphs of information stored in Org tables,
+either graphically or in ASCII art.
+
+*** Graphical plots using Gnuplot
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: @samp{PLOT}, keyword
+Org Plot can produce 2D and 3D graphs of information stored in Org
+tables using [[https://www.gnuplot.info/][Gnuplot]] and [[http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html][Gnuplot mode]]. To see this in action, ensure
+that you have both Gnuplot and Gnuplot mode installed on your system,
+then call {{{kbd(C-c \quot g)}}} or {{{kbd(M-x org-plot/gnuplot)}}} on the
+following table.
+
+#+begin_example
+,#+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 |
+#+end_example
+
+Org Plot supports a range of plot types, and provides the ability to add more.
+For example, a radar plot can be generated like so:
+#+begin_example
+,#+PLOT: title:"An evaluation of plaintext document formats" transpose:yes type:radar min:0 max:4
+| Format | Fine-grained-control | Initial Effort | Syntax simplicity | Editor Support | Integrations | Ease-of-referencing | Versatility |
+|-------------------+----------------------+----------------+-------------------+----------------+--------------+---------------------+-------------|
+| Word | 2 | 4 | 4 | 2 | 3 | 2 | 2 |
+| LaTeX | 4 | 1 | 1 | 3 | 2 | 4 | 3 |
+| Org Mode | 4 | 2 | 3.5 | 1 | 4 | 4 | 4 |
+| Markdown | 1 | 3 | 3 | 4 | 3 | 3 | 1 |
+| Markdown + Pandoc | 2.5 | 2.5 | 2.5 | 3 | 3 | 3 | 2 |
+#+end_example
+
+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 [[https://orgmode.org/worg/org-tutorials/org-plot.html][Org Plot tutorial]].
+
+**** Plot options
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- =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.
+
+- transpose ::
+
+ When =y=, =yes=, or =t= attempt to transpose the table data before
+ plotting. Also recognises the shorthand option =trans=.
+
+- =type= ::
+
+ Specify the type of the plot, by default one of =2d=, =3d=, =radar=, or =grid=.
+ Available types can be customised with ~org-plot/preset-plot-types~.
+
+- =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.
+
+- min ::
+
+ Provides a minimum axis value that may be used by a plot type.
+ Implicitly assumes the =y= axis is being referred to. Can
+ explicitly provide a value for a either the =x= or =y= axis with
+ =xmin= and =ymin=.
+
+- max ::
+
+ Provides a maximum axis value that may be used by a plot type.
+ Implicitly assumes the =y= axis is being referred to. Can
+ explicitly provide a value for a either the =x= or =y= axis with
+ =xmax= and =ymax=.
+
+- ticks ::
+
+ Provides a desired number of axis ticks to display, that may be used
+ by a plot type. If none is given a plot type that requires ticks
+ will use ~org--plot/sensible-tick-num~ to try to determine a good
+ value.
+
+- =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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+While point is on a column, typing {{{kbd(C-c " a)}}} or {{{kbd(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 {{{kbd(C-u C-c *)}}}.
+
+#+begin_example
+| 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)
+#+end_example
+
+The formula is an Elisp call.
+
+#+attr_texinfo: :options orgtbl-ascii-draw value min max &optional width
+#+begin_defun
+Draw an ASCII bar in a table.
+
+{{{var(VALUE)}}} is the value to plot.
+
+{{{var(MIN)}}} is the value displayed as an empty bar. {{{var(MAX)}}}
+is the value filling all the {{{var(WIDTH)}}}. Sources values outside
+this range are displayed as =too small= or =too large=.
+
+{{{var(WIDTH)}}} is the number of characters of the bar plot. It
+defaults to =12=.
+#+end_defun
+
+* Hyperlinks
+:PROPERTIES:
+:DESCRIPTION: Notes in context.
+:END:
+#+cindex: hyperlinks
+
+Like HTML, Org provides support for links inside a file, external
+links to other files, Usenet articles, emails, and much more.
+
+** Link Format
+:PROPERTIES:
+:DESCRIPTION: How links in Org are formatted.
+:END:
+#+cindex: link format
+#+cindex: format, of links
+
+#+cindex: angle bracket links
+#+cindex: plain links
+Org recognizes plain URIs, possibly wrapped within angle
+brackets[fn:23], and activate them as clickable links.
+
+#+cindex: bracket links
+The general link format, however, looks like this:
+
+: [[LINK][DESCRIPTION]]
+
+#+texinfo: @noindent
+or alternatively
+
+: [[LINK]]
+
+#+cindex: escape syntax, for links
+#+cindex: backslashes, in links
+Some =\=, =[= and =]= characters in the {{{var(LINK)}}} part need to
+be "escaped", i.e., preceded by another =\= character. More
+specifically, the following characters, and only them, must be
+escaped:
+
+1. all =[= and =]= characters,
+2. every =\= character preceding either =]= or =[=,
+3. every =\= character at the end of the link.
+
+#+findex: org-link-escape
+Functions inserting links (see [[*Handling Links]]) properly escape
+ambiguous characters. You only need to bother about the rules above
+when inserting directly, or yanking, a URI within square brackets.
+When in doubt, you may use the function ~org-link-escape~, which turns
+a link string into its escaped form.
+
+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 {{{var(LINK)}}} part, if there is no description, or the
+{{{var(DESCRIPTION)}}} part otherwise. To also edit the invisible
+{{{var(LINK)}}} part, use {{{kbd(C-c C-l)}}} with point on the link
+(see [[*Handling Links]]).
+
+If you place point at the beginning or just behind the end of the
+displayed text and press {{{kbd(BS)}}}, you remove
+the---invisible---bracket at that location[fn:24]. 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 \rarr Hyperlinks \rarr
+Literal links.
+
+** Internal Links
+:PROPERTIES:
+:DESCRIPTION: Links to other places in the current file.
+:END:
+#+cindex: internal links
+#+cindex: links, internal
+
+A link that does not look like a URL---i.e., does not start with
+a known scheme or a file name---refers to the current document. You
+can follow it with {{{kbd(C-c C-o)}}} when point is on the link, or
+with a mouse click (see [[*Handling Links]]).
+
+#+cindex: @samp{CUSTOM_ID}, property
+Org provides several refinements to internal navigation within
+a document. Most notably, a construct like =[[#my-custom-id]]=
+specifically targets the entry with the =CUSTOM_ID= property set to
+=my-custom-id=. Also, an internal link looking like =[[*Some
+section]]= points to a headline with the name =Some section=[fn:25].
+
+#+cindex: targets, for links
+When the link does not belong to any of the cases above, Org looks for
+a /dedicated target/: the same string in double angular brackets, like
+=<<My Target>>=.
+
+#+cindex: @samp{NAME}, keyword
+If no dedicated target exists, the link tries to match the exact name
+of an element within the buffer. Naming is done, unsurprisingly, with
+the =NAME= keyword, which has to be put in the line before the element
+it refers to, as in the following example
+
+#+begin_example
+,#+NAME: My Target
+| a | table |
+|----+------------|
+| of | four cells |
+#+end_example
+
+#+vindex: org-link-search-must-match-exact-headline
+Ultimately, 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, or initiates a plain text search, according to the value of
+~org-link-search-must-match-exact-headline~.
+
+Note that you must make sure custom IDs, dedicated targets, and names
+are unique throughout the document. Org provides a linter to assist
+you in the process, if needed. See [[*Org Syntax]].
+
+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[fn:26]. In the following excerpt from
+an Org buffer
+
+#+begin_example
+1. one item
+2. <<target>>another item
+Here we refer to item [[target]].
+#+end_example
+
+#+texinfo: @noindent
+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 {{{kbd(C-c &)}}}. Using this
+command several times in direct succession goes back to positions
+recorded earlier.
+
+** Radio Targets
+:PROPERTIES:
+:DESCRIPTION: Make targets trigger links in plain text.
+:END:
+#+cindex: radio targets
+#+cindex: targets, radio
+#+cindex: links, 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 =<<<My
+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 {{{kbd(C-c C-c)}}} with
+point on or at a target.
+
+** External Links
+:PROPERTIES:
+:DESCRIPTION: URL-like links to the world.
+:END:
+#+cindex: links, external
+#+cindex: external links
+#+cindex: attachment links
+#+cindex: BBDB links
+#+cindex: Elisp links
+#+cindex: file links
+#+cindex: Gnus links
+#+cindex: Help links
+#+cindex: IRC links
+#+cindex: Info links
+#+cindex: MH-E links
+#+cindex: Rmail links
+#+cindex: shell links
+#+cindex: URL links
+#+cindex: Usenet 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.
+
+Here is the full set of built-in link types:
+
+- =file= ::
+
+ File links. File name may be remote, absolute, or relative.
+
+ Additionally, you can specify a line number, or a text search.
+ In Org files, you may link to a headline name, a custom ID, or a
+ code reference instead.
+
+ As a special case, "file" prefix may be omitted if the file name
+ is complete, e.g., it starts with =./=, or =/=.
+
+- =attachment= ::
+
+ Same as file links but for files and folders attached to the current
+ node (see [[*Attachments]]). Attachment links are intended to behave
+ exactly as file links but for files relative to the attachment
+ directory.
+
+- =bbdb= ::
+
+ Link to a BBDB record, with possible regexp completion.
+
+- =docview= ::
+
+ Link to a document opened with DocView mode. You may specify a page
+ number.
+
+- =doi= ::
+
+ Link to an electronic resource, through its handle.
+
+- =elisp= ::
+
+ Execute an Elisp command upon activation.
+
+- =gnus=, =rmail=, =mhe= ::
+
+ Link to messages or folders from a given Emacs' MUA.
+
+- =help= ::
+
+ Display documentation of a symbol in =*Help*= buffer.
+
+- =http=, =https= ::
+
+ Web links.
+
+- =id= ::
+
+ Link to a specific headline by its ID property, in an Org file.
+
+- =info= ::
+
+ Link to an Info manual, or to a specific node.
+
+- =irc= ::
+
+ Link to an IRC channel.
+
+- =mailto= ::
+
+ Link to message composition.
+
+- =news= ::
+
+ Usenet links.
+
+- =shell= ::
+
+ Execute a shell command upon activation.
+
+The following table illustrates the link types above, along with their
+options:
+
+| Link Type | Example |
+|------------+----------------------------------------------------------|
+| http | =http://staff.science.uva.nl/c.dominik/= |
+| https | =https://orgmode.org/= |
+| doi | =doi:10.1000/182= |
+| file | =file:/home/dominik/images/jupiter.jpg= |
+| | =/home/dominik/images/jupiter.jpg= (same as above) |
+| | =file:papers/last.pdf= |
+| | =./papers/last.pdf= (same as above) |
+| | =file:/ssh:me@some.where:papers/last.pdf= (remote) |
+| | =/ssh:me@some.where:papers/last.pdf= (same as above) |
+| | =file:sometextfile::NNN= (jump to line number) |
+| | =file:projects.org= |
+| | =file:projects.org::some words= (text search)[fn:27] |
+| | =file:projects.org::*task title= (headline search) |
+| | =file:projects.org::#custom-id= (headline search) |
+| attachment | =attachment:projects.org= |
+| | =attachment:projects.org::some words= (text search) |
+| docview | =docview:papers/last.pdf::NNN= |
+| id | =id:B7423F4D-2E8A-471B-8810-C40F074717E9= |
+| news | =news:comp.emacs= |
+| mailto | =mailto:adent@galaxy.net= |
+| mhe | =mhe:folder= (folder link) |
+| | =mhe:folder#id= (message link) |
+| rmail | =rmail:folder= (folder link) |
+| | =rmail:folder#id= (message link) |
+| gnus | =gnus:group= (group link) |
+| | =gnus:group#id= (article link) |
+| bbdb | =bbdb:R.*Stallman= (record with regexp) |
+| irc | =irc:/irc.com/#emacs/bob= |
+| help | =help:org-store-link= |
+| info | =info:org#External links= |
+| shell | =shell:ls *.org= |
+| elisp | =elisp:(find-file "Elisp.org")= (Elisp form to evaluate) |
+| | =elisp:org-agenda= (interactive Elisp command) |
+
+#+cindex: VM links
+#+cindex: Wanderlust links
+On top of these built-in link types, additional ones are available
+through the =org-contrib= repository (see [[*Installation]]). For
+example, these links to VM or Wanderlust messages are available when
+you load the corresponding libraries from the =org-contrib=
+repository:
+
+| =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 [[*Adding
+Hyperlink Types]].
+
+A link should be enclosed in double brackets and may contain
+descriptive text to be displayed instead of the URL (see [[*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 (see [[*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.
+
+#+cindex: square brackets, around links
+#+cindex: angular brackets, around links
+#+cindex: plain text external links
+Org also recognizes external links amid normal text and activates them
+as links. If spaces must be part of the link (for example in
+=bbdb:R.*Stallman=), or if you need to remove ambiguities about the
+end of the link, enclose the link in square or angular brackets.
+
+** Handling Links
+:PROPERTIES:
+:DESCRIPTION: Creating, inserting and following.
+:END:
+#+cindex: links, handling
+
+Org provides methods to create a link in the correct syntax, to insert
+it into an Org file, and to follow the link.
+
+#+findex: org-store-link
+#+cindex: storing links
+The main function is ~org-store-link~, called with {{{kbd(M-x
+org-store-link)}}}. Because of its importance, we suggest to bind it
+to a widely available key (see [[*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 =<<target>>= at point, the link points
+ to the target. Otherwise it points to the current headline, which
+ is also the description[fn:28].
+
+ #+vindex: org-id-link-to-org-use-id
+ #+cindex: @samp{CUSTOM_ID}, property
+ #+cindex: @samp{ID}, property
+ 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[fn:29]. 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. The =ID= property can be either a
+ UUID (default) or a timestamp, depending on ~org-id-method~. Later,
+ when inserting the link, you need to decide which one to use.
+
+- /Email/News clients: VM, Rmail, Wanderlust, MH-E, Gnus/ ::
+
+ #+vindex: org-link-email-description-format
+ 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-link-email-description-format~. By default, it refers to the
+ addressee and the subject.
+
+- /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/ ::
+
+ #+vindex: org-irc-links-to-logs
+ 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 [[*Search Options in File Links]]) 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 [[*Custom Searches]]).
+
+ You can also define dedicated links to other files. See [[*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.
+
+#+attr_texinfo: :sep ,
+- {{{kbd(C-c C-l)}}} (~org-insert-link~) ::
+
+ #+kindex: C-c C-l
+ #+findex: org-insert-link
+ #+cindex: link completion
+ #+cindex: completion, of links
+ #+cindex: inserting links
+ #+vindex: org-link-keep-stored-after-insertion
+ Insert a link[fn:30]. 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[fn:31]. 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 {{{kbd(UP)}}}
+ and {{{kbd(DOWN)}}} (or {{{kbd(M-p)}}}, {{{kbd(M-n)}}}).
+
+ - /Completion support/ ::
+
+ Completion with {{{kbd(TAB)}}} helps you to insert valid link
+ prefixes like =http= or =ftp=, including the prefixes defined
+ through link abbreviations (see [[*Link Abbreviations]]). If you
+ press {{{kbd(RET)}}} after inserting only the prefix, Org offers
+ specific completion support for some link types[fn:32]. For
+ example, if you type {{{kbd(f i l e RET)}}}---alternative access:
+ {{{kbd(C-u C-c C-l)}}}, see below---Org offers file name
+ completion, and after {{{kbd(b b d b RET)}}} you can complete
+ contact names.
+
+- {{{kbd(C-u C-c C-l)}}} ::
+
+ #+cindex: file name completion
+ #+cindex: completion, of file names
+ #+kindex: C-u C-c C-l
+ When {{{kbd(C-c C-l)}}} is called with a {{{kbd(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
+ {{{kbd(C-u)}}} prefixes.
+
+- {{{kbd(C-c C-l)}}} (with point on existing link) ::
+
+ #+cindex: following links
+ When point is on an existing link, {{{kbd(C-c C-l)}}} allows you to
+ edit the link and description parts of the link.
+
+- {{{kbd(C-c C-o)}}} (~org-open-at-point~) ::
+
+ #+kindex: C-c C-o
+ #+findex: org-open-at-point
+ #+vindex: org-file-apps
+ 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 [[*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 {{{kbd(C-u)}}} prefix. If you want to avoid opening in Emacs, use
+ a {{{kbd(C-u C-u)}}} prefix.
+
+ #+vindex: org-link-frame-setup
+ 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~.
+
+- {{{kbd(RET)}}} ::
+
+ #+vindex: org-return-follows-link
+ #+kindex: RET
+ When ~org-return-follows-link~ is set, {{{kbd(RET)}}} also follows
+ the link at point.
+
+- {{{kbd(mouse-2)}}} or {{{kbd(mouse-1)}}} ::
+
+ #+kindex: mouse-2
+ #+kindex: mouse-1
+ On links, {{{kbd(mouse-1)}}} and {{{kbd(mouse-2)}}} opens the link
+ just as {{{kbd(C-c C-o)}}} does.
+
+- {{{kbd(mouse-3)}}} ::
+
+ #+vindex: org-link-use-indirect-buffer-for-internals
+ #+kindex: mouse-3
+ Like {{{kbd(mouse-2)}}}, but force file links to be opened with
+ Emacs, and internal links to be displayed in another window[fn:33].
+
+- {{{kbd(C-c %)}}} (~org-mark-ring-push~) ::
+
+ #+kindex: C-c %
+ #+findex: org-mark-ring-push
+ #+cindex: mark ring
+ Push the current position onto the Org mark ring, to be able to
+ return easily. Commands following an internal link do this
+ automatically.
+
+- {{{kbd(C-c &)}}} (~org-mark-ring-goto~) ::
+
+ #+kindex: C-c &
+ #+findex: org-mark-ring-goto
+ #+cindex: links, returning to
+ Jump back to a recorded position. A position is recorded by the
+ commands following internal links, and by {{{kbd(C-c %)}}}. Using
+ this command several times in direct succession moves through a ring
+ of previously recorded positions.
+
+- {{{kbd(C-c C-x C-n)}}} (~org-next-link~), {{{kbd(C-c C-x C-p)}}} (~org-previous-link~) ::
+
+ #+kindex: C-c C-x C-p
+ #+findex: org-previous-link
+ #+kindex: C-c C-x C-n
+ #+findex: org-next-link
+ #+cindex: links, finding next/previous
+ 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 {{{kbd(M-n)}}} and {{{kbd(M-p)}}}.
+
+ #+begin_src emacs-lisp
+ (with-eval-after-load 'org
+ (define-key org-mode-map (kbd "M-n") #'org-next-link)
+ (define-key org-mode-map (kbd "M-p") #'org-previous-link))
+ #+end_src
+
+** Using Links Outside Org
+:PROPERTIES:
+:DESCRIPTION: Linking from my C source code?
+:END:
+
+#+findex: org-insert-link-global
+#+findex: org-open-at-point-global
+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
+[[*Activation]] for some advice.
+
+** Link Abbreviations
+:PROPERTIES:
+:DESCRIPTION: Shortcuts for writing complex links.
+:END:
+#+cindex: link abbreviations
+#+cindex: abbreviation, links
+
+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]]
+
+#+texinfo: @noindent
+#+vindex: org-link-abbrev-alist
+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:
+
+#+begin_src emacs-lisp
+(setq org-link-abbrev-alist
+ '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
+ ("Nu Html Checker" . "https://validator.w3.org/nu/?doc=%h")
+ ("duckduckgo" . "https://duckduckgo.com/?q=%s")
+ ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1")
+ ("ads" . "https://ui.adsabs.harvard.edu/search/q=%20author%3A\"%s\"")))
+#+end_src
+
+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 =[[duckduckgo: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
+
+#+cindex: @samp{LINK}, keyword
+#+begin_example
+,#+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
+,#+LINK: duckduckgo https://duckduckgo.com/?q=%s
+#+end_example
+
+In-buffer completion (see [[*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 {{{kbd(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:
+
+#+begin_src emacs-lisp
+(org-link-set-parameter "type" :complete #'some-completion-function)
+#+end_src
+
+** Search Options in File Links
+:PROPERTIES:
+:DESCRIPTION: Linking to a specific location.
+:ALT_TITLE: Search Options
+:END:
+#+cindex: search option in file links
+#+cindex: file links, searching
+#+cindex: attachment links, searching
+
+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[fn:34]. For
+example, when the command ~org-store-link~ creates a link (see
+[[*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 {{{kbd(C-c C-o)}}}.
+
+Note that all search options apply for Attachment links in the same
+way that they apply for File links.
+
+Here is the syntax of the different ways to attach a search to a file
+link, together with explanations for each:
+
+#+begin_example
+[[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/]]
+[[attachment:main.c::255]]
+#+end_example
+
+- =255= ::
+
+ Jump to line 255.
+
+- =My Target= ::
+
+ Search for a link target =<<My Target>>=, or do a text search for
+ =my target=, similar to the search in internal links, see [[*Internal
+ Links]]. In HTML export (see [[*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 {{{var(REGEXP)}}} (see [[*Regular
+ Expressions]]). 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.
+
+** Custom Searches
+:PROPERTIES:
+:DESCRIPTION: When the default search is not enough.
+:END:
+#+cindex: custom search strings
+#+cindex: search strings, custom
+
+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.
+
+#+vindex: org-create-file-search-functions
+#+vindex: org-execute-file-search-functions
+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 =ol-bibtex.el=.
+
+* TODO Items
+:PROPERTIES:
+:DESCRIPTION: Every tree branch can be a TODO item.
+:END:
+#+cindex: TODO items
+
+Org mode does not maintain TODO lists as separate documents[fn:35].
+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.
+
+** Basic TODO Functionality
+:PROPERTIES:
+:DESCRIPTION: Marking and displaying TODO entries.
+:ALT_TITLE: TODO Basics
+:END:
+
+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:
+
+- {{{kbd(C-c C-t)}}} (~org-todo~) ::
+
+ #+kindex: C-c C-t
+ #+cindex: cycling, of TODO states
+ Rotate the TODO state of the current item among
+
+ #+begin_example
+ ,-> (unmarked) -> TODO -> DONE --.
+ '--------------------------------'
+ #+end_example
+
+ If TODO keywords have fast access keys (see [[*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 state changing can also be done "remotely" from the agenda
+ buffer with the {{{kbd(t)}}} command key (see [[*Commands in the
+ Agenda Buffer]]).
+
+- {{{kbd(S-RIGHT)}}} {{{kbd(S-LEFT)}}} ::
+
+ #+kindex: S-RIGHT
+ #+kindex: S-LEFT
+ #+vindex: org-treat-S-cursor-todo-selection-as-state-change
+ Select the following/preceding TODO state, similar to cycling.
+ Useful mostly if more than two TODO states are possible (see
+ [[*Extended Use of TODO Keywords]]). See also [[*Packages that conflict
+ with Org mode]], for a discussion of the interaction with
+ shift-selection. See also the variable
+ ~org-treat-S-cursor-todo-selection-as-state-change~.
+
+- {{{kbd(C-c / t)}}} (~org-show-todo-tree~) ::
+
+ #+kindex: C-c / t
+ #+cindex: sparse tree, for TODO
+ #+vindex: org-todo-keywords
+ #+findex: org-show-todo-tree
+ View TODO items in a /sparse tree/ (see [[*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 {{{kbd(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.
+
+- {{{kbd(M-x org-agenda t)}}} (~org-todo-list~) ::
+
+ #+kindex: t @r{(Agenda dispatcher)}
+ Show the global TODO list. Collects the TODO items (with not-DONE
+ states) from all agenda files (see [[*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 [[*Commands in the Agenda Buffer]]). See [[*The global TODO
+ list]], for more information.
+
+- {{{kbd(S-M-RET)}}} (~org-insert-todo-heading~) ::
+
+ #+kindex: S-M-RET
+ #+findex: org-insert-todo-heading
+ Insert a new TODO entry below the current one.
+
+#+vindex: org-todo-state-tags-triggers
+Changing a TODO state can also trigger tag changes. See the docstring
+of the option ~org-todo-state-tags-triggers~ for details.
+
+** Extended Use of TODO Keywords
+:PROPERTIES:
+:DESCRIPTION: Workflow and assignments.
+:ALT_TITLE: TODO Extensions
+:END:
+#+cindex: extended TODO keywords
+
+#+vindex: org-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 [[*Tags]]).
+
+*** TODO keywords as workflow states
+:PROPERTIES:
+:DESCRIPTION: From TODO to DONE in steps.
+:ALT_TITLE: Workflow states
+:END:
+#+cindex: TODO workflow
+#+cindex: workflow states as TODO keywords
+
+You can use TODO keywords to indicate different, possibly /sequential/
+states in the process of working on an item, for example[fn:36]:
+
+#+begin_src emacs-lisp
+(setq org-todo-keywords
+ '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
+#+end_src
+
+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.
+
+#+cindex: completion, of TODO keywords
+With this setup, the command {{{kbd(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 {{{kbd(C-3 C-c C-t)}}} changes
+the state immediately to =VERIFY=. Or you can use {{{kbd(S-RIGHT)}}}
+and {{{kbd(S-LEFT)}}} to go forward and backward through the states.
+If you define many keywords, you can use in-buffer completion (see
+[[*Completion]]) or a special one-key selection scheme (see [[*Fast
+access to TODO states]]) to insert these words into the buffer.
+Changing a TODO state can be logged with a timestamp, see [[*Tracking
+TODO state changes]], for more information.
+
+*** TODO keywords as types
+:PROPERTIES:
+:DESCRIPTION: I do this, Fred does the rest.
+:ALT_TITLE: TODO types
+:END:
+#+cindex: TODO types
+#+cindex: names as TODO keywords
+#+cindex: types as TODO keywords
+
+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 type of
+functionality is actually much better served by using tags (see
+[[*Tags]]), so the TODO implementation is kept just for backward
+compatibility.
+
+Using TODO types, it would be set up like this:
+
+#+begin_src emacs-lisp
+(setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
+#+end_src
+
+In this case, different keywords do not indicate states, 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 {{{kbd(C-c
+C-t)}}}[fn:37]. 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
+{{{kbd(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 {{{kbd(C-c / t)}}}.
+For example, to see all things Lucy has to do, you would use
+{{{kbd(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: {{{kbd(C-3 M-x org-agenda
+t)}}}.
+
+*** Multiple keyword sets in one file
+:PROPERTIES:
+:DESCRIPTION: Mixing it all, still finding your way.
+:ALT_TITLE: Multiple sets in one file
+:END:
+#+cindex: TODO keyword sets
+
+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:
+
+#+begin_src emacs-lisp
+(setq org-todo-keywords
+ '((sequence "TODO" "|" "DONE")
+ (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
+ (sequence "|" "CANCELED")))
+#+end_src
+
+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,
+{{{kbd(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 [[*Completion]]), you may also apply the following commands:
+
+#+attr_texinfo: :sep ,
+- {{{kbd(C-u C-u C-c C-t)}}}, {{{kbd(C-S-RIGHT)}}}, {{{kbd(C-S-LEFT)}}} ::
+
+ #+kindex: C-S-RIGHT
+ #+kindex: C-S-LEFT
+ #+kindex: C-u C-u C-c C-t
+ These keys jump from one TODO sub-sequence to the next. In the
+ above example, {{{kbd(C-u C-u C-c C-t)}}} or {{{kbd(C-S-RIGHT)}}}
+ would jump from =TODO= or =DONE= to =REPORT=, and any of the words
+ in the second row to =CANCELED=. Note that the {{{kbd(C-S-)}}} key
+ binding conflict with shift-selection (see [[*Packages that conflict
+ with Org mode]]).
+
+- {{{kbd(S-RIGHT)}}}, {{{kbd(S-LEFT)}}} ::
+
+ #+kindex: S-RIGHT
+ #+kindex: S-LEFT
+ {{{kbd(S-LEFT)}}} and {{{kbd(S-RIGHT)}}} walk through /all/ keywords
+ from all sub-sequences, so for example {{{kbd(S-RIGHT)}}} would
+ switch from =DONE= to =REPORT= in the example above. For
+ a discussion of the interaction with shift-selection, see [[*Packages
+ that conflict with Org mode]].
+
+*** Fast access to TODO states
+:PROPERTIES:
+:DESCRIPTION: Single letter selection of state.
+:END:
+
+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[fn:38]. For
+example:
+
+#+begin_src emacs-lisp
+(setq org-todo-keywords
+ '((sequence "TODO(t)" "|" "DONE(d)")
+ (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
+ (sequence "|" "CANCELED(c)")))
+#+end_src
+
+#+vindex: org-fast-tag-selection-include-todo
+If you then press {{{kbd(C-c C-t)}}} followed by the selection key,
+the entry is switched to this state. {{{kbd(SPC)}}} can be used to
+remove any TODO keyword from an entry[fn:39].
+
+*** Setting up keywords for individual files
+:PROPERTIES:
+:DESCRIPTION: Different files, different requirements.
+:ALT_TITLE: Per-file keywords
+:END:
+#+cindex: keyword options
+#+cindex: per-file keywords
+#+cindex: @samp{TODO}, keyword
+#+cindex: @samp{TYP_TODO}, keyword
+#+cindex: @samp{SEQ_TODO}, keyword
+
+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:
+
+#+begin_example
+,#+TODO: TODO(t) | DONE(d)
+,#+TODO: REPORT(r) BUG(b) KNOWNCAUSE(k) | FIXED(f)
+,#+TODO: | CANCELED(c)
+#+end_example
+
+#+cindex: completion, of option keywords
+#+kindex: M-TAB
+To make sure you are using the correct keyword, type =#+= into the
+buffer and then use {{{kbd(M-TAB)}}} to complete it (see [[*Completion]]).
+
+#+cindex: DONE, final TODO keyword
+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 {{{kbd(C-c C-c)}}} with point still in the line to make the
+changes known to Org mode[fn:40].
+
+*** Faces for TODO keywords
+:PROPERTIES:
+:DESCRIPTION: Highlighting states.
+:END:
+#+cindex: faces, for TODO keywords
+
+#+vindex: org-todo, face
+#+vindex: org-done, face
+#+vindex: org-todo-keyword-faces
+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:
+
+#+begin_src emacs-lisp
+(setq org-todo-keyword-faces
+ '(("TODO" . org-warning) ("STARTED" . "yellow")
+ ("CANCELED" . (:foreground "blue" :weight bold))))
+#+end_src
+
+#+vindex: org-faces-easy-properties
+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.
+
+*** TODO dependencies
+:PROPERTIES:
+:DESCRIPTION: When one task needs to wait for others.
+:END:
+#+cindex: TODO dependencies
+#+cindex: dependencies, of TODO states
+
+#+vindex: org-enforce-todo-dependencies
+#+cindex: @samp{ORDERED}, property
+The structure of Org files---hierarchy and lists---makes it easy to
+define TODO dependencies. Usually, a parent TODO task should not be
+marked as 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 as 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 as done.
+Here is an example:
+
+#+begin_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)
+#+end_example
+
+#+cindex: TODO dependencies, @samp{NOBLOCKING}
+#+cindex: @samp{NOBLOCKING}, property
+You can ensure an entry is never blocked by using the =NOBLOCKING=
+property (see [[*Properties and Columns]]):
+
+#+begin_example
+,* This entry is never blocked
+:PROPERTIES:
+:NOBLOCKING: t
+:END:
+#+end_example
+
+- {{{kbd(C-c C-x o)}}} (~org-toggle-ordered-property~) ::
+
+ #+kindex: C-c C-x o
+ #+findex: org-toggle-ordered-property
+ #+vindex: org-track-ordered-property-with-tag
+ 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 [[*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~.
+
+- {{{kbd(C-u C-u C-u C-c C-t)}}} ::
+
+ #+kindex: C-u C-u C-u C-u C-c C-t
+ Change TODO state, regardless of any state blocking.
+
+#+vindex: org-agenda-dim-blocked-tasks
+If you set the variable ~org-agenda-dim-blocked-tasks~, TODO entries
+that cannot be marked as done because of unmarked children are shown
+in a dimmed font or even made invisible in agenda views (see [[*Agenda
+Views]]).
+
+#+cindex: checkboxes and TODO dependencies
+#+vindex: org-enforce-todo-dependencies
+You can also block changes of TODO states by using checkboxes (see
+[[*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 module =org-depend.el= in the =org-contrib= repository.
+
+** Progress Logging
+:PROPERTIES:
+:DESCRIPTION: Dates and notes for progress.
+:END:
+#+cindex: progress logging
+#+cindex: logging, of progress
+
+To record a timestamp and a note when changing a TODO state, call the
+command ~org-todo~ with a prefix argument.
+
+- {{{kbd(C-u C-c C-t)}}} (~org-todo~) ::
+
+ #+kindex: C-u C-c C-t
+ Prompt for a note and record a the time of the TODO state change.
+ The note is inserted as a list item below the headline, but can also
+ be placed into a drawer, see [[*Tracking TODO state changes]].
+
+If you want to be more systematic, 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 [[*Clocking Work Time]].
+
+*** Closing items
+:PROPERTIES:
+:DESCRIPTION: When was this entry marked as done?
+:END:
+
+The most basic automatic logging is to keep track of /when/ a certain
+TODO item was marked as done. This can be achieved with[fn:41]
+
+#+begin_src emacs-lisp
+(setq org-log-done 'time)
+#+end_src
+
+#+vindex: org-closed-keep-when-no-todo
+#+texinfo: @noindent
+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 {{{kbd(C-c C-t
+SPC)}}} 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[fn:42]
+
+#+begin_src emacs-lisp
+(setq org-log-done 'note)
+#+end_src
+
+#+texinfo: @noindent
+You are then prompted for a note, and that note is stored below the
+entry with a =Closing Note= heading.
+
+*** Tracking TODO state changes
+:PROPERTIES:
+:DESCRIPTION: When did the status change?
+:END:
+#+cindex: drawer, for state change recording
+
+#+vindex: org-log-states-order-reversed
+#+vindex: org-log-into-drawer
+#+cindex: @samp{LOG_INTO_DRAWER}, property
+You might want to automatically 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[fn:43].
+When taking a lot of notes, you might want to get the notes out of the
+way into a drawer (see [[*Drawers]]). Customize the variable
+~org-log-into-drawer~ to get this behavior---the recommended drawer
+for this is called =LOGBOOK=[fn:44]. 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
+
+#+begin_src emacs-lisp
+(setq org-todo-keywords
+ '((sequence "TODO(t)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELED(c@)")))
+#+end_src
+
+#+vindex: org-log-done
+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=[fn:45]. 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@)
+
+To record a timestamp without a note for TODO keywords configured with
+=@=, just type {{{kbd(C-c C-c)}}} to enter a blank note when prompted.
+
+#+cindex: @samp{LOGGING}, property
+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:
+
+#+begin_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:
+#+end_example
+
+*** Tracking your habits
+:PROPERTIES:
+:DESCRIPTION: How consistent have you been?
+:END:
+#+cindex: habits
+#+cindex: @samp{STYLE}, property
+
+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 [[*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 [[*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:
+
+#+begin_example
+,** 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]
+#+end_example
+
+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 [[*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~ ::
+
+ #+vindex: 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~ ::
+
+ #+vindex: org-habit-preceding-days
+ The amount of history, in days before today, to appear in
+ consistency graphs.
+
+- ~org-habit-following-days~ ::
+
+ #+vindex: org-habit-following-days
+ The number of days after today that appear in consistency graphs.
+
+- ~org-habit-show-habits-only-for-today~ ::
+
+ #+vindex: org-habit-show-habits-only-for-today
+ If non-~nil~, only show habits in today's agenda view. The default
+ value is ~t~. Pressing {{{kbd(C-u K)}}} in the agenda toggles this
+ variable.
+
+Lastly, pressing {{{kbd(K)}}} in the agenda buffer causes habits to
+temporarily be disabled and do not appear at all. Press {{{kbd(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.
+
+** Priorities
+:PROPERTIES:
+:DESCRIPTION: Some things are more important than others.
+:END:
+#+cindex: priorities
+#+cindex: priority cookie
+
+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
+right after the TODO keyword, like this:
+
+: *** TODO [#A] Write letter to Sam Fortune
+
+#+vindex: org-priority-faces
+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 [[*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.
+
+You can also use numeric values for priorities, such as
+
+: *** TODO [#1] Write letter to Sam Fortune
+
+When using numeric priorities, you need to set ~org-priority-highest~,
+~org-priority-lowest~ and ~org-priority-default~ to integers, which
+must all be strictly inferior to 65.
+
+Priorities can be attached to any outline node; they do not need to be
+TODO items.
+
+#+attr_texinfo: :sep ;
+- {{{kbd(C-c \,)}}} (~org-priority~) ::
+
+ #+kindex: C-c ,
+ #+findex: org-priority
+ Set the priority of the current headline. The command prompts for
+ a priority character =A=, =B= or =C=. When you press {{{kbd(SPC)}}}
+ 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 {{{kbd(\,)}}} command (see [[*Commands in the
+ Agenda Buffer]]).
+
+- {{{kbd(S-UP)}}} (~org-priority-up~); {{{kbd(S-DOWN)}}} (~org-priority-down~) ::
+
+ #+kindex: S-UP
+ #+kindex: S-DOWN
+ #+findex: org-priority-up
+ #+findex: org-priority-down
+ #+vindex: org-priority-start-cycle-with-default
+ Increase/decrease the priority of the current headline[fn:46]. Note
+ that these keys are also used to modify timestamps (see [[*Creating
+ Timestamps]]). See also [[*Packages that conflict with Org mode]], for
+ a discussion of the interaction with shift-selection.
+
+#+vindex: org-priority-highest
+#+vindex: org-priority-lowest
+#+vindex: org-priority-default
+You can change the range of allowed priorities by setting the
+variables ~org-priority-highest~, ~org-priority-lowest~, and
+~org-priority-default~. 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):
+
+#+cindex: @samp{PRIORITIES}, keyword
+: #+PRIORITIES: A C B
+
+Or, using numeric values:
+
+: #+PRIORITIES: 1 10 5
+
+** Breaking Down Tasks into Subtasks
+:PROPERTIES:
+:DESCRIPTION: Splitting a task into manageable pieces.
+:ALT_TITLE: Breaking Down Tasks
+:END:
+#+cindex: tasks, breaking down
+#+cindex: statistics, for TODO items
+
+#+vindex: org-agenda-todo-list-sublevels
+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[fn:47]. To keep
+an overview of the fraction of subtasks that have already been marked
+as done, insert either =[/]= or =[%]= anywhere in the headline. These
+cookies are updated each time the TODO status of a child changes, or
+when pressing {{{kbd(C-c C-c)}}} on the cookie. For example:
+
+#+begin_example
+,* Organize Party [33%]
+,** TODO Call people [1/2]
+,*** TODO Peter
+,*** DONE Sarah
+,** TODO Buy food
+,** DONE Talk to neighbor
+#+end_example
+
+#+cindex: @samp{COOKIE_DATA}, property
+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.
+
+#+vindex: org-hierarchical-todo-statistics
+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.
+
+#+begin_example org
+,* Parent capturing statistics [2/20]
+ :PROPERTIES:
+ :COOKIE_DATA: todo recursive
+ :END:
+#+end_example
+
+If you would like a TODO entry to automatically change to DONE when
+all children are done, you can use the following setup:
+
+#+begin_src emacs-lisp
+(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)
+#+end_src
+
+Another possibility is the use of checkboxes to identify (a hierarchy
+of) a large number of subtasks (see [[*Checkboxes]]).
+
+** Checkboxes
+:PROPERTIES:
+:DESCRIPTION: Tick-off lists.
+:END:
+#+cindex: checkboxes
+
+#+vindex: org-list-automatic-rules
+Every item in a plain list[fn:48] (see [[*Plain Lists]]) can be made into
+a checkbox by starting it with the string =[ ]=. This feature is
+similar to TODO items (see [[*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.
+
+Here is an example of a checkbox list.
+
+#+begin_example
+,* 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
+#+end_example
+
+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.
+
+#+cindex: statistics, for checkboxes
+#+cindex: checkbox statistics
+#+cindex: @samp{COOKIE_DATA}, property
+#+vindex: org-hierarchical-checkbox-statistics
+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[fn:49]. 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.
+
+#+cindex: blocking, of checkboxes
+#+cindex: checkbox blocking
+#+cindex: @samp{ORDERED}, property
+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:
+
+- {{{kbd(C-c C-c)}}} (~org-toggle-checkbox~) ::
+
+ #+kindex: C-c C-c
+ #+findex: 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[fn:50]. With a double prefix argument, set
+ it to =[-]=, which is considered to be an intermediate state.
+
+- {{{kbd(C-c C-x C-b)}}} (~org-toggle-checkbox~) ::
+
+ #+kindex: C-c C-x C-b
+ 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.
+
+- {{{kbd(C-c C-x C-r)}}} (~org-toggle-radio-button~) ::
+
+ #+kindex: C-c C-x C-r
+ #+findex: org-toggle-radio-button
+ #+cindex: radio button, checkbox as
+ Toggle checkbox status by using the checkbox of the item at point as
+ a radio button: when the checkbox is turned on, all other checkboxes
+ on the same level will be turned off. With a universal prefix
+ argument, toggle the presence of the checkbox. With a double prefix
+ argument, set it to =[-]=.
+
+ #+findex: org-list-checkbox-radio-mode
+ {{{kbd(C-c C-c)}}} can be told to consider checkboxes as radio buttons by
+ setting =#+ATTR_ORG: :radio t= right before the list or by calling
+ {{{kbd(M-x org-list-checkbox-radio-mode)}}} to activate this minor mode.
+
+- {{{kbd(M-S-RET)}}} (~org-insert-todo-heading~) ::
+
+ #+kindex: M-S-RET
+ #+findex: org-insert-todo-heading
+ Insert a new item with a checkbox. This works only if point is
+ already in a plain list item (see [[*Plain Lists]]).
+
+- {{{kbd(C-c C-x o)}}} (~org-toggle-ordered-property~) ::
+
+ #+kindex: C-c C-x o
+ #+findex: org-toggle-ordered-property
+ #+vindex: org-track-ordered-property-with-tag
+ 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~.
+
+- {{{kbd(C-c #)}}} (~org-update-statistics-cookies~) ::
+
+ #+kindex: C-c #
+ #+findex: org-update-statistics-cookies
+ Update the statistics cookie in the current outline entry. When
+ called with a {{{kbd(C-u)}}} prefix, update the entire file.
+ Checkbox statistic cookies are updated automatically if you toggle
+ checkboxes with {{{kbd(C-c C-c)}}} and make new ones with
+ {{{kbd(M-S-RET)}}}. 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.
+
+* Tags
+:PROPERTIES:
+:DESCRIPTION: Tagging headlines and matching sets of tags.
+:END:
+#+cindex: tags
+#+cindex: headline tagging
+#+cindex: matching, tags
+#+cindex: sparse tree, tag based
+
+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.
+
+#+vindex: org-tag-faces
+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 [[*Faces for TODO keywords]]).
+
+** Tag Inheritance
+:PROPERTIES:
+:DESCRIPTION: Tags use the tree structure of an outline.
+:END:
+#+cindex: tag inheritance
+#+cindex: inheritance, of tags
+#+cindex: sublevels, inclusion into tags match
+
+/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
+
+#+begin_example
+,* Meeting with the French group :work:
+,** Summary by Frank :boss:notes:
+,*** TODO Prepare slides for him :action:
+#+end_example
+
+#+texinfo: @noindent
+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[fn:51]
+
+#+cindex: @samp{FILETAGS}, keyword
+: #+FILETAGS: :Peter:Boss:Secret:
+
+#+vindex: org-use-tag-inheritance
+#+vindex: org-tags-exclude-from-inheritance
+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~.
+
+#+vindex: org-tags-match-list-sublevels
+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[fn:52]. 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).
+
+#+vindex: org-agenda-use-tag-inheritance
+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.
+
+** Setting Tags
+:PROPERTIES:
+:DESCRIPTION: How to assign tags to a headline.
+:END:
+#+cindex: setting tags
+#+cindex: tags, setting
+
+#+kindex: M-TAB
+Tags can simply be typed into the buffer at the end of a headline.
+After a colon, {{{kbd(M-TAB)}}} offers completion on tags. There is
+also a special command for inserting tags:
+
+- {{{kbd(C-c C-q)}}} (~org-set-tags-command~) ::
+
+ #+kindex: C-c C-q
+ #+findex: org-set-tags-command
+ #+cindex: completion, of tags
+ #+vindex: org-tags-column
+ 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 {{{kbd(RET)}}}, the tags are inserted and
+ aligned to ~org-tags-column~. When called with a {{{kbd(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 [[*Basic TODO
+ Functionality]]).
+
+- {{{kbd(C-c C-c)}}} (~org-set-tags-command~) ::
+
+ #+kindex: C-c C-c
+ When point is in a headline, this does the same as {{{kbd(C-c
+ C-q)}}}.
+
+#+vindex: org-complete-tags-always-offer-all-agenda-tags
+#+vindex: org-tag-alist
+#+cindex: @samp{TAGS}, keyword
+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[fn:53]. 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
+
+#+begin_example
+,#+TAGS: @work @home @tennisclub
+,#+TAGS: laptop car pc sailboat
+#+end_example
+
+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:
+
+#+vindex: org-tag-persistent-alist
+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:
+
+#+begin_src emacs-lisp
+(setq org-tag-alist '(("@work" . ?w) ("@home" . ?h) ("laptop" . ?l)))
+#+end_src
+
+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)
+
+#+texinfo: @noindent
+or write them in two lines:
+
+#+begin_example
+,#+TAGS: @work(w) @home(h) @tennisclub(t)
+,#+TAGS: laptop(l) pc(p)
+#+end_example
+
+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)
+
+#+texinfo: @noindent
+you indicate that at most one of =@work=, =@home=, and =@tennisclub=
+should be selected. Multiple such groups are allowed.
+
+Do not forget to press {{{kbd(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:
+
+#+begin_src emacs-lisp
+(setq org-tag-alist '((:startgroup . nil)
+ ("@work" . ?w) ("@home" . ?h)
+ ("@tennisclub" . ?t)
+ (:endgroup . nil)
+ ("laptop" . ?l) ("pc" . ?p)))
+#+end_src
+
+If at least one tag has a selection key then pressing {{{kbd(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[fn:54].
+
+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:
+
+- {{{kbd(TAB)}}} ::
+
+ #+kindex: TAB
+ 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
+ and globally pre-defined tags from ~org-tag-alist~ and
+ ~org-tag-persistent-alist~. You can also add several tags: just
+ separate them with a comma.
+
+- {{{kbd(SPC)}}} ::
+
+ #+kindex: SPC
+ Clear all tags for this line.
+
+- {{{kbd(RET)}}} ::
+
+ #+kindex: RET
+ Accept the modified set.
+
+- {{{kbd(C-g)}}} ::
+
+ #+kindex: C-g
+ Abort without installing changes.
+
+- {{{kbd(q)}}} ::
+
+ #+kindex: q
+ If {{{kbd(q)}}} is not assigned to a tag, it aborts like
+ {{{kbd(C-g)}}}.
+
+- {{{kbd(!)}}} ::
+
+ #+kindex: !
+ Turn off groups of mutually exclusive tags. Use this to (as an
+ exception) assign several tags from such a group.
+
+- {{{kbd(C-c)}}} ::
+
+ #+kindex: C-c C-c
+ Toggle auto-exit after the next change (see below). If you are
+ using expert mode, the first {{{kbd(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:
+{{{kbd(C-c C-c SPC h l p RET)}}}. Switching from =@home= to =@work=
+would be done with {{{kbd(C-c C-c w RET)}}} or alternatively with
+{{{kbd(C-c C-c C-c w)}}}. Adding the non-predefined tag =sarah= could
+be done with {{{kbd(C-c C-c TAB s a r a h RET)}}}.
+
+#+vindex: org-fast-tag-selection-single-key
+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
+{{{kbd(RET)}}} to exit fast tag selection---it exits after the first
+change. If you then occasionally need more keys, press {{{kbd(C-c)}}}
+to turn off auto-exit for the current tag selection process (in
+effect: start selection with {{{kbd(C-c C-c C-c)}}} instead of
+{{{kbd(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 {{{kbd(C-c)}}}.
+
+** Tag Hierarchy
+:PROPERTIES:
+:DESCRIPTION: Create a hierarchy of tags.
+:END:
+#+cindex: group tags
+#+cindex: tags, groups
+#+cindex: tags 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:
+
+#+begin_example
+,#+TAGS: [ Control : Context Task ]
+,#+TAGS: [ Persp : Vision Goal AOF Project ]
+#+end_example
+
+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:
+
+#+begin_src emacs-lisp
+(setq org-tag-alist '((:startgrouptag)
+ ("GTD")
+ (:grouptags)
+ ("Control")
+ ("Persp")
+ (:endgrouptag)
+ (:startgrouptag)
+ ("Control")
+ (:grouptags)
+ ("Context")
+ ("Task")
+ (:endgrouptag)))
+#+end_src
+
+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 (see [[*Regular Expressions]]). The regular expressions in
+the group must be specified within curly brackets. Here is an
+expanded example:
+
+#+begin_example
+,#+TAGS: [ Vision : {V@.+} ]
+,#+TAGS: [ Goal : {G@.+} ]
+,#+TAGS: [ AOF : {AOF@.+} ]
+,#+TAGS: [ Project : {P@.+} ]
+#+end_example
+
+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=.
+
+#+kindex: C-c C-x q
+#+findex: org-toggle-tags-groups
+#+vindex: org-group-tags
+If you want to ignore group tags temporarily, toggle group tags
+support with ~org-toggle-tags-groups~, bound to {{{kbd(C-c C-x q)}}}.
+If you want to disable tag groups completely, set ~org-group-tags~ to
+~nil~.
+
+** Tag Searches
+:PROPERTIES:
+:DESCRIPTION: Searching for combinations of tags.
+:END:
+#+cindex: tag searches
+#+cindex: searching for tags
+
+Once a system of tags has been set up, it can be used to collect
+related information into special lists.
+
+- {{{kbd(C-c / m)}}} or {{{kbd(C-c \)}}} (~org-match-sparse-tree~) ::
+
+ #+kindex: C-c / m
+ #+kindex: C-c \
+ #+findex: org-match-sparse-tree
+ Create a sparse tree with all headlines matching a tags search.
+ With a {{{kbd(C-u)}}} prefix argument, ignore headlines that are not
+ a TODO line.
+
+- {{{kbd(M-x org-agenda m)}}} (~org-tags-view~) ::
+
+ #+kindex: m @r{(Agenda dispatcher)}
+ #+findex: org-tags-view
+ Create a global list of tag matches from all agenda files. See
+ [[*Matching tags and properties]].
+
+- {{{kbd(M-x org-agenda M)}}} (~org-tags-view~) ::
+
+ #+kindex: M @r{(Agenda dispatcher)}
+ #+vindex: org-tags-match-list-sublevels
+ 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 [[*Matching tags and properties]].
+
+* Properties and Columns
+:PROPERTIES:
+:DESCRIPTION: Storing information about an entry.
+:END:
+#+cindex: properties
+
+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 the whole buffer.
+
+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
+[[*Column View]]).
+
+** Property Syntax
+:PROPERTIES:
+:DESCRIPTION: How properties are spelled out.
+:END:
+#+cindex: property syntax
+#+cindex: drawer, for properties
+
+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 [[*Drawers]]) with the name =PROPERTIES=, which has to be
+located right below a headline, and its planning line (see [[*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:
+
+#+begin_example
+,* CD collection
+,** Classic
+,*** Goldberg Variations
+ :PROPERTIES:
+ :Title: Goldberg Variations
+ :Composer: J.S. Bach
+ :Artist: Glenn Gould
+ :Publisher: Deutsche Grammophon
+ :NDisks: 1
+ :END:
+#+end_example
+
+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 [[*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:
+
+#+begin_example
+,* CD collection
+ :PROPERTIES:
+ :NDisks_ALL: 1 2 3 4
+ :Publisher_ALL: "Deutsche Grammophon" Philips EMI
+ :END:
+#+end_example
+
+Properties can be inserted on buffer level. That means they apply
+before the first headline and can be inherited by all entries in a
+file. Property blocks defined before first headline needs to be
+located at the top of the buffer, allowing only comments above.
+
+Properties can also be defined using lines like:
+
+#+cindex: @samp{_ALL} suffix, in properties
+#+cindex: @samp{PROPERTY}, keyword
+: #+PROPERTY: NDisks_ALL 1 2 3 4
+
+#+cindex: @samp{+} suffix, in properties
+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=.
+
+#+begin_example
+,#+PROPERTY: var foo=1
+,#+PROPERTY: var+ bar=2
+#+end_example
+
+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.
+
+#+begin_example
+,* 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:
+#+end_example
+
+Note that a property can only have one entry per drawer.
+
+#+vindex: org-global-properties
+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:
+
+#+attr_texinfo: :sep ,
+- {{{kbd(M-TAB)}}} (~pcomplete~) ::
+
+ #+kindex: M-TAB
+ #+findex: pcomplete
+ After an initial colon in a line, complete property keys. All keys
+ used in the current file are offered as possible completions.
+
+- {{{kbd(C-c C-x p)}}} (~org-set-property~) ::
+
+ #+kindex: C-c C-x p
+ #+findex: org-set-property
+ Set a property. This prompts for a property name and a value. If
+ necessary, the property drawer is created as well.
+
+- {{{kbd(C-u M-x org-insert-drawer)}}} ::
+
+ #+findex: 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. If before first headline the drawer is
+ inserted at the top of the drawer after any potential comments.
+
+- {{{kbd(C-c C-c)}}} (~org-property-action~) ::
+
+ #+kindex: C-c C-c
+ #+findex: org-property-action
+ With point in a property drawer, this executes property commands.
+
+- {{{kbd(C-c C-c s)}}} (~org-set-property~) ::
+
+ #+kindex: C-c C-c s
+ #+findex: org-set-property
+ Set a property in the current entry. Both the property and the
+ value can be inserted using completion.
+
+- {{{kbd(S-RIGHT)}}} (~org-property-next-allowed-values~), {{{kbd(S-LEFT)}}} (~org-property-previous-allowed-value~) ::
+
+ #+kindex: S-RIGHT
+ #+kindex: S-LEFT
+ Switch property at point to the next/previous allowed value.
+
+- {{{kbd(C-c C-c d)}}} (~org-delete-property~) ::
+
+ #+kindex: C-c C-c d
+ #+findex: org-delete-property
+ Remove a property from the current entry.
+
+- {{{kbd(C-c C-c D)}}} (~org-delete-property-globally~) ::
+
+ #+kindex: C-c C-c D
+ #+findex: org-delete-property-globally
+ Globally remove a property, from all entries in the current file.
+
+- {{{kbd(C-c C-c c)}}} (~org-compute-property-at-point~) ::
+
+ #+kindex: C-c C-c c
+ #+findex: org-compute-property-at-point
+ Compute the property at point, using the operator and scope from the
+ nearest column format definition.
+
+** Special Properties
+:PROPERTIES:
+:DESCRIPTION: Access to other Org mode features.
+:END:
+#+cindex: properties, special
+
+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 [[*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:
+
+#+cindex: @samp{ALLTAGS}, special property
+#+cindex: @samp{BLOCKED}, special property
+#+cindex: @samp{CLOCKSUM}, special property
+#+cindex: @samp{CLOCKSUM_T}, special property
+#+cindex: @samp{CLOSED}, special property
+#+cindex: @samp{DEADLINE}, special property
+#+cindex: @samp{FILE}, special property
+#+cindex: @samp{ITEM}, special property
+#+cindex: @samp{PRIORITY}, special property
+#+cindex: @samp{SCHEDULED}, special property
+#+cindex: @samp{TAGS}, special property
+#+cindex: @samp{TIMESTAMP}, special property
+#+cindex: @samp{TIMESTAMP_IA}, special property
+#+cindex: @samp{TODO}, special property
+| =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 timestamp. |
+| =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. |
+| =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. |
+
+** Property Searches
+:PROPERTIES:
+:DESCRIPTION: Matching property values.
+:END:
+#+cindex: properties, searching
+#+cindex: searching, of properties
+
+To create sparse trees and special lists with selection based on
+properties, the same commands are used as for tag searches (see [[*Tag
+Searches]]).
+
+- {{{kbd(C-c / m)}}} or {{{kbd(C-c \)}}} (~org-match-sparse-tree~) ::
+
+ #+kindex: C-c / m
+ #+kindex: C-c \
+ #+findex: org-match-sparse-tree
+ Create a sparse tree with all matching entries. With
+ a {{{kbd(C-u)}}} prefix argument, ignore headlines that are not
+ a TODO line.
+
+- {{{kbd(M-x org-agenda m)}}} (~org-tags-view~) ::
+
+ #+kindex: m @r{(Agenda dispatcher)}
+ #+findex: org-tags-view
+ Create a global list of tag/property matches from all agenda files.
+
+- {{{kbd(M-x org-agenda M)}}} (~org-tags-view~) ::
+
+ #+kindex: M @r{(Agenda dispatcher)}
+ #+vindex: org-tags-match-list-sublevels
+ 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 [[*Matching tags and
+properties]].
+
+There is also a special command for creating sparse trees based on a
+single property:
+
+- {{{kbd(C-c / p)}}} ::
+
+ #+kindex: 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 (see [[*Regular Expressions]]).
+
+** Property Inheritance
+:PROPERTIES:
+:DESCRIPTION: Passing values down a tree.
+:END:
+#+cindex: properties, inheritance
+#+cindex: inheritance, of properties
+
+#+vindex: org-use-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~ ::
+
+ #+cindex: @samp{COLUMNS}, property
+ The =COLUMNS= property defines the format of column view (see
+ [[*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~ ::
+
+ #+cindex: @samp{CATEGORY}, property
+ For agenda view, a category set through a =CATEGORY= property
+ applies to the entire subtree.
+
+- ~ARCHIVE~ ::
+
+ #+cindex: @samp{ARCHIVE}, property
+ For archiving, the =ARCHIVE= property may define the archive
+ location for the entire subtree (see [[*Moving a tree to an archive
+ file]]).
+
+- ~LOGGING~ ::
+
+ #+cindex: @samp{LOGGING}, property
+ The =LOGGING= property may define logging settings for an entry or
+ a subtree (see [[*Tracking TODO state changes]]).
+
+** Column View
+:PROPERTIES:
+:DESCRIPTION: Tabular viewing and editing.
+:END:
+
+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---{{{kbd(S-TAB)}}} {{{kbd(S-TAB)}}}, or simply {{{kbd(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
+[[*Agenda Views]]) where queries have collected selected items, possibly
+from a number of files.
+
+*** Defining columns
+:PROPERTIES:
+:DESCRIPTION: The COLUMNS format property.
+:END:
+#+cindex: column view, for properties
+#+cindex: properties, column view
+
+Setting up a column view first requires defining the columns. This is
+done by defining a column format line.
+
+**** Scope of column definitions
+:PROPERTIES:
+:DESCRIPTION: Where defined, where valid?
+:END:
+
+To specify a format that only applies to a specific tree, add
+a =COLUMNS= property to the top node of that tree, for example:
+
+#+begin_example
+,** Top node for columns view
+ :PROPERTIES:
+ :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
+ :END:
+#+end_example
+
+A =COLUMNS= property within a property drawer before first headline
+will apply to the entire file. As an addition to property drawers,
+keywords can also be defined for an entire file using a line like:
+
+#+cindex: @samp{COLUMNS}, keyword
+: #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
+
+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.
+
+**** Column attributes
+:PROPERTIES:
+:DESCRIPTION: Appearance and content of a column.
+:END:
+
+A column definition sets the attributes of a column. The general
+definition looks like this:
+
+: %[WIDTH]PROPERTY[(TITLE)][{SUMMARY-TYPE}]
+
+#+texinfo: @noindent
+Except for the percent sign and the property name, all items are
+optional. The individual parts have the following meaning:
+
+- {{{var(WIDTH)}}} ::
+
+ An integer specifying the width of the column in characters. If
+ omitted, the width is determined automatically.
+
+- {{{var(PROPERTY)}}} ::
+
+ The property that should be edited in this column. Special
+ properties representing meta data are allowed here as well (see
+ [[*Special Properties]]).
+
+- {{{var(TITLE)}}} ::
+
+ The header text for the column. If omitted, the property name is
+ used.
+
+- {{{var(SUMMARY-TYPE)}}} ::
+
+ The summary type. If specified, the column values for parent nodes
+ are computed from the children[fn:55].
+
+ 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 minutes. |
+ | =:min= | Smallest time value in column. |
+ | =:max= | Largest time value. |
+ | =:mean= | Arithmetic mean of time values. |
+ | =@min= | Minimum age[fn:56] (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. |
+
+ #+vindex: org-columns-summary-types
+ 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[fn:57].
+
+#+begin_example
+: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]"
+#+end_example
+
+#+texinfo: @noindent
+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.
+
+*** Using column view
+:PROPERTIES:
+:DESCRIPTION: How to create and use column view.
+:END:
+
+**** Turning column view on or off
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(C-c C-x C-c)}}} (~org-columns~) ::
+
+ #+kindex: C-c C-x C-c
+ #+vindex: org-columns
+ #+vindex: org-columns-default-format
+ 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.
+
+- {{{kbd(r)}}} or {{{kbd(g)}}} on a columns view line (~org-columns-redo~) ::
+
+ #+kindex: r
+ #+kindex: g
+ #+findex: org-columns-redo
+ Recreate the column view, to include recent changes made in the
+ buffer.
+
+- {{{kbd(C-c C-c)}}} or {{{kbd(q)}}} on a columns view line (~org-columns-quit~) ::
+
+ #+kindex: q
+ #+kindex: C-c C-c
+ #+findex: org-columns-quit
+ Exit column view.
+
+**** Editing values
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+attr_texinfo: :sep and
+- {{{kbd(LEFT)}}}, {{{kbd(RIGHT)}}}, {{{kbd(UP)}}}, {{{kbd(DOWN)}}} ::
+
+ Move through the column view from field to field.
+
+- {{{kbd(1..9\,0)}}} ::
+
+ #+kindex: 1..9,0
+ Directly select the Nth allowed value, {{{kbd(0)}}} selects the
+ 10th value.
+
+- {{{kbd(n)}}} or {{{kbd(S-RIGHT)}}} (~org-columns-next-allowed-value~) and {{{kbd(p)}}} or {{{kbd(S-LEFT)}}} (~org-columns-previous-allowed-value~) ::
+
+ #+kindex: n
+ #+kindex: S-RIGHT
+ #+kindex: p
+ #+kindex: S-LEFT
+ #+findex: org-columns-next-allowed-value
+ #+findex: 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.
+
+- {{{kbd(e)}}} (~org-columns-edit-value~) ::
+
+ #+kindex: e
+ #+findex: 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.
+
+- {{{kbd(C-c C-c)}}} (~org-columns-toggle-or-columns-quit~) ::
+
+ #+kindex: C-c C-c
+ #+findex: org-columns-toggle-or-columns-quit
+ When there is a checkbox at point, toggle it. Else exit column
+ view.
+
+- {{{kbd(v)}}} (~org-columns-show-value~) ::
+
+ #+kindex: v
+ #+findex: 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.
+
+- {{{kbd(a)}}} (~org-columns-edit-allowed~) ::
+
+ #+kindex: a
+ #+findex: 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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+attr_texinfo: :sep and
+- {{{kbd(<)}}} (~org-columns-narrow~) and {{{kbd(>)}}} (~org-columns-widen~) ::
+
+ #+kindex: <
+ #+kindex: >
+ #+findex: org-columns-narrow
+ #+findex: org-columns-widen
+ Make the column narrower/wider by one character.
+
+- {{{kbd(S-M-RIGHT)}}} (~org-columns-new~) ::
+
+ #+kindex: S-M-RIGHT
+ #+findex: org-columns-new
+ Insert a new column, to the left of the current column.
+
+- {{{kbd(S-M-LEFT)}}} (~org-columns-delete~) ::
+
+ #+kindex: S-M-LEFT
+ #+findex: org-columns-delete
+ Delete the current column.
+
+*** Capturing column view
+:PROPERTIES:
+:DESCRIPTION: A dynamic block for column view.
+:END:
+
+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 [[*Dynamic Blocks]]). The frame of
+this block looks like this:
+
+#+cindex: @samp{BEGIN columnview}
+#+begin_example
+,* The column view
+,#+BEGIN: columnview :hlines 1 :id "label"
+
+,#+END:
+#+end_example
+
+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 {{{var(FILENAME)}}} file.
+
+ - =LABEL= ::
+
+ #+cindex: @samp{ID}, property
+ Call column view in the tree that has an =ID= property with the
+ value {{{var(LABEL)}}}. You can use {{{kbd(M-x org-id-copy)}}} to
+ create a globally unique ID for the current entry and copy it to
+ the kill-ring.
+
+- =:match= ::
+
+ When set to a string, use this as a tags/property match filter to
+ select only a subset of the headlines in the scope set by the ~:id~
+ parameter.
+
+
+- =: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=.
+
+- =:exclude-tags= ::
+
+ List of tags to exclude from column view table: entries with these
+ tags will be excluded from the column view.
+
+- =:indent= ::
+
+ When non-~nil~, indent each =ITEM= field according to its level.
+
+- =:format= ::
+
+ Specify a column attribute (see [[*Column attributes]]) for the dynamic
+ block.
+
+The following commands insert or update the dynamic block:
+
+- ~org-columns-insert-dblock~ ::
+
+ #+kindex: C-c C-x x
+ #+findex: org-columns-insert-dblock
+ Insert a dynamic block capturing a column view. Prompt for the
+ scope or ID of the view.
+
+ This command can be invoked by calling
+ ~org-dynamic-block-insert-dblock~ ({{{kbd(C-c C-x x)}}}) and
+ selecting "columnview" (see [[*Dynamic Blocks]]).
+
+- {{{kbd(C-c C-c)}}} {{{kbd(C-c C-x C-u)}}} (~org-dblock-update~) ::
+
+ #+kindex: C-c C-c
+ #+kindex: C-c C-x C-u
+ #+findex: org-dblock-update
+ Update dynamic block at point. point needs to be in the =#+BEGIN=
+ line of the dynamic block.
+
+- {{{kbd(C-u C-c C-x C-u)}}} (~org-update-all-dblocks~) ::
+
+ #+kindex: C-u C-c C-x C-u
+ Update all dynamic blocks (see [[*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 package
+in =org-contrib=[fn:58]. 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.
+
+* Dates and Times
+:PROPERTIES:
+:DESCRIPTION: Making items useful for planning.
+:END:
+#+cindex: dates
+#+cindex: times
+#+cindex: timestamp
+#+cindex: date stamp
+
+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.
+
+** Timestamps
+:PROPERTIES:
+:DESCRIPTION: Assigning a time to a tree entry.
+:END:
+#+cindex: timestamps
+#+cindex: ranges, time
+#+cindex: date stamps
+#+cindex: deadlines
+#+cindex: 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>=[fn:59].
+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 [[*Weekly/daily agenda]]). We distinguish:
+
+- Plain timestamp; Event; Appointment ::
+
+ #+cindex: timestamp
+ #+cindex: 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.
+
+ #+begin_example
+ ,* Meet Peter at the movies
+ <2006-11-01 Wed 19:15>
+ ,* Discussion on climate change
+ <2006-11-02 Thu 20:00-22:00>
+ #+end_example
+
+- Timestamp with repeater interval ::
+
+ #+cindex: 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:
+
+ #+begin_example
+ ,* Pick up Sam at school
+ <2007-05-16 Wed 12:30 +1w>
+ #+end_example
+
+- Diary-style expression entries ::
+
+ #+cindex: diary style timestamps
+ #+cindex: sexp timestamps
+ For more complex date specifications, Org mode supports using the
+ special expression diary entries implemented in the Emacs Calendar
+ package[fn:60]. For example, with optional time:
+
+ #+begin_example
+ ,* 22:00-23:00 The nerd meeting on every 2nd Thursday of the month
+ <%%(diary-float t 4 2)>
+ #+end_example
+
+- Time/Date range ::
+
+ #+cindex: timerange
+ #+cindex: 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:
+
+ #+begin_example
+ ,** Meeting in Amsterdam
+ <2004-08-23 Mon>--<2004-08-26 Thu>
+ #+end_example
+
+- Inactive timestamp ::
+
+ #+cindex: timestamp, inactive
+ #+cindex: 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.
+
+ #+begin_example
+ ,* Gillian comes late for the fifth time
+ [2006-11-01 Wed]
+ #+end_example
+
+** Creating Timestamps
+:PROPERTIES:
+:DESCRIPTION: Commands to insert timestamps.
+:END:
+
+For Org mode to recognize timestamps, they need to be in the specific
+format. All commands listed below produce timestamps in the correct
+format.
+
+#+attr_texinfo: :sep ,
+- {{{kbd(C-c .)}}} (~org-time-stamp~) ::
+
+ #+kindex: C-c .
+ #+findex: 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.
+
+ #+kindex: C-u C-c .
+ #+vindex: org-time-stamp-rounding-minutes
+ 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~.
+
+ #+kindex: C-u C-u C-c .
+ With two prefix arguments, insert an active timestamp with the
+ current time without prompting.
+
+- {{{kbd(C-c !)}}} (~org-time-stamp-inactive~) ::
+
+ #+kindex: C-c !
+ #+kindex: C-u C-c !
+ #+kindex: C-u C-u C-c !
+ #+findex: org-time-stamp-inactive
+ Like {{{kbd(C-c .)}}}, but insert an inactive timestamp that does
+ not cause an agenda entry.
+
+- {{{kbd(C-c C-c)}}} ::
+
+ #+kindex: C-c C-c
+ Normalize timestamp, insert or fix day name if missing or wrong.
+
+- {{{kbd(C-c <)}}} (~org-date-from-calendar~) ::
+
+ #+kindex: C-c <
+ #+findex: org-date-from-calendar
+ Insert a timestamp corresponding to point date in the calendar.
+
+- {{{kbd(C-c >)}}} (~org-goto-calendar~) ::
+
+ #+kindex: C-c >
+ #+findex: 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.
+
+- {{{kbd(C-c C-o)}}} (~org-open-at-point~) ::
+
+ #+kindex: C-c C-o
+ #+findex: org-open-at-point
+ Access the agenda for the date given by the timestamp or -range at
+ point (see [[*Weekly/daily agenda]]).
+
+- {{{kbd(S-LEFT)}}} (~org-timestamp-down-day~), {{{kbd(S-RIGHT)}}} (~org-timestamp-up-day~) ::
+
+ #+kindex: S-LEFT
+ #+kindex: S-RIGHT
+ #+findex: org-timestamp-down-day
+ #+findex: org-timestamp-up-day
+ Change date at point by one day. These key bindings conflict with
+ shift-selection and related modes (see [[*Packages that conflict with
+ Org mode]]).
+
+- {{{kbd(S-UP)}}} (~org-timestamp-up~), {{{kbd(S-DOWN)}}} (~org-timestamp-down~) ::
+
+ #+kindex: S-UP
+ #+kindex: S-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 [[*Priorities]]). The key bindings
+ also conflict with shift-selection and related modes (see [[*Packages
+ that conflict with Org mode]]).
+
+- {{{kbd(C-c C-y)}}} (~org-evaluate-time-range~) ::
+
+ #+kindex: C-c C-y
+ #+findex: org-evaluate-time-range
+ #+cindex: 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).
+
+*** The date/time prompt
+:PROPERTIES:
+:DESCRIPTION: How Org mode helps you enter dates and times.
+:END:
+#+cindex: date, reading in minibuffer
+#+cindex: time, reading in minibuffer
+
+#+vindex: org-read-date-prefer-future
+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[fn:61]. 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= | \rArr{} 2003-02-05 |
+| =2/5/3= | \rArr{} 2003-02-05 |
+| =14= | \rArr{} *2006*-*06*-14 |
+| =12= | \rArr{} *2006*-*07*-12 |
+| =2/5= | \rArr{} *2007*-02-05 |
+| =Fri= | \rArr{} nearest Friday (default date or later) |
+| =sep 15= | \rArr{} *2006*-09-15 |
+| =feb 15= | \rArr{} *2007*-02-15 |
+| =sep 12 9= | \rArr{} 2009-09-12 |
+| =12:45= | \rArr{} *2006*-*06*-*13* 12:45 |
+| =22 sept 0:34= | \rArr{} *2006*-09-22 0:34 |
+| =w4= | \rArr{} ISO week for of the current year *2006* |
+| =2012 w4 fri= | \rArr{} Friday of ISO week 4 in 2012 |
+| =2012-w04-5= | \rArr{} 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---=h=,
+=d=, =w=, =m= or =y=---to indicate a change in hours, days, weeks,
+months, or years. With =h= the date is relative to the current time,
+with the other letters and a single plus or minus, the date is
+relative to today at 00:00. 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= | \rArr{} today |
+| =.= | \rArr{} today |
+| =+2h= | \rArr{} two hours from now |
+| =+4d= | \rArr{} four days from today |
+| =+4= | \rArr{} same as +4d |
+| =+2w= | \rArr{} two weeks from today |
+| =++5= | \rArr{} five days from default date |
+| =+2tue= | \rArr{} second Tuesday from now |
+
+#+vindex: parse-time-months
+#+vindex: parse-time-weekdays
+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~.
+
+#+vindex: org-read-date-force-compatible-dates
+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= | \rArr{} 11:00-13:15 |
+| =11h-13h15= | \rArr{} same as above |
+| =11am--1:15pm= | \rArr{} same as above |
+| =11am+2:15= | \rArr{} same as above |
+
+#+cindex: calendar, for selecting date
+#+vindex: org-popup-calendar-for-date-prompt
+Parallel to the minibuffer prompt, a calendar is popped up[fn:62].
+When you exit the date prompt, either by clicking on a date in the
+calendar, or by pressing {{{kbd(RET)}}}, the date selected in the
+calendar is combined with the information entered at the prompt. You
+can control the calendar fully from the minibuffer:
+
+#+kindex: <
+#+kindex: >
+#+kindex: M-v
+#+kindex: C-v
+#+kindex: mouse-1
+#+kindex: S-RIGHT
+#+kindex: S-LEFT
+#+kindex: S-DOWN
+#+kindex: S-UP
+#+kindex: M-S-RIGHT
+#+kindex: M-S-LEFT
+#+kindex: RET
+#+kindex: .
+#+kindex: C-.
+#+attr_texinfo: :columns 0.25 0.55
+| {{{kbd(RET)}}} | Choose date at point in calendar. |
+| {{{kbd(mouse-1)}}} | Select date by clicking on it. |
+| {{{kbd(S-RIGHT)}}} | One day forward. |
+| {{{kbd(S-LEFT)}}} | One day backward. |
+| {{{kbd(S-DOWN)}}} | One week forward. |
+| {{{kbd(S-UP)}}} | One week backward. |
+| {{{kbd(M-S-RIGHT)}}} | One month forward. |
+| {{{kbd(M-S-LEFT)}}} | One month backward. |
+| {{{kbd(>)}}} | Scroll calendar forward by one month. |
+| {{{kbd(<)}}} | Scroll calendar backward by one month. |
+| {{{kbd(M-v)}}} | Scroll calendar forward by 3 months. |
+| {{{kbd(C-v)}}} | Scroll calendar backward by 3 months. |
+| {{{kbd(C-.)}}} | Select today's date[fn:63] |
+
+#+vindex: org-read-date-display-live
+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[fn:64].
+
+*** Custom time format
+:PROPERTIES:
+:DESCRIPTION: Making dates look different.
+:END:
+#+cindex: custom date/time format
+#+cindex: time format, custom
+#+cindex: date format, custom
+
+#+vindex: org-display-custom-times
+#+vindex: org-time-stamp-custom-formats
+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~.
+
+- {{{kbd(C-c C-x C-t)}}} (~org-toggle-time-stamp-overlays~) ::
+
+ #+kindex: C-c C-x C-t
+ #+findex: 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 {{{kbd(S-UP)}}} and {{{kbd(S-DOWN)}}} keys can no longer be used
+ to adjust each component of a timestamp. If point is at the
+ beginning of the stamp, {{{kbd(S-UP)}}} and {{{kbd(S-DOWN)}}} change
+ the stamp by one day, just like {{{kbd(S-LEFT)}}}
+ {{{kbd(S-RIGHT)}}}. 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.
+
+** Deadlines and Scheduling
+:PROPERTIES:
+:DESCRIPTION: Planning your work.
+:END:
+
+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= ::
+
+ #+cindex: @samp{DEADLINE} marker
+ Meaning: the task---most likely a TODO item, though not
+ necessarily---is supposed to be finished on that date.
+
+ #+vindex: org-deadline-warning-days
+ 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 as
+ done. An example:
+
+ #+begin_example
+ ,*** TODO write article about the Earth for the Guide
+ DEADLINE: <2004-02-29 Sun>
+ The editor in charge is [[bbdb:Ford Prefect]]
+ #+end_example
+
+ #+vindex: org-agenda-skip-deadline-prewarning-if-scheduled
+ 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= ::
+
+ #+cindex: @samp{SCHEDULED} marker
+ Meaning: you are planning to start working on that task on the given
+ date.
+
+ #+vindex: org-agenda-skip-scheduled-if-done
+ The headline is listed under the given date[fn:65]. In addition,
+ a reminder that the scheduled date has passed is present in the
+ compilation for /today/, until the entry is marked as done, i.e.,
+ the task is automatically forwarded until completed.
+
+ #+begin_example
+ ,*** TODO Call Trillian for a date on New Years Eve.
+ SCHEDULED: <2004-12-25 Sat>
+ #+end_example
+
+ #+vindex: org-scheduled-delay-days
+ #+vindex: org-agenda-skip-scheduled-delay-if-deadline
+ 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.
+
+ #+attr_texinfo: :tag Important
+ #+begin_quote
+ 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.
+ #+end_quote
+
+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 expression entries like
+
+: <%%(diary-float t 42)>
+
+#+texinfo: @noindent
+in scheduling and deadline timestamps is limited. Org mode does not
+know enough about the internals of each function to issue early and
+late warnings. However, it shows the item on each day where the
+expression entry matches.
+
+*** Inserting deadlines or schedules
+:PROPERTIES:
+:DESCRIPTION: Planning items.
+:ALT_TITLE: Inserting deadline/schedule
+:END:
+
+The following commands allow you to quickly insert a deadline or to
+schedule an item:[fn:66]
+
+- {{{kbd(C-c C-d)}}} (~org-deadline~) ::
+
+ #+kindex: C-c C-d
+ #+findex: org-deadline
+ #+vindex: org-log-redeadline
+ 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[fn:67].
+
+- {{{kbd(C-c C-s)}}} (~org-schedule~) ::
+
+ #+kindex: C-c C-s
+ #+findex: org-schedule
+ #+vindex: org-log-reschedule
+ 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[fn:68].
+
+- {{{kbd(C-c / d)}}} (~org-check-deadlines~) ::
+
+ #+kindex: C-c / d
+ #+findex: org-check-deadlines
+ #+cindex: sparse tree, for deadlines
+ #+vindex: org-deadline-warning-days
+ Create a sparse tree with all deadlines that are either past-due, or
+ which will become due within ~org-deadline-warning-days~. With
+ {{{kbd(C-u)}}} prefix, show all deadlines in the file. With
+ a numeric prefix, check that many days. For example, {{{kbd(C-1 C-c
+ / d)}}} shows all deadlines due tomorrow.
+
+- {{{kbd(C-c / b)}}} (~org-check-before-date~) ::
+
+ #+kindex: C-c / b
+ #+findex: org-check-before-date
+ Sparse tree for deadlines and scheduled items before a given date.
+
+- {{{kbd(C-c / a)}}} (~org-check-after-date~) ::
+
+ #+kindex: C-c / a
+ #+findex: 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.
+
+*** Repeated tasks
+:PROPERTIES:
+:DESCRIPTION: Items that show up again and again.
+:END:
+#+cindex: tasks, repeated
+#+cindex: 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[fn:69]. In the following example:
+
+#+begin_example
+,** TODO Pay the rent
+ DEADLINE: <2005-10-01 Sat +1m>
+#+end_example
+
+#+texinfo: @noindent
+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=, =m=, =w=, =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>
+
+#+vindex: org-todo-repeat-to-state
+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 as done, using {{{kbd(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[fn:70]. In the example
+above, setting the state to =DONE= would actually switch the date like
+this:
+
+#+begin_example
+,** TODO Pay the rent
+ DEADLINE: <2005-11-01 Tue +1m>
+#+end_example
+
+To mark a task with a repeater as DONE, use {{{kbd(C-- 1 C-c C-t)}}},
+i.e., ~org-todo~ with a numeric prefix argument of =-1=.
+
+#+vindex: org-log-repeat
+A timestamp[fn:71] 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:
+
+#+begin_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 shifts the date to one month after today.
+
+,** TODO Wash my hands
+ DEADLINE: <2019-04-05 08:00 Sun .+1h>
+ Marking this DONE shifts the date to exactly one hour from now.
+#+end_example
+
+#+vindex: org-agenda-skip-scheduled-if-deadline-is-shown
+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
+{{{kbd(C-c C-x c)}}} was created for this purpose; it is described in
+[[*Structure Editing]].
+
+** Clocking Work Time
+:PROPERTIES:
+:DESCRIPTION: Tracking how long you spend on a task.
+:END:
+#+cindex: clocking time
+#+cindex: time clocking
+
+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[fn:72] 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:
+
+#+begin_src emacs-lisp
+(setq org-clock-persist 'history)
+(org-clock-persistence-insinuate)
+#+end_src
+
+#+vindex: org-clock-persist
+When you clock into a new task after resuming Emacs, the incomplete
+clock[fn:73] is retrieved (see [[*Resolving idle time]]) and you are
+prompted about what to do with it.
+
+*** Clocking commands
+:PROPERTIES:
+:DESCRIPTION: Starting and stopping a clock.
+:END:
+
+#+attr_texinfo: :sep ,
+- {{{kbd(C-c C-x C-i)}}} (~org-clock-in~) ::
+
+ #+kindex: C-c C-x C-i
+ #+findex: org-clock-in
+ #+vindex: org-clock-into-drawer
+ #+vindex: org-clock-continuously
+ #+cindex: @samp{LOG_INTO_DRAWER}, property
+ 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 {{{kbd(C-u)}}} prefix argument, select the task from
+ a list of recently clocked tasks. With two {{{kbd(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
+ {{{kbd(d)}}} when selecting a clocking task. With three {{{kbd(C-u
+ C-u C-u)}}} prefixes, force continuous clocking by starting the
+ clock when the last clock stopped.
+
+ #+cindex: @samp{CLOCK_MODELINE_TOTAL}, property
+ #+cindex: @samp{LAST_REPEAT}, property
+ #+vindex: org-clock-mode-line-total
+ #+vindex: org-clock-in-prepare-hook
+ 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 [[*Effort Estimates]]), the mode
+ line displays the current clocking time against it[fn:74]. If the
+ task is a repeating one (see [[*Repeated tasks]]), show only the time
+ since the last reset of the task[fn:75]. 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[fn:76]. Clicking with
+ {{{kbd(mouse-1)}}} onto the mode line entry pops up a menu with
+ clocking options.
+
+- {{{kbd(C-c C-x C-o)}}} (~org-clock-out~) ::
+
+ #+kindex: C-c C-x C-o
+ #+findex: org-clock-out
+ #+vindex: org-log-note-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[fn:77].
+
+- {{{kbd(C-c C-x C-x)}}} (~org-clock-in-last~) ::
+
+ #+kindex: C-c C-x C-x
+ #+findex: org-clock-in-last
+ #+vindex: org-clock-continuously
+ Re-clock the last clocked task. With one {{{kbd(C-u)}}} prefix
+ argument, select the task from the clock history. With two
+ {{{kbd(C-u)}}} prefixes, force continuous clocking by starting the
+ clock when the last clock stopped.
+
+- {{{kbd(C-c C-x C-e)}}} (~org-clock-modify-effort-estimate~) ::
+
+ #+kindex: C-c C-x C-e
+ #+findex: org-clock-modify-effort-estimate
+ Update the effort estimate for the current clock task.
+
+- {{{kbd(C-c C-c)}}} or {{{kbd(C-c C-y)}}} (~org-evaluate-time-range~) ::
+
+ #+kindex: C-c C-c
+ #+kindex: C-c C-y
+ #+findex: 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 {{{kbd(S-<cursor>)}}} keys, the update is
+ automatic.
+
+- {{{kbd(C-S-UP)}}} (~org-clock-timestamps-up~), {{{kbd(C-S-DOWN)}}} (~org-clock-timestamps-down~) ::
+
+ #+kindex: C-S-UP
+ #+findex: org-clock-timestamps-up
+ #+kindex: C-S-DOWN
+ #+findex: org-clock-timestamps-down
+ On CLOCK log lines, increase/decrease both timestamps so that the
+ clock duration keeps the same value.
+
+- {{{kbd(S-M-UP)}}} (~org-timestamp-up~), {{{kbd(S-M-DOWN)}}} (~org-timestamp-down~) ::
+
+ #+kindex: S-M-UP
+ #+findex: org-clock-timestamp-up
+ #+kindex: S-M-DOWN
+ #+findex: org-clock-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 {{{kbd(S-M-UP)}}} to increase
+ a clocked-out timestamp by five minutes, then the clocked-in
+ timestamp of the next clock is increased by five minutes.
+
+- {{{kbd(C-c C-t)}}} (~org-todo~) ::
+
+ #+kindex: C-c C-t
+ #+findex: org-todo
+ Changing the TODO state of an item to DONE automatically stops the
+ clock if it is running in this same item.
+
+- {{{kbd(C-c C-x C-q)}}} (~org-clock-cancel~) ::
+
+ #+kindex: C-c C-x C-q
+ #+findex: 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.
+
+- {{{kbd(C-c C-x C-j)}}} (~org-clock-goto~) ::
+
+ #+kindex: C-c C-x C-j
+ #+findex: or-clock-goto
+ Jump to the headline of the currently clocked in task. With
+ a {{{kbd(C-u)}}} prefix argument, select the target task from a list
+ of recently clocked tasks.
+
+- {{{kbd(C-c C-x C-d)}}} (~org-clock-display~) ::
+
+ #+kindex: C-c C-x C-d
+ #+findex: org-clock-display
+ #+vindex: org-remove-highlights-with-change
+ 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 {{{kbd(C-c C-c)}}}.
+
+The {{{kbd(l)}}} key may be used in the agenda (see [[*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.
+
+*** The clock table
+:PROPERTIES:
+:DESCRIPTION: Detailed reports.
+:END:
+#+cindex: clocktable, dynamic block
+#+cindex: report, of clocked time
+
+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.
+
+#+attr_texinfo: :sep ,
+- ~org-clock-report~ ::
+
+ #+kindex: C-c C-x x
+ #+findex: org-clock-report
+ Insert or update a clock table. When called with a prefix argument,
+ jump to the first clock table in the current document and update it.
+ The clock table includes archived trees.
+
+ This command can be invoked by calling
+ ~org-dynamic-block-insert-dblock~ ({{{kbd(C-c C-x x)}}}) and
+ selecting "clocktable" (see [[*Dynamic Blocks]]).
+
+- {{{kbd(C-c C-c)}}} or {{{kbd(C-c C-x C-u)}}} (~org-dblock-update~) ::
+
+ #+kindex: C-c C-c
+ #+kindex: C-c C-x C-u
+ #+findex: org-dblock-update
+ Update dynamic block at point. Point needs to be in the =BEGIN=
+ line of the dynamic block.
+
+- {{{kbd(C-u C-c C-x C-u)}}} ::
+
+ #+kindex: C-u C-c C-x C-u
+ Update all dynamic blocks (see [[*Dynamic Blocks]]). This is useful if
+ you have several clock table blocks in a buffer.
+
+- {{{kbd(S-LEFT)}}}, {{{kbd(S-RIGHT)}}} (~org-clocktable-try-shift~) ::
+
+ #+kindex: S-LEFT
+ #+kindex: S-RIGHT
+ #+findex: 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 by ~org-clock-report~:
+
+#+cindex: @samp{BEGIN clocktable}
+#+begin_example
+,#+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
+,#+END: clocktable
+#+end_example
+
+#+vindex: org-clocktable-defaults
+The =#+BEGIN= line contains 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 {{{var(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=[fn:78] | all clocked time ever |
+
+ #+vindex: org-clock-display-default-range
+ 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 {{{kbd(S-LEFT)}}} or {{{kbd(S-RIGHT)}}} to shift the time
+ interval.
+
+- =:tstart= ::
+
+ A time string specifying when to start considering times. Relative
+ times like ="<-2w>"= can also be used. See [[*Matching tags and
+ properties]] for relative time syntax.
+
+- =:tend= ::
+
+ A time string specifying when to stop considering times. Relative
+ times like ="<now>"= can also be used. See [[*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 =day=, =week=, =semimonth=, =month=, or =year= to split the
+ table into chunks. To use this, either =:block=, or =:tstart= and
+ =:tend= are required.
+
+- =: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
+ [[*Matching tags and properties]] for the match syntax.
+
+#+findex: org-clocktable-write-default
+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[fn:79] 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.
+
+- =:hidefiles= ::
+
+ Hide the file column when multiple files are used to produce the
+ table.
+
+- =: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
+ [[*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_example
+,#+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
+,#+END: clocktable
+#+end_example
+
+#+texinfo: @noindent
+To use a specific time range you could write[fn:80]
+
+#+begin_example
+,#+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
+ :tend "<2006-08-10 Thu 12:00>"
+,#+END: clocktable
+#+end_example
+
+#+texinfo: @noindent
+A range starting a week ago and ending right now could be written as
+
+#+begin_example
+,#+BEGIN: clocktable :tstart "<-1w>" :tend "<now>"
+,#+END: clocktable
+#+end_example
+
+#+texinfo: @noindent
+A summary of the current subtree with % times would be
+
+#+begin_example
+,#+BEGIN: clocktable :scope subtree :link t :formula %
+,#+END: clocktable
+#+end_example
+
+#+texinfo: @noindent
+A horizontally compact representation of everything clocked during
+last week would be
+
+#+begin_example
+,#+BEGIN: clocktable :scope agenda :block lastweek :compact t
+,#+END: clocktable
+#+end_example
+
+*** Resolving idle time and continuous clocking
+:PROPERTIES:
+:DESCRIPTION: Resolving time when you've been idle.
+:ALT_TITLE: Resolving idle time
+:END:
+
+**** Resolving idle time
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: resolve idle time
+#+cindex: idle, resolve, dangling
+
+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.
+
+#+vindex: org-clock-idle-time
+#+vindex: org-clock-x11idle-program-name
+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[fn:81], 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:
+
+- {{{kbd(k)}}} ::
+
+ #+kindex: k
+ To keep some or all of the minutes and stay clocked in, press
+ {{{kbd(k)}}}. Org asks how many of the minutes to keep. Press
+ {{{kbd(RET)}}} to keep them all, effectively changing nothing, or
+ enter a number to keep that many minutes.
+
+- {{{kbd(K)}}} ::
+
+ #+kindex: K
+ If you use the shift key and press {{{kbd(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.
+
+- {{{kbd(s)}}} ::
+
+ #+kindex: s
+ To keep none of the minutes, use {{{kbd(s)}}} to subtract all the
+ away time from the clock, and then check back in from the moment you
+ returned.
+
+- {{{kbd(S)}}} ::
+
+ #+kindex: S
+ To keep none of the minutes and just clock out at the start of the
+ away time, use the shift key and press {{{kbd(S)}}}. Remember that
+ using shift always leave you clocked out, no matter which option you
+ choose.
+
+- {{{kbd(C)}}} ::
+
+ #+kindex: C
+ To cancel the clock altogether, use {{{kbd(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 {{{kbd(M-x org-resolve-clocks
+RET)}}} (or {{{kbd(C-c C-x C-z)}}}).
+
+**** Continuous clocking
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: continuous clocking
+
+#+vindex: org-clock-continuously
+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 {{{kbd(C-u C-u)}}} with
+~org-clock-in-last~.
+
+**** Clocking out automatically after some idle time
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: auto clocking out after idle time
+
+#+vindex: org-clock-auto-clockout-timer
+When you often forget to clock out before being idle and you don't
+want to manually set the clocking time to take into account, you can
+set ~org-clock-auto-clockout-timer~ to a number of seconds and add
+=(org-clock-auto-clockout-insinuate)= to your =.emacs= file.
+
+When the clock is running and Emacs is idle for more than this number
+of seconds, the clock will be clocked out automatically.
+
+Use =M-x org-clock-toggle-auto-clockout RET= to temporarily turn this
+on or off.
+
+** Effort Estimates
+:PROPERTIES:
+:DESCRIPTION: Planning work effort in advance.
+:END:
+#+cindex: effort estimates
+#+cindex: @samp{EFFORT}, property
+#+vindex: org-effort-property
+
+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=. Multiple
+formats are supported, such as =3:12=, =1:23:45=, or =1d3h5min=; see
+the file =org-duration.el= for more detailed information about the
+format.
+
+You can set the effort for an entry with the following commands:
+
+- {{{kbd(C-c C-x e)}}} (~org-set-effort~) ::
+
+ #+kindex: C-c C-x e
+ #+findex: 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 {{{kbd(e)}}}
+ key.
+
+- {{{kbd(C-c C-x C-e)}}} (~org-clock-modify-effort-estimate~) ::
+
+ #+kindex: C-c C-x C-e
+ #+findex: 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 [[*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:
+
+#+begin_example
+,#+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
+#+end_example
+
+#+texinfo: @noindent
+#+vindex: org-global-properties
+#+vindex: org-columns-default-format
+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 {{{kbd(S-RIGHT)}}} and {{{kbd(S-LEFT)}}} 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.
+
+#+vindex: org-agenda-columns-add-appointments-to-effort-sum
+If you switch to column view in the daily/weekly agenda, the effort
+column summarizes the estimated work effort for each day[fn:82], 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 {{{kbd(/)}}} key in the agenda (see [[*Commands in
+the Agenda Buffer]]). 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.
+
+** Taking Notes with a Relative Timer
+:PROPERTIES:
+:DESCRIPTION: Notes with a running timer.
+:ALT_TITLE: Timers
+:END:
+#+cindex: relative timer
+#+cindex: countdown 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.
+
+- {{{kbd(C-c C-x 0)}}} (~org-timer-start~) ::
+
+ #+kindex: C-c C-x 0
+ #+findex: org-timer-start
+ Start or reset the relative timer. By default, the timer is set
+ to 0. When called with a {{{kbd(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 {{{kbd(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.
+
+- {{{kbd(C-c C-x ;)}}} (~org-timer-set-timer~) ::
+
+ #+kindex: C-c C-x ;
+ #+findex: org-timer-set-timer
+ #+vindex: org-timer-default-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 {{{kbd(;)}}} in agenda buffers.
+
+Once started, relative and countdown timers are controlled with the
+same commands.
+
+- {{{kbd(C-c C-x .)}}} (~org-timer~) ::
+
+ #+kindex: C-c C-x .
+ #+findex: org-timer
+ Insert a relative time into the buffer. The first time you use
+ this, the timer starts. Using a prefix argument restarts it.
+
+- {{{kbd(C-c C-x -)}}} (~org-timer-item~) ::
+
+ #+kindex: C-c C-x -
+ #+findex: org-timer-item
+ Insert a description list item with the current relative time. With
+ a prefix argument, first reset the timer to 0.
+
+- {{{kbd(M-RET)}}} (~org-insert-heading~) ::
+
+ #+kindex: M-RET
+ #+findex: org-insert-heading
+ Once the timer list is started, you can also use {{{kbd(M-RET)}}} to
+ insert new timer items.
+
+- {{{kbd(C-c C-x \,)}}} (~org-timer-pause-or-continue~) ::
+
+ #+kindex: C-c C-x ,
+ #+findex: org-timer-pause-or-continue
+ Pause the timer, or continue it if it is already paused.
+
+- {{{kbd(C-c C-x _)}}} (~org-timer-stop~) ::
+
+ #+kindex: C-c C-x _
+ #+findex: 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.
+
+* Refiling and Archiving
+:PROPERTIES:
+:DESCRIPTION: Moving and copying information with ease.
+:END:
+#+cindex: refiling notes
+#+cindex: copying notes
+#+cindex: archiving
+
+Once information is in the system, it may need to be moved around.
+Org provides Refile, Copy and Archive commands for this. Refile and
+Copy helps with moving and copying outlines. Archiving helps to keep
+the system compact and fast.
+
+** Refile and Copy
+:PROPERTIES:
+:DESCRIPTION: Moving/copying a tree from one place to another.
+:END:
+#+cindex: refiling notes
+#+cindex: copying notes
+
+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:
+
+- {{{kbd(C-c C-w)}}} (~org-refile~) ::
+
+ #+kindex: C-c C-w
+ #+findex: org-refile
+ #+vindex: org-reverse-note-order
+ #+vindex: org-refile-targets
+ #+vindex: org-refile-use-outline-path
+ #+vindex: org-outline-path-complete-in-steps
+ #+vindex: org-refile-allow-creating-parent-nodes
+ #+vindex: org-log-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~[fn:83] is set, a timestamp or a note is
+ recorded whenever an entry is refiled.
+
+- {{{kbd(C-u C-c C-w)}}} ::
+
+ #+kindex: C-u C-c C-w
+ Use the refile interface to jump to a heading.
+
+- {{{kbd(C-u C-u C-c C-w)}}} (~org-refile-goto-last-stored~) ::
+
+ #+kindex: C-u C-u C-c C-w
+ #+findex: org-refile-goto-last-stored
+ Jump to the location where ~org-refile~ last moved a tree to.
+
+- {{{kbd(C-2 C-c C-w)}}} ::
+
+ #+kindex: C-2 C-c C-w
+ Refile as the child of the item currently being clocked.
+
+- {{{kbd(C-3 C-c C-w)}}} ::
+
+ #+kindex: C-3 C-c C-w
+ #+vindex: org-refile-keep
+ 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.
+
+- {{{kbd(C-0 C-c C-w)}}} or {{{kbd(C-u C-u C-u C-c C-w)}}} (~org-refile-cache-clear~) ::
+
+ #+kindex: C-u C-u C-u C-c C-w
+ #+kindex: C-0 C-c C-w
+ #+findex: org-refile-cache-clear
+ #+vindex: org-refile-use-cache
+ 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.
+
+- {{{kbd(C-c M-w)}}} (~org-refile-copy~) ::
+
+ #+kindex: C-c M-w
+ #+findex: org-refile-copy
+ Copying works like refiling, except that the original note is not
+ deleted.
+
+- {{{kbd(C-c C-M-w)}}} (~org-refile-reverse~) ::
+
+ #+kindex: C-c C-M-w
+ #+findex: org-refile-reverse
+ Works like refiling, except that it temporarily toggles how the
+ value of ~org-reverse-note-order~ applies to the current buffer. So
+ if ~org-refile~ would append the entry as the last entry under the
+ target header, ~org-refile-reverse~ will prepend it as the first
+ entry, and vice-versa.
+
+** Archiving
+:PROPERTIES:
+:DESCRIPTION: What to do with finished products.
+:END:
+#+cindex: 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.
+
+- {{{kbd(C-c C-x C-a)}}} (~org-archive-subtree-default~) ::
+
+ #+kindex: C-c C-x C-a
+ #+findex: org-archive-subtree-default
+ #+vindex: org-archive-default-command
+ Archive the current entry using the command specified in the
+ variable ~org-archive-default-command~.
+
+*** Moving a tree to an archive file
+:PROPERTIES:
+:DESCRIPTION: Moving a tree to an archive file.
+:ALT_TITLE: Moving subtrees
+:END:
+#+cindex: external archiving
+
+The most common archiving action is to move a project tree to another
+file, the archive file.
+
+- {{{kbd(C-c C-x C-s)}}} or short {{{kbd(C-c $)}}} (~org-archive-subtree~) ::
+
+ #+kindex: C-c C-x C-s
+ #+kindex: C-c $
+ #+findex: org-archive-subtree
+ #+vindex: org-archive-location
+ Archive the subtree starting at point position to the location given
+ by ~org-archive-location~.
+
+- {{{kbd(C-u C-c C-x C-s)}}} ::
+
+ #+kindex: 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.
+
+- {{{kbd(C-u C-u C-c C-x C-s)}}} ::
+
+ #+kindex: 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.
+
+#+cindex: archive locations
+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:
+
+#+cindex: @samp{ARCHIVE}, keyword
+: #+ARCHIVE: %s_done::
+
+#+cindex: ARCHIVE, property
+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 [[*Properties and Columns]]).
+
+#+vindex: org-archive-save-context-info
+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.
+
+#+vindex: org-archive-subtree-save-file-p
+When ~org-archive-subtree-save-file-p~ is non-~nil~, save the target
+archive buffer.
+
+*** Internal archiving
+:PROPERTIES:
+:DESCRIPTION: Switch off a tree but keep it in the file.
+:END:
+
+#+cindex: @samp{ARCHIVE}, tag
+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 [[*Tags]]) stays at
+its location in the outline tree, but behaves in the following way:
+
+-
+ #+vindex: org-cycle-open-archived-trees
+ It does not open when you attempt to do so with a visibility cycling
+ command (see [[*Visibility Cycling]]). You can force cycling archived
+ subtrees with {{{kbd(C-TAB)}}}, or by setting the option
+ ~org-cycle-open-archived-trees~. Also normal outline commands, like
+ ~outline-show-all~, open archived subtrees.
+
+-
+ #+vindex: org-sparse-tree-open-archived-trees
+ During sparse tree construction (see [[*Sparse Trees]]), matches in
+ archived subtrees are not exposed, unless you configure the option
+ ~org-sparse-tree-open-archived-trees~.
+
+-
+ #+vindex: org-agenda-skip-archived-trees
+ During agenda view construction (see [[*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 {{{kbd(v a)}}} to get
+ archives temporarily included.
+
+-
+ #+vindex: org-export-with-archived-trees
+ Archived trees are not exported (see [[*Exporting]]), only the headline
+ is. Configure the details using the variable
+ ~org-export-with-archived-trees~.
+
+-
+ #+vindex: org-columns-skip-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:
+
+- {{{kbd(C-c C-x a)}}} (~org-toggle-archive-tag~) ::
+
+ #+kindex: C-c C-x a
+ #+findex: 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.
+
+- {{{kbd(C-u C-c C-x a)}}} ::
+
+ #+kindex: 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.
+
+- {{{kbd(C-c C-TAB)}}} (~org-force-cycle-archived~) ::
+
+ #+kindex: C-TAB
+ Cycle a tree even if it is tagged with =ARCHIVE=.
+
+- {{{kbd(C-c C-x A)}}} (~org-archive-to-archive-sibling~) ::
+
+ #+kindex: C-c C-x A
+ #+findex: 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.
+
+* Capture and Attachments
+:PROPERTIES:
+:DESCRIPTION: Dealing with external data.
+:END:
+#+cindex: capture
+#+cindex: attachments
+#+cindex: RSS feeds
+#+cindex: Atom feeds
+#+cindex: protocols, for external access
+
+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.
+Finally, it can parse RSS feeds for information. To learn how to let
+external programs (for example a web browser) trigger Org to capture
+material, see [[*Protocols for External Access]].
+
+** Capture
+:PROPERTIES:
+:DESCRIPTION: Capturing new stuff.
+:END:
+#+cindex: 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.
+
+*** Setting up capture
+:PROPERTIES:
+:DESCRIPTION: Where notes will be stored.
+:END:
+
+The following customization sets a default target file for notes.
+
+#+vindex: org-default-notes-file
+#+begin_src emacs-lisp
+(setq org-default-notes-file (concat org-directory "/notes.org"))
+#+end_src
+
+You may also define a global key for capturing new material (see
+[[*Activation]]).
+
+*** Using capture
+:PROPERTIES:
+:DESCRIPTION: Commands to invoke and terminate capture.
+:END:
+
+- {{{kbd(M-x org-capture)}}} (~org-capture~) ::
+
+ #+findex: org-capture
+ #+cindex: date tree
+ Display the capture templates menu. If you have templates defined
+ (see [[*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.
+
+- {{{kbd(C-c C-c)}}} (~org-capture-finalize~) ::
+
+ #+kindex: C-c C-c @r{(Capture buffer)}
+ #+findex: org-capture-finalize
+ Once you have finished entering information into the capture buffer,
+ {{{kbd(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.
+
+- {{{kbd(C-c C-w)}}} (~org-capture-refile~) ::
+
+ #+kindex: C-c C-w @r{(Capture buffer)}
+ #+findex: org-capture-refile
+ Finalize the capture process by refiling the note to a different
+ place (see [[*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.
+
+- {{{kbd(C-c C-k)}}} (~org-capture-kill~) ::
+
+ #+kindex: C-c C-k @r{(Capture buffer)}
+ #+findex: org-capture-kill
+ Abort the capture process and return to the previous state.
+
+#+kindex: k c @r{(Agenda)}
+You can also call ~org-capture~ in a special way from the agenda,
+using the {{{kbd(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:
+
+- {{{kbd(C-u M-x org-capture)}}} ::
+
+ Visit the target location of a capture template. You get to select
+ the template in the usual way.
+
+- {{{kbd(C-u C-u M-x org-capture)}}} ::
+
+ Visit the last stored capture item in its buffer.
+
+#+vindex: org-capture-bookmark
+#+vindex: org-capture-last-stored
+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 {{{kbd(C-0)}}} prefix argument.
+
+*** Capture templates
+:PROPERTIES:
+:DESCRIPTION: Define the outline of different note types.
+:END:
+#+cindex: templates, for Capture
+
+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.
+
+- {{{kbd(C)}}} ::
+
+ #+kindex: C @r{(Capture menu}
+ #+vindex: org-capture-templates
+ 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:
+
+#+begin_src emacs-lisp
+(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")))
+#+end_src
+
+If you then press {{{kbd(t)}}} from the capture menu, Org will prepare
+the template for you like this:
+
+#+begin_example
+,* TODO
+ [[file:LINK TO WHERE YOU INITIATED CAPTURE]]
+#+end_example
+
+#+texinfo: @noindent
+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 {{{kbd(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:
+
+#+begin_src emacs-lisp
+(define-key global-map (kbd "C-c x")
+ (lambda () (interactive) (org-capture nil "x")))
+#+end_src
+
+**** Template elements
+:PROPERTIES:
+:DESCRIPTION: What is needed for a complete template entry.
+:END:
+
+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:
+
+ #+begin_src emacs-lisp
+ ("b" "Templates for marking stuff to buy")
+ #+end_src
+
+ If you do not define a template for the {{{kbd(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 ::
+
+ #+vindex: org-default-notes-file
+ #+vindex: org-directory
+ 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[fn:84] creates a heading in a date tree[fn:85] 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. You may also get this
+ template string from a file[fn:86], or dynamically, from a function
+ using either syntax:
+
+ : (file "/path/to/template-file")
+ : (function FUNCTION-RETURNING-THE-TEMPLATE)
+
+- 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.
+
+ - ~:jump-to-captured~ ::
+
+ When set, jump to the captured entry when finished.
+
+ - ~: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.
+
+ - ~:empty-lines-after~ ::
+
+ Set this to the number of lines that should be inserted after the
+ new item. Overrides ~:empty-lines~ for the number of lines
+ inserted after.
+
+ - ~:empty-lines-before~ ::
+
+ Set this to the number of lines that should be inserted before the
+ new item. Overrides ~:empty-lines~ for the number lines inserted
+ before.
+
+ - ~: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 {{{kbd(C-1)}}} prefix argument.
+
+ - ~:tree-type~ ::
+
+ Use ~week~ to make a week tree instead of the month-day tree,
+ i.e., place the headings for each day under a heading with the
+ current ISO week. Use ~month~ to group entries by month
+ only. Default is to group entries by day.
+
+ - ~: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.
+
+ - ~:refile-targets :: Temporarily set ~org-refile-targets~ to the
+ value of this property.
+
+**** Template expansion
+:PROPERTIES:
+:DESCRIPTION: Filling in information about time and context.
+:END:
+
+In the template itself, special "%-escapes"[fn:87] allow dynamic
+insertion of content. The templates are expanded in the order given
+here:
+
+- =%[FILE]= ::
+
+ Insert the contents of the file given by {{{var(FILE)}}}.
+
+- =%(EXP)= ::
+
+ Evaluate Elisp expression {{{var(EXP)}}} and replace it with the
+ result. The {{{var(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.
+
+- =%<FORMAT>= ::
+
+ The result of format-time-string on the {{{var(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.
+
+- =%L= ::
+
+ Like =%l=, but without brackets (the link content itself).
+
+- =%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 {{{var(PROP)}}}. You may
+ specify a default value with =%^{PROP|default}=.
+
+- =%^{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 {{{var(N)}}}th =%^{PROMPT}=, where
+ {{{var(N)}}} is a number, starting from 1.
+
+- =%?= ::
+
+ After completing the template, position point here.
+
+#+vindex: org-store-link-props
+For specific link types, the following keywords are defined[fn:88]:
+
+#+vindex: org-link-from-user-regexp
+| 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")[fn:89] |
+| gnus | =%:group=, for messages also all email fields |
+| w3, w3m | =%:url= |
+| info | =%:file=, =%:node= |
+| calendar | =%:date= |
+| org-protocol | =%:link=, =%:description=, =%:annotation= |
+
+**** Templates in contexts
+:PROPERTIES:
+:DESCRIPTION: Only show a template in a specific context.
+:END:
+
+#+vindex: org-capture-templates-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:
+
+#+begin_src emacs-lisp
+(setq org-capture-templates-contexts
+ '(("p" ((in-mode . "message-mode")))))
+#+end_src
+
+You can also tell that the command key {{{kbd(p)}}} should refer to
+another template. In that case, add this command key like this:
+
+#+begin_src emacs-lisp
+(setq org-capture-templates-contexts
+ '(("p" "q" ((in-mode . "message-mode")))))
+#+end_src
+
+See the docstring of the variable for more information.
+
+** Attachments
+:PROPERTIES:
+:DESCRIPTION: Attach files to outlines.
+:END:
+#+cindex: attachments
+
+It is often useful to associate reference material with an outline
+node. Small chunks of plain text can simply be stored in the subtree
+of a project. Hyperlinks (see [[*Hyperlinks]]) can establish associations
+with files that live elsewhere on a local, or even remote, computer,
+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 either
+named by a unique ID of each entry, or by a =DIR= property.
+
+*** Attachment defaults and dispatcher
+:PROPERTIES:
+:DESCRIPTION: How to access attachment commands
+:END:
+
+By default, Org attach uses ID properties when adding attachments to
+outline nodes. This makes working with attachments fully automated.
+There is no decision needed for folder-name or location. ID-based
+directories are by default located in the =data/= directory, which
+lives in the same directory where your Org file lives[fn:90].
+
+When attachments are made using ~org-attach~ a default tag =ATTACH= is
+added to the node that gets the attachments.
+
+For more control over the setup, see [[*Attachment options]].
+
+The following commands deal with attachments:
+
+- {{{kbd(C-c C-a)}}} (~org-attach~) ::
+
+ #+kindex: C-c C-a
+ #+findex: 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:
+
+ - {{{kbd(a)}}} (~org-attach-attach~) ::
+
+ #+kindex: C-c C-a a
+ #+findex: org-attach-attach
+ #+vindex: org-attach-method
+ 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.
+
+ - {{{kbd(c)}}}/{{{kbd(m)}}}/{{{kbd(l)}}} ::
+
+ #+kindex: C-c C-a c
+ #+kindex: C-c C-a m
+ #+kindex: C-c C-a l
+ Attach a file using the copy/move/link method. Note that hard
+ links are not supported on all systems.
+
+ - {{{kbd(b)}}} (~org-attach-buffer~) ::
+
+ #+kindex: C-c C-a b
+ #+findex: org-attach-buffer
+ Select a buffer and save it as a file in the task's attachment
+ directory.
+
+ - {{{kbd(n)}}} (~org-attach-new~) ::
+
+ #+kindex: C-c C-a n
+ #+findex: org-attach-new
+ Create a new attachment as an Emacs buffer.
+
+ - {{{kbd(z)}}} (~org-attach-sync~) ::
+
+ #+kindex: C-c C-a z
+ #+findex: org-attach-sync
+ Synchronize the current task with its attachment directory, in
+ case you added attachments yourself.
+
+ - {{{kbd(o)}}} (~org-attach-open~) ::
+
+ #+kindex: C-c C-a o
+ #+findex: org-attach-open
+ #+vindex: org-file-apps
+ 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 [[*Handling Links]]).
+
+ - {{{kbd(O)}}} (~org-attach-open-in-emacs~) ::
+
+ #+kindex: C-c C-a O
+ #+findex: org-attach-open-in-emacs
+ Also open the attachment, but force opening the file in Emacs.
+
+ - {{{kbd(f)}}} (~org-attach-reveal~) ::
+
+ #+kindex: C-c C-a f
+ #+findex: org-attach-reveal
+ Open the current task's attachment directory.
+
+ - {{{kbd(F)}}} (~org-attach-reveal-in-emacs~) ::
+
+ #+kindex: C-c C-a F
+ #+findex: org-attach-reveal-in-emacs
+ Also open the directory, but force using Dired in Emacs.
+
+ - {{{kbd(d)}}} (~org-attach-delete-one~) ::
+
+ #+kindex: C-c C-a d
+ Select and delete a single attachment.
+
+ - {{{kbd(D)}}} (~org-attach-delete-all~) ::
+
+ #+kindex: C-c C-a D
+ Delete all of a task's attachments. A safer way is to open the
+ directory in Dired and delete from there.
+
+ - {{{kbd(s)}}} (~org-attach-set-directory~) ::
+
+ #+kindex: C-c C-a s
+ #+cindex: @samp{DIR}, property
+ Set a specific directory as the entry's attachment directory.
+ This works by putting the directory path into the =DIR=
+ property.
+
+ - {{{kbd(S)}}} (~org-attach-unset-directory~) ::
+
+ #+kindex: C-c C-a S
+ #+cindex: @samp{DIR}, property
+ Remove the attachment directory. This command removes the =DIR=
+ property and asks the user to either move content inside that
+ folder, if an =ID= property is set, delete the content, or to
+ leave the attachment directory as is but no longer attached to the
+ outline node.
+
+*** Attachment options
+:PROPERTIES:
+:DESCRIPTION: Configuring the attachment system
+:END:
+
+There are a couple of options for attachments that are worth
+mentioning.
+
+- ~org-attach-id-dir~ ::
+ #+vindex: org-attach-id-dir
+ The directory where attachments are stored when =ID= is used as
+ method.
+
+- ~org-attach-dir-relative~ ::
+ #+vindex: org-attach-dir-relative
+ When setting the =DIR= property on a node using {{{kbd(C-c C-a s)}}}
+ (~org-attach-set-directory~), absolute links are entered by default.
+ This option changes that to relative links.
+
+- ~org-attach-use-inheritance~ ::
+ #+vindex: org-attach-use-inheritance
+ By default folders attached to an outline node are inherited from
+ parents according to ~org-use-property-inheritance~. If one instead
+ want to set inheritance specifically for Org attach that can be done
+ using ~org-attach-use-inheritance~. Inheriting documents through
+ the node hierarchy makes a lot of sense in most cases. Especially
+ when using attachment links (see [[*Attachment links]]). The following
+ example shows one use case for attachment inheritance:
+
+ #+begin_example
+ ,* Chapter A ...
+ :PROPERTIES:
+ :DIR: Chapter A/
+ :END:
+ ,** Introduction
+ Some text
+
+ #+NAME: Image 1
+ [[attachment:image 1.jpg]]
+ #+end_example
+
+ Without inheritance one would not be able to resolve the link to
+ =image 1.jpg=, since the link is inside a sub-heading to =Chapter
+ A=.
+
+ Inheritance works the same way for both =ID= and =DIR= property. If
+ both properties are defined on the same headline then =DIR= takes
+ precedence. This is also true if inheritance is enabled. If =DIR=
+ is inherited from a parent node in the outline, that property still
+ takes precedence over an =ID= property defined on the node itself.
+
+- ~org-attach-method~ ::
+ #+vindex: org-attach-method
+ When attaching files using the dispatcher {{{kbd(C-c C-a)}}} it
+ defaults to copying files. The behavior can be changed by
+ customizing ~org-attach-method~. Options are Copy, Move/Rename,
+ Hard link or Symbolic link.
+
+- ~org-attach-preferred-new-method~ ::
+ #+vindex: org-attach-preferred-new-method
+ This customization lets you choose the default way to attach to
+ nodes without existing =ID= and =DIR= property. It defaults to ~id~
+ but can also be set to ~dir~, ~ask~ or ~nil~.
+
+- ~org-attach-archive-delete~ ::
+ #+vindex: org-attach-archive-delete
+ Configure this to determine if attachments should be deleted or not
+ when a subtree that has attachments is archived.
+
+- ~org-attach-auto-tag~ ::
+ #+vindex: org-attach-auto-tag
+ When attaching files to a heading it will be assigned a tag
+ according to what is set here.
+
+- ~org-attach-id-to-path-function-list~ ::
+ #+vindex: org-attach-id-to-path-function-list
+ When =ID= is used for attachments, the ID is parsed into a part of a
+ directory-path. See ~org-attach-id-uuid-folder-format~ for the
+ default function. Define a new one and add it as first element in
+ ~org-attach-id-to-path-function-list~ if you want the folder
+ structure in any other way. All functions in this list will be
+ tried when resolving existing ID's into paths, to maintain backward
+ compatibility with existing folders in your system.
+
+- ~org-attach-store-link-p~ ::
+ #+vindex: org-attach-store-link-p
+ Stores a link to the file that is being attached. The link is
+ stored in ~org-stored-links~ for later insertion with {{{kbd(C-c
+ C-l)}}} (see [[*Handling Links]]). Depending on what option is set in
+ ~org-attach-store-link-p~, the link is stored to either the original
+ location as a file link, the attachment location as an attachment
+ link or to the attachment location as a file link.
+
+- ~org-attach-commands~ ::
+ #+vindex: org-attach-commands
+ List of all commands used in the attach dispatcher.
+
+- ~org-attach-expert~ ::
+ #+vindex: org-attach-expert
+ Do not show the splash buffer with the attach dispatcher when
+ ~org-attach-expert~ is set to non-~nil~.
+
+See customization group =Org Attach= if you want to change the
+default settings.
+
+*** Attachment links
+:PROPERTIES:
+:DESCRIPTION: Hyperlink access to attachments
+:END:
+
+Attached files and folders can be referenced using attachment links.
+This makes it easy to refer to the material added to an outline node.
+Especially if it was attached using the unique ID of the entry!
+
+#+begin_example
+,* TODO Some task
+ :PROPERTIES:
+ :ID: 95d50008-c12e-479f-a4f2-cc0238205319
+ :END:
+See attached document for more information: [[attachment:info.org]]
+#+end_example
+
+See [[*External Links]] for more information about these links.
+
+*** Automatic version-control with Git
+:PROPERTIES:
+:DESCRIPTION: Everything safely stored away
+:END:
+
+If the directory attached to an outline node is a Git repository, Org
+can be configured to automatically commit changes to that repository
+when it sees them.
+
+To make Org mode take care of versioning of attachments for you, add
+the following to your Emacs config:
+
+#+begin_src emacs-lisp
+(require 'org-attach-git)
+#+end_src
+
+*** Attach from Dired
+:PROPERTIES:
+:DESCRIPTION: Using dired to select an attachment
+:END:
+#+cindex: attach from Dired
+#+findex: org-attach-dired-to-subtree
+
+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,
+{{{kbd(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 {{{kbd(C-c C-x
+a)}}} attach files in Dired buffers.
+
+#+begin_src emacs-lisp
+(add-hook 'dired-mode-hook
+ (lambda ()
+ (define-key dired-mode-map
+ (kbd "C-c C-x a")
+ #'org-attach-dired-to-subtree)))
+#+end_src
+
+The following code shows how to bind the previous command with
+a specific attachment method.
+
+#+begin_src emacs-lisp
+(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))))))
+#+end_src
+
+** RSS Feeds
+:PROPERTIES:
+:DESCRIPTION: Getting input from RSS feeds.
+:END:
+#+cindex: RSS feeds
+#+cindex: Atom 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
+
+#+begin_src emacs-lisp
+(setq org-feed-alist
+ '(("Slashdot"
+ "https://rss.slashdot.org/Slashdot/slashdot"
+ "~/txt/org/feeds.org" "Slashdot Entries")))
+#+end_src
+
+#+texinfo: @noindent
+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:
+
+- {{{kbd(C-c C-x g)}}} (~org-feed-update-all~) ::
+
+ #+kindex: C-c C-x g
+ Collect items from the feeds configured in ~org-feed-alist~ and act
+ upon them.
+
+- {{{kbd(C-c C-x G)}}} (~org-feed-goto-inbox~) ::
+
+ #+kindex: C-c C-x G
+ 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~.
+
+* Agenda Views
+:PROPERTIES:
+:DESCRIPTION: Collecting information into views.
+:END:
+#+cindex: 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.
+
+#+vindex: org-agenda-skip-comment-trees
+#+vindex: org-agenda-skip-archived-trees
+#+cindex: commented entries, in agenda views
+#+cindex: archived entries, in agenda views
+By default, the report ignores commented (see [[*Comment Lines]]) and
+archived (see [[*Internal archiving]]) entries. You can override this by
+setting ~org-agenda-skip-comment-trees~ and
+~org-agenda-skip-archived-trees~ to ~nil~.
+
+#+vindex: org-agenda-window-setup
+#+vindex: org-agenda-restore-windows-after-quit
+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~.
+
+** Agenda Files
+:PROPERTIES:
+:DESCRIPTION: Files being searched for agenda information.
+:END:
+#+cindex: agenda files
+#+cindex: files for agenda
+
+#+vindex: org-agenda-files
+The information to be shown is normally collected from all /agenda
+files/, the files listed in the variable ~org-agenda-files~[fn:91].
+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[fn:92]. You can customize ~org-agenda-files~,
+but the easiest way to maintain it is through the following commands
+
+#+attr_texinfo: :sep and
+- {{{kbd(C-c [)}}} (~org-agenda-file-to-front~) ::
+
+ #+kindex: C-c [
+ #+findex: org-agenda-file-to-front
+ #+cindex: files, adding to agenda list
+ 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.
+
+- {{{kbd(C-c ])}}} (~org-remove-file~) ::
+
+ #+kindex: C-c ]
+ #+findex: org-remove-file
+ Remove current file from the list of agenda files.
+
+- {{{kbd(C-')}}} and {{{kbd(C-\,)}}} (~org-cycle-agenda-files~) ::
+
+ #+kindex: C-'
+ #+kindex: C-,
+ #+findex: org-cycle-agenda-files
+ #+cindex: cycling, of agenda files
+ Cycle through agenda file list, visiting one file after the other.
+
+- {{{kbd(M-x org-switchb)}}} ::
+
+ #+findex: org-switchb
+ Command to use an Iswitchb-like interface to switch to and between
+ Org buffers.
+
+#+texinfo: @noindent
+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 {{{kbd(<)}}} once or several times in
+the dispatcher (see [[*The Agenda Dispatcher]]). To restrict the agenda
+scope for an extended period, use the following commands:
+
+- {{{kbd(C-c C-x <)}}} (~org-agenda-set-restriction-lock~) ::
+
+ #+kindex: C-c C-x <
+ #+findex: 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 {{{kbd(C-c C-x >)}}}, or by typing
+ either {{{kbd(<)}}} or {{{kbd(>)}}} in the agenda dispatcher. If
+ there is a window displaying an agenda view, the new restriction
+ takes effect immediately.
+
+- {{{kbd(C-c C-x >)}}} (~org-agenda-remove-restriction-lock~) ::
+
+ #+kindex: C-c C-x >
+ #+findex: org-agenda-remove-restriction-lock
+ Remove the restriction created by {{{kbd(C-c C-x <)}}}.
+
+When working with Speedbar, you can use the following commands in the
+Speedbar frame:
+
+- {{{kbd(<)}}} (~org-speedbar-set-agenda-restriction~) ::
+
+ #+findex: 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.
+
+- {{{kbd(>)}}} (~org-agenda-remove-restriction-lock~) ::
+
+ #+findex: org-agenda-remove-restriction-lock
+ Remove the restriction.
+
+** The Agenda Dispatcher
+:PROPERTIES:
+:DESCRIPTION: Keyboard access to agenda views.
+:ALT_TITLE: Agenda Dispatcher
+:END:
+#+cindex: agenda dispatcher
+#+cindex: dispatching agenda commands
+
+The views are created through a dispatcher, accessible with {{{kbd(M-x
+org-agenda)}}}, or, better, bound to a global key (see [[*Activation]]).
+It displays a menu from which an additional letter is required to
+execute a command. The dispatcher offers the following default
+commands:
+
+#+attr_texinfo: :sep ,
+- {{{kbd(a)}}} ::
+
+ Create the calendar-like agenda (see [[*Weekly/daily agenda]]).
+
+- {{{kbd(t)}}}, {{{kbd(T)}}} ::
+
+ Create a list of all TODO items (see [[*The global TODO list]]).
+
+- {{{kbd(m)}}}, {{{kbd(M)}}} ::
+
+ Create a list of headlines matching a given expression (see
+ [[*Matching tags and properties]]).
+
+- {{{kbd(s)}}} ::
+
+ #+kindex: s @r{(Agenda dispatcher)}
+ 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.
+
+- {{{kbd(/)}}} ::
+
+ #+kindex: / @r{(Agenda dispatcher)}
+ #+vindex: org-agenda-text-search-extra-files
+ 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.
+
+- {{{kbd(#)}}} ::
+
+ Create a list of stuck projects (see [[*Stuck projects]]).
+
+- {{{kbd(!)}}} ::
+
+ Configure the list of stuck projects (see [[*Stuck projects]]).
+
+- {{{kbd(<)}}} ::
+
+ #+kindex: < @r{(Agenda dispatcher)}
+ Restrict an agenda command to the current buffer[fn:93]. If
+ narrowing is in effect restrict to the narrowed part of the buffer.
+ After pressing {{{kbd(<)}}}, you still need to press the character
+ selecting the command.
+
+- {{{kbd(< <)}}} ::
+
+ #+kindex: < < @r{(Agenda dispatcher)}
+ If there is an active region, restrict the following agenda command
+ to the region. Otherwise, restrict it to the current
+ subtree[fn:94]. After pressing {{{kbd(< <)}}}, you still need to
+ press the character selecting the command.
+
+- {{{kbd(*)}}} ::
+
+ #+kindex: * @r{(Agenda dispatcher)}
+ #+vindex: org-agenda-sticky
+ #+findex: org-toggle-sticky-agenda
+ 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
+ {{{kbd(r)}}} or {{{kbd(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 [[*Custom Agenda Views]].
+
+** The Built-in Agenda Views
+:PROPERTIES:
+:DESCRIPTION: What is available out of the box?
+:ALT_TITLE: Built-in Agenda Views
+:END:
+
+In this section we describe the built-in views.
+
+*** Weekly/daily agenda
+:PROPERTIES:
+:DESCRIPTION: The calendar page with current tasks.
+:END:
+#+cindex: agenda
+#+cindex: weekly agenda
+#+cindex: 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.
+
+- {{{kbd(M-x org-agenda a)}}} (~org-agenda-list~) ::
+
+ #+kindex: a @r{(Agenda dispatcher)}
+ #+findex: org-agenda-list
+ #+cindex: org-agenda, command
+ 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[fn:95]---like {{{kbd(C-u 2 1 M-x org-agenda a)}}}---you may
+ set the number of days to be displayed.
+
+#+vindex: org-agenda-span
+#+vindex: org-agenda-start-day
+#+vindex: org-agenda-start-on-weekday
+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 [[*Commands in
+the Agenda Buffer]].
+
+**** Calendar/Diary integration
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: calendar integration
+#+cindex: diary integration
+
+Emacs contains the calendar and diary by Edward\nbsp{}M.\nbsp{}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
+
+#+begin_src emacs-lisp
+(setq org-agenda-include-diary t)
+#+end_src
+
+#+texinfo: @noindent
+After that, everything happens automatically. All diary entries
+including holidays, anniversaries, etc., are included in the agenda
+buffer created by Org mode. {{{kbd(SPC)}}}, {{{kbd(TAB)}}}, and
+{{{kbd(RET)}}} can be used from the agenda buffer to jump to the diary
+file in order to edit existing diary entries. The {{{kbd(i)}}}
+command to insert new entries for the current date works in the agenda
+buffer, as well as the commands {{{kbd(S)}}}, {{{kbd(M)}}}, and
+{{{kbd(C)}}} to display Sunrise/Sunset times, show lunar phases and to
+convert to other calendars, respectively. {{{kbd(c)}}} can be used to
+switch back and forth between calendar and agenda.
+
+If you are using the diary only for expression 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
+expression entries, and does it faster because there is no overhead
+for first creating the diary display. Note that the expression
+entries must start at the left margin, no whitespace is allowed before
+them, as seen in the following segment of an Org file:[fn:96]
+
+#+begin_example
+,* 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
+#+end_example
+
+**** Anniversaries from BBDB
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: BBDB, anniversaries
+#+cindex: anniversaries, from BBDB
+
+#+findex: org-bbdb-anniversaries
+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:
+
+#+begin_example
+,* Anniversaries
+ :PROPERTIES:
+ :CATEGORY: Anniv
+ :END:
+%%(org-bbdb-anniversaries)
+#+end_example
+
+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
+=ol-bbdb.el= contains more detailed information.
+
+#+begin_example
+1973-06-22
+06-22
+1955-08-02 wedding
+2008-04-14 %s released version 6.01 of Org mode, %d years ago
+#+end_example
+
+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.
+
+#+findex: org-bbdb-anniversaries-future
+If you would like to see upcoming anniversaries with a bit of
+forewarning, you can use the following instead:
+
+#+begin_example
+,* Anniversaries
+ :PROPERTIES:
+ :CATEGORY: Anniv
+ :END:
+%%(org-bbdb-anniversaries-future 3)
+#+end_example
+
+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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: @file{appt.el}
+#+cindex: appointment reminders
+#+cindex: appointment
+#+cindex: reminders
+
+#+cindex: APPT_WARNTIME, keyword
+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.
+
+*** The global TODO list
+:PROPERTIES:
+:DESCRIPTION: All unfinished action items.
+:ALT_TITLE: Global TODO list
+:END:
+#+cindex: global TODO list
+#+cindex: TODO list, global
+
+The global TODO list contains all unfinished TODO items formatted and
+collected into a single place.
+
+- {{{kbd(M-x org-agenda t)}}} (~org-todo-list~) ::
+
+ #+kindex: t @r{(Agenda dispatcher)}
+ #+findex: org-todo-list
+ Show the global TODO list. This collects the TODO items from all
+ agenda files (see [[*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 [[*Commands in the
+ Agenda Buffer]]).
+
+- {{{kbd(M-x org-agenda T)}}} (~org-todo-list~) ::
+
+ #+kindex: T @r{(Agenda dispatcher)}
+ #+findex: org-todo-list
+ #+cindex: TODO keyword matching
+ #+vindex: org-todo-keywords
+ Like the above, but allows selection of a specific TODO keyword.
+ You can also do this by specifying a prefix argument to
+ {{{kbd(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.
+
+ #+kindex: r
+ The {{{kbd(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 {{{kbd(3 r)}}}. If you often need
+ a search for a specific keyword, define a custom command for it (see
+ [[*The Agenda Dispatcher]]).
+
+ Matching specific TODO keywords can also be done as part of a tags
+ search (see [[*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 [[*Commands in the Agenda Buffer]].
+
+#+cindex: sublevels, inclusion into TODO list
+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:
+
+-
+ #+vindex: org-agenda-todo-ignore-scheduled
+ #+vindex: org-agenda-todo-ignore-deadlines
+ #+vindex: org-agenda-todo-ignore-timestamp
+ #+vindex: org-agenda-todo-ignore-with-date
+ Some people view a TODO item that has been /scheduled/ for execution
+ or have a /deadline/ (see [[*Timestamps]]) as no longer /open/.
+ Configure the variables ~org-agenda-todo-ignore-scheduled~ to
+ exclude some or all scheduled items from the global TODO list,
+ ~org-agenda-todo-ignore-deadlines~ to exclude some or all items with
+ a deadline set, ~org-agenda-todo-ignore-timestamp~ to exclude some
+ or all items with an active timestamp other than a DEADLINE or
+ a SCHEDULED timestamp and/or ~org-agenda-todo-ignore-with-date~ to
+ exclude items with at least one active timestamp.
+
+-
+ #+vindex: org-agenda-todo-list-sublevels
+ 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.
+
+*** Matching tags and properties
+:PROPERTIES:
+:DESCRIPTION: Structured information with fine-tuned search.
+:END:
+#+cindex: matching, of tags
+#+cindex: matching, of properties
+#+cindex: tags view
+#+cindex: match view
+
+If headlines in the agenda files are marked with /tags/ (see [[*Tags]]),
+or have properties (see [[*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 {{{kbd(C-c / m)}}}.
+
+- {{{kbd(M-x org-agenda m)}}} (~org-tags-view~) ::
+
+ #+kindex: m @r{(Agenda dispatcher)}
+ #+findex: 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 [[*Tags]]). If you often need a specific search, define a custom
+ command for it (see [[*The Agenda Dispatcher]]).
+
+- {{{kbd(M-x org-agenda M)}}} (~org-tags-view~) ::
+
+ #+kindex: M @r{(Agenda dispatcher)}
+ #+findex: org-tags-view
+ #+vindex: org-tags-match-list-sublevels
+ #+vindex: org-agenda-tags-todo-honor-ignore-options
+ Like {{{kbd(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 [[*Tag Searches]].
+
+The commands available in the tags list are described in [[*Commands in
+the Agenda Buffer]].
+
+#+cindex: boolean logic, for agenda searches
+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=.
+
+#+cindex: regular expressions, with tags search
+Instead of a tag, you may also specify a regular expression enclosed
+in curly braces (see [[*Regular Expressions]]). For example,
+=work+{^boss.*}= matches headlines that contain the tag =:work:= and
+any tag /starting/ with =boss=.
+
+#+cindex: group tags, as regular expressions
+Group tags (see [[*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\)}=).
+
+#+cindex: TODO keyword matching, with tags search
+#+cindex: level, for tags/property match
+#+cindex: category, for tags/property match
+#+vindex: org-odd-levels-only
+You may also test for properties (see [[*Properties and Columns]]) at the
+same time as matching tags. The properties may be real properties, or
+special properties that represent other metadata (see [[*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:
+
+#+begin_example
++work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2
+ +With={Sarah\|Denny}+SCHEDULED>="<2008-10-11>"
+#+end_example
+
+#+texinfo: @noindent
+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
+ ="<now>"= for now (including time), ="<today>"=, and ="<tomorrow>"=
+ 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 [[*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 {{{kbd(M-x
+org-agenda M)}}}, or equivalently start the TODO part after the slash
+with =!=. Using {{{kbd(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=.
+
+*** Search view
+:PROPERTIES:
+:DESCRIPTION: Find entries by searching for text.
+:END:
+#+cindex: search view
+#+cindex: text search
+#+cindex: searching, for text
+
+This agenda view is a general text search facility for Org mode
+entries. It is particularly useful to find notes.
+
+- {{{kbd(M-x org-agenda s)}}} (~org-search-view~) ::
+
+ #+kindex: s @r{(Agenda dispatcher)}
+ #+findex: 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 and conveniently adjust a boolean search from
+the agenda search view with the following keys
+
+#+attr_texinfo: :columns 0.1 0.6
+| {{{kbd([)}}} | Add a positive search word |
+| {{{kbd(])}}} | Add a negative search word |
+| {{{kbd({)}}} | Add a positive regular expression |
+| {{{kbd(})}}} | Add a negative regular expression |
+
+#+vindex: org-agenda-text-search-extra-files
+Note that in addition to the agenda files, this command also searches
+the files listed in ~org-agenda-text-search-extra-files~.
+
+*** Stuck projects
+:PROPERTIES:
+:DESCRIPTION: Find projects you need to review.
+:END:
+#+pindex: GTD, Getting Things Done
+
+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.
+
+- {{{kbd(M-x org-agenda #)}}} (~org-agenda-list-stuck-projects~) ::
+
+ #+kindex: # @r{(Agenda dispatcher)}
+ #+findex: org-agenda-list-stuck-projects
+ List projects that are stuck.
+
+- {{{kbd(M-x org-agenda !)}}} ::
+
+ #+kindex: ! @r{(Agenda dispatcher)}
+ #+vindex: org-stuck-projects
+ 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
+[[*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:
+
+#+begin_src emacs-lisp
+(setq org-stuck-projects
+ '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@shop")
+ "\\<IGNORE\\>"))
+#+end_src
+
+Note that if a project is identified as non-stuck, the subtree of this
+entry is searched for stuck projects.
+
+** Presentation and Sorting
+:PROPERTIES:
+:DESCRIPTION: How agenda items are prepared for display.
+:END:
+#+cindex: presentation, of agenda items
+
+#+vindex: org-agenda-prefix-format
+#+vindex: org-agenda-tags-column
+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 [[*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.
+
+*** Categories
+:PROPERTIES:
+:DESCRIPTION: Not all tasks are equal.
+:END:
+#+cindex: category
+#+cindex: @samp{CATEGORY}, keyword
+
+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
+
+#+cindex: @samp{CATEGORY}, property
+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.
+
+#+vindex: org-agenda-category-icon-alist
+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.
+
+*** Time-of-day specifications
+:PROPERTIES:
+:DESCRIPTION: How the agenda knows the time.
+:END:
+#+cindex: time-of-day specification
+
+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>
+
+#+texinfo: @noindent
+Time ranges can be specified with two timestamps:
+
+: <2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>
+
+#+vindex: org-agenda-search-headline-for-time
+In the headline of the entry itself, a time(range)---like =12:45= or
+a =8:30-1pm=---may also appear as plain text[fn:97].
+
+If the agenda integrates the Emacs diary (see [[*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:
+
+#+begin_example
+ 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
+#+end_example
+
+#+cindex: time grid
+If the agenda is in single-day mode, or for the display of today, the
+timed entries are embedded in a time grid, like
+
+#+begin_example
+ 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
+#+end_example
+
+#+vindex: org-agenda-use-time-grid
+#+vindex: org-agenda-time-grid
+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~.
+
+*** Sorting of agenda items
+:PROPERTIES:
+:DESCRIPTION: The order of things.
+:END:
+#+cindex: sorting, of agenda items
+#+cindex: priorities, of agenda items
+
+Before being inserted into a view, the items are sorted. How this is
+done depends on the type of view.
+
+-
+ #+vindex: org-agenda-files
+ 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
+ [[*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
+ [[*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.
+
+#+vindex: org-agenda-sorting-strategy
+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 [[*Effort Estimates]]).
+
+*** Filtering/limiting agenda items
+:PROPERTIES:
+:DESCRIPTION: Dynamically narrow the agenda.
+:END:
+
+#+vindex: org-agenda-category-filter-preset
+#+vindex: org-agenda-tag-filter-preset
+#+vindex: org-agenda-effort-filter-preset
+#+vindex: org-agenda-regexp-filter-preset
+Agenda built-in or custom commands are statically defined. Agenda
+filters and limits allow to flexibly narrow down the list of agenda
+entries.
+
+/Filters/ only change the visibility of items, are very fast and are
+mostly used interactively[fn:98]. You can switch quickly between
+different filters without having to recreate the agenda. /Limits/ on
+the other hand take effect before the agenda buffer is populated, so
+they are mostly useful when defined as local variables within custom
+agenda commands.
+
+**** Filtering in the agenda
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: agenda filtering
+#+cindex: filtering entries, in agenda
+#+cindex: tag filtering, in agenda
+#+cindex: category filtering, in agenda
+#+cindex: top headline filtering, in agenda
+#+cindex: effort filtering, in agenda
+#+cindex: query editing, in agenda
+
+The general filtering command is ~org-agenda-filter~, bound to
+{{{kbd(/)}}}. Before we introduce it, we describe commands for
+individual filter types. All filtering commands handle prefix
+arguments in the same way: A single {{{kbd(C-u)}}} prefix negates the
+filter, so it removes lines selected by the filter. A double prefix
+adds the new filter condition to the one(s) already in place, so
+filter elements are accumulated.
+
+- {{{kbd(\)}}} (~org-agenda-filter-by-tag~) ::
+
+ #+findex: org-agenda-filter-by-tag
+ Filter the agenda view with respect to a tag. You are prompted for
+ a tag selection letter; {{{kbd(SPC)}}} means any tag at all.
+ Pressing {{{kbd(TAB)}}} 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. Pressing {{{kbd(+)}}} or {{{kbd(-)}}} at the prompt switches
+ between filtering for and against the next tag. To clear the
+ filter, press {{{kbd(\)}}} twice (once to call the command again,
+ and once at the prompt).
+
+- {{{kbd(<)}}} (~org-agenda-filter-by-category~) ::
+
+ #+findex: org-agenda-filter-by-category
+ Filter by category of the line at point, and show only entries with
+ this category. When called with a prefix argument, hide all entries
+ with the category at point. To clear the filter, call this command
+ again by pressing {{{kbd(<)}}}.
+
+- {{{kbd(=)}}} (~org-agenda-filter-by-regexp~) ::
+
+ #+findex: org-agenda-filter-by-regexp
+ Filter the agenda view by a regular expression: only show agenda
+ entries matching the regular expression the user entered. To clear
+ the filter, call the command again by pressing {{{kbd(=)}}}.
+
+- {{{kbd(_)}}} (~org-agenda-filter-by-effort~) ::
+
+ #+findex: org-agenda-filter-by-effort
+ Filter the agenda view with respect to effort estimates, so select
+ tasks that take the right amount of time. You first need to set up
+ a list of efforts globally, for example
+
+ #+begin_src emacs-lisp
+ (setq org-global-properties
+ '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
+ #+end_src
+
+ #+vindex: org-sort-agenda-noeffort-is-high
+ You can then filter for an effort by first typing an operator, one
+ of {{{kbd(<)}}}, {{{kbd(>)}}} and {{{kbd(=)}}}, and then the
+ one-digit index of an effort estimate in your array of allowed
+ values, where {{{kbd(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~. To clear the
+ filter, press {{{kbd(_)}}} twice (once to call the command again,
+ and once at the first prompt).
+
+- {{{kbd(^)}}} (~org-agenda-filter-by-top-headline~) ::
+
+ #+findex: org-agenda-filter-by-top-headline
+ Filter the current agenda view and only display items that fall
+ under the same top-level headline as the current entry. To clear
+ the filter, call this command again by pressing {{{kbd(^)}}}.
+
+- {{{kbd(/)}}} (~org-agenda-filter~) ::
+
+ #+findex: org-agenda-filter
+ This is the unified interface to four of the five filter methods
+ described above. At the prompt, specify different filter elements
+ in a single string, with full completion support. For example,
+
+ : +work-John+<0:10-/plot/
+
+ selects entries with category =work= and effort estimates below 10
+ minutes, and deselects entries with tag =John= or matching the
+ regexp =plot= (see [[*Regular Expressions]]). You can leave =+= out if
+ that does not lead to ambiguities. The sequence of elements is
+ arbitrary. The filter syntax assumes that there is no overlap
+ between categories and tags. Otherwise, tags take priority. If you
+ reply to the prompt with the empty string, all filtering is removed.
+ If a filter is specified, it replaces all current filters. But if
+ you call the command with a double prefix argument, or if you add an
+ additional =+= (e.g., =++work=) to the front of the string, the new
+ filter elements are added to the active ones. A single prefix
+ argument applies the entire filter in a negative sense.
+
+- {{{kbd(|)}}} (~org-agenda-filter-remove-all~) ::
+
+ Remove all filters in the current agenda view.
+
+**** Computed tag filtering
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+vindex: org-agenda-auto-exclude-function
+If the variable ~org-agenda-auto-exclude-function~ is set to
+a user-defined function, that function can select tags that should be
+used as a tag filter when requested. The function will be called with
+lower-case versions of all tags represented in the current view. The
+function should return ="-tag"= if the filter should remove
+entries with that tag, ="+tag"= if only entries with this tag should
+be kept, or =nil= if that tag is irrelevant. 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:
+
+#+begin_src emacs-lisp
+(defun my-auto-exclude-fn (tag)
+ (when (cond ((string= tag "net")
+ (/= 0 (call-process "/sbin/ping" nil nil nil
+ "-c1" "-q" "-t1" "mail.gnu.org")))
+ ((member tag '("errand" "call"))
+ (let ((hr (nth 2 (decode-time))))
+ (or (< hr 8) (> hr 21)))))
+ (concat "-" tag)))
+
+(setq org-agenda-auto-exclude-function #'my-auto-exclude-fn)
+#+end_src
+
+You can apply this self-adapting filter by using a triple prefix
+argument to ~org-agenda-filter~, i.e.\nbsp{}press {{{kbd(C-u C-u C-u /)}}},
+or by pressing {{{kbd(RET)}}} in ~org-agenda-filter-by-tag~.
+
+**** Setting limits for the agenda
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: limits, in agenda
+
+Here is a list of options that you can set, either globally, or
+locally in your custom agenda views (see [[*Custom Agenda Views]]).
+
+- ~org-agenda-max-entries~ ::
+
+ #+vindex: org-agenda-max-entries
+ Limit the number of entries.
+
+- ~org-agenda-max-effort~ ::
+
+ #+vindex: org-agenda-max-effort
+ Limit the duration of accumulated efforts (as minutes).
+
+- ~org-agenda-max-todos~ ::
+
+ #+vindex: org-agenda-max-todos
+ Limit the number of entries with TODO keywords.
+
+- ~org-agenda-max-tags~ ::
+
+ #+vindex: 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.
+
+#+begin_src emacs-lisp
+(setq org-agenda-custom-commands
+ '(("n" todo "NEXT"
+ ((org-agenda-max-entries 5)))))
+#+end_src
+
+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:
+
+- {{{kbd(~ )}}} (~org-agenda-limit-interactively~) ::
+
+ #+findex: org-agenda-limit-interactively
+ This prompts for the type of limit to apply and its value.
+
+** Commands in the Agenda Buffer
+:PROPERTIES:
+:DESCRIPTION: Remote editing of Org trees.
+:ALT_TITLE: Agenda Commands
+:END:
+#+cindex: commands, in 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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: motion commands in agenda
+
+- {{{kbd(n)}}} (~org-agenda-next-line~) ::
+
+ #+kindex: n
+ #+findex: org-agenda-next-line
+ Next line (same as {{{kbd(DOWN)}}} and {{{kbd(C-n)}}}).
+
+- {{{kbd(p)}}} (~org-agenda-previous-line~) ::
+
+ #+kindex: p
+ #+findex: org-agenda-previous-line
+ Previous line (same as {{{kbd(UP)}}} and {{{kbd(C-p)}}}).
+
+*** View/Go to Org file
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: view file commands in agenda
+
+- {{{kbd(SPC)}}} or {{{kbd(mouse-3)}}} (~org-agenda-show-and-scroll-up~) ::
+
+ #+kindex: SPC
+ #+kindex: mouse-3
+ #+findex: 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.
+
+- {{{kbd(L)}}} (~org-agenda-recenter~) ::
+
+ #+findex: org-agenda-recenter
+ Display original location and recenter that window.
+
+- {{{kbd(TAB)}}} or {{{kbd(mouse-2)}}} (~org-agenda-goto~) ::
+
+ #+kindex: TAB
+ #+kindex: mouse-2
+ #+findex: org-agenda-goto
+ Go to the original location of the item in another window.
+
+- {{{kbd(RET)}}} (~org-agenda-switch-to~) ::
+
+ #+kindex: RET
+ #+findex: org-agenda-switch-to
+ Go to the original location of the item and delete other windows.
+
+- {{{kbd(F)}}} (~org-agenda-follow-mode~) ::
+
+ #+kindex: F
+ #+findex: org-agenda-follow-mode
+ #+vindex: org-agenda-start-with-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~.
+
+- {{{kbd(C-c C-x b)}}} (~org-agenda-tree-to-indirect-buffer~) ::
+
+ #+kindex: C-c C-x b
+ #+findex: 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 {{{kbd(C-u)}}} prefix, do not remove the previously used indirect
+ buffer.
+
+- {{{kbd(C-c C-o)}}} (~org-agenda-open-link~) ::
+
+ #+kindex: C-c C-o
+ #+findex: 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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: change agenda display
+#+cindex: display changing, in agenda
+
+#+attr_texinfo: :sep ,
+- {{{kbd(A)}}} ::
+
+ #+kindex: A
+ Interactively select another agenda view and append it to the
+ current view.
+
+- {{{kbd(o)}}} ::
+
+ #+kindex: o
+ Delete other windows.
+
+- {{{kbd(v d)}}} or short {{{kbd(d)}}} (~org-agenda-day-view~) ::
+
+ #+kindex: v d
+ #+kindex: d
+ #+findex: 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, {{{kbd(32 d)}}} jumps to February 1st. When
+ setting day view, a year may be encoded in the prefix argument as
+ well. For example, {{{kbd(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.
+
+- {{{kbd(v w)}}} or short {{{kbd(w)}}} (~org-agenda-week-view~) ::
+
+ #+kindex: v w
+ #+kindex: w
+ #+findex: 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 {{{kbd(9 w)}}} to ISO week number 9. When
+ setting week view, a year may be encoded in the prefix argument as
+ well. For example, {{{kbd(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.
+
+- {{{kbd(v m)}}} (~org-agenda-month-view~) ::
+
+ #+kindex: v m
+ #+findex: 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, {{{kbd(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.
+
+- {{{kbd(v y)}}} (~org-agenda-year-view~) ::
+
+ #+kindex: v y
+ #+findex: 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.
+
+- {{{kbd(v SPC)}}} (~org-agenda-reset-view~) ::
+
+ #+kindex: v SPC
+ #+findex: org-agenda-reset-view
+ #+vindex: org-agenda-span
+ Reset the current view to ~org-agenda-span~.
+
+- {{{kbd(f)}}} (~org-agenda-later~) ::
+
+ #+kindex: f
+ #+findex: 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.
+
+- {{{kbd(b)}}} (~org-agenda-earlier~) ::
+
+ #+kindex: b
+ #+findex: org-agenda-earlier
+ Go backward in time to display earlier dates.
+
+- {{{kbd(.)}}} (~org-agenda-goto-today~) ::
+
+ #+kindex: .
+ #+findex: org-agenda-goto-today
+ Go to today.
+
+- {{{kbd(j)}}} (~org-agenda-goto-date~) ::
+
+ #+kindex: j
+ #+findex: org-agenda-goto-date
+ Prompt for a date and go there.
+
+- {{{kbd(J)}}} (~org-agenda-clock-goto~) ::
+
+ #+kindex: J
+ #+findex: org-agenda-clock-goto
+ Go to the currently clocked-in task /in the agenda buffer/.
+
+- {{{kbd(D)}}} (~org-agenda-toggle-diary~) ::
+
+ #+kindex: D
+ #+findex: org-agenda-toggle-diary
+ Toggle the inclusion of diary entries. See [[*Weekly/daily agenda]].
+
+- {{{kbd(v l)}}} or {{{kbd(v L)}}} or short {{{kbd(l)}}} (~org-agenda-log-mode~) ::
+
+ #+kindex: v l
+ #+kindex: l
+ #+kindex: v L
+ #+findex: org-agenda-log-mode
+ #+vindex: org-log-done
+ #+vindex: org-agenda-log-mode-items
+ Toggle Logbook mode. In Logbook mode, entries that were marked as
+ 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 {{{kbd(C-u)}}} prefix argument, show all possible
+ logbook entries, including state changes. When called with two
+ prefix arguments {{{kbd(C-u C-u)}}}, show only logging information,
+ nothing else. {{{kbd(v L)}}} is equivalent to {{{kbd(C-u v l)}}}.
+
+- {{{kbd(v [)}}} or short {{{kbd([)}}} (~org-agenda-manipulate-query-add~) ::
+
+ #+kindex: v [
+ #+kindex: [
+ #+findex: org-agenda-manipulate-query-add
+ Include inactive timestamps into the current view. Only for
+ weekly/daily agenda.
+
+- {{{kbd(v a)}}} (~org-agenda-archives-mode~) ::
+
+ #+kindex: v a
+ #+findex: org-agenda-archives-mode
+ Toggle Archives mode. In Archives mode, trees that are archived
+ (see [[*Internal archiving]]) are also scanned when producing the
+ agenda. To exit archives mode, press {{{kbd(v a)}}} again.
+
+- {{{kbd(v A)}}} ::
+
+ #+kindex: v A
+ Toggle Archives mode. Include all archive files as well.
+
+- {{{kbd(v R)}}} or short {{{kbd(R)}}} (~org-agenda-clockreport-mode~) ::
+
+ #+kindex: v R
+ #+kindex: R
+ #+findex: org-agenda-clockreport-mode
+ #+vindex: org-agenda-start-with-clockreport-mode
+ #+vindex: org-clock-report-include-clocking-task
+ 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., {{{kbd(C-u R)}}}),
+ the clock table does not show contributions from entries that are
+ hidden by agenda filtering[fn:99]. See also the variable
+ ~org-clock-report-include-clocking-task~.
+
+- {{{kbd(v c)}}} ::
+
+ #+kindex: v c
+ #+vindex: org-agenda-clock-consistency-checks
+ 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 {{{kbd(l)}}} to exit Logbook
+ mode.
+
+- {{{kbd(v E)}}} or short {{{kbd(E)}}} (~org-agenda-entry-text-mode~) ::
+
+ #+kindex: v E
+ #+kindex: E
+ #+findex: org-agenda-entry-text-mode
+ #+vindex: org-agenda-start-with-entry-text-mode
+ #+vindex: org-agenda-entry-text-maxlines
+ 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.
+
+- {{{kbd(G)}}} (~org-agenda-toggle-time-grid~) ::
+
+ #+kindex: G
+ #+vindex: org-agenda-use-time-grid
+ #+vindex: org-agenda-time-grid
+ Toggle the time grid on and off. See also the variables
+ ~org-agenda-use-time-grid~ and ~org-agenda-time-grid~.
+
+- {{{kbd(r)}}} (~org-agenda-redo~), {{{kbd(g)}}} ::
+
+ #+kindex: r
+ #+kindex: g
+ #+findex: org-agenda-redo
+ Recreate the agenda buffer, for example to reflect the changes after
+ modification of the timestamps of items with {{{kbd(S-LEFT)}}} and
+ {{{kbd(S-RIGHT)}}}. When the buffer is the global TODO list,
+ a prefix argument is interpreted to create a selective list for
+ a specific TODO keyword.
+
+- {{{kbd(C-x C-s)}}} or short {{{kbd(s)}}} (~org-save-all-org-buffers~) ::
+
+ #+kindex: C-x C-s
+ #+findex: org-save-all-org-buffers
+ #+kindex: s
+ Save all Org buffers in the current Emacs session, and also the
+ locations of IDs.
+
+- {{{kbd(C-c C-x C-c)}}} (~org-agenda-columns~) ::
+
+ #+kindex: C-c C-x C-c
+ #+findex: org-agenda-columns
+ #+vindex: org-columns-default-format
+ Invoke column view (see [[*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.
+
+- {{{kbd(C-c C-x >)}}} (~org-agenda-remove-restriction-lock~) ::
+
+ #+kindex: C-c C-x >
+ #+findex: org-agenda-remove-restriction-lock
+ Remove the restriction lock on the agenda, if it is currently
+ restricted to a file or subtree (see [[*Agenda Files]]).
+
+- {{{kbd(M-UP)}}} (~org-agenda-drag-line-backward~) ::
+
+ #+kindex: M-UP
+ #+findex: 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.
+
+- {{{kbd(M-DOWN)}}} (~org-agenda-drag-line-forward~) ::
+
+ #+kindex: M-DOWN
+ #+findex: 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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: remote editing, from agenda
+
+- {{{kbd(0--9)}}} ::
+
+ Digit argument.
+
+- {{{kbd(C-_)}}} (~org-agenda-undo~) ::
+
+ #+kindex: C-_
+ #+findex: org-agenda-undo
+ #+cindex: undoing remote-editing events
+ #+cindex: remote editing, undo
+ Undo a change due to a remote editing command. The change is undone
+ both in the agenda buffer and in the remote buffer.
+
+- {{{kbd(t)}}} (~org-agenda-todo~) ::
+
+ #+kindex: t
+ #+findex: org-agenda-todo
+ Change the TODO state of the item, both in the agenda and in the
+ original Org file. A prefix arg is passed through to the ~org-todo~
+ command, so for example a {{{kbd(C-u)}}} prefix are will trigger
+ taking a note to document the state change.
+
+- {{{kbd(C-S-RIGHT)}}} (~org-agenda-todo-nextset~) ::
+
+ #+kindex: C-S-RIGHT
+ #+findex: org-agenda-todo-nextset
+ Switch to the next set of TODO keywords.
+
+- {{{kbd(C-S-LEFT)}}}, ~org-agenda-todo-previousset~ ::
+
+ #+kindex: C-S-LEFT
+ Switch to the previous set of TODO keywords.
+
+- {{{kbd(C-k)}}} (~org-agenda-kill~) ::
+
+ #+kindex: C-k
+ #+findex: org-agenda-kill
+ #+vindex: org-agenda-confirm-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~.
+
+- {{{kbd(C-c C-w)}}} (~org-agenda-refile~) ::
+
+ #+kindex: C-c C-w
+ #+findex: org-agenda-refile
+ Refile the entry at point.
+
+- {{{kbd(C-c C-x C-a)}}} or short {{{kbd(a)}}} (~org-agenda-archive-default-with-confirmation~) ::
+
+ #+kindex: C-c C-x C-a
+ #+kindex: a
+ #+findex: org-agenda-archive-default-with-confirmation
+ #+vindex: org-archive-default-command
+ Archive the subtree corresponding to the entry at point using the
+ default archiving command set in ~org-archive-default-command~.
+ When using the {{{kbd(a)}}} key, confirmation is required.
+
+- {{{kbd(C-c C-x a)}}} (~org-agenda-toggle-archive-tag~) ::
+
+ #+kindex: C-c C-x a
+ #+findex: org-agenda-toggle-archive-tag
+ Toggle the archive tag (see [[*Internal archiving]]) for the current
+ headline.
+
+- {{{kbd(C-c C-x A)}}} (~org-agenda-archive-to-archive-sibling~) ::
+
+ #+kindex: C-c C-x A
+ #+findex: org-agenda-archive-to-archive-sibling
+ Move the subtree corresponding to the current entry to its /archive
+ sibling/.
+
+- {{{kbd(C-c C-x C-s)}}} or short {{{kbd($)}}} (~org-agenda-archive~) ::
+
+ #+kindex: C-c C-x C-s
+ #+kindex: $
+ #+findex: 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.
+
+- {{{kbd(T)}}} (~org-agenda-show-tags~) ::
+
+ #+kindex: T
+ #+findex: org-agenda-show-tags
+ #+vindex: org-agenda-show-inherited-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.
+
+- {{{kbd(:)}}} (~org-agenda-set-tags~) ::
+
+ #+kindex: :
+ #+findex: 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.
+
+- {{{kbd(\,)}}} (~org-agenda-priority~) ::
+
+ #+kindex: ,
+ #+findex: org-agenda-priority
+ Set the priority for the current item. Org mode prompts for the
+ priority character. If you reply with {{{kbd(SPC)}}}, the priority
+ cookie is removed from the entry.
+
+- {{{kbd(+)}}} or {{{kbd(S-UP)}}} (~org-agenda-priority-up~) ::
+
+ #+kindex: +
+ #+kindex: S-UP
+ #+findex: 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
+ {{{kbd(r)}}} key for this.
+
+- {{{kbd(-)}}} or {{{kbd(S-DOWN)}}} (~org-agenda-priority-down~) ::
+
+ #+kindex: -
+ #+kindex: S-DOWN
+ #+findex: org-agenda-priority-down
+ Decrease the priority of the current item.
+
+- {{{kbd(C-c C-x e)}}} or short {{{kbd(e)}}} (~org-agenda-set-effort~) ::
+
+ #+kindex: e
+ #+kindex: C-c C-x e
+ #+findex: org-agenda-set-effort
+ Set the effort property for the current item.
+
+- {{{kbd(C-c C-z)}}} or short {{{kbd(z)}}} (~org-agenda-add-note~) ::
+
+ #+kindex: z
+ #+kindex: C-c C-z
+ #+findex: org-agenda-add-note
+ #+vindex: org-log-into-drawer
+ 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.
+
+- {{{kbd(C-c C-a)}}} (~org-attach~) ::
+
+ #+kindex: C-c C-a
+ #+findex: org-attach
+ Dispatcher for all command related to attachments.
+
+- {{{kbd(C-c C-s)}}} (~org-agenda-schedule~) ::
+
+ #+kindex: C-c C-s
+ #+findex: org-agenda-schedule
+ Schedule this item. With a prefix argument, remove the
+ scheduling timestamp
+
+- {{{kbd(C-c C-d)}}} (~org-agenda-deadline~) ::
+
+ #+kindex: C-c C-d
+ #+findex: org-agenda-deadline
+ Set a deadline for this item. With a prefix argument, remove the
+ deadline.
+
+- {{{kbd(S-RIGHT)}}} (~org-agenda-do-date-later~) ::
+
+ #+kindex: S-RIGHT
+ #+findex: 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, {{{kbd(3 6 5 S-RIGHT)}}} changes
+ it by a year. With a {{{kbd(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
+ {{{kbd(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 {{{kbd(r)}}} or
+ {{{kbd(g)}}} to update the buffer.
+
+- {{{kbd(S-LEFT)}}} (~org-agenda-do-date-earlier~) ::
+
+ #+kindex: S-LEFT
+ #+findex: org-agenda-do-date-earlier
+ Change the timestamp associated with the current line by one day
+ into the past.
+
+- {{{kbd(>)}}} (~org-agenda-date-prompt~) ::
+
+ #+kindex: >
+ #+findex: org-agenda-date-prompt
+ Change the timestamp associated with the current line. The key
+ {{{kbd(>)}}} has been chosen, because it is the same as
+ {{{kbd(S-.)}}} on my keyboard.
+
+- {{{kbd(I)}}} (~org-agenda-clock-in~) ::
+
+ #+kindex: I
+ #+findex: org-agenda-clock-in
+ Start the clock on the current item. If a clock is running already,
+ it is stopped first.
+
+- {{{kbd(O)}}} (~org-agenda-clock-out~) ::
+
+ #+kindex: O
+ #+findex: org-agenda-clock-out
+ Stop the previously started clock.
+
+- {{{kbd(X)}}} (~org-agenda-clock-cancel~) ::
+
+ #+kindex: X
+ #+findex: org-agenda-clock-cancel
+ Cancel the currently running clock.
+
+- {{{kbd(J)}}} (~org-agenda-clock-goto~) ::
+
+ #+kindex: J
+ #+findex: org-agenda-clock-goto
+ Jump to the running clock in another window.
+
+- {{{kbd(k)}}} (~org-agenda-capture~) ::
+
+ #+kindex: k
+ #+findex: org-agenda-capture
+ #+cindex: capturing, from agenda
+ #+vindex: org-capture-use-agenda-date
+ 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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: remote editing, bulk, from agenda
+#+vindex: org-agenda-bulk-custom-functions
+
+- {{{kbd(m)}}} (~org-agenda-bulk-mark~) ::
+ #+kindex: m
+ #+findex: 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.
+
+- {{{kbd(*)}}} (~org-agenda-bulk-mark-all~) ::
+ #+kindex: *
+ #+findex: org-agenda-bulk-mark-all
+
+ Mark all visible agenda entries for bulk action.
+
+- {{{kbd(u)}}} (~org-agenda-bulk-unmark~) ::
+ #+kindex: u
+ #+findex: org-agenda-bulk-unmark
+
+ Unmark entry for bulk action.
+
+- {{{kbd(U)}}} (~org-agenda-bulk-remove-all-marks~) ::
+ #+kindex: U
+ #+findex: org-agenda-bulk-remove-all-marks
+
+ Unmark all marked entries for bulk action.
+
+- {{{kbd(M-m)}}} (~org-agenda-bulk-toggle~) ::
+ #+kindex: M-m
+ #+findex: org-agenda-bulk-toggle
+
+ Toggle mark of the entry at point for bulk action.
+
+- {{{kbd(M-*)}}} (~org-agenda-bulk-toggle-all~) ::
+ #+kindex: M-*
+ #+findex: org-agenda-bulk-toggle-all
+
+ Toggle mark of every entry for bulk action.
+
+- {{{kbd(%)}}} (~org-agenda-bulk-mark-regexp~) ::
+ #+kindex: %
+ #+findex: org-agenda-bulk-mark-regexp
+
+ Mark entries matching a regular expression for bulk action.
+
+- {{{kbd(B)}}} (~org-agenda-bulk-action~) ::
+ #+kindex: B
+ #+findex: org-agenda-bulk-action
+ #+vindex: org-agenda-bulk-persistent-marks
+
+ 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 {{{kbd(B)}}} is passed through to the {{{kbd(s)}}} and
+ {{{kbd(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
+ {{{kbd(p)}}} at the prompt.
+
+ - {{{kbd(p)}}} ::
+
+ Toggle persistent marks.
+
+ - {{{kbd($)}}} ::
+
+ Archive all selected entries.
+
+ - {{{kbd(A)}}} ::
+
+ Archive entries by moving them to their respective archive
+ siblings.
+
+ - {{{kbd(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.
+
+ - {{{kbd(+)}}} ::
+
+ Add a tag to all selected entries.
+
+ - {{{kbd(-)}}} ::
+
+ Remove a tag from all selected entries.
+
+ - {{{kbd(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=.
+
+ - {{{kbd(d)}}} ::
+
+ Set deadline to a specific date.
+
+ - {{{kbd(r)}}} ::
+
+ Prompt for a single refile target and move all entries. The
+ entries are no longer in the agenda; refresh ({{{kbd(g)}}}) to
+ bring them back.
+
+ - {{{kbd(S)}}} ::
+
+ Reschedule randomly into the coming N days. N is prompted for.
+ With a prefix argument ({{{kbd(C-u B S)}}}), scatter only across
+ weekdays.
+
+ - {{{kbd(f)}}} ::
+
+ #+vindex: org-agenda-bulk-custom-functions
+ Apply a function[fn:100] to marked entries. For example, the
+ function below sets the =CATEGORY= property of the entries to
+ =web=.
+
+ #+begin_src emacs-lisp
+ (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"))))
+ #+end_src
+
+*** Calendar commands
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: calendar commands, from agenda
+
+- {{{kbd(c)}}} (~org-agenda-goto-calendar~) ::
+
+ #+kindex: c
+ #+findex: org-agenda-goto-calendar
+ Open the Emacs calendar and go to the date at point in the agenda.
+
+- {{{kbd(c)}}} (~org-calendar-goto-agenda~) ::
+
+ #+kindex: c
+ #+findex: org-calendar-goto-agenda
+ When in the calendar, compute and show the Org agenda for the date
+ at point.
+
+- {{{kbd(i)}}} (~org-agenda-diary-entry~) ::
+ #+kindex: i
+ #+findex: org-agenda-diary-entry
+
+ #+cindex: diary entries, creating from agenda
+ 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[fn:101], in a way similar to the {{{kbd(i)}}} command in the
+ calendar. The diary file pops up in another window, where you can
+ add the entry.
+
+ #+vindex: org-agenda-diary-file
+ 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 {{{kbd(RET)}}} at the prompt
+ without typing text, the target file is shown in another window for
+ you to finish the entry there. See also the {{{kbd(k r)}}} command.
+
+- {{{kbd(M)}}} (~org-agenda-phases-of-moon~) ::
+
+ #+kindex: M
+ #+findex: org-agenda-phases-of-moon
+ Show the phases of the moon for the three months around current
+ date.
+
+- {{{kbd(S)}}} (~org-agenda-sunrise-sunset~) ::
+
+ #+kindex: S
+ #+findex: 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.
+
+- {{{kbd(C)}}} (~org-agenda-convert-date~) ::
+
+ #+kindex: C
+ #+findex: org-agenda-convert-date
+ Convert the date at point into many other cultural and historic
+ calendars.
+
+- {{{kbd(H)}}} (~org-agenda-holidays~) ::
+
+ #+kindex: H
+ #+findex: org-agenda-holidays
+ Show holidays for three months around point date.
+
+*** Quit and exit
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(q)}}} (~org-agenda-quit~) ::
+ #+kindex: q
+ #+findex: org-agenda-quit
+
+ Quit agenda, remove the agenda buffer.
+
+- {{{kbd(x)}}} (~org-agenda-exit~) ::
+ #+kindex: x
+ #+findex: org-agenda-exit
+
+ #+cindex: agenda files, removing buffers
+ 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.
+
+** Custom Agenda Views
+:PROPERTIES:
+:DESCRIPTION: Defining special searches and views.
+:END:
+#+cindex: custom agenda views
+#+cindex: agenda views, custom
+
+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 [[*The Agenda Dispatcher]]), just like the
+default commands.
+
+*** Storing searches
+:PROPERTIES:
+:DESCRIPTION: Type once, use often.
+:END:
+
+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).
+
+#+kindex: C @r{(Agenda dispatcher)}
+#+vindex: org-agenda-custom-commands
+#+cindex: agenda views, main example
+#+cindex: agenda, as an agenda views
+#+cindex: agenda*, as an agenda views
+#+cindex: tags, as an agenda view
+#+cindex: todo, as an agenda view
+#+cindex: tags-todo
+#+cindex: todo-tree
+#+cindex: occur-tree
+#+cindex: tags-tree
+Custom commands are configured in the variable
+~org-agenda-custom-commands~. You can customize this variable, for
+example by pressing {{{kbd(C)}}} from the agenda dispatcher (see [[*The
+Agenda Dispatcher]]). You can also directly set it with Emacs Lisp in
+the Emacs init file. The following example contains all valid agenda
+views:
+
+#+begin_src emacs-lisp
+(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 "\\<FIXME\\>")
+ ("h" . "HOME+Name tags searches") ;description for "h" prefix
+ ("hl" tags "+home+Lisa")
+ ("hp" tags "+home+Peter")
+ ("hk" tags "+home+Kim")))
+#+end_src
+
+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 is 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[fn:102]. 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:
+
+- {{{kbd(x)}}} ::
+
+ as a global search for agenda entries planned[fn:103] this week/day.
+
+- {{{kbd(y)}}} ::
+
+ as the same search, but only for entries with an hour specification
+ like =[h]h:mm=---think of them as appointments.
+
+- {{{kbd(w)}}} ::
+
+ as a global search for TODO entries with =WAITING= as the TODO
+ keyword.
+
+- {{{kbd(W)}}} ::
+
+ as the same search, but only in the current buffer and displaying
+ the results as a sparse tree.
+
+- {{{kbd(u)}}} ::
+
+ as a global tags search for headlines tagged =boss= but not
+ =urgent=.
+
+- {{{kbd(v)}}} ::
+
+ The same search, but limiting it to headlines that are also TODO
+ items.
+
+- {{{kbd(U)}}} ::
+
+ as the same search, but only in the current buffer and displaying
+ the result as a sparse tree.
+
+- {{{kbd(f)}}} ::
+
+ to create a sparse tree (again, current buffer only) with all
+ entries containing the word =FIXME=.
+
+- {{{kbd(h)}}} ::
+
+ as a prefix command for a =HOME= tags search where you have to press
+ an additional key ({{{kbd(l)}}}, {{{kbd(p)}}} or {{{kbd(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.
+
+*** Block agenda
+:PROPERTIES:
+:DESCRIPTION: All the stuff you need in a single buffer.
+:END:
+#+cindex: block agenda
+#+cindex: agenda, with block views
+
+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 {{{kbd(a)}}}) , ~alltodo~ for
+the global TODO list (as constructed with {{{kbd(t)}}}), ~stuck~ for
+the list of stuck projects (as obtained with {{{kbd(#)}}}) and the
+matching commands discussed above: ~todo~, ~tags~, and ~tags-todo~.
+
+Here are two examples:
+
+#+begin_src emacs-lisp
+(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")))))
+#+end_src
+
+#+texinfo: @noindent
+This defines {{{kbd(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
+{{{kbd(o)}}} provides a similar view for office tasks.
+
+*** Setting options for custom commands
+:PROPERTIES:
+:DESCRIPTION: Changing the rules.
+:ALT_TITLE: Setting options
+:END:
+#+cindex: options, for custom agenda views
+
+#+vindex: org-agenda-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:
+
+#+begin_src emacs-lisp
+(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)))))
+#+end_src
+
+#+texinfo: @noindent
+Now the {{{kbd(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
+{{{kbd(U)}}} now turns out ultra-compact, because neither the headline
+hierarchy above the match, nor the headline following the match are
+shown. The command {{{kbd(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 [[*Block
+agenda]]), let's change the sorting strategy for the {{{kbd(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:
+
+#+begin_src emacs-lisp
+(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")))))
+#+end_src
+
+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.
+
+#+vindex: org-agenda-custom-commands-contexts
+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 {{{kbd(o)}}} displaying a view that you only
+need when reading emails. Then you would configure this option like
+this:
+
+#+begin_src emacs-lisp
+(setq org-agenda-custom-commands-contexts
+ '(("o" (in-mode . "message-mode"))))
+#+end_src
+
+You can also tell that the command key {{{kbd(o)}}} should refer to
+another command key {{{kbd(r)}}}. In that case, add this command key
+like this:
+
+#+begin_src emacs-lisp
+(setq org-agenda-custom-commands-contexts
+ '(("o" "r" (in-mode . "message-mode"))))
+#+end_src
+
+See the docstring of the variable for more information.
+
+** Exporting Agenda Views
+:PROPERTIES:
+:DESCRIPTION: Writing a view to a file.
+:END:
+#+cindex: agenda views, exporting
+
+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[fn:104], Postscript,
+PDF[fn:105], and iCalendar files. If you want to do this only
+occasionally, use the following command:
+
+- {{{kbd(C-x C-w)}}} (~org-agenda-write~) ::
+ #+kindex: C-x C-w
+ #+findex: org-agenda-write
+ #+cindex: exporting agenda views
+ #+cindex: agenda views, exporting
+
+ #+vindex: org-agenda-exporter-settings
+ 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[fn:106]. 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.
+
+#+begin_src emacs-lisp
+(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"))))
+#+end_src
+
+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:
+
+- {{{kbd(e)}}} (~org-store-agenda-views~) ::
+
+ #+kindex: e @r{(Agenda dispatcher)}
+ #+findex: 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:
+
+#+begin_src emacs-lisp
+(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"))))
+#+end_src
+
+#+texinfo: @noindent
+#+vindex: org-agenda-exporter-settings
+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.,
+
+#+begin_src emacs-lisp
+(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)))
+#+end_src
+
+#+texinfo: @noindent
+but the settings in ~org-agenda-custom-commands~ take precedence.
+
+From the command line you may also use:
+
+#+begin_src shell
+emacs -eval (org-batch-store-agenda-views) -kill
+#+end_src
+
+#+texinfo: @noindent
+or, if you need to modify some parameters[fn:107]
+
+#+begin_src shell
+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
+#+end_src
+
+#+texinfo: @noindent
+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 [[*Extracting Agenda Information]], for
+more information.
+
+** Using Column View in the Agenda
+:PROPERTIES:
+:DESCRIPTION: Using column view for collected entries.
+:ALT_TITLE: Agenda Column View
+:END:
+#+cindex: column view, in agenda
+#+cindex: agenda, column view
+
+Column view (see [[*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.
+
+- {{{kbd(C-c C-x C-c)}}} (~org-agenda-columns~) ::
+ #+kindex: C-c C-x C-c
+ #+findex: 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.
+ #+vindex: org-columns-default-format-for-agenda
+ #+vindex: org-columns-default-format
+ 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
+ ~org-overriding-columns-format~ is currently set, and if so, takes
+ the format from there. You should set this variable only in the
+ /local settings section/ of a custom agenda command (see [[*Custom
+ Agenda Views]]) to make it valid for that specific agenda view. If
+ no such binding exists, it checks, in sequence,
+ ~org-columns-default-format-for-agenda~, the format associated with
+ the first item in the agenda (through a property or a =#+COLUMNS=
+ setting in that buffer) and finally ~org-columns-default-format~.
+
+2.
+ #+cindex: @samp{CLOCKSUM}, special property
+ If any of the columns has a summary type defined (see [[*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 {{{kbd(R)}}} in the agenda).
+
+4.
+ #+cindex: @samp{CLOCKSUM_T}, special property
+ 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.
+
+* Markup for Rich Contents
+:PROPERTIES:
+:DESCRIPTION: Compose beautiful documents.
+:END:
+
+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
+[[*Exporting]]), you can author beautiful documents in Org---like the fine
+manual you are currently reading.
+
+** Paragraphs
+:PROPERTIES:
+:DESCRIPTION: The basic unit of text.
+:END:
+
+#+cindex: paragraphs, markup rules
+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.
+
+#+cindex: line breaks, markup rules
+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.
+
+#+cindex: @samp{BEGIN_VERSE}
+#+cindex: verse blocks
+#+begin_example
+,#+BEGIN_VERSE
+ Great clouds overhead
+ Tiny black birds rise and fall
+ Snow covers Emacs
+
+ ---AlexSchroeder
+,#+END_VERSE
+#+end_example
+
+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:
+
+#+cindex: @samp{BEGIN_QUOTE}
+#+cindex: quote blocks
+#+begin_example
+,#+BEGIN_QUOTE
+Everything should be made as simple as possible,
+but not any simpler ---Albert Einstein
+,#+END_QUOTE
+#+end_example
+
+If you would like to center some text, do it like this:
+
+#+cindex: @samp{BEGIN_CENTER}
+#+cindex: center blocks
+#+begin_example
+,#+BEGIN_CENTER
+Everything should be made as simple as possible, \\
+but not any simpler
+,#+END_CENTER
+#+end_example
+
+** Emphasis and Monospace
+:PROPERTIES:
+:DESCRIPTION: Bold, italic, etc.
+:END:
+#+cindex: underlined text, markup rules
+#+cindex: bold text, markup rules
+#+cindex: italic text, markup rules
+#+cindex: verbatim text, markup rules
+#+cindex: code text, markup rules
+#+cindex: strike-through text, markup rules
+
+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 specific syntax; it is
+exported verbatim.
+
+#+vindex: org-fontify-emphasized-text
+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~.
+
+Sometimes, when marked text also contains the marker character itself,
+the result may be unsettling. For example,
+
+#+begin_example
+/One may expect this whole sentence to be italicized, but the
+following ~user/?variable~ contains =/= character, which effectively
+stops emphasis there./
+#+end_example
+
+You can use zero width space to help Org sorting out the ambiguity.
+See [[*Escape Character]] for more details.
+
+** Subscripts and Superscripts
+:PROPERTIES:
+:DESCRIPTION: Simple syntax for raising/lowering text.
+:END:
+#+cindex: subscript
+#+cindex: superscript
+
+=^= 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
+
+#+begin_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}.
+#+end_example
+
+#+vindex: org-use-sub-superscripts
+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.
+
+You can set ~org-use-sub-superscripts~ in a file using the export
+option =^:= (see [[*Export Settings][Export Settings]]). For example, =#+OPTIONS: ^:{}=
+sets ~org-use-sub-superscripts~ to ~{}~ and limits super- and
+subscripts to the curly bracket notation.
+
+You can also toggle the visual display of super- and subscripts:
+
+- {{{kbd(C-c C-x \)}}} (~org-toggle-pretty-entities~) ::
+
+ #+kindex: C-c C-x \
+ #+findex: org-toggle-pretty-entities
+ This command formats sub- and superscripts in a WYSIWYM way.
+
+#+vindex: org-pretty-entities
+#+vindex: org-pretty-entities-include-sub-superscripts
+Set both ~org-pretty-entities~ and
+~org-pretty-entities-include-sub-superscripts~ to ~t~ to start with
+super- and subscripts /visually/ interpreted as specified by the
+option ~org-use-sub-superscripts~.
+
+** Special Symbols
+:PROPERTIES:
+:DESCRIPTION: Greek letters and other symbols.
+:END:
+#+cindex: math symbols
+#+cindex: special symbols
+#+cindex: entities
+
+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 {{{kbd(M-TAB)}}} to see possible
+completions. If you need such a symbol inside a word, terminate it
+with a pair of curly brackets. For example
+
+#+begin_example
+Pro tip: Given a circle \Gamma of diameter d, the length of its
+circumference is \pi{}d.
+#+end_example
+
+#+findex: org-entities-help
+#+vindex: org-entities-user
+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 =&alpha;= in
+the HTML output, and as =\(\alpha\)= in the LaTeX output. Similarly, =\nbsp=
+becomes =&nbsp;= in HTML and =~= in LaTeX.
+
+#+cindex: special symbols, in-buffer display
+If you would like to see entities displayed as UTF-8 characters, use
+the following command[fn:108]:
+
+- {{{kbd(C-c C-x \)}}} (~org-toggle-pretty-entities~) ::
+ #+kindex: C-c C-x \
+ #+findex: 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.
+
+#+cindex: shy hyphen, special symbol
+#+cindex: dash, special symbol
+#+cindex: ellipsis, special symbol
+In addition to regular entities defined above, Org exports in
+a special way[fn:109] the following commonly used character
+combinations: =\-= is treated as a shy hyphen, =--= and =---= are
+converted into dashes, and =...= becomes a compact set of dots.
+
+** Embedded LaTeX
+:PROPERTIES:
+:DESCRIPTION: LaTeX can be freely used inside Org documents.
+:END:
+#+cindex: @TeX{} interpretation
+#+cindex: @LaTeX{} interpretation
+
+Plain ASCII is normally sufficient for almost all note taking.
+Exceptions include scientific notes, which often require mathematical
+symbols and the occasional formula. LaTeX[fn:110] 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.
+
+*** LaTeX fragments
+:PROPERTIES:
+:DESCRIPTION: Complex formulas made easy.
+:END:
+#+cindex: @LaTeX{} fragments
+
+#+vindex: org-format-latex-header
+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
+[[https://www.mathjax.org][MathJax]] (see [[*Math formatting in HTML export]]) or transcode the math
+into images (see [[*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[fn:111]. 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.
+
+#+texinfo: @noindent
+For example:
+
+#+begin_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} \].
+#+end_example
+
+#+vindex: org-export-with-latex
+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 |
+
+*** Previewing LaTeX fragments
+:PROPERTIES:
+:DESCRIPTION: What will this snippet look like?
+:END:
+#+cindex: @LaTeX{} fragments, preview
+
+#+vindex: org-preview-latex-default-process
+If you have a working LaTeX installation and =dvipng=, =dvisvgm= or
+=convert= installed[fn:112], LaTeX fragments can be processed to
+produce images of the typeset expressions to be used for inclusion
+while exporting to HTML (see [[*LaTeX fragments]]), or for inline
+previewing within Org mode.
+
+#+vindex: org-format-latex-options
+#+vindex: org-format-latex-header
+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.
+
+- {{{kbd(C-c C-x C-l)}}} (~org-latex-preview~) ::
+ #+kindex: C-c C-x C-l
+ #+findex: org-latex-preview
+
+ 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 single prefix argument, clear all images in the
+ current entry. Two prefix arguments produce a preview image for all
+ fragments in the buffer, while three of them clear all the images in
+ that buffer.
+
+#+vindex: org-startup-with-latex-preview
+You can turn on the previewing of all LaTeX fragments in a file with
+
+: #+STARTUP: latexpreview
+
+To disable it, simply use
+
+: #+STARTUP: nolatexpreview
+
+*** Using CDLaTeX to enter math
+:PROPERTIES:
+:DESCRIPTION: Speed up entering of formulas.
+:ALT_TITLE: CDLaTeX mode
+:END:
+#+cindex: CD@LaTeX{}
+
+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)
+using [[https://melpa.org/][MELPA]] with the [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html][Emacs packaging system]] or alternatively from
+[[https://staff.fnwi.uva.nl/c.dominik/Tools/cdlatex/]]. Do not use
+CDLaTeX mode itself under Org mode, but use the special version Org
+CDLaTeX minor mode that comes as part of Org. Turn it on for the
+current buffer with {{{kbd(M-x org-cdlatex-mode)}}}, or for all Org
+files with
+
+#+begin_src emacs-lisp
+(add-hook 'org-mode-hook #'turn-on-org-cdlatex)
+#+end_src
+
+When this mode is enabled, the following features are present (for
+more details see the documentation of CDLaTeX mode):
+
+#+attr_texinfo: :sep ,
+- {{{kbd(C-c {)}}} ::
+ #+kindex: C-c @{
+
+ Insert an environment template.
+
+- {{{kbd(TAB)}}} ::
+ #+kindex: TAB
+
+ The {{{kbd(TAB)}}} key expands the template if point is inside
+ a LaTeX fragment[fn:113]. For example, {{{kbd(TAB)}}} expands =fr=
+ to =\frac{}{}= and position point correctly inside the first brace.
+ Another {{{kbd(TAB)}}} gets you into the second brace.
+
+ Even outside fragments, {{{kbd(TAB)}}} expands environment
+ abbreviations at the beginning of a line. For example, if you write
+ =equ= at the beginning of a line and press {{{kbd(TAB)}}}, this
+ abbreviation is expanded to an =equation= environment. To get
+ a list of all abbreviations, type {{{kbd(M-x
+ cdlatex-command-help)}}}.
+
+- {{{kbd(^)}}}, {{{kbd(_)}}} ::
+ #+kindex: _
+ #+kindex: ^
+ #+vindex: cdlatex-simplify-sub-super-scripts
+
+ Pressing {{{kbd(_)}}} and {{{kbd(^)}}} inside a LaTeX fragment
+ inserts these characters together with a pair of braces. If you use
+ {{{kbd(TAB)}}} 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~).
+
+- {{{kbd(`)}}} ::
+ #+kindex: `
+
+ 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.
+
+- {{{kbd(')}}} ::
+ #+kindex: '
+
+ 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.
+
+** Literal Examples
+:PROPERTIES:
+:DESCRIPTION: Source code examples with special formatting.
+:END:
+#+cindex: literal examples, markup rules
+#+cindex: code line references, markup rules
+
+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.
+
+#+cindex: @samp{BEGIN_EXAMPLE}
+#+cindex: example block
+#+begin_example
+,#+BEGIN_EXAMPLE
+ Some example from a text file.
+,#+END_EXAMPLE
+#+end_example
+
+#+cindex: comma escape, in literal examples
+There is one limitation, however. You must insert a comma right
+before lines starting with either =*=, =,*=, =#+= or =,#+=, as those
+may be interpreted as outlines nodes or some other special syntax.
+Org transparently strips these additional commas whenever it accesses
+the contents of the block.
+
+#+begin_example
+,#+BEGIN_EXAMPLE
+,,* I am no real headline
+,#+END_EXAMPLE
+#+end_example
+
+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:
+
+#+begin_example
+Here is an example
+ : Some example from a text file.
+#+end_example
+
+#+cindex: formatting source code, markup rules
+#+vindex: org-latex-listings
+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[fn:114]. 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[fn:115],
+see [[*Structure Templates]] for shortcuts to easily insert code blocks.
+
+#+cindex: @samp{BEGIN_SRC}
+#+cindex: source block
+#+begin_example
+,#+BEGIN_SRC emacs-lisp
+ (defun org-xor (a b)
+ "Exclusive or."
+ (if a (not b) b))
+ ,#+END_SRC
+#+end_example
+
+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_example
+,#+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
+#+end_example
+
+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[fn:116]. 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_example -l "(dumb-reference:%s)"
+,#+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.
+#+end_example
+
+#+cindex: indentation, in source blocks
+Source code and examples may be /indented/ in order to align nicely
+with the surrounding text, and in particular with plain list structure
+(see [[*Plain Lists]]). By default, Org only retains the relative
+indentation between lines, e.g., when exporting the contents of the
+block. However, you can use the =-i= switch to also preserve the
+global indentation, if it does matter. See [[*Editing Source Code]].
+
+#+vindex: org-coderef-label-format
+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))"
+
+#+texinfo: @noindent
+See also the variable ~org-coderef-label-format~.
+
+HTML export also allows examples to be published as text areas (see
+[[*Text areas in HTML export]]).
+
+Because the =#+BEGIN= ... =#+END= patterns need to be added so often,
+a shortcut is provided (see [[*Structure Templates]]).
+
+- {{{kbd(C-c ')}}} (~org-edit-special~) ::
+
+ #+kindex: C-c '
+ #+findex: 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 {{{kbd(C-c ')}}} again. 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[fn:117] to allow creating
+ ASCII drawings easily. Using this command in an empty line creates
+ a new fixed-width region.
+
+#+cindex: storing link, in a source code buffer
+Calling ~org-store-link~ (see [[*Handling Links]]) while editing a source
+code example in a temporary buffer created with {{{kbd(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 {{{kbd(C-c C-l)}}}.
+
+** Images
+:PROPERTIES:
+:DESCRIPTION: Display an image.
+:END:
+
+#+cindex: inlining images
+#+cindex: images, markup rules
+An image is a link to an image file[fn:118] that does not have
+a description part, for example
+
+: ./img/cat.jpg
+
+If you wish to define a caption for the image (see [[*Captions]]) and
+maybe a label for internal cross references (see [[*Internal Links]]),
+make sure that the link is on a line by itself and precede it with
+=CAPTION= and =NAME= keywords as follows:
+
+#+begin_example
+,#+CAPTION: This is the caption for the next figure link (or table)
+,#+NAME: fig:SED-HR4049
+[[./img/a.jpg]]
+#+end_example
+
+Such images can be displayed within the buffer with the following
+command:
+
+- {{{kbd(C-c C-x C-v)}}} (~org-toggle-inline-images~) ::
+
+ #+kindex: C-c C-x C-v
+ #+findex: org-toggle-inline-images
+ #+vindex: org-startup-with-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~[fn:119].
+
+** Captions
+:PROPERTIES:
+:DESCRIPTION: Describe tables, images...
+:END:
+#+cindex: captions, markup rules
+#+cindex: @samp{CAPTION}, keyword
+
+You can assign a caption to a specific part of a document by inserting
+a =CAPTION= keyword immediately before it:
+
+#+begin_example
+,#+CAPTION: This is the caption for the next table (or link)
+| ... | ... |
+|-----+-----|
+#+end_example
+
+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.
+
+** Horizontal Rules
+:PROPERTIES:
+:DESCRIPTION: Make a line.
+:END:
+
+#+cindex: horizontal rules, markup rules
+A line consisting of only dashes, and at least 5 of them, is exported
+as a horizontal line.
+
+** Creating Footnotes
+:PROPERTIES:
+:DESCRIPTION: Edit and read footnotes.
+:END:
+#+cindex: 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:
+
+#+begin_example
+The Org homepage[fn:1] now looks a lot better than it used to.
+...
+[fn:1] The link is: https://orgmode.org
+#+end_example
+
+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 {{{var(NAME)}}} is a unique
+ label word, or, for simplicity of automatic creation, a number.
+
+- =[fn:: This is the inline definition of this footnote]= ::
+
+ An 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.
+
+#+vindex: org-footnote-auto-label
+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:
+
+- {{{kbd(C-c C-x f)}}} ::
+
+ The footnote action command.
+
+ #+kindex: C-c C-x f
+ When point is on a footnote reference, jump to the definition. When
+ it is at a definition, jump to the---first---reference.
+
+ #+vindex: org-footnote-define-inline
+ #+vindex: org-footnote-section
+ Otherwise, create a new footnote. Depending on the variable
+ ~org-footnote-define-inline~[fn:120], 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:
+
+ #+attr_texinfo: :columns 0.1 0.9
+ | {{{kbd(s)}}} | Sort the footnote definitions by reference sequence. |
+ | {{{kbd(r)}}} | Renumber the simple =fn:N= footnotes. |
+ | {{{kbd(S)}}} | Short for first {{{kbd(r)}}}, then {{{kbd(s)}}} action. |
+ | {{{kbd(n)}}} | Rename all footnotes into a =fn:1= ... =fn:n= sequence. |
+ | {{{kbd(d)}}} | Delete the footnote at point, including definition and references. |
+
+ #+vindex: org-footnote-auto-adjust
+ Depending on the variable ~org-footnote-auto-adjust~[fn:121],
+ renumbering and sorting footnotes can be automatic after each
+ insertion or deletion.
+
+- {{{kbd(C-c C-c)}}} ::
+
+ #+kindex: 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
+ {{{kbd(C-c C-x f)}}}.
+
+- {{{kbd(C-c C-o)}}} or {{{kbd(mouse-1/2)}}} ::
+
+ #+kindex: C-c C-o
+ #+kindex: mouse-1
+ #+kindex: mouse-2
+ Footnote labels are also links to the corresponding definition or
+ reference, and you can use the usual commands to follow these links.
+
+* Exporting
+:PROPERTIES:
+:DESCRIPTION: Sharing and publishing notes.
+:END:
+#+cindex: 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 [[*Document Structure]]) and markup (see [[*Markup for Rich
+Contents]]) as possible.
+
+#+cindex: export back-end
+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 {{{var(NAME)}}} is a format. For
+example, ~ox-koma-letter~ for /koma-letter/ back-end. More libraries
+can be found in the =org-contrib= repository (see [[*Installation]]).
+
+#+vindex: org-export-backends
+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:
+
+#+begin_src emacs-lisp
+(require 'ox-md)
+#+end_src
+
+** The Export Dispatcher
+:PROPERTIES:
+:DESCRIPTION: The main interface.
+:END:
+#+cindex: dispatcher, for export commands
+#+cindex: 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.
+
+#+vindex: org-export-dispatch-use-expert-ui
+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 {{{kbd(?)}}}.
+
+- {{{kbd(C-c C-e)}}} (~org-export~) ::
+ #+kindex: C-c C-e
+ #+findex: org-export
+
+ Invokes the export dispatcher interface. The options show default
+ settings. The {{{kbd(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.
+
+- {{{kbd(C-a)}}} ::
+ #+kindex: C-c C-e 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
+ {{{kbd(C-u)}}} prefix argument. If already in the export dispatcher
+ menu, {{{kbd(&)}}} displays the stack.
+
+ #+vindex: org-export-in-background
+ You can make asynchronous export the default by setting
+ ~org-export-in-background~.
+
+ #+vindex: org-export-async-init-file
+ You can set the initialization file used by the background process
+ by setting ~org-export-async-init-file~.
+
+- {{{kbd(C-b)}}} ::
+ #+kindex: C-c C-e 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 =<head>...</head>= in HTML.
+
+- {{{kbd(C-s)}}} ::
+ #+kindex: C-c C-e 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.
+
+ #+vindex: org-export-initial-scope
+ To make sub-tree export the default, customize the variable
+ ~org-export-initial-scope~.
+
+- {{{kbd(C-v)}}} ::
+ #+kindex: C-c C-e 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. See also [[*Sparse Trees]].
+
+** Export Settings
+:PROPERTIES:
+:DESCRIPTION: Common export settings.
+:END:
+#+cindex: options, for export
+#+cindex: Export, settings
+
+#+cindex: @samp{OPTIONS}, keyword
+Export options can be set: globally with variables; for an individual
+file by making variables buffer-local with in-buffer settings (see
+[[*Summary of 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 [[*Properties and Columns]]). Options
+set at a specific level override options set at a more general level.
+
+#+cindex: @samp{SETUPFILE}, keyword
+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 [[*The Export
+Dispatcher]]) using the =Insert template= command by pressing
+{{{kbd(#)}}}. To insert keywords individually, a good way to make
+sure the keyword is correct is to type =#+= and then to use
+{{{kbd(M-TAB)}}}[fn:16] for completion.
+
+The export keywords available for every back-end, and their equivalent
+global variables, include:
+
+- =AUTHOR= ::
+
+ #+cindex: @samp{AUTHOR}, keyword
+ #+vindex: user-full-name
+ The document author (~user-full-name~).
+
+- =CREATOR= ::
+
+ #+cindex: @samp{CREATOR}, keyword
+ #+vindex: org-expot-creator-string
+ Entity responsible for output generation
+ (~org-export-creator-string~).
+
+- =DATE= ::
+
+ #+cindex: @samp{DATE}, keyword
+ #+vindex: org-export-date-timestamp-format
+ A date or a time-stamp[fn:122].
+
+- =EMAIL= ::
+
+ #+cindex: @samp{EMAIL}, keyword
+ #+vindex: user-mail-address
+ The email address (~user-mail-address~).
+
+- =LANGUAGE= ::
+
+ #+cindex: @samp{LANGUAGE}, keyword
+ #+vindex: org-export-default-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=[fn:123].
+
+- =SELECT_TAGS= ::
+
+ #+cindex: @samp{SELECT_TAGS}, keyword
+ #+vindex: org-export-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= ::
+
+ #+cindex: @samp{EXCLUDE_TAGS}, keyword
+ #+vindex: org-export-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= ::
+
+ #+cindex: @samp{TITLE}, keyword
+ #+cindex: document title
+ Org displays this title. For long titles, use multiple =#+TITLE=
+ lines.
+
+- =EXPORT_FILE_NAME= ::
+
+ #+cindex: @samp{EXPORT_FILE_NAME}, keyword
+ 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.
+
+- ~'~ ::
+
+ #+vindex: org-export-with-smart-quotes
+ 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.
+
+- ~*~ ::
+
+ #+vindex: org-export-with-emphasize
+ Toggle emphasized text (~org-export-with-emphasize~).
+
+- ~-~ ::
+
+ #+vindex: org-export-with-special-strings
+ Toggle conversion of special strings
+ (~org-export-with-special-strings~).
+
+- ~:~ ::
+
+ #+vindex: org-export-with-fixed-width
+ Toggle fixed-width sections (~org-export-with-fixed-width~).
+
+- ~<~ ::
+
+ #+vindex: org-export-with-timestamps
+ Toggle inclusion of time/date active/inactive stamps
+ (~org-export-with-timestamps~).
+
+- ~\n~ ::
+
+ #+vindex: org-export-preserve-breaks
+ Toggles whether to preserve line breaks
+ (~org-export-preserve-breaks~).
+
+- ~^~ ::
+
+ #+vindex: org-export-with-sub-superscripts
+ 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~ ::
+
+ #+vindex: org-export-with-archived-trees
+ 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~ ::
+
+ #+vindex: org-export-with-author
+ Toggle inclusion of author name into exported file
+ (~org-export-with-author~).
+
+- ~broken-links~ ::
+
+ #+vindex: org-export-with-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~ ::
+
+ #+vindex: org-export-with-clocks
+ Toggle inclusion of =CLOCK= keywords (~org-export-with-clocks~).
+
+- ~creator~ ::
+
+ #+vindex: org-export-with-creator
+ Toggle inclusion of creator information in the exported file
+ (~org-export-with-creator~).
+
+- ~d~ ::
+
+ #+vindex: org-export-with-drawers
+ Toggles inclusion of drawers, or list of drawers to include, or list
+ of drawers to exclude (~org-export-with-drawers~).
+
+- ~date~ ::
+
+ #+vindex: org-export-with-date
+ Toggle inclusion of a date into exported file
+ (~org-export-with-date~).
+
+- ~e~ ::
+
+ #+vindex: org-export-with-entities
+ Toggle inclusion of entities (~org-export-with-entities~).
+
+- ~email~ ::
+
+ #+vindex: org-export-with-email
+ Toggle inclusion of the author's e-mail into exported file
+ (~org-export-with-email~).
+
+- ~f~ ::
+
+ #+vindex: org-export-with-footnotes
+ Toggle the inclusion of footnotes (~org-export-with-footnotes~).
+
+- ~H~ ::
+
+ #+vindex: org-export-headline-levels
+ 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~ ::
+
+ #+vindex: org-export-with-inlinetasks
+ Toggle inclusion of inlinetasks (~org-export-with-inlinetasks~).
+
+- ~num~ ::
+
+ #+vindex: org-export-with-section-numbers
+ #+cindex: @samp{UNNUMBERED}, property
+ 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 [[*Table of Contents]]).
+
+- ~p~ ::
+
+ #+vindex: org-export-with-planning
+ 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~ ::
+
+ #+vindex: org-export-with-priority
+ Toggle inclusion of priority cookies
+ (~org-export-with-priority~).
+
+- ~prop~ ::
+
+ #+vindex: org-export-with-properties
+ Toggle inclusion of property drawers, or list the properties to
+ include (~org-export-with-properties~).
+
+- ~stat~ ::
+
+ #+vindex: org-export-with-statistics-cookies
+ Toggle inclusion of statistics cookies
+ (~org-export-with-statistics-cookies~).
+
+- ~tags~ ::
+
+ #+vindex: org-export-with-tags
+ Toggle inclusion of tags, may also be ~not-in-toc~
+ (~org-export-with-tags~).
+
+- ~tasks~ ::
+
+ #+vindex: org-export-with-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~ ::
+
+ #+vindex: org-export-with-latex
+ ~nil~ does not export; ~t~ exports; ~verbatim~ keeps everything in
+ verbatim (~org-export-with-latex~).
+
+- ~timestamp~ ::
+
+ #+vindex: org-export-time-stamp-file
+ Toggle inclusion of the creation time in the exported file
+ (~org-export-time-stamp-file~).
+
+- ~title~ ::
+
+ #+vindex: org-export-with-title
+ Toggle inclusion of title (~org-export-with-title~).
+
+- ~toc~ ::
+
+ #+vindex: org-export-with-toc
+ Toggle inclusion of the table of contents, or set the level limit
+ (~org-export-with-toc~).
+
+- ~todo~ ::
+
+ #+vindex: org-export-with-todo-keywords
+ Toggle inclusion of TODO keywords into exported text
+ (~org-export-with-todo-keywords~).
+
+- ~|~ ::
+
+ #+vindex: org-export-with-tables
+ 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.
+
+#+cindex: @samp{BIND}, keyword
+#+vindex: org-export-allow-bind-keywords
+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.
+
+** Table of Contents
+:PROPERTIES:
+:DESCRIPTION: The if and where of the table of contents.
+:END:
+#+cindex: table of contents
+#+cindex: list of tables
+#+cindex: list of listings
+
+#+cindex: @samp{toc}, in @samp{OPTIONS} keyword
+#+vindex: org-export-with-toc
+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:
+
+#+begin_example
+,#+OPTIONS: toc:2 (only include two levels in TOC)
+,#+OPTIONS: toc:nil (no default TOC at all)
+#+end_example
+
+#+cindex: excluding entries from table of contents
+#+cindex: table of contents, exclude entries
+Org includes both numbered and unnumbered headlines in the table of
+contents[fn:124]. If you need to exclude an unnumbered headline,
+along with all its children, set the =UNNUMBERED= property to =notoc=
+value.
+
+#+begin_example
+,* Subtree not numbered, not in table of contents either
+ :PROPERTIES:
+ :UNNUMBERED: notoc
+ :END:
+#+end_example
+
+#+cindex: @samp{TOC}, keyword
+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).
+
+#+begin_example
+,#+OPTIONS: toc:nil
+...
+,#+TOC: headlines 2
+#+end_example
+
+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.
+
+#+begin_example
+,* Section
+,#+TOC: headlines 1 local
+#+end_example
+
+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.
+
+The following example inserts a table of contents that links to the
+children of the specified target.
+
+#+begin_example
+,* Target
+ :PROPERTIES:
+ :CUSTOM_ID: TargetSection
+ :END:
+,** Heading A
+,** Heading B
+,* Another section
+,#+TOC: headlines 1 :target #TargetSection
+#+end_example
+
+The =:target= attribute is supported in HTML, Markdown, ODT, and ASCII export.
+
+Use the =TOC= keyword to generate list of tables---respectively, all
+listings---with captions.
+
+#+begin_example
+,#+TOC: listings
+,#+TOC: tables
+#+end_example
+
+#+cindex: @samp{ALT_TITLE}, property
+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.
+
+** Include Files
+:PROPERTIES:
+:DESCRIPTION: Include additional files into a document.
+:END:
+#+cindex: include files, during export
+#+cindex: export, include files
+#+cindex: @samp{INCLUDE}, keyword
+
+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
+
+#+texinfo: @noindent
+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.
+
+#+cindex: @samp{minlevel}, include
+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 [[*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
+
+#+cindex: @samp{lines}, include
+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~[fn:125] (see [[*Search Options in File Links]]). The
+ranges for =:lines= keyword are relative to the requested element.
+Therefore,
+
+: #+INCLUDE: "./paper.org::*conclusion" :lines 1-20
+
+#+texinfo: @noindent
+includes the first 20 lines of the headline named =conclusion=.
+
+#+cindex: @samp{only-contents}, include
+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 to the included document:
+
+- {{{kbd(C-c ')}}} (~org-edit~special~) ::
+ #+kindex: C-c '
+ #+findex: org-edit-special
+
+ Visit the included file at point.
+
+** Macro Replacement
+:PROPERTIES:
+:DESCRIPTION: Use macros to create templates.
+:END:
+#+cindex: macro replacement, during export
+#+cindex: @samp{MACRO}, keyword
+
+#+vindex: org-export-global-macros
+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
+
+#+texinfo: @noindent
+which can be referenced using ={{{name(arg1, arg2)}}}=[fn:126]. For
+example
+
+#+begin_example
+,#+MACRO: poem Rose is $1, violet's $2. Life's ordered: Org assists you.
+{{{poem(red,blue)}}}
+#+end_example
+
+#+texinfo: @noindent
+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)))
+
+#+texinfo: @noindent
+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:
+
+#+attr_texinfo: :sep ;
+- ={{{keyword(NAME)}}}=; ={{{title}}}=; ={{{author}}}=; ={{{email}}}= ::
+
+ #+cindex: @samp{keyword}, macro
+ #+cindex: @samp{title}, macro
+ #+cindex: @samp{author}, macro
+ #+cindex: @samp{email}, macro
+ The =keyword= macro collects all values from {{{var(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)}}}= ::
+
+ #+cindex: @samp{date}, macro
+ This macro refers to the =DATE= keyword. {{{var(FORMAT)}}} is an
+ optional argument to the =date= macro that is used only if =DATE= is
+ a single timestamp. {{{var(FORMAT)}}} should be a format string
+ understood by ~format-time-string~.
+
+- ={{{time(FORMAT)}}}=; ={{{modification-time(FORMAT, VC)}}}= ::
+
+ #+cindex: @samp{time}, macro
+ #+cindex: @samp{modification-time}, macro
+ These macros refer to the document's date and time of export and
+ date and time of modification. {{{var(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}}}= ::
+
+ #+cindex: @samp{input-file}, macro
+ This macro refers to the filename of the exported file.
+
+- ={{{property(PROPERTY-NAME)}}}=; ={{{property(PROPERTY-NAME, SEARCH OPTION)}}}= ::
+
+ #+cindex: @samp{property}, macro
+ This macro returns the value of property {{{var(PROPERTY-NAME)}}} in
+ the current entry. If {{{var(SEARCH-OPTION)}}} (see [[*Search
+ Options in File Links]]) refers to a remote entry, use it instead.
+
+- ={{{n}}}=; ={{{n(NAME)}}}=; ={{{n(NAME, ACTION)}}}= ::
+
+ #+cindex: @samp{n}, macro
+ #+cindex: counter, macro
+ 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 {{{var(NAME)}}}
+ values. If {{{var(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 {{{var(NAME)}}} empty to reset the default
+ counter.
+
+#+cindex: @samp{results}, macro
+Moreover, inline source blocks (see [[*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.
+
+#+vindex: org-hide-macro-markers
+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.
+
+** Comment Lines
+:PROPERTIES:
+:DESCRIPTION: What will not be exported.
+:END:
+#+cindex: exporting, not
+
+#+cindex: 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.
+
+#+cindex: @samp{BEGIN_COMMENT}
+#+cindex: comment block
+Likewise, regions surrounded by =#+BEGIN_COMMENT= ... =#+END_COMMENT=
+are not exported.
+
+#+cindex: comment trees
+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[fn:127]. The command below helps changing the
+comment status of a headline.
+
+- {{{kbd(C-c ;)}}} (~org-toggle-comment~) ::
+ #+kindex: C-c ;
+ #+findex: org-toggle-comment
+
+ Toggle the =COMMENT= keyword at the beginning of an entry.
+
+** ASCII/Latin-1/UTF-8 export
+:PROPERTIES:
+:DESCRIPTION: Exporting to flat files with encoding.
+:END:
+#+cindex: ASCII export
+#+cindex: Latin-1 export
+#+cindex: 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.
+
+#+vindex: org-ascii-text-width
+On export, Org fills and justifies text according to the text width
+set in ~org-ascii-text-width~.
+
+#+vindex: org-ascii-links-to-notes
+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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+attr_texinfo: :sep ,
+- {{{kbd(C-c C-e t a)}}} (~org-ascii-export-to-ascii~), {{{kbd(C-c C-e t l)}}}, {{{kbd(C-c C-e t u)}}} ::
+ #+kindex: C-c C-e t a
+ #+kindex: C-c C-e t l
+ #+kindex: C-c C-e t u
+ #+findex: 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.
+
+- {{{kbd(C-c C-e t A)}}} (~org-ascii-export-to-ascii~), {{{kbd(C-c C-e t L)}}}, {{{kbd(C-c C-e t U)}}} ::
+ #+kindex: C-c C-e t A
+ #+kindex: C-c C-e t L
+ #+kindex: C-c C-e t U
+ #+findex: org-ascii-export-as-ascii
+
+ Export to a temporary buffer. Does not create a file.
+
+*** ASCII specific export settings
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+The ASCII export back-end has one extra keyword for customizing ASCII
+output. Setting this keyword works similar to the general options
+(see [[*Export Settings]]).
+
+- =SUBTITLE= ::
+
+ #+cindex: @samp{SUBTITLE}, keyword
+ 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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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 [[*Export Settings]].
+
+*** Quoting ASCII text
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+To insert text within the Org file by the ASCII back-end, use one the
+following constructs, inline, keyword, or export block:
+
+#+cindex: @samp{ASCII}, keyword
+#+cindex: @samp{BEGIN_EXPORT ascii}
+#+begin_example
+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
+#+end_example
+
+*** ASCII specific attributes
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: @samp{ATTR_ASCII}, keyword
+#+cindex: horizontal rules, in ASCII export
+
+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:
+
+#+begin_example
+,#+ATTR_ASCII: :width 10
+-----
+#+end_example
+
+*** ASCII special blocks
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+cindex: special blocks, in ASCII export
+#+cindex: @samp{BEGIN_JUSTIFYLEFT}
+#+cindex: @samp{BEGIN_JUSTIFYRIGHT}
+
+Besides =#+BEGIN_CENTER= blocks (see [[*Paragraphs]]), ASCII back-end has
+these two left and right justification blocks:
+
+#+begin_example
+,#+BEGIN_JUSTIFYLEFT
+It's just a jump to the left...
+,#+END_JUSTIFYLEFT
+
+,#+BEGIN_JUSTIFYRIGHT
+...and then a step to the right.
+,#+END_JUSTIFYRIGHT
+#+end_example
+
+** Beamer Export
+:PROPERTIES:
+:DESCRIPTION: Producing presentations and slides.
+:END:
+#+cindex: 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.
+
+*** Beamer export commands
+:PROPERTIES:
+:DESCRIPTION: For creating Beamer documents.
+:END:
+
+- {{{kbd(C-c C-e l b)}}} (~org-beamer-export-to-latex~) ::
+ #+kindex: C-c C-e l b
+ #+findex: org-beamer-export-to-latex
+
+ Export as LaTeX file with a =.tex= extension. For =myfile.org=, Org
+ exports to =myfile.tex=, overwriting without warning.
+
+- {{{kbd(C-c C-e l B)}}} (~org-beamer-export-as-latex~) ::
+ #+kindex: C-c C-e l B
+ #+findex: org-beamer-export-as-latex
+
+ Export to a temporary buffer. Does not create a file.
+
+- {{{kbd(C-c C-e l P)}}} (~org-beamer-export-to-pdf~) ::
+ #+kindex: C-c C-e l P
+ #+findex: org-beamer-export-to-pdf
+
+ Export as LaTeX file and then convert it to PDF format.
+
+- {{{kbd(C-c C-e l O)}}} ::
+ #+kindex: C-c C-e l O
+
+ Export as LaTeX file, convert it to PDF format, and then open the
+ PDF file.
+
+*** Beamer specific export settings
+:PROPERTIES:
+:DESCRIPTION: For customizing Beamer export.
+:END:
+
+Beamer export back-end has several additional keywords for customizing
+Beamer output. These keywords work similar to the general options
+settings (see [[*Export Settings]]).
+
+- =BEAMER_THEME= ::
+
+ #+cindex: @samp{BEAMER_THEME}, keyword
+ #+vindex: org-beamer-theme
+ The Beamer layout theme (~org-beamer-theme~). Use square brackets
+ for options. For example:
+
+ : #+BEAMER_THEME: Rochester [height=20pt]
+
+- =BEAMER_FONT_THEME= ::
+
+ #+cindex: @samp{BEAMER_FONT_THEME}, keyword
+ The Beamer font theme.
+
+- =BEAMER_INNER_THEME= ::
+
+ #+cindex: @samp{BEAMER_INNER_THEME}, keyword
+ The Beamer inner theme.
+
+- =BEAMER_OUTER_THEME= ::
+
+ #+cindex: @samp{BEAMER_OUTER_THEME}, keyword
+ The Beamer outer theme.
+
+- =BEAMER_HEADER= ::
+
+ #+cindex: @samp{BEAMER_HEADER}, keyword
+ Arbitrary lines inserted in the preamble, just before the =hyperref=
+ settings.
+
+- =DESCRIPTION= ::
+
+ #+cindex: @samp{DESCRIPTION}, keyword
+ 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= ::
+
+ #+cindex: @samp{KEYWORDS}, keyword
+ 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= ::
+
+ #+cindex: @samp{SUBTITLE}, keyword
+ 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.
+
+*** Frames and Blocks in Beamer
+:PROPERTIES:
+:DESCRIPTION: For composing Beamer slides.
+:END:
+
+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.
+
+-
+ #+vindex: org-beamer-frame-level
+ 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 [[*Export Settings]]).
+
+ #+cindex: @samp{BEAMER_ENV}, property
+ 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[fn:128]. For valid values see
+ ~org-beamer-environments-default~. To add more values, see
+ ~org-beamer-environments-extra~.
+ #+vindex: org-beamer-environments-default
+ #+vindex: org-beamer-environments-extra
+
+-
+ #+cindex: @samp{BEAMER_REF}, property
+ 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
+
+ #+cindex: @samp{BEAMER_ACT}, property
+ #+cindex: @samp{BEAMER_OPT}, property
+ 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.
+
+ #+cindex: @samp{BEAMER_COL}, property
+ 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.
+
+*** Beamer specific syntax
+:PROPERTIES:
+:DESCRIPTION: For using in Org documents.
+:END:
+
+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 [[*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 [[*Table of
+Contents]]). Use square brackets for specifying options.
+
+: #+TOC: headlines [currentsection]
+
+Insert Beamer-specific code using the following constructs:
+
+#+cindex: @samp{BEAMER}, keyword
+#+cindex: @samp{BEGIN_EXPORT beamer}
+#+begin_example
+,#+BEAMER: \pause
+
+,#+BEGIN_EXPORT beamer
+ Only Beamer export back-end exports this.
+,#+END_BEAMER
+
+Text @@beamer:some code@@ within a paragraph.
+#+end_example
+
+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
+
+#+cindex: @samp{ATTR_BEAMER}, keyword
+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.
+
+#+begin_example
+,#+ATTR_BEAMER: :environment nonindentlist
+- item 1, not indented
+- item 2, not indented
+- item 3, not indented
+#+end_example
+
+#+begin_example
+,#+ATTR_BEAMER: :overlay <+->
+- item 1
+- item 2
+#+end_example
+
+#+begin_example
+,#+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$.
+#+end_example
+
+*** Editing support
+:PROPERTIES:
+:DESCRIPTION: Editing support.
+:END:
+
+Org Beamer mode is a special minor mode for faster editing of Beamer
+documents.
+
+: #+STARTUP: beamer
+
+- {{{kbd(C-c C-b)}}} (~org-beamer-select-environment~) ::
+ #+kindex: C-c C-b
+ #+findex: org-beamer-select-environment
+
+ Org Beamer mode provides this key for quicker selections in Beamer
+ normal environments, and for selecting the =BEAMER_COL= property.
+
+*** A Beamer example
+:PROPERTIES:
+:DESCRIPTION: A complete presentation.
+:END:
+
+Here is an example of an Org document ready for Beamer export.
+
+#+begin_example
+,#+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!
+#+end_example
+
+** HTML Export
+:PROPERTIES:
+:DESCRIPTION: Exporting to HTML.
+:END:
+#+cindex: HTML export
+
+Org mode contains an HTML exporter with extensive HTML formatting
+compatible with XHTML 1.0 strict standard.
+
+*** HTML export commands
+:PROPERTIES:
+:DESCRIPTION: Invoking HTML export.
+:END:
+
+- {{{kbd(C-c C-e h h)}}} (~org-html-export-to-html~) ::
+ #+kindex: C-c C-e h h
+ #+kindex: C-c C-e h o
+ #+findex: 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.
+
+- {{{kbd(C-c C-e h H)}}} (~org-html-export-as-html~) ::
+ #+kindex: C-c C-e h H
+ #+findex: org-html-export-as-html
+
+ Exports to a temporary buffer. Does not create a file.
+
+*** HTML specific export settings
+:PROPERTIES:
+:DESCRIPTION: Settings for HTML export.
+:END:
+
+HTML export has a number of keywords, similar to the general options
+settings described in [[*Export Settings]].
+
+- =DESCRIPTION= ::
+
+ #+cindex: @samp{DESCRIPTION}, keyword
+ 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.
+
+ The exporter includes a number of other meta tags, which can be customized
+ by modifying ~org-html-meta-tags~.
+
+- =HTML_DOCTYPE= ::
+
+ #+cindex: @samp{HTML_DOCTYPE}, keyword
+ #+vindex: org-html-doctype
+ Specify the document type, for example: HTML5 (~org-html-doctype~).
+
+- =HTML_CONTAINER= ::
+
+ #+cindex: @samp{HTML_CONTAINER}, keyword
+ #+vindex: org-html-container-element
+ Specify the HTML container, such as =div=, for wrapping sections and
+ elements (~org-html-container-element~).
+
+- =HTML_LINK_HOME= ::
+
+ #+cindex: @samp{HTML_LINK_HOME}, keyword
+ #+vindex: org-html-link-home
+ The URL for home link (~org-html-link-home~).
+
+- =HTML_LINK_UP= ::
+
+ #+cindex: @samp{HTML_LINK_UP}, keyword
+ #+vindex: org-html-link-up
+ The URL for the up link of exported HTML pages (~org-html-link-up~).
+
+- =HTML_MATHJAX= ::
+
+ #+cindex: @samp{HTML_MATHJAX}, keyword
+ #+vindex: org-html-mathjax-options
+ Options for MathJax (~org-html-mathjax-options~). MathJax is used
+ to typeset LaTeX math in HTML documents. See [[*Math formatting in
+ HTML export]], for an example.
+
+- =HTML_HEAD= ::
+
+ #+cindex: @samp{HTML_HEAD}, keyword
+ #+vindex: org-html-head
+ Arbitrary lines for appending to the HTML document's head
+ (~org-html-head~).
+
+- =HTML_HEAD_EXTRA= ::
+
+ #+cindex: @samp{HTML_HEAD_EXTRA}, keyword
+ #+vindex: org-html-head-extra
+ More arbitrary lines for appending to the HTML document's head
+ (~org-html-head-extra~).
+
+- =KEYWORDS= ::
+
+ #+cindex: @samp{KEYWORDS}, keyword
+ 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= ::
+
+ #+cindex: @samp{LATEX_HEADER}, keyword
+ Arbitrary lines for appending to the preamble; HTML exporter appends
+ when transcoding LaTeX fragments to images (see [[*Math formatting in
+ HTML export]]).
+
+- =SUBTITLE= ::
+
+ #+cindex: @samp{SUBTITLE}, keyword
+ 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.
+
+*** HTML doctypes
+:PROPERTIES:
+:DESCRIPTION: Exporting various (X)HTML flavors.
+:END:
+
+Org can export to various (X)HTML flavors.
+
+#+vindex: org-html-doctype
+#+vindex: org-html-doctype-alist
+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"~
+
+#+texinfo: @noindent
+See the variable ~org-html-doctype-alist~ for details. The default is
+~"xhtml-strict"~.
+
+#+vindex: org-html-html5-fancy
+#+cindex: @samp{HTML5}, export new elements
+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_example
+,#+BEGIN_aside
+ Lorem ipsum
+,#+END_aside
+#+end_example
+
+#+texinfo: @noindent
+exports to:
+
+#+begin_src html
+<aside>
+ <p>Lorem ipsum</p>
+</aside>
+#+end_src
+
+#+texinfo: @noindent
+while this:
+
+#+begin_example
+,#+ATTR_HTML: :controls controls :width 350
+,#+BEGIN_video
+,#+HTML: <source src="movie.mp4" type="video/mp4">
+,#+HTML: <source src="movie.ogg" type="video/ogg">
+Your browser does not support the video tag.
+,#+END_video
+#+end_example
+
+#+texinfo: @noindent
+exports to:
+
+#+begin_src html
+<video controls="controls" width="350">
+ <source src="movie.mp4" type="video/mp4">
+ <source src="movie.ogg" type="video/ogg">
+ <p>Your browser does not support the video tag.</p>
+</video>
+#+end_src
+
+#+vindex: org-html-html5-elements
+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 ~<div class="lederhosen">~.
+
+Special blocks cannot have headlines. For the HTML exporter to wrap
+the headline and its contents in ~<section>~ or ~<article>~ tags, set
+the =HTML_CONTAINER= property for the headline.
+
+*** HTML preamble and postamble
+:PROPERTIES:
+:DESCRIPTION: Inserting preamble and postamble.
+:END:
+#+vindex: org-html-preamble
+#+vindex: org-html-postamble
+#+vindex: org-html-preamble-format
+#+vindex: org-html-postamble-format
+#+vindex: org-html-validation-link
+#+vindex: org-export-creator-string
+#+vindex: org-export-time-stamp-file
+
+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~.
+
+*** Quoting HTML tags
+:PROPERTIES:
+:DESCRIPTION: Using direct HTML in Org files.
+:END:
+
+The HTML export back-end transforms =<= and =>= to =&lt;= and =&gt;=.
+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:<b>@@bold text@@html:</b>@@
+
+#+cindex: @samp{HTML}, keyword
+#+cindex: @samp{BEGIN_EXPORT html}
+For larger raw HTML code blocks, use these HTML export code blocks:
+
+#+begin_example
+,#+HTML: Literal HTML code for export
+
+,#+BEGIN_EXPORT html
+ All lines between these markers are exported literally
+,#+END_EXPORT
+#+end_example
+
+*** Headlines in HTML export
+:PROPERTIES:
+:DESCRIPTION: Formatting headlines.
+:END:
+#+cindex: headlines, in HTML export
+
+Headlines are exported to =<h1>=, =<h2>=, etc. Each headline gets the
+=id= attribute from =CUSTOM_ID= property, or a unique generated value,
+see [[*Internal Links]].
+
+#+vindex: org-html-self-link-headlines
+When ~org-html-self-link-headlines~ is set to a non-~nil~ value, the
+text of the headlines is also wrapped in =<a>= tags. These tags have
+a =href= attribute making the headlines link to themselves.
+
+*** Links in HTML export
+:PROPERTIES:
+:DESCRIPTION: Inserting and formatting links.
+:END:
+#+cindex: links, in HTML export
+#+cindex: internal links, in HTML export
+#+cindex: external links, in HTML export
+
+The HTML export back-end transforms Org's internal links (see
+[[*Internal Links]]) to equivalent HTML links in the output. The back-end
+similarly handles Org's automatic links created by radio targets (see
+[[*Radio Targets]]) similarly. For Org links to external files, the
+back-end transforms the links to /relative/ paths.
+
+#+vindex: org-html-link-org-files-as-html
+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 [[*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 ~<a>~ or ~<img>~ tags. This example shows
+changing the link's title and style:
+
+#+cindex: @samp{ATTR_HTML}, keyword
+#+begin_example
+,#+ATTR_HTML: :title The Org mode homepage :style color:red;
+[[https://orgmode.org]]
+#+end_example
+
+*** Tables in HTML export
+:PROPERTIES:
+:DESCRIPTION: How to modify the formatting of tables.
+:END:
+#+cindex: tables, in HTML
+#+vindex: org-export-html-table-tag
+
+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:
+
+#+cindex: @samp{CAPTION}, keyword
+#+cindex: @samp{ATTR_HTML}, keyword
+#+begin_example
+,#+CAPTION: This is a table with lines around and between cells
+,#+ATTR_HTML: :border 2 :rules all :frame border
+#+end_example
+
+The HTML export back-end preserves column groupings in Org tables (see
+[[*Column Groups]]) when exporting to HTML.
+
+Additional options for customizing tables for HTML export.
+
+- ~org-html-table-align-individual-fields~ ::
+
+ #+vindex: org-html-table-align-individual-fields
+ Non-~nil~ attaches style attributes for alignment to each table
+ field.
+
+- ~org-html-table-caption-above~ ::
+
+ #+vindex: org-html-table-caption-above
+ Non-~nil~ places caption string at the beginning of the table.
+
+- ~org-html-table-data-tags~ ::
+
+ #+vindex: org-html-table-data-tags
+ Opening and ending tags for table data fields.
+
+- ~org-html-table-default-attributes~ ::
+
+ #+vindex: org-html-table-default-attributes
+ Default attributes and values for table tags.
+
+- ~org-html-table-header-tags~ ::
+
+ #+vindex: org-html-table-header-tags
+ Opening and ending tags for table's header fields.
+
+- ~org-html-table-row-tags~ ::
+
+ #+vindex: org-html-table-row-tags
+ Opening and ending tags for table rows.
+
+- ~org-html-table-use-header-tags-for-first-column~ ::
+
+ #+vindex: org-html-table-use-header-tags-for-first-column
+ Non-~nil~ formats column one in tables with header tags.
+
+*** Images in HTML export
+:PROPERTIES:
+:DESCRIPTION: How to insert figures into HTML output.
+:END:
+#+cindex: images, inline in HTML
+#+cindex: inlining images in HTML
+
+The HTML export back-end has features to convert Org image links to
+HTML inline images and HTML clickable image links.
+
+#+vindex: org-html-inline-images
+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.
+
+#+cindex: @samp{CAPTION}, keyword
+#+cindex: @samp{ATTR_HTML}, keyword
+#+begin_example
+,#+CAPTION: A black cat stalking a spider
+,#+ATTR_HTML: :alt cat/spider image :title Action! :align right
+[[./img/a.jpg]]
+#+end_example
+
+The HTML export back-end copies the =http= links from the Org file
+as-is.
+
+*** Math formatting in HTML export
+:PROPERTIES:
+:DESCRIPTION: Beautiful math also on the web.
+:END:
+#+cindex: MathJax
+#+cindex: dvipng
+#+cindex: dvisvgm
+#+cindex: ImageMagick
+
+#+vindex: org-html-mathjax-options~
+LaTeX math snippets (see [[*LaTeX fragments]]) can be displayed in two
+different ways on HTML pages. The default is to use the [[https://www.mathjax.org][MathJax]],
+which should work out of the box with Org[fn:129][fn:130]. Some MathJax
+display options can be configured via ~org-html-mathjax-options~, or
+in the buffer. For example, with the following settings,
+
+#+begin_example
+,#+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler
+,#+HTML_MATHJAX: cancel.js noErrors.js
+#+end_example
+
+#+texinfo: @noindent
+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=[fn:131].
+
+#+vindex: org-html-mathjax-template
+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
+
+#+texinfo: @noindent
+or
+
+: #+OPTIONS: tex:imagemagick
+
+*** Text areas in HTML export
+:PROPERTIES:
+:DESCRIPTION: An alternate way to show an example.
+:END:
+
+#+cindex: text areas, in HTML
+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.
+
+#+begin_example
+,#+ATTR_HTML: :textarea t :width 40
+,#+BEGIN_EXAMPLE
+ (defun org-xor (a b)
+ "Exclusive or."
+ (if a (not b) b))
+,#+END_EXAMPLE
+#+end_example
+
+*** CSS support
+:PROPERTIES:
+:DESCRIPTION: Changing the appearance of the output.
+:END:
+#+cindex: CSS, for HTML export
+#+cindex: HTML export, CSS
+
+#+vindex: org-export-html-todo-kwd-class-prefix
+#+vindex: org-export-html-tag-class-prefix
+You can modify the CSS style definitions for the exported file. The
+HTML exporter assigns the following special CSS classes[fn:132] 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 <sup>) |
+| ~.footnum~ | footnote number in footnote definition (always <sup>) |
+| ~.org-svg~ | default class for a linked =.svg= image |
+
+#+vindex: org-html-style-default
+#+vindex: org-html-head
+#+vindex: org-html-head-extra
+#+cindex: @samp{HTML_INCLUDE_STYLE}, keyword
+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.
+
+#+cindex: @samp{HTML_HEAD}, keyword
+#+cindex: @samp{HTML_HEAD_EXTRA}, keyword
+#+begin_example
+,#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style1.css" />
+,#+HTML_HEAD_EXTRA: <link rel="alternate stylesheet" type="text/css" href="style2.css" />
+#+end_example
+
+#+vindex: org-html-head-include-default-style
+To just turn off the default style, customize
+~org-html-head-include-default-style~ variable, or use this option
+line in the Org file.
+
+#+cindex: @samp{html-style}, @samp{OPTIONS} item
+: #+OPTIONS: html-style:nil
+
+For longer style definitions, either use several =HTML_HEAD= and
+=HTML_HEAD_EXTRA= keywords, or use ~<style> ... </style>~ blocks
+around them. Both of these approaches can avoid referring to an
+external file.
+
+#+cindex: @samp{HTML_CONTAINER_CLASS}, property
+#+cindex: @samp{HTML_HEADLINE_CLASS}, property
+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. You can also assign a specific class to
+a headline with the =HTML_HEADLINE_CLASS= property.
+
+Never change the ~org-html-style-default~ constant. Instead use other
+simpler ways of customizing as described above.
+
+*** JavaScript supported display of web pages
+:PROPERTIES:
+:DESCRIPTION: Info and folding in a web browser.
+:ALT_TITLE: JavaScript support
+:END:
+
+Sebastian Rose has written a JavaScript program especially designed to
+allow two different ways of viewing HTML files created with Org. One
+is an /Info/-like mode where each section is displayed separately and
+navigation can be done with the {{{kbd(n)}}} and {{{kbd(p)}}} keys, and some other
+keys as well, press {{{kbd(?)}}} for an overview of the available keys. The
+second one has a /folding/ view, much like Org provides inside Emacs.
+The script is available at https://orgmode.org/org-info.js and the
+documentation at https://orgmode.org/worg/code/org-info-js/. The
+script is hosted on https://orgmode.org, but for reliability, prefer
+installing it on your own web server.
+
+To use this program, just add this line to the Org file:
+
+#+cindex: @samp{INFOJS_OPT}, keyword
+: #+INFOJS_OPT: view:info toc:nil
+
+#+texinfo: @noindent
+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
+ [[https://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 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 {{{kbd(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.
+
+#+vindex: org-infojs-options
+#+vindex: org-export-html-use-infojs
+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~.
+
+** LaTeX Export
+:PROPERTIES:
+:DESCRIPTION: Exporting to @LaTeX{} and processing to PDF.
+:END:
+#+cindex: @LaTeX{} export
+#+cindex: PDF 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.
+
+*** LaTeX/PDF export commands
+:PROPERTIES:
+:DESCRIPTION: For producing @LaTeX{} and PDF documents.
+:END:
+
+- {{{kbd(C-c C-e l l)}}} (~org-latex-export-to-latex~) ::
+
+ #+kindex: C-c C-e l l
+ #+findex: 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.
+
+- {{{kbd(C-c C-e l L)}}} (~org-latex-export-as-latex~) ::
+
+ #+kindex: C-c C-e l L
+ #+findex: org-latex-export-as-latex
+ Export to a temporary buffer. Do not create a file.
+
+- {{{kbd(C-c C-e l p)}}} (~org-latex-export-to-pdf~) ::
+
+ #+kindex: C-c C-e l p
+ #+findex: org-latex-export-to-pdf
+ Export as LaTeX file and convert it to PDF file.
+
+- {{{kbd(C-c C-e l o)}}} ::
+
+ #+kindex: C-c C-e l o
+ Export as LaTeX file and convert it to PDF, then open the PDF using
+ the default viewer.
+
+- {{{kbd(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.
+
+#+vindex: org-latex-compiler
+#+vindex: org-latex-bibtex-compiler
+#+vindex: org-latex-default-packages-alist
+#+cindex: pdflatex
+#+cindex: xelatex
+#+cindex: lualatex
+#+cindex: @samp{LATEX_COMPILER}, keyword
+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[fn:133].
+
+*** LaTeX specific export settings
+:PROPERTIES:
+:DESCRIPTION: Unique to this @LaTeX{} back-end.
+:END:
+
+The LaTeX export back-end has several additional keywords for
+customizing LaTeX output. Setting these keywords works similar to the
+general options (see [[*Export Settings]]).
+
+#+attr_texinfo: :sep ,
+- =DESCRIPTION= ::
+ #+cindex: @samp{DESCRIPTION}, keyword
+ #+vindex: org-latex-hyperref-template
+ #+vindex: org-latex-title-command
+ 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= ::
+ #+cindex: @samp{LANGUAGE}, keyword
+ #+vindex: org-latex-packages-alist
+ 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:
+
+ #+begin_src emacs-lisp
+ (add-to-list 'org-latex-packages-alist
+ '("AUTO" "babel" t ("pdflatex")))
+ (add-to-list 'org-latex-packages-alist
+ '("AUTO" "polyglossia" t ("xelatex" "lualatex")))
+ #+end_src
+
+- =LATEX_CLASS= ::
+
+ #+cindex: @samp{LATEX_CLASS}, keyword
+ #+vindex: org-latex-default-class
+ #+vindex: org-latex-classes
+ 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= ::
+
+ #+cindex: @samp{LATEX_CLASS_OPTIONS}, keyword
+ Options the LaTeX export back-end uses when calling the LaTeX
+ document class.
+
+- =LATEX_COMPILER= ::
+
+ #+cindex: @samp{LATEX_COMPILER}, keyword
+ #+vindex: org-latex-compiler
+ The compiler, such as =pdflatex=, =xelatex=, =lualatex=, for
+ producing the PDF. See ~org-latex-compiler~.
+
+- =LATEX_HEADER=, =LATEX_HEADER_EXTRA= ::
+
+ #+cindex: @samp{LATEX_HEADER}, keyword
+ #+cindex: @samp{LATEX_HEADER_EXTRA}, keyword
+ #+vindex: org-latex-classes
+ 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= ::
+
+ #+cindex: @samp{KEYWORDS}, keyword
+ #+vindex: org-latex-hyperref-template
+ #+vindex: org-latex-title-command
+ 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= ::
+
+ #+cindex: @samp{SUBTITLE}, keyword
+ #+vindex: org-latex-subtitle-separate
+ #+vindex: org-latex-subtitle-format
+ The document's subtitle. It is typeset as per
+ ~org-latex-subtitle-format~. If ~org-latex-subtitle-separate~ is
+ non-~nil~, it is typed outside 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.
+
+*** LaTeX header and sectioning structure
+:PROPERTIES:
+:DESCRIPTION: Setting up the export file structure.
+:ALT_TITLE: LaTeX header and sectioning
+:END:
+#+cindex: @LaTeX{} class
+#+cindex: @LaTeX{} sectioning structure
+#+cindex: @LaTeX{} header
+#+cindex: header, for @LaTeX{} files
+#+cindex: sectioning structure, for @LaTeX{} export
+
+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 [[*Export Settings]]).
+
+By default, the LaTeX export back-end uses the /article/ class.
+
+#+vindex: org-latex-default-class
+#+vindex: org-latex-classes
+#+vindex: org-latex-default-packages-alist
+#+vindex: org-latex-packages-alist
+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.
+
+#+cindex: @samp{LATEX_CLASS}, keyword
+#+cindex: @samp{LATEX_CLASS_OPTIONS}, keyword
+#+cindex: @samp{EXPORT_LATEX_CLASS}, property
+#+cindex: @samp{EXPORT_LATEX_CLASS_OPTIONS}, property
+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]
+
+#+cindex: @samp{LATEX_HEADER}, keyword
+#+cindex: @samp{LATEX_HEADER_EXTRA}, keyword
+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 [[*Previewing LaTeX fragments]]).
+
+A sample Org file with the above headers:
+
+#+begin_example
+,#+LATEX_CLASS: article
+,#+LATEX_CLASS_OPTIONS: [a4paper]
+,#+LATEX_HEADER: \usepackage{xyz}
+
+,* Headline 1
+ some text
+,* Headline 2
+ some more text
+#+end_example
+
+*** Quoting LaTeX code
+:PROPERTIES:
+:DESCRIPTION: Incorporating literal @LaTeX{} code.
+:END:
+
+The LaTeX export back-end can insert any arbitrary LaTeX code, see
+[[*Embedded LaTeX]]. There are three ways to embed such code in the Org
+file and they all use different quoting syntax.
+
+#+cindex: inline, in @LaTeX{} export
+Inserting in-line quoted with @ symbols:
+
+: Code embedded in-line @@latex:any arbitrary LaTeX code@@ in a paragraph.
+
+#+cindex: @samp{LATEX}, keyword
+Inserting as one or more keyword lines in the Org file:
+
+: #+LATEX: any arbitrary LaTeX code
+
+#+cindex: @samp{BEGIN_EXPORT latex}
+Inserting as an export block in the Org file, where the back-end
+exports any code between begin and end markers:
+
+#+begin_example
+,#+BEGIN_EXPORT latex
+ any arbitrary LaTeX code
+,#+END_EXPORT
+#+end_example
+
+*** Tables in LaTeX export
+:PROPERTIES:
+:DESCRIPTION: Options for exporting tables to @LaTeX{}.
+:END:
+#+cindex: tables, in @LaTeX{} export
+
+The LaTeX export back-end can pass several LaTeX attributes for table
+contents and layout. Besides specifying a label (see [[*Internal Links]])
+and a caption (see [[*Captions]]), the other valid LaTeX attributes
+include:
+
+#+attr_texinfo: :sep ,
+- =:mode= ::
+
+ #+vindex: org-latex-default-table-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= ::
+
+ #+vindex: org-latex-default-table-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
+ [[*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= ::
+
+ #+vindex: org-latex-tables-booktabs
+ #+vindex: org-latex-tables-centered
+ 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:
+
+#+begin_example
+,#+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 |
+#+end_example
+
+Set the caption with the LaTeX command
+=\bicaption{HeadingA}{HeadingB}=:
+
+#+begin_example
+,#+ATTR_LATEX: :caption \bicaption{HeadingA}{HeadingB}
+| ... | ... |
+| ... | ... |
+#+end_example
+
+*** Images in LaTeX export
+:PROPERTIES:
+:DESCRIPTION: How to insert figures into @LaTeX{} output.
+:END:
+#+cindex: images, inline in LaTeX
+#+cindex: inlining images in LaTeX
+#+cindex: @samp{ATTR_LATEX}, keyword
+
+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 (http://sourceforge.net/projects/pgf/)
+images, the back-end uses an ~\input~ macro wrapped within
+a ~tikzpicture~ environment.
+
+For specifying image =:width=, =:height=, =:scale= and other =:options=,
+use this syntax:
+
+#+begin_example
+,#+ATTR_LATEX: :width 5cm :options angle=90
+[[./img/sed-hr4049.pdf]]
+#+end_example
+
+A =:scale= attribute overrides both =:width= and =:height= attributes.
+
+For custom commands for captions, use the =:caption= attribute. It
+overrides the default =#+CAPTION= value:
+
+#+begin_example
+,#+ATTR_LATEX: :caption \bicaption{HeadingA}{HeadingB}
+[[./img/sed-hr4049.pdf]]
+#+end_example
+
+When captions follow the method as described in [[*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.
+
+#+begin_example
+,#+ATTR_LATEX: :float wrap :width 0.38\textwidth :placement {r}{0.4\textwidth}
+[[./img/hst.png]]
+#+end_example
+
+#+vindex: org-latex-images-centered
+#+cindex: center image in LaTeX export
+#+cindex: image, centering in LaTeX export
+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 =nil=.
+
+Set the =:comment-include= attribute to non-~nil~ value for the LaTeX
+export back-end to comment out the =\includegraphics= macro.
+
+*** Plain lists in LaTeX export
+:PROPERTIES:
+:DESCRIPTION: Attributes specific to lists.
+:END:
+
+#+cindex: plain lists, in @LaTeX{} export
+#+cindex: @samp{ATTR_LATEX}, keyword
+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:
+
+#+begin_example
+,#+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.
+#+end_example
+
+Since LaTeX supports only four levels of nesting for lists, use an
+external package, such as =enumitem= in LaTeX, for levels deeper than
+four:
+
+#+begin_example
+,#+LATEX_HEADER: \usepackage{enumitem}
+,#+LATEX_HEADER: \renewlist{itemize}{itemize}{9}
+,#+LATEX_HEADER: \setlist[itemize]{label=$\circ$}
+- One
+ - Two
+ - Three
+ - Four
+ - Five
+#+end_example
+
+*** Source blocks in LaTeX export
+:PROPERTIES:
+:DESCRIPTION: Attributes specific to source code blocks.
+:END:
+#+cindex: source blocks, in @LaTeX{} export
+#+cindex: @samp{ATTR_LATEX}, keyword
+
+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.
+
+#+begin_example
+,#+ATTR_LATEX: :float nil
+,#+BEGIN_SRC emacs-lisp
+ Lisp code that may not fit in a single page.
+,#+END_SRC
+#+end_example
+
+#+vindex: org-latex-listings-options
+#+vindex: org-latex-minted-options
+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[fn:134].
+
+#+begin_example
+,#+ATTR_LATEX: :options commentstyle=\bfseries
+,#+BEGIN_SRC emacs-lisp
+ (defun Fib (n)
+ (if (< n 2) n (+ (Fib (- n 1)) (Fib (- n 2)))))
+,#+END_SRC
+#+end_example
+
+To apply similar configuration options for all source blocks in
+a file, use the ~org-latex-listings-options~ and
+~org-latex-minted-options~ variables.
+
+*** Example blocks in LaTeX export
+:PROPERTIES:
+:DESCRIPTION: Attributes specific to example blocks.
+:END:
+#+cindex: example blocks, in @LaTeX{} export
+#+cindex: verbatim blocks, in @LaTeX{} export
+#+cindex: @samp{ATTR_LATEX}, keyword
+
+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
+[[*Advanced Export Configuration]]). To change this behavior to use
+another environment for each block, use the =:environment= parameter
+to specify a custom environment.
+
+#+begin_example
+,#+ATTR_LATEX: :environment myverbatim
+,#+BEGIN_EXAMPLE
+ This sentence is false.
+,#+END_EXAMPLE
+#+end_example
+
+*** Special blocks in LaTeX export
+:PROPERTIES:
+:DESCRIPTION: Attributes specific to special blocks.
+:END:
+
+#+cindex: special blocks, in @LaTeX{} export
+#+cindex: abstract, in @LaTeX{} export
+#+cindex: proof, in @LaTeX{} export
+#+cindex: @samp{ATTR_LATEX}, keyword
+
+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_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
+#+end_example
+
+#+texinfo: @noindent
+exports to
+
+#+begin_example
+\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}
+#+end_example
+
+If you need to insert a specific caption command, use =:caption=
+attribute. It overrides standard =CAPTION= value, if any. For
+example:
+
+#+begin_example
+,#+ATTR_LATEX: :caption \MyCaption{HeadingA}
+,#+BEGIN_proof
+ ...
+,#+END_proof
+#+end_example
+
+*** Horizontal rules in LaTeX export
+:PROPERTIES:
+:DESCRIPTION: Attributes specific to horizontal rules.
+:END:
+#+cindex: horizontal rules, in @LaTeX{} export
+#+cindex: @samp{ATTR_LATEX}, keyword
+
+The LaTeX export back-end converts horizontal rules by the specified
+=:width= and =:thickness= attributes. For example:
+
+#+begin_example
+,#+ATTR_LATEX: :width .6\textwidth :thickness 0.8pt
+-----
+#+end_example
+
+*** Verse blocks in LaTeX export
+:PROPERTIES:
+:DESCRIPTION: Attributes specific to special blocks.
+:END:
+
+#+cindex: verse blocks, in @LaTeX{} export
+#+cindex: @samp{ATTR_LATEX}, keyword
+
+The LaTeX export back-end accepts four attributes for verse blocks:
+=:lines=, =:center=, =:versewidth= and =:latexcode=. The three first
+require the external LaTeX package =verse.sty=, which is an extension
+of the standard LaTeX environment.
+
+- =:lines= :: To add marginal verse numbering. Its value is an
+ integer, the sequence in which the verses should be numbered.
+- =:center= :: With value =t= all the verses on the page are optically
+ centered (a typographic convention for poetry), taking as a
+ reference the longest verse, which must be indicated by the
+ attribute =:versewidth=.
+- =:versewidth= :: Its value is a literal text string with the longest
+ verse.
+- =:latexcode= :: It accepts any arbitrary LaTeX code that can be
+ included within a LaTeX =verse= environment.
+
+A complete example with Shakespeare's first sonnet:
+
+#+begin_src org
+,#+ATTR_LATEX: :center t :latexcode \color{red} :lines 5
+,#+ATTR_LATEX: :versewidth Feed’st thy light’s flame with self-substantial fuel,
+,#+BEGIN_VERSE
+From fairest creatures we desire increase,
+That thereby beauty’s rose might never die,
+But as the riper should by time decease
+His tender heir might bear his memory
+But thou, contracted to thine own bright eyes,
+Feed’st thy light’s flame with self-substantial fuel,
+Making a famine where abundance lies,
+Thyself thy foe, to thy sweet self too cruel.
+Thou that art now the world’s fresh ornament,
+And only herald to the gaudy spring,
+Within thine own bud buriest thy content,
+And, tender churl, mak’st waste in niggardly.
+Pity the world, or else this glutton be,
+To eat the world’s due, by the grave and thee.
+,#+END_VERSE
+#+end_src
+
+*** Quote blocks in LaTeX export
+:PROPERTIES:
+:DESCRIPTION: Attributes specific to quote blocks.
+:END:
+
+#+cindex: quote blocks, in @LaTeX{} export
+#+cindex: @samp{ATTR_LATEX}, keyword
+#+cindex: org-latex-default-quote-environment
+
+The LaTeX export back-end accepts two attributes for quote blocks:
+=:environment=, for an arbitrary quoting environment (the default
+value is that of ~org-latex-default-quote-environment~: ~"quote"~) and
+=:options=. For example, to choose the environment =quotation=,
+included as an alternative to =quote= in standard LaTeX classes:
+
+#+begin_example
+,#+ATTR_LATEX: :environment quotation
+,#+BEGIN_QUOTE
+some text...
+,#+END_QUOTE
+#+end_example
+
+To choose the =foreigndisplayquote= environment, included in the LaTeX
+package =csquotes=, with the =german= option, use this syntax:
+
+#+begin_example
+,#+LATEX_HEADER:\usepackage[autostyle=true]{csquotes}
+,#+ATTR_LATEX: :environment foreigndisplayquote :options {german}
+,#+BEGIN_QUOTE
+some text in German...
+,#+END_QUOTE
+#+end_example
+
+#+texinfo: @noindent
+which is exported to LaTeX as
+
+#+begin_example
+\begin{foreigndisplayquote}{german}
+some text in German...
+\end{foreigndisplayquote}
+#+end_example
+
+** Markdown Export
+:PROPERTIES:
+:DESCRIPTION: Exporting to Markdown.
+:END:
+#+cindex: Markdown export
+
+The Markdown export back-end, "md", converts an Org file to Markdown
+format, as defined at http://daringfireball.net/projects/markdown/.
+
+Since it is built on top of the HTML back-end (see [[*HTML Export]]), it
+converts every Org construct not defined in Markdown syntax, such as
+tables, to HTML.
+
+*** Markdown export commands
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(C-c C-e m m)}}} (~org-md-export-to-markdown~) ::
+
+ #+kindex: C-c C-c m m
+ #+findex: org-md-export-to-markdown
+ Export to a text file with Markdown syntax. For =myfile.org=, Org
+ exports to =myfile.md=, overwritten without warning.
+
+- {{{kbd(C-c C-e m M)}}} (~org-md-export-as-markdown~) ::
+
+ #+kindex: C-c C-c m M
+ #+findex: org-md-export-as-markdown
+ Export to a temporary buffer. Does not create a file.
+
+- {{{kbd(C-c C-e m o)}}} ::
+
+ #+kindex: C-c C-e m o
+ Export as a text file with Markdown syntax, then open it.
+
+*** Header and sectioning structure
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+vindex: org-md-headline-style
+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 [[*Export Settings]]).
+
+** OpenDocument Text Export
+:PROPERTIES:
+:DESCRIPTION: Exporting to OpenDocument Text.
+:END:
+#+cindex: ODT
+#+cindex: OpenDocument
+#+cindex: export, OpenDocument
+#+cindex: LibreOffice
+
+The ODT export back-end handles creating of OpenDocument Text (ODT)
+format. Documents created by this exporter use the
+{{{cite(OpenDocument-v1.2 specification)}}}[fn:135] and are compatible
+with LibreOffice 3.4.
+
+*** Pre-requisites for ODT export
+:PROPERTIES:
+:DESCRIPTION: Required packages.
+:END:
+#+cindex: zip
+
+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.
+
+*** ODT export commands
+:PROPERTIES:
+:DESCRIPTION: Invoking export.
+:END:
+
+- {{{kbd(C-c C-e o o)}}} (~org-export-to-odt~) ::
+
+ #+kindex: C-c C-e o o
+ #+findex: org-export-to-odt
+ Export as OpenDocument Text file.
+
+ #+cindex: @samp{EXPORT_FILE_NAME}, property
+ #+vindex: org-odt-preferred-output-format
+
+ 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, {{{kbd(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.
+
+- {{{kbd(C-c C-e o O)}}} ::
+
+ #+kindex: C-c C-e o O
+ Export as an OpenDocument Text file and open the resulting file.
+
+ #+vindex: org-export-odt-preferred-output-format
+ If ~org-export-odt-preferred-output-format~ is specified, open the
+ converted file instead. See [[*Automatically exporting to other
+ formats]].
+
+*** ODT specific export settings
+:PROPERTIES:
+:DESCRIPTION: Configuration options.
+:END:
+
+The ODT export back-end has several additional keywords for
+customizing ODT output. Setting these keywords works similar to the
+general options (see [[*Export Settings]]).
+
+- =DESCRIPTION= ::
+
+ #+cindex: @samp{DESCRIPTION}, keyword
+ 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= ::
+
+ #+cindex: @samp{KEYWORDS}, keyword
+ 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= ::
+
+ #+cindex: @samp{ODT_STYLES_FILE}, keyword
+ #+vindex: org-odt-styles-file
+ The ODT export back-end uses the ~org-odt-styles-file~ by default.
+ See [[*Applying custom styles]] for details.
+
+- =SUBTITLE= ::
+
+ #+cindex: @samp{SUBTITLE}, keyword
+ The document subtitle.
+
+*** Extending ODT export
+:PROPERTIES:
+:DESCRIPTION: Producing DOC, PDF files.
+:END:
+
+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=.
+
+#+cindex: @file{unoconv}
+#+vindex: org-odt-convert-process
+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 [[*Configuring
+a document converter]].
+
+**** Automatically exporting to other formats
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+vindex: org-odt-preferred-output-format
+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 [[*ODT export commands]]).
+
+**** Converting between document formats
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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:
+
+- {{{kbd(M-x org-odt-convert)}}} ::
+
+ #+findex: org-odt-convert
+ Convert an existing document from one format to another. With
+ a prefix argument, opens the newly produced file.
+
+*** Applying custom styles
+:PROPERTIES:
+:DESCRIPTION: Styling the output.
+:END:
+#+cindex: styles, custom
+#+cindex: template, custom
+
+The ODT export back-end comes with many OpenDocument styles (see
+[[*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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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.
+ #+vindex: org-odt-styles-file
+ Customize the variable ~org-odt-styles-file~ and point it to the
+ newly created file. For additional configuration options, see
+ [[x-overriding-factory-styles][Overriding factory styles]].
+
+ #+cindex: @samp{ODT_STYLES_FILE}, keyword
+ 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"
+
+ #+texinfo: @noindent
+ or
+
+ : #+ODT_STYLES_FILE: ("/path/to/file.ott" ("styles.xml" "image/hdr.png"))
+
+**** Using third-party styles and templates
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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.
+
+*** Links in ODT export
+:PROPERTIES:
+:DESCRIPTION: Handling and formatting links.
+:END:
+#+cindex: 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
+[[*Labels and captions in ODT export]].
+
+*** Tables in ODT export
+:PROPERTIES:
+:DESCRIPTION: Org tables conversions.
+:END:
+
+#+cindex: tables, in ODT export
+
+The ODT export back-end handles native Org mode tables (see [[*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 [[*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 [[*Column Width and Alignment]]).
+
+Note that the ODT export back-end interprets column widths as weighted
+ratios, the default weight being 1.
+
+#+cindex: @samp{ATTR_ODT}, keyword
+Specifying =:rel-width= property on an =ATTR_ODT= line controls the
+width of the table. For example:
+
+#+begin_example
+,#+ATTR_ODT: :rel-width 50
+| Area/Month | Jan | Feb | Mar | Sum |
+|---------------+-------+-------+-------+-------|
+| / | < | | | < |
+| <l13> | <r5> | <r5> | <r5> | <r6> |
+| North America | 1 | 21 | 926 | 948 |
+| Middle East | 6 | 75 | 844 | 925 |
+| Asia Pacific | 9 | 27 | 790 | 826 |
+|---------------+-------+-------+-------+-------|
+| Sum | 16 | 123 | 2560 | 2699 |
+#+end_example
+
+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 [[*Customizing
+tables in ODT export]].
+
+*** Images in ODT export
+:PROPERTIES:
+:DESCRIPTION: Inserting images.
+:END:
+#+cindex: images, embedding in ODT
+#+cindex: embedding images in ODT
+
+**** Embedding images
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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 https://orgmode.org
+website, do the following
+
+: [[https://orgmode.org][./org-mode-unicorn.png]]
+
+**** Sizing and scaling of embedded images
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: @samp{ATTR_ODT}, keyword
+
+Control the size and scale of the embedded images with the =ATTR_ODT=
+attribute.
+
+#+cindex: identify, ImageMagick
+#+vindex: org-odt-pixels-per-inch
+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:
+
+ #+begin_example
+ ,#+ATTR_ODT: :width 10 :height 10
+ [[./img.png]]
+ #+end_example
+
+- Scale the image ::
+
+ To embed =img.png= at half its size, do the following:
+
+ #+begin_example
+ ,#+ATTR_ODT: :scale 0.5
+ [[./img.png]]
+ #+end_example
+
+- 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:
+
+ #+begin_example
+ ,#+ATTR_ODT: :width 10
+ [[./img.png]]
+ #+end_example
+
+- 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:
+
+ #+begin_example
+ ,#+ATTR_ODT: :height 10
+ [[./img.png]]
+ #+end_example
+
+**** Anchoring of images
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: @samp{ATTR_ODT}, keyword
+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:
+
+#+begin_example
+,#+ATTR_ODT: :anchor page
+[[./img.png]]
+#+end_example
+
+*** Math formatting in ODT export
+:PROPERTIES:
+:DESCRIPTION: Formatting @LaTeX{} fragments.
+:END:
+
+The ODT exporter has special support for handling math.
+
+**** LaTeX math snippets
+:PROPERTIES:
+:DESCRIPTION: Embedding in @LaTeX{} format.
+:END:
+
+LaTeX math snippets (see [[*LaTeX fragments]]) can be embedded in the ODT
+document in one of the following ways:
+
+- MathML ::
+
+ #+cindex: 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.
+
+ #+vindex: org-latex-to-mathml-convert-command
+ #+vindex: org-latex-to-mathml-jar-file
+ 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[fn:136] as your converter, you can
+ configure the above variables as shown below.
+
+ #+begin_src emacs-lisp
+ (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")
+ #+end_src
+
+ #+texinfo: @noindent
+ or, to use LaTeX​ML[fn:137] instead,
+
+ #+begin_src emacs-lisp
+ (setq org-latex-to-mathml-convert-command
+ "latexmlmath \"%i\" --presentationmathml=%o")
+ #+end_src
+
+ To quickly verify the reliability of the LaTeX-to-MathML
+ converter, use the following commands:
+
+ - {{{kbd(M-x org-export-as-odf)}}} ::
+
+ Convert a LaTeX math snippet to an OpenDocument formula (=.odf=)
+ file.
+
+ - {{{kbd(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 ::
+
+ #+cindex: dvipng
+ #+cindex: dvisvgm
+ #+cindex: ImageMagick
+ Add this line to the Org file. This option is activated on
+ a per-file basis.
+
+ : #+OPTIONS: tex:dvipng
+
+ : #+OPTIONS: tex:dvisvgm
+
+ #+texinfo: @noindent
+ 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.
+
+**** MathML and OpenDocument formula files
+:PROPERTIES:
+:DESCRIPTION: Embedding in native format.
+:END:
+
+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]]
+
+#+texinfo: @noindent
+or
+
+: [[./equation.odf]]
+
+*** Labels and captions in ODT export
+:PROPERTIES:
+:DESCRIPTION: Rendering objects.
+:END:
+
+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.
+
+#+begin_example
+,#+CAPTION: Bell curve
+,#+NAME: fig:SED-HR4049
+[[./img/a.png]]
+#+end_example
+
+When rendered, it may show as follows in the exported document:
+
+: Figure 2: Bell curve
+
+#+vindex: org-odt-category-map-alist
+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:
+
+#+begin_src emacs-lisp
+(setq org-odt-category-map-alist
+ '(("__Figure__" "Illustration" "value" "Figure" org-odt--enumerable-image-p)))
+#+end_src
+
+With the above modification, the previous example changes to:
+
+: Illustration 2: Bell curve
+
+*** Literal examples in ODT export
+:PROPERTIES:
+:DESCRIPTION: For source code and example blocks.
+:END:
+
+The ODT export back-end supports literal examples (see [[*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.
+
+#+vindex: org-odt-fontify-srcblocks
+For custom fontification styles, customize the
+~org-odt-create-custom-styles-for-srcblocks~ option.
+
+#+vindex: org-odt-create-custom-styles-for-srcblocks
+To turn off fontification of literal examples, customize the
+~org-odt-fontify-srcblocks~ option.
+
+*** Advanced topics in ODT export
+:PROPERTIES:
+:DESCRIPTION: For power users.
+:END:
+
+The ODT export back-end has extensive features useful for power users
+and frequent uses of ODT formats.
+
+**** Configuring a document converter
+:PROPERTIES:
+:DESCRIPTION: Registering a document converter.
+:UNNUMBERED: notoc
+:END:
+#+cindex: convert
+#+cindex: doc, docx, rtf
+#+cindex: converter
+
+The ODT export back-end works with popular converters with little or
+no extra configuration. See [[*Extending ODT export]]. The following is
+for unsupported converters or tweaking existing defaults.
+
+- Register the converter ::
+
+ #+vindex: org-export-odt-convert-processes
+ 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 ::
+
+ #+vindex: org-export-odt-convert-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 ::
+
+ #+vindex: org-export-odt-convert-process
+ Select the newly added converter as the preferred one by customizing
+ the option ~org-odt-convert-process~.
+
+**** Working with OpenDocument style files
+:PROPERTIES:
+:DESCRIPTION: Exploring internals.
+:UNNUMBERED: notoc
+:END:
+#+cindex: styles, custom
+#+cindex: template, custom
+
+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= <<x-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= <<x-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
+ =<office:text>= ... =</office:text>= 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 =<text:sequence-decl>= ... =</text:sequence-decl>=
+ elements that control numbering of tables, images, equations, and
+ similar entities.
+
+<<x-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:
+
+ - =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
+:PROPERTIES:
+:DESCRIPTION: Customizing styles, highlighting...
+:UNNUMBERED: notoc
+:END:
+
+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:
+
+ #+begin_example
+ @@odt:<text:span text:style-name="Highlight">This is highlighted
+ text</text:span>@@. But this is regular text.
+ #+end_example
+
+ *Hint:* To see the above example in action, edit the =styles.xml=
+ (see [[x-orgodtstyles-xml][Factory styles]]) and add a custom /Highlight/ style as shown
+ below:
+
+ #+begin_example
+ <style:style style:name="Highlight" style:family="text">
+ <style:text-properties fo:background-color="#ff0000"/>
+ </style:style>
+ #+end_example
+
+- Embedding a one-line OpenDocument XML ::
+
+ #+cindex: @samp{ODT}, keyword
+ The ODT export back-end can read one-liner options with =#+ODT:= in
+ the Org file. For example, to force a page break:
+
+ #+begin_example
+ ,#+ODT: <text:p text:style-name="PageBreak"/>
+ #+end_example
+
+ *Hint:* To see the above example in action, edit your
+ =styles.xml= (see [[x-orgodtstyles-xml][Factory styles]]) and add a custom =PageBreak=
+ style as shown below.
+
+ #+begin_example
+ <style:style style:name="PageBreak" style:family="paragraph"
+ style:parent-style-name="Text_20_body">
+ <style:paragraph-properties fo:break-before="page"/>
+ </style:style>
+ #+end_example
+
+- 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_example
+ ,#+BEGIN_EXPORT odt
+ <text:p text:style-name="Text_20_body_20_bold">
+ This paragraph is specially formatted and uses bold text.
+ </text:p>
+ ,#+END_EXPORT
+ #+end_example
+
+**** Customizing tables in ODT export
+:PROPERTIES:
+:DESCRIPTION: Defining table templates.
+:UNNUMBERED: notoc
+:END:
+#+cindex: tables, in ODT export
+#+cindex: @samp{ATTR_ODT}, keyword
+
+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 [[*Tables in ODT export]].
+
+This feature closely mimics the way table templates are defined in the
+OpenDocument-v1.2 specification[fn:138].
+
+#+vindex: org-odt-table-styles
+For quick preview of this feature, install the settings below and export the
+table that follows:
+
+#+begin_src emacs-lisp
+(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))))))
+#+end_src
+
+#+begin_example
+,#+ATTR_ODT: :style TableWithHeaderRowAndColumn
+| Name | Phone | Age |
+| Peter | 1234 | 17 |
+| Anna | 4321 | 25 |
+#+end_example
+
+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 [[x-orgodtcontenttemplate-xml][Factory styles]]). For adding new
+templates, define new styles there.
+
+To use this feature proceed as follows:
+
+1. Create a table template[fn:139].
+
+ 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 =<office:automatic-styles>= ...
+ =</office:automatic-styles>= element of the content template file
+ (see [[x-orgodtcontenttemplate-xml][Factory styles]]).
+
+2. Define a table style[fn:140].
+
+ #+vindex: org-odt-table-styles
+ 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.
+
+ #+begin_src emacs-lisp
+ (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))))))
+ #+end_src
+
+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.
+
+ #+begin_example
+ ,#+ATTR_ODT: :style TableWithHeaderRowAndColumn
+ | Name | Phone | Age |
+ | Peter | 1234 | 17 |
+ | Anna | 4321 | 25 |
+ #+end_example
+
+**** Validating OpenDocument XML
+:PROPERTIES:
+:DESCRIPTION: Debugging corrupted OpenDocument files.
+:UNNUMBERED: notoc
+:END:
+
+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: [[info:emacs::File Archives]]. The contents of
+ODT files are in XML. For general help with validation---and
+schema-sensitive editing---of XML files: [[info:nxml-mode::Introduction]].
+
+#+vindex: org-export-odt-schema-dir
+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~.
+
+** Org Export
+:PROPERTIES:
+:DESCRIPTION: Exporting to Org.
+:END:
+
+#+cindex: Org export
+/org/ export back-end creates a normalized version of the Org document
+in current buffer. The exporter evaluates Babel code (see [[*Evaluating
+Code Blocks]]) and removes content specific to other back-ends.
+
+*** Org export commands
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- {{{kbd(C-c C-e O o)}}} (~org-org-export-to-org~) ::
+
+ #+kindex: C-c C-e O o
+ #+findex: 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.
+
+- {{{kbd(C-c C-e O v)}}} (~~) ::
+
+ #+kindex: C-c C-e O v
+ Export to an Org file, then open it.
+
+** Texinfo Export
+:PROPERTIES:
+:DESCRIPTION: Exporting to Texinfo.
+:END:
+
+*** Texinfo export commands
+:PROPERTIES:
+:DESCRIPTION: Invoking commands.
+:END:
+
+- {{{kbd(C-c C-e i t)}}} (~org-texinfo-export-to-texinfo~) ::
+
+ #+kindex: C-c C-e i t
+ #+findex: org-texinfo-export-to-texinfo
+ Export as a Texinfo file with =.texi= extension. For =myfile.org=,
+ Org exports to =myfile.texi=, overwriting without warning.
+
+- {{{kbd(C-c C-e i i)}}} (~org-texinfo-export-to-info~) ::
+
+ #+kindex: C-c C-e i i
+ #+findex: org-texinfo-export-to-info
+ #+vindex: org-texinfo-info-process
+ 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.
+
+*** Texinfo specific export settings
+:PROPERTIES:
+:DESCRIPTION: Setting the environment.
+:END:
+
+The Texinfo export back-end has several additional keywords for
+customizing Texinfo output. Setting these keywords works similar to
+the general options (see [[*Export Settings]]).
+
+- =SUBTITLE= ::
+
+ #+cindex: @samp{SUBTITLE}, keyword
+ The document subtitle.
+
+- =SUBAUTHOR= ::
+
+ #+cindex: @samp{SUBAUTHOR}, keyword
+ Additional authors for the document.
+
+- =TEXINFO_FILENAME= ::
+
+ #+cindex: @samp{TEXINFO_FILENAME}, keyword
+ The Texinfo filename.
+
+- =TEXINFO_CLASS= ::
+
+ #+cindex: @samp{TEXINFO_CLASS}, keyword
+ #+vindex: org-texinfo-default-class
+ The default document class (~org-texinfo-default-class~), which must
+ be a member of ~org-texinfo-classes~.
+
+- =TEXINFO_HEADER= ::
+
+ #+cindex: @samp{TEXINFO_HEADER}, keyword
+ Arbitrary lines inserted at the end of the header.
+
+- =TEXINFO_POST_HEADER= ::
+
+ #+cindex: @samp{TEXINFO_POST_HEADER}, keyword
+ Arbitrary lines inserted after the end of the header.
+
+- =TEXINFO_DIR_CATEGORY= ::
+
+ #+cindex: @samp{TEXINFO_DIR_CATEGORY}, keyword
+ The directory category of the document.
+
+- =TEXINFO_DIR_TITLE= ::
+
+ #+cindex: @samp{TEXINFO_DIR_TITLE}, keyword
+ The directory title of the document.
+
+- =TEXINFO_DIR_DESC= ::
+
+ #+cindex: @samp{TEXINFO_DIR_DESC}, keyword
+ The directory description of the document.
+
+- =TEXINFO_PRINTED_TITLE= ::
+
+ #+cindex: @samp{TEXINFO_PRINTED_TITLE}, keyword
+ The printed title of the document.
+
+*** Texinfo file header
+:PROPERTIES:
+:DESCRIPTION: Generating the header.
+:END:
+
+#+cindex: @samp{TEXINFO_FILENAME}, keyword
+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.
+
+#+vindex: org-texinfo-coding-system
+#+cindex: @samp{TEXINFO_HEADER}, keyword
+Along with the output's file name, the Texinfo header also contains
+language details (see [[*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
+
+#+cindex: @samp{TEXINFO_CLASS}, keyword
+#+vindex: org-texinfo-classes
+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.
+
+*** Texinfo title and copyright page
+:PROPERTIES:
+:DESCRIPTION: Creating preamble pages.
+:END:
+
+#+cindex: @samp{TEXINFO_PRINTED_TITLE}, keyword
+The default template for hard copy output has a title page with
+=TITLE= and =AUTHOR= keywords (see [[*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.
+
+#+cindex: @samp{SUBAUTHOR}, keyword
+If one =AUTHOR= line is not sufficient, add multiple =SUBAUTHOR=
+keywords. They have to be set in raw Texinfo code.
+
+#+begin_example
+,#+AUTHOR: Jane Smith
+,#+SUBAUTHOR: John Doe
+,#+TEXINFO_PRINTED_TITLE: This Long Title@@inlinefmt{tex,@*} Is Broken in @TeX{}
+#+end_example
+
+#+cindex: @samp{COPYING}, property
+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.
+
+#+begin_example
+,* 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.
+#+end_example
+
+*** Info directory file
+:PROPERTIES:
+:DESCRIPTION: Installing a manual in Info file hierarchy.
+:END:
+
+#+cindex: @samp{dir} file, in Texinfo export
+#+cindex: Info directory file, in Texinfo export
+#+cindex: @code{install-info}, in Texinfo export
+
+#+cindex: @samp{TEXINFO_DIR_CATEGORY}, keyword
+#+cindex: @samp{TEXINFO_DIR_TITLE}, keyword
+#+cindex: @samp{TEXINFO_DIR_DESC}, keyword
+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:
+
+#+begin_example
+,#+TEXINFO_DIR_CATEGORY: Emacs
+,#+TEXINFO_DIR_TITLE: Org Mode: (org)
+,#+TEXINFO_DIR_DESC: Outline-based notes management and organizer
+#+end_example
+
+*** Headings and sectioning structure
+:PROPERTIES:
+:DESCRIPTION: Building document structure.
+:END:
+
+#+vindex: org-texinfo-classes
+#+vindex: org-texinfo-default-class
+#+cindex: @samp{TEXINFO_CLASS}, keyword
+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 [[*Export Settings]]), then
+the Texinfo export back-end makes it into a list item.
+
+#+cindex: @samp{APPENDIX}, property
+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.
+
+#+cindex: @samp{ALT_TITLE}, property
+#+cindex: @samp{DESCRIPTION}, property
+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 [[*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:
+
+#+begin_example
+,* Controlling Screen Display
+ :PROPERTIES:
+ :ALT_TITLE: Display
+ :DESCRIPTION: Controlling Screen Display
+ :END:
+#+end_example
+
+#+cindex: Top node, in Texinfo export
+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 [[info:texinfo::The Top Node]], for more information.
+
+*** Indices
+:PROPERTIES:
+:DESCRIPTION: Creating indices.
+:END:
+
+#+cindex: @samp{CINDEX}, keyword
+#+cindex: concept index, in Texinfo export
+#+cindex: @samp{FINDEX}, keyword
+#+cindex: function index, in Texinfo export
+#+cindex: @samp{KINDEX}, keyword
+#+cindex: keystroke index, in Texinfo export
+#+cindex: @samp{PINDEX}, keyword
+#+cindex: program index, in Texinfo export
+#+cindex: @samp{TINDEX}, keyword
+#+cindex: data type index, in Texinfo export
+#+cindex: @samp{VINDEX}, keyword
+#+cindex: variable index, in Texinfo export
+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
+
+#+cindex: @samp{INDEX}, property
+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.
+
+#+begin_example
+,* Concept Index
+ :PROPERTIES:
+ :INDEX: cp
+ :END:
+#+end_example
+
+*** Quoting Texinfo code
+:PROPERTIES:
+:DESCRIPTION: Incorporating literal Texinfo code.
+:END:
+
+Use any of the following three methods to insert or escape raw Texinfo
+code:
+
+#+cindex: @samp{TEXINFO}, keyword
+#+cindex: @samp{BEGIN_EXPORT texinfo}
+#+begin_example
+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
+#+end_example
+
+*** Plain lists in Texinfo export
+:PROPERTIES:
+:DESCRIPTION: List attributes.
+:END:
+
+#+cindex: @samp{ATTR_TEXINFO}, keyword
+#+cindex: two-column tables, in Texinfo export
+#+cindex: table-type, Texinfo attribute
+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, set =:table-type=
+attribute to either =ftable= or =vtable= value. For more information,
+see [[info:texinfo::Two-column Tables]].
+
+#+vindex: org-texinfo-table-default-markup
+#+cindex: indic, Texinfo attribute
+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.
+
+#+cindex: multiple items in Texinfo lists
+#+cindex: sep, Texinfo 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:
+
+#+begin_example
+,#+ATTR_TEXINFO: :table-type vtable :sep , :indic asis
+- foo, bar :: This is the common text for variables foo and bar.
+#+end_example
+
+#+texinfo: @noindent
+becomes
+
+#+begin_example
+@vtable @asis
+@item foo
+@itemx bar
+This is the common text for variables foo and bar.
+@end table
+#+end_example
+
+#+cindex: lettered lists, in Texinfo export
+#+cindex: enum, Texinfo attribute
+Ordered lists are numbered when exported to Texinfo format. Such
+numbering obeys any counter (see [[*Plain Lists]]) in the first item of
+the list. The =:enum= attribute also let you start the list at
+a specific number, or switch to a lettered list, as illustrated here
+
+#+begin_example
+#+ATTR_TEXINFO: :enum A
+1. Alpha
+2. Bravo
+3. Charlie
+#+end_example
+
+*** Tables in Texinfo export
+:PROPERTIES:
+:DESCRIPTION: Table attributes.
+:END:
+
+#+cindex: @samp{ATTR_TEXINFO}, keyword
+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.
+
+#+begin_example
+,#+ATTR_TEXINFO: :columns .5 .5
+| a cell | another cell |
+#+end_example
+
+*** Images in Texinfo export
+:PROPERTIES:
+:DESCRIPTION: Image attributes.
+:END:
+
+#+cindex: @samp{ATTR_TEXINFO}, keyword
+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:
+
+#+begin_example
+,#+ATTR_TEXINFO: :width 1in :alt Alternate @i{text}
+[[ridt.pdf]]
+#+end_example
+
+*** Quotations in Texinfo export
+:PROPERTIES:
+:DESCRIPTION: Quote block attributes.
+:END:
+
+#+cindex: @samp{ATTR_TEXINFO}, keyword
+You can write the text of a quotation within a quote block (see
+[[*Paragraphs]]). You may also emphasize some text at the beginning of
+the quotation with the =:tag= attribute.
+
+#+begin_example
+,#+ATTR_TEXINFO: :tag Warning
+,#+BEGIN_QUOTE
+Striking your thumb with a hammer may cause severe pain and discomfort.
+,#+END_QUOTE
+#+end_example
+
+To specify the author of the quotation, use the =:author= attribute.
+
+#+begin_example
+,#+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
+#+end_example
+
+*** Special blocks in Texinfo export
+:PROPERTIES:
+:DESCRIPTION: Special block attributes.
+:END:
+
+#+cindex: @samp{ATTR_TEXINFO}, keyword
+
+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:
+
+#+begin_example
+,#+ATTR_TEXINFO: :options org-org-export-to-org ...
+,#+BEGIN_defun
+ A somewhat obsessive function name.
+,#+END_defun
+#+end_example
+
+#+texinfo: @noindent
+becomes
+
+#+begin_example
+@defun org-org-export-to-org ...
+ A somewhat obsessive function name.
+@end defun
+#+end_example
+
+*** A Texinfo example
+:PROPERTIES:
+:DESCRIPTION: Processing Org to Texinfo.
+:END:
+
+Here is a more detailed example Org file. See
+[[info:texinfo::GNU Sample Texts]] for an equivalent example using
+Texinfo code.
+
+#+begin_example
+,#+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:
+
+ ,#+INCLUDE: fdl.org
+
+,* Index
+ :PROPERTIES:
+ :INDEX: cp
+ :END:
+#+end_example
+
+** iCalendar Export
+:PROPERTIES:
+:DESCRIPTION: Exporting to iCalendar.
+:END:
+#+cindex: 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.
+
+#+vindex: org-icalendar-include-todo
+#+vindex: org-icalendar-use-deadline
+#+vindex: org-icalendar-use-scheduled
+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.
+
+#+vindex: org-icalendar-categories
+#+vindex: org-icalendar-alarm-time
+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.
+
+#+vindex: org-icalendar-store-UID
+#+cindex: @samp{ID}, property
+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.
+
+- {{{kbd(C-c C-e c f)}}} (~org-icalendar-export-to-ics~) ::
+
+ #+kindex: C-c C-e c f
+ #+findex: 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=.
+
+- {{{kbd(C-c C-e c a)}}} (~org-icalendar-export-agenda-files~) ::
+
+ #+kindex: C-c C-e c a
+ #+findex: 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.
+
+- {{{kbd(C-c C-e c c)}}} (~org-icalendar-combine-agenda-files~) ::
+
+ #+kindex: C-c C-e c c
+ #+findex: org-icalendar-combine-agenda-files
+ #+vindex: org-icalendar-combined-agenda-file
+ Create a combined iCalendar file from Org files in
+ ~org-agenda-files~ and write it to
+ ~org-icalendar-combined-agenda-file~ file name.
+
+#+cindex: @samp{SUMMARY}, property
+#+cindex: @samp{DESCRIPTION}, property
+#+cindex: @samp{LOCATION}, property
+#+cindex: @samp{TIMEZONE}, property
+#+cindex: @samp{CLASS}, property
+The iCalendar export back-end includes =SUMMARY=, =DESCRIPTION=,
+=LOCATION=, =TIMEZONE= and =CLASS= properties from the Org entries
+when exporting. To force the back-end to inherit the =LOCATION=,
+=TIMEZONE= and =CLASS= properties, configure the
+~org-use-property-inheritance~ variable.
+
+#+vindex: org-icalendar-include-body
+When Org entries do not have =SUMMARY=, =DESCRIPTION=, =LOCATION= and
+=CLASS= 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.
+
+The =CLASS= property can be used to specify a per-entry visibility
+class or access restrictions, and is applied to any entry with class
+information. The iCalendar standard defines three visibility classes:
+- =PUBLIC= :: The entry is publicly visible (this is the default).
+- =CONFIDENTIAL= :: Only a limited group of clients get access to the
+ event.
+- =PRIVATE= :: The entry can be retrieved only by its owner.
+The server should treat unknown class properties the same as
+=PRIVATE=.
+
+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.
+
+** Other Built-in Back-ends
+:PROPERTIES:
+:DESCRIPTION: Exporting to a man page.
+:END:
+
+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 [[*The Export
+Dispatcher]]).
+
+Follow the comment section of such files, for example, =ox-man.el=,
+for usage and configuration details.
+
+** Advanced Export Configuration
+:PROPERTIES:
+:DESCRIPTION: Fine-tuning the export output.
+:END:
+
+*** Export hooks
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+vindex: org-export-before-processing-hook
+#+vindex: org-export-before-parsing-hook
+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:
+
+#+begin_src emacs-lisp
+(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)
+#+end_src
+
+*** Filters
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: Filters, exporting
+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 {{{var(TYPE)}}}
+is the type targeted by the filter. Valid types are:
+
+#+attr_texinfo: :columns 0.33 0.33 0.33
+| 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.
+
+#+begin_src emacs-lisp
+(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)
+#+end_src
+
+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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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.
+
+#+begin_example
+,#+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
+#+end_example
+
+*** Extending an existing back-end
+:PROPERTIES:
+:UNNUMBERED: notoc
+: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.
+
+#+begin_src emacs-lisp
+(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)))
+#+end_src
+
+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:
+
+#+begin_src emacs-lisp
+(org-export-to-buffer 'my-ascii "*Org MY-ASCII Export*")
+#+end_src
+
+Further steps to consider would be an interactive function,
+self-installing an item in the export dispatcher menu, and other
+user-friendly improvements.
+
+** Export in Foreign Buffers
+:PROPERTIES:
+:DESCRIPTION: Author tables and lists in Org syntax.
+:END:
+
+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~ ::
+
+ #+findex: org-ascii-convert-region-to-ascii
+ Convert the selected region into ASCII.
+
+- ~org-ascii-convert-region-to-utf8~ ::
+
+ #+findex: org-ascii-convert-region-to-utf8
+ Convert the selected region into UTF-8.
+
+- ~org-html-convert-region-to-html~ ::
+
+ #+findex: org-html-convert-region-to-html
+ Convert the selected region into HTML.
+
+- ~org-latex-convert-region-to-latex~ ::
+
+ #+findex: org-latex-convert-region-to-latex
+ Convert the selected region into LaTeX.
+
+- ~org-texinfo-convert-region-to-texinfo~ ::
+
+ #+findex: org-texinfo-convert-region-to-texinfo
+ Convert the selected region into Texinfo.
+
+- ~org-md-convert-region-to-md~ ::
+
+ #+findex: 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
+{{{kbd(M-x org-html-convert-region-to-html)}}}.
+
+*** Exporting to minimal HTML
+:PROPERTIES:
+:DESCRIPTION: Exporting HTML without CSS, Javascript, etc.
+:ALT_TITLE: Bare HTML
+:END:
+
+If you want to output a minimal HTML file, with no CSS, no Javascript,
+no preamble or postamble, here are the variable you would need to set:
+
+#+vindex: org-html-head
+#+vindex: org-html-head-extra
+#+vindex: org-html-head-include-default-style
+#+vindex: org-html-head-include-scripts
+#+vindex: org-html-preamble
+#+vindex: org-html-postamble
+#+vindex: org-html-use-infojs
+#+begin_src emacs-lisp
+(setq org-html-head ""
+ org-html-head-extra ""
+ org-html-head-include-default-style nil
+ org-html-head-include-scripts nil
+ org-html-preamble nil
+ org-html-postamble nil
+ org-html-use-infojs nil)
+#+end_src
+
+* Publishing
+:PROPERTIES:
+:DESCRIPTION: Create a web site of linked Org files.
+:END:
+#+cindex: 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.
+
+** Configuration
+:PROPERTIES:
+:DESCRIPTION: Defining projects.
+:END:
+Publishing needs significant configuration to specify files,
+destination and many other properties of a project.
+
+*** The variable ~org-publish-project-alist~
+:PROPERTIES:
+:DESCRIPTION: The central configuration variable.
+:ALT_TITLE: Project alist
+:END:
+#+cindex: projects, for publishing
+
+#+vindex: 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:
+
+#+begin_src emacs-lisp
+("project-name" :property value :property value ...)
+#+end_src
+
+#+texinfo: @noindent
+i.e., a well-formed property list with alternating keys and values,
+or:
+
+#+begin_src emacs-lisp
+("project-name" :components ("project-name" "project-name" ...))
+#+end_src
+
+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.
+
+*** Sources and destinations for files
+:PROPERTIES:
+:DESCRIPTION: From here to there.
+:ALT_TITLE: Sources and destinations
+:END:
+#+cindex: directories, for publishing
+
+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 [[*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.
+
+*** Selecting files
+:PROPERTIES:
+:DESCRIPTION: What files are part of the project?
+:END:
+#+cindex: files, selecting for publishing
+
+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.
+
+*** Publishing action
+:PROPERTIES:
+:DESCRIPTION: Setting the function doing the publishing.
+:END:
+#+cindex: action, for publishing
+
+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 (see [[*HTML
+Export]]). But you can also 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
+/archived/, /commented/, and /tag-excluded/ trees removed, use
+~org-org-publish-to-org~. This produces =file.org= and puts 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[fn:141].
+
+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.
+
+*** Options for the exporters
+:PROPERTIES:
+:DESCRIPTION: Tweaking HTML/@LaTeX{} export.
+:ALT_TITLE: Publishing options
+:END:
+#+cindex: options, for publishing
+#+cindex: publishing options
+
+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.
+
+#+vindex: org-publish-project-alist
+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 [[*Export
+Settings]]), however, override everything.
+
+**** Generic properties
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+| ~: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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+| ~: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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+| ~: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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+| ~: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-equation-reference-format~ | ~org-html-equation-reference-format~ |
+| ~: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-self-link-headlines~ | ~org-html-self-link-headlines~ |
+| ~: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-wrap-src-lines~ | ~org-html-wrap-src-lines~ |
+| ~:html-xml-declaration~ | ~org-html-xml-declaration~ |
+
+**** LaTeX specific properties
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+| ~: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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+| ~:md-footnote-format~ | ~org-md-footnote-format~ |
+| ~:md-footnotes-section~ | ~org-md-footnotes-section~ |
+| ~:md-headline-style~ | ~org-md-headline-style~ |
+
+**** ODT specific properties
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+| ~: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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+| ~: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~ |
+
+*** Publishing links
+:PROPERTIES:
+:DESCRIPTION: Which links keep working after publishing?
+:END:
+#+cindex: links, publishing
+
+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 [[*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 [[*Example: complex publishing configuration]], for an example of this
+usage.
+
+Eventually, links between published documents can contain some search
+options (see [[*Search Options in File Links]]), 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=.
+
+#+begin_example
+[[file:foo.org::*heading]]
+[[file:foo.org::#custom-id]]
+[[file:foo.org::target]]
+#+end_example
+
+*** Generating a sitemap
+:PROPERTIES:
+:DESCRIPTION: Generating a list of all pages.
+:ALT_TITLE: Site map
+:END:
+#+cindex: sitemap, of published pages
+
+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~ ::
+
+ #+findex: org-publish-find-date
+ #+findex: org-publish-find-property
+ #+findex: org-publish-find-title
+ 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~.
+
+*** Generating an index
+:PROPERTIES:
+:DESCRIPTION: An index that reaches across pages.
+:END:
+#+cindex: index, in a publishing project
+
+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.
+
+#+cindex: @samp{INDEX}, keyword
+Index entries are specified with =INDEX= keyword. An entry that
+contains an exclamation mark creates a sub item.
+
+#+begin_example
+,*** Curriculum Vitae
+,#+INDEX: CV
+,#+INDEX: Application!CV
+#+end_example
+
+** Uploading Files
+:PROPERTIES:
+:DESCRIPTION: How to get files up on the server.
+:END:
+#+cindex: rsync
+#+cindex: unison
+
+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.
+
+** Sample Configuration
+:PROPERTIES:
+:DESCRIPTION: Example projects.
+:END:
+
+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.
+
+*** Example: simple publishing configuration
+:PROPERTIES:
+:DESCRIPTION: One-component publishing.
+:ALT_TITLE: Simple example
+:END:
+
+This example publishes a set of Org files to the =public_html=
+directory on the local machine.
+
+#+begin_src emacs-lisp
+(setq org-publish-project-alist
+ '(("org"
+ :base-directory "~/org/"
+ :publishing-function org-html-publish-to-html
+ :publishing-directory "~/public_html"
+ :section-numbers nil
+ :with-toc nil
+ :html-head "<link rel=\"stylesheet\"
+ href=\"../other/mystyle.css\"
+ type=\"text/css\"/>")))
+#+end_src
+
+*** Example: complex publishing configuration
+:PROPERTIES:
+:DESCRIPTION: A multi-component publishing example.
+:ALT_TITLE: Complex example
+:END:
+
+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.
+
+#+begin_src emacs-lisp
+(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 "<link rel=\"stylesheet\"
+ href=\"../other/mystyle.css\" type=\"text/css\"/>"
+ :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"))))
+#+end_src
+
+** Triggering Publication
+:PROPERTIES:
+:DESCRIPTION: Publication commands.
+:END:
+
+Once properly configured, Org can publish with the following commands:
+
+- {{{kbd(C-c C-e P x)}}} (~org-publish~) ::
+
+ #+kindex: C-c C-e P x
+ #+findex: org-publish
+ Prompt for a specific project and publish all files that belong to
+ it.
+
+- {{{kbd(C-c C-e P p)}}} (~org-publish-current-project~) ::
+
+ #+kindex: C-c C-e P p
+ #+findex: org-publish-current-project
+ Publish the project containing the current file.
+
+- {{{kbd(C-c C-e P f)}}} (~org-publish-current-file~) ::
+
+ #+kindex: C-c C-e P f
+ #+findex: org-publish-current-file
+ Publish only the current file.
+
+- {{{kbd(C-c C-e P a)}}} (~org-publish-all~) ::
+
+ #+kindex: C-c C-e P a
+ #+findex: org-publish-all
+ Publish every project.
+
+#+vindex: org-publish-use-timestamps-flag
+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.
+
+* Citation handling
+:PROPERTIES:
+:DESCRIPTION: create, follow and export citations.
+:END:
+#+cindex: citation
+
+The =oc.el= library provides tooling to handle citations in Org via
+"citation processors" that offer some or all of the following
+capabilities:
+
+- activate :: Fontification, tooltip preview, etc.
+- follow :: At-point actions on citations via ~org-open-at-point~.
+- insert :: Add and edit citations via ~org-cite-insert~.
+- export :: Via different libraries for different target formats.
+
+The user can configure these with ~org-cite-activate-processor~,
+~org-cite-follow-processor~, ~org-cite-insert-processor~, and
+~org-cite-export-processors~ respectively.
+
+The included "basic" processor provides all four capabilities.
+
+** Citations
+
+Before adding citations, first set one-or-more bibliographies, either
+globally with ~org-cite-global-bibliography~, or locally using one or
+more "bibliography" keywords.
+
+#+begin_example
+#+bibliography: SomeFile.bib
+#+bibliography: /some/other/file.json
+#+bibliography: "/some/file/with spaces/in its name.bib"
+#+end_example
+
+#+kindex: C-c C-x @@
+#+findex: org-cite-insert
+One can then insert and edit citations using ~org-cite-insert~, called
+with {{{kbd(C-c C-x @)}}}.
+
+A /citation/ requires one or more citation /key(s)/, elements
+identifying a reference in the bibliography.
+
+- Each citation is surrounded by brackets and uses the =cite= type.
+
+- Each key starts with the character =@=.
+
+- Each key can be qualified by a /prefix/ (e.g.\nbsp{}"see ") and/or
+ a /suffix/ (e.g.\nbsp{}"p.\nbsp{}123"), giving information useful or necessary
+ fo the comprehension of the citation but not included in the
+ reference.
+
+- A single citation can cite more than one reference ; the keys are
+ separated by semicolons ; the formatting of such citation groups is
+ specified by the style.
+
+- One can also specify a stylistic variation for the citations by
+ inserting a =/= and a style name between the =cite= keyword and the
+ colon; this usually makes sense only for the author-year styles.
+
+: [cite/style:common prefix ;prefix @key suffix; ... ; common suffix]
+
+The only mandatory elements are:
+
+- The =cite= keyword and the colon.
+- The =@= character immediately preceding each key.
+- The brackets surrounding the citation(s) (group).
+
+** Citation export processors
+
+Org currently includes the following export processors:
+
+- Two processors can export to a variety of formats, including =latex=
+ (and therefore =pdf=), =html=, =odt= and plain (UTF8) text:
+
+ - basic :: a basic export processor, well adapted to situations
+ where backward compatibility is not a requirement and formatting
+ needs are minimal;
+
+ - csl :: this export processor uses format files written in [[https://en.wikipedia.org/wiki/Citation_Style_Language][Citation
+ Style Language]] via [[https://github.com/andras-simonyi/citeproc-el][citeproc-el]];
+
+- In contrast, two other processors target LaTeX and LaTeX-derived
+ formats exclusively:
+
+ - natbib :: this export processor uses BibTeX, the historical
+ bibliographic processor used with LaTeX, thus allowing the use of
+ data and style files compatible with this processor (including
+ a large number of publishers' styles). It uses citation commands
+ implemented in the LaTeX package =natbib=, allowing more stylistic
+ variants that LaTeX's =\cite= command.
+
+ - biblatex :: this backend allows the use of data and formats
+ prepared for BibLaTeX, an alternate bibliographic processor used
+ with LaTeX, which overcomes some serious BibTeX limitations, but
+ has not (yet?)\nbsp{}been widely adopted by publishers.
+
+The =CITE_EXPORT= keyword specifies the export processor and the
+citation (and possibly reference) style(s); for example (all arguments
+are optional)
+
+: #+cite_export: basic author author-year
+
+#+texinfo: @noindent
+specifies the "basic" export processor with citations inserted as
+author's name and references indexed by author's names and year;
+
+: #+cite_export: csl /some/path/to/vancouver-brackets.csl
+
+#+texinfo: @noindent
+specifies the "csl" processor and CSL style, which in this case
+defines numeric citations and numeric references according to the
+=Vancouver= specification (as style used in many medical journals),
+following a typesetting variation putting citations between brackets;
+
+: #+cite_export: natbib kluwer
+
+#+texinfo: @noindent
+specifies the =natbib= export processor with a label citation style
+conformant to the Harvard style and the specification of the
+Wolkers-Kluwer publisher; since it relies on the ~bibtex~ processor of
+your LaTeX installation, it won't export to anything but PDF.
+
+* Working with Source Code
+:PROPERTIES:
+:DESCRIPTION: Export, evaluate, and tangle code blocks.
+:END:
+#+cindex: source code, working with
+
+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_example
+,#+BEGIN_SRC emacs-lisp
+ (defun org-xor (a b)
+ "Exclusive or."
+ (if a (not b) b))
+,#+END_SRC
+#+end_example
+
+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=.
+
+Details of Org's facilities for working with source code are described
+in the following sections.
+
+** Features Overview
+:PROPERTIES:
+:DESCRIPTION: Enjoy the versatility of source blocks.
+:END:
+
+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 the "liveliness" of each
+source code block by tweaking the header arguments (see [[*Using Header
+Arguments]]) for compiling, execution, extraction, and exporting.
+
+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.
+
+** Structure of Code Blocks
+:PROPERTIES:
+:DESCRIPTION: Code block syntax described.
+:END:
+#+cindex: code block, structure
+#+cindex: source code, block structure
+#+cindex: @samp{NAME} keyword, in source blocks
+#+cindex: @samp{BEGIN_SRC}
+
+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:
+
+#+begin_example
+,#+NAME: <name>
+,#+BEGIN_SRC <language> <switches> <header arguments>
+ <body>
+,#+END_SRC
+#+end_example
+
+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
+[[*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.
+
+#+cindex: source code, inline
+An inline code block conforms to this structure:
+
+: src_<language>{<body>}
+
+#+texinfo: @noindent
+or
+
+: src_<language>[<header arguments>]{<body>}
+
+- =#+NAME: <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 [[*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.
+
+- =<language>= ::
+
+ #+cindex: language, in code blocks
+ Mandatory. It is the identifier of the source code language in the
+ block. See [[*Languages]], for identifiers of supported languages.
+
+- =<switches>= ::
+
+ #+cindex: switches, in code blocks
+ Optional. Switches provide finer control of the code execution,
+ export, and format (see the discussion of switches in [[*Literal
+ Examples]]).
+
+- =<header arguments>= ::
+
+ #+cindex: header arguments, in code blocks
+ Optional. Heading arguments control many aspects of evaluation,
+ export and tangling of code blocks (see [[*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.
+
+- =<body>= ::
+
+ Source code in the dialect of the specified language identifier.
+
+** Using Header Arguments
+:PROPERTIES:
+:DESCRIPTION: Different ways to set header arguments.
+:END:
+
+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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+#+vindex: org-babel-default-header-args
+
+#+vindex: org-babel-default-header-args
+System-wide values of header arguments can be specified by customizing
+the ~org-babel-default-header-args~ variable, which defaults to the
+following values:
+
+#+begin_example
+:session => "none"
+:results => "replace"
+:exports => "code"
+:cache => "no"
+:noweb => "no"
+#+end_example
+
+The example below sets =:noweb= header arguments to =yes=, which makes
+Org expand =:noweb= references by default.
+
+#+begin_src emacs-lisp
+(setq org-babel-default-header-args
+ (cons '(:noweb . "yes")
+ (assq-delete-all :noweb org-babel-default-header-args)))
+#+end_src
+
+#+cindex: language specific default header arguments
+#+cindex: default header arguments per language
+Each language can have separate default header arguments by
+customizing the variable ~org-babel-default-header-args:<LANG>~, where
+{{{var(<LANG>)}}} is the name of the language. For details, see the
+language-specific online documentation at
+https://orgmode.org/worg/org-contrib/babel/.
+
+*** Header arguments in Org mode properties
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+For header arguments applicable to the buffer, use =PROPERTY= keyword
+anywhere in the Org file (see [[*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.
+
+#+begin_example
+,#+PROPERTY: header-args:R :session *R*
+,#+PROPERTY: header-args :results silent
+#+end_example
+
+#+vindex: org-use-property-inheritance
+Header arguments set through Org's property drawers (see [[*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.
+
+#+begin_example
+,* sample header
+ :PROPERTIES:
+ :header-args: :cache yes
+ :END:
+#+end_example
+
+#+kindex: C-c C-x p
+#+findex: org-set-property
+Properties defined through ~org-set-property~ function, bound to
+{{{kbd(C-c C-x p)}}}, apply to all active languages. They override
+properties set in ~org-babel-default-header-args~.
+
+#+cindex: language specific header arguments properties
+#+cindex: header arguments per language
+Language-specific header arguments are also read from properties
+=header-args:<LANG>= where {{{var(<LANG>)}}} is the language
+identifier. For example,
+
+#+begin_example
+,* Heading
+ :PROPERTIES:
+ :header-args:clojure: :session *clojure-1*
+ :header-args:R: :session *R*
+ :END:
+,** Subheading
+ :PROPERTIES:
+ :header-args:clojure: :session *clojure-2*
+ :END:
+#+end_example
+
+#+texinfo: @noindent
+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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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.
+
+#+begin_example
+,#+NAME: factorial
+,#+BEGIN_SRC haskell :results silent :exports code :var n=0
+ fac 0 = 1
+ fac n = n * fac (n-1)
+,#+END_SRC
+#+end_example
+
+The same header arguments in an inline code block:
+
+: src_haskell[:exports both]{fac 5}
+
+#+cindex: @samp{HEADER}, keyword
+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:
+
+#+begin_example
+,#+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
+#+end_example
+
+Multi-line header arguments on a named code block:
+
+#+begin_example
+,#+NAME: named-block
+,#+HEADER: :var data=2
+,#+BEGIN_SRC emacs-lisp
+ (message "data:%S" data)
+,#+END_SRC
+
+,#+RESULTS: named-block
+ : data:2
+#+end_example
+
+*** Header arguments in function calls
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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 [[*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)
+
+** Environment of a Code Block
+:PROPERTIES:
+:DESCRIPTION: Arguments, sessions, working directory...
+:END:
+
+*** Passing arguments
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: passing arguments to code blocks
+#+cindex: arguments, in code blocks
+#+cindex: @samp{var}, header argument
+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
+
+#+texinfo: @noindent
+{{{var(NAME)}}} is the name of the variable bound in the code block
+body. {{{var(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. {{{var(ASSIGN)}}} may specify a filename for references
+to elements in a different file, using a =:= to separate the filename
+from the reference.
+
+: :var NAME=FILE:REFERENCE
+
+Here are examples of passing values by reference:
+
+- table ::
+
+ A table named with a =NAME= keyword.
+
+ #+begin_example
+ ,#+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
+ #+end_example
+
+ When passing a table, you can treat specially the row, or the
+ column, containing labels for the columns, or the rows, in the
+ table.
+
+ #+cindex: @samp{colnames}, header argument
+ 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.
+
+ #+begin_example
+ ,#+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* |
+ #+end_example
+
+ #+cindex: @samp{rownames}, header argument
+ 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.
+
+ #+begin_example
+ ,#+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 |
+ #+end_example
+
+To refer to a table in another file, join the filename and table name with
+a colon, for example: =:var table=other-file.org:example-table=.
+
+- list ::
+
+ A simple named list.
+
+ #+begin_example
+ ,#+NAME: example-list
+ - simple
+ - not
+ - nested
+ - list
+
+ ,#+BEGIN_SRC emacs-lisp :var x=example-list
+ (print x)
+ ,#+END_SRC
+
+ ,#+RESULTS:
+ | simple | list |
+ #+end_example
+
+ 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_example
+ ,#+BEGIN_SRC emacs-lisp :var length=table-length()
+ (* 2 length)
+ ,#+END_SRC
+
+ ,#+RESULTS:
+ : 8
+ #+end_example
+
+- code block with arguments ::
+
+ A code block name, as assigned by =NAME= keyword, followed by
+ parentheses and optional arguments passed within the parentheses.
+
+ #+begin_example
+ ,#+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
+ #+end_example
+
+- literal example ::
+
+ A literal example block named with a =NAME= keyword.
+
+ #+begin_example
+ ,#+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.
+ #+end_example
+
+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=:
+
+#+begin_example
+,#+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
+#+end_example
+
+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=.
+
+#+begin_example
+,#+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 |
+#+end_example
+
+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.
+
+#+begin_example
+,#+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 |
+#+end_example
+
+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.
+
+#+begin_example
+,#+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 |
+#+end_example
+
+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_example
+,#+BEGIN_SRC sh :var filename=(buffer-file-name) :exports both
+ wc -w $filename
+,#+END_SRC
+#+end_example
+
+Note that values read from tables and lists are not mistakenly
+evaluated as Emacs Lisp code, as illustrated in the following example.
+
+#+begin_example
+,#+NAME: table
+| (a b c) |
+
+,#+HEADER: :var data=table[0,0]
+,#+BEGIN_SRC perl
+ $data
+,#+END_SRC
+
+,#+RESULTS:
+: (a b c)
+#+end_example
+
+*** Using sessions
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: using sessions in code blocks
+#+cindex: @samp{session}, header argument
+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.
+
+- {{{var(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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: working directory, in a code block
+#+cindex: @samp{dir}, header argument
+#+cindex: @samp{mkdirp}, header argument
+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
+DIRECTORY= temporarily has the same effect as changing the current
+directory with {{{kbd(M-x cd RET DIRECTORY)}}}, and then not setting
+=dir=. Under the surface, =dir= simply sets the value of the Emacs
+variable ~default-directory~. Setting =mkdirp= header argument to
+a non-~nil~ value creates the directory, if necessary.
+
+For example, to save the plot file in the =Work/= folder of the home
+directory---notice tilde is expanded:
+
+#+begin_example
+,#+BEGIN_SRC R :file myplot.png :dir ~/Work
+ matplot(matrix(rnorm(100), 10), type="l")
+,#+END_SRC
+#+end_example
+
+To evaluate the code block on a remote machine, supply a remote
+directory name using Tramp syntax. For example:
+
+#+begin_example
+,#+BEGIN_SRC R :file plot.png :dir /scp:dand@yakuba.princeton.edu:
+ plot(1:10, main=system("hostname", intern=TRUE))
+,#+END_SRC
+#+end_example
+
+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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: headers, in code blocks
+#+cindex: footers, in code blocks
+#+cindex: @samp{prologue}, header argument
+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:
+
+#+begin_src emacs-lisp
+(add-to-list 'org-babel-default-header-args:gnuplot
+ '((:prologue . "reset")))
+
+#+end_src
+
+#+cindex: @samp{epilogue}, header argument
+Likewise, the value of the =epilogue= header argument is for appending
+to the end of the code block for execution.
+
+** Evaluating Code Blocks
+:PROPERTIES:
+:DESCRIPTION: Place results of evaluation in the Org buffer.
+:END:
+#+cindex: code block, evaluating
+#+cindex: source code, evaluating
+#+cindex: @samp{RESULTS}, keyword
+
+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 [[*Code Evaluation and Security Issues]].
+
+*** How to evaluate source code
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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 [[*Languages]] to enable other languages.
+
+#+kindex: C-c C-c
+#+kindex: C-c C-v e
+#+findex: org-babel-execute-src-block
+Org provides many ways to execute code blocks. {{{kbd(C-c C-c)}}} or
+{{{kbd(C-c C-v e)}}} with the point on a code block[fn:142] calls the
+~org-babel-execute-src-block~ function, which executes the code in the
+block, collects the results, and inserts them in the buffer.
+
+#+cindex: @samp{CALL}, keyword
+#+vindex: org-babel-inline-result-wrap
+By calling a named code block[fn:143] 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 [[*Library of Babel]]).
+
+The syntax for =CALL= keyword is:
+
+#+begin_example
+,#+CALL: <name>(<arguments>)
+,#+CALL: <name>[<inside header arguments>](<arguments>) <end header arguments>
+#+end_example
+
+The syntax for inline named code blocks is:
+
+#+begin_example
+... call_<name>(<arguments>) ...
+... call_<name>[<inside header arguments>](<arguments>)[<end header arguments>] ...
+#+end_example
+
+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.
+
+- =<name>= ::
+
+ This is the name of the code block (see [[*Structure of Code Blocks]])
+ to be evaluated in the current document. If the block is located in
+ another file, start =<name>= 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()
+
+- =<arguments>= ::
+
+ 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)
+
+ #+texinfo: @noindent
+ Note how this function call syntax is different from the header
+ argument syntax.
+
+- =<inside header arguments>= ::
+
+ 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>= ::
+
+ 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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: @samp{eval}, header argument
+#+cindex: control 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 [[*Code Evaluation and Security Issues]]).
+
+*** Cache results of evaluation
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: @samp{cache}, header argument
+#+cindex: cache results of code 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 [[*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 [[*Noweb Reference Syntax]]).
+
+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.
+
+#+begin_example
+,#+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
+#+end_example
+
+** Results of Evaluation
+:PROPERTIES:
+:DESCRIPTION: Choosing a results type, post-processing...
+:END:
+#+cindex: code block, results of evaluation
+#+cindex: source code, results of evaluation
+
+#+cindex: @samp{results}, header argument
+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 results;
+
+- Handling ::
+
+ For inserting results once they are properly formatted.
+
+*** Collection
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+Collection options specify the results. Choose one of the options;
+they are mutually exclusive.
+
+- =value= ::
+
+ Default for most Babel libraries[fn:143]. 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 [[*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 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.
+
+*** Type
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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.
+
+#+attr_texinfo: :sep ,
+- =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=.
+
+ #+cindex: @samp{hlines}, header argument
+ 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.
+
+ #+begin_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 |
+ #+end_example
+
+- =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.
+
+ #+cindex: @samp{file}, header argument
+ #+cindex: @samp{output-dir}, header argument
+ 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_example
+ ,#+BEGIN_SRC asymptote :results value file :file circle.pdf :output-dir img/
+ size(2cm);
+ draw(unitcircle);
+ ,#+END_SRC
+ #+end_example
+
+ #+cindex: @samp{file-ext}, header argument
+ If =file= header argument 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.
+
+ #+begin_example
+ ,#+name: circle
+ ,#+BEGIN_SRC asymptote :results value file :file-ext pdf
+ size(2cm);
+ draw(unitcircle);
+ ,#+END_SRC
+ #+end_example
+
+ #+cindex: @samp{file-desc}, header argument
+ The =file-desc= header argument defines the description (see [[*Link
+ Format]]) for the link. If =file-desc= is present but has no value,
+ the =file= value is used as the link description. When this
+ argument is not present, the description is omitted. If you want to
+ provide the =file-desc= argument but omit the description, you can
+ provide it with an empty vector (i.e., :file-desc []).
+
+ #+cindex: @samp{sep}, header argument
+ 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.
+
+ #+cindex: @samp{file-mode}, header argument
+ The =file-mode= header argument defines the file permissions. To
+ make it executable, use =:file-mode (identity #o755)=.
+
+ #+begin_example
+ ,#+BEGIN_SRC shell :results file :file script.sh :file-mode (identity #o755)
+ echo "#!/bin/bash"
+ echo "echo Hello World"
+ ,#+END_SRC
+ #+end_example
+
+*** Format
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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.
+
+#+attr_texinfo: :sep ,
+- =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= ::
+
+ When used along with =file= type, the result is a link to the file
+ specified in =:file= header argument. However, unlike plain =file=
+ type, nothing is written to the disk. The block is used for its
+ side-effects only, as in the following example:
+
+ #+begin_example
+ ,#+begin_src shell :results file link :file "download.tar.gz"
+ wget -c "https://example.com/download.tar.gz"
+ ,#+end_src
+ #+end_example
+
+- =org= ::
+
+ Results enclosed in a =BEGIN_SRC org= block. For comma-escape,
+ either {{{kbd(TAB)}}} 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=.
+
+#+cindex: @samp{wrap}, header argument
+The =wrap= header argument unconditionally 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_example
+,#+BEGIN_SRC emacs-lisp :results html :wrap EXPORT markdown
+"<blink>Welcome back to the 90's</blink>"
+,#+END_SRC
+
+,#+RESULTS:
+,#+BEGIN_EXPORT markdown
+<blink>Welcome back to the 90's</blink>
+,#+END_EXPORT
+#+end_example
+
+*** Handling
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+Handling options after collecting the results.
+
+- =replace= ::
+
+ Default. Insert results in the Org buffer. Remove previous
+ results. Usage example: =:results output replace=.
+
+- =silent= ::
+
+ Do not insert results in the Org mode buffer, but echo them in the
+ minibuffer. Usage example: =:results output silent=.
+
+- =none= ::
+
+ Do not process results at all. No inserting in the Org mode buffer
+ nor echo them in the minibuffer. Usage example: =:results none=.
+
+- =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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: @samp{post}, header argument
+#+cindex: @samp{*this*}, in @samp{post} header argument
+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 [[*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=.
+
+#+begin_example
+,#+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:
+#+end_example
+
+The second example shows use of =colnames= header argument in =post=
+to pass data between code blocks.
+
+#+begin_example
+,#+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 |
+#+end_example
+
+** Exporting Code Blocks
+:PROPERTIES:
+:DESCRIPTION: Export contents and/or results.
+:END:
+#+cindex: code block, exporting
+#+cindex: source code, exporting
+
+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 [[*Literal
+Examples]]. To selectively export sub-trees of an Org document, see
+[[*Exporting]].
+
+#+cindex: @samp{exports}, header argument
+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=.
+
+#+vindex: org-export-use-babel
+To stop Org from evaluating code blocks to speed exports, use the
+header argument =:eval never-export= (see [[*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 [[*Evaluating Code Blocks]]).
+
+Org never evaluates code blocks in commented sub-trees when exporting
+(see [[*Comment Lines]]). On the other hand, Org does evaluate code
+blocks in sub-trees excluded from export (see [[*Export Settings]]).
+
+** Extracting Source Code
+:PROPERTIES:
+:DESCRIPTION: Create pure source code files.
+:END:
+#+cindex: tangling
+#+cindex: source code, extracting
+#+cindex: code block, 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 [[*Noweb Reference Syntax]]).
+
+*** Header arguments
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+cindex: @samp{tangle}, header argument
+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=.
+
+- {{{var(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=.
+
+#+cindex: @samp{mkdirp}, header argument
+The =mkdirp= header argument creates parent directories for tangled
+files if the directory does not exist. A =yes= value enables
+directory creation whereas =no= inhibits it.
+
+#+cindex: @samp{comments}, header argument
+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 [[*Noweb
+ Reference Syntax]]), and wraps them in link comments inside the body
+ of the code block.
+
+#+cindex: @samp{padline}, header argument
+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.
+
+#+cindex: @samp{shebang}, header argument
+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.
+
+#+cindex: @samp{tangle-mode}, header argument
+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.
+
+#+cindex: @samp{no-expand}, header argument
+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
+[[*Environment of a Code Block]]) to variables. Expansions also replace
+noweb references with their targets (see [[*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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- ~org-babel-tangle~ ::
+
+ #+findex: org-babel-tangle
+ #+kindex: C-c C-v t
+ Tangle the current file. Bound to {{{kbd(C-c C-v t)}}}.
+
+ With prefix argument only tangle the current code block.
+
+- ~org-babel-tangle-file~ ::
+
+ #+findex: org-babel-tangle-file
+ #+kindex: C-c C-v f
+ Choose a file to tangle. Bound to {{{kbd(C-c C-v f)}}}.
+
+*** Tangle hooks
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- ~org-babel-post-tangle-hook~ ::
+
+ #+vindex: 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
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+#+findex: org-babel-tangle-jump-to-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.
+
+** Languages
+:PROPERTIES:
+:DESCRIPTION: List of supported code block languages.
+:END:
+#+cindex: babel, languages
+#+cindex: source code, languages
+#+cindex: code block, languages
+
+Code blocks in dozens of languages are supported. See Worg for
+[[https://orgmode.org/worg/org-contrib/babel/languages/index.html][language specific documentation]].
+
+#+vindex: org-babel-load-languages
+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.
+
+#+begin_src emacs-lisp
+(org-babel-do-load-languages
+ 'org-babel-load-languages
+ '((emacs-lisp . nil)
+ (R . t)))
+#+end_src
+
+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:
+
+#+begin_src emacs-lisp
+(require 'ob-clojure)
+#+end_src
+
+** Editing Source Code
+:PROPERTIES:
+:DESCRIPTION: Language major-mode editing.
+:END:
+#+cindex: code block, editing
+#+cindex: source code, editing
+
+#+kindex: C-c '
+Use {{{kbd(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 {{{kbd(C-c ')}}} again to close the buffer
+and return to the Org buffer.
+
+#+kindex: C-x C-s
+#+vindex: org-edit-src-auto-save-idle-delay
+#+cindex: auto-save, in code block editing
+{{{kbd(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~ ::
+
+ #+vindex: org-src-lang-modes
+ If an Emacs major-mode named ~<LANG>-mode~ exists, where
+ {{{var(<LANG>)}}} 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~ ::
+
+ #+vindex: org-src-window-setup
+ For specifying Emacs window arrangement when the new edit buffer is
+ created.
+
+- ~org-src-preserve-indentation~ ::
+
+ #+cindex: indentation, in code blocks
+ #+vindex: 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~ ::
+
+ #+vindex: 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.
+
+#+vindex: org-src-fontify-natively
+#+vindex: org-src-block-faces
+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.
+
+#+begin_src emacs-lisp
+(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"))))
+#+end_src
+
+** Noweb Reference Syntax
+:PROPERTIES:
+:DESCRIPTION: Literate programming in Org mode.
+:END:
+#+cindex: code block, noweb reference
+#+cindex: syntax, noweb
+#+cindex: source code, noweb reference
+
+#+cindex: @samp{noweb-ref}, header argument
+Source code blocks can include references to other source code blocks,
+using a noweb[fn:144] style syntax:
+
+: <<CODE-BLOCK-ID>>
+
+#+texinfo: @noindent
+where {{{var(CODE-BLOCK-ID)}}} refers to either the =NAME= of a single
+source code block, or a collection of one or more source code blocks
+sharing the same =noweb-ref= header argument (see [[*Using Header
+Arguments]]). Org can replace such references with the source code of
+the block or blocks being referenced, or, in the case of a single
+source code block named with =NAME=, with the results of an evaluation
+of that block.
+
+#+cindex: @samp{noweb}, header argument
+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 most simple case, the contents of a single source block is
+inserted within other blocks. Thus, in following example,
+
+#+begin_example
+,#+NAME: initialization
+,#+BEGIN_SRC emacs-lisp
+ (setq sentence "Never a foot too far, even.")
+,#+END_SRC
+
+,#+BEGIN_SRC emacs-lisp :noweb yes
+ <<initialization>>
+ (reverse sentence)
+,#+END_SRC
+#+end_example
+
+#+texinfo: @noindent
+the second code block is expanded as
+
+#+begin_example
+,#+BEGIN_SRC emacs-lisp :noweb yes
+ (setq sentence "Never a foot too far, even.")
+ (reverse sentence)
+,#+END_SRC
+#+end_example
+
+You may also include the contents of multiple blocks sharing a common
+=noweb-ref= header argument, which can be set at the file, sub-tree,
+or code block 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_example
+,#+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh
+ <<fullest-disk>>
+,#+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
+#+end_example
+
+#+cindex: @samp{noweb-sep}, header argument
+By default a newline separates each noweb reference concatenation. To
+use a different separator, edit the =noweb-sep= header argument.
+
+Alternatively, Org can include the results of evaluation of a single
+code block rather than its body. Evaluation occurs when parentheses,
+possibly including arguments, are appended to the code block name, as
+shown below.
+
+: <<NAME(optional arguments)>>
+
+Note that in this case, a code block name set by =NAME= keyword is
+required; the reference set by =noweb-ref= will not work when
+evaluation is desired.
+
+Here is an example that demonstrates how the exported content changes
+when noweb style references are used with parentheses versus without.
+Given:
+
+#+begin_example
+,#+NAME: some-code
+,#+BEGIN_SRC python :var num=0 :results output :exports none
+ print(num*10)
+,#+END_SRC
+#+end_example
+
+#+texinfo: @noindent
+this code block:
+
+#+begin_example
+,#+BEGIN_SRC text :noweb yes
+ <<some-code>>
+,#+END_SRC
+#+end_example
+
+#+texinfo: @noindent
+expands to:
+
+: print(num*10)
+
+Below, a similar noweb style reference is used, but with parentheses,
+while setting a variable =num= to 10:
+
+#+begin_example
+,#+BEGIN_SRC text :noweb yes
+ <<some-code(num=10)>>
+,#+END_SRC
+#+end_example
+
+#+texinfo: @noindent
+Note that the expansion now contains the results of the code block
+=some-code=, not the code block itself:
+
+: 100
+
+Noweb insertions honor prefix characters that appear before the noweb
+syntax reference. This behavior is illustrated in the following
+example. Because the =<<example>>= noweb reference appears behind the
+SQL comment syntax, each line of the expanded noweb reference is
+commented. With:
+
+#+begin_example
+,#+NAME: example
+,#+BEGIN_SRC text
+ this is the
+ multi-line body of example
+,#+END_SRC
+#+end_example
+
+#+texinfo: @noindent
+this code block:
+
+#+begin_example
+,#+BEGIN_SRC sql :noweb yes
+ ---<<example>>
+,#+END_SRC
+#+end_example
+
+#+texinfo: @noindent
+expands to:
+
+#+begin_example
+,#+BEGIN_SRC sql :noweb yes
+ ---this is the
+ ---multi-line body of example
+,#+END_SRC
+#+end_example
+
+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:
+
+#+begin_example
+,#+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
+#+end_example
+
+#+texinfo: @noindent
+this code block:
+
+#+begin_example
+,#+begin_src python :noweb yes :results output
+ if true:
+ <<if-true>>
+ else:
+ <<if-false>>
+,#+end_src
+#+end_example
+
+#+texinfo: @noindent
+expands to:
+
+#+begin_example
+if true:
+ print('do things when true')
+else:
+ print('do things when false')
+#+end_example
+
+When in doubt about the outcome of a source code block expansion, you
+can preview the results with the following command:
+
+- {{{kbd(C-c C-v v)}}} or {{{kbd(C-c C-v C-v)}}} (~org-babel-expand-src-block~) ::
+
+ #+findex: org-babel-expand-src-block
+ #+kindex: C-c C-v v
+ #+kindex: C-c C-v C-v
+ Expand the current source code block according to its header
+ arguments and pop open the results in a preview buffer.
+
+** Library of Babel
+:PROPERTIES:
+:DESCRIPTION: Use and contribute to a library of useful code blocks.
+:END:
+#+cindex: babel, library of
+#+cindex: source code, library
+#+cindex: code block, library
+
+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 [[https://orgmode.org/worg/library-of-babel.html][Worg]]. For
+remote code block evaluation syntax, see [[*Evaluating Code Blocks]].
+
+#+kindex: C-c C-v i
+#+findex: org-babel-lob-ingest
+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 {{{kbd(C-c C-v i)}}}.
+
+** Key bindings and Useful Functions
+:PROPERTIES:
+:DESCRIPTION: Work quickly with code blocks.
+:END:
+#+cindex: code block, key bindings
+
+Many common Org mode key sequences are re-bound depending on
+the context.
+
+Active key bindings in code blocks:
+
+#+kindex: C-c C-c
+#+findex: org-babel-execute-src-block
+#+kindex: C-c C-o
+#+findex: org-babel-open-src-block-result
+#+kindex: M-UP
+#+findex: org-babel-load-in-session
+#+kindex: M-DOWN
+#+findex: org-babel-pop-to-session
+#+attr_texinfo: :columns 0.2 0.55
+| Key binding | Function |
+|--------------------+-----------------------------------|
+| {{{kbd(C-c C-c)}}} | ~org-babel-execute-src-block~ |
+| {{{kbd(C-c C-o)}}} | ~org-babel-open-src-block-result~ |
+| {{{kbd(M-UP)}}} | ~org-babel-load-in-session~ |
+| {{{kbd(M-DOWN)}}} | ~org-babel-pop-to-session~ |
+
+Active key bindings in Org mode buffer:
+
+#+kindex: C-c C-v p
+#+kindex: C-c C-v C-p
+#+kindex: C-c C-v n
+#+kindex: C-c C-v C-n
+#+kindex: C-c C-v e
+#+kindex: C-c C-v C-e
+#+kindex: C-c C-v o
+#+kindex: C-c C-v C-o
+#+kindex: C-c C-v v
+#+kindex: C-c C-v C-v
+#+kindex: C-c C-v u
+#+kindex: C-c C-v C-u
+#+kindex: C-c C-v g
+#+kindex: C-c C-v C-g
+#+kindex: C-c C-v r
+#+kindex: C-c C-v C-r
+#+kindex: C-c C-v b
+#+kindex: C-c C-v C-b
+#+kindex: C-c C-v s
+#+kindex: C-c C-v C-s
+#+kindex: C-c C-v d
+#+kindex: C-c C-v C-d
+#+kindex: C-c C-v t
+#+kindex: C-c C-v C-t
+#+kindex: C-c C-v f
+#+kindex: C-c C-v C-f
+#+kindex: C-c C-v c
+#+kindex: C-c C-v C-c
+#+kindex: C-c C-v j
+#+kindex: C-c C-v C-j
+#+kindex: C-c C-v l
+#+kindex: C-c C-v C-l
+#+kindex: C-c C-v i
+#+kindex: C-c C-v C-i
+#+kindex: C-c C-v I
+#+kindex: C-c C-v C-I
+#+kindex: C-c C-v z
+#+kindex: C-c C-v C-z
+#+kindex: C-c C-v a
+#+kindex: C-c C-v C-a
+#+kindex: C-c C-v h
+#+kindex: C-c C-v C-h
+#+kindex: C-c C-v x
+#+kindex: C-c C-v C-x
+#+findex: org-babel-previous-src-block
+#+findex: org-babel-next-src-block
+#+findex: org-babel-execute-maybe
+#+findex: org-babel-open-src-block-result
+#+findex: org-babel-expand-src-block
+#+findex: org-babel-goto-src-block-head
+#+findex: org-babel-goto-named-src-block
+#+findex: org-babel-goto-named-result
+#+findex: org-babel-execute-buffer
+#+findex: org-babel-execute-subtree
+#+findex: org-babel-demarcate-block
+#+findex: org-babel-tangle
+#+findex: org-babel-tangle-file
+#+findex: org-babel-check-src-block
+#+findex: org-babel-insert-header-arg
+#+findex: org-babel-load-in-session
+#+findex: org-babel-lob-ingest
+#+findex: org-babel-view-src-block-info
+#+findex: org-babel-switch-to-session-with-code
+#+findex: org-babel-sha1-hash
+#+findex: org-babel-describe-bindings
+#+findex: org-babel-do-key-sequence-in-edit-buffer
+#+attr_texinfo: :columns 0.45 0.55
+| Key binding | Function |
+|------------------------------------------------+--------------------------------------------|
+| {{{kbd(C-c C-v p)}}} or {{{kbd(C-c C-v C-p)}}} | ~org-babel-previous-src-block~ |
+| {{{kbd(C-c C-v n)}}} or {{{kbd(C-c C-v C-n)}}} | ~org-babel-next-src-block~ |
+| {{{kbd(C-c C-v e)}}} or {{{kbd(C-c C-v C-e)}}} | ~org-babel-execute-maybe~ |
+| {{{kbd(C-c C-v o)}}} or {{{kbd(C-c C-v C-o)}}} | ~org-babel-open-src-block-result~ |
+| {{{kbd(C-c C-v v)}}} or {{{kbd(C-c C-v C-v)}}} | ~org-babel-expand-src-block~ |
+| {{{kbd(C-c C-v u)}}} or {{{kbd(C-c C-v C-u)}}} | ~org-babel-goto-src-block-head~ |
+| {{{kbd(C-c C-v g)}}} or {{{kbd(C-c C-v C-g)}}} | ~org-babel-goto-named-src-block~ |
+| {{{kbd(C-c C-v r)}}} or {{{kbd(C-c C-v C-r)}}} | ~org-babel-goto-named-result~ |
+| {{{kbd(C-c C-v b)}}} or {{{kbd(C-c C-v C-b)}}} | ~org-babel-execute-buffer~ |
+| {{{kbd(C-c C-v s)}}} or {{{kbd(C-c C-v C-s)}}} | ~org-babel-execute-subtree~ |
+| {{{kbd(C-c C-v d)}}} or {{{kbd(C-c C-v C-d)}}} | ~org-babel-demarcate-block~ |
+| {{{kbd(C-c C-v t)}}} or {{{kbd(C-c C-v C-t)}}} | ~org-babel-tangle~ |
+| {{{kbd(C-c C-v f)}}} or {{{kbd(C-c C-v C-f)}}} | ~org-babel-tangle-file~ |
+| {{{kbd(C-c C-v c)}}} or {{{kbd(C-c C-v C-c)}}} | ~org-babel-check-src-block~ |
+| {{{kbd(C-c C-v j)}}} or {{{kbd(C-c C-v C-j)}}} | ~org-babel-insert-header-arg~ |
+| {{{kbd(C-c C-v l)}}} or {{{kbd(C-c C-v C-l)}}} | ~org-babel-load-in-session~ |
+| {{{kbd(C-c C-v i)}}} or {{{kbd(C-c C-v C-i)}}} | ~org-babel-lob-ingest~ |
+| {{{kbd(C-c C-v I)}}} or {{{kbd(C-c C-v C-I)}}} | ~org-babel-view-src-block-info~ |
+| {{{kbd(C-c C-v z)}}} or {{{kbd(C-c C-v C-z)}}} | ~org-babel-switch-to-session-with-code~ |
+| {{{kbd(C-c C-v a)}}} or {{{kbd(C-c C-v C-a)}}} | ~org-babel-sha1-hash~ |
+| {{{kbd(C-c C-v h)}}} or {{{kbd(C-c C-v C-h)}}} | ~org-babel-describe-bindings~ |
+| {{{kbd(C-c C-v x)}}} or {{{kbd(C-c C-v C-x)}}} | ~org-babel-do-key-sequence-in-edit-buffer~ |
+
+** Batch Execution
+:PROPERTIES:
+:DESCRIPTION: Call functions from the command line.
+:END:
+#+cindex: code block, batch execution
+#+cindex: source code, 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~.
+
+#+begin_example
+#!/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))))
+ " "$@"
+#+end_example
+
+* Miscellaneous
+:PROPERTIES:
+:DESCRIPTION: All the rest which did not fit elsewhere.
+:END:
+
+** Completion
+:PROPERTIES:
+:DESCRIPTION: @kbd{M-@key{TAB}} guesses completions.
+:END:
+#+cindex: completion, of @TeX{} symbols
+#+cindex: completion, of TODO keywords
+#+cindex: completion, of dictionary words
+#+cindex: completion, of option keywords
+#+cindex: completion, of tags
+#+cindex: completion, of property keys
+#+cindex: completion, of link abbreviations
+#+cindex: @TeX{} symbol completion
+#+cindex: TODO keywords completion
+#+cindex: dictionary word completion
+#+cindex: option keyword completion
+#+cindex: tag completion
+#+cindex: link abbreviations, completion of
+
+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.
+
+- {{{kbd(M-TAB)}}} ::
+ #+kindex: M-TAB
+
+ Complete word at point.
+
+ - At the beginning of an empty headline, complete TODO keywords.
+
+ - After =\=, complete TeX symbols supported by the exporter.
+
+ - After =:= in a headline, complete tags. Org deduces the list of
+ tags from the =TAGS= in-buffer option (see [[*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 [[*Link Abbreviations]]).
+
+ - After =[[*=, complete headlines in the current buffer so that they
+ can be used in search links like: =[[*find this headline]]=
+
+ - After =#+=, complete the special keywords like =TYP_TODO= or
+ file-specific =OPTIONS=. After option keyword is complete,
+ pressing {{{kbd(M-TAB)}}} again inserts example settings for this
+ keyword.
+
+ - After =STARTUP= keyword, complete startup items.
+
+ - When point is anywhere else, complete dictionary words using
+ Ispell.
+
+** Structure Templates
+:PROPERTIES:
+:DESCRIPTION: Quick insertion of structural elements.
+:END:
+#+cindex: template insertion
+#+cindex: insertion, of 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.
+
+- {{{kbd(C-c C-\,)}}} (~org-insert-structure-template~) ::
+
+ #+findex: org-insert-structure-template
+ #+kindex: C-c C-,
+ 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 {{{kbd(TAB)}}}, {{{kbd(RET)}}},
+ or {{{kbd(SPC)}}}, the user is prompted to enter a block type.
+
+#+vindex: org-structure-template-alist
+Available structure types are defined in
+~org-structure-template-alist~, see the docstring for adding or
+changing values.
+
+#+cindex: Tempo
+#+cindex: template expansion
+#+cindex: insertion, of templates
+#+vindex: org-tempo-keywords-alist
+Org Tempo expands snippets to structures defined in
+~org-structure-template-alist~ and ~org-tempo-keywords-alist~. For
+example, {{{kbd(< s TAB)}}} creates a code block. Enable it by
+customizing ~org-modules~ or add =(require 'org-tempo)= to your Emacs
+init file[fn:145].
+
+#+attr_texinfo: :columns 0.1 0.9
+| {{{kbd(a)}}} | =#+BEGIN_EXPORT ascii= ... =#+END_EXPORT= |
+| {{{kbd(c)}}} | =#+BEGIN_CENTER= ... =#+END_CENTER= |
+| {{{kbd(C)}}} | =#+BEGIN_COMMENT= ... =#+END_COMMENT= |
+| {{{kbd(e)}}} | =#+BEGIN_EXAMPLE= ... =#+END_EXAMPLE= |
+| {{{kbd(E)}}} | =#+BEGIN_EXPORT= ... =#+END_EXPORT= |
+| {{{kbd(h)}}} | =#+BEGIN_EXPORT html= ... =#+END_EXPORT= |
+| {{{kbd(l)}}} | =#+BEGIN_EXPORT latex= ... =#+END_EXPORT= |
+| {{{kbd(q)}}} | =#+BEGIN_QUOTE= ... =#+END_QUOTE= |
+| {{{kbd(s)}}} | =#+BEGIN_SRC= ... =#+END_SRC= |
+| {{{kbd(v)}}} | =#+BEGIN_VERSE= ... =#+END_VERSE= |
+
+** Speed Keys
+:PROPERTIES:
+:DESCRIPTION: Electric commands at the beginning of a headline.
+:END:
+#+cindex: 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.
+
+#+vindex: org-use-speed-commands
+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.
+
+#+vindex: org-speed-commands
+#+findex: org-speed-command-help
+Org comes with a pre-defined list of Speed Keys. To add or modify
+Speed Keys, customize the option ~org-speed-commands~. For more
+details, see the variable's docstring. With Speed Keys activated,
+{{{kbd(M-x org-speed-command-help)}}}, or {{{kbd(?)}}} when point is at the
+beginning of an Org headline, shows currently active Speed Keys,
+including the user-defined ones.
+
+** A Cleaner Outline View
+:PROPERTIES:
+:DESCRIPTION: Getting rid of leading stars in the outline.
+:ALT_TITLE: Clean View
+:END:
+#+cindex: hiding leading stars
+#+cindex: dynamic indentation
+#+cindex: odd-levels-only outlines
+#+cindex: clean outline view
+
+Org's outline with stars and no indents can look 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 displays only one
+star and indents text to line up with the heading:
+
+#+begin_example
+,* 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
+#+end_example
+
+Org can achieve this in two ways, (1) by just displaying the buffer in
+this way without changing it, or (2) by actually indenting every line
+in the desired amount with hard spaces and hiding leading stars.
+
+*** Org Indent Mode
+
+#+cindex: Indent mode
+#+findex: org-indent-mode
+To display the buffer in the indented view, activate Org Indent minor
+mode, using {{{kbd(M-x org-indent-mode)}}}. Text lines that are not
+headlines are prefixed with virtual spaces to vertically align with
+the headline text[fn:146].
+
+#+vindex: org-indent-indentation-per-level
+To make more horizontal space, the headlines are shifted by two
+characters. Configure ~org-indent-indentation-per-level~ variable for
+a different number.
+
+#+vindex: org-indent-mode-turns-on-hiding-stars
+#+vindex: org-indent-mode-turns-off-org-adapt-indentation
+By default, Org Indent mode turns off ~org-adapt-indentation~ and does
+hide leading stars by locally setting ~org-hide-leading-stars~ to ~t~:
+only one star on each headline is visible, the rest are masked with
+the same font color as the background. If you want to customize this
+default behavior, see ~org-indent-mode-turns-on-hiding-stars~ and
+~org-indent-mode-turns-off-org-adapt-indentation~.
+
+#+vindex: org-startup-indented
+To globally turn on Org Indent mode for all files, customize the
+variable ~org-startup-indented~. To control it for individual files,
+use =STARTUP= keyword as follows:
+
+: #+STARTUP: indent
+: #+STARTUP: noindent
+
+*** Hard indentation
+
+It is possible to use hard spaces to achieve the indentation instead,
+if the bare ASCII file should have the indented look also outside
+Emacs[fn:147]. With Org's support, you have to indent all lines to
+line up with the outline headers. You would use these
+settings[fn:148]:
+
+#+begin_src emacs-lisp
+(setq org-adapt-indentation t
+ org-hide-leading-stars t
+ org-odd-levels-only t)
+#+end_src
+
+- /Indentation of text below headlines/ (~org-adapt-indentation~) ::
+
+ #+vindex: org-adapt-indentation
+ The first setting modifies paragraph filling, line wrapping, and
+ structure editing commands to preserving or adapting the indentation
+ as appropriate.
+
+- /Hiding leading stars/ (~org-hide-leading-stars~) ::
+
+ #+vindex: org-hide-leading-stars
+ #+vindex: org-hide, face
+ The second setting makes leading stars invisible by applying the
+ face ~org-hide~ to them. For per-file preference, use these file
+ =STARTUP= options:
+
+ #+begin_example
+ ,#+STARTUP: hidestars
+ ,#+STARTUP: showstars
+ #+end_example
+
+- /Odd levels/ (~org-odd-levels-only~) ::
+
+ #+vindex: org-odd-levels-only
+ The third setting makes Org use only odd levels, 1, 3, 5, ..., in
+ the outline to create more indentation. On a per-file level,
+ control this with:
+
+ #+begin_example
+ ,#+STARTUP: odd
+ ,#+STARTUP: oddeven
+ #+end_example
+
+ To convert a file between single and double stars layouts, use
+ {{{kbd(M-x org-convert-to-odd-levels)}}} and {{{kbd(M-x
+ org-convert-to-oddeven-levels)}}}.
+
+** Execute commands in the active region
+:PROPERTIES:
+:DESCRIPTION: Execute commands on multiple items in Org or agenda view.
+:END:
+
+#+vindex: org-loop-over-headlines-in-active-region
+When in an Org buffer and the region is active, some commands will
+apply to all the subtrees in the active region. For example, hitting
+{{{kbd(C-c C-s)}}} when multiple headlines are within the active region will
+successively prompt you for a new schedule date and time. To disable
+this, set the option ~org-loop-over-headlines-in-active-region~ to
+non-~t~, activate the region and run the command normally.
+
+#+vindex: org-agenda-loop-over-headlines-in-active-region
+~org-agenda-loop-over-headlines-in-active-region~ is the equivalent
+option of the agenda buffer, where you can also use [[*Bulk remote editing selected entries][bulk editing of
+selected entries]].
+
+Not all commands can loop in the active region and what subtrees or
+headlines are considered can be refined: see the docstrings of these
+options for more details.
+
+** Dynamic Headline Numbering
+:PROPERTIES:
+:DESCRIPTION: Display and update outline numbering.
+:END:
+
+#+cindex: Org Num mode
+#+cindex: number headlines
+The Org Num minor mode, toggled with {{{kbd(M-x org-num-mode)}}},
+displays outline numbering on top of headlines. It also updates it
+automatically upon changes to the structure of the document.
+
+#+vindex: org-num-max-level
+#+vindex: org-num-skip-tags
+#+vindex: org-num-skip-commented
+#+vindex: org-num-skip-unnumbered
+By default, all headlines are numbered. You can limit numbering to
+specific headlines according to their level, tags, =COMMENT= keyword,
+or =UNNUMBERED= property. Set ~org-num-max-level~,
+~org-num-skip-tags~, ~org-num-skip-commented~,
+~org-num-skip-unnumbered~, or ~org-num-skip-footnotes~ accordingly.
+
+#+vindex: org-num-skip-footnotes
+If ~org-num-skip-footnotes~ is non-~nil~, footnotes sections (see
+[[*Creating Footnotes]]) are not numbered either.
+
+#+vindex: org-num-face
+#+vindex: org-num-format-function
+You can control how the numbering is displayed by setting
+~org-num-face~ and ~org-num-format-function~.
+
+#+vindex: org-startup-numerated
+You can also turn this mode globally for all Org files by setting the
+option ~org-startup-numerated~ to =t=, or locally on a file by using
+=#+startup: num=.
+
+** The Very Busy {{{kbd(C-c C-c)}}} Key
+:PROPERTIES:
+:DESCRIPTION: When in doubt, press @kbd{C-c C-c}.
+:END:
+#+kindex: C-c C-c
+#+cindex: @kbd{C-c C-c}, overview
+
+The {{{kbd(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 column view (see [[*Column View]]) is on, exit column view.
+
+- 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.
+
+- 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 =<<<target>>>=, 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.
+
+** Summary of In-Buffer Settings
+:PROPERTIES:
+:DESCRIPTION: Overview of keywords.
+:ALT_TITLE: In-buffer Settings
+:END:
+#+cindex: in-buffer settings
+#+cindex: special keywords
+
+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.
+
+#+cindex: refresh set-up
+{{{kbd(C-c C-c)}}} activates any changes to the in-buffer settings.
+Closing and reopening the Org file in Emacs also activates the
+changes.
+
+#+attr_texinfo: :sep ,
+- =#+ARCHIVE: %s_done::= ::
+
+ #+cindex: @samp{ARCHIVE}, keyword
+ #+vindex: org-archive-location
+ Sets the archive location of the agenda file. The corresponding
+ variable is ~org-archive-location~.
+
+- =#+CATEGORY= ::
+
+ #+cindex: @samp{CATEGORY}, keyword
+ Sets the category of the agenda file, which applies to the entire
+ document.
+
+- =#+COLUMNS: %25ITEM ...= ::
+
+ #+cindex: @samp{COLUMNS}, property
+ 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 ...= ::
+
+ #+cindex: @samp{CONSTANTS}, keyword
+ #+vindex: org-table-formula-constants
+ #+vindex: org-table-formula
+ 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:= ::
+
+ #+cindex: @samp{FILETAGS}, keyword
+ Set tags that all entries in the file inherit from, including the
+ top-level entries.
+
+- =#+LINK: linkword replace= ::
+
+ #+cindex: @samp{LINK}, keyword
+ #+vindex: org-link-abbrev-alist
+ Each line specifies one abbreviation for one link. Use multiple
+ =LINK= keywords for more, see [[*Link Abbreviations]]. The
+ corresponding variable is ~org-link-abbrev-alist~.
+
+- =#+PRIORITIES: highest lowest default= ::
+
+ #+cindex: @samp{PRIORITIES}, keyword
+ #+vindex: org-priority-highest
+ #+vindex: org-priority-lowest
+ #+vindex: org-priority-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= ::
+
+ #+cindex: @samp{PROPERTY}, keyword
+ 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= ::
+
+ #+cindex: @samp{SETUPFILE}, keyword
+ 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. {{{kbd(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 {{{kbd(C-c ')}}} while point is on the line with the
+ file name.
+
+- =#+STARTUP:= ::
+
+ #+cindex: @samp{STARTUP}, keyword
+ Startup options Org uses when first visiting a file.
+
+ #+vindex: org-startup-folded
+ 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
+ ~showeverything~.
+
+ | =overview= | Top-level headlines only. |
+ | =content= | All headlines. |
+ | =showall= | No folding on any entry. |
+ | =show2levels= | Headline levels 1-2. |
+ | =show3levels= | Headline levels 1-3. |
+ | =show4levels= | Headline levels 1-4. |
+ | =show5levels= | Headline levels 1-5. |
+ | =showeverything= | Show even drawer contents. |
+
+ #+vindex: org-startup-indented
+ Dynamic virtual indentation is controlled by the variable
+ ~org-startup-indented~[fn:149].
+
+ | =indent= | Start with Org Indent mode turned on. |
+ | =noindent= | Start with Org Indent mode turned off. |
+
+ #+vindex: org-startup-numerated
+ Dynamic virtual numeration of headlines is controlled by the variable
+ ~org-startup-numerated~.
+
+ | =num= | Start with Org num mode turned on. |
+ | =nonum= | Start with Org num mode turned off. |
+
+ #+vindex: org-startup-align-all-tables
+ 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. |
+
+ #+vindex: org-startup-shrink-all-tables
+ Shrink table columns with a width cookie. The corresponding
+ variable is ~org-startup-shrink-all-tables~ with ~nil~ as
+ default value.
+
+ #+vindex: org-startup-with-inline-images
+ 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. |
+
+ #+vindex: org-log-done
+ #+vindex: org-log-note-clock-out
+ #+vindex: org-log-repeat
+ 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 as done. |
+ | =lognotedone= | Record timestamp and a note when DONE. |
+ | =nologdone= | Do not record when items are marked as 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. |
+
+ #+vindex: org-hide-leading-stars
+ #+vindex: org-odd-levels-only
+ 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. |
+
+ #+vindex: org-put-time-stamp-overlays
+ #+vindex: org-time-stamp-overlay-formats
+ 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. |
+
+ #+vindex: constants-unit-system
+ 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. |
+
+ #+vindex: org-footnote-define-inline
+ #+vindex: org-footnote-auto-label
+ #+vindex: org-footnote-auto-adjust
+ 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. |
+
+ #+vindex: org-hide-block-startup
+ 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. |
+
+ #+vindex: org-pretty-entities
+ 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)= ::
+
+ #+cindex: @samp{TAGS}, keyword
+ #+vindex: org-tag-alist
+ 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:= ::
+
+ #+cindex: @samp{SEQ_TODO}, keyword
+ #+cindex: @samp{TODO}, keyword
+ #+cindex: @samp{TYP_TODO}, keyword
+ #+vindex: org-todo-keywords
+ These lines set the TODO keywords and their interpretation in the
+ current file. The corresponding variable is ~org-todo-keywords~.
+
+** Regular Expressions
+:PROPERTIES:
+:DESCRIPTION: Elisp regular expressions.
+:END:
+#+cindex: regular expressions syntax
+#+cindex: regular expressions, in searches
+
+Org, as an Emacs mode, makes use of Elisp regular expressions for
+searching, matching and filtering. Elisp regular expressions have a
+somewhat different syntax then some common standards. Most notably,
+alternation is indicated using =\|= and matching groups are denoted by
+=\(...\)=. For example the string =home\|work= matches either =home=
+or =work=.
+
+For more information, see [[info:emacs::Regexps][Regular Expressions in Emacs]].
+
+** Org Syntax
+:PROPERTIES:
+:DESCRIPTION: Formal description of Org's syntax.
+:END:
+
+A reference document providing a formal description of Org's syntax is
+available as [[https://orgmode.org/worg/dev/org-syntax.html][a draft on Worg]], written and maintained by Nicolas
+Goaziou. It defines Org's core internal concepts such as "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) <RET>
+
+#+texinfo: @noindent
+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.
+
+#+cindex: syntax checker
+#+cindex: linter
+#+findex: org-lint
+You can probe the syntax of your documents with the command
+
+: M-x org-lint <RET>
+
+#+texinfo: @noindent
+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:
+
+#+attr_texinfo: :columns 0.22 0.78
+| {{{kbd(C-j)}}}, {{{kbd(TAB)}}} | Display the offending line |
+| {{{kbd(RET)}}} | Move point to the offending line |
+| {{{kbd(g)}}} | Check the document again |
+| {{{kbd(h)}}} | Hide all reports from the same checker |
+| {{{kbd(i)}}} | Also remove them from all subsequent checks |
+| {{{kbd(S)}}} | Sort reports by the column at point |
+
+** Context Dependent Documentation
+:PROPERTIES:
+:DESCRIPTION: Read documentation about current syntax.
+:ALT_TITLE: Documentation Access
+:END:
+#+cindex: documentation
+#+cindex: Info
+
+#+findex: org-info-find-node
+#+kindex: C-c C-x I
+{{{kbd(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.
+
+{{{kbd(q)}}} closes the Info window.
+
+** Escape Character
+:PROPERTIES:
+:DESCRIPTION: Prevent Org from interpreting your writing.
+:END:
+
+#+cindex: escape character
+#+cindex: zero width space
+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, i.e., a backslash in macros (see [[*Macro
+Replacement]]) and links (see [[*Link Format]]), or a comma in source and
+example blocks (see [[*Literal Examples]]). In the general case, however,
+we suggest to use the zero width space. You can insert one with any
+of the following:
+
+: C-x 8 <RET> zero width space <RET>
+: C-x 8 <RET> 200B <RET>
+
+For example, in order to write =[[1,2]]= as-is in your document, you
+may write instead
+
+: [X[1,2]]
+
+where =X= denotes the zero width space character.
+
+** Code Evaluation and Security Issues
+:PROPERTIES:
+:DESCRIPTION: Org files evaluate in-line code.
+:ALT_TITLE: Code Evaluation Security
+:END:
+
+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 {{{kbd(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.
+
+ #+attr_texinfo: :options org-confirm-babel-evaluate
+ #+begin_defopt
+ 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.
+ #+end_defopt
+
+ For example, here is how to execute ditaa code blocks without
+ prompting:
+
+ #+begin_src emacs-lisp
+ (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)
+ #+end_src
+
+- /Following =shell= and =elisp= links/ ::
+
+ Org has two link types that can directly evaluate code (see
+ [[*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:
+
+ #+attr_texinfo: :options org-link-shell-confirm-function
+ #+begin_defopt
+ Function that prompts the user before executing a shell link.
+ #+end_defopt
+
+ #+attr_texinfo: :options org-link-elisp-confirm-function
+ #+begin_defopt
+ Function that prompts the user before executing an Emacs Lisp link.
+ #+end_defopt
+
+- /Formulas in tables/ ::
+
+ Formulas in tables (see [[*The Spreadsheet]]) are code that is evaluated
+ either by the Calc interpreter, or by the Emacs Lisp interpreter.
+
+** Interaction with Other Packages
+:PROPERTIES:
+:DESCRIPTION: With other Emacs packages.
+:ALT_TITLE: Interaction
+:END:
+#+cindex: packages, interaction with other
+
+Org's compatibility and the level of interaction with other Emacs
+packages are documented here.
+
+*** Packages that Org cooperates with
+:PROPERTIES:
+:DESCRIPTION: Packages Org cooperates with.
+:ALT_TITLE: Cooperation
+:END:
+
+- =calc.el= by Dave Gillespie ::
+ #+cindex: @file{calc.el}
+
+ Org uses the Calc package for implementing spreadsheet functionality
+ in its tables (see [[*The Spreadsheet]]). Org also uses Calc for
+ embedded calculations. See [[info:calc::Embedded Mode][GNU Emacs Calc Manual]].
+
+- =constants.el= by Carsten Dominik ::
+ #+cindex: @file{constants.el}
+ #+vindex: org-table-formula-constants
+
+ 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
+ [[http://www.astro.uva.nl/~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 ::
+ #+cindex: @file{cdlatex.el}
+
+ Org mode can make use of the CDLaTeX package to efficiently enter
+ LaTeX fragments into Org files. See [[*Using CDLaTeX to enter math]].
+
+- =imenu.el= by Ake Stenhoff and Lars Lindberg ::
+ #+cindex: @file{imenu.el}
+
+ 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:
+
+ #+begin_src emacs-lisp
+ (add-hook 'org-mode-hook
+ (lambda () (imenu-add-to-menubar "Imenu")))
+ #+end_src
+
+ #+vindex: org-imenu-depth
+ By default the index is two levels deep---you can modify the
+ depth using the option ~org-imenu-depth~.
+
+- =speedbar.el= by Eric\nbsp{}M.\nbsp{}Ludlam ::
+ #+cindex: @file{speedbar.el}
+
+ 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 {{{kbd(<)}}}
+ in the Speedbar frame tweaks the agenda commands to that file or to
+ a subtree.
+
+- =table.el= by Takaaki Ota ::
+ #+cindex: table editor, @file{table.el}
+ #+cindex: @file{table.el}
+
+ 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. {{{kbd(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.
+
+ - {{{kbd(C-c ')}}} (~org-edit-special~) ::
+
+ #+kindex: C-c '
+ #+findex: org-edit-special
+ Edit a =table.el= table. Works when point is in a =table.el=
+ table.
+
+ - {{{kbd(C-c ~​)}}} (~org-table-create-with-table.el~) ::
+
+ #+kindex: C-c ~
+ #+findex: 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.
+
+*** Packages that conflict with Org mode
+:PROPERTIES:
+:DESCRIPTION: Packages that lead to conflicts.
+:ALT_TITLE: Conflicts
+:END:
+
+#+cindex: shift-selection
+#+vindex: org-support-shift-select
+In Emacs, shift-selection combines motions of point with shift key to
+enlarge regions. Emacs sets this mode by default. This conflicts
+with Org's use of {{{kbd(S-<cursor>)}}} commands to change timestamps,
+TODO keywords, priorities, and item bullet types, etc. Since
+{{{kbd(S-<cursor>)}}} 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\nbsp{}F.\nbsp{}Storm ::
+
+ #+cindex: @file{cua.el}
+ #+vindex: org-replace-disputed-keys
+ Org key bindings conflict with {{{kbd(S-<cursor>)}}} 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.
+
+ #+attr_texinfo: :columns 0.4 0.4
+ | {{{kbd(S-UP)}}} \rArr{} {{{kbd(M-p)}}} | {{{kbd(S-DOWN)}}} \rArr{} {{{kbd(M-n)}}} |
+ | {{{kbd(S-LEFT)}}} \rArr{} {{{kbd(M--)}}} | {{{kbd(S-RIGHT)}}} \rArr{} {{{kbd(M-+)}}} |
+ | {{{kbd(C-S-LEFT)}}} \rArr{} {{{kbd(M-S--)}}} | {{{kbd(C-S-RIGHT)}}} \rArr{} {{{kbd(M-S-+)}}} |
+
+ #+vindex: org-disputed-keys
+ 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 ::
+
+ #+cindex: @file{ecomplete.el}
+ 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 [[*The Orgtbl Minor 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 ::
+
+ #+cindex: @file{filladapt.el}
+ 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:
+
+ #+begin_src emacs-lisp
+ (add-hook 'org-mode-hook 'turn-off-filladapt-mode)
+ #+end_src
+
+- =viper.el= by Michael Kifer ::
+ #+cindex: @file{viper.el}
+ #+kindex: C-c /
+
+ Viper uses {{{kbd(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
+
+ #+begin_src emacs-lisp
+ (define-key viper-vi-global-user-map "C-c /" 'org-sparse-tree)
+ #+end_src
+
+- =windmove.el= by Hovav Shacham ::
+ #+cindex: @file{windmove.el}
+
+ This package also uses the {{{kbd(S-<cursor>)}}} 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 {{{kbd(S-<cursor>)}}},
+ add this to your configuration:
+
+ #+begin_src emacs-lisp
+ ;; 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)
+ #+end_src
+
+- =yasnippet.el= ::
+
+ #+cindex: @file{yasnippet.el}
+ The way Org mode binds the {{{kbd(TAB)}}} key (binding to ~[tab]~
+ instead of ~"\t"~) overrules YASnippet's access to this key. The
+ following code fixed this problem:
+
+ #+begin_src emacs-lisp
+ (add-hook 'org-mode-hook
+ (lambda ()
+ (setq-local yas/trigger-key [tab])
+ (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand)))
+ #+end_src
+
+ 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:
+
+ #+begin_src emacs-lisp
+ (defun yas/org-very-safe-expand ()
+ (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
+ #+end_src
+
+ Then, tell Org mode to use that function:
+
+ #+begin_src emacs-lisp
+ (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)))
+ #+end_src
+** Using Org on a TTY
+:PROPERTIES:
+:DESCRIPTION: Using Org on a tty.
+:ALT_TITLE: TTY Keys
+:END:
+#+cindex: tty key bindings
+
+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
+{{{kbd(S-<cursor>)}}} for editing timestamp might be better with
+{{{kbd(C-c .)}}} chord.
+
+#+attr_texinfo: :columns 0.2 0.28 0.15 0.21
+| Default | Alternative 1 | Speed key | Alternative 2 |
+|----------------------+--------------------------+--------------+----------------------|
+| {{{kbd(S-TAB)}}} | {{{kbd(C-u TAB)}}} | {{{kbd(C)}}} | |
+| {{{kbd(M-LEFT)}}} | {{{kbd(C-c C-x l)}}} | {{{kbd(l)}}} | {{{kbd(Esc LEFT)}}} |
+| {{{kbd(M-S-LEFT)}}} | {{{kbd(C-c C-x L)}}} | {{{kbd(L)}}} | |
+| {{{kbd(M-RIGHT)}}} | {{{kbd(C-c C-x r)}}} | {{{kbd(r)}}} | {{{kbd(Esc RIGHT)}}} |
+| {{{kbd(M-S-RIGHT)}}} | {{{kbd(C-c C-x R)}}} | {{{kbd(R)}}} | |
+| {{{kbd(M-UP)}}} | {{{kbd(C-c C-x u)}}} | | {{{kbd(Esc UP)}}} |
+| {{{kbd(M-S-UP)}}} | {{{kbd(C-c C-x U)}}} | {{{kbd(U)}}} | |
+| {{{kbd(M-DOWN)}}} | {{{kbd(C-c C-x d)}}} | | {{{kbd(Esc DOWN)}}} |
+| {{{kbd(M-S-DOWN)}}} | {{{kbd(C-c C-x D)}}} | {{{kbd(D)}}} | |
+| {{{kbd(S-RET)}}} | {{{kbd(C-c C-x c)}}} | | |
+| {{{kbd(M-RET)}}} | {{{kbd(C-c C-x m)}}} | | {{{kbd(Esc RET)}}} |
+| {{{kbd(M-S-RET)}}} | {{{kbd(C-c C-x M)}}} | | |
+| {{{kbd(S-LEFT)}}} | {{{kbd(C-c LEFT)}}} | | |
+| {{{kbd(S-RIGHT)}}} | {{{kbd(C-c RIGHT)}}} | | |
+| {{{kbd(S-UP)}}} | {{{kbd(C-c UP)}}} | | |
+| {{{kbd(S-DOWN)}}} | {{{kbd(C-c DOWN)}}} | | |
+| {{{kbd(C-S-LEFT)}}} | {{{kbd(C-c C-x LEFT)}}} | | |
+| {{{kbd(C-S-RIGHT)}}} | {{{kbd(C-c C-x RIGHT)}}} | | |
+
+** Protocols for External Access
+:PROPERTIES:
+:DESCRIPTION: External access to Emacs and Org.
+:ALT_TITLE: Protocols
+:END:
+#+cindex: protocols, for external access
+
+Org protocol is a tool 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 [[*Capture]]). You can also create a bookmark that tells
+Emacs to open the local source file of a remote website you are
+browsing.
+
+#+cindex: Org protocol, set-up
+#+cindex: Installing Org protocol
+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"
+
+#+texinfo: @noindent
+Emacs calls the handler associated to {{{var(PROTOCOL)}}} with
+argument =(:key1 val1 :key2 val2)=.
+
+#+cindex: protocol, new protocol
+#+cindex: defining new protocols
+Org protocol comes with three predefined protocols, detailed in the
+following sections. Configure ~org-protocol-protocol-alist~ to define
+your own.
+
+*** The ~store-link~ protocol
+:PROPERTIES:
+:DESCRIPTION: Store a link, push URL to kill-ring.
+:END:
+#+cindex: store-link protocol
+#+cindex: protocol, store-link
+
+Using the ~store-link~ handler, you can copy links, to that they can
+be inserted using {{{kbd(M-x org-insert-link)}}} or yanking. More
+precisely, the command
+
+: emacsclient "org-protocol://store-link?url=URL&title=TITLE"
+
+#+texinfo: @noindent
+stores the following link:
+
+: [[URL][TITLE]]
+
+In addition, {{{var(URL)}}} is pushed on the kill-ring for yanking.
+You need to encode {{{var(URL)}}} and {{{var(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/:
+
+#+begin_example
+javascript:location.href='org-protocol://store-link?' +
+ new URLSearchParams({url:location.href, title:document.title});
+#+end_example
+
+Title is an optional parameter. Another expression was recommended earlier:
+
+#+begin_example
+javascript:location.href='org-protocol://store-link?url='+
+ encodeURIComponent(location.href);
+#+end_example
+
+The latter form is compatible with older Org versions from 9.0 to 9.4.
+
+*** The ~capture~ protocol
+:PROPERTIES:
+:DESCRIPTION: Fill a buffer with external information.
+:END:
+#+cindex: capture protocol
+#+cindex: protocol, capture
+
+Activating the "capture" handler pops up a =Capture= buffer in Emacs,
+using acapture template.
+
+: 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=:
+
+#+begin_example
+javascript:location.href='org-protocol://capture?' +
+ new URLSearchParams({
+ template: 'x', url: window.location.href,
+ title: document.title, body: window.getSelection()});
+#+end_example
+
+You might have seen another expression:
+
+#+begin_example
+javascript:location.href='org-protocol://capture?template=x'+
+ '&url='+encodeURIComponent(window.location.href)+
+ '&title='+encodeURIComponent(document.title)+
+ '&body='+encodeURIComponent(window.getSelection());
+#+end_example
+
+It is a bit more cluttered than the former one, but it is compatible
+with previous Org versions 9.0-9.4. In these versions encoding of
+space as "+" character was not supported by URI decoder.
+
+#+vindex: org-protocol-default-template-key
+The capture template to be used can be specified in the bookmark (like
+=X= above). If unspecified, the template key is set in the variable
+~org-protocol-default-template-key~. The following template
+placeholders are available:
+
+#+begin_example
+%:link The URL
+%:description The webpage title
+%:annotation Equivalent to [[%:link][%:description]]
+%i The selected text
+#+end_example
+
+*** The ~open-source~ protocol
+:PROPERTIES:
+:DESCRIPTION: Edit published contents.
+:END:
+#+cindex: open-source protocol
+#+cindex: protocol, open-source
+
+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:
+
+#+begin_example
+javascript:location.href='org-protocol://open-source?&url='+
+ encodeURIComponent(location.href)
+#+end_example
+
+#+vindex: org-protocol-project-alist
+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
+
+#+begin_src emacs-lisp
+(setq org-protocol-project-alist
+ '(("Worg"
+ :base-url "https://orgmode.org/worg/"
+ :working-directory "/home/user/worg/"
+ :online-suffix ".html"
+ :working-suffix ".org")))
+#+end_src
+
+#+texinfo: @noindent
+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.
+
+#+cindex: rewritten URL in open-source protocol
+#+cindex: protocol, open-source rewritten URL
+However, such mapping may not always yield the desired results.
+Suppose you maintain an online store located at =https://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 =https://example.com/print/posters.html= might be
+rewritten on the server to something like
+=https://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:
+
+#+begin_src emacs-lisp
+(setq org-protocol-project-alist
+ '(("example.com"
+ :base-url "https://example.com/"
+ :working-directory "/home/user/example/"
+ :online-suffix ".php"
+ :working-suffix ".php"
+ :rewrites (("example.com/print/" . "products.php")
+ ("example.com/$" . "index.php")))))
+#+end_src
+
+#+texinfo: @noindent
+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.
+
+#+cindex: protocol, open-source, set-up mapping
+#+cindex: mappings in open-source protocol
+#+findex: org-protocol-create
+#+findex: org-protocol-create-for-org
+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.
+** Org Crypt
+:PROPERTIES:
+:DESCRIPTION: Encrypting Org files.
+:END:
+
+Org Crypt encrypts the text of an entry, but not the headline, or
+properties. Behind the scene, it uses the [[info:epa][Emacs EasyPG Library]] to
+encrypt and decrypt files, and EasyPG needs a correct [[info:gnupg][GnuPG]] setup.
+
+#+vindex: org-crypt-tag-matcher
+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:
+
+#+begin_src emacs-lisp
+(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; -*-
+#+end_src
+
+It's possible to use different keys for different headings by
+specifying the respective key as property =CRYPTKEY=, e.g.:
+
+#+begin_example
+,* Totally secret :crypt:
+ :PROPERTIES:
+ :CRYPTKEY: 0x0123456789012345678901234567890123456789
+ :END:
+#+end_example
+
+Excluding the =crypt= tag from inheritance prevents already encrypted
+text from being encrypted again.
+
+** Org Mobile
+:PROPERTIES:
+:DESCRIPTION: Viewing and capture on a mobile device.
+:END:
+#+cindex: smartphone
+
+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~, ~org-tag-alist~ and
+~org-tag-persistent-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 [[*Setting up keywords
+for individual files]]) and /mutually exclusive/ tags (see [[*Setting
+Tags]]) only for those set in these variables.
+
+*** Setting up the staging area
+:PROPERTIES:
+:DESCRIPTION: For the mobile device.
+:END:
+
+#+vindex: org-mobile-directory
+The mobile application needs access to a file directory on
+a server[fn:150] 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:
+
+#+begin_src emacs-lisp
+(setq org-mobile-directory "~/orgmobile/")
+#+end_src
+
+Alternatively, by using TRAMP (see [[info:tramp][TRAMP User Manual]]),
+~org-mobile-directory~ may point to a remote directory accessible
+through, for example, SSH, SCP, or DAVS:
+
+#+begin_src emacs-lisp
+(setq org-mobile-directory "/davs:user@remote.host:/org/webdav/")
+#+end_src
+
+#+vindex: org-mobile-encryption
+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~[fn:151]. 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.
+
+*** Pushing to the mobile application
+:PROPERTIES:
+:DESCRIPTION: Uploading Org files and agendas.
+:END:
+
+#+findex: org-mobile-push
+#+vindex: org-mobile-files
+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[fn:152].
+
+Push creates a special Org file =agendas.org= with custom agenda views
+defined by the user[fn:153].
+
+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[fn:154]
+have changed.
+
+*** Pulling from the mobile application
+:PROPERTIES:
+:DESCRIPTION: Integrating captured and flagged items.
+:END:
+
+#+findex: org-mobile-pull
+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.
+ #+vindex: org-mobile-inbox-for-pull
+ Org moves all entries found in =mobileorg.org=[fn:155] 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.
+ #+cindex: @samp{FLAGGED}, tag
+ 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.
+
+ - {{{kbd(?)}}} ::
+
+ Pressing {{{kbd(?)}}} 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 {{{kbd(? z C-y C-c C-c)}}}. Pressing
+ {{{kbd(?)}}} 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.
+
+#+kindex: ? @r{(Agenda dispatcher)}
+From the agenda dispatcher, {{{kbd(?)}}} 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.
+
+* Hacking
+:PROPERTIES:
+:DESCRIPTION: How to hack your way around.
+:APPENDIX: t
+:END:
+#+cindex: hacking
+
+This appendix describes some ways a user can extend the functionality
+of Org.
+
+** Hooks
+:PROPERTIES:
+:DESCRIPTION: How to reach into Org's internals.
+:END:
+#+cindex: 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
+https://orgmode.org/worg/doc.html#hooks.
+
+** Add-on Packages
+:PROPERTIES:
+:DESCRIPTION: Available extensions.
+:END:
+#+cindex: add-on packages
+
+Various authors wrote a large number of add-on packages for Org. Some
+of these packages used to be part of the =org-mode= repository but are
+now hosted in a separate =org-contrib= repository
+[[https://git.sr.ht/~bzg/org-contrib][here]]. A Worg page with more
+information is at: https://orgmode.org/worg/org-contrib/.
+
+** Adding Hyperlink Types
+:PROPERTIES:
+:DESCRIPTION: New custom link types.
+:END:
+#+cindex: hyperlinks, adding new types
+
+Org has many built-in hyperlink types (see [[*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]]
+
+#+texinfo: @noindent
+The following =ol-man.el= file implements it
+
+#+begin_src emacs-lisp
+;;; ol-man.el - Support for links to man pages in Org mode
+(require 'ol)
+
+(org-link-set-parameters "man"
+ :follow #'org-man-open
+ :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-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 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-link-store-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&section=all" link))
+ (desc (or description link)))
+ (pcase format
+ (`html (format "<a target=\"_blank\" href=\"%s\">%s</a>" 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 ol-man)
+;;; ol-man.el ends here
+#+end_src
+
+#+texinfo: @noindent
+To activate links to man pages in Org, enter this in the Emacs init
+file:
+
+#+begin_src emacs-lisp
+(require 'ol-man)
+#+end_src
+
+#+texinfo: @noindent
+A review of =ol-man.el=:
+
+1. First, =(require 'ol)= ensures that =ol.el= is loaded.
+
+2.
+
+ #+findex: org-link-set-parameters
+ #+vindex: org-link-parameters
+ 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 [[*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.
+
+** Adding Export Back-ends
+:PROPERTIES:
+:DESCRIPTION: How to write new export back-ends.
+:END:
+#+cindex: Export, writing 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.
+
+#+findex: org-export-define-backend
+#+findex: org-export-define-derived-backend
+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 [[https://orgmode.org/worg/dev/org-export-reference.html][the Org Export Reference on Worg]].
+
+** Tables in Arbitrary Syntax
+:PROPERTIES:
+:DESCRIPTION: Orgtbl for LaTeX and other programs.
+:END:
+#+cindex: tables, in other modes
+#+cindex: lists, in other modes
+#+cindex: Orgtbl mode
+
+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.
+
+*** Radio tables
+:PROPERTIES:
+:DESCRIPTION: Sending and receiving radio tables.
+:END:
+#+cindex: 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_example
+/* BEGIN RECEIVE ORGTBL table_name */
+/* END RECEIVE ORGTBL table_name */
+#+end_example
+
+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:
+
+#+cindex: @samp{ORGTBL}, keyword
+: #+ORGTBL: SEND table_name translation_function arguments ...
+
+#+texinfo: @noindent
+=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
+ {{{kbd(M-x orgtbl-toggle-comment)}}} command makes toggling easy.
+
+*** A LaTeX example of radio tables
+:PROPERTIES:
+:DESCRIPTION: Step by step, almost a tutorial.
+:ALT_TITLE: A LaTeX example
+:END:
+#+cindex: @LaTeX{}, and Orgtbl mode
+
+To wrap a source table in LaTeX, use the =comment= environment
+provided by =comment.sty=[fn:156]. To activate it, put
+~\usepackage{comment}~ in the document header. Orgtbl mode inserts
+a radio table skeleton[fn:157] with the command {{{kbd(M-x
+orgtbl-insert-radio-table)}}}, which prompts for a table name. For
+example, if =salesfigures= is the name, the template inserts:
+
+#+begin_example
+% BEGIN RECEIVE ORGTBL salesfigures
+% END RECEIVE ORGTBL salesfigures
+\begin{comment}
+,#+ORGTBL: SEND salesfigures orgtbl-to-latex
+| | |
+\end{comment}
+#+end_example
+
+#+vindex: LaTeX-verbatim-environments
+#+texinfo: @noindent
+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[fn:158]:
+
+#+begin_example
+% 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}
+#+end_example
+
+After editing, {{{kbd(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_example
+\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}
+#+end_example
+
+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 [[*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
+ {{{var(EFMT)}}} has been applied to a value, {{{var(FMT)}}}---see
+ above---is also applied. Functions with two arguments can be
+ supplied instead of strings. By default, no special formatting is
+ applied.
+
+*** Translator functions
+:PROPERTIES:
+:DESCRIPTION: Copy and modify.
+:END:
+#+cindex: HTML, and Orgtbl mode
+#+cindex: translator function
+
+#+findex: orgtbl-to-csv
+#+findex: orgtbl-to-tsv
+#+findex: orgtbl-to-latex
+#+findex: orgtbl-to-html
+#+findex: orgtbl-to-texinfo
+#+findex: orgtbl-to-unicode
+#+findex: orgtbl-to-orgtbl
+#+findex: orgtbl-to-generic
+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:
+
+#+begin_src emacs-lisp
+(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)))
+#+end_src
+
+#+texinfo: @noindent
+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 mailto:emacs-orgmode@gnu.org.
+
+** Dynamic Blocks
+:PROPERTIES:
+:DESCRIPTION: Automatically filled blocks.
+:END:
+#+cindex: 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.
+
+#+kindex: C-c C-x x
+#+findex: org-dynamic-block-insert-dblock
+You can insert a dynamic block with ~org-dynamic-block-insert-dblock~,
+which is bound to {{{kbd(C-c C-x x)}}} by default. For example,
+{{{kbd(C-c C-x x c l o c k t a b l e RET)}}} inserts a table that
+updates the work time (see [[*Clocking Work Time]]).
+
+Dynamic blocks can have names and function parameters. The syntax is
+similar to source code block specifications:
+
+#+begin_example
+,#+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
+ ...
+,#+END:
+#+end_example
+
+These commands update dynamic blocks:
+
+- {{{kbd(C-c C-x C-u)}}} (~org-dblock-update~) ::
+
+ #+kindex: C-c C-x C-u
+ #+findex: org-dblock-update
+ Update dynamic block at point.
+
+- {{{kbd(C-u C-c C-x C-u)}}} ::
+
+ #+kindex: 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 as a plist. The
+previous content of the dynamic block becomes erased from the buffer
+and appended to the plist under ~:content~.
+
+The syntax for naming a writer function with a dynamic block labeled
+=myblock= is: ~org-dblock-write:myblock~.
+
+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_example
+,#+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
+ ...
+,#+END:
+#+end_example
+
+#+texinfo: @noindent
+The dynamic block's writer function:
+
+#+begin_src emacs-lisp
+(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))))
+#+end_src
+
+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.
+
+#+findex: org-narrow-to-block
+Dynamic blocks, like any other block, can be narrowed with
+~org-narrow-to-block~.
+
+** Special Agenda Views
+:PROPERTIES:
+:DESCRIPTION: Customized views.
+:END:
+#+cindex: agenda views, user-defined
+
+#+vindex: org-agenda-skip-function
+#+vindex: org-agenda-skip-function-global
+Org provides a special hook to further limit items in agenda views:
+~agenda~, ~agenda*~[fn:159], ~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.
+
+#+begin_src emacs-lisp
+(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
+#+end_src
+
+To use this custom function in a custom agenda command:
+
+#+begin_src emacs-lisp
+(org-add-agenda-custom-command
+ '("b" todo "PROJECT"
+ ((org-agenda-skip-function 'my-skip-unless-waiting)
+ (org-agenda-overriding-header "Projects waiting for something: "))))
+#+end_src
+
+#+vindex: org-agenda-overriding-header
+Note that this also binds ~org-agenda-overriding-header~ to a more
+meaningful string suitable for the agenda view.
+
+#+vindex: org-odd-levels-only
+#+vindex: org-agenda-skip-function
+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=[fn:160]. 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:
+
+#+begin_src emacs-lisp
+(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: "))))
+#+end_src
+
+** Speeding Up Your Agendas
+:PROPERTIES:
+:DESCRIPTION: Tips on how to speed up your agendas.
+:END:
+#+cindex: agenda views, optimization
+
+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:
+ #+vindex: org-agenda-dim-blocked-tasks
+
+ #+begin_src emacs-lisp
+ (setq org-agenda-dim-blocked-tasks nil)
+ #+end_src
+
+- Stop preparing agenda buffers on startup:
+ #+vindex: org-startup-folded
+ #+vindex: org-agenda-inhibit-startup
+
+ #+begin_src emacs-lisp
+ (setq org-agenda-inhibit-startup t)
+ #+end_src
+
+- Disable tag inheritance for agendas:
+ #+vindex: org-agenda-show-inherited-tags
+ #+vindex: org-agenda-use-tag-inheritance
+
+ #+begin_src emacs-lisp
+ (setq org-agenda-use-tag-inheritance nil)
+ #+end_src
+
+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 [[https://orgmode.org/worg/agenda-optimization.html][dedicated Worg page]] for agenda
+optimization.
+
+** Extracting Agenda Information
+:PROPERTIES:
+:DESCRIPTION: Post-processing agenda information.
+:END:
+#+cindex: agenda, pipe
+#+cindex: scripts, for agenda processing
+
+Org provides commands to access agendas through Emacs batch mode.
+Through this command-line interface, agendas are automated for further
+processing or printing.
+
+#+vindex: org-agenda-custom-commands
+#+findex: org-batch-agenda
+~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 [[*The 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=:
+
+#+begin_example
+emacs -batch -l ~/.emacs \
+ -eval '(org-batch-agenda "+shop-NewYork")' | lpr
+#+end_example
+
+#+texinfo: @noindent
+An example showing on-the-fly parameter modifications:
+
+#+begin_example
+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
+#+end_example
+
+#+texinfo: @noindent
+which produces an agenda for the next 30 days from just the
+=~/org/projects.org= file.
+
+#+findex: org-batch-agenda-csv
+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:
+
+#+begin_src perl
+#!/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";
+}
+#+end_src
+
+** Using the Property API
+:PROPERTIES:
+:DESCRIPTION: Writing programs that use entry properties.
+:END:
+#+cindex: API, for properties
+#+cindex: properties, API
+
+Here is a description of the functions that can be used to work with
+properties.
+
+#+attr_texinfo: :options org-entry-properties &optional pom which
+#+begin_defun
+Get all properties of the entry at point-or-marker {{{var(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. {{{var(POM)}}} may also
+be ~nil~, in which case the current entry is used. If
+{{{var(WHICH)}}} is ~nil~ or ~all~, get all properties. If
+{{{var(WHICH)}}} is ~special~ or ~standard~, only get that subclass.
+#+end_defun
+
+#+vindex: org-use-property-inheritance
+#+findex: org-insert-property-drawer
+#+attr_texinfo: :options org-entry-get pom property &optional inherit
+#+begin_defun
+Get value of {{{var(PROPERTY)}}} for entry at point-or-marker
+{{{var(POM)}}}. By default, this only looks at properties defined
+locally in the entry. If {{{var(INHERIT)}}} is non-~nil~ and the
+entry does not have the property, then also check higher levels of the
+hierarchy. If {{{var(INHERIT)}}} is the symbol ~selective~, use
+inheritance if and only if the setting of
+~org-use-property-inheritance~ selects {{{var(PROPERTY)}}} for
+inheritance.
+#+end_defun
+
+#+attr_texinfo: :options org-entry-delete pom property
+#+begin_defun
+Delete the property {{{var(PROPERTY)}}} from entry at point-or-marker
+{{{var(POM)}}}.
+#+end_defun
+
+#+attr_texinfo: :options org-entry-put pom property value
+#+begin_defun
+Set {{{var(PROPERTY)}}} to {{{var(VALUES)}}} for entry at
+point-or-marker POM.
+#+end_defun
+
+#+attr_texinfo: :options org-buffer-property-keys &optional include-specials
+#+begin_defun
+Get all property keys in the current buffer.
+#+end_defun
+
+#+attr_texinfo: :options org-insert-property-drawer
+#+begin_defun
+Insert a property drawer for the current entry. Also
+#+end_defun
+
+#+attr_texinfo: :options org-entry-put-multivalued-property pom property &rest values
+#+begin_defun
+Set {{{var(PROPERTY)}}} at point-or-marker {{{var(POM)}}} to
+{{{var(VALUES)}}}. {{{var(VALUES)}}} should be a list of strings.
+They are concatenated, with spaces as separators.
+#+end_defun
+
+#+attr_texinfo: :options org-entry-get-multivalued-property pom property
+#+begin_defun
+Treat the value of the property {{{var(PROPERTY)}}} as
+a whitespace-separated list of values and return the values as a list
+of strings.
+#+end_defun
+
+#+attr_texinfo: :options org-entry-add-to-multivalued-property pom property value
+#+begin_defun
+Treat the value of the property {{{var(PROPERTY)}}} as
+a whitespace-separated list of values and make sure that
+{{{var(VALUE)}}} is in this list.
+#+end_defun
+
+#+attr_texinfo: :options org-entry-remove-from-multivalued-property pom property value
+#+begin_defun
+Treat the value of the property {{{var(PROPERTY)}}} as
+a whitespace-separated list of values and make sure that
+{{{var(VALUE)}}} is /not/ in this list.
+#+end_defun
+
+#+attr_texinfo: :options org-entry-member-in-multivalued-property pom property value
+#+begin_defun
+Treat the value of the property {{{var(PROPERTY)}}} as
+a whitespace-separated list of values and check if {{{var(VALUE)}}} is
+in this list.
+#+end_defun
+
+#+attr_texinfo: :options org-property-allowed-value-functions
+#+begin_defopt
+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.
+#+end_defopt
+
+** Using the Mapping API
+:PROPERTIES:
+:DESCRIPTION: Mapping over all or selected entries.
+:END:
+#+cindex: API, for mapping
+#+cindex: mapping entries, 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:
+
+#+attr_texinfo: :options org-map-entries func &optional match scope &rest skip
+#+begin_defun
+Call {{{var(FUNC)}}} at each headline selected by {{{var(MATCH)}}} in
+{{{var(SCOPE)}}}.
+
+{{{var(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 {{{var(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
+{{{var(FUNC)}}} set the variable ~org-map-continue-from~ to a specific
+buffer position.
+
+{{{var(MATCH)}}} is a tags/property/TODO match. Org iterates only
+matched headlines. Org iterates over all headlines when
+{{{var(MATCH)}}} is ~nil~ or ~t~.
+
+{{{var(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.
+
+#+texinfo: @noindent
+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 ::
+
+ #+vindex: org-agenda-skip-function
+ Used as value for ~org-agenda-skip-function~, so whenever the
+ function returns ~t~, {{{var(FUNC)}}} is called for that entry and
+ search continues from the point where the function leaves it.
+#+end_defun
+
+The mapping routine can call any arbitrary function, even functions
+that change meta data or query the property API (see [[*Using the
+Property API]]). Here are some handy functions:
+
+#+attr_texinfo: :options org-todo &optional arg
+#+begin_defun
+Change the TODO state of the entry. See the docstring of the
+functions for the many possible values for the argument
+{{{var(ARG)}}}.
+#+end_defun
+
+#+attr_texinfo: :options org-priority &optional action
+#+begin_defun
+Change the priority of the entry. See the docstring of this function
+for the possible values for {{{var(ACTION)}}}.
+#+end_defun
+
+#+attr_texinfo: :options org-toggle-tag tag &optional onoff
+#+begin_defun
+Toggle the tag {{{var(TAG)}}} in the current entry. Setting
+{{{var(ONOFF)}}} to either ~on~ or ~off~ does not toggle tag, but
+ensure that it is either on or off.
+#+end_defun
+
+#+attr_texinfo: :options org-promote
+#+begin_defun
+Promote the current entry.
+#+end_defun
+
+#+attr_texinfo: :options org-demote
+#+begin_defun
+Demote the current entry.
+#+end_defun
+
+This example turns all entries tagged with =TOMORROW= into TODO
+entries with keyword =UPCOMING=. Org ignores entries in comment trees
+and archive trees.
+
+#+begin_src emacs-lisp
+(org-map-entries '(org-todo "UPCOMING")
+ "+TOMORROW" 'file 'archive 'comment)
+#+end_src
+
+The following example counts the number of entries with TODO keyword
+=WAITING=, in all agenda files.
+
+#+begin_src emacs-lisp
+(length (org-map-entries t "/+WAITING" 'agenda))
+#+end_src
+
+* History and Acknowledgments
+:PROPERTIES:
+:DESCRIPTION: How Org came into being.
+:APPENDIX: t
+:END:
+
+** From Carsten
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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
+[[mailto:emacs-orgmode@gnu.org][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 JavaScript program 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!
+
+** From Bastien
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+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.
+
+** List of Contributions
+:PROPERTIES:
+:UNNUMBERED: notoc
+:END:
+
+- Russell Adams came up with the idea for drawers.
+
+- Thomas Baumann wrote =ol-bbdb.el= and =ol-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 =ol-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.
+
+- Timothy E Chapman worked on a complete overhaul of the orgmode.org
+ website in 2020 and helped fixing various bugs.
+
+- 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\nbsp{}S.\nbsp{}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\nbsp{}A.\nbsp{}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 =ol-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\nbsp{}F.\nbsp{}McBrayer suggested agenda export to CSV format.
+
+- Kyle Meyer helped setting up the [[https://public-inbox.org/][public-inbox]] archive of the [[https://orgmode.org/list/][Org
+ mailing list]] and has been fixing many bugs.
+
+- 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.
+
+- Ihor Radchenko helped with fixing bugs and improving the user
+ experience regarding Org's speed.
+
+- T.\nbsp{}V.\nbsp{}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 the [[https://git.sr.ht/~bzg/org-contrib][org-contrib]] repository.
+
+- 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 =ol-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\nbsp{}K.\nbsp{}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 =ol-eww.el=.
+
+* GNU Free Documentation License
+:PROPERTIES:
+:APPENDIX: t
+:DESCRIPTION: The license for this documentation.
+:END:
+
+#+include: fdl.org
+
+* Main Index
+:PROPERTIES:
+:INDEX: cp
+:DESCRIPTION: An index of Org's concepts and features.
+:END:
+
+* Key Index
+:PROPERTIES:
+:DESCRIPTION: Key bindings and where they are described.
+:INDEX: ky
+:END:
+
+* Command and Function Index
+:PROPERTIES:
+:DESCRIPTION: Command names and some internal functions.
+:INDEX: fn
+:END:
+
+* Variable Index
+:PROPERTIES:
+:DESCRIPTION: Variables mentioned in the manual.
+:INDEX: vr
+:END:
+
+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
+{{{kbd(M-x org-customize)}}} and then click yourself through the tree.
+
+* Copying
+:PROPERTIES:
+:copying: t
+:END:
+
+This manual is for Org version {{{version}}}.
+
+Copyright \copy 2004--2021 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 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."
+#+end_quote
+
+* Export Setup :noexport:
+
+#+setupfile: doc-setup.org
+
+#+export_file_name: org.texi
+
+#+texinfo_dir_category: Emacs editing modes
+#+texinfo_dir_title: Org Mode: (org)
+#+texinfo_dir_desc: Outline-based notes management and organizer
+
+* Footnotes
+
+[fn: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)=.
+
+[fn:2] Please consider subscribing to the mailing list in order to
+minimize the work the mailing list moderators have to do.
+
+[fn:3] See the variables ~org-special-ctrl-a/e~, ~org-special-ctrl-k~,
+and ~org-ctrl-k-protect-subtree~ to configure special behavior of
+{{{kbd(C-a)}}}, {{{kbd(C-e)}}}, and {{{kbd(C-k)}}} in headlines. Note
+also that clocking only works with headings indented less than 30
+stars.
+
+[fn:4] See, however, the option ~org-cycle-emulate-tab~.
+
+[fn:5] 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 [[info:emacs#Indirect Buffers][GNU Emacs Manual]].
+
+[fn:6] 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 [[*Speeding Up Your Agendas]]).
+
+[fn:7] See also the variable ~org-show-context-detail~ to decide how
+much context is shown around each match.
+
+[fn:8] This depends on the option ~org-remove-highlights-with-change~.
+
+[fn:9] 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.
+
+[fn:10] You can filter out any of them by configuring
+~org-plain-list-ordered-item-terminator~.
+
+[fn:11] 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.
+
+[fn:12] 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]=.
+
+[fn:13] If you do not want the item to be split, customize the
+variable ~org-M-RET-may-split-line~.
+
+[fn:14] If you want to cycle around items that way, you may customize
+~org-list-use-circular-motion~.
+
+[fn:15] See ~org-list-use-circular-motion~ for a cyclic behavior.
+
+[fn:16] Many desktops intercept {{{kbd(M-TAB)}}} to switch windows.
+Use {{{kbd(C-M-i)}}} or {{{kbd(ESC TAB)}}} instead.
+
+[fn:17] To insert a vertical bar into a table field, use =\vert= or,
+inside a word =abc\vert{}def=.
+
+[fn:18] 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~.
+
+[fn:19] The computation time scales as O(N^2) because table
+{{{var(FOO)}}} is parsed for each field to be copied.
+
+[fn:20] 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.
+
+[fn:21] 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.
+
+[fn:22] Such names must start with an alphabetic character and use
+only alphanumeric/underscore characters.
+
+[fn:23] Plain URIs are recognized only for a well-defined set of
+schemes. See [[*External Links]]. Unlike URI syntax, they cannot contain
+parenthesis or white spaces, either. URIs within angle brackets have
+no such limitation.
+
+[fn:24] More accurately, the precise behavior depends on how point
+arrived there---see [[info:elisp#Invisible Text][Invisible Text]].
+
+[fn:25] 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 {{{kbd(M-TAB)}}}. All headlines in the current
+buffer are offered as completions.
+
+[fn:26] When targeting a =NAME= keyword, the =CAPTION= keyword is
+mandatory in order to get proper numbering (see [[*Captions]]).
+
+[fn:27] 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.
+
+[fn:28] 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.
+
+[fn:29] 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.
+
+[fn:30] 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.
+
+[fn:31] 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 {{{kbd(C-u)}}} prefix argument to {{{kbd(C-c C-l)}}}, or
+configure the option ~org-link-keep-stored-after-insertion~.
+
+[fn:32] This works if a function has been defined in the ~:complete~
+property of a link in ~org-link-parameters~.
+
+[fn:33] See the variable ~org-link-use-indirect-buffer-for-internals~.
+
+[fn:34] For backward compatibility, line numbers can also follow a
+single colon.
+
+[fn:35] Of course, you can make a document that contains only long
+lists of TODO items, but this is not required.
+
+[fn:36] Changing the variable ~org-todo-keywords~ only becomes
+effective after restarting Org mode in a buffer.
+
+[fn:37] This is also true for the {{{kbd(t)}}} command in the agenda
+buffer.
+
+[fn:38] All characters are allowed except =@=, =^= and =!=, which have
+a special meaning here.
+
+[fn:39] Check also the variable ~org-fast-tag-selection-include-todo~,
+it allows you to change the TODO state through the tags interface (see
+[[*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.
+
+[fn:40] Org mode parses these lines only when Org mode is activated
+after visiting a file. {{{kbd(C-c C-c)}}} with point in a line
+starting with =#+= is simply restarting Org mode for the current
+buffer.
+
+[fn:41] The corresponding in-buffer setting is: =#+STARTUP: logdone=.
+
+[fn:42] The corresponding in-buffer setting is: =#+STARTUP:
+lognotedone=.
+
+[fn:43] See the variable ~org-log-states-order-reversed~.
+
+[fn:44] Note that the =LOGBOOK= drawer is unfolded when pressing
+{{{kbd(SPC)}}} in the agenda to show an entry---use {{{kbd(C-u
+SPC)}}} to keep it folded here.
+
+[fn:45] 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.
+
+[fn:46] See also the option ~org-priority-start-cycle-with-default~.
+
+[fn:47] To keep subtasks out of the global TODO list, see the option
+~org-agenda-todo-list-sublevels~.
+
+[fn:48] With the exception of description lists. But you can allow it
+by modifying ~org-list-automatic-rules~ accordingly.
+
+[fn:49] 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.
+
+[fn:50] {{{kbd(C-u C-c C-c)}}} on the /first/ item of a list with no
+checkbox adds checkboxes to the rest of the list.
+
+[fn:51] As with all these in-buffer settings, pressing {{{kbd(C-c
+C-c)}}} activates any changes in the line.
+
+[fn:52] This is only true if the search does not involve more complex
+tests including properties (see [[*Property Searches]]).
+
+[fn:53] To extend this default list to all tags used in all agenda
+files (see [[*Agenda Views]]), customize the variable
+~org-complete-tags-always-offer-all-agenda-tags~.
+
+[fn:54] Keys are automatically assigned to tags that have no
+configured keys.
+
+[fn:55] If more than one summary type applies to the same property,
+the parent values are computed according to the first of them.
+
+[fn:56] 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.
+
+[fn:57] Please note that the =COLUMNS= definition must be on a single
+line; it is wrapped here only because of formatting constraints.
+
+[fn:58] Contributed packages are not part of Emacs, but are
+distributed with the main distribution of Org---visit
+[[https://orgmode.org]].
+
+[fn:59] The Org date format is inspired by the standard ISO 8601
+date/time format. To use an alternative format, see [[*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.
+
+[fn:60] When working with the standard diary expression 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~.
+
+[fn:61] 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.
+
+[fn:62] If you do not need/want the calendar, configure the variable
+~org-popup-calendar-for-date-prompt~.
+
+[fn:63] You can also use the calendar command {{{kbd(.)}}} to jump to
+today's date, but if you are inserting an hour specification for your
+timestamp, {{{kbd(.)}}} will then insert a dot after the hour. By contrast,
+{{{kbd(C-.)}}} will always jump to today's date.
+
+[fn:64] If you find this distracting, turn off the display with
+~org-read-date-display-live~.
+
+[fn:65] It will still be listed on that date after it has been marked
+as done. If you do not like this, set the variable
+~org-agenda-skip-scheduled-if-done~.
+
+[fn:66] 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.
+
+[fn:67] Note the corresponding =STARTUP= options =logredeadline=,
+=lognoteredeadline=, and =nologredeadline=.
+
+[fn:68] Note the corresponding =STARTUP= options =logreschedule=,
+=lognotereschedule=, and =nologreschedule=.
+
+[fn:69] Org does not repeat inactive timestamps, however. See
+[[*Timestamps]].
+
+[fn:70] 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.
+
+[fn:71] 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.
+
+[fn:72] 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~.
+
+[fn:73] To resume the clock under the assumption that you have worked
+on this task while outside Emacs, use =(setq org-clock-persist t)=.
+
+[fn:74] To add an effort estimate "on the fly", hook a function doing
+this to ~org-clock-in-prepare-hook~.
+
+[fn:75] The last reset of the task is recorded by the =LAST_REPEAT=
+property.
+
+[fn:76] See also the variable ~org-clock-mode-line-total~.
+
+[fn:77] The corresponding in-buffer setting is: =#+STARTUP:
+lognoteclock-out=.
+
+[fn:78] When using ~:step~, ~untilnow~ starts from the beginning of
+2003, not the beginning of time.
+
+[fn:79] Language terms can be set through the variable
+~org-clock-clocktable-language-setup~.
+
+[fn:80] Note that all parameters must be specified in a single
+line---the line is broken here only to fit it into the manual.
+
+[fn:81] 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 =org-contrib/=
+repository, 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.
+
+[fn:82] Please note the pitfalls of summing hierarchical data in
+a flat list (see [[*Using Column View in the Agenda]]).
+
+[fn:83] Note the corresponding =STARTUP= options =logrefile=,
+=lognoterefile=, and =nologrefile=.
+
+[fn:84] 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.
+
+[fn:85] 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.
+
+[fn:86] When the file name is not absolute, Org assumes it is relative
+to ~org-directory~.
+
+[fn:87] If you need one of these sequences literally, escape the =%=
+with a backslash.
+
+[fn:88] If you define your own link types (see [[*Adding Hyperlink
+Types]]), any property you store with ~org-store-link-props~ can be
+accessed in capture templates in a similar way.
+
+[fn:89] This is always the other, not the user. See the variable
+~org-link-from-user-regexp~.
+
+[fn:90] If you move entries or Org files from one directory to
+another, you may want to configure ~org-attach-id-dir~ to contain
+an absolute path.
+
+[fn:91] 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.
+
+[fn:92] When using the dispatcher, pressing {{{kbd(<)}}} before
+selecting a command actually limits the command to the current file,
+and ignores ~org-agenda-files~ until the next dispatcher command.
+
+[fn:93] For backward compatibility, you can also press {{{kbd(1)}}} to
+restrict to the current buffer.
+
+[fn:94] For backward compatibility, you can also press {{{kbd(0)}}} to
+restrict to the current region/subtree.
+
+[fn:95] For backward compatibility, the universal prefix argument
+{{{kbd(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 [[*Block agenda]]).
+
+[fn:96] 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~.
+
+[fn:97] You can, however, disable this by setting
+~org-agenda-search-headline-for-time~ variable to a ~nil~ value.
+
+[fn:98] Custom agenda commands can preset a filter by binding one of
+the variables ~org-agenda-tag-filter-preset~,
+~org-agenda-category-filter-preset~, ~org-agenda-effort-filter-preset~
+or ~org-agenda-regexp-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.
+
+[fn:99] Only tags filtering is respected here, effort filtering is
+ignored.
+
+[fn:100] You can also create persistent custom functions through
+~org-agenda-bulk-custom-functions~.
+
+[fn:101] This file is parsed for the agenda when
+~org-agenda-include-diary~ is set.
+
+[fn:102] You can provide a description for a prefix key by inserting
+a cons cell with the prefix and the description.
+
+[fn:103] /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.
+
+[fn:104] For HTML you need to install Hrvoje Nikšić's =htmlize.el=
+as an Emacs package from MELPA or from [[https://github.com/hniksic/emacs-htmlize][Hrvoje Nikšić's repository]].
+
+[fn:105] To create PDF output, the Ghostscript ps2pdf utility must be
+installed on the system. Selecting a PDF file also creates the
+postscript file.
+
+[fn:106] 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.
+
+[fn:107] Quoting depends on the system you use, please check the FAQ
+for examples.
+
+[fn:108] 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=.
+
+[fn:109] This behavior can be disabled with =-= export setting (see
+[[*Export Settings]]).
+
+[fn:110] LaTeX is a macro system based on Donald\nbsp{}E.\nbsp{}Knuth's TeX
+system. Many of the features described here as "LaTeX" are really
+from TeX, but for simplicity I am blurring this distinction.
+
+[fn:111] 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.
+
+[fn:112] 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.
+
+[fn:113] 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~.
+
+[fn:114] 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
+[[https://www.ctan.org/pkg/listings][listings]] package or the [[https://www.ctan.org/pkg/minted][minted]] package. Refer to
+~org-latex-listings~ for details.
+
+[fn:115] Source code in code blocks may also be evaluated either
+interactively or on export. See [[*Working with Source Code]] for more
+information on evaluating code blocks.
+
+[fn:116] 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.
+
+[fn:117] You may select a different mode with the variable
+~org-edit-fixed-width-region-mode~.
+
+[fn:118] What Emacs considers to be an image depends on
+~image-file-name-extensions~ and ~image-file-name-regexps~.
+
+[fn:119] The variable ~org-startup-with-inline-images~ can be set
+within a buffer with the =STARTUP= options =inlineimages= and
+=noinlineimages=.
+
+[fn:120] The corresponding in-buffer setting is: =#+STARTUP: fninline=
+or =#+STARTUP: nofninline=.
+
+[fn:121] The corresponding in-buffer options are =#+STARTUP: fnadjust=
+and =#+STARTUP: nofnadjust=.
+
+[fn:122] The variable ~org-export-date-timestamp-format~ defines how
+this timestamp are exported.
+
+[fn:123] For export to LaTeX format---or LaTeX-related formats such as
+Beamer---, the =org-latex-package-alist= variable needs further
+configuration. See [[LaTeX specific export settings]].
+
+[fn:124] 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.
+
+[fn:125] 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.
+
+[fn:126] 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.
+
+[fn:127] For a less drastic behavior, consider using a select tag (see
+[[*Export Settings]]) instead.
+
+[fn:128] 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.
+
+[fn:129] By default Org loads MathJax from [[https://cdnjs.com][cdnjs.com]] as recommended by
+[[https://www.mathjax.org][MathJax]].
+
+[fn:130] Please note that exported formulas are part of an HTML
+document, and that signs such as =<=, =>=, or =&= have special
+meanings. See [[http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-in-html-documents][MathJax TeX and LaTeX support]].
+
+[fn:131] See [[http://docs.mathjax.org/en/latest/tex.html#tex-extensions][TeX and LaTeX extensions]] in the [[http://docs.mathjax.org][MathJax manual]] to learn
+about extensions.
+
+[fn:132] 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.
+
+[fn:133] 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.
+
+[fn:134] Minted uses an external Python package for code highlighting,
+which requires the flag =-shell-escape= to be added to
+~org-latex-pdf-process~.
+
+[fn:135] See [[http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html][Open Document Format for Office Applications
+(OpenDocument) Version 1.2]].
+
+[fn:136] See [[http://www.mathtoweb.com/cgi-bin/mathtoweb_home.pl][MathToWeb]].
+
+[fn:137] See [[http://dlmf.nist.gov/LaTeXML/]].
+
+[fn:138] [[http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html][OpenDocument-v1.2 Specification]]
+
+[fn:139] See the =<table:table-template>= element of the
+OpenDocument-v1.2 specification.
+
+[fn:140] 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 =<table:table>= element in the OpenDocument-v1.2 specification.
+
+[fn:141] 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.
+
+[fn:142] The option ~org-babel-no-eval-on-ctrl-c-ctrl-c~ can be used
+to remove code evaluation from the {{{kbd(C-c C-c)}}} key binding.
+
+[fn:143] Actually, the constructs =call_<name>()= and =src_<lang>{}=
+are not evaluated when they appear in a keyword (see [[*Summary of
+In-Buffer Settings]]).
+
+[fn:144] For noweb literate programming details, see
+http://www.cs.tufts.edu/~nr/noweb/.
+
+[fn:145] For more information, please refer to the commentary section
+in =org-tempo.el=.
+
+[fn:146] Org Indent mode also sets ~wrap-prefix~ correctly for
+indenting and wrapping long lines of headlines or text. This minor
+mode also handles Visual Line mode and directly applied settings
+through ~word-wrap~.
+
+[fn:147] This works, but requires extra effort. Org Indent mode is
+more convenient for most applications.
+
+[fn:148] ~org-adapt-indentation~ can also be set to ='headline-data=,
+in which case only data lines below the headline will be indented.
+
+[fn:149] 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.
+
+[fn:150] For a server to host files, consider using a WebDAV server,
+such as [[https://nextcloud.com][Nextcloud]]. Additional help is at this [[https://orgmode.org/worg/org-faq.html#mobileorg_webdav][FAQ entry]].
+
+[fn:151] If Emacs is configured for safe storing of passwords, then
+configure the variable ~org-mobile-encryption-password~; please read
+the docstring of that variable.
+
+[fn:152] Symbolic links in ~org-directory~ need to have the same name
+as their targets.
+
+[fn:153] 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.
+
+[fn:154] Checksums are stored automatically in the file
+=checksums.dat=.
+
+[fn:155] The file will be empty after this operation.
+
+[fn:156] https://www.ctan.org/pkg/comment
+
+[fn:157] By default this works only for LaTeX, HTML, and Texinfo.
+Configure the variable ~orgtbl-radio-table-templates~ to install
+templates for other modes.
+
+[fn:158] 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~.
+
+[fn:159] 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.
+
+[fn:160] Note that, for ~org-odd-levels-only~, a level number
+corresponds to order in the hierarchy, not to the number of stars.
diff --git a/elpa/org-9.5.2/doc/org-version.inc b/elpa/org-9.5.2/doc/org-version.inc
new file mode 100644
index 0000000..22fb34e
--- /dev/null
+++ b/elpa/org-9.5.2/doc/org-version.inc
@@ -0,0 +1,3 @@
+@c automatically generated, do not edit
+@set VERSION 9.5.2 (9.5.2-gfbff08)
+@set DATE 2021-12-24
diff --git a/elpa/org-9.5.2/doc/org.texi b/elpa/org-9.5.2/doc/org.texi
new file mode 100644
index 0000000..a196989
--- /dev/null
+++ b/elpa/org-9.5.2/doc/org.texi
@@ -0,0 +1,23491 @@
+\input texinfo @c -*- texinfo -*-
+@c %**start of header
+@setfilename org.info
+@settitle The Org Manual
+@documentencoding UTF-8
+@documentlanguage en
+@set txicodequoteundirected
+@set txicodequotebacktick
+@set MAINTAINERSITE @uref{https://orgmode.org,maintainers webpage}
+@set MAINTAINER Bastien Guerry
+@set MAINTAINEREMAIL @email{bzg@gnu.org}
+@set MAINTAINERCONTACT @uref{mailto:bzg@gnu.org,contact the maintainer}
+@c %**end of header
+
+@copying
+This manual is for Org version 9.5.
+
+Copyright @copyright{} 2004--2021 Free Software Foundation, Inc.
+
+@quotation
+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.''
+
+@end quotation
+@end copying
+
+@dircategory Emacs editing modes
+@direntry
+* Org Mode: (org). Outline-based notes management and organizer.
+@end direntry
+
+@finalout
+@titlepage
+@title The Org Manual
+@subtitle Release 9.5
+@author The Org Mode Developers
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+
+@contents
+
+@ifnottex
+@node Top
+@top The Org Manual
+
+@insertcopying
+@end ifnottex
+
+@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.
+* Refiling and Archiving:: Moving and copying information with ease.
+* Capture and Attachments:: Dealing with external data.
+* 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.
+* Citation handling:: create, follow and export citations.
+* 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.
+
+@detailmenu
+--- 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.
+
+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 as 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.
+
+Refiling and Archiving
+
+* Refile and Copy:: Moving/copying a tree from one place to another.
+* Archiving:: What to do with finished products.
+
+Archiving
+
+* Moving subtrees:: Moving a tree to an archive file.
+* Internal archiving:: Switch off a tree but keep it in the file.
+
+Capture and Attachments
+
+* Capture:: Capturing new stuff.
+* Attachments:: Attach files to outlines.
+* RSS Feeds:: Getting input from RSS feeds.
+
+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.
+
+Attachments
+
+* Attachment defaults and dispatcher:: How to access attachment commands
+* Attachment options:: Configuring the attachment system
+* Attachment links:: Hyperlink access to attachments
+* Automatic version-control with Git:: Everything safely stored away
+* Attach from Dired:: Using dired to select an attachment
+
+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 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 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.
+* Creating Footnotes:: Edit and read footnotes.
+
+Embedded @LaTeX{}
+
+* @LaTeX{} fragments:: Complex formulas made easy.
+* Previewing @LaTeX{} fragments:: What will this snippet look like?
+* CD@LaTeX{} 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:: Producing presentations and slides.
+* 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.
+* Headlines in HTML export:: Formatting headlines.
+* 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.
+* Verse blocks in @LaTeX{} export:: Attributes specific to special blocks.
+* Quote blocks in @LaTeX{} export:: Attributes specific to quote blocks.
+
+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.
+
+Export in Foreign Buffers
+
+* Bare HTML:: Exporting HTML without CSS, Javascript, etc.
+
+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.
+
+Citation handling
+
+* Citations::
+* Citation export processors::
+
+Working with Source Code
+
+* Features Overview:: Enjoy the versatility of source blocks.
+* 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:: @kbd{M-@key{TAB}} guesses completions.
+* Structure Templates:: Quick insertion of structural elements.
+* Speed Keys:: Electric commands at the beginning of a headline.
+* Clean View:: Getting rid of leading stars in the outline.
+* Execute commands in the active region:: Execute commands on multiple items in Org or agenda view.
+* Dynamic Headline Numbering:: Display and update outline numbering.
+* The Very Busy @kbd{C-c C-c} Key:: When in doubt, press @kbd{C-c C-c}.
+* In-buffer Settings:: Overview of keywords.
+* Regular Expressions:: Elisp regular expressions.
+* Org Syntax:: Formal description of Org's syntax.
+* Documentation Access:: Read documentation about current syntax.
+* Escape Character:: Prevent Org from interpreting your writing.
+* Code Evaluation Security:: Org files evaluate in-line code.
+* Interaction:: With other Emacs packages.
+* TTY Keys:: Using Org on a tty.
+* Protocols:: External access to Emacs and Org.
+* Org Crypt:: Encrypting Org files.
+* Org Mobile:: Viewing and capture on a mobile device.
+
+Clean View
+
+* Org Indent Mode::
+* Hard indentation::
+
+Interaction
+
+* Cooperation:: Packages Org cooperates with.
+* Conflicts:: Packages that lead to conflicts.
+
+Protocols
+
+* The @code{store-link} protocol:: Store a link, push URL to kill-ring.
+* The @code{capture} protocol:: Fill a buffer with external information.
+* The @code{open-source} protocol:: Edit published contents.
+
+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:: 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.
+
+@end detailmenu
+@end menu
+
+@node Introduction
+@chapter Introduction
+
+@cindex 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.
+@end menu
+
+@node Summary
+@section Summary
+
+@cindex 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 @emph{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.
+
+@cindex FAQ
+There is a website for Org which provides links to the newest version
+of Org, as well as additional information, frequently asked questions
+(FAQ), links to tutorials, etc. This page is located at
+@uref{https://orgmode.org}.
+
+@cindex print edition
+An earlier version (7.3) of this manual is available as a @uref{http://www.network-theory.co.uk/org/manual/, paperback
+book from Network Theory Ltd.}.
+
+@node Installation
+@section Installation
+
+@cindex 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, you can use the Emacs package system or clone
+Org's git repository.
+
+We @strong{strongly recommend} sticking to a single installation method.
+
+@anchor{Using Emacs packaging system}
+@subheading Using Emacs packaging system
+
+Recent Emacs distributions include a packaging system which lets you
+install Elisp libraries. You can install Org from the ``package menu'',
+with @kbd{M-x list-packages}. See @ref{Package Menu,Package Menu,,emacs,}.
+
+@quotation Important
+You need to do this in a session where no @samp{.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.
+
+@end quotation
+
+@anchor{Using Org's git repository}
+@subheading Using Org's git repository
+
+You can clone Org's repository and install Org like this:
+
+@example
+$ cd ~/src/
+$ git clone https://git.savannah.gnu.org/git/emacs/org-mode.git
+$ cd org-mode/
+$ make autoloads
+@end example
+
+Note that in this case, @samp{make autoloads} is mandatory: it defines
+Org's version in @samp{org-version.el} and Org's autoloads in
+@samp{org-loaddefs.el}.
+
+Remember to add the correct load path as described in the method
+above.
+
+You can also compile with @samp{make}, generate the documentation with
+@samp{make doc}, create a local configuration with @samp{make config} and
+install Org with @samp{make install}. Please run @samp{make help} to get the
+list of compilation/installation options.
+
+For more detailed explanations on Org's build system, please check the
+Org Build System page on @uref{https://orgmode.org/worg/dev/org-build-system.html, Worg}.
+
+@anchor{Installing Org's contributed packages}
+@subheading Installing Org's contributed packages
+
+Org's repository used to contain @samp{contrib/} directory for add-ons
+contributed by others. As of Org 9.5, the directory has bee moved to
+this new dedicated @uref{https://git.sr.ht/~bzg/org-contrib, org-contrib} repository, which you can install
+separately.
+
+@node Activation
+@section Activation
+
+@cindex activation
+@cindex autoload
+@cindex ELPA
+@cindex global key bindings
+@cindex key bindings, global
+
+Org mode buffers need Font Lock to be turned on: this is the default
+in Emacs@footnote{If you do not use Font Lock globally turn it on in Org buffer
+with @samp{(add-hook 'org-mode-hook #'turn-on-font-lock)}.}.
+
+There are compatibility issues between Org mode and some other Elisp
+packages (see @ref{Conflicts}). Please take the
+time to check the list.
+
+@findex org-agenda
+@findex org-capture
+@findex org-store-link
+For a better experience, the three Org commands @code{org-store-link},
+@code{org-capture} and @code{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
+@ref{Key Binding Conventions,,,elisp,}). Here are suggested bindings,
+please modify the keys to your own liking.
+
+@lisp
+(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)
+@end lisp
+
+@cindex Org mode, turning on
+Files with the @samp{.org} extension use Org mode by default. To turn on
+Org mode in a file that does not have the extension @samp{.org}, make the
+first line of a file look like this:
+
+@example
+MY PROJECTS -*- mode: org; -*-
+@end example
+
+
+@vindex org-insert-mode-line-in-empty-file
+@noindent
+which selects Org mode for this buffer no matter what the file's name
+is. See also the variable @code{org-insert-mode-line-in-empty-file}.
+
+Many commands in Org work on the region if the region is @emph{active}. To
+make use of this, you need to have Transient Mark mode turned on,
+which is the default. If you do not like it, you can create an active
+region by using the mouse to select a region, or pressing
+@kbd{C-@key{SPC}} twice before moving point.
+
+@node Feedback
+@section Feedback
+
+@cindex feedback
+@cindex bug reports
+@cindex reporting a bug
+@cindex maintainer
+@cindex author
+
+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
+@email{emacs-orgmode@@gnu.org}. You can subscribe to the list @uref{https://lists.gnu.org/mailman/listinfo/emacs-orgmode, from this
+web page}. If you are not a member of the mailing list, your mail will
+be passed to the list after a moderator has approved it@footnote{Please consider subscribing to the mailing list in order to
+minimize the work the mailing list moderators have to do.}. We ask
+you to read and respect the @uref{https://www.gnu.org/philosophy/kind-communication.html, GNU Kind Communications Guidelines} when
+sending messages on this mailing list.
+
+@findex org-version
+@findex org-submit-bug-report
+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 (@kbd{M-x emacs-version}) and Org (@kbd{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
+
+@example
+M-x org-submit-bug-report <RET>
+@end example
+
+
+@noindent
+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.
+
+@example
+$ emacs -Q -l /path/to/minimal-org.el
+@end example
+
+
+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 @samp{emacs -Q}. The @samp{minimal-org.el} setup file can have contents as
+shown below.
+
+@lisp
+;;; 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"))
+@end lisp
+
+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:
+
+@enumerate
+@item
+What exactly did you do?
+@item
+What did you expect to happen?
+@item
+What happened instead?
+@end enumerate
+
+Thank you for helping to improve this program.
+
+@anchor{How to create a useful backtrace}
+@subheading How to create a useful backtrace
+
+@cindex backtrace of an error
+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:
+
+@enumerate
+@item
+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
+
+@example
+C-u M-x org-reload <RET>
+@end example
+
+
+@noindent
+or, from the menu: Org @arrow{} Refresh/Reload @arrow{} Reload Org uncompiled.
+
+@item
+Then, activate the debugger:
+
+@example
+M-x toggle-debug-on-error <RET>
+@end example
+
+
+@noindent
+or, from the menu: Options @arrow{} Enter Debugger on Error.
+
+@item
+Do whatever you have to do to hit the error. Do not forget to
+document the steps you take.
+
+@item
+When you hit the error, a @samp{*Backtrace*} buffer appears on the
+screen. Save this buffer to a file---for example using @kbd{C-x C-w}---and attach it to your bug report.
+@end enumerate
+
+@node Conventions
+@section Typesetting Conventions Used in this Manual
+
+
+
+@anchor{TODO keywords tags properties etc}
+@subheading 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:
+
+@table @asis
+@item @samp{TODO}
+@itemx @samp{WAITING}
+TODO keywords are written with all capitals, even if they are
+user-defined.
+
+@item @samp{boss}
+@itemx @samp{ARCHIVE}
+Tags are case-sensitive. User-defined tags are usually written in
+lowercase; built-in tags with special meaning are written as they
+should appear in the document, usually with all capitals.
+
+@item @samp{Release}
+@itemx @samp{PRIORITY}
+User-defined properties are capitalized; built-in properties with
+special meaning are written with all capitals.
+
+@item @samp{TITLE}
+@itemx @samp{BEGIN} @dots{} @samp{END}
+Keywords and blocks are written in uppercase to enhance their
+readability, but you can use lowercase in your Org files.
+@end table
+
+@anchor{Key bindings and commands}
+@subheading 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 @code{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, @kbd{M-@key{RIGHT}} will be listed to call
+@code{org-do-demote}, while in the chapter on tables, it will be listed to
+call @code{org-table-move-column-right}.
+
+@node Document Structure
+@chapter Document Structure
+
+@cindex document structure
+@cindex structure of document
+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,
+@code{org-cycle}, which is bound to the @kbd{@key{TAB}} 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.
+@end menu
+
+@node Headlines
+@section Headlines
+
+@cindex headlines
+@cindex outline tree
+@vindex org-special-ctrl-a/e
+@vindex org-special-ctrl-k
+@vindex org-ctrl-k-protect-subtree
+
+Headlines define the structure of an outline tree. Org headlines
+start on the left margin@footnote{See the variables @code{org-special-ctrl-a/e}, @code{org-special-ctrl-k},
+and @code{org-ctrl-k-protect-subtree} to configure special behavior of
+@kbd{C-a}, @kbd{C-e}, and @kbd{C-k} in headlines. Note
+also that clocking only works with headings indented less than 30
+stars.} with one or more stars followed by
+a space. For example:
+
+@example
+* Top level headline
+** Second level
+*** Third level
+ some text
+*** Third level
+ more text
+* Another top level headline
+@end example
+
+@vindex org-footnote-section
+The name defined in @code{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.
+This can be achieved using a Org Indent minor mode. See @ref{Clean View} for more information.
+
+Headlines are not numbered. However, you may want to dynamically
+number some, or all, of them. See @ref{Dynamic Headline Numbering}.
+
+@vindex org-cycle-separator-lines
+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
+@code{org-cycle-separator-lines} to modify this behavior.
+
+@node Visibility Cycling
+@section Visibility Cycling
+
+@cindex cycling, visibility
+@cindex visibility cycling
+@cindex trees, visibility
+@cindex show hidden text
+@cindex hide text
+
+@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.
+@end menu
+
+@node Global and local cycling
+@subsection Global and local cycling
+
+@cindex subtree visibility states
+@cindex subtree cycling
+@cindex folded, subtree visibility state
+@cindex children, subtree visibility state
+@cindex subtree, subtree visibility state
+
+Outlines make it possible to hide parts of the text in the buffer.
+Org uses just two commands, bound to @kbd{@key{TAB}} and
+@kbd{S-@key{TAB}} to change the visibility in the buffer.
+
+@table @asis
+@item @kbd{@key{TAB}} (@code{org-cycle})
+@kindex TAB
+@findex org-cycle
+@emph{Subtree cycling}: Rotate current subtree among the states
+
+@example
+,-> FOLDED -> CHILDREN -> SUBTREE --.
+'-----------------------------------'
+@end example
+
+@vindex org-cycle-emulate-tab
+Point must be on a headline for this to work@footnote{See, however, the option @code{org-cycle-emulate-tab}.}.
+
+@item @kbd{S-@key{TAB}} (@code{org-global-cycle})
+@itemx @kbd{C-u @key{TAB}}
+@cindex global visibility states
+@cindex global cycling
+@cindex overview, global visibility state
+@cindex contents, global visibility state
+@cindex show all, global visibility state
+@kindex C-u TAB
+@kindex S-TAB
+@findex org-global-cycle
+@emph{Global cycling}: Rotate the entire buffer among the states
+
+@example
+,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
+'--------------------------------------'
+@end example
+
+When @kbd{S-@key{TAB}} is called with a numeric prefix argument
+@var{N}, view contents only up to headlines of level
+@var{N}.
+
+Note that inside tables (see @ref{Tables}), @kbd{S-@key{TAB}} jumps to the
+previous field instead.
+
+@vindex org-cycle-global-at-bob
+You can run global cycling using @kbd{@key{TAB}} only if point is at
+the very beginning of the buffer, but not on a headline, and
+@code{org-cycle-global-at-bob} is set to a non-@code{nil} value.
+
+@item @kbd{C-u C-u @key{TAB}} (@code{org-set-startup-visibility})
+@cindex startup visibility
+@kindex C-u C-u TAB
+@findex org-set-startup-visibility
+Switch back to the startup visibility of the buffer (see @ref{Initial visibility}).
+
+@item @kbd{C-u C-u C-u @key{TAB}} (@code{outline-show-all})
+@cindex show all, command
+@kindex C-u C-u C-u TAB
+@findex outline-show-all
+Show all, including drawers.
+
+@item @kbd{C-c C-r} (@code{org-reveal})
+@cindex revealing context
+@kindex C-c C-r
+@findex org-reveal
+Reveal context around point, showing the current entry, the
+following heading and the hierarchy above. It is useful for working
+near a location that has been exposed by a sparse tree command (see
+@ref{Sparse Trees}) or an agenda command (see @ref{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.
+
+@item @kbd{C-c C-k} (@code{outline-show-branches})
+@cindex show branches, command
+@kindex C-c C-k
+@findex outline-show-branches
+Expose all the headings of the subtree, but not their bodies.
+
+@item @kbd{C-c @key{TAB}} (@code{outline-show-children})
+@cindex show children, command
+@kindex C-c TAB
+@findex outline-show-children
+Expose all direct children of the subtree. With a numeric prefix
+argument @var{N}, expose all children down to level
+@var{N}.
+
+@item @kbd{C-c C-x b} (@code{org-tree-to-indirect-buffer})
+@kindex C-c C-x b
+@findex org-tree-to-indirect-buffer
+Show the current subtree in an indirect buffer@footnote{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 @ref{Indirect Buffers,GNU Emacs Manual,,emacs,}.}. With
+a numeric prefix argument @var{N}, go up to level @var{N}
+and then take that tree. If @var{N} is negative then go up
+that many levels. With a @kbd{C-u} prefix, do not remove the
+previously used indirect buffer.
+
+@item @kbd{C-c C-x v} (@code{org-copy-visible})
+@kindex C-c C-x v
+@findex org-copy-visible
+Copy the @emph{visible} text in the region into the kill ring.
+@end table
+
+@node Initial visibility
+@subsection Initial visibility
+
+@vindex org-startup-folded
+When Emacs first visits an Org file, the global state is set to
+@code{showeverything}, i.e., all file content is visible@footnote{When @code{org-agenda-inhibit-startup} is non-@code{nil}, Org does not
+honor the default visibility state when first opening a file for the
+agenda (see @ref{Speeding Up Your Agendas}).}. This can
+be configured through the variable @code{org-startup-folded}, or on
+a per-file basis by adding one of the following lines anywhere in the
+buffer:
+
+@cindex @samp{STARTUP}, keyword
+@example
+#+STARTUP: overview
+#+STARTUP: content
+#+STARTUP: showall
+#+STARTUP: show2levels
+#+STARTUP: show3levels
+#+STARTUP: show4levels
+#+STARTUP: show5levels
+#+STARTUP: showeverything
+@end example
+
+@cindex @samp{VISIBILITY}, property
+Furthermore, any entries with a @samp{VISIBILITY} property (see @ref{Properties and Columns}) get their visibility adapted accordingly. Allowed values
+for this property are @samp{folded}, @samp{children}, @samp{content}, and @samp{all}.
+
+@table @asis
+@item @kbd{C-u C-u @key{TAB}} (@code{org-set-startup-visibility})
+@kindex C-u C-u TAB
+@findex org-set-startup-visibility
+Switch back to the startup visibility of the buffer, i.e., whatever
+is requested by startup options and @samp{VISIBILITY} properties in
+individual entries.
+@end table
+
+@node Catching invisible edits
+@subsection Catching invisible edits
+
+@cindex edits, catching invisible
+
+@vindex org-catch-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 @code{org-catch-invisible-edits} to non-@code{nil} helps preventing
+this. See the docstring of this option on how Org should catch
+invisible edits and process them.
+
+@node Motion
+@section Motion
+
+@cindex motion, between headlines
+@cindex jumping, to headlines
+@cindex headline navigation
+
+The following commands jump to other headlines in the buffer.
+
+@table @asis
+@item @kbd{C-c C-n} (@code{org-next-visible-heading})
+@kindex C-c C-n
+@findex org-next-visible-heading
+Next heading.
+
+@item @kbd{C-c C-p} (@code{org-previous-visible-heading})
+@kindex C-c C-p
+@findex org-previous-visible-heading
+Previous heading.
+
+@item @kbd{C-c C-f} (@code{org-forward-heading-same-level})
+@kindex C-c C-f
+@findex org-forward-heading-same-level
+Next heading same level.
+
+@item @kbd{C-c C-b} (@code{org-backward-heading-same-level})
+@kindex C-c C-b
+@findex org-backward-heading-same-level
+Previous heading same level.
+
+@item @kbd{C-c C-u} (@code{outline-up-heading})
+@kindex C-c C-u
+@findex outline-up-heading
+Backward to higher level heading.
+
+@item @kbd{C-c C-j} (@code{org-goto})
+@kindex C-c C-j
+@findex org-goto
+@vindex org-goto-auto-isearch
+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:
+
+@multitable @columnfractions 0.3 0.7
+@item @kbd{@key{TAB}}
+@tab Cycle visibility.
+@item @kbd{@key{DOWN}} / @kbd{@key{UP}}
+@tab Next/previous visible headline.
+@item @kbd{@key{RET}}
+@tab Select this location.
+@item @kbd{/}
+@tab Do a Sparse-tree search
+@end multitable
+
+@noindent
+The following keys work if you turn off @code{org-goto-auto-isearch}
+
+@multitable @columnfractions 0.3 0.7
+@item @kbd{n} / @kbd{p}
+@tab Next/previous visible headline.
+@item @kbd{f} / @kbd{b}
+@tab Next/previous headline same level.
+@item @kbd{u}
+@tab One level up.
+@item @kbd{0} @dots{} @kbd{9}
+@tab Digit argument.
+@item @kbd{q}
+@tab Quit.
+@end multitable
+
+@vindex org-goto-interface
+@noindent
+See also the variable @code{org-goto-interface}.
+@end table
+
+@node Structure Editing
+@section Structure Editing
+
+@cindex structure editing
+@cindex headline, promotion and demotion
+@cindex promotion, of subtrees
+@cindex demotion, of subtrees
+@cindex subtree, cut and paste
+@cindex pasting, of subtrees
+@cindex cutting, of subtrees
+@cindex copying, of subtrees
+@cindex sorting, of subtrees
+@cindex subtrees, cut and paste
+
+@table @asis
+@item @kbd{M-@key{RET}} (@code{org-meta-return})
+@kindex M-RET
+@findex org-meta-return
+@vindex org-M-RET-may-split-line
+Insert a new heading, item or row.
+
+If the command is used at the @emph{beginning} of a line, and if there is
+a heading or a plain list item (see @ref{Plain Lists}) at point, the new
+heading/item is created @emph{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
+@code{org-M-RET-may-split-line}.
+
+Calling the command with a @kbd{C-u} prefix unconditionally
+inserts a new heading at the end of the current subtree, thus
+preserving its contents. With a double @kbd{C-u C-u} prefix,
+the new heading is created at the end of the parent subtree instead.
+
+@item @kbd{C-@key{RET}} (@code{org-insert-heading-respect-content})
+@kindex C-RET
+@findex org-insert-heading-respect-content
+Insert a new heading at the end of the current subtree.
+
+@item @kbd{M-S-@key{RET}} (@code{org-insert-todo-heading})
+@kindex M-S-RET
+@findex org-insert-todo-heading
+@vindex org-treat-insert-todo-heading-as-state-change
+Insert new TODO entry with same level as current heading. See also
+the variable @code{org-treat-insert-todo-heading-as-state-change}.
+
+@item @kbd{C-S-@key{RET}} (@code{org-insert-todo-heading-respect-content})
+@kindex C-S-RET
+@findex org-insert-todo-heading-respect-content
+Insert new TODO entry with same level as current heading. Like
+@kbd{C-@key{RET}}, the new headline is inserted after the current
+subtree.
+
+@item @kbd{@key{TAB}} (@code{org-cycle})
+@kindex TAB
+@findex org-cycle
+In a new entry with no text yet, the first @kbd{@key{TAB}} demotes
+the entry to become a child of the previous one. The next
+@kbd{@key{TAB}} makes it a parent, and so on, all the way to top
+level. Yet another @kbd{@key{TAB}}, and you are back to the initial
+level.
+
+@item @kbd{M-@key{LEFT}} (@code{org-do-promote})
+@itemx @kbd{M-@key{RIGHT}} (@code{org-do-demote})
+@kindex M-LEFT
+@findex org-do-promote
+@kindex M-RIGHT
+@findex org-do-demote
+Promote or demote current heading by one level.
+
+@cindex region, active
+@cindex active region
+@cindex transient mark mode
+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.
+
+@item @kbd{M-S-@key{LEFT}} (@code{org-promote-subtree})
+@kindex M-S-LEFT
+@findex org-promote-subtree
+Promote the current subtree by one level.
+
+@item @kbd{M-S-@key{RIGHT}} (@code{org-demote-subtree})
+@kindex M-S-RIGHT
+@findex org-demote-subtree
+Demote the current subtree by one level.
+
+@item @kbd{M-@key{UP}} (@code{org-move-subtree-up})
+@kindex M-UP
+@findex org-move-subtree-up
+Move subtree up, i.e., swap with previous subtree of same level.
+
+@item @kbd{M-@key{DOWN}} (@code{org-move-subtree-down})
+@kindex M-DOWN
+@findex org-move-subtree-down
+Move subtree down, i.e., swap with next subtree of same level.
+
+@item @kbd{C-c @@} (@code{org-mark-subtree})
+@kindex C-c @@
+@findex org-mark-subtree
+Mark the subtree at point. Hitting repeatedly marks subsequent
+subtrees of the same level as the marked subtree.
+
+@item @kbd{C-c C-x C-w} (@code{org-cut-subtree})
+@kindex C-c C-x C-w
+@findex 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.
+
+@item @kbd{C-c C-x M-w} (@code{org-copy-subtree})
+@kindex C-c C-x M-w
+@findex org-copy-subtree
+Copy subtree to kill ring. With a numeric prefix argument N, copy
+the N sequential subtrees.
+
+@item @kbd{C-c C-x C-y} (@code{org-paste-subtree})
+@kindex C-c C-x C-y
+@findex 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 @samp{****}.
+
+@item @kbd{C-y} (@code{org-yank})
+@kindex C-y
+@findex org-yank
+@vindex org-yank-adjusted-subtrees
+@vindex org-yank-folded-subtrees
+Depending on the variables @code{org-yank-adjusted-subtrees} and
+@code{org-yank-folded-subtrees}, Org's internal @code{yank} command pastes
+subtrees folded and in a clever way, using the same command as
+@kbd{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 @code{yank} to be executed, with the prefix
+passed along. A good way to force a normal yank is @kbd{C-u C-y}. If you use @code{yank-pop} after a yank, it yanks previous kill
+items plainly, without adjustment and folding.
+
+@item @kbd{C-c C-x c} (@code{org-clone-subtree-with-time-shift})
+@kindex C-c C-x c
+@findex 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 @code{org-clone-subtree-with-time-shift}.
+
+@item @kbd{C-c C-w} (@code{org-refile})
+@kindex C-c C-w
+@findex org-refile
+Refile entry or region to a different location. See @ref{Refile and Copy}.
+
+@item @kbd{C-c ^} (@code{org-sort})
+@kindex C-c ^
+@findex 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 @kbd{C-u} prefix, sorting is case-sensitive.
+
+@item @kbd{C-x n s} (@code{org-narrow-to-subtree})
+@kindex C-x n s
+@findex org-narrow-to-subtree
+Narrow buffer to current subtree.
+
+@item @kbd{C-x n b} (@code{org-narrow-to-block})
+@kindex C-x n b
+@findex org-narrow-to-block
+Narrow buffer to current block.
+
+@item @kbd{C-x n w} (@code{widen})
+@kindex C-x n w
+@findex widen
+Widen buffer to remove narrowing.
+
+@item @kbd{C-c *} (@code{org-toggle-heading})
+@kindex C-c *
+@findex 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.
+@end table
+
+Note that when point is inside a table (see @ref{Tables}), the Meta-Cursor
+keys have different functionality.
+
+@node Sparse Trees
+@section Sparse Trees
+
+@cindex sparse trees
+@cindex trees, sparse
+@cindex folding, sparse trees
+@cindex occur, command
+
+@vindex org-show-context-detail
+An important feature of Org mode is the ability to construct @emph{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@footnote{See also the variable @code{org-show-context-detail} to decide how
+much context is shown around each match.}.
+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:
+
+@table @asis
+@item @kbd{C-c /} (@code{org-sparse-tree})
+@kindex C-c /
+@findex org-sparse-tree
+This prompts for an extra key to select a sparse-tree creating
+command.
+
+@item @kbd{C-c / r} or @kbd{C-c / /} (@code{org-occur})
+@kindex C-c / r
+@kindex C-c / /
+@findex org-occur
+@vindex org-remove-highlights-with-change
+Prompts for a regexp (see @ref{Regular Expressions}) 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 @kbd{C-c C-c}@footnote{This depends on the option @code{org-remove-highlights-with-change}.}. When
+called with a @kbd{C-u} prefix argument, previous highlights
+are kept, so several calls to this command can be stacked.
+
+@item @kbd{M-g n} or @kbd{M-g M-n} (@code{next-error})
+@kindex M-g n
+@kindex M-g M-n
+@findex next-error
+Jump to the next sparse tree match in this buffer.
+
+@item @kbd{M-g p} or @kbd{M-g M-p} (@code{previous-error})
+@kindex M-g p
+@kindex M-g M-p
+@findex previous-error
+Jump to the previous sparse tree match in this buffer.
+@end table
+
+@vindex org-agenda-custom-commands
+For frequently used sparse trees of specific search strings, you can
+use the variable @code{org-agenda-custom-commands} to define fast keyboard
+access to specific sparse trees. These commands will then be
+accessible through the agenda dispatcher (see @ref{Agenda Dispatcher}).
+For example:
+
+@lisp
+(setq org-agenda-custom-commands
+ '(("f" occur-tree "FIXME")))
+@end lisp
+
+@noindent
+defines the key @kbd{f} as a shortcut for creating a sparse tree
+matching the string @samp{FIXME}.
+
+The other sparse tree commands select headings based on TODO keywords,
+tags, or properties and are discussed later in this manual.
+
+@kindex C-c C-e C-v
+@cindex printing sparse trees
+@cindex visible text, printing
+To print a sparse tree, you can use the Emacs command
+@code{ps-print-buffer-with-faces} which does not print invisible parts of
+the document. Or you can use the command @kbd{C-c C-e C-v} to
+export only the visible part of the document and print the resulting
+file.
+
+@node Plain Lists
+@section Plain Lists
+
+@cindex plain lists
+@cindex lists, plain
+@cindex lists, ordered
+@cindex ordered 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 @ref{Checkboxes}). Org supports editing such lists, and
+every exporter (see @ref{Exporting}) can parse and format them.
+
+Org knows ordered lists, unordered lists, and description lists.
+
+@itemize
+@item
+@emph{Unordered} list items start with @samp{-}, @samp{+}, or @samp{*}@footnote{When using @samp{*} 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 @samp{*} is supported, it may be better to not use it for plain list
+items.} as bullets.
+
+@item
+@vindex org-plain-list-ordered-item-terminator
+@vindex org-alphabetical-lists
+@emph{Ordered} list items start with a numeral followed by either
+a period or a right parenthesis@footnote{You can filter out any of them by configuring
+@code{org-plain-list-ordered-item-terminator}.}, such as @samp{1.} or @samp{1)}@footnote{You can also get @samp{a.}, @samp{A.}, @samp{a)} and @samp{A)} by configuring
+@code{org-list-allow-alphabetical}. To minimize confusion with normal
+text, those are limited to one character only. Beyond that limit,
+bullets automatically become numbers.}
+If you want a list to start with a different value---e.g.,
+20---start the text of the item with @samp{[@@20]}@footnote{If there's a checkbox in the item, the cookie must be put
+@emph{before} the checkbox. If you have activated alphabetical lists, you
+can also use counters like @samp{[@@b]}.}. Those
+constructs can be used in any item of the list in order to enforce
+a particular numbering.
+
+@item
+@emph{Description} list items are unordered list items, and contain the
+separator @samp{::} to distinguish the description @emph{term} from the
+description.
+@end itemize
+
+Items belonging to the same list must have the same indentation on the
+first line. In particular, if an ordered list reaches number @samp{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:
+
+@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/.
+@end example
+
+Org supports these lists by tuning filling and wrapping commands to
+deal with them correctly, and by exporting them properly (see
+@ref{Exporting}). Since indentation is what governs the structure of these
+lists, many structural constructs like @samp{#+BEGIN_} blocks can be
+indented to signal that they belong to a particular item.
+
+@vindex org-list-demote-modify-bullet
+@vindex org-list-indent-offset
+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 @code{org-list-demote-modify-bullet}. To get a greater difference
+of indentation between items and theirs sub-items, customize
+@code{org-list-indent-offset}.
+
+@vindex org-list-automatic-rules
+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 @code{org-list-automatic-rules}
+to disable them individually.
+
+@table @asis
+@item @kbd{@key{TAB}} (@code{org-cycle})
+@cindex cycling, in plain lists
+@kindex TAB
+@findex org-cycle
+@vindex org-cycle-include-plain-lists
+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 @code{org-cycle-include-plain-lists}. If this variable is set
+to @code{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 @kbd{@key{TAB}} demotes the item to
+become a child of the previous one. Subsequent @kbd{@key{TAB}}s move
+the item to meaningful levels in the list and eventually get it back
+to its initial position.
+
+@item @kbd{M-@key{RET}} (@code{org-insert-heading})
+@kindex M-RET
+@findex org-insert-heading
+@vindex org-M-RET-may-split-line
+Insert new item at current level. With a prefix argument, force
+a new heading (see @ref{Structure Editing}). If this command is used in
+the middle of an item, that item is @emph{split} in two, and the second
+part becomes the new item@footnote{If you do not want the item to be split, customize the
+variable @code{org-M-RET-may-split-line}.}. If this command is executed
+@emph{before item's body}, the new item is created @emph{before} the current
+one.
+
+@item @kbd{M-S-@key{RET}}
+@kindex M-S-RET
+Insert a new item with a checkbox (see @ref{Checkboxes}).
+
+@item @kbd{S-@key{UP}}
+@itemx @kbd{S-@key{DOWN}}
+@kindex S-UP
+@kindex S-DOWN
+@cindex shift-selection-mode
+@vindex org-support-shift-select
+@vindex org-list-use-circular-motion
+Jump to the previous/next item in the current list, but only if
+@code{org-support-shift-select} is off@footnote{If you want to cycle around items that way, you may customize
+@code{org-list-use-circular-motion}.}. If not, you can still use
+paragraph jumping commands like @kbd{C-@key{UP}} and
+@kbd{C-@key{DOWN}} to quite similar effect.
+
+@item @kbd{M-@key{UP}}
+@itemx @kbd{M-@key{DOWN}}
+@kindex M-UP
+@kindex M-DOWN
+Move the item including subitems up/down@footnote{See @code{org-list-use-circular-motion} for a cyclic behavior.}, i.e., swap with
+previous/next item of same indentation. If the list is ordered,
+renumbering is automatic.
+
+@item @kbd{M-@key{LEFT}}
+@itemx @kbd{M-@key{RIGHT}}
+@kindex M-LEFT
+@kindex M-RIGHT
+Decrease/increase the indentation of an item, leaving children
+alone.
+
+@item @kbd{M-S-@key{LEFT}}
+@itemx @kbd{M-S-@key{RIGHT}}
+@kindex M-S-LEFT
+@kindex M-S-RIGHT
+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 @code{org-list-automatic-rules}. The global indentation of
+a list has no influence on the text @emph{after} the list.
+
+@item @kbd{C-c C-c}
+@kindex C-c C-c
+If there is a checkbox (see @ref{Checkboxes}) in the item line, toggle
+the state of the checkbox. In any case, verify bullets and
+indentation consistency in the whole list.
+
+@item @kbd{C-c -}
+@kindex C-c -
+@vindex org-plain-list-ordered-item-terminator
+Cycle the entire list level through the different itemize/enumerate
+bullets (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}) or a subset of them, depending
+on @code{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 lines are converted to list items. With a prefix
+argument, the selected text is changed into a single item. 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.
+
+@item @kbd{C-c *}
+@kindex C-c *
+Turn a plain list item into a headline---so that it becomes
+a subheading at its location. See @ref{Structure Editing}, for
+a detailed explanation.
+
+@item @kbd{C-c C-*}
+@kindex C-c C-*
+Turn the whole plain list into a subtree of the current heading.
+Checkboxes (see @ref{Checkboxes}) become @samp{TODO}, respectively @samp{DONE},
+keywords when unchecked, respectively checked.
+
+@item @kbd{S-@key{LEFT}}
+@itemx @kbd{S-@key{RIGHT}}
+@vindex org-support-shift-select
+@kindex S-LEFT
+@kindex S-RIGHT
+This command also cycles bullet styles when point is in on the
+bullet or anywhere in an item line, details depending on
+@code{org-support-shift-select}.
+
+@item @kbd{C-c ^}
+@kindex C-c ^
+@cindex sorting, of plain list
+Sort the plain list. Prompt for the sorting method: numerically,
+alphabetically, by time, or by custom function.
+@end table
+
+@node Drawers
+@section Drawers
+
+@cindex drawers
+@cindex visibility cycling, 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 @emph{drawers}.
+They can contain anything but a headline and another drawer. Drawers
+look like this:
+
+@example
+** This is a headline
+Still outside the drawer
+:DRAWERNAME:
+This is inside the drawer.
+:END:
+After the drawer.
+@end example
+
+@kindex C-c C-x d
+@findex org-insert-drawer
+You can interactively insert a drawer at point by calling
+@code{org-insert-drawer}, which is bound to @kbd{C-c C-x d}. With an
+active region, this command puts the region inside the drawer. With
+a prefix argument, this command calls @code{org-insert-property-drawer},
+which creates a @samp{PROPERTIES} drawer right below the current headline.
+Org mode uses this special drawer for storing properties (see
+@ref{Properties and Columns}). You cannot use it for anything else.
+
+Completion over drawer keywords is also possible using
+@kbd{M-@key{TAB}}@footnote{Many desktops intercept @kbd{M-@key{TAB}} to switch windows.
+Use @kbd{C-M-i} or @kbd{@key{ESC} @key{TAB}} instead.}.
+
+Visibility cycling (see @ref{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 @kbd{@key{TAB}} there.
+
+You can also arrange for state change notes (see @ref{Tracking TODO state changes}) and clock times (see @ref{Clocking Work Time}) to be stored in
+a @samp{LOGBOOK} drawer. If you want to store a quick note there, in
+a similar way to state changes, use
+
+@table @asis
+@item @kbd{C-c C-z}
+@kindex C-c C-z
+Add a time-stamped note to the @samp{LOGBOOK} drawer.
+@end table
+
+@node Blocks
+@section Blocks
+
+@vindex org-hide-block-startup
+@cindex blocks, folding
+
+Org mode uses @samp{#+BEGIN} @dots{} @samp{#+END} blocks for various purposes from
+including source code examples (see @ref{Literal Examples}) to capturing
+time logging information (see @ref{Clocking Work Time}). These blocks can
+be folded and unfolded by pressing @kbd{@key{TAB}} in the @samp{#+BEGIN}
+line. You can also get all blocks folded at startup by configuring
+the variable @code{org-hide-block-startup} or on a per-file basis by using
+
+@cindex STARTUP, keyword
+@example
+#+STARTUP: hideblocks
+#+STARTUP: nohideblocks
+@end example
+
+@node Tables
+@chapter Tables
+
+@cindex tables
+@cindex editing tables
+
+Org comes with a fast and intuitive table editor. Spreadsheet-like
+calculations are supported using the Emacs Calc package (see @ref{Top,GNU Emacs
+Calculator Manual,,calc,}).
+
+@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.
+@end menu
+
+@node Built-in Table Editor
+@section Built-in Table Editor
+
+@cindex table editor, built-in
+
+@cindex header lines, in tables
+@cindex horizontal rule, in tables
+@cindex row separator, in tables
+@cindex table syntax
+Org makes it easy to format tables in plain ASCII@. Any line with @samp{|}
+as the first non-whitespace character is considered part of a table.
+@samp{|} is also the column separator@footnote{To insert a vertical bar into a table field, use @samp{\vert} or,
+inside a word @samp{abc\vert@{@}def}.}. Moreover, a line starting
+with @samp{|-} is a horizontal rule. It separates rows explicitly. Rows
+before the first horizontal rule are header lines. A table might look
+like this:
+
+@example
+| Name | Phone | Age |
+|-------+-------+-----|
+| Peter | 1234 | 17 |
+| Anna | 4321 | 25 |
+@end example
+
+A table is re-aligned automatically each time you press
+@kbd{@key{TAB}}, @kbd{@key{RET}} or @kbd{C-c C-c} inside the table.
+@kbd{@key{TAB}} also moves to the next field---@kbd{@key{RET}} 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
+
+@example
+|Name|Phone|Age|
+|-
+@end example
+
+@noindent
+and then press @kbd{@key{TAB}} to align the table and start filling in
+fields. Even faster would be to type @samp{|Name|Phone|Age} followed by
+@kbd{C-c @key{RET}}.
+
+When typing text into a field, Org treats @kbd{DEL},
+@kbd{Backspace}, and all character keys in a special way, so that
+inserting and deleting avoids shifting other fields. Also, when
+typing @emph{immediately} after point was moved into a new field with
+@kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}, the field is
+automatically made blank. If this behavior is too unpredictable for
+you, configure the option @code{org-table-auto-blank-field}.
+
+@anchor{Creation and conversion}
+@subheading Creation and conversion
+
+@table @asis
+@item @kbd{C-c |} (@code{org-table-create-or-convert-from-region})
+@kindex C-c |
+@findex org-table-create-or-convert-from-region
+Convert the active region to table. If every line contains at least
+one @kbd{@key{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: @kbd{C-u} forces CSV, @kbd{C-u C-u} forces
+@kbd{@key{TAB}}, @kbd{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 @kbd{@key{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 @kbd{| N a m e | P h o n e | A g e @key{RET} | - @key{TAB}}.
+@end table
+
+@anchor{Re-aligning and field motion}
+@subheading Re-aligning and field motion
+
+@table @asis
+@item @kbd{C-c C-c} (@code{org-table-align})
+@kindex C-c C-c
+@findex org-table-align
+Re-align the table without moving point.
+
+@item @kbd{@key{TAB}} (@code{org-table-next-field})
+@kindex TAB
+@findex org-table-next-field
+Re-align the table, move to the next field. Creates a new row if
+necessary.
+
+@item @kbd{M-x org-table-blank-field}
+@findex org-table-blank-field
+Blank the field at point.
+
+@item @kbd{S-@key{TAB}} (@code{org-table-previous-field})
+@kindex S-TAB
+@findex org-table-previous-field
+Re-align, move to previous field.
+
+@item @kbd{@key{RET}} (@code{org-table-next-row})
+@kindex RET
+@findex 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, @kbd{@key{RET}} still
+inserts a new line, so it can be used to split a table.
+
+@item @kbd{M-a} (@code{org-table-beginning-of-field})
+@kindex M-a
+@findex org-table-beginning-of-field
+Move to beginning of the current table field, or on to the previous
+field.
+
+@item @kbd{M-e} (@code{org-table-end-of-field})
+@kindex M-e
+@findex org-table-end-of-field
+Move to end of the current table field, or on to the next field.
+@end table
+
+@anchor{Column and row editing}
+@subheading Column and row editing
+
+@table @asis
+@item @kbd{M-@key{LEFT}} (@code{org-table-move-column-left})
+@kindex M-LEFT
+@findex org-table-move-column-left
+Move the current column left.
+
+@item @kbd{M-@key{RIGHT}} (@code{org-table-move-column-right})
+@kindex M-RIGHT
+@findex org-table-move-column-right
+Move the current column right.
+
+@item @kbd{M-S-@key{LEFT}} (@code{org-table-delete-column})
+@kindex M-S-LEFT
+@findex org-table-delete-column
+Kill the current column.
+
+@item @kbd{M-S-@key{RIGHT}} (@code{org-table-insert-column})
+@kindex M-S-RIGHT
+@findex org-table-insert-column
+Insert a new column at point position. Move the recent column and
+all cells to the right of this column to the right.
+
+@item @kbd{M-@key{UP}} (@code{org-table-move-row-up})
+@kindex M-UP
+@findex org-table-move-row-up
+Move the current row up.
+
+@item @kbd{M-@key{DOWN}} (@code{org-table-move-row-down})
+@kindex M-DOWN
+@findex org-table-move-row-down
+Move the current row down.
+
+@item @kbd{M-S-@key{UP}} (@code{org-table-kill-row})
+@kindex M-S-UP
+@findex org-table-kill-row
+Kill the current row or horizontal line.
+
+@item @kbd{S-@key{UP}} (@code{org-table-move-cell-up})
+@kindex S-UP
+@findex org-table-move-cell-up
+Move cell up by swapping with adjacent cell.
+
+@item @kbd{S-@key{DOWN}} (@code{org-table-move-cell-down})
+@kindex S-DOWN
+@findex org-table-move-cell-down
+Move cell down by swapping with adjacent cell.
+
+@item @kbd{S-@key{LEFT}} (@code{org-table-move-cell-left})
+@kindex S-LEFT
+@findex org-table-move-cell-left
+Move cell left by swapping with adjacent cell.
+
+@item @kbd{S-@key{RIGHT}} (@code{org-table-move-cell-right})
+@kindex S-RIGHT
+@findex org-table-move-cell-right
+Move cell right by swapping with adjacent cell.
+
+@item @kbd{M-S-@key{DOWN}} (@code{org-table-insert-row})
+@kindex M-S-DOWN
+@findex org-table-insert-row
+Insert a new row above the current row. With a prefix argument, the
+line is created below the current one.
+
+@item @kbd{C-c -} (@code{org-table-insert-hline})
+@kindex C-c -
+@findex org-table-insert-hline
+Insert a horizontal line below current row. With a prefix argument,
+the line is created above the current line.
+
+@item @kbd{C-c @key{RET}} (@code{org-table-hline-and-move})
+@kindex C-c RET
+@findex org-table-hline-and-move
+Insert a horizontal line below current row, and move point into the
+row below that line.
+
+@item @kbd{C-c ^} (@code{org-table-sort-lines})
+@kindex C-c ^
+@findex 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.
+@end table
+
+@anchor{Regions}
+@subheading Regions
+
+@table @asis
+@item @kbd{C-c C-x M-w} (@code{org-table-copy-region})
+@kindex C-c C-x M-w
+@findex 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.
+
+@item @kbd{C-c C-x C-w} (@code{org-table-cut-region})
+@kindex C-c C-x C-w
+@findex 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.
+
+@item @kbd{C-c C-x C-y} (@code{org-table-paste-rectangle})
+@kindex C-c C-x C-y
+@findex 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.
+
+@item @kbd{M-@key{RET}} (@code{org-table-wrap-region})
+@kindex M-RET
+@findex 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.
+@end table
+
+@anchor{Calculations}
+@subheading Calculations
+
+@cindex formula, in tables
+@cindex calculations, in tables
+
+@table @asis
+@item @kbd{C-c +} (@code{org-table-sum})
+@kindex C-c +
+@findex 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 @kbd{C-y}.
+
+@item @kbd{S-@key{RET}} (@code{org-table-copy-down})
+@kindex S-RET
+@findex org-table-copy-down
+@vindex org-table-copy-increment
+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 @code{org-table-copy-increment}, integer and
+time stamp field values, and fields prefixed or suffixed with
+a whole number, can be incremented during copy. Also, a @code{0} prefix
+argument temporarily disables the increment.
+
+This key is also used by shift-selection and related modes (see
+@ref{Conflicts}).
+@end table
+
+@anchor{Miscellaneous (1)}
+@subheading Miscellaneous
+
+@table @asis
+@item @kbd{C-c `} (@code{org-table-edit-field})
+@kindex C-c `
+@findex org-table-edit-field
+Edit the current field in a separate window. This is useful for
+fields that are not fully visible (see @ref{Column Width and Alignment}).
+When called with a @kbd{C-u} prefix, just make the full field
+visible, so that it can be edited in place. When called with two
+@kbd{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 @kbd{C-u C-u C-c `}.
+
+@item @kbd{M-x org-table-import}
+@findex 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.
+
+@item @kbd{C-c |} (@code{org-table-create-or-convert-from-region})
+@kindex C-c |
+@findex 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 @kbd{C-x C-x} and then
+using the @kbd{C-c |} command (see @ref{Creation and conversion}).
+
+@item @kbd{M-x org-table-export}
+@findex org-table-export
+@vindex org-table-export-default-format
+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
+@code{org-table-export-default-format}. You may also use properties
+@samp{TABLE_EXPORT_FILE} and @samp{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 @ref{Translator functions}, for a detailed description.
+
+@item @kbd{M-x org-table-header-line-mode}
+@findex org-table-header-line-mode
+@vindex org-table-header-line-p
+Turn on the display of the first data row of the table at point in
+the window header line when this first row is not visible anymore in
+the buffer. You can activate this minor mode by default by setting
+the option @code{org-table-header-line-p} to @code{t}.
+
+@item @kbd{M-x org-table-transpose-table-at-point}
+@findex org-table-transpose-table-at-point
+Transpose the table at point and eliminate hlines.
+@end table
+
+@node Column Width and Alignment
+@section Column Width and Alignment
+
+@cindex narrow columns in tables
+@cindex alignment in tables
+
+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.
+
+@vindex org-table-automatic-realign
+Editing a field may modify alignment of the table. Moving
+a contiguous row or column---i.e., using @kbd{@key{TAB}} or
+@kbd{@key{RET}}---automatically re-aligns it. If you want to disable
+this behavior, set @code{org-table-automatic-realign} to @code{nil}. In any
+case, you can always align manually a table:
+
+@table @asis
+@item @kbd{C-c C-c} (@code{org-table-align})
+@kindex C-c C-c
+@findex org-table-align
+Align the current table.
+@end table
+
+@vindex org-startup-align-all-tables
+Setting the option @code{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:
+
+@example
+#+STARTUP: align
+#+STARTUP: noalign
+@end example
+
+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.
+
+@example
+|---+---------------------+--------| |---+-------…+…|
+| | <6> | | | | <6> …|…|
+| 1 | one | some | ----\ | 1 | one …|…|
+| 2 | two | boring | ----/ | 2 | two …|…|
+| 3 | This is a long text | column | | 3 | This i…|…|
+|---+---------------------+--------| |---+-------…+…|
+@end example
+
+To set the width of a column, one field anywhere in the column may
+contain just the string @samp{<N>} where @var{N} specifies the width
+as a number of characters. You control displayed width of columns
+with the following tools:
+
+@table @asis
+@item @kbd{C-c @key{TAB}} (@code{org-table-toggle-column-width})
+@kindex C-c TAB
+@findex 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.
+
+@item @kbd{C-u C-c @key{TAB}} (@code{org-table-shrink})
+@kindex C-u C-c TAB
+@findex org-table-shrink
+Shrink all columns with a column width. Expand the others.
+
+@item @kbd{C-u C-u C-c @key{TAB}} (@code{org-table-expand})
+@kindex C-u C-u C-c TAB
+@findex org-table-expand
+Expand all columns.
+@end table
+
+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, @kbd{C-h .} (@code{display-local-help}) reveals them,
+too. For convenience, any change near the shrunk part of a column
+expands it.
+
+@vindex org-startup-shrink-all-tables
+Setting the option @code{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:
+
+@example
+#+STARTUP: shrink
+@end example
+
+
+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 @samp{<r>}, @samp{<c>} or @samp{<l>} in a similar fashion. You may also combine
+alignment and field width like this: @samp{<r10>}.
+
+Lines which only contain these formatting cookies are removed
+automatically upon exporting the document.
+
+@node Column Groups
+@section Column Groups
+
+@cindex grouping columns in tables
+
+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 @samp{/}. The further fields can either contain
+@samp{<} to indicate that this column should start a group, @samp{>} to indicate
+the end of a column, or @samp{<>} (no space between @samp{<} and @samp{>}) to make
+a column a group of its own. Upon export, boundaries between column
+groups are marked with vertical lines. Here is an example:
+
+@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)))
+@end example
+
+It is also sufficient to just insert the column group starters after
+every vertical line you would like to have:
+
+@example
+| N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
+|---+-----+-----+-----+---------+------------|
+| / | < | | | < | |
+@end example
+
+@node Orgtbl Mode
+@section The Orgtbl Minor Mode
+
+@cindex Orgtbl mode
+@cindex minor mode for tables
+
+@findex orgtbl-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 @kbd{M-x orgtbl-mode}. To turn it on by default, for
+example in Message mode, use
+
+@lisp
+(add-hook 'message-mode-hook #'turn-on-orgtbl)
+@end lisp
+
+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
+@ref{Tables in Arbitrary Syntax}.
+
+@node The Spreadsheet
+@section The Spreadsheet
+
+@cindex calculations, in tables
+@cindex spreadsheet capabilities
+@cindex Calc package
+
+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 @emph{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...
+@end menu
+
+@node References
+@subsection References
+
+@cindex 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 @kbd{C-c ?} in
+that field, or press @kbd{C-c @}} to toggle the display of a grid.
+
+@anchor{Field references}
+@subsubheading Field references
+
+@cindex field references
+@cindex references, to fields
+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 @samp{B3}, meaning the second field in the
+third row. However, Org prefers to use another, more general
+representation that looks like this:@footnote{Org understands references typed by the user as @samp{B4}, but it
+does not use this syntax when offering a formula for editing. You can
+customize this behavior using the variable
+@code{org-table-use-standard-references}.}
+
+@example
+@@ROW$COLUMN
+@end example
+
+
+Column specifications can be absolute like @samp{$1}, @samp{$2}, @dots{}, @samp{$N}, or
+relative to the current column, i.e., the column of the field which is
+being computed, like @samp{$+1} or @samp{$-2}. @samp{$<} and @samp{$>} are immutable
+references to the first and last column, respectively, and you can use
+@samp{$>>>} 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 @samp{@@1}, @samp{@@2}, @dots{}, @samp{@@N}, and row numbers relative to the
+current row like @samp{@@+3} or @samp{@@-1}. @samp{@@<} and @samp{@@>} are immutable
+references the first and last row in the table, respectively. You may
+also specify the row relative to one of the hlines: @samp{@@I} refers to the
+first hline, @samp{@@II} to the second, etc. @samp{@@-I} refers to the first such
+line above the current line, @samp{@@+I} to the first such line below the
+current line. You can also write @samp{@@III+2} which is the second data
+line after the third hline in the table.
+
+@samp{@@0} and @samp{$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 @emph{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 @emph{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:
+
+@multitable @columnfractions 0.2 0.8
+@item @samp{@@2$3}
+@tab 2nd row, 3rd column (same as @samp{C2})
+@item @samp{$5}
+@tab column 5 in the current row (same as @samp{E&})
+@item @samp{@@2}
+@tab current column, row 2
+@item @samp{@@-1$-3}
+@tab field one row up, three columns to the left
+@item @samp{@@-I$2}
+@tab field just under hline above current row, column 2
+@item @samp{@@>$5}
+@tab field in the last row, in column 5
+@end multitable
+
+@anchor{Range references}
+@subsubheading Range references
+
+@cindex range references
+@cindex references, to ranges
+You may reference a rectangular range of fields by specifying two
+field references connected by two dots @samp{..}. The ends are included in
+the range. If both fields are in the current row, you may simply use
+@samp{$2..$7}, but if at least one field is in a different row, you need to
+use the general @samp{@@ROW$COLUMN} format at least for the first field,
+i.e., the reference must start with @samp{@@} in order to be interpreted
+correctly. Examples:
+
+@multitable @columnfractions 0.2 0.8
+@item @samp{$1..$3}
+@tab first three fields in the current row
+@item @samp{$P..$Q}
+@tab range, using column names (see @ref{Advanced features})
+@item @samp{$<<<..$>>}
+@tab start in third column, continue to the last but one
+@item @samp{@@2$1..@@4$3}
+@tab nine fields between these two fields (same as @samp{A2..C4})
+@item @samp{@@-1$-2..@@-1}
+@tab 3 fields in the row above, starting from 2 columns on the left
+@item @samp{@@I..II}
+@tab between first and second hline, short for @samp{@@I..@@II}
+@end multitable
+
+@noindent
+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 @samp{E}, @samp{N} and examples, see @ref{Formula syntax for Calc}.
+
+@anchor{Field coordinates in formulas}
+@subsubheading Field coordinates in formulas
+
+@cindex field coordinates
+@cindex coordinates, of field
+@cindex row, of field coordinates
+@cindex column, of field coordinates
+@vindex org-table-current-column
+@vindex org-table-current-dline
+One of the very first actions during evaluation of Calc formulas and
+Lisp formulas is to substitute @samp{@@#} and @samp{$#} 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 @code{org-table-current-dline}
+and @code{org-table-current-column}. Examples:
+
+@table @asis
+@item @samp{if(@@# % 2, $#, string(""))}
+Insert column number on odd rows, set field to empty on even rows.
+
+@item @samp{$2 = '(identity remote(FOO, @@@@#$1))}
+Copy text or values of each row of column 1 of the table named
+@var{FOO} into column 2 of the current table.
+
+@item @samp{@@3 = 2 * remote(FOO, @@1$$#)}
+Insert the doubled value of each column of row 1 of the table
+named @var{FOO} into row 3 of the current table.
+@end table
+
+@noindent
+For the second and third examples, table @var{FOO} must have at
+least as many rows or columns as the current table. Note that this is
+inefficient@footnote{The computation time scales as O(N^2) because table
+@var{FOO} is parsed for each field to be copied.} for large number of rows.
+
+@anchor{Named references}
+@subsubheading Named references
+
+@cindex named references
+@cindex references, named
+@cindex name, of column or field
+@cindex constants, in calculations
+@cindex @samp{CONSTANTS}, keyword
+@vindex org-table-formula-constants
+
+@samp{$name} is interpreted as the name of a column, parameter or constant.
+Constants are defined globally through the variable
+@code{org-table-formula-constants}, and locally---for the file---through
+a line like this example:
+
+@example
+#+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
+@end example
+
+
+@vindex constants-unit-system
+@pindex constants.el
+Also, properties (see @ref{Properties and Columns}) can be used as
+constants in table formulas: for a property @samp{Xyz} use the name
+@samp{$PROP_Xyz}, and the property will be searched in the current outline
+entry and in the hierarchy above it. If you have the @samp{constants.el}
+package, it will also be used to resolve constants, including natural
+constants like @samp{$h} for Planck's constant, and units like @samp{$km} for
+kilometers@footnote{The file @samp{constants.el} can supply the values of constants in
+two different unit systems, @samp{SI} and @samp{cgs}. Which one is used depends
+on the value of the variable @code{constants-unit-system}. You can use the
+@samp{STARTUP} options @samp{constSI} and @samp{constcgs} to set this value for the
+current buffer.}. Column names and parameters can be specified in
+special table lines. These are described below, see @ref{Advanced features}. All names must start with a letter, and further consist
+of letters and numbers.
+
+@anchor{Remote references}
+@subsubheading Remote references
+
+@cindex remote references
+@cindex references, remote
+@cindex references, to a different table
+@cindex name, of column or field
+@cindex @samp{NAME}, keyword
+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
+
+@example
+remote(NAME,REF)
+@end example
+
+
+@noindent
+where @var{NAME} can be the name of a table in the current file
+as set by a @samp{#+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. @var{REF} is an absolute field or
+range reference as described above for example @samp{@@3$3} or @samp{$somename},
+valid in the referenced table.
+
+@cindex table indirection
+When @var{NAME} has the format @samp{@@ROW$COLUMN}, it is substituted
+with the name or ID found in this field of the current table. For
+example @samp{remote($1, @@@@>$2)} @result{} @samp{remote(year_2013, @@@@>$1)}. The format
+@samp{B3} is not supported because it can not be distinguished from a plain
+table name or ID@.
+
+@node Formula syntax for Calc
+@subsection Formula syntax for Calc
+
+@cindex formula syntax, Calc
+@cindex syntax, of formulas
+
+A formula can be any algebraic expression understood by the Emacs Calc
+package. Note that Calc has the non-standard convention that @samp{/} has
+lower precedence than @samp{*}, so that @samp{a/b*c} is interpreted as
+@samp{(a/(b*c))}. Before evaluation by @code{calc-eval} (see @ref{Calling Calc from Your Programs,Calling Calc from
+Your Lisp Programs,,calc,}), variable substitution takes place according to
+the rules described above.
+
+@cindex vectors, in table calculations
+The range vectors can be directly fed into the Calc vector functions
+like @code{vmean} and @code{vsum}.
+
+@cindex format specifier, in spreadsheet
+@cindex mode, for Calc
+@vindex org-calc-default-modes
+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 @samp{(float 8)} to keep
+tables compact. The default settings can be configured using the
+variable @code{org-calc-default-modes}.
+
+@table @asis
+@item @samp{p20}
+Set the internal Calc calculation precision to 20 digits.
+
+@item @samp{n3}, @samp{s3}, @samp{e2}, @samp{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.
+
+@item @samp{D}, @samp{R}
+Degree and radian angle modes of Calc.
+
+@item @samp{F}, @samp{S}
+Fraction and symbolic modes of Calc.
+
+@item @samp{u}
+Units simplification mode of Calc. Calc is also a symbolic
+calculator and is capable of working with values having a unit,
+represented with numerals followed by a unit string in Org table
+cells. This mode instructs Calc to simplify the units in the
+computed expression before returning the result.
+
+@item @samp{T}, @samp{t}, @samp{U}
+Duration computations in Calc or Lisp, @ref{Durations and time values}.
+
+@item @samp{E}
+If and how to consider empty fields. Without @samp{E} empty fields in
+range references are suppressed so that the Calc vector or Lisp list
+contains only the non-empty fields. With @samp{E} the empty fields are
+kept. For empty fields in ranges or empty field references the
+value @samp{nan} (not a number) is used in Calc formulas and the empty
+string is used for Lisp formulas. Add @samp{N} to use 0 instead for both
+formula types. For the value of a field the mode @samp{N} has higher
+precedence than @samp{E}.
+
+@item @samp{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 @samp{N}.
+
+@item @samp{L}
+Literal, for Lisp formulas only. See the next section.
+@end table
+
+Unless you use large integer numbers or high-precision calculation and
+display for floating point numbers you may alternatively provide
+a @code{printf} format specifier to reformat the Calc result after it has
+been passed back to Org instead of letting Calc already do the
+formatting@footnote{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.}. A few examples:
+
+@multitable {aaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{$1+$2}
+@tab Sum of first and second field
+@item @samp{$1+$2;%.2f}
+@tab Same, format result to two decimals
+@item @samp{exp($2)+exp($1)}
+@tab Math functions can be used
+@item @samp{$0;%.1f}
+@tab Reformat current cell to 1 decimal
+@item @samp{($3-32)*5/9}
+@tab Degrees F @arrow{} C conversion
+@item @samp{$c/$1/$cm}
+@tab Hz @arrow{} cm conversion, using @samp{constants.el}
+@item @samp{tan($1);Dp3s1}
+@tab Compute in degrees, precision 3, display SCI 1
+@item @samp{sin($1);Dp3%.1e}
+@tab Same, but use @code{printf} specifier for display
+@item @samp{vmean($2..$7)}
+@tab Compute column range mean, using vector function
+@item @samp{vmean($2..$7);EN}
+@tab Same, but treat empty fields as 0
+@item @samp{taylor($3,x=7,2)}
+@tab Taylor series of $3, at x=7, second degree
+@end multitable
+
+Calc also contains a complete set of logical operations (see @ref{Logical Operations,Logical
+Operations,,calc,}). For example
+
+@table @asis
+@item @samp{if($1 < 20, teen, string(""))}
+@samp{"teen"} if age @samp{$1} is less than 20, else the Org table result
+field is set to empty with the empty string.
+
+@item @samp{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. @samp{E} is
+required to not convert empty fields to 0. @samp{f-1} is an optional
+Calc format string similar to @samp{%.1f} but leaves empty results empty.
+
+@item @samp{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 @samp{nan} which lets @samp{vmean}
+result in @samp{nan}. Then @samp{typeof =} 12= detects the @samp{nan} from @code{vmean}
+and the Org table result field is set to empty. Use this when the
+sample set is expected to never have missing values.
+
+@item @samp{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.
+
+@item @samp{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.
+@end table
+
+You can add your own Calc functions defined in Emacs Lisp with
+@code{defmath} and use them in formula syntax for Calc.
+
+@node Formula syntax for Lisp
+@subsection Emacs Lisp forms as formulas
+
+@cindex Lisp forms, as table 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.
+
+A formula is evaluated as a Lisp form when it starts with a
+single-quote followed by an opening parenthesis. Cell table
+references are interpolated into the Lisp form before execution. The
+evaluation should return either a string or a number. Evaluation
+modes and a @code{printf} format used to render the returned values can be
+specified after a semicolon.
+
+By default, references are interpolated as literal Lisp strings: the
+field content is replaced in the Lisp form stripped of leading and
+trailing white space and surrounded in double-quotes. For example:
+
+@example
+'(concat $1 $2)
+@end example
+
+
+@noindent
+concatenates the content of columns 1 and column 2.
+
+When the @samp{N} flag is used, all referenced elements are parsed as
+numbers and interpolated as Lisp numbers, without quotes. Fields that
+cannot be parsed as numbers are interpolated as zeros. For example:
+
+@example
+'(+ $1 $2);N
+@end example
+
+
+@noindent
+adds columns 1 and 2, equivalent to Calc's @samp{$1+$2}. Ranges are
+inserted as space-separated fields, so they can be embedded in list or
+vector syntax. For example:
+
+@example
+'(apply '+ '($1..$4));N
+@end example
+
+
+@noindent
+computes the sum of columns 1 to 4, like Calc's @samp{vsum($1..$4)}.
+
+When the @samp{L} flag is used, all fields are interpolated literally: the
+cell content is replaced in the Lisp form stripped of leading and
+trailing white space and without quotes. If a reference is intended
+to be interpreted as a string by the Lisp form, the reference operator
+itself should be enclosed in double-quotes, like @samp{"$3"}. The @samp{L} flag
+is useful when strings and numbers are used in the same Lisp form. For
+example:
+
+@example
+'(substring "$1" $2 $3);L
+@end example
+
+
+@noindent
+extracts the part of the string in column 1 between the character
+positions specified in the integers in column 2 and 3 and it is easier
+to read than the equivalent:
+
+@example
+'(substring $1 (string-to-number $2) (string-to-number $3))
+@end example
+
+@node Durations and time values
+@subsection Durations and time values
+
+@cindex duration, computing
+@cindex time, computing
+@vindex org-table-duration-custom-format
+
+If you want to compute time values use the @samp{T}, @samp{t}, or @samp{U} flag,
+either in Calc formulas or Elisp formulas:
+
+@example
+| 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
+@end example
+
+Input duration values must be of the form @samp{HH:MM[:SS]}, where seconds
+are optional. With the @samp{T} flag, computed durations are displayed as
+@samp{HH:MM:SS} (see the first formula above). With the @samp{U} flag, seconds
+are omitted so that the result is only @samp{HH:MM} (see second formula
+above). Zero-padding of the hours field depends upon the value of the
+variable @code{org-table-duration-hour-zero-padding}.
+
+With the @samp{t} flag, computed durations are displayed according to the
+value of the option @code{org-table-duration-custom-format}, which defaults
+to @code{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.
+
+@node Field and range formulas
+@subsection Field and range formulas
+
+@cindex field formula
+@cindex range formula
+@cindex formula, for individual table field
+@cindex formula, for range of fields
+
+To assign a formula to a particular field, type it directly into the
+field, preceded by @samp{:=}, for example @samp{vsum(@@II..III)}. When you press
+@kbd{@key{TAB}} or @kbd{@key{RET}} or @kbd{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.
+
+@cindex @samp{TBLFM}, keyword
+Formulas are stored in a special @samp{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 @samp{@@3$4=$1+$2}.
+When inserting/deleting/swapping column and rows with the appropriate
+commands, @emph{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 @samp{@@<}, @samp{@@>}, @samp{$<}, @samp{$>}), or at
+hlines using the @samp{@@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
+
+@table @asis
+@item @kbd{C-u C-c =} (@code{org-table-eval-formula})
+@kindex C-u C-c =
+@findex org-table-eval-formula
+Install a new formula for the current field. The command prompts
+for a formula with default taken from the @samp{TBLFM} keyword,
+applies it to the current field, and stores it.
+@end table
+
+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 @ref{Editing and debugging formulas}) or edit
+the @samp{TBLFM} keyword directly.
+
+@table @asis
+@item @samp{$2=}
+Column formula, valid for the entire column. This is so common that
+Org treats these formulas in a special way, see @ref{Column formulas}.
+
+@item @samp{@@3=}
+Row formula, applies to all fields in the specified row. @samp{@@>=}
+means the last row.
+
+@item @samp{@@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.
+
+@item @samp{$NAME=}
+Named field, see @ref{Advanced features}.
+@end table
+
+@node Column formulas
+@subsection Column formulas
+
+@cindex column formula
+@cindex formula, for table column
+
+When you assign a formula to a simple column reference like @samp{$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 @emph{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 @samp{=$1+$2}. When you press
+@kbd{@key{TAB}} or @kbd{@key{RET}} or @kbd{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 @samp{=}, the previously stored formula
+for this column is used. For each column, Org only remembers the most
+recently used formula. In the @samp{TBLFM} keyword, column formulas look
+like @samp{$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 @samp{$>}.
+
+Instead of typing an equation into the field, you may also use the
+following command:
+
+@table @asis
+@item @kbd{C-c =} (@code{org-table-eval-formula})
+@kindex C-c =
+@findex 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 @samp{TBLFM} keyword, applies it
+to the current field and stores it. With a numeric prefix argument,
+e.g., @kbd{C-5 C-c =}, the command applies it to that many
+consecutive fields in the current column.
+@end table
+
+@node Lookup functions
+@subsection Lookup functions
+
+@cindex lookup functions in tables
+@cindex table lookup functions
+
+Org has three predefined Emacs Lisp functions for lookups in tables.
+
+@table @asis
+@item @samp{(org-lookup-first VAL S-LIST R-LIST &optional PREDICATE)}
+@findex org-lookup-first
+Searches for the first element @var{S} in list
+@var{S-LIST} for which
+@lisp
+(PREDICATE VAL S)
+@end lisp
+is non-@code{nil}; returns the value from the corresponding position in
+list @var{R-LIST}. The default @var{PREDICATE} is
+@code{equal}. Note that the parameters @var{VAL} and @var{S}
+are passed to @var{PREDICATE} in the same order as the
+corresponding parameters are in the call to @code{org-lookup-first},
+where @var{VAL} precedes @var{S-LIST}. If
+@var{R-LIST} is @code{nil}, the matching element @var{S} of
+@var{S-LIST} is returned.
+
+@item @samp{(org-lookup-last VAL S-LIST R-LIST &optional PREDICATE)}
+@findex org-lookup-last
+Similar to @code{org-lookup-first} above, but searches for the @emph{last}
+element for which @var{PREDICATE} is non-@code{nil}.
+
+@item @samp{(org-lookup-all VAL S-LIST R-LIST &optional PREDICATE)}
+@findex org-lookup-all
+Similar to @code{org-lookup-first}, but searches for @emph{all} elements for
+which @var{PREDICATE} is non-@code{nil}, and returns @emph{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.
+@end table
+
+If the ranges used in these functions contain empty fields, the @samp{E}
+mode for the formula should usually be specified: otherwise empty
+fields are not included in @var{S-LIST} and/or @var{R-LIST}
+which can, for example, result in an incorrect mapping from an element
+of @var{S-LIST} to the corresponding element of
+@var{R-LIST}.
+
+These three functions can be used to implement associative arrays,
+count matching cells, rank results, group data, etc. For practical
+examples see @uref{https://orgmode.org/worg/org-tutorials/org-lookups.html, this tutorial on Worg}.
+
+@node Editing and debugging formulas
+@subsection Editing and debugging formulas
+
+@cindex formula editing
+@cindex editing, of table formulas
+
+@vindex org-table-use-standard-references
+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 @samp{B3} or @samp{D&}) if possible. If
+you prefer to only work with the internal format (like @samp{@@3$2} or
+@samp{$4}), configure the variable @code{org-table-use-standard-references}.
+
+@table @asis
+@item @kbd{C-c =} or @kbd{C-u C-c =} (@code{org-table-eval-formula})
+@kindex C-c =
+@kindex C-u C-c =
+@findex org-table-eval-formula
+Edit the formula associated with the current column/field in the
+minibuffer. See @ref{Column formulas}, and @ref{Field and range formulas}.
+
+@item @kbd{C-u C-u C-c =} (@code{org-table-eval-formula})
+@kindex C-u C-u C-c =
+@findex 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 @kbd{C-c ?}.
+
+@item @kbd{C-c ?} (@code{org-table-field-info})
+@kindex C-c ?
+@findex 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.
+
+@item @kbd{C-c @}} (@code{org-table-toggle-coordinate-overlays})
+@kindex C-c @}
+@findex 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 @kbd{C-c C-c}.
+
+@item @kbd{C-c @{} (@code{org-table-toggle-formula-debugger})
+@kindex C-c @{
+@findex org-table-toggle-formula-debugger
+Toggle the formula debugger on and off. See below.
+
+@item @kbd{C-c '} (@code{org-table-edit-formulas})
+@kindex C-c '
+@findex 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:
+
+@table @asis
+@item @kbd{C-c C-c} or @kbd{C-x C-s} (@code{org-table-fedit-finish})
+@kindex C-x C-s
+@kindex C-c C-c
+@findex org-table-fedit-finish
+Exit the formula editor and store the modified formulas. With
+@kbd{C-u} prefix, also apply the new formulas to the
+entire table.
+
+@item @kbd{C-c C-q} (@code{org-table-fedit-abort})
+@kindex C-c C-q
+@findex org-table-fedit-abort
+Exit the formula editor without installing changes.
+
+@item @kbd{C-c C-r} (@code{org-table-fedit-toggle-ref-type})
+@kindex C-c C-r
+@findex org-table-fedit-toggle-ref-type
+Toggle all references in the formula editor between standard (like
+@samp{B3}) and internal (like @samp{@@3$2}).
+
+@item @kbd{@key{TAB}} (@code{org-table-fedit-lisp-indent})
+@kindex TAB
+@findex 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 @kbd{@key{TAB}} collapses the formula back
+again. In the open formula, @kbd{@key{TAB}} re-indents just like
+in Emacs Lisp mode.
+
+@item @kbd{M-@key{TAB}} (@code{lisp-complete-symbol})
+@kindex M-TAB
+@findex lisp-complete-symbol
+Complete Lisp symbols, just like in Emacs Lisp mode.
+
+@item @kbd{S-@key{UP}}, @kbd{S-@key{DOWN}}, @kbd{S-@key{LEFT}}, @kbd{S-@key{RIGHT}}
+@kindex S-UP
+@kindex S-DOWN
+@kindex S-LEFT
+@kindex S-RIGHT
+@findex org-table-fedit-ref-up
+@findex org-table-fedit-ref-down
+@findex org-table-fedit-ref-left
+@findex org-table-fedit-ref-right
+Shift the reference at point. For example, if the reference is
+@samp{B3} and you press @kbd{S-@key{RIGHT}}, it becomes @samp{C3}. This also
+works for relative references and for hline references.
+
+@item @kbd{M-S-@key{UP}} (@code{org-table-fedit-line-up})
+@kindex M-S-UP
+@findex org-table-fedit-line-up
+Move the test line for column formulas up in the Org buffer.
+
+@item @kbd{M-S-@key{DOWN}} (@code{org-table-fedit-line-down})
+@kindex M-S-DOWN
+@findex org-table-fedit-line-down
+Move the test line for column formulas down in the Org buffer.
+
+@item @kbd{M-@key{UP}} (@code{org-table-fedit-scroll-up})
+@kindex M-UP
+@findex org-table-fedit-scroll-up
+Scroll up the window displaying the table.
+
+@item @kbd{M-@key{DOWN}} (@code{org-table-fedit-scroll-down})
+@kindex M-DOWN
+@findex org-table-fedit-scroll-down
+Scroll down the window displaying the table.
+
+@item @kbd{C-c @}}
+@kindex C-c @}
+@findex org-table-toggle-coordinate-overlays
+Turn the coordinate grid in the table on and off.
+@end table
+@end table
+
+Making a table field blank does not remove the formula associated with
+the field, because that is stored in a different line---the @samp{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 @samp{TBLFM} keyword.
+
+@kindex C-c C-c
+You may edit the @samp{TBLFM} keyword directly and re-apply the changed
+equations with @kbd{C-c C-c} in that line or with the normal
+recalculation commands in the table.
+
+@anchor{Using multiple @samp{TBLFM} lines}
+@subsubheading Using multiple @samp{TBLFM} lines
+
+@cindex multiple formula lines
+@cindex @samp{TBLFM} keywords, multiple
+@cindex @samp{TBLFM}, switching
+
+@kindex C-c C-c
+You may apply the formula temporarily. This is useful when you want
+to switch the formula applied to the table. Place multiple @samp{TBLFM}
+keywords right after the table, and then press @kbd{C-c C-c} on
+the formula to apply. Here is an example:
+
+@example
+| x | y |
+|---+---|
+| 1 | |
+| 2 | |
+#+TBLFM: $2=$1*1
+#+TBLFM: $2=$1*2
+@end example
+
+@noindent
+Pressing @kbd{C-c C-c} in the line of @samp{#+TBLFM: $2=$1*2} yields:
+
+@example
+| x | y |
+|---+---|
+| 1 | 2 |
+| 2 | 4 |
+#+TBLFM: $2=$1*1
+#+TBLFM: $2=$1*2
+@end example
+
+@noindent
+If you recalculate this table, with @kbd{C-u C-c *}, for example,
+you get the following result from applying only the first @samp{TBLFM}
+keyword.
+
+@example
+| x | y |
+|---+---|
+| 1 | 1 |
+| 2 | 2 |
+#+TBLFM: $2=$1*1
+#+TBLFM: $2=$1*2
+@end example
+
+@anchor{Debugging formulas}
+@subsubheading Debugging formulas
+
+@cindex formula debugging
+@cindex debugging, of table formulas
+
+When the evaluation of a formula leads to an error, the field content
+becomes the string @samp{#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 @kbd{C-u C-u C-c = @key{RET}} in
+a field. Detailed information are displayed.
+
+@node Updating the table
+@subsection Updating the table
+
+@cindex recomputing table fields
+@cindex updating, 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 @ref{Advanced features}.
+
+In order to recalculate a line of a table or the entire table, use the
+following commands:
+
+@table @asis
+@item @kbd{C-c *} (@code{org-table-recalculate})
+@kindex C-c *
+@findex 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.
+
+@item @kbd{C-u C-c *} or @kbd{C-u C-c C-c}
+@kindex C-u C-c *
+@kindex 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.
+
+@item @kbd{C-u C-u C-c *} or @kbd{C-u C-u C-c C-c} (@code{org-table-iterate})
+@kindex C-u C-u C-c *
+@kindex C-u C-u C-c C-c
+@findex 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 @emph{later} in the calculation sequence.
+
+@item @kbd{M-x org-table-recalculate-buffer-tables}
+@findex org-table-recalculate-buffer-tables
+Recompute all tables in the current buffer.
+
+@item @kbd{M-x org-table-iterate-buffer-tables}
+@findex org-table-iterate-buffer-tables
+Iterate all tables in the current buffer, in order to converge
+table-to-table dependencies.
+@end table
+
+@node Advanced features
+@subsection Advanced features
+
+If you want the recalculation of fields to happen automatically, or if
+you want to be able to assign @emph{names}@footnote{Such names must start with an alphabetic character and use
+only alphanumeric/underscore characters.} to fields and columns,
+you need to reserve the first column of the table for special marking
+characters.
+
+@table @asis
+@item @kbd{C-#} (@code{org-table-rotate-recalc-marks})
+@kindex C-#
+@findex org-table-rotate-recalc-marks
+Rotate the calculation mark in first column through the states @samp{#},
+@samp{*}, @samp{!}, @samp{$}. When there is an active region, change all marks in
+the region.
+@end table
+
+Here is an example of a table that collects exam results of students
+and makes use of these features:
+
+@example
+|---+---------+--------+--------+--------+-------+------|
+| | 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
+@end example
+
+@quotation Important
+Please note that for these special tables, recalculating the table
+with @kbd{C-u C-c *} only affects rows that are marked @samp{#} or
+@samp{*}, and fields that have a formula assigned to the field itself. The
+column formulas are not applied in rows with empty first field.
+
+@end quotation
+
+@cindex marking characters, tables
+The marking characters have the following meaning:
+
+@table @asis
+@item @samp{!}
+The fields in this line define names for the columns, so that you
+may refer to a column as @samp{$Tot} instead of @samp{$6}.
+
+@item @samp{^}
+This row defines names for the fields @emph{above} the row. With such
+a definition, any formula in the table may use @samp{$m1} to refer to the
+value @samp{10}. Also, if you assign a formula to a names field, it is
+stored as @samp{$name = ...}.
+
+@item @samp{_}
+Similar to @samp{^}, but defines names for the fields in the row @emph{below}.
+
+@item @samp{$}
+Fields in this row can define @emph{parameters} for formulas. For
+example, if a field in a @samp{$} row contains @samp{max=50}, then formulas in
+this table can refer to the value 50 using @samp{$max}. Parameters work
+exactly like constants, only that they can be defined on a per-table
+basis.
+
+@item @samp{#}
+Fields in this row are automatically recalculated when pressing
+@kbd{@key{TAB}} or @kbd{@key{RET}} or @kbd{S-@key{TAB}} in this row.
+Also, this row is selected for a global recalculation with
+@kbd{C-u C-c *}. Unmarked lines are left alone by this
+command.
+
+@item @samp{*}
+Selects this line for global recalculation with @kbd{C-u C-c *}, but not for automatic recalculation. Use this when automatic
+recalculation slows down editing too much.
+
+@item @samp{/}
+Do not export this line. Useful for lines that contain the
+narrowing @samp{<N>} markers or column group markers.
+@end table
+
+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.
+
+@example
+|---+-------------+---+-----+--------------------------------------|
+| | 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
+@end example
+
+@node Org Plot
+@section Org Plot
+
+@cindex graph, in tables
+@cindex plot tables using Gnuplot
+
+Org Plot can produce graphs of information stored in Org tables,
+either graphically or in ASCII art.
+
+@anchor{Graphical plots using Gnuplot}
+@subheading Graphical plots using Gnuplot
+
+@cindex @samp{PLOT}, keyword
+Org Plot can produce 2D and 3D graphs of information stored in Org
+tables using @uref{https://www.gnuplot.info/, Gnuplot} and @uref{http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html, Gnuplot mode}. To see this in action, ensure
+that you have both Gnuplot and Gnuplot mode installed on your system,
+then call @kbd{C-c " g} or @kbd{M-x org-plot/gnuplot} on the
+following table.
+
+@example
+#+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 |
+@end example
+
+Org Plot supports a range of plot types, and provides the ability to add more.
+For example, a radar plot can be generated like so:
+@example
+#+PLOT: title:"An evaluation of plaintext document formats" transpose:yes type:radar min:0 max:4
+| Format | Fine-grained-control | Initial Effort | Syntax simplicity | Editor Support | Integrations | Ease-of-referencing | Versatility |
+|-------------------+----------------------+----------------+-------------------+----------------+--------------+---------------------+-------------|
+| Word | 2 | 4 | 4 | 2 | 3 | 2 | 2 |
+| LaTeX | 4 | 1 | 1 | 3 | 2 | 4 | 3 |
+| Org Mode | 4 | 2 | 3.5 | 1 | 4 | 4 | 4 |
+| Markdown | 1 | 3 | 3 | 4 | 3 | 3 | 1 |
+| Markdown + Pandoc | 2.5 | 2.5 | 2.5 | 3 | 3 | 3 | 2 |
+@end example
+
+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 @samp{PLOT} keyword
+preceding a table. See below for a complete list of Org Plot options.
+For more information and examples see the @uref{https://orgmode.org/worg/org-tutorials/org-plot.html, Org Plot tutorial}.
+
+@anchor{Plot options}
+@subsubheading Plot options
+
+@table @asis
+@item @samp{set}
+Specify any Gnuplot option to be set when graphing.
+
+@item @samp{title}
+Specify the title of the plot.
+
+@item @samp{ind}
+Specify which column of the table to use as the @samp{x} axis.
+
+@item @samp{deps}
+Specify the columns to graph as a Lisp style list, surrounded by
+parentheses and separated by spaces for example @samp{dep:(3 4)} to graph
+the third and fourth columns. Defaults to graphing all other
+columns aside from the @samp{ind} column.
+
+@item transpose
+When @samp{y}, @samp{yes}, or @samp{t} attempt to transpose the table data before
+plotting. Also recognises the shorthand option @samp{trans}.
+
+@item @samp{type}
+Specify the type of the plot, by default one of @samp{2d}, @samp{3d}, @samp{radar}, or @samp{grid}.
+Available types can be customised with @code{org-plot/preset-plot-types}.
+
+@item @samp{with}
+Specify a @samp{with} option to be inserted for every column being
+plotted, e.g., @samp{lines}, @samp{points}, @samp{boxes}, @samp{impulses}. Defaults to
+@samp{lines}.
+
+@item @samp{file}
+If you want to plot to a file, specify
+@samp{"path/to/desired/output-file"}.
+
+@item @samp{labels}
+List of labels to be used for the @samp{deps}. Defaults to the column
+headers if they exist.
+
+@item @samp{line}
+Specify an entire line to be inserted in the Gnuplot script.
+
+@item @samp{map}
+When plotting @samp{3d} or @samp{grid} types, set this to @samp{t} to graph a flat
+mapping rather than a @samp{3d} slope.
+
+@item min
+Provides a minimum axis value that may be used by a plot type.
+Implicitly assumes the @samp{y} axis is being referred to. Can
+explicitly provide a value for a either the @samp{x} or @samp{y} axis with
+@samp{xmin} and @samp{ymin}.
+
+@item max
+Provides a maximum axis value that may be used by a plot type.
+Implicitly assumes the @samp{y} axis is being referred to. Can
+explicitly provide a value for a either the @samp{x} or @samp{y} axis with
+@samp{xmax} and @samp{ymax}.
+
+@item ticks
+Provides a desired number of axis ticks to display, that may be used
+by a plot type. If none is given a plot type that requires ticks
+will use @code{org--plot/sensible-tick-num} to try to determine a good
+value.
+
+@item @samp{timefmt}
+Specify format of Org mode timestamps as they will be parsed by
+Gnuplot. Defaults to @samp{%Y-%m-%d-%H:%M:%S}.
+
+@item @samp{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 @samp{$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.
+@end table
+
+@anchor{ASCII bar plots}
+@subheading ASCII bar plots
+
+While point is on a column, typing @kbd{C-c `` a} or @kbd{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 @kbd{C-u C-c *}.
+
+@example
+| 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)
+@end example
+
+The formula is an Elisp call.
+
+@defun orgtbl-ascii-draw value min max &optional width
+Draw an ASCII bar in a table.
+
+@var{VALUE} is the value to plot.
+
+@var{MIN} is the value displayed as an empty bar. @var{MAX}
+is the value filling all the @var{WIDTH}. Sources values outside
+this range are displayed as @samp{too small} or @samp{too large}.
+
+@var{WIDTH} is the number of characters of the bar plot. It
+defaults to @samp{12}.
+@end defun
+
+@node Hyperlinks
+@chapter Hyperlinks
+
+@cindex 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.
+@end menu
+
+@node Link Format
+@section Link Format
+
+@cindex link format
+@cindex format, of links
+
+@cindex angle bracket links
+@cindex plain links
+Org recognizes plain URIs, possibly wrapped within angle
+brackets@footnote{Plain URIs are recognized only for a well-defined set of
+schemes. See @ref{External Links}. Unlike URI syntax, they cannot contain
+parenthesis or white spaces, either. URIs within angle brackets have
+no such limitation.}, and activate them as clickable links.
+
+@cindex bracket links
+The general link format, however, looks like this:
+
+@example
+[[LINK][DESCRIPTION]]
+@end example
+
+
+@noindent
+or alternatively
+
+@example
+[[LINK]]
+@end example
+
+
+@cindex escape syntax, for links
+@cindex backslashes, in links
+Some @samp{\}, @samp{[} and @samp{]} characters in the @var{LINK} part need to
+be ``escaped'', i.e., preceded by another @samp{\} character. More
+specifically, the following characters, and only them, must be
+escaped:
+
+@enumerate
+@item
+all @samp{[} and @samp{]} characters,
+@item
+every @samp{\} character preceding either @samp{]} or @samp{[},
+@item
+every @samp{\} character at the end of the link.
+@end enumerate
+
+@findex org-link-escape
+Functions inserting links (see @ref{Handling Links}) properly escape
+ambiguous characters. You only need to bother about the rules above
+when inserting directly, or yanking, a URI within square brackets.
+When in doubt, you may use the function @code{org-link-escape}, which turns
+a link string into its escaped form.
+
+Once a link in the buffer is complete, with all brackets present, Org
+changes the display so that @samp{DESCRIPTION} is displayed instead of
+@samp{[[LINK][DESCRIPTION]]} and @samp{LINK} is displayed instead of @samp{[[LINK]]}.
+Links are highlighted in the @code{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 @var{LINK} part, if there is no description, or the
+@var{DESCRIPTION} part otherwise. To also edit the invisible
+@var{LINK} part, use @kbd{C-c C-l} with point on the link
+(see @ref{Handling Links}).
+
+If you place point at the beginning or just behind the end of the
+displayed text and press @kbd{@key{BS}}, you remove
+the---invisible---bracket at that location@footnote{More accurately, the precise behavior depends on how point
+arrived there---see @ref{Invisible Text,Invisible Text,,elisp,}.}. 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 @arrow{} Hyperlinks @arrow{}
+Literal links.
+
+@node Internal Links
+@section Internal Links
+
+@cindex internal links
+@cindex links, internal
+
+A link that does not look like a URL---i.e., does not start with
+a known scheme or a file name---refers to the current document. You
+can follow it with @kbd{C-c C-o} when point is on the link, or
+with a mouse click (see @ref{Handling Links}).
+
+@cindex @samp{CUSTOM_ID}, property
+Org provides several refinements to internal navigation within
+a document. Most notably, a construct like @samp{[[#my-custom-id]]}
+specifically targets the entry with the @samp{CUSTOM_ID} property set to
+@samp{my-custom-id}. Also, an internal link looking like @samp{[[*Some
+section]]} points to a headline with the name @samp{Some section}@footnote{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 @kbd{M-@key{TAB}}. All headlines in the current
+buffer are offered as completions.}.
+
+@cindex targets, for links
+When the link does not belong to any of the cases above, Org looks for
+a @emph{dedicated target}: the same string in double angular brackets, like
+@samp{<<My Target>>}.
+
+@cindex @samp{NAME}, keyword
+If no dedicated target exists, the link tries to match the exact name
+of an element within the buffer. Naming is done, unsurprisingly, with
+the @samp{NAME} keyword, which has to be put in the line before the element
+it refers to, as in the following example
+
+@example
+#+NAME: My Target
+| a | table |
+|----+------------|
+| of | four cells |
+@end example
+
+@vindex org-link-search-must-match-exact-headline
+Ultimately, 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, or initiates a plain text search, according to the value of
+@code{org-link-search-must-match-exact-headline}.
+
+Note that you must make sure custom IDs, dedicated targets, and names
+are unique throughout the document. Org provides a linter to assist
+you in the process, if needed. See @ref{Org Syntax}.
+
+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@footnote{When targeting a @samp{NAME} keyword, the @samp{CAPTION} keyword is
+mandatory in order to get proper numbering (see @ref{Captions}).}. In the following excerpt from
+an Org buffer
+
+@example
+1. one item
+2. <<target>>another item
+Here we refer to item [[target]].
+@end example
+
+@noindent
+The last sentence will appear as @samp{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 @samp{target}.
+
+Following a link pushes a mark onto Org's own mark ring. You can
+return to the previous position with @kbd{C-c &}. Using this
+command several times in direct succession goes back to positions
+recorded earlier.
+
+@node Radio Targets
+@section Radio Targets
+
+@cindex radio targets
+@cindex targets, radio
+@cindex links, 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 @samp{<<<My
+Target>>>} causes each occurrence of @samp{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 @kbd{C-c C-c} with
+point on or at a target.
+
+@node External Links
+@section External Links
+
+@cindex links, external
+@cindex external links
+@cindex attachment links
+@cindex BBDB links
+@cindex Elisp links
+@cindex file links
+@cindex Gnus links
+@cindex Help links
+@cindex IRC links
+@cindex Info links
+@cindex MH-E links
+@cindex Rmail links
+@cindex shell links
+@cindex URL links
+@cindex Usenet 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.
+
+Here is the full set of built-in link types:
+
+@table @asis
+@item @samp{file}
+File links. File name may be remote, absolute, or relative.
+
+Additionally, you can specify a line number, or a text search.
+In Org files, you may link to a headline name, a custom ID, or a
+code reference instead.
+
+As a special case, ``file'' prefix may be omitted if the file name
+is complete, e.g., it starts with @samp{./}, or @samp{/}.
+
+@item @samp{attachment}
+Same as file links but for files and folders attached to the current
+node (see @ref{Attachments}). Attachment links are intended to behave
+exactly as file links but for files relative to the attachment
+directory.
+
+@item @samp{bbdb}
+Link to a BBDB record, with possible regexp completion.
+
+@item @samp{docview}
+Link to a document opened with DocView mode. You may specify a page
+number.
+
+@item @samp{doi}
+Link to an electronic resource, through its handle.
+
+@item @samp{elisp}
+Execute an Elisp command upon activation.
+
+@item @samp{gnus}, @samp{rmail}, @samp{mhe}
+Link to messages or folders from a given Emacs' MUA@.
+
+@item @samp{help}
+Display documentation of a symbol in @samp{*Help*} buffer.
+
+@item @samp{http}, @samp{https}
+Web links.
+
+@item @samp{id}
+Link to a specific headline by its ID property, in an Org file.
+
+@item @samp{info}
+Link to an Info manual, or to a specific node.
+
+@item @samp{irc}
+Link to an IRC channel.
+
+@item @samp{mailto}
+Link to message composition.
+
+@item @samp{news}
+Usenet links.
+
+@item @samp{shell}
+Execute a shell command upon activation.
+@end table
+
+The following table illustrates the link types above, along with their
+options:
+
+@multitable {aaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@headitem Link Type
+@tab Example
+@item http
+@tab @samp{http://staff.science.uva.nl/c.dominik/}
+@item https
+@tab @samp{https://orgmode.org/}
+@item doi
+@tab @samp{doi:10.1000/182}
+@item file
+@tab @samp{file:/home/dominik/images/jupiter.jpg}
+@item
+@tab @samp{/home/dominik/images/jupiter.jpg} (same as above)
+@item
+@tab @samp{file:papers/last.pdf}
+@item
+@tab @samp{./papers/last.pdf} (same as above)
+@item
+@tab @samp{file:/ssh:me@@some.where:papers/last.pdf} (remote)
+@item
+@tab @samp{/ssh:me@@some.where:papers/last.pdf} (same as above)
+@item
+@tab @samp{file:sometextfile::NNN} (jump to line number)
+@item
+@tab @samp{file:projects.org}
+@item
+@tab @samp{file:projects.org::some words} (text search)@footnote{The actual behavior of the search depends on the value of the
+variable @code{org-link-search-must-match-exact-headline}. If its value is
+@code{nil}, then a fuzzy text search is done. If it is @code{t}, then only the
+exact headline is matched, ignoring spaces and statistic cookies. If
+the value is @code{query-to-create}, then an exact headline is searched; if
+it is not found, then the user is queried to create it.}
+@item
+@tab @samp{file:projects.org::*task title} (headline search)
+@item
+@tab @samp{file:projects.org::#custom-id} (headline search)
+@item attachment
+@tab @samp{attachment:projects.org}
+@item
+@tab @samp{attachment:projects.org::some words} (text search)
+@item docview
+@tab @samp{docview:papers/last.pdf::NNN}
+@item id
+@tab @samp{id:B7423F4D-2E8A-471B-8810-C40F074717E9}
+@item news
+@tab @samp{news:comp.emacs}
+@item mailto
+@tab @samp{mailto:adent@@galaxy.net}
+@item mhe
+@tab @samp{mhe:folder} (folder link)
+@item
+@tab @samp{mhe:folder#id} (message link)
+@item rmail
+@tab @samp{rmail:folder} (folder link)
+@item
+@tab @samp{rmail:folder#id} (message link)
+@item gnus
+@tab @samp{gnus:group} (group link)
+@item
+@tab @samp{gnus:group#id} (article link)
+@item bbdb
+@tab @samp{bbdb:R.*Stallman} (record with regexp)
+@item irc
+@tab @samp{irc:/irc.com/#emacs/bob}
+@item help
+@tab @samp{help:org-store-link}
+@item info
+@tab @samp{info:org#External links}
+@item shell
+@tab @samp{shell:ls *.org}
+@item elisp
+@tab @samp{elisp:(find-file "Elisp.org")} (Elisp form to evaluate)
+@item
+@tab @samp{elisp:org-agenda} (interactive Elisp command)
+@end multitable
+
+@cindex VM links
+@cindex Wanderlust links
+On top of these built-in link types, additional ones are available
+through the @samp{org-contrib} repository (see @ref{Installation}). For
+example, these links to VM or Wanderlust messages are available when
+you load the corresponding libraries from the @samp{org-contrib}
+repository:
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{vm:folder}
+@tab VM folder link
+@item @samp{vm:folder#id}
+@tab VM message link
+@item @samp{vm://myself@@some.where.org/folder#id}
+@tab VM on remote machine
+@item @samp{vm-imap:account:folder}
+@tab VM IMAP folder link
+@item @samp{vm-imap:account:folder#id}
+@tab VM IMAP message link
+@item @samp{wl:folder}
+@tab Wanderlust folder link
+@item @samp{wl:folder#id}
+@tab Wanderlust message link
+@end multitable
+
+For information on customizing Org to add new link types, see @ref{Adding Hyperlink Types}.
+
+A link should be enclosed in double brackets and may contain
+descriptive text to be displayed instead of the URL (see @ref{Link Format}), for example:
+
+@example
+[[https://www.gnu.org/software/emacs/][GNU Emacs]]
+@end example
+
+
+If the description is a file name or URL that points to an image, HTML
+export (see @ref{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.
+
+@cindex square brackets, around links
+@cindex angular brackets, around links
+@cindex plain text external links
+Org also recognizes external links amid normal text and activates them
+as links. If spaces must be part of the link (for example in
+@samp{bbdb:R.*Stallman}), or if you need to remove ambiguities about the
+end of the link, enclose the link in square or angular brackets.
+
+@node Handling Links
+@section Handling Links
+
+@cindex links, handling
+
+Org provides methods to create a link in the correct syntax, to insert
+it into an Org file, and to follow the link.
+
+@findex org-store-link
+@cindex storing links
+The main function is @code{org-store-link}, called with @kbd{M-x org-store-link}. Because of its importance, we suggest to bind it
+to a widely available key (see @ref{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:
+
+@table @asis
+@item @emph{Org mode buffers}
+For Org files, if there is a @samp{<<target>>} at point, the link points
+to the target. Otherwise it points to the current headline, which
+is also the description@footnote{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.}.
+
+@vindex org-id-link-to-org-use-id
+@cindex @samp{CUSTOM_ID}, property
+@cindex @samp{ID}, property
+If the headline has a @samp{CUSTOM_ID} property, store a link to this
+custom ID@. In addition or alternatively, depending on the value of
+@code{org-id-link-to-org-use-id}, create and/or use a globally unique
+@samp{ID} property for the link@footnote{The Org Id library must first be loaded, either through
+@code{org-customize}, by enabling @code{id} in @code{org-modules}, or by adding
+@samp{(require 'org-id)} in your Emacs init file.}. 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. The @samp{ID} property can be either a
+UUID (default) or a timestamp, depending on @code{org-id-method}. Later,
+when inserting the link, you need to decide which one to use.
+
+@item @emph{Email/News clients: VM, Rmail, Wanderlust, MH-E, Gnus}
+@vindex org-link-email-description-format
+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
+@code{org-link-email-description-format}. By default, it refers to the
+addressee and the subject.
+
+@item @emph{Web browsers: W3, W3M and EWW}
+Here the link is the current URL, with the page title as the
+description.
+
+@item @emph{Contacts: BBDB}
+Links created in a BBDB buffer point to the current entry.
+
+@item @emph{Chat: IRC}
+@vindex org-irc-links-to-logs
+For IRC links, if the variable @code{org-irc-link-to-logs} is non-@code{nil},
+create a @samp{file} style link to the relevant point in the logs for the
+current conversation. Otherwise store an @samp{irc} style link to the
+user/channel/server under the point.
+
+@item @emph{Other files}
+For any other file, the link points to the file, with a search
+string (see @ref{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 @ref{Custom Searches}).
+
+You can also define dedicated links to other files. See @ref{Adding Hyperlink Types}.
+
+@item @emph{Agenda view}
+When point is in an agenda view, the created link points to the
+entry referenced by the current line.
+@end table
+
+From an Org buffer, the following commands create, navigate or, more
+generally, act on links.
+
+@table @asis
+@item @kbd{C-c C-l} (@code{org-insert-link})
+@kindex C-c C-l
+@findex org-insert-link
+@cindex link completion
+@cindex completion, of links
+@cindex inserting links
+@vindex org-link-keep-stored-after-insertion
+Insert a link@footnote{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.}. 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@footnote{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 @kbd{C-u} prefix argument to @kbd{C-c C-l}, or
+configure the option @code{org-link-keep-stored-after-insertion}.}. If some text was selected at this time,
+it becomes the default description.
+
+@table @asis
+@item @emph{Inserting stored links}
+All links stored during the current session are part of the
+history for this prompt, so you can access them with @kbd{@key{UP}}
+and @kbd{@key{DOWN}} (or @kbd{M-p}, @kbd{M-n}).
+
+@item @emph{Completion support}
+Completion with @kbd{@key{TAB}} helps you to insert valid link
+prefixes like @samp{http} or @samp{ftp}, including the prefixes defined
+through link abbreviations (see @ref{Link Abbreviations}). If you
+press @kbd{@key{RET}} after inserting only the prefix, Org offers
+specific completion support for some link types@footnote{This works if a function has been defined in the @code{:complete}
+property of a link in @code{org-link-parameters}.}. For
+example, if you type @kbd{f i l e @key{RET}}---alternative access:
+@kbd{C-u C-c C-l}, see below---Org offers file name
+completion, and after @kbd{b b d b @key{RET}} you can complete
+contact names.
+@end table
+
+@item @kbd{C-u C-c C-l}
+@cindex file name completion
+@cindex completion, of file names
+@kindex C-u C-c C-l
+When @kbd{C-c C-l} is called with a @kbd{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 @samp{../}.
+Otherwise an absolute path is used, if possible with @samp{~/} for your
+home directory. You can force an absolute path with two
+@kbd{C-u} prefixes.
+
+@item @kbd{C-c C-l} (with point on existing link)
+@cindex following links
+When point is on an existing link, @kbd{C-c C-l} allows you to
+edit the link and description parts of the link.
+
+@item @kbd{C-c C-o} (@code{org-open-at-point})
+@kindex C-c C-o
+@findex org-open-at-point
+@vindex org-file-apps
+Open link at point. This launches a web browser for URL (using
+@code{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 @ref{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 @samp{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 @code{org-file-apps}. If you want to override the
+default application and visit the file with Emacs, use
+a @kbd{C-u} prefix. If you want to avoid opening in Emacs, use
+a @kbd{C-u C-u} prefix.
+
+@vindex org-link-frame-setup
+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 @code{org-link-frame-setup}.
+
+@item @kbd{@key{RET}}
+@vindex org-return-follows-link
+@kindex RET
+When @code{org-return-follows-link} is set, @kbd{@key{RET}} also follows
+the link at point.
+
+@item @kbd{mouse-2} or @kbd{mouse-1}
+@kindex mouse-2
+@kindex mouse-1
+On links, @kbd{mouse-1} and @kbd{mouse-2} opens the link
+just as @kbd{C-c C-o} does.
+
+@item @kbd{mouse-3}
+@vindex org-link-use-indirect-buffer-for-internals
+@kindex mouse-3
+Like @kbd{mouse-2}, but force file links to be opened with
+Emacs, and internal links to be displayed in another window@footnote{See the variable @code{org-link-use-indirect-buffer-for-internals}.}.
+
+@item @kbd{C-c %} (@code{org-mark-ring-push})
+@kindex C-c %
+@findex org-mark-ring-push
+@cindex mark ring
+Push the current position onto the Org mark ring, to be able to
+return easily. Commands following an internal link do this
+automatically.
+
+@item @kbd{C-c &} (@code{org-mark-ring-goto})
+@kindex C-c &
+@findex org-mark-ring-goto
+@cindex links, returning to
+Jump back to a recorded position. A position is recorded by the
+commands following internal links, and by @kbd{C-c %}. Using
+this command several times in direct succession moves through a ring
+of previously recorded positions.
+
+@item @kbd{C-c C-x C-n} (@code{org-next-link})
+@itemx @kbd{C-c C-x C-p} (@code{org-previous-link})
+@kindex C-c C-x C-p
+@findex org-previous-link
+@kindex C-c C-x C-n
+@findex org-next-link
+@cindex links, finding next/previous
+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 @kbd{M-n} and @kbd{M-p}.
+
+@lisp
+(with-eval-after-load 'org
+ (define-key org-mode-map (kbd "M-n") #'org-next-link)
+ (define-key org-mode-map (kbd "M-p") #'org-previous-link))
+@end lisp
+@end table
+
+@node Using Links Outside Org
+@section Using Links Outside Org
+
+@findex org-insert-link-global
+@findex org-open-at-point-global
+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:
+@code{org-insert-link-global} and @code{org-open-at-point-global}.
+
+You might want to bind them to globally available keys. See
+@ref{Activation} for some advice.
+
+@node Link Abbreviations
+@section Link Abbreviations
+
+@cindex link abbreviations
+@cindex abbreviation, links
+
+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
+
+@example
+[[linkword:tag][description]]
+@end example
+
+
+@noindent
+@vindex org-link-abbrev-alist
+where the tag is optional. The @emph{linkword} must be a word, starting
+with a letter, followed by letters, numbers, @samp{-}, and @samp{_}.
+Abbreviations are resolved according to the information in the
+variable @code{org-link-abbrev-alist} that relates the linkwords to
+replacement text. Here is an example:
+
+@lisp
+(setq org-link-abbrev-alist
+ '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
+ ("Nu Html Checker" . "https://validator.w3.org/nu/?doc=%h")
+ ("duckduckgo" . "https://duckduckgo.com/?q=%s")
+ ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1")
+ ("ads" . "https://ui.adsabs.harvard.edu/search/q=%20author%3A\"%s\"")))
+@end lisp
+
+If the replacement text contains the string @samp{%s}, it is replaced with
+the tag. Using @samp{%h} instead of @samp{%s} percent-encodes the tag (see the
+example above, where we need to encode the URL parameter). Using
+@samp{%(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
+@samp{[[bugzilla:129]]}, search the web for @samp{OrgMode} with @samp{[[duckduckgo:OrgMode]]},
+show the map location of the Free Software Foundation @samp{[[gmap:51
+Franklin Street, Boston]]} or of Carsten office @samp{[[omap:Science Park 904,
+Amsterdam, The Netherlands]]} and find out what the Org author is doing
+besides Emacs hacking with @samp{[[ads:Dominik,C]]}.
+
+If you need special abbreviations just for a single Org buffer, you
+can define them in the file with
+
+@cindex @samp{LINK}, keyword
+@example
+#+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
+#+LINK: duckduckgo https://duckduckgo.com/?q=%s
+@end example
+
+In-buffer completion (see @ref{Completion}) can be used after @samp{[} to
+complete link abbreviations. You may also define a Lisp function that
+implements special (e.g., completion) support for inserting such a
+link with @kbd{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:
+
+@lisp
+(org-link-set-parameter "type" :complete #'some-completion-function)
+@end lisp
+
+@node Search Options
+@section Search Options in File Links
+
+@cindex search option in file links
+@cindex file links, searching
+@cindex attachment links, searching
+
+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@footnote{For backward compatibility, line numbers can also follow a
+single colon.}. For
+example, when the command @code{org-store-link} creates a link (see
+@ref{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 @kbd{C-c C-o}.
+
+Note that all search options apply for Attachment links in the same
+way that they apply for File links.
+
+Here is the syntax of the different ways to attach a search to a file
+link, together with explanations for each:
+
+@example
+[[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/]]
+[[attachment:main.c::255]]
+@end example
+
+@table @asis
+@item @samp{255}
+Jump to line 255.
+
+@item @samp{My Target}
+Search for a link target @samp{<<My Target>>}, or do a text search for
+@samp{my target}, similar to the search in internal links, see @ref{Internal Links}. In HTML export (see @ref{HTML Export}), such a file link becomes
+a HTML reference to the corresponding named anchor in the linked
+file.
+
+@item @samp{*My Target}
+In an Org file, restrict search to headlines.
+
+@item @samp{#my-custom-id}
+Link to a heading with a @samp{CUSTOM_ID} property
+
+@item @samp{/REGEXP/}
+Do a regular expression search for @var{REGEXP} (see @ref{Regular Expressions}). This uses the Emacs command @code{occur} to list all
+matches in a separate window. If the target file is in Org mode,
+@code{org-occur} is used to create a sparse tree with the matches.
+@end table
+
+As a degenerate case, a file link with an empty file name can be used
+to search the current file. For example, @samp{[[file:::find me]]} does
+a search for @samp{find me} in the current file, just as @samp{[[find me]]}
+would.
+
+@node Custom Searches
+@section Custom Searches
+
+@cindex custom search strings
+@cindex search strings, custom
+
+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, Bib@TeX{} database files have many entries like
+@code{year="1993"} which would not result in good search strings, because
+the only unique identification for a Bib@TeX{} entry is the citation key.
+
+@vindex org-create-file-search-functions
+@vindex org-execute-file-search-functions
+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 @code{add-hook}, these functions
+need to be added to the hook variables
+@code{org-create-file-search-functions} and
+@code{org-execute-file-search-functions}. See the docstring for these
+variables for more information. Org actually uses this mechanism for
+Bib@TeX{} database files, and you can use the corresponding code as an
+implementation example. See the file @samp{ol-bibtex.el}.
+
+@node TODO Items
+@chapter TODO Items
+
+@cindex TODO items
+
+Org mode does not maintain TODO lists as separate documents@footnote{Of course, you can make a document that contains only long
+lists of TODO items, but this is not required.}.
+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.
+@end menu
+
+@node TODO Basics
+@section Basic TODO Functionality
+
+Any headline becomes a TODO item when it starts with the word @samp{TODO},
+for example:
+
+@example
+*** TODO Write letter to Sam Fortune
+@end example
+
+
+The most important commands to work with TODO entries are:
+
+@table @asis
+@item @kbd{C-c C-t} (@code{org-todo})
+@kindex C-c C-t
+@cindex cycling, of TODO states
+Rotate the TODO state of the current item among
+
+@example
+,-> (unmarked) -> TODO -> DONE --.
+'--------------------------------'
+@end example
+
+If TODO keywords have fast access keys (see @ref{Fast access to TODO states}), prompt for a TODO keyword through the fast selection
+interface; this is the default behavior when
+@code{org-use-fast-todo-selection} is non-@code{nil}.
+
+The same state changing can also be done ``remotely'' from the agenda
+buffer with the @kbd{t} command key (see @ref{Agenda Commands}).
+
+@item @kbd{S-@key{RIGHT}} @kbd{S-@key{LEFT}}
+@kindex S-RIGHT
+@kindex S-LEFT
+@vindex org-treat-S-cursor-todo-selection-as-state-change
+Select the following/preceding TODO state, similar to cycling.
+Useful mostly if more than two TODO states are possible (see
+@ref{TODO Extensions}). See also @ref{Conflicts}, for a discussion of the interaction with
+shift-selection. See also the variable
+@code{org-treat-S-cursor-todo-selection-as-state-change}.
+
+@item @kbd{C-c / t} (@code{org-show-todo-tree})
+@kindex C-c / t
+@cindex sparse tree, for TODO
+@vindex org-todo-keywords
+@findex org-show-todo-tree
+View TODO items in a @emph{sparse tree} (see @ref{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 @kbd{C-c / T}, search for a specific TODO@. You are
+prompted for the keyword, and you can also give a list of keywords
+like @samp{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 @code{org-todo-keywords}. With two prefix
+arguments, find all TODO states, both un-done and done.
+
+@item @kbd{M-x org-agenda t} (@code{org-todo-list})
+@kindex t @r{(Agenda dispatcher)}
+Show the global TODO list. Collects the TODO items (with not-DONE
+states) from all agenda files (see @ref{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 @ref{Agenda Commands}). See @ref{Global TODO list}, for more information.
+
+@item @kbd{S-M-@key{RET}} (@code{org-insert-todo-heading})
+@kindex S-M-RET
+@findex org-insert-todo-heading
+Insert a new TODO entry below the current one.
+@end table
+
+@vindex org-todo-state-tags-triggers
+Changing a TODO state can also trigger tag changes. See the docstring
+of the option @code{org-todo-state-tags-triggers} for details.
+
+@node TODO Extensions
+@section Extended Use of TODO Keywords
+
+@cindex extended TODO keywords
+
+@vindex org-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 @emph{TODO keywords} (stored in @code{org-todo-keywords}). With special
+setup, the TODO keyword system can work differently in different
+files.
+
+Note that @emph{tags} are another way to classify headlines in general and
+TODO items in particular (see @ref{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.
+@end menu
+
+@node Workflow states
+@subsection TODO keywords as workflow states
+
+@cindex TODO workflow
+@cindex workflow states as TODO keywords
+
+You can use TODO keywords to indicate different, possibly @emph{sequential}
+states in the process of working on an item, for example@footnote{Changing the variable @code{org-todo-keywords} only becomes
+effective after restarting Org mode in a buffer.}:
+
+@lisp
+(setq org-todo-keywords
+ '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
+@end lisp
+
+The vertical bar separates the TODO keywords (states that @emph{need
+action}) from the DONE states (which need @emph{no further action}). If
+you do not provide the separator bar, the last state is used as the
+DONE state.
+
+@cindex completion, of TODO keywords
+With this setup, the command @kbd{C-c C-t} cycles an entry from
+@samp{TODO} to @samp{FEEDBACK}, then to @samp{VERIFY}, and finally to @samp{DONE} and
+@samp{DELEGATED}. You may also use a numeric prefix argument to quickly
+select a specific state. For example @kbd{C-3 C-c C-t} changes
+the state immediately to @samp{VERIFY}. Or you can use @kbd{S-@key{RIGHT}}
+and @kbd{S-@key{LEFT}} to go forward and backward through the states.
+If you define many keywords, you can use in-buffer completion (see
+@ref{Completion}) or a special one-key selection scheme (see @ref{Fast access to TODO states}) to insert these words into the buffer.
+Changing a TODO state can be logged with a timestamp, see @ref{Tracking TODO state changes}, for more information.
+
+@node TODO types
+@subsection TODO keywords as types
+
+@cindex TODO types
+@cindex names as TODO keywords
+@cindex types as TODO keywords
+
+The second possibility is to use TODO keywords to indicate different
+@emph{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 type of
+functionality is actually much better served by using tags (see
+@ref{Tags}), so the TODO implementation is kept just for backward
+compatibility.
+
+Using TODO types, it would be set up like this:
+
+@lisp
+(setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
+@end lisp
+
+In this case, different keywords do not indicate states, 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 @kbd{C-c C-t}@footnote{This is also true for the @kbd{t} command in the agenda
+buffer.}. 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
+@kbd{C-c C-t} again, it will switch from any name directly to
+@samp{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 @kbd{C-c / t}.
+For example, to see all things Lucy has to do, you would use
+@kbd{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: @kbd{C-3 M-x org-agenda t}.
+
+@node Multiple sets in one file
+@subsection Multiple keyword sets in one file
+
+@cindex TODO keyword sets
+
+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:
+
+@lisp
+(setq org-todo-keywords
+ '((sequence "TODO" "|" "DONE")
+ (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
+ (sequence "|" "CANCELED")))
+@end lisp
+
+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,
+@kbd{C-c C-t} only operates within a sub-sequence, so it switches
+from @samp{DONE} to (nothing) to @samp{TODO}, and from @samp{FIXED} to (nothing) to
+@samp{REPORT}. Therefore you need a mechanism to initially select the
+correct sequence. In addition to typing a keyword or using completion
+(see @ref{Completion}), you may also apply the following commands:
+
+@table @asis
+@item @kbd{C-u C-u C-c C-t}
+@itemx @kbd{C-S-@key{RIGHT}}
+@itemx @kbd{C-S-@key{LEFT}}
+@kindex C-S-RIGHT
+@kindex C-S-LEFT
+@kindex C-u C-u C-c C-t
+These keys jump from one TODO sub-sequence to the next. In the
+above example, @kbd{C-u C-u C-c C-t} or @kbd{C-S-@key{RIGHT}}
+would jump from @samp{TODO} or @samp{DONE} to @samp{REPORT}, and any of the words
+in the second row to @samp{CANCELED}. Note that the @kbd{C-S-} key
+binding conflict with shift-selection (see @ref{Conflicts}).
+
+@item @kbd{S-@key{RIGHT}}
+@itemx @kbd{S-@key{LEFT}}
+@kindex S-RIGHT
+@kindex S-LEFT
+@kbd{S-@key{LEFT}} and @kbd{S-@key{RIGHT}} walk through @emph{all} keywords
+from all sub-sequences, so for example @kbd{S-@key{RIGHT}} would
+switch from @samp{DONE} to @samp{REPORT} in the example above. For
+a discussion of the interaction with shift-selection, see @ref{Conflicts}.
+@end table
+
+@node Fast access to TODO states
+@subsection 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@footnote{All characters are allowed except @samp{@@}, @samp{^} and @samp{!}, which have
+a special meaning here.}. For
+example:
+
+@lisp
+(setq org-todo-keywords
+ '((sequence "TODO(t)" "|" "DONE(d)")
+ (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
+ (sequence "|" "CANCELED(c)")))
+@end lisp
+
+@vindex org-fast-tag-selection-include-todo
+If you then press @kbd{C-c C-t} followed by the selection key,
+the entry is switched to this state. @kbd{@key{SPC}} can be used to
+remove any TODO keyword from an entry@footnote{Check also the variable @code{org-fast-tag-selection-include-todo},
+it allows you to change the TODO state through the tags interface (see
+@ref{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.}.
+
+@node Per-file keywords
+@subsection Setting up keywords for individual files
+
+@cindex keyword options
+@cindex per-file keywords
+@cindex @samp{TODO}, keyword
+@cindex @samp{TYP_TODO}, keyword
+@cindex @samp{SEQ_TODO}, keyword
+
+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:
+
+@example
+#+TODO: TODO FEEDBACK VERIFY | DONE CANCELED
+@end example
+
+
+You may also write @samp{#+SEQ_TODO} to be explicit about the
+interpretation, but it means the same as @samp{#+TODO}, or
+
+@example
+#+TYP_TODO: Fred Sara Lucy Mike | DONE
+@end example
+
+
+A setup for using several sets in parallel would be:
+
+@example
+#+TODO: TODO(t) | DONE(d)
+#+TODO: REPORT(r) BUG(b) KNOWNCAUSE(k) | FIXED(f)
+#+TODO: | CANCELED(c)
+@end example
+
+@cindex completion, of option keywords
+@kindex M-TAB
+To make sure you are using the correct keyword, type @samp{#+} into the
+buffer and then use @kbd{M-@key{TAB}} to complete it (see @ref{Completion}).
+
+@cindex DONE, final TODO keyword
+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 @kbd{C-c C-c} with point still in the line to make the
+changes known to Org mode@footnote{Org mode parses these lines only when Org mode is activated
+after visiting a file. @kbd{C-c C-c} with point in a line
+starting with @samp{#+} is simply restarting Org mode for the current
+buffer.}.
+
+@node Faces for TODO keywords
+@subsection Faces for TODO keywords
+
+@cindex faces, for TODO keywords
+
+@vindex org-todo, face
+@vindex org-done, face
+@vindex org-todo-keyword-faces
+Org mode highlights TODO keywords with special faces: @code{org-todo} for
+keywords indicating that an item still has to be acted upon, and
+@code{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
+@code{org-todo-keyword-faces}. For example:
+
+@lisp
+(setq org-todo-keyword-faces
+ '(("TODO" . org-warning) ("STARTED" . "yellow")
+ ("CANCELED" . (:foreground "blue" :weight bold))))
+@end lisp
+
+@vindex org-faces-easy-properties
+While using a list with face properties as shown for @samp{CANCELED}
+@emph{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 @code{org-faces-easy-properties}
+determines if that color is interpreted as a foreground or
+a background color.
+
+@node TODO dependencies
+@subsection TODO dependencies
+
+@cindex TODO dependencies
+@cindex dependencies, of TODO states
+
+@vindex org-enforce-todo-dependencies
+@cindex @samp{ORDERED}, property
+The structure of Org files---hierarchy and lists---makes it easy to
+define TODO dependencies. Usually, a parent TODO task should not be
+marked as 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 as done. If you customize the variable
+@code{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 @samp{ORDERED}, each of its TODO
+children is blocked until all earlier siblings are marked as done.
+Here is an example:
+
+@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)
+@end example
+
+@cindex TODO dependencies, @samp{NOBLOCKING}
+@cindex @samp{NOBLOCKING}, property
+You can ensure an entry is never blocked by using the @samp{NOBLOCKING}
+property (see @ref{Properties and Columns}):
+
+@example
+* This entry is never blocked
+:PROPERTIES:
+:NOBLOCKING: t
+:END:
+@end example
+
+@table @asis
+@item @kbd{C-c C-x o} (@code{org-toggle-ordered-property})
+@kindex C-c C-x o
+@findex org-toggle-ordered-property
+@vindex org-track-ordered-property-with-tag
+Toggle the @samp{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 @ref{Tags}).
+However, if you would like to @emph{track} the value of this property
+with a tag for better visibility, customize the variable
+@code{org-track-ordered-property-with-tag}.
+
+@item @kbd{C-u C-u C-u C-c C-t}
+@kindex C-u C-u C-u C-u C-c C-t
+Change TODO state, regardless of any state blocking.
+@end table
+
+@vindex org-agenda-dim-blocked-tasks
+If you set the variable @code{org-agenda-dim-blocked-tasks}, TODO entries
+that cannot be marked as done because of unmarked children are shown
+in a dimmed font or even made invisible in agenda views (see @ref{Agenda Views}).
+
+@cindex checkboxes and TODO dependencies
+@vindex org-enforce-todo-dependencies
+You can also block changes of TODO states by using checkboxes (see
+@ref{Checkboxes}). If you set the variable
+@code{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 module @samp{org-depend.el} in the @samp{org-contrib} repository.
+
+@node Progress Logging
+@section Progress Logging
+
+@cindex progress logging
+@cindex logging, of progress
+
+To record a timestamp and a note when changing a TODO state, call the
+command @code{org-todo} with a prefix argument.
+
+@table @asis
+@item @kbd{C-u C-c C-t} (@code{org-todo})
+@kindex C-u C-c C-t
+Prompt for a note and record a the time of the TODO state change.
+The note is inserted as a list item below the headline, but can also
+be placed into a drawer, see @ref{Tracking TODO state changes}.
+@end table
+
+If you want to be more systematic, 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 @ref{Clocking Work Time}.
+
+@menu
+* Closing items:: When was this entry marked as done?
+* Tracking TODO state changes:: When did the status change?
+* Tracking your habits:: How consistent have you been?
+@end menu
+
+@node Closing items
+@subsection Closing items
+
+The most basic automatic logging is to keep track of @emph{when} a certain
+TODO item was marked as done. This can be achieved with@footnote{The corresponding in-buffer setting is: @samp{#+STARTUP: logdone}.}
+
+@lisp
+(setq org-log-done 'time)
+@end lisp
+
+@vindex org-closed-keep-when-no-todo
+@noindent
+Then each time you turn an entry from a TODO (not-done) state into any
+of the DONE states, a line @samp{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 @kbd{C-c C-t @key{SPC}} for example), that line is also removed, unless you set
+@code{org-closed-keep-when-no-todo} to non-@code{nil}. If you want to record
+a note along with the timestamp, use@footnote{The corresponding in-buffer setting is: @samp{#+STARTUP:
+lognotedone}.}
+
+@lisp
+(setq org-log-done 'note)
+@end lisp
+
+@noindent
+You are then prompted for a note, and that note is stored below the
+entry with a @samp{Closing Note} heading.
+
+@node Tracking TODO state changes
+@subsection Tracking TODO state changes
+
+@cindex drawer, for state change recording
+
+@vindex org-log-states-order-reversed
+@vindex org-log-into-drawer
+@cindex @samp{LOG_INTO_DRAWER}, property
+You might want to automatically 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@footnote{See the variable @code{org-log-states-order-reversed}.}.
+When taking a lot of notes, you might want to get the notes out of the
+way into a drawer (see @ref{Drawers}). Customize the variable
+@code{org-log-into-drawer} to get this behavior---the recommended drawer
+for this is called @samp{LOGBOOK}@footnote{Note that the @samp{LOGBOOK} drawer is unfolded when pressing
+@kbd{@key{SPC}} in the agenda to show an entry---use @kbd{C-u @key{SPC}} to keep it folded here.}. You can also overrule the
+setting of this variable for a subtree by setting a @samp{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 @samp{!} (for a timestamp) or @samp{@@} (for
+a note with timestamp) in parentheses after each keyword. For
+example, with the setting
+
+@lisp
+(setq org-todo-keywords
+ '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)")))
+@end lisp
+
+@vindex org-log-done
+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 @samp{DONE},
+and that a note is recorded when switching to @samp{WAIT} or
+@samp{CANCELED}@footnote{It is possible that Org mode records two timestamps when you
+are using both @code{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.}. The setting for @samp{WAIT} is even more special: the
+@samp{!} after the slash means that in addition to the note taken when
+entering the state, a timestamp should be recorded when @emph{leaving} the
+@samp{WAIT} state, if and only if the @emph{target} state does not configure
+logging for entering it. So it has no effect when switching from
+@samp{WAIT} to @samp{DONE}, because @samp{DONE} is configured to record a timestamp
+only. But when switching from @samp{WAIT} back to @samp{TODO}, the @samp{/!} in the
+@samp{WAIT} setting now triggers a timestamp even though @samp{TODO} has no
+logging configured.
+
+You can use the exact same syntax for setting logging preferences local
+to a buffer:
+
+@example
+#+TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
+@end example
+
+
+To record a timestamp without a note for TODO keywords configured with
+@samp{@@}, just type @kbd{C-c C-c} to enter a blank note when prompted.
+
+@cindex @samp{LOGGING}, property
+In order to define logging settings that are local to a subtree or
+a single item, define a @samp{LOGGING} property in this entry. Any
+non-empty @samp{LOGGING} property resets all logging settings to @code{nil}.
+You may then turn on logging for this specific tree using @samp{STARTUP}
+keywords like @samp{lognotedone} or @samp{logrepeat}, as well as adding state
+specific settings like @samp{TODO(!)}. For example:
+
+@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:
+@end example
+
+@node Tracking your habits
+@subsection Tracking your habits
+
+@cindex habits
+@cindex @samp{STYLE}, property
+
+Org has the ability to track the consistency of a special category of
+TODO, called ``habits.'' To use habits, you have to enable the @code{habits}
+module by customizing the variable @code{org-modules}.
+
+A habit has the following properties:
+
+@enumerate
+@item
+The habit is a TODO item, with a TODO keyword representing an open
+state.
+
+@item
+The property @samp{STYLE} is set to the value @samp{habit} (see @ref{Properties and Columns}).
+
+@item
+The TODO has a scheduled date, usually with a @samp{.+} style repeat
+interval. A @samp{++} style may be appropriate for habits with time
+constraints, e.g., must be done on weekends, or a @samp{+} style for an
+unusual habit that can have a backlog, e.g., weekly reports.
+
+@item
+The TODO may also have minimum and maximum ranges specified by
+using the syntax @samp{.+2d/3d}, which says that you want to do the task
+at least every three days, but at most every two days.
+
+@item
+State logging for the DONE state is enabled (see @ref{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.
+@end enumerate
+
+To give you an idea of what the above rules look like in action, here's an
+actual habit with some history:
+
+@example
+** 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]
+@end example
+
+What this habit says is: I want to shave at most every 2 days---given
+by the @samp{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 @ref{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:
+
+@table @asis
+@item Blue
+If the task was not to be done yet on that day.
+@item Green
+If the task could have been done on that day.
+@item Yellow
+If the task was going to be overdue the next day.
+@item Red
+If the task was overdue on that day.
+@end table
+
+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.
+
+@table @asis
+@item @code{org-habit-graph-column}
+@vindex 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.
+
+@item @code{org-habit-preceding-days}
+@vindex org-habit-preceding-days
+The amount of history, in days before today, to appear in
+consistency graphs.
+
+@item @code{org-habit-following-days}
+@vindex org-habit-following-days
+The number of days after today that appear in consistency graphs.
+
+@item @code{org-habit-show-habits-only-for-today}
+@vindex org-habit-show-habits-only-for-today
+If non-@code{nil}, only show habits in today's agenda view. The default
+value is @code{t}. Pressing @kbd{C-u K} in the agenda toggles this
+variable.
+@end table
+
+Lastly, pressing @kbd{K} in the agenda buffer causes habits to
+temporarily be disabled and do not appear at all. Press @kbd{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.
+
+@node Priorities
+@section Priorities
+
+@cindex priorities
+@cindex priority cookie
+
+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 @emph{priority cookie} into the headline of a TODO item
+right after the TODO keyword, like this:
+
+@example
+*** TODO [#A] Write letter to Sam Fortune
+@end example
+
+
+@vindex org-priority-faces
+By default, Org mode supports three priorities: @samp{A}, @samp{B}, and @samp{C}.
+@samp{A} is the highest priority. An entry without a cookie is treated as
+equivalent if it had priority @samp{B}. Priorities make a difference only
+for sorting in the agenda (see @ref{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 @code{org-priority-faces},
+which can be customized.
+
+You can also use numeric values for priorities, such as
+
+@example
+*** TODO [#1] Write letter to Sam Fortune
+@end example
+
+
+When using numeric priorities, you need to set @code{org-priority-highest},
+@code{org-priority-lowest} and @code{org-priority-default} to integers, which
+must all be strictly inferior to 65.
+
+Priorities can be attached to any outline node; they do not need to be
+TODO items.
+
+@table @asis
+@item @kbd{C-c ,} (@code{org-priority})
+@kindex C-c ,
+@findex org-priority
+Set the priority of the current headline. The command prompts for
+a priority character @samp{A}, @samp{B} or @samp{C}. When you press @kbd{@key{SPC}}
+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 @kbd{,} command (see @ref{Agenda Commands}).
+
+@item @kbd{S-@key{UP}} (@code{org-priority-up})
+@itemx @kbd{S-@key{DOWN}} (@code{org-priority-down})
+@kindex S-UP
+@kindex S-DOWN
+@findex org-priority-up
+@findex org-priority-down
+@vindex org-priority-start-cycle-with-default
+Increase/decrease the priority of the current headline@footnote{See also the option @code{org-priority-start-cycle-with-default}.}. Note
+that these keys are also used to modify timestamps (see @ref{Creating Timestamps}). See also @ref{Conflicts}, for
+a discussion of the interaction with shift-selection.
+@end table
+
+@vindex org-priority-highest
+@vindex org-priority-lowest
+@vindex org-priority-default
+You can change the range of allowed priorities by setting the
+variables @code{org-priority-highest}, @code{org-priority-lowest}, and
+@code{org-priority-default}. 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):
+
+@cindex @samp{PRIORITIES}, keyword
+@example
+#+PRIORITIES: A C B
+@end example
+
+
+Or, using numeric values:
+
+@example
+#+PRIORITIES: 1 10 5
+@end example
+
+@node Breaking Down Tasks
+@section Breaking Down Tasks into Subtasks
+
+@cindex tasks, breaking down
+@cindex statistics, for TODO items
+
+@vindex org-agenda-todo-list-sublevels
+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@footnote{To keep subtasks out of the global TODO list, see the option
+@code{org-agenda-todo-list-sublevels}.}. To keep
+an overview of the fraction of subtasks that have already been marked
+as done, insert either @samp{[/]} or @samp{[%]} anywhere in the headline. These
+cookies are updated each time the TODO status of a child changes, or
+when pressing @kbd{C-c C-c} on the cookie. For example:
+
+@example
+* Organize Party [33%]
+** TODO Call people [1/2]
+*** TODO Peter
+*** DONE Sarah
+** TODO Buy food
+** DONE Talk to neighbor
+@end example
+
+@cindex @samp{COOKIE_DATA}, property
+If a heading has both checkboxes and TODO children below it, the
+meaning of the statistics cookie become ambiguous. Set the property
+@samp{COOKIE_DATA} to either @samp{checkbox} or @samp{todo} to resolve this issue.
+
+@vindex org-hierarchical-todo-statistics
+If you would like to have the statistics cookie count any TODO entries
+in the subtree (not just direct children), configure the variable
+@code{org-hierarchical-todo-statistics}. To do this for a single subtree,
+include the word @samp{recursive} into the value of the @samp{COOKIE_DATA}
+property.
+
+@example
+* Parent capturing statistics [2/20]
+ :PROPERTIES:
+ :COOKIE_DATA: todo recursive
+ :END:
+@end example
+
+If you would like a TODO entry to automatically change to DONE when
+all children are done, you can use the following setup:
+
+@lisp
+(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)
+@end lisp
+
+Another possibility is the use of checkboxes to identify (a hierarchy
+of) a large number of subtasks (see @ref{Checkboxes}).
+
+@node Checkboxes
+@section Checkboxes
+
+@cindex checkboxes
+
+@vindex org-list-automatic-rules
+Every item in a plain list@footnote{With the exception of description lists. But you can allow it
+by modifying @code{org-list-automatic-rules} accordingly.} (see @ref{Plain Lists}) can be made into
+a checkbox by starting it with the string @samp{[ ]}. This feature is
+similar to TODO items (see @ref{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.
+
+Here is an example of a checkbox list.
+
+@example
+* 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
+@end example
+
+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.
+
+@cindex statistics, for checkboxes
+@cindex checkbox statistics
+@cindex @samp{COOKIE_DATA}, property
+@vindex org-hierarchical-checkbox-statistics
+The @samp{[2/4]} and @samp{[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@footnote{Set the variable @code{org-hierarchical-checkbox-statistics} if you
+want such cookies to count all checkboxes below the cookie, not just
+those belonging to direct children.}. You have to insert the cookie yourself by typing
+either @samp{[/]} or @samp{[%]}. With @samp{[/]} you get an @samp{n out of m} result, as
+in the examples above. With @samp{[%]} you get information about the
+percentage of checkboxes checked (in the above example, this would be
+@samp{[50%]} and @samp{[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 @samp{COOKIE_DATA} to
+either @samp{checkbox} or @samp{todo} to resolve this issue.
+
+@cindex blocking, of checkboxes
+@cindex checkbox blocking
+@cindex @samp{ORDERED}, property
+If the current outline node has an @samp{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:
+
+@table @asis
+@item @kbd{C-c C-c} (@code{org-toggle-checkbox})
+@kindex C-c C-c
+@findex 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@footnote{@kbd{C-u C-c C-c} on the @emph{first} item of a list with no
+checkbox adds checkboxes to the rest of the list.}. With a double prefix argument, set
+it to @samp{[-]}, which is considered to be an intermediate state.
+
+@item @kbd{C-c C-x C-b} (@code{org-toggle-checkbox})
+@kindex C-c C-x C-b
+Toggle checkbox status or---with prefix argument---checkbox presence
+at point. With double prefix argument, set it to @samp{[-]}, which is
+considered to be an intermediate state.
+
+@itemize
+@item
+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.
+
+@item
+If point is in a headline, toggle checkboxes in the region between
+this headline and the next---so @emph{not} the entire subtree.
+
+@item
+If there is no active region, just toggle the checkbox at point.
+@end itemize
+
+@item @kbd{C-c C-x C-r} (@code{org-toggle-radio-button})
+@kindex C-c C-x C-r
+@findex org-toggle-radio-button
+@cindex radio button, checkbox as
+Toggle checkbox status by using the checkbox of the item at point as
+a radio button: when the checkbox is turned on, all other checkboxes
+on the same level will be turned off. With a universal prefix
+argument, toggle the presence of the checkbox. With a double prefix
+argument, set it to @samp{[-]}.
+
+@findex org-list-checkbox-radio-mode
+@kbd{C-c C-c} can be told to consider checkboxes as radio buttons by
+setting @samp{#+ATTR_ORG: :radio t} right before the list or by calling
+@kbd{M-x org-list-checkbox-radio-mode} to activate this minor mode.
+
+@item @kbd{M-S-@key{RET}} (@code{org-insert-todo-heading})
+@kindex M-S-RET
+@findex org-insert-todo-heading
+Insert a new item with a checkbox. This works only if point is
+already in a plain list item (see @ref{Plain Lists}).
+
+@item @kbd{C-c C-x o} (@code{org-toggle-ordered-property})
+@kindex C-c C-x o
+@findex org-toggle-ordered-property
+@vindex org-track-ordered-property-with-tag
+Toggle the @samp{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 @emph{track} the
+value of this property with a tag for better visibility, customize
+@code{org-track-ordered-property-with-tag}.
+
+@item @kbd{C-c #} (@code{org-update-statistics-cookies})
+@kindex C-c #
+@findex org-update-statistics-cookies
+Update the statistics cookie in the current outline entry. When
+called with a @kbd{C-u} prefix, update the entire file.
+Checkbox statistic cookies are updated automatically if you toggle
+checkboxes with @kbd{C-c C-c} and make new ones with
+@kbd{M-S-@key{RET}}. 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.
+@end table
+
+@node Tags
+@chapter Tags
+
+@cindex tags
+@cindex headline tagging
+@cindex matching, tags
+@cindex sparse tree, tag based
+
+An excellent way to implement labels and contexts for
+cross-correlating information is to assign @emph{tags} to headlines. Org
+mode has extensive support for tags.
+
+@vindex org-tag-faces
+Every headline can contain a list of tags; they occur at the end of
+the headline. Tags are normal words containing letters, numbers, @samp{_},
+and @samp{@@}. Tags must be preceded and followed by a single colon, e.g.,
+@samp{:work:}. Several tags can be specified, as in @samp{: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
+@code{org-tag-faces}, in much the same way as you can for TODO keywords
+(see @ref{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.
+@end menu
+
+@node Tag Inheritance
+@section Tag Inheritance
+
+@cindex tag inheritance
+@cindex inheritance, of tags
+@cindex sublevels, inclusion into tags match
+
+@emph{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
+
+@example
+* Meeting with the French group :work:
+** Summary by Frank :boss:notes:
+*** TODO Prepare slides for him :action:
+@end example
+
+@noindent
+the final heading has the tags @samp{work}, @samp{boss}, @samp{notes}, and @samp{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@footnote{As with all these in-buffer settings, pressing @kbd{C-c C-c} activates any changes in the line.}
+
+@cindex @samp{FILETAGS}, keyword
+@example
+#+FILETAGS: :Peter:Boss:Secret:
+@end example
+
+
+@vindex org-use-tag-inheritance
+@vindex org-tags-exclude-from-inheritance
+To limit tag inheritance to specific tags, or to turn it off entirely,
+use the variables @code{org-use-tag-inheritance} and
+@code{org-tags-exclude-from-inheritance}.
+
+@vindex org-tags-match-list-sublevels
+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@footnote{This is only true if the search does not involve more complex
+tests including properties (see @ref{Property Searches}).}. 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 @code{org-tags-match-list-sublevels} (not
+recommended).
+
+@vindex org-agenda-use-tag-inheritance
+Tag inheritance is relevant when the agenda search tries to match
+a tag, either in the @code{tags} or @code{tags-todo} agenda types. In other
+agenda types, @code{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
+@code{org-agenda-use-tag-inheritance} to control this: the default value
+includes all agenda types, but setting this to @code{nil} can really speed
+up agenda generation.
+
+@node Setting Tags
+@section Setting Tags
+
+@cindex setting tags
+@cindex tags, setting
+
+@kindex M-TAB
+Tags can simply be typed into the buffer at the end of a headline.
+After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
+also a special command for inserting tags:
+
+@table @asis
+@item @kbd{C-c C-q} (@code{org-set-tags-command})
+@kindex C-c C-q
+@findex org-set-tags-command
+@cindex completion, of tags
+@vindex org-tags-column
+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 @kbd{@key{RET}}, the tags are inserted and
+aligned to @code{org-tags-column}. When called with a @kbd{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 @ref{TODO Basics}).
+
+@item @kbd{C-c C-c} (@code{org-set-tags-command})
+@kindex C-c C-c
+When point is in a headline, this does the same as @kbd{C-c C-q}.
+@end table
+
+@vindex org-complete-tags-always-offer-all-agenda-tags
+@vindex org-tag-alist
+@cindex @samp{TAGS}, keyword
+Org supports tag insertion based on a @emph{list of tags}. By default this
+list is constructed dynamically, containing all tags currently used in
+the buffer@footnote{To extend this default list to all tags used in all agenda
+files (see @ref{Agenda Views}), customize the variable
+@code{org-complete-tags-always-offer-all-agenda-tags}.}. You may also globally specify a hard list of tags
+with the variable @code{org-tag-alist}. Finally you can set the default
+tags for a given file using the @samp{TAGS} keyword, like
+
+@example
+#+TAGS: @@work @@home @@tennisclub
+#+TAGS: laptop car pc sailboat
+@end example
+
+If you have globally defined your preferred set of tags using the
+variable @code{org-tag-alist}, but would like to use a dynamic tag list in
+a specific file, add an empty @samp{TAGS} keyword to that file:
+
+@example
+#+TAGS:
+@end example
+
+
+@vindex org-tag-persistent-alist
+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 @samp{TAGS}
+keyword, then you may specify a list of tags with the variable
+@code{org-tag-persistent-alist}. You may turn this off on a per-file basis
+by adding a @samp{STARTUP} keyword to that file:
+
+@example
+#+STARTUP: noptag
+@end example
+
+
+By default Org mode uses the standard minibuffer completion facilities
+for entering tags. However, it also implements another, quicker, tag
+selection method called @emph{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
+@code{org-tag-alist} in your Emacs init file. For example, you may find
+the need to tag many items in different files with @samp{@@home}. In this
+case you can set something like:
+
+@lisp
+(setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
+@end lisp
+
+If the tag is only relevant to the file you are working on, then you
+can instead set the @samp{TAGS} keyword as:
+
+@example
+#+TAGS: @@work(w) @@home(h) @@tennisclub(t) laptop(l) pc(p)
+@end example
+
+
+The tags interface shows the available tags in a splash window. If
+you want to start a new line after a specific tag, insert @samp{\n} into
+the tag list
+
+@example
+#+TAGS: @@work(w) @@home(h) @@tennisclub(t) \n laptop(l) pc(p)
+@end example
+
+
+@noindent
+or write them in two lines:
+
+@example
+#+TAGS: @@work(w) @@home(h) @@tennisclub(t)
+#+TAGS: laptop(l) pc(p)
+@end example
+
+You can also group together tags that are mutually exclusive by using
+braces, as in:
+
+@example
+#+TAGS: @{ @@work(w) @@home(h) @@tennisclub(t) @} laptop(l) pc(p)
+@end example
+
+
+@noindent
+you indicate that at most one of @samp{@@work}, @samp{@@home}, and @samp{@@tennisclub}
+should be selected. Multiple such groups are allowed.
+
+Do not forget to press @kbd{C-c C-c} with point in one of these
+lines to activate any changes.
+
+To set these mutually exclusive groups in the variable
+@code{org-tags-alist}, you must use the dummy tags @code{:startgroup} and
+@code{:endgroup} instead of the braces. Similarly, you can use @code{:newline}
+to indicate a line break. The previous example would be set globally
+by the following configuration:
+
+@lisp
+(setq org-tag-alist '((:startgroup . nil)
+ ("@@work" . ?w) ("@@home" . ?h)
+ ("@@tennisclub" . ?t)
+ (:endgroup . nil)
+ ("laptop" . ?l) ("pc" . ?p)))
+@end lisp
+
+If at least one tag has a selection key then pressing @kbd{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@footnote{Keys are automatically assigned to tags that have no
+configured keys.}.
+
+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:
+
+@table @asis
+@item @kbd{@key{TAB}}
+@kindex TAB
+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
+and globally pre-defined tags from @code{org-tag-alist} and
+@code{org-tag-persistent-alist}. You can also add several tags: just
+separate them with a comma.
+
+@item @kbd{@key{SPC}}
+@kindex SPC
+Clear all tags for this line.
+
+@item @kbd{@key{RET}}
+@kindex RET
+Accept the modified set.
+
+@item @kbd{C-g}
+@kindex C-g
+Abort without installing changes.
+
+@item @kbd{q}
+@kindex q
+If @kbd{q} is not assigned to a tag, it aborts like
+@kbd{C-g}.
+
+@item @kbd{!}
+@kindex !
+Turn off groups of mutually exclusive tags. Use this to (as an
+exception) assign several tags from such a group.
+
+@item @kbd{C-c}
+@kindex C-c C-c
+Toggle auto-exit after the next change (see below). If you are
+using expert mode, the first @kbd{C-c} displays the selection
+window.
+@end table
+
+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
+@samp{@@home}, @samp{laptop} and @samp{pc} tags with just the following keys:
+@kbd{C-c C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@home} to @samp{@@work}
+would be done with @kbd{C-c C-c w @key{RET}} or alternatively with
+@kbd{C-c C-c C-c w}. Adding the non-predefined tag @samp{sarah} could
+be done with @kbd{C-c C-c @key{TAB} s a r a h @key{RET}}.
+
+@vindex org-fast-tag-selection-single-key
+If you find that most of the time you need only a single key press to
+modify your list of tags, set the variable
+@code{org-fast-tag-selection-single-key}. Then you no longer have to press
+@kbd{@key{RET}} to exit fast tag selection---it exits after the first
+change. If you then occasionally need more keys, press @kbd{C-c}
+to turn off auto-exit for the current tag selection process (in
+effect: start selection with @kbd{C-c C-c C-c} instead of
+@kbd{C-c C-c}). If you set the variable to the value @code{expert},
+the special window is not even shown for single-key tag selection, it
+comes up only when you press an extra @kbd{C-c}.
+
+@node Tag Hierarchy
+@section Tag Hierarchy
+
+@cindex group tags
+@cindex tags, groups
+@cindex tags hierarchy
+
+Tags can be defined in hierarchies. A tag can be defined as a @emph{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:
+
+@example
+#+TAGS: [ GTD : Control Persp ]
+@end example
+
+
+In this example, @samp{GTD} is the group tag and it is related to two other
+tags: @samp{Control}, @samp{Persp}. Defining @samp{Control} and @samp{Persp} as group
+tags creates a hierarchy of tags:
+
+@example
+#+TAGS: [ Control : Context Task ]
+#+TAGS: [ Persp : Vision Goal AOF Project ]
+@end example
+
+That can conceptually be seen as a hierarchy of tags:
+
+@itemize
+@item
+@samp{GTD}
+@itemize
+@item
+@samp{Persp}
+@itemize
+@item
+@samp{Vision}
+@item
+@samp{Goal}
+@item
+@samp{AOF}
+@item
+@samp{Project}
+@end itemize
+@item
+@samp{Control}
+@itemize
+@item
+@samp{Context}
+@item
+@samp{Task}
+@end itemize
+@end itemize
+@end itemize
+
+You can use the @code{:startgrouptag}, @code{:grouptags} and @code{:endgrouptag}
+keyword directly when setting @code{org-tag-alist} directly:
+
+@lisp
+(setq org-tag-alist '((:startgrouptag)
+ ("GTD")
+ (:grouptags)
+ ("Control")
+ ("Persp")
+ (:endgrouptag)
+ (:startgrouptag)
+ ("Control")
+ (:grouptags)
+ ("Context")
+ ("Task")
+ (:endgrouptag)))
+@end lisp
+
+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.
+
+@example
+#+TAGS: @{ Context : @@Home @@Work @@Call @}
+@end example
+
+
+When setting @code{org-tag-alist} you can use @code{:startgroup} and @code{:endgroup}
+instead of @code{:startgrouptag} and @code{: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 (see @ref{Regular Expressions}). The regular expressions in
+the group must be specified within curly brackets. Here is an
+expanded example:
+
+@example
+#+TAGS: [ Vision : @{V@@.+@} ]
+#+TAGS: [ Goal : @{G@@.+@} ]
+#+TAGS: [ AOF : @{AOF@@.+@} ]
+#+TAGS: [ Project : @{P@@.+@} ]
+@end example
+
+Searching for the tag @samp{Project} now lists all tags also including
+regular expression matches for @samp{P@@.+}, and similarly for tag searches
+on @samp{Vision}, @samp{Goal} and @samp{AOF}. For example, this would work well for
+a project tagged with a common project-identifier, e.g.,
+@samp{P@@2014_OrgTags}.
+
+@kindex C-c C-x q
+@findex org-toggle-tags-groups
+@vindex org-group-tags
+If you want to ignore group tags temporarily, toggle group tags
+support with @code{org-toggle-tags-groups}, bound to @kbd{C-c C-x q}.
+If you want to disable tag groups completely, set @code{org-group-tags} to
+@code{nil}.
+
+@node Tag Searches
+@section Tag Searches
+
+@cindex tag searches
+@cindex searching for tags
+
+Once a system of tags has been set up, it can be used to collect
+related information into special lists.
+
+@table @asis
+@item @kbd{C-c / m} or @kbd{C-c \} (@code{org-match-sparse-tree})
+@kindex C-c / m
+@kindex C-c \
+@findex org-match-sparse-tree
+Create a sparse tree with all headlines matching a tags search.
+With a @kbd{C-u} prefix argument, ignore headlines that are not
+a TODO line.
+
+@item @kbd{M-x org-agenda m} (@code{org-tags-view})
+@kindex m @r{(Agenda dispatcher)}
+@findex org-tags-view
+Create a global list of tag matches from all agenda files. See
+@ref{Matching tags and properties}.
+
+@item @kbd{M-x org-agenda M} (@code{org-tags-view})
+@kindex M @r{(Agenda dispatcher)}
+@vindex org-tags-match-list-sublevels
+Create a global list of tag matches from all agenda files, but check
+only TODO items and force checking subitems (see the option
+@code{org-tags-match-list-sublevels}).
+@end table
+
+These commands all prompt for a match string which allows basic
+Boolean logic like @samp{+boss+urgent-project1}, to find entries with tags
+@samp{boss} and @samp{urgent}, but not @samp{project1}, or @samp{Kathy|Sally} to find
+entries which are tagged, like @samp{Kathy} or @samp{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 @ref{Matching tags and properties}.
+
+@node Properties and Columns
+@chapter Properties and Columns
+
+@cindex properties
+
+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 the whole buffer.
+
+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 @samp{release_1}, @samp{release_2}, you
+can use a property, say @samp{Release}, that in different subtrees has
+different values, such as @samp{1.0} or @samp{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
+@ref{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.
+@end menu
+
+@node Property Syntax
+@section Property Syntax
+
+@cindex property syntax
+@cindex drawer, for properties
+
+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 @ref{Drawers}) with the name @samp{PROPERTIES}, which has to be
+located right below a headline, and its planning line (see @ref{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:
+
+@example
+* CD collection
+** Classic
+*** Goldberg Variations
+ :PROPERTIES:
+ :Title: Goldberg Variations
+ :Composer: J.S. Bach
+ :Artist: Glenn Gould
+ :Publisher: Deutsche Grammophon
+ :NDisks: 1
+ :END:
+@end example
+
+Depending on the value of @code{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 @ref{Property Inheritance}.
+
+You may define the allowed values for a particular property @samp{Xyz} by
+setting a property @samp{Xyz_ALL}. This special property is @emph{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:
+
+@example
+* CD collection
+ :PROPERTIES:
+ :NDisks_ALL: 1 2 3 4
+ :Publisher_ALL: "Deutsche Grammophon" Philips EMI
+ :END:
+@end example
+
+Properties can be inserted on buffer level. That means they apply
+before the first headline and can be inherited by all entries in a
+file. Property blocks defined before first headline needs to be
+located at the top of the buffer, allowing only comments above.
+
+Properties can also be defined using lines like:
+
+@cindex @samp{_ALL} suffix, in properties
+@cindex @samp{PROPERTY}, keyword
+@example
+#+PROPERTY: NDisks_ALL 1 2 3 4
+@end example
+
+
+@cindex @samp{+} suffix, in properties
+If you want to add to the value of an existing property, append a @samp{+}
+to the property name. The following results in the property @samp{var}
+having the value @samp{foo=1 bar=2}.
+
+@example
+#+PROPERTY: var foo=1
+#+PROPERTY: var+ bar=2
+@end example
+
+It is also possible to add to the values of inherited properties. The
+following results in the @samp{Genres} property having the value @samp{Classic
+Baroque} under the @samp{Goldberg Variations} subtree.
+
+@example
+* 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:
+@end example
+
+Note that a property can only have one entry per drawer.
+
+@vindex org-global-properties
+Property values set with the global variable @code{org-global-properties}
+can be inherited by all entries in all Org files.
+
+The following commands help to work with properties:
+
+@table @asis
+@item @kbd{M-@key{TAB}} (@code{pcomplete})
+@kindex M-TAB
+@findex pcomplete
+After an initial colon in a line, complete property keys. All keys
+used in the current file are offered as possible completions.
+
+@item @kbd{C-c C-x p} (@code{org-set-property})
+@kindex C-c C-x p
+@findex org-set-property
+Set a property. This prompts for a property name and a value. If
+necessary, the property drawer is created as well.
+
+@item @kbd{C-u M-x org-insert-drawer}
+@findex 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. If before first headline the drawer is
+inserted at the top of the drawer after any potential comments.
+
+@item @kbd{C-c C-c} (@code{org-property-action})
+@kindex C-c C-c
+@findex org-property-action
+With point in a property drawer, this executes property commands.
+
+@item @kbd{C-c C-c s} (@code{org-set-property})
+@kindex C-c C-c s
+@findex org-set-property
+Set a property in the current entry. Both the property and the
+value can be inserted using completion.
+
+@item @kbd{S-@key{RIGHT}} (@code{org-property-next-allowed-values})
+@itemx @kbd{S-@key{LEFT}} (@code{org-property-previous-allowed-value})
+@kindex S-RIGHT
+@kindex S-LEFT
+Switch property at point to the next/previous allowed value.
+
+@item @kbd{C-c C-c d} (@code{org-delete-property})
+@kindex C-c C-c d
+@findex org-delete-property
+Remove a property from the current entry.
+
+@item @kbd{C-c C-c D} (@code{org-delete-property-globally})
+@kindex C-c C-c D
+@findex org-delete-property-globally
+Globally remove a property, from all entries in the current file.
+
+@item @kbd{C-c C-c c} (@code{org-compute-property-at-point})
+@kindex C-c C-c c
+@findex org-compute-property-at-point
+Compute the property at point, using the operator and scope from the
+nearest column format definition.
+@end table
+
+@node Special Properties
+@section Special Properties
+
+@cindex properties, special
+
+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 @ref{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:
+
+@cindex @samp{ALLTAGS}, special property
+@cindex @samp{BLOCKED}, special property
+@cindex @samp{CLOCKSUM}, special property
+@cindex @samp{CLOCKSUM_T}, special property
+@cindex @samp{CLOSED}, special property
+@cindex @samp{DEADLINE}, special property
+@cindex @samp{FILE}, special property
+@cindex @samp{ITEM}, special property
+@cindex @samp{PRIORITY}, special property
+@cindex @samp{SCHEDULED}, special property
+@cindex @samp{TAGS}, special property
+@cindex @samp{TIMESTAMP}, special property
+@cindex @samp{TIMESTAMP_IA}, special property
+@cindex @samp{TODO}, special property
+@multitable {aaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{ALLTAGS}
+@tab All tags, including inherited ones.
+@item @samp{BLOCKED}
+@tab @code{t} if task is currently blocked by children or siblings.
+@item @samp{CATEGORY}
+@tab The category of an entry.
+@item @samp{CLOCKSUM}
+@tab The sum of CLOCK intervals in the subtree. @code{org-clock-sum}
+@item
+@tab must be run first to compute the values in the current buffer.
+@item @samp{CLOCKSUM_T}
+@tab The sum of CLOCK intervals in the subtree for today.
+@item
+@tab @code{org-clock-sum-today} must be run first to compute the
+@item
+@tab values in the current buffer.
+@item @samp{CLOSED}
+@tab When was this entry closed?
+@item @samp{DEADLINE}
+@tab The deadline timestamp.
+@item @samp{FILE}
+@tab The filename the entry is located in.
+@item @samp{ITEM}
+@tab The headline of the entry.
+@item @samp{PRIORITY}
+@tab The priority of the entry, a string with a single letter.
+@item @samp{SCHEDULED}
+@tab The scheduling timestamp.
+@item @samp{TAGS}
+@tab The tags defined directly in the headline.
+@item @samp{TIMESTAMP}
+@tab The first keyword-less timestamp in the entry.
+@item @samp{TIMESTAMP_IA}
+@tab The first inactive timestamp in the entry.
+@item @samp{TODO}
+@tab The TODO keyword of the entry.
+@end multitable
+
+@node Property Searches
+@section Property Searches
+
+@cindex properties, searching
+@cindex searching, of properties
+
+To create sparse trees and special lists with selection based on
+properties, the same commands are used as for tag searches (see @ref{Tag Searches}).
+
+@table @asis
+@item @kbd{C-c / m} or @kbd{C-c \} (@code{org-match-sparse-tree})
+@kindex C-c / m
+@kindex C-c \
+@findex org-match-sparse-tree
+Create a sparse tree with all matching entries. With
+a @kbd{C-u} prefix argument, ignore headlines that are not
+a TODO line.
+
+@item @kbd{M-x org-agenda m} (@code{org-tags-view})
+@kindex m @r{(Agenda dispatcher)}
+@findex org-tags-view
+Create a global list of tag/property matches from all agenda files.
+
+@item @kbd{M-x org-agenda M} (@code{org-tags-view})
+@kindex M @r{(Agenda dispatcher)}
+@vindex org-tags-match-list-sublevels
+Create a global list of tag matches from all agenda files, but check
+only TODO items and force checking of subitems (see the option
+@code{org-tags-match-list-sublevels}).
+@end table
+
+The syntax for the search string is described in @ref{Matching tags and properties}.
+
+There is also a special command for creating sparse trees based on a
+single property:
+
+@table @asis
+@item @kbd{C-c / p}
+@kindex 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 (see @ref{Regular Expressions}).
+@end table
+
+@node Property Inheritance
+@section Property Inheritance
+
+@cindex properties, inheritance
+@cindex inheritance, of properties
+
+@vindex org-use-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
+@code{org-use-property-inheritance}. It may be set to @code{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 @code{nil}, this is interpreted as
+an explicit un-define of the property, so that inheritance search
+stops at this value and returns @code{nil}.
+
+Org mode has a few properties for which inheritance is hard-coded, at
+least for the special applications for which they are used:
+
+@table @asis
+@item @code{COLUMNS}
+@cindex @samp{COLUMNS}, property
+The @samp{COLUMNS} property defines the format of column view (see
+@ref{Column View}). It is inherited in the sense that the level where
+a @samp{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.
+
+@item @code{CATEGORY}
+@cindex @samp{CATEGORY}, property
+For agenda view, a category set through a @samp{CATEGORY} property
+applies to the entire subtree.
+
+@item @code{ARCHIVE}
+@cindex @samp{ARCHIVE}, property
+For archiving, the @samp{ARCHIVE} property may define the archive
+location for the entire subtree (see @ref{Moving subtrees}).
+
+@item @code{LOGGING}
+@cindex @samp{LOGGING}, property
+The @samp{LOGGING} property may define logging settings for an entry or
+a subtree (see @ref{Tracking TODO state changes}).
+@end table
+
+@node Column View
+@section Column View
+
+A great way to view and edit properties in an outline tree is @emph{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---@kbd{S-@key{TAB}} @kbd{S-@key{TAB}}, or simply @kbd{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
+@ref{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.
+@end menu
+
+@node Defining columns
+@subsection Defining columns
+
+@cindex column view, for properties
+@cindex properties, column view
+
+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.
+@end menu
+
+@node Scope of column definitions
+@subsubsection Scope of column definitions
+
+To specify a format that only applies to a specific tree, add
+a @samp{COLUMNS} property to the top node of that tree, for example:
+
+@example
+** Top node for columns view
+ :PROPERTIES:
+ :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
+ :END:
+@end example
+
+A @samp{COLUMNS} property within a property drawer before first headline
+will apply to the entire file. As an addition to property drawers,
+keywords can also be defined for an entire file using a line like:
+
+@cindex @samp{COLUMNS}, keyword
+@example
+#+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
+@end example
+
+
+If a @samp{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.
+
+@node Column attributes
+@subsubsection Column attributes
+
+A column definition sets the attributes of a column. The general
+definition looks like this:
+
+@example
+%[WIDTH]PROPERTY[(TITLE)][@{SUMMARY-TYPE@}]
+@end example
+
+
+@noindent
+Except for the percent sign and the property name, all items are
+optional. The individual parts have the following meaning:
+
+@table @asis
+@item @var{WIDTH}
+An integer specifying the width of the column in characters. If
+omitted, the width is determined automatically.
+
+@item @var{PROPERTY}
+The property that should be edited in this column. Special
+properties representing meta data are allowed here as well (see
+@ref{Special Properties}).
+
+@item @var{TITLE}
+The header text for the column. If omitted, the property name is
+used.
+
+@item @var{SUMMARY-TYPE}
+The summary type. If specified, the column values for parent nodes
+are computed from the children@footnote{If more than one summary type applies to the same property,
+the parent values are computed according to the first of them.}.
+
+Supported summary types are:
+
+@multitable {aaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{+}
+@tab Sum numbers in this column.
+@item @samp{+;%.1f}
+@tab Like @samp{+}, but format result with @samp{%.1f}.
+@item @samp{$}
+@tab Currency, short for @samp{+;%.2f}.
+@item @samp{min}
+@tab Smallest number in column.
+@item @samp{max}
+@tab Largest number.
+@item @samp{mean}
+@tab Arithmetic mean of numbers.
+@item @samp{X}
+@tab Checkbox status, @samp{[X]} if all children are @samp{[X]}.
+@item @samp{X/}
+@tab Checkbox status, @samp{[n/m]}.
+@item @samp{X%}
+@tab Checkbox status, @samp{[n%]}.
+@item @samp{:}
+@tab Sum times, HH:MM, plain numbers are minutes.
+@item @samp{:min}
+@tab Smallest time value in column.
+@item @samp{:max}
+@tab Largest time value.
+@item @samp{:mean}
+@tab Arithmetic mean of time values.
+@item @samp{@@min}
+@tab Minimum age@footnote{An age can be defined as a duration, using units defined in
+@code{org-duration-units}, e.g., @samp{3d 1h}. If any value in the column is as
+such, the summary is also expressed as a duration.} (in days/hours/mins/seconds).
+@item @samp{@@max}
+@tab Maximum age (in days/hours/mins/seconds).
+@item @samp{@@mean}
+@tab Arithmetic mean of ages (in days/hours/mins/seconds).
+@item @samp{est+}
+@tab Add low-high estimates.
+@end multitable
+
+@vindex org-columns-summary-types
+You can also define custom summary types by setting
+@code{org-columns-summary-types}.
+@end table
+
+The @samp{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, @samp{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, @samp{est+} estimates the full job more realistically, at 10--15
+days.
+
+Here is an example for a complete columns definition, along with
+allowed values@footnote{Please note that the @samp{COLUMNS} definition must be on a single
+line; it is wrapped here only because of formatting constraints.}.
+
+@example
+: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]"
+@end example
+
+@noindent
+The first column, @samp{%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 @samp{ITEM} specifier. The other specifiers
+create columns @samp{Owner} with a list of names as allowed values, for
+@samp{Status} with four different possible values, and for a checkbox field
+@samp{Approved}. When no width is given after the @samp{%} character, the
+column is exactly as wide as it needs to be in order to fully display
+all values. The @samp{Approved} column does have a modified title
+(@samp{Approved?}, with a question mark). Summaries are created for the
+@samp{Time_Estimate} column by adding time duration expressions like HH:MM,
+and for the @samp{Approved} column, by providing an @samp{[X]} status if all
+children have been checked. The @samp{CLOCKSUM} and @samp{CLOCKSUM_T} columns
+are special, they lists the sums of CLOCK intervals in the subtree,
+either for all clocks or just for today.
+
+@node Using column view
+@subsection Using column view
+
+
+
+@anchor{Turning column view on or off}
+@subsubheading Turning column view on or off
+
+@table @asis
+@item @kbd{C-c C-x C-c} (@code{org-columns})
+@kindex C-c C-x C-c
+@vindex org-columns
+@vindex org-columns-default-format
+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
+@samp{#+COLUMNS} definition. If point is somewhere inside the outline,
+this command searches the hierarchy, up from point, for a @samp{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 @samp{COLUMNS} property. If no such property is found, the
+format is taken from the @samp{#+COLUMNS} line or from the variable
+@code{org-columns-default-format}, and column view is established for the
+current entry and its subtree.
+
+@item @kbd{r} or @kbd{g} on a columns view line (@code{org-columns-redo})
+@kindex r
+@kindex g
+@findex org-columns-redo
+Recreate the column view, to include recent changes made in the
+buffer.
+
+@item @kbd{C-c C-c} or @kbd{q} on a columns view line (@code{org-columns-quit})
+@kindex q
+@kindex C-c C-c
+@findex org-columns-quit
+Exit column view.
+@end table
+
+@anchor{Editing values}
+@subsubheading Editing values
+
+@table @asis
+@item @kbd{@key{LEFT}}, @kbd{@key{RIGHT}}, @kbd{@key{UP}}, @kbd{@key{DOWN}}
+Move through the column view from field to field.
+
+@item @kbd{1..9,0}
+@kindex 1..9,0
+Directly select the Nth allowed value, @kbd{0} selects the
+10th value.
+
+@item @kbd{n} or @kbd{S-@key{RIGHT}} (@code{org-columns-next-allowed-value})
+@itemx @kbd{p} or @kbd{S-@key{LEFT}} (@code{org-columns-previous-allowed-value})
+@kindex n
+@kindex S-RIGHT
+@kindex p
+@kindex S-LEFT
+@findex org-columns-next-allowed-value
+@findex 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.
+
+@item @kbd{e} (@code{org-columns-edit-value})
+@kindex e
+@findex 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 @samp{TAGS} property.
+
+@item @kbd{C-c C-c} (@code{org-columns-toggle-or-columns-quit})
+@kindex C-c C-c
+@findex org-columns-toggle-or-columns-quit
+When there is a checkbox at point, toggle it. Else exit column
+view.
+
+@item @kbd{v} (@code{org-columns-show-value})
+@kindex v
+@findex 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.
+
+@item @kbd{a} (@code{org-columns-edit-allowed})
+@kindex a
+@findex 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.
+@end table
+
+@anchor{Modifying column view on-the-fly}
+@subsubheading Modifying column view on-the-fly
+
+@table @asis
+@item @kbd{<} (@code{org-columns-narrow})
+@itemx @kbd{>} (@code{org-columns-widen})
+@kindex <
+@kindex >
+@findex org-columns-narrow
+@findex org-columns-widen
+Make the column narrower/wider by one character.
+
+@item @kbd{S-M-@key{RIGHT}} (@code{org-columns-new})
+@kindex S-M-RIGHT
+@findex org-columns-new
+Insert a new column, to the left of the current column.
+
+@item @kbd{S-M-@key{LEFT}} (@code{org-columns-delete})
+@kindex S-M-LEFT
+@findex org-columns-delete
+Delete the current column.
+@end table
+
+@node Capturing column view
+@subsection 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 @samp{columnview} dynamic block (see @ref{Dynamic Blocks}). The frame of
+this block looks like this:
+
+@cindex @samp{BEGIN columnview}
+@example
+* The column view
+#+BEGIN: columnview :hlines 1 :id "label"
+
+#+END:
+@end example
+
+This dynamic block has the following parameters:
+
+@table @asis
+@item @samp{: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:
+
+@table @asis
+@item @samp{local}
+Use the tree in which the capture block is located.
+
+@item @samp{global}
+Make a global view, including all headings in the file.
+
+@item @samp{file:FILENAME}
+Run column view at the top of the @var{FILENAME} file.
+
+@item @samp{LABEL}
+@cindex @samp{ID}, property
+Call column view in the tree that has an @samp{ID} property with the
+value @var{LABEL}. You can use @kbd{M-x org-id-copy} to
+create a globally unique ID for the current entry and copy it to
+the kill-ring.
+@end table
+
+@item @samp{:match}
+When set to a string, use this as a tags/property match filter to
+select only a subset of the headlines in the scope set by the @code{:id}
+parameter.
+@end table
+
+
+@table @asis
+@item @samp{:hlines}
+When @code{t}, insert an hline after every line. When a number N, insert
+an hline before each headline with level @code{<= N}.
+
+@item @samp{:vlines}
+When non-@code{nil}, force column groups to get vertical lines.
+
+@item @samp{:maxlevel}
+When set to a number, do not capture entries below this level.
+
+@item @samp{:skip-empty-rows}
+When non-@code{nil}, skip rows where the only non-empty specifier of
+the column view is @samp{ITEM}.
+
+@item @samp{:exclude-tags}
+List of tags to exclude from column view table: entries with these
+tags will be excluded from the column view.
+
+@item @samp{:indent}
+When non-@code{nil}, indent each @samp{ITEM} field according to its level.
+
+@item @samp{:format}
+Specify a column attribute (see @ref{Column attributes}) for the dynamic
+block.
+@end table
+
+The following commands insert or update the dynamic block:
+
+@table @asis
+@item @code{org-columns-insert-dblock}
+@kindex C-c C-x x
+@findex org-columns-insert-dblock
+Insert a dynamic block capturing a column view. Prompt for the
+scope or ID of the view.
+
+This command can be invoked by calling
+@code{org-dynamic-block-insert-dblock} (@kbd{C-c C-x x}) and
+selecting ``columnview'' (see @ref{Dynamic Blocks}).
+
+@item @kbd{C-c C-c} @kbd{C-c C-x C-u} (@code{org-dblock-update})
+@kindex C-c C-c
+@kindex C-c C-x C-u
+@findex org-dblock-update
+Update dynamic block at point. point needs to be in the @samp{#+BEGIN}
+line of the dynamic block.
+
+@item @kbd{C-u C-c C-x C-u} (@code{org-update-all-dblocks})
+@kindex C-u C-c C-x C-u
+Update all dynamic blocks (see @ref{Dynamic Blocks}). This is useful if
+you have several clock table blocks, column-capturing blocks or
+other dynamic blocks in a buffer.
+@end table
+
+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 @samp{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 @samp{org-collector.el}, which is a package
+in @samp{org-contrib}@footnote{Contributed packages are not part of Emacs, but are
+distributed with the main distribution of Org---visit
+@uref{https://orgmode.org}.}. It provides a general API to collect
+properties from entries in a certain scope, and arbitrary Lisp
+expressions to process these values before inserting them into a table
+or a dynamic block.
+
+@node Dates and Times
+@chapter Dates and Times
+
+@cindex dates
+@cindex times
+@cindex timestamp
+@cindex date stamp
+
+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 @emph{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.
+@end menu
+
+@node Timestamps
+@section Timestamps
+
+@cindex timestamps
+@cindex ranges, time
+@cindex date stamps
+@cindex deadlines
+@cindex scheduling
+
+A timestamp is a specification of a date (possibly with a time or
+a range of times) in a special format, either @samp{<2003-09-16 Tue>} or
+@samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue 12:00-12:30>}@footnote{The Org date format is inspired by the standard ISO 8601
+date/time format. To use an alternative format, see @ref{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.}.
+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 @ref{Weekly/daily agenda}). We distinguish:
+
+@table @asis
+@item Plain timestamp; Event; Appointment
+@cindex timestamp
+@cindex 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.
+
+@example
+* Meet Peter at the movies
+ <2006-11-01 Wed 19:15>
+* Discussion on climate change
+ <2006-11-02 Thu 20:00-22:00>
+@end example
+
+@item Timestamp with repeater interval
+@cindex timestamp, with repeater interval
+A timestamp may contain a @emph{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:
+
+@example
+* Pick up Sam at school
+ <2007-05-16 Wed 12:30 +1w>
+@end example
+
+@item Diary-style expression entries
+@cindex diary style timestamps
+@cindex sexp timestamps
+For more complex date specifications, Org mode supports using the
+special expression diary entries implemented in the Emacs Calendar
+package@footnote{When working with the standard diary expression functions, you
+need to be very careful with the order of the arguments. That order
+depends evilly on the variable @code{calendar-date-style}. For example, to
+specify a date December 12, 2005, the call might look like
+@samp{(diary-date 12 1 2005)} or @samp{(diary-date 1 12 2005)} or @samp{(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 @code{org-date} or @code{org-anniversary}. These work just
+like the corresponding @code{diary-} functions, but with stable ISO order
+of arguments (year, month, day) wherever applicable, independent of
+the value of @code{calendar-date-style}.}. For example, with optional time:
+
+@example
+* 22:00-23:00 The nerd meeting on every 2nd Thursday of the month
+ <%%(diary-float t 4 2)>
+@end example
+
+@item Time/Date range
+@cindex timerange
+@cindex date range
+Two timestamps connected by @samp{--} 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:
+
+@example
+** Meeting in Amsterdam
+ <2004-08-23 Mon>--<2004-08-26 Thu>
+@end example
+
+@item Inactive timestamp
+@cindex timestamp, inactive
+@cindex 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 @emph{not} trigger an entry to show up in the agenda.
+
+@example
+* Gillian comes late for the fifth time
+ [2006-11-01 Wed]
+@end example
+@end table
+
+@node Creating Timestamps
+@section 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.
+
+@table @asis
+@item @kbd{C-c .} (@code{org-time-stamp})
+@kindex C-c .
+@findex 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.
+
+@kindex C-u C-c .
+@vindex org-time-stamp-rounding-minutes
+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
+@code{org-time-stamp-rounding-minutes}.
+
+@kindex C-u C-u C-c .
+With two prefix arguments, insert an active timestamp with the
+current time without prompting.
+
+@item @kbd{C-c !} (@code{org-time-stamp-inactive})
+@kindex C-c !
+@kindex C-u C-c !
+@kindex C-u C-u C-c !
+@findex org-time-stamp-inactive
+Like @kbd{C-c .}, but insert an inactive timestamp that does
+not cause an agenda entry.
+
+@item @kbd{C-c C-c}
+@kindex C-c C-c
+Normalize timestamp, insert or fix day name if missing or wrong.
+
+@item @kbd{C-c <} (@code{org-date-from-calendar})
+@kindex C-c <
+@findex org-date-from-calendar
+Insert a timestamp corresponding to point date in the calendar.
+
+@item @kbd{C-c >} (@code{org-goto-calendar})
+@kindex C-c >
+@findex 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.
+
+@item @kbd{C-c C-o} (@code{org-open-at-point})
+@kindex C-c C-o
+@findex org-open-at-point
+Access the agenda for the date given by the timestamp or -range at
+point (see @ref{Weekly/daily agenda}).
+
+@item @kbd{S-@key{LEFT}} (@code{org-timestamp-down-day})
+@itemx @kbd{S-@key{RIGHT}} (@code{org-timestamp-up-day})
+@kindex S-LEFT
+@kindex S-RIGHT
+@findex org-timestamp-down-day
+@findex org-timestamp-up-day
+Change date at point by one day. These key bindings conflict with
+shift-selection and related modes (see @ref{Conflicts}).
+
+@item @kbd{S-@key{UP}} (@code{org-timestamp-up})
+@itemx @kbd{S-@key{DOWN}} (@code{org-timestamp-down})
+@kindex S-UP
+@kindex S-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 @samp{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 @ref{Priorities}). The key bindings
+also conflict with shift-selection and related modes (see @ref{Conflicts}).
+
+@item @kbd{C-c C-y} (@code{org-evaluate-time-range})
+@kindex C-c C-y
+@findex org-evaluate-time-range
+@cindex 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).
+@end table
+
+@menu
+* The date/time prompt:: How Org mode helps you enter dates and times.
+* Custom time format:: Making dates look different.
+@end menu
+
+@node The date/time prompt
+@subsection The date/time prompt
+
+@cindex date, reading in minibuffer
+@cindex time, reading in minibuffer
+
+@vindex org-read-date-prefer-future
+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 @emph{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 @emph{before} today, it assumes that you mean a future
+date@footnote{See the variable @code{org-read-date-prefer-future}. You may set
+that variable to the symbol @code{time} to even make a time before now
+shift the date to tomorrow.}. If the date has been automatically shifted into the
+future, the time prompt shows this with @samp{(=>F)}.
+
+For example, let's assume that today is @strong{June 13, 2006}. Here is how
+various inputs are interpreted, the items filled in by Org mode are in
+@strong{bold}.
+
+@multitable {aaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{3-2-5}
+@tab @result{} 2003-02-05
+@item @samp{2/5/3}
+@tab @result{} 2003-02-05
+@item @samp{14}
+@tab @result{} @strong{2006}-@strong{06}-14
+@item @samp{12}
+@tab @result{} @strong{2006}-@strong{07}-12
+@item @samp{2/5}
+@tab @result{} @strong{2007}-02-05
+@item @samp{Fri}
+@tab @result{} nearest Friday (default date or later)
+@item @samp{sep 15}
+@tab @result{} @strong{2006}-09-15
+@item @samp{feb 15}
+@tab @result{} @strong{2007}-02-15
+@item @samp{sep 12 9}
+@tab @result{} 2009-09-12
+@item @samp{12:45}
+@tab @result{} @strong{2006}-@strong{06}-@strong{13} 12:45
+@item @samp{22 sept 0:34}
+@tab @result{} @strong{2006}-09-22 0:34
+@item @samp{w4}
+@tab @result{} ISO week for of the current year @strong{2006}
+@item @samp{2012 w4 fri}
+@tab @result{} Friday of ISO week 4 in 2012
+@item @samp{2012-w04-5}
+@tab @result{} Same as above
+@end multitable
+
+Furthermore you can specify a relative date by giving, as the @emph{first}
+thing in the input: a plus/minus sign, a number and a letter---@samp{h},
+@samp{d}, @samp{w}, @samp{m} or @samp{y}---to indicate a change in hours, days, weeks,
+months, or years. With @samp{h} the date is relative to the current time,
+with the other letters and a single plus or minus, the date is
+relative to today at 00:00. 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.:
+
+@multitable {aaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{+0}
+@tab @result{} today
+@item @samp{.}
+@tab @result{} today
+@item @samp{+2h}
+@tab @result{} two hours from now
+@item @samp{+4d}
+@tab @result{} four days from today
+@item @samp{+4}
+@tab @result{} same as +4d
+@item @samp{+2w}
+@tab @result{} two weeks from today
+@item @samp{++5}
+@tab @result{} five days from default date
+@item @samp{+2tue}
+@tab @result{} second Tuesday from now
+@end multitable
+
+@vindex parse-time-months
+@vindex parse-time-weekdays
+The function understands English month and weekday abbreviations. If
+you want to use un-abbreviated names and/or other languages, configure
+the variables @code{parse-time-months} and @code{parse-time-weekdays}.
+
+@vindex org-read-date-force-compatible-dates
+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
+@code{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 @samp{+} as the
+separator in the latter case, e.g.:
+
+@multitable {aaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaa}
+@item @samp{11am-1:15pm}
+@tab @result{} 11:00-13:15
+@item @samp{11h-13h15}
+@tab @result{} same as above
+@item @samp{11am--1:15pm}
+@tab @result{} same as above
+@item @samp{11am+2:15}
+@tab @result{} same as above
+@end multitable
+
+@cindex calendar, for selecting date
+@vindex org-popup-calendar-for-date-prompt
+Parallel to the minibuffer prompt, a calendar is popped up@footnote{If you do not need/want the calendar, configure the variable
+@code{org-popup-calendar-for-date-prompt}.}.
+When you exit the date prompt, either by clicking on a date in the
+calendar, or by pressing @kbd{@key{RET}}, the date selected in the
+calendar is combined with the information entered at the prompt. You
+can control the calendar fully from the minibuffer:
+
+@kindex <
+@kindex >
+@kindex M-v
+@kindex C-v
+@kindex mouse-1
+@kindex S-RIGHT
+@kindex S-LEFT
+@kindex S-DOWN
+@kindex S-UP
+@kindex M-S-RIGHT
+@kindex M-S-LEFT
+@kindex RET
+@kindex .
+@kindex C-.
+@multitable @columnfractions 0.25 0.55
+@item @kbd{@key{RET}}
+@tab Choose date at point in calendar.
+@item @kbd{mouse-1}
+@tab Select date by clicking on it.
+@item @kbd{S-@key{RIGHT}}
+@tab One day forward.
+@item @kbd{S-@key{LEFT}}
+@tab One day backward.
+@item @kbd{S-@key{DOWN}}
+@tab One week forward.
+@item @kbd{S-@key{UP}}
+@tab One week backward.
+@item @kbd{M-S-@key{RIGHT}}
+@tab One month forward.
+@item @kbd{M-S-@key{LEFT}}
+@tab One month backward.
+@item @kbd{>}
+@tab Scroll calendar forward by one month.
+@item @kbd{<}
+@tab Scroll calendar backward by one month.
+@item @kbd{M-v}
+@tab Scroll calendar forward by 3 months.
+@item @kbd{C-v}
+@tab Scroll calendar backward by 3 months.
+@item @kbd{C-.}
+@tab Select today's date@footnote{You can also use the calendar command @kbd{.} to jump to
+today's date, but if you are inserting an hour specification for your
+timestamp, @kbd{.} will then insert a dot after the hour. By contrast,
+@kbd{C-.} will always jump to today's date.}
+@end multitable
+
+@vindex org-read-date-display-live
+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@footnote{If you find this distracting, turn off the display with
+@code{org-read-date-display-live}.}.
+
+@node Custom time format
+@subsection Custom time format
+
+@cindex custom date/time format
+@cindex time format, custom
+@cindex date format, custom
+
+@vindex org-display-custom-times
+@vindex org-time-stamp-custom-formats
+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 @code{org-display-custom-times} and
+@code{org-time-stamp-custom-formats}.
+
+@table @asis
+@item @kbd{C-c C-x C-t} (@code{org-toggle-time-stamp-overlays})
+@kindex C-c C-x C-t
+@findex org-toggle-time-stamp-overlays
+Toggle the display of custom formats for dates and times.
+@end table
+
+Org mode needs the default format for scanning, so the custom
+date/time format does not @emph{replace} the default format. Instead, it
+is put @emph{over} the default format using text properties. This has the
+following consequences:
+
+@itemize
+@item
+You cannot place point onto a timestamp anymore, only before or
+after.
+
+@item
+The @kbd{S-@key{UP}} and @kbd{S-@key{DOWN}} keys can no longer be used
+to adjust each component of a timestamp. If point is at the
+beginning of the stamp, @kbd{S-@key{UP}} and @kbd{S-@key{DOWN}} change
+the stamp by one day, just like @kbd{S-@key{LEFT}}
+@kbd{S-@key{RIGHT}}. At the end of the stamp, change the time by one
+minute.
+
+@item
+If the timestamp contains a range of clock times or a repeater,
+these are not overlaid, but remain in the buffer as they were.
+
+@item
+When you delete a timestamp character-by-character, it only
+disappears from the buffer after @emph{all} (invisible) characters
+belonging to the ISO timestamp have been removed.
+
+@item
+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.
+@end itemize
+
+@node Deadlines and Scheduling
+@section 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.
+
+@table @asis
+@item @samp{DEADLINE}
+@cindex @samp{DEADLINE} marker
+Meaning: the task---most likely a TODO item, though not
+necessarily---is supposed to be finished on that date.
+
+@vindex org-deadline-warning-days
+On the deadline date, the task is listed in the agenda. In
+addition, the agenda for @emph{today} carries a warning about the
+approaching or missed deadline, starting @code{org-deadline-warning-days}
+before the due date, and continuing until the entry is marked as
+done. An example:
+
+@example
+*** TODO write article about the Earth for the Guide
+ DEADLINE: <2004-02-29 Sun>
+ The editor in charge is [[bbdb:Ford Prefect]]
+@end example
+
+@vindex org-agenda-skip-deadline-prewarning-if-scheduled
+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 @samp{DEADLINE: <2004-02-29 Sun -5d>}. This
+warning is deactivated if the task gets scheduled and you set
+@code{org-agenda-skip-deadline-prewarning-if-scheduled} to @code{t}.
+
+@item @samp{SCHEDULED}
+@cindex @samp{SCHEDULED} marker
+Meaning: you are planning to start working on that task on the given
+date.
+
+@vindex org-agenda-skip-scheduled-if-done
+The headline is listed under the given date@footnote{It will still be listed on that date after it has been marked
+as done. If you do not like this, set the variable
+@code{org-agenda-skip-scheduled-if-done}.}. In addition,
+a reminder that the scheduled date has passed is present in the
+compilation for @emph{today}, until the entry is marked as done, i.e.,
+the task is automatically forwarded until completed.
+
+@example
+*** TODO Call Trillian for a date on New Years Eve.
+ SCHEDULED: <2004-12-25 Sat>
+@end example
+
+@vindex org-scheduled-delay-days
+@vindex org-agenda-skip-scheduled-delay-if-deadline
+If you want to @emph{delay} the display of this task in the agenda, use
+@samp{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 @samp{--2d} instead. See @code{org-scheduled-delay-days} and
+@code{org-agenda-skip-scheduled-delay-if-deadline} for details on how to
+control this globally or per agenda.
+
+@quotation Important
+Scheduling an item in Org mode should @emph{not} be understood in the
+same way that we understand @emph{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, @emph{scheduling} means setting a date when you want
+to start working on an action item.
+
+@end quotation
+@end table
+
+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 @emph{nearest instance} of the
+repeater. However, the use of diary expression entries like
+
+@example
+<%%(diary-float t 42)>
+@end example
+
+
+@noindent
+in scheduling and deadline timestamps is limited. Org mode does not
+know enough about the internals of each function to issue early and
+late warnings. However, it shows the item on each day where the
+expression entry matches.
+
+@menu
+* Inserting deadline/schedule:: Planning items.
+* Repeated tasks:: Items that show up again and again.
+@end menu
+
+@node Inserting deadline/schedule
+@subsection Inserting deadlines or schedules
+
+The following commands allow you to quickly insert a deadline or to
+schedule an item:@footnote{The @samp{SCHEDULED} and @samp{DEADLINE} dates are inserted on the line
+right below the headline. Do not put any text between this line and
+the headline.}
+
+@table @asis
+@item @kbd{C-c C-d} (@code{org-deadline})
+@kindex C-c C-d
+@findex org-deadline
+@vindex org-log-redeadline
+Insert @samp{DEADLINE} keyword along with a stamp. The insertion happens
+in the line directly following the headline. Remove any @samp{CLOSED}
+timestamp . When called with a prefix argument, also remove any
+existing deadline from the entry. Depending on the variable
+@code{org-log-redeadline}, take a note when changing an existing
+deadline@footnote{Note the corresponding @samp{STARTUP} options @samp{logredeadline},
+@samp{lognoteredeadline}, and @samp{nologredeadline}.}.
+
+@item @kbd{C-c C-s} (@code{org-schedule})
+@kindex C-c C-s
+@findex org-schedule
+@vindex org-log-reschedule
+Insert @samp{SCHEDULED} keyword along with a stamp. The insertion
+happens in the line directly following the headline. Remove any
+@samp{CLOSED} timestamp. When called with a prefix argument, also remove
+the scheduling date from the entry. Depending on the variable
+@code{org-log-reschedule}, take a note when changing an existing
+scheduling time@footnote{Note the corresponding @samp{STARTUP} options @samp{logreschedule},
+@samp{lognotereschedule}, and @samp{nologreschedule}.}.
+
+@item @kbd{C-c / d} (@code{org-check-deadlines})
+@kindex C-c / d
+@findex org-check-deadlines
+@cindex sparse tree, for deadlines
+@vindex org-deadline-warning-days
+Create a sparse tree with all deadlines that are either past-due, or
+which will become due within @code{org-deadline-warning-days}. With
+@kbd{C-u} prefix, show all deadlines in the file. With
+a numeric prefix, check that many days. For example, @kbd{C-1 C-c / d} shows all deadlines due tomorrow.
+
+@item @kbd{C-c / b} (@code{org-check-before-date})
+@kindex C-c / b
+@findex org-check-before-date
+Sparse tree for deadlines and scheduled items before a given date.
+
+@item @kbd{C-c / a} (@code{org-check-after-date})
+@kindex C-c / a
+@findex org-check-after-date
+Sparse tree for deadlines and scheduled items after a given date.
+@end table
+
+Note that @code{org-schedule} and @code{org-deadline} supports setting the date
+by indicating a relative time e.g., @samp{+1d} sets the date to the next
+day after today, and @samp{--1w} sets the date to the previous week before
+any current timestamp.
+
+@node Repeated tasks
+@subsection Repeated tasks
+
+@cindex tasks, repeated
+@cindex 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 @samp{DEADLINE},
+@samp{SCHEDULED}, or plain timestamps@footnote{Org does not repeat inactive timestamps, however. See
+@ref{Timestamps}.}. In the following example:
+
+@example
+** TODO Pay the rent
+ DEADLINE: <2005-10-01 Sat +1m>
+@end example
+
+@noindent
+the @samp{+1m} is a repeater; the intended interpretation is that the task
+has a deadline on @samp{<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 @samp{y}, @samp{m}, @samp{w}, @samp{d} and @samp{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
+
+@example
+DEADLINE: <2005-10-01 Sat +1m -3d>
+@end example
+
+
+@vindex org-todo-repeat-to-state
+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 @samp{DEADLINE} or
+a @samp{SCHEDULED} with the TODO keyword @samp{DONE}, it no longer produces
+entries in the agenda. The problem with this is, however, is that
+then also the @emph{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 as done, using @kbd{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@footnote{In fact, the target state is taken from, in this sequence, the
+@samp{REPEAT_TO_STATE} property, the variable @code{org-todo-repeat-to-state} if
+it is a string, the previous TODO state if @code{org-todo-repeat-to-state}
+is @code{t}, or the first state of the TODO state sequence.}. In the example
+above, setting the state to @samp{DONE} would actually switch the date like
+this:
+
+@example
+** TODO Pay the rent
+ DEADLINE: <2005-11-01 Tue +1m>
+@end example
+
+To mark a task with a repeater as DONE, use @kbd{C-- 1 C-c C-t},
+i.e., @code{org-todo} with a numeric prefix argument of @samp{-1}.
+
+@vindex org-log-repeat
+A timestamp@footnote{You can change this using the option @code{org-log-repeat}, or the
+@samp{STARTUP} options @samp{logrepeat}, @samp{lognoterepeat}, and @samp{nologrepeat}.
+With @samp{lognoterepeat}, you will also be prompted for a note.} 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 @samp{+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
+@emph{after} the last time you did it. For these tasks, Org mode has
+special repeaters @samp{++} and @samp{.+}. For example:
+
+@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 shifts the date to one month after today.
+
+** TODO Wash my hands
+ DEADLINE: <2019-04-05 08:00 Sun .+1h>
+ Marking this DONE shifts the date to exactly one hour from now.
+@end example
+
+@vindex org-agenda-skip-scheduled-if-deadline-is-shown
+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 @code{org-agenda-skip-scheduled-if-deadline-is-shown} to
+@code{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
+@kbd{C-c C-x c} was created for this purpose; it is described in
+@ref{Structure Editing}.
+
+@node Clocking Work Time
+@section Clocking Work Time
+
+@cindex clocking time
+@cindex time clocking
+
+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@footnote{Clocking only works if all headings are indented with less
+than 30 stars. This is a hard-coded limitation of @code{lmax} in
+@code{org-clock-sum}.} 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:
+
+@lisp
+(setq org-clock-persist 'history)
+(org-clock-persistence-insinuate)
+@end lisp
+
+@vindex org-clock-persist
+When you clock into a new task after resuming Emacs, the incomplete
+clock@footnote{To resume the clock under the assumption that you have worked
+on this task while outside Emacs, use @samp{(setq org-clock-persist t)}.} is retrieved (see @ref{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.
+@end menu
+
+@node Clocking commands
+@subsection Clocking commands
+
+@table @asis
+@item @kbd{C-c C-x C-i} (@code{org-clock-in})
+@kindex C-c C-x C-i
+@findex org-clock-in
+@vindex org-clock-into-drawer
+@vindex org-clock-continuously
+@cindex @samp{LOG_INTO_DRAWER}, property
+Start the clock on the current item (clock-in). This inserts the
+@samp{CLOCK} keyword together with a timestamp. If this is not the first
+clocking of this item, the multiple @samp{CLOCK} lines are wrapped into
+a @samp{LOGBOOK} drawer (see also the variable @code{org-clock-into-drawer}).
+You can also overrule the setting of this variable for a subtree by
+setting a @samp{CLOCK_INTO_DRAWER} or @samp{LOG_INTO_DRAWER} property. When
+called with a @kbd{C-u} prefix argument, select the task from
+a list of recently clocked tasks. With two @kbd{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
+@kbd{d} when selecting a clocking task. With three @kbd{C-u C-u C-u} prefixes, force continuous clocking by starting the
+clock when the last clock stopped.
+
+@cindex @samp{CLOCK_MODELINE_TOTAL}, property
+@cindex @samp{LAST_REPEAT}, property
+@vindex org-clock-mode-line-total
+@vindex org-clock-in-prepare-hook
+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 @ref{Effort Estimates}), the mode
+line displays the current clocking time against it@footnote{To add an effort estimate ``on the fly'', hook a function doing
+this to @code{org-clock-in-prepare-hook}.}. If the
+task is a repeating one (see @ref{Repeated tasks}), show only the time
+since the last reset of the task@footnote{The last reset of the task is recorded by the @samp{LAST_REPEAT}
+property.}. You can exercise more
+control over show time with the @samp{CLOCK_MODELINE_TOTAL} property. It
+may have the values @samp{current} to show only the current clocking
+instance, @samp{today} to show all time clocked on this tasks today---see
+also the variable @code{org-extend-today-until}, @code{all} to include all
+time, or @code{auto} which is the default@footnote{See also the variable @code{org-clock-mode-line-total}.}. Clicking with
+@kbd{mouse-1} onto the mode line entry pops up a menu with
+clocking options.
+
+@item @kbd{C-c C-x C-o} (@code{org-clock-out})
+@kindex C-c C-x C-o
+@findex org-clock-out
+@vindex org-log-note-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
+@samp{=>HH:MM}. See the variable @code{org-log-note-clock-out} for the
+possibility to record an additional note together with the clock-out
+timestamp@footnote{The corresponding in-buffer setting is: @samp{#+STARTUP:
+lognoteclock-out}.}.
+
+@item @kbd{C-c C-x C-x} (@code{org-clock-in-last})
+@kindex C-c C-x C-x
+@findex org-clock-in-last
+@vindex org-clock-continuously
+Re-clock the last clocked task. With one @kbd{C-u} prefix
+argument, select the task from the clock history. With two
+@kbd{C-u} prefixes, force continuous clocking by starting the
+clock when the last clock stopped.
+
+@item @kbd{C-c C-x C-e} (@code{org-clock-modify-effort-estimate})
+@kindex C-c C-x C-e
+@findex org-clock-modify-effort-estimate
+Update the effort estimate for the current clock task.
+
+@item @kbd{C-c C-c} or @kbd{C-c C-y} (@code{org-evaluate-time-range})
+@kindex C-c C-c
+@kindex C-c C-y
+@findex 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 @kbd{S-<cursor>} keys, the update is
+automatic.
+
+@item @kbd{C-S-@key{UP}} (@code{org-clock-timestamps-up})
+@itemx @kbd{C-S-@key{DOWN}} (@code{org-clock-timestamps-down})
+@kindex C-S-UP
+@findex org-clock-timestamps-up
+@kindex C-S-DOWN
+@findex org-clock-timestamps-down
+On CLOCK log lines, increase/decrease both timestamps so that the
+clock duration keeps the same value.
+
+@item @kbd{S-M-@key{UP}} (@code{org-timestamp-up})
+@itemx @kbd{S-M-@key{DOWN}} (@code{org-timestamp-down})
+@kindex S-M-UP
+@findex org-clock-timestamp-up
+@kindex S-M-DOWN
+@findex org-clock-timestamp-down
+On @samp{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 @kbd{S-M-@key{UP}} to increase
+a clocked-out timestamp by five minutes, then the clocked-in
+timestamp of the next clock is increased by five minutes.
+
+@item @kbd{C-c C-t} (@code{org-todo})
+@kindex C-c C-t
+@findex org-todo
+Changing the TODO state of an item to DONE automatically stops the
+clock if it is running in this same item.
+
+@item @kbd{C-c C-x C-q} (@code{org-clock-cancel})
+@kindex C-c C-x C-q
+@findex 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.
+
+@item @kbd{C-c C-x C-j} (@code{org-clock-goto})
+@kindex C-c C-x C-j
+@findex or-clock-goto
+Jump to the headline of the currently clocked in task. With
+a @kbd{C-u} prefix argument, select the target task from a list
+of recently clocked tasks.
+
+@item @kbd{C-c C-x C-d} (@code{org-clock-display})
+@kindex C-c C-x C-d
+@findex org-clock-display
+@vindex org-remove-highlights-with-change
+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
+@code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
+@end table
+
+The @kbd{l} key may be used in the agenda (see @ref{Weekly/daily agenda}) to show which tasks have been worked on or closed during
+a day.
+
+@strong{Important:} note that both @code{org-clock-out} and @code{org-clock-in-last}
+can have a global keybinding and do not modify the window disposition.
+
+@node The clock table
+@subsection The clock table
+
+@cindex clocktable, dynamic block
+@cindex report, of clocked time
+
+Org mode can produce quite complex reports based on the time clocking
+information. Such a report is called a @emph{clock table}, because it is
+formatted as one or several Org tables.
+
+@table @asis
+@item @code{org-clock-report}
+@kindex C-c C-x x
+@findex org-clock-report
+Insert or update a clock table. When called with a prefix argument,
+jump to the first clock table in the current document and update it.
+The clock table includes archived trees.
+
+This command can be invoked by calling
+@code{org-dynamic-block-insert-dblock} (@kbd{C-c C-x x}) and
+selecting ``clocktable'' (see @ref{Dynamic Blocks}).
+
+@item @kbd{C-c C-c} or @kbd{C-c C-x C-u} (@code{org-dblock-update})
+@kindex C-c C-c
+@kindex C-c C-x C-u
+@findex org-dblock-update
+Update dynamic block at point. Point needs to be in the @samp{BEGIN}
+line of the dynamic block.
+
+@item @kbd{C-u C-c C-x C-u}
+@kindex C-u C-c C-x C-u
+Update all dynamic blocks (see @ref{Dynamic Blocks}). This is useful if
+you have several clock table blocks in a buffer.
+
+@item @kbd{S-@key{LEFT}}
+@itemx @kbd{S-@key{RIGHT}} (@code{org-clocktable-try-shift})
+@kindex S-LEFT
+@kindex S-RIGHT
+@findex org-clocktable-try-shift
+Shift the current @samp{:block} interval and update the table. Point
+needs to be in the @samp{#+BEGIN: clocktable} line for this command. If
+@samp{:block} is @samp{today}, it is shifted to @samp{today-1}, etc.
+@end table
+
+Here is an example of the frame for a clock table as it is inserted
+into the buffer by @code{org-clock-report}:
+
+@cindex @samp{BEGIN clocktable}
+@example
+#+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
+#+END: clocktable
+@end example
+
+@vindex org-clocktable-defaults
+The @samp{#+BEGIN} line contains options to define the scope, structure,
+and formatting of the report. Defaults for all these options can be
+configured in the variable @code{org-clocktable-defaults}.
+
+First there are options that determine which clock entries are to
+be selected:
+
+@table @asis
+@item @samp{:maxlevel}
+Maximum level depth to which times are listed in the table. Clocks
+at deeper levels are summed into the upper level.
+
+@item @samp{:scope}
+The scope to consider. This can be any of the following:
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{nil}
+@tab the current buffer or narrowed region
+@item @samp{file}
+@tab the full current buffer
+@item @samp{subtree}
+@tab the subtree where the clocktable is located
+@item @samp{treeN}
+@tab the surrounding level N tree, for example @samp{tree3}
+@item @samp{tree}
+@tab the surrounding level 1 tree
+@item @samp{agenda}
+@tab all agenda files
+@item @samp{("file" ...)}
+@tab scan these files
+@item @samp{FUNCTION}
+@tab scan files returned by calling @var{FUNCTION} with no argument
+@item @samp{file-with-archives}
+@tab current file and its archives
+@item @samp{agenda-with-archives}
+@tab all agenda files, including archives
+@end multitable
+
+@item @samp{: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:
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaa}
+@item @samp{2007-12-31}
+@tab New year eve 2007
+@item @samp{2007-12}
+@tab December 2007
+@item @samp{2007-W50}
+@tab ISO-week 50 in 2007
+@item @samp{2007-Q2}
+@tab 2nd quarter in 2007
+@item @samp{2007}
+@tab the year 2007
+@item @samp{today}, @samp{yesterday}, @samp{today-N}
+@tab a relative day
+@item @samp{thisweek}, @samp{lastweek}, @samp{thisweek-N}
+@tab a relative week
+@item @samp{thismonth}, @samp{lastmonth}, @samp{thismonth-N}
+@tab a relative month
+@item @samp{thisyear}, @samp{lastyear}, @samp{thisyear-N}
+@tab a relative year
+@item @samp{untilnow}@footnote{When using @code{:step}, @code{untilnow} starts from the beginning of
+2003, not the beginning of time.}
+@tab all clocked time ever
+@end multitable
+
+@vindex org-clock-display-default-range
+When this option is not set, Org falls back to the value in
+@code{org-clock-display-default-range}, which defaults to the current
+year.
+
+Use @kbd{S-@key{LEFT}} or @kbd{S-@key{RIGHT}} to shift the time
+interval.
+
+@item @samp{:tstart}
+A time string specifying when to start considering times. Relative
+times like @samp{"<-2w>"} can also be used. See @ref{Matching tags and properties} for relative time syntax.
+
+@item @samp{:tend}
+A time string specifying when to stop considering times. Relative
+times like @samp{"<now>"} can also be used. See @ref{Matching tags and properties} for relative time syntax.
+
+@item @samp{:wstart}
+The starting day of the week. The default is 1 for Monday.
+
+@item @samp{:mstart}
+The starting day of the month. The default is 1 for the first.
+
+@item @samp{:step}
+Set to @samp{day}, @samp{week}, @samp{semimonth}, @samp{month}, or @samp{year} to split the
+table into chunks. To use this, either @samp{:block}, or @samp{:tstart} and
+@samp{:tend} are required.
+
+@item @samp{:stepskip0}
+When non-@code{nil}, do not show steps that have zero time.
+
+@item @samp{:fileskip0}
+When non-@code{nil}, do not show table sections from files which did not
+contribute.
+
+@item @samp{:match}
+A tags match to select entries that should contribute. See
+@ref{Matching tags and properties} for the match syntax.
+@end table
+
+@findex org-clocktable-write-default
+Then there are options that determine the formatting of the table.
+There options are interpreted by the function
+@code{org-clocktable-write-default}, but you can specify your own function
+using the @samp{:formatter} parameter.
+
+@table @asis
+@item @samp{:emphasize}
+When non-@code{nil}, emphasize level one and level two items.
+
+@item @samp{:lang}
+Language@footnote{Language terms can be set through the variable
+@code{org-clock-clocktable-language-setup}.} to use for descriptive cells like ``Task''.
+
+@item @samp{:link}
+Link the item headlines in the table to their origins.
+
+@item @samp{:narrow}
+An integer to limit the width of the headline column in the Org
+table. If you write it like @samp{50!}, then the headline is also
+shortened in export.
+
+@item @samp{:indent}
+Indent each headline field according to its level.
+
+@item @samp{:hidefiles}
+Hide the file column when multiple files are used to produce the
+table.
+
+@item @samp{:tcolumns}
+Number of columns to be used for times. If this is smaller than
+@samp{:maxlevel}, lower levels are lumped into one column.
+
+@item @samp{:level}
+Should a level number column be included?
+
+@item @samp{:sort}
+A cons cell containing the column to sort and a sorting type. E.g.,
+@samp{:sort (1 . ?a)} sorts the first column alphabetically.
+
+@item @samp{:compact}
+Abbreviation for @samp{:level nil :indent t :narrow 40! :tcolumns 1}.
+All are overwritten except if there is an explicit @samp{:narrow}.
+
+@item @samp{:timestamp}
+A timestamp for the entry, when available. Look for @samp{SCHEDULED},
+@samp{DEADLINE}, @samp{TIMESTAMP} and @samp{TIMESTAMP_IA} special properties (see
+@ref{Special Properties}), in this order.
+
+@item @samp{:tags}
+When this flag is non-@code{nil}, show the headline's tags.
+
+@item @samp{:properties}
+List of properties shown in the table. Each property gets its own
+column.
+
+@item @samp{:inherit-props}
+When this flag is non-@code{nil}, the values for @samp{:properties} are
+inherited.
+
+@item @samp{:formula}
+Content of a @samp{TBLFM} keyword to be added and evaluated. As
+a special case, @samp{: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.
+
+@item @samp{:formatter}
+A function to format clock data and insert it into the buffer.
+@end table
+
+To get a clock summary of the current level 1 tree, for the current
+day, you could write:
+
+@example
+#+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
+#+END: clocktable
+@end example
+
+@noindent
+To use a specific time range you could write@footnote{Note that all parameters must be specified in a single
+line---the line is broken here only to fit it into the manual.}
+
+@example
+#+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
+ :tend "<2006-08-10 Thu 12:00>"
+#+END: clocktable
+@end example
+
+@noindent
+A range starting a week ago and ending right now could be written as
+
+@example
+#+BEGIN: clocktable :tstart "<-1w>" :tend "<now>"
+#+END: clocktable
+@end example
+
+@noindent
+A summary of the current subtree with % times would be
+
+@example
+#+BEGIN: clocktable :scope subtree :link t :formula %
+#+END: clocktable
+@end example
+
+@noindent
+A horizontally compact representation of everything clocked during
+last week would be
+
+@example
+#+BEGIN: clocktable :scope agenda :block lastweek :compact t
+#+END: clocktable
+@end example
+
+@node Resolving idle time
+@subsection Resolving idle time and continuous clocking
+
+
+
+@anchor{Resolving idle time (1)}
+@subsubheading Resolving idle time
+
+@cindex resolve idle time
+@cindex idle, resolve, dangling
+
+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.
+
+@vindex org-clock-idle-time
+@vindex org-clock-x11idle-program-name
+By customizing the variable @code{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@footnote{On computers using macOS, idleness is based on actual user
+idleness, not just Emacs' idle time. For X11, you can install a
+utility program @samp{x11idle.c}, available in the @samp{org-contrib/}
+repository, or install the xprintidle package and set it to the
+variable @code{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.}, 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:
+
+@table @asis
+@item @kbd{k}
+@kindex k
+To keep some or all of the minutes and stay clocked in, press
+@kbd{k}. Org asks how many of the minutes to keep. Press
+@kbd{@key{RET}} to keep them all, effectively changing nothing, or
+enter a number to keep that many minutes.
+
+@item @kbd{K}
+@kindex K
+If you use the shift key and press @kbd{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.
+
+@item @kbd{s}
+@kindex s
+To keep none of the minutes, use @kbd{s} to subtract all the
+away time from the clock, and then check back in from the moment you
+returned.
+
+@item @kbd{S}
+@kindex S
+To keep none of the minutes and just clock out at the start of the
+away time, use the shift key and press @kbd{S}. Remember that
+using shift always leave you clocked out, no matter which option you
+choose.
+
+@item @kbd{C}
+@kindex C
+To cancel the clock altogether, use @kbd{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.
+@end table
+
+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 @kbd{M-x org-resolve-clocks @key{RET}} (or @kbd{C-c C-x C-z}).
+
+@anchor{Continuous clocking}
+@subsubheading Continuous clocking
+
+@cindex continuous clocking
+
+@vindex org-clock-continuously
+You may want to start clocking from the time when you clocked out the
+previous task. To enable this systematically, set
+@code{org-clock-continuously} to non-@code{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 @code{org-clock-in} and two @kbd{C-u C-u} with
+@code{org-clock-in-last}.
+
+@anchor{Clocking out automatically after some idle time}
+@subsubheading Clocking out automatically after some idle time
+
+@cindex auto clocking out after idle time
+
+@vindex org-clock-auto-clockout-timer
+When you often forget to clock out before being idle and you don't
+want to manually set the clocking time to take into account, you can
+set @code{org-clock-auto-clockout-timer} to a number of seconds and add
+@samp{(org-clock-auto-clockout-insinuate)} to your @samp{.emacs} file.
+
+When the clock is running and Emacs is idle for more than this number
+of seconds, the clock will be clocked out automatically.
+
+Use @samp{M-x org-clock-toggle-auto-clockout RET} to temporarily turn this
+on or off.
+
+@node Effort Estimates
+@section Effort Estimates
+
+@cindex effort estimates
+@cindex @samp{EFFORT}, property
+@vindex org-effort-property
+
+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 @samp{EFFORT}. Multiple
+formats are supported, such as @samp{3:12}, @samp{1:23:45}, or @samp{1d3h5min}; see
+the file @samp{org-duration.el} for more detailed information about the
+format.
+
+You can set the effort for an entry with the following commands:
+
+@table @asis
+@item @kbd{C-c C-x e} (@code{org-set-effort})
+@kindex C-c C-x e
+@findex 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 @kbd{e}
+key.
+
+@item @kbd{C-c C-x C-e} (@code{org-clock-modify-effort-estimate})
+@kindex C-c C-x C-e
+@findex org-clock-modify-effort-estimate
+Modify the effort estimate of the item currently being clocked.
+@end table
+
+Clearly the best way to work with effort estimates is through column
+view (see @ref{Column View}). You should start by setting up discrete
+values for effort estimates, and a @samp{COLUMNS} format that displays
+these values together with clock sums---if you want to clock your
+time. For a specific buffer you can use:
+
+@example
+#+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
+@end example
+
+@noindent
+@vindex org-global-properties
+@vindex org-columns-default-format
+or, even better, you can set up these values globally by customizing
+the variables @code{org-global-properties} and
+@code{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 @kbd{S-@key{RIGHT}} and @kbd{S-@key{LEFT}} 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.
+
+@vindex org-agenda-columns-add-appointments-to-effort-sum
+If you switch to column view in the daily/weekly agenda, the effort
+column summarizes the estimated work effort for each day@footnote{Please note the pitfalls of summing hierarchical data in
+a flat list (see @ref{Agenda Column View}).}, 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 @code{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 @kbd{/} key in the agenda (see @ref{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.
+
+@node Timers
+@section Taking Notes with a Relative Timer
+
+@cindex relative timer
+@cindex countdown 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.
+
+@table @asis
+@item @kbd{C-c C-x 0} (@code{org-timer-start})
+@kindex C-c C-x 0
+@findex org-timer-start
+Start or reset the relative timer. By default, the timer is set
+to 0. When called with a @kbd{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 @kbd{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.
+
+@item @kbd{C-c C-x ;} (@code{org-timer-set-timer})
+@kindex C-c C-x ;
+@findex org-timer-set-timer
+@vindex org-timer-default-timer
+Start a countdown timer. The user is prompted for a duration.
+@code{org-timer-default-timer} sets the default countdown value. Giving
+a numeric prefix argument overrides this default value. This
+command is available as @kbd{;} in agenda buffers.
+@end table
+
+Once started, relative and countdown timers are controlled with the
+same commands.
+
+@table @asis
+@item @kbd{C-c C-x .} (@code{org-timer})
+@kindex C-c C-x .
+@findex org-timer
+Insert a relative time into the buffer. The first time you use
+this, the timer starts. Using a prefix argument restarts it.
+
+@item @kbd{C-c C-x -} (@code{org-timer-item})
+@kindex C-c C-x -
+@findex org-timer-item
+Insert a description list item with the current relative time. With
+a prefix argument, first reset the timer to 0.
+
+@item @kbd{M-@key{RET}} (@code{org-insert-heading})
+@kindex M-RET
+@findex org-insert-heading
+Once the timer list is started, you can also use @kbd{M-@key{RET}} to
+insert new timer items.
+
+@item @kbd{C-c C-x ,} (@code{org-timer-pause-or-continue})
+@kindex C-c C-x ,
+@findex org-timer-pause-or-continue
+Pause the timer, or continue it if it is already paused.
+
+@item @kbd{C-c C-x _} (@code{org-timer-stop})
+@kindex C-c C-x _
+@findex 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.
+@end table
+
+@node Refiling and Archiving
+@chapter Refiling and Archiving
+
+@cindex refiling notes
+@cindex copying notes
+@cindex archiving
+
+Once information is in the system, it may need to be moved around.
+Org provides Refile, Copy and Archive commands for this. Refile and
+Copy helps with moving and copying outlines. Archiving helps to keep
+the system compact and fast.
+
+@menu
+* Refile and Copy:: Moving/copying a tree from one place to another.
+* Archiving:: What to do with finished products.
+@end menu
+
+@node Refile and Copy
+@section Refile and Copy
+
+@cindex refiling notes
+@cindex copying notes
+
+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:
+
+@table @asis
+@item @kbd{C-c C-w} (@code{org-refile})
+@kindex C-c C-w
+@findex org-refile
+@vindex org-reverse-note-order
+@vindex org-refile-targets
+@vindex org-refile-use-outline-path
+@vindex org-outline-path-complete-in-steps
+@vindex org-refile-allow-creating-parent-nodes
+@vindex org-log-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
+@code{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 @code{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 @code{org-refile-use-outline-path} and
+@code{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 @code{org-refile-allow-creating-parent-nodes}. When the
+variable @code{org-log-refile}@footnote{Note the corresponding @samp{STARTUP} options @samp{logrefile},
+@samp{lognoterefile}, and @samp{nologrefile}.} is set, a timestamp or a note is
+recorded whenever an entry is refiled.
+
+@item @kbd{C-u C-c C-w}
+@kindex C-u C-c C-w
+Use the refile interface to jump to a heading.
+
+@item @kbd{C-u C-u C-c C-w} (@code{org-refile-goto-last-stored})
+@kindex C-u C-u C-c C-w
+@findex org-refile-goto-last-stored
+Jump to the location where @code{org-refile} last moved a tree to.
+
+@item @kbd{C-2 C-c C-w}
+@kindex C-2 C-c C-w
+Refile as the child of the item currently being clocked.
+
+@item @kbd{C-3 C-c C-w}
+@kindex C-3 C-c C-w
+@vindex org-refile-keep
+Refile and keep the entry in place. Also see @code{org-refile-keep} to
+make this the default behavior, and beware that this may result in
+duplicated @samp{ID} properties.
+
+@item @kbd{C-0 C-c C-w} or @kbd{C-u C-u C-u C-c C-w} (@code{org-refile-cache-clear})
+@kindex C-u C-u C-u C-c C-w
+@kindex C-0 C-c C-w
+@findex org-refile-cache-clear
+@vindex org-refile-use-cache
+Clear the target cache. Caching of refile targets can be turned on
+by setting @code{org-refile-use-cache}. To make the command see new
+possible targets, you have to clear the cache with this command.
+
+@item @kbd{C-c M-w} (@code{org-refile-copy})
+@kindex C-c M-w
+@findex org-refile-copy
+Copying works like refiling, except that the original note is not
+deleted.
+
+@item @kbd{C-c C-M-w} (@code{org-refile-reverse})
+@kindex C-c C-M-w
+@findex org-refile-reverse
+Works like refiling, except that it temporarily toggles how the
+value of @code{org-reverse-note-order} applies to the current buffer. So
+if @code{org-refile} would append the entry as the last entry under the
+target header, @code{org-refile-reverse} will prepend it as the first
+entry, and vice-versa.
+@end table
+
+@node Archiving
+@section Archiving
+
+@cindex 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.
+
+@table @asis
+@item @kbd{C-c C-x C-a} (@code{org-archive-subtree-default})
+@kindex C-c C-x C-a
+@findex org-archive-subtree-default
+@vindex org-archive-default-command
+Archive the current entry using the command specified in the
+variable @code{org-archive-default-command}.
+@end table
+
+@menu
+* Moving subtrees:: Moving a tree to an archive file.
+* Internal archiving:: Switch off a tree but keep it in the file.
+@end menu
+
+@node Moving subtrees
+@subsection Moving a tree to an archive file
+
+@cindex external archiving
+
+The most common archiving action is to move a project tree to another
+file, the archive file.
+
+@table @asis
+@item @kbd{C-c C-x C-s} or short @kbd{C-c $} (@code{org-archive-subtree})
+@kindex C-c C-x C-s
+@kindex C-c $
+@findex org-archive-subtree
+@vindex org-archive-location
+Archive the subtree starting at point position to the location given
+by @code{org-archive-location}.
+
+@item @kbd{C-u C-c C-x C-s}
+@kindex 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 @emph{not} on a headline when this command
+is invoked, check level 1 trees.
+
+@item @kbd{C-u C-u C-c C-x C-s}
+@kindex 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 @emph{does} contain
+a timestamp, and that timestamp is in the past.
+@end table
+
+@cindex archive locations
+The default archive location is a file in the same directory as the
+current file, with the name derived by appending @samp{_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
+@code{org-archive-location}.
+
+There is also an in-buffer option for setting this variable, for
+example:
+
+@cindex @samp{ARCHIVE}, keyword
+@example
+#+ARCHIVE: %s_done::
+@end example
+
+
+@cindex ARCHIVE, property
+If you would like to have a special archive location for a single
+entry or a (sub)tree, give the entry an @samp{ARCHIVE} property with the
+location as the value (see @ref{Properties and Columns}).
+
+@vindex org-archive-save-context-info
+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
+@code{org-archive-save-context-info} to adjust the amount of information
+added.
+
+@vindex org-archive-subtree-save-file-p
+When @code{org-archive-subtree-save-file-p} is non-@code{nil}, save the target
+archive buffer.
+
+@node Internal archiving
+@subsection Internal archiving
+
+@cindex @samp{ARCHIVE}, tag
+If you want to just switch off---for agenda views---certain subtrees
+without moving them to a different file, you can use the @samp{ARCHIVE}
+tag.
+
+A headline that is marked with the @samp{ARCHIVE} tag (see @ref{Tags}) stays at
+its location in the outline tree, but behaves in the following way:
+
+@itemize
+@item
+@vindex org-cycle-open-archived-trees
+It does not open when you attempt to do so with a visibility cycling
+command (see @ref{Visibility Cycling}). You can force cycling archived
+subtrees with @kbd{C-@key{TAB}}, or by setting the option
+@code{org-cycle-open-archived-trees}. Also normal outline commands, like
+@code{outline-show-all}, open archived subtrees.
+
+@item
+@vindex org-sparse-tree-open-archived-trees
+During sparse tree construction (see @ref{Sparse Trees}), matches in
+archived subtrees are not exposed, unless you configure the option
+@code{org-sparse-tree-open-archived-trees}.
+
+@item
+@vindex org-agenda-skip-archived-trees
+During agenda view construction (see @ref{Agenda Views}), the content of
+archived trees is ignored unless you configure the option
+@code{org-agenda-skip-archived-trees}, in which case these trees are
+always included. In the agenda you can press @kbd{v a} to get
+archives temporarily included.
+
+@item
+@vindex org-export-with-archived-trees
+Archived trees are not exported (see @ref{Exporting}), only the headline
+is. Configure the details using the variable
+@code{org-export-with-archived-trees}.
+
+@item
+@vindex org-columns-skip-archived-trees
+Archived trees are excluded from column view unless the variable
+@code{org-columns-skip-archived-trees} is configured to @code{nil}.
+@end itemize
+
+The following commands help manage the @samp{ARCHIVE} tag:
+
+@table @asis
+@item @kbd{C-c C-x a} (@code{org-toggle-archive-tag})
+@kindex C-c C-x a
+@findex 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.
+
+@item @kbd{C-u C-c C-x a}
+@kindex 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 @samp{ARCHIVE} tag for the
+child. If point is @emph{not} on a headline when this command is
+invoked, check the level 1 trees.
+
+@item @kbd{C-c C-@key{TAB}} (@code{org-force-cycle-archived})
+@kindex C-TAB
+Cycle a tree even if it is tagged with @samp{ARCHIVE}.
+
+@item @kbd{C-c C-x A} (@code{org-archive-to-archive-sibling})
+@kindex C-c C-x A
+@findex org-archive-to-archive-sibling
+Move the current entry to the @emph{Archive Sibling}. This is a sibling
+of the entry with the heading @samp{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.
+@end table
+
+@node Capture and Attachments
+@chapter Capture and Attachments
+
+@cindex capture
+@cindex attachments
+@cindex RSS feeds
+@cindex Atom feeds
+@cindex protocols, for external access
+
+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 @emph{capture}. It also can
+store files related to a task (@emph{attachments}) in a special directory.
+Finally, it can parse RSS feeds for information. To learn how to let
+external programs (for example a web browser) trigger Org to capture
+material, see @ref{Protocols}.
+
+@menu
+* Capture:: Capturing new stuff.
+* Attachments:: Attach files to outlines.
+* RSS Feeds:: Getting input from RSS feeds.
+@end menu
+
+@node Capture
+@section Capture
+
+@cindex 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.
+@end menu
+
+@node Setting up capture
+@subsection Setting up capture
+
+The following customization sets a default target file for notes.
+
+@vindex org-default-notes-file
+@lisp
+(setq org-default-notes-file (concat org-directory "/notes.org"))
+@end lisp
+
+You may also define a global key for capturing new material (see
+@ref{Activation}).
+
+@node Using capture
+@subsection Using capture
+
+@table @asis
+@item @kbd{M-x org-capture} (@code{org-capture})
+@findex org-capture
+@cindex date tree
+Display the capture templates menu. If you have templates defined
+(see @ref{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.
+
+@item @kbd{C-c C-c} (@code{org-capture-finalize})
+@kindex C-c C-c @r{(Capture buffer)}
+@findex org-capture-finalize
+Once you have finished entering information into the capture buffer,
+@kbd{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.
+
+@item @kbd{C-c C-w} (@code{org-capture-refile})
+@kindex C-c C-w @r{(Capture buffer)}
+@findex org-capture-refile
+Finalize the capture process by refiling the note to a different
+place (see @ref{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 @code{org-refile} command.
+
+@item @kbd{C-c C-k} (@code{org-capture-kill})
+@kindex C-c C-k @r{(Capture buffer)}
+@findex org-capture-kill
+Abort the capture process and return to the previous state.
+@end table
+
+@kindex k c @r{(Agenda)}
+You can also call @code{org-capture} in a special way from the agenda,
+using the @kbd{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 @code{org-capture}
+with prefix commands:
+
+@table @asis
+@item @kbd{C-u M-x org-capture}
+Visit the target location of a capture template. You get to select
+the template in the usual way.
+
+@item @kbd{C-u C-u M-x org-capture}
+Visit the last stored capture item in its buffer.
+@end table
+
+@vindex org-capture-bookmark
+@vindex org-capture-last-stored
+You can also jump to the bookmark @code{org-capture-last-stored}, which is
+automatically created unless you set @code{org-capture-bookmark} to @code{nil}.
+
+To insert the capture at point in an Org buffer, call @code{org-capture}
+with a @kbd{C-0} prefix argument.
+
+@node Capture templates
+@subsection Capture templates
+
+@cindex templates, for Capture
+
+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.
+
+@table @asis
+@item @kbd{C}
+@kindex C @r{(Capture menu}
+@vindex org-capture-templates
+Customize the variable @code{org-capture-templates}.
+@end table
+
+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 @samp{Tasks} in your file @samp{~/org/gtd.org}. Also, a date tree in
+the file @samp{journal.org} should capture journal entries. A possible
+configuration would look like:
+
+@lisp
+(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")))
+@end lisp
+
+If you then press @kbd{t} from the capture menu, Org will prepare
+the template for you like this:
+
+@example
+* TODO
+ [[file:LINK TO WHERE YOU INITIATED CAPTURE]]
+@end example
+
+@noindent
+During expansion of the template, @samp{%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 @kbd{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:
+
+@lisp
+(define-key global-map (kbd "C-c x")
+ (lambda () (interactive) (org-capture nil "x")))
+@end lisp
+
+@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.
+@end menu
+
+@node Template elements
+@subsubsection Template elements
+
+Now lets look at the elements of a template definition. Each entry in
+@code{org-capture-templates} is a list with the following items:
+
+@table @asis
+@item keys
+The keys that selects the template, as a string, characters only,
+for example @samp{"a"}, for a template to be selected with a single key,
+or @samp{"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:
+
+@lisp
+("b" "Templates for marking stuff to buy")
+@end lisp
+
+If you do not define a template for the @kbd{C} key, this key
+opens the Customize buffer for this complex variable.
+
+@item description
+A short string describing the template, shown during selection.
+
+@item type
+The type of entry, a symbol. Valid values are:
+
+@table @asis
+@item @code{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 @code{item}
+A plain list item, placed in the first plain list at the target
+location. Again the target file should be an Org file.
+
+@item @code{checkitem}
+A checkbox item. This only differs from the plain list item by
+the default template.
+
+@item @code{table-line}
+A new line in the first table at the target location. Where
+exactly the line will be inserted depends on the properties
+@code{:prepend} and @code{:table-line-pos} (see below).
+
+@item @code{plain}
+Text to be inserted as it is.
+@end table
+
+@item target
+@vindex org-default-notes-file
+@vindex org-directory
+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
+@code{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 @code{org-directory}.
+
+Valid values are:
+
+@table @asis
+@item @samp{(file "path/to/file")}
+Text will be placed at the beginning or end of that file.
+
+@item @samp{(id "id of existing org entry")}
+Filing as child of this entry, or in the body of the entry.
+
+@item @samp{(file+headline "filename" "node headline")}
+Fast configuration if the target heading is unique in the file.
+
+@item @samp{(file+olp "filename" "Level 1 heading" "Level 2" ...)}
+For non-unique headings, the full path is safer.
+
+@item @samp{(file+regexp "filename" "regexp to find location")}
+Use a regular expression to position point.
+
+@item @samp{(file+olp+datetree "filename" [ "Level 1 heading" ...])}
+This target@footnote{Org used to offer four different targets for date/week tree
+capture. Now, Org automatically translates these to use
+@code{file+olp+datetree}, applying the @code{:time-prompt} and @code{:tree-type}
+properties. Please rewrite your date/week-tree targets using
+@code{file+olp+datetree} since the older targets are now deprecated.} creates a heading in a date tree@footnote{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.} 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 @code{:time-prompt} and @code{:tree-type} properties
+below for additional options.
+
+@item @samp{(file+function "filename" function-finding-location)}
+A function to find the right location in the file.
+
+@item @samp{(clock)}
+File to the entry that is currently being clocked.
+
+@item @samp{(function function-finding-location)}
+Most general way: write your own function which both visits the
+file and moves point to the right location.
+@end table
+
+@item 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. You may also get this
+template string from a file@footnote{When the file name is not absolute, Org assumes it is relative
+to @code{org-directory}.}, or dynamically, from a function
+using either syntax:
+
+@example
+(file "/path/to/template-file")
+(function FUNCTION-RETURNING-THE-TEMPLATE)
+@end example
+
+@item properties
+The rest of the entry is a property list of additional options.
+Recognized properties are:
+
+@table @asis
+@item @code{:prepend}
+Normally new captured information will be appended at the target
+location (last child, last table line, last list item, @dots{}).
+Setting this property changes that.
+
+@item @code{: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.
+
+@item @code{:jump-to-captured}
+When set, jump to the captured entry when finished.
+
+@item @code{: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.
+
+@item @code{:empty-lines-after}
+Set this to the number of lines that should be inserted after the
+new item. Overrides @code{:empty-lines} for the number of lines
+inserted after.
+
+@item @code{:empty-lines-before}
+Set this to the number of lines that should be inserted before the
+new item. Overrides @code{:empty-lines} for the number lines inserted
+before.
+
+@item @code{:clock-in}
+Start the clock in this item.
+
+@item @code{:clock-keep}
+Keep the clock running when filing the captured entry.
+
+@item @code{:clock-resume}
+If starting the capture interrupted a clock, restart that clock
+when finished with the capture. Note that @code{:clock-keep} has
+precedence over @code{:clock-resume}. When setting both to non-@code{nil},
+the current clock will run and the previous one will not be
+resumed.
+
+@item @code{: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 @code{org-capture} with
+a @kbd{C-1} prefix argument.
+
+@item @code{:tree-type}
+Use @code{week} to make a week tree instead of the month-day tree,
+i.e., place the headings for each day under a heading with the
+current ISO week. Use @code{month} to group entries by month
+only. Default is to group entries by day.
+
+@item @code{: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.
+
+@item @code{:table-line-pos}
+Specification of the location in the table where the new line
+should be inserted. It should be a string like @samp{II-3} meaning
+that the new line should become the third line before the second
+horizontal separator line.
+
+@item @code{:kill-buffer}
+If the target file was not yet visited when capture was invoked,
+kill the buffer again after capture is completed.
+
+@item @code{:no-save}
+Do not save the target file after finishing the capture.
+
+@item ~:refile-targets
+Temporarily set @code{org-refile-targets} to the
+value of this property.
+@end table
+@end table
+
+@node Template expansion
+@subsubsection Template expansion
+
+In the template itself, special ``%-escapes''@footnote{If you need one of these sequences literally, escape the @samp{%}
+with a backslash.} allow dynamic
+insertion of content. The templates are expanded in the order given
+here:
+
+@table @asis
+@item @samp{%[FILE]}
+Insert the contents of the file given by @var{FILE}.
+
+@item @samp{%(EXP)}
+Evaluate Elisp expression @var{EXP} and replace it with the
+result. The @var{EXP} form must return a string. Only
+placeholders pre-existing within the template, or introduced with
+@samp{%[file]}, are expanded this way. Since this happens after
+expanding non-interactive ``%-escapes'', those can be used to fill the
+expression.
+
+@item @samp{%<FORMAT>}
+The result of format-time-string on the @var{FORMAT}
+specification.
+
+@item @samp{%t}
+Timestamp, date only.
+
+@item @samp{%T}
+Timestamp, with date and time.
+
+@item @samp{%u}, @samp{%U}
+Like @samp{%t}, @samp{%T} above, but inactive timestamps.
+
+@item @samp{%i}
+Initial content, the region when capture is called while the region
+is active. If there is text before @samp{%i} on the same line, such as
+indentation, and @samp{%i} is not inside a @samp{%(exp)} form, that prefix is
+added before every line in the inserted text.
+
+@item @samp{%a}
+Annotation, normally the link created with @code{org-store-link}.
+
+@item @samp{%A}
+Like @samp{%a}, but prompt for the description part.
+
+@item @samp{%l}
+Like @samp{%a}, but only insert the literal link.
+
+@item @samp{%L}
+Like @samp{%l}, but without brackets (the link content itself).
+
+@item @samp{%c}
+Current kill ring head.
+
+@item @samp{%x}
+Content of the X clipboard.
+
+@item @samp{%k}
+Title of the currently clocked task.
+
+@item @samp{%K}
+Link to the currently clocked task.
+
+@item @samp{%n}
+User name (taken from @code{user-full-name}).
+
+@item @samp{%f}
+File visited by current buffer when org-capture was called.
+
+@item @samp{%F}
+Full path of the file or directory visited by current buffer.
+
+@item @samp{%:keyword}
+Specific information for certain link types, see below.
+
+@item @samp{%^g}
+Prompt for tags, with completion on tags in target file.
+
+@item @samp{%^G}
+Prompt for tags, with completion all tags in all agenda files.
+
+@item @samp{%^t}
+Like @samp{%t}, but prompt for date. Similarly @samp{%^T}, @samp{%^u}, @samp{%^U}. You
+may define a prompt like @samp{%^@{Birthday@}t}.
+
+@item @samp{%^C}
+Interactive selection of which kill or clip to use.
+
+@item @samp{%^L}
+Like @samp{%^C}, but insert as link.
+
+@item @samp{%^@{PROP@}p}
+Prompt the user for a value for property @var{PROP}. You may
+specify a default value with @samp{%^@{PROP|default@}}.
+
+@item @samp{%^@{PROMPT@}}
+Prompt the user for a string and replace this sequence with it. You
+may specify a default value and a completion table with
+@samp{%^@{prompt|default|completion2|completion3...@}}. The arrow keys
+access a prompt-specific history.
+
+@item @samp{%\N}
+Insert the text entered at the @var{N}th @samp{%^@{PROMPT@}}, where
+@var{N} is a number, starting from 1.
+
+@item @samp{%?}
+After completing the template, position point here.
+@end table
+
+@vindex org-store-link-props
+For specific link types, the following keywords are defined@footnote{If you define your own link types (see @ref{Adding Hyperlink Types}), any property you store with @code{org-store-link-props} can be
+accessed in capture templates in a similar way.}:
+
+@vindex org-link-from-user-regexp
+@multitable {aaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@headitem Link type
+@tab Available keywords
+@item bbdb
+@tab @samp{%:name}, @samp{%:company}
+@item irc
+@tab @samp{%:server}, @samp{%:port}, @samp{%:nick}
+@item mh, rmail
+@tab @samp{%:type}, @samp{%:subject}, @samp{%:message-id}
+@item
+@tab @samp{%:from}, @samp{%:fromname}, @samp{%:fromaddress}
+@item
+@tab @samp{%:to}, @samp{%:toname}, @samp{%:toaddress}
+@item
+@tab @samp{%:date} (message date header field)
+@item
+@tab @samp{%:date-timestamp} (date as active timestamp)
+@item
+@tab @samp{%:date-timestamp-inactive} (date as inactive timestamp)
+@item
+@tab @samp{%:fromto} (either ``to NAME'' or ``from NAME'')@footnote{This is always the other, not the user. See the variable
+@code{org-link-from-user-regexp}.}
+@item gnus
+@tab @samp{%:group}, for messages also all email fields
+@item w3, w3m
+@tab @samp{%:url}
+@item info
+@tab @samp{%:file}, @samp{%:node}
+@item calendar
+@tab @samp{%:date}
+@item org-protocol
+@tab @samp{%:link}, @samp{%:description}, @samp{%:annotation}
+@end multitable
+
+@node Templates in contexts
+@subsubsection Templates in contexts
+
+@vindex org-capture-templates-contexts
+To control whether a capture template should be accessible from
+a specific context, you can customize
+@code{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:
+
+@lisp
+(setq org-capture-templates-contexts
+ '(("p" ((in-mode . "message-mode")))))
+@end lisp
+
+You can also tell that the command key @kbd{p} should refer to
+another template. In that case, add this command key like this:
+
+@lisp
+(setq org-capture-templates-contexts
+ '(("p" "q" ((in-mode . "message-mode")))))
+@end lisp
+
+See the docstring of the variable for more information.
+
+@node Attachments
+@section Attachments
+
+@cindex attachments
+
+It is often useful to associate reference material with an outline
+node. Small chunks of plain text can simply be stored in the subtree
+of a project. Hyperlinks (see @ref{Hyperlinks}) can establish associations
+with files that live elsewhere on a local, or even remote, computer,
+like emails or source code files belonging to a project.
+
+Another method is @emph{attachments}, which are files located in a
+directory belonging to an outline node. Org uses directories either
+named by a unique ID of each entry, or by a @samp{DIR} property.
+
+@menu
+* Attachment defaults and dispatcher:: How to access attachment commands
+* Attachment options:: Configuring the attachment system
+* Attachment links:: Hyperlink access to attachments
+* Automatic version-control with Git:: Everything safely stored away
+* Attach from Dired:: Using dired to select an attachment
+@end menu
+
+@node Attachment defaults and dispatcher
+@subsection Attachment defaults and dispatcher
+
+By default, Org attach uses ID properties when adding attachments to
+outline nodes. This makes working with attachments fully automated.
+There is no decision needed for folder-name or location. ID-based
+directories are by default located in the @samp{data/} directory, which
+lives in the same directory where your Org file lives@footnote{If you move entries or Org files from one directory to
+another, you may want to configure @code{org-attach-id-dir} to contain
+an absolute path.}.
+
+When attachments are made using @code{org-attach} a default tag @samp{ATTACH} is
+added to the node that gets the attachments.
+
+For more control over the setup, see @ref{Attachment options}.
+
+The following commands deal with attachments:
+
+@table @asis
+@item @kbd{C-c C-a} (@code{org-attach})
+@kindex C-c C-a
+@findex 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:
+
+@table @asis
+@item @kbd{a} (@code{org-attach-attach})
+@kindex C-c C-a a
+@findex org-attach-attach
+@vindex org-attach-method
+Select a file and move it into the task's attachment directory.
+The file is copied, moved, or linked, depending on
+@code{org-attach-method}. Note that hard links are not supported on
+all systems.
+
+@item @kbd{c}/@kbd{m}/@kbd{l}
+@kindex C-c C-a c
+@kindex C-c C-a m
+@kindex C-c C-a l
+Attach a file using the copy/move/link method. Note that hard
+links are not supported on all systems.
+
+@item @kbd{b} (@code{org-attach-buffer})
+@kindex C-c C-a b
+@findex org-attach-buffer
+Select a buffer and save it as a file in the task's attachment
+directory.
+
+@item @kbd{n} (@code{org-attach-new})
+@kindex C-c C-a n
+@findex org-attach-new
+Create a new attachment as an Emacs buffer.
+
+@item @kbd{z} (@code{org-attach-sync})
+@kindex C-c C-a z
+@findex org-attach-sync
+Synchronize the current task with its attachment directory, in
+case you added attachments yourself.
+
+@item @kbd{o} (@code{org-attach-open})
+@kindex C-c C-a o
+@findex org-attach-open
+@vindex org-file-apps
+Open current task's attachment. If there is more than one, prompt
+for a file name first. Opening follows the rules set by
+@code{org-file-apps}. For more details, see the information on
+following hyperlinks (see @ref{Handling Links}).
+
+@item @kbd{O} (@code{org-attach-open-in-emacs})
+@kindex C-c C-a O
+@findex org-attach-open-in-emacs
+Also open the attachment, but force opening the file in Emacs.
+
+@item @kbd{f} (@code{org-attach-reveal})
+@kindex C-c C-a f
+@findex org-attach-reveal
+Open the current task's attachment directory.
+
+@item @kbd{F} (@code{org-attach-reveal-in-emacs})
+@kindex C-c C-a F
+@findex org-attach-reveal-in-emacs
+Also open the directory, but force using Dired in Emacs.
+
+@item @kbd{d} (@code{org-attach-delete-one})
+@kindex C-c C-a d
+Select and delete a single attachment.
+
+@item @kbd{D} (@code{org-attach-delete-all})
+@kindex C-c C-a D
+Delete all of a task's attachments. A safer way is to open the
+directory in Dired and delete from there.
+
+@item @kbd{s} (@code{org-attach-set-directory})
+@kindex C-c C-a s
+@cindex @samp{DIR}, property
+Set a specific directory as the entry's attachment directory.
+This works by putting the directory path into the @samp{DIR}
+property.
+
+@item @kbd{S} (@code{org-attach-unset-directory})
+@kindex C-c C-a S
+@cindex @samp{DIR}, property
+Remove the attachment directory. This command removes the @samp{DIR}
+property and asks the user to either move content inside that
+folder, if an @samp{ID} property is set, delete the content, or to
+leave the attachment directory as is but no longer attached to the
+outline node.
+@end table
+@end table
+
+@node Attachment options
+@subsection Attachment options
+
+There are a couple of options for attachments that are worth
+mentioning.
+
+@table @asis
+@item @code{org-attach-id-dir}
+@vindex org-attach-id-dir
+The directory where attachments are stored when @samp{ID} is used as
+method.
+
+@item @code{org-attach-dir-relative}
+@vindex org-attach-dir-relative
+When setting the @samp{DIR} property on a node using @kbd{C-c C-a s}
+(@code{org-attach-set-directory}), absolute links are entered by default.
+This option changes that to relative links.
+
+@item @code{org-attach-use-inheritance}
+@vindex org-attach-use-inheritance
+By default folders attached to an outline node are inherited from
+parents according to @code{org-use-property-inheritance}. If one instead
+want to set inheritance specifically for Org attach that can be done
+using @code{org-attach-use-inheritance}. Inheriting documents through
+the node hierarchy makes a lot of sense in most cases. Especially
+when using attachment links (see @ref{Attachment links}). The following
+example shows one use case for attachment inheritance:
+
+@example
+* Chapter A ...
+ :PROPERTIES:
+ :DIR: Chapter A/
+ :END:
+** Introduction
+Some text
+
+#+NAME: Image 1
+[[attachment:image 1.jpg]]
+@end example
+
+Without inheritance one would not be able to resolve the link to
+@samp{image 1.jpg}, since the link is inside a sub-heading to @samp{Chapter
+ A}.
+
+Inheritance works the same way for both @samp{ID} and @samp{DIR} property. If
+both properties are defined on the same headline then @samp{DIR} takes
+precedence. This is also true if inheritance is enabled. If @samp{DIR}
+is inherited from a parent node in the outline, that property still
+takes precedence over an @samp{ID} property defined on the node itself.
+
+@item @code{org-attach-method}
+@vindex org-attach-method
+When attaching files using the dispatcher @kbd{C-c C-a} it
+defaults to copying files. The behavior can be changed by
+customizing @code{org-attach-method}. Options are Copy, Move/Rename,
+Hard link or Symbolic link.
+
+@item @code{org-attach-preferred-new-method}
+@vindex org-attach-preferred-new-method
+This customization lets you choose the default way to attach to
+nodes without existing @samp{ID} and @samp{DIR} property. It defaults to @code{id}
+but can also be set to @code{dir}, @code{ask} or @code{nil}.
+
+@item @code{org-attach-archive-delete}
+@vindex org-attach-archive-delete
+Configure this to determine if attachments should be deleted or not
+when a subtree that has attachments is archived.
+
+@item @code{org-attach-auto-tag}
+@vindex org-attach-auto-tag
+When attaching files to a heading it will be assigned a tag
+according to what is set here.
+
+@item @code{org-attach-id-to-path-function-list}
+@vindex org-attach-id-to-path-function-list
+When @samp{ID} is used for attachments, the ID is parsed into a part of a
+directory-path. See @code{org-attach-id-uuid-folder-format} for the
+default function. Define a new one and add it as first element in
+@code{org-attach-id-to-path-function-list} if you want the folder
+structure in any other way. All functions in this list will be
+tried when resolving existing ID's into paths, to maintain backward
+compatibility with existing folders in your system.
+
+@item @code{org-attach-store-link-p}
+@vindex org-attach-store-link-p
+Stores a link to the file that is being attached. The link is
+stored in @code{org-stored-links} for later insertion with @kbd{C-c C-l} (see @ref{Handling Links}). Depending on what option is set in
+@code{org-attach-store-link-p}, the link is stored to either the original
+location as a file link, the attachment location as an attachment
+link or to the attachment location as a file link.
+
+@item @code{org-attach-commands}
+@vindex org-attach-commands
+List of all commands used in the attach dispatcher.
+
+@item @code{org-attach-expert}
+@vindex org-attach-expert
+Do not show the splash buffer with the attach dispatcher when
+@code{org-attach-expert} is set to non-@code{nil}.
+@end table
+
+See customization group @samp{Org Attach} if you want to change the
+default settings.
+
+@node Attachment links
+@subsection Attachment links
+
+Attached files and folders can be referenced using attachment links.
+This makes it easy to refer to the material added to an outline node.
+Especially if it was attached using the unique ID of the entry!
+
+@example
+* TODO Some task
+ :PROPERTIES:
+ :ID: 95d50008-c12e-479f-a4f2-cc0238205319
+ :END:
+See attached document for more information: [[attachment:info.org]]
+@end example
+
+See @ref{External Links} for more information about these links.
+
+@node Automatic version-control with Git
+@subsection Automatic version-control with Git
+
+If the directory attached to an outline node is a Git repository, Org
+can be configured to automatically commit changes to that repository
+when it sees them.
+
+To make Org mode take care of versioning of attachments for you, add
+the following to your Emacs config:
+
+@lisp
+(require 'org-attach-git)
+@end lisp
+
+@node Attach from Dired
+@subsection Attach from Dired
+
+@cindex attach from Dired
+@findex org-attach-dired-to-subtree
+
+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,
+@kbd{M-x org-attach-dired-to-subtree} attaches the file to the
+subtree using the attachment method set by variable
+@code{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 @kbd{C-c C-x a} attach files in Dired buffers.
+
+@lisp
+(add-hook 'dired-mode-hook
+ (lambda ()
+ (define-key dired-mode-map
+ (kbd "C-c C-x a")
+ #'org-attach-dired-to-subtree)))
+@end lisp
+
+The following code shows how to bind the previous command with
+a specific attachment method.
+
+@lisp
+(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))))))
+@end lisp
+
+@node RSS Feeds
+@section RSS Feeds
+
+@cindex RSS feeds
+@cindex Atom 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 @code{org-feed-alist}. The docstring of this
+variable has detailed information. With the following
+
+@lisp
+(setq org-feed-alist
+ '(("Slashdot"
+ "https://rss.slashdot.org/Slashdot/slashdot"
+ "~/txt/org/feeds.org" "Slashdot Entries")))
+@end lisp
+
+@noindent
+new items from the feed provided by @samp{rss.slashdot.org} result in new
+entries in the file @samp{~/org/feeds.org} under the heading @samp{Slashdot
+Entries}, whenever the following command is used:
+
+@table @asis
+@item @kbd{C-c C-x g} (@code{org-feed-update-all})
+@kindex C-c C-x g
+Collect items from the feeds configured in @code{org-feed-alist} and act
+upon them.
+
+@item @kbd{C-c C-x G} (@code{org-feed-goto-inbox})
+@kindex C-c C-x G
+Prompt for a feed name and go to the inbox configured for this feed.
+@end table
+
+Under the same headline, Org creates a drawer @samp{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
+@samp{org-feed.el} and the docstring of @code{org-feed-alist}.
+
+@node Agenda Views
+@chapter Agenda Views
+
+@cindex 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:
+
+@itemize
+@item
+an @emph{agenda} that is like a calendar and shows information for
+specific dates,
+
+@item
+a @emph{TODO list} that covers all unfinished action items,
+
+@item
+a @emph{match view}, showings headlines based on the tags, properties,
+and TODO state associated with them,
+
+@item
+a @emph{text search view} that shows all entries from multiple files that
+contain specified keywords,
+
+@item
+a @emph{stuck projects view} showing projects that currently do not move
+along, and
+
+@item
+@emph{custom views} that are special searches and combinations of
+different views.
+@end itemize
+
+The extracted information is displayed in a special @emph{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.
+
+@vindex org-agenda-skip-comment-trees
+@vindex org-agenda-skip-archived-trees
+@cindex commented entries, in agenda views
+@cindex archived entries, in agenda views
+By default, the report ignores commented (see @ref{Comment Lines}) and
+archived (see @ref{Internal archiving}) entries. You can override this by
+setting @code{org-agenda-skip-comment-trees} and
+@code{org-agenda-skip-archived-trees} to @code{nil}.
+
+@vindex org-agenda-window-setup
+@vindex org-agenda-restore-windows-after-quit
+Two variables control how the agenda buffer is displayed and whether
+the window configuration is restored when the agenda exits:
+@code{org-agenda-window-setup} and @code{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.
+@end menu
+
+@node Agenda Files
+@section Agenda Files
+
+@cindex agenda files
+@cindex files for agenda
+
+@vindex org-agenda-files
+The information to be shown is normally collected from all @emph{agenda
+files}, the files listed in the variable @code{org-agenda-files}@footnote{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.}.
+If a directory is part of this list, all files with the extension
+@samp{.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@footnote{When using the dispatcher, pressing @kbd{<} before
+selecting a command actually limits the command to the current file,
+and ignores @code{org-agenda-files} until the next dispatcher command.}. You can customize @code{org-agenda-files},
+but the easiest way to maintain it is through the following commands
+
+@table @asis
+@item @kbd{C-c [} (@code{org-agenda-file-to-front})
+@kindex C-c [
+@findex org-agenda-file-to-front
+@cindex files, adding to agenda list
+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.
+
+@item @kbd{C-c ]} (@code{org-remove-file})
+@kindex C-c ]
+@findex org-remove-file
+Remove current file from the list of agenda files.
+
+@item @kbd{C-'}
+@itemx @kbd{C-,} (@code{org-cycle-agenda-files})
+@kindex C-'
+@kindex C-,
+@findex org-cycle-agenda-files
+@cindex cycling, of agenda files
+Cycle through agenda file list, visiting one file after the other.
+
+@item @kbd{M-x org-switchb}
+@findex org-switchb
+Command to use an Iswitchb-like interface to switch to and between
+Org buffers.
+@end table
+
+@noindent
+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 @kbd{<} once or several times in
+the dispatcher (see @ref{Agenda Dispatcher}). To restrict the agenda
+scope for an extended period, use the following commands:
+
+@table @asis
+@item @kbd{C-c C-x <} (@code{org-agenda-set-restriction-lock})
+@kindex C-c C-x <
+@findex 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 @kbd{C-c C-x >}, or by typing
+either @kbd{<} or @kbd{>} in the agenda dispatcher. If
+there is a window displaying an agenda view, the new restriction
+takes effect immediately.
+
+@item @kbd{C-c C-x >} (@code{org-agenda-remove-restriction-lock})
+@kindex C-c C-x >
+@findex org-agenda-remove-restriction-lock
+Remove the restriction created by @kbd{C-c C-x <}.
+@end table
+
+When working with Speedbar, you can use the following commands in the
+Speedbar frame:
+
+@table @asis
+@item @kbd{<} (@code{org-speedbar-set-agenda-restriction})
+@findex 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.
+
+@item @kbd{>} (@code{org-agenda-remove-restriction-lock})
+@findex org-agenda-remove-restriction-lock
+Remove the restriction.
+@end table
+
+@node Agenda Dispatcher
+@section The Agenda Dispatcher
+
+@cindex agenda dispatcher
+@cindex dispatching agenda commands
+
+The views are created through a dispatcher, accessible with @kbd{M-x org-agenda}, or, better, bound to a global key (see @ref{Activation}).
+It displays a menu from which an additional letter is required to
+execute a command. The dispatcher offers the following default
+commands:
+
+@table @asis
+@item @kbd{a}
+Create the calendar-like agenda (see @ref{Weekly/daily agenda}).
+
+@item @kbd{t}
+@itemx @kbd{T}
+Create a list of all TODO items (see @ref{Global TODO list}).
+
+@item @kbd{m}
+@itemx @kbd{M}
+Create a list of headlines matching a given expression (see
+@ref{Matching tags and properties}).
+
+@item @kbd{s}
+@kindex s @r{(Agenda dispatcher)}
+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.
+
+@item @kbd{/}
+@kindex / @r{(Agenda dispatcher)}
+@vindex org-agenda-text-search-extra-files
+Search for a regular expression in all agenda files and additionally
+in the files listed in @code{org-agenda-text-search-extra-files}. This
+uses the Emacs command @code{multi-occur}. A prefix argument can be used
+to specify the number of context lines for each match, default is
+@enumerate
+@item
+@end enumerate
+
+@item @kbd{#}
+Create a list of stuck projects (see @ref{Stuck projects}).
+
+@item @kbd{!}
+Configure the list of stuck projects (see @ref{Stuck projects}).
+
+@item @kbd{<}
+@kindex < @r{(Agenda dispatcher)}
+Restrict an agenda command to the current buffer@footnote{For backward compatibility, you can also press @kbd{1} to
+restrict to the current buffer.}. If
+narrowing is in effect restrict to the narrowed part of the buffer.
+After pressing @kbd{<}, you still need to press the character
+selecting the command.
+
+@item @kbd{< <}
+@kindex < < @r{(Agenda dispatcher)}
+If there is an active region, restrict the following agenda command
+to the region. Otherwise, restrict it to the current
+subtree@footnote{For backward compatibility, you can also press @kbd{0} to
+restrict to the current region/subtree.}. After pressing @kbd{< <}, you still need to
+press the character selecting the command.
+
+@item @kbd{*}
+@kindex * @r{(Agenda dispatcher)}
+@vindex org-agenda-sticky
+@findex org-toggle-sticky-agenda
+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
+@code{org-agenda-sticky}). With sticky agendas, the dispatcher only
+switches to the selected view, you need to update it by hand with
+@kbd{r} or @kbd{g}. You can toggle sticky agenda view any
+time with @code{org-toggle-sticky-agenda}.
+@end table
+
+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 @ref{Custom Agenda Views}.
+
+@node Built-in Agenda Views
+@section 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.
+@end menu
+
+@node Weekly/daily agenda
+@subsection Weekly/daily agenda
+
+@cindex agenda
+@cindex weekly agenda
+@cindex daily agenda
+
+The purpose of the weekly/daily @emph{agenda} is to act like a page of
+a paper agenda, showing all the tasks for the current week or day.
+
+@table @asis
+@item @kbd{M-x org-agenda a} (@code{org-agenda-list})
+@kindex a @r{(Agenda dispatcher)}
+@findex org-agenda-list
+@cindex org-agenda, command
+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@footnote{For backward compatibility, the universal prefix argument
+@kbd{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 @ref{Block agenda}).}---like @kbd{C-u 2 1 M-x org-agenda a}---you may
+set the number of days to be displayed.
+@end table
+
+@vindex org-agenda-span
+@vindex org-agenda-start-day
+@vindex org-agenda-start-on-weekday
+The default number of days displayed in the agenda is set by the
+variable @code{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 @code{day}, @code{week}, @code{month} or @code{year}. For weekly agendas, the default
+is to start on the previous Monday (see
+@code{org-agenda-start-on-weekday}). You can also set the start date using
+a date shift: @samp{(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 @ref{Agenda Commands}.
+
+@anchor{Calendar/Diary integration}
+@subsubheading Calendar/Diary integration
+
+@cindex calendar integration
+@cindex diary integration
+
+Emacs contains the calendar and diary by Edward@tie{}M@.@tie{}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
+
+@lisp
+(setq org-agenda-include-diary t)
+@end lisp
+
+@noindent
+After that, everything happens automatically. All diary entries
+including holidays, anniversaries, etc., are included in the agenda
+buffer created by Org mode. @kbd{@key{SPC}}, @kbd{@key{TAB}}, and
+@kbd{@key{RET}} can be used from the agenda buffer to jump to the diary
+file in order to edit existing diary entries. The @kbd{i}
+command to insert new entries for the current date works in the agenda
+buffer, as well as the commands @kbd{S}, @kbd{M}, and
+@kbd{C} to display Sunrise/Sunset times, show lunar phases and to
+convert to other calendars, respectively. @kbd{c} can be used to
+switch back and forth between calendar and agenda.
+
+If you are using the diary only for expression 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
+expression entries, and does it faster because there is no overhead
+for first creating the diary display. Note that the expression
+entries must start at the left margin, no whitespace is allowed before
+them, as seen in the following segment of an Org file:@footnote{The variable @code{org-anniversary} used in the example is just
+like @code{diary-anniversary}, but the argument order is always according
+to ISO and therefore independent of the value of
+@code{calendar-date-style}.}
+
+@example
+* 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
+@end example
+
+@anchor{Anniversaries from BBDB}
+@subsubheading Anniversaries from BBDB
+
+@cindex BBDB, anniversaries
+@cindex anniversaries, from BBDB
+
+@findex org-bbdb-anniversaries
+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:
+
+@example
+* Anniversaries
+ :PROPERTIES:
+ :CATEGORY: Anniv
+ :END:
+%%(org-bbdb-anniversaries)
+@end example
+
+You can then go ahead and define anniversaries for a BBDB record.
+Basically, you need a field named @samp{anniversary} for the BBDB record
+which contains the date in the format @samp{YYYY-MM-DD} or @samp{MM-DD},
+followed by a space and the class of the anniversary (@samp{birthday},
+@samp{wedding}, or a format string). If you omit the class, it defaults to
+@samp{birthday}. Here are a few examples, the header for the file
+@samp{ol-bbdb.el} contains more detailed information.
+
+@example
+1973-06-22
+06-22
+1955-08-02 wedding
+2008-04-14 %s released version 6.01 of Org mode, %d years ago
+@end example
+
+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
+@samp{%%(diary-anniversary)} entries in an Org or Diary file.
+
+@findex org-bbdb-anniversaries-future
+If you would like to see upcoming anniversaries with a bit of
+forewarning, you can use the following instead:
+
+@example
+* Anniversaries
+ :PROPERTIES:
+ :CATEGORY: Anniv
+ :END:
+%%(org-bbdb-anniversaries-future 3)
+@end example
+
+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.
+
+@anchor{Appointment reminders}
+@subsubheading Appointment reminders
+
+@cindex @file{appt.el}
+@cindex appointment reminders
+@cindex appointment
+@cindex reminders
+
+@cindex APPT_WARNTIME, keyword
+Org can interact with Emacs appointments notification facility. To
+add the appointments of your agenda files, use the command
+@code{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 @samp{APPT_WARNTIME} property which overrides the value of
+@code{appt-message-warning-time} for this appointment. See the docstring
+for details.
+
+@node Global TODO list
+@subsection The global TODO list
+
+@cindex global TODO list
+@cindex TODO list, global
+
+The global TODO list contains all unfinished TODO items formatted and
+collected into a single place.
+
+@table @asis
+@item @kbd{M-x org-agenda t} (@code{org-todo-list})
+@kindex t @r{(Agenda dispatcher)}
+@findex org-todo-list
+Show the global TODO list. This collects the TODO items from all
+agenda files (see @ref{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 @ref{Agenda Commands}).
+
+@item @kbd{M-x org-agenda T} (@code{org-todo-list})
+@kindex T @r{(Agenda dispatcher)}
+@findex org-todo-list
+@cindex TODO keyword matching
+@vindex org-todo-keywords
+Like the above, but allows selection of a specific TODO keyword.
+You can also do this by specifying a prefix argument to
+@kbd{t}. You are prompted for a keyword, and you may also
+specify several keywords by separating them with @samp{|} as the boolean
+OR operator. With a numeric prefix, the Nth keyword in
+@code{org-todo-keywords} is selected.
+
+@kindex r
+The @kbd{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 @kbd{3 r}. If you often need
+a search for a specific keyword, define a custom command for it (see
+@ref{Agenda Dispatcher}).
+
+Matching specific TODO keywords can also be done as part of a tags
+search (see @ref{Tag Searches}).
+@end table
+
+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 @ref{Agenda Commands}.
+
+@cindex sublevels, inclusion into TODO list
+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:
+
+@itemize
+@item
+@vindex org-agenda-todo-ignore-scheduled
+@vindex org-agenda-todo-ignore-deadlines
+@vindex org-agenda-todo-ignore-timestamp
+@vindex org-agenda-todo-ignore-with-date
+Some people view a TODO item that has been @emph{scheduled} for execution
+or have a @emph{deadline} (see @ref{Timestamps}) as no longer @emph{open}.
+Configure the variables @code{org-agenda-todo-ignore-scheduled} to
+exclude some or all scheduled items from the global TODO list,
+@code{org-agenda-todo-ignore-deadlines} to exclude some or all items with
+a deadline set, @code{org-agenda-todo-ignore-timestamp} to exclude some
+or all items with an active timestamp other than a DEADLINE or
+a SCHEDULED timestamp and/or @code{org-agenda-todo-ignore-with-date} to
+exclude items with at least one active timestamp.
+
+@item
+@vindex org-agenda-todo-list-sublevels
+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 @code{org-agenda-todo-list-sublevels} to get this behavior.
+@end itemize
+
+@node Matching tags and properties
+@subsection Matching tags and properties
+
+@cindex matching, of tags
+@cindex matching, of properties
+@cindex tags view
+@cindex match view
+
+If headlines in the agenda files are marked with @emph{tags} (see @ref{Tags}),
+or have properties (see @ref{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 @kbd{C-c / m}.
+
+@table @asis
+@item @kbd{M-x org-agenda m} (@code{org-tags-view})
+@kindex m @r{(Agenda dispatcher)}
+@findex 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 @samp{+work+urgent-withboss} or @samp{work|home}
+(see @ref{Tags}). If you often need a specific search, define a custom
+command for it (see @ref{Agenda Dispatcher}).
+
+@item @kbd{M-x org-agenda M} (@code{org-tags-view})
+@kindex M @r{(Agenda dispatcher)}
+@findex org-tags-view
+@vindex org-tags-match-list-sublevels
+@vindex org-agenda-tags-todo-honor-ignore-options
+Like @kbd{m}, but only select headlines that are also TODO
+items and force checking subitems (see the variable
+@code{org-tags-match-list-sublevels}). To exclude scheduled/deadline
+items, see the variable @code{org-agenda-tags-todo-honor-ignore-options}.
+Matching specific TODO keywords together with a tags match is also
+possible, see @ref{Tag Searches}.
+@end table
+
+The commands available in the tags list are described in @ref{Agenda Commands}.
+
+@cindex boolean logic, for agenda searches
+A search string can use Boolean operators @samp{&} for AND and @samp{|} for OR@.
+@samp{&} binds more strongly than @samp{|}. Parentheses are currently not
+implemented. Each element in the search is either a tag, a regular
+expression matching tags, or an expression like @samp{PROPERTY OPERATOR
+VALUE} with a comparison operator, accessing a property value. Each
+element may be preceded by @samp{-} to select against it, and @samp{+} is
+syntactic sugar for positive selection. The AND operator @samp{&} is
+optional when @samp{+} or @samp{-} is present. Here are some examples, using
+only tags.
+
+@table @asis
+@item @samp{+work-boss}
+Select headlines tagged @samp{work}, but discard those also tagged
+@samp{boss}.
+
+@item @samp{work|laptop}
+Selects lines tagged @samp{work} or @samp{laptop}.
+
+@item @samp{work|laptop+night}
+Like before, but require the @samp{laptop} lines to be tagged also
+@samp{night}.
+@end table
+
+@cindex regular expressions, with tags search
+Instead of a tag, you may also specify a regular expression enclosed
+in curly braces (see @ref{Regular Expressions}). For example,
+@samp{work+@{^boss.*@}} matches headlines that contain the tag @samp{:work:} and
+any tag @emph{starting} with @samp{boss}.
+
+@cindex group tags, as regular expressions
+Group tags (see @ref{Tag Hierarchy}) are expanded as regular expressions.
+E.g., if @samp{work} is a group tag for the group @samp{:work:lab:conf:}, then
+searching for @samp{work} also searches for @samp{@{\(?:work\|lab\|conf\)@}} and
+searching for @samp{-work} searches for all headlines but those with one of
+the tags in the group (i.e., @samp{-@{\(?:work\|lab\|conf\)@}}).
+
+@cindex TODO keyword matching, with tags search
+@cindex level, for tags/property match
+@cindex category, for tags/property match
+@vindex org-odd-levels-only
+You may also test for properties (see @ref{Properties and Columns}) at the
+same time as matching tags. The properties may be real properties, or
+special properties that represent other metadata (see @ref{Special Properties}). For example, the property @samp{TODO} represents the TODO
+keyword of the entry. Or, the property @samp{LEVEL} represents the level
+of an entry. So searching @samp{+LEVEL=3+boss-TODO​="DONE"} lists all level
+three headlines that have the tag @samp{boss} and are @emph{not} marked with the
+TODO keyword @samp{DONE}. In buffers with @code{org-odd-levels-only} set,
+@samp{LEVEL} does not count the number of stars, but @samp{LEVEL=2} corresponds
+to 3 stars etc.
+
+Here are more examples:
+
+@table @asis
+@item @samp{work+TODO​="WAITING"}
+Select @samp{work}-tagged TODO lines with the specific TODO keyword
+@samp{WAITING}.
+
+@item @samp{work+TODO​="WAITING"|home+TODO​="WAITING"}
+Waiting tasks both at work and at home.
+@end table
+
+When matching properties, a number of different operators can be used
+to test the value of a property. Here is a complex example:
+
+@example
++work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2
+ +With=@{Sarah\|Denny@}+SCHEDULED>="<2008-10-11>"
+@end example
+
+@noindent
+The type of comparison depends on how the comparison value is written:
+
+@itemize
+@item
+If the comparison value is a plain number, a numerical comparison is
+done, and the allowed operators are @samp{<}, @samp{=}, @samp{>}, @samp{<=}, @samp{>=}, and
+@samp{<>}.
+
+@item
+If the comparison value is enclosed in double-quotes, a string
+comparison is done, and the same operators are allowed.
+
+@item
+If the comparison value is enclosed in double-quotes @emph{and} angular
+brackets (like @samp{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
+@samp{"<now>"} for now (including time), @samp{"<today>"}, and @samp{"<tomorrow>"}
+for these days at 0:00 hours, i.e., without a time specification.
+You can also use strings like @samp{"<+5d>"} or @samp{"<-2m>"} with units @samp{d},
+@samp{w}, @samp{m}, and @samp{y} for day, week, month, and year, respectively.
+
+@item
+If the comparison value is enclosed in curly braces, a regexp match
+is performed, with @samp{=} meaning that the regexp matches the property
+value, and @samp{<>} meaning that it does not match.
+@end itemize
+
+So the search string in the example finds entries tagged @samp{work} but
+not @samp{boss}, which also have a priority value @samp{A}, a @samp{Coffee} property
+with the value @samp{unlimited}, an @samp{EFFORT} property that is numerically
+smaller than 2, a @samp{With} property that is matched by the regular
+expression @samp{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 @ref{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 @samp{|}) with a @samp{/} 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, @emph{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 @kbd{M-x org-agenda M}, or equivalently start the TODO part after the slash
+with @samp{!}. Using @kbd{M-x org-agenda M} or @samp{/!} does not match
+TODO keywords in a DONE state. Examples:
+
+@table @asis
+@item @samp{work/WAITING}
+Same as @samp{work+TODO​="WAITING"}.
+
+@item @samp{work/!-WAITING-NEXT}
+Select @samp{work}-tagged TODO lines that are neither @samp{WAITING} nor
+@samp{NEXT}.
+
+@item @samp{work/!+WAITING|+NEXT}
+Select @samp{work}-tagged TODO lines that are either @samp{WAITING} or @samp{NEXT}.
+@end table
+
+@node Search view
+@subsection Search view
+
+@cindex search view
+@cindex text search
+@cindex searching, for text
+
+This agenda view is a general text search facility for Org mode
+entries. It is particularly useful to find notes.
+
+@table @asis
+@item @kbd{M-x org-agenda s} (@code{org-search-view})
+@kindex s @r{(Agenda dispatcher)}
+@findex org-search-view
+This is a special search that lets you select entries by matching
+a substring or specific words using a boolean logic.
+@end table
+
+For example, the search string @samp{computer equipment} matches entries
+that contain @samp{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 @samp{+computer
++wifi -ethernet -@{8\.11[bg]@}} matches note entries that contain the
+keywords @samp{computer} and @samp{wifi}, but not the keyword @samp{ethernet}, and
+which are also not matched by the regular expression @samp{8\.11[bg]},
+meaning to exclude both @samp{8.11b} and @samp{8.11g}. The first @samp{+} is
+necessary to turn on boolean search, other @samp{+} characters are
+optional. For more details, see the docstring of the command
+@code{org-search-view}.
+
+You can incrementally and conveniently adjust a boolean search from
+the agenda search view with the following keys
+
+@multitable @columnfractions 0.1 0.6
+@item @kbd{[}
+@tab Add a positive search word
+@item @kbd{]}
+@tab Add a negative search word
+@item @kbd{@{}
+@tab Add a positive regular expression
+@item @kbd{@}}
+@tab Add a negative regular expression
+@end multitable
+
+@vindex org-agenda-text-search-extra-files
+Note that in addition to the agenda files, this command also searches
+the files listed in @code{org-agenda-text-search-extra-files}.
+
+@node Stuck projects
+@subsection Stuck projects
+
+@pindex GTD, Getting Things Done
+
+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 @emph{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.
+
+@table @asis
+@item @kbd{M-x org-agenda #} (@code{org-agenda-list-stuck-projects})
+@kindex # @r{(Agenda dispatcher)}
+@findex org-agenda-list-stuck-projects
+List projects that are stuck.
+
+@item @kbd{M-x org-agenda !}
+@kindex ! @r{(Agenda dispatcher)}
+@vindex org-stuck-projects
+Customize the variable @code{org-stuck-projects} to define what a stuck
+project is and how to find it.
+@end table
+
+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 @samp{TODO} or @samp{NEXT} or @samp{NEXTACTION}.
+
+Let's assume that you, in your own way of using Org mode, identify
+projects with a tag @samp{:PROJECT:}, and that you use a TODO keyword
+@samp{MAYBE} to indicate a project that should not be considered yet.
+Let's further assume that the TODO keyword @samp{DONE} marks finished
+projects, and that @samp{NEXT} and @samp{TODO} indicate next actions. The tag
+@samp{:@@shop:} indicates shopping and is a next action even without the
+NEXT tag. Finally, if the project contains the special word @samp{IGNORE}
+anywhere, it should not be listed either. In this case you would
+start by identifying eligible projects with a tags/TODO match (see
+@ref{Tag Searches}) @samp{+PROJECT/-MAYBE-DONE}, and then check for @samp{TODO},
+@samp{NEXT}, @samp{@@shop}, and @samp{IGNORE} in the subtree to identify projects that
+are not stuck. The correct customization for this is:
+
+@lisp
+(setq org-stuck-projects
+ '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@shop")
+ "\\<IGNORE\\>"))
+@end lisp
+
+Note that if a project is identified as non-stuck, the subtree of this
+entry is searched for stuck projects.
+
+@node Presentation and Sorting
+@section Presentation and Sorting
+
+@cindex presentation, of agenda items
+
+@vindex org-agenda-prefix-format
+@vindex org-agenda-tags-column
+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 @emph{prefix} that contains the @emph{category} (see @ref{Categories})
+of the item and other important information. You can customize in
+which column tags are displayed through @code{org-agenda-tags-column}. You
+can also customize the prefix using the option
+@code{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 items:: Dynamically narrow the agenda.
+@end menu
+
+@node Categories
+@subsection Categories
+
+@cindex category
+@cindex @samp{CATEGORY}, keyword
+
+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:
+
+@example
+#+CATEGORY: Thesis
+@end example
+
+
+@cindex @samp{CATEGORY}, property
+If you would like to have a special category for a single entry or
+a (sub)tree, give the entry a @samp{CATEGORY} property with the special
+category you want to apply as the value.
+
+@vindex org-agenda-category-icon-alist
+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 @code{org-agenda-category-icon-alist} variable.
+
+@node Time-of-day specifications
+@subsection Time-of-day specifications
+
+@cindex time-of-day specification
+
+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
+
+@example
+<2005-05-10 Tue 19:00>
+@end example
+
+
+@noindent
+Time ranges can be specified with two timestamps:
+
+@example
+<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>
+@end example
+
+
+@vindex org-agenda-search-headline-for-time
+In the headline of the entry itself, a time(range)---like @samp{12:45} or
+a @samp{8:30-1pm}---may also appear as plain text@footnote{You can, however, disable this by setting
+@code{org-agenda-search-headline-for-time} variable to a @code{nil} value.}.
+
+If the agenda integrates the Emacs diary (see @ref{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:
+
+@example
+ 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
+@end example
+
+@cindex time grid
+If the agenda is in single-day mode, or for the display of today, the
+timed entries are embedded in a time grid, like
+
+@example
+ 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
+@end example
+
+@vindex org-agenda-use-time-grid
+@vindex org-agenda-time-grid
+The time grid can be turned on and off with the variable
+@code{org-agenda-use-time-grid}, and can be configured with
+@code{org-agenda-time-grid}.
+
+@node Sorting of agenda items
+@subsection Sorting of agenda items
+
+@cindex sorting, of agenda items
+@cindex priorities, of agenda items
+
+Before being inserted into a view, the items are sorted. How this is
+done depends on the type of view.
+
+@itemize
+@item
+@vindex org-agenda-files
+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 @emph{schedule} for the day. After that, items remain
+grouped in categories, in the sequence given by @code{org-agenda-files}.
+Within each category, items are sorted by priority (see
+@ref{Priorities}), which is composed of the base priority (2000 for
+priority @samp{A}, 1000 for @samp{B}, and 0 for @samp{C}), plus additional
+increments for overdue scheduled or deadline items.
+
+@item
+For the TODO list, items remain in the order of categories, but
+within each category, sorting takes place according to priority (see
+@ref{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.
+
+@item
+For tags matches, items are not sorted at all, but just appear in
+the sequence in which they are found in the agenda files.
+@end itemize
+
+@vindex org-agenda-sorting-strategy
+Sorting can be customized using the variable
+@code{org-agenda-sorting-strategy}, and may also include criteria based on
+the estimated effort of an entry (see @ref{Effort Estimates}).
+
+@node Filtering/limiting agenda items
+@subsection Filtering/limiting agenda items
+
+@vindex org-agenda-category-filter-preset
+@vindex org-agenda-tag-filter-preset
+@vindex org-agenda-effort-filter-preset
+@vindex org-agenda-regexp-filter-preset
+Agenda built-in or custom commands are statically defined. Agenda
+filters and limits allow to flexibly narrow down the list of agenda
+entries.
+
+@emph{Filters} only change the visibility of items, are very fast and are
+mostly used interactively@footnote{Custom agenda commands can preset a filter by binding one of
+the variables @code{org-agenda-tag-filter-preset},
+@code{org-agenda-category-filter-preset}, @code{org-agenda-effort-filter-preset}
+or @code{org-agenda-regexp-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.}. You can switch quickly between
+different filters without having to recreate the agenda. @emph{Limits} on
+the other hand take effect before the agenda buffer is populated, so
+they are mostly useful when defined as local variables within custom
+agenda commands.
+
+@anchor{Filtering in the agenda}
+@subsubheading Filtering in the agenda
+
+@cindex agenda filtering
+@cindex filtering entries, in agenda
+@cindex tag filtering, in agenda
+@cindex category filtering, in agenda
+@cindex top headline filtering, in agenda
+@cindex effort filtering, in agenda
+@cindex query editing, in agenda
+
+The general filtering command is @code{org-agenda-filter}, bound to
+@kbd{/}. Before we introduce it, we describe commands for
+individual filter types. All filtering commands handle prefix
+arguments in the same way: A single @kbd{C-u} prefix negates the
+filter, so it removes lines selected by the filter. A double prefix
+adds the new filter condition to the one(s) already in place, so
+filter elements are accumulated.
+
+@table @asis
+@item @kbd{\} (@code{org-agenda-filter-by-tag})
+@findex org-agenda-filter-by-tag
+Filter the agenda view with respect to a tag. You are prompted for
+a tag selection letter; @kbd{@key{SPC}} means any tag at all.
+Pressing @kbd{@key{TAB}} 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. Pressing @kbd{+} or @kbd{-} at the prompt switches
+between filtering for and against the next tag. To clear the
+filter, press @kbd{\} twice (once to call the command again,
+and once at the prompt).
+
+@item @kbd{<} (@code{org-agenda-filter-by-category})
+@findex org-agenda-filter-by-category
+Filter by category of the line at point, and show only entries with
+this category. When called with a prefix argument, hide all entries
+with the category at point. To clear the filter, call this command
+again by pressing @kbd{<}.
+
+@item @kbd{=} (@code{org-agenda-filter-by-regexp})
+@findex org-agenda-filter-by-regexp
+Filter the agenda view by a regular expression: only show agenda
+entries matching the regular expression the user entered. To clear
+the filter, call the command again by pressing @kbd{=}.
+
+@item @kbd{_} (@code{org-agenda-filter-by-effort})
+@findex org-agenda-filter-by-effort
+Filter the agenda view with respect to effort estimates, so select
+tasks that take the right amount of time. You first need to set up
+a list of efforts globally, for example
+
+@lisp
+(setq org-global-properties
+ '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
+@end lisp
+
+@vindex org-sort-agenda-noeffort-is-high
+You can then filter for an effort by first typing an operator, one
+of @kbd{<}, @kbd{>} and @kbd{=}, and then the
+one-digit index of an effort estimate in your array of allowed
+values, where @kbd{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 @code{org-sort-agenda-noeffort-is-high}. To clear the
+filter, press @kbd{_} twice (once to call the command again,
+and once at the first prompt).
+
+@item @kbd{^} (@code{org-agenda-filter-by-top-headline})
+@findex org-agenda-filter-by-top-headline
+Filter the current agenda view and only display items that fall
+under the same top-level headline as the current entry. To clear
+the filter, call this command again by pressing @kbd{^}.
+
+@item @kbd{/} (@code{org-agenda-filter})
+@findex org-agenda-filter
+This is the unified interface to four of the five filter methods
+described above. At the prompt, specify different filter elements
+in a single string, with full completion support. For example,
+
+@example
++work-John+<0:10-/plot/
+@end example
+
+
+selects entries with category @samp{work} and effort estimates below 10
+minutes, and deselects entries with tag @samp{John} or matching the
+regexp @samp{plot} (see @ref{Regular Expressions}). You can leave @samp{+} out if
+that does not lead to ambiguities. The sequence of elements is
+arbitrary. The filter syntax assumes that there is no overlap
+between categories and tags. Otherwise, tags take priority. If you
+reply to the prompt with the empty string, all filtering is removed.
+If a filter is specified, it replaces all current filters. But if
+you call the command with a double prefix argument, or if you add an
+additional @samp{+} (e.g., @samp{++work}) to the front of the string, the new
+filter elements are added to the active ones. A single prefix
+argument applies the entire filter in a negative sense.
+
+@item @kbd{|} (@code{org-agenda-filter-remove-all})
+Remove all filters in the current agenda view.
+@end table
+
+@anchor{Computed tag filtering}
+@subsubheading Computed tag filtering
+
+@vindex org-agenda-auto-exclude-function
+If the variable @code{org-agenda-auto-exclude-function} is set to
+a user-defined function, that function can select tags that should be
+used as a tag filter when requested. The function will be called with
+lower-case versions of all tags represented in the current view. The
+function should return @samp{"-tag"} if the filter should remove
+entries with that tag, @samp{"+tag"} if only entries with this tag should
+be kept, or @samp{nil} if that tag is irrelevant. For example, let's say
+you use a @samp{Net} tag to identify tasks which need network access, an
+@samp{Errand} tag for errands in town, and a @samp{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:
+
+@lisp
+(defun my-auto-exclude-fn (tag)
+ (when (cond ((string= tag "net")
+ (/= 0 (call-process "/sbin/ping" nil nil nil
+ "-c1" "-q" "-t1" "mail.gnu.org")))
+ ((member tag '("errand" "call"))
+ (let ((hr (nth 2 (decode-time))))
+ (or (< hr 8) (> hr 21)))))
+ (concat "-" tag)))
+
+(setq org-agenda-auto-exclude-function #'my-auto-exclude-fn)
+@end lisp
+
+You can apply this self-adapting filter by using a triple prefix
+argument to @code{org-agenda-filter}, i.e.@tie{}press @kbd{C-u C-u C-u /},
+or by pressing @kbd{@key{RET}} in @code{org-agenda-filter-by-tag}.
+
+@anchor{Setting limits for the agenda}
+@subsubheading Setting limits for the agenda
+
+@cindex limits, in agenda
+
+Here is a list of options that you can set, either globally, or
+locally in your custom agenda views (see @ref{Custom Agenda Views}).
+
+@table @asis
+@item @code{org-agenda-max-entries}
+@vindex org-agenda-max-entries
+Limit the number of entries.
+
+@item @code{org-agenda-max-effort}
+@vindex org-agenda-max-effort
+Limit the duration of accumulated efforts (as minutes).
+
+@item @code{org-agenda-max-todos}
+@vindex org-agenda-max-todos
+Limit the number of entries with TODO keywords.
+
+@item @code{org-agenda-max-tags}
+@vindex org-agenda-max-tags
+Limit the number of tagged entries.
+@end table
+
+When set to a positive integer, each option excludes entries from
+other categories: for example, @samp{(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 @code{org-agenda-max-effort}. One
+useful setup is to use @code{org-agenda-max-entries} locally in a custom
+command. For example, this custom command displays the next five
+entries with a @samp{NEXT} TODO keyword.
+
+@lisp
+(setq org-agenda-custom-commands
+ '(("n" todo "NEXT"
+ ((org-agenda-max-entries 5)))))
+@end lisp
+
+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:
+
+@table @asis
+@item @kbd{~} (@code{org-agenda-limit-interactively})
+@findex org-agenda-limit-interactively
+This prompts for the type of limit to apply and its value.
+@end table
+
+@node Agenda Commands
+@section Commands in the Agenda Buffer
+
+@cindex commands, in 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.
+
+@anchor{Motion (1)}
+@subheading Motion
+
+@cindex motion commands in agenda
+
+@table @asis
+@item @kbd{n} (@code{org-agenda-next-line})
+@kindex n
+@findex org-agenda-next-line
+Next line (same as @kbd{@key{DOWN}} and @kbd{C-n}).
+
+@item @kbd{p} (@code{org-agenda-previous-line})
+@kindex p
+@findex org-agenda-previous-line
+Previous line (same as @kbd{@key{UP}} and @kbd{C-p}).
+@end table
+
+@anchor{View/Go to Org file}
+@subheading View/Go to Org file
+
+@cindex view file commands in agenda
+
+@table @asis
+@item @kbd{@key{SPC}} or @kbd{mouse-3} (@code{org-agenda-show-and-scroll-up})
+@kindex SPC
+@kindex mouse-3
+@findex 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.
+
+@item @kbd{L} (@code{org-agenda-recenter})
+@findex org-agenda-recenter
+Display original location and recenter that window.
+
+@item @kbd{@key{TAB}} or @kbd{mouse-2} (@code{org-agenda-goto})
+@kindex TAB
+@kindex mouse-2
+@findex org-agenda-goto
+Go to the original location of the item in another window.
+
+@item @kbd{@key{RET}} (@code{org-agenda-switch-to})
+@kindex RET
+@findex org-agenda-switch-to
+Go to the original location of the item and delete other windows.
+
+@item @kbd{F} (@code{org-agenda-follow-mode})
+@kindex F
+@findex org-agenda-follow-mode
+@vindex org-agenda-start-with-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
+@code{org-agenda-start-with-follow-mode}.
+
+@item @kbd{C-c C-x b} (@code{org-agenda-tree-to-indirect-buffer})
+@kindex C-c C-x b
+@findex 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 @kbd{C-u} prefix, do not remove the previously used indirect
+buffer.
+
+@item @kbd{C-c C-o} (@code{org-agenda-open-link})
+@kindex C-c C-o
+@findex 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.
+@end table
+
+@anchor{Change display}
+@subheading Change display
+
+@cindex change agenda display
+@cindex display changing, in agenda
+
+@table @asis
+@item @kbd{A}
+@kindex A
+Interactively select another agenda view and append it to the
+current view.
+
+@item @kbd{o}
+@kindex o
+Delete other windows.
+
+@item @kbd{v d} or short @kbd{d} (@code{org-agenda-day-view})
+@kindex v d
+@kindex d
+@findex 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, @kbd{32 d} jumps to February 1st. When
+setting day view, a year may be encoded in the prefix argument as
+well. For example, @kbd{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.
+
+@item @kbd{v w} or short @kbd{w} (@code{org-agenda-week-view})
+@kindex v w
+@kindex w
+@findex 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 @kbd{9 w} to ISO week number 9. When
+setting week view, a year may be encoded in the prefix argument as
+well. For example, @kbd{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.
+
+@item @kbd{v m} (@code{org-agenda-month-view})
+@kindex v m
+@findex 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, @kbd{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.
+
+@item @kbd{v y} (@code{org-agenda-year-view})
+@kindex v y
+@findex 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.
+
+@item @kbd{v @key{SPC}} (@code{org-agenda-reset-view})
+@kindex v SPC
+@findex org-agenda-reset-view
+@vindex org-agenda-span
+Reset the current view to @code{org-agenda-span}.
+
+@item @kbd{f} (@code{org-agenda-later})
+@kindex f
+@findex 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.
+
+@item @kbd{b} (@code{org-agenda-earlier})
+@kindex b
+@findex org-agenda-earlier
+Go backward in time to display earlier dates.
+
+@item @kbd{.} (@code{org-agenda-goto-today})
+@kindex .
+@findex org-agenda-goto-today
+Go to today.
+
+@item @kbd{j} (@code{org-agenda-goto-date})
+@kindex j
+@findex org-agenda-goto-date
+Prompt for a date and go there.
+
+@item @kbd{J} (@code{org-agenda-clock-goto})
+@kindex J
+@findex org-agenda-clock-goto
+Go to the currently clocked-in task @emph{in the agenda buffer}.
+
+@item @kbd{D} (@code{org-agenda-toggle-diary})
+@kindex D
+@findex org-agenda-toggle-diary
+Toggle the inclusion of diary entries. See @ref{Weekly/daily agenda}.
+
+@item @kbd{v l} or @kbd{v L} or short @kbd{l} (@code{org-agenda-log-mode})
+@kindex v l
+@kindex l
+@kindex v L
+@findex org-agenda-log-mode
+@vindex org-log-done
+@vindex org-agenda-log-mode-items
+Toggle Logbook mode. In Logbook mode, entries that were marked as
+done while logging was on (see the variable @code{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 @code{org-agenda-log-mode-items}. When
+called with a @kbd{C-u} prefix argument, show all possible
+logbook entries, including state changes. When called with two
+prefix arguments @kbd{C-u C-u}, show only logging information,
+nothing else. @kbd{v L} is equivalent to @kbd{C-u v l}.
+
+@item @kbd{v [} or short @kbd{[} (@code{org-agenda-manipulate-query-add})
+@kindex v [
+@kindex [
+@findex org-agenda-manipulate-query-add
+Include inactive timestamps into the current view. Only for
+weekly/daily agenda.
+
+@item @kbd{v a} (@code{org-agenda-archives-mode})
+@kindex v a
+@findex org-agenda-archives-mode
+Toggle Archives mode. In Archives mode, trees that are archived
+(see @ref{Internal archiving}) are also scanned when producing the
+agenda. To exit archives mode, press @kbd{v a} again.
+
+@item @kbd{v A}
+@kindex v A
+Toggle Archives mode. Include all archive files as well.
+
+@item @kbd{v R} or short @kbd{R} (@code{org-agenda-clockreport-mode})
+@kindex v R
+@kindex R
+@findex org-agenda-clockreport-mode
+@vindex org-agenda-start-with-clockreport-mode
+@vindex org-clock-report-include-clocking-task
+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 @code{org-agenda-start-with-clockreport-mode}. By using
+a prefix argument when toggling this mode (i.e., @kbd{C-u R}),
+the clock table does not show contributions from entries that are
+hidden by agenda filtering@footnote{Only tags filtering is respected here, effort filtering is
+ignored.}. See also the variable
+@code{org-clock-report-include-clocking-task}.
+
+@item @kbd{v c}
+@kindex v c
+@vindex org-agenda-clock-consistency-checks
+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
+@code{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 @kbd{l} to exit Logbook
+mode.
+
+@item @kbd{v E} or short @kbd{E} (@code{org-agenda-entry-text-mode})
+@kindex v E
+@kindex E
+@findex org-agenda-entry-text-mode
+@vindex org-agenda-start-with-entry-text-mode
+@vindex org-agenda-entry-text-maxlines
+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 @code{org-agenda-entry-text-maxlines}. Calling this command
+with a numeric prefix argument temporarily modifies that number to
+the prefix value.
+
+@item @kbd{G} (@code{org-agenda-toggle-time-grid})
+@kindex G
+@vindex org-agenda-use-time-grid
+@vindex org-agenda-time-grid
+Toggle the time grid on and off. See also the variables
+@code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
+
+@item @kbd{r} (@code{org-agenda-redo})
+@itemx @kbd{g}
+@kindex r
+@kindex g
+@findex org-agenda-redo
+Recreate the agenda buffer, for example to reflect the changes after
+modification of the timestamps of items with @kbd{S-@key{LEFT}} and
+@kbd{S-@key{RIGHT}}. When the buffer is the global TODO list,
+a prefix argument is interpreted to create a selective list for
+a specific TODO keyword.
+
+@item @kbd{C-x C-s} or short @kbd{s} (@code{org-save-all-org-buffers})
+@kindex C-x C-s
+@findex org-save-all-org-buffers
+@kindex s
+Save all Org buffers in the current Emacs session, and also the
+locations of IDs.
+
+@item @kbd{C-c C-x C-c} (@code{org-agenda-columns})
+@kindex C-c C-x C-c
+@findex org-agenda-columns
+@vindex org-columns-default-format
+Invoke column view (see @ref{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 @samp{COLUMNS} keyword, or from the
+default variable @code{org-columns-default-format}) is used in the
+agenda.
+
+@item @kbd{C-c C-x >} (@code{org-agenda-remove-restriction-lock})
+@kindex C-c C-x >
+@findex org-agenda-remove-restriction-lock
+Remove the restriction lock on the agenda, if it is currently
+restricted to a file or subtree (see @ref{Agenda Files}).
+
+@item @kbd{M-@key{UP}} (@code{org-agenda-drag-line-backward})
+@kindex M-UP
+@findex 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.
+
+@item @kbd{M-@key{DOWN}} (@code{org-agenda-drag-line-forward})
+@kindex M-DOWN
+@findex org-agenda-drag-line-forward
+Drag the line at point forward one line. With a numeric prefix
+argument, drag forward by that many lines.
+@end table
+
+@anchor{Remote editing}
+@subheading Remote editing
+
+@cindex remote editing, from agenda
+
+@table @asis
+@item @kbd{0--9}
+Digit argument.
+
+@item @kbd{C-_} (@code{org-agenda-undo})
+@kindex C-_
+@findex org-agenda-undo
+@cindex undoing remote-editing events
+@cindex remote editing, undo
+Undo a change due to a remote editing command. The change is undone
+both in the agenda buffer and in the remote buffer.
+
+@item @kbd{t} (@code{org-agenda-todo})
+@kindex t
+@findex org-agenda-todo
+Change the TODO state of the item, both in the agenda and in the
+original Org file. A prefix arg is passed through to the @code{org-todo}
+command, so for example a @kbd{C-u} prefix are will trigger
+taking a note to document the state change.
+
+@item @kbd{C-S-@key{RIGHT}} (@code{org-agenda-todo-nextset})
+@kindex C-S-RIGHT
+@findex org-agenda-todo-nextset
+Switch to the next set of TODO keywords.
+
+@item @kbd{C-S-@key{LEFT}}, @code{org-agenda-todo-previousset}
+@kindex C-S-LEFT
+Switch to the previous set of TODO keywords.
+
+@item @kbd{C-k} (@code{org-agenda-kill})
+@kindex C-k
+@findex org-agenda-kill
+@vindex org-agenda-confirm-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 @code{org-agenda-confirm-kill}.
+
+@item @kbd{C-c C-w} (@code{org-agenda-refile})
+@kindex C-c C-w
+@findex org-agenda-refile
+Refile the entry at point.
+
+@item @kbd{C-c C-x C-a} or short @kbd{a} (@code{org-agenda-archive-default-with-confirmation})
+@kindex C-c C-x C-a
+@kindex a
+@findex org-agenda-archive-default-with-confirmation
+@vindex org-archive-default-command
+Archive the subtree corresponding to the entry at point using the
+default archiving command set in @code{org-archive-default-command}.
+When using the @kbd{a} key, confirmation is required.
+
+@item @kbd{C-c C-x a} (@code{org-agenda-toggle-archive-tag})
+@kindex C-c C-x a
+@findex org-agenda-toggle-archive-tag
+Toggle the archive tag (see @ref{Internal archiving}) for the current
+headline.
+
+@item @kbd{C-c C-x A} (@code{org-agenda-archive-to-archive-sibling})
+@kindex C-c C-x A
+@findex org-agenda-archive-to-archive-sibling
+Move the subtree corresponding to the current entry to its @emph{archive
+sibling}.
+
+@item @kbd{C-c C-x C-s} or short @kbd{$} (@code{org-agenda-archive})
+@kindex C-c C-x C-s
+@kindex $
+@findex 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.
+
+@item @kbd{T} (@code{org-agenda-show-tags})
+@kindex T
+@findex org-agenda-show-tags
+@vindex org-agenda-show-inherited-tags
+Show all tags associated with the current item. This is useful if
+you have turned off @code{org-agenda-show-inherited-tags}, but still want
+to see all tags of a headline occasionally.
+
+@item @kbd{:} (@code{org-agenda-set-tags})
+@kindex :
+@findex 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.
+
+@item @kbd{,} (@code{org-agenda-priority})
+@kindex ,
+@findex org-agenda-priority
+Set the priority for the current item. Org mode prompts for the
+priority character. If you reply with @kbd{@key{SPC}}, the priority
+cookie is removed from the entry.
+
+@item @kbd{+} or @kbd{S-@key{UP}} (@code{org-agenda-priority-up})
+@kindex +
+@kindex S-UP
+@findex 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
+@kbd{r} key for this.
+
+@item @kbd{-} or @kbd{S-@key{DOWN}} (@code{org-agenda-priority-down})
+@kindex -
+@kindex S-DOWN
+@findex org-agenda-priority-down
+Decrease the priority of the current item.
+
+@item @kbd{C-c C-x e} or short @kbd{e} (@code{org-agenda-set-effort})
+@kindex e
+@kindex C-c C-x e
+@findex org-agenda-set-effort
+Set the effort property for the current item.
+
+@item @kbd{C-c C-z} or short @kbd{z} (@code{org-agenda-add-note})
+@kindex z
+@kindex C-c C-z
+@findex org-agenda-add-note
+@vindex org-log-into-drawer
+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
+@code{org-log-into-drawer}, this may be inside a drawer.
+
+@item @kbd{C-c C-a} (@code{org-attach})
+@kindex C-c C-a
+@findex org-attach
+Dispatcher for all command related to attachments.
+
+@item @kbd{C-c C-s} (@code{org-agenda-schedule})
+@kindex C-c C-s
+@findex org-agenda-schedule
+Schedule this item. With a prefix argument, remove the
+scheduling timestamp
+
+@item @kbd{C-c C-d} (@code{org-agenda-deadline})
+@kindex C-c C-d
+@findex org-agenda-deadline
+Set a deadline for this item. With a prefix argument, remove the
+deadline.
+
+@item @kbd{S-@key{RIGHT}} (@code{org-agenda-do-date-later})
+@kindex S-RIGHT
+@findex 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, @kbd{3 6 5 S-@key{RIGHT}} changes
+it by a year. With a @kbd{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
+@kbd{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 @kbd{r} or
+@kbd{g} to update the buffer.
+
+@item @kbd{S-@key{LEFT}} (@code{org-agenda-do-date-earlier})
+@kindex S-LEFT
+@findex org-agenda-do-date-earlier
+Change the timestamp associated with the current line by one day
+into the past.
+
+@item @kbd{>} (@code{org-agenda-date-prompt})
+@kindex >
+@findex org-agenda-date-prompt
+Change the timestamp associated with the current line. The key
+@kbd{>} has been chosen, because it is the same as
+@kbd{S-.} on my keyboard.
+
+@item @kbd{I} (@code{org-agenda-clock-in})
+@kindex I
+@findex org-agenda-clock-in
+Start the clock on the current item. If a clock is running already,
+it is stopped first.
+
+@item @kbd{O} (@code{org-agenda-clock-out})
+@kindex O
+@findex org-agenda-clock-out
+Stop the previously started clock.
+
+@item @kbd{X} (@code{org-agenda-clock-cancel})
+@kindex X
+@findex org-agenda-clock-cancel
+Cancel the currently running clock.
+
+@item @kbd{J} (@code{org-agenda-clock-goto})
+@kindex J
+@findex org-agenda-clock-goto
+Jump to the running clock in another window.
+
+@item @kbd{k} (@code{org-agenda-capture})
+@kindex k
+@findex org-agenda-capture
+@cindex capturing, from agenda
+@vindex org-capture-use-agenda-date
+Like @code{org-capture}, but use the date at point as the default date
+for the capture template. See @code{org-capture-use-agenda-date} to make
+this the default behavior of @code{org-capture}.
+@end table
+
+@anchor{Bulk remote editing selected entries}
+@subheading Bulk remote editing selected entries
+
+@cindex remote editing, bulk, from agenda
+@vindex org-agenda-bulk-custom-functions
+
+@table @asis
+@item @kbd{m} (@code{org-agenda-bulk-mark})
+@kindex m
+@findex 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.
+
+@item @kbd{*} (@code{org-agenda-bulk-mark-all})
+@kindex *
+@findex org-agenda-bulk-mark-all
+
+Mark all visible agenda entries for bulk action.
+
+@item @kbd{u} (@code{org-agenda-bulk-unmark})
+@kindex u
+@findex org-agenda-bulk-unmark
+
+Unmark entry for bulk action.
+
+@item @kbd{U} (@code{org-agenda-bulk-remove-all-marks})
+@kindex U
+@findex org-agenda-bulk-remove-all-marks
+
+Unmark all marked entries for bulk action.
+
+@item @kbd{M-m} (@code{org-agenda-bulk-toggle})
+@kindex M-m
+@findex org-agenda-bulk-toggle
+
+Toggle mark of the entry at point for bulk action.
+
+@item @kbd{M-*} (@code{org-agenda-bulk-toggle-all})
+@kindex M-*
+@findex org-agenda-bulk-toggle-all
+
+Toggle mark of every entry for bulk action.
+
+@item @kbd{%} (@code{org-agenda-bulk-mark-regexp})
+@kindex %
+@findex org-agenda-bulk-mark-regexp
+
+Mark entries matching a regular expression for bulk action.
+
+@item @kbd{B} (@code{org-agenda-bulk-action})
+@kindex B
+@findex org-agenda-bulk-action
+@vindex org-agenda-bulk-persistent-marks
+
+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 @kbd{B} is passed through to the @kbd{s} and
+@kbd{d} commands, to bulk-remove these special timestamps. By
+default, marks are removed after the bulk. If you want them to
+persist, set @code{org-agenda-bulk-persistent-marks} to @code{t} or hit
+@kbd{p} at the prompt.
+
+@table @asis
+@item @kbd{p}
+Toggle persistent marks.
+
+@item @kbd{$}
+Archive all selected entries.
+
+@item @kbd{A}
+Archive entries by moving them to their respective archive
+siblings.
+
+@item @kbd{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.
+
+@item @kbd{+}
+Add a tag to all selected entries.
+
+@item @kbd{-}
+Remove a tag from all selected entries.
+
+@item @kbd{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 @samp{++8d} or @samp{++2w}.
+
+@item @kbd{d}
+Set deadline to a specific date.
+
+@item @kbd{r}
+Prompt for a single refile target and move all entries. The
+entries are no longer in the agenda; refresh (@kbd{g}) to
+bring them back.
+
+@item @kbd{S}
+Reschedule randomly into the coming N days. N is prompted for.
+With a prefix argument (@kbd{C-u B S}), scatter only across
+weekdays.
+
+@item @kbd{f}
+@vindex org-agenda-bulk-custom-functions
+Apply a function@footnote{You can also create persistent custom functions through
+@code{org-agenda-bulk-custom-functions}.} to marked entries. For example, the
+function below sets the @samp{CATEGORY} property of the entries to
+@samp{web}.
+
+@lisp
+(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"))))
+@end lisp
+@end table
+@end table
+
+@anchor{Calendar commands}
+@subheading Calendar commands
+
+@cindex calendar commands, from agenda
+
+@table @asis
+@item @kbd{c} (@code{org-agenda-goto-calendar})
+@kindex c
+@findex org-agenda-goto-calendar
+Open the Emacs calendar and go to the date at point in the agenda.
+
+@item @kbd{c} (@code{org-calendar-goto-agenda})
+@kindex c
+@findex org-calendar-goto-agenda
+When in the calendar, compute and show the Org agenda for the date
+at point.
+
+@item @kbd{i} (@code{org-agenda-diary-entry})
+@kindex i
+@findex org-agenda-diary-entry
+
+@cindex diary entries, creating from agenda
+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@footnote{This file is parsed for the agenda when
+@code{org-agenda-include-diary} is set.}, in a way similar to the @kbd{i} command in the
+calendar. The diary file pops up in another window, where you can
+add the entry.
+
+@vindex org-agenda-diary-file
+If you configure @code{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 @samp{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 @code{org-agenda-diary-file} without further
+interaction. If you directly press @kbd{@key{RET}} at the prompt
+without typing text, the target file is shown in another window for
+you to finish the entry there. See also the @kbd{k r} command.
+
+@item @kbd{M} (@code{org-agenda-phases-of-moon})
+@kindex M
+@findex org-agenda-phases-of-moon
+Show the phases of the moon for the three months around current
+date.
+
+@item @kbd{S} (@code{org-agenda-sunrise-sunset})
+@kindex S
+@findex 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.
+
+@item @kbd{C} (@code{org-agenda-convert-date})
+@kindex C
+@findex org-agenda-convert-date
+Convert the date at point into many other cultural and historic
+calendars.
+
+@item @kbd{H} (@code{org-agenda-holidays})
+@kindex H
+@findex org-agenda-holidays
+Show holidays for three months around point date.
+@end table
+
+@anchor{Quit and exit}
+@subheading Quit and exit
+
+@table @asis
+@item @kbd{q} (@code{org-agenda-quit})
+@kindex q
+@findex org-agenda-quit
+
+Quit agenda, remove the agenda buffer.
+
+@item @kbd{x} (@code{org-agenda-exit})
+@kindex x
+@findex org-agenda-exit
+
+@cindex agenda files, removing buffers
+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.
+@end table
+
+@node Custom Agenda Views
+@section Custom Agenda Views
+
+@cindex custom agenda views
+@cindex agenda views, custom
+
+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 @ref{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.
+@end menu
+
+@node Storing searches
+@subsection 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).
+
+@kindex C @r{(Agenda dispatcher)}
+@vindex org-agenda-custom-commands
+@cindex agenda views, main example
+@cindex agenda, as an agenda views
+@cindex agenda*, as an agenda views
+@cindex tags, as an agenda view
+@cindex todo, as an agenda view
+@cindex tags-todo
+@cindex todo-tree
+@cindex occur-tree
+@cindex tags-tree
+Custom commands are configured in the variable
+@code{org-agenda-custom-commands}. You can customize this variable, for
+example by pressing @kbd{C} from the agenda dispatcher (see @ref{Agenda Dispatcher}). You can also directly set it with Emacs Lisp in
+the Emacs init file. The following example contains all valid agenda
+views:
+
+@lisp
+(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 "\\<FIXME\\>")
+ ("h" . "HOME+Name tags searches") ;description for "h" prefix
+ ("hl" tags "+home+Lisa")
+ ("hp" tags "+home+Peter")
+ ("hk" tags "+home+Kim")))
+@end lisp
+
+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 is 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@footnote{You can provide a description for a prefix key by inserting
+a cons cell with the prefix and the description.}. 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:
+
+@table @asis
+@item @kbd{x}
+as a global search for agenda entries planned@footnote{@emph{Planned} means here that these entries have some planning
+information attached to them, like a time-stamp, a scheduled or
+a deadline string. See @code{org-agenda-entry-types} on how to set what
+planning information is taken into account.} this week/day.
+
+@item @kbd{y}
+as the same search, but only for entries with an hour specification
+like @samp{[h]h:mm}---think of them as appointments.
+
+@item @kbd{w}
+as a global search for TODO entries with @samp{WAITING} as the TODO
+keyword.
+
+@item @kbd{W}
+as the same search, but only in the current buffer and displaying
+the results as a sparse tree.
+
+@item @kbd{u}
+as a global tags search for headlines tagged @samp{boss} but not
+@samp{urgent}.
+
+@item @kbd{v}
+The same search, but limiting it to headlines that are also TODO
+items.
+
+@item @kbd{U}
+as the same search, but only in the current buffer and displaying
+the result as a sparse tree.
+
+@item @kbd{f}
+to create a sparse tree (again, current buffer only) with all
+entries containing the word @samp{FIXME}.
+
+@item @kbd{h}
+as a prefix command for a @samp{HOME} tags search where you have to press
+an additional key (@kbd{l}, @kbd{p} or @kbd{k}) to
+select a name (Lisa, Peter, or Kim) as additional tag to match.
+@end table
+
+Note that @code{*-tree} agenda views need to be called from an Org buffer
+as they operate on the current buffer only.
+
+@node Block agenda
+@subsection Block agenda
+
+@cindex block agenda
+@cindex agenda, with block views
+
+Another possibility is the construction of agenda views that comprise
+the results of @emph{several} commands, each of which creates a block in
+the agenda buffer. The available commands include @code{agenda} for the
+daily or weekly agenda (as created with @kbd{a}) , @code{alltodo} for
+the global TODO list (as constructed with @kbd{t}), @code{stuck} for
+the list of stuck projects (as obtained with @kbd{#}) and the
+matching commands discussed above: @code{todo}, @code{tags}, and @code{tags-todo}.
+
+Here are two examples:
+
+@lisp
+(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")))))
+@end lisp
+
+@noindent
+This defines @kbd{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 @samp{home},
+and also all lines tagged with @samp{garden}. Finally the command
+@kbd{o} provides a similar view for office tasks.
+
+@node Setting options
+@subsection Setting options for custom commands
+
+@cindex options, for custom agenda views
+
+@vindex org-agenda-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 @code{org-agenda-custom-commands}. For example:
+
+@lisp
+(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)))))
+@end lisp
+
+@noindent
+Now the @kbd{w} command sorts the collected entries only by
+priority, and the prefix format is modified to just say @samp{Mixed:}
+instead of giving the category of the entry. The sparse tags tree of
+@kbd{U} now turns out ultra-compact, because neither the headline
+hierarchy above the match, nor the headline following the match are
+shown. The command @kbd{N} does a text search limited to only
+a single file.
+
+For command sets creating a block agenda, @code{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 @ref{Block agenda}), let's change the sorting strategy for the @kbd{h}
+commands to @code{priority-down}, but let's sort the results for @samp{garden}
+tags query in the opposite order, @code{priority-up}. This would look like
+this:
+
+@lisp
+(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")))))
+@end lisp
+
+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 @emph{values} are just Lisp expressions. So if the
+value is a string, you need to add the double-quotes around the value
+yourself.
+
+@vindex org-agenda-custom-commands-contexts
+To control whether an agenda command should be accessible from
+a specific context, you can customize
+@code{org-agenda-custom-commands-contexts}. Let's say for example that you
+have an agenda command @kbd{o} displaying a view that you only
+need when reading emails. Then you would configure this option like
+this:
+
+@lisp
+(setq org-agenda-custom-commands-contexts
+ '(("o" (in-mode . "message-mode"))))
+@end lisp
+
+You can also tell that the command key @kbd{o} should refer to
+another command key @kbd{r}. In that case, add this command key
+like this:
+
+@lisp
+(setq org-agenda-custom-commands-contexts
+ '(("o" "r" (in-mode . "message-mode"))))
+@end lisp
+
+See the docstring of the variable for more information.
+
+@node Exporting Agenda Views
+@section Exporting Agenda Views
+
+@cindex agenda views, exporting
+
+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@footnote{For HTML you need to install Hrvoje Nikšić's @samp{htmlize.el}
+as an Emacs package from MELPA or from @uref{https://github.com/hniksic/emacs-htmlize, Hrvoje Nikšić's repository}.}, Postscript,
+PDF@footnote{To create PDF output, the Ghostscript ps2pdf utility must be
+installed on the system. Selecting a PDF file also creates the
+postscript file.}, and iCalendar files. If you want to do this only
+occasionally, use the following command:
+
+@table @asis
+@item @kbd{C-x C-w} (@code{org-agenda-write})
+@kindex C-x C-w
+@findex org-agenda-write
+@cindex exporting agenda views
+@cindex agenda views, exporting
+
+@vindex org-agenda-exporter-settings
+Write the agenda view to a file.
+@end table
+
+If you need to export certain agenda views frequently, you can
+associate any custom agenda command with a list of output file
+names@footnote{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.}. 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.
+
+@lisp
+(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"))))
+@end lisp
+
+The extension of the file name determines the type of export. If it
+is @samp{.html}, Org mode uses the htmlize package to convert the buffer to
+HTML and save it to this file name. If the extension is @samp{.ps},
+@code{ps-print-buffer-with-faces} is used to produce Postscript output. If
+the extension is @samp{.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 @emph{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 @emph{all} specified
+files in one step:
+
+@table @asis
+@item @kbd{e} (@code{org-store-agenda-views})
+@kindex e @r{(Agenda dispatcher)}
+@findex org-store-agenda-views
+Export all agenda views that have export file names associated with
+them.
+@end table
+
+You can use the options section of the custom agenda commands to also
+set options for the export commands. For example:
+
+@lisp
+(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"))))
+@end lisp
+
+@noindent
+@vindex org-agenda-exporter-settings
+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
+@code{org-agenda-exporter-settings} also apply, e.g.,
+
+@lisp
+(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)))
+@end lisp
+
+@noindent
+but the settings in @code{org-agenda-custom-commands} take precedence.
+
+From the command line you may also use:
+
+@example
+emacs -eval (org-batch-store-agenda-views) -kill
+@end example
+
+@noindent
+or, if you need to modify some parameters@footnote{Quoting depends on the system you use, please check the FAQ
+for examples.}
+
+@example
+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
+@end example
+
+@noindent
+which creates the agenda views restricted to the file
+@samp{~/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 @ref{Extracting Agenda Information}, for
+more information.
+
+@node Agenda Column View
+@section Using Column View in the Agenda
+
+@cindex column view, in agenda
+@cindex agenda, column view
+
+Column view (see @ref{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.
+
+@table @asis
+@item @kbd{C-c C-x C-c} (@code{org-agenda-columns})
+@kindex C-c C-x C-c
+@findex org-agenda-columns
+
+Turn on column view in the agenda.
+@end table
+
+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:
+
+@enumerate
+@item
+@vindex org-columns-default-format-for-agenda
+@vindex org-columns-default-format
+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
+@code{org-overriding-columns-format} is currently set, and if so, takes
+the format from there. You should set this variable only in the
+@emph{local settings section} of a custom agenda command (see @ref{Custom Agenda Views}) to make it valid for that specific agenda view. If
+no such binding exists, it checks, in sequence,
+@code{org-columns-default-format-for-agenda}, the format associated with
+the first item in the agenda (through a property or a @samp{#+COLUMNS}
+setting in that buffer) and finally @code{org-columns-default-format}.
+
+@item
+@cindex @samp{CLOCKSUM}, special property
+If any of the columns has a summary type defined (see @ref{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
+@samp{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
+@emph{twice}---for example as scheduled and as a deadline---and it may
+show two entries from the same hierarchy (for example a @emph{parent}
+and its @emph{child}). In these cases, the summation in the agenda
+leads to incorrect results because some values count double.
+
+@item
+When the column view in the agenda shows the @samp{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 @kbd{R} in the agenda).
+
+@item
+@cindex @samp{CLOCKSUM_T}, special property
+When the column view in the agenda shows the @samp{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 @samp{CLOCKSUM}---and with
+the planned total effort for it.
+@end enumerate
+
+@node Markup for Rich Contents
+@chapter 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
+@ref{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.
+* Creating Footnotes:: Edit and read footnotes.
+@end menu
+
+@node Paragraphs
+@section Paragraphs
+
+@cindex paragraphs, markup rules
+Paragraphs are separated by at least one empty line. If you need to
+enforce a line break within a paragraph, use @samp{\\} at the end of
+a line.
+
+@cindex line breaks, markup rules
+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.
+
+@cindex @samp{BEGIN_VERSE}
+@cindex verse blocks
+@example
+#+BEGIN_VERSE
+ Great clouds overhead
+ Tiny black birds rise and fall
+ Snow covers Emacs
+
+ ---AlexSchroeder
+#+END_VERSE
+@end example
+
+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:
+
+@cindex @samp{BEGIN_QUOTE}
+@cindex quote blocks
+@example
+#+BEGIN_QUOTE
+Everything should be made as simple as possible,
+but not any simpler ---Albert Einstein
+#+END_QUOTE
+@end example
+
+If you would like to center some text, do it like this:
+
+@cindex @samp{BEGIN_CENTER}
+@cindex center blocks
+@example
+#+BEGIN_CENTER
+Everything should be made as simple as possible, \\
+but not any simpler
+#+END_CENTER
+@end example
+
+@node Emphasis and Monospace
+@section Emphasis and Monospace
+
+@cindex underlined text, markup rules
+@cindex bold text, markup rules
+@cindex italic text, markup rules
+@cindex verbatim text, markup rules
+@cindex code text, markup rules
+@cindex strike-through text, markup rules
+
+You can make words @samp{*bold*}, @samp{/italic/}, @samp{_underlined_}, @samp{=verbatim=}
+and @samp{~code~}, and, if you must, @samp{+strike-through+}. Text in the code
+and verbatim string is not processed for Org specific syntax; it is
+exported verbatim.
+
+@vindex org-fontify-emphasized-text
+To turn off fontification for marked up text, you can set
+@code{org-fontify-emphasized-text} to @code{nil}. To narrow down the list of
+available markup syntax, you can customize @code{org-emphasis-alist}.
+
+Sometimes, when marked text also contains the marker character itself,
+the result may be unsettling. For example,
+
+@example
+/One may expect this whole sentence to be italicized, but the
+following ~user/?variable~ contains =/= character, which effectively
+stops emphasis there./
+@end example
+
+You can use zero width space to help Org sorting out the ambiguity.
+See @ref{Escape Character} for more details.
+
+@node Subscripts and Superscripts
+@section Subscripts and Superscripts
+
+@cindex subscript
+@cindex superscript
+
+@samp{^} and @samp{_} 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
+
+@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@}.
+@end example
+
+@vindex org-use-sub-superscripts
+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 @code{org-use-sub-superscripts} to
+change this convention. For example, when setting this variable to
+@code{@{@}}, @samp{a_b} is not interpreted as a subscript, but @samp{a_@{b@}} is.
+
+You can set @code{org-use-sub-superscripts} in a file using the export
+option @samp{^:} (see @ref{Export Settings}). For example, @samp{#+OPTIONS: ^:@{@}}
+sets @code{org-use-sub-superscripts} to @code{@{@}} and limits super- and
+subscripts to the curly bracket notation.
+
+You can also toggle the visual display of super- and subscripts:
+
+@table @asis
+@item @kbd{C-c C-x \} (@code{org-toggle-pretty-entities})
+@kindex C-c C-x \
+@findex org-toggle-pretty-entities
+This command formats sub- and superscripts in a WYSIWYM way.
+@end table
+
+@vindex org-pretty-entities
+@vindex org-pretty-entities-include-sub-superscripts
+Set both @code{org-pretty-entities} and
+@code{org-pretty-entities-include-sub-superscripts} to @code{t} to start with
+super- and subscripts @emph{visually} interpreted as specified by the
+option @code{org-use-sub-superscripts}.
+
+@node Special Symbols
+@section Special Symbols
+
+@cindex math symbols
+@cindex special symbols
+@cindex entities
+
+You can use @LaTeX{}-like syntax to insert special symbols---named
+entities---like @samp{\alpha} to indicate the Greek letter, or @samp{\to} to indicate
+an arrow. Completion for these symbols is available, just type @samp{\}
+and maybe a few letters, and press @kbd{M-@key{TAB}} to see possible
+completions. If you need such a symbol inside a word, terminate it
+with a pair of curly brackets. For example
+
+@example
+Pro tip: Given a circle \Gamma of diameter d, the length of its
+circumference is \pi@{@}d.
+@end example
+
+@findex org-entities-help
+@vindex org-entities-user
+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 @code{org-entities-help}. It is also
+possible to provide your own special symbols in the variable
+@code{org-entities-user}.
+
+During export, these symbols are transformed into the native format of
+the exporter back-end. Strings like @samp{\alpha} are exported as @samp{&alpha;} in
+the HTML output, and as @samp{\(\alpha\)} in the @LaTeX{} output. Similarly, @samp{\nbsp}
+becomes @samp{&nbsp;} in HTML and @samp{~} in @LaTeX{}.
+
+@cindex special symbols, in-buffer display
+If you would like to see entities displayed as UTF-8 characters, use
+the following command@footnote{You can turn this on by default by setting the variable
+@code{org-pretty-entities}, or on a per-file base with the @samp{STARTUP} option
+@samp{entitiespretty}.}:
+
+@table @asis
+@item @kbd{C-c C-x \} (@code{org-toggle-pretty-entities})
+@kindex C-c C-x \
+@findex 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.
+@end table
+
+@cindex shy hyphen, special symbol
+@cindex dash, special symbol
+@cindex ellipsis, special symbol
+In addition to regular entities defined above, Org exports in
+a special way@footnote{This behavior can be disabled with @samp{-} export setting (see
+@ref{Export Settings}).} the following commonly used character
+combinations: @samp{\-} is treated as a shy hyphen, @samp{--} and @samp{---} are
+converted into dashes, and @samp{...} becomes a compact set of dots.
+
+@node Embedded @LaTeX{}
+@section Embedded @LaTeX{}
+
+@cindex @TeX{} interpretation
+@cindex @LaTeX{} interpretation
+
+Plain ASCII is normally sufficient for almost all note taking.
+Exceptions include scientific notes, which often require mathematical
+symbols and the occasional formula. @LaTeX{}@footnote{@LaTeX{} is a macro system based on Donald@tie{}E@.@tie{}Knuth's @TeX{}
+system. Many of the features described here as ``@LaTeX{}'' are really
+from @TeX{}, but for simplicity I am blurring this distinction.} 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?
+* CD@LaTeX{} mode:: Speed up entering of formulas.
+@end menu
+
+@node @LaTeX{} fragments
+@subsection @LaTeX{} fragments
+
+@cindex @LaTeX{} fragments
+
+@vindex org-format-latex-header
+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
+@uref{https://www.mathjax.org, MathJax} (see @ref{Math formatting in HTML export}) or transcode the math
+into images (see @ref{Previewing @LaTeX{} fragments}).
+
+@LaTeX{} fragments do not need any special marking at all. The following
+snippets are identified as @LaTeX{} source code:
+
+@itemize
+@item
+Environments of any kind@footnote{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.}. The only requirement is that the
+@samp{\begin} statement appears on a new line, preceded by only
+whitespace.
+
+@item
+Text within the usual @LaTeX{} math delimiters. To avoid conflicts
+with currency specifications, single @samp{$} characters are only
+recognized as math delimiters if the enclosed text contains at most
+two line breaks, is directly attached to the @samp{$} characters with no
+whitespace in between, and if the closing @samp{$} is followed by
+whitespace, punctuation or a dash. For the other delimiters, there
+is no such restriction, so when in doubt, use @samp{\(...\)} as inline
+math delimiters.
+@end itemize
+
+@noindent
+For example:
+
+@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@} \].
+@end example
+
+@vindex org-export-with-latex
+@LaTeX{} processing can be configured with the variable
+@code{org-export-with-latex}. The default setting is @code{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:
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{#+OPTIONS: tex:t}
+@tab Do the right thing automatically (MathJax)
+@item @samp{#+OPTIONS: tex:nil}
+@tab Do not process @LaTeX{} fragments at all
+@item @samp{#+OPTIONS: tex:verbatim}
+@tab Verbatim export, for jsMath or so
+@end multitable
+
+@node Previewing @LaTeX{} fragments
+@subsection Previewing @LaTeX{} fragments
+
+@cindex @LaTeX{} fragments, preview
+
+@vindex org-preview-latex-default-process
+If you have a working @LaTeX{} installation and @samp{dvipng}, @samp{dvisvgm} or
+@samp{convert} installed@footnote{These are respectively available at
+@uref{http://sourceforge.net/projects/dvipng/}, @uref{http://dvisvgm.bplaced.net/}
+and from the ImageMagick suite. Choose the converter by setting the
+variable @code{org-preview-latex-default-process} accordingly.}, @LaTeX{} fragments can be processed to
+produce images of the typeset expressions to be used for inclusion
+while exporting to HTML (see @ref{@LaTeX{} fragments}), or for inline
+previewing within Org mode.
+
+@vindex org-format-latex-options
+@vindex org-format-latex-header
+You can customize the variables @code{org-format-latex-options} and
+@code{org-format-latex-header} to influence some aspects of the preview.
+In particular, the @code{:scale} (and for HTML export, @code{:html-scale})
+property of the former can be used to adjust the size of the preview
+images.
+
+@table @asis
+@item @kbd{C-c C-x C-l} (@code{org-latex-preview})
+@kindex C-c C-x C-l
+@findex org-latex-preview
+
+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 single prefix argument, clear all images in the
+current entry. Two prefix arguments produce a preview image for all
+fragments in the buffer, while three of them clear all the images in
+that buffer.
+@end table
+
+@vindex org-startup-with-latex-preview
+You can turn on the previewing of all @LaTeX{} fragments in a file with
+
+@example
+#+STARTUP: latexpreview
+@end example
+
+
+To disable it, simply use
+
+@example
+#+STARTUP: nolatexpreview
+@end example
+
+@node CD@LaTeX{} mode
+@subsection Using CD@LaTeX{} to enter math
+
+@cindex CD@LaTeX{}
+
+CD@LaTeX{} mode is a minor mode that is normally used in combination with
+a major @LaTeX{} mode like AUC@TeX{} in order to speed-up insertion of
+environments and math templates. Inside Org mode, you can make use of
+some of the features of CD@LaTeX{} mode. You need to install
+@samp{cdlatex.el} and @samp{texmathp.el} (the latter comes also with AUC@TeX{})
+using @uref{https://melpa.org/, MELPA} with the @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html, Emacs packaging system} or alternatively from
+@uref{https://staff.fnwi.uva.nl/c.dominik/Tools/cdlatex/}. Do not use
+CD@LaTeX{} mode itself under Org mode, but use the special version Org
+CD@LaTeX{} minor mode that comes as part of Org. Turn it on for the
+current buffer with @kbd{M-x org-cdlatex-mode}, or for all Org
+files with
+
+@lisp
+(add-hook 'org-mode-hook #'turn-on-org-cdlatex)
+@end lisp
+
+When this mode is enabled, the following features are present (for
+more details see the documentation of CD@LaTeX{} mode):
+
+@table @asis
+@item @kbd{C-c @{}
+@kindex C-c @{
+
+Insert an environment template.
+
+@item @kbd{@key{TAB}}
+@kindex TAB
+
+The @kbd{@key{TAB}} key expands the template if point is inside
+a @LaTeX{} fragment@footnote{Org mode has a method to test if point is inside such
+a fragment, see the documentation of the function
+@code{org-inside-LaTeX-fragment-p}.}. For example, @kbd{@key{TAB}} expands @samp{fr}
+to @samp{\frac@{@}@{@}} and position point correctly inside the first brace.
+Another @kbd{@key{TAB}} gets you into the second brace.
+
+Even outside fragments, @kbd{@key{TAB}} expands environment
+abbreviations at the beginning of a line. For example, if you write
+@samp{equ} at the beginning of a line and press @kbd{@key{TAB}}, this
+abbreviation is expanded to an @samp{equation} environment. To get
+a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
+
+@item @kbd{^}
+@itemx @kbd{_}
+@kindex _
+@kindex ^
+@vindex cdlatex-simplify-sub-super-scripts
+
+Pressing @kbd{_} and @kbd{^} inside a @LaTeX{} fragment
+inserts these characters together with a pair of braces. If you use
+@kbd{@key{TAB}} 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 @code{cdlatex-simplify-sub-super-scripts}).
+
+@item @kbd{`}
+@kindex `
+
+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.
+
+@item @kbd{'}
+@kindex '
+
+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.
+@end table
+
+@node Literal Examples
+@section Literal Examples
+
+@cindex literal examples, markup rules
+@cindex code line references, markup rules
+
+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.
+
+@cindex @samp{BEGIN_EXAMPLE}
+@cindex example block
+@example
+#+BEGIN_EXAMPLE
+ Some example from a text file.
+#+END_EXAMPLE
+@end example
+
+@cindex comma escape, in literal examples
+There is one limitation, however. You must insert a comma right
+before lines starting with either @samp{*}, @samp{,*}, @samp{#+} or @samp{,#+}, as those
+may be interpreted as outlines nodes or some other special syntax.
+Org transparently strips these additional commas whenever it accesses
+the contents of the block.
+
+@example
+#+BEGIN_EXAMPLE
+,* I am no real headline
+#+END_EXAMPLE
+@end example
+
+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:
+
+@example
+Here is an example
+ : Some example from a text file.
+@end example
+
+@cindex formatting source code, markup rules
+@vindex org-latex-listings
+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@footnote{This works automatically for the HTML backend (it requires
+version 1.34 of the @samp{htmlize.el} package, which you need to install).
+Fontified code chunks in @LaTeX{} can be achieved using either the
+@uref{https://www.ctan.org/pkg/listings, listings} package or the @uref{https://www.ctan.org/pkg/minted, minted} package. Refer to
+@code{org-latex-listings} for details.}. 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@footnote{Source code in code blocks may also be evaluated either
+interactively or on export. See @ref{Working with Source Code} for more
+information on evaluating code blocks.},
+see @ref{Structure Templates} for shortcuts to easily insert code blocks.
+
+@cindex @samp{BEGIN_SRC}
+@cindex source block
+@example
+#+BEGIN_SRC emacs-lisp
+ (defun org-xor (a b)
+ "Exclusive or."
+ (if a (not b) b))
+ #+END_SRC
+@end example
+
+Both in @samp{example} and in @samp{src} snippets, you can add a @samp{-n} switch to
+the end of the @samp{#+BEGIN} line, to get the lines of the example
+numbered. The @samp{-n} takes an optional numeric argument specifying the
+starting line number of the block. If you use a @samp{+n} switch, the
+numbering from the previous numbered snippet is continued in the
+current one. The @samp{+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.
+
+@example
+#+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
+@end example
+
+In literal examples, Org interprets strings like @samp{(ref:name)} as
+labels, and use them as targets for special hyperlinks like
+@samp{[[(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 @samp{-r} switch which @emph{removes} the labels from the
+source code@footnote{Adding @samp{-k} to @samp{-n -r} @emph{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.}. With the @samp{-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:
+
+@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.
+@end example
+
+@cindex indentation, in source blocks
+Source code and examples may be @emph{indented} in order to align nicely
+with the surrounding text, and in particular with plain list structure
+(see @ref{Plain Lists}). By default, Org only retains the relative
+indentation between lines, e.g., when exporting the contents of the
+block. However, you can use the @samp{-i} switch to also preserve the
+global indentation, if it does matter. See @ref{Editing Source Code}.
+
+@vindex org-coderef-label-format
+If the syntax for the label format conflicts with the language syntax,
+use a @samp{-l} switch to change the format, for example
+
+@example
+#+BEGIN_SRC pascal -n -r -l "((%s))"
+@end example
+
+
+@noindent
+See also the variable @code{org-coderef-label-format}.
+
+HTML export also allows examples to be published as text areas (see
+@ref{Text areas in HTML export}).
+
+Because the @samp{#+BEGIN} @dots{} @samp{#+END} patterns need to be added so often,
+a shortcut is provided (see @ref{Structure Templates}).
+
+@table @asis
+@item @kbd{C-c '} (@code{org-edit-special})
+@kindex C-c '
+@findex 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 @kbd{C-c '} again. 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@footnote{You may select a different mode with the variable
+@code{org-edit-fixed-width-region-mode}.} to allow creating
+ASCII drawings easily. Using this command in an empty line creates
+a new fixed-width region.
+@end table
+
+@cindex storing link, in a source code buffer
+Calling @code{org-store-link} (see @ref{Handling Links}) while editing a source
+code example in a temporary buffer created with @kbd{C-c '}
+prompts for a label. Make sure that it is unique in the current
+buffer, and insert it with the proper formatting like @samp{(ref:label)} at
+the end of the current line. Then the label is stored as a link
+@samp{(label)}, for retrieval with @kbd{C-c C-l}.
+
+@node Images
+@section Images
+
+@cindex inlining images
+@cindex images, markup rules
+An image is a link to an image file@footnote{What Emacs considers to be an image depends on
+@code{image-file-name-extensions} and @code{image-file-name-regexps}.} that does not have
+a description part, for example
+
+@example
+./img/cat.jpg
+@end example
+
+
+If you wish to define a caption for the image (see @ref{Captions}) and
+maybe a label for internal cross references (see @ref{Internal Links}),
+make sure that the link is on a line by itself and precede it with
+@samp{CAPTION} and @samp{NAME} keywords as follows:
+
+@example
+#+CAPTION: This is the caption for the next figure link (or table)
+#+NAME: fig:SED-HR4049
+[[./img/a.jpg]]
+@end example
+
+Such images can be displayed within the buffer with the following
+command:
+
+@table @asis
+@item @kbd{C-c C-x C-v} (@code{org-toggle-inline-images})
+@kindex C-c C-x C-v
+@findex org-toggle-inline-images
+@vindex org-startup-with-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
+@code{org-startup-with-inline-images}@footnote{The variable @code{org-startup-with-inline-images} can be set
+within a buffer with the @samp{STARTUP} options @samp{inlineimages} and
+@samp{noinlineimages}.}.
+@end table
+
+@node Captions
+@section Captions
+
+@cindex captions, markup rules
+@cindex @samp{CAPTION}, keyword
+
+You can assign a caption to a specific part of a document by inserting
+a @samp{CAPTION} keyword immediately before it:
+
+@example
+#+CAPTION: This is the caption for the next table (or link)
+| ... | ... |
+|-----+-----|
+@end example
+
+Optionally, the caption can take the form:
+
+@example
+#+CAPTION[Short caption]: Longer caption.
+@end example
+
+
+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.
+
+@node Horizontal Rules
+@section Horizontal Rules
+
+@cindex horizontal rules, markup rules
+A line consisting of only dashes, and at least 5 of them, is exported
+as a horizontal line.
+
+@node Creating Footnotes
+@section Creating Footnotes
+
+@cindex 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 @samp{fn:}. For example:
+
+@example
+The Org homepage[fn:1] now looks a lot better than it used to.
+...
+[fn:1] The link is: https://orgmode.org
+@end example
+
+Org mode extends the number-based syntax to @emph{named} footnotes and
+optional inline definition. Here are the valid references:
+
+@table @asis
+@item @samp{[fn:NAME]}
+A named footnote reference, where @var{NAME} is a unique
+label word, or, for simplicity of automatic creation, a number.
+
+@item @samp{[fn:: This is the inline definition of this footnote]}
+An anonymous footnote where the definition is given directly at the
+reference point.
+
+@item @samp{[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 @samp{[fn:NAME]} to create additional references.
+@end table
+
+@vindex org-footnote-auto-label
+Footnote labels can be created automatically, or you can create names
+yourself. This is handled by the variable @code{org-footnote-auto-label}
+and its corresponding @samp{STARTUP} keywords. See the docstring of that
+variable for details.
+
+The following command handles footnotes:
+
+@table @asis
+@item @kbd{C-c C-x f}
+The footnote action command.
+
+@kindex C-c C-x f
+When point is on a footnote reference, jump to the definition. When
+it is at a definition, jump to the---first---reference.
+
+@vindex org-footnote-define-inline
+@vindex org-footnote-section
+Otherwise, create a new footnote. Depending on the variable
+@code{org-footnote-define-inline}@footnote{The corresponding in-buffer setting is: @samp{#+STARTUP: fninline}
+or @samp{#+STARTUP: nofninline}.}, the definition is placed right
+into the text as part of the reference, or separately into the
+location determined by the variable @code{org-footnote-section}.
+
+When this command is called with a prefix argument, a menu of
+additional options is offered:
+
+@multitable @columnfractions 0.1 0.9
+@item @kbd{s}
+@tab Sort the footnote definitions by reference sequence.
+@item @kbd{r}
+@tab Renumber the simple @samp{fn:N} footnotes.
+@item @kbd{S}
+@tab Short for first @kbd{r}, then @kbd{s} action.
+@item @kbd{n}
+@tab Rename all footnotes into a @samp{fn:1} @dots{} @samp{fn:n} sequence.
+@item @kbd{d}
+@tab Delete the footnote at point, including definition and references.
+@end multitable
+
+@vindex org-footnote-auto-adjust
+Depending on the variable @code{org-footnote-auto-adjust}@footnote{The corresponding in-buffer options are @samp{#+STARTUP: fnadjust}
+and @samp{#+STARTUP: nofnadjust}.},
+renumbering and sorting footnotes can be automatic after each
+insertion or deletion.
+
+@item @kbd{C-c C-c}
+@kindex 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
+@kbd{C-c C-x f}.
+
+@item @kbd{C-c C-o} or @kbd{mouse-1/2}
+@kindex C-c C-o
+@kindex mouse-1
+@kindex mouse-2
+Footnote labels are also links to the corresponding definition or
+reference, and you can use the usual commands to follow these links.
+@end table
+
+@node Exporting
+@chapter Exporting
+
+@cindex 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 @ref{Document Structure}) and markup (see @ref{Markup for Rich Contents}) as possible.
+
+@cindex export back-end
+The libraries responsible for translating Org files to other formats
+are called @emph{back-ends}. Org ships with support for the following
+back-ends:
+
+@itemize
+@item
+@emph{ascii} (ASCII format)
+@item
+@emph{beamer} (@LaTeX{} Beamer format)
+@item
+@emph{html} (HTML format)
+@item
+@emph{icalendar} (iCalendar format)
+@item
+@emph{latex} (@LaTeX{} format)
+@item
+@emph{md} (Markdown format)
+@item
+@emph{odt} (OpenDocument Text format)
+@item
+@emph{org} (Org format)
+@item
+@emph{texinfo} (Texinfo format)
+@item
+@emph{man} (Man page format)
+@end itemize
+
+Users can install libraries for additional formats from the Emacs
+packaging system. For easy discovery, these packages have a common
+naming scheme: @code{ox-NAME}, where @var{NAME} is a format. For
+example, @code{ox-koma-letter} for @emph{koma-letter} back-end. More libraries
+can be found in the @samp{org-contrib} repository (see @ref{Installation}).
+
+@vindex org-export-backends
+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 @code{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:
+
+@lisp
+(require 'ox-md)
+@end lisp
+
+@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:: Producing presentations and slides.
+* 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.
+@end menu
+
+@node The Export Dispatcher
+@section The Export Dispatcher
+
+@cindex dispatcher, for export commands
+@cindex 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.
+
+@vindex org-export-dispatch-use-expert-ui
+Org also has a minimal prompt interface for the export dispatcher.
+When the variable @code{org-export-dispatch-use-expert-ui} is set to
+a non-@code{nil} value, Org prompts in the minibuffer. To switch back to
+the hierarchical menu, press @kbd{?}.
+
+@table @asis
+@item @kbd{C-c C-e} (@code{org-export})
+@kindex C-c C-e
+@findex org-export
+
+Invokes the export dispatcher interface. The options show default
+settings. The @kbd{C-u} prefix argument preserves options from
+the previous export, including any sub-tree selections.
+@end table
+
+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.
+
+@table @asis
+@item @kbd{C-a}
+@kindex C-c C-e 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 @emph{export stack}.
+To view this stack, call the export dispatcher with a double
+@kbd{C-u} prefix argument. If already in the export dispatcher
+menu, @kbd{&} displays the stack.
+
+@vindex org-export-in-background
+You can make asynchronous export the default by setting
+@code{org-export-in-background}.
+
+@vindex org-export-async-init-file
+You can set the initialization file used by the background process
+by setting @code{org-export-async-init-file}.
+
+@item @kbd{C-b}
+@kindex C-c C-e 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 @samp{<head>...</head>} in HTML@.
+
+@item @kbd{C-s}
+@kindex C-c C-e 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.
+
+@vindex org-export-initial-scope
+To make sub-tree export the default, customize the variable
+@code{org-export-initial-scope}.
+
+@item @kbd{C-v}
+@kindex C-c C-e 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. See also @ref{Sparse Trees}.
+@end table
+
+@node Export Settings
+@section Export Settings
+
+@cindex options, for export
+@cindex Export, settings
+
+@cindex @samp{OPTIONS}, keyword
+Export options can be set: globally with variables; for an individual
+file by making variables buffer-local with in-buffer settings (see
+@ref{In-buffer Settings}); by setting individual keywords or
+specifying them in compact form with the @samp{OPTIONS} keyword; or for
+a tree by setting properties (see @ref{Properties and Columns}). Options
+set at a specific level override options set at a more general level.
+
+@cindex @samp{SETUPFILE}, keyword
+In-buffer settings may appear anywhere in the file, either directly or
+indirectly through a file included using @samp{#+SETUPFILE: filename or
+URL} syntax. Option keyword sets tailored to a particular back-end
+can be inserted from the export dispatcher (see @ref{The Export Dispatcher}) using the @samp{Insert template} command by pressing
+@kbd{#}. To insert keywords individually, a good way to make
+sure the keyword is correct is to type @samp{#+} and then to use
+@kbd{M-@key{TAB}}@footnote{Many desktops intercept @kbd{M-@key{TAB}} to switch windows.
+Use @kbd{C-M-i} or @kbd{@key{ESC} @key{TAB}} instead.} for completion.
+
+The export keywords available for every back-end, and their equivalent
+global variables, include:
+
+@table @asis
+@item @samp{AUTHOR}
+@cindex @samp{AUTHOR}, keyword
+@vindex user-full-name
+The document author (@code{user-full-name}).
+
+@item @samp{CREATOR}
+@cindex @samp{CREATOR}, keyword
+@vindex org-expot-creator-string
+Entity responsible for output generation
+(@code{org-export-creator-string}).
+
+@item @samp{DATE}
+@cindex @samp{DATE}, keyword
+@vindex org-export-date-timestamp-format
+A date or a time-stamp@footnote{The variable @code{org-export-date-timestamp-format} defines how
+this timestamp are exported.}.
+
+@item @samp{EMAIL}
+@cindex @samp{EMAIL}, keyword
+@vindex user-mail-address
+The email address (@code{user-mail-address}).
+
+@item @samp{LANGUAGE}
+@cindex @samp{LANGUAGE}, keyword
+@vindex org-export-default-language
+Language to use for translating certain strings
+(@code{org-export-default-language}). With @samp{#+LANGUAGE: fr}, for
+example, Org translates @samp{Table of contents} to the French @samp{Table des
+ matières}@footnote{For export to @LaTeX{} format---or @LaTeX{}-related formats such as
+Beamer---, the @samp{org-latex-package-alist} variable needs further
+configuration. See @ref{@LaTeX{} specific export settings}.}.
+
+@item @samp{SELECT_TAGS}
+@cindex @samp{SELECT_TAGS}, keyword
+@vindex org-export-select-tags
+The default value is @samp{("export")}. When a tree is tagged with
+@samp{export} (@code{org-export-select-tags}), Org selects that tree and its
+sub-trees for export. Org excludes trees with @samp{noexport} tags, see
+below. When selectively exporting files with @samp{export} tags set, Org
+does not export any text that appears before the first headline.
+
+@item @samp{EXCLUDE_TAGS}
+@cindex @samp{EXCLUDE_TAGS}, keyword
+@vindex org-export-exclude-tags
+The default value is @samp{("noexport")}. When a tree is tagged with
+@samp{noexport} (@code{org-export-exclude-tags}), Org excludes that tree and
+its sub-trees from export. Entries tagged with @samp{noexport} are
+unconditionally excluded from the export, even if they have an
+@samp{export} tag. Even if a sub-tree is not exported, Org executes any
+code blocks contained there.
+
+@item @samp{TITLE}
+@cindex @samp{TITLE}, keyword
+@cindex document title
+Org displays this title. For long titles, use multiple @samp{#+TITLE}
+lines.
+
+@item @samp{EXPORT_FILE_NAME}
+@cindex @samp{EXPORT_FILE_NAME}, keyword
+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.
+@end table
+
+The @samp{OPTIONS} keyword is a compact form. To configure multiple
+options, use several @samp{OPTIONS} lines. @samp{OPTIONS} recognizes the
+following arguments.
+
+@table @asis
+@item @code{'}
+@vindex org-export-with-smart-quotes
+Toggle smart quotes (@code{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.
+
+@item @code{*}
+@vindex org-export-with-emphasize
+Toggle emphasized text (@code{org-export-with-emphasize}).
+
+@item @code{-}
+@vindex org-export-with-special-strings
+Toggle conversion of special strings
+(@code{org-export-with-special-strings}).
+
+@item @code{:}
+@vindex org-export-with-fixed-width
+Toggle fixed-width sections (@code{org-export-with-fixed-width}).
+
+@item @code{<}
+@vindex org-export-with-timestamps
+Toggle inclusion of time/date active/inactive stamps
+(@code{org-export-with-timestamps}).
+
+@item @code{\n}
+@vindex org-export-preserve-breaks
+Toggles whether to preserve line breaks
+(@code{org-export-preserve-breaks}).
+
+@item @code{^}
+@vindex org-export-with-sub-superscripts
+Toggle @TeX{}-like syntax for sub- and superscripts. If you write
+@samp{^:@{@}}, @samp{a_@{b@}} is interpreted, but the simple @samp{a_b} is left as it
+is (@code{org-export-with-sub-superscripts}).
+
+@item @code{arch}
+@vindex org-export-with-archived-trees
+Configure how archived trees are exported. When set to @code{headline},
+the export process skips the contents and processes only the
+headlines (@code{org-export-with-archived-trees}).
+
+@item @code{author}
+@vindex org-export-with-author
+Toggle inclusion of author name into exported file
+(@code{org-export-with-author}).
+
+@item @code{broken-links}
+@vindex org-export-with-broken-links
+Toggles if Org should continue exporting upon finding a broken
+internal link. When set to @code{mark}, Org clearly marks the problem
+link in the output (@code{org-export-with-broken-links}).
+
+@item @code{c}
+@vindex org-export-with-clocks
+Toggle inclusion of @samp{CLOCK} keywords (@code{org-export-with-clocks}).
+
+@item @code{creator}
+@vindex org-export-with-creator
+Toggle inclusion of creator information in the exported file
+(@code{org-export-with-creator}).
+
+@item @code{d}
+@vindex org-export-with-drawers
+Toggles inclusion of drawers, or list of drawers to include, or list
+of drawers to exclude (@code{org-export-with-drawers}).
+
+@item @code{date}
+@vindex org-export-with-date
+Toggle inclusion of a date into exported file
+(@code{org-export-with-date}).
+
+@item @code{e}
+@vindex org-export-with-entities
+Toggle inclusion of entities (@code{org-export-with-entities}).
+
+@item @code{email}
+@vindex org-export-with-email
+Toggle inclusion of the author's e-mail into exported file
+(@code{org-export-with-email}).
+
+@item @code{f}
+@vindex org-export-with-footnotes
+Toggle the inclusion of footnotes (@code{org-export-with-footnotes}).
+
+@item @code{H}
+@vindex org-export-headline-levels
+Set the number of headline levels for export
+(@code{org-export-headline-levels}). Below that level, headlines are
+treated differently. In most back-ends, they become list items.
+
+@item @code{inline}
+@vindex org-export-with-inlinetasks
+Toggle inclusion of inlinetasks (@code{org-export-with-inlinetasks}).
+
+@item @code{num}
+@vindex org-export-with-section-numbers
+@cindex @samp{UNNUMBERED}, property
+Toggle section-numbers (@code{org-export-with-section-numbers}). When
+set to number N, Org numbers only those headlines at level N or
+above. Set @samp{UNNUMBERED} property to non-@code{nil} to disable numbering
+of heading and subheadings entirely. Moreover, when the value is
+@samp{notoc} the headline, and all its children, do not appear in the
+table of contents either (see @ref{Table of Contents}).
+
+@item @code{p}
+@vindex org-export-with-planning
+Toggle export of planning information (@code{org-export-with-planning}).
+``Planning information'' comes from lines located right after the
+headline and contain any combination of these cookies: @samp{SCHEDULED},
+@samp{DEADLINE}, or @samp{CLOSED}.
+
+@item @code{pri}
+@vindex org-export-with-priority
+Toggle inclusion of priority cookies
+(@code{org-export-with-priority}).
+
+@item @code{prop}
+@vindex org-export-with-properties
+Toggle inclusion of property drawers, or list the properties to
+include (@code{org-export-with-properties}).
+
+@item @code{stat}
+@vindex org-export-with-statistics-cookies
+Toggle inclusion of statistics cookies
+(@code{org-export-with-statistics-cookies}).
+
+@item @code{tags}
+@vindex org-export-with-tags
+Toggle inclusion of tags, may also be @code{not-in-toc}
+(@code{org-export-with-tags}).
+
+@item @code{tasks}
+@vindex org-export-with-tasks
+Toggle inclusion of tasks (TODO items); or @code{nil} to remove all
+tasks; or @code{todo} to remove done tasks; or list the keywords to keep
+(@code{org-export-with-tasks}).
+
+@item @code{tex}
+@vindex org-export-with-latex
+@code{nil} does not export; @code{t} exports; @code{verbatim} keeps everything in
+verbatim (@code{org-export-with-latex}).
+
+@item @code{timestamp}
+@vindex org-export-time-stamp-file
+Toggle inclusion of the creation time in the exported file
+(@code{org-export-time-stamp-file}).
+
+@item @code{title}
+@vindex org-export-with-title
+Toggle inclusion of title (@code{org-export-with-title}).
+
+@item @code{toc}
+@vindex org-export-with-toc
+Toggle inclusion of the table of contents, or set the level limit
+(@code{org-export-with-toc}).
+
+@item @code{todo}
+@vindex org-export-with-todo-keywords
+Toggle inclusion of TODO keywords into exported text
+(@code{org-export-with-todo-keywords}).
+
+@item @code{|}
+@vindex org-export-with-tables
+Toggle inclusion of tables (@code{org-export-with-tables}).
+@end table
+
+When exporting sub-trees, special node properties can override the
+above keywords. These properties have an @samp{EXPORT_} prefix. For
+example, @samp{DATE} becomes, @samp{EXPORT_DATE} when used for a specific
+sub-tree. Except for @samp{SETUPFILE}, all other keywords listed above
+have an @samp{EXPORT_} equivalent.
+
+@cindex @samp{BIND}, keyword
+@vindex org-export-allow-bind-keywords
+If @code{org-export-allow-bind-keywords} is non-@code{nil}, Emacs variables can
+become buffer-local during export by using the @samp{BIND} keyword. Its
+syntax is @samp{#+BIND: variable value}. This is particularly useful for
+in-buffer settings that cannot be changed using keywords.
+
+@node Table of Contents
+@section Table of Contents
+
+@cindex table of contents
+@cindex list of tables
+@cindex list of listings
+
+@cindex @samp{toc}, in @samp{OPTIONS} keyword
+@vindex org-export-with-toc
+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
+@code{org-export-with-toc} variable accordingly. You can achieve the same
+on a per file basis, using the following @samp{toc} item in @samp{OPTIONS}
+keyword:
+
+@example
+#+OPTIONS: toc:2 (only include two levels in TOC)
+#+OPTIONS: toc:nil (no default TOC at all)
+@end example
+
+@cindex excluding entries from table of contents
+@cindex table of contents, exclude entries
+Org includes both numbered and unnumbered headlines in the table of
+contents@footnote{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.}. If you need to exclude an unnumbered headline,
+along with all its children, set the @samp{UNNUMBERED} property to @samp{notoc}
+value.
+
+@example
+* Subtree not numbered, not in table of contents either
+ :PROPERTIES:
+ :UNNUMBERED: notoc
+ :END:
+@end example
+
+@cindex @samp{TOC}, keyword
+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 @code{org-export-with-toc}
+variable or with @samp{#+OPTIONS: toc:nil}. Then insert @samp{#+TOC: headlines
+N} at the desired location(s).
+
+@example
+#+OPTIONS: toc:nil
+...
+#+TOC: headlines 2
+@end example
+
+To adjust the table of contents depth for a specific section of the
+Org document, append an additional @samp{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.
+
+@example
+* Section
+#+TOC: headlines 1 local
+@end example
+
+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 @emph{before} hyperref.
+Customize the @code{org-latex-default-packages-alist} variable.
+
+The following example inserts a table of contents that links to the
+children of the specified target.
+
+@example
+* Target
+ :PROPERTIES:
+ :CUSTOM_ID: TargetSection
+ :END:
+** Heading A
+** Heading B
+* Another section
+#+TOC: headlines 1 :target #TargetSection
+@end example
+
+The @samp{:target} attribute is supported in HTML, Markdown, ODT, and ASCII export.
+
+Use the @samp{TOC} keyword to generate list of tables---respectively, all
+listings---with captions.
+
+@example
+#+TOC: listings
+#+TOC: tables
+@end example
+
+@cindex @samp{ALT_TITLE}, property
+Normally Org uses the headline for its entry in the table of contents.
+But with @samp{ALT_TITLE} property, a different entry can be specified for
+the table of contents.
+
+@node Include Files
+@section Include Files
+
+@cindex include files, during export
+@cindex export, include files
+@cindex @samp{INCLUDE}, keyword
+
+During export, you can include the content of another file. For
+example, to include your @samp{.emacs} file, you could use:
+
+@example
+#+INCLUDE: "~/.emacs" src emacs-lisp
+@end example
+
+
+@noindent
+The first parameter is the file name to include. The optional second
+parameter specifies the block type: @samp{example}, @samp{export} or @samp{src}. The
+optional third parameter specifies the source code language to use for
+formatting the contents. This is relevant to both @samp{export} and @samp{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.
+
+@cindex @samp{minlevel}, include
+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 @ref{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
+@samp{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, @samp{: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:
+
+@example
+#+INCLUDE: "~/my-book/chapter2.org" :minlevel 1
+@end example
+
+
+@cindex @samp{lines}, include
+Inclusion of only portions of files are specified using ranges
+parameter with @samp{: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.
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{#+INCLUDE: "~/.emacs" :lines "5-10"}
+@tab Include lines 5 to 10, 10 excluded
+@item @samp{#+INCLUDE: "~/.emacs" :lines "-10"}
+@tab Include lines 1 to 10, 10 excluded
+@item @samp{#+INCLUDE: "~/.emacs" :lines "10-"}
+@tab Include lines from 10 to EOF
+@end multitable
+
+Inclusions may specify a file-link to extract an object matched by
+@code{org-link-search}@footnote{Note that @code{org-link-search-must-match-exact-headline} is
+locally bound to non-@code{nil}. Therefore, @code{org-link-search} only matches
+headlines and named elements.} (see @ref{Search Options}). The
+ranges for @samp{:lines} keyword are relative to the requested element.
+Therefore,
+
+@example
+#+INCLUDE: "./paper.org::*conclusion" :lines 1-20
+@end example
+
+
+@noindent
+includes the first 20 lines of the headline named @samp{conclusion}.
+
+@cindex @samp{only-contents}, include
+To extract only the contents of the matched object, set
+@samp{:only-contents} property to non-@code{nil}. This omits any planning lines
+or property drawers. For example, to include the body of the heading
+with the custom ID @samp{theory}, you can use
+
+@example
+#+INCLUDE: "./paper.org::#theory" :only-contents t
+@end example
+
+
+The following command allows navigating to the included document:
+
+@table @asis
+@item @kbd{C-c '} (@code{org-edit~special})
+@kindex C-c '
+@findex org-edit-special
+
+Visit the included file at point.
+@end table
+
+@node Macro Replacement
+@section Macro Replacement
+
+@cindex macro replacement, during export
+@cindex @samp{MACRO}, keyword
+
+@vindex org-export-global-macros
+Macros replace text snippets during export. Macros are defined
+globally in @code{org-export-global-macros}, or document-wise with the
+following syntax:
+
+@example
+#+MACRO: name replacement text; $1, $2 are arguments
+@end example
+
+
+@noindent
+which can be referenced using @samp{@{@{@{name(arg1, arg2)@}@}@}}@footnote{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.}. For
+example
+
+@example
+#+MACRO: poem Rose is $1, violet's $2. Life's ordered: Org assists you.
+@{@{@{poem(red,blue)@}@}@}
+@end example
+
+@noindent
+becomes
+
+@example
+Rose is red, violet's blue. Life's ordered: Org assists you.
+@end example
+
+
+As a special case, Org parses any replacement text starting with
+@samp{(eval} as an Emacs Lisp expression and evaluates it accordingly.
+Within such templates, arguments become strings. Thus, the following
+macro
+
+@example
+#+MACRO: gnustamp (eval (concat "GNU/" (capitalize $1)))
+@end example
+
+
+@noindent
+turns @samp{@{@{@{gnustamp(linux)@}@}@}} into @samp{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 @samp{CAPTION}, @samp{TITLE},
+@samp{AUTHOR}, @samp{DATE}, and for some back-end specific export options.
+
+Org comes with following pre-defined macros:
+
+@table @asis
+@item @samp{@{@{@{keyword(NAME)@}@}@}}
+@itemx @samp{@{@{@{title@}@}@}}
+@itemx @samp{@{@{@{author@}@}@}}
+@itemx @samp{@{@{@{email@}@}@}}
+@cindex @samp{keyword}, macro
+@cindex @samp{title}, macro
+@cindex @samp{author}, macro
+@cindex @samp{email}, macro
+The @samp{keyword} macro collects all values from @var{NAME}
+keywords throughout the buffer, separated with white space.
+@samp{title}, @samp{author} and @samp{email} macros are shortcuts for,
+respectively, @samp{@{@{@{keyword(TITLE)@}@}@}}, @samp{@{@{@{keyword(AUTHOR)@}@}@}} and
+@samp{@{@{@{keyword(EMAIL)@}@}@}}.
+
+@item @samp{@{@{@{date@}@}@}}
+@itemx @samp{@{@{@{date(FORMAT)@}@}@}}
+@cindex @samp{date}, macro
+This macro refers to the @samp{DATE} keyword. @var{FORMAT} is an
+optional argument to the @samp{date} macro that is used only if @samp{DATE} is
+a single timestamp. @var{FORMAT} should be a format string
+understood by @code{format-time-string}.
+
+@item @samp{@{@{@{time(FORMAT)@}@}@}}
+@itemx @samp{@{@{@{modification-time(FORMAT, VC)@}@}@}}
+@cindex @samp{time}, macro
+@cindex @samp{modification-time}, macro
+These macros refer to the document's date and time of export and
+date and time of modification. @var{FORMAT} is a string
+understood by @code{format-time-string}. If the second argument to the
+@code{modification-time} macro is non-@code{nil}, Org uses @samp{vc.el} to retrieve
+the document's modification time from the version control system.
+Otherwise Org reads the file attributes.
+
+@item @samp{@{@{@{input-file@}@}@}}
+@cindex @samp{input-file}, macro
+This macro refers to the filename of the exported file.
+
+@item @samp{@{@{@{property(PROPERTY-NAME)@}@}@}}
+@itemx @samp{@{@{@{property(PROPERTY-NAME, SEARCH OPTION)@}@}@}}
+@cindex @samp{property}, macro
+This macro returns the value of property @var{PROPERTY-NAME} in
+the current entry. If @var{SEARCH-OPTION} (see @ref{Search Options}) refers to a remote entry, use it instead.
+
+@item @samp{@{@{@{n@}@}@}}
+@itemx @samp{@{@{@{n(NAME)@}@}@}}
+@itemx @samp{@{@{@{n(NAME, ACTION)@}@}@}}
+@cindex @samp{n}, macro
+@cindex counter, macro
+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 @var{NAME}
+values. If @var{ACTION} is @samp{-}, 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 @var{NAME} empty to reset the default
+counter.
+@end table
+
+@cindex @samp{results}, macro
+Moreover, inline source blocks (see @ref{Structure of Code Blocks}) use the
+special @samp{results} macro to mark their output. As such, you are
+advised against re-defining it, unless you know what you are doing.
+
+@vindex org-hide-macro-markers
+The surrounding brackets can be made invisible by setting
+@code{org-hide-macro-markers} to a non-@code{nil} value.
+
+Org expands macros at the very beginning of the export process.
+
+@node Comment Lines
+@section Comment Lines
+
+@cindex exporting, not
+
+@cindex comment lines
+Lines starting with zero or more whitespace characters followed by one
+@samp{#} and a whitespace are treated as comments and, as such, are not
+exported.
+
+@cindex @samp{BEGIN_COMMENT}
+@cindex comment block
+Likewise, regions surrounded by @samp{#+BEGIN_COMMENT} @dots{} @samp{#+END_COMMENT}
+are not exported.
+
+@cindex comment trees
+Finally, a @samp{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@footnote{For a less drastic behavior, consider using a select tag (see
+@ref{Export Settings}) instead.}. The command below helps changing the
+comment status of a headline.
+
+@table @asis
+@item @kbd{C-c ;} (@code{org-toggle-comment})
+@kindex C-c ;
+@findex org-toggle-comment
+
+Toggle the @samp{COMMENT} keyword at the beginning of an entry.
+@end table
+
+@node ASCII/Latin-1/UTF-8 export
+@section ASCII/Latin-1/UTF-8 export
+
+@cindex ASCII export
+@cindex Latin-1 export
+@cindex 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.
+
+@vindex org-ascii-text-width
+On export, Org fills and justifies text according to the text width
+set in @code{org-ascii-text-width}.
+
+@vindex org-ascii-links-to-notes
+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 @code{org-ascii-links-to-notes} for details.
+
+@anchor{ASCII export commands}
+@subheading ASCII export commands
+
+@table @asis
+@item @kbd{C-c C-e t a} (@code{org-ascii-export-to-ascii})
+@itemx @kbd{C-c C-e t l}
+@itemx @kbd{C-c C-e t u}
+@kindex C-c C-e t a
+@kindex C-c C-e t l
+@kindex C-c C-e t u
+@findex org-ascii-export-to-ascii
+
+Export as an ASCII file with a @samp{.txt} extension. For @samp{myfile.org},
+Org exports to @samp{myfile.txt}, overwriting without warning. For
+@samp{myfile.txt}, Org exports to @samp{myfile.txt.txt} in order to prevent
+data loss.
+
+@item @kbd{C-c C-e t A} (@code{org-ascii-export-to-ascii})
+@itemx @kbd{C-c C-e t L}
+@itemx @kbd{C-c C-e t U}
+@kindex C-c C-e t A
+@kindex C-c C-e t L
+@kindex C-c C-e t U
+@findex org-ascii-export-as-ascii
+
+Export to a temporary buffer. Does not create a file.
+@end table
+
+@anchor{ASCII specific export settings}
+@subheading 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 @ref{Export Settings}).
+
+@table @asis
+@item @samp{SUBTITLE}
+@cindex @samp{SUBTITLE}, keyword
+The document subtitle. For long subtitles, use multiple
+@samp{#+SUBTITLE} lines in the Org file. Org prints them on one
+continuous line, wrapping into multiple lines if necessary.
+@end table
+
+@anchor{Header and sectioning structure}
+@subheading 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 @ref{Export Settings}.
+
+@anchor{Quoting ASCII text}
+@subheading 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:
+
+@cindex @samp{ASCII}, keyword
+@cindex @samp{BEGIN_EXPORT ascii}
+@example
+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
+@end example
+
+@anchor{ASCII specific attributes}
+@subheading ASCII specific attributes
+
+@cindex @samp{ATTR_ASCII}, keyword
+@cindex horizontal rules, in ASCII export
+
+ASCII back-end recognizes only one attribute, @samp{:width}, which
+specifies the width of a horizontal rule in number of characters. The
+keyword and syntax for specifying widths is:
+
+@example
+#+ATTR_ASCII: :width 10
+-----
+@end example
+
+@anchor{ASCII special blocks}
+@subheading ASCII special blocks
+
+@cindex special blocks, in ASCII export
+@cindex @samp{BEGIN_JUSTIFYLEFT}
+@cindex @samp{BEGIN_JUSTIFYRIGHT}
+
+Besides @samp{#+BEGIN_CENTER} blocks (see @ref{Paragraphs}), ASCII back-end has
+these two left and right justification blocks:
+
+@example
+#+BEGIN_JUSTIFYLEFT
+It's just a jump to the left...
+#+END_JUSTIFYLEFT
+
+#+BEGIN_JUSTIFYRIGHT
+...and then a step to the right.
+#+END_JUSTIFYRIGHT
+@end example
+
+@node Beamer Export
+@section Beamer Export
+
+@cindex 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.
+@end menu
+
+@node Beamer export commands
+@subsection Beamer export commands
+
+@table @asis
+@item @kbd{C-c C-e l b} (@code{org-beamer-export-to-latex})
+@kindex C-c C-e l b
+@findex org-beamer-export-to-latex
+
+Export as @LaTeX{} file with a @samp{.tex} extension. For @samp{myfile.org}, Org
+exports to @samp{myfile.tex}, overwriting without warning.
+
+@item @kbd{C-c C-e l B} (@code{org-beamer-export-as-latex})
+@kindex C-c C-e l B
+@findex org-beamer-export-as-latex
+
+Export to a temporary buffer. Does not create a file.
+
+@item @kbd{C-c C-e l P} (@code{org-beamer-export-to-pdf})
+@kindex C-c C-e l P
+@findex org-beamer-export-to-pdf
+
+Export as @LaTeX{} file and then convert it to PDF format.
+
+@item @kbd{C-c C-e l O}
+@kindex C-c C-e l O
+
+Export as @LaTeX{} file, convert it to PDF format, and then open the
+PDF file.
+@end table
+
+@node Beamer specific export settings
+@subsection 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 @ref{Export Settings}).
+
+@table @asis
+@item @samp{BEAMER_THEME}
+@cindex @samp{BEAMER_THEME}, keyword
+@vindex org-beamer-theme
+The Beamer layout theme (@code{org-beamer-theme}). Use square brackets
+for options. For example:
+
+@example
+#+BEAMER_THEME: Rochester [height=20pt]
+@end example
+
+@item @samp{BEAMER_FONT_THEME}
+@cindex @samp{BEAMER_FONT_THEME}, keyword
+The Beamer font theme.
+
+@item @samp{BEAMER_INNER_THEME}
+@cindex @samp{BEAMER_INNER_THEME}, keyword
+The Beamer inner theme.
+
+@item @samp{BEAMER_OUTER_THEME}
+@cindex @samp{BEAMER_OUTER_THEME}, keyword
+The Beamer outer theme.
+
+@item @samp{BEAMER_HEADER}
+@cindex @samp{BEAMER_HEADER}, keyword
+Arbitrary lines inserted in the preamble, just before the @samp{hyperref}
+settings.
+
+@item @samp{DESCRIPTION}
+@cindex @samp{DESCRIPTION}, keyword
+The document description. For long descriptions, use multiple
+@samp{DESCRIPTION} keywords. By default, @samp{hyperref} inserts
+@samp{DESCRIPTION} as metadata. Use @code{org-latex-hyperref-template} to
+configure document metadata. Use @code{org-latex-title-command} to
+configure typesetting of description as part of front matter.
+
+@item @samp{KEYWORDS}
+@cindex @samp{KEYWORDS}, keyword
+The keywords for defining the contents of the document. Use
+multiple @samp{KEYWORDS} lines if necessary. By default, @samp{hyperref}
+inserts @samp{KEYWORDS} as metadata. Use @code{org-latex-hyperref-template}
+to configure document metadata. Use @code{org-latex-title-command} to
+configure typesetting of keywords as part of front matter.
+
+@item @samp{SUBTITLE}
+@cindex @samp{SUBTITLE}, keyword
+Document's subtitle. For typesetting, use
+@code{org-beamer-subtitle-format} string. Use
+@code{org-latex-hyperref-template} to configure document metadata. Use
+@code{org-latex-title-command} to configure typesetting of subtitle as
+part of front matter.
+@end table
+
+@node Frames and Blocks in Beamer
+@subsection 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.
+
+@itemize
+@item
+@vindex org-beamer-frame-level
+Org headlines become Beamer frames when the heading level in Org is
+equal to @code{org-beamer-frame-level} or @samp{H} value in a @samp{OPTIONS} line
+(see @ref{Export Settings}).
+
+@cindex @samp{BEAMER_ENV}, property
+Org overrides headlines to frames conversion for the current tree of
+an Org file if it encounters the @samp{BEAMER_ENV} property set to
+@samp{frame} or @samp{fullframe}. Org ignores whatever
+@code{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.
+
+@item
+Org exports a Beamer frame's objects as block environments. Org can
+enforce wrapping in special block types when @samp{BEAMER_ENV} property
+is set@footnote{If @samp{BEAMER_ENV} is set, Org export adds @samp{B_environment} tag
+to make it visible. The tag serves as a visual aid and has no
+semantic relevance.}. For valid values see
+@code{org-beamer-environments-default}. To add more values, see
+@code{org-beamer-environments-extra}.
+@vindex org-beamer-environments-default
+@vindex org-beamer-environments-extra
+
+@item
+@cindex @samp{BEAMER_REF}, property
+If @samp{BEAMER_ENV} is set to @samp{appendix}, Org exports the entry as an
+appendix. When set to @samp{note}, Org exports the entry as a note
+within the frame or between frames, depending on the entry's heading
+level. When set to @samp{noteNH}, Org exports the entry as a note
+without its title. When set to @samp{againframe}, Org exports the entry
+with @samp{\againframe} command, which makes setting the @samp{BEAMER_REF}
+property mandatory because @samp{\againframe} needs frame to resume.
+
+When @samp{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 @samp{column}
+environment. @@end itemize
+
+@cindex @samp{BEAMER_ACT}, property
+@cindex @samp{BEAMER_OPT}, property
+When @samp{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 @samp{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
+@samp{fragile} option for any code that may require a verbatim block.
+
+@cindex @samp{BEAMER_COL}, property
+To create a column on the Beamer slide, use the @samp{BEAMER_COL}
+property for its headline in the Org file. Set the value of
+@samp{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 @samp{BEAMER_ENV} property.
+@end itemize
+
+@node Beamer specific syntax
+@subsection 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,
+@samp{#+LATEX:} or @samp{#+ATTR_LATEX:}. See @ref{@LaTeX{} Export}, for details.
+
+Beamer export wraps the table of contents generated with @samp{toc:t}
+@samp{OPTION} keyword in a @samp{frame} environment. Beamer export does not
+wrap the table of contents generated with @samp{TOC} keyword (see @ref{Table of Contents}). Use square brackets for specifying options.
+
+@example
+#+TOC: headlines [currentsection]
+@end example
+
+
+Insert Beamer-specific code using the following constructs:
+
+@cindex @samp{BEAMER}, keyword
+@cindex @samp{BEGIN_EXPORT beamer}
+@example
+#+BEAMER: \pause
+
+#+BEGIN_EXPORT beamer
+ Only Beamer export back-end exports this.
+#+END_BEAMER
+
+Text @@@@beamer:some code@@@@ within a paragraph.
+@end example
+
+Inline constructs, such as the last one above, are useful for adding
+overlay specifications to objects with @code{bold}, @code{item}, @code{link},
+@code{radio-target} and @code{target} types. Enclose the value in angular
+brackets and place the specification at the beginning of the object as
+shown in this example:
+
+@example
+A *@@@@beamer:<2->@@@@useful* feature
+@end example
+
+
+@cindex @samp{ATTR_BEAMER}, keyword
+Beamer export recognizes the @samp{ATTR_BEAMER} keyword with the following
+attributes from Beamer configurations: @samp{:environment} for changing
+local Beamer environment, @samp{:overlay} for specifying Beamer overlays in
+angular or square brackets, and @samp{:options} for inserting optional
+arguments.
+
+@example
+#+ATTR_BEAMER: :environment nonindentlist
+- item 1, not indented
+- item 2, not indented
+- item 3, not indented
+@end example
+
+@example
+#+ATTR_BEAMER: :overlay <+->
+- item 1
+- item 2
+@end example
+
+@example
+#+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$.
+@end example
+
+@node Editing support
+@subsection Editing support
+
+Org Beamer mode is a special minor mode for faster editing of Beamer
+documents.
+
+@example
+#+STARTUP: beamer
+@end example
+
+
+@table @asis
+@item @kbd{C-c C-b} (@code{org-beamer-select-environment})
+@kindex C-c C-b
+@findex org-beamer-select-environment
+
+Org Beamer mode provides this key for quicker selections in Beamer
+normal environments, and for selecting the @samp{BEAMER_COL} property.
+@end table
+
+@node A Beamer example
+@subsection A Beamer example
+
+Here is an example of an Org document ready for Beamer export.
+
+@example
+#+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!
+@end example
+
+@node HTML Export
+@section HTML Export
+
+@cindex 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.
+* Headlines in HTML export:: Formatting headlines.
+* 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.
+@end menu
+
+@node HTML export commands
+@subsection HTML export commands
+
+@table @asis
+@item @kbd{C-c C-e h h} (@code{org-html-export-to-html})
+@kindex C-c C-e h h
+@kindex C-c C-e h o
+@findex org-html-export-to-html
+
+Export as HTML file with a @samp{.html} extension. For @samp{myfile.org}, Org
+exports to @samp{myfile.html}, overwriting without warning. @kbd{C-c C-e h o} exports to HTML and opens it in a web browser.
+
+@item @kbd{C-c C-e h H} (@code{org-html-export-as-html})
+@kindex C-c C-e h H
+@findex org-html-export-as-html
+
+Exports to a temporary buffer. Does not create a file.
+@end table
+
+@node HTML specific export settings
+@subsection HTML specific export settings
+
+HTML export has a number of keywords, similar to the general options
+settings described in @ref{Export Settings}.
+
+@table @asis
+@item @samp{DESCRIPTION}
+@cindex @samp{DESCRIPTION}, keyword
+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 @samp{DESCRIPTION} lines. The exporter takes care of wrapping
+the lines properly.
+
+The exporter includes a number of other meta tags, which can be customized
+by modifying @code{org-html-meta-tags}.
+
+@item @samp{HTML_DOCTYPE}
+@cindex @samp{HTML_DOCTYPE}, keyword
+@vindex org-html-doctype
+Specify the document type, for example: HTML5 (@code{org-html-doctype}).
+
+@item @samp{HTML_CONTAINER}
+@cindex @samp{HTML_CONTAINER}, keyword
+@vindex org-html-container-element
+Specify the HTML container, such as @samp{div}, for wrapping sections and
+elements (@code{org-html-container-element}).
+
+@item @samp{HTML_LINK_HOME}
+@cindex @samp{HTML_LINK_HOME}, keyword
+@vindex org-html-link-home
+The URL for home link (@code{org-html-link-home}).
+
+@item @samp{HTML_LINK_UP}
+@cindex @samp{HTML_LINK_UP}, keyword
+@vindex org-html-link-up
+The URL for the up link of exported HTML pages (@code{org-html-link-up}).
+
+@item @samp{HTML_MATHJAX}
+@cindex @samp{HTML_MATHJAX}, keyword
+@vindex org-html-mathjax-options
+Options for MathJax (@code{org-html-mathjax-options}). MathJax is used
+to typeset @LaTeX{} math in HTML documents. See @ref{Math formatting in HTML export}, for an example.
+
+@item @samp{HTML_HEAD}
+@cindex @samp{HTML_HEAD}, keyword
+@vindex org-html-head
+Arbitrary lines for appending to the HTML document's head
+(@code{org-html-head}).
+
+@item @samp{HTML_HEAD_EXTRA}
+@cindex @samp{HTML_HEAD_EXTRA}, keyword
+@vindex org-html-head-extra
+More arbitrary lines for appending to the HTML document's head
+(@code{org-html-head-extra}).
+
+@item @samp{KEYWORDS}
+@cindex @samp{KEYWORDS}, keyword
+Keywords to describe the document's content. HTML exporter inserts
+these keywords as HTML meta tags. For long keywords, use multiple
+@samp{KEYWORDS} lines.
+
+@item @samp{LATEX_HEADER}
+@cindex @samp{LATEX_HEADER}, keyword
+Arbitrary lines for appending to the preamble; HTML exporter appends
+when transcoding @LaTeX{} fragments to images (see @ref{Math formatting in HTML export}).
+
+@item @samp{SUBTITLE}
+@cindex @samp{SUBTITLE}, keyword
+The document's subtitle. HTML exporter formats subtitle if document
+type is @samp{HTML5} and the CSS has a @samp{subtitle} class.
+@end table
+
+Some of these keywords are explained in more detail in the following
+sections of the manual.
+
+@node HTML doctypes
+@subsection HTML doctypes
+
+Org can export to various (X)HTML flavors.
+
+@vindex org-html-doctype
+@vindex org-html-doctype-alist
+Set the @code{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:
+
+@itemize
+@item
+@code{"html4-strict"}
+@item
+@code{"html4-transitional"}
+@item
+@code{"html4-frameset"}
+@item
+@code{"xhtml-strict"}
+@item
+@code{"xhtml-transitional"}
+@item
+@code{"xhtml-frameset"}
+@item
+@code{"xhtml-11"}
+@item
+@code{"html5"}
+@item
+@code{"xhtml5"}
+@end itemize
+
+@noindent
+See the variable @code{org-html-doctype-alist} for details. The default is
+@code{"xhtml-strict"}.
+
+@vindex org-html-html5-fancy
+@cindex @samp{HTML5}, export new elements
+Org's HTML exporter does not by default enable new block elements
+introduced with the HTML5 standard. To enable them, set
+@code{org-html-html5-fancy} to non-@code{nil}. Or use an @samp{OPTIONS} line in the
+file to set @samp{html5-fancy}.
+
+HTML5 documents can now have arbitrary @samp{#+BEGIN} @dots{} @samp{#+END} blocks.
+For example:
+
+@example
+#+BEGIN_aside
+ Lorem ipsum
+#+END_aside
+@end example
+
+@noindent
+exports to:
+
+@example
+<aside>
+ <p>Lorem ipsum</p>
+</aside>
+@end example
+
+@noindent
+while this:
+
+@example
+#+ATTR_HTML: :controls controls :width 350
+#+BEGIN_video
+#+HTML: <source src="movie.mp4" type="video/mp4">
+#+HTML: <source src="movie.ogg" type="video/ogg">
+Your browser does not support the video tag.
+#+END_video
+@end example
+
+@noindent
+exports to:
+
+@example
+<video controls="controls" width="350">
+ <source src="movie.mp4" type="video/mp4">
+ <source src="movie.ogg" type="video/ogg">
+ <p>Your browser does not support the video tag.</p>
+</video>
+@end example
+
+@vindex org-html-html5-elements
+When special blocks do not have a corresponding HTML5 element, the
+HTML exporter reverts to standard translation (see
+@code{org-html-html5-elements}). For example, @samp{#+BEGIN_lederhosen} exports
+to @code{<div class="lederhosen">}.
+
+Special blocks cannot have headlines. For the HTML exporter to wrap
+the headline and its contents in @code{<section>} or @code{<article>} tags, set
+the @samp{HTML_CONTAINER} property for the headline.
+
+@node HTML preamble and postamble
+@subsection HTML preamble and postamble
+
+@vindex org-html-preamble
+@vindex org-html-postamble
+@vindex org-html-preamble-format
+@vindex org-html-postamble-format
+@vindex org-html-validation-link
+@vindex org-export-creator-string
+@vindex org-export-time-stamp-file
+
+The HTML exporter has delineations for preamble and postamble. The
+default value for @code{org-html-preamble} is @code{t}, which makes the HTML
+exporter insert the preamble. See the variable
+@code{org-html-preamble-format} for the format string.
+
+Set @code{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 @code{org-html-preamble} is set @code{nil}.
+
+The default value for @code{org-html-postamble} is @code{auto}, which makes the
+HTML exporter build a postamble from looking up author's name, email
+address, creator's name, and date. Set @code{org-html-postamble} to @code{t} to
+insert the postamble in the format specified in the
+@code{org-html-postamble-format} variable. The HTML exporter does not
+insert a postamble if @code{org-html-postamble} is set to @code{nil}.
+
+@node Quoting HTML tags
+@subsection Quoting HTML tags
+
+The HTML export back-end transforms @samp{<} and @samp{>} to @samp{&lt;} and @samp{&gt;}.
+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:
+@samp{@@@@html:...@@@@}. For example:
+
+@example
+@@@@html:<b>@@@@bold text@@@@html:</b>@@@@
+@end example
+
+
+@cindex @samp{HTML}, keyword
+@cindex @samp{BEGIN_EXPORT html}
+For larger raw HTML code blocks, use these HTML export code blocks:
+
+@example
+#+HTML: Literal HTML code for export
+
+#+BEGIN_EXPORT html
+ All lines between these markers are exported literally
+#+END_EXPORT
+@end example
+
+@node Headlines in HTML export
+@subsection Headlines in HTML export
+
+@cindex headlines, in HTML export
+
+Headlines are exported to @samp{<h1>}, @samp{<h2>}, etc. Each headline gets the
+@samp{id} attribute from @samp{CUSTOM_ID} property, or a unique generated value,
+see @ref{Internal Links}.
+
+@vindex org-html-self-link-headlines
+When @code{org-html-self-link-headlines} is set to a non-@code{nil} value, the
+text of the headlines is also wrapped in @samp{<a>} tags. These tags have
+a @samp{href} attribute making the headlines link to themselves.
+
+@node Links in HTML export
+@subsection Links in HTML export
+
+@cindex links, in HTML export
+@cindex internal links, in HTML export
+@cindex external links, in HTML export
+
+The HTML export back-end transforms Org's internal links (see
+@ref{Internal Links}) to equivalent HTML links in the output. The back-end
+similarly handles Org's automatic links created by radio targets (see
+@ref{Radio Targets}) similarly. For Org links to external files, the
+back-end transforms the links to @emph{relative} paths.
+
+@vindex org-html-link-org-files-as-html
+For Org links to other @samp{.org} files, the back-end automatically
+changes the file extension to @samp{.html} and makes file paths relative.
+If the @samp{.org} files have an equivalent @samp{.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 @code{org-html-link-org-files-as-html} to @code{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 @ref{Publishing links}.
+
+Org files can also have special directives to the HTML export
+back-end. For example, by using @samp{#+ATTR_HTML} lines to specify new
+format attributes to @code{<a>} or @code{<img>} tags. This example shows
+changing the link's title and style:
+
+@cindex @samp{ATTR_HTML}, keyword
+@example
+#+ATTR_HTML: :title The Org mode homepage :style color:red;
+[[https://orgmode.org]]
+@end example
+
+@node Tables in HTML export
+@subsection Tables in HTML export
+
+@cindex tables, in HTML
+@vindex org-export-html-table-tag
+
+The HTML export back-end uses @code{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:
+
+@cindex @samp{CAPTION}, keyword
+@cindex @samp{ATTR_HTML}, keyword
+@example
+#+CAPTION: This is a table with lines around and between cells
+#+ATTR_HTML: :border 2 :rules all :frame border
+@end example
+
+The HTML export back-end preserves column groupings in Org tables (see
+@ref{Column Groups}) when exporting to HTML@.
+
+Additional options for customizing tables for HTML export.
+
+@table @asis
+@item @code{org-html-table-align-individual-fields}
+@vindex org-html-table-align-individual-fields
+Non-@code{nil} attaches style attributes for alignment to each table
+field.
+
+@item @code{org-html-table-caption-above}
+@vindex org-html-table-caption-above
+Non-@code{nil} places caption string at the beginning of the table.
+
+@item @code{org-html-table-data-tags}
+@vindex org-html-table-data-tags
+Opening and ending tags for table data fields.
+
+@item @code{org-html-table-default-attributes}
+@vindex org-html-table-default-attributes
+Default attributes and values for table tags.
+
+@item @code{org-html-table-header-tags}
+@vindex org-html-table-header-tags
+Opening and ending tags for table's header fields.
+
+@item @code{org-html-table-row-tags}
+@vindex org-html-table-row-tags
+Opening and ending tags for table rows.
+
+@item @code{org-html-table-use-header-tags-for-first-column}
+@vindex org-html-table-use-header-tags-for-first-column
+Non-@code{nil} formats column one in tables with header tags.
+@end table
+
+@node Images in HTML export
+@subsection Images in HTML export
+
+@cindex images, inline in HTML
+@cindex inlining images in HTML
+
+The HTML export back-end has features to convert Org image links to
+HTML inline images and HTML clickable image links.
+
+@vindex org-html-inline-images
+When the link in the Org file has no description, the HTML export
+back-end by default in-lines that image. For example:
+@samp{[[file:myimg.jpg]]} is in-lined, while @samp{[[file:myimg.jpg][the image]]} links to the text,
+@samp{the image}. For more details, see the variable
+@code{org-html-inline-images}.
+
+On the other hand, if the description part of the Org link is itself
+another link, such as @samp{file:} or @samp{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:
+
+@example
+[[file:highres.jpg][file:thumb.jpg]]
+@end example
+
+
+To change attributes of in-lined images, use @samp{#+ATTR_HTML} lines in
+the Org file. This example shows realignment to right, and adds @code{alt}
+and @code{title} attributes in support of text viewers and modern web
+accessibility standards.
+
+@cindex @samp{CAPTION}, keyword
+@cindex @samp{ATTR_HTML}, keyword
+@example
+#+CAPTION: A black cat stalking a spider
+#+ATTR_HTML: :alt cat/spider image :title Action! :align right
+[[./img/a.jpg]]
+@end example
+
+The HTML export back-end copies the @samp{http} links from the Org file
+as-is.
+
+@node Math formatting in HTML export
+@subsection Math formatting in HTML export
+
+@cindex MathJax
+@cindex dvipng
+@cindex dvisvgm
+@cindex ImageMagick
+
+@vindex org-html-mathjax-options~
+@LaTeX{} math snippets (see @ref{@LaTeX{} fragments}) can be displayed in two
+different ways on HTML pages. The default is to use the @uref{https://www.mathjax.org, MathJax},
+which should work out of the box with Org@footnote{By default Org loads MathJax from @uref{https://cdnjs.com, cdnjs.com} as recommended by
+@uref{https://www.mathjax.org, MathJax}.}@footnote{Please note that exported formulas are part of an HTML
+document, and that signs such as @samp{<}, @samp{>}, or @samp{&} have special
+meanings. See @uref{http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-in-html-documents, MathJax @TeX{} and @LaTeX{} support}.}. Some MathJax
+display options can be configured via @code{org-html-mathjax-options}, or
+in the buffer. For example, with the following settings,
+
+@example
+#+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler
+#+HTML_MATHJAX: cancel.js noErrors.js
+@end example
+
+@noindent
+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 @samp{cancel.js} and @samp{noErrors.js}@footnote{See @uref{http://docs.mathjax.org/en/latest/tex.html#tex-extensions, @TeX{} and @LaTeX{} extensions} in the @uref{http://docs.mathjax.org, MathJax manual} to learn
+about extensions.}.
+
+@vindex org-html-mathjax-template
+See the docstring of @code{org-html-mathjax-options} for all supported
+variables. The MathJax template can be configure via
+@code{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
+
+@example
+#+OPTIONS: tex:dvipng
+@end example
+
+
+@example
+#+OPTIONS: tex:dvisvgm
+@end example
+
+
+@noindent
+or
+
+@example
+#+OPTIONS: tex:imagemagick
+@end example
+
+@node Text areas in HTML export
+@subsection Text areas in HTML export
+
+@cindex text areas, in HTML
+Before Org mode's Babel, one popular approach to publishing code in
+HTML was by using @samp{: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
+@samp{#+ATTR_HTML} line as shown in the example below with the @samp{:textarea}
+option. This must be followed by either an example or a source code
+block. Other Org block types do not honor the @samp{: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 @samp{:width} and @samp{:height} options on the @samp{#+ATTR_HTML}
+line.
+
+@example
+#+ATTR_HTML: :textarea t :width 40
+#+BEGIN_EXAMPLE
+ (defun org-xor (a b)
+ "Exclusive or."
+ (if a (not b) b))
+#+END_EXAMPLE
+@end example
+
+@node CSS support
+@subsection CSS support
+
+@cindex CSS, for HTML export
+@cindex HTML export, CSS
+
+@vindex org-export-html-todo-kwd-class-prefix
+@vindex org-export-html-tag-class-prefix
+You can modify the CSS style definitions for the exported file. The
+HTML exporter assigns the following special CSS classes@footnote{If the classes on TODO keywords and tags lead to conflicts,
+use the variables @code{org-html-todo-kwd-class-prefix} and
+@code{org-html-tag-class-prefix} to make them unique.} 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.
+
+@multitable {aaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @code{p.author}
+@tab author information, including email
+@item @code{p.date}
+@tab publishing date
+@item @code{p.creator}
+@tab creator info, about org mode version
+@item @code{.title}
+@tab document title
+@item @code{.subtitle}
+@tab document subtitle
+@item @code{.todo}
+@tab TODO keywords, all not-done states
+@item @code{.done}
+@tab the DONE keywords, all states that count as done
+@item @code{.WAITING}
+@tab each TODO keyword also uses a class named after itself
+@item @code{.timestamp}
+@tab timestamp
+@item @code{.timestamp-kwd}
+@tab keyword associated with a timestamp, like @samp{SCHEDULED}
+@item @code{.timestamp-wrapper}
+@tab span around keyword plus timestamp
+@item @code{.tag}
+@tab tag in a headline
+@item @code{._HOME}
+@tab each tag uses itself as a class, ``@@'' replaced by ``_''
+@item @code{.target}
+@tab target for links
+@item @code{.linenr}
+@tab the line number in a code example
+@item @code{.code-highlighted}
+@tab for highlighting referenced code lines
+@item @code{div.outline-N}
+@tab div for outline level N (headline plus text)
+@item @code{div.outline-text-N}
+@tab extra div for text at outline level N
+@item @code{.section-number-N}
+@tab section number in headlines, different for each level
+@item @code{.figure-number}
+@tab label like ``Figure 1:''
+@item @code{.table-number}
+@tab label like ``Table 1:''
+@item @code{.listing-number}
+@tab label like ``Listing 1:''
+@item @code{div.figure}
+@tab how to format an in-lined image
+@item @code{pre.src}
+@tab formatted source code
+@item @code{pre.example}
+@tab normal example
+@item @code{p.verse}
+@tab verse paragraph
+@item @code{div.footnotes}
+@tab footnote section headline
+@item @code{p.footnote}
+@tab footnote definition paragraph, containing a footnote
+@item @code{.footref}
+@tab a footnote reference number (always a <sup>)
+@item @code{.footnum}
+@tab footnote number in footnote definition (always <sup>)
+@item @code{.org-svg}
+@tab default class for a linked @samp{.svg} image
+@end multitable
+
+@vindex org-html-style-default
+@vindex org-html-head
+@vindex org-html-head-extra
+@cindex @samp{HTML_INCLUDE_STYLE}, keyword
+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.
+
+@cindex @samp{HTML_HEAD}, keyword
+@cindex @samp{HTML_HEAD_EXTRA}, keyword
+@example
+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style1.css" />
+#+HTML_HEAD_EXTRA: <link rel="alternate stylesheet" type="text/css" href="style2.css" />
+@end example
+
+@vindex org-html-head-include-default-style
+To just turn off the default style, customize
+@code{org-html-head-include-default-style} variable, or use this option
+line in the Org file.
+
+@cindex @samp{html-style}, @samp{OPTIONS} item
+@example
+#+OPTIONS: html-style:nil
+@end example
+
+
+For longer style definitions, either use several @samp{HTML_HEAD} and
+@samp{HTML_HEAD_EXTRA} keywords, or use @code{<style> ... </style>} blocks
+around them. Both of these approaches can avoid referring to an
+external file.
+
+@cindex @samp{HTML_CONTAINER_CLASS}, property
+@cindex @samp{HTML_HEADLINE_CLASS}, property
+In order to add styles to a sub-tree, use the @samp{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 @samp{CUSTOM_ID} property. You can also assign a specific class to
+a headline with the @samp{HTML_HEADLINE_CLASS} property.
+
+Never change the @code{org-html-style-default} constant. Instead use other
+simpler ways of customizing as described above.
+
+@node JavaScript support
+@subsection JavaScript supported display of web pages
+
+Sebastian Rose has written a JavaScript program especially designed to
+allow two different ways of viewing HTML files created with Org. One
+is an @emph{Info}-like mode where each section is displayed separately and
+navigation can be done with the @kbd{n} and @kbd{p} keys, and some other
+keys as well, press @kbd{?} for an overview of the available keys. The
+second one has a @emph{folding} view, much like Org provides inside Emacs.
+The script is available at @uref{https://orgmode.org/org-info.js} and the
+documentation at @uref{https://orgmode.org/worg/code/org-info-js/}. The
+script is hosted on @uref{https://orgmode.org}, but for reliability, prefer
+installing it on your own web server.
+
+To use this program, just add this line to the Org file:
+
+@cindex @samp{INFOJS_OPT}, keyword
+@example
+#+INFOJS_OPT: view:info toc:nil
+@end example
+
+
+@noindent
+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:
+
+@table @asis
+@item @samp{path:}
+The path to the script. The default is to grab the script from
+@uref{https://orgmode.org/org-info.js}, but you might want to have a local
+copy and use a path like @samp{../scripts/org-info.js}.
+
+@item @samp{view:}
+Initial view when the website is first shown. Possible values are:
+
+@multitable {aaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{info}
+@tab Info-like interface with one section per page
+@item @samp{overview}
+@tab Folding interface, initially showing only top-level
+@item @samp{content}
+@tab Folding interface, starting with all headlines visible
+@item @samp{showall}
+@tab Folding interface, all headlines and text visible
+@end multitable
+
+@item @samp{sdepth:}
+Maximum headline level still considered as an independent section
+for info and folding modes. The default is taken from
+@code{org-export-headline-levels}, i.e., the @samp{H} switch in @samp{OPTIONS}. If
+this is smaller than in @code{org-export-headline-levels}, each
+info/folding section can still contain child headlines.
+
+@item @samp{toc:}
+Should the table of contents @emph{initially} be visible? Even when
+@samp{nil}, you can always get to the ``toc'' with @kbd{i}.
+
+@item @samp{tdepth:}
+The depth of the table of contents. The defaults are taken from the
+variables @code{org-export-headline-levels} and @code{org-export-with-toc}.
+
+@item @samp{ftoc:}
+Does the CSS of the page specify a fixed position for the ``toc''? If
+yes, the toc is displayed as a section.
+
+@item @samp{ltoc:}
+Should there be short contents (children) in each section? Make
+this @samp{above} if the section should be above initial text.
+
+@item @samp{mouse:}
+Headings are highlighted when the mouse is over them. Should be
+@samp{underline} (default) or a background color like @samp{#cccccc}.
+
+@item @samp{buttons:}
+Should view-toggle buttons be everywhere? When @samp{nil} (the default),
+only one such button is present.
+@end table
+
+@vindex org-infojs-options
+@vindex org-export-html-use-infojs
+You can choose default values for these options by customizing the
+variable @code{org-infojs-options}. If you always want to apply the script
+to your pages, configure the variable @code{org-export-html-use-infojs}.
+
+@node @LaTeX{} Export
+@section @LaTeX{} Export
+
+@cindex @LaTeX{} export
+@cindex PDF 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
+@code{org-latex-compiler}; for build sequences, see
+@code{org-latex-pdf-process}; for packages, see
+@code{org-latex-default-packages-alist} and @code{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.
+* Verse blocks in @LaTeX{} export:: Attributes specific to special blocks.
+* Quote blocks in @LaTeX{} export:: Attributes specific to quote blocks.
+@end menu
+
+@node @LaTeX{}/PDF export commands
+@subsection @LaTeX{}/PDF export commands
+
+@table @asis
+@item @kbd{C-c C-e l l} (@code{org-latex-export-to-latex})
+@kindex C-c C-e l l
+@findex org-latex-export-to-latex~
+Export to a @LaTeX{} file with a @samp{.tex} extension. For @samp{myfile.org},
+Org exports to @samp{myfile.tex}, overwriting without warning.
+
+@item @kbd{C-c C-e l L} (@code{org-latex-export-as-latex})
+@kindex C-c C-e l L
+@findex org-latex-export-as-latex
+Export to a temporary buffer. Do not create a file.
+
+@item @kbd{C-c C-e l p} (@code{org-latex-export-to-pdf})
+@kindex C-c C-e l p
+@findex org-latex-export-to-pdf
+Export as @LaTeX{} file and convert it to PDF file.
+
+@item @kbd{C-c C-e l o}
+@kindex C-c C-e l o
+Export as @LaTeX{} file and convert it to PDF, then open the PDF using
+the default viewer.
+
+@item @kbd{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.
+@end table
+
+@vindex org-latex-compiler
+@vindex org-latex-bibtex-compiler
+@vindex org-latex-default-packages-alist
+@cindex pdflatex
+@cindex xelatex
+@cindex lualatex
+@cindex @samp{LATEX_COMPILER}, keyword
+The @LaTeX{} export back-end can use any of these @LaTeX{} engines:
+@samp{pdflatex}, @samp{xelatex}, and @samp{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
+@code{org-latex-compiler} variable or the @samp{#+LATEX_COMPILER} keyword in the
+Org file. See the docstring for the
+@code{org-latex-default-packages-alist} for loading packages with certain
+compilers. Also see @code{org-latex-bibtex-compiler} to set the
+bibliography compiler@footnote{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.}.
+
+@node @LaTeX{} specific export settings
+@subsection @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 @ref{Export Settings}).
+
+@table @asis
+@item @samp{DESCRIPTION}
+@cindex @samp{DESCRIPTION}, keyword
+@vindex org-latex-hyperref-template
+@vindex org-latex-title-command
+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 @code{org-latex-hyperref-template} for
+customizing metadata items. See @code{org-latex-title-command} for
+typesetting description into the document's front matter. Use
+multiple @samp{DESCRIPTION} keywords for long descriptions.
+
+@item @samp{LANGUAGE}
+@cindex @samp{LANGUAGE}, keyword
+@vindex org-latex-packages-alist
+In order to be effective, the @samp{babel} or @samp{polyglossia}
+packages---according to the @LaTeX{} compiler used---must be loaded
+with the appropriate language as argument. This can be accomplished
+by modifying the @code{org-latex-packages-alist} variable, e.g., with the
+following snippet:
+
+@lisp
+(add-to-list 'org-latex-packages-alist
+ '("AUTO" "babel" t ("pdflatex")))
+(add-to-list 'org-latex-packages-alist
+ '("AUTO" "polyglossia" t ("xelatex" "lualatex")))
+@end lisp
+
+@item @samp{LATEX_CLASS}
+@cindex @samp{LATEX_CLASS}, keyword
+@vindex org-latex-default-class
+@vindex org-latex-classes
+This is @LaTeX{} document class, such as @emph{article}, @emph{report}, @emph{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 @code{org-latex-default-class} variable.
+Org has @emph{article} as the default class. A valid default class must
+be an element of @code{org-latex-classes}.
+
+@item @samp{LATEX_CLASS_OPTIONS}
+@cindex @samp{LATEX_CLASS_OPTIONS}, keyword
+Options the @LaTeX{} export back-end uses when calling the @LaTeX{}
+document class.
+
+@item @samp{LATEX_COMPILER}
+@cindex @samp{LATEX_COMPILER}, keyword
+@vindex org-latex-compiler
+The compiler, such as @samp{pdflatex}, @samp{xelatex}, @samp{lualatex}, for
+producing the PDF@. See @code{org-latex-compiler}.
+
+@item @samp{LATEX_HEADER}
+@itemx @samp{LATEX_HEADER_EXTRA}
+@cindex @samp{LATEX_HEADER}, keyword
+@cindex @samp{LATEX_HEADER_EXTRA}, keyword
+@vindex org-latex-classes
+Arbitrary lines to add to the document's preamble, before the
+hyperref settings. See @code{org-latex-classes} for adjusting the
+structure and order of the @LaTeX{} headers.
+
+@item @samp{KEYWORDS}
+@cindex @samp{KEYWORDS}, keyword
+@vindex org-latex-hyperref-template
+@vindex org-latex-title-command
+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 @code{org-latex-hyperref-template} for
+customizing metadata items. See @code{org-latex-title-command} for
+typesetting description into the document's front matter. Use
+multiple @samp{KEYWORDS} lines if necessary.
+
+@item @samp{SUBTITLE}
+@cindex @samp{SUBTITLE}, keyword
+@vindex org-latex-subtitle-separate
+@vindex org-latex-subtitle-format
+The document's subtitle. It is typeset as per
+@code{org-latex-subtitle-format}. If @code{org-latex-subtitle-separate} is
+non-@code{nil}, it is typed outside of the @code{\title} macro. See
+@code{org-latex-hyperref-template} for customizing metadata items. See
+@code{org-latex-title-command} for typesetting description into the
+document's front matter.
+@end table
+
+The following sections have further details.
+
+@node @LaTeX{} header and sectioning
+@subsection @LaTeX{} header and sectioning structure
+
+@cindex @LaTeX{} class
+@cindex @LaTeX{} sectioning structure
+@cindex @LaTeX{} header
+@cindex header, for @LaTeX{} files
+@cindex sectioning structure, for @LaTeX{} export
+
+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 @ref{Export Settings}).
+
+By default, the @LaTeX{} export back-end uses the @emph{article} class.
+
+@vindex org-latex-default-class
+@vindex org-latex-classes
+@vindex org-latex-default-packages-alist
+@vindex org-latex-packages-alist
+To change the default class globally, edit @code{org-latex-default-class}.
+To change the default class locally in an Org file, add option lines
+@samp{#+LATEX_CLASS: myclass}. To change the default class for just a part
+of the Org file, set a sub-tree property, @samp{EXPORT_LATEX_CLASS}. The
+class name entered here must be valid member of @code{org-latex-classes}.
+This variable defines a header template for each class into which the
+exporter splices the values of @code{org-latex-default-packages-alist} and
+@code{org-latex-packages-alist}. Use the same three variables to define
+custom sectioning or custom classes.
+
+@cindex @samp{LATEX_CLASS}, keyword
+@cindex @samp{LATEX_CLASS_OPTIONS}, keyword
+@cindex @samp{EXPORT_LATEX_CLASS}, property
+@cindex @samp{EXPORT_LATEX_CLASS_OPTIONS}, property
+The @LaTeX{} export back-end sends the @samp{LATEX_CLASS_OPTIONS} keyword and
+@samp{EXPORT_LATEX_CLASS_OPTIONS} property as options to the @LaTeX{}
+@code{\documentclass} macro. The options and the syntax for specifying
+them, including enclosing them in square brackets, follow @LaTeX{}
+conventions.
+
+@example
+#+LATEX_CLASS_OPTIONS: [a4paper,11pt,twoside,twocolumn]
+@end example
+
+
+@cindex @samp{LATEX_HEADER}, keyword
+@cindex @samp{LATEX_HEADER_EXTRA}, keyword
+The @LaTeX{} export back-end appends values from @samp{LATEX_HEADER} and
+@samp{LATEX_HEADER_EXTRA} keywords to the @LaTeX{} header. The docstring for
+@code{org-latex-classes} explains in more detail. Also note that @LaTeX{}
+export back-end does not append @samp{LATEX_HEADER_EXTRA} to the header
+when previewing @LaTeX{} snippets (see @ref{Previewing @LaTeX{} fragments}).
+
+A sample Org file with the above headers:
+
+@example
+#+LATEX_CLASS: article
+#+LATEX_CLASS_OPTIONS: [a4paper]
+#+LATEX_HEADER: \usepackage@{xyz@}
+
+* Headline 1
+ some text
+* Headline 2
+ some more text
+@end example
+
+@node Quoting @LaTeX{} code
+@subsection Quoting @LaTeX{} code
+
+The @LaTeX{} export back-end can insert any arbitrary @LaTeX{} code, see
+@ref{Embedded @LaTeX{}}. There are three ways to embed such code in the Org
+file and they all use different quoting syntax.
+
+@cindex inline, in @LaTeX{} export
+Inserting in-line quoted with @@ symbols:
+
+@example
+Code embedded in-line @@@@latex:any arbitrary LaTeX code@@@@ in a paragraph.
+@end example
+
+
+@cindex @samp{LATEX}, keyword
+Inserting as one or more keyword lines in the Org file:
+
+@example
+#+LATEX: any arbitrary LaTeX code
+@end example
+
+
+@cindex @samp{BEGIN_EXPORT latex}
+Inserting as an export block in the Org file, where the back-end
+exports any code between begin and end markers:
+
+@example
+#+BEGIN_EXPORT latex
+ any arbitrary LaTeX code
+#+END_EXPORT
+@end example
+
+@node Tables in @LaTeX{} export
+@subsection Tables in @LaTeX{} export
+
+@cindex tables, in @LaTeX{} export
+
+The @LaTeX{} export back-end can pass several @LaTeX{} attributes for table
+contents and layout. Besides specifying a label (see @ref{Internal Links})
+and a caption (see @ref{Captions}), the other valid @LaTeX{} attributes
+include:
+
+@table @asis
+@item @samp{:mode}
+@vindex org-latex-default-table-mode
+The @LaTeX{} export back-end wraps the table differently depending on
+the mode for accurate rendering of math symbols. Mode is either
+@samp{table}, @samp{math}, @samp{inline-math} or @samp{verbatim}.
+
+For @samp{math} or @samp{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
+@code{org-latex-default-table-mode}. The @LaTeX{} export back-end merges
+contiguous tables in the same mode into a single environment.
+
+@item @samp{:environment}
+@vindex org-latex-default-table-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
+@code{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 @code{org-latex-packages-alist}
+variable for configuring these packages for @LaTeX{} snippet previews,
+if any.
+
+@item @samp{:caption}
+Use @samp{CAPTION} keyword to set a simple caption for a table (see
+@ref{Captions}). For custom captions, use @samp{:caption} attribute, which
+accepts raw @LaTeX{} code. @samp{:caption} value overrides @samp{CAPTION} value.
+
+@item @samp{:float}
+@itemx @samp{:placement}
+The table environments by default are not floats in @LaTeX{}. To make
+them floating objects use @samp{:float} with one of the following
+options: @samp{sideways}, @samp{multicolumn}, @samp{t}, and @samp{nil}.
+
+@LaTeX{} floats can also have additional layout @samp{:placement}
+attributes. These are the usual @samp{[h t b p ! H]} permissions
+specified in square brackets. Note that for @samp{:float sideways}
+tables, the @LaTeX{} export back-end ignores @samp{:placement} attributes.
+
+@item @samp{:align}
+@itemx @samp{:font}
+@itemx @samp{:width}
+The @LaTeX{} export back-end uses these attributes for regular tables
+to set their alignments, fonts, and widths.
+
+@item @samp{:spread}
+When @samp{:spread} is non-@code{nil}, the @LaTeX{} export back-end spreads or
+shrinks the table by the @samp{:width} for tabu and longtabu
+environments. @samp{:spread} has no effect if @samp{:width} is not set.
+
+@item @samp{:booktabs}
+@itemx @samp{:center}
+@itemx @samp{:rmlines}
+@vindex org-latex-tables-booktabs
+@vindex org-latex-tables-centered
+All three commands are toggles. @samp{:booktabs} brings in modern
+typesetting enhancements to regular tables. The booktabs package
+has to be loaded through @code{org-latex-packages-alist}. @samp{:center} is
+for centering the table. @samp{:rmlines} removes all but the very first
+horizontal line made of ASCII characters from ``table.el'' tables
+only.
+
+@item @samp{:math-prefix}
+@itemx @samp{:math-suffix}
+@itemx @samp{:math-arguments}
+The @LaTeX{} export back-end inserts @samp{:math-prefix} string value in
+a math environment before the table. The @LaTeX{} export back-end
+inserts @samp{:math-suffix} string value in a math environment after the
+table. The @LaTeX{} export back-end inserts @samp{:math-arguments} string
+value between the macro name and the table's contents.
+@samp{:math-arguments} comes in use for matrix macros that require more
+than one argument, such as @samp{qbordermatrix}.
+@end table
+
+@LaTeX{} table attributes help formatting tables for a wide range of
+situations, such as matrix product or spanning multiple pages:
+
+@example
+#+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 |
+@end example
+
+Set the caption with the @LaTeX{} command
+@samp{\bicaption@{HeadingA@}@{HeadingB@}}:
+
+@example
+#+ATTR_LATEX: :caption \bicaption@{HeadingA@}@{HeadingB@}
+| ... | ... |
+| ... | ... |
+@end example
+
+@node Images in @LaTeX{} export
+@subsection Images in @LaTeX{} export
+
+@cindex images, inline in LaTeX
+@cindex inlining images in LaTeX
+@cindex @samp{ATTR_LATEX}, keyword
+
+The @LaTeX{} export back-end processes image links in Org files that do
+not have descriptions, such as these links @samp{[[file:img.jpg]]} or
+@samp{[[./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 @samp{\includegraphics} macro to
+insert the image. But for TikZ (@uref{http://sourceforge.net/projects/pgf/})
+images, the back-end uses an @code{\input} macro wrapped within
+a @code{tikzpicture} environment.
+
+For specifying image @samp{:width}, @samp{:height}, @samp{:scale} and other @samp{:options},
+use this syntax:
+
+@example
+#+ATTR_LATEX: :width 5cm :options angle=90
+[[./img/sed-hr4049.pdf]]
+@end example
+
+A @samp{:scale} attribute overrides both @samp{:width} and @samp{:height} attributes.
+
+For custom commands for captions, use the @samp{:caption} attribute. It
+overrides the default @samp{#+CAPTION} value:
+
+@example
+#+ATTR_LATEX: :caption \bicaption@{HeadingA@}@{HeadingB@}
+[[./img/sed-hr4049.pdf]]
+@end example
+
+When captions follow the method as described in @ref{Captions}, the @LaTeX{}
+export back-end wraps the picture in a floating @samp{figure} environment.
+To float an image without specifying a caption, set the @samp{:float}
+attribute to one of the following:
+
+@table @asis
+@item @samp{t}
+For a standard @samp{figure} environment; used by default whenever an
+image has a caption.
+
+@item @samp{multicolumn}
+To span the image across multiple columns of a page; the back-end
+wraps the image in a @samp{figure*} environment.
+
+@item @samp{wrap}
+For text to flow around the image on the right; the figure occupies
+the left half of the page.
+
+@item @samp{sideways}
+For a new page with the image sideways, rotated ninety degrees, in
+a @samp{sidewaysfigure} environment; overrides @samp{:placement} setting.
+
+@item @samp{nil}
+To avoid a @samp{:float} even if using a caption.
+@end table
+
+Use the @samp{placement} attribute to modify a floating environment's
+placement.
+
+@example
+#+ATTR_LATEX: :float wrap :width 0.38\textwidth :placement @{r@}@{0.4\textwidth@}
+[[./img/hst.png]]
+@end example
+
+@vindex org-latex-images-centered
+@cindex center image in LaTeX export
+@cindex image, centering in LaTeX export
+The @LaTeX{} export back-end centers all images by default. Setting
+@samp{:center} to @samp{nil} disables centering. To disable centering globally,
+set @code{org-latex-images-centered} to @samp{nil}.
+
+Set the @samp{:comment-include} attribute to non-@code{nil} value for the @LaTeX{}
+export back-end to comment out the @samp{\includegraphics} macro.
+
+@node Plain lists in @LaTeX{} export
+@subsection Plain lists in @LaTeX{} export
+
+@cindex plain lists, in @LaTeX{} export
+@cindex @samp{ATTR_LATEX}, keyword
+The @LaTeX{} export back-end accepts the @samp{environment} and @samp{options}
+attributes for plain lists. Both attributes work together for
+customizing lists, as shown in the examples:
+
+@example
+#+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.
+@end example
+
+Since @LaTeX{} supports only four levels of nesting for lists, use an
+external package, such as @samp{enumitem} in @LaTeX{}, for levels deeper than
+four:
+
+@example
+#+LATEX_HEADER: \usepackage@{enumitem@}
+#+LATEX_HEADER: \renewlist@{itemize@}@{itemize@}@{9@}
+#+LATEX_HEADER: \setlist[itemize]@{label=$\circ$@}
+- One
+ - Two
+ - Three
+ - Four
+ - Five
+@end example
+
+@node Source blocks in @LaTeX{} export
+@subsection Source blocks in @LaTeX{} export
+
+@cindex source blocks, in @LaTeX{} export
+@cindex @samp{ATTR_LATEX}, keyword
+
+The @LaTeX{} export back-end can make source code blocks into floating
+objects through the attributes @samp{:float} and @samp{:options}. For @samp{:float}:
+
+@table @asis
+@item @samp{t}
+Makes a source block float; by default floats any source block with
+a caption.
+
+@item @samp{multicolumn}
+Spans the source block across multiple columns of a page.
+
+@item @samp{nil}
+Avoids a @samp{:float} even if using a caption; useful for source code
+blocks that may not fit on a page.
+@end table
+
+@example
+#+ATTR_LATEX: :float nil
+#+BEGIN_SRC emacs-lisp
+ Lisp code that may not fit in a single page.
+#+END_SRC
+@end example
+
+@vindex org-latex-listings-options
+@vindex org-latex-minted-options
+The @LaTeX{} export back-end passes string values in @samp{:options} to @LaTeX{}
+packages for customization of that specific source block. In the
+example below, the @samp{:options} are set for Minted. Minted is a source
+code highlighting @LaTeX{} package with many configurable options@footnote{Minted uses an external Python package for code highlighting,
+which requires the flag @samp{-shell-escape} to be added to
+@code{org-latex-pdf-process}.}.
+
+@example
+#+ATTR_LATEX: :options commentstyle=\bfseries
+#+BEGIN_SRC emacs-lisp
+ (defun Fib (n)
+ (if (< n 2) n (+ (Fib (- n 1)) (Fib (- n 2)))))
+#+END_SRC
+@end example
+
+To apply similar configuration options for all source blocks in
+a file, use the @code{org-latex-listings-options} and
+@code{org-latex-minted-options} variables.
+
+@node Example blocks in @LaTeX{} export
+@subsection Example blocks in @LaTeX{} export
+
+@cindex example blocks, in @LaTeX{} export
+@cindex verbatim blocks, in @LaTeX{} export
+@cindex @samp{ATTR_LATEX}, keyword
+
+The @LaTeX{} export back-end wraps the contents of example blocks in
+a @samp{verbatim} environment. To change this behavior to use another
+environment globally, specify an appropriate export filter (see
+@ref{Advanced Export Configuration}). To change this behavior to use
+another environment for each block, use the @samp{:environment} parameter
+to specify a custom environment.
+
+@example
+#+ATTR_LATEX: :environment myverbatim
+#+BEGIN_EXAMPLE
+ This sentence is false.
+#+END_EXAMPLE
+@end example
+
+@node Special blocks in @LaTeX{} export
+@subsection Special blocks in @LaTeX{} export
+
+@cindex special blocks, in @LaTeX{} export
+@cindex abstract, in @LaTeX{} export
+@cindex proof, in @LaTeX{} export
+@cindex @samp{ATTR_LATEX}, keyword
+
+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
+@samp{:options}, if any, and appends as-is to that environment's opening
+string. For example:
+
+@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
+@end example
+
+@noindent
+exports to
+
+@example
+\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@}
+@end example
+
+If you need to insert a specific caption command, use @samp{:caption}
+attribute. It overrides standard @samp{CAPTION} value, if any. For
+example:
+
+@example
+#+ATTR_LATEX: :caption \MyCaption@{HeadingA@}
+#+BEGIN_proof
+ ...
+#+END_proof
+@end example
+
+@node Horizontal rules in @LaTeX{} export
+@subsection Horizontal rules in @LaTeX{} export
+
+@cindex horizontal rules, in @LaTeX{} export
+@cindex @samp{ATTR_LATEX}, keyword
+
+The @LaTeX{} export back-end converts horizontal rules by the specified
+@samp{:width} and @samp{:thickness} attributes. For example:
+
+@example
+#+ATTR_LATEX: :width .6\textwidth :thickness 0.8pt
+-----
+@end example
+
+@node Verse blocks in @LaTeX{} export
+@subsection Verse blocks in @LaTeX{} export
+
+@cindex verse blocks, in @LaTeX{} export
+@cindex @samp{ATTR_LATEX}, keyword
+
+The @LaTeX{} export back-end accepts four attributes for verse blocks:
+@samp{:lines}, @samp{:center}, @samp{:versewidth} and @samp{:latexcode}. The three first
+require the external @LaTeX{} package @samp{verse.sty}, which is an extension
+of the standard @LaTeX{} environment.
+
+@table @asis
+@item @samp{:lines}
+To add marginal verse numbering. Its value is an
+integer, the sequence in which the verses should be numbered.
+@item @samp{:center}
+With value @samp{t} all the verses on the page are optically
+centered (a typographic convention for poetry), taking as a
+reference the longest verse, which must be indicated by the
+attribute @samp{:versewidth}.
+@item @samp{:versewidth}
+Its value is a literal text string with the longest
+verse.
+@item @samp{:latexcode}
+It accepts any arbitrary @LaTeX{} code that can be
+included within a @LaTeX{} @samp{verse} environment.
+@end table
+
+A complete example with Shakespeare's first sonnet:
+
+@example
+#+ATTR_LATEX: :center t :latexcode \color@{red@} :lines 5
+#+ATTR_LATEX: :versewidth Feed’st thy light’s flame with self-substantial fuel,
+#+BEGIN_VERSE
+From fairest creatures we desire increase,
+That thereby beauty’s rose might never die,
+But as the riper should by time decease
+His tender heir might bear his memory
+But thou, contracted to thine own bright eyes,
+Feed’st thy light’s flame with self-substantial fuel,
+Making a famine where abundance lies,
+Thyself thy foe, to thy sweet self too cruel.
+Thou that art now the world’s fresh ornament,
+And only herald to the gaudy spring,
+Within thine own bud buriest thy content,
+And, tender churl, mak’st waste in niggardly.
+Pity the world, or else this glutton be,
+To eat the world’s due, by the grave and thee.
+#+END_VERSE
+@end example
+
+@node Quote blocks in @LaTeX{} export
+@subsection Quote blocks in @LaTeX{} export
+
+@cindex quote blocks, in @LaTeX{} export
+@cindex @samp{ATTR_LATEX}, keyword
+@cindex org-latex-default-quote-environment
+
+The @LaTeX{} export back-end accepts two attributes for quote blocks:
+@samp{:environment}, for an arbitrary quoting environment (the default
+value is that of @code{org-latex-default-quote-environment}: @code{"quote"}) and
+@samp{:options}. For example, to choose the environment @samp{quotation},
+included as an alternative to @samp{quote} in standard @LaTeX{} classes:
+
+@example
+#+ATTR_LATEX: :environment quotation
+#+BEGIN_QUOTE
+some text...
+#+END_QUOTE
+@end example
+
+To choose the @samp{foreigndisplayquote} environment, included in the @LaTeX{}
+package @samp{csquotes}, with the @samp{german} option, use this syntax:
+
+@example
+#+LATEX_HEADER:\usepackage[autostyle=true]@{csquotes@}
+#+ATTR_LATEX: :environment foreigndisplayquote :options @{german@}
+#+BEGIN_QUOTE
+some text in German...
+#+END_QUOTE
+@end example
+
+@noindent
+which is exported to @LaTeX{} as
+
+@example
+\begin@{foreigndisplayquote@}@{german@}
+some text in German...
+\end@{foreigndisplayquote@}
+@end example
+
+@node Markdown Export
+@section Markdown Export
+
+@cindex Markdown export
+
+The Markdown export back-end, ``md'', converts an Org file to Markdown
+format, as defined at @uref{http://daringfireball.net/projects/markdown/}.
+
+Since it is built on top of the HTML back-end (see @ref{HTML Export}), it
+converts every Org construct not defined in Markdown syntax, such as
+tables, to HTML@.
+
+@anchor{Markdown export commands}
+@subheading Markdown export commands
+
+@table @asis
+@item @kbd{C-c C-e m m} (@code{org-md-export-to-markdown})
+@kindex C-c C-c m m
+@findex org-md-export-to-markdown
+Export to a text file with Markdown syntax. For @samp{myfile.org}, Org
+exports to @samp{myfile.md}, overwritten without warning.
+
+@item @kbd{C-c C-e m M} (@code{org-md-export-as-markdown})
+@kindex C-c C-c m M
+@findex org-md-export-as-markdown
+Export to a temporary buffer. Does not create a file.
+
+@item @kbd{C-c C-e m o}
+@kindex C-c C-e m o
+Export as a text file with Markdown syntax, then open it.
+@end table
+
+@anchor{Header and sectioning structure (1)}
+@subheading Header and sectioning structure
+
+@vindex org-md-headline-style
+Based on @code{org-md-headline-style}, Markdown export can generate
+headlines of both @emph{atx} and @emph{setext} types. @emph{atx} limits headline
+levels to two whereas @emph{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 @ref{Export Settings}).
+
+@node OpenDocument Text Export
+@section OpenDocument Text Export
+
+@cindex ODT
+@cindex OpenDocument
+@cindex export, OpenDocument
+@cindex LibreOffice
+
+The ODT export back-end handles creating of OpenDocument Text (ODT)
+format. Documents created by this exporter use the
+@cite{OpenDocument-v1.2 specification}@footnote{See @uref{http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html, Open Document Format for Office Applications
+(OpenDocument) Version 1.2}.} 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.
+@end menu
+
+@node Pre-requisites for ODT export
+@subsection Pre-requisites for ODT export
+
+@cindex zip
+
+The ODT export back-end relies on the zip program to create the final
+compressed ODT output. Check if @samp{zip} is locally available and
+executable. Without it, export cannot finish.
+
+@node ODT export commands
+@subsection ODT export commands
+
+@table @asis
+@item @kbd{C-c C-e o o} (@code{org-export-to-odt})
+@kindex C-c C-e o o
+@findex org-export-to-odt
+Export as OpenDocument Text file.
+
+@cindex @samp{EXPORT_FILE_NAME}, property
+@vindex org-odt-preferred-output-format
+
+If @code{org-odt-preferred-output-format} is specified, the ODT export
+back-end automatically converts the exported file to that format.
+
+For @samp{myfile.org}, Org exports to @samp{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, @kbd{C-c @@} selects the current sub-tree. If the tree head entry has, or
+inherits, an @samp{EXPORT_FILE_NAME} property, the ODT export back-end
+uses that for file name.
+
+@item @kbd{C-c C-e o O}
+@kindex C-c C-e o O
+Export as an OpenDocument Text file and open the resulting file.
+
+@vindex org-export-odt-preferred-output-format
+If @code{org-export-odt-preferred-output-format} is specified, open the
+converted file instead. See @ref{Automatically exporting to other formats}.
+@end table
+
+@node ODT specific export settings
+@subsection 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 @ref{Export Settings}).
+
+@table @asis
+@item @samp{DESCRIPTION}
+@cindex @samp{DESCRIPTION}, keyword
+This is the document's description, which the ODT export back-end
+inserts as document metadata. For long descriptions, use multiple
+lines, prefixed with @samp{DESCRIPTION}.
+
+@item @samp{KEYWORDS}
+@cindex @samp{KEYWORDS}, keyword
+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 @samp{KEYWORDS} if
+necessary.
+
+@item @samp{ODT_STYLES_FILE}
+@cindex @samp{ODT_STYLES_FILE}, keyword
+@vindex org-odt-styles-file
+The ODT export back-end uses the @code{org-odt-styles-file} by default.
+See @ref{Applying custom styles} for details.
+
+@item @samp{SUBTITLE}
+@cindex @samp{SUBTITLE}, keyword
+The document subtitle.
+@end table
+
+@node Extending ODT export
+@subsection 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 @samp{doc}, or
+convert a document from one format, say @samp{csv}, to another format, say
+@samp{xls}.
+
+@cindex @file{unoconv}
+@vindex org-odt-convert-process
+Customize @code{org-odt-convert-process} variable to point to @samp{unoconv},
+which is the ODT's preferred converter. Working installations of
+LibreOffice would already have @samp{unoconv} installed. Alternatively,
+other converters may be substituted here. See @ref{Configuring a document converter}.
+
+@anchor{Automatically exporting to other formats}
+@subsubheading Automatically exporting to other formats
+
+@vindex org-odt-preferred-output-format
+If ODT format is just an intermediate step to get to other formats,
+such as @samp{doc}, @samp{docx}, @samp{rtf}, or @samp{pdf}, etc., then extend the ODT
+export back-end to directly produce that format. Specify the final
+format in the @code{org-odt-preferred-output-format} variable. This is one
+way to extend (see @ref{ODT export commands}).
+
+@anchor{Converting between document formats}
+@subsubheading 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:
+
+@table @asis
+@item @kbd{M-x org-odt-convert}
+@findex org-odt-convert
+Convert an existing document from one format to another. With
+a prefix argument, opens the newly produced file.
+@end table
+
+@node Applying custom styles
+@subsection Applying custom styles
+
+@cindex styles, custom
+@cindex template, custom
+
+The ODT export back-end comes with many OpenDocument styles (see
+@ref{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.
+
+@anchor{Applying custom styles the easy way}
+@subsubheading Applying custom styles: the easy way
+
+@enumerate
+@item
+Create a sample @samp{example.org} file with settings as shown below,
+and export it to ODT format.
+
+@example
+#+OPTIONS: H:10 num:t
+@end example
+
+@item
+Open the above @samp{example.odt} using LibreOffice. Use the @emph{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.
+
+@item
+@vindex org-odt-styles-file
+Customize the variable @code{org-odt-styles-file} and point it to the
+newly created file. For additional configuration options, see
+@ref{x-overriding-factory-styles, , Overriding factory styles}.
+
+@cindex @samp{ODT_STYLES_FILE}, keyword
+To apply an ODT style to a particular file, use the
+@samp{ODT_STYLES_FILE} keyword as shown in the example below:
+
+@example
+#+ODT_STYLES_FILE: "/path/to/example.ott"
+@end example
+
+
+@noindent
+or
+
+@example
+#+ODT_STYLES_FILE: ("/path/to/file.ott" ("styles.xml" "image/hdr.png"))
+@end example
+@end enumerate
+
+@anchor{Using third-party styles and templates}
+@subsubheading 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.
+
+@node Links in ODT export
+@subsection Links in ODT export
+
+@cindex 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 @samp{\ref@{label@}}-style reference to an image, table etc., is replaced
+with a cross-reference and sequence number of the labeled entity. See
+@ref{Labels and captions in ODT export}.
+
+@node Tables in ODT export
+@subsection Tables in ODT export
+
+@cindex tables, in ODT export
+
+The ODT export back-end handles native Org mode tables (see @ref{Tables})
+and simple @samp{table.el} tables. Complex @samp{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 @ref{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 @ref{Column Width and Alignment}).
+
+Note that the ODT export back-end interprets column widths as weighted
+ratios, the default weight being 1.
+
+@cindex @samp{ATTR_ODT}, keyword
+Specifying @samp{:rel-width} property on an @samp{ATTR_ODT} line controls the
+width of the table. For example:
+
+@example
+#+ATTR_ODT: :rel-width 50
+| Area/Month | Jan | Feb | Mar | Sum |
+|---------------+-------+-------+-------+-------|
+| / | < | | | < |
+| <l13> | <r5> | <r5> | <r5> | <r6> |
+| North America | 1 | 21 | 926 | 948 |
+| Middle East | 6 | 75 | 844 | 925 |
+| Asia Pacific | 9 | 27 | 790 | 826 |
+|---------------+-------+-------+-------+-------|
+| Sum | 16 | 123 | 2560 | 2699 |
+@end example
+
+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 @samp{ATTR_ODT} keyword. See @ref{Customizing tables in ODT export}.
+
+@node Images in ODT export
+@subsection Images in ODT export
+
+@cindex images, embedding in ODT
+@cindex embedding images in ODT
+
+@anchor{Embedding images}
+@subsubheading Embedding images
+
+The ODT export back-end processes image links in Org files that do not
+have descriptions, such as these links @samp{[[file:img.jpg]]} or @samp{[[./img.jpg]]},
+as direct image insertions in the final output. Either of these
+examples works:
+
+@example
+[[file:img.png]]
+@end example
+
+
+@example
+[[./img.png]]
+@end example
+
+@anchor{Embedding clickable images}
+@subsubheading Embedding clickable images
+
+For clickable images, provide a link whose description is another link
+to an image file. For example, to embed an image
+@samp{org-mode-unicorn.png} which when clicked jumps to @uref{https://orgmode.org}
+website, do the following
+
+@example
+[[https://orgmode.org][./org-mode-unicorn.png]]
+@end example
+
+@anchor{Sizing and scaling of embedded images}
+@subsubheading Sizing and scaling of embedded images
+
+@cindex @samp{ATTR_ODT}, keyword
+
+Control the size and scale of the embedded images with the @samp{ATTR_ODT}
+attribute.
+
+@cindex identify, ImageMagick
+@vindex org-odt-pixels-per-inch
+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 @code{create-image} and
+@code{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 @code{org-odt-pixels-per-inch} into the familiar 72
+dpi or 96 dpi. The default value for this is in
+@code{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:
+
+@table @asis
+@item Explicitly size the image
+To embed @samp{img.png} as a 10 cm x 10 cm image, do the following:
+
+@example
+#+ATTR_ODT: :width 10 :height 10
+[[./img.png]]
+@end example
+
+@item Scale the image
+To embed @samp{img.png} at half its size, do the following:
+
+@example
+#+ATTR_ODT: :scale 0.5
+[[./img.png]]
+@end example
+
+@item Scale the image to a specific width
+To embed @samp{img.png} with a width of 10 cm while retaining the
+original height:width ratio, do the following:
+
+@example
+#+ATTR_ODT: :width 10
+[[./img.png]]
+@end example
+
+@item Scale the image to a specific height
+To embed @samp{img.png} with a height of 10 cm while retaining the
+original height:width ratio, do the following:
+
+@example
+#+ATTR_ODT: :height 10
+[[./img.png]]
+@end example
+@end table
+
+@anchor{Anchoring of images}
+@subsubheading Anchoring of images
+
+@cindex @samp{ATTR_ODT}, keyword
+The ODT export back-end can anchor images to @samp{as-char}, @samp{paragraph},
+or @samp{page}. Set the preferred anchor using the @samp{:anchor} property of
+the @samp{ATTR_ODT} line.
+
+To create an image that is anchored to a page:
+
+@example
+#+ATTR_ODT: :anchor page
+[[./img.png]]
+@end example
+
+@node Math formatting in ODT export
+@subsection 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.
+@end menu
+
+@node @LaTeX{} math snippets
+@subsubsection @LaTeX{} math snippets
+
+@LaTeX{} math snippets (see @ref{@LaTeX{} fragments}) can be embedded in the ODT
+document in one of the following ways:
+
+@table @asis
+@item MathML
+@cindex MathML
+Add this line to the Org file. This option is activated on
+a per-file basis.
+
+@example
+#+OPTIONS: tex:t
+@end example
+
+
+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.
+
+@vindex org-latex-to-mathml-convert-command
+@vindex org-latex-to-mathml-jar-file
+You can specify the @LaTeX{}-to-MathML converter by customizing the
+variables @code{org-latex-to-mathml-convert-command} and
+@code{org-latex-to-mathml-jar-file}.
+
+If you prefer to use MathToWeb@footnote{See @uref{http://www.mathtoweb.com/cgi-bin/mathtoweb_home.pl, MathToWeb}.} as your converter, you can
+configure the above variables as shown below.
+
+@lisp
+(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")
+@end lisp
+
+@noindent
+or, to use @LaTeX{}​ML@footnote{See @uref{http://dlmf.nist.gov/LaTeXML/}.} instead,
+
+@lisp
+(setq org-latex-to-mathml-convert-command
+ "latexmlmath \"%i\" --presentationmathml=%o")
+@end lisp
+
+To quickly verify the reliability of the @LaTeX{}-to-MathML
+converter, use the following commands:
+
+@table @asis
+@item @kbd{M-x org-export-as-odf}
+Convert a @LaTeX{} math snippet to an OpenDocument formula (@samp{.odf})
+file.
+
+@item @kbd{M-x org-export-as-odf-and-open}
+Convert a @LaTeX{} math snippet to an OpenDocument formula (@samp{.odf})
+file and open the formula file with the system-registered
+application.
+@end table
+
+@item PNG images
+@cindex dvipng
+@cindex dvisvgm
+@cindex ImageMagick
+Add this line to the Org file. This option is activated on
+a per-file basis.
+
+@example
+#+OPTIONS: tex:dvipng
+@end example
+
+
+@example
+#+OPTIONS: tex:dvisvgm
+@end example
+
+
+@noindent
+or
+
+@example
+#+OPTIONS: tex:imagemagick
+@end example
+
+
+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.
+@end table
+
+@node MathML and OpenDocument formula files
+@subsubsection 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 (@samp{.mml}) source or its OpenDocument formula (@samp{.odf}) file as
+shown below:
+
+@example
+[[./equation.mml]]
+@end example
+
+
+@noindent
+or
+
+@example
+[[./equation.odf]]
+@end example
+
+@node Labels and captions in ODT export
+@subsection 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.
+
+@example
+#+CAPTION: Bell curve
+#+NAME: fig:SED-HR4049
+[[./img/a.png]]
+@end example
+
+When rendered, it may show as follows in the exported document:
+
+@example
+Figure 2: Bell curve
+@end example
+
+
+@vindex org-odt-category-map-alist
+To modify the category component of the caption, customize the option
+@code{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:
+
+@lisp
+(setq org-odt-category-map-alist
+ '(("__Figure__" "Illustration" "value" "Figure" org-odt--enumerable-image-p)))
+@end lisp
+
+With the above modification, the previous example changes to:
+
+@example
+Illustration 2: Bell curve
+@end example
+
+@node Literal examples in ODT export
+@subsection Literal examples in ODT export
+
+The ODT export back-end supports literal examples (see @ref{Literal Examples}) with full fontification. Internally, the ODT export
+back-end relies on @samp{htmlfontify.el} to generate the style definitions
+needed for fancy listings. The auto-generated styles get @samp{OrgSrc}
+prefix and inherit colors from the faces used by Emacs Font Lock
+library for that source language.
+
+@vindex org-odt-fontify-srcblocks
+For custom fontification styles, customize the
+@code{org-odt-create-custom-styles-for-srcblocks} option.
+
+@vindex org-odt-create-custom-styles-for-srcblocks
+To turn off fontification of literal examples, customize the
+@code{org-odt-fontify-srcblocks} option.
+
+@node Advanced topics in ODT export
+@subsection Advanced topics in ODT export
+
+The ODT export back-end has extensive features useful for power users
+and frequent uses of ODT formats.
+
+@anchor{Configuring a document converter}
+@subsubheading Configuring a document converter
+
+@cindex convert
+@cindex doc, docx, rtf
+@cindex converter
+
+The ODT export back-end works with popular converters with little or
+no extra configuration. See @ref{Extending ODT export}. The following is
+for unsupported converters or tweaking existing defaults.
+
+@table @asis
+@item Register the converter
+@vindex org-export-odt-convert-processes
+Add the name of the converter to the @code{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.
+
+@item Configure its capabilities
+@vindex org-export-odt-convert-capabilities
+Specify which formats the converter can handle by customizing the
+variable @code{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.
+
+@item Choose the converter
+@vindex org-export-odt-convert-process
+Select the newly added converter as the preferred one by customizing
+the option @code{org-odt-convert-process}.
+@end table
+
+@anchor{Working with OpenDocument style files}
+@subsubheading Working with OpenDocument style files
+
+@cindex styles, custom
+@cindex template, custom
+
+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 @code{org-odt-styles-dir}. The two files are:
+
+@table @asis
+@item @samp{OrgOdtStyles.xml} @anchor{x-orgodtstyles-xml}
+This file contributes to the @samp{styles.xml} file of the final ODT
+document. This file gets modified for the following purposes:
+
+@enumerate
+@item
+To control outline numbering based on user settings;
+
+@item
+To add styles generated by @samp{htmlfontify.el} for fontification of
+code blocks.
+@end enumerate
+
+@item @samp{OrgOdtContentTemplate.xml} @anchor{x-orgodtcontenttemplate-xml}
+This file contributes to the @samp{content.xml} file of the final ODT
+document. The contents of the Org outline are inserted between the
+@samp{<office:text>} @dots{} @samp{</office:text>} elements of this file.
+
+Apart from serving as a template file for the final @samp{content.xml},
+the file serves the following purposes:
+
+@enumerate
+@item
+It contains automatic styles for formatting of tables which are
+referenced by the exporter;
+
+@item
+It contains @samp{<text:sequence-decl>} @dots{} @samp{</text:sequence-decl>}
+elements that control numbering of tables, images, equations, and
+similar entities.
+@end enumerate
+@end table
+
+@anchor{x-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.
+
+@table @asis
+@item @code{org-odt-styles-file}
+The ODT export back-end uses the file pointed to by this variable,
+such as @samp{styles.xml}, for the final output. It can take one of the
+following values:
+
+@table @asis
+@item @samp{FILE.xml}
+Use this file instead of the default @samp{styles.xml}
+
+@item @samp{FILE.odt} or @samp{FILE.ott}
+Use the @samp{styles.xml} contained in the specified OpenDocument
+Text or Template file
+
+@item @samp{FILE.odt} or @samp{FILE.ott} and a subset of included files
+Use the @samp{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 @samp{styles.xml} file references additional
+files like header and footer images.
+
+@item @code{nil}
+Use the default @samp{styles.xml}.
+@end table
+
+@item @code{org-odt-content-template-file}
+Use this variable to specify the blank @samp{content.xml} used in the
+final output.
+@end table
+
+@anchor{Creating one-off styles}
+@subsubheading 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.
+
+@table @asis
+@item Embedding ODT tags as part of regular text
+Enclose OpenDocument syntax in @samp{@@@@odt:...@@@@} for inline markup. For
+example, to highlight a region of text do the following:
+
+@example
+@@@@odt:<text:span text:style-name="Highlight">This is highlighted
+text</text:span>@@@@. But this is regular text.
+@end example
+
+@strong{Hint:} To see the above example in action, edit the @samp{styles.xml}
+(see @ref{x-orgodtstyles-xml, , Factory styles}) and add a custom @emph{Highlight} style as shown
+below:
+
+@example
+<style:style style:name="Highlight" style:family="text">
+ <style:text-properties fo:background-color="#ff0000"/>
+</style:style>
+@end example
+
+@item Embedding a one-line OpenDocument XML
+@cindex @samp{ODT}, keyword
+The ODT export back-end can read one-liner options with @samp{#+ODT:} in
+the Org file. For example, to force a page break:
+
+@example
+#+ODT: <text:p text:style-name="PageBreak"/>
+@end example
+
+@strong{Hint:} To see the above example in action, edit your
+@samp{styles.xml} (see @ref{x-orgodtstyles-xml, , Factory styles}) and add a custom @samp{PageBreak}
+style as shown below.
+
+@example
+<style:style style:name="PageBreak" style:family="paragraph"
+ style:parent-style-name="Text_20_body">
+ <style:paragraph-properties fo:break-before="page"/>
+</style:style>
+@end example
+
+@item Embedding a block of OpenDocument XML
+The ODT export back-end can also read ODT export blocks for
+OpenDocument XML@. Such blocks use the @samp{#+BEGIN_EXPORT odt}
+@dots{} @samp{#+END_EXPORT} constructs.
+
+For example, to create a one-off paragraph that uses bold text, do
+the following:
+
+@example
+#+BEGIN_EXPORT odt
+ <text:p text:style-name="Text_20_body_20_bold">
+ This paragraph is specially formatted and uses bold text.
+ </text:p>
+#+END_EXPORT
+@end example
+@end table
+
+@anchor{Customizing tables in ODT export}
+@subsubheading Customizing tables in ODT export
+
+@cindex tables, in ODT export
+@cindex @samp{ATTR_ODT}, keyword
+
+Override the default table format by specifying a custom table style
+with the @samp{#+ATTR_ODT} line. For a discussion on default formatting of
+tables, see @ref{Tables in ODT export}.
+
+This feature closely mimics the way table templates are defined in the
+OpenDocument-v1.2 specification@footnote{@uref{http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html, OpenDocument-v1.2 Specification}}.
+
+@vindex org-odt-table-styles
+For quick preview of this feature, install the settings below and export the
+table that follows:
+
+@lisp
+(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))))))
+@end lisp
+
+@example
+#+ATTR_ODT: :style TableWithHeaderRowAndColumn
+| Name | Phone | Age |
+| Peter | 1234 | 17 |
+| Anna | 4321 | 25 |
+@end example
+
+The example above used @samp{Custom} template and installed two table
+styles @samp{TableWithHeaderRowAndColumn} and
+@samp{TableWithFirstRowandLastRow}. @strong{Important:} The OpenDocument styles
+needed for producing the above template were pre-defined. They are
+available in the section marked @samp{Custom Table Template} in
+@samp{OrgOdtContentTemplate.xml} (see @ref{x-orgodtcontenttemplate-xml, , Factory styles}). For adding new
+templates, define new styles there.
+
+To use this feature proceed as follows:
+
+@enumerate
+@item
+Create a table template@footnote{See the @samp{<table:table-template>} element of the
+OpenDocument-v1.2 specification.}.
+
+A table template is set of @samp{table-cell} and @samp{paragraph} styles for
+each of the following table cell categories:
+
+@itemize
+@item
+Body
+@item
+First column
+@item
+Last column
+@item
+First row
+@item
+Last row
+@item
+Even row
+@item
+Odd row
+@item
+Even column
+@item
+Odd Column
+@end itemize
+
+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 @samp{Custom}, the needed style names are
+listed in the following table.
+
+@multitable {aaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@headitem Cell type
+@tab Cell style
+@tab Paragraph style
+@item Body
+@tab @samp{CustomTableCell}
+@tab @samp{CustomTableParagraph}
+@item First column
+@tab @samp{CustomFirstColumnTableCell}
+@tab @samp{CustomFirstColumnTableParagraph}
+@item Last column
+@tab @samp{CustomLastColumnTableCell}
+@tab @samp{CustomLastColumnTableParagraph}
+@item First row
+@tab @samp{CustomFirstRowTableCell}
+@tab @samp{CustomFirstRowTableParagraph}
+@item Last row
+@tab @samp{CustomLastRowTableCell}
+@tab @samp{CustomLastRowTableParagraph}
+@item Even row
+@tab @samp{CustomEvenRowTableCell}
+@tab @samp{CustomEvenRowTableParagraph}
+@item Odd row
+@tab @samp{CustomOddRowTableCell}
+@tab @samp{CustomOddRowTableParagraph}
+@item Even column
+@tab @samp{CustomEvenColumnTableCell}
+@tab @samp{CustomEvenColumnTableParagraph}
+@item Odd column
+@tab @samp{CustomOddColumnTableCell}
+@tab @samp{CustomOddColumnTableParagraph}
+@end multitable
+
+To create a table template with the name @samp{Custom}, define the above
+styles in the @samp{<office:automatic-styles>} @dots{}
+@samp{</office:automatic-styles>} element of the content template file
+(see @ref{x-orgodtcontenttemplate-xml, , Factory styles}).
+
+@item
+Define a table style@footnote{See the attributes @samp{table:template-name},
+@samp{table:use-first-row-styles}, @samp{table:use-last-row-styles},
+@samp{table:use-first-column-styles}, @samp{table:use-last-column-styles},
+@samp{table:use-banding-rows-styles}, and @samp{table:use-banding-column-styles}
+of the @samp{<table:table>} element in the OpenDocument-v1.2 specification.}.
+
+@vindex org-odt-table-styles
+To define a table style, create an entry for the style in the
+variable @code{org-odt-table-styles} and specify the following:
+
+@itemize
+@item
+the name of the table template created in step (1),
+@item
+the set of cell styles in that template that are to be activated.
+@end itemize
+
+For example, the entry below defines two different table styles
+@samp{TableWithHeaderRowAndColumn} and @samp{TableWithFirstRowandLastRow}
+based on the same template @samp{Custom}. The styles achieve their
+intended effect by selectively activating the individual cell
+styles in that template.
+
+@lisp
+(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))))))
+@end lisp
+
+@item
+Associate a table with the table style.
+
+To do this, specify the table style created in step (2) as part of
+the @samp{ATTR_ODT} line as shown below.
+
+@example
+#+ATTR_ODT: :style TableWithHeaderRowAndColumn
+| Name | Phone | Age |
+| Peter | 1234 | 17 |
+| Anna | 4321 | 25 |
+@end example
+@end enumerate
+
+@anchor{Validating OpenDocument XML}
+@subsubheading Validating OpenDocument XML
+
+Sometimes ODT format files may not open due to @samp{.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
+@samp{.odt} files have to be decompressed using @samp{zip}. Note that @samp{.odt}
+files are ZIP archives: @ref{File Archives,,,emacs,}. The contents of
+ODT files are in XML@. For general help with validation---and
+schema-sensitive editing---of XML files: @ref{Introduction,,,nxml-mode,}.
+
+@vindex org-export-odt-schema-dir
+Customize @code{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
+@code{rng-schema-locating-files}.
+
+@node Org Export
+@section Org Export
+
+@cindex Org export
+@emph{org} export back-end creates a normalized version of the Org document
+in current buffer. The exporter evaluates Babel code (see @ref{Evaluating Code Blocks}) and removes content specific to other back-ends.
+
+@anchor{Org export commands}
+@subheading Org export commands
+
+@table @asis
+@item @kbd{C-c C-e O o} (@code{org-org-export-to-org})
+@kindex C-c C-e O o
+@findex org-org-export-to-org
+Export as an Org file with a @samp{.org} extension. For @samp{myfile.org},
+Org exports to @samp{myfile.org.org}, overwriting without warning.
+
+@item @kbd{C-c C-e O v} (~~)
+@kindex C-c C-e O v
+Export to an Org file, then open it.
+@end table
+
+@node Texinfo Export
+@section 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.
+@end menu
+
+@node Texinfo export commands
+@subsection Texinfo export commands
+
+@table @asis
+@item @kbd{C-c C-e i t} (@code{org-texinfo-export-to-texinfo})
+@kindex C-c C-e i t
+@findex org-texinfo-export-to-texinfo
+Export as a Texinfo file with @samp{.texi} extension. For @samp{myfile.org},
+Org exports to @samp{myfile.texi}, overwriting without warning.
+
+@item @kbd{C-c C-e i i} (@code{org-texinfo-export-to-info})
+@kindex C-c C-e i i
+@findex org-texinfo-export-to-info
+@vindex org-texinfo-info-process
+Export to Texinfo format first and then process it to make an Info
+file. To generate other formats, such as DocBook, customize the
+@code{org-texinfo-info-process} variable.
+@end table
+
+@node Texinfo specific export settings
+@subsection 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 @ref{Export Settings}).
+
+@table @asis
+@item @samp{SUBTITLE}
+@cindex @samp{SUBTITLE}, keyword
+The document subtitle.
+
+@item @samp{SUBAUTHOR}
+@cindex @samp{SUBAUTHOR}, keyword
+Additional authors for the document.
+
+@item @samp{TEXINFO_FILENAME}
+@cindex @samp{TEXINFO_FILENAME}, keyword
+The Texinfo filename.
+
+@item @samp{TEXINFO_CLASS}
+@cindex @samp{TEXINFO_CLASS}, keyword
+@vindex org-texinfo-default-class
+The default document class (@code{org-texinfo-default-class}), which must
+be a member of @code{org-texinfo-classes}.
+
+@item @samp{TEXINFO_HEADER}
+@cindex @samp{TEXINFO_HEADER}, keyword
+Arbitrary lines inserted at the end of the header.
+
+@item @samp{TEXINFO_POST_HEADER}
+@cindex @samp{TEXINFO_POST_HEADER}, keyword
+Arbitrary lines inserted after the end of the header.
+
+@item @samp{TEXINFO_DIR_CATEGORY}
+@cindex @samp{TEXINFO_DIR_CATEGORY}, keyword
+The directory category of the document.
+
+@item @samp{TEXINFO_DIR_TITLE}
+@cindex @samp{TEXINFO_DIR_TITLE}, keyword
+The directory title of the document.
+
+@item @samp{TEXINFO_DIR_DESC}
+@cindex @samp{TEXINFO_DIR_DESC}, keyword
+The directory description of the document.
+
+@item @samp{TEXINFO_PRINTED_TITLE}
+@cindex @samp{TEXINFO_PRINTED_TITLE}, keyword
+The printed title of the document.
+@end table
+
+@node Texinfo file header
+@subsection Texinfo file header
+
+@cindex @samp{TEXINFO_FILENAME}, keyword
+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 @samp{TEXINFO_FILENAME} keyword.
+
+@vindex org-texinfo-coding-system
+@cindex @samp{TEXINFO_HEADER}, keyword
+Along with the output's file name, the Texinfo header also contains
+language details (see @ref{Export Settings}) and encoding system as set in
+the @code{org-texinfo-coding-system} variable. Insert @samp{TEXINFO_HEADER}
+keywords for each additional command in the header, for example:
+
+@example
+#+TEXINFO_HEADER: @@synindex
+@end example
+
+
+@cindex @samp{TEXINFO_CLASS}, keyword
+@vindex org-texinfo-classes
+Instead of repeatedly installing the same set of commands, define
+a class in @code{org-texinfo-classes} once, and then activate it in the
+document by setting the @samp{TEXINFO_CLASS} keyword to that class.
+
+@node Texinfo title and copyright page
+@subsection Texinfo title and copyright page
+
+@cindex @samp{TEXINFO_PRINTED_TITLE}, keyword
+The default template for hard copy output has a title page with
+@samp{TITLE} and @samp{AUTHOR} keywords (see @ref{Export Settings}). To replace the
+regular title with something different for the printed version, use
+the @samp{TEXINFO_PRINTED_TITLE} and @samp{SUBTITLE} keywords. Both expect raw
+Texinfo code for setting their values.
+
+@cindex @samp{SUBAUTHOR}, keyword
+If one @samp{AUTHOR} line is not sufficient, add multiple @samp{SUBAUTHOR}
+keywords. They have to be set in raw Texinfo code.
+
+@example
+#+AUTHOR: Jane Smith
+#+SUBAUTHOR: John Doe
+#+TEXINFO_PRINTED_TITLE: This Long Title@@@@inlinefmt@{tex,@@*@} Is Broken in @@TeX@{@}
+@end example
+
+@cindex @samp{COPYING}, property
+Copying material is defined in a dedicated headline with a non-@code{nil}
+@samp{COPYING} property. The back-end inserts the contents within
+a @samp{@@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.
+
+@example
+* 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.
+@end example
+
+@node Info directory file
+@subsection Info directory file
+
+@cindex @samp{dir} file, in Texinfo export
+@cindex Info directory file, in Texinfo export
+@cindex @code{install-info}, in Texinfo export
+
+@cindex @samp{TEXINFO_DIR_CATEGORY}, keyword
+@cindex @samp{TEXINFO_DIR_TITLE}, keyword
+@cindex @samp{TEXINFO_DIR_DESC}, keyword
+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: @samp{TEXINFO_DIR_CATEGORY}, @samp{TEXINFO_DIR_TITLE},
+and @samp{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:
+
+@example
+#+TEXINFO_DIR_CATEGORY: Emacs
+#+TEXINFO_DIR_TITLE: Org Mode: (org)
+#+TEXINFO_DIR_DESC: Outline-based notes management and organizer
+@end example
+
+@node Headings and sectioning structure
+@subsection Headings and sectioning structure
+
+@vindex org-texinfo-classes
+@vindex org-texinfo-default-class
+@cindex @samp{TEXINFO_CLASS}, keyword
+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
+@code{@@chapter} and lower-level headlines to unnumbered chapters tagged as
+@code{@@unnumbered}. To override such mappings to introduce @code{@@part} or
+other Texinfo structuring commands, define a new class in
+@code{org-texinfo-classes}. Activate the new class with the
+@samp{TEXINFO_CLASS} keyword. When no new class is defined and activated,
+the Texinfo export back-end defaults to the
+@code{org-texinfo-default-class}.
+
+If an Org headline's level has no associated Texinfo structuring
+command, or is below a certain threshold (see @ref{Export Settings}), then
+the Texinfo export back-end makes it into a list item.
+
+@cindex @samp{APPENDIX}, property
+The Texinfo export back-end makes any headline with a non-@code{nil}
+@samp{APPENDIX} property into an appendix. This happens independent of the
+Org headline level or the @samp{TEXINFO_CLASS} keyword.
+
+@cindex @samp{ALT_TITLE}, property
+@cindex @samp{DESCRIPTION}, property
+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 @samp{ALT_TITLE} property (see @ref{Table of Contents}). Texinfo menu entries also have an option for a longer
+@samp{DESCRIPTION} property. Here's an example that uses both to override
+the default menu entry:
+
+@example
+* Controlling Screen Display
+ :PROPERTIES:
+ :ALT_TITLE: Display
+ :DESCRIPTION: Controlling Screen Display
+ :END:
+@end example
+
+@cindex Top node, in Texinfo export
+The text before the first headline belongs to the @emph{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 @samp{.texi}
+file. See @ref{The Top Node,,,texinfo,}, for more information.
+
+@node Indices
+@subsection Indices
+
+@cindex @samp{CINDEX}, keyword
+@cindex concept index, in Texinfo export
+@cindex @samp{FINDEX}, keyword
+@cindex function index, in Texinfo export
+@cindex @samp{KINDEX}, keyword
+@cindex keystroke index, in Texinfo export
+@cindex @samp{PINDEX}, keyword
+@cindex program index, in Texinfo export
+@cindex @samp{TINDEX}, keyword
+@cindex data type index, in Texinfo export
+@cindex @samp{VINDEX}, keyword
+@cindex variable index, in Texinfo export
+The Texinfo export back-end recognizes these indexing keywords if used
+in the Org file: @samp{CINDEX}, @samp{FINDEX}, @samp{KINDEX}, @samp{PINDEX}, @samp{TINDEX} and
+@samp{VINDEX}. Write their value as verbatim Texinfo code; in particular,
+@samp{@{}, @samp{@}} and @samp{@@} characters need to be escaped with @samp{@@} if they do not
+belong to a Texinfo command.
+
+@example
+#+CINDEX: Defining indexing entries
+@end example
+
+
+@cindex @samp{INDEX}, property
+For the back-end to generate an index entry for a headline, set the
+@samp{INDEX} property to @samp{cp} or @samp{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.
+
+@example
+* Concept Index
+ :PROPERTIES:
+ :INDEX: cp
+ :END:
+@end example
+
+@node Quoting Texinfo code
+@subsection Quoting Texinfo code
+
+Use any of the following three methods to insert or escape raw Texinfo
+code:
+
+@cindex @samp{TEXINFO}, keyword
+@cindex @samp{BEGIN_EXPORT texinfo}
+@example
+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
+@end example
+
+@node Plain lists in Texinfo export
+@subsection Plain lists in Texinfo export
+
+@cindex @samp{ATTR_TEXINFO}, keyword
+@cindex two-column tables, in Texinfo export
+@cindex table-type, Texinfo attribute
+The Texinfo export back-end by default converts description lists in
+the Org file using the default command @samp{@@table}, which results in
+a table with two columns. To change this behavior, set @samp{:table-type}
+attribute to either @samp{ftable} or @samp{vtable} value. For more information,
+see @ref{Two-column Tables,,,texinfo,}.
+
+@vindex org-texinfo-table-default-markup
+@cindex indic, Texinfo attribute
+The Texinfo export back-end by default also applies a text highlight
+based on the defaults stored in @code{org-texinfo-table-default-markup}.
+To override the default highlight command, specify another one with
+the @samp{:indic} attribute.
+
+@cindex multiple items in Texinfo lists
+@cindex sep, Texinfo 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 @samp{:sep} attribute. Each part then becomes a new
+entry in the first column of the table.
+
+The following example illustrates all the attributes above:
+
+@example
+#+ATTR_TEXINFO: :table-type vtable :sep , :indic asis
+- foo, bar :: This is the common text for variables foo and bar.
+@end example
+
+@noindent
+becomes
+
+@example
+@@vtable @@asis
+@@item foo
+@@itemx bar
+This is the common text for variables foo and bar.
+@@end table
+@end example
+
+@cindex lettered lists, in Texinfo export
+@cindex enum, Texinfo attribute
+Ordered lists are numbered when exported to Texinfo format. Such
+numbering obeys any counter (see @ref{Plain Lists}) in the first item of
+the list. The @samp{:enum} attribute also let you start the list at
+a specific number, or switch to a lettered list, as illustrated here
+
+@example
+#+ATTR_TEXINFO: :enum A
+1. Alpha
+2. Bravo
+3. Charlie
+@end example
+
+@node Tables in Texinfo export
+@subsection Tables in Texinfo export
+
+@cindex @samp{ATTR_TEXINFO}, keyword
+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 @samp{:columns} attribute. See example
+below.
+
+@example
+#+ATTR_TEXINFO: :columns .5 .5
+| a cell | another cell |
+@end example
+
+@node Images in Texinfo export
+@subsection Images in Texinfo export
+
+@cindex @samp{ATTR_TEXINFO}, keyword
+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 @samp{:width} and @samp{:height} attributes. For alternate text, use @samp{:alt}
+and specify the text using Texinfo code, as shown in the example:
+
+@example
+#+ATTR_TEXINFO: :width 1in :alt Alternate @@i@{text@}
+[[ridt.pdf]]
+@end example
+
+@node Quotations in Texinfo export
+@subsection Quotations in Texinfo export
+
+@cindex @samp{ATTR_TEXINFO}, keyword
+You can write the text of a quotation within a quote block (see
+@ref{Paragraphs}). You may also emphasize some text at the beginning of
+the quotation with the @samp{:tag} attribute.
+
+@example
+#+ATTR_TEXINFO: :tag Warning
+#+BEGIN_QUOTE
+Striking your thumb with a hammer may cause severe pain and discomfort.
+#+END_QUOTE
+@end example
+
+To specify the author of the quotation, use the @samp{:author} attribute.
+
+@example
+#+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
+@end example
+
+@node Special blocks in Texinfo export
+@subsection Special blocks in Texinfo export
+
+@cindex @samp{ATTR_TEXINFO}, keyword
+
+The Texinfo export back-end converts special blocks to commands with
+the same name. It also adds any @samp{:options} attributes to the end of
+the command, as shown in this example:
+
+@example
+#+ATTR_TEXINFO: :options org-org-export-to-org ...
+#+BEGIN_defun
+ A somewhat obsessive function name.
+#+END_defun
+@end example
+
+@noindent
+becomes
+
+@example
+@@defun org-org-export-to-org ...
+ A somewhat obsessive function name.
+@@end defun
+@end example
+
+@node A Texinfo example
+@subsection A Texinfo example
+
+Here is a more detailed example Org file. See
+@ref{GNU Sample Texts,,,texinfo,} for an equivalent example using
+Texinfo code.
+
+@example
+#+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:
+
+ #+INCLUDE: fdl.org
+
+* Index
+ :PROPERTIES:
+ :INDEX: cp
+ :END:
+@end example
+
+@node iCalendar Export
+@section iCalendar Export
+
+@cindex 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.
+
+@vindex org-icalendar-include-todo
+@vindex org-icalendar-use-deadline
+@vindex org-icalendar-use-scheduled
+The iCalendar export back-end can also incorporate TODO entries based
+on the configuration of the @code{org-icalendar-include-todo} variable.
+The back-end exports plain timestamps as @samp{VEVENT}, TODO items as
+@samp{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 @code{org-icalendar-use-deadline} and
+@code{org-icalendar-use-scheduled} variables for more details.
+
+@vindex org-icalendar-categories
+@vindex org-icalendar-alarm-time
+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 @code{org-icalendar-categories}. To assign
+clock alarms based on time, configure the @code{org-icalendar-alarm-time}
+variable.
+
+@vindex org-icalendar-store-UID
+@cindex @samp{ID}, property
+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 @code{org-icalendar-store-UID}. The back-end looks for the @samp{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.
+
+@table @asis
+@item @kbd{C-c C-e c f} (@code{org-icalendar-export-to-ics})
+@kindex C-c C-e c f
+@findex org-icalendar-export-to-ics
+Create iCalendar entries from the current Org buffer and store them
+in the same directory, using a file extension @samp{.ics}.
+
+@item @kbd{C-c C-e c a} (@code{org-icalendar-export-agenda-files})
+@kindex C-c C-e c a
+@findex org-icalendar-export-agenda-files
+Create iCalendar entries from Org files in @code{org-agenda-files} and
+store in a separate iCalendar file for each Org file.
+
+@item @kbd{C-c C-e c c} (@code{org-icalendar-combine-agenda-files})
+@kindex C-c C-e c c
+@findex org-icalendar-combine-agenda-files
+@vindex org-icalendar-combined-agenda-file
+Create a combined iCalendar file from Org files in
+@code{org-agenda-files} and write it to
+@code{org-icalendar-combined-agenda-file} file name.
+@end table
+
+@cindex @samp{SUMMARY}, property
+@cindex @samp{DESCRIPTION}, property
+@cindex @samp{LOCATION}, property
+@cindex @samp{TIMEZONE}, property
+@cindex @samp{CLASS}, property
+The iCalendar export back-end includes @samp{SUMMARY}, @samp{DESCRIPTION},
+@samp{LOCATION}, @samp{TIMEZONE} and @samp{CLASS} properties from the Org entries
+when exporting. To force the back-end to inherit the @samp{LOCATION},
+@samp{TIMEZONE} and @samp{CLASS} properties, configure the
+@code{org-use-property-inheritance} variable.
+
+@vindex org-icalendar-include-body
+When Org entries do not have @samp{SUMMARY}, @samp{DESCRIPTION}, @samp{LOCATION} and
+@samp{CLASS} properties, the iCalendar export back-end derives the summary
+from the headline, and derives the description from the body of the
+Org item. The @code{org-icalendar-include-body} variable limits the
+maximum number of characters of the content are turned into its
+description.
+
+The @samp{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.,
+@samp{Asia/Almaty}. Alternately, the property value can be @samp{UTC}, to force
+UTC time for this entry only.
+
+The @samp{CLASS} property can be used to specify a per-entry visibility
+class or access restrictions, and is applied to any entry with class
+information. The iCalendar standard defines three visibility classes:
+@table @asis
+@item @samp{PUBLIC}
+The entry is publicly visible (this is the default).
+@item @samp{CONFIDENTIAL}
+Only a limited group of clients get access to the
+event.
+@item @samp{PRIVATE}
+The entry can be retrieved only by its owner.
+@end table
+The server should treat unknown class properties the same as
+@samp{PRIVATE}.
+
+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.
+
+@node Other Built-in Back-ends
+@section Other Built-in Back-ends
+
+Other export back-ends included with Org are:
+
+@itemize
+@item
+@samp{ox-man.el}: Export to a man page.
+@end itemize
+
+To activate such back-ends, either customize @code{org-export-backends} or
+load directly with @samp{(require 'ox-man)}. On successful load, the
+back-end adds new keys in the export dispatcher (see @ref{The Export Dispatcher}).
+
+Follow the comment section of such files, for example, @samp{ox-man.el},
+for usage and configuration details.
+
+@node Advanced Export Configuration
+@section Advanced Export Configuration
+
+
+
+@anchor{Export hooks}
+@subheading Export hooks
+
+@vindex org-export-before-processing-hook
+@vindex org-export-before-parsing-hook
+The export process executes two hooks before the actual exporting
+begins. The first hook, @code{org-export-before-processing-hook}, runs
+before any expansions of macros, Babel code, and include keywords in
+the buffer. The second hook, @code{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:
+
+@lisp
+(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)
+@end lisp
+
+@anchor{Filters}
+@subheading Filters
+
+@cindex Filters, exporting
+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: @code{org-export-filter-TYPE-functions}, where @var{TYPE}
+is the type targeted by the filter. Valid types are:
+
+@multitable @columnfractions 0.33 0.33 0.33
+@item body
+@tab bold
+@tab babel-call
+@item center-block
+@tab clock
+@tab code
+@item diary-sexp
+@tab drawer
+@tab dynamic-block
+@item entity
+@tab example-block
+@tab export-block
+@item export-snippet
+@tab final-output
+@tab fixed-width
+@item footnote-definition
+@tab footnote-reference
+@tab headline
+@item horizontal-rule
+@tab inline-babel-call
+@tab inline-src-block
+@item inlinetask
+@tab italic
+@tab item
+@item keyword
+@tab latex-environment
+@tab latex-fragment
+@item line-break
+@tab link
+@tab node-property
+@item options
+@tab paragraph
+@tab parse-tree
+@item plain-list
+@tab plain-text
+@tab planning
+@item property-drawer
+@tab quote-block
+@tab radio-target
+@item section
+@tab special-block
+@tab src-block
+@item statistics-cookie
+@tab strike-through
+@tab subscript
+@item superscript
+@tab table
+@tab table-cell
+@item table-row
+@tab target
+@tab timestamp
+@item underline
+@tab verbatim
+@tab verse-block
+@end multitable
+
+Here is an example filter that replaces non-breaking spaces @code{ } in the
+Org buffer with @samp{~} for the @LaTeX{} back-end.
+
+@lisp
+(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)
+@end lisp
+
+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
+@code{org-export-derived-backend-p} predicate that tests for @emph{latex}
+back-end or any other back-end, such as @emph{beamer}, derived from
+@emph{latex}.
+
+@anchor{Defining filters for individual files}
+@subheading Defining filters for individual files
+
+The Org export can filter not just for back-ends, but also for
+specific files through the @samp{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.
+
+@example
+#+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
+@end example
+
+@anchor{Extending an existing back-end}
+@subheading 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 @emph{ascii} back-end display the language used
+in a source code block. Also make it display only when some attribute
+is non-@code{nil}, like the following:
+
+@example
+#+ATTR_ASCII: :language t
+@end example
+
+
+Then extend ASCII back-end with a custom ``my-ascii'' back-end.
+
+@lisp
+(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)))
+@end lisp
+
+The @code{my-ascii-src-block} function looks at the attribute above the
+current element. If not true, hands over to @emph{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 @code{src-block} type elements.
+
+To use the newly defined back-end, evaluate the following from an Org
+buffer:
+
+@lisp
+(org-export-to-buffer 'my-ascii "*Org MY-ASCII Export*")
+@end lisp
+
+Further steps to consider would be an interactive function,
+self-installing an item in the export dispatcher menu, and other
+user-friendly improvements.
+
+@node Export in Foreign Buffers
+@section 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:
+
+@table @asis
+@item @code{org-ascii-convert-region-to-ascii}
+@findex org-ascii-convert-region-to-ascii
+Convert the selected region into ASCII@.
+
+@item @code{org-ascii-convert-region-to-utf8}
+@findex org-ascii-convert-region-to-utf8
+Convert the selected region into UTF-8.
+
+@item @code{org-html-convert-region-to-html}
+@findex org-html-convert-region-to-html
+Convert the selected region into HTML@.
+
+@item @code{org-latex-convert-region-to-latex}
+@findex org-latex-convert-region-to-latex
+Convert the selected region into @LaTeX{}.
+
+@item @code{org-texinfo-convert-region-to-texinfo}
+@findex org-texinfo-convert-region-to-texinfo
+Convert the selected region into Texinfo.
+
+@item @code{org-md-convert-region-to-md}
+@findex org-md-convert-region-to-md
+Convert the selected region into Markdown.
+@end table
+
+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
+@kbd{M-x org-html-convert-region-to-html}.
+
+@menu
+* Bare HTML:: Exporting HTML without CSS, Javascript, etc.
+@end menu
+
+@node Bare HTML
+@subsection Exporting to minimal HTML
+
+If you want to output a minimal HTML file, with no CSS, no Javascript,
+no preamble or postamble, here are the variable you would need to set:
+
+@vindex org-html-head
+@vindex org-html-head-extra
+@vindex org-html-head-include-default-style
+@vindex org-html-head-include-scripts
+@vindex org-html-preamble
+@vindex org-html-postamble
+@vindex org-html-use-infojs
+@lisp
+(setq org-html-head ""
+ org-html-head-extra ""
+ org-html-head-include-default-style nil
+ org-html-head-include-scripts nil
+ org-html-preamble nil
+ org-html-postamble nil
+ org-html-use-infojs nil)
+@end lisp
+
+@node Publishing
+@chapter Publishing
+
+@cindex publishing
+
+Org includes a publishing management system that allows you to
+configure automatic HTML conversion of @emph{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.
+@end menu
+
+@node Configuration
+@section 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.
+@end menu
+
+@node Project alist
+@subsection The variable @code{org-publish-project-alist}
+
+@cindex projects, for publishing
+
+@vindex org-publish-project-alist
+Publishing is configured almost entirely through setting the value of
+one variable, called @code{org-publish-project-alist}. Each element of the
+list configures one project, and may be in one of the two following
+forms:
+
+@lisp
+("project-name" :property value :property value ...)
+@end lisp
+
+@noindent
+i.e., a well-formed property list with alternating keys and values,
+or:
+
+@lisp
+("project-name" :components ("project-name" "project-name" ...))
+@end lisp
+
+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 @code{: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.
+
+@node Sources and destinations
+@subsection Sources and destinations for files
+
+@cindex directories, for publishing
+
+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.
+
+@table @asis
+@item @code{:base-directory}
+Directory containing publishing source files.
+
+@item @code{: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 @ref{Uploading Files}).
+
+@item @code{:preparation-function}
+Function or list of functions to be called before starting the
+publishing process, for example, to run @samp{make} for updating files to
+be published. Each preparation function is called with a single
+argument, the project property list.
+
+@item @code{: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.
+@end table
+
+@node Selecting files
+@subsection Selecting files
+
+@cindex files, selecting for publishing
+
+By default, all files with extension @samp{.org} in the base directory are
+considered part of the project. This can be modified by setting the
+following properties
+
+@table @asis
+@item @code{:base-extension}
+Extension---without the dot---of source files. This actually is
+a regular expression. Set this to the symbol @code{any} if you want to
+get all files in @code{:base-directory}, even without extension.
+
+@item @code{:exclude}
+Regular expression to match file names that should not be published,
+even though they have been selected on the basis of their extension.
+
+@item @code{:include}
+List of files to be included regardless of @code{:base-extension} and
+@code{:exclude}.
+
+@item @code{:recursive}
+Non-@code{nil} means, check base-directory recursively for files to
+publish.
+@end table
+
+@node Publishing action
+@subsection Publishing action
+
+@cindex action, for publishing
+
+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
+@code{org-html-publish-to-html} which calls the HTML exporter (see @ref{HTML Export}). But you can also publish your content as PDF files using
+@code{org-latex-publish-to-pdf}, or as ASCII, Texinfo, etc., using the
+corresponding functions.
+
+If you want to publish the Org file as an @samp{.org} file but with
+@emph{archived}, @emph{commented}, and @emph{tag-excluded} trees removed, use
+@code{org-org-publish-to-org}. This produces @samp{file.org} and puts it in the
+publishing directory. If you want a htmlized version of this file,
+set the parameter @code{:htmlized-source} to @code{t}. It produces
+@samp{file.org.html} in the publishing directory@footnote{If the publishing directory is the same as the source
+directory, @samp{file.org} is exported as @samp{file.org.org}, so you probably
+do not want to do this.}.
+
+Other files like images only need to be copied to the publishing
+destination; for this you can use @code{org-publish-attachment}. For
+non-Org files, you always need to specify the publishing function:
+
+@table @asis
+@item @code{:publishing-function}
+Function executing the publication of a file. This may also be
+a list of functions, which are all called in turn.
+
+@item @code{:htmlized-source}
+Non-@code{nil} means, publish htmlized source.
+@end table
+
+The function must accept three arguments: a property list containing
+at least a @code{: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.
+
+@node Publishing options
+@subsection Options for the exporters
+
+@cindex options, for publishing
+@cindex publishing options
+
+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.
+
+@vindex org-publish-project-alist
+When a property is given a value in @code{org-publish-project-alist}, its
+setting overrides the value of the corresponding user variable, if
+any, during publishing. Options set within a file (see @ref{Export Settings}), however, override everything.
+
+@anchor{Generic properties}
+@subsubheading Generic properties
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @code{:archived-trees}
+@tab @code{org-export-with-archived-trees}
+@item @code{:exclude-tags}
+@tab @code{org-export-exclude-tags}
+@item @code{:headline-levels}
+@tab @code{org-export-headline-levels}
+@item @code{:language}
+@tab @code{org-export-default-language}
+@item @code{:preserve-breaks}
+@tab @code{org-export-preserve-breaks}
+@item @code{:section-numbers}
+@tab @code{org-export-with-section-numbers}
+@item @code{:select-tags}
+@tab @code{org-export-select-tags}
+@item @code{:with-author}
+@tab @code{org-export-with-author}
+@item @code{:with-broken-links}
+@tab @code{org-export-with-broken-links}
+@item @code{:with-clocks}
+@tab @code{org-export-with-clocks}
+@item @code{:with-creator}
+@tab @code{org-export-with-creator}
+@item @code{:with-date}
+@tab @code{org-export-with-date}
+@item @code{:with-drawers}
+@tab @code{org-export-with-drawers}
+@item @code{:with-email}
+@tab @code{org-export-with-email}
+@item @code{:with-emphasize}
+@tab @code{org-export-with-emphasize}
+@item @code{:with-fixed-width}
+@tab @code{org-export-with-fixed-width}
+@item @code{:with-footnotes}
+@tab @code{org-export-with-footnotes}
+@item @code{:with-latex}
+@tab @code{org-export-with-latex}
+@item @code{:with-planning}
+@tab @code{org-export-with-planning}
+@item @code{:with-priority}
+@tab @code{org-export-with-priority}
+@item @code{:with-properties}
+@tab @code{org-export-with-properties}
+@item @code{:with-special-strings}
+@tab @code{org-export-with-special-strings}
+@item @code{:with-sub-superscript}
+@tab @code{org-export-with-sub-superscripts}
+@item @code{:with-tables}
+@tab @code{org-export-with-tables}
+@item @code{:with-tags}
+@tab @code{org-export-with-tags}
+@item @code{:with-tasks}
+@tab @code{org-export-with-tasks}
+@item @code{:with-timestamps}
+@tab @code{org-export-with-timestamps}
+@item @code{:with-title}
+@tab @code{org-export-with-title}
+@item @code{:with-toc}
+@tab @code{org-export-with-toc}
+@item @code{:with-todo-keywords}
+@tab @code{org-export-with-todo-keywords}
+@end multitable
+
+@anchor{ASCII specific properties}
+@subsubheading ASCII specific properties
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @code{:ascii-bullets}
+@tab @code{org-ascii-bullets}
+@item @code{:ascii-caption-above}
+@tab @code{org-ascii-caption-above}
+@item @code{:ascii-charset}
+@tab @code{org-ascii-charset}
+@item @code{:ascii-global-margin}
+@tab @code{org-ascii-global-margin}
+@item @code{:ascii-format-drawer-function}
+@tab @code{org-ascii-format-drawer-function}
+@item @code{:ascii-format-inlinetask-function}
+@tab @code{org-ascii-format-inlinetask-function}
+@item @code{:ascii-headline-spacing}
+@tab @code{org-ascii-headline-spacing}
+@item @code{:ascii-indented-line-width}
+@tab @code{org-ascii-indented-line-width}
+@item @code{:ascii-inlinetask-width}
+@tab @code{org-ascii-inlinetask-width}
+@item @code{:ascii-inner-margin}
+@tab @code{org-ascii-inner-margin}
+@item @code{:ascii-links-to-notes}
+@tab @code{org-ascii-links-to-notes}
+@item @code{:ascii-list-margin}
+@tab @code{org-ascii-list-margin}
+@item @code{:ascii-paragraph-spacing}
+@tab @code{org-ascii-paragraph-spacing}
+@item @code{:ascii-quote-margin}
+@tab @code{org-ascii-quote-margin}
+@item @code{:ascii-table-keep-all-vertical-lines}
+@tab @code{org-ascii-table-keep-all-vertical-lines}
+@item @code{:ascii-table-use-ascii-art}
+@tab @code{org-ascii-table-use-ascii-art}
+@item @code{:ascii-table-widen-columns}
+@tab @code{org-ascii-table-widen-columns}
+@item @code{:ascii-text-width}
+@tab @code{org-ascii-text-width}
+@item @code{:ascii-underline}
+@tab @code{org-ascii-underline}
+@item @code{:ascii-verbatim-format}
+@tab @code{org-ascii-verbatim-format}
+@end multitable
+
+@anchor{Beamer specific properties}
+@subsubheading Beamer specific properties
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @code{:beamer-theme}
+@tab @code{org-beamer-theme}
+@item @code{:beamer-column-view-format}
+@tab @code{org-beamer-column-view-format}
+@item @code{:beamer-environments-extra}
+@tab @code{org-beamer-environments-extra}
+@item @code{:beamer-frame-default-options}
+@tab @code{org-beamer-frame-default-options}
+@item @code{:beamer-outline-frame-options}
+@tab @code{org-beamer-outline-frame-options}
+@item @code{:beamer-outline-frame-title}
+@tab @code{org-beamer-outline-frame-title}
+@item @code{:beamer-subtitle-format}
+@tab @code{org-beamer-subtitle-format}
+@end multitable
+
+@anchor{HTML specific properties}
+@subsubheading HTML specific properties
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @code{:html-allow-name-attribute-in-anchors}
+@tab @code{org-html-allow-name-attribute-in-anchors}
+@item @code{:html-checkbox-type}
+@tab @code{org-html-checkbox-type}
+@item @code{:html-container}
+@tab @code{org-html-container-element}
+@item @code{:html-divs}
+@tab @code{org-html-divs}
+@item @code{:html-doctype}
+@tab @code{org-html-doctype}
+@item @code{:html-extension}
+@tab @code{org-html-extension}
+@item @code{:html-footnote-format}
+@tab @code{org-html-footnote-format}
+@item @code{:html-footnote-separator}
+@tab @code{org-html-footnote-separator}
+@item @code{:html-footnotes-section}
+@tab @code{org-html-footnotes-section}
+@item @code{:html-format-drawer-function}
+@tab @code{org-html-format-drawer-function}
+@item @code{:html-format-headline-function}
+@tab @code{org-html-format-headline-function}
+@item @code{:html-format-inlinetask-function}
+@tab @code{org-html-format-inlinetask-function}
+@item @code{:html-head-extra}
+@tab @code{org-html-head-extra}
+@item @code{:html-head-include-default-style}
+@tab @code{org-html-head-include-default-style}
+@item @code{:html-head-include-scripts}
+@tab @code{org-html-head-include-scripts}
+@item @code{:html-head}
+@tab @code{org-html-head}
+@item @code{:html-home/up-format}
+@tab @code{org-html-home/up-format}
+@item @code{:html-html5-fancy}
+@tab @code{org-html-html5-fancy}
+@item @code{:html-indent}
+@tab @code{org-html-indent}
+@item @code{:html-infojs-options}
+@tab @code{org-html-infojs-options}
+@item @code{:html-infojs-template}
+@tab @code{org-html-infojs-template}
+@item @code{:html-inline-image-rules}
+@tab @code{org-html-inline-image-rules}
+@item @code{:html-inline-images}
+@tab @code{org-html-inline-images}
+@item @code{:html-link-home}
+@tab @code{org-html-link-home}
+@item @code{:html-link-org-files-as-html}
+@tab @code{org-html-link-org-files-as-html}
+@item @code{:html-link-up}
+@tab @code{org-html-link-up}
+@item @code{:html-link-use-abs-url}
+@tab @code{org-html-link-use-abs-url}
+@item @code{:html-mathjax-options}
+@tab @code{org-html-mathjax-options}
+@item @code{:html-mathjax-template}
+@tab @code{org-html-mathjax-template}
+@item @code{:html-equation-reference-format}
+@tab @code{org-html-equation-reference-format}
+@item @code{:html-metadata-timestamp-format}
+@tab @code{org-html-metadata-timestamp-format}
+@item @code{:html-postamble-format}
+@tab @code{org-html-postamble-format}
+@item @code{:html-postamble}
+@tab @code{org-html-postamble}
+@item @code{:html-preamble-format}
+@tab @code{org-html-preamble-format}
+@item @code{:html-preamble}
+@tab @code{org-html-preamble}
+@item @code{:html-self-link-headlines}
+@tab @code{org-html-self-link-headlines}
+@item @code{:html-table-align-individual-field}
+@tab @code{de@{org-html-table-align-individual-fields}
+@item @code{:html-table-attributes}
+@tab @code{org-html-table-default-attributes}
+@item @code{:html-table-caption-above}
+@tab @code{org-html-table-caption-above}
+@item @code{:html-table-data-tags}
+@tab @code{org-html-table-data-tags}
+@item @code{:html-table-header-tags}
+@tab @code{org-html-table-header-tags}
+@item @code{:html-table-row-tags}
+@tab @code{org-html-table-row-tags}
+@item @code{:html-table-use-header-tags-for-first-column}
+@tab @code{org-html-table-use-header-tags-for-first-column}
+@item @code{:html-tag-class-prefix}
+@tab @code{org-html-tag-class-prefix}
+@item @code{:html-text-markup-alist}
+@tab @code{org-html-text-markup-alist}
+@item @code{:html-todo-kwd-class-prefix}
+@tab @code{org-html-todo-kwd-class-prefix}
+@item @code{:html-toplevel-hlevel}
+@tab @code{org-html-toplevel-hlevel}
+@item @code{:html-use-infojs}
+@tab @code{org-html-use-infojs}
+@item @code{:html-validation-link}
+@tab @code{org-html-validation-link}
+@item @code{:html-viewport}
+@tab @code{org-html-viewport}
+@item @code{:html-wrap-src-lines}
+@tab @code{org-html-wrap-src-lines}
+@item @code{:html-xml-declaration}
+@tab @code{org-html-xml-declaration}
+@end multitable
+
+@anchor{@LaTeX{} specific properties}
+@subsubheading @LaTeX{} specific properties
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @code{:latex-active-timestamp-format}
+@tab @code{org-latex-active-timestamp-format}
+@item @code{:latex-caption-above}
+@tab @code{org-latex-caption-above}
+@item @code{:latex-classes}
+@tab @code{org-latex-classes}
+@item @code{:latex-class}
+@tab @code{org-latex-default-class}
+@item @code{:latex-compiler}
+@tab @code{org-latex-compiler}
+@item @code{:latex-default-figure-position}
+@tab @code{org-latex-default-figure-position}
+@item @code{:latex-default-table-environment}
+@tab @code{org-latex-default-table-environment}
+@item @code{:latex-default-table-mode}
+@tab @code{org-latex-default-table-mode}
+@item @code{:latex-diary-timestamp-format}
+@tab @code{org-latex-diary-timestamp-format}
+@item @code{:latex-footnote-defined-format}
+@tab @code{org-latex-footnote-defined-format}
+@item @code{:latex-footnote-separator}
+@tab @code{org-latex-footnote-separator}
+@item @code{:latex-format-drawer-function}
+@tab @code{org-latex-format-drawer-function}
+@item @code{:latex-format-headline-function}
+@tab @code{org-latex-format-headline-function}
+@item @code{:latex-format-inlinetask-function}
+@tab @code{org-latex-format-inlinetask-function}
+@item @code{:latex-hyperref-template}
+@tab @code{org-latex-hyperref-template}
+@item @code{:latex-image-default-height}
+@tab @code{org-latex-image-default-height}
+@item @code{:latex-image-default-option}
+@tab @code{org-latex-image-default-option}
+@item @code{:latex-image-default-width}
+@tab @code{org-latex-image-default-width}
+@item @code{:latex-images-centered}
+@tab @code{org-latex-images-centered}
+@item @code{:latex-inactive-timestamp-format}
+@tab @code{org-latex-inactive-timestamp-format}
+@item @code{:latex-inline-image-rules}
+@tab @code{org-latex-inline-image-rules}
+@item @code{:latex-link-with-unknown-path-format}
+@tab @code{org-latex-link-with-unknown-path-format}
+@item @code{:latex-listings-langs}
+@tab @code{org-latex-listings-langs}
+@item @code{:latex-listings-options}
+@tab @code{org-latex-listings-options}
+@item @code{:latex-listings}
+@tab @code{org-latex-listings}
+@item @code{:latex-minted-langs}
+@tab @code{org-latex-minted-langs}
+@item @code{:latex-minted-options}
+@tab @code{org-latex-minted-options}
+@item @code{:latex-prefer-user-labels}
+@tab @code{org-latex-prefer-user-labels}
+@item @code{:latex-subtitle-format}
+@tab @code{org-latex-subtitle-format}
+@item @code{:latex-subtitle-separate}
+@tab @code{org-latex-subtitle-separate}
+@item @code{:latex-table-scientific-notation}
+@tab @code{org-latex-table-scientific-notation}
+@item @code{:latex-tables-booktabs}
+@tab @code{org-latex-tables-booktabs}
+@item @code{:latex-tables-centered}
+@tab @code{org-latex-tables-centered}
+@item @code{:latex-text-markup-alist}
+@tab @code{org-latex-text-markup-alist}
+@item @code{:latex-title-command}
+@tab @code{org-latex-title-command}
+@item @code{:latex-toc-command}
+@tab @code{org-latex-toc-command}
+@end multitable
+
+@anchor{Markdown specific properties}
+@subsubheading Markdown specific properties
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @code{:md-footnote-format}
+@tab @code{org-md-footnote-format}
+@item @code{:md-footnotes-section}
+@tab @code{org-md-footnotes-section}
+@item @code{:md-headline-style}
+@tab @code{org-md-headline-style}
+@end multitable
+
+@anchor{ODT specific properties}
+@subsubheading ODT specific properties
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @code{:odt-content-template-file}
+@tab @code{org-odt-content-template-file}
+@item @code{:odt-display-outline-level}
+@tab @code{org-odt-display-outline-level}
+@item @code{:odt-fontify-srcblocks}
+@tab @code{org-odt-fontify-srcblocks}
+@item @code{:odt-format-drawer-function}
+@tab @code{org-odt-format-drawer-function}
+@item @code{:odt-format-headline-function}
+@tab @code{org-odt-format-headline-function}
+@item @code{:odt-format-inlinetask-function}
+@tab @code{org-odt-format-inlinetask-function}
+@item @code{:odt-inline-formula-rules}
+@tab @code{org-odt-inline-formula-rules}
+@item @code{:odt-inline-image-rules}
+@tab @code{org-odt-inline-image-rules}
+@item @code{:odt-pixels-per-inch}
+@tab @code{org-odt-pixels-per-inch}
+@item @code{:odt-styles-file}
+@tab @code{org-odt-styles-file}
+@item @code{:odt-table-styles}
+@tab @code{org-odt-table-styles}
+@item @code{:odt-use-date-fields}
+@tab @code{org-odt-use-date-fields}
+@end multitable
+
+@anchor{Texinfo specific properties}
+@subsubheading Texinfo specific properties
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @code{:texinfo-active-timestamp-format}
+@tab @code{org-texinfo-active-timestamp-format}
+@item @code{:texinfo-classes}
+@tab @code{org-texinfo-classes}
+@item @code{:texinfo-class}
+@tab @code{org-texinfo-default-class}
+@item @code{:texinfo-table-default-markup}
+@tab @code{org-texinfo-table-default-markup}
+@item @code{:texinfo-diary-timestamp-format}
+@tab @code{org-texinfo-diary-timestamp-format}
+@item @code{:texinfo-filename}
+@tab @code{org-texinfo-filename}
+@item @code{:texinfo-format-drawer-function}
+@tab @code{org-texinfo-format-drawer-function}
+@item @code{:texinfo-format-headline-function}
+@tab @code{org-texinfo-format-headline-function}
+@item @code{:texinfo-format-inlinetask-function}
+@tab @code{org-texinfo-format-inlinetask-function}
+@item @code{:texinfo-inactive-timestamp-format}
+@tab @code{org-texinfo-inactive-timestamp-format}
+@item @code{:texinfo-link-with-unknown-path-format}
+@tab @code{org-texinfo-link-with-unknown-path-format}
+@item @code{:texinfo-node-description-column}
+@tab @code{org-texinfo-node-description-column}
+@item @code{:texinfo-table-scientific-notation}
+@tab @code{org-texinfo-table-scientific-notation}
+@item @code{:texinfo-tables-verbatim}
+@tab @code{org-texinfo-tables-verbatim}
+@item @code{:texinfo-text-markup-alist}
+@tab @code{org-texinfo-text-markup-alist}
+@end multitable
+
+@node Publishing links
+@subsection Publishing links
+
+@cindex links, publishing
+
+To create a link from one Org file to another, you would use something
+like @samp{[[file:foo.org][The foo]]} or simply @samp{[[file:foo.org]]} (see @ref{External Links}). When
+published, this link becomes a link to @samp{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 @samp{http} link instead of
+a @samp{file:} link, because @samp{file} links are converted to link to the
+corresponding @samp{.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 @ref{Complex example}, for an example of this
+usage.
+
+Eventually, links between published documents can contain some search
+options (see @ref{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 @samp{foo.html}.
+
+@example
+[[file:foo.org::*heading]]
+[[file:foo.org::#custom-id]]
+[[file:foo.org::target]]
+@end example
+
+@node Site map
+@subsection Generating a sitemap
+
+@cindex sitemap, of published pages
+
+The following properties may be used to control publishing of
+a map of files for a given project.
+
+@table @asis
+@item @code{:auto-sitemap}
+When non-@code{nil}, publish a sitemap during
+@code{org-publish-current-project} or @code{org-publish-all}.
+
+@item @code{:sitemap-filename}
+Filename for output of sitemap. Defaults to @samp{sitemap.org}, which
+becomes @samp{sitemap.html}.
+
+@item @code{:sitemap-title}
+Title of sitemap page. Defaults to name of file.
+
+@item @code{:sitemap-format-entry}
+@findex org-publish-find-date
+@findex org-publish-find-property
+@findex org-publish-find-title
+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 @code{org-publish-find-date}, @code{org-publish-find-title} and
+@code{org-publish-find-property}, to retrieve additional information
+about published documents.
+
+@item @code{: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 @code{org-list-to-generic},
+@code{org-list-to-subtree} and alike. Default value generates a plain
+list of links to all files in the project.
+
+@item @code{:sitemap-sort-folders}
+Where folders should appear in the sitemap. Set this to @code{first}
+(default) or @code{last} to display folders first or last, respectively.
+When set to @code{ignore}, folders are ignored altogether. Any other
+value mixes files and folders. This variable has no effect when
+site-map style is @code{tree}.
+
+@item @code{:sitemap-sort-files}
+How the files are sorted in the site map. Set this to
+@code{alphabetically} (default), @code{chronologically} or
+@code{anti-chronologically}. @code{chronologically} sorts the files with
+older date first while @code{anti-chronologically} sorts the files with
+newer date first. @code{alphabetically} sorts the files alphabetically.
+The date of a file is retrieved with @code{org-publish-find-date}.
+
+@item @code{:sitemap-ignore-case}
+Should sorting be case-sensitive? Default @code{nil}.
+
+@item @code{: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:
+@code{%t} stands for the title of the file, @code{%a} stands for the author of
+the file and @code{%d} stands for the date of the file. The date is
+retrieved with the @code{org-publish-find-date} function and formatted
+with @code{org-publish-sitemap-date-format}. Default @code{%t}.
+
+@item @code{:sitemap-date-format}
+Format string for the @code{format-time-string} function that tells how
+a sitemap entry's date is to be formatted. This property bypasses
+@code{org-publish-sitemap-date-format} which defaults to @code{%Y-%m-%d}.
+@end table
+
+@node Generating an index
+@subsection Generating an index
+
+@cindex index, in a publishing project
+
+Org mode can generate an index across the files of a publishing project.
+
+@table @asis
+@item @code{:makeindex}
+When non-@code{nil}, generate in index in the file @samp{theindex.org} and
+publish it as @samp{theindex.html}.
+@end table
+
+The file is created when first publishing a project with the
+@code{:makeindex} set. The file only contains a statement @samp{#+INCLUDE:
+"theindex.inc"}. You can then build around this include statement by
+adding a title, style information, etc.
+
+@cindex @samp{INDEX}, keyword
+Index entries are specified with @samp{INDEX} keyword. An entry that
+contains an exclamation mark creates a sub item.
+
+@example
+*** Curriculum Vitae
+#+INDEX: CV
+#+INDEX: Application!CV
+@end example
+
+@node Uploading Files
+@section Uploading Files
+
+@cindex rsync
+@cindex unison
+
+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 @emph{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 @code{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 @code{org-publish-use-timestamps-flag} to @code{nil}, you gain the
+main benefit of re-including any changed external files such as source
+example files you might include with @samp{INCLUDE} keyword. The timestamp
+mechanism in Org is not smart enough to detect if included files have
+been modified.
+
+@node Sample Configuration
+@section 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.
+@end menu
+
+@node Simple example
+@subsection Example: simple publishing configuration
+
+This example publishes a set of Org files to the @samp{public_html}
+directory on the local machine.
+
+@lisp
+(setq org-publish-project-alist
+ '(("org"
+ :base-directory "~/org/"
+ :publishing-function org-html-publish-to-html
+ :publishing-directory "~/public_html"
+ :section-numbers nil
+ :with-toc nil
+ :html-head "<link rel=\"stylesheet\"
+ href=\"../other/mystyle.css\"
+ type=\"text/css\"/>")))
+@end lisp
+
+@node Complex example
+@subsection 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 @samp{~/org/} and your
+publishable images in @samp{~/images/}, you would link to an image with
+
+@example
+file:../images/myimage.png
+@end example
+
+
+On the web server, the relative path to the image should be the same.
+You can accomplish this by setting up an @samp{images/} folder in the right
+place on the web server, and publishing images to it.
+
+@lisp
+(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 "<link rel=\"stylesheet\"
+ href=\"../other/mystyle.css\" type=\"text/css\"/>"
+ :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"))))
+@end lisp
+
+@node Triggering Publication
+@section Triggering Publication
+
+Once properly configured, Org can publish with the following commands:
+
+@table @asis
+@item @kbd{C-c C-e P x} (@code{org-publish})
+@kindex C-c C-e P x
+@findex org-publish
+Prompt for a specific project and publish all files that belong to
+it.
+
+@item @kbd{C-c C-e P p} (@code{org-publish-current-project})
+@kindex C-c C-e P p
+@findex org-publish-current-project
+Publish the project containing the current file.
+
+@item @kbd{C-c C-e P f} (@code{org-publish-current-file})
+@kindex C-c C-e P f
+@findex org-publish-current-file
+Publish only the current file.
+
+@item @kbd{C-c C-e P a} (@code{org-publish-all})
+@kindex C-c C-e P a
+@findex org-publish-all
+Publish every project.
+@end table
+
+@vindex org-publish-use-timestamps-flag
+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
+@code{org-publish-use-timestamps-flag}. This may be necessary in
+particular if files include other files via @samp{SETUPFILE} or @samp{INCLUDE}
+keywords.
+
+@node Citation handling
+@chapter Citation handling
+
+@cindex citation
+
+The @samp{oc.el} library provides tooling to handle citations in Org via
+``citation processors'' that offer some or all of the following
+capabilities:
+
+@table @asis
+@item activate
+Fontification, tooltip preview, etc.
+@item follow
+At-point actions on citations via @code{org-open-at-point}.
+@item insert
+Add and edit citations via @code{org-cite-insert}.
+@item export
+Via different libraries for different target formats.
+@end table
+
+The user can configure these with @code{org-cite-activate-processor},
+@code{org-cite-follow-processor}, @code{org-cite-insert-processor}, and
+@code{org-cite-export-processors} respectively.
+
+The included ``basic'' processor provides all four capabilities.
+
+@menu
+* Citations::
+* Citation export processors::
+@end menu
+
+@node Citations
+@section Citations
+
+Before adding citations, first set one-or-more bibliographies, either
+globally with @code{org-cite-global-bibliography}, or locally using one or
+more ``bibliography'' keywords.
+
+@example
+#+bibliography: SomeFile.bib
+#+bibliography: /some/other/file.json
+#+bibliography: "/some/file/with spaces/in its name.bib"
+@end example
+
+@kindex C-c C-x @@
+@findex org-cite-insert
+One can then insert and edit citations using @code{org-cite-insert}, called
+with @kbd{C-c C-x @@}.
+
+A @emph{citation} requires one or more citation @emph{key(s)}, elements
+identifying a reference in the bibliography.
+
+@itemize
+@item
+Each citation is surrounded by brackets and uses the @samp{cite} type.
+
+@item
+Each key starts with the character @samp{@@}.
+
+@item
+Each key can be qualified by a @emph{prefix} (e.g.@tie{}``see '') and/or
+a @emph{suffix} (e.g.@tie{}``p.@tie{}123''), giving information useful or necessary
+fo the comprehension of the citation but not included in the
+reference.
+
+@item
+A single citation can cite more than one reference ; the keys are
+separated by semicolons ; the formatting of such citation groups is
+specified by the style.
+
+@item
+One can also specify a stylistic variation for the citations by
+inserting a @samp{/} and a style name between the @samp{cite} keyword and the
+colon; this usually makes sense only for the author-year styles.
+@end itemize
+
+@example
+[cite/style:common prefix ;prefix @@key suffix; ... ; common suffix]
+@end example
+
+
+The only mandatory elements are:
+
+@itemize
+@item
+The @samp{cite} keyword and the colon.
+@item
+The @samp{@@} character immediately preceding each key.
+@item
+The brackets surrounding the citation(s) (group).
+@end itemize
+
+@node Citation export processors
+@section Citation export processors
+
+Org currently includes the following export processors:
+
+@itemize
+@item
+Two processors can export to a variety of formats, including @samp{latex}
+(and therefore @samp{pdf}), @samp{html}, @samp{odt} and plain (UTF8) text:
+
+@table @asis
+@item basic
+a basic export processor, well adapted to situations
+where backward compatibility is not a requirement and formatting
+needs are minimal;
+
+@item csl
+this export processor uses format files written in @uref{https://en.wikipedia.org/wiki/Citation_Style_Language, Citation
+Style Language} via @uref{https://github.com/andras-simonyi/citeproc-el, citeproc-el};
+@end table
+
+@item
+In contrast, two other processors target @LaTeX{} and @LaTeX{}-derived
+formats exclusively:
+
+@table @asis
+@item natbib
+this export processor uses Bib@TeX{}, the historical
+bibliographic processor used with @LaTeX{}, thus allowing the use of
+data and style files compatible with this processor (including
+a large number of publishers' styles). It uses citation commands
+implemented in the @LaTeX{} package @samp{natbib}, allowing more stylistic
+variants that @LaTeX{}'s @samp{\cite} command.
+
+@item biblatex
+this backend allows the use of data and formats
+prepared for Bib@LaTeX{}, an alternate bibliographic processor used
+with @LaTeX{}, which overcomes some serious Bib@TeX{} limitations, but
+has not (yet?)@tie{}been widely adopted by publishers.
+@end table
+@end itemize
+
+The @samp{CITE_EXPORT} keyword specifies the export processor and the
+citation (and possibly reference) style(s); for example (all arguments
+are optional)
+
+@example
+#+cite_export: basic author author-year
+@end example
+
+
+@noindent
+specifies the ``basic'' export processor with citations inserted as
+author's name and references indexed by author's names and year;
+
+@example
+#+cite_export: csl /some/path/to/vancouver-brackets.csl
+@end example
+
+
+@noindent
+specifies the ``csl'' processor and CSL style, which in this case
+defines numeric citations and numeric references according to the
+@samp{Vancouver} specification (as style used in many medical journals),
+following a typesetting variation putting citations between brackets;
+
+@example
+#+cite_export: natbib kluwer
+@end example
+
+
+@noindent
+specifies the @samp{natbib} export processor with a label citation style
+conformant to the Harvard style and the specification of the
+Wolkers-Kluwer publisher; since it relies on the @code{bibtex} processor of
+your @LaTeX{} installation, it won't export to anything but PDF@.
+
+@node Working with Source Code
+@chapter Working with Source Code
+
+@cindex source code, working with
+
+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:
+
+@example
+#+BEGIN_SRC emacs-lisp
+ (defun org-xor (a b)
+ "Exclusive or."
+ (if a (not b) b))
+#+END_SRC
+@end example
+
+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
+@samp{#+BEGIN_SRC} and @samp{#+END_SRC}.
+
+Details of Org's facilities for working with source code are described
+in the following sections.
+
+@menu
+* Features Overview:: Enjoy the versatility of source blocks.
+* 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.
+@end menu
+
+@node Features Overview
+@section Features Overview
+
+Org can manage the source code in the block delimited by @samp{#+BEGIN_SRC}
+@dots{} @samp{#+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 @emph{live code}
+blocks because they can alter the content of the Org document or the
+material that it exports. Users can control the ``liveliness'' of each
+source code block by tweaking the header arguments (see @ref{Using Header Arguments}) for compiling, execution, extraction, and exporting.
+
+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 @emph{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 @emph{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.
+
+@node Structure of Code Blocks
+@section Structure of Code Blocks
+
+@cindex code block, structure
+@cindex source code, block structure
+@cindex @samp{NAME} keyword, in source blocks
+@cindex @samp{BEGIN_SRC}
+
+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:
+
+@example
+#+NAME: <name>
+#+BEGIN_SRC <language> <switches> <header arguments>
+ <body>
+#+END_SRC
+@end example
+
+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
+@ref{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.
+
+@cindex source code, inline
+An inline code block conforms to this structure:
+
+@example
+src_<language>@{<body>@}
+@end example
+
+
+@noindent
+or
+
+@example
+src_<language>[<header arguments>]@{<body>@}
+@end example
+
+
+@table @asis
+@item @samp{#+NAME: <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 @ref{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.
+
+@item @samp{#+BEGIN_SRC} @dots{} @samp{#+END_SRC}
+Mandatory. They mark the start and end of a block that Org
+requires. The @samp{#+BEGIN_SRC} line takes additional arguments, as
+described next.
+
+@item @samp{<language>}
+@cindex language, in code blocks
+Mandatory. It is the identifier of the source code language in the
+block. See @ref{Languages}, for identifiers of supported languages.
+
+@item @samp{<switches>}
+@cindex switches, in code blocks
+Optional. Switches provide finer control of the code execution,
+export, and format (see the discussion of switches in @ref{Literal Examples}).
+
+@item @samp{<header arguments>}
+@cindex header arguments, in code blocks
+Optional. Heading arguments control many aspects of evaluation,
+export and tangling of code blocks (see @ref{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.
+
+@item @samp{<body>}
+Source code in the dialect of the specified language identifier.
+@end table
+
+@node Using Header Arguments
+@section 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.
+
+@anchor{System-wide header arguments}
+@subheading System-wide header arguments
+
+@vindex org-babel-default-header-args
+
+@vindex org-babel-default-header-args
+System-wide values of header arguments can be specified by customizing
+the @code{org-babel-default-header-args} variable, which defaults to the
+following values:
+
+@example
+:session => "none"
+:results => "replace"
+:exports => "code"
+:cache => "no"
+:noweb => "no"
+@end example
+
+The example below sets @samp{:noweb} header arguments to @samp{yes}, which makes
+Org expand @samp{:noweb} references by default.
+
+@lisp
+(setq org-babel-default-header-args
+ (cons '(:noweb . "yes")
+ (assq-delete-all :noweb org-babel-default-header-args)))
+@end lisp
+
+@cindex language specific default header arguments
+@cindex default header arguments per language
+Each language can have separate default header arguments by
+customizing the variable @code{org-babel-default-header-args:<LANG>}, where
+@var{<LANG>} is the name of the language. For details, see the
+language-specific online documentation at
+@uref{https://orgmode.org/worg/org-contrib/babel/}.
+
+@anchor{Header arguments in Org mode properties}
+@subheading Header arguments in Org mode properties
+
+For header arguments applicable to the buffer, use @samp{PROPERTY} keyword
+anywhere in the Org file (see @ref{Property Syntax}).
+
+The following example makes all the R code blocks execute in the same
+session. Setting @samp{:results} to @samp{silent} ignores the results of
+executions for all blocks, not just R code blocks; no results inserted
+for any block.
+
+@example
+#+PROPERTY: header-args:R :session *R*
+#+PROPERTY: header-args :results silent
+@end example
+
+@vindex org-use-property-inheritance
+Header arguments set through Org's property drawers (see @ref{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
+@code{org-use-property-inheritance} setting.
+
+In this example, @samp{:cache} defaults to @samp{yes} for all code blocks in the
+sub-tree.
+
+@example
+* sample header
+ :PROPERTIES:
+ :header-args: :cache yes
+ :END:
+@end example
+
+@kindex C-c C-x p
+@findex org-set-property
+Properties defined through @code{org-set-property} function, bound to
+@kbd{C-c C-x p}, apply to all active languages. They override
+properties set in @code{org-babel-default-header-args}.
+
+@cindex language specific header arguments properties
+@cindex header arguments per language
+Language-specific header arguments are also read from properties
+@samp{header-args:<LANG>} where @var{<LANG>} is the language
+identifier. For example,
+
+@example
+* Heading
+ :PROPERTIES:
+ :header-args:clojure: :session *clojure-1*
+ :header-args:R: :session *R*
+ :END:
+** Subheading
+ :PROPERTIES:
+ :header-args:clojure: :session *clojure-2*
+ :END:
+@end example
+
+@noindent
+would force separate sessions for Clojure blocks in @samp{Heading} and
+@samp{Subheading}, but use the same session for all R blocks. Blocks in
+@samp{Subheading} inherit settings from @samp{Heading}.
+
+@anchor{Code block specific header arguments}
+@subheading Code block specific header arguments
+
+Header arguments are most commonly set at the source code block level,
+on the @samp{#+BEGIN_SRC} line. Arguments set at this level take
+precedence over those set in the @code{org-babel-default-header-args}
+variable, and also those set as header properties.
+
+In the following example, setting @samp{:results} to @samp{silent} makes it
+ignore results of the code execution. Setting @samp{:exports} to @samp{code}
+exports only the body of the code block to HTML or @LaTeX{}.
+
+@example
+#+NAME: factorial
+#+BEGIN_SRC haskell :results silent :exports code :var n=0
+ fac 0 = 1
+ fac n = n * fac (n-1)
+#+END_SRC
+@end example
+
+The same header arguments in an inline code block:
+
+@example
+src_haskell[:exports both]@{fac 5@}
+@end example
+
+
+@cindex @samp{HEADER}, keyword
+Code block header arguments can span multiple lines using @samp{#+HEADER:}
+on each line. Note that Org currently accepts the plural spelling of
+@samp{#+HEADER:} only as a convenience for backward-compatibility. It may
+be removed at some point.
+
+Multi-line header arguments on an unnamed code block:
+
+@example
+#+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
+@end example
+
+Multi-line header arguments on a named code block:
+
+@example
+#+NAME: named-block
+#+HEADER: :var data=2
+#+BEGIN_SRC emacs-lisp
+ (message "data:%S" data)
+#+END_SRC
+
+#+RESULTS: named-block
+ : data:2
+@end example
+
+@anchor{Header arguments in function calls}
+@subheading 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 @samp{#+CALL:} examples are shown below. For the complete
+syntax of @samp{CALL} keyword, see @ref{Evaluating Code Blocks}.
+
+In this example, @samp{:exports results} header argument is applied to the
+evaluation of the @samp{#+CALL:} line.
+
+@example
+#+CALL: factorial(n=5) :exports results
+@end example
+
+
+In this example, @samp{:session special} header argument is applied to the
+evaluation of @samp{factorial} code block.
+
+@example
+#+CALL: factorial[:session special](n=5)
+@end example
+
+@node Environment of a Code Block
+@section Environment of a Code Block
+
+
+
+@anchor{Passing arguments}
+@subheading Passing arguments
+
+@cindex passing arguments to code blocks
+@cindex arguments, in code blocks
+@cindex @samp{var}, header argument
+Use @samp{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 @samp{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 @samp{var} header argument.
+
+@example
+:var NAME=ASSIGN
+@end example
+
+
+@noindent
+@var{NAME} is the name of the variable bound in the code block
+body. @var{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. @var{ASSIGN} may specify a filename for references
+to elements in a different file, using a @samp{:} to separate the filename
+from the reference.
+
+@example
+:var NAME=FILE:REFERENCE
+@end example
+
+
+Here are examples of passing values by reference:
+
+@table @asis
+@item table
+A table named with a @samp{NAME} keyword.
+
+@example
+#+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
+@end example
+
+When passing a table, you can treat specially the row, or the
+column, containing labels for the columns, or the rows, in the
+table.
+
+@cindex @samp{colnames}, header argument
+The @samp{colnames} header argument accepts @samp{yes}, @samp{no}, or @samp{nil} values.
+The default value is @samp{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 @samp{yes},
+Org does the same to the first row, even if the initial table does
+not contain any horizontal rule. When set to @samp{no}, Org does not
+pre-process column names at all.
+
+@example
+#+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* |
+@end example
+
+@cindex @samp{rownames}, header argument
+Similarly, the @samp{rownames} header argument can take two values: @samp{yes}
+or @samp{no}. When set to @samp{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 @samp{no}, which means Org does not
+pre-process the first column. Note that Emacs Lisp code blocks
+ignore @samp{rownames} header argument because of the ease of
+table-handling in Emacs.
+
+@example
+#+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 |
+@end example
+@end table
+
+To refer to a table in another file, join the filename and table name with
+a colon, for example: @samp{:var table=other-file.org:example-table}.
+
+@table @asis
+@item list
+A simple named list.
+
+@example
+#+NAME: example-list
+- simple
+ - not
+ - nested
+- list
+
+#+BEGIN_SRC emacs-lisp :var x=example-list
+ (print x)
+#+END_SRC
+
+#+RESULTS:
+| simple | list |
+@end example
+
+Note that only the top level list items are passed along. Nested
+list items are ignored.
+
+@item code block without arguments
+A code block name, as assigned by @samp{NAME} keyword from the example
+above, optionally followed by parentheses.
+
+@example
+#+BEGIN_SRC emacs-lisp :var length=table-length()
+ (* 2 length)
+#+END_SRC
+
+#+RESULTS:
+: 8
+@end example
+
+@item code block with arguments
+A code block name, as assigned by @samp{NAME} keyword, followed by
+parentheses and optional arguments passed within the parentheses.
+
+@example
+#+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
+@end example
+
+@item literal example
+A literal example block named with a @samp{NAME} keyword.
+
+@example
+#+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.
+@end example
+@end table
+
+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
+@emph{before} other table-related header arguments are applied, such as
+@samp{hlines}, @samp{colnames} and @samp{rownames}. The following example assigns
+the last cell of the first row the table @samp{example-table} to the
+variable @samp{data}:
+
+@example
+#+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
+@end example
+
+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 @samp{example-table}
+to @samp{data}.
+
+@example
+#+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 |
+@end example
+
+To pick the entire range, use an empty index, or the single character
+@samp{*}. @samp{0:-1} does the same thing. Example below shows how to
+reference the first column only.
+
+@example
+#+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 |
+@end example
+
+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.
+
+@example
+#+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 |
+@end example
+
+Note that row names and column names are not removed prior to variable
+indexing. You need to take them into account, even when @samp{colnames} or
+@samp{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 @samp{(}, @samp{[}, @samp{'} or @samp{`} 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.
+
+@example
+#+BEGIN_SRC sh :var filename=(buffer-file-name) :exports both
+ wc -w $filename
+#+END_SRC
+@end example
+
+Note that values read from tables and lists are not mistakenly
+evaluated as Emacs Lisp code, as illustrated in the following example.
+
+@example
+#+NAME: table
+| (a b c) |
+
+#+HEADER: :var data=table[0,0]
+#+BEGIN_SRC perl
+ $data
+#+END_SRC
+
+#+RESULTS:
+: (a b c)
+@end example
+
+@anchor{Using sessions}
+@subheading Using sessions
+
+@cindex using sessions in code blocks
+@cindex @samp{session}, header argument
+Two code blocks can share the same environment. The @samp{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.
+
+@table @asis
+@item @samp{none}
+Default. Each code block gets a new interpreter process to execute.
+The process terminates once the block is evaluated.
+
+@item @var{STRING}
+Any string besides @samp{none} turns that string into the name of that
+session. For example, @samp{:session STRING} names it @samp{STRING}. If
+@samp{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.
+@end table
+
+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.
+
+@anchor{Choosing a working directory}
+@subheading Choosing a working directory
+
+@cindex working directory, in a code block
+@cindex @samp{dir}, header argument
+@cindex @samp{mkdirp}, header argument
+The @samp{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 @samp{:dir
+DIRECTORY} temporarily has the same effect as changing the current
+directory with @kbd{M-x cd @key{RET} DIRECTORY}, and then not setting
+@samp{dir}. Under the surface, @samp{dir} simply sets the value of the Emacs
+variable @code{default-directory}. Setting @samp{mkdirp} header argument to
+a non-@code{nil} value creates the directory, if necessary.
+
+For example, to save the plot file in the @samp{Work/} folder of the home
+directory---notice tilde is expanded:
+
+@example
+#+BEGIN_SRC R :file myplot.png :dir ~/Work
+ matplot(matrix(rnorm(100), 10), type="l")
+#+END_SRC
+@end example
+
+To evaluate the code block on a remote machine, supply a remote
+directory name using Tramp syntax. For example:
+
+@example
+#+BEGIN_SRC R :file plot.png :dir /scp:dand@@yakuba.princeton.edu:
+ plot(1:10, main=system("hostname", intern=TRUE))
+#+END_SRC
+@end example
+
+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
+@samp{dir} and @code{default-directory}, as illustrated here:
+
+@example
+[[file:/scp:dand@@yakuba.princeton.edu:/home/dand/plot.png][plot.png]]
+@end example
+
+
+When @samp{dir} is used with @samp{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 @samp{dir} with @samp{:exports results} or with @samp{:exports both} to
+avoid Org inserting incorrect links to remote files. That is because
+Org does not expand @code{default directory} to avoid some underlying
+portability issues.
+
+@anchor{Inserting headers and footers}
+@subheading Inserting headers and footers
+
+@cindex headers, in code blocks
+@cindex footers, in code blocks
+@cindex @samp{prologue}, header argument
+The @samp{prologue} header argument is for appending to the top of the code
+block for execution, like a reset instruction. For example, you may
+use @samp{:prologue "reset"} in a Gnuplot code block or, for every such
+block:
+
+@lisp
+(add-to-list 'org-babel-default-header-args:gnuplot
+ '((:prologue . "reset")))
+
+@end lisp
+
+@cindex @samp{epilogue}, header argument
+Likewise, the value of the @samp{epilogue} header argument is for appending
+to the end of the code block for execution.
+
+@node Evaluating Code Blocks
+@section Evaluating Code Blocks
+
+@cindex code block, evaluating
+@cindex source code, evaluating
+@cindex @samp{RESULTS}, keyword
+
+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 @ref{Code Evaluation Security}.
+
+@anchor{How to evaluate source code}
+@subheading 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 @samp{RESULTS} keyword. Org creates the @samp{RESULTS}
+keyword if one is not already there.
+
+By default, Org enables only Emacs Lisp code blocks for execution.
+See @ref{Languages} to enable other languages.
+
+@kindex C-c C-c
+@kindex C-c C-v e
+@findex org-babel-execute-src-block
+Org provides many ways to execute code blocks. @kbd{C-c C-c} or
+@kbd{C-c C-v e} with the point on a code block@footnote{The option @code{org-babel-no-eval-on-ctrl-c-ctrl-c} can be used
+to remove code evaluation from the @kbd{C-c C-c} key binding.} calls the
+@code{org-babel-execute-src-block} function, which executes the code in the
+block, collects the results, and inserts them in the buffer.
+
+@cindex @samp{CALL}, keyword
+@vindex org-babel-inline-result-wrap
+By calling a named code block@footnote{Actually, the constructs @samp{call_<name>()} and @samp{src_<lang>@{@}}
+are not evaluated when they appear in a keyword (see @ref{In-buffer Settings}).} 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 @ref{Library of Babel}).
+
+The syntax for @samp{CALL} keyword is:
+
+@example
+#+CALL: <name>(<arguments>)
+#+CALL: <name>[<inside header arguments>](<arguments>) <end header arguments>
+@end example
+
+The syntax for inline named code blocks is:
+
+@example
+... call_<name>(<arguments>) ...
+... call_<name>[<inside header arguments>](<arguments>)[<end header arguments>] ...
+@end example
+
+When inline syntax is used, the result is wrapped based on the
+variable @code{org-babel-inline-result-wrap}, which by default is set to
+@code{"=%s="} to produce verbatim text suitable for markup.
+
+@table @asis
+@item @samp{<name>}
+This is the name of the code block (see @ref{Structure of Code Blocks})
+to be evaluated in the current document. If the block is located in
+another file, start @samp{<name>} with the file name followed by
+a colon. For example, in order to execute a block named @samp{clear-data}
+in @samp{file.org}, you can write the following:
+
+@example
+#+CALL: file.org:clear-data()
+@end example
+
+@item @samp{<arguments>}
+Org passes arguments to the code block using standard function call
+syntax. For example, a @samp{#+CALL:} line that passes @samp{4} to a code
+block named @samp{double}, which declares the header argument @samp{:var n=2},
+would be written as:
+
+@example
+#+CALL: double(n=4)
+@end example
+
+
+@noindent
+Note how this function call syntax is different from the header
+argument syntax.
+
+@item @samp{<inside header arguments>}
+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, @samp{[: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.
+
+@item @samp{<end header arguments>}
+End header arguments affect the results returned by the code block.
+For example, @samp{:results html} wraps the results in a @samp{#+BEGIN_EXPORT
+ html} block before inserting the results in the Org buffer.
+@end table
+
+@anchor{Limit code block evaluation}
+@subheading Limit code block evaluation
+
+@cindex @samp{eval}, header argument
+@cindex control code block evaluation
+The @samp{eval} header argument can limit evaluation of specific code
+blocks and @samp{CALL} keyword. It is useful for protection against
+evaluating untrusted code blocks by prompting for a confirmation.
+
+@table @asis
+@item @samp{never} or @samp{no}
+Org never evaluates the source code.
+
+@item @samp{query}
+Org prompts the user for permission to evaluate the source code.
+
+@item @samp{never-export} or @samp{no-export}
+Org does not evaluate the source code when exporting, yet the user
+can evaluate it interactively.
+
+@item @samp{query-export}
+Org prompts the user for permission to evaluate the source code
+during export.
+@end table
+
+If @samp{eval} header argument is not set, then Org determines whether to
+evaluate the source code from the @code{org-confirm-babel-evaluate}
+variable (see @ref{Code Evaluation Security}).
+
+@anchor{Cache results of evaluation}
+@subheading Cache results of evaluation
+
+@cindex @samp{cache}, header argument
+@cindex cache results of code evaluation
+The @samp{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 @samp{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 @ref{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 @samp{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 @ref{Noweb Reference Syntax}).
+
+The @samp{cache} header argument can have one of two values: @samp{yes} or @samp{no}.
+
+@table @asis
+@item @samp{no}
+Default. No caching of results; code block evaluated every time.
+
+@item @samp{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
+@samp{#+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 @samp{#+RESULTS:} line.
+@end table
+
+In this example, both functions are cached. But @samp{caller} runs only if
+the result from @samp{random} has changed since the last run.
+
+@example
+#+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
+@end example
+
+@node Results of Evaluation
+@section Results of Evaluation
+
+@cindex code block, results of evaluation
+@cindex source code, results of evaluation
+
+@cindex @samp{results}, header argument
+How Org handles results of a code block execution depends on many
+header arguments working together. The primary determinant, however,
+is the @samp{results} header argument. It accepts four classes of options.
+Each code block can take only one option per class:
+
+@table @asis
+@item Collection
+For how the results should be collected from the code block;
+
+@item Type
+For which type of result the code block will return; affects how Org
+processes and inserts results in the Org buffer;
+
+@item Format
+For the result; affects how Org processes results;
+
+@item Handling
+For inserting results once they are properly formatted.
+@end table
+
+@anchor{Collection}
+@subheading Collection
+
+Collection options specify the results. Choose one of the options;
+they are mutually exclusive.
+
+@table @asis
+@item @samp{value}
+Default for most Babel libraries@footnote{Actually, the constructs @samp{call_<name>()} and @samp{src_<lang>@{@}}
+are not evaluated when they appear in a keyword (see @ref{In-buffer Settings}).}. 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 @samp{:results
+ value}, code should execute like a function and return a value. For
+languages like Python, an explicit @code{return} statement is mandatory
+when using @samp{:results value}. Result is the value returned by the
+last statement in the code block.
+
+When evaluating the code block in a session (see @ref{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 @code{_} in Ruby, and the value of @code{.Last.value} in R@.
+
+@item @samp{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.
+@end table
+
+@anchor{Type}
+@subheading 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 @asis
+@item @samp{table}
+@itemx @samp{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:
+@samp{:results value table}.
+
+@cindex @samp{hlines}, header argument
+In-between each table row or below the table headings, sometimes
+results have horizontal lines, which are also known as ``hlines''.
+The @samp{hlines} argument with the default @samp{no} value strips such lines
+from the input table. For most code, this is desirable, or else
+those @samp{hline} symbols raise unbound variable errors. A @samp{yes}
+accepts such lines, as demonstrated in the following example.
+
+@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 |
+@end example
+
+@item @samp{list}
+Interpret the results as an Org list. If the result is a single
+value, create a list of one element.
+
+@item @samp{scalar}
+@itemx @samp{verbatim}
+Interpret literally and insert as quoted text. Do not create
+a table. Usage example: @samp{:results value verbatim}.
+
+@item @samp{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.
+
+@cindex @samp{file}, header argument
+@cindex @samp{output-dir}, header argument
+Org first tries to generate the filename from the value of the
+@samp{file} header argument and the directory specified using the
+@samp{output-dir} header arguments. If @samp{output-dir} is not specified,
+Org assumes it is the current directory.
+
+@example
+#+BEGIN_SRC asymptote :results value file :file circle.pdf :output-dir img/
+ size(2cm);
+ draw(unitcircle);
+#+END_SRC
+@end example
+
+@cindex @samp{file-ext}, header argument
+If @samp{file} header argument is missing, Org generates the base name of
+the output file from the name of the code block, and its extension
+from the @samp{file-ext} header argument. In that case, both the name
+and the extension are mandatory.
+
+@example
+#+name: circle
+#+BEGIN_SRC asymptote :results value file :file-ext pdf
+ size(2cm);
+ draw(unitcircle);
+#+END_SRC
+@end example
+
+@cindex @samp{file-desc}, header argument
+The @samp{file-desc} header argument defines the description (see @ref{Link Format}) for the link. If @samp{file-desc} is present but has no value,
+the @samp{file} value is used as the link description. When this
+argument is not present, the description is omitted. If you want to
+provide the @samp{file-desc} argument but omit the description, you can
+provide it with an empty vector (i.e., :file-desc []).
+
+@cindex @samp{sep}, header argument
+By default, Org assumes that a table written to a file has
+TAB-delimited output. You can choose a different separator with
+the @samp{sep} header argument.
+
+@cindex @samp{file-mode}, header argument
+The @samp{file-mode} header argument defines the file permissions. To
+make it executable, use @samp{:file-mode (identity #o755)}.
+
+@example
+#+BEGIN_SRC shell :results file :file script.sh :file-mode (identity #o755)
+ echo "#!/bin/bash"
+ echo "echo Hello World"
+#+END_SRC
+@end example
+@end table
+
+@anchor{Format}
+@subheading 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.
+
+@table @asis
+@item @samp{code}
+Result enclosed in a code block. Useful for parsing. Usage
+example: @samp{:results value code}.
+
+@item @samp{drawer}
+Result wrapped in a @samp{RESULTS} drawer. Useful for containing @samp{raw}
+or @samp{org} results for later scripting and automated processing.
+Usage example: @samp{:results value drawer}.
+
+@item @samp{html}
+Results enclosed in a @samp{BEGIN_EXPORT html} block. Usage example:
+@samp{:results value html}.
+
+@item @samp{latex}
+Results enclosed in a @samp{BEGIN_EXPORT latex} block. Usage example:
+@samp{:results value latex}.
+
+@item @samp{link}
+@itemx @samp{graphics}
+When used along with @samp{file} type, the result is a link to the file
+specified in @samp{:file} header argument. However, unlike plain @samp{file}
+type, nothing is written to the disk. The block is used for its
+side-effects only, as in the following example:
+
+@example
+#+begin_src shell :results file link :file "download.tar.gz"
+wget -c "https://example.com/download.tar.gz"
+#+end_src
+@end example
+
+@item @samp{org}
+Results enclosed in a @samp{BEGIN_SRC org} block. For comma-escape,
+either @kbd{@key{TAB}} in the block, or export the file. Usage
+example: @samp{:results value org}.
+
+@item @samp{pp}
+Result converted to pretty-print source code. Enclosed in a code
+block. Languages supported: Emacs Lisp, Python, and Ruby. Usage
+example: @samp{:results value pp}.
+
+@item @samp{raw}
+Interpreted as raw Org mode. Inserted directly into the buffer.
+Aligned if it is a table. Usage example: @samp{:results value raw}.
+@end table
+
+@cindex @samp{wrap}, header argument
+The @samp{wrap} header argument unconditionally marks the results block by
+appending strings to @samp{#+BEGIN_} and @samp{#+END_}. If no string is
+specified, Org wraps the results in a @samp{#+BEGIN_results}
+@dots{} @samp{#+END_results} block. It takes precedent over the @samp{results}
+value listed above. E.g.,
+
+@example
+#+BEGIN_SRC emacs-lisp :results html :wrap EXPORT markdown
+"<blink>Welcome back to the 90's</blink>"
+#+END_SRC
+
+#+RESULTS:
+#+BEGIN_EXPORT markdown
+<blink>Welcome back to the 90's</blink>
+#+END_EXPORT
+@end example
+
+@anchor{Handling}
+@subheading Handling
+
+Handling options after collecting the results.
+
+@table @asis
+@item @samp{replace}
+Default. Insert results in the Org buffer. Remove previous
+results. Usage example: @samp{:results output replace}.
+
+@item @samp{silent}
+Do not insert results in the Org mode buffer, but echo them in the
+minibuffer. Usage example: @samp{:results output silent}.
+
+@item @samp{none}
+Do not process results at all. No inserting in the Org mode buffer
+nor echo them in the minibuffer. Usage example: @samp{:results none}.
+
+@item @samp{append}
+Append results to the Org buffer. Latest results are at the bottom.
+Does not remove previous results. Usage example: @samp{:results output
+ append}.
+
+@item @samp{prepend}
+Prepend results to the Org buffer. Latest results are at the top.
+Does not remove previous results. Usage example: @samp{:results output
+ prepend}.
+@end table
+
+@anchor{Post-processing}
+@subheading Post-processing
+
+@cindex @samp{post}, header argument
+@cindex @samp{*this*}, in @samp{post} header argument
+The @samp{post} header argument is for post-processing results from block
+evaluation. When @samp{post} has any value, Org binds the results to
+@code{*this*} variable for easy passing to @samp{var} header argument
+specifications (see @ref{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 @samp{post} header argument in
+action. The first one shows how to attach an @samp{ATTR_LATEX} keyword
+using @samp{post}.
+
+@example
+#+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:
+@end example
+
+The second example shows use of @samp{colnames} header argument in @samp{post}
+to pass data between code blocks.
+
+@example
+#+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 |
+@end example
+
+@node Exporting Code Blocks
+@section Exporting Code Blocks
+
+@cindex code block, exporting
+@cindex source code, exporting
+
+It is possible to export the @emph{code} of code blocks, the @emph{results} of
+code block evaluation, @emph{both} the code and the results of code block
+evaluation, or @emph{none}. Org defaults to exporting @emph{code} for most
+languages. For some languages, such as ditaa, Org defaults to
+@emph{results}. To export just the body of code blocks, see @ref{Literal Examples}. To selectively export sub-trees of an Org document, see
+@ref{Exporting}.
+
+@cindex @samp{exports}, header argument
+The @samp{exports} header argument is to specify if that part of the Org
+file is exported to, say, HTML or @LaTeX{} formats.
+
+@table @asis
+@item @samp{code}
+The default. The body of code is included into the exported file.
+Example: @samp{:exports code}.
+
+@item @samp{results}
+The results of evaluation of the code is included in the exported
+file. Example: @samp{:exports results}.
+
+@item @samp{both}
+Both the code and results of evaluation are included in the exported
+file. Example: @samp{:exports both}.
+
+@item @samp{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: @samp{:exports none}.
+@end table
+
+@vindex org-export-use-babel
+To stop Org from evaluating code blocks to speed exports, use the
+header argument @samp{:eval never-export} (see @ref{Evaluating Code Blocks}).
+To stop Org from evaluating code blocks for greater security, set the
+@code{org-export-use-babel} variable to @code{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 @samp{:eval never-export} (see @ref{Evaluating Code Blocks}).
+
+Org never evaluates code blocks in commented sub-trees when exporting
+(see @ref{Comment Lines}). On the other hand, Org does evaluate code
+blocks in sub-trees excluded from export (see @ref{Export Settings}).
+
+@node Extracting Source Code
+@section Extracting Source Code
+
+@cindex tangling
+@cindex source code, extracting
+@cindex code block, 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 @emph{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 @ref{Noweb Reference Syntax}).
+
+@anchor{Header arguments}
+@subheading Header arguments
+
+@cindex @samp{tangle}, header argument
+The @samp{tangle} header argument specifies if the code block is exported
+to source file(s).
+
+@table @asis
+@item @samp{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: @samp{:tangle yes}.
+
+@item @samp{no}
+The default. Do not extract the code in a source code file.
+Example: @samp{:tangle no}.
+
+@item @var{FILENAME}
+Export the code block to source file whose file name is derived from
+any string passed to the @samp{tangle} header argument. Org derives the
+file name as being relative to the directory of the Org file's
+location. Example: @samp{:tangle FILENAME}.
+@end table
+
+@cindex @samp{mkdirp}, header argument
+The @samp{mkdirp} header argument creates parent directories for tangled
+files if the directory does not exist. A @samp{yes} value enables
+directory creation whereas @samp{no} inhibits it.
+
+@cindex @samp{comments}, header argument
+The @samp{comments} header argument controls inserting comments into
+tangled files. These are above and beyond whatever comments may
+already exist in the code block.
+
+@table @asis
+@item @samp{no}
+The default. Do not insert any extra comments during tangling.
+
+@item @samp{link}
+Wrap the code block in comments. Include links pointing back to the
+place in the Org file from where the code was tangled.
+
+@item @samp{yes}
+Kept for backward compatibility; same as @samp{link}.
+
+@item @samp{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.
+
+@item @samp{both}
+Includes both @samp{link} and @samp{org} options.
+
+@item @samp{noweb}
+Includes @samp{link} option, expands noweb references (see @ref{Noweb Reference Syntax}), and wraps them in link comments inside the body
+of the code block.
+@end table
+
+@cindex @samp{padline}, header argument
+The @samp{padline} header argument controls insertion of newlines to pad
+source code in the tangled file.
+
+@table @asis
+@item @samp{yes}
+Default. Insert a newline before and after each code block in the
+tangled file.
+
+@item @samp{no}
+Do not insert newlines to pad the tangled code blocks.
+@end table
+
+@cindex @samp{shebang}, header argument
+The @samp{shebang} header argument can turn results into executable script
+files. By setting it to a string value---for example, @samp{: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.
+
+@cindex @samp{tangle-mode}, header argument
+The @samp{tangle-mode} header argument specifies what permissions to set
+for tangled files by @code{set-file-modes}. For example, to make
+a read-only tangled file, use @samp{:tangle-mode (identity #o444)}. To
+make it executable, use @samp{:tangle-mode (identity #o755)}. It also
+overrides executable permission granted by @samp{shebang}. When multiple
+source code blocks tangle to a single file with different and
+conflicting @samp{tangle-mode} header arguments, Org's behavior is
+undefined.
+
+@cindex @samp{no-expand}, header argument
+By default Org expands code blocks during tangling. The @samp{no-expand}
+header argument turns off such expansions. Note that one side-effect
+of expansion by @code{org-babel-expand-src-block} also assigns values (see
+@ref{Environment of a Code Block}) to variables. Expansions also replace
+noweb references with their targets (see @ref{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.
+
+@anchor{Functions}
+@subheading Functions
+
+@table @asis
+@item @code{org-babel-tangle}
+@findex org-babel-tangle
+@kindex C-c C-v t
+Tangle the current file. Bound to @kbd{C-c C-v t}.
+
+With prefix argument only tangle the current code block.
+
+@item @code{org-babel-tangle-file}
+@findex org-babel-tangle-file
+@kindex C-c C-v f
+Choose a file to tangle. Bound to @kbd{C-c C-v f}.
+@end table
+
+@anchor{Tangle hooks}
+@subheading Tangle hooks
+
+@table @asis
+@item @code{org-babel-post-tangle-hook}
+@vindex org-babel-post-tangle-hook
+This hook is run from within code files tangled by
+@code{org-babel-tangle}, making it suitable for post-processing,
+compilation, and evaluation of code in the tangled files.
+@end table
+
+@anchor{Jumping between code and Org}
+@subheading Jumping between code and Org
+
+@findex org-babel-tangle-jump-to-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
+@code{org-babel-tangle-jump-to-org} function with two additional source
+code block header arguments:
+
+@enumerate
+@item
+Set @samp{padline} to true---this is the default setting.
+@item
+Set @samp{comments} to @samp{link}, which makes Org insert links to the Org
+file.
+@end enumerate
+
+@node Languages
+@section Languages
+
+@cindex babel, languages
+@cindex source code, languages
+@cindex code block, languages
+
+Code blocks in dozens of languages are supported. See Worg for
+@uref{https://orgmode.org/worg/org-contrib/babel/languages/index.html, language specific documentation}.
+
+@vindex org-babel-load-languages
+By default, only Emacs Lisp is enabled for evaluation. To enable or
+disable other languages, customize the @code{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@.
+
+@lisp
+(org-babel-do-load-languages
+ 'org-babel-load-languages
+ '((emacs-lisp . nil)
+ (R . t)))
+@end lisp
+
+Note that this is not the only way to enable a language. Org also
+enables languages when loaded with @code{require} statement. For example,
+the following enables execution of Clojure code blocks:
+
+@lisp
+(require 'ob-clojure)
+@end lisp
+
+@node Editing Source Code
+@section Editing Source Code
+
+@cindex code block, editing
+@cindex source code, editing
+
+@kindex C-c '
+Use @kbd{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 @kbd{C-c '} again to close the buffer
+and return to the Org buffer.
+
+@kindex C-x C-s
+@vindex org-edit-src-auto-save-idle-delay
+@cindex auto-save, in code block editing
+@kbd{C-x C-s} saves the buffer and updates the contents of the
+Org buffer. Set @code{org-edit-src-auto-save-idle-delay} to save the base
+buffer after a certain idle delay time. Set
+@code{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 @code{org-edit-structure}.
+
+@table @asis
+@item @code{org-src-lang-modes}
+@vindex org-src-lang-modes
+If an Emacs major-mode named @code{<LANG>-mode} exists, where
+@var{<LANG>} 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.
+
+@item @code{org-src-window-setup}
+@vindex org-src-window-setup
+For specifying Emacs window arrangement when the new edit buffer is
+created.
+
+@item @code{org-src-preserve-indentation}
+@cindex indentation, in code blocks
+@vindex org-src-preserve-indentation
+Default is @code{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-@code{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.
+
+@item @code{org-src-ask-before-returning-to-edit-buffer}
+@vindex org-src-ask-before-returning-to-edit-buffer
+When @code{nil}, Org returns to the edit buffer without further prompts.
+The default prompts for a confirmation.
+@end table
+
+@vindex org-src-fontify-natively
+@vindex org-src-block-faces
+Set @code{org-src-fontify-natively} to non-@code{nil} to turn on native code
+fontification in the @emph{Org} buffer. Fontification of code blocks can
+give visual separation of text and code on the display page. To
+further customize the appearance of @code{org-block} for specific
+languages, customize @code{org-src-block-faces}. The following example
+shades the background of regular blocks, and colors source blocks only
+for Python and Emacs Lisp languages.
+
+@lisp
+(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"))))
+@end lisp
+
+@node Noweb Reference Syntax
+@section Noweb Reference Syntax
+
+@cindex code block, noweb reference
+@cindex syntax, noweb
+@cindex source code, noweb reference
+
+@cindex @samp{noweb-ref}, header argument
+Source code blocks can include references to other source code blocks,
+using a noweb@footnote{For noweb literate programming details, see
+@uref{http://www.cs.tufts.edu/~nr/noweb/}.} style syntax:
+
+@example
+<<CODE-BLOCK-ID>>
+@end example
+
+
+@noindent
+where @var{CODE-BLOCK-ID} refers to either the @samp{NAME} of a single
+source code block, or a collection of one or more source code blocks
+sharing the same @samp{noweb-ref} header argument (see @ref{Using Header Arguments}). Org can replace such references with the source code of
+the block or blocks being referenced, or, in the case of a single
+source code block named with @samp{NAME}, with the results of an evaluation
+of that block.
+
+@cindex @samp{noweb}, header argument
+The @samp{noweb} header argument controls expansion of noweb syntax
+references. Expansions occur when source code blocks are evaluated,
+tangled, or exported.
+
+@table @asis
+@item @samp{no}
+Default. No expansion of noweb syntax references in the body of the
+code when evaluating, tangling, or exporting.
+
+@item @samp{yes}
+Expansion of noweb syntax references in the body of the code block
+when evaluating, tangling, or exporting.
+
+@item @samp{tangle}
+Expansion of noweb syntax references in the body of the code block
+when tangling. No expansion when evaluating or exporting.
+
+@item @samp{no-export}
+Expansion of noweb syntax references in the body of the code block
+when evaluating or tangling. No expansion when exporting.
+
+@item @samp{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.
+
+@item @samp{eval}
+Expansion of noweb syntax references in the body of the code block
+only before evaluating.
+@end table
+
+In the most simple case, the contents of a single source block is
+inserted within other blocks. Thus, in following example,
+
+@example
+#+NAME: initialization
+#+BEGIN_SRC emacs-lisp
+ (setq sentence "Never a foot too far, even.")
+#+END_SRC
+
+#+BEGIN_SRC emacs-lisp :noweb yes
+ <<initialization>>
+ (reverse sentence)
+#+END_SRC
+@end example
+
+@noindent
+the second code block is expanded as
+
+@example
+#+BEGIN_SRC emacs-lisp :noweb yes
+ (setq sentence "Never a foot too far, even.")
+ (reverse sentence)
+#+END_SRC
+@end example
+
+You may also include the contents of multiple blocks sharing a common
+@samp{noweb-ref} header argument, which can be set at the file, sub-tree,
+or code block 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.
+
+@example
+#+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh
+ <<fullest-disk>>
+#+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
+@end example
+
+@cindex @samp{noweb-sep}, header argument
+By default a newline separates each noweb reference concatenation. To
+use a different separator, edit the @samp{noweb-sep} header argument.
+
+Alternatively, Org can include the results of evaluation of a single
+code block rather than its body. Evaluation occurs when parentheses,
+possibly including arguments, are appended to the code block name, as
+shown below.
+
+@example
+<<NAME(optional arguments)>>
+@end example
+
+
+Note that in this case, a code block name set by @samp{NAME} keyword is
+required; the reference set by @samp{noweb-ref} will not work when
+evaluation is desired.
+
+Here is an example that demonstrates how the exported content changes
+when noweb style references are used with parentheses versus without.
+Given:
+
+@example
+#+NAME: some-code
+#+BEGIN_SRC python :var num=0 :results output :exports none
+ print(num*10)
+#+END_SRC
+@end example
+
+@noindent
+this code block:
+
+@example
+#+BEGIN_SRC text :noweb yes
+ <<some-code>>
+#+END_SRC
+@end example
+
+@noindent
+expands to:
+
+@example
+print(num*10)
+@end example
+
+
+Below, a similar noweb style reference is used, but with parentheses,
+while setting a variable @samp{num} to 10:
+
+@example
+#+BEGIN_SRC text :noweb yes
+ <<some-code(num=10)>>
+#+END_SRC
+@end example
+
+@noindent
+Note that the expansion now contains the results of the code block
+@samp{some-code}, not the code block itself:
+
+@example
+100
+@end example
+
+
+Noweb insertions honor prefix characters that appear before the noweb
+syntax reference. This behavior is illustrated in the following
+example. Because the @samp{<<example>>} noweb reference appears behind the
+SQL comment syntax, each line of the expanded noweb reference is
+commented. With:
+
+@example
+#+NAME: example
+#+BEGIN_SRC text
+ this is the
+ multi-line body of example
+#+END_SRC
+@end example
+
+@noindent
+this code block:
+
+@example
+#+BEGIN_SRC sql :noweb yes
+ ---<<example>>
+#+END_SRC
+@end example
+
+@noindent
+expands to:
+
+@example
+#+BEGIN_SRC sql :noweb yes
+ ---this is the
+ ---multi-line body of example
+#+END_SRC
+@end example
+
+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:
+
+@example
+#+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
+@end example
+
+@noindent
+this code block:
+
+@example
+#+begin_src python :noweb yes :results output
+ if true:
+ <<if-true>>
+ else:
+ <<if-false>>
+#+end_src
+@end example
+
+@noindent
+expands to:
+
+@example
+if true:
+ print('do things when true')
+else:
+ print('do things when false')
+@end example
+
+When in doubt about the outcome of a source code block expansion, you
+can preview the results with the following command:
+
+@table @asis
+@item @kbd{C-c C-v v} or @kbd{C-c C-v C-v} (@code{org-babel-expand-src-block})
+@findex org-babel-expand-src-block
+@kindex C-c C-v v
+@kindex C-c C-v C-v
+Expand the current source code block according to its header
+arguments and pop open the results in a preview buffer.
+@end table
+
+@node Library of Babel
+@section Library of Babel
+
+@cindex babel, library of
+@cindex source code, library
+@cindex code block, library
+
+The ``Library of Babel'' is a collection of code blocks. Like
+a function library, these code blocks can be called from other Org
+files. A collection of useful code blocks is available on @uref{https://orgmode.org/worg/library-of-babel.html, Worg}. For
+remote code block evaluation syntax, see @ref{Evaluating Code Blocks}.
+
+@kindex C-c C-v i
+@findex org-babel-lob-ingest
+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
+@code{org-babel-lob-ingest}, which is bound to @kbd{C-c C-v i}.
+
+@node Key bindings and Useful Functions
+@section Key bindings and Useful Functions
+
+@cindex code block, key bindings
+
+Many common Org mode key sequences are re-bound depending on
+the context.
+
+Active key bindings in code blocks:
+
+@kindex C-c C-c
+@findex org-babel-execute-src-block
+@kindex C-c C-o
+@findex org-babel-open-src-block-result
+@kindex M-UP
+@findex org-babel-load-in-session
+@kindex M-DOWN
+@findex org-babel-pop-to-session
+@multitable @columnfractions 0.2 0.55
+@headitem Key binding
+@tab Function
+@item @kbd{C-c C-c}
+@tab @code{org-babel-execute-src-block}
+@item @kbd{C-c C-o}
+@tab @code{org-babel-open-src-block-result}
+@item @kbd{M-@key{UP}}
+@tab @code{org-babel-load-in-session}
+@item @kbd{M-@key{DOWN}}
+@tab @code{org-babel-pop-to-session}
+@end multitable
+
+Active key bindings in Org mode buffer:
+
+@kindex C-c C-v p
+@kindex C-c C-v C-p
+@kindex C-c C-v n
+@kindex C-c C-v C-n
+@kindex C-c C-v e
+@kindex C-c C-v C-e
+@kindex C-c C-v o
+@kindex C-c C-v C-o
+@kindex C-c C-v v
+@kindex C-c C-v C-v
+@kindex C-c C-v u
+@kindex C-c C-v C-u
+@kindex C-c C-v g
+@kindex C-c C-v C-g
+@kindex C-c C-v r
+@kindex C-c C-v C-r
+@kindex C-c C-v b
+@kindex C-c C-v C-b
+@kindex C-c C-v s
+@kindex C-c C-v C-s
+@kindex C-c C-v d
+@kindex C-c C-v C-d
+@kindex C-c C-v t
+@kindex C-c C-v C-t
+@kindex C-c C-v f
+@kindex C-c C-v C-f
+@kindex C-c C-v c
+@kindex C-c C-v C-c
+@kindex C-c C-v j
+@kindex C-c C-v C-j
+@kindex C-c C-v l
+@kindex C-c C-v C-l
+@kindex C-c C-v i
+@kindex C-c C-v C-i
+@kindex C-c C-v I
+@kindex C-c C-v C-I
+@kindex C-c C-v z
+@kindex C-c C-v C-z
+@kindex C-c C-v a
+@kindex C-c C-v C-a
+@kindex C-c C-v h
+@kindex C-c C-v C-h
+@kindex C-c C-v x
+@kindex C-c C-v C-x
+@findex org-babel-previous-src-block
+@findex org-babel-next-src-block
+@findex org-babel-execute-maybe
+@findex org-babel-open-src-block-result
+@findex org-babel-expand-src-block
+@findex org-babel-goto-src-block-head
+@findex org-babel-goto-named-src-block
+@findex org-babel-goto-named-result
+@findex org-babel-execute-buffer
+@findex org-babel-execute-subtree
+@findex org-babel-demarcate-block
+@findex org-babel-tangle
+@findex org-babel-tangle-file
+@findex org-babel-check-src-block
+@findex org-babel-insert-header-arg
+@findex org-babel-load-in-session
+@findex org-babel-lob-ingest
+@findex org-babel-view-src-block-info
+@findex org-babel-switch-to-session-with-code
+@findex org-babel-sha1-hash
+@findex org-babel-describe-bindings
+@findex org-babel-do-key-sequence-in-edit-buffer
+@multitable @columnfractions 0.45 0.55
+@headitem Key binding
+@tab Function
+@item @kbd{C-c C-v p} or @kbd{C-c C-v C-p}
+@tab @code{org-babel-previous-src-block}
+@item @kbd{C-c C-v n} or @kbd{C-c C-v C-n}
+@tab @code{org-babel-next-src-block}
+@item @kbd{C-c C-v e} or @kbd{C-c C-v C-e}
+@tab @code{org-babel-execute-maybe}
+@item @kbd{C-c C-v o} or @kbd{C-c C-v C-o}
+@tab @code{org-babel-open-src-block-result}
+@item @kbd{C-c C-v v} or @kbd{C-c C-v C-v}
+@tab @code{org-babel-expand-src-block}
+@item @kbd{C-c C-v u} or @kbd{C-c C-v C-u}
+@tab @code{org-babel-goto-src-block-head}
+@item @kbd{C-c C-v g} or @kbd{C-c C-v C-g}
+@tab @code{org-babel-goto-named-src-block}
+@item @kbd{C-c C-v r} or @kbd{C-c C-v C-r}
+@tab @code{org-babel-goto-named-result}
+@item @kbd{C-c C-v b} or @kbd{C-c C-v C-b}
+@tab @code{org-babel-execute-buffer}
+@item @kbd{C-c C-v s} or @kbd{C-c C-v C-s}
+@tab @code{org-babel-execute-subtree}
+@item @kbd{C-c C-v d} or @kbd{C-c C-v C-d}
+@tab @code{org-babel-demarcate-block}
+@item @kbd{C-c C-v t} or @kbd{C-c C-v C-t}
+@tab @code{org-babel-tangle}
+@item @kbd{C-c C-v f} or @kbd{C-c C-v C-f}
+@tab @code{org-babel-tangle-file}
+@item @kbd{C-c C-v c} or @kbd{C-c C-v C-c}
+@tab @code{org-babel-check-src-block}
+@item @kbd{C-c C-v j} or @kbd{C-c C-v C-j}
+@tab @code{org-babel-insert-header-arg}
+@item @kbd{C-c C-v l} or @kbd{C-c C-v C-l}
+@tab @code{org-babel-load-in-session}
+@item @kbd{C-c C-v i} or @kbd{C-c C-v C-i}
+@tab @code{org-babel-lob-ingest}
+@item @kbd{C-c C-v I} or @kbd{C-c C-v C-I}
+@tab @code{org-babel-view-src-block-info}
+@item @kbd{C-c C-v z} or @kbd{C-c C-v C-z}
+@tab @code{org-babel-switch-to-session-with-code}
+@item @kbd{C-c C-v a} or @kbd{C-c C-v C-a}
+@tab @code{org-babel-sha1-hash}
+@item @kbd{C-c C-v h} or @kbd{C-c C-v C-h}
+@tab @code{org-babel-describe-bindings}
+@item @kbd{C-c C-v x} or @kbd{C-c C-v C-x}
+@tab @code{org-babel-do-key-sequence-in-edit-buffer}
+@end multitable
+
+@node Batch Execution
+@section Batch Execution
+
+@cindex code block, batch execution
+@cindex source code, 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
+@code{org-babel-tangle}.
+
+@example
+#!/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))))
+ " "$@@"
+@end example
+
+@node Miscellaneous
+@chapter Miscellaneous
+
+@menu
+* Completion:: @kbd{M-@key{TAB}} guesses completions.
+* Structure Templates:: Quick insertion of structural elements.
+* Speed Keys:: Electric commands at the beginning of a headline.
+* Clean View:: Getting rid of leading stars in the outline.
+* Execute commands in the active region:: Execute commands on multiple items in Org or agenda view.
+* Dynamic Headline Numbering:: Display and update outline numbering.
+* The Very Busy @kbd{C-c C-c} Key:: When in doubt, press @kbd{C-c C-c}.
+* In-buffer Settings:: Overview of keywords.
+* Regular Expressions:: Elisp regular expressions.
+* Org Syntax:: Formal description of Org's syntax.
+* Documentation Access:: Read documentation about current syntax.
+* Escape Character:: Prevent Org from interpreting your writing.
+* Code Evaluation Security:: Org files evaluate in-line code.
+* Interaction:: With other Emacs packages.
+* TTY Keys:: Using Org on a tty.
+* Protocols:: External access to Emacs and Org.
+* Org Crypt:: Encrypting Org files.
+* Org Mobile:: Viewing and capture on a mobile device.
+@end menu
+
+@node Completion
+@section Completion
+
+@cindex completion, of @TeX{} symbols
+@cindex completion, of TODO keywords
+@cindex completion, of dictionary words
+@cindex completion, of option keywords
+@cindex completion, of tags
+@cindex completion, of property keys
+@cindex completion, of link abbreviations
+@cindex @TeX{} symbol completion
+@cindex TODO keywords completion
+@cindex dictionary word completion
+@cindex option keyword completion
+@cindex tag completion
+@cindex link abbreviations, completion of
+
+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.
+
+@table @asis
+@item @kbd{M-@key{TAB}}
+@kindex M-TAB
+
+Complete word at point.
+
+@itemize
+@item
+At the beginning of an empty headline, complete TODO keywords.
+
+@item
+After @samp{\}, complete @TeX{} symbols supported by the exporter.
+
+@item
+After @samp{:} in a headline, complete tags. Org deduces the list of
+tags from the @samp{TAGS} in-buffer option (see @ref{Setting Tags}), the
+variable @code{org-tag-alist}, or from all tags used in the current
+buffer.
+
+@item
+After @samp{:} and not in a headline, complete property keys. The list
+of keys is constructed dynamically from all keys used in the
+current buffer.
+
+@item
+After @samp{[[}, complete link abbreviations (see @ref{Link Abbreviations}).
+
+@item
+After @samp{[[*}, complete headlines in the current buffer so that they
+can be used in search links like: @samp{[[*find this headline]]}
+
+@item
+After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
+file-specific @samp{OPTIONS}. After option keyword is complete,
+pressing @kbd{M-@key{TAB}} again inserts example settings for this
+keyword.
+
+@item
+After @samp{STARTUP} keyword, complete startup items.
+
+@item
+When point is anywhere else, complete dictionary words using
+Ispell.
+@end itemize
+@end table
+
+@node Structure Templates
+@section Structure Templates
+
+@cindex template insertion
+@cindex insertion, of templates
+
+With just a few keystrokes, it is possible to insert empty structural
+blocks, such as @samp{#+BEGIN_SRC} @dots{} @samp{#+END_SRC}, or to wrap existing
+text in such a block.
+
+@table @asis
+@item @kbd{C-c C-,} (@code{org-insert-structure-template})
+@findex org-insert-structure-template
+@kindex C-c C-,
+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 @kbd{@key{TAB}}, @kbd{@key{RET}},
+or @kbd{@key{SPC}}, the user is prompted to enter a block type.
+@end table
+
+@vindex org-structure-template-alist
+Available structure types are defined in
+@code{org-structure-template-alist}, see the docstring for adding or
+changing values.
+
+@cindex Tempo
+@cindex template expansion
+@cindex insertion, of templates
+@vindex org-tempo-keywords-alist
+Org Tempo expands snippets to structures defined in
+@code{org-structure-template-alist} and @code{org-tempo-keywords-alist}. For
+example, @kbd{< s @key{TAB}} creates a code block. Enable it by
+customizing @code{org-modules} or add @samp{(require 'org-tempo)} to your Emacs
+init file@footnote{For more information, please refer to the commentary section
+in @samp{org-tempo.el}.}.
+
+@multitable @columnfractions 0.1 0.9
+@item @kbd{a}
+@tab @samp{#+BEGIN_EXPORT ascii} @dots{} @samp{#+END_EXPORT}
+@item @kbd{c}
+@tab @samp{#+BEGIN_CENTER} @dots{} @samp{#+END_CENTER}
+@item @kbd{C}
+@tab @samp{#+BEGIN_COMMENT} @dots{} @samp{#+END_COMMENT}
+@item @kbd{e}
+@tab @samp{#+BEGIN_EXAMPLE} @dots{} @samp{#+END_EXAMPLE}
+@item @kbd{E}
+@tab @samp{#+BEGIN_EXPORT} @dots{} @samp{#+END_EXPORT}
+@item @kbd{h}
+@tab @samp{#+BEGIN_EXPORT html} @dots{} @samp{#+END_EXPORT}
+@item @kbd{l}
+@tab @samp{#+BEGIN_EXPORT latex} @dots{} @samp{#+END_EXPORT}
+@item @kbd{q}
+@tab @samp{#+BEGIN_QUOTE} @dots{} @samp{#+END_QUOTE}
+@item @kbd{s}
+@tab @samp{#+BEGIN_SRC} @dots{} @samp{#+END_SRC}
+@item @kbd{v}
+@tab @samp{#+BEGIN_VERSE} @dots{} @samp{#+END_VERSE}
+@end multitable
+
+@node Speed Keys
+@section Speed Keys
+
+@cindex 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.
+
+@vindex org-use-speed-commands
+By default, Org has Speed Keys disabled. To activate Speed Keys, set
+the variable @code{org-use-speed-commands} to a non-@code{nil} value. To
+trigger a Speed Key, point must be at the beginning of an Org
+headline, before any of the stars.
+
+@vindex org-speed-commands
+@findex org-speed-command-help
+Org comes with a pre-defined list of Speed Keys. To add or modify
+Speed Keys, customize the option @code{org-speed-commands}. For more
+details, see the variable's docstring. With Speed Keys activated,
+@kbd{M-x org-speed-command-help}, or @kbd{?} when point is at the
+beginning of an Org headline, shows currently active Speed Keys,
+including the user-defined ones.
+
+@node Clean View
+@section A Cleaner Outline View
+
+@cindex hiding leading stars
+@cindex dynamic indentation
+@cindex odd-levels-only outlines
+@cindex clean outline view
+
+Org's outline with stars and no indents can look cluttered for short
+documents. For @emph{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 displays only one
+star and indents text to line up with the heading:
+
+@example
+* 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
+@end example
+
+Org can achieve this in two ways, (1) by just displaying the buffer in
+this way without changing it, or (2) by actually indenting every line
+in the desired amount with hard spaces and hiding leading stars.
+
+@menu
+* Org Indent Mode::
+* Hard indentation::
+@end menu
+
+@node Org Indent Mode
+@subsection Org Indent Mode
+
+@cindex Indent mode
+@findex org-indent-mode
+To display the buffer in the indented view, activate Org Indent minor
+mode, using @kbd{M-x org-indent-mode}. Text lines that are not
+headlines are prefixed with virtual spaces to vertically align with
+the headline text@footnote{Org Indent mode also sets @code{wrap-prefix} correctly for
+indenting and wrapping long lines of headlines or text. This minor
+mode also handles Visual Line mode and directly applied settings
+through @code{word-wrap}.}.
+
+@vindex org-indent-indentation-per-level
+To make more horizontal space, the headlines are shifted by two
+characters. Configure @code{org-indent-indentation-per-level} variable for
+a different number.
+
+@vindex org-indent-mode-turns-on-hiding-stars
+@vindex org-indent-mode-turns-off-org-adapt-indentation
+By default, Org Indent mode turns off @code{org-adapt-indentation} and does
+hide leading stars by locally setting @code{org-hide-leading-stars} to @code{t}:
+only one star on each headline is visible, the rest are masked with
+the same font color as the background. If you want to customize this
+default behavior, see @code{org-indent-mode-turns-on-hiding-stars} and
+@code{org-indent-mode-turns-off-org-adapt-indentation}.
+
+@vindex org-startup-indented
+To globally turn on Org Indent mode for all files, customize the
+variable @code{org-startup-indented}. To control it for individual files,
+use @samp{STARTUP} keyword as follows:
+
+@example
+#+STARTUP: indent
+#+STARTUP: noindent
+@end example
+
+@node Hard indentation
+@subsection Hard indentation
+
+It is possible to use hard spaces to achieve the indentation instead,
+if the bare ASCII file should have the indented look also outside
+Emacs@footnote{This works, but requires extra effort. Org Indent mode is
+more convenient for most applications.}. With Org's support, you have to indent all lines to
+line up with the outline headers. You would use these
+settings@footnote{@code{org-adapt-indentation} can also be set to @samp{'headline-data},
+in which case only data lines below the headline will be indented.}:
+
+@lisp
+(setq org-adapt-indentation t
+ org-hide-leading-stars t
+ org-odd-levels-only t)
+@end lisp
+
+@table @asis
+@item @emph{Indentation of text below headlines} (@code{org-adapt-indentation})
+@vindex org-adapt-indentation
+The first setting modifies paragraph filling, line wrapping, and
+structure editing commands to preserving or adapting the indentation
+as appropriate.
+
+@item @emph{Hiding leading stars} (@code{org-hide-leading-stars})
+@vindex org-hide-leading-stars
+@vindex org-hide, face
+The second setting makes leading stars invisible by applying the
+face @code{org-hide} to them. For per-file preference, use these file
+@samp{STARTUP} options:
+
+@example
+#+STARTUP: hidestars
+#+STARTUP: showstars
+@end example
+
+@item @emph{Odd levels} (@code{org-odd-levels-only})
+@vindex org-odd-levels-only
+The third setting makes Org use only odd levels, 1, 3, 5, @dots{}, in
+the outline to create more indentation. On a per-file level,
+control this with:
+
+@example
+#+STARTUP: odd
+#+STARTUP: oddeven
+@end example
+
+To convert a file between single and double stars layouts, use
+@kbd{M-x org-convert-to-odd-levels} and @kbd{M-x org-convert-to-oddeven-levels}.
+@end table
+
+@node Execute commands in the active region
+@section Execute commands in the active region
+
+@vindex org-loop-over-headlines-in-active-region
+When in an Org buffer and the region is active, some commands will
+apply to all the subtrees in the active region. For example, hitting
+@kbd{C-c C-s} when multiple headlines are within the active region will
+successively prompt you for a new schedule date and time. To disable
+this, set the option @code{org-loop-over-headlines-in-active-region} to
+non-@code{t}, activate the region and run the command normally.
+
+@vindex org-agenda-loop-over-headlines-in-active-region
+@code{org-agenda-loop-over-headlines-in-active-region} is the equivalent
+option of the agenda buffer, where you can also use @ref{Bulk remote editing selected entries, , bulk editing of
+selected entries}.
+
+Not all commands can loop in the active region and what subtrees or
+headlines are considered can be refined: see the docstrings of these
+options for more details.
+
+@node Dynamic Headline Numbering
+@section Dynamic Headline Numbering
+
+@cindex Org Num mode
+@cindex number headlines
+The Org Num minor mode, toggled with @kbd{M-x org-num-mode},
+displays outline numbering on top of headlines. It also updates it
+automatically upon changes to the structure of the document.
+
+@vindex org-num-max-level
+@vindex org-num-skip-tags
+@vindex org-num-skip-commented
+@vindex org-num-skip-unnumbered
+By default, all headlines are numbered. You can limit numbering to
+specific headlines according to their level, tags, @samp{COMMENT} keyword,
+or @samp{UNNUMBERED} property. Set @code{org-num-max-level},
+@code{org-num-skip-tags}, @code{org-num-skip-commented},
+@code{org-num-skip-unnumbered}, or @code{org-num-skip-footnotes} accordingly.
+
+@vindex org-num-skip-footnotes
+If @code{org-num-skip-footnotes} is non-@code{nil}, footnotes sections (see
+@ref{Creating Footnotes}) are not numbered either.
+
+@vindex org-num-face
+@vindex org-num-format-function
+You can control how the numbering is displayed by setting
+@code{org-num-face} and @code{org-num-format-function}.
+
+@vindex org-startup-numerated
+You can also turn this mode globally for all Org files by setting the
+option @code{org-startup-numerated} to @samp{t}, or locally on a file by using
+@samp{#+startup: num}.
+
+@node The Very Busy @kbd{C-c C-c} Key
+@section The Very Busy @kbd{C-c C-c} Key
+
+@kindex C-c C-c
+@cindex @kbd{C-c C-c}, overview
+
+The @kbd{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.
+
+@itemize
+@item
+If column view (see @ref{Column View}) is on, exit column view.
+
+@item
+If any highlights shown in the buffer from the creation of a sparse
+tree, or from clock display, remove such highlights.
+
+@item
+If point is in one of the special @samp{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 @samp{SETUPFILE}.
+
+@item
+If point is inside a table, realign the table.
+
+@item
+If point is on a @samp{TBLFM} keyword, re-apply the formulas to the
+entire table.
+
+@item
+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.
+
+@item
+If point is on a @samp{<<<target>>>}, update radio targets and
+corresponding links in this buffer.
+
+@item
+If point is on a property line or at the start or end of a property
+drawer, offer property commands.
+
+@item
+If point is at a footnote reference, go to the corresponding
+definition, and @emph{vice versa}.
+
+@item
+If point is on a statistics cookie, update it.
+
+@item
+If point is in a plain list item with a checkbox, toggle the status
+of the checkbox.
+
+@item
+If point is on a numbered item in a plain list, renumber the ordered
+list.
+
+@item
+If point is on the @samp{#+BEGIN} line of a dynamic block, the block is
+updated.
+
+@item
+If point is at a timestamp, fix the day name in the timestamp.
+@end itemize
+
+@node In-buffer Settings
+@section Summary of In-Buffer Settings
+
+@cindex in-buffer settings
+@cindex special keywords
+
+In-buffer settings start with @samp{#+}, 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.
+
+@cindex refresh set-up
+@kbd{C-c C-c} activates any changes to the in-buffer settings.
+Closing and reopening the Org file in Emacs also activates the
+changes.
+
+@table @asis
+@item @samp{#+ARCHIVE: %s_done::}
+@cindex @samp{ARCHIVE}, keyword
+@vindex org-archive-location
+Sets the archive location of the agenda file. The corresponding
+variable is @code{org-archive-location}.
+
+@item @samp{#+CATEGORY}
+@cindex @samp{CATEGORY}, keyword
+Sets the category of the agenda file, which applies to the entire
+document.
+
+@item @samp{#+COLUMNS: %25ITEM ...}
+@cindex @samp{COLUMNS}, property
+Set the default format for columns view. This format applies when
+columns view is invoked in locations where no @samp{COLUMNS} property
+applies.
+
+@item @samp{#+CONSTANTS: name1=value1 ...}
+@cindex @samp{CONSTANTS}, keyword
+@vindex org-table-formula-constants
+@vindex org-table-formula
+Set file-local values for constants that table formulas can use.
+This line sets the local variable
+@code{org-table-formula-constants-local}. The global version of this
+variable is @code{org-table-formula-constants}.
+
+@item @samp{#+FILETAGS: :tag1:tag2:tag3:}
+@cindex @samp{FILETAGS}, keyword
+Set tags that all entries in the file inherit from, including the
+top-level entries.
+
+@item @samp{#+LINK: linkword replace}
+@cindex @samp{LINK}, keyword
+@vindex org-link-abbrev-alist
+Each line specifies one abbreviation for one link. Use multiple
+@samp{LINK} keywords for more, see @ref{Link Abbreviations}. The
+corresponding variable is @code{org-link-abbrev-alist}.
+
+@item @samp{#+PRIORITIES: highest lowest default}
+@cindex @samp{PRIORITIES}, keyword
+@vindex org-priority-highest
+@vindex org-priority-lowest
+@vindex org-priority-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.
+
+@item @samp{#+PROPERTY: Property_Name Value}
+@cindex @samp{PROPERTY}, keyword
+This line sets a default inheritance value for entries in the
+current buffer, most useful for specifying the allowed values of
+a property.
+
+@item @samp{#+SETUPFILE: file}
+@cindex @samp{SETUPFILE}, keyword
+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. @kbd{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 @kbd{C-c '} while point is on the line with the
+file name.
+
+@item @samp{#+STARTUP:}
+@cindex @samp{STARTUP}, keyword
+Startup options Org uses when first visiting a file.
+
+@vindex org-startup-folded
+The first set of options deals with the initial visibility of the
+outline tree. The corresponding variable for global default
+settings is @code{org-startup-folded} with a default value of
+@code{showeverything}.
+
+@multitable {aaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{overview}
+@tab Top-level headlines only.
+@item @samp{content}
+@tab All headlines.
+@item @samp{showall}
+@tab No folding on any entry.
+@item @samp{show2levels}
+@tab Headline levels 1-2.
+@item @samp{show3levels}
+@tab Headline levels 1-3.
+@item @samp{show4levels}
+@tab Headline levels 1-4.
+@item @samp{show5levels}
+@tab Headline levels 1-5.
+@item @samp{showeverything}
+@tab Show even drawer contents.
+@end multitable
+
+@vindex org-startup-indented
+Dynamic virtual indentation is controlled by the variable
+@code{org-startup-indented}@footnote{Note that Org Indent mode also sets the @code{wrap-prefix}
+property, such that Visual Line mode (or purely setting @code{word-wrap})
+wraps long lines, including headlines, correctly indented.}.
+
+@multitable {aaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{indent}
+@tab Start with Org Indent mode turned on.
+@item @samp{noindent}
+@tab Start with Org Indent mode turned off.
+@end multitable
+
+@vindex org-startup-numerated
+Dynamic virtual numeration of headlines is controlled by the variable
+@code{org-startup-numerated}.
+
+@multitable {aaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{num}
+@tab Start with Org num mode turned on.
+@item @samp{nonum}
+@tab Start with Org num mode turned off.
+@end multitable
+
+@vindex org-startup-align-all-tables
+Aligns tables consistently upon visiting a file. The
+corresponding variable is @code{org-startup-align-all-tables} with
+@code{nil} as default value.
+
+@multitable {aaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{align}
+@tab Align all tables.
+@item @samp{noalign}
+@tab Do not align tables on startup.
+@end multitable
+
+@vindex org-startup-shrink-all-tables
+Shrink table columns with a width cookie. The corresponding
+variable is @code{org-startup-shrink-all-tables} with @code{nil} as
+default value.
+
+@vindex org-startup-with-inline-images
+When visiting a file, inline images can be automatically
+displayed. The corresponding variable is
+@code{org-startup-with-inline-images}, with a default value @code{nil} to
+avoid delays when visiting a file.
+
+@multitable {aaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{inlineimages}
+@tab Show inline images.
+@item @samp{noinlineimages}
+@tab Do not show inline images on startup.
+@end multitable
+
+@vindex org-log-done
+@vindex org-log-note-clock-out
+@vindex org-log-repeat
+Logging the closing and reopening of TODO items and clock
+intervals can be configured using these options (see variables
+@code{org-log-done}, @code{org-log-note-clock-out}, and @code{org-log-repeat}).
+
+@multitable {aaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{logdone}
+@tab Record a timestamp when an item is marked as done.
+@item @samp{lognotedone}
+@tab Record timestamp and a note when DONE@.
+@item @samp{nologdone}
+@tab Do not record when items are marked as done.
+@item @samp{logrepeat}
+@tab Record a time when reinstating a repeating item.
+@item @samp{lognoterepeat}
+@tab Record a note when reinstating a repeating item.
+@item @samp{nologrepeat}
+@tab Do not record when reinstating repeating item.
+@item @samp{lognoteclock-out}
+@tab Record a note when clocking out.
+@item @samp{nolognoteclock-out}
+@tab Do not record a note when clocking out.
+@item @samp{logreschedule}
+@tab Record a timestamp when scheduling time changes.
+@item @samp{lognotereschedule}
+@tab Record a note when scheduling time changes.
+@item @samp{nologreschedule}
+@tab Do not record when a scheduling date changes.
+@item @samp{logredeadline}
+@tab Record a timestamp when deadline changes.
+@item @samp{lognoteredeadline}
+@tab Record a note when deadline changes.
+@item @samp{nologredeadline}
+@tab Do not record when a deadline date changes.
+@item @samp{logrefile}
+@tab Record a timestamp when refiling.
+@item @samp{lognoterefile}
+@tab Record a note when refiling.
+@item @samp{nologrefile}
+@tab Do not record when refiling.
+@end multitable
+
+@vindex org-hide-leading-stars
+@vindex org-odd-levels-only
+Here are the options for hiding leading stars in outline
+headings, and for indenting outlines. The corresponding
+variables are @code{org-hide-leading-stars} and
+@code{org-odd-levels-only}, both with a default setting @code{nil}
+(meaning @samp{showstars} and @samp{oddeven}).
+
+@multitable {aaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{hidestars}
+@tab Make all but one of the stars starting a headline invisible.
+@item @samp{showstars}
+@tab Show all stars starting a headline.
+@item @samp{indent}
+@tab Virtual indentation according to outline level.
+@item @samp{noindent}
+@tab No virtual indentation according to outline level.
+@item @samp{odd}
+@tab Allow only odd outline levels (1, 3, @dots{}).
+@item @samp{oddeven}
+@tab Allow all outline levels.
+@end multitable
+
+@vindex org-put-time-stamp-overlays
+@vindex org-time-stamp-overlay-formats
+To turn on custom format overlays over timestamps (variables
+@code{org-put-time-stamp-overlays} and
+@code{org-time-stamp-overlay-formats}), use:
+
+@multitable {aaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{customtime}
+@tab Overlay custom time format.
+@end multitable
+
+@vindex constants-unit-system
+The following options influence the table spreadsheet (variable
+@code{constants-unit-system}).
+
+@multitable {aaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{constcgs}
+@tab @samp{constants.el} should use the c-g-s unit system.
+@item @samp{constSI}
+@tab @samp{constants.el} should use the SI unit system.
+@end multitable
+
+@vindex org-footnote-define-inline
+@vindex org-footnote-auto-label
+@vindex org-footnote-auto-adjust
+To influence footnote settings, use the following keywords. The
+corresponding variables are @code{org-footnote-define-inline},
+@code{org-footnote-auto-label}, and @code{org-footnote-auto-adjust}.
+
+@multitable {aaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{fninline}
+@tab Define footnotes inline.
+@item @samp{fnnoinline}
+@tab Define footnotes in separate section.
+@item @samp{fnlocal}
+@tab Define footnotes near first reference, but not inline.
+@item @samp{fnprompt}
+@tab Prompt for footnote labels.
+@item @samp{fnauto}
+@tab Create @samp{[fn:1]}-like labels automatically (default).
+@item @samp{fnconfirm}
+@tab Offer automatic label for editing or confirmation.
+@item @samp{fnadjust}
+@tab Automatically renumber and sort footnotes.
+@item @samp{nofnadjust}
+@tab Do not renumber and sort automatically.
+@end multitable
+
+@vindex org-hide-block-startup
+To hide blocks on startup, use these keywords. The
+corresponding variable is @code{org-hide-block-startup}.
+
+@multitable {aaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{hideblocks}
+@tab Hide all begin/end blocks on startup.
+@item @samp{nohideblocks}
+@tab Do not hide blocks on startup.
+@end multitable
+
+@vindex org-pretty-entities
+The display of entities as UTF-8 characters is governed by the
+variable @code{org-pretty-entities} and the keywords
+
+@multitable {aaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{entitiespretty}
+@tab Show entities as UTF-8 characters where possible.
+@item @samp{entitiesplain}
+@tab Leave entities plain.
+@end multitable
+
+@item @samp{#+TAGS: TAG1(c1) TAG2(c2)}
+@cindex @samp{TAGS}, keyword
+@vindex org-tag-alist
+These lines (several such lines are allowed) specify the valid tags
+in this file, and (potentially) the corresponding @emph{fast tag
+selection} keys. The corresponding variable is @code{org-tag-alist}.
+
+@item @samp{#+TODO:}
+@itemx @samp{#+SEQ_TODO:}
+@itemx @samp{#+TYP_TODO:}
+@cindex @samp{SEQ_TODO}, keyword
+@cindex @samp{TODO}, keyword
+@cindex @samp{TYP_TODO}, keyword
+@vindex org-todo-keywords
+These lines set the TODO keywords and their interpretation in the
+current file. The corresponding variable is @code{org-todo-keywords}.
+@end table
+
+@node Regular Expressions
+@section Regular Expressions
+
+@cindex regular expressions syntax
+@cindex regular expressions, in searches
+
+Org, as an Emacs mode, makes use of Elisp regular expressions for
+searching, matching and filtering. Elisp regular expressions have a
+somewhat different syntax then some common standards. Most notably,
+alternation is indicated using @samp{\|} and matching groups are denoted by
+@samp{\(...\)}. For example the string @samp{home\|work} matches either @samp{home}
+or @samp{work}.
+
+For more information, see @ref{Regexps,Regular Expressions in Emacs,,emacs,}.
+
+@node Org Syntax
+@section Org Syntax
+
+A reference document providing a formal description of Org's syntax is
+available as @uref{https://orgmode.org/worg/dev/org-syntax.html, a draft on Worg}, written and maintained by Nicolas
+Goaziou. It defines Org's core internal concepts such as ``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:
+
+@example
+M-: (org-element-parse-buffer) <RET>
+@end example
+
+
+@noindent
+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.
+
+@cindex syntax checker
+@cindex linter
+@findex org-lint
+You can probe the syntax of your documents with the command
+
+@example
+M-x org-lint <RET>
+@end example
+
+
+@noindent
+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:
+
+@multitable @columnfractions 0.22 0.78
+@item @kbd{C-j}, @kbd{@key{TAB}}
+@tab Display the offending line
+@item @kbd{@key{RET}}
+@tab Move point to the offending line
+@item @kbd{g}
+@tab Check the document again
+@item @kbd{h}
+@tab Hide all reports from the same checker
+@item @kbd{i}
+@tab Also remove them from all subsequent checks
+@item @kbd{S}
+@tab Sort reports by the column at point
+@end multitable
+
+@node Documentation Access
+@section Context Dependent Documentation
+
+@cindex documentation
+@cindex Info
+
+@findex org-info-find-node
+@kindex C-c C-x I
+@kbd{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.
+
+@kbd{q} closes the Info window.
+
+@node Escape Character
+@section Escape Character
+
+@cindex escape character
+@cindex zero width space
+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, i.e., a backslash in macros (see @ref{Macro Replacement}) and links (see @ref{Link Format}), or a comma in source and
+example blocks (see @ref{Literal Examples}). In the general case, however,
+we suggest to use the zero width space. You can insert one with any
+of the following:
+
+@example
+C-x 8 <RET> zero width space <RET>
+C-x 8 <RET> 200B <RET>
+@end example
+
+
+For example, in order to write @samp{[[1,2]]} as-is in your document, you
+may write instead
+
+@example
+[X[1,2]]
+@end example
+
+
+where @samp{X} denotes the zero width space character.
+
+@node Code Evaluation Security
+@section 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:
+
+@table @asis
+@item @emph{Source code blocks}
+Org evaluates source code blocks in an Org file during export. Org
+also evaluates a source code block with the @kbd{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.
+
+@defopt org-confirm-babel-evaluate
+When @code{t}, Org prompts the user for confirmation before executing
+each code block. When @code{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 @code{t} or @code{nil}, which
+determines if the user is prompted. Each source code language can
+be handled separately through this function argument.
+@end defopt
+
+For example, here is how to execute ditaa code blocks without
+prompting:
+
+@lisp
+(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)
+@end lisp
+
+@item @emph{Following @samp{shell} and @samp{elisp} links}
+Org has two link types that can directly evaluate code (see
+@ref{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:
+
+@defopt org-link-shell-confirm-function
+Function that prompts the user before executing a shell link.
+@end defopt
+
+@defopt org-link-elisp-confirm-function
+Function that prompts the user before executing an Emacs Lisp link.
+@end defopt
+
+@item @emph{Formulas in tables}
+Formulas in tables (see @ref{The Spreadsheet}) are code that is evaluated
+either by the Calc interpreter, or by the Emacs Lisp interpreter.
+@end table
+
+@node Interaction
+@section Interaction with Other Packages
+
+@cindex packages, interaction with other
+
+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.
+@end menu
+
+@node Cooperation
+@subsection Packages that Org cooperates with
+
+@table @asis
+@item @samp{calc.el} by Dave Gillespie
+@cindex @file{calc.el}
+
+Org uses the Calc package for implementing spreadsheet functionality
+in its tables (see @ref{The Spreadsheet}). Org also uses Calc for
+embedded calculations. See @ref{Embedded Mode,GNU Emacs Calc Manual,,calc,}.
+
+@item @samp{constants.el} by Carsten Dominik
+@cindex @file{constants.el}
+@vindex org-table-formula-constants
+
+Org can use names for constants in formulas in tables. Org can also
+use calculation suffixes for units, such as @samp{M} for @samp{Mega}. For
+a standard collection of such constants, install the @samp{constants}
+package. Install version 2.0 of this package, available at
+@uref{http://www.astro.uva.nl/~dominik/Tools}. Org checks if the function
+@code{constants-get} has been autoloaded. Installation instructions are
+in the file @samp{constants.el}.
+
+@item @samp{cdlatex.el} by Carsten Dominik
+@cindex @file{cdlatex.el}
+
+Org mode can make use of the CD@LaTeX{} package to efficiently enter
+@LaTeX{} fragments into Org files. See @ref{CD@LaTeX{} mode}.
+
+@item @samp{imenu.el} by Ake Stenhoff and Lars Lindberg
+@cindex @file{imenu.el}
+
+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:
+
+@lisp
+(add-hook 'org-mode-hook
+ (lambda () (imenu-add-to-menubar "Imenu")))
+@end lisp
+
+@vindex org-imenu-depth
+By default the index is two levels deep---you can modify the
+depth using the option @code{org-imenu-depth}.
+
+@item @samp{speedbar.el} by Eric@tie{}M@.@tie{}Ludlam
+@cindex @file{speedbar.el}
+
+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 @kbd{<}
+in the Speedbar frame tweaks the agenda commands to that file or to
+a subtree.
+
+@item @samp{table.el} by Takaaki Ota
+@cindex table editor, @file{table.el}
+@cindex @file{table.el}
+
+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. @kbd{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.
+
+@table @asis
+@item @kbd{C-c '} (@code{org-edit-special})
+@kindex C-c '
+@findex org-edit-special
+Edit a @samp{table.el} table. Works when point is in a @samp{table.el}
+table.
+
+@item @kbd{C-c ~​} (@code{org-table-create-with-table.el})
+@kindex C-c ~
+@findex org-table-create-with-table.el
+Insert a @samp{table.el} table. If there is already a table at point,
+this command converts it between the @samp{table.el} format and the Org
+mode format. See the documentation string of the command
+@code{org-convert-table} for the restrictions under which this is
+possible.
+@end table
+@end table
+
+@node Conflicts
+@subsection Packages that conflict with Org mode
+
+@cindex shift-selection
+@vindex org-support-shift-select
+In Emacs, shift-selection combines motions of point with shift key to
+enlarge regions. Emacs sets this mode by default. This conflicts
+with Org's use of @kbd{S-<cursor>} commands to change timestamps,
+TODO keywords, priorities, and item bullet types, etc. Since
+@kbd{S-<cursor>} commands outside of specific contexts do not do
+anything, Org offers the variable @code{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.
+
+@table @asis
+@item @samp{cua.el} by Kim@tie{}F@.@tie{}Storm
+@cindex @file{cua.el}
+@vindex org-replace-disputed-keys
+Org key bindings conflict with @kbd{S-<cursor>} keys used by
+CUA mode. For Org to relinquish these bindings to CUA mode,
+configure the variable @code{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.
+
+@multitable @columnfractions 0.4 0.4
+@item @kbd{S-@key{UP}} @result{} @kbd{M-p}
+@tab @kbd{S-@key{DOWN}} @result{} @kbd{M-n}
+@item @kbd{S-@key{LEFT}} @result{} @kbd{M--}
+@tab @kbd{S-@key{RIGHT}} @result{} @kbd{M-+}
+@item @kbd{C-S-@key{LEFT}} @result{} @kbd{M-S--}
+@tab @kbd{C-S-@key{RIGHT}} @result{} @kbd{M-S-+}
+@end multitable
+
+@vindex org-disputed-keys
+Yes, these are unfortunately more difficult to remember. If you
+want to have other replacement keys, look at the variable
+@code{org-disputed-keys}.
+
+@item @samp{ecomplete.el} by Lars Magne Ingebrigtsen
+@cindex @file{ecomplete.el}
+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 @emph{not} follow the advice to automagically
+turn on Orgtbl mode in message buffers (see @ref{Orgtbl Mode}),
+but instead---after filling in the message headers---turn on Orgtbl
+mode manually when needed in the messages body.
+
+@item @samp{filladapt.el} by Kyle Jones
+@cindex @file{filladapt.el}
+Org mode tries to do the right thing when filling paragraphs, list
+items and other elements. Many users reported problems using both
+@samp{filladapt.el} and Org mode, so a safe thing to do is to disable
+filladapt like this:
+
+@lisp
+(add-hook 'org-mode-hook 'turn-off-filladapt-mode)
+@end lisp
+
+@item @samp{viper.el} by Michael Kifer
+@cindex @file{viper.el}
+@kindex C-c /
+
+Viper uses @kbd{C-c /} and therefore makes this key not access
+the corresponding Org mode command @code{org-sparse-tree}. You need to
+find another key for this command, or override the key in
+@code{viper-vi-global-user-map} with
+
+@lisp
+(define-key viper-vi-global-user-map "C-c /" 'org-sparse-tree)
+@end lisp
+
+@item @samp{windmove.el} by Hovav Shacham
+@cindex @file{windmove.el}
+
+This package also uses the @kbd{S-<cursor>} 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 @kbd{S-<cursor>},
+add this to your configuration:
+
+@lisp
+;; 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)
+@end lisp
+
+@item @samp{yasnippet.el}
+@cindex @file{yasnippet.el}
+The way Org mode binds the @kbd{@key{TAB}} key (binding to @code{[tab]}
+instead of @code{"\t"}) overrules YASnippet's access to this key. The
+following code fixed this problem:
+
+@lisp
+(add-hook 'org-mode-hook
+ (lambda ()
+ (setq-local yas/trigger-key [tab])
+ (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand)))
+@end lisp
+
+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:
+
+@lisp
+(defun yas/org-very-safe-expand ()
+ (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
+@end lisp
+
+Then, tell Org mode to use that function:
+
+@lisp
+(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)))
+@end lisp
+@end table
+
+@node TTY Keys
+@section Using Org on a TTY
+
+@cindex tty key bindings
+
+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
+@kbd{S-<cursor>} for editing timestamp might be better with
+@kbd{C-c .} chord.
+
+@multitable @columnfractions 0.2 0.28 0.15 0.21
+@headitem Default
+@tab Alternative 1
+@tab Speed key
+@tab Alternative 2
+@item @kbd{S-@key{TAB}}
+@tab @kbd{C-u @key{TAB}}
+@tab @kbd{C}
+@tab
+@item @kbd{M-@key{LEFT}}
+@tab @kbd{C-c C-x l}
+@tab @kbd{l}
+@tab @kbd{Esc @key{LEFT}}
+@item @kbd{M-S-@key{LEFT}}
+@tab @kbd{C-c C-x L}
+@tab @kbd{L}
+@tab
+@item @kbd{M-@key{RIGHT}}
+@tab @kbd{C-c C-x r}
+@tab @kbd{r}
+@tab @kbd{Esc @key{RIGHT}}
+@item @kbd{M-S-@key{RIGHT}}
+@tab @kbd{C-c C-x R}
+@tab @kbd{R}
+@tab
+@item @kbd{M-@key{UP}}
+@tab @kbd{C-c C-x u}
+@tab
+@tab @kbd{Esc @key{UP}}
+@item @kbd{M-S-@key{UP}}
+@tab @kbd{C-c C-x U}
+@tab @kbd{U}
+@tab
+@item @kbd{M-@key{DOWN}}
+@tab @kbd{C-c C-x d}
+@tab
+@tab @kbd{Esc @key{DOWN}}
+@item @kbd{M-S-@key{DOWN}}
+@tab @kbd{C-c C-x D}
+@tab @kbd{D}
+@tab
+@item @kbd{S-@key{RET}}
+@tab @kbd{C-c C-x c}
+@tab
+@tab
+@item @kbd{M-@key{RET}}
+@tab @kbd{C-c C-x m}
+@tab
+@tab @kbd{Esc @key{RET}}
+@item @kbd{M-S-@key{RET}}
+@tab @kbd{C-c C-x M}
+@tab
+@tab
+@item @kbd{S-@key{LEFT}}
+@tab @kbd{C-c @key{LEFT}}
+@tab
+@tab
+@item @kbd{S-@key{RIGHT}}
+@tab @kbd{C-c @key{RIGHT}}
+@tab
+@tab
+@item @kbd{S-@key{UP}}
+@tab @kbd{C-c @key{UP}}
+@tab
+@tab
+@item @kbd{S-@key{DOWN}}
+@tab @kbd{C-c @key{DOWN}}
+@tab
+@tab
+@item @kbd{C-S-@key{LEFT}}
+@tab @kbd{C-c C-x @key{LEFT}}
+@tab
+@tab
+@item @kbd{C-S-@key{RIGHT}}
+@tab @kbd{C-c C-x @key{RIGHT}}
+@tab
+@tab
+@end multitable
+
+@node Protocols
+@section Protocols for External Access
+
+@cindex protocols, for external access
+
+Org protocol is a tool 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 @ref{Capture}). You can also create a bookmark that tells
+Emacs to open the local source file of a remote website you are
+browsing.
+
+@cindex Org protocol, set-up
+@cindex Installing Org protocol
+In order to use Org protocol from an application, you need to register
+@samp{org-protocol://} as a valid scheme-handler. External calls are
+passed to Emacs through the @samp{emacsclient} command, so you also need to
+ensure an Emacs server is running. More precisely, when the
+application calls
+
+@example
+emacsclient "org-protocol://PROTOCOL?key1=val1&key2=val2"
+@end example
+
+
+@noindent
+Emacs calls the handler associated to @var{PROTOCOL} with
+argument @samp{(:key1 val1 :key2 val2)}.
+
+@cindex protocol, new protocol
+@cindex defining new protocols
+Org protocol comes with three predefined protocols, detailed in the
+following sections. Configure @code{org-protocol-protocol-alist} to define
+your own.
+
+@menu
+* The @code{store-link} protocol:: Store a link, push URL to kill-ring.
+* The @code{capture} protocol:: Fill a buffer with external information.
+* The @code{open-source} protocol:: Edit published contents.
+@end menu
+
+@node The @code{store-link} protocol
+@subsection The @code{store-link} protocol
+
+@cindex store-link protocol
+@cindex protocol, store-link
+
+Using the @code{store-link} handler, you can copy links, to that they can
+be inserted using @kbd{M-x org-insert-link} or yanking. More
+precisely, the command
+
+@example
+emacsclient "org-protocol://store-link?url=URL&title=TITLE"
+@end example
+
+
+@noindent
+stores the following link:
+
+@example
+[[URL][TITLE]]
+@end example
+
+
+In addition, @var{URL} is pushed on the kill-ring for yanking.
+You need to encode @var{URL} and @var{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., @samp{Org: store-link} and enter this as @emph{Location}:
+
+@example
+javascript:location.href='org-protocol://store-link?' +
+ new URLSearchParams(@{url:location.href, title:document.title@});
+@end example
+
+Title is an optional parameter. Another expression was recommended earlier:
+
+@example
+javascript:location.href='org-protocol://store-link?url='+
+ encodeURIComponent(location.href);
+@end example
+
+The latter form is compatible with older Org versions from 9.0 to 9.4.
+
+@node The @code{capture} protocol
+@subsection The @code{capture} protocol
+
+@cindex capture protocol
+@cindex protocol, capture
+
+Activating the ``capture'' handler pops up a @samp{Capture} buffer in Emacs,
+using acapture template.
+
+@example
+emacsclient "org-protocol://capture?template=X&url=URL&title=TITLE&body=BODY"
+@end example
+
+
+To use this feature, add a bookmark with an arbitrary name, e.g.,
+@samp{Org: capture}, and enter this as @samp{Location}:
+
+@example
+javascript:location.href='org-protocol://capture?' +
+ new URLSearchParams(@{
+ template: 'x', url: window.location.href,
+ title: document.title, body: window.getSelection()@});
+@end example
+
+You might have seen another expression:
+
+@example
+javascript:location.href='org-protocol://capture?template=x'+
+ '&url='+encodeURIComponent(window.location.href)+
+ '&title='+encodeURIComponent(document.title)+
+ '&body='+encodeURIComponent(window.getSelection());
+@end example
+
+It is a bit more cluttered than the former one, but it is compatible
+with previous Org versions 9.0-9.4. In these versions encoding of
+space as ``+'' character was not supported by URI decoder.
+
+@vindex org-protocol-default-template-key
+The capture template to be used can be specified in the bookmark (like
+@samp{X} above). If unspecified, the template key is set in the variable
+@code{org-protocol-default-template-key}. The following template
+placeholders are available:
+
+@example
+%:link The URL
+%:description The webpage title
+%:annotation Equivalent to [[%:link][%:description]]
+%i The selected text
+@end example
+
+@node The @code{open-source} protocol
+@subsection The @code{open-source} protocol
+
+@cindex open-source protocol
+@cindex protocol, open-source
+
+The @code{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:
+
+@example
+javascript:location.href='org-protocol://open-source?&url='+
+ encodeURIComponent(location.href)
+@end example
+
+@vindex org-protocol-project-alist
+The variable @code{org-protocol-project-alist} maps URLs to local file
+names, by stripping URL parameters from the end and replacing the
+@code{:base-url} with @code{:working-directory} and @code{:online-suffix} with
+@code{:working-suffix}. For example, assuming you own a local copy of
+@samp{https://orgmode.org/worg/} contents at @samp{/home/user/worg}, you can set
+@code{org-protocol-project-alist} to the following
+
+@lisp
+(setq org-protocol-project-alist
+ '(("Worg"
+ :base-url "https://orgmode.org/worg/"
+ :working-directory "/home/user/worg/"
+ :online-suffix ".html"
+ :working-suffix ".org")))
+@end lisp
+
+@noindent
+If you are now browsing
+@samp{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.
+
+@cindex rewritten URL in open-source protocol
+@cindex protocol, open-source rewritten URL
+However, such mapping may not always yield the desired results.
+Suppose you maintain an online store located at @samp{https://example.com/}.
+The local sources reside in @samp{/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 @samp{https://example.com/print/posters.html} might be
+rewritten on the server to something like
+@samp{https://example.com/shop/products.php/posters.html.php}. The
+@code{open-source} handler probably cannot find a file named
+@samp{/home/user/example/print/posters.html.php} and fails.
+
+Such an entry in @code{org-protocol-project-alist} may hold an additional
+property @code{:rewrites}. This property is a list of cons cells, each of
+which maps a regular expression to a path relative to the
+@code{:working-directory}.
+
+Now map the URL to the path @samp{/home/user/example/products.php} by
+adding @code{:rewrites} rules like this:
+
+@lisp
+(setq org-protocol-project-alist
+ '(("example.com"
+ :base-url "https://example.com/"
+ :working-directory "/home/user/example/"
+ :online-suffix ".php"
+ :working-suffix ".php"
+ :rewrites (("example.com/print/" . "products.php")
+ ("example.com/$" . "index.php")))))
+@end lisp
+
+@noindent
+Since @samp{example.com/$} is used as a regular expression, it maps
+@samp{http://example.com/}, @samp{https://example.com},
+@samp{http://www.example.com/} and similar to
+@samp{/home/user/example/index.php}.
+
+The @code{:rewrites} rules are searched as a last resort if and only if no
+existing file name is matched.
+
+@cindex protocol, open-source, set-up mapping
+@cindex mappings in open-source protocol
+@findex org-protocol-create
+@findex org-protocol-create-for-org
+Two functions can help you filling @code{org-protocol-project-alist} with
+valid contents: @code{org-protocol-create} and
+@code{org-protocol-create-for-org}. The latter is of use if you're editing
+an Org file that is part of a publishing project.
+
+@node Org Crypt
+@section Org Crypt
+
+Org Crypt encrypts the text of an entry, but not the headline, or
+properties. Behind the scene, it uses the @ref{Top,Emacs EasyPG Library,,epa,} to
+encrypt and decrypt files, and EasyPG needs a correct @ref{Top,GnuPG,,gnupg,} setup.
+
+@vindex org-crypt-tag-matcher
+Any text below a headline that has a @samp{crypt} tag is automatically
+encrypted when the file is saved. To use a different tag, customize
+the @code{org-crypt-tag-matcher} setting.
+
+Here is a suggestion for Org Crypt settings in Emacs init file:
+
+@lisp
+(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; -*-
+@end lisp
+
+It's possible to use different keys for different headings by
+specifying the respective key as property @samp{CRYPTKEY}, e.g.:
+
+@example
+* Totally secret :crypt:
+ :PROPERTIES:
+ :CRYPTKEY: 0x0123456789012345678901234567890123456789
+ :END:
+@end example
+
+Excluding the @samp{crypt} tag from inheritance prevents already encrypted
+text from being encrypted again.
+
+@node Org Mobile
+@section Org Mobile
+
+@cindex smartphone
+
+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 @code{org-todo-keywords}, @code{org-tag-alist} and
+@code{org-tag-persistent-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 @emph{sets} (see @ref{Per-file keywords}) and @emph{mutually exclusive} tags (see @ref{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.
+@end menu
+
+@node Setting up the staging area
+@subsection Setting up the staging area
+
+@vindex org-mobile-directory
+The mobile application needs access to a file directory on
+a server@footnote{For a server to host files, consider using a WebDAV server,
+such as @uref{https://nextcloud.com, Nextcloud}. Additional help is at this @uref{https://orgmode.org/worg/org-faq.html#mobileorg_webdav, FAQ entry}.} to interact with Emacs. Pass its location through
+the @code{org-mobile-directory} variable. If you can mount that directory
+locally just set the variable to point to that directory:
+
+@lisp
+(setq org-mobile-directory "~/orgmobile/")
+@end lisp
+
+Alternatively, by using TRAMP (see @ref{Top,TRAMP User Manual,,tramp,}),
+@code{org-mobile-directory} may point to a remote directory accessible
+through, for example, SSH, SCP, or DAVS:
+
+@lisp
+(setq org-mobile-directory "/davs:user@@remote.host:/org/webdav/")
+@end lisp
+
+@vindex org-mobile-encryption
+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
+@code{org-mobile-use-encryption}@footnote{If Emacs is configured for safe storing of passwords, then
+configure the variable @code{org-mobile-encryption-password}; please read
+the docstring of that variable.}. 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.
+
+@node Pushing to the mobile application
+@subsection Pushing to the mobile application
+
+@findex org-mobile-push
+@vindex org-mobile-files
+The command @code{org-mobile-push} copies files listed in
+@code{org-mobile-files} into the staging area. Files include agenda files
+(as listed in @code{org-agenda-files}). Customize @code{org-mobile-files} to
+add other files. File names are staged with paths relative to
+@code{org-directory}, so all files should be inside this directory@footnote{Symbolic links in @code{org-directory} need to have the same name
+as their targets.}.
+
+Push creates a special Org file @samp{agendas.org} with custom agenda views
+defined by the user@footnote{While creating the agendas, Org mode forces @samp{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
+@code{org-mobile-force-id-on-agenda-items} to @code{nil}. Org mode then relies
+on outline paths, assuming they are unique.}.
+
+Finally, Org writes the file @samp{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@footnote{Checksums are stored automatically in the file
+@samp{checksums.dat}.}
+have changed.
+
+@node Pulling from the mobile application
+@subsection Pulling from the mobile application
+
+@findex org-mobile-pull
+The command @code{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 @samp{mobileorg.org} on the server. Org ultimately integrates its
+data in an inbox file format, through the following steps:
+
+@enumerate
+@item
+@vindex org-mobile-inbox-for-pull
+Org moves all entries found in @samp{mobileorg.org}@footnote{The file will be empty after this operation.} and appends
+them to the file pointed to by the variable
+@code{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.
+
+@item
+@cindex @samp{FLAGGED}, tag
+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 @samp{FLAGGED}. Org marks entries with problems with an error
+message in the inbox. They have to be resolved manually.
+
+@item
+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.
+
+@table @asis
+@item @kbd{?}
+Pressing @kbd{?} 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 @kbd{? z C-y C-c C-c}. Pressing
+@kbd{?} twice does these things: first it removes the
+@samp{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.
+@end table
+@end enumerate
+
+@kindex ? @r{(Agenda dispatcher)}
+From the agenda dispatcher, @kbd{?} 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.
+
+@node Hacking
+@appendix Hacking
+
+@cindex hacking
+
+This appendix describes some ways a user 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.
+* 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.
+@end menu
+
+@node Hooks
+@appendixsec Hooks
+
+@cindex 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
+@uref{https://orgmode.org/worg/doc.html#hooks}.
+
+@node Add-on Packages
+@appendixsec Add-on Packages
+
+@cindex add-on packages
+
+Various authors wrote a large number of add-on packages for Org. Some
+of these packages used to be part of the @samp{org-mode} repository but are
+now hosted in a separate @samp{org-contrib} repository
+@uref{https://git.sr.ht/~bzg/org-contrib, here}. A Worg page with more
+information is at: @uref{https://orgmode.org/worg/org-contrib/}.
+
+@node Adding Hyperlink Types
+@appendixsec Adding Hyperlink Types
+
+@cindex hyperlinks, adding new types
+
+Org has many built-in hyperlink types (see @ref{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
+
+@example
+[[man:printf][The printf manual]]
+@end example
+
+
+@noindent
+The following @samp{ol-man.el} file implements it
+
+@lisp
+;;; ol-man.el - Support for links to man pages in Org mode
+(require 'ol)
+
+(org-link-set-parameters "man"
+ :follow #'org-man-open
+ :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-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 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-link-store-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&section=all" link))
+ (desc (or description link)))
+ (pcase format
+ (`html (format "<a target=\"_blank\" href=\"%s\">%s</a>" 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 ol-man)
+;;; ol-man.el ends here
+@end lisp
+
+@noindent
+To activate links to man pages in Org, enter this in the Emacs init
+file:
+
+@lisp
+(require 'ol-man)
+@end lisp
+
+@noindent
+A review of @samp{ol-man.el}:
+
+@enumerate
+@item
+First, @samp{(require 'ol)} ensures that @samp{ol.el} is loaded.
+
+@item
+@findex org-link-set-parameters
+@vindex org-link-parameters
+Then @code{org-link-set-parameters} defines a new link type with @samp{man}
+prefix and associates functions for following, exporting and
+storing such links. See the variable @code{org-link-parameters} for
+a complete list of possible associations.
+
+@item
+The rest of the file implements necessary variables and functions.
+
+For example, @code{org-man-store-link} is responsible for storing a link
+when @code{org-store-link} (see @ref{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 @code{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 @samp{man:} prefix with the man topic. It also provides a default
+description. The function @code{org-insert-link} can insert it back
+into an Org buffer later on.
+@end enumerate
+
+@node Adding Export Back-ends
+@appendixsec Adding Export Back-ends
+
+@cindex Export, writing 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.
+
+@findex org-export-define-backend
+@findex org-export-define-derived-backend
+The two main entry points to the export engine are:
+@code{org-export-define-backend} and @code{org-export-define-derived-backend}.
+To grok these functions, see @samp{ox-latex.el} for an example of defining
+a new back-end from scratch, and @samp{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 @code{:menu-entry}
+keyword. For export options specific to this back-end, set the
+@code{:options-alist}.
+
+For creating a new back-end from an existing one, set
+@code{:translate-alist} to an alist of export functions. This alist
+replaces the parent back-end functions.
+
+For complete documentation, see @uref{https://orgmode.org/worg/dev/org-export-reference.html, the Org Export Reference on Worg}.
+
+@node Tables in Arbitrary Syntax
+@appendixsec Tables in Arbitrary Syntax
+
+@cindex tables, in other modes
+@cindex lists, in other modes
+@cindex Orgtbl mode
+
+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 @emph{translate} function that
+operates on a native Org @emph{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.
+@end menu
+
+@node Radio tables
+@appendixsubsec Radio tables
+
+@cindex 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 @samp{BEGIN/END
+RECEIVE ORGTBL}. They have to appear as comments in the current mode.
+If the mode is C, then:
+
+@example
+/* BEGIN RECEIVE ORGTBL table_name */
+/* END RECEIVE ORGTBL table_name */
+@end example
+
+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:
+
+@cindex @samp{ORGTBL}, keyword
+@example
+#+ORGTBL: SEND table_name translation_function arguments ...
+@end example
+
+
+@noindent
+@samp{table_name} is the table's reference name, which is also used in the
+receiver lines, and the @samp{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:
+
+@table @asis
+@item @samp{:skip N}
+Skip the first N lines of the table. Hlines do count; include them
+if they are to be skipped.
+
+@item @samp{: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
+@samp{skipcols}.
+@end table
+
+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:
+
+@itemize
+@item
+Place the table in a block comment. For example, in C mode you
+could wrap the table between @samp{/*} and @samp{*/} lines.
+
+@item
+Put the table after an ``end'' statement. For example @code{\bye} in @TeX{}
+and @code{\end@{document@}} in @LaTeX{}.
+
+@item
+Comment and un-comment each line of the table during edits. The
+@kbd{M-x orgtbl-toggle-comment} command makes toggling easy.
+@end itemize
+
+@node A @LaTeX{} example
+@appendixsubsec A @LaTeX{} example of radio tables
+
+@cindex @LaTeX{}, and Orgtbl mode
+
+To wrap a source table in @LaTeX{}, use the @samp{comment} environment
+provided by @samp{comment.sty}@footnote{@uref{https://www.ctan.org/pkg/comment}}. To activate it, put
+@code{\usepackage@{comment@}} in the document header. Orgtbl mode inserts
+a radio table skeleton@footnote{By default this works only for @LaTeX{}, HTML, and Texinfo.
+Configure the variable @code{orgtbl-radio-table-templates} to install
+templates for other modes.} with the command @kbd{M-x orgtbl-insert-radio-table}, which prompts for a table name. For
+example, if @samp{salesfigures} is the name, the template inserts:
+
+@example
+% BEGIN RECEIVE ORGTBL salesfigures
+% END RECEIVE ORGTBL salesfigures
+\begin@{comment@}
+#+ORGTBL: SEND salesfigures orgtbl-to-latex
+| | |
+\end@{comment@}
+@end example
+
+@vindex LaTeX-verbatim-environments
+@noindent
+The line @samp{#+ORGTBL: SEND} tells Orgtbl mode to use the function
+@code{orgtbl-to-latex} to convert the table to @LaTeX{} format, then insert
+the table at the target (receive) location named @samp{salesfigures}. Now
+the table is ready for data entry. It can even use spreadsheet
+features@footnote{If the @samp{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 @samp{comment} environment that is used to balance the dollar
+expressions. If you are using AUC@TeX{} with the font-latex library,
+a much better solution is to add the @samp{comment} environment to the
+variable @code{LaTeX-verbatim-environments}.}:
+
+@example
+% 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@}
+@end example
+
+After editing, @kbd{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
+@emph{splice} out the target table without the header and footer.
+
+@example
+\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@}
+@end example
+
+The @LaTeX{} translator function @code{orgtbl-to-latex} is already part of
+Orgtbl mode and uses a @samp{tabular} environment to typeset the table and
+marks horizontal lines with @code{\hline}. For additional parameters to
+control output, see @ref{Translator functions}:
+
+@table @asis
+@item @samp{:splice BOOLEAN}
+When @{@{@{var(BOOLEAN@}@}@} is non-@code{nil}, return only table body lines;
+i.e., not wrapped in @samp{tabular} environment. Default is @code{nil}.
+
+@item @samp{:fmt FMT}
+Format string to warp each field. It should contain @samp{%s} for the
+original field value. For example, to wrap each field value in
+dollar symbol, you could use @samp{:fmt "$%s$"}. Format can also wrap
+a property list with column numbers and formats, for example @samp{: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.
+
+@item @samp{:efmt EFMT}
+Format numbers as exponentials. The spec should have @samp{%s} twice for
+inserting mantissa and exponent, for example @samp{"%s\\times10^@{%s@}"}. This
+may also be a property list with column numbers and formats, for
+example @samp{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
+@var{EFMT} has been applied to a value, @var{FMT}---see
+above---is also applied. Functions with two arguments can be
+supplied instead of strings. By default, no special formatting is
+applied.
+@end table
+
+@node Translator functions
+@appendixsubsec Translator functions
+
+@cindex HTML, and Orgtbl mode
+@cindex translator function
+
+@findex orgtbl-to-csv
+@findex orgtbl-to-tsv
+@findex orgtbl-to-latex
+@findex orgtbl-to-html
+@findex orgtbl-to-texinfo
+@findex orgtbl-to-unicode
+@findex orgtbl-to-orgtbl
+@findex orgtbl-to-generic
+Orgtbl mode has built-in translator functions: @code{orgtbl-to-csv}
+(comma-separated values), @code{orgtbl-to-tsv} (TAB-separated values),
+@code{orgtbl-to-latex}, @code{orgtbl-to-html}, @code{orgtbl-to-texinfo},
+@code{orgtbl-to-unicode} and @code{orgtbl-to-orgtbl}. They use the generic
+translator, @code{orgtbl-to-generic}, which delegates translations to
+various export back-ends.
+
+Properties passed to the function through the @samp{ORGTBL SEND} line take
+precedence over properties defined inside the function. For example,
+this overrides the default @LaTeX{} line endings, @code{\\}, with @code{\\[2mm]}:
+
+@example
+#+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
+@end example
+
+
+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 @samp{!BTBL!} and @samp{!ETBL!};
+a beginning and ending of lines with @samp{!BL!} and @samp{!EL!}; and uses a TAB
+for a field separator:
+
+@lisp
+(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)))
+@end lisp
+
+@noindent
+The documentation for the @code{orgtbl-to-generic} function shows
+a complete list of parameters, each of which can be passed through to
+@code{orgtbl-to-latex}, @code{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 @code{hline}. The second argument is the property
+list consisting of parameters specified in the @samp{#+ORGTBL: SEND} line.
+Please share your translator functions by posting them to the Org
+users mailing list, at @email{emacs-orgmode@@gnu.org}.
+
+@node Dynamic Blocks
+@appendixsec Dynamic Blocks
+
+@cindex dynamic blocks
+
+Org supports @emph{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.
+
+@kindex C-c C-x x
+@findex org-dynamic-block-insert-dblock
+You can insert a dynamic block with @code{org-dynamic-block-insert-dblock},
+which is bound to @kbd{C-c C-x x} by default. For example,
+@kbd{C-c C-x x c l o c k t a b l e @key{RET}} inserts a table that
+updates the work time (see @ref{Clocking Work Time}).
+
+Dynamic blocks can have names and function parameters. The syntax is
+similar to source code block specifications:
+
+@example
+#+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
+ ...
+#+END:
+@end example
+
+These commands update dynamic blocks:
+
+@table @asis
+@item @kbd{C-c C-x C-u} (@code{org-dblock-update})
+@kindex C-c C-x C-u
+@findex org-dblock-update
+Update dynamic block at point.
+
+@item @kbd{C-u C-c C-x C-u}
+@kindex C-u C-c C-x C-u
+Update all dynamic blocks in the current file.
+@end table
+
+Before updating a dynamic block, Org removes content between the
+@samp{BEGIN} and @samp{END} markers. Org then reads the parameters on the
+@samp{BEGIN} line for passing to the writer function as a plist. The
+previous content of the dynamic block becomes erased from the buffer
+and appended to the plist under @code{:content}.
+
+The syntax for naming a writer function with a dynamic block labeled
+@samp{myblock} is: @code{org-dblock-write:myblock}.
+
+The following is an example of a dynamic block and a block writer function
+that updates the time when the function was last run:
+
+@example
+#+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
+ ...
+#+END:
+@end example
+
+@noindent
+The dynamic block's writer function:
+
+@lisp
+(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))))
+@end lisp
+
+To keep dynamic blocks up-to-date in an Org file, use the function,
+@code{org-update-all-dblocks} in hook, such as @code{before-save-hook}. The
+@code{org-update-all-dblocks} function does not run if the file is not in
+Org mode.
+
+@findex org-narrow-to-block
+Dynamic blocks, like any other block, can be narrowed with
+@code{org-narrow-to-block}.
+
+@node Special Agenda Views
+@appendixsec Special Agenda Views
+
+@cindex agenda views, user-defined
+
+@vindex org-agenda-skip-function
+@vindex org-agenda-skip-function-global
+Org provides a special hook to further limit items in agenda views:
+@code{agenda}, @code{agenda*}@footnote{The @code{agenda*} view is the same as @code{agenda} except that it
+only considers @emph{appointments}, i.e., scheduled and deadline items that
+have a time specification @samp{[h]h:mm} in their time-stamps.}, @code{todo}, @code{alltodo}, @code{tags}, @code{tags-todo},
+@code{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
+@code{org-agenda-skip-function-global} variable. Org uses a global
+condition with @code{org-agenda-skip-function} for custom searching.
+
+This example defines a function for a custom view showing TODO items
+with @samp{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 @samp{waiting} tag and
+returns @code{nil} on match. Otherwise it gives the location from where
+the search continues.
+
+@lisp
+(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
+@end lisp
+
+To use this custom function in a custom agenda command:
+
+@lisp
+(org-add-agenda-custom-command
+ '("b" todo "PROJECT"
+ ((org-agenda-skip-function 'my-skip-unless-waiting)
+ (org-agenda-overriding-header "Projects waiting for something: "))))
+@end lisp
+
+@vindex org-agenda-overriding-header
+Note that this also binds @code{org-agenda-overriding-header} to a more
+meaningful string suitable for the agenda view.
+
+@vindex org-odd-levels-only
+@vindex org-agenda-skip-function
+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 @samp{LEVEL>0}@footnote{Note that, for @code{org-odd-levels-only}, a level number
+corresponds to order in the hierarchy, not to the number of stars.}. Then to selectively pick
+the matched entries, use @code{org-agenda-skip-function}, which also
+accepts Lisp forms, such as @code{org-agenda-skip-entry-if} and
+@code{org-agenda-skip-subtree-if}. For example:
+
+@table @asis
+@item @samp{(org-agenda-skip-entry-if 'scheduled)}
+Skip current entry if it has been scheduled.
+
+@item @samp{(org-agenda-skip-entry-if 'notscheduled)}
+Skip current entry if it has not been scheduled.
+
+@item @samp{(org-agenda-skip-entry-if 'deadline)}
+Skip current entry if it has a deadline.
+
+@item @samp{(org-agenda-skip-entry-if 'scheduled 'deadline)}
+Skip current entry if it has a deadline, or if it is scheduled.
+
+@item @samp{(org-agenda-skip-entry-if 'todo '("TODO" "WAITING"))}
+Skip current entry if the TODO keyword is TODO or WAITING@.
+
+@item @samp{(org-agenda-skip-entry-if 'todo 'done)}
+Skip current entry if the TODO keyword marks a DONE state.
+
+@item @samp{(org-agenda-skip-entry-if 'timestamp)}
+Skip current entry if it has any timestamp, may also be deadline or
+scheduled.
+
+@item @samp{(org-agenda-skip-entry-if 'regexp "regular expression")}
+Skip current entry if the regular expression matches in the entry.
+
+@item @samp{(org-agenda-skip-entry-if 'notregexp "regular expression")}
+Skip current entry unless the regular expression matches.
+
+@item @samp{(org-agenda-skip-subtree-if 'regexp "regular expression")}
+Same as above, but check and skip the entire subtree.
+@end table
+
+The following is an example of a search for @samp{waiting} without the
+special function:
+
+@lisp
+(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: "))))
+@end lisp
+
+@node Speeding Up Your Agendas
+@appendixsec Speeding Up Your Agendas
+
+@cindex agenda views, optimization
+
+Some agenda commands slow down when the Org files grow in size or
+number. Here are tips to speed up:
+
+@itemize
+@item
+Reduce the number of Org agenda files to avoid slowdowns due to hard drive
+accesses.
+
+@item
+Reduce the number of DONE and archived headlines so agenda
+operations that skip over these can finish faster.
+
+@item
+Do not dim blocked tasks:
+@vindex org-agenda-dim-blocked-tasks
+
+@lisp
+(setq org-agenda-dim-blocked-tasks nil)
+@end lisp
+
+@item
+Stop preparing agenda buffers on startup:
+@vindex org-startup-folded
+@vindex org-agenda-inhibit-startup
+
+@lisp
+(setq org-agenda-inhibit-startup t)
+@end lisp
+
+@item
+Disable tag inheritance for agendas:
+@vindex org-agenda-show-inherited-tags
+@vindex org-agenda-use-tag-inheritance
+
+@lisp
+(setq org-agenda-use-tag-inheritance nil)
+@end lisp
+@end itemize
+
+These options can be applied to selected agenda views. For more
+details about generation of agenda views, see the docstrings for the
+relevant variables, and this @uref{https://orgmode.org/worg/agenda-optimization.html, dedicated Worg page} for agenda
+optimization.
+
+@node Extracting Agenda Information
+@appendixsec Extracting Agenda Information
+
+@cindex agenda, pipe
+@cindex scripts, for agenda processing
+
+Org provides commands to access agendas through Emacs batch mode.
+Through this command-line interface, agendas are automated for further
+processing or printing.
+
+@vindex org-agenda-custom-commands
+@findex org-batch-agenda
+@code{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
+@code{org-agenda-custom-commands}. These are the same ones available
+through the agenda dispatcher (see @ref{Agenda Dispatcher}).
+
+This example command line directly prints the TODO list to the printer:
+
+@example
+emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
+@end example
+
+
+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 @samp{shop}, but excludes items tagged with
+@samp{NewYork}:
+
+@example
+emacs -batch -l ~/.emacs \
+ -eval '(org-batch-agenda "+shop-NewYork")' | lpr
+@end example
+
+@noindent
+An example showing on-the-fly parameter modifications:
+
+@example
+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
+@end example
+
+@noindent
+which produces an agenda for the next 30 days from just the
+@samp{~/org/projects.org} file.
+
+@findex org-batch-agenda-csv
+For structured processing of agenda output, use @code{org-batch-agenda-csv}
+with the following fields:
+
+@table @asis
+@item category
+The category of the item
+@item head
+The headline, without TODO keyword, TAGS and PRIORITY
+@item type
+The type of the agenda entry, can be
+
+@multitable {aaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @code{todo}
+@tab selected in TODO match
+@item @code{tagsmatch}
+@tab selected in tags match
+@item @code{diary}
+@tab imported from diary
+@item @code{deadline}
+@tab a deadline
+@item @code{scheduled}
+@tab scheduled
+@item @code{timestamp}
+@tab appointment, selected by timestamp
+@item @code{closed}
+@tab entry was closed on date
+@item @code{upcoming-deadline}
+@tab warning about nearing deadline
+@item @code{past-scheduled}
+@tab forwarded scheduled item
+@item @code{block}
+@tab entry has date block including date
+@end multitable
+
+@item todo
+The TODO keyword, if any
+@item tags
+All tags including inherited ones, separated by colons
+@item date
+The relevant date, like @samp{2007-2-14}
+@item time
+The time, like @samp{15:00-16:50}
+@item extra
+String with extra planning info
+@item priority-l
+The priority letter if any was given
+@item priority-n
+The computed numerical priority
+@end table
+
+If the selection of the agenda item was based on a timestamp,
+including those items with @samp{DEADLINE} and @samp{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:
+
+@example
+#!/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";
+@}
+@end example
+
+@node Using the Property API
+@appendixsec Using the Property API
+
+@cindex API, for properties
+@cindex properties, API
+
+Here is a description of the functions that can be used to work with
+properties.
+
+@defun org-entry-properties &optional pom which
+Get all properties of the entry at point-or-marker @var{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. @var{POM} may also
+be @code{nil}, in which case the current entry is used. If
+@var{WHICH} is @code{nil} or @code{all}, get all properties. If
+@var{WHICH} is @code{special} or @code{standard}, only get that subclass.
+@end defun
+
+@vindex org-use-property-inheritance
+@findex org-insert-property-drawer
+@defun org-entry-get pom property &optional inherit
+Get value of @var{PROPERTY} for entry at point-or-marker
+@var{POM}. By default, this only looks at properties defined
+locally in the entry. If @var{INHERIT} is non-@code{nil} and the
+entry does not have the property, then also check higher levels of the
+hierarchy. If @var{INHERIT} is the symbol @code{selective}, use
+inheritance if and only if the setting of
+@code{org-use-property-inheritance} selects @var{PROPERTY} for
+inheritance.
+@end defun
+
+@defun org-entry-delete pom property
+Delete the property @var{PROPERTY} from entry at point-or-marker
+@var{POM}.
+@end defun
+
+@defun org-entry-put pom property value
+Set @var{PROPERTY} to @var{VALUES} for entry at
+point-or-marker POM@.
+@end defun
+
+@defun org-buffer-property-keys &optional include-specials
+Get all property keys in the current buffer.
+@end defun
+
+@defun org-insert-property-drawer
+Insert a property drawer for the current entry. Also
+@end defun
+
+@defun org-entry-put-multivalued-property pom property &rest values
+Set @var{PROPERTY} at point-or-marker @var{POM} to
+@var{VALUES}. @var{VALUES} should be a list of strings.
+They are concatenated, with spaces as separators.
+@end defun
+
+@defun org-entry-get-multivalued-property pom property
+Treat the value of the property @var{PROPERTY} as
+a whitespace-separated list of values and return the values as a list
+of strings.
+@end defun
+
+@defun org-entry-add-to-multivalued-property pom property value
+Treat the value of the property @var{PROPERTY} as
+a whitespace-separated list of values and make sure that
+@var{VALUE} is in this list.
+@end defun
+
+@defun org-entry-remove-from-multivalued-property pom property value
+Treat the value of the property @var{PROPERTY} as
+a whitespace-separated list of values and make sure that
+@var{VALUE} is @emph{not} in this list.
+@end defun
+
+@defun org-entry-member-in-multivalued-property pom property value
+Treat the value of the property @var{PROPERTY} as
+a whitespace-separated list of values and check if @var{VALUE} is
+in this list.
+@end defun
+
+@defopt 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 @samp{:ETC} is one of the
+values, use the values as completion help, but allow also other values
+to be entered. The functions must return @code{nil} if they are not
+responsible for this property.
+@end defopt
+
+@node Using the Mapping API
+@appendixsec Using the Mapping API
+
+@cindex API, for mapping
+@cindex mapping entries, 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:
+
+@defun org-map-entries func &optional match scope &rest skip
+Call @var{FUNC} at each headline selected by @var{MATCH} in
+@var{SCOPE}.
+
+@var{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 @var{FUNC} in
+@code{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
+@var{FUNC} set the variable @code{org-map-continue-from} to a specific
+buffer position.
+
+@var{MATCH} is a tags/property/TODO match. Org iterates only
+matched headlines. Org iterates over all headlines when
+@var{MATCH} is @code{nil} or @code{t}.
+
+@var{SCOPE} determines the scope of this command. It can be any
+of:
+
+@table @asis
+@item @code{nil}
+The current buffer, respecting the restriction, if any.
+
+@item @code{tree}
+The subtree started with the entry at point.
+
+@item @code{region}
+The entries within the active region, if any.
+
+@item @code{file}
+The current buffer, without restriction.
+
+@item @code{file-with-archives}
+The current buffer, and any archives associated with it.
+
+@item @code{agenda}
+All agenda files.
+
+@item @code{agenda-with-archives}
+All agenda files with any archive files associated with them.
+
+@item list of filenames
+If this is a list, all files in the list are scanned.
+@end table
+
+@noindent
+The remaining arguments are treated as settings for the scanner's
+skipping facilities. Valid arguments are:
+
+@table @asis
+@item @code{archive}
+Skip trees with the @samp{ARCHIVE} tag.
+
+@item @code{comment}
+Skip trees with the COMMENT keyword.
+
+@item function or Lisp form
+@vindex org-agenda-skip-function
+Used as value for @code{org-agenda-skip-function}, so whenever the
+function returns @code{t}, @var{FUNC} is called for that entry and
+search continues from the point where the function leaves it.
+@end table
+@end defun
+
+The mapping routine can call any arbitrary function, even functions
+that change meta data or query the property API (see @ref{Using the Property API}). Here are some handy functions:
+
+@defun 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
+@var{ARG}.
+@end defun
+
+@defun org-priority &optional action
+Change the priority of the entry. See the docstring of this function
+for the possible values for @var{ACTION}.
+@end defun
+
+@defun org-toggle-tag tag &optional onoff
+Toggle the tag @var{TAG} in the current entry. Setting
+@var{ONOFF} to either @code{on} or @code{off} does not toggle tag, but
+ensure that it is either on or off.
+@end defun
+
+@defun org-promote
+Promote the current entry.
+@end defun
+
+@defun org-demote
+Demote the current entry.
+@end defun
+
+This example turns all entries tagged with @samp{TOMORROW} into TODO
+entries with keyword @samp{UPCOMING}. Org ignores entries in comment trees
+and archive trees.
+
+@lisp
+(org-map-entries '(org-todo "UPCOMING")
+ "+TOMORROW" 'file 'archive 'comment)
+@end lisp
+
+The following example counts the number of entries with TODO keyword
+@samp{WAITING}, in all agenda files.
+
+@lisp
+(length (org-map-entries t "/+WAITING" 'agenda))
+@end lisp
+
+@node History and Acknowledgments
+@appendix History and Acknowledgments
+
+
+
+@anchor{From Carsten}
+@appendixsec 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. @emph{Visibility cycling}
+and @emph{structure editing} were originally implemented in the package
+@samp{outline-magic.el}, but quickly moved to the more general @samp{org.el}.
+As this environment became comfortable for project planning, the next
+step was adding @emph{TODO entries}, basic @emph{timestamps}, and @emph{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
+@email{emacs-orgmode@@gnu.org, 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:
+
+@table @asis
+@item 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.
+
+@item 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.
+
+@item John Wiegley
+John has contributed a number of great ideas and patches directly to
+Org, including the attachment system (@samp{org-attach.el}), integration
+with Apple Mail (@samp{org-mac-message.el}), hierarchical dependencies of
+TODO items, habit tracking (@samp{org-habits.el}), and encryption
+(@samp{org-crypt.el}). Also, the capture system is really an extended
+copy of his great @samp{remember.el}.
+
+@item 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 @samp{org-info.js},
+a JavaScript program for displaying webpages derived from Org using
+an Info-like or a folding interface with single-key navigation.
+@end table
+
+See below for the full list of contributions! Again, please let me
+know what I am missing here!
+
+@anchor{From Bastien}
+@appendixsec 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:
+
+@table @asis
+@item 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.
+
+@item Nicolas Goaziou
+Nicolas is maintaining the consistency of the deepest parts of Org.
+His work on @samp{org-element.el} and @samp{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.
+
+@item Achim Gratz
+Achim rewrote the building process of Org, turning some @emph{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.
+
+@item 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.
+@end table
+
+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.
+
+@anchor{List of Contributions}
+@appendixsec List of Contributions
+
+@itemize
+@item
+Russell Adams came up with the idea for drawers.
+
+@item
+Thomas Baumann wrote @samp{ol-bbdb.el} and @samp{ol-mhe.el}.
+
+@item
+Christophe Bataillon created the great unicorn logo that we use on
+the Org mode website.
+
+@item
+Alex Bochannek provided a patch for rounding timestamps.
+
+@item
+Jan Böcker wrote @samp{ol-docview.el}.
+
+@item
+Brad Bozarth showed how to pull RSS feed data into Org files.
+
+@item
+Tom Breton wrote @samp{org-choose.el}.
+
+@item
+Charles Cave's suggestion sparked the implementation of templates
+for Remember, which are now templates for capture.
+
+@item
+Timothy E Chapman worked on a complete overhaul of the orgmode.org
+website in 2020 and helped fixing various bugs.
+
+@item
+Pavel Chalmoviansky influenced the agenda treatment of items with
+specified time.
+
+@item
+Gregory Chernov patched support for Lisp forms into table
+calculations and improved XEmacs compatibility, in particular by
+porting @samp{nouline.el} to XEmacs.
+
+@item
+Sacha Chua suggested copying some linking code from Planner.
+
+@item
+Baoqiu Cui contributed the DocBook exporter.
+
+@item
+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.
+
+@item
+Nick Dokos tracked down several nasty bugs.
+
+@item
+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.
+
+@item
+Thomas@tie{}S@.@tie{}Dye contributed documentation on Worg and helped
+integrating the Org Babel documentation into the manual.
+
+@item
+Christian Egli converted the documentation into Texinfo format,
+inspired the agenda, patched CSS formatting into the HTML exporter,
+and wrote @samp{org-taskjuggler.el}.
+
+@item
+David Emery provided a patch for custom CSS support in exported HTML
+agendas.
+
+@item
+Nic Ferrier contributed mailcap and XOXO support.
+
+@item
+Miguel@tie{}A@.@tie{}Figueroa-Villanueva implemented hierarchical checkboxes.
+
+@item
+John Foerch figured out how to make incremental search show context
+around a match in a hidden outline tree.
+
+@item
+Raimar Finken wrote @samp{org-git-line.el}.
+
+@item
+Mikael Fornius works as a mailing list moderator.
+
+@item
+Austin Frank works as a mailing list moderator.
+
+@item
+Eric Fraga drove the development of Beamer export with ideas and
+testing.
+
+@item
+Barry Gidden did proofreading the manual in preparation for the book
+publication through Network Theory Ltd.
+
+@item
+Niels Giesen had the idea to automatically archive DONE trees.
+
+@item
+Nicolas Goaziou rewrote much of the plain list code.
+
+@item
+Kai Grossjohann pointed out key-binding conflicts with other
+packages.
+
+@item
+Brian Gough of Network Theory Ltd publishes the Org mode manual as
+a book.
+
+@item
+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.
+
+@item
+Manuel Hermenegildo has contributed various ideas, small fixes and
+patches.
+
+@item
+Phil Jackson wrote @samp{ol-irc.el}.
+
+@item
+Scott Jaderholm proposed footnotes, control over whitespace between
+folded entries, and column view for properties.
+
+@item
+Matt Jones wrote MobileOrg Android.
+
+@item
+Tokuya Kameshima wrote @samp{org-wl.el} and @samp{org-mew.el}.
+
+@item
+Shidai Liu (``Leo'') asked for embedded @LaTeX{} and tested it. He also
+provided frequent feedback and some patches.
+
+@item
+Matt Lundin has proposed last-row references for table formulas and
+named invisible anchors. He has also worked a lot on the FAQ@.
+
+@item
+David Maus wrote @samp{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.
+
+@item
+Jason@tie{}F@.@tie{}McBrayer suggested agenda export to CSV format.
+
+@item
+Kyle Meyer helped setting up the @uref{https://public-inbox.org/, public-inbox} archive of the @uref{https://orgmode.org/list/, Org
+mailing list} and has been fixing many bugs.
+
+@item
+Max Mikhanosha came up with the idea of refiling.
+
+@item
+Dmitri Minaev sent a patch to set priority limits on a per-file
+basis.
+
+@item
+Stefan Monnier provided a patch to keep the Emacs Lisp compiler
+happy.
+
+@item
+Richard Moreland wrote MobileOrg for the iPhone.
+
+@item
+Rick Moynihan proposed allowing multiple TODO sequences in a file
+and being able to quickly restrict the agenda to a subtree.
+
+@item
+Todd Neal provided patches for links to Info files and Elisp forms.
+
+@item
+Greg Newman refreshed the unicorn logo into its current form.
+
+@item
+Tim O'Callaghan suggested in-file links, search options for general
+file links, and tags.
+
+@item
+Osamu Okano wrote @samp{orgcard2ref.pl}, a Perl program to create a text
+version of the reference card.
+
+@item
+Takeshi Okano translated the manual and David O'Toole's tutorial
+into Japanese.
+
+@item
+Oliver Oppitz suggested multi-state TODO items.
+
+@item
+Scott Otterson sparked the introduction of descriptive text for
+links, among other things.
+
+@item
+Pete Phillips helped during the development of the TAGS feature,
+and provided frequent feedback.
+
+@item
+Martin Pohlack provided the code snippet to bundle character
+insertion into bundles of 20 for undo.
+
+@item
+Ihor Radchenko helped with fixing bugs and improving the user
+experience regarding Org's speed.
+
+@item
+T@.@tie{}V@.@tie{}Raman reported bugs and suggested improvements.
+
+@item
+Matthias Rempe (Oelde) provided ideas, Windows support, and quality
+control.
+
+@item
+Paul Rivier provided the basic implementation of named footnotes.
+He also acted as mailing list moderator for some time.
+
+@item
+Kevin Rogers contributed code to access VM files on remote hosts.
+
+@item
+Frank Ruell solved the mystery of the @samp{keymapp nil} bug, a conflict
+with @samp{allout.el}.
+
+@item
+Jason Riedy generalized the send-receive mechanism for Orgtbl
+tables with extensive patches.
+
+@item
+Philip Rooke created the Org reference card, provided lots of
+feedback, developed and applied standards to the Org documentation.
+
+@item
+Christian Schlauer proposed angular brackets around links, among
+other things.
+
+@item
+Paul Sexton wrote @samp{org-ctags.el}.
+
+@item
+Tom Shannon's @samp{organizer-mode.el} inspired linking to VM/BBDB/Gnus.
+
+@item
+Ilya Shlyakhter proposed the Archive Sibling, line numbering in
+literal examples, and remote highlighting for referenced code lines.
+
+@item
+Stathis Sideris wrote the @samp{ditaa.jar} ASCII to PNG converter that is
+now packaged into the @uref{https://git.sr.ht/~bzg/org-contrib, org-contrib} repository.
+
+@item
+Daniel Sinder came up with the idea of internal archiving by locking
+subtrees.
+
+@item
+Dale Smith proposed link abbreviations.
+
+@item
+James TD Smith has contributed a large number of patches for
+useful tweaks and features.
+
+@item
+Adam Spiers asked for global linking commands, inspired the link
+extension system, added support for Mairix, and proposed the mapping
+API@.
+
+@item
+Ulf Stegemann created the table to translate special symbols to
+HTML, @LaTeX{}, UTF-8, Latin-1 and ASCII@.
+
+@item
+Andy Stewart contributed code to @samp{ol-w3m.el}, to copy
+HTML content with links transformation to Org syntax.
+
+@item
+David O'Toole wrote @samp{org-publish.el} and drafted the
+manual chapter about publishing.
+
+@item
+Jambunathan@tie{}K@.@tie{}contributed the ODT exporter.
+
+@item
+Sebastien Vauban reported many issues with @LaTeX{} and Beamer export
+and enabled source code highlighting in Gnus.
+
+@item
+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.
+
+@item
+Jürgen Vollmer contributed code generating the table of contents in
+HTML output.
+
+@item
+Samuel Wales has provided important feedback and bug reports.
+
+@item
+Chris Wallace provided a patch implementing the @samp{QUOTE} block.
+
+@item
+David Wainberg suggested archiving, and improvements to the
+linking system.
+
+@item
+Carsten Wimmer suggested some changes and helped fix a bug in
+linking to Gnus.
+
+@item
+Roland Winkler requested additional key bindings to make Org work on
+a TTY@.
+
+@item
+Piotr Zielinski wrote @samp{org-mouse.el}, proposed agenda
+blocks and contributed various ideas and code snippets.
+
+@item
+Marco Wahl wrote @samp{ol-eww.el}.
+@end itemize
+
+@node GNU Free Documentation License
+@appendix GNU Free Documentation License
+
+@center Version 1.3, 3 November 2008
+
+@display
+Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+@uref{https://fsf.org/}
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+
+@enumerate 0
+@item
+PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document @dfn{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.
+
+@item
+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.
+
+@item
+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.
+
+@item
+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.
+
+@item
+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:
+
+@enumerate A
+@item
+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.
+
+@item
+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.
+
+@item
+State on the Title page the name of the publisher of the
+Modified Version, as the publisher.
+
+@item
+Preserve all the copyright notices of the Document.
+
+@item
+Add an appropriate copyright notice for your modifications
+adjacent to the other copyright notices.
+
+@item
+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.
+
+@item
+Preserve in that license notice the full lists of Invariant
+Sections and required Cover Texts given in the Document's
+license notice.
+
+@item
+Include an unaltered copy of this License.
+
+@item
+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.
+
+@item
+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.
+
+@item
+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.
+
+@item
+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.
+
+@item
+Delete any section Entitled ``Endorsements''. Such a section may
+not be included in the Modified Version.
+
+@item
+Do not retitle any existing section to be Entitled
+``Endorsements'' or to conflict in title with any Invariant
+Section.
+
+@item
+Preserve any Warranty Disclaimers.
+@end enumerate
+
+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.
+
+@item
+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.''
+
+@item
+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.
+
+@item
+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.
+
+@item
+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.
+
+@item
+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.
+
+@item
+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
+@uref{https://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.
+
+@item
+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.
+@end enumerate
+
+@page
+
+@anchor{ADDENDUM How to use this License for your documents}
+@appendixsec 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:
+
+@example
+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''.
+@end example
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the ``with@dots{}Texts.''@tie{}line with this:
+
+@example
+with the Invariant Sections being LIST THEIR TITLES, with
+the Front-Cover Texts being LIST, and with the Back-Cover Texts
+being LIST.
+@end example
+
+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.
+
+@node Main Index
+@chapter Main Index
+
+@printindex cp
+
+@node Key Index
+@chapter Key Index
+
+@printindex ky
+
+@node Command and Function Index
+@chapter Command and Function Index
+
+@printindex fn
+
+@node Variable Index
+@chapter 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
+@kbd{M-x org-customize} and then click yourself through the tree.
+
+@printindex vr
+
+@bye \ No newline at end of file
diff --git a/elpa/org-9.5.2/doc/orgcard.tex b/elpa/org-9.5.2/doc/orgcard.tex
new file mode 100644
index 0000000..a4400e7
--- /dev/null
+++ b/elpa/org-9.5.2/doc/orgcard.tex
@@ -0,0 +1,691 @@
+% Reference Card for Org Mode
+\input org-version.tex
+
+%**start of header
+\newcount\columnsperpage
+\newcount\letterpaper
+
+% This file can be printed with 1, 2, or 3 columns per page (see below).
+% Specify how many you want here.
+\columnsperpage=3
+
+% PDF output layout. 0 for A4, 1 for letter (US), a `l' is added for
+% a landscape layout.
+\input pdflayout.sty
+\pdflayout=(0l)
+
+% Nothing else needs to be changed below this line.
+% Copyright (C) 1987, 1993, 1996--1997, 2001--2021 Free Software
+% Foundation, Inc.
+
+% This document 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.
+
+% As a special additional permission, you may distribute reference cards
+% printed, or formatted for printing, with the notice "Released under
+% the terms of the GNU General Public License version 3 or later"
+% instead of the usual distributed-under-the-GNU-GPL notice, and without
+% a copy of the GPL itself.
+
+% This document 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 <https://www.gnu.org/licenses/>.
+
+% This file is intended to be processed by plain TeX (TeX82).
+%
+% The final reference card has six columns, three on each side.
+% This file can be used to produce it in any of three ways:
+% 1 column per page
+% produces six separate pages, each of which needs to be reduced to 80%.
+% This gives the best resolution.
+% 2 columns per page
+% produces three already-reduced pages.
+% You will still need to cut and paste.
+% 3 columns per page
+% produces two pages which must be printed sideways to make a
+% ready-to-use 8.5 x 11 inch reference card.
+% For this you need a dvi device driver that can print sideways.
+% Which mode to use is controlled by setting \columnsperpage above.
+%
+% To compile and print this document:
+% tex refcard.tex
+% dvips -t landscape refcard.dvi
+%
+% Author:
+% Stephen Gildea <stepheng+emacs@gildea.com>
+%
+% Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik
+% for their many good ideas.
+
+\def\shortcopyrightnotice{\vskip 1ex plus 2 fill
+ \centerline{\small \copyright\ \year\ Free Software Foundation, Inc.
+ Permissions on back. v\orgversionnumber}}
+
+\def\copyrightnotice{
+\vskip 1ex plus 100 fill\begingroup\small
+\centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.}
+\centerline{v\orgversionnumber{} for Org-Mode \orgversionnumber{}, \versionyear}
+\centerline{Author: Philip Rooke}
+\centerline{based on refcard design and format by Stephen Gildea}
+
+\centerline{Released under the terms of the GNU General Public License}
+\centerline{version 3 or later.}
+
+\endgroup}
+
+% make \bye not \outer so that the \def\bye in the \else clause below
+% can be scanned without complaint.
+\def\bye{\par\vfill\supereject\end}
+
+\newdimen\intercolumnskip %horizontal space between columns
+\newbox\columna %boxes to hold columns already built
+\newbox\columnb
+
+\def\ncolumns{\the\columnsperpage}
+
+\message{[\ncolumns\space
+ column\if 1\ncolumns\else s\fi\space per page]}
+
+\def\scaledmag#1{ scaled \magstep #1}
+
+% This multi-way format was designed by Stephen Gildea October 1986.
+% Note that the 1-column format is fontfamily-independent.
+\if 1\ncolumns %one-column format uses normal size
+ \hsize 4in
+ \vsize 10in
+ \voffset -.7in
+ \font\titlefont=\fontname\tenbf \scaledmag3
+ \font\headingfont=\fontname\tenbf \scaledmag2
+ \font\smallfont=\fontname\sevenrm
+ \font\smallsy=\fontname\sevensy
+
+ \footline{\hss\folio}
+ \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}}
+\else %2 or 3 columns uses prereduced size
+ \if 1\the\letterpaper
+ \hsize 3.2in
+ \vsize 7.95in
+ \hoffset -.75in
+ \voffset -.745in
+ \else
+ \hsize 3.2in
+ \vsize 7.65in
+ \hoffset -.25in
+ \voffset -.745in
+ \fi
+ \font\titlefont=cmbx10 \scaledmag2
+ \font\headingfont=cmbx10 \scaledmag1
+ \font\smallfont=cmr6
+ \font\smallsy=cmsy6
+ \font\eightrm=cmr8
+ \font\eightbf=cmbx8
+ \font\eightit=cmti8
+ \font\eighttt=cmtt8
+ \font\eightmi=cmmi8
+ \font\eightsy=cmsy8
+ \textfont0=\eightrm
+ \textfont1=\eightmi
+ \textfont2=\eightsy
+ \def\rm{\eightrm}
+ \def\bf{\eightbf}
+ \def\it{\eightit}
+ \def\tt{\eighttt}
+ \if 1\the\letterpaper
+ \normalbaselineskip=.8\normalbaselineskip
+ \else
+ \normalbaselineskip=.7\normalbaselineskip
+ \fi
+ \normallineskip=.8\normallineskip
+ \normallineskiplimit=.8\normallineskiplimit
+ \normalbaselines\rm %make definitions take effect
+
+ \if 2\ncolumns
+ \let\maxcolumn=b
+ \footline{\hss\rm\folio\hss}
+ \def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}}
+ \else \if 3\ncolumns
+ \let\maxcolumn=c
+ \nopagenumbers
+ \else
+ \errhelp{You must set \columnsperpage equal to 1, 2, or 3.}
+ \errmessage{Illegal number of columns per page}
+ \fi\fi
+
+ \intercolumnskip=.46in
+ \def\abc{a}
+ \output={% %see The TeXbook page 257
+ % This next line is useful when designing the layout.
+ %\immediate\write16{Column \folio\abc\space starts with \firstmark}
+ \if \maxcolumn\abc \multicolumnformat \global\def\abc{a}
+ \else\if a\abc
+ \global\setbox\columna\columnbox \global\def\abc{b}
+ %% in case we never use \columnb (two-column mode)
+ \global\setbox\columnb\hbox to -\intercolumnskip{}
+ \else
+ \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi}
+ \def\multicolumnformat{\shipout\vbox{\makeheadline
+ \hbox{\box\columna\hskip\intercolumnskip
+ \box\columnb\hskip\intercolumnskip\columnbox}
+ \makefootline}\advancepageno}
+ \def\columnbox{\leftline{\pagebody}}
+
+ \def\bye{\par\vfill\supereject
+ \if a\abc \else\null\vfill\eject\fi
+ \if a\abc \else\null\vfill\eject\fi
+ \end}
+\fi
+
+% we won't be using math mode much, so redefine some of the characters
+% we might want to talk about
+%\catcode`\^=12
+\catcode`\_=12
+
+% we also need the tilde, for file names.
+\catcode`\~=12
+
+\chardef\\=`\\
+\chardef\{=`\{
+\chardef\}=`\}
+
+\hyphenation{mini-buf-fer}
+
+\parindent 0pt
+\parskip 1ex plus .5ex minus .5ex
+
+\def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip}
+
+% newcolumn - force a new column. Use sparingly, probably only for
+% the first column of a page, which should have a title anyway.
+\outer\def\newcolumn{\vfill\eject}
+
+% title - page title. Argument is title text.
+\outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus .5ex}
+
+% section - new major section. Argument is section name.
+\outer\def\section#1{\par\filbreak
+ \vskip 3ex plus 2ex minus 2ex {\headingfont #1}\mark{#1}%
+ \vskip 2ex plus 1ex minus 1.5ex}
+
+\newdimen\keyindent
+
+% beginindentedkeys...endindentedkeys - key definitions will be
+% indented, but running text, typically used as headings to group
+% definitions, will not.
+\def\beginindentedkeys{\keyindent=1em}
+\def\endindentedkeys{\keyindent=0em}
+\endindentedkeys
+
+% paralign - begin paragraph containing an alignment.
+% If an \halign is entered while in vertical mode, a parskip is never
+% inserted. Using \paralign instead of \halign solves this problem.
+\def\paralign{\vskip\parskip\halign}
+
+% \<...> - surrounds a variable name in a code example
+\def\<#1>{{\it #1\/}}
+
+% kbd - argument is characters typed literally. Like the Texinfo command.
+\def\kbd#1{{\tt#1}\null} %\null so not an abbrev even if period follows
+
+% beginexample...endexample - surrounds literal text, such a code example.
+% typeset in a typewriter font with line breaks preserved
+\def\beginexample{\par\leavevmode\begingroup
+ \obeylines\obeyspaces\parskip0pt\tt}
+{\obeyspaces\global\let =\ }
+\def\endexample{\endgroup}
+
+% key - definition of a key.
+% \key{description of key}{key-name}
+% prints the description left-justified, and the key-name in a \kbd
+% form near the right margin.
+\def\key#1#2{\leavevmode\hbox to \hsize{\vtop
+ {\hsize=.75\hsize\rightskip=1em
+ \hskip\keyindent\relax#1}\kbd{#2}\hfil}}
+
+\newbox\metaxbox
+\setbox\metaxbox\hbox{\kbd{M-x }}
+\newdimen\metaxwidth
+\metaxwidth=\wd\metaxbox
+
+% metax - definition of a M-x command.
+% \metax{description of command}{M-x command-name}
+% Tries to justify the beginning of the command name at the same place
+% as \key starts the key name. (The "M-x " sticks out to the left.)
+\def\metax#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize
+ {\hskip\keyindent\relax#1\hfil}%
+ \hskip -\metaxwidth minus 1fil
+ \kbd{#2}\hfil}}
+
+% threecol - like "key" but with two key names.
+% for example, one for doing the action backward, and one for forward.
+\def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\hfil\quad
+ &\kbd{#3}\hfil\quad\cr}
+
+%\def\noteone{{\small \hfill [1]}}
+%\def\notetwo{{\small \hfill [2]}}
+\def\noteone{{\small [1]}}
+\def\notetwo{{\small [2]}}
+
+
+%**end of header
+
+
+\title{Org-Mode Reference Card (1/2)}
+
+\centerline{(for version \orgversionnumber)}
+
+\section{Getting Started}
+\metax{To read the on-line documentation try}{M-x org-info}
+
+\section{Visibility Cycling}
+
+\key{rotate current subtree between states}{TAB}
+\key{rotate entire buffer between states}{S-TAB}
+\key{restore property-dependent startup visibility}{C-u C-u TAB}
+\metax{show the whole file, including drawers}{C-u C-u C-u TAB}
+\key{reveal context around point}{C-c C-r}
+\metax{toggle indented view}{M-x org-indent-mode}
+
+\section{Motion}
+
+\key{next/previous heading}{C-c C-n/p}
+\key{next/previous heading, same level}{C-c C-f/b}
+\key{backward to higher level heading}{C-c C-u}
+\key{jump to another place in document}{C-c C-j}
+\key{previous/next plain list item}{S-UP/DOWN\notetwo}
+
+\section{Structure Editing}
+
+\key{insert new heading/item at current level}{M-RET}
+\key{insert new heading after subtree}{C-RET}
+\key{insert new TODO entry/checkbox item}{M-S-RET}
+\key{insert TODO entry/ckbx after subtree}{C-S-RET}
+\key{turn (head)line into item, cycle item type}{C-c -}
+\key{turn item/line into headline}{C-c *}
+\key{promote/demote heading}{M-LEFT/RIGHT}
+\metax{promote/demote current subtree}{M-S-LEFT/RIGHT}
+\metax{move subtree/list item up/down}{M-UP/DOWN}
+\metax{move the line at point up/down}{M-S-UP/DOWN}
+\metax{sort subtree/region/plain-list}{C-c \^{}}
+\metax{clone a subtree}{C-c C-x c}
+\metax{copy visible parts of the region}{C-c C-x v}
+\metax{kill/copy subtree}{C-c C-x C-w/M-w}
+\metax{yank subtree}{C-c C-x C-y or C-y}
+\metax{narrow buffer to subtree / widen}{C-x n s/w}
+
+\section{Capture - Refile - Archiving}
+\key{capture a new item (C-u C-u = goto last)}{C-c c \noteone}
+\key{refile subtree (C-u C-u = goto last)}{C-c C-w}
+\key{archive subtree using the default command}{C-c C-x C-a}
+\key{move subtree to archive file}{C-c C-x C-s}
+\key{toggle ARCHIVE tag / to ARCHIVE sibling}{C-c C-x a/A}
+\key{force cycling of an ARCHIVEd tree}{C-TAB}
+
+\section{Filtering and Sparse Trees}
+
+\key{construct a sparse tree by various criteria}{C-c /}
+\key{view TODO's in sparse tree}{C-c / t/T}
+\key{global TODO list in agenda mode}{C-c a t \noteone}
+
+\section{Tables}
+
+{\bf Creating a table}
+
+%\metax{insert a new Org-mode table}{M-x org-table-create}
+\metax{just start typing, e.g.}{|Name|Phone|Age RET |- TAB}
+\key{convert region to table}{C-c |}
+\key{... separator at least 3 spaces}{C-3 C-c |}
+
+{\bf Commands available inside tables}
+
+The following commands work when the cursor is {\it inside a table}.
+Outside of tables, the same keys may have other functionality.
+
+{\bf Re-aligning and field motion}
+
+\key{re-align the table without moving the cursor}{C-c C-c}
+\key{re-align the table, move to next field}{TAB}
+\key{move to previous field}{S-TAB}
+\key{re-align the table, move to next row}{RET}
+\key{move to beginning/end of field}{M-a/e}
+
+{\bf Row and column editing}
+
+\key{move the current column left}{M-LEFT/RIGHT}
+\key{kill the current column}{M-S-LEFT}
+\key{insert new column to left of cursor position}{M-S-RIGHT}
+
+\key{move the current row up/down}{M-UP/DOWN}
+\key{kill the current row or horizontal line}{M-S-UP}
+\key{insert new row above the current row}{M-S-DOWN}
+\key{insert hline below (\kbd{C-u} : above) current row}{C-c -}
+\key{insert hline and move to line below it}{C-c RET}
+\key{sort lines in region}{C-c \^{}}
+
+{\bf Regions}
+
+\metax{cut/copy/paste rectangular region}{C-c C-x C-w/M-w/C-y}
+%\key{copy rectangular region}{C-c C-x M-w}
+%\key{paste rectangular region}{C-c C-x C-y}
+
+{\bf Miscellaneous}
+
+\key{to limit column width to \kbd{N} characters, use}{...| <N> |...}
+\key{edit the current field in a separate window}{C-c `}
+\key{make current field fully visible}{C-u TAB}
+\metax{export as tab-separated file}{M-x org-table-export}
+\metax{import tab-separated file}{M-x org-table-import}
+\key{sum numbers in current column/rectangle}{C-c +}
+
+{\bf Tables created with the \kbd{table.el} package}
+
+\key{insert a new \kbd{table.el} table}{C-c ~}
+\key{recognize existing table.el table}{C-c C-c}
+\key{convert table (Org-mode $\leftrightarrow$ table.el)}{C-c ~}
+
+{\bf Spreadsheet}
+
+Formulas typed in field are executed by \kbd{TAB},
+\kbd{RET} and \kbd{C-c C-c}. \kbd{=} introduces a column
+formula, \kbd{:=} a field formula.
+
+\key{Example: Add Col1 and Col2}{|=\$1+\$2 |}
+\key{... with printf format specification}{|=\$1+\$2;\%.2f|}
+\key{... with constants from constants.el}{|=\$1/\$c/\$cm |}
+\metax{sum from 2nd to 3rd hline}{|:=vsum(@II..@III)|}
+\key{apply current column formula}{| = |}
+
+\key{set and eval column formula}{C-c =}
+\key{set and eval field formula}{C-u C-c =}
+\key{re-apply all stored equations to current line}{C-c *}
+\key{re-apply all stored equations to entire table}{C-u C-c *}
+\key{iterate table to stability}{C-u C-u C-c *}
+\key{rotate calculation mark through \# * ! \^ \_ \$}{C-\#}
+\key{show line, column, formula reference}{C-c ?}
+\key{toggle grid / debugger}{C-c \}/\{}
+
+\newcolumn
+{\it Formula Editor}
+
+\key{edit formulas in separate buffer}{C-c '}
+\key{exit and install new formulas}{C-c C-c}
+\key{exit, install, and apply new formulas}{C-u C-c C-c}
+\key{abort}{C-c C-q}
+\key{toggle reference style}{C-c C-r}
+\key{pretty-print Lisp formula}{TAB}
+\key{complete Lisp symbol}{M-TAB}
+\key{shift reference point}{S-cursor}
+\key{shift test line for column references}{M-up/down}
+\key{scroll the window showing the table}{M-S-up/down}
+\key{toggle table coordinate grid}{C-c \}}
+
+\section{Links}
+
+\key{globally store link to the current location}{C-c l \noteone}
+\key{insert a link (TAB completes stored links)}{C-c C-l}
+\key{insert file link with file name completion}{C-u C-c C-l}
+\key{edit (also hidden part of) link at point}{C-c C-l}
+
+\key{open file links in emacs}{C-c C-o}
+\key{...force open in emacs/other window}{C-u C-c C-o}
+\key{open link at point}{mouse-1/2}
+\key{...force open in emacs/other window}{mouse-3}
+\key{record a position in mark ring}{C-c \%}
+\key{jump back to last followed link(s)}{C-c \&}
+\key{find next link}{C-c C-x C-n}
+\key{find previous link}{C-c C-x C-p}
+\key{edit code snippet of file at point}{C-c '}
+\key{toggle inline display of linked images}{C-c C-x C-v}
+
+\section{Working with Code (Babel)}
+
+\key{execute code block at point}{C-c C-c}
+\key{open results of code block at point}{C-c C-o}
+\key{check code block at point for errors}{C-c C-v c}
+\key{insert a header argument with completion}{C-c C-v j}
+\key{view expanded body of code block at point}{C-c C-v v}
+\key{view information about code block at point}{C-c C-v I}
+\key{go to named code block}{C-c C-v g}
+\key{go to named result}{C-c C-v r}
+\key{go to the head of the current code block}{C-c C-v u}
+\key{go to the next code block}{C-c C-v n}
+\key{go to the previous code block}{C-c C-v p}
+\key{demarcate a code block}{C-c C-v d}
+\key{execute next key sequence in code edit buffer}{C-c C-v x}
+\key{execute all code blocks in current buffer}{C-c C-v b}
+\key{execute all code blocks in current subtree}{C-c C-v s}
+\key{tangle code blocks in current file}{C-c C-v t}
+\key{tangle code blocks in supplied file}{C-c C-v f}
+\key{ingest all code blocks in supplied file into the Library of Babel}{C-c C-v i}
+\key{switch to the session of the current code block}{C-c C-v z}
+\key{load the current code block into a session}{C-c C-v l}
+\key{view sha1 hash of the current code block}{C-c C-v a}
+
+\section{Completion and Template Insertion}
+
+In-buffer completion completes TODO keywords at headline start, TeX
+macros after ``{\tt \\}'', option keywords after ``{\tt \#-}'', TAGS
+after ``{\tt :}'', and dictionary words elsewhere.
+
+\key{complete word at point}{M-TAB}
+\key{structure template (insert or wrap region)}{C-c C-,}
+
+
+\newcolumn
+\title{Org-Mode Reference Card (2/2)}
+
+\centerline{(for version \orgversionnumber)}
+
+\section{TODO Items and Checkboxes}
+
+\key{rotate the state of the current item}{C-c C-t}
+\metax{select next/previous state}{\quad\quad S-LEFT/RIGHT}
+\metax{select next/previous set}{\quad\quad\quad C-S-LEFT/RIGHT}
+\key{toggle ORDERED property}{C-c C-x o}
+
+\key{view TODO items in a sparse tree}{C-c / t}
+\key{view 3rd TODO keyword's sparse tree}{C-3 C-c / t}
+\key{set the priority of the current item}{C-c , [ABC]}
+\key{remove priority cookie from current item}{C-c , SPC}
+\key{raise/lower priority of current item}{S-UP/DOWN\notetwo}
+
+\key{insert new checkbox item in plain list}{M-S-RET}
+\key{toggle checkbox(es) in region/entry/at point}{C-c C-x C-b}
+\key{toggle checkbox at point}{C-c C-c}
+%\metax{checkbox statistics cookies: insert {\tt [/]} or {\tt [\%]}}{}
+\key{update checkbox statistics (\kbd{C-u} : whole file)}{C-c \#}
+
+\section{Tags}
+
+\key{set tags for current heading}{C-c C-q}
+\key{realign tags in all headings}{C-u C-c C-q}
+\key{create sparse tree with matching tags}{C-c \\}
+\key{globally (agenda) match tags at cursor}{C-c C-o}
+
+\section{Properties and Column View}
+
+\key{set property/effort}{C-c C-x p/e}
+\key{special commands in property lines}{C-c C-c}
+\key{next/previous allowed value}{S-LEFT/RIGHT}
+\key{turn on column view}{C-c C-x C-c}
+\key{capture columns view in dynamic block}{C-c C-x x}
+
+\key{quit column view}{q}
+\key{show full value}{v}
+\key{edit value}{e}
+\metax{next/previous allowed value}{n/p or S-LEFT/RIGHT}
+\key{edit allowed values list}{a}
+\key{make column wider/narrower}{> / <}
+\key{move column left/right}{M-LEFT/RIGHT}
+\key{add new column}{M-S-RIGHT}
+\key{Delete current column}{M-S-LEFT}
+
+
+\section{Timestamps}
+
+\key{prompt for date and insert timestamp}{C-c .}
+\key{like \kbd{C-c .} but insert date and time format}{C-u C-c .}
+\key{like \kbd{C-c .} but make stamp inactive}{C-c !} % FIXME
+\key{insert DEADLINE timestamp}{C-c C-d}
+\key{insert SCHEDULED timestamp}{C-c C-s}
+\key{create sparse tree with all deadlines due}{C-c / d}
+\key{the time between 2 dates in a time range}{C-c C-y}
+\metax{change timestamp at cursor $\pm 1$ day}{\quad\quad\quad\quad S-RIGHT/LEFT \notetwo}
+\key{change year/month/day at cursor by $\pm 1$}{S-UP/DOWN \notetwo}
+\key{access the calendar for the current date}{C-c >}
+\key{insert timestamp matching date in calendar}{C-c <}
+\key{access agenda for current date}{C-c C-o}
+\key{select date while prompted}{mouse-1/RET}
+%\key{... select date in calendar}{mouse-1/RET}
+%\key{... scroll calendar back/forward one month}{< / >}
+%\key{... forward/backward one day}{S-LEFT/RIGHT}
+%\key{... forward/backward one week}{S-UP/DOWN}
+%\key{... forward/backward one month}{M-S-LEFT/RIGHT}
+\key{toggle custom format display for dates/times}{C-c C-x C-t}
+
+\newcolumn
+
+{\bf Clocking time}
+
+\key{start clock on current item}{C-c C-x C-i}
+\key{stop/cancel clock on current item}{C-c C-x C-o/x}
+\key{display total subtree times}{C-c C-x C-d}
+\key{remove displayed times}{C-c C-c}
+\key{insert/update table with clock report}{C-c C-x C-x}
+
+\section{Agenda Views}
+
+\key{add/move current file to front of agenda}{C-c [}
+\key{remove current file from your agenda}{C-c ]}
+\key{cycle through agenda file list}{C-'}
+\key{set/remove restriction lock}{C-c C-x </>}
+
+\key{compile agenda for the current week}{C-c a a \noteone}
+\key{compile global TODO list}{C-c a t \noteone}
+\key{compile TODO list for specific keyword}{C-c a T \noteone}
+\key{match tags, TODO kwds, properties}{C-c a m \noteone}
+\key{match only in TODO entries}{C-c a M \noteone}
+\key{find stuck projects}{C-c a \# \noteone}
+\key{configure custom commands}{C-c a C \noteone}
+%\key{configure stuck projects}{C-c a ! \noteone}
+\key{agenda for date at cursor}{C-c C-o}
+
+{\bf Commands available in an agenda buffer}
+
+{\bf View Org file}
+
+\key{show original location of item}{SPC/mouse-3}
+%\key{... also available with}{mouse-3}
+\key{show and recenter window}{L}
+\key{goto original location in other window}{TAB/mouse-2}
+%\key{... also available with}{mouse-2}
+\key{goto original location, delete other windows}{RET}
+\key{show subtree in indirect buffer, ded.\ frame}{C-c C-x b}
+\key{toggle follow-mode}{F}
+
+{\bf Change display}
+
+\key{delete other windows}{o}
+\key{view mode dispatcher}{v}
+\key{switch to day/week/month/year/def view}{d w vm vy vSP}
+\key{toggle diary entries / time grid / habits}{D / G / K}
+\key{toggle entry text / clock report}{E / R}
+\key{toggle display of logbook entries}{l / v l/L/c}
+\key{toggle inclusion of archived trees/files}{v a/A}
+\key{refresh agenda buffer with any changes}{r / g}
+\key{filter with respect to a tag}{/}
+\key{save all org-mode buffers}{s}
+\key{display next/previous day,week,...}{f / b}
+\key{goto today / some date (prompt)}{. / j}
+
+{\bf Remote editing}
+
+\key{digit argument}{0-9}
+\key{change state of current TODO item}{t}
+\key{kill item and source}{C-k}
+\key{archive default}{\$ / a}
+\key{refile the subtree}{C-c C-w}
+\key{set/show tags of current headline}{: / T}
+\key{set effort property (prefix=nth)}{e}
+\key{set / compute priority of current item}{, / P}
+\key{raise/lower priority of current item}{S-UP/DOWN\notetwo}
+\key{run an attachment command}{C-c C-a}
+\key{schedule/set deadline for this item}{C-c C-s/d}
+\metax{change timestamp one day earlier/later}{S-LEFT/RIGHT\notetwo}
+\key{change timestamp to today}{>}
+\key{insert new entry into diary}{i}
+\newcolumn
+\key{start/stop/cancel the clock on current item}{I / O / X}
+\key{jump to running clock entry}{J}
+\key{mark / unmark / execute bulk action}{m / u / B}
+
+{\bf Misc}
+
+\key{follow one or offer all links in current entry}{C-c C-o}
+
+{\bf Calendar commands}
+
+\key{find agenda cursor date in calendar}{c}
+\key{compute agenda for calendar cursor date}{c}
+\key{show phases of the moon}{M}
+\key{show sunrise/sunset times}{S}
+\key{show holidays}{H}
+\key{convert date to other calendars}{C}
+
+{\bf Quit and Exit}
+
+\key{quit agenda, remove agenda buffer}{q}
+\key{exit agenda, remove all agenda buffers}{x}
+
+\section{LaTeX and cdlatex-mode}
+
+\key{preview LaTeX fragment}{C-c C-x C-l}
+\key{expand abbreviation (cdlatex-mode)}{TAB}
+\key{insert/modify math symbol (cdlatex-mode)}{` / '}
+\key{insert citation using RefTeX}{C-c C-x [}
+
+\section{Exporting and Publishing}
+
+Exporting creates files with extensions {\it .txt\/} and {\it .html\/}
+in the current directory. Publishing puts the resulting file into
+some other place.
+
+\key{export/publish dispatcher}{C-c C-e}
+
+\key{toggle asynchronous export}{C-c C-e C-a}
+\key{toggle body/visible only export}{C-c C-e C-b/v}
+\key{toggle subtree export}{C-c C-e C-s}
+\key{insert template of export options}{C-c C-e \#}
+
+\key{toggle fixed width for entry or region}{C-c :}
+\key{toggle pretty display of scripts, entities}{C-c C-x {\tt\char`\\}}
+
+Lines starting with \kbd{\#} and subtrees starting with COMMENT are
+never exported.
+
+\key{toggle COMMENT keyword on entry}{C-c ;}
+
+\section{Dynamic Blocks}
+
+\key{update dynamic block at point}{C-c C-x C-u}
+\metax{update all dynamic blocks}{C-u C-c C-x C-u}
+
+\section{Notes}
+[1] This is only a suggestion for a binding of this command. Choose
+your own key as shown under ACTIVATION.
+
+[2] Keybinding affected by {\tt org-support-shift-select} and also
+ {\tt org-replace-disputed-keys}.
+
+\copyrightnotice
+
+\bye
+
+% Local variables:
+% compile-command: "pdftex orgcard"
+% End:
diff --git a/elpa/org-9.5.2/doc/orgguide.texi b/elpa/org-9.5.2/doc/orgguide.texi
new file mode 100644
index 0000000..5b4a116
--- /dev/null
+++ b/elpa/org-9.5.2/doc/orgguide.texi
@@ -0,0 +1,2688 @@
+\input texinfo @c -*- texinfo -*-
+@c %**start of header
+@setfilename orgguide.info
+@settitle Org Mode Compact Guide
+@documentencoding UTF-8
+@documentlanguage en
+@set txicodequoteundirected
+@set txicodequotebacktick
+@set MAINTAINERSITE @uref{https://orgmode.org,maintainers webpage}
+@set MAINTAINER Bastien Guerry
+@set MAINTAINEREMAIL @email{bzg@gnu.org}
+@set MAINTAINERCONTACT @uref{mailto:bzg@gnu.org,contact the maintainer}
+@c %**end of header
+
+@copying
+Copyright @copyright{} 2004--2021 Free Software Foundation, Inc.
+
+@quotation
+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.''
+in the full Org manual, which is distributed together with this
+compact guide.
+
+(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
+modify this GNU manual.''
+
+@end quotation
+@end copying
+
+@dircategory Emacs editing modes
+@direntry
+* Org Guide: (orgguide). Abbreviated Org mode manual.
+@end direntry
+
+@finalout
+@titlepage
+@title Org Mode Compact Guide
+@subtitle Release 9.5
+@author The Org Mode Developers
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+
+@contents
+
+@ifnottex
+@node Top
+@top Org Mode Compact Guide
+
+@insertcopying
+@end ifnottex
+
+@menu
+* Introduction:: Welcome!
+* 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:: 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:: 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.
+
+@detailmenu
+--- The Detailed Node Listing ---
+
+Document Structure
+
+* Headlines:: How to typeset Org tree nodes.
+* 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.
+
+TODO Items
+
+* TODO Basics:: Marking and displaying TODO entries.
+* Multi-state Workflow:: More than just on/off.
+* 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.
+
+Dates and Times
+
+* Timestamps:: Assigning a time to a tree entry.
+* Creating Timestamps:: Commands that insert timestamps.
+* Deadlines and Scheduling:: Planning your work.
+* Clocking Work Time:: Tracking how long you spent on a task.
+
+Capture, Refile, Archive
+
+* Capture:: Capturing new stuff.
+* Refile and Copy:: Moving/copying a tree from one place to another.
+* Archiving:: What to do with finished products.
+
+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?
+* 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.
+* Agenda Commands:: Remote editing of Org trees.
+* Custom Agenda Views:: Defining special searches and views.
+
+Markup
+
+* Paragraphs:: The basic unit of text.
+* Emphasis and Monospace:: Bold, italic, etc.
+* Embedded @LaTeX{}:: LaTeX can be freely used inside Org documents.
+* Literal examples:: Source code examples with special formatting.
+* Images:: Display an image.
+* Creating Footnotes:: Edit and read footnotes.
+
+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.
+* Comment Lines:: What will not be exported.
+* ASCII/UTF-8 Export:: Exporting to flat files with encoding.
+* HTML Export:: Exporting to HTML.
+* @LaTeX{} Export:: Exporting to @LaTeX{} and processing to PDF.
+* iCalendar Export:: Exporting to iCalendar.
+
+@end detailmenu
+@end menu
+
+@node Introduction
+@chapter Introduction
+
+Org is a mode for keeping notes, maintaining TODO lists, and doing
+project planning with a fast and effective plain-text system. It is
+also an authoring and publishing system, and it supports working with
+source code for literal programming and reproducible research.
+
+This document is a much compressed derivative of the @ref{Top,comprehensive Org
+mode manual,,org,}. It contains all basic features and commands, along with
+important hints for customization. It is intended for beginners who
+would shy back from a 200 pages manual because of sheer size.
+
+@anchor{Installation}
+@heading Installation
+
+@quotation Important
+If you are using a version of Org that is part of the Emacs
+distribution, please skip this section and go directly to @ref{Activation}.
+
+@end quotation
+
+If you have downloaded Org from the web, either as a distribution
+@samp{.zip} or @samp{.tar} file, or as a Git archive, it is best to run it
+directly from the distribution directory. You need to add the @samp{lisp/}
+subdirectories to the Emacs load path. To do this, add the following
+line to your Emacs init file:
+
+@example
+(add-to-list 'load-path "~/path/to/orgdir/lisp")
+@end example
+
+
+@noindent
+If you have been using git or a tar ball to get Org, you need to run
+the following command to generate autoload information.
+
+@example
+make autoloads
+@end example
+
+@anchor{Activation}
+@heading Activation
+
+Add the following lines to your Emacs init file to define @emph{global}
+keys for three commands that are useful in any Emacs buffer, not just
+Org buffers. Please choose suitable keys yourself.
+
+@lisp
+(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)
+@end lisp
+
+Files with extension @samp{.org} will be put into Org mode automatically.
+
+@anchor{Feedback}
+@heading Feedback
+
+If you find problems with Org, or if you have questions, remarks, or
+ideas about it, please mail to the Org mailing list
+@email{emacs-orgmode@@gnu.org}. For information on how to submit bug
+reports, see the main manual.
+
+@node Document Structure
+@chapter 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,
+@code{org-cycle}, which is bound to the @kbd{@key{TAB}} key.
+
+@menu
+* Headlines:: How to typeset Org tree nodes.
+* 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.
+@end menu
+
+@node Headlines
+@section Headlines
+
+Headlines define the structure of an outline tree. The headlines in
+Org start on the left margin@footnote{See the variable @code{org-special-ctrl-a/e} to configure special
+behavior of @kbd{C-a} and @kbd{C-e} in headlines.} with one or more stars followed by
+a space. For example:
+
+@example
+* Top level headline
+** Second level
+*** Third level
+ some text
+*** Third level
+ more text
+* Another top level headline
+@end example
+
+Note that a headline named after @code{org-footnote-section}, which
+defaults to @samp{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.
+See @ref{Miscellaneous} for a setup to realize this.
+
+@node Visibility Cycling
+@section Visibility Cycling
+
+Outlines make it possible to hide parts of the text in the buffer.
+Org uses just two commands, bound to @kbd{@key{TAB}} and
+@{@{@{kbd@{S-TAB)@}@}@} to change the visibility in the buffer.
+
+@table @asis
+@item @kbd{@key{TAB}}
+@emph{Subtree cycling}: Rotate current subtree among the states
+
+@example
+,-> FOLDED -> CHILDREN -> SUBTREE --.
+'-----------------------------------'
+@end example
+
+
+When called with a prefix argument (@kbd{C-u @key{TAB}}), or with the
+Shift key, global cycling is invoked.
+
+@item @kbd{S-@key{TAB}}
+@itemx @kbd{C-u @key{TAB}}
+@emph{Global cycling}: Rotate the entire buffer among the states
+
+@example
+,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
+'--------------------------------------'
+@end example
+
+@item @kbd{C-u C-u C-u @key{TAB}}
+Show all, including drawers.
+@end table
+
+When Emacs first visits an Org file, the global state is set to
+OVERVIEW, i.e., only the top level headlines are visible. This can be
+configured through the variable @code{org-startup-folded}, or on a per-file
+basis by adding a @samp{STARTUP} keyword to @samp{overview}, @samp{content},
+@samp{showall}, @samp{showeverything} or @samp{show<n>levels} (n = 2..5) like this:
+
+@example
+#+STARTUP: content
+@end example
+
+@node Motion
+@section Motion
+
+The following commands jump to other headlines in the buffer.
+
+@table @asis
+@item @kbd{C-c C-n}
+Next heading.
+
+@item @kbd{C-c C-p}
+Previous heading.
+
+@item @kbd{C-c C-f}
+Next heading same level.
+
+@item @kbd{C-c C-b}
+Previous heading same level.
+
+@item @kbd{C-c C-u}
+Backward to higher level heading.
+@end table
+
+@node Structure Editing
+@section Structure Editing
+
+@table @asis
+@item @kbd{M-@key{RET}}
+Insert new heading with same level as current. If point is in
+a plain list item, a new item is created (see @ref{Plain Lists}). When
+this command is used in the middle of a line, the line is split and
+the rest of the line becomes the new headline@footnote{If you do not want the line to be split, customize the variable
+@code{org-M-RET-may-split-line}.}.
+
+@item @kbd{M-S-@key{RET}}
+Insert new TODO entry with same level as current heading.
+
+@item @kbd{@key{TAB}} in new
+@itemx empty entry
+In a new entry with no text yet, @kbd{@key{TAB}} cycles through
+reasonable levels.
+
+@item @kbd{M-@key{LEFT}}
+@itemx @kbd{M-@key{RIGHT}}
+Promote or demote current heading by one level.
+
+@item @kbd{M-@key{UP}}
+@itemx @kbd{M-@key{DOWN}}
+Move subtree up or down, i.e., swap with previous or next subtree of
+same level.
+
+@item @kbd{C-c C-w}
+Refile entry or region to a different location. See @ref{Refile and Copy}.
+
+@item @kbd{C-x n s}
+@itemx @kbd{C-x n w}
+Narrow buffer to current subtree and widen it again.
+@end table
+
+When there is an active region (Transient Mark mode), promotion and
+demotion work on all headlines in the region.
+
+@node Sparse Trees
+@section Sparse Trees
+
+An important feature of Org mode is the ability to construct @emph{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@footnote{See also the variable @code{org-show-context-detail} to decide how
+much context is shown around each match.}.
+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:
+
+@table @asis
+@item @kbd{C-c /}
+This prompts for an extra key to select a sparse-tree creating
+command.
+
+@item @kbd{C-c / r}
+Occur. Prompts for a regexp and shows a sparse tree with all
+matches. Each match is also highlighted; the highlights disappear
+by pressing @kbd{C-c C-c}.
+
+The other sparse tree commands select headings based on TODO
+keywords, tags, or properties and will be discussed later in this
+manual.
+@end table
+
+@node Plain Lists
+@section 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 @ref{Checkboxes}). Org supports editing such lists, and
+every exporter (see @ref{Exporting}) can parse and format them.
+
+Org knows ordered lists, unordered lists, and description lists.
+
+@itemize
+@item
+@emph{Unordered} list items start with @samp{-}, @samp{+}, or @samp{*} as bullets.
+
+@item
+@emph{Ordered} list items start with @samp{1.}, or @samp{1)}.
+
+@item
+@emph{Description} list use @samp{::} to separate the @emph{term} from the
+description.
+@end itemize
+
+Items belonging to the same list must have the same indentation on the
+first line. An item ends before the next line that is indented like
+its bullet/number, or less. A list ends when all items are closed, or
+before two blank lines. An example:
+
+@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.
+ Important actors in this film are:
+ - Elijah Wood :: He plays Frodo
+ - Sean Astin :: He plays Sam, Frodo's friend.
+@end example
+
+The following commands act on items when point is in the first line of
+an item (the line with the bullet or number).
+
+@table @asis
+@item @kbd{@key{TAB}}
+Items can be folded just like headline levels.
+
+@item @kbd{M-@key{RET}}
+Insert new item at current level. With a prefix argument, force
+a new heading (see @ref{Structure Editing}).
+
+@item @kbd{M-S-@key{RET}}
+Insert a new item with a checkbox (see @ref{Checkboxes}).
+
+@item @kbd{M-S-@key{UP}}
+@itemx @kbd{M-S-@key{DOWN}}
+Move the item including subitems up/down (swap with previous/next
+item of same indentation). If the list is ordered, renumbering is
+automatic.
+
+@item @kbd{M-@key{LEFT}}
+@itemx @kbd{M-@key{RIGHT}}
+Decrease/increase the indentation of an item, leaving children
+alone.
+
+@item @kbd{M-S-@key{LEFT}}
+@itemx @kbd{M-S-@key{RIGHT}}
+Decrease/increase the indentation of the item, including subitems.
+
+@item @kbd{C-c C-c}
+If there is a checkbox (see @ref{Checkboxes}) in the item line, toggle
+the state of the checkbox. Also verify bullets and indentation
+consistency in the whole list.
+
+@item @kbd{C-c -}
+Cycle the entire list level through the different itemize/enumerate
+bullets (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}).
+@end table
+
+@node Tables
+@chapter Tables
+
+Org comes with a fast and intuitive table editor. Spreadsheet-like
+calculations are supported in connection with the Emacs Calc package
+(see @ref{Top,GNU Emacs Calculator Manual,,calc,}).
+
+Org makes it easy to format tables in plain ASCII@. Any line with @samp{|}
+as the first non-whitespace character is considered part of a table.
+@samp{|} is also the column separator. A table might look like this:
+
+@example
+| Name | Phone | Age |
+|-------+-------+-----|
+| Peter | 1234 | 17 |
+| Anna | 4321 | 25 |
+@end example
+
+A table is re-aligned automatically each time you press @kbd{@key{TAB}}
+or @kbd{@key{RET}} or @kbd{C-c C-c} inside the table.
+@kbd{@key{TAB}} also moves to the next field (@kbd{@key{RET}} 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 @samp{|-} 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
+
+@example
+|Name|Phone|Age|
+|-
+@end example
+
+
+@noindent
+and then press @kbd{@key{TAB}} to align the table and start filling in
+fields. Even faster would be to type @samp{|Name|Phone|Age} followed by
+@kbd{C-c @key{RET}}.
+
+When typing text into a field, Org treats @kbd{DEL},
+@kbd{Backspace}, and all character keys in a special way, so that
+inserting and deleting avoids shifting other fields. Also, when
+typing @emph{immediately after point was moved into a new field with
+@kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the field is
+automatically made blank.
+
+@anchor{Creation and conversion}
+@heading Creation and conversion
+
+@table @asis
+@item @kbd{C-c |}
+Convert the active region to table. If every line contains at least
+one @kbd{@key{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.
+
+If there is no active region, this command creates an empty Org
+table. But it is easier just to start typing, like @kbd{| N a m e | P h o n e | A g e @key{RET} | - @key{TAB}}.
+@end table
+
+@anchor{Re-aligning and field motion}
+@heading Re-aligning and field motion
+
+@table @asis
+@item @kbd{C-c C-c}
+Re-align the table without moving point.
+
+@item @kbd{@key{TAB}}
+Re-align the table, move to the next field. Creates a new row if
+necessary.
+
+@item @kbd{S-@key{TAB}}
+Re-align, move to previous field.
+
+@item @kbd{@key{RET}}
+Re-align the table and move down to next row. Creates a new row if
+necessary.
+
+@item @kbd{S-@key{UP}}
+@itemx @kbd{S-@key{DOWN}}
+@itemx @kbd{S-@key{LEFT}}
+@itemx @kbd{S-@key{RIGHT}}
+Move a cell up, down, left, and right by swapping with adjacent
+cell.
+@end table
+
+@anchor{Column and row editing}
+@heading Column and row editing
+
+@table @asis
+@item @kbd{M-@key{LEFT}}, @kbd{M-@key{RIGHT}}
+Move the current column left/right.
+
+@item @kbd{M-S-@key{LEFT}}
+Kill the current column.
+
+@item @kbd{M-S-@key{RIGHT}}
+Insert a new column to the left of point position.
+
+@item @kbd{M-@key{UP}}, @kbd{M-@key{DOWN}}
+Move the current row up/down.
+
+@item @kbd{M-S-@key{UP}}
+Kill the current row or horizontal line.
+
+@item @kbd{M-S-@key{DOWN}}
+Insert a new row above the current row. With a prefix argument, the
+line is created below the current one.
+
+@item @kbd{C-c -}
+Insert a horizontal line below current row. With a prefix argument,
+the line is created above the current line.
+
+@item @kbd{C-c @key{RET}}
+Insert a horizontal line below current row, and move the point into
+the row below that line.
+
+@item @kbd{C-c ^}
+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.
+@end table
+
+@node Hyperlinks
+@chapter Hyperlinks
+
+Like HTML, Org provides links inside a file, external links to other
+files, Usenet articles, emails, and much more.
+
+Org recognizes plain URIs, possibly wrapped within angle brackets, and
+activate them as clickable links. The general link format, however,
+looks like this:
+
+@example
+[[LINK][DESCRIPTION]]
+@end example
+
+
+@noindent
+or alternatively
+
+@example
+[[LINK]]
+@end example
+
+
+Once a link in the buffer is complete, with all brackets present, Org
+changes the display so that @samp{DESCRIPTION} is displayed instead of
+@samp{[[LINK][DESCRIPTION]]} and @samp{LINK} is displayed instead of @samp{[[LINK]]}.
+To edit the invisible @var{LINK} part, use @kbd{C-c C-l}
+with the point on the link.
+
+@anchor{Internal links}
+@heading 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
+@samp{[[#my-custom-id]]} which links to the entry with the @samp{CUSTOM_ID} property
+@samp{my-custom-id}.
+
+Links such as @samp{[[My Target]]} or @samp{[[My Target][Find my target]]} lead
+to a text search in the current file for the corresponding target,
+which looks like @samp{<<My Target>>}.
+
+@anchor{External Links}
+@heading 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. Here are some examples:
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{http://www.astro.uva.nl/=dominik}
+@tab on the web
+@item @samp{file:/home/dominik/images/jupiter.jpg}
+@tab file, absolute path
+@item @samp{/home/dominik/images/jupiter.jpg}
+@tab same as above
+@item @samp{file:papers/last.pdf}
+@tab file, relative path
+@item @samp{./papers/last.pdf}
+@tab same as above
+@item @samp{file:projects.org}
+@tab another Org file
+@item @samp{docview:papers/last.pdf::NNN}
+@tab open in DocView mode at page @var{NNN}
+@item @samp{id:B7423F4D-2E8A-471B-8810-C40F074717E9}
+@tab link to heading by ID
+@item @samp{news:comp.emacs}
+@tab Usenet link
+@item @samp{mailto:adent@@galaxy.net}
+@tab mail link
+@item @samp{mhe:folder#id}
+@tab MH-E message link
+@item @samp{rmail:folder#id}
+@tab Rmail message link
+@item @samp{gnus:group#id}
+@tab Gnus article link
+@item @samp{bbdb:R.*Stallman}
+@tab BBDB link (with regexp)
+@item @samp{irc:/irc.com/#emacs/bob}
+@tab IRC link
+@item @samp{info:org#Hyperlinks}
+@tab Info node link
+@end multitable
+
+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. Here are a few
+examples,, together with an explanation:
+
+@multitable {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{file:~/code/main.c::255}
+@tab Find line 255
+@item @samp{file:~/xx.org::My Target}
+@tab Find @samp{<<My Target>>}
+@item @samp{[[file:~/xx.org::#my-custom-id]]}
+@tab Find entry with a custom ID
+@end multitable
+
+@anchor{Handling Links}
+@heading 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 @code{org-store-link}, called with @kbd{M-x org-store-link}. Because of its importance, we suggest to bind it
+to a widely available key (see @ref{Activation}). It stores a link to the
+current location. The link is stored for later insertion into an Org
+buffer---see below.
+
+From an Org buffer, the following commands create, navigate or, more
+generally, act on links.
+
+@table @asis
+@item @kbd{C-c C-l}
+Insert a link. This prompts for a link to be inserted into the
+buffer. You can just type a link, or use history keys @kbd{@key{UP}}
+and @kbd{@key{DOWN}} to access stored links. You will be prompted
+for the description part of the link.
+
+When called with a @kbd{C-u} prefix argument, file name
+completion is used to link to a file.
+
+@item @kbd{C-c C-l} (with point on existing link)
+When point is on an existing link, @kbd{C-c C-l} allows you to
+edit the link and description parts of the link.
+
+@item @kbd{C-c C-o}
+Open link at point.
+
+@item @kbd{C-c &}
+Jump back to a recorded position. A position is recorded by the
+commands following internal links, and by @kbd{C-c %}. Using
+this command several times in direct succession moves through a ring
+of previously recorded positions.
+@end table
+
+@node TODO Items
+@chapter TODO Items
+
+Org mode does not require TODO lists to live in separate documents.
+Instead, TODO items are part of a 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 TODO items remain in the context from which they
+emerged.
+
+Org mode provides methods to give you an overview of all the things
+that you have to do, collected from many files.
+
+@menu
+* TODO Basics:: Marking and displaying TODO entries.
+* Multi-state Workflow:: More than just on/off.
+* 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.
+@end menu
+
+@node TODO Basics
+@section Basic TODO Functionality
+
+Any headline becomes a TODO item when it starts with the word @samp{TODO},
+for example:
+
+@example
+*** TODO Write letter to Sam Fortune
+@end example
+
+
+The most important commands to work with TODO entries are:
+
+@table @asis
+@item @kbd{C-c C-t}
+Rotate the TODO state of the current item among
+
+@example
+,-> (unmarked) -> TODO -> DONE --.
+'--------------------------------'
+@end example
+
+
+The same rotation can also be done ``remotely'' from the agenda buffer
+with the @kbd{t} command key (see @ref{Agenda Commands}).
+
+@item @kbd{S-@key{RIGHT}}
+@itemx @kbd{S-@key{LEFT}}
+Select the following/preceding TODO state, similar to cycling.
+
+@item @kbd{C-c / t}
+View TODO items in a @emph{sparse tree} (see @ref{Sparse Trees}). Folds the
+entire buffer, but shows all TODO items---with not-DONE state---and
+the headings hierarchy above them.
+
+@item @kbd{M-x org-agenda t}
+Show the global TODO list. Collects the TODO items (with not-DONE
+states) from all agenda files (see @ref{Agenda Views}) into a single
+buffer. See @ref{Global TODO List}, for more information.
+
+@item @kbd{S-M-@key{RET}}
+Insert a new TODO entry below the current one.
+@end table
+
+Changing a TODO state can also trigger tag changes. See the docstring
+of the option @code{org-todo-state-tags-triggers} for details.
+
+@node Multi-state Workflow
+@section Multi-state Workflow
+
+You can use TODO keywords to indicate @@emph@{sequential@} working progress
+states:
+
+@lisp
+(setq org-todo-keywords
+ '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
+@end lisp
+
+@noindent
+The vertical bar separates the @samp{TODO} keywords (states that @emph{need
+action}) from the @samp{DONE} states (which need @emph{no further action}). If
+you do not provide the separator bar, the last state is used as the
+@samp{DONE} state. With this setup, the command @kbd{C-c C-t} cycles
+an entry from @samp{TODO} to @samp{FEEDBACK}, then to @samp{VERIFY}, and finally to
+@samp{DONE} and @samp{DELEGATED}.
+
+Sometimes you may want to use different sets of TODO keywords in
+parallel. For example, you may want to have the basic @samp{TODO=/=DONE},
+but also a workflow for bug fixing. Your setup would then look like
+this:
+
+@lisp
+(setq org-todo-keywords
+ '((sequence "TODO(t)" "|" "DONE(d)")
+ (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")))
+@end lisp
+
+@noindent
+The keywords should all be different, this helps Org mode to keep
+track of which subsequence should be used for a given entry. The
+example also shows how to define keys for fast access of a particular
+state, by adding a letter in parenthesis after each keyword---you will
+be prompted for the key after @kbd{C-c C-t}.
+
+To define TODO keywords that are valid only in a single file, use the
+following text anywhere in the file.
+
+@example
+#+TODO: TODO(t) | DONE(d)
+#+TODO: REPORT(r) BUG(b) KNOWNCAUSE(k) | FIXED(f)
+#+TODO: | CANCELED(c)
+@end example
+
+After changing one of these lines, use @kbd{C-c C-c} with the
+cursor still in the line to make the changes known to Org mode.
+
+@node Progress Logging
+@section Progress Logging
+
+To record a timestamp and a note when changing a TODO state, call the
+command @code{org-todo} with a prefix argument.
+
+@table @asis
+@item @kbd{C-u C-c C-t}
+Prompt for a note and record a the time of the TODO state change.
+@end table
+
+Org mode can also 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 @ref{Clocking Work Time}.
+
+@anchor{Closing items}
+@subheading Closing items
+
+The most basic logging is to keep track of @emph{when} a certain TODO item
+was marked as done. This can be achieved with@footnote{The corresponding in-buffer setting is @samp{#+STARTUP: logdone}.}
+
+@lisp
+(setq org-log-done 'time)
+@end lisp
+
+@noindent
+Then each time you turn an entry from a TODO (not-done) state into any
+of the DONE states, a line @samp{CLOSED: [timestamp]} is inserted just
+after the headline.
+
+If you want to record a note along with the timestamp, use@footnote{The corresponding in-buffer setting is @samp{#+STARTUP:
+logenotedone}.}
+
+@lisp
+(setq org-log-done 'note)
+@end lisp
+
+@noindent
+You are then be prompted for a note, and that note is stored below the
+entry with a @samp{Closing Note} heading.
+
+@anchor{Tracking TODO state changes}
+@subheading Tracking TODO state changes
+
+You might want to keep track of TODO state changes. You can either
+record just a timestamp, or a time-stamped note for a change. These
+records are inserted after the headline as an itemized list. When
+taking a lot of notes, you might want to get the notes out of the way
+into a drawer. Customize the variable @code{org-log-into-drawer} to get
+this behavior.
+
+For state logging, Org mode expects configuration on a per-keyword
+basis. This is achieved by adding special markers @samp{!} (for
+a timestamp) and @samp{@@} (for a note) in parentheses after each keyword.
+For example:
+
+@example
+#+TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
+@end example
+
+
+@noindent
+defines TODO keywords and fast access keys, and also request that
+a time is recorded when the entry is set to @samp{DONE}, and that a note is
+recorded when switching to @samp{WAIT} or @samp{CANCELED}. The same syntax
+works also when setting @code{org-todo-keywords}.
+
+@node Priorities
+@section 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 @emph{priority cookie} into the headline of a TODO item,
+like this
+
+@example
+*** TODO [#A] Write letter to Sam Fortune
+@end example
+
+
+Org mode supports three priorities: @samp{A}, @samp{B}, and @samp{C}. @samp{A} is the
+highest, @samp{B} the default if none is given. Priorities make
+a difference only in the agenda.
+
+@table @asis
+@item @kbd{C-c ,}
+Set the priority of the current headline. Press @kbd{A},
+@kbd{B} or @kbd{C} to select a priority, or @kbd{@key{SPC}}
+to remove the cookie.
+
+@item @kbd{S-@key{UP}} (@code{org-priority-up})
+@itemx @kbd{S-@key{DOWN}} (@code{org-priority-down})
+Increase/decrease the priority of the current headline.
+@end table
+
+@node Breaking Down Tasks
+@section 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. To keep an
+overview of the fraction of subtasks that have already been marked
+as done, insert either @samp{[/]} or @samp{[%]} anywhere in the headline. These
+cookies are updated each time the TODO status of a child changes, or
+when pressing @kbd{C-c C-c} on the cookie. For example:
+
+@example
+* Organize Party [33%]
+** TODO Call people [1/2]
+*** TODO Peter
+*** DONE Sarah
+** TODO Buy food
+** DONE Talk to neighbor
+@end example
+
+@node Checkboxes
+@section Checkboxes
+
+Every item in a plain list (see @ref{Plain Lists}) can be made into
+a checkbox by starting it with the string @samp{[ ]}. Checkboxes are not
+included into the global TODO list, so they are often great to split
+a task into a number of simple steps.
+
+Here is an example of a checkbox list.
+
+@example
+* TODO Organize party [2/4]
+ - [-] call people [1/2]
+ - [ ] Peter
+ - [X] Sarah
+ - [X] order food
+@end example
+
+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 following commands work with checkboxes:
+
+@table @asis
+@item @kbd{C-c C-c}
+Toggle checkbox status or---with prefix argument---checkbox presence
+at point.
+
+@item @kbd{M-S-@key{RET}}
+Insert a new item with a checkbox. This works only if point is
+already in a plain list item (see @ref{Plain Lists}).
+@end table
+
+@node Tags
+@chapter Tags
+
+An excellent way to implement labels and contexts for
+cross-correlating information is to assign @emph{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, @samp{_},
+and @samp{@@}. Tags must be preceded and followed by a single colon, e.g.,
+@samp{:work:}. Several tags can be specified, as in @samp{:work:urgent:}. Tags
+by default are in bold face with the same color as the headline.
+
+@anchor{Tag inheritance}
+@heading 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
+
+@example
+* Meeting with the French group :work:
+** Summary by Frank :boss:notes:
+*** TODO Prepare slides for him :action:
+@end example
+
+@noindent
+the final heading has the tags @samp{work}, @samp{boss}, @samp{notes}, and @samp{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@footnote{As with all these in-buffer settings, pressing @kbd{C-c C-c} activates any changes in the line.}:
+
+@example
+#+FILETAGS: :Peter:Boss:Secret:
+@end example
+
+@anchor{Setting tags}
+@heading Setting tags
+
+Tags can simply be typed into the buffer at the end of a headline.
+After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
+also a special command for inserting tags:
+
+@table @asis
+@item @kbd{C-c C-q}
+Enter new tags for the current headline. Org mode either offers
+completion or a special single-key interface for setting tags, see
+below.
+
+@item @kbd{C-c C-c}
+When point is in a headline, this does the same as @kbd{C-c C-q}.
+@end table
+
+Org supports tag insertion based on a @emph{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 @code{org-tag-alist}. Finally you can set the default tags
+for a given file using the @samp{TAGS} keyword, like
+
+@example
+#+TAGS: @@work @@home @@tennisclub
+#+TAGS: laptop car pc sailboat
+@end example
+
+
+By default Org mode uses the standard minibuffer completion facilities
+for entering tags. However, it also implements another, quicker, tag
+selection method called @emph{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
+@code{org-tag-alist} in your Emacs init file. For example, you may find
+the need to tag many items in different files with @samp{@@home}. In this
+case you can set something like:
+
+@lisp
+(setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
+@end lisp
+
+If the tag is only relevant to the file you are working on, then you
+can instead set the @samp{TAGS} keyword as:
+
+@example
+#+TAGS: @@work(w) @@home(h) @@tennisclub(t) laptop(l) pc(p)
+@end example
+
+@anchor{Tag groups}
+@heading Tag groups
+
+A tag can be defined as a @emph{group tag} for a set of other tags. The
+group tag can be seen as the ``broader term'' for its set of tags.
+
+You can set group tags by using brackets and inserting a colon between
+the group tag and its related tags:
+
+@example
+#+TAGS: [ GTD : Control Persp ]
+@end example
+
+
+@noindent
+or, if tags in the group should be mutually exclusive:
+
+@example
+#+TAGS: @{ Context : @@Home @@Work @}
+@end example
+
+
+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.
+
+If you want to ignore group tags temporarily, toggle group tags
+support with @code{org-toggle-tags-groups}, bound to @kbd{C-c C-x q}.
+
+@anchor{Tag searches}
+@heading Tag searches
+
+@table @asis
+@item @kbd{C-c / m} or @kbd{C-c \}
+Create a sparse tree with all headlines matching a tags search.
+With a @kbd{C-u} prefix argument, ignore headlines that are not
+a TODO line.
+
+@item @kbd{M-x org-agenda m}
+Create a global list of tag matches from all agenda files. See
+@ref{Matching Tags and Properties}.
+
+@item @kbd{M-x org-agenda M}
+Create a global list of tag matches from all agenda files, but check
+only TODO items and force checking subitems (see the option
+@code{org-tags-match-list-sublevels}).
+@end table
+
+These commands all prompt for a match string which allows basic
+Boolean logic like @samp{+boss+urgent-project1}, to find entries with tags
+@samp{boss} and @samp{urgent}, but not @samp{project1}, or @samp{Kathy|Sally} to find
+entries which are tagged, like @samp{Kathy} or @samp{Sally}. The full syntax of
+the search string is rich and allows also matching against TODO
+keywords, entry levels and properties. For a more detailed description
+with many examples, see @ref{Matching Tags and Properties}.
+
+@node Properties
+@chapter Properties
+
+Properties are key-value pairs associated with an entry. They live in
+a special drawer with the name @samp{PROPERTIES}. Each property is
+specified on a single line, with the key (surrounded by colons) first,
+and the value after it:
+
+@example
+* CD collection
+** Classic
+*** Goldberg Variations
+ :PROPERTIES:
+ :Title: Goldberg Variations
+ :Composer: J.S. Bach
+ :Publisher: Deutsche Grammophon
+ :NDisks: 1
+ :END:
+@end example
+
+You may define the allowed values for a particular property @samp{Xyz} by
+setting a property @samp{Xyz_ALL}. This special property is @emph{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:
+
+@example
+* CD collection
+ :PROPERTIES:
+ :NDisks_ALL: 1 2 3 4
+ :Publisher_ALL: "Deutsche Grammophon" Philips EMI
+ :END:
+@end example
+
+If you want to set properties that can be inherited by any entry in
+a file, use a line like:
+
+@example
+#+PROPERTY: NDisks_ALL 1 2 3 4
+@end example
+
+
+The following commands help to work with properties:
+
+@table @asis
+@item @kbd{C-c C-x p}
+Set a property. This prompts for a property name and a value.
+
+@item @kbd{C-c C-c d}
+Remove a property from the current entry.
+@end table
+
+To create sparse trees and special lists with selection based on
+properties, the same commands are used as for tag searches (see
+@ref{Tags}). The syntax for the search string is described in @ref{Matching Tags and Properties}.
+
+@node Dates and Times
+@chapter 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 @emph{timestamp} in Org mode.
+
+@menu
+* Timestamps:: Assigning a time to a tree entry.
+* Creating Timestamps:: Commands that insert timestamps.
+* Deadlines and Scheduling:: Planning your work.
+* Clocking Work Time:: Tracking how long you spent on a task.
+@end menu
+
+@node Timestamps
+@section Timestamps
+
+A timestamp is a specification of a date---possibly with a time or
+a range of times---in a special format, either @samp{<2003-09-16 Tue>} or
+@samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue 12:00-12:30>}.
+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 [BROKEN LINK: *The Weekly/daily Agenda]). We distinguish:
+
+@table @asis
+@item 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.
+
+@example
+* Meet Peter at the movies
+ <2006-11-01 Wed 19:15>
+* Discussion on climate change
+ <2006-11-02 Thu 20:00-22:00>
+@end example
+
+@item Timestamp with repeater interval
+A timestamp may contain a @emph{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:
+
+@example
+* Pick up Sam at school
+ <2007-05-16 Wed 12:30 +1w>
+@end example
+
+@item Diary-style expression entries
+@cindex diary style timestamps
+@cindex sexp timestamps
+For more complex date specifications, Org mode supports using the
+special expression diary entries implemented in the Emacs Calendar
+package. For example, with optional time:
+
+@example
+* 22:00-23:00 The nerd meeting on every 2nd Thursday of the month
+ <%%(diary-float t 4 2)>
+@end example
+
+@item Time/Date range
+Two timestamps connected by @samp{--} denote a range.
+
+@example
+** Meeting in Amsterdam
+ <2004-08-23 Mon>--<2004-08-26 Thu>
+@end example
+
+@item 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 @emph{not} trigger an entry to show up in the agenda.
+
+@example
+* Gillian comes late for the fifth time
+ [2006-11-01 Wed]
+@end example
+@end table
+
+@node Creating Timestamps
+@section 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.
+
+@table @asis
+@item @kbd{C-c .}
+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. With
+a prefix argument, it also adds the current time.
+
+@item @kbd{C-c !}
+Like @kbd{C-c .}, but insert an inactive timestamp that does
+not cause an agenda entry.
+
+@item @kbd{S-@key{LEFT}}
+@itemx @kbd{S-@key{RIGHT}}
+Change date at point by one day.
+
+@item @kbd{S-@key{UP}}
+@itemx @kbd{S-@key{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 @samp{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.
+@end table
+
+
+When Org mode prompts for a date/time, it accepts any string
+containing some date and/or time information, and intelligently
+interprets the string, deriving defaults for unspecified information
+from the current date and time. You can also select a date in the
+pop-up calendar. See the manual for more information on how exactly
+the date/time prompt works.
+
+@node Deadlines and Scheduling
+@section Deadlines and Scheduling
+
+A timestamp may be preceded by special keywords to facilitate
+planning:
+
+@table @asis
+@item @kbd{C-c C-d}
+Insert @samp{DEADLINE} keyword along with a time stamp, in the line
+following the headline.
+
+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 @emph{today} carries a warning about the
+approaching or missed deadline, starting @code{org-deadline-warning-days}
+before the due date, and continuing until the entry is marked as
+done. An example:
+
+@example
+*** TODO write article about the Earth for the Guide
+ DEADLINE: <2004-02-29 Sun>
+ The editor in charge is [[bbdb:Ford Prefect]]
+@end example
+
+@item @kbd{C-c C-s}
+Insert @samp{SCHEDULED} keyword along with a stamp, in the line following
+the headline.
+
+Meaning: you are planning to start working on that task on the given
+date@footnote{This is quite different from what is normally understood by
+@emph{scheduling a meeting}, which is done in Org by just inserting a time
+stamp without keyword.}.
+
+The headline is listed under the given date@footnote{It will still be listed on that date after it has been marked
+as done. If you do not like this, set the variable
+@code{org-agenda-skip-scheduled-if-done}.}. In addition,
+a reminder that the scheduled date has passed is present in the
+compilation for @emph{today}, until the entry is marked as done, i.e.,
+the task is automatically forwarded until completed.
+
+@example
+*** TODO Call Trillian for a date on New Years Eve.
+ SCHEDULED: <2004-12-25 Sat>
+@end example
+@end table
+
+Some tasks need to be repeated again and again. Org mode helps to
+organize such tasks using a so-called repeater in a @samp{DEADLINE},
+@samp{SCHEDULED}, or plain timestamps. In the following example:
+
+@example
+** TODO Pay the rent
+ DEADLINE: <2005-10-01 Sat +1m>
+@end example
+
+@noindent
+the @samp{+1m} is a repeater; the intended interpretation is that the task
+has a deadline on @samp{<2005-10-01>} and repeats itself every (one) month
+starting from that time.
+
+@node Clocking Work Time
+@section Clocking Work Time
+
+Org mode allows you to clock the time you spend on specific tasks in
+a project.
+
+@table @asis
+@item @kbd{C-c C-x C-i}
+Start the clock on the current item (clock-in). This inserts the
+@samp{CLOCK} keyword together with a timestamp. When called with
+a @kbd{C-u} prefix argument, select the task from a list of
+recently clocked tasks.
+
+@item @kbd{C-c C-x C-o}
+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
+@samp{=>HH:MM}.
+
+@item @kbd{C-c C-x C-e}
+Update the effort estimate for the current clock task.
+
+@item @kbd{C-c C-x C-q}
+Cancel the current clock. This is useful if a clock was started by
+mistake, or if you ended up working on something else.
+
+@item @kbd{C-c C-x C-j}
+Jump to the headline of the currently clocked in task. With
+a @kbd{C-u} prefix argument, select the target task from a list
+of recently clocked tasks.
+@end table
+
+The @kbd{l} key may be used in the agenda (see [BROKEN LINK: *The Weekly/daily Agenda]) to show which tasks have been worked on or closed during
+a day.
+
+@node Capture Refile Archive
+@chapter 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 @emph{capture}. It also can
+store files related to a task (@emph{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.
+* Refile and Copy:: Moving/copying a tree from one place to another.
+* Archiving:: What to do with finished products.
+@end menu
+
+@node Capture
+@section Capture
+
+Capture lets you quickly store notes with little interruption of your
+work flow. You can define templates for new entries and associate
+them with different targets for storing notes.
+
+@anchor{Setting up capture}
+@subheading Setting up capture
+
+The following customization sets a default target@footnote{Using capture templates, you get finer control over capture
+locations. See @ref{Capture templates}.} file for notes.
+
+@lisp
+(setq org-default-notes-file (concat org-directory "/notes.org"))
+@end lisp
+
+You may also define a global key for capturing new material (see
+@ref{Activation}).
+
+@anchor{Using capture}
+@subheading Using capture
+
+@table @asis
+@item @kbd{M-x org-capture}
+Start a capture process, placing you into a narrowed indirect buffer
+to edit.
+
+@item @kbd{C-c C-c}
+Once you have finished entering information into the capture buffer,
+@kbd{C-c C-c} returns you to the window configuration before
+the capture process, so that you can resume your work without
+further distraction.
+
+@item @kbd{C-c C-w}
+Finalize the capture process by refiling the note to a different
+place (see @ref{Refile and Copy}).
+
+@item @kbd{C-c C-k}
+Abort the capture process and return to the previous state.
+@end table
+
+@anchor{Capture templates}
+@subheading Capture templates
+
+You can use templates for different types of capture items, and for
+different target locations. Say you would like to use one template to
+create general TODO entries, and you want to put these entries under
+the heading @samp{Tasks} in your file @samp{~/org/gtd.org}. Also, a date tree
+in the file @samp{journal.org} should capture journal entries. A possible
+configuration would look like:
+
+@lisp
+(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")))
+@end lisp
+
+If you then press @kbd{t} from the capture menu, Org will prepare
+the template for you like this:
+
+@example
+* TODO
+ [[file:LINK TO WHERE YOU INITIATED CAPTURE]]
+@end example
+
+
+@noindent
+During expansion of the template, special %-escapes@footnote{If you need one of these sequences literally, escape the @samp{%}
+with a backslash.} allow
+dynamic insertion of content. Here is a small selection of the
+possibilities, consult the manual for more.
+
+@multitable {aaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{%a}
+@tab annotation, normally the link created with @code{org-store-link}
+@item @samp{%i}
+@tab initial content, the region when capture is called with @kbd{C-u}
+@item @samp{%t}, @samp{%T}
+@tab timestamp, date only, or date and time
+@item @samp{%u}, @samp{%U}
+@tab like above, but inactive timestamps
+@item @samp{%?}
+@tab after completing the template, position point here
+@end multitable
+
+@node Refile and Copy
+@section 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:
+
+@table @asis
+@item @kbd{C-c C-w}
+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.
+
+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 @code{org-refile-targets} for
+details.
+
+@item @kbd{C-u C-c C-w}
+Use the refile interface to jump to a heading.
+
+@item @kbd{C-u C-u C-c C-w}
+Jump to the location where @code{org-refile} last moved a tree to.
+
+@item @kbd{C-c M-w}
+Copying works like refiling, except that the original note is not
+deleted.
+@end table
+
+@node Archiving
+@section 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.
+
+The most common archiving action is to move a project tree to another
+file, the archive file.
+
+@table @asis
+@item @kbd{C-c C-x C-a}
+Archive the current entry using the command specified in the
+variable @code{org-archive-default-command}.
+
+@item @kbd{C-c C-x C-s} or short @kbd{C-c $}
+Archive the subtree starting at point position to the location given
+by @code{org-archive-location}.
+@end table
+
+The default archive location is a file in the same directory as the
+current file, with the name derived by appending @samp{_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
+@code{org-archive-location}.
+
+There is also an in-buffer option for setting this variable, for
+example:
+
+@example
+#+ARCHIVE: %s_done::
+@end example
+
+@node Agenda Views
+@chapter 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.
+
+The extracted information is displayed in a special @emph{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. Remote editing from the agenda buffer means,
+for example, that you can change the dates of deadlines and
+appointments from the agenda buffer. For commands available in the
+Agenda buffer, see @ref{Agenda Commands}.
+
+@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?
+* 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.
+* Agenda Commands:: Remote editing of Org trees.
+* Custom Agenda Views:: Defining special searches and views.
+@end menu
+
+@node Agenda Files
+@section Agenda Files
+
+The information to be shown is normally collected from all @emph{agenda
+files}, the files listed in the variable @code{org-agenda-files}.
+
+@table @asis
+@item @kbd{C-c [}
+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.
+
+@item @kbd{C-c ]}
+Remove current file from the list of agenda files.
+
+@item @kbd{C-'}
+@itemx @kbd{C-,}
+Cycle through agenda file list, visiting one file after the other.
+@end table
+
+@node Agenda Dispatcher
+@section The Agenda Dispatcher
+
+The views are created through a dispatcher, accessible with @kbd{M-x org-agenda}, or, better, bound to a global key (see @ref{Activation}).
+It displays a menu from which an additional letter is required to
+execute a command. The dispatcher offers the following default
+commands:
+
+@table @asis
+@item @kbd{a}
+Create the calendar-like agenda (see [BROKEN LINK: *The Weekly/daily Agenda]).
+
+@item @kbd{t}
+@itemx @kbd{T}
+Create a list of all TODO items (see @ref{Global TODO List}).
+
+@item @kbd{m}
+@itemx @kbd{M}
+Create a list of headlines matching a given expression (see
+@ref{Matching Tags and Properties}).
+
+@item @kbd{s}
+@kindex s @r{(Agenda dispatcher)}
+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.
+@end table
+
+@node Built-in Agenda Views
+@section The Weekly/Daily Agenda
+
+The purpose of the weekly/daily @emph{agenda} is to act like a page of
+a paper agenda, showing all the tasks for the current week or day.
+
+@table @asis
+@item @kbd{M-x org-agenda a}
+Compile an agenda for the current week from a list of Org files.
+The agenda shows the entries for each day.
+@end table
+
+Org mode understands the syntax of the diary and allows you to use
+diary expression entries directly in Org files:
+
+@example
+* 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
+@end example
+
+Org can interact with Emacs appointments notification facility. To
+add the appointments of your agenda files, use the command
+@code{org-agenda-to-appt}.
+
+@node Global TODO List
+@section The Global TODO List
+
+The global TODO list contains all unfinished TODO items formatted and
+collected into a single place. Remote editing of TODO items lets you
+can change the state of a TODO entry with a single key press. For
+commands available in the TODO list, see @ref{Agenda Commands}.
+
+@table @asis
+@item @kbd{M-x org-agenda t}
+Show the global TODO list. This collects the TODO items from all
+agenda files (see @ref{Agenda Views}) into a single buffer.
+
+@item @kbd{M-x org-agenda T}
+Like the above, but allows selection of a specific TODO keyword.
+@end table
+
+@node Matching Tags and Properties
+@section Matching Tags and Properties
+
+If headlines in the agenda files are marked with @emph{tags} (see @ref{Tags}),
+or have properties (see @ref{Properties}), 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
+@kbd{C-c / m}.
+
+@table @asis
+@item @kbd{M-x org-agenda m}
+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 @samp{+work+urgent-withboss} or @samp{work|home}
+(see @ref{Tags}). If you often need a specific search, define a custom
+command for it (see @ref{Agenda Dispatcher}).
+
+@item @kbd{M-x org-agenda M}
+Like @kbd{m}, but only select headlines that are also TODO
+items.
+@end table
+
+A search string can use Boolean operators @samp{&} for AND and @samp{|} for OR@.
+@samp{&} binds more strongly than @samp{|}. Parentheses are currently not
+implemented. Each element in the search is either a tag, a regular
+expression matching tags, or an expression like @samp{PROPERTY OPERATOR
+VALUE} with a comparison operator, accessing a property value. Each
+element may be preceded by @samp{-} to select against it, and @samp{+} is
+syntactic sugar for positive selection. The AND operator @samp{&} is
+optional when @samp{+} or @samp{-} is present. Here are some examples, using
+only tags.
+
+@table @asis
+@item @samp{+work-boss}
+Select headlines tagged @samp{work}, but discard those also tagged
+@samp{boss}.
+
+@item @samp{work|laptop}
+Selects lines tagged @samp{work} or @samp{laptop}.
+
+@item @samp{work|laptop+night}
+Like before, but require the @samp{laptop} lines to be tagged also
+@samp{night}.
+@end table
+
+You may also test for properties at the same time as matching tags,
+see the manual for more information.
+
+@node Search View
+@section Search View
+
+This agenda view is a general text search facility for Org mode
+entries. It is particularly useful to find notes.
+
+@table @asis
+@item @kbd{M-x org-agenda s} (@code{org-search-view})
+@kindex s @r{(Agenda dispatcher)}
+@findex org-search-view
+This is a special search that lets you select entries by matching
+a substring or specific words using a boolean logic.
+@end table
+
+For example, the search string @samp{computer equipment} matches entries
+that contain @samp{computer equipment} as a substring.
+
+Search view can also search for specific keywords in the entry, using
+Boolean logic. The search string @samp{+computer
++wifi -ethernet -@{8\.11[bg]@}} matches note entries that contain the
+keywords @samp{computer} and @samp{wifi}, but not the keyword @samp{ethernet}, and
+which are also not matched by the regular expression @samp{8\.11[bg]},
+meaning to exclude both @samp{8.11b} and @samp{8.11g}.
+
+Note that in addition to the agenda files, this command also searches
+the files listed in @code{org-agenda-text-search-extra-files}.
+
+@node Agenda Commands
+@section 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. This is just a selection of the many commands, explore
+the agenda menu and the manual for a complete list.
+
+@anchor{Motion (1)}
+@subheading Motion
+
+@table @asis
+@item @kbd{n}
+Next line (same as @kbd{@key{DOWN}} and @kbd{C-n}).
+
+@item @kbd{p}
+Previous line (same as @kbd{@key{UP}} and @kbd{C-p}).
+@end table
+
+@anchor{View/Go to Org file}
+@subheading View/Go to Org file
+
+@table @asis
+@item @kbd{@key{SPC}}
+Display the original location of the item in another window.
+With a prefix argument, make sure that drawers stay folded.
+
+@item @kbd{@key{TAB}}
+Go to the original location of the item in another window.
+
+@item @kbd{@key{RET}}
+Go to the original location of the item and delete other windows.
+@end table
+
+@anchor{Change display}
+@subheading Change display
+
+@table @asis
+@item @kbd{o}
+Delete other windows.
+
+@item @kbd{v d} or short @kbd{d}
+Switch to day view.
+
+@item @kbd{v w} or short @kbd{w}
+Switch to week view.
+
+@item @kbd{f}
+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.
+
+@item @kbd{b}
+Go backward in time to display earlier dates.
+
+@item @kbd{.}
+Go to today.
+
+@item @kbd{j}
+Prompt for a date and go there.
+
+@item @kbd{v l} or @kbd{v L} or short @kbd{l}
+Toggle Logbook mode. In Logbook mode, entries that were marked as
+done while logging was on (see the variable @code{org-log-done}) are
+shown in the agenda, as are entries that have been clocked on that
+day. When called with a @kbd{C-u} prefix argument, show all
+possible logbook entries, including state changes.
+
+@item @kbd{r}
+@itemx @kbd{g}
+Recreate the agenda buffer, for example to reflect the changes after
+modification of the timestamps of items.
+
+@item @kbd{s}
+@kindex C-x C-s
+@findex org-save-all-org-buffers
+@kindex s
+Save all Org buffers in the current Emacs session, and also the
+locations of IDs.
+@end table
+
+@anchor{Remote editing}
+@subheading Remote editing
+
+@table @asis
+@item @kbd{0--9}
+Digit argument.
+
+@item @kbd{t}
+Change the TODO state of the item, both in the agenda and in the
+original Org file.
+
+@item @kbd{C-k}
+Delete the current agenda item along with the entire subtree
+belonging to it in the original Org file.
+
+@item @kbd{C-c C-w}
+Refile the entry at point.
+
+@item @kbd{a}
+Archive the subtree corresponding to the entry at point using the
+default archiving command set in @code{org-archive-default-command}.
+
+@item @kbd{$}
+Archive the subtree corresponding to the current headline.
+
+@item @kbd{C-c C-s}
+Schedule this item. With a prefix argument, remove the
+scheduling timestamp
+
+@item @kbd{C-c C-d}
+Set a deadline for this item. With a prefix argument, remove the
+deadline.
+
+@item @kbd{S-@key{RIGHT}}
+Change the timestamp associated with the current line by one day
+into the future.
+
+@item @kbd{S-@key{LEFT}}
+Change the timestamp associated with the current line by one day
+into the past.
+
+@item @kbd{I}
+Start the clock on the current item.
+
+@item @kbd{O}
+Stop the previously started clock.
+
+@item @kbd{X}
+Cancel the currently running clock.
+
+@item @kbd{J}
+Jump to the running clock in another window.
+@end table
+
+@anchor{Quit and exit}
+@subheading Quit and exit
+
+@table @asis
+@item @kbd{q}
+Quit agenda, remove the agenda buffer.
+
+@item @kbd{x}
+Exit agenda, remove the agenda buffer and all buffers loaded by
+Emacs for the compilation of the agenda.
+@end table
+
+@node Custom Agenda Views
+@section Custom Agenda Views
+
+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
+@code{org-agenda-custom-commands}. You can customize this variable, for
+example by pressing @kbd{C} from the agenda dispatcher (see @ref{Agenda Dispatcher}). You can also directly set it with Emacs Lisp in
+the Emacs init file. The following example contains all valid agenda
+views:
+
+@lisp
+(setq org-agenda-custom-commands
+ '(("w" todo "WAITING")
+ ("u" tags "+boss-urgent")
+ ("v" tags-todo "+boss-urgent")))
+@end lisp
+
+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 is just a single character. 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:
+
+@table @asis
+@item @kbd{w}
+as a global search for TODO entries with @samp{WAITING} as the TODO
+keyword.
+
+@item @kbd{u}
+as a global tags search for headlines tagged @samp{boss} but not
+@samp{urgent}.
+
+@item @kbd{v}
+The same search, but limiting it to headlines that are also TODO
+items.
+@end table
+
+@node Markup
+@chapter 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. Used in
+conjunction with the export framework (see @ref{Exporting}), you can author
+beautiful documents in Org.
+
+@menu
+* Paragraphs:: The basic unit of text.
+* Emphasis and Monospace:: Bold, italic, etc.
+* Embedded @LaTeX{}:: LaTeX can be freely used inside Org documents.
+* Literal examples:: Source code examples with special formatting.
+* Images:: Display an image.
+* Creating Footnotes:: Edit and read footnotes.
+@end menu
+
+@node Paragraphs
+@section Paragraphs
+
+Paragraphs are separated by at least one empty line. If you need to
+enforce a line break within a paragraph, use @samp{\\} 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.
+
+@example
+#+BEGIN_VERSE
+ Great clouds overhead
+ Tiny black birds rise and fall
+ Snow covers Emacs
+
+ ---AlexSchroeder
+#+END_VERSE
+@end example
+
+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:
+
+@example
+#+BEGIN_QUOTE
+Everything should be made as simple as possible,
+but not any simpler ---Albert Einstein
+#+END_QUOTE
+@end example
+
+If you would like to center some text, do it like this:
+
+@example
+#+BEGIN_CENTER
+Everything should be made as simple as possible, \\
+but not any simpler
+#+END_CENTER
+@end example
+
+@node Emphasis and Monospace
+@section Emphasis and Monospace
+
+You can make words @samp{*bold*}, @samp{/italic/}, @samp{_underlined_}, @samp{=verbatim=}
+and @samp{~code~}, and, if you must, @samp{+strike-through+}. Text in the code
+and verbatim string is not processed for Org specific syntax; it is
+exported verbatim.
+
+@node Embedded @LaTeX{}
+@section Embedded @LaTeX{}
+
+For scientific notes which need to be able to contain mathematical
+symbols and the occasional formula, Org mode supports embedding @LaTeX{}
+code into its files. You can directly use @TeX{}-like syntax for special
+symbols, enter formulas and entire @LaTeX{} environments.
+
+@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@}.
+
+\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@} \].
+@end example
+
+@node Literal examples
+@section 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.
+
+@example
+#+BEGIN_EXAMPLE
+ Some example from a text file.
+#+END_EXAMPLE
+@end example
+
+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:
+
+@example
+Here is an example
+ : Some example from a text file.
+@end example
+
+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.
+
+@example
+#+BEGIN_SRC emacs-lisp
+ (defun org-xor (a b)
+ "Exclusive or."
+ (if a (not b) b))
+ #+END_SRC
+@end example
+
+To edit the example in a special buffer supporting this language, use
+@kbd{C-c '} to both enter and leave the editing buffer.
+
+@node Images
+@section Images
+
+An image is a link to an image file that does not have a description
+part, for example
+
+@example
+./img/cat.jpg
+@end example
+
+
+If you wish to define a caption for the image and maybe a label for
+internal cross references (see @ref{Hyperlinks}), make sure that the
+link is on a line by itself and precede it with @samp{CAPTION} and @samp{NAME}
+keywords as follows:
+
+@example
+#+CAPTION: This is the caption for the next figure link (or table)
+#+NAME: fig:SED-HR4049
+[[./img/a.jpg]]
+@end example
+
+@node Creating Footnotes
+@section Creating Footnotes
+
+A footnote is defined in a paragraph that is started by a footnote
+marker in square brackets in column 0, no indentation allowed. The
+footnote reference is simply the marker in square brackets, inside
+text. For example:
+
+@example
+The Org homepage[fn:1] now looks a lot better than it used to.
+...
+[fn:1] The link is: https://orgmode.org
+@end example
+
+The following commands handle footnotes:
+
+@table @asis
+@item @kbd{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. When this
+command is called with a prefix argument, a menu of additional
+options including renumbering is offered.
+
+@item @kbd{C-c C-c}
+Jump between definition and reference.
+@end table
+
+@node Exporting
+@chapter Exporting
+
+Org can convert and export documents to a variety of other formats
+while retaining as much structure (see @ref{Document Structure}) and markup
+(see @ref{Markup}) as possible.
+
+@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.
+* Comment Lines:: What will not be exported.
+* ASCII/UTF-8 Export:: Exporting to flat files with encoding.
+* HTML Export:: Exporting to HTML.
+* @LaTeX{} Export:: Exporting to @LaTeX{} and processing to PDF.
+* iCalendar Export:: Exporting to iCalendar.
+@end menu
+
+@node The Export Dispatcher
+@section 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.
+
+@table @asis
+@item @kbd{C-c C-e}
+Invokes the export dispatcher interface.
+@end table
+
+Org exports the entire buffer by default. If the Org buffer has an
+active region, then Org exports just that region.
+
+@node Export Settings
+@section Export Settings
+
+The exporter recognizes special lines in the buffer which provide
+additional information. These lines may be put anywhere in the file:
+
+@example
+#+TITLE: I'm in the Mood for Org
+@end example
+
+
+Most proeminent export options include:
+
+@multitable {aaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{TITLE}
+@tab the title to be shown
+@item @samp{AUTHOR}
+@tab the author (default taken from @code{user-full-name})
+@item @samp{DATE}
+@tab a date, fixed, or an Org timestamp
+@item @samp{EMAIL}
+@tab email address (default from @code{user-mail-address})
+@item @samp{LANGUAGE}
+@tab language code, e.g., @samp{en}
+@end multitable
+
+Option keyword sets can be inserted from the export dispatcher (see
+@ref{The Export Dispatcher}) using the @samp{Insert template} command by
+pressing @kbd{#}.
+
+@node Table of Contents
+@section 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
+@code{org-export-with-toc} variable accordingly. You can achieve the same
+on a per file basis, using the following @samp{toc} item in @samp{OPTIONS}
+keyword:
+
+@example
+#+OPTIONS: toc:2 (only include two levels in TOC)
+#+OPTIONS: toc:nil (no default TOC at all)
+@end example
+
+Org normally inserts the table of contents directly before the first
+headline of the file.
+
+@node Include Files
+@section Include Files
+
+During export, you can include the content of another file. For
+example, to include your @samp{.emacs} file, you could use:
+
+@example
+#+INCLUDE: "~/.emacs" src emacs-lisp
+@end example
+
+
+@noindent
+The first parameter is the file name to include. The optional second
+parameter specifies the block type: @samp{example}, @samp{export} or @samp{src}. The
+optional third parameter specifies the source code language to use for
+formatting the contents. This is relevant to both @samp{export} and @samp{src}
+block types.
+
+You can visit the included file with @kbd{C-c '}.
+
+@node Comment Lines
+@section Comment Lines
+
+Lines starting with zero or more whitespace characters followed by one
+@samp{#} and a whitespace are treated as comments and, as such, are not
+exported.
+
+Likewise, regions surrounded by @samp{#+BEGIN_COMMENT} @dots{} @samp{#+END_COMMENT}
+are not exported.
+
+Finally, a @samp{COMMENT} keyword at the beginning of an entry, but after
+any other keyword or priority cookie, comments out the entire subtree.
+The command below helps changing the comment status of a headline.
+
+@table @asis
+@item @kbd{C-c ;}
+Toggle the @samp{COMMENT} keyword at the beginning of an entry.
+@end table
+
+@node ASCII/UTF-8 Export
+@section ASCII/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. UTF-8 export uses additional
+characters and symbols available in this encoding standards.
+
+@table @asis
+@item @kbd{C-c C-e t a}
+@itemx @kbd{C-c C-e t u}
+Export as an ASCII file with a @samp{.txt} extension. For @samp{myfile.org},
+Org exports to @samp{myfile.txt}, overwriting without warning. For
+@samp{myfile.txt}, Org exports to @samp{myfile.txt.txt} in order to prevent
+data loss.
+@end table
+
+@node HTML Export
+@section HTML Export
+
+Org mode contains an HTML exporter with extensive HTML formatting
+compatible with XHTML 1.0 strict standard.
+
+@table @asis
+@item @kbd{C-c C-e h h}
+Export as HTML file with a @samp{.html} extension. For @samp{myfile.org}, Org
+exports to @samp{myfile.html}, overwriting without warning. @kbd{C-c C-e h o} exports to HTML and opens it in a web browser.
+@end table
+
+The HTML export back-end transforms @samp{<} and @samp{>} to @samp{&lt;} and @samp{&gt;}.
+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:
+@samp{@@@@html:...@@@@}. For example:
+
+@example
+@@@@html:<b>@@@@bold text@@@@html:</b>@@@@
+@end example
+
+
+For larger raw HTML code blocks, use these HTML export code blocks:
+
+@example
+#+HTML: Literal HTML code for export
+
+#+BEGIN_EXPORT html
+ All lines between these markers are exported literally
+#+END_EXPORT
+@end example
+
+@node @LaTeX{} Export
+@section @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.
+
+By default, the @LaTeX{} output uses the @emph{article} class. You can change
+this by adding an option like @samp{#+LATEX_CLASS: myclass} in your file.
+The class must be listed in @code{org-latex-classes}.
+
+@table @asis
+@item @kbd{C-c C-e l l}
+Export to a @LaTeX{} file with a @samp{.tex} extension. For @samp{myfile.org},
+Org exports to @samp{myfile.tex}, overwriting without warning.
+
+@item @kbd{C-c C-e l p}
+Export as @LaTeX{} file and convert it to PDF file.
+
+@item @kbd{C-c C-e l o}
+Export as @LaTeX{} file and convert it to PDF, then open the PDF using
+the default viewer.
+@end table
+
+The @LaTeX{} export back-end can insert any arbitrary @LaTeX{} code, see
+@ref{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:
+
+@example
+Code embedded in-line @@@@latex:any arbitrary LaTeX code@@@@ in a paragraph.
+@end example
+
+
+Inserting as one or more keyword lines in the Org file:
+
+@example
+#+LATEX: any arbitrary LaTeX code
+@end example
+
+
+Inserting as an export block in the Org file, where the back-end
+exports any code between begin and end markers:
+
+@example
+#+BEGIN_EXPORT latex
+ any arbitrary LaTeX code
+#+END_EXPORT
+@end example
+
+@node iCalendar Export
+@section 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.
+
+@table @asis
+@item @kbd{C-c C-e c f}
+Create iCalendar entries from the current Org buffer and store them
+in the same directory, using a file extension @samp{.ics}.
+
+@item @kbd{C-c C-e c c}
+Create a combined iCalendar file from Org files in
+@code{org-agenda-files} and write it to
+@code{org-icalendar-combined-agenda-file} file name.
+@end table
+
+@node Publishing
+@chapter Publishing
+
+Org includes a publishing management system that allows you to
+configure automatic HTML conversion of @emph{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.
+
+For detailed instructions about setup, see the manual. Here is an
+example:
+
+@lisp
+(setq org-publish-project-alist
+ '(("org"
+ :base-directory "~/org/"
+ :publishing-function org-html-publish-to-html
+ :publishing-directory "~/public_html"
+ :section-numbers nil
+ :with-toc nil
+ :html-head "<link rel=\"stylesheet\"
+ href=\"../other/mystyle.css\"
+ type=\"text/css\"/>")))
+@end lisp
+
+@table @asis
+@item @kbd{C-c C-e P x}
+Prompt for a specific project and publish all files that belong to
+it.
+
+@item @kbd{C-c C-e P p}
+Publish the project containing the current file.
+
+@item @kbd{C-c C-e P f}
+Publish only the current file.
+
+@item @kbd{C-c C-e P a}
+Publish every project.
+@end table
+
+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.
+
+@node Working with Source Code
+@chapter Working with Source Code
+
+Org mode provides a number of features for working with source code,
+including editing of code blocks in their native major mode,
+evaluation of code blocks, tangling of code blocks, and exporting code
+blocks and their results in several formats.
+
+A source code block conforms to this structure:
+
+@example
+#+NAME: <name>
+#+BEGIN_SRC <language> <switches> <header arguments>
+ <body>
+#+END_SRC
+@end example
+
+@noindent
+where:
+
+@itemize
+@item
+@samp{<name>} is a string used to uniquely name the code block,
+
+@item
+@samp{<language>} specifies the language of the code block, e.g.,
+@samp{emacs-lisp}, @samp{shell}, @samp{R}, @samp{python}, etc.,
+
+@item
+@samp{<switches>} can be used to control export of the code block,
+
+@item
+@samp{<header arguments>} can be used to control many aspects of code
+block behavior as demonstrated below,
+
+@item
+@samp{<body>} contains the actual source code.
+@end itemize
+
+Use @kbd{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 @kbd{C-c '} again to close the buffer
+and return to the Org buffer.
+
+@anchor{Using header arguments}
+@heading Using header arguments
+
+A header argument is specified with an initial colon followed by the
+argument's name in lowercase.
+
+Header arguments can be set in several ways; Org prioritizes them in
+case of overlaps or conflicts by giving local settings a higher
+priority.
+
+@table @asis
+@item System-wide header arguments
+Those are specified by customizing @code{org-babel-default-header-args}
+variable, or, for a specific language @var{LANG}
+@code{org-babel-default-header-args:LANG}.
+
+@item Header arguments in properties
+You can set them using @samp{header-args} property (see @ref{Properties})---or
+@samp{header-args:LANG} for language @var{LANG}. Header arguments
+set through properties drawers apply at the sub-tree level on down.
+
+@item Header arguments in code blocks
+Header arguments are most commonly set at the source code block
+level, on the @samp{BEGIN_SRC} line:
+
+@example
+#+NAME: factorial
+#+BEGIN_SRC haskell :results silent :exports code :var n=0
+ fac 0 = 1
+ fac n = n * fac (n-1)
+#+END_SRC
+@end example
+
+Code block header arguments can span multiple lines using @samp{HEADER}
+keyword on each line.
+@end table
+
+@anchor{Evaluating code blocks}
+@heading Evaluating code blocks
+
+Use @kbd{C-c C-c} to evaluate the current code block and insert
+its results in the Org document. By default, evaluation is only
+turned on for @samp{emacs-lisp} code blocks, however support exists for
+evaluating blocks in many languages. For a complete list of supported
+languages see the manual. The following shows a code block and its
+results.
+
+@example
+#+BEGIN_SRC emacs-lisp
+ (+ 1 2 3 4)
+#+END_SRC
+
+#+RESULTS:
+: 10
+@end example
+
+The following syntax is used to pass arguments to code blocks using
+the @samp{var} header argument.
+
+@example
+:var NAME=ASSIGN
+@end example
+
+
+@noindent
+@var{NAME} is the name of the variable bound in the code block
+body. @var{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.
+
+@anchor{Results of evaluation}
+@heading 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 @samp{results} header argument. It controls the @emph{collection},
+@emph{type}, @emph{format}, and @emph{handling} of code block results.
+
+@table @asis
+@item Collection
+How the results should be collected from the code block. You may
+choose either @samp{output} or @samp{value} (the default).
+
+@item Type
+What result types to expect from the execution of the code block.
+You may choose among @samp{table}, @samp{list}, @samp{scalar}, and @samp{file}. Org
+tries to guess it if you do not provide it.
+
+@item Format
+How Org processes results. Some possible values are @samp{code},
+@samp{drawer}, @samp{html}, @samp{latex}, @samp{link}, and @samp{raw}.
+
+@item Handling
+How to insert the results once properly formatted. Allowed values
+are @samp{silent}, @samp{replace} (the default), @samp{append}, or @samp{prepend}.
+@end table
+
+Code blocks which output results to files---e.g.: graphs, diagrams and
+figures---can accept a @samp{:file FILENAME} header argument, in which case
+the results are saved to the named file, and a link to the file is
+inserted into the buffer.
+
+@anchor{Exporting code blocks}
+@heading Exporting code blocks
+
+It is possible to export the @emph{code} of code blocks, the @emph{results} of
+code block evaluation, @emph{both} the code and the results of code block
+evaluation, or @emph{none}. Org defaults to exporting @emph{code} for most
+languages.
+
+The @samp{exports} header argument is to specify if that part of the Org
+file is exported to, say, HTML or @LaTeX{} formats. It can be set to
+either @samp{code}, @samp{results}, @samp{both} or @samp{none}.
+
+@anchor{Extracting source code}
+@heading Extracting source code
+
+Use @kbd{C-c C-v t} to create pure source code files by
+extracting code from source blocks in the current buffer. This is
+referred to as ``tangling''---a term adopted from the literate
+programming community. During tangling of code blocks their bodies
+are expanded using @code{org-babel-expand-src-block}, which can expand both
+variable and ``Noweb'' style references. In order to tangle a code
+block it must have a @samp{tangle} header argument, see the manual for
+details.
+
+@node Miscellaneous
+@chapter Miscellaneous
+
+
+
+@anchor{Completion}
+@heading Completion
+
+Org has in-buffer completions with @kbd{M-@key{TAB}}. No minibuffer is
+involved. Type one or more letters and invoke the hot key to complete
+the text in-place.
+
+For example, this command will complete @TeX{} symbols after @samp{\}, TODO
+keywords at the beginning of a headline, and tags after @samp{:} in
+a headline.
+
+@anchor{Structure Templates}
+@heading Structure Templates
+
+To quickly insert empty structural blocks, such as @samp{#+BEGIN_SRC}
+@dots{} @samp{#+END_SRC}, or to wrap existing text in such a block, use
+
+@table @asis
+@item @kbd{C-c C-,}
+Prompt for a type of block structure, and insert the block at point.
+If the region is active, it is wrapped in the block.
+@end table
+
+@anchor{Clean view}
+@heading Clean view
+
+Org's default outline with stars and no indents can become too
+cluttered for short documents. For @emph{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:
+
+@example
+* 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
+@end example
+
+This kind of view can be achieved dynamically at display time using
+Org Indent mode (@kbd{M-x org-indent-mode @key{RET}}), which prepends
+intangible space to each line. You can turn on Org Indent mode for
+all files by customizing the variable @code{org-startup-indented}, or you
+can turn it on for individual files using
+
+@example
+#+STARTUP: indent
+@end example
+
+
+If you want the indentation to be hard space characters so that the
+plain text file looks as similar as possible to the Emacs display, Org
+supports you by helping to indent (with @kbd{@key{TAB}}) text below
+each headline, by hiding leading stars, and by only using levels 1, 3,
+etc to get two characters indentation for each level. To get this
+support in a file, use
+
+@example
+#+STARTUP: hidestars odd
+@end example
+
+@bye \ No newline at end of file
diff --git a/elpa/org-9.5.2/doc/pdflayout.sty b/elpa/org-9.5.2/doc/pdflayout.sty
new file mode 100644
index 0000000..7fb6afd
--- /dev/null
+++ b/elpa/org-9.5.2/doc/pdflayout.sty
@@ -0,0 +1,44 @@
+% Copyright (C) 2007-2013 Free Software Foundation, Inc.
+
+% 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 <https://www.gnu.org/licenses/>.
+
+% This file defines `\pdflayout':
+% - \pdflayout=(0) is A4 portrait,
+% - \pdflayout=(1) is letter (US) portrait,
+% - \pdflayout=(0l) is A4 landscape.
+% - \pdflayout=(1l) is letter (US) landscape,
+
+\input ifpdf.sty
+
+\ifpdf
+ \def\pdflayout=(#1#2){
+ \if0#1 % A4
+ \pdfpagewidth=21cm
+ \pdfpageheight=29.7cm
+ \else\if1#1 % Letter
+ \pdfpagewidth=8.5in
+ \pdfpageheight=11in
+ \letterpaper=1
+ \fi\fi
+ \if l#2 % Landscape
+ \edef\oldwidth{\the\pdfpagewidth}
+ \pdfpagewidth=\pdfpageheight
+ \pdfpageheight=\oldwidth
+ \fi
+ }
+\else
+ \def\pdflayout=(#1#2){}
+\fi
diff --git a/elpa/org-9.5.2/doc/texinfo.tex b/elpa/org-9.5.2/doc/texinfo.tex
new file mode 100644
index 0000000..f3c25b9
--- /dev/null
+++ b/elpa/org-9.5.2/doc/texinfo.tex
@@ -0,0 +1,10145 @@
+% texinfo.tex -- TeX macros to handle Texinfo files.
+%
+% Load plain if necessary, i.e., if running under initex.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{2013-09-11.11}
+%
+% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
+% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+%
+% This texinfo.tex file 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.
+%
+% This texinfo.tex file 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 this program. If not, see <https://www.gnu.org/licenses/>.
+%
+% As a special exception, when this file is read by TeX when processing
+% a Texinfo source document, you may use the result without
+% restriction. This Exception is an additional permission under section 7
+% of the GNU General Public License, version 3 ("GPLv3").
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+% https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
+% https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
+% https://www.gnu.org/software/texinfo/ (the Texinfo home page)
+% The texinfo.tex in any given distribution could well be out
+% of date, so if that's what you're using, please check.
+%
+% Send bug reports to bug-texinfo@gnu.org. Please include including a
+% complete document in each bug report with which we can reproduce the
+% problem. Patches are, of course, greatly appreciated.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution. For a simple
+% manual foo.texi, however, you can get away with this:
+% tex foo.texi
+% texindex foo.??
+% tex foo.texi
+% tex foo.texi
+% dvips foo.dvi -o # or whatever; this makes foo.ps.
+% The extra TeX runs get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+%
+% It is possible to adapt texinfo.tex for other languages, to some
+% extent. You can get the existing language-specific files from the
+% full Texinfo distribution.
+%
+% The GNU Texinfo home page is https://www.gnu.org/software/texinfo.
+
+
+\message{Loading texinfo [version \texinfoversion]:}
+
+% If in a .fmt file, print the version number
+% and turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+\everyjob{\message{[Texinfo version \texinfoversion]}%
+ \catcode`+=\active \catcode`\_=\active}
+
+\chardef\other=12
+
+% We never want plain's \outer definition of \+ in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+
+% Save some plain tex macros whose names we will redefine.
+\let\ptexb=\b
+\let\ptexbullet=\bullet
+\let\ptexc=\c
+\let\ptexcomma=\,
+\let\ptexdot=\.
+\let\ptexdots=\dots
+\let\ptexend=\end
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
+\let\ptexfootnote=\footnote
+\let\ptexgtr=>
+\let\ptexhat=^
+\let\ptexi=\i
+\let\ptexindent=\indent
+\let\ptexinsert=\insert
+\let\ptexlbrace=\{
+\let\ptexless=<
+\let\ptexnewwrite\newwrite
+\let\ptexnoindent=\noindent
+\let\ptexplus=+
+\let\ptexraggedright=\raggedright
+\let\ptexrbrace=\}
+\let\ptexslash=\/
+\let\ptexstar=\*
+\let\ptext=\t
+\let\ptextop=\top
+{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
+
+% If this character appears in an error message or help string, it
+% starts a new line in the output.
+\newlinechar = `^^J
+
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+ \let\linenumber = \empty % Pre-3.0.
+\else
+ \def\linenumber{l.\the\inputlineno:\space}
+\fi
+
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
+\ifx\putworderror\undefined \gdef\putworderror{error}\fi
+\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
+\ifx\putwordin\undefined \gdef\putwordin{in}\fi
+\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
+\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
+\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
+\ifx\putwordof\undefined \gdef\putwordof{of}\fi
+\ifx\putwordon\undefined \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
+\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
+\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
+%
+\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
+\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
+\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
+\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
+\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
+\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
+\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
+\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
+\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
+\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
+\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
+\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
+%
+\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
+\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
+\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
+\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
+\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
+
+% Since the category of space is not known, we have to be careful.
+\chardef\spacecat = 10
+\def\spaceisspace{\catcode`\ =\spacecat}
+
+% sometimes characters are active, so we need control sequences.
+\chardef\ampChar = `\&
+\chardef\colonChar = `\:
+\chardef\commaChar = `\,
+\chardef\dashChar = `\-
+\chardef\dotChar = `\.
+\chardef\exclamChar= `\!
+\chardef\hashChar = `\#
+\chardef\lquoteChar= `\`
+\chardef\questChar = `\?
+\chardef\rquoteChar= `\'
+\chardef\semiChar = `\;
+\chardef\slashChar = `\/
+\chardef\underChar = `\_
+
+% Ignore a token.
+%
+\def\gobble#1{}
+
+% The following is used inside several \edef's.
+\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
+
+% Hyphenation fixes.
+\hyphenation{
+ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
+ ap-pen-dix bit-map bit-maps
+ data-base data-bases eshell fall-ing half-way long-est man-u-script
+ man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
+ par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
+ spell-ing spell-ings
+ stand-alone strong-est time-stamp time-stamps which-ever white-space
+ wide-spread wrap-around
+}
+
+% Margin to add to right of even pages, to left of odd pages.
+\newdimen\bindingoffset
+\newdimen\normaloffset
+\newdimen\pagewidth \newdimen\pageheight
+
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt }
+
+% Sometimes it is convenient to have everything in the transcript file
+% and nothing on the terminal. We don't just call \tracingall here,
+% since that produces some useless output on the terminal. We also make
+% some effort to order the tracing commands to reduce output in the log
+% file; cf. trace.sty in LaTeX.
+%
+\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\def\loggingall{%
+ \tracingstats2
+ \tracingpages1
+ \tracinglostchars2 % 2 gives us more in etex
+ \tracingparagraphs1
+ \tracingoutput1
+ \tracingmacros2
+ \tracingrestores1
+ \showboxbreadth\maxdimen \showboxdepth\maxdimen
+ \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
+ \tracingscantokens1
+ \tracingifs1
+ \tracinggroups1
+ \tracingnesting2
+ \tracingassigns1
+ \fi
+ \tracingcommands3 % 3 gives us more in etex
+ \errorcontextlines16
+}%
+
+% @errormsg{MSG}. Do the index-like expansions on MSG, but if things
+% aren't perfect, it's not the end of the world, being an error message,
+% after all.
+%
+\def\errormsg{\begingroup \indexnofonts \doerrormsg}
+\def\doerrormsg#1{\errmessage{#1}}
+
+% add check for \lastpenalty to plain's definitions. If the last thing
+% we did was a \nobreak, we don't want to insert more space.
+%
+\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
+ \removelastskip\penalty-50\smallskip\fi\fi}
+\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
+ \removelastskip\penalty-100\medskip\fi\fi}
+\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
+ \removelastskip\penalty-200\bigskip\fi\fi}
+
+% Do @cropmarks to get crop marks.
+%
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
+%
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
+%
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
+
+% Output a mark which sets \thischapter, \thissection and \thiscolor.
+% We dump everything together because we only have one kind of mark.
+% This works because we only use \botmark / \topmark, not \firstmark.
+%
+% A mark contains a subexpression of the \ifcase ... \fi construct.
+% \get*marks macros below extract the needed part using \ifcase.
+%
+% Another complication is to let the user choose whether \thischapter
+% (\thissection) refers to the chapter (section) in effect at the top
+% of a page, or that at the bottom of a page. The solution is
+% described on page 260 of The TeXbook. It involves outputting two
+% marks for the sectioning macros, one before the section break, and
+% one after. I won't pretend I can describe this better than DEK...
+\def\domark{%
+ \toks0=\expandafter{\lastchapterdefs}%
+ \toks2=\expandafter{\lastsectiondefs}%
+ \toks4=\expandafter{\prevchapterdefs}%
+ \toks6=\expandafter{\prevsectiondefs}%
+ \toks8=\expandafter{\lastcolordefs}%
+ \mark{%
+ \the\toks0 \the\toks2 % 0: top marks (\last...)
+ \noexpand\or \the\toks4 \the\toks6 % 1: bottom marks (default, \prev...)
+ \noexpand\else \the\toks8 % 2: color marks
+ }%
+}
+% \topmark doesn't work for the very first chapter (after the title
+% page or the contents), so we use \firstmark there -- this gets us
+% the mark with the chapter defs, unless the user sneaks in, e.g.,
+% @setcolor (or @url, or @link, etc.) between @contents and the very
+% first @chapter.
+\def\gettopheadingmarks{%
+ \ifcase0\topmark\fi
+ \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
+}
+\def\getbottomheadingmarks{\ifcase1\botmark\fi}
+\def\getcolormarks{\ifcase2\topmark\fi}
+
+% Avoid "undefined control sequence" errors.
+\def\lastchapterdefs{}
+\def\lastsectiondefs{}
+\def\prevchapterdefs{}
+\def\prevsectiondefs{}
+\def\lastcolordefs{}
+
+% Main output routine.
+\chardef\PAGE = 255
+\output = {\onepageout{\pagecontents\PAGE}}
+
+\newbox\headlinebox
+\newbox\footlinebox
+
+% \onepageout takes a vbox as an argument. Note that \pagecontents
+% does insertions, but you have to call it yourself.
+\def\onepageout#1{%
+ \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+ %
+ \ifodd\pageno \advance\hoffset by \bindingoffset
+ \else \advance\hoffset by -\bindingoffset\fi
+ %
+ % Do this outside of the \shipout so @code etc. will be expanded in
+ % the headline as they should be, not taken literally (outputting ''code).
+ \def\commmonheadfootline{\let\hsize=\pagewidth \texinfochars}
+ %
+ \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
+ \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}%
+ %
+ \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
+ \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}%
+ %
+ {%
+ % Have to do this stuff outside the \shipout because we want it to
+ % take effect in \write's, yet the group defined by the \vbox ends
+ % before the \shipout runs.
+ %
+ \indexdummies % don't expand commands in the output.
+ \normalturnoffactive % \ in index entries must not stay \, e.g., if
+ % the page break happens to be in the middle of an example.
+ % We don't want .vr (or whatever) entries like this:
+ % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
+ % "\acronym" won't work when it's read back in;
+ % it needs to be
+ % {\code {{\tt \backslashcurfont }acronym}
+ \shipout\vbox{%
+ % Do this early so pdf references go to the beginning of the page.
+ \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
+ %
+ \ifcropmarks \vbox to \outervsize\bgroup
+ \hsize = \outerhsize
+ \vskip-\topandbottommargin
+ \vtop to0pt{%
+ \line{\ewtop\hfil\ewtop}%
+ \nointerlineskip
+ \line{%
+ \vbox{\moveleft\cornerthick\nstop}%
+ \hfill
+ \vbox{\moveright\cornerthick\nstop}%
+ }%
+ \vss}%
+ \vskip\topandbottommargin
+ \line\bgroup
+ \hfil % center the page within the outer (page) hsize.
+ \ifodd\pageno\hskip\bindingoffset\fi
+ \vbox\bgroup
+ \fi
+ %
+ \unvbox\headlinebox
+ \pagebody{#1}%
+ \ifdim\ht\footlinebox > 0pt
+ % Only leave this space if the footline is nonempty.
+ % (We lessened \vsize for it in \oddfootingyyy.)
+ % The \baselineskip=24pt in plain's \makefootline has no effect.
+ \vskip 24pt
+ \unvbox\footlinebox
+ \fi
+ %
+ \ifcropmarks
+ \egroup % end of \vbox\bgroup
+ \hfil\egroup % end of (centering) \line\bgroup
+ \vskip\topandbottommargin plus1fill minus1fill
+ \boxmaxdepth = \cornerthick
+ \vbox to0pt{\vss
+ \line{%
+ \vbox{\moveleft\cornerthick\nsbot}%
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}%
+ }%
+ \nointerlineskip
+ \line{\ewbot\hfil\ewbot}%
+ }%
+ \egroup % \vbox from first cropmarks clause
+ \fi
+ }% end of \shipout\vbox
+ }% end of group with \indexdummies
+ \advancepageno
+ \ifnum\outputpenalty>-20000 \else\dosupereject\fi
+}
+
+\newinsert\margin \dimen\margin=\maxdimen
+
+\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+{\catcode`\@ =11
+\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
+% marginal hacks, juha@viisa.uucp (Juha Takala)
+\ifvoid\margin\else % marginal info is present
+ \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
+\dimen@=\dp#1\relax \unvbox#1\relax
+\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
+\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
+}
+
+% Here are the rules for the cropmarks. Note that they are
+% offset so that the space between them is truly \outerhsize or \outervsize
+% (P. A. MacKay, 12 November, 1986)
+%
+\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
+\def\nstop{\vbox
+ {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
+\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
+\def\nsbot{\vbox
+ {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
+
+% Parse an argument, then pass it to #1. The argument is the rest of
+% the input line (except we remove a trailing comment). #1 should be a
+% macro which expects an ordinary undelimited TeX argument.
+%
+\def\parsearg{\parseargusing{}}
+\def\parseargusing#1#2{%
+ \def\argtorun{#2}%
+ \begingroup
+ \obeylines
+ \spaceisspace
+ #1%
+ \parseargline\empty% Insert the \empty token, see \finishparsearg below.
+}
+
+{\obeylines %
+ \gdef\parseargline#1^^M{%
+ \endgroup % End of the group started in \parsearg.
+ \argremovecomment #1\comment\ArgTerm%
+ }%
+}
+
+% First remove any @comment, then any @c comment.
+\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
+\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
+
+% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
+%
+% \argremovec might leave us with trailing space, e.g.,
+% @end itemize @c foo
+% This space token undergoes the same procedure and is eventually removed
+% by \finishparsearg.
+%
+\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
+\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
+\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
+ \def\temp{#3}%
+ \ifx\temp\empty
+ % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
+ \let\temp\finishparsearg
+ \else
+ \let\temp\argcheckspaces
+ \fi
+ % Put the space token in:
+ \temp#1 #3\ArgTerm
+}
+
+% If a _delimited_ argument is enclosed in braces, they get stripped; so
+% to get _exactly_ the rest of the line, we had to prevent such situation.
+% We prepended an \empty token at the very beginning and we expand it now,
+% just before passing the control to \argtorun.
+% (Similarly, we have to think about #3 of \argcheckspacesY above: it is
+% either the null string, or it ends with \^^M---thus there is no danger
+% that a pair of braces would be stripped.
+%
+% But first, we have to remove the trailing space token.
+%
+\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
+
+% \parseargdef\foo{...}
+% is roughly equivalent to
+% \def\foo{\parsearg\Xfoo}
+% \def\Xfoo#1{...}
+%
+% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
+% favourite TeX trick. --kasal, 16nov03
+
+\def\parseargdef#1{%
+ \expandafter \doparseargdef \csname\string#1\endcsname #1%
+}
+\def\doparseargdef#1#2{%
+ \def#2{\parsearg#1}%
+ \def#1##1%
+}
+
+% Several utility definitions with active space:
+{
+ \obeyspaces
+ \gdef\obeyedspace{ }
+
+ % Make each space character in the input produce a normal interword
+ % space in the output. Don't allow a line break at this space, as this
+ % is used only in environments like @example, where each line of input
+ % should produce a line of output anyway.
+ %
+ \gdef\sepspaces{\obeyspaces\let =\tie}
+
+ % If an index command is used in an @example environment, any spaces
+ % therein should become regular spaces in the raw index file, not the
+ % expansion of \tie (\leavevmode \penalty \@M \ ).
+ \gdef\unsepspaces{\let =\space}
+}
+
+
+\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
+
+% Define the framework for environments in texinfo.tex. It's used like this:
+%
+% \envdef\foo{...}
+% \def\Efoo{...}
+%
+% It's the responsibility of \envdef to insert \begingroup before the
+% actual body; @end closes the group after calling \Efoo. \envdef also
+% defines \thisenv, so the current environment is known; @end checks
+% whether the environment name matches. The \checkenv macro can also be
+% used to check whether the current environment is the one expected.
+%
+% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
+% are not treated as environments; they don't open a group. (The
+% implementation of @end takes care not to call \endgroup in this
+% special case.)
+
+
+% At run-time, environments start with this:
+\def\startenvironment#1{\begingroup\def\thisenv{#1}}
+% initialize
+\let\thisenv\empty
+
+% ... but they get defined via ``\envdef\foo{...}'':
+\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
+\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
+
+% Check whether we're in the right environment:
+\def\checkenv#1{%
+ \def\temp{#1}%
+ \ifx\thisenv\temp
+ \else
+ \badenverr
+ \fi
+}
+
+% Environment mismatch, #1 expected:
+\def\badenverr{%
+ \errhelp = \EMsimple
+ \errmessage{This command can appear only \inenvironment\temp,
+ not \inenvironment\thisenv}%
+}
+\def\inenvironment#1{%
+ \ifx#1\empty
+ outside of any environment%
+ \else
+ in environment \expandafter\string#1%
+ \fi
+}
+
+% @end foo executes the definition of \Efoo.
+% But first, it executes a specialized version of \checkenv
+%
+\parseargdef\end{%
+ \if 1\csname iscond.#1\endcsname
+ \else
+ % The general wording of \badenverr may not be ideal.
+ \expandafter\checkenv\csname#1\endcsname
+ \csname E#1\endcsname
+ \endgroup
+ \fi
+}
+
+\newhelp\EMsimple{Press RETURN to continue.}
+
+
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
+% @: forces normal size whitespace following.
+\def\:{\spacefactor=1000 }
+
+% @* forces a line break.
+\def\*{\unskip\hfil\break\hbox{}\ignorespaces}
+
+% @/ allows a line break.
+\let\/=\allowbreak
+
+% @. is an end-of-sentence period.
+\def\.{.\spacefactor=\endofsentencespacefactor\space}
+
+% @! is an end-of-sentence bang.
+\def\!{!\spacefactor=\endofsentencespacefactor\space}
+
+% @? is an end-of-sentence query.
+\def\?{?\spacefactor=\endofsentencespacefactor\space}
+
+% @frenchspacing on|off says whether to put extra space after punctuation.
+%
+\def\onword{on}
+\def\offword{off}
+%
+\parseargdef\frenchspacing{%
+ \def\temp{#1}%
+ \ifx\temp\onword \plainfrenchspacing
+ \else\ifx\temp\offword \plainnonfrenchspacing
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
+ \fi\fi
+}
+
+% @w prevents a word break. Without the \leavevmode, @w at the
+% beginning of a paragraph, when TeX is still in vertical mode, would
+% produce a whole line of output instead of starting the paragraph.
+\def\w#1{\leavevmode\hbox{#1}}
+
+% @group ... @end group forces ... to be all on one page, by enclosing
+% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
+% to keep its height that of a normal line. According to the rules for
+% \topskip (p.114 of the TeXbook), the glue inserted is
+% max (\topskip - \ht (first item), 0). If that height is large,
+% therefore, no glue is inserted, and the space between the headline and
+% the text is small, which looks bad.
+%
+% Another complication is that the group might be very large. This can
+% cause the glue on the previous page to be unduly stretched, because it
+% does not have much material. In this case, it's better to add an
+% explicit \vfill so that the extra space is at the bottom. The
+% threshold for doing this is if the group is more than \vfilllimit
+% percent of a page (\vfilllimit can be changed inside of @tex).
+%
+\newbox\groupbox
+\def\vfilllimit{0.7}
+%
+\envdef\group{%
+ \ifnum\catcode`\^^M=\active \else
+ \errhelp = \groupinvalidhelp
+ \errmessage{@group invalid in context where filling is enabled}%
+ \fi
+ \startsavinginserts
+ %
+ \setbox\groupbox = \vtop\bgroup
+ % Do @comment since we are called inside an environment such as
+ % @example, where each end-of-line in the input causes an
+ % end-of-line in the output. We don't want the end-of-line after
+ % the `@group' to put extra space in the output. Since @group
+ % should appear on a line by itself (according to the Texinfo
+ % manual), we don't worry about eating any user text.
+ \comment
+}
+%
+% The \vtop produces a box with normal height and large depth; thus, TeX puts
+% \baselineskip glue before it, and (when the next line of text is done)
+% \lineskip glue after it. Thus, space below is not quite equal to space
+% above. But it's pretty close.
+\def\Egroup{%
+ % To get correct interline space between the last line of the group
+ % and the first line afterwards, we have to propagate \prevdepth.
+ \endgraf % Not \par, as it may have been set to \lisppar.
+ \global\dimen1 = \prevdepth
+ \egroup % End the \vtop.
+ % \dimen0 is the vertical size of the group's box.
+ \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
+ % \dimen2 is how much space is left on the page (more or less).
+ \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
+ % if the group doesn't fit on the current page, and it's a big big
+ % group, force a page break.
+ \ifdim \dimen0 > \dimen2
+ \ifdim \pagetotal < \vfilllimit\pageheight
+ \page
+ \fi
+ \fi
+ \box\groupbox
+ \prevdepth = \dimen1
+ \checkinserts
+}
+%
+% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
+% message, so this ends up printing `@group can only ...'.
+%
+\newhelp\groupinvalidhelp{%
+group can only be used in environments such as @example,^^J%
+where each line of input produces a line of output.}
+
+% @need space-in-mils
+% forces a page break if there is not space-in-mils remaining.
+
+\newdimen\mil \mil=0.001in
+
+\parseargdef\need{%
+ % Ensure vertical mode, so we don't make a big box in the middle of a
+ % paragraph.
+ \par
+ %
+ % If the @need value is less than one line space, it's useless.
+ \dimen0 = #1\mil
+ \dimen2 = \ht\strutbox
+ \advance\dimen2 by \dp\strutbox
+ \ifdim\dimen0 > \dimen2
+ %
+ % Do a \strut just to make the height of this box be normal, so the
+ % normal leading is inserted relative to the preceding line.
+ % And a page break here is fine.
+ \vtop to #1\mil{\strut\vfil}%
+ %
+ % TeX does not even consider page breaks if a penalty added to the
+ % main vertical list is 10000 or more. But in order to see if the
+ % empty box we just added fits on the page, we must make it consider
+ % page breaks. On the other hand, we don't want to actually break the
+ % page after the empty box. So we use a penalty of 9999.
+ %
+ % There is an extremely small chance that TeX will actually break the
+ % page at this \penalty, if there are no other feasible breakpoints in
+ % sight. (If the user is using lots of big @group commands, which
+ % almost-but-not-quite fill up a page, TeX will have a hard time doing
+ % good page breaking, for example.) However, I could not construct an
+ % example where a page broke at this \penalty; if it happens in a real
+ % document, then we can reconsider our strategy.
+ \penalty9999
+ %
+ % Back up by the size of the box, whether we did a page break or not.
+ \kern -#1\mil
+ %
+ % Do not allow a page break right after this kern.
+ \nobreak
+ \fi
+}
+
+% @br forces paragraph break (and is undocumented).
+
+\let\br = \par
+
+% @page forces the start of a new page.
+%
+\def\page{\par\vfill\supereject}
+
+% @exdent text....
+% outputs text on separate line in roman font, starting at standard page margin
+
+% This records the amount of indent in the innermost environment.
+% That's how much \exdent should take out.
+\newskip\exdentamount
+
+% This defn is used inside fill environments such as @defun.
+\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
+
+% This defn is used inside nofill environments such as @example.
+\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
+ \leftline{\hskip\leftskip{\rm#1}}}}
+
+% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
+% paragraph. For more general purposes, use the \margin insertion
+% class. WHICH is `l' or `r'. Not documented, written for gawk manual.
+%
+\newskip\inmarginspacing \inmarginspacing=1cm
+\def\strutdepth{\dp\strutbox}
+%
+\def\doinmargin#1#2{\strut\vadjust{%
+ \nobreak
+ \kern-\strutdepth
+ \vtop to \strutdepth{%
+ \baselineskip=\strutdepth
+ \vss
+ % if you have multiple lines of stuff to put here, you'll need to
+ % make the vbox yourself of the appropriate size.
+ \ifx#1l%
+ \llap{\ignorespaces #2\hskip\inmarginspacing}%
+ \else
+ \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
+ \fi
+ \null
+ }%
+}}
+\def\inleftmargin{\doinmargin l}
+\def\inrightmargin{\doinmargin r}
+%
+% @inmargin{TEXT [, RIGHT-TEXT]}
+% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
+% else use TEXT for both).
+%
+\def\inmargin#1{\parseinmargin #1,,\finish}
+\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \def\lefttext{#1}% have both texts
+ \def\righttext{#2}%
+ \else
+ \def\lefttext{#1}% have only one text
+ \def\righttext{#1}%
+ \fi
+ %
+ \ifodd\pageno
+ \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
+ \else
+ \def\temp{\inleftmargin\lefttext}%
+ \fi
+ \temp
+}
+
+% @| inserts a changebar to the left of the current line. It should
+% surround any changed text. This approach does *not* work if the
+% change spans more than two lines of output. To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change). This command
+% is not documented, not supported, and doesn't work.
+%
+\def\|{%
+ % \vadjust can only be used in horizontal mode.
+ \leavevmode
+ %
+ % Append this vertical mode material after the current line in the output.
+ \vadjust{%
+ % We want to insert a rule with the height and depth of the current
+ % leading; that is exactly what \strutbox is supposed to record.
+ \vskip-\baselineskip
+ %
+ % \vadjust-items are inserted at the left edge of the type. So
+ % the \llap here moves out into the left-hand margin.
+ \llap{%
+ %
+ % For a thicker or thinner bar, change the `1pt'.
+ \vrule height\baselineskip width1pt
+ %
+ % This is the space between the bar and the text.
+ \hskip 12pt
+ }%
+ }%
+}
+
+% @include FILE -- \input text of FILE.
+%
+\def\include{\parseargusing\filenamecatcodes\includezzz}
+\def\includezzz#1{%
+ \pushthisfilestack
+ \def\thisfile{#1}%
+ {%
+ \makevalueexpandable % we want to expand any @value in FILE.
+ \turnoffactive % and allow special characters in the expansion
+ \indexnofonts % Allow `@@' and other weird things in file names.
+ \wlog{texinfo.tex: doing @include of #1^^J}%
+ \edef\temp{\noexpand\input #1 }%
+ %
+ % This trickery is to read FILE outside of a group, in case it makes
+ % definitions, etc.
+ \expandafter
+ }\temp
+ \popthisfilestack
+}
+\def\filenamecatcodes{%
+ \catcode`\\=\other
+ \catcode`~=\other
+ \catcode`^=\other
+ \catcode`_=\other
+ \catcode`|=\other
+ \catcode`<=\other
+ \catcode`>=\other
+ \catcode`+=\other
+ \catcode`-=\other
+ \catcode`\`=\other
+ \catcode`\'=\other
+}
+
+\def\pushthisfilestack{%
+ \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
+}
+\def\pushthisfilestackX{%
+ \expandafter\pushthisfilestackY\thisfile\StackTerm
+}
+\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
+ \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
+}
+
+\def\popthisfilestack{\errthisfilestackempty}
+\def\errthisfilestackempty{\errmessage{Internal error:
+ the stack of filenames is empty.}}
+%
+\def\thisfile{}
+
+% @center line
+% outputs that line, centered.
+%
+\parseargdef\center{%
+ \ifhmode
+ \let\centersub\centerH
+ \else
+ \let\centersub\centerV
+ \fi
+ \centersub{\hfil \ignorespaces#1\unskip \hfil}%
+ \let\centersub\relax % don't let the definition persist, just in case
+}
+\def\centerH#1{{%
+ \hfil\break
+ \advance\hsize by -\leftskip
+ \advance\hsize by -\rightskip
+ \line{#1}%
+ \break
+}}
+%
+\newcount\centerpenalty
+\def\centerV#1{%
+ % The idea here is the same as in \startdefun, \cartouche, etc.: if
+ % @center is the first thing after a section heading, we need to wipe
+ % out the negative parskip inserted by \sectionheading, but still
+ % prevent a page break here.
+ \centerpenalty = \lastpenalty
+ \ifnum\centerpenalty>10000 \vskip\parskip \fi
+ \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
+ \line{\kern\leftskip #1\kern\rightskip}%
+}
+
+% @sp n outputs n lines of vertical space
+%
+\parseargdef\sp{\vskip #1\baselineskip}
+
+% @comment ...line which is ignored...
+% @c is the same as @comment
+% @ignore ... @end ignore is another way to write a comment
+%
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
+%
+\let\c=\comment
+
+% @paragraphindent NCHARS
+% We'll use ems for NCHARS, close enough.
+% NCHARS can also be the word `asis' or `none'.
+% We cannot feasibly implement @paragraphindent asis, though.
+%
+\def\asisword{asis} % no translation, these are keywords
+\def\noneword{none}
+%
+\parseargdef\paragraphindent{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \defaultparindent = 0pt
+ \else
+ \defaultparindent = #1em
+ \fi
+ \fi
+ \parindent = \defaultparindent
+}
+
+% @exampleindent NCHARS
+% We'll use ems for NCHARS like @paragraphindent.
+% It seems @exampleindent asis isn't necessary, but
+% I preserve it to make it similar to @paragraphindent.
+\parseargdef\exampleindent{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \lispnarrowing = 0pt
+ \else
+ \lispnarrowing = #1em
+ \fi
+ \fi
+}
+
+% @firstparagraphindent WORD
+% If WORD is `none', then suppress indentation of the first paragraph
+% after a section heading. If WORD is `insert', then do indent at such
+% paragraphs.
+%
+% The paragraph indentation is suppressed or not by calling
+% \suppressfirstparagraphindent, which the sectioning commands do.
+% We switch the definition of this back and forth according to WORD.
+% By default, we suppress indentation.
+%
+\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
+\def\insertword{insert}
+%
+\parseargdef\firstparagraphindent{%
+ \def\temp{#1}%
+ \ifx\temp\noneword
+ \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
+ \else\ifx\temp\insertword
+ \let\suppressfirstparagraphindent = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @firstparagraphindent option `\temp'}%
+ \fi\fi
+}
+
+% Here is how we actually suppress indentation. Redefine \everypar to
+% \kern backwards by \parindent, and then reset itself to empty.
+%
+% We also make \indent itself not actually do anything until the next
+% paragraph.
+%
+\gdef\dosuppressfirstparagraphindent{%
+ \gdef\indent{%
+ \restorefirstparagraphindent
+ \indent
+ }%
+ \gdef\noindent{%
+ \restorefirstparagraphindent
+ \noindent
+ }%
+ \global\everypar = {%
+ \kern -\parindent
+ \restorefirstparagraphindent
+ }%
+}
+
+\gdef\restorefirstparagraphindent{%
+ \global \let \indent = \ptexindent
+ \global \let \noindent = \ptexnoindent
+ \global \everypar = {}%
+}
+
+
+% @refill is a no-op.
+\let\refill=\relax
+
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
+% @setfilename is done at the beginning of every texinfo file.
+% So open here the files we need to have open while reading the input.
+% This makes it possible to make a .fmt file for texinfo.
+\def\setfilename{%
+ \fixbackslash % Turn off hack to swallow `\input texinfo'.
+ \iflinks
+ \tryauxfile
+ % Open the new aux file. TeX will close it automatically at exit.
+ \immediate\openout\auxfile=\jobname.aux
+ \fi % \openindices needs to do some work in any case.
+ \openindices
+ \let\setfilename=\comment % Ignore extra @setfilename cmds.
+ %
+ % If texinfo.cnf is present on the system, read it.
+ % Useful for site-wide @afourpaper, etc.
+ \openin 1 texinfo.cnf
+ \ifeof 1 \else \input texinfo.cnf \fi
+ \closein 1
+ %
+ \comment % Ignore the actual filename.
+}
+
+% Called from \setfilename.
+%
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
+% @bye.
+\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+
+
+\message{pdf,}
+% adobe `portable' document format
+\newcount\tempnum
+\newcount\lnkcount
+\newtoks\filename
+\newcount\filenamelength
+\newcount\pgn
+\newtoks\toksA
+\newtoks\toksB
+\newtoks\toksC
+\newtoks\toksD
+\newbox\boxA
+\newcount\countA
+\newif\ifpdf
+\newif\ifpdfmakepagedest
+
+% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
+% can be set). So we test for \relax and 0 as well as being undefined.
+\ifx\pdfoutput\thisisundefined
+\else
+ \ifx\pdfoutput\relax
+ \else
+ \ifcase\pdfoutput
+ \else
+ \pdftrue
+ \fi
+ \fi
+\fi
+
+% PDF uses PostScript string constants for the names of xref targets,
+% for display in the outlines, and in other places. Thus, we have to
+% double any backslashes. Otherwise, a name like "\node" will be
+% interpreted as a newline (\n), followed by o, d, e. Not good.
+%
+% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
+% related messages. The final outcome is that it is up to the TeX user
+% to double the backslashes and otherwise make the string valid, so
+% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
+% do this reliably, so we use it.
+
+% #1 is a control sequence in which to do the replacements,
+% which we \xdef.
+\def\txiescapepdf#1{%
+ \ifx\pdfescapestring\thisisundefined
+ % No primitive available; should we give a warning or log?
+ % Many times it won't matter.
+ \else
+ % The expandable \pdfescapestring primitive escapes parentheses,
+ % backslashes, and other special chars.
+ \xdef#1{\pdfescapestring{#1}}%
+ \fi
+}
+
+\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
+with PDF output, and none of those formats could be found. (.eps cannot
+be supported due to the design of the PDF format; use regular TeX (DVI
+output) for that.)}
+
+\ifpdf
+ %
+ % Color manipulation macros based on pdfcolor.tex,
+ % except using rgb instead of cmyk; the latter is said to render as a
+ % very dark gray on-screen and a very dark halftone in print, instead
+ % of actual black.
+ \def\rgbDarkRed{0.50 0.09 0.12}
+ \def\rgbBlack{0 0 0}
+ %
+ % k sets the color for filling (usual text, etc.);
+ % K sets the color for stroking (thin rules, e.g., normal _'s).
+ \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
+ %
+ % Set color, and create a mark which defines \thiscolor accordingly,
+ % so that \makeheadline knows which color to restore.
+ \def\setcolor#1{%
+ \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+ \domark
+ \pdfsetcolor{#1}%
+ }
+ %
+ \def\maincolor{\rgbBlack}
+ \pdfsetcolor{\maincolor}
+ \edef\thiscolor{\maincolor}
+ \def\lastcolordefs{}
+ %
+ \def\makefootline{%
+ \baselineskip24pt
+ \line{\pdfsetcolor{\maincolor}\the\footline}%
+ }
+ %
+ \def\makeheadline{%
+ \vbox to 0pt{%
+ \vskip-22.5pt
+ \line{%
+ \vbox to8.5pt{}%
+ % Extract \thiscolor definition from the marks.
+ \getcolormarks
+ % Typeset the headline with \maincolor, then restore the color.
+ \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
+ }%
+ \vss
+ }%
+ \nointerlineskip
+ }
+ %
+ %
+ \pdfcatalog{/PageMode /UseOutlines}
+ %
+ % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
+ \def\dopdfimage#1#2#3{%
+ \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
+ \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
+ %
+ % pdftex (and the PDF format) support .pdf, .png, .jpg (among
+ % others). Let's try in that order, PDF first since if
+ % someone has a scalable image, presumably better to use that than a
+ % bitmap.
+ \let\pdfimgext=\empty
+ \begingroup
+ \openin 1 #1.pdf \ifeof 1
+ \openin 1 #1.PDF \ifeof 1
+ \openin 1 #1.png \ifeof 1
+ \openin 1 #1.jpg \ifeof 1
+ \openin 1 #1.jpeg \ifeof 1
+ \openin 1 #1.JPG \ifeof 1
+ \errhelp = \nopdfimagehelp
+ \errmessage{Could not find image file #1 for pdf}%
+ \else \gdef\pdfimgext{JPG}%
+ \fi
+ \else \gdef\pdfimgext{jpeg}%
+ \fi
+ \else \gdef\pdfimgext{jpg}%
+ \fi
+ \else \gdef\pdfimgext{png}%
+ \fi
+ \else \gdef\pdfimgext{PDF}%
+ \fi
+ \else \gdef\pdfimgext{pdf}%
+ \fi
+ \closein 1
+ \endgroup
+ %
+ % without \immediate, ancient pdftex seg faults when the same image is
+ % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
+ \ifnum\pdftexversion < 14
+ \immediate\pdfimage
+ \else
+ \immediate\pdfximage
+ \fi
+ \ifdim \wd0 >0pt width \pdfimagewidth \fi
+ \ifdim \wd2 >0pt height \pdfimageheight \fi
+ \ifnum\pdftexversion<13
+ #1.\pdfimgext
+ \else
+ {#1.\pdfimgext}%
+ \fi
+ \ifnum\pdftexversion < 14 \else
+ \pdfrefximage \pdflastximage
+ \fi}
+ %
+ \def\pdfmkdest#1{{%
+ % We have to set dummies so commands such as @code, and characters
+ % such as \, aren't expanded when present in a section title.
+ \indexnofonts
+ \turnoffactive
+ \makevalueexpandable
+ \def\pdfdestname{#1}%
+ \txiescapepdf\pdfdestname
+ \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
+ }}
+ %
+ % used to mark target names; must be expandable.
+ \def\pdfmkpgn#1{#1}
+ %
+ % by default, use a color that is dark enough to print on paper as
+ % nearly black, but still distinguishable for online viewing.
+ \def\urlcolor{\rgbDarkRed}
+ \def\linkcolor{\rgbDarkRed}
+ \def\endlink{\setcolor{\maincolor}\pdfendlink}
+ %
+ % Adding outlines to PDF; macros for calculating structure of outlines
+ % come from Petr Olsak
+ \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
+ \else \csname#1\endcsname \fi}
+ \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
+ \advance\tempnum by 1
+ \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
+ %
+ % #1 is the section text, which is what will be displayed in the
+ % outline by the pdf viewer. #2 is the pdf expression for the number
+ % of subentries (or empty, for subsubsections). #3 is the node text,
+ % which might be empty if this toc entry had no corresponding node.
+ % #4 is the page number
+ %
+ \def\dopdfoutline#1#2#3#4{%
+ % Generate a link to the node text if that exists; else, use the
+ % page number. We could generate a destination for the section
+ % text in the case where a section has no node, but it doesn't
+ % seem worth the trouble, since most documents are normally structured.
+ \edef\pdfoutlinedest{#3}%
+ \ifx\pdfoutlinedest\empty
+ \def\pdfoutlinedest{#4}%
+ \else
+ \txiescapepdf\pdfoutlinedest
+ \fi
+ %
+ % Also escape PDF chars in the display string.
+ \edef\pdfoutlinetext{#1}%
+ \txiescapepdf\pdfoutlinetext
+ %
+ \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
+ }
+ %
+ \def\pdfmakeoutlines{%
+ \begingroup
+ % Read toc silently, to get counts of subentries for \pdfoutline.
+ \def\partentry##1##2##3##4{}% ignore parts in the outlines
+ \def\numchapentry##1##2##3##4{%
+ \def\thischapnum{##2}%
+ \def\thissecnum{0}%
+ \def\thissubsecnum{0}%
+ }%
+ \def\numsecentry##1##2##3##4{%
+ \advancenumber{chap\thischapnum}%
+ \def\thissecnum{##2}%
+ \def\thissubsecnum{0}%
+ }%
+ \def\numsubsecentry##1##2##3##4{%
+ \advancenumber{sec\thissecnum}%
+ \def\thissubsecnum{##2}%
+ }%
+ \def\numsubsubsecentry##1##2##3##4{%
+ \advancenumber{subsec\thissubsecnum}%
+ }%
+ \def\thischapnum{0}%
+ \def\thissecnum{0}%
+ \def\thissubsecnum{0}%
+ %
+ % use \def rather than \let here because we redefine \chapentry et
+ % al. a second time, below.
+ \def\appentry{\numchapentry}%
+ \def\appsecentry{\numsecentry}%
+ \def\appsubsecentry{\numsubsecentry}%
+ \def\appsubsubsecentry{\numsubsubsecentry}%
+ \def\unnchapentry{\numchapentry}%
+ \def\unnsecentry{\numsecentry}%
+ \def\unnsubsecentry{\numsubsecentry}%
+ \def\unnsubsubsecentry{\numsubsubsecentry}%
+ \readdatafile{toc}%
+ %
+ % Read toc second time, this time actually producing the outlines.
+ % The `-' means take the \expnumber as the absolute number of
+ % subentries, which we calculated on our first read of the .toc above.
+ %
+ % We use the node names as the destinations.
+ \def\numchapentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
+ \def\numsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
+ \def\numsubsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
+ \def\numsubsubsecentry##1##2##3##4{% count is always zero
+ \dopdfoutline{##1}{}{##3}{##4}}%
+ %
+ % PDF outlines are displayed using system fonts, instead of
+ % document fonts. Therefore we cannot use special characters,
+ % since the encoding is unknown. For example, the eogonek from
+ % Latin 2 (0xea) gets translated to a | character. Info from
+ % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
+ %
+ % TODO this right, we have to translate 8-bit characters to
+ % their "best" equivalent, based on the @documentencoding. Too
+ % much work for too little return. Just use the ASCII equivalents
+ % we use for the index sort strings.
+ %
+ \indexnofonts
+ \setupdatafile
+ % We can have normal brace characters in the PDF outlines, unlike
+ % Texinfo index files. So set that up.
+ \def\{{\lbracecharliteral}%
+ \def\}{\rbracecharliteral}%
+ \catcode`\\=\active \otherbackslash
+ \input \tocreadfilename
+ \endgroup
+ }
+ {\catcode`[=1 \catcode`]=2
+ \catcode`{=\other \catcode`}=\other
+ \gdef\lbracecharliteral[{]%
+ \gdef\rbracecharliteral[}]%
+ ]
+ %
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \nextsp}
+ \def\getfilename#1{%
+ \filenamelength=0
+ % If we don't expand the argument now, \skipspaces will get
+ % snagged on things like "@value{foo}".
+ \edef\temp{#1}%
+ \expandafter\skipspaces\temp|\relax
+ }
+ \ifnum\pdftexversion < 14
+ \let \startlink \pdfannotlink
+ \else
+ \let \startlink \pdfstartlink
+ \fi
+ % make a live url in pdf output.
+ \def\pdfurl#1{%
+ \begingroup
+ % it seems we really need yet another set of dummies; have not
+ % tried to figure out what each command should do in the context
+ % of @url. for now, just make @/ a no-op, that's the only one
+ % people have actually reported a problem with.
+ %
+ \normalturnoffactive
+ \def\@{@}%
+ \let\/=\empty
+ \makevalueexpandable
+ % do we want to go so far as to use \indexnofonts instead of just
+ % special-casing \var here?
+ \def\var##1{##1}%
+ %
+ \leavevmode\setcolor{\urlcolor}%
+ \startlink attr{/Border [0 0 0]}%
+ user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
+ \endgroup}
+ \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+ \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+ \def\maketoks{%
+ \expandafter\poptoks\the\toksA|ENDTOKS|\relax
+ \ifx\first0\adn0
+ \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+ \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else
+ \ifnum0=\countA\else\makelink\fi
+ \ifx\first.\let\next=\done\else
+ \let\next=\maketoks
+ \addtokens{\toksB}{\the\toksD}
+ \ifx\first,\addtokens{\toksB}{\space}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+ \def\makelink{\addtokens{\toksB}%
+ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+ \def\pdflink#1{%
+ \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
+ \setcolor{\linkcolor}#1\endlink}
+ \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\else
+ % non-pdf mode
+ \let\pdfmkdest = \gobble
+ \let\pdfurl = \gobble
+ \let\endlink = \relax
+ \let\setcolor = \gobble
+ \let\pdfsetcolor = \gobble
+ \let\pdfmakeoutlines = \relax
+\fi % \ifx\pdfoutput
+
+
+\message{fonts,}
+
+% Change the current font style to #1, remembering it in \curfontstyle.
+% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
+% italics, not bold italics.
+%
+\def\setfontstyle#1{%
+ \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
+ \csname ten#1\endcsname % change the current font
+}
+
+% Select #1 fonts with the current style.
+%
+\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
+
+\def\rm{\fam=0 \setfontstyle{rm}}
+\def\it{\fam=\itfam \setfontstyle{it}}
+\def\sl{\fam=\slfam \setfontstyle{sl}}
+\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
+\def\tt{\fam=\ttfam \setfontstyle{tt}}
+
+% Unfortunately, we have to override this for titles and the like, since
+% in those cases "rm" is bold. Sigh.
+\def\rmisbold{\rm\def\curfontstyle{bf}}
+
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf.
+\newfam\sffam
+\def\sf{\fam=\sffam \setfontstyle{sf}}
+\let\li = \sf % Sometimes we call it \li, not \sf.
+
+% We don't need math for this font style.
+\def\ttsl{\setfontstyle{ttsl}}
+
+
+% Set the baselineskip to #1, and the lineskip and strut size
+% correspondingly. There is no deep meaning behind these magic numbers
+% used as factors; they just match (closely enough) what Knuth defined.
+%
+\def\lineskipfactor{.08333}
+\def\strutheightpercent{.70833}
+\def\strutdepthpercent {.29167}
+%
+% can get a sort of poor man's double spacing by redefining this.
+\def\baselinefactor{1}
+%
+\newdimen\textleading
+\def\setleading#1{%
+ \dimen0 = #1\relax
+ \normalbaselineskip = \baselinefactor\dimen0
+ \normallineskip = \lineskipfactor\normalbaselineskip
+ \normalbaselines
+ \setbox\strutbox =\hbox{%
+ \vrule width0pt height\strutheightpercent\baselineskip
+ depth \strutdepthpercent \baselineskip
+ }%
+}
+
+% PDF CMaps. See also LaTeX's t1.cmap.
+%
+% do nothing with this by default.
+\expandafter\let\csname cmapOT1\endcsname\gobble
+\expandafter\let\csname cmapOT1IT\endcsname\gobble
+\expandafter\let\csname cmapOT1TT\endcsname\gobble
+
+% if we are producing pdf, and we have \pdffontattr, then define cmaps.
+% (\pdffontattr was introduced many years ago, but people still run
+% older pdftex's; it's easy to conditionalize, so we do.)
+\ifpdf \ifx\pdffontattr\thisisundefined \else
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1-0)
+%%Title: (TeX-OT1-0 TeX OT1 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+8 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<23> <26> <0023>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<5D> <5E> <005D>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+endbfrange
+40 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <007E>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+%
+% \cmapOT1IT
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1IT-0)
+%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1IT)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1IT-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+8 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<25> <26> <0025>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<5D> <5E> <005D>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+endbfrange
+42 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<23> <0023>
+<24> <00A3>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <007E>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1IT\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+%
+% \cmapOT1TT
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1TT-0)
+%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1TT)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1TT-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+5 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<21> <26> <0021>
+<28> <5F> <0028>
+<61> <7E> <0061>
+endbfrange
+32 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <2191>
+<0C> <2193>
+<0D> <0027>
+<0E> <00A1>
+<0F> <00BF>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<20> <2423>
+<27> <2019>
+<60> <2018>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1TT\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+\fi\fi
+
+
+% Set the font macro #1 to the font named \fontprefix#2.
+% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
+% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
+% Example:
+% #1 = \textrm
+% #2 = \rmshape
+% #3 = 10
+% #4 = \mainmagstep
+% #5 = OT1
+%
+\def\setfont#1#2#3#4#5{%
+ \font#1=\fontprefix#2#3 scaled #4
+ \csname cmap#5\endcsname#1%
+}
+% This is what gets called when #5 of \setfont is empty.
+\let\cmap\gobble
+%
+% (end of cmaps)
+
+% Use cm as the default font prefix.
+% To specify the font prefix, you must define \fontprefix
+% before you read in texinfo.tex.
+\ifx\fontprefix\thisisundefined
+\def\fontprefix{cm}
+\fi
+% Support font families that don't use the same naming scheme as CM.
+\def\rmshape{r}
+\def\rmbshape{bx} % where the normal face is bold
+\def\bfshape{b}
+\def\bxshape{bx}
+\def\ttshape{tt}
+\def\ttbshape{tt}
+\def\ttslshape{sltt}
+\def\itshape{ti}
+\def\itbshape{bxti}
+\def\slshape{sl}
+\def\slbshape{bxsl}
+\def\sfshape{ss}
+\def\sfbshape{ss}
+\def\scshape{csc}
+\def\scbshape{csc}
+
+% Definitions for a main text size of 11pt. (The default in Texinfo.)
+%
+\def\definetextfontsizexi{%
+% Text fonts (11.2pt, magstep1).
+\def\textnominalsize{11pt}
+\edef\mainmagstep{\magstephalf}
+\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
+\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
+\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
+\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
+\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
+\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
+\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+\def\textecsize{1095}
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstep1}{OT1}
+\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
+\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}{OT1}
+\setfont\smalltt\ttshape{9}{1000}{OT1TT}
+\setfont\smallbf\bfshape{10}{900}{OT1}
+\setfont\smallit\itshape{9}{1000}{OT1IT}
+\setfont\smallsl\slshape{9}{1000}{OT1}
+\setfont\smallsf\sfshape{9}{1000}{OT1}
+\setfont\smallsc\scshape{10}{900}{OT1}
+\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+\def\smallecsize{0900}
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}{OT1}
+\setfont\smallertt\ttshape{8}{1000}{OT1TT}
+\setfont\smallerbf\bfshape{10}{800}{OT1}
+\setfont\smallerit\itshape{8}{1000}{OT1IT}
+\setfont\smallersl\slshape{8}{1000}{OT1}
+\setfont\smallersf\sfshape{8}{1000}{OT1}
+\setfont\smallersc\scshape{10}{800}{OT1}
+\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+\def\smallerecsize{0800}
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
+\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
+\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
+\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
+\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
+\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\titleecsize{2074}
+
+% Chapter (and unnumbered) fonts (17.28pt).
+\def\chapnominalsize{17pt}
+\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
+\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
+\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
+\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
+\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
+\setfont\chapsf\sfbshape{17}{1000}{OT1}
+\let\chapbf=\chaprm
+\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
+\font\chapi=cmmi12 scaled \magstep2
+\font\chapsy=cmsy10 scaled \magstep3
+\def\chapecsize{1728}
+
+% Section fonts (14.4pt).
+\def\secnominalsize{14pt}
+\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
+\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
+\setfont\secsl\slbshape{10}{\magstep2}{OT1}
+\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
+\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
+\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep2}{OT1}
+\font\seci=cmmi12 scaled \magstep1
+\font\secsy=cmsy10 scaled \magstep2
+\def\sececsize{1440}
+
+% Subsection fonts (13.15pt).
+\def\ssecnominalsize{13pt}
+\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
+\setfont\ssecit\itbshape{10}{1315}{OT1IT}
+\setfont\ssecsl\slbshape{10}{1315}{OT1}
+\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
+\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
+\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1315}{OT1}
+\font\sseci=cmmi12 scaled \magstephalf
+\font\ssecsy=cmsy10 scaled 1315
+\def\ssececsize{1200}
+
+% Reduced fonts for @acro in text (10pt).
+\def\reducednominalsize{10pt}
+\setfont\reducedrm\rmshape{10}{1000}{OT1}
+\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
+\setfont\reducedbf\bfshape{10}{1000}{OT1}
+\setfont\reducedit\itshape{10}{1000}{OT1IT}
+\setfont\reducedsl\slshape{10}{1000}{OT1}
+\setfont\reducedsf\sfshape{10}{1000}{OT1}
+\setfont\reducedsc\scshape{10}{1000}{OT1}
+\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
+\font\reducedi=cmmi10
+\font\reducedsy=cmsy10
+\def\reducedecsize{1000}
+
+\textleading = 13.2pt % line spacing for 11pt CM
+\textfonts % reset the current fonts
+\rm
+} % end of 11pt text font size definitions, \definetextfontsizexi
+
+
+% Definitions to make the main text be 10pt Computer Modern, with
+% section, chapter, etc., sizes following suit. This is for the GNU
+% Press printing of the Emacs 22 manual. Maybe other manuals in the
+% future. Used with @smallbook, which sets the leading to 12pt.
+%
+\def\definetextfontsizex{%
+% Text fonts (10pt).
+\def\textnominalsize{10pt}
+\edef\mainmagstep{1000}
+\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
+\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
+\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
+\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
+\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
+\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
+\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+\def\textecsize{1000}
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
+\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
+\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}{OT1}
+\setfont\smalltt\ttshape{9}{1000}{OT1TT}
+\setfont\smallbf\bfshape{10}{900}{OT1}
+\setfont\smallit\itshape{9}{1000}{OT1IT}
+\setfont\smallsl\slshape{9}{1000}{OT1}
+\setfont\smallsf\sfshape{9}{1000}{OT1}
+\setfont\smallsc\scshape{10}{900}{OT1}
+\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+\def\smallecsize{0900}
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}{OT1}
+\setfont\smallertt\ttshape{8}{1000}{OT1TT}
+\setfont\smallerbf\bfshape{10}{800}{OT1}
+\setfont\smallerit\itshape{8}{1000}{OT1IT}
+\setfont\smallersl\slshape{8}{1000}{OT1}
+\setfont\smallersf\sfshape{8}{1000}{OT1}
+\setfont\smallersc\scshape{10}{800}{OT1}
+\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+\def\smallerecsize{0800}
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
+\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
+\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
+\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
+\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
+\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\titleecsize{2074}
+
+% Chapter fonts (14.4pt).
+\def\chapnominalsize{14pt}
+\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
+\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
+\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
+\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
+\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
+\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
+\let\chapbf\chaprm
+\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
+\font\chapi=cmmi12 scaled \magstep1
+\font\chapsy=cmsy10 scaled \magstep2
+\def\chapecsize{1440}
+
+% Section fonts (12pt).
+\def\secnominalsize{12pt}
+\setfont\secrm\rmbshape{12}{1000}{OT1}
+\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
+\setfont\secsl\slbshape{10}{\magstep1}{OT1}
+\setfont\sectt\ttbshape{12}{1000}{OT1TT}
+\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
+\setfont\secsf\sfbshape{12}{1000}{OT1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep1}{OT1}
+\font\seci=cmmi12
+\font\secsy=cmsy10 scaled \magstep1
+\def\sececsize{1200}
+
+% Subsection fonts (10pt).
+\def\ssecnominalsize{10pt}
+\setfont\ssecrm\rmbshape{10}{1000}{OT1}
+\setfont\ssecit\itbshape{10}{1000}{OT1IT}
+\setfont\ssecsl\slbshape{10}{1000}{OT1}
+\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
+\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
+\setfont\ssecsf\sfbshape{10}{1000}{OT1}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1000}{OT1}
+\font\sseci=cmmi10
+\font\ssecsy=cmsy10
+\def\ssececsize{1000}
+
+% Reduced fonts for @acro in text (9pt).
+\def\reducednominalsize{9pt}
+\setfont\reducedrm\rmshape{9}{1000}{OT1}
+\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
+\setfont\reducedbf\bfshape{10}{900}{OT1}
+\setfont\reducedit\itshape{9}{1000}{OT1IT}
+\setfont\reducedsl\slshape{9}{1000}{OT1}
+\setfont\reducedsf\sfshape{9}{1000}{OT1}
+\setfont\reducedsc\scshape{10}{900}{OT1}
+\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
+\font\reducedi=cmmi9
+\font\reducedsy=cmsy9
+\def\reducedecsize{0900}
+
+\divide\parskip by 2 % reduce space between paragraphs
+\textleading = 12pt % line spacing for 10pt CM
+\textfonts % reset the current fonts
+\rm
+} % end of 10pt text font size definitions, \definetextfontsizex
+
+
+% We provide the user-level command
+% @fonttextsize 10
+% (or 11) to redefine the text font size. pt is assumed.
+%
+\def\xiword{11}
+\def\xword{10}
+\def\xwordpt{10pt}
+%
+\parseargdef\fonttextsize{%
+ \def\textsizearg{#1}%
+ %\wlog{doing @fonttextsize \textsizearg}%
+ %
+ % Set \globaldefs so that documents can use this inside @tex, since
+ % makeinfo 4.8 does not support it, but we need it nonetheless.
+ %
+ \begingroup \globaldefs=1
+ \ifx\textsizearg\xword \definetextfontsizex
+ \else \ifx\textsizearg\xiword \definetextfontsizexi
+ \else
+ \errhelp=\EMsimple
+ \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
+ \fi\fi
+ \endgroup
+}
+
+
+% In order for the font changes to affect most math symbols and letters,
+% we have to define the \textfont of the standard families. Since
+% texinfo doesn't allow for producing subscripts and superscripts except
+% in the main text, we don't bother to reset \scriptfont and
+% \scriptscriptfont (which would also require loading a lot more fonts).
+%
+\def\resetmathfonts{%
+ \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
+ \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
+ \textfont\ttfam=\tentt \textfont\sffam=\tensf
+}
+
+% The font-changing commands redefine the meanings of \tenSTYLE, instead
+% of just \STYLE. We do this because \STYLE needs to also set the
+% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
+% \tenSTYLE to set the current font.
+%
+% Each font-changing command also sets the names \lsize (one size lower)
+% and \lllsize (three sizes lower). These relative commands are used in
+% the LaTeX logo and acronyms.
+%
+% This all needs generalizing, badly.
+%
+\def\textfonts{%
+ \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
+ \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
+ \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
+ \let\tenttsl=\textttsl
+ \def\curfontsize{text}%
+ \def\lsize{reduced}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{\textleading}}
+\def\titlefonts{%
+ \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
+ \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
+ \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+ \let\tenttsl=\titlettsl
+ \def\curfontsize{title}%
+ \def\lsize{chap}\def\lllsize{subsec}%
+ \resetmathfonts \setleading{27pt}}
+\def\titlefont#1{{\titlefonts\rmisbold #1}}
+\def\chapfonts{%
+ \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
+ \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
+ \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
+ \let\tenttsl=\chapttsl
+ \def\curfontsize{chap}%
+ \def\lsize{sec}\def\lllsize{text}%
+ \resetmathfonts \setleading{19pt}}
+\def\secfonts{%
+ \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
+ \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
+ \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
+ \let\tenttsl=\secttsl
+ \def\curfontsize{sec}%
+ \def\lsize{subsec}\def\lllsize{reduced}%
+ \resetmathfonts \setleading{16pt}}
+\def\subsecfonts{%
+ \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
+ \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
+ \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
+ \let\tenttsl=\ssecttsl
+ \def\curfontsize{ssec}%
+ \def\lsize{text}\def\lllsize{small}%
+ \resetmathfonts \setleading{15pt}}
+\let\subsubsecfonts = \subsecfonts
+\def\reducedfonts{%
+ \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
+ \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
+ \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
+ \let\tenttsl=\reducedttsl
+ \def\curfontsize{reduced}%
+ \def\lsize{small}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{10.5pt}}
+\def\smallfonts{%
+ \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
+ \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
+ \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
+ \let\tenttsl=\smallttsl
+ \def\curfontsize{small}%
+ \def\lsize{smaller}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{10.5pt}}
+\def\smallerfonts{%
+ \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
+ \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
+ \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
+ \let\tenttsl=\smallerttsl
+ \def\curfontsize{smaller}%
+ \def\lsize{smaller}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{9.5pt}}
+
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}{OT1}
+\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
+\setfont\shortcontsl\slshape{12}{1000}{OT1}
+\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
+
+% Define these just so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
+% Set the fonts to use with the @small... environments.
+\let\smallexamplefonts = \smallfonts
+
+% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
+% can fit this many characters:
+% 8.5x11=86 smallbook=72 a4=90 a5=69
+% If we use \scriptfonts (8pt), then we can fit this many characters:
+% 8.5x11=90+ smallbook=80 a4=90+ a5=77
+% For me, subjectively, the few extra characters that fit aren't worth
+% the additional smallness of 8pt. So I'm making the default 9pt.
+%
+% By the way, for comparison, here's what fits with @example (10pt):
+% 8.5x11=71 smallbook=60 a4=75 a5=58
+% --karl, 24jan03.
+
+% Set up the default fonts, so we can use them for creating boxes.
+%
+\definetextfontsizexi
+
+
+\message{markup,}
+
+% Check if we are currently using a typewriter font. Since all the
+% Computer Modern typewriter fonts have zero interword stretch (and
+% shrink), and it is reasonable to expect all typewriter fonts to have
+% this property, we can check that font parameter.
+%
+\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
+
+% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
+% define and register \INITMACRO to be called on markup style changes.
+% \INITMACRO can check \currentmarkupstyle for the innermost
+% style and the set of \ifmarkupSTYLE switches for all styles
+% currently in effect.
+\newif\ifmarkupvar
+\newif\ifmarkupsamp
+\newif\ifmarkupkey
+%\newif\ifmarkupfile % @file == @samp.
+%\newif\ifmarkupoption % @option == @samp.
+\newif\ifmarkupcode
+\newif\ifmarkupkbd
+%\newif\ifmarkupenv % @env == @code.
+%\newif\ifmarkupcommand % @command == @code.
+\newif\ifmarkuptex % @tex (and part of @math, for now).
+\newif\ifmarkupexample
+\newif\ifmarkupverb
+\newif\ifmarkupverbatim
+
+\let\currentmarkupstyle\empty
+
+\def\setupmarkupstyle#1{%
+ \csname markup#1true\endcsname
+ \def\currentmarkupstyle{#1}%
+ \markupstylesetup
+}
+
+\let\markupstylesetup\empty
+
+\def\defmarkupstylesetup#1{%
+ \expandafter\def\expandafter\markupstylesetup
+ \expandafter{\markupstylesetup #1}%
+ \def#1%
+}
+
+% Markup style setup for left and right quotes.
+\defmarkupstylesetup\markupsetuplq{%
+ \expandafter\let\expandafter \temp
+ \csname markupsetuplq\currentmarkupstyle\endcsname
+ \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
+}
+
+\defmarkupstylesetup\markupsetuprq{%
+ \expandafter\let\expandafter \temp
+ \csname markupsetuprq\currentmarkupstyle\endcsname
+ \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
+}
+
+{
+\catcode`\'=\active
+\catcode`\`=\active
+
+\gdef\markupsetuplqdefault{\let`\lq}
+\gdef\markupsetuprqdefault{\let'\rq}
+
+\gdef\markupsetcodequoteleft{\let`\codequoteleft}
+\gdef\markupsetcodequoteright{\let'\codequoteright}
+}
+
+\let\markupsetuplqcode \markupsetcodequoteleft
+\let\markupsetuprqcode \markupsetcodequoteright
+%
+\let\markupsetuplqexample \markupsetcodequoteleft
+\let\markupsetuprqexample \markupsetcodequoteright
+%
+\let\markupsetuplqkbd \markupsetcodequoteleft
+\let\markupsetuprqkbd \markupsetcodequoteright
+%
+\let\markupsetuplqsamp \markupsetcodequoteleft
+\let\markupsetuprqsamp \markupsetcodequoteright
+%
+\let\markupsetuplqverb \markupsetcodequoteleft
+\let\markupsetuprqverb \markupsetcodequoteright
+%
+\let\markupsetuplqverbatim \markupsetcodequoteleft
+\let\markupsetuprqverbatim \markupsetcodequoteright
+
+% Allow an option to not use regular directed right quote/apostrophe
+% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
+% The undirected quote is ugly, so don't make it the default, but it
+% works for pasting with more pdf viewers (at least evince), the
+% lilypond developers report. xpdf does work with the regular 0x27.
+%
+\def\codequoteright{%
+ \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
+ \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
+ '%
+ \else \char'15 \fi
+ \else \char'15 \fi
+}
+%
+% and a similar option for the left quote char vs. a grave accent.
+% Modern fonts display ASCII 0x60 as a grave accent, so some people like
+% the code environments to do likewise.
+%
+\def\codequoteleft{%
+ \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
+ \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
+ % [Knuth] pp. 380,381,391
+ % \relax disables Spanish ligatures ?` and !` of \tt font.
+ \relax`%
+ \else \char'22 \fi
+ \else \char'22 \fi
+}
+
+% Commands to set the quote options.
+%
+\parseargdef\codequoteundirected{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETtxicodequoteundirected\endcsname
+ = t%
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETtxicodequoteundirected\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
+ \fi\fi
+}
+%
+\parseargdef\codequotebacktick{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETtxicodequotebacktick\endcsname
+ = t%
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETtxicodequotebacktick\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
+ \fi\fi
+}
+
+% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
+\def\noligaturesquoteleft{\relax\lq}
+
+% Count depth in font-changes, for error checks
+\newcount\fontdepth \fontdepth=0
+
+% Font commands.
+
+% #1 is the font command (\sl or \it), #2 is the text to slant.
+% If we are in a monospaced environment, however, 1) always use \ttsl,
+% and 2) do not add an italic correction.
+\def\dosmartslant#1#2{%
+ \ifusingtt
+ {{\ttsl #2}\let\next=\relax}%
+ {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
+ \next
+}
+\def\smartslanted{\dosmartslant\sl}
+\def\smartitalic{\dosmartslant\it}
+
+% Output an italic correction unless \next (presumed to be the following
+% character) is such as not to need one.
+\def\smartitaliccorrection{%
+ \ifx\next,%
+ \else\ifx\next-%
+ \else\ifx\next.%
+ \else\ifx\next\.%
+ \else\ifx\next\comma%
+ \else\ptexslash
+ \fi\fi\fi\fi\fi
+ \aftersmartic
+}
+
+% Unconditional use \ttsl, and no ic. @var is set to this for defuns.
+\def\ttslanted#1{{\ttsl #1}}
+
+% @cite is like \smartslanted except unconditionally use \sl. We never want
+% ttsl for book titles, do we?
+\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
+
+\def\aftersmartic{}
+\def\var#1{%
+ \let\saveaftersmartic = \aftersmartic
+ \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
+ \smartslanted{#1}%
+}
+
+\let\i=\smartitalic
+\let\slanted=\smartslanted
+\let\dfn=\smartslanted
+\let\emph=\smartitalic
+
+% Explicit font changes: @r, @sc, undocumented @ii.
+\def\r#1{{\rm #1}} % roman font
+\def\sc#1{{\smallcaps#1}} % smallcaps font
+\def\ii#1{{\it #1}} % italic font
+
+% @b, explicit bold. Also @strong.
+\def\b#1{{\bf #1}}
+\let\strong=\b
+
+% @sansserif, explicit sans.
+\def\sansserif#1{{\sf #1}}
+
+% We can't just use \exhyphenpenalty, because that only has effect at
+% the end of a paragraph. Restore normal hyphenation at the end of the
+% group within which \nohyphenation is presumably called.
+%
+\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
+\def\restorehyphenation{\hyphenchar\font = `- }
+
+% Set sfcode to normal for the chars that usually have another value.
+% Can't use plain's \frenchspacing because it uses the `\x notation, and
+% sometimes \x has an active definition that messes things up.
+%
+\catcode`@=11
+ \def\plainfrenchspacing{%
+ \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
+ \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
+ \def\endofsentencespacefactor{1000}% for @. and friends
+ }
+ \def\plainnonfrenchspacing{%
+ \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
+ \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
+ \def\endofsentencespacefactor{3000}% for @. and friends
+ }
+\catcode`@=\other
+\def\endofsentencespacefactor{3000}% default
+
+% @t, explicit typewriter.
+\def\t#1{%
+ {\tt \rawbackslash \plainfrenchspacing #1}%
+ \null
+}
+
+% @samp.
+\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
+
+% @indicateurl is \samp, that is, with quotes.
+\let\indicateurl=\samp
+
+% @code (and similar) prints in typewriter, but with spaces the same
+% size as normal in the surrounding text, without hyphenation, etc.
+% This is a subroutine for that.
+\def\tclose#1{%
+ {%
+ % Change normal interword space to be same as for the current font.
+ \spaceskip = \fontdimen2\font
+ %
+ % Switch to typewriter.
+ \tt
+ %
+ % But `\ ' produces the large typewriter interword space.
+ \def\ {{\spaceskip = 0pt{} }}%
+ %
+ % Turn off hyphenation.
+ \nohyphenation
+ %
+ \rawbackslash
+ \plainfrenchspacing
+ #1%
+ }%
+ \null % reset spacefactor to 1000
+}
+
+% We *must* turn on hyphenation at `-' and `_' in @code.
+% (But see \codedashfinish below.)
+% Otherwise, it is too hard to avoid overfull hboxes
+% in the Emacs manual, the Library manual, etc.
+%
+% Unfortunately, TeX uses one parameter (\hyphenchar) to control
+% both hyphenation at - and hyphenation within words.
+% We must therefore turn them both off (\tclose does that)
+% and arrange explicitly to hyphenate at a dash. -- rms.
+{
+ \catcode`\-=\active \catcode`\_=\active
+ \catcode`\'=\active \catcode`\`=\active
+ \global\let'=\rq \global\let`=\lq % default definitions
+ %
+ \global\def\code{\begingroup
+ \setupmarkupstyle{code}%
+ % The following should really be moved into \setupmarkupstyle handlers.
+ \catcode\dashChar=\active \catcode\underChar=\active
+ \ifallowcodebreaks
+ \let-\codedash
+ \let_\codeunder
+ \else
+ \let-\normaldash
+ \let_\realunder
+ \fi
+ % Given -foo (with a single dash), we do not want to allow a break
+ % after the hyphen.
+ \global\let\codedashprev=\codedash
+ %
+ \codex
+ }
+ %
+ \gdef\codedash{\futurelet\next\codedashfinish}
+ \gdef\codedashfinish{%
+ \normaldash % always output the dash character itself.
+ %
+ % Now, output a discretionary to allow a line break, unless
+ % (a) the next character is a -, or
+ % (b) the preceding character is a -.
+ % E.g., given --posix, we do not want to allow a break after either -.
+ % Given --foo-bar, we do want to allow a break between the - and the b.
+ \ifx\next\codedash \else
+ \ifx\codedashprev\codedash
+ \else \discretionary{}{}{}\fi
+ \fi
+ % we need the space after the = for the case when \next itself is a
+ % space token; it would get swallowed otherwise. As in @code{- a}.
+ \global\let\codedashprev= \next
+ }
+}
+\def\normaldash{-}
+%
+\def\codex #1{\tclose{#1}\endgroup}
+
+\def\codeunder{%
+ % this is all so @math{@code{var_name}+1} can work. In math mode, _
+ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
+ % will therefore expand the active definition of _, which is us
+ % (inside @code that is), therefore an endless loop.
+ \ifusingtt{\ifmmode
+ \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
+ \else\normalunderscore \fi
+ \discretionary{}{}{}}%
+ {\_}%
+}
+
+% An additional complication: the above will allow breaks after, e.g.,
+% each of the four underscores in __typeof__. This is bad.
+% @allowcodebreaks provides a document-level way to turn breaking at -
+% and _ on and off.
+%
+\newif\ifallowcodebreaks \allowcodebreakstrue
+
+\def\keywordtrue{true}
+\def\keywordfalse{false}
+
+\parseargdef\allowcodebreaks{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\keywordtrue
+ \allowcodebreakstrue
+ \else\ifx\txiarg\keywordfalse
+ \allowcodebreaksfalse
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
+ \fi\fi
+}
+
+% For @command, @env, @file, @option quotes seem unnecessary,
+% so use \code rather than \samp.
+\let\command=\code
+\let\env=\code
+\let\file=\code
+\let\option=\code
+
+% @uref (abbreviation for `urlref') takes an optional (comma-separated)
+% second argument specifying the text to display and an optional third
+% arg as text to display instead of (rather than in addition to) the url
+% itself. First (mandatory) arg is the url.
+% (This \urefnobreak definition isn't used now, leaving it for a while
+% for comparison.)
+\def\urefnobreak#1{\dourefnobreak #1,,,\finish}
+\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt
+ \unhbox0 % third arg given, show only that
+ \else
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ \unhbox0 % PDF: 2nd arg given, show only it
+ \else
+ \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
+ \fi
+ \else
+ \code{#1}% only url given, so show it
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% This \urefbreak definition is the active one.
+\def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
+\let\uref=\urefbreak
+\def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
+\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt
+ \unhbox0 % third arg given, show only that
+ \else
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ \unhbox0 % PDF: 2nd arg given, show only it
+ \else
+ \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
+ \fi
+ \else
+ \urefcode{#1}% only url given, so show it
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% Allow line breaks around only a few characters (only).
+\def\urefcatcodes{%
+ \catcode\ampChar=\active \catcode\dotChar=\active
+ \catcode\hashChar=\active \catcode\questChar=\active
+ \catcode\slashChar=\active
+}
+{
+ \urefcatcodes
+ %
+ \global\def\urefcode{\begingroup
+ \setupmarkupstyle{code}%
+ \urefcatcodes
+ \let&\urefcodeamp
+ \let.\urefcodedot
+ \let#\urefcodehash
+ \let?\urefcodequest
+ \let/\urefcodeslash
+ \codex
+ }
+ %
+ % By default, they are just regular characters.
+ \global\def&{\normalamp}
+ \global\def.{\normaldot}
+ \global\def#{\normalhash}
+ \global\def?{\normalquest}
+ \global\def/{\normalslash}
+}
+
+% we put a little stretch before and after the breakable chars, to help
+% line breaking of long url's. The unequal skips make look better in
+% cmtt at least, especially for dots.
+\def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
+\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
+%
+\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
+\def\urefcodedot{\urefprestretch .\urefpoststretch}
+\def\urefcodehash{\urefprestretch \#\urefpoststretch}
+\def\urefcodequest{\urefprestretch ?\urefpoststretch}
+\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
+{
+ \catcode`\/=\active
+ \global\def\urefcodeslashfinish{%
+ \urefprestretch \slashChar
+ % Allow line break only after the final / in a sequence of
+ % slashes, to avoid line break between the slashes in http://.
+ \ifx\next/\else \urefpoststretch \fi
+ }
+}
+
+% One more complication: by default we'll break after the special
+% characters, but some people like to break before the special chars, so
+% allow that. Also allow no breaking at all, for manual control.
+%
+\parseargdef\urefbreakstyle{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\wordnone
+ \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
+ \else\ifx\txiarg\wordbefore
+ \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
+ \else\ifx\txiarg\wordafter
+ \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
+ \fi\fi\fi
+}
+\def\wordafter{after}
+\def\wordbefore{before}
+\def\wordnone{none}
+
+\urefbreakstyle after
+
+% @url synonym for @uref, since that's how everyone uses it.
+%
+\let\url=\uref
+
+% rms does not like angle brackets --karl, 17may97.
+% So now @email is just like @uref, unless we are pdf.
+%
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\ifpdf
+ \def\email#1{\doemail#1,,\finish}
+ \def\doemail#1,#2,#3\finish{\begingroup
+ \unsepspaces
+ \pdfurl{mailto:#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+ \endlink
+ \endgroup}
+\else
+ \let\email=\uref
+\fi
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+% `example' (@kbd uses ttsl only inside of @example and friends),
+% or `code' (@kbd uses normal tty font always).
+\parseargdef\kbdinputstyle{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\worddistinct
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+ \else\ifx\txiarg\wordexample
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+ \else\ifx\txiarg\wordcode
+ \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
+ \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is `distinct'.
+\kbdinputstyle distinct
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
+
+\def\xkey{\key}
+\def\kbdsub#1#2#3\par{%
+ \def\one{#1}\def\three{#3}\def\threex{??}%
+ \ifx\one\xkey\ifx\threex\three \key{#2}%
+ \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+ \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+}
+
+% definition of @key that produces a lozenge. Doesn't adjust to text size.
+%\setfont\keyrm\rmshape{8}{1000}{OT1}
+%\font\keysy=cmsy9
+%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+% \vbox{\hrule\kern-0.4pt
+% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+% \kern-0.4pt\hrule}%
+% \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+
+% definition of @key with no lozenge. If the current font is already
+% monospace, don't change it; that way, we respect @kbdinputstyle. But
+% if it isn't monospace, then use \tt.
+%
+\def\key#1{{\setupmarkupstyle{key}%
+ \nohyphenation
+ \ifmonospace\else\tt\fi
+ #1}\null}
+
+% @clicksequence{File @click{} Open ...}
+\def\clicksequence#1{\begingroup #1\endgroup}
+
+% @clickstyle @arrow (by default)
+\parseargdef\clickstyle{\def\click{#1}}
+\def\click{\arrow}
+
+% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
+%
+\def\dmn#1{\thinspace #1}
+
+% @l was never documented to mean ``switch to the Lisp font'',
+% and it is not used as such in any manual I can find. We need it for
+% Polish suppressed-l. --karl, 22sep96.
+%\def\l#1{{\li #1}\null}
+
+% @acronym for "FBI", "NATO", and the like.
+% We print this one point size smaller, since it's intended for
+% all-uppercase.
+%
+\def\acronym#1{\doacronym #1,,\finish}
+\def\doacronym#1,#2,#3\finish{%
+ {\selectfonts\lsize #1}%
+ \def\temp{#2}%
+ \ifx\temp\empty \else
+ \space ({\unsepspaces \ignorespaces \temp \unskip})%
+ \fi
+ \null % reset \spacefactor=1000
+}
+
+% @abbr for "Comput. J." and the like.
+% No font change, but don't do end-of-sentence spacing.
+%
+\def\abbr#1{\doabbr #1,,\finish}
+\def\doabbr#1,#2,#3\finish{%
+ {\plainfrenchspacing #1}%
+ \def\temp{#2}%
+ \ifx\temp\empty \else
+ \space ({\unsepspaces \ignorespaces \temp \unskip})%
+ \fi
+ \null % reset \spacefactor=1000
+}
+
+% @asis just yields its argument. Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math outputs its argument in math mode.
+%
+% One complication: _ usually means subscripts, but it could also mean
+% an actual _ character, as in @math{@var{some_variable} + 1}. So make
+% _ active, and distinguish by seeing if the current family is \slfam,
+% which is what @var uses.
+{
+ \catcode`\_ = \active
+ \gdef\mathunderscore{%
+ \catcode`\_=\active
+ \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
+ }
+}
+% Another complication: we want \\ (and @\) to output a math (or tt) \.
+% FYI, plain.tex uses \\ as a temporary control sequence (for no
+% particular reason), but this is not advertised and we don't care.
+%
+% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
+\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
+%
+\def\math{%
+ \tex
+ \mathunderscore
+ \let\\ = \mathbackslash
+ \mathactive
+ % make the texinfo accent commands work in math mode
+ \let\"=\ddot
+ \let\'=\acute
+ \let\==\bar
+ \let\^=\hat
+ \let\`=\grave
+ \let\u=\breve
+ \let\v=\check
+ \let\~=\tilde
+ \let\dotaccent=\dot
+ $\finishmath
+}
+\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
+
+% Some active characters (such as <) are spaced differently in math.
+% We have to reset their definitions in case the @math was an argument
+% to a command which sets the catcodes (such as @item or @section).
+%
+{
+ \catcode`^ = \active
+ \catcode`< = \active
+ \catcode`> = \active
+ \catcode`+ = \active
+ \catcode`' = \active
+ \gdef\mathactive{%
+ \let^ = \ptexhat
+ \let< = \ptexless
+ \let> = \ptexgtr
+ \let+ = \ptexplus
+ \let' = \ptexquoteright
+ }
+}
+
+% ctrl is no longer a Texinfo command, but leave this definition for fun.
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
+% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
+% except specified as a normal braced arg, so no newlines to worry about.
+%
+\def\outfmtnametex{tex}
+%
+\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
+\long\def\doinlinefmt#1,#2,\finish{%
+ \def\inlinefmtname{#1}%
+ \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
+}
+%
+% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
+% FMTNAME is tex, else ELSE-TEXT.
+\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
+\long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
+ \def\inlinefmtname{#1}%
+ \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
+}
+%
+% For raw, must switch into @tex before parsing the argument, to avoid
+% setting catcodes prematurely. Doing it this way means that, for
+% example, @inlineraw{html, foo{bar} gets a parse error instead of being
+% ignored. But this isn't important because if people want a literal
+% *right* brace they would have to use a command anyway, so they may as
+% well use a command to get a left brace too. We could re-use the
+% delimiter character idea from \verb, but it seems like overkill.
+%
+\long\def\inlineraw{\tex \doinlineraw}
+\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
+\def\doinlinerawtwo#1,#2,\finish{%
+ \def\inlinerawname{#1}%
+ \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
+ \endgroup % close group opened by \tex.
+}
+
+% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
+%
+\long\def\inlineifset#1{\doinlineifset #1,\finish}
+\long\def\doinlineifset#1,#2,\finish{%
+ \def\inlinevarname{#1}%
+ \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
+ \else\ignorespaces#2\fi
+}
+
+% @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
+%
+\long\def\inlineifclear#1{\doinlineifclear #1,\finish}
+\long\def\doinlineifclear#1,#2,\finish{%
+ \def\inlinevarname{#1}%
+ \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
+}
+
+
+\message{glyphs,}
+% and logos.
+
+% @@ prints an @, as does @atchar{}.
+\def\@{\char64 }
+\let\atchar=\@
+
+% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
+% Unless we're in typewriter, use \ecfont because the CM text fonts do
+% not have braces, and we don't want to switch into math.
+\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
+\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
+\let\{=\mylbrace \let\lbracechar=\{
+\let\}=\myrbrace \let\rbracechar=\}
+\begingroup
+ % Definitions to produce \{ and \} commands for indices,
+ % and @{ and @} for the aux/toc files.
+ \catcode`\{ = \other \catcode`\} = \other
+ \catcode`\[ = 1 \catcode`\] = 2
+ \catcode`\! = 0 \catcode`\\ = \other
+ !gdef!lbracecmd[\{]%
+ !gdef!rbracecmd[\}]%
+ !gdef!lbraceatcmd[@{]%
+ !gdef!rbraceatcmd[@}]%
+!endgroup
+
+% @comma{} to avoid , parsing problems.
+\let\comma = ,
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
+\let\, = \ptexc
+\let\dotaccent = \ptexdot
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \ptext
+\let\ubaraccent = \ptexb
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown @ordf @ordm
+% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
+\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+ \def\temp{#1}%
+ \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
+ \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
+ \else \errmessage{@dotless can be used only with i or j}%
+ \fi\fi
+}
+
+% The \TeX{} logo, as in plain, but resetting the spacing so that a
+% period following counts as ending a sentence. (Idea found in latex.)
+%
+\edef\TeX{\TeX \spacefactor=1000 }
+
+% @LaTeX{} logo. Not quite the same results as the definition in
+% latex.ltx, since we use a different font for the raised A; it's most
+% convenient for us to use an explicitly smaller font, rather than using
+% the \scriptstyle font (since we don't reset \scriptstyle and
+% \scriptscriptstyle).
+%
+\def\LaTeX{%
+ L\kern-.36em
+ {\setbox0=\hbox{T}%
+ \vbox to \ht0{\hbox{%
+ \ifx\textnominalsize\xwordpt
+ % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
+ % Revert to plain's \scriptsize, which is 7pt.
+ \count255=\the\fam $\fam\count255 \scriptstyle A$%
+ \else
+ % For 11pt, we can use our lllsize.
+ \selectfonts\lllsize A%
+ \fi
+ }%
+ \vss
+ }}%
+ \kern-.15em
+ \TeX
+}
+
+% Some math mode symbols.
+\def\bullet{$\ptexbullet$}
+\def\geq{\ifmmode \ge\else $\ge$\fi}
+\def\leq{\ifmmode \le\else $\le$\fi}
+\def\minus{\ifmmode -\else $-$\fi}
+
+% @dots{} outputs an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in the cm
+% typewriter fonts as three actual period characters; on the other hand,
+% in other typewriter fonts three periods are wider than 1.5em. So do
+% whichever is larger.
+%
+\def\dots{%
+ \leavevmode
+ \setbox0=\hbox{...}% get width of three periods
+ \ifdim\wd0 > 1.5em
+ \dimen0 = \wd0
+ \else
+ \dimen0 = 1.5em
+ \fi
+ \hbox to \dimen0{%
+ \hskip 0pt plus.25fil
+ .\hskip 0pt plus1fil
+ .\hskip 0pt plus1fil
+ .\hskip 0pt plus.5fil
+ }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \dots
+ \spacefactor=\endofsentencespacefactor
+}
+
+% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
+%
+% Since these characters are used in examples, they should be an even number of
+% \tt widths. Each \tt character is 1en, so two makes it 1em.
+%
+\def\point{$\star$}
+\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
+\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
+\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
+\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
+\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
+
+% The @error{} command.
+% Adapted from the TeXbook's \boxit.
+%
+\newbox\errorbox
+%
+{\tentt \global\dimen0 = 3em}% Width of the box.
+\dimen2 = .55pt % Thickness of rules
+% The text. (`r' is open on the right, `e' somewhat less so on the left.)
+\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
+%
+\setbox\errorbox=\hbox to \dimen0{\hfil
+ \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
+ \advance\hsize by -2\dimen2 % Rules.
+ \vbox{%
+ \hrule height\dimen2
+ \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
+ \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
+ \kern3pt\vrule width\dimen2}% Space to right.
+ \hrule height\dimen2}
+ \hfil}
+%
+\def\error{\leavevmode\lower.7ex\copy\errorbox}
+
+% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
+%
+\def\pounds{{\it\$}}
+
+% @euro{} comes from a separate font, depending on the current style.
+% We use the free feym* fonts from the eurosym package by Henrik
+% Theiling, which support regular, slanted, bold and bold slanted (and
+% "outlined" (blackboard board, sort of) versions, which we don't need).
+% It is available from https://www.ctan.org/tex-archive/fonts/eurosym.
+%
+% Although only regular is the truly official Euro symbol, we ignore
+% that. The Euro is designed to be slightly taller than the regular
+% font height.
+%
+% feymr - regular
+% feymo - slanted
+% feybr - bold
+% feybo - bold slanted
+%
+% There is no good (free) typewriter version, to my knowledge.
+% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
+% Hmm.
+%
+% Also doesn't work in math. Do we need to do math with euro symbols?
+% Hope not.
+%
+%
+\def\euro{{\eurofont e}}
+\def\eurofont{%
+ % We set the font at each command, rather than predefining it in
+ % \textfonts and the other font-switching commands, so that
+ % installations which never need the symbol don't have to have the
+ % font installed.
+ %
+ % There is only one designed size (nominal 10pt), so we always scale
+ % that to the current nominal size.
+ %
+ % By the way, simply using "at 1em" works for cmr10 and the like, but
+ % does not work for cmbx10 and other extended/shrunken fonts.
+ %
+ \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
+ %
+ \ifx\curfontstyle\bfstylename
+ % bold:
+ \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
+ \else
+ % regular:
+ \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
+ \fi
+ \thiseurofont
+}
+
+% Glyphs from the EC fonts. We don't use \let for the aliases, because
+% sometimes we redefine the original macro, and the alias should reflect
+% the redefinition.
+%
+% Use LaTeX names for the Icelandic letters.
+\def\DH{{\ecfont \char"D0}} % Eth
+\def\dh{{\ecfont \char"F0}} % eth
+\def\TH{{\ecfont \char"DE}} % Thorn
+\def\th{{\ecfont \char"FE}} % thorn
+%
+\def\guillemetleft{{\ecfont \char"13}}
+\def\guillemotleft{\guillemetleft}
+\def\guillemetright{{\ecfont \char"14}}
+\def\guillemotright{\guillemetright}
+\def\guilsinglleft{{\ecfont \char"0E}}
+\def\guilsinglright{{\ecfont \char"0F}}
+\def\quotedblbase{{\ecfont \char"12}}
+\def\quotesinglbase{{\ecfont \char"0D}}
+%
+% This positioning is not perfect (see the ogonek LaTeX package), but
+% we have the precomposed glyphs for the most common cases. We put the
+% tests to use those glyphs in the single \ogonek macro so we have fewer
+% dummy definitions to worry about for index entries, etc.
+%
+% ogonek is also used with other letters in Lithuanian (IOU), but using
+% the precomposed glyphs for those is not so easy since they aren't in
+% the same EC font.
+\def\ogonek#1{{%
+ \def\temp{#1}%
+ \ifx\temp\macrocharA\Aogonek
+ \else\ifx\temp\macrochara\aogonek
+ \else\ifx\temp\macrocharE\Eogonek
+ \else\ifx\temp\macrochare\eogonek
+ \else
+ \ecfont \setbox0=\hbox{#1}%
+ \ifdim\ht0=1ex\accent"0C #1%
+ \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
+ \fi
+ \fi\fi\fi\fi
+ }%
+}
+\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
+\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
+\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
+\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
+%
+% Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
+\def\ecfont{%
+ % We can't distinguish serif/sans and italic/slanted, but this
+ % is used for crude hacks anyway (like adding French and German
+ % quotes to documents typeset with CM, where we lose kerning), so
+ % hopefully nobody will notice/care.
+ \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
+ \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
+ \ifmonospace
+ % typewriter:
+ \font\thisecfont = ectt\ecsize \space at \nominalsize
+ \else
+ \ifx\curfontstyle\bfstylename
+ % bold:
+ \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
+ \else
+ % regular:
+ \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
+ \fi
+ \fi
+ \thisecfont
+}
+
+% @registeredsymbol - R in a circle. The font for the R should really
+% be smaller yet, but lllsize is the best we can do for now.
+% Adapted from the plain.tex definition of \copyright.
+%
+\def\registeredsymbol{%
+ $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
+ \hfil\crcr\Orb}}%
+ }$%
+}
+
+% @textdegree - the normal degrees sign.
+%
+\def\textdegree{$^\circ$}
+
+% Laurent Siebenmann reports \Orb undefined with:
+% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
+% so we'll define it if necessary.
+%
+\ifx\Orb\thisisundefined
+\def\Orb{\mathhexbox20D}
+\fi
+
+% Quotes.
+\chardef\quotedblleft="5C
+\chardef\quotedblright=`\"
+\chardef\quoteleft=`\`
+\chardef\quoteright=`\'
+
+
+\message{page headings,}
+
+\newskip\titlepagetopglue \titlepagetopglue = 1.5in
+\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
+
+% First the title page. Must do @settitle before @titlepage.
+\newif\ifseenauthor
+\newif\iffinishedtitlepage
+
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
+%
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
+\parseargdef\shorttitlepage{%
+ \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+ \endgroup\page\hbox{}\page}
+
+\envdef\titlepage{%
+ % Open one extra group, as we want to close it in the middle of \Etitlepage.
+ \begingroup
+ \parindent=0pt \textfonts
+ % Leave some space at the very top of the page.
+ \vglue\titlepagetopglue
+ % No rule at page bottom unless we print one at the top with @title.
+ \finishedtitlepagetrue
+ %
+ % Most title ``pages'' are actually two pages long, with space
+ % at the top of the second. We don't want the ragged left on the second.
+ \let\oldpage = \page
+ \def\page{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ \let\page = \oldpage
+ \page
+ \null
+ }%
+}
+
+\def\Etitlepage{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ % It is important to do the page break before ending the group,
+ % because the headline and footline are only empty inside the group.
+ % If we use the new definition of \page, we always get a blank page
+ % after the title page, which we certainly don't want.
+ \oldpage
+ \endgroup
+ %
+ % Need this before the \...aftertitlepage checks so that if they are
+ % in effect the toc pages will come out with page numbers.
+ \HEADINGSon
+ %
+ % If they want short, they certainly want long too.
+ \ifsetshortcontentsaftertitlepage
+ \shortcontents
+ \contents
+ \global\let\shortcontents = \relax
+ \global\let\contents = \relax
+ \fi
+ %
+ \ifsetcontentsaftertitlepage
+ \contents
+ \global\let\contents = \relax
+ \global\let\shortcontents = \relax
+ \fi
+}
+
+\def\finishtitlepage{%
+ \vskip4pt \hrule height 2pt width \hsize
+ \vskip\titlepagebottomglue
+ \finishedtitlepagetrue
+}
+
+% Settings used for typesetting titles: no hyphenation, no indentation,
+% don't worry much about spacing, ragged right. This should be used
+% inside a \vbox, and fonts need to be set appropriately first. Because
+% it is always used for titles, nothing else, we call \rmisbold. \par
+% should be specified before the end of the \vbox, since a vbox is a group.
+%
+\def\raggedtitlesettings{%
+ \rmisbold
+ \hyphenpenalty=10000
+ \parindent=0pt
+ \tolerance=5000
+ \ptexraggedright
+}
+
+% Macros to be used within @titlepage:
+
+\let\subtitlerm=\tenrm
+\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
+
+\parseargdef\title{%
+ \checkenv\titlepage
+ \vbox{\titlefonts \raggedtitlesettings #1\par}%
+ % print a rule at the page bottom also.
+ \finishedtitlepagefalse
+ \vskip4pt \hrule height 4pt width \hsize \vskip4pt
+}
+
+\parseargdef\subtitle{%
+ \checkenv\titlepage
+ {\subtitlefont \rightline{#1}}%
+}
+
+% @author should come last, but may come many times.
+% It can also be used inside @quotation.
+%
+\parseargdef\author{%
+ \def\temp{\quotation}%
+ \ifx\thisenv\temp
+ \def\quotationauthor{#1}% printed in \Equotation.
+ \else
+ \checkenv\titlepage
+ \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
+ {\secfonts\rmisbold \leftline{#1}}%
+ \fi
+}
+
+
+% Set up page headings and footings.
+
+\let\thispage=\folio
+
+\newtoks\evenheadline % headline on even pages
+\newtoks\oddheadline % headline on odd pages
+\newtoks\evenfootline % footline on even pages
+\newtoks\oddfootline % footline on odd pages
+
+% Now make TeX use those variables
+\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
+ \else \the\evenheadline \fi}}
+\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
+ \else \the\evenfootline \fi}\HEADINGShook}
+\let\HEADINGShook=\relax
+
+% Commands to set those variables.
+% For example, this is what @headings on does
+% @evenheading @thistitle|@thispage|@thischapter
+% @oddheading @thischapter|@thispage|@thistitle
+% @evenfooting @thisfile||
+% @oddfooting ||@thisfile
+
+
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
+\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
+\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
+
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
+\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
+\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
+ \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+ %
+ % Leave some space for the footline. Hopefully ok to assume
+ % @evenfooting will not be used by itself.
+ \global\advance\pageheight by -12pt
+ \global\advance\vsize by -12pt
+}
+
+\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
+
+% @evenheadingmarks top \thischapter <- chapter at the top of a page
+% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
+%
+% The same set of arguments for:
+%
+% @oddheadingmarks
+% @evenfootingmarks
+% @oddfootingmarks
+% @everyheadingmarks
+% @everyfootingmarks
+
+\def\evenheadingmarks{\headingmarks{even}{heading}}
+\def\oddheadingmarks{\headingmarks{odd}{heading}}
+\def\evenfootingmarks{\headingmarks{even}{footing}}
+\def\oddfootingmarks{\headingmarks{odd}{footing}}
+\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
+ \headingmarks{odd}{heading}{#1} }
+\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
+ \headingmarks{odd}{footing}{#1} }
+% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
+\def\headingmarks#1#2#3 {%
+ \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
+ \global\expandafter\let\csname get#1#2marks\endcsname \temp
+}
+
+\everyheadingmarks bottom
+\everyfootingmarks bottom
+
+% @headings double turns headings on for double-sided printing.
+% @headings single turns headings on for single-sided printing.
+% @headings off turns them off.
+% @headings on same as @headings double, retained for compatibility.
+% @headings after turns on double-sided headings after this page.
+% @headings doubleafter turns on double-sided headings after this page.
+% @headings singleafter turns on single-sided headings after this page.
+% By default, they are off at the start of a document,
+% and turned `on' after @end titlepage.
+
+\def\headings #1 {\csname HEADINGS#1\endcsname}
+
+\def\headingsoff{% non-global headings elimination
+ \evenheadline={\hfil}\evenfootline={\hfil}%
+ \oddheadline={\hfil}\oddfootline={\hfil}%
+}
+
+\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
+\HEADINGSoff % it's the default
+
+% When we turn headings on, set the page number to 1.
+% For double-sided printing, put current file name in lower left corner,
+% chapter name on inside top of right hand pages, document
+% title on inside top of left hand pages, and page numbers on outside top
+% edge of all pages.
+\def\HEADINGSdouble{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+\let\contentsalignmacro = \chappager
+
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingle{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+\def\HEADINGSon{\HEADINGSdouble}
+
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\let\HEADINGSdoubleafter=\HEADINGSafter
+\def\HEADINGSdoublex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
+\def\HEADINGSsinglex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% Subroutines used in generating headings
+% This produces Day Month Year style of output.
+% Only define if not already defined, in case a txi-??.tex file has set
+% up a different format (e.g., txi-cs.tex does this).
+\ifx\today\thisisundefined
+\def\today{%
+ \number\day\space
+ \ifcase\month
+ \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
+ \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
+ \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
+ \fi
+ \space\number\year}
+\fi
+
+% @settitle line... specifies the title of the document, for headings.
+% It generates no output of its own.
+\def\thistitle{\putwordNoTitle}
+\def\settitle{\parsearg{\gdef\thistitle}}
+
+
+\message{tables,}
+% Tables -- @table, @ftable, @vtable, @item(x).
+
+% default indentation of table text
+\newdimen\tableindent \tableindent=.8in
+% default indentation of @itemize and @enumerate text
+\newdimen\itemindent \itemindent=.3in
+% margin between end of table item and start of table text.
+\newdimen\itemmargin \itemmargin=.1in
+
+% used internally for \itemindent minus \itemmargin
+\newdimen\itemmax
+
+% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
+% these defs.
+% They also define \itemindex
+% to index the item name in whatever manner is desired (perhaps none).
+
+\newif\ifitemxneedsnegativevskip
+
+\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
+
+\def\internalBitem{\smallbreak \parsearg\itemzzz}
+\def\internalBitemx{\itemxpar \parsearg\itemzzz}
+
+\def\itemzzz #1{\begingroup %
+ \advance\hsize by -\rightskip
+ \advance\hsize by -\tableindent
+ \setbox0=\hbox{\itemindicate{#1}}%
+ \itemindex{#1}%
+ \nobreak % This prevents a break before @itemx.
+ %
+ % If the item text does not fit in the space we have, put it on a line
+ % by itself, and do not allow a page break either before or after that
+ % line. We do not start a paragraph here because then if the next
+ % command is, e.g., @kindex, the whatsit would get put into the
+ % horizontal list on a line by itself, resulting in extra blank space.
+ \ifdim \wd0>\itemmax
+ %
+ % Make this a paragraph so we get the \parskip glue and wrapping,
+ % but leave it ragged-right.
+ \begingroup
+ \advance\leftskip by-\tableindent
+ \advance\hsize by\tableindent
+ \advance\rightskip by0pt plus1fil\relax
+ \leavevmode\unhbox0\par
+ \endgroup
+ %
+ % We're going to be starting a paragraph, but we don't want the
+ % \parskip glue -- logically it's part of the @item we just started.
+ \nobreak \vskip-\parskip
+ %
+ % Stop a page break at the \parskip glue coming up. However, if
+ % what follows is an environment such as @example, there will be no
+ % \parskip glue; then the negative vskip we just inserted would
+ % cause the example and the item to crash together. So we use this
+ % bizarre value of 10001 as a signal to \aboveenvbreak to insert
+ % \parskip glue after all. Section titles are handled this way also.
+ %
+ \penalty 10001
+ \endgroup
+ \itemxneedsnegativevskipfalse
+ \else
+ % The item text fits into the space. Start a paragraph, so that the
+ % following text (if any) will end up on the same line.
+ \noindent
+ % Do this with kerns and \unhbox so that if there is a footnote in
+ % the item text, it can migrate to the main vertical list and
+ % eventually be printed.
+ \nobreak\kern-\tableindent
+ \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+ \unhbox0
+ \nobreak\kern\dimen0
+ \endgroup
+ \itemxneedsnegativevskiptrue
+ \fi
+}
+
+\def\item{\errmessage{@item while not in a list environment}}
+\def\itemx{\errmessage{@itemx while not in a list environment}}
+
+% @table, @ftable, @vtable.
+\envdef\table{%
+ \let\itemindex\gobble
+ \tablecheck{table}%
+}
+\envdef\ftable{%
+ \def\itemindex ##1{\doind {fn}{\code{##1}}}%
+ \tablecheck{ftable}%
+}
+\envdef\vtable{%
+ \def\itemindex ##1{\doind {vr}{\code{##1}}}%
+ \tablecheck{vtable}%
+}
+\def\tablecheck#1{%
+ \ifnum \the\catcode`\^^M=\active
+ \endgroup
+ \errmessage{This command won't work in this context; perhaps the problem is
+ that we are \inenvironment\thisenv}%
+ \def\next{\doignore{#1}}%
+ \else
+ \let\next\tablex
+ \fi
+ \next
+}
+\def\tablex#1{%
+ \def\itemindicate{#1}%
+ \parsearg\tabley
+}
+\def\tabley#1{%
+ {%
+ \makevalueexpandable
+ \edef\temp{\noexpand\tablez #1\space\space\space}%
+ \expandafter
+ }\temp \endtablez
+}
+\def\tablez #1 #2 #3 #4\endtablez{%
+ \aboveenvbreak
+ \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
+ \ifnum 0#2>0 \tableindent=#2\mil \fi
+ \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
+ \itemmax=\tableindent
+ \advance \itemmax by -\itemmargin
+ \advance \leftskip by \tableindent
+ \exdentamount=\tableindent
+ \parindent = 0pt
+ \parskip = \smallskipamount
+ \ifdim \parskip=0pt \parskip=2pt \fi
+ \let\item = \internalBitem
+ \let\itemx = \internalBitemx
+}
+\def\Etable{\endgraf\afterenvbreak}
+\let\Eftable\Etable
+\let\Evtable\Etable
+\let\Eitemize\Etable
+\let\Eenumerate\Etable
+
+% This is the counter used by @enumerate, which is really @itemize
+
+\newcount \itemno
+
+\envdef\itemize{\parsearg\doitemize}
+
+\def\doitemize#1{%
+ \aboveenvbreak
+ \itemmax=\itemindent
+ \advance\itemmax by -\itemmargin
+ \advance\leftskip by \itemindent
+ \exdentamount=\itemindent
+ \parindent=0pt
+ \parskip=\smallskipamount
+ \ifdim\parskip=0pt \parskip=2pt \fi
+ %
+ % Try typesetting the item mark that if the document erroneously says
+ % something like @itemize @samp (intending @table), there's an error
+ % right away at the @itemize. It's not the best error message in the
+ % world, but it's better than leaving it to the @item. This means if
+ % the user wants an empty mark, they have to say @w{} not just @w.
+ \def\itemcontents{#1}%
+ \setbox0 = \hbox{\itemcontents}%
+ %
+ % @itemize with no arg is equivalent to @itemize @bullet.
+ \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
+ %
+ \let\item=\itemizeitem
+}
+
+% Definition of @item while inside @itemize and @enumerate.
+%
+\def\itemizeitem{%
+ \advance\itemno by 1 % for enumerations
+ {\let\par=\endgraf \smallbreak}% reasonable place to break
+ {%
+ % If the document has an @itemize directly after a section title, a
+ % \nobreak will be last on the list, and \sectionheading will have
+ % done a \vskip-\parskip. In that case, we don't want to zero
+ % parskip, or the item text will crash with the heading. On the
+ % other hand, when there is normal text preceding the item (as there
+ % usually is), we do want to zero parskip, or there would be too much
+ % space. In that case, we won't have a \nobreak before. At least
+ % that's the theory.
+ \ifnum\lastpenalty<10000 \parskip=0in \fi
+ \noindent
+ \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
+ %
+ \vadjust{\penalty 1200}}% not good to break after first line of item.
+ \flushcr
+}
+
+% \splitoff TOKENS\endmark defines \first to be the first token in
+% TOKENS, and \rest to be the remainder.
+%
+\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
+
+% Allow an optional argument of an uppercase letter, lowercase letter,
+% or number, to specify the first label in the enumerated list. No
+% argument is the same as `1'.
+%
+\envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
+\def\enumeratey #1 #2\endenumeratey{%
+ % If we were given no argument, pretend we were given `1'.
+ \def\thearg{#1}%
+ \ifx\thearg\empty \def\thearg{1}\fi
+ %
+ % Detect if the argument is a single token. If so, it might be a
+ % letter. Otherwise, the only valid thing it can be is a number.
+ % (We will always have one token, because of the test we just made.
+ % This is a good thing, since \splitoff doesn't work given nothing at
+ % all -- the first parameter is undelimited.)
+ \expandafter\splitoff\thearg\endmark
+ \ifx\rest\empty
+ % Only one token in the argument. It could still be anything.
+ % A ``lowercase letter'' is one whose \lccode is nonzero.
+ % An ``uppercase letter'' is one whose \lccode is both nonzero, and
+ % not equal to itself.
+ % Otherwise, we assume it's a number.
+ %
+ % We need the \relax at the end of the \ifnum lines to stop TeX from
+ % continuing to look for a <number>.
+ %
+ \ifnum\lccode\expandafter`\thearg=0\relax
+ \numericenumerate % a number (we hope)
+ \else
+ % It's a letter.
+ \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
+ \lowercaseenumerate % lowercase letter
+ \else
+ \uppercaseenumerate % uppercase letter
+ \fi
+ \fi
+ \else
+ % Multiple tokens in the argument. We hope it's a number.
+ \numericenumerate
+ \fi
+}
+
+% An @enumerate whose labels are integers. The starting integer is
+% given in \thearg.
+%
+\def\numericenumerate{%
+ \itemno = \thearg
+ \startenumeration{\the\itemno}%
+}
+
+% The starting (lowercase) letter is in \thearg.
+\def\lowercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more lowercase letters in @enumerate; get a bigger
+ alphabet}%
+ \fi
+ \char\lccode\itemno
+ }%
+}
+
+% The starting (uppercase) letter is in \thearg.
+\def\uppercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more uppercase letters in @enumerate; get a bigger
+ alphabet}
+ \fi
+ \char\uccode\itemno
+ }%
+}
+
+% Call \doitemize, adding a period to the first argument and supplying the
+% common last two arguments. Also subtract one from the initial value in
+% \itemno, since @item increments \itemno.
+%
+\def\startenumeration#1{%
+ \advance\itemno by -1
+ \doitemize{#1.}\flushcr
+}
+
+% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
+% to @enumerate.
+%
+\def\alphaenumerate{\enumerate{a}}
+\def\capsenumerate{\enumerate{A}}
+\def\Ealphaenumerate{\Eenumerate}
+\def\Ecapsenumerate{\Eenumerate}
+
+
+% @multitable macros
+% Amy Hendrickson, 8/18/94, 3/6/96
+%
+% @multitable ... @end multitable will make as many columns as desired.
+% Contents of each column will wrap at width given in preamble. Width
+% can be specified either with sample text given in a template line,
+% or in percent of \hsize, the current width of text on page.
+
+% Table can continue over pages but will only break between lines.
+
+% To make preamble:
+%
+% Either define widths of columns in terms of percent of \hsize:
+% @multitable @columnfractions .25 .3 .45
+% @item ...
+%
+% Numbers following @columnfractions are the percent of the total
+% current hsize to be used for each column. You may use as many
+% columns as desired.
+
+
+% Or use a template:
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item ...
+% using the widest term desired in each column.
+
+% Each new table line starts with @item, each subsequent new column
+% starts with @tab. Empty columns may be produced by supplying @tab's
+% with nothing between them for as many times as empty columns are needed,
+% ie, @tab@tab@tab will produce two empty columns.
+
+% @item, @tab do not need to be on their own lines, but it will not hurt
+% if they are.
+
+% Sample multitable:
+
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item first col stuff @tab second col stuff @tab third col
+% @item
+% first col stuff
+% @tab
+% second col stuff
+% @tab
+% third col
+% @item first col stuff @tab second col stuff
+% @tab Many paragraphs of text may be used in any column.
+%
+% They will wrap at the width determined by the template.
+% @item@tab@tab This will be in third column.
+% @end multitable
+
+% Default dimensions may be reset by user.
+% @multitableparskip is vertical space between paragraphs in table.
+% @multitableparindent is paragraph indent in table.
+% @multitablecolmargin is horizontal space to be left between columns.
+% @multitablelinespace is space to leave between table items, baseline
+% to baseline.
+% 0pt means it depends on current normal line spacing.
+%
+\newskip\multitableparskip
+\newskip\multitableparindent
+\newdimen\multitablecolspace
+\newskip\multitablelinespace
+\multitableparskip=0pt
+\multitableparindent=6pt
+\multitablecolspace=12pt
+\multitablelinespace=0pt
+
+% Macros used to set up halign preamble:
+%
+\let\endsetuptable\relax
+\def\xendsetuptable{\endsetuptable}
+\let\columnfractions\relax
+\def\xcolumnfractions{\columnfractions}
+\newif\ifsetpercent
+
+% #1 is the @columnfraction, usually a decimal number like .5, but might
+% be just 1. We just use it, whatever it is.
+%
+\def\pickupwholefraction#1 {%
+ \global\advance\colcount by 1
+ \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
+ \setuptable
+}
+
+\newcount\colcount
+\def\setuptable#1{%
+ \def\firstarg{#1}%
+ \ifx\firstarg\xendsetuptable
+ \let\go = \relax
+ \else
+ \ifx\firstarg\xcolumnfractions
+ \global\setpercenttrue
+ \else
+ \ifsetpercent
+ \let\go\pickupwholefraction
+ \else
+ \global\advance\colcount by 1
+ \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
+ % separator; typically that is always in the input, anyway.
+ \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \fi
+ \fi
+ \ifx\go\pickupwholefraction
+ % Put the argument back for the \pickupwholefraction call, so
+ % we'll always have a period there to be parsed.
+ \def\go{\pickupwholefraction#1}%
+ \else
+ \let\go = \setuptable
+ \fi%
+ \fi
+ \go
+}
+
+% multitable-only commands.
+%
+% @headitem starts a heading row, which we typeset in bold.
+% Assignments have to be global since we are inside the implicit group
+% of an alignment entry. \everycr resets \everytab so we don't have to
+% undo it ourselves.
+\def\headitemfont{\b}% for people to use in the template row; not changeable
+\def\headitem{%
+ \checkenv\multitable
+ \crcr
+ \global\everytab={\bf}% can't use \headitemfont since the parsing differs
+ \the\everytab % for the first item
+}%
+%
+% A \tab used to include \hskip1sp. But then the space in a template
+% line is not enough. That is bad. So let's go back to just `&' until
+% we again encounter the problem the 1sp was intended to solve.
+% --karl, nathan@acm.org, 20apr99.
+\def\tab{\checkenv\multitable &\the\everytab}%
+
+% @multitable ... @end multitable definitions:
+%
+\newtoks\everytab % insert after every tab.
+%
+\envdef\multitable{%
+ \vskip\parskip
+ \startsavinginserts
+ %
+ % @item within a multitable starts a normal row.
+ % We use \def instead of \let so that if one of the multitable entries
+ % contains an @itemize, we don't choke on the \item (seen as \crcr aka
+ % \endtemplate) expanding \doitemize.
+ \def\item{\crcr}%
+ %
+ \tolerance=9500
+ \hbadness=9500
+ \setmultitablespacing
+ \parskip=\multitableparskip
+ \parindent=\multitableparindent
+ \overfullrule=0pt
+ \global\colcount=0
+ %
+ \everycr = {%
+ \noalign{%
+ \global\everytab={}%
+ \global\colcount=0 % Reset the column counter.
+ % Check for saved footnotes, etc.
+ \checkinserts
+ % Keeps underfull box messages off when table breaks over pages.
+ %\filbreak
+ % Maybe so, but it also creates really weird page breaks when the
+ % table breaks over pages. Wouldn't \vfil be better? Wait until the
+ % problem manifests itself, so it can be fixed for real --karl.
+ }%
+ }%
+ %
+ \parsearg\domultitable
+}
+\def\domultitable#1{%
+ % To parse everything between @multitable and @item:
+ \setuptable#1 \endsetuptable
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+ \halign\bgroup &%
+ \global\advance\colcount by 1
+ \multistrut
+ \vtop{%
+ % Use the current \colcount to find the correct column width:
+ \hsize=\expandafter\csname col\the\colcount\endcsname
+ %
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ %
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ %
+ % If the user has set preamble in terms of percent of \hsize we will
+ % use that dimension as the width of the column, and the \leftskip
+ % will keep entries from bumping into each other. Table will start at
+ % left margin and final column will justify at right margin.
+ %
+ % Make sure we don't inherit \rightskip from the outer environment.
+ \rightskip=0pt
+ \ifnum\colcount=1
+ % The first column will be indented with the surrounding text.
+ \advance\hsize by\leftskip
+ \else
+ \ifsetpercent \else
+ % If user has not set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace.
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+ \leftskip=\multitablecolspace
+ \fi
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively
+ % marking characters.
+ \noindent\ignorespaces##\unskip\multistrut
+ }\cr
+}
+\def\Emultitable{%
+ \crcr
+ \egroup % end the \halign
+ \global\setpercentfalse
+}
+
+\def\setmultitablespacing{%
+ \def\multistrut{\strut}% just use the standard line spacing
+ %
+ % Compute \multitablelinespace (if not defined by user) for use in
+ % \multitableparskip calculation. We used define \multistrut based on
+ % this, but (ironically) that caused the spacing to be off.
+ % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
+\ifdim\multitablelinespace=0pt
+\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
+\global\advance\multitablelinespace by-\ht0
+\fi
+% Test to see if parskip is larger than space between lines of
+% table. If not, do nothing.
+% If so, set to same dimension as multitablelinespace.
+\ifdim\multitableparskip>\multitablelinespace
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
+ % than skip between lines in the table.
+\fi%
+\ifdim\multitableparskip=0pt
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
+ % than skip between lines in the table.
+\fi}
+
+
+\message{conditionals,}
+
+% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
+% @ifnotxml always succeed. They currently do nothing; we don't
+% attempt to check whether the conditionals are properly nested. But we
+% have to remember that they are conditionals, so that @end doesn't
+% attempt to close an environment group.
+%
+\def\makecond#1{%
+ \expandafter\let\csname #1\endcsname = \relax
+ \expandafter\let\csname iscond.#1\endcsname = 1
+}
+\makecond{iftex}
+\makecond{ifnotdocbook}
+\makecond{ifnothtml}
+\makecond{ifnotinfo}
+\makecond{ifnotplaintext}
+\makecond{ifnotxml}
+
+% Ignore @ignore, @ifhtml, @ifinfo, and the like.
+%
+\def\direntry{\doignore{direntry}}
+\def\documentdescription{\doignore{documentdescription}}
+\def\docbook{\doignore{docbook}}
+\def\html{\doignore{html}}
+\def\ifdocbook{\doignore{ifdocbook}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\ifplaintext{\doignore{ifplaintext}}
+\def\ifxml{\doignore{ifxml}}
+\def\ignore{\doignore{ignore}}
+\def\menu{\doignore{menu}}
+\def\xml{\doignore{xml}}
+
+% Ignore text until a line `@end #1', keeping track of nested conditionals.
+%
+% A count to remember the depth of nesting.
+\newcount\doignorecount
+
+\def\doignore#1{\begingroup
+ % Scan in ``verbatim'' mode:
+ \obeylines
+ \catcode`\@ = \other
+ \catcode`\{ = \other
+ \catcode`\} = \other
+ %
+ % Make sure that spaces turn into tokens that match what \doignoretext wants.
+ \spaceisspace
+ %
+ % Count number of #1's that we've seen.
+ \doignorecount = 0
+ %
+ % Swallow text until we reach the matching `@end #1'.
+ \dodoignore{#1}%
+}
+
+{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
+ \obeylines %
+ %
+ \gdef\dodoignore#1{%
+ % #1 contains the command name as a string, e.g., `ifinfo'.
+ %
+ % Define a command to find the next `@end #1'.
+ \long\def\doignoretext##1^^M@end #1{%
+ \doignoretextyyy##1^^M@#1\_STOP_}%
+ %
+ % And this command to find another #1 command, at the beginning of a
+ % line. (Otherwise, we would consider a line `@c @ifset', for
+ % example, to count as an @ifset for nesting.)
+ \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
+ %
+ % And now expand that command.
+ \doignoretext ^^M%
+ }%
+}
+
+\def\doignoreyyy#1{%
+ \def\temp{#1}%
+ \ifx\temp\empty % Nothing found.
+ \let\next\doignoretextzzz
+ \else % Found a nested condition, ...
+ \advance\doignorecount by 1
+ \let\next\doignoretextyyy % ..., look for another.
+ % If we're here, #1 ends with ^^M\ifinfo (for example).
+ \fi
+ \next #1% the token \_STOP_ is present just after this macro.
+}
+
+% We have to swallow the remaining "\_STOP_".
+%
+\def\doignoretextzzz#1{%
+ \ifnum\doignorecount = 0 % We have just found the outermost @end.
+ \let\next\enddoignore
+ \else % Still inside a nested condition.
+ \advance\doignorecount by -1
+ \let\next\doignoretext % Look for the next @end.
+ \fi
+ \next
+}
+
+% Finish off ignored text.
+{ \obeylines%
+ % Ignore anything after the last `@end #1'; this matters in verbatim
+ % environments, where otherwise the newline after an ignored conditional
+ % would result in a blank line in the output.
+ \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
+}
+
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it.
+% We rely on the fact that \parsearg sets \catcode`\ =10.
+%
+\parseargdef\set{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+ {%
+ \makevalueexpandable
+ \def\temp{#2}%
+ \edef\next{\gdef\makecsname{SET#1}}%
+ \ifx\temp\empty
+ \next{}%
+ \else
+ \setzzz#2\endsetzzz
+ \fi
+ }%
+}
+% Remove the trailing space \setxxx inserted.
+\def\setzzz#1 \endsetzzz{\next{#1}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\parseargdef\clear{%
+ {%
+ \makevalueexpandable
+ \global\expandafter\let\csname SET#1\endcsname=\relax
+ }%
+}
+
+% @value{foo} gets the text saved in variable foo.
+\def\value{\begingroup\makevalueexpandable\valuexxx}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+{
+ \catcode`\-=\active \catcode`\_=\active
+ %
+ \gdef\makevalueexpandable{%
+ \let\value = \expandablevalue
+ % We don't want these characters active, ...
+ \catcode`\-=\other \catcode`\_=\other
+ % ..., but we might end up with active ones in the argument if
+ % we're called from @code, as @code{@value{foo-bar_}}, though.
+ % So \let them to their normal equivalents.
+ \let-\normaldash \let_\normalunderscore
+ }
+}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we call \makevalueexpandable in \indexdummies).
+% The command has to be fully expandable (if the variable is set), since
+% the result winds up in the index file. This means that if the
+% variable's value contains other Texinfo commands, it's almost certain
+% it will fail (although perhaps we could fix that with sufficient work
+% to do a one-level expansion on the result, instead of complete).
+%
+% Unfortunately, this has the consequence that when _ is in the *value*
+% of an @set, it does not print properly in the roman fonts (get the cmr
+% dot accent at position 126 instead). No fix comes to mind, and it's
+% been this way since 2003 or earlier, so just ignore it.
+%
+\def\expandablevalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ {[No value for ``#1'']}%
+ \message{Variable `#1', used in @value, is not set.}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+% To get the special treatment we need for `@end ifset,' we call
+% \makecond and then redefine.
+%
+\makecond{ifset}
+\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
+\def\doifset#1#2{%
+ {%
+ \makevalueexpandable
+ \let\next=\empty
+ \expandafter\ifx\csname SET#2\endcsname\relax
+ #1% If not set, redefine \next.
+ \fi
+ \expandafter
+ }\next
+}
+\def\ifsetfail{\doignore{ifset}}
+
+% @ifclear VAR ... @end executes the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+% The `\else' inside the `\doifset' parameter is a trick to reuse the
+% above code: if the variable is not set, do nothing, if it is set,
+% then redefine \next to \ifclearfail.
+%
+\makecond{ifclear}
+\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
+\def\ifclearfail{\doignore{ifclear}}
+
+% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
+% without the @) is in fact defined. We can only feasibly check at the
+% TeX level, so something like `mathcode' is going to considered
+% defined even though it is not a Texinfo command.
+%
+\makecond{ifcommanddefined}
+\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
+%
+\def\doifcmddefined#1#2{{%
+ \makevalueexpandable
+ \let\next=\empty
+ \expandafter\ifx\csname #2\endcsname\relax
+ #1% If not defined, \let\next as above.
+ \fi
+ \expandafter
+ }\next
+}
+\def\ifcmddefinedfail{\doignore{ifcommanddefined}}
+
+% @ifcommandnotdefined CMD ... handled similar to @ifclear above.
+\makecond{ifcommandnotdefined}
+\def\ifcommandnotdefined{%
+ \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
+\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
+
+% Set the `txicommandconditionals' variable, so documents have a way to
+% test if the @ifcommand...defined conditionals are available.
+\set txicommandconditionals
+
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory=\comment
+
+% @defininfoenclose.
+\let\definfoenclose=\comment
+
+
+\message{indexing,}
+% Index generation facilities
+
+% Define \newwrite to be identical to plain tex's \newwrite
+% except not \outer, so it can be used within macros and \if's.
+\edef\newwrite{\makecsname{ptexnewwrite}}
+
+% \newindex {foo} defines an index named foo.
+% It automatically defines \fooindex such that
+% \fooindex ...rest of line... puts an entry in the index foo.
+% It also defines \fooindfile to be the number of the output channel for
+% the file that accumulates this index. The file's extension is foo.
+% The name of an index should be no more than 2 characters long
+% for the sake of vms.
+%
+\def\newindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
+ \noexpand\doindex{#1}}
+}
+
+% @defindex foo == \newindex{foo}
+%
+\def\defindex{\parsearg\newindex}
+
+% Define @defcodeindex, like @defindex except put all entries in @code.
+%
+\def\defcodeindex{\parsearg\newcodeindex}
+%
+\def\newcodeindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{%
+ \noexpand\docodeindex{#1}}%
+}
+
+
+% @synindex foo bar makes index foo feed into index bar.
+% Do this instead of @defindex foo if you don't want it as a separate index.
+%
+% @syncodeindex foo bar similar, but put all entries made for index foo
+% inside @code.
+%
+\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
+\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
+
+% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
+% #3 the target index (bar).
+\def\dosynindex#1#2#3{%
+ % Only do \closeout if we haven't already done it, else we'll end up
+ % closing the target index.
+ \expandafter \ifx\csname donesynindex#2\endcsname \relax
+ % The \closeout helps reduce unnecessary open files; the limit on the
+ % Acorn RISC OS is a mere 16 files.
+ \expandafter\closeout\csname#2indfile\endcsname
+ \expandafter\let\csname donesynindex#2\endcsname = 1
+ \fi
+ % redefine \fooindfile:
+ \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
+ \expandafter\let\csname#2indfile\endcsname=\temp
+ % redefine \fooindex:
+ \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
+}
+
+% Define \doindex, the driver for all \fooindex macros.
+% Argument #1 is generated by the calling \fooindex macro,
+% and it is "foo", the name of the index.
+
+% \doindex just uses \parsearg; it calls \doind for the actual work.
+% This is because \doind is more useful to call from other macros.
+
+% There is also \dosubind {index}{topic}{subtopic}
+% which makes an entry in a two-level index such as the operation index.
+
+\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
+\def\singleindexer #1{\doind{\indexname}{#1}}
+
+% like the previous two, but they put @code around the argument.
+\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
+\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
+
+% Take care of Texinfo commands that can appear in an index entry.
+% Since there are some commands we want to expand, and others we don't,
+% we have to laboriously prevent expansion for those that we don't.
+%
+\def\indexdummies{%
+ \escapechar = `\\ % use backslash in output files.
+ \def\@{@}% change to @@ when we switch to @ as escape char in index files.
+ \def\ {\realbackslash\space }%
+ %
+ % Need these unexpandable (because we define \tt as a dummy)
+ % definitions when @{ or @} appear in index entry text. Also, more
+ % complicated, when \tex is in effect and \{ is a \delimiter again.
+ % We can't use \lbracecmd and \rbracecmd because texindex assumes
+ % braces and backslashes are used only as delimiters. Perhaps we
+ % should define @lbrace and @rbrace commands a la @comma.
+ \def\{{{\tt\char123}}%
+ \def\}{{\tt\char125}}%
+ %
+ % I don't entirely understand this, but when an index entry is
+ % generated from a macro call, the \endinput which \scanmacro inserts
+ % causes processing to be prematurely terminated. This is,
+ % apparently, because \indexsorttmp is fully expanded, and \endinput
+ % is an expandable command. The redefinition below makes \endinput
+ % disappear altogether for that purpose -- although logging shows that
+ % processing continues to some further point. On the other hand, it
+ % seems \endinput does not hurt in the printed index arg, since that
+ % is still getting written without apparent harm.
+ %
+ % Sample source (mac-idx3.tex, reported by Graham Percival to
+ % help-texinfo, 22may06):
+ % @macro funindex {WORD}
+ % @findex xyz
+ % @end macro
+ % ...
+ % @funindex commtest
+ %
+ % The above is not enough to reproduce the bug, but it gives the flavor.
+ %
+ % Sample whatsit resulting:
+ % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
+ %
+ % So:
+ \let\endinput = \empty
+ %
+ % Do the redefinitions.
+ \commondummies
+}
+
+% For the aux and toc files, @ is the escape character. So we want to
+% redefine everything using @ as the escape character (instead of
+% \realbackslash, still used for index files). When everything uses @,
+% this will be simpler.
+%
+\def\atdummies{%
+ \def\@{@@}%
+ \def\ {@ }%
+ \let\{ = \lbraceatcmd
+ \let\} = \rbraceatcmd
+ %
+ % Do the redefinitions.
+ \commondummies
+ \otherbackslash
+}
+
+% Called from \indexdummies and \atdummies.
+%
+\def\commondummies{%
+ %
+ % \definedummyword defines \#1 as \string\#1\space, thus effectively
+ % preventing its expansion. This is used only for control words,
+ % not control letters, because the \space would be incorrect for
+ % control characters, but is needed to separate the control word
+ % from whatever follows.
+ %
+ % For control letters, we have \definedummyletter, which omits the
+ % space.
+ %
+ % These can be used both for control words that take an argument and
+ % those that do not. If it is followed by {arg} in the input, then
+ % that will dutifully get written to the index (or wherever).
+ %
+ \def\definedummyword ##1{\def##1{\string##1\space}}%
+ \def\definedummyletter##1{\def##1{\string##1}}%
+ \let\definedummyaccent\definedummyletter
+ %
+ \commondummiesnofonts
+ %
+ \definedummyletter\_%
+ \definedummyletter\-%
+ %
+ % Non-English letters.
+ \definedummyword\AA
+ \definedummyword\AE
+ \definedummyword\DH
+ \definedummyword\L
+ \definedummyword\O
+ \definedummyword\OE
+ \definedummyword\TH
+ \definedummyword\aa
+ \definedummyword\ae
+ \definedummyword\dh
+ \definedummyword\exclamdown
+ \definedummyword\l
+ \definedummyword\o
+ \definedummyword\oe
+ \definedummyword\ordf
+ \definedummyword\ordm
+ \definedummyword\questiondown
+ \definedummyword\ss
+ \definedummyword\th
+ %
+ % Although these internal commands shouldn't show up, sometimes they do.
+ \definedummyword\bf
+ \definedummyword\gtr
+ \definedummyword\hat
+ \definedummyword\less
+ \definedummyword\sf
+ \definedummyword\sl
+ \definedummyword\tclose
+ \definedummyword\tt
+ %
+ \definedummyword\LaTeX
+ \definedummyword\TeX
+ %
+ % Assorted special characters.
+ \definedummyword\arrow
+ \definedummyword\bullet
+ \definedummyword\comma
+ \definedummyword\copyright
+ \definedummyword\registeredsymbol
+ \definedummyword\dots
+ \definedummyword\enddots
+ \definedummyword\entrybreak
+ \definedummyword\equiv
+ \definedummyword\error
+ \definedummyword\euro
+ \definedummyword\expansion
+ \definedummyword\geq
+ \definedummyword\guillemetleft
+ \definedummyword\guillemetright
+ \definedummyword\guilsinglleft
+ \definedummyword\guilsinglright
+ \definedummyword\lbracechar
+ \definedummyword\leq
+ \definedummyword\minus
+ \definedummyword\ogonek
+ \definedummyword\pounds
+ \definedummyword\point
+ \definedummyword\print
+ \definedummyword\quotedblbase
+ \definedummyword\quotedblleft
+ \definedummyword\quotedblright
+ \definedummyword\quoteleft
+ \definedummyword\quoteright
+ \definedummyword\quotesinglbase
+ \definedummyword\rbracechar
+ \definedummyword\result
+ \definedummyword\textdegree
+ %
+ % We want to disable all macros so that they are not expanded by \write.
+ \macrolist
+ %
+ \normalturnoffactive
+ %
+ % Handle some cases of @value -- where it does not contain any
+ % (non-fully-expandable) commands.
+ \makevalueexpandable
+}
+
+% \commondummiesnofonts: common to \commondummies and \indexnofonts.
+%
+\def\commondummiesnofonts{%
+ % Control letters and accents.
+ \definedummyletter\!%
+ \definedummyaccent\"%
+ \definedummyaccent\'%
+ \definedummyletter\*%
+ \definedummyaccent\,%
+ \definedummyletter\.%
+ \definedummyletter\/%
+ \definedummyletter\:%
+ \definedummyaccent\=%
+ \definedummyletter\?%
+ \definedummyaccent\^%
+ \definedummyaccent\`%
+ \definedummyaccent\~%
+ \definedummyword\u
+ \definedummyword\v
+ \definedummyword\H
+ \definedummyword\dotaccent
+ \definedummyword\ogonek
+ \definedummyword\ringaccent
+ \definedummyword\tieaccent
+ \definedummyword\ubaraccent
+ \definedummyword\udotaccent
+ \definedummyword\dotless
+ %
+ % Texinfo font commands.
+ \definedummyword\b
+ \definedummyword\i
+ \definedummyword\r
+ \definedummyword\sansserif
+ \definedummyword\sc
+ \definedummyword\slanted
+ \definedummyword\t
+ %
+ % Commands that take arguments.
+ \definedummyword\abbr
+ \definedummyword\acronym
+ \definedummyword\anchor
+ \definedummyword\cite
+ \definedummyword\code
+ \definedummyword\command
+ \definedummyword\dfn
+ \definedummyword\dmn
+ \definedummyword\email
+ \definedummyword\emph
+ \definedummyword\env
+ \definedummyword\file
+ \definedummyword\image
+ \definedummyword\indicateurl
+ \definedummyword\inforef
+ \definedummyword\kbd
+ \definedummyword\key
+ \definedummyword\math
+ \definedummyword\option
+ \definedummyword\pxref
+ \definedummyword\ref
+ \definedummyword\samp
+ \definedummyword\strong
+ \definedummyword\tie
+ \definedummyword\uref
+ \definedummyword\url
+ \definedummyword\var
+ \definedummyword\verb
+ \definedummyword\w
+ \definedummyword\xref
+}
+
+% \indexnofonts is used when outputting the strings to sort the index
+% by, and when constructing control sequence names. It eliminates all
+% control sequences and just writes whatever the best ASCII sort string
+% would be for a given command (usually its argument).
+%
+\def\indexnofonts{%
+ % Accent commands should become @asis.
+ \def\definedummyaccent##1{\let##1\asis}%
+ % We can just ignore other control letters.
+ \def\definedummyletter##1{\let##1\empty}%
+ % All control words become @asis by default; overrides below.
+ \let\definedummyword\definedummyaccent
+ %
+ \commondummiesnofonts
+ %
+ % Don't no-op \tt, since it isn't a user-level command
+ % and is used in the definitions of the active chars like <, >, |, etc.
+ % Likewise with the other plain tex font commands.
+ %\let\tt=\asis
+ %
+ \def\ { }%
+ \def\@{@}%
+ \def\_{\normalunderscore}%
+ \def\-{}% @- shouldn't affect sorting
+ %
+ % Unfortunately, texindex is not prepared to handle braces in the
+ % content at all. So for index sorting, we map @{ and @} to strings
+ % starting with |, since that ASCII character is between ASCII { and }.
+ \def\{{|a}%
+ \def\lbracechar{|a}%
+ %
+ \def\}{|b}%
+ \def\rbracechar{|b}%
+ %
+ % Non-English letters.
+ \def\AA{AA}%
+ \def\AE{AE}%
+ \def\DH{DZZ}%
+ \def\L{L}%
+ \def\OE{OE}%
+ \def\O{O}%
+ \def\TH{ZZZ}%
+ \def\aa{aa}%
+ \def\ae{ae}%
+ \def\dh{dzz}%
+ \def\exclamdown{!}%
+ \def\l{l}%
+ \def\oe{oe}%
+ \def\ordf{a}%
+ \def\ordm{o}%
+ \def\o{o}%
+ \def\questiondown{?}%
+ \def\ss{ss}%
+ \def\th{zzz}%
+ %
+ \def\LaTeX{LaTeX}%
+ \def\TeX{TeX}%
+ %
+ % Assorted special characters.
+ % (The following {} will end up in the sort string, but that's ok.)
+ \def\arrow{->}%
+ \def\bullet{bullet}%
+ \def\comma{,}%
+ \def\copyright{copyright}%
+ \def\dots{...}%
+ \def\enddots{...}%
+ \def\equiv{==}%
+ \def\error{error}%
+ \def\euro{euro}%
+ \def\expansion{==>}%
+ \def\geq{>=}%
+ \def\guillemetleft{<<}%
+ \def\guillemetright{>>}%
+ \def\guilsinglleft{<}%
+ \def\guilsinglright{>}%
+ \def\leq{<=}%
+ \def\minus{-}%
+ \def\point{.}%
+ \def\pounds{pounds}%
+ \def\print{-|}%
+ \def\quotedblbase{"}%
+ \def\quotedblleft{"}%
+ \def\quotedblright{"}%
+ \def\quoteleft{`}%
+ \def\quoteright{'}%
+ \def\quotesinglbase{,}%
+ \def\registeredsymbol{R}%
+ \def\result{=>}%
+ \def\textdegree{o}%
+ %
+ \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
+ \else \indexlquoteignore \fi
+ %
+ % We need to get rid of all macros, leaving only the arguments (if present).
+ % Of course this is not nearly correct, but it is the best we can do for now.
+ % makeinfo does not expand macros in the argument to @deffn, which ends up
+ % writing an index entry, and texindex isn't prepared for an index sort entry
+ % that starts with \.
+ %
+ % Since macro invocations are followed by braces, we can just redefine them
+ % to take a single TeX argument. The case of a macro invocation that
+ % goes to end-of-line is not handled.
+ %
+ \macrolist
+}
+
+% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
+% ignore left quotes in the sort term.
+{\catcode`\`=\active
+ \gdef\indexlquoteignore{\let`=\empty}}
+
+\let\indexbackslash=0 %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% Most index entries go through here, but \dosubind is the general case.
+% #1 is the index name, #2 is the entry text.
+\def\doind#1#2{\dosubind{#1}{#2}{}}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% empty if called from \doind, as we usually are (the main exception
+% is with most defuns, which call us directly).
+%
+\def\dosubind#1#2#3{%
+ \iflinks
+ {%
+ % Store the main index entry text (including the third arg).
+ \toks0 = {#2}%
+ % If third arg is present, precede it with a space.
+ \def\thirdarg{#3}%
+ \ifx\thirdarg\empty \else
+ \toks0 = \expandafter{\the\toks0 \space #3}%
+ \fi
+ %
+ \edef\writeto{\csname#1indfile\endcsname}%
+ %
+ \safewhatsit\dosubindwrite
+ }%
+ \fi
+}
+
+% Write the entry in \toks0 to the index file:
+%
+\def\dosubindwrite{%
+ % Put the index entry in the margin if desired.
+ \ifx\SETmarginindex\relax\else
+ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
+ \fi
+ %
+ % Remember, we are within a group.
+ \indexdummies % Must do this here, since \bf, etc expand at this stage
+ \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
+ % so it will be output as is; and it will print as backslash.
+ %
+ % Process the index entry with all font commands turned off, to
+ % get the string to sort by.
+ {\indexnofonts
+ \edef\temp{\the\toks0}% need full expansion
+ \xdef\indexsorttmp{\temp}%
+ }%
+ %
+ % Set up the complete index entry, with both the sort key and
+ % the original text, including any font commands. We write
+ % three arguments to \entry to the .?? file (four in the
+ % subentry case), texindex reduces to two when writing the .??s
+ % sorted result.
+ \edef\temp{%
+ \write\writeto{%
+ \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
+ }%
+ \temp
+}
+
+% Take care of unwanted page breaks/skips around a whatsit:
+%
+% If a skip is the last thing on the list now, preserve it
+% by backing up by \lastskip, doing the \write, then inserting
+% the skip again. Otherwise, the whatsit generated by the
+% \write or \pdfdest will make \lastskip zero. The result is that
+% sequences like this:
+% @end defun
+% @tindex whatever
+% @defun ...
+% will have extra space inserted, because the \medbreak in the
+% start of the @defun won't see the skip inserted by the @end of
+% the previous defun.
+%
+% But don't do any of this if we're not in vertical mode. We
+% don't want to do a \vskip and prematurely end a paragraph.
+%
+% Avoid page breaks due to these extra skips, too.
+%
+% But wait, there is a catch there:
+% We'll have to check whether \lastskip is zero skip. \ifdim is not
+% sufficient for this purpose, as it ignores stretch and shrink parts
+% of the skip. The only way seems to be to check the textual
+% representation of the skip.
+%
+% The following is almost like \def\zeroskipmacro{0.0pt} except that
+% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
+%
+\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
+%
+\newskip\whatsitskip
+\newcount\whatsitpenalty
+%
+% ..., ready, GO:
+%
+\def\safewhatsit#1{\ifhmode
+ #1%
+ \else
+ % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
+ \whatsitskip = \lastskip
+ \edef\lastskipmacro{\the\lastskip}%
+ \whatsitpenalty = \lastpenalty
+ %
+ % If \lastskip is nonzero, that means the last item was a
+ % skip. And since a skip is discardable, that means this
+ % -\whatsitskip glue we're inserting is preceded by a
+ % non-discardable item, therefore it is not a potential
+ % breakpoint, therefore no \nobreak needed.
+ \ifx\lastskipmacro\zeroskipmacro
+ \else
+ \vskip-\whatsitskip
+ \fi
+ %
+ #1%
+ %
+ \ifx\lastskipmacro\zeroskipmacro
+ % If \lastskip was zero, perhaps the last item was a penalty, and
+ % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
+ % to re-insert the same penalty (values >10000 are used for various
+ % signals); since we just inserted a non-discardable item, any
+ % following glue (such as a \parskip) would be a breakpoint. For example:
+ % @deffn deffn-whatever
+ % @vindex index-whatever
+ % Description.
+ % would allow a break between the index-whatever whatsit
+ % and the "Description." paragraph.
+ \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
+ \else
+ % On the other hand, if we had a nonzero \lastskip,
+ % this make-up glue would be preceded by a non-discardable item
+ % (the whatsit from the \write), so we must insert a \nobreak.
+ \nobreak\vskip\whatsitskip
+ \fi
+\fi}
+
+% The index entry written in the file actually looks like
+% \entry {sortstring}{page}{topic}
+% or
+% \entry {sortstring}{page}{topic}{subtopic}
+% The texindex program reads in these files and writes files
+% containing these kinds of lines:
+% \initial {c}
+% before the first topic whose initial is c
+% \entry {topic}{pagelist}
+% for a topic that is used without subtopics
+% \primary {topic}
+% for the beginning of a topic that is used with subtopics
+% \secondary {subtopic}{pagelist}
+% for each subtopic.
+
+% Define the user-accessible indexing commands
+% @findex, @vindex, @kindex, @cindex.
+
+\def\findex {\fnindex}
+\def\kindex {\kyindex}
+\def\cindex {\cpindex}
+\def\vindex {\vrindex}
+\def\tindex {\tpindex}
+\def\pindex {\pgindex}
+
+\def\cindexsub {\begingroup\obeylines\cindexsub}
+{\obeylines %
+\gdef\cindexsub "#1" #2^^M{\endgroup %
+\dosubind{cp}{#2}{#1}}}
+
+% Define the macros used in formatting output of the sorted index material.
+
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
+\parseargdef\printindex{\begingroup
+ \dobreak \chapheadingskip{10000}%
+ %
+ \smallfonts \rm
+ \tolerance = 9500
+ \plainfrenchspacing
+ \everypar = {}% don't want the \kern\-parindent from indentation suppression.
+ %
+ % See if the index file exists and is nonempty.
+ % Change catcode of @ here so that if the index file contains
+ % \initial {@}
+ % as its first line, TeX doesn't complain about mismatched braces
+ % (because it thinks @} is a control sequence).
+ \catcode`\@ = 11
+ \openin 1 \jobname.#1s
+ \ifeof 1
+ % \enddoublecolumns gets confused if there is no text in the index,
+ % and it loses the chapter title and the aux file entries for the
+ % index. The easiest way to prevent this problem is to make sure
+ % there is some text.
+ \putwordIndexNonexistent
+ \else
+ %
+ % If the index file exists but is empty, then \openin leaves \ifeof
+ % false. We have to make TeX try to read something from the file, so
+ % it can discover if there is anything in it.
+ \read 1 to \temp
+ \ifeof 1
+ \putwordIndexIsEmpty
+ \else
+ % Index files are almost Texinfo source, but we use \ as the escape
+ % character. It would be better to use @, but that's too big a change
+ % to make right now.
+ \def\indexbackslash{\backslashcurfont}%
+ \catcode`\\ = 0
+ \escapechar = `\\
+ \begindoublecolumns
+ \input \jobname.#1s
+ \enddoublecolumns
+ \fi
+ \fi
+ \closein 1
+\endgroup}
+
+% These macros are used by the sorted index file itself.
+% Change them to control the appearance of the index.
+
+\def\initial#1{{%
+ % Some minor font changes for the special characters.
+ \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+ %
+ % Remove any glue we may have, we'll be inserting our own.
+ \removelastskip
+ %
+ % We like breaks before the index initials, so insert a bonus.
+ \nobreak
+ \vskip 0pt plus 3\baselineskip
+ \penalty 0
+ \vskip 0pt plus -3\baselineskip
+ %
+ % Typeset the initial. Making this add up to a whole number of
+ % baselineskips increases the chance of the dots lining up from column
+ % to column. It still won't often be perfect, because of the stretch
+ % we need before each entry, but it's better.
+ %
+ % No shrink because it confuses \balancecolumns.
+ \vskip 1.67\baselineskip plus .5\baselineskip
+ \leftline{\secbf #1}%
+ % Do our best not to break after the initial.
+ \nobreak
+ \vskip .33\baselineskip plus .1\baselineskip
+}}
+
+% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
+% then page number (#2) flushed to the right margin. It is used for index
+% and table of contents entries. The paragraph is indented by \leftskip.
+%
+% A straightforward implementation would start like this:
+% \def\entry#1#2{...
+% But this freezes the catcodes in the argument, and can cause problems to
+% @code, which sets - active. This problem was fixed by a kludge---
+% ``-'' was active throughout whole index, but this isn't really right.
+% The right solution is to prevent \entry from swallowing the whole text.
+% --kasal, 21nov03
+\def\entry{%
+ \begingroup
+ %
+ % Start a new paragraph if necessary, so our assignments below can't
+ % affect previous text.
+ \par
+ %
+ % Do not fill out the last line with white space.
+ \parfillskip = 0in
+ %
+ % No extra space above this paragraph.
+ \parskip = 0in
+ %
+ % Do not prefer a separate line ending with a hyphen to fewer lines.
+ \finalhyphendemerits = 0
+ %
+ % \hangindent is only relevant when the entry text and page number
+ % don't both fit on one line. In that case, bob suggests starting the
+ % dots pretty far over on the line. Unfortunately, a large
+ % indentation looks wrong when the entry text itself is broken across
+ % lines. So we use a small indentation and put up with long leaders.
+ %
+ % \hangafter is reset to 1 (which is the value we want) at the start
+ % of each paragraph, so we need not do anything with that.
+ \hangindent = 2em
+ %
+ % When the entry text needs to be broken, just fill out the first line
+ % with blank space.
+ \rightskip = 0pt plus1fil
+ %
+ % A bit of stretch before each entry for the benefit of balancing
+ % columns.
+ \vskip 0pt plus1pt
+ %
+ % When reading the text of entry, convert explicit line breaks
+ % from @* into spaces. The user might give these in long section
+ % titles, for instance.
+ \def\*{\unskip\space\ignorespaces}%
+ \def\entrybreak{\hfil\break}%
+ %
+ % Swallow the left brace of the text (first parameter):
+ \afterassignment\doentry
+ \let\temp =
+}
+\def\entrybreak{\unskip\space\ignorespaces}%
+\def\doentry{%
+ \bgroup % Instead of the swallowed brace.
+ \noindent
+ \aftergroup\finishentry
+ % And now comes the text of the entry.
+}
+\def\finishentry#1{%
+ % #1 is the page number.
+ %
+ % The following is kludged to not output a line of dots in the index if
+ % there are no page numbers. The next person who breaks this will be
+ % cursed by a Unix daemon.
+ \setbox\boxA = \hbox{#1}%
+ \ifdim\wd\boxA = 0pt
+ \ %
+ \else
+ %
+ % If we must, put the page number on a line of its own, and fill out
+ % this line with blank space. (The \hfil is overwhelmed with the
+ % fill leaders glue in \indexdotfill if the page number does fit.)
+ \hfil\penalty50
+ \null\nobreak\indexdotfill % Have leaders before the page number.
+ %
+ % The `\ ' here is removed by the implicit \unskip that TeX does as
+ % part of (the primitive) \par. Without it, a spurious underfull
+ % \hbox ensues.
+ \ifpdf
+ \pdfgettoks#1.%
+ \ \the\toksA
+ \else
+ \ #1%
+ \fi
+ \fi
+ \par
+ \endgroup
+}
+
+% Like plain.tex's \dotfill, except uses up at least 1 em.
+\def\indexdotfill{\cleaders
+ \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
+
+\def\primary #1{\line{#1\hfil}}
+
+\newskip\secondaryindent \secondaryindent=0.5cm
+\def\secondary#1#2{{%
+ \parfillskip=0in
+ \parskip=0in
+ \hangindent=1in
+ \hangafter=1
+ \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
+ \ifpdf
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \else
+ #2
+ \fi
+ \par
+}}
+
+% Define two-column mode, which we use to typeset indexes.
+% Adapted from the TeXbook, page 416, which is to say,
+% the manmac.tex format used to print the TeXbook itself.
+\catcode`\@=11
+
+\newbox\partialpage
+\newdimen\doublecolumnhsize
+
+\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+ % Grab any single-column material above us.
+ \output = {%
+ %
+ % Here is a possibility not foreseen in manmac: if we accumulate a
+ % whole lot of material, we might end up calling this \output
+ % routine twice in a row (see the doublecol-lose test, which is
+ % essentially a couple of indexes with @setchapternewpage off). In
+ % that case we just ship out what is in \partialpage with the normal
+ % output routine. Generally, \partialpage will be empty when this
+ % runs and this will be a no-op. See the indexspread.tex test case.
+ \ifvoid\partialpage \else
+ \onepageout{\pagecontents\partialpage}%
+ \fi
+ %
+ \global\setbox\partialpage = \vbox{%
+ % Unvbox the main output page.
+ \unvbox\PAGE
+ \kern-\topskip \kern\baselineskip
+ }%
+ }%
+ \eject % run that output routine to set \partialpage
+ %
+ % Use the double-column output routine for subsequent pages.
+ \output = {\doublecolumnout}%
+ %
+ % Change the page size parameters. We could do this once outside this
+ % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
+ % format, but then we repeat the same computation. Repeating a couple
+ % of assignments once per index is clearly meaningless for the
+ % execution time, so we may as well do it in one place.
+ %
+ % First we halve the line length, less a little for the gutter between
+ % the columns. We compute the gutter based on the line length, so it
+ % changes automatically with the paper format. The magic constant
+ % below is chosen so that the gutter has the same value (well, +-<1pt)
+ % as it did when we hard-coded it.
+ %
+ % We put the result in a separate register, \doublecolumhsize, so we
+ % can restore it in \pagesofar, after \hsize itself has (potentially)
+ % been clobbered.
+ %
+ \doublecolumnhsize = \hsize
+ \advance\doublecolumnhsize by -.04154\hsize
+ \divide\doublecolumnhsize by 2
+ \hsize = \doublecolumnhsize
+ %
+ % Double the \vsize as well. (We don't need a separate register here,
+ % since nobody clobbers \vsize.)
+ \vsize = 2\vsize
+}
+
+% The double-column output routine for all double-column pages except
+% the last.
+%
+\def\doublecolumnout{%
+ \splittopskip=\topskip \splitmaxdepth=\maxdepth
+ % Get the available space for the double columns -- the normal
+ % (undoubled) page height minus any material left over from the
+ % previous page.
+ \dimen@ = \vsize
+ \divide\dimen@ by 2
+ \advance\dimen@ by -\ht\partialpage
+ %
+ % box0 will be the left-hand column, box2 the right.
+ \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+ \onepageout\pagesofar
+ \unvbox255
+ \penalty\outputpenalty
+}
+%
+% Re-output the contents of the output page -- any previous material,
+% followed by the two boxes we just split, in box0 and box2.
+\def\pagesofar{%
+ \unvbox\partialpage
+ %
+ \hsize = \doublecolumnhsize
+ \wd0=\hsize \wd2=\hsize
+ \hbox to\pagewidth{\box0\hfil\box2}%
+}
+%
+% All done with double columns.
+\def\enddoublecolumns{%
+ % The following penalty ensures that the page builder is exercised
+ % _before_ we change the output routine. This is necessary in the
+ % following situation:
+ %
+ % The last section of the index consists only of a single entry.
+ % Before this section, \pagetotal is less than \pagegoal, so no
+ % break occurs before the last section starts. However, the last
+ % section, consisting of \initial and the single \entry, does not
+ % fit on the page and has to be broken off. Without the following
+ % penalty the page builder will not be exercised until \eject
+ % below, and by that time we'll already have changed the output
+ % routine to the \balancecolumns version, so the next-to-last
+ % double-column page will be processed with \balancecolumns, which
+ % is wrong: The two columns will go to the main vertical list, with
+ % the broken-off section in the recent contributions. As soon as
+ % the output routine finishes, TeX starts reconsidering the page
+ % break. The two columns and the broken-off section both fit on the
+ % page, because the two columns now take up only half of the page
+ % goal. When TeX sees \eject from below which follows the final
+ % section, it invokes the new output routine that we've set after
+ % \balancecolumns below; \onepageout will try to fit the two columns
+ % and the final section into the vbox of \pageheight (see
+ % \pagebody), causing an overfull box.
+ %
+ % Note that glue won't work here, because glue does not exercise the
+ % page builder, unlike penalties (see The TeXbook, pp. 280-281).
+ \penalty0
+ %
+ \output = {%
+ % Split the last of the double-column material. Leave it on the
+ % current page, no automatic page break.
+ \balancecolumns
+ %
+ % If we end up splitting too much material for the current page,
+ % though, there will be another page break right after this \output
+ % invocation ends. Having called \balancecolumns once, we do not
+ % want to call it again. Therefore, reset \output to its normal
+ % definition right away. (We hope \balancecolumns will never be
+ % called on to balance too much material, but if it is, this makes
+ % the output somewhat more palatable.)
+ \global\output = {\onepageout{\pagecontents\PAGE}}%
+ }%
+ \eject
+ \endgroup % started in \begindoublecolumns
+ %
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize (after the
+ % \endgroup where \vsize got restored).
+ \pagegoal = \vsize
+}
+%
+% Called at the end of the double column material.
+\def\balancecolumns{%
+ \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+ \dimen@ = \ht0
+ \advance\dimen@ by \topskip
+ \advance\dimen@ by-\baselineskip
+ \divide\dimen@ by 2 % target to split to
+ %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
+ \splittopskip = \topskip
+ % Loop until we get a decent breakpoint.
+ {%
+ \vbadness = 10000
+ \loop
+ \global\setbox3 = \copy0
+ \global\setbox1 = \vsplit3 to \dimen@
+ \ifdim\ht3>\dimen@
+ \global\advance\dimen@ by 1pt
+ \repeat
+ }%
+ %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
+ \setbox0=\vbox to\dimen@{\unvbox1}%
+ \setbox2=\vbox to\dimen@{\unvbox3}%
+ %
+ \pagesofar
+}
+\catcode`\@ = \other
+
+
+\message{sectioning,}
+% Chapters, sections, etc.
+
+% Let's start with @part.
+\outer\parseargdef\part{\partzzz{#1}}
+\def\partzzz#1{%
+ \chapoddpage
+ \null
+ \vskip.3\vsize % move it down on the page a bit
+ \begingroup
+ \noindent \titlefonts\rmisbold #1\par % the text
+ \let\lastnode=\empty % no node to associate with
+ \writetocentry{part}{#1}{}% but put it in the toc
+ \headingsoff % no headline or footline on the part page
+ \chapoddpage
+ \endgroup
+}
+
+% \unnumberedno is an oxymoron. But we count the unnumbered
+% sections so that we can refer to them unambiguously in the pdf
+% outlines by their "section number". We avoid collisions with chapter
+% numbers by starting them at 10000. (If a document ever has 10000
+% chapters, we're in trouble anyway, I'm sure.)
+\newcount\unnumberedno \unnumberedno = 10000
+\newcount\chapno
+\newcount\secno \secno=0
+\newcount\subsecno \subsecno=0
+\newcount\subsubsecno \subsubsecno=0
+
+% This counter is funny since it counts through charcodes of letters A, B, ...
+\newcount\appendixno \appendixno = `\@
+%
+% \def\appendixletter{\char\the\appendixno}
+% We do the following ugly conditional instead of the above simple
+% construct for the sake of pdftex, which needs the actual
+% letter in the expansion, not just typeset.
+%
+\def\appendixletter{%
+ \ifnum\appendixno=`A A%
+ \else\ifnum\appendixno=`B B%
+ \else\ifnum\appendixno=`C C%
+ \else\ifnum\appendixno=`D D%
+ \else\ifnum\appendixno=`E E%
+ \else\ifnum\appendixno=`F F%
+ \else\ifnum\appendixno=`G G%
+ \else\ifnum\appendixno=`H H%
+ \else\ifnum\appendixno=`I I%
+ \else\ifnum\appendixno=`J J%
+ \else\ifnum\appendixno=`K K%
+ \else\ifnum\appendixno=`L L%
+ \else\ifnum\appendixno=`M M%
+ \else\ifnum\appendixno=`N N%
+ \else\ifnum\appendixno=`O O%
+ \else\ifnum\appendixno=`P P%
+ \else\ifnum\appendixno=`Q Q%
+ \else\ifnum\appendixno=`R R%
+ \else\ifnum\appendixno=`S S%
+ \else\ifnum\appendixno=`T T%
+ \else\ifnum\appendixno=`U U%
+ \else\ifnum\appendixno=`V V%
+ \else\ifnum\appendixno=`W W%
+ \else\ifnum\appendixno=`X X%
+ \else\ifnum\appendixno=`Y Y%
+ \else\ifnum\appendixno=`Z Z%
+ % The \the is necessary, despite appearances, because \appendixletter is
+ % expanded while writing the .toc file. \char\appendixno is not
+ % expandable, thus it is written literally, thus all appendixes come out
+ % with the same letter (or @) in the toc without it.
+ \else\char\the\appendixno
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
+% Each @chapter defines these (using marks) as the number+name, number
+% and name of the chapter. Page headings and footings can use
+% these. @section does likewise.
+\def\thischapter{}
+\def\thischapternum{}
+\def\thischaptername{}
+\def\thissection{}
+\def\thissectionnum{}
+\def\thissectionname{}
+
+\newcount\absseclevel % used to calculate proper heading level
+\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
+
+% @raisesections: treat @section as chapter, @subsection as section, etc.
+\def\raisesections{\global\advance\secbase by -1}
+\let\up=\raisesections % original BFox name
+
+% @lowersections: treat @chapter as section, @section as subsection, etc.
+\def\lowersections{\global\advance\secbase by 1}
+\let\down=\lowersections % original BFox name
+
+% we only have subsub.
+\chardef\maxseclevel = 3
+%
+% A numbered section within an unnumbered changes to unnumbered too.
+% To achieve this, remember the "biggest" unnum. sec. we are currently in:
+\chardef\unnlevel = \maxseclevel
+%
+% Trace whether the current chapter is an appendix or not:
+% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
+\def\chapheadtype{N}
+
+% Choose a heading macro
+% #1 is heading type
+% #2 is heading level
+% #3 is text for heading
+\def\genhead#1#2#3{%
+ % Compute the abs. sec. level:
+ \absseclevel=#2
+ \advance\absseclevel by \secbase
+ % Make sure \absseclevel doesn't fall outside the range:
+ \ifnum \absseclevel < 0
+ \absseclevel = 0
+ \else
+ \ifnum \absseclevel > 3
+ \absseclevel = 3
+ \fi
+ \fi
+ % The heading type:
+ \def\headtype{#1}%
+ \if \headtype U%
+ \ifnum \absseclevel < \unnlevel
+ \chardef\unnlevel = \absseclevel
+ \fi
+ \else
+ % Check for appendix sections:
+ \ifnum \absseclevel = 0
+ \edef\chapheadtype{\headtype}%
+ \else
+ \if \headtype A\if \chapheadtype N%
+ \errmessage{@appendix... within a non-appendix chapter}%
+ \fi\fi
+ \fi
+ % Check for numbered within unnumbered:
+ \ifnum \absseclevel > \unnlevel
+ \def\headtype{U}%
+ \else
+ \chardef\unnlevel = 3
+ \fi
+ \fi
+ % Now print the heading:
+ \if \headtype U%
+ \ifcase\absseclevel
+ \unnumberedzzz{#3}%
+ \or \unnumberedseczzz{#3}%
+ \or \unnumberedsubseczzz{#3}%
+ \or \unnumberedsubsubseczzz{#3}%
+ \fi
+ \else
+ \if \headtype A%
+ \ifcase\absseclevel
+ \appendixzzz{#3}%
+ \or \appendixsectionzzz{#3}%
+ \or \appendixsubseczzz{#3}%
+ \or \appendixsubsubseczzz{#3}%
+ \fi
+ \else
+ \ifcase\absseclevel
+ \chapterzzz{#3}%
+ \or \seczzz{#3}%
+ \or \numberedsubseczzz{#3}%
+ \or \numberedsubsubseczzz{#3}%
+ \fi
+ \fi
+ \fi
+ \suppressfirstparagraphindent
+}
+
+% an interface:
+\def\numhead{\genhead N}
+\def\apphead{\genhead A}
+\def\unnmhead{\genhead U}
+
+% @chapter, @appendix, @unnumbered. Increment top-level counter, reset
+% all lower-level sectioning counters to zero.
+%
+% Also set \chaplevelprefix, which we prepend to @float sequence numbers
+% (e.g., figures), q.v. By default (before any chapter), that is empty.
+\let\chaplevelprefix = \empty
+%
+\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz#1{%
+ % section resetting is \global in case the chapter is in a group, such
+ % as an @include file.
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\chapno by 1
+ %
+ % Used for \float.
+ \gdef\chaplevelprefix{\the\chapno.}%
+ \resetallfloatnos
+ %
+ % \putwordChapter can contain complex things in translations.
+ \toks0=\expandafter{\putwordChapter}%
+ \message{\the\toks0 \space \the\chapno}%
+ %
+ % Write the actual heading.
+ \chapmacro{#1}{Ynumbered}{\the\chapno}%
+ %
+ % So @section and the like are numbered underneath this chapter.
+ \global\let\section = \numberedsec
+ \global\let\subsection = \numberedsubsec
+ \global\let\subsubsection = \numberedsubsubsec
+}
+
+\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
+%
+\def\appendixzzz#1{%
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\appendixno by 1
+ \gdef\chaplevelprefix{\appendixletter.}%
+ \resetallfloatnos
+ %
+ % \putwordAppendix can contain complex things in translations.
+ \toks0=\expandafter{\putwordAppendix}%
+ \message{\the\toks0 \space \appendixletter}%
+ %
+ \chapmacro{#1}{Yappendix}{\appendixletter}%
+ %
+ \global\let\section = \appendixsec
+ \global\let\subsection = \appendixsubsec
+ \global\let\subsubsection = \appendixsubsubsec
+}
+
+% normally unnmhead0 calls unnumberedzzz:
+\outer\parseargdef\unnumbered{\unnmhead0{#1}}
+\def\unnumberedzzz#1{%
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\unnumberedno by 1
+ %
+ % Since an unnumbered has no number, no prefix for figures.
+ \global\let\chaplevelprefix = \empty
+ \resetallfloatnos
+ %
+ % This used to be simply \message{#1}, but TeX fully expands the
+ % argument to \message. Therefore, if #1 contained @-commands, TeX
+ % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
+ % expanded @cite (which turns out to cause errors because \cite is meant
+ % to be executed, not expanded).
+ %
+ % Anyway, we don't want the fully-expanded definition of @cite to appear
+ % as a result of the \message, we just want `@cite' itself. We use
+ % \the<toks register> to achieve this: TeX expands \the<toks> only once,
+ % simply yielding the contents of <toks register>. (We also do this for
+ % the toc entries.)
+ \toks0 = {#1}%
+ \message{(\the\toks0)}%
+ %
+ \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
+ %
+ \global\let\section = \unnumberedsec
+ \global\let\subsection = \unnumberedsubsec
+ \global\let\subsubsection = \unnumberedsubsubsec
+}
+
+% @centerchap is like @unnumbered, but the heading is centered.
+\outer\parseargdef\centerchap{%
+ % Well, we could do the following in a group, but that would break
+ % an assumption that \chapmacro is called at the outermost level.
+ % Thus we are safer this way: --kasal, 24feb04
+ \let\centerparametersmaybe = \centerparameters
+ \unnmhead0{#1}%
+ \let\centerparametersmaybe = \relax
+}
+
+% @top is like @unnumbered.
+\let\top\unnumbered
+
+% Sections.
+%
+\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
+\def\seczzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
+}
+
+% normally calls appendixsectionzzz:
+\outer\parseargdef\appendixsection{\apphead1{#1}}
+\def\appendixsectionzzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
+}
+\let\appendixsec\appendixsection
+
+% normally calls unnumberedseczzz:
+\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
+\def\unnumberedseczzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
+}
+
+% Subsections.
+%
+% normally calls numberedsubseczzz:
+\outer\parseargdef\numberedsubsec{\numhead2{#1}}
+\def\numberedsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
+}
+
+% normally calls appendixsubseczzz:
+\outer\parseargdef\appendixsubsec{\apphead2{#1}}
+\def\appendixsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Yappendix}%
+ {\appendixletter.\the\secno.\the\subsecno}%
+}
+
+% normally calls unnumberedsubseczzz:
+\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
+\def\unnumberedsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Ynothing}%
+ {\the\unnumberedno.\the\secno.\the\subsecno}%
+}
+
+% Subsubsections.
+%
+% normally numberedsubsubseczzz:
+\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
+\def\numberedsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Ynumbered}%
+ {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% normally appendixsubsubseczzz:
+\outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
+\def\appendixsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Yappendix}%
+ {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% normally unnumberedsubsubseczzz:
+\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
+\def\unnumberedsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Ynothing}%
+ {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% These macros control what the section commands do, according
+% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
+% Define them by default for a numbered chapter.
+\let\section = \numberedsec
+\let\subsection = \numberedsubsec
+\let\subsubsection = \numberedsubsubsec
+
+% Define @majorheading, @heading and @subheading
+
+\def\majorheading{%
+ {\advance\chapheadingskip by 10pt \chapbreak }%
+ \parsearg\chapheadingzzz
+}
+
+\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
+\def\chapheadingzzz#1{%
+ \vbox{\chapfonts \raggedtitlesettings #1\par}%
+ \nobreak\bigskip \nobreak
+ \suppressfirstparagraphindent
+}
+
+% @heading, @subheading, @subsubheading.
+\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+
+% These macros generate a chapter, section, etc. heading only
+% (including whitespace, linebreaking, etc. around it),
+% given all the information in convenient, parsed form.
+
+% Args are the skip and penalty (usually negative)
+\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
+
+% Parameter controlling skip before chapter headings (if needed)
+\newskip\chapheadingskip
+
+% Define plain chapter starts, and page on/off switching for it.
+\def\chapbreak{\dobreak \chapheadingskip {-4000}}
+\def\chappager{\par\vfill\supereject}
+% Because \domark is called before \chapoddpage, the filler page will
+% get the headings for the next chapter, which is wrong. But we don't
+% care -- we just disable all headings on the filler page.
+\def\chapoddpage{%
+ \chappager
+ \ifodd\pageno \else
+ \begingroup
+ \headingsoff
+ \null
+ \chappager
+ \endgroup
+ \fi
+}
+
+\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+
+\def\CHAPPAGoff{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chapbreak
+\global\let\pagealignmacro=\chappager}
+
+\def\CHAPPAGon{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chappager
+\global\let\pagealignmacro=\chappager
+\global\def\HEADINGSon{\HEADINGSsingle}}
+
+\def\CHAPPAGodd{%
+\global\let\contentsalignmacro = \chapoddpage
+\global\let\pchapsepmacro=\chapoddpage
+\global\let\pagealignmacro=\chapoddpage
+\global\def\HEADINGSon{\HEADINGSdouble}}
+
+\CHAPPAGon
+
+% Chapter opening.
+%
+% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
+% Yappendix, Yomitfromtoc), #3 the chapter number.
+%
+% To test against our argument.
+\def\Ynothingkeyword{Ynothing}
+\def\Yomitfromtockeyword{Yomitfromtoc}
+\def\Yappendixkeyword{Yappendix}
+%
+\def\chapmacro#1#2#3{%
+ % Insert the first mark before the heading break (see notes for \domark).
+ \let\prevchapterdefs=\lastchapterdefs
+ \let\prevsectiondefs=\lastsectiondefs
+ \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
+ \gdef\thissection{}}%
+ %
+ \def\temptype{#2}%
+ \ifx\temptype\Ynothingkeyword
+ \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+ \gdef\thischapter{\thischaptername}}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+ \gdef\thischapter{}}%
+ \else\ifx\temptype\Yappendixkeyword
+ \toks0={#1}%
+ \xdef\lastchapterdefs{%
+ \gdef\noexpand\thischaptername{\the\toks0}%
+ \gdef\noexpand\thischapternum{\appendixletter}%
+ % \noexpand\putwordAppendix avoids expanding indigestible
+ % commands in some of the translations.
+ \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
+ \noexpand\thischapternum:
+ \noexpand\thischaptername}%
+ }%
+ \else
+ \toks0={#1}%
+ \xdef\lastchapterdefs{%
+ \gdef\noexpand\thischaptername{\the\toks0}%
+ \gdef\noexpand\thischapternum{\the\chapno}%
+ % \noexpand\putwordChapter avoids expanding indigestible
+ % commands in some of the translations.
+ \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
+ \noexpand\thischapternum:
+ \noexpand\thischaptername}%
+ }%
+ \fi\fi\fi
+ %
+ % Output the mark. Pass it through \safewhatsit, to take care of
+ % the preceding space.
+ \safewhatsit\domark
+ %
+ % Insert the chapter heading break.
+ \pchapsepmacro
+ %
+ % Now the second mark, after the heading break. No break points
+ % between here and the heading.
+ \let\prevchapterdefs=\lastchapterdefs
+ \let\prevsectiondefs=\lastsectiondefs
+ \domark
+ %
+ {%
+ \chapfonts \rmisbold
+ %
+ % Have to define \lastsection before calling \donoderef, because the
+ % xref code eventually uses it. On the other hand, it has to be called
+ % after \pchapsepmacro, or the headline will change too soon.
+ \gdef\lastsection{#1}%
+ %
+ % Only insert the separating space if we have a chapter/appendix
+ % number, and don't print the unnumbered ``number''.
+ \ifx\temptype\Ynothingkeyword
+ \setbox0 = \hbox{}%
+ \def\toctype{unnchap}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
+ \def\toctype{omit}%
+ \else\ifx\temptype\Yappendixkeyword
+ \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
+ \def\toctype{app}%
+ \else
+ \setbox0 = \hbox{#3\enspace}%
+ \def\toctype{numchap}%
+ \fi\fi\fi
+ %
+ % Write the toc entry for this chapter. Must come before the
+ % \donoderef, because we include the current node name in the toc
+ % entry, and \donoderef resets it to empty.
+ \writetocentry{\toctype}{#1}{#3}%
+ %
+ % For pdftex, we have to write out the node definition (aka, make
+ % the pdfdest) after any page break, but before the actual text has
+ % been typeset. If the destination for the pdf outline is after the
+ % text, then jumping from the outline may wind up with the text not
+ % being visible, for instance under high magnification.
+ \donoderef{#2}%
+ %
+ % Typeset the actual heading.
+ \nobreak % Avoid page breaks at the interline glue.
+ \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
+ \unhbox0 #1\par}%
+ }%
+ \nobreak\bigskip % no page break after a chapter title
+ \nobreak
+}
+
+% @centerchap -- centered and unnumbered.
+\let\centerparametersmaybe = \relax
+\def\centerparameters{%
+ \advance\rightskip by 3\rightskip
+ \leftskip = \rightskip
+ \parfillskip = 0pt
+}
+
+
+% I don't think this chapter style is supported any more, so I'm not
+% updating it with the new noderef stuff. We'll see. --karl, 11aug03.
+%
+\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+%
+\def\unnchfopen #1{%
+ \chapoddpage
+ \vbox{\chapfonts \raggedtitlesettings #1\par}%
+ \nobreak\bigskip\nobreak
+}
+\def\chfopen #1#2{\chapoddpage {\chapfonts
+\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
+\par\penalty 5000 %
+}
+\def\centerchfopen #1{%
+ \chapoddpage
+ \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
+ \nobreak\bigskip \nobreak
+}
+\def\CHAPFopen{%
+ \global\let\chapmacro=\chfopen
+ \global\let\centerchapmacro=\centerchfopen}
+
+
+% Section titles. These macros combine the section number parts and
+% call the generic \sectionheading to do the printing.
+%
+\newskip\secheadingskip
+\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
+
+% Subsection titles.
+\newskip\subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
+
+% Subsubsection titles.
+\def\subsubsecheadingskip{\subsecheadingskip}
+\def\subsubsecheadingbreak{\subsecheadingbreak}
+
+
+% Print any size, any type, section title.
+%
+% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
+% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
+% section number.
+%
+\def\seckeyword{sec}
+%
+\def\sectionheading#1#2#3#4{%
+ {%
+ \checkenv{}% should not be in an environment.
+ %
+ % Switch to the right set of fonts.
+ \csname #2fonts\endcsname \rmisbold
+ %
+ \def\sectionlevel{#2}%
+ \def\temptype{#3}%
+ %
+ % Insert first mark before the heading break (see notes for \domark).
+ \let\prevsectiondefs=\lastsectiondefs
+ \ifx\temptype\Ynothingkeyword
+ \ifx\sectionlevel\seckeyword
+ \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
+ \gdef\thissection{\thissectionname}}%
+ \fi
+ \else\ifx\temptype\Yomitfromtockeyword
+ % Don't redefine \thissection.
+ \else\ifx\temptype\Yappendixkeyword
+ \ifx\sectionlevel\seckeyword
+ \toks0={#1}%
+ \xdef\lastsectiondefs{%
+ \gdef\noexpand\thissectionname{\the\toks0}%
+ \gdef\noexpand\thissectionnum{#4}%
+ % \noexpand\putwordSection avoids expanding indigestible
+ % commands in some of the translations.
+ \gdef\noexpand\thissection{\noexpand\putwordSection{}
+ \noexpand\thissectionnum:
+ \noexpand\thissectionname}%
+ }%
+ \fi
+ \else
+ \ifx\sectionlevel\seckeyword
+ \toks0={#1}%
+ \xdef\lastsectiondefs{%
+ \gdef\noexpand\thissectionname{\the\toks0}%
+ \gdef\noexpand\thissectionnum{#4}%
+ % \noexpand\putwordSection avoids expanding indigestible
+ % commands in some of the translations.
+ \gdef\noexpand\thissection{\noexpand\putwordSection{}
+ \noexpand\thissectionnum:
+ \noexpand\thissectionname}%
+ }%
+ \fi
+ \fi\fi\fi
+ %
+ % Go into vertical mode. Usually we'll already be there, but we
+ % don't want the following whatsit to end up in a preceding paragraph
+ % if the document didn't happen to have a blank line.
+ \par
+ %
+ % Output the mark. Pass it through \safewhatsit, to take care of
+ % the preceding space.
+ \safewhatsit\domark
+ %
+ % Insert space above the heading.
+ \csname #2headingbreak\endcsname
+ %
+ % Now the second mark, after the heading break. No break points
+ % between here and the heading.
+ \global\let\prevsectiondefs=\lastsectiondefs
+ \domark
+ %
+ % Only insert the space after the number if we have a section number.
+ \ifx\temptype\Ynothingkeyword
+ \setbox0 = \hbox{}%
+ \def\toctype{unn}%
+ \gdef\lastsection{#1}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ % for @headings -- no section number, don't include in toc,
+ % and don't redefine \lastsection.
+ \setbox0 = \hbox{}%
+ \def\toctype{omit}%
+ \let\sectionlevel=\empty
+ \else\ifx\temptype\Yappendixkeyword
+ \setbox0 = \hbox{#4\enspace}%
+ \def\toctype{app}%
+ \gdef\lastsection{#1}%
+ \else
+ \setbox0 = \hbox{#4\enspace}%
+ \def\toctype{num}%
+ \gdef\lastsection{#1}%
+ \fi\fi\fi
+ %
+ % Write the toc entry (before \donoderef). See comments in \chapmacro.
+ \writetocentry{\toctype\sectionlevel}{#1}{#4}%
+ %
+ % Write the node reference (= pdf destination for pdftex).
+ % Again, see comments in \chapmacro.
+ \donoderef{#3}%
+ %
+ % Interline glue will be inserted when the vbox is completed.
+ % That glue will be a valid breakpoint for the page, since it'll be
+ % preceded by a whatsit (usually from the \donoderef, or from the
+ % \writetocentry if there was no node). We don't want to allow that
+ % break, since then the whatsits could end up on page n while the
+ % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
+ \nobreak
+ %
+ % Output the actual section heading.
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
+ \hangindent=\wd0 % zero if no section number
+ \unhbox0 #1}%
+ }%
+ % Add extra space after the heading -- half of whatever came above it.
+ % Don't allow stretch, though.
+ \kern .5 \csname #2headingskip\endcsname
+ %
+ % Do not let the kern be a potential breakpoint, as it would be if it
+ % was followed by glue.
+ \nobreak
+ %
+ % We'll almost certainly start a paragraph next, so don't let that
+ % glue accumulate. (Not a breakpoint because it's preceded by a
+ % discardable item.) However, when a paragraph is not started next
+ % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
+ % or the negative glue will cause weirdly wrong output, typically
+ % obscuring the section heading with something else.
+ \vskip-\parskip
+ %
+ % This is so the last item on the main vertical list is a known
+ % \penalty > 10000, so \startdefun, etc., can recognize the situation
+ % and do the needful.
+ \penalty 10001
+}
+
+
+\message{toc,}
+% Table of contents.
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc.
+%
+% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
+% We append the current node name (if any) and page number as additional
+% arguments for the \{chap,sec,...}entry macros which will eventually
+% read this. The node name is used in the pdf outlines as the
+% destination to jump to.
+%
+% We open the .toc file for writing here instead of at @setfilename (or
+% any other fixed time) so that @contents can be anywhere in the document.
+% But if #1 is `omit', then we don't do anything. This is used for the
+% table of contents chapter openings themselves.
+%
+\newif\iftocfileopened
+\def\omitkeyword{omit}%
+%
+\def\writetocentry#1#2#3{%
+ \edef\writetoctype{#1}%
+ \ifx\writetoctype\omitkeyword \else
+ \iftocfileopened\else
+ \immediate\openout\tocfile = \jobname.toc
+ \global\tocfileopenedtrue
+ \fi
+ %
+ \iflinks
+ {\atdummies
+ \edef\temp{%
+ \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
+ \temp
+ }%
+ \fi
+ \fi
+ %
+ % Tell \shipout to create a pdf destination on each page, if we're
+ % writing pdf. These are used in the table of contents. We can't
+ % just write one on every page because the title pages are numbered
+ % 1 and 2 (the page numbers aren't printed), and so are the first
+ % two pages of the document. Thus, we'd have two destinations named
+ % `1', and two named `2'.
+ \ifpdf \global\pdfmakepagedesttrue \fi
+}
+
+
+% These characters do not print properly in the Computer Modern roman
+% fonts, so we must take special care. This is more or less redundant
+% with the Texinfo input format setup at the end of this file.
+%
+\def\activecatcodes{%
+ \catcode`\"=\active
+ \catcode`\$=\active
+ \catcode`\<=\active
+ \catcode`\>=\active
+ \catcode`\\=\active
+ \catcode`\^=\active
+ \catcode`\_=\active
+ \catcode`\|=\active
+ \catcode`\~=\active
+}
+
+
+% Read the toc file, which is essentially Texinfo input.
+\def\readtocfile{%
+ \setupdatafile
+ \activecatcodes
+ \input \tocreadfilename
+}
+
+\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Prepare to read what we've written to \tocfile.
+%
+\def\startcontents#1{%
+ % If @setchapternewpage on, and @headings double, the contents should
+ % start on an odd page, unlike chapters. Thus, we maintain
+ % \contentsalignmacro in parallel with \pagealignmacro.
+ % From: Torbjorn Granlund <tege@matematik.su.se>
+ \contentsalignmacro
+ \immediate\closeout\tocfile
+ %
+ % Don't need to put `Contents' or `Short Contents' in the headline.
+ % It is abundantly clear what they are.
+ \chapmacro{#1}{Yomitfromtoc}{}%
+ %
+ \savepageno = \pageno
+ \begingroup % Set up to handle contents files properly.
+ \raggedbottom % Worry more about breakpoints than the bottom.
+ \advance\hsize by -\contentsrightmargin % Don't use the full line length.
+ %
+ % Roman numerals for page numbers.
+ \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
+}
+
+% redefined for the two-volume lispref. We always output on
+% \jobname.toc even if this is redefined.
+%
+\def\tocreadfilename{\jobname.toc}
+
+% Normal (long) toc.
+%
+\def\contents{%
+ \startcontents{\putwordTOC}%
+ \openin 1 \tocreadfilename\space
+ \ifeof 1 \else
+ \readtocfile
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \ifeof 1 \else
+ \pdfmakeoutlines
+ \fi
+ \closein 1
+ \endgroup
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
+}
+
+% And just the chapters.
+\def\summarycontents{%
+ \startcontents{\putwordShortTOC}%
+ %
+ \let\partentry = \shortpartentry
+ \let\numchapentry = \shortchapentry
+ \let\appentry = \shortchapentry
+ \let\unnchapentry = \shortunnchapentry
+ % We want a true roman here for the page numbers.
+ \secfonts
+ \let\rm=\shortcontrm \let\bf=\shortcontbf
+ \let\sl=\shortcontsl \let\tt=\shortconttt
+ \rm
+ \hyphenpenalty = 10000
+ \advance\baselineskip by 1pt % Open it up a little.
+ \def\numsecentry##1##2##3##4{}
+ \let\appsecentry = \numsecentry
+ \let\unnsecentry = \numsecentry
+ \let\numsubsecentry = \numsecentry
+ \let\appsubsecentry = \numsecentry
+ \let\unnsubsecentry = \numsecentry
+ \let\numsubsubsecentry = \numsecentry
+ \let\appsubsubsecentry = \numsecentry
+ \let\unnsubsubsecentry = \numsecentry
+ \openin 1 \tocreadfilename\space
+ \ifeof 1 \else
+ \readtocfile
+ \fi
+ \closein 1
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \endgroup
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
+}
+\let\shortcontents = \summarycontents
+
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
+%
+\def\shortchaplabel#1{%
+ % This space should be enough, since a single number is .5em, and the
+ % widest letter (M) is 1em, at least in the Computer Modern fonts.
+ % But use \hss just in case.
+ % (This space doesn't include the extra space that gets added after
+ % the label; that gets put in by \shortchapentry above.)
+ %
+ % We'd like to right-justify chapter numbers, but that looks strange
+ % with appendix letters. And right-justifying numbers and
+ % left-justifying letters looks strange when there is less than 10
+ % chapters. Have to read the whole toc once to know how many chapters
+ % there are before deciding ...
+ \hbox to 1em{#1\hss}%
+}
+
+% These macros generate individual entries in the table of contents.
+% The first argument is the chapter or section name.
+% The last argument is the page number.
+% The arguments in between are the chapter number, section number, ...
+
+% Parts, in the main contents. Replace the part number, which doesn't
+% exist, with an empty box. Let's hope all the numbers have the same width.
+% Also ignore the page number, which is conventionally not printed.
+\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
+\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
+%
+% Parts, in the short toc.
+\def\shortpartentry#1#2#3#4{%
+ \penalty-300
+ \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
+ \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
+}
+
+% Chapters, in the main contents.
+\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
+%
+% Chapters, in the short toc.
+% See comments in \dochapentry re vbox and related settings.
+\def\shortchapentry#1#2#3#4{%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
+}
+
+% Appendices, in the main contents.
+% Need the word Appendix, and a fixed-size box.
+%
+\def\appendixbox#1{%
+ % We use M since it's probably the widest letter.
+ \setbox0 = \hbox{\putwordAppendix{} M}%
+ \hbox to \wd0{\putwordAppendix{} #1\hss}}
+%
+\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
+
+% Unnumbered chapters.
+\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
+\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
+
+% Sections.
+\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
+\let\appsecentry=\numsecentry
+\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
+
+% Subsections.
+\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsecentry=\numsubsecentry
+\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
+
+% And subsubsections.
+\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsubsecentry=\numsubsubsecentry
+\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
+
+% This parameter controls the indentation of the various levels.
+% Same as \defaultparindent.
+\newdimen\tocindent \tocindent = 15pt
+
+% Now for the actual typesetting. In all these, #1 is the text and #2 is the
+% page number.
+%
+% If the toc has to be broken over pages, we want it to be at chapters
+% if at all possible; hence the \penalty.
+\def\dochapentry#1#2{%
+ \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
+ \begingroup
+ \chapentryfonts
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+ \endgroup
+ \nobreak\vskip .25\baselineskip plus.1\baselineskip
+}
+
+\def\dosecentry#1#2{\begingroup
+ \secentryfonts \leftskip=\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsecentry#1#2{\begingroup
+ \subsecentryfonts \leftskip=2\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsubsecentry#1#2{\begingroup
+ \subsubsecentryfonts \leftskip=3\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+% We use the same \entry macro as for the index entries.
+\let\tocentry = \entry
+
+% Space between chapter (or whatever) number and the title.
+\def\labelspace{\hskip1em \relax}
+
+\def\dopageno#1{{\rm #1}}
+\def\doshortpageno#1{{\rm #1}}
+
+\def\chapentryfonts{\secfonts \rm}
+\def\secentryfonts{\textfonts}
+\def\subsecentryfonts{\textfonts}
+\def\subsubsecentryfonts{\textfonts}
+
+
+\message{environments,}
+% @foo ... @end foo.
+
+% @tex ... @end tex escapes into raw TeX temporarily.
+% One exception: @ is still an escape character, so that @end tex works.
+% But \@ or @@ will get a plain @ character.
+
+\envdef\tex{%
+ \setupmarkupstyle{tex}%
+ \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+ \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
+ \catcode `\%=14
+ \catcode `\+=\other
+ \catcode `\"=\other
+ \catcode `\|=\other
+ \catcode `\<=\other
+ \catcode `\>=\other
+ \catcode `\`=\other
+ \catcode `\'=\other
+ \escapechar=`\\
+ %
+ % ' is active in math mode (mathcode"8000). So reset it, and all our
+ % other math active characters (just in case), to plain's definitions.
+ \mathactive
+ %
+ \let\b=\ptexb
+ \let\bullet=\ptexbullet
+ \let\c=\ptexc
+ \let\,=\ptexcomma
+ \let\.=\ptexdot
+ \let\dots=\ptexdots
+ \let\equiv=\ptexequiv
+ \let\!=\ptexexclam
+ \let\i=\ptexi
+ \let\indent=\ptexindent
+ \let\noindent=\ptexnoindent
+ \let\{=\ptexlbrace
+ \let\+=\tabalign
+ \let\}=\ptexrbrace
+ \let\/=\ptexslash
+ \let\*=\ptexstar
+ \let\t=\ptext
+ \expandafter \let\csname top\endcsname=\ptextop % we've made it outer
+ \let\frenchspacing=\plainfrenchspacing
+ %
+ \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+ \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+ \def\@{@}%
+}
+% There is no need to define \Etex.
+
+% Define @lisp ... @end lisp.
+% @lisp environment forms a group so it can rebind things,
+% including the definition of @end lisp (which normally is erroneous).
+
+% Amount to narrow the margins by for @lisp.
+\newskip\lispnarrowing \lispnarrowing=0.4in
+
+% This is the definition that ^^M gets inside @lisp, @example, and other
+% such environments. \null is better than a space, since it doesn't
+% have any width.
+\def\lisppar{\null\endgraf}
+
+% This space is always present above and below environments.
+\newskip\envskipamount \envskipamount = 0pt
+
+% Make spacing and below environment symmetrical. We use \parskip here
+% to help in doing that, since in @example-like environments \parskip
+% is reset to zero; thus the \afterenvbreak inserts no space -- but the
+% start of the next paragraph will insert \parskip.
+%
+\def\aboveenvbreak{{%
+ % =10000 instead of <10000 because of a special case in \itemzzz and
+ % \sectionheading, q.v.
+ \ifnum \lastpenalty=10000 \else
+ \advance\envskipamount by \parskip
+ \endgraf
+ \ifdim\lastskip<\envskipamount
+ \removelastskip
+ % it's not a good place to break if the last penalty was \nobreak
+ % or better ...
+ \ifnum\lastpenalty<10000 \penalty-50 \fi
+ \vskip\envskipamount
+ \fi
+ \fi
+}}
+
+\let\afterenvbreak = \aboveenvbreak
+
+% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
+% also clear it, so that its embedded environments do the narrowing again.
+\let\nonarrowing=\relax
+
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
+\font\circle=lcircle10
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+\circthick=\fontdimen8\circle
+%
+\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
+\def\ctr{{\hskip 6pt\circle\char'010}}
+\def\cbl{{\circle\char'012\hskip -6pt}}
+\def\cbr{{\hskip 6pt\circle\char'011}}
+\def\carttop{\hbox to \cartouter{\hskip\lskip
+ \ctl\leaders\hrule height\circthick\hfil\ctr
+ \hskip\rskip}}
+\def\cartbot{\hbox to \cartouter{\hskip\lskip
+ \cbl\leaders\hrule height\circthick\hfil\cbr
+ \hskip\rskip}}
+%
+\newskip\lskip\newskip\rskip
+
+\envdef\cartouche{%
+ \ifhmode\par\fi % can't be in the midst of a paragraph.
+ \startsavinginserts
+ \lskip=\leftskip \rskip=\rightskip
+ \leftskip=0pt\rightskip=0pt % we want these *outside*.
+ \cartinner=\hsize \advance\cartinner by-\lskip
+ \advance\cartinner by-\rskip
+ \cartouter=\hsize
+ \advance\cartouter by 18.4pt % allow for 3pt kerns on either
+ % side, and for 6pt waste from
+ % each corner char, and rule thickness
+ \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+ % Flag to tell @lisp, etc., not to narrow margin.
+ \let\nonarrowing = t%
+ %
+ % If this cartouche directly follows a sectioning command, we need the
+ % \parskip glue (backspaced over by default) or the cartouche can
+ % collide with the section heading.
+ \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
+ %
+ \vbox\bgroup
+ \baselineskip=0pt\parskip=0pt\lineskip=0pt
+ \carttop
+ \hbox\bgroup
+ \hskip\lskip
+ \vrule\kern3pt
+ \vbox\bgroup
+ \kern3pt
+ \hsize=\cartinner
+ \baselineskip=\normbskip
+ \lineskip=\normlskip
+ \parskip=\normpskip
+ \vskip -\parskip
+ \comment % For explanation, see the end of def\group.
+}
+\def\Ecartouche{%
+ \ifhmode\par\fi
+ \kern3pt
+ \egroup
+ \kern3pt\vrule
+ \hskip\rskip
+ \egroup
+ \cartbot
+ \egroup
+ \checkinserts
+}
+
+
+% This macro is called at the beginning of all the @example variants,
+% inside a group.
+\newdimen\nonfillparindent
+\def\nonfillstart{%
+ \aboveenvbreak
+ \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
+ \sepspaces % Make spaces be word-separators rather than space tokens.
+ \let\par = \lisppar % don't ignore blank lines
+ \obeylines % each line of input is a line of output
+ \parskip = 0pt
+ % Turn off paragraph indentation but redefine \indent to emulate
+ % the normal \indent.
+ \nonfillparindent=\parindent
+ \parindent = 0pt
+ \let\indent\nonfillindent
+ %
+ \emergencystretch = 0pt % don't try to avoid overfull boxes
+ \ifx\nonarrowing\relax
+ \advance \leftskip by \lispnarrowing
+ \exdentamount=\lispnarrowing
+ \else
+ \let\nonarrowing = \relax
+ \fi
+ \let\exdent=\nofillexdent
+}
+
+\begingroup
+\obeyspaces
+% We want to swallow spaces (but not other tokens) after the fake
+% @indent in our nonfill-environments, where spaces are normally
+% active and set to @tie, resulting in them not being ignored after
+% @indent.
+\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
+\gdef\nonfillindentcheck{%
+\ifx\temp %
+\expandafter\nonfillindentgobble%
+\else%
+\leavevmode\nonfillindentbox%
+\fi%
+}%
+\endgroup
+\def\nonfillindentgobble#1{\nonfillindent}
+\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
+
+% If you want all examples etc. small: @set dispenvsize small.
+% If you want even small examples the full size: @set dispenvsize nosmall.
+% This affects the following displayed environments:
+% @example, @display, @format, @lisp
+%
+\def\smallword{small}
+\def\nosmallword{nosmall}
+\let\SETdispenvsize\relax
+\def\setnormaldispenv{%
+ \ifx\SETdispenvsize\smallword
+ % end paragraph for sake of leading, in case document has no blank
+ % line. This is redundant with what happens in \aboveenvbreak, but
+ % we need to do it before changing the fonts, and it's inconvenient
+ % to change the fonts afterward.
+ \ifnum \lastpenalty=10000 \else \endgraf \fi
+ \smallexamplefonts \rm
+ \fi
+}
+\def\setsmalldispenv{%
+ \ifx\SETdispenvsize\nosmallword
+ \else
+ \ifnum \lastpenalty=10000 \else \endgraf \fi
+ \smallexamplefonts \rm
+ \fi
+}
+
+% We often define two environments, @foo and @smallfoo.
+% Let's do it in one command. #1 is the env name, #2 the definition.
+\def\makedispenvdef#1#2{%
+ \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
+ \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
+ \expandafter\let\csname E#1\endcsname \afterenvbreak
+ \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
+}
+
+% Define two environment synonyms (#1 and #2) for an environment.
+\def\maketwodispenvdef#1#2#3{%
+ \makedispenvdef{#1}{#3}%
+ \makedispenvdef{#2}{#3}%
+}
+%
+% @lisp: indented, narrowed, typewriter font;
+% @example: same as @lisp.
+%
+% @smallexample and @smalllisp: use smaller fonts.
+% Originally contributed by Pavel@xerox.
+%
+\maketwodispenvdef{lisp}{example}{%
+ \nonfillstart
+ \tt\setupmarkupstyle{example}%
+ \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+ \gobble % eat return
+}
+% @display/@smalldisplay: same as @lisp except keep current font.
+%
+\makedispenvdef{display}{%
+ \nonfillstart
+ \gobble
+}
+
+% @format/@smallformat: same as @display except don't narrow margins.
+%
+\makedispenvdef{format}{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \gobble
+}
+
+% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
+\envdef\flushleft{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \gobble
+}
+\let\Eflushleft = \afterenvbreak
+
+% @flushright.
+%
+\envdef\flushright{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \advance\leftskip by 0pt plus 1fill\relax
+ \gobble
+}
+\let\Eflushright = \afterenvbreak
+
+
+% @raggedright does more-or-less normal line breaking but no right
+% justification. From plain.tex.
+\envdef\raggedright{%
+ \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
+}
+\let\Eraggedright\par
+
+\envdef\raggedleft{%
+ \parindent=0pt \leftskip0pt plus2em
+ \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
+ \hbadness=10000 % Last line will usually be underfull, so turn off
+ % badness reporting.
+}
+\let\Eraggedleft\par
+
+\envdef\raggedcenter{%
+ \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
+ \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
+ \hbadness=10000 % Last line will usually be underfull, so turn off
+ % badness reporting.
+}
+\let\Eraggedcenter\par
+
+
+% @quotation does normal linebreaking (hence we can't use \nonfillstart)
+% and narrows the margins. We keep \parskip nonzero in general, since
+% we're doing normal filling. So, when using \aboveenvbreak and
+% \afterenvbreak, temporarily make \parskip 0.
+%
+\makedispenvdef{quotation}{\quotationstart}
+%
+\def\quotationstart{%
+ \indentedblockstart % same as \indentedblock, but increase right margin too.
+ \ifx\nonarrowing\relax
+ \advance\rightskip by \lispnarrowing
+ \fi
+ \parsearg\quotationlabel
+}
+
+% We have retained a nonzero parskip for the environment, since we're
+% doing normal filling.
+%
+\def\Equotation{%
+ \par
+ \ifx\quotationauthor\thisisundefined\else
+ % indent a bit.
+ \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
+ \fi
+ {\parskip=0pt \afterenvbreak}%
+}
+\def\Esmallquotation{\Equotation}
+
+% If we're given an argument, typeset it in bold with a colon after.
+\def\quotationlabel#1{%
+ \def\temp{#1}%
+ \ifx\temp\empty \else
+ {\bf #1: }%
+ \fi
+}
+
+% @indentedblock is like @quotation, but indents only on the left and
+% has no optional argument.
+%
+\makedispenvdef{indentedblock}{\indentedblockstart}
+%
+\def\indentedblockstart{%
+ {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+ \parindent=0pt
+ %
+ % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \ifx\nonarrowing\relax
+ \advance\leftskip by \lispnarrowing
+ \exdentamount = \lispnarrowing
+ \else
+ \let\nonarrowing = \relax
+ \fi
+}
+
+% Keep a nonzero parskip for the environment, since we're doing normal filling.
+%
+\def\Eindentedblock{%
+ \par
+ {\parskip=0pt \afterenvbreak}%
+}
+\def\Esmallindentedblock{\Eindentedblock}
+
+
+% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
+% If we want to allow any <char> as delimiter,
+% we need the curly braces so that makeinfo sees the @verb command, eg:
+% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
+%
+% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
+%
+% [Knuth] p.344; only we need to do the other characters Texinfo sets
+% active too. Otherwise, they get lost as the first character on a
+% verbatim line.
+\def\dospecials{%
+ \do\ \do\\\do\{\do\}\do\$\do\&%
+ \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
+ \do\<\do\>\do\|\do\@\do+\do\"%
+ % Don't do the quotes -- if we do, @set txicodequoteundirected and
+ % @set txicodequotebacktick will not have effect on @verb and
+ % @verbatim, and ?` and !` ligatures won't get disabled.
+ %\do\`\do\'%
+}
+%
+% [Knuth] p. 380
+\def\uncatcodespecials{%
+ \def\do##1{\catcode`##1=\other}\dospecials}
+%
+% Setup for the @verb command.
+%
+% Eight spaces for a tab
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
+\endgroup
+%
+\def\setupverb{%
+ \tt % easiest (and conventionally used) font for verbatim
+ \def\par{\leavevmode\endgraf}%
+ \setupmarkupstyle{verb}%
+ \tabeightspaces
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+}
+
+% Setup for the @verbatim environment
+%
+% Real tab expansion.
+\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
+%
+% We typeset each line of the verbatim in an \hbox, so we can handle
+% tabs. The \global is in case the verbatim line starts with an accent,
+% or some other command that starts with a begin-group. Otherwise, the
+% entire \verbbox would disappear at the corresponding end-group, before
+% it is typeset. Meanwhile, we can't have nested verbatim commands
+% (can we?), so the \global won't be overwriting itself.
+\newbox\verbbox
+\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
+%
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabexpand{%
+ \catcode`\^^I=\active
+ \def^^I{\leavevmode\egroup
+ \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
+ \divide\dimen\verbbox by\tabw
+ \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
+ \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
+ \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
+ }%
+ }
+\endgroup
+
+% start the verbatim environment.
+\def\setupverbatim{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \tt % easiest (and conventionally used) font for verbatim
+ % The \leavevmode here is for blank lines. Otherwise, we would
+ % never \starttabox and the \egroup would end verbatim mode.
+ \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
+ \tabexpand
+ \setupmarkupstyle{verbatim}%
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count.
+ % Must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+ \everypar{\starttabbox}%
+}
+
+% Do the @verb magic: verbatim text is quoted by unique
+% delimiter characters. Before first delimiter expect a
+% right brace, after last delimiter expect closing brace:
+%
+% \def\doverb'{'<char>#1<char>'}'{#1}
+%
+% [Knuth] p. 382; only eat outer {}
+\begingroup
+ \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
+ \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
+\endgroup
+%
+\def\verb{\begingroup\setupverb\doverb}
+%
+%
+% Do the @verbatim magic: define the macro \doverbatim so that
+% the (first) argument ends when '@end verbatim' is reached, ie:
+%
+% \def\doverbatim#1@end verbatim{#1}
+%
+% For Texinfo it's a lot easier than for LaTeX,
+% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
+% we need not redefine '\', '{' and '}'.
+%
+% Inspired by LaTeX's verbatim command set [latex.ltx]
+%
+\begingroup
+ \catcode`\ =\active
+ \obeylines %
+ % ignore everything up to the first ^^M, that's the newline at the end
+ % of the @verbatim input line itself. Otherwise we get an extra blank
+ % line in the output.
+ \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
+ % We really want {...\end verbatim} in the body of the macro, but
+ % without the active space; thus we have to use \xdef and \gobble.
+\endgroup
+%
+\envdef\verbatim{%
+ \setupverbatim\doverbatim
+}
+\let\Everbatim = \afterenvbreak
+
+
+% @verbatiminclude FILE - insert text of file in verbatim environment.
+%
+\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
+%
+\def\doverbatiminclude#1{%
+ {%
+ \makevalueexpandable
+ \setupverbatim
+ \indexnofonts % Allow `@@' and other weird things in file names.
+ \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
+ \input #1
+ \afterenvbreak
+ }%
+}
+
+% @copying ... @end copying.
+% Save the text away for @insertcopying later.
+%
+% We save the uninterpreted tokens, rather than creating a box.
+% Saving the text in a box would be much easier, but then all the
+% typesetting commands (@smallbook, font changes, etc.) have to be done
+% beforehand -- and a) we want @copying to be done first in the source
+% file; b) letting users define the frontmatter in as flexible order as
+% possible is very desirable.
+%
+\def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
+\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
+%
+\def\insertcopying{%
+ \begingroup
+ \parindent = 0pt % paragraph indentation looks wrong on title page
+ \scanexp\copyingtext
+ \endgroup
+}
+
+
+\message{defuns,}
+% @defun etc.
+
+\newskip\defbodyindent \defbodyindent=.4in
+\newskip\defargsindent \defargsindent=50pt
+\newskip\deflastargmargin \deflastargmargin=18pt
+\newcount\defunpenalty
+
+% Start the processing of @deffn:
+\def\startdefun{%
+ \ifnum\lastpenalty<10000
+ \medbreak
+ \defunpenalty=10003 % Will keep this @deffn together with the
+ % following @def command, see below.
+ \else
+ % If there are two @def commands in a row, we'll have a \nobreak,
+ % which is there to keep the function description together with its
+ % header. But if there's nothing but headers, we need to allow a
+ % break somewhere. Check specifically for penalty 10002, inserted
+ % by \printdefunline, instead of 10000, since the sectioning
+ % commands also insert a nobreak penalty, and we don't want to allow
+ % a break between a section heading and a defun.
+ %
+ % As a further refinement, we avoid "club" headers by signalling
+ % with penalty of 10003 after the very first @deffn in the
+ % sequence (see above), and penalty of 10002 after any following
+ % @def command.
+ \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
+ %
+ % Similarly, after a section heading, do not allow a break.
+ % But do insert the glue.
+ \medskip % preceded by discardable penalty, so not a breakpoint
+ \fi
+ %
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+}
+
+\def\dodefunx#1{%
+ % First, check whether we are in the right environment:
+ \checkenv#1%
+ %
+ % As above, allow line break if we have multiple x headers in a row.
+ % It's not a great place, though.
+ \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
+ %
+ % And now, it's time to reuse the body of the original defun:
+ \expandafter\gobbledefun#1%
+}
+\def\gobbledefun#1\startdefun{}
+
+% \printdefunline \deffnheader{text}
+%
+\def\printdefunline#1#2{%
+ \begingroup
+ % call \deffnheader:
+ #1#2 \endheader
+ % common ending:
+ \interlinepenalty = 10000
+ \advance\rightskip by 0pt plus 1fil\relax
+ \endgraf
+ \nobreak\vskip -\parskip
+ \penalty\defunpenalty % signal to \startdefun and \dodefunx
+ % Some of the @defun-type tags do not enable magic parentheses,
+ % rendering the following check redundant. But we don't optimize.
+ \checkparencounts
+ \endgroup
+}
+
+\def\Edefun{\endgraf\medbreak}
+
+% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
+% the only thing remaining is to define \deffnheader.
+%
+\def\makedefun#1{%
+ \expandafter\let\csname E#1\endcsname = \Edefun
+ \edef\temp{\noexpand\domakedefun
+ \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
+ \temp
+}
+
+% \domakedefun \deffn \deffnx \deffnheader
+%
+% Define \deffn and \deffnx, without parameters.
+% \deffnheader has to be defined explicitly.
+%
+\def\domakedefun#1#2#3{%
+ \envdef#1{%
+ \startdefun
+ \doingtypefnfalse % distinguish typed functions from all else
+ \parseargusing\activeparens{\printdefunline#3}%
+ }%
+ \def#2{\dodefunx#1}%
+ \def#3%
+}
+
+\newif\ifdoingtypefn % doing typed function?
+\newif\ifrettypeownline % typeset return type on its own line?
+
+% @deftypefnnewline on|off says whether the return type of typed functions
+% are printed on their own line. This affects @deftypefn, @deftypefun,
+% @deftypeop, and @deftypemethod.
+%
+\parseargdef\deftypefnnewline{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETtxideftypefnnl\endcsname
+ = \empty
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETtxideftypefnnl\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @txideftypefnnl value `\temp',
+ must be on|off}%
+ \fi\fi
+}
+
+% Untyped functions:
+
+% @deffn category name args
+\makedefun{deffn}{\deffngeneral{}}
+
+% @deffn category class name args
+\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
+
+% \defopon {category on}class name args
+\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deffngeneral {subind}category name args
+%
+\def\deffngeneral#1#2 #3 #4\endheader{%
+ % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
+ \dosubind{fn}{\code{#3}}{#1}%
+ \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
+}
+
+% Typed functions:
+
+% @deftypefn category type name args
+\makedefun{deftypefn}{\deftypefngeneral{}}
+
+% @deftypeop category class type name args
+\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
+
+% \deftypeopon {category on}class type name args
+\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypefngeneral {subind}category type name args
+%
+\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
+ \dosubind{fn}{\code{#4}}{#1}%
+ \doingtypefntrue
+ \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+% Typed variables:
+
+% @deftypevr category type var args
+\makedefun{deftypevr}{\deftypecvgeneral{}}
+
+% @deftypecv category class type var args
+\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
+
+% \deftypecvof {category of}class type var args
+\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypecvgeneral {subind}category type var args
+%
+\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
+ \dosubind{vr}{\code{#4}}{#1}%
+ \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+% Untyped variables:
+
+% @defvr category var args
+\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
+
+% @defcv category class var args
+\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
+
+% \defcvof {category of}class var args
+\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
+
+% Types:
+
+% @deftp category name args
+\makedefun{deftp}#1 #2 #3\endheader{%
+ \doind{tp}{\code{#2}}%
+ \defname{#1}{}{#2}\defunargs{#3\unskip}%
+}
+
+% Remaining @defun-like shortcuts:
+\makedefun{defun}{\deffnheader{\putwordDeffunc} }
+\makedefun{defmac}{\deffnheader{\putwordDefmac} }
+\makedefun{defspec}{\deffnheader{\putwordDefspec} }
+\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
+\makedefun{defvar}{\defvrheader{\putwordDefvar} }
+\makedefun{defopt}{\defvrheader{\putwordDefopt} }
+\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
+\makedefun{defmethod}{\defopon\putwordMethodon}
+\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
+\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
+\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
+
+% \defname, which formats the name of the @def (not the args).
+% #1 is the category, such as "Function".
+% #2 is the return type, if any.
+% #3 is the function name.
+%
+% We are followed by (but not passed) the arguments, if any.
+%
+\def\defname#1#2#3{%
+ \par
+ % Get the values of \leftskip and \rightskip as they were outside the @def...
+ \advance\leftskip by -\defbodyindent
+ %
+ % Determine if we are typesetting the return type of a typed function
+ % on a line by itself.
+ \rettypeownlinefalse
+ \ifdoingtypefn % doing a typed function specifically?
+ % then check user option for putting return type on its own line:
+ \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
+ \rettypeownlinetrue
+ \fi
+ \fi
+ %
+ % How we'll format the category name. Putting it in brackets helps
+ % distinguish it from the body text that may end up on the next line
+ % just below it.
+ \def\temp{#1}%
+ \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
+ %
+ % Figure out line sizes for the paragraph shape. We'll always have at
+ % least two.
+ \tempnum = 2
+ %
+ % The first line needs space for \box0; but if \rightskip is nonzero,
+ % we need only space for the part of \box0 which exceeds it:
+ \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
+ %
+ % If doing a return type on its own line, we'll have another line.
+ \ifrettypeownline
+ \advance\tempnum by 1
+ \def\maybeshapeline{0in \hsize}%
+ \else
+ \def\maybeshapeline{}%
+ \fi
+ %
+ % The continuations:
+ \dimen2=\hsize \advance\dimen2 by -\defargsindent
+ %
+ % The final paragraph shape:
+ \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
+ %
+ % Put the category name at the right margin.
+ \noindent
+ \hbox to 0pt{%
+ \hfil\box0 \kern-\hsize
+ % \hsize has to be shortened this way:
+ \kern\leftskip
+ % Intentionally do not respect \rightskip, since we need the space.
+ }%
+ %
+ % Allow all lines to be underfull without complaint:
+ \tolerance=10000 \hbadness=10000
+ \exdentamount=\defbodyindent
+ {%
+ % defun fonts. We use typewriter by default (used to be bold) because:
+ % . we're printing identifiers, they should be in tt in principle.
+ % . in languages with many accents, such as Czech or French, it's
+ % common to leave accents off identifiers. The result looks ok in
+ % tt, but exceedingly strange in rm.
+ % . we don't want -- and --- to be treated as ligatures.
+ % . this still does not fix the ?` and !` ligatures, but so far no
+ % one has made identifiers using them :).
+ \df \tt
+ \def\temp{#2}% text of the return type
+ \ifx\temp\empty\else
+ \tclose{\temp}% typeset the return type
+ \ifrettypeownline
+ % put return type on its own line; prohibit line break following:
+ \hfil\vadjust{\nobreak}\break
+ \else
+ \space % type on same line, so just followed by a space
+ \fi
+ \fi % no return type
+ #3% output function name
+ }%
+ {\rm\enskip}% hskip 0.5 em of \tenrm
+ %
+ \boldbrax
+ % arguments will be output next, if any.
+}
+
+% Print arguments in slanted roman (not ttsl), inconsistently with using
+% tt for the name. This is because literal text is sometimes needed in
+% the argument list (groff manual), and ttsl and tt are not very
+% distinguishable. Prevent hyphenation at `-' chars.
+%
+\def\defunargs#1{%
+ % use sl by default (not ttsl),
+ % tt for the names.
+ \df \sl \hyphenchar\font=0
+ %
+ % On the other hand, if an argument has two dashes (for instance), we
+ % want a way to get ttsl. We used to recommend @var for that, so
+ % leave the code in, but it's strange for @var to lead to typewriter.
+ % Nowadays we recommend @code, since the difference between a ttsl hyphen
+ % and a tt hyphen is pretty tiny. @code also disables ?` !`.
+ \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
+ #1%
+ \sl\hyphenchar\font=45
+}
+
+% We want ()&[] to print specially on the defun line.
+%
+\def\activeparens{%
+ \catcode`\(=\active \catcode`\)=\active
+ \catcode`\[=\active \catcode`\]=\active
+ \catcode`\&=\active
+}
+
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
+
+% Be sure that we always have a definition for `(', etc. For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+{
+ \activeparens
+ \global\let(=\lparen \global\let)=\rparen
+ \global\let[=\lbrack \global\let]=\rbrack
+ \global\let& = \&
+
+ \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+ \gdef\magicamp{\let&=\amprm}
+}
+
+\newcount\parencount
+
+% If we encounter &foo, then turn on ()-hacking afterwards
+\newif\ifampseen
+\def\amprm#1 {\ampseentrue{\bf\&#1 }}
+
+\def\parenfont{%
+ \ifampseen
+ % At the first level, print parens in roman,
+ % otherwise use the default font.
+ \ifnum \parencount=1 \rm \fi
+ \else
+ % The \sf parens (in \boldbrax) actually are a little bolder than
+ % the contained text. This is especially needed for [ and ] .
+ \sf
+ \fi
+}
+\def\infirstlevel#1{%
+ \ifampseen
+ \ifnum\parencount=1
+ #1%
+ \fi
+ \fi
+}
+\def\bfafterword#1 {#1 \bf}
+
+\def\opnr{%
+ \global\advance\parencount by 1
+ {\parenfont(}%
+ \infirstlevel \bfafterword
+}
+\def\clnr{%
+ {\parenfont)}%
+ \infirstlevel \sl
+ \global\advance\parencount by -1
+}
+
+\newcount\brackcount
+\def\lbrb{%
+ \global\advance\brackcount by 1
+ {\bf[}%
+}
+\def\rbrb{%
+ {\bf]}%
+ \global\advance\brackcount by -1
+}
+
+\def\checkparencounts{%
+ \ifnum\parencount=0 \else \badparencount \fi
+ \ifnum\brackcount=0 \else \badbrackcount \fi
+}
+% these should not use \errmessage; the glibc manual, at least, actually
+% has such constructs (when documenting function pointers).
+\def\badparencount{%
+ \message{Warning: unbalanced parentheses in @def...}%
+ \global\parencount=0
+}
+\def\badbrackcount{%
+ \message{Warning: unbalanced square brackets in @def...}%
+ \global\brackcount=0
+}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\thisisundefined
+ \newwrite\macscribble
+ \def\scantokens#1{%
+ \toks0={#1}%
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{\the\toks0}%
+ \immediate\closeout\macscribble
+ \input \jobname.tmp
+ }
+\fi
+
+\def\scanmacro#1{\begingroup
+ \newlinechar`\^^M
+ \let\xeatspaces\eatspaces
+ %
+ % Undo catcode changes of \startcontents and \doprintindex
+ % When called from @insertcopying or (short)caption, we need active
+ % backslash to get it printed correctly. Previously, we had
+ % \catcode`\\=\other instead. We'll see whether a problem appears
+ % with macro expansion. --kasal, 19aug04
+ \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
+ %
+ % ... and for \example:
+ \spaceisspace
+ %
+ % The \empty here causes a following catcode 5 newline to be eaten as
+ % part of reading whitespace after a control sequence. It does not
+ % eat a catcode 13 newline. There's no good way to handle the two
+ % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
+ % would then have different behavior). See the Macro Details node in
+ % the manual for the workaround we recommend for macros and
+ % line-oriented commands.
+ %
+ \scantokens{#1\empty}%
+\endgroup}
+
+\def\scanexp#1{%
+ \edef\temp{\noexpand\scanmacro{#1}}%
+ \temp
+}
+
+\newcount\paramno % Count of parameters
+\newtoks\macname % Macro name
+\newif\ifrecursive % Is it recursive?
+
+% List of all defined macros in the form
+% \definedummyword\macro1\definedummyword\macro2...
+% Currently is also contains all @aliases; the list can be split
+% if there is a need.
+\def\macrolist{}
+
+% Add the macro to \macrolist
+\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
+\def\addtomacrolistxxx#1{%
+ \toks0 = \expandafter{\macrolist\definedummyword#1}%
+ \xdef\macrolist{\the\toks0}%
+}
+
+% Utility routines.
+% This does \let #1 = #2, with \csnames; that is,
+% \let \csname#1\endcsname = \csname#2\endcsname
+% (except of course we have to play expansion games).
+%
+\def\cslet#1#2{%
+ \expandafter\let
+ \csname#1\expandafter\endcsname
+ \csname#2\endcsname
+}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=\other \catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \
+% to recognize macro arguments; this is the job of \mbodybackslash.
+%
+% Non-ASCII encodings make 8-bit characters active, so un-activate
+% them to avoid their expansion. Must do this non-globally, to
+% confine the change to the current group.
+%
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+%
+\def\scanctxt{% used as subroutine
+ \catcode`\"=\other
+ \catcode`\+=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\@=\other
+ \catcode`\^=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\~=\other
+ \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
+}
+
+\def\scanargctxt{% used for copying and captions, not macros.
+ \scanctxt
+ \catcode`\\=\other
+ \catcode`\^^M=\other
+}
+
+\def\macrobodyctxt{% used for @macro definitions
+ \scanctxt
+ \catcode`\{=\other
+ \catcode`\}=\other
+ \catcode`\^^M=\other
+ \usembodybackslash
+}
+
+\def\macroargctxt{% used when scanning invocations
+ \scanctxt
+ \catcode`\\=0
+}
+% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
+% for the single characters \ { }. Thus, we end up with the "commands"
+% that would be written @\ @{ @} in a Texinfo document.
+%
+% We already have @{ and @}. For @\, we define it here, and only for
+% this purpose, to produce a typewriter backslash (so, the @\ that we
+% define for @math can't be used with @macro calls):
+%
+\def\\{\normalbackslash}%
+%
+% We would like to do this for \, too, since that is what makeinfo does.
+% But it is not possible, because Texinfo already has a command @, for a
+% cedilla accent. Documents must use @comma{} instead.
+%
+% \anythingelse will almost certainly be an error of some kind.
+
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+%
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+\def\margbackslash#1{\char`\#1 }
+
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+ \getargs{#1}% now \macname is the macname and \argl the arglist
+ \ifx\argl\empty % no arguments
+ \paramno=0\relax
+ \else
+ \expandafter\parsemargdef \argl;%
+ \if\paramno>256\relax
+ \ifx\eTeXversion\thisisundefined
+ \errhelp = \EMsimple
+ \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
+ \fi
+ \fi
+ \fi
+ \if1\csname ismacro.\the\macname\endcsname
+ \message{Warning: redefining \the\macname}%
+ \else
+ \expandafter\ifx\csname \the\macname\endcsname \relax
+ \else \errmessage{Macro name \the\macname\space already defined}\fi
+ \global\cslet{macsave.\the\macname}{\the\macname}%
+ \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
+ \addtomacrolist{\the\macname}%
+ \fi
+ \begingroup \macrobodyctxt
+ \ifrecursive \expandafter\parsermacbody
+ \else \expandafter\parsemacbody
+ \fi}
+
+\parseargdef\unmacro{%
+ \if1\csname ismacro.#1\endcsname
+ \global\cslet{#1}{macsave.#1}%
+ \global\expandafter\let \csname ismacro.#1\endcsname=0%
+ % Remove the macro name from \macrolist:
+ \begingroup
+ \expandafter\let\csname#1\endcsname \relax
+ \let\definedummyword\unmacrodo
+ \xdef\macrolist{\macrolist}%
+ \endgroup
+ \else
+ \errmessage{Macro #1 not defined}%
+ \fi
+}
+
+% Called by \do from \dounmacro on each macro. The idea is to omit any
+% macro definitions that have been changed to \relax.
+%
+\def\unmacrodo#1{%
+ \ifx #1\relax
+ % remove this
+ \else
+ \noexpand\definedummyword \noexpand#1%
+ \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname#1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% For macro processing make @ a letter so that we can make Texinfo private macro names.
+\edef\texiatcatcode{\the\catcode`\@}
+\catcode `@=11\relax
+
+% Parse the optional {params} list. Set up \paramno and \paramlist
+% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH
+% in the params list to some hook where the argument si to be expanded. If
+% there are less than 10 arguments that hook is to be replaced by ##N where N
+% is the position in that list, that is to say the macro arguments are to be
+% defined `a la TeX in the macro body.
+%
+% That gets used by \mbodybackslash (above).
+%
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX: let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+%
+% If there are 10 or more arguments, a different technique is used, where the
+% hook remains in the body, and when macro is to be expanded the body is
+% processed again to replace the arguments.
+%
+% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
+% argument N value and then \edef the body (nothing else will expand because of
+% the catcode regime underwhich the body was input).
+%
+% If you compile with TeX (not eTeX), and you have macros with 10 or more
+% arguments, you need that no macro has more than 256 arguments, otherwise an
+% error is produced.
+\def\parsemargdef#1;{%
+ \paramno=0\def\paramlist{}%
+ \let\hash\relax
+ \let\xeatspaces\relax
+ \parsemargdefxxx#1,;,%
+ % In case that there are 10 or more arguments we parse again the arguments
+ % list to set new definitions for the \macarg.BLAH macros corresponding to
+ % each BLAH argument. It was anyhow needed to parse already once this list
+ % in order to count the arguments, and as macros with at most 9 arguments
+ % are by far more frequent than macro with 10 or more arguments, defining
+ % twice the \macarg.BLAH macros does not cost too much processing power.
+ \ifnum\paramno<10\relax\else
+ \paramno0\relax
+ \parsemmanyargdef@@#1,;,% 10 or more arguments
+ \fi
+}
+\def\parsemargdefxxx#1,{%
+ \if#1;\let\next=\relax
+ \else \let\next=\parsemargdefxxx
+ \advance\paramno by 1
+ \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+ {\xeatspaces{\hash\the\paramno}}%
+ \edef\paramlist{\paramlist\hash\the\paramno,}%
+ \fi\next}
+
+\def\parsemmanyargdef@@#1,{%
+ \if#1;\let\next=\relax
+ \else
+ \let\next=\parsemmanyargdef@@
+ \edef\tempb{\eatspaces{#1}}%
+ \expandafter\def\expandafter\tempa
+ \expandafter{\csname macarg.\tempb\endcsname}%
+ % Note that we need some extra \noexpand\noexpand, this is because we
+ % don't want \the to be expanded in the \parsermacbody as it uses an
+ % \xdef .
+ \expandafter\edef\tempa
+ {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
+ \advance\paramno by 1\relax
+ \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+%
+
+\catcode `\@\texiatcatcode
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1@end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\catcode `\@=11\relax
+
+\let\endargs@\relax
+\let\nil@\relax
+\def\nilm@{\nil@}%
+\long\def\nillm@{\nil@}%
+
+% This macro is expanded during the Texinfo macro expansion, not during its
+% definition. It gets all the arguments values and assigns them to macros
+% macarg.ARGNAME
+%
+% #1 is the macro name
+% #2 is the list of argument names
+% #3 is the list of argument values
+\def\getargvals@#1#2#3{%
+ \def\macargdeflist@{}%
+ \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
+ \def\paramlist{#2,\nil@}%
+ \def\macroname{#1}%
+ \begingroup
+ \macroargctxt
+ \def\argvaluelist{#3,\nil@}%
+ \def\@tempa{#3}%
+ \ifx\@tempa\empty
+ \setemptyargvalues@
+ \else
+ \getargvals@@
+ \fi
+}
+
+%
+\def\getargvals@@{%
+ \ifx\paramlist\nilm@
+ % Some sanity check needed here that \argvaluelist is also empty.
+ \ifx\argvaluelist\nillm@
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Too many arguments in macro `\macroname'!}%
+ \fi
+ \let\next\macargexpandinbody@
+ \else
+ \ifx\argvaluelist\nillm@
+ % No more arguments values passed to macro. Set remaining named-arg
+ % macros to empty.
+ \let\next\setemptyargvalues@
+ \else
+ % pop current arg name into \@tempb
+ \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
+ \expandafter\@tempa\expandafter{\paramlist}%
+ % pop current argument value into \@tempc
+ \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
+ \expandafter\@tempa\expandafter{\argvaluelist}%
+ % Here \@tempb is the current arg name and \@tempc is the current arg value.
+ % First place the new argument macro definition into \@tempd
+ \expandafter\macname\expandafter{\@tempc}%
+ \expandafter\let\csname macarg.\@tempb\endcsname\relax
+ \expandafter\def\expandafter\@tempe\expandafter{%
+ \csname macarg.\@tempb\endcsname}%
+ \edef\@tempd{\long\def\@tempe{\the\macname}}%
+ \push@\@tempd\macargdeflist@
+ \let\next\getargvals@@
+ \fi
+ \fi
+ \next
+}
+
+\def\push@#1#2{%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter#2%
+ \expandafter\expandafter\expandafter{%
+ \expandafter#1#2}%
+}
+
+% Replace arguments by their values in the macro body, and place the result
+% in macro \@tempa
+\def\macvalstoargs@{%
+ % To do this we use the property that token registers that are \the'ed
+ % within an \edef expand only once. So we are going to place all argument
+ % values into respective token registers.
+ %
+ % First we save the token context, and initialize argument numbering.
+ \begingroup
+ \paramno0\relax
+ % Then, for each argument number #N, we place the corresponding argument
+ % value into a new token list register \toks#N
+ \expandafter\putargsintokens@\saveparamlist@,;,%
+ % Then, we expand the body so that argument are replaced by their
+ % values. The trick for values not to be expanded themselves is that they
+ % are within tokens and that tokens expand only once in an \edef .
+ \edef\@tempc{\csname mac.\macroname .body\endcsname}%
+ % Now we restore the token stack pointer to free the token list registers
+ % which we have used, but we make sure that expanded body is saved after
+ % group.
+ \expandafter
+ \endgroup
+ \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
+ }
+
+\def\macargexpandinbody@{%
+ %% Define the named-macro outside of this group and then close this group.
+ \expandafter
+ \endgroup
+ \macargdeflist@
+ % First the replace in body the macro arguments by their values, the result
+ % is in \@tempa .
+ \macvalstoargs@
+ % Then we point at the \norecurse or \gobble (for recursive) macro value
+ % with \@tempb .
+ \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
+ % Depending on whether it is recursive or not, we need some tailing
+ % \egroup .
+ \ifx\@tempb\gobble
+ \let\@tempc\relax
+ \else
+ \let\@tempc\egroup
+ \fi
+ % And now we do the real job:
+ \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
+ \@tempd
+}
+
+\def\putargsintokens@#1,{%
+ \if#1;\let\next\relax
+ \else
+ \let\next\putargsintokens@
+ % First we allocate the new token list register, and give it a temporary
+ % alias \@tempb .
+ \toksdef\@tempb\the\paramno
+ % Then we place the argument value into that token list register.
+ \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
+ \expandafter\@tempb\expandafter{\@tempa}%
+ \advance\paramno by 1\relax
+ \fi
+ \next
+}
+
+% Save the token stack pointer into macro #1
+\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
+% Restore the token stack pointer from number in macro #1
+\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
+% newtoks that can be used non \outer .
+\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
+
+% Tailing missing arguments are set to empty
+\def\setemptyargvalues@{%
+ \ifx\paramlist\nilm@
+ \let\next\macargexpandinbody@
+ \else
+ \expandafter\setemptyargvaluesparser@\paramlist\endargs@
+ \let\next\setemptyargvalues@
+ \fi
+ \next
+}
+
+\def\setemptyargvaluesparser@#1,#2\endargs@{%
+ \expandafter\def\expandafter\@tempa\expandafter{%
+ \expandafter\def\csname macarg.#1\endcsname{}}%
+ \push@\@tempa\macargdeflist@
+ \def\paramlist{#2}%
+}
+
+% #1 is the element target macro
+% #2 is the list macro
+% #3,#4\endargs@ is the list value
+\def\pop@#1#2#3,#4\endargs@{%
+ \def#1{#3}%
+ \def#2{#4}%
+}
+\long\def\longpop@#1#2#3,#4\endargs@{%
+ \long\def#1{#3}%
+ \long\def#2{#4}%
+}
+
+% This defines a Texinfo @macro. There are eight cases: recursive and
+% nonrecursive macros of zero, one, up to nine, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+%
+\def\defmacro{%
+ \let\hash=##% convert placeholders to macro parameter chars
+ \ifrecursive
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\scanmacro{\temp}}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup\noexpand\scanmacro{\temp}}%
+ \else
+ \ifnum\paramno<10\relax % at most 9
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+ \else % 10 or more
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\getargvals@{\the\macname}{\argl}%
+ }%
+ \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
+ \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
+ \fi
+ \fi
+ \else
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % at most 9
+ \ifnum\paramno<10\relax
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \expandafter\noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % 10 or more:
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\getargvals@{\the\macname}{\argl}%
+ }%
+ \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
+ \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
+ \fi
+ \fi
+ \fi}
+
+\catcode `\@\texiatcatcode\relax
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {. If so it reads up to the closing }, if not, it reads the whole
+% line. Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg).
+%
+\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+ \ifx\nchar\bgroup\else
+ \expandafter\parsearg
+ \fi \macnamexxx}
+
+
+% @alias.
+% We need some trickery to remove the optional spaces around the equal
+% sign. Make them active and then expand them all to nothing.
+%
+\def\alias{\parseargusing\obeyspaces\aliasxxx}
+\def\aliasxxx #1{\aliasyyy#1\relax}
+\def\aliasyyy #1=#2\relax{%
+ {%
+ \expandafter\let\obeyedspace=\empty
+ \addtomacrolist{#1}%
+ \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
+ }%
+ \next
+}
+
+
+\message{cross references,}
+
+\newwrite\auxfile
+\newif\ifhavexrefs % True if xref values are known.
+\newif\ifwarnedxrefs % True if we warned once that they aren't known.
+
+% @inforef is relatively simple.
+\def\inforef #1{\inforefzzz #1,,,,**}
+\def\inforefzzz #1,#2,#3,#4**{%
+ \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+ node \samp{\ignorespaces#1{}}}
+
+% @node's only job in TeX is to define \lastnode, which is used in
+% cross-references. The @node line might or might not have commas, and
+% might or might not have spaces before the first comma, like:
+% @node foo , bar , ...
+% We don't want such trailing spaces in the node name.
+%
+\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
+%
+% also remove a trailing comma, in case of something like this:
+% @node Help-Cross, , , Cross-refs
+\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
+\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
+
+\let\nwnode=\node
+\let\lastnode=\empty
+
+% Write a cross-reference definition for the current node. #1 is the
+% type (Ynumbered, Yappendix, Ynothing).
+%
+\def\donoderef#1{%
+ \ifx\lastnode\empty\else
+ \setref{\lastnode}{#1}%
+ \global\let\lastnode=\empty
+ \fi
+}
+
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\newcount\savesfregister
+%
+\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
+% anchor), which consists of three parts:
+% 1) NAME-title - the current sectioning name taken from \lastsection,
+% or the anchor name.
+% 2) NAME-snt - section number and type, passed as the SNT arg, or
+% empty for anchors.
+% 3) NAME-pg - the page number.
+%
+% This is called from \donoderef, \anchor, and \dofloat. In the case of
+% floats, there is an additional part, which is not written here:
+% 4) NAME-lof - the text as it should appear in a @listoffloats.
+%
+\def\setref#1#2{%
+ \pdfmkdest{#1}%
+ \iflinks
+ {%
+ \atdummies % preserve commands, but don't expand them
+ \edef\writexrdef##1##2{%
+ \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
+ ##1}{##2}}% these are parameters of \writexrdef
+ }%
+ \toks0 = \expandafter{\lastsection}%
+ \immediate \writexrdef{title}{\the\toks0 }%
+ \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
+ \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
+ }%
+ \fi
+}
+
+% @xrefautosectiontitle on|off says whether @section(ing) names are used
+% automatically in xrefs, if the third arg is not explicitly specified.
+% This was provided as a "secret" @set xref-automatic-section-title
+% variable, now it's official.
+%
+\parseargdef\xrefautomaticsectiontitle{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETxref-automatic-section-title\endcsname
+ = \empty
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETxref-automatic-section-title\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
+ must be on|off}%
+ \fi\fi
+}
+
+%
+% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual. All but the node name can be omitted.
+%
+\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
+\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
+\def\ref#1{\xrefX[#1,,,,,,,]}
+%
+\newbox\toprefbox
+\newbox\printedrefnamebox
+\newbox\infofilenamebox
+\newbox\printedmanualbox
+%
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+ \unsepspaces
+ %
+ % Get args without leading/trailing spaces.
+ \def\printedrefname{\ignorespaces #3}%
+ \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
+ %
+ \def\infofilename{\ignorespaces #4}%
+ \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
+ %
+ \def\printedmanual{\ignorespaces #5}%
+ \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
+ %
+ % If the printed reference name (arg #3) was not explicitly given in
+ % the @xref, figure out what we want to use.
+ \ifdim \wd\printedrefnamebox = 0pt
+ % No printed node name was explicitly given.
+ \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
+ % Not auto section-title: use node name inside the square brackets.
+ \def\printedrefname{\ignorespaces #1}%
+ \else
+ % Auto section-title: use chapter/section title inside
+ % the square brackets if we have it.
+ \ifdim \wd\printedmanualbox > 0pt
+ % It is in another manual, so we don't have it; use node name.
+ \def\printedrefname{\ignorespaces #1}%
+ \else
+ \ifhavexrefs
+ % We (should) know the real title if we have the xref values.
+ \def\printedrefname{\refx{#1-title}{}}%
+ \else
+ % Otherwise just copy the Info node name.
+ \def\printedrefname{\ignorespaces #1}%
+ \fi%
+ \fi
+ \fi
+ \fi
+ %
+ % Make link in pdf output.
+ \ifpdf
+ {\indexnofonts
+ \turnoffactive
+ \makevalueexpandable
+ % This expands tokens, so do it after making catcode changes, so _
+ % etc. don't get their TeX definitions. This ignores all spaces in
+ % #4, including (wrongly) those in the middle of the filename.
+ \getfilename{#4}%
+ %
+ % This (wrongly) does not take account of leading or trailing
+ % spaces in #1, which should be ignored.
+ \edef\pdfxrefdest{#1}%
+ \ifx\pdfxrefdest\empty
+ \def\pdfxrefdest{Top}% no empty targets
+ \else
+ \txiescapepdf\pdfxrefdest % escape PDF special chars
+ \fi
+ %
+ \leavevmode
+ \startlink attr{/Border [0 0 0]}%
+ \ifnum\filenamelength>0
+ goto file{\the\filename.pdf} name{\pdfxrefdest}%
+ \else
+ goto name{\pdfmkpgn{\pdfxrefdest}}%
+ \fi
+ }%
+ \setcolor{\linkcolor}%
+ \fi
+ %
+ % Float references are printed completely differently: "Figure 1.2"
+ % instead of "[somenode], p.3". We distinguish them by the
+ % LABEL-title being set to a magic string.
+ {%
+ % Have to otherify everything special to allow the \csname to
+ % include an _ in the xref name, etc.
+ \indexnofonts
+ \turnoffactive
+ \expandafter\global\expandafter\let\expandafter\Xthisreftitle
+ \csname XR#1-title\endcsname
+ }%
+ \iffloat\Xthisreftitle
+ % If the user specified the print name (third arg) to the ref,
+ % print it instead of our usual "Figure 1.2".
+ \ifdim\wd\printedrefnamebox = 0pt
+ \refx{#1-snt}{}%
+ \else
+ \printedrefname
+ \fi
+ %
+ % If the user also gave the printed manual name (fifth arg), append
+ % "in MANUALNAME".
+ \ifdim \wd\printedmanualbox > 0pt
+ \space \putwordin{} \cite{\printedmanual}%
+ \fi
+ \else
+ % node/anchor (non-float) references.
+ %
+ % If we use \unhbox to print the node names, TeX does not insert
+ % empty discretionaries after hyphens, which means that it will not
+ % find a line break at a hyphen in a node names. Since some manuals
+ % are best written with fairly long node names, containing hyphens,
+ % this is a loss. Therefore, we give the text of the node name
+ % again, so it is as if TeX is seeing it for the first time.
+ %
+ \ifdim \wd\printedmanualbox > 0pt
+ % Cross-manual reference with a printed manual name.
+ %
+ \crossmanualxref{\cite{\printedmanual\unskip}}%
+ %
+ \else\ifdim \wd\infofilenamebox > 0pt
+ % Cross-manual reference with only an info filename (arg 4), no
+ % printed manual name (arg 5). This is essentially the same as
+ % the case above; we output the filename, since we have nothing else.
+ %
+ \crossmanualxref{\code{\infofilename\unskip}}%
+ %
+ \else
+ % Reference within this manual.
+ %
+ % _ (for example) has to be the character _ for the purposes of the
+ % control sequence corresponding to the node, but it has to expand
+ % into the usual \leavevmode...\vrule stuff for purposes of
+ % printing. So we \turnoffactive for the \refx-snt, back on for the
+ % printing, back off for the \refx-pg.
+ {\turnoffactive
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ }%
+ % output the `[mynode]' via the macro below so it can be overridden.
+ \xrefprintnodename\printedrefname
+ %
+ % But we always want a comma and a space:
+ ,\space
+ %
+ % output the `page 3'.
+ \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+ \fi\fi
+ \fi
+ \endlink
+\endgroup}
+
+% Output a cross-manual xref to #1. Used just above (twice).
+%
+% Only include the text "Section ``foo'' in" if the foo is neither
+% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
+% "see The Foo Manual", the idea being to refer to the whole manual.
+%
+% But, this being TeX, we can't easily compare our node name against the
+% string "Top" while ignoring the possible spaces before and after in
+% the input. By adding the arbitrary 7sp below, we make it much less
+% likely that a real node name would have the same width as "Top" (e.g.,
+% in a monospaced font). Hopefully it will never happen in practice.
+%
+% For the same basic reason, we retypeset the "Top" at every
+% reference, since the current font is indeterminate.
+%
+\def\crossmanualxref#1{%
+ \setbox\toprefbox = \hbox{Top\kern7sp}%
+ \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
+ \ifdim \wd2 > 7sp % nonempty?
+ \ifdim \wd2 = \wd\toprefbox \else % same as Top?
+ \putwordSection{} ``\printedrefname'' \putwordin{}\space
+ \fi
+ \fi
+ #1%
+}
+
+% This macro is called from \xrefX for the `[nodename]' part of xref
+% output. It's a separate macro only so it can be changed more easily,
+% since square brackets don't work well in some documents. Particularly
+% one that Bob is working on :).
+%
+\def\xrefprintnodename#1{[#1]}
+
+% Things referred to by \setref.
+%
+\def\Ynothing{}
+\def\Yomitfromtoc{}
+\def\Ynumbered{%
+ \ifnum\secno=0
+ \putwordChapter@tie \the\chapno
+ \else \ifnum\subsecno=0
+ \putwordSection@tie \the\chapno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
+\def\Yappendix{%
+ \ifnum\secno=0
+ \putwordAppendix@tie @char\the\appendixno{}%
+ \else \ifnum\subsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie
+ @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
+
+% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
+% If its value is nonempty, SUFFIX is output afterward.
+%
+\def\refx#1#2{%
+ {%
+ \indexnofonts
+ \otherbackslash
+ \expandafter\global\expandafter\let\expandafter\thisrefX
+ \csname XR#1\endcsname
+ }%
+ \ifx\thisrefX\relax
+ % If not defined, say something at least.
+ \angleleft un\-de\-fined\angleright
+ \iflinks
+ \ifhavexrefs
+ {\toks0 = {#1}% avoid expansion of possibly-complex value
+ \message{\linenumber Undefined cross reference `\the\toks0'.}}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
+ \fi
+ \fi
+ \else
+ % It's defined, so just use it.
+ \thisrefX
+ \fi
+ #2% Output the suffix in any case.
+}
+
+% This is the macro invoked by entries in the aux file. Usually it's
+% just a \def (we prepend XR to the control sequence name to avoid
+% collisions). But if this is a float type, we have more work to do.
+%
+\def\xrdef#1#2{%
+ {% The node name might contain 8-bit characters, which in our current
+ % implementation are changed to commands like @'e. Don't let these
+ % mess up the control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safexrefname{#1}%
+ }%
+ %
+ \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
+ %
+ % Was that xref control sequence that we just defined for a float?
+ \expandafter\iffloat\csname XR\safexrefname\endcsname
+ % it was a float, and we have the (safe) float type in \iffloattype.
+ \expandafter\let\expandafter\floatlist
+ \csname floatlist\iffloattype\endcsname
+ %
+ % Is this the first time we've seen this float type?
+ \expandafter\ifx\floatlist\relax
+ \toks0 = {\do}% yes, so just \do
+ \else
+ % had it before, so preserve previous elements in list.
+ \toks0 = \expandafter{\floatlist\do}%
+ \fi
+ %
+ % Remember this xref in the control sequence \floatlistFLOATTYPE,
+ % for later use in \listoffloats.
+ \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
+ {\safexrefname}}%
+ \fi
+}
+
+% Read the last existing aux file, if any. No error if none exists.
+%
+\def\tryauxfile{%
+ \openin 1 \jobname.aux
+ \ifeof 1 \else
+ \readdatafile{aux}%
+ \global\havexrefstrue
+ \fi
+ \closein 1
+}
+
+\def\setupdatafile{%
+ \catcode`\^^@=\other
+ \catcode`\^^A=\other
+ \catcode`\^^B=\other
+ \catcode`\^^C=\other
+ \catcode`\^^D=\other
+ \catcode`\^^E=\other
+ \catcode`\^^F=\other
+ \catcode`\^^G=\other
+ \catcode`\^^H=\other
+ \catcode`\^^K=\other
+ \catcode`\^^L=\other
+ \catcode`\^^N=\other
+ \catcode`\^^P=\other
+ \catcode`\^^Q=\other
+ \catcode`\^^R=\other
+ \catcode`\^^S=\other
+ \catcode`\^^T=\other
+ \catcode`\^^U=\other
+ \catcode`\^^V=\other
+ \catcode`\^^W=\other
+ \catcode`\^^X=\other
+ \catcode`\^^Z=\other
+ \catcode`\^^[=\other
+ \catcode`\^^\=\other
+ \catcode`\^^]=\other
+ \catcode`\^^^=\other
+ \catcode`\^^_=\other
+ % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
+ % in xref tags, i.e., node names. But since ^^e4 notation isn't
+ % supported in the main text, it doesn't seem desirable. Furthermore,
+ % that is not enough: for node names that actually contain a ^
+ % character, we would end up writing a line like this: 'xrdef {'hat
+ % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
+ % argument, and \hat is not an expandable control sequence. It could
+ % all be worked out, but why? Either we support ^^ or we don't.
+ %
+ % The other change necessary for this was to define \auxhat:
+ % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
+ % and then to call \auxhat in \setq.
+ %
+ \catcode`\^=\other
+ %
+ % Special characters. Should be turned off anyway, but...
+ \catcode`\~=\other
+ \catcode`\[=\other
+ \catcode`\]=\other
+ \catcode`\"=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\$=\other
+ \catcode`\#=\other
+ \catcode`\&=\other
+ \catcode`\%=\other
+ \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ %
+ % This is to support \ in node names and titles, since the \
+ % characters end up in a \csname. It's easier than
+ % leaving it active and making its active definition an actual \
+ % character. What I don't understand is why it works in the *value*
+ % of the xrdef. Seems like it should be a catcode12 \, and that
+ % should not typeset properly. But it works, so I'm moving on for
+ % now. --karl, 15jan04.
+ \catcode`\\=\other
+ %
+ % Make the characters 128-255 be printing characters.
+ {%
+ \count1=128
+ \def\loop{%
+ \catcode\count1=\other
+ \advance\count1 by 1
+ \ifnum \count1<256 \loop \fi
+ }%
+ }%
+ %
+ % @ is our escape character in .aux files, and we need braces.
+ \catcode`\{=1
+ \catcode`\}=2
+ \catcode`\@=0
+}
+
+\def\readdatafile#1{%
+\begingroup
+ \setupdatafile
+ \input\jobname.#1
+\endgroup}
+
+
+\message{insertions,}
+% including footnotes.
+
+\newcount \footnoteno
+
+% The trailing space in the following definition for supereject is
+% vital for proper filling; pages come out unaligned when you do a
+% pagealignmacro call if that space before the closing brace is
+% removed. (Generally, numeric constants should always be followed by a
+% space to prevent strange expansion errors.)
+\def\supereject{\par\penalty -20000\footnoteno =0 }
+
+% @footnotestyle is meaningful for Info output only.
+\let\footnotestyle=\comment
+
+{\catcode `\@=11
+%
+% Auto-number footnotes. Otherwise like plain.
+\gdef\footnote{%
+ \let\indent=\ptexindent
+ \let\noindent=\ptexnoindent
+ \global\advance\footnoteno by \@ne
+ \edef\thisfootno{$^{\the\footnoteno}$}%
+ %
+ % In case the footnote comes at the end of a sentence, preserve the
+ % extra spacing after we do the footnote number.
+ \let\@sf\empty
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
+ %
+ % Remove inadvertent blank space before typesetting the footnote number.
+ \unskip
+ \thisfootno\@sf
+ \dofootnote
+}%
+
+% Don't bother with the trickery in plain.tex to not require the
+% footnote text as a parameter. Our footnotes don't need to be so general.
+%
+% Oh yes, they do; otherwise, @ifset (and anything else that uses
+% \parseargline) fails inside footnotes because the tokens are fixed when
+% the footnote is read. --karl, 16nov96.
+%
+\gdef\dofootnote{%
+ \insert\footins\bgroup
+ % We want to typeset this text as a normal paragraph, even if the
+ % footnote reference occurs in (for example) a display environment.
+ % So reset some parameters.
+ \hsize=\pagewidth
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\ht\strutbox % top baseline for broken footnotes
+ \splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM
+ \leftskip\z@skip
+ \rightskip\z@skip
+ \spaceskip\z@skip
+ \xspaceskip\z@skip
+ \parindent\defaultparindent
+ %
+ \smallfonts \rm
+ %
+ % Because we use hanging indentation in footnotes, a @noindent appears
+ % to exdent this text, so make it be a no-op. makeinfo does not use
+ % hanging indentation so @noindent can still be needed within footnote
+ % text after an @example or the like (not that this is good style).
+ \let\noindent = \relax
+ %
+ % Hang the footnote text off the number. Use \everypar in case the
+ % footnote extends for more than one paragraph.
+ \everypar = {\hang}%
+ \textindent{\thisfootno}%
+ %
+ % Don't crash into the line above the footnote text. Since this
+ % expands into a box, it must come within the paragraph, lest it
+ % provide a place where TeX can split the footnote.
+ \footstrut
+ %
+ % Invoke rest of plain TeX footnote routine.
+ \futurelet\next\fo@t
+}
+}%end \catcode `\@=11
+
+% In case a @footnote appears in a vbox, save the footnote text and create
+% the real \insert just after the vbox finished. Otherwise, the insertion
+% would be lost.
+% Similarly, if a @footnote appears inside an alignment, save the footnote
+% text to a box and make the \insert when a row of the table is finished.
+% And the same can be done for other insert classes. --kasal, 16nov03.
+
+% Replace the \insert primitive by a cheating macro.
+% Deeper inside, just make sure that the saved insertions are not spilled
+% out prematurely.
+%
+\def\startsavinginserts{%
+ \ifx \insert\ptexinsert
+ \let\insert\saveinsert
+ \else
+ \let\checkinserts\relax
+ \fi
+}
+
+% This \insert replacement works for both \insert\footins{foo} and
+% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
+%
+\def\saveinsert#1{%
+ \edef\next{\noexpand\savetobox \makeSAVEname#1}%
+ \afterassignment\next
+ % swallow the left brace
+ \let\temp =
+}
+\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
+\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
+
+\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
+
+\def\placesaveins#1{%
+ \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
+ {\box#1}%
+}
+
+% eat @SAVE -- beware, all of them have catcode \other:
+{
+ \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
+ \gdef\gobblesave @SAVE{}
+}
+
+% initialization:
+\def\newsaveins #1{%
+ \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
+ \next
+}
+\def\newsaveinsX #1{%
+ \csname newbox\endcsname #1%
+ \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
+ \checksaveins #1}%
+}
+
+% initialize:
+\let\checkinserts\empty
+\newsaveins\footins
+\newsaveins\margin
+
+
+% @image. We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front. If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+ % Do not bother showing banner with epsf.tex v2.7k (available in
+ % doc/epsf.tex and on ctan).
+ \def\epsfannounce{\toks0 = }%
+ \input epsf.tex
+\fi
+\closein 1
+%
+% We will only complain once about lack of epsf.tex.
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+ work. It is also included in the Texinfo distribution, or you can get
+ it from ftp://tug.org/tex/epsf.tex.}
+%
+\def\image#1{%
+ \ifx\epsfbox\thisisundefined
+ \ifwarnednoepsf \else
+ \errhelp = \noepsfhelp
+ \errmessage{epsf.tex not found, images will be ignored}%
+ \global\warnednoepsftrue
+ \fi
+ \else
+ \imagexxx #1,,,,,\finish
+ \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is (ignored optional) html alt text.
+% #5 is (ignored optional) extension.
+% #6 is just the usual extra ignored arg for parsing stuff.
+\newif\ifimagevmode
+\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
+ \catcode`\^^M = 5 % in case we're inside an example
+ \normalturnoffactive % allow _ et al. in names
+ % If the image is by itself, center it.
+ \ifvmode
+ \imagevmodetrue
+ \else \ifx\centersub\centerV
+ % for @center @image, we need a vbox so we can have our vertical space
+ \imagevmodetrue
+ \vbox\bgroup % vbox has better behavior than vtop herev
+ \fi\fi
+ %
+ \ifimagevmode
+ \nobreak\medskip
+ % Usually we'll have text after the image which will insert
+ % \parskip glue, so insert it here too to equalize the space
+ % above and below.
+ \nobreak\vskip\parskip
+ \nobreak
+ \fi
+ %
+ % Leave vertical mode so that indentation from an enclosing
+ % environment such as @quotation is respected.
+ % However, if we're at the top level, we don't want the
+ % normal paragraph indentation.
+ % On the other hand, if we are in the case of @center @image, we don't
+ % want to start a paragraph, which will create a hsize-width box and
+ % eradicate the centering.
+ \ifx\centersub\centerV\else \noindent \fi
+ %
+ % Output the image.
+ \ifpdf
+ \dopdfimage{#1}{#2}{#3}%
+ \else
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+ \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+ \epsfbox{#1.eps}%
+ \fi
+ %
+ \ifimagevmode
+ \medskip % space after a standalone image
+ \fi
+ \ifx\centersub\centerV \egroup \fi
+\endgroup}
+
+
+% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
+% etc. We don't actually implement floating yet, we always include the
+% float "here". But it seemed the best name for the future.
+%
+\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
+
+% There may be a space before second and/or third parameter; delete it.
+\def\eatcommaspace#1, {#1,}
+
+% #1 is the optional FLOATTYPE, the text label for this float, typically
+% "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
+% this float will not be numbered and cannot be referred to.
+%
+% #2 is the optional xref label. Also must be present for the float to
+% be referable.
+%
+% #3 is the optional positioning argument; for now, it is ignored. It
+% will somehow specify the positions allowed to float to (here, top, bottom).
+%
+% We keep a separate counter for each FLOATTYPE, which we reset at each
+% chapter-level command.
+\let\resetallfloatnos=\empty
+%
+\def\dofloat#1,#2,#3,#4\finish{%
+ \let\thiscaption=\empty
+ \let\thisshortcaption=\empty
+ %
+ % don't lose footnotes inside @float.
+ %
+ % BEWARE: when the floats start float, we have to issue warning whenever an
+ % insert appears inside a float which could possibly float. --kasal, 26may04
+ %
+ \startsavinginserts
+ %
+ % We can't be used inside a paragraph.
+ \par
+ %
+ \vtop\bgroup
+ \def\floattype{#1}%
+ \def\floatlabel{#2}%
+ \def\floatloc{#3}% we do nothing with this yet.
+ %
+ \ifx\floattype\empty
+ \let\safefloattype=\empty
+ \else
+ {%
+ % the floattype might have accents or other special characters,
+ % but we need to use it in a control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safefloattype{\floattype}%
+ }%
+ \fi
+ %
+ % If label is given but no type, we handle that as the empty type.
+ \ifx\floatlabel\empty \else
+ % We want each FLOATTYPE to be numbered separately (Figure 1,
+ % Table 1, Figure 2, ...). (And if no label, no number.)
+ %
+ \expandafter\getfloatno\csname\safefloattype floatno\endcsname
+ \global\advance\floatno by 1
+ %
+ {%
+ % This magic value for \lastsection is output by \setref as the
+ % XREFLABEL-title value. \xrefX uses it to distinguish float
+ % labels (which have a completely different output format) from
+ % node and anchor labels. And \xrdef uses it to construct the
+ % lists of floats.
+ %
+ \edef\lastsection{\floatmagic=\safefloattype}%
+ \setref{\floatlabel}{Yfloat}%
+ }%
+ \fi
+ %
+ % start with \parskip glue, I guess.
+ \vskip\parskip
+ %
+ % Don't suppress indentation if a float happens to start a section.
+ \restorefirstparagraphindent
+}
+
+% we have these possibilities:
+% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
+% @float Foo,lbl & no caption: Foo 1.1
+% @float Foo & @caption{Cap}: Foo: Cap
+% @float Foo & no caption: Foo
+% @float ,lbl & Caption{Cap}: 1.1: Cap
+% @float ,lbl & no caption: 1.1
+% @float & @caption{Cap}: Cap
+% @float & no caption:
+%
+\def\Efloat{%
+ \let\floatident = \empty
+ %
+ % In all cases, if we have a float type, it comes first.
+ \ifx\floattype\empty \else \def\floatident{\floattype}\fi
+ %
+ % If we have an xref label, the number comes next.
+ \ifx\floatlabel\empty \else
+ \ifx\floattype\empty \else % if also had float type, need tie first.
+ \appendtomacro\floatident{\tie}%
+ \fi
+ % the number.
+ \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
+ \fi
+ %
+ % Start the printed caption with what we've constructed in
+ % \floatident, but keep it separate; we need \floatident again.
+ \let\captionline = \floatident
+ %
+ \ifx\thiscaption\empty \else
+ \ifx\floatident\empty \else
+ \appendtomacro\captionline{: }% had ident, so need a colon between
+ \fi
+ %
+ % caption text.
+ \appendtomacro\captionline{\scanexp\thiscaption}%
+ \fi
+ %
+ % If we have anything to print, print it, with space before.
+ % Eventually this needs to become an \insert.
+ \ifx\captionline\empty \else
+ \vskip.5\parskip
+ \captionline
+ %
+ % Space below caption.
+ \vskip\parskip
+ \fi
+ %
+ % If have an xref label, write the list of floats info. Do this
+ % after the caption, to avoid chance of it being a breakpoint.
+ \ifx\floatlabel\empty \else
+ % Write the text that goes in the lof to the aux file as
+ % \floatlabel-lof. Besides \floatident, we include the short
+ % caption if specified, else the full caption if specified, else nothing.
+ {%
+ \atdummies
+ %
+ % since we read the caption text in the macro world, where ^^M
+ % is turned into a normal character, we have to scan it back, so
+ % we don't write the literal three characters "^^M" into the aux file.
+ \scanexp{%
+ \xdef\noexpand\gtemp{%
+ \ifx\thisshortcaption\empty
+ \thiscaption
+ \else
+ \thisshortcaption
+ \fi
+ }%
+ }%
+ \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
+ \ifx\gtemp\empty \else : \gtemp \fi}}%
+ }%
+ \fi
+ \egroup % end of \vtop
+ %
+ % place the captured inserts
+ %
+ % BEWARE: when the floats start floating, we have to issue warning
+ % whenever an insert appears inside a float which could possibly
+ % float. --kasal, 26may04
+ %
+ \checkinserts
+}
+
+% Append the tokens #2 to the definition of macro #1, not expanding either.
+%
+\def\appendtomacro#1#2{%
+ \expandafter\def\expandafter#1\expandafter{#1#2}%
+}
+
+% @caption, @shortcaption
+%
+\def\caption{\docaption\thiscaption}
+\def\shortcaption{\docaption\thisshortcaption}
+\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
+\def\defcaption#1#2{\egroup \def#1{#2}}
+
+% The parameter is the control sequence identifying the counter we are
+% going to use. Create it if it doesn't exist and assign it to \floatno.
+\def\getfloatno#1{%
+ \ifx#1\relax
+ % Haven't seen this figure type before.
+ \csname newcount\endcsname #1%
+ %
+ % Remember to reset this floatno at the next chap.
+ \expandafter\gdef\expandafter\resetallfloatnos
+ \expandafter{\resetallfloatnos #1=0 }%
+ \fi
+ \let\floatno#1%
+}
+
+% \setref calls this to get the XREFLABEL-snt value. We want an @xref
+% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
+% first read the @float command.
+%
+\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
+
+% Magic string used for the XREFLABEL-title value, so \xrefX can
+% distinguish floats from other xref types.
+\def\floatmagic{!!float!!}
+
+% #1 is the control sequence we are passed; we expand into a conditional
+% which is true if #1 represents a float ref. That is, the magic
+% \lastsection value which we \setref above.
+%
+\def\iffloat#1{\expandafter\doiffloat#1==\finish}
+%
+% #1 is (maybe) the \floatmagic string. If so, #2 will be the
+% (safe) float type for this float. We set \iffloattype to #2.
+%
+\def\doiffloat#1=#2=#3\finish{%
+ \def\temp{#1}%
+ \def\iffloattype{#2}%
+ \ifx\temp\floatmagic
+}
+
+% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
+%
+\parseargdef\listoffloats{%
+ \def\floattype{#1}% floattype
+ {%
+ % the floattype might have accents or other special characters,
+ % but we need to use it in a control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safefloattype{\floattype}%
+ }%
+ %
+ % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
+ \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
+ \ifhavexrefs
+ % if the user said @listoffloats foo but never @float foo.
+ \message{\linenumber No `\safefloattype' floats to list.}%
+ \fi
+ \else
+ \begingroup
+ \leftskip=\tocindent % indent these entries like a toc
+ \let\do=\listoffloatsdo
+ \csname floatlist\safefloattype\endcsname
+ \endgroup
+ \fi
+}
+
+% This is called on each entry in a list of floats. We're passed the
+% xref label, in the form LABEL-title, which is how we save it in the
+% aux file. We strip off the -title and look up \XRLABEL-lof, which
+% has the text we're supposed to typeset here.
+%
+% Figures without xref labels will not be included in the list (since
+% they won't appear in the aux file).
+%
+\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
+\def\listoffloatsdoentry#1-title\finish{{%
+ % Can't fully expand XR#1-lof because it can contain anything. Just
+ % pass the control sequence. On the other hand, XR#1-pg is just the
+ % page number, and we want to fully expand that so we can get a link
+ % in pdf output.
+ \toksA = \expandafter{\csname XR#1-lof\endcsname}%
+ %
+ % use the same \entry macro we use to generate the TOC and index.
+ \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
+ \writeentry
+}}
+
+
+\message{localization,}
+
+% For single-language documents, @documentlanguage is usually given very
+% early, just after @documentencoding. Single argument is the language
+% (de) or locale (de_DE) abbreviation.
+%
+{
+ \catcode`\_ = \active
+ \globaldefs=1
+\parseargdef\documentlanguage{\begingroup
+ \let_=\normalunderscore % normal _ character for filenames
+ \tex % read txi-??.tex file in plain TeX.
+ % Read the file by the name they passed if it exists.
+ \openin 1 txi-#1.tex
+ \ifeof 1
+ \documentlanguagetrywithoutunderscore{#1_\finish}%
+ \else
+ \globaldefs = 1 % everything in the txi-LL files needs to persist
+ \input txi-#1.tex
+ \fi
+ \closein 1
+ \endgroup % end raw TeX
+\endgroup}
+%
+% If they passed de_DE, and txi-de_DE.tex doesn't exist,
+% try txi-de.tex.
+%
+\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
+ \openin 1 txi-#1.tex
+ \ifeof 1
+ \errhelp = \nolanghelp
+ \errmessage{Cannot read language file txi-#1.tex}%
+ \else
+ \globaldefs = 1 % everything in the txi-LL files needs to persist
+ \input txi-#1.tex
+ \fi
+ \closein 1
+}
+}% end of special _ catcode
+%
+\newhelp\nolanghelp{The given language definition file cannot be found or
+is empty. Maybe you need to install it? Putting it in the current
+directory should work if nowhere else does.}
+
+% This macro is called from txi-??.tex files; the first argument is the
+% \language name to set (without the "\lang@" prefix), the second and
+% third args are \{left,right}hyphenmin.
+%
+% The language names to pass are determined when the format is built.
+% See the etex.log file created at that time, e.g.,
+% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
+%
+% With TeX Live 2008, etex now includes hyphenation patterns for all
+% available languages. This means we can support hyphenation in
+% Texinfo, at least to some extent. (This still doesn't solve the
+% accented characters problem.)
+%
+\catcode`@=11
+\def\txisetlanguage#1#2#3{%
+ % do not set the language if the name is undefined in the current TeX.
+ \expandafter\ifx\csname lang@#1\endcsname \relax
+ \message{no patterns for #1}%
+ \else
+ \global\language = \csname lang@#1\endcsname
+ \fi
+ % but there is no harm in adjusting the hyphenmin values regardless.
+ \global\lefthyphenmin = #2\relax
+ \global\righthyphenmin = #3\relax
+}
+
+% Helpers for encodings.
+% Set the catcode of characters 128 through 255 to the specified number.
+%
+\def\setnonasciicharscatcode#1{%
+ \count255=128
+ \loop\ifnum\count255<256
+ \global\catcode\count255=#1\relax
+ \advance\count255 by 1
+ \repeat
+}
+
+\def\setnonasciicharscatcodenonglobal#1{%
+ \count255=128
+ \loop\ifnum\count255<256
+ \catcode\count255=#1\relax
+ \advance\count255 by 1
+ \repeat
+}
+
+% @documentencoding sets the definition of non-ASCII characters
+% according to the specified encoding.
+%
+\parseargdef\documentencoding{%
+ % Encoding being declared for the document.
+ \def\declaredencoding{\csname #1.enc\endcsname}%
+ %
+ % Supported encodings: names converted to tokens in order to be able
+ % to compare them with \ifx.
+ \def\ascii{\csname US-ASCII.enc\endcsname}%
+ \def\latnine{\csname ISO-8859-15.enc\endcsname}%
+ \def\latone{\csname ISO-8859-1.enc\endcsname}%
+ \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
+ \def\utfeight{\csname UTF-8.enc\endcsname}%
+ %
+ \ifx \declaredencoding \ascii
+ \asciichardefs
+ %
+ \else \ifx \declaredencoding \lattwo
+ \setnonasciicharscatcode\active
+ \lattwochardefs
+ %
+ \else \ifx \declaredencoding \latone
+ \setnonasciicharscatcode\active
+ \latonechardefs
+ %
+ \else \ifx \declaredencoding \latnine
+ \setnonasciicharscatcode\active
+ \latninechardefs
+ %
+ \else \ifx \declaredencoding \utfeight
+ \setnonasciicharscatcode\active
+ \utfeightchardefs
+ %
+ \else
+ \message{Unknown document encoding #1, ignoring.}%
+ %
+ \fi % utfeight
+ \fi % latnine
+ \fi % latone
+ \fi % lattwo
+ \fi % ascii
+}
+
+% A message to be logged when using a character that isn't available
+% the default font encoding (OT1).
+%
+\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
+
+% Take account of \c (plain) vs. \, (Texinfo) difference.
+\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
+
+% First, make active non-ASCII characters in order for them to be
+% correctly categorized when TeX reads the replacement text of
+% macros containing the character definitions.
+\setnonasciicharscatcode\active
+%
+% Latin1 (ISO-8859-1) character definitions.
+\def\latonechardefs{%
+ \gdef^^a0{\tie}
+ \gdef^^a1{\exclamdown}
+ \gdef^^a2{\missingcharmsg{CENT SIGN}}
+ \gdef^^a3{{\pounds}}
+ \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
+ \gdef^^a5{\missingcharmsg{YEN SIGN}}
+ \gdef^^a6{\missingcharmsg{BROKEN BAR}}
+ \gdef^^a7{\S}
+ \gdef^^a8{\"{}}
+ \gdef^^a9{\copyright}
+ \gdef^^aa{\ordf}
+ \gdef^^ab{\guillemetleft}
+ \gdef^^ac{$\lnot$}
+ \gdef^^ad{\-}
+ \gdef^^ae{\registeredsymbol}
+ \gdef^^af{\={}}
+ %
+ \gdef^^b0{\textdegree}
+ \gdef^^b1{$\pm$}
+ \gdef^^b2{$^2$}
+ \gdef^^b3{$^3$}
+ \gdef^^b4{\'{}}
+ \gdef^^b5{$\mu$}
+ \gdef^^b6{\P}
+ %
+ \gdef^^b7{$^.$}
+ \gdef^^b8{\cedilla\ }
+ \gdef^^b9{$^1$}
+ \gdef^^ba{\ordm}
+ %
+ \gdef^^bb{\guillemetright}
+ \gdef^^bc{$1\over4$}
+ \gdef^^bd{$1\over2$}
+ \gdef^^be{$3\over4$}
+ \gdef^^bf{\questiondown}
+ %
+ \gdef^^c0{\`A}
+ \gdef^^c1{\'A}
+ \gdef^^c2{\^A}
+ \gdef^^c3{\~A}
+ \gdef^^c4{\"A}
+ \gdef^^c5{\ringaccent A}
+ \gdef^^c6{\AE}
+ \gdef^^c7{\cedilla C}
+ \gdef^^c8{\`E}
+ \gdef^^c9{\'E}
+ \gdef^^ca{\^E}
+ \gdef^^cb{\"E}
+ \gdef^^cc{\`I}
+ \gdef^^cd{\'I}
+ \gdef^^ce{\^I}
+ \gdef^^cf{\"I}
+ %
+ \gdef^^d0{\DH}
+ \gdef^^d1{\~N}
+ \gdef^^d2{\`O}
+ \gdef^^d3{\'O}
+ \gdef^^d4{\^O}
+ \gdef^^d5{\~O}
+ \gdef^^d6{\"O}
+ \gdef^^d7{$\times$}
+ \gdef^^d8{\O}
+ \gdef^^d9{\`U}
+ \gdef^^da{\'U}
+ \gdef^^db{\^U}
+ \gdef^^dc{\"U}
+ \gdef^^dd{\'Y}
+ \gdef^^de{\TH}
+ \gdef^^df{\ss}
+ %
+ \gdef^^e0{\`a}
+ \gdef^^e1{\'a}
+ \gdef^^e2{\^a}
+ \gdef^^e3{\~a}
+ \gdef^^e4{\"a}
+ \gdef^^e5{\ringaccent a}
+ \gdef^^e6{\ae}
+ \gdef^^e7{\cedilla c}
+ \gdef^^e8{\`e}
+ \gdef^^e9{\'e}
+ \gdef^^ea{\^e}
+ \gdef^^eb{\"e}
+ \gdef^^ec{\`{\dotless i}}
+ \gdef^^ed{\'{\dotless i}}
+ \gdef^^ee{\^{\dotless i}}
+ \gdef^^ef{\"{\dotless i}}
+ %
+ \gdef^^f0{\dh}
+ \gdef^^f1{\~n}
+ \gdef^^f2{\`o}
+ \gdef^^f3{\'o}
+ \gdef^^f4{\^o}
+ \gdef^^f5{\~o}
+ \gdef^^f6{\"o}
+ \gdef^^f7{$\div$}
+ \gdef^^f8{\o}
+ \gdef^^f9{\`u}
+ \gdef^^fa{\'u}
+ \gdef^^fb{\^u}
+ \gdef^^fc{\"u}
+ \gdef^^fd{\'y}
+ \gdef^^fe{\th}
+ \gdef^^ff{\"y}
+}
+
+% Latin9 (ISO-8859-15) encoding character definitions.
+\def\latninechardefs{%
+ % Encoding is almost identical to Latin1.
+ \latonechardefs
+ %
+ \gdef^^a4{\euro}
+ \gdef^^a6{\v S}
+ \gdef^^a8{\v s}
+ \gdef^^b4{\v Z}
+ \gdef^^b8{\v z}
+ \gdef^^bc{\OE}
+ \gdef^^bd{\oe}
+ \gdef^^be{\"Y}
+}
+
+% Latin2 (ISO-8859-2) character definitions.
+\def\lattwochardefs{%
+ \gdef^^a0{\tie}
+ \gdef^^a1{\ogonek{A}}
+ \gdef^^a2{\u{}}
+ \gdef^^a3{\L}
+ \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
+ \gdef^^a5{\v L}
+ \gdef^^a6{\'S}
+ \gdef^^a7{\S}
+ \gdef^^a8{\"{}}
+ \gdef^^a9{\v S}
+ \gdef^^aa{\cedilla S}
+ \gdef^^ab{\v T}
+ \gdef^^ac{\'Z}
+ \gdef^^ad{\-}
+ \gdef^^ae{\v Z}
+ \gdef^^af{\dotaccent Z}
+ %
+ \gdef^^b0{\textdegree}
+ \gdef^^b1{\ogonek{a}}
+ \gdef^^b2{\ogonek{ }}
+ \gdef^^b3{\l}
+ \gdef^^b4{\'{}}
+ \gdef^^b5{\v l}
+ \gdef^^b6{\'s}
+ \gdef^^b7{\v{}}
+ \gdef^^b8{\cedilla\ }
+ \gdef^^b9{\v s}
+ \gdef^^ba{\cedilla s}
+ \gdef^^bb{\v t}
+ \gdef^^bc{\'z}
+ \gdef^^bd{\H{}}
+ \gdef^^be{\v z}
+ \gdef^^bf{\dotaccent z}
+ %
+ \gdef^^c0{\'R}
+ \gdef^^c1{\'A}
+ \gdef^^c2{\^A}
+ \gdef^^c3{\u A}
+ \gdef^^c4{\"A}
+ \gdef^^c5{\'L}
+ \gdef^^c6{\'C}
+ \gdef^^c7{\cedilla C}
+ \gdef^^c8{\v C}
+ \gdef^^c9{\'E}
+ \gdef^^ca{\ogonek{E}}
+ \gdef^^cb{\"E}
+ \gdef^^cc{\v E}
+ \gdef^^cd{\'I}
+ \gdef^^ce{\^I}
+ \gdef^^cf{\v D}
+ %
+ \gdef^^d0{\DH}
+ \gdef^^d1{\'N}
+ \gdef^^d2{\v N}
+ \gdef^^d3{\'O}
+ \gdef^^d4{\^O}
+ \gdef^^d5{\H O}
+ \gdef^^d6{\"O}
+ \gdef^^d7{$\times$}
+ \gdef^^d8{\v R}
+ \gdef^^d9{\ringaccent U}
+ \gdef^^da{\'U}
+ \gdef^^db{\H U}
+ \gdef^^dc{\"U}
+ \gdef^^dd{\'Y}
+ \gdef^^de{\cedilla T}
+ \gdef^^df{\ss}
+ %
+ \gdef^^e0{\'r}
+ \gdef^^e1{\'a}
+ \gdef^^e2{\^a}
+ \gdef^^e3{\u a}
+ \gdef^^e4{\"a}
+ \gdef^^e5{\'l}
+ \gdef^^e6{\'c}
+ \gdef^^e7{\cedilla c}
+ \gdef^^e8{\v c}
+ \gdef^^e9{\'e}
+ \gdef^^ea{\ogonek{e}}
+ \gdef^^eb{\"e}
+ \gdef^^ec{\v e}
+ \gdef^^ed{\'{\dotless{i}}}
+ \gdef^^ee{\^{\dotless{i}}}
+ \gdef^^ef{\v d}
+ %
+ \gdef^^f0{\dh}
+ \gdef^^f1{\'n}
+ \gdef^^f2{\v n}
+ \gdef^^f3{\'o}
+ \gdef^^f4{\^o}
+ \gdef^^f5{\H o}
+ \gdef^^f6{\"o}
+ \gdef^^f7{$\div$}
+ \gdef^^f8{\v r}
+ \gdef^^f9{\ringaccent u}
+ \gdef^^fa{\'u}
+ \gdef^^fb{\H u}
+ \gdef^^fc{\"u}
+ \gdef^^fd{\'y}
+ \gdef^^fe{\cedilla t}
+ \gdef^^ff{\dotaccent{}}
+}
+
+% UTF-8 character definitions.
+%
+% This code to support UTF-8 is based on LaTeX's utf8.def, with some
+% changes for Texinfo conventions. It is included here under the GPL by
+% permission from Frank Mittelbach and the LaTeX team.
+%
+\newcount\countUTFx
+\newcount\countUTFy
+\newcount\countUTFz
+
+\gdef\UTFviiiTwoOctets#1#2{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\endcsname}
+%
+\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
+%
+\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
+
+\gdef\UTFviiiDefined#1{%
+ \ifx #1\relax
+ \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
+ \else
+ \expandafter #1%
+ \fi
+}
+
+\begingroup
+ \catcode`\~13
+ \catcode`\"12
+
+ \def\UTFviiiLoop{%
+ \global\catcode\countUTFx\active
+ \uccode`\~\countUTFx
+ \uppercase\expandafter{\UTFviiiTmp}%
+ \advance\countUTFx by 1
+ \ifnum\countUTFx < \countUTFy
+ \expandafter\UTFviiiLoop
+ \fi}
+
+ \countUTFx = "C2
+ \countUTFy = "E0
+ \def\UTFviiiTmp{%
+ \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
+ \UTFviiiLoop
+
+ \countUTFx = "E0
+ \countUTFy = "F0
+ \def\UTFviiiTmp{%
+ \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
+ \UTFviiiLoop
+
+ \countUTFx = "F0
+ \countUTFy = "F4
+ \def\UTFviiiTmp{%
+ \xdef~{\noexpand\UTFviiiFourOctets\string~}}
+ \UTFviiiLoop
+\endgroup
+
+\begingroup
+ \catcode`\"=12
+ \catcode`\<=12
+ \catcode`\.=12
+ \catcode`\,=12
+ \catcode`\;=12
+ \catcode`\!=12
+ \catcode`\~=13
+
+ \gdef\DeclareUnicodeCharacter#1#2{%
+ \countUTFz = "#1\relax
+ %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
+ \begingroup
+ \parseXMLCharref
+ \def\UTFviiiTwoOctets##1##2{%
+ \csname u8:##1\string ##2\endcsname}%
+ \def\UTFviiiThreeOctets##1##2##3{%
+ \csname u8:##1\string ##2\string ##3\endcsname}%
+ \def\UTFviiiFourOctets##1##2##3##4{%
+ \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter
+ \gdef\UTFviiiTmp{#2}%
+ \endgroup}
+
+ \gdef\parseXMLCharref{%
+ \ifnum\countUTFz < "A0\relax
+ \errhelp = \EMsimple
+ \errmessage{Cannot define Unicode char value < 00A0}%
+ \else\ifnum\countUTFz < "800\relax
+ \parseUTFviiiA,%
+ \parseUTFviiiB C\UTFviiiTwoOctets.,%
+ \else\ifnum\countUTFz < "10000\relax
+ \parseUTFviiiA;%
+ \parseUTFviiiA,%
+ \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
+ \else
+ \parseUTFviiiA;%
+ \parseUTFviiiA,%
+ \parseUTFviiiA!%
+ \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
+ \fi\fi\fi
+ }
+
+ \gdef\parseUTFviiiA#1{%
+ \countUTFx = \countUTFz
+ \divide\countUTFz by 64
+ \countUTFy = \countUTFz
+ \multiply\countUTFz by 64
+ \advance\countUTFx by -\countUTFz
+ \advance\countUTFx by 128
+ \uccode `#1\countUTFx
+ \countUTFz = \countUTFy}
+
+ \gdef\parseUTFviiiB#1#2#3#4{%
+ \advance\countUTFz by "#10\relax
+ \uccode `#3\countUTFz
+ \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
+\endgroup
+
+\def\utfeightchardefs{%
+ \DeclareUnicodeCharacter{00A0}{\tie}
+ \DeclareUnicodeCharacter{00A1}{\exclamdown}
+ \DeclareUnicodeCharacter{00A3}{\pounds}
+ \DeclareUnicodeCharacter{00A8}{\"{ }}
+ \DeclareUnicodeCharacter{00A9}{\copyright}
+ \DeclareUnicodeCharacter{00AA}{\ordf}
+ \DeclareUnicodeCharacter{00AB}{\guillemetleft}
+ \DeclareUnicodeCharacter{00AD}{\-}
+ \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
+ \DeclareUnicodeCharacter{00AF}{\={ }}
+
+ \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
+ \DeclareUnicodeCharacter{00B4}{\'{ }}
+ \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
+ \DeclareUnicodeCharacter{00BA}{\ordm}
+ \DeclareUnicodeCharacter{00BB}{\guillemetright}
+ \DeclareUnicodeCharacter{00BF}{\questiondown}
+
+ \DeclareUnicodeCharacter{00C0}{\`A}
+ \DeclareUnicodeCharacter{00C1}{\'A}
+ \DeclareUnicodeCharacter{00C2}{\^A}
+ \DeclareUnicodeCharacter{00C3}{\~A}
+ \DeclareUnicodeCharacter{00C4}{\"A}
+ \DeclareUnicodeCharacter{00C5}{\AA}
+ \DeclareUnicodeCharacter{00C6}{\AE}
+ \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
+ \DeclareUnicodeCharacter{00C8}{\`E}
+ \DeclareUnicodeCharacter{00C9}{\'E}
+ \DeclareUnicodeCharacter{00CA}{\^E}
+ \DeclareUnicodeCharacter{00CB}{\"E}
+ \DeclareUnicodeCharacter{00CC}{\`I}
+ \DeclareUnicodeCharacter{00CD}{\'I}
+ \DeclareUnicodeCharacter{00CE}{\^I}
+ \DeclareUnicodeCharacter{00CF}{\"I}
+
+ \DeclareUnicodeCharacter{00D0}{\DH}
+ \DeclareUnicodeCharacter{00D1}{\~N}
+ \DeclareUnicodeCharacter{00D2}{\`O}
+ \DeclareUnicodeCharacter{00D3}{\'O}
+ \DeclareUnicodeCharacter{00D4}{\^O}
+ \DeclareUnicodeCharacter{00D5}{\~O}
+ \DeclareUnicodeCharacter{00D6}{\"O}
+ \DeclareUnicodeCharacter{00D8}{\O}
+ \DeclareUnicodeCharacter{00D9}{\`U}
+ \DeclareUnicodeCharacter{00DA}{\'U}
+ \DeclareUnicodeCharacter{00DB}{\^U}
+ \DeclareUnicodeCharacter{00DC}{\"U}
+ \DeclareUnicodeCharacter{00DD}{\'Y}
+ \DeclareUnicodeCharacter{00DE}{\TH}
+ \DeclareUnicodeCharacter{00DF}{\ss}
+
+ \DeclareUnicodeCharacter{00E0}{\`a}
+ \DeclareUnicodeCharacter{00E1}{\'a}
+ \DeclareUnicodeCharacter{00E2}{\^a}
+ \DeclareUnicodeCharacter{00E3}{\~a}
+ \DeclareUnicodeCharacter{00E4}{\"a}
+ \DeclareUnicodeCharacter{00E5}{\aa}
+ \DeclareUnicodeCharacter{00E6}{\ae}
+ \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
+ \DeclareUnicodeCharacter{00E8}{\`e}
+ \DeclareUnicodeCharacter{00E9}{\'e}
+ \DeclareUnicodeCharacter{00EA}{\^e}
+ \DeclareUnicodeCharacter{00EB}{\"e}
+ \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
+ \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
+ \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
+ \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
+
+ \DeclareUnicodeCharacter{00F0}{\dh}
+ \DeclareUnicodeCharacter{00F1}{\~n}
+ \DeclareUnicodeCharacter{00F2}{\`o}
+ \DeclareUnicodeCharacter{00F3}{\'o}
+ \DeclareUnicodeCharacter{00F4}{\^o}
+ \DeclareUnicodeCharacter{00F5}{\~o}
+ \DeclareUnicodeCharacter{00F6}{\"o}
+ \DeclareUnicodeCharacter{00F8}{\o}
+ \DeclareUnicodeCharacter{00F9}{\`u}
+ \DeclareUnicodeCharacter{00FA}{\'u}
+ \DeclareUnicodeCharacter{00FB}{\^u}
+ \DeclareUnicodeCharacter{00FC}{\"u}
+ \DeclareUnicodeCharacter{00FD}{\'y}
+ \DeclareUnicodeCharacter{00FE}{\th}
+ \DeclareUnicodeCharacter{00FF}{\"y}
+
+ \DeclareUnicodeCharacter{0100}{\=A}
+ \DeclareUnicodeCharacter{0101}{\=a}
+ \DeclareUnicodeCharacter{0102}{\u{A}}
+ \DeclareUnicodeCharacter{0103}{\u{a}}
+ \DeclareUnicodeCharacter{0104}{\ogonek{A}}
+ \DeclareUnicodeCharacter{0105}{\ogonek{a}}
+ \DeclareUnicodeCharacter{0106}{\'C}
+ \DeclareUnicodeCharacter{0107}{\'c}
+ \DeclareUnicodeCharacter{0108}{\^C}
+ \DeclareUnicodeCharacter{0109}{\^c}
+ \DeclareUnicodeCharacter{0118}{\ogonek{E}}
+ \DeclareUnicodeCharacter{0119}{\ogonek{e}}
+ \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
+ \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
+ \DeclareUnicodeCharacter{010C}{\v{C}}
+ \DeclareUnicodeCharacter{010D}{\v{c}}
+ \DeclareUnicodeCharacter{010E}{\v{D}}
+
+ \DeclareUnicodeCharacter{0112}{\=E}
+ \DeclareUnicodeCharacter{0113}{\=e}
+ \DeclareUnicodeCharacter{0114}{\u{E}}
+ \DeclareUnicodeCharacter{0115}{\u{e}}
+ \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
+ \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
+ \DeclareUnicodeCharacter{011A}{\v{E}}
+ \DeclareUnicodeCharacter{011B}{\v{e}}
+ \DeclareUnicodeCharacter{011C}{\^G}
+ \DeclareUnicodeCharacter{011D}{\^g}
+ \DeclareUnicodeCharacter{011E}{\u{G}}
+ \DeclareUnicodeCharacter{011F}{\u{g}}
+
+ \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
+ \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
+ \DeclareUnicodeCharacter{0124}{\^H}
+ \DeclareUnicodeCharacter{0125}{\^h}
+ \DeclareUnicodeCharacter{0128}{\~I}
+ \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
+ \DeclareUnicodeCharacter{012A}{\=I}
+ \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
+ \DeclareUnicodeCharacter{012C}{\u{I}}
+ \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
+
+ \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
+ \DeclareUnicodeCharacter{0131}{\dotless{i}}
+ \DeclareUnicodeCharacter{0132}{IJ}
+ \DeclareUnicodeCharacter{0133}{ij}
+ \DeclareUnicodeCharacter{0134}{\^J}
+ \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
+ \DeclareUnicodeCharacter{0139}{\'L}
+ \DeclareUnicodeCharacter{013A}{\'l}
+
+ \DeclareUnicodeCharacter{0141}{\L}
+ \DeclareUnicodeCharacter{0142}{\l}
+ \DeclareUnicodeCharacter{0143}{\'N}
+ \DeclareUnicodeCharacter{0144}{\'n}
+ \DeclareUnicodeCharacter{0147}{\v{N}}
+ \DeclareUnicodeCharacter{0148}{\v{n}}
+ \DeclareUnicodeCharacter{014C}{\=O}
+ \DeclareUnicodeCharacter{014D}{\=o}
+ \DeclareUnicodeCharacter{014E}{\u{O}}
+ \DeclareUnicodeCharacter{014F}{\u{o}}
+
+ \DeclareUnicodeCharacter{0150}{\H{O}}
+ \DeclareUnicodeCharacter{0151}{\H{o}}
+ \DeclareUnicodeCharacter{0152}{\OE}
+ \DeclareUnicodeCharacter{0153}{\oe}
+ \DeclareUnicodeCharacter{0154}{\'R}
+ \DeclareUnicodeCharacter{0155}{\'r}
+ \DeclareUnicodeCharacter{0158}{\v{R}}
+ \DeclareUnicodeCharacter{0159}{\v{r}}
+ \DeclareUnicodeCharacter{015A}{\'S}
+ \DeclareUnicodeCharacter{015B}{\'s}
+ \DeclareUnicodeCharacter{015C}{\^S}
+ \DeclareUnicodeCharacter{015D}{\^s}
+ \DeclareUnicodeCharacter{015E}{\cedilla{S}}
+ \DeclareUnicodeCharacter{015F}{\cedilla{s}}
+
+ \DeclareUnicodeCharacter{0160}{\v{S}}
+ \DeclareUnicodeCharacter{0161}{\v{s}}
+ \DeclareUnicodeCharacter{0162}{\cedilla{t}}
+ \DeclareUnicodeCharacter{0163}{\cedilla{T}}
+ \DeclareUnicodeCharacter{0164}{\v{T}}
+
+ \DeclareUnicodeCharacter{0168}{\~U}
+ \DeclareUnicodeCharacter{0169}{\~u}
+ \DeclareUnicodeCharacter{016A}{\=U}
+ \DeclareUnicodeCharacter{016B}{\=u}
+ \DeclareUnicodeCharacter{016C}{\u{U}}
+ \DeclareUnicodeCharacter{016D}{\u{u}}
+ \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
+ \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
+
+ \DeclareUnicodeCharacter{0170}{\H{U}}
+ \DeclareUnicodeCharacter{0171}{\H{u}}
+ \DeclareUnicodeCharacter{0174}{\^W}
+ \DeclareUnicodeCharacter{0175}{\^w}
+ \DeclareUnicodeCharacter{0176}{\^Y}
+ \DeclareUnicodeCharacter{0177}{\^y}
+ \DeclareUnicodeCharacter{0178}{\"Y}
+ \DeclareUnicodeCharacter{0179}{\'Z}
+ \DeclareUnicodeCharacter{017A}{\'z}
+ \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
+ \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
+ \DeclareUnicodeCharacter{017D}{\v{Z}}
+ \DeclareUnicodeCharacter{017E}{\v{z}}
+
+ \DeclareUnicodeCharacter{01C4}{D\v{Z}}
+ \DeclareUnicodeCharacter{01C5}{D\v{z}}
+ \DeclareUnicodeCharacter{01C6}{d\v{z}}
+ \DeclareUnicodeCharacter{01C7}{LJ}
+ \DeclareUnicodeCharacter{01C8}{Lj}
+ \DeclareUnicodeCharacter{01C9}{lj}
+ \DeclareUnicodeCharacter{01CA}{NJ}
+ \DeclareUnicodeCharacter{01CB}{Nj}
+ \DeclareUnicodeCharacter{01CC}{nj}
+ \DeclareUnicodeCharacter{01CD}{\v{A}}
+ \DeclareUnicodeCharacter{01CE}{\v{a}}
+ \DeclareUnicodeCharacter{01CF}{\v{I}}
+
+ \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
+ \DeclareUnicodeCharacter{01D1}{\v{O}}
+ \DeclareUnicodeCharacter{01D2}{\v{o}}
+ \DeclareUnicodeCharacter{01D3}{\v{U}}
+ \DeclareUnicodeCharacter{01D4}{\v{u}}
+
+ \DeclareUnicodeCharacter{01E2}{\={\AE}}
+ \DeclareUnicodeCharacter{01E3}{\={\ae}}
+ \DeclareUnicodeCharacter{01E6}{\v{G}}
+ \DeclareUnicodeCharacter{01E7}{\v{g}}
+ \DeclareUnicodeCharacter{01E8}{\v{K}}
+ \DeclareUnicodeCharacter{01E9}{\v{k}}
+
+ \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
+ \DeclareUnicodeCharacter{01F1}{DZ}
+ \DeclareUnicodeCharacter{01F2}{Dz}
+ \DeclareUnicodeCharacter{01F3}{dz}
+ \DeclareUnicodeCharacter{01F4}{\'G}
+ \DeclareUnicodeCharacter{01F5}{\'g}
+ \DeclareUnicodeCharacter{01F8}{\`N}
+ \DeclareUnicodeCharacter{01F9}{\`n}
+ \DeclareUnicodeCharacter{01FC}{\'{\AE}}
+ \DeclareUnicodeCharacter{01FD}{\'{\ae}}
+ \DeclareUnicodeCharacter{01FE}{\'{\O}}
+ \DeclareUnicodeCharacter{01FF}{\'{\o}}
+
+ \DeclareUnicodeCharacter{021E}{\v{H}}
+ \DeclareUnicodeCharacter{021F}{\v{h}}
+
+ \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
+ \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
+ \DeclareUnicodeCharacter{0228}{\cedilla{E}}
+ \DeclareUnicodeCharacter{0229}{\cedilla{e}}
+ \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
+ \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
+
+ \DeclareUnicodeCharacter{0232}{\=Y}
+ \DeclareUnicodeCharacter{0233}{\=y}
+ \DeclareUnicodeCharacter{0237}{\dotless{j}}
+
+ \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
+
+ \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
+ \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
+ \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
+ \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
+ \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
+ \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
+ \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
+ \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
+ \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
+ \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
+ \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
+ \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
+
+ \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
+ \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
+
+ \DeclareUnicodeCharacter{1E20}{\=G}
+ \DeclareUnicodeCharacter{1E21}{\=g}
+ \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
+ \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
+ \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
+ \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
+ \DeclareUnicodeCharacter{1E26}{\"H}
+ \DeclareUnicodeCharacter{1E27}{\"h}
+
+ \DeclareUnicodeCharacter{1E30}{\'K}
+ \DeclareUnicodeCharacter{1E31}{\'k}
+ \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
+ \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
+ \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
+ \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
+ \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
+ \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
+ \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
+ \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
+ \DeclareUnicodeCharacter{1E3E}{\'M}
+ \DeclareUnicodeCharacter{1E3F}{\'m}
+
+ \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
+ \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
+ \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
+ \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
+ \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
+ \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
+ \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
+ \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
+ \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
+ \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
+
+ \DeclareUnicodeCharacter{1E54}{\'P}
+ \DeclareUnicodeCharacter{1E55}{\'p}
+ \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
+ \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
+ \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
+ \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
+ \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
+ \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
+ \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
+ \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
+
+ \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
+ \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
+ \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
+ \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
+ \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
+ \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
+ \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
+ \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
+ \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
+ \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
+
+ \DeclareUnicodeCharacter{1E7C}{\~V}
+ \DeclareUnicodeCharacter{1E7D}{\~v}
+ \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
+ \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
+
+ \DeclareUnicodeCharacter{1E80}{\`W}
+ \DeclareUnicodeCharacter{1E81}{\`w}
+ \DeclareUnicodeCharacter{1E82}{\'W}
+ \DeclareUnicodeCharacter{1E83}{\'w}
+ \DeclareUnicodeCharacter{1E84}{\"W}
+ \DeclareUnicodeCharacter{1E85}{\"w}
+ \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
+ \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
+ \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
+ \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
+ \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
+ \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
+ \DeclareUnicodeCharacter{1E8C}{\"X}
+ \DeclareUnicodeCharacter{1E8D}{\"x}
+ \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
+ \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
+
+ \DeclareUnicodeCharacter{1E90}{\^Z}
+ \DeclareUnicodeCharacter{1E91}{\^z}
+ \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
+ \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
+ \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
+ \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
+ \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
+ \DeclareUnicodeCharacter{1E97}{\"t}
+ \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
+ \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
+
+ \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
+ \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
+
+ \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
+ \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
+ \DeclareUnicodeCharacter{1EBC}{\~E}
+ \DeclareUnicodeCharacter{1EBD}{\~e}
+
+ \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
+ \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
+ \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
+ \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
+
+ \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
+ \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
+
+ \DeclareUnicodeCharacter{1EF2}{\`Y}
+ \DeclareUnicodeCharacter{1EF3}{\`y}
+ \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
+
+ \DeclareUnicodeCharacter{1EF8}{\~Y}
+ \DeclareUnicodeCharacter{1EF9}{\~y}
+
+ \DeclareUnicodeCharacter{2013}{--}
+ \DeclareUnicodeCharacter{2014}{---}
+ \DeclareUnicodeCharacter{2018}{\quoteleft}
+ \DeclareUnicodeCharacter{2019}{\quoteright}
+ \DeclareUnicodeCharacter{201A}{\quotesinglbase}
+ \DeclareUnicodeCharacter{201C}{\quotedblleft}
+ \DeclareUnicodeCharacter{201D}{\quotedblright}
+ \DeclareUnicodeCharacter{201E}{\quotedblbase}
+ \DeclareUnicodeCharacter{2022}{\bullet}
+ \DeclareUnicodeCharacter{2026}{\dots}
+ \DeclareUnicodeCharacter{2039}{\guilsinglleft}
+ \DeclareUnicodeCharacter{203A}{\guilsinglright}
+ \DeclareUnicodeCharacter{20AC}{\euro}
+
+ \DeclareUnicodeCharacter{2192}{\expansion}
+ \DeclareUnicodeCharacter{21D2}{\result}
+
+ \DeclareUnicodeCharacter{2212}{\minus}
+ \DeclareUnicodeCharacter{2217}{\point}
+ \DeclareUnicodeCharacter{2261}{\equiv}
+}% end of \utfeightchardefs
+
+
+% US-ASCII character definitions.
+\def\asciichardefs{% nothing need be done
+ \relax
+}
+
+% Make non-ASCII characters printable again for compatibility with
+% existing Texinfo documents that may use them, even without declaring a
+% document encoding.
+%
+\setnonasciicharscatcode \other
+
+
+\message{formatting,}
+
+\newdimen\defaultparindent \defaultparindent = 15pt
+
+\chapheadingskip = 15pt plus 4pt minus 2pt
+\secheadingskip = 12pt plus 3pt minus 2pt
+\subsecheadingskip = 9pt plus 2pt minus 2pt
+
+% Prevent underfull vbox error messages.
+\vbadness = 10000
+
+% Don't be very finicky about underfull hboxes, either.
+\hbadness = 6666
+
+% Following George Bush, get rid of widows and orphans.
+\widowpenalty=10000
+\clubpenalty=10000
+
+% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
+% using an old version of TeX, don't do anything. We want the amount of
+% stretch added to depend on the line length, hence the dependence on
+% \hsize. We call this whenever the paper size is set.
+%
+\def\setemergencystretch{%
+ \ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+ \else
+ \emergencystretch = .15\hsize
+ \fi
+}
+
+% Parameters in order: 1) textheight; 2) textwidth;
+% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
+% 7) physical page height; 8) physical page width.
+%
+% We also call \setleading{\textleading}, so the caller should define
+% \textleading. The caller should also set \parskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6#7#8{%
+ \voffset = #3\relax
+ \topskip = #6\relax
+ \splittopskip = \topskip
+ %
+ \vsize = #1\relax
+ \advance\vsize by \topskip
+ \outervsize = \vsize
+ \advance\outervsize by 2\topandbottommargin
+ \pageheight = \vsize
+ %
+ \hsize = #2\relax
+ \outerhsize = \hsize
+ \advance\outerhsize by 0.5in
+ \pagewidth = \hsize
+ %
+ \normaloffset = #4\relax
+ \bindingoffset = #5\relax
+ %
+ \ifpdf
+ \pdfpageheight #7\relax
+ \pdfpagewidth #8\relax
+ % if we don't reset these, they will remain at "1 true in" of
+ % whatever layout pdftex was dumped with.
+ \pdfhorigin = 1 true in
+ \pdfvorigin = 1 true in
+ \fi
+ %
+ \setleading{\textleading}
+ %
+ \parindent = \defaultparindent
+ \setemergencystretch
+}
+
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \textleading = 13.2pt
+ %
+ % If page is nothing but text, make it come out even.
+ \internalpagesizes{607.2pt}{6in}% that's 46 lines
+ {\voffset}{.25in}%
+ {\bindingoffset}{36pt}%
+ {11in}{8.5in}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.25 trim size.
+\def\smallbook{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \textleading = 12pt
+ %
+ \internalpagesizes{7.5in}{5in}%
+ {-.2in}{0in}%
+ {\bindingoffset}{16pt}%
+ {9.25in}{7in}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = .5cm
+}}
+
+% Use @smallerbook to reset parameters for 6x9 trim size.
+% (Just testing, parameters still in flux.)
+\def\smallerbook{{\globaldefs = 1
+ \parskip = 1.5pt plus 1pt
+ \textleading = 12pt
+ %
+ \internalpagesizes{7.4in}{4.8in}%
+ {-.2in}{-.4in}%
+ {0pt}{14pt}%
+ {9in}{6in}%
+ %
+ \lispnarrowing = 0.25in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = .4cm
+}}
+
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \textleading = 13.2pt
+ %
+ % Double-side printing via postscript on Laserjet 4050
+ % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
+ % To change the settings for a different printer or situation, adjust
+ % \normaloffset until the front-side and back-side texts align. Then
+ % do the same for \bindingoffset. You can set these for testing in
+ % your texinfo source file like this:
+ % @tex
+ % \global\normaloffset = -6mm
+ % \global\bindingoffset = 10mm
+ % @end tex
+ \internalpagesizes{673.2pt}{160mm}% that's 51 lines
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{44pt}%
+ {297mm}{210mm}%
+ %
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = 5mm
+}}
+
+% Use @afivepaper to print on European A5 paper.
+% From romildo@urano.iceb.ufop.br, 2 July 2000.
+% He also recommends making @example and @lisp be small.
+\def\afivepaper{{\globaldefs = 1
+ \parskip = 2pt plus 1pt minus 0.1pt
+ \textleading = 12.5pt
+ %
+ \internalpagesizes{160mm}{120mm}%
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{8pt}%
+ {210mm}{148mm}%
+ %
+ \lispnarrowing = 0.2in
+ \tolerance = 800
+ \hfuzz = 1.2pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = 2mm
+ \tableindent = 12mm
+}}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper.
+\def\afourlatex{{\globaldefs = 1
+ \afourpaper
+ \internalpagesizes{237mm}{150mm}%
+ {\voffset}{4.6mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ %
+ % Must explicitly reset to 0 because we call \afourpaper.
+ \globaldefs = 0
+}}
+
+% Use @afourwide to print on A4 paper in landscape format.
+\def\afourwide{{\globaldefs = 1
+ \afourpaper
+ \internalpagesizes{241mm}{165mm}%
+ {\voffset}{-2.95mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ \globaldefs = 0
+}}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+ \globaldefs = 1
+ %
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{\textleading}%
+ %
+ \dimen0 = #1\relax
+ \advance\dimen0 by \voffset
+ %
+ \dimen2 = \hsize
+ \advance\dimen2 by \normaloffset
+ %
+ \internalpagesizes{#1}{\hsize}%
+ {\voffset}{\normaloffset}%
+ {\bindingoffset}{44pt}%
+ {\dimen0}{\dimen2}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+
+\message{and turning on texinfo input format.}
+
+\def^^L{\par} % remove \outer, so ^L can appear in an @comment
+
+% DEL is a comment character, in case @c does not suffice.
+\catcode`\^^? = 14
+
+% Define macros to output various characters with catcode for normal text.
+\catcode`\"=\other \def\normaldoublequote{"}
+\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
+\catcode`\+=\other \def\normalplus{+}
+\catcode`\<=\other \def\normalless{<}
+\catcode`\>=\other \def\normalgreater{>}
+\catcode`\^=\other \def\normalcaret{^}
+\catcode`\_=\other \def\normalunderscore{_}
+\catcode`\|=\other \def\normalverticalbar{|}
+\catcode`\~=\other \def\normaltilde{~}
+
+% This macro is used to make a character print one way in \tt
+% (where it can probably be output as-is), and another way in other fonts,
+% where something hairier probably needs to be done.
+%
+% #1 is what to print if we are indeed using \tt; #2 is what to print
+% otherwise. Since all the Computer Modern typewriter fonts have zero
+% interword stretch (and shrink), and it is reasonable to expect all
+% typewriter fonts to have this, we can check that font parameter.
+%
+\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
+
+% Same as above, but check for italic font. Actually this also catches
+% non-italic slanted fonts since it is impossible to distinguish them from
+% italic fonts. But since this is only used by $ and it uses \sl anyway
+% this is not a problem.
+\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
+
+% Turn off all special characters except @
+% (and those which the user can use as if they were ordinary).
+% Most of these we simply print from the \tt font, but for some, we can
+% use math or other variants that look better in normal text.
+
+\catcode`\"=\active
+\def\activedoublequote{{\tt\char34}}
+\let"=\activedoublequote
+\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
+\chardef\hat=`\^
+\catcode`\^=\active \def\activehat{{\tt \hat}} \let^ = \activehat
+
+\catcode`\_=\active
+\def_{\ifusingtt\normalunderscore\_}
+\let\realunder=_
+% Subroutine for the previous macro.
+\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
+
+\catcode`\|=\active
+\def|{{\tt\char124}}
+
+\chardef \less=`\<
+\catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
+\chardef \gtr=`\>
+\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
+\catcode`\+=\active \def+{{\tt \char 43}}
+\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
+
+% used for headline/footline in the output routine, in case the page
+% breaks in the middle of an @tex block.
+\def\texinfochars{%
+ \let< = \activeless
+ \let> = \activegtr
+ \let~ = \activetilde
+ \let^ = \activehat
+ \markupsetuplqdefault \markupsetuprqdefault
+ \let\b = \strong
+ \let\i = \smartitalic
+ % in principle, all other definitions in \tex have to be undone too.
+}
+
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have \everyjob (or @setfilename) turn them on.
+% \otherifyactive is called near the end of this file.
+\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
+
+% Used sometimes to turn off (effectively) the active characters even after
+% parsing them.
+\def\turnoffactive{%
+ \normalturnoffactive
+ \otherbackslash
+}
+
+\catcode`\@=0
+
+% \backslashcurfont outputs one backslash character in current font,
+% as in \char`\\.
+\global\chardef\backslashcurfont=`\\
+\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
+
+% \realbackslash is an actual character `\' with catcode other, and
+% \doublebackslash is two of them (for the pdf outlines).
+{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
+
+% In texinfo, backslash is an active character; it prints the backslash
+% in fixed width font.
+\catcode`\\=\active % @ for escape char from now on.
+
+% The story here is that in math mode, the \char of \backslashcurfont
+% ends up printing the roman \ from the math symbol font (because \char
+% in math mode uses the \mathcode, and plain.tex sets
+% \mathcode`\\="026E). It seems better for @backslashchar{} to always
+% print a typewriter backslash, hence we use an explicit \mathchar,
+% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
+% ignored family value; char position "5C). We can't use " for the
+% usual hex value because it has already been made active.
+@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
+@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
+
+% On startup, @fixbackslash assigns:
+% @let \ = @normalbackslash
+% \rawbackslash defines an active \ to do \backslashcurfont.
+% \otherbackslash defines an active \ to be a literal `\' character with
+% catcode other. We switch back and forth between these.
+@gdef@rawbackslash{@let\=@backslashcurfont}
+@gdef@otherbackslash{@let\=@realbackslash}
+
+% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
+% the literal character `\'. Also revert - to its normal character, in
+% case the active - from code has slipped in.
+%
+{@catcode`- = @active
+ @gdef@normalturnoffactive{%
+ @let-=@normaldash
+ @let"=@normaldoublequote
+ @let$=@normaldollar %$ font-lock fix
+ @let+=@normalplus
+ @let<=@normalless
+ @let>=@normalgreater
+ @let\=@normalbackslash
+ @let^=@normalcaret
+ @let_=@normalunderscore
+ @let|=@normalverticalbar
+ @let~=@normaltilde
+ @markupsetuplqdefault
+ @markupsetuprqdefault
+ @unsepspaces
+ }
+}
+
+% Make _ and + \other characters, temporarily.
+% This is canceled by @fixbackslash.
+@otherifyactive
+
+% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
+% That is what \eatinput is for; after that, the `\' should revert to printing
+% a backslash.
+%
+@gdef@eatinput input texinfo{@fixbackslash}
+@global@let\ = @eatinput
+
+% On the other hand, perhaps the file did not have a `\input texinfo'. Then
+% the first `\' in the file would cause an error. This macro tries to fix
+% that, assuming it is called before the first `\' could plausibly occur.
+% Also turn back on active characters that might appear in the input
+% file name, in case not using a pre-dumped format.
+%
+@gdef@fixbackslash{%
+ @ifx\@eatinput @let\ = @normalbackslash @fi
+ @catcode`+=@active
+ @catcode`@_=@active
+}
+
+% Say @foo, not \foo, in error messages.
+@escapechar = `@@
+
+% These (along with & and #) are made active for url-breaking, so need
+% active definitions as the normal characters.
+@def@normaldot{.}
+@def@normalquest{?}
+@def@normalslash{/}
+
+% These look ok in all fonts, so just make them not special.
+% @hashchar{} gets its own user-level command, because of #line.
+@catcode`@& = @other @def@normalamp{&}
+@catcode`@# = @other @def@normalhash{#}
+@catcode`@% = @other @def@normalpercent{%}
+
+@let @hashchar = @normalhash
+
+@c Finally, make ` and ' active, so that txicodequoteundirected and
+@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
+@c don't make ` and ' active, @code will not get them as active chars.
+@c Do this last of all since we use ` in the previous @catcode assignments.
+@catcode`@'=@active
+@catcode`@`=@active
+@markupsetuplqdefault
+@markupsetuprqdefault
+
+@c Local variables:
+@c eval: (add-hook 'write-file-hooks 'time-stamp)
+@c page-delimiter: "^\\\\message"
+@c time-stamp-start: "def\\\\texinfoversion{"
+@c time-stamp-format: "%:y-%02m-%02d.%02H"
+@c time-stamp-end: "}"
+@c End:
+
+@c vim:sw=2:
+
+@ignore
+ arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
+@end ignore
diff --git a/elpa/org-9.5.2/etc/Makefile b/elpa/org-9.5.2/etc/Makefile
new file mode 100644
index 0000000..ab5c988
--- /dev/null
+++ b/elpa/org-9.5.2/etc/Makefile
@@ -0,0 +1,31 @@
+ETCDIRS = styles schema csl
+-include local.mk # optional local customization
+
+.NOTPARALLEL: # always run this make serially
+.SUFFIXES: # we don't need default suffix rules
+ifeq ($(MAKELEVEL), 0)
+ $(error This make needs to be started as a sub-make from the toplevel directory.)
+endif
+
+.PHONY: all install clean cleanall clean-install
+
+all:
+
+install: $(ETCDIRS)
+ for dir in $? ; do \
+ if [ ! -d $(DESTDIR)$(datadir)/$${dir} ] ; then \
+ $(MKDIR) $(DESTDIR)$(datadir)/$${dir} ; \
+ fi ; \
+ $(CP) $${dir}/* $(DESTDIR)$(datadir)/$${dir} ; \
+ done ;
+
+clean:
+
+cleanall:
+
+clean-install: $(ETCDIRS)
+ for dir in $? ; do \
+ if [ -d $(DESTDIR)$(datadir)/$${dir} ] ; then \
+ $(RMR) $(DESTDIR)$(datadir)/$${dir} ; \
+ fi ; \
+ done ;
diff --git a/elpa/org-9.5.2/etc/ORG-NEWS b/elpa/org-9.5.2/etc/ORG-NEWS
new file mode 100644
index 0000000..5e7813c
--- /dev/null
+++ b/elpa/org-9.5.2/etc/ORG-NEWS
@@ -0,0 +1,6327 @@
+ORG NEWS -- history of user-visible changes. -*- mode: org; coding: utf-8 -*-
+
+#+STARTUP: overview
+
+#+LINK: doc https://orgmode.org/worg/doc.html#%s
+#+LINK: msg https://list.orgmode.org/%s/
+#+LINK: git https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=%s
+
+Copyright (C) 2012-2021 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.5
+
+** Important announcements and breaking changes
+
+*** The =contrib/= now lives in a separate repository
+
+Org's repository has been trimmed from the =contrib/= directory.
+
+The old contents of the =contrib/= directory now lives in a separate
+repository at https://git.sr.ht/~bzg/org-contrib.
+
+You can install this repository by cloning it and updating your
+~load-path~ accordingly. You can also install =org-contrib= as a
+[[https://elpa.nongnu.org/nongnu/][NonGNU ELPA]] package.
+
+*** Org ELPA and Org archives won't be available for Org > 9.5
+
+[[https://orgmode.org/elpa.html][Org ELPA]] is still available for installing Org 9.5, either with or
+without contributed packages, but future versions won't be available
+via Org ELPA, as we are deprecating this installation method.
+
+Also, Org 9.5 is available as =tar.gz= and =zip= archives, but this
+installation method is also deprecated.
+
+If you want to install the latest stable versions of Org, please use
+the GNU ELPA package. If you want to install the contributed files,
+please use the NonGNU ELPA package. If you want to keep up with the
+latest unstable Org, please install from the Git repository.
+
+See https://orgmode.org/org.html#Installation for the details.
+
+*** =ditaa.jar= is not bundled with Org anymore
+
+=ditaa.jar= used to be bundled with Org but it is not anymore.
+See [[https://github.com/stathissideris/ditaa][the ditaa repository]] on how to install it.
+
+*** ~org-adapt-indentation~ now defaults to =nil=
+
+If you want to automatically indent headlines' metadata, set it to
+=headline-data=.
+
+If you want to automatically indent every line to the headline's
+current indentation, set it to =t=.
+
+Indent added by =RET= and =C-j= also depends on the value of
+~electric-indent-mode~. Enabling this mode by default in 9.4 revealed
+some bugs caused confusing behavior. If you disabled
+~electric-indent-mode~ for this reason, it is time to try it again.
+Hopefully problems have been fixed. See [[https://orgmode.org/worg/org-faq.html#indentation][this FAQ]] for more details.
+
+*** ~org-speed-commands-user~ is obsolete, use ~org-speed-commands~
+
+Setting ~org-speed-commands-user~ in your configuration won't have any
+effect. Please set ~org-speed-commands~ instead, which see.
+
+*** Some =ob-*.el= files have been moved to the org-contrib repo
+
+These files have been moved to https://git.sr.ht/~bzg/org-contrib:
+
+- ob-abc.el
+- ob-asymptote.el
+- ob-coq.el
+- ob-ebnf.el
+- ob-hledger.el
+- ob-io.el
+- ob-J.el
+- ob-ledger.el
+- ob-mscgen.el
+- ob-picolisp.el
+- ob-shen.el
+- ob-stan.el
+- ob-vala.el
+
+See the discussion [[msg::87bl9rq29m.fsf@gnu.org][here]].
+
+*** Compatibility with Emacs versions
+
+We made it explicit that we aim at keeping the latest stable version
+of Org compatible with at least Emacs V, V-1 and V-2, where V is the
+stable major version of Emacs.
+
+For example, if the current major version of Emacs is 28.x, then the
+latest stable version of Org should be compatible with Emacs 28.x,
+27.x and 26.x – but not with Emacs 25.x.
+
+See [[https://orgmode.org/worg/org-maintenance.html#emacs-compatibility][this note on Worg]] and [[git::519947e508e081e71bf67db99e27b1c171ba4dfe][this commit]].
+
+*** The keybinding for ~org-table-blank-field~ has been removed
+
+If you prefer to keep the keybinding, you can add it back to
+~org-mode-map~ like so:
+
+#+begin_src emacs-lisp
+(define-key org-mode-map (kbd "C-c SPC") #'org-table-blank-field)
+#+end_src
+
+** New features
+
+*** New citation engine
+
+Org 9.5 provides a new library =oc.el= which provides tooling to
+handle citations in Org, e.g., activate, follow, insert, and export
+them, respectively called "activate", "follow", "insert" and "export"
+capabilities. Libraries responsible for providing some, or all, of
+these capabilities are called "citation processors".
+
+The manual contains a few pointers to let you start and you may want
+to check [[https://blog.tecosaur.com/tmio/2021-07-31-citations.html][this blog post]]. If you need help using this new features,
+please ask on the mailing list.
+
+Thanks to Nicolas Goaziou for implementing this, to Bruce D’Arcus for
+helping him and to John Kitchin for paving the way with =org-ref.el=.
+
+*** Async session evaluation
+
+The =:async= header argument can be used for asynchronous evaluation
+in session blocks for certain languages.
+
+Currently, async evaluation is supported in Python. There is also
+functionality to implement async evaluation in other languages that
+use comint, but this needs to be done on a per-language basis.
+
+By default, async evaluation is disabled unless the =:async= header
+argument is present. You can also set =:async no= to force it off
+(for example if you've set =:async= in a property drawer).
+
+Async evaluation is disabled during export.
+*** ~ox-koma-letter.el~ is now part of Org's core
+
+~ox-koma-letter.el~ provides a KOMA scrlttr2 back-end for the Org
+export engine. It used to be in the =contrib/= directory but it is
+now part of Org's core.
+
+*** Support exporting DOI links
+
+Org now supports export for DOI links, through its new =ol-doi.el=
+library. For backward compatibility, it is loaded by default.
+
+*** Add a new ~:refile-targets~ template option
+
+When exiting capture mode via ~org-capture-refile~, the variable
+~org-refile-targets~ will be temporarily bound to the value of this
+template option.
+
+*** New startup options =#+startup: show<n>levels=
+
+These startup options complement the existing =overview=, =content=,
+=showall=, =showeverything= with a way to start the document with n
+levels shown, where n goes from 2 to 5.
+
+Example:
+
+: #+startup: show3levels
+
+*** New =u= table formula flag to enable Calc units simplification mode
+
+A new =u= mode flag for Calc formulas in Org tables has been added to
+enable Calc units simplification mode.
+
+*** Support fontification of inline export snippets
+
+See [[msg:87im57fh8j.fsf@gmail.com][this thread]].
+
+*** New command =org-refile-reverse= bound to =C-c C-M-w=
+
+You can now use =C-c C-M-w= to run ~org-refile-reverse~.
+
+It is almost identical to ~org-refile~, except that it temporarily
+toggles how ~org-reverse-note-order~ applies to the current buffer.
+So if ~org-refile~ would append the entry as the last entry under the
+target heading, ~org-refile-reverse~ will prepend it as the first
+entry, and vice-versa.
+
+*** LaTeX attribute ~:float~ now passes through arbitrary values
+
+LaTeX users are able to define arbitrary float types, e.g. with the
+float package. The Org mode LaTeX exporter is now able to process and
+export arbitrary float types. The user is responsible for ensuring
+that Org mode configures LaTeX to process any new float type.
+
+*** Support verse and quote blocks in LaTeX export
+
+The LaTeX export back-end accepts four attributes for verse blocks:
+=:lines=, =:center=, =:versewidth= and =:latexcode=. The three first
+require the external LaTeX package =verse.sty=, which is an extension
+of the standard LaTeX environment.
+
+The LaTeX export back-end accepts two attributes for quote blocks:
+=:environment=, for an arbitrary quoting environment (the default
+value is that of =org-latex-default-quote-environment=: ="quote"=) and
+=:options=.
+
+*** =org-set-tags-command= selects tags from ~org-global-tags-completion-table~
+
+Let ~org-set-tags-command~ TAB fast tag completion interface complete
+tags including from both buffer local and user defined persistent
+global list (~org-tag-alist~ and ~org-tag-persistent-alist~). Now
+option ~org-complete-tags-always-offer-all-agenda-tags~ is honored.
+
+*** Clocktable option =:formula %= now shows the per-file time percentages
+
+This change only has an effect when multiple files are contributing to
+a given clocktable (such as when =:scope agenda= has been specified).
+The existing behavior is that such tables have an extra 'File' column,
+and each individual file that contributes has its own summary line
+with the headline value '*File time*'. Those summary rows also
+produce a rollup time value for the file in the 'Time' column.
+
+Prior to this change, the built-in =%= formula did not produce a
+calculation for those per-file times in the '%' column (the relevant
+cells in the '%' column were blank). With this change, the percentage
+contribution of each individual file time to the total time is shown.
+
+The more agenda files you have, the more useful this behavior becomes.
+
+*** =ob-python.el= improvements to =:return= header argument
+
+The =:return= header argument in =ob-python= now works for session
+blocks as well as non-session blocks. Also, it now works with the
+=:epilogue= header argument -- previously, setting the =:return=
+header would cause the =:epilogue= to be ignored.
+
+This change allows more easily moving boilerplate out of the main code
+block and into the header. For example, for plotting, we need to add
+boilerplate to save the figure to a file and return the
+filename. Instead of doing this within the code block, we can now
+handle it through the header arguments as follows:
+
+#+BEGIN_SRC org
+,#+header: :var fname="/home/jack/tmp/plot.svg"
+,#+header: :epilogue plt.savefig(fname)
+,#+header: :return fname
+,#+begin_src python :results value file
+ import matplotlib, numpy
+ import matplotlib.pyplot as plt
+ fig=plt.figure(figsize=(4,2))
+ x=numpy.linspace(-15,15)
+ plt.plot(numpy.sin(x)/x)
+ fig.tight_layout()
+,#+end_src
+
+,#+RESULTS:
+[[file:/home/jack/tmp/plot.svg]]
+#+END_SRC
+
+As another example, we can use =:return= with the external [[https://pypi.org/project/tabulate/][tabulate]]
+package, to convert pandas Dataframes into orgmode tables:
+
+#+begin_src org
+,#+header: :prologue from tabulate import tabulate
+,#+header: :return tabulate(table, headers=table.columns, tablefmt="orgtbl")
+,#+begin_src python :results value raw :session
+ import pandas as pd
+ table = pd.DataFrame({
+ "a": [1,2,3],
+ "b": [4,5,6]
+ })
+,#+end_src
+
+,#+RESULTS:
+| | a | b |
+|---+---+---|
+| 0 | 1 | 4 |
+| 1 | 2 | 5 |
+| 2 | 3 | 6 |
+#+end_src
+
+*** Display images with width proportional to the buffer text width
+
+Previously, if you used a =:width= attribute like =#+attr_html: :width 70%= or
+=#+attr_latex: :width 0.7\linewidth= this would be interpreted as a 70px wide and
+0.7px wide width specification respectively.
+
+Now, percentages are transformed into floats (i.e. 70% becomes 0.7),
+and float width specifications between 0.0 and 2.0 are now interpreted
+as that portion of the text width in the buffer. For instance, the
+above examples of =70%= and =0.7\linewidth= will result in an image
+with width equal to the pixel-width of the buffer text multiplied by 0.7.
+
+This functionality is implemented in a new function,
+~org-display-inline-image--width~ which contains the width
+determination logic previously in ~org-display-inline-images~ and the
+new behaviour.
+
+** New options
+*** Option ~org-hidden-keywords~ now also applies to #+SUBTITLE:
+
+The option ~org-hidden-keywords~ previously applied
+to #+TITLE:, #+AUTHOR:, #+DATE:, and #+EMAIL:. Now it can also be
+used to hide the #+SUBTITLE: keyword.
+
+*** New formatting directive ~%L~ for org-capture
+
+The new ~%L~ formatting directive contains the bare link target, and
+may be used to create links with programmatically generated
+descriptions.
+
+*** New option ~org-id-ts-format~
+
+Earlier, IDs generated using =ts= method had a hard-coded format (i.e. =20200923T160237.891616=).
+The new option allows user to customise the format.
+Defaults are unchanged.
+
+*** New argument for ~file-desc~ babel header
+
+It is now possible to provide the =file-desc= header argument for a
+babel source block but omit the description by passing an empty vector
+as an argument (i.e., :file-desc []). This can be useful because
+providing =file-desc= without an argument results in the result of
+=file= being used in the description. Previously, the only way to
+omit a file description was to omit the header argument entirely,
+which made it difficult/impossible to provide a default value for
+=file-desc=.
+
+*** New option to set ~org-link-file-path-type~ to a function
+
+~org-link-file-path-type~ can now be set to a function that takes the
+full filename as an argument and returns the path to link to.
+
+For example, if you use ~project.el~, you can set this function to use
+relative links within a project as follows:
+
+#+begin_src emacs-lisp
+(setq (org-link-file-path-type
+ (lambda (path)
+ (let* ((proj (project-current))
+ (root (if proj (project-root proj) default-directory)))
+ (if (string-prefix-p (expand-file-name root) path)
+ (file-relative-name path)
+ (abbreviate-file-name path))))))
+#+end_src
+
+*** New options and new behavior for babel LaTeX SVG image files
+
+Org babel now uses a two-stage process for converting latex source
+blocks to SVG image files (when the extension of the output file is
+~.svg~). The first stage in the process converts the latex block into
+a PDF file, which is then converted into an SVG file in the second
+stage. The TeX->PDF part uses the existing infrastructure for
+~org-babel-latex-tex-to-pdf~. The PDF->SVG part uses a command
+specified in a new customization,
+~org-babel-latex-pdf-svg-process~. By default, this uses inkscape for
+conversion, but since it is fully customizable, any other command can
+be used in its place. For instance, dvisvgm might be used here. This
+two-part processing replaces the previous use of htlatex to process
+LaTeX directly to SVG (htlatex is still used for HTML conversion).
+
+Conversion to SVG exposes a number of additional customizations that
+give the user full control over the contents of the latex source
+block. ~org-babel-latex-preamble~, ~org-babel-latex-begin-env~ and
+~org-babel-latex-end-env~ are new customization options added to allow
+the user to specify the preamble and code that preceedes and proceeds
+the contents of the source block.
+
+*** New option ~org-html-meta-tags~ allows for HTML meta tags customization
+
+New variable ~org-html-meta-tags~ makes it possible to customize the
+=<meta>= tags used in an HTML export. Accepts either a static list of
+values, or a function that generates such a list (see
+~org-html-meta-tags-default~ as an example of the latter).
+
+*** Option ~org-agenda-bulk-custom-functions~ now supports collecting bulk arguments
+
+When specifying a custom agenda bulk option, you can now also specify
+a function which collects the arguments to be used with each call to
+the custom function.
+
+*** New faces to improve the contextuality of Org agenda views
+
+Four new faces improve certain styles and offer more flexibility for
+some Org agenda views: ~org-agenda-date-weekend-today~,
+~org-imminent-deadline~, ~org-agenda-structure-secondary~,
+~org-agenda-structure-filter~. They inherit from existing faces in
+order to remain backward-compatible.
+
+Quoting from [[https://list.orgmode.org/87lf7q7gpq.fsf@protesilaos.com/][this thread]]:
+
+#+begin_quote
++ The 'org-imminent-deadline' is useful to disambiguate generic
+ warnings from deadlines. For example, a warning could be rendered
+ in a yellow colored text and have a bold weight, whereas a deadline
+ might be red and styled with italics.
+
++ The 'org-agenda-structure-filter' applies to all tag/term filters
+ in agenda views that search for keywords or patterns. It is
+ designed to inherit from 'org-agenda-structure' in addition to the
+ 'org-warning' face that was present before (and removes the
+ generic 'warning' face from one place). This offers the benefit
+ of consistency, as, say, an increase in font height or a change in
+ font family in 'org-agenda-structure' will propagate to the filter
+ as well. The whole header line thus looks part of a singular
+ design.
+
++ The 'org-agenda-structure-secondary' complements the above for those
+ same views where a description follows the header. For instance, the
+ tags view provides information to "Press N r" to filter by a
+ numbered tag. Themes/users may prefer to disambiguate this line
+ from the header above it, such as by using a less intense color or by
+ reducing its height relative to the 'org-agenda-structure'.
+
++ The 'org-agenda-date-weekend-today' provides the option to
+ differentiate the current date on a weekend from the current date on
+ weekdays.
+#+end_quote
+
+*** New option ~org-clock-ask-before-exiting~
+
+By default, a function is now added to ~kill-emacs-query-functions~
+that asks whether to clock out and save when there's a running clock.
+Customize ~org-clock-ask-before-exiting~~ to nil to disable this new
+behavior.
+
+*** Option ~org-html-inline-image-rules~ now includes .webp
+
+By default ox-html now inlines webp images.
+
+*** ~org-html-head-include-scripts~ is now =nil= by default
+
+See [[msg:498dbe2e-0cd2-c81e-7960-4a26c566a1f7@memebeam.org][this thread]].
+
+*** New option ~org-html-content-class~
+
+This is the CSS class name to use for the top level content wrapper.
+
+*** New option ~org-babel-plantuml-svg-text-to-path~
+
+This option, nil by default, allows to add a SVG-specific post-export
+step that runs inkscape text-to-path replacement over the output file.
+
+*** You can now configure ~org-html-scripts~ and ~org-html-style-default~
+
+~org-html-scripts~ and ~org-html-style-default~ used to be constants,
+you can now configure them.
+
+*** New option ~org-attach-git-dir~
+
+~org-attach-git-dir~ will decide whether to use ~org-attach-git-dir~
+(the default) or use the attachment directory of the current node, if
+it is correctly configured as a Git repository.
+
+*** Some faces now use fixed-pitch
+
+See [[msg:875z8njaol.fsf@protesilaos.com][this thread]].
+
+*** New option ~org-attach-sync-delete-empty-dir~
+
+~org-attach-sync-delete-empty-dir~ controls the deletion of an empty
+attachment directory at calls of ~org-attach-sync~. There is
+Never delete, Always delete and Query the user (default).
+
+*** ~org-babel-default-header-args~ can now be specified as closures or strings
+
+~org-babel-default-header-args~ now also accepts closures that
+evaluate to a string. Previously, only direct strings were
+supported. These closures are evaluated when point is at the source
+block, which allows them to make use of contextual information at the
+relevant source block. One example that illustrates the usefulness of
+this addition (also given in the documentation for
+~org-babel-default-header-args~) is:
+
+#+begin_src elisp
+(defun org-src-sha ()
+ (let ((elem (org-element-at-point)))
+ (concat (sha1 (org-element-property :value elem)) \".svg\")))
+
+(setq org-babel-default-header-args:latex
+ `((:results . \"file link replace\")
+ (:file . (lambda () (org-src-sha)))))
+#+end_src
+
+This will set the ~:file~ header argument to the sha1 checksum of the
+contents of the current latex source block.
+
+Finally, the closures are only evaluated if they're not overridden for
+a source block. This improves efficiency in cases where the result of
+a compute-expensive closure would otherwise be discarded.
+
+** Miscellaneous
+*** =org-bibtex= includes =doi= and =url= entries when exporting to BiBTeX
+=doi= and =url= entries have been made optional for some publication
+types and will be exported if present for those types.
+*** Missing or empty placeholders in "eval" macros are now =nil=
+They used to be the empty string.
+*** =org-goto-first-child= now works before first heading
+
+When point is before first heading =org-goto-first-child= will move
+point to the first child heading, or return nil if no heading exist
+in buffer. This is in line with the fact that everything before first
+heading is regarded as outline level 0, i.e. the parent level of all
+headings in the buffer.
+
+Previously =org-goto-first-child= would do nothing before first
+heading, except return nil.
+
+*** Faces of all the heading text elements now conform to the headline face
+
+In the past, faces of todo keywords, emphasised text, tags, and
+priority cookies inherited =default= face. The resulting headline
+fontification was not always consistent, as discussed in [[https://lists.gnu.org/archive/html/emacs-orgmode/2020-09/msg00331.html][this bug
+report]]. Now, the relevant faces adapt to face used to fontify the
+current headline level.
+
+Users who prefer to keep the old behaviour should change their face
+customisation explicitly stating that =default= face is inherited.
+
+Example of old face customisation:
+
+#+begin_src emacs-lisp
+(setq org-todo-keyword-faces '(("TODO"
+ :background "chocolate"
+ :height 0.75)))
+#+end_src
+
+To preserve the old behaviour the above customisation should be
+changed to
+
+#+begin_src emacs-lisp
+(setq org-todo-keyword-faces '(("TODO"
+ :inherit default
+ :background "chocolate"
+ :height 0.75)))
+#+end_src
+
+*** Storing ID-links before first heading uses title as description
+
+Storing links to files using ~org-store-link~ (=<C-c l>=) when
+~org-id-link-to-org-use-id~ is not nil will now store the title as
+description of the link, if available. If no title exists it falls
+back to the filename as before.
+
+*** Change in =org-tags-expand= signature
+
+The function does not allow for a third optional parameter anymore.
+*** LaTeX environment =#+results= are now removed
+
+If a babel src block produces a raw LaTeX environment, it will now be
+recognised as a result, and so replaced when re-evaluated.
+
+*** Tag completion now uses =completing-read-multiple=
+
+Tag completion now uses =completing-read-multiple= with a simple
+completion table, which should allow better interoperability with
+custom completion functions.
+
+*** Providing =directory-empty-p= from Emacs 28 as =org-directory-empty-p=
+
+*** =org-get-last-sibling= marked as obsolete
+
+Use =org-get-previous-sibling= instead. This is just a rename to have
+a more consistent naming. E.g. recall the pair of funtctions
+=next-line= / =previous-line=.
+
+*** Make org-protocol compatible with =URLSearchParams= JavaScript class
+
+Decoder of query part of org-protocol URI recognizes "+" as an encoded
+space characters now, so it is possible to avoid call to =encodeURIComponent=
+for each parameter and use more readable expression in bookmarklet:
+
+#+begin_example
+'org-protocol://store-link?' + new URLSearchParams({
+ url: location.href, title: document.title})
+#+end_example
+
+*** Remove obsolete LaTeX packages from ~org-latex-default-packages-alist~
+
+The LaTeX packages =grffile= and =textcomp= are redundant, with their
+capabilities being merged into =graphicx= and the LaTeX core
+respectively a while ago.
+
+* Version 9.4
+** Incompatible changes
+*** Possibly broken internal file links: please check and fix
+
+A bug has been affecting internal links to headlines, like
+
+: [[*Headline][A link to a headline]]
+
+Storing a link to a headline may have been broken in your setup and
+those links may appear as
+
+: [[*TODO Headline][A link to a headline]]
+
+Following the link above will result in an error: the TODO keyword
+should not be part of internal file links.
+
+You can use the following command to fix links in an Org buffer:
+
+#+begin_src emacs-lisp
+(defun org-fix-links ()
+ "Fix ill-formatted internal links.
+E.g. replace [[*TODO Headline][headline]] by [[*Headline][headline]].
+Go through the buffer and ask for the replacement."
+ (interactive)
+ (visible-mode 1)
+ (save-excursion
+ (goto-char (point-min))
+ (let ((regexp (format "\\[\\[\\*%s\\s-+"
+ (regexp-opt org-todo-keywords-1 t))))
+ (while (re-search-forward regexp nil t)
+ (when (and (save-excursion
+ (goto-char (match-beginning 0))
+ (looking-at-p org-link-bracket-re))
+ (y-or-n-p "Fix link (remove TODO keyword)? "))
+ (replace-match "[[*")))))
+ (visible-mode -1))
+#+end_src
+
+*** Calling conventions changes when opening or exporting custom links
+
+This changes affects export back-ends, and libraries providing new
+link types.
+
+Function used in ~:follow~ link parameter is required to accept a
+second argument. Likewise, function used in ~:export~ parameter needs
+to accept a fourth argument. See ~org-link-set-parameters~ for
+details.
+
+Eventually, the function ~org-export-custom-protocol-maybe~ is now
+called with a fourth argument. Even though the 3-arguments definition
+is still supported, at least for now, we encourage back-end developers
+to switch to the new signature.
+
+*** Python session return values must be top-level expression statements
+
+Python blocks with ~:session :results value~ header arguments now only
+return a value if the last line is a top-level expression statement.
+Also, when a None value is returned, "None" will be printed under
+"#+RESULTS:", as it already did with ~:results value~ for non-session
+blocks.
+
+*** In HTML export, change on how outline-container-* is set
+
+When the headline has a =CUSTOM_ID=, use this custom id to build the
+div id. For example, if you have =:CUSTOM_ID: my-headline= then the
+resulting <div> will be ~<div id="outline-container-my-headline">~.
+
+You may want to check whether your HTML files are rendered differently
+after this change.
+
+*** New keybinding =<C-c C-TAB>= for ~org-force-cycle-archived~
+
+~org-force-cycle-archived~ used to be associated with =<C-TAB>= but
+this keybinding is used in Emacs for navigating tabs in Emacs. The
+new keybinding is =<C-c C-TAB>=.
+
+** New default settings for some options
+
+These options now default to =t=:
+
+- ~org-loop-over-headlines-in-active-region~
+- ~org-fontify-done-headline~
+- ~org-src-tab-acts-natively~
+
+You may want to read the docstrings of these options to understand the
+consequences of this change.
+
+Also, ~org-startup-folded~ now defaults to ~showeverything~.
+
+** New features
+
+*** =RET= and =C-j= now obey ~electric-indent-mode~
+
+Since Emacs 24.4, ~electric-indent-mode~ is enabled by default. In
+most major modes, this causes =RET= to reindent the current line and
+indent the new line, and =C-j= to insert a newline without indenting.
+
+Org mode now obeys this minor mode: when ~electric-indent-mode~ is
+enabled, and point is neither in a table nor on a timestamp or a link:
+
+- =RET= (bound to ~org-return~) reindents the current line and indents
+ the new line;
+- =C-j= (bound to the new command ~org-return-and-maybe-indent~)
+ merely inserts a newline.
+
+To get the previous behaviour back, disable ~electric-indent-mode~
+explicitly:
+
+#+begin_src emacs-lisp
+(add-hook 'org-mode-hook (lambda () (electric-indent-local-mode -1)))
+#+end_src
+
+Alternatively, if you wish to keep =RET= as the "smart-return" key,
+but dislike Org's default indentation of sections, you may prefer to
+customize ~org-adapt-indentation~ to either nil or =headline-data=.
+
+*** New allowed value for ~org-adapt-indentation~
+
+~org-adapt-indentation~ now accepts a new value, =headline-data=.
+
+When set to this value, Org will only adapt indentation of headline
+data lines, such as planning/clock lines and property/logbook drawers.
+Also, with this setting, =org-indent-mode= will keep these data lines
+correctly aligned with the headline above.
+
+*** Looping agenda commands over headlines
+
+~org-agenda-loop-over-headlines-in-active-region~ allows you to loop
+agenda commands over the active region.
+
+When set to =t= (the default), loop over all headlines. When set to
+='start-level=, loop over headlines with the same level as the first
+headline in the region. When set to a string, loop over lines
+matching this regular expression.
+
+*** New minor mode ~org-table-header-line-mode~
+
+Turn on the display of the first data row of the table at point in the
+window header line when this first row is not visible anymore in the
+buffer.
+
+You can activate this minor mode by default by setting the option
+~org-table-header-line-p~ to =t=. You can also change the face for
+the header line by customizing the ~org-table-header~ face.
+
+*** New minor mode ~org-list-checkbox-radio-mode~
+
+When this minor mode is on, checkboxes behave as radio buttons: if a
+checkbox is turned on, other checkboxes at the same level are turned
+off.
+
+If you want to occasionally toggle a checkbox as a radio button
+without turning this minor mode on, you can use =<C-c C-x C-r>= to
+call ~org-toggle-radio-button~.
+
+You can also add =#+ATTR_ORG: :radio t= right before the list to tell
+Org to use radio buttons for this list only.
+
+*** Numeric priorities are now allowed (up to 65)
+
+You can now set ~org-priority-highest/lowest/default~ to integers to
+use numeric priorities globally or set, for example
+
+#+PRIORITIES: 1 10 5
+
+to define a buffer-local range and default for priorities. Priority
+commands should work as usual. You cannot use numbers superior to 64
+for numeric priorities, as it would clash with priorities like [#A]
+where the "A" is internally converted to its numeric value of 65.
+
+*** Property drawers allowed before first headline
+
+Property drawers are now allowed before the first headline.
+
+Org mode is moving more towards making things before the first
+headline behave just as if it was at outline level 0. Inheritance for
+properties will work also for this level. In other words: defining
+things in a property drawer before the first headline will make them
+"inheritable" for all headlines.
+
+*** Refinement in window behavior on exiting Org source buffer
+
+After editing a source block, Org will restore the window layout when
+~org-src-window-setup~ is set to a value that modifies the layout.
+
+*** Display remote inline images
+
+Org now knows how to display remote images inline.
+
+Whether the images are actually displayed is controlled by the new
+option ~org-display-remote-inline-images~.
+
+*** New option to resolve open clock at a provided time
+
+~org-resolve-clocks~ now has a `t' option, which works just like the
+`k' option, but the user specifies a time of day, not a number of
+minutes.
+
+*** New step value =semimonth= accepted for clock tables
+
+*** Allow text rescaling in column view
+
+You can now use =C-x C-+= in column view: the columns face size will
+increase or decrease, together with the column header size.
+
+*** New startup option =#+startup: num=
+
+When this startup option is set, display headings as numerated.
+
+Use =#+startup: nonum= to turn this off.
+
+*** New tool for custom links
+
+Org provides a new tool ~org-link-open-as-file~, useful when defining
+new link types similar to "file"-type links. See docstring for
+details.
+
+*** New optional numeric argument for ~org-return~
+
+In situations where ~org-return~ calls ~newline~, multiple newlines
+can now be inserted with this prefix argument.
+
+*** New source code block header argument =:file-mode=
+
+Source code block header argument =:file-mode= can set file
+permissions if =:file= argument is provided.
+
+*** =ob-C.el= allows the inclusion of non-system header files
+
+In C and C++ blocks, ~:includes~ arguments that do not start with a
+~<~ character will now be formatted as double-quoted ~#include~
+statements.
+
+*** =ob-clojure.el= supports inf-clojure.el and ClojureScript evaluation
+
+You can now set ~(setq org-babel-clojure-backend 'inf-clojure)~ and
+evaluate Clojure source blocks using [[https://github.com/clojure-emacs/inf-clojure][inf-clojure]]. With a header
+argument like =:alias "alias"= the Clojure REPL will boot with
+=clojure -Aalias=. Otherwise Clojure will boot with =lein=, =boot= or
+=tools.deps=, depending on whether the current directory contains a
+=project.clj=, =build.boot= or =deps.edn=, falling back on
+~inf-clojure-generic-cmd~ in case no such file is present.
+
+Also, when using [[https://github.com/clojure-emacs/cider][cider]], you can now use =#+begin_src clojurescript= to
+execute ClojureScript code from Org files. Note that this works only
+if your Org file is associated with a cider session that knows how to
+run ClojureScript code. A bare =lein repl= session outside of a
+directory configured for ClojureScript will /not/ work.
+
+*** =ob-java.el= supports Java command line arguments
+
+Babel Java blocks recognize header argument =:cmdargs= and pass its
+value in call to =java=.
+
+*** =ob-screen.el= now accepts =:screenrc= header argument
+
+Screen blocks now recognize the =:screenrc= header argument and pass
+its value to the screen command via the "-c" option. The default
+remains =/dev/null= (i.e. a clean screen session)
+
+*** =ob-plantuml=: now supports using PlantUML executable to generate diagrams
+
+Set =org-plantuml-exec-mode= to ='plantuml= in order to use the
+executable instead of JAR. When using an executable it is also
+possible to configure executable location as well as arguments via:
+=org-plantuml-executable-path= and =org-plantuml-executable-args=.
+
+** New commands
+*** ~org-table-header-line-mode~
+
+Turn on a minor mode to display the first data row of the table at
+point in the header-line when the beginning of the table is invisible.
+
+*** ~org-agenda-ctrl-c-ctrl-c~
+
+Hitting =<C-c C-c>= in an agenda view now calls ~org-agenda-set-tags~.
+
+*** ~org-hide-entry~
+
+This command is the counterpart of ~org-show-entry~.
+
+*** ~org-columns-toggle-or-columns-quit~
+
+=<C-c C-c>= bound to ~org-columns-toggle-or-columns-quit~ replaces the
+recent ~org-columns-set-tags-or-toggle~. Tag setting is still
+possible via column view value edit or with =<C-c C-q>=.
+
+*** ~org-datetree-find-month-create~
+
+Find or create a month entry for a date.
+
+** New options and settings
+*** New option ~org-html-prefer-user-labels~
+
+When non-nil, use =NAME= affiliated keyword, or raw target values, to
+generate anchor's ID. Otherwise, consistently use internal naming
+scheme.
+
+=CUSTOM_ID= values are still always used, when available.
+*** New option for using tabs in ~org-agenda-window-setup~
+
+Choosing ~other-tab~ for ~org-agenda-window-setup~ will open the
+agenda view in a new tab. This will work with versions of Emacs since
+27.1 when ~tab-bar-mode~ was introduced.
+
+*** New option ~org-table-header-line-p~
+
+Setting this option to =t= will activate ~org-table-header-line-mode~
+in org-mode buffers.
+
+*** New option ~org-startup-numerated~
+
+When this option is =t=, Org files will start using ~(org-num-mode 1)~
+and headings will be visually numerated.
+
+You can turn this on/off on a per-file basis with =#+startup: num= or
+=#+startup: nonum=.
+
+*** New option ~org-clock-auto-clockout-timer~
+
+When this option is set to a number and the user configuration
+contains =(org-clock-auto-clockout-insinuate)=, Org will clock out the
+currently clocked in task after that number of seconds of idle time.
+
+This is useful when you often forget to clock out before being idle
+and don't want to have to manually set the clocking time to take into
+account.
+
+*** New option to group captured datetime entries by month
+
+A new `:tree-type month' option was added to org-capture-templates to
+group new datetime entries by month.
+
+*** New option to show source buffers using "plain" display-buffer
+
+There is a new option ~plain~ to ~org-src-window-setup~ to show source
+buffers using ~display-buffer~. This allows users to control how
+source buffers are displayed by modifying ~display-buffer-alist~ or
+~display-buffer-base-action~.
+
+*** New option ~org-archive-subtree-save-file-p~
+
+Archiving a subtree used to always save the target archive buffer.
+Commit [[git::b186d1d7][b186d1d7]] changed this behavior by always not saving the target
+buffer, because batch archiving from agenda could take too much time.
+
+This new option ~org-archive-subtree-save-file-p~ defaults to the
+value =from-org= so that archiving a subtree will save the target
+buffer when done from an org-mode buffer, but not from the agenda.
+You can also set this option to =t= or to =from-agenda=.
+
+*** New option ~org-show-notification-timeout~
+
+This option will add a timeout to notifications.
+
+*** New option ~org-latex-to-html-convert-command~
+
+This new option allows you to convert a LaTeX fragment directly into
+HTML.
+
+*** New option ~org-babel-shell-results-defaults-to-output~
+
+By default, source code blocks are executed in "functional mode": it
+means that the results of executing them are the value of their last
+statement (see [[https://orgmode.org/manual/Results-of-Evaluation.html][the documentation]].)
+
+The value of a shell script's execution is its exit code. But most
+users expect the results of executing a shell script to be its output,
+not its exit code.
+
+So we introduced this option, that you can set to nil if you want to
+stick using ~:results value~ as the implicit header.
+
+In all Babel libraries, the absence of a ~:results~ header should
+produce the same result than setting ~:results value~, unless there is
+an option to explicitly create an exception.
+
+See [[msg:CA+A2iZaziAfMeGpBqL6qGrzrWEVvLvC0DUw++T4gCF3NGuW-DQ@mail.gmail.com][this thread]] for more context.
+
+*** New option in ~org-attach-store-link-p~
+
+~org-attach-store-link-p~ has a new option to store a file link to the
+attachment.
+*** New option ~org-fontify-todo-headline~
+
+This feature is the same as ~org-fontify-done-headline~, but for TODO
+headlines instead. This allows you to distinguish TODO headlines from
+normal headlines. The face can be customized via ~org-headline-todo~.
+
+*** New default value for ~org-file-apps~
+
+The new value uses Emacs as the application for opening directory.
+
+*** New hook ~org-agenda-filter-hook~
+
+Functions in this hook are run after ~org-agenda-filter~ is called.
+
+** Removed or renamed functions and variables
+*** Deprecated ~org-flag-drawer~ function
+
+Use ~org-hide-drawer-toggle~ instead.
+
+*** Deprecated ~org-hide-block-toggle-maybe~ function
+
+Use ~org-hide-block-toggle~ instead.
+
+*** Deprecated ~org-hide-block-toggle-all~ function
+
+This function was not used in the code base, and has no clear use
+either. It has been marked for future removal. Please contact the
+mailing list if you use this function.
+
+*** Deprecated ~org-return-indent~ function
+
+In Elisp code, use ~(org-return t)~ instead. Interactively, =C-j= is
+now bound to ~org-return-and-maybe-indent~, which indents the new line
+when ~electric-indent-mode~ is disabled.
+
+*** Removed ~org-maybe-keyword-time-regexp~
+
+The variable was not used in the code base.
+
+*** Removed ~org-export-special-keywords~
+
+The variable was not used in the code base.
+
+*** Renamed ~org-at-property-block-p~
+
+The new name is ~org-at-property-drawer-p~, which is less confusing.
+
+*** Renamed ~org-columns-set-tags-or-toggle~
+
+See [[*~org-columns-toggle-or-columns-quit~]].
+
+*** Renamed priority options
+
+From ~org-lowest-priority~ to ~org-priority-lowest~.
+From ~org-default-priority~ to ~org-priority-default~.
+From ~org-highest-priority~ to ~org-priority-highest~.
+From ~org-enable-priority-commands~ to ~org-priority-enable-commands~.
+From ~org-show-priority~ to ~org-priority-show~.
+
+** Miscellaneous
+*** =ob-screen.el= now respects screen =:session= name
+
+Screen babel session are now named based on the =:session= header
+argument (defaults to ~default~).
+
+Previously all session names had ~org-babel-session-~ prepended.
+
+*** Forward/backward paragraph functions in line with the rest of Emacs
+
+~org-forward-paragraph~ and ~org-backward-paragraph~, bound to
+~<C-UP>~ and ~<C-DOWN>~ functions mimic more closely behaviour of
+~forward-paragraph~ and ~backward-paragraph~ functions when
+available.
+
+They also accept an optional argument for multiple calls.
+
+See their docstring for details.
+*** ~org-table-to-lisp~ no longer checks if point is at a table
+
+The caller is now responsible for the check. It can use, e.g.,
+~org-at-table-p~.
+
+The function is also much more efficient than it used to be, even on
+very large tables.
+
+*** New function ~org-collect-keywords~
+*** Drawers' folding use an API similar to block's
+
+Tooling for folding drawers interactively or programmatically is now
+on par with block folding. In particular, ~org-hide-drawer-toggle~,
+a new function, is the central place for drawer folding.
+
+*** Duration can be read and written in compact form
+
+~org-duration-to-minutes~ understands =1d3h5min= as a duration,
+whereas ~org-duration-from-minutes~ can output this compact form if
+the duration format contains the symbol ~compact~.
+
+*** C-n, C-p, SPC and DEL in agenda commands dispatch window
+
+You can now use =<C-n>=, =<C-p>=, =<SPC>= and =<DEL>= key to scroll up
+and down the agenda and attach dispatch window.
+
+*** =<C-c C-c>= in agenda calls ~org-agenda-set-tags~
+
+Both =<C-c C-q>= and =<C-c C-c>= set the tags of the headline in the
+Org buffer. Both keybindings are now available from the agenda too.
+
+*** Allow to use an empty HTML extension
+
+Using =(setq org-html-extension "")= or setting the HTML extension in
+any fashion will produce the expected output, with no trailing period
+to the resulting HTML file.
+
+*** Handle repeated tasks with =.+= type and hours step
+
+A task using a =.+= repeater and hours step is repeated starting from
+now. E.g.,
+
+#+begin_example
+,,** TODO Wash my hands
+ DEADLINE: <2019-04-05 08:00 Sun .+1h>
+ Marking this DONE shifts the date to exactly one hour from now.
+#+end_example
+
+*** The format of equation reference in HTML export can now be specified
+
+By default, HTML (via MathJax) and LaTeX export equation references
+using different commands. LaTeX must use ~\ref{%s}~ because it is used
+for all labels; however, HTML (via MathJax) uses ~\eqref{%s}~ for
+equations producing inconsistent output. New option
+~org-html-equation-reference-format~ sets the command used in HTML
+export.
+
+*** =ob-haskell.el= supports compilation with =:compile= header argument
+
+By default, Haskell blocks are interpreted. By adding =:compile yes=
+to a Haskell source block, it will be compiled, executed and the
+results will be displayed.
+
+*** Support for ~org-edit-special~ with LaTeX fragments
+
+Calling ~org-edit-special~ on an inline LaTeX fragment calls a new
+function, ~org-edit-latex-fragment~. This functions in a comparable
+manner to editing inline source blocks, bringing up a minibuffer set
+to LaTeX mode. The math-mode deliminators are read only.
+
+*** ~org-capture-current-plist~ is now accessible during ~org-capture-mode-hook~
+*** New =org-refile.el= file
+
+Org refile variables and functions have been moved to a new file.
+
+*** The end of a 7 years old bug
+
+This bug [[https://lists.gnu.org/archive/html/emacs-orgmode/2013-08/msg00072.html][originally reported]] by Matt Lundin and investigated by Andrew
+Hyatt has been fixed. Thanks to both of them.
+
+* Version 9.3
+
+** Incompatible changes
+*** Change bracket link escaping syntax
+
+Org used to percent-encode sensitive characters in the URI part of the
+bracket links.
+
+Now, escaping mechanism uses the usual backslash character, according
+to the following rules:
+
+1. All =[= and =]= characters in the URI must be escaped;
+2. Every =\= character preceding either =[= or =]= must be escaped;
+3. Every =\= character at the end of the URI must be escaped.
+
+When in doubt, use the function ~org-link-escape~ in order to turn
+a link string into its properly escaped form.
+
+The following function will help switching your links to the new
+syntax:
+
+#+begin_src emacs-lisp
+(defun org-update-link-syntax (&optional no-query)
+ "Update syntax for links in current buffer.
+Query before replacing a link, unless optional argument NO-QUERY
+is non-nil."
+ (interactive "P")
+ (org-with-point-at 1
+ (let ((case-fold-search t))
+ (while (re-search-forward "\\[\\[[^]]*?%\\(?:2[05]\\|5[BD]\\)" nil t)
+ (let ((object (save-match-data (org-element-context))))
+ (when (and (eq 'link (org-element-type object))
+ (= (match-beginning 0)
+ (org-element-property :begin object)))
+ (goto-char (org-element-property :end object))
+ (let* ((uri-start (+ 2 (match-beginning 0)))
+ (uri-end (save-excursion
+ (goto-char uri-start)
+ (re-search-forward "\\][][]" nil t)
+ (match-beginning 0)))
+ (uri (buffer-substring-no-properties uri-start uri-end)))
+ (when (or no-query
+ (y-or-n-p
+ (format "Possibly obsolete URI syntax: %S. Fix? "
+ uri)))
+ (setf (buffer-substring uri-start uri-end)
+ (org-link-escape (org-link-decode uri)))))))))))
+#+end_src
+
+The old ~org-link-escape~ and ~org-link-unescape~ functions have been
+renamed into ~org-link-encode~ and ~org-link-decode~.
+
+*** Change match group number in ~org-link-bracket-re~
+
+Link description, if any, is located in match group 2 instead of match
+group 3.
+
+*** ob-clojure does not auto prepend ~(ns ..)~ statement anymore
+
+When tangling, user usually just wants to tangle literally code instead
+of prepend inserting a ~(ns ..)~ statement before source block
+code. Now, when you have no ~:ns~ header argument specified, this
+behavior will not happen automatically.
+
+*** Change in behavior on exit from an Org edit buffer
+
+Org will no longer attempt to restore the window configuration in the
+frame to which the user returns after editing a source block with
+~org-edit-src-code~. Instead, the window configuration will remain as
+it is.
+
+*** Change default value for ~org-email-link-description-format~
+
+When linking from a mail buffer, Org used to truncate the subject of
+the message to 30 characters in order to build the description of the
+link. This behavior was considered as too surprising. As
+a consequence, Org no longer truncates subjects.
+
+You can get the old behavior back with the following:
+
+: (setq org-email-link-description-format "Email %c: %.30s")
+
+*** ~:file~ header argument no longer assume "file" ~:results~
+
+The "file" ~:results~ value is now mandatory for a code block
+returning a link to a file. The ~:file~ or ~:file-ext~ header
+arguments no longer imply a "file" result is expected.
+
+*** Plain numbers are hours in Column View mode
+
+See [[git:3367ac9457]] for details.
+
+*** All LaTeX preview backends use now xcolor
+
+The dvipng backend was previously relying on fg and bg parameters to
+be passed to the CLI. This didn't work when xcolor was directly or
+indirectly used in the document (e.g. tkiz is a user of xcolor). Since
+every other backend was already using xcolor to set fg and bg, the CLI
+alternative was removed and there is no more a :use-xcolor options
+since now it's implicitly always true.
+
+*** Org-Attach Git commit
+
+[[*Org-Attach has been refactored and extended][Refactoring of Org-Attach]] affected the Git commit functionality. Not
+much, but the following changes are required if you still need to
+auto-commit attachments to git:
+
+- Customization of ~org-attach-annex-auto-get~ needs to be renamed to
+ ~org-attach-git-annex-auto-get~.
+
+- Customization of ~org-attach-commit~ is no longer needed. Instead
+ one need to require the =org-attach-git= module in the startup.
+
+** New features
+*** New option to wrap source code lines in HTML export
+
+When new option ~html-wrap-src-lines~ (with variable
+~org-html-wrap-src-lines~) is non-nil, HTML export wraps source code
+lines in HTML ~code~ elements.
+
+*** New option to handle schedules and deadlines in iCalendar export
+
+Export ignore done tasks with a deadline when
+~org-icalendar-use-deadline~ contains ~event-if-todo-not-done~.
+Likewise, scheduled done tasks are also ignored when
+~org-icalendar-use-scheduled~ contains the same symbol.
+
+*** Add ~split-window-right~ option for src block edit window placement
+
+Given the increasing popularity of wide screen monitors, splitting
+horizontally may make more sense than splitting vertically. An
+option, ~split-window-right~, to request horizontal splitting has been
+added to ~org-src-window-setup~.
+
+*** Org-Attach has been refactored and extended
+
+Org attach has been refactored and the functionality extended. It
+should now be easier to understand how it works. A few improvements
+and extra options have been added as well.
+
+From the initial comment in org-attach source-code:
+
+- Attachments are managed either by using a custom property DIR or by
+ using property ID from org-id. When DIR is defined, a location in
+ the filesystem is directly attached to the outline node. When
+ org-id is used, attachments are stored in a folder named after the
+ ID, in a location defined by ~org-attach-id-dir~. DIR has
+ precedence over ID when both parameters are defined for the current
+ outline node (also when inherited parameters are taken into
+ account).
+
+From now on inheritance requires no extra property and will adhere to
+~org-attach-use-inheritance~ by default. Inheritance can be
+customized to always be activated or never be activated in
+~org-attach-use-inheritance~.
+
+The ATTACH_DIR property is deprecated in favor of the shorter
+property DIR. Links to folders inside the DIR property can now be
+declared as relative links. This is not enabled by default, but can
+be set in ~org-attach-dir-relative~.
+
+When adding new attachment to the outline node the preferred way of
+doing so can be customized. Take a look at
+~org-attach-preferred-new-method~. It defaults to using ID since that
+was the behavior before this change.
+
+If both DIR and ID properties are set on the same node, DIR has
+precedence and will be used.
+
+One can now also choose to build attachment-directory-paths in a
+customized way. This is an advanced topic, but in some case it makes
+sense to parse an ID in a different way than the default one. Create
+your own function and add it to the beginning of
+~org-attach-id-to-path-function~list~ if you want to customize the ID
+based folder structure.
+
+If you've used ATTACH_DIR properties to manage attachments, use the
+following code to rename that property to DIR which supports the same
+functionality. ATTACH_DIR_INHERIT is no longer supported and is
+removed.
+
+#+begin_src emacs-lisp
+ (defun org-update-attach-properties ()
+ "Change properties for Org-Attach."
+ (interactive)
+ (org-with-point-at 1
+ (while (outline-next-heading)
+ (let ((DIR (org--property-local-values "ATTACH_DIR" nil)))
+ (when DIR
+ (org-set-property "DIR" (car DIR))
+ (org-delete-property "ATTACH_DIR"))))
+ (org-delete-property-globally "ATTACH_DIR_INHERIT")))
+#+end_src
+
+For those who hate breaking changes, even though the changes are made
+to clean things up; fear not. ATTACH_DIR will still continue to work.
+It's just not documented any longer. When you get the chance, run the
+code above to clean things up anyway!
+
+**** New hooks
+Two hooks are added to org-attach:
+- org-attach-after-change-hook
+- org-attach-open-hook
+
+They are added mostly for internal restructuring purposes, but can
+ofc. be used for other things as well.
+
+*** New link-type: Attachment
+
+Attachment-links are now first-class citizens. They mimic file-links
+in everything they do but use the existing attachment-folder as a base
+when expanding the links. Both =DIR= and =ID= properties are used to
+try to resolve the links, in exactly the same way as Org-Attach uses
+those properties.
+
+*** Handle overlay specification for notes in Beamer export
+
+This aligns Beamer notes with slide overlays.
+
+*** Add support for lettered lists in Texinfo
+
+Using =:enum A= or =:enum a= Texinfo attribute switches an otherwise
+numbered list to a lettered list.
+
+*** Add a dispatcher command to insert dynamic blocks
+
+You can add new dynamic blocks with function
+~org-dynamic-block-define~. All such dynamic blocks can be used by
+~org-dynamic-block-insert-dblock~ command.
+
+*** Babel
+
+**** ob-emacs-lisp sets ~lexical-binding~ in Org edit buffers
+
+When editing an Elisp src block, the editing buffer's
+~lexical-binding~ is set according to the src block's =:lexical=
+parameter.
+
+**** Add LaTeX output support in PlantUML
+
+*** New minor mode to display headline numbering
+
+Use =<M-x org-num-mode>= to get a visual indication of the numbering
+in the outline. The numbering is also automatically updated upon
+changes in the buffer.
+
+*** New property =HTML_HEADLINE_CLASS= in HTML export
+
+The new property =HTML_HEADLINE_CLASS= assigns a class attribute to
+a headline.
+
+*** Allow LaTeX attributes and captions for "table.el" tables
+
+Supported LaTeX attributes are ~:float~, ~:center~, ~:font~ and
+~:caption~.
+
+*** Attach buffer contents to headline
+
+With =<b>= key from attachment dispatcher (=<C-c C-a>=), it is now
+possible to write the contents of a buffer to a file in the headline
+attachment directory.
+
+*** iCalendar export respects a =CLASS= property
+
+Set the =CLASS= property on an entry to specify a visibility class for
+that entry only during iCalendar export. The property can be set to
+anything the calendar server supports. The iCalendar standard defines
+the values =PUBLIC=, =CONFIDENTIAL=, =PRIVATE=, which can be
+interpreted as publicly visible, accessible to a specific group, and
+private respectively.
+
+This property can be inherited during iCalendar export, depending on
+the value of ~org-use-property-inheritance~.
+
+*** New parameter for =INCLUDE= keyword
+
+Add =:coding CODING-SYSTEM= to include files using a different coding
+system than the main Org document. For example:
+
+#+begin_example
+,#+INCLUDE: "myfile.cmd" src cmd :coding cp850-dos
+#+end_example
+
+*** New values in clock tables' step: =month= and =year=
+*** ODT export handles numbers cookies in lists
+*** New cell movement functions in tables
+
+~S-<UP>~, ~S-<DOWN>~, ~S-<RIGHT>~, and ~S-<LEFT>~ now move cells in
+the corresponding direction by swapping with the adjacent cell.
+
+*** New option to natively fontify LaTeX snippets and environments
+
+A 'native option was added to org-highlight-latex-and-related. It
+matches the same structures than 'latex but it calls
+org-src-font-lock-fontify-block instead, thus bringing about full
+LaTeX font locking.
+
+*** ~org-clone-subtree-with-time-shift~ learned to shift backward in time
+
+=<C-c C-x c>= (~org-clone-subtree-with-time-shift~) now takes a
+negative value as a valid repeater to shift time stamps in backward
+in cloned subtrees. You can give, for example, ‘-3d’ to shift three
+days in the past.
+
+*** Toggle display of all vs. undone scheduled habits conveniently
+
+=<C-u K>= (~org-habit-toggle-display-in-agenda~) in an agenda toggles
+the display of all habits to those which are undone and scheduled.
+This is a function for convenience.
+
+*** New parameter for SQL Babel blocks: ~:dbconnection~
+
+The new parameter ~:dbconnection~ allows to specify a connection name
+in a SQL block header: this name is used to look up connection
+parameters in ~sql-connection-alist~.
+
+*** New =:scale= attribute supported by LaTeX exporters
+
+The builtin "latex" exporters now accept and use a =:scale= attribute,
+which scales an image by a given factor.
+
+This attribute is wrapped around the =scale= parameter of LaTeX's
+=\includegraphics= (bitmap images) or a TiKZ's =\scalebox=.
+Therefore, its value should be some string palatable to LaTeX as
+a positive float Its default value is an empty string (i.e. disabled).
+
+This attribute overrides the =:width= and =:height= attributes.
+
+#+begin_example
+,#+name: Beastie
+,#+caption: I think I saw this curious horse already, but where ?
+,#+LATEX_ATTR: :scale 2
+[[https://orgmode.org/img/org-mode-unicorn-logo.png]]
+#+end_example
+
+*** Allow specifying the target for a table of contents
+
+The =+TOC= keyword now accepts a =:target:= attribute that specifies
+the headline to use for making the table of contents.
+
+#+begin_example
+,* Target
+ :PROPERTIES:
+ :CUSTOM_ID: TargetSection
+ :END:
+,** Heading A
+,** Heading B
+,* Another section
+,#+TOC: headlines 1 :target "#TargetSection"
+#+end_example
+** New functions
+*** ~org-dynamic-block-insert-dblock~
+
+Use default keybinding =<C-c C-x x>= to run command
+~org-dynamic-block-insert-dblock~. It will prompt user to select
+dynamic block in ~org-dynamic-block-alist~.
+
+*** ~org-table-cell-up~
+*** ~org-table-cell-down~
+*** ~org-table-cell-left~
+*** ~org-table-cell-right~
+*** ~org-habit-toggle-display-in-agenda~
+** Removed functions and variables
+*** Removed Org Drill
+
+You can install it back from MELPA.
+
+*** ~org-babel-set-current-result-hash~
+*** ~org-capture-insert-template-here~
+*** ~org-attach-directory~
+
+It has been deprecated in favor of ~org-attach-id-dir~ which is less
+ambiguous given the restructured org-attach.
+
+*** ~org-enable-fixed-width-editor~
+
+This variable was not used through the code base.
+
+** Miscellaneous
+*** Change signature for ~org-list-to-subtree~
+
+The function now accepts the level of the subtree as an optional
+argument. It no longer deduces it from the current level.
+
+*** LaTeX preview is simplified
+
+Function ~org-latex-preview~, formerly known as
+~org-toggle-latex-fragment~, has a hopefully simpler and more
+predictable behavior. See its docstring for details.
+
+*** ~org-table-copy-down~ supports patterns
+
+When ~org-table-copy-increment~ is non-nil, it is now possible to
+increment fields like =A1=, or =0A=, i.e., any string prefixed or
+suffixed with a whole number.
+
+*** No more special indentation for description items
+
+Descriptions items are indented like regular ones, i.e., text starts
+after the bullet. Special indentation used to introduce bugs when
+inserting sub-items in a description list.
+
+*** New hook: ~org-todo-repeat-hook~
+
+This hook was actually introduced in Org 9.2.1, but wasn't advertised.
+
+*** Org Table reads numbers starting with 0 as strings
+*** Disable fast tag selection interface via prefix arg
+
+A call of ~org-set-tags-command~ with prefix argument C-u C-u avoids
+the fast tag selection interface and instead offers the plain
+interface.
+
+*** ~:mkdirp~ now supports create directory for ~:dir~ path
+
+The ~:mkdirp~ header argument used to only work for ~:tangle~ tangle
+files. Now ~:mkdirp~ works for ~:dir~ too. This is more convenient for
+specify default directory and with ~:file~ header argument.
+
+*** New variable: ~org-agenda-breadcrumbs-separator~
+
+If breadcrumbs are showed in org-agenda with the help of "%b" format
+in ~org-agenda-prefix-format~, user can customize breadcrumbs's
+separator using ~org-agenda-breadcrumbs-separator~.
+
+*** New variable ~org-attach-commands~
+
+This variable makes it possible to customize the list of commands for
+the attachment dispatcher.
+
+*** New ID method based on timestamp
+
+If one chooses, it is now possible to create ID's based on timestamp
+(ISO8601) instead of UUID by changing org-id-method to ts.
+
+For an improved folder structure when using timestamp as ID, make sure
+to promote ~org-attach-id-ts-folder-format~ to the first element of
+~org-attach-id-to-path-function-list~ in your configuration at the
+same time.
+
+*** New customization: ~org-id-locations-relative~
+
+New customization to make the persisting of org-id-locations between
+sessions to store links to files as relative instead of absolute. The
+links will be stored as relative to the path of org-id-locations-file.
+
+*** ~org-ctrl-c-tab~ is functional before the first headline
+
+I.e. treat the whole file as if it was a subtree.
+
+Also fold everything below the chosen level. Former behavior was to
+leave unfolded subtrees unfolded.
+
+*** ~org-kill-note-or-show-branches~ is functional before the first headline
+
+I.e. treat the whole file as if it was a subtree.
+
+*** Respect narrowing when agenda command is restricted to buffer
+
+*** ~org-table-insert-column~ inserts the column at point position
+
+Before, the new column was inserted to the right of the column at
+point position.
+
+*** Table column deletion now consistent with row deletion
+
+Point stays in the column at deletion, except when deleting the
+rightmost column.
+
+* 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 update it, see the docstring for accepted values.
+
+If you prefer using previous patterns, e.g. =<s=, you can activate
+them again by requiring Org Tempo library:
+
+: (require 'org-tempo)
+
+or add it to ~org-modules~.
+
+If you need complex templates, look at the ~tempo-define-template~
+function or at solutions like Yasnippet.
+
+*** Change to Noweb expansion
+
+Expansion check =:noweb-ref= only if no matching named block is found
+in the buffer. As a consequence, any =:noweb-ref= value matching the
+name of a source block in the buffer is ignored. A simple fix is to
+give every concerned source-block, including the named one, a new,
+unique, Noweb reference.
+
+#+BEGIN_SRC org
+ ,#+NAME: foo
+ ,#+BEGIN_SRC emacs-lisp
+ 1
+ ,#+END_SRC
+
+ ,#+BEGIN_SRC emacs-lisp :noweb-ref foo
+ 2
+ ,#+END_SRC
+
+ ,#+BEGIN_SRC emacs-lisp :noweb yes
+ <<foo>>
+ ,#+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
+ <<bar>>
+ ,#+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 behavior 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 ~:session~ support of ob-clojure for CIDER
+You can initialize source block session with Babel default keybinding
+=[C-c C-v C-z]= to use =sesman= session manager to link current
+project, directory or buffer with specific Clojure session, or
+=cider-jack-in= a new CIDER REPL if no CIDER REPLs available. In older
+CIDER version which has not =sesman= integrated, only has
+=cider-jack-in= without Clojure project is supported.
+#+begin_src clojure :session
+(dissoc Clojure 'JVM)
+(conj clojurists "stardiviner")
+#+end_src
+*** 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 "https://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 below.
+
+#+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.
+
+*** Headlines can now link to themselves in HTML export
+
+When enabling ~org-html-self-link-headlines~ the headlines exported to
+HTML contain a hyperlink to themselves.
+
+** 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 information
+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
+
+*** Variables relative to clocksum duration are obsolete
+
+~org-time-clocksum-format~, ~org-time-clocksum-use-fractional~ and
+~org-time-clocksum-fractional-format~ are obsolete. If you changed
+them, consider modifying ~org-duration-format~ instead.
+
+Variable ~org-time-clocksum-use-effort-durations~ is also obsolete.
+Consider setting ~org-duration-units~ instead.
+
+*** ~org-at-timestamp-p~ optional argument accepts different values
+
+See docstrings for the allowed values. For backward compatibility,
+~(org-at-timestamp-p t)~ is still supported, but should be updated
+accordingly.
+
+*** ~org-capture-templates~ no longer accepts S-expressions as file names
+
+Since functions are allowed there, a straightforward way to migrate
+is to turn, e.g.,
+
+: (file (sexp))
+
+into
+
+: (file (lambda () (sexp)))
+
+*** Deleted contributed packages
+
+=org-ebib.el, =org-bullets.el= and =org-mime.el= have been deleted
+from the contrib/ directory.
+
+You can now find them here :
+
+- https://github.com/joostkremers/ebib
+- https://github.com/sabof/org-bullets
+- https://github.com/org-mime/org-mime
+
+*** Change ~org-texinfo-classes~ value
+The value cannot support functions to create sectioning commands
+anymore. Also, the sectioning commands should include commands for
+appendices. See the docstring for more information.
+*** Removal of ~:sitemap-sans-extension~
+
+The publishing property is no longer recognized, as a consequence of
+changes to site-map generation.
+
+You can get the same functionality by setting ~:sitemap-format-entry~
+to the following
+
+#+BEGIN_SRC elisp
+(lambda (entry style project)
+ (cond ((not (directory-name-p entry))
+ (format "[[file:%s][%s]]"
+ (file-name-sans-extension entry)
+ (org-publish-find-title entry project)))
+ ((eq style 'tree) (file-name-nondirectory (directory-file-name entry)))
+ (t entry)))
+#+END_SRC
+
+*** Change signature for ~:sitemap-function~
+
+~:sitemap-function~ now expects to be called with two arguments. See
+~org-publish-project-alist~ for details.
+
+*** Change signature for some properties in ~org-list-to-generic~
+
+~:istart~, ~:icount~, ~:iend~ and ~:isep~ now expect the type of the
+list as their first argument.
+
+*** Change signature for ~org-get-repeater~
+The optional argument is now a string to extract the repeater from.
+See docstring for details.
+
+*** Change signature for ~org-time-string-to-time~
+See docstring for changes.
+
+*** Change order of items in ~org-agenda-time-grid~
+~org-agenda-time-grid~ gained an extra item to allow users to customize
+the string displayed after times in the agenda. See docstring for
+details.
+
+*** ~tags-todo~ custom searches now include DONE keywords
+
+Use "/!" markup when filtering TODO keywords to get only not-done TODO
+keywords.
+
+*** ~org-split-string~ returns ~("")~ when called on an empty string
+
+It used to return nil.
+
+*** Removal of =ob-scala.el=
+
+See [[https://github.com/ensime/emacs-scala-mode/issues/114][this github issue]].
+
+You can use =ob-scala.el= as packaged in scala-mode, available from the
+MELPA repository.
+
+** New features
+*** iCalendar export uses inheritance for TIMEZONE and LOCATION properties
+Both these properties can be inherited during iCalendar export,
+depending on the value of ~org-use-property-inheritance~.
+*** iCalendar export respects a TIMEZONE property
+Set the TIMEZONE property on an entry to specify a time zone for that
+entry only during iCalendar export. The property value should be
+specified as in "Europe/London".
+*** ~org-attach~ can move directory contents
+When setting a new directory for an entry, org-attach offers to move
+files over from the old directory. Using a prefix arg will reset the
+directory to old, ID based one.
+*** New Org duration library
+This new library implements tools to read and print time durations in
+various formats (e.g., "H:MM", or "1d 2h 3min"...).
+
+See ~org-duration-to-minutes~ and ~org-duration-from-minutes~
+docstrings.
+
+*** Agenda
+**** New variable : ~org-agenda-show-future-repeats~
+**** New variable : ~org-agenda-prefer-last-repeat~
+**** New variable : ~org-deadline-past-days~
+See docstring for details.
+**** Binding C-c C-x < for ~org-agenda-set-restriction-lock-from-agenda~
+**** New auto-align default setting for =org-agenda-tags-column=
+
+=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
+directories in published site-maps.
+
+*** Babel
+
+**** Scheme: support for tables
+**** Scheme: new variable: ~org-babel-scheme-null-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~
+
+A new block code header has been created for Org Babel that enables
+developers to prepend code to the scheme block being processed.
+
+Multiple ~:prologue~ headers can be added each of them using a string
+with the content to be added.
+
+The scheme blocks are prepared by surrounding the code in the block
+with a let form. The content of the ~:prologue~ headers are prepended
+before this let form.
+
+**** Support for hledger accounting reports added
+**** Clojure: new setting ~org-babel-clojure-sync-nrepl-timeout~
+
+Creation of a new setting to specify the Cider timeout. By setting
+the =org-babel-clojure-sync-nrepl-timeout= setting option. The value
+is in seconds and if set to nil then no timeout will occur.
+
+**** Clojure: new header ~:show-process~
+
+A new block code header has been created for Org Babel that enables
+developers to output the process of an ongoing process into a new
+window/buffer.
+
+You can tell Org Babel to output the process of a running code block.
+
+To show that output you only have to specify the =:show-process=
+option in the code block's header like this:
+
+#+begin_example
+,#+BEGIN_SRC clojure :results output :show-process t
+ (dotimes [n 10]
+ (println n ".")
+ (Thread/sleep 500))
+,#+END_SRC
+#+end_example
+
+If =:show-process= is specified that way, then when you will run the
+code using =C-c C-c= a new window will open in Emacs. Everything that
+is output by the REPL will immediately be added to that new window.
+
+When the processing of the code is finished, then the window and its
+buffer will be closed and the results will be reported in the
+=#+RESULTS= section.
+
+Note that the =:results= parameter's behavior is *not* changed. If
+=silent= is specified, then no result will be displayed. If =output=
+is specified then all the output from the window will appears in the
+results section. If =value= is specified, then only the last returned
+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 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
+
+[[https://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~
+
+A new engine was added to support ~sqsh~ command line utility for use
+against Microsoft SQL Server or Sybase SQL server.
+
+More information on ~sqsh~ can be found here: [[https://sourceforge.net/projects/sqsh/][sourceforge/sqsh]]
+
+To use ~sqsh~ in an *sql* =SRC_BLK= set the =:engine= like this:
+
+#+begin_example
+,#+BEGIN_SRC sql :engine sqsh :dbhost my_host :dbuser master :dbpassword pass :database support
+Select * From Users
+Where clue > 0
+,#+END_SRC
+#+end_example
+
+**** SQL: new engine added =vertica=
+
+A new engine was added to support vsql command line utility for use
+against HP Vertica.
+
+More information on =vsql= can be found here: [[https://my.vertica.com/docs/7.2.x/HTML/index.htm#Authoring/ConnectingToHPVertica/vsql/UsingVsql.htm][my.vertica.com]]
+
+To use =vertica= in an sql =SRC_BLK= set the =:engine= like this:
+
+#+BEGIN_EXAMPLE
+ ,#+BEGIN_SRC sql :engine vertica :dbhost my_host :dbuser dbadmin :dbpassword pw :database vmart
+ SELECT * FROM nodes;
+ ,#+END_SRC
+#+END_EXAMPLE
+**** C++: New header ~:namespaces~
+
+The new ~:namespaces~ export option can be used to specify namespaces
+to be used within a C++ org source block. Its usage is similar to
+~:includes~, in that it can accept multiple, space-separated
+namespaces to use. This header is equivalent to adding ~using
+namespace <name>;~ in the source block. Here is a "Hello World" in C++
+using ~:namespaces~:
+
+#+begin_example
+ ,#+BEGIN_SRC C++ :results output :namespaces std :includes <iostream>
+ cout << "Hello World" << endl;
+ ,#+END_SRC
+#+end_example
+
+**** Support for Vala language
+
+[[https://wiki.gnome.org/Projects/Vala][Vala]] language blocks support two special header arguments:
+
+- ~:flags~ passes arguments to the compiler
+- ~:cmdline~ passes commandline arguments to the generated executable
+
+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~
+~org-babel-vala-compiler~.
+
+*** New ~function~ scope argument for the Clock Table
+Added a nullary function that returns a list of files as a possible
+argument for the scope of the clock table.
+*** Export
+**** Implement vernacular table of contents in Markdown exporter
+Global table of contents are generated using vanilla Markdown syntax
+instead of HTML. Also #+TOC keyword, including local table of
+contents, are now supported.
+**** Add Slovenian translations
+**** Implement ~org-export-insert-image-links~
+This new function is meant to be used in back-ends supporting images
+as descriptions of links, a.k.a. image links. See its docstring for
+details.
+**** New macro : ~{{{n}}}~
+This macro creates and increment multiple counters in a document. See
+manual for details.
+**** Add global macros through ~org-export-global-macros~
+With this variable, one can define macros available for all documents.
+**** New keyword ~#+EXPORT_FILE_NAME~
+Similarly to ~:EXPORT_FILE_NAME:~ property, this keyword allows the
+user to specify the name of the output file upon exporting the
+document. This also has an effect on publishing.
+**** Horizontal rules are no longer ignored in LaTeX table math mode
+**** Use ~compilation-mode~ for compilation output
+**** Plain lists accept a new ~:separator~ attribute in Texinfo
+
+The new ~:separator~ attribute splits a tag from a description list
+item into multiple parts. This allows to have two-column tables with
+multiple entries in the first column. See manual for more details.
+
+**** ~latex-environment~ elements support ~caption~ keywords for LaTeX export
+*** ~org-edit-special~ can edit LaTeX environments
+
+Using ~C-c '~ on a LaTeX environment opens a sub-editing buffer. By
+default, major mode in that buffer is ~latex-mode~, but it can be
+changed by configuring ~org-src-lang-modes~.
+
+*** ~org-list-to-generic~ includes a new property: ~:ifmt~
+
+~:ifmt~ is a function to be called on the body of each item. See
+~org-list-to-generic~ documentation for details.
+
+*** New variable : ~org-bibtex-headline-format-function~
+This allow to use a different title than entry title.
+
+*** ~org-attach~ supports attaching files from URLs
+
+Using ~C-c C-a u~ prompts for a URL pointing to a file to be attached
+to the document.
+
+*** New option for ~org-refile-use-outline-path~
+~org-refile-use-outline-path~ now supports the setting ~buffer-name~,
+which causes refile targets to be prefixed with the buffer’s
+name. This is particularly useful when used in conjunction with
+~uniquify.el~.
+
+*** ~org-file-contents~ now allows the FILE argument to be a URL.
+This allows ~#+SETUPFILE:~ to accept a URL instead of a local file
+path. The URL contents are auto-downloaded and saved to a temporary
+cache ~org--file-cache~. A new optional argument ~NOCACHE~ is added
+to ~org-file-contents~.
+
+*** ~org-mode-restart~ now resets the newly added ~org--file-cache~.
+Using ~C-c C-c~ on any keyword (like ~#+SETUPFILE~) will reset the
+that file cache.
+
+*** New option : ~org-table-duration-hour-zero-padding~
+This variable allow computed durations in tables to be zero-padded.
+
+*** New mode switch for table formulas : =U=
+This mode omits seconds in durations.
+
+** Removed functions
+
+*** Org Timeline
+
+This feature has been removed. Use a custom agenda view, possibly
+narrowed to current buffer to achieve a similar functionality.
+
+*** ~org-agenda-skip-entry-when-regexp-matches~ is obsolete
+
+Use ~org-agenda-skip-if~ instead.
+
+*** ~org-agenda-skip-subtree-when-regexp-matches~ is obsolete
+
+Use ~org-agenda-skip-if~ instead.
+
+*** ~org-agenda-skip-entry-when-regexp-matches-in-subtree~ is obsolete
+
+Use ~org-agenda-skip-if~ instead.
+
+*** ~org-minutes-to-clocksum-string~ is obsolete
+
+Use ~org-duration-from-minutes~ instead.
+
+*** ~org-hh:mm-string-to-minutes~ is obsolete
+
+Use ~org-duration-to-minutes~ instead.
+
+*** ~org-duration-string-to-minutes~ is obsolete
+
+Use ~org-duration-to-minutes~ instead.
+
+*** ~org-gnus-nnimap-cached-article-number~ is removed.
+
+This function relied on ~nnimap-group-overview-filename~, which was
+removed from Gnus circa September 2010.
+
+** Removed options
+
+*** ~org-agenda-repeating-timestamp-show-all~ is removed.
+
+For an equivalent to a nil value, set ~org-agenda-show-future-repeats~
+to nil and ~org-agenda-prefer-last-repeat~ to =t=.
+
+*** ~org-gnus-nnimap-query-article-no-from-file~ is removed.
+
+This variable has no effect, as it was relying on a function that was
+removed from Gnus circa September 2010.
+
+*** ~org-usenet-links-prefer-google~ is obsolete.
+
+Use ~org-gnus-prefer-web-links~ instead.
+
+*** ~org-publish-sitemap-file-entry-format~ is deprecated
+
+One can provide new ~:sitemap-format-entry~ property for a function
+equivalent to the removed format string.
+
+*** ~org-enable-table-editor~ is removed.
+
+Setting it to a nil value broke some other features (e.g., speed
+keys).
+
+*** ~org-export-use-babel~ cannot be set to ~inline-only~
+
+The variable is now a boolean.
+
+*** ~org-texinfo-def-table-markup~ is obsolete
+
+Use ~org-texinfo-table-default-markup~ instead.
+
+** New functions
+
+*** ~org-publish-find-property~
+
+This function can be used as a tool to format entries in a site-map,
+in addition to ~org-publish-find-title~ and ~org-publish-find-date~.
+
+*** ~org-list-to-org~
+
+It is the reciprocal of ~org-list-to-lisp~, which see.
+
+*** ~org-agenda-set-restriction-lock-from-agenda~
+
+Call ~org-agenda-set-restriction-lock~ from the agenda.
+
+** Miscellaneous
+
+*** The Library of Babel now on Worg
+
+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 [[https://orgmode.org/worg/library-of-babel.html][here]].
+
+If you want to contribute to it, please see [[https://orgmode.org/worg/org-contribute.html][how to contribute]].
+
+*** Allow multiple columns view
+
+Columns view is not limited to a single buffer anymore.
+*** Org Attach obeys ~dired-dwim-target~
+
+When a Dired buffer is opened next to the Org document being edited,
+the prompt for file to attach can start in the Dired buffer's
+directory if `dired-dwim-target' in non-nil.
+
+*** ~org-fill-paragraph~ can now fill a whole region
+*** More specific anniversary descriptions
+
+Anniversary descriptions (used in the agenda view, for instance)
+include the point in time, when the anniversary appears. This is,
+in its most general form, just the date of the anniversary. Or
+more specific terms, like "today", "tomorrow" or "in n days" are
+used to describe the time span.
+
+This feature allows to automatically change the description of an
+anniversary, depending on if it occurs in the next few days or
+far away in the future.
+
+*** Computed dates in tables appear as inactive time stamps
+
+*** Save point before opening a file with an unknown search option
+
+When following a file link with a search option (e.g., =::#custom-id=)
+that doesn't exist in the target file, save position before raising an
+error. As a consequence, it is possible to jump back to the original
+document with ~org-mark-ring-goto~ (default binding =C-c &=).
+
+*** ~org-get-heading~ accepts two more optional arguments
+
+See docstring for details.
+
+*** New option ~org-babel-uppercase-example-markers~
+
+This variable is a ~defcustom~ and replaces the variable
+~org-babel-capitalize-example-region-markers~, which is a ~defvar~ and
+is now obsolete.
+*** =INCLUDE= keywords in commented trees are now ignored.
+*** Default value for ~org-texinfo-text-markup-alist~ changed.
+
+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 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~
+*** 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.
+
+*** Add (C) =COMMENT= support to ~org-structure-template-alist~
+
+* Version 9.0
+
+** Incompatible changes
+
+*** Emacs 23 support has been dropped
+
+From now on, Org expects at least Emacs 24.3, although Emacs 24.4 or
+above is suggested.
+
+*** XEmacs support has been dropped
+
+Incomplete compatibility layer with XEmacs has been removed. If you
+want to take over maintenance of this compatibility, please contact
+our mailing list.
+
+*** New syntax for export blocks
+
+Export blocks are explicitly marked as such at the syntax level to
+disambiguate their parsing from special blocks. The new syntax is
+
+#+BEGIN_SRC org
+,#+BEGIN_EXPORT backend
+...
+,#+END_EXPORT
+#+END_SRC
+
+instead of
+
+#+BEGIN_SRC org
+,#+BEGIN_backend
+...
+,#+END_backend
+#+END_SRC
+
+As a consequence, =INCLUDE= keywords syntax is modified, e.g.,
+
+#+BEGIN_SRC org
+,#+INCLUDE: "file.org" HTML
+#+END_SRC
+
+becomes
+
+#+BEGIN_SRC org
+,#+INCLUDE: "file.org" export html
+#+END_SRC
+
+The following function repairs export blocks and =INCLUDE= keywords
+using previous syntax:
+
+#+BEGIN_SRC emacs-lisp
+(defun org-repair-export-blocks ()
+ "Repair export blocks and INCLUDE keywords in current buffer."
+ (interactive)
+ (when (eq major-mode 'org-mode)
+ (let ((case-fold-search t)
+ (back-end-re (regexp-opt
+ '("HTML" "ASCII" "LATEX" "ODT" "MARKDOWN" "MD" "ORG"
+ "MAN" "BEAMER" "TEXINFO" "GROFF" "KOMA-LETTER")
+ t)))
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (let ((block-re (concat "^[ \t]*#\\+BEGIN_" back-end-re)))
+ (save-excursion
+ (while (re-search-forward block-re nil t)
+ (let ((element (save-match-data (org-element-at-point))))
+ (when (eq (org-element-type element) 'special-block)
+ (save-excursion
+ (goto-char (org-element-property :end element))
+ (save-match-data (search-backward "_"))
+ (forward-char)
+ (insert "EXPORT")
+ (delete-region (point) (line-end-position)))
+ (replace-match "EXPORT \\1" nil nil nil 1))))))
+ (let ((include-re
+ (format "^[ \t]*#\\+INCLUDE: .*?%s[ \t]*$" back-end-re)))
+ (while (re-search-forward include-re nil t)
+ (let ((element (save-match-data (org-element-at-point))))
+ (when (and (eq (org-element-type element) 'keyword)
+ (string= (org-element-property :key element) "INCLUDE"))
+ (replace-match "EXPORT \\1" nil nil nil 1)))))))))
+#+END_SRC
+
+Moreover, ~:export-block~ keyword used in ~org-export-define-backend~ and
+~org-export-define-derived-backend~ is no longer used and needs to be
+removed.
+
+*** Footnotes changes
+
+**** [1]-like constructs are not valid footnotes
+
+Using =[1]= as a footnote was already discouraged in the manual, since
+it introduced too many false-positives in many Org documents. These
+constructs are now unsupported.
+
+If you used =[N]= in some of your documents, consider turning them into
+=[fn:N]=.
+
+**** /Org Footnote/ library doesn't handle non-Org buffers
+
+Commands for footnotes in an Org document no longer try to do
+something in non-Org ones. If you need to have footnotes there,
+consider using the =footnote.el= library, shipped with Emacs.
+
+In particular, ~org-footnote-tag-for-non-org-mode-files~ no longer
+exists.
+
+*** ~org-file-apps~ no longer accepts S-expressions as commands
+
+The variable now accepts functions of two arguments instead of plain
+S-expressions. Replacing an S-expression with an appropriate function
+is straightforward. For example
+
+: ("pdf" . (foo))
+
+becomes
+
+: ("pdf" . (lambda (file link) (foo)))
+
+*** The ~{{{modification-time}}}~ macro can get time via =vc=
+
+The modification time will be determined via =vc.el= if the second
+argument is non-nil. See the manual for details.
+
+*** Preparation and completion functions in publishing projects change signature
+
+Preparation and completion functions are now called with an argument,
+which is the project property list. It used to be dynamically scoped
+through the ~project-plist~ variable.
+
+*** Old Babel header properties are no longer supported
+
+Using header arguments as property names is no longer possible. As
+such, the following
+
+#+BEGIN_EXAMPLE
+,* Headline
+:PROPERTIES:
+:exports: code
+:var: a=1 b=2
+:var+: c=3
+:END:
+#+END_EXAMPLE
+
+should be written instead
+
+#+BEGIN_EXAMPLE
+,* Headline
+:PROPERTIES:
+:header-args: :exports code
+:header-args+: :var a=1 b=2
+:header-args+: :var c=3
+:END:
+#+END_EXAMPLE
+
+Please note that, however, old properties were defined at the source
+block definition. Current ones are defined where the block is called.
+
+** New features
+
+*** ~org-eww~ has been moved into core
+*** New org-protocol key=value syntax
+
+Org-protocol can now handle query-style parameters such as:
+
+#+begin_example
+org-protocol://store-link?url=http:%2F%2Flocalhost%2Findex.html&title=The%20title
+org-protocol://capture?template=x&title=Hello&body=World&url=http:%2F%2Fexample.com
+#+end_example
+
+Old-style links such as
+: org-protocol://store-link:/http:%2F%2Flocalhost%2Findex.html/The%20title
+continue to be supported.
+
+If you have defined your own handler functions for
+~org-protocol-protocol-alist~, change them to accept either a property
+list (for new-style links) or a string (for old-style links). Use
+~org-protocol-parse-parameters~ to convert old-style links into property
+lists.
+
+*** New Org linter library
+
+~org-lint~ can check syntax and report common issues in Org documents.
+
+*** New option ~date-tree-last~ for ~org-agenda-insert-diary-strategy~
+
+When ~org-agenda-insert-diary-strategy~ is set to ~date-tree-last~, diary
+entries are added to last in the date tree.
+
+*** New ~vbar~ entity
+
+~\vbar~ or ~\vbar{}~ will be exported unconditionally as a =|=,
+unlike to existing ~\vert~, which is expanded as ~&vert;~ when using
+a HTML derived export back-end.
+
+*** Export
+
+**** New =#+latex_compiler= keyword to set LaTeX compiler.
+
+PDFLaTeX, XeLaTeX, and LuaLaTeX are supported. See the manual for
+details.
+
+**** New option ~org-export-with-broken-links~
+
+This option tells the export process how to behave when encountering
+a broken internal link. See its docstring for more information.
+
+**** Attributes support in custom language environments for LaTeX export
+
+Custom language environments for LaTeX export can now define the
+string to be inserted during export, using attributes to indicate the
+position of the elements. See variable ~org-latex-custom-lang-environments~
+for more details.
+
+**** New Texinfo ~options~ attribute on special blocks
+
+Using ~:options~ as a Texinfo attribute, it is possible to add
+information to custom environments. See manual for details.
+
+**** New HTML ~id~ attributes on special, example and quote blocks
+
+If the block has a =#+NAME:= attribute assigned, then the HTML element
+will have an ~id~ attribute with that name in the HTML export. This
+enables one to create links to these elements in other places, e.g.,
+~<a href="#name">text</a>~.
+
+**** Listings with captions are now numbered in HTML export
+
+The class associated to the numbering is "listing-number". If you
+don't want these blocks to be numbered, as it was the case until now,
+You may want to add ~.listing-number { display: none; }~ to the CSS
+used.
+
+**** Line Numbering in SRC/EXAMPLE blocks support arbitrary start number
+
+The ~-n~ option to ~SRC~ and ~EXAMPLE~ blocks can now take a numeric
+argument to specify the staring line number for the source or example
+block. The ~+n~ option can now take a numeric argument that will be
+added to the last line number from the previous block as the starting
+point for the SRC/EXAMPLE block.
+
+#+BEGIN_SRC org
+,#+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
+#+END_SRC
+
+**** Allow toggling center for images in LaTeX export
+
+With the global variable ~org-latex-images-centered~ or the local
+attribute ~:center~ it is now possible to center an image in LaTeX
+export.
+
+**** Default CSS class ~org-svg~ for SVG images in HTML export
+
+SVG images exported in HTML are now by default assigned a CSS class
+~org-svg~ if no CSS class is specified with the ~:class~ attribute. By
+default, the CSS styling of class ~org-svg~ specifies an image width of
+90\thinsp{}% of the container the image.
+
+**** Markdown footnote export customization
+
+Variables ~org-md-footnotes-section~ and ~org-md-footnote-format~
+introduced for =ox-md.el=. Both new variables define template strings
+which can be used to customize the format of the exported footnotes
+section and individual footnotes, respectively.
+
+*** Babel
+
+**** Blocks with coderefs labels can now be evaluated
+
+The labels are removed prior to evaluating the block.
+
+**** Support for Lua language
+**** Support for SLY in Lisp blocks
+
+See ~org-babel-lisp-eval-fn~ to activate it.
+
+**** Support for Stan language
+
+New ob-stan.el library.
+
+Evaluating a Stan block can produce two different results.
+
+1. Dump the source code contents to a file.
+
+ This file can then be used as a variable in other blocks, which
+ allows interfaces like RStan to use the model.
+
+2. Compile the contents to a model file.
+
+ This provides access to the CmdStan interface. To use this, set
+ ~org-babel-stan-cmdstan-directory~ and provide a ~:file~ argument
+ that does not end in ".stan".
+
+For more information and usage examples, visit
+https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-stan.html
+
+**** Support for Oracle databases via ~sqlplus~
+
+=ob-sql= library supports running SQL blocks against an Oracle
+database using ~sqlplus~. Use with properties like this (all
+mandatory):
+
+#+BEGIN_EXAMPLE
+:engine oracle
+:dbhost <host.com>
+:dbport <1521>
+:dbuser <username>
+:database <database>
+:dbpassword <secret>
+#+END_EXAMPLE
+
+**** Improved support to Microsoft SQL Server via ~sqlcmd~
+
+=ob-sql= library removes support to the ~msosql~ engine which uses the
+deprecated ~osql~ command line tool, and replaces it with ~mssql~
+engine which uses the ~sqlcmd~ command line tool. Use with properties
+like this:
+
+#+BEGIN_EXAMPLE
+:engine mssql
+:dbhost <host.com>
+:dbuser <username>
+:dbpassword <secret>
+:database <database>
+#+END_EXAMPLE
+
+If you want to use the *trusted connection* feature, omit *both* the
+=dbuser= and =dbpassword= properties and add =cmdline -E= to the properties.
+
+If your Emacs is running in a Cygwin environment, the =ob-sql= library
+can pass the converted path to the =sqlcmd= tool.
+
+**** Improved support of header arguments for postgresql
+
+The postgresql engine in a sql code block supports now ~:dbport~ nd
+~:dbpassword~ as header arguments.
+
+**** Support for additional plantuml output formats
+
+The support for output formats of [[https://plantuml.com/][plantuml]] has been extended to now
+include:
+
+All Diagrams:
+- png ::
+- svg ::
+- eps ::
+- pdf ::
+- vdx ::
+- txt :: ASCII art
+- utxt :: ASCII art using unicode characters
+
+Class Diagrams:
+- xmi ::
+- html ::
+
+State Diagrams:
+- scxml ::
+
+The output formats are determined by the file extension specified
+using the :file property, e.g.:
+
+#+begin_src plantuml :file diagram.png
+@startuml
+Alice -> Bob: Authentication Request
+Bob --> Alice: Authentication Response
+
+Alice -> Bob: Another authentication Request
+Alice <-- Bob: another authentication Response
+@enduml
+#+end_src
+
+Please note that *pdf* *does not work out of the box* and needs additional
+setup in addition to plantuml. See [[https://plantuml.com/pdf.html]] for
+details and setup information.
+
+*** Rewrite of radio lists
+
+Radio lists, i.e, Org plain lists in foreign buffers, have been
+rewritten to be on par with Radio tables. You can use a large set of
+parameters to control how a given list should be rendered. See manual
+for details.
+
+*** org-bbdb-anniversaries-future
+
+Used like ~org-bbdb-anniversaries~, it provides a few days warning for
+upcoming anniversaries (default: 7 days).
+
+*** Clear non-repeated SCHEDULED upon repeating a task
+
+If the task is repeated, and therefore done at least one, scheduling
+information is no longer relevant. It is therefore removed.
+
+See [[git:481719fbd5751aaa9c672b762cb43aea8ee986b0][commit message]] for more information.
+
+*** Support for ISO week trees
+
+ISO week trees are an alternative date tree format that orders entries
+by ISO week and not by month.
+
+For example:
+
+: * 2015
+: ** 2015-W35
+: ** 2015-W36
+: *** 2015-08-31 Monday
+
+They are supported in org-capture via ~file+weektree~ and
+~file+weektree+prompt~ target specifications.
+
+*** Accept ~:indent~ parameter when capturing column view
+
+When defining a "columnview" dynamic block, it is now possible to add
+an :indent parameter, much like the one in the clock table.
+
+On the other hand, stars no longer appear in an ITEM field.
+
+*** Columns view
+
+**** ~org-columns~ accepts a prefix argument
+
+When called with a prefix argument, ~org-columns~ apply to the whole
+buffer unconditionally.
+
+**** New variable : ~org-agenda-view-columns-initially~
+
+The variable used to be a ~defvar~, it is now a ~defcustom~.
+
+**** Allow custom summaries
+
+It is now possible to add new summary types, or override those
+provided by Org by customizing ~org-columns-summary-types~, which see.
+
+**** Allow multiple summaries for any property
+
+Columns can now summarize the same property using different summary
+types.
+
+*** Preview LaTeX snippets in buffers not visiting files
+*** New option ~org-attach-commit~
+
+When non-nil, commit attachments with git, assuming the document is in
+a git repository.
+
+*** Allow conditional case-fold searches in ~org-occur~
+
+When set to ~smart~, the new variable ~org-occur-case-fold-search~ allows
+to mimic =isearch.el=: if the regexp searched contains any upper case
+character (or character class), the search is case sensitive.
+Otherwise, it is case insensitive.
+
+*** More robust repeated =ox-latex= footnote handling
+
+Repeated footnotes are now numbered by referring to a label in the
+first footnote.
+
+*** The ~org-block~ face is inherited by ~src-blocks~
+
+This works also when =org-src-fontify-natively= is non-nil. It is also
+possible to specify per-languages faces. See =org-src-block-faces= and
+the manual for details.
+
+*** Links are now customizable
+
+Links can now have custom colors, tooltips, keymaps, display behavior,
+etc. Links are now centralized in ~org-link-parameters~.
+
+** New functions
+
+*** ~org-next-line-empty-p~
+
+It replaces the deprecated ~next~ argument to ~org-previous-line-empty-p~.
+
+*** ~org-show-children~
+
+It is a faster implementation of ~outline-show-children~.
+
+** Removed functions
+
+*** ~org-agenda-filter-by-tag-refine~ has been removed.
+
+Use ~org-agenda-filter-by-tag~ instead.
+
+*** ~org-agenda-todayp~ is deprecated.
+
+Use ~org-agenda-today-p~ instead.
+
+*** ~org-babel-get-header~ is removed.
+
+Use ~org-babel--get-vars~ or ~assq~ instead, as applicable.
+
+*** ~org-babel-trim~ is deprecated.
+
+Use ~org-trim~ instead.
+
+*** ~org-element-remove-indentation~ is deprecated.
+
+Use ~org-remove-indentation~ instead.
+
+*** ~org-image-file-name-regexp~ is deprecated
+
+Use ~image-file-name-regexp~ instead.
+The never-used-in-core ~extensions~ argument has been dropped.
+
+*** ~org-list-parse-list~ is deprecated
+
+Use ~org-list-to-lisp~ instead.
+
+*** ~org-on-heading-p~ is deprecated
+
+A comment to this effect was in the source code since 7.8.03, but
+now a byte-compiler warning will be generated as well.
+
+*** ~org-table-p~ is deprecated
+
+Use ~org-at-table-p~ instead.
+
+*** ~org-table-recognize-table.el~ is deprecated
+
+It was not called by any org code since 2010.
+
+*** Various reimplementations of cl-lib functions are deprecated
+
+The affected functions are:
+- ~org-count~
+- ~org-remove-if~
+- ~org-remove-if-not~
+- ~org-reduce~
+- ~org-every~
+- ~org-some~
+
+Additionally, ~org-sublist~ is deprecated in favor of ~cl-subseq~. Note
+the differences in indexing conventions: ~org-sublist~ is 1-based and
+end-inclusive; ~cl-subseq~ is 0-based and end-exclusive.
+
+** Removed options
+
+*** Remove all options related to ~ido~ or ~iswitchb~
+
+This includes ~org-completion-use-iswitchb~ and ~org-completion-use-ido~.
+Instead Org uses regular functions, e.g., ~completion-read~ so as to
+let those libraries operate.
+
+*** Remove ~org-list-empty-line-terminates-plain-lists~
+
+Two consecutive blank lines always terminate all levels of current
+plain list.
+
+*** ~fixltx2e~ is removed from ~org-latex-default-packages-alist~
+
+fixltx2e is obsolete, see LaTeX News 22.
+
+** Miscellaneous
+*** Add Icelandic smart quotes
+*** Allow multiple receiver locations in radio tables and lists
+*** Allow angular links within link descriptions
+
+It is now allowed to write, e.g.,
+~[[http:orgmode.org][<file:unicorn.png>]]~ as an equivalent to
+~[[http:orgmode.org][file:unicorn.png]]~. The advantage of the former
+is that spaces are allowed within the path.
+
+*** Beamer export back-ends uses ~org-latex-prefer-user-labels~
+*** ~:preparation-function~ called earlier during publishing
+
+Functions in this list are called before any file is associated to the
+current project. Thus, they can be used to generate to be published
+Org files.
+
+*** Function ~org-remove-indentation~ changes.
+
+The new algorithm doesn't remove TAB characters not used for
+indentation.
+
+*** Secure placeholders in capture templates
+
+Placeholders in capture templates are no longer expanded recursively.
+However, ~%(...)~ constructs are expanded very late, so you can fill
+the contents of the S-exp with the replacement text of non-interactive
+placeholders. As before, interactive ones are still expanded as the
+very last step, so the previous statement doesn't apply to them.
+
+Note that only ~%(...)~ placeholders initially present in the
+template, or introduced using a file placeholder, i.e., ~%[...]~ are
+expanded. This prevents evaluating potentially malicious code when
+another placeholder, e.g., ~%i~ expands to a S-exp.
+
+*** Links stored by ~org-gnus-store-link~ in nnir groups
+
+Since gnus nnir groups are temporary, ~org-gnus-store-link~ now refers
+to the article's original group.
+
+*** ~org-babel-check-confirm-evaluate~ is now a function instead of a macro
+
+The calling convention has changed.
+
+*** HTML export table row customization changes
+
+Variable ~org-html-table-row-tags~ has been split into
+~org-html-table-row-open-tag~ and ~org-html-table-row-close-tag~.
+Both new variables can be either a string or a function which will be
+called with 6 parameters.
+
+*** =ITEM= special property returns headline without stars
+*** Rename ~org-insert-columns-dblock~ into ~org-columns-insert-dblock~
+
+The previous name is, for the time being, kept as an obsolete alias.
+
+*** ~org-trim~ can preserve leading indentation.
+
+When setting a new optional argument to a non-nil value, ~org-trim~
+preserves leading indentation while removing blank lines at the
+beginning of the string. The behavior is identical for white space at
+the end of the string.
+
+*** Function ~org-info-export~ changes.
+
+HTML links created from certain info links now point to =gnu.org= URL's rather
+than just to local files. For example info links such as =info:emacs#List
+Buffers= used to be converted to HTML links like this:
+
+: <a href="emacs.html#List-Buffers">emacs#List Buffers</a>
+
+where local file =emacs.html= is referenced.
+For most folks this file does not exist.
+Thus the new behavior is to generate this HTML link instead:
+
+: <a href="https://www.gnu.org/software/emacs/manual/html_mono/emacs.html#List-Buffers">emacs#List Buffers</a>
+
+All emacs related info links are similarly translated plus few other
+=gnu.org= manuals.
+
+*** Repeaters with a ~++~ interval and a time can be shifted to later today
+
+Previously, if a recurring task had a timestamp of
+~<2016-01-01 Fri 20:00 ++1d>~ and was completed on =2016-01-02= at
+=08:00=, the task would skip =2016-01-02= and would be rescheduled for
+=2016-01-03=. Timestamps with ~++~ cookies and a specific time will
+now shift to the first possible future occurrence, even if the
+occurrence is later the same day the task is completed. (Timestamps
+already in the future are still shifted one time further into the
+future.)
+
+*** ~org-mobile-action-alist~ is now a defconst
+
+It used to be a defcustom, with a warning that it shouldn't be
+modified anyway.
+
+*** ~file+emacs~ and ~file+sys~ link types are deprecated
+
+They are still supported in Org 9.0 but will eventually be removed in
+a later release. Use ~file~ link type along with universal arguments
+to force opening it in either Emacs or with system application.
+
+*** New defcustom ~org-babel-J-command~ stores the j command
+*** New defalias ~org-babel-execute:j~
+
+Allows J source blocks be indicated by letter j. Previously the
+indication letter was solely J.
+
+*** ~org-open-line~ ignores tables at the very beginning of the buffer
+
+When ~org-special-ctrl-o~ is non-nil, it is impractical to create
+a blank line above a table at the beginning of the document. Now, as
+a special case, ~org-open-line~ behaves normally in this situation.
+
+*** ~org-babel-hash-show-time~ is now customizable
+
+The experimental variable used to be more or less confidential, as
+a ~defvar~.
+
+*** New ~:format~ property to parsed links
+
+It defines the format of the original link. Possible values are:
+~plain~, ~bracket~ and ~angle~.
+
+* Version 8.3
+
+** Incompatible changes
+
+*** Properties drawers syntax changes
+
+Properties drawers are now required to be located right after a
+headline and its planning line, when applicable.
+
+It will break some documents as TODO states changes were sometimes
+logged before the property drawer.
+
+The following function will repair them:
+
+#+BEGIN_SRC emacs-lisp
+(defun org-repair-property-drawers ()
+ "Fix properties drawers in current buffer.
+Ignore non Org buffers."
+ (when (eq major-mode 'org-mode)
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (let ((case-fold-search t)
+ (inline-re (and (featurep 'org-inlinetask)
+ (concat (org-inlinetask-outline-regexp)
+ "END[ \t]*$"))))
+ (org-map-entries
+ (lambda ()
+ (unless (and inline-re (org-looking-at-p inline-re))
+ (save-excursion
+ (let ((end (save-excursion (outline-next-heading) (point))))
+ (forward-line)
+ (when (org-looking-at-p org-planning-line-re) (forward-line))
+ (when (and (< (point) end)
+ (not (org-looking-at-p org-property-drawer-re))
+ (save-excursion
+ (and (re-search-forward org-property-drawer-re end t)
+ (eq (org-element-type
+ (save-match-data (org-element-at-point)))
+ 'drawer))))
+ (insert (delete-and-extract-region
+ (match-beginning 0)
+ (min (1+ (match-end 0)) end)))
+ (unless (bolp) (insert "\n"))))))))))))
+#+END_SRC
+
+*** Using "COMMENT" is now equivalent to commenting with "#"
+
+If you used "COMMENT" in headlines to prevent a subtree from being
+exported, you can still do it but all information within the subtree
+is now commented out, i.e. no #+OPTIONS line will be parsed or taken
+into account when exporting.
+
+If you want to exclude a headline from export while using its contents
+for setting options, use =:noexport:= (see =org-export-exclude-tags=.)
+
+*** =#+CATEGORY= keywords no longer apply partially to document
+
+It was possible to use several such keywords and have them apply to
+the text below until the next one, but strongly deprecated since Org
+5.14 (2008).
+
+=#+CATEGORY= keywords are now global to the document. You can use node
+properties to set category for a subtree, e.g.,
+
+#+BEGIN_SRC org
+,* Headline
+ :PROPERTIES:
+ :CATEGORY: some category
+ :END:
+#+END_SRC
+
+*** New variable to control visibility when revealing a location
+
+~org-show-following-heading~, ~org-show-siblings~, ~org-show-entry-below~
+and ~org-show-hierarchy-above~ no longer exist. Instead, visibility is
+controlled through a single variable: ~org-show-context-detail~, which
+see.
+
+*** Replace disputed keys again when reading a date
+
+~org-replace-disputed-keys~ has been ignored when reading date since
+version 8.1, but the former behavior is restored again.
+
+Keybinding for reading date can be customized with a new variable
+~org-read-date-minibuffer-local-map~.
+
+*** No default title is provided when =TITLE= keyword is missing
+
+Skipping =TITLE= keyword no longer provides the current file name, or
+buffer name, as the title. Instead, simply ignore the title.
+
+*** Default bindings of =C-c C-n= and =C-c C-p= changed
+
+The key sequences =C-c C-n= and =C-c C-p= are now bound to
+~org-next-visible-heading~ and ~org-previous-visible-heading~
+respectively, rather than the =outline-mode= versions of these
+functions. The Org version of these functions skips over inline tasks
+(and even-level headlines when ~org-odd-levels-only~ is set).
+
+*** ~org-element-context~ no longer return objects in keywords
+
+~org-element-context~ used to return objects on some keywords, i.e.,
+=TITLE=, =DATE= and =AUTHOR=. It now returns only the keyword.
+
+*** ~org-timer-default-timer~ type changed from number to string
+
+If you have, in your configuration, something like =(setq
+org-timer-default-timer 10)= replace it with =(setq
+org-timer-default-timer "10")=.
+
+*** Functions signature changes
+
+The following functions require an additional argument. See their
+docstring for more information.
+
+- ~org-export-collect-footnote-definitions~
+- ~org-html-format-headline-function~
+- ~org-html-format-inlinetask-function~
+- ~org-latex-format-headline-function~
+- ~org-latex-format-inlinetask-function~
+- ~org-link-search~
+
+** New features
+
+*** Default lexical evaluation of emacs-lisp source blocks
+
+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.
+:lexical yes
+
+This turns lexical scoping off in the eval (the former behavior).
+:lexical no
+
+This uses the lexical environment with x=42 in the eval.
+:lexical '((x . 42))
+
+*** Behavior of ~org-return~ changed
+
+If point is before or after the headline title, insert a new line
+without changing the headline.
+
+*** Hierarchies of tags
+
+The functionality of nesting tags in hierarchies is added to Org mode.
+This is the generalization of what was previously called "Tag groups"
+in the manual. That term is now changed to "Tag hierarchy".
+
+The following in-buffer definition:
+
+#+BEGIN_SRC org
+ ,#+TAGS: [ Group : SubOne SubTwo ]
+ ,#+TAGS: [ SubOne : SubOne1 SubOne2 ]
+ ,#+TAGS: [ SubTwo : SubTwo1 SubTwo2 ]
+#+END_SRC
+
+Should be seen as the following tree of tags:
+
+- Group
+ - SubOne
+ - SubOne1
+ - SubOne2
+ - SubTwo
+ - SubTwo1
+ - SubTwo2
+
+Searching for "Group" should return all tags defined above. Filtering
+on SubOne filters also it's sub-tags. Etc.
+
+There is no limit on the depth for the tag hierarchy.
+
+*** Additional syntax for non-unique grouptags
+
+Additional syntax is defined for grouptags if the tags in the group
+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 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:
+
+[ group : sub1 sub2 ]
+
+#+BEGIN_SRC org
+,* Test :sub1:sub2:
+#+END_SRC
+
+This is a more general case than the already existing syntax for
+grouptags; { }.
+
+*** Define regular expression patterns as tags
+
+Tags can be defined as grouptags with regular expressions as
+"sub-tags".
+
+The regular expressions in the group must be marked up within { }.
+Example use:
+
+: #+TAGS: [ Project : {P@.+} ]
+
+Searching for the tag Project will now list all tags also including
+regular expression matches for P@.+. This is good for example for
+projects tagged with a common identifier, i.e. P@2014_OrgTags.
+
+*** Filtering in the agenda on grouptags (Tag hierarchies)
+
+Filtering in the agenda on grouptags filters all of the related tags.
+Except if a filter is applied with a (double) prefix-argument.
+
+Filtering in the agenda on subcategories does not filter the "above"
+levels anymore.
+
+If a grouptag contains a regular expression the regular expression
+is also used as a filter.
+
+*** Minor refactoring of ~org-agenda-filter-by-tag~
+
+Now uses the argument ARG and optional argument exclude instead of
+strip and narrow. ARG because the argument has multiple purposes and
+makes more sense than strip now. The term "narrowing" is changed to
+exclude.
+
+The main purpose is for the function to make more logical sense when
+filtering on tags now when tags can be structured in hierarchies.
+
+*** Babel: support for sed scripts
+
+Thanks to Bjarte Johansen for this feature.
+
+*** Babel: support for Processing language
+
+New ob-processing.el library.
+
+This library implements necessary functions for implementing editing
+of Processing code blocks, viewing the resulting sketches in an
+external viewer, and HTML export of the sketches.
+
+Check the documentation for more details.
+
+Thanks to Jarmo Hurri for this feature.
+
+*** New behavior for ~org-toggle-latex-fragment~
+
+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
+ buffer;
+
+- With a single prefix argument, toggle overlays in the current
+ subtree;
+
+- On latex code, toggle overlay at point;
+
+- Otherwise, toggle overlays in the current section.
+
+*** Additional markup with =#+INCLUDE= keyword
+
+The content of the included file can now be optionally marked up, for
+instance as HTML. See the documentation for details.
+
+*** File links with =#+INCLUDE= keyword
+
+Objects can be extracted via =#+INCLUDE= using file links. It is
+possible to include only the contents of the object. See manual for
+more information.
+
+*** Drawers do not need anymore to be referenced in =#+DRAWERS=
+
+One can use a drawer without listing it in the =#+DRAWERS= keyword,
+which is now obsolete. As a consequence, this change also deprecates
+~org-drawers~ variable.
+
+*** ~org-edit-special~ can edit export blocks
+
+Using C-c ' on an export block now opens a sub-editing buffer. Major
+mode in that buffer is determined by export backend name (e.g.,
+"latex" \to "latex-mode"). You can define exceptions to this rule by
+configuring ~org-src-lang-modes~, which see.
+
+*** Additional =:hline= processing to ob-shell
+
+If the argument =:hlines yes= is present in a babel call, an optional
+argument =:hlines-string= can be used to define a string to use as a
+representation for the lisp symbol ='hline= in the shell program. The
+default is =hline=.
+
+*** Markdown export supports switches in source blocks
+
+For example, it is now possible to number lines using the =-n= switch in
+a source block.
+
+*** New option in ASCII export
+
+Plain lists can have an extra margin by setting ~org-ascii-list-margin~
+variable to an appropriate integer.
+
+*** New blocks in ASCII export
+
+ASCII export now supports =#+BEGIN_JUSTIFYRIGHT= and =#+BEGIN_JUSTIFYLEFT=
+blocks. See documentation for details.
+
+*** More back-end specific publishing options
+
+The number of publishing options specific to each back-end has been
+increased. See manual for details.
+
+*** Export inline source blocks
+
+Inline source code was used to be removed upon exporting. They are
+now handled as standard code blocks, i.e., the source code can appear
+in the output, depending on the parameters.
+
+*** Extend ~org-export-first-sibling-p~ and ~org-export-last-sibling-p~
+
+These functions now support any element or object, not only headlines.
+
+*** New function: ~org-export-table-row-in-header-p~
+
+*** New function: ~org-export-get-reference~
+
+*** New function: ~org-element-lineage~
+
+This function deprecates ~org-export-get-genealogy~. It also provides
+more features. See docstring for details.
+
+*** New function: ~org-element-copy~
+
+*** New filter: ~org-export-filter-body-functions~
+
+Functions in this filter are applied on the body of the exported
+document, before wrapping it within the template.
+
+*** New :environment parameter when exporting example blocks to LaTeX
+
+: #+ATTR_LATEX: :environment myverbatim
+: #+BEGIN_EXAMPLE
+: This sentence is false.
+: #+END_EXAMPLE
+
+will be exported using =@samp(myverbatim)= instead of =@samp(verbatim)=.
+
+*** Various improvements on radio tables
+
+Radio tables feature now relies on Org's export framework ("ox.el").
+~:no-escape~ parameter no longer exists, but additional global
+parameters are now supported: ~:raw~, ~:backend~. Moreover, there are new
+parameters specific to some pre-defined translators, e.g.,
+~:environment~ and ~:booktabs~ for ~orgtbl-to-latex~. See translators
+docstrings (including ~orgtbl-to-generic~) for details.
+
+*** Non-floating minted listings in Latex export
+
+It is not possible to specify =#+attr_latex: :float nil= in conjunction
+with source blocks exported by the minted package.
+
+*** Field formulas can now create columns as needed
+
+Previously, evaluating formulas that referenced out-of-bounds columns
+would throw an error. A new variable ~org-table-formula-create-columns~
+was added to adjust this behavior. It is now possible to silently add
+new columns, to do so with a warning or to explicitly ask the user
+each time.
+
+*** ASCII plot
+
+Ability to plot values in a column through ASCII-art bars. See manual
+for details.
+
+*** New hook: ~org-archive-hook~
+
+This hook is called after successfully archiving a subtree, with point
+on the original subtree, not yet deleted.
+
+*** New option: ~org-attach-archive-delete~
+
+When non-nil, attachments from archived subtrees are removed.
+
+*** New option: ~org-latex-caption-above~
+
+This variable generalizes ~org-latex-table-caption-above~, which is now
+deprecated. In addition to tables, it applies to source blocks,
+special blocks and images. See docstring for more information.
+
+*** New option: ~org-latex-prefer-user-labels~
+
+See the docstring for more information.
+
+*** Export unnumbered headlines
+
+Headlines, for which the property ~UNNUMBERED~ is non-nil, are now
+exported without section numbers irrespective of their levels. The
+property is inherited by children.
+
+*** Tables can be sorted with an arbitrary function
+
+It is now possible to specify a function, both programmatically,
+through a new optional argument, and interactively with ~f~ or ~F~ keys,
+to sort a table.
+
+*** Table of contents can be local to a section
+
+The ~TOC~ keywords now accepts an optional ~local~ parameter. See manual
+for details.
+
+*** Countdown timers can now be paused
+
+~org-timer-pause-time~ now pauses and restarts both relative and
+countdown timers.
+
+*** New option ~only-window~ for ~org-agenda-window-setup~
+
+When ~org-agenda-window-setup~ is set to ~only-window~, the agenda is
+displayed as the sole window of the current frame.
+
+*** ~{{{date}}}~ macro supports optional formatting argument
+
+It is now possible to supply and optional formatting argument to
+~{{{date}}}~. See manual for details.
+
+*** ~{{{property}}}~ macro supports optional search argument
+
+It is now possible to supply an optional search option to
+~{{{property}}}~ in order to retrieve remote properties optional. See
+manual for details.
+
+*** New option ~org-export-with-title~
+
+It is possible to suppress the title insertion with ~#+OPTIONS:
+title:nil~ or globally using the variable ~org-export-with-title~.
+
+*** New entities family: "\_ "
+
+"\_ " are used to insert up to 20 contiguous spaces in various
+back-ends. In particular, this family can be used to introduce
+leading spaces within table cells.
+
+*** New MathJax configuration options
+
+Org uses the MathJax CDN by default. See the manual and the docstring
+of ~org-html-mathjax-options~ for details.
+
+*** New behavior in `org-export-options-alist'
+
+When defining a back-end, it is now possible to specify to give
+`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
+=:EXPORT_KEYWORD:= property, which can be used to override the keyword
+value during a subtree export. Moreover, macros are expanded in such
+keywords and properties.
+
+*** Viewport support in html export
+
+Viewport for mobile-optimized website is now automatically inserted
+when exporting to html. See ~org-html-viewport~ for details.
+
+*** New ~#+SUBTITLE~ export keyword
+
+Org can typeset a subtitle in some export backends. See the manual
+for details.
+
+*** Remotely edit a footnote definition
+
+Calling ~org-edit-footnote-reference~ (C-c ') on a footnote reference
+allows to edit its definition, as long as it is not anonymous, in a
+dedicated buffer. It works even if buffer is currently narrowed.
+
+*** New function ~org-delete-indentation~ bound to ~M-^~
+
+Work as ~delete-indentation~ unless at heading, in which case text is
+added to headline text.
+
+*** Support for images in Texinfo export
+
+~Texinfo~ back-end now handles images. See the manual for details.
+
+*** Support for captions in Texinfo export
+
+Tables and source blocks can now have captions. Additionally, lists
+of tables and lists of listings can be inserted in the document with
+=#+TOC= keyword.
+
+*** Countdown timer support hh:mm:ss format
+
+In addition to setting countdown timers in minutes, they can also be
+set using the hh:mm:ss format.
+
+*** Extend ~org-clone-subtree-with-time-shift~
+
+~org-clone-subtree-with-time-shift~ now accepts 0 as an argument for the
+number of clones, which removes the repeater from the original subtree
+and creates one shifted, repeating clone.
+
+*** New time block for clock tables: ~untilnow~
+
+It encompasses all past closed clocks.
+
+*** Support for the ~polyglossia~ LaTeX package
+
+See the docstring of ~org-latex-classes~ and
+~org-latex-guess-polyglossia-language~ for details.
+
+*** None-floating tables, graphics and blocks can have captions
+
+*** `org-insert-heading' can be forced to insert top-level headline
+
+** Removed functions
+
+*** Removed function ~org-translate-time~
+
+Use ~org-timestamp-translate~ instead.
+
+*** Removed function ~org-beamer-insert-options-template~
+
+This function inserted a Beamer specific template at point or in
+current subtree. Use ~org-export-insert-default-template~ instead, as
+it provides more features and covers all export back-ends. It is also
+accessible from the export dispatcher.
+
+*** Removed function ~org-timer-cancel-timer~
+
+~org-timer-stop~ now stops both relative and countdown timers.
+
+*** Removed function ~org-export-solidify-link-text~
+
+This function, being non-bijective, introduced bug in internal
+references. Use ~org-export-get-reference~ instead.
+
+*** Removed function ~org-end-of-meta-data-and-drawers~
+
+The function is superseded by ~org-end-of-meta-data~, called with an
+optional argument.
+
+*** Removed functions ~org-table-colgroup-line-p~, ~org-table-cookie-line-p~
+
+These functions were left-over from pre 8.0 era. They are not correct
+anymore. Since they are not needed, they have no replacement.
+
+** Removed options
+
+*** ~org-list-empty-line-terminates-plain-lists~ is deprecated
+
+It will be kept in code base until next release, for backward
+compatibility.
+
+If you need to separate consecutive lists with blank lines, always use
+two of them, as if this option was nil (default value).
+
+*** ~org-export-with-creator~ is a boolean
+
+Special ~comment~ value is no longer allowed. It is possible to use a
+body filter to add comments about the creator at the end of the
+document instead.
+
+*** Removed option =org-html-use-unicode-chars=
+
+Setting this to non-nil was problematic as it converted characters
+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 behavior is to use the value
+of =shell-file-name= directly when the shell language is =shell=. To chose
+a different shell, either customize =shell-file-name= or bind this
+variable locally.
+
+*** Removed option =org-babel-sh-var-quote-fmt=
+
+This undocumented option was supposed to provide different quoting
+styles when changing the shell type. Changing the shell type can now
+be done directly from the source block and the quoting style has to be
+compatible across all shells, so a customization doesn't make sense
+anymore. The chosen hard coded quoting style conforms to POSIX.
+
+*** Removed option ~org-insert-labeled-timestamps-at-point~
+
+Setting this option to anything else that the default value (nil)
+would create invalid planning info. This dangerous option is now
+removed.
+
+*** Removed option ~org-koma-letter-use-title~
+
+Use org-export-with-title instead. See also below.
+
+*** Removed option ~org-entities-ascii-explanatory~
+
+This variable has no effect since Org 8.0.
+
+*** Removed option ~org-table-error-on-row-ref-crossing-hline~
+
+This variable has no effect since August 2009.
+
+*** Removed MathML-related options from ~org-html-mathjax-options~
+
+MathJax automatically chooses the best display technology based on the
+end-users browser. You may force initial usage of MathML via
+~org-html-mathjax-template~ or by setting the ~path~ property of
+~org-html-mathjax-options~.
+
+*** Removed comment-related filters
+
+~org-export-filter-comment-functions~ and
+~org-export-filter-comment-block-functions~ variables do not exist
+anymore.
+
+** Miscellaneous
+
+*** Strip all meta data from ITEM special property
+
+ITEM special property does not contain TODO, priority or tags anymore.
+
+*** File names in links accept are now compatible with URI syntax
+
+Absolute file names can now start with =///= in addition to =/=. E.g.,
+=[[file:///home/me/unicorn.jpg]]=.
+
+*** Footnotes in included files are now local to the file
+
+As a consequence, it is possible to include multiple Org files with
+footnotes in a master document without being concerned about footnote
+labels colliding.
+
+*** Mailto links now use regular URI syntax
+
+This change deprecates old Org syntax for mailto links:
+=mailto:user@domain::Subject=.
+
+*** =QUOTE= keywords do not exist anymore
+
+=QUOTE= keywords have been deprecated since Org 8.2.
+
+*** Select tests to perform with the build system
+
+The build system has been enhanced to allow test selection with a
+regular expression by defining =BTEST_RE= during the test invocation.
+This is especially useful during bisection to find just when a
+particular test failure was introduced.
+
+*** Exact heading search for external links ignore spaces and cookies
+
+Exact heading search for links now ignore spaces and cookies. This is
+the case for links of the form ~file:projects.org::*task title~, as well
+as links of the form ~file:projects.org::some words~ when
+~org-link-search-must-match-exact-headline~ is not nil.
+
+*** ~org-latex-hyperref-template~, ~org-latex-title-command~ formatting
+
+New formatting keys are supported. See the respective docstrings.
+Note, ~org-latex-hyperref-template~ has a new default value.
+
+*** ~float, wasysym, marvosym~ are removed from ~org-latex-default-packages-alist~
+
+If you require any of these package add them to your preamble via
+~org-latex-packages-alist~. Org also uses default LaTeX ~\tolerance~ now.
+
+*** When exporting, throw an error on unresolved id/fuzzy links and code refs
+
+This helps spotting wrong links.
+
+* Version 8.2
+
+** Incompatible changes
+*** =ob-sh.el= renamed to =ob-shell=
+This may require two changes in user config.
+
+1. In =org-babel-do-load-languages=, change =(sh . t)= to =(shell . t)=.
+2. Edit =local.mk= files to change the value of =BTEST_OB_LANGUAGES=
+ to remove "sh" and include "shell".
+
+*** Combine org-mac-message.el and org-mac-link-grabber into org-mac-link.el
+
+Please remove calls to =(require 'org-mac-message)= and =(require
+'org-mac-link-grabber)= in your =.emacs= initialization file. All you
+need now is =(require 'org-mac-link)=.
+
+Additionally, replace any calls to =ogml-grab-link= to
+=org-mac-grab-link=. For example, replace this line:
+
+: (define-key org-mode-map (kbd "C-c g") 'omgl-grab-link)
+
+with this:
+
+: (define-key org-mode-map (kbd "C-c g") 'org-mac-grab-link)
+
+*** HTML export: Replace =HTML_HTML5_FANCY= by =:html-html5-fancy= (...)
+
+Some of the HTML specific export options in Org <8.1 are either nil or
+t, like =#+HTML_INCLUDE_STYLE=. We replaced these binary options with
+option keywords like :html-include-style.
+
+So you need to replace
+
+: #+HTML_INCLUDE_STYLE: t
+
+by
+
+: #+OPTIONS: :html-include-style t
+
+Options affected by this change: =HTML5_FANCY=, =HTML_INCLUDE_SCRIPTS=
+and =HTML_INCLUDE_STYLE=.
+
+*** Add an argument to ~org-export-to-file~ and ~org-export-to-buffer~
+
+~org-export-to-file~ and ~org-export-to-file~ can run in a different
+process when provided a non-nil =ASYNC= optional argument, without
+relying on ~org-export-async-start~ macro.
+
+Since =ASYNC= is the first of optional arguments, you have to shift
+the other optional arguments accordingly.
+
+*** Export back-ends are now structures
+
+Export back-ends are now structures, and stored as such in the
+communication channel during an export process. In other words, from
+now on, ~(plist-get info :back-end)~ will return a structure instead
+of a symbol.
+
+Arguments in hooks and in filters are still symbols, though.
+
+** Important bugfixes
+
+*** [[doc:org-insert-heading][org-insert-heading]] has been rewritten and bugs are now fixed
+*** The replacement of disputed keys is now turned of when reading a date
+
+*** Match string for sparse trees can now contain a slash in a property value
+
+ You can now have searches like SOMEPROP="aaa/bbb". Until now,
+ this would break because the slash would be interpreted as the
+ separator starting a TOTO match string.
+** New features
+
+*** =C-c ^ x= will now sort checklist items by their checked status
+
+See [[doc:org-sort-list][org-sort-list]]: hitting =C-c ^ x= will put checked items at the end
+of the list.
+*** Various LaTeX export enhancements
+
+- Support SVG images
+- Support for .pgf files
+- LaTeX Babel blocks can now be exported as =.tikz= files
+- Allow =latexmk= as an option for [[doc:org-latex-pdf-process][org-latex-pdf-process]]
+- When using =\usepackage[AUTO]{babel}=, AUTO will automatically be
+ replaced with a value compatible with ~org-export-default-language~
+ or ~LANGUAGE~ keyword.
+- The dependency on the =latexsym= LaTeX package has been removed, we
+ now use =amssymb= symbols by default instead.
+
+*** New functions for paragraph motion
+
+ The commands =C-down= and =C-up= now invoke special commands
+ that use knowledge from the org-elements parser to move the cursor
+ in a paragraph-like way.
+
+*** New entities in =org-entities.el=
+
+Add support for ell, imath, jmath, varphi, varpi, aleph, gimel, beth,
+dalet, cdots, S (§), dag, ddag, colon, therefore, because, triangleq,
+leq, geq, lessgtr, lesseqgtr, ll, lll, gg, ggg, prec, preceq,
+preccurlyeq, succ, succeq, succurlyeq, setminus, nexist(s), mho,
+check, frown, diamond. Changes loz, vert, checkmark, smile and tilde.
+
+*** Anonymous export back-ends
+
+~org-export-create-backend~ can create anonymous export back-ends,
+which can then be passed to export functions like
+~org-export-to-file~, ~org-export-to-buffer~ or ~org-export-as~.
+
+It allows for quick translation of Org syntax without the overhead of
+registering a new back-end.
+
+*** New agenda fortnight view
+
+ The agenda has not, in addition to day, week, month, and year
+ views, also a fortnight view covering 14 days.
+** New options
+
+*** New option [[doc:org-bookmark-names-plist][org-bookmark-names-plist]]
+
+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 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
+the =#+OPTIONS= line(s) or within a [[doc:org-publish-project-alist][org-publish-project-alist]].
+
+Setting this option to =t= is needed when the HTML output does not
+allow relative URLs. For example, the =contrib/lisp/ox-rss.el=
+library produces a RSS feed, and RSS feeds need to use absolute URLs,
+so a combination of =:html-link-home "..." and :html-link-use-abs-url
+t= is required---see the configuration example in the comment section
+of =ox-rss.el=.
+
+*** New option [[doc:org-babel-ditaa-java-cmd][org-babel-ditaa-java-cmd]]
+
+This makes java executable configurable for ditaa blocks.
+
+*** New options [[doc:org-babel-latex-htlatex][org-babel-latex-htlatex]] and [[doc:org-babel-latex-htlatex-packages][org-babel-latex-htlatex-packages]]
+
+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/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]]
+
+If you set this to the following
+
+: (setq org-babel-inline-result-wrap "$%s$")
+
+then inline code snippets will be wrapped into the formatting string.
+
+*** New option: [[doc:org-special-ctrl-o][org-special-ctrl-o]]
+
+ This variable can be used to turn off the special behavior of
+ =C-o= in tables.
+** New contributed packages
+
+- =ox-bibtex.el= by Nicolas Goaziou :: an utility to handle BibTeX
+ export to both LaTeX and HTML exports. It uses the [[https://www.lri.fr/~filliatr/bibtex2html/][bibtex2html]]
+ software.
+
+- =org-screenshot.el= by Max Mikhanosha :: an utility to handle
+ screenshots easily from Org, using the external tool [[https://freecode.com/projects/scrot][scrot]].
+
+** Miscellaneous
+
+*** "QUOTE" keywords in headlines are deprecated
+
+"QUOTE" keywords are an undocumented feature in Org. When a headline
+starts with the keyword "QUOTE", its contents are parsed as
+a ~quote-section~ and treated as an example block. You can achieve
+the same with example blocks.
+
+This feature is deprecated and will be removed in the next Org
+release.
+
+* Version 8.0.1
+
+** Installation
+
+Installation instructions have been updated and simplified.
+
+If you have troubles installing or updating Org, focus on these
+instructions:
+
+- when updating via a =.zip/.tar.gz= file, you only need to set the
+ =load-path= in your =.emacs=. Set it before any other Org
+ customization that would call autoloaded Org functions.
+
+- when updating by pulling Org's Git repository, make sure to create the
+ correct autoloads. You can do this by running =~$ make autoloads= (to
+ only create the autoloads) or by running =~$ make= (to also compile
+ the Emacs lisp files.) =~$ make help= and =~$ make helpall= gives you
+ detailed explanations.
+
+- when updating through ELPA (either from GNU ELPA or from Org ELPA),
+ you have to install Org's ELPA package in a session where no Org
+ function has been called already.
+
+When in doubt, run =M-x org-version RET= and see if you have a mixed-up
+installation.
+
+See https://orgmode.org/org.html#Installation for details.
+
+** Incompatible changes
+
+Org 8.0 is the most disruptive major version of Org.
+
+If you configured export options, you will have to update some of them.
+
+If you used =#+ATTR_*= keywords, the syntax of the attributes changed and
+you will have to update them.
+
+Below is a list of changes for which you need to take action.
+
+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
+
+Org 8.0 comes with a new export engine written by Nicolas Goaziou. This
+export engine relies on ~org-element.el~ (Org's syntax parser), which was
+already in Org's core. This new export engine triggered the rewriting of
+/all/ export back-ends.
+
+The most visible change is the export dispatcher, accessible through the
+keybinding =C-c C-e=. By default, this menu only shows some of the
+built-in export formats, but you can add more formats by loading them
+directly (e.g., =(require 'ox-texinfo)= or by configuring the option
+[[doc:org-export-backends][org-export-backends]].
+
+More contributed back-ends are available from the =contrib/= directory, the
+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 [[https://orgmode.org/worg/org-8.0.html][this Worg page]] for directions.
+
+**** New syntax for #+ATTR_HTML/LaTeX/... options
+
+ : #+ATTR_HTML width="200px"
+
+ should now be written
+
+ : #+ATTR_HTML :width 200px
+
+ Keywords like =#+ATTR_HTML= and =#+ATTR_LaTeX= are defined in their
+ respective back-ends, and the list of supported parameters depends on
+ each backend. See Org's manual for details.
+
+**** ~org-remember.el~ has been removed
+
+ You cannot use =remember.el= anymore to capture notes.
+
+ Support for remember templates has been obsoleted since long, it is
+ now fully removed.
+
+ Use =M-x org-capture-import-remember-templates RET= to import your
+ remember templates into capture templates.
+
+**** ~org-jsinfo.el~ has been merged into ~ox-html.el~
+
+ If you were requiring ~ox-jsinfo.el~ in your ~.emacs.el~ file, you
+ will have to remove this requirement from your initialization file.
+
+**** Note for third-party developers
+
+ The name of the files for export back-end have changed: we now use the
+ prefix =ox-= for those files (like we use the =ob-= prefix for Babel
+ files.) For example ~org-html.el~ is now ~ox-html.el~.
+
+ If your code relies on these files, please update the names in your
+ code.
+
+**** Packages moved from core to contrib
+
+ Since packages in Org's core are meant to be part of GNU Emacs, we try
+ to be minimalist when it comes to adding files into core. For 8.0, we
+ moved some contributions into the =contrib/= directory.
+
+ The rationale for deciding that these files should live in =contrib/=
+ is either because they rely on third-party software that is not
+ included in Emacs, or because they are not targeting a significant
+ user-base.
+
+ - org-colview-xemacs.el
+ - org-mac-message.el
+ - org-mew.el
+ - org-wl.el
+ - ox-freedmind.el
+ - ox-taskjuggler.el
+
+ Note that ~ox-freedmind.el~ has been rewritten by Jambunathan,
+ ~org-mew.el~ has been enhanced by Tokuya Kameshima and
+ ~ox-taskjuggler.el~ by Nicolas Goaziou and others.
+
+ Also, the Taskjuggler exporter now uses TJ3 by default. John Hendy
+ wrote [[https://orgmode.org/worg/org-tutorials/org-taskjuggler3.html][a tutorial on Worg]] for the TJ3 export.
+
+** New packages in core
+
+*** ~ob-makefile.el~ by Eric Schulte and Thomas S. Dye
+
+ =ob-makefile.el= implements Org Babel support for Makefile tangling.
+
+*** ~ox-man.el~ by Luis Anaya
+
+ =ox-man.el= allows you to export Org files to =man= pages.
+
+*** ~ox-md.el~ by Nicolas Goaziou
+
+ =ox-md.el= allows you to export Org files to Markdown files, using the
+ vanilla [[https://daringfireball.net/projects/markdown/][Markdown syntax]].
+
+*** ~ox-texinfo.el~ by Jonathan Leech-Pepin
+
+ =ox-texinfo.el= allows you to export Org files to [[https://www.gnu.org/software/texinfo/][Texinfo]] files.
+
+** New packages in contrib
+
+*** ~ob-julia.el~ by G. Jay Kerns
+
+ [[https://julialang.org/][Julia]] is a new programming language.
+
+ =ob-julia.el= provides Org Babel support for evaluating Julia source
+ code.
+
+*** ~ob-mathomatic.el~ by Luis Anaya
+
+ [[https://www.mathomatic.org/][mathomatic]] a portable, command-line, educational CAS and calculator
+ software, written entirely in the C programming language.
+
+ ~ob-mathomatic.el~ provides Org Babel support for evaluating mathomatic
+ entries.
+
+*** ~ob-tcl.el~ by Luis Anaya
+
+ ~ob-tcl.el~ provides Org Babel support for evaluating [[https://www.tcl.tk/][Tcl]] source code.
+
+*** ~org-bullets.el~ by Evgeni Sabof
+
+ Display bullets instead of stars for headlines.
+
+ Also see [[https://orgmode.org/worg/org-faq.html#sec-8-12][this updated FAQ]] on how to display another character than "*"
+ for starting headlines.
+
+*** ~org-favtable.el~ by Marc-Oliver Ihm
+
+ ~org-favtable.el~ helps you to create and update a table of favorite
+ locations in org, keeping the most frequently visited lines right at
+ the top. This table is called "favtable". See the documentation on
+ [[https://orgmode.org/worg/org-contrib/org-favtable.html][Worg]].
+
+*** ~ox-confluence.el~ by Sébastien Delafond
+
+ ~ox-confluence.el~ lets you convert Org files to [[https://confluence.atlassian.com/display/DOC/Confluence%2BWiki%2BMarkup][Confluence Wiki]] files.
+
+*** ~ox-deck.el~ and ~ox-s5.el~ by Rick Frankel
+
+ [[http://imakewebthings.com/deck.js/][deck.js]] is a javascript library for displaying HTML ages as
+ presentations. ~ox-deck.el~ exports Org files to HTML presentations
+ using =deck.js=.
+
+ [[https://meyerweb.com/eric/tools/s5/][s5]] is a set of scripts which also allows to display HTML pages as
+ presentations. ~ox-s5.el~ exports Org files to HTML presentations
+ using =s5=.
+
+*** ~ox-groff.el~ by Luis Anaya and Nicolas Goaziou
+
+ The [[https://www.gnu.org/software/groff/][groff]] (GNU troff) software is a typesetting package which reads
+ plain text mixed with formatting commands and produces formatted
+ output.
+
+ Luis Anaya and Nicolas Goaziou implemented ~ox-groff.el~ to allow
+ conversion from Org files to groff.
+
+*** ~ox-koma-letter.el~ by Nicolas Goaziou and Alan Schmitt
+
+ This back-end allow to export Org pages to the =KOMA Scrlttr2= format.
+
+*** ~ox-rss.el~ by Bastien
+
+ This back-end lets you export Org pages to RSS 2.0 feeds. Combined
+ with the HTML publishing feature, this allows you to build a blog
+ entirely with Org.
+
+** New features
+
+*** Export
+
+**** New export generic options
+
+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:
+
+- [[doc:org-export-allow-bind-keywords][org-export-allow-bind-keywords]] :: This option replaces the old option
+ =org-export-allow-BIND= and the default value is =nil=, not =confirm=.
+ You will need to explicitly set this to =t= in your initialization
+ file if you want to allow =#+BIND= keywords.
+
+- [[doc:org-export-with-planning][org-export-with-planning]] :: This new option controls the export of
+ =SCHEDULED:, DEADLINE:, CLOSED:= lines, and planning information is
+ now skipped by default during export. This use to be the job of
+ [[doc:org-export-with-timestamps][org-export-with-timestamps]], but this latter option has been given a
+ new role: it controls the export of /standalone time-stamps/. When
+ set to =nil=, Org will not export active and inactive time-stamps
+ standing on a line by themselves or within a paragraph that only
+ contains time-stamps.
+
+To check if an option has been introduced or its default value changed in
+Org 8.0, do =C-h v [option] RET= and check if the documentation says that
+the variable has been introduced (or changed) in version 24.4 of Emacs.
+
+**** Enhanced default stylesheet for the HTML exporter
+
+See the new default value of [[doc:org-html-style-default][org-html-style-default]].
+
+**** New tags, classes and ids for the HTML exporter
+
+See the new default value of [[doc:org-html-divs][org-html-divs]].
+
+**** Support for tikz pictures in LaTeX export
+**** ~org-man.el~: New export function for "man" links
+**** ~org-docview.el~: New export function for docview links
+*** Structure editing
+
+**** =C-u C-u M-RET= inserts a heading at the end of the parent subtree
+**** Cycling to the =CONTENTS= view keeps inline tasks folded
+
+[[doc:org-cycle-hook][org-cycle-hook]] as a new function [[doc:org-cycle-hide-inline-tasks][org-cycle-hide-inline-tasks]] which
+prevents the display of inline tasks when showing the content of a subtree.
+
+**** =C-c -= in a region makes a list item for each line
+
+This is the opposite of the previous behavior, where =C-c -= on a region
+would create one item for the whole region, and where =C-u C-c -= would
+create an item for each line. Now =C-c -= on the selected region creates
+an item per line, and =C-u C-c -= creates a single item for the whole
+region.
+
+**** When transposing words, markup characters are now part of the words
+
+In Emacs, you can transpose words with =M-t=. Transposing =*these*
+_words__= will preserve markup.
+
+**** New command [[doc:org-set-property-and-value][org-set-property-and-value]] bound to =C-c C-x P=
+
+This command allows you to quickly add both the property and its value. It
+is useful in buffers where there are many properties and where =C-c C-x p=
+can slow down the flow of editing too much.
+
+**** New commands [[doc:org-next-block][org-next-block]] and [[doc:org-previous-block][org-previous-block]]
+
+These commands allow you to go to the previous block (=C-c M-b= or the
+speedy key =B=) or to the next block (=C-c M-f= or the speedy key =F=.)
+
+**** New commands [[doc:org-drag-line-forward][org-drag-line-forward]] and [[doc:org-drag-line-backward][org-drag-line-backward]]
+
+These commands emulate the old behavior of =M-<down>= and =M-<up>= but are
+now bound to =S-M-<down>= and =S-M-<up>= respectively, since =M-<down>= and
+=M-<up>= now drag the whole element at point (a paragraph, a table, etc.)
+forward and backward.
+
+**** When a list item has a checkbox, inserting a new item uses a checkbox too
+**** When sorting entries/items, only the description of links is considered
+
+Now Org will sort this list
+
+: - [[https://abc.org][B]]
+: - [[https://def.org][A]]
+
+like this:
+
+: - [[https://def.org][A]]
+: - [[https://abc.org][B]]
+
+by comparing the descriptions, not the links.
+Same when sorting headlines instead of list items.
+**** New option =orgstruct-heading-prefix-regexp=
+
+For example, setting this option to "^;;; " in Emacs lisp files and using
+=orgstruct-mode= in those files will allow you to cycle through visibility
+states as if lines starting with ";;; *..." where headlines.
+
+In general, you want to set =orgstruct-heading-prefix-regexp= as a file
+local variable.
+
+**** New behavior of [[doc:org-clone-subtree-with-time-shift][org-clone-subtree-with-time-shift]]
+
+The default is now to ask for a time-shift only when there is a time-stamp.
+When called with a universal prefix argument =C-u=, it will not ask for a
+time-shift even if there is a time-stamp.
+
+**** New option [[doc:org-agenda-restriction-lock-highlight-subtree][org-agenda-restriction-lock-highlight-subtree]]
+
+This defaults to =t= so that the whole subtree is highlighted when you
+restrict the agenda view to it with =C-c C-x <= (or the speed command =<=).
+The default setting helps ensuring that you are not adding tasks after the
+restricted region. If you find this highlighting too intrusive, set this
+option to =nil=.
+**** New option [[doc:org-closed-keep-when-no-todo][org-closed-keep-when-no-todo]]
+
+When switching back from a =DONE= keyword to a =TODO= keyword, Org now
+removes the =CLOSED= planning information, if any. It also removes this
+information when going back to a non-TODO state (e.g., with =C-c C-t SPC=).
+If you want to keep the =CLOSED= planning information when removing the
+TODO keyword, set [[doc:org-closed-keep-when-no-todo][org-closed-keep-when-no-todo]] to =t=.
+
+**** New option [[doc:org-image-actual-width][org-image-actual-width]]
+
+This option allows you to change the width of in-buffer displayed images.
+The default is to use the actual width of the image, but you can use a
+fixed value for all images, or fall back on an attribute like
+
+: #+attr_html: :width 300px
+*** Scheduled/deadline
+
+**** Implement "delay" cookies for scheduled items
+
+If you want to delay the display of a scheduled task in the agenda, you can
+now use a delay cookie like this: =SCHEDULED: <2004-12-25 Sat -2d>=. The
+task is still scheduled on the 25th but will appear in your agenda starting
+from two days later (i.e. from March 27th.)
+
+Imagine for example that your co-workers are not done in due time and tell
+you "we need two more days". In that case, you may want to delay the
+display of the task in your agenda by two days, but you still want the task
+to appear as scheduled on March 25th.
+
+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 [[doc:org-scheduled-delay-days][org-scheduled-delay-days]]
+and [[doc:org-agenda-skip-scheduled-delay-if-deadline][org-agenda-skip-scheduled-delay-if-deadline]] for details on how to
+control this globally or per agenda.
+
+**** Use =C-u C-u C-c C-s= will insert a delay cookie for scheduled tasks
+
+See the previous section for why delay cookies may be useful.
+
+**** Use =C-u C-u C-c C-d= will insert a warning delay for deadline tasks
+
+=C-u C-u C-c C-d= now inserts a warning delay to deadlines.
+*** Calendar, diary and appts
+
+**** New variable [[doc:org-read-date-minibuffer-local-map][org-read-date-minibuffer-local-map]]
+
+By default, this new local map uses "." to go to today's date, like in the
+normal =M-x calendar RET=. If you want to deactivate this and to reassign
+the "@" key to =calendar-goto-today=, use this:
+
+#+BEGIN_SRC emacs-lisp
+ ;; Unbind "." in Org's calendar:
+ (define-key org-read-date-minibuffer-local-map (kbd ".") nil)
+
+ ;; Bind "@" to `calendar-goto-today':
+ (define-key org-read-date-minibuffer-local-map
+ (kbd "@")
+ (lambda () (interactive) (org-eval-in-calendar '(calendar-goto-today))))
+#+END_SRC
+
+**** In Org's calendar, =!= displays diary entries of the date at point
+
+This is useful when you want to check if you don't already have an
+appointment when setting new ones with =C-c .= or =C-c s=. =!= will
+call =diary-view-entries= and display the diary in a separate buffer.
+
+**** [[doc:org-diary][org-diary]]: only keep the descriptions of links
+
+[[doc:org-diary][org-diary]] returns diary information from Org files, but it returns it
+in a diary buffer, not in an Org mode buffer. When links are displayed,
+only show their description, not the full links.
+*** Agenda
+
+**** New agenda type =agenda*= and entry types =:scheduled* :deadline*=
+
+When defining agenda custom commands, you can now use =agenda*=: this will
+list entries that have both a date and a time. This is useful when you
+want to build a list of appointments.
+
+You can also set [[doc:org-agenda-entry-types][org-agenda-entry-types]] either globally or locally in
+each agenda custom command and use =:timestamp*= and/or =:deadline*= there.
+
+Another place where this is useful is your =.diary= file:
+
+: %%(org-diary :scheduled*) ~/org/rdv.org
+
+This will list only entries from =~/org/rdv.org= that are scheduled with a
+time value (i.e. appointments).
+
+**** New agenda sorting strategies
+
+[[doc:org-agenda-sorting-strategy][org-agenda-sorting-strategy]] allows these new sorting strategies:
+
+| Strategy | Explanations |
+|----------------+------------------------------------------|
+| 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 |
+
+**** New options to limit the number of agenda entries
+
+You can now limit the number of entries in an agenda view. This is
+different from filters: filters only /hide/ the entries in the agenda,
+while limits are set while generating the list of agenda entries.
+
+These new options are available:
+
+- [[doc:org-agenda-max-entries][org-agenda-max-entries]] :: limit by number of entries.
+- [[doc:org-agenda-max-todos][org-agenda-max-todos]] :: limit by number of TODOs.
+- [[doc:org-agenda-max-tags][org-agenda-max-tags]] :: limit by number of tagged entries.
+- [[doc:org-agenda-max-effort][org-agenda-max-effort]] :: limit by effort (minutes).
+
+For example, if you locally set [[doc:org-agenda-max-todos][org-agenda-max-todos]] to 3 in an agenda
+view, the agenda will be limited to the first three todos. Other entries
+without a TODO keyword or beyond the third TODO headline will be ignored.
+
+When setting a limit (e.g. about an effort's sum), the default behavior is
+to exclude entries that cannot be checked against (e.g. entries that have
+no effort property.) To include other entries too, you can set the limit
+to a negative number. For example =(setq org-agenda-max-tags -3)= will not
+show the fourth tagged headline (and beyond), but it will also show
+non-tagged headlines.
+
+**** =~= in agenda view sets temporary limits
+
+You can hit =~= in the agenda to temporarily set limits: this will
+regenerate the agenda as if the limits were set. This is useful for
+example when you want to only see a list of =N= tasks, or a list of tasks
+that take only =N= minutes.
+
+**** "=" in agenda view filters by regular expressions
+
+You can now filter agenda entries by regular expressions using ~=~. =C-u
+== will filter entries out. Regexp filters are cumulative. You can set
+[[doc:org-agenda-regexp-filter-preset][org-agenda-regexp-filter-preset]] to suit your needs in each agenda view.
+
+**** =|= in agenda view resets all filters
+
+Since it's common to combine tag filters, category filters, and now regexp
+filters, there is a new command =|= to reset all filters at once.
+
+**** Allow writing an agenda to an =.org= file
+
+You can now write an agenda view to an =.org= file. It copies the
+headlines and their content (but not subheadings) into the new file.
+
+This is useful when you want to quickly share an agenda containing the full
+list of notes.
+
+**** New commands to drag an agenda line forward (=M-<down>=) or backward (=M-<up>=)
+
+It sometimes handy to move agenda lines around, just to quickly reorganize
+your tasks, or maybe before saving the agenda to a file. Now you can use
+=M-<down>= and =M-<up>= to move the line forward or backward.
+
+This does not persist after a refresh of the agenda, and this does not
+change the =.org= files who contribute to the agenda.
+
+**** Use =%b= for displaying "breadcrumbs" in the agenda view
+
+[[doc:org-agenda-prefix-format][org-agenda-prefix-format]] now allows to use a =%b= formatter to tell Org
+to display "breadcrumbs" in the agenda view.
+
+This is useful when you want to display the task hierarchy in your agenda.
+
+**** Use =%l= for displaying the headline's level in the agenda view
+
+[[doc:org-agenda-prefix-format][org-agenda-prefix-format]] allows to use a =%l= formatter to tell Org to
+display entries with additional spaces corresponding to their level in the
+outline tree.
+
+**** [[doc:org-agenda-write][org-agenda-write]] will ask before overwriting an existing file
+
+=M-x org-agenda-write RET= (or =C-c C-w= from an agenda buffer) used to
+overwrite preexisting file with the same name without confirmation. It now
+asks for a confirmation.
+
+**** New commands =M-m= and =M-*= to toggle (all) mark(s) for bulk action
+
+- [[doc:org-agenda-bulk-toggle][org-agenda-bulk-toggle]] :: this command is bound to =M-m= and toggles
+ the mark of the entry at point.
+
+- [[doc:org-agenda-bulk-toggle-all][org-agenda-bulk-toggle-all]] :: this command is bound to =M-*= and
+ toggles all the marks in the current agenda.
+
+**** New option [[doc:org-agenda-search-view-max-outline-level][org-agenda-search-view-max-outline-level]]
+
+This option sets the maximum outline level to display in search view.
+E.g. when this is set to 1, the search view will only show headlines of
+level 1.
+
+**** New option [[doc:org-agenda-todo-ignore-time-comparison-use-seconds][org-agenda-todo-ignore-time-comparison-use-seconds]]
+
+This allows to compare times using seconds instead of days when honoring
+options like =org-agenda-todo-ignore-*= in the agenda display.
+
+**** New option [[doc:org-agenda-entry-text-leaders][org-agenda-entry-text-leaders]]
+
+This allows you to get rid of the ">" character that gets added in front of
+entries excerpts when hitting =E= in the agenda view.
+
+**** New formatting string for past deadlines in [[doc:org-agenda-deadline-leaders][org-agenda-deadline-leaders]]
+
+The default formatting for past deadlines is ="%2d d. ago: "=, which makes
+it explicit that the deadline is in the past. You can configure this via
+[[doc:org-agenda-deadline-leaders][org-agenda-deadline-leaders]]. Note that the width of the formatting
+string is important to keep the agenda alignment clean.
+
+**** New allowed value =repeated-after-deadline= for [[doc:org-agenda-skip-scheduled-if-deadline-is-shown][org-agenda-skip-scheduled-if-deadline-is-shown]]
+
+When [[doc:org-agenda-skip-scheduled-if-deadline-is-shown][org-agenda-skip-scheduled-if-deadline-is-shown]] is set to
+=repeated-after-deadline=, the agenda will skip scheduled items if they are
+repeated beyond the current deadline.
+
+**** New option for [[doc:org-agenda-skip-deadline-prewarning-if-scheduled][org-agenda-skip-deadline-prewarning-if-scheduled]]
+
+This variable may be set to nil, t, the symbol `pre-scheduled', or a number
+which will then give the number of days before the actual deadline when the
+prewarnings should resume. The symbol `pre-scheduled' eliminates the
+deadline prewarning only prior to the scheduled date.
+
+Read the full docstring for details.
+
+**** [[doc:org-class][org-class]] now supports holiday strings in the skip-weeks parameter
+
+For example, this task will now be skipped only on new year's day:
+
+ : * Task
+ : <%%(org-class 2012 1 1 2013 12 12 2 "New Year's Day")>
+*** Capture
+
+**** Allow =C-1= as a prefix for [[doc:org-agenda-capture][org-agenda-capture]] and [[doc:org-capture][org-capture]]
+
+With a =C-1= prefix, the capture mechanism will use the =HH:MM= value at
+point (if any) or the current =HH:MM= time as the default time for the
+capture template.
+
+**** Expand keywords within %(sexp) placeholder in capture templates
+
+If you use a =%:keyword= construct within a =%(sexp)= construct, Org will
+expand the keywords before expanding the =%(sexp)=.
+
+**** Allow to contextualize capture (and agenda) commands by checking the name of the buffer
+
+[[doc:org-capture-templates-contexts][org-capture-templates-contexts]] and [[doc:org-agenda-custom-commands-contexts][org-agenda-custom-commands-contexts]]
+allow you to define what capture templates and what agenda commands should
+be available in various contexts. It is now possible for the context to
+check against the name of the buffer.
+*** Tag groups
+
+Using =#+TAGS: { Tag1 : Tag2 Tag3 }= will define =Tag1= as a /group tag/
+(note the colon after =Tag1=). If you search for =Tag1=, it will return
+headlines containing either =Tag1=, =Tag2= or =Tag3= (or any combination
+of those tags.)
+
+You can use group tags for sparse tree in an Org buffer, for creating
+agenda views, and for filtering.
+
+See https://orgmode.org/org.html#Tag-groups for details.
+
+*** Links
+
+**** =C-u C-u M-x org-store-link RET= will ignore non-core link functions
+
+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 [[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.
+
+You can now do this with =C-u C-u M-x org-store-link RET=.
+
+**** =C-u C-u C-u M-x org-store-link RET= on an active region will store links for each lines
+
+Imagine for example that you want to store a link for every message in a
+Gnus summary buffer. In that case =C-x h C-u C-u C-u M-x org-store-link
+RET= will store a link for every line (i.e. message) if the region is
+active.
+
+**** =C-c C-M-l= will add a default description for links which don't have one
+
+=C-c C-M-l= inserts all stored links. If a link does not have a
+description, this command now adds a default one, so that we are not mixing
+with-description and without-description links when inserting them.
+
+**** No curly braces to bracket links within internal links
+
+When storing a link to a headline like
+
+: * 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
+there is no description.
+*** Table
+
+**** Switching between #+TBLFM lines
+
+If you have several =#+TBLFM= lines below a table, =C-c C-c= on a line will
+apply the formulas from this line, and =C-c C-c= on another line will apply
+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
+[[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.
+
+**** Handle localized time-stamps in formulas evaluation
+
+If your =LOCALE= is set so that Org time-stamps use another language than
+english, and if you make time computations in Org's table, it now works by
+internally converting the time-stamps with a temporary =LOCALE=C= before
+doing computation.
+
+**** New lookup functions
+
+There are now three lookup functions:
+
+- [[doc:org-loopup-first][org-loopup-first]]
+- [[doc:org-loopup-last][org-loopup-last]]
+- [[doc:org-loopup-all][org-loopup-all]]
+
+See [[https://orgmode.org/org.html#Lookup-functions][the manual]] for details.
+*** Startup keywords
+
+These new startup keywords are now available:
+
+| Startup keyword | Option |
+|----------------------------------+---------------------------------------------|
+| =#+STARTUP: logdrawer= | =(setq org-log-into-drawer t)= |
+| =#+STARTUP: nologdrawer= | =(setq org-log-into-drawer nil)= |
+|----------------------------------+---------------------------------------------|
+| =#+STARTUP: logstatesreversed= | =(setq org-log-states-order-reversed t)= |
+| =#+STARTUP: nologstatesreversed= | =(setq org-log-states-order-reversed nil)= |
+|----------------------------------+---------------------------------------------|
+| =#+STARTUP: latexpreview= | =(setq org-startup-with-latex-preview t)= |
+| =#+STARTUP: nolatexpreview= | =(setq org-startup-with-latex-preview nil)= |
+
+*** Clocking
+
+**** New option [[doc:org-clock-rounding-minutes][org-clock-rounding-minutes]]
+
+E.g. if [[doc:org-clock-rounding-minutes][org-clock-rounding-minutes]] is set to 5, time is 14:47 and you
+clock in: then the clock starts at 14:45. If you clock out within the next
+5 minutes, the clock line will be removed; if you clock out 8 minutes after
+your clocked in, the clock out time will be 14:50.
+
+**** New option [[doc:org-time-clocksum-use-effort-durations][org-time-clocksum-use-effort-durations]]
+
+When non-nil, =C-c C-x C-d= uses effort durations. E.g., by default, one
+day is considered to be a 8 hours effort, so a task that has been clocked
+for 16 hours will be displayed as during 2 days in the clock display or in
+the clocktable.
+
+See [[doc:org-effort-durations][org-effort-durations]] on how to set effort durations and
+[[doc:org-time-clocksum-format][org-time-clocksum-format]] for more on time clock formats.
+
+**** New option [[doc:org-clock-x11idle-program-name][org-clock-x11idle-program-name]]
+
+This allows to set the name of the program which prints X11 idle time in
+milliseconds. The default is to use =x11idle=.
+
+**** New option [[doc:org-use-last-clock-out-time-as-effective-time][org-use-last-clock-out-time-as-effective-time]]
+
+When non-nil, use the last clock out time for [[doc:org-todo][org-todo]]. Note that this
+option has precedence over the combined use of [[doc:org-use-effective-time][org-use-effective-time]] and
+[[doc:org-extend-today-until][org-extend-today-until]].
+
+**** =S-<left/right>= on a clocksum column will update the sum by updating the last clock
+**** =C-u 3 C-S-<up/down>= will update clock timestamps synchronously by 3 units
+**** New parameter =:wstart= for clocktables to define the week start day
+**** New parameter =:mstart= to state the starting day of the month
+**** Allow relative times in clocktable tstart and tend options
+**** The clocktable summary is now a caption
+**** =:tstart= and =:tend= and friends allow relative times like "<-1w>" or "<now>"
+*** Babel
+
+**** You can now use =C-c C-k= for [[doc:org-edit-src-abort][org-edit-src-abort]]
+
+This allows you to quickly cancel editing a source block.
+
+**** =C-u C-u M-x org-babel-tangle RET= tangles by the target file of the block at point
+
+This is handy if you want to tangle all source code blocks that have the
+same target than the block at point.
+
+**** New options for auto-saving the base buffer or the source block editing buffer
+
+When [[doc:org-edit-src-turn-on-auto-save][org-edit-src-turn-on-auto-save]] is set to =t=, editing a source block
+in a new window will turn on =auto-save-mode= and save the code in a new
+file under the same directory than the base Org file.
+
+When [[doc:org-edit-src-auto-save-idle-delay][org-edit-src-auto-save-idle-delay]] is set to a number of minutes =N=,
+the base Org buffer will be saved after this number of minutes of idle
+time.
+
+**** New =:post= header argument post-processes results
+
+ This header argument may be used to pass the results of the current
+ code block through another code block for post-processing. See the
+ manual for a usage example.
+
+**** Commented out heading are ignored when collecting blocks for tangling
+
+If you comment out a heading (with =C-c ;= anywhere on the heading or in
+the subtree), code blocks from within this heading are now ignored when
+collecting blocks for tangling.
+
+**** New option [[doc:org-babel-hash-show-time][org-babel-hash-show-time]] to show a time-stamp in the result hash
+**** Do not ask for confirmation if cached value is current
+
+Do not run [[doc:org-babel-confirm-evaluate][org-babel-confirm-evaluate]] if source block has a cache and the
+cache value is current as there is no evaluation involved in this case.
+**** =ob-sql.el= and =ob-python.el= have been improved.
+**** New Babel files only need to =(require 'ob)=
+
+When writing a new Babel file, you now only need to use =(require 'ob)=
+instead of requiring each Babel library one by one.
+*** Faces
+
+- Org now fontifies radio link targets by default
+- In the agenda, use [[doc:org-todo-keyword-faces][org-todo-keyword-faces]] to highlight selected TODO keywords
+- New face [[doc:org-priority][org-priority]], enhanced fontification of priority cookies in agenda
+- New face [[doc:org-tag-group][org-tag-group]] for group tags
+
+** Miscellaneous
+
+- New speedy key =s= pour [[doc:org-narrow-to-subtree][org-narrow-to-subtree]]
+- Handling of [[doc:org-html-table-row][org-html-table-row]] has been updated (incompatible change)
+- [[doc:org-export-html-table-tag][org-export-html-table-tag]] is replaced by [[doc:org-html-table-default-attributes][org-html-table-default-attributes]]
+- Support using =git-annex= with Org attachments
+- org-protocol: Pass optional value using query in url to capture from protocol
+- When the refile history is empty, use the current filename as default
+- When you cannot change the TODO state of a task, Org displays the blocking task
+- New option [[doc:org-mobile-allpriorities][org-mobile-allpriorities]]
+- org-bibtex.el now use =visual-line-mode= instead of the deprecated =longlines-mode=
+- [[doc:org-format-latex-options][org-format-latex-options]] allows to set the foreground/background colors automatically
+- New option [[doc:org-archive-file-header-format][org-archive-file-header-format]]
+- New "neg" entity in [[doc:org-entities][org-entities]]
+- New function [[doc:org-docview-export][org-docview-export]] to export docview links
+- New =:eps= header argument for ditaa code blocks
+- New option [[doc:org-gnus-no-server][org-gnus-no-server]] to start Gnus with =gnus-no-server=
+- Org is now distributed with =htmlize.el= version 1.43
+- ~org-drill.el~ has been updated to version 2.3.7
+- ~org-mac-iCal.el~ now supports OS X versions up to 10.8
+- Various improvements to ~org-contacts.el~ and =orgpan.el=
+
+** Outside Org
+
+*** Spanish translation of the Org guide by David Arroyo Menéndez
+
+David (and others) translated the Org compact guide in spanish:
+
+You can read the [[https://orgmode.org/worg/orgguide/orgguide.es.pdf][PDF guide]].
+
+*** ~poporg.el~ and ~outorg.el~
+
+Two new libraries (~poporg.el~ by François Pinard and ~outorg.el~ by
+Thorsten Jolitz) now enable editing of comment-sections from source-code
+buffers in temporary Org-mode buffers, making the full editing power of
+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: https://orgmode.org/worg/org-tutorials/org-outside-org.html
+
+Here are two screencasts demonstrating Thorsten's tools:
+
+- [[https://youtu.be/nqE6YxlY0rw]["Modern conventions for Emacs Lisp files"]]
+- [[https://www.youtube.com/watch?v%3DII-xYw5VGFM][Exploring Bernt Hansen's Org-mode tutorial with 'navi-mode']]
+
+*** MobileOrg for iOS
+
+MobileOrg for iOS back in the App Store The 1.6.0 release was focused on
+the new Dropbox API and minor bug fixes but also includes a new ability to
+launch in Capture mode. Track development and contribute [[https://github.com/MobileOrg/mobileorg/issues][on github]].
+
+* Version 7.9.3
+
+** New option [[doc::org-agenda-use-tag-inheritance][org-agenda-use-tag-inheritance]]
+
+[[doc::org-use-tag-inheritance][org-use-tag-inheritance]] controls whether tags are inherited when
+org-tags-view is called (either in =tags=, =tags-tree= or =tags-todo=
+agenda views.)
+
+When generating other agenda types such as =agenda=, =todo= and
+=todo-tree=, tags inheritance is not used when selecting the entries
+to display. Still, you might want to have all tag information correct
+in the agenda buffer, e.g. for tag filtering. In that case, add the
+agenda type to this variable.
+
+Setting this variable to nil should considerably speeds up the agenda
+generation.
+
+Note that the default was to display inherited tags in the agenda
+lines even if `org-use-tag-inheritance' was nil. The default is now
+to *never* display inherited tags in agenda lines, but to /know/ about
+them when the agenda type is listed in [[doc::org-agenda-use-tag-inheritance][org-agenda-use-tag-inheritance]].
+
+** New default value =nil= for [[doc::org-agenda-dim-blocked-tasks][org-agenda-dim-blocked-tasks]]
+
+Using `nil' as the default value speeds up the agenda generation. You
+can hit `#' (or `C-u #') in agenda buffers to temporarily dim (or turn
+invisible) blocked tasks.
+
+** New speedy keys for [[doc::org-speed-commands-default][org-speed-commands-default]]
+
+You can now use `:' (instead of `;') for setting tags---this is
+consistent with using the `:' key in agenda view.
+
+You can now use `=' for [[doc::org-columns][org-columns]].
+
+** =org-float= is now obsolete, use =diary-float= instead
+** No GPL manual anymore
+
+There used to be a GPL version of the Org manual, but this is not the
+case anymore, the Free Software Foundation does not permit this.
+
+The GNU FDL license is now included in the manual directly.
+
+** Enhanced compatibility with Emacs 22 and XEmacs
+
+Thanks to Achim for his work on enhancing Org's compatibility with
+various Emacsen. Things may not be perfect, but Org should work okay
+in most environments.
+
+* Version 7.9.2
+
+** New ELPA repository for Org packages
+
+You can now add the Org ELPA repository like this:
+
+#+BEGIN_SRC emacs-lisp
+(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
+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 https://orgmode.org/elpa/
+
+** Overview of the new keybindings
+
+ | Keybinding | Speedy | Command |
+ |-----------------+--------+-----------------------------|
+ | =C-c C-x C-z= | | [[doc::org-clock-resolve][org-clock-resolve]] |
+ | =C-c C-x C-q= | | [[doc::org-clock-cancel][org-clock-cancel]] |
+ | =C-c C-x C-x= | | [[doc::org-clock-in-last][org-clock-in-last]] |
+ | =M-h= | | [[doc::org-mark-element][org-mark-element]] |
+ | =*= | | [[doc::org-agenda-bulk-mark-all][org-agenda-bulk-mark-all]] |
+ | =C-c C-M-l= | | [[doc::org-insert-all-links][org-insert-all-links]] |
+ | =C-c C-x C-M-v= | | [[doc::org-redisplay-inline-images][org-redisplay-inline-images]] |
+ | =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= |
+ | =k= | | [[doc::org-agenda-capture][org-agenda-capture]] |
+ | C-c , | , | [[doc::org-priority][org-priority]] |
+
+** New package and Babel language
+
+*** =org-eshell.el= by Konrad Hinsen is now in Org
+
+ =org-eshell.el= allows you to create links from [[https://www.gnu.org/software/emacs/manual/html_node/eshell/index.html][Eshell]].
+
+*** Support for execution of Scala code blocks (see ob-scala.el)
+*** Support for execution of IO code blocks (see ob-io.el)
+
+** Incompatible changes
+
+ - If your code relies on =org-write-agenda=, please use
+ [[doc::org-agenda-write][org-agenda-write]] from now on.
+
+ - If your code relies on =org-make-link=, please use =concat=
+ instead.
+
+ - =org-link-to-org-use-id= has been renamed to
+ =org-id-link-to-org-use-id= and its default value is nil. The
+ previous default was =create-if-interactive-and-no-custom-id=.
+
+** New features and user-visible changes
+
+*** Org Element
+
+ =org-element.el= is a toolbox for parsing and analyzing "elements"
+ in an Org-mode buffer. This has been written by Nicolas Goaziou
+ and has been tested for quite some time. It is now part of Org's
+ core and many core functions rely on this package.
+
+ Two functions might be particularly handy for users:
+ =org-element-at-point= and =org-element-context=.
+
+ See the docstrings for more details.
+
+ Below is a list of editing and navigating commands that now rely
+ on =org-element.el=.
+
+**** [[doc::org-fill-paragraph][org-fill-paragraph]] has been completely rewritten
+
+ The filling mechanisms now rely on org-element, trying to do the
+ right thing on each element in various contexts. E.g. filling in
+ a list item will preserve indentation; filling in message-mode
+ will fall back on the relevant filling functions; etc.
+
+**** [[doc::org-metaup][org-metaup]] and [[doc::org-metadown][org-metadown]] will drag the element backward/forward
+
+ If you want to get the old behavior (i.e. moving a line up and
+ down), you can first select the line as an active region, then
+ =org-metaup= or =org-metadown= to move the region backward or
+ forward. This also works with regions bigger than just one line.
+
+**** [[doc::org-up-element][org-up-element]] and [[doc::org-down-element][org-down-element]] (respectively =C-c C-^= and =C-c C-_=)
+
+ This will move the point up/down in the hierarchy of elements.
+
+**** [[doc::org-backward-element][org-backward-element]] and [[doc::org-forward-element][org-forward-element]] (respectively =M-{= and =M-}=)
+
+ This will move the point backward/forward in the hierarchy of
+ elements.
+
+**** [[doc::org-narrow-to-element][org-narrow-to-element]] will narrow to the element at point
+**** [[doc::org-mark-element][org-mark-element]] will mark the element at point
+
+ This command is bound to =M-h= and will mark the element at
+ point. If the point is at a paragraph, it will mark the
+ paragraph. If the point is at a list item, it will mark the list
+ item. Etc.
+
+ Note that if point is at the beginning of a list, it will mark
+ the whole list.
+
+ To mark a subtree, you can either use =M-h= on the headline
+ (since there is no ambiguity about the element you're at) or
+ [[doc::org-mark-subtree][org-mark-subtree]] (=C-c @=) anywhere in the subtree.
+
+ Invoking [[doc::org-mark-element][org-mark-element]] repeatedly will try to mark the next
+ element on top of the previous one(s). E.g. hitting =M-h= twice
+ on a headline will mark the current subtree and the next one on
+ the same level.
+
+*** Org Agenda
+
+**** New option [[doc::org-agenda-sticky][org-agenda-sticky]]
+
+ There is a new option =org-agenda-sticky= which enables "sticky"
+ agendas. Sticky agendas remain opened in the background so that
+ you don't need to regenerate them each time you hit the
+ corresponding keystroke. This is a big time saver.
+
+ When [[doc::org-agenda-sticky][org-agenda-sticky]] is =non-nil=, the agenda buffer will be
+ named using the agenda key and its description. In sticky
+ agendas, the =q= key will just bury the agenda buffers and
+ further agenda commands will show existing buffer instead of
+ generating new ones.
+
+ If [[doc::org-agenda-sticky][org-agenda-sticky]] is set to =nil=, =q= will kill the single
+ agenda buffer.
+
+**** New option [[doc::org-agenda-custom-commands-contexts][org-agenda-custom-commands-contexts]]
+
+ Setting this option allows you to define specific context where
+ agenda commands should be available from. For example, when set
+ to this value
+
+ #+BEGIN_SRC emacs-lisp
+ (setq org-agenda-custom-commands-contexts
+ '(("p" (in-file . "\\.txt"))))
+#+END_SRC
+
+ then the =p= agenda command will only be available from buffers
+ visiting *.txt files. See the docstring and the manual for more
+ details on how to use this.
+
+**** Changes in bulk actions
+
+ The set of commands starting with =k ...= as been deleted and the
+ features have been merged into the "bulk action" feature.
+
+ After you marked some entries in the agenda, if you call =B s=,
+ the agenda entries will be rescheduled using the date at point if
+ on a date header. If you are on an entry with a timestamp, you
+ will be prompted for a date to reschedule your marked entries to,
+ using the timestamp at point as the default prompt.
+
+ You can now use =k= to capture the marked entry and use the date
+ at point as an overriding date for the capture template.
+
+ To bind this behavior to =M-x org-capture RET= (or its
+ keybinding), set the new option [[doc::org-capture-use-agenda-date][org-capture-use-agenda-date]] to
+ =t=.
+
+**** =N= and =P= in the agenda will move to the next/previous item
+
+**** New command [[doc::org-agenda-bulk-mark-all][org-agenda-bulk-mark-all]] to mark all items
+
+ This new command is bound to =*= in agenda mode.
+
+ There is also a new option [[doc::org-agenda-bulk-mark-char][org-agenda-bulk-mark-char]] to set the
+ character to use as a mark for bulk actions.
+
+**** New option [[doc::org-agenda-persistent-marks][org-agenda-persistent-marks]]
+
+ When set to =non-nil=, marks will remain visible after a bulk
+ action. You can temporarily toggle this by pressing =p= when
+ invoking [[doc::org-agenda-bulk-action][org-agenda-bulk-action]]. Marks are deleted if your
+ rebuild the agenda buffer or move to another date/span (e.g. with
+ =f= or =w=).
+
+**** New option [[doc::org-agenda-skip-timestamp-if-deadline-is-shown][org-agenda-skip-timestamp-if-deadline-is-shown]]
+
+ =Non-nil= means skip timestamp line if same entry shows because
+ of deadline.
+
+ In the agenda of today, an entry can show up multiple times
+ because it has both a plain timestamp and has a nearby deadline.
+ When this variable is t, then only the deadline is shown and the
+ fact that the entry has a timestamp for or including today is not
+ shown. When this variable is =nil=, the entry will be shown
+ several times.
+
+**** New =todo-unblocked= and =nottodo-unblocked= skip conditions
+
+ See the [[https://orgmode.org/cgit.cgi/org-mode.git/commit/?id=f426da][git commit]] for more explanations.
+
+**** Allow category filtering in the agenda
+
+ You can now filter the agenda by category. Pressing "<" will
+ filter by the category of the item on the current line, and
+ pressing "<" again will remove the filter. You can combine tag
+ filters and category filters.
+
+ You can use =org-agenda-category-filter= in your custom agenda
+ views and =org-agenda-category-filter-preset= in your main
+ configuration.
+
+ See also the new command [[doc::org-agenda-filter-by-top-category][org-agenda-filter-by-top-category]]:
+ hitting =^= will filter by "Top" category: only show entries that
+ are of the same category than the Top category of the entry at
+ point.
+
+*** Org Links
+
+**** Inserting links
+
+ When inserting links through [[doc::org-insert-link][org-insert-link]], the description is
+ now displayed first, followed by the literal link, as the
+ description is often more useful when you look for the link you
+ want to insert.
+
+ Completion now complete both literal links and description. If
+ you complete a description, the literal link and its description
+ will be inserted directly, whereas when you complete the literal
+ link, you will be prompted for a description (as with Org 7.8.)
+
+ In the completion buffer, links to the current buffer are now
+ highlighted.
+
+**** New templates =%h= and =%(sexp)= for abbreviated links
+
+ On top of =%s= template, which is replaced by the link tag in
+ abbreviated links, you can now use =%h= (which does the same than =%s=
+ but does not hexify the tag) and =%(sexp)= (which can run a function
+ that takes the tag as its own argument.)
+
+**** New link type =help=
+
+ You can now create links from =help= buffers.
+
+ For example, if you request help for the command [[doc::org-agenda][org-agenda]] with
+ =C-h f org-agenda RET=, creating a link from this buffer will let
+ you go back to the same buffer.
+
+**** New command [[doc::org-insert-all-links][org-insert-all-links]]
+
+ This will insert all links as list items. With a universal
+ prefix argument, links will not be deleted from the variable
+ =org-stored-links=.
+
+ This new command is bound to =C-c C-M-l=.
+
+**** New option [[doc::org-url-hexify-p][org-url-hexify-p]]
+
+ When set to =nil=, the =URL= part of a link will not be hexified.
+
+**** Org can now open multiple shell links
+
+**** New option [[doc::org-doi-server-url][org-doi-server-url]] to specify an alternate DOI server
+
+**** RET now follows time stamps links
+
+*** Org Editing
+
+**** [[doc::org-todo][org-todo]] and =org-archive-*= can now loop in the active region
+
+ When [[doc::org-loop-over-headlines-in-active-region][org-loop-over-headlines-in-active-region]] is =non-nil=, using
+ [[doc::org-todo][org-todo]] or =org-archive-*= commands in the active region will
+ loop over headlines. This is handy if you want to set the TODO
+ keyword for several items, or archive them quickly.
+
+**** You can now set tags for headlines in a region
+
+ If [[doc::org-loop-over-headlines-in-active-region][org-loop-over-headlines-in-active-region]] is =non-nil=, then
+ selecting the region and hitting =C-c C-q= will set the tags for
+ all headlines in the region.
+
+**** New command [[doc::org-insert-drawer][org-insert-drawer]] to insert a drawer interactively
+
+**** Comments start with "^[ \t]*# " anywhere on a line
+
+ Note that the space after the hashtag is mandatory. Comments
+ with "^#+" are not supported anymore.
+
+**** New speed key =#= to toggle the COMMENT cookie on a headline
+
+**** =indent-region-function= is now set to [[doc::org-indent-region][org-indent-region]]
+
+ =C-M-\= should now produce useful results.
+
+ You can unindent the buffer with [[doc::org-unindent-buffer][org-unindent-buffer]].
+
+**** New option [[doc::org-allow-promoting-top-level-subtree][org-allow-promoting-top-level-subtree]]
+
+ When =non-nil=, =S-M-<left>= will promote level-1 subtrees
+ containing other subtrees. The level-1 headline will be
+ commented out. You can revert to the previous state with =M-x
+ undo RET=.
+
+*** Org Clock
+
+**** New keybinding =C-c C-x C-z= for [[doc::org-clock-resolve][org-clock-resolve]]
+
+**** New keybinding =C-c C-x C-q= for [[doc::org-clock-cancel][org-clock-cancel]]
+
+**** New command [[doc::org-clock-in-last][org-clock-in-last]] to clock in the last clocked item
+
+ This command is bound to =C-c C-x C-x= and will clock in the last
+ clocked entry, if any.
+
+**** =C-u M-x= [[doc::org-clock-out][org-clock-out]] =RET= now prompts for a state to switch to
+
+**** =S-M-<up/down>= on a clock timestamps adjusts the previous/next clock
+
+**** New option [[doc::org-clock-continuously][org-clock-continuously]]
+
+ When set to =nil=, clocking in a task will first try to find the
+ last clocked out task and restart from when that task was clocked
+ out.
+
+ You can temporarily activate continuous clocking with =C-u C-u
+ C-u M-x= [[doc::org-clock-in][org-clock-in]] =RET= (three universal prefix arguments)
+ and =C-u C-u M-x= [[doc::org-clock-in-last][org-clock-in-last]] =RET= (two universal prefix
+ arguments).
+
+
+**** New option [[doc::org-clock-frame-title-format][org-clock-frame-title-format]]
+
+ This option sets the value of =frame-title-format= when clocking
+ in.
+
+**** New options for controlling the clockreport display
+
+ [[doc::org-clock-file-time-cell-format][org-clock-file-time-cell-format]]: Format string for the file time
+ cells in clockreport.
+
+ [[doc::org-clock-total-time-cell-format][org-clock-total-time-cell-format]]: Format string for the total
+ time cells in clockreport.
+
+
+**** New options for controlling the clock/timer display
+
+ [[doc::org-clock-clocked-in-display][org-clock-clocked-in-display]]: control whether the current clock
+ is displayed in the mode line and/or frame title.
+
+ [[doc::org-timer-display][org-timer-display]]: control whether the current timer is displayed
+ in the mode line and/or frame title.
+
+ This allows the clock and timer to be displayed in the frame
+ title instead of, or as well as, the mode line. This is useful
+ for people with limited space in the mode line but with ample
+ space in the frame title.
+
+*** Org Appearance
+
+**** New option [[doc::org-custom-properties][org-custom-properties]]
+
+ The visibility of properties listed in this options can be turn
+ on/off with [[doc::org-toggle-custom-properties-visibility][org-toggle-custom-properties-visibility]]. This might
+ be useful for properties used by third-part tools or that you
+ don't want to see temporarily.
+
+**** New command [[doc::org-redisplay-inline-images][org-redisplay-inline-images]]
+
+ This will redisplay all images. It is bound to =C-c C-x C-M-v=.
+
+**** New entities in =org-entities.el=
+
+ There are these new entities:
+
+ : ("tilde" "\\~{}" nil "&tilde;" "~" "~" "~")
+ : ("slash" "/" nil "/" "/" "/" "/")
+ : ("plus" "+" nil "+" "+" "+" "+")
+ : ("under" "\\_" nil "_" "_" "_" "_")
+ : ("equal" "=" nil "=" "=" "=" "=")
+ : ("asciicirc" "\\textasciicircum{}" nil "^" "^" "^" "^")
+
+**** New face =org-list-dt= for definition terms
+**** New face =org-date-selected= for the selected calendar day
+**** New face value for =org-document-title=
+
+ The face is back to a normal height.
+
+*** Org Columns
+
+**** New speed command =:= to activate the column view
+**** New special property =CLOCKSUM_T= to display today's clocked time
+
+ You can use =CLOCKSUM_T= the same way you use =CLOCKSUM=. It
+ will display the time spent on tasks for today only.
+
+**** Use the =:COLUMNS:= property in columnview dynamic blocks
+
+ If the =:COLUMNS:= is set in a subtree, the columnview dynamic
+ block will use its value as the column format.
+
+**** Consider inline tasks when computing a sum
+
+*** Org Dates and Time Stamps
+
+**** Enhanced [[doc::org-sparse-tree][org-sparse-tree]]
+
+ =C-c /= can now check for time ranges.
+
+ When checking for dates with =C-c /= it is useful to change the
+ type of dates that you are interested in. You can now do this
+ interactively with =c= after =C-c /= and/or by setting
+ [[doc::org-sparse-tree-default-date-type][org-sparse-tree-default-date-type]] to the default value you want.
+
+**** Support for hourly repeat cookies
+
+ You can now use
+
+ : SCHEDULED: <2012-08-20 lun. 08:00 +1h>
+
+ if you want to add an hourly repeater to an entry.
+
+**** =C-u C-u C-c .= inserts a time-stamp with no prompt
+
+**** When (setq [[doc::org-read-date-prefer-future][org-read-date-prefer-future]] 'time), accept days in the prompt
+
+ "8am Wed" and "Wed 8am" are now acceptable values when entering a
+ date from the prompt. If [[doc::org-read-date-prefer-future][org-read-date-prefer-future]] is set to
+ =time=, this will produce the expected prompt indication.
+
+**** New option [[doc::org-datetree-add-timestamp][org-datetree-add-timestamp]]
+
+ When set to =non-nil=, datetree entries will also have a
+ timestamp. This is useful if you want to see these entries in a
+ sparse tree with =C-c /=.
+
+*** Org Capture
+
+**** New command [[doc::org-capture-string][org-capture-string]]
+
+ M-x [[doc::org-capture-string][org-capture-string]] RET will prompt for a string and a capture
+ template. The string will be used as an annotation for the
+ template. This is useful when capturing in batch mode as it lets
+ you define the content of the template without being in Emacs.
+
+**** New option [[doc::org-capture-templates-contexts][org-capture-templates-contexts]]
+
+ Setting this option allows you to define specific context where
+ capture templates should be available from. For example, when
+ set to this value
+
+ #+BEGIN_SRC emacs-lisp
+ (setq org-capture-templates-contexts
+ '(("c" (in-mode . "message-mode"))))
+#+END_SRC
+
+ then the =c= capture template will only be available from
+ =message-mode= buffers. See the docstring and the manual for
+ more details on how to use this.
+
+**** New =%l= template to insert the literal link
+**** New option [[doc::org-capture-bookmark][org-capture-bookmark]]
+
+ Org used to automatically add a bookmark with capture a note.
+ You can now turn this on by setting [[doc::org-capture-bookmark][org-capture-bookmark]] to
+ =nil=.
+
+**** Expand =%<num>= escape sequences into text entered for <num>'th =%^{PROMPT}= escape
+
+ See the manual for more explanations.
+
+**** More control over empty lines
+
+ You can use =:empty-lines-before= and =:empty-lines-after= to
+ control the insertion of empty lines. Check the manual for more
+ explanations.
+
+**** New hook [[doc::org-capture-prepare-finalize-hook][org-capture-prepare-finalize-hook]]
+
+ This new hook runs before the finalization process starts.
+
+*** Org Export
+
+**** New functions =orgtbl-to-table.el= and =orgtbl-to-unicode=
+
+ =orgtbl-to-table.el= convert the table to a =table.el= table, and
+ =orgtbl-to-unicode= will use =ascii-art-to-unicode.el= (when
+ available) to print beautiful tables.
+
+**** [[doc::org-table-export][org-table-export]] now a bit clever about the target format
+
+ When you specify a file name like =table.csv=, [[doc::org-table-export][org-table-export]]
+ will now suggest =orgtbl-to-csv= the default method for exporting
+ the table.
+
+**** New option [[doc::org-export-date-timestamp-format][org-export-date-timestamp-format]]
+
+ The option allows to set a time string format for Org timestamps
+ in the #+DATE option.
+
+**** LaTeX: New options for exporting table rules :tstart, :hline and :tend
+
+ See [[doc::org-export-latex-tables-hline][org-export-latex-tables-hline]] and [[doc::org-export-latex-tables-tend][org-export-latex-tables-tend]].
+
+**** LaTeX: You can now set =:hfmt= from =#+ATTR_LaTeX=
+**** Beamer: Add support and keybinding for the =exampleblock= environment
+
+ Add support for these languages in [[doc::org-export-language-setup][org-export-language-setup]].
+ More languages are always welcome.
+
+**** Beamer: New option [[doc::org-beamer-inherited-properties][org-beamer-inherited-properties]]
+
+ This option allows Beamer export to inherit some properties.
+ Thanks to Carsten for implementing this.
+
+**** ODT: Add support for ODT export in org-bbdb.el
+**** 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
+**** HTML: New option [[doc::org-export-html-date-format-string][org-export-html-date-format-string]]
+
+ Format string to format the date and time in HTML export. Thanks
+ to Sébastien Vauban for this patch.
+
+*** Org Babel
+
+**** New =:results drawer= parameter
+
+=:results drawer= replaces =:results wrap=, which is deprecated but still
+supported.
+
+**** =:results org= now put results in a =#+BEGIN_SRC org= block
+
+=:results org= used to put results in a =#+BEGIN_ORG= block but it now puts
+results in a =#+BEGIN_SRC org= block, with comma-escaped lines.
+
+=#+BEGIN_ORG= blocks are obsolete.
+
+**** Exporting =#+BEGIN_SRC org= blocks exports the code
+
+It used to exports the results of the code.
+
+*** Miscellaneous
+
+**** New menu entry for [[doc::org-refile][org-refile]]
+**** Allow capturing to encrypted entries
+
+If you capture to an encrypted entry, it will be decrypted before
+inserting the template then re-encrypted after finalizing the capture.
+
+**** Inactive timestamps are now handled in tables
+
+Calc can do computation on active time-stamps like <2012-09-29 sat.>.
+Inactive time-stamps in a table's cell are now internally deactivated so
+that Calc formulas can operate on them.
+
+**** [[doc::org-table-number-regexp][org-table-number-regexp]] can now accept comma as decimal mark
+**** Org allows a new property =APPT_WARNTIME=
+
+ You can set it with the =W= speedy key or set it manually. When
+ set, exporting to iCalendar and [[doc::org-agenda-to-appt][org-agenda-to-appt]] will use the
+ value of this property as the number of minutes for the warning
+ alarm.
+
+**** New command [[doc::org-inc-effort][org-inc-effort]]
+
+ This will increment the effort value.
+
+ It is bound to =C-c C-x E= and to =E= as a speedy command.
+
+**** Attach: Add support for creating symbolic links
+
+ =org-attach-method= now supports a new method =lns=, allowing to
+ attach symbolic links.
+
+**** Archive: you can now archive to a datetree
+
+**** New option [[doc::org-inlinetask-show-first-star][org-inlinetask-show-first-star]]
+
+ =Non-nil= means display the first star of an inline task as
+ additional marker. When =nil=, the first star is not shown.
+
+**** New option [[doc::org-latex-preview-ltxpng-directory][org-latex-preview-ltxpng-directory]]
+
+ This lets you define the path for the =ltxpng/= directory.
+
+**** You can now use imagemagick instead of dvipng to preview LaTeX fragments
+**** You can now turn off [[doc::orgstruct++-mode][orgstruct++-mode]] safely
+**** =C-u C-c C-c= on list items to add check boxes
+
+ =C-u C-c C-c= will add an empty check box on a list item.
+
+ When hit from the top of the list, it will add check boxes for
+ all top level list items.
+
+**** =org-list-ending-method= and =org-list-end-regexp= are now obsolete
+
+ Fall back on using =org-list-end-re= only, which see.
+
+**** org-feed.el now expands =%(sexp)= templates
+**** New option [[doc::org-protocol-data-separator][org-protocol-data-separator]]
+
+**** New option [[doc::org-ditaa-jar-option][org-ditaa-jar-option]] to specify the ditaa jar file
+
+**** New possible value for [[doc::org-loop-over-headlines-in-active-region][org-loop-over-headlines-in-active-region]]
+
+ When [[doc::org-loop-over-headlines-in-active-region][org-loop-over-headlines-in-active-region]] is set to
+ =start-level=, the command will loop over the active region but
+ will only act upon entries that are of the same level than the
+ first headline in the region.
+
+**** New option [[doc::org-habit-show-all-today][org-habit-show-all-today]]
+
+ When set to =t=, show all (even unscheduled) habits on today's
+ agenda.
+
+** Important bug fixes
+
+*** M-TAB on options keywords perform completion correctly again
+
+ If you hit =M-TAB= on keywords like =#+TITLE=, Org will try to
+ perform completion with meaningful values.
+
+*** Add licenses to javascript embedded and external code snippets
+
+ Embedded javascript code produced when exporting an Org file to
+ HTML is now licensed under GPLv3 (or later), and the copyright is
+ owned by the Free Software Foundation, Inc.
+
+ The javascript code for embedding MathJax in the browser mentions
+ the MathJax copyright and the Apache 2.0 license.
+
+ The javascript code for embedding =org-injo.js= in the browser
+ mentions the copyright of Sebastian Rose and the GPLv3 (or later)
+ license.
+
+ =org-export-html-scripts= is now a variable, so that you can adapt
+ the code and the license to your needs.
+
+ See https://www.gnu.org/philosophy/javascript-trap.html for
+ explanations on why these changes were necessary.
+
+* Version 7.8.11
+
+** Incompatible changes
+
+*** Emacs 21 support has been dropped
+
+ 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
+
+ To use Org mode 7.xx with XEmacs, you need to run the developer
+ version of XEmacs. We were about to drop XEmacs support entirely,
+ but Michael Sperber stepped in and made changes to XEmacs that
+ made it easier to keep the support. Thanks to Michael for this
+ last-minute save.
+
+*** New keys for TODO sparse trees
+
+ The key =C-c C-v= is now reserved for Org Babel action. TODO
+ sparse trees can still be made with =C-c / t= (all not-done
+ states) and =C-c / T= (specific states).
+
+*** The Agenda =org-agenda-ndays= is now obsolete
+
+ The variable =org-agenda-ndays= is obsolete - please use
+ =org-agenda-span= instead.
+
+ Thanks to Julien Danjou for this.
+
+*** Changes to the intended use of =org-export-latex-classes=
+
+ So far this variable has been used to specify the complete header
+ of the LaTeX document, including all the =\usepackage= calls
+ necessary for the document. This setup makes it difficult to
+ maintain the list of packages that Org itself would like to call,
+ for example for the special symbol support it needs.
+
+ First of all, you can *opt out of this change* in the following
+ way: You can say: /I want to have full control over headers, and I
+ will take responsibility to include the packages Org needs/. If
+ that is what you want, add this to your configuration and skip the
+ rest of this section (except maybe for the description of the
+ =[EXTRA]= place holder):
+
+ #+begin_src emacs-lisp
+ (setq org-export-latex-default-packages-alist nil
+ org-export-latex-packages-alist nil)
+ #+end_src
+
+ /Continue to read here if you want to go along with the modified
+ setup./
+
+ There are now two variables that should be used to list the LaTeX
+ packages that need to be included in all classes. The header
+ definition in =org-export-latex-classes= should then not contain
+ the corresponding =\usepackage= calls (see below).
+
+ The two new variables are:
+
+ 1. =org-export-latex-default-packages-alist= :: This is the
+ variable where Org-mode itself puts the packages it needs.
+ Normally you should not change this variable. The only
+ reason to change it anyway is when one of these packages
+ causes a conflict with another package you want to use. Then
+ you can remove that packages and hope that you are not using
+ Org-mode functionality that needs it.
+
+ 2. =org-export-latex-packages-alist= :: This is the variable where
+ you can put the packages that you'd like to use across all
+ classes.
+
+ The sequence how these customizations will show up in the LaTeX
+ document are:
+
+ 1. Header from =org-export-latex-classes=
+ 2. =org-export-latex-default-packages-alist=
+ 3. =org-export-latex-packages-alist=
+ 4. Buffer-specific things set with =#+LaTeX_HEADER:=
+
+ If you want more control about which segment is placed where, or
+ if you want, for a specific class, have full control over the
+ header and exclude some of the automatic building blocks, you can
+ put the following macro-like place holders into the header:
+
+ #+begin_example
+ [DEFAULT-PACKAGES] \usepackage statements for default packages
+ [NO-DEFAULT-PACKAGES] do not include any of the default packages
+ [PACKAGES] \usepackage statements for packages
+ [NO-PACKAGES] do not include the packages
+ [EXTRA] the stuff from #+LaTeX_HEADER
+ [NO-EXTRA] do not include #+LaTeX_HEADER stuff
+ #+end_example
+
+ If you have currently customized =org-export-latex-classes=, you
+ should revise that customization and remove any package calls that
+ are covered by =org-export-latex-default-packages-alist=. This
+ applies to the following packages:
+
+ - inputenc
+ - fontenc
+ - fixltx2e
+ - graphicx
+ - longtable
+ - float
+ - wrapfig
+ - soul
+ - t1enc
+ - textcomp
+ - marvosym
+ - wasysym
+ - latexsym
+ - amssymb
+ - hyperref
+
+ If one of these packages creates a conflict with another package
+ you are using, you can remove it from
+ =org-export-latex-default-packages-alist=. But then you risk that
+ some of the advertised export features of Org will not work
+ properly.
+
+ You can also consider moving packages that you use in all classes
+ to =org-export-latex-packages-alist=. If necessary, put the place
+ holders so that the packages get loaded in the right sequence. As
+ said above, for backward compatibility, if you omit the place
+ holders, all the variables will dump their content at the end of
+ the header.
+
+*** The constant =org-html-entities= is obsolete
+
+ Its content is now part of the new constant =org-entities=, which
+ is defined in the file org-entities.el. =org-html-entities= was
+ an internal variable, but it is possible that some users did write
+ code using it.
+
+*** =org-bbdb-anniversary-format-alist= has changed
+
+ Please check the docstring and update your settings accordingly.
+
+*** Deleted =org-mode-p=
+
+ This function has been deleted: please update your code.
+
+** Important new features
+
+*** New Org to ODT exporter
+
+ Jambunathan's Org to ODT exporter is now part of Org.
+
+ To use it, it `C-c C-e o' in an Org file. See the documentation
+ for more information on how to customize it.
+
+*** org-capture.el is now the default capture system
+
+ 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 [[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
+ [[msg:C46F10DC-DE51-43D4-AFFE-F71E440D1E1F@gmail.com][Carsten's announcement]] for more details.
+
+ To switch over to the new system:
+
+ 1. Run
+
+ : M-x org-capture-import-remember-templates RET
+
+ to get a translated version of your remember templates into the
+ new variable =org-capture-templates=. This will "mostly" work,
+ but maybe not for all cases. At least it will give you a good
+ place to modify your templates. After running this command,
+ enter the customize buffer for this variable with
+
+ : M-x customize-variable RET org-capture-templates RET
+
+ and convince yourself that everything is OK. Then save the
+ customization.
+
+ 2. Bind the command =org-capture= to a key, similar to what you did
+ with org-remember:
+
+ : (define-key global-map "\C-cc" 'org-capture)
+
+ If your fingers prefer =C-c r=, you can also use this key once
+ you have decided to move over completely to the new
+ implementation. During a test time, there is nothing wrong
+ with using both system in parallel.
+
+** New libraries
+
+*** New Org libraries
+**** org-eshell.el (Konrad Hinsen)
+
+ Implement links to eshell buffers.
+
+**** org-special-blocks (Carsten Dominik)
+
+ This package generalizes the #+begin_foo and #+end_foo tokens.
+
+ To use, put the following in your init file:
+
+ #+BEGIN_EXAMPLE
+(require 'org-special-blocks)
+#+END_EXAMPLE
+
+ The tokens #+begin_center, #+begin_verse, etc. existed
+ previously. This package generalizes them (at least for the
+ LaTeX and html exporters). When a #+begin_foo token is
+ encountered by the LaTeX exporter, it is expanded
+ into \begin{foo}. The text inside the environment is not
+ protected, as text inside environments generally is.
+ When #+begin_foo is encountered by the html exporter, a div with
+ class foo is inserted into the HTML file. It is up to the user
+ to add this class to his or her stylesheet if this div is to mean
+ anything.
+
+**** org-taskjuggler.el (Christian Egli)
+
+ Christian Egli's /org-taskjuggler.el/ module is now part of Org.
+ He also wrote a [[https://orgmode.org/worg/org-tutorials/org-taskjuggler.php][tutorial]] for it.
+
+**** org-ctags.el (Paul Sexton)
+
+ Targets like =<<my target>>= can now be found by Emacs' etag
+ functionality, and Org-mode links can be used to to link to
+ etags, also in non-Org-mode files. For details, see the file
+ /org-ctags.el/.
+
+ This feature uses a new hook =org-open-link-functions= which will
+ call function to do something special with text links.
+
+ Thanks to Paul Sexton for this contribution.
+
+**** org-docview.el (Jan Böcker)
+
+ This new module allows links to various file types using docview, where
+ Emacs displays images of document pages. Docview link types can point
+ to a specific page in a document, for example to page 131 of the
+ Org-mode manual:
+
+ : [[docview:~/.elisp/org/doc/org.pdf::131][Org-Mode Manual]]
+
+ Thanks to Jan Böcker for this contribution.
+
+*** New Babel libraries
+
+- ob-picolisp.el (Thorsten Jolitz)
+- ob-fortran.el (Sergey Litvinov)
+- ob-shen.el (Eric Schulte)
+- ob-maxima.el (Eric S Fraga)
+- ob-java.el (Eric Schulte)
+- ob-lilypond.el (Martyn Jago)
+- ob-awk.el (Eric Schulte)
+
+** Other new features and various enhancements
+
+*** Hyperlinks
+
+**** Org-Bibtex -- major improvements
+
+ Provides support for managing bibtex bibliographical references
+ data in headline properties. Each headline corresponds to a
+ single reference and the relevant bibliographic meta-data is
+ stored in headline properties, leaving the body of the headline
+ free to hold notes and comments. Org-bibtex is aware of all
+ standard bibtex reference types and fields.
+
+ The key new functions are
+
+ - org-bibtex-check :: queries the user to flesh out all required
+ (and with prefix argument optional) bibtex fields available
+ for the specific reference =type= of the current headline.
+
+ - org-bibtex-create :: Create a new entry at the given level,
+ using org-bibtex-check to flesh out the relevant fields.
+
+ - org-bibtex-yank :: Yank a bibtex entry on the kill ring as a
+ formatted Org-mode headline into the current buffer
+
+ - org-bibtex-export-to-kill-ring :: Export the current headline
+ to the kill ring as a formatted bibtex entry.
+
+**** org-gnus.el now allows link creation from messages
+
+ You can now create links from messages. This is particularly
+ useful when the user wants to stored messages that he sends, for
+ later check. Thanks to Ulf Stegemann for the patch.
+
+**** Modified link escaping
+
+ David Maus worked on `org-link-escape'. See [[msg:87k4gysacq.wl%dmaus@ictsoc.de][his message]]:
+
+ : Percent escaping is used in Org mode to escape certain characters
+ : in links that would either break the parser (e.g. square brackets
+ : in link target or description) or are not allowed to appear in
+ : a particular link type (e.g. non-ascii characters in a http:
+ : link).
+ :
+ : With this change in place Org will apply percent escaping and
+ : unescaping more consistently especially for non-ascii characters.
+ : Additionally some of the outstanding bugs or glitches concerning
+ : percent escaped links are solved.
+
+ Thanks a lot to David for this work.
+
+**** Make =org-store-link= point to directory in a dired buffer
+
+ When, in a dired buffer, the cursor is not in a line listing a
+ file, `org-store-link' will store a link to the directory.
+
+ Patch by Stephen Eglen.
+
+**** Allow regexps in =org-file-apps= to capture link parameters
+
+ The way extension regexps in =org-file-apps= are handled has
+ changed. Instead of matching against the file name, the regexps
+ are now matched against the whole link, and you can use grouping
+ to extract link parameters which you can then use in a command
+ string to be executed.
+
+ For example, to allow linking to PDF files using the syntax
+ =file:/doc.pdf::<page number>=, you can add the following entry
+ to org-file-apps:
+
+ #+begin_example
+ Extension: \.pdf::\([0-9]+\)\'
+ Command: evince "%s" -p %1
+ #+end_example
+
+ Thanks to Jan Böcker for a patch to this effect.
+
+*** Dates and time
+
+**** Allow relative time when scheduling/adding a deadline
+
+ You can now use relative duration strings like "-2d" or "++3w"
+ when calling =org-schedule= or =org-deadline=: it will schedule
+ (or set the deadline for) the item respectively two days before
+ today and three weeks after the current timestamp, if any.
+
+ You can use this programmatically: =(org-schedule nil "+2d")=
+ will work on the current entry.
+
+ You can also use this while (bulk-)rescheduling and
+ (bulk-)resetting the deadline of (several) items from the agenda.
+
+ Thanks to Memnon Anon for a heads up about this!
+
+**** American-style dates are now understood by =org-read-date=
+
+ So when you are prompted for a date, you can now answer like this
+
+ #+begin_example
+ 2/5/3 --> 2003-02-05
+ 2/5 --> <CURRENT-YEAR>-02-05
+ #+end_example
+
+*** Agenda
+
+**** =org-agenda-custom-commands= has a default value
+
+ This option used to be `nil' by default. This now has a default
+ value, displaying an agenda and all TODOs. See the docstring for
+ details. Thanks to Carsten for this.
+
+**** Improved filtering through =org-agenda-to-appt=
+
+ The new function allows the user to refine the scope of entries
+ to pass to =org-agenda-get-day-entries= and allows to filter out
+ entries using a function.
+
+ Thanks to Peter Münster for raising a related issue and to
+ Tassilo Horn for this idea. Also thanks to Peter Münster for
+ [[git:68ffb7a7][fixing a small bug]] in the final implementation.
+
+**** Allow ap/pm times in agenda time grid
+
+ Times in the agenda can now be displayed in am/pm format. See
+ the new variable =org-agenda-timegrid-use-ampm=. Thanks to
+ C. A. Webber for a patch to this effect.
+
+**** Agenda: Added a bulk "scattering" command
+
+ =B S= in the agenda buffer will cause tasks to be rescheduled a
+ random number of days into the future, with 7 as the default.
+ This is useful if you've got a ton of tasks scheduled for today,
+ you realize you'll never deal with them all, and you just want
+ them to be distributed across the next N days. When called with
+ a prefix arg, rescheduling will avoid weekend days.
+
+ Thanks to John Wiegley for this.
+
+*** Exporting
+
+**** Simplification of org-export-html-preamble/postamble
+
+ When set to `t', export the preamble/postamble as usual, honoring
+ the =org-export-email/author/creator-info= variables.
+
+ When set to a formatting string, insert this string. See the
+ docstring of these variable for details about available
+ %-sequences.
+
+ You can set =:html-preamble= in publishing project in the same
+ way: `t' means to honor =:email/creator/author-info=, and a
+ formatting string will insert a string.
+
+**** New exporters to Latin-1 and UTF-8
+
+ While Ulf Stegemann was going through the entities list to
+ improve the LaTeX export, he had the great idea to provide
+ representations for many of the entities in Latin-1, and for all
+ of them in UTF-8. This means that we can now export files rich
+ in special symbols to Latin-1 and to UTF-8 files. These new
+ exporters can be reached with the commands =C-c C-e n= and =C-c
+ C-e u=, respectively.
+
+ When there is no representation for a given symbol in the
+ targeted coding system, you can choose to keep the TeX-macro-like
+ representation, or to get an "explanatory" representation. For
+ example, =\simeq= could be represented as "[approx. equal to]".
+ Please use the variable =org-entities-ascii-explanatory= to state
+ your preference.
+
+**** HTML export: Add class to outline containers using property
+
+ The =HTML_CONTAINER_CLASS= property can now be used to add a
+ class name to the outline container of a node in HTML export.
+
+**** Throw an error when creating an image from a LaTeX snippet fails
+
+ This behavior can be configured with the new option variable
+ =org-format-latex-signal-error=.
+
+**** Support for creating BEAMER presentations from Org-mode documents
+
+ 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 [[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
+ BEAMER support and how it should work. This was a great example
+ for how this community can achieve a much better result than any
+ individual could.
+
+*** Refiling
+
+**** Refile targets can now be cached
+
+ You can turn on caching of refile targets by setting the variable
+ =org-refile-use-cache=. This should speed up refiling if you
+ have many eligible targets in many files. If you need to update
+ the cache because Org misses a newly created entry or still
+ offers a deleted one, press =C-0 C-c C-w=.
+
+**** New logging support for refiling
+
+ Whenever you refile an item, a time stamp and even a note can be
+ added to this entry. For details, see the new option
+ =org-log-refile=.
+
+ Thanks to Charles Cave for this idea.
+
+*** Completion
+
+**** In-buffer completion is now done using John Wiegley's pcomplete.el
+
+ Thanks to John Wiegley for much of this code.
+
+*** Tables
+
+**** New command =org-table-transpose-table-at-point=
+
+ See the docstring. This hack from Juan Pechiar is now part of
+ Org's core. Thanks to Juan!
+
+**** Display field's coordinates when editing it with =C-c `=
+
+ When editing a field with =C-c `=, the field's coordinate will
+ the displayed in the buffer.
+
+ Thanks to Michael Brand for a patch to this effect.
+
+**** Spreadsheet computation of durations and time values
+
+ If you want to compute time values use the =T= flag, either in
+ Calc formulas or Elisp formulas:
+
+ | Task 1 | Task 2 | Total |
+ |--------+--------+---------|
+ | 35:00 | 35:00 | 1:10:00 |
+ #+TBLFM: @2$3=$1+$2;T
+
+ Values must be of the form =[HH:]MM:SS=, where hours are
+ optional.
+
+ Thanks to Martin Halder, Eric Schulte and Carsten for code and
+ feedback on this.
+
+**** Implement formulas applying to field ranges
+
+ Carsten implemented this field-ranges formulas.
+
+ : A frequently requested feature for tables has been to be able to define
+ : row formulas in a way similar to column formulas. The patch below allows
+ : things like
+ :
+ : @3=
+ : @2$2..@5$7=
+ : @I$2..@II$4=
+ :
+ : as the left hand side for table formulas in order to write a formula that
+ : is valid for an entire column or for a rectangular section in a
+ : table.
+
+ Thanks a lot to Carsten for this.
+
+**** Sending radio tables from org buffers is now allowed
+
+ Org radio tables can no also be sent inside Org buffers. Also,
+ there is a new hook which get called after a table has been sent.
+
+ Thanks to Seweryn Kokot.
+
+*** Lists
+
+**** Improved handling of lists
+
+ Nicolas Goaziou extended and improved the way Org handles lists.
+
+ 1. Indentation of text determines again end of items in
+ lists. So, some text less indented than the previous item
+ doesn't close the whole list anymore, only all items more
+ indented than it.
+
+ 2. Alphabetical bullets are implemented, through the use of the
+ variable `org-alphabetical-lists'. This also adds alphabetical
+ counters like [@c] or [@W].
+
+ 3. Lists can now safely contain drawers, inline tasks, or various
+ blocks, themselves containing lists. Two variables are
+ controlling this: `org-list-forbidden-blocks', and
+ `org-list-export-context'.
+
+ 4. Improve `newline-and-indent' (C-j): used in an item, it will
+ keep text from moving at column 0. This allows to split text
+ and make paragraphs and still not break the list.
+
+ 5. Improve `org-toggle-item' (C-c -): used on a region with
+ standard text, it will change the region into one item. With a
+ prefix argument, it will fallback to the previous behavior and
+ make every line in region an item. It permits to easily
+ integrate paragraphs inside a list.
+
+ 6. `fill-paragraph' (M-q) now understands lists. It can freely be
+ used inside items, or on text just after a list, even with no
+ blank line around, without breaking list structure.
+
+ Thanks a lot to Nicolas for all this!
+
+*** Inline display of linked images
+
+ Images can now be displayed inline. The key C-c C-x C-v does
+ toggle the display of such images. Note that only image links
+ that have no description part will be inlined.
+
+*** Implement offsets for ordered lists
+
+ If you want to start an ordered plain list with a number different
+ from 1, you can now do it like this:
+
+ : 1. [@start:12] will star a lit a number 12
+
+*** Babel: code block body expansion for table and preview
+
+ In org-babel, code is "expanded" prior to evaluation. I.e. the
+ code that is actually evaluated comprises the code block contents,
+ augmented with the extra code which assigns the referenced data to
+ variables. It is now possible to preview expanded contents, and
+ also to expand code during during tangling. This expansion takes
+ into account all header arguments, and variables.
+
+ A new keybinding `C-c M-b p' bound to `org-babel-expand-src-block'
+ can be used from inside of a source code block to preview its
+ expanded contents (which can be very useful for debugging).
+ tangling
+
+ The expanded body can now be tangled, this includes variable
+ values which may be the results of other source-code blocks, or
+ stored in headline properties or tables. One possible use for this
+ is to allow those using org-babel for their emacs initialization
+ to store values (e.g. usernames, passwords, etc...) in headline
+ properties or in tables.
+
+ Org-babel now supports three new header arguments, and new default
+ behavior for handling horizontal lines in tables (hlines), column
+ names, and rownames across all languages.
+
+*** Editing Convenience and Appearance
+
+**** New command =org-copy-visible= (=C-c C-x v=)
+
+ This command will copy the visible text in the region into the
+ kill ring. Thanks to Florian Beck for this function and to
+ Carsten for adding it to org.el and documenting it!
+
+**** Make it possible to protect hidden subtrees from being killed by =C-k=
+
+ See the new variable =org-ctrl-k-protect-subtree=. This was a
+ request by Scott Otterson.
+
+**** Implement pretty display of entities, sub-, and superscripts.
+
+ The command =C-c C-x \= toggles the display of Org's special
+ entities like =\alpha= as pretty unicode characters. Also, sub
+ and superscripts are displayed in a pretty way (raised/lower
+ display, in a smaller font). If you want to exclude sub- and
+ superscripts, see the variable
+ =org-pretty-entities-include-sub-superscripts=.
+
+ Thanks to Eric Schulte and Ulf Stegeman for making this possible.
+
+**** New faces for title, date, author and email address lines
+
+ The keywords in these lines are now dimmed out, and the title is
+ displayed in a larger font, and a special font is also used for
+ author, date, and email information. This is implemented by the
+ following new faces:
+
+ =org-document-title=
+ =org-document-info=
+ =org-document-info-keyword=
+
+ In addition, the variable =org-hidden-keywords= can be used to
+ make the corresponding keywords disappear.
+
+ Thanks to Dan Davison for this feature.
+
+**** Simpler way to specify faces for tags and todo keywords
+
+ The variables =org-todo-keyword-faces=, =org-tag-faces=, and
+ =org-priority-faces= now accept simple color names as
+ specifications. The colors will be used as either foreground or
+ background color for the corresponding keyword. See also the
+ variable =org-faces-easy-properties=, which governs which face
+ property is affected by this setting.
+
+ This is really a great simplification for setting keyword faces.
+ The change is based on an idea and patch by Ryan Thompson.
+
+**** <N> in tables now means fixed width, not maximum width
+
+ Requested by Michael Brand.
+
+**** Better level cycling function
+
+ =TAB= in an empty headline cycles the level of that headline
+ through likely states. Ryan Thompson implemented an improved
+ version of this function, which does not depend upon when exactly
+ this command is used. Thanks to Ryan for this improvement.
+
+**** Adaptive filling
+
+ For paragraph text, =org-adaptive-fill-function= did not handle
+ the base case of regular text which needed to be filled. This is
+ now fixed. Among other things, it allows email-style ">"
+ comments to be filled correctly.
+
+ Thanks to Dan Hackney for this patch.
+
+**** `org-reveal' (=C-c C-r=) also decrypts encrypted entries (org-crypt.el)
+
+ Thanks to Richard Riley for triggering this change.
+
+**** Better automatic letter selection for TODO keywords
+
+ When all first letters of keywords have been used, Org now
+ assigns more meaningful characters based on the keywords.
+
+ Thanks to Mikael Fornius for this patch.
+
+*** Clocking
+
+**** Clock: Allow synchronous update of timestamps in CLOCK log
+
+ Using =S-M-<up/down>= on CLOCK log timestamps will
+ increase/decrease the two timestamps on this line so that
+ duration will keep the same. Note that duration can still be
+ slightly modified in case a timestamp needs some rounding.
+
+ Thanks to Rainer Stengele for this idea.
+
+**** Localized clock tables
+
+ Clock tables now support a new new =:lang= parameter, allowing
+ the user to customize the localization of the table headers. See
+ the variable =org-clock-clocktable-language-setup= which controls
+ available translated strings.
+
+**** Show clock overruns in mode line
+
+ When clocking an item with a planned effort, overrunning the
+ planned time is now made visible in the mode line, for example
+ using the new face =org-mode-line-clock-overrun=, or by adding an
+ extra string given by =org-task-overrun-text=.
+
+ Thanks to Richard Riley for a patch to this effect.
+
+**** Clock reports can now include the running, incomplete clock
+
+ If you have a clock running, and the entry being clocked falls
+ into the scope when creating a clock table, the time so far spent
+ can be added to the total. This behavior depends on the setting
+ of =org-clock-report-include-clocking-task=. The default is
+ =nil=.
+
+ Thanks to Bernt Hansen for this useful addition.
+
+*** Misc
+
+**** Improvements with inline tasks and indentation
+
+ There is now a configurable way on how to export inline tasks.
+ See the new variable =org-inlinetask-export-templates=.
+
+ Thanks to Nicolas Goaziou for coding these changes.
+
+**** A property value of =nil= now means to unset a property
+
+ This can be useful in particular with property inheritance, if
+ some upper level has the property, and some grandchild of it
+ would like to have the default settings (i.e. not overruled by a
+ property) back.
+
+ Thanks to Robert Goldman and Bernt Hansen for suggesting this
+ change.
+
+**** New helper functions in org-table.el
+
+ There are new functions to access and write to a specific table field.
+ This is for hackers, and maybe for the org-babel people.
+
+ #+begin_example
+ org-table-get
+ org-table-put
+ org-table-current-line
+ org-table-goto-line
+ #+end_example
+
+**** Archiving: Allow to reverse order in target node
+
+ The new option =org-archive-reversed-order= allows to have
+ archived entries inserted in a last-on-top fashion in the target
+ node.
+
+ This was requested by Tom.
+
+**** Org-reveal: Double prefix arg shows the entire subtree of the parent
+
+ This can help to get out of an inconsistent state produced for
+ example by viewing from the agenda.
+
+ This was a request by Matt Lundin.
+
+* License
+
+ 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 <https://www.gnu.org/licenses/>.
diff --git a/elpa/org-9.5.2/etc/csl/README b/elpa/org-9.5.2/etc/csl/README
new file mode 100644
index 0000000..a921220
--- /dev/null
+++ b/elpa/org-9.5.2/etc/csl/README
@@ -0,0 +1,10 @@
+These data files are used by Org's oc-csl.el library.
+
+LICENSE INFORMATION
+
+chicago-author-date.csl
+locales-en-US.xml
+
+ Both of these files are part of the Citation Style Language (CSL)
+ project (<https://citationstyles.org/>) and are released under the
+ Creative Commons Attribution-ShareAlike 3.0 Unported license.
diff --git a/elpa/org-9.5.2/etc/csl/chicago-author-date.csl b/elpa/org-9.5.2/etc/csl/chicago-author-date.csl
new file mode 100644
index 0000000..8c13335
--- /dev/null
+++ b/elpa/org-9.5.2/etc/csl/chicago-author-date.csl
@@ -0,0 +1,658 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="display-and-sort" page-range-format="chicago">
+ <info>
+ <title>Chicago Manual of Style 17th edition (author-date)</title>
+ <id>http://www.zotero.org/styles/chicago-author-date</id>
+ <link href="http://www.zotero.org/styles/chicago-author-date" rel="self"/>
+ <link href="http://www.chicagomanualofstyle.org/tools_citationguide.html" rel="documentation"/>
+ <author>
+ <name>Julian Onions</name>
+ <email>julian.onions@gmail.com</email>
+ </author>
+ <contributor>
+ <name>Sebastian Karcher</name>
+ </contributor>
+ <contributor>
+ <name>Richard Karnesky</name>
+ <email>karnesky+zotero@gmail.com</email>
+ <uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri>
+ </contributor>
+ <contributor>
+ <name>Andrew Dunning</name>
+ <email>andrew.dunning@utoronto.ca</email>
+ <uri>https://orcid.org/0000-0003-0464-5036</uri>
+ </contributor>
+ <contributor>
+ <name>Matthew Roth</name>
+ <email>matthew.g.roth@yale.edu</email>
+ <uri> https://orcid.org/0000-0001-7902-6331</uri>
+ </contributor>
+ <contributor>
+ <name>Brenton M. Wiernik</name>
+ </contributor>
+ <category citation-format="author-date"/>
+ <category field="generic-base"/>
+ <summary>The author-date variant of the Chicago style</summary>
+ <updated>2018-01-24T12:00:00+00:00</updated>
+ <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+ </info>
+ <locale xml:lang="en">
+ <terms>
+ <term name="editor" form="verb-short">ed.</term>
+ <term name="container-author" form="verb">by</term>
+ <term name="translator" form="verb-short">trans.</term>
+ <term name="editortranslator" form="verb">edited and translated by</term>
+ <term name="translator" form="short">trans.</term>
+ </terms>
+ </locale>
+ <macro name="secondary-contributors">
+ <choose>
+ <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="none">
+ <group delimiter=". ">
+ <names variable="editor translator" delimiter=". ">
+ <label form="verb" text-case="capitalize-first" suffix=" "/>
+ <name and="text" delimiter=", "/>
+ </names>
+ <names variable="director" delimiter=". ">
+ <label form="verb" text-case="capitalize-first" suffix=" "/>
+ <name and="text" delimiter=", "/>
+ </names>
+ </group>
+ </if>
+ </choose>
+ </macro>
+ <macro name="container-contributors">
+ <choose>
+ <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+ <group prefix=", " delimiter=", ">
+ <names variable="container-author" delimiter=", ">
+ <label form="verb" suffix=" "/>
+ <name and="text" delimiter=", "/>
+ </names>
+ <names variable="editor translator" delimiter=", ">
+ <label form="verb" suffix=" "/>
+ <name and="text" delimiter=", "/>
+ </names>
+ </group>
+ </if>
+ </choose>
+ </macro>
+ <macro name="editor">
+ <names variable="editor">
+ <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+ <label form="short" prefix=", "/>
+ </names>
+ </macro>
+ <macro name="translator">
+ <names variable="translator">
+ <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+ <label form="short" prefix=", "/>
+ </names>
+ </macro>
+ <macro name="recipient">
+ <choose>
+ <if type="personal_communication">
+ <choose>
+ <if variable="genre">
+ <text variable="genre" text-case="capitalize-first"/>
+ </if>
+ <else>
+ <text term="letter" text-case="capitalize-first"/>
+ </else>
+ </choose>
+ </if>
+ </choose>
+ <names variable="recipient" delimiter=", ">
+ <label form="verb" prefix=" " text-case="lowercase" suffix=" "/>
+ <name and="text" delimiter=", "/>
+ </names>
+ </macro>
+ <macro name="substitute-title">
+ <choose>
+ <if type="article-magazine article-newspaper review review-book" match="any">
+ <text macro="container-title"/>
+ </if>
+ </choose>
+ </macro>
+ <macro name="contributors">
+ <group delimiter=". ">
+ <names variable="author">
+ <name and="text" name-as-sort-order="first" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+ <label form="short" prefix=", "/>
+ <substitute>
+ <names variable="editor"/>
+ <names variable="translator"/>
+ <names variable="director"/>
+ <text macro="substitute-title"/>
+ <text macro="title"/>
+ </substitute>
+ </names>
+ <text macro="recipient"/>
+ </group>
+ </macro>
+ <macro name="contributors-short">
+ <names variable="author">
+ <name form="short" and="text" delimiter=", " initialize-with=". "/>
+ <substitute>
+ <names variable="editor"/>
+ <names variable="translator"/>
+ <names variable="director"/>
+ <text macro="substitute-title"/>
+ <text macro="title"/>
+ </substitute>
+ </names>
+ </macro>
+ <macro name="interviewer">
+ <names variable="interviewer" delimiter=", ">
+ <label form="verb" prefix=" " text-case="capitalize-first" suffix=" "/>
+ <name and="text" delimiter=", "/>
+ </names>
+ </macro>
+ <macro name="archive">
+ <group delimiter=". ">
+ <text variable="archive_location" text-case="capitalize-first"/>
+ <text variable="archive"/>
+ <text variable="archive-place"/>
+ </group>
+ </macro>
+ <macro name="access">
+ <group delimiter=". ">
+ <choose>
+ <if type="graphic report" match="any">
+ <text macro="archive"/>
+ </if>
+ <else-if type="article-journal bill book chapter legal_case legislation motion_picture paper-conference" match="none">
+ <text macro="archive"/>
+ </else-if>
+ </choose>
+ <choose>
+ <if type="webpage post-weblog" match="any">
+ <date variable="issued" form="text"/>
+ </if>
+ </choose>
+ <choose>
+ <if variable="issued" match="none">
+ <group delimiter=" ">
+ <text term="accessed" text-case="capitalize-first"/>
+ <date variable="accessed" form="text"/>
+ </group>
+ </if>
+ </choose>
+ <choose>
+ <if type="legal_case" match="none">
+ <choose>
+ <if variable="DOI">
+ <text variable="DOI" prefix="https://doi.org/"/>
+ </if>
+ <else>
+ <text variable="URL"/>
+ </else>
+ </choose>
+ </if>
+ </choose>
+ </group>
+ </macro>
+ <macro name="title">
+ <choose>
+ <if variable="title" match="none">
+ <choose>
+ <if type="personal_communication" match="none">
+ <text variable="genre" text-case="capitalize-first"/>
+ </if>
+ </choose>
+ </if>
+ <else-if type="bill book graphic legislation motion_picture song" match="any">
+ <text variable="title" text-case="title" font-style="italic"/>
+ <group prefix=" (" suffix=")" delimiter=" ">
+ <text term="version"/>
+ <text variable="version"/>
+ </group>
+ </else-if>
+ <else-if variable="reviewed-author">
+ <choose>
+ <if variable="reviewed-title">
+ <group delimiter=". ">
+ <text variable="title" text-case="title" quotes="true"/>
+ <group delimiter=", ">
+ <text variable="reviewed-title" text-case="title" font-style="italic" prefix="Review of "/>
+ <names variable="reviewed-author">
+ <label form="verb-short" text-case="lowercase" suffix=" "/>
+ <name and="text" delimiter=", "/>
+ </names>
+ </group>
+ </group>
+ </if>
+ <else>
+ <group delimiter=", ">
+ <text variable="title" text-case="title" font-style="italic" prefix="Review of "/>
+ <names variable="reviewed-author">
+ <label form="verb-short" text-case="lowercase" suffix=" "/>
+ <name and="text" delimiter=", "/>
+ </names>
+ </group>
+ </else>
+ </choose>
+ </else-if>
+ <else-if type="legal_case interview patent" match="any">
+ <text variable="title"/>
+ </else-if>
+ <else>
+ <text variable="title" text-case="title" quotes="true"/>
+ </else>
+ </choose>
+ </macro>
+ <macro name="edition">
+ <choose>
+ <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+ <choose>
+ <if is-numeric="edition">
+ <group delimiter=" " prefix=". ">
+ <number variable="edition" form="ordinal"/>
+ <text term="edition" form="short" strip-periods="true"/>
+ </group>
+ </if>
+ <else>
+ <text variable="edition" text-case="capitalize-first" prefix=". "/>
+ </else>
+ </choose>
+ </if>
+ <else-if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+ <choose>
+ <if is-numeric="edition">
+ <group delimiter=" " prefix=", ">
+ <number variable="edition" form="ordinal"/>
+ <text term="edition" form="short"/>
+ </group>
+ </if>
+ <else>
+ <text variable="edition" prefix=", "/>
+ </else>
+ </choose>
+ </else-if>
+ </choose>
+ </macro>
+ <macro name="locators">
+ <choose>
+ <if type="article-journal">
+ <choose>
+ <if variable="volume">
+ <text variable="volume" prefix=" "/>
+ <group prefix=" (" suffix=")">
+ <choose>
+ <if variable="issue">
+ <text variable="issue"/>
+ </if>
+ <else>
+ <date variable="issued">
+ <date-part name="month"/>
+ </date>
+ </else>
+ </choose>
+ </group>
+ </if>
+ <else-if variable="issue">
+ <group delimiter=" " prefix=", ">
+ <text term="issue" form="short"/>
+ <text variable="issue"/>
+ <date variable="issued" prefix="(" suffix=")">
+ <date-part name="month"/>
+ </date>
+ </group>
+ </else-if>
+ <else>
+ <date variable="issued" prefix=", ">
+ <date-part name="month"/>
+ </date>
+ </else>
+ </choose>
+ </if>
+ <else-if type="legal_case">
+ <text variable="volume" prefix=", "/>
+ <text variable="container-title" prefix=" "/>
+ <text variable="page" prefix=" "/>
+ </else-if>
+ <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+ <group prefix=". " delimiter=". ">
+ <group>
+ <text term="volume" form="short" text-case="capitalize-first" suffix=" "/>
+ <number variable="volume" form="numeric"/>
+ </group>
+ <group>
+ <number variable="number-of-volumes" form="numeric"/>
+ <text term="volume" form="short" prefix=" " plural="true"/>
+ </group>
+ </group>
+ </else-if>
+ <else-if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+ <choose>
+ <if variable="page" match="none">
+ <group prefix=". ">
+ <text term="volume" form="short" text-case="capitalize-first" suffix=" "/>
+ <number variable="volume" form="numeric"/>
+ </group>
+ </if>
+ </choose>
+ </else-if>
+ </choose>
+ </macro>
+ <macro name="locators-chapter">
+ <choose>
+ <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+ <choose>
+ <if variable="page">
+ <group prefix=", ">
+ <text variable="volume" suffix=":"/>
+ <text variable="page"/>
+ </group>
+ </if>
+ </choose>
+ </if>
+ </choose>
+ </macro>
+ <macro name="locators-article">
+ <choose>
+ <if type="article-newspaper">
+ <group prefix=", " delimiter=", ">
+ <group delimiter=" ">
+ <text variable="edition"/>
+ <text term="edition"/>
+ </group>
+ <group>
+ <text term="section" form="short" suffix=" "/>
+ <text variable="section"/>
+ </group>
+ </group>
+ </if>
+ <else-if type="article-journal">
+ <choose>
+ <if variable="volume issue" match="any">
+ <text variable="page" prefix=": "/>
+ </if>
+ <else>
+ <text variable="page" prefix=", "/>
+ </else>
+ </choose>
+ </else-if>
+ </choose>
+ </macro>
+ <macro name="point-locators">
+ <choose>
+ <if variable="locator">
+ <choose>
+ <if locator="page" match="none">
+ <choose>
+ <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+ <choose>
+ <if variable="volume">
+ <group>
+ <text term="volume" form="short" suffix=" "/>
+ <number variable="volume" form="numeric"/>
+ <label variable="locator" form="short" prefix=", " suffix=" "/>
+ </group>
+ </if>
+ <else>
+ <label variable="locator" form="short" suffix=" "/>
+ </else>
+ </choose>
+ </if>
+ <else>
+ <label variable="locator" form="short" suffix=" "/>
+ </else>
+ </choose>
+ </if>
+ <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+ <number variable="volume" form="numeric" suffix=":"/>
+ </else-if>
+ </choose>
+ <text variable="locator"/>
+ </if>
+ </choose>
+ </macro>
+ <macro name="container-prefix">
+ <text term="in" text-case="capitalize-first"/>
+ </macro>
+ <macro name="container-title">
+ <choose>
+ <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+ <text macro="container-prefix" suffix=" "/>
+ </if>
+ </choose>
+ <choose>
+ <if type="webpage">
+ <text variable="container-title" text-case="title"/>
+ </if>
+ <else-if type="legal_case" match="none">
+ <group delimiter=" ">
+ <text variable="container-title" text-case="title" font-style="italic"/>
+ <choose>
+ <if type="post-weblog">
+ <text value="(blog)"/>
+ </if>
+ </choose>
+ </group>
+ </else-if>
+ </choose>
+ </macro>
+ <macro name="publisher">
+ <group delimiter=": ">
+ <text variable="publisher-place"/>
+ <text variable="publisher"/>
+ </group>
+ </macro>
+ <macro name="date">
+ <choose>
+ <if variable="issued">
+ <group delimiter=" ">
+ <date variable="original-date" form="text" date-parts="year" prefix="(" suffix=")"/>
+ <date variable="issued">
+ <date-part name="year"/>
+ </date>
+ </group>
+ </if>
+ <else-if variable="status">
+ <text variable="status" text-case="capitalize-first"/>
+ </else-if>
+ <else>
+ <text term="no date" form="short"/>
+ </else>
+ </choose>
+ </macro>
+ <macro name="date-in-text">
+ <choose>
+ <if variable="issued">
+ <group delimiter=" ">
+ <date variable="original-date" form="text" date-parts="year" prefix="[" suffix="]"/>
+ <date variable="issued">
+ <date-part name="year"/>
+ </date>
+ </group>
+ </if>
+ <else-if variable="status">
+ <text variable="status"/>
+ </else-if>
+ <else>
+ <text term="no date" form="short"/>
+ </else>
+ </choose>
+ </macro>
+ <macro name="day-month">
+ <date variable="issued">
+ <date-part name="month"/>
+ <date-part name="day" prefix=" "/>
+ </date>
+ </macro>
+ <macro name="collection-title">
+ <choose>
+ <if match="none" type="article-journal">
+ <choose>
+ <if match="none" is-numeric="collection-number">
+ <group delimiter=", ">
+ <text variable="collection-title" text-case="title"/>
+ <text variable="collection-number"/>
+ </group>
+ </if>
+ <else>
+ <group delimiter=" ">
+ <text variable="collection-title" text-case="title"/>
+ <text variable="collection-number"/>
+ </group>
+ </else>
+ </choose>
+ </if>
+ </choose>
+ </macro>
+ <macro name="collection-title-journal">
+ <choose>
+ <if type="article-journal">
+ <group delimiter=" ">
+ <text variable="collection-title"/>
+ <text variable="collection-number"/>
+ </group>
+ </if>
+ </choose>
+ </macro>
+ <macro name="event">
+ <group delimiter=" ">
+ <choose>
+ <if variable="genre">
+ <text term="presented at"/>
+ </if>
+ <else>
+ <text term="presented at" text-case="capitalize-first"/>
+ </else>
+ </choose>
+ <text variable="event"/>
+ </group>
+ </macro>
+ <macro name="description">
+ <choose>
+ <if variable="interviewer" type="interview" match="any">
+ <group delimiter=". ">
+ <text macro="interviewer"/>
+ <text variable="medium" text-case="capitalize-first"/>
+ </group>
+ </if>
+ <else-if type="patent">
+ <group delimiter=" " prefix=". ">
+ <text variable="authority"/>
+ <text variable="number"/>
+ </group>
+ </else-if>
+ <else>
+ <text variable="medium" text-case="capitalize-first" prefix=". "/>
+ </else>
+ </choose>
+ <choose>
+ <if variable="title" match="none"/>
+ <else-if type="thesis personal_communication speech" match="any"/>
+ <else>
+ <group delimiter=" " prefix=". ">
+ <text variable="genre" text-case="capitalize-first"/>
+ <choose>
+ <if type="report">
+ <text variable="number"/>
+ </if>
+ </choose>
+ </group>
+ </else>
+ </choose>
+ </macro>
+ <macro name="issue">
+ <choose>
+ <if type="legal_case">
+ <text variable="authority" prefix=". "/>
+ </if>
+ <else-if type="speech">
+ <group prefix=". " delimiter=", ">
+ <group delimiter=" ">
+ <text variable="genre" text-case="capitalize-first"/>
+ <text macro="event"/>
+ </group>
+ <text variable="event-place"/>
+ <text macro="day-month"/>
+ </group>
+ </else-if>
+ <else-if type="article-newspaper article-magazine personal_communication" match="any">
+ <date variable="issued" form="text" prefix=", "/>
+ </else-if>
+ <else-if type="patent">
+ <group delimiter=", " prefix=", ">
+ <group delimiter=" ">
+ <!--Needs Localization-->
+ <text value="filed"/>
+ <date variable="submitted" form="text"/>
+ </group>
+ <group delimiter=" ">
+ <choose>
+ <if variable="issued submitted" match="all">
+ <text term="and"/>
+ </if>
+ </choose>
+ <!--Needs Localization-->
+ <text value="issued"/>
+ <date variable="issued" form="text"/>
+ </group>
+ </group>
+ </else-if>
+ <else-if type="article-journal" match="any"/>
+ <else>
+ <group prefix=". " delimiter=", ">
+ <choose>
+ <if type="thesis">
+ <text variable="genre" text-case="capitalize-first"/>
+ </if>
+ </choose>
+ <text macro="publisher"/>
+ </group>
+ </else>
+ </choose>
+ </macro>
+ <citation et-al-min="4" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" givenname-disambiguation-rule="primary-name" collapse="year" after-collapse-delimiter="; ">
+ <layout prefix="(" suffix=")" delimiter="; ">
+ <group delimiter=", ">
+ <choose>
+ <if variable="issued accessed" match="any">
+ <group delimiter=" ">
+ <text macro="contributors-short"/>
+ <text macro="date-in-text"/>
+ </group>
+ </if>
+ <!---comma before forthcoming and n.d.-->
+ <else>
+ <group delimiter=", ">
+ <text macro="contributors-short"/>
+ <text macro="date-in-text"/>
+ </group>
+ </else>
+ </choose>
+ <text macro="point-locators"/>
+ </group>
+ </layout>
+ </citation>
+ <bibliography hanging-indent="true" et-al-min="11" et-al-use-first="7" subsequent-author-substitute="&#8212;&#8212;&#8212;" entry-spacing="0">
+ <sort>
+ <key macro="contributors"/>
+ <key variable="issued"/>
+ <key variable="title"/>
+ </sort>
+ <layout suffix=".">
+ <group delimiter=". ">
+ <text macro="contributors"/>
+ <text macro="date"/>
+ <text macro="title"/>
+ </group>
+ <text macro="description"/>
+ <text macro="secondary-contributors" prefix=". "/>
+ <text macro="container-title" prefix=". "/>
+ <text macro="container-contributors"/>
+ <text macro="edition"/>
+ <text macro="locators-chapter"/>
+ <text macro="collection-title-journal" prefix=", " suffix=", "/>
+ <text macro="locators"/>
+ <text macro="collection-title" prefix=". "/>
+ <text macro="issue"/>
+ <text macro="locators-article"/>
+ <text macro="access" prefix=". "/>
+ </layout>
+ </bibliography>
+</style>
diff --git a/elpa/org-9.5.2/etc/csl/locales-en-US.xml b/elpa/org-9.5.2/etc/csl/locales-en-US.xml
new file mode 100644
index 0000000..be78c5e
--- /dev/null
+++ b/elpa/org-9.5.2/etc/csl/locales-en-US.xml
@@ -0,0 +1,357 @@
+<?xml version="1.0" encoding="utf-8"?>
+<locale xmlns="http://purl.org/net/xbiblio/csl" version="1.0" xml:lang="en-US">
+ <info>
+ <translator>
+ <name>Andrew Dunning</name>
+ </translator>
+ <translator>
+ <name>Sebastian Karcher</name>
+ </translator>
+ <translator>
+ <name>Rintze M. Zelle</name>
+ </translator>
+ <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+ <updated>2015-10-10T23:31:02+00:00</updated>
+ </info>
+ <style-options punctuation-in-quote="true"/>
+ <date form="text">
+ <date-part name="month" suffix=" "/>
+ <date-part name="day" suffix=", "/>
+ <date-part name="year"/>
+ </date>
+ <date form="numeric">
+ <date-part name="month" form="numeric-leading-zeros" suffix="/"/>
+ <date-part name="day" form="numeric-leading-zeros" suffix="/"/>
+ <date-part name="year"/>
+ </date>
+ <terms>
+ <term name="accessed">accessed</term>
+ <term name="and">and</term>
+ <term name="and others">and others</term>
+ <term name="anonymous">anonymous</term>
+ <term name="anonymous" form="short">anon.</term>
+ <term name="at">at</term>
+ <term name="available at">available at</term>
+ <term name="by">by</term>
+ <term name="circa">circa</term>
+ <term name="circa" form="short">c.</term>
+ <term name="cited">cited</term>
+ <term name="edition">
+ <single>edition</single>
+ <multiple>editions</multiple>
+ </term>
+ <term name="edition" form="short">ed.</term>
+ <term name="et-al">et al.</term>
+ <term name="forthcoming">forthcoming</term>
+ <term name="from">from</term>
+ <term name="ibid">ibid.</term>
+ <term name="in">in</term>
+ <term name="in press">in press</term>
+ <term name="internet">internet</term>
+ <term name="interview">interview</term>
+ <term name="letter">letter</term>
+ <term name="no date">no date</term>
+ <term name="no date" form="short">n.d.</term>
+ <term name="online">online</term>
+ <term name="presented at">presented at the</term>
+ <term name="reference">
+ <single>reference</single>
+ <multiple>references</multiple>
+ </term>
+ <term name="reference" form="short">
+ <single>ref.</single>
+ <multiple>refs.</multiple>
+ </term>
+ <term name="retrieved">retrieved</term>
+ <term name="scale">scale</term>
+ <term name="version">version</term>
+
+ <!-- ANNO DOMINI; BEFORE CHRIST -->
+ <term name="ad">AD</term>
+ <term name="bc">BC</term>
+
+ <!-- PUNCTUATION -->
+ <term name="open-quote">“</term>
+ <term name="close-quote">”</term>
+ <term name="open-inner-quote">‘</term>
+ <term name="close-inner-quote">’</term>
+ <term name="page-range-delimiter">–</term>
+
+ <!-- ORDINALS -->
+ <term name="ordinal">th</term>
+ <term name="ordinal-01">st</term>
+ <term name="ordinal-02">nd</term>
+ <term name="ordinal-03">rd</term>
+ <term name="ordinal-11">th</term>
+ <term name="ordinal-12">th</term>
+ <term name="ordinal-13">th</term>
+
+ <!-- LONG ORDINALS -->
+ <term name="long-ordinal-01">first</term>
+ <term name="long-ordinal-02">second</term>
+ <term name="long-ordinal-03">third</term>
+ <term name="long-ordinal-04">fourth</term>
+ <term name="long-ordinal-05">fifth</term>
+ <term name="long-ordinal-06">sixth</term>
+ <term name="long-ordinal-07">seventh</term>
+ <term name="long-ordinal-08">eighth</term>
+ <term name="long-ordinal-09">ninth</term>
+ <term name="long-ordinal-10">tenth</term>
+
+ <!-- LONG LOCATOR FORMS -->
+ <term name="book">
+ <single>book</single>
+ <multiple>books</multiple>
+ </term>
+ <term name="chapter">
+ <single>chapter</single>
+ <multiple>chapters</multiple>
+ </term>
+ <term name="column">
+ <single>column</single>
+ <multiple>columns</multiple>
+ </term>
+ <term name="figure">
+ <single>figure</single>
+ <multiple>figures</multiple>
+ </term>
+ <term name="folio">
+ <single>folio</single>
+ <multiple>folios</multiple>
+ </term>
+ <term name="issue">
+ <single>number</single>
+ <multiple>numbers</multiple>
+ </term>
+ <term name="line">
+ <single>line</single>
+ <multiple>lines</multiple>
+ </term>
+ <term name="note">
+ <single>note</single>
+ <multiple>notes</multiple>
+ </term>
+ <term name="opus">
+ <single>opus</single>
+ <multiple>opera</multiple>
+ </term>
+ <term name="page">
+ <single>page</single>
+ <multiple>pages</multiple>
+ </term>
+ <term name="number-of-pages">
+ <single>page</single>
+ <multiple>pages</multiple>
+ </term>
+ <term name="paragraph">
+ <single>paragraph</single>
+ <multiple>paragraphs</multiple>
+ </term>
+ <term name="part">
+ <single>part</single>
+ <multiple>parts</multiple>
+ </term>
+ <term name="section">
+ <single>section</single>
+ <multiple>sections</multiple>
+ </term>
+ <term name="sub verbo">
+ <single>sub verbo</single>
+ <multiple>sub verbis</multiple>
+ </term>
+ <term name="verse">
+ <single>verse</single>
+ <multiple>verses</multiple>
+ </term>
+ <term name="volume">
+ <single>volume</single>
+ <multiple>volumes</multiple>
+ </term>
+
+ <!-- SHORT LOCATOR FORMS -->
+ <term name="book" form="short">
+ <single>bk.</single>
+ <multiple>bks.</multiple>
+ </term>
+ <term name="chapter" form="short">
+ <single>chap.</single>
+ <multiple>chaps.</multiple>
+ </term>
+ <term name="column" form="short">
+ <single>col.</single>
+ <multiple>cols.</multiple>
+ </term>
+ <term name="figure" form="short">
+ <single>fig.</single>
+ <multiple>figs.</multiple>
+ </term>
+ <term name="folio" form="short">
+ <single>fol.</single>
+ <multiple>fols.</multiple>
+ </term>
+ <term name="issue" form="short">
+ <single>no.</single>
+ <multiple>nos.</multiple>
+ </term>
+ <term name="line" form="short">
+ <single>l.</single>
+ <multiple>ll.</multiple>
+ </term>
+ <term name="note" form="short">
+ <single>n.</single>
+ <multiple>nn.</multiple>
+ </term>
+ <term name="opus" form="short">
+ <single>op.</single>
+ <multiple>opp.</multiple>
+ </term>
+ <term name="page" form="short">
+ <single>p.</single>
+ <multiple>pp.</multiple>
+ </term>
+ <term name="number-of-pages" form="short">
+ <single>p.</single>
+ <multiple>pp.</multiple>
+ </term>
+ <term name="paragraph" form="short">
+ <single>para.</single>
+ <multiple>paras.</multiple>
+ </term>
+ <term name="part" form="short">
+ <single>pt.</single>
+ <multiple>pts.</multiple>
+ </term>
+ <term name="section" form="short">
+ <single>sec.</single>
+ <multiple>secs.</multiple>
+ </term>
+ <term name="sub verbo" form="short">
+ <single>s.v.</single>
+ <multiple>s.vv.</multiple>
+ </term>
+ <term name="verse" form="short">
+ <single>v.</single>
+ <multiple>vv.</multiple>
+ </term>
+ <term name="volume" form="short">
+ <single>vol.</single>
+ <multiple>vols.</multiple>
+ </term>
+
+ <!-- SYMBOL LOCATOR FORMS -->
+ <term name="paragraph" form="symbol">
+ <single>¶</single>
+ <multiple>¶¶</multiple>
+ </term>
+ <term name="section" form="symbol">
+ <single>§</single>
+ <multiple>§§</multiple>
+ </term>
+
+ <!-- LONG ROLE FORMS -->
+ <term name="director">
+ <single>director</single>
+ <multiple>directors</multiple>
+ </term>
+ <term name="editor">
+ <single>editor</single>
+ <multiple>editors</multiple>
+ </term>
+ <term name="editorial-director">
+ <single>editor</single>
+ <multiple>editors</multiple>
+ </term>
+ <term name="illustrator">
+ <single>illustrator</single>
+ <multiple>illustrators</multiple>
+ </term>
+ <term name="translator">
+ <single>translator</single>
+ <multiple>translators</multiple>
+ </term>
+ <term name="editortranslator">
+ <single>editor &amp; translator</single>
+ <multiple>editors &amp; translators</multiple>
+ </term>
+
+ <!-- SHORT ROLE FORMS -->
+ <term name="director" form="short">
+ <single>dir.</single>
+ <multiple>dirs.</multiple>
+ </term>
+ <term name="editor" form="short">
+ <single>ed.</single>
+ <multiple>eds.</multiple>
+ </term>
+ <term name="editorial-director" form="short">
+ <single>ed.</single>
+ <multiple>eds.</multiple>
+ </term>
+ <term name="illustrator" form="short">
+ <single>ill.</single>
+ <multiple>ills.</multiple>
+ </term>
+ <term name="translator" form="short">
+ <single>tran.</single>
+ <multiple>trans.</multiple>
+ </term>
+ <term name="editortranslator" form="short">
+ <single>ed. &amp; tran.</single>
+ <multiple>eds. &amp; trans.</multiple>
+ </term>
+
+ <!-- VERB ROLE FORMS -->
+ <term name="container-author" form="verb">by</term>
+ <term name="director" form="verb">directed by</term>
+ <term name="editor" form="verb">edited by</term>
+ <term name="editorial-director" form="verb">edited by</term>
+ <term name="illustrator" form="verb">illustrated by</term>
+ <term name="interviewer" form="verb">interview by</term>
+ <term name="recipient" form="verb">to</term>
+ <term name="reviewed-author" form="verb">by</term>
+ <term name="translator" form="verb">translated by</term>
+ <term name="editortranslator" form="verb">edited &amp; translated by</term>
+
+ <!-- SHORT VERB ROLE FORMS -->
+ <term name="director" form="verb-short">dir. by</term>
+ <term name="editor" form="verb-short">ed. by</term>
+ <term name="editorial-director" form="verb-short">ed. by</term>
+ <term name="illustrator" form="verb-short">illus. by</term>
+ <term name="translator" form="verb-short">trans. by</term>
+ <term name="editortranslator" form="verb-short">ed. &amp; trans. by</term>
+
+ <!-- LONG MONTH FORMS -->
+ <term name="month-01">January</term>
+ <term name="month-02">February</term>
+ <term name="month-03">March</term>
+ <term name="month-04">April</term>
+ <term name="month-05">May</term>
+ <term name="month-06">June</term>
+ <term name="month-07">July</term>
+ <term name="month-08">August</term>
+ <term name="month-09">September</term>
+ <term name="month-10">October</term>
+ <term name="month-11">November</term>
+ <term name="month-12">December</term>
+
+ <!-- SHORT MONTH FORMS -->
+ <term name="month-01" form="short">Jan.</term>
+ <term name="month-02" form="short">Feb.</term>
+ <term name="month-03" form="short">Mar.</term>
+ <term name="month-04" form="short">Apr.</term>
+ <term name="month-05" form="short">May</term>
+ <term name="month-06" form="short">Jun.</term>
+ <term name="month-07" form="short">Jul.</term>
+ <term name="month-08" form="short">Aug.</term>
+ <term name="month-09" form="short">Sep.</term>
+ <term name="month-10" form="short">Oct.</term>
+ <term name="month-11" form="short">Nov.</term>
+ <term name="month-12" form="short">Dec.</term>
+
+ <!-- SEASONS -->
+ <term name="season-01">Spring</term>
+ <term name="season-02">Summer</term>
+ <term name="season-03">Autumn</term>
+ <term name="season-04">Winter</term>
+ </terms>
+</locale>
diff --git a/elpa/org-9.5.2/etc/styles/OrgOdtContentTemplate.xml b/elpa/org-9.5.2/etc/styles/OrgOdtContentTemplate.xml
new file mode 100644
index 0000000..d0c98a3
--- /dev/null
+++ b/elpa/org-9.5.2/etc/styles/OrgOdtContentTemplate.xml
@@ -0,0 +1,275 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- See etc/org/README for copyright information -->
+<office:document-content
+ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
+ xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+ xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
+ xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
+ xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
+ xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+ xmlns:math="http://www.w3.org/1998/Math/MathML"
+ xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
+ xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
+ xmlns:ooo="http://openoffice.org/2004/office"
+ xmlns:ooow="http://openoffice.org/2004/writer"
+ xmlns:oooc="http://openoffice.org/2004/calc"
+ xmlns:dom="http://www.w3.org/2001/xml-events"
+ xmlns:xforms="http://www.w3.org/2002/xforms"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:rpt="http://openoffice.org/2005/report"
+ xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"
+ xmlns:xodt="http://www.w3.org/1999/xodt"
+ xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" office:version="1.2">
+ <!-- scripts -->
+ <office:scripts/>
+
+ <!-- font face declarations -->
+ <office:font-face-decls>
+ <style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/>
+ <style:font-face style:name="courier" svg:font-family="courier, monospace"/>
+ <style:font-face style:name="Arial Unicode MS" svg:font-family="&apos;Arial Unicode MS&apos;" style:font-pitch="variable"/>
+ <style:font-face style:name="HG Mincho Light J" svg:font-family="&apos;HG Mincho Light J&apos;" style:font-pitch="variable"/>
+ <style:font-face style:name="Thorndale" svg:font-family="Thorndale" style:font-family-generic="roman" style:font-pitch="variable"/>
+ <style:font-face style:name="Times New Roman" svg:font-family="&apos;Times New Roman&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
+ <style:font-face style:name="Albany" svg:font-family="Albany" style:font-family-generic="swiss" style:font-pitch="variable"/>
+ <style:font-face style:name="SimSun" svg:font-family="SimSun" style:font-family-generic="system" style:font-pitch="variable"/>
+ <style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+
+ <!-- automatic styles -->
+ <office:automatic-styles>
+
+ <!-- Section styles -->
+
+ <!-- Section styles for Table Of Contents and Other Indices -->
+ <style:style style:name="OrgIndexSection" style:family="section">
+ <style:section-properties fo:background-color="#c0c0c0" style:editable="false">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ <style:background-image/>
+ </style:section-properties>
+ </style:style>
+
+ <!-- Indented sections, used as container for tables that occur
+ within list items -->
+ <style:style style:name="OrgIndentedSection-Level-1" style:family="section">
+ <style:section-properties text:dont-balance-text-columns="false" fo:margin-left="1.281cm" fo:margin-right="0cm" style:editable="false">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ </style:section-properties>
+ </style:style>
+ <style:style style:name="OrgIndentedSection-Level-2" style:family="section">
+ <style:section-properties text:dont-balance-text-columns="false" fo:margin-left="1.905cm" fo:margin-right="0cm" style:editable="false">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ </style:section-properties>
+ </style:style>
+ <style:style style:name="OrgIndentedSection-Level-3" style:family="section">
+ <style:section-properties text:dont-balance-text-columns="false" fo:margin-left="2.54cm" fo:margin-right="0cm" style:editable="false">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ </style:section-properties>
+ </style:style>
+ <style:style style:name="OrgIndentedSection-Level-4" style:family="section">
+ <style:section-properties text:dont-balance-text-columns="false" fo:margin-left="3.175cm" fo:margin-right="0cm" style:editable="false">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ </style:section-properties>
+ </style:style>
+ <style:style style:name="OrgIndentedSection-Level-5" style:family="section">
+ <style:section-properties text:dont-balance-text-columns="false" fo:margin-left="3.81cm" fo:margin-right="0cm" style:editable="false">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ </style:section-properties>
+ </style:style>
+ <style:style style:name="OrgIndentedSection-Level-6" style:family="section">
+ <style:section-properties text:dont-balance-text-columns="false" fo:margin-left="4.445cm" fo:margin-right="0cm" style:editable="false">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ </style:section-properties>
+ </style:style>
+ <style:style style:name="OrgIndentedSection-Level-7" style:family="section">
+ <style:section-properties text:dont-balance-text-columns="false" fo:margin-left="5.08cm" fo:margin-right="0cm" style:editable="false">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ </style:section-properties>
+ </style:style>
+ <style:style style:name="OrgIndentedSection-Level-8" style:family="section">
+ <style:section-properties text:dont-balance-text-columns="false" fo:margin-left="5.715cm" fo:margin-right="0cm" style:editable="false">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ </style:section-properties>
+ </style:style>
+ <style:style style:name="OrgIndentedSection-Level-9" style:family="section">
+ <style:section-properties text:dont-balance-text-columns="false" fo:margin-left="6.35cm" fo:margin-right="0cm" style:editable="false">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ </style:section-properties>
+ </style:style>
+ <style:style style:name="OrgIndentedSection-Level-10" style:family="section">
+ <style:section-properties text:dont-balance-text-columns="false" fo:margin-left="6.985cm" fo:margin-right="0cm" style:editable="false">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ </style:section-properties>
+ </style:style>
+
+ <!-- Table styles -->
+ <style:style style:name="OrgTable" style:family="table">
+ <style:table-properties style:rel-width="96%" fo:margin-top="0cm" fo:margin-bottom="0.20cm" table:align="center"/>
+ </style:style>
+
+ <style:style style:name="OrgTableColumn" style:family="table-column">
+ <style:table-column-properties style:rel-column-width="1*"/>
+ </style:style>
+
+ <style:style style:name="OrgTblCell" style:family="table-cell">
+ <style:table-cell-properties style:vertical-align="top" fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="none" fo:border-left="none" fo:border-right="none"/>
+ </style:style>
+ <style:style style:name="OrgTblCellL" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="none" fo:border-left="0.002cm solid #000000" fo:border-right="none"/>
+ </style:style>
+ <style:style style:name="OrgTblCellR" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="none" fo:border-left="none" fo:border-right="0.002cm solid #000000"/>
+ </style:style>
+ <style:style style:name="OrgTblCellLR" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="none" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000"/>
+ </style:style>
+ <style:style style:name="OrgTblCellT" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="none" fo:border-left="none" fo:border-right="none"/>
+ </style:style>
+ <style:style style:name="OrgTblCellTL" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="none" fo:border-left="0.002cm solid #000000" fo:border-right="none"/>
+ </style:style>
+ <style:style style:name="OrgTblCellTR" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="none" fo:border-left="none" fo:border-right="0.002cm solid #000000"/>
+ </style:style>
+ <style:style style:name="OrgTblCellTLR" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="none" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000"/>
+ </style:style>
+ <style:style style:name="OrgTblCellB" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="0.002cm solid #000000" fo:border-left="none" fo:border-right="none"/>
+ </style:style>
+ <style:style style:name="OrgTblCellBL" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="0.002cm solid #000000" fo:border-left="0.002cm solid #000000" fo:border-right="none"/>
+ </style:style>
+ <style:style style:name="OrgTblCellBR" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="0.002cm solid #000000" fo:border-left="none" fo:border-right="0.002cm solid #000000"/>
+ </style:style>
+ <style:style style:name="OrgTblCellBLR" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="0.002cm solid #000000" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000"/>
+ </style:style>
+ <style:style style:name="OrgTblCellTB" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000" fo:border-left="none" fo:border-right="none"/>
+ </style:style>
+ <style:style style:name="OrgTblCellTBL" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000" fo:border-left="0.002cm solid #000000" fo:border-right="none"/>
+ </style:style>
+ <style:style style:name="OrgTblCellTBR" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000" fo:border-left="none" fo:border-right="0.002cm solid #000000"/>
+ </style:style>
+ <style:style style:name="OrgTblCellTBLR" style:family="table-cell" style:parent-style-name="OrgTblCell">
+ <style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000"/>
+ </style:style>
+
+ <!-- BEGIN: Table styles for numbered equations -->
+ <style:style style:name="OrgEquation" style:family="table">
+ <style:table-properties style:rel-width="100%" fo:margin-top="0cm" fo:margin-bottom="0.20cm" table:align="center"/>
+ </style:style>
+ <style:style style:name="OrgEquationTableColumn" style:family="table-column">
+ <style:table-column-properties style:rel-column-width="1*"/>
+ </style:style>
+ <style:style style:name="OrgFirstEquationFirstColumnTableCell" style:family="table-cell">
+ <style:table-cell-properties style:vertical-align="middle" fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="none" fo:border-left="none" fo:border-right="none"/>
+ </style:style>
+ <style:style style:name="OrgEquationLastColumnTableCell" style:family="table-cell">
+ <style:table-cell-properties style:vertical-align="middle" fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="none" fo:border-left="none" fo:border-right="none"/>
+ </style:style>
+ <style:style style:name="OrgEquationFirstColumnTableParagraph" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+ </style:style>
+ <style:style style:name="OrgEquationLastColumnTableParagraph" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+ <style:paragraph-properties fo:text-align="end" style:justify-single-word="false"/>
+ </style:style>
+ <!-- END: Table styles for numbered equations -->
+
+ <!-- BEGIN: Custom Table Template -->
+ <style:style style:name="Custom" style:family="table">
+ <style:table-properties style:rel-width="80%" table:align="center"/>
+ </style:style>
+
+ <style:style style:name="CustomColumn" style:family="table-column">
+ <style:table-column-properties style:rel-column-width="1*"/>
+ </style:style>
+
+ <!-- Table Paragraph Styles -->
+ <style:style style:name="CustomTableParagraph" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+ <style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+ <style:text-properties fo:color="#000000" style:text-outline="false" style:text-line-through-style="none" style:font-name="Times New Roman" fo:font-size="12pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="normal" style:font-size-asian="12pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="12pt" style:font-style-complex="normal" style:font-weight-complex="normal" style:text-overline-style="none" style:text-overline-color="font-color"/>
+ </style:style>
+
+ <style:style style:name="CustomLastRowTableParagraph" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+ <style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+ <style:text-properties fo:color="#000000" style:text-outline="false" style:text-line-through-style="none" style:font-name="Times New Roman" fo:font-size="12pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="normal" style:font-size-asian="12pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="12pt" style:font-style-complex="normal" style:font-weight-complex="normal" style:text-overline-style="none" style:text-overline-color="font-color"/>
+ </style:style>
+
+ <style:style style:name="CustomLastColumnTableParagraph" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+ <style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+ <style:text-properties fo:color="#000000" style:text-outline="false" style:text-line-through-style="none" style:font-name="Times New Roman" fo:font-size="12pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="normal" style:font-size-asian="12pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="12pt" style:font-style-complex="normal" style:font-weight-complex="normal" style:text-overline-style="none" style:text-overline-color="font-color"/>
+ </style:style>
+
+ <style:style style:name="CustomFirstRowTableParagraph" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+ <style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+ <style:text-properties fo:color="#ffffff" style:text-outline="false" style:text-line-through-style="none" style:font-name="Times New Roman" fo:font-size="12pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="normal" style:font-size-asian="12pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="12pt" style:font-style-complex="normal" style:font-weight-complex="normal" style:text-overline-style="none" style:text-overline-color="font-color"/>
+ </style:style>
+
+ <style:style style:name="CustomFirstColumnTableParagraph" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+ <style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+ <style:text-properties fo:color="#ffffff" style:text-outline="false" style:text-line-through-style="none" style:font-name="Times New Roman" fo:font-size="12pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="normal" style:font-size-asian="12pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="12pt" style:font-style-complex="normal" style:font-weight-complex="normal" style:text-overline-style="none" style:text-overline-color="font-color"/>
+ </style:style>
+
+ <!-- Table Cell Styles -->
+ <style:style style:name="CustomTableCell" style:family="table-cell">
+ <style:table-cell-properties style:vertical-align="top" fo:background-color="#ffffff" fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000">
+ <style:background-image/>
+ </style:table-cell-properties>
+ </style:style>
+
+ <style:style style:name="CustomFirstRowTableCell" style:family="table-cell">
+ <style:table-cell-properties style:vertical-align="top" fo:background-color="#000080" fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000">
+ <style:background-image/>
+ </style:table-cell-properties>
+ </style:style>
+
+ <style:style style:name="CustomLastRowTableCell" style:family="table-cell">
+ <style:table-cell-properties style:vertical-align="top" fo:background-color="#cccccc" fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000">
+ <style:background-image/>
+ </style:table-cell-properties>
+ </style:style>
+
+ <style:style style:name="CustomFirstColumnTableCell" style:family="table-cell">
+ <style:table-cell-properties style:vertical-align="top" fo:background-color="#4d4d4d" fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000">
+ <style:background-image/>
+ </style:table-cell-properties>
+ </style:style>
+
+ <style:style style:name="CustomLastColumnTableCell" style:family="table-cell">
+ <style:table-cell-properties style:vertical-align="top" fo:background-color="#cccccc" fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000">
+ <style:background-image/>
+ </style:table-cell-properties>
+ </style:style>
+
+ <!-- END: Custom Table Template -->
+
+ </office:automatic-styles>
+
+ <office:body>
+ <office:text>
+ <text:sequence-decls>
+ <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Equation"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Listing"/>
+ </text:sequence-decls>
+ </office:text>
+ </office:body>
+</office:document-content>
diff --git a/elpa/org-9.5.2/etc/styles/OrgOdtStyles.xml b/elpa/org-9.5.2/etc/styles/OrgOdtStyles.xml
new file mode 100644
index 0000000..1a8edee
--- /dev/null
+++ b/elpa/org-9.5.2/etc/styles/OrgOdtStyles.xml
@@ -0,0 +1,861 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- See etc/org/README for copyright information -->
+<office:document-styles xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" office:version="1.2">
+ <office:font-face-decls>
+ <style:font-face style:name="OpenSymbol" svg:font-family="OpenSymbol"/>
+ <style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/>
+ <style:font-face style:name="Courier New" svg:font-family="&apos;Courier New&apos;" style:font-family-generic="modern" style:font-pitch="fixed"/>
+ <style:font-face style:name="NSimSun" svg:font-family="NSimSun" style:font-family-generic="modern" style:font-pitch="fixed"/>
+ <style:font-face style:name="Times New Roman" svg:font-family="&apos;Times New Roman&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
+ <style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/>
+ <style:font-face style:name="SimSun" svg:font-family="SimSun" style:font-family-generic="system" style:font-pitch="variable"/>
+ <style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+ <style:default-style style:family="graphic">
+ <style:graphic-properties draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+ <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
+ <style:tab-stops/>
+ </style:paragraph-properties>
+ <style:text-properties style:use-window-font-color="true" fo:font-size="12pt" fo:language="en" fo:country="GB" style:letter-kerning="true" style:font-size-asian="12pt" style:language-asian="zh" style:country-asian="CN" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
+ </style:default-style>
+ <style:default-style style:family="paragraph">
+ <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
+ <style:text-properties style:use-window-font-color="true" style:font-name="Times New Roman" fo:font-size="12pt" fo:language="en" fo:country="GB" style:letter-kerning="true" style:font-name-asian="SimSun" style:font-size-asian="12pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Tahoma" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/>
+ </style:default-style>
+ <style:default-style style:family="table">
+ <style:table-properties table:border-model="collapsing"/>
+ </style:default-style>
+ <style:default-style style:family="table-row">
+ <style:table-row-properties fo:keep-together="auto"/>
+ </style:default-style>
+
+ <!-- Outline numbering -->
+ <text:outline-style style:name="OrgOutline">
+ <text:outline-level-style text:level="1" style:num-suffix=". " style:num-format="1">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-0.762cm" fo:margin-left="0.762cm"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="2" style:num-suffix=". " style:num-format="1" text:display-levels="2">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-1.016cm" fo:margin-left="1.016cm"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="3" style:num-suffix=". " style:num-format="1" text:display-levels="3">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-1.27cm" fo:margin-left="1.27cm"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="4" style:num-suffix=". " style:num-format="1" text:display-levels="4">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-1.524cm" fo:margin-left="1.524cm"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="5" style:num-suffix=". " style:num-format="1" text:display-levels="5">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-1.778cm" fo:margin-left="1.778cm"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="6" style:num-suffix=". " style:num-format="1" text:display-levels="6">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-2.032cm" fo:margin-left="2.032cm"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="7" style:num-suffix=". " style:num-format="1" text:display-levels="7">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-2.286cm" fo:margin-left="2.286cm"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="8" style:num-suffix=". " style:num-format="1" text:display-levels="8">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-2.54cm" fo:margin-left="2.54cm"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="9" style:num-suffix=". " style:num-format="1" text:display-levels="9">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-2.794cm" fo:margin-left="2.794cm"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ <text:outline-level-style text:level="10" style:num-suffix=". " style:num-format="1" text:display-levels="10">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-3.048cm" fo:margin-left="3.048cm"/>
+ </style:list-level-properties>
+ </text:outline-level-style>
+ </text:outline-style>
+
+ <style:style style:name="Standard" style:family="paragraph" style:class="text"/>
+ <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
+ <style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" fo:keep-with-next="always">
+ <style:tab-stops>
+ <style:tab-stop style:position="17cm" style:type="right"/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ <style:text-properties style:font-name="Arial" fo:font-size="14pt" style:font-name-asian="SimSun" style:font-size-asian="14pt" style:font-name-complex="Tahoma" style:font-size-complex="14pt"/>
+ </style:style>
+ <style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
+ <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.212cm"/>
+ </style:style>
+ <style:style style:name="List" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="list">
+ <style:text-properties style:font-name-complex="Tahoma1"/>
+ </style:style>
+ <style:style style:name="Caption" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
+ <style:paragraph-properties fo:margin-top="0.212cm" fo:margin-bottom="0.212cm" text:number-lines="false" text:line-number="0"/>
+ <style:text-properties fo:font-size="12pt" fo:font-style="italic" style:font-size-asian="12pt" style:font-style-asian="italic" style:font-name-complex="Tahoma1" style:font-size-complex="12pt" style:font-style-complex="italic"/>
+ </style:style>
+ <style:style style:name="Index" style:family="paragraph" style:parent-style-name="Standard" style:class="index">
+ <style:paragraph-properties text:number-lines="false" text:line-number="0"/>
+ <style:text-properties style:font-name-complex="Tahoma1"/>
+ </style:style>
+ <style:style style:name="Heading_20_1" style:display-name="Heading 1" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="1" style:class="text">
+ <style:text-properties fo:font-size="115%" fo:font-weight="bold" style:font-size-asian="115%" style:font-weight-asian="bold" style:font-size-complex="115%" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_1_unnumbered" style:family="paragraph" style:parent-style-name="Heading_20_1" style:list-style-name="">
+ </style:style>
+ <style:style style:name="Heading_20_2" style:display-name="Heading 2" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="2" style:class="text">
+ <style:text-properties fo:font-size="14pt" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="14pt" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-style-complex="italic" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_2_unnumbered" style:family="paragraph" style:parent-style-name="Heading_20_2" style:list-style-name="">
+ </style:style>
+ <style:style style:name="Heading_20_3" style:display-name="Heading 3" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="3" style:class="text">
+ <style:text-properties fo:font-size="14pt" fo:font-weight="bold" style:font-size-asian="14pt" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_3_unnumbered" style:family="paragraph" style:parent-style-name="Heading_20_3" style:list-style-name="">
+ </style:style>
+ <style:style style:name="Heading_20_4" style:display-name="Heading 4" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="4" style:class="text">
+ <style:text-properties fo:font-size="85%" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="85%" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="85%" style:font-style-complex="italic" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_4_unnumbered" style:family="paragraph" style:parent-style-name="Heading_20_4" style:list-style-name="">
+ </style:style>
+ <style:style style:name="Heading_20_5" style:display-name="Heading 5" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="5" style:class="text">
+ <style:text-properties fo:font-size="85%" fo:font-weight="bold" style:font-size-asian="85%" style:font-weight-asian="bold" style:font-size-complex="85%" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_5_unnumbered" style:family="paragraph" style:parent-style-name="Heading_20_5" style:list-style-name="">
+ </style:style>
+ <style:style style:name="Heading_20_6" style:display-name="Heading 6" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="6" style:class="text">
+ <style:text-properties fo:font-size="75%" fo:font-weight="bold" style:font-size-asian="75%" style:font-weight-asian="bold" style:font-size-complex="75%" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_6_unnumbered" style:family="paragraph" style:parent-style-name="Heading_20_6" style:list-style-name="">
+ </style:style>
+ <style:style style:name="Heading_20_7" style:display-name="Heading 7" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="7" style:class="text">
+ <style:text-properties fo:font-size="75%" fo:font-weight="bold" style:font-size-asian="75%" style:font-weight-asian="bold" style:font-size-complex="75%" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_7_unnumbered" style:family="paragraph" style:parent-style-name="Heading_20_7" style:list-style-name="">
+ </style:style>
+ <style:style style:name="Heading_20_8" style:display-name="Heading 8" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="8" style:class="text">
+ <style:text-properties fo:font-size="75%" fo:font-weight="bold" style:font-size-asian="75%" style:font-weight-asian="bold" style:font-size-complex="75%" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_8_unnumbered" style:family="paragraph" style:parent-style-name="Heading_20_8" style:list-style-name="">
+ </style:style>
+ <style:style style:name="Heading_20_9" style:display-name="Heading 9" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="9" style:class="text">
+ <style:text-properties fo:font-size="75%" fo:font-weight="bold" style:font-size-asian="75%" style:font-weight-asian="bold" style:font-size-complex="75%" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_9_unnumbered" style:family="paragraph" style:parent-style-name="Heading_20_9" style:list-style-name="">
+ </style:style>
+ <style:style style:name="Heading_20_10" style:display-name="Heading 10" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="10" style:class="text">
+ <style:text-properties fo:font-size="75%" fo:font-weight="bold" style:font-size-asian="75%" style:font-weight-asian="bold" style:font-size-complex="75%" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_10_unnumbered" style:family="paragraph" style:parent-style-name="Heading_20_10" style:list-style-name="">
+ </style:style>
+ <style:style style:name="Heading_20_1.title" style:display-name="Heading 1.title" style:family="paragraph" style:parent-style-name="Heading_20_1">
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+ </style:style>
+ <style:style style:name="Title" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Subtitle" style:class="chapter">
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+ <style:text-properties fo:font-size="18pt" fo:font-weight="bold" style:font-size-asian="18pt" style:font-weight-asian="bold" style:font-size-complex="18pt" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="OrgTitle" style:family="paragraph" style:parent-style-name="Title">
+ <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm"/>
+ <style:text-properties fo:font-size="24pt"/>
+ </style:style>
+ <style:style style:name="Subtitle" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:class="chapter">
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+ <style:text-properties fo:font-size="14pt" fo:font-style="italic" style:font-size-asian="14pt" style:font-style-asian="italic" style:font-size-complex="14pt" style:font-style-complex="italic"/>
+ </style:style>
+ <style:style style:name="OrgSubtitle" style:family="paragraph" style:parent-style-name="Subtitle">
+ <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm"/>
+ <style:text-properties fo:font-size="20pt"/>
+ </style:style>
+ <style:style style:name="Text_20_body_20_indent" style:display-name="Text body indent" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="text">
+ <style:paragraph-properties fo:margin-left="0.499cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
+ </style:style>
+ <style:style style:name="List_20_Indent" style:display-name="List Indent" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="text">
+ <style:paragraph-properties fo:margin-left="5.001cm" fo:margin-right="0cm" fo:text-indent="-4.5cm" style:auto-text-indent="false">
+ <style:tab-stops>
+ <style:tab-stop style:position="0cm"/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="First_20_line_20_indent" style:display-name="First line indent" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="text">
+ <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0.499cm" style:auto-text-indent="false"/>
+ </style:style>
+ <style:style style:name="Hanging_20_indent" style:display-name="Hanging indent" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="text">
+ <style:paragraph-properties fo:margin-left="1cm" fo:margin-right="0cm" fo:text-indent="-0.499cm" style:auto-text-indent="false">
+ <style:tab-stops>
+ <style:tab-stop style:position="0cm"/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Salutation" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
+ <style:paragraph-properties text:number-lines="false" text:line-number="0"/>
+ </style:style>
+ <style:style style:name="Contents_20_Heading" style:display-name="Contents Heading" style:family="paragraph" style:parent-style-name="Heading" style:class="index">
+ <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false" text:number-lines="false" text:line-number="0"/>
+ <style:text-properties fo:font-size="16pt" fo:font-weight="bold" style:font-size-asian="16pt" style:font-weight-asian="bold" style:font-size-complex="16pt" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Contents_20_1" style:display-name="Contents 1" style:family="paragraph" style:parent-style-name="Index" style:class="index">
+ <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
+ <style:tab-stops>
+ <style:tab-stop style:position="17cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Contents_20_2" style:display-name="Contents 2" style:family="paragraph" style:parent-style-name="Index" style:class="index">
+ <style:paragraph-properties fo:margin-left="0.499cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
+ <style:tab-stops>
+ <style:tab-stop style:position="16.501cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Contents_20_3" style:display-name="Contents 3" style:family="paragraph" style:parent-style-name="Index" style:class="index">
+ <style:paragraph-properties fo:margin-left="0.998cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
+ <style:tab-stops>
+ <style:tab-stop style:position="16.002cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Contents_20_4" style:display-name="Contents 4" style:family="paragraph" style:parent-style-name="Index" style:class="index">
+ <style:paragraph-properties fo:margin-left="1.498cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
+ <style:tab-stops>
+ <style:tab-stop style:position="15.503cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Contents_20_5" style:display-name="Contents 5" style:family="paragraph" style:parent-style-name="Index" style:class="index">
+ <style:paragraph-properties fo:margin-left="1.997cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
+ <style:tab-stops>
+ <style:tab-stop style:position="15.004cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Contents_20_6" style:display-name="Contents 6" style:family="paragraph" style:parent-style-name="Index" style:class="index">
+ <style:paragraph-properties fo:margin-left="2.496cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
+ <style:tab-stops>
+ <style:tab-stop style:position="14.504cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Contents_20_7" style:display-name="Contents 7" style:family="paragraph" style:parent-style-name="Index" style:class="index">
+ <style:paragraph-properties fo:margin-left="2.995cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
+ <style:tab-stops>
+ <style:tab-stop style:position="14.005cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Contents_20_8" style:display-name="Contents 8" style:family="paragraph" style:parent-style-name="Index" style:class="index">
+ <style:paragraph-properties fo:margin-left="3.494cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
+ <style:tab-stops>
+ <style:tab-stop style:position="13.506cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Contents_20_9" style:display-name="Contents 9" style:family="paragraph" style:parent-style-name="Index" style:class="index">
+ <style:paragraph-properties fo:margin-left="3.993cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
+ <style:tab-stops>
+ <style:tab-stop style:position="13.007cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Contents_20_10" style:display-name="Contents 10" style:family="paragraph" style:parent-style-name="Index" style:class="index">
+ <style:paragraph-properties fo:margin-left="4.493cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
+ <style:tab-stops>
+ <style:tab-stop style:position="12.508cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Quotations" style:family="paragraph" style:parent-style-name="Standard" style:class="html">
+ <style:paragraph-properties fo:margin-left="1cm" fo:margin-right="1cm" fo:margin-top="0cm" fo:margin-bottom="0.499cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
+ </style:style>
+ <style:style style:name="OrgFootnoteQuotations" style:family="paragraph" style:parent-style-name="Footnote" style:class="html">
+ <style:paragraph-properties fo:margin-left="1cm" fo:margin-right="1cm" fo:margin-top="0cm" fo:margin-bottom="0.499cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
+ </style:style>
+ <style:style style:name="Preformatted_20_Text" style:display-name="Preformatted Text" style:family="paragraph" style:parent-style-name="Standard" style:class="html">
+ <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm"/>
+ <style:text-properties style:font-name="Courier New" fo:font-size="10pt" style:font-name-asian="NSimSun" style:font-size-asian="10pt" style:font-name-complex="Courier New" style:font-size-complex="10pt"/>
+ </style:style>
+
+ <style:style style:name="OrgVerse" style:family="paragraph" style:parent-style-name="Preformatted_20_Text">
+ <style:paragraph-properties fo:background-color="transparent" fo:padding="0cm" fo:border="none" style:shadow="none">
+ <style:background-image/>
+ </style:paragraph-properties>
+ </style:style>
+
+ <style:style style:name="OrgClock" style:family="paragraph" style:parent-style-name="Text_20_body">
+ <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm"/>
+ </style:style>
+ <style:style style:name="OrgClockLastLine" style:family="paragraph" style:parent-style-name="OrgClock"/>
+ <style:style style:name="OrgPlanning" style:family="paragraph" style:parent-style-name="Text_20_body"/>
+
+ <!-- Fixed width block -->
+ <style:style style:name="OrgFixedWidthBlock" style:family="paragraph" style:parent-style-name="Preformatted_20_Text">
+ <style:paragraph-properties fo:background-color="#c0c0c0" fo:padding="0.049cm" fo:border="0.06pt solid #000000" style:shadow="none">
+ <style:background-image/>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="OrgFixedWidthBlockLastLine" style:family="paragraph" style:parent-style-name="OrgFixedWidthBlock">
+ <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.21cm"/>
+ </style:style>
+
+ <style:style style:name="OrgFormula" style:family="paragraph" style:parent-style-name="Text_20_body">
+ <style:paragraph-properties>
+ <style:tab-stops>
+ <style:tab-stop style:position="17cm" style:type="right"/>
+ </style:tab-stops>
+ </style:paragraph-properties>
+ </style:style>
+
+ <style:style style:name="OrgSrcBlockLastLine" style:family="paragraph" style:parent-style-name="OrgSrcBlock">
+ <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.21cm"/>
+ </style:style>
+
+ <style:style style:name="OrgCenter" style:family="paragraph" style:parent-style-name="Text_20_body">
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+ </style:style>
+ <style:style style:name="OrgFootnoteCenter" style:family="paragraph" style:parent-style-name="Footnote">
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+ </style:style>
+ <style:style style:name="OrgTableContents" style:family="paragraph" style:parent-style-name="Text_20_body"/>
+ <style:style style:name="OrgTableHeading" style:family="paragraph" style:parent-style-name="OrgTableContents" style:class="extra">
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false" text:number-lines="false" text:line-number="0"/>
+ <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
+ </style:style>
+
+ <style:style style:name="OrgTableHeadingLeft" style:family="paragraph" style:parent-style-name="OrgTableHeading">
+ <style:paragraph-properties fo:text-align="left" style:justify-single-word="false"/>
+ </style:style>
+ <style:style style:name="OrgTableHeadingRight" style:family="paragraph" style:parent-style-name="OrgTableHeading">
+ <style:paragraph-properties fo:text-align="right" style:justify-single-word="false"/>
+ </style:style>
+ <style:style style:name="OrgTableHeadingCenter" style:family="paragraph" style:parent-style-name="OrgTableHeading">
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+ </style:style>
+
+ <style:style style:name="OrgTableContentsLeft" style:family="paragraph" style:parent-style-name="OrgTableContents">
+ <style:paragraph-properties fo:text-align="left" style:justify-single-word="false"/>
+ </style:style>
+ <style:style style:name="OrgTableContentsRight" style:family="paragraph" style:parent-style-name="OrgTableContents">
+ <style:paragraph-properties fo:text-align="right" style:justify-single-word="false"/>
+ </style:style>
+ <style:style style:name="OrgTableContentsCenter" style:family="paragraph" style:parent-style-name="OrgTableContents">
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+ </style:style>
+ <style:style style:name="Text_20_body_20_bold" style:display-name="Text body bold" style:family="paragraph" style:parent-style-name="Text_20_body" style:next-style-name="Text_20_body">
+ <style:text-properties fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="Footnote" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
+ <style:paragraph-properties fo:margin-left="0.499cm" fo:margin-right="0cm" fo:text-indent="-0.499cm" style:auto-text-indent="false" text:number-lines="false" text:line-number="0"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="Figure" style:family="paragraph" style:parent-style-name="Caption"/>
+ <style:style style:name="Illustration_20_Index_20_Heading" style:display-name="Illustration Index Heading" style:family="paragraph" style:parent-style-name="Heading" style:class="index">
+ <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false" text:number-lines="false" text:line-number="0"/>
+ <style:text-properties fo:font-size="16pt" fo:font-weight="bold" style:font-size-asian="16pt" style:font-weight-asian="bold" style:font-size-complex="16pt" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Table" style:family="paragraph" style:parent-style-name="Caption" style:class="extra">
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+ </style:style>
+ <style:style style:name="Listing" style:family="paragraph" style:parent-style-name="Caption" style:class="extra">
+ <style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false" fo:keep-with-next="always">
+ <style:tab-stops/>
+ </style:paragraph-properties>
+ </style:style>
+ <style:style style:name="Horizontal_20_Line" style:display-name="Horizontal Line" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="html">
+ <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.21cm" style:page-number="auto" fo:padding="0cm" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.06pt solid #000000" style:shadow="none" text:number-lines="false" text:line-number="0" style:join-border="false"/>
+ <style:text-properties fo:font-size="6pt" style:font-size-asian="6pt" style:font-size-complex="6pt"/>
+ </style:style>
+
+ <style:style style:name="Emphasis" style:family="text">
+ <style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/>
+ </style:style>
+ <style:style style:name="Underline" style:family="text">
+ <style:text-properties style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" fo:background-color="transparent"/>
+ </style:style>
+ <style:style style:name="Strikethrough" style:family="text">
+ <style:text-properties style:text-line-through-style="solid"/>
+ </style:style>
+ <style:style style:name="Source_20_Text" style:display-name="Source Text" style:family="text">
+ <style:text-properties style:font-name="Courier New" fo:background-color="transparent" style:font-name-asian="NSimSun" style:font-name-complex="Courier New"/>
+ </style:style>
+ <style:style style:name="Citation" style:family="text">
+ <style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/>
+ </style:style>
+ <style:style style:name="Example" style:family="text">
+ <style:text-properties style:font-name="Courier New" fo:background-color="transparent" style:font-name-asian="NSimSun" style:font-name-complex="Courier New"/>
+ </style:style>
+ <style:style style:name="OrgCode" style:family="text" style:parent-style-name="Source_20_Text"/>
+
+ <!-- BEGIN: Org Agenda Styles -->
+ <style:style style:name="OrgTodo" style:family="text"/>
+ <style:style style:name="OrgDone" style:family="text"/>
+
+ <style:style style:name="OrgTag" style:family="text">
+ <style:text-properties fo:font-variant="small-caps" fo:background-color="transparent"/>
+ </style:style>
+ <style:style style:name="OrgTags" style:family="text"/>
+
+ <style:style style:name="OrgPriority" style:family="text"/>
+ <style:style style:name="OrgPriority-A" style:family="text" style:parent-style-name="OrgPriority"/>
+ <style:style style:name="OrgPriority-B" style:family="text" style:parent-style-name="OrgPriority"/>
+ <style:style style:name="OrgPriority-C" style:family="text" style:parent-style-name="OrgPriority"/>
+
+ <style:style style:name="OrgTimestamp" style:display-name="OrgTimestamp" style:family="text">
+ <style:text-properties style:font-name="Courier New" fo:background-color="transparent" style:font-name-asian="NSimSun" style:font-name-complex="Courier New"/>
+ </style:style>
+ <style:style style:name="OrgActiveTimestamp" style:family="text" style:parent-style-name="OrgTimestamp"/>
+ <style:style style:name="OrgInactiveTimestamp" style:family="text" style:parent-style-name="OrgTimestamp"/>
+ <style:style style:name="OrgTimestampKeyword" style:family="text">
+ <style:text-properties style:use-window-font-color="true" fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="OrgScheduledKeyword" style:family="text" style:parent-style-name="OrgTimestampKeyword"/>
+ <style:style style:name="OrgDeadlineKeyword" style:family="text" style:parent-style-name="OrgTimestampKeyword"/>
+ <style:style style:name="OrgClockKeyword" style:family="text" style:parent-style-name="OrgTimestampKeyword"/>
+ <style:style style:name="OrgClosedKeyword" style:family="text" style:parent-style-name="OrgTimestampKeyword"/>
+ <style:style style:name="OrgTimestampWrapper" style:family="text"/>
+ <style:style style:name="OrgTarget" style:family="text"/>
+
+ <number:date-style style:name="OrgDate" number:automatic-order="true">
+ <number:day number:style="long"/>
+ <number:text>/</number:text>
+ <number:month number:style="long"/>
+ <number:text>/</number:text>
+ <number:year number:style="long"/>
+ </number:date-style>
+ <!-- END: Org Agenda Styles -->
+
+ <style:style style:name="Bold" style:family="text">
+ <style:text-properties fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="Numbering_20_Symbols" style:display-name="Numbering Symbols" style:family="text"/>
+ <style:style style:name="Footnote_20_Symbol" style:display-name="Footnote Symbol" style:family="text"/>
+ <style:style style:name="Footnote_20_anchor" style:display-name="Footnote anchor" style:family="text">
+ <style:text-properties style:text-position="super 58%"/>
+ </style:style>
+ <style:style style:name="OrgSuperscript" style:family="text">
+ <style:text-properties style:text-position="super 58%"/>
+ </style:style>
+ <style:style style:name="OrgSubscript" style:family="text">
+ <style:text-properties style:text-position="sub 58%"/>
+ </style:style>
+ <style:style style:name="Internet_20_link" style:display-name="Internet link" style:family="text">
+ <style:text-properties fo:color="#000080" fo:language="zxx" fo:country="none" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" style:language-asian="zxx" style:country-asian="none" style:language-complex="zxx" style:country-complex="none"/>
+ </style:style>
+ <style:style style:name="Graphics" style:family="graphic">
+ <style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/>
+ </style:style>
+ <style:style style:name="Frame" style:family="graphic">
+ <style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" fo:margin-left="0.201cm" fo:margin-right="0.201cm" fo:margin-top="0.201cm" fo:margin-bottom="0.201cm" style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" fo:padding="0.15cm" fo:border="0.002cm solid #000000"/>
+ </style:style>
+
+ <!-- Simple Images -->
+ <style:style style:name="OrgDisplayImage" style:family="graphic" style:parent-style-name="Graphics">
+ <style:graphic-properties text:anchor-type="paragraph" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/>
+ </style:style>
+
+ <style:style style:name="OrgPageImage" style:family="graphic" style:parent-style-name="Graphics">
+ <style:graphic-properties text:anchor-type="page" fo:margin-top="0.21cm" fo:margin-bottom="0.21cm" style:vertical-pos="middle" style:vertical-rel="page" style:horizontal-pos="center" style:horizontal-rel="page" fo:background-color="transparent" style:background-transparency="100%" style:shadow="none" style:mirror="none" fo:clip="rect(0cm, 0cm, 0cm, 0cm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard">
+ <style:background-image/>
+ </style:graphic-properties>
+ </style:style>
+
+ <!-- Captioned Images -->
+ <style:style style:name="OrgCaptionedImage" style:family="graphic" style:parent-style-name="Graphics">
+ <style:graphic-properties style:rel-width="100%" text:anchor-type="paragraph" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0cm" fo:margin-bottom="0cm" style:run-through="foreground" style:wrap="none" style:vertical-pos="from-top" style:vertical-rel="paragraph-content" style:horizontal-pos="from-left" style:horizontal-rel="paragraph-content" fo:padding="0cm" fo:border="none" style:shadow="none"/>
+ </style:style>
+
+ <style:style style:name="OrgImageCaptionFrame" style:family="graphic" style:parent-style-name="Frame">
+ <style:graphic-properties text:anchor-type="paragraph" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0cm" fo:margin-bottom="0cm" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph" fo:padding="0cm" fo:border="none"/>
+ </style:style>
+
+ <style:style style:name="OrgPageImageCaptionFrame" style:family="graphic" style:parent-style-name="Frame">
+ <style:graphic-properties text:anchor-type="paragraph" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.21cm" fo:margin-bottom="0.21cm" style:wrap="none" style:vertical-pos="middle" style:vertical-rel="page" style:horizontal-pos="center" style:horizontal-rel="page" fo:background-color="transparent" style:background-transparency="100%" fo:padding="0cm" fo:border="none" style:shadow="none">
+ <style:background-image/>
+ </style:graphic-properties>
+ </style:style>
+
+ <!-- Inlined Images -->
+ <style:style style:name="OrgInlineImage" style:family="graphic" style:parent-style-name="Graphics">
+ <style:graphic-properties text:anchor-type="as-char" style:vertical-pos="top" style:vertical-rel="baseline" style:horizontal-pos="center" style:horizontal-rel="paragraph"/>
+ </style:style>
+
+ <!-- Inline Formula -->
+ <style:style style:name="OrgFormula" style:family="graphic">
+ <style:graphic-properties text:anchor-type="as-char" svg:y="0cm" fo:margin-left="0.201cm" fo:margin-right="0.201cm" style:vertical-pos="middle" style:vertical-rel="text" style:shadow="none"/>
+ </style:style>
+
+ <style:style style:name="OrgInlineFormula" style:family="graphic" style:parent-style-name="Formula">
+ <style:graphic-properties text:anchor-type="as-char" fo:margin-left="0.201cm" fo:margin-right="0.201cm" style:vertical-pos="middle" style:vertical-rel="text"/>
+ </style:style>
+
+ <style:style style:name="OrgInlineFormula" style:family="graphic" style:parent-style-name="Formula">
+ <style:graphic-properties style:vertical-pos="middle" style:vertical-rel="text" draw:ole-draw-aspect="1"/>
+ </style:style>
+
+ <style:style style:name="OrgDisplayFormula" style:family="graphic" style:parent-style-name="OrgFormula">
+ <style:graphic-properties style:vertical-pos="middle" style:vertical-rel="text" style:horizontal-pos="from-left" style:horizontal-rel="paragraph-content" draw:ole-draw-aspect="1"/>
+ </style:style>
+
+ <style:style style:name="OrgFormulaCaptionFrame" style:family="graphic" style:parent-style-name="Frame">
+ <style:graphic-properties text:anchor-type="paragraph" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0cm" fo:margin-bottom="0cm" style:wrap="right" style:number-wrapped-paragraphs="1" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph" fo:padding="0cm" fo:border="none"/>
+ </style:style>
+
+ <style:style style:name="OrgCaptionedFormula" style:family="graphic" style:parent-style-name="OrgFormula">
+ <style:graphic-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0cm" fo:margin-bottom="0cm" style:run-through="foreground" style:wrap="none" style:vertical-pos="from-top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" fo:padding="0cm" fo:border="none" style:shadow="none" draw:ole-draw-aspect="1"/>
+ </style:style>
+
+ <!-- Inline Tasks -->
+ <style:style style:name="OrgInlineTaskHeading" style:family="paragraph" style:parent-style-name="Caption" style:next-style-name="Text_20_body">
+ <style:text-properties style:font-name="Arial1" fo:font-style="normal" fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="OrgInlineTaskFrame" style:family="graphic" style:parent-style-name="Frame">
+ <style:graphic-properties svg:x="0cm" svg:y="0cm" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" fo:background-color="#ffffcc" style:background-transparency="0%" fo:padding="0.15cm" fo:border="0.26pt solid #000000" style:shadow="none">
+ <style:background-image/>
+ </style:graphic-properties>
+ </style:style>
+
+ <text:list-style style:name="Numbering_20_1" style:display-name="Numbering 1">
+ <text:list-level-style-number text:level="1" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.499cm" fo:text-indent="-0.499cm" fo:margin-left="0.499cm"/>
+ </style:list-level-properties>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="2" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1cm" fo:text-indent="-0.499cm" fo:margin-left="1cm"/>
+ </style:list-level-properties>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="3" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.499cm" fo:text-indent="-0.499cm" fo:margin-left="1.499cm"/>
+ </style:list-level-properties>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="4" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2cm" fo:text-indent="-0.499cm" fo:margin-left="2cm"/>
+ </style:list-level-properties>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="5" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.499cm" fo:text-indent="-0.499cm" fo:margin-left="2.499cm"/>
+ </style:list-level-properties>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="6" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="3cm" fo:text-indent="-0.499cm" fo:margin-left="3cm"/>
+ </style:list-level-properties>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="7" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="3.5cm" fo:text-indent="-0.499cm" fo:margin-left="3.5cm"/>
+ </style:list-level-properties>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="8" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="4.001cm" fo:text-indent="-0.499cm" fo:margin-left="4.001cm"/>
+ </style:list-level-properties>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="9" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="4.5cm" fo:text-indent="-0.499cm" fo:margin-left="4.5cm"/>
+ </style:list-level-properties>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="10" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="5.001cm" fo:text-indent="-0.499cm" fo:margin-left="5.001cm"/>
+ </style:list-level-properties>
+ </text:list-level-style-number>
+ </text:list-style>
+ <text:list-style style:name="List_20_1" style:display-name="List 1">
+ <text:list-level-style-bullet text:level="1" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.4cm" fo:text-indent="-0.4cm" fo:margin-left="0.4cm"/>
+ </style:list-level-properties>
+ <style:text-properties style:font-name="OpenSymbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="2" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.801cm" fo:text-indent="-0.4cm" fo:margin-left="0.801cm"/>
+ </style:list-level-properties>
+ <style:text-properties style:font-name="OpenSymbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="3" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.199cm" fo:text-indent="-0.4cm" fo:margin-left="1.199cm"/>
+ </style:list-level-properties>
+ <style:text-properties style:font-name="OpenSymbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="4" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.6cm" fo:text-indent="-0.4cm" fo:margin-left="1.6cm"/>
+ </style:list-level-properties>
+ <style:text-properties style:font-name="OpenSymbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="5" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2cm" fo:text-indent="-0.4cm" fo:margin-left="2cm"/>
+ </style:list-level-properties>
+ <style:text-properties style:font-name="OpenSymbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="6" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.401cm" fo:text-indent="-0.4cm" fo:margin-left="2.401cm"/>
+ </style:list-level-properties>
+ <style:text-properties style:font-name="OpenSymbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="7" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.799cm" fo:text-indent="-0.4cm" fo:margin-left="2.799cm"/>
+ </style:list-level-properties>
+ <style:text-properties style:font-name="OpenSymbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="8" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="3.2cm" fo:text-indent="-0.4cm" fo:margin-left="3.2cm"/>
+ </style:list-level-properties>
+ <style:text-properties style:font-name="OpenSymbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="9" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="3.6cm" fo:text-indent="-0.4cm" fo:margin-left="3.6cm"/>
+ </style:list-level-properties>
+ <style:text-properties style:font-name="OpenSymbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="10" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
+ <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+ <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="4.001cm" fo:text-indent="-0.4cm" fo:margin-left="4.001cm"/>
+ </style:list-level-properties>
+ <style:text-properties style:font-name="OpenSymbol"/>
+ </text:list-level-style-bullet>
+ </text:list-style>
+
+ <!-- Numbered List -->
+ <text:list-style style:name="OrgNumberedList">
+ <text:list-level-style-number text:level="1" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:space-before="0.635cm" text:min-label-width="0.635cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="2" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:space-before="1.27cm" text:min-label-width="0.635cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="3" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:space-before="1.905cm" text:min-label-width="0.635cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="4" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:space-before="2.54cm" text:min-label-width="0.635cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="5" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:space-before="3.175cm" text:min-label-width="0.635cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="6" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:space-before="3.81cm" text:min-label-width="0.635cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="7" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:space-before="4.445cm" text:min-label-width="0.635cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="8" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:space-before="5.08cm" text:min-label-width="0.635cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="9" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:space-before="5.715cm" text:min-label-width="0.635cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="10" style:num-suffix="." style:num-format="1">
+ <style:list-level-properties text:space-before="6.35cm" text:min-label-width="0.635cm"/>
+ </text:list-level-style-number>
+ </text:list-style>
+
+ <!-- Bulleted List -->
+ <text:list-style style:name="OrgBulletedList">
+ <text:list-level-style-bullet text:level="1" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:list-level-properties text:space-before="0.635cm" text:min-label-width="0.635cm"/>
+ <style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="2" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:list-level-properties text:space-before="1.27cm" text:min-label-width="0.635cm"/>
+ <style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="3" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:list-level-properties text:space-before="1.905cm" text:min-label-width="0.635cm"/>
+ <style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="4" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:list-level-properties text:space-before="2.54cm" text:min-label-width="0.635cm"/>
+ <style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="5" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:list-level-properties text:space-before="3.175cm" text:min-label-width="0.635cm"/>
+ <style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="6" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:list-level-properties text:space-before="3.81cm" text:min-label-width="0.635cm"/>
+ <style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="7" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:list-level-properties text:space-before="4.445cm" text:min-label-width="0.635cm"/>
+ <style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="8" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:list-level-properties text:space-before="5.08cm" text:min-label-width="0.635cm"/>
+ <style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="9" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:list-level-properties text:space-before="5.715cm" text:min-label-width="0.635cm"/>
+ <style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="10" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:list-level-properties text:space-before="6.35cm" text:min-label-width="0.635cm"/>
+ <style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ </text:list-style>
+
+ <!-- Description List -->
+ <text:list-style style:name="OrgDescriptionList">
+ <text:list-level-style-number text:level="1" style:num-format="">
+ <style:list-level-properties text:space-before="0.635cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="2" style:num-format="">
+ <style:list-level-properties text:space-before="1.27cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="3" style:num-format="">
+ <style:list-level-properties text:space-before="1.905cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="4" style:num-format="">
+ <style:list-level-properties text:space-before="2.54cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="5" style:num-format="">
+ <style:list-level-properties text:space-before="3.175cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="6" style:num-format="">
+ <style:list-level-properties text:space-before="3.81cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="7" style:num-format="">
+ <style:list-level-properties text:space-before="4.445cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="8" style:num-format="">
+ <style:list-level-properties text:space-before="5.08cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="9" style:num-format="">
+ <style:list-level-properties text:space-before="5.715cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="10" style:num-format="">
+ <style:list-level-properties text:space-before="6.35cm"/>
+ </text:list-level-style-number>
+ </text:list-style>
+
+ <text:list-style style:name="OrgSrcBlockNumberedLine">
+ <text:list-level-style-number text:level="1" style:num-format="1">
+ <style:list-level-properties text:space-before="0.635cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="2" style:num-format="1">
+ <style:list-level-properties text:space-before="1.27cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="3" style:num-format="1">
+ <style:list-level-properties text:space-before="1.905cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="4" style:num-format="1">
+ <style:list-level-properties text:space-before="2.54cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="5" style:num-format="1">
+ <style:list-level-properties text:space-before="3.175cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="6" style:num-format="1">
+ <style:list-level-properties text:space-before="3.81cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="7" style:num-format="1">
+ <style:list-level-properties text:space-before="4.445cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="8" style:num-format="1">
+ <style:list-level-properties text:space-before="5.08cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="9" style:num-format="1">
+ <style:list-level-properties text:space-before="5.715cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="10" style:num-format="1">
+ <style:list-level-properties text:space-before="6.35cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
+ </text:list-level-style-number>
+ </text:list-style>
+
+ <text:notes-configuration text:note-class="footnote" text:citation-style-name="Footnote_20_Symbol" text:citation-body-style-name="Footnote_20_anchor" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/>
+ <text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/>
+ <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="MP1" style:family="paragraph" style:parent-style-name="Footer">
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+ </style:style>
+ <style:page-layout style:name="Mpm1" style:page-usage="mirrored">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="none" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style/>
+ <style:footer-style>
+ <style:header-footer-properties fo:min-height="0.6cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.499cm" style:dynamic-spacing="false"/>
+ </style:footer-style>
+ </style:page-layout>
+ <style:page-layout style:name="Mpm2">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style/>
+ <style:footer-style/>
+ </style:page-layout>
+ <style:page-layout style:name="Mpm3" style:page-usage="mirrored">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="i" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style/>
+ <style:footer-style>
+ <style:header-footer-properties fo:min-height="0cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.499cm"/>
+ </style:footer-style>
+ </style:page-layout>
+ <style:page-layout style:name="Mpm4" style:page-usage="right">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" fo:background-color="transparent" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
+ <style:background-image/>
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style/>
+ <style:footer-style>
+ <style:header-footer-properties fo:min-height="0.6cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.499cm" style:dynamic-spacing="false"/>
+ </style:footer-style>
+ </style:page-layout>
+ <style:page-layout style:name="Mpm5" style:page-usage="mirrored">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style/>
+ <style:footer-style>
+ <style:header-footer-properties fo:min-height="0.6cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.499cm" style:dynamic-spacing="false"/>
+ </style:footer-style>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="Mpm1">
+ <style:footer>
+ <text:p text:style-name="MP1"><text:page-number text:select-page="current"></text:page-number></text:p>
+ </style:footer>
+ </style:master-page>
+ <style:master-page style:name="OrgTitlePage" style:page-layout-name="Mpm2" style:next-style-name="OrgFrontMatterPage"/>
+ <style:master-page style:name="OrgFrontMatterPage" style:page-layout-name="Mpm3">
+ <style:footer>
+ <text:p text:style-name="MP1"><text:page-number text:select-page="current"/></text:p>
+ </style:footer>
+ </style:master-page>
+ <style:master-page style:name="OrgFirstPage" style:page-layout-name="Mpm4" style:next-style-name="OrgPage">
+ <style:footer>
+ <text:p text:style-name="MP1"><text:page-number text:select-page="current"/></text:p>
+ </style:footer>
+ </style:master-page>
+ <style:master-page style:name="OrgPage" style:page-layout-name="Mpm5">
+ <style:footer>
+ <text:p text:style-name="MP1"><text:page-number text:select-page="current"/></text:p>
+ </style:footer>
+ </style:master-page>
+ </office:master-styles>
+</office:document-styles>
diff --git a/elpa/org-9.5.2/etc/styles/README b/elpa/org-9.5.2/etc/styles/README
new file mode 100644
index 0000000..07126fc
--- /dev/null
+++ b/elpa/org-9.5.2/etc/styles/README
@@ -0,0 +1,36 @@
+The files OrgOdtContentTemplate.xml and OrgOdtStyles.xml have the
+following copyright information:
+
+Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+These files are 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 <https://www.gnu.org/licenses/>.
+
+
+Author: Jambunathan K <kjambunathan at gmail dot com>
+Keywords: outlines, hypermedia, calendar, wp
+Homepage: https://orgmode.org
+
+Commentary:
+
+These files are part of Org-mode's OpenDocument export module.
+
+OrgOdtContentTemplate.xml provides a template within which the content
+of an exported document is enclosed. This file contributes to
+"content.xml" file within an exported document and acts as a
+repository of automatic styles.
+
+OrgOdtStyles.xml contributes to "styles.xml" file within an exported
+document and acts as a repository of custom styles.
diff --git a/elpa/org-9.5.2/local.mk b/elpa/org-9.5.2/local.mk
new file mode 100644
index 0000000..f21da7f
--- /dev/null
+++ b/elpa/org-9.5.2/local.mk
@@ -0,0 +1,52 @@
+
+# Remove "oldorg:" to switch to "all" as the default target.
+# Change "oldorg:" to an existing target to make that target the default,
+# or define your own target here to become the default target.
+oldorg: # do what the old Makefile did by default.
+
+##----------------------------------------------------------------------
+## CHECK AND ADAPT THE FOLLOWING DEFINITIONS
+##----------------------------------------------------------------------
+
+# Name of your emacs binary
+EMACS = emacs
+
+# Where local software is found
+prefix = /usr/share
+
+# Where local lisp files go.
+lispdir= $(prefix)/emacs/site-lisp/org
+
+# Where local data files go.
+datadir = $(prefix)/emacs/etc/org
+
+# Where info files go.
+infodir = $(prefix)/info
+
+# Define if you only need info documentation, the default includes html and pdf
+#ORG_MAKE_DOC = info # html pdf
+
+# Define which git branch to switch to during update. Does not switch
+# the branch when undefined.
+GIT_BRANCH =
+
+# Where to create temporary files for the testsuite
+# respect TMPDIR if it is already defined in the environment
+TMPDIR ?= /tmp
+testdir = $(TMPDIR)/tmp-orgtest
+
+# Configuration for testing
+# add options before standard load-path
+BTEST_PRE =
+# add options after standard load path
+BTEST_POST =
+ # -L <path-to>/ert # needed for Emacs23, Emacs24 has ert built in
+ # -L <path-to>/ess # needed for running R tests
+ # -L <path-to>/htmlize # need at least version 1.34 for source code formatting
+BTEST_OB_LANGUAGES = awk C fortran maxima lilypond octave perl python
+ # R # requires ESS to be installed and configured
+ # ruby # requires inf-ruby to be installed and configured
+# extra packages to require for testing
+BTEST_EXTRA =
+ # ess-site # load ESS for R tests
+# See default.mk for further configuration options.
diff --git a/elpa/org-9.5.2/ob-C.el b/elpa/org-9.5.2/ob-C.el
new file mode 100644
index 0000000..842e0d3
--- /dev/null
+++ b/elpa/org-9.5.2/ob-C.el
@@ -0,0 +1,505 @@
+;;; ob-C.el --- Babel Functions for C and Similar Languages -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Thierry Banel
+;; Maintainer: Thierry Banel
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating C, C++, D code.
+;;
+;; very limited implementation:
+;; - currently only support :results output
+;; - not much in the way of error feedback
+
+;;; Code:
+
+(require 'cc-mode)
+(require 'ob)
+(require 'org-macs)
+
+(declare-function org-entry-get "org" (pom property &optional inherit literal-nil))
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("C++" . "cpp"))
+(add-to-list 'org-babel-tangle-lang-exts '("D" . "d"))
+
+(defvar org-babel-default-header-args:C '())
+
+(defconst org-babel-header-args:C '((includes . :any)
+ (defines . :any)
+ (main . :any)
+ (flags . :any)
+ (cmdline . :any)
+ (libs . :any))
+ "C/C++-specific header arguments.")
+
+(defconst org-babel-header-args:C++
+ (append '((namespaces . :any))
+ org-babel-header-args:C)
+ "C++-specific header arguments.")
+
+(defcustom org-babel-C-compiler "gcc"
+ "Command used to compile a C source code file into an executable.
+May be either a command in the path, like gcc
+or an absolute path name, like /usr/local/bin/gcc
+parameter may be used, like gcc -v"
+ :group 'org-babel
+ :version "24.3"
+ :type 'string)
+
+(defcustom org-babel-C++-compiler "g++"
+ "Command used to compile a C++ source code file into an executable.
+May be either a command in the path, like g++
+or an absolute path name, like /usr/local/bin/g++
+parameter may be used, like g++ -v"
+ :group 'org-babel
+ :version "24.3"
+ :type 'string)
+
+(defcustom org-babel-D-compiler "rdmd"
+ "Command used to compile and execute a D source code file.
+May be either a command in the path, like rdmd
+or an absolute path name, like /usr/local/bin/rdmd
+parameter may be used, like rdmd --chatty"
+ :group 'org-babel
+ :version "24.3"
+ :type 'string)
+
+(defvar org-babel-c-variant nil
+ "Internal variable used to hold which type of C (e.g. C or C++ or D)
+is currently being evaluated.")
+
+(defun org-babel-execute:cpp (body params)
+ "Execute BODY according to PARAMS.
+This function calls `org-babel-execute:C++'."
+ (org-babel-execute:C++ body params))
+
+(defun org-babel-expand-body:cpp (body params)
+ "Expand a block of C++ code with org-babel according to its header arguments."
+ (org-babel-expand-body:C++ body params))
+
+(defun org-babel-execute:C++ (body params)
+ "Execute a block of C++ code with org-babel.
+This function is called by `org-babel-execute-src-block'."
+ (let ((org-babel-c-variant 'cpp)) (org-babel-C-execute body params)))
+
+(defun org-babel-expand-body:C++ (body params)
+ "Expand a block of C++ code with org-babel according to its header arguments."
+ (let ((org-babel-c-variant 'cpp)) (org-babel-C-expand-C++ body params)))
+
+(defun org-babel-execute:D (body params)
+ "Execute a block of D code with org-babel.
+This function is called by `org-babel-execute-src-block'."
+ (let ((org-babel-c-variant 'd)) (org-babel-C-execute body params)))
+
+(defun org-babel-expand-body:D (body params)
+ "Expand a block of D code with org-babel according to its header arguments."
+ (let ((org-babel-c-variant 'd)) (org-babel-C-expand-D body params)))
+
+(defun org-babel-execute:C (body params)
+ "Execute a block of C code with org-babel.
+This function is called by `org-babel-execute-src-block'."
+ (let ((org-babel-c-variant 'c)) (org-babel-C-execute body params)))
+
+(defun org-babel-expand-body:C (body params)
+ "Expand a block of C code with org-babel according to its header arguments."
+ (let ((org-babel-c-variant 'c)) (org-babel-C-expand-C body params)))
+
+(defun org-babel-C-execute (body params)
+ "This function should only be called by `org-babel-execute:C'
+or `org-babel-execute:C++' or `org-babel-execute:D'."
+ (let* ((tmp-src-file (org-babel-temp-file
+ "C-src-"
+ (pcase org-babel-c-variant
+ (`c ".c") (`cpp ".cpp") (`d ".d"))))
+ (tmp-bin-file ;not used for D
+ (org-babel-process-file-name
+ (org-babel-temp-file "C-bin-" org-babel-exeext)))
+ (cmdline (cdr (assq :cmdline params)))
+ (cmdline (if cmdline (concat " " cmdline) ""))
+ (flags (cdr (assq :flags params)))
+ (flags (mapconcat 'identity
+ (if (listp flags) flags (list flags)) " "))
+ (libs (org-babel-read
+ (or (cdr (assq :libs params))
+ (org-entry-get nil "libs" t))
+ nil))
+ (libs (mapconcat #'identity
+ (if (listp libs) libs (list libs))
+ " "))
+ (full-body
+ (pcase org-babel-c-variant
+ (`c (org-babel-C-expand-C body params))
+ (`cpp (org-babel-C-expand-C++ body params))
+ (`d (org-babel-C-expand-D body params)))))
+ (with-temp-file tmp-src-file (insert full-body))
+ (pcase org-babel-c-variant
+ ((or `c `cpp)
+ (org-babel-eval
+ (format "%s -o %s %s %s %s"
+ (pcase org-babel-c-variant
+ (`c org-babel-C-compiler)
+ (`cpp org-babel-C++-compiler))
+ tmp-bin-file
+ flags
+ (org-babel-process-file-name tmp-src-file)
+ libs)
+ ""))
+ (`d nil)) ;; no separate compilation for D
+ (let ((results
+ (org-babel-eval
+ (pcase org-babel-c-variant
+ ((or `c `cpp)
+ (concat tmp-bin-file cmdline))
+ (`d
+ (format "%s %s %s %s"
+ org-babel-D-compiler
+ flags
+ (org-babel-process-file-name tmp-src-file)
+ cmdline)))
+ "")))
+ (when results
+ (setq results (org-remove-indentation results))
+ (org-babel-reassemble-table
+ (org-babel-result-cond (cdr (assq :result-params params))
+ (org-babel-read results t)
+ (let ((tmp-file (org-babel-temp-file "c-")))
+ (with-temp-file tmp-file (insert results))
+ (org-babel-import-elisp-from-file tmp-file)))
+ (org-babel-pick-name
+ (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
+ (org-babel-pick-name
+ (cdr (assq :rowname-names params)) (cdr (assq :rownames params)))))
+ )))
+
+(defun org-babel-C-expand-C++ (body params)
+ "Expand a block of C/C++ code with org-babel according to its header arguments."
+ (org-babel-C-expand-C body params))
+
+(defun org-babel-C-expand-C (body params)
+ "Expand a block of C/C++ code with org-babel according to its header arguments."
+ (let ((vars (org-babel--get-vars params))
+ (colnames (cdr (assq :colname-names params)))
+ (main-p (not (string= (cdr (assq :main params)) "no")))
+ (includes (org-babel-read
+ (cdr (assq :includes params))
+ nil))
+ (defines (org-babel-read
+ (cdr (assq :defines params))
+ nil))
+ (namespaces (org-babel-read
+ (cdr (assq :namespaces params))
+ nil)))
+ (when (stringp includes)
+ (setq includes (split-string includes)))
+ (when (stringp namespaces)
+ (setq namespaces (split-string namespaces)))
+ (when (stringp defines)
+ (let ((y nil)
+ (result (list t)))
+ (dolist (x (split-string defines))
+ (if (null y)
+ (setq y x)
+ (nconc result (list (concat y " " x)))
+ (setq y nil)))
+ (setq defines (cdr result))))
+ (mapconcat 'identity
+ (list
+ ;; includes
+ (mapconcat
+ (lambda (inc)
+ ;; :includes '(<foo> <bar>) gives us a list of
+ ;; symbols; convert those to strings.
+ (when (symbolp inc) (setq inc (symbol-name inc)))
+ (if (string-prefix-p "<" inc)
+ (format "#include %s" inc)
+ (format "#include \"%s\"" inc)))
+ includes "\n")
+ ;; defines
+ (mapconcat
+ (lambda (inc) (format "#define %s" inc))
+ (if (listp defines) defines (list defines)) "\n")
+ ;; namespaces
+ (mapconcat
+ (lambda (inc) (format "using namespace %s;" inc))
+ namespaces
+ "\n")
+ ;; variables
+ (mapconcat 'org-babel-C-var-to-C vars "\n")
+ ;; table sizes
+ (mapconcat 'org-babel-C-table-sizes-to-C vars "\n")
+ ;; tables headers utility
+ (when colnames
+ (org-babel-C-utility-header-to-C))
+ ;; tables headers
+ (mapconcat (lambda (head)
+ (let* ((tblnm (car head))
+ (tbl (cdr (car (let* ((el vars))
+ (while (not (or (equal tblnm (caar el)) (not el)))
+ (setq el (cdr el)))
+ el))))
+ (type (org-babel-C-val-to-base-type tbl)))
+ (org-babel-C-header-to-C head type))) colnames "\n")
+ ;; body
+ (if main-p
+ (org-babel-C-ensure-main-wrap body)
+ body) "\n") "\n")))
+
+(defun org-babel-C-expand-D (body params)
+ "Expand a block of D code with org-babel according to its header arguments."
+ (let ((vars (org-babel--get-vars params))
+ (colnames (cdr (assq :colname-names params)))
+ (main-p (not (string= (cdr (assq :main params)) "no")))
+ (imports (or (cdr (assq :imports params))
+ (org-babel-read (org-entry-get nil "imports" t)))))
+ (when (stringp imports)
+ (setq imports (split-string imports)))
+ (setq imports (append imports '("std.stdio" "std.conv")))
+ (mapconcat 'identity
+ (list
+ "module mmm;"
+ ;; imports
+ (mapconcat
+ (lambda (inc) (format "import %s;" inc))
+ imports "\n")
+ ;; variables
+ (mapconcat 'org-babel-C-var-to-C vars "\n")
+ ;; table sizes
+ (mapconcat 'org-babel-C-table-sizes-to-C vars "\n")
+ ;; tables headers utility
+ (when colnames
+ (org-babel-C-utility-header-to-C))
+ ;; tables headers
+ (mapconcat (lambda (head)
+ (let* ((tblnm (car head))
+ (tbl (cdr (car (let* ((el vars))
+ (while (not (or (equal tblnm (caar el)) (not el)))
+ (setq el (cdr el)))
+ el))))
+ (type (org-babel-C-val-to-base-type tbl)))
+ (org-babel-C-header-to-C head type))) colnames "\n")
+ ;; body
+ (if main-p
+ (org-babel-C-ensure-main-wrap body)
+ body) "\n") "\n")))
+
+(defun org-babel-C-ensure-main-wrap (body)
+ "Wrap BODY in a \"main\" function call if none exists."
+ (if (string-match "^[ \t]*[intvod]+[ \t\n\r]*main[ \t]*(.*)" body)
+ body
+ (format "int main() {\n%s\nreturn 0;\n}\n" body)))
+
+(defun org-babel-prep-session:C (_session _params)
+ "This function does nothing as C is a compiled language with no
+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."
+ (error "C is a compiled language -- no support for sessions"))
+
+;; helper functions
+
+(defun org-babel-C-format-val (type val)
+ "Handle the FORMAT part of TYPE with the data from VAL."
+ (let ((format-data (cadr type)))
+ (if (stringp format-data)
+ (cons "" (format format-data val))
+ (funcall format-data val))))
+
+(defun org-babel-C-val-to-C-type (val)
+ "Determine the type of VAL.
+Return a list (TYPE-NAME FORMAT). TYPE-NAME should be the name of the type.
+FORMAT can be either a format string or a function which is called with VAL."
+ (let* ((basetype (org-babel-C-val-to-base-type val))
+ (type
+ (pcase basetype
+ (`integerp '("int" "%d"))
+ (`floatp '("double" "%f"))
+ (`stringp
+ (list
+ (if (eq org-babel-c-variant 'd) "string" "const char*")
+ "\"%s\""))
+ (_ (error "Unknown type %S" basetype)))))
+ (cond
+ ((integerp val) type) ;; an integer declared in the #+begin_src line
+ ((floatp val) type) ;; a numeric declared in the #+begin_src line
+ ((and (listp val) (listp (car val))) ;; a table
+ `(,(car type)
+ (lambda (val)
+ (cons
+ (pcase org-babel-c-variant
+ ((or `c `cpp) (format "[%d][%d]" (length val) (length (car val))))
+ (`d (format "[%d][%d]" (length (car val)) (length val))))
+ (concat
+ (if (eq org-babel-c-variant 'd) "[\n" "{\n")
+ (mapconcat
+ (lambda (v)
+ (concat
+ (if (eq org-babel-c-variant 'd) " [" " {")
+ (mapconcat (lambda (w) (format ,(cadr type) w)) v ",")
+ (if (eq org-babel-c-variant 'd) "]" "}")))
+ val
+ ",\n")
+ (if (eq org-babel-c-variant 'd) "\n]" "\n}"))))))
+ ((or (listp val) (vectorp val)) ;; a list declared in the #+begin_src line
+ `(,(car type)
+ (lambda (val)
+ (cons
+ (format "[%d]" (length val))
+ (concat
+ (if (eq org-babel-c-variant 'd) "[" "{")
+ (mapconcat (lambda (v) (format ,(cadr type) v)) val ",")
+ (if (eq org-babel-c-variant 'd) "]" "}"))))))
+ (t ;; treat unknown types as string
+ type))))
+
+(defun org-babel-C-val-to-base-type (val)
+ "Determine the base type of VAL which may be
+`integerp' if all base values are integers
+`floatp' if all base values are either floating points or integers
+`stringp' otherwise."
+ (cond
+ ((integerp val) 'integerp)
+ ((floatp val) 'floatp)
+ ((or (listp val) (vectorp val))
+ (let ((type nil))
+ (mapc (lambda (v)
+ (pcase (org-babel-C-val-to-base-type v)
+ (`stringp (setq type 'stringp))
+ (`floatp
+ (when (or (not type) (eq type 'integerp))
+ (setq type 'floatp)))
+ (`integerp
+ (unless type (setq type 'integerp)))))
+ val)
+ type))
+ (t 'stringp)))
+
+(defun org-babel-C-var-to-C (pair)
+ "Convert an elisp val into a string of C code specifying a var of the same value."
+ ;; TODO list support
+ (let ((var (car pair))
+ (val (cdr pair)))
+ (when (symbolp val)
+ (setq val (symbol-name val))
+ (when (= (length val) 1)
+ (setq val (string-to-char val))))
+ (let* ((type-data (org-babel-C-val-to-C-type val))
+ (type (car type-data))
+ (formatted (org-babel-C-format-val type-data val))
+ (suffix (car formatted))
+ (data (cdr formatted)))
+ (pcase org-babel-c-variant
+ ((or `c `cpp)
+ (format "%s %s%s = %s;"
+ type
+ var
+ suffix
+ data))
+ (`d
+ (format "%s%s %s = %s;"
+ type
+ suffix
+ var
+ data))))))
+
+(defun org-babel-C-table-sizes-to-C (pair)
+ "Create constants of table dimensions, if PAIR is a table."
+ (when (listp (cdr pair))
+ (cond
+ ((listp (cadr pair)) ;; a table
+ (concat
+ (format "const int %s_rows = %d;" (car pair) (length (cdr pair)))
+ "\n"
+ (format "const int %s_cols = %d;" (car pair) (length (cadr pair)))))
+ (t ;; a list declared in the #+begin_src line
+ (format "const int %s_cols = %d;" (car pair) (length (cdr pair)))))))
+
+(defun org-babel-C-utility-header-to-C ()
+ "Generate a utility function to convert a column name into a column number."
+ (pcase org-babel-c-variant
+ ((or `c `cpp)
+ (concat
+ "
+#ifndef _STRING_H
+#include <string.h>
+#endif
+int get_column_num (int nbcols, const char** header, const char* column)
+{
+ int c;
+ for (c=0; c<nbcols; c++)
+ if (strcmp(header[c],column)==0)
+ return c;
+ return -1;
+}
+"))
+ (`d
+ "int get_column_num (string[] header, string column)
+{
+ foreach (c, h; header)
+ if (h==column)
+ return to!int(c);
+ return -1;
+}
+")))
+
+(defun org-babel-C-header-to-C (head type)
+ "Convert an elisp list of header table into a C or D vector
+specifying a variable with the name of the table."
+ (message "%S" type)
+ (let ((table (car head))
+ (headers (cdr head))
+ (typename (pcase type
+ (`integerp "int")
+ (`floatp "double")
+ (`stringp (pcase org-babel-c-variant
+ ((or `c `cpp) "const char*")
+ (`d "string"))))))
+ (concat
+ (pcase org-babel-c-variant
+ ((or `c `cpp)
+ (format "const char* %s_header[%d] = {%s};"
+ table
+ (length headers)
+ (mapconcat (lambda (h) (format "\"%s\"" h)) headers ",")))
+ (`d
+ (format "string[%d] %s_header = [%s];"
+ (length headers)
+ table
+ (mapconcat (lambda (h) (format "\"%s\"" h)) headers ","))))
+ "\n"
+ (pcase org-babel-c-variant
+ ((or `c `cpp)
+ (format
+ "%s %s_h (int row, const char* col) { return %s[row][get_column_num(%d,%s_header,col)]; }"
+ typename table table (length headers) table))
+ (`d
+ (format
+ "%s %s_h (size_t row, string col) { return %s[row][get_column_num(%s_header,col)]; }"
+ typename table table table))))))
+
+(provide 'ob-C)
+
+;;; ob-C.el ends here
diff --git a/elpa/org-9.5.2/ob-C.elc b/elpa/org-9.5.2/ob-C.elc
new file mode 100644
index 0000000..d42b2e6
--- /dev/null
+++ b/elpa/org-9.5.2/ob-C.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-R.el b/elpa/org-9.5.2/ob-R.el
new file mode 100644
index 0000000..169e1d6
--- /dev/null
+++ b/elpa/org-9.5.2/ob-R.el
@@ -0,0 +1,570 @@
+;;; ob-R.el --- Babel Functions for R -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Dan Davison
+;; Maintainer: Jeremie Juste
+;; Keywords: literate programming, reproducible research, R, statistics
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating R code
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ob)
+
+(declare-function orgtbl-to-tsv "org-table" (table params))
+(declare-function R "ext:essd-r" (&optional start-args))
+(declare-function inferior-ess-send-input "ext:ess-inf" ())
+(declare-function ess-make-buffer-current "ext:ess-inf" ())
+(declare-function ess-eval-buffer "ext:ess-inf" (vis))
+(declare-function ess-wait-for-process "ext:ess-inf"
+ (&optional proc sec-prompt wait force-redisplay))
+
+;; FIXME: Temporary declaration to silence the byte-compiler
+(defvar user-inject-src-param)
+(defvar ess-eval-visibly-tmp)
+(defvar ess-eval-visibly)
+(defvar ess-inject-source)
+(defvar user-inject-src-param)
+
+(defconst org-babel-header-args:R
+ '((width . :any)
+ (height . :any)
+ (bg . :any)
+ (units . :any)
+ (pointsize . :any)
+ (antialias . :any)
+ (quality . :any)
+ (compression . :any)
+ (res . :any)
+ (type . :any)
+ (family . :any)
+ (title . :any)
+ (fonts . :any)
+ (version . :any)
+ (paper . :any)
+ (encoding . :any)
+ (pagecentre . :any)
+ (colormodel . :any)
+ (useDingbats . :any)
+ (horizontal . :any)
+ (results . ((file list vector table scalar verbatim)
+ (raw html latex org code pp drawer)
+ (replace silent none append prepend)
+ (output value graphics))))
+ "R-specific header arguments.")
+
+(defconst ob-R-safe-header-args
+ (append org-babel-safe-header-args
+ '(:width :height :bg :units :pointsize :antialias :quality
+ :compression :res :type :family :title :fonts
+ :version :paper :encoding :pagecentre :colormodel
+ :useDingbats :horizontal))
+ "Header args which are safe for R babel blocks.
+
+See `org-babel-safe-header-args' for documentation of the format of
+this variable.")
+
+(defvar org-babel-default-header-args:R '())
+(put 'org-babel-default-header-args:R 'safe-local-variable
+ (org-babel-header-args-safe-fn ob-R-safe-header-args))
+
+(defcustom org-babel-R-command "R --slave --no-save"
+ "Name of command to use for executing R code."
+ :group 'org-babel
+ :version "24.1"
+ :type 'string)
+
+(defvar ess-current-process-name) ; dynamically scoped
+(defvar ess-local-process-name) ; dynamically scoped
+(defun org-babel-edit-prep:R (info)
+ (let ((session (cdr (assq :session (nth 2 info)))))
+ (when (and session
+ (string-prefix-p "*" session)
+ (string-suffix-p "*" session))
+ (org-babel-R-initiate-session session nil))))
+
+;; The usage of utils::read.table() ensures that the command
+;; read.table() can be found even in circumstances when the utils
+;; package is not in the search path from R.
+(defconst ob-R-transfer-variable-table-with-header
+ "%s <- local({
+ con <- textConnection(
+ %S
+ )
+ res <- utils::read.table(
+ con,
+ header = %s,
+ row.names = %s,
+ sep = \"\\t\",
+ as.is = TRUE
+ )
+ close(con)
+ res
+ })"
+ "R code used to transfer a table defined as a variable from org to R.
+
+This function is used when the table contains a header.")
+
+(defconst ob-R-transfer-variable-table-without-header
+ "%s <- local({
+ con <- textConnection(
+ %S
+ )
+ res <- utils::read.table(
+ con,
+ header = %s,
+ row.names = %s,
+ sep = \"\\t\",
+ as.is = TRUE,
+ fill = TRUE,
+ col.names = paste(\"V\", seq_len(%d), sep =\"\")
+ )
+ close(con)
+ res
+ })"
+ "R code used to transfer a table defined as a variable from org to R.
+
+This function is used when the table does not contain a header.")
+
+(defun org-babel-expand-body:R (body params &optional _graphics-file)
+ "Expand BODY according to PARAMS, return the expanded body."
+ (mapconcat 'identity
+ (append
+ (when (cdr (assq :prologue params))
+ (list (cdr (assq :prologue params))))
+ (org-babel-variable-assignments:R params)
+ (list body)
+ (when (cdr (assq :epilogue params))
+ (list (cdr (assq :epilogue params)))))
+ "\n"))
+
+(defun org-babel-execute:R (body params)
+ "Execute a block of R code.
+This function is called by `org-babel-execute-src-block'."
+ (save-excursion
+ (let* ((result-params (cdr (assq :result-params params)))
+ (result-type (cdr (assq :result-type params)))
+ (async (org-babel-comint-use-async params))
+ (session (org-babel-R-initiate-session
+ (cdr (assq :session params)) params))
+ (graphics-file (and (member "graphics" (assq :result-params params))
+ (org-babel-graphical-output-file params)))
+ (colnames-p (unless graphics-file (cdr (assq :colnames params))))
+ (rownames-p (unless graphics-file (cdr (assq :rownames params))))
+ (full-body
+ (let ((inside
+ (list (org-babel-expand-body:R body params graphics-file))))
+ (mapconcat 'identity
+ (if graphics-file
+ (append
+ (list (org-babel-R-construct-graphics-device-call
+ graphics-file params))
+ inside
+ (list "},error=function(e){plot(x=-1:1, y=-1:1, type='n', xlab='', ylab='', axes=FALSE); text(x=0, y=0, labels=e$message, col='red'); paste('ERROR', e$message, sep=' : ')}); dev.off()"))
+ inside)
+ "\n")))
+ (result
+ (org-babel-R-evaluate
+ session full-body result-type result-params
+ (or (equal "yes" colnames-p)
+ (org-babel-pick-name
+ (cdr (assq :colname-names params)) colnames-p))
+ (or (equal "yes" rownames-p)
+ (org-babel-pick-name
+ (cdr (assq :rowname-names params)) rownames-p))
+ async)))
+ (if graphics-file nil result))))
+
+(defun org-babel-prep-session:R (session params)
+ "Prepare SESSION according to the header arguments specified in PARAMS."
+ (let* ((session (org-babel-R-initiate-session session params))
+ (var-lines (org-babel-variable-assignments:R params)))
+ (org-babel-comint-in-buffer session
+ (mapc (lambda (var)
+ (end-of-line 1) (insert var) (comint-send-input nil t)
+ (org-babel-comint-wait-for-output session))
+ var-lines))
+ session))
+
+(defun org-babel-load-session:R (session body params)
+ "Load BODY into SESSION."
+ (save-window-excursion
+ (let ((buffer (org-babel-prep-session:R session params)))
+ (with-current-buffer buffer
+ (goto-char (process-mark (get-buffer-process (current-buffer))))
+ (insert (org-babel-chomp body)))
+ buffer)))
+
+;; helper functions
+
+(defun org-babel-variable-assignments:R (params)
+ "Return list of R statements assigning the block's variables."
+ (let ((vars (org-babel--get-vars params)))
+ (mapcar
+ (lambda (pair)
+ (org-babel-R-assign-elisp
+ (car pair) (cdr pair)
+ (equal "yes" (cdr (assq :colnames params)))
+ (equal "yes" (cdr (assq :rownames params)))))
+ (mapcar
+ (lambda (i)
+ (cons (car (nth i vars))
+ (org-babel-reassemble-table
+ (cdr (nth i vars))
+ (cdr (nth i (cdr (assq :colname-names params))))
+ (cdr (nth i (cdr (assq :rowname-names params)))))))
+ (number-sequence 0 (1- (length vars)))))))
+
+(defun org-babel-R-quote-tsv-field (s)
+ "Quote field S for export to R."
+ (if (stringp s)
+ (concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"") "\"")
+ (format "%S" s)))
+
+(defun org-babel-R-assign-elisp (name value colnames-p rownames-p)
+ "Construct R code assigning the elisp VALUE to a variable named NAME."
+ (if (listp value)
+ (let* ((lengths (mapcar 'length (cl-remove-if-not 'sequencep value)))
+ (max (if lengths (apply 'max lengths) 0))
+ (min (if lengths (apply 'min lengths) 0)))
+ ;; Ensure VALUE has an orgtbl structure (depth of at least 2).
+ (unless (listp (car value)) (setq value (list value)))
+ (let ((file (orgtbl-to-tsv value '(:fmt org-babel-R-quote-tsv-field)))
+ (header (if (or (eq (nth 1 value) 'hline) colnames-p)
+ "TRUE" "FALSE"))
+ (row-names (if rownames-p "1" "NULL")))
+ (if (= max min)
+ (format ob-R-transfer-variable-table-with-header
+ name file header row-names)
+ (format ob-R-transfer-variable-table-without-header
+ name file header row-names max))))
+ (cond ((integerp value) (format "%s <- %s" name (concat (number-to-string value) "L")))
+ ((floatp value) (format "%s <- %s" name value))
+ ((stringp value) (format "%s <- %S" name (org-no-properties value)))
+ (t (format "%s <- %S" name (prin1-to-string value))))))
+
+
+(defvar ess-ask-for-ess-directory) ; dynamically scoped
+(defun org-babel-R-initiate-session (session params)
+ "If there is not a current R process then create one."
+ (unless (string= session "none")
+ (let ((session (or session "*R*"))
+ (ess-ask-for-ess-directory
+ (and (boundp 'ess-ask-for-ess-directory)
+ ess-ask-for-ess-directory
+ (not (cdr (assq :dir params))))))
+ (if (org-babel-comint-buffer-livep session)
+ session
+ (save-window-excursion
+ (when (get-buffer session)
+ ;; Session buffer exists, but with dead process
+ (set-buffer session))
+ (require 'ess) (R)
+ (let ((R-proc (get-process (or ess-local-process-name
+ ess-current-process-name))))
+ (while (process-get R-proc 'callbacks)
+ (ess-wait-for-process R-proc)))
+ (rename-buffer
+ (if (bufferp session)
+ (buffer-name session)
+ (if (stringp session)
+ session
+ (buffer-name))))
+ (current-buffer))))))
+
+(defun org-babel-R-associate-session (session)
+ "Associate R code buffer with an R session.
+Make SESSION be the inferior ESS process associated with the
+current code buffer."
+ (setq ess-local-process-name
+ (process-name (get-buffer-process session)))
+ (ess-make-buffer-current))
+
+(defvar org-babel-R-graphics-devices
+ '((:bmp "bmp" "filename")
+ (:jpg "jpeg" "filename")
+ (:jpeg "jpeg" "filename")
+ (:tikz "tikz" "file")
+ (:tiff "tiff" "filename")
+ (:png "png" "filename")
+ (:svg "svg" "file")
+ (:pdf "pdf" "file")
+ (:ps "postscript" "file")
+ (:postscript "postscript" "file"))
+ "An alist mapping graphics file types to R functions.
+
+Each member of this list is a list with three members:
+1. the file extension of the graphics file, as an elisp :keyword
+2. the R graphics device function to call to generate such a file
+3. the name of the argument to this function which specifies the
+ file to write to (typically \"file\" or \"filename\")")
+
+(defun org-babel-R-construct-graphics-device-call (out-file params)
+ "Construct the call to the graphics device."
+ (let* ((allowed-args '(:width :height :bg :units :pointsize
+ :antialias :quality :compression :res
+ :type :family :title :fonts :version
+ :paper :encoding :pagecentre :colormodel
+ :useDingbats :horizontal))
+ (device (file-name-extension out-file))
+ (device-info (or (assq (intern (concat ":" device))
+ org-babel-R-graphics-devices)
+ (assq :png org-babel-R-graphics-devices)))
+ (extra-args (cdr (assq :R-dev-args params))) filearg args)
+ (setq device (nth 1 device-info))
+ (setq filearg (nth 2 device-info))
+ (setq args (mapconcat
+ (lambda (pair)
+ (if (member (car pair) allowed-args)
+ (format ",%s=%S"
+ (substring (symbol-name (car pair)) 1)
+ (cdr pair)) ""))
+ params ""))
+ (format "%s(%s=\"%s\"%s%s%s); tryCatch({"
+ device filearg out-file args
+ (if extra-args "," "") (or extra-args ""))))
+
+(defconst org-babel-R-eoe-indicator "'org_babel_R_eoe'")
+(defconst org-babel-R-eoe-output "[1] \"org_babel_R_eoe\"")
+
+(defconst org-babel-R-write-object-command "{
+ function(object,transfer.file) {
+ object
+ invisible(
+ if (
+ inherits(
+ try(
+ {
+ tfile<-tempfile()
+ write.table(object, file=tfile, sep=\"\\t\",
+ na=\"\",row.names=%s,col.names=%s,
+ quote=FALSE)
+ file.rename(tfile,transfer.file)
+ },
+ silent=TRUE),
+ \"try-error\"))
+ {
+ if(!file.exists(transfer.file))
+ file.create(transfer.file)
+ }
+ )
+ }
+}(object=%s,transfer.file=\"%s\")"
+ "Template for an R command to evaluate a block of code and write result to file.
+
+Has four %s escapes to be filled in:
+1. Row names, \"TRUE\" or \"FALSE\"
+2. Column names, \"TRUE\" or \"FALSE\"
+3. The code to be run (must be an expression, not a statement)
+4. The name of the file to write to")
+
+(defun org-babel-R-evaluate
+ (session body result-type result-params column-names-p row-names-p async)
+ "Evaluate R code in BODY."
+ (if session
+ (if async
+ (ob-session-async-org-babel-R-evaluate-session
+ session body result-type result-params column-names-p row-names-p)
+ (org-babel-R-evaluate-session
+ session body result-type result-params column-names-p row-names-p))
+ (org-babel-R-evaluate-external-process
+ body result-type result-params column-names-p row-names-p)))
+
+(defun org-babel-R-evaluate-external-process
+ (body result-type result-params column-names-p row-names-p)
+ "Evaluate BODY in external R process.
+If RESULT-TYPE equals `output' then return standard output as a
+string. If RESULT-TYPE equals `value' then return the value of the
+last statement in BODY, as elisp."
+ (cl-case result-type
+ (value
+ (let ((tmp-file (org-babel-temp-file "R-")))
+ (org-babel-eval org-babel-R-command
+ (format org-babel-R-write-object-command
+ (if row-names-p "TRUE" "FALSE")
+ (if column-names-p
+ (if row-names-p "NA" "TRUE")
+ "FALSE")
+ (format "{function ()\n{\n%s\n}}()" body)
+ (org-babel-process-file-name tmp-file 'noquote)))
+ (org-babel-R-process-value-result
+ (org-babel-result-cond result-params
+ (with-temp-buffer
+ (insert-file-contents tmp-file)
+ (org-babel-chomp (buffer-string) "\n"))
+ (org-babel-import-elisp-from-file tmp-file '(16)))
+ column-names-p)))
+ (output (org-babel-eval org-babel-R-command body))))
+
+(defvar ess-eval-visibly-p)
+
+(defun org-babel-R-evaluate-session
+ (session body result-type result-params column-names-p row-names-p)
+ "Evaluate BODY in SESSION.
+If RESULT-TYPE equals `output' then return standard output as a
+string. If RESULT-TYPE equals `value' then return the value of the
+last statement in BODY, as elisp."
+ (cl-case result-type
+ (value
+ (with-temp-buffer
+ (insert (org-babel-chomp body))
+ (let ((ess-local-process-name
+ (process-name (get-buffer-process session)))
+ (ess-eval-visibly-p nil))
+ (ess-eval-buffer nil)))
+ (let ((tmp-file (org-babel-temp-file "R-")))
+ (org-babel-comint-eval-invisibly-and-wait-for-file
+ session tmp-file
+ (format org-babel-R-write-object-command
+ (if row-names-p "TRUE" "FALSE")
+ (if column-names-p
+ (if row-names-p "NA" "TRUE")
+ "FALSE")
+ ".Last.value" (org-babel-process-file-name tmp-file 'noquote)))
+ (org-babel-R-process-value-result
+ (org-babel-result-cond result-params
+ (with-temp-buffer
+ (insert-file-contents tmp-file)
+ (org-babel-chomp (buffer-string) "\n"))
+ (org-babel-import-elisp-from-file tmp-file '(16)))
+ column-names-p)))
+ (output
+ (mapconcat
+ 'org-babel-chomp
+ (butlast
+ (delq nil
+ (mapcar
+ (lambda (line) (when (> (length line) 0) line))
+ (mapcar
+ (lambda (line) ;; cleanup extra prompts left in output
+ (if (string-match
+ "^\\([>+.]\\([ ][>.+]\\)*[ ]\\)"
+ (car (split-string line "\n")))
+ (substring line (match-end 1))
+ line))
+ (with-current-buffer session
+ (let ((comint-prompt-regexp (concat "^" comint-prompt-regexp)))
+ (org-babel-comint-with-output (session org-babel-R-eoe-output)
+ (insert (mapconcat 'org-babel-chomp
+ (list body org-babel-R-eoe-indicator)
+ "\n"))
+ (inferior-ess-send-input)))))))) "\n"))))
+
+(defun org-babel-R-process-value-result (result column-names-p)
+ "R-specific processing of return value.
+Insert hline if column names in output have been requested."
+ (if column-names-p
+ (condition-case nil
+ (cons (car result) (cons 'hline (cdr result)))
+ (error "Could not parse R result"))
+ result))
+
+
+;;; async evaluation
+
+(defconst ob-session-async-R-indicator "'ob_comint_async_R_%s_%s'")
+
+(defun ob-session-async-org-babel-R-evaluate-session
+ (session body result-type _ column-names-p row-names-p)
+ "Asynchronously evaluate BODY in SESSION.
+Returns a placeholder string for insertion, to later be replaced
+by `org-babel-comint-async-filter'."
+ (org-babel-comint-async-register
+ session (current-buffer)
+ "^\\(?:[>.+] \\)*\\[1\\] \"ob_comint_async_R_\\(.+?\\)_\\(.+\\)\"$"
+ 'org-babel-chomp
+ 'ob-session-async-R-value-callback)
+ (cl-case result-type
+ (value
+ (let ((tmp-file (org-babel-temp-file "R-")))
+ (with-temp-buffer
+ (insert
+ (org-babel-chomp body))
+ (let ((ess-local-process-name
+ (process-name (get-buffer-process session))))
+ (ess-eval-buffer nil)))
+ (with-temp-buffer
+ (insert
+ (mapconcat
+ 'org-babel-chomp
+ (list (format org-babel-R-write-object-command
+ (if row-names-p "TRUE" "FALSE")
+ (if column-names-p
+ (if row-names-p "NA" "TRUE")
+ "FALSE")
+ ".Last.value"
+ (org-babel-process-file-name tmp-file 'noquote))
+ (format ob-session-async-R-indicator
+ "file" tmp-file))
+ "\n"))
+ (let ((ess-local-process-name
+ (process-name (get-buffer-process session))))
+ (ess-eval-buffer nil)))
+ tmp-file))
+ (output
+ (let ((uuid (md5 (number-to-string (random 100000000))))
+ (ess-local-process-name
+ (process-name (get-buffer-process session))))
+ (with-temp-buffer
+ (insert (format ob-session-async-R-indicator
+ "start" uuid))
+ (insert "\n")
+ (insert body)
+ (insert "\n")
+ (insert (format ob-session-async-R-indicator
+ "end" uuid))
+ (setq ess-eval-visibly-tmp ess-eval-visibly)
+ (setq user-inject-src-param ess-inject-source)
+ (setq ess-eval-visibly nil)
+ (setq ess-inject-source 'function-and-buffer)
+ (ess-eval-buffer nil))
+ (setq ess-eval-visibly ess-eval-visibly-tmp)
+ (setq ess-inject-source user-inject-src-param)
+ uuid))))
+
+(defun ob-session-async-R-value-callback (params tmp-file)
+ "Callback for async value results.
+Assigned locally to `ob-session-async-file-callback' in R
+comint buffers used for asynchronous Babel evaluation."
+ (let* ((graphics-file (and (member "graphics" (assq :result-params params))
+ (org-babel-graphical-output-file params)))
+ (colnames-p (unless graphics-file (cdr (assq :colnames params)))))
+ (org-babel-R-process-value-result
+ (org-babel-result-cond (assq :result-params params)
+ (with-temp-buffer
+ (insert-file-contents tmp-file)
+ (org-babel-chomp (buffer-string) "\n"))
+ (org-babel-import-elisp-from-file tmp-file '(16)))
+ (or (equal "yes" colnames-p)
+ (org-babel-pick-name
+ (cdr (assq :colname-names params)) colnames-p)))))
+
+
+
+;;; ob-session-async-R.el ends here
+
+
+(provide 'ob-R)
+
+;;; ob-R.el ends here
diff --git a/elpa/org-9.5.2/ob-R.elc b/elpa/org-9.5.2/ob-R.elc
new file mode 100644
index 0000000..941f0b6
--- /dev/null
+++ b/elpa/org-9.5.2/ob-R.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-awk.el b/elpa/org-9.5.2/ob-awk.el
new file mode 100644
index 0000000..28e9d32
--- /dev/null
+++ b/elpa/org-9.5.2/ob-awk.el
@@ -0,0 +1,110 @@
+;;; ob-awk.el --- Babel Functions for Awk -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Maintainer: Tyler Smith <tyler@plantarum.ca>
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Babel's awk can use special header argument:
+;;
+;; - :in-file takes a path to a file of data to be processed by awk
+;;
+;; - :stdin takes an Org data or code block reference, the value of
+;; which will be passed to the awk process through STDIN
+
+;;; Code:
+(require 'ob)
+(require 'org-compat)
+
+(declare-function org-babel-ref-resolve "ob-ref" (ref))
+(declare-function orgtbl-to-generic "org-table" (table params))
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("awk" . "awk"))
+
+(defvar org-babel-awk-command "awk"
+ "Name of the awk executable command.")
+
+(defun org-babel-expand-body:awk (body _params)
+ "Expand BODY according to PARAMS, return the expanded body."
+ 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'."
+ (message "executing Awk source code block")
+ (let* ((result-params (cdr (assq :result-params params)))
+ (cmd-line (cdr (assq :cmd-line params)))
+ (in-file (cdr (assq :in-file params)))
+ (full-body (org-babel-expand-body:awk body params))
+ (code-file (let ((file (org-babel-temp-file "awk-")))
+ (with-temp-file file (insert full-body)) file))
+ (stdin (let ((stdin (cdr (assq :stdin params))))
+ (when stdin
+ (let ((tmp (org-babel-temp-file "awk-stdin-"))
+ (res (org-babel-ref-resolve stdin)))
+ (with-temp-file tmp
+ (insert (org-babel-awk-var-to-awk res)))
+ tmp))))
+ (cmd (mapconcat #'identity
+ (append
+ (list org-babel-awk-command
+ "-f" code-file cmd-line)
+ (mapcar (lambda (pair)
+ (format "-v %s='%s'"
+ (car pair)
+ (org-babel-awk-var-to-awk
+ (cdr pair))))
+ (org-babel--get-vars params))
+ (list in-file))
+ " ")))
+ (org-babel-reassemble-table
+ (let ((results
+ (cond
+ (stdin (with-temp-buffer
+ (call-process-shell-command cmd stdin (current-buffer))
+ (buffer-string)))
+ (t (org-babel-eval cmd "")))))
+ (when results
+ (org-babel-result-cond result-params
+ results
+ (let ((tmp (org-babel-temp-file "awk-results-")))
+ (with-temp-file tmp (insert results))
+ (org-babel-import-elisp-from-file tmp)))))
+ (org-babel-pick-name
+ (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
+ (org-babel-pick-name
+ (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))
+
+(defun org-babel-awk-var-to-awk (var &optional sep)
+ "Return a printed value of VAR suitable for parsing with awk."
+ (let ((echo-var (lambda (v) (if (stringp v) v (format "%S" v)))))
+ (cond
+ ((and (listp var) (listp (car var)))
+ (orgtbl-to-generic var (list :sep (or sep "\t") :fmt echo-var)))
+ ((listp var)
+ (mapconcat echo-var var "\n"))
+ (t (funcall echo-var var)))))
+
+(provide 'ob-awk)
+
+;;; ob-awk.el ends here
diff --git a/elpa/org-9.5.2/ob-awk.elc b/elpa/org-9.5.2/ob-awk.elc
new file mode 100644
index 0000000..9eaa11e
--- /dev/null
+++ b/elpa/org-9.5.2/ob-awk.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-calc.el b/elpa/org-9.5.2/ob-calc.el
new file mode 100644
index 0000000..5962d38
--- /dev/null
+++ b/elpa/org-9.5.2/ob-calc.el
@@ -0,0 +1,109 @@
+;;; ob-calc.el --- Babel Functions for Calc -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Maintainer: Tom Gillespie <tgbugs@gmail.com>
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating calc code
+
+;;; Code:
+(require 'ob)
+(require 'org-macs)
+(require 'calc)
+(require 'calc-trail)
+(require 'calc-store)
+
+(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))
+
+(defvar org-babel-default-header-args:calc nil
+ "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)
+
+(defvar org--var-syms) ; Dynamically scoped from org-babel-execute:calc
+
+(defun org-babel-execute:calc (body params)
+ "Execute a block of calc code with Babel."
+ (unless (get-buffer "*Calculator*")
+ (save-window-excursion (calc) (calc-quit)))
+ (let* ((vars (org-babel--get-vars params))
+ (org--var-syms (mapcar #'car vars))
+ (var-names (mapcar #'symbol-name org--var-syms)))
+ (mapc
+ (lambda (pair)
+ (calc-push-list (list (cdr pair)))
+ (calc-store-into (car pair)))
+ vars)
+ (mapc
+ (lambda (line)
+ (when (> (length line) 0)
+ (cond
+ ;; simple variable name
+ ((member line var-names) (calc-recall (intern line)))
+ ;; stack operation
+ ((string= "'" (substring line 0 1))
+ (funcall (lookup-key calc-mode-map (substring line 1)) nil))
+ ;; complex expression
+ (t
+ (calc-push-list
+ (list (let ((res (calc-eval line)))
+ (cond
+ ((numberp res) res)
+ ((math-read-number res) (math-read-number res))
+ ((listp res) (error "Calc error \"%s\" on input \"%s\""
+ (cadr res) line))
+ (t (replace-regexp-in-string
+ "'" ""
+ (calc-eval
+ (math-evaluate-expr
+ ;; resolve user variables, calc built in
+ ;; variables are handled automatically
+ ;; upstream by calc
+ (mapcar #'org-babel-calc-maybe-resolve-var
+ ;; parse line into calc objects
+ (car (math-read-exprs line)))))))))
+ ))))))
+ (mapcar #'org-trim
+ (split-string (org-babel-expand-body:calc body params) "[\n\r]"))))
+ (save-excursion
+ (with-current-buffer (get-buffer "*Calculator*")
+ (prog1
+ (calc-eval (calc-top 1))
+ (calc-pop 1)))))
+
+(defun org-babel-calc-maybe-resolve-var (el)
+ (if (consp el)
+ (if (and (eq 'var (car el)) (member (cadr el) org--var-syms))
+ (progn
+ (calc-recall (cadr el))
+ (prog1 (calc-top 1)
+ (calc-pop 1)))
+ (mapcar #'org-babel-calc-maybe-resolve-var el))
+ el))
+
+(provide 'ob-calc)
+
+;;; ob-calc.el ends here
diff --git a/elpa/org-9.5.2/ob-calc.elc b/elpa/org-9.5.2/ob-calc.elc
new file mode 100644
index 0000000..7c13cb6
--- /dev/null
+++ b/elpa/org-9.5.2/ob-calc.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-clojure.el b/elpa/org-9.5.2/ob-clojure.el
new file mode 100644
index 0000000..3b995d9
--- /dev/null
+++ b/elpa/org-9.5.2/ob-clojure.el
@@ -0,0 +1,254 @@
+;;; ob-clojure.el --- Babel Functions for Clojure -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Joel Boehland, Eric Schulte, Oleh Krehel, Frederick Giasson
+;; Maintainer: Bastien Guerry <bzg@gnu.org>
+;;
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Support for evaluating clojure code
+
+;; Requirements:
+
+;; - clojure (at least 1.2.0)
+;; - clojure-mode
+;; - inf-clojure, cider or SLIME
+
+;; For clojure-mode, see https://github.com/clojure-emacs/clojure-mode
+;; For cider, see https://github.com/clojure-emacs/cider
+;; For inf-clojure, see https://github.com/clojure-emacs/cider
+
+;; For SLIME, the best way to install these components is by following
+;; the directions as set out by Phil Hagelberg (Technomancy) on the
+;; web page: https://technomancy.us/126
+
+;;; Code:
+(require 'ob)
+
+(declare-function cider-current-connection "ext:cider-client" (&optional type))
+(declare-function cider-current-ns "ext:cider-client" ())
+(declare-function inf-clojure "ext:inf-clojure" (cmd))
+(declare-function inf-clojure-cmd "ext:inf-clojure" (project-type))
+(declare-function inf-clojure-eval-string "ext:inf-clojure" (code))
+(declare-function inf-clojure-project-type "ext:inf-clojure" ())
+(declare-function nrepl-dict-get "ext:nrepl-client" (dict key))
+(declare-function nrepl-sync-request:eval "ext:nrepl-client" (input connection &optional ns tooling))
+(declare-function sesman-start-session "ext:sesman" (system))
+(declare-function slime-eval "ext:slime" (sexp &optional package))
+
+(defvar cider-buffer-ns)
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("clojure" . "clj"))
+(add-to-list 'org-babel-tangle-lang-exts '("clojurescript" . "cljs"))
+
+(defvar org-babel-default-header-args:clojure '())
+(defvar org-babel-header-args:clojure '((ns . :any) (package . :any)))
+(defvar org-babel-default-header-args:clojurescript '())
+(defvar org-babel-header-args:clojurescript '((package . :any)))
+
+(defcustom org-babel-clojure-backend nil
+ "Backend used to evaluate Clojure code blocks."
+ :group 'org-babel
+ :type '(choice
+ (const :tag "inf-clojure" inf-clojure)
+ (const :tag "cider" cider)
+ (const :tag "slime" slime)
+ (const :tag "Not configured yet" nil)))
+
+(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-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))
+ (if (eq org-babel-clojure-backend 'cider)
+ (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)))
+ (result-params (cdr (assq :result-params params)))
+ (print-level nil)
+ (print-length nil)
+ ;; Remove comments, they break (let [...] ...) bindings
+ (body (replace-regexp-in-string "^[ ]*;+.*$" "" body))
+ (body (org-trim
+ (concat
+ ;; Source block specified namespace :ns.
+ (and (cdr (assq :ns params)) (format "(ns %s)\n" ns))
+ ;; Variables binding.
+ (if (null vars) (org-trim body)
+ (format "(let [%s]\n%s)"
+ (mapconcat
+ (lambda (var)
+ (format "%S %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)
+ body)))
+
+(defvar ob-clojure-inf-clojure-filter-out)
+(defvar ob-clojure-inf-clojure-tmp-output)
+(defun ob-clojure-inf-clojure-output (s)
+ "Store a trimmed version of S in a variable and return S."
+ (let ((s0 (org-trim
+ (replace-regexp-in-string
+ ob-clojure-inf-clojure-filter-out "" s))))
+ (push s0 ob-clojure-inf-clojure-tmp-output))
+ s)
+
+(defmacro ob-clojure-with-temp-expanded (expanded params &rest body)
+ "Run BODY on EXPANDED code block with PARAMS."
+ (declare (debug (body)) (indent 2))
+ `(with-temp-buffer
+ (insert ,expanded)
+ (goto-char (point-min))
+ (while (not (looking-at "\\s-*\\'"))
+ (let* ((beg (point))
+ (end (progn (forward-sexp) (point)))
+ (exp (org-babel-expand-body:clojure
+ (buffer-substring beg end) ,params)))
+ (sit-for .1)
+ ,@body))))
+
+(defsubst ob-clojure-string-or-list (l)
+ "Convert list L into a string or a list of list."
+ (if (and (listp l) (= (length l) 1))
+ (car l)
+ (mapcar #'list l)))
+
+(defvar inf-clojure-buffer)
+(defvar comint-prompt-regexp)
+(defvar inf-clojure-comint-prompt-regexp)
+(defun ob-clojure-eval-with-inf-clojure (expanded params)
+ "Evaluate EXPANDED code block with PARAMS using inf-clojure."
+ (condition-case nil (require 'inf-clojure)
+ (user-error "inf-clojure not available"))
+ ;; Maybe initiate the inf-clojure session
+ (unless (and inf-clojure-buffer
+ (buffer-live-p (get-buffer inf-clojure-buffer)))
+ (save-window-excursion
+ (let* ((alias (cdr (assq :alias params)))
+ (cmd0 (inf-clojure-cmd (inf-clojure-project-type)))
+ (cmd (if alias (replace-regexp-in-string
+ "clojure" (format "clojure -A%s" alias)
+ cmd0)
+ cmd0)))
+ (setq comint-prompt-regexp inf-clojure-comint-prompt-regexp)
+ (funcall-interactively #'inf-clojure cmd)
+ (goto-char (point-max))))
+ (sit-for 1))
+ ;; Now evaluate the code
+ (setq ob-clojure-inf-clojure-filter-out
+ (concat "^nil\\|nil$\\|\\s-*"
+ (or (cdr (assq :ns params))
+ org-babel-clojure-default-ns)
+ "=>\\s-*"))
+ (add-hook 'comint-preoutput-filter-functions
+ #'ob-clojure-inf-clojure-output)
+ (setq ob-clojure-inf-clojure-tmp-output nil)
+ (ob-clojure-with-temp-expanded expanded nil
+ (inf-clojure-eval-string exp))
+ (sit-for .5)
+ (remove-hook 'comint-preoutput-filter-functions
+ #'ob-clojure-inf-clojure-output)
+ ;; And return the result
+ (ob-clojure-string-or-list
+ (delete nil
+ (mapcar
+ (lambda (s)
+ (unless (or (equal "" s)
+ (string-match-p "^Clojure" s))
+ s))
+ (reverse ob-clojure-inf-clojure-tmp-output)))))
+
+(defun ob-clojure-eval-with-cider (expanded params)
+ "Evaluate EXPANDED code block with PARAMS using cider."
+ (condition-case nil (require 'cider)
+ (user-error "cider not available"))
+ (let ((connection (cider-current-connection (cdr (assq :target params))))
+ (result-params (cdr (assq :result-params params)))
+ result0)
+ (unless connection (sesman-start-session 'CIDER))
+ (if (not connection)
+ ;; Display in the result instead of using `user-error'
+ (setq result0 "Please reevaluate when nREPL is connected")
+ (ob-clojure-with-temp-expanded expanded params
+ (let ((response (nrepl-sync-request:eval exp connection)))
+ (push (or (nrepl-dict-get response "root-ex")
+ (nrepl-dict-get response "ex")
+ (nrepl-dict-get
+ response (if (or (member "output" result-params)
+ (member "pp" result-params))
+ "out"
+ "value")))
+ result0)))
+ (ob-clojure-string-or-list
+ (reverse (delete "" (mapcar (lambda (r)
+ (replace-regexp-in-string "nil" "" r))
+ result0)))))))
+
+(defun ob-clojure-eval-with-slime (expanded params)
+ "Evaluate EXPANDED code block with PARAMS using slime."
+ (condition-case nil (require 'slime)
+ (user-error "slime not available"))
+ (with-temp-buffer
+ (insert expanded)
+ (slime-eval
+ `(swank:eval-and-grab-output
+ ,(buffer-substring-no-properties (point-min) (point-max)))
+ (cdr (assq :package params)))))
+
+(defun org-babel-execute:clojure (body params)
+ "Execute a block of Clojure code with Babel."
+ (unless org-babel-clojure-backend
+ (user-error "You need to customize org-babel-clojure-backend"))
+ (let* ((expanded (org-babel-expand-body:clojure body params))
+ (result-params (cdr (assq :result-params params)))
+ result)
+ (setq result
+ (cond
+ ((eq org-babel-clojure-backend 'inf-clojure)
+ (ob-clojure-eval-with-inf-clojure expanded params))
+ ((eq org-babel-clojure-backend 'cider)
+ (ob-clojure-eval-with-cider expanded params))
+ ((eq org-babel-clojure-backend 'slime)
+ (ob-clojure-eval-with-slime expanded params))))
+ (org-babel-result-cond result-params
+ result
+ (condition-case nil (org-babel-script-escape result)
+ (error result)))))
+
+(defun org-babel-execute:clojurescript (body params)
+ "Evaluate BODY with PARAMS as ClojureScript code."
+ (org-babel-execute:clojure body (cons '(:target . "cljs") params)))
+
+(provide 'ob-clojure)
+
+;;; ob-clojure.el ends here
diff --git a/elpa/org-9.5.2/ob-clojure.elc b/elpa/org-9.5.2/ob-clojure.elc
new file mode 100644
index 0000000..4785ef5
--- /dev/null
+++ b/elpa/org-9.5.2/ob-clojure.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-comint.el b/elpa/org-9.5.2/ob-comint.el
new file mode 100644
index 0000000..20ae76f
--- /dev/null
+++ b/elpa/org-9.5.2/ob-comint.el
@@ -0,0 +1,312 @@
+;;; ob-comint.el --- Babel Functions for Interaction with Comint Buffers -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research, comint
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; These functions build on comint to ease the sending and receiving
+;; of commands and results from comint buffers.
+
+;; Note that the buffers in this file are analogous to sessions in
+;; org-babel at large.
+
+;;; Code:
+(require 'ob-core)
+(require 'org-compat)
+(require 'comint)
+
+(defun org-babel-comint-buffer-livep (buffer)
+ "Check if BUFFER is a comint buffer with a live process."
+ (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)
+ "Check BUFFER and execute BODY.
+BUFFER is checked with `org-babel-comint-buffer-livep'. BODY is
+executed inside the protection of `save-excursion' and
+`save-match-data'."
+ (declare (indent 1) (debug t))
+ `(progn
+ (unless (org-babel-comint-buffer-livep ,buffer)
+ (error "Buffer %s does not exist or has no process" ,buffer))
+ (save-match-data
+ (with-current-buffer ,buffer
+ (save-excursion
+ (let ((comint-input-filter (lambda (_input) nil)))
+ ,@body))))))
+
+(defmacro org-babel-comint-with-output (meta &rest body)
+ "Evaluate BODY in BUFFER and return process output.
+Will wait until EOE-INDICATOR appears in the output, then return
+all process output. If REMOVE-ECHO and FULL-BODY are present and
+non-nil, then strip echo'd body from the returned output. META
+should be a list containing the following where the last two
+elements are optional.
+
+ (BUFFER EOE-INDICATOR REMOVE-ECHO FULL-BODY)
+
+This macro ensures that the filter is removed in case of an error
+or user `keyboard-quit' during execution of body."
+ (declare (indent 1) (debug (sexp body)))
+ (let ((buffer (nth 0 meta))
+ (eoe-indicator (nth 1 meta))
+ (remove-echo (nth 2 meta))
+ (full-body (nth 3 meta)))
+ `(org-babel-comint-in-buffer ,buffer
+ (let* ((string-buffer "")
+ (comint-output-filter-functions
+ (cons (lambda (text) (setq string-buffer (concat string-buffer text)))
+ comint-output-filter-functions))
+ dangling-text)
+ ;; got located, and save dangling text
+ (goto-char (process-mark (get-buffer-process (current-buffer))))
+ (let ((start (point))
+ (end (point-max)))
+ (setq dangling-text (buffer-substring start end))
+ (delete-region start end))
+ ;; pass FULL-BODY to process
+ ,@body
+ ;; wait for end-of-evaluation indicator
+ (while (progn
+ (goto-char comint-last-input-end)
+ (not (save-excursion
+ (and (re-search-forward
+ (regexp-quote ,eoe-indicator) nil t)
+ (re-search-forward
+ comint-prompt-regexp nil t)))))
+ (accept-process-output (get-buffer-process (current-buffer))))
+ ;; replace cut dangling text
+ (goto-char (process-mark (get-buffer-process (current-buffer))))
+ (insert dangling-text)
+
+ ;; remove echo'd FULL-BODY from input
+ (when (and ,remove-echo ,full-body
+ (string-match
+ (replace-regexp-in-string
+ "\n" "[\r\n]+" (regexp-quote (or ,full-body "")))
+ string-buffer))
+ (setq string-buffer (substring string-buffer (match-end 0))))
+ (split-string string-buffer comint-prompt-regexp)))))
+
+(defun org-babel-comint-input-command (buffer cmd)
+ "Pass CMD to BUFFER.
+The input will not be echoed."
+ (org-babel-comint-in-buffer buffer
+ (goto-char (process-mark (get-buffer-process buffer)))
+ (insert cmd)
+ (comint-send-input)
+ (org-babel-comint-wait-for-output buffer)))
+
+(defun org-babel-comint-wait-for-output (buffer)
+ "Wait until output arrives from BUFFER.
+Note: this is only safe when waiting for the result of a single
+statement (not large blocks of code)."
+ (org-babel-comint-in-buffer buffer
+ (while (progn
+ (goto-char comint-last-input-end)
+ (not (and (re-search-forward comint-prompt-regexp nil t)
+ (goto-char (match-beginning 0))
+ (string= (face-name (face-at-point))
+ "comint-highlight-prompt"))))
+ (accept-process-output (get-buffer-process buffer)))))
+
+(defun org-babel-comint-eval-invisibly-and-wait-for-file
+ (buffer file string &optional period)
+ "Evaluate STRING in BUFFER invisibly.
+Don't return until FILE exists. Code in STRING must ensure that
+FILE exists at end of evaluation."
+ (unless (org-babel-comint-buffer-livep buffer)
+ (error "Buffer %s does not exist or has no process" buffer))
+ (when (file-exists-p file) (delete-file file))
+ (process-send-string
+ (get-buffer-process buffer)
+ (if (= (aref string (1- (length string))) ?\n) string (concat string "\n")))
+ (while (not (file-exists-p file)) (sit-for (or period 0.25))))
+
+
+;;; Async evaluation
+
+(defvar-local org-babel-comint-async-indicator nil
+ "Regular expression that `org-babel-comint-async-filter' scans for.
+It should have 2 parenthesized expressions,
+e.g. \"org_babel_async_\\(start\\|end\\|file\\)_\\(.*\\)\". The
+first parenthesized expression determines whether the token is
+delimiting a result block, or whether the result is in a file.
+If delimiting a block, the second expression gives a UUID for the
+location to insert the result. Otherwise, the result is in a tmp
+file, and the second expression gives the file name.")
+
+(defvar-local org-babel-comint-async-buffers nil
+ "List of Org mode buffers to check for Babel async output results.")
+
+(defvar-local org-babel-comint-async-file-callback nil
+ "Callback to clean and insert Babel async results from a temp file.
+The callback function takes two arguments: the alist of params of the Babel
+source block, and the name of the temp file.")
+
+(defvar-local org-babel-comint-async-chunk-callback nil
+ "Callback function to clean Babel async output results before insertion.
+Its single argument is a string consisting of output from the
+comint process. It should return a string that will be be passed
+to `org-babel-insert-result'.")
+
+(defvar-local org-babel-comint-async-dangling nil
+ "Dangling piece of the last process output, in case
+`org-babel-comint-async-indicator' is spread across multiple
+comint outputs due to buffering.")
+
+(defun org-babel-comint-use-async (params)
+ "Determine whether to use session async evaluation.
+PARAMS are the header arguments as passed to
+`org-babel-execute:lang'."
+ (let ((async (assq :async params))
+ (session (assq :session params)))
+ (and async
+ (not org-babel-exp-reference-buffer)
+ (not (equal (cdr async) "no"))
+ (not (equal (cdr session) "none")))))
+
+(defun org-babel-comint-async-filter (string)
+ "Captures Babel async output from comint buffer back to Org mode buffers.
+This function is added as a hook to `comint-output-filter-functions'.
+STRING contains the output originally inserted into the comint buffer."
+ ;; Remove outdated Org mode buffers
+ (setq org-babel-comint-async-buffers
+ (cl-loop for buf in org-babel-comint-async-buffers
+ if (buffer-live-p buf)
+ collect buf))
+ (let* ((indicator org-babel-comint-async-indicator)
+ (org-buffers org-babel-comint-async-buffers)
+ (file-callback org-babel-comint-async-file-callback)
+ (combined-string (concat org-babel-comint-async-dangling string))
+ (new-dangling combined-string)
+ ;; list of UUID's matched by `org-babel-comint-async-indicator'
+ uuid-list)
+ (with-temp-buffer
+ (insert combined-string)
+ (goto-char (point-min))
+ (while (re-search-forward indicator nil t)
+ ;; update dangling
+ (setq new-dangling (buffer-substring (point) (point-max)))
+ (cond ((equal (match-string 1) "end")
+ ;; save UUID for insertion later
+ (push (match-string 2) uuid-list))
+ ((equal (match-string 1) "file")
+ ;; insert results from tmp-file
+ (let ((tmp-file (match-string 2)))
+ (cl-loop for buf in org-buffers
+ until
+ (with-current-buffer buf
+ (save-excursion
+ (goto-char (point-min))
+ (when (search-forward tmp-file nil t)
+ (org-babel-previous-src-block)
+ (let* ((info (org-babel-get-src-block-info))
+ (params (nth 2 info))
+ (result-params
+ (cdr (assq :result-params params))))
+ (org-babel-insert-result
+ (funcall file-callback
+ (nth
+ 2 (org-babel-get-src-block-info))
+ tmp-file)
+ result-params info))
+ t))))))))
+ ;; Truncate dangling to only the most recent output
+ (when (> (length new-dangling) (length string))
+ (setq new-dangling string)))
+ (setq-local org-babel-comint-async-dangling new-dangling)
+ (when uuid-list
+ ;; Search for results in the comint buffer
+ (save-excursion
+ (goto-char (point-max))
+ (while uuid-list
+ (re-search-backward indicator)
+ (when (equal (match-string 1) "end")
+ (let* ((uuid (match-string-no-properties 2))
+ (res-str-raw
+ (buffer-substring
+ ;; move point to beginning of indicator
+ (- (match-beginning 0) 1)
+ ;; find the matching start indicator
+ (cl-loop
+ do (re-search-backward indicator)
+ until (and (equal (match-string 1) "start")
+ (equal (match-string 2) uuid))
+ finally return (+ 1 (match-end 0)))))
+ ;; Apply callback to clean up the result
+ (res-str (funcall org-babel-comint-async-chunk-callback
+ res-str-raw)))
+ ;; Search for uuid in associated org-buffers to insert results
+ (cl-loop for buf in org-buffers
+ until (with-current-buffer buf
+ (save-excursion
+ (goto-char (point-min))
+ (when (search-forward uuid nil t)
+ (org-babel-previous-src-block)
+ (let* ((info (org-babel-get-src-block-info))
+ (params (nth 2 info))
+ (result-params
+ (cdr (assq :result-params params))))
+ (org-babel-insert-result
+ res-str result-params info))
+ t))))
+ ;; Remove uuid from the list to search for
+ (setq uuid-list (delete uuid uuid-list)))))))))
+
+(defun org-babel-comint-async-register
+ (session-buffer org-buffer indicator-regexp
+ chunk-callback file-callback)
+ "Set local org-babel-comint-async variables in SESSION-BUFFER.
+ORG-BUFFER is added to `org-babel-comint-async-buffers' if not
+present. `org-babel-comint-async-indicator',
+`org-babel-comint-async-chunk-callback', and
+`org-babel-comint-async-file-callback' are set to
+INDICATOR-REGEXP, CHUNK-CALLBACK, and FILE-CALLBACK
+respectively."
+ (org-babel-comint-in-buffer session-buffer
+ (setq org-babel-comint-async-indicator indicator-regexp
+ org-babel-comint-async-chunk-callback chunk-callback
+ org-babel-comint-async-file-callback file-callback)
+ (unless (memq org-buffer org-babel-comint-async-buffers)
+ (setq org-babel-comint-async-buffers
+ (cons org-buffer org-babel-comint-async-buffers)))
+ (add-hook 'comint-output-filter-functions
+ 'org-babel-comint-async-filter nil t)))
+
+(defmacro org-babel-comint-async-delete-dangling-and-eval
+ (session-buffer &rest body)
+ "Remove dangling text in SESSION-BUFFER and evaluate BODY.
+This is analogous to `org-babel-comint-with-output', but meant
+for asynchronous output, and much shorter because inserting the
+result is delegated to `org-babel-comint-async-filter'."
+ (declare (indent 1) (debug t))
+ `(org-babel-comint-in-buffer ,session-buffer
+ (goto-char (process-mark (get-buffer-process (current-buffer))))
+ (delete-region (point) (point-max))
+ ,@body))
+
+(provide 'ob-comint)
+
+
+
+;;; ob-comint.el ends here
diff --git a/elpa/org-9.5.2/ob-comint.elc b/elpa/org-9.5.2/ob-comint.elc
new file mode 100644
index 0000000..78f03cf
--- /dev/null
+++ b/elpa/org-9.5.2/ob-comint.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-core.el b/elpa/org-9.5.2/ob-core.el
new file mode 100644
index 0000000..06a2a88
--- /dev/null
+++ b/elpa/org-9.5.2/ob-core.el
@@ -0,0 +1,3269 @@
+;;; ob-core.el --- Working with Code Blocks -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Authors: Eric Schulte
+;; Dan Davison
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Code:
+(require 'cl-lib)
+(require 'ob-eval)
+(require 'org-macs)
+(require 'org-compat)
+
+(defconst org-babel-exeext
+ (if (memq system-type '(windows-nt cygwin))
+ ".exe"
+ nil))
+
+(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)
+(defvar org-babel-tangle-uncomment-comments)
+
+(declare-function org-at-item-p "org-list" ())
+(declare-function org-at-table-p "org" (&optional table-type))
+(declare-function org-babel-lob-execute-maybe "ob-lob" ())
+(declare-function org-babel-ref-goto-headline-id "ob-ref" (id))
+(declare-function org-babel-ref-headline-body "ob-ref" ())
+(declare-function org-babel-ref-parse "ob-ref" (assignment))
+(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-current-level "org" ())
+(declare-function org-cycle "org" (&optional arg))
+(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" ())
+(declare-function org-element-context "org-element" (&optional element))
+(declare-function org-element-normalize-string "org-element" (s))
+(declare-function org-element-property "org-element" (property element))
+(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-forward-heading-same-level "org" (arg &optional invisible-ok))
+(declare-function org-in-commented-heading-p "org" (&optional no-inheritance))
+(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))
+(declare-function org-list-struct "org-list" ())
+(declare-function org-list-to-generic "org-list" (LIST PARAMS))
+(declare-function org-list-to-lisp "org-list" (&optional delete))
+(declare-function org-macro-escape-arguments "org-macro" (&rest args))
+(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-open-at-point "org" (&optional in-emacs reference-buffer))
+(declare-function org-previous-block "org" (arg &optional block-regexp))
+(declare-function org-show-context "org" (&optional key))
+(declare-function org-src-coderef-format "org-src" (&optional element))
+(declare-function org-src-coderef-regexp "org-src" (fmt &optional label))
+(declare-function org-src-get-lang-mode "org-src" (lang))
+(declare-function org-table-align "org-table" ())
+(declare-function org-table-convert-region "org-table" (beg0 end0 &optional separator))
+(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-unescape-code-in-string "org-src" (s))
+(declare-function orgtbl-to-generic "org-table" (table params))
+(declare-function orgtbl-to-orgtbl "org-table" (table params))
+(declare-function tramp-compat-make-temp-file "tramp-compat" (filename &optional dir-flag))
+
+(defgroup org-babel nil
+ "Code block evaluation and management in `org-mode' documents."
+ :tag "Babel"
+ :group 'org)
+
+(defcustom org-confirm-babel-evaluate t
+ "Confirm before evaluation.
+\\<org-mode-map>\
+Require confirmation before interactively evaluating code
+blocks in Org buffers. The default value of this variable is t,
+meaning confirmation is required for any code block evaluation.
+This variable can be set to nil to inhibit any future
+confirmation requests. This variable can also be set to a
+function which takes two arguments the language of the code block
+and the body of the code block. Such a function should then
+return a non-nil value if the user should be prompted for
+execution or nil if no prompt is required.
+
+Warning: Disabling confirmation may result in accidental
+evaluation of potentially harmful code. It may be advisable
+remove code block execution from `\\[org-ctrl-c-ctrl-c]' \
+as further protection
+against accidental code block evaluation. The
+`org-babel-no-eval-on-ctrl-c-ctrl-c' variable can be used to
+remove code block execution from the `\\[org-ctrl-c-ctrl-c]' keybinding."
+ :group 'org-babel
+ :version "24.1"
+ :type '(choice boolean function))
+;; don't allow this variable to be changed through file settings
+(put 'org-confirm-babel-evaluate 'safe-local-variable (lambda (x) (eq x t)))
+
+(defcustom org-babel-no-eval-on-ctrl-c-ctrl-c nil
+ "\\<org-mode-map>\
+Remove code block evaluation from the `\\[org-ctrl-c-ctrl-c]' key binding."
+ :group 'org-babel
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-babel-results-keyword "RESULTS"
+ "Keyword used to name results generated by code blocks.
+It should be \"RESULTS\". However any capitalization may be
+used."
+ :group 'org-babel
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string
+ :safe (lambda (v)
+ (and (stringp v)
+ (eq (compare-strings "RESULTS" nil nil v nil nil t)
+ t))))
+
+(defcustom org-babel-noweb-wrap-start "<<"
+ "String used to begin a noweb reference in a code block.
+See also `org-babel-noweb-wrap-end'."
+ :group 'org-babel
+ :type 'string)
+
+(defcustom org-babel-noweb-wrap-end ">>"
+ "String used to end a noweb reference in a code block.
+See also `org-babel-noweb-wrap-start'."
+ :group 'org-babel
+ :type 'string)
+
+(defcustom org-babel-inline-result-wrap "=%s="
+ "Format string used to wrap inline results.
+This string must include a \"%s\" which will be replaced by the results."
+ :group 'org-babel
+ :type 'string)
+(put 'org-babel-inline-result-wrap
+ 'safe-local-variable
+ (lambda (value)
+ (and (stringp value)
+ (string-match-p "%s" value))))
+
+(defcustom org-babel-hash-show-time nil
+ "Non-nil means show the time the code block was evaluated in the result hash."
+ :group 'org-babel
+ :type 'boolean
+ :package-version '(Org . "9.0")
+ :safe #'booleanp)
+
+(defcustom org-babel-uppercase-example-markers nil
+ "When non-nil, begin/end example markers will be inserted in upper case."
+ :group 'org-babel
+ :type 'boolean
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :safe #'booleanp)
+
+(defun org-babel-noweb-wrap (&optional regexp)
+ "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]*"
+ "Regular expression used to match a source name line.")
+
+(defvar org-babel-multi-line-header-regexp
+ "^[ \t]*#\\+headers?:[ \t]*\\([^\n]*\\)$"
+ "Regular expression used to match multi-line header arguments.")
+
+(defvar org-babel-src-block-regexp
+ (concat
+ ;; (1) indentation (2) lang
+ "^\\([ \t]*\\)#\\+begin_src[ \t]+\\([^ \f\t\n\r\v]+\\)[ \t]*"
+ ;; (3) switches
+ "\\([^\":\n]*\"[^\"\n*]*\"[^\":\n]*\\|[^\":\n]*\\)"
+ ;; (4) header arguments
+ "\\([^\n]*\\)\n"
+ ;; (5) body
+ "\\([^\000]*?\n\\)??[ \t]*#\\+end_src")
+ "Regexp used to identify code blocks.")
+
+(defun org-babel--get-vars (params)
+ "Return the babel variable assignments in PARAMS.
+
+PARAMS is a quasi-alist of header args, which may contain
+multiple entries for the key `:var'. This function returns a
+list of the cdr of all the `:var' entries."
+ (mapcar #'cdr
+ (cl-remove-if-not (lambda (x) (eq (car x) :var)) params)))
+
+(defvar org-babel-exp-reference-buffer nil
+ "Buffer containing original contents of the exported buffer.
+This is used by Babel to resolve references in source blocks.
+Its value is dynamically bound during export.")
+
+(defun org-babel-check-confirm-evaluate (info)
+ "Check whether INFO allows code block evaluation.
+
+Returns nil if evaluation is disallowed, t if it is
+unconditionally allowed, and the symbol `query' if the user
+should be asked whether to allow evaluation."
+ (let* ((headers (nth 2 info))
+ (eval (or (cdr (assq :eval headers))
+ (when (assq :noeval headers) "no")))
+ (eval-no (member eval '("no" "never")))
+ (export org-babel-exp-reference-buffer)
+ (eval-no-export (and export (member eval '("no-export" "never-export"))))
+ (noeval (or eval-no eval-no-export))
+ (query (or (equal eval "query")
+ (and export (equal eval "query-export"))
+ (if (functionp org-confirm-babel-evaluate)
+ (funcall org-confirm-babel-evaluate
+ ;; Language, code block body.
+ (nth 0 info)
+ (org-babel--expand-body info))
+ org-confirm-babel-evaluate))))
+ (cond
+ (noeval nil)
+ (query 'query)
+ (t t))))
+
+(defun org-babel-check-evaluate (info)
+ "Check if code block INFO should be evaluated.
+Do not query the user, but do display an informative message if
+evaluation is blocked. Returns non-nil if evaluation is not blocked."
+ (let ((confirmed (org-babel-check-confirm-evaluate info)))
+ (unless confirmed
+ (message "Evaluation of this %s code block%sis disabled."
+ (nth 0 info)
+ (let ((name (nth 4 info)))
+ (if name (format " (%s) " name) " "))))
+ confirmed))
+
+;; Dynamically scoped for asynchronous export.
+(defvar org-babel-confirm-evaluate-answer-no)
+
+(defun org-babel-confirm-evaluate (info)
+ "Confirm evaluation of the code block INFO.
+
+This query can also be suppressed by setting the value of
+`org-confirm-babel-evaluate' to nil, in which case all future
+interactive code block evaluations will proceed without any
+confirmation from the user.
+
+Note disabling confirmation may result in accidental evaluation
+of potentially harmful code.
+
+The variable `org-babel-confirm-evaluate-answer-no' is used by
+the async export process, which requires a non-interactive
+environment, to override this check."
+ (let* ((evalp (org-babel-check-confirm-evaluate info))
+ (lang (nth 0 info))
+ (name (nth 4 info))
+ (name-string (if name (format " (%s) " name) " ")))
+ (pcase evalp
+ (`nil nil)
+ (`t t)
+ (`query (or
+ (and (not (bound-and-true-p
+ org-babel-confirm-evaluate-answer-no))
+ (yes-or-no-p
+ (format "Evaluate this %s code block%son your system? "
+ lang name-string)))
+ (progn
+ (message "Evaluation of this %s code block%sis aborted."
+ lang name-string)
+ nil)))
+ (x (error "Unexpected value `%s' from `org-babel-check-confirm-evaluate'" x)))))
+
+;;;###autoload
+(defun org-babel-execute-safely-maybe ()
+ (unless org-babel-no-eval-on-ctrl-c-ctrl-c
+ (org-babel-execute-maybe)))
+
+;;;###autoload
+(defun org-babel-execute-maybe ()
+ (interactive)
+ (or (org-babel-execute-src-block-maybe)
+ (org-babel-lob-execute-maybe)))
+
+(defmacro org-babel-when-in-src-block (&rest body)
+ "Execute BODY if point is in a source block and return t.
+
+Otherwise do nothing and return nil."
+ `(if (memq (org-element-type (org-element-context))
+ '(inline-src-block src-block))
+ (progn
+ ,@body
+ t)
+ nil))
+
+(defun org-babel-execute-src-block-maybe ()
+ "Conditionally execute a source block.
+Detect if this is context for a Babel src-block and if so
+then run `org-babel-execute-src-block'."
+ (interactive)
+ (org-babel-when-in-src-block
+ (org-babel-eval-wipe-error-buffer)
+ (org-babel-execute-src-block current-prefix-arg)))
+
+;;;###autoload
+(defun org-babel-view-src-block-info ()
+ "Display information on the current source block.
+This includes header arguments, language and name, and is largely
+a window into the `org-babel-get-src-block-info' function."
+ (interactive)
+ (let ((info (org-babel-get-src-block-info 'light))
+ (full (lambda (it) (> (length it) 0)))
+ (printf (lambda (fmt &rest args) (princ (apply #'format fmt args)))))
+ (when info
+ (with-help-window (help-buffer)
+ (let ((name (nth 4 info))
+ (lang (nth 0 info))
+ (switches (nth 3 info))
+ (header-args (nth 2 info)))
+ (when name (funcall printf "Name: %s\n" name))
+ (when lang (funcall printf "Lang: %s\n" lang))
+ (funcall printf "Properties:\n")
+ (funcall printf "\t:header-args \t%s\n" (org-entry-get (point) "header-args" t))
+ (funcall printf "\t:header-args:%s \t%s\n" lang (org-entry-get (point) (concat "header-args:" lang) t))
+
+ (when (funcall full switches) (funcall printf "Switches: %s\n" switches))
+ (funcall printf "Header Arguments:\n")
+ (dolist (pair (sort header-args
+ (lambda (a b) (string< (symbol-name (car a))
+ (symbol-name (car b))))))
+ (when (funcall full (format "%s" (cdr pair)))
+ (funcall printf "\t%S%s\t%s\n"
+ (car pair)
+ (if (> (length (format "%S" (car pair))) 7) "" "\t")
+ (cdr pair)))))))))
+
+;;;###autoload
+(defun org-babel-expand-src-block-maybe ()
+ "Conditionally expand a source block.
+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
+ (org-babel-expand-src-block current-prefix-arg)))
+
+;;;###autoload
+(defun org-babel-load-in-session-maybe ()
+ "Conditionally load a source block in a session.
+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
+ (org-babel-load-in-session current-prefix-arg)))
+
+(add-hook 'org-metaup-hook 'org-babel-load-in-session-maybe)
+
+;;;###autoload
+(defun org-babel-pop-to-session-maybe ()
+ "Conditionally pop to a session.
+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
+ (org-babel-switch-to-session current-prefix-arg)))
+
+(add-hook 'org-metadown-hook 'org-babel-pop-to-session-maybe)
+
+(defconst org-babel-common-header-args-w-values
+ '((cache . ((no yes)))
+ (cmdline . :any)
+ (colnames . ((nil no yes)))
+ (comments . ((no link yes org both noweb)))
+ (dir . :any)
+ (eval . ((yes no no-export strip-export never-export eval never
+ query)))
+ (exports . ((code results both none)))
+ (epilogue . :any)
+ (file . :any)
+ (file-desc . :any)
+ (file-ext . :any)
+ (file-mode . ((#o755 #o555 #o444 :any)))
+ (hlines . ((no yes)))
+ (mkdirp . ((yes no)))
+ (no-expand)
+ (noeval)
+ (noweb . ((yes no tangle no-export strip-export)))
+ (noweb-ref . :any)
+ (noweb-sep . :any)
+ (output-dir . :any)
+ (padline . ((yes no)))
+ (post . :any)
+ (prologue . :any)
+ (results . ((file list vector table scalar verbatim)
+ (raw html latex org code pp drawer link graphics)
+ (replace silent none append prepend)
+ (output value)))
+ (rownames . ((no yes)))
+ (sep . :any)
+ (session . :any)
+ (shebang . :any)
+ (tangle . ((tangle yes no :any)))
+ (tangle-mode . ((#o755 #o555 #o444 :any)))
+ (var . :any)
+ (wrap . :any)))
+
+(defconst org-babel-header-arg-names
+ (mapcar #'car org-babel-common-header-args-w-values)
+ "Common header arguments used by org-babel.
+Note that individual languages may define their own language
+specific header arguments as well.")
+
+(defconst org-babel-safe-header-args
+ '(:cache :colnames :comments :exports :epilogue :hlines :noeval
+ :noweb :noweb-ref :noweb-sep :padline :prologue :rownames
+ :sep :session :tangle :wrap
+ (:eval . ("never" "query"))
+ (:results . (lambda (str) (not (string-match "file" str)))))
+ "A list of safe header arguments for babel source blocks.
+
+The list can have entries of the following forms:
+- :ARG -> :ARG is always a safe header arg
+- (:ARG . (VAL1 VAL2 ...)) -> :ARG is safe as a header arg if it is
+ `equal' to one of the VALs.
+- (:ARG . FN) -> :ARG is safe as a header arg if the function FN
+ returns non-nil. FN is passed one
+ argument, the value of the header arg
+ (as a string).")
+
+(defmacro org-babel-header-args-safe-fn (safe-list)
+ "Return a function that determines whether a list of header args are safe.
+
+Intended usage is:
+\(put \\='org-babel-default-header-args \\='safe-local-variable
+ (org-babel-header-args-safe-p org-babel-safe-header-args)
+
+This allows org-babel languages to extend the list of safe values for
+their `org-babel-default-header-args:foo' variable.
+
+For the format of SAFE-LIST, see `org-babel-safe-header-args'."
+ `(lambda (value)
+ (and (listp value)
+ (cl-every
+ (lambda (pair)
+ (and (consp pair)
+ (org-babel-one-header-arg-safe-p pair ,safe-list)))
+ value))))
+
+(defvar org-babel-default-header-args
+ '((:session . "none") (:results . "replace") (:exports . "code")
+ (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no"))
+ "Default arguments to use when evaluating a source block.
+
+This is a list in which each element is an alist. Each key
+corresponds to a header argument, and each value to that header's
+value. The value can either be a string or a closure that
+evaluates to a string. The closure is evaluated when the source
+block is being evaluated (e.g. during execution or export), with
+point at the source block. It is not possible to use an
+arbitrary function symbol (e.g. 'some-func), since org uses
+lexical binding. To achieve the same functionality, call the
+function within a closure (e.g. (lambda () (some-func))).
+
+To understand how closures can be used as default header
+arguments, imagine you'd like to set the file name output of a
+latex source block to a sha1 of its contents. We could achieve
+this with:
+
+(defun org-src-sha ()
+ (let ((elem (org-element-at-point)))
+ (concat (sha1 (org-element-property :value elem)) \".svg\")))
+
+(setq org-babel-default-header-args:latex
+ `((:results . \"file link replace\")
+ (:file . (lambda () (org-src-sha)))))
+
+Because the closure is evaluated with point at the source block,
+the call to `org-element-at-point' above will always retrieve
+information about the current source block.")
+
+(put 'org-babel-default-header-args 'safe-local-variable
+ (org-babel-header-args-safe-fn org-babel-safe-header-args))
+
+(defvar org-babel-default-inline-header-args
+ '((:session . "none") (:results . "replace")
+ (:exports . "results") (:hlines . "yes"))
+ "Default arguments to use when evaluating an inline source block.")
+(put 'org-babel-default-inline-header-args 'safe-local-variable
+ (org-babel-header-args-safe-fn org-babel-safe-header-args))
+
+(defconst org-babel-name-regexp
+ (format "^[ \t]*#\\+%s:[ \t]*"
+ ;; FIXME: TBLNAME is for backward compatibility.
+ (regexp-opt '("NAME" "TBLNAME")))
+ "Regexp matching a NAME keyword.")
+
+(defconst org-babel-result-regexp
+ (rx (seq bol
+ (zero-or-more (any "\t "))
+ "#+results"
+ (opt "["
+ ;; Time stamp part.
+ (opt "("
+ (= 4 digit) (= 2 "-" (= 2 digit))
+ " "
+ (= 2 digit) (= 2 ":" (= 2 digit))
+ ") ")
+ ;; SHA1 hash.
+ (group (one-or-more hex-digit))
+ "]")
+ ":"
+ (zero-or-more (any "\t "))))
+ "Regular expression used to match result lines.
+If the results are associated with a hash key then the hash will
+be saved in match group 1.")
+
+(defconst org-babel-result-w-name-regexp
+ (concat org-babel-result-regexp "\\(?9:[^ \t\n\r\v\f]+\\)")
+ "Regexp matching a RESULTS keyword with a name.
+Name is saved in match group 9.")
+
+(defvar org-babel-min-lines-for-block-output 10
+ "The minimum number of lines for block output.
+If number of lines of output is equal to or exceeds this
+value, the output is placed in a #+begin_example...#+end_example
+block. Otherwise the output is marked as literal by inserting
+colons at the starts of the lines. This variable only takes
+effect if the :results output option is in effect.")
+
+(defvar org-babel-noweb-error-all-langs nil
+ "Raise errors when noweb references don't resolve.
+Also see `org-babel-noweb-error-langs' to control noweb errors on
+a language by language bases.")
+
+(defvar org-babel-noweb-error-langs nil
+ "Languages for which Babel will raise literate programming errors.
+List of languages for which errors should be raised when the
+source code block satisfying a noweb reference in this language
+can not be resolved. Also see `org-babel-noweb-error-all-langs'
+to raise errors for all languages.")
+
+(defvar org-babel-hash-show 4
+ "Number of initial characters to show of a hidden results hash.")
+
+(defvar org-babel-after-execute-hook nil
+ "Hook for functions to be called after `org-babel-execute-src-block'.")
+
+(defun org-babel-named-src-block-regexp-for-name (&optional name)
+ "Generate 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'."
+ (concat org-babel-src-name-regexp
+ (concat (if name (regexp-quote name) "\\(?9:.*?\\)") "[ \t]*" )
+ "\\(?:\n[ \t]*#\\+\\S-+:.*\\)*?"
+ "\n"
+ (substring org-babel-src-block-regexp 1)))
+
+(defun org-babel-named-data-regexp-for-name (name)
+ "Generate a regexp used to match data named NAME."
+ (concat org-babel-name-regexp (regexp-quote name) "[ \t]*$"))
+
+(defun org-babel--normalize-body (datum)
+ "Normalize body for element or object DATUM.
+DATUM is a source block element or an inline source block object.
+Remove final newline character and spurious indentation."
+ (let* ((value (org-element-property :value datum))
+ (body (if (string-suffix-p "\n" value)
+ (substring value 0 -1)
+ value)))
+ (cond ((eq (org-element-type datum) 'inline-src-block)
+ ;; Newline characters and indentation in an inline
+ ;; src-block are not meaningful, since they could come from
+ ;; some paragraph filling. Treat them as a white space.
+ (replace-regexp-in-string "\n[ \t]*" " " body))
+ ((or org-src-preserve-indentation
+ (org-element-property :preserve-indent datum))
+ body)
+ (t (org-remove-indentation body)))))
+
+;;; functions
+(defvar org-babel-current-src-block-location nil
+ "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
+the outer-most code block.")
+
+(defun org-babel-eval-headers (headers)
+ "Compute header list set with HEADERS.
+
+Evaluate all header arguments set to functions prior to returning
+the list of header arguments."
+ (let ((lst nil))
+ (dolist (elem headers)
+ (if (and (cdr elem) (functionp (cdr elem)))
+ (push `(,(car elem) . ,(funcall (cdr elem))) lst)
+ (push elem lst)))
+ (reverse lst)))
+
+(defun org-babel-get-src-block-info (&optional light datum)
+ "Extract information from a source block or inline source block.
+
+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
+object instead.
+
+Return nil if point is not on a source block. Otherwise, return
+a list with the following pattern:
+
+ (language body arguments switches name start coderef)"
+ (let* ((datum (or datum (org-element-context)))
+ (type (org-element-type datum))
+ (inline (eq type 'inline-src-block)))
+ (when (memq type '(inline-src-block src-block))
+ (let* ((lang (org-element-property :language datum))
+ (lang-headers (intern
+ (concat "org-babel-default-header-args:" lang)))
+ (name (org-element-property :name datum))
+ (info
+ (list
+ lang
+ (org-babel--normalize-body datum)
+ (apply #'org-babel-merge-params
+ (if inline org-babel-default-inline-header-args
+ org-babel-default-header-args)
+ (and (boundp lang-headers) (eval lang-headers t))
+ (append
+ ;; If DATUM is provided, make sure we get node
+ ;; properties applicable to its location within
+ ;; the document.
+ (org-with-point-at (org-element-property :begin datum)
+ (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) "")
+ name
+ (org-element-property (if inline :begin :post-affiliated)
+ datum)
+ (and (not inline) (org-src-coderef-format datum)))))
+ (unless light
+ (setf (nth 2 info) (org-babel-process-params (nth 2 info))))
+ (setf (nth 2 info) (org-babel-generate-file-param name (nth 2 info)))
+ info))))
+
+(defun org-babel--expand-body (info)
+ "Expand noweb references in body and remove any coderefs."
+ (let ((coderef (nth 6 info))
+ (expand
+ (if (org-babel-noweb-p (nth 2 info) :eval)
+ (org-babel-expand-noweb-references info)
+ (nth 1 info))))
+ (if (not coderef) expand
+ (replace-regexp-in-string
+ (org-src-coderef-regexp coderef) "" expand nil nil 1))))
+
+(defun org-babel--file-desc (params result)
+ "Retrieve file description."
+ (pcase (assq :file-desc params)
+ (`nil nil)
+ (`(:file-desc) result)
+ (`(:file-desc . ,(and (pred stringp) val)) val)))
+
+(defvar *this*) ; Dynamically bound in `org-babel-execute-src-block'
+ ; and `org-babel-read'
+
+;;;###autoload
+(defun org-babel-execute-src-block (&optional arg info params)
+ "Execute the current source code block.
+Insert the results of execution into the buffer. Source code
+execution and the collection and formatting of results can be
+controlled through a variety of header arguments.
+
+With prefix argument ARG, force re-execution even if an existing
+result cached in the buffer would otherwise have been returned.
+
+Optionally supply a value for INFO in the form returned by
+`org-babel-get-src-block-info'.
+
+Optionally supply a value for PARAMS which will be merged with
+the header arguments specified at the front of the source code
+block."
+ (interactive)
+ (let* ((org-babel-current-src-block-location
+ (or org-babel-current-src-block-location
+ (nth 5 info)
+ (org-babel-where-is-src-block-head)))
+ (info (if info (copy-tree info) (org-babel-get-src-block-info))))
+ ;; Merge PARAMS with INFO before considering source block
+ ;; evaluation since both could disagree.
+ (cl-callf org-babel-merge-params (nth 2 info) params)
+ (when (org-babel-check-evaluate info)
+ (cl-callf org-babel-process-params (nth 2 info))
+ (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 :eval)))
+ (old-hash (and cache (org-babel-current-result-hash)))
+ (current-cache (and new-hash (equal new-hash old-hash))))
+ (cond
+ (current-cache
+ (save-excursion ;Return cached result.
+ (goto-char (org-babel-where-is-src-block-result nil info))
+ (forward-line)
+ (skip-chars-forward " \t")
+ (let ((result (org-babel-read-result)))
+ (message (replace-regexp-in-string "%" "%%" (format "%S" result)))
+ result)))
+ ((org-babel-confirm-evaluate info)
+ (let* ((lang (nth 0 info))
+ (result-params (cdr (assq :result-params params)))
+ (body (org-babel--expand-body info))
+ (dir (cdr (assq :dir params)))
+ (mkdirp (cdr (assq :mkdirp params)))
+ (default-directory
+ (cond
+ ((not dir) default-directory)
+ ((member mkdirp '("no" "nil" nil))
+ (file-name-as-directory (expand-file-name dir)))
+ (t
+ (let ((d (file-name-as-directory (expand-file-name dir))))
+ (make-directory d 'parents)
+ d))))
+ (cmd (intern (concat "org-babel-execute:" lang)))
+ result)
+ (unless (fboundp cmd)
+ (error "No org-babel-execute function for %s!" lang))
+ (message "executing %s code block%s..."
+ (capitalize lang)
+ (let ((name (nth 4 info)))
+ (if name (format " (%s)" name) "")))
+ (if (member "none" result-params)
+ (progn (funcall cmd body params)
+ (message "result silenced"))
+ (setq result
+ (let ((r (funcall cmd body params)))
+ (if (and (eq (cdr (assq :result-type params)) 'value)
+ (or (member "vector" result-params)
+ (member "table" result-params))
+ (not (listp r)))
+ (list (list r))
+ r)))
+ (let ((file (and (member "file" result-params)
+ (cdr (assq :file params)))))
+ ;; If non-empty result and :file then write to :file.
+ (when file
+ ;; 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)))))
+ ;; Set file permissions if header argument
+ ;; `:file-mode' is provided.
+ (when (assq :file-mode params)
+ (set-file-modes file (cdr (assq :file-mode params)))))
+ (setq result file))
+ ;; Possibly perform post process provided its
+ ;; appropriate. Dynamically bind "*this*" to the
+ ;; actual results of the block.
+ (let ((post (cdr (assq :post params))))
+ (when post
+ (let ((*this* (if (not file) result
+ (org-babel-result-to-file
+ file
+ (org-babel--file-desc params result)))))
+ (setq result (org-babel-ref-resolve post))
+ (when file
+ (setq result-params (remove "file" result-params))))))
+ (org-babel-insert-result
+ result result-params info new-hash lang)))
+ (run-hooks 'org-babel-after-execute-hook)
+ result)))))))
+
+(defun org-babel-expand-body:generic (body params &optional var-lines)
+ "Expand BODY with PARAMS.
+Expand a block of code with org-babel according to its header
+arguments. This generic implementation of body expansion is
+called for languages which have not defined their own specific
+org-babel-expand-body:lang function."
+ (let ((pro (cdr (assq :prologue params)))
+ (epi (cdr (assq :epilogue params))))
+ (mapconcat #'identity
+ (append (when pro (list pro))
+ var-lines
+ (list body)
+ (when epi (list epi)))
+ "\n")))
+
+;;;###autoload
+(defun org-babel-expand-src-block (&optional _arg info params)
+ "Expand the current source code block.
+Expand according to the source code block's header
+arguments and pop open the results in a preview buffer."
+ (interactive)
+ (let* ((info (or info (org-babel-get-src-block-info)))
+ (lang (nth 0 info))
+ (params (setf (nth 2 info)
+ (sort (org-babel-merge-params (nth 2 info) params)
+ (lambda (el1 el2) (string< (symbol-name (car el1))
+ (symbol-name (car el2)))))))
+ (body (setf (nth 1 info)
+ (if (org-babel-noweb-p params :eval)
+ (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)))
+ (expanded
+ (if (fboundp expand-cmd) (funcall expand-cmd body params)
+ (org-babel-expand-body:generic
+ body params (and (fboundp assignments-cmd)
+ (funcall assignments-cmd params))))))
+ (if (called-interactively-p 'any)
+ (org-edit-src-code
+ expanded (concat "*Org-Babel Preview " (buffer-name) "[ " lang " ]*"))
+ expanded)))
+
+(defun org-babel-combine-header-arg-lists (original &rest others)
+ "Combine a number of lists of header argument names and arguments."
+ (let ((results (copy-sequence original)))
+ (dolist (new-list others)
+ (dolist (arg-pair new-list)
+ (let ((header (car arg-pair)))
+ (setq results
+ (cons arg-pair (cl-remove-if
+ (lambda (pair) (equal header (car pair)))
+ results))))))
+ results))
+
+;;;###autoload
+(defun org-babel-check-src-block ()
+ "Check for misspelled header arguments in the current code block."
+ (interactive)
+ ;; TODO: report malformed code block
+ ;; TODO: report incompatible combinations of header arguments
+ ;; TODO: report uninitialized variables
+ (let ((too-close 2) ;; <- control closeness to report potential match
+ (names (mapcar #'symbol-name org-babel-header-arg-names)))
+ (dolist (header (mapcar (lambda (arg) (substring (symbol-name (car arg)) 1))
+ (and (org-babel-where-is-src-block-head)
+ (org-babel-parse-header-arguments
+ (org-no-properties
+ (match-string 4))))))
+ (dolist (name names)
+ (when (and (not (string= header name))
+ (<= (org-string-distance header name) too-close)
+ (not (member header names)))
+ (error "Supplied header \"%S\" is suspiciously close to \"%S\""
+ header name))))
+ (message "No suspicious header arguments found.")))
+
+;;;###autoload
+(defun org-babel-insert-header-arg (&optional header-arg value)
+ "Insert a header argument selecting from lists of common args and values."
+ (interactive)
+ (let* ((info (org-babel-get-src-block-info 'light))
+ (lang (car info))
+ (begin (nth 5 info))
+ (lang-headers (intern (concat "org-babel-header-args:" lang)))
+ (headers (org-babel-combine-header-arg-lists
+ org-babel-common-header-args-w-values
+ (when (boundp lang-headers) (eval lang-headers t))))
+ (header-arg (or header-arg
+ (completing-read
+ "Header Arg: "
+ (mapcar
+ (lambda (header-spec) (symbol-name (car header-spec)))
+ headers))))
+ (vals (cdr (assoc (intern header-arg) headers)))
+ (value (or value
+ (cond
+ ((eq vals :any)
+ (read-from-minibuffer "value: "))
+ ((listp vals)
+ (mapconcat
+ (lambda (group)
+ (let ((arg (completing-read
+ "Value: "
+ (cons "default"
+ (mapcar #'symbol-name group)))))
+ (if (and arg (not (string= "default" arg)))
+ (concat arg " ")
+ "")))
+ vals ""))))))
+ (save-excursion
+ (goto-char begin)
+ (goto-char (point-at-eol))
+ (unless (= (char-before (point)) ?\ ) (insert " "))
+ (insert ":" header-arg) (when value (insert " " value)))))
+
+;; Add support for completing-read insertion of header arguments after ":"
+(defun org-babel-header-arg-expand ()
+ "Call `org-babel-enter-header-arg-w-completion' in appropriate contexts."
+ (when (and (equal (char-before) ?\:) (org-babel-where-is-src-block-head))
+ (org-babel-enter-header-arg-w-completion (match-string 2))))
+
+(defun org-babel-enter-header-arg-w-completion (&optional lang)
+ "Insert header argument appropriate for LANG with completion."
+ (let* ((lang-headers-var (intern (concat "org-babel-header-args:" lang)))
+ (lang-headers (when (boundp lang-headers-var) (eval lang-headers-var t)))
+ (headers-w-values (org-babel-combine-header-arg-lists
+ org-babel-common-header-args-w-values lang-headers))
+ (headers (mapcar #'symbol-name (mapcar #'car headers-w-values)))
+ (header (org-completing-read "Header Arg: " headers))
+ (args (cdr (assoc (intern header) headers-w-values)))
+ (arg (when (and args (listp args))
+ (org-completing-read
+ (format "%s: " header)
+ (mapcar #'symbol-name (apply #'append args))))))
+ (insert (concat header " " (or arg "")))
+ (cons header arg)))
+
+(add-hook 'org-tab-first-hook 'org-babel-header-arg-expand)
+
+;;;###autoload
+(defun org-babel-load-in-session (&optional _arg info)
+ "Load the body of the current source-code block.
+Evaluate the header arguments for the source block before
+entering the session. After loading the body this pops open the
+session."
+ (interactive)
+ (let* ((info (or info (org-babel-get-src-block-info)))
+ (lang (nth 0 info))
+ (params (nth 2 info))
+ (body (if (not info)
+ (user-error "No src code block at point")
+ (setf (nth 1 info)
+ (if (org-babel-noweb-p params :eval)
+ (org-babel-expand-noweb-references info)
+ (nth 1 info)))))
+ (session (cdr (assq :session params)))
+ (dir (cdr (assq :dir params)))
+ (default-directory
+ (or (and dir (file-name-as-directory dir)) default-directory))
+ (cmd (intern (concat "org-babel-load-session:" lang))))
+ (unless (fboundp cmd)
+ (error "No org-babel-load-session function for %s!" lang))
+ (pop-to-buffer (funcall cmd session body params))
+ (end-of-line 1)))
+
+;;;###autoload
+(defun org-babel-initiate-session (&optional arg info)
+ "Initiate session for current code block.
+If called with a prefix argument then resolve any variable
+references in the header arguments and assign these variables in
+the session. Copy the body of the code block to the kill ring."
+ (interactive "P")
+ (let* ((info (or info (org-babel-get-src-block-info (not arg))))
+ (lang (nth 0 info))
+ (body (nth 1 info))
+ (params (nth 2 info))
+ (session (cdr (assq :session params)))
+ (dir (cdr (assq :dir params)))
+ (default-directory
+ (or (and dir (file-name-as-directory dir)) default-directory))
+ (init-cmd (intern (format "org-babel-%s-initiate-session" lang)))
+ (prep-cmd (intern (concat "org-babel-prep-session:" lang))))
+ (when (and (stringp session) (string= session "none"))
+ (error "This block is not using a session!"))
+ (unless (fboundp init-cmd)
+ (error "No org-babel-initiate-session function for %s!" lang))
+ (with-temp-buffer (insert (org-trim body))
+ (copy-region-as-kill (point-min) (point-max)))
+ (when arg
+ (unless (fboundp prep-cmd)
+ (error "No org-babel-prep-session function for %s!" lang))
+ (funcall prep-cmd session params))
+ (funcall init-cmd session params)))
+
+;;;###autoload
+(defun org-babel-switch-to-session (&optional arg info)
+ "Switch to the session of the current code block.
+Uses `org-babel-initiate-session' to start the session. If called
+with a prefix argument then this is passed on to
+`org-babel-initiate-session'."
+ (interactive "P")
+ (pop-to-buffer (org-babel-initiate-session arg info))
+ (end-of-line 1))
+
+(defalias 'org-babel-pop-to-session 'org-babel-switch-to-session)
+
+(defvar org-src-window-setup)
+
+;;;###autoload
+(defun org-babel-switch-to-session-with-code (&optional arg _info)
+ "Switch to code buffer and display session."
+ (interactive "P")
+ (let ((swap-windows
+ (lambda ()
+ (let ((other-window-buffer (window-buffer (next-window))))
+ (set-window-buffer (next-window) (current-buffer))
+ (set-window-buffer (selected-window) other-window-buffer))
+ (other-window 1)))
+ (info (org-babel-get-src-block-info))
+ (org-src-window-setup 'reorganize-frame))
+ (save-excursion
+ (org-babel-switch-to-session arg info))
+ (org-edit-src-code)
+ (funcall swap-windows)))
+
+;;;###autoload
+(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."
+ (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)
+ (when outside-position (goto-char outside-position)))
+ t)))
+
+(defun org-babel-do-key-sequence-in-edit-buffer (key)
+ "Read key sequence and execute the command in edit buffer.
+Enter a key sequence to be executed in the language major-mode
+edit buffer. For example, TAB will alter the contents of the
+Org code block according to the effect of TAB in the language
+major mode buffer. For languages that support interactive
+sessions, this can be used to send code from the Org buffer
+to the session for evaluation using the native major mode
+evaluation mechanisms."
+ (interactive "kEnter key-sequence to execute in edit buffer: ")
+ (org-babel-do-in-edit-buffer
+ (call-interactively
+ (key-binding (or key (read-key-sequence nil))))))
+
+(defvar org-link-bracket-re)
+
+(defun org-babel-active-location-p ()
+ (memq (org-element-type (save-match-data (org-element-context)))
+ '(babel-call inline-babel-call inline-src-block src-block)))
+
+;;;###autoload
+(defun org-babel-open-src-block-result (&optional re-run)
+ "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")
+ (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-link-bracket-re) (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)
+ "Evaluate BODY forms on each source-block in FILE.
+If FILE is nil evaluate BODY forms on source blocks in current
+buffer. During evaluation of BODY the following local variables
+are set relative to the currently matched code block.
+
+full-block ------- string holding the entirety of the code block
+beg-block -------- point at the beginning of the code block
+end-block -------- point at the end of the matched code block
+lang ------------- string holding the language of the code block
+beg-lang --------- point at the beginning of the lang
+end-lang --------- point at the end of the lang
+switches --------- string holding the switches
+beg-switches ----- point at the beginning of the switches
+end-switches ----- point at the end of the switches
+header-args ------ string holding the header-args
+beg-header-args -- point at the beginning of the header-args
+end-header-args -- point at the end of the header-args
+body ------------- string holding the body of the code block
+beg-body --------- point at the beginning of the body
+end-body --------- point at the end of the body"
+ (declare (indent 1) (debug t))
+ (let ((tempvar (make-symbol "file")))
+ `(let* ((case-fold-search t)
+ (,tempvar ,file)
+ (visited-p (or (null ,tempvar)
+ (get-file-buffer (expand-file-name ,tempvar))))
+ (point (point)) to-be-removed)
+ (save-window-excursion
+ (when ,tempvar (find-file ,tempvar))
+ (setq to-be-removed (current-buffer))
+ (goto-char (point-min))
+ (while (re-search-forward org-babel-src-block-regexp nil t)
+ (when (org-babel-active-location-p)
+ (goto-char (match-beginning 0))
+ (let ((full-block (match-string 0))
+ (beg-block (match-beginning 0))
+ (end-block (match-end 0))
+ (lang (match-string 2))
+ (beg-lang (match-beginning 2))
+ (end-lang (match-end 2))
+ (switches (match-string 3))
+ (beg-switches (match-beginning 3))
+ (end-switches (match-end 3))
+ (header-args (match-string 4))
+ (beg-header-args (match-beginning 4))
+ (end-header-args (match-end 4))
+ (body (match-string 5))
+ (beg-body (match-beginning 5))
+ (end-body (match-end 5)))
+ ;; Silence byte-compiler in case `body' doesn't use all
+ ;; those variables.
+ (ignore full-block beg-block end-block lang
+ beg-lang end-lang switches beg-switches
+ end-switches header-args beg-header-args
+ end-header-args body beg-body end-body)
+ ,@body
+ (goto-char end-block)))))
+ (unless visited-p (kill-buffer to-be-removed))
+ (goto-char point))))
+
+;;;###autoload
+(defmacro org-babel-map-inline-src-blocks (file &rest body)
+ "Evaluate BODY forms on each inline source block in FILE.
+If FILE is nil evaluate BODY forms on source blocks in current
+buffer."
+ (declare (indent 1) (debug (form body)))
+ (org-with-gensyms (datum end point tempvar to-be-removed visitedp)
+ `(let* ((case-fold-search t)
+ (,tempvar ,file)
+ (,visitedp (or (null ,tempvar)
+ (get-file-buffer (expand-file-name ,tempvar))))
+ (,point (point))
+ ,to-be-removed)
+ (save-window-excursion
+ (when ,tempvar (find-file ,tempvar))
+ (setq ,to-be-removed (current-buffer))
+ (goto-char (point-min))
+ (while (re-search-forward "src_\\S-" nil t)
+ (let ((,datum (save-match-data (org-element-context))))
+ (when (eq (org-element-type ,datum) 'inline-src-block)
+ (goto-char (match-beginning 0))
+ (let ((,end (copy-marker (org-element-property :end ,datum))))
+ ,@body
+ (goto-char ,end)
+ (set-marker ,end nil))))))
+ (unless ,visitedp (kill-buffer ,to-be-removed))
+ (goto-char ,point))))
+
+;;;###autoload
+(defmacro org-babel-map-call-lines (file &rest body)
+ "Evaluate BODY forms on each call line in FILE.
+If FILE is nil evaluate BODY forms on source blocks in current
+buffer."
+ (declare (indent 1) (debug (form body)))
+ (org-with-gensyms (datum end point tempvar to-be-removed visitedp)
+ `(let* ((case-fold-search t)
+ (,tempvar ,file)
+ (,visitedp (or (null ,tempvar)
+ (get-file-buffer (expand-file-name ,tempvar))))
+ (,point (point))
+ ,to-be-removed)
+ (save-window-excursion
+ (when ,tempvar (find-file ,tempvar))
+ (setq ,to-be-removed (current-buffer))
+ (goto-char (point-min))
+ (while (re-search-forward "call_\\S-\\|^[ \t]*#\\+CALL:" nil t)
+ (let ((,datum (save-match-data (org-element-context))))
+ (when (memq (org-element-type ,datum)
+ '(babel-call inline-babel-call))
+ (goto-char (match-beginning 0))
+ (let ((,end (copy-marker (org-element-property :end ,datum))))
+ ,@body
+ (goto-char ,end)
+ (set-marker ,end nil))))))
+ (unless ,visitedp (kill-buffer ,to-be-removed))
+ (goto-char ,point))))
+
+;;;###autoload
+(defmacro org-babel-map-executables (file &rest body)
+ "Evaluate BODY forms on each active Babel code in FILE.
+If FILE is nil evaluate BODY forms on source blocks in current
+buffer."
+ (declare (indent 1) (debug (form body)))
+ (org-with-gensyms (datum end point tempvar to-be-removed visitedp)
+ `(let* ((case-fold-search t)
+ (,tempvar ,file)
+ (,visitedp (or (null ,tempvar)
+ (get-file-buffer (expand-file-name ,tempvar))))
+ (,point (point))
+ ,to-be-removed)
+ (save-window-excursion
+ (when ,tempvar (find-file ,tempvar))
+ (setq ,to-be-removed (current-buffer))
+ (goto-char (point-min))
+ (while (re-search-forward
+ "\\(call\\|src\\)_\\|^[ \t]*#\\+\\(BEGIN_SRC\\|CALL:\\)" nil t)
+ (let ((,datum (save-match-data (org-element-context))))
+ (when (memq (org-element-type ,datum)
+ '(babel-call inline-babel-call inline-src-block
+ src-block))
+ (goto-char (match-beginning 0))
+ (let ((,end (copy-marker (org-element-property :end ,datum))))
+ ,@body
+ (goto-char ,end)
+ (set-marker ,end nil))))))
+ (unless ,visitedp (kill-buffer ,to-be-removed))
+ (goto-char ,point))))
+
+;;;###autoload
+(defun org-babel-execute-buffer (&optional arg)
+ "Execute source code blocks in a buffer.
+Call `org-babel-execute-src-block' on every source block in
+the current buffer."
+ (interactive "P")
+ (org-babel-eval-wipe-error-buffer)
+ (org-save-outline-visibility t
+ (org-babel-map-executables nil
+ (if (memq (org-element-type (org-element-context))
+ '(babel-call inline-babel-call))
+ (org-babel-lob-execute-maybe)
+ (org-babel-execute-src-block arg)))))
+
+;;;###autoload
+(defun org-babel-execute-subtree (&optional arg)
+ "Execute source code blocks in a subtree.
+Call `org-babel-execute-src-block' on every source block in
+the current subtree."
+ (interactive "P")
+ (save-restriction
+ (save-excursion
+ (org-narrow-to-subtree)
+ (org-babel-execute-buffer arg)
+ (widen))))
+
+;;;###autoload
+(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)))
+ (context (or context :eval)))
+ (setf (nth 2 info)
+ (sort (copy-sequence (nth 2 info))
+ (lambda (a b) (string< (car a) (car b)))))
+ (let* ((rm (lambda (lst)
+ (dolist (p '("replace" "silent" "none"
+ "append" "prepend"))
+ (setq lst (remove p lst)))
+ lst))
+ (norm (lambda (arg)
+ (let ((v (if (and (listp (cdr arg)) (null (cddr arg)))
+ (copy-sequence (cdr arg))
+ (cdr arg))))
+ (when (and v (not (and (sequencep v)
+ (not (consp v))
+ (= (length v) 0))))
+ (cond
+ ((and (listp v) ; lists are sorted
+ (member (car arg) '(:result-params)))
+ (sort (funcall rm v) #'string<))
+ ((and (stringp v) ; strings are sorted
+ (member (car arg) '(:results :exports)))
+ (mapconcat #'identity (sort (funcall rm (split-string v))
+ #'string<) " "))
+ (t v))))))
+ ;; expanded body
+ (lang (nth 0 info))
+ (params (nth 2 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)))
+ (expanded
+ (if (fboundp expand-cmd) (funcall expand-cmd body params)
+ (org-babel-expand-body:generic
+ body params (and (fboundp assignments-cmd)
+ (funcall assignments-cmd params))))))
+ (let* ((it (format "%s-%s"
+ (mapconcat
+ #'identity
+ (delq nil (mapcar (lambda (arg)
+ (let ((normalized (funcall norm arg)))
+ (when normalized
+ (format "%S" normalized))))
+ (nth 2 info))) ":")
+ expanded))
+ (hash (sha1 it)))
+ (when (called-interactively-p 'interactive) (message hash))
+ hash))))
+
+(defun org-babel-current-result-hash (&optional info)
+ "Return the current in-buffer hash."
+ (let ((result (org-babel-where-is-src-block-result nil info)))
+ (when result
+ (org-with-point-at result
+ (let ((case-fold-search t)) (looking-at org-babel-result-regexp))
+ (match-string-no-properties 1)))))
+
+(defun org-babel-hide-hash ()
+ "Hide the hash in the current results line.
+Only the initial `org-babel-hash-show' characters of the hash
+will remain visible."
+ (add-to-invisibility-spec '(org-babel-hide-hash . t))
+ (save-excursion
+ (when (and (let ((case-fold-search t))
+ (re-search-forward org-babel-result-regexp nil t))
+ (match-string 1))
+ (let* ((start (match-beginning 1))
+ (hide-start (+ org-babel-hash-show start))
+ (end (match-end 1))
+ (hash (match-string 1))
+ ov1 ov2)
+ (setq ov1 (make-overlay start hide-start))
+ (setq ov2 (make-overlay hide-start end))
+ (overlay-put ov2 'invisible 'org-babel-hide-hash)
+ (overlay-put ov1 'babel-hash hash)))))
+
+(defun org-babel-hide-all-hashes ()
+ "Hide the hash in the current buffer.
+Only the initial `org-babel-hash-show' characters of each hash
+will remain visible. This function should be called as part of
+the `org-mode-hook'."
+ (save-excursion
+ (let ((case-fold-search t))
+ (while (and (not org-babel-hash-show-time)
+ (re-search-forward org-babel-result-regexp nil t))
+ (goto-char (match-beginning 0))
+ (org-babel-hide-hash)
+ (goto-char (match-end 0))))))
+(add-hook 'org-mode-hook #'org-babel-hide-all-hashes)
+
+(defun org-babel-hash-at-point (&optional point)
+ "Return the value of the hash at POINT.
+\\<org-mode-map>\
+The hash is also added as the last element of the kill ring.
+This can be called with `\\[org-ctrl-c-ctrl-c]'."
+ (interactive)
+ (let ((hash (car (delq nil (mapcar
+ (lambda (ol) (overlay-get ol 'babel-hash))
+ (overlays-at (or point (point))))))))
+ (when hash (kill-new hash) (message hash))))
+
+(defun org-babel-result-hide-spec ()
+ "Hide portions of results lines.
+Add `org-babel-hide-result' as an invisibility spec for hiding
+portions of results lines."
+ (add-to-invisibility-spec '(org-babel-hide-result . t)))
+(add-hook 'org-mode-hook #'org-babel-result-hide-spec)
+
+(defvar org-babel-hide-result-overlays nil
+ "Overlays hiding results.")
+
+(defun org-babel-result-hide-all ()
+ "Fold all results in the current buffer."
+ (interactive)
+ (org-babel-show-result-all)
+ (save-excursion
+ (let ((case-fold-search t))
+ (while (re-search-forward org-babel-result-regexp nil t)
+ (save-excursion (goto-char (match-beginning 0))
+ (org-babel-hide-result-toggle-maybe))))))
+
+(defun org-babel-show-result-all ()
+ "Unfold all results in the current buffer."
+ (mapc 'delete-overlay org-babel-hide-result-overlays)
+ (setq org-babel-hide-result-overlays nil))
+
+;;;###autoload
+(defun org-babel-hide-result-toggle-maybe ()
+ "Toggle visibility of result at point."
+ (interactive)
+ (let ((case-fold-search t))
+ (and (org-match-line org-babel-result-regexp)
+ (progn (org-babel-hide-result-toggle) t))))
+
+(defun org-babel-hide-result-toggle (&optional force)
+ "Toggle the visibility of the current result."
+ (interactive)
+ (save-excursion
+ (beginning-of-line)
+ (let ((case-fold-search t))
+ (unless (re-search-forward org-babel-result-regexp nil t)
+ (error "Not looking at a result line")))
+ (let ((start (progn (beginning-of-line 2) (1- (point))))
+ (end (progn
+ (while (looking-at org-babel-multi-line-header-regexp)
+ (forward-line 1))
+ (goto-char (1- (org-babel-result-end)))
+ (point)))
+ ov)
+ (if (memq t (mapcar (lambda (overlay)
+ (eq (overlay-get overlay 'invisible)
+ 'org-babel-hide-result))
+ (overlays-at start)))
+ (when (or (not force) (eq force 'off))
+ (mapc (lambda (ov)
+ (when (member ov org-babel-hide-result-overlays)
+ (setq org-babel-hide-result-overlays
+ (delq ov org-babel-hide-result-overlays)))
+ (when (eq (overlay-get ov 'invisible)
+ 'org-babel-hide-result)
+ (delete-overlay ov)))
+ (overlays-at start)))
+ (setq ov (make-overlay start end))
+ (overlay-put ov 'invisible 'org-babel-hide-result)
+ ;; make the block accessible to isearch
+ (overlay-put
+ ov 'isearch-open-invisible
+ (lambda (ov)
+ (when (member ov org-babel-hide-result-overlays)
+ (setq org-babel-hide-result-overlays
+ (delq ov org-babel-hide-result-overlays)))
+ (when (eq (overlay-get ov 'invisible)
+ 'org-babel-hide-result)
+ (delete-overlay ov))))
+ (push ov org-babel-hide-result-overlays)))))
+
+;; org-tab-after-check-for-cycling-hook
+(add-hook 'org-tab-first-hook #'org-babel-hide-result-toggle-maybe)
+;; Remove overlays when changing major mode
+(add-hook 'org-mode-hook
+ (lambda () (add-hook 'change-major-mode-hook
+ #'org-babel-show-result-all 'append 'local)))
+
+(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
+ ;; point of call.
+ (org-babel-parse-header-arguments
+ (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 (point) (concat "header-args:" lang) 'inherit)
+ no-eval)))))
+
+(defun org-babel-balanced-split (string alts)
+ "Split STRING on instances of ALTS.
+ALTS is a character, or cons of two character options where each
+option may be either the numeric code of a single character or
+a list of character alternatives. For example, to split on
+balanced instances of \"[ \t]:\", set ALTS to ((32 9) . 58)."
+ (with-temp-buffer
+ (insert string)
+ (goto-char (point-min))
+ (let ((splitp (lambda (past next)
+ ;; Non-nil when there should be a split after NEXT
+ ;; character. PAST is the character before NEXT.
+ (pcase alts
+ (`(,(and first (pred consp)) . ,(and second (pred consp)))
+ (and (memq past first) (memq next second)))
+ (`(,first . ,(and second (pred consp)))
+ (and (eq past first) (memq next second)))
+ (`(,(and first (pred consp)) . ,second)
+ (and (memq past first) (eq next second)))
+ (`(,first . ,second)
+ (and (eq past first) (eq next second)))
+ ((pred (eq next)) t)
+ (_ nil))))
+ (partial nil)
+ (result nil))
+ (while (not (eobp))
+ (cond
+ ((funcall splitp (char-before) (char-after))
+ ;; There is a split after point. If ALTS is two-folds,
+ ;; remove last parsed character as it belongs to ALTS.
+ (when (consp alts) (pop partial))
+ ;; Include elements parsed so far in RESULTS and flush
+ ;; partial parsing.
+ (when partial
+ (push (apply #'string (nreverse partial)) result)
+ (setq partial nil))
+ (forward-char))
+ ((memq (char-after) '(?\( ?\[))
+ ;; Include everything between balanced brackets.
+ (let* ((origin (point))
+ (after (char-after))
+ (openings (list after)))
+ (forward-char)
+ (while (and openings (re-search-forward "[]()]" nil t))
+ (pcase (char-before)
+ ((and match (or ?\[ ?\()) (push match openings))
+ (?\] (when (eq ?\[ (car openings)) (pop openings)))
+ (_ (when (eq ?\( (car openings)) (pop openings)))))
+ (if (null openings)
+ (setq partial
+ (nconc (nreverse (string-to-list
+ (buffer-substring origin (point))))
+ partial))
+ ;; Un-balanced bracket. Backtrack.
+ (push after partial)
+ (goto-char (1+ origin)))))
+ ((and (eq ?\" (char-after)) (not (eq ?\\ (char-before))))
+ ;; Include everything from current double quote to next
+ ;; non-escaped double quote.
+ (let ((origin (point)))
+ (if (re-search-forward "[^\\]\"" nil t)
+ (setq partial
+ (nconc (nreverse (string-to-list
+ (buffer-substring origin (point))))
+ partial))
+ ;; No closing double quote. Backtrack.
+ (push ?\" partial)
+ (forward-char))))
+ (t (push (char-after) partial)
+ (forward-char))))
+ ;; Add pending parsing and return result.
+ (when partial (push (apply #'string (nreverse partial)) result))
+ (nreverse result))))
+
+(defun org-babel-join-splits-near-ch (ch list)
+ "Join splits where \"=\" is on either end of the split."
+ (let ((last= (lambda (str) (= ch (aref str (1- (length str))))))
+ (first= (lambda (str) (= ch (aref str 0)))))
+ (reverse
+ (cl-reduce (lambda (acc el)
+ (let ((head (car acc)))
+ (if (and head (or (funcall last= head) (funcall first= el)))
+ (cons (concat head el) (cdr acc))
+ (cons el acc))))
+ list :initial-value nil))))
+
+(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
+ (lambda (arg)
+ (if (string-match
+ "\\([^ \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))
+ no-eval))
+ (cons (intern (org-babel-chomp arg)) nil)))
+ (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.
+
+This allows expression of multiple variables with one :var as
+shown below.
+
+#+PROPERTY: var foo=1, bar=2"
+ (let (results)
+ (mapc (lambda (pair)
+ (if (eq (car pair) :var)
+ (mapcar (lambda (v) (push (cons :var (org-trim v)) results))
+ (org-babel-join-splits-near-ch
+ 61 (org-babel-balanced-split (cdr pair) 32)))
+ (push pair results)))
+ header-arguments)
+ (nreverse results)))
+
+(defun org-babel-process-params (params)
+ "Expand variables in PARAMS and add summary parameters."
+ (let* ((processed-vars (mapcar (lambda (el)
+ (if (consp el)
+ el
+ (org-babel-ref-parse el)))
+ (org-babel--get-vars params)))
+ (vars-and-names (if (and (assq :colname-names params)
+ (assq :rowname-names params))
+ (list processed-vars)
+ (org-babel-disassemble-tables
+ processed-vars
+ (cdr (assq :hlines params))
+ (cdr (assq :colnames params))
+ (cdr (assq :rownames params)))))
+ (raw-result (or (cdr (assq :results params)) ""))
+ (result-params (delete-dups
+ (append
+ (split-string (if (stringp raw-result)
+ raw-result
+ (eval raw-result t)))
+ (cdr (assq :result-params params))))))
+ (append
+ (mapcar (lambda (var) (cons :var var)) (car vars-and-names))
+ (list
+ (cons :colname-names (or (cdr (assq :colname-names params))
+ (cadr vars-and-names)))
+ (cons :rowname-names (or (cdr (assq :rowname-names params))
+ (cl-caddr vars-and-names)))
+ (cons :result-params result-params)
+ (cons :result-type (cond ((member "output" result-params) 'output)
+ ((member "value" result-params) 'value)
+ (t 'value))))
+ (cl-remove-if
+ (lambda (x) (memq (car x) '(:colname-names :rowname-names :result-params
+ :result-type :var)))
+ params))))
+
+;; row and column names
+(defun org-babel-del-hlines (table)
+ "Remove all `hline's from TABLE."
+ (remq 'hline table))
+
+(defun org-babel-get-colnames (table)
+ "Return the column names of TABLE.
+Return a cons cell, the `car' of which contains the TABLE less
+colnames, and the `cdr' of which contains a list of the column
+names."
+ (if (eq 'hline (nth 1 table))
+ (cons (cddr table) (car table))
+ (cons (cdr table) (car table))))
+
+(defun org-babel-get-rownames (table)
+ "Return the row names of TABLE.
+Return a cons cell, the `car' of which contains the TABLE less
+rownames, and the `cdr' of which contains a list of the rownames.
+Note: this function removes any hlines in TABLE."
+ (let* ((table (org-babel-del-hlines table))
+ (rownames (funcall (lambda ()
+ (let ((tp table))
+ (mapcar
+ (lambda (_row)
+ (prog1
+ (pop (car tp))
+ (setq tp (cdr tp))))
+ table))))))
+ (cons table rownames)))
+
+(defun org-babel-put-colnames (table colnames)
+ "Add COLNAMES to TABLE if they exist."
+ (if colnames (apply 'list colnames 'hline table) table))
+
+(defun org-babel-put-rownames (table rownames)
+ "Add ROWNAMES to TABLE if they exist."
+ (if rownames
+ (mapcar (lambda (row)
+ (if (listp row)
+ (cons (or (pop rownames) "") row)
+ row))
+ table)
+ table))
+
+(defun org-babel-pick-name (names selector)
+ "Select one out of an alist of row or column names.
+SELECTOR can be either a list of names in which case those names
+will be returned directly, or an index into the list NAMES in
+which case the indexed names will be return."
+ (if (listp selector)
+ selector
+ (when names
+ (if (and selector (symbolp selector) (not (equal t selector)))
+ (cdr (assoc selector names))
+ (if (integerp selector)
+ (nth (- selector 1) names)
+ (cdr (car (last names))))))))
+
+(defun org-babel-disassemble-tables (vars hlines colnames rownames)
+ "Parse tables for further processing.
+Process the variables in VARS according to the HLINES,
+ROWNAMES and COLNAMES header arguments. Return a list consisting
+of the vars, cnames and rnames."
+ (let (cnames rnames)
+ (list
+ (mapcar
+ (lambda (var)
+ (when (proper-list-p (cdr var))
+ (when (and (not (equal colnames "no"))
+ ;; Compatibility note: avoid `length>', which
+ ;; isn't available until Emacs 28.
+ (or colnames (and (> (length (cdr var)) 1)
+ (eq (nth 1 (cdr var)) 'hline)
+ (not (member 'hline (cddr (cdr var)))))))
+ (let ((both (org-babel-get-colnames (cdr var))))
+ (setq cnames (cons (cons (car var) (cdr both))
+ cnames))
+ (setq var (cons (car var) (car both)))))
+ (when (and rownames (not (equal rownames "no")))
+ (let ((both (org-babel-get-rownames (cdr var))))
+ (setq rnames (cons (cons (car var) (cdr both))
+ rnames))
+ (setq var (cons (car var) (car both)))))
+ (when (and hlines (not (equal hlines "yes")))
+ (setq var (cons (car var) (org-babel-del-hlines (cdr var))))))
+ var)
+ vars)
+ (reverse cnames) (reverse rnames))))
+
+(defun org-babel-reassemble-table (table colnames rownames)
+ "Add column and row names to a table.
+Given a TABLE and set of COLNAMES and ROWNAMES add the names
+to the table for reinsertion to `org-mode'."
+ (if (listp table)
+ (let ((table (if (and rownames (= (length table) (length rownames)))
+ (org-babel-put-rownames table rownames) table)))
+ (if (and colnames (listp (car table)) (= (length (car table))
+ (length colnames)))
+ (org-babel-put-colnames table colnames) table))
+ table))
+
+(defun org-babel-where-is-src-block-head (&optional src-block)
+ "Find where the current source block begins.
+
+If optional argument SRC-BLOCK is `src-block' type element, find
+its current beginning instead.
+
+Return the point at the beginning of the current source block.
+Specifically at the beginning of the #+BEGIN_SRC line. Also set
+match-data relatively to `org-babel-src-block-regexp', which see.
+If the point is not on a source block then return nil."
+ (let ((element (or src-block (org-element-at-point))))
+ (when (eq (org-element-type element) 'src-block)
+ (let ((end (org-element-property :end element)))
+ (org-with-wide-buffer
+ ;; Ensure point is not on a blank line after the block.
+ (beginning-of-line)
+ (skip-chars-forward " \r\t\n" end)
+ (when (< (point) end)
+ (prog1 (goto-char (org-element-property :post-affiliated element))
+ (looking-at org-babel-src-block-regexp))))))))
+
+;;;###autoload
+(defun org-babel-goto-src-block-head ()
+ "Go to the beginning of the current code block."
+ (interactive)
+ (let ((head (org-babel-where-is-src-block-head)))
+ (if head (goto-char head) (error "Not currently in a code block"))))
+
+;;;###autoload
+(defun org-babel-goto-named-src-block (name)
+ "Go to a named source-code block."
+ (interactive
+ (let ((completion-ignore-case t)
+ (case-fold-search t)
+ (all-block-names (org-babel-src-block-names)))
+ (list (completing-read
+ "source-block name: " all-block-names nil t
+ (let* ((context (org-element-context))
+ (type (org-element-type context))
+ (noweb-ref
+ (and (memq type '(inline-src-block src-block))
+ (org-in-regexp (org-babel-noweb-wrap)))))
+ (cond
+ (noweb-ref
+ (buffer-substring
+ (+ (car noweb-ref) (length org-babel-noweb-wrap-start))
+ (- (cdr noweb-ref) (length org-babel-noweb-wrap-end))))
+ ((memq type '(babel-call inline-babel-call)) ;#+CALL:
+ (org-element-property :call context))
+ ((car (org-element-property :results context))) ;#+RESULTS:
+ ((let ((symbol (thing-at-point 'symbol))) ;Symbol.
+ (and symbol
+ (member-ignore-case symbol all-block-names)
+ symbol)))
+ (t "")))))))
+ (let ((point (org-babel-find-named-block name)))
+ (if point
+ ;; Taken from `org-open-at-point'.
+ (progn (org-mark-ring-push) (goto-char point) (org-show-context))
+ (message "source-code block `%s' not found in this buffer" name))))
+
+(defun org-babel-find-named-block (name)
+ "Find a named source-code block.
+Return the location of the source block identified by source
+NAME, or nil if no such block exists. Set match data according
+to `org-babel-named-src-block-regexp'."
+ (save-excursion
+ (goto-char (point-min))
+ (let ((regexp (org-babel-named-src-block-regexp-for-name name)))
+ (or (and (looking-at regexp)
+ (progn (goto-char (match-beginning 1))
+ (line-beginning-position)))
+ (ignore-errors (org-next-block 1 nil regexp))))))
+
+(defun org-babel-src-block-names (&optional file)
+ "Return the names of source blocks in FILE or the current buffer."
+ (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)
+ "Go to a named result."
+ (interactive
+ (let ((completion-ignore-case t))
+ (list (completing-read "Source-block name: "
+ (org-babel-result-names) nil t))))
+ (let ((point (org-babel-find-named-result name)))
+ (if point
+ ;; taken from `org-open-at-point'
+ (progn (goto-char point) (org-show-context))
+ (message "result `%s' not found in this buffer" name))))
+
+(defun org-babel-find-named-result (name)
+ "Find a named result.
+Return the location of the result named NAME in the current
+buffer or nil if no such result exists."
+ (save-excursion
+ (goto-char (point-min))
+ (let ((case-fold-search t)
+ (re (format "^[ \t]*#\\+%s.*?:[ \t]*%s[ \t]*$"
+ org-babel-results-keyword
+ (regexp-quote name))))
+ (catch :found
+ (while (re-search-forward re nil t)
+ (let ((element (org-element-at-point)))
+ (when (or (eq (org-element-type element) 'keyword)
+ (< (point)
+ (org-element-property :post-affiliated element)))
+ (throw :found (line-beginning-position)))))))))
+
+(defun org-babel-result-names (&optional file)
+ "Return the names of results in FILE or the current buffer."
+ (save-excursion
+ (when file (find-file file)) (goto-char (point-min))
+ (let ((case-fold-search t) names)
+ (while (re-search-forward org-babel-result-w-name-regexp nil t)
+ (setq names (cons (match-string-no-properties 9) names)))
+ names)))
+
+;;;###autoload
+(defun org-babel-next-src-block (&optional arg)
+ "Jump to the next source block.
+With optional prefix argument ARG, jump forward ARG many source blocks."
+ (interactive "p")
+ (org-next-block arg nil org-babel-src-block-regexp))
+
+;;;###autoload
+(defun org-babel-previous-src-block (&optional arg)
+ "Jump to the previous source block.
+With optional prefix argument ARG, jump backward ARG many source blocks."
+ (interactive "p")
+ (org-previous-block arg org-babel-src-block-regexp))
+
+(defvar org-babel-load-languages)
+
+;;;###autoload
+(defun org-babel-mark-block ()
+ "Mark current source block."
+ (interactive)
+ (let ((head (org-babel-where-is-src-block-head)))
+ (when head
+ (save-excursion
+ (goto-char head)
+ (looking-at org-babel-src-block-regexp))
+ (push-mark (match-end 5) nil t)
+ (goto-char (match-beginning 5)))))
+
+(defun org-babel-demarcate-block (&optional arg)
+ "Wrap or split the code in the region or on the point.
+When called from inside of a code block the current block is
+split. When called from outside of a code block a new code block
+is created. In both cases if the region is demarcated and if the
+region is not active then the point is demarcated."
+ (interactive "P")
+ (let* ((info (org-babel-get-src-block-info 'light))
+ (start (org-babel-where-is-src-block-head))
+ (block (and start (match-string 0)))
+ (headers (and start (match-string 4)))
+ (stars (concat (make-string (or (org-current-level) 1) ?*) " "))
+ (upper-case-p (and block
+ (let (case-fold-search)
+ (string-match-p "#\\+BEGIN_SRC" block)))))
+ (if info
+ (mapc
+ (lambda (place)
+ (save-excursion
+ (goto-char place)
+ (let ((lang (nth 0 info))
+ (indent (make-string (current-indentation) ?\s)))
+ (when (string-match "^[[:space:]]*$"
+ (buffer-substring (point-at-bol)
+ (point-at-eol)))
+ (delete-region (point-at-bol) (point-at-eol)))
+ (insert (concat
+ (if (looking-at "^") "" "\n")
+ indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
+ (if arg stars indent) "\n"
+ indent (if upper-case-p "#+BEGIN_SRC " "#+begin_src ")
+ lang
+ (if (> (length headers) 1)
+ (concat " " headers) headers)
+ (if (looking-at "[\n\r]")
+ ""
+ (concat "\n" (make-string (current-column) ? )))))))
+ (move-end-of-line 2))
+ (sort (if (org-region-active-p) (list (mark) (point)) (list (point))) #'>))
+ (let ((start (point))
+ (lang (completing-read
+ "Lang: "
+ (mapcar #'symbol-name
+ (delete-dups
+ (append (mapcar #'car org-babel-load-languages)
+ (mapcar (lambda (el) (intern (car el)))
+ org-src-lang-modes))))))
+ (body (delete-and-extract-region
+ (if (org-region-active-p) (mark) (point)) (point))))
+ (insert (concat (if (looking-at "^") "" "\n")
+ (if arg (concat stars "\n") "")
+ (if upper-case-p "#+BEGIN_SRC " "#+begin_src ")
+ lang "\n" body
+ (if (or (= (length body) 0)
+ (string-suffix-p "\r" body)
+ (string-suffix-p "\n" body))
+ ""
+ "\n")
+ (if upper-case-p "#+END_SRC\n" "#+end_src\n")))
+ (goto-char start)
+ (move-end-of-line 1)))))
+
+(defun org-babel--insert-results-keyword (name hash)
+ "Insert RESULTS keyword with NAME value at point.
+If NAME is nil, results are anonymous. HASH is a string used as
+the results hash, or nil. Leave point before the keyword."
+ (save-excursion (insert "\n")) ;open line to indent.
+ (org-indent-line)
+ (delete-char 1)
+ (insert (concat "#+" org-babel-results-keyword
+ (cond ((not hash) nil)
+ (org-babel-hash-show-time
+ (format "[%s %s]"
+ (format-time-string "(%F %T)")
+ hash))
+ (t (format "[%s]" hash)))
+ ":"
+ (when name (concat " " name))
+ "\n"))
+ ;; Make sure results are going to be followed by at least one blank
+ ;; line so they do not get merged with the next element, e.g.,
+ ;;
+ ;; #+results:
+ ;; : 1
+ ;;
+ ;; : fixed-width area, unrelated to the above.
+ (unless (looking-at "^[ \t]*$") (save-excursion (insert "\n")))
+ (beginning-of-line 0)
+ (when hash (org-babel-hide-hash)))
+
+(defun org-babel--clear-results-maybe (hash)
+ "Clear results when hash doesn't match HASH.
+
+When results hash does not match HASH, remove RESULTS keyword at
+point, along with related contents. Do nothing if HASH is nil.
+
+Return a non-nil value if results were cleared. In this case,
+leave point where new results should be inserted."
+ (when hash
+ (let ((case-fold-search t)) (looking-at org-babel-result-regexp))
+ (unless (string= (match-string 1) hash)
+ (let* ((e (org-element-at-point))
+ (post (copy-marker (org-element-property :post-affiliated e))))
+ ;; Delete contents.
+ (delete-region post
+ (save-excursion
+ (goto-char (org-element-property :end e))
+ (skip-chars-backward " \t\n")
+ (line-beginning-position 2)))
+ ;; Delete RESULT keyword. However, if RESULTS keyword is
+ ;; orphaned, ignore this part. The deletion above already
+ ;; took care of it.
+ (unless (= (point) post)
+ (delete-region (line-beginning-position)
+ (line-beginning-position 2)))
+ (goto-char post)
+ (set-marker post nil)
+ t))))
+
+(defun org-babel-where-is-src-block-result (&optional insert _info hash)
+ "Find where the current source block results begin.
+
+Return the point at the beginning of the result of the current
+source block, specifically at the beginning of the results line.
+
+If no result exists for this block return nil, unless optional
+argument INSERT is non-nil. In this case, create a results line
+following the source block and return the position at its
+beginning. In the case of inline code, remove the results part
+instead.
+
+If optional argument HASH is a string, remove contents related to
+RESULTS keyword if its hash is different. Then update the latter
+to HASH."
+ (let ((context (org-element-context)))
+ (catch :found
+ (org-with-wide-buffer
+ (pcase (org-element-type context)
+ ((or `inline-babel-call `inline-src-block)
+ ;; Results for inline objects are located right after them.
+ ;; There is no RESULTS line to insert either.
+ (let ((limit (org-element-property
+ :contents-end (org-element-property :parent context))))
+ (goto-char (org-element-property :end context))
+ (skip-chars-forward " \t\n" limit)
+ (throw :found
+ (and
+ (< (point) limit)
+ (let ((result (org-element-context)))
+ (and (eq (org-element-type result) 'macro)
+ (string= (org-element-property :key result)
+ "results")
+ (if (not insert) (point)
+ (delete-region
+ (point)
+ (progn
+ (goto-char (org-element-property :end result))
+ (skip-chars-backward " \t")
+ (point)))
+ (point))))))))
+ ((or `babel-call `src-block)
+ (let* ((name (org-element-property :name context))
+ (named-results (and name (org-babel-find-named-result name))))
+ (goto-char (or named-results (org-element-property :end context)))
+ (cond
+ ;; Existing results named after the current source.
+ (named-results
+ (when (org-babel--clear-results-maybe hash)
+ (org-babel--insert-results-keyword name hash))
+ (throw :found (point)))
+ ;; Named results expect but none to be found.
+ (name)
+ ;; No possible anonymous results at the very end of
+ ;; buffer or outside CONTEXT parent.
+ ((eq (point)
+ (or (org-element-property
+ :contents-end (org-element-property :parent context))
+ (point-max))))
+ ;; Check if next element is an anonymous result below
+ ;; the current block.
+ ((let* ((next (org-element-at-point))
+ (end (save-excursion
+ (goto-char
+ (org-element-property :post-affiliated next))
+ (line-end-position)))
+ (empty-result-re (concat org-babel-result-regexp "$"))
+ (case-fold-search t))
+ (re-search-forward empty-result-re end t))
+ (beginning-of-line)
+ (when (org-babel--clear-results-maybe hash)
+ (org-babel--insert-results-keyword nil hash))
+ (throw :found (point))))))
+ ;; Ignore other elements.
+ (_ (throw :found nil))))
+ ;; No result found. Insert a RESULTS keyword below element, if
+ ;; appropriate. In this case, ensure there is an empty line
+ ;; after the previous element.
+ (when insert
+ (save-excursion
+ (goto-char (min (org-element-property :end context) (point-max)))
+ (skip-chars-backward " \t\n")
+ (forward-line)
+ (unless (bolp) (insert "\n"))
+ (insert "\n")
+ (org-babel--insert-results-keyword
+ (org-element-property :name context) hash)
+ (point))))))
+
+(defun org-babel-read-element (element)
+ "Read ELEMENT into emacs-lisp.
+Return nil if ELEMENT cannot be read."
+ (org-with-wide-buffer
+ (goto-char (org-element-property :post-affiliated element))
+ (pcase (org-element-type element)
+ (`fixed-width
+ (let ((v (org-trim (org-element-property :value element))))
+ (or (org-babel--string-to-number v) v)))
+ (`table (org-babel-read-table))
+ (`plain-list (org-babel-read-list))
+ (`example-block
+ (let ((v (org-element-property :value element)))
+ (if (or org-src-preserve-indentation
+ (org-element-property :preserve-indent element))
+ v
+ (org-remove-indentation v))))
+ (`export-block
+ (org-remove-indentation (org-element-property :value element)))
+ (`paragraph
+ ;; Treat paragraphs containing a single link specially.
+ (skip-chars-forward " \t")
+ (if (and (looking-at org-link-bracket-re)
+ (save-excursion
+ (goto-char (match-end 0))
+ (skip-chars-forward " \r\t\n")
+ (<= (org-element-property :end element)
+ (point))))
+ (org-babel-read-link)
+ (buffer-substring-no-properties
+ (org-element-property :contents-begin element)
+ (org-element-property :contents-end element))))
+ ((or `center-block `quote-block `verse-block `special-block)
+ (org-remove-indentation
+ (buffer-substring-no-properties
+ (org-element-property :contents-begin element)
+ (org-element-property :contents-end element))))
+ (_ nil))))
+
+(defun org-babel-read-result ()
+ "Read the result at point into emacs-lisp."
+ (and (not (save-excursion
+ (beginning-of-line)
+ (looking-at-p "[ \t]*$")))
+ (org-babel-read-element (org-element-at-point))))
+
+(defun org-babel-read-table ()
+ "Read the table at point into emacs-lisp."
+ (mapcar (lambda (row)
+ (if (and (symbolp row) (equal row 'hline)) row
+ (mapcar (lambda (el) (org-babel-read el 'inhibit-lisp-eval)) row)))
+ (org-table-to-lisp)))
+
+(defun org-babel-read-list ()
+ "Read the list at point into emacs-lisp."
+ (mapcar (lambda (el) (org-babel-read el 'inhibit-lisp-eval))
+ (cdr (org-list-to-lisp))))
+
+(defvar org-link-types-re)
+(defun org-babel-read-link ()
+ "Read the link at point into emacs-lisp.
+If the path of the link is a file path it is expanded using
+`expand-file-name'."
+ (let* ((case-fold-search t)
+ (raw (and (looking-at org-link-bracket-re)
+ (org-no-properties (match-string 1))))
+ (type (and (string-match org-link-types-re raw)
+ (match-string 1 raw))))
+ (cond
+ ((not type) (expand-file-name raw))
+ ((string= type "file")
+ (and (string-match "file\\(.*\\):\\(.+\\)" raw)
+ (expand-file-name (match-string 2 raw))))
+ (t raw))))
+
+(defun org-babel-format-result (result &optional sep)
+ "Format RESULT for writing to file."
+ (let ((echo-res (lambda (r) (if (stringp r) r (format "%S" r)))))
+ (if (listp result)
+ ;; table result
+ (orgtbl-to-generic
+ result (list :sep (or sep "\t") :fmt echo-res))
+ ;; scalar result
+ (funcall echo-res result))))
+
+(defun org-babel-insert-result (result &optional result-params info hash lang)
+ "Insert RESULT into the current buffer.
+
+By default RESULT is inserted after the end of the current source
+block. The RESULT of an inline source block usually will be
+wrapped inside a `results' macro and placed on the same line as
+the inline source block. The macro is stripped upon export.
+Multiline and non-scalar RESULTS from inline source blocks are
+not allowed. With optional argument RESULT-PARAMS controls
+insertion of results in the Org mode file. RESULT-PARAMS can
+take the following values:
+
+replace - (default option) insert results after the source block
+ or inline source block replacing any previously
+ inserted results.
+
+silent -- no results are inserted into the Org buffer but
+ the results are echoed to the minibuffer and are
+ ingested by Emacs (a potentially time consuming
+ process).
+
+none ---- no results are inserted into the Org buffer nor
+ echoed to the minibuffer. they are not processed into
+ Emacs-lisp objects at all.
+
+file ---- the results are interpreted as a file path, and are
+ inserted into the buffer using the Org file syntax.
+
+list ---- the results are interpreted as an Org list.
+
+raw ----- results are added directly to the Org file. This is
+ a good option if you code block will output Org
+ formatted text.
+
+drawer -- results are added directly to the Org file as with
+ \"raw\", but are wrapped in a RESULTS drawer or results
+ macro, allowing them to later be replaced or removed
+ automatically.
+
+org ----- results are added inside of a \"src_org{}\" or \"#+BEGIN_SRC
+ org\" block depending on whether the current source block is
+ inline or not. They are not comma-escaped when inserted,
+ but Org syntax here will be discarded when exporting the
+ file.
+
+html ---- results are added inside of a #+BEGIN_EXPORT HTML block
+ or html export snippet depending on whether the current
+ source block is inline or not. This is a good option
+ if your code block will output html formatted text.
+
+latex --- results are added inside of a #+BEGIN_EXPORT LATEX
+ block or latex export snippet depending on whether the
+ current source block is inline or not. This is a good
+ option if your code block will output latex formatted
+ text.
+
+code ---- the results are extracted in the syntax of the source
+ code of the language being evaluated and are added
+ inside of a source block with the source-code language
+ set appropriately. Also, source block inlining is
+ preserved in this case. Note this relies on the
+ optional LANG argument.
+
+list ---- the results are rendered as a list. This option not
+ allowed for inline source blocks.
+
+table --- the results are rendered as a table. This option not
+ allowed for inline source blocks.
+
+INFO may provide the values of these header arguments (in the
+`header-arguments-alist' see the docstring for
+`org-babel-get-src-block-info'):
+
+:file --- the name of the file to which output should be written.
+
+:wrap --- the effect is similar to `latex' in RESULT-PARAMS but
+ using the argument supplied to specify the export block
+ or snippet type."
+ (cond ((stringp result)
+ (setq result (org-no-properties result))
+ (when (member "file" result-params)
+ (setq result (org-babel-result-to-file
+ result
+ (org-babel--file-desc (nth 2 info) result)))))
+ ((listp result))
+ (t (setq result (format "%S" result))))
+ (if (and result-params (member "silent" result-params))
+ (progn (message (replace-regexp-in-string "%" "%%" (format "%S" result)))
+ result)
+ (let ((inline (let ((context (org-element-context)))
+ (and (memq (org-element-type context)
+ '(inline-babel-call inline-src-block))
+ context))))
+ (when inline
+ (let ((warning
+ (or (and (member "table" result-params) "`:results table'")
+ (and (listp result) "list result")
+ (and (string-match-p "\n." result) "multiline result")
+ (and (member "list" result-params) "`:results list'"))))
+ (when warning
+ (user-error "Inline error: %s cannot be used" warning))))
+ (save-excursion
+ (let* ((visible-beg (point-min-marker))
+ (visible-end (copy-marker (point-max) t))
+ (inline (let ((context (org-element-context)))
+ (and (memq (org-element-type context)
+ '(inline-babel-call inline-src-block))
+ context)))
+ (existing-result (org-babel-where-is-src-block-result t nil hash))
+ (results-switches (cdr (assq :results_switches (nth 2 info))))
+ ;; When results exist outside of the current visible
+ ;; region of the buffer, be sure to widen buffer to
+ ;; update them.
+ (outside-scope (and existing-result
+ (buffer-narrowed-p)
+ (or (> visible-beg existing-result)
+ (<= visible-end existing-result))))
+ beg end indent)
+ ;; Ensure non-inline results end in a newline.
+ (when (and (org-string-nw-p result)
+ (not inline)
+ (not (string-equal (substring result -1) "\n")))
+ (setq result (concat result "\n")))
+ (unwind-protect
+ (progn
+ (when outside-scope (widen))
+ (if existing-result (goto-char existing-result)
+ (goto-char (org-element-property :end inline))
+ (skip-chars-backward " \t"))
+ (unless inline
+ (setq indent (current-indentation))
+ (forward-line 1))
+ (setq beg (point))
+ (cond
+ (inline
+ ;; Make sure new results are separated from the
+ ;; source code by one space.
+ (unless existing-result
+ (insert " ")
+ (setq beg (point))))
+ ((member "replace" result-params)
+ (delete-region (point) (org-babel-result-end)))
+ ((member "append" result-params)
+ (goto-char (org-babel-result-end)) (setq beg (point-marker)))
+ ((member "prepend" result-params))) ; already there
+ (setq results-switches
+ (if results-switches (concat " " results-switches) ""))
+ (let ((wrap
+ (lambda (start finish &optional no-escape no-newlines
+ inline-start inline-finish)
+ (when inline
+ (setq start inline-start)
+ (setq finish inline-finish)
+ (setq no-newlines t))
+ (let ((before-finish (copy-marker end)))
+ (goto-char end)
+ (insert (concat finish (unless no-newlines "\n")))
+ (goto-char beg)
+ (insert (concat start (unless no-newlines "\n")))
+ (unless no-escape
+ (org-escape-code-in-region
+ (min (point) before-finish) before-finish))
+ (goto-char end))))
+ (tabulablep
+ (lambda (r)
+ ;; Non-nil when result R can be turned into
+ ;; a table.
+ (and (proper-list-p r)
+ (cl-every
+ (lambda (e) (or (atom e) (proper-list-p e)))
+ result)))))
+ ;; insert results based on type
+ (cond
+ ;; Do nothing for an empty result.
+ ((null result))
+ ;; Insert a list if preferred.
+ ((member "list" result-params)
+ (insert
+ (org-trim
+ (org-list-to-generic
+ (cons 'unordered
+ (mapcar
+ (lambda (e)
+ (list (if (stringp e) e (format "%S" e))))
+ (if (listp result) result
+ (split-string result "\n" t))))
+ '(:splicep nil :istart "- " :iend "\n")))
+ "\n"))
+ ;; Try hard to print RESULT as a table. Give up if
+ ;; it contains an improper list.
+ ((funcall tabulablep result)
+ (goto-char beg)
+ (insert (concat (orgtbl-to-orgtbl
+ (if (cl-every
+ (lambda (e)
+ (or (eq e 'hline) (listp e)))
+ result)
+ result
+ (list result))
+ nil)
+ "\n"))
+ (goto-char beg)
+ (when (org-at-table-p) (org-table-align))
+ (goto-char (org-table-end)))
+ ;; Print verbatim a list that cannot be turned into
+ ;; a table.
+ ((listp result) (insert (format "%s\n" result)))
+ ((member "file" result-params)
+ (when inline
+ (setq result (org-macro-escape-arguments result)))
+ (insert result))
+ ((and inline (not (member "raw" result-params)))
+ (insert (org-macro-escape-arguments
+ (org-babel-chomp result "\n"))))
+ (t (goto-char beg) (insert result)))
+ (setq end (copy-marker (point) t))
+ ;; Possibly wrap result.
+ (cond
+ ((assq :wrap (nth 2 info))
+ (let* ((full (or (cdr (assq :wrap (nth 2 info))) "results"))
+ (split (split-string full))
+ (type (car split))
+ (opening-line (concat "#+begin_" full))
+ (closing-line (concat "#+end_" type)))
+ (cond
+ ;; Escape contents from "export" wrap. Wrap
+ ;; inline results within an export snippet with
+ ;; appropriate value.
+ ((eq t (compare-strings type nil nil "export" nil nil t))
+ (let ((backend (pcase split
+ (`(,_) "none")
+ (`(,_ ,b . ,_) b))))
+ (funcall wrap
+ opening-line closing-line
+ nil nil
+ (format "{{{results(@@%s:"
+ backend) "@@)}}}")))
+ ;; Escape contents from "example" wrap. Mark
+ ;; inline results as verbatim.
+ ((eq t (compare-strings type nil nil "example" nil nil t))
+ (funcall wrap
+ opening-line closing-line
+ nil nil
+ "{{{results(=" "=)}}}"))
+ ;; Escape contents from "src" wrap. Mark
+ ;; inline results as inline source code.
+ ((eq t (compare-strings type nil nil "src" nil nil t))
+ (let ((inline-open
+ (pcase split
+ (`(,_)
+ "{{{results(src_none{")
+ (`(,_ ,language)
+ (format "{{{results(src_%s{" language))
+ (`(,_ ,language . ,rest)
+ (let ((r (mapconcat #'identity rest " ")))
+ (format "{{{results(src_%s[%s]{"
+ language r))))))
+ (funcall wrap
+ opening-line closing-line
+ nil nil
+ inline-open "})}}}")))
+ ;; Do not escape contents in non-verbatim
+ ;; blocks. Return plain inline results.
+ (t
+ (funcall wrap
+ opening-line closing-line
+ t nil
+ "{{{results(" ")}}}")))))
+ ((member "html" result-params)
+ (funcall wrap "#+begin_export html" "#+end_export" nil nil
+ "{{{results(@@html:" "@@)}}}"))
+ ((member "latex" result-params)
+ (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
+ "{{{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
+ (format "{{{results(src_%s[%s]{" lang results-switches)
+ "})}}}")))
+ ((member "raw" result-params)
+ (goto-char beg) (when (org-at-table-p) (org-cycle)))
+ ((or (member "drawer" result-params)
+ ;; 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
+ "{{{results(" ")}}}"))
+ ((and inline (member "file" result-params))
+ (funcall wrap nil nil nil nil "{{{results(" ")}}}"))
+ ((and (not (funcall tabulablep result))
+ (not (member "file" result-params)))
+ (let ((org-babel-inline-result-wrap
+ ;; Hard code {{{results(...)}}} on top of
+ ;; customization.
+ (format "{{{results(%s)}}}"
+ org-babel-inline-result-wrap)))
+ (org-babel-examplify-region
+ beg end results-switches inline)))))
+ ;; Possibly indent results in par with #+results line.
+ (when (and (not inline) (numberp indent) (> indent 0)
+ ;; In this case `table-align' does the work
+ ;; for us.
+ (not (and (listp result)
+ (member "append" result-params))))
+ (indent-rigidly beg end indent))
+ (if (null result)
+ (if (member "value" result-params)
+ (message "Code block returned no value.")
+ (message "Code block produced no output."))
+ (message "Code block evaluation complete.")))
+ (set-marker end nil)
+ (when outside-scope (narrow-to-region visible-beg visible-end))
+ (set-marker visible-beg nil)
+ (set-marker visible-end nil)))))))
+
+(defun org-babel-remove-result (&optional info keep-keyword)
+ "Remove the result of the current source block."
+ (interactive)
+ (let ((location (org-babel-where-is-src-block-result nil info))
+ (case-fold-search t))
+ (when location
+ (save-excursion
+ (goto-char location)
+ (when (looking-at org-babel-result-regexp)
+ (delete-region
+ (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.
+The result must be wrapped in a `results' macro to be removed.
+Leading white space is trimmed."
+ (interactive)
+ (let* ((el (or datum (org-element-context))))
+ (when (memq (org-element-type el) '(inline-src-block inline-babel-call))
+ (org-with-wide-buffer
+ (goto-char (org-element-property :end el))
+ (skip-chars-backward " \t")
+ (let ((result (save-excursion
+ (skip-chars-forward
+ " \t\n"
+ (org-element-property
+ :contents-end (org-element-property :parent el)))
+ (org-element-context))))
+ (when (and (eq (org-element-type result) 'macro)
+ (string= (org-element-property :key result) "results"))
+ (delete-region ; And leading whitespace.
+ (point)
+ (progn (goto-char (org-element-property :end result))
+ (skip-chars-backward " \t\n")
+ (point)))))))))
+
+(defun org-babel-remove-result-one-or-many (x)
+ "Remove the result of the current source block.
+If called with a prefix argument, remove all result blocks
+in the buffer."
+ (interactive "P")
+ (if x
+ (org-babel-map-src-blocks nil (org-babel-remove-result))
+ (org-babel-remove-result)))
+
+(defun org-babel-result-end ()
+ "Return the point at the end of the current set of results."
+ (cond ((looking-at-p "^[ \t]*$") (point)) ;no result
+ ((looking-at-p (format "^[ \t]*%s[ \t]*$" org-link-bracket-re))
+ (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
+ special-block src-block item plain-list table
+ latex-environment))
+ (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 link with optional DESCRIPTION.
+If the `default-directory' is different from the containing
+file's directory then expand relative links."
+ (when (stringp result)
+ (let ((same-directory?
+ (and (buffer-file-name (buffer-base-buffer))
+ (not (string= (expand-file-name default-directory)
+ (expand-file-name
+ (file-name-directory
+ (buffer-file-name (buffer-base-buffer)))))))))
+ (format "[[file:%s]%s]"
+ (if (and default-directory
+ (buffer-file-name (buffer-base-buffer)) 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 (buffer-base-buffer))))
+ (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."
+ (interactive "*r")
+ (let ((maybe-cap
+ (lambda (str)
+ (if org-babel-uppercase-example-markers (upcase str) str))))
+ (if inline
+ (save-excursion
+ (goto-char beg)
+ (insert (format org-babel-inline-result-wrap
+ (delete-and-extract-region beg end))))
+ (let ((size (count-lines beg end)))
+ (save-excursion
+ (cond ((= size 0)) ; do nothing for an empty result
+ ((< size org-babel-min-lines-for-block-output)
+ (goto-char beg)
+ (dotimes (_ size)
+ (beginning-of-line 1) (insert ": ") (forward-line 1)))
+ (t
+ (goto-char beg)
+ (insert (if results-switches
+ (format "%s%s\n"
+ (funcall maybe-cap "#+begin_example")
+ results-switches)
+ (funcall maybe-cap "#+begin_example\n")))
+ (let ((p (point)))
+ (if (markerp end) (goto-char end) (forward-char (- end beg)))
+ (org-escape-code-in-region p (point)))
+ (insert (funcall maybe-cap "#+end_example\n")))))))))
+
+(defun org-babel-update-block-body (new-body)
+ "Update the body of the current code block to NEW-BODY."
+ (let ((element (org-element-at-point)))
+ (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 (current-indentation))
+ (body-start (line-beginning-position 2))
+ (body (org-element-normalize-string
+ (if (or org-src-preserve-indentation
+ (org-element-property :preserve-indent element))
+ new-body
+ (with-temp-buffer
+ (insert (org-remove-indentation new-body))
+ (indent-rigidly
+ (point-min)
+ (point-max)
+ (+ ind org-edit-src-content-indentation))
+ (buffer-string))))))
+ (delete-region body-start
+ (org-with-wide-buffer
+ (goto-char (org-element-property :end element))
+ (skip-chars-backward " \t\n")
+ (line-beginning-position)))
+ (goto-char body-start)
+ (insert body))))
+
+(defun org-babel-merge-params (&rest plists)
+ "Combine all parameter association lists in PLISTS.
+Later elements of PLISTS override the values of previous elements.
+This takes into account some special considerations for certain
+parameters when merging lists."
+ (let* ((results-exclusive-groups
+ (mapcar (lambda (group) (mapcar #'symbol-name group))
+ (cdr (assq 'results org-babel-common-header-args-w-values))))
+ (exports-exclusive-groups
+ (mapcar (lambda (group) (mapcar #'symbol-name group))
+ (cdr (assq 'exports org-babel-common-header-args-w-values))))
+ (merge
+ (lambda (exclusive-groups &rest result-params)
+ ;; Maintain exclusivity of mutually exclusive parameters,
+ ;; as defined in EXCLUSIVE-GROUPS while merging lists in
+ ;; RESULT-PARAMS.
+ (let (output)
+ (dolist (new-params result-params (delete-dups output))
+ (dolist (new-param new-params)
+ (dolist (exclusive-group exclusive-groups)
+ (when (member new-param exclusive-group)
+ (setq output (cl-remove-if
+ (lambda (o) (member o exclusive-group))
+ output))))
+ (push new-param output))))))
+ (variable-index 0) ;Handle positional arguments.
+ clearnames
+ params ;Final parameters list.
+ ;; Some keywords accept multiple values. We need to treat
+ ;; them specially.
+ vars results exports)
+ (dolist (plist plists)
+ (dolist (pair plist)
+ (pcase pair
+ (`(:var . ,value)
+ (let ((name (cond
+ ((listp value) (car value))
+ ((string-match "^\\([^= \f\t\n\r\v]+\\)[ \t]*=" value)
+ (intern (match-string 1 value)))
+ (t nil))))
+ (cond
+ (name
+ (setq vars
+ (append (if (not (assoc name vars)) vars
+ (push name clearnames)
+ (cl-remove-if (lambda (p) (equal name (car p)))
+ vars))
+ (list (cons name pair)))))
+ ((and vars (nth variable-index vars))
+ ;; If no name is given and we already have named
+ ;; variables then assign to named variables in order.
+ (let ((name (car (nth variable-index vars))))
+ ;; Clear out colnames and rownames for replace vars.
+ (push name clearnames)
+ (setf (cddr (nth variable-index vars))
+ (concat (symbol-name name) "=" value))
+ (cl-incf variable-index)))
+ (t (error "Variable \"%s\" must be assigned a default value"
+ (cdr pair))))))
+ (`(:results . ,value)
+ (setq results (funcall merge
+ results-exclusive-groups
+ results
+ (split-string
+ (cond ((stringp value) value)
+ ((functionp value) (funcall value))
+ (t (eval value t)))))))
+ (`(:exports . ,value)
+ (setq exports (funcall merge
+ exports-exclusive-groups
+ exports
+ (split-string
+ (cond ((and value (functionp value)) (funcall value))
+ (value value)
+ (t ""))))))
+ ;; Regular keywords: any value overwrites the previous one.
+ (_ (setq params (cons pair (assq-delete-all (car pair) params)))))))
+ ;; Handle `:var' and clear out colnames and rownames for replaced
+ ;; variables.
+ (setq params (nconc (mapcar (lambda (v) (cons :var (cddr v))) vars)
+ params))
+ (dolist (name clearnames)
+ (dolist (param '(:colname-names :rowname-names))
+ (when (assq param params)
+ (setf (cdr (assq param params))
+ (cl-remove-if (lambda (pair) (equal name (car pair)))
+ (cdr (assq param params))))
+ (setq params
+ (cl-remove-if (lambda (pair) (and (equal (car pair) param)
+ (null (cdr pair))))
+ params)))))
+ ;; Handle other special keywords, which accept multiple values.
+ (setq params (nconc (list (cons :results (mapconcat #'identity results " "))
+ (cons :exports (mapconcat #'identity exports " ")))
+ params))
+ ;; Return merged params.
+ (org-babel-eval-headers params)))
+
+(defun org-babel-noweb-p (params context)
+ "Check if PARAMS require expansion in CONTEXT.
+CONTEXT may be one of :tangle, :export or :eval."
+ (let ((allowed-values (cl-case context
+ (:tangle '("yes" "tangle" "no-export" "strip-export"))
+ (:eval '("yes" "no-export" "strip-export" "eval"))
+ (:export '("yes")))))
+ (cl-some (lambda (v) (member v allowed-values))
+ (split-string (or (cdr (assq :noweb params)) "")))))
+
+(defun org-babel-expand-noweb-references (&optional info parent-buffer)
+ "Expand Noweb references in the body of the current source code block.
+
+For example the following reference would be replaced with the
+body of the source-code block named `example-block'.
+
+<<example-block>>
+
+Note that any text preceding the <<foo>> construct on a line will
+be interposed between the lines of the replacement text. So for
+example if <<foo>> is placed behind a comment, then the entire
+replacement text will also be commented.
+
+This function must be called from inside of the buffer containing
+the source-code block which holds BODY.
+
+In addition the following syntax can be used to insert the
+results of evaluating the source-code block named `example-block'.
+
+<<example-block()>>
+
+Any optional arguments can be passed to example-block by placing
+the arguments inside the parenthesis following the convention
+defined by `org-babel-lob'. For example
+
+<<example-block(a=9)>>
+
+would set the value of argument \"a\" equal to \"9\". Note that
+these arguments are not evaluated in the current source-code
+block but are passed literally to the \"example-block\"."
+ (let* ((parent-buffer (or parent-buffer (current-buffer)))
+ (info (or info (org-babel-get-src-block-info 'light)))
+ (lang (nth 0 info))
+ (body (nth 1 info))
+ (comment (string= "noweb" (cdr (assq :comments (nth 2 info)))))
+ (noweb-re (format "\\(.*?\\)\\(%s\\)"
+ (with-current-buffer parent-buffer
+ (org-babel-noweb-wrap))))
+ (cache nil)
+ (c-wrap
+ (lambda (s)
+ ;; Comment string S, according to LANG mode. Return new
+ ;; string.
+ (unless org-babel-tangle-uncomment-comments
+ (with-temp-buffer
+ (funcall (org-src-get-lang-mode lang))
+ (comment-region (point)
+ (progn (insert s) (point)))
+ (org-trim (buffer-string))))))
+ (expand-body
+ (lambda (i)
+ ;; Expand body of code 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))))))))
+ (expand-references
+ (lambda (ref cache)
+ (pcase (gethash ref cache)
+ (`(,last . ,previous)
+ ;; Ignore separator for last block.
+ (let ((strings (list (funcall expand-body last))))
+ (dolist (i previous)
+ (let ((parameters (nth 2 i)))
+ ;; Since we're operating in reverse order, first
+ ;; push separator, then body.
+ (push (or (cdr (assq :noweb-sep parameters)) "\n")
+ strings)
+ (push (funcall expand-body i) strings)))
+ (mapconcat #'identity strings "")))
+ ;; Raise an error about missing reference, or return the
+ ;; empty string.
+ ((guard (or org-babel-noweb-error-all-langs
+ (member lang org-babel-noweb-error-langs)))
+ (error "Cannot resolve %s (see `org-babel-noweb-error-langs')"
+ (org-babel-noweb-wrap ref)))
+ (_ "")))))
+ (replace-regexp-in-string
+ noweb-re
+ (lambda (m)
+ (with-current-buffer parent-buffer
+ (save-match-data
+ (let* ((prefix (match-string 1 m))
+ (id (match-string 3 m))
+ (evaluate (string-match-p "(.*)" id))
+ (expansion
+ (cond
+ (evaluate
+ ;; Evaluation can potentially modify the buffer
+ ;; and invalidate the cache: reset it.
+ (setq cache nil)
+ (let ((raw (org-babel-ref-resolve id)))
+ (if (stringp raw) raw (format "%S" raw))))
+ ;; Return the contents of headlines literally.
+ ((org-babel-ref-goto-headline-id id)
+ (org-babel-ref-headline-body))
+ ;; Look for a source block named SOURCE-NAME. If
+ ;; found, assume it is unique; do not look after
+ ;; `:noweb-ref' header argument.
+ ((org-with-point-at 1
+ (let ((r (org-babel-named-src-block-regexp-for-name id)))
+ (and (re-search-forward r nil t)
+ (not (org-in-commented-heading-p))
+ (funcall expand-body
+ (org-babel-get-src-block-info t))))))
+ ;; Retrieve from the Library of Babel.
+ ((nth 2 (assoc-string id org-babel-library-of-babel)))
+ ;; All Noweb references were cached in a previous
+ ;; run. Extract the information from the cache.
+ ((hash-table-p cache)
+ (funcall expand-references id cache))
+ ;; Though luck. We go into the long process of
+ ;; checking each source block and expand those
+ ;; with a matching Noweb reference. Since we're
+ ;; going to visit all source blocks in the
+ ;; document, cache information about them as well.
+ (t
+ (setq cache (make-hash-table :test #'equal))
+ (org-with-wide-buffer
+ (org-babel-map-src-blocks nil
+ (if (org-in-commented-heading-p)
+ (org-forward-heading-same-level nil t)
+ (let* ((info (org-babel-get-src-block-info t))
+ (ref (cdr (assq :noweb-ref (nth 2 info)))))
+ (push info (gethash ref cache))))))
+ (funcall expand-references id cache)))))
+ ;; Interpose PREFIX between every line.
+ (mapconcat #'identity
+ (split-string expansion "[\n\r]")
+ (concat "\n" prefix))))))
+ body t t 2)))
+
+(defun org-babel--script-escape-inner (str)
+ (let (in-single in-double backslash out)
+ (mapc
+ (lambda (ch)
+ (setq
+ out
+ (if backslash
+ (progn
+ (setq backslash nil)
+ (cond
+ ((and in-single (eq ch ?'))
+ ;; Escaped single quote inside single quoted string:
+ ;; emit just a single quote, since we've changed the
+ ;; outer quotes to double.
+ (cons ch out))
+ ((eq ch ?\")
+ ;; Escaped double quote
+ (if in-single
+ ;; This should be interpreted as backslash+quote,
+ ;; not an escape. Emit a three backslashes
+ ;; followed by a quote (because one layer of
+ ;; quoting will be stripped by `org-babel-read').
+ (append (list ch ?\\ ?\\ ?\\) out)
+ ;; Otherwise we are in a double-quoted string. Emit
+ ;; a single escaped quote
+ (append (list ch ?\\) out)))
+ ((eq ch ?\\)
+ ;; Escaped backslash: emit a single escaped backslash
+ (append (list ?\\ ?\\) out))
+ ;; Other: emit a quoted backslash followed by whatever
+ ;; the character was (because one layer of quoting will
+ ;; be stripped by `org-babel-read').
+ (t (append (list ch ?\\ ?\\) out))))
+ (cl-case ch
+ (?\[ (if (or in-double in-single)
+ (cons ?\[ out)
+ (cons ?\( out)))
+ (?\] (if (or in-double in-single)
+ (cons ?\] out)
+ (cons ?\) out)))
+ (?\{ (if (or in-double in-single)
+ (cons ?\{ out)
+ (cons ?\( out)))
+ (?\} (if (or in-double in-single)
+ (cons ?\} out)
+ (cons ?\) out)))
+ (?, (if (or in-double in-single)
+ (cons ?, out) (cons ?\s out)))
+ (?\' (if in-double
+ (cons ?\' out)
+ (setq in-single (not in-single)) (cons ?\" out)))
+ (?\" (if in-single
+ (append (list ?\" ?\\) out)
+ (setq in-double (not in-double)) (cons ?\" out)))
+ (?\\ (unless (or in-single in-double)
+ (error "Can't handle backslash outside string in `org-babel-script-escape'"))
+ (setq backslash t)
+ out)
+ (t (cons ch out))))))
+ (string-to-list str))
+ (when (or in-single in-double)
+ (error "Unterminated string in `org-babel-script-escape'"))
+ (apply #'string (reverse out))))
+
+(defun org-babel-script-escape (str &optional force)
+ "Safely convert tables into elisp lists."
+ (unless (stringp str)
+ (error "`org-babel-script-escape' expects a string"))
+ (let ((escaped
+ (cond
+ ((and (> (length str) 2)
+ (or (and (string-equal "[" (substring str 0 1))
+ (string-equal "]" (substring str -1)))
+ (and (string-equal "{" (substring str 0 1))
+ (string-equal "}" (substring str -1)))
+ (and (string-equal "(" (substring str 0 1))
+ (string-equal ")" (substring str -1)))))
+
+ (concat "'" (org-babel--script-escape-inner str)))
+ ((or force
+ (and (> (length str) 2)
+ (or (and (string-equal "'" (substring str 0 1))
+ (string-equal "'" (substring str -1)))
+ ;; We need to pass double-quoted strings
+ ;; through the backslash-twiddling bits, even
+ ;; though we don't need to change their
+ ;; delimiters.
+ (and (string-equal "\"" (substring str 0 1))
+ (string-equal "\"" (substring str -1))))))
+ (org-babel--script-escape-inner str))
+ (t str))))
+ (condition-case nil (org-babel-read escaped) (error escaped))))
+
+(defun org-babel-read (cell &optional inhibit-lisp-eval)
+ "Convert the string value of CELL to a number if appropriate.
+Otherwise if CELL looks like Lisp (meaning it starts with a
+\"(\", \"\\='\", \"\\=`\" or a \"[\") then read and evaluate it as
+lisp, otherwise return it unmodified as a string. Optional
+argument INHIBIT-LISP-EVAL inhibits lisp evaluation for
+situations in which is it not appropriate."
+ (cond ((not (org-string-nw-p cell)) cell)
+ ((org-babel--string-to-number cell))
+ ((and (not inhibit-lisp-eval)
+ (or (memq (string-to-char cell) '(?\( ?' ?` ?\[))
+ (string= cell "*this*")))
+ (eval (read cell) t))
+ ((eq (string-to-char cell) ?\") (read cell))
+ (t (org-no-properties cell))))
+
+(defun org-babel--string-to-number (string)
+ "If STRING represents a number return its value.
+Otherwise return nil."
+ (unless (or (string-match-p "\\s-" (org-trim string))
+ (not (string-match-p "^[0-9e.+ -]+$" string)))
+ (let ((interned-string (ignore-errors (read string))))
+ (when (numberp interned-string)
+ interned-string))))
+
+(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
+ (with-temp-buffer
+ (condition-case err
+ (progn
+ (insert-file-contents file-name)
+ (delete-file file-name)
+ (let ((pmax (point-max)))
+ ;; If the file was empty, don't bother trying to
+ ;; convert the table.
+ (when (> pmax 1)
+ (org-table-convert-region (point-min) pmax separator)
+ (delq nil
+ (mapcar (lambda (row)
+ (and (not (eq row 'hline))
+ (mapcar #'org-babel-string-read row)))
+ (org-table-to-lisp))))))
+ (error
+ (display-warning 'org-babel
+ (format "Error reading results: %S" err)
+ :error)
+ 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)
+ (match-string 1 cell))
+ cell) t))
+
+(defun org-babel-chomp (string &optional regexp)
+ "Strip a trailing space or carriage return from STRING.
+The default regexp used is \"[ \\f\\t\\n\\r\\v]\" but another one
+can be specified as the REGEXP argument."
+ (let ((regexp (or regexp "[ \f\t\n\r\v]")))
+ (while (and (> (length string) 0)
+ (string-match regexp (substring string -1)))
+ (setq string (substring string 0 -1)))
+ string))
+
+(defun org-babel-process-file-name (name &optional no-quote-p)
+ "Prepare NAME to be used in an external process.
+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'."
+ (let ((f (org-babel-local-file-name (expand-file-name name))))
+ (if no-quote-p f (shell-quote-argument f))))
+
+(defvar org-babel-temporary-directory)
+(unless (or noninteractive (boundp 'org-babel-temporary-directory))
+ (defvar org-babel-temporary-directory
+ (or (and (boundp 'org-babel-temporary-directory)
+ (file-exists-p org-babel-temporary-directory)
+ org-babel-temporary-directory)
+ (make-temp-file "babel-" t))
+ "Directory to hold temporary files created to execute code blocks.
+Used by `org-babel-temp-file'. This directory will be removed on
+Emacs shutdown."))
+
+(defcustom org-babel-remote-temporary-directory "/tmp/"
+ "Directory to hold temporary files on remote hosts."
+ :group 'org-babel
+ :type 'string)
+
+(defmacro org-babel-result-cond (result-params scalar-form &rest table-forms)
+ "Call the code to parse raw string results according to RESULT-PARAMS."
+ (declare (indent 1) (debug t))
+ (org-with-gensyms (params)
+ `(let ((,params ,result-params))
+ (unless (member "none" ,params)
+ (if (or (member "scalar" ,params)
+ (member "verbatim" ,params)
+ (member "html" ,params)
+ (member "code" ,params)
+ (member "pp" ,params)
+ (member "file" ,params)
+ (and (or (member "output" ,params)
+ (member "raw" ,params)
+ (member "org" ,params)
+ (member "drawer" ,params))
+ (not (member "table" ,params))))
+ ,scalar-form
+ ,@table-forms)))))
+
+(defun org-babel-temp-file (prefix &optional suffix)
+ "Create a temporary file in the `org-babel-temporary-directory'.
+Passes PREFIX and SUFFIX directly to `make-temp-file' with the
+value of `temporary-file-directory' temporarily set to the value
+of `org-babel-temporary-directory'."
+ (if (file-remote-p default-directory)
+ (let ((prefix
+ (concat (file-remote-p default-directory)
+ (expand-file-name
+ prefix org-babel-remote-temporary-directory))))
+ (make-temp-file prefix nil suffix))
+ (let ((temporary-file-directory
+ (or (and (boundp 'org-babel-temporary-directory)
+ (file-exists-p org-babel-temporary-directory)
+ org-babel-temporary-directory)
+ temporary-file-directory)))
+ (make-temp-file prefix nil suffix))))
+
+(defun org-babel-remove-temporary-directory ()
+ "Remove `org-babel-temporary-directory' on Emacs shutdown."
+ (when (and (boundp 'org-babel-temporary-directory)
+ (file-exists-p org-babel-temporary-directory))
+ ;; taken from `delete-directory' in files.el
+ (condition-case nil
+ (progn
+ (mapc (lambda (file)
+ ;; This test is equivalent to
+ ;; (and (file-directory-p fn) (not (file-symlink-p fn)))
+ ;; but more efficient
+ (if (eq t (car (file-attributes file)))
+ (delete-directory file)
+ (delete-file file)))
+ (directory-files org-babel-temporary-directory 'full
+ directory-files-no-dot-files-regexp))
+ (delete-directory org-babel-temporary-directory))
+ (error
+ (message "Failed to remove temporary Org-babel directory %s"
+ (if (boundp 'org-babel-temporary-directory)
+ org-babel-temporary-directory
+ "[directory not defined]"))))))
+
+(add-hook 'kill-emacs-hook #'org-babel-remove-temporary-directory)
+
+(defun org-babel-one-header-arg-safe-p (pair safe-list)
+ "Determine if the PAIR is a safe babel header arg according to SAFE-LIST.
+
+For the format of SAFE-LIST, see `org-babel-safe-header-args'."
+ (and (consp pair)
+ (keywordp (car pair))
+ (stringp (cdr pair))
+ (or
+ (memq (car pair) safe-list)
+ (let ((entry (assq (car pair) safe-list)))
+ (and entry
+ (consp entry)
+ (cond ((functionp (cdr entry))
+ (funcall (cdr entry) (cdr pair)))
+ ((listp (cdr entry))
+ (member (cdr pair) (cdr entry)))
+ (t nil)))))))
+
+(defun org-babel-generate-file-param (src-name params)
+ "Calculate the filename for source block results.
+
+The directory is calculated from the :output-dir property of the
+source block; if not specified, use the current directory.
+
+If the source block has a #+NAME and the :file parameter does not
+contain any period characters, then the :file parameter is
+treated as an extension, and the output file name is the
+concatenation of the directory (as calculated above), the block
+name, a period, and the parameter value as a file extension.
+Otherwise, the :file parameter is treated as a full file name,
+and the output file name is the directory (as calculated above)
+plus the parameter value."
+ (let* ((file-cons (assq :file params))
+ (file-ext-cons (assq :file-ext params))
+ (file-ext (cdr-safe file-ext-cons))
+ (dir (cdr-safe (assq :output-dir params)))
+ fname)
+ ;; create the output-dir if it does not exist
+ (when dir
+ (make-directory dir t))
+ (if file-cons
+ ;; :file given; add :output-dir if given
+ (when dir
+ (setcdr file-cons (concat (file-name-as-directory dir) (cdr file-cons))))
+ ;; :file not given; compute from name and :file-ext if possible
+ (when (and src-name file-ext)
+ (if dir
+ (setq fname (concat (file-name-as-directory (or dir ""))
+ src-name "." file-ext))
+ (setq fname (concat src-name "." file-ext)))
+ (setq params (cons (cons :file fname) params))))
+ params))
+
+(defun org-babel-graphical-output-file (params)
+ "File where a babel block should send graphical output, per PARAMS.
+Return nil if no graphical output is expected. Raise an error if
+the output file is ill-defined."
+ (let ((file (cdr (assq :file params))))
+ (cond (file (and (member "graphics" (cdr (assq :result-params params)))
+ file))
+ ((assq :file-ext params)
+ (user-error ":file-ext given but no :file generated; did you forget \
+to name a block?"))
+ (t (user-error "No :file header argument given; cannot create \
+graphical result")))))
+
+(defun org-babel-make-language-alias (new old)
+ "Make source blocks of type NEW aliases for those of type OLD.
+
+NEW and OLD should be strings. This function should be called
+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"
+ "edit-prep"))
+ (let ((sym (intern-soft (concat "org-babel-" fn ":" old))))
+ (when (and sym (fboundp sym))
+ (defalias (intern (concat "org-babel-" fn ":" new)) sym))))
+ ;; Technically we don't need a `dolist' for just one variable, but
+ ;; we keep it for symmetry/ease of future expansion.
+ (dolist (var '("default-header-args"))
+ (let ((sym (intern-soft (concat "org-babel-" var ":" old))))
+ (when (and sym (boundp sym))
+ (defvaralias (intern (concat "org-babel-" var ":" new)) sym)))))
+
+(provide 'ob-core)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ob-core.el ends here
diff --git a/elpa/org-9.5.2/ob-core.elc b/elpa/org-9.5.2/ob-core.elc
new file mode 100644
index 0000000..aa246c6
--- /dev/null
+++ b/elpa/org-9.5.2/ob-core.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-css.el b/elpa/org-9.5.2/ob-css.el
new file mode 100644
index 0000000..8ad70d4
--- /dev/null
+++ b/elpa/org-9.5.2/ob-css.el
@@ -0,0 +1,46 @@
+;;; ob-css.el --- Babel Functions for CSS -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Since CSS can't be executed, this file exists solely for tangling
+;; CSS from Org files.
+
+;;; Code:
+(require 'ob)
+
+(defvar org-babel-default-header-args:css '())
+
+(defun org-babel-execute:css (body _params)
+ "Execute a block of CSS code.
+This function is called by `org-babel-execute-src-block'."
+ body)
+
+(defun org-babel-prep-session:css (_session _params)
+ "Return an error if the :session header argument is set.
+CSS does not support sessions."
+ (error "CSS sessions are nonsensical"))
+
+(provide 'ob-css)
+
+;;; ob-css.el ends here
diff --git a/elpa/org-9.5.2/ob-css.elc b/elpa/org-9.5.2/ob-css.elc
new file mode 100644
index 0000000..2e39812
--- /dev/null
+++ b/elpa/org-9.5.2/ob-css.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-ditaa.el b/elpa/org-9.5.2/ob-ditaa.el
new file mode 100644
index 0000000..249c8c8
--- /dev/null
+++ b/elpa/org-9.5.2/ob-ditaa.el
@@ -0,0 +1,122 @@
+;;; ob-ditaa.el --- Babel Functions for ditaa -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating ditaa source code.
+;;
+;; This differs from most standard languages in that
+;;
+;; 1) there is no such thing as a "session" in ditaa
+;;
+;; 2) we are generally only going to return results of type "file"
+;;
+;; 3) we are adding the "file" and "cmdline" header arguments
+;;
+;; 4) there are no variables (at least for now)
+
+;;; Code:
+(require 'ob)
+(require 'org-compat)
+
+(defvar org-babel-default-header-args:ditaa
+ '((:results . "file")
+ (:exports . "results")
+ (:java . "-Dfile.encoding=UTF-8"))
+ "Default arguments for evaluating a ditaa source block.")
+
+(defcustom org-ditaa-jar-path (expand-file-name
+ "ditaa.jar"
+ (file-name-as-directory
+ (expand-file-name
+ "scripts"
+ (file-name-as-directory
+ (expand-file-name
+ "../contrib"
+ (file-name-directory (org-find-library-dir "org")))))))
+ "Path to the ditaa jar executable."
+ :group 'org-babel
+ :type 'string)
+
+(defcustom org-babel-ditaa-java-cmd "java"
+ "Java executable to use when evaluating ditaa blocks."
+ :group 'org-babel
+ :type 'string)
+
+(defcustom org-ditaa-eps-jar-path
+ (expand-file-name "DitaaEps.jar" (file-name-directory org-ditaa-jar-path))
+ "Path to the DitaaEps.jar executable."
+ :group 'org-babel
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string)
+
+(defcustom org-ditaa-jar-option "-jar"
+ "Option for the ditaa jar file.
+Do not leave leading or trailing spaces in this string."
+ :group 'org-babel
+ :version "24.1"
+ :type 'string)
+
+(defun org-babel-execute:ditaa (body params)
+ "Execute a block of Ditaa code with org-babel.
+This function is called by `org-babel-execute-src-block'."
+ (let* ((out-file (or (cdr (assq :file params))
+ (error
+ "ditaa code block requires :file header argument")))
+ (cmdline (cdr (assq :cmdline params)))
+ (java (cdr (assq :java params)))
+ (in-file (org-babel-temp-file "ditaa-"))
+ (eps (cdr (assq :eps params)))
+ (eps-file (when eps
+ (org-babel-process-file-name (concat in-file ".eps"))))
+ (pdf-cmd (when (and (or (string= (file-name-extension out-file) "pdf")
+ (cdr (assq :pdf params))))
+ (concat
+ "epstopdf"
+ " " eps-file
+ " -o=" (org-babel-process-file-name out-file))))
+ (cmd (concat org-babel-ditaa-java-cmd
+ " " java " " org-ditaa-jar-option " "
+ (shell-quote-argument
+ (expand-file-name
+ (if eps org-ditaa-eps-jar-path org-ditaa-jar-path)))
+ " " cmdline
+ " " (org-babel-process-file-name in-file)
+ " " (if pdf-cmd
+ eps-file
+ (org-babel-process-file-name out-file)))))
+ (unless (file-exists-p org-ditaa-jar-path)
+ (error "Could not find ditaa.jar at %s" org-ditaa-jar-path))
+ (with-temp-file in-file (insert body))
+ (message cmd) (shell-command cmd)
+ (when pdf-cmd (message pdf-cmd) (shell-command pdf-cmd))
+ nil)) ;; signal that output has already been written to file
+
+(defun org-babel-prep-session:ditaa (_session _params)
+ "Return an error because ditaa does not support sessions."
+ (error "Ditaa does not support sessions"))
+
+(provide 'ob-ditaa)
+
+;;; ob-ditaa.el ends here
diff --git a/elpa/org-9.5.2/ob-ditaa.elc b/elpa/org-9.5.2/ob-ditaa.elc
new file mode 100644
index 0000000..355dcec
--- /dev/null
+++ b/elpa/org-9.5.2/ob-ditaa.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-dot.el b/elpa/org-9.5.2/ob-dot.el
new file mode 100644
index 0000000..8e05a59
--- /dev/null
+++ b/elpa/org-9.5.2/ob-dot.el
@@ -0,0 +1,91 @@
+;;; ob-dot.el --- Babel Functions for dot -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Maintainer: Justin Abrahms
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating dot source code.
+;;
+;; For information on dot see https://www.graphviz.org/
+;;
+;; This differs from most standard languages in that
+;;
+;; 1) there is no such thing as a "session" in dot
+;;
+;; 2) we are generally only going to return results of type "file"
+;;
+;; 3) we are adding the "file" and "cmdline" header arguments
+;;
+;; 4) there are no variables (at least for now)
+
+;;; Code:
+(require 'ob)
+
+(defvar org-babel-default-header-args:dot
+ '((:results . "file") (:exports . "results"))
+ "Default arguments to use when evaluating a dot source block.")
+
+(defun org-babel-expand-body:dot (body params)
+ "Expand BODY according to PARAMS, return the expanded body."
+ (let ((vars (org-babel--get-vars params)))
+ (mapc
+ (lambda (pair)
+ (let ((name (symbol-name (car pair)))
+ (value (cdr pair)))
+ (setq body
+ (replace-regexp-in-string
+ (concat "$" (regexp-quote name))
+ (if (stringp value) value (format "%S" value))
+ body
+ t
+ t))))
+ vars)
+ body))
+
+(defun org-babel-execute:dot (body params)
+ "Execute a block of Dot code with org-babel.
+This function is called by `org-babel-execute-src-block'."
+ (let* ((out-file (cdr (or (assq :file params)
+ (error "You need to specify a :file parameter"))))
+ (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)))
+ (org-babel-eval
+ (concat cmd
+ " " (org-babel-process-file-name in-file)
+ " " cmdline
+ " -o " (org-babel-process-file-name out-file)) "")
+ nil)) ;; signal that output has already been written to file
+
+(defun org-babel-prep-session:dot (_session _params)
+ "Return an error because Dot does not support sessions."
+ (error "Dot does not support sessions"))
+
+(provide 'ob-dot)
+
+;;; ob-dot.el ends here
diff --git a/elpa/org-9.5.2/ob-dot.elc b/elpa/org-9.5.2/ob-dot.elc
new file mode 100644
index 0000000..ce069d5
--- /dev/null
+++ b/elpa/org-9.5.2/ob-dot.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-emacs-lisp.el b/elpa/org-9.5.2/ob-emacs-lisp.el
new file mode 100644
index 0000000..d03151f
--- /dev/null
+++ b/elpa/org-9.5.2/ob-emacs-lisp.el
@@ -0,0 +1,110 @@
+;;; ob-emacs-lisp.el --- Babel Functions for Emacs-lisp Code -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating emacs-lisp code
+
+;;; Code:
+
+(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.")
+
+(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 source blocks to be eval'd using
+lexical scoping. It can also be an alist mapping symbols to
+their value. It is used both as the optional LEXICAL argument to
+`eval', and as the value for `lexical-binding' in buffers created
+by `org-edit-src-code'.")
+
+(defun org-babel-expand-body:emacs-lisp (body params)
+ "Expand BODY according to PARAMS, return the expanded body."
+ (let ((vars (org-babel--get-vars params))
+ (print-level nil)
+ (print-length nil))
+ (if (null vars) (concat body "\n")
+ (format "(let (%s)\n%s\n)"
+ (mapconcat
+ (lambda (var)
+ (format "%S" (print `(,(car var) ',(cdr var)))))
+ vars "\n ")
+ body))))
+
+(defun org-babel-execute:emacs-lisp (body params)
+ "Execute a block of emacs-lisp code with Babel."
+ (let* ((lexical (cdr (assq :lexical params)))
+ (result-params (cdr (assq :result-params params)))
+ (body (format (if (member "output" result-params)
+ "(with-output-to-string %s\n)"
+ "(progn %s\n)")
+ (org-babel-expand-body:emacs-lisp body params)))
+ (result (eval (read (if (or (member "code" result-params)
+ (member "pp" result-params))
+ (concat "(pp " body ")")
+ body))
+ (org-babel-emacs-lisp-lexical lexical))))
+ (org-babel-result-cond result-params
+ (let ((print-level nil)
+ (print-length nil))
+ (if (or (member "scalar" result-params)
+ (member "verbatim" result-params))
+ (format "%S" result)
+ (format "%s" result)))
+ (org-babel-reassemble-table
+ result
+ (org-babel-pick-name (cdr (assq :colname-names params))
+ (cdr (assq :colnames params)))
+ (org-babel-pick-name (cdr (assq :rowname-names params))
+ (cdr (assq :rownames params)))))))
+
+(defun org-babel-emacs-lisp-lexical (lexical)
+ "Interpret :lexical source block argument.
+Convert LEXICAL into the form appropriate for `lexical-binding'
+and the LEXICAL argument to `eval'."
+ (if (listp lexical)
+ lexical
+ (not (null (member lexical '("yes" "t"))))))
+
+(defun org-babel-edit-prep:emacs-lisp (info)
+ "Set `lexical-binding' in Org edit buffer.
+Set `lexical-binding' in Org edit buffer according to the
+corresponding :lexical source block argument."
+ (setq lexical-binding
+ (org-babel-emacs-lisp-lexical
+ (org-babel-read
+ (cdr (assq :lexical (nth 2 info)))))))
+
+(org-babel-make-language-alias "elisp" "emacs-lisp")
+
+(provide 'ob-emacs-lisp)
+
+;;; ob-emacs-lisp.el ends here
diff --git a/elpa/org-9.5.2/ob-emacs-lisp.elc b/elpa/org-9.5.2/ob-emacs-lisp.elc
new file mode 100644
index 0000000..d8c741f
--- /dev/null
+++ b/elpa/org-9.5.2/ob-emacs-lisp.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-eshell.el b/elpa/org-9.5.2/ob-eshell.el
new file mode 100644
index 0000000..d74c4fc
--- /dev/null
+++ b/elpa/org-9.5.2/ob-eshell.el
@@ -0,0 +1,110 @@
+;;; ob-eshell.el --- Babel Functions for Eshell -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
+
+;; Author: stardiviner <numbchild@gmail.com>
+;; Maintainer: stardiviner <numbchild@gmail.com>
+;; Homepage: https://github.com/stardiviner/ob-eshell
+;; Keywords: literate programming, reproducible research
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org Babel support for evaluating Eshell source code.
+
+;;; Code:
+(require 'ob)
+(require 'eshell)
+
+(declare-function eshell-send-input "esh-mode"
+ (&optional use-region queue-p no-newline))
+
+(defvar eshell-last-output-start)
+(defvar eshell-last-output-end)
+(defvar eshell-last-input-end)
+
+(defvar org-babel-default-header-args:eshell '())
+
+(defun org-babel-execute:eshell (body params)
+ "Execute a block of Eshell code BODY with PARAMS.
+This function is called by `org-babel-execute-src-block'.
+
+The BODY can be any code which allowed executed in Eshell.
+Eshell allow to execute normal shell command and Elisp code.
+More details please reference Eshell Info.
+
+The PARAMS are variables assignments."
+ (let* ((session (org-babel-eshell-initiate-session
+ (cdr (assq :session params))))
+ (full-body (org-babel-expand-body:generic
+ body params (org-babel-variable-assignments:eshell params))))
+ (if session
+ (progn
+ (with-current-buffer session
+ (dolist (line (split-string full-body "\n"))
+ (goto-char eshell-last-output-end)
+ (insert line)
+ (eshell-send-input))
+ ;; get output of last input
+ ;; TODO: collect all output instead of last command's output.
+ (goto-char eshell-last-input-end)
+ (buffer-substring-no-properties (point) eshell-last-output-start)))
+ (with-temp-buffer
+ (eshell-command full-body t)
+ (buffer-string)))))
+
+(defun org-babel-prep-session:eshell (session params)
+ "Prepare SESSION according to the header arguments specified in PARAMS."
+ (let* ((session (org-babel-eshell-initiate-session session))
+ ;; Eshell session buffer is read from variable `eshell-buffer-name'.
+ (eshell-buffer-name session)
+ (var-lines (org-babel-variable-assignments:eshell params)))
+ (call-interactively #'eshell)
+ (mapc #'eshell-command var-lines)
+ session))
+
+(defun ob-eshell-session-live-p (session)
+ "Non-nil if Eshell SESSION exists."
+ (get-buffer session))
+
+(defun org-babel-eshell-initiate-session (&optional session _params)
+ "Initiate a session named SESSION."
+ (when (and session (not (string= session "none")))
+ (save-window-excursion
+ (unless (ob-eshell-session-live-p session)
+ (let ((eshell-buffer-name session)) (eshell))))
+ session))
+
+(defun org-babel-variable-assignments:eshell (params)
+ "Convert ob-eshell :var specified variables into Eshell variables assignments."
+ (mapcar
+ (lambda (pair)
+ (format "(setq %s %S)" (car pair) (cdr pair)))
+ (org-babel--get-vars params)))
+
+(defun org-babel-load-session:eshell (session body params)
+ "Load BODY into SESSION with PARAMS."
+ (save-window-excursion
+ (let ((buffer (org-babel-prep-session:eshell session params)))
+ (with-current-buffer buffer
+ (goto-char (point-max))
+ (insert (org-babel-chomp body)))
+ buffer)))
+
+(provide 'ob-eshell)
+
+;;; ob-eshell.el ends here
diff --git a/elpa/org-9.5.2/ob-eshell.elc b/elpa/org-9.5.2/ob-eshell.elc
new file mode 100644
index 0000000..6c163b0
--- /dev/null
+++ b/elpa/org-9.5.2/ob-eshell.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-eval.el b/elpa/org-9.5.2/ob-eval.el
new file mode 100644
index 0000000..cfd8022
--- /dev/null
+++ b/elpa/org-9.5.2/ob-eval.el
@@ -0,0 +1,160 @@
+;;; ob-eval.el --- Babel Functions for External Code Evaluation -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research, comint
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; These functions build existing Emacs support for executing external
+;; shell commands.
+
+;;; Code:
+(require 'org-macs)
+
+(defvar org-babel-error-buffer-name "*Org-Babel Error Output*")
+(declare-function org-babel-temp-file "ob-core" (prefix &optional suffix))
+
+(defun org-babel-eval-error-notify (exit-code stderr)
+ "Open a buffer to display STDERR and a message with the value of EXIT-CODE."
+ (let ((buf (get-buffer-create org-babel-error-buffer-name)))
+ (with-current-buffer buf
+ (goto-char (point-max))
+ (save-excursion (insert stderr)))
+ (display-buffer buf))
+ (message "Babel evaluation exited with code %S" exit-code))
+
+(defun org-babel-eval (command query)
+ "Run COMMAND on QUERY.
+Writes QUERY into a temp-buffer that is processed with
+`org-babel--shell-command-on-region'. If COMMAND succeeds then return
+its results, otherwise display STDERR with
+`org-babel-eval-error-notify'."
+ (let ((error-buffer (get-buffer-create " *Org-Babel Error*")) exit-code)
+ (with-current-buffer error-buffer (erase-buffer))
+ (with-temp-buffer
+ (insert query)
+ (setq exit-code
+ (org-babel--shell-command-on-region
+ command error-buffer))
+ (if (or (not (numberp exit-code)) (> exit-code 0))
+ (progn
+ (with-current-buffer error-buffer
+ (org-babel-eval-error-notify exit-code (buffer-string)))
+ (save-excursion
+ (when (get-buffer org-babel-error-buffer-name)
+ (with-current-buffer org-babel-error-buffer-name
+ (unless (derived-mode-p 'compilation-mode)
+ (compilation-mode))
+ ;; Compilation-mode enforces read-only, but Babel expects the buffer modifiable.
+ (setq buffer-read-only nil))))
+ nil)
+ (buffer-string)))))
+
+(defun org-babel-eval-read-file (file)
+ "Return the contents of FILE as a string."
+ (with-temp-buffer (insert-file-contents file)
+ (buffer-string)))
+
+(defun org-babel--shell-command-on-region (command error-buffer)
+ "Execute COMMAND in an inferior shell with region as input.
+Stripped down version of `shell-command-on-region' for internal use in
+Babel only. This lets us work around errors in the original function
+in various versions of Emacs. This expects the query to be run to be
+in the current temp buffer. This is written into
+input-file. ERROR-BUFFER is the name of the file which
+`org-babel-eval' has created to use for any error messages that are
+returned."
+
+ (let ((input-file (org-babel-temp-file "ob-input-"))
+ (error-file (if error-buffer (org-babel-temp-file "ob-error-") nil))
+ (shell-file-name (org-babel--get-shell-file-name))
+ exit-status)
+ ;; There is an error in `process-file' when `error-file' exists.
+ ;; This is fixed in Emacs trunk as of 2012-12-21; let's use this
+ ;; workaround for now.
+ (unless (file-remote-p default-directory)
+ (delete-file error-file))
+ ;; we always call this with 'replace, remove conditional
+ ;; Replace specified region with output from command.
+ (org-babel--write-temp-buffer-input-file input-file)
+ (setq exit-status
+ (process-file shell-file-name input-file
+ (if error-file
+ (list t error-file)
+ t)
+ nil shell-command-switch command))
+
+ (when (and input-file (file-exists-p input-file)
+ ;; bind org-babel--debug-input around the call to keep
+ ;; the temporary input files available for inspection
+ (not (when (boundp 'org-babel--debug-input)
+ org-babel--debug-input)))
+ (delete-file input-file))
+
+ (when (and error-file (file-exists-p 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)
+ (insert "\f\n"))
+ ;; Do no formatting while reading error file,
+ ;; because that can run a shell command, and we
+ ;; don't want that to cause an infinite recursion.
+ (format-insert-file error-file nil)
+ ;; Put point after the inserted errors.
+ (goto-char (- (point-max) pos-from-end)))
+ (current-buffer)))
+ (delete-file error-file))
+ exit-status))
+
+(defun org-babel--write-temp-buffer-input-file (input-file)
+ "Write the contents of the current temp buffer into INPUT-FILE."
+ (let ((start (point-min))
+ (end (point-max)))
+ (goto-char start)
+ (push-mark (point) 'nomsg)
+ (write-region start end input-file)
+ (delete-region start end)
+ (exchange-point-and-mark)))
+
+(defun org-babel-eval-wipe-error-buffer ()
+ "Delete the contents of the Org code block error buffer.
+This buffer is named by `org-babel-error-buffer-name'."
+ (when (get-buffer org-babel-error-buffer-name)
+ (with-current-buffer org-babel-error-buffer-name
+ (delete-region (point-min) (point-max)))))
+
+(defun org-babel--get-shell-file-name ()
+ "Return system `shell-file-name', defaulting to /bin/sh.
+Unfortunately, `executable-find' does not support file name
+handlers. Therefore, we could use it in the local case only."
+ ;; FIXME: This is generic enough that it should probably be in emacs, not org-mode
+ (cond ((and (not (file-remote-p default-directory))
+ (executable-find shell-file-name))
+ shell-file-name)
+ ((file-executable-p
+ (concat (file-remote-p default-directory) shell-file-name))
+ shell-file-name)
+ ("/bin/sh")))
+
+(provide 'ob-eval)
+
+;;; ob-eval.el ends here
diff --git a/elpa/org-9.5.2/ob-eval.elc b/elpa/org-9.5.2/ob-eval.elc
new file mode 100644
index 0000000..f997ed7
--- /dev/null
+++ b/elpa/org-9.5.2/ob-eval.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-exp.el b/elpa/org-9.5.2/ob-exp.el
new file mode 100644
index 0000000..d10d228
--- /dev/null
+++ b/elpa/org-9.5.2/ob-exp.el
@@ -0,0 +1,418 @@
+;;; ob-exp.el --- Exportation of Babel Source Blocks -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Authors: Eric Schulte
+;; Dan Davison
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Code:
+(require 'ob-core)
+
+(declare-function org-babel-lob-get-info "ob-lob" (&optional datum))
+(declare-function org-element-at-point "org-element" ())
+(declare-function org-element-context "org-element" (&optional element))
+(declare-function org-element-property "org-element" (property element))
+(declare-function org-element-type "org-element" (element))
+(declare-function org-escape-code-in-string "org-src" (s))
+(declare-function org-export-copy-buffer "ox" ())
+(declare-function org-in-commented-heading-p "org" (&optional no-inheritance))
+(declare-function org-in-archived-heading-p "org" (&optional no-inheritance))
+
+(defvar org-src-preserve-indentation)
+
+(defcustom org-export-use-babel t
+ "Switch controlling code evaluation and header processing during export.
+When set to nil no code will be evaluated as part of the export
+process and no header arguments will be obeyed. Users who wish
+to avoid evaluating code on export should use the header argument
+`:eval never-export'."
+ :group 'org-babel
+ :version "24.1"
+ :type '(choice (const :tag "Never" nil)
+ (const :tag "Always" t))
+ :safe #'null)
+
+
+(defmacro org-babel-exp--at-source (&rest body)
+ "Evaluate BODY at the source of the Babel block at point.
+Source is located in `org-babel-exp-reference-buffer'. The value
+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)))
+ ;; 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
+ (when source (goto-char source))
+ ,@body))))
+
+(defun org-babel-exp-src-block ()
+ "Process source block for export.
+Depending on the \":export\" header argument, replace the source
+code block like this:
+
+both ---- display the code and the results
+
+code ---- the default, display the code inside the block but do
+ not process
+
+results - just like none only the block is run on export ensuring
+ that its results are present in the Org mode buffer
+
+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))
+ (lang (nth 0 info))
+ (raw-params (nth 2 info))
+ hash)
+ ;; bail if we couldn't get any info from the block
+ (unless noninteractive
+ (message "org-babel-exp process %s at position %d..."
+ lang
+ (line-beginning-position)))
+ (when info
+ ;; if we're actually going to need the parameters
+ (when (member (cdr (assq :exports (nth 2 info))) '("both" "results"))
+ (let ((lang-headers (intern (concat "org-babel-default-header-args:"
+ lang))))
+ (org-babel-exp--at-source
+ (setf (nth 2 info)
+ (org-babel-process-params
+ (apply #'org-babel-merge-params
+ org-babel-default-header-args
+ (and (boundp lang-headers)
+ (symbol-value lang-headers))
+ (append (org-babel-params-from-properties lang)
+ (list raw-params)))))))
+ (setf hash (org-babel-sha1-hash info :export)))
+ (org-babel-exp-do-export info 'block hash)))))
+
+(defcustom org-babel-exp-call-line-template
+ ""
+ "Template used to export call lines.
+This template may be customized to include the call line name
+with any export markup. The template is filled out using
+`org-fill-template', and the following %keys may be used.
+
+ line --- call line
+
+An example value would be \"\\n: call: %line\" to export the call line
+wrapped in a verbatim environment.
+
+Note: the results are inserted separately after the contents of
+this template."
+ :group 'org-babel
+ :type 'string)
+
+(defun org-babel-exp-process-buffer ()
+ "Execute all Babel blocks in current buffer."
+ (interactive)
+ (when org-export-use-babel
+ (save-window-excursion
+ (let ((case-fold-search t)
+ (regexp "\\(call\\|src\\)_\\|^[ \t]*#\\+\\(BEGIN_SRC\\|CALL:\\)")
+ ;; Get a pristine copy of current buffer so Babel
+ ;; references are properly resolved and source block
+ ;; context is preserved.
+ (org-babel-exp-reference-buffer (org-export-copy-buffer)))
+ (unwind-protect
+ (save-excursion
+ ;; First attach to every source block their original
+ ;; position, so that they can be retrieved within
+ ;; `org-babel-exp-reference-buffer', even after heavy
+ ;; modifications on current buffer.
+ ;;
+ ;; False positives are harmless, so we don't check if
+ ;; we're really at some Babel object. Moreover,
+ ;; `line-end-position' ensures that we propertize
+ ;; a noticeable part of the object, without affecting
+ ;; multiple objects on the same line.
+ (goto-char (point-min))
+ (while (re-search-forward regexp nil t)
+ (let ((s (match-beginning 0)))
+ (put-text-property s (line-end-position) 'org-reference s)))
+ ;; Evaluate from top to bottom every Babel block
+ ;; encountered.
+ (goto-char (point-min))
+ (while (re-search-forward regexp nil t)
+ (unless (save-match-data (or (org-in-commented-heading-p)
+ (org-in-archived-heading-p)))
+ (let* ((object? (match-end 1))
+ (element (save-match-data
+ (if object? (org-element-context)
+ ;; No deep inspection if we're
+ ;; just looking for an element.
+ (org-element-at-point))))
+ (type
+ (pcase (org-element-type element)
+ ;; Discard block elements if we're looking
+ ;; for inline objects. False results
+ ;; happen when, e.g., "call_" syntax is
+ ;; located within affiliated keywords:
+ ;;
+ ;; #+name: call_src
+ ;; #+begin_src ...
+ ((and (or `babel-call `src-block) (guard object?))
+ nil)
+ (type type)))
+ (begin
+ (copy-marker (org-element-property :begin element)))
+ (end
+ (copy-marker
+ (save-excursion
+ (goto-char (org-element-property :end element))
+ (skip-chars-backward " \r\t\n")
+ (point)))))
+ (pcase type
+ (`inline-src-block
+ (let* ((info
+ (org-babel-get-src-block-info nil element))
+ (params (nth 2 info)))
+ (setf (nth 1 info)
+ (if (and (cdr (assq :noweb params))
+ (string= "yes"
+ (cdr (assq :noweb params))))
+ (org-babel-expand-noweb-references
+ info org-babel-exp-reference-buffer)
+ (nth 1 info)))
+ (goto-char begin)
+ (let ((replacement
+ (org-babel-exp-do-export info 'inline)))
+ (if (equal replacement "")
+ ;; Replacement code is empty: remove
+ ;; inline source block, including extra
+ ;; white space that might have been
+ ;; created when inserting results.
+ (delete-region begin
+ (progn (goto-char end)
+ (skip-chars-forward " \t")
+ (point)))
+ ;; 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)
+ (org-babel-exp-do-export
+ (or (org-babel-lob-get-info element)
+ (user-error "Unknown Babel reference: %s"
+ (org-element-property :call element)))
+ 'lob)
+ (let ((rep
+ (org-fill-template
+ org-babel-exp-call-line-template
+ `(("line" .
+ ,(org-element-property :value element))))))
+ ;; If replacement is empty, completely remove
+ ;; the object/element, including any extra
+ ;; white space that might have been created
+ ;; when including results.
+ (if (equal rep "")
+ (delete-region
+ begin
+ (progn (goto-char end)
+ (if (not (eq type 'babel-call))
+ (progn (skip-chars-forward " \t")
+ (point))
+ (skip-chars-forward " \r\t\n")
+ (line-beginning-position))))
+ ;; Otherwise, preserve trailing
+ ;; spaces/newlines and then, insert
+ ;; replacement string.
+ (goto-char begin)
+ (delete-region begin end)
+ (insert rep))))
+ (`src-block
+ (let ((match-start (copy-marker (match-beginning 0)))
+ (ind (current-indentation)))
+ ;; Take care of matched block: compute
+ ;; replacement string. In particular, a nil
+ ;; REPLACEMENT means the block is left as-is
+ ;; while an empty string removes the block.
+ (let ((replacement
+ (progn (goto-char match-start)
+ (org-babel-exp-src-block))))
+ (cond ((not replacement) (goto-char end))
+ ((equal replacement "")
+ (goto-char end)
+ (skip-chars-forward " \r\t\n")
+ (beginning-of-line)
+ (delete-region begin (point)))
+ (t
+ (goto-char match-start)
+ (delete-region (point)
+ (save-excursion
+ (goto-char end)
+ (line-end-position)))
+ (insert replacement)
+ (if (or org-src-preserve-indentation
+ (org-element-property
+ :preserve-indent element))
+ ;; Indent only code block
+ ;; markers.
+ (save-excursion
+ (skip-chars-backward " \r\t\n")
+ (indent-line-to ind)
+ (goto-char match-start)
+ (indent-line-to ind))
+ ;; Indent everything.
+ (indent-rigidly
+ match-start (point) ind)))))
+ (set-marker match-start nil))))
+ (set-marker begin nil)
+ (set-marker end nil)))))
+ (kill-buffer org-babel-exp-reference-buffer)
+ (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.
+The function respects the value of the :exports header argument."
+ (let ((silently (lambda () (let ((session (cdr (assq :session (nth 2 info)))))
+ (unless (equal "none" session)
+ (org-babel-exp-results info type 'silent)))))
+ (clean (lambda () (if (eq type 'inline)
+ (org-babel-remove-inline-result)
+ (org-babel-remove-result info)))))
+ (pcase (or (cdr (assq :exports (nth 2 info))) "code")
+ ("none" (funcall silently) (funcall clean) "")
+ ("code" (funcall silently) (funcall clean) (org-babel-exp-code info type))
+ ("results" (org-babel-exp-results info type nil hash) "")
+ ("both"
+ (org-babel-exp-results info type nil hash)
+ (org-babel-exp-code info type)))))
+
+(defcustom org-babel-exp-code-template
+ "#+BEGIN_SRC %lang%switches%flags\n%body\n#+END_SRC"
+ "Template used to export the body of code blocks.
+This template may be customized to include additional information
+such as the code block name, or the values of particular header
+arguments. The template is filled out using `org-fill-template',
+and the following %keys may be used.
+
+ lang ------ the language of the code block
+ name ------ the name of the code block
+ body ------ the body of the code block
+ switches -- the switches associated to the code block
+ flags ----- the flags passed to the code block
+
+In addition to the keys mentioned above, every header argument
+defined for the code block may be used as a key and will be
+replaced with its value."
+ :group 'org-babel
+ :type 'string)
+
+(defcustom org-babel-exp-inline-code-template
+ "src_%lang[%switches%flags]{%body}"
+ "Template used to export the body of inline code blocks.
+This template may be customized to include additional information
+such as the code block name, or the values of particular header
+arguments. The template is filled out using `org-fill-template',
+and the following %keys may be used.
+
+ lang ------ the language of the code block
+ name ------ the name of the code block
+ body ------ the body of the code block
+ switches -- the switches associated to the code block
+ flags ----- the flags passed to the code block
+
+In addition to the keys mentioned above, every header argument
+defined for the code block may be used as a key and will be
+replaced with its value."
+ :group 'org-babel
+ :type 'string
+ :version "26.1"
+ :package-version '(Org . "8.3"))
+
+(defun org-babel-exp-code (info type)
+ "Return the original code block formatted for export."
+ (setf (nth 1 info)
+ (if (string= "strip-export" (cdr (assq :noweb (nth 2 info))))
+ (replace-regexp-in-string
+ (org-babel-noweb-wrap) "" (nth 1 info))
+ (if (org-babel-noweb-p (nth 2 info) :export)
+ (org-babel-expand-noweb-references
+ info org-babel-exp-reference-buffer)
+ (nth 1 info))))
+ (org-fill-template
+ (if (eq type 'inline)
+ org-babel-exp-inline-code-template
+ org-babel-exp-code-template)
+ `(("lang" . ,(nth 0 info))
+ ;; Inline source code should not be escaped.
+ ("body" . ,(let ((body (nth 1 info)))
+ (if (eq type 'inline) body
+ (org-escape-code-in-string body))))
+ ("switches" . ,(let ((f (nth 3 info)))
+ (and (org-string-nw-p f) (concat " " f))))
+ ("flags" . ,(let ((f (assq :flags (nth 2 info))))
+ (and f (concat " " (cdr f)))))
+ ,@(mapcar (lambda (pair)
+ (cons (substring (symbol-name (car pair)) 1)
+ (format "%S" (cdr pair))))
+ (nth 2 info))
+ ("name" . ,(or (nth 4 info) "")))))
+
+(defun org-babel-exp-results (info type &optional silent hash)
+ "Evaluate and return the results of the current code block for export.
+Results are prepared in a manner suitable for export by Org mode.
+This function is called by `org-babel-exp-do-export'. The code
+block will be evaluated. Optional argument SILENT can be used to
+inhibit insertion of results into the buffer."
+ (unless (and hash (equal hash (org-babel-current-result-hash)))
+ (let ((lang (nth 0 info))
+ (body (if (org-babel-noweb-p (nth 2 info) :eval)
+ (org-babel-expand-noweb-references
+ info org-babel-exp-reference-buffer)
+ (nth 1 info)))
+ (info (copy-sequence info))
+ (org-babel-current-src-block-location (point-marker)))
+ ;; Skip code blocks which we can't evaluate.
+ (when (fboundp (intern (concat "org-babel-execute:" lang)))
+ (org-babel-eval-wipe-error-buffer)
+ (setf (nth 1 info) body)
+ (setf (nth 2 info)
+ (org-babel-exp--at-source
+ (org-babel-process-params
+ (org-babel-merge-params
+ (nth 2 info)
+ `((:results . ,(if silent "silent" "replace")))))))
+ (pcase type
+ (`block (org-babel-execute-src-block nil info))
+ (`inline
+ ;; Position the point on the inline source block
+ ;; allowing `org-babel-insert-result' to check that the
+ ;; block is inline.
+ (goto-char (nth 5 info))
+ (org-babel-execute-src-block nil info))
+ (`lob
+ (save-excursion
+ (goto-char (nth 5 info))
+ (org-babel-execute-src-block nil info))))))))
+
+(provide 'ob-exp)
+
+;;; ob-exp.el ends here
diff --git a/elpa/org-9.5.2/ob-exp.elc b/elpa/org-9.5.2/ob-exp.elc
new file mode 100644
index 0000000..093c31b
--- /dev/null
+++ b/elpa/org-9.5.2/ob-exp.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-forth.el b/elpa/org-9.5.2/ob-forth.el
new file mode 100644
index 0000000..74dbc02
--- /dev/null
+++ b/elpa/org-9.5.2/ob-forth.el
@@ -0,0 +1,88 @@
+;;; ob-forth.el --- Babel Functions for Forth -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research, forth
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Requires the gforth forth compiler and `forth-mode' (see below).
+;; https://www.gnu.org/software/gforth/
+
+;;; Requirements:
+
+;; Session evaluation requires the gforth forth compiler as well as
+;; `forth-mode' which is distributed with gforth (in gforth.el).
+
+;;; Code:
+(require 'ob)
+(require 'org-macs)
+
+(declare-function forth-proc "ext:gforth" ())
+
+(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'."
+ (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)))
+ (if (member "output" (cdr (assq :result-params params)))
+ (mapconcat #'identity all-results "\n")
+ (car (last all-results))))))
+
+(defun org-babel-forth-session-execute (body params)
+ (require 'forth-mode)
+ (let ((proc (forth-proc))
+ (rx " \\(\n:\\|compiled\n\\|ok\n\\)")
+ (result-start))
+ (with-current-buffer (process-buffer (forth-proc))
+ (mapcar (lambda (line)
+ (setq result-start (progn (goto-char (process-mark proc))
+ (point)))
+ (comint-send-string proc (concat line "\n"))
+ ;; wait for forth to say "ok"
+ (while (not (progn (goto-char result-start)
+ (re-search-forward rx nil t)))
+ (accept-process-output proc 0.01))
+ (let ((case (match-string 1)))
+ (cond
+ ((string= "ok\n" case)
+ ;; Collect intermediate output.
+ (buffer-substring (+ result-start 1 (length line))
+ (match-beginning 0)))
+ ((string= "compiled\n" case))
+ ;; Ignore partial compilation.
+ ((string= "\n:" case)
+ ;; Report errors.
+ (org-babel-eval-error-notify 1
+ (buffer-substring
+ (+ (match-beginning 0) 1) (point-max)))
+ nil))))
+ (split-string (org-trim
+ (org-babel-expand-body:generic body params))
+ "\n"
+ 'omit-nulls)))))
+
+(provide 'ob-forth)
+
+;;; ob-forth.el ends here
diff --git a/elpa/org-9.5.2/ob-forth.elc b/elpa/org-9.5.2/ob-forth.elc
new file mode 100644
index 0000000..e35f921
--- /dev/null
+++ b/elpa/org-9.5.2/ob-forth.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-fortran.el b/elpa/org-9.5.2/ob-fortran.el
new file mode 100644
index 0000000..2e55498
--- /dev/null
+++ b/elpa/org-9.5.2/ob-fortran.el
@@ -0,0 +1,170 @@
+;;; ob-fortran.el --- Babel Functions for Fortran -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+;; Authors: Sergey Litvinov
+;; Eric Schulte
+;; Keywords: literate programming, reproducible research, fortran
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating fortran code.
+
+;;; Code:
+(require 'ob)
+(require 'org-macs)
+(require 'cc-mode)
+(require 'cl-lib)
+
+(declare-function org-entry-get "org"
+ (pom property &optional inherit literal-nil))
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("fortran" . "F90"))
+
+(defvar org-babel-default-header-args:fortran '())
+
+(defcustom org-babel-fortran-compiler "gfortran"
+ "Fortran command used to compile Fortran source code file."
+ :group 'org-babel
+ :package-version '(Org . "9.5")
+ :type 'string)
+
+(defun org-babel-execute:fortran (body params)
+ "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)))
+ (flags (cdr (assq :flags params)))
+ (full-body (org-babel-expand-body:fortran body params)))
+ (with-temp-file tmp-src-file (insert full-body))
+ (org-babel-eval
+ (format "%s -o %s %s %s"
+ org-babel-fortran-compiler
+ (org-babel-process-file-name tmp-bin-file)
+ (mapconcat 'identity
+ (if (listp flags) flags (list flags)) " ")
+ (org-babel-process-file-name tmp-src-file)) "")
+ (let ((results
+ (org-trim
+ (org-remove-indentation
+ (org-babel-eval
+ (concat tmp-bin-file (if cmdline (concat " " cmdline) "")) "")))))
+ (org-babel-reassemble-table
+ (org-babel-result-cond (cdr (assq :result-params params))
+ (org-babel-read results)
+ (let ((tmp-file (org-babel-temp-file "f-")))
+ (with-temp-file tmp-file (insert results))
+ (org-babel-import-elisp-from-file tmp-file)))
+ (org-babel-pick-name
+ (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
+ (org-babel-pick-name
+ (cdr (assq :rowname-names params)) (cdr (assq :rownames params)))))))
+
+(defun org-babel-expand-body:fortran (body params)
+ "Expand a block of fortran or fortran code with org-babel according to
+its header arguments."
+ (let ((vars (org-babel--get-vars params))
+ (main-p (not (string= (cdr (assq :main params)) "no")))
+ (includes (or (cdr (assq :includes params))
+ (org-babel-read (org-entry-get nil "includes" t))))
+ (defines (org-babel-read
+ (or (cdr (assq :defines params))
+ (org-babel-read (org-entry-get nil "defines" t))))))
+ (mapconcat 'identity
+ (list
+ ;; includes
+ (mapconcat
+ (lambda (inc) (format "#include %s" inc))
+ (if (listp includes) includes (list includes)) "\n")
+ ;; defines
+ (mapconcat
+ (lambda (inc) (format "#define %s" inc))
+ (if (listp defines) defines (list defines)) "\n")
+ ;; body
+ (if main-p
+ (org-babel-fortran-ensure-main-wrap
+ (concat
+ ;; variables
+ (mapconcat 'org-babel-fortran-var-to-fortran vars "\n")
+ body)
+ params)
+ body) "\n") "\n")))
+
+(defun org-babel-fortran-ensure-main-wrap (body params)
+ "Wrap body in a \"program ... end program\" block if none exists."
+ (if (string-match "^[ \t]*program\\>" (capitalize body))
+ (let ((vars (org-babel--get-vars params)))
+ (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."
+ (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."
+ (error "Fortran is a compiled languages -- no support for sessions"))
+
+;; helper functions
+
+(defun org-babel-fortran-var-to-fortran (pair)
+ "Convert an elisp val into a string of fortran code specifying a var
+of the same value."
+ ;; TODO list support
+ (let ((var (car pair))
+ (val (cdr pair)))
+ (when (symbolp val)
+ (setq val (symbol-name val))
+ (when (= (length val) 1)
+ (setq val (string-to-char val))))
+ (cond
+ ((integerp val)
+ (format "integer, parameter :: %S = %S\n" var val))
+ ((floatp val)
+ (format "real, parameter :: %S = %S\n" var val))
+ ((or (integerp val))
+ (format "character, parameter :: %S = '%S'\n" var val))
+ ((stringp val)
+ (format "character(len=%d), parameter :: %S = '%s'\n"
+ (length val) var val))
+ ;; val is a matrix
+ ((and (listp val) (cl-every #'listp val))
+ (format "real, parameter :: %S(%d,%d) = transpose( reshape( %s , (/ %d, %d /) ) )\n"
+ var (length val) (length (car val))
+ (org-babel-fortran-transform-list val)
+ (length (car val)) (length val)))
+ ((listp val)
+ (format "real, parameter :: %S(%d) = %s\n"
+ var (length val) (org-babel-fortran-transform-list val)))
+ (t
+ (error "The type of parameter %s is not supported by ob-fortran" var)))))
+
+(defun org-babel-fortran-transform-list (val)
+ "Return a fortran representation of enclose syntactic lists."
+ (if (listp val)
+ (concat "(/" (mapconcat #'org-babel-fortran-transform-list val ", ") "/)")
+ (format "%S" val)))
+
+(provide 'ob-fortran)
+
+;;; ob-fortran.el ends here
diff --git a/elpa/org-9.5.2/ob-fortran.elc b/elpa/org-9.5.2/ob-fortran.elc
new file mode 100644
index 0000000..eaca9f8
--- /dev/null
+++ b/elpa/org-9.5.2/ob-fortran.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-gnuplot.el b/elpa/org-9.5.2/ob-gnuplot.el
new file mode 100644
index 0000000..8c4a595
--- /dev/null
+++ b/elpa/org-9.5.2/ob-gnuplot.el
@@ -0,0 +1,299 @@
+;;; ob-gnuplot.el --- Babel Functions for Gnuplot -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Maintainer: Ihor Radchenko <yantar92@gmail.com>
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating gnuplot source code.
+;;
+;; This differs from most standard languages in that
+;;
+;; 1) we are generally only going to return results of type "file"
+;;
+;; 2) we are adding the "file" and "cmdline" header arguments
+
+;;; Requirements:
+
+;; - gnuplot :: https://www.gnuplot.info/
+;;
+;; - gnuplot-mode :: you can search the web for the latest active one.
+
+;;; Code:
+(require 'ob)
+(require 'org-macs)
+
+(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))
+(declare-function gnuplot-send-buffer-to-gnuplot "ext:gnuplot-mode" ())
+
+(defvar org-babel-temporary-directory)
+
+(defvar org-babel-default-header-args:gnuplot
+ '((:results . "file") (:exports . "results") (:session . nil))
+ "Default arguments to use when evaluating a gnuplot source block.")
+
+(defvar org-babel-header-args:gnuplot
+ '((title . :any)
+ (lines . :any)
+ (sets . :any)
+ (x-labels . :any)
+ (y-labels . :any)
+ (timefmt . :any)
+ (time-ind . :any)
+ (missing . :any)
+ (term . :any))
+ "Gnuplot specific header args.")
+
+(defvar org-babel-gnuplot-timestamp-fmt nil) ; Dynamically scoped.
+
+(defvar *org-babel-gnuplot-missing* nil)
+
+(defcustom *org-babel-gnuplot-terms*
+ '((eps . "postscript eps"))
+ "List of file extensions and the associated gnuplot terminal."
+ :group 'org-babel
+ :type '(repeat (cons (symbol :tag "File extension")
+ (string :tag "Gnuplot terminal"))))
+
+(defun org-babel-gnuplot-process-vars (params)
+ "Extract variables from PARAMS and process the variables.
+Dumps all vectors into files and returns an association list
+of variable names and the related value to be used in the gnuplot
+code."
+ (let ((*org-babel-gnuplot-missing* (cdr (assq :missing params))))
+ (mapcar
+ (lambda (pair)
+ (cons
+ (car pair) ;; variable name
+ (let* ((val (cdr pair)) ;; variable value
+ (lp (proper-list-p val)))
+ (if lp
+ (org-babel-gnuplot-table-to-data
+ (let* ((first (car val))
+ (tablep (or (listp first) (symbolp first))))
+ (if tablep val (mapcar 'list val)))
+ (org-babel-temp-file "gnuplot-") params)
+ (if (and (stringp val)
+ (file-remote-p val) ;; check if val is a remote file
+ (file-exists-p val)) ;; call to file-exists-p is slow, maybe remove it
+ (let* ((local-name (concat ;; create a unique filename to avoid multiple downloads
+ org-babel-temporary-directory
+ "/gnuplot/"
+ (file-remote-p val 'host)
+ (org-babel-local-file-name val))))
+ (if (and (file-exists-p local-name) ;; only download file if remote is newer
+ (file-newer-than-file-p local-name val))
+ local-name
+ (make-directory (file-name-directory local-name) t)
+ (copy-file val local-name t)
+ ))
+ val
+ )))))
+ (org-babel--get-vars params))))
+
+(defun org-babel-expand-body:gnuplot (body params)
+ "Expand BODY according to PARAMS, return the expanded body."
+ (save-window-excursion
+ (let* ((vars (org-babel-gnuplot-process-vars params))
+ (out-file (cdr (assq :file params)))
+ (prologue (cdr (assq :prologue params)))
+ (epilogue (cdr (assq :epilogue params)))
+ (term (or (cdr (assq :term params))
+ (when out-file
+ (let ((ext (file-name-extension out-file)))
+ (or (cdr (assoc (intern (downcase ext))
+ *org-babel-gnuplot-terms*))
+ ext)))))
+ (title (cdr (assq :title params)))
+ (lines (cdr (assq :line params)))
+ (sets (cdr (assq :set params)))
+ (x-labels (cdr (assq :xlabels params)))
+ (y-labels (cdr (assq :ylabels params)))
+ (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)))
+ (when lines (mapc (lambda (el) (funcall add-to-body el)) lines))
+ (when sets
+ (mapc (lambda (el) (funcall add-to-body (format "set %s" el))) sets))
+ (when x-labels
+ (funcall add-to-body
+ (format "set xtics (%s)"
+ (mapconcat (lambda (pair)
+ (format "\"%s\" %d"
+ (cdr pair) (car pair)))
+ x-labels ", "))))
+ (when y-labels
+ (funcall add-to-body
+ (format "set ytics (%s)"
+ (mapconcat (lambda (pair)
+ (format "\"%s\" %d"
+ (cdr pair) (car pair)))
+ y-labels ", "))))
+ (when time-ind
+ (funcall add-to-body "set xdata time")
+ (funcall add-to-body (concat "set timefmt \""
+ (or timefmt
+ "%Y-%m-%d-%H:%M:%S") "\"")))
+ (when out-file
+ ;; set the terminal at the top of the block
+ (funcall add-to-body (format "set output \"%s\"" out-file))
+ ;; and close the terminal at the bottom of the block
+ (setq body (concat body "\nset output\n")))
+ (when term (funcall add-to-body (format "set term %s" term)))
+ ;; insert variables into code body: this should happen last
+ ;; placing the variables at the *top* of the code in case their
+ ;; values are used later
+ (funcall add-to-body
+ (mapconcat #'identity
+ (org-babel-variable-assignments:gnuplot params)
+ "\n"))
+ ;; replace any variable names preceded by '$' with the actual
+ ;; value of the variable
+ (mapc (lambda (pair)
+ (setq body (replace-regexp-in-string
+ (format "\\$%s" (car pair)) (cdr pair) body)))
+ vars)
+ (when prologue (funcall add-to-body prologue))
+ (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)
+ "Execute a block of Gnuplot code.
+This function is called by `org-babel-execute-src-block'."
+ (require 'gnuplot)
+ (let ((session (cdr (assq :session params)))
+ (result-type (cdr (assq :results params)))
+ (body (org-babel-expand-body:gnuplot body params))
+ output)
+ (save-window-excursion
+ ;; evaluate the code body with gnuplot
+ (if (string= session "none")
+ (let ((script-file (org-babel-temp-file "gnuplot-script-")))
+ (with-temp-file script-file
+ (insert (concat body "\n")))
+ (message "gnuplot \"%s\"" script-file)
+ (setq output
+ (shell-command-to-string
+ (format
+ "gnuplot \"%s\""
+ (org-babel-process-file-name
+ script-file
+ (if (member system-type '(cygwin windows-nt ms-dos))
+ t nil)))))
+ (message "%s" output))
+ (with-temp-buffer
+ (insert (concat body "\n"))
+ (gnuplot-mode)
+ (gnuplot-send-buffer-to-gnuplot)))
+ (if (member "output" (split-string result-type))
+ output
+ nil)))) ;; signal that output has already been written to file
+
+(defun org-babel-prep-session:gnuplot (session params)
+ "Prepare SESSION according to the header arguments in PARAMS."
+ (let* ((session (org-babel-gnuplot-initiate-session session))
+ (var-lines (org-babel-variable-assignments:gnuplot params)))
+ (message "%S" session)
+ (org-babel-comint-in-buffer session
+ (dolist (var-line var-lines)
+ (insert var-line)
+ (comint-send-input nil t)
+ (org-babel-comint-wait-for-output session)
+ (sit-for .1)
+ (goto-char (point-max))))
+ session))
+
+(defun org-babel-load-session:gnuplot (session body params)
+ "Load BODY into SESSION."
+ (save-window-excursion
+ (let ((buffer (org-babel-prep-session:gnuplot session params)))
+ (with-current-buffer buffer
+ (goto-char (process-mark (get-buffer-process (current-buffer))))
+ (insert (org-babel-chomp body)))
+ buffer)))
+
+(defun org-babel-variable-assignments:gnuplot (params)
+ "Return list of gnuplot statements assigning the block's variables."
+ (mapcar
+ (lambda (pair) (format "%s = \"%s\"" (car pair) (cdr pair)))
+ (org-babel-gnuplot-process-vars params)))
+
+(defvar gnuplot-buffer)
+(defun org-babel-gnuplot-initiate-session (&optional session _params)
+ "Initiate a gnuplot session.
+If there is not a current inferior-process-buffer in SESSION
+then create one. Return the initialized session. The current
+`gnuplot-mode' doesn't provide support for multiple sessions."
+ (require 'gnuplot)
+ (unless (string= session "none")
+ (save-window-excursion
+ (gnuplot-send-string-to-gnuplot "" "line")
+ gnuplot-buffer)))
+
+(defun org-babel-gnuplot-quote-timestamp-field (s)
+ "Convert S from timestamp to Unix time and export to gnuplot."
+ (format-time-string org-babel-gnuplot-timestamp-fmt
+ (org-time-string-to-time s)))
+
+(defvar org-table-number-regexp)
+(defvar org-ts-regexp3)
+(defun org-babel-gnuplot-quote-tsv-field (s)
+ "Quote S for export to gnuplot."
+ (unless (stringp s)
+ (setq s (format "%s" s)))
+ (if (string-match org-table-number-regexp s) s
+ (if (string-match org-ts-regexp3 s)
+ (org-babel-gnuplot-quote-timestamp-field s)
+ (if (zerop (length s))
+ (or *org-babel-gnuplot-missing* s)
+ (if (string-match "[ \"]" s)
+ (concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"")
+ "\"")
+ s)))))
+
+(defun org-babel-gnuplot-table-to-data (table data-file params)
+ "Export TABLE to DATA-FILE in a format readable by gnuplot.
+Pass PARAMS through to `orgtbl-to-generic' when exporting TABLE."
+ (with-temp-file data-file
+ (insert (let ((org-babel-gnuplot-timestamp-fmt
+ (or (plist-get params :timefmt) "%Y-%m-%d-%H:%M:%S")))
+ (orgtbl-to-generic
+ table
+ (org-combine-plists
+ '(:sep "\t" :fmt org-babel-gnuplot-quote-tsv-field :raw t :backend ascii)
+ params)))))
+ data-file)
+
+(provide 'ob-gnuplot)
+
+;;; ob-gnuplot.el ends here
diff --git a/elpa/org-9.5.2/ob-gnuplot.elc b/elpa/org-9.5.2/ob-gnuplot.elc
new file mode 100644
index 0000000..67dffd2
--- /dev/null
+++ b/elpa/org-9.5.2/ob-gnuplot.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-groovy.el b/elpa/org-9.5.2/ob-groovy.el
new file mode 100644
index 0000000..b3ff34a
--- /dev/null
+++ b/elpa/org-9.5.2/ob-groovy.el
@@ -0,0 +1,113 @@
+;;; ob-groovy.el --- Babel Functions for Groovy -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
+
+;; Author: Miro Bezjak
+;; Maintainer: Palak Mathur
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Currently only supports the external execution. No session support yet.
+
+;;; Requirements:
+;; - Groovy language :: https://groovy-lang.org
+;; - Groovy major mode :: Can be installed from MELPA or
+;; https://github.com/russel/Emacs-Groovy-Mode
+
+;;; Code:
+(require 'ob)
+
+(defvar org-babel-tangle-lang-exts) ;; Autoloaded
+(add-to-list 'org-babel-tangle-lang-exts '("groovy" . "groovy"))
+(defvar org-babel-default-header-args:groovy '())
+(defcustom org-babel-groovy-command "groovy"
+ "Name of the command to use for executing Groovy code.
+May be either a command in the path, like groovy
+or an absolute path name, like /usr/local/bin/groovy
+parameters may be used, like groovy -v"
+ :group 'org-babel
+ :version "24.3"
+ :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'."
+ (message "executing Groovy source code block")
+ (let* ((processed-params (org-babel-process-params params))
+ (session (org-babel-groovy-initiate-session (nth 0 processed-params)))
+ (result-params (nth 2 processed-params))
+ (result-type (cdr (assq :result-type params)))
+ (full-body (org-babel-expand-body:generic
+ body params))
+ (result (org-babel-groovy-evaluate
+ session full-body result-type result-params)))
+
+ (org-babel-reassemble-table
+ result
+ (org-babel-pick-name
+ (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
+ (org-babel-pick-name
+ (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))
+
+(defvar org-babel-groovy-wrapper-method
+ "class Runner extends Script {
+ def out = new PrintWriter(new ByteArrayOutputStream())
+ def run() { %s }
+}
+
+println(new Runner().run())
+")
+
+(defun org-babel-groovy-evaluate
+ (session body &optional result-type result-params)
+ "Evaluate BODY in external Groovy process.
+If RESULT-TYPE equals `output' then return standard output as a string.
+If RESULT-TYPE equals `value' then return the value of the last statement
+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_")))
+ (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_"))
+ (wrapper (format org-babel-groovy-wrapper-method body)))
+ (with-temp-file src-file (insert wrapper))
+ (let ((raw (org-babel-eval
+ (concat org-babel-groovy-command " " src-file) "")))
+ (org-babel-result-cond result-params
+ raw
+ (org-babel-script-escape raw)))))))
+
+
+(defun org-babel-prep-session:groovy (_session _params)
+ "Prepare SESSION according to the header arguments specified in PARAMS."
+ (error "Sessions are not (yet) supported for Groovy"))
+
+(defun org-babel-groovy-initiate-session (&optional _session)
+ "If there is not a current inferior-process-buffer in SESSION
+then create. Return the initialized session. Sessions are not
+supported in Groovy."
+ nil)
+
+(provide 'ob-groovy)
+
+;;; ob-groovy.el ends here
diff --git a/elpa/org-9.5.2/ob-groovy.elc b/elpa/org-9.5.2/ob-groovy.elc
new file mode 100644
index 0000000..2c1bbc4
--- /dev/null
+++ b/elpa/org-9.5.2/ob-groovy.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-haskell.el b/elpa/org-9.5.2/ob-haskell.el
new file mode 100644
index 0000000..971e1ce
--- /dev/null
+++ b/elpa/org-9.5.2/ob-haskell.el
@@ -0,0 +1,281 @@
+;;; ob-haskell.el --- Babel Functions for Haskell -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Maintainer: Lawrence Bottorff <borgauf@gmail.com>
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org Babel support for evaluating Haskell source code.
+;; Haskell programs must be compiled before
+;; they can be run, but haskell code can also be run through an
+;; interactive interpreter.
+;;
+;; By default we evaluate using the Haskell interpreter.
+;; To use the compiler, specify :compile yes in the header.
+
+;;; Requirements:
+
+;; - haskell-mode: https://www.iro.umontreal.ca/~monnier/elisp/#haskell-mode
+;; - inf-haskell: https://www.iro.umontreal.ca/~monnier/elisp/#haskell-mode
+;; - (optionally) lhs2tex: https://people.cs.uu.nl/andres/lhs2tex/
+
+;;; Code:
+(require 'ob)
+(require 'org-macs)
+(require 'comint)
+
+(declare-function haskell-mode "ext:haskell-mode" ())
+(declare-function run-haskell "ext:inf-haskell" (&optional arg))
+(declare-function inferior-haskell-load-file
+ "ext:inf-haskell" (&optional reload))
+(declare-function org-entry-get "org" (pom property &optional inherit literal-nil))
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("haskell" . "hs"))
+
+(defvar org-babel-default-header-args:haskell
+ '((:padlines . "no")))
+
+(defvar org-babel-haskell-lhs2tex-command "lhs2tex")
+
+(defvar org-babel-haskell-eoe "\"org-babel-haskell-eoe\"")
+
+(defvar haskell-prompt-regexp)
+
+(defcustom org-babel-haskell-compiler "ghc"
+ "Command used to compile a Haskell source code file into an executable.
+May be either a command in the path, like \"ghc\" or an absolute
+path name, like \"/usr/local/bin/ghc\". The command can include
+a parameter, such as \"ghc -v\"."
+ :group 'org-babel
+ :package-version '(Org "9.4")
+ :type 'string)
+
+(defconst org-babel-header-args:haskell '((compile . :any))
+ "Haskell-specific header arguments.")
+
+(defun org-babel-haskell-execute (body params)
+ "This function should only be called by `org-babel-execute:haskell'."
+ (let* ((tmp-src-file (org-babel-temp-file "Haskell-src-" ".hs"))
+ (tmp-bin-file
+ (org-babel-process-file-name
+ (org-babel-temp-file "Haskell-bin-" org-babel-exeext)))
+ (cmdline (cdr (assq :cmdline params)))
+ (cmdline (if cmdline (concat " " cmdline) ""))
+ (flags (cdr (assq :flags params)))
+ (flags (mapconcat #'identity
+ (if (listp flags)
+ flags
+ (list flags))
+ " "))
+ (libs (org-babel-read
+ (or (cdr (assq :libs params))
+ (org-entry-get nil "libs" t))
+ nil))
+ (libs (mapconcat #'identity
+ (if (listp libs) libs (list libs))
+ " ")))
+ (with-temp-file tmp-src-file (insert body))
+ (org-babel-eval
+ (format "%s -o %s %s %s %s"
+ org-babel-haskell-compiler
+ tmp-bin-file
+ flags
+ (org-babel-process-file-name tmp-src-file)
+ libs)
+ "")
+ (let ((results (org-babel-eval (concat tmp-bin-file cmdline) "")))
+ (when results
+ (setq results (org-trim (org-remove-indentation results)))
+ (org-babel-reassemble-table
+ (org-babel-result-cond (cdr (assq :result-params params))
+ (org-babel-read results t)
+ (let ((tmp-file (org-babel-temp-file "Haskell-")))
+ (with-temp-file tmp-file (insert results))
+ (org-babel-import-elisp-from-file tmp-file)))
+ (org-babel-pick-name
+ (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
+ (org-babel-pick-name
+ (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))))
+
+(defun org-babel-interpret-haskell (body params)
+ (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-strip-quotes
+ (cdr (member org-babel-haskell-eoe
+ (reverse (mapcar #'org-trim raw)))))))
+ (org-babel-reassemble-table
+ (let ((result
+ (pcase result-type
+ (`output (mapconcat #'identity (reverse results) "\n"))
+ (`value (car results)))))
+ (org-babel-result-cond (cdr (assq :result-params params))
+ result (org-babel-script-escape result)))
+ (org-babel-pick-name (cdr (assq :colname-names params))
+ (cdr (assq :colname-names params)))
+ (org-babel-pick-name (cdr (assq :rowname-names params))
+ (cdr (assq :rowname-names params))))))
+
+(defun org-babel-execute:haskell (body params)
+ "Execute a block of Haskell code."
+ (let ((compile (string= "yes" (cdr (assq :compile params)))))
+ (if (not compile)
+ (org-babel-interpret-haskell body params)
+ (org-babel-haskell-execute body params))))
+
+(defun org-babel-haskell-initiate-session (&optional _session _params)
+ "Initiate a haskell session.
+If there is not a current inferior-process-buffer in SESSION
+then create one. Return the initialized session."
+ (require 'inf-haskell)
+ (or (get-buffer "*haskell*")
+ (save-window-excursion (run-haskell) (sleep-for 0.25) (current-buffer))))
+
+(defun org-babel-load-session:haskell (session body params)
+ "Load BODY into SESSION."
+ (save-window-excursion
+ (let* ((buffer (org-babel-prep-session:haskell session params))
+ (load-file (concat (org-babel-temp-file "haskell-load-") ".hs")))
+ (with-temp-buffer
+ (insert body) (write-file load-file)
+ (haskell-mode) (inferior-haskell-load-file))
+ buffer)))
+
+(defun org-babel-prep-session:haskell (session params)
+ "Prepare SESSION according to the header arguments in PARAMS."
+ (save-window-excursion
+ (let ((buffer (org-babel-haskell-initiate-session session)))
+ (org-babel-comint-in-buffer buffer
+ (mapc (lambda (line)
+ (insert line)
+ (comint-send-input nil t))
+ (org-babel-variable-assignments:haskell params)))
+ (current-buffer))))
+
+(defun org-babel-variable-assignments:haskell (params)
+ "Return list of haskell statements assigning the block's variables."
+ (mapcar (lambda (pair)
+ (format "let %s = %s"
+ (car pair)
+ (org-babel-haskell-var-to-haskell (cdr pair))))
+ (org-babel--get-vars params)))
+
+(defun org-babel-haskell-var-to-haskell (var)
+ "Convert an elisp value VAR into a haskell variable.
+The elisp VAR is converted to a string of haskell source code
+specifying a variable of the same value."
+ (if (listp var)
+ (concat "[" (mapconcat #'org-babel-haskell-var-to-haskell var ", ") "]")
+ (format "%S" var)))
+
+(defvar org-export-copy-to-kill-ring)
+(declare-function org-export-to-file "ox"
+ (backend file
+ &optional async subtreep visible-only body-only
+ ext-plist post-process))
+(defun org-babel-haskell-export-to-lhs (&optional arg)
+ "Export to a .lhs file with all haskell code blocks escaped.
+When called with a prefix argument the resulting
+.lhs file will be exported to a .tex file. This function will
+create two new files, base-name.lhs and base-name.tex where
+base-name is the name of the current Org file.
+
+Note that all standard Babel literate programming
+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]"
+ "\\([^\000]*?\\)[\r\n][ \t]*#\\+end_src.*"))
+ (base-name (file-name-sans-extension (buffer-file-name)))
+ (tmp-file (org-babel-temp-file "haskell-"))
+ (tmp-org-file (concat tmp-file ".org"))
+ (tmp-tex-file (concat tmp-file ".tex"))
+ (lhs-file (concat base-name ".lhs"))
+ (tex-file (concat base-name ".tex"))
+ (command (concat org-babel-haskell-lhs2tex-command
+ " " (org-babel-process-file-name lhs-file)
+ " > " (org-babel-process-file-name tex-file)))
+ (preserve-indentp org-src-preserve-indentation)
+ indentation)
+ ;; escape haskell source-code blocks
+ (with-temp-file tmp-org-file
+ (insert contents)
+ (goto-char (point-min))
+ (while (re-search-forward haskell-regexp nil t)
+ (save-match-data (setq indentation (length (match-string 1))))
+ (replace-match (save-match-data
+ (concat
+ "#+begin_export latex\n\\begin{code}\n"
+ (if (or preserve-indentp
+ (string-match "-i" (match-string 2)))
+ (match-string 3)
+ (org-remove-indentation (match-string 3)))
+ "\n\\end{code}\n#+end_export\n"))
+ t t)
+ (indent-code-rigidly (match-beginning 0) (match-end 0) indentation)))
+ (save-excursion
+ ;; export to latex w/org and save as .lhs
+ (require 'ox-latex)
+ (find-file tmp-org-file)
+ ;; Ensure we do not clutter kill ring with incomplete results.
+ (let (org-export-copy-to-kill-ring)
+ (org-export-to-file 'latex tmp-tex-file))
+ (kill-buffer nil)
+ (delete-file tmp-org-file)
+ (find-file tmp-tex-file)
+ (goto-char (point-min)) (forward-line 2)
+ (insert "%include polycode.fmt\n")
+ ;; ensure all \begin/end{code} statements start at the first column
+ (while (re-search-forward "^[ \t]+\\\\begin{code}[^\000]+\\\\end{code}" nil t)
+ (replace-match (save-match-data (org-remove-indentation (match-string 0)))
+ t t))
+ (setq contents (buffer-string))
+ (save-buffer) (kill-buffer nil))
+ (delete-file tmp-tex-file)
+ ;; save org exported latex to a .lhs file
+ (with-temp-file lhs-file (insert contents))
+ (if (not arg)
+ (find-file lhs-file)
+ ;; process .lhs file with lhs2tex
+ (message "running %s" command) (shell-command command) (find-file tex-file))))
+
+(provide 'ob-haskell)
+
+;;; ob-haskell.el ends here
diff --git a/elpa/org-9.5.2/ob-haskell.elc b/elpa/org-9.5.2/ob-haskell.elc
new file mode 100644
index 0000000..595e2b8
--- /dev/null
+++ b/elpa/org-9.5.2/ob-haskell.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-java.el b/elpa/org-9.5.2/ob-java.el
new file mode 100644
index 0000000..dd35387
--- /dev/null
+++ b/elpa/org-9.5.2/ob-java.el
@@ -0,0 +1,490 @@
+;;; ob-java.el --- org-babel functions for java evaluation -*- lexical-binding: t -*-
+
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+;; Authors: Eric Schulte
+;; Dan Davison
+;; Maintainer: Ian Martins <ianxm@jhu.edu>
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating java source code.
+
+;;; Code:
+(require 'ob)
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("java" . "java"))
+
+(defvar org-babel-temporary-directory) ; from ob-core
+
+(defvar org-babel-default-header-args:java '((:results . "output")
+ (:dir . "."))
+ "Default header args for java source blocks.
+The docs say functional mode should be the default [1], but
+ob-java didn't originally support functional mode, so we keep
+scripting mode as the default for now to maintain previous
+behavior.
+
+Most languages write tempfiles to babel's temporary directory,
+but ob-java originally had to write them to the current
+directory, so we keep that as the default behavior.
+
+[1] https://orgmode.org/manual/Results-of-Evaluation.html")
+
+(defconst org-babel-header-args:java '((imports . :any))
+ "Java-specific header arguments.")
+
+(defcustom org-babel-java-command "java"
+ "Name of the java command.
+May be either a command in the path, like java or an absolute
+path name, like /usr/local/bin/java. Parameters may be used,
+like java -verbose."
+ :group 'org-babel
+ :package-version '(Org . "9.5")
+ :type 'string)
+
+(defcustom org-babel-java-compiler "javac"
+ "Name of the java compiler.
+May be either a command in the path, like javac or an absolute
+path name, like /usr/local/bin/javac. Parameters may be used,
+like javac -verbose."
+ :group 'org-babel
+ :package-version '(Org . "9.5")
+ :type 'string)
+
+(defcustom org-babel-java-hline-to "null"
+ "Replace hlines in incoming tables with this when translating to java."
+ :group 'org-babel
+ :package-version '(Org . "9.5")
+ :type 'string)
+
+(defcustom org-babel-java-null-to 'hline
+ "Replace `null' in java tables with this before returning."
+ :group 'org-babel
+ :package-version '(Org . "9.5")
+ :type 'symbol)
+
+(defconst org-babel-java--package-re (rx line-start (0+ space) "package"
+ (1+ space) (group (1+ (in alnum ?_ ?.))) ; capture the package name
+ (0+ space) ?\; line-end)
+ "Regexp for the package statement.")
+(defconst org-babel-java--imports-re (rx line-start (0+ space) "import"
+ (opt (1+ space) "static")
+ (1+ space) (group (1+ (in alnum ?_ ?. ?*))) ; capture the fully qualified class name
+ (0+ space) ?\; line-end)
+ "Regexp for import statements.")
+(defconst org-babel-java--class-re (rx line-start (0+ space) (opt (seq "public" (1+ space)))
+ "class" (1+ space)
+ (group (1+ (in alnum ?_))) ; capture the class name
+ (0+ space) ?{)
+ "Regexp for the class declaration.")
+(defconst org-babel-java--main-re
+ (rx line-start (0+ space) "public"
+ (1+ space) "static"
+ (1+ space) "void"
+ (1+ space) "main"
+ (0+ space) ?\(
+ (0+ space) "String"
+ (1+ (in alnum ?_ ?\[ ?\] space)) ; "[] args" or "args[]"
+ ?\)
+ (0+ space) (opt "throws" (1+ (in alnum ?_ ?, ?. space)))
+ ?{)
+ "Regexp for the main method declaration.")
+(defconst org-babel-java--any-method-re
+ (rx line-start
+ (0+ space) (opt (seq (1+ alnum) (1+ space))) ; visibility
+ (opt (seq "static" (1+ space))) ; binding
+ (1+ (in alnum ?_ ?\[ ?\])) ; return type
+ (1+ space) (1+ (in alnum ?_)) ; method name
+ (0+ space) ?\(
+ (0+ (in alnum ?_ ?\[ ?\] ?, space)) ; params
+ ?\)
+ (0+ space) (opt "throws" (1+ (in alnum ?_ ?, ?. space)))
+ ?{)
+ "Regexp for any method.")
+(defconst org-babel-java--result-wrapper "\n public static String __toString(Object val) {
+ if (val instanceof String) {
+ return \"\\\"\" + val + \"\\\"\";
+ } else if (val == null) {
+ return \"null\";
+ } else if (val.getClass().isArray()) {
+ StringBuffer sb = new StringBuffer();
+ Object[] vals = (Object[])val;
+ sb.append(\"[\");
+ for (int ii=0; ii<vals.length; ii++) {
+ sb.append(__toString(vals[ii]));
+ if (ii<vals.length-1)
+ sb.append(\",\");
+ }
+ sb.append(\"]\");
+ return sb.toString();
+ } else if (val instanceof List) {
+ StringBuffer sb = new StringBuffer();
+ List vals = (List)val;
+ sb.append(\"[\");
+ for (int ii=0; ii<vals.size(); ii++) {
+ sb.append(__toString(vals.get(ii)));
+ if (ii<vals.size()-1)
+ sb.append(\",\");
+ }
+ sb.append(\"]\");
+ return sb.toString();
+ } else {
+ return String.valueOf(val);
+ }
+ }
+
+ public static void main(String[] args) throws IOException {
+ BufferedWriter output = new BufferedWriter(new FileWriter(\"%s\"));
+ output.write(__toString(_main(args)));
+ output.close();
+ }"
+ "Code to inject into a class so that we can capture the value it returns.
+This implementation was inspired by ob-python, although not as
+elegant. This modified the source block to write out the value
+it wants to return to a temporary file so that ob-java can read
+it back. The name of the temporary file to write must be
+replaced in this string.")
+
+(defun org-babel-execute:java (body params)
+ "Execute a java source block with BODY code and PARAMS params."
+ (let* (;; allow header overrides
+ (org-babel-java-compiler
+ (or (cdr (assq :javac params))
+ org-babel-java-compiler))
+ (org-babel-java-command
+ (or (cdr (assq :java params))
+ org-babel-java-command))
+ ;; if true, run from babel temp directory
+ (run-from-temp (not (cdr (assq :dir params))))
+ ;; class and package
+ (fullclassname (or (cdr (assq :classname params))
+ (org-babel-java-find-classname body)))
+ ;; just the class name
+ (classname (car (last (split-string fullclassname "\\."))))
+ ;; just the package name
+ (packagename (if (string-match-p "\\." fullclassname)
+ (file-name-base fullclassname)))
+ ;; the base dir that contains the top level package dir
+ (basedir (file-name-as-directory (if run-from-temp
+ (if (file-remote-p default-directory)
+ (concat
+ (file-remote-p default-directory)
+ org-babel-remote-temporary-directory)
+ org-babel-temporary-directory)
+ default-directory)))
+ ;; the dir to write the source file
+ (packagedir (if (and (not run-from-temp) packagename)
+ (file-name-as-directory
+ (concat basedir (replace-regexp-in-string "\\." "/" packagename)))
+ basedir))
+ ;; the filename of the source file
+ (src-file (concat packagedir classname ".java"))
+ ;; compiler flags
+ (cmpflag (or (cdr (assq :cmpflag params)) ""))
+ ;; runtime flags
+ (cmdline (or (cdr (assq :cmdline params)) ""))
+ ;; command line args
+ (cmdargs (or (cdr (assq :cmdargs params)) ""))
+ ;; the command to compile and run
+ (cmd (concat org-babel-java-compiler " " cmpflag " "
+ (org-babel-process-file-name src-file 'noquote)
+ " && " org-babel-java-command
+ " -cp " (org-babel-process-file-name basedir 'noquote)
+ " " cmdline " " (if run-from-temp classname fullclassname)
+ " " cmdargs))
+ ;; header args for result processing
+ (result-type (cdr (assq :result-type params)))
+ (result-params (cdr (assq :result-params params)))
+ (result-file (and (eq result-type 'value)
+ (org-babel-temp-file "java-")))
+ ;; the expanded body of the source block
+ (full-body (org-babel-expand-body:java body params)))
+
+ ;; created package-name directories if missing
+ (unless (or (not packagedir) (file-exists-p packagedir))
+ (make-directory packagedir 'parents))
+
+ ;; write the source file
+ (setq full-body (org-babel-java--expand-for-evaluation
+ full-body run-from-temp result-type result-file))
+ (with-temp-file src-file (insert full-body))
+
+ ;; compile, run, process result
+ (org-babel-reassemble-table
+ (org-babel-java-evaluate cmd result-type result-params result-file)
+ (org-babel-pick-name
+ (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
+ (org-babel-pick-name
+ (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))))
+
+;; helper functions
+
+(defun org-babel-java-find-classname (body)
+ "Try to find fully qualified class name in BODY.
+Look through BODY for the package and class. If found, put them
+together into a fully qualified class name and return. Else just
+return class name. If that isn't found either, default to Main."
+ (let ((package (if (string-match org-babel-java--package-re body)
+ (match-string 1 body)))
+ (class (if (string-match org-babel-java--class-re body)
+ (match-string 1 body))))
+ (or (and package class (concat package "." class))
+ (and class class)
+ (and package (concat package ".Main"))
+ "Main")))
+
+(defun org-babel-java--expand-for-evaluation (body suppress-package-p result-type result-file)
+ "Expand source block for evaluation.
+In order to return a value we have to add a __toString method.
+In order to prevent classes without main methods from erroring we
+add a dummy main method if one is not provided. These
+manipulations are done outside of `org-babel--expand-body' so
+that they are hidden from tangles.
+
+BODY is the file content before instrumentation.
+
+SUPPRESS-PACKAGE-P if true, suppress the package statement.
+
+RESULT-TYPE is taken from params.
+
+RESULT-FILE is the temp file to write the result."
+ (with-temp-buffer
+ (insert body)
+
+ ;; suppress package statement
+ (goto-char (point-min))
+ (when (and suppress-package-p
+ (re-search-forward org-babel-java--package-re nil t))
+ (replace-match ""))
+
+ ;; add a dummy main method if needed
+ (goto-char (point-min))
+ (when (not (re-search-forward org-babel-java--main-re nil t))
+ (org-babel-java--move-past org-babel-java--class-re)
+ (insert "\n public static void main(String[] args) {
+ System.out.print(\"success\");
+ }\n\n"))
+
+ ;; special handling to return value
+ (when (eq result-type 'value)
+ (goto-char (point-min))
+ (org-babel-java--move-past org-babel-java--class-re)
+ (insert (format org-babel-java--result-wrapper
+ (org-babel-process-file-name result-file 'noquote)))
+ (search-forward "public static void main(") ; rename existing main
+ (replace-match "public static Object _main("))
+
+ ;; add imports
+ (org-babel-java--import-maybe "java.util" "List")
+ (org-babel-java--import-maybe "java.util" "Arrays")
+ (org-babel-java--import-maybe "java.io" "BufferedWriter")
+ (org-babel-java--import-maybe "java.io" "FileWriter")
+ (org-babel-java--import-maybe "java.io" "IOException")
+
+ (buffer-string)))
+
+(defun org-babel-java--move-past (re)
+ "Move point past the first occurrence of the given regexp RE."
+ (while (re-search-forward re nil t)
+ (goto-char (1+ (match-end 0)))))
+
+(defun org-babel-java--import-maybe (package class)
+ "Import from PACKAGE the given CLASS if it is used and not already imported."
+ (let (class-found import-found)
+ (goto-char (point-min))
+ (setq class-found (re-search-forward class nil t))
+ (goto-char (point-min))
+ (setq import-found
+ (re-search-forward (concat "^import .*" package ".*\\(?:\\*\\|" class "\\);") nil t))
+ (when (and class-found (not import-found))
+ (org-babel-java--move-past org-babel-java--package-re)
+ (insert (concat "import " package "." class ";\n")))))
+
+(defun org-babel-expand-body:java (body params)
+ "Expand BODY with PARAMS.
+BODY could be a few statements, or could include a full class
+definition specifying package, imports, and class. Because we
+allow this flexibility in what the source block can contain, it
+is simplest to expand the code block from the inside out."
+ (let* ((fullclassname (or (cdr (assq :classname params)) ; class and package
+ (org-babel-java-find-classname body)))
+ (classname (car (last (split-string fullclassname "\\.")))) ; just class name
+ (packagename (if (string-match-p "\\." fullclassname) ; just package name
+ (file-name-base fullclassname)))
+ (var-lines (org-babel-variable-assignments:java params))
+ (imports-val (assq :imports params))
+ (imports (if imports-val
+ (split-string (org-babel-read (cdr imports-val) nil) " ")
+ nil)))
+ (with-temp-buffer
+ (insert body)
+
+ ;; wrap main. If there are methods defined, but no main method
+ ;; and no class, wrap everything in a generic main method.
+ (goto-char (point-min))
+ (when (and (not (re-search-forward org-babel-java--main-re nil t))
+ (not (re-search-forward org-babel-java--any-method-re nil t)))
+ (org-babel-java--move-past org-babel-java--package-re) ; if package is defined, move past it
+ (org-babel-java--move-past org-babel-java--imports-re) ; if imports are defined, move past them
+ (insert "public static void main(String[] args) {\n")
+ (indent-code-rigidly (point) (point-max) 4)
+ (goto-char (point-max))
+ (insert "\n}"))
+
+ ;; wrap class. If there's no class, wrap everything in a
+ ;; generic class.
+ (goto-char (point-min))
+ (when (not (re-search-forward org-babel-java--class-re nil t))
+ (org-babel-java--move-past org-babel-java--package-re) ; if package is defined, move past it
+ (org-babel-java--move-past org-babel-java--imports-re) ; if imports are defined, move past them
+ (insert (concat "\npublic class " (file-name-base classname) " {\n"))
+ (indent-code-rigidly (point) (point-max) 4)
+ (goto-char (point-max))
+ (insert "\n}"))
+ (goto-char (point-min))
+
+ ;; insert variables from source block headers
+ (when var-lines
+ (goto-char (point-min))
+ (org-babel-java--move-past org-babel-java--class-re) ; move inside class
+ (insert (mapconcat 'identity var-lines "\n"))
+ (insert "\n"))
+
+ ;; add imports from source block headers
+ (when imports
+ (goto-char (point-min))
+ (org-babel-java--move-past org-babel-java--package-re) ; if package is defined, move past it
+ (insert (mapconcat (lambda (package) (concat "import " package ";")) imports "\n") "\n"))
+
+ ;; add package at the top
+ (goto-char (point-min))
+ (when (and packagename (not (re-search-forward org-babel-java--package-re nil t)))
+ (insert (concat "package " packagename ";\n")))
+
+ ;; return expanded body
+ (buffer-string))))
+
+(defun org-babel-variable-assignments:java (params)
+ "Return a list of java statements assigning the block's variables.
+variables are contained in PARAMS."
+ (mapcar
+ (lambda (pair)
+ (let* ((type-data (org-babel-java-val-to-type (cdr pair)))
+ (basetype (car type-data))
+ (var-to-java (lambda (var) (funcall #'org-babel-java-var-to-java var basetype))))
+ (format " static %s %s = %s;"
+ (cdr type-data) ; type
+ (car pair) ; name
+ (funcall var-to-java (cdr pair))))) ; value
+ (org-babel--get-vars params)))
+
+(defun org-babel-java-var-to-java (var basetype)
+ "Convert an elisp value to a java variable.
+Convert an elisp value, VAR, of type BASETYPE into a string of
+java source code specifying a variable of the same value."
+ (cond ((and (sequencep var) (not (stringp var)))
+ (let ((var-to-java (lambda (var) (funcall #'org-babel-java-var-to-java var basetype))))
+ (concat "Arrays.asList(" (mapconcat var-to-java var ", ") ")")))
+ ((eq var 'hline) org-babel-java-hline-to)
+ ((eq basetype 'integerp) (format "%d" var))
+ ((eq basetype 'floatp) (format "%f" var))
+ ((eq basetype 'stringp) (if (and (stringp var) (string-match-p ".\n+." var))
+ (error "Java does not support multiline string literals")
+ (format "\"%s\"" var)))))
+
+(defun org-babel-java-val-to-type (val)
+ "Determine the type of VAL.
+Return (BASETYPE . LISTTYPE), where BASETYPE is a symbol
+representing the type of the individual items in VAL, and
+LISTTYPE is a string name of the type parameter for a container
+for BASETYPE items."
+ (let* ((basetype (org-babel-java-val-to-base-type val))
+ (basetype-str (pcase basetype
+ (`integerp "Integer")
+ (`floatp "Double")
+ (`stringp "String")
+ (_ (error "Unknown type %S" basetype)))))
+ (cond
+ ((and (listp val) (listp (car val))) ; a table
+ (cons basetype (format "List<List<%s>>" basetype-str)))
+ ((or (listp val) (vectorp val)) ; a list declared in the source block header
+ (cons basetype (format "List<%s>" basetype-str)))
+ (t ; return base type
+ (cons basetype basetype-str)))))
+
+(defun org-babel-java-val-to-base-type (val)
+ "Determine the base type of VAL.
+VAL may be
+`integerp' if all base values are integers
+`floatp' if all base values are either floating points or integers
+`stringp' otherwise."
+ (cond
+ ((integerp val) 'integerp)
+ ((floatp val) 'floatp)
+ ((or (listp val) (vectorp val))
+ (let ((type nil))
+ (mapc (lambda (v)
+ (pcase (org-babel-java-val-to-base-type v)
+ (`stringp (setq type 'stringp))
+ (`floatp
+ (when (or (not type) (eq type 'integerp))
+ (setq type 'floatp)))
+ (`integerp
+ (unless type (setq type 'integerp)))))
+ val)
+ type))
+ (t 'stringp)))
+
+(defun org-babel-java-table-or-string (results)
+ "Convert RESULTS into an appropriate elisp value.
+If the results look like a list or vector, then convert them into an
+Emacs-lisp table, otherwise return the results as a string."
+ (let ((res (org-babel-script-escape results)))
+ (if (listp res)
+ (mapcar (lambda (el) (if (eq 'null el)
+ org-babel-java-null-to
+ el))
+ res)
+ res)))
+
+(defun org-babel-java-evaluate (cmd result-type result-params result-file)
+ "Evaluate using an external java process.
+CMD the command to execute.
+
+If RESULT-TYPE equals `output' then return standard output as a
+string. If RESULT-TYPE equals `value' then return the value
+returned by the source block, as elisp.
+
+RESULT-PARAMS input params used to format the response.
+
+RESULT-FILE filename of the tempfile to store the returned value in
+for `value' RESULT-TYPE. Not used for `output' RESULT-TYPE."
+ (let ((raw (pcase result-type
+ (`output (org-babel-eval cmd ""))
+ (`value (org-babel-eval cmd "")
+ (org-babel-eval-read-file result-file)))))
+ (org-babel-result-cond result-params raw
+ (org-babel-java-table-or-string raw))))
+
+(provide 'ob-java)
+
+;;; ob-java.el ends here
diff --git a/elpa/org-9.5.2/ob-java.elc b/elpa/org-9.5.2/ob-java.elc
new file mode 100644
index 0000000..60db736
--- /dev/null
+++ b/elpa/org-9.5.2/ob-java.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-js.el b/elpa/org-9.5.2/ob-js.el
new file mode 100644
index 0000000..5d1be61
--- /dev/null
+++ b/elpa/org-9.5.2/ob-js.el
@@ -0,0 +1,204 @@
+;;; ob-js.el --- Babel Functions for Javascript -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research, js
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Now working with SBCL for both session and external evaluation.
+;;
+;; This certainly isn't optimally robust, but it seems to be working
+;; for the basic use cases.
+
+;;; Requirements:
+
+;; - a non-browser javascript engine such as node.js https://nodejs.org/
+;; or mozrepl https://wiki.github.com/bard/mozrepl/
+;;
+;; - for session based evaluation mozrepl and moz.el are required see
+;; https://wiki.github.com/bard/mozrepl/emacs-integration for
+;; configuration instructions
+
+;;; Code:
+(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.")
+
+(defvar org-babel-js-eoe "org-babel-js-eoe"
+ "String to indicate that evaluation has completed.")
+
+(defcustom org-babel-js-cmd "node"
+ "Name of command used to evaluate js blocks."
+ :group 'org-babel
+ :version "24.1"
+ :type '(choice (const "node")
+ (const "mozrepl")
+ (const "skewer-mode")
+ (const "indium")
+ (const "js-comint"))
+ :safe #'stringp)
+
+(defvar org-babel-js-function-wrapper
+ "require('process').stdout.write(require('util').inspect(function(){%s}()));"
+ "Javascript code to print value of body.")
+
+(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'."
+ (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 (cond
+ ;; no session specified, external evaluation
+ ((string= session "none")
+ (let ((script-file (org-babel-temp-file "js-script-")))
+ (with-temp-file script-file
+ (insert
+ ;; return the value or the output
+ (if (string= result-type "value")
+ (format org-babel-js-function-wrapper full-body)
+ full-body)))
+ (org-babel-eval
+ (format "%s %s" org-babel-js-cmd
+ (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))))
+
+(defun org-babel-js-read (results)
+ "Convert RESULTS into an appropriate elisp value.
+If RESULTS look like a table, then convert them into an
+Emacs-lisp table, otherwise return the results as a string."
+ (org-babel-read
+ (if (and (stringp results)
+ (string-prefix-p "[" results)
+ (string-suffix-p "]" results))
+ (org-babel-read
+ (concat "'"
+ (replace-regexp-in-string
+ "\\[" "(" (replace-regexp-in-string
+ "\\]" ")" (replace-regexp-in-string
+ ",[[:space:]]" " "
+ (replace-regexp-in-string
+ "'" "\"" results))))))
+ results)))
+
+(defun org-babel-js-var-to-js (var)
+ "Convert VAR into a js variable.
+Convert an elisp value into a string of js source code
+specifying a variable of the same value."
+ (if (listp var)
+ (concat "[" (mapconcat #'org-babel-js-var-to-js var ", ") "]")
+ (replace-regexp-in-string "\n" "\\\\n" (format "%S" var))))
+
+(defun org-babel-prep-session:js (session params)
+ "Prepare SESSION according to the header arguments specified in PARAMS."
+ (let* ((session (org-babel-js-initiate-session session))
+ (var-lines (org-babel-variable-assignments:js params)))
+ (when session
+ (org-babel-comint-in-buffer session
+ (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)
+ "Return list of Javascript statements assigning the block's variables."
+ (mapcar
+ (lambda (pair) (format "var %s=%s;"
+ (car pair) (org-babel-js-var-to-js (cdr pair))))
+ (org-babel--get-vars params)))
+
+(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."
+ (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)
+
+;;; ob-js.el ends here
diff --git a/elpa/org-9.5.2/ob-js.elc b/elpa/org-9.5.2/ob-js.elc
new file mode 100644
index 0000000..8043ce2
--- /dev/null
+++ b/elpa/org-9.5.2/ob-js.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-julia.el b/elpa/org-9.5.2/ob-julia.el
new file mode 100644
index 0000000..3176baf
--- /dev/null
+++ b/elpa/org-9.5.2/ob-julia.el
@@ -0,0 +1,333 @@
+;;; ob-julia.el --- org-babel functions for julia code evaluation -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
+;; Authors: G. Jay Kerns
+;; Maintainer: Pedro Bruel <pedro.bruel@gmail.com>
+;; Keywords: literate programming, reproducible research, scientific computing
+;; Homepage: https://github.com/phrb/ob-julia
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating julia code
+;;
+;; Based on ob-R.el by Eric Schulte and Dan Davison.
+
+;;; Code:
+(require 'cl-lib)
+(require 'ob)
+
+(declare-function orgtbl-to-csv "org-table" (table params))
+(declare-function julia "ext:ess-julia" (&optional start-args))
+(declare-function inferior-ess-send-input "ext:ess-inf" ())
+(declare-function ess-make-buffer-current "ext:ess-inf" ())
+(declare-function ess-eval-buffer "ext:ess-inf" (vis))
+(declare-function ess-wait-for-process "ext:ess-inf"
+ (&optional proc sec-prompt wait force-redisplay))
+
+(defvar org-babel-header-args:julia
+ '((width . :any)
+ (horizontal . :any)
+ (results . ((file list vector table scalar verbatim)
+ (raw org html latex code pp wrap)
+ (replace silent append prepend)
+ (output value graphics))))
+ "Julia-specific header arguments.")
+
+(add-to-list 'org-babel-tangle-lang-exts '("julia" . "jl"))
+
+(defvar org-babel-default-header-args:julia '())
+
+(defcustom org-babel-julia-command "julia"
+ "Name of command to use for executing julia code."
+ :version "24.3"
+ :package-version '(Org . "8.0")
+ :group 'org-babel
+ :type 'string)
+
+(defvar ess-current-process-name) ; dynamically scoped
+(defvar ess-local-process-name) ; dynamically scoped
+(defvar ess-eval-visibly-p) ; dynamically scoped
+(defun org-babel-edit-prep:julia (info)
+ (let ((session (cdr (assq :session (nth 2 info)))))
+ (when (and session
+ (string-prefix-p "*" session)
+ (string-suffix-p "*" session))
+ (org-babel-julia-initiate-session session nil))))
+
+(defun org-babel-expand-body:julia (body params &optional _graphics-file)
+ "Expand BODY according to PARAMS, return the expanded body."
+ (mapconcat #'identity
+ (append
+ (when (cdr (assq :prologue params))
+ (list (cdr (assq :prologue params))))
+ (org-babel-variable-assignments:julia params)
+ (list body)
+ (when (cdr (assq :epilogue params))
+ (list (cdr (assq :epilogue params)))))
+ "\n"))
+
+(defun org-babel-execute:julia (body params)
+ "Execute a block of julia code.
+This function is called by `org-babel-execute-src-block'."
+ (save-excursion
+ (let* ((result-params (cdr (assq :result-params params)))
+ (result-type (cdr (assq :result-type params)))
+ (session (org-babel-julia-initiate-session
+ (cdr (assq :session params)) params))
+ (graphics-file (and (member "graphics" (assq :result-params params))
+ (org-babel-graphical-output-file params)))
+ (colnames-p (unless graphics-file (cdr (assq :colnames params))))
+ (full-body (org-babel-expand-body:julia body params graphics-file))
+ (result
+ (org-babel-julia-evaluate
+ session full-body result-type result-params
+ (or (equal "yes" colnames-p)
+ (org-babel-pick-name
+ (cdr (assq :colname-names params)) colnames-p)))))
+ (if graphics-file nil result))))
+
+(defun org-babel-normalize-newline (result)
+ (replace-regexp-in-string
+ "\\(\n\r?\\)\\{2,\\}"
+ "\n"
+ result))
+
+(defun org-babel-prep-session:julia (session params)
+ "Prepare SESSION according to the header arguments specified in PARAMS."
+ (let* ((session (org-babel-julia-initiate-session session params))
+ (var-lines (org-babel-variable-assignments:julia params)))
+ (org-babel-comint-in-buffer session
+ (mapc (lambda (var)
+ (end-of-line 1) (insert var) (comint-send-input nil t)
+ (org-babel-comint-wait-for-output session)) var-lines))
+ session))
+
+(defun org-babel-load-session:julia (session body params)
+ "Load BODY into SESSION."
+ (save-window-excursion
+ (let ((buffer (org-babel-prep-session:julia session params)))
+ (with-current-buffer buffer
+ (goto-char (process-mark (get-buffer-process (current-buffer))))
+ (insert (org-babel-chomp body)))
+ buffer)))
+
+;; helper functions
+
+(defun org-babel-variable-assignments:julia (params)
+ "Return list of julia statements assigning the block's variables."
+ (let ((vars (org-babel--get-vars params)))
+ (mapcar
+ (lambda (pair) (org-babel-julia-assign-elisp (car pair) (cdr pair)))
+ (mapcar
+ (lambda (i)
+ (cons (car (nth i vars))
+ (org-babel-reassemble-table
+ (cdr (nth i vars))
+ (cdr (nth i (cdr (assq :colname-names params))))
+ (cdr (nth i (cdr (assq :rowname-names params)))))))
+ (number-sequence 0 (1- (length vars)))))))
+
+(defun org-babel-julia-quote-csv-field (s)
+ "Quote field S for export to julia."
+ (if (stringp s)
+ (concat "\"" (mapconcat #'identity (split-string s "\"") "\"\"") "\"")
+ (format "%S" s)))
+
+(defun org-babel-julia-assign-elisp (name value)
+ "Construct julia code assigning the elisp VALUE to a variable named NAME."
+ (if (listp value)
+ (let* ((lengths (mapcar #'length (cl-remove-if-not #'sequencep value)))
+ (max (if lengths (apply #'max lengths) 0))
+ (min (if lengths (apply #'min lengths) 0)))
+ ;; Ensure VALUE has an orgtbl structure (depth of at least 2).
+ (unless (listp (car value)) (setq value (list value)))
+ (let ((file (orgtbl-to-csv value '(:fmt org-babel-julia-quote-csv-field))))
+ (if (= max min)
+ (format "%s = begin
+ using CSV
+ CSV.read(\"%s\")
+end" name file)
+ (format "%s = begin
+ using CSV
+ CSV.read(\"%s\")
+end"
+ name file))))
+ (format "%s = %s" name (org-babel-julia-quote-csv-field value))))
+
+(defvar ess-ask-for-ess-directory) ; dynamically scoped
+(defun org-babel-julia-initiate-session (session params)
+ "If there is not a current julia process then create one."
+ (unless (string= session "none")
+ (let ((session (or session "*Julia*"))
+ (ess-ask-for-ess-directory
+ (and (bound-and-true-p ess-ask-for-ess-directory)
+ (not (cdr (assq :dir params))))))
+ (if (org-babel-comint-buffer-livep session)
+ session
+ ;; FIXME: Depending on `display-buffer-alist', (julia) may end up
+ ;; popping up a new frame which `save-window-excursion' won't be able
+ ;; to "undo", so we really should call a kind of
+ ;; `julia-no-select' instead so we don't need to undo any
+ ;; window-changes afterwards.
+ (save-window-excursion
+ (when (get-buffer session)
+ ;; Session buffer exists, but with dead process
+ (set-buffer session))
+ (require 'ess) (set-buffer (julia))
+ (rename-buffer
+ (if (bufferp session)
+ (buffer-name session)
+ (if (stringp session)
+ session
+ (buffer-name))))
+ (current-buffer))))))
+
+(defun org-babel-julia-graphical-output-file (params)
+ "Name of file to which julia should send graphical output."
+ (and (member "graphics" (cdr (assq :result-params params)))
+ (cdr (assq :file params))))
+
+(defconst org-babel-julia-eoe-indicator "print(\"org_babel_julia_eoe\")")
+(defconst org-babel-julia-eoe-output "org_babel_julia_eoe")
+
+(defconst org-babel-julia-write-object-command "begin
+ local p_ans = %s
+ local p_tmp_file = \"%s\"
+
+ try
+ using CSV, DataFrames
+
+ if typeof(p_ans) <: DataFrame
+ p_ans_df = p_ans
+ else
+ p_ans_df = DataFrame(:ans => p_ans)
+ end
+
+ CSV.write(p_tmp_file,
+ p_ans_df,
+ writeheader = %s,
+ transform = (col, val) -> something(val, missing),
+ missingstring = \"nil\",
+ quotestrings = false)
+ p_ans
+ catch e
+ err_msg = \"Source block evaluation failed. $e\"
+ CSV.write(p_tmp_file,
+ DataFrame(:ans => err_msg),
+ writeheader = false,
+ transform = (col, val) -> something(val, missing),
+ missingstring = \"nil\",
+ quotestrings = false)
+
+ err_msg
+ end
+end")
+
+(defun org-babel-julia-evaluate
+ (session body result-type result-params column-names-p)
+ "Evaluate julia code in BODY."
+ (if session
+ (org-babel-julia-evaluate-session
+ session body result-type result-params column-names-p)
+ (org-babel-julia-evaluate-external-process
+ body result-type result-params column-names-p)))
+
+(defun org-babel-julia-evaluate-external-process
+ (body result-type result-params column-names-p)
+ "Evaluate BODY in external julia process.
+If RESULT-TYPE equals 'output then return standard output as a
+string. If RESULT-TYPE equals 'value then return the value of the
+last statement in BODY, as elisp."
+ (cl-case result-type
+ (value
+ (let ((tmp-file (org-babel-temp-file "julia-")))
+ (org-babel-eval org-babel-julia-command
+ (format org-babel-julia-write-object-command
+ (format "begin %s end" body)
+ (org-babel-process-file-name tmp-file 'noquote)
+ (if column-names-p "true" "false")
+ ))
+ (org-babel-julia-process-value-result
+ (org-babel-result-cond result-params
+ (with-temp-buffer
+ (insert-file-contents tmp-file)
+ (buffer-string))
+ (org-babel-import-elisp-from-file tmp-file '(4)))
+ column-names-p)))
+ (output (org-babel-eval org-babel-julia-command body))))
+
+(defun org-babel-julia-evaluate-session
+ (session body result-type result-params column-names-p)
+ "Evaluate BODY in SESSION.
+If RESULT-TYPE equals 'output then return standard output as a
+string. If RESULT-TYPE equals 'value then return the value of the
+last statement in BODY, as elisp."
+ (cl-case result-type
+ (value
+ (with-temp-buffer
+ (insert (org-babel-chomp body))
+ (let ((ess-local-process-name
+ (process-name (get-buffer-process session)))
+ (ess-eval-visibly-p nil))
+ (ess-eval-buffer nil)))
+ (let ((tmp-file (org-babel-temp-file "julia-")))
+ (org-babel-comint-eval-invisibly-and-wait-for-file
+ session tmp-file
+ (format org-babel-julia-write-object-command
+ "ans"
+ (org-babel-process-file-name tmp-file 'noquote)
+ (if column-names-p "true" "false")
+ ))
+ (org-babel-julia-process-value-result
+ (org-babel-result-cond result-params
+ (with-temp-buffer
+ (insert-file-contents tmp-file)
+ (buffer-string))
+ (org-babel-import-elisp-from-file tmp-file '(4)))
+ column-names-p)))
+ (output
+ (mapconcat
+ #'org-babel-chomp
+ (butlast
+ (delq nil
+ (mapcar
+ (lambda (line) (when (> (length line) 0) line))
+ (mapcar
+ (lambda (line) ;; cleanup extra prompts left in output
+ (if (string-match
+ "^\\([>+.]\\([ ][>.+]\\)*[ ]\\)"
+ (car (split-string line "\n")))
+ (substring line (match-end 1))
+ line))
+ (org-babel-comint-with-output (session org-babel-julia-eoe-output)
+ (insert (mapconcat #'org-babel-chomp
+ (list body org-babel-julia-eoe-indicator)
+ "\n"))
+ (inferior-ess-send-input))))))
+ "\n"))))
+
+(defun org-babel-julia-process-value-result (result column-names-p)
+ "Julia-specific processing of return value.
+Insert hline if column names in output have been requested."
+ (if column-names-p
+ (cons (car result) (cons 'hline (cdr result)))
+ result))
+
+(provide 'ob-julia)
+
+;;; ob-julia.el ends here
diff --git a/elpa/org-9.5.2/ob-julia.elc b/elpa/org-9.5.2/ob-julia.elc
new file mode 100644
index 0000000..7e1f632
--- /dev/null
+++ b/elpa/org-9.5.2/ob-julia.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-latex.el b/elpa/org-9.5.2/ob-latex.el
new file mode 100644
index 0000000..7c65256
--- /dev/null
+++ b/elpa/org-9.5.2/ob-latex.el
@@ -0,0 +1,283 @@
+;;; ob-latex.el --- Babel Functions for LaTeX -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating LaTeX source code.
+;;
+;; Currently on evaluation this returns raw LaTeX code, unless a :file
+;; header argument is given in which case small png or pdf files will
+;; be created directly form the latex source code.
+
+;;; 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))
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("latex" . "tex"))
+
+(defvar org-format-latex-header) ; From org.el
+(defvar org-format-latex-options) ; From org.el
+(defvar org-latex-default-packages-alist) ; From org.el
+(defvar org-latex-packages-alist) ; From org.el
+
+(defvar org-babel-default-header-args:latex
+ '((:results . "latex") (:exports . "results"))
+ "Default arguments to use when evaluating a LaTeX source block.")
+
+(defconst org-babel-header-args:latex
+ '((border . :any)
+ (fit . :any)
+ (imagemagick . ((nil t)))
+ (iminoptions . :any)
+ (imoutoptions . :any)
+ (packages . :any)
+ (pdfheight . :any)
+ (pdfpng . :any)
+ (pdfwidth . :any)
+ (headers . :any)
+ (packages . :any)
+ (buffer . ((yes no))))
+ "LaTeX-specific header arguments.")
+
+(defcustom org-babel-latex-htlatex "htlatex"
+ "The htlatex command to enable conversion of LaTeX to SVG or HTML."
+ :group 'org-babel
+ :type 'string)
+
+(defcustom org-babel-latex-preamble
+ (lambda (_)
+ "\\documentclass[preview]{standalone}
+\\def\\pgfsysdriver{pgfsys-tex4ht.def}
+")
+ "Closure which evaluates at runtime to the LaTeX preamble.
+
+It takes 1 argument which is the parameters of the source block."
+ :group 'org-babel
+ :type 'function)
+
+(defcustom org-babel-latex-begin-env
+ (lambda (_)
+ "\\begin{document}")
+ "Function that evaluates to the begin part of the document environment.
+
+It takes 1 argument which is the parameters of the source block.
+This allows adding additional code that will be ignored when
+exporting the literal LaTeX source."
+ :group 'org-babel
+ :type 'function)
+
+(defcustom org-babel-latex-end-env
+ (lambda (_)
+ "\\end{document}")
+ "Closure which evaluates at runtime to the end part of the document environment.
+
+It takes 1 argument which is the parameters of the source block.
+This allows adding additional code that will be ignored when
+exporting the literal LaTeX source."
+ :group 'org-babel
+ :type 'function)
+
+(defcustom org-babel-latex-pdf-svg-process
+ "inkscape --pdf-poppler %f -T -l -o %O"
+ "Command to convert a PDF file to an SVG file."
+ :group 'org-babel
+ :type 'string)
+
+(defcustom org-babel-latex-htlatex-packages
+ '("[usenames]{color}" "{tikz}" "{color}" "{listings}" "{amsmath}")
+ "Packages to use for htlatex export."
+ :group 'org-babel
+ :type '(repeat (string)))
+
+(defun org-babel-expand-body:latex (body params)
+ "Expand BODY according to PARAMS, return the expanded body."
+ (mapc (lambda (pair) ;; replace variables
+ (setq body
+ (replace-regexp-in-string
+ (regexp-quote (format "%S" (car pair)))
+ (if (stringp (cdr pair))
+ (cdr pair) (format "%S" (cdr pair)))
+ body)))
+ (org-babel--get-vars params))
+ (org-trim body))
+
+(defun org-babel-execute:latex (body params)
+ "Execute a block of Latex code with Babel.
+This function is called by `org-babel-execute-src-block'."
+ (setq body (org-babel-expand-body:latex body params))
+ (if (cdr (assq :file params))
+ (let* ((out-file (cdr (assq :file params)))
+ (extension (file-name-extension out-file))
+ (tex-file (org-babel-temp-file "latex-" ".tex"))
+ (border (cdr (assq :border params)))
+ (imagemagick (cdr (assq :imagemagick params)))
+ (im-in-options (cdr (assq :iminoptions params)))
+ (im-out-options (cdr (assq :imoutoptions params)))
+ (fit (or (cdr (assq :fit params)) border))
+ (height (and fit (cdr (assq :pdfheight params))))
+ (width (and fit (cdr (assq :pdfwidth params))))
+ (headers (cdr (assq :headers params)))
+ (in-buffer (not (string= "no" (cdr (assq :buffer params)))))
+ (org-latex-packages-alist
+ (append (cdr (assq :packages params)) org-latex-packages-alist)))
+ (cond
+ ((and (string-suffix-p ".png" out-file) (not imagemagick))
+ (let ((org-format-latex-header
+ (concat org-format-latex-header "\n"
+ (mapconcat #'identity headers "\n"))))
+ (org-create-formula-image
+ body out-file org-format-latex-options in-buffer)))
+ ((string= "svg" extension)
+ (with-temp-file tex-file
+ (insert (concat (funcall org-babel-latex-preamble params)
+ (mapconcat #'identity headers "\n")
+ (funcall org-babel-latex-begin-env params)
+ body
+ (funcall org-babel-latex-end-env params))))
+ (let ((tmp-pdf (org-babel-latex-tex-to-pdf tex-file)))
+ (let* ((log-buf (get-buffer-create "*Org Babel LaTeX Output*"))
+ (err-msg "org babel latex failed")
+ (img-out (org-compile-file
+ tmp-pdf
+ (list org-babel-latex-pdf-svg-process)
+ extension err-msg log-buf)))
+ (shell-command (format "mv %s %s" img-out out-file)))))
+ ((string-suffix-p ".tikz" out-file)
+ (when (file-exists-p out-file) (delete-file out-file))
+ (with-temp-file out-file
+ (insert body)))
+ ((and (string= "html" extension)
+ (executable-find org-babel-latex-htlatex))
+ ;; TODO: this is a very different way of generating the
+ ;; frame latex document than in the pdf case. Ideally, both
+ ;; would be unified. This would prevent bugs creeping in
+ ;; such as the one fixed on Aug 16 2014 whereby :headers was
+ ;; not included in the SVG/HTML case.
+ (with-temp-file tex-file
+ (insert (concat
+ "\\documentclass[preview]{standalone}
+\\def\\pgfsysdriver{pgfsys-tex4ht.def}
+"
+ (mapconcat (lambda (pkg)
+ (concat "\\usepackage" pkg))
+ org-babel-latex-htlatex-packages
+ "\n")
+ (if headers
+ (concat "\n"
+ (if (listp headers)
+ (mapconcat #'identity headers "\n")
+ headers) "\n")
+ "")
+ "\\begin{document}"
+ body
+ "\\end{document}")))
+ (when (file-exists-p out-file) (delete-file out-file))
+ (let ((default-directory (file-name-directory tex-file)))
+ (shell-command (format "%s %s" org-babel-latex-htlatex tex-file)))
+ (cond
+ ((file-exists-p (concat (file-name-sans-extension tex-file) "-1.svg"))
+ (if (string-suffix-p ".svg" out-file)
+ (progn
+ (shell-command "pwd")
+ (shell-command (format "mv %s %s"
+ (concat (file-name-sans-extension tex-file) "-1.svg")
+ out-file)))
+ (error "SVG file produced but HTML file requested")))
+ ((file-exists-p (concat (file-name-sans-extension tex-file) ".html"))
+ (if (string-suffix-p ".html" out-file)
+ (shell-command "mv %s %s"
+ (concat (file-name-sans-extension tex-file)
+ ".html")
+ out-file)
+ (error "HTML file produced but SVG file requested")))))
+ ((or (string= "pdf" extension) imagemagick)
+ (with-temp-file tex-file
+ (require 'ox-latex)
+ (insert
+ (org-latex-guess-inputenc
+ (org-splice-latex-header
+ org-format-latex-header
+ (delq
+ nil
+ (mapcar
+ (lambda (el)
+ (unless (and (listp el) (string= "hyperref" (cadr el)))
+ el))
+ org-latex-default-packages-alist))
+ org-latex-packages-alist
+ nil))
+ (if fit "\n\\usepackage[active, tightpage]{preview}\n" "")
+ (if border (format "\\setlength{\\PreviewBorder}{%s}" border) "")
+ (if height (concat "\n" (format "\\pdfpageheight %s" height)) "")
+ (if width (concat "\n" (format "\\pdfpagewidth %s" width)) "")
+ (if headers
+ (concat "\n"
+ (if (listp headers)
+ (mapconcat #'identity headers "\n")
+ headers) "\n")
+ "")
+ (if fit
+ (concat "\n\\begin{document}\n\\begin{preview}\n" body
+ "\n\\end{preview}\n\\end{document}\n")
+ (concat "\n\\begin{document}\n" body "\n\\end{document}\n"))))
+ (when (file-exists-p out-file) (delete-file out-file))
+ (let ((transient-pdf-file (org-babel-latex-tex-to-pdf tex-file)))
+ (cond
+ ((string= "pdf" extension)
+ (rename-file transient-pdf-file out-file))
+ (imagemagick
+ (org-babel-latex-convert-pdf
+ transient-pdf-file out-file im-in-options im-out-options)
+ (when (file-exists-p transient-pdf-file)
+ (delete-file transient-pdf-file)))
+ (t
+ (error "Can not create %s files, please specify a .png or .pdf file or try the :imagemagick header argument"
+ extension))))))
+ nil) ;; signal that output has already been written to file
+ body))
+
+(defun org-babel-latex-convert-pdf (pdffile out-file im-in-options im-out-options)
+ "Generate a file from a pdf file using imagemagick."
+ (let ((cmd (concat "convert " im-in-options " " pdffile " "
+ im-out-options " " out-file)))
+ (message "Converting pdffile file %s..." cmd)
+ (shell-command cmd)))
+
+(defun org-babel-latex-tex-to-pdf (file)
+ "Generate a pdf file according to the contents FILE."
+ (require 'ox-latex)
+ (org-latex-compile file))
+
+(defun org-babel-prep-session:latex (_session _params)
+ "Return an error because LaTeX doesn't support sessions."
+ (error "LaTeX does not support sessions"))
+
+(provide 'ob-latex)
+
+;;; ob-latex.el ends here
diff --git a/elpa/org-9.5.2/ob-latex.elc b/elpa/org-9.5.2/ob-latex.elc
new file mode 100644
index 0000000..f29f3f8
--- /dev/null
+++ b/elpa/org-9.5.2/ob-latex.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-lilypond.el b/elpa/org-9.5.2/ob-lilypond.el
new file mode 100644
index 0000000..410d53b
--- /dev/null
+++ b/elpa/org-9.5.2/ob-lilypond.el
@@ -0,0 +1,428 @@
+;;; ob-lilypond.el --- Babel Functions for Lilypond -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Author: Martyn Jago
+;; Keywords: babel language, literate programming
+;; Homepage: https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Installation, ob-lilypond documentation, and examples are available at
+;; https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html
+;;
+;; Lilypond documentation can be found at
+;; https://lilypond.org/manuals.html
+;;
+;; This depends on epstopdf --- See https://www.ctan.org/pkg/epstopdf.
+
+;;; Code:
+(require 'ob)
+
+(declare-function org-show-all "org" (&optional types))
+
+(defalias 'lilypond-mode 'LilyPond-mode)
+
+(add-to-list 'org-babel-tangle-lang-exts '("LilyPond" . "ly"))
+
+(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'
+To configure, see `ob-lilypond-header-args'
+.")
+
+(defvar ob-lilypond-header-args
+ '((:results . "file") (:exports . "results"))
+ "User-configurable header arguments for lilypond code blocks.
+NOTE: The final value used by org-babel is computed at compile-time
+and stored in `org-babel-default-header-args:lilypond'
+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.")
+
+(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.")
+
+(defvar org-babel-lilypond-play-midi-post-tangle t
+ "Following a successful LilyPond compilation
+org-babel-lilypond-play-midi-post-tangle determines whether to automate the
+playing of the resultant midi file. If the value is nil,
+the midi file is not automatically played. Default value is t")
+
+(defvar org-babel-lilypond-ly-command ""
+ "Command to execute lilypond on your system.
+Do not set it directly. Customize `org-babel-lilypond-commands' instead.")
+
+(defvar org-babel-lilypond-pdf-command ""
+ "Command to show a PDF file on your system.
+Do not set it directly. Customize `org-babel-lilypond-commands' instead.")
+
+(defvar org-babel-lilypond-midi-command ""
+ "Command to play a MIDI file on your system.
+Do not set it directly. Customize `org-babel-lilypond-commands' instead.")
+
+(defcustom org-babel-lilypond-commands
+ (cond
+ ((eq system-type 'darwin)
+ '("/Applications/lilypond.app/Contents/Resources/bin/lilypond" "open" "open"))
+ ((eq system-type 'windows-nt)
+ '("lilypond" "" ""))
+ (t
+ '("lilypond" "xdg-open" "xdg-open")))
+ "Commands to run lilypond and view or play the results.
+These should be executables that take a filename as an argument.
+On some system it is possible to specify the filename directly
+and the viewer or player will be determined from the file type;
+you can leave the string empty on this case."
+ :group 'org-babel
+ :type '(list
+ (string :tag "Lilypond ")
+ (string :tag "PDF Viewer ")
+ (string :tag "MIDI Player"))
+ :version "24.4"
+ :package-version '(Org . "8.2.7")
+ :set
+ (lambda (symbol value)
+ (set symbol value)
+ (setq
+ org-babel-lilypond-ly-command (nth 0 value)
+ org-babel-lilypond-pdf-command (nth 1 value)
+ org-babel-lilypond-midi-command (nth 2 value))))
+
+(defvar org-babel-lilypond-gen-png nil
+ "Non-nil means image generation (PNG) is turned on by default.")
+
+(defvar org-babel-lilypond-gen-svg nil
+ "Non-nil means image generation (SVG) is be turned on by default.")
+
+(defvar org-babel-lilypond-gen-html nil
+ "Non-nil means HTML generation is turned on by default.")
+
+(defvar org-babel-lilypond-gen-pdf nil
+ "Non-nil means PDF generation is be turned on by default.")
+
+(defvar org-babel-lilypond-use-eps nil
+ "Non-nil forces the compiler to use the EPS backend.")
+
+(defvar org-babel-lilypond-arrange-mode nil
+ "Non-nil turns Arrange mode on.
+In Arrange mode the following settings are altered from default:
+:tangle yes, :noweb yes
+:results silent :comments yes.
+In addition lilypond block execution causes tangling of all lilypond
+blocks.")
+
+(defun org-babel-expand-body:lilypond (body params)
+ "Expand BODY according to PARAMS, return the expanded body."
+ (let ((vars (org-babel--get-vars params)))
+ (mapc
+ (lambda (pair)
+ (let ((name (symbol-name (car pair)))
+ (value (cdr pair)))
+ (setq body
+ (replace-regexp-in-string
+ (concat "$" (regexp-quote name))
+ (if (stringp value) value (format "%S" value))
+ body))))
+ vars)
+ body))
+
+(defun org-babel-execute:lilypond (body params)
+ "This function is called by `org-babel-execute-src-block'.
+Depending on whether we are in arrange mode either:
+1. Attempt to execute lilypond block according to header settings
+ (This is the default basic mode)
+2. Tangle all lilypond blocks and process the result (arrange mode)"
+ (org-babel-lilypond-set-header-args org-babel-lilypond-arrange-mode)
+ (if org-babel-lilypond-arrange-mode
+ (org-babel-lilypond-tangle)
+ (org-babel-lilypond-process-basic body params)))
+
+(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=."
+ (interactive)
+ (if (org-babel-tangle nil "yes" "lilypond")
+ (org-babel-lilypond-execute-tangled-ly) nil))
+
+(defun org-babel-lilypond-process-basic (body params)
+ "Execute a lilypond block in basic mode."
+ (let* ((out-file (cdr (assq :file params)))
+ (cmdline (or (cdr (assq :cmdline params))
+ ""))
+ (in-file (org-babel-temp-file "lilypond-")))
+
+ (with-temp-file in-file
+ (insert (org-babel-expand-body:generic body params)))
+ (org-babel-eval
+ (concat
+ org-babel-lilypond-ly-command
+ " -dbackend=eps "
+ "-dno-gs-load-fonts "
+ "-dinclude-eps-fonts "
+ (or (cdr (assoc (file-name-extension out-file)
+ '(("pdf" . "--pdf ")
+ ("ps" . "--ps ")
+ ("png" . "--png "))))
+ "--png ")
+ "--output="
+ (file-name-sans-extension out-file)
+ " "
+ cmdline
+ in-file) "")) nil)
+
+(defun org-babel-prep-session:lilypond (_session _params)
+ "Return an error because LilyPond exporter does not support sessions."
+ (error "Sorry, LilyPond does not currently support sessions!"))
+
+(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."
+ (when org-babel-lilypond-compile-post-tangle
+ (let ((org-babel-lilypond-tangled-file (org-babel-lilypond-switch-extension
+ (buffer-file-name) ".lilypond"))
+ (org-babel-lilypond-temp-file (org-babel-lilypond-switch-extension
+ (buffer-file-name) ".ly")))
+ (if (not (file-exists-p org-babel-lilypond-tangled-file))
+ (error "Error: Tangle Failed!")
+ (when (file-exists-p org-babel-lilypond-temp-file)
+ (delete-file org-babel-lilypond-temp-file))
+ (rename-file org-babel-lilypond-tangled-file
+ org-babel-lilypond-temp-file))
+ (org-switch-to-buffer-other-window "*lilypond*")
+ (erase-buffer)
+ (org-babel-lilypond-compile-lilyfile org-babel-lilypond-temp-file)
+ (goto-char (point-min))
+ (if (org-babel-lilypond-check-for-compile-error org-babel-lilypond-temp-file)
+ (error "Error in Compilation!")
+ (other-window -1)
+ (org-babel-lilypond-attempt-to-open-pdf org-babel-lilypond-temp-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."
+ (message "Compiling LilyPond...")
+ (let ((arg-1 org-babel-lilypond-ly-command) ;program
+ ;; (arg-2 nil) ;infile
+ (arg-3 "*lilypond*") ;buffer
+ (arg-4 t) ;display
+ (arg-5 (if org-babel-lilypond-gen-png "--png" "")) ;&rest...
+ (arg-6 (if org-babel-lilypond-gen-html "--html" ""))
+ (arg-7 (if org-babel-lilypond-gen-pdf "--pdf" ""))
+ (arg-8 (if org-babel-lilypond-use-eps "-dbackend=eps" ""))
+ (arg-9 (if org-babel-lilypond-gen-svg "-dbackend=svg" ""))
+ (arg-10 (concat "--output=" (file-name-sans-extension file-name)))
+ (arg-11 file-name))
+ (if test
+ `(,arg-1 ,nil ,arg-3 ,arg-4 ,arg-5 ,arg-6 ;; arg-2
+ ,arg-7 ,arg-8 ,arg-9 ,arg-10 ,arg-11)
+ (call-process
+ arg-1 nil arg-3 arg-4 arg-5 arg-6 ;; arg-2
+ arg-7 arg-8 arg-9 arg-10 arg-11))))
+
+(defun org-babel-lilypond-check-for-compile-error (file-name &optional test)
+ "Check for compile error.
+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."
+ (let ((is-error (search-forward "error:" nil t)))
+ (if test
+ is-error
+ (when is-error
+ (org-babel-lilypond-process-compile-error file-name)))))
+
+(defun org-babel-lilypond-process-compile-error (file-name)
+ "Process the compilation error that has occurred.
+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)
+ (error "Error: Compilation Failed!"))))
+
+(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."
+ (org-switch-to-buffer-other-window
+ (concat (file-name-nondirectory
+ (org-babel-lilypond-switch-extension file-name ".org"))))
+ (let ((temp (point)))
+ (goto-char (point-min))
+ (setq case-fold-search nil)
+ (if (search-forward line nil t)
+ (progn
+ (org-show-all)
+ (set-mark (point))
+ (goto-char (- (point) (length line))))
+ (goto-char temp))))
+
+(defun org-babel-lilypond-parse-line-num (&optional buffer)
+ "Extract error line number."
+ (when buffer (set-buffer buffer))
+ (let ((start
+ (and (search-backward ":" nil t)
+ (search-backward ":" nil t)
+ (search-backward ":" nil t)
+ (search-backward ":" nil t))))
+ (when start
+ (forward-char)
+ (let ((num (string-to-number
+ (buffer-substring
+ (+ 1 start)
+ (- (search-forward ":" nil t) 1)))))
+ (and (numberp num) num)))))
+
+(defun org-babel-lilypond-parse-error-line (file-name lineNo)
+ "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."
+ (with-temp-buffer
+ (insert-file-contents (org-babel-lilypond-switch-extension file-name ".ly")
+ nil nil nil t)
+ (if (> lineNo 0)
+ (progn
+ (goto-char (point-min))
+ (forward-line (- lineNo 1))
+ (buffer-substring (point) (point-at-eol)))
+ 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."
+ (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)
+ (let ((cmd-string
+ (concat org-babel-lilypond-pdf-command " " pdf-file)))
+ (if test
+ cmd-string
+ (start-process
+ "\"Audition pdf\""
+ "*lilypond*"
+ org-babel-lilypond-pdf-command
+ pdf-file)))
+ (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."
+ (when org-babel-lilypond-play-midi-post-tangle
+ (let* ((ext (if (eq system-type 'windows-nt)
+ ".mid" ".midi"))
+ (midi-file (org-babel-lilypond-switch-extension file-name ext)))
+ (if (file-exists-p midi-file)
+ (let ((cmd-string
+ (concat org-babel-lilypond-midi-command " " midi-file)))
+ (if test
+ cmd-string
+ (start-process
+ "\"Audition midi\""
+ "*lilypond*"
+ org-babel-lilypond-midi-command
+ midi-file)))
+ (message "No midi file generated so can't play!")))))
+
+(defun org-babel-lilypond-toggle-midi-play ()
+ "Toggle whether midi will be played following a successful compilation."
+ (interactive)
+ (setq org-babel-lilypond-play-midi-post-tangle
+ (not org-babel-lilypond-play-midi-post-tangle))
+ (message (concat "Post-Tangle MIDI play has been "
+ (if org-babel-lilypond-play-midi-post-tangle
+ "ENABLED." "DISABLED."))))
+
+(defun org-babel-lilypond-toggle-pdf-display ()
+ "Toggle whether pdf will be displayed following a successful compilation."
+ (interactive)
+ (setq org-babel-lilypond-display-pdf-post-tangle
+ (not org-babel-lilypond-display-pdf-post-tangle))
+ (message (concat "Post-Tangle PDF display has been "
+ (if org-babel-lilypond-display-pdf-post-tangle
+ "ENABLED." "DISABLED."))))
+
+(defun org-babel-lilypond-toggle-png-generation ()
+ "Toggle whether png image will be generated by compilation."
+ (interactive)
+ (setq org-babel-lilypond-gen-png (not org-babel-lilypond-gen-png))
+ (message (concat "PNG image generation has been "
+ (if org-babel-lilypond-gen-png "ENABLED." "DISABLED."))))
+
+(defun org-babel-lilypond-toggle-html-generation ()
+ "Toggle whether html will be generated by compilation."
+ (interactive)
+ (setq org-babel-lilypond-gen-html (not org-babel-lilypond-gen-html))
+ (message (concat "HTML generation has been "
+ (if org-babel-lilypond-gen-html "ENABLED." "DISABLED."))))
+
+(defun org-babel-lilypond-toggle-pdf-generation ()
+ "Toggle whether pdf will be generated by compilation."
+ (interactive)
+ (setq org-babel-lilypond-gen-pdf (not org-babel-lilypond-gen-pdf))
+ (message (concat "PDF generation has been "
+ (if org-babel-lilypond-gen-pdf "ENABLED." "DISABLED."))))
+
+(defun org-babel-lilypond-toggle-arrange-mode ()
+ "Toggle whether in Arrange mode or Basic mode."
+ (interactive)
+ (setq org-babel-lilypond-arrange-mode
+ (not org-babel-lilypond-arrange-mode))
+ (message (concat "Arrange mode has been "
+ (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."
+ (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. MODE is t."
+ (cond (mode
+ '((:tangle . "yes")
+ (:noweb . "yes")
+ (:results . "silent")
+ (:cache . "yes")
+ (:comments . "yes")))
+ (t
+ ob-lilypond-header-args)))
+
+(defun org-babel-lilypond-set-header-args (mode)
+ "Set org-babel-default-header-args:lilypond
+dependent on ORG-BABEL-LILYPOND-ARRANGE-MODE."
+ (setq org-babel-default-header-args:lilypond
+ (org-babel-lilypond-get-header-args mode)))
+
+(provide 'ob-lilypond)
+
+;;; ob-lilypond.el ends here
diff --git a/elpa/org-9.5.2/ob-lilypond.elc b/elpa/org-9.5.2/ob-lilypond.elc
new file mode 100644
index 0000000..9a1ea89
--- /dev/null
+++ b/elpa/org-9.5.2/ob-lilypond.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-lisp.el b/elpa/org-9.5.2/ob-lisp.el
new file mode 100644
index 0000000..b32b122
--- /dev/null
+++ b/elpa/org-9.5.2/ob-lisp.el
@@ -0,0 +1,125 @@
+;;; ob-lisp.el --- Babel Functions for Common Lisp -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Authors: Joel Boehland
+;; Eric Schulte
+;; David T. O'Toole <dto@gnu.org>
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Support for evaluating Common Lisp code, relies on SLY or SLIME
+;;; for all eval.
+
+;;; Requirements:
+
+;; Requires SLY (Sylvester the Cat's Common Lisp IDE) or SLIME
+;; (Superior Lisp Interaction Mode for Emacs). See:
+;; - https://github.com/capitaomorte/sly
+;; - https://common-lisp.net/project/slime/
+
+;;; Code:
+(require 'ob)
+(require 'org-macs)
+
+(declare-function sly-eval "ext:sly" (sexp &optional package))
+(declare-function slime-eval "ext:slime" (sexp &optional package))
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("lisp" . "lisp"))
+
+(defvar org-babel-default-header-args:lisp '())
+(defvar org-babel-header-args:lisp '((package . :any)))
+
+(defcustom org-babel-lisp-eval-fn #'slime-eval
+ "The function to be called to evaluate code on the Lisp side.
+Valid values include `slime-eval' and `sly-eval'."
+ :group 'org-babel
+ :version "26.1"
+ :package-version '(Org . "9.0")
+ :type 'symbol)
+
+(defcustom org-babel-lisp-dir-fmt
+ "(let ((*default-pathname-defaults* #P%S\n)) %%s\n)"
+ "Format string used to wrap code bodies to set the current directory.
+For example a value of \"(progn ;; %s\\n %%s)\" would ignore the
+current directory string."
+ :group 'org-babel
+ :version "24.1"
+ :type 'string)
+
+(defun org-babel-expand-body:lisp (body params)
+ "Expand BODY according to PARAMS, return the expanded body."
+ (let* ((vars (org-babel--get-vars params))
+ (result-params (cdr (assq :result-params params)))
+ (print-level nil) (print-length nil)
+ (body (if (null vars) (org-trim body)
+ (concat "(let ("
+ (mapconcat
+ (lambda (var)
+ (format "(%S (quote %S))" (car var) (cdr var)))
+ vars "\n ")
+ ")\n" body ")"))))
+ (if (or (member "code" result-params)
+ (member "pp" result-params))
+ (format "(pprint %s)" body)
+ body)))
+
+(defun org-babel-execute:lisp (body params)
+ "Execute a block of Common Lisp code with Babel.
+BODY is the contents of the block, as a string. PARAMS is
+a property list containing the parameters of the block."
+ (require (pcase org-babel-lisp-eval-fn
+ (`slime-eval 'slime)
+ (`sly-eval 'sly)))
+ (org-babel-reassemble-table
+ (let ((result
+ (funcall (if (member "output" (cdr (assq :result-params params)))
+ #'car #'cadr)
+ (with-temp-buffer
+ (insert (org-babel-expand-body:lisp body params))
+ (funcall org-babel-lisp-eval-fn
+ `(swank:eval-and-grab-output
+ ,(let ((dir (if (assq :dir params)
+ (cdr (assq :dir params))
+ default-directory)))
+ (format
+ (if dir (format org-babel-lisp-dir-fmt dir)
+ "(progn %s\n)")
+ (buffer-substring-no-properties
+ (point-min) (point-max)))))
+ (cdr (assq :package params)))))))
+ (org-babel-result-cond (cdr (assq :result-params params))
+ (org-strip-quotes result)
+ (condition-case nil
+ (read (org-babel-lisp-vector-to-list result))
+ (error result))))
+ (org-babel-pick-name (cdr (assq :colname-names params))
+ (cdr (assq :colnames params)))
+ (org-babel-pick-name (cdr (assq :rowname-names params))
+ (cdr (assq :rownames params)))))
+
+(defun org-babel-lisp-vector-to-list (results)
+ ;; TODO: better would be to replace #(...) with [...]
+ (replace-regexp-in-string "#(" "(" results))
+
+(provide 'ob-lisp)
+
+;;; ob-lisp.el ends here
diff --git a/elpa/org-9.5.2/ob-lisp.elc b/elpa/org-9.5.2/ob-lisp.elc
new file mode 100644
index 0000000..f3d248e
--- /dev/null
+++ b/elpa/org-9.5.2/ob-lisp.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-lob.el b/elpa/org-9.5.2/ob-lob.el
new file mode 100644
index 0000000..903dabf
--- /dev/null
+++ b/elpa/org-9.5.2/ob-lob.el
@@ -0,0 +1,164 @@
+;;; ob-lob.el --- Functions Supporting the Library of Babel -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Authors: Eric Schulte
+;; Dan Davison
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Code:
+(require 'cl-lib)
+(require 'ob-core)
+(require 'ob-table)
+
+(declare-function org-babel-ref-split-args "ob-ref" (arg-string))
+(declare-function org-element-at-point "org-element" ())
+(declare-function org-element-context "org-element" (&optional element))
+(declare-function org-element-property "org-element" (property element))
+(declare-function org-element-type "org-element" (element))
+
+(defvar org-babel-library-of-babel nil
+ "Library of source-code blocks.
+This is an association list. Populate the library by calling
+`org-babel-lob-ingest' on files containing source blocks.")
+
+(defvar org-babel-default-lob-header-args '((:exports . "results"))
+ "Default header arguments to use when exporting Babel calls.
+By default, a Babel call inherits its arguments from the source
+block being called. Header arguments defined in this variable
+take precedence over these. It is useful for properties that
+should not be inherited from a source block.")
+
+(defun org-babel-lob-ingest (&optional file)
+ "Add all named source blocks defined in FILE to `org-babel-library-of-babel'."
+ (interactive "fFile: ")
+ (let ((lob-ingest-count 0))
+ (org-babel-map-src-blocks file
+ (let* ((info (org-babel-get-src-block-info 'light))
+ (source-name (nth 4 info)))
+ (when source-name
+ (setf (nth 1 info)
+ (if (org-babel-noweb-p (nth 2 info) :eval)
+ (org-babel-expand-noweb-references info)
+ (nth 1 info)))
+ (let ((source (intern source-name)))
+ (setq org-babel-library-of-babel
+ (cons (cons source info)
+ (assq-delete-all source org-babel-library-of-babel))))
+ (cl-incf lob-ingest-count))))
+ (message "%d source block%s added to Library of Babel"
+ lob-ingest-count (if (> lob-ingest-count 1) "s" ""))
+ lob-ingest-count))
+
+;; Functions for executing lob one-liners.
+
+;;;###autoload
+(defun org-babel-lob-execute-maybe ()
+ "Execute a Library of Babel source block, if appropriate.
+Detect if this is context for a Library Of Babel source block and
+if so then run the appropriate source block from the Library."
+ (interactive)
+ (let ((info (org-babel-lob-get-info)))
+ (when info
+ (org-babel-execute-src-block nil info)
+ t)))
+
+(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 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 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))
+ (reference (org-element-property :call context)))
+ (when (memq type '(babel-call inline-babel-call))
+ (pcase (org-babel-lob--src-info reference)
+ (`(,language ,body ,header ,_ ,_ ,_ ,coderef)
+ (let ((begin (org-element-property (if (eq type 'inline-babel-call)
+ :begin
+ :post-affiliated)
+ context)))
+ (list language
+ body
+ (apply #'org-babel-merge-params
+ header
+ org-babel-default-lob-header-args
+ (append
+ (org-with-point-at begin
+ (org-babel-params-from-properties language))
+ (list
+ (org-babel-parse-header-arguments
+ (org-element-property :inside-header context))
+ (let ((args (org-element-property :arguments context)))
+ (and args
+ (mapcar (lambda (ref) (cons :var ref))
+ (org-babel-ref-split-args args))))
+ (org-babel-parse-header-arguments
+ (org-element-property :end-header context)))))
+ nil
+ (org-element-property :name context)
+ begin
+ coderef)))
+ (_ nil)))))
+
+(provide 'ob-lob)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ob-lob.el ends here
diff --git a/elpa/org-9.5.2/ob-lob.elc b/elpa/org-9.5.2/ob-lob.elc
new file mode 100644
index 0000000..a157db4
--- /dev/null
+++ b/elpa/org-9.5.2/ob-lob.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-lua.el b/elpa/org-9.5.2/ob-lua.el
new file mode 100644
index 0000000..a4a964a
--- /dev/null
+++ b/elpa/org-9.5.2/ob-lua.el
@@ -0,0 +1,403 @@
+;;; ob-lua.el --- Org Babel functions for Lua evaluation -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2014, 2016-2021 Free Software Foundation, Inc.
+
+;; Authors: Dieter Schoen
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating lua source code.
+
+;; Requirements:
+;; for session support, lua-mode is needed.
+;; lua-mode is not part of GNU Emacs/orgmode, but can be obtained
+;; from marmalade or melpa.
+;; The source repository is here:
+;; https://github.com/immerrr/lua-mode
+
+;; However, sessions are not yet working.
+
+;;; Code:
+(require 'ob)
+(require 'org-macs)
+(require 'cl-lib)
+
+(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))
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("lua" . "lua"))
+
+(defvar org-babel-default-header-args:lua '())
+
+(defcustom org-babel-lua-command "lua"
+ "Name of the command for executing Lua code."
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :group 'org-babel
+ :type 'string)
+
+(defcustom org-babel-lua-mode 'lua-mode
+ "Preferred lua mode for use in running lua interactively.
+This will typically be `lua-mode'."
+ :group 'org-babel
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'symbol)
+
+(defcustom org-babel-lua-hline-to "None"
+ "Replace hlines in incoming tables with this when translating to lua."
+ :group 'org-babel
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'string)
+
+(defcustom org-babel-lua-None-to 'hline
+ "Replace `None' in lua tables with this before returning."
+ :group 'org-babel
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'symbol)
+
+(defun org-babel-execute:lua (body params)
+ "Execute a block of Lua code with Babel.
+This function is called by `org-babel-execute-src-block'."
+ (let* ((session (org-babel-lua-initiate-session
+ (cdr (assq :session params))))
+ (result-params (cdr (assq :result-params params)))
+ (result-type (cdr (assq :result-type params)))
+ (return-val (when (and (eq result-type 'value) (not session))
+ (cdr (assq :return params))))
+ (preamble (cdr (assq :preamble params)))
+ (full-body
+ (org-babel-expand-body:generic
+ (concat body (if return-val (format "\nreturn %s" return-val) ""))
+ params (org-babel-variable-assignments:lua params)))
+ (result (org-babel-lua-evaluate
+ session full-body result-type result-params preamble)))
+ (org-babel-reassemble-table
+ result
+ (org-babel-pick-name (cdr (assq :colname-names params))
+ (cdr (assq :colnames params)))
+ (org-babel-pick-name (cdr (assq :rowname-names params))
+ (cdr (assq :rownames params))))))
+
+(defun org-babel-prep-session:lua (session params)
+ "Prepare SESSION according to the header arguments in PARAMS.
+VARS contains resolved variable references."
+ (let* ((session (org-babel-lua-initiate-session session))
+ (var-lines
+ (org-babel-variable-assignments:lua params)))
+ (org-babel-comint-in-buffer session
+ (mapc (lambda (var)
+ (end-of-line 1) (insert var) (comint-send-input)
+ (org-babel-comint-wait-for-output session))
+ var-lines))
+ session))
+
+(defun org-babel-load-session:lua (session body params)
+ "Load BODY into SESSION."
+ (save-window-excursion
+ (let ((buffer (org-babel-prep-session:lua session params)))
+ (with-current-buffer buffer
+ (goto-char (process-mark (get-buffer-process (current-buffer))))
+ (insert (org-babel-chomp body)))
+ buffer)))
+
+;; helper functions
+
+(defun org-babel-variable-assignments:lua (params)
+ "Return a list of Lua statements assigning the block's variables."
+ (mapcar
+ (lambda (pair)
+ (format "%s=%s"
+ (car pair)
+ (org-babel-lua-var-to-lua (cdr pair))))
+ (org-babel--get-vars params)))
+
+(defun org-babel-lua-var-to-lua (var)
+ "Convert an elisp value to a lua variable.
+Convert an elisp value, VAR, into a string of lua source code
+specifying a variable of the same value."
+ (if (listp var)
+ (if (and (= 1 (length var)) (not (listp (car var))))
+ (org-babel-lua-var-to-lua (car var))
+ (if (and
+ (= 2 (length var))
+ (not (listp (car var))))
+ (concat
+ (substring-no-properties (car var))
+ "="
+ (org-babel-lua-var-to-lua (cdr var)))
+ (concat "{" (mapconcat #'org-babel-lua-var-to-lua var ", ") "}")))
+ (if (eq var 'hline)
+ org-babel-lua-hline-to
+ (format
+ (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)
+ "Convert RESULTS into an appropriate elisp value.
+If the results look like a list or tuple, then convert them into an
+Emacs-lisp table, otherwise return the results as a string."
+ (let ((res (org-babel-script-escape results)))
+ (if (listp res)
+ (mapcar (lambda (el) (if (eq el 'None)
+ org-babel-lua-None-to el))
+ res)
+ res)))
+
+(defvar org-babel-lua-buffers '((:default . "*Lua*")))
+
+(defun org-babel-lua-session-buffer (session)
+ "Return the buffer associated with SESSION."
+ (cdr (assoc session org-babel-lua-buffers)))
+
+(defun org-babel-lua-with-earmuffs (session)
+ (let ((name (if (stringp session) session (format "%s" session))))
+ (if (and (string= "*" (substring name 0 1))
+ (string= "*" (substring name (- (length name) 1))))
+ name
+ (format "*%s*" name))))
+
+(defun org-babel-lua-without-earmuffs (session)
+ (let ((name (if (stringp session) session (format "%s" session))))
+ (if (and (string= "*" (substring name 0 1))
+ (string= "*" (substring name (- (length name) 1))))
+ (substring name 1 (- (length name) 1))
+ name)))
+
+(defvar lua-default-interpreter)
+(defvar lua-which-bufname)
+(defvar lua-shell-buffer-name)
+(defun org-babel-lua-initiate-session-by-key (&optional session)
+ "Initiate a lua session.
+If there is not a current inferior-process-buffer in SESSION
+then create. Return the initialized session."
+ ;; (require org-babel-lua-mode)
+ (save-window-excursion
+ (let* ((session (if session (intern session) :default))
+ (lua-buffer (org-babel-lua-session-buffer session))
+ ;; (cmd (if (member system-type '(cygwin windows-nt ms-dos))
+ ;; (concat org-babel-lua-command " -i")
+ ;; org-babel-lua-command))
+ )
+ (cond
+ ((and (eq 'lua-mode org-babel-lua-mode)
+ (fboundp 'lua-start-process)) ; lua-mode.el
+ ;; Make sure that lua-which-bufname is initialized, as otherwise
+ ;; it will be overwritten the first time a Lua buffer is
+ ;; created.
+ ;;(lua-toggle-shells lua-default-interpreter)
+ ;; `lua-shell' creates a buffer whose name is the value of
+ ;; `lua-which-bufname' with '*'s at the beginning and end
+ (let* ((bufname (if (and lua-buffer (buffer-live-p lua-buffer))
+ (replace-regexp-in-string ;; zap surrounding *
+ "^\\*\\([^*]+\\)\\*$" "\\1" (buffer-name lua-buffer))
+ (concat "Lua-" (symbol-name session))))
+ (lua-which-bufname bufname))
+ (lua-start-process)
+ (setq lua-buffer (org-babel-lua-with-earmuffs bufname))))
+ (t
+ (error "No function available for running an inferior Lua")))
+ (setq org-babel-lua-buffers
+ (cons (cons session lua-buffer)
+ (assq-delete-all session org-babel-lua-buffers)))
+ session)))
+
+(defun org-babel-lua-initiate-session (&optional session _params)
+ "Create a session named SESSION according to PARAMS."
+ (unless (string= session "none")
+ (error "Sessions currently not supported, work in progress")
+ (org-babel-lua-session-buffer
+ (org-babel-lua-initiate-session-by-key session))))
+
+(defvar org-babel-lua-eoe-indicator "--eoe"
+ "A string to indicate that evaluation has completed.")
+
+(defvar org-babel-lua-wrapper-method
+ "
+function main()
+%s
+end
+
+fd=io.open(\"%s\", \"w\")
+fd:write( main() )
+fd:close()")
+(defvar org-babel-lua-pp-wrapper-method
+ "
+-- table to string
+function t2s(t, indent)
+ if indent == nil then
+ indent = \"\"
+ end
+ if type(t) == \"table\" then
+ ts = \"\"
+ for k,v in pairs(t) do
+ if type(v) == \"table\" then
+ ts = ts .. indent .. t2s(k,indent .. \" \") .. \" = \\n\" ..
+ t2s(v, indent .. \" \")
+ else
+ ts = ts .. indent .. t2s(k,indent .. \" \") .. \" = \" ..
+ t2s(v, indent .. \" \") .. \"\\n\"
+ end
+ end
+ return ts
+ else
+ return tostring(t)
+ end
+end
+
+
+function main()
+%s
+end
+
+fd=io.open(\"%s\", \"w\")
+fd:write(t2s(main()))
+fd:close()")
+
+(defun org-babel-lua-evaluate
+ (session body &optional result-type result-params preamble)
+ "Evaluate BODY as Lua code."
+ (if session
+ (org-babel-lua-evaluate-session
+ session body result-type result-params)
+ (org-babel-lua-evaluate-external-process
+ body result-type result-params preamble)))
+
+(defun org-babel-lua-evaluate-external-process
+ (body &optional result-type result-params preamble)
+ "Evaluate BODY in external lua process.
+If RESULT-TYPE equals `output' then return standard output as a
+string. If RESULT-TYPE equals `value' then return the value of the
+last statement in BODY, as elisp."
+ (let ((raw
+ (pcase result-type
+ (`output (org-babel-eval org-babel-lua-command
+ (concat preamble (and preamble "\n")
+ body)))
+ (`value (let ((tmp-file (org-babel-temp-file "lua-")))
+ (org-babel-eval
+ org-babel-lua-command
+ (concat
+ preamble (and preamble "\n")
+ (format
+ (if (member "pp" result-params)
+ org-babel-lua-pp-wrapper-method
+ org-babel-lua-wrapper-method)
+ (mapconcat
+ (lambda (line) (format "\t%s" line))
+ (split-string
+ (org-remove-indentation
+ (org-trim body))
+ "[\r\n]") "\n")
+ (org-babel-process-file-name tmp-file 'noquote))))
+ (org-babel-eval-read-file tmp-file))))))
+ (org-babel-result-cond result-params
+ raw
+ (org-babel-lua-table-or-string (org-trim raw)))))
+
+(defun org-babel-lua-evaluate-session
+ (session body &optional result-type result-params)
+ "Pass BODY to the Lua process in SESSION.
+If RESULT-TYPE equals `output' then return standard output as a
+string. If RESULT-TYPE equals `value' then return the value of the
+last statement in BODY, as elisp."
+ (let* ((send-wait (lambda () (comint-send-input nil t) (sleep-for 0 5)))
+ (dump-last-value
+ (lambda
+ (tmp-file pp)
+ (mapc
+ (lambda (statement) (insert statement) (funcall send-wait))
+ (if pp
+ (list
+ "-- table to string
+function t2s(t, indent)
+ if indent == nil then
+ indent = \"\"
+ end
+ if type(t) == \"table\" then
+ ts = \"\"
+ for k,v in pairs(t) do
+ if type(v) == \"table\" then
+ ts = ts .. indent .. t2s(k,indent .. \" \") .. \" = \\n\" ..
+ t2s(v, indent .. \" \")
+ else
+ ts = ts .. indent .. t2s(k,indent .. \" \") .. \" = \" ..
+ t2s(v, indent .. \" \") .. \"\\n\"
+ end
+ end
+ return ts
+ else
+ return tostring(t)
+ end
+end
+"
+ (concat "fd:write(_))
+fd:close()"
+ (org-babel-process-file-name tmp-file 'noquote)))
+ (list (format "fd=io.open(\"%s\", \"w\")
+fd:write( _ )
+fd:close()"
+ (org-babel-process-file-name tmp-file
+ 'noquote)))))))
+ (input-body (lambda (body)
+ (mapc (lambda (line) (insert line) (funcall send-wait))
+ (split-string body "[\r\n]"))
+ (funcall send-wait)))
+ (results
+ (pcase result-type
+ (`output
+ (mapconcat
+ #'org-trim
+ (butlast
+ (org-babel-comint-with-output
+ (session org-babel-lua-eoe-indicator t body)
+ (funcall input-body body)
+ (funcall send-wait) (funcall send-wait)
+ (insert org-babel-lua-eoe-indicator)
+ (funcall send-wait))
+ 2) "\n"))
+ (`value
+ (let ((tmp-file (org-babel-temp-file "lua-")))
+ (org-babel-comint-with-output
+ (session org-babel-lua-eoe-indicator nil body)
+ (let ((comint-process-echoes nil))
+ (funcall input-body body)
+ (funcall dump-last-value tmp-file
+ (member "pp" result-params))
+ (funcall send-wait) (funcall send-wait)
+ (insert org-babel-lua-eoe-indicator)
+ (funcall send-wait)))
+ (org-babel-eval-read-file tmp-file))))))
+ (unless (string= (substring org-babel-lua-eoe-indicator 1 -1) results)
+ (org-babel-result-cond result-params
+ results
+ (org-babel-lua-table-or-string results)))))
+
+(defun org-babel-lua-read-string (string)
+ "Strip 's from around Lua string."
+ (org-unbracket-string "'" "'" string))
+
+(provide 'ob-lua)
+
+;;; ob-lua.el ends here
diff --git a/elpa/org-9.5.2/ob-lua.elc b/elpa/org-9.5.2/ob-lua.elc
new file mode 100644
index 0000000..92b65aa
--- /dev/null
+++ b/elpa/org-9.5.2/ob-lua.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-makefile.el b/elpa/org-9.5.2/ob-makefile.el
new file mode 100644
index 0000000..eae64cf
--- /dev/null
+++ b/elpa/org-9.5.2/ob-makefile.el
@@ -0,0 +1,45 @@
+;;; ob-makefile.el --- Babel Functions for Makefile -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Thomas S. Dye
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file exists solely for tangling a Makefile from Org files.
+
+;;; Code:
+(require 'ob)
+
+(defvar org-babel-default-header-args:makefile '())
+
+(defun org-babel-execute:makefile (body _params)
+ "Execute a block of makefile code.
+This function is called by `org-babel-execute-src-block'."
+ body)
+
+(defun org-babel-prep-session:makefile (_session _params)
+ "Signal error; Make does not support sessions."
+ (error "Makefile sessions are nonsensical"))
+
+(provide 'ob-makefile)
+
+;;; ob-makefile.el ends here
diff --git a/elpa/org-9.5.2/ob-makefile.elc b/elpa/org-9.5.2/ob-makefile.elc
new file mode 100644
index 0000000..58a77dd
--- /dev/null
+++ b/elpa/org-9.5.2/ob-makefile.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-matlab.el b/elpa/org-9.5.2/ob-matlab.el
new file mode 100644
index 0000000..45ec5c5
--- /dev/null
+++ b/elpa/org-9.5.2/ob-matlab.el
@@ -0,0 +1,45 @@
+;;; ob-matlab.el --- Babel support for Matlab -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Author: Dan Davison
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Functions that are common to org-babel support for matlab and
+;; octave are in org-babel-octave.el
+
+;;; Requirements:
+
+;; Matlab
+
+;; matlab.el required for interactive emacs sessions and matlab-mode
+;; major mode for source code editing buffer
+;; http://matlab-emacs.sourceforge.net/
+
+;;; Code:
+(require 'ob)
+(require 'ob-octave)
+
+;; see ob-octave for matlab implementation
+
+(provide 'ob-matlab)
+
+;;; ob-matlab.el ends here
diff --git a/elpa/org-9.5.2/ob-matlab.elc b/elpa/org-9.5.2/ob-matlab.elc
new file mode 100644
index 0000000..58a7b56
--- /dev/null
+++ b/elpa/org-9.5.2/ob-matlab.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-maxima.el b/elpa/org-9.5.2/ob-maxima.el
new file mode 100644
index 0000000..7b49bb0
--- /dev/null
+++ b/elpa/org-9.5.2/ob-maxima.el
@@ -0,0 +1,128 @@
+;;; ob-maxima.el --- Babel Functions for Maxima -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric S Fraga
+;; Eric Schulte
+;; Keywords: literate programming, reproducible research, maxima
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating maxima entries.
+;;
+;; This differs from most standard languages in that
+;; 1) there is no such thing as a "session" in maxima
+;; 2) we are adding the "cmdline" header argument
+
+;;; Code:
+(require 'ob)
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("maxima" . "max"))
+
+(defvar org-babel-default-header-args:maxima '())
+
+(defcustom org-babel-maxima-command
+ (if (boundp 'maxima-command) maxima-command "maxima")
+ "Command used to call maxima on the shell."
+ :group 'org-babel
+ :type 'string)
+
+(defun org-babel-maxima-expand (body params)
+ "Expand a block of Maxima code according to its header arguments."
+ (let ((vars (org-babel--get-vars params))
+ (epilogue (cdr (assq :epilogue params)))
+ (prologue (cdr (assq :prologue params))))
+ (mapconcat 'identity
+ (list
+ ;; Any code from the specified prologue at the start.
+ prologue
+ ;; graphic output
+ (let ((graphic-file (ignore-errors (org-babel-graphical-output-file params))))
+ (if graphic-file
+ (format
+ "set_plot_option ([gnuplot_term, png]); set_plot_option ([gnuplot_out_file, %S]);"
+ graphic-file)
+ ""))
+ ;; variables
+ (mapconcat 'org-babel-maxima-var-to-maxima vars "\n")
+ ;; body
+ body
+ ;; Any code from the specified epilogue at the end.
+ epilogue
+ "gnuplot_close ()$")
+ "\n")))
+
+(defun org-babel-execute:maxima (body params)
+ "Execute a block of Maxima entries with org-babel.
+This function is called by `org-babel-execute-src-block'."
+ (message "executing Maxima source code block")
+ (let ((result-params (split-string (or (cdr (assq :results params)) "")))
+ (result
+ (let* ((cmdline (or (cdr (assq :cmdline params)) ""))
+ (in-file (org-babel-temp-file "maxima-" ".max"))
+ (cmd (format "%s --very-quiet -r 'batchload(%S)$' %s"
+ org-babel-maxima-command in-file cmdline)))
+ (with-temp-file in-file (insert (org-babel-maxima-expand body params)))
+ (message cmd)
+ ;; " | grep -v batch | grep -v 'replaced' | sed '/^$/d' "
+ (let ((raw (org-babel-eval cmd "")))
+ (mapconcat
+ #'identity
+ (delq nil
+ (mapcar (lambda (line)
+ (unless (or (string-match "batch" line)
+ (string-match "^rat: replaced .*$" line)
+ (string-match "^;;; Loading #P" line)
+ (= 0 (length line)))
+ line))
+ (split-string raw "[\r\n]"))) "\n")))))
+ (if (ignore-errors (org-babel-graphical-output-file params))
+ nil
+ (org-babel-result-cond result-params
+ result
+ (let ((tmp-file (org-babel-temp-file "maxima-res-")))
+ (with-temp-file tmp-file (insert result))
+ (org-babel-import-elisp-from-file tmp-file))))))
+
+
+(defun org-babel-prep-session:maxima (_session _params)
+ (error "Maxima does not support sessions"))
+
+(defun org-babel-maxima-var-to-maxima (pair)
+ "Convert an elisp val into a string of maxima code specifying a var
+of the same value."
+ (let ((var (car pair))
+ (val (cdr pair)))
+ (when (symbolp val)
+ (setq val (symbol-name val))
+ (when (= (length val) 1)
+ (setq val (string-to-char val))))
+ (format "%S: %s$" var
+ (org-babel-maxima-elisp-to-maxima val))))
+
+(defun org-babel-maxima-elisp-to-maxima (val)
+ "Return a string of maxima code which evaluates to VAL."
+ (if (listp val)
+ (concat "[" (mapconcat #'org-babel-maxima-elisp-to-maxima val ", ") "]")
+ (format "%s" val)))
+
+(provide 'ob-maxima)
+
+;;; ob-maxima.el ends here
diff --git a/elpa/org-9.5.2/ob-maxima.elc b/elpa/org-9.5.2/ob-maxima.elc
new file mode 100644
index 0000000..15aea8a
--- /dev/null
+++ b/elpa/org-9.5.2/ob-maxima.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-ocaml.el b/elpa/org-9.5.2/ob-ocaml.el
new file mode 100644
index 0000000..faf117c
--- /dev/null
+++ b/elpa/org-9.5.2/ob-ocaml.el
@@ -0,0 +1,169 @@
+;;; ob-ocaml.el --- Babel Functions for Ocaml -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating ocaml source code. This one will
+;; be sort of tricky because ocaml programs must be compiled before
+;; they can be run, but ocaml code can also be run through an
+;; interactive interpreter.
+;;
+;; For now lets only allow evaluation using the ocaml interpreter.
+
+;;; Requirements:
+
+;; - tuareg-mode :: https://elpa.nongnu.org/nongnu/tuareg.html
+
+;;; 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" ())
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("ocaml" . "ml"))
+
+(defvar org-babel-default-header-args:ocaml '())
+
+(defvar org-babel-ocaml-eoe-indicator "\"org-babel-ocaml-eoe\";;")
+(defvar org-babel-ocaml-eoe-output "org-babel-ocaml-eoe")
+
+(defcustom org-babel-ocaml-command "ocaml"
+ "Name of the command for executing Ocaml code."
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :group 'org-babel
+ :type 'string)
+
+(defun org-babel-execute:ocaml (body params)
+ "Execute a block of Ocaml code with Babel."
+ (let* ((full-body (org-babel-expand-body:generic
+ body params
+ (org-babel-variable-assignments:ocaml params)))
+ (session (org-babel-prep-session:ocaml
+ (cdr (assq :session params)) params))
+ (raw (org-babel-comint-with-output
+ (session org-babel-ocaml-eoe-output nil full-body)
+ (insert
+ (concat
+ (org-babel-chomp full-body) ";;\n"
+ org-babel-ocaml-eoe-indicator))
+ (tuareg-interactive-send-input)))
+ (clean
+ (car (let ((re (regexp-quote org-babel-ocaml-eoe-output)) out)
+ (delq nil (mapcar (lambda (line)
+ (if out
+ (progn (setq out nil) line)
+ (when (string-match re line)
+ (progn (setq out t) nil))))
+ (mapcar #'org-trim (reverse raw)))))))
+ (raw (org-trim clean))
+ (result-params (cdr (assq :result-params params))))
+ (string-match
+ "\\(\\(.*\n\\)*\\)[^:\n]+ : \\([^=\n]+\\) =[[:space:]]+\\(\\(.\\|\n\\)+\\)$"
+ raw)
+ (let ((output (match-string 1 raw))
+ (type (match-string 3 raw))
+ (value (match-string 4 raw)))
+ (org-babel-reassemble-table
+ (org-babel-result-cond result-params
+ (cond
+ ((member "verbatim" result-params) raw)
+ ((member "output" result-params) output)
+ (t raw))
+ (if (and value type)
+ (org-babel-ocaml-parse-output value type)
+ raw))
+ (org-babel-pick-name
+ (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
+ (org-babel-pick-name
+ (cdr (assq :rowname-names params)) (cdr (assq :rownames params)))))))
+
+(defvar tuareg-interactive-buffer-name)
+(defun org-babel-prep-session:ocaml (session _params)
+ "Prepare SESSION according to the header arguments in PARAMS."
+ (require 'tuareg)
+ (let ((tuareg-interactive-buffer-name (if (and (not (string= session "none"))
+ (not (string= session "default"))
+ (stringp session))
+ session
+ tuareg-interactive-buffer-name)))
+ (save-window-excursion (if (fboundp 'tuareg-run-process-if-needed)
+ (tuareg-run-process-if-needed org-babel-ocaml-command)
+ (tuareg-run-caml)))
+ (get-buffer tuareg-interactive-buffer-name)))
+
+(defun org-babel-variable-assignments:ocaml (params)
+ "Return list of ocaml statements assigning the block's variables."
+ (mapcar
+ (lambda (pair) (format "let %s = %s;;" (car pair)
+ (org-babel-ocaml-elisp-to-ocaml (cdr pair))))
+ (org-babel--get-vars params)))
+
+(defun org-babel-ocaml-elisp-to-ocaml (val)
+ "Return a string of ocaml code which evaluates to VAL."
+ (if (listp val)
+ (concat "[|" (mapconcat #'org-babel-ocaml-elisp-to-ocaml val "; ") "|]")
+ (format "%S" val)))
+
+(defun org-babel-ocaml-parse-output (value type)
+ "Parse VALUE of type TYPE.
+VALUE and TYPE are string output from an ocaml process."
+ (cond
+ ((string= "string" type)
+ (org-babel-read value))
+ ((or (string= "int" type)
+ (string= "float" type))
+ (string-to-number value))
+ ((string-match "list" type)
+ (org-babel-ocaml-read-list value))
+ ((string-match "array" type)
+ (org-babel-ocaml-read-array value))
+ (t (message "don't recognize type %s" type) value)))
+
+(defun org-babel-ocaml-read-list (results)
+ "Convert RESULTS into an elisp table or string.
+If the results look like a table, then convert them into an
+Emacs-lisp table, otherwise return the results as a string."
+ ;; XXX: This probably does not behave as expected when a semicolon
+ ;; is in a string in a list. The same comment applies to
+ ;; `org-babel-ocaml-read-array' below (with even more failure
+ ;; modes).
+ (org-babel-script-escape (replace-regexp-in-string ";" "," results)))
+
+(defun org-babel-ocaml-read-array (results)
+ "Convert RESULTS into an elisp table or string.
+If the results look like a table, then convert them into an
+Emacs-lisp table, otherwise return the results as a string."
+ (org-babel-script-escape
+ (replace-regexp-in-string
+ "\\[|" "[" (replace-regexp-in-string
+ "|\\]" "]" (replace-regexp-in-string
+ "; " "," results)))))
+
+(provide 'ob-ocaml)
+
+;;; ob-ocaml.el ends here
diff --git a/elpa/org-9.5.2/ob-ocaml.elc b/elpa/org-9.5.2/ob-ocaml.elc
new file mode 100644
index 0000000..3dd39bb
--- /dev/null
+++ b/elpa/org-9.5.2/ob-ocaml.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-octave.el b/elpa/org-9.5.2/ob-octave.el
new file mode 100644
index 0000000..bfe3e2a
--- /dev/null
+++ b/elpa/org-9.5.2/ob-octave.el
@@ -0,0 +1,264 @@
+;;; ob-octave.el --- Babel Functions for Octave and Matlab -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Author: Dan Davison
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Requirements:
+
+;; octave
+;; octave-mode.el and octave-inf.el come with GNU emacs
+
+;;; Code:
+(require 'ob)
+(require 'org-macs)
+
+(declare-function matlab-shell "ext:matlab-mode")
+(declare-function matlab-shell-run-region "ext:matlab-mode")
+
+(defvar org-babel-default-header-args:matlab '())
+(defvar org-babel-default-header-args:octave '())
+
+(defvar org-babel-matlab-shell-command "matlab -nosplash"
+ "Shell command to run matlab as an external process.")
+(defvar org-babel-octave-shell-command "octave -q"
+ "Shell command to run octave as an external process.")
+
+(defvar org-babel-matlab-with-emacs-link nil
+ "If non-nil use matlab-shell-run-region for session evaluation.
+This will use EmacsLink if (matlab-with-emacs-link) evaluates
+to a non-nil value.")
+
+(defvar org-babel-matlab-emacs-link-wrapper-method
+ "%s
+if ischar(ans), fid = fopen('%s', 'w'); fprintf(fid, '%%s\\n', ans); fclose(fid);
+else, save -ascii %s ans
+end
+delete('%s')
+")
+(defvar org-babel-octave-wrapper-method
+ "%s
+if ischar(ans), fid = fopen('%s', 'w'); fprintf(fid, '%%s\\n', ans); fclose(fid);
+else, dlmwrite('%s', ans, '\\t')
+end")
+
+(defvar org-babel-octave-eoe-indicator "'org_babel_eoe'")
+
+(defvar org-babel-octave-eoe-output "ans = org_babel_eoe")
+
+(defun org-babel-execute:matlab (body params)
+ "Execute a block of matlab code with Babel."
+ (org-babel-execute:octave body params 'matlab))
+
+(defun org-babel-execute:octave (body params &optional matlabp)
+ "Execute a block of octave code with Babel."
+ (let* ((session
+ (funcall (intern (format "org-babel-%s-initiate-session"
+ (if matlabp "matlab" "octave")))
+ (cdr (assq :session params)) params))
+ (result-type (cdr (assq :result-type params)))
+ (full-body
+ (org-babel-expand-body:generic
+ body params (org-babel-variable-assignments:octave params)))
+ (gfx-file (ignore-errors (org-babel-graphical-output-file params)))
+ (result (org-babel-octave-evaluate
+ session
+ (if gfx-file
+ (mapconcat 'identity
+ (list
+ "set (0, \"defaultfigurevisible\", \"off\");"
+ full-body
+ (format "print -dpng %s" gfx-file))
+ "\n")
+ full-body)
+ result-type matlabp)))
+ (if gfx-file
+ nil
+ (org-babel-reassemble-table
+ result
+ (org-babel-pick-name
+ (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
+ (org-babel-pick-name
+ (cdr (assq :rowname-names params)) (cdr (assq :rownames params)))))))
+
+(defun org-babel-prep-session:matlab (session params)
+ "Prepare SESSION according to PARAMS."
+ (org-babel-prep-session:octave session params 'matlab))
+
+(defun org-babel-variable-assignments:octave (params)
+ "Return list of octave statements assigning the block's variables."
+ (mapcar
+ (lambda (pair)
+ (format "%s=%s;"
+ (car pair)
+ (org-babel-octave-var-to-octave (cdr pair))))
+ (org-babel--get-vars params)))
+
+(defalias 'org-babel-variable-assignments:matlab
+ 'org-babel-variable-assignments:octave)
+
+(defun org-babel-octave-var-to-octave (var)
+ "Convert an emacs-lisp value into an octave variable.
+Converts an emacs-lisp variable into a string of octave code
+specifying a variable of the same value."
+ (if (listp var)
+ (concat "[" (mapconcat #'org-babel-octave-var-to-octave var
+ (if (listp (car var)) "; " ",")) "]")
+ (cond
+ ((stringp var)
+ (format "'%s'" var))
+ (t
+ (format "%s" var)))))
+
+(defun org-babel-prep-session:octave (session params &optional matlabp)
+ "Prepare SESSION according to the header arguments specified in PARAMS."
+ (let* ((session (org-babel-octave-initiate-session session params matlabp))
+ (var-lines (org-babel-variable-assignments:octave params)))
+ (org-babel-comint-in-buffer session
+ (mapc (lambda (var)
+ (end-of-line 1) (insert var) (comint-send-input nil t)
+ (org-babel-comint-wait-for-output session))
+ var-lines))
+ session))
+
+(defun org-babel-matlab-initiate-session (&optional session params)
+ "Create a matlab inferior process buffer.
+If there is not a current inferior-process-buffer in SESSION then
+create. Return the initialized session."
+ (org-babel-octave-initiate-session session params 'matlab))
+
+(defun org-babel-octave-initiate-session (&optional session _params matlabp)
+ "Create an octave inferior process buffer.
+If there is not a current inferior-process-buffer in SESSION then
+create. Return the initialized session."
+ (if matlabp (require 'matlab) (or (require 'octave-inf nil 'noerror)
+ (require 'octave)))
+ (unless (string= session "none")
+ (let ((session (or session
+ (if matlabp "*Inferior Matlab*" "*Inferior Octave*"))))
+ (if (org-babel-comint-buffer-livep session) session
+ (save-window-excursion
+ (if matlabp (unless org-babel-matlab-with-emacs-link (matlab-shell))
+ (run-octave))
+ (rename-buffer (if (bufferp session) (buffer-name session)
+ (if (stringp session) session (buffer-name))))
+ (current-buffer))))))
+
+(defun org-babel-octave-evaluate
+ (session body result-type &optional matlabp)
+ "Pass BODY to the octave process in SESSION.
+If RESULT-TYPE equals `output' then return the outputs of the
+statements in BODY, if RESULT-TYPE equals `value' then return the
+value of the last statement in BODY, as elisp."
+ (if session
+ (org-babel-octave-evaluate-session session body result-type matlabp)
+ (org-babel-octave-evaluate-external-process body result-type matlabp)))
+
+(defun org-babel-octave-evaluate-external-process (body result-type matlabp)
+ "Evaluate BODY in an external octave process."
+ (let ((cmd (if matlabp
+ org-babel-matlab-shell-command
+ org-babel-octave-shell-command)))
+ (pcase result-type
+ (`output (org-babel-eval cmd body))
+ (`value (let ((tmp-file (org-babel-temp-file "octave-")))
+ (org-babel-eval
+ cmd
+ (format org-babel-octave-wrapper-method body
+ (org-babel-process-file-name tmp-file 'noquote)
+ (org-babel-process-file-name tmp-file 'noquote)))
+ (org-babel-octave-import-elisp-from-file tmp-file))))))
+
+(defun org-babel-octave-evaluate-session
+ (session body result-type &optional matlabp)
+ "Evaluate BODY in SESSION."
+ (let* ((tmp-file (org-babel-temp-file (if matlabp "matlab-" "octave-")))
+ (wait-file (org-babel-temp-file "matlab-emacs-link-wait-signal-"))
+ (full-body
+ (pcase result-type
+ (`output
+ (mapconcat
+ #'org-babel-chomp
+ (list body org-babel-octave-eoe-indicator) "\n"))
+ (`value
+ (if (and matlabp org-babel-matlab-with-emacs-link)
+ (concat
+ (format org-babel-matlab-emacs-link-wrapper-method
+ body
+ (org-babel-process-file-name tmp-file 'noquote)
+ (org-babel-process-file-name tmp-file 'noquote) wait-file) "\n")
+ (mapconcat
+ #'org-babel-chomp
+ (list (format org-babel-octave-wrapper-method
+ body
+ (org-babel-process-file-name tmp-file 'noquote)
+ (org-babel-process-file-name tmp-file 'noquote))
+ org-babel-octave-eoe-indicator) "\n")))))
+ (raw (if (and matlabp org-babel-matlab-with-emacs-link)
+ (save-window-excursion
+ (with-temp-buffer
+ (insert full-body)
+ (write-region "" 'ignored wait-file nil nil nil 'excl)
+ (matlab-shell-run-region (point-min) (point-max))
+ (message "Waiting for Matlab Emacs Link")
+ (while (file-exists-p wait-file) (sit-for 0.01))
+ "")) ;; matlab-shell-run-region doesn't seem to
+ ;; make *matlab* buffer contents easily
+ ;; available, so :results output currently
+ ;; won't work
+ (org-babel-comint-with-output
+ (session
+ (if matlabp
+ org-babel-octave-eoe-indicator
+ org-babel-octave-eoe-output)
+ t full-body)
+ (insert full-body) (comint-send-input nil t))))
+ results)
+ (pcase result-type
+ (`value
+ (org-babel-octave-import-elisp-from-file tmp-file))
+ (`output
+ (setq results
+ (if matlabp
+ (cdr (reverse (delq "" (mapcar #'org-strip-quotes
+ (mapcar #'org-trim raw)))))
+ (cdr (member org-babel-octave-eoe-output
+ (reverse (mapcar #'org-strip-quotes
+ (mapcar #'org-trim raw)))))))
+ (mapconcat #'identity (reverse results) "\n")))))
+
+(defun org-babel-octave-import-elisp-from-file (file-name)
+ "Import data from FILE-NAME.
+This removes initial blank and comment lines and then calls
+`org-babel-import-elisp-from-file'."
+ (let ((temp-file (org-babel-temp-file "octave-matlab-")) beg end)
+ (with-temp-file temp-file
+ (insert-file-contents file-name)
+ (re-search-forward "^[ \t]*[^# \t]" nil t)
+ (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)
+
+;;; ob-octave.el ends here
diff --git a/elpa/org-9.5.2/ob-octave.elc b/elpa/org-9.5.2/ob-octave.elc
new file mode 100644
index 0000000..07103ca
--- /dev/null
+++ b/elpa/org-9.5.2/ob-octave.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-org.el b/elpa/org-9.5.2/ob-org.el
new file mode 100644
index 0000000..e29cbb5
--- /dev/null
+++ b/elpa/org-9.5.2/ob-org.el
@@ -0,0 +1,70 @@
+;;; ob-org.el --- Babel Functions for Org Code Blocks -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This is the simplest of code blocks, where upon evaluation the
+;; contents of the code block are returned in a raw result.
+
+;;; Code:
+(require 'ob)
+
+(declare-function org-export-string-as "ox"
+ (string backend &optional body-only ext-plist))
+
+(defvar org-babel-default-header-args:org
+ '((:results . "raw silent") (:exports . "code"))
+ "Default arguments for evaluating an org source block.")
+
+(defvar org-babel-org-default-header
+ "#+TITLE: default empty header\n"
+ "Default header inserted during export of org blocks.")
+
+(defun org-babel-expand-body:org (body params)
+ (dolist (var (org-babel--get-vars params))
+ (setq body (replace-regexp-in-string
+ (regexp-quote (format "$%s" (car var)))
+ (format "%s" (cdr var))
+ body nil 'literal)))
+ body)
+
+(defun org-babel-execute:org (body params)
+ "Execute a block of Org code with.
+This function is called by `org-babel-execute-src-block'."
+ (let ((result-params (split-string (or (cdr (assq :results params)) "")))
+ (body (org-babel-expand-body:org
+ (replace-regexp-in-string "^," "" body) params)))
+ (cond
+ ((member "latex" result-params)
+ (org-export-string-as (concat "#+Title: \n" body) 'latex t))
+ ((member "html" result-params) (org-export-string-as body 'html t))
+ ((member "ascii" result-params) (org-export-string-as body 'ascii t))
+ (t body))))
+
+(defun org-babel-prep-session:org (_session _params)
+ "Return an error because org does not support sessions."
+ (error "Org does not support sessions"))
+
+(provide 'ob-org)
+
+;;; ob-org.el ends here
diff --git a/elpa/org-9.5.2/ob-org.elc b/elpa/org-9.5.2/ob-org.elc
new file mode 100644
index 0000000..1585f9f
--- /dev/null
+++ b/elpa/org-9.5.2/ob-org.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-perl.el b/elpa/org-9.5.2/ob-perl.el
new file mode 100644
index 0000000..4d405a8
--- /dev/null
+++ b/elpa/org-9.5.2/ob-perl.el
@@ -0,0 +1,156 @@
+;;; ob-perl.el --- Babel Functions for Perl -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Authors: Dan Davison
+;; Eric Schulte
+;; Maintainer: Corwin Brust
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating perl source code.
+
+;;; Code:
+(require 'ob)
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("perl" . "pl"))
+
+(defvar org-babel-default-header-args:perl '())
+
+(defvar org-babel-perl-command "perl"
+ "Name of command to use for executing perl code.")
+
+(defun org-babel-execute:perl (body params)
+ "Execute a block of Perl code with Babel.
+This function is called by `org-babel-execute-src-block'."
+ (let* ((session (cdr (assq :session params)))
+ (result-params (cdr (assq :result-params params)))
+ (result-type (cdr (assq :result-type params)))
+ (full-body (org-babel-expand-body:generic
+ body params (org-babel-variable-assignments:perl params)))
+ (session (org-babel-perl-initiate-session session)))
+ (org-babel-reassemble-table
+ (org-babel-perl-evaluate session full-body result-type result-params)
+ (org-babel-pick-name
+ (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
+ (org-babel-pick-name
+ (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))
+
+(defun org-babel-prep-session:perl (_session _params)
+ "Prepare SESSION according to the header arguments in PARAMS."
+ (error "Sessions are not supported for Perl"))
+
+(defun org-babel-variable-assignments:perl (params)
+ "Return list of perl statements assigning the block's variables."
+ (mapcar
+ (lambda (pair)
+ (org-babel-perl--var-to-perl (cdr pair) (car pair)))
+ (org-babel--get-vars params)))
+
+;; helper functions
+
+(defvar org-babel-perl-var-wrap "q(%s)"
+ "Wrapper for variables inserted into Perl code.")
+
+(defvar org-babel-perl--lvl)
+(defun org-babel-perl--var-to-perl (var &optional varn)
+ "Convert an elisp value to a perl variable.
+The elisp value, VAR, is converted to a string of perl source code
+specifying a var of the same value."
+ (if varn
+ (let ((org-babel-perl--lvl 0) (lvar (listp var)))
+ (concat "my $" (symbol-name varn) "=" (when lvar "\n")
+ (org-babel-perl--var-to-perl var)
+ ";\n"))
+ (let ((prefix (make-string (* 2 org-babel-perl--lvl) ?\ )))
+ (concat prefix
+ (if (listp var)
+ (let ((org-babel-perl--lvl (1+ org-babel-perl--lvl)))
+ (concat "[\n"
+ (mapconcat #'org-babel-perl--var-to-perl var "")
+ prefix "]"))
+ (format "q(%s)" var))
+ (unless (zerop org-babel-perl--lvl) ",\n")))))
+
+(defvar org-babel-perl-buffers '(:default . nil))
+
+(defun org-babel-perl-initiate-session (&optional _session _params)
+ "Return nil because sessions are not supported by perl."
+ nil)
+
+(defvar org-babel-perl-wrapper-method "{
+ my $babel_sub = sub {
+ %s
+ };
+ open my $BOH, qq(>%s) or die qq(Perl: Could not open output file.$/);
+ my $rv = &$babel_sub();
+ my $rt = ref $rv;
+ select $BOH;
+ if (qq(ARRAY) eq $rt) {
+ local $\\=$/;
+ local $,=qq(\t);
+ foreach my $rv ( @$rv ) {
+ my $rt = ref $rv;
+ if (qq(ARRAY) eq $rt) {
+ print @$rv;
+ } else {
+ print $rv;
+ }
+ }
+ } else {
+ print $rv;
+ }
+}")
+
+(defvar org-babel-perl-preface nil)
+
+(defvar org-babel-perl-pp-wrapper-method
+ nil)
+
+(defun org-babel-perl-evaluate (session ibody &optional result-type result-params)
+ "Pass BODY to the Perl process in SESSION.
+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, as elisp."
+ (when session (error "Sessions are not supported for Perl"))
+ (let* ((body (concat org-babel-perl-preface ibody))
+ (tmp-file (org-babel-temp-file "perl-"))
+ (tmp-babel-file (org-babel-process-file-name
+ tmp-file 'noquote)))
+ (let ((results
+ (pcase result-type
+ (`output
+ (with-temp-file tmp-file
+ (insert
+ (org-babel-eval org-babel-perl-command body))
+ (buffer-string)))
+ (`value
+ (org-babel-eval org-babel-perl-command
+ (format org-babel-perl-wrapper-method
+ body tmp-babel-file))))))
+ (when results
+ (org-babel-result-cond result-params
+ (org-babel-eval-read-file tmp-file)
+ (org-babel-import-elisp-from-file tmp-file '(16)))))))
+
+(provide 'ob-perl)
+
+;;; ob-perl.el ends here
diff --git a/elpa/org-9.5.2/ob-perl.elc b/elpa/org-9.5.2/ob-perl.elc
new file mode 100644
index 0000000..0ec4cb4
--- /dev/null
+++ b/elpa/org-9.5.2/ob-perl.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-plantuml.el b/elpa/org-9.5.2/ob-plantuml.el
new file mode 100644
index 0000000..fc62160
--- /dev/null
+++ b/elpa/org-9.5.2/ob-plantuml.el
@@ -0,0 +1,165 @@
+;;; ob-plantuml.el --- Babel Functions for Plantuml -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Author: Zhang Weize
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating plantuml script.
+;;
+;; Inspired by Ian Yang's org-export-blocks-format-plantuml
+;; https://www.emacswiki.org/emacs/org-export-blocks-format-plantuml.el
+
+;;; Requirements:
+
+;; plantuml | http://plantuml.sourceforge.net/
+;; plantuml.jar | `org-plantuml-jar-path' should point to the jar file (when exec mode is `jar')
+
+;;; Code:
+(require 'ob)
+
+(defvar org-babel-default-header-args:plantuml
+ '((:results . "file") (:exports . "results"))
+ "Default arguments for evaluating a plantuml source block.")
+
+(defcustom org-plantuml-jar-path ""
+ "Path to the plantuml.jar file."
+ :group 'org-babel
+ :version "24.1"
+ :type 'string)
+
+(defcustom org-plantuml-exec-mode 'jar
+ "Method to use for PlantUML diagram generation.
+`jar' means to use java together with the JAR.
+The JAR can be configured via `org-plantuml-jar-path'.
+
+`plantuml' means to use the PlantUML executable.
+The executable can be configured via `org-plantuml-executable-path'.
+You can also configure extra arguments via `org-plantuml-executable-args'."
+ :group 'org-babel
+ :package-version '(Org . "9.4")
+ :type 'symbol
+ :options '(jar plantuml))
+
+(defcustom org-plantuml-executable-path "plantuml"
+ "File name of the PlantUML executable."
+ :group 'org-babel
+ :package-version '(Org . "9.4")
+ :type 'string)
+
+(defcustom org-plantuml-executable-args (list "-headless")
+ "The arguments passed to plantuml executable when executing PlantUML."
+ :group 'org-babel
+ :package-version '(Org . "9.4")
+ :type '(repeat string))
+
+(defcustom org-babel-plantuml-svg-text-to-path nil
+ "When non-nil, export text in SVG images to paths using Inkscape."
+ :group 'org-babel
+ :package-version '(Org . "9.5")
+ :type 'boolean)
+
+(defun org-babel-variable-assignments:plantuml (params)
+ "Return a list of PlantUML statements assigning the block's variables.
+PARAMS is a property list of source block parameters, which may
+contain multiple entries for the key `:var'. `:var' entries in PARAMS
+are expected to be scalar variables."
+ (mapcar
+ (lambda (pair)
+ (format "!define %s %s"
+ (car pair)
+ (replace-regexp-in-string "\"" "" (cdr pair))))
+ (org-babel--get-vars params)))
+
+(defun org-babel-plantuml-make-body (body params)
+ "Return PlantUML input string.
+
+BODY is the content of the source block and PARAMS is a property list
+of source block parameters. This function relies on the
+`org-babel-expand-body:generic' function to extract `:var' entries
+from PARAMS and on the `org-babel-variable-assignments:plantuml'
+function to convert variables to PlantUML assignments.
+
+If BODY does not contain @startXXX ... @endXXX clauses, @startuml
+... @enduml will be added."
+ (let ((full-body
+ (org-babel-expand-body:generic
+ body params (org-babel-variable-assignments:plantuml params))))
+ (if (string-prefix-p "@start" body t) full-body
+ (format "@startuml\n%s\n@enduml" full-body))))
+
+(defun org-babel-execute:plantuml (body params)
+ "Execute a block of plantuml code with org-babel.
+This function is called by `org-babel-execute-src-block'."
+ (let* ((out-file (or (cdr (assq :file params))
+ (error "PlantUML requires a \":file\" header argument")))
+ (cmdline (cdr (assq :cmdline params)))
+ (in-file (org-babel-temp-file "plantuml-"))
+ (java (or (cdr (assq :java params)) ""))
+ (executable (cond ((eq org-plantuml-exec-mode 'plantuml) org-plantuml-executable-path)
+ (t "java")))
+ (executable-args (cond ((eq org-plantuml-exec-mode 'plantuml) org-plantuml-executable-args)
+ ((string= "" org-plantuml-jar-path)
+ (error "`org-plantuml-jar-path' is not set"))
+ ((not (file-exists-p org-plantuml-jar-path))
+ (error "Could not find plantuml.jar at %s" org-plantuml-jar-path))
+ (t (list java
+ "-jar"
+ (shell-quote-argument (expand-file-name org-plantuml-jar-path))))))
+ (full-body (org-babel-plantuml-make-body body params))
+ (cmd (mapconcat #'identity
+ (append
+ (list executable)
+ executable-args
+ (pcase (file-name-extension out-file)
+ ("png" '("-tpng"))
+ ("svg" '("-tsvg"))
+ ("eps" '("-teps"))
+ ("pdf" '("-tpdf"))
+ ("tex" '("-tlatex"))
+ ("vdx" '("-tvdx"))
+ ("xmi" '("-txmi"))
+ ("scxml" '("-tscxml"))
+ ("html" '("-thtml"))
+ ("txt" '("-ttxt"))
+ ("utxt" '("-utxt")))
+ (list
+ "-p"
+ cmdline
+ "<"
+ (org-babel-process-file-name in-file)
+ ">"
+ (org-babel-process-file-name out-file)))
+ " ")))
+ (with-temp-file in-file (insert full-body))
+ (message "%s" cmd) (org-babel-eval cmd "")
+ (if (and (string= (file-name-extension out-file) "svg")
+ org-babel-plantuml-svg-text-to-path)
+ (org-babel-eval (format "inkscape %s -T -l %s" out-file out-file) ""))
+ nil)) ;; signal that output has already been written to file
+
+(defun org-babel-prep-session:plantuml (_session _params)
+ "Return an error because plantuml does not support sessions."
+ (error "Plantuml does not support sessions"))
+
+(provide 'ob-plantuml)
+
+;;; ob-plantuml.el ends here
diff --git a/elpa/org-9.5.2/ob-plantuml.elc b/elpa/org-9.5.2/ob-plantuml.elc
new file mode 100644
index 0000000..29395a1
--- /dev/null
+++ b/elpa/org-9.5.2/ob-plantuml.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-processing.el b/elpa/org-9.5.2/ob-processing.el
new file mode 100644
index 0000000..84fd6a2
--- /dev/null
+++ b/elpa/org-9.5.2/ob-processing.el
@@ -0,0 +1,195 @@
+;;; ob-processing.el --- Babel functions for processing -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
+
+;; Author: Jarmo Hurri (adapted from ob-asymptote.el written by Eric Schulte)
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Babel support for evaluating processing source code.
+;;
+;; This differs from most standard languages in that
+;;
+;; 1) there is no such thing as a "session" in processing
+;;
+;; 2) results can only be exported as html; in this case, the
+;; processing code is embedded via a file into a javascript block
+;; using the processing.js module; the script then draws the
+;; resulting output when the web page is viewed in a browser; note
+;; that the user is responsible for making sure that processing.js
+;; is available on the website
+;;
+;; 3) it is possible to interactively view the sketch of the
+;; Processing code block via Processing 2.0 Emacs mode, using
+;; `org-babel-processing-view-sketch'. You can bind this command
+;; to, e.g., C-c C-v C-k with
+;;
+;; (define-key org-babel-map (kbd "C-k") 'org-babel-processing-view-sketch)
+
+
+;;; Requirements:
+
+;; - processing2-emacs mode :: https://github.com/ptrv/processing2-emacs
+;; - Processing.js module :: https://processingjs.org/
+
+;;; Code:
+(require 'ob)
+(require 'sha1)
+
+(declare-function processing-sketch-run "ext:processing-mode" ())
+
+(defvar org-babel-temporary-directory)
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("processing" . "pde"))
+
+;; Default header tags depend on whether exporting html or not; if not
+;; exporting html, then no results are produced; otherwise results are
+;; HTML.
+(defvar org-babel-default-header-args:processing
+ '((:results . "html") (:exports . "results"))
+ "Default arguments when evaluating a Processing source block.")
+
+(defvar org-babel-processing-processing-js-filename "processing.js"
+ "Filename of the processing.js file.")
+
+(defun org-babel-processing-view-sketch ()
+ "Show the sketch of the Processing block under point in an external viewer."
+ (interactive)
+ (require 'processing-mode)
+ (let ((info (org-babel-get-src-block-info)))
+ (if (string= (nth 0 info) "processing")
+ (let* ((body (nth 1 info))
+ (params (org-babel-process-params (nth 2 info)))
+ (sketch-code
+ (org-babel-expand-body:generic
+ body
+ params
+ (org-babel-variable-assignments:processing params))))
+ ;; Note: sketch filename can not contain a hyphen, since it
+ ;; has to be a valid java class name; for this reason
+ ;; make-temp-file is repeated until no hyphen is in the
+ ;; name; also sketch dir name must be the same as the
+ ;; basename of the sketch file.
+ (let* ((temporary-file-directory org-babel-temporary-directory)
+ (sketch-dir
+ (let (sketch-dir-candidate)
+ (while
+ (progn
+ (setq sketch-dir-candidate
+ (make-temp-file "processing" t))
+ (when (string-match-p
+ "-"
+ (file-name-nondirectory sketch-dir-candidate))
+ (delete-directory sketch-dir-candidate)
+ t)))
+ sketch-dir-candidate))
+ (sketch-filename
+ (concat sketch-dir
+ "/"
+ (file-name-nondirectory sketch-dir)
+ ".pde")))
+ (with-temp-file sketch-filename (insert sketch-code))
+ (find-file sketch-filename)
+ (processing-sketch-run)
+ (kill-buffer)))
+ (message "Not inside a Processing source block."))))
+
+(defun org-babel-execute:processing (body params)
+ "Execute a block of Processing code.
+This function is called by `org-babel-execute-src-block'."
+ (let ((sketch-code
+ (org-babel-expand-body:generic
+ body
+ params
+ (org-babel-variable-assignments:processing params))))
+ ;; Results are HTML.
+ (let ((sketch-canvas-id (concat "ob-" (sha1 sketch-code))))
+ (concat "<script src=\""
+ org-babel-processing-processing-js-filename
+ "\"></script>\n <script type=\"text/processing\""
+ " data-processing-target=\""
+ sketch-canvas-id
+ "\">\n"
+ sketch-code
+ "\n</script> <canvas id=\""
+ sketch-canvas-id
+ "\"></canvas>"))))
+
+(defun org-babel-prep-session:processing (_session _params)
+ "Return an error if the :session header argument is set.
+Processing does not support sessions."
+ (error "Processing does not support sessions"))
+
+(defun org-babel-variable-assignments:processing (params)
+ "Return list of processing statements assigning the block's variables."
+ (mapcar #'org-babel-processing-var-to-processing
+ (org-babel--get-vars params)))
+
+(defun org-babel-processing-var-to-processing (pair)
+ "Convert an elisp value into a Processing variable.
+The elisp value PAIR is converted into Processing code specifying
+a variable of the same value."
+ (let ((var (car pair))
+ (val (let ((v (cdr pair)))
+ (if (symbolp v) (symbol-name v) v))))
+ (cond
+ ((integerp val)
+ (format "int %S=%S;" var val))
+ ((floatp val)
+ (format "float %S=%S;" var val))
+ ((stringp val)
+ (format "String %S=\"%s\";" var val))
+ ((and (listp val) (not (listp (car val))))
+ (let* ((type (org-babel-processing-define-type val))
+ (fmt (if (eq 'String type) "\"%s\"" "%s"))
+ (vect (mapconcat (lambda (e) (format fmt e)) val ", ")))
+ (format "%s[] %S={%s};" type var vect)))
+ ((listp val)
+ (let* ((type (org-babel-processing-define-type val))
+ (fmt (if (eq 'String type) "\"%s\"" "%s"))
+ (array (mapconcat (lambda (row)
+ (concat "{"
+ (mapconcat (lambda (e) (format fmt e))
+ row ", ")
+ "}"))
+ val ",")))
+ (format "%S[][] %S={%s};" type var array))))))
+
+(defun org-babel-processing-define-type (data)
+ "Determine type of DATA.
+
+DATA is a list. Return type as a symbol.
+
+The type is `String' if any element in DATA is a string.
+Otherwise, it is either `float', if some elements are floats, or
+`int'."
+ (letrec ((type 'int)
+ (find-type
+ (lambda (row)
+ (dolist (e row type)
+ (cond ((listp e) (setq type (funcall find-type e)))
+ ((stringp e) (throw 'exit 'String))
+ ((floatp e) (setq type 'float)))))))
+ (catch 'exit (funcall find-type data))))
+
+(provide 'ob-processing)
+
+;;; ob-processing.el ends here
diff --git a/elpa/org-9.5.2/ob-processing.elc b/elpa/org-9.5.2/ob-processing.elc
new file mode 100644
index 0000000..f4e6130
--- /dev/null
+++ b/elpa/org-9.5.2/ob-processing.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-python.el b/elpa/org-9.5.2/ob-python.el
new file mode 100644
index 0000000..3c095ad
--- /dev/null
+++ b/elpa/org-9.5.2/ob-python.el
@@ -0,0 +1,444 @@
+;;; ob-python.el --- Babel Functions for Python -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Authors: Eric Schulte
+;; Dan Davison
+;; Maintainer: Jack Kamm <jackkamm@gmail.com>
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating python source code.
+
+;;; Code:
+(require 'ob)
+(require 'org-macs)
+(require 'python)
+
+(declare-function py-shell "ext:python-mode" (&rest args))
+(declare-function py-toggle-shells "ext:python-mode" (arg))
+(declare-function py-shell-send-string "ext:python-mode" (strg &optional process))
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("python" . "py"))
+
+(defvar org-babel-default-header-args:python '())
+
+(defcustom org-babel-python-command "python"
+ "Name of the command for executing Python code."
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :group 'org-babel
+ :type 'string)
+
+(defcustom org-babel-python-mode
+ (if (featurep 'python-mode) 'python-mode 'python)
+ "Preferred python mode for use in running python interactively.
+This will typically be either `python' or `python-mode'."
+ :group 'org-babel
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'symbol)
+
+(defcustom org-babel-python-hline-to "None"
+ "Replace hlines in incoming tables with this when translating to python."
+ :group 'org-babel
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string)
+
+(defcustom org-babel-python-None-to 'hline
+ "Replace `None' in python tables with this before returning."
+ :group 'org-babel
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'symbol)
+
+(defun org-babel-execute:python (body params)
+ "Execute a block of Python code with Babel.
+This function is called by `org-babel-execute-src-block'."
+ (let* ((org-babel-python-command
+ (or (cdr (assq :python params))
+ org-babel-python-command))
+ (session (org-babel-python-initiate-session
+ (cdr (assq :session params))))
+ (result-params (cdr (assq :result-params params)))
+ (result-type (cdr (assq :result-type params)))
+ (return-val (when (eq result-type 'value)
+ (cdr (assq :return params))))
+ (preamble (cdr (assq :preamble params)))
+ (async (org-babel-comint-use-async params))
+ (full-body
+ (concat
+ (org-babel-expand-body:generic
+ body params
+ (org-babel-variable-assignments:python params))
+ (when return-val
+ (format (if session "\n%s" "\nreturn %s") return-val))))
+ (result (org-babel-python-evaluate
+ session full-body result-type
+ result-params preamble async)))
+ (org-babel-reassemble-table
+ result
+ (org-babel-pick-name (cdr (assq :colname-names params))
+ (cdr (assq :colnames params)))
+ (org-babel-pick-name (cdr (assq :rowname-names params))
+ (cdr (assq :rownames params))))))
+
+(defun org-babel-prep-session:python (session params)
+ "Prepare SESSION according to the header arguments in PARAMS.
+VARS contains resolved variable references."
+ (let* ((session (org-babel-python-initiate-session session))
+ (var-lines
+ (org-babel-variable-assignments:python params)))
+ (org-babel-comint-in-buffer session
+ (mapc (lambda (var)
+ (end-of-line 1) (insert var) (comint-send-input)
+ (org-babel-comint-wait-for-output session))
+ var-lines))
+ session))
+
+(defun org-babel-load-session:python (session body params)
+ "Load BODY into SESSION."
+ (save-window-excursion
+ (let ((buffer (org-babel-prep-session:python session params)))
+ (with-current-buffer buffer
+ (goto-char (process-mark (get-buffer-process (current-buffer))))
+ (insert (org-babel-chomp body)))
+ buffer)))
+
+;; helper functions
+
+(defun org-babel-variable-assignments:python (params)
+ "Return a list of Python statements assigning the block's variables."
+ (mapcar
+ (lambda (pair)
+ (format "%s=%s"
+ (car pair)
+ (org-babel-python-var-to-python (cdr pair))))
+ (org-babel--get-vars params)))
+
+(defun org-babel-python-var-to-python (var)
+ "Convert an elisp value to a python variable.
+Convert an elisp value, VAR, into a string of python source code
+specifying a variable of the same value."
+ (if (listp var)
+ (concat "[" (mapconcat #'org-babel-python-var-to-python var ", ") "]")
+ (if (eq var 'hline)
+ org-babel-python-hline-to
+ (format
+ (if (and (stringp var) (string-match "[\n\r]" var)) "\"\"%S\"\"" "%S")
+ (if (stringp var) (substring-no-properties var) var)))))
+
+(defun org-babel-python-table-or-string (results)
+ "Convert RESULTS into an appropriate elisp value.
+If the results look like a list or tuple, then convert them into an
+Emacs-lisp table, otherwise return the results as a string."
+ (let ((res (org-babel-script-escape results)))
+ (if (listp res)
+ (mapcar (lambda (el) (if (eq el 'None)
+ org-babel-python-None-to el))
+ res)
+ res)))
+
+(defvar org-babel-python-buffers '((:default . "*Python*")))
+
+(defun org-babel-python-session-buffer (session)
+ "Return the buffer associated with SESSION."
+ (cdr (assoc session org-babel-python-buffers)))
+
+(defun org-babel-python-with-earmuffs (session)
+ (let ((name (if (stringp session) session (format "%s" session))))
+ (if (and (string= "*" (substring name 0 1))
+ (string= "*" (substring name (- (length name) 1))))
+ name
+ (format "*%s*" name))))
+
+(defun org-babel-python-without-earmuffs (session)
+ (let ((name (if (stringp session) session (format "%s" session))))
+ (if (and (string= "*" (substring name 0 1))
+ (string= "*" (substring name (- (length name) 1))))
+ (substring name 1 (- (length name) 1))
+ name)))
+
+(defvar py-default-interpreter)
+(defvar py-which-bufname)
+(defvar python-shell-buffer-name)
+(defun org-babel-python-initiate-session-by-key (&optional session)
+ "Initiate a python session.
+If there is not a current inferior-process-buffer in SESSION
+then create. Return the initialized session."
+ (save-window-excursion
+ (let* ((session (if session (intern session) :default))
+ (py-buffer (org-babel-python-session-buffer session))
+ (cmd (if (member system-type '(cygwin windows-nt ms-dos))
+ (concat org-babel-python-command " -i")
+ org-babel-python-command)))
+ (cond
+ ((eq 'python org-babel-python-mode) ; python.el
+ (unless py-buffer
+ (setq py-buffer (org-babel-python-with-earmuffs session)))
+ (let ((python-shell-buffer-name
+ (org-babel-python-without-earmuffs py-buffer)))
+ (run-python cmd)
+ (sleep-for 0 10)))
+ ((and (eq 'python-mode org-babel-python-mode)
+ (fboundp 'py-shell)) ; python-mode.el
+ (require 'python-mode)
+ ;; Make sure that py-which-bufname is initialized, as otherwise
+ ;; it will be overwritten the first time a Python buffer is
+ ;; created.
+ (py-toggle-shells py-default-interpreter)
+ ;; `py-shell' creates a buffer whose name is the value of
+ ;; `py-which-bufname' with '*'s at the beginning and end
+ (let* ((bufname (if (and py-buffer (buffer-live-p py-buffer))
+ (replace-regexp-in-string ;; zap surrounding *
+ "^\\*\\([^*]+\\)\\*$" "\\1" py-buffer)
+ (concat "Python-" (symbol-name session))))
+ (py-which-bufname bufname))
+ (setq py-buffer (org-babel-python-with-earmuffs bufname))
+ (py-shell nil nil t org-babel-python-command py-buffer nil nil t nil)))
+ (t
+ (error "No function available for running an inferior Python")))
+ (setq org-babel-python-buffers
+ (cons (cons session py-buffer)
+ (assq-delete-all session org-babel-python-buffers)))
+ session)))
+
+(defun org-babel-python-initiate-session (&optional session _params)
+ "Create a session named SESSION according to PARAMS."
+ (unless (string= session "none")
+ (org-babel-python-session-buffer
+ (org-babel-python-initiate-session-by-key session))))
+
+(defvar org-babel-python-eoe-indicator "org_babel_python_eoe"
+ "A string to indicate that evaluation has completed.")
+
+(defconst org-babel-python-wrapper-method
+ "
+def main():
+%s
+
+open('%s', 'w').write( str(main()) )")
+(defconst org-babel-python-pp-wrapper-method
+ "
+import pprint
+def main():
+%s
+
+open('%s', 'w').write( pprint.pformat(main()) )")
+
+(defconst org-babel-python--exec-tmpfile "\
+with open('%s') as __org_babel_python_tmpfile:
+ exec(compile(__org_babel_python_tmpfile.read(), __org_babel_python_tmpfile.name, 'exec'))"
+ "Template for Python session command with output results.
+
+Has a single %s escape, the tempfile containing the source code
+to evaluate.")
+
+(defun org-babel-python-format-session-value
+ (src-file result-file result-params)
+ "Return Python code to evaluate SRC-FILE and write result to RESULT-FILE."
+ (format "\
+import ast
+with open('%s') as __org_babel_python_tmpfile:
+ __org_babel_python_ast = ast.parse(__org_babel_python_tmpfile.read())
+__org_babel_python_final = __org_babel_python_ast.body[-1]
+if isinstance(__org_babel_python_final, ast.Expr):
+ __org_babel_python_ast.body = __org_babel_python_ast.body[:-1]
+ exec(compile(__org_babel_python_ast, '<string>', 'exec'))
+ __org_babel_python_final = eval(compile(ast.Expression(
+ __org_babel_python_final.value), '<string>', 'eval'))
+ with open('%s', 'w') as __org_babel_python_tmpfile:
+ if %s:
+ import pprint
+ __org_babel_python_tmpfile.write(pprint.pformat(__org_babel_python_final))
+ else:
+ __org_babel_python_tmpfile.write(str(__org_babel_python_final))
+else:
+ exec(compile(__org_babel_python_ast, '<string>', 'exec'))
+ __org_babel_python_final = None"
+ (org-babel-process-file-name src-file 'noquote)
+ (org-babel-process-file-name result-file 'noquote)
+ (if (member "pp" result-params) "True" "False")))
+
+(defun org-babel-python-evaluate
+ (session body &optional result-type result-params preamble async)
+ "Evaluate BODY as Python code."
+ (if session
+ (if async
+ (org-babel-python-async-evaluate-session
+ session body result-type result-params)
+ (org-babel-python-evaluate-session
+ session body result-type result-params))
+ (org-babel-python-evaluate-external-process
+ body result-type result-params preamble)))
+
+(defun org-babel-python--shift-right (body &optional count)
+ (with-temp-buffer
+ (python-mode)
+ (insert body)
+ (goto-char (point-min))
+ (while (not (eobp))
+ (unless (python-syntax-context 'string)
+ (python-indent-shift-right (line-beginning-position)
+ (line-end-position)
+ count))
+ (forward-line 1))
+ (buffer-string)))
+
+(defun org-babel-python-evaluate-external-process
+ (body &optional result-type result-params preamble)
+ "Evaluate BODY in external python process.
+If RESULT-TYPE equals `output' then return standard output as a
+string. If RESULT-TYPE equals `value' then return the value of the
+last statement in BODY, as elisp."
+ (let ((raw
+ (pcase result-type
+ (`output (org-babel-eval org-babel-python-command
+ (concat preamble (and preamble "\n")
+ body)))
+ (`value (let ((tmp-file (org-babel-temp-file "python-")))
+ (org-babel-eval
+ org-babel-python-command
+ (concat
+ preamble (and preamble "\n")
+ (format
+ (if (member "pp" result-params)
+ org-babel-python-pp-wrapper-method
+ org-babel-python-wrapper-method)
+ (org-babel-python--shift-right body)
+ (org-babel-process-file-name tmp-file 'noquote))))
+ (org-babel-eval-read-file tmp-file))))))
+ (org-babel-result-cond result-params
+ raw
+ (org-babel-python-table-or-string (org-trim raw)))))
+
+(defun org-babel-python--send-string (session body)
+ "Pass BODY to the Python process in SESSION.
+Return output."
+ (with-current-buffer session
+ (let* ((string-buffer "")
+ (comint-output-filter-functions
+ (cons (lambda (text) (setq string-buffer
+ (concat string-buffer text)))
+ comint-output-filter-functions))
+ (body (format "\
+try:
+%s
+except:
+ raise
+finally:
+ print('%s')"
+ (org-babel-python--shift-right body 4)
+ org-babel-python-eoe-indicator)))
+ (if (not (eq 'python-mode org-babel-python-mode))
+ (let ((python-shell-buffer-name
+ (org-babel-python-without-earmuffs session)))
+ (python-shell-send-string body))
+ (require 'python-mode)
+ (py-shell-send-string body (get-buffer-process session)))
+ ;; same as `python-shell-comint-end-of-output-p' in emacs-25.1+
+ (while (not (string-match
+ org-babel-python-eoe-indicator
+ string-buffer))
+ (accept-process-output (get-buffer-process (current-buffer))))
+ (org-babel-chomp (substring string-buffer 0 (match-beginning 0))))))
+
+(defun org-babel-python-evaluate-session
+ (session body &optional result-type result-params)
+ "Pass BODY to the Python process in SESSION.
+If RESULT-TYPE equals `output' then return standard output as a
+string. If RESULT-TYPE equals `value' then return the value of the
+last statement in BODY, as elisp."
+ (let* ((tmp-src-file (org-babel-temp-file "python-"))
+ (results
+ (progn
+ (with-temp-file tmp-src-file (insert body))
+ (pcase result-type
+ (`output
+ (let ((body (format org-babel-python--exec-tmpfile
+ (org-babel-process-file-name
+ tmp-src-file 'noquote))))
+ (org-babel-python--send-string session body)))
+ (`value
+ (let* ((tmp-results-file (org-babel-temp-file "python-"))
+ (body (org-babel-python-format-session-value
+ tmp-src-file tmp-results-file result-params)))
+ (org-babel-python--send-string session body)
+ (sleep-for 0 10)
+ (org-babel-eval-read-file tmp-results-file)))))))
+ (org-babel-result-cond result-params
+ results
+ (org-babel-python-table-or-string results))))
+
+(defun org-babel-python-read-string (string)
+ "Strip \\='s from around Python string."
+ (if (and (string-prefix-p "'" string)
+ (string-suffix-p "'" string))
+ (substring string 1 -1)
+ string))
+
+;; Async session eval
+
+(defconst org-babel-python-async-indicator "print ('ob_comint_async_python_%s_%s')")
+
+(defun org-babel-python-async-value-callback (params tmp-file)
+ (let ((result-params (cdr (assq :result-params params)))
+ (results (org-babel-eval-read-file tmp-file)))
+ (org-babel-result-cond result-params
+ results
+ (org-babel-python-table-or-string results))))
+
+(defun org-babel-python-async-evaluate-session
+ (session body &optional result-type result-params)
+ "Asynchronously evaluate BODY in SESSION.
+Returns a placeholder string for insertion, to later be replaced
+by `org-babel-comint-async-filter'."
+ (org-babel-comint-async-register
+ session (current-buffer)
+ "ob_comint_async_python_\\(.+\\)_\\(.+\\)"
+ 'org-babel-chomp 'org-babel-python-async-value-callback)
+ (let ((python-shell-buffer-name (org-babel-python-without-earmuffs session)))
+ (pcase result-type
+ (`output
+ (let ((uuid (md5 (number-to-string (random 100000000)))))
+ (with-temp-buffer
+ (insert (format org-babel-python-async-indicator "start" uuid))
+ (insert "\n")
+ (insert body)
+ (insert "\n")
+ (insert (format org-babel-python-async-indicator "end" uuid))
+ (python-shell-send-buffer))
+ uuid))
+ (`value
+ (let ((tmp-results-file (org-babel-temp-file "python-"))
+ (tmp-src-file (org-babel-temp-file "python-")))
+ (with-temp-file tmp-src-file (insert body))
+ (with-temp-buffer
+ (insert (org-babel-python-format-session-value tmp-src-file tmp-results-file result-params))
+ (insert "\n")
+ (insert (format org-babel-python-async-indicator "file" tmp-results-file))
+ (python-shell-send-buffer))
+ tmp-results-file)))))
+
+(provide 'ob-python)
+
+;;; ob-python.el ends here
diff --git a/elpa/org-9.5.2/ob-python.elc b/elpa/org-9.5.2/ob-python.elc
new file mode 100644
index 0000000..a46c6f6
--- /dev/null
+++ b/elpa/org-9.5.2/ob-python.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-ref.el b/elpa/org-9.5.2/ob-ref.el
new file mode 100644
index 0000000..a7ab299
--- /dev/null
+++ b/elpa/org-9.5.2/ob-ref.el
@@ -0,0 +1,246 @@
+;;; ob-ref.el --- Babel Functions for Referencing External Data -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Authors: Eric Schulte
+;; Dan Davison
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Functions for referencing data from the header arguments of a
+;; org-babel block. The syntax of such a reference should be
+
+;; #+VAR: variable-name=file:resource-id
+
+;; - variable-name :: the name of the variable to which the value
+;; will be assigned
+
+;; - file :: path to the file containing the resource, or omitted if
+;; resource is in the current file
+
+;; - resource-id :: the id or name of the resource
+
+;; So an example of a simple source block referencing table data in
+;; the same file would be
+
+;; #+NAME: sandbox
+;; | 1 | 2 | 3 |
+;; | 4 | org-babel | 6 |
+;;
+;; #+begin_src emacs-lisp :var table=sandbox
+;; (message table)
+;; #+end_src
+
+;;; Code:
+(require 'ob-core)
+(require 'org-macs)
+(require 'cl-lib)
+
+(declare-function org-babel-lob-get-info "ob-lob" (&optional datum))
+(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-find-property "org" (property &optional value))
+(declare-function org-id-find-id-file "org-id" (id))
+(declare-function org-id-find-id-in-file "org-id" (id file &optional markerp))
+(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))
+
+(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 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
+ (goto-char (if (markerp org-babel-current-src-block-location)
+ (marker-position org-babel-current-src-block-location)
+ org-babel-current-src-block-location)))
+ (org-babel-read ref))))
+ (if (equal out ref)
+ (if (and (string-prefix-p "\"" ref)
+ (string-suffix-p "\"" ref))
+ (read ref)
+ (org-babel-ref-resolve ref))
+ out))))))
+
+(defun org-babel-ref-goto-headline-id (id)
+ (or (let ((h (org-find-property "CUSTOM_ID" id)))
+ (when h (goto-char h)))
+ (let* ((file (org-id-find-id-file id))
+ (m (when file (org-id-find-id-in-file id file 'marker))))
+ (when (and file m)
+ (message "file:%S" file)
+ (pop-to-buffer-same-window (marker-buffer m))
+ (goto-char m)
+ (move-marker m nil)
+ (org-show-context)
+ t))))
+
+(defun org-babel-ref-headline-body ()
+ (save-restriction
+ (org-narrow-to-subtree)
+ (buffer-substring
+ (save-excursion (goto-char (point-min))
+ (org-end-of-meta-data)
+ (point))
+ (point-max))))
+
+(defvar org-babel-library-of-babel)
+(defun org-babel-ref-resolve (ref)
+ "Resolve the reference REF and return its value."
+ (save-window-excursion
+ (with-current-buffer (or org-babel-exp-reference-buffer (current-buffer))
+ (save-excursion
+ (let ((case-fold-search t)
+ args new-refere new-header-args new-referent split-file split-ref
+ index)
+ ;; if ref is indexed grab the indices -- beware nested indices
+ (when (and (string-match "\\[\\([^\\[]+\\)\\]$" ref)
+ (let ((str (substring ref 0 (match-beginning 0))))
+ (= (cl-count ?\( str) (cl-count ?\) str))))
+ (setq index (match-string 1 ref))
+ (setq ref (substring ref 0 (match-beginning 0))))
+ ;; assign any arguments to pass to source block
+ (when (string-match
+ "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.*\\))$" ref)
+ (setq new-refere (match-string 1 ref))
+ (setq new-header-args (match-string 3 ref))
+ (setq new-referent (match-string 5 ref))
+ (when (> (length new-refere) 0)
+ (when (> (length new-referent) 0)
+ (setq args (mapcar (lambda (ref) (cons :var ref))
+ (org-babel-ref-split-args new-referent))))
+ (when (> (length new-header-args) 0)
+ (setq args (append (org-babel-parse-header-arguments
+ new-header-args)
+ args)))
+ (setq ref new-refere)))
+ (when (string-match "^\\(.+\\):\\(.+\\)$" ref)
+ (setq split-file (match-string 1 ref))
+ (setq split-ref (match-string 2 ref))
+ (find-file split-file)
+ (setq ref split-ref))
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (let* ((params (append args '((:results . "silent"))))
+ (regexp (org-babel-named-data-regexp-for-name ref))
+ (result
+ (catch :found
+ ;; Check for code blocks or named data.
+ (while (re-search-forward regexp nil t)
+ ;; Ignore COMMENTed headings and orphaned
+ ;; affiliated keywords.
+ (unless (org-in-commented-heading-p)
+ (let ((e (org-element-at-point)))
+ (when (equal (org-element-property :name e) ref)
+ (goto-char
+ (org-element-property :post-affiliated e))
+ (pcase (org-element-type e)
+ (`babel-call
+ (throw :found
+ (org-babel-execute-src-block
+ nil (org-babel-lob-get-info e) params)))
+ (`src-block
+ (throw :found
+ (org-babel-execute-src-block
+ nil nil
+ (and
+ (not org-babel-update-intermediate)
+ params))))
+ ((and (let v (org-babel-read-element e))
+ (guard v))
+ (throw :found v))
+ (_ (error "Reference not found")))))))
+ ;; Check for local or global headlines by ID.
+ (when (org-babel-ref-goto-headline-id ref)
+ (throw :found (org-babel-ref-headline-body)))
+ ;; Check the Library of Babel.
+ (let ((info (cdr (assq (intern ref)
+ org-babel-library-of-babel))))
+ (when info
+ (throw :found
+ (org-babel-execute-src-block nil info params))))
+ (error "Reference `%s' not found in this buffer" ref))))
+ (cond
+ ((symbolp result) (format "%S" result))
+ ((and index (listp result))
+ (org-babel-ref-index-list index result))
+ (t result)))))))))
+
+(defun org-babel-ref-index-list (index lis)
+ "Return the subset of LIS indexed by INDEX.
+
+Indices are 0 based and negative indices count from the end of
+LIS, so 0 references the first element of LIS and -1 references
+the last. If INDEX is separated by \",\"s then each \"portion\"
+is assumed to index into the next deepest nesting or dimension.
+
+A valid \"portion\" can consist of either an integer index, two
+integers separated by a \":\" in which case the entire range is
+returned, or an empty string or \"*\" both of which are
+interpreted to mean the entire range and as such are equivalent
+to \"0:-1\"."
+ (if (and (> (length index) 0) (string-match "^\\([^,]*\\),?" index))
+ (let* ((ind-re "\\(\\([-[:digit:]]+\\):\\([-[:digit:]]+\\)\\|\\*\\)")
+ (lgth (length lis))
+ (portion (match-string 1 index))
+ (remainder (substring index (match-end 0)))
+ (wrap (lambda (num) (if (< num 0) (+ lgth num) num)))
+ (open (lambda (ls) (if (and (listp ls) (= (length ls) 1)) (car ls) ls))))
+ (funcall
+ open
+ (mapcar
+ (lambda (sub-lis)
+ (if (listp sub-lis)
+ (org-babel-ref-index-list remainder sub-lis)
+ sub-lis))
+ (if (or (= 0 (length portion)) (string-match ind-re portion))
+ (mapcar
+ (lambda (n) (nth n lis))
+ (apply 'org-number-sequence
+ (if (and (> (length portion) 0) (match-string 2 portion))
+ (list
+ (funcall wrap (string-to-number (match-string 2 portion)))
+ (funcall wrap (string-to-number (match-string 3 portion))))
+ (list (funcall wrap 0) (funcall wrap -1)))))
+ (list (nth (funcall wrap (string-to-number portion)) lis))))))
+ lis))
+
+(defun org-babel-ref-split-args (arg-string)
+ "Split ARG-STRING into top-level arguments of balanced parenthesis."
+ (mapcar #'org-trim (org-babel-balanced-split arg-string 44)))
+
+(provide 'ob-ref)
+
+;;; ob-ref.el ends here
diff --git a/elpa/org-9.5.2/ob-ref.elc b/elpa/org-9.5.2/ob-ref.elc
new file mode 100644
index 0000000..87b6d0c
--- /dev/null
+++ b/elpa/org-9.5.2/ob-ref.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-ruby.el b/elpa/org-9.5.2/ob-ruby.el
new file mode 100644
index 0000000..b2483f1
--- /dev/null
+++ b/elpa/org-9.5.2/ob-ruby.el
@@ -0,0 +1,279 @@
+;;; ob-ruby.el --- Babel Functions for Ruby -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating ruby source code.
+
+;;; Requirements:
+
+;; - ruby and irb executables :: https://www.ruby-lang.org/
+;;
+;; - ruby-mode :: Can be installed through ELPA, or from
+;; https://github.com/eschulte/rinari/raw/master/util/ruby-mode.el
+;;
+;; - inf-ruby mode :: Can be installed through ELPA, or from
+;; https://github.com/eschulte/rinari/raw/master/util/inf-ruby.el
+
+;;; Code:
+(require 'ob)
+(require 'org-macs)
+
+(declare-function run-ruby-or-pop-to-buffer "ext:inf-ruby" (command &optional name buffer))
+(declare-function inf-ruby-buffer "ext:inf-ruby" ())
+(declare-function xmp "ext:rcodetools" (&optional option))
+
+(defvar inf-ruby-default-implementation)
+(defvar inf-ruby-implementations)
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("ruby" . "rb"))
+
+(defvar org-babel-default-header-args:ruby '())
+
+(defvar org-babel-ruby-command "ruby"
+ "Name of command to use for executing ruby code.
+It's possible to override it by using a header argument `:ruby'")
+
+(defcustom org-babel-ruby-hline-to "nil"
+ "Replace hlines in incoming tables with this when translating to ruby."
+ :group 'org-babel
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string)
+
+(defcustom org-babel-ruby-nil-to 'hline
+ "Replace nil in ruby tables with this before returning."
+ :group 'org-babel
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'symbol)
+
+(defun org-babel-execute:ruby (body params)
+ "Execute a block of Ruby code with Babel.
+This function is called by `org-babel-execute-src-block'."
+ (let* ((session (org-babel-ruby-initiate-session
+ (cdr (assq :session params)) params))
+ (result-params (cdr (assq :result-params params)))
+ (result-type (cdr (assq :result-type params)))
+ (org-babel-ruby-command
+ (or (cdr (assq :ruby params))
+ org-babel-ruby-command))
+ (full-body (org-babel-expand-body:generic
+ body params (org-babel-variable-assignments:ruby params)))
+ (result (if (member "xmp" result-params)
+ (with-temp-buffer
+ (require 'rcodetools)
+ (insert full-body)
+ (xmp (cdr (assq :xmp-option params)))
+ (buffer-string))
+ (org-babel-ruby-evaluate
+ session full-body result-type result-params))))
+ (org-babel-reassemble-table
+ (org-babel-result-cond result-params
+ result
+ (org-babel-ruby-table-or-string result))
+ (org-babel-pick-name (cdr (assq :colname-names params))
+ (cdr (assq :colnames params)))
+ (org-babel-pick-name (cdr (assq :rowname-names params))
+ (cdr (assq :rownames params))))))
+
+(defun org-babel-prep-session:ruby (session params)
+ "Prepare SESSION according to the header arguments specified in PARAMS."
+ ;; (message "params=%S" params) ;; debugging
+ (let* ((session (org-babel-ruby-initiate-session session))
+ (var-lines (org-babel-variable-assignments:ruby params)))
+ (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))
+ session))
+
+(defun org-babel-load-session:ruby (session body params)
+ "Load BODY into SESSION."
+ (save-window-excursion
+ (let ((buffer (org-babel-prep-session:ruby session params)))
+ (with-current-buffer buffer
+ (goto-char (process-mark (get-buffer-process (current-buffer))))
+ (insert (org-babel-chomp body)))
+ buffer)))
+
+;; helper functions
+
+(defun org-babel-variable-assignments:ruby (params)
+ "Return list of ruby statements assigning the block's variables."
+ (mapcar
+ (lambda (pair)
+ (format "%s=%s"
+ (car pair)
+ (org-babel-ruby-var-to-ruby (cdr pair))))
+ (org-babel--get-vars params)))
+
+(defun org-babel-ruby-var-to-ruby (var)
+ "Convert VAR into a ruby variable.
+Convert an elisp value into a string of ruby source code
+specifying a variable of the same value."
+ (if (listp var)
+ (concat "[" (mapconcat #'org-babel-ruby-var-to-ruby var ", ") "]")
+ (if (eq var 'hline)
+ org-babel-ruby-hline-to
+ (format "%S" var))))
+
+(defun org-babel-ruby-table-or-string (results)
+ "Convert RESULTS into an appropriate elisp value.
+If RESULTS look like a table, then convert them into an
+Emacs-lisp table, otherwise return the results as a string."
+ (let ((res (org-babel-script-escape results)))
+ (if (listp res)
+ (mapcar (lambda (el) (if (not el)
+ org-babel-ruby-nil-to el))
+ res)
+ res)))
+
+(defun org-babel-ruby-initiate-session (&optional session params)
+ "Initiate a ruby session.
+If there is not a current inferior-process-buffer in SESSION
+then create one. Return the initialized session."
+ (unless (string= session "none")
+ (require 'inf-ruby)
+ (let* ((command (cdr (or (assq :ruby params)
+ (assoc inf-ruby-default-implementation
+ inf-ruby-implementations))))
+ (buffer (get-buffer (format "*%s*" session)))
+ (session-buffer (or buffer (save-window-excursion
+ (run-ruby-or-pop-to-buffer
+ (if (functionp command)
+ (funcall command)
+ command)
+ (or session "ruby")
+ (unless session
+ (inf-ruby-buffer)))
+ (current-buffer)))))
+ (if (org-babel-comint-buffer-livep session-buffer)
+ (progn (sit-for .25) session-buffer)
+ (sit-for .5)
+ (org-babel-ruby-initiate-session session)))))
+
+(defvar org-babel-ruby-eoe-indicator ":org_babel_ruby_eoe"
+ "String to indicate that evaluation has completed.")
+(defvar org-babel-ruby-f-write
+ "File.open('%s','w'){|f| f.write((_.class == String) ? _ : _.inspect)}")
+(defvar org-babel-ruby-pp-f-write
+ "File.open('%s','w'){|f| $stdout = f; pp(results); $stdout = orig_out}")
+(defvar org-babel-ruby-wrapper-method
+ "
+def main()
+%s
+end
+results = main()
+File.open('%s', 'w'){ |f| f.write((results.class == String) ? results : results.inspect) }
+")
+(defvar org-babel-ruby-pp-wrapper-method
+ "
+require 'pp'
+def main()
+%s
+end
+results = main()
+File.open('%s', 'w') do |f|
+ $stdout = f
+ pp results
+end
+")
+
+(defun org-babel-ruby-evaluate
+ (buffer body &optional result-type result-params)
+ "Pass BODY to the Ruby process in BUFFER.
+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, as elisp."
+ (if (not buffer)
+ ;; external process evaluation
+ (pcase result-type
+ (`output (org-babel-eval org-babel-ruby-command body))
+ (`value (let ((tmp-file (org-babel-temp-file "ruby-")))
+ (org-babel-eval
+ org-babel-ruby-command
+ (format (if (member "pp" result-params)
+ org-babel-ruby-pp-wrapper-method
+ org-babel-ruby-wrapper-method)
+ body (org-babel-process-file-name tmp-file 'noquote)))
+ (org-babel-eval-read-file tmp-file))))
+ ;; comint session evaluation
+ (pcase result-type
+ (`output
+ (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 input has already
+ ;; been inserted and that throws off the extraction of the
+ ;; result for Babel.
+ (org-babel-comint-with-output
+ (buffer org-babel-ruby-eoe-indicator t eoe-string)
+ (insert eoe-string) (comint-send-input nil t))
+ ;; Now we can start the evaluation.
+ (mapconcat
+ #'identity
+ (butlast
+ (split-string
+ (mapconcat
+ #'org-trim
+ (org-babel-comint-with-output
+ (buffer org-babel-ruby-eoe-indicator t body)
+ (mapc
+ (lambda (line)
+ (insert (org-babel-chomp line)) (comint-send-input nil t))
+ (list "conf.echo=false;_org_prompt_mode=conf.prompt_mode;conf.prompt_mode=:NULL"
+ body
+ "conf.prompt_mode=_org_prompt_mode;conf.echo=true"
+ eoe-string)))
+ "\n") "[\r\n]") 4) "\n")))
+ (`value
+ (let* ((tmp-file (org-babel-temp-file "ruby-"))
+ (ppp (or (member "code" result-params)
+ (member "pp" result-params))))
+ (org-babel-comint-with-output
+ (buffer org-babel-ruby-eoe-indicator t body)
+ (when ppp (insert "require 'pp';") (comint-send-input nil t))
+ (mapc
+ (lambda (line)
+ (insert (org-babel-chomp line)) (comint-send-input nil t))
+ (append
+ (list body)
+ (if (not ppp)
+ (list (format org-babel-ruby-f-write
+ (org-babel-process-file-name tmp-file 'noquote)))
+ (list
+ "results=_" "require 'pp'" "orig_out = $stdout"
+ (format org-babel-ruby-pp-f-write
+ (org-babel-process-file-name tmp-file 'noquote))))
+ (list org-babel-ruby-eoe-indicator)))
+ (comint-send-input nil t))
+ (org-babel-eval-read-file tmp-file))))))
+
+(provide 'ob-ruby)
+
+;;; ob-ruby.el ends here
diff --git a/elpa/org-9.5.2/ob-ruby.elc b/elpa/org-9.5.2/ob-ruby.elc
new file mode 100644
index 0000000..0d59e72
--- /dev/null
+++ b/elpa/org-9.5.2/ob-ruby.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-sass.el b/elpa/org-9.5.2/ob-sass.el
new file mode 100644
index 0000000..c8762ca
--- /dev/null
+++ b/elpa/org-9.5.2/ob-sass.el
@@ -0,0 +1,68 @@
+;;; ob-sass.el --- Babel Functions for the Sass CSS generation language -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; For more information on sass see https://sass-lang.com/
+;;
+;; This accepts a 'file' header argument which is the target of the
+;; compiled sass. The default output type for sass evaluation is
+;; either file (if a 'file' header argument was given) or scalar if no
+;; such header argument was supplied.
+;;
+;; A 'cmdline' header argument can be supplied to pass arguments to
+;; the sass command line.
+
+;;; Requirements:
+
+;; - sass-mode :: https://github.com/nex3/haml/blob/master/extra/sass-mode.el
+
+;;; Code:
+(require 'ob)
+
+(defvar org-babel-default-header-args:sass '())
+
+(defun org-babel-execute:sass (body params)
+ "Execute a block of Sass code with Babel.
+This function is called by `org-babel-execute-src-block'."
+ (let* ((file (cdr (assq :file params)))
+ (out-file (or file (org-babel-temp-file "sass-out-")))
+ (cmdline (cdr (assq :cmdline params)))
+ (in-file (org-babel-temp-file "sass-in-"))
+ (cmd (concat "sass " (or cmdline "")
+ " " (org-babel-process-file-name in-file)
+ " " (org-babel-process-file-name out-file))))
+ (with-temp-file in-file
+ (insert (org-babel-expand-body:generic body params)))
+ (org-babel-eval cmd "")
+ (if file
+ nil ;; signal that output has already been written to file
+ (with-temp-buffer (insert-file-contents out-file) (buffer-string)))))
+
+(defun org-babel-prep-session:sass (_session _params)
+ "Raise an error because sass does not support sessions."
+ (error "Sass does not support sessions"))
+
+(provide 'ob-sass)
+
+;;; ob-sass.el ends here
diff --git a/elpa/org-9.5.2/ob-sass.elc b/elpa/org-9.5.2/ob-sass.elc
new file mode 100644
index 0000000..b692287
--- /dev/null
+++ b/elpa/org-9.5.2/ob-sass.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-scheme.el b/elpa/org-9.5.2/ob-scheme.el
new file mode 100644
index 0000000..f4836b2
--- /dev/null
+++ b/elpa/org-9.5.2/ob-scheme.el
@@ -0,0 +1,241 @@
+;;; ob-scheme.el --- Babel Functions for Scheme -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Authors: Eric Schulte
+;; Michael Gauland
+;; Keywords: literate programming, reproducible research, scheme
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Now working with SBCL for both session and external evaluation.
+;;
+;; This certainly isn't optimally robust, but it seems to be working
+;; for the basic use cases.
+
+;;; Requirements:
+
+;; - a working scheme implementation
+;; (e.g. guile https://www.gnu.org/software/guile/guile.html)
+;;
+;; - for session based evaluation geiser is required, which is available from
+;; ELPA.
+
+;;; 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-scheme-implementation) ; Defined in geiser-impl.el
+(defvar geiser-default-implementation) ; Defined in geiser-impl.el
+(defvar geiser-active-implementations) ; Defined in geiser-impl.el
+(defvar geiser-debug-show-debug-p) ; Defined in geiser-debug.el
+(defvar geiser-debug-jump-to-debug-p) ; Defined in geiser-debug.el
+(defvar geiser-repl-use-other-window) ; Defined in geiser-repl.el
+(defvar geiser-repl-window-allow-split) ; Defined in geiser-repl.el
+
+(declare-function run-geiser "ext:geiser-repl" (impl))
+(declare-function geiser-mode "ext:geiser-mode" ())
+(declare-function geiser-eval-region "ext:geiser-mode"
+ (start end &optional and-go raw nomsg))
+(declare-function geiser-repl-exit "ext:geiser-repl" (&optional arg))
+(declare-function geiser-eval--retort-output "ext:geiser-eval" (ret))
+(declare-function geiser-eval--retort-result-str "ext:geiser-eval" (ret prefix))
+
+(defcustom org-babel-scheme-null-to 'hline
+ "Replace `null' and empty lists in scheme tables with this before returning."
+ :group 'org-babel
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :type 'symbol)
+
+(defvar org-babel-default-header-args:scheme '()
+ "Default header arguments for scheme code blocks.")
+
+(defun org-babel-expand-body:scheme (body params)
+ "Expand BODY according to PARAMS, return the expanded body."
+ (let ((vars (org-babel--get-vars params))
+ (prepends (cdr (assq :prologue params)))
+ (postpends (cdr (assq :epilogue params))))
+ (concat (and prepends (concat prepends "\n"))
+ (if (null vars) body
+ (format "(let (%s)\n%s\n)"
+ (mapconcat
+ (lambda (var)
+ (format "%S" (print `(,(car var) ',(cdr var)))))
+ vars
+ "\n ")
+ body))
+ (and postpends (concat "\n" postpends)))))
+
+
+(defvar org-babel-scheme-repl-map (make-hash-table :test #'equal)
+ "Map of scheme sessions to session names.")
+
+(defun org-babel-scheme-cleanse-repl-map ()
+ "Remove dead buffers from the REPL map."
+ (maphash
+ (lambda (x y) (unless (buffer-name y) (remhash x org-babel-scheme-repl-map)))
+ org-babel-scheme-repl-map))
+
+(defun org-babel-scheme-get-session-buffer (session-name)
+ "Look up the scheme buffer for a session; return nil if it doesn't exist."
+ (org-babel-scheme-cleanse-repl-map) ; Prune dead sessions
+ (gethash session-name org-babel-scheme-repl-map))
+
+(defun org-babel-scheme-set-session-buffer (session-name buffer)
+ "Record the scheme buffer used for a given session."
+ (puthash session-name buffer org-babel-scheme-repl-map))
+
+(defun org-babel-scheme-get-buffer-impl (buffer)
+ "Return the scheme implementation geiser associates with the buffer."
+ (with-current-buffer (set-buffer buffer)
+ geiser-impl--implementation))
+
+(defun org-babel-scheme-get-repl (impl name)
+ "Switch to a scheme REPL, creating it if it doesn't exist."
+ (let ((buffer (org-babel-scheme-get-session-buffer name)))
+ (or buffer
+ (progn
+ (run-geiser impl)
+ (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)
+ "Generate a name for the session buffer.
+
+For a named session, the buffer name will be the session name.
+
+If the session is unnamed (nil), generate a name.
+
+If the session is `none', use nil for the session name, and
+org-babel-scheme-execute-with-geiser will use a temporary session."
+ (cond ((not name) (concat buffer " " (symbol-name impl) " REPL"))
+ ((string= name "none") nil)
+ (name)))
+
+(defmacro org-babel-scheme-capture-current-message (&rest body)
+ "Capture current message in both interactive and noninteractive mode."
+ `(if noninteractive
+ (let ((original-message (symbol-function 'message))
+ (current-message nil))
+ (unwind-protect
+ (progn
+ (defun message (&rest args)
+ (setq current-message (apply original-message args)))
+ ,@body
+ current-message)
+ (fset 'message original-message)))
+ (progn
+ ,@body
+ (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.
+
+Returns the output of executing the code if the OUTPUT parameter
+is true; otherwise returns the last value."
+ (let ((result nil))
+ (with-temp-buffer
+ (insert (format ";; -*- geiser-scheme-implementation: %s -*-" impl))
+ (newline)
+ (insert code)
+ (geiser-mode)
+ (let ((geiser-repl-window-allow-split nil)
+ (geiser-repl-use-other-window nil))
+ (let ((repl-buffer (save-current-buffer
+ (org-babel-scheme-get-repl impl repl))))
+ (when (not (eq impl (org-babel-scheme-get-buffer-impl
+ (current-buffer))))
+ (message "Implementation mismatch: %s (%s) %s (%s)" impl (symbolp impl)
+ (org-babel-scheme-get-buffer-impl (current-buffer))
+ (symbolp (org-babel-scheme-get-buffer-impl
+ (current-buffer)))))
+ (setq geiser-repl--repl repl-buffer)
+ (setq geiser-impl--implementation nil)
+ (let ((geiser-debug-jump-to-debug-p nil)
+ (geiser-debug-show-debug-p nil))
+ (let ((ret (geiser-eval-region (point-min) (point-max))))
+ (setq result (if output
+ (or (geiser-eval--retort-output ret)
+ "Geiser Interpreter produced no output")
+ (geiser-eval--retort-result-str ret "")))))
+ (when (not repl)
+ (save-current-buffer (set-buffer repl-buffer)
+ (geiser-repl-exit))
+ (set-process-query-on-exit-flag (get-buffer-process repl-buffer) nil)
+ (kill-buffer repl-buffer)))))
+ result))
+
+(defun org-babel-scheme--table-or-string (results)
+ "Convert RESULTS into an appropriate elisp value.
+If the results look like a list or tuple, then convert them into an
+Emacs-lisp table, otherwise return the results as a string."
+ (let ((res (org-babel-script-escape results)))
+ (cond ((listp res)
+ (mapcar (lambda (el)
+ (if (or (null el) (eq el 'null))
+ org-babel-scheme-null-to
+ el))
+ res))
+ (t res))))
+
+(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'."
+ (let* ((source-buffer (current-buffer))
+ (source-buffer-name (replace-regexp-in-string ;; zap surrounding *
+ "^ ?\\*\\([^*]+\\)\\*" "\\1"
+ (buffer-name source-buffer))))
+ (save-excursion
+ (let* ((result-type (cdr (assq :result-type params)))
+ (impl (or (when (cdr (assq :scheme params))
+ (intern (cdr (assq :scheme params))))
+ geiser-scheme-implementation
+ geiser-default-implementation
+ (car geiser-active-implementations)))
+ (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
+ (string= result-type "output") ; output?
+ impl ; implementation
+ (and (not (string= session "none")) session)))) ; session
+ (let ((table
+ (org-babel-reassemble-table
+ result
+ (org-babel-pick-name (cdr (assq :colname-names params))
+ (cdr (assq :colnames params)))
+ (org-babel-pick-name (cdr (assq :rowname-names params))
+ (cdr (assq :rownames params))))))
+ (org-babel-result-cond result-params
+ result
+ (org-babel-scheme--table-or-string table)))))))
+
+(provide 'ob-scheme)
+
+;;; ob-scheme.el ends here
diff --git a/elpa/org-9.5.2/ob-scheme.elc b/elpa/org-9.5.2/ob-scheme.elc
new file mode 100644
index 0000000..f2ad77b
--- /dev/null
+++ b/elpa/org-9.5.2/ob-scheme.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-screen.el b/elpa/org-9.5.2/ob-screen.el
new file mode 100644
index 0000000..7793825
--- /dev/null
+++ b/elpa/org-9.5.2/ob-screen.el
@@ -0,0 +1,143 @@
+;;; ob-screen.el --- Babel Support for Interactive Terminal -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Benjamin Andresen
+;; Maintainer: Ken Mankoff
+;; Keywords: literate programming, interactive shell
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for interactive terminals. Mostly shell scripts.
+;; Heavily inspired by 'eev' from Eduardo Ochs
+;;
+;; Adding :cmd and :terminal as header arguments
+;; :terminal must support the -T (title) and -e (command) parameter
+;;
+;; You can test the default setup (xterm + sh) with
+;; M-x org-babel-screen-test RET
+
+;;; Code:
+(require 'ob)
+
+(defvar org-babel-screen-location "screen"
+ "The command location for screen.
+In case you want to use a different screen than one selected by your $PATH")
+
+(defvar org-babel-default-header-args:screen
+ `((:results . "silent") (:session . "default") (:cmd . "sh")
+ (:terminal . "xterm") (:screenrc . ,null-device))
+ "Default arguments to use when running screen source blocks.")
+
+(defun org-babel-execute:screen (body params)
+ "Send a block of code via screen to a terminal using Babel.
+\"default\" session is used when none is specified."
+ (message "Sending source code block to interactive terminal session...")
+ (save-window-excursion
+ (let* ((session (cdr (assq :session params)))
+ (socket (org-babel-screen-session-socketname session)))
+ (unless socket (org-babel-prep-session:screen session params))
+ (org-babel-screen-session-execute-string
+ session (org-babel-expand-body:generic body params)))))
+
+(defun org-babel-prep-session:screen (_session params)
+ "Prepare SESSION according to the header arguments specified in PARAMS."
+ (let* ((session (cdr (assq :session params)))
+ (cmd (cdr (assq :cmd params)))
+ (terminal (cdr (assq :terminal params)))
+ (screenrc (cdr (assq :screenrc params)))
+ (process-name (concat "org-babel: terminal (" session ")")))
+ (apply 'start-process process-name "*Messages*"
+ terminal `("-T" ,(concat "org-babel: " session) "-e" ,org-babel-screen-location
+ "-c" ,screenrc "-mS" ,session ,cmd))
+ ;; XXX: Is there a better way than the following?
+ (while (not (org-babel-screen-session-socketname session))
+ ;; wait until screen session is available before returning
+ )))
+
+;; helper functions
+
+(defun org-babel-screen-session-execute-string (session body)
+ "If SESSION exists, send BODY to it."
+ (let ((socket (org-babel-screen-session-socketname session)))
+ (when socket
+ (let ((tmpfile (org-babel-screen-session-write-temp-file session body)))
+ (apply 'start-process (concat "org-babel: screen (" session ")") "*Messages*"
+ org-babel-screen-location
+ `("-S" ,socket "-X" "eval" "msgwait 0"
+ ,(concat "readreg z " tmpfile)
+ "paste z"))))))
+
+(defun org-babel-screen-session-socketname (session)
+ "Check if SESSION exists by parsing output of \"screen -ls\"."
+ (let* ((screen-ls (shell-command-to-string "screen -ls"))
+ (sockets (delq
+ nil
+ (mapcar
+ (lambda (x)
+ (when (string-match (rx (or "(Attached)" "(Detached)")) x)
+ x))
+ (split-string screen-ls "\n"))))
+ (match-socket (car
+ (delq
+ nil
+ (mapcar
+ (lambda (x)
+ (and (string-match-p (regexp-quote session) x)
+ x))
+ sockets)))))
+ (when match-socket (car (split-string match-socket)))))
+
+(defun org-babel-screen-session-write-temp-file (_session body)
+ "Save BODY in a temp file that is named after SESSION."
+ (let ((tmpfile (org-babel-temp-file "screen-")))
+ (with-temp-file tmpfile
+ (insert body)
+ (insert "\n")
+
+ ;; org-babel has superfluous spaces
+ (goto-char (point-min))
+ (delete-matching-lines "^ +$"))
+ tmpfile))
+
+(defun org-babel-screen-test ()
+ "Test if the default setup works.
+The terminal should shortly flicker."
+ (interactive)
+ (let* ((random-string (format "%s" (random 99999)))
+ (tmpfile (org-babel-temp-file "ob-screen-test-"))
+ (body (concat "echo '" random-string "' > " tmpfile "\nexit\n"))
+ tmp-string)
+ (org-babel-execute:screen body org-babel-default-header-args:screen)
+ ;; XXX: need to find a better way to do the following
+ (while (not (file-readable-p tmpfile))
+ ;; do something, otherwise this will be optimized away
+ (message "org-babel-screen: File not readable yet."))
+ (setq tmp-string (with-temp-buffer
+ (insert-file-contents-literally tmpfile)
+ (buffer-substring (point-min) (point-max))))
+ (delete-file tmpfile)
+ (message (concat "org-babel-screen: Setup "
+ (if (string-match random-string tmp-string)
+ "WORKS."
+ "DOESN'T work.")))))
+
+(provide 'ob-screen)
+
+;;; ob-screen.el ends here
diff --git a/elpa/org-9.5.2/ob-screen.elc b/elpa/org-9.5.2/ob-screen.elc
new file mode 100644
index 0000000..9a6bcf7
--- /dev/null
+++ b/elpa/org-9.5.2/ob-screen.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-sed.el b/elpa/org-9.5.2/ob-sed.el
new file mode 100644
index 0000000..4d3eeee
--- /dev/null
+++ b/elpa/org-9.5.2/ob-sed.el
@@ -0,0 +1,106 @@
+;;; ob-sed.el --- Babel Functions for Sed Scripts -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
+
+;; Author: Bjarte Johansen
+;; Keywords: literate programming, reproducible research
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Provides a way to evaluate sed scripts in Org mode.
+
+;;; Usage:
+
+;; Add to your Emacs config:
+
+;; (org-babel-do-load-languages
+;; 'org-babel-load-languages
+;; '((sed . t)))
+
+;; In addition to the normal header arguments, ob-sed also provides
+;; :cmd-line and :in-file. :cmd-line allows one to pass other flags to
+;; the sed command like the "--in-place" flag which makes sed edit the
+;; file pass to it instead of outputting to standard out or to a
+;; different file. :in-file is a header arguments that allows one to
+;; tell Org Babel which file the sed script to act on.
+
+;;; Code:
+(require 'ob)
+
+(defvar org-babel-sed-command "sed"
+ "Name of the sed executable command.")
+
+(defvar org-babel-tangle-lang-exts)
+(add-to-list 'org-babel-tangle-lang-exts '("sed" . "sed"))
+
+(defconst org-babel-header-args:sed
+ '((:cmd-line . :any)
+ (:in-file . :any))
+ "Sed specific header arguments.")
+
+(defvar org-babel-default-header-args:sed '()
+ "Default arguments for evaluating a sed source block.")
+
+(defun org-babel-execute:sed (body params)
+ "Execute a block of sed code with Org Babel.
+BODY is the source inside a sed source block and PARAMS is an
+association list over the source block configurations. This
+function is called by `org-babel-execute-src-block'."
+ (message "executing sed source code block")
+ (let* ((result-params (cdr (assq :result-params params)))
+ (cmd-line (cdr (assq :cmd-line params)))
+ (in-file (cdr (assq :in-file params)))
+ (code-file (let ((file (org-babel-temp-file "sed-")))
+ (with-temp-file file
+ (insert body))
+ file))
+ (stdin (let ((stdin (cdr (assq :stdin params))))
+ (when stdin
+ (let ((tmp (org-babel-temp-file "sed-stdin-"))
+ (res (org-babel-ref-resolve stdin)))
+ (with-temp-file tmp
+ (insert res))
+ tmp))))
+ (cmd (mapconcat #'identity
+ (remq nil
+ (list org-babel-sed-command
+ (format "-f \"%s\"" code-file)
+ cmd-line
+ in-file))
+ " ")))
+ (org-babel-reassemble-table
+ (let ((results
+ (cond
+ (stdin (with-temp-buffer
+ (call-process-shell-command cmd stdin (current-buffer))
+ (buffer-string)))
+ (t (org-babel-eval cmd "")))))
+ (when results
+ (org-babel-result-cond result-params
+ results
+ (let ((tmp (org-babel-temp-file "sed-results-")))
+ (with-temp-file tmp (insert results))
+ (org-babel-import-elisp-from-file tmp)))))
+ (org-babel-pick-name
+ (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
+ (org-babel-pick-name
+ (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))
+
+(provide 'ob-sed)
+
+;;; ob-sed.el ends here
diff --git a/elpa/org-9.5.2/ob-sed.elc b/elpa/org-9.5.2/ob-sed.elc
new file mode 100644
index 0000000..f4e8abb
--- /dev/null
+++ b/elpa/org-9.5.2/ob-sed.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-shell.el b/elpa/org-9.5.2/ob-shell.el
new file mode 100644
index 0000000..3eed0c1
--- /dev/null
+++ b/elpa/org-9.5.2/ob-shell.el
@@ -0,0 +1,309 @@
+;;; ob-shell.el --- Babel Functions for Shell Evaluation -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating shell source code.
+
+;;; Code:
+(require 'ob)
+(require 'org-macs)
+(require 'shell)
+(require 'cl-lib)
+
+(declare-function org-babel-comint-in-buffer "ob-comint" (buffer &rest body)
+ t)
+(declare-function org-babel-comint-wait-for-output "ob-comint" (buffer))
+(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 orgtbl-to-generic "org-table" (table params))
+
+(defvar org-babel-default-header-args:shell '())
+(defvar org-babel-shell-names)
+
+(defun org-babel-shell-initialize ()
+ "Define execution functions associated to shell names.
+This function has to be called whenever `org-babel-shell-names'
+is modified outside the Customize interface."
+ (interactive)
+ (dolist (name org-babel-shell-names)
+ (eval `(defun ,(intern (concat "org-babel-execute:" name))
+ (body params)
+ ,(format "Execute a block of %s commands with Babel." name)
+ (let ((shell-file-name ,name))
+ (org-babel-execute:shell body params))))
+ (eval `(defalias ',(intern (concat "org-babel-variable-assignments:" name))
+ 'org-babel-variable-assignments:shell
+ ,(format "Return list of %s statements assigning to the block's \
+variables."
+ name)))
+ (eval `(defvar ,(intern (concat "org-babel-default-header-args:" name)) '()))))
+
+(defcustom org-babel-shell-names
+ '("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."
+ :group 'org-babel
+ :type '(repeat (string :tag "Shell name: "))
+ :set (lambda (symbol value)
+ (set-default symbol value)
+ (org-babel-shell-initialize)))
+
+(defcustom org-babel-shell-results-defaults-to-output t
+ "Let shell execution defaults to \":results output\".
+
+When set to t, use \":results output\" when no :results setting
+is set. This is especially useful for inline source blocks.
+
+When set to nil, stick to the convention of using :results value
+as the default setting when no :results is set, the \"value\" of
+a shell execution being its exit code."
+ :group 'org-babel
+ :type 'boolean
+ :package-version '(Org . "9.4"))
+
+(defun org-babel-execute:shell (body params)
+ "Execute a block of Shell commands with Babel.
+This function is called by `org-babel-execute-src-block'."
+ (let* ((session (org-babel-sh-initiate-session
+ (cdr (assq :session params))))
+ (stdin (let ((stdin (cdr (assq :stdin params))))
+ (when stdin (org-babel-sh-var-to-string
+ (org-babel-ref-resolve stdin)))))
+ (results-params (cdr (assq :result-params params)))
+ (value-is-exit-status
+ (or (and
+ (equal '("replace") results-params)
+ (not org-babel-shell-results-defaults-to-output))
+ (member "value" results-params)))
+ (cmdline (cdr (assq :cmdline params)))
+ (full-body (concat
+ (org-babel-expand-body:generic
+ body params (org-babel-variable-assignments:shell params))
+ (when value-is-exit-status "\necho $?"))))
+ (org-babel-reassemble-table
+ (org-babel-sh-evaluate session full-body params stdin cmdline)
+ (org-babel-pick-name
+ (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
+ (org-babel-pick-name
+ (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))
+
+(defun org-babel-prep-session:shell (session params)
+ "Prepare SESSION according to the header arguments specified in PARAMS."
+ (let* ((session (org-babel-sh-initiate-session session))
+ (var-lines (org-babel-variable-assignments:shell params)))
+ (org-babel-comint-in-buffer session
+ (mapc (lambda (var)
+ (insert var) (comint-send-input nil t)
+ (org-babel-comint-wait-for-output session))
+ var-lines))
+ session))
+
+(defun org-babel-load-session:shell (session body params)
+ "Load BODY into SESSION."
+ (save-window-excursion
+ (let ((buffer (org-babel-prep-session:shell session params)))
+ (with-current-buffer buffer
+ (goto-char (process-mark (get-buffer-process (current-buffer))))
+ (insert (org-babel-chomp body)))
+ buffer)))
+
+
+;;; Helper functions
+(defun org-babel--variable-assignments:sh-generic
+ (varname values &optional sep hline)
+ "Return a list of statements declaring the values as a generic variable."
+ (format "%s=%s" varname (org-babel-sh-var-to-sh values sep hline)))
+
+(defun org-babel--variable-assignments:bash_array
+ (varname values &optional sep hline)
+ "Return a list of statements declaring the values as a bash array."
+ (format "unset %s\ndeclare -a %s=( %s )"
+ varname varname
+ (mapconcat
+ (lambda (value) (org-babel-sh-var-to-sh value sep hline))
+ values
+ " ")))
+
+(defun org-babel--variable-assignments:bash_assoc
+ (varname values &optional sep hline)
+ "Return a list of statements declaring the values as bash associative array."
+ (format "unset %s\ndeclare -A %s\n%s"
+ varname varname
+ (mapconcat
+ (lambda (items)
+ (format "%s[%s]=%s"
+ varname
+ (org-babel-sh-var-to-sh (car items) sep hline)
+ (org-babel-sh-var-to-sh (cdr items) sep hline)))
+ values
+ "\n")))
+
+(defun org-babel--variable-assignments:bash (varname values &optional sep hline)
+ "Represent the parameters as useful Bash shell variables."
+ (pcase values
+ (`((,_ ,_ . ,_) . ,_) ;two-dimensional array
+ (org-babel--variable-assignments:bash_assoc varname values sep hline))
+ (`(,_ . ,_) ;simple list
+ (org-babel--variable-assignments:bash_array varname values sep hline))
+ (_ ;scalar value
+ (org-babel--variable-assignments:sh-generic varname values sep hline))))
+
+(defun org-babel-variable-assignments:shell (params)
+ "Return list of shell statements assigning the block's variables."
+ (let ((sep (cdr (assq :separator params)))
+ (hline (when (string= "yes" (cdr (assq :hlines params)))
+ (or (cdr (assq :hline-string params))
+ "hline"))))
+ (mapcar
+ (lambda (pair)
+ (if (string-suffix-p "bash" shell-file-name)
+ (org-babel--variable-assignments:bash
+ (car pair) (cdr pair) sep hline)
+ (org-babel--variable-assignments:sh-generic
+ (car pair) (cdr pair) sep hline)))
+ (org-babel--get-vars params))))
+
+(defun org-babel-sh-var-to-sh (var &optional sep hline)
+ "Convert an elisp value to a shell variable.
+Convert an elisp var into a string of shell commands specifying a
+var of the same value."
+ (concat "'" (replace-regexp-in-string
+ "'" "'\"'\"'"
+ (org-babel-sh-var-to-string var sep hline))
+ "'"))
+
+(defun org-babel-sh-var-to-string (var &optional sep hline)
+ "Convert an elisp value to a string."
+ (let ((echo-var (lambda (v) (if (stringp v) v (format "%S" v)))))
+ (cond
+ ((and (listp var) (or (listp (car var)) (eq (car var) 'hline)))
+ (orgtbl-to-generic var (list :sep (or sep "\t") :fmt echo-var
+ :hline hline)))
+ ((listp var)
+ (mapconcat echo-var var "\n"))
+ (t (funcall echo-var var)))))
+
+(defun org-babel-sh-initiate-session (&optional session _params)
+ "Initiate a session named SESSION according to PARAMS."
+ (when (and session (not (string= session "none")))
+ (save-window-excursion
+ (or (org-babel-comint-buffer-livep session)
+ (progn
+ (shell session)
+ ;; Needed for Emacs 23 since the marker is initially
+ ;; undefined and the filter functions try to use it without
+ ;; checking.
+ (set-marker comint-last-output-start (point))
+ (get-buffer (current-buffer)))))))
+
+(defvar org-babel-sh-eoe-indicator "echo 'org_babel_sh_eoe'"
+ "String to indicate that evaluation has completed.")
+(defvar org-babel-sh-eoe-output "org_babel_sh_eoe"
+ "String to indicate that evaluation has completed.")
+
+(defun org-babel-sh-evaluate (session body &optional params stdin cmdline)
+ "Pass BODY to the Shell process in BUFFER.
+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* ((shebang (cdr (assq :shebang params)))
+ (results-params (cdr (assq :result-params params)))
+ (value-is-exit-status
+ (or (and
+ (equal '("replace") results-params)
+ (not org-babel-shell-results-defaults-to-output))
+ (member "value" results-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 value-is-exit-status
+ (setq results (car (reverse (split-string results "\n" t)))))
+ (when results
+ (let ((result-params (cdr (assq :result-params params))))
+ (org-babel-result-cond result-params
+ results
+ (let ((tmp-file (org-babel-temp-file "sh-")))
+ (with-temp-file tmp-file (insert results))
+ (org-babel-import-elisp-from-file tmp-file)))))))
+
+(defun org-babel-sh-strip-weird-long-prompt (string)
+ "Remove prompt cruft from a string of shell output."
+ (while (string-match "^% +[\r\n$]+ *" string)
+ (setq string (substring string (match-end 0))))
+ string)
+
+(provide 'ob-shell)
+
+;;; ob-shell.el ends here
diff --git a/elpa/org-9.5.2/ob-shell.elc b/elpa/org-9.5.2/ob-shell.elc
new file mode 100644
index 0000000..f3a59fe
--- /dev/null
+++ b/elpa/org-9.5.2/ob-shell.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-sql.el b/elpa/org-9.5.2/ob-sql.el
new file mode 100644
index 0000000..f512d29
--- /dev/null
+++ b/elpa/org-9.5.2/ob-sql.el
@@ -0,0 +1,421 @@
+;;; ob-sql.el --- Babel Functions for SQL -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating sql source code.
+;; (see also ob-sqlite.el)
+;;
+;; SQL is somewhat unique in that there are many different engines for
+;; the evaluation of sql (Mysql, PostgreSQL, etc...), so much of this
+;; file will have to be implemented engine by engine.
+;;
+;; Also SQL evaluation generally takes place inside of a database.
+;;
+;; Header args used:
+;; - engine
+;; - cmdline
+;; - dbhost
+;; - dbport
+;; - dbuser
+;; - dbpassword
+;; - dbconnection (to reference connections in sql-connection-alist)
+;; - dbinstance (currently only used by SAP HANA)
+;; - database
+;; - colnames (default, nil, means "yes")
+;; - result-params
+;; - out-file
+;;
+;; The following are used but not really implemented for SQL:
+;; - colname-names
+;; - rownames
+;; - rowname-names
+;;
+;; Engines supported:
+;; - mysql
+;; - dbi
+;; - mssql
+;; - sqsh
+;; - postgresql (postgres)
+;; - oracle
+;; - vertica
+;; - saphana
+;;
+;; TODO:
+;;
+;; - support for sessions
+;; - support for more engines
+;; - what's a reasonable way to drop table data into SQL?
+;;
+
+;;; Code:
+(require 'ob)
+
+(declare-function org-table-import "org-table" (file arg))
+(declare-function orgtbl-to-csv "org-table" (table params))
+(declare-function org-table-to-lisp "org-table" (&optional txt))
+(declare-function cygwin-convert-file-name-to-windows "cygw32.c" (file &optional absolute-p))
+(declare-function sql-set-product "sql" (product))
+
+(defvar sql-connection-alist)
+(defvar org-babel-default-header-args:sql '())
+
+(defconst org-babel-header-args:sql
+ '((engine . :any)
+ (out-file . :any)
+ (dbhost . :any)
+ (dbport . :any)
+ (dbuser . :any)
+ (dbpassword . :any)
+ (dbinstance . :any)
+ (database . :any))
+ "SQL-specific header arguments.")
+
+(defun org-babel-expand-body:sql (body params)
+ "Expand BODY according to the values of PARAMS."
+ (let ((prologue (cdr (assq :prologue params)))
+ (epilogue (cdr (assq :epilogue params))))
+ (mapconcat 'identity
+ (list
+ prologue
+ (org-babel-sql-expand-vars
+ body (org-babel--get-vars params))
+ epilogue)
+ "\n")))
+
+(defun org-babel-edit-prep:sql (info)
+ "Set `sql-product' in Org edit buffer.
+Set `sql-product' in Org edit buffer according to the
+corresponding :engine source block header argument."
+ (let ((product (cdr (assq :engine (nth 2 info)))))
+ (condition-case nil
+ (sql-set-product product)
+ (user-error "Cannot set `sql-product' in Org Src edit buffer"))))
+
+(defun org-babel-sql-dbstring-mysql (host port user password database)
+ "Make MySQL cmd line args for database connection. Pass nil to omit that arg."
+ (combine-and-quote-strings
+ (delq nil
+ (list (when host (concat "-h" host))
+ (when port (format "-P%d" port))
+ (when user (concat "-u" user))
+ (when password (concat "-p" password))
+ (when database (concat "-D" database))))))
+
+(defun org-babel-sql-dbstring-postgresql (host port user database)
+ "Make PostgreSQL command line args for database connection.
+Pass nil to omit that arg."
+ (combine-and-quote-strings
+ (delq nil
+ (list (when host (concat "-h" host))
+ (when port (format "-p%d" port))
+ (when user (concat "-U" user))
+ (when database (concat "-d" database))))))
+
+(defun org-babel-sql-dbstring-oracle (host port user password 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
+
+ <user>/<password>@<host>:<port>/<database>
+
+or
+
+ <user>/<password>@<database>
+
+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.
+`sqlcmd' is the preferred command line tool to access Microsoft
+SQL Server on Windows and Linux platform."
+ (mapconcat #'identity
+ (delq nil
+ (list (when host (format "-S \"%s\"" host))
+ (when user (format "-U \"%s\"" user))
+ (when password (format "-P \"%s\"" password))
+ (when database (format "-d \"%s\"" database))))
+ " "))
+
+(defun org-babel-sql-dbstring-sqsh (host user password database)
+ "Make sqsh command line args for database connection.
+\"sqsh\" is one method to access Sybase or MS SQL via Linux platform"
+ (mapconcat #'identity
+ (delq nil
+ (list (when host (format "-S \"%s\"" host))
+ (when user (format "-U \"%s\"" user))
+ (when password (format "-P \"%s\"" password))
+ (when database (format "-D \"%s\"" database))))
+ " "))
+
+(defun org-babel-sql-dbstring-vertica (host port user password database)
+ "Make Vertica command line args for database connection.
+Pass nil to omit that arg."
+ (mapconcat #'identity
+ (delq nil
+ (list (when host (format "-h %s" host))
+ (when port (format "-p %d" port))
+ (when user (format "-U %s" user))
+ (when password (format "-w %s" (shell-quote-argument password) ))
+ (when database (format "-d %s" database))))
+ " "))
+
+(defun org-babel-sql-dbstring-saphana (host port instance user password database)
+ "Make SAP HANA command line args for database connection.
+Pass nil to omit that arg."
+ (mapconcat #'identity
+ (delq nil
+ (list (and host port (format "-n %s:%s" host port))
+ (and host (not port) (format "-n %s" host))
+ (and instance (format "-i %d" instance))
+ (and user (format "-u %s" user))
+ (and password (format "-p %s"
+ (shell-quote-argument password)))
+ (and database (format "-d %s" database))))
+ " "))
+
+(defun org-babel-sql-convert-standard-filename (file)
+ "Convert FILE to OS standard file name.
+If in Cygwin environment, uses Cygwin specific function to
+convert the file name. In a Windows-NT environment, do nothing.
+Otherwise, use Emacs' standard conversion function."
+ (cond ((fboundp 'cygwin-convert-file-name-to-windows)
+ (format "%S" (cygwin-convert-file-name-to-windows file)))
+ ((string= "windows-nt" system-type) file)
+ (t (format "%S" (convert-standard-filename file)))))
+
+(defun org-babel-find-db-connection-param (params name)
+ "Return database connection parameter NAME.
+Given a parameter NAME, if :dbconnection is defined in PARAMS
+then look for the parameter into the corresponding connection
+defined in `sql-connection-alist', otherwise look into PARAMS.
+See `sql-connection-alist' (part of SQL mode) for how to define
+database connections."
+ (if (assq :dbconnection params)
+ (let* ((dbconnection (cdr (assq :dbconnection params)))
+ (name-mapping '((:dbhost . sql-server)
+ (:dbport . sql-port)
+ (:dbuser . sql-user)
+ (:dbpassword . sql-password)
+ (:dbinstance . sql-dbinstance)
+ (:database . sql-database)))
+ (mapped-name (cdr (assq name name-mapping))))
+ (cadr (assq mapped-name
+ (cdr (assoc dbconnection sql-connection-alist)))))
+ (cdr (assq name params))))
+
+(defun org-babel-execute:sql (body params)
+ "Execute a block of Sql code with Babel.
+This function is called by `org-babel-execute-src-block'."
+ (let* ((result-params (cdr (assq :result-params params)))
+ (cmdline (cdr (assq :cmdline params)))
+ (dbhost (org-babel-find-db-connection-param params :dbhost))
+ (dbport (org-babel-find-db-connection-param params :dbport))
+ (dbuser (org-babel-find-db-connection-param params :dbuser))
+ (dbpassword (org-babel-find-db-connection-param params :dbpassword))
+ (dbinstance (org-babel-find-db-connection-param params :dbinstance))
+ (database (org-babel-find-db-connection-param params :database))
+ (engine (cdr (assq :engine params)))
+ (colnames-p (not (equal "no" (cdr (assq :colnames params)))))
+ (in-file (org-babel-temp-file "sql-in-"))
+ (out-file (or (cdr (assq :out-file params))
+ (org-babel-temp-file "sql-out-")))
+ (header-delim "")
+ (command (cl-case (intern engine)
+ (dbi (format "dbish --batch %s < %s | sed '%s' > %s"
+ (or cmdline "")
+ (org-babel-process-file-name in-file)
+ "/^+/d;s/^|//;s/(NULL)/ /g;$d"
+ (org-babel-process-file-name out-file)))
+ (monetdb (format "mclient -f tab %s < %s > %s"
+ (or cmdline "")
+ (org-babel-process-file-name in-file)
+ (org-babel-process-file-name out-file)))
+ (mssql (format "sqlcmd %s -s \"\t\" %s -i %s -o %s"
+ (or cmdline "")
+ (org-babel-sql-dbstring-mssql
+ dbhost dbuser dbpassword database)
+ (org-babel-sql-convert-standard-filename
+ (org-babel-process-file-name in-file))
+ (org-babel-sql-convert-standard-filename
+ (org-babel-process-file-name out-file))))
+ (mysql (format "mysql %s %s %s < %s > %s"
+ (org-babel-sql-dbstring-mysql
+ dbhost dbport dbuser dbpassword database)
+ (if colnames-p "" "-N")
+ (or cmdline "")
+ (org-babel-process-file-name in-file)
+ (org-babel-process-file-name out-file)))
+ ((postgresql postgres) (format
+ "%s%s --set=\"ON_ERROR_STOP=1\" %s -A -P \
+footer=off -F \"\t\" %s -f %s -o %s %s"
+ (if dbpassword
+ (format "PGPASSWORD=%s " dbpassword)
+ "")
+ (or (bound-and-true-p
+ sql-postgres-program)
+ "psql")
+ (if colnames-p "" "-t")
+ (org-babel-sql-dbstring-postgresql
+ dbhost dbport dbuser database)
+ (org-babel-process-file-name in-file)
+ (org-babel-process-file-name out-file)
+ (or cmdline "")))
+ (sqsh (format "sqsh %s %s -i %s -o %s -m csv"
+ (or cmdline "")
+ (org-babel-sql-dbstring-sqsh
+ dbhost dbuser dbpassword database)
+ (org-babel-sql-convert-standard-filename
+ (org-babel-process-file-name in-file))
+ (org-babel-sql-convert-standard-filename
+ (org-babel-process-file-name out-file))))
+ (vertica (format "vsql %s -f %s -o %s %s"
+ (org-babel-sql-dbstring-vertica
+ dbhost dbport dbuser dbpassword database)
+ (org-babel-process-file-name in-file)
+ (org-babel-process-file-name out-file)
+ (or cmdline "")))
+ (oracle (format
+ "sqlplus -s %s < %s > %s"
+ (org-babel-sql-dbstring-oracle
+ dbhost dbport dbuser dbpassword database)
+ (org-babel-process-file-name in-file)
+ (org-babel-process-file-name out-file)))
+ (saphana (format "hdbsql %s -I %s -o %s %s"
+ (org-babel-sql-dbstring-saphana
+ dbhost dbport dbinstance dbuser dbpassword database)
+ (org-babel-process-file-name in-file)
+ (org-babel-process-file-name out-file)
+ (or cmdline "")))
+ (t (user-error "No support for the %s SQL engine" engine)))))
+ (with-temp-file in-file
+ (insert
+ (pcase (intern engine)
+ (`dbi "/format partbox\n")
+ (`oracle "SET PAGESIZE 50000
+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
+SET HEADING ON
+SET MARKUP HTML OFF SPOOL OFF
+SET COLSEP '|'
+
+")
+ ((or `mssql `sqsh) "SET NOCOUNT ON
+
+")
+ (`vertica "\\a\n")
+ (_ ""))
+ (org-babel-expand-body:sql body params)
+ ;; "sqsh" requires "go" inserted at EOF.
+ (if (string= engine "sqsh") "\ngo" "")))
+ (org-babel-eval command "")
+ (org-babel-result-cond result-params
+ (with-temp-buffer
+ (progn (insert-file-contents-literally out-file) (buffer-string)))
+ (with-temp-buffer
+ (cond
+ ((memq (intern engine) '(dbi mysql postgresql postgres saphana sqsh vertica))
+ ;; Add header row delimiter after column-names header in first line
+ (cond
+ (colnames-p
+ (with-temp-buffer
+ (insert-file-contents out-file)
+ (goto-char (point-min))
+ (forward-line 1)
+ (insert "-\n")
+ (setq header-delim "-")
+ (write-file out-file)))))
+ (t
+ ;; Need to figure out the delimiter for the header row
+ (with-temp-buffer
+ (insert-file-contents out-file)
+ (goto-char (point-min))
+ (when (re-search-forward "^\\(-+\\)[^-]" nil t)
+ (setq header-delim (match-string-no-properties 1)))
+ (goto-char (point-max))
+ (forward-char -1)
+ (while (looking-at "\n")
+ (delete-char 1)
+ (goto-char (point-max))
+ (forward-char -1))
+ (write-file out-file))))
+ (org-table-import out-file (if (string= engine "sqsh") '(4) '(16)))
+ (org-babel-reassemble-table
+ (mapcar (lambda (x)
+ (if (string= (car x) header-delim)
+ 'hline
+ x))
+ (org-table-to-lisp))
+ (org-babel-pick-name (cdr (assq :colname-names params))
+ (cdr (assq :colnames params)))
+ (org-babel-pick-name (cdr (assq :rowname-names params))
+ (cdr (assq :rownames params))))))))
+
+(defun org-babel-sql-expand-vars (body vars &optional sqlite)
+ "Expand the variables held in VARS in BODY.
+
+If SQLITE has been provided, prevent passing a format to
+`orgtbl-to-csv'. This prevents overriding the default format, which if
+there were commas in the context of the table broke the table as an
+argument mechanism."
+ (mapc
+ (lambda (pair)
+ (setq body
+ (replace-regexp-in-string
+ (format "$%s" (car pair))
+ (let ((val (cdr pair)))
+ (if (listp val)
+ (let ((data-file (org-babel-temp-file "sql-data-")))
+ (with-temp-file data-file
+ (insert (orgtbl-to-csv
+ val (if sqlite
+ nil
+ '(:fmt (lambda (el) (if (stringp el)
+ el
+ (format "%S" el))))))))
+ data-file)
+ (if (stringp val) val (format "%S" val))))
+ body)))
+ vars)
+ body)
+
+(defun org-babel-prep-session:sql (_session _params)
+ "Raise an error because Sql sessions aren't implemented."
+ (error "SQL sessions not yet implemented"))
+
+(provide 'ob-sql)
+
+;;; ob-sql.el ends here
diff --git a/elpa/org-9.5.2/ob-sql.elc b/elpa/org-9.5.2/ob-sql.elc
new file mode 100644
index 0000000..26c6c10
--- /dev/null
+++ b/elpa/org-9.5.2/ob-sql.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-sqlite.el b/elpa/org-9.5.2/ob-sqlite.el
new file mode 100644
index 0000000..7bfb66c
--- /dev/null
+++ b/elpa/org-9.5.2/ob-sqlite.el
@@ -0,0 +1,148 @@
+;;; ob-sqlite.el --- Babel Functions for SQLite Databases -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Maintainer: Nick Savage
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating sqlite source code.
+
+;;; Code:
+(require 'ob)
+(require 'ob-sql)
+
+(declare-function org-table-convert-region "org-table"
+ (beg0 end0 &optional separator))
+(declare-function orgtbl-to-csv "org-table" (table params))
+(declare-function org-table-to-lisp "org-table" (&optional txt))
+
+(defvar org-babel-default-header-args:sqlite '())
+
+(defvar org-babel-header-args:sqlite
+ '((db . :any)
+ (header . :any)
+ (echo . :any)
+ (bail . :any)
+ (csv . :any)
+ (column . :any)
+ (html . :any)
+ (line . :any)
+ (list . :any)
+ (separator . :any)
+ (nullvalue . :any))
+ "Sqlite specific header args.")
+
+(defun org-babel-expand-body:sqlite (body params)
+ "Expand BODY according to the values of PARAMS."
+ (org-babel-sql-expand-vars
+ body (org-babel--get-vars params) t))
+
+(defvar org-babel-sqlite3-command "sqlite3")
+
+(defun org-babel-execute:sqlite (body params)
+ "Execute a block of Sqlite code with Babel.
+This function is called by `org-babel-execute-src-block'."
+ (let ((result-params (split-string (or (cdr (assq :results params)) "")))
+ (db (cdr (assq :db params)))
+ (separator (cdr (assq :separator params)))
+ (nullvalue (cdr (assq :nullvalue params)))
+ (headers-p (equal "yes" (cdr (assq :colnames params))))
+ (others (delq nil (mapcar
+ (lambda (arg) (car (assq arg params)))
+ (list :header :echo :bail :column
+ :csv :html :line :list)))))
+ (unless db (error "ob-sqlite: can't evaluate without a database"))
+ (with-temp-buffer
+ (insert
+ (org-babel-eval
+ (org-fill-template
+ "%cmd %header %separator %nullvalue %others %csv %db "
+ (list
+ (cons "cmd" org-babel-sqlite3-command)
+ (cons "header" (if headers-p "-header" "-noheader"))
+ (cons "separator"
+ (if separator (format "-separator %s" separator) ""))
+ (cons "nullvalue"
+ (if nullvalue (format "-nullvalue %s" nullvalue) ""))
+ (cons "others"
+ (mapconcat
+ (lambda (arg) (format "-%s" (substring (symbol-name arg) 1)))
+ others " "))
+ ;; for easy table parsing, default header type should be -csv
+ (cons "csv" (if (or (member :csv others) (member :column others)
+ (member :line others) (member :list others)
+ (member :html others) separator)
+ ""
+ "-csv"))
+ (cons "db " db)))
+ ;; body of the code block
+ (org-babel-expand-body:sqlite body params)))
+ (org-babel-result-cond result-params
+ (buffer-string)
+ (if (equal (point-min) (point-max))
+ ""
+ (org-table-convert-region (point-min) (point-max)
+ (if (or (member :csv others)
+ (member :column others)
+ (member :line others)
+ (member :list others)
+ (member :html others) separator)
+ nil
+ '(4)))
+ (org-babel-sqlite-table-or-scalar
+ (org-babel-sqlite-offset-colnames
+ (org-table-to-lisp) headers-p)))))))
+
+(defun org-babel-sqlite-expand-vars (body vars)
+ "Expand the variables held in VARS in BODY."
+ (declare (obsolete "use `org-babel-sql-expand-vars' instead." "9.5"))
+ (org-babel-sql-expand-vars body vars t))
+
+(defun org-babel-sqlite-table-or-scalar (result)
+ "If RESULT looks like a trivial table, then unwrap it."
+ (if (and (equal 1 (length result))
+ (equal 1 (length (car result))))
+ (org-babel-read (caar result) t)
+ (mapcar (lambda (row)
+ (if (eq 'hline row)
+ 'hline
+ (mapcar #'org-babel-sqlite--read-cell row)))
+ result)))
+
+(defun org-babel-sqlite-offset-colnames (table headers-p)
+ "If HEADERS-P is non-nil then offset the first row as column names."
+ (if headers-p
+ (cons (car table) (cons 'hline (cdr table)))
+ table))
+
+(defun org-babel-prep-session:sqlite (_session _params)
+ "Raise an error because support for SQLite sessions isn't implemented.
+Prepare SESSION according to the header arguments specified in PARAMS."
+ (error "SQLite sessions not yet implemented"))
+
+(defun org-babel-sqlite--read-cell (cell)
+ "Process CELL to remove unnecessary characters."
+ (org-babel-read cell t))
+
+(provide 'ob-sqlite)
+
+;;; ob-sqlite.el ends here
diff --git a/elpa/org-9.5.2/ob-sqlite.elc b/elpa/org-9.5.2/ob-sqlite.elc
new file mode 100644
index 0000000..d7a1326
--- /dev/null
+++ b/elpa/org-9.5.2/ob-sqlite.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-table.el b/elpa/org-9.5.2/ob-table.el
new file mode 100644
index 0000000..e081708
--- /dev/null
+++ b/elpa/org-9.5.2/ob-table.el
@@ -0,0 +1,152 @@
+;;; ob-table.el --- Support for Calling Babel Functions from Tables -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Should allow calling functions from Org tables using the function
+;; `org-sbe' as so...
+
+;; #+begin_src emacs-lisp :results silent
+;; (defun fibbd (n) (if (< n 2) 1 (+ (fibbd (- n 1)) (fibbd (- n 2)))))
+;; #+end_src
+
+;; #+name: fibbd
+;; #+begin_src emacs-lisp :var n=2 :results silent
+;; (fibbd n)
+;; #+end_src
+
+;; | original | fibbd |
+;; |----------+--------|
+;; | 0 | |
+;; | 1 | |
+;; | 2 | |
+;; | 3 | |
+;; | 4 | |
+;; | 5 | |
+;; | 6 | |
+;; | 7 | |
+;; | 8 | |
+;; | 9 | |
+;; #+TBLFM: $2='(org-sbe "fibbd" (n $1))
+
+;; NOTE: The quotation marks around the function name, 'fibbd' here,
+;; are optional.
+
+;;; Code:
+(require 'ob-core)
+(require 'org-macs)
+
+(defun org-babel-table-truncate-at-newline (string)
+ "Replace newline character with ellipses.
+If STRING ends in a newline character, then remove the newline
+character and replace it with ellipses."
+ (if (and (stringp string) (string-match "[\n\r]\\(.\\)?" string))
+ (concat (substring string 0 (match-beginning 0))
+ (when (match-string 1 string) "..."))
+ string))
+
+(defmacro org-sbe (source-block &rest variables)
+ "Return the results of calling SOURCE-BLOCK with VARIABLES.
+
+Each element of VARIABLES should be a list of two elements: the
+first element is the name of the variable and second element is a
+string of its value.
+
+So this `org-sbe' construct
+
+ (org-sbe \"source-block\" (n $2) (m 3))
+
+is the equivalent of the following source code block:
+
+ #+begin_src emacs-lisp :var results=source-block(n=val_at_col_2, m=3) \\
+ :results silent
+ results
+ #+end_src
+
+NOTE: The quotation marks around the function name,
+'source-block', are optional.
+
+NOTE: By default, string variable names are interpreted as
+references to source-code blocks, to force interpretation of a
+cell's value as a string, prefix the identifier a \"$\" (e.g.,
+\"$$2\" instead of \"$2\" or \"$@2$2\" instead of \"@2$2\").
+
+NOTE: It is also possible to pass header arguments to the code
+block. In this case a table cell should hold the string value of
+the header argument which can then be passed before all variables
+as shown in the example below.
+
+| 1 | 2 | :file nothing.png | nothing.png |
+#+TBLFM: @1$4=\\='(org-sbe test-sbe $3 (x $1) (y $2))"
+ (declare (debug (form form)))
+ (let* ((header-args (if (stringp (car variables)) (car variables) ""))
+ (variables (if (stringp (car variables)) (cdr variables) variables)))
+ (let* (quote
+ (variables
+ (mapcar
+ (lambda (var)
+ ;; ensure that all cells prefixed with $'s are strings
+ (cons (car var)
+ (delq nil (mapcar
+ (lambda (el)
+ (if (eq '$ el)
+ (prog1 nil (setq quote t))
+ (prog1
+ (cond
+ (quote (format "\"%s\"" el))
+ ((stringp el) (org-no-properties el))
+ (t el))
+ (setq quote nil))))
+ (cdr var)))))
+ variables)))
+ (unless (stringp source-block)
+ (setq source-block (symbol-name source-block)))
+ (let ((result
+ (if (and source-block (> (length source-block) 0))
+ (let ((params
+ ;; FIXME: Why `eval'?!?!?
+ (eval `(org-babel-parse-header-arguments
+ (concat
+ ":var results="
+ ,source-block
+ "[" ,header-args "]"
+ "("
+ (mapconcat
+ (lambda (var-spec)
+ (if (> (length (cdr var-spec)) 1)
+ (format "%S='%S"
+ (car var-spec)
+ (mapcar #'read (cdr var-spec)))
+ (format "%S=%s"
+ (car var-spec) (cadr var-spec))))
+ ',variables ", ")
+ ")")))))
+ (org-babel-execute-src-block
+ nil (list "emacs-lisp" "results" params)
+ '((:results . "silent"))))
+ "")))
+ (org-trim (if (stringp result) result (format "%S" result)))))))
+
+(provide 'ob-table)
+
+;;; ob-table.el ends here
diff --git a/elpa/org-9.5.2/ob-table.elc b/elpa/org-9.5.2/ob-table.elc
new file mode 100644
index 0000000..0bd827c
--- /dev/null
+++ b/elpa/org-9.5.2/ob-table.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob-tangle.el b/elpa/org-9.5.2/ob-tangle.el
new file mode 100644
index 0000000..8ed7002
--- /dev/null
+++ b/elpa/org-9.5.2/ob-tangle.el
@@ -0,0 +1,616 @@
+;;; ob-tangle.el --- Extract Source Code From Org Files -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Eric Schulte
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Extract the code from source blocks out into raw source-code files.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'org-src)
+(require 'org-macs)
+(require 'ol)
+
+(declare-function make-directory "files" (dir &optional parents))
+(declare-function org-at-heading-p "org" (&optional ignored))
+(declare-function org-babel-update-block-body "ob-core" (new-body))
+(declare-function org-back-to-heading "org" (&optional invisible-ok))
+(declare-function org-before-first-heading-p "org" ())
+(declare-function org-element-at-point "org-element" ())
+(declare-function org-element-type "org-element" (element))
+(declare-function org-heading-components "org" ())
+(declare-function org-in-commented-heading-p "org" (&optional no-inheritance))
+(declare-function org-in-archived-heading-p "org" (&optional no-inheritance))
+(declare-function outline-previous-heading "outline" ())
+(defvar org-id-link-to-org-use-id nil) ; Dynamically scoped
+
+(defcustom org-babel-tangle-lang-exts
+ '(("emacs-lisp" . "el")
+ ("elisp" . "el"))
+ "Alist mapping languages to their file extensions.
+The key is the language name, the value is the string that should
+be inserted as the extension commonly used to identify files
+written in this language. If no entry is found in this list,
+then the name of the language is used."
+ :group 'org-babel-tangle
+ :version "24.1"
+ :type '(repeat
+ (cons
+ (string "Language name")
+ (string "File Extension"))))
+
+(defcustom org-babel-tangle-use-relative-file-links t
+ "Use relative path names in links from tangled source back the Org file."
+ :group 'org-babel-tangle
+ :type 'boolean)
+
+(defcustom org-babel-post-tangle-hook nil
+ "Hook run in code files tangled by `org-babel-tangle'."
+ :group 'org-babel
+ :version "24.1"
+ :type 'hook)
+
+(defcustom org-babel-pre-tangle-hook '(save-buffer)
+ "Hook run at the beginning of `org-babel-tangle'."
+ :group 'org-babel
+ :version "24.1"
+ :type 'hook)
+
+(defcustom org-babel-tangle-body-hook nil
+ "Hook run over the contents of each code block body."
+ :group 'org-babel
+ :version "24.1"
+ :type 'hook)
+
+(defcustom org-babel-tangle-comment-format-beg "[[%link][%source-name]]"
+ "Format of inserted comments in tangled code files.
+The following format strings can be used to insert special
+information into the output using `org-fill-template'.
+%start-line --- the line number at the start of the code block
+%file --------- the file from which the code block was tangled
+%link --------- Org style link to the code block
+%source-name -- name of the code block
+
+Upon insertion the formatted comment will be commented out, and
+followed by a newline. To inhibit this post-insertion processing
+set the `org-babel-tangle-uncomment-comments' variable to a
+non-nil value.
+
+Whether or not comments are inserted during tangling is
+controlled by the :comments header argument."
+ :group 'org-babel
+ :version "24.1"
+ :type 'string)
+
+(defcustom org-babel-tangle-comment-format-end "%source-name ends here"
+ "Format of inserted comments in tangled code files.
+The following format strings can be used to insert special
+information into the output using `org-fill-template'.
+%start-line --- the line number at the start of the code block
+%file --------- the file from which the code block was tangled
+%link --------- Org style link to the code block
+%source-name -- name of the code block
+
+Upon insertion the formatted comment will be commented out, and
+followed by a newline. To inhibit this post-insertion processing
+set the `org-babel-tangle-uncomment-comments' variable to a
+non-nil value.
+
+Whether or not comments are inserted during tangling is
+controlled by the :comments header argument."
+ :group 'org-babel
+ :version "24.1"
+ :type 'string)
+
+(defcustom org-babel-tangle-uncomment-comments nil
+ "Inhibits automatic commenting and addition of trailing newline
+of tangle comments. Use `org-babel-tangle-comment-format-beg'
+and `org-babel-tangle-comment-format-end' to customize the format
+of tangled comments."
+ :group 'org-babel
+ :type 'boolean)
+
+(defcustom org-babel-process-comment-text 'org-remove-indentation
+ "Function called to process raw Org text collected to be
+inserted as comments in tangled source-code files. The function
+should take a single string argument and return a string
+result. The default value is `org-remove-indentation'."
+ :group 'org-babel
+ :version "24.1"
+ :type 'function)
+
+(defun org-babel-find-file-noselect-refresh (file)
+ "Find file ensuring that the latest changes on disk are
+represented in the file."
+ (find-file-noselect file 'nowarn)
+ (with-current-buffer (get-file-buffer file)
+ (revert-buffer t t t)))
+
+(defmacro org-babel-with-temp-filebuffer (file &rest body)
+ "Open FILE into a temporary buffer execute BODY there like
+`progn', then kill the FILE buffer returning the result of
+evaluating BODY."
+ (declare (indent 1) (debug t))
+ (let ((temp-path (make-symbol "temp-path"))
+ (temp-result (make-symbol "temp-result"))
+ (temp-file (make-symbol "temp-file"))
+ (visited-p (make-symbol "visited-p")))
+ `(let* ((,temp-path ,file)
+ (,visited-p (get-file-buffer ,temp-path))
+ ,temp-result ,temp-file)
+ (org-babel-find-file-noselect-refresh ,temp-path)
+ (setf ,temp-file (get-file-buffer ,temp-path))
+ (with-current-buffer ,temp-file
+ (setf ,temp-result (progn ,@body)))
+ (unless ,visited-p (kill-buffer ,temp-file))
+ ,temp-result)))
+
+;;;###autoload
+(defun org-babel-tangle-file (file &optional target-file lang-re)
+ "Extract the bodies of source code blocks in FILE.
+Source code blocks are extracted with `org-babel-tangle'.
+
+Optional argument TARGET-FILE can be used to specify a default
+export file for all source blocks.
+
+Optional argument LANG-RE can be used to limit the exported
+source code blocks by languages matching a regular expression.
+
+Return a list whose CAR is the tangled file name."
+ (interactive "fFile to tangle: \nP")
+ (let* ((visited (find-buffer-visiting file))
+ (buffer (or visited (find-file-noselect file))))
+ (prog1
+ (with-current-buffer buffer
+ (org-with-wide-buffer
+ (mapcar #'expand-file-name
+ (org-babel-tangle nil target-file lang-re))))
+ (unless visited (kill-buffer buffer)))))
+
+(defun org-babel-tangle-publish (_ filename pub-dir)
+ "Tangle FILENAME and place the results in PUB-DIR."
+ (unless (file-exists-p pub-dir)
+ (make-directory pub-dir t))
+ (setq pub-dir (file-name-as-directory pub-dir))
+ (mapc (lambda (el) (copy-file el pub-dir t)) (org-babel-tangle-file filename)))
+
+;;;###autoload
+(defun org-babel-tangle (&optional arg target-file lang-re)
+ "Write code blocks to source-specific files.
+Extract the bodies of all source code blocks from the current
+file into their own source-specific files.
+With one universal prefix argument, only tangle the block at point.
+When two universal prefix arguments, only tangle blocks for the
+tangle file of the block at point.
+Optional argument TARGET-FILE can be used to specify a default
+export file for all source blocks. Optional argument LANG-RE can
+be used to limit the exported source code blocks by languages
+matching a regular expression."
+ (interactive "P")
+ (run-hooks 'org-babel-pre-tangle-hook)
+ ;; Possibly Restrict the buffer to the current code block
+ (save-restriction
+ (save-excursion
+ (when (equal arg '(4))
+ (let ((head (org-babel-where-is-src-block-head)))
+ (if head
+ (goto-char head)
+ (user-error "Point is not in a source code block"))))
+ (let ((block-counter 0)
+ (org-babel-default-header-args
+ (if target-file
+ (org-babel-merge-params org-babel-default-header-args
+ (list (cons :tangle target-file)))
+ org-babel-default-header-args))
+ (tangle-file
+ (when (equal arg '(16))
+ (or (cdr (assq :tangle (nth 2 (org-babel-get-src-block-info 'light))))
+ (user-error "Point is not in a source code block"))))
+ path-collector)
+ (mapc ;; map over file-names
+ (lambda (by-fn)
+ (let ((file-name (car by-fn)))
+ (when file-name
+ (let ((lspecs (cdr by-fn))
+ (fnd (file-name-directory file-name))
+ modes make-dir she-banged lang)
+ ;; drop source-blocks to file
+ ;; We avoid append-to-file as it does not work with tramp.
+ (with-temp-buffer
+ (mapc
+ (lambda (lspec)
+ (let* ((block-lang (car lspec))
+ (spec (cdr lspec))
+ (get-spec (lambda (name) (cdr (assq name (nth 4 spec)))))
+ (she-bang (let ((sheb (funcall get-spec :shebang)))
+ (when (> (length sheb) 0) sheb)))
+ (tangle-mode (funcall get-spec :tangle-mode)))
+ (unless (string-equal block-lang lang)
+ (setq lang block-lang)
+ (let ((lang-f (org-src-get-lang-mode lang)))
+ (when (fboundp lang-f) (ignore-errors (funcall lang-f)))))
+ ;; if file contains she-bangs, then make it executable
+ (when she-bang
+ (unless tangle-mode (setq tangle-mode #o755)))
+ (when tangle-mode
+ (add-to-list 'modes tangle-mode))
+ ;; Possibly create the parent directories for file.
+ (let ((m (funcall get-spec :mkdirp)))
+ (and m fnd (not (string= m "no"))
+ (setq make-dir t)))
+ ;; Handle :padlines unless first line in file
+ (unless (or (string= "no" (funcall get-spec :padline))
+ (= (point) (point-min)))
+ (insert "\n"))
+ (when (and she-bang (not she-banged))
+ (insert (concat she-bang "\n"))
+ (setq she-banged t))
+ (org-babel-spec-to-string spec)
+ (setq block-counter (+ 1 block-counter))))
+ lspecs)
+ (when make-dir
+ (make-directory fnd 'parents))
+ ;; erase previous file
+ (when (file-exists-p file-name)
+ (delete-file file-name))
+ (write-region nil nil file-name)
+ (mapc (lambda (mode) (set-file-modes file-name mode)) modes)
+ (push file-name path-collector))))))
+ (if (equal arg '(4))
+ (org-babel-tangle-single-block 1 t)
+ (org-babel-tangle-collect-blocks lang-re tangle-file)))
+ (message "Tangled %d code block%s from %s" block-counter
+ (if (= block-counter 1) "" "s")
+ (file-name-nondirectory
+ (buffer-file-name
+ (or (buffer-base-buffer)
+ (current-buffer)
+ (and (org-src-edit-buffer-p)
+ (org-src-source-buffer))))))
+ ;; run `org-babel-post-tangle-hook' in all tangled files
+ (when org-babel-post-tangle-hook
+ (mapc
+ (lambda (file)
+ (org-babel-with-temp-filebuffer file
+ (run-hooks 'org-babel-post-tangle-hook)))
+ path-collector))
+ path-collector))))
+
+(defun org-babel-tangle-clean ()
+ "Remove comments inserted by `org-babel-tangle'.
+Call this function inside of a source-code file generated by
+`org-babel-tangle' to remove all comments inserted automatically
+by `org-babel-tangle'. Warning, this comment removes any lines
+containing constructs which resemble Org file links or noweb
+references."
+ (interactive)
+ (goto-char (point-min))
+ (while (or (re-search-forward "\\[\\[file:.*\\]\\[.*\\]\\]" nil t)
+ (re-search-forward (org-babel-noweb-wrap) nil t))
+ (delete-region (save-excursion (beginning-of-line 1) (point))
+ (save-excursion (end-of-line 1) (forward-char 1) (point)))))
+
+(defun org-babel-spec-to-string (spec)
+ "Insert SPEC into the current file.
+
+Insert the source-code specified by SPEC into the current source
+code file. This function uses `comment-region' which assumes
+that the appropriate major-mode is set. SPEC has the form:
+
+ (start-line file link source-name params body comment)"
+ (pcase-let*
+ ((`(,start ,file ,link ,source ,info ,body ,comment) spec)
+ (comments (cdr (assq :comments info)))
+ (link? (or (string= comments "both") (string= comments "link")
+ (string= comments "yes") (string= comments "noweb")))
+ (link-data `(("start-line" . ,(number-to-string start))
+ ("file" . ,file)
+ ("link" . ,link)
+ ("source-name" . ,source)))
+ (insert-comment (lambda (text)
+ (when (and comments
+ (not (string= comments "no"))
+ (org-string-nw-p text))
+ (if org-babel-tangle-uncomment-comments
+ ;; Plain comments: no processing.
+ (insert text)
+ ;; Ensure comments are made to be
+ ;; comments, and add a trailing newline.
+ ;; Also ignore invisible characters when
+ ;; commenting.
+ (comment-region
+ (point)
+ (progn (insert (org-no-properties text))
+ (point)))
+ (end-of-line)
+ (insert "\n"))))))
+ (when comment (funcall insert-comment comment))
+ (when link?
+ (funcall insert-comment
+ (org-fill-template
+ org-babel-tangle-comment-format-beg link-data)))
+ (insert body "\n")
+ (when link?
+ (funcall insert-comment
+ (org-fill-template
+ org-babel-tangle-comment-format-end link-data)))))
+
+(defun org-babel-effective-tangled-filename (buffer-fn src-lang src-tfile)
+ "Return effective tangled filename of a source-code block.
+BUFFER-FN is the name of the buffer, SRC-LANG the language of the
+block and SRC-TFILE is the value of the :tangle header argument,
+as computed by `org-babel-tangle-single-block'."
+ (let ((base-name (cond
+ ((string= "yes" src-tfile)
+ ;; Use the buffer name
+ (file-name-sans-extension buffer-fn))
+ ((string= "no" src-tfile) nil)
+ ((> (length src-tfile) 0) src-tfile)))
+ (ext (or (cdr (assoc src-lang org-babel-tangle-lang-exts)) src-lang)))
+ (when base-name
+ ;; decide if we want to add ext to base-name
+ (if (and ext (string= "yes" src-tfile))
+ (concat base-name "." ext) base-name))))
+
+(defun org-babel-tangle-collect-blocks (&optional lang-re tangle-file)
+ "Collect source blocks in the current Org file.
+Return an association list of language and source-code block
+specifications of the form used by `org-babel-spec-to-string'
+grouped by tangled file name.
+
+Optional argument LANG-RE can be used to limit the collected
+source code blocks by languages matching a regular expression.
+
+Optional argument TANGLE-FILE can be used to limit the collected
+code blocks by target file."
+ (let ((counter 0) last-heading-pos blocks)
+ (org-babel-map-src-blocks (buffer-file-name)
+ (let ((current-heading-pos
+ (org-with-wide-buffer
+ (org-with-limited-levels (outline-previous-heading)))))
+ (if (eq last-heading-pos current-heading-pos) (cl-incf counter)
+ (setq counter 1)
+ (setq last-heading-pos current-heading-pos)))
+ (unless (or (org-in-commented-heading-p)
+ (org-in-archived-heading-p))
+ (let* ((info (org-babel-get-src-block-info 'light))
+ (src-lang (nth 0 info))
+ (src-tfile (cdr (assq :tangle (nth 2 info)))))
+ (unless (or (string= src-tfile "no")
+ (and tangle-file (not (equal tangle-file src-tfile)))
+ (and lang-re (not (string-match-p lang-re src-lang))))
+ ;; Add the spec for this block to blocks under its tangled
+ ;; file name.
+ (let* ((block (org-babel-tangle-single-block counter))
+ (src-tfile (cdr (assq :tangle (nth 4 block))))
+ (file-name (org-babel-effective-tangled-filename
+ (nth 1 block) src-lang src-tfile))
+ (by-fn (assoc file-name blocks)))
+ (if by-fn (setcdr by-fn (cons (cons src-lang block) (cdr by-fn)))
+ (push (cons file-name (list (cons src-lang block))) blocks)))))))
+ ;; Ensure blocks are in the correct order.
+ (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.
+Return the list of block attributes needed by
+`org-babel-tangle-collect-blocks'. When ONLY-THIS-BLOCK is
+non-nil, return the full association list to be used by
+`org-babel-tangle' directly."
+ (let* ((info (org-babel-get-src-block-info))
+ (start-line
+ (save-restriction (widen)
+ (+ 1 (line-number-at-pos (point)))))
+ (file (buffer-file-name (buffer-base-buffer)))
+ (src-lang (nth 0 info))
+ (params (nth 2 info))
+ (extra (nth 3 info))
+ (coderef (nth 6 info))
+ (cref-regexp (org-src-coderef-regexp coderef))
+ (link (let* (
+ ;; The created link is transient. Using ID is
+ ;; not necessary, but could have side-effects if
+ ;; used. An ID property may be added to
+ ;; existing entries thus creatin unexpected file
+ ;; modifications.
+ (org-id-link-to-org-use-id nil)
+ (l (org-no-properties (org-store-link nil))))
+ (and (string-match org-link-bracket-re l)
+ (match-string 1 l))))
+ (source-name
+ (or (nth 4 info)
+ (format "%s:%d"
+ (or (ignore-errors (nth 4 (org-heading-components)))
+ "No heading")
+ block-counter)))
+ (expand-cmd (intern (concat "org-babel-expand-body:" src-lang)))
+ (assignments-cmd
+ (intern (concat "org-babel-variable-assignments:" src-lang)))
+ (body
+ ;; Run the tangle-body-hook.
+ (let ((body (if (org-babel-noweb-p params :tangle)
+ (org-babel-expand-noweb-references info)
+ (nth 1 info))))
+ (with-temp-buffer
+ (insert
+ ;; Expand body in language specific manner.
+ (cond ((assq :no-expand params) body)
+ ((fboundp expand-cmd) (funcall expand-cmd body params))
+ (t
+ (org-babel-expand-body:generic
+ body params (and (fboundp assignments-cmd)
+ (funcall assignments-cmd params))))))
+ (when (string-match "-r" extra)
+ (goto-char (point-min))
+ (while (re-search-forward cref-regexp nil t)
+ (replace-match "")))
+ (run-hooks 'org-babel-tangle-body-hook)
+ (buffer-string))))
+ (comment
+ (when (or (string= "both" (cdr (assq :comments params)))
+ (string= "org" (cdr (assq :comments params))))
+ ;; From the previous heading or code-block end
+ (funcall
+ org-babel-process-comment-text
+ (buffer-substring
+ (max (condition-case nil
+ (save-excursion
+ (org-back-to-heading t) ; Sets match data
+ (match-end 0))
+ (error (point-min)))
+ (save-excursion
+ (if (re-search-backward
+ org-babel-src-block-regexp nil t)
+ (match-end 0)
+ (point-min))))
+ (point)))))
+ (result
+ (list start-line
+ (if org-babel-tangle-use-relative-file-links
+ (file-relative-name file)
+ file)
+ (if (and org-babel-tangle-use-relative-file-links
+ (string-match org-link-types-re link)
+ (string= (match-string 1 link) "file"))
+ (concat "file:"
+ (file-relative-name (substring link (match-end 0))
+ (file-name-directory
+ (cdr (assq :tangle params)))))
+ link)
+ source-name
+ params
+ (if org-src-preserve-indentation
+ (org-trim body t)
+ (org-trim (org-remove-indentation body)))
+ comment)))
+ (if only-this-block
+ (let* ((src-tfile (cdr (assq :tangle (nth 4 result))))
+ (file-name (org-babel-effective-tangled-filename
+ (nth 1 result) src-lang src-tfile)))
+ (list (cons file-name (list (cons src-lang result)))))
+ result)))
+
+(defun org-babel-tangle-comment-links (&optional info)
+ "Return a list of begin and end link comments for the code block at point.
+INFO, when non nil, is the source block information, as returned
+by `org-babel-get-src-block-info'."
+ (let ((link-data (pcase (or info (org-babel-get-src-block-info 'light))
+ (`(,_ ,_ ,_ ,_ ,name ,start ,_)
+ `(("start-line" . ,(org-with-point-at start
+ (number-to-string
+ (line-number-at-pos))))
+ ("file" . ,(buffer-file-name))
+ ("link" . ,(let (;; The created link is transient. Using ID is
+ ;; not necessary, but could have side-effects if
+ ;; used. An ID property may be added to
+ ;; existing entries thus creatin unexpected file
+ ;; modifications.
+ (org-id-link-to-org-use-id nil))
+ (org-no-properties (org-store-link nil))))
+ ("source-name" . ,name))))))
+ (list (org-fill-template org-babel-tangle-comment-format-beg link-data)
+ (org-fill-template org-babel-tangle-comment-format-end link-data))))
+
+;; de-tangling functions
+(defun org-babel-detangle (&optional source-code-file)
+ "Propagate changes in source file back original to Org file.
+This requires that code blocks were tangled with link comments
+which enable the original code blocks to be found."
+ (interactive)
+ (save-excursion
+ (when source-code-file (find-file source-code-file))
+ (goto-char (point-min))
+ (let ((counter 0) new-body end)
+ (while (re-search-forward org-link-bracket-re nil t)
+ (if (and (match-string 2)
+ (re-search-forward
+ (concat " " (regexp-quote (match-string 2)) " ends here") nil t))
+ (progn (setq end (match-end 0))
+ (forward-line -1)
+ (save-excursion
+ (when (setq new-body (org-babel-tangle-jump-to-org))
+ (org-babel-update-block-body new-body)))
+ (setq counter (+ 1 counter)))
+ (setq end (point)))
+ (goto-char end))
+ (prog1 counter (message "Detangled %d code blocks" counter)))))
+
+(defun org-babel-tangle-jump-to-org ()
+ "Jump from a tangled code file to the related Org mode file."
+ (interactive)
+ (let ((mid (point))
+ start body-start end target-buffer target-char link block-name body)
+ (save-window-excursion
+ (save-excursion
+ (while (and (re-search-backward org-link-bracket-re nil t)
+ (not ; ever wider searches until matching block comments
+ (and (setq start (line-beginning-position))
+ (setq body-start (line-beginning-position 2))
+ (setq link (match-string 0))
+ (setq block-name (match-string 2))
+ (save-excursion
+ (save-match-data
+ (re-search-forward
+ (concat " " (regexp-quote block-name)
+ " ends here")
+ nil t)
+ (setq end (line-beginning-position))))))))
+ (unless (and start (< start mid) (< mid end))
+ (error "Not in tangled code"))
+ (setq body (buffer-substring body-start end)))
+ ;; Go to the beginning of the relative block in Org file.
+ (org-link-open-from-string link)
+ (setq target-buffer (current-buffer))
+ (if (string-match "[^ \t\n\r]:\\([[:digit:]]+\\)" block-name)
+ (let ((n (string-to-number (match-string 1 block-name))))
+ (if (org-before-first-heading-p) (goto-char (point-min))
+ (org-back-to-heading t))
+ ;; Do not skip the first block if it begins at point min.
+ (cond ((or (org-at-heading-p)
+ (not (eq (org-element-type (org-element-at-point))
+ 'src-block)))
+ (org-babel-next-src-block n))
+ ((= n 1))
+ (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))
+ (forward-line 1)
+ ;; 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)
+ body))
+
+(provide 'ob-tangle)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ob-tangle.el ends here
diff --git a/elpa/org-9.5.2/ob-tangle.elc b/elpa/org-9.5.2/ob-tangle.elc
new file mode 100644
index 0000000..87fba1e
--- /dev/null
+++ b/elpa/org-9.5.2/ob-tangle.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ob.el b/elpa/org-9.5.2/ob.el
new file mode 100644
index 0000000..1e89b02
--- /dev/null
+++ b/elpa/org-9.5.2/ob.el
@@ -0,0 +1,43 @@
+;;; ob.el --- Working with Code Blocks in Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Authors: Eric Schulte
+;; Keywords: literate programming, reproducible research
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Code:
+(require 'org-macs)
+(require 'org-compat)
+(require 'org-keys)
+(require 'ob-eval)
+(require 'ob-core)
+(require 'ob-comint)
+(require 'ob-exp)
+(require 'ob-table)
+(require 'ob-lob)
+(require 'ob-ref)
+(require 'ob-tangle)
+
+(provide 'ob)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ob.el ends here
diff --git a/elpa/org-9.5.2/ob.elc b/elpa/org-9.5.2/ob.elc
new file mode 100644
index 0000000..e0f00a3
--- /dev/null
+++ b/elpa/org-9.5.2/ob.elc
Binary files differ
diff --git a/elpa/org-9.5.2/oc-basic.el b/elpa/org-9.5.2/oc-basic.el
new file mode 100644
index 0000000..7c83bdc
--- /dev/null
+++ b/elpa/org-9.5.2/oc-basic.el
@@ -0,0 +1,789 @@
+;;; oc-basic.el --- basic back-end for citations -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; The `basic' citation processor provides "activate", "follow", "export" and
+;; "insert" capabilities.
+
+;; "activate" capability re-uses default fontification, but provides additional
+;; features on both correct and wrong keys according to the bibliography
+;; defined in the document.
+
+;; When the mouse is over a known key, it displays the corresponding
+;; bibliography entry. Any wrong key, however, is highlighted with `error'
+;; face. Moreover, moving the mouse onto it displays a list of suggested correct
+;; keys, and pressing <mouse-1> on the faulty key will try to fix it according to
+;; those suggestions.
+
+;; On a citation key, "follow" capability moves point to the corresponding entry
+;; in the current bibliography. Elsewhere on the citation, it asks the user to
+;; follow any of the keys cited there, with completion.
+
+;; "export" capability supports the following citation styles:
+;;
+;; - author (a), including caps (c) variant,
+;; - noauthor (na) including bare (b) variant,
+;; - text (t), including bare (b), caps (c), and bare-caps (bc) variants,
+;; - note (ft, including bare (b), caps (c), and bare-caps (bc) variants,
+;; - nocite (n)
+;; - numeric (nb),
+;; - default, including bare (b), caps (c), and bare-caps (bc) variants.
+;;
+;; It also supports the following styles for bibliography:
+;; - plain
+;; - numeric
+;; - author-year (default)
+
+;; "insert" capability inserts or edits (with completion) citation style or
+;; citation reference keys. In an appropriate place, it offers to insert a new
+;; citation. With a prefix argument, it removes the one at point.
+
+;; It supports bibliography files in BibTeX (".bibtex"), biblatex (".bib") and
+;; JSON (".json") format.
+
+;; Disclaimer: this citation processor is meant to be a proof of concept, and
+;; possibly a fall-back mechanism when nothing else is available. It is too
+;; limited for any serious use case.
+
+;;; Code:
+
+(require 'bibtex)
+(require 'json)
+(require 'map)
+(require 'oc)
+(require 'seq)
+
+(declare-function org-open-at-point "org" (&optional arg))
+
+(declare-function org-element-interpret-data "org-element" (data))
+(declare-function org-element-property "org-element" (property element))
+(declare-function org-element-type "org-element" (element))
+
+(declare-function org-export-data "org-export" (data info))
+(declare-function org-export-derived-backend-p "org-export" (backend &rest backends))
+(declare-function org-export-raw-string "org-export" (contents))
+
+
+;;; Customization
+(defcustom org-cite-basic-sorting-field 'author
+ "Field used to sort bibliography items as a symbol, or nil."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type 'symbol
+ :safe #'symbolp)
+
+(defcustom org-cite-basic-author-year-separator ", "
+ "String used to separate cites in an author-year configuration."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type 'string
+ :safe #'stringp)
+
+(defcustom org-cite-basic-max-key-distance 2
+ "Maximum (Levenshtein) distance between a wrong key and its suggestions."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type 'integer
+ :safe #'integerp)
+
+(defcustom org-cite-basic-author-column-end 25
+ "Column where author field ends in completion table, as an integer."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type 'integer
+ :safe #'integerp)
+
+(defcustom org-cite-basic-column-separator " "
+ "Column separator in completion table, as a string."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type 'string
+ :safe #'stringp)
+
+(defcustom org-cite-basic-mouse-over-key-face 'highlight
+ "Face used when mouse is over a citation key."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type 'face
+ :safe #'facep)
+
+
+;;; Internal variables
+(defvar org-cite-basic--bibliography-cache nil
+ "Cache for parsed bibliography files.
+
+This is an association list following the pattern:
+
+ (FILE-ID . ENTRIES)
+
+FILE-ID is a cons cell (FILE . HASH), with FILE being the absolute file name of
+the bibliography file, and HASH a hash of its contents.
+
+ENTRIES is a hash table with citation references as keys and fields alist as
+values.")
+
+(defvar org-cite-basic--completion-cache (make-hash-table :test #'equal)
+ "Cache for key completion table.
+
+This is an a hash-table.")
+
+
+;;; Internal functions
+(defun org-cite-basic--parse-json ()
+ "Parse JSON entries in the current buffer.
+Return a hash table with citation references as keys and fields alist as values."
+ (let ((entries (make-hash-table :test #'equal)))
+ (let ((json-array-type 'list)
+ (json-key-type 'symbol))
+ (dolist (item (json-read))
+ (puthash (cdr (assq 'id item))
+ (mapcar (pcase-lambda (`(,field . ,value))
+ (pcase field
+ ('author
+ ;; Author is an array of objects, each
+ ;; of them designing a person. These
+ ;; objects may contain multiple
+ ;; properties, but for this basic
+ ;; processor, we'll focus on `given' and
+ ;; `family'.
+ ;;
+ ;; For compatibility with BibTeX, add
+ ;; "and" between authors.
+ (cons 'author
+ (mapconcat
+ (lambda (alist)
+ (concat (alist-get 'family alist)
+ " "
+ (alist-get 'given alist)))
+ value
+ " and ")))
+ ('issued
+ ;; Date are expressed as an array
+ ;; (`date-parts') or a "string (`raw').
+ ;; In both cases, extract the year and
+ ;; associate it to `year' field, for
+ ;; compatibility with BibTeX format.
+ (let ((date (or (alist-get 'date-parts value)
+ (alist-get 'raw value))))
+ (cons 'year
+ (cond
+ ((consp date)
+ (caar date))
+ ((stringp date)
+ (car (split-string date "-")))
+ (t
+ (error "Unknown CSL-JSON date format: %S"
+ date))))))
+ (_
+ (cons field value))))
+ item)
+ entries))
+ entries)))
+
+(defun org-cite-basic--parse-bibtex (dialect)
+ "Parse BibTeX entries in the current buffer.
+DIALECT is the BibTeX dialect used. See `bibtex-dialect'.
+Return a hash table with citation references as keys and fields alist as values."
+ (let ((entries (make-hash-table :test #'equal))
+ (bibtex-sort-ignore-string-entries t))
+ (bibtex-set-dialect dialect t)
+ (bibtex-map-entries
+ (lambda (key &rest _)
+ ;; Normalize entries: field names are turned into symbols
+ ;; including special "=key=" and "=type=", and consecutive
+ ;; white spaces are removed from values.
+ (puthash key
+ (mapcar
+ (pcase-lambda (`(,field . ,value))
+ (pcase field
+ ("=key=" (cons 'id key))
+ ("=type=" (cons 'type value))
+ (_
+ (cons
+ (intern (downcase field))
+ (replace-regexp-in-string "[ \t\n]+" " " value)))))
+ (bibtex-parse-entry t))
+ entries)))
+ entries))
+
+(defun org-cite-basic--parse-bibliography (&optional info)
+ "List all entries available in the buffer.
+
+Each association follows the pattern
+
+ (FILE . ENTRIES)
+
+where FILE is the absolute file name of the BibTeX file, and ENTRIES is a hash
+table where keys are references and values are association lists between fields,
+as symbols, and values as strings or nil.
+
+Optional argument INFO is the export state, as a property list."
+ (if (plist-member info :cite-basic/bibliography)
+ (plist-get info :cite-basic/bibliography)
+ (let ((results nil))
+ (dolist (file (org-cite-list-bibliography-files))
+ (when (file-readable-p file)
+ (with-temp-buffer
+ (insert-file-contents file)
+ (let* ((file-id (cons file (org-buffer-hash)))
+ (entries
+ (or (cdr (assoc file-id org-cite-basic--bibliography-cache))
+ (let ((table
+ (pcase (file-name-extension file)
+ ("json" (org-cite-basic--parse-json))
+ ("bib" (org-cite-basic--parse-bibtex 'biblatex))
+ ("bibtex" (org-cite-basic--parse-bibtex 'BibTeX))
+ (ext
+ (user-error "Unknown bibliography extension: %S"
+ ext)))))
+ (push (cons file-id table) org-cite-basic--bibliography-cache)
+ table))))
+ (push (cons file entries) results)))))
+ (when info (plist-put info :cite-basic/bibliography results))
+ results)))
+
+(defun org-cite-basic--key-number (key info)
+ "Return number associated to cited KEY.
+INFO is the export state, as a property list."
+ (let ((predicate
+ (org-cite-basic--field-less-p org-cite-basic-sorting-field info)))
+ (org-cite-key-number key info predicate)))
+
+(defun org-cite-basic--all-keys ()
+ "List all keys available in current bibliography."
+ (seq-mapcat (pcase-lambda (`(,_ . ,entries))
+ (map-keys entries))
+ (org-cite-basic--parse-bibliography)))
+
+(defun org-cite-basic--get-entry (key &optional info)
+ "Return BibTeX entry for KEY, as an association list.
+When non-nil, INFO is the export state, as a property list."
+ (catch :found
+ (pcase-dolist (`(,_ . ,entries) (org-cite-basic--parse-bibliography info))
+ (let ((entry (gethash key entries)))
+ (when entry (throw :found entry))))
+ nil))
+
+(defun org-cite-basic--get-field (field entry-or-key &optional info raw)
+ "Return FIELD value for ENTRY-OR-KEY, or nil.
+
+FIELD is a symbol. ENTRY-OR-KEY is either an association list, as returned by
+`org-cite-basic--get-entry', or a string representing a citation key.
+
+Optional argument INFO is the export state, as a property list.
+
+Return value may be nil or a string. If current export back-end is derived
+from `latex', return a raw string instead, unless optional argument RAW is
+non-nil."
+ (let ((value
+ (cdr
+ (assq field
+ (pcase entry-or-key
+ ((pred stringp)
+ (org-cite-basic--get-entry entry-or-key info))
+ ((pred consp)
+ entry-or-key)
+ (_
+ (error "Wrong value for ENTRY-OR-KEY: %S" entry-or-key)))))))
+ (if (and value
+ (not raw)
+ (org-export-derived-backend-p (plist-get info :back-end) 'latex))
+ (org-export-raw-string value)
+ value)))
+
+(defun org-cite-basic--number-to-suffix (n)
+ "Compute suffix associated to number N.
+This is used for disambiguation."
+ (let ((result nil))
+ (apply #'string
+ (mapcar (lambda (n) (+ 97 n))
+ (catch :complete
+ (while t
+ (push (% n 26) result)
+ (setq n (/ n 26))
+ (cond
+ ((= n 0) (throw :complete result))
+ ((< n 27) (throw :complete (cons (1- n) result)))
+ ((= n 27) (throw :complete (cons 0 (cons 0 result))))
+ (t nil))))))))
+
+(defun org-cite-basic--get-year (entry-or-key info &optional no-suffix)
+ "Return year associated to ENTRY-OR-KEY.
+
+ENTRY-OR-KEY is either an association list, as returned by
+`org-cite-basic--get-entry', or a string representing a citation
+key. INFO is the export state, as a property list.
+
+Year is obtained from the \"year\" field, if available, or from
+the \"date\" field if it starts with a year pattern.
+
+Unlike `org-cite-basic--get-field', this function disambiguates
+author-year patterns by adding a letter suffix to the year when
+necessary, unless optional argument NO-SUFFIX is non-nil."
+ ;; The cache is an association list with the following structure:
+ ;;
+ ;; (AUTHOR-YEAR . KEY-SUFFIX-ALIST).
+ ;;
+ ;; AUTHOR-YEAR is the author year pair associated to current entry
+ ;; or key.
+ ;;
+ ;; KEY-SUFFIX-ALIST is an association (KEY . SUFFIX), where KEY is
+ ;; the cite key, as a string, and SUFFIX is the generated suffix
+ ;; string, or the empty string.
+ (let* ((author (org-cite-basic--get-field 'author entry-or-key info 'raw))
+ (year
+ (or (org-cite-basic--get-field 'year entry-or-key info 'raw)
+ (let ((date
+ (org-cite-basic--get-field 'date entry-or-key info t)))
+ (and (stringp date)
+ (string-match (rx string-start
+ (group (= 4 digit))
+ (or string-end (not digit)))
+ date)
+ (match-string 1 date)))))
+ (cache-key (cons author year))
+ (key
+ (pcase entry-or-key
+ ((pred stringp) entry-or-key)
+ ((pred consp) (cdr (assq 'id entry-or-key)))
+ (_ (error "Wrong value for ENTRY-OR-KEY: %S" entry-or-key))))
+ (cache (plist-get info :cite-basic/author-date-cache)))
+ (pcase (assoc cache-key cache)
+ ('nil
+ (let ((value (cons cache-key (list (cons key "")))))
+ (plist-put info :cite-basic/author-date-cache (cons value cache))
+ year))
+ (`(,_ . ,alist)
+ (let ((suffix
+ (or (cdr (assoc key alist))
+ (let ((new (org-cite-basic--number-to-suffix
+ (1- (length alist)))))
+ (push (cons key new) alist)
+ new))))
+ (if no-suffix year (concat year suffix)))))))
+
+(defun org-cite-basic--print-entry (entry style &optional info)
+ "Format ENTRY according to STYLE string.
+ENTRY is an alist, as returned by `org-cite-basic--get-entry'.
+Optional argument INFO is the export state, as a property list."
+ (let ((author (org-cite-basic--get-field 'author entry info))
+ (title (org-cite-basic--get-field 'title entry info))
+ (from
+ (or (org-cite-basic--get-field 'publisher entry info)
+ (org-cite-basic--get-field 'journal entry info)
+ (org-cite-basic--get-field 'institution entry info)
+ (org-cite-basic--get-field 'school entry info))))
+ (pcase style
+ ("plain"
+ (let ((year (org-cite-basic--get-year entry info 'no-suffix)))
+ (org-cite-concat
+ author ". " title (and from (list ", " from)) ", " year ".")))
+ ("numeric"
+ (let ((n (org-cite-basic--key-number (cdr (assq 'id entry)) info))
+ (year (org-cite-basic--get-year entry info 'no-suffix)))
+ (org-cite-concat
+ (format "[%d] " n) author ", "
+ (org-cite-emphasize 'italic title)
+ (and from (list ", " from)) ", "
+ year ".")))
+ ;; Default to author-year. Use year disambiguation there.
+ (_
+ (let ((year (org-cite-basic--get-year entry info)))
+ (org-cite-concat
+ author " (" year "). "
+ (org-cite-emphasize 'italic title)
+ (and from (list ", " from)) "."))))))
+
+
+;;; "Activate" capability
+(defun org-cite-basic--close-keys (key keys)
+ "List cite keys close to KEY in terms of string distance."
+ (seq-filter (lambda (k)
+ (>= org-cite-basic-max-key-distance
+ (org-string-distance k key)))
+ keys))
+
+(defun org-cite-basic--set-keymap (beg end suggestions)
+ "Set keymap on citation key between BEG and END positions.
+
+When the key is know, SUGGESTIONS is nil. Otherwise, it may be
+a list of replacement keys, as strings, which will be offered as
+substitutes for the unknown key. Finally, it may be the symbol
+`all'."
+ (let ((km (make-sparse-keymap)))
+ (define-key km (kbd "<mouse-1>")
+ (pcase suggestions
+ ('nil #'org-open-at-point)
+ ('all #'org-cite-insert)
+ (_
+ (lambda ()
+ (interactive)
+ (setf (buffer-substring beg end)
+ (concat "@"
+ (if (= 1 (length suggestions))
+ (car suggestions)
+ (completing-read "Did you mean: "
+ suggestions nil t))))))))
+ (put-text-property beg end 'keymap km)))
+
+(defun org-cite-basic-activate (citation)
+ "Set various text properties on CITATION object.
+
+Fontify whole citation with `org-cite' face. Fontify key with `error' face
+when it does not belong to known keys. Otherwise, use `org-cite-key' face.
+
+Moreover, when mouse is on a known key, display the corresponding bibliography.
+On a wrong key, suggest a list of possible keys, and offer to substitute one of
+them with a mouse click."
+ (pcase-let ((`(,beg . ,end) (org-cite-boundaries citation))
+ (keys (org-cite-basic--all-keys)))
+ (put-text-property beg end 'font-lock-multiline t)
+ (add-face-text-property beg end 'org-cite)
+ (dolist (reference (org-cite-get-references citation))
+ (pcase-let* ((`(,beg . ,end) (org-cite-key-boundaries reference))
+ (key (org-element-property :key reference)))
+ ;; Highlight key on mouse over.
+ (put-text-property beg end
+ 'mouse-face
+ org-cite-basic-mouse-over-key-face)
+ (if (member key keys)
+ ;; Activate a correct key. Face is `org-cite-key' and
+ ;; `help-echo' displays bibliography entry, for reference.
+ ;; <mouse-1> calls `org-open-at-point'.
+ (let* ((entry (org-cite-basic--get-entry key))
+ (bibliography-entry
+ (org-element-interpret-data
+ (org-cite-basic--print-entry entry "plain"))))
+ (add-face-text-property beg end 'org-cite-key)
+ (put-text-property beg end 'help-echo bibliography-entry)
+ (org-cite-basic--set-keymap beg end nil))
+ ;; Activate a wrong key. Face is `error', `help-echo'
+ ;; displays possible suggestions.
+ (add-face-text-property beg end 'error)
+ (let ((close-keys (org-cite-basic--close-keys key keys)))
+ (when close-keys
+ (put-text-property beg end 'help-echo
+ (concat "Suggestions (mouse-1 to substitute): "
+ (mapconcat #'identity close-keys " "))))
+ ;; When the are close know keys, <mouse-1> provides
+ ;; completion to fix the current one. Otherwise, call
+ ;; `org-cite-insert'.
+ (org-cite-basic--set-keymap beg end (or close-keys 'all))))))))
+
+
+;;; "Export" capability
+(defun org-cite-basic--format-author-year (citation format-cite format-ref info)
+ "Format CITATION object according to author-year format.
+
+FORMAT-CITE is a function of three arguments: the global prefix, the contents,
+and the global suffix. All arguments can be strings or secondary strings.
+
+FORMAT-REF is a function of four arguments: the reference prefix, as a string or
+secondary string, the author, the year, and the reference suffix, as a string or
+secondary string.
+
+INFO is the export state, as a property list."
+ (org-export-data
+ (funcall format-cite
+ (org-element-property :prefix citation)
+ (org-cite-mapconcat
+ (lambda (ref)
+ (let ((k (org-element-property :key ref))
+ (prefix (org-element-property :prefix ref))
+ (suffix (org-element-property :suffix ref)))
+ (funcall format-ref
+ prefix
+ (org-cite-basic--get-field 'author k info)
+ (org-cite-basic--get-year k info)
+ suffix)))
+ (org-cite-get-references citation)
+ org-cite-basic-author-year-separator)
+ (org-element-property :suffix citation))
+ info))
+
+(defun org-cite-basic--citation-numbers (citation info)
+ "Return numbers associated to references in CITATION object.
+INFO is the export state as a property list."
+ (let* ((numbers
+ (sort (mapcar (lambda (k) (org-cite-basic--key-number k info))
+ (org-cite-get-references citation t))
+ #'<))
+ (last (car numbers))
+ (result (list (number-to-string (pop numbers)))))
+ ;; Use compact number references, i.e., "1, 2, 3" becomes "1-3".
+ (while numbers
+ (let ((current (pop numbers))
+ (next (car numbers)))
+ (cond
+ ((and next
+ (= current (1+ last))
+ (= current (1- next)))
+ (unless (equal "-" (car result))
+ (push "-" result)))
+ ((equal "-" (car result))
+ (push (number-to-string current) result))
+ (t
+ (push (format ", %d" current) result)))
+ (setq last current)))
+ (apply #'concat (nreverse result))))
+
+(defun org-cite-basic--field-less-p (field info)
+ "Return a sort predicate comparing FIELD values for two citation keys.
+INFO is the export state, as a property list."
+ (and field
+ (lambda (a b)
+ (org-string-collate-lessp
+ (org-cite-basic--get-field field a info 'raw)
+ (org-cite-basic--get-field field b info 'raw)
+ nil t))))
+
+(defun org-cite-basic--sort-keys (keys info)
+ "Sort KEYS by author name.
+INFO is the export communication channel, as a property list."
+ (let ((predicate (org-cite-basic--field-less-p org-cite-basic-sorting-field info)))
+ (if predicate
+ (sort keys predicate)
+ keys)))
+
+(defun org-cite-basic-export-citation (citation style _ info)
+ "Export CITATION object.
+STYLE is the expected citation style, as a pair of strings or nil. INFO is the
+export communication channel, as a property list."
+ (let ((has-variant-p
+ (lambda (variant type)
+ ;; Non-nil when style VARIANT has TYPE. TYPE is either
+ ;; `bare' or `caps'.
+ (member variant
+ (pcase type
+ ('bare '("bare" "bare-caps" "b" "bc"))
+ ('caps '("caps" "bare-caps" "c" "bc"))
+ (_ (error "Invalid variant type: %S" type)))))))
+ (pcase style
+ ;; "author" style.
+ (`(,(or "author" "a") . ,variant)
+ (let ((caps (member variant '("caps" "c"))))
+ (org-export-data
+ (mapconcat
+ (lambda (key)
+ (let ((author (org-cite-basic--get-field 'author key info)))
+ (if caps (capitalize author) author)))
+ (org-cite-get-references citation t)
+ org-cite-basic-author-year-separator)
+ info)))
+ ;; "noauthor" style.
+ (`(,(or "noauthor" "na") . ,variant)
+ (format (if (funcall has-variant-p variant 'bare) "%s" "(%s)")
+ (mapconcat (lambda (key) (org-cite-basic--get-year key info))
+ (org-cite-get-references citation t)
+ org-cite-basic-author-year-separator)))
+ ;; "nocite" style.
+ (`(,(or "nocite" "n") . ,_) nil)
+ ;; "text" and "note" styles.
+ (`(,(and (or "text" "note" "t" "ft") style) . ,variant)
+ (when (and (member style '("note" "ft"))
+ (not (org-cite-inside-footnote-p citation)))
+ (org-cite-adjust-note citation info)
+ (org-cite-wrap-citation citation info))
+ (let ((bare (funcall has-variant-p variant 'bare))
+ (caps (funcall has-variant-p variant 'caps)))
+ (org-cite-basic--format-author-year
+ citation
+ (lambda (p c s) (org-cite-concat p c s))
+ (lambda (p a y s)
+ (org-cite-concat p
+ (if caps (capitalize a) a)
+ (if bare " " " (")
+ y s
+ (and (not bare) ")")))
+ info)))
+ ;; "numeric" style.
+ ;;
+ ;; When using this style on citations with multiple references,
+ ;; use global affixes and ignore local ones.
+ (`(,(or "numeric" "nb") . ,_)
+ (pcase-let ((`(,prefix . ,suffix) (org-cite-main-affixes citation)))
+ (org-export-data
+ (org-cite-concat
+ "(" prefix (org-cite-basic--citation-numbers citation info) suffix ")")
+ info)))
+ ;; Default ("nil") style.
+ (`(,_ . ,variant)
+ (let ((bare (funcall has-variant-p variant 'bare))
+ (caps (funcall has-variant-p variant 'caps)))
+ (org-cite-basic--format-author-year
+ citation
+ (lambda (p c s)
+ (org-cite-concat (and (not bare) "(") p c s (and (not bare) ")")))
+ (lambda (p a y s)
+ (org-cite-concat p (if caps (capitalize a) a) ", " y s))
+ info)))
+ ;; This should not happen.
+ (_ (error "Invalid style: %S" style)))))
+
+(defun org-cite-basic-export-bibliography (keys _files style _props backend info)
+ "Generate bibliography.
+KEYS is the list of cited keys, as strings. STYLE is the expected bibliography
+style, as a string. BACKEND is the export back-end, as a symbol. INFO is the
+export state, as a property list."
+ (mapconcat
+ (lambda (k)
+ (let ((entry (org-cite-basic--get-entry k info)))
+ (org-export-data
+ (org-cite-make-paragraph
+ (and (org-export-derived-backend-p backend 'latex)
+ (org-export-raw-string "\\noindent\n"))
+ (org-cite-basic--print-entry entry style info))
+ info)))
+ (org-cite-basic--sort-keys keys info)
+ "\n"))
+
+
+;;; "Follow" capability
+(defun org-cite-basic-goto (datum _)
+ "Follow citation or citation reference DATUM.
+When DATUM is a citation reference, open bibliography entry referencing
+the citation key. Otherwise, select which key to follow among all keys
+present in the citation."
+ (let* ((key
+ (if (eq 'citation-reference (org-element-type datum))
+ (org-element-property :key datum)
+ (pcase (org-cite-get-references datum t)
+ (`(,key) key)
+ (keys
+ (or (completing-read "Select citation key: " keys nil t)
+ (user-error "Aborted"))))))
+ (file
+ (pcase (seq-find (pcase-lambda (`(,_ . ,entries))
+ (gethash key entries))
+ (org-cite-basic--parse-bibliography))
+ (`(,f . ,_) f)
+ (_ (user-error "Cannot find citation key: %S" key)))))
+ (org-open-file file '(4))
+ (pcase (file-name-extension file)
+ ("json"
+ ;; `rx' can not be used with Emacs <27.1 since `literal' form
+ ;; is not supported.
+ (let ((regexp (rx-to-string `(seq "\"id\":" (0+ (any "[ \t]")) "\"" ,key "\"") t)))
+ (goto-char (point-min))
+ (re-search-forward regexp)
+ (search-backward "{")))
+ (_
+ (bibtex-set-dialect)
+ (bibtex-search-entry key)))))
+
+
+;;; "Insert" capability
+(defun org-cite-basic--complete-style (_)
+ "Offer completion for style.
+Return chosen style as a string."
+ (let* ((styles
+ (mapcar (pcase-lambda (`((,style . ,_) . ,_))
+ style)
+ (org-cite-supported-styles))))
+ (pcase styles
+ (`(,style) style)
+ (_ (completing-read "Style (\"\" for default): " styles nil t)))))
+
+(defun org-cite-basic--key-completion-table ()
+ "Return completion table for cite keys, as a hash table.
+
+In this hash table, keys are a strings with author, date, and
+title of the reference. Values are the cite keys.
+
+Return nil if there are no bibliography files or no entries."
+ ;; Populate bibliography cache.
+ (let ((entries (org-cite-basic--parse-bibliography)))
+ (cond
+ ((null entries) nil) ;no bibliography files
+ ((gethash entries org-cite-basic--completion-cache)
+ org-cite-basic--completion-cache)
+ (t
+ (clrhash org-cite-basic--completion-cache)
+ (dolist (key (org-cite-basic--all-keys))
+ (let ((completion
+ (concat
+ (let ((author (org-cite-basic--get-field 'author key nil t)))
+ (if author
+ (truncate-string-to-width
+ (replace-regexp-in-string " and " "; " author)
+ org-cite-basic-author-column-end nil ?\s)
+ (make-string org-cite-basic-author-column-end ?\s)))
+ org-cite-basic-column-separator
+ (let ((date (org-cite-basic--get-year key nil 'no-suffix)))
+ (format "%4s" (or date "")))
+ org-cite-basic-column-separator
+ (org-cite-basic--get-field 'title key nil t))))
+ (puthash completion key org-cite-basic--completion-cache)))
+ (unless (map-empty-p org-cite-basic--completion-cache) ;no key
+ (puthash entries t org-cite-basic--completion-cache)
+ org-cite-basic--completion-cache)))))
+
+(defun org-cite-basic--complete-key (&optional multiple)
+ "Prompt for a reference key and return a citation reference string.
+
+When optional argument MULTIPLE is non-nil, prompt for multiple
+keys, until one of them is nil. Then return the list of
+reference strings selected.
+
+Raise an error when no bibliography is set in the buffer."
+ (let* ((table
+ (or (org-cite-basic--key-completion-table)
+ (user-error "No bibliography set")))
+ (prompt
+ (lambda (text)
+ (completing-read text table nil t))))
+ (if (null multiple)
+ (let ((key (gethash (funcall prompt "Key: ") table)))
+ (org-string-nw-p key))
+ (let* ((keys nil)
+ (build-prompt
+ (lambda ()
+ (if keys
+ (format "Key (empty input exits) %s: "
+ (mapconcat #'identity (reverse keys) ";"))
+ "Key (empty input exits): "))))
+ (let ((key (funcall prompt (funcall build-prompt))))
+ (while (org-string-nw-p key)
+ (push (gethash key table) keys)
+ (setq key (funcall prompt (funcall build-prompt)))))
+ keys))))
+
+
+;;; Register processor
+(org-cite-register-processor 'basic
+ :activate #'org-cite-basic-activate
+ :export-citation #'org-cite-basic-export-citation
+ :export-bibliography #'org-cite-basic-export-bibliography
+ :follow #'org-cite-basic-goto
+ :insert (org-cite-make-insert-processor #'org-cite-basic--complete-key
+ #'org-cite-basic--complete-style)
+ :cite-styles
+ '((("author" "a") ("caps" "c"))
+ (("noauthor" "na") ("bare" "b"))
+ (("nocite" "n"))
+ (("note" "ft") ("bare-caps" "bc") ("caps" "c"))
+ (("numeric" "nb"))
+ (("text" "t") ("bare-caps" "bc") ("caps" "c"))
+ (("nil") ("bare" "b") ("bare-caps" "bc") ("caps" "c"))))
+
+(provide 'oc-basic)
+;;; oc-basic.el ends here
diff --git a/elpa/org-9.5.2/oc-basic.elc b/elpa/org-9.5.2/oc-basic.elc
new file mode 100644
index 0000000..c792d5b
--- /dev/null
+++ b/elpa/org-9.5.2/oc-basic.elc
Binary files differ
diff --git a/elpa/org-9.5.2/oc-biblatex.el b/elpa/org-9.5.2/oc-biblatex.el
new file mode 100644
index 0000000..e985963
--- /dev/null
+++ b/elpa/org-9.5.2/oc-biblatex.el
@@ -0,0 +1,318 @@
+;;; oc-biblatex.el --- biblatex citation processor for Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library registers the `biblatex' citation processor, which provides
+;; the "export" capability for citations.
+
+;; The processor relies on "biblatex" LaTeX package. As such it ensures that
+;; the package is properly required in the document's preamble. More
+;; accurately, it will re-use any "\usepackage{biblatex}" already present in
+;; the document (e.g., through `org-latex-packages-alist'), or insert one using
+;; options defined in `org-cite-biblatex-options'.
+
+;; In any case, the library will override style-related options with those
+;; specified with the citation processor, in `org-cite-export-processors' or
+;; "cite_export" keyword. If you need to use different styles for bibliography
+;; and citations, you can separate them with "bibstyle/citestyle" syntax. E.g.,
+;;
+;; #+cite_export: biblatex authortitle/authortitle-ibid
+
+;; The library supports the following citation styles:
+;;
+;; - author (a), including caps (c), full (f) and caps-full (cf) variants,
+;; - locators (l), including bare (b), caps (c) and bare-caps (bc) variants,
+;; - noauthor (na),
+;; - nocite (n),
+;; - text (t), including caps (c) variant,
+;; - default style, including bare (b), caps (c) and bare-caps (bc) variants.
+
+;; When citation and style permit, the library automatically generates
+;; "multicite" versions of the commands above.
+
+;; Bibliography is printed using "\printbibliography" command. Additional
+;; options may be passed to it through a property list attached to the
+;; "print_bibliography" keyword. E.g.,
+;;
+;; #+print_bibliography: :section 2 :heading subbibliography
+;;
+;; Values including spaces must be surrounded with double quotes. If you need
+;; to use a key multiple times, you can separate its values with commas, but
+;; without any space in-between:
+;;
+;; #+print_bibliography: :keyword abc,xyz :title "Primary Sources"
+
+;;; Code:
+(require 'org-macs)
+(require 'oc)
+
+(declare-function org-element-property "org-element" (property element))
+(declare-function org-export-data "org-export" (data info))
+(declare-function org-export-get-next-element "org-export" (blob info &optional n))
+
+
+;;; Customization
+(defcustom org-cite-biblatex-options nil
+ "Options added to \"biblatex\" package.
+If \"biblatex\" package is already required in the document, e.g., through
+`org-latex-packages-alist' variable, these options are ignored."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type '(choice
+ (string :tag "Options (key=value,key2=value2...)")
+ (const :tag "No option" nil))
+ :safe #'string-or-null-p)
+
+
+;;; Internal functions
+(defun org-cite-biblatex--package-options (initial style)
+ "Return options string for \"biblatex\" package.
+
+INITIAL is an initial style of comma-separated options, as a string or nil.
+STYLE is the style definition as a string or nil.
+
+Return a string."
+ (let ((options-no-style
+ (and initial
+ (let ((re (rx string-start (or "bibstyle" "citestyle" "style"))))
+ (seq-filter
+ (lambda (option) (not (string-match re option)))
+ (split-string (org-unbracket-string "[" "]" initial)
+ "," t " \t")))))
+ (style-options
+ (cond
+ ((null style) nil)
+ ((not (string-match "/" style)) (list (concat "style=" style)))
+ (t
+ (list (concat "bibstyle=" (substring style nil (match-beginning 0)))
+ (concat "citestyle=" (substring style (match-end 0))))))))
+ (if (or options-no-style style-options)
+ (format "[%s]"
+ (mapconcat #'identity
+ (append options-no-style style-options)
+ ","))
+ "")))
+
+(defun org-cite-biblatex--multicite-p (citation)
+ "Non-nil when citation could make use of a \"multicite\" command."
+ (let ((references (org-cite-get-references citation)))
+ (and (< 1 (length references))
+ (seq-some (lambda (r)
+ (or (org-element-property :prefix r)
+ (org-element-property :suffix r)))
+ references))))
+
+(defun org-cite-biblatex--atomic-arguments (references info &optional no-opt)
+ "Build argument for the list of citation REFERENCES.
+When NO-OPT argument is non-nil, only provide mandatory arguments."
+ (let ((mandatory
+ (format "{%s}"
+ (mapconcat (lambda (r) (org-element-property :key r))
+ references
+ ","))))
+ (if no-opt mandatory
+ (let* ((origin (pcase references
+ (`(,reference) reference)
+ (`(,reference . ,_)
+ (org-element-property :parent reference))))
+ (suffix (org-element-property :suffix origin))
+ (prefix (org-element-property :prefix origin)))
+ (concat (and prefix
+ (format "[%s]" (org-trim (org-export-data prefix info))))
+ (cond
+ (suffix (format "[%s]"
+ (org-trim (org-export-data suffix info))))
+ (prefix "[]")
+ (t nil))
+ mandatory)))))
+
+(defun org-cite-biblatex--multi-arguments (citation info)
+ "Build \"multicite\" command arguments for CITATION object.
+INFO is the export state, as a property list."
+ (let ((global-prefix (org-element-property :prefix citation))
+ (global-suffix (org-element-property :suffix citation)))
+ (concat (and global-prefix
+ (format "(%s)"
+ (org-trim (org-export-data global-prefix info))))
+ (cond
+ ;; Global pre/post-notes.
+ (global-suffix
+ (format "(%s)"
+ (org-trim (org-export-data global-suffix info))))
+ (global-prefix "()")
+ (t nil))
+ ;; All arguments.
+ (mapconcat (lambda (r)
+ (org-cite-biblatex--atomic-arguments (list r) info))
+ (org-cite-get-references citation)
+ "")
+ ;; According to BibLaTeX manual, left braces or brackets
+ ;; following a multicite command could be parsed as other
+ ;; arguments. So we stop any further parsing by inserting
+ ;; a \relax unconditionally.
+ "\\relax")))
+
+(defun org-cite-biblatex--command (citation info base &optional multi no-opt)
+ "Return biblatex command using BASE name for CITATION object.
+
+INFO is the export state, as a property list.
+
+When optional argument MULTI is non-nil, generate a \"multicite\" command when
+appropriate. When optional argument NO-OPT is non-nil, do not add optional
+arguments to the command."
+ (format "\\%s%s"
+ base
+ (if (and multi (org-cite-biblatex--multicite-p citation))
+ (concat "s" (org-cite-biblatex--multi-arguments citation info))
+ (org-cite-biblatex--atomic-arguments
+ (org-cite-get-references citation) info no-opt))))
+
+
+;;; Export capability
+(defun org-cite-biblatex-export-bibliography (_keys _files _style props &rest _)
+ "Print references from bibliography.
+PROPS is the local properties of the bibliography, as a property list."
+ (concat "\\printbibliography"
+ (and props
+ (let ((key nil)
+ (results nil))
+ (dolist (datum props)
+ (cond
+ ((keywordp datum)
+ (when key (push key results))
+ (setq key (substring (symbol-name datum) 1)))
+ (t
+ ;; Comma-separated values are associated to the
+ ;; same keyword.
+ (push (mapconcat (lambda (v) (concat key "=" v))
+ (split-string datum "," t)
+ ",")
+ results)
+ (setq key nil))))
+ (format "[%s]"
+ (mapconcat #'identity (nreverse results) ","))))))
+
+(defun org-cite-biblatex-export-citation (citation style _ info)
+ "Export CITATION object.
+STYLE is the citation style, as a pair of either strings or nil.
+INFO is the export state, as a property list."
+ (apply
+ #'org-cite-biblatex--command citation info
+ (pcase style
+ ;; "author" style.
+ (`(,(or "author" "a") . ,variant)
+ (pcase variant
+ ((or "caps" "c") '("Citeauthor*"))
+ ((or "full" "f") '("citeauthor"))
+ ((or "caps-full" "cf") '("Citeauthor"))
+ (_ '("citeauthor*"))))
+ ;; "locators" style.
+ (`(,(or "locators" "l") . ,variant)
+ (pcase variant
+ ((or "bare" "b") '("notecite"))
+ ((or "caps" "c") '("Pnotecite"))
+ ((or "bare-caps" "bc") '("Notecite"))
+ (_ '("pnotecite"))))
+ ;; "noauthor" style.
+ (`(,(or "noauthor" "na") . ,_) '("autocite*"))
+ ;; "nocite" style.
+ (`(,(or "nocite" "n") . ,_) '("nocite" nil t))
+ ;; "text" style.
+ (`(,(or "text" "t") . ,variant)
+ (pcase variant
+ ((or "caps" "c") '("Textcite" t))
+ (_ '("textcite" t))))
+ ;; Default "nil" style.
+ (`(,_ . ,variant)
+ (pcase variant
+ ((or "bare" "b") '("cite" t))
+ ((or "caps" "c") '("Autocite" t))
+ ((or "bare-caps" "bc") '("Cite" t))
+ (_ '("autocite" t))))
+ ;; This should not happen.
+ (_ (error "Invalid style: %S" style)))))
+
+(defun org-cite-biblatex-prepare-preamble (output _keys files style &rest _)
+ "Prepare document preamble for \"biblatex\" usage.
+
+OUTPUT is the final output of the export process. FILES is the list of file
+names used as the bibliography.
+
+This function ensures \"biblatex\" package is required. It also adds resources
+to the document, and set styles."
+ (with-temp-buffer
+ (save-excursion (insert output))
+ (when (search-forward "\\begin{document}" nil t)
+ ;; Ensure there is a \usepackage{biblatex} somewhere or add one.
+ ;; Then set options.
+ (goto-char (match-beginning 0))
+ (let ((re (rx "\\usepackage"
+ (opt (group "[" (*? anything) "]"))
+ "{biblatex}")))
+ (cond
+ ;; No "biblatex" package loaded. Insert "usepackage" command
+ ;; with appropriate options, including style.
+ ((not (re-search-backward re nil t))
+ (save-excursion
+ (insert
+ (format "\\usepackage%s{biblatex}\n"
+ (org-cite-biblatex--package-options
+ org-cite-biblatex-options style)))))
+ ;; "biblatex" package loaded, but without any option.
+ ;; Include style only.
+ ((not (match-beginning 1))
+ (search-forward "{" nil t)
+ (insert (org-cite-biblatex--package-options nil style)))
+ ;; "biblatex" package loaded with some options set. Override
+ ;; style-related options with ours.
+ (t
+ (replace-match
+ (save-match-data
+ (org-cite-biblatex--package-options (match-string 1) style))
+ nil nil nil 1))))
+ ;; Insert resources below.
+ (forward-line)
+ (insert (mapconcat (lambda (f)
+ (format "\\addbibresource%s{%s}"
+ (if (org-url-p f) "[location=remote]" "")
+ f))
+ files
+ "\n")
+ "\n"))
+ (buffer-string)))
+
+
+;;; Register `biblatex' processor
+(org-cite-register-processor 'biblatex
+ :export-bibliography #'org-cite-biblatex-export-bibliography
+ :export-citation #'org-cite-biblatex-export-citation
+ :export-finalizer #'org-cite-biblatex-prepare-preamble
+ :cite-styles
+ '((("author" "a") ("caps" "c") ("full" "f") ("caps-full" "cf"))
+ (("locators" "l") ("bare" "b") ("caps" "c") ("bare-caps" "bc"))
+ (("noauthor" "na"))
+ (("nocite" "n"))
+ (("text" "t") ("caps" "c"))
+ (("nil") ("bare" "b") ("caps" "c") ("bare-caps" "bc"))))
+
+(provide 'oc-biblatex)
+;;; oc-biblatex.el ends here
diff --git a/elpa/org-9.5.2/oc-biblatex.elc b/elpa/org-9.5.2/oc-biblatex.elc
new file mode 100644
index 0000000..22e74bc
--- /dev/null
+++ b/elpa/org-9.5.2/oc-biblatex.elc
Binary files differ
diff --git a/elpa/org-9.5.2/oc-csl.el b/elpa/org-9.5.2/oc-csl.el
new file mode 100644
index 0000000..a92ea8a
--- /dev/null
+++ b/elpa/org-9.5.2/oc-csl.el
@@ -0,0 +1,631 @@
+;;; oc-csl.el --- csl citation processor for Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library registers the `csl' citation processor, which provides
+;; the "export" capability for citations.
+
+;; The processor relies on the external Citeproc Emacs library, which must be
+;; available prior to loading this library.
+
+;; By default, citations are rendered in Chicago author-date CSL style. You can
+;; use another style file by specifying it in `org-cite-export-processors' or
+;; from within the document by adding the file name to "cite_export" keyword
+;;
+;; #+cite_export: csl /path/to/style-file.csl
+;; #+cite_export: csl "/path/to/style-file.csl"
+;;
+;; With the variable `org-cite-csl-styles-dir' set appropriately, the
+;; above can even be shortened to
+;;
+;; #+cite_export: csl style-file.csl
+;;
+;; Styles can be downloaded, for instance, from the Zotero Style Repository
+;; (<https://www.zotero.org/styles>). Dependent styles (which are not "unique"
+;; in the Zotero Style Repository terminology) are not supported.
+
+;; The processor uses the "en-US" CSL locale file shipped with Org for rendering
+;; localized dates and terms in the references, independently of the language
+;; settings of the Org document. Additional CSL locales can be made available
+;; by setting `org-cite-csl-locales-dir' to a directory containing the locale
+;; files in question (see <https://github.com/citation-style-language/locales>
+;; for such files).
+
+;; Bibliography is defined with the "bibliography" keyword. It supports files
+;; with ".bib", ".bibtex", and ".json" extensions. References are exported using
+;; the "print_bibliography" keyword.
+
+;; The library supports the following citation styles:
+;;
+;; - author (a), including caps (c), full (f), and caps-full (cf) variants,
+;; - noauthor (na), including bare (b), caps (c) and bare-caps (bc) variants,
+;; - year (y), including a bare (b) variant,
+;; - text (t). including caps (c), full (f), and caps-full (cf) variants,
+;; - default style, including bare (b), caps (c) and bare-caps (bc) variants.
+
+;; CSL styles recognize "locator" in citation references' suffix. For example,
+;; in the citation
+;;
+;; [cite:see @Tarski-1965 chapter 1, for an example]
+;;
+;; "chapter 1" is the locator. The whole citation is rendered as
+;;
+;; (see Tarski 1965, chap. 1 for an example)
+;;
+;; in the default CSL style.
+;;
+;; The locator starts with a locator term, among "bk.", "bks.", "book", "chap.",
+;; "chaps.", "chapter", "col.", "cols.", "column", "figure", "fig.", "figs.",
+;; "folio", "fol.", "fols.", "number", "no.", "nos.", "line", "l.", "ll.",
+;; "note", "n.", "nn.", "opus", "op.", "opp.", "page", "p.", "pp.", "paragraph",
+;; "para.", "paras.", "¶", "¶¶", "§", "§§", "part", "pt.", "pts.", "section",
+;; "sec.", "secs.", "sub verbo", "s.v.", "s.vv.", "verse", "v.", "vv.",
+;; "volume", "vol.", and "vols.". It ends with the last comma or digit in the
+;; suffix, whichever comes last, or runs till the end of the suffix.
+;;
+;; The part of the suffix before the locator is appended to reference's prefix.
+;; If no locator term is used, but a number is present, then "page" is assumed.
+
+;; This library was heavily inspired by and borrows from András Simonyi's
+;; Citeproc Org (<https://github.com/andras-simonyi/citeproc-org>) library.
+;; Many thanks to him!
+
+;;; Code:
+(require 'bibtex)
+(require 'json)
+(require 'oc)
+
+(require 'citeproc nil t)
+(declare-function citeproc-style-cite-note "ext:citeproc")
+(declare-function citeproc-proc-style "ext:citeproc")
+(declare-function citeproc-bt-entry-to-csl "ext:citeproc")
+(declare-function citeproc-locale-getter-from-dir "ext:citeproc")
+(declare-function citeproc-create "ext:citeproc")
+(declare-function citeproc-citation-create "ext:citeproc")
+(declare-function citeproc-append-citations "ext:citeproc")
+(declare-function citeproc-render-citations "ext:citeproc")
+(declare-function citeproc-render-bib "ext:citeproc")
+(declare-function citeproc-hash-itemgetter-from-any "ext:citeproc")
+
+(declare-function org-element-interpret-data "org-element" (data))
+(declare-function org-element-map "org-element" (data types fun &optional info first-match no-recursion with-affiliated))
+(declare-function org-element-property "org-element" (property element))
+(declare-function org-element-put-property "org-element" (element property value))
+
+(declare-function org-export-data "org-export" (data info))
+(declare-function org-export-derived-backend-p "org-export" (backend &rest backends))
+(declare-function org-export-get-footnote-number "org-export" (footnote info &optional data body-first))
+
+
+;;; Customization
+
+;;;; Location of CSL directories
+(defcustom org-cite-csl-locales-dir nil
+ "Directory of CSL locale files.
+If nil then only the fallback en-US locale will be available."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type '(choice
+ (directory :tag "Locales directory")
+ (const :tag "Use en-US locale only" nil))
+ ;; It's not obvious to me that arbitrary locations are safe.
+;;; :safe #'string-or-null-p
+ )
+
+(defcustom org-cite-csl-styles-dir nil
+ "Directory of CSL style files.
+When non-nil, relative style file names are expanded relatively to this
+directory. This variable is ignored when style file is absolute."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type '(choice
+ (directory :tag "Styles directory")
+ (const :tag "Use absolute file names" nil))
+ ;; It's not obvious to me that arbitrary locations are safe.
+;;; :safe #'string-or-null-p
+ )
+
+;;;; Citelinks
+(defcustom org-cite-csl-link-cites t
+ "When non-nil, link cites to references."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-cite-csl-no-citelinks-backends '(ascii)
+ "List of export back-ends for which cite linking is disabled.
+Cite linking for export back-ends derived from any of the back-ends listed here,
+is also disabled."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type '(repeat symbol))
+
+;;;; Output-specific variables
+(defcustom org-cite-csl-html-hanging-indent "1.5em"
+ "Size of hanging-indent for HTML output in valid CSS units."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type 'string
+ :safe #'stringp)
+
+(defcustom org-cite-csl-html-label-width-per-char "0.6em"
+ "Character width in CSS units for calculating entry label widths.
+Used only when `second-field-align' is activated by the used CSL style."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type 'string
+ :safe #'stringp)
+
+(defcustom org-cite-csl-latex-hanging-indent "1.5em"
+ "Size of hanging-indent for LaTeX output in valid LaTeX units."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type 'string
+ :safe #'stringp)
+
+
+;;; Internal variables
+(defconst org-cite-csl--etc-dir
+ (let ((oc-root (file-name-directory (locate-library "oc"))))
+ (cond
+ ;; First check whether it looks like we're running from the main
+ ;; Org repository.
+ ((let ((csl-org (expand-file-name "../etc/csl/" oc-root)))
+ (and (file-directory-p csl-org) csl-org)))
+ ;; Next look for the directory alongside oc.el because package.el
+ ;; and straight will put all of org-mode/lisp/ in org-mode/.
+ ((let ((csl-pkg (expand-file-name "etc/csl/" oc-root)))
+ (and (file-directory-p csl-pkg) csl-pkg)))
+ ;; Finally fall back the location used by shared system installs
+ ;; and when running directly from Emacs repository.
+ (t
+ (expand-file-name "org/csl/" data-directory))))
+ "Directory containing CSL-related data files.")
+
+(defconst org-cite-csl--fallback-locales-dir org-cite-csl--etc-dir
+ "Fallback CSL locale files directory.")
+
+(defconst org-cite-csl--fallback-style-file
+ (expand-file-name "chicago-author-date.csl"
+ org-cite-csl--etc-dir)
+ "Default CSL style file, or nil.
+If nil then the Chicago author-date style is used as a fallback.")
+
+(defconst org-cite-csl--label-alist
+ '(("bk." . "book")
+ ("bks." . "book")
+ ("book" . "book")
+ ("chap." . "chapter")
+ ("chaps." . "chapter")
+ ("chapter" . "chapter")
+ ("col." . "column")
+ ("cols." . "column")
+ ("column" . "column")
+ ("figure" . "figure")
+ ("fig." . "figure")
+ ("figs." . "figure")
+ ("folio" . "folio")
+ ("fol." . "folio")
+ ("fols." . "folio")
+ ("number" . "number")
+ ("no." . "number")
+ ("nos." . "number")
+ ("line" . "line")
+ ("l." . "line")
+ ("ll." . "line")
+ ("note" . "note")
+ ("n." . "note")
+ ("nn." . "note")
+ ("opus" . "opus")
+ ("op." . "opus")
+ ("opp." . "opus")
+ ("page" . "page")
+ ("p" . "page")
+ ("p." . "page")
+ ("pp." . "page")
+ ("paragraph" . "paragraph")
+ ("para." . "paragraph")
+ ("paras." . "paragraph")
+ ("¶" . "paragraph")
+ ("¶¶" . "paragraph")
+ ("part" . "part")
+ ("pt." . "part")
+ ("pts." . "part")
+ ("§" . "section")
+ ("§§" . "section")
+ ("section" . "section")
+ ("sec." . "section")
+ ("secs." . "section")
+ ("sub verbo" . "sub verbo")
+ ("s.v." . "sub verbo")
+ ("s.vv." . "sub verbo")
+ ("verse" . "verse")
+ ("v." . "verse")
+ ("vv." . "verse")
+ ("volume" . "volume")
+ ("vol." . "volume")
+ ("vols." . "volume"))
+ "Alist mapping locator names to locators.")
+
+(defconst org-cite-csl--label-regexp
+ ;; Prior to Emacs-27.1 argument of `regexp' form must be a string literal.
+ ;; It is the reason why `rx' is avoided here.
+ (rx-to-string
+ `(seq (or line-start space)
+ (regexp ,(regexp-opt (mapcar #'car org-cite-csl--label-alist) t))
+ (0+ digit)
+ (or word-end line-end space " "))
+ t)
+ "Regexp matching a label in a citation reference suffix.
+Label is in match group 1.")
+
+
+;;; Internal functions
+(defun org-cite-csl--barf-without-citeproc ()
+ "Raise an error if Citeproc library is not loaded."
+ (unless (featurep 'citeproc)
+ (error "Citeproc library is not loaded")))
+
+(defun org-cite-csl--note-style-p (info)
+ "Non-nil when bibliography style implies wrapping citations in footnotes.
+INFO is the export state, as a property list."
+ (citeproc-style-cite-note
+ (citeproc-proc-style
+ (org-cite-csl--processor info))))
+
+(defun org-cite-csl--create-structure-params (citation info)
+ "Return citeproc structure creation params for CITATION object.
+STYLE is the citation style, as a string or nil. INFO is the export state, as
+a property list."
+ (let ((style (org-cite-citation-style citation info)))
+ (pcase style
+ ;; "author" style.
+ (`(,(or "author" "a") . ,variant)
+ (pcase variant
+ ((or "caps" "c") '(:mode author-only :capitalize-first t))
+ ((or "full" "f") '(:mode author-only :ignore-et-al t))
+ ((or "caps-full" "cf") '(:mode author-only :capitalize-first t :ignore-et-al t))
+ (_ '(:mode author-only))))
+ ;; "noauthor" style.
+ (`(,(or "noauthor" "na") . ,variant)
+ (pcase variant
+ ((or "bare" "b") '(:mode suppress-author :suppress-affixes t))
+ ((or "caps" "c") '(:mode suppress-author :capitalize-first t))
+ ((or "bare-caps" "bc")
+ '(:mode suppress-author :suppress-affixes t :capitalize-first t))
+ (_ '(:mode suppress-author))))
+ ;; "year" style.
+ (`(,(or "year" "y") . ,variant)
+ (pcase variant
+ ((or "bare" "b") '(:mode year-only :suppress-affixes t))
+ (_ '(:mode year-only))))
+ ;; "text" style.
+ (`(,(or "text" "t") . ,variant)
+ (pcase variant
+ ((or "caps" "c") '(:mode textual :capitalize-first t))
+ ((or "full" "f") '(:mode textual :ignore-et-al t))
+ ((or "caps-full" "cf") '(:mode textual :ignore-et-al t :capitalize-first t))
+ (_ '(:mode textual))))
+ ;; Default "nil" style.
+ (`(,_ . ,variant)
+ (pcase variant
+ ((or "caps" "c") '(:capitalize-first t))
+ ((or "bare" "b") '(:suppress-affixes t))
+ ((or "bare-caps" "bc") '(:suppress-affixes t :capitalize-first t))
+ (_ nil)))
+ ;; This should not happen.
+ (_ (error "Invalid style: %S" style)))))
+
+(defun org-cite-csl--no-citelinks-p (info)
+ "Non-nil when export BACKEND should not create cite-reference links."
+ (or (not org-cite-csl-link-cites)
+ (and org-cite-csl-no-citelinks-backends
+ (apply #'org-export-derived-backend-p
+ (plist-get info :back-end)
+ org-cite-csl-no-citelinks-backends))
+ ;; No references are being exported anyway.
+ (not (org-element-map (plist-get info :parse-tree) 'keyword
+ (lambda (k)
+ (equal "PRINT_BIBLIOGRAPHY" (org-element-property :key k)))
+ info t))))
+
+(defun org-cite-csl--output-format (info)
+ "Return expected Citeproc's output format.
+INFO is the export state, as a property list. The return value is a symbol
+corresponding to one of the output formats supported by Citeproc: `html',
+`latex', or `org'."
+ (let ((backend (plist-get info :back-end)))
+ (cond
+ ((org-export-derived-backend-p backend 'html) 'html)
+ ((org-export-derived-backend-p backend 'latex) 'latex)
+ (t 'org))))
+
+(defun org-cite-csl--style-file (info)
+ "Return style file associated to current export process.
+
+INFO is the export state, as a property list.
+
+When file name is relative, expand it according to `org-cite-csl-styles-dir',
+or raise an error if the variable is unset."
+ (pcase (org-cite-bibliography-style info)
+ ('nil org-cite-csl--fallback-style-file)
+ ((and (pred file-name-absolute-p) file) file)
+ ((and (guard org-cite-csl-styles-dir) file)
+ (expand-file-name file org-cite-csl-styles-dir))
+ (other
+ (user-error "Cannot handle relative style file name: %S" other))))
+
+(defun org-cite-csl--locale-getter ()
+ "Return a locale getter.
+The getter looks for locales in `org-cite-csl-locales-dir' directory. If it
+cannot find them, it retrieves the default \"en_US\" from
+`org-cite-csl--fallback-locales-dir'."
+ (lambda (loc)
+ (or (and org-cite-csl-locales-dir
+ (ignore-errors
+ (funcall (citeproc-locale-getter-from-dir org-cite-csl-locales-dir)
+ loc)))
+ (funcall (citeproc-locale-getter-from-dir
+ org-cite-csl--fallback-locales-dir)
+ loc))))
+
+(defun org-cite-csl--processor (info)
+ "Return Citeproc processor reading items from current bibliography.
+
+INFO is the export state, as a property list.
+
+Newly created processor is stored as the value of the `:cite-citeproc-processor'
+property in INFO."
+ (or (plist-get info :cite-citeproc-processor)
+ (let* ((bibliography (plist-get info :bibliography))
+ (locale (or (plist-get info :language) "en_US"))
+ (processor
+ (citeproc-create
+ (org-cite-csl--style-file info)
+ (citeproc-hash-itemgetter-from-any bibliography)
+ (org-cite-csl--locale-getter)
+ locale)))
+ (plist-put info :cite-citeproc-processor processor)
+ processor)))
+
+(defun org-cite-csl--parse-reference (reference info)
+ "Return Citeproc's structure associated to citation REFERENCE.
+
+INFO is the export state, as a property list.
+
+The result is a association list. Keys are: `id', `prefix',`suffix',
+`location', `locator' and `label'."
+ (let (label location-start locator-start location locator prefix suffix)
+ ;; Parse suffix. Insert it in a temporary buffer to find
+ ;; different parts: pre-label, label, locator, location (label +
+ ;; locator), and suffix.
+ (with-temp-buffer
+ (save-excursion
+ (insert (org-element-interpret-data
+ (org-element-property :suffix reference))))
+ (cond
+ ((re-search-forward org-cite-csl--label-regexp nil t)
+ (setq location-start (match-beginning 0))
+ (setq label (cdr (assoc (match-string 1) org-cite-csl--label-alist)))
+ (goto-char (match-end 1))
+ (skip-chars-forward "[:space:] ")
+ (setq locator-start (point)))
+ ((re-search-forward (rx digit) nil t)
+ (setq location-start (match-beginning 0))
+ (setq label "page")
+ (setq locator-start location-start))
+ (t
+ (setq suffix (org-element-property :suffix reference))))
+ ;; Find locator's end, and suffix, if any. To that effect, look
+ ;; for the last comma or digit after label, whichever comes
+ ;; last.
+ (unless suffix
+ (goto-char (point-max))
+ (let ((re (rx (or "," (group digit)))))
+ (when (re-search-backward re location-start t)
+ (goto-char (or (match-end 1) (match-beginning 0)))
+ (setq location (buffer-substring location-start (point)))
+ (setq locator (org-trim (buffer-substring locator-start (point))))
+ ;; Skip comma in suffix.
+ (setq suffix
+ (org-cite-parse-objects
+ (buffer-substring (match-end 0) (point-max))
+ t)))))
+ (setq prefix
+ (org-cite-concat
+ (org-element-property :prefix reference)
+ (and location-start
+ (org-cite-parse-objects
+ (buffer-substring 1 location-start)
+ t)))))
+ ;; Return value.
+ (let ((export
+ (lambda (data)
+ (org-string-nw-p
+ (org-trim
+ ;; When Citeproc exports to Org syntax, avoid mix and
+ ;; matching output formats by also generating Org
+ ;; syntax for prefix and suffix.
+ (if (eq 'org (org-cite-csl--output-format info))
+ (org-element-interpret-data data)
+ (org-export-data data info)))))))
+ `((id . ,(org-element-property :key reference))
+ (prefix . ,(funcall export prefix))
+ (suffix . ,(funcall export suffix))
+ (locator . ,locator)
+ (label . ,label)
+ (location . ,location)))))
+
+(defun org-cite-csl--create-structure (citation info)
+ "Create Citeproc structure for CITATION object.
+INFO is the export state, as a property list."
+ (let* ((cites (mapcar (lambda (r)
+ (org-cite-csl--parse-reference r info))
+ (org-cite-get-references citation)))
+ (footnote (org-cite-inside-footnote-p citation)))
+ ;; Global prefix is inserted in front of the prefix of the first
+ ;; reference.
+ (let ((global-prefix (org-element-property :prefix citation)))
+ (when global-prefix
+ (let* ((first (car cites))
+ (prefix-item (assq 'prefix first)))
+ (setcdr prefix-item
+ (concat (org-element-interpret-data global-prefix)
+ " "
+ (cdr prefix-item))))))
+ ;; Global suffix is appended to the suffix of the last reference.
+ (let ((global-suffix (org-element-property :suffix citation)))
+ (when global-suffix
+ (let* ((last (org-last cites))
+ (suffix-item (assq 'suffix last)))
+ (setcdr suffix-item
+ (concat (cdr suffix-item)
+ " "
+ (org-element-interpret-data global-suffix))))))
+ ;; Check if CITATION needs wrapping, i.e., it should be wrapped in
+ ;; a footnote, but isn't yet.
+ (when (and (not footnote) (org-cite-csl--note-style-p info))
+ (org-cite-adjust-note citation info)
+ (setq footnote (org-cite-wrap-citation citation info)))
+ ;; Return structure.
+ (apply #'citeproc-citation-create
+ `(:note-index
+ ,(and footnote (org-export-get-footnote-number footnote info))
+ :cites ,cites
+ ,@(org-cite-csl--create-structure-params citation info)))))
+
+(defun org-cite-csl--rendered-citations (info)
+ "Return the rendered citations as an association list.
+
+INFO is the export state, as a property list.
+
+Return an alist (CITATION . OUTPUT) where CITATION object has been rendered as
+OUTPUT using Citeproc."
+ (or (plist-get info :cite-citeproc-rendered-citations)
+ (let* ((citations (org-cite-list-citations info))
+ (processor (org-cite-csl--processor info))
+ (structures
+ (mapcar (lambda (c) (org-cite-csl--create-structure c info))
+ citations)))
+ (citeproc-append-citations structures processor)
+ (let* ((rendered
+ (citeproc-render-citations
+ processor
+ (org-cite-csl--output-format info)
+ (org-cite-csl--no-citelinks-p info)))
+ (result (seq-mapn #'cons citations rendered)))
+ (plist-put info :cite-citeproc-rendered-citations result)
+ result))))
+
+
+;;; Export capability
+(defun org-cite-csl-render-citation (citation _style _backend info)
+ "Export CITATION object.
+INFO is the export state, as a property list."
+ (org-cite-csl--barf-without-citeproc)
+ (let ((output (cdr (assq citation (org-cite-csl--rendered-citations info)))))
+ (if (not (eq 'org (org-cite-csl--output-format info)))
+ output
+ ;; Parse Org output to re-export it during the regular export
+ ;; process.
+ (org-cite-parse-objects output))))
+
+(defun org-cite-csl-render-bibliography (_keys _files _style _props _backend info)
+ "Export bibliography.
+INFO is the export state, as a property list."
+ (org-cite-csl--barf-without-citeproc)
+ (pcase-let* ((format (org-cite-csl--output-format info))
+ (`(,output . ,parameters)
+ (citeproc-render-bib
+ (org-cite-csl--processor info)
+ format
+ (org-cite-csl--no-citelinks-p info))))
+ (pcase format
+ ('html
+ (concat
+ (and (cdr (assq 'second-field-align parameters))
+ (let* ((max-offset (cdr (assq 'max-offset parameters)))
+ (char-width
+ (string-to-number org-cite-csl-html-label-width-per-char))
+ (char-width-unit
+ (progn
+ (string-match (number-to-string char-width)
+ org-cite-csl-html-label-width-per-char)
+ (substring org-cite-csl-html-label-width-per-char
+ (match-end 0)))))
+ (format
+ "<style>.csl-left-margin{float: left; padding-right: 0em;}
+ .csl-right-inline{margin: 0 0 0 %d%s;}</style>"
+ (* max-offset char-width)
+ char-width-unit)))
+ (and (cdr (assq 'hanging-indent parameters))
+ (format
+ "<style>.csl-entry{text-indent: -%s; margin-left: %s;}</style>"
+ org-cite-csl-html-hanging-indent
+ org-cite-csl-html-hanging-indent))
+ output))
+ ('latex
+ (if (cdr (assq 'hanging-indent parameters))
+ (format "\\begin{hangparas}{%s}{1}\n%s\n\\end{hangparas}"
+ org-cite-csl-latex-hanging-indent
+ output)
+ output))
+ (_
+ ;; Parse Org output to re-export it during the regular export
+ ;; process.
+ (org-cite-parse-elements output)))))
+
+(defun org-cite-csl-finalizer (output _keys _files _style _backend info)
+ "Add \"hanging\" package if missing from LaTeX output.
+OUTPUT is the export document, as a string. INFO is the export state, as a
+property list."
+ (org-cite-csl--barf-without-citeproc)
+ (if (not (eq 'latex (org-cite-csl--output-format info)))
+ output
+ (with-temp-buffer
+ (save-excursion (insert output))
+ (when (search-forward "\\begin{document}" nil t)
+ (goto-char (match-beginning 0))
+ ;; Ensure that \citeprocitem is defined for citeproc-el.
+ (insert "\\makeatletter\n\\newcommand{\\citeprocitem}[2]{\\hyper@linkstart{cite}{citeproc_bib_item_#1}#2\\hyper@linkend}\n\\makeatother\n\n")
+ ;; Ensure there is a \usepackage{hanging} somewhere or add one.
+ (let ((re (rx "\\usepackage" (opt "[" (*? nonl) "]") "{hanging}")))
+ (unless (re-search-backward re nil t)
+ (insert "\\usepackage[notquote]{hanging}\n"))))
+ (buffer-string))))
+
+
+;;; Register `csl' processor
+(org-cite-register-processor 'csl
+ :export-citation #'org-cite-csl-render-citation
+ :export-bibliography #'org-cite-csl-render-bibliography
+ :export-finalizer #'org-cite-csl-finalizer
+ :cite-styles
+ '((("author" "a") ("full" "f") ("caps" "c") ("caps-full" "cf"))
+ (("noauthor" "na") ("bare" "b") ("caps" "c") ("bare-caps" "bc"))
+ (("year" "y") ("bare" "b"))
+ (("text" "t") ("caps" "c") ("full" "f") ("caps-full" "cf"))
+ (("nil") ("bare" "b") ("caps" "c") ("bare-caps" "bc"))))
+
+(provide 'oc-csl)
+;;; oc-csl.el ends here
diff --git a/elpa/org-9.5.2/oc-csl.elc b/elpa/org-9.5.2/oc-csl.elc
new file mode 100644
index 0000000..b794445
--- /dev/null
+++ b/elpa/org-9.5.2/oc-csl.elc
Binary files differ
diff --git a/elpa/org-9.5.2/oc-natbib.el b/elpa/org-9.5.2/oc-natbib.el
new file mode 100644
index 0000000..bf086f3
--- /dev/null
+++ b/elpa/org-9.5.2/oc-natbib.el
@@ -0,0 +1,193 @@
+;;; oc-natbib.el --- Citation processor using natbib LaTeX package -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library registers the `natbib' citation processor, which provides the
+;; "export" capability for citations.
+
+;; The processor relies on "natbib" LaTeX package. As such it ensures that the
+;; package is properly required in the document's preamble. More accurately, it
+;; will use any "\\usepackage{natbib}" command already present in the document
+;; (e.g., through `org-latex-packages-alist'), or insert one using options
+;; defined in `org-cite-natbib-options'.
+
+;; It supports the following citation styles:
+;;
+;; - author (a), including caps (c), and full (f) variants,
+;; - noauthor (na), including bare (b) variant,
+;; - text (t), including bare (b), caps (c), full (f), bare-caps (bc),
+;; bare-full (bf), caps-full (cf), and bare-caps-full (bcf) variants,
+;; - default, including bare (b), caps (c), full (f), bare-caps (bc),
+;; bare-full (bf), caps-full (cf), and bare-caps-full (bcf) variants.
+
+;; Bibliography accepts any style supported by "natbib" package.
+
+;;; Code:
+(require 'oc)
+
+(declare-function org-element-property "org-element" (property element))
+
+(declare-function org-export-data "org-export" (data info))
+
+
+;;; Customization
+(defcustom org-cite-natbib-options nil
+ "List of options added to \"natbib\" package.
+If \"natbib\" package is already required in the document, e.g., through
+`org-latex-packages-alist' variable, these options are ignored."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type
+ '(set
+ (const :tag "use round parentheses (default)" round)
+ (const :tag "use square brackets" square)
+ (const :tag "use curly braces" curly)
+ (const :tag "use angle brackets" angle)
+ (const :tag "separate multiple citations with colons (default)" colon)
+ (const :tag "separate multiple citations with comas" comma)
+ (const :tag "generate author-year citations" authoryear)
+ (const :tag "generate numerical citations" numbers)
+ (const :tag "generate superscripted numerical citations" super)
+ (const :tag "order multiple citations according to the list of references" sort)
+ (const :tag "order as above, but numerical citations are compressed if possible" sort&compress)
+ (const :tag "display full author list on first citation, abbreviate the others" longnamesfirst)
+ (const :tag "redefine \\thebibliography to issue \\section* instead of \\chapter*" sectionbib)
+ (const :tag "keep all the authors' names in a citation on one line" nonamebreak)))
+
+
+;;; Internal functions
+(defun org-cite-natbib--style-to-command (style)
+ "Return command name to use according to STYLE pair."
+ (pcase style
+ ;; "author" style.
+ (`(,(or "author" "a") . ,variant)
+ (pcase variant
+ ((or "caps" "c") "\\Citeauthor")
+ ((or "full" "f") "\\citeauthor*")
+ (_ "\\citeauthor")))
+ ;; "noauthor" style.
+ (`(,(or "noauthor" "na") . ,variant)
+ (pcase variant
+ ((or "bare" "b") "\\citeyear")
+ (_ "\\citeyearpar")))
+ ;; "nocite" style.
+ (`(,(or "nocite" "n") . ,_) "\\nocite")
+ ;; "text" style.
+ (`(,(or "text" "t") . ,variant)
+ (pcase variant
+ ((or "bare" "b") "\\citealt")
+ ((or "caps" "c") "\\Citet")
+ ((or "full" "f") "\\citet*")
+ ((or "bare-caps" "bc") "\\Citealt")
+ ((or "bare-full" "bf") "\\citealt*")
+ ((or "caps-full" "cf") "\\Citet*")
+ ((or "bare-caps-full" "bcf") "\\Citealt*")
+ (_ "\\citet")))
+ ;; Default ("nil") style.
+ (`(,_ . ,variant)
+ (pcase variant
+ ((or "bare" "b") "\\citealp")
+ ((or "caps" "c") "\\Citep")
+ ((or "full" "f") "\\citep*")
+ ((or "bare-caps" "bc") "\\Citealp")
+ ((or "bare-full" "bf") "\\citealp*")
+ ((or "caps-full" "cf") "\\Citep*")
+ ((or "bare-caps-full" "bcf") "\\Citealp*")
+ (_ "\\citep")))
+ ;; This should not happen.
+ (_ (error "Invalid style: %S" style))))
+
+(defun org-cite-natbib--build-optional-arguments (citation info)
+ "Build optional arguments for citation command.
+CITATION is the citation object. INFO is the export state, as a property list."
+ (pcase-let ((`(,prefix . ,suffix) (org-cite-main-affixes citation)))
+ (concat (and prefix (format "[%s]" (org-trim (org-export-data prefix info))))
+ (cond
+ (suffix (format "[%s]" (org-trim (org-export-data suffix info))))
+ (prefix "[]")
+ (t nil)))))
+
+(defun org-cite-natbib--build-arguments (citation)
+ "Build arguments for citation command for CITATION object."
+ (format "{%s}"
+ (mapconcat #'identity
+ (org-cite-get-references citation t)
+ ",")))
+
+
+;;; Export capability
+(defun org-cite-natbib-export-bibliography (_keys files style &rest _)
+ "Print references from bibliography FILES.
+FILES is a list of absolute file names. STYLE is the bibliography style, as
+a string or nil."
+ (concat (and style (format "\\bibliographystyle{%s}\n" style))
+ (format "\\bibliography{%s}"
+ (mapconcat #'file-name-sans-extension
+ files
+ ","))))
+
+(defun org-cite-natbib-export-citation (citation style _ info)
+ "Export CITATION object.
+STYLE is the citation style, as a pair of strings or nil. INFO is the export
+state, as a property list."
+ (concat (org-cite-natbib--style-to-command style)
+ (org-cite-natbib--build-optional-arguments citation info)
+ (org-cite-natbib--build-arguments citation)))
+
+(defun org-cite-natbib-use-package (output &rest _)
+ "Ensure output requires \"natbib\" package.
+OUTPUT is the final output of the export process."
+ (with-temp-buffer
+ (save-excursion (insert output))
+ (when (search-forward "\\begin{document}" nil t)
+ ;; Ensure there is a \usepackage{natbib} somewhere or add one.
+ (goto-char (match-beginning 0))
+ (let ((re (rx "\\usepackage" (opt "[" (*? nonl) "]") "{natbib}")))
+ (unless (re-search-backward re nil t)
+ (insert
+ (format "\\usepackage%s{natbib}\n"
+ (if (null org-cite-natbib-options)
+ ""
+ (format "[%s]"
+ (mapconcat #'symbol-name
+ org-cite-natbib-options
+ ","))))))))
+ (buffer-string)))
+
+
+;;; Register `natbib' processor
+(org-cite-register-processor 'natbib
+ :export-bibliography #'org-cite-natbib-export-bibliography
+ :export-citation #'org-cite-natbib-export-citation
+ :export-finalizer #'org-cite-natbib-use-package
+ :cite-styles
+ '((("author" "a") ("caps" "a") ("full" "f"))
+ (("noauthor" "na") ("bare" "b"))
+ (("text" "t")
+ ("bare" "b") ("caps" "c") ("full" "f") ("bare-caps" "bc")
+ ("bare-full" "bf") ("caps-full" "cf") ("bare-caps-full" "bcf"))
+ (("nil")
+ ("bare" "b") ("caps" "c") ("full" "f") ("bare-caps" "bc")
+ ("bare-full" "bf") ("caps-full" "cf") ("bare-caps-full" "bcf"))))
+
+(provide 'oc-natbib)
+;;; oc-natbib.el ends here
diff --git a/elpa/org-9.5.2/oc-natbib.elc b/elpa/org-9.5.2/oc-natbib.elc
new file mode 100644
index 0000000..8f465ff
--- /dev/null
+++ b/elpa/org-9.5.2/oc-natbib.elc
Binary files differ
diff --git a/elpa/org-9.5.2/oc.el b/elpa/org-9.5.2/oc.el
new file mode 100644
index 0000000..a77daa7
--- /dev/null
+++ b/elpa/org-9.5.2/oc.el
@@ -0,0 +1,1650 @@
+;;; oc.el --- Org Cite library -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library provides tooling to handle citations in Org, e.g,
+;; activate, follow, insert, and export them, respectively called
+;; "activate", "follow", "insert" and "export" capabilities.
+;; Libraries responsible for providing some, or all, of these
+;; capabilities are called "citation processors".
+
+;; Such processors are defined using `org-cite-register-processor'.
+;; Using this function, it is possible, in addition to giving it a
+;; name, to attach functions associated to capabilities. As such, a
+;; processor handling citation export must set the `:export-citation'
+;; property to an appropriate function. Likewise, "activate"
+;; capability requires an appropriate `:activate' property, "insert"
+;; requires `:insert' property and, unsurprisingly, "follow"
+;; capability implies `:follow' property.
+
+;; As a user, the first thing to do is setting a bibliography, either
+;; globally with `org-cite-global-bibliography', or locally using one
+;; or more "bibliography" keywords. Then one can select any
+;; registered processor for each capability by providing a processor
+;; name to the variables `org-cite-activate-processor' and
+;; `org-cite-follow-processor'.
+
+;; The "export" capability is slightly more involved as one need to
+;; select the processor providing it, but may also provide a default
+;; style for citations and bibliography. Also, the choice of an
+;; export processor may depend of the current export back-end. The
+;; association between export back-ends and triplets of parameters can
+;; be set in `org-cite-export-processors' variable, or in a document,
+;; through the "cite_export" keyword.
+
+;; Eventually, this library provides some tools, mainly targeted at
+;; processor implementors. Most are export-specific and are located
+;; in the "Tools only available during export" and "Tools generating
+;; or operating on parsed data" sections.
+
+;; The few others can be used directly from an Org buffer, or operate
+;; on processors. See "Generic tools" section.
+
+;;; Code:
+
+(require 'org-compat)
+(require 'org-macs)
+(require 'seq)
+
+(declare-function org-at-heading-p "org" (&optional _))
+(declare-function org-collect-keywords "org" (keywords &optional unique directory))
+
+(declare-function org-element-adopt-elements "org-element" (parent &rest children))
+(declare-function org-element-citation-parser "org-element" ())
+(declare-function org-element-citation-reference-parser "org-element" ())
+(declare-function org-element-class "org-element" (datum &optional parent))
+(declare-function org-element-contents "org-element" (element))
+(declare-function org-element-create "org-element" (type &optional props &rest children))
+(declare-function org-element-extract-element "org-element" (element))
+(declare-function org-element-insert-before "org-element" (element location))
+(declare-function org-element-lineage "org-element" (datum &optional types with-self))
+(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-secondary-string "org-element" (string restriction &optional parent))
+(declare-function org-element-context "org-element" (&optional element))
+(declare-function org-element-property "org-element" (property element))
+(declare-function org-element-put-property "org-element" (element property value))
+(declare-function org-element-restriction "org-element" (element))
+(declare-function org-element-set-element "org-element" (old new))
+(declare-function org-element-type "org-element" (element))
+
+(declare-function org-export-derived-backend-p "org-export" (backend &rest backends))
+(declare-function org-export-get-next-element "org-export" (blob info &optional n))
+(declare-function org-export-get-previous-element "org-export" (blob info &optional n))
+(declare-function org-export-raw-string "org-export" (s))
+
+(defvar org-complex-heading-regexp)
+(defvar org-element-all-objects)
+(defvar org-element-citation-key-re)
+(defvar org-element-citation-prefix-re)
+(defvar org-element-parsed-keywords)
+
+
+;;; Constants
+;; Borrowed from "citeproc.el" library.
+(defconst org-cite--default-region-alist
+ '(("af" . "za") ("ca" . "ad") ("cs" . "cz") ("cy" . "gb")
+ ("da" . "dk") ("el" . "gr") ("et" . "ee") ("fa" . "ir")
+ ("he" . "ir") ("ja" . "jp") ("km" . "kh") ("ko" . "kr")
+ ("nb" . "no") ("nn" . "no") ("sl" . "si") ("sr" . "rs")
+ ("sv" . "se") ("uk" . "ua") ("vi" . "vn") ("zh" . "cn"))
+ "Alist mapping those languages to their default region.
+Only those languages are given for which the default region is not simply the
+result of duplicating the language part.")
+
+
+;;; Configuration variables
+(defgroup org-cite nil
+ "Options concerning citations in Org mode."
+ :group 'org
+ :tag "Org Cite")
+
+(defcustom org-cite-global-bibliography nil
+ "List of bibliography files available in all documents.
+File names must be absolute."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type '(choice (const :tag "No global bibliography" nil)
+ (repeat :tag "List of bibliography files"
+ (file :tag "Bibliography"))))
+
+(defcustom org-cite-activate-processor 'basic
+ "Processor used for activating citations, as a symbol."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type '(choice (const :tag "Default fontification" nil)
+ (symbol :tag "Citation processor")))
+
+(defcustom org-cite-export-processors '((t basic))
+ "Processor used for exporting citations, as a triplet, or nil.
+
+When nil, citations and bibliography are not exported.
+
+When non-nil, the value is an association list between export back-ends and
+citation export processors:
+
+ (BACK-END . PROCESSOR)
+
+where BACK-END is the name of an export back-end or t, and PROCESSOR is a
+triplet following the pattern
+
+ (NAME BIBLIOGRAPHY-STYLE CITATION-STYLE)
+
+There, NAME is the name of a registered citation processor providing export
+functionality, as a symbol. BIBLIOGRAPHY-STYLE (respectively CITATION-STYLE)
+is the desired default style to use when printing a bibliography (respectively
+exporting a citation), as a string or nil. Both BIBLIOGRAPHY-STYLE and
+CITATION-STYLE are optional. NAME is mandatory.
+
+The export process selects the citation processor associated to the current
+export back-end, or the most specific back-end the current one is derived from,
+or, if all are inadequate, to the processor associated to t. For example, with
+the following value
+
+ ((beamer natbib)
+ (latex biblatex)
+ (t csl))
+
+exporting with `beamer' or any back-end derived from it will use `natbib',
+whereas exporting with `latex' or any back-end derived from it but different
+from `beamer' will use `biblatex' processor. Any other back-end, such as
+`html', will use `csl' processor.
+
+CITATION-STYLE is overridden by adding a style to any citation object. A nil
+style lets the export processor choose the default output. Any style not
+recognized by the export processor is equivalent to nil.
+
+The citation triplet can also be set with the CITE_EXPORT keyword.
+E.g.,
+
+ #+CITE_EXPORT: basic note numeric
+
+or
+
+ #+CITE_EXPORT: basic
+
+In that case, `basic' processor is used on every export, independently on the
+back-end."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type '(choice (const :tag "No export" nil)
+ (alist :key-type symbol
+ :value-type
+ (list :tag "Citation processor"
+ (symbol :tag "Processor name")
+ (choice
+ (const :tag "Default bibliography style" nil)
+ (string :tag "Use specific bibliography style"))
+ (choice
+ (const :tag "Default citation style" nil)
+ (string :tag "Use specific citation style"))))))
+
+(defcustom org-cite-follow-processor 'basic
+ "Processor used for following citations, as a symbol."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type '(choice (const :tag "No following" nil)
+ (symbol :tag "Citation processor")))
+
+(defcustom org-cite-insert-processor 'basic
+ "Processor used for inserting citations, as a symbol."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type '(choice (const :tag "No insertion" nil)
+ (symbol :tag "Citation processor")))
+
+(defcustom org-cite-adjust-note-numbers t
+ "When non-nil, allow process to modify location of note numbers.
+
+When this variable is non-nil, it is possible to swap between author-date and
+note style without modifying the document. To that effect, citations should
+always be located as in an author-date style. Prior to turning the citation
+into a footnote, the citation processor moves the citation (i.e., the future
+note number), and the surrounding punctuation, according to rules defined in
+`org-cite-note-rules'.
+
+When nil, the note number is not moved."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type '(choice (const :tag "Automatic note number location" t)
+ (const :tag "Place note numbers manually" nil))
+ :safe #'booleanp)
+
+(defcustom org-cite-note-rules
+ '(("en-us" inside outside after)
+ ("fr" adaptive same before))
+ "Alist between languages and typographic rules for citations in note style.
+
+When `org-cite-adjust-note-numbers' is non-nil, and note style is requested,
+citation processor is allowed to move the note marker according to some specific
+rules, detailed here. More accurately, a rule is a list following the pattern
+
+ (LANGUAGE-TAG . RULE)
+
+ LANGUAGE-TAG is a down-cased string representing a language tag as defined in
+ RFC 4646. It may constituted of a language and a region separated with an
+ hyphen (e.g., \"en-us\"), or the language alone (e.g., \"fr\"). A language
+ without a region applies to all regions.
+
+ RULE is a triplet
+
+ (PUNCTUATION NUMBER ORDER)
+
+ PUNCTUATION is the desired location of the punctuation with regards to the
+ quotation, if any. It may be `inside', `outside', or `adaptive'. The latter
+ permits subtler control over the punctuation: when there is no space between
+ the quotation mark and the punctuation, it is equivalent to `inside'.
+ Otherwise, it means `outside', as illustrated in the following examples:
+
+ \"A quotation ending without punctuation\" [cite:@org21].
+ \"A quotation ending with a period\"[cite:@org21].
+
+ Notwithstanding the above, a space always appear before the citation when it
+ is to become anything else than a note.
+
+ NUMBER is the desired location of the note number with regards to the
+ quotation mark, if any. It may be `inside', `outside', or `same'. When set
+ to `same', the number appears on the same side as the punctuation, unless
+ there is punctuation on both sides or on none.
+
+ ORDER is the relative position of the citation with regards to the closest
+ punctuation. It may be `after' or `before'.
+
+For example (adaptive same before) corresponds to French typography.
+
+When the locale is unknown to this variable, the default rule is:
+
+ (adaptive outside after)
+
+This roughly follows the Oxford Guide to Style recommendations."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type
+ '(repeat
+ (list :tag "Typographic rule"
+ (string :tag "Language code")
+ (choice :tag "Location of punctuation"
+ (const :tag "Punctuation inside quotation" inside)
+ (const :tag "Punctuation outside quotation" outside)
+ (const :tag "Location depends on spacing" adaptive))
+ (choice :tag "Location of citation"
+ (const :tag "Citation inside quotation" inside)
+ (const :tag "Citation outside quotation" outside)
+ (const :tag "Citation next to punctuation" same))
+ (choice :tag "Order of citation and punctuation"
+ (const :tag "Citation first" before)
+ (const :tag "Citation last" after)))))
+
+(defcustom org-cite-punctuation-marks '("." "," ";" ":" "!" "?")
+ "List of strings that can be moved around when placing note numbers.
+
+When `org-cite-adjust-note-numbers' is non-nil, the citation processor is
+allowed to shuffle punctuation marks specified in this list in order to
+place note numbers according to rules defined in `org-cite-note-rules'."
+ :group 'org-cite
+ :package-version '(Org . "9.5")
+ :type '(repeat string))
+
+
+;;; Citation processors
+(cl-defstruct (org-cite-processor (:constructor org-cite--make-processor)
+ (:copier nil))
+ (name nil :read-only t)
+ (activate nil :read-only t)
+ (cite-styles nil :read-only t)
+ (export-bibliography nil :read-only t)
+ (export-citation nil :read-only t)
+ (export-finalizer nil :read-only t)
+ (follow nil :read-only t)
+ (insert nil :read-only t))
+
+(defvar org-cite--processors nil
+ "List of registered citation processors.
+See `org-cite-register-processor' for more information about
+processors.")
+
+(defun org-cite--get-processor (name)
+ "Return citation processor named after symbol NAME.
+Return nil if no such processor is found."
+ (seq-find (lambda (p) (eq name (org-cite-processor-name p)))
+ org-cite--processors))
+
+(defun org-cite-register-processor (name &rest body)
+ "Mark citation processor NAME as available.
+
+NAME is a symbol. BODY is a property list, where the following
+optional keys can be set:
+
+ `:activate'
+
+ Function activating a citation. It is called with a single
+ argument: a citation object extracted from the current
+ buffer. It may add text properties to the buffer. If it is
+ not provided, `org-cite-fontify-default' is used.
+
+ `:export-bibliography'
+
+ Function rendering a bibliography. It is called with six
+ arguments: the list of citation keys used in the document, as
+ strings, a list of bibliography files, the style, as a string
+ or nil, the local properties, as a property list, the export
+ back-end, as a symbol, and the communication channel, as a
+ property list.
+
+ It is called at each \"print_bibliography\" keyword in the
+ parse tree. It may return a string, a parsed element, a list
+ of parsed elements, or nil. When it returns nil, the keyword
+ is ignored. Otherwise, the value it returns replaces the
+ keyword in the export output.
+
+ `:export-citation' (mandatory for \"export\" capability)
+
+ Function rendering citations. It is called with four
+ arguments: a citation object, the style, as a pair, the
+ export back-end, as a symbol, and the communication channel,
+ as a property list.
+
+ It is called on each citation object in the parse tree. It
+ may return a string, a parsed object, a secondary string, or
+ nil. When it returns nil, the citation is ignored.
+ Otherwise, the value it returns replaces the citation object
+ in the export output.
+
+ `:export-finalizer'
+
+ Function called at the end of export process. It must accept
+ six arguments: the output, as a string, a list of citation
+ keys used in the document, a list of bibliography files, the
+ expected bibliography style, as a string or nil, the export
+ back-end, as a symbol, and the communication channel, as a
+ property list.
+
+ It must return a string, which will become the final output
+ from the export process, barring subsequent modifications
+ from export filters.
+
+ `:follow'
+
+ Function called to follow a citation. It accepts two
+ arguments, the citation or citation reference object at
+ point, and any prefix argument received during interactive
+ call of `org-open-at-point'.
+
+ `:insert'
+
+ Function called to insert a citation. It accepts two
+ arguments, the citation or citation reference object at point
+ or nil, and any prefix argument received.
+
+ `:cite-styles'
+
+ When the processor has export capability, the value can
+ specify what cite styles, variants, and their associated
+ shortcuts are supported. It can be useful information for
+ completion or linting.
+
+ The expected format is
+
+ ((STYLE . SHORTCUTS) . VARIANTS))
+
+ where STYLE is a string, SHORTCUTS a list of strings or nil,
+ and VARIANTS is a list of pairs (VARIANT . SHORTCUTS),
+ VARIANT being a string and SHORTCUTS a list of strings or
+ nil.
+
+ The \"nil\" style denotes the processor fall-back style. It
+ should have a corresponding entry in the value.
+
+Return a non-nil value on a successful operation."
+ (declare (indent 1))
+ (unless (and name (symbolp name))
+ (error "Invalid processor name: %S" name))
+ (when (org-cite--get-processor name)
+ (org-cite-unregister-processor name))
+ (push (apply #'org-cite--make-processor :name name body)
+ org-cite--processors))
+
+(defun org-cite-unregister-processor (name)
+ "Unregister citation processor NAME.
+NAME is a symbol. Raise an error if processor is not registered.
+Return a non-nil value on a successful operation."
+ (unless (and name (symbolp name))
+ (error "Invalid processor name: %S" name))
+ (pcase (org-cite--get-processor name)
+ ('nil (error "Processor %S not registered" name))
+ (processor
+ (setq org-cite--processors (delete processor org-cite--processors))))
+ t)
+
+(defun org-cite-processor-has-capability-p (processor capability)
+ "Return non-nil if PROCESSOR is able to handle CAPABILITY.
+PROCESSOR is the name of a cite processor, as a symbol. CAPABILITY is
+`activate', `export', `follow', or `insert'."
+ (let ((p (org-cite--get-processor processor)))
+ (pcase capability
+ ((guard (not p)) nil) ;undefined processor
+ ('activate (functionp (org-cite-processor-activate p)))
+ ('export (functionp (org-cite-processor-export-citation p)))
+ ('follow (functionp (org-cite-processor-follow p)))
+ ('insert (functionp (org-cite-processor-insert p)))
+ (other (error "Invalid capability: %S" other)))))
+
+
+;;; Internal functions
+(defun org-cite--set-post-blank (datum blanks)
+ "Set `:post-blank' property from element or object before DATUM to BLANKS.
+DATUM is an element or object. BLANKS is an integer. DATUM is modified
+by side-effect."
+ (if (not (eq 'plain-text (org-element-type datum)))
+ (org-element-put-property datum :post-blank blanks)
+ ;; Remove any blank from string before DATUM so it is exported
+ ;; with exactly BLANKS white spaces.
+ (org-element-set-element
+ datum
+ (replace-regexp-in-string
+ "[ \t\n]*\\'" (make-string blanks ?\s) datum))))
+
+(defun org-cite--set-previous-post-blank (datum blanks info)
+ "Set `:post-blank' property from element or object before DATUM to BLANKS.
+DATUM is an element or object. BLANKS is an integer. INFO is the export
+state, as a property list. Previous element or object, if any, is modified by
+side-effect."
+ (let ((previous (org-export-get-previous-element datum info)))
+ (when previous
+ (org-cite--set-post-blank previous blanks))))
+
+(defun org-cite--insert-at-split (s citation n regexp)
+ "Split string S and insert CITATION object between the two parts.
+S is split at beginning of match group N upon matching REGEXP against it.
+This function assumes S precedes CITATION."
+ ;; When extracting the citation, remove white spaces before it, but
+ ;; preserve those after it.
+ (let ((post-blank (org-element-property :post-blank citation)))
+ (when (and post-blank (> post-blank 0))
+ (org-element-insert-before (make-string post-blank ?\s) citation)))
+ (org-element-insert-before
+ (org-element-put-property (org-element-extract-element citation)
+ :post-blank 0)
+ s)
+ (string-match regexp s)
+ (let* ((split (match-beginning n))
+ (first-part (substring s nil split))
+ ;; Remove trailing white spaces as they are before the
+ ;; citation.
+ (last-part
+ (replace-regexp-in-string (rx (1+ (any blank ?\n)) string-end)
+ ""
+ (substring s split))))
+ (when (org-string-nw-p first-part)
+ (org-element-insert-before first-part citation))
+ (org-element-set-element s last-part)))
+
+(defun org-cite--move-punct-before (punct citation s info)
+ "Move punctuation PUNCT before CITATION object.
+String S contains PUNCT. INFO is the export state, as a property list.
+The function assumes S follows CITATION. Parse tree is modified by side-effect."
+ (if (equal s punct)
+ (org-element-extract-element s) ;it would be empty anyway
+ (org-element-set-element s (substring s (length punct))))
+ ;; Remove blanks before citation.
+ (org-cite--set-previous-post-blank citation 0 info)
+ (org-element-insert-before
+ ;; Blanks between citation and punct are now before punct and
+ ;; citation.
+ (concat (make-string (or (org-element-property :post-blank citation) 0) ?\s)
+ punct)
+ citation))
+
+(defun org-cite--parse-as-plist (s)
+ "Parse string S as a property list.
+Values are always strings. Return nil if S is nil."
+ (cond
+ ((null s) nil)
+ ((stringp s)
+ (with-temp-buffer
+ (save-excursion (insert s))
+ (skip-chars-forward " \t")
+ (let ((results nil)
+ (value-flag nil))
+ (while (not (eobp))
+ (pcase (char-after)
+ (?:
+ (push (read (current-buffer)) results)
+ (setq value-flag t))
+ ((guard (not value-flag))
+ (skip-chars-forward "^ \t"))
+ (?\"
+ (let ((origin (point)))
+ (condition-case _
+ (progn
+ (read (current-buffer))
+ (push (buffer-substring (1+ origin) (1- (point))) results))
+ (end-of-file
+ (goto-char origin)
+ (skip-chars-forward "^ \t")
+ (push (buffer-substring origin (point)) results)))
+ (setq value-flag nil)))
+ (_
+ (let ((origin (point)))
+ (skip-chars-forward "^ \t")
+ (push (buffer-substring origin (point)) results)
+ (setq value-flag nil))))
+ (skip-chars-forward " \t"))
+ (nreverse results))))
+ (t (error "Invalid argument type: %S" s))))
+
+(defun org-cite--get-note-rule (info)
+ "Return punctuation rule according to language used for export.
+
+INFO is the export state, as a property list.
+
+Rule is found according to the language used for export and
+`org-cite-note-rules', which see.
+
+If there is no rule matching current language, the rule defaults
+to (adaptive outside after)."
+ (let* ((language-tags
+ ;; Normalize language as a language-region tag, as described
+ ;; in RFC 4646.
+ (pcase (split-string (plist-get info :language) "[-_]")
+ (`(,language)
+ (list language
+ (or (cdr (assoc language org-cite--default-region-alist))
+ language)))
+ (`(,language ,region)
+ (list language region))
+ (other
+ (error "Invalid language identifier: %S" other))))
+ (language-region (mapconcat #'downcase language-tags "-"))
+ (language (car language-tags)))
+ (or (cdr (assoc language-region org-cite-note-rules))
+ (cdr (assoc language org-cite-note-rules))
+ '(adaptive outside after))))
+
+
+;;; Generic tools
+(defun org-cite-list-bibliography-files ()
+ "List all bibliography files defined in the buffer."
+ (delete-dups
+ (append (mapcar (lambda (value)
+ (pcase value
+ (`(,f . ,d)
+ (expand-file-name (org-strip-quotes f) d))))
+ (pcase (org-collect-keywords
+ '("BIBLIOGRAPHY") nil '("BIBLIOGRAPHY"))
+ (`(("BIBLIOGRAPHY" . ,pairs)) pairs)))
+ org-cite-global-bibliography)))
+
+(defun org-cite-get-references (citation &optional keys-only)
+ "Return citations references contained in CITATION object.
+
+When optional argument KEYS-ONLY is non-nil, return the references' keys, as a
+list of strings.
+
+Assume CITATION object comes from either a full parse tree, e.g., during export,
+or from the current buffer."
+ (let ((contents (org-element-contents citation)))
+ (cond
+ ((null contents)
+ (org-with-point-at (org-element-property :contents-begin citation)
+ (narrow-to-region (point) (org-element-property :contents-end citation))
+ (let ((references nil))
+ (while (not (eobp))
+ (let ((reference (org-element-citation-reference-parser)))
+ (goto-char (org-element-property :end reference))
+ (push (if keys-only
+ (org-element-property :key reference)
+ reference)
+ references)))
+ (nreverse references))))
+ (keys-only (mapcar (lambda (r) (org-element-property :key r)) contents))
+ (t contents))))
+
+(defun org-cite-boundaries (citation)
+ "Return the beginning and end strict position of CITATION.
+Returns a (BEG . END) pair."
+ (let ((beg (org-element-property :begin citation))
+ (end (org-with-point-at (org-element-property :end citation)
+ (skip-chars-backward " \t")
+ (point))))
+ (cons beg end)))
+
+(defun org-cite-key-boundaries (reference)
+ "Return citation REFERENCE's key boundaries as buffer positions.
+The function returns a pair (START . END) where START and END denote positions
+in the current buffer. Positions include leading \"@\" character."
+ (org-with-point-at (org-element-property :begin reference)
+ (let ((end (org-element-property :end reference)))
+ (re-search-forward org-element-citation-key-re end t)
+ (cons (match-beginning 0) (match-end 0)))))
+
+(defun org-cite-main-affixes (citation)
+ "Return main affixes for CITATION object.
+
+Some export back-ends only support a single pair of affixes per
+citation, even if it contains multiple keys. This function
+decides what affixes are the most appropriate.
+
+Return a pair (PREFIX . SUFFIX) where PREFIX and SUFFIX are
+parsed data."
+ (let ((source
+ ;; When there are multiple references, use global affixes.
+ ;; Otherwise, local affixes have priority.
+ (pcase (org-cite-get-references citation)
+ (`(,reference) reference)
+ (_ citation))))
+ (cons (org-element-property :prefix source)
+ (org-element-property :suffix source))))
+
+(defun org-cite-supported-styles (&optional processors)
+ "List of supported citation styles and variants.
+
+Supported styles are those handled by export processors from
+`org-cite-export-processors', or in PROCESSORS, as a list of symbols,
+when non-nil.
+
+Return value is a list with the following items:
+
+ ((STYLE . SHORTCUTS) . VARIANTS))
+
+where STYLE is a string, SHORTCUTS a list of strings, and VARIANTS is a list of
+pairs (VARIANT . SHORTCUTS), VARIANT being a string and SHORTCUTS a list of
+strings."
+ (let ((collection
+ (seq-mapcat
+ (lambda (name)
+ (org-cite-processor-cite-styles (org-cite--get-processor name)))
+ (or processors
+ (mapcar (pcase-lambda (`(,_ . (,name . ,_))) name)
+ org-cite-export-processors))))
+ (result nil))
+ ;; Merge duplicate styles. Each style full name is guaranteed to
+ ;; be unique, and associated to all shortcuts and all variants in
+ ;; the initial collection.
+ (pcase-dolist (`((,style . ,shortcuts) . ,variants) collection)
+ (let ((entry (assoc style result)))
+ (if (not entry)
+ (push (list style shortcuts variants) result)
+ (setf (nth 1 entry)
+ (seq-uniq (append shortcuts (nth 1 entry))))
+ (setf (nth 2 entry)
+ (append variants (nth 2 entry))))))
+ ;; Return value with the desired format.
+ (nreverse
+ (mapcar (pcase-lambda (`(,style ,shortcuts ,variants))
+ (cons (cons style (nreverse shortcuts))
+ ;; Merge variant shortcuts.
+ (let ((result nil))
+ (pcase-dolist (`(,variant . ,shortcuts) variants)
+ (let ((entry (assoc variant result)))
+ (if (not entry)
+ (push (cons variant shortcuts) result)
+ (setf (cdr entry)
+ (seq-uniq (append shortcuts (cdr entry)))))))
+ result)))
+ result))))
+
+(defun org-cite-delete-citation (datum)
+ "Delete citation or citation reference DATUM.
+When removing the last reference, also remove the whole citation."
+ (pcase (org-element-type datum)
+ ('citation
+ (pcase-let* ((`(,begin . ,end) (org-cite-boundaries datum))
+ (pos-before-blank
+ (org-with-point-at begin
+ (skip-chars-backward " \t")
+ (point)))
+ (pos-after-blank (org-element-property :end datum))
+ (first-on-line?
+ (= pos-before-blank (line-beginning-position)))
+ (last-on-line?
+ (= pos-after-blank (line-end-position))))
+ (cond
+ ;; The citation is alone on its line. Remove the whole line.
+ ;; Do not leave it blank as it might break a surrounding
+ ;; paragraph.
+ ((and first-on-line? last-on-line?)
+ (delete-region (line-beginning-position) (line-beginning-position 2)))
+ ;; When the citation starts the line, preserve indentation.
+ (first-on-line? (delete-region begin pos-after-blank))
+ ;; When the citation ends the line, remove any trailing space.
+ (last-on-line? (delete-region pos-before-blank (line-end-position)))
+ ;; Otherwise, delete blanks before the citation.
+ ;; Nevertheless, make sure there is at least one blank left,
+ ;; so as to not splice unrelated surroundings.
+ (t
+ (delete-region pos-before-blank end)
+ (when (= pos-after-blank end)
+ (org-with-point-at pos-before-blank (insert " ")))))))
+ ('citation-reference
+ (let* ((citation (org-element-property :parent datum))
+ (references (org-cite-get-references citation))
+ (begin (org-element-property :begin datum))
+ (end (org-element-property :end datum)))
+ (cond
+ ;; Single reference.
+ ((= 1 (length references))
+ (org-cite-delete-citation citation))
+ ;; First reference, no prefix.
+ ((and (= begin (org-element-property :contents-begin citation))
+ (not (org-element-property :prefix citation)))
+ (org-with-point-at (org-element-property :begin datum)
+ (skip-chars-backward " \t")
+ (delete-region (point) end)))
+ ;; Last reference, no suffix.
+ ((and (= end (org-element-property :contents-end citation))
+ (not (org-element-property :suffix citation)))
+ (delete-region (1- begin) (1- (cdr (org-cite-boundaries citation)))))
+ ;; Somewhere in-between.
+ (t
+ (delete-region begin end)))))
+ (other
+ (error "Invalid object type: %S" other))))
+
+
+;;; Tools only available during export
+(defun org-cite-citation-style (citation info)
+ "Return citation style used for CITATION object.
+
+Style is a pair (NAME . VARIANT) where NAME and VARIANT are strings or nil.
+A nil NAME means the default style for the current processor should be used.
+
+INFO is a plist used as a communication channel."
+ (let* ((separate
+ (lambda (s)
+ (cond
+ ((null s) (cons nil nil))
+ ((not (string-match "/" s)) (cons s nil))
+ (t (cons (substring s nil (match-beginning 0))
+ (org-string-nw-p (substring s (match-end 0))))))))
+ (local (funcall separate (org-element-property :style citation)))
+ (global
+ (funcall separate (pcase (plist-get info :cite-export)
+ (`(,_ ,_ ,style) style)
+ (_ nil)))))
+ (cond
+ ((org-string-nw-p (car local))
+ (cons (org-not-nil (car local)) (cdr local)))
+ (t
+ (cons (org-not-nil (car global))
+ (or (cdr local) (cdr global)))))))
+
+(defun org-cite-bibliography-style (info)
+ "Return expected bibliography style.
+INFO is a plist used as a communication channel."
+ (pcase (plist-get info :cite-export)
+ (`(,_ ,style ,_) style)
+ (_ nil)))
+
+(defun org-cite-bibliography-properties (keyword)
+ "Return properties associated to \"print_bibliography\" KEYWORD object.
+Return value is a property list."
+ (org-cite--parse-as-plist (org-element-property :value keyword)))
+
+(defun org-cite-list-citations (info)
+ "List citations in the exported document.
+Citations are ordered by appearance in the document, when following footnotes.
+INFO is the export communication channel, as a property list."
+ (or (plist-get info :citations)
+ (letrec ((cites nil)
+ (tree (plist-get info :parse-tree))
+ (find-definition
+ ;; Find definition for standard reference LABEL. At
+ ;; this point, it is impossible to rely on
+ ;; `org-export-get-footnote-definition' because the
+ ;; function caches results that could contain
+ ;; un-processed citation objects. So we use
+ ;; a simplified version of the function above.
+ (lambda (label)
+ (org-element-map tree 'footnote-definition
+ (lambda (d)
+ (and (equal label (org-element-property :label d))
+ (or (org-element-contents d) "")))
+ info t)))
+ (search-cites
+ (lambda (data)
+ (org-element-map data '(citation footnote-reference)
+ (lambda (datum)
+ (pcase (org-element-type datum)
+ ('citation (push datum cites))
+ ;; Do not force entering inline definitions, since
+ ;; `org-element-map' is going to enter it anyway.
+ ((guard (eq 'inline (org-element-property :type datum))))
+ ;; Walk footnote definition.
+ (_
+ (let ((label (org-element-property :label datum)))
+ (funcall search-cites
+ (funcall find-definition label))))))
+ info nil 'footnote-definition t))))
+ (funcall search-cites tree)
+ (let ((result (nreverse cites)))
+ (plist-put info :citations result)
+ result))))
+
+(defun org-cite-list-keys (info)
+ "List citation keys in the exported document.
+Keys are ordered by first appearance in the document, when following footnotes.
+Duplicate keys are removed. INFO is the export communication channel, as a
+property list."
+ (delete-dups
+ (org-element-map (org-cite-list-citations info) 'citation-reference
+ (lambda (r) (org-element-property :key r))
+ info)))
+
+(defun org-cite-key-number (key info &optional predicate)
+ "Return number associated to string KEY.
+
+INFO is the export communication channel, as a property list.
+
+Optional argument PREDICATE is called with two keys, and returns non-nil
+if the first reference should sort before the second. When nil, references
+are sorted in order cited."
+ (let* ((keys (org-cite-list-keys info))
+ (sorted-keys (if (functionp predicate)
+ (sort keys predicate)
+ keys))
+ (position (seq-position sorted-keys key #'string-equal)))
+ (and (integerp position)
+ (1+ position))))
+
+(defun org-cite-inside-footnote-p (citation &optional strict)
+ "Non-nil when CITATION object is contained within a footnote.
+
+When optional argument STRICT is non-nil, return t only if CITATION represents
+the sole contents of the footnote, e.g., after calling `org-cite-wrap-citation'.
+
+When non-nil, the return value if the footnote container."
+ (let ((footnote
+ (org-element-lineage citation
+ '(footnote-definition footnote-reference))))
+ (and footnote
+ (or (not strict)
+ (equal (org-element-contents (org-element-property :parent citation))
+ (list citation)))
+ ;; Return value.
+ footnote)))
+
+(defun org-cite-wrap-citation (citation info)
+ "Wrap an anonymous inline footnote around CITATION object in the parse tree.
+
+INFO is the export state, as a property list.
+
+White space before the citation, if any, are removed. The parse tree is
+modified by side-effect.
+
+Return newly created footnote object."
+ (let ((footnote
+ (list 'footnote-reference
+ (list :label nil
+ :type 'inline
+ :contents-begin (org-element-property :begin citation)
+ :contents-end (org-element-property :end citation)
+ :post-blank (org-element-property :post-blank citation)))))
+ ;; Remove any white space before citation.
+ (org-cite--set-previous-post-blank citation 0 info)
+ ;; Footnote swallows citation.
+ (org-element-insert-before footnote citation)
+ (org-element-adopt-elements footnote
+ (org-element-extract-element citation))))
+
+(defun org-cite-adjust-note (citation info &optional rule punct)
+ "Adjust note number location for CITATION object, and punctuation around it.
+
+INFO is the export state, as a property list.
+
+Optional argument RULE is the punctuation rule used, as a triplet. When nil,
+rule is determined according to `org-cite-note-rules', which see.
+
+Optional argument PUNCT is a list of punctuation marks to be considered.
+When nil, it defaults to `org-cite-punctuation-marks'.
+
+Parse tree is modified by side-effect.
+
+Note: when calling both `org-cite-adjust-note' and `org-cite-wrap-citation' on
+the same object, call `org-cite-adjust-note' first."
+ (when org-cite-adjust-note-numbers
+ (pcase-let* ((rule (or rule (org-cite--get-note-rule info)))
+ (punct-re (regexp-opt (or punct org-cite-punctuation-marks)))
+ ;; with Emacs <27.1. Argument of `regexp' form (PUNCT-RE this case)
+ ;; must be a string literal.
+ (previous-punct-re
+ (rx-to-string `(seq (opt (group (regexp ,(rx (0+ (any blank ?\n))))
+ (regexp ,punct-re)))
+ (regexp ,(rx (opt (0+ (any blank ?\n)) (group ?\"))
+ (opt (group (1+ (any blank ?\n))))
+ string-end)))
+ t))
+ (next-punct-re
+ (rx-to-string `(seq string-start
+ (group (0+ (any blank ?\n)) (regexp ,punct-re)))
+ t))
+ (next (org-export-get-next-element citation info))
+ (final-punct
+ (and (stringp next)
+ (string-match next-punct-re next)
+ (match-string 1 next)))
+ (previous
+ ;; Find the closest terminal object. Consider
+ ;; citation, subscript and superscript objects as
+ ;; terminal.
+ (org-last
+ (org-element-map (org-export-get-previous-element citation info)
+ '(citation code entity export-snippet footnote-reference
+ line-break latex-fragment link plain-text
+ radio-target statistics-cookie timestamp
+ verbatim)
+ #'identity info nil '(citation subscript superscript))))
+ (`(,punct ,quote ,spacing)
+ (and (stringp previous)
+ (string-match previous-punct-re previous)
+ (list (match-string 1 previous)
+ (match-string 2 previous)
+ (match-string 3 previous)))))
+ ;; Bail you when there is no quote and either no punctuation, or
+ ;; punctuation on both sides.
+ (when (or quote (org-xor punct final-punct))
+ ;; Phase 1: handle punctuation rule.
+ (pcase rule
+ ((guard (not quote)) nil)
+ ;; Move punctuation inside.
+ (`(,(or `inside (and `adaptive (guard (not spacing)))) . ,_)
+ ;; This only makes sense if there is a quotation before the
+ ;; citation that does not end with some punctuation.
+ (when (and (not punct) final-punct)
+ ;; Quote guarantees there is a string object before
+ ;; citation. Likewise, any final punctuation guarantees
+ ;; there is a string object following citation.
+ (let ((new-prev
+ (replace-regexp-in-string
+ previous-punct-re
+ (concat final-punct "\"") previous nil nil 2))
+ (new-next
+ (replace-regexp-in-string
+ ;; Before Emacs-27.1 `literal' `rx' form with a variable
+ ;; as an argument is not available.
+ (rx-to-string `(seq string-start ,final-punct) t)
+ "" next)))
+ (org-element-set-element previous new-prev)
+ (org-element-set-element next new-next)
+ (setq previous new-prev)
+ (setq next new-next)
+ (setq punct final-punct)
+ (setq final-punct nil))))
+ ;; Move punctuation outside.
+ (`(,(or `outside (and `adaptive (guard spacing))) . ,_)
+ ;; This is only meaningful if there is some inner
+ ;; punctuation and no final punctuation already.
+ (when (and punct (not final-punct))
+ ;; Inner punctuation guarantees there is text object
+ ;; before the citation. However, there is no information
+ ;; about the object following citation, if any.
+ ;; Therefore, we handle all the possible cases (string,
+ ;; other type, or none).
+ (let ((new-prev
+ (replace-regexp-in-string
+ previous-punct-re "" previous nil nil 1))
+ (new-next (if (stringp next) (concat punct next) punct)))
+ (org-element-set-element previous new-prev)
+ (cond
+ ((stringp next)
+ (org-element-set-element next new-next))
+ (next
+ (org-element-insert-before new-next next))
+ (t
+ (org-element-adopt-elements
+ (org-element-property :parent citation)
+ new-next)))
+ (setq previous new-prev)
+ (setq next new-next)
+ (setq final-punct punct)
+ (setq punct nil))))
+ (_
+ (error "Invalid punctuation rule: %S" rule))))
+ ;; Phase 2: move citation to its appropriate location.
+ ;;
+ ;; First transform relative citation location into a definitive
+ ;; location, according to the surrounding punctuation.
+ (pcase rule
+ (`(,punctuation same ,order)
+ (setf rule
+ (list punctuation
+ (cond
+ ;; When there is punctuation on both sides, the
+ ;; citation is necessarily on the outside.
+ ((and punct final-punct) 'outside)
+ (punct 'inside)
+ (final-punct 'outside)
+ ;; No punctuation: bail out on next step.
+ (t nil))
+ order))))
+ (pcase rule
+ (`(,_ nil ,_) nil)
+ (`(,_ inside after)
+ ;; Citation has to be moved after punct, if there is
+ ;; a quotation mark, or after final punctuation.
+ (cond
+ (quote
+ (org-cite--insert-at-split previous citation 2 previous-punct-re))
+ (final-punct
+ (org-cite--move-punct-before final-punct citation next info))
+ ;; There is only punct, and we're already after it.
+ (t nil)))
+ (`(,_ inside before)
+ ;; Citation is already behind final-punct, so only consider
+ ;; other locations.
+ (when (or punct quote)
+ (org-cite--insert-at-split previous citation 0 previous-punct-re)))
+ (`(,_ outside after)
+ ;; Citation is already after any punct or quote. It can only
+ ;; move past final punctuation, if there is one.
+ (when final-punct
+ (org-cite--move-punct-before final-punct citation next info)))
+ (`(,_ outside before)
+ ;; The only non-trivial case is when citation follows punct
+ ;; without a quote.
+ (when (and punct (not quote))
+ (org-cite--insert-at-split previous citation 0 previous-punct-re)))
+ (_
+ (error "Invalid punctuation rule: %S" rule))))))
+
+
+;;; Tools generating or operating on parsed data
+(defun org-cite-parse-elements (s)
+ "Parse string S as a list of Org elements.
+
+The return value is suitable as a replacement for a
+\"print_bibliography\" keyword. As a consequence, the function
+raises an error if S contains a headline."
+ (with-temp-buffer
+ (insert s)
+ (pcase (org-element-contents (org-element-parse-buffer))
+ ('nil nil)
+ (`(,(and section (guard (eq 'section (org-element-type section)))))
+ (org-element-contents section))
+ (_
+ (error "Headlines cannot replace a keyword")))))
+
+(defun org-cite-parse-objects (s &optional affix)
+ "Parse string S as a secondary string.
+
+The return value is suitable as a replacement for a citation object.
+
+When optional argument AFFIX is non-nil, restrict the set of allowed object
+types to match the contents of a citation affix."
+ (org-element-parse-secondary-string
+ s (org-element-restriction (if affix 'citation-reference 'paragraph))))
+
+(defun org-cite-make-paragraph (&rest data)
+ "Return a paragraph element containing DATA.
+DATA are strings, objects or secondary strings."
+ (apply #'org-element-create 'paragraph nil (apply #'org-cite-concat data)))
+
+(defun org-cite-emphasize (type &rest data)
+ "Apply emphasis TYPE on DATA.
+TYPE is a symbol among `bold', `italic', `strike-through' and `underline'.
+DATA are strings, objects or secondary strings. Return an object of type TYPE."
+ (declare (indent 1))
+ (unless (memq type '(bold italic strike-through underline))
+ (error "Wrong emphasis type: %S" type))
+ (apply #'org-element-create type nil (apply #'org-cite-concat data)))
+
+(defun org-cite-concat (&rest data)
+ "Concatenate all the DATA arguments and make the result a secondary string.
+Each argument may be a string, an object, or a secondary string."
+ (let ((results nil))
+ (dolist (datum (reverse data))
+ (pcase datum
+ ('nil nil)
+ ;; Element or object.
+ ((pred org-element-type) (push datum results))
+ ;; Secondary string.
+ ((pred consp) (setq results (append datum results)))
+ (_
+ (signal
+ 'wrong-type-argument
+ (list (format "Argument is not a string or a secondary string: %S"
+ datum))))))
+ results))
+
+(defun org-cite-mapconcat (function data separator)
+ "Apply FUNCTION to each element of DATA, and return a secondary string.
+
+In between each pair of results, stick SEPARATOR, which may be a string,
+an object, or a secondary string. FUNCTION must be a function of one argument,
+and must return either a string, an object, or a secondary string."
+ (and data
+ (let ((result (list (funcall function (car data)))))
+ (dolist (datum (cdr data))
+ (setq result
+ (org-cite-concat result separator (funcall function datum))))
+ result)))
+
+
+;;; Internal interface with fontification (activate capability)
+(defun org-cite-fontify-default (cite)
+ "Fontify CITE with `org-cite' and `org-cite-key' faces.
+CITE is a citation object. The function applies `org-cite' face
+on the whole citation, and `org-cite-key' face on each key."
+ (let ((beg (org-element-property :begin cite))
+ (end (org-with-point-at (org-element-property :end cite)
+ (skip-chars-backward " \t")
+ (point))))
+ (add-text-properties beg end '(font-lock-multiline t))
+ (add-face-text-property beg end 'org-cite)
+ (dolist (reference (org-cite-get-references cite))
+ (let ((boundaries (org-cite-key-boundaries reference)))
+ (add-face-text-property (car boundaries) (cdr boundaries)
+ 'org-cite-key)))))
+
+(defun org-cite-activate (limit)
+ "Activate citations from up to LIMIT buffer position.
+Each citation encountered is activated using the appropriate function
+from the processor set in `org-cite-activate-processor'."
+ (let* ((name org-cite-activate-processor)
+ (activate
+ (or (and name
+ (org-cite-processor-has-capability-p name 'activate)
+ (org-cite-processor-activate (org-cite--get-processor name)))
+ #'org-cite-fontify-default)))
+ (when (re-search-forward org-element-citation-prefix-re limit t)
+ (let ((cite (org-with-point-at (match-beginning 0)
+ (org-element-citation-parser))))
+ (when cite
+ (funcall activate cite)
+ ;; Move after cite object and make sure to return
+ ;; a non-nil value.
+ (goto-char (org-element-property :end cite)))))))
+
+
+;;; Internal interface with Org Export library (export capability)
+(defun org-cite-store-bibliography (info)
+ "Store bibliography in the communication channel.
+
+Bibliography is stored as a list of absolute file names in the `:bibliography'
+property.
+
+INFO is the communication channel, as a plist. It is modified by side-effect."
+ (plist-put info :bibliography (org-cite-list-bibliography-files)))
+
+(defun org-cite-store-export-processor (info)
+ "Store export processor in the `:cite-export' property during export.
+
+Export processor is stored as a triplet, or nil.
+
+When non-nil, it is defined as (NAME BIBLIOGRAPHY-STYLE CITATION-STYLE) where
+NAME is a symbol, whereas BIBLIOGRAPHY-STYLE and CITATION-STYLE are strings,
+or nil.
+
+INFO is the communication channel, as a plist. It is modified by side-effect."
+ (let* ((err
+ (lambda (s)
+ (user-error "Invalid cite export processor definition: %S" s)))
+ (processor
+ (pcase (plist-get info :cite-export)
+ ((or "" `nil) nil)
+ ;; Value is a string. It comes from a "cite_export"
+ ;; keyword. It may contain between 1 and 3 tokens, the
+ ;; first one being a symbol and the other (optional) two,
+ ;; strings.
+ ((and (pred stringp) s)
+ (with-temp-buffer
+ (save-excursion (insert s))
+ (let ((result (list (read (current-buffer)))))
+ (dotimes (_ 2)
+ (skip-chars-forward " \t")
+ (cond
+ ((eobp) (push nil result))
+ ((char-equal ?\" (char-after))
+ (condition-case _
+ (push (org-not-nil (read (current-buffer))) result)
+ (error (funcall err s))))
+ (t
+ (let ((origin (point)))
+ (skip-chars-forward "^ \t")
+ (push (org-not-nil (buffer-substring origin (point)))
+ result)))))
+ (unless (eobp) (funcall err s))
+ (nreverse result))))
+ ;; Value is an alist. It must come from
+ ;; `org-cite-export-processors' variable. Find the most
+ ;; appropriate processor according to current export
+ ;; back-end.
+ ((and (pred consp) alist)
+ (let* ((backend (plist-get info :back-end))
+ (candidates
+ ;; Limit candidates to processors associated to
+ ;; back-ends derived from or equal to the current
+ ;; one.
+ (sort (seq-filter
+ (pcase-lambda (`(,key . ,_))
+ (org-export-derived-backend-p backend key))
+ alist)
+ (lambda (a b)
+ (org-export-derived-backend-p (car a) (car b))))))
+ ;; Select the closest candidate, or fallback to t.
+ (pcase (or (car candidates) (assq t alist))
+ ('nil nil)
+ (`(,_ . ,p)
+ ;; Normalize value by turning it into a triplet.
+ (pcase p
+ (`(,(pred symbolp))
+ (append p (list nil nil)))
+ (`(,(pred symbolp) ,(pred string-or-null-p))
+ (append p (list nil)))
+ (`(,(pred symbolp)
+ ,(pred string-or-null-p)
+ ,(pred string-or-null-p))
+ p)
+ (_ (funcall err p))))
+ (other (funcall err (cdr other))))))
+ (other (funcall err other)))))
+ (pcase processor
+ ('nil nil)
+ (`(,name . ,_)
+ (cond
+ ((not (org-cite--get-processor name))
+ (user-error "Unknown processor %S" name))
+ ((not (org-cite-processor-has-capability-p name 'export))
+ (user-error "Processor %S is unable to handle citation export" name)))))
+ (plist-put info :cite-export processor)))
+
+(defun org-cite-export-citation (citation _ info)
+ "Export CITATION object according to INFO property list.
+This function delegates the export of the current citation to the
+selected citation processor."
+ (pcase (plist-get info :cite-export)
+ ('nil nil)
+ (`(,p ,_ ,_)
+ (funcall (org-cite-processor-export-citation (org-cite--get-processor p))
+ citation
+ (org-cite-citation-style citation info)
+ (plist-get info :back-end)
+ info))
+ (other (error "Invalid `:cite-export' value: %S" other))))
+
+(defun org-cite-export-bibliography (keyword _ info)
+ "Return bibliography associated to \"print_bibliography\" KEYWORD.
+BACKEND is the export back-end, as a symbol. INFO is a plist
+used as a communication channel."
+ (pcase (plist-get info :cite-export)
+ ('nil nil)
+ (`(,p ,_ ,_)
+ (let ((export-bibilography
+ (org-cite-processor-export-bibliography
+ (org-cite--get-processor p))))
+ (when export-bibilography
+ (funcall export-bibilography
+ (org-cite-list-keys info)
+ (plist-get info :bibliography)
+ (org-cite-bibliography-style info)
+ (org-cite-bibliography-properties keyword)
+ (plist-get info :back-end)
+ info))))
+ (other (error "Invalid `:cite-export' value: %S" other))))
+
+(defun org-cite-process-citations (info)
+ "Replace all citations in the parse tree.
+INFO is the communication channel, as a plist. Parse tree is modified
+by side-effect."
+ (dolist (cite (org-cite-list-citations info))
+ (let ((replacement (org-cite-export-citation cite nil info))
+ (blanks (or (org-element-property :post-blank cite) 0)))
+ (if (null replacement)
+ ;; Before removing the citation, transfer its `:post-blank'
+ ;; property to the object before, if any.
+ (org-cite--set-previous-post-blank cite blanks info)
+ ;; Make sure there is a space between a quotation mark and
+ ;; a citation. This is particularly important when using
+ ;; `adaptive' note rule. See `org-cite-note-rules'.
+ (let ((previous (org-export-get-previous-element cite info)))
+ (when (and (org-string-nw-p previous)
+ (string-suffix-p "\"" previous))
+ (org-cite--set-previous-post-blank cite 1 info)))
+ (pcase replacement
+ ;; String.
+ ((pred stringp)
+ ;; Handle `:post-blank' before replacing value.
+ (let ((output (concat (org-trim replacement)
+ (make-string blanks ?\s))))
+ (org-element-insert-before (org-export-raw-string output) cite)))
+ ;; Single element.
+ (`(,(pred symbolp) . ,_)
+ (org-cite--set-post-blank replacement blanks)
+ (org-element-insert-before replacement cite))
+ ;; Secondary string: splice objects at cite's place.
+ ;; Transfer `:post-blank' to the last object.
+ ((pred consp)
+ (let ((last nil))
+ (dolist (datum replacement)
+ (setq last datum)
+ (org-element-insert-before datum cite))
+ (org-cite--set-post-blank last blanks)))
+ (_
+ (error "Invalid return value from citation export processor: %S"
+ replacement))))
+ (org-element-extract-element cite))))
+
+(defun org-cite-process-bibliography (info)
+ "Replace all \"print_bibliography\" keywords in the parse tree.
+
+INFO is the communication channel, as a plist. Parse tree is modified
+by side effect."
+ (org-element-map (plist-get info :parse-tree) 'keyword
+ (lambda (keyword)
+ (when (equal "PRINT_BIBLIOGRAPHY" (org-element-property :key keyword))
+ (let ((replacement (org-cite-export-bibliography keyword nil info))
+ (blanks (or (org-element-property :post-blank keyword) 0)))
+ (pcase replacement
+ ;; Before removing the citation, transfer its
+ ;; `:post-blank' property to the element before, if any.
+ ('nil
+ (org-cite--set-previous-post-blank keyword blanks info)
+ (org-element-extract-element keyword))
+ ;; Handle `:post-blank' before replacing keyword with string.
+ ((pred stringp)
+ (let ((output (concat (org-element-normalize-string replacement)
+ (make-string blanks ?\n))))
+ (org-element-set-element keyword (org-export-raw-string output))))
+ ;; List of elements: splice contents before keyword and
+ ;; remove the latter. Transfer `:post-blank' to last
+ ;; element.
+ ((and `(,(pred listp) . ,_) contents)
+ (let ((last nil))
+ (dolist (datum contents)
+ (setq last datum)
+ (org-element-insert-before datum keyword))
+ (org-cite--set-post-blank last blanks)
+ (org-element-extract-element keyword)))
+ ;; Single element: replace the keyword.
+ (`(,(pred symbolp) . ,_)
+ (org-cite--set-post-blank replacement blanks)
+ (org-element-set-element keyword replacement))
+ (_
+ (error "Invalid return value from citation export processor: %S"
+ replacement))))))
+ info))
+
+(defun org-cite-finalize-export (output info)
+ "Finalizer for export process.
+OUTPUT is the full output of the export process. INFO is the communication
+channel, as a property list."
+ (pcase (plist-get info :cite-export)
+ ('nil output)
+ (`(,p ,_ ,_)
+ (let ((finalizer
+ (org-cite-processor-export-finalizer (org-cite--get-processor p))))
+ (if (not finalizer)
+ output
+ (funcall finalizer
+ output
+ (org-cite-list-keys info)
+ (plist-get info :bibliography)
+ (org-cite-bibliography-style info)
+ (plist-get info :back-end)
+ info))))
+ (other (error "Invalid `:cite-export' value: %S" other))))
+
+
+;;; Internal interface with `org-open-at-point' (follow capability)
+(defun org-cite-follow (datum arg)
+ "Follow citation or citation-reference DATUM.
+Following is done according to the processor set in `org-cite-follow-processor'.
+ARG is the prefix argument received when calling `org-open-at-point', or nil."
+ (let ((name org-cite-follow-processor))
+ (cond
+ ((null name)
+ (user-error "No processor set to follow citations"))
+ ((not (org-cite--get-processor name))
+ (user-error "Unknown processor %S" name))
+ ((not (org-cite-processor-has-capability-p name 'follow))
+ (user-error "Processor %S cannot follow citations" name))
+ (t
+ (let ((follow (org-cite-processor-follow (org-cite--get-processor name))))
+ (funcall follow datum arg))))))
+
+
+;;; Meta-command for citation insertion (insert capability)
+(defun org-cite--allowed-p (context)
+ "Non-nil when a citation can be inserted at point.
+CONTEXT is the element or object at point, as returned by `org-element-context'."
+ (let ((type (org-element-type context)))
+ (cond
+ ;; No citation in attributes, except in parsed ones.
+ ;;
+ ;; XXX: Inserting citation in a secondary value is not allowed
+ ;; yet. Is it useful?
+ ((let ((post (org-element-property :post-affiliated context)))
+ (and post (< (point) post)))
+ (let ((case-fold-search t))
+ (looking-back
+ (rx-to-string
+ `(seq line-start (0+ (any " \t"))
+ "#+"
+ (or ,@org-element-parsed-keywords)
+ ":"
+ (0+ nonl))
+ t)
+ (line-beginning-position))))
+ ;; Paragraphs and blank lines at top of document are fine.
+ ((memq type '(nil paragraph)))
+ ;; So are contents of verse blocks.
+ ((eq type 'verse-block)
+ (and (>= (point) (org-element-property :contents-begin context))
+ (< (point) (org-element-property :contents-end context))))
+ ;; In an headline or inlinetask, point must be either on the
+ ;; heading itself or on the blank lines below.
+ ((memq type '(headline inlinetask))
+ (or (not (org-at-heading-p))
+ (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))))))
+ ;; White spaces after an object or blank lines after an element
+ ;; are OK.
+ ((>= (point)
+ (save-excursion (goto-char (org-element-property :end context))
+ (skip-chars-backward " \r\t\n")
+ (if (eq (org-element-class context) 'object) (point)
+ (line-beginning-position 2)))))
+ ;; At the beginning of a footnote definition, right after the
+ ;; label, is OK.
+ ((eq type 'footnote-definition) (looking-at (rx space)))
+ ;; At the start of a list item is fine, as long as the bullet is
+ ;; unaffected.
+ ((eq type 'item)
+ (> (point) (+ (org-element-property :begin context)
+ (current-indentation)
+ (if (org-element-property :checkbox context)
+ 5 1))))
+ ;; Other elements are invalid.
+ ((eq (org-element-class context) 'element) nil)
+ ;; Just before object is fine.
+ ((= (point) (org-element-property :begin context)))
+ ;; Within recursive object too, but not in a link.
+ ((eq type 'link) nil)
+ ((eq type 'table-cell)
+ ;; :contents-begin is not reliable on empty cells, so special
+ ;; case it.
+ (<= (save-excursion (skip-chars-backward " \t") (point))
+ (org-element-property :contents-end context)))
+ ((let ((cbeg (org-element-property :contents-begin context))
+ (cend (org-element-property :contents-end context)))
+ (and cbeg (>= (point) cbeg) (<= (point) cend)))))))
+
+(defun org-cite--insert-string-before (string reference)
+ "Insert STRING before citation REFERENCE object."
+ (org-with-point-at (org-element-property :begin reference)
+ (insert string ";")))
+
+(defun org-cite--insert-string-after (string reference)
+ "Insert STRING after citation REFERENCE object."
+ (org-with-point-at (org-element-property :end reference)
+ ;; Make sure to move forward when we're inserting at point, so the
+ ;; insertion can happen multiple times.
+ (if (char-equal ?\; (char-before))
+ (insert-before-markers string ";")
+ (insert-before-markers ";" string))))
+
+(defun org-cite--keys-to-citation (keys)
+ "Build a citation object from a list of citation KEYS.
+Citation keys are strings without the leading \"@\"."
+ (apply #'org-element-create
+ 'citation
+ nil
+ (mapcar (lambda (k)
+ (org-element-create 'citation-reference (list :key k)))
+ keys)))
+
+(defun org-cite-make-insert-processor (select-key select-style)
+ "Build a function appropriate as an insert processor.
+
+SELECT-KEY is a function called with one argument. When it is nil, the function
+should return a citation key as a string, or nil. Otherwise, the function
+should return a list of such keys, or nil. The keys should not have any leading
+\"@\" character.
+
+SELECT-STYLE is a function called with one argument, the citation object being
+edited or constructed so far. It should return a style string, or nil.
+
+The return value is a function of two arguments: CONTEXT and ARG. CONTEXT is
+either a citation reference, a citation object, or nil. ARG is a prefix
+argument.
+
+The generated function inserts or edit a citation at point. More specifically,
+
+ On a citation reference:
+
+ - on the prefix or right before the \"@\" character, insert a new reference
+ before the current one,
+ - on the suffix, insert it after the reference,
+ - otherwise, update the cite key, preserving both affixes.
+
+ When ARG is non-nil, remove the reference, possibly removing the whole
+ citation if it contains a single reference.
+
+ On a citation object:
+
+ - on the style part, offer to update it,
+ - on the global prefix, add a new reference before the first one,
+ - on the global suffix, add a new reference after the last one,
+
+ Elsewhere, insert a citation at point. When ARG is non-nil, offer to complete
+ style in addition to references."
+ (unless (and (functionp select-key) (functionp select-style))
+ (error "Wrong argument type(s)"))
+ (lambda (context arg)
+ (pcase (org-element-type context)
+ ;; When on a citation, check point is not on the blanks after it.
+ ;; Otherwise, consider we're after it.
+ ((and 'citation
+ (guard
+ (let ((boundaries (org-cite-boundaries context)))
+ (and (< (point) (cdr boundaries))
+ (> (point) (car boundaries))))))
+ ;; When ARG is non-nil, delete the whole citation. Otherwise,
+ ;; action depends on the point.
+ (if arg
+ (org-cite-delete-citation context)
+ (let* ((begin (org-element-property :begin context))
+ (style-end (1- (org-with-point-at begin (search-forward ":")))))
+ (if (>= style-end (point))
+ ;; On style part, edit the style.
+ (let ((style-start (+ 5 begin))
+ (style (funcall select-style)))
+ (unless style (user-error "Aborted"))
+ (org-with-point-at style-start
+ (delete-region style-start style-end)
+ (when (org-string-nw-p style) (insert "/" style))))
+ ;; On an affix, insert a new reference before or after
+ ;; point.
+ (let* ((references (org-cite-get-references context))
+ (key (concat "@" (funcall select-key nil))))
+ (if (< (point) (org-element-property :contents-begin context))
+ (org-cite--insert-string-before key (car references))
+ (org-cite--insert-string-after key (org-last references))))))))
+ ;; On a citation reference. If ARG is not nil, remove the
+ ;; reference. Otherwise, action depends on the point.
+ ((and 'citation-reference (guard arg)) (org-cite-delete-citation context))
+ ('citation-reference
+ (pcase-let* ((`(,start . ,end) (org-cite-key-boundaries context))
+ (key (concat "@"
+ (or (funcall select-key nil)
+ (user-error "Aborted")))))
+ ;; Right before the "@" character, do not replace the reference
+ ;; at point, but insert a new one before it. It makes adding
+ ;; a new reference at the beginning easier in the following
+ ;; case: [cite:@key].
+ (cond
+ ((>= start (point)) (org-cite--insert-string-before key context))
+ ((<= end (point)) (org-cite--insert-string-after key context))
+ (t
+ (org-with-point-at start
+ (delete-region start end)
+ (insert key))))))
+ (_
+ (let ((keys (funcall select-key t)))
+ (unless keys (user-error "Aborted"))
+ (insert
+ (format "[cite%s:%s]"
+ (if arg
+ (let ((style (funcall select-style
+ (org-cite--keys-to-citation keys))))
+ (if (org-string-nw-p style)
+ (concat "/" style)
+ ""))
+ "")
+ (mapconcat (lambda (k) (concat "@" k)) keys "; "))))))))
+
+;;;###autoload
+(defun org-cite-insert (arg)
+ "Insert a citation at point.
+Insertion is done according to the processor set in `org-cite-insert-processor'.
+ARG is the prefix argument received when calling interactively the function."
+ (interactive "P")
+ (let ((name org-cite-insert-processor))
+ (cond
+ ((null name)
+ (user-error "No processor set to insert citations"))
+ ((not (org-cite--get-processor name))
+ (user-error "Unknown processor %S" name))
+ ((not (org-cite-processor-has-capability-p name 'insert))
+ (user-error "Processor %S cannot insert citations" name))
+ (t
+ (let ((context (org-element-context))
+ (insert (org-cite-processor-insert (org-cite--get-processor name))))
+ (cond
+ ((memq (org-element-type context) '(citation citation-reference))
+ (funcall insert context arg))
+ ((org-cite--allowed-p context)
+ (funcall insert nil arg))
+ (t
+ (user-error "Cannot insert a citation here"))))))))
+
+(provide 'oc)
+;;; oc.el ends here
diff --git a/elpa/org-9.5.2/oc.elc b/elpa/org-9.5.2/oc.elc
new file mode 100644
index 0000000..57a3282
--- /dev/null
+++ b/elpa/org-9.5.2/oc.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ol-bbdb.el b/elpa/org-9.5.2/ol-bbdb.el
new file mode 100644
index 0000000..f697f1f
--- /dev/null
+++ b/elpa/org-9.5.2/ol-bbdb.el
@@ -0,0 +1,546 @@
+;;; ol-bbdb.el --- Links to BBDB entries -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+;; Authors: Carsten Dominik <carsten.dominik@gmail.com>
+;; Thomas Baumann <thomas dot baumann at ch dot tum dot de>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file implements links to BBDB database entries from within Org.
+;; Org mode loads this module by default - if this is not what you want,
+;; configure the variable `org-modules'.
+
+;; It also implements an interface (based on Ivar Rummelhoff's
+;; bbdb-anniv.el) for those Org users, who do not use the diary
+;; but who do want to include the anniversaries stored in the BBDB
+;; into the org-agenda. If you already include the `diary' into the
+;; agenda, you might want to prefer to include the anniversaries in
+;; the diary using bbdb-anniv.el.
+;;
+;; Put the following in /somewhere/at/home/diary.org and make sure
+;; that this file is in `org-agenda-files'.
+;;
+;; %%(org-bbdb-anniversaries)
+;;
+;; For example my diary.org looks like:
+;; * Anniversaries
+;; #+CATEGORY: Anniv
+;; %%(org-bbdb-anniversaries)
+;;
+;;
+;; To add an anniversary to a BBDB record, press `C-o' in the record.
+;; You will be prompted for the field name, in this case it must be
+;; "anniversary". If this is the first time you are using this field,
+;; you need to confirm that it should be created.
+;;
+;; The format of an anniversary field stored in BBDB is the following
+;; (items in {} are optional):
+;;
+;; YYYY-MM-DD{ CLASS-OR-FORMAT-STRING}
+;; {\nYYYY-MM-DD CLASS-OR-FORMAT-STRING}...
+;;
+;; CLASS-OR-FORMAT-STRING is one of two things:
+;;
+;; - an identifier for a class of anniversaries (e.g. birthday or
+;; wedding) from `org-bbdb-anniversary-format-alist' which then
+;; defines the format string for this class
+;; - the (format) string displayed in the diary.
+;;
+;; You can enter multiple anniversaries for a single BBDB record by
+;; separating them with a newline character. At the BBDB prompt for
+;; the field value, type `C-q C-j' to enter a newline between two
+;; anniversaries.
+;;
+;; If you omit the CLASS-OR-FORMAT-STRING entirely, it defaults to the
+;; value of `org-bbdb-default-anniversary-format' ("birthday" by
+;; default).
+;;
+;; The substitutions in the format string are (in order):
+;; - the name of the record containing this anniversary
+;; - the number of years
+;; - an ordinal suffix (st, nd, rd, th) for the year
+;;
+;; See the documentation of `org-bbdb-anniversary-format-alist' for
+;; further options.
+;;
+;; Example
+;;
+;; 1973-06-22
+;; 20??-??-?? wedding
+;; 1998-03-12 %s created bbdb-anniv.el %d years ago
+;;
+;; From Org's agenda, you can use `C-c C-o' to jump to the BBDB
+;; link from which the entry at point originates.
+;;
+;;; Code:
+
+(require 'cl-lib)
+(require 'org-compat)
+(require 'org-macs)
+(require 'ol)
+
+;;; Declare functions and variables
+
+(declare-function bbdb "ext:bbdb-com" (string elidep))
+(declare-function bbdb-company "ext:bbdb-com" (string elidep))
+(declare-function bbdb-current-record "ext:bbdb-com" (&optional planning-on-modifying))
+(declare-function bbdb-name "ext:bbdb-com" (string elidep))
+(declare-function bbdb-completing-read-record "ext:bbdb-com" (prompt &optional omit-records))
+(declare-function bbdb-record-field "ext:bbdb" (record field))
+(declare-function bbdb-record-getprop "ext:bbdb" (record property))
+(declare-function bbdb-record-name "ext:bbdb" (record))
+(declare-function bbdb-records "ext:bbdb" (&optional dont-check-disk already-in-db-buffer))
+(declare-function bbdb-split "ext:bbdb" (string separators))
+(declare-function bbdb-string-trim "ext:bbdb" (string))
+(declare-function bbdb-record-get-field "ext:bbdb" (record field))
+(declare-function bbdb-search-name "ext:bbdb-com" (regexp &optional layout))
+(declare-function bbdb-search-organization "ext:bbdb-com" (regexp &optional layout))
+
+;; `bbdb-record-note' was part of BBDB v3.x
+(declare-function bbdb-record-note "ext:bbdb" (record label))
+;; `bbdb-record-xfield' replaces it in recent BBDB v3.x+
+(declare-function bbdb-record-xfield "ext:bbdb" (record label))
+
+(declare-function calendar-absolute-from-gregorian "calendar" (date))
+(declare-function calendar-gregorian-from-absolute "calendar" (date))
+(declare-function calendar-leap-year-p "calendar" (year))
+
+(declare-function diary-ordinal-suffix "diary-lib" (n))
+
+(with-no-warnings (defvar date)) ; unprefixed, from calendar.el
+
+;;; Customization
+
+(defgroup org-bbdb-anniversaries nil
+ "Customizations for including anniversaries from BBDB into Agenda."
+ :group 'org-bbdb)
+
+(defcustom org-bbdb-default-anniversary-format "birthday"
+ "Default anniversary class."
+ :type 'string
+ :group 'org-bbdb-anniversaries
+ :require 'bbdb)
+
+(defcustom org-bbdb-general-anniversary-description-after 7
+ "When to switch anniversary descriptions to a more general format.
+
+Anniversary descriptions include the point in time, when the
+anniversary appears. This is, in its most general form, just the
+date of the anniversary. Or more specific terms, like \"today\",
+\"tomorrow\" or \"in n days\" are used to describe the time span.
+
+If the anniversary happens in less than that number of days, the
+specific description is used. Otherwise, the general one is
+used."
+ :group 'org-bbdb-anniversaries
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :type 'integer
+ :require 'bbdb
+ :safe #'integerp)
+
+(defcustom org-bbdb-anniversary-format-alist
+ '(("birthday" .
+ (lambda (name years suffix)
+ (concat "Birthday: [[bbdb:" name "][" name " ("
+ (format "%s" years) ; handles numbers as well as strings
+ suffix ")]]")))
+ ("wedding" .
+ (lambda (name years suffix)
+ (concat "[[bbdb:" name "][" name "'s "
+ (format "%s" years)
+ suffix " wedding anniversary]]"))))
+ "How different types of anniversaries should be formatted.
+An alist of elements (STRING . FORMAT) where STRING is the name of an
+anniversary class and format is either:
+1) A format string with the following substitutions (in order):
+ - the name of the record containing this anniversary
+ - the number of years
+ - an ordinal suffix (st, nd, rd, th) for the year
+
+2) A function to be called with three arguments: NAME YEARS SUFFIX
+ (string int string) returning a string for the diary or nil.
+
+3) An Emacs Lisp form that should evaluate to a string (or nil) in the
+ scope of variables NAME, YEARS and SUFFIX (among others)."
+ :type '(alist :key-type (string :tag "Class")
+ :value-type (function :tag "Function"))
+ :group 'org-bbdb-anniversaries
+ :require 'bbdb)
+
+(defcustom org-bbdb-anniversary-field 'anniversary
+ "The BBDB field which contains anniversaries.
+The anniversaries are stored in the following format
+
+YYYY-MM-DD Class-or-Format-String
+
+where class is one of the customized classes for anniversaries;
+birthday and wedding are predefined. Format-String can take three
+substitutions 1) the name of the record containing this
+anniversary, 2) the number of years, and 3) an ordinal suffix for
+the year.
+
+Multiple anniversaries can be separated by \\n."
+ :type 'symbol
+ :group 'org-bbdb-anniversaries
+ :require 'bbdb)
+
+(defcustom org-bbdb-extract-date-fun 'org-bbdb-anniv-extract-date
+ "How to retrieve `month date year' from the anniversary field.
+
+Customize if you have already filled your BBDB with dates
+different from YYYY-MM-DD. The function must return a list (month
+date year)."
+ :type 'function
+ :group 'org-bbdb-anniversaries
+ :require 'bbdb)
+
+;; Install the link type
+(org-link-set-parameters "bbdb"
+ :follow #'org-bbdb-open
+ :export #'org-bbdb-export
+ :complete #'org-bbdb-complete-link
+ :store #'org-bbdb-store-link)
+
+;;; Implementation
+
+(defun org-bbdb-store-link ()
+ "Store a link to a BBDB database entry."
+ (when (eq major-mode 'bbdb-mode)
+ ;; This is BBDB, we make this link!
+ (let* ((rec (bbdb-current-record))
+ (name (bbdb-record-name rec))
+ (company (if (fboundp 'bbdb-record-getprop)
+ (bbdb-record-getprop rec 'company)
+ (car (bbdb-record-field rec 'organization))))
+ (link (concat "bbdb:" name)))
+ (org-link-store-props :type "bbdb" :name name :company company
+ :link link :description name)
+ link)))
+
+(defun org-bbdb-export (path desc format _)
+ "Create the export version of a BBDB link specified by PATH or DESC.
+If exporting to either HTML or LaTeX FORMAT the link will be
+italicized, in all other cases it is left unchanged."
+ (when (string= desc (format "bbdb:%s" path))
+ (setq desc path))
+ (cond
+ ((eq format 'html) (format "<i>%s</i>" desc))
+ ((eq format 'latex) (format "\\textit{%s}" desc))
+ ((eq format 'odt)
+ (format "<text:span text:style-name=\"Emphasis\">%s</text:span>" desc))
+ (t desc)))
+
+(defun org-bbdb-open (name _)
+ "Follow a BBDB link to NAME."
+ (require 'bbdb-com)
+ (let ((inhibit-redisplay (not debug-on-error)))
+ (if (fboundp 'bbdb-name)
+ (org-bbdb-open-old name)
+ (org-bbdb-open-new name))))
+
+(defun org-bbdb-open-old (name)
+ (catch 'exit
+ ;; Exact match on name
+ (bbdb-name (concat "\\`" name "\\'") nil)
+ (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
+ ;; Exact match on name
+ (bbdb-company (concat "\\`" name "\\'") nil)
+ (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
+ ;; Partial match on name
+ (bbdb-name name nil)
+ (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
+ ;; Partial match on company
+ (bbdb-company name nil)
+ (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
+ ;; General match including network address and notes
+ (bbdb name nil)
+ (when (= 0 (buffer-size (get-buffer "*BBDB*")))
+ (delete-window (get-buffer-window "*BBDB*"))
+ (error "No matching BBDB record"))))
+
+(defun org-bbdb-open-new (name)
+ (catch 'exit
+ ;; Exact match on name
+ (bbdb-search-name (concat "\\`" name "\\'") nil)
+ (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
+ ;; Exact match on name
+ (bbdb-search-organization (concat "\\`" name "\\'") nil)
+ (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
+ ;; Partial match on name
+ (bbdb-search-name name nil)
+ (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
+ ;; Partial match on company
+ (bbdb-search-organization name nil)
+ (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
+ ;; General match including network address and notes
+ (bbdb name nil)
+ (when (= 0 (buffer-size (get-buffer "*BBDB*")))
+ (delete-window (get-buffer-window "*BBDB*"))
+ (error "No matching BBDB record"))))
+
+(defun org-bbdb-anniv-extract-date (time-str)
+ "Convert YYYY-MM-DD to (month date year).
+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) (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)))))
+
+(defun org-bbdb-anniv-split (str)
+ "Split multiple entries in the BBDB anniversary field.
+Argument STR is the anniversary field in BBDB."
+ (let ((pos (string-match "[ \t]" str)))
+ (if pos (list (substring str 0 pos)
+ (bbdb-string-trim (substring str pos)))
+ (list str nil))))
+
+(defvar org-bbdb-anniv-hash nil
+ "A hash holding anniversaries extracted from BBDB.
+The hash table is created on first use.")
+
+(defvar org-bbdb-updated-p t
+ "This is non-nil if BBDB has been updated since we last built the hash.")
+
+(defun org-bbdb-make-anniv-hash ()
+ "Create a hash with anniversaries extracted from BBDB, for fast access.
+The anniversaries are assumed to be stored `org-bbdb-anniversary-field'."
+ (let ((old-bbdb (fboundp 'bbdb-record-getprop))
+ (record-func (if (fboundp 'bbdb-record-xfield)
+ 'bbdb-record-xfield
+ 'bbdb-record-note))
+ split tmp annivs)
+ (clrhash org-bbdb-anniv-hash)
+ (dolist (rec (bbdb-records))
+ (when (setq annivs (if old-bbdb
+ (bbdb-record-getprop
+ rec org-bbdb-anniversary-field)
+ (funcall record-func
+ rec org-bbdb-anniversary-field)))
+ (setq annivs (if old-bbdb
+ (bbdb-split annivs "\n")
+ ;; parameter order is reversed in new bbdb
+ (bbdb-split "\n" annivs)))
+ (while annivs
+ (setq split (org-bbdb-anniv-split (pop annivs)))
+ (pcase-let ((`(,m ,d ,y) (funcall org-bbdb-extract-date-fun
+ (car split))))
+ (setq tmp (gethash (list m d) org-bbdb-anniv-hash))
+ (puthash (list m d) (cons (list y
+ (bbdb-record-name rec)
+ (cadr split))
+ tmp)
+ org-bbdb-anniv-hash))))))
+ (setq org-bbdb-updated-p nil))
+
+(defun org-bbdb-updated (_rec)
+ "Record the fact that BBDB has been updated.
+This is used by Org to re-create the anniversary hash table."
+ (setq org-bbdb-updated-p t))
+
+(add-hook 'bbdb-after-change-hook 'org-bbdb-updated)
+
+;;;###autoload
+(defun org-bbdb-anniversaries ()
+ "Extract anniversaries from BBDB for display in the agenda.
+When called programmatically, this function expects the `date'
+variable to be globally bound."
+ (require 'bbdb)
+ (require 'diary-lib)
+ (unless (hash-table-p org-bbdb-anniv-hash)
+ (setq org-bbdb-anniv-hash
+ (make-hash-table :test 'equal :size 366)))
+
+ (when (or org-bbdb-updated-p
+ (= 0 (hash-table-count org-bbdb-anniv-hash)))
+ (org-bbdb-make-anniv-hash))
+
+ (let* ((m (car date)) ; month
+ (d (nth 1 date)) ; day
+ (y (nth 2 date)) ; year
+ (annivs (gethash (list m d) org-bbdb-anniv-hash))
+ (text ())
+ rec recs)
+
+ ;; We don't want to miss people born on Feb. 29th
+ (when (and (= m 3) (= d 1)
+ (not (null (gethash (list 2 29) org-bbdb-anniv-hash)))
+ (not (calendar-leap-year-p y)))
+ (setq recs (gethash (list 2 29) org-bbdb-anniv-hash))
+ (while (setq rec (pop recs))
+ (push rec annivs)))
+
+ (when annivs
+ (while (setq rec (pop annivs))
+ (when rec
+ (let* ((class (or (nth 2 rec)
+ org-bbdb-default-anniversary-format))
+ (form (or (cdr (assoc-string
+ class org-bbdb-anniversary-format-alist t))
+ class)) ; (as format string)
+ (name (nth 1 rec))
+ (years (if (eq (car rec) nil)
+ "unknown"
+ (- y (car rec))))
+ (suffix (if (eq (car rec) nil)
+ ""
+ (diary-ordinal-suffix years)))
+ (tmp (cond
+ ((functionp form)
+ (funcall form name years suffix))
+ ((listp form) (eval form))
+ (t (format form name years suffix)))))
+ (org-add-props tmp nil 'org-bbdb-name name)
+ (if text
+ (setq text (append text (list tmp)))
+ (setq text (list tmp)))))
+ ))
+ text))
+
+;;; Return the list of anniversaries for today and the next n-1
+;;; (default: n=7) days. This is meant to be used in an org file
+;;; instead of org-bbdb-anniversaries:
+;;;
+;;; %%(org-bbdb-anniversaries-future)
+;;;
+;;; or
+;;;
+;;; %%(org-bbdb-anniversaries-future 3)
+;;;
+;;; to override the 7-day default.
+
+(defun org-bbdb-date-list (d n)
+ "Return list of dates in (m d y) format from the given date D to n-1 days hence."
+ (let ((abs (calendar-absolute-from-gregorian d)))
+ (mapcar (lambda (i) (calendar-gregorian-from-absolute (+ abs i)))
+ (number-sequence 0 (1- n)))))
+
+(defun org-bbdb-anniversary-description (agenda-date anniv-date)
+ "Return a string used to incorporate into an agenda anniversary entry.
+The calculation of the anniversary description string is based on
+the difference between the anniversary date, given as ANNIV-DATE,
+and the date on which the entry appears in the agenda, given as
+AGENDA-DATE. This makes it possible to have different entries
+for the same event depending on if it occurs in the next few days
+or far away in the future."
+ (let ((delta (- (calendar-absolute-from-gregorian anniv-date)
+ (calendar-absolute-from-gregorian agenda-date))))
+ (cond
+ ((= delta 0) " -- today\\&")
+ ((= delta 1) " -- tomorrow\\&")
+ ((< delta org-bbdb-general-anniversary-description-after)
+ (format " -- in %d days\\&" delta))
+ ((pcase-let ((`(,month ,day ,year) anniv-date))
+ (format " -- %d-%02d-%02d\\&" year month day))))))
+
+(defun org-bbdb-anniversaries-future (&optional n)
+ "Return list of anniversaries for today and the next n-1 days (default n=7)."
+ (let ((n (or n 7)))
+ (when (<= n 0)
+ (error "The (optional) argument of `org-bbdb-anniversaries-future' \
+must be positive"))
+ (let (
+ ;; List of relevant dates.
+ (dates (org-bbdb-date-list date n))
+ ;; Function to annotate text of each element of l with the
+ ;; anniversary date d.
+ (annotate-descriptions
+ (lambda (agenda-date d l)
+ (mapcar (lambda (x)
+ ;; The assumption here is that x is a bbdb link
+ ;; of the form [[bbdb:name][description]].
+ ;; This function rather arbitrarily modifies
+ ;; the description by adding the date to it in
+ ;; a fixed format.
+ (let ((desc (org-bbdb-anniversary-description
+ agenda-date d)))
+ (string-match "]]" x)
+ (replace-match desc nil nil x)))
+ l))))
+ ;; Map a function that generates anniversaries for each date
+ ;; over the dates and nconc the results into a single list. When
+ ;; it is no longer necessary to support older versions of Emacs,
+ ;; this can be done with a cl-mapcan; for now, we use the (apply
+ ;; #'nconc ...) method for compatibility.
+ (apply #'nconc
+ (mapcar
+ (lambda (d)
+ (let ((agenda-date date)
+ (date d))
+ ;; Rebind 'date' so that org-bbdb-anniversaries will
+ ;; be fooled into giving us the list for the given
+ ;; date and then annotate the descriptions for that
+ ;; date.
+ (funcall annotate-descriptions agenda-date d (org-bbdb-anniversaries))))
+ dates)))))
+
+(defun org-bbdb-complete-link ()
+ "Read a bbdb link with name completion."
+ (require 'bbdb-com)
+ (let ((rec (bbdb-completing-read-record "Name: ")))
+ (concat "bbdb:"
+ (bbdb-record-name (if (listp rec)
+ (car rec)
+ rec)))))
+
+(defun org-bbdb-anniv-export-ical ()
+ "Extract anniversaries from BBDB and convert them to icalendar format."
+ (require 'bbdb)
+ (require 'diary-lib)
+ (unless (hash-table-p org-bbdb-anniv-hash)
+ (setq org-bbdb-anniv-hash
+ (make-hash-table :test 'equal :size 366)))
+ (when (or org-bbdb-updated-p
+ (= 0 (hash-table-count org-bbdb-anniv-hash)))
+ (org-bbdb-make-anniv-hash))
+ (maphash 'org-bbdb-format-vevent org-bbdb-anniv-hash))
+
+(defun org-bbdb-format-vevent (key recs)
+ (let (rec categ)
+ (while (setq rec (pop recs))
+ (setq categ (or (nth 2 rec) org-bbdb-default-anniversary-format))
+ (princ (format "BEGIN:VEVENT
+UID: ANNIV-%4i%02i%02i-%s
+DTSTART:%4i%02i%02i
+SUMMARY:%s
+DESCRIPTION:%s
+CATEGORIES:%s
+RRULE:FREQ=YEARLY
+END:VEVENT\n"
+ (nth 0 rec) (nth 0 key) (nth 1 key)
+ (mapconcat 'identity
+ (org-split-string (nth 1 rec) "[^a-zA-Z0-90]+")
+ "-")
+ (nth 0 rec) (nth 0 key) (nth 1 key)
+ (nth 1 rec)
+ (concat (capitalize categ) " " (nth 1 rec))
+ categ)))))
+
+(provide 'ol-bbdb)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ol-bbdb.el ends here
diff --git a/elpa/org-9.5.2/ol-bbdb.elc b/elpa/org-9.5.2/ol-bbdb.elc
new file mode 100644
index 0000000..f0df437
--- /dev/null
+++ b/elpa/org-9.5.2/ol-bbdb.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ol-bibtex.el b/elpa/org-9.5.2/ol-bibtex.el
new file mode 100644
index 0000000..476095d
--- /dev/null
+++ b/elpa/org-9.5.2/ol-bibtex.el
@@ -0,0 +1,770 @@
+;;; ol-bibtex.el --- Links to BibTeX entries -*- lexical-binding: t; -*-
+;;
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
+;;
+;; Authors: Bastien Guerry <bzg@gnu.org>
+;; Carsten Dominik <carsten dot dominik at gmail dot com>
+;; Eric Schulte <schulte dot eric at gmail dot com>
+;; Keywords: org, wp, capture
+;;
+;; 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 <https://www.gnu.org/licenses/>.
+;;
+;;; Commentary:
+;;
+;; This file implements links to database entries in BibTeX files.
+;; Instead of defining a special link prefix, it uses the normal file
+;; links combined with a custom search mechanism to find entries
+;; by reference key. And it constructs a nice description tag for
+;; the link that contains the author name, the year and a short title.
+;;
+;; It also stores detailed information about the entry so that
+;; capture templates can access and enter this information easily.
+;;
+;; The available properties for each entry are listed here:
+;;
+;; :author :publisher :volume :pages
+;; :editor :url :number :journal
+;; :title :year :series :address
+;; :booktitle :month :annote :abstract
+;; :key :btype
+;;
+;; Here is an example of a capture template that use some of this
+;; information (:author :year :title :journal :pages):
+;;
+;; (setq org-capture-templates
+;; '((?b "* READ %?\n\n%a\n\n%:author (%:year): %:title\n \
+;; In %:journal, %:pages.")))
+;;
+;; Let's say you want to capture this BibTeX entry:
+;;
+;; @Article{dolev83,
+;; author = {Danny Dolev and Andrew C. Yao},
+;; title = {On the security of public-key protocols},
+;; journal = {IEEE Transaction on Information Theory},
+;; year = 1983,
+;; volume = 2,
+;; number = 29,
+;; pages = {198--208},
+;; month = {Mars}
+;; }
+;;
+;; M-x `org-capture' on this entry will produce this buffer:
+;;
+;; =====================================================================
+;; * READ <== [point here]
+;;
+;; [[file:file.bib::dolev83][Dolev & Yao 1983: security of public key protocols]]
+;;
+;; Danny Dolev and Andrew C. Yao (1983): On the security of public-key protocols
+;; In IEEE Transaction on Information Theory, 198--208.
+;; =====================================================================
+;;
+;; Additionally, the following functions are now available for storing
+;; bibtex entries within Org documents.
+;;
+;; - Run `org-bibtex' to export the current file to a .bib.
+;;
+;; - Run `org-bibtex-check' or `org-bibtex-check-all' to check and
+;; fill in missing field of either the current, or all headlines
+;;
+;; - Run `org-bibtex-create' to add a bibtex entry
+;;
+;; - Use `org-bibtex-read' to read a bibtex entry after `point' or in
+;; the active region, then call `org-bibtex-write' in a .org file to
+;; insert a heading for the read bibtex entry
+;;
+;; - All Bibtex information is taken from the document compiled by
+;; Andrew Roberts from the Bibtex manual, available at
+;; https://www.andy-roberts.net/res/writing/latex/bibentries.pdf
+;;
+;;; History:
+;;
+;; The link creation part has been part of Org for a long time.
+;;
+;; Creating better capture template information was inspired by a request
+;; of Austin Frank: https://orgmode.org/list/m0myu03vbx.fsf@gmail.com
+;; and then implemented by Bastien Guerry.
+;;
+;; Eric Schulte eventually added the functions for translating between
+;; Org headlines and Bibtex entries, and for fleshing out the Bibtex
+;; fields of existing Org headlines.
+;;
+;; Org mode loads this module by default - if this is not what you want,
+;; configure the variable `org-modules'.
+
+;;; Code:
+
+(require 'bibtex)
+(require 'cl-lib)
+(require 'org-compat)
+(require 'org-macs)
+(require 'ol)
+
+(defvar org-agenda-overriding-header)
+(defvar org-agenda-search-view-always-boolean)
+(defvar org-bibtex-description nil) ; dynamically scoped from org.el
+(defvar org-id-locations)
+(defvar org-property-end-re)
+(defvar org-special-properties)
+(defvar org-window-config-before-follow-link)
+
+(declare-function bibtex-beginning-of-entry "bibtex" ())
+(declare-function bibtex-generate-autokey "bibtex" ())
+(declare-function bibtex-parse-entry "bibtex" (&optional content))
+(declare-function bibtex-url "bibtex" (&optional pos no-browse))
+
+(declare-function org-back-to-heading "org" (&optional invisible-ok))
+(declare-function org-entry-get "org" (pom property &optional inherit literal-nil))
+(declare-function org-entry-properties "org" (&optional pom which))
+(declare-function org-get-tags "org" (&optional pos local))
+(declare-function org-heading-components "org" ())
+(declare-function org-insert-heading "org" (&optional arg invisible-ok top))
+(declare-function org-map-entries "org" (func &optional match scope &rest skip))
+(declare-function org-narrow-to-subtree "org" ())
+(declare-function org-set-property "org" (property value))
+(declare-function org-toggle-tag "org" (tag &optional onoff))
+
+(declare-function org-search-view "org-agenda" (&optional todo-only string edit-at))
+
+
+;;; Bibtex data
+(defvar org-bibtex-types
+ '((:article
+ (:description . "An article from a journal or magazine")
+ (:required :author :title :journal :year)
+ (:optional :volume :number :pages :month :note :doi))
+ (:book
+ (:description . "A book with an explicit publisher")
+ (:required (:editor :author) :title :publisher :year)
+ (:optional (:volume :number) :series :address :edition :month :note :doi))
+ (:booklet
+ (:description . "A work that is printed and bound, but without a named publisher or sponsoring institution.")
+ (:required :title)
+ (:optional :author :howpublished :address :month :year :note :doi :url))
+ (:conference
+ (:description . "")
+ (:required :author :title :booktitle :year)
+ (:optional :editor :pages :organization :publisher :address :month :note :doi :url))
+ (:inbook
+ (:description . "A part of a book, which may be a chapter (or section or whatever) and/or a range of pages.")
+ (:required (:author :editor) :title (:chapter :pages) :publisher :year)
+ (:optional :crossref (:volume :number) :series :type :address :edition :month :note :doi))
+ (:incollection
+ (:description . "A part of a book having its own title.")
+ (:required :author :title :booktitle :publisher :year)
+ (:optional :crossref :editor (:volume :number) :series :type :chapter :pages :address :edition :month :note :doi))
+ (:inproceedings
+ (:description . "An article in a conference proceedings")
+ (:required :author :title :booktitle :year)
+ (:optional :crossref :editor (:volume :number) :series :pages :address :month :organization :publisher :note :doi))
+ (:manual
+ (:description . "Technical documentation.")
+ (:required :title)
+ (:optional :author :organization :address :edition :month :year :note :doi :url))
+ (:mastersthesis
+ (:description . "A Master’s thesis.")
+ (:required :author :title :school :year)
+ (:optional :type :address :month :note :doi :url))
+ (:misc
+ (:description . "Use this type when nothing else fits.")
+ (:required)
+ (:optional :author :title :howpublished :month :year :note :doi :url))
+ (:phdthesis
+ (:description . "A PhD thesis.")
+ (:required :author :title :school :year)
+ (:optional :type :address :month :note :doi :url))
+ (:proceedings
+ (:description . "The proceedings of a conference.")
+ (:required :title :year)
+ (:optional :editor (:volume :number) :series :address :month :organization :publisher :note :doi))
+ (:techreport
+ (:description . "A report published by a school or other institution.")
+ (:required :author :title :institution :year)
+ (:optional :type :address :month :note :doi :url))
+ (:unpublished
+ (:description . "A document having an author and title, but not formally published.")
+ (:required :author :title :note)
+ (:optional :month :year :doi :url)))
+ "Bibtex entry types with required and optional parameters.")
+
+(defvar org-bibtex-fields
+ '((:address . "Usually the address of the publisher or other type of institution. For major publishing houses, van Leunen recommends omitting the information entirely. For small publishers, on the other hand, you can help the reader by giving the complete address.")
+ (:annote . "An annotation. It is not used by the standard bibliography styles, but may be used by others that produce an annotated bibliography.")
+ (:author . "The name(s) of the author(s), in the format described in the LaTeX book. Remember, all names are separated with the and keyword, and not commas.")
+ (:booktitle . "Title of a book, part of which is being cited. See the LaTeX book for how to type titles. For book entries, use the title field instead.")
+ (:chapter . "A chapter (or section or whatever) number.")
+ (:crossref . "The database key of the entry being cross referenced.")
+ (:doi . "The digital object identifier.")
+ (:edition . "The edition of a book for example, 'Second'. This should be an ordinal, and should have the first letter capitalized, as shown here; the standard styles convert to lower case when necessary.")
+ (:editor . "Name(s) of editor(s), typed as indicated in the LaTeX book. If there is also an author field, then the editor field gives the editor of the book or collection in which the reference appears.")
+ (:howpublished . "How something strange has been published. The first word should be capitalized.")
+ (:institution . "The sponsoring institution of a technical report.")
+ (:journal . "A journal name.")
+ (:key . "Used for alphabetizing, cross-referencing, and creating a label when the author information is missing. This field should not be confused with the key that appears in the \\cite command and at the beginning of the database entry.")
+ (:month . "The month in which the work was published or, for an unpublished work, in which it was written. You should use the standard three-letter abbreviation,")
+ (:note . "Any additional information that can help the reader. The first word should be capitalized.")
+ (:number . "Any additional information that can help the reader. The first word should be capitalized.")
+ (:organization . "The organization that sponsors a conference or that publishes a manual.")
+ (:pages . "One or more page numbers or range of numbers, such as 42-111 or 7,41,73-97 or 43+ (the ‘+’ in this last example indicates pages following that don’t form simple range). BibTEX requires double dashes for page ranges (--).")
+ (:publisher . "The publisher’s name.")
+ (:school . "The name of the school where a thesis was written.")
+ (:series . "The name of a series or set of books. When citing an entire book, the title field gives its title and an optional series field gives the name of a series or multi-volume set in which the book is published.")
+ (:title . "The work’s title, typed as explained in the LaTeX book.")
+ (:type . "The type of a technical report for example, 'Research Note'.")
+ (:url . "Uniform resource locator.")
+ (:volume . "The volume of a journal or multi-volume book.")
+ (:year . "The year of publication or, for an unpublished work, the year it was written. Generally it should consist of four numerals, such as 1984, although the standard styles can handle any year whose last four nonpunctuation characters are numerals, such as '(about 1984)'"))
+ "Bibtex fields with descriptions.")
+
+(defvar org-bibtex-entries nil
+ "List to hold parsed bibtex entries.")
+
+(defcustom org-bibtex-autogen-keys nil
+ "Set to a truth value to use `bibtex-generate-autokey' to generate keys."
+ :group 'org-bibtex
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-bibtex-prefix nil
+ "Optional prefix for all bibtex property names.
+For example setting to `BIB_' would allow interoperability with fireforg."
+ :group 'org-bibtex
+ :version "24.1"
+ :type '(choice
+ (const nil)
+ (string)))
+
+(defcustom org-bibtex-treat-headline-as-title t
+ "Treat headline text as title if title property is absent.
+If an entry is missing a title property, use the headline text as
+the property. If this value is t, `org-bibtex-check' will ignore
+a missing title field."
+ :group 'org-bibtex
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-bibtex-headline-format-function
+ (lambda (entry) (cdr (assq :title entry)))
+ "Function returning the headline text for `org-bibtex-write'.
+It should take a single argument, the bibtex entry (an alist as
+returned by `org-bibtex-read'). The default value simply returns
+the entry title."
+ :group 'org-bibtex
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :type 'function)
+
+(defcustom org-bibtex-export-arbitrary-fields nil
+ "When converting to bibtex allow fields not defined in `org-bibtex-fields'.
+This only has effect if `org-bibtex-prefix' is defined, so as to
+ensure that other org-properties, such as CATEGORY or LOGGING are
+not placed in the exported bibtex entry."
+ :group 'org-bibtex
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-bibtex-key-property "CUSTOM_ID"
+ "Property that holds the bibtex key.
+By default, this is CUSTOM_ID, which enables easy linking to
+bibtex headlines from within an org file. This can be set to ID
+to enable global links, but only with great caution, as global
+IDs must be unique."
+ :group 'org-bibtex
+ :version "24.1"
+ :type 'string)
+
+(defcustom org-bibtex-tags nil
+ "List of tag(s) that should be added to new bib entries."
+ :group 'org-bibtex
+ :version "24.1"
+ :type '(repeat :tag "Tag" (string)))
+
+(defcustom org-bibtex-tags-are-keywords nil
+ "Convert the value of the keywords field to tags and vice versa.
+
+When non-nil, comma-separated entries in a bibtex entry's keywords
+field will be converted to Org tags. Note: spaces will be escaped
+with underscores, and characters that are not permitted in Org
+tags will be removed.
+
+When non-nil, local tags in an Org entry will be exported as
+a comma-separated string of keywords when exported to bibtex.
+If `org-bibtex-inherit-tags' is non-nil, inherited tags will also
+be exported as keywords. Tags defined in `org-bibtex-tags' or
+`org-bibtex-no-export-tags' will not be exported."
+ :group 'org-bibtex
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-bibtex-no-export-tags nil
+ "List of tag(s) that should not be converted to keywords.
+This variable is relevant only if `org-bibtex-tags-are-keywords'
+is non-nil."
+ :group 'org-bibtex
+ :version "24.1"
+ :type '(repeat :tag "Tag" (string)))
+
+(defcustom org-bibtex-inherit-tags nil
+ "Controls whether inherited tags are converted to bibtex keywords.
+It is relevant only if `org-bibtex-tags-are-keywords' is non-nil.
+Tag inheritance itself is controlled by `org-use-tag-inheritance'
+and `org-tags-exclude-from-inheritance'."
+ :group 'org-bibtex
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'boolean)
+
+(defcustom org-bibtex-type-property-name "btype"
+ "Property in which to store bibtex entry type (e.g., article)."
+ :group 'org-bibtex
+ :version "24.1"
+ :type 'string)
+
+
+;;; Utility functions
+(defun org-bibtex-get (property)
+ (let ((it (let ((org-special-properties
+ (delete "FILE" (copy-sequence org-special-properties))))
+ (or
+ (org-entry-get (point) (upcase property))
+ (org-entry-get (point) (concat org-bibtex-prefix
+ (upcase property)))))))
+ (when it (org-trim it))))
+
+(defun org-bibtex-put (property value)
+ (let ((prop (upcase (if (keywordp property)
+ (substring (symbol-name property) 1)
+ property))))
+ (org-set-property
+ (concat (unless (string= org-bibtex-key-property prop) org-bibtex-prefix)
+ prop)
+ value)))
+
+(defun org-bibtex-headline ()
+ "Return a bibtex entry of the given headline as a string."
+ (letrec ((val (lambda (key lst) (cdr (assoc key lst))))
+ (to (lambda (string) (intern (concat ":" string))))
+ (from (lambda (key) (substring (symbol-name key) 1)))
+ (flatten (lambda (&rest lsts)
+ (apply #'append (mapcar
+ (lambda (e)
+ (if (listp e) (apply flatten e) (list e)))
+ lsts))))
+ (id (org-bibtex-get org-bibtex-key-property))
+ (type (org-bibtex-get org-bibtex-type-property-name))
+ (tags (when org-bibtex-tags-are-keywords
+ (delq nil
+ (mapcar
+ (lambda (tag)
+ (unless (member tag
+ (append org-bibtex-tags
+ org-bibtex-no-export-tags))
+ tag))
+ (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
+ (mapconcat
+ (lambda (pair)
+ (format " %s={%s}" (car pair) (cdr pair)))
+ (remove nil
+ (if (and org-bibtex-export-arbitrary-fields
+ org-bibtex-prefix)
+ (mapcar
+ (lambda (kv)
+ (let ((key (car kv)) (val0 (cdr kv)))
+ (when (and
+ (string-match org-bibtex-prefix key)
+ (not (string=
+ (downcase (concat org-bibtex-prefix
+ org-bibtex-type-property-name))
+ (downcase key))))
+ (cons (downcase (replace-regexp-in-string
+ org-bibtex-prefix "" key))
+ val0))))
+ (org-entry-properties nil 'standard))
+ (mapcar
+ (lambda (field)
+ (let ((value (or (org-bibtex-get (funcall from field))
+ (and (eq :title field)
+ (nth 4 (org-heading-components))))))
+ (when value (cons (funcall from field) value))))
+ (funcall flatten
+ (funcall val :required (funcall val (funcall to type) org-bibtex-types))
+ (funcall val :optional (funcall val (funcall to type) org-bibtex-types))))))
+ ",\n"))))
+ (with-temp-buffer
+ (insert entry)
+ (when tags
+ (bibtex-beginning-of-entry)
+ (if (re-search-forward "keywords.*=.*{\\(.*\\)}" nil t)
+ (progn (goto-char (match-end 1)) (insert ", "))
+ (search-forward ",\n" nil t)
+ (insert " keywords={},\n")
+ (search-backward "}," nil t))
+ (insert (mapconcat #'identity tags ", ")))
+ (buffer-string))))))
+
+(defun org-bibtex-ask (field)
+ (unless (assoc field org-bibtex-fields)
+ (error "Field:%s is not known" field))
+ (save-window-excursion
+ (let* ((name (substring (symbol-name field) 1))
+ (buf-name (format "*Bibtex Help %s*" name)))
+ (with-output-to-temp-buffer buf-name
+ (princ (cdr (assoc field org-bibtex-fields))))
+ (with-current-buffer buf-name (visual-line-mode 1))
+ (org-fit-window-to-buffer (get-buffer-window buf-name))
+ (let ((result (read-from-minibuffer (format "%s: " name))))
+ (when (> (length result) 0) result)))))
+
+(defun org-bibtex-autokey ()
+ "Generate an autokey for the current headline."
+ (org-bibtex-put org-bibtex-key-property
+ (if org-bibtex-autogen-keys
+ (let* ((entry (org-bibtex-headline))
+ (key
+ (with-temp-buffer
+ (insert entry)
+ (bibtex-generate-autokey))))
+ ;; test for duplicate IDs if using global ID
+ (when (and
+ (equal org-bibtex-key-property "ID")
+ (featurep 'org-id)
+ (hash-table-p org-id-locations)
+ (gethash key org-id-locations))
+ (warn "Another entry has the same ID"))
+ key)
+ (read-from-minibuffer "id: "))))
+
+(defun org-bibtex-fleshout (type &optional optional)
+ "Fleshout current heading, ensuring all required fields are present.
+With optional argument OPTIONAL, also prompt for optional fields."
+ (let ((val (lambda (key lst) (cdr (assoc key lst))))
+ (keyword (lambda (name) (intern (concat ":" (downcase name)))))
+ (name (lambda (keyword) (substring (symbol-name keyword) 1))))
+ (dolist (field (append
+ (if org-bibtex-treat-headline-as-title
+ (remove :title (funcall val :required (funcall val type org-bibtex-types)))
+ (funcall val :required (funcall val type org-bibtex-types)))
+ (when optional (funcall val :optional (funcall val type org-bibtex-types)))))
+ (when (consp field) ; or'd pair of fields e.g., (:editor :author)
+ (let ((present (nth 0 (remove
+ nil
+ (mapcar
+ (lambda (f)
+ (when (org-bibtex-get (funcall name f)) f))
+ field)))))
+ (setf field (or present (funcall keyword
+ (completing-read
+ "Field: " (mapcar name field)))))))
+ (let ((name (funcall name field)))
+ (unless (org-bibtex-get name)
+ (let ((prop (org-bibtex-ask field)))
+ (when prop (org-bibtex-put name prop)))))))
+ (when (and type (assoc type org-bibtex-types)
+ (not (org-bibtex-get org-bibtex-key-property)))
+ (org-bibtex-autokey)))
+
+
+;;; Bibtex link functions
+(org-link-set-parameters "bibtex"
+ :follow #'org-bibtex-open
+ :store #'org-bibtex-store-link)
+
+(defun org-bibtex-open (path arg)
+ "Visit the bibliography entry on PATH.
+ARG, when non-nil, is a universal prefix argument. See
+`org-open-file' for details."
+ (org-link-open-as-file path arg))
+
+(defun org-bibtex-store-link ()
+ "Store a link to a BibTeX entry."
+ (when (eq major-mode 'bibtex-mode)
+ (let* ((search (org-create-file-search-in-bibtex))
+ (link (concat "file:" (abbreviate-file-name buffer-file-name)
+ "::" search))
+ (entry (mapcar ; repair strings enclosed in "..." or {...}
+ (lambda(c)
+ (if (string-match
+ "^\\(?:{\\|\"\\)\\(.*\\)\\(?:}\\|\"\\)$" (cdr c))
+ (cons (car c) (match-string 1 (cdr c))) c))
+ (save-excursion
+ (bibtex-beginning-of-entry)
+ (bibtex-parse-entry)))))
+ (org-link-store-props
+ :key (cdr (assoc "=key=" entry))
+ :author (or (cdr (assoc "author" entry)) "[no author]")
+ :doi (or (cdr (assoc "doi" entry)) "[no doi]")
+ :editor (or (cdr (assoc "editor" entry)) "[no editor]")
+ :title (or (cdr (assoc "title" entry)) "[no title]")
+ :booktitle (or (cdr (assoc "booktitle" entry)) "[no booktitle]")
+ :journal (or (cdr (assoc "journal" entry)) "[no journal]")
+ :publisher (or (cdr (assoc "publisher" entry)) "[no publisher]")
+ :pages (or (cdr (assoc "pages" entry)) "[no pages]")
+ :url (or (cdr (assoc "url" entry)) "[no url]")
+ :year (or (cdr (assoc "year" entry)) "[no year]")
+ :month (or (cdr (assoc "month" entry)) "[no month]")
+ :address (or (cdr (assoc "address" entry)) "[no address]")
+ :volume (or (cdr (assoc "volume" entry)) "[no volume]")
+ :number (or (cdr (assoc "number" entry)) "[no number]")
+ :annote (or (cdr (assoc "annote" entry)) "[no annotation]")
+ :series (or (cdr (assoc "series" entry)) "[no series]")
+ :abstract (or (cdr (assoc "abstract" entry)) "[no abstract]")
+ :btype (or (cdr (assoc "=type=" entry)) "[no type]")
+ :type "bibtex"
+ :link link
+ :description org-bibtex-description))))
+
+(defun org-create-file-search-in-bibtex ()
+ "Create the search string and description for a BibTeX database entry."
+ ;; Make a good description for this entry, using names, year and the title
+ ;; Put it into the `description' variable which is dynamically scoped.
+ (let ((bibtex-autokey-names 1)
+ (bibtex-autokey-names-stretch 1)
+ (bibtex-autokey-name-case-convert-function 'identity)
+ (bibtex-autokey-name-separator " & ")
+ (bibtex-autokey-additional-names " et al.")
+ (bibtex-autokey-year-length 4)
+ (bibtex-autokey-name-year-separator " ")
+ (bibtex-autokey-titlewords 3)
+ (bibtex-autokey-titleword-separator " ")
+ (bibtex-autokey-titleword-case-convert-function 'identity)
+ (bibtex-autokey-titleword-length 'infty)
+ (bibtex-autokey-year-title-separator ": "))
+ (setq org-bibtex-description (bibtex-generate-autokey)))
+ ;; Now parse the entry, get the key and return it.
+ (save-excursion
+ (bibtex-beginning-of-entry)
+ (cdr (assoc "=key=" (bibtex-parse-entry)))))
+
+(defun org-execute-file-search-in-bibtex (s)
+ "Find the link search string S as a key for a database entry."
+ (when (eq major-mode 'bibtex-mode)
+ ;; Yes, we want to do the search in this file.
+ ;; We construct a regexp that searches for "@entrytype{" followed by the key
+ (goto-char (point-min))
+ (and (re-search-forward (concat "@[a-zA-Z]+[ \t\n]*{[ \t\n]*"
+ (regexp-quote s) "[ \t\n]*,")
+ nil t)
+ (goto-char (match-beginning 0)))
+ (if (and (match-beginning 0) (equal current-prefix-arg '(16)))
+ ;; Use double prefix to indicate that any web link should be browsed
+ (let ((b (current-buffer)) (p (point)))
+ ;; Restore the window configuration because we just use the web link
+ (set-window-configuration org-window-config-before-follow-link)
+ (with-current-buffer b
+ (goto-char p)
+ (bibtex-url)))
+ (recenter 0)) ; Move entry start to beginning of window
+ ;; return t to indicate that the search is done.
+ t))
+
+;; Finally add the link search function to the right hook.
+(add-hook 'org-execute-file-search-functions 'org-execute-file-search-in-bibtex)
+
+
+;;; Bibtex <-> Org headline translation functions
+(defun org-bibtex (filename)
+ "Export each headline in the current file to a bibtex entry.
+Headlines are exported using `org-bibtex-headline'."
+ (interactive
+ (list (read-file-name
+ "Bibtex file: " nil nil nil
+ (let ((file (buffer-file-name (buffer-base-buffer))))
+ (and file
+ (file-name-nondirectory
+ (concat (file-name-sans-extension file) ".bib")))))))
+ (let ((error-point
+ (catch 'bib
+ (let ((bibtex-entries
+ (remove nil (org-map-entries
+ (lambda ()
+ (condition-case nil
+ (org-bibtex-headline)
+ (error (throw 'bib (point)))))))))
+ (with-temp-file filename
+ (insert (mapconcat #'identity bibtex-entries "\n")))
+ (message "Successfully exported %d BibTeX entries to %s"
+ (length bibtex-entries) filename)
+ nil))))
+ (when error-point
+ (goto-char error-point)
+ (message "Bibtex error at %S" (nth 4 (org-heading-components))))))
+
+(defun org-bibtex-check (&optional optional)
+ "Check the current headline for required fields.
+With prefix argument OPTIONAL also prompt for optional fields."
+ (interactive "P")
+ (save-restriction
+ (org-narrow-to-subtree)
+ (let ((type (let ((name (org-bibtex-get org-bibtex-type-property-name)))
+ (when name (intern (concat ":" name))))))
+ (when type (org-bibtex-fleshout type optional)))))
+
+(defun org-bibtex-check-all (&optional optional)
+ "Check all headlines in the current file.
+With prefix argument OPTIONAL also prompt for optional fields."
+ (interactive) (org-map-entries (lambda () (org-bibtex-check optional))))
+
+(defun org-bibtex-create (&optional arg nonew)
+ "Create a new entry at the given level.
+With a prefix arg, query for optional fields as well.
+If nonew is t, add data to the headline of the entry at point."
+ (interactive "P")
+ (let* ((type (completing-read
+ "Type: " (mapcar (lambda (type)
+ (substring (symbol-name (car type)) 1))
+ org-bibtex-types)
+ nil nil (when nonew
+ (org-bibtex-get org-bibtex-type-property-name))))
+ (type (if (keywordp type) type (intern (concat ":" type))))
+ (org-bibtex-treat-headline-as-title (if nonew nil t)))
+ (unless (assoc type org-bibtex-types)
+ (error "Type:%s is not known" type))
+ (if nonew
+ (org-back-to-heading)
+ (org-insert-heading)
+ (let ((title (org-bibtex-ask :title)))
+ (insert title)
+ (org-bibtex-put "TITLE" title)))
+ (org-bibtex-put org-bibtex-type-property-name
+ (substring (symbol-name type) 1))
+ (org-bibtex-fleshout type arg)
+ (dolist (tag org-bibtex-tags) (org-toggle-tag tag 'on))))
+
+(defun org-bibtex-create-in-current-entry (&optional arg)
+ "Add bibliographical data to the current entry.
+With a prefix arg, query for optional fields."
+ (interactive "P")
+ (org-bibtex-create arg t))
+
+(defun org-bibtex-read ()
+ "Read a bibtex entry and save to `org-bibtex-entries'.
+This uses `bibtex-parse-entry'."
+ (interactive)
+ (let ((keyword (lambda (str) (intern (concat ":" (downcase str)))))
+ (clean-space (lambda (str) (replace-regexp-in-string
+ "[[:space:]\n\r]+" " " str)))
+ (strip-delim
+ (lambda (str) ; strip enclosing "..." and {...}
+ (dolist (pair '((34 . 34) (123 . 125)))
+ (when (and (> (length str) 1)
+ (= (aref str 0) (car pair))
+ (= (aref str (1- (length str))) (cdr pair)))
+ (setf str (substring str 1 (1- (length str))))))
+ str)))
+ (push (mapcar
+ (lambda (pair)
+ (cons (let ((field (funcall keyword (car pair))))
+ (pcase field
+ (:=type= :type)
+ (:=key= :key)
+ (_ field)))
+ (funcall clean-space (funcall strip-delim (cdr pair)))))
+ (save-excursion (bibtex-beginning-of-entry) (bibtex-parse-entry)))
+ org-bibtex-entries)
+ (unless (car org-bibtex-entries) (pop org-bibtex-entries))))
+
+(defun org-bibtex-read-buffer (buffer)
+ "Read all bibtex entries in BUFFER and save to `org-bibtex-entries'.
+Return the number of saved entries."
+ (interactive "bBuffer: ")
+ (let ((start-length (length org-bibtex-entries)))
+ (with-current-buffer buffer
+ (save-excursion
+ (goto-char (point-max))
+ (while (not (= (point) (point-min)))
+ (backward-char 1)
+ (org-bibtex-read)
+ (bibtex-beginning-of-entry))))
+ (let ((added (- (length org-bibtex-entries) start-length)))
+ (message "Parsed %d entries" added)
+ added)))
+
+(defun org-bibtex-read-file (file)
+ "Read FILE with `org-bibtex-read-buffer'."
+ (interactive "fFile: ")
+ (org-bibtex-read-buffer (find-file-noselect file 'nowarn 'rawfile)))
+
+(defun org-bibtex-write ()
+ "Insert a heading built from the first element of `org-bibtex-entries'."
+ (interactive)
+ (when (= (length org-bibtex-entries) 0)
+ (error "No entries in `org-bibtex-entries'"))
+ (let* ((entry (pop org-bibtex-entries))
+ (org-special-properties nil) ; avoids errors with `org-entry-put'
+ (val (lambda (field) (cdr (assoc field entry))))
+ (togtag (lambda (tag) (org-toggle-tag tag 'on))))
+ (org-insert-heading)
+ (insert (funcall org-bibtex-headline-format-function entry))
+ (org-bibtex-put "TITLE" (funcall val :title))
+ (org-bibtex-put org-bibtex-type-property-name
+ (downcase (funcall val :type)))
+ (dolist (pair entry)
+ (pcase (car pair)
+ (:title nil)
+ (:type nil)
+ (:key (org-bibtex-put org-bibtex-key-property (cdr pair)))
+ (:keywords (if org-bibtex-tags-are-keywords
+ (dolist (kw (split-string (cdr pair) ", *"))
+ (funcall
+ togtag
+ (replace-regexp-in-string
+ "[^[:alnum:]_@#%]" ""
+ (replace-regexp-in-string "[ \t]+" "_" kw))))
+ (org-bibtex-put (car pair) (cdr pair))))
+ (_ (org-bibtex-put (car pair) (cdr pair)))))
+ (mapc togtag org-bibtex-tags)))
+
+(defun org-bibtex-yank ()
+ "If kill ring holds a bibtex entry yank it as an Org headline."
+ (interactive)
+ (let (entry)
+ (with-temp-buffer (yank 1) (setf entry (org-bibtex-read)))
+ (if entry
+ (org-bibtex-write)
+ (error "Yanked text does not appear to contain a BibTeX entry"))))
+
+(defun org-bibtex-import-from-file (file)
+ "Read bibtex entries from FILE and insert as Org headlines after point."
+ (interactive "fFile: ")
+ (dotimes (_ (org-bibtex-read-file file))
+ (save-excursion (org-bibtex-write))
+ (re-search-forward org-property-end-re)
+ (open-line 1) (forward-char 1)))
+
+(defun org-bibtex-export-to-kill-ring ()
+ "Export current headline to kill ring as bibtex entry."
+ (interactive)
+ (let ((result (org-bibtex-headline)))
+ (kill-new result) result))
+
+(defun org-bibtex-search (string)
+ "Search for bibliographical entries in agenda files.
+This function relies `org-search-view' to locate results."
+ (interactive "sSearch string: ")
+ (let ((org-agenda-overriding-header "Bib search results:")
+ (org-agenda-search-view-always-boolean t))
+ (org-search-view nil
+ (format "%s +{:%s%s:}"
+ string (or org-bibtex-prefix "")
+ org-bibtex-type-property-name))))
+
+(provide 'ol-bibtex)
+
+;;; ol-bibtex.el ends here
diff --git a/elpa/org-9.5.2/ol-bibtex.elc b/elpa/org-9.5.2/ol-bibtex.elc
new file mode 100644
index 0000000..f587696
--- /dev/null
+++ b/elpa/org-9.5.2/ol-bibtex.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ol-docview.el b/elpa/org-9.5.2/ol-docview.el
new file mode 100644
index 0000000..7ab67de
--- /dev/null
+++ b/elpa/org-9.5.2/ol-docview.el
@@ -0,0 +1,103 @@
+;;; ol-docview.el --- Links to Docview mode buffers -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Jan Böcker <jan.boecker at jboecker dot de>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file implements links to open files in doc-view-mode.
+;; Org mode loads this module by default - if this is not what you want,
+;; configure the variable `org-modules'.
+
+;; The links take the form
+;;
+;; docview:<file path>::<page number>
+;;
+;; for example: [[docview:~/.elisp/org/doc/org.pdf::1][Org-Mode Manual]]
+;;
+;; Autocompletion for inserting links is supported; you will be
+;; prompted for a file and a page number.
+;;
+;; If you use org-store-link in a doc-view mode buffer, the stored
+;; link will point to the current page.
+
+;;; Code:
+
+
+(require 'doc-view)
+(require 'ol)
+
+(declare-function doc-view-goto-page "doc-view" (page))
+(declare-function image-mode-window-get "image-mode" (prop &optional winprops))
+(declare-function org-open-file "org" (path &optional in-emacs line search))
+
+(org-link-set-parameters "docview"
+ :follow #'org-docview-open
+ :export #'org-docview-export
+ :store #'org-docview-store-link)
+
+(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)))
+ (when (stringp path)
+ (setq path (expand-file-name path))
+ (cond
+ ((eq format 'html) (format "<a href=\"%s\">%s</a>" path desc))
+ ((eq format 'latex) (format "\\href{%s}{%s}" path desc))
+ ((eq format 'ascii) (format "%s (%s)" desc path))
+ (t path)))))
+
+(defun org-docview-open (link _)
+ (string-match "\\(.*?\\)\\(?:::\\([0-9]+\\)\\)?$" link)
+ (let ((path (match-string 1 link))
+ (page (and (match-beginning 2)
+ (string-to-number (match-string 2 link)))))
+ ;; Let Org mode open the file (in-emacs = 1) to ensure
+ ;; org-link-frame-setup is respected.
+ (org-open-file path 1)
+ (when page (doc-view-goto-page page))))
+
+(defun org-docview-store-link ()
+ "Store a link to a docview buffer."
+ (when (eq major-mode 'doc-view-mode)
+ ;; This buffer is in doc-view-mode
+ (let* ((path buffer-file-name)
+ (page (image-mode-window-get 'page))
+ (link (concat "docview:" path "::" (number-to-string page))))
+ (org-link-store-props
+ :type "docview"
+ :link link
+ :description path))))
+
+(defun org-docview-complete-link ()
+ "Use the existing file name completion for file.
+Links to get the file name, then ask the user for the page number
+and append it."
+ (concat (replace-regexp-in-string "^file:" "docview:" (org-link-complete-file))
+ "::"
+ (read-from-minibuffer "Page:" "1")))
+
+(provide 'ol-docview)
+
+;;; ol-docview.el ends here
diff --git a/elpa/org-9.5.2/ol-docview.elc b/elpa/org-9.5.2/ol-docview.elc
new file mode 100644
index 0000000..604876c
--- /dev/null
+++ b/elpa/org-9.5.2/ol-docview.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ol-doi.el b/elpa/org-9.5.2/ol-doi.el
new file mode 100644
index 0000000..d2d16b2
--- /dev/null
+++ b/elpa/org-9.5.2/ol-doi.el
@@ -0,0 +1,72 @@
+;;; ol-doi.el --- DOI links support in Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library introduces the "doi" link type in Org, and provides
+;; code for opening and exporting such links.
+
+;;; Code:
+
+(require 'ol)
+
+(defcustom org-link-doi-server-url "https://doi.org/"
+ "The URL of the DOI server."
+ :group 'org-link-follow
+ :version "24.3"
+ :type 'string
+ :safe #'stringp)
+
+(defun org-link-doi-open (path arg)
+ "Open a \"doi\" type link.
+PATH is a the path to search for, as a string."
+ (browse-url (url-encode-url (concat org-link-doi-server-url path)) arg))
+
+(defun org-link-doi-export (path desc backend info)
+ "Export a \"doi\" type link.
+PATH is the DOI name. DESC is the description of the link, or
+nil. BACKEND is a symbol representing the backend used for
+export. INFO is a a plist containing the export parameters."
+ (let ((uri (concat org-link-doi-server-url path)))
+ (pcase backend
+ (`html
+ (format "<a href=\"%s\">%s</a>" uri (or desc uri)))
+ (`latex
+ (if desc (format "\\href{%s}{%s}" uri desc)
+ (format "\\url{%s}" uri)))
+ (`ascii
+ (if (not desc) (format "<%s>" uri)
+ (concat (format "[%s]" desc)
+ (and (not (plist-get info :ascii-links-to-notes))
+ (format " (<%s>)" uri)))))
+ (`texinfo
+ (if (not desc) (format "@uref{%s}" uri)
+ (format "@uref{%s, %s}" uri desc)))
+ (_ uri))))
+
+(org-link-set-parameters "doi"
+ :follow #'org-link-doi-open
+ :export #'org-link-doi-export)
+
+
+(provide 'org-link-doi)
+(provide 'ol-doi)
+;;; ol-doi.el ends here
diff --git a/elpa/org-9.5.2/ol-doi.elc b/elpa/org-9.5.2/ol-doi.elc
new file mode 100644
index 0000000..71a1b36
--- /dev/null
+++ b/elpa/org-9.5.2/ol-doi.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ol-eshell.el b/elpa/org-9.5.2/ol-eshell.el
new file mode 100644
index 0000000..a7550e3
--- /dev/null
+++ b/elpa/org-9.5.2/ol-eshell.el
@@ -0,0 +1,68 @@
+;;; ol-eshell.el --- Links to Working Directories in Eshell -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+;; Author: Konrad Hinsen <konrad.hinsen AT fastmail.net>
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'eshell)
+(require 'esh-mode)
+(require 'ol)
+
+(declare-function eshell/pwd "em-dirs.el" (&rest args))
+
+(org-link-set-parameters "eshell"
+ :follow #'org-eshell-open
+ :store #'org-eshell-store-link)
+
+(defun org-eshell-open (link _)
+ "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)
+ (list (match-string 1 link)
+ (match-string 2 link))
+ (list eshell-buffer-name link)))
+ (eshell-buffer-name (car buffer-and-command))
+ (command (cadr buffer-and-command)))
+ (if (get-buffer eshell-buffer-name)
+ (pop-to-buffer-same-window eshell-buffer-name)
+ (eshell))
+ (goto-char (point-max))
+ (eshell-kill-input)
+ (insert command)
+ (eshell-send-input)))
+
+(defun org-eshell-store-link ()
+ "Store a link that, when opened, switches back to the current eshell buffer
+and the current working directory."
+ (when (eq major-mode 'eshell-mode)
+ (let* ((command (concat "cd " (eshell/pwd)))
+ (link (concat (buffer-name) ":" command)))
+ (org-link-store-props
+ :link (concat "eshell:" link)
+ :description command))))
+
+(provide 'ol-eshell)
+
+;;; ol-eshell.el ends here
diff --git a/elpa/org-9.5.2/ol-eshell.elc b/elpa/org-9.5.2/ol-eshell.elc
new file mode 100644
index 0000000..f3a12c8
--- /dev/null
+++ b/elpa/org-9.5.2/ol-eshell.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ol-eww.el b/elpa/org-9.5.2/ol-eww.el
new file mode 100644
index 0000000..e9ffee6
--- /dev/null
+++ b/elpa/org-9.5.2/ol-eww.el
@@ -0,0 +1,181 @@
+;;; ol-eww.el --- Store URL and kill from Eww mode -*- lexical-binding: t -*-
+
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
+
+;; Author: Marco Wahl <marcowahlsoft>a<gmailcom>
+;; Keywords: link, eww
+;; 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 <https://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+
+;; When this module is active `org-store-link' (often on key C-c l) in
+;; 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
+;; 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.
+
+;; C-c C-x C-w (and also C-c C-x M-w) trigger
+;; `org-eww-copy-for-org-mode'.
+
+;; Hint: A lot of code of this module comes from module org-w3m which
+;; has been written by Andy Steward based on the idea of Richard
+;; Riley. Thanks!
+
+;; Potential: Since the code for w3m and eww is so similar one could
+;; try to refactor.
+
+
+;;; Code:
+(require 'ol)
+(require 'cl-lib)
+(require 'eww)
+
+;; For Emacsen < 25.
+(defvar eww-current-title)
+(defvar eww-current-url)
+
+
+;; Store Org link in Eww mode buffer
+(org-link-set-parameters "eww"
+ :follow #'org-eww-open
+ :store #'org-eww-store-link)
+
+(defun org-eww-open (url _)
+ "Open URL with Eww in the current buffer."
+ (eww url))
+
+(defun org-eww-store-link ()
+ "Store a link to the url of an EWW buffer."
+ (when (eq major-mode 'eww-mode)
+ (org-link-store-props
+ :type "eww"
+ :link (if (< emacs-major-version 25)
+ eww-current-url
+ (eww-current-url))
+ :url (url-view-url t)
+ :description (if (< emacs-major-version 25)
+ (or eww-current-title eww-current-url)
+ (or (plist-get eww-data :title)
+ (eww-current-url))))))
+
+
+;; Some auxiliary functions concerning links in Eww buffers
+(defun org-eww-goto-next-url-property-change ()
+ "Move to the start of next link if exists.
+Otherwise point is not moved. Return point."
+ (goto-char
+ (or (next-single-property-change (point) 'shr-url)
+ (point))))
+
+(defun org-eww-has-further-url-property-change-p ()
+ "Non-nil if there is a next url property change."
+ (save-excursion
+ (not (eq (point) (org-eww-goto-next-url-property-change)))))
+
+(defun org-eww-url-below-point ()
+ "Return the url below point if there is an url; otherwise, return nil."
+ (get-text-property (point) 'shr-url))
+
+
+(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-link-make-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."
+ (interactive)
+ (let* ((regionp (org-region-active-p))
+ (transform-start (point-min))
+ (transform-end (point-max))
+ return-content
+ link-location link-title
+ temp-position out-bound)
+ (when regionp
+ (setq transform-start (region-beginning))
+ (setq transform-end (region-end))
+ ;; Deactivate mark if current mark is activate.
+ (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
+ (org-eww-has-further-url-property-change-p)) ; there is a next link
+ ;; Store current point before jump next anchor.
+ (setq temp-position (point))
+ ;; Move to next anchor when current point is not at anchor.
+ (or (org-eww-url-below-point)
+ (org-eww-goto-next-url-property-change))
+ (cl-assert
+ (org-eww-url-below-point) t
+ "program logic error: point must have an url below but it hasn't")
+ (if (<= (point) transform-end) ; if point is inside transform bound
+ (progn
+ ;; Get content between two links.
+ (when (< temp-position (point))
+ (setq return-content (concat return-content
+ (buffer-substring
+ temp-position (point)))))
+ ;; Get link location at current point.
+ (setq link-location (org-eww-url-below-point))
+ ;; Get link title at current point.
+ (setq link-title
+ (buffer-substring
+ (point)
+ (org-eww-goto-next-url-property-change)))
+ ;; concat `org-mode' style url to `return-content'.
+ (setq return-content
+ (concat return-content
+ (if (org-string-nw-p link-location)
+ ;; Hint: link-location is different
+ ;; for form-elements.
+ (org-link-make-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.
+ (when (< (point) transform-end)
+ (setq return-content
+ (concat return-content
+ (buffer-substring (point) transform-end))))
+ ;; Quote lines starting with *.
+ (org-kill-new (replace-regexp-in-string "^\\*" ",*" return-content))
+ (message "Transforming links...done, use C-y to insert text into Org mode file"))))
+
+
+;; Additional keys for eww-mode
+
+(defun org-eww-extend-eww-keymap ()
+ (define-key eww-mode-map "\C-c\C-x\M-w" 'org-eww-copy-for-org-mode)
+ (define-key eww-mode-map "\C-c\C-x\C-w" 'org-eww-copy-for-org-mode))
+
+(when (and (boundp 'eww-mode-map)
+ (keymapp eww-mode-map)) ; eww is already up.
+ (org-eww-extend-eww-keymap))
+
+(add-hook 'eww-mode-hook #'org-eww-extend-eww-keymap)
+
+
+(provide 'ol-eww)
+
+;;; ol-eww.el ends here
diff --git a/elpa/org-9.5.2/ol-eww.elc b/elpa/org-9.5.2/ol-eww.elc
new file mode 100644
index 0000000..cf8f47e
--- /dev/null
+++ b/elpa/org-9.5.2/ol-eww.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ol-gnus.el b/elpa/org-9.5.2/ol-gnus.el
new file mode 100644
index 0000000..72bdd73
--- /dev/null
+++ b/elpa/org-9.5.2/ol-gnus.el
@@ -0,0 +1,272 @@
+;;; ol-gnus.el --- Links to Gnus Groups and Messages -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; Tassilo Horn <tassilo at member dot fsf dot org>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file implements links to Gnus groups and messages from within Org.
+;; Org mode loads this module by default - if this is not what you want,
+;; configure the variable `org-modules'.
+
+;;; Code:
+
+(require 'gnus-sum)
+(require 'gnus-util)
+(require 'nnheader)
+(or (require 'nnselect nil t) ; Emacs >= 28
+ (require 'nnir nil t)) ; Emacs < 28
+(require 'ol)
+
+
+;;; 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
+
+(defcustom org-gnus-prefer-web-links nil
+ "If non-nil, `org-store-link' creates web links to Google groups.
+\\<org-mode-map>When nil, Gnus will be used for such links.
+Using a prefix argument to the command `\\[org-store-link]' (`org-store-link')
+negates this setting for the duration of the command."
+ :group 'org-link-store
+ :type 'boolean)
+
+(defcustom org-gnus-no-server nil
+ "Should Gnus be started using `gnus-no-server'?"
+ :group 'org-gnus
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+
+;;; Install the link type
+
+(org-link-set-parameters "gnus"
+ :follow #'org-gnus-open
+ :store #'org-gnus-store-link)
+
+;;; Implementation
+
+(defun org-gnus-group-link (group)
+ "Create a link to the Gnus group GROUP.
+If GROUP is a newsgroup and `org-gnus-prefer-web-links' is
+non-nil, create a link to groups.google.com. Otherwise create a
+link to the group inside Gnus.
+
+If `org-store-link' was called with a prefix arg the meaning of
+`org-gnus-prefer-web-links' is reversed."
+ (let ((unprefixed-group (replace-regexp-in-string "^[^:]+:" "" group)))
+ (if (and (string-prefix-p "nntp" group) ;; Only for nntp groups
+ (org-xor current-prefix-arg
+ org-gnus-prefer-web-links))
+ (concat "https://groups.google.com/group/" unprefixed-group)
+ (concat "gnus:" group))))
+
+(defun org-gnus-article-link (group newsgroups message-id x-no-archive)
+ "Create a link to a Gnus article.
+
+The article is specified by its MESSAGE-ID. Additional
+parameters are the Gnus GROUP, the NEWSGROUPS the article was
+posted to and the X-NO-ARCHIVE header value of that article.
+
+If GROUP is a newsgroup and `org-gnus-prefer-web-links' is
+non-nil, create a link to groups.google.com.
+Otherwise create a link to the article inside Gnus.
+
+If `org-store-link' was called with a prefix arg the meaning of
+`org-gnus-prefer-web-links' is reversed."
+ (if (and (org-xor current-prefix-arg org-gnus-prefer-web-links)
+ newsgroups ;make web links only for nntp groups
+ (not x-no-archive)) ;and if X-No-Archive isn't set
+ (format "https://groups.google.com/groups/search?as_umsgid=%s"
+ (url-encode-url message-id))
+ (concat "gnus:" group "#" message-id)))
+
+(defun org-gnus-store-link ()
+ "Store a link to a Gnus folder or message."
+ (pcase major-mode
+ (`gnus-group-mode
+ (let ((group (gnus-group-group-name)))
+ (when group
+ (org-link-store-props :type "gnus" :group group)
+ (let ((description (org-gnus-group-link group)))
+ (org-link-add-props :link description :description description)
+ description))))
+ ((or `gnus-summary-mode `gnus-article-mode)
+ (let* ((group
+ (pcase (gnus-find-method-for-group gnus-newsgroup-name)
+ (`(nnvirtual . ,_)
+ (save-excursion
+ (car (nnvirtual-map-article (gnus-summary-article-number)))))
+ (`(,(or `nnselect `nnir) . ,_) ; nnir is for Emacs < 28.
+ (save-excursion
+ (cond
+ ((fboundp 'nnselect-article-group)
+ (nnselect-article-group (gnus-summary-article-number)))
+ ((fboundp 'nnir-article-group)
+ (nnir-article-group (gnus-summary-article-number)))
+ (t
+ (error "No article-group variant bound")))))
+ (_ gnus-newsgroup-name)))
+ (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)))
+ (date (org-trim (mail-header-date header)))
+ ;; Remove text properties of subject string to avoid Emacs
+ ;; bug #3506.
+ (subject (org-no-properties
+ (copy-sequence (mail-header-subject header))))
+ (to (cdr (assq 'To (mail-header-extra header))))
+ newsgroups x-no-archive)
+ ;; Fetching an article is an expensive operation; newsgroup and
+ ;; x-no-archive are only needed for web links.
+ (when (org-xor current-prefix-arg org-gnus-prefer-web-links)
+ ;; Make sure the original article buffer is up-to-date.
+ (save-window-excursion (gnus-summary-select-article))
+ (setq to (or to (gnus-fetch-original-field "To")))
+ (setq newsgroups (gnus-fetch-original-field "Newsgroups"))
+ (setq x-no-archive (gnus-fetch-original-field "x-no-archive")))
+ (org-link-store-props :type "gnus" :from from :date date :subject subject
+ :message-id message-id :group group :to to)
+ (let ((link (org-gnus-article-link
+ group newsgroups message-id x-no-archive))
+ (description (org-link-email-description)))
+ (org-link-add-props :link link :description description)
+ link)))
+ (`message-mode
+ (setq org-store-link-plist nil) ;reset
+ (save-excursion
+ (save-restriction
+ (message-narrow-to-headers)
+ (unless (message-fetch-field "Message-ID")
+ (message-generate-headers '(Message-ID)))
+ (goto-char (point-min))
+ (re-search-forward "^Message-ID:" nil t)
+ (put-text-property (line-beginning-position) (line-end-position)
+ 'message-deletable nil)
+ (let ((gcc (org-last (message-unquote-tokens
+ (message-tokenize-header
+ (mail-fetch-field "gcc" nil t) " ,"))))
+ (id (org-unbracket-string "<" ">"
+ (mail-fetch-field "Message-ID")))
+ (to (mail-fetch-field "To"))
+ (from (mail-fetch-field "From"))
+ (subject (mail-fetch-field "Subject"))
+ ) ;; newsgroup xarchive ;those are always nil for gcc
+ (unless gcc (error "Can not create link: No Gcc header found"))
+ (org-link-store-props :type "gnus" :from from :subject subject
+ :message-id id :group gcc :to to)
+ (let ((link (org-gnus-article-link gcc nil id nil)) ;;newsgroup xarchive
+ (description (org-link-email-description)))
+ (org-link-add-props :link link :description description)
+ link)))))))
+
+(defun org-gnus-open-nntp (path)
+ "Follow the nntp: link specified by PATH."
+ (let* ((spec (split-string path "/"))
+ (server (split-string (nth 2 spec) "@"))
+ (group (nth 3 spec))
+ (article (nth 4 spec)))
+ (org-gnus-follow-link
+ (format "nntp+%s:%s" (or (cdr server) (car server)) group)
+ article)))
+
+(defun org-gnus-open (path _)
+ "Follow the Gnus message or folder link specified by PATH."
+ (unless (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path)
+ (error "Error in Gnus link %S" path))
+ (let ((group (match-string-no-properties 1 path))
+ (article (match-string-no-properties 3 path)))
+ (org-gnus-follow-link group article)))
+
+(defun org-gnus-follow-link (&optional group article)
+ "Follow a Gnus link to GROUP and ARTICLE."
+ (require 'gnus)
+ (funcall (cdr (assq 'gnus org-link-frame-setup)))
+ (when gnus-other-frame-object (select-frame gnus-other-frame-object))
+ (let ((group (org-no-properties group))
+ (article (org-no-properties article)))
+ (cond
+ ((and group article)
+ (gnus-activate-group group)
+ (condition-case nil
+ (let ((msg "Couldn't follow Gnus link. Summary couldn't be opened."))
+ (pcase (gnus-find-method-for-group group)
+ (`(nndoc . ,_)
+ (if (gnus-group-read-group t nil group)
+ (gnus-summary-goto-article article nil t)
+ (message msg)))
+ (_
+ (let ((articles 1)
+ group-opened)
+ (while (and (not group-opened)
+ ;; 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)
+ (1+ articles)
+ (* articles 2))))
+ (if group-opened
+ (gnus-summary-goto-article article nil t)
+ (message msg))))))
+ (quit
+ (message "Couldn't follow Gnus link. The linked group is empty."))))
+ (group (gnus-group-jump-to-group group)))))
+
+(defun org-gnus-no-new-news ()
+ "Like `\\[gnus]' but doesn't check for new news."
+ (cond ((gnus-alive-p) nil)
+ (org-gnus-no-server (gnus-no-server))
+ (t (gnus))))
+
+(provide 'ol-gnus)
+
+;;; ol-gnus.el ends here
diff --git a/elpa/org-9.5.2/ol-gnus.elc b/elpa/org-9.5.2/ol-gnus.elc
new file mode 100644
index 0000000..25179f2
--- /dev/null
+++ b/elpa/org-9.5.2/ol-gnus.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ol-info.el b/elpa/org-9.5.2/ol-info.el
new file mode 100644
index 0000000..a535ea5
--- /dev/null
+++ b/elpa/org-9.5.2/ol-info.el
@@ -0,0 +1,148 @@
+;;; ol-info.el --- Links to Info Nodes -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file implements links to Info nodes from within Org mode.
+;; Org mode loads this module by default - if this is not what you want,
+;; configure the variable `org-modules'.
+
+;;; Code:
+
+(require 'ol)
+
+;; Declare external functions and variables
+
+(declare-function Info-find-node "info"
+ (filename nodename &optional no-going-back strict-case))
+(defvar Info-current-file)
+(defvar Info-current-node)
+
+;; Install the link type
+(org-link-set-parameters "info"
+ :follow #'org-info-open
+ :export #'org-info-export
+ :store #'org-info-store-link)
+
+;; Implementation
+(defun org-info-store-link ()
+ "Store a link to an Info file and node."
+ (when (eq major-mode 'Info-mode)
+ (let ((link (concat "info:"
+ (file-name-nondirectory Info-current-file)
+ "#" Info-current-node))
+ (desc (concat (file-name-nondirectory Info-current-file)
+ "#" Info-current-node)))
+ (org-link-store-props :type "info" :file Info-current-file
+ :node Info-current-node
+ :link link :description desc)
+ link)))
+
+(defun org-info-open (path _)
+ "Follow an Info file and node link specified by PATH."
+ (org-info-follow-link path))
+
+
+(defun org-info-follow-link (name)
+ "Follow an Info file and node link specified by NAME."
+ (if (or (string-match "\\(.*\\)\\(?:#\\|::\\)\\(.*\\)" name)
+ (string-match "\\(.*\\)" name))
+ (let ((filename (match-string 1 name))
+ (nodename-or-index (or (match-string 2 name) "Top")))
+ (require 'info)
+ ;; If nodename-or-index is invalid node name, then look it up
+ ;; in the index.
+ (condition-case nil
+ (Info-find-node filename nodename-or-index)
+ (user-error (Info-find-node filename "Top")
+ (condition-case nil
+ (Info-index nodename-or-index)
+ (user-error "Could not find '%s' node or index entry"
+ nodename-or-index)))))
+ (user-error "Could not open: %s" name)))
+
+(defconst org-info-emacs-documents
+ '("ada-mode" "auth" "autotype" "bovine" "calc" "ccmode" "cl" "dbus" "dired-x"
+ "ebrowse" "ede" "ediff" "edt" "efaq-w32" "efaq" "eieio" "eintr" "elisp"
+ "emacs-gnutls" "emacs-mime" "emacs" "epa" "erc" "ert" "eshell" "eudc" "eww"
+ "flymake" "forms" "gnus" "htmlfontify" "idlwave" "ido" "info" "mairix-el"
+ "message" "mh-e" "newsticker" "nxml-mode" "octave-mode" "org" "pcl-cvs"
+ "pgg" "rcirc" "reftex" "remember" "sasl" "sc" "semantic" "ses" "sieve"
+ "smtpmail" "speedbar" "srecode" "todo-mode" "tramp" "url" "vip" "viper"
+ "widget" "wisent" "woman")
+ "List of Emacs documents available.
+Taken from <https://www.gnu.org/software/emacs/manual/html_mono/.>")
+
+(defconst org-info-other-documents
+ '(("libc" . "https://www.gnu.org/software/libc/manual/html_mono/libc.html")
+ ("make" . "https://www.gnu.org/software/make/manual/make.html"))
+ "Alist of documents generated from Texinfo source.
+When converting info links to HTML, links to any one of these manuals are
+converted to use these URL.")
+
+(defun org-info-map-html-url (filename)
+ "Return URL or HTML file associated to Info FILENAME.
+If FILENAME refers to an official GNU document, return a URL pointing to
+the official page for that document, e.g., use \"gnu.org\" for all Emacs
+related documents. Otherwise, append \".html\" extension to FILENAME.
+See `org-info-emacs-documents' and `org-info-other-documents' for details."
+ (cond ((member filename org-info-emacs-documents)
+ (format "https://www.gnu.org/software/emacs/manual/html_mono/%s.html"
+ filename))
+ ((cdr (assoc filename org-info-other-documents)))
+ (t (concat filename ".html"))))
+
+(defun org-info--expand-node-name (node)
+ "Expand Info NODE to HTML cross reference."
+ ;; See (info "(texinfo) HTML Xref Node Name Expansion") for the
+ ;; expansion rule.
+ (let ((node (replace-regexp-in-string
+ "\\([ \t\n\r]+\\)\\|\\([^a-zA-Z0-9]\\)"
+ (lambda (m)
+ (if (match-end 1) "-" (format "_%04x" (string-to-char m))))
+ (org-trim node))))
+ (cond ((string= node "") "")
+ ((string-match-p "\\`[0-9]" node) (concat "g_t" node))
+ (t node))))
+
+(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 "#\\|::"))
+ (manual (car parts))
+ (node (or (nth 1 parts) "Top")))
+ (pcase format
+ (`html
+ (format "<a href=\"%s#%s\">%s</a>"
+ (org-info-map-html-url manual)
+ (org-info--expand-node-name node)
+ (or desc path)))
+ (`texinfo
+ (let ((title (or desc "")))
+ (format "@ref{%s,%s,,%s,}" node title manual)))
+ (_ nil))))
+
+(provide 'ol-info)
+
+;;; ol-info.el ends here
diff --git a/elpa/org-9.5.2/ol-info.elc b/elpa/org-9.5.2/ol-info.elc
new file mode 100644
index 0000000..9b21245
--- /dev/null
+++ b/elpa/org-9.5.2/ol-info.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ol-irc.el b/elpa/org-9.5.2/ol-irc.el
new file mode 100644
index 0000000..df62dd0
--- /dev/null
+++ b/elpa/org-9.5.2/ol-irc.el
@@ -0,0 +1,269 @@
+;;; ol-irc.el --- Links to IRC Sessions -*- lexical-binding: t; -*-
+;;
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
+;;
+;; Author: Philip Jackson <emacs@shellarchive.co.uk>
+;; Keywords: erc, irc, link, 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file implements links to an IRC session from within Org mode.
+;; Org mode loads this module by default - if this is not what you want,
+;; configure the variable `org-modules'.
+;;
+;; Please customize the variable `org-modules' to select
+;; extensions you would like to use, and to deselect those which you don't
+;; want.
+;;
+;; Please note that at the moment only ERC is supported. Other clients
+;; shouldn't be difficult to add though.
+;;
+;; Then set `org-irc-link-to-logs' to non-nil if you would like a
+;; file:/ type link to be created to the current line in the logs or
+;; to t if you would like to create an irc:/ style link.
+;;
+;; Links within an org buffer might look like this:
+;;
+;; [[irc:/irc.libera.chat/#emacs/bob][chat with bob in #emacs on Libera.Chat]]
+;; [[irc:/irc.libera.chat/#emacs][#emacs on Libera.Chat]]
+;; [[irc:/irc.libera.chat/]]
+;;
+;; If, when the resulting link is visited, there is no connection to a
+;; requested server then one will be created.
+
+;;; Code:
+
+(require 'ol)
+
+(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-default-target "erc" ())
+(declare-function erc-get-server-nickname-list "erc" ())
+(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.")
+
+(defvar erc-default-port) ; dynamically scoped from erc.el
+(defvar erc-session-port) ; dynamically scoped form erc-backend.el
+(defvar erc-session-server) ; dynamically scoped form erc-backend.el
+
+;; Generic functions/config (extend these for other clients)
+
+(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."
+ (let ((link (org-irc-parse-link link)))
+ (cond
+ ((eq org-irc-client 'erc)
+ (org-irc-visit-erc link))
+ (t
+ (error "ERC only known client")))))
+
+(defun org-irc-parse-link (link)
+ "Parse an IRC LINK and return the attributes found.
+Parse a LINK that looks like server:port/chan/user (port, chan
+and user being optional) and return any of the port, channel or user
+attributes that are found."
+ (let* ((parts (split-string link "/" t))
+ (len (length parts)))
+ (when (or (< len 1) (> len 3))
+ (error "Failed to parse link needed 1-3 parts, got %d" len))
+ (setcar parts (split-string (car parts) ":" t))
+ parts))
+
+;;;###autoload
+(defun org-irc-store-link ()
+ "Dispatch to the appropriate function to store a link to an IRC session."
+ (cond
+ ((eq major-mode 'erc-mode)
+ (org-irc-erc-store-link))))
+
+(defun org-irc-ellipsify-description (string &optional after)
+ "Remove unnecessary white space from STRING and add ellipses if necessary.
+Strip starting and ending white space from STRING and replace any
+chars that the value AFTER with `...'"
+ (let* ((after (number-to-string (or after 30)))
+ (replace-map (list (cons "^[ \t]*" "")
+ (cons "[ \t]*$" "")
+ (cons (concat "^\\(.\\{" after
+ "\\}\\).*") "\\1..."))))
+ (dolist (x replace-map string)
+ (when (string-match (car x) string)
+ (setq string (replace-match (cdr x) nil nil string))))))
+
+;; ERC specific functions
+
+(defun org-irc-erc-get-line-from-log (erc-line)
+ "Find the best line to link to from the ERC logs given ERC-LINE as a start.
+If the user is on the ERC-prompt then search backward for the
+first non-blank line, otherwise return the current line. The
+result is a cons of the filename and search string."
+ (erc-save-buffer-in-logs)
+ (require 'erc-log)
+ (with-current-buffer (find-file-noselect (erc-current-logfile))
+ (goto-char (point-max))
+ (list
+ (abbreviate-file-name buffer-file-name)
+ ;; can we get a '::' part?
+ (if (string= erc-line (erc-prompt))
+ (progn
+ (goto-char (point-at-bol))
+ (when (search-backward-regexp "^[^ ]" nil t)
+ (buffer-substring-no-properties (point-at-bol)
+ (point-at-eol))))
+ (when (search-backward erc-line nil t)
+ (buffer-substring-no-properties (point-at-bol)
+ (point-at-eol)))))))
+
+(defun org-irc-erc-store-link ()
+ "Store a link to the IRC log file or the session itself.
+Depending on the variable `org-irc-link-to-logs' store either a
+link to the log file for the current session or an irc: link to
+the session itself."
+ (require 'erc-log)
+ (if org-irc-link-to-logs
+ (let* ((erc-line (buffer-substring-no-properties
+ (point-at-bol) (point-at-eol)))
+ (parsed-line (org-irc-erc-get-line-from-log erc-line)))
+ (if (erc-logging-enabled nil)
+ (progn
+ (org-link-store-props
+ :type "file"
+ :description (concat "'" (org-irc-ellipsify-description
+ (cadr parsed-line) 20)
+ "' from an IRC conversation")
+ :link (concat "file:" (car parsed-line) "::"
+ (cadr parsed-line)))
+ t)
+ (error "This ERC session is not being logged")))
+ (let* ((link-text (org-irc-get-erc-link))
+ (link (org-irc-parse-link link-text)))
+ (if link-text
+ (progn
+ (org-link-store-props
+ :type "irc"
+ :link (concat "irc:/" link-text)
+ :description (concat "irc session `" link-text "'")
+ :server (car (car link))
+ :port (or (string-to-number (cadr (pop link))) erc-default-port)
+ :nick (pop link))
+ t)
+ (error "Failed to create ('irc:/' style) ERC link")))))
+
+(defun org-irc-get-erc-link ()
+ "Return an org compatible irc:/ link from an ERC buffer."
+ (let* ((session-port (if (numberp erc-session-port)
+ (number-to-string erc-session-port)
+ erc-session-port))
+ (link (concat erc-session-server ":" session-port)))
+ (concat link "/"
+ (if (and (erc-default-target)
+ (erc-channel-p (erc-default-target))
+ (car (get-text-property (point) 'erc-data)))
+ ;; we can get a nick
+ (let ((nick (car (get-text-property (point) 'erc-data))))
+ (concat (erc-default-target) "/" nick))
+ (erc-default-target)))))
+
+(defun org-irc-get-current-erc-port ()
+ "Return the current port as a number.
+Return the current port number or, if none is set, return the ERC
+default."
+ (cond
+ ((stringp erc-session-port)
+ (string-to-number erc-session-port))
+ ((numberp erc-session-port)
+ erc-session-port)
+ (t
+ erc-default-port)))
+
+(defun org-irc-visit-erc (link)
+ "Visit an ERC buffer based on criteria found in LINK."
+ (require 'erc)
+ (require 'erc-log)
+ (let* ((server (car (car link)))
+ (port (let ((p (cadr (pop link))))
+ (if p (string-to-number p) erc-default-port)))
+ (server-buffer)
+ (buffer-list
+ (erc-buffer-filter
+ (lambda nil
+ (let ((tmp-server-buf (erc-server-buffer)))
+ (and tmp-server-buf
+ (with-current-buffer tmp-server-buf
+ (and
+ (eq (org-irc-get-current-erc-port) port)
+ (string= erc-session-server server)
+ (setq server-buffer tmp-server-buf)))))))))
+ (if buffer-list
+ (let ((chan-name (pop link)))
+ ;; if we got a channel name then switch to it or join it
+ (if chan-name
+ (let ((chan-buf (catch 'found
+ (dolist (x buffer-list)
+ (if (string= (buffer-name x) chan-name)
+ (throw 'found x))))))
+ (if chan-buf
+ (progn
+ (pop-to-buffer-same-window chan-buf)
+ ;; if we got a nick, and they're in the chan,
+ ;; then start a chat with them
+ (let ((nick (pop link)))
+ (when nick
+ (if (member nick (erc-get-server-nickname-list))
+ (progn
+ (goto-char (point-max))
+ (insert (concat nick ": ")))
+ (error "%s not found in %s" nick chan-name)))))
+ (progn
+ (pop-to-buffer-same-window server-buffer)
+ (erc-cmd-JOIN chan-name))))
+ (pop-to-buffer-same-window server-buffer)))
+ ;; 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 "<a href=\"irc:%s\">%s</a>" link desc))
+ (`md (format "[%s](irc:%s)" desc link))
+ (_ nil))))
+
+(provide 'ol-irc)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ol-irc.el ends here
diff --git a/elpa/org-9.5.2/ol-irc.elc b/elpa/org-9.5.2/ol-irc.elc
new file mode 100644
index 0000000..40263fd
--- /dev/null
+++ b/elpa/org-9.5.2/ol-irc.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ol-man.el b/elpa/org-9.5.2/ol-man.el
new file mode 100644
index 0000000..0d9ac7c
--- /dev/null
+++ b/elpa/org-9.5.2/ol-man.el
@@ -0,0 +1,86 @@
+;;; ol-man.el --- Links to man pages -*- lexical-binding: t; -*-
+;;
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; Maintainer: Bastien Guerry <bzg@gnu.org>
+;; Keywords: outlines, hypermedia, calendar, wp
+;; Homepage: https://orgmode.org
+;;
+;; This file is part of GNU Emacs.
+;;
+;; This program 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, or (at your option)
+;; any later version.
+
+;; This program 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+(require 'ol)
+
+(org-link-set-parameters "man"
+ :follow #'org-man-open
+ :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-open (path _)
+ "Visit the manpage on PATH.
+PATH should be a topic that can be thrown at the man command.
+If PATH contains extra ::STRING which will use `occur' to search
+matched strings in man buffer."
+ (string-match "\\(.*?\\)\\(?:::\\(.*\\)\\)?$" path)
+ (let* ((command (match-string 1 path))
+ (search (match-string 2 path)))
+ (funcall org-man-command command)
+ (when search
+ (with-current-buffer (concat "*Man " command "*")
+ (goto-char (point-min))
+ (search-forward search)))))
+
+(defun org-man-store-link ()
+ "Store a link to a README file."
+ (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-link-store-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&section=all" link))
+ (desc (or description link)))
+ (cond
+ ((eq format 'html) (format "<a target=\"_blank\" href=\"%s\">%s</a>" path desc))
+ ((eq format 'latex) (format "\\href{%s}{%s}" path desc))
+ ((eq format 'texinfo) (format "@uref{%s,%s}" path desc))
+ ((eq format 'ascii) (format "%s (%s)" desc path))
+ ((eq format 'md) (format "[%s](%s)" desc path))
+ (t path))))
+
+(provide 'ol-man)
+
+;;; ol-man.el ends here
diff --git a/elpa/org-9.5.2/ol-man.elc b/elpa/org-9.5.2/ol-man.elc
new file mode 100644
index 0000000..4ef669b
--- /dev/null
+++ b/elpa/org-9.5.2/ol-man.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ol-mhe.el b/elpa/org-9.5.2/ol-mhe.el
new file mode 100644
index 0000000..37147a3
--- /dev/null
+++ b/elpa/org-9.5.2/ol-mhe.el
@@ -0,0 +1,219 @@
+;;; ol-mhe.el --- Links to MH-E Messages -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file implements links to MH-E messages from within Org.
+;; Org mode loads this module by default - if this is not what you want,
+;; configure the variable `org-modules'.
+
+;;; Code:
+
+(require 'org-macs)
+(require 'ol)
+
+;; Customization variables
+
+(defcustom org-mhe-search-all-folders nil
+ "Non-nil means the search for the mh-message may extend to all folders.
+When non-nil, the search for a message will extend to all other
+folders if it cannot be found in the folder given in the link.
+Searching all folders may be slow with the default pick based
+search but is very efficient with one of the other search engines
+supported by MH-E."
+ :group 'org-link-follow
+ :type 'boolean)
+
+;; Declare external functions and variables
+(declare-function mh-display-msg "mh-show" (msg-num folder-name))
+(declare-function mh-find-path "mh-utils" ())
+(declare-function mh-get-header-field "mh-utils" (field))
+(declare-function mh-get-msg-num "mh-utils" (error-if-no-message))
+(declare-function mh-header-display "mh-show" ())
+(declare-function mh-index-previous-folder "mh-search" ())
+(declare-function mh-normalize-folder-name "mh-utils"
+ (folder &optional empty-string-okay dont-remove-trailing-slash
+ return-nil-if-folder-empty))
+(declare-function mh-search "mh-search"
+ (folder search-regexp &optional redo-search-flag
+ window-config))
+(declare-function mh-search-choose "mh-search" (&optional searcher))
+(declare-function mh-show "mh-show" (&optional message redisplay-flag))
+(declare-function mh-show-buffer-message-number "mh-comp" (&optional buffer))
+(declare-function mh-show-header-display "mh-show" t t)
+(declare-function mh-show-msg "mh-show" (msg))
+(declare-function mh-show-show "mh-show" t t)
+(declare-function mh-visit-folder "mh-folder" (folder &optional
+ range index-data))
+(defvar mh-progs)
+(defvar mh-current-folder)
+(defvar mh-show-folder-buffer)
+(defvar mh-index-folder)
+(defvar mh-searcher)
+(defvar mh-search-regexp-builder)
+
+;; Install the link type
+(org-link-set-parameters "mhe" :follow #'org-mhe-open :store #'org-mhe-store-link)
+
+;; Implementation
+(defun org-mhe-store-link ()
+ "Store a link to an MH-E folder or message."
+ (when (or (eq major-mode 'mh-folder-mode)
+ (eq major-mode 'mh-show-mode))
+ (save-window-excursion
+ (let* ((from (org-mhe-get-header "From:"))
+ (to (org-mhe-get-header "To:"))
+ (message-id (org-mhe-get-header "Message-Id:"))
+ (subject (org-mhe-get-header "Subject:"))
+ (date (org-mhe-get-header "Date:"))
+ link desc)
+ (org-link-store-props :type "mh" :from from :to to :date date
+ :subject subject :message-id message-id)
+ (setq desc (org-link-email-description))
+ (setq link (concat "mhe:" (org-mhe-get-message-real-folder) "#"
+ (org-unbracket-string "<" ">" message-id)))
+ (org-link-add-props :link link :description desc)
+ link))))
+
+(defun org-mhe-open (path _)
+ "Follow an MH-E message link specified by PATH."
+ (let (folder article)
+ (if (not (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path))
+ (error "Error in MH-E link"))
+ (setq folder (match-string 1 path)
+ article (match-string 3 path))
+ (org-mhe-follow-link folder article)))
+
+;;; mh-e integration based on planner-mode
+(defun org-mhe-get-message-real-folder ()
+ "Return the name of the real folder for the current message.
+So if you use sequences, it will now work."
+ (save-excursion
+ (let* ((folder
+ (if (eq major-mode 'mh-folder-mode)
+ mh-current-folder
+ ;; Refer to the show buffer
+ mh-show-folder-buffer))
+ (end-index
+ (if (boundp 'mh-index-folder)
+ (min (length mh-index-folder) (length folder))))
+ )
+ ;; a simple test on mh-index-data does not work, because
+ ;; mh-index-data is always nil in a show buffer.
+ (if (and (boundp 'mh-index-folder)
+ (string= mh-index-folder (substring folder 0 end-index)))
+ (if (eq major-mode 'mh-show-mode)
+ (save-window-excursion
+ (let (pop-up-frames)
+ (when (buffer-live-p (get-buffer folder))
+ (progn
+ (pop-to-buffer folder)
+ (org-mhe-get-message-folder-from-index)
+ )
+ )))
+ (org-mhe-get-message-folder-from-index)
+ )
+ folder
+ )
+ )))
+
+(defun org-mhe-get-message-folder-from-index ()
+ "Return the name of the message folder in an index folder buffer."
+ (save-excursion
+ (mh-index-previous-folder)
+ (if (re-search-forward "^\\(\\+.*\\)$" nil t)
+ (message "%s" (match-string 1)))))
+
+(defun org-mhe-get-message-folder ()
+ "Return the name of the current message folder.
+Be careful if you use sequences."
+ (save-excursion
+ (if (eq major-mode 'mh-folder-mode)
+ mh-current-folder
+ ;; Refer to the show buffer
+ mh-show-folder-buffer)))
+
+(defun org-mhe-get-message-num ()
+ "Return the number of the current message.
+Be careful if you use sequences."
+ (save-excursion
+ (if (eq major-mode 'mh-folder-mode)
+ (mh-get-msg-num nil)
+ ;; Refer to the show buffer
+ (mh-show-buffer-message-number))))
+
+(defun org-mhe-get-header (header)
+ "Return the field for HEADER of the message in folder mode.
+This will create a show buffer for the corresponding message. If
+you have a better idea of how to do this then please let us know."
+ (let* ((folder (org-mhe-get-message-folder))
+ (num (org-mhe-get-message-num))
+ (buffer (get-buffer-create (concat "show-" folder)))
+ (header-field))
+ (with-current-buffer buffer
+ (mh-display-msg num folder)
+ (if (eq major-mode 'mh-folder-mode)
+ (mh-header-display)
+ (mh-show-header-display))
+ (set-buffer buffer)
+ (setq header-field (mh-get-header-field header))
+ (if (eq major-mode 'mh-folder-mode)
+ (mh-show)
+ (mh-show-show))
+ (org-trim header-field))))
+
+(defun org-mhe-follow-link (folder article)
+ "Follow an MH-E link to FOLDER and ARTICLE.
+If ARTICLE is nil FOLDER is shown. If the configuration variable
+`org-mhe-search-all-folders' is t and `mh-searcher' is pick,
+ARTICLE is searched in all folders. Indexed searches (swish++,
+namazu, and others supported by MH-E) will always search in all
+folders."
+ (require 'mh-e)
+ (require 'mh-search)
+ (require 'mh-utils)
+ (mh-find-path)
+ (if (not article)
+ (mh-visit-folder (mh-normalize-folder-name folder))
+ (mh-search-choose)
+ (if (eq mh-searcher 'pick)
+ (progn
+ (setq article (org-link-add-angle-brackets article))
+ (mh-search folder (list "--message-id" article))
+ (when (and org-mhe-search-all-folders
+ (not (org-mhe-get-message-real-folder)))
+ (kill-buffer)
+ (mh-search "+" (list "--message-id" article))))
+ (if mh-search-regexp-builder
+ (mh-search "+" (funcall mh-search-regexp-builder
+ (list (cons 'message-id article))))
+ (mh-search "+" article)))
+ (if (org-mhe-get-message-real-folder)
+ (mh-show-msg 1)
+ (kill-buffer)
+ (error "Message not found"))))
+
+(provide 'ol-mhe)
+
+;;; ol-mhe.el ends here
diff --git a/elpa/org-9.5.2/ol-mhe.elc b/elpa/org-9.5.2/ol-mhe.elc
new file mode 100644
index 0000000..5e6f664
--- /dev/null
+++ b/elpa/org-9.5.2/ol-mhe.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ol-rmail.el b/elpa/org-9.5.2/ol-rmail.el
new file mode 100644
index 0000000..2593ebd
--- /dev/null
+++ b/elpa/org-9.5.2/ol-rmail.el
@@ -0,0 +1,117 @@
+;;; ol-rmail.el --- Links to Rmail Messages -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file implements links to Rmail messages from within Org mode.
+;; Org mode loads this module by default - if this is not what you
+;; want, configure the variable `org-modules'.
+
+;;; Code:
+
+(require 'ol)
+
+;; Declare external functions and variables
+(declare-function rmail-show-message "rmail" (&optional n no-summary))
+(declare-function rmail-what-message "rmail" (&optional pos))
+(declare-function rmail-toggle-header "rmail" (&optional arg))
+(declare-function rmail "rmail" (&optional file-name-arg))
+(declare-function rmail-widen "rmail" ())
+(defvar rmail-current-message) ; From rmail.el
+(defvar rmail-header-style) ; From rmail.el
+(defvar rmail-file-name) ; From rmail.el
+
+;; Install the link type
+(org-link-set-parameters "rmail"
+ :follow #'org-rmail-open
+ :store #'org-rmail-store-link)
+
+;; Implementation
+(defun org-rmail-store-link ()
+ "Store a link to an Rmail folder or message."
+ (when (or (eq major-mode 'rmail-mode)
+ (eq major-mode 'rmail-summary-mode))
+ (save-window-excursion
+ (save-restriction
+ (when (eq major-mode 'rmail-summary-mode)
+ (rmail-show-message rmail-current-message))
+ (when (fboundp 'rmail-narrow-to-non-pruned-header)
+ (rmail-narrow-to-non-pruned-header))
+ (when (eq rmail-header-style 'normal)
+ (rmail-toggle-header -1))
+ (let* ((folder buffer-file-name)
+ (message-id (mail-fetch-field "message-id"))
+ (from (mail-fetch-field "from"))
+ (to (mail-fetch-field "to"))
+ (subject (mail-fetch-field "subject"))
+ (date (mail-fetch-field "date"))
+ desc link)
+ (org-link-store-props
+ :type "rmail" :from from :to to :date date
+ :subject subject :message-id message-id)
+ (setq message-id (org-unbracket-string "<" ">" message-id))
+ (setq desc (org-link-email-description))
+ (setq link (concat "rmail:" folder "#" message-id))
+ (org-link-add-props :link link :description desc)
+ (rmail-show-message rmail-current-message)
+ link)))))
+
+(defun org-rmail-open (path _)
+ "Follow an Rmail message link to the specified PATH."
+ (let (folder article)
+ (if (not (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path))
+ (error "Error in Rmail link"))
+ (setq folder (match-string 1 path)
+ article (match-string 3 path))
+ (org-rmail-follow-link folder article)))
+
+(defun org-rmail-follow-link (folder article)
+ "Follow an Rmail link to FOLDER and ARTICLE."
+ (require 'rmail)
+ (cond ((null article) (setq article ""))
+ ((stringp article)
+ (setq article (org-link-add-angle-brackets article)))
+ (t (user-error "Wrong RMAIL link format")))
+ (let (message-number)
+ (save-excursion
+ (save-window-excursion
+ (rmail (if (string= folder "RMAIL") rmail-file-name folder))
+ (setq message-number
+ (save-restriction
+ (rmail-widen)
+ (goto-char (point-max))
+ (if (re-search-backward
+ (concat "^Message-ID:\\s-+" (regexp-quote article))
+ nil t)
+ (rmail-what-message))))))
+ (if message-number
+ (progn
+ (rmail (if (string= folder "RMAIL") rmail-file-name folder))
+ (rmail-show-message message-number)
+ message-number)
+ (error "Message not found"))))
+
+(provide 'ol-rmail)
+
+;;; ol-rmail.el ends here
diff --git a/elpa/org-9.5.2/ol-rmail.elc b/elpa/org-9.5.2/ol-rmail.elc
new file mode 100644
index 0000000..37858d3
--- /dev/null
+++ b/elpa/org-9.5.2/ol-rmail.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ol-w3m.el b/elpa/org-9.5.2/ol-w3m.el
new file mode 100644
index 0000000..9e03269
--- /dev/null
+++ b/elpa/org-9.5.2/ol-w3m.el
@@ -0,0 +1,221 @@
+;;; ol-w3m.el --- Copy and Paste From W3M -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+;; Author: Andy Stewart <lazycat dot manatee at gmail dot com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file implements copying HTML content from a w3m buffer and
+;; transforming the text on the fly so that it can be pasted into an
+;; Org buffer with hot links. It will also work for regions in gnus
+;; buffers that have been washed with w3m.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Acknowledgments:
+
+;; Richard Riley <rileyrgdev at googlemail dot com>
+;;
+;; The idea of transforming the HTML content with Org syntax is
+;; proposed by Richard, I'm just coding it.
+;;
+
+;;; Code:
+
+(require 'ol)
+
+(defvar w3m-current-url)
+(defvar w3m-current-title)
+
+(org-link-set-parameters "w3m" :store #'org-w3m-store-link)
+(defun org-w3m-store-link ()
+ "Store a link to a w3m buffer."
+ (when (eq major-mode 'w3m-mode)
+ (org-link-store-props
+ :type "w3m"
+ :link w3m-current-url
+ :url (url-view-url t)
+ :description (or w3m-current-title w3m-current-url))))
+
+(defun org-w3m-copy-for-org-mode ()
+ "Copy current buffer content or active region with Org style links.
+This will encode `link-title' and `link-location' with
+`org-link-make-string', and insert the transformed test into the kill ring,
+so that it can be yanked into an Org buffer with links working correctly."
+ (interactive)
+ (let* ((regionp (org-region-active-p))
+ (transform-start (point-min))
+ (transform-end (point-max))
+ return-content
+ link-location link-title
+ temp-position out-bound)
+ (when regionp
+ (setq transform-start (region-beginning))
+ (setq transform-end (region-end))
+ ;; Deactivate mark if current mark is activate.
+ (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
+ (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))
+ (cond
+ ((<= (point) transform-end) ; point is inside transform bound
+ ;; get content between two links.
+ (when (> (point) temp-position)
+ (setq return-content (concat return-content
+ (buffer-substring
+ temp-position (point)))))
+ (cond
+ ((setq link-location (get-text-property (point) 'w3m-href-anchor))
+ ;; current point is a link
+ ;; (we thus also got link location at current point)
+ ;; get link title at current point.
+ (setq link-title (buffer-substring (point)
+ (org-w3m-get-anchor-end)))
+ ;; concat Org style url to `return-content'.
+ (setq return-content
+ (concat return-content
+ (if (org-string-nw-p link-location)
+ (org-link-make-string link-location link-title)
+ link-title))))
+ ((setq link-location (get-text-property (point) 'w3m-image))
+ ;; current point is an image
+ ;; (we thus also got image link location at current point)
+ ;; get link title at current point.
+ (setq link-title (buffer-substring (point) (org-w3m-get-image-end)))
+ ;; concat Org style url to `return-content'.
+ (setq return-content
+ (concat return-content
+ (if (org-string-nw-p link-location)
+ (org-link-make-string link-location link-title)
+ link-title))))
+ (t nil))); current point is neither a link nor an image
+ (t ; point is NOT inside transform bound
+ (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
+ (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."))))
+
+(defun org-w3m-get-anchor-start ()
+ "Move cursor to the start of current anchor. Return point."
+ ;; get start position of anchor or current point
+ ;; NOTE: This function seems never to be used. Should it be removed?
+ (goto-char (or (previous-single-property-change (point) 'w3m-anchor-sequence)
+ (point))))
+
+(defun org-w3m-get-anchor-end ()
+ "Move cursor to the end of current anchor. Return point."
+ ;; get end position of anchor or point
+ (goto-char (or (next-single-property-change (point) 'w3m-anchor-sequence)
+ (point))))
+
+(defun org-w3m-get-image-end ()
+ "Move cursor to the end of current image. Return point."
+ ;; get end position of image or point
+ ;; NOTE: Function `org-w3m-get-image-start' was not created because
+ ;; function `org-w3m-get-anchor-start' is never used.
+ (goto-char (or (next-single-property-change (point) 'w3m-image)
+ (point))))
+
+(defun org-w3m-get-next-link-start ()
+ "Move cursor to the start of next link or image. Return point."
+ (let (pos start-pos anchor-pos image-pos)
+ (setq pos (setq start-pos (point)))
+ (setq anchor-pos
+ (catch 'reach
+ (while (setq pos (next-single-property-change pos 'w3m-anchor-sequence))
+ (when (get-text-property pos 'w3m-href-anchor)
+ (throw 'reach pos)))))
+ (setq pos start-pos)
+ (setq image-pos
+ (catch 'reach
+ (while (setq pos (next-single-property-change pos 'w3m-image))
+ (when (get-text-property pos 'w3m-image)
+ (throw 'reach pos)))))
+ (goto-char (min (or anchor-pos (point-max)) (or image-pos (point-max))))))
+
+(defun org-w3m-get-prev-link-start ()
+ "Move cursor to the start of previous link. Return point."
+ ;; NOTE: This function is only called by `org-w3m-no-prev-link-p',
+ ;; which itself seems never to be used. Should it be removed?
+ ;;
+ ;; WARNING: This function has not been updated to account for
+ ;; `w3m-image'. See `org-w3m-get-next-link-start'.
+ (catch 'reach
+ (let ((pos (point)))
+ (while (setq pos (previous-single-property-change pos 'w3m-anchor-sequence))
+ (when (get-text-property pos 'w3m-href-anchor)
+ ;; jump to previous anchor
+ (goto-char pos)
+ ;; return point when current is valid link
+ (throw 'reach nil)))))
+ (point))
+
+(defun org-w3m-no-next-link-p ()
+ "Whether there is no next link after the cursor.
+Return t if there is no next link; otherwise, return nil."
+ (save-excursion
+ (equal (point) (org-w3m-get-next-link-start))))
+
+(defun org-w3m-no-prev-link-p ()
+ "Whether there is no previous link after the cursor.
+Return t if there is no previous link; otherwise, return nil."
+ ;; NOTE: This function seems never to be used. Should it be removed?
+ (save-excursion
+ (equal (point) (org-w3m-get-prev-link-start))))
+
+;; Install keys into the w3m keymap
+(defvar w3m-mode-map)
+(defvar w3m-minor-mode-map)
+(when (and (boundp 'w3m-mode-map)
+ (keymapp w3m-mode-map))
+ (define-key w3m-mode-map "\C-c\C-x\M-w" 'org-w3m-copy-for-org-mode)
+ (define-key w3m-mode-map "\C-c\C-x\C-w" 'org-w3m-copy-for-org-mode))
+(when (and (boundp 'w3m-minor-mode-map)
+ (keymapp w3m-minor-mode-map))
+ (define-key w3m-minor-mode-map "\C-c\C-x\M-w" 'org-w3m-copy-for-org-mode)
+ (define-key w3m-minor-mode-map "\C-c\C-x\C-w" 'org-w3m-copy-for-org-mode))
+(add-hook
+ 'w3m-mode-hook
+ (lambda ()
+ (define-key w3m-mode-map "\C-c\C-x\M-w" 'org-w3m-copy-for-org-mode)
+ (define-key w3m-mode-map "\C-c\C-x\C-w" 'org-w3m-copy-for-org-mode)))
+(add-hook
+ 'w3m-minor-mode-hook
+ (lambda ()
+ (define-key w3m-minor-mode-map "\C-c\C-x\M-w" 'org-w3m-copy-for-org-mode)
+ (define-key w3m-minor-mode-map "\C-c\C-x\C-w" 'org-w3m-copy-for-org-mode)))
+
+(provide 'ol-w3m)
+
+;;; ol-w3m.el ends here
diff --git a/elpa/org-9.5.2/ol-w3m.elc b/elpa/org-9.5.2/ol-w3m.elc
new file mode 100644
index 0000000..937307f
--- /dev/null
+++ b/elpa/org-9.5.2/ol-w3m.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ol.el b/elpa/org-9.5.2/ol.el
new file mode 100644
index 0000000..aa18497
--- /dev/null
+++ b/elpa/org-9.5.2/ol.el
@@ -0,0 +1,2042 @@
+;;; ol.el --- Org links library -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library provides tooling to handle both external and internal
+;; links.
+
+;;; Code:
+
+(require 'org-compat)
+(require 'org-macs)
+
+(defvar clean-buffer-list-kill-buffer-names)
+(defvar org-agenda-buffer-name)
+(defvar org-comment-string)
+(defvar org-highlight-links)
+(defvar org-id-link-to-org-use-id)
+(defvar org-inhibit-startup)
+(defvar org-outline-regexp-bol)
+(defvar org-src-source-file-name)
+(defvar org-time-stamp-formats)
+(defvar org-ts-regexp)
+
+(declare-function calendar-cursor-to-date "calendar" (&optional error event))
+(declare-function dired-get-filename "dired" (&optional localp no-error-if-not-filep))
+(declare-function org-at-heading-p "org" (&optional _))
+(declare-function org-back-to-heading "org" (&optional invisible-ok))
+(declare-function org-before-first-heading-p "org" ())
+(declare-function org-do-occur "org" (regexp &optional cleanup))
+(declare-function org-element-at-point "org-element" ())
+(declare-function org-element-cache-refresh "org-element" (pos))
+(declare-function org-element-context "org-element" (&optional element))
+(declare-function org-element-lineage "org-element" (datum &optional types with-self))
+(declare-function org-element-link-parser "org-element" ())
+(declare-function org-element-property "org-element" (property element))
+(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-find-property "org" (property &optional value))
+(declare-function org-get-heading "org" (&optional no-tags no-todo no-priority no-comment))
+(declare-function org-id-find-id-file "org-id" (id))
+(declare-function org-id-store-link "org-id" ())
+(declare-function org-insert-heading "org" (&optional arg invisible-ok top))
+(declare-function org-load-modules-maybe "org" (&optional force))
+(declare-function org-mark-ring-push "org" (&optional pos buffer))
+(declare-function org-mode "org" ())
+(declare-function org-occur "org" (regexp &optional keep-previous callback))
+(declare-function org-open-file "org" (path &optional in-emacs line search))
+(declare-function org-overview "org" ())
+(declare-function org-restart-font-lock "org" ())
+(declare-function org-run-like-in-org-mode "org" (cmd))
+(declare-function org-show-context "org" (&optional key))
+(declare-function org-src-coderef-format "org-src" (&optional element))
+(declare-function org-src-coderef-regexp "org-src" (fmt &optional label))
+(declare-function org-src-edit-buffer-p "org-src" (&optional buffer))
+(declare-function org-src-source-buffer "org-src" ())
+(declare-function org-src-source-type "org-src" ())
+(declare-function org-time-stamp-format "org" (&optional long inactive))
+(declare-function outline-next-heading "outline" ())
+
+
+;;; Customization
+
+(defgroup org-link nil
+ "Options concerning links in Org mode."
+ :tag "Org Link"
+ :group 'org)
+
+(defcustom org-link-parameters nil
+ "Alist of properties that defines all the links in Org mode.
+
+The key in each association is a string of the link type.
+Subsequent optional elements make up a property list for that
+type.
+
+All properties are optional. However, the most important ones
+are, in this order, `:follow', `:export', and `:store', described
+below.
+
+`:follow'
+
+ Function used to follow the link, when the `org-open-at-point'
+ command runs on it. It is called with two arguments: the path,
+ as a string, and a universal prefix argument.
+
+ Here, you may use `org-link-open-as-file' helper function for
+ types similar to \"file\".
+
+`:export'
+
+ Function that accepts four arguments:
+ - the path, as a string,
+ - the description as a string, or nil,
+ - the export back-end,
+ - the export communication channel, as a plist.
+
+ When nil, export for that type of link is delegated to the
+ back-end.
+
+`:store'
+
+ Function responsible for storing the link. See the function
+ `org-store-link-functions' for a description of the expected
+ arguments.
+
+Additional properties provide more specific control over the
+link.
+
+`:activate-func'
+
+ Function to run at the end of Font Lock activation. It must
+ accept four arguments:
+ - the buffer position at the start of the link,
+ - the buffer position at its end,
+ - the path, as a string,
+ - a boolean, non-nil when the link has brackets.
+
+`:complete'
+
+ Function that inserts a link with completion. The function
+ takes one optional prefix argument.
+
+`:display'
+
+ Value for `invisible' text property on the hidden parts of the
+ link. The most useful value is `full', which will not fold the
+ link in descriptive display. Default is `org-link'.
+
+`:face'
+
+ Face for the link, or a function returning a face. The
+ function takes one argument, which is the path.
+
+ The default face is `org-link'.
+
+`:help-echo'
+
+ String or function used as a value for the `help-echo' text
+ property. The function is called with one argument, the help
+ string to display, and should return a string.
+
+`:htmlize-link'
+
+ Function or plist for the `htmlize-link' text property. The
+ function takes no argument.
+
+ Default is (:uri \"type:path\")
+
+`:keymap'
+
+ Active keymap when point is on the link. Default is
+ `org-mouse-map'.
+
+`:mouse-face'
+
+ Face used when hovering over the link. Default is
+ `highlight'."
+ :group 'org-link
+ :package-version '(Org . "9.1")
+ :type '(alist :tag "Link display parameters"
+ :value-type plist))
+
+(defcustom org-link-descriptive t
+ "Non-nil means Org displays descriptive links.
+
+E.g. [[https://orgmode.org][Org website]] is be displayed as
+\"Org Website\", hiding the link itself and just displaying its
+description. When set to nil, Org displays the full links
+literally.
+
+You can interactively set the value of this variable by calling
+`org-toggle-link-display' or from the \"Org > Hyperlinks\" menu."
+ :group 'org-link
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-link-make-description-function nil
+ "Function to use for generating link descriptions from links.
+This function must take two parameters: the first one is the
+link, the second one is the description generated by
+`org-insert-link'. The function should return the description to
+use."
+ :group 'org-link
+ :type '(choice (const nil) (function))
+ :safe #'null)
+
+(defcustom org-link-file-path-type 'adaptive
+ "How the path name in file links should be stored.
+Valid values are:
+
+relative Relative to the current directory, i.e. the directory of the file
+ into which the link is being inserted.
+absolute Absolute path, if possible with ~ for home directory.
+noabbrev Absolute path, no abbreviation of home directory.
+adaptive Use relative path for files in the current directory and sub-
+ directories of it. For other files, use an absolute path.
+
+Alternatively, users may supply a custom function that takes the
+full filename as an argument and returns the path."
+ :group 'org-link
+ :type '(choice
+ (const relative)
+ (const absolute)
+ (const noabbrev)
+ (const adaptive)
+ (function))
+ :package-version '(Org . "9.5")
+ :safe #'symbolp)
+
+(defcustom org-link-abbrev-alist nil
+ "Alist of link abbreviations.
+The car of each element is a string, to be replaced at the start of a link.
+The cdrs are replacement values, like (\"linkkey\" . REPLACE). Abbreviated
+links in Org buffers can have an optional tag after a double colon, e.g.,
+
+ [[linkkey:tag][description]]
+
+The `linkkey' must be a single word, starting with a letter, followed
+by letters, numbers, `-' or `_'.
+
+If REPLACE is a string, the tag will simply be appended to create the link.
+If the string contains \"%s\", the tag will be inserted there. If the string
+contains \"%h\", it will cause a url-encoded version of the tag to be inserted
+at that point (see the function `url-hexify-string'). If the string contains
+the specifier \"%(my-function)\", then the custom function `my-function' will
+be invoked: this function takes the tag as its only argument and must return
+a string.
+
+REPLACE may also be a function that will be called with the tag as the
+only argument to create the link, which should be returned as a string.
+
+See the manual for examples."
+ :group 'org-link
+ :type '(repeat
+ (cons (string :tag "Protocol")
+ (choice
+ (string :tag "Format")
+ (function))))
+ :safe (lambda (val)
+ (pcase val
+ (`(,(pred stringp) . ,(pred stringp)) t)
+ (_ nil))))
+
+(defgroup org-link-follow nil
+ "Options concerning following links in Org mode."
+ :tag "Org Follow Link"
+ :group 'org-link)
+
+(defcustom org-link-translation-function nil
+ "Function to translate links with different syntax to Org syntax.
+This can be used to translate links created for example by the Planner
+or emacs-wiki packages to Org syntax.
+The function must accept two parameters, a TYPE containing the link
+protocol name like \"rmail\" or \"gnus\" as a string, and the linked path,
+which is everything after the link protocol. It should return a cons
+with possibly modified values of type and path.
+Org contains a function for this, so if you set this variable to
+`org-translate-link-from-planner', you should be able follow many
+links created by planner."
+ :group 'org-link-follow
+ :type '(choice (const nil) (function))
+ :safe #'null)
+
+(defcustom org-link-frame-setup
+ '((vm . vm-visit-folder-other-frame)
+ (vm-imap . vm-visit-imap-folder-other-frame)
+ (gnus . org-gnus-no-new-news)
+ (file . find-file-other-window)
+ (wl . wl-other-frame))
+ "Setup the frame configuration for following links.
+When following a link with Emacs, it may often be useful to display
+this link in another window or frame. This variable can be used to
+set this up for the different types of links.
+For VM, use any of
+ `vm-visit-folder'
+ `vm-visit-folder-other-window'
+ `vm-visit-folder-other-frame'
+For Gnus, use any of
+ `gnus'
+ `gnus-other-frame'
+ `org-gnus-no-new-news'
+For FILE, use any of
+ `find-file'
+ `find-file-other-window'
+ `find-file-other-frame'
+For Wanderlust use any of
+ `wl'
+ `wl-other-frame'
+For the calendar, use the variable `calendar-setup'.
+For BBDB, it is currently only possible to display the matches in
+another window."
+ :group 'org-link-follow
+ :type '(list
+ (cons (const vm)
+ (choice
+ (const vm-visit-folder)
+ (const vm-visit-folder-other-window)
+ (const vm-visit-folder-other-frame)))
+ (cons (const vm-imap)
+ (choice
+ (const vm-visit-imap-folder)
+ (const vm-visit-imap-folder-other-window)
+ (const vm-visit-imap-folder-other-frame)))
+ (cons (const gnus)
+ (choice
+ (const gnus)
+ (const gnus-other-frame)
+ (const org-gnus-no-new-news)))
+ (cons (const file)
+ (choice
+ (const find-file)
+ (const find-file-other-window)
+ (const find-file-other-frame)))
+ (cons (const wl)
+ (choice
+ (const wl)
+ (const wl-other-frame)))))
+
+(defcustom org-link-search-must-match-exact-headline 'query-to-create
+ "Non-nil means internal fuzzy links can only match headlines.
+
+When nil, the a fuzzy link may point to a target or a named
+construct in the document. When set to the special value
+`query-to-create', offer to create a new headline when none
+matched.
+
+Spaces and statistics cookies are ignored during heading searches."
+ :group 'org-link-follow
+ :version "24.1"
+ :type '(choice
+ (const :tag "Use fuzzy text search" nil)
+ (const :tag "Match only exact headline" t)
+ (const :tag "Match exact headline or query to create it"
+ query-to-create))
+ :safe #'symbolp)
+
+(defcustom org-link-use-indirect-buffer-for-internals nil
+ "Non-nil means use indirect buffer to display infile links.
+Activating internal links (from one location in a file to another location
+in the same file) normally just jumps to the location. When the link is
+activated with a `\\[universal-argument]' prefix (or with mouse-3), the link \
+is displayed in
+another window. When this option is set, the other window actually displays
+an indirect buffer clone of the current buffer, to avoid any visibility
+changes to the current buffer."
+ :group 'org-link-follow
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-link-shell-confirm-function 'yes-or-no-p
+ "Non-nil means ask for confirmation before executing shell links.
+
+Shell links can be dangerous: just think about a link
+
+ [[shell:rm -rf ~/*][Web Search]]
+
+This link would show up in your Org document as \"Web Search\",
+but really it would remove your entire home directory.
+Therefore we advise against setting this variable to nil.
+Just change it to `y-or-n-p' if you want to confirm with a
+single keystroke rather than having to type \"yes\"."
+ :group 'org-link-follow
+ :type '(choice
+ (const :tag "with yes-or-no (safer)" yes-or-no-p)
+ (const :tag "with y-or-n (faster)" y-or-n-p)
+ (const :tag "no confirmation (dangerous)" nil)))
+
+(defcustom org-link-shell-skip-confirm-regexp ""
+ "Regexp to skip confirmation for shell links."
+ :group 'org-link-follow
+ :version "24.1"
+ :type 'regexp)
+
+(defcustom org-link-elisp-confirm-function 'yes-or-no-p
+ "Non-nil means ask for confirmation before executing Emacs Lisp links.
+Elisp links can be dangerous: just think about a link
+
+ [[elisp:(shell-command \"rm -rf ~/*\")][Web Search]]
+
+This link would show up in your Org document as \"Web Search\",
+but really it would remove your entire home directory.
+Therefore we advise against setting this variable to nil.
+Just change it to `y-or-n-p' if you want to confirm with a
+single keystroke rather than having to type \"yes\"."
+ :group 'org-link-follow
+ :type '(choice
+ (const :tag "with yes-or-no (safer)" yes-or-no-p)
+ (const :tag "with y-or-n (faster)" y-or-n-p)
+ (const :tag "no confirmation (dangerous)" nil)))
+
+(defcustom org-link-elisp-skip-confirm-regexp ""
+ "A regexp to skip confirmation for Elisp links."
+ :group 'org-link-follow
+ :version "24.1"
+ :type 'regexp)
+
+(defgroup org-link-store nil
+ "Options concerning storing links in Org mode."
+ :tag "Org Store Link"
+ :group 'org-link)
+
+(defcustom org-link-context-for-files t
+ "Non-nil means file links from `org-store-link' contain context.
+\\<org-mode-map>
+A search string is added to the file name with \"::\" as separator
+and used to find the context when the link is activated by the command
+`org-open-at-point'. When this option is t, the entire active region
+is be placed in the search string of the file link. If set to a
+positive integer N, only the first N lines of context are stored.
+
+Using a prefix argument to the command `org-store-link' \
+\(`\\[universal-argument] \\[org-store-link]')
+negates this setting for the duration of the command."
+ :group 'org-link-store
+ :type '(choice boolean integer)
+ :safe (lambda (val) (or (booleanp val) (integerp val))))
+
+(defcustom org-link-email-description-format "Email %c: %s"
+ "Format of the description part of a link to an email or Usenet message.
+The following %-escapes will be replaced by corresponding information:
+
+%F full \"From\" field
+%f name, taken from \"From\" field, address if no name
+%T full \"To\" field
+%t first name in \"To\" field, address if no name
+%c correspondent. Usually \"from NAME\", but if you sent it yourself, it
+ will be \"to NAME\". See also the variable `org-from-is-user-regexp'.
+%s subject
+%d date
+%m message-id.
+
+You may use normal field width specification between the % and the letter.
+This is for example useful to limit the length of the subject.
+
+Examples: \"%f on: %.30s\", \"Email from %f\", \"Email %c\""
+ :group 'org-link-store
+ :package-version '(Org . "9.3")
+ :type 'string
+ :safe #'stringp)
+
+(defcustom org-link-from-user-regexp
+ (let ((mail (and (org-string-nw-p user-mail-address)
+ (format "\\<%s\\>" (regexp-quote user-mail-address))))
+ (name (and (org-string-nw-p user-full-name)
+ (format "\\<%s\\>" (regexp-quote user-full-name)))))
+ (if (and mail name) (concat mail "\\|" name) (or mail name)))
+ "Regexp matched against the \"From:\" header of an email or Usenet message.
+It should match if the message is from the user him/herself."
+ :group 'org-link-store
+ :type 'regexp
+ :safe #'stringp)
+
+(defcustom org-link-keep-stored-after-insertion nil
+ "Non-nil means keep link in list for entire session.
+\\<org-mode-map>
+The command `org-store-link' adds a link pointing to the current
+location to an internal list. These links accumulate during a session.
+The command `org-insert-link' can be used to insert links into any
+Org file (offering completion for all stored links).
+
+When this option is nil, every link which has been inserted once using
+`\\[org-insert-link]' will be removed from the list, to make completing the \
+unused
+links more efficient."
+ :group 'org-link-store
+ :type 'boolean
+ :safe #'booleanp)
+
+;;; Public variables
+
+(defconst org-target-regexp (let ((border "[^<>\n\r \t]"))
+ (format "<<\\(%s\\|%s[^<>\n\r]*%s\\)>>"
+ border border border))
+ "Regular expression matching a link target.")
+
+(defconst org-radio-target-regexp (format "<%s>" org-target-regexp)
+ "Regular expression matching a radio target.")
+
+(defvar-local org-target-link-regexp nil
+ "Regular expression matching radio targets in plain text.")
+
+(defvar org-link-types-re nil
+ "Matches a link that has a url-like prefix like \"http:\".")
+
+(defvar org-link-angle-re nil
+ "Matches link with angular brackets, spaces are allowed.")
+
+(defvar org-link-plain-re nil
+ "Matches plain link, without spaces.
+Group 1 must contain the link type (i.e. https).
+Group 2 must contain the link path (i.e. //example.com).
+Used by `org-element-link-parser'.")
+
+(defvar org-link-bracket-re nil
+ "Matches a link in double brackets.")
+
+(defvar org-link-any-re nil
+ "Regular expression matching any link.")
+
+(defvar-local org-link-abbrev-alist-local nil
+ "Buffer-local version of `org-link-abbrev-alist', which see.
+The value of this is taken from the LINK keywords.")
+
+(defvar org-stored-links nil
+ "Contains the links stored with `org-store-link'.")
+
+(defvar org-store-link-plist nil
+ "Plist with info about the most recently link created with `org-store-link'.")
+
+(defvar org-create-file-search-functions nil
+ "List of functions to construct the right search string for a file link.
+
+These functions are called in turn with point at the location to
+which the link should point.
+
+A function in the hook should first test if it would like to
+handle this file type, for example by checking the `major-mode'
+or the file extension. If it decides not to handle this file, it
+should just return nil to give other functions a chance. If it
+does handle the file, it must return the search string to be used
+when following the link. The search string will be part of the
+file link, given after a double colon, and `org-open-at-point'
+will automatically search for it. If special measures must be
+taken to make the search successful, another function should be
+added to the companion hook `org-execute-file-search-functions',
+which see.
+
+A function in this hook may also use `setq' to set the variable
+`description' to provide a suggestion for the descriptive text to
+be used for this link when it gets inserted into an Org buffer
+with \\[org-insert-link].")
+
+(defvar org-execute-file-search-functions nil
+ "List of functions to execute a file search triggered by a link.
+
+Functions added to this hook must accept a single argument, the
+search string that was part of the file link, the part after the
+double colon. The function must first check if it would like to
+handle this search, for example by checking the `major-mode' or
+the file extension. If it decides not to handle this search, it
+should just return nil to give other functions a chance. If it
+does handle the search, it must return a non-nil value to keep
+other functions from trying.
+
+Each function can access the current prefix argument through the
+variable `current-prefix-arg'. Note that a single prefix is used
+to force opening a link in Emacs, so it may be good to only use a
+numeric or double prefix to guide the search function.
+
+In case this is needed, a function in this hook can also restore
+the window configuration before `org-open-at-point' was called using:
+
+ (set-window-configuration org-window-config-before-follow-link)")
+
+(defvar org-open-link-functions nil
+ "Hook for functions finding a plain text link.
+These functions must take a single argument, the link content.
+They will be called for links that look like [[link text][description]]
+when LINK TEXT does not have a protocol like \"http:\" and does not look
+like a filename (e.g. \"./blue.png\").
+
+These functions will be called *before* Org attempts to resolve the
+link by doing text searches in the current buffer - so if you want a
+link \"[[target]]\" to still find \"<<target>>\", your function should
+handle this as a special case.
+
+When the function does handle the link, it must return a non-nil value.
+If it decides that it is not responsible for this link, it must return
+nil to indicate that Org can continue with other options like
+exact and fuzzy text search.")
+
+
+;;; Internal Variables
+
+(defconst org-link--forbidden-chars "]\t\n\r<>"
+ "Characters forbidden within a link, as a string.")
+
+(defvar org-link--history nil
+ "History for inserted links.")
+
+(defvar org-link--insert-history nil
+ "Minibuffer history for links inserted with `org-insert-link'.")
+
+(defvar org-link--search-failed nil
+ "Non-nil when last link search failed.")
+
+
+;;; Internal Functions
+
+(defun org-link--try-special-completion (type)
+ "If there is completion support for link type TYPE, offer it."
+ (let ((fun (org-link-get-parameter type :complete)))
+ (if (functionp fun)
+ (funcall fun)
+ (read-string "Link (no completion support): " (concat type ":")))))
+
+(defun org-link--prettify (link)
+ "Return a human-readable representation of LINK.
+The car of LINK must be a raw link. The cdr of LINK must be
+either a link description or nil."
+ (let ((desc (or (cadr link) "<no description>")))
+ (concat (format "%-45s" (substring desc 0 (min (length desc) 40)))
+ "<" (car link) ">")))
+
+(defun org-link--decode-compound (hex)
+ "Unhexify Unicode hex-chars HEX.
+E.g. \"%C3%B6\" is the German o-Umlaut. Note: this function also
+decodes single byte encodings like \"%E1\" (a-acute) if not
+followed by another \"%[A-F0-9]{2}\" group."
+ (save-match-data
+ (let* ((bytes (cdr (split-string hex "%")))
+ (ret "")
+ (eat 0)
+ (sum 0))
+ (while bytes
+ (let* ((val (string-to-number (pop bytes) 16))
+ (shift-xor
+ (if (= 0 eat)
+ (cond
+ ((>= val 252) (cons 6 252))
+ ((>= val 248) (cons 5 248))
+ ((>= val 240) (cons 4 240))
+ ((>= val 224) (cons 3 224))
+ ((>= val 192) (cons 2 192))
+ (t (cons 0 0)))
+ (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))
+ (when (> eat 0) (setq eat (- eat 1)))
+ (cond
+ ((= 0 eat) ;multi byte
+ (setq ret (concat ret (char-to-string sum)))
+ (setq sum 0))
+ ((not bytes) ; single byte(s)
+ (setq ret (org-link--decode-single-byte-sequence hex))))))
+ ret)))
+
+(defun org-link--decode-single-byte-sequence (hex)
+ "Unhexify hex-encoded single byte character sequence HEX."
+ (mapconcat (lambda (byte)
+ (char-to-string (string-to-number byte 16)))
+ (cdr (split-string hex "%"))
+ ""))
+
+(defun org-link--fontify-links-to-this-file ()
+ "Fontify links to the current file in `org-stored-links'."
+ (let ((f (buffer-file-name)) a b)
+ (setq a (mapcar (lambda(l)
+ (let ((ll (car l)))
+ (when (and (string-match "^file:\\(.+\\)::" ll)
+ (equal f (expand-file-name (match-string 1 ll))))
+ ll)))
+ org-stored-links))
+ (when (featurep 'org-id)
+ (setq b (mapcar (lambda(l)
+ (let ((ll (car l)))
+ (when (and (string-match "^id:\\(.+\\)$" ll)
+ (equal f (expand-file-name
+ (or (org-id-find-id-file
+ (match-string 1 ll)) ""))))
+ ll)))
+ org-stored-links)))
+ (mapcar (lambda(l)
+ (put-text-property 0 (length l) 'face 'font-lock-comment-face l))
+ (delq nil (append a b)))))
+
+(defun org-link--buffer-for-internals ()
+ "Return buffer used for displaying the target of internal links."
+ (cond
+ ((not org-link-use-indirect-buffer-for-internals) (current-buffer))
+ ((string-suffix-p "(Clone)" (buffer-name))
+ (message "Buffer is already a clone, not making another one")
+ ;; We also do not modify visibility in this case.
+ (current-buffer))
+ (t ;make a new indirect buffer for displaying the link
+ (let* ((indirect-buffer-name (concat (buffer-name) "(Clone)"))
+ (indirect-buffer
+ (or (get-buffer indirect-buffer-name)
+ (make-indirect-buffer (current-buffer)
+ indirect-buffer-name
+ 'clone))))
+ (with-current-buffer indirect-buffer (org-overview))
+ indirect-buffer))))
+
+(defun org-link--search-radio-target (target)
+ "Search a radio target matching TARGET in current buffer.
+White spaces are not significant."
+ (let ((re (format "<<<%s>>>"
+ (mapconcat #'regexp-quote
+ (split-string target)
+ "[ \t]+\\(?:\n[ \t]*\\)?")))
+ (origin (point)))
+ (goto-char (point-min))
+ (catch :radio-match
+ (while (re-search-forward re nil t)
+ (forward-char -1)
+ (let ((object (org-element-context)))
+ (when (eq (org-element-type object) 'radio-target)
+ (goto-char (org-element-property :begin object))
+ (org-show-context 'link-search)
+ (throw :radio-match nil))))
+ (goto-char origin)
+ (user-error "No match for radio target: %s" target))))
+
+(defun org-link--context-from-region ()
+ "Return context string from active region, or nil."
+ (when (org-region-active-p)
+ (let ((context (buffer-substring (region-beginning) (region-end))))
+ (when (and (wholenump org-link-context-for-files)
+ (> org-link-context-for-files 0))
+ (let ((lines (org-split-string context "\n")))
+ (setq context
+ (mapconcat #'identity
+ (cl-subseq lines 0 org-link-context-for-files)
+ "\n"))))
+ context)))
+
+(defun org-link--normalize-string (string &optional context)
+ "Remove ignored contents from STRING string and return it.
+This function removes contiguous white spaces and statistics
+cookies. When optional argument CONTEXT is non-nil, it assumes
+STRING is a context string, and also removes special search
+syntax around the string."
+ (let ((string
+ (org-trim
+ (replace-regexp-in-string
+ (rx (one-or-more (any " \t")))
+ " "
+ (replace-regexp-in-string
+ ;; Statistics cookie regexp.
+ (rx (seq "[" (0+ digit) (or "%" (seq "/" (0+ digit))) "]"))
+ " "
+ string)))))
+ (when context
+ (while (cond ((and (string-prefix-p "(" string)
+ (string-suffix-p ")" string))
+ (setq string (org-trim (substring string 1 -1))))
+ ((string-match "\\`[#*]+[ \t]*" string)
+ (setq string (substring string (match-end 0))))
+ (t nil))))
+ string))
+
+
+;;; Public API
+
+(defun org-link-types ()
+ "Return a list of known link types."
+ (mapcar #'car org-link-parameters))
+
+(defun org-link-get-parameter (type key)
+ "Get TYPE link property for KEY.
+TYPE is a string and KEY is a plist keyword. See
+`org-link-parameters' for supported keywords."
+ (plist-get (cdr (assoc type org-link-parameters))
+ key))
+
+(defun org-link-set-parameters (type &rest parameters)
+ "Set link TYPE properties to PARAMETERS.
+PARAMETERS should be keyword value pairs. See
+`org-link-parameters' for supported keys."
+ (when (member type '("coderef" "custom-id" "fuzzy" "radio"))
+ (error "Cannot override reserved link type: %S" type))
+ (let ((data (assoc type org-link-parameters)))
+ (if data (setcdr data (org-combine-plists (cdr data) parameters))
+ (push (cons type parameters) org-link-parameters)
+ (org-link-make-regexps)
+ (when (featurep 'org-element) (org-element-update-syntax)))))
+
+(defun org-link-make-regexps ()
+ "Update the link regular expressions.
+This should be called after the variable `org-link-parameters' has changed."
+ (let ((types-re (regexp-opt (org-link-types) t)))
+ (setq org-link-types-re
+ (concat "\\`" types-re ":")
+ org-link-angle-re
+ (format "<%s:\\([^>\n]*\\(?:\n[ \t]*[^> \t\n][^>\n]*\\)*\\)>"
+ types-re)
+ org-link-plain-re
+ (let* ((non-space-bracket "[^][ \t\n()<>]")
+ (parenthesis
+ `(seq "("
+ (0+ (or (regex ,non-space-bracket)
+ (seq "("
+ (0+ (regex ,non-space-bracket))
+ ")")))
+ ")")))
+ ;; Heuristics for an URL link inspired by
+ ;; https://daringfireball.net/2010/07/improved_regex_for_matching_urls
+ (rx-to-string
+ `(seq word-start
+ ;; Link type: match group 1.
+ (regexp ,types-re)
+ ":"
+ ;; Link path: match group 2.
+ (group
+ (1+ (or (regex ,non-space-bracket)
+ ,parenthesis))
+ (or (regexp "[^[:punct:] \t\n]")
+ ?/
+ ,parenthesis)))))
+ org-link-bracket-re
+ (rx (seq "[["
+ ;; URI part: match group 1.
+ (group
+ (one-or-more
+ (or (not (any "[]\\"))
+ (and "\\" (zero-or-more "\\\\") (any "[]"))
+ (and (one-or-more "\\") (not (any "[]"))))))
+ "]"
+ ;; Description (optional): match group 2.
+ (opt "[" (group (+? anything)) "]")
+ "]"))
+ org-link-any-re
+ (concat "\\(" org-link-bracket-re "\\)\\|\\("
+ org-link-angle-re "\\)\\|\\("
+ org-link-plain-re "\\)"))))
+
+(defun org-link-complete-file (&optional arg)
+ "Create a file link using completion."
+ (let ((file (read-file-name "File: "))
+ (pwd (file-name-as-directory (expand-file-name ".")))
+ (pwd1 (file-name-as-directory (abbreviate-file-name
+ (expand-file-name ".")))))
+ (cond ((equal arg '(16))
+ (concat "file:"
+ (abbreviate-file-name (expand-file-name file))))
+ ((string-match
+ (concat "^" (regexp-quote pwd1) "\\(.+\\)") file)
+ (concat "file:" (match-string 1 file)))
+ ((string-match
+ (concat "^" (regexp-quote pwd) "\\(.+\\)")
+ (expand-file-name file))
+ (concat "file:"
+ (match-string 1 (expand-file-name file))))
+ (t (concat "file:" file)))))
+
+(defun org-link-email-description (&optional fmt)
+ "Return the description part of an email link.
+This takes information from `org-store-link-plist' and formats it
+according to FMT (default from `org-link-email-description-format')."
+ (setq fmt (or fmt org-link-email-description-format))
+ (let* ((p org-store-link-plist)
+ (to (plist-get p :toaddress))
+ (from (plist-get p :fromaddress))
+ (table
+ (list
+ (cons "%c" (plist-get p :fromto))
+ (cons "%F" (plist-get p :from))
+ (cons "%f" (or (plist-get p :fromname) (plist-get p :fromaddress) "?"))
+ (cons "%T" (plist-get p :to))
+ (cons "%t" (or (plist-get p :toname) (plist-get p :toaddress) "?"))
+ (cons "%s" (plist-get p :subject))
+ (cons "%d" (plist-get p :date))
+ (cons "%m" (plist-get p :message-id)))))
+ (when (string-match "%c" fmt)
+ ;; Check if the user wrote this message
+ (if (and org-link-from-user-regexp from to
+ (save-match-data (string-match org-link-from-user-regexp from)))
+ (setq fmt (replace-match "to %t" t t fmt))
+ (setq fmt (replace-match "from %f" t t fmt))))
+ (org-replace-escapes fmt table)))
+
+(defun org-link-store-props (&rest plist)
+ "Store link properties.
+The properties are pre-processed by extracting names, addresses
+and dates."
+ (let ((x (plist-get plist :from)))
+ (when x
+ (let ((adr (mail-extract-address-components x)))
+ (setq plist (plist-put plist :fromname (car adr)))
+ (setq plist (plist-put plist :fromaddress (nth 1 adr))))))
+ (let ((x (plist-get plist :to)))
+ (when x
+ (let ((adr (mail-extract-address-components x)))
+ (setq plist (plist-put plist :toname (car adr)))
+ (setq plist (plist-put plist :toaddress (nth 1 adr))))))
+ (let ((x (ignore-errors (date-to-time (plist-get plist :date)))))
+ (when x
+ (setq plist (plist-put plist :date-timestamp
+ (format-time-string
+ (org-time-stamp-format t) x)))
+ (setq plist (plist-put plist :date-timestamp-inactive
+ (format-time-string
+ (org-time-stamp-format t t) x)))))
+ (let ((from (plist-get plist :from))
+ (to (plist-get plist :to)))
+ (when (and from to org-link-from-user-regexp)
+ (setq plist
+ (plist-put plist :fromto
+ (if (string-match org-link-from-user-regexp from)
+ (concat "to %t")
+ (concat "from %f"))))))
+ (setq org-store-link-plist plist))
+
+(defun org-link-add-props (&rest plist)
+ "Add these properties to the link property list."
+ (let (key value)
+ (while plist
+ (setq key (pop plist) value (pop plist))
+ (setq org-store-link-plist
+ (plist-put org-store-link-plist key value)))))
+
+(defun org-link-encode (text table)
+ "Return percent escaped representation of string TEXT.
+TEXT is a string with the text to escape. TABLE is a list of
+characters that should be escaped."
+ (mapconcat
+ (lambda (c)
+ (if (memq c table)
+ (mapconcat (lambda (e) (format "%%%.2X" e))
+ (or (encode-coding-char c 'utf-8)
+ (error "Unable to percent escape character: %c" c))
+ "")
+ (char-to-string c)))
+ text ""))
+
+(defun org-link-decode (s)
+ "Decode percent-encoded parts in string S.
+E.g. \"%C3%B6\" becomes the german o-Umlaut."
+ (replace-regexp-in-string "\\(%[0-9A-Za-z]\\{2\\}\\)+"
+ #'org-link--decode-compound s t t))
+
+(defun org-link-escape (link)
+ "Backslash-escape sensitive characters in string LINK."
+ (replace-regexp-in-string
+ (rx (seq (group (zero-or-more "\\")) (group (or string-end (any "[]")))))
+ (lambda (m)
+ (concat (match-string 1 m)
+ (match-string 1 m)
+ (and (/= (match-beginning 2) (match-end 2)) "\\")))
+ link nil t 1))
+
+(defun org-link-unescape (link)
+ "Remove escaping backslash characters from string LINK."
+ (replace-regexp-in-string
+ (rx (group (one-or-more "\\")) (or string-end (any "[]")))
+ (lambda (_)
+ (concat (make-string (/ (- (match-end 1) (match-beginning 1)) 2) ?\\)))
+ link nil t 1))
+
+(defun org-link-make-string (link &optional description)
+ "Make a bracket link, consisting of LINK and DESCRIPTION.
+LINK is escaped with backslashes for inclusion in buffer."
+ (let* ((zero-width-space (string ?\x200B))
+ (description
+ (and (org-string-nw-p description)
+ ;; Description cannot contain two consecutive square
+ ;; brackets, or end with a square bracket. To prevent
+ ;; this, insert a zero width space character between
+ ;; the brackets, or at the end of the description.
+ (replace-regexp-in-string
+ "\\(]\\)\\(]\\)"
+ (concat "\\1" zero-width-space "\\2")
+ (replace-regexp-in-string "]\\'"
+ (concat "\\&" zero-width-space)
+ (org-trim description))))))
+ (if (not (org-string-nw-p link)) description
+ (format "[[%s]%s]"
+ (org-link-escape link)
+ (if description (format "[%s]" description) "")))))
+
+(defun org-store-link-functions ()
+ "List of functions that are called to create and store a link.
+
+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
+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
+a non-nil value after calling `org-link-store-props' with a list
+of properties and values. Special properties are:
+
+:type The link prefix, like \"http\". This must be given.
+:link The link, like \"http://www.astro.uva.nl/~dominik\".
+ This is obligatory as well.
+:description Optional default description for the second pair
+ of brackets in an Org mode link. The user can still change
+ this when inserting this link into an Org mode buffer.
+
+In addition to these, any additional properties can be specified
+and then used in capture templates."
+ (cl-loop for link in org-link-parameters
+ with store-func
+ do (setq store-func (org-link-get-parameter (car link) :store))
+ if store-func
+ collect store-func))
+
+(defun org-link-expand-abbrev (link)
+ "Replace link abbreviations in LINK string.
+Abbreviations are defined in `org-link-abbrev-alist'."
+ (if (not (string-match "^\\([^:]*\\)\\(::?\\(.*\\)\\)?$" link)) link
+ (let* ((key (match-string 1 link))
+ (as (or (assoc key org-link-abbrev-alist-local)
+ (assoc key org-link-abbrev-alist)))
+ (tag (and (match-end 2) (match-string 3 link)))
+ rpl)
+ (if (not as)
+ link
+ (setq rpl (cdr as))
+ (cond
+ ((symbolp rpl) (funcall rpl tag))
+ ((string-match "%(\\([^)]+\\))" rpl)
+ (replace-match
+ (save-match-data
+ (funcall (intern-soft (match-string 1 rpl)) tag))
+ t t rpl))
+ ((string-match "%s" rpl) (replace-match (or tag "") t t rpl))
+ ((string-match "%h" rpl)
+ (replace-match (url-hexify-string (or tag "")) t t rpl))
+ (t (concat rpl tag)))))))
+
+(defun org-link-open (link &optional arg)
+ "Open a link object LINK.
+
+ARG is an optional prefix argument. Some link types may handle
+it. For example, it determines what application to run when
+opening a \"file\" link.
+
+Functions responsible for opening the link are either hard-coded
+for internal and \"file\" links, or stored as a parameter in
+`org-link-parameters', which see."
+ (let ((type (org-element-property :type link))
+ (path (org-element-property :path link)))
+ (pcase type
+ ;; Opening a "file" link requires special treatment since we
+ ;; first need to integrate search option, if any.
+ ("file"
+ (let* ((option (org-element-property :search-option link))
+ (path (if option (concat path "::" option) path)))
+ (org-link-open-as-file path
+ (pcase (org-element-property :application link)
+ ((guard arg) arg)
+ ("emacs" 'emacs)
+ ("sys" 'system)))))
+ ;; Internal links.
+ ((or "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-link--buffer-for-internals)))
+ (let ((destination
+ (org-with-wide-buffer
+ (if (equal type "radio")
+ (org-link--search-radio-target path)
+ (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 link)))))
+ (point))))
+ (unless (and (<= (point-min) destination)
+ (>= (point-max) destination))
+ (widen))
+ (goto-char destination))))
+ (_
+ ;; Look for a dedicated "follow" function in custom links.
+ (let ((f (org-link-get-parameter type :follow)))
+ (when (functionp f)
+ ;; Function defined in `:follow' parameter may use a single
+ ;; argument, as it was mandatory before Org 9.4. This is
+ ;; deprecated, but support it for now.
+ (condition-case nil
+ (funcall (org-link-get-parameter type :follow) path arg)
+ (wrong-number-of-arguments
+ (funcall (org-link-get-parameter type :follow) path)))))))))
+
+(defun org-link-open-from-string (s &optional arg)
+ "Open a link in the string S, as if it was in Org mode.
+Optional argument is passed to `org-open-file' when S is
+a \"file\" link."
+ (interactive "sLink: \nP")
+ (pcase (with-temp-buffer
+ (let ((org-inhibit-startup nil))
+ (insert s)
+ (org-mode)
+ (goto-char (point-min))
+ (org-element-link-parser)))
+ (`nil (user-error "No valid link in %S" s))
+ (link (org-link-open link arg))))
+
+(defun org-link-search (s &optional avoid-pos stealth)
+ "Search for a search string S.
+
+If S starts with \"#\", it triggers a custom ID search.
+
+If S is enclosed within parenthesis, it initiates a coderef
+search.
+
+If S is surrounded by forward slashes, it is interpreted as
+a regular expression. In Org mode files, this will create an
+`org-occur' sparse tree. In ordinary files, `occur' will be used
+to list matches. If the current buffer is in `dired-mode', grep
+will be used to search in all files.
+
+When AVOID-POS is given, ignore matches near that position.
+
+When optional argument STEALTH is non-nil, do not modify
+visibility around point, thus ignoring `org-show-context-detail'
+variable.
+
+Search is case-insensitive and ignores white spaces. Return type
+of matched result, which is either `dedicated' or `fuzzy'."
+ (unless (org-string-nw-p s) (error "Invalid search string \"%s\"" s))
+ (let* ((case-fold-search t)
+ (origin (point))
+ (normalized (replace-regexp-in-string "\n[ \t]*" " " s))
+ (starred (eq (string-to-char normalized) ?*))
+ (words (split-string (if starred (substring s 1) s)))
+ (s-multi-re (mapconcat #'regexp-quote words "\\(?:[ \t\n]+\\)"))
+ (s-single-re (mapconcat #'regexp-quote words "[ \t]+"))
+ type)
+ (cond
+ ;; Check if there are any special search functions.
+ ((run-hook-with-args-until-success 'org-execute-file-search-functions s))
+ ((eq (string-to-char s) ?#)
+ ;; Look for a custom ID S if S starts with "#".
+ (let* ((id (substring normalized 1))
+ (match (org-find-property "CUSTOM_ID" id)))
+ (if match (progn (goto-char match) (setf type 'dedicated))
+ (error "No match for custom ID: %s" id))))
+ ((string-match "\\`(\\(.*\\))\\'" normalized)
+ ;; Look for coderef targets if S is enclosed within parenthesis.
+ (let ((coderef (match-string-no-properties 1 normalized))
+ (re (substring s-single-re 1 -1)))
+ (goto-char (point-min))
+ (catch :coderef-match
+ (while (re-search-forward re nil t)
+ (let ((element (org-element-at-point)))
+ (when (and (memq (org-element-type element)
+ '(example-block src-block))
+ (org-match-line
+ (concat ".*?" (org-src-coderef-regexp
+ (org-src-coderef-format element)
+ coderef))))
+ (setq type 'dedicated)
+ (goto-char (match-beginning 2))
+ (throw :coderef-match nil))))
+ (goto-char origin)
+ (error "No match for coderef: %s" coderef))))
+ ((string-match "\\`/\\(.*\\)/\\'" normalized)
+ ;; Look for a regular expression.
+ (funcall (if (derived-mode-p 'org-mode) #'org-occur #'org-do-occur)
+ (match-string 1 s)))
+ ;; From here, we handle fuzzy links.
+ ;;
+ ;; Look for targets, only if not in a headline search.
+ ((and (not starred)
+ (let ((target (format "<<%s>>" s-multi-re)))
+ (catch :target-match
+ (goto-char (point-min))
+ (while (re-search-forward target nil t)
+ (backward-char)
+ (let ((context (org-element-context)))
+ (when (eq (org-element-type context) 'target)
+ (setq type 'dedicated)
+ (goto-char (org-element-property :begin context))
+ (throw :target-match t))))
+ nil))))
+ ;; Look for elements named after S, only if not in a headline
+ ;; search.
+ ((and (not starred)
+ (let ((name (format "^[ \t]*#\\+NAME: +%s[ \t]*$" s-single-re)))
+ (catch :name-match
+ (goto-char (point-min))
+ (while (re-search-forward name nil t)
+ (let* ((element (org-element-at-point))
+ (name (org-element-property :name element)))
+ (when (and name (equal words (split-string name)))
+ (setq type 'dedicated)
+ (beginning-of-line)
+ (throw :name-match t))))
+ nil))))
+ ;; Regular text search. Prefer headlines in Org mode buffers.
+ ;; Ignore COMMENT keyword, TODO keywords, priority cookies,
+ ;; statistics cookies and tags.
+ ((and (derived-mode-p 'org-mode)
+ (let ((title-re
+ (format "%s.*\\(?:%s[ \t]\\)?.*%s"
+ org-outline-regexp-bol
+ org-comment-string
+ (mapconcat #'regexp-quote words ".+"))))
+ (goto-char (point-min))
+ (catch :found
+ (while (re-search-forward title-re nil t)
+ (when (equal words
+ (split-string
+ (org-link--normalize-string
+ (org-get-heading t t t t))))
+ (throw :found t)))
+ nil)))
+ (beginning-of-line)
+ (setq type 'dedicated))
+ ;; Offer to create non-existent headline depending on
+ ;; `org-link-search-must-match-exact-headline'.
+ ((and (derived-mode-p 'org-mode)
+ (eq org-link-search-must-match-exact-headline 'query-to-create)
+ (yes-or-no-p "No match - create this as a new heading? "))
+ (goto-char (point-max))
+ (unless (bolp) (newline))
+ (org-insert-heading nil t t)
+ (insert s "\n")
+ (beginning-of-line 0))
+ ;; Only headlines are looked after. No need to process
+ ;; further: throw an error.
+ ((and (derived-mode-p 'org-mode)
+ (or starred org-link-search-must-match-exact-headline))
+ (goto-char origin)
+ (error "No match for fuzzy expression: %s" normalized))
+ ;; Regular text search.
+ ((catch :fuzzy-match
+ (goto-char (point-min))
+ (while (re-search-forward s-multi-re nil t)
+ ;; Skip match if it contains AVOID-POS or it is included in
+ ;; a link with a description but outside the description.
+ (unless (or (and avoid-pos
+ (<= (match-beginning 0) avoid-pos)
+ (> (match-end 0) avoid-pos))
+ (and (save-match-data
+ (org-in-regexp org-link-bracket-re))
+ (match-beginning 3)
+ (or (> (match-beginning 3) (point))
+ (<= (match-end 3) (point)))
+ (org-element-lineage
+ (save-match-data (org-element-context))
+ '(link) t)))
+ (goto-char (match-beginning 0))
+ (setq type 'fuzzy)
+ (throw :fuzzy-match t)))
+ nil))
+ ;; All failed. Throw an error.
+ (t (goto-char origin)
+ (error "No match for fuzzy expression: %s" normalized)))
+ ;; Disclose surroundings of match, if appropriate.
+ (when (and (derived-mode-p 'org-mode) (not stealth))
+ (org-show-context 'link-search))
+ type))
+
+(defun org-link-heading-search-string (&optional string)
+ "Make search string for the current headline or STRING.
+
+Search string starts with an asterisk. COMMENT keyword and
+statistics cookies are removed, and contiguous spaces are packed
+into a single one.
+
+When optional argument STRING is non-nil, assume it a headline,
+without any asterisk, TODO or COMMENT keyword, and without any
+priority cookie or tag."
+ (concat "*"
+ (org-link--normalize-string
+ (or string (org-get-heading t t t t)))))
+
+(defun org-link-open-as-file (path arg)
+ "Pretend PATH is a file name and open it.
+
+According to \"file\"-link syntax, PATH may include additional
+search options, separated from the file name with \"::\".
+
+This function is meant to be used as a possible tool for
+`:follow' property in `org-link-parameters'."
+ (let* ((option (and (string-match "::\\(.*\\)\\'" path)
+ (match-string 1 path)))
+ (file-name (if (not option) path
+ (substring path 0 (match-beginning 0)))))
+ (if (string-match "[*?{]" (file-name-nondirectory file-name))
+ (dired file-name)
+ (apply #'org-open-file
+ file-name
+ arg
+ (cond ((not option) nil)
+ ((string-match-p "\\`[0-9]+\\'" option)
+ (list (string-to-number option)))
+ (t (list nil option)))))))
+
+(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-link-bracket-re
+ (lambda (m) (or (match-string 2 m) (match-string 1 m)))
+ s nil t)))
+
+(defun org-link-add-angle-brackets (s)
+ "Wrap string S within angle brackets."
+ (unless (equal (substring s 0 1) "<") (setq s (concat "<" s)))
+ (unless (equal (substring s -1) ">") (setq s (concat s ">")))
+ s)
+
+
+;;; Built-in link types
+
+;;;; "elisp" link type
+(defun org-link--open-elisp (path _)
+ "Open a \"elisp\" type link.
+PATH is the sexp to evaluate, as a string."
+ (if (or (and (org-string-nw-p org-link-elisp-skip-confirm-regexp)
+ (string-match-p org-link-elisp-skip-confirm-regexp path))
+ (not org-link-elisp-confirm-function)
+ (funcall org-link-elisp-confirm-function
+ (format "Execute %S as Elisp? "
+ (org-add-props path nil 'face 'org-warning))))
+ (message "%s => %s" path
+ (if (eq ?\( (string-to-char path))
+ (eval (read path))
+ (call-interactively (read path))))
+ (user-error "Abort")))
+
+(org-link-set-parameters "elisp" :follow #'org-link--open-elisp)
+
+;;;; "file" link type
+(org-link-set-parameters "file" :complete #'org-link-complete-file)
+
+;;;; "help" link type
+(defun org-link--open-help (path _)
+ "Open a \"help\" type link.
+PATH is a symbol name, as a string."
+ (pcase (intern path)
+ ((and (pred fboundp) function) (describe-function function))
+ ((and (pred boundp) variable) (describe-variable variable))
+ (name (user-error "Unknown function or variable: %s" name))))
+
+(defun org-link--store-help ()
+ "Store \"help\" type link."
+ (when (eq major-mode 'help-mode)
+ (let ((symbol
+ (save-excursion
+ (goto-char (point-min))
+ ;; In case the help is about the key-binding, store the
+ ;; function instead.
+ (search-forward "runs the command " (line-end-position) t)
+ (read (current-buffer)))))
+ (org-link-store-props :type "help"
+ :link (format "help:%s" symbol)
+ :description nil))))
+
+(org-link-set-parameters "help"
+ :follow #'org-link--open-help
+ :store #'org-link--store-help)
+
+;;;; "http", "https", "mailto", "ftp", and "news" link types
+(dolist (scheme '("ftp" "http" "https" "mailto" "news"))
+ (org-link-set-parameters scheme
+ :follow
+ (lambda (url arg)
+ (browse-url (concat scheme ":" url) arg))))
+
+;;;; "shell" link type
+(defun org-link--open-shell (path _)
+ "Open a \"shell\" type link.
+PATH is the command to execute, as a string."
+ (if (or (and (org-string-nw-p org-link-shell-skip-confirm-regexp)
+ (string-match-p org-link-shell-skip-confirm-regexp path))
+ (not org-link-shell-confirm-function)
+ (funcall org-link-shell-confirm-function
+ (format "Execute %S in shell? "
+ (org-add-props path nil 'face 'org-warning))))
+ (let ((buf (generate-new-buffer "*Org Shell Output*")))
+ (message "Executing %s" path)
+ (shell-command path buf)
+ (when (featurep 'midnight)
+ (setq clean-buffer-list-kill-buffer-names
+ (cons (buffer-name buf)
+ clean-buffer-list-kill-buffer-names))))
+ (user-error "Abort")))
+
+(org-link-set-parameters "shell" :follow #'org-link--open-shell)
+
+
+;;; Interactive Functions
+
+;;;###autoload
+(defun org-next-link (&optional search-backward)
+ "Move forward to the next link.
+If the link is in hidden text, expose it. When SEARCH-BACKWARD
+is non-nil, move backward."
+ (interactive)
+ (let ((pos (point))
+ (search-fun (if search-backward #'re-search-backward
+ #'re-search-forward)))
+ ;; Tweak initial position. If last search failed, wrap around.
+ ;; Otherwise, make sure we do not match current link.
+ (cond
+ ((not (and org-link--search-failed (eq this-command last-command)))
+ (cond
+ ((and (not search-backward) (looking-at org-link-any-re))
+ (goto-char (match-end 0)))
+ (search-backward
+ (pcase (org-in-regexp org-link-any-re nil t)
+ (`(,beg . ,_) (goto-char beg))
+ (_ nil)))
+ (t nil)))
+ (search-backward
+ (goto-char (point-max))
+ (message "Link search wrapped back to end of buffer"))
+ (t
+ (goto-char (point-min))
+ (message "Link search wrapped back to beginning of buffer")))
+ (setq org-link--search-failed nil)
+ (catch :found
+ (while (funcall search-fun org-link-any-re nil t)
+ (let ((context (save-excursion
+ (unless search-backward (forward-char -1))
+ (org-element-context))))
+ (pcase (org-element-lineage context '(link) t)
+ (`nil nil)
+ (link
+ (goto-char (org-element-property :begin link))
+ (when (org-invisible-p) (org-show-context))
+ (throw :found t)))))
+ (goto-char pos)
+ (setq org-link--search-failed t)
+ (message "No further link found"))))
+
+;;;###autoload
+(defun org-previous-link ()
+ "Move backward to the previous link.
+If the link is in hidden text, expose it."
+ (interactive)
+ (org-next-link t))
+
+;;;###autoload
+(defun org-toggle-link-display ()
+ "Toggle the literal or descriptive display of links."
+ (interactive)
+ (if org-link-descriptive (remove-from-invisibility-spec '(org-link))
+ (add-to-invisibility-spec '(org-link)))
+ (org-restart-font-lock)
+ (setq org-link-descriptive (not org-link-descriptive)))
+
+;;;###autoload
+(defun org-store-link (arg &optional interactive?)
+ "Store a link to the current location.
+\\<org-mode-map>
+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."
+ (interactive "P\np")
+ (org-load-modules-maybe)
+ (if (and (equal arg '(64)) (org-region-active-p))
+ (save-excursion
+ (let ((end (region-end)))
+ (goto-char (region-beginning))
+ (set-mark (point))
+ (while (< (point-at-eol) end)
+ (move-end-of-line 1) (activate-mark)
+ (let (current-prefix-arg)
+ (call-interactively 'org-store-link))
+ (move-beginning-of-line 2)
+ (set-mark (point)))))
+ (setq org-store-link-plist nil)
+ (let (link cpltxt desc search custom-id agenda-link) ;; description
+ (cond
+ ;; 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)))
+ (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-link-store-props
+ (cdr (assoc-string
+ (completing-read
+ (format "Store link with (default %s): " name)
+ (mapcar #'car results-alist)
+ nil t nil nil (symbol-name name))
+ results-alist)))
+ t))))
+ (setq link (plist-get org-store-link-plist :link))
+ ;; If store function actually set `:description' property, use
+ ;; it, even if it is nil. Otherwise, fallback to link value.
+ (setq desc (if (plist-member org-store-link-plist :description)
+ (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))
+ (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))
+ (let ((m (or (get-text-property (point) 'org-hd-marker)
+ (get-text-property (point) 'org-marker))))
+ (when m
+ (org-with-point-at m
+ (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))))
+ (org-link-store-props :type "calendar" :date cd)))
+
+ ((eq major-mode 'w3-mode)
+ (setq cpltxt (if (and (buffer-name)
+ (not (string-match "Untitled" (buffer-name))))
+ (buffer-name)
+ (url-view-url t))
+ link (url-view-url t))
+ (org-link-store-props :type "w3" :url (url-view-url t)))
+
+ ((eq major-mode 'image-mode)
+ (setq cpltxt (concat "file:"
+ (abbreviate-file-name buffer-file-name))
+ link cpltxt)
+ (org-link-store-props :type "image" :file buffer-file-name))
+
+ ;; In dired, store a link to the file of the current line
+ ((derived-mode-p 'dired-mode)
+ (let ((file (dired-get-filename nil t)))
+ (setq file (if file
+ (abbreviate-file-name
+ (expand-file-name (dired-get-filename nil t)))
+ ;; otherwise, no file so use current directory.
+ default-directory))
+ (setq cpltxt (concat "file:" file)
+ link cpltxt)))
+
+ ((setq search (run-hook-with-args-until-success
+ 'org-create-file-search-functions))
+ (setq link (concat "file:" (abbreviate-file-name buffer-file-name)
+ "::" search))
+ (setq cpltxt (or link))) ;; description
+
+ ((and (buffer-file-name (buffer-base-buffer)) (derived-mode-p 'org-mode))
+ (org-with-limited-levels
+ (cond
+ ;; Store a link using the target at point.
+ ((org-in-regexp "[^<]<<\\([^<>]+\\)>>[^>]" 1)
+ (setq cpltxt
+ (concat "file:"
+ (abbreviate-file-name
+ (buffer-file-name (buffer-base-buffer)))
+ "::" (match-string 1))
+ link cpltxt))
+ ;; Store a link using the CUSTOM_ID property.
+ ((setq custom-id (org-entry-get nil "CUSTOM_ID"))
+ (setq cpltxt
+ (concat "file:"
+ (abbreviate-file-name
+ (buffer-file-name (buffer-base-buffer)))
+ "::#" custom-id)
+ link cpltxt))
+ ;; Store a link using (and perhaps creating) the ID property.
+ ((and (featurep 'org-id)
+ (or (eq org-id-link-to-org-use-id t)
+ (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)
+ (not custom-id))))
+ (and org-id-link-to-org-use-id (org-entry-get nil "ID"))))
+ (setq link (condition-case nil
+ (prog1 (org-id-store-link)
+ (setq desc (or (plist-get org-store-link-plist
+ :description)
+ "")))
+ (error
+ ;; Probably before first headline, link only to file.
+ (concat "file:"
+ (abbreviate-file-name
+ (buffer-file-name (buffer-base-buffer))))))))
+ (t
+ ;; Just link to current headline.
+ (setq cpltxt (concat "file:"
+ (abbreviate-file-name
+ (buffer-file-name (buffer-base-buffer)))))
+ ;; Add a context search string.
+ (when (org-xor org-link-context-for-files (equal arg '(4)))
+ (let* ((element (org-element-at-point))
+ (name (org-element-property :name element))
+ (context
+ (cond
+ ((let ((region (org-link--context-from-region)))
+ (and region (org-link--normalize-string region t))))
+ (name)
+ ((org-before-first-heading-p)
+ (org-link--normalize-string (org-current-line-string) t))
+ (t (org-link-heading-search-string)))))
+ (when (org-string-nw-p context)
+ (setq cpltxt (format "%s::%s" cpltxt context))
+ (setq desc
+ (or name
+ ;; Although description is not a search
+ ;; string, use `org-link--normalize-string'
+ ;; to prettify it (contiguous white spaces)
+ ;; and remove volatile contents (statistics
+ ;; cookies).
+ (and (not (org-before-first-heading-p))
+ (org-link--normalize-string
+ (org-get-heading t t t t)))
+ "NONE")))))
+ (setq link cpltxt)))))
+
+ ((buffer-file-name (buffer-base-buffer))
+ ;; Just link to this file here.
+ (setq cpltxt (concat "file:"
+ (abbreviate-file-name
+ (buffer-file-name (buffer-base-buffer)))))
+ ;; Add a context search string.
+ (when (org-xor org-link-context-for-files (equal arg '(4)))
+ (let ((context (org-link--normalize-string
+ (or (org-link--context-from-region)
+ (org-current-line-string))
+ t)))
+ ;; Only use search option if there is some text.
+ (when (org-string-nw-p context)
+ (setq cpltxt (format "%s::%s" cpltxt context))
+ (setq desc "NONE"))))
+ (setq link cpltxt))
+
+ (interactive?
+ (user-error "No method for storing a link from this buffer"))
+
+ (t (setq link nil)))
+
+ ;; We're done setting link and desc, clean up
+ (when (consp link) (setq cpltxt (car link) link (cdr link)))
+ (setq link (or link cpltxt)
+ desc (or desc cpltxt))
+ (cond ((not desc))
+ ((equal desc "NONE") (setq desc nil))
+ (t (setq desc (org-link-display-format desc))))
+ ;; Store and return the link
+ (if (not (and interactive? link))
+ (or agenda-link (and link (org-link-make-string link desc)))
+ (if (member (list link desc) org-stored-links)
+ (message "This link has already been stored")
+ (push (list link desc) org-stored-links)
+ (message "Stored: %s" (or desc link))
+ (when custom-id
+ (setq link (concat "file:"
+ (abbreviate-file-name
+ (buffer-file-name (buffer-base-buffer)))
+ "::#" custom-id))
+ (push (list link desc) org-stored-links)))
+ (car org-stored-links)))))
+
+;;;###autoload
+(defun org-insert-link (&optional complete-file link-location description)
+ "Insert a link. At the prompt, enter the link.
+
+Completion can be used to insert any of the link protocol prefixes in use.
+
+The history can be used to select a link previously stored with
+`org-store-link'. When the empty string is entered (i.e. if you just
+press `RET' at the prompt), the link defaults to the most recently
+stored link. As `SPC' triggers completion in the minibuffer, you need to
+use `M-SPC' or `C-q SPC' to force the insertion of a space character.
+
+You will also be prompted for a description, and if one is given, it will
+be displayed in the buffer instead of the link.
+
+If there is already a link at point, this command will allow you to edit
+link and description parts.
+
+With a `\\[universal-argument]' prefix, prompts for a file to link to. The \
+file name can be
+selected using completion. The path to the file will be relative to the
+current directory if the file is in the current directory or a subdirectory.
+Otherwise, the link will be the absolute path as completed in the minibuffer
+\(i.e. normally ~/path/to/file). You can configure this behavior using the
+option `org-link-file-path-type'.
+
+With a `\\[universal-argument] \\[universal-argument]' prefix, enforce an \
+absolute path even if the file is in
+the current directory or below.
+
+A `\\[universal-argument] \\[universal-argument] \\[universal-argument]' \
+prefix negates `org-link-keep-stored-after-insertion'.
+
+If the LINK-LOCATION parameter is non-nil, this value will be used as
+the link location instead of reading one interactively.
+
+If the DESCRIPTION parameter is non-nil, this value will be used as the
+default description. Otherwise, if `org-link-make-description-function'
+is non-nil, this function will be called with the link target, and the
+result will be the 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))
+ (region (when (org-region-active-p)
+ (buffer-substring (region-beginning) (region-end))))
+ (remove (and region (list (region-beginning) (region-end))))
+ (desc region)
+ (link link-location)
+ (abbrevs org-link-abbrev-alist-local)
+ entry all-prefixes auto-desc)
+ (cond
+ (link-location) ; specified by arg, just use it.
+ ((org-in-regexp org-link-bracket-re 1)
+ ;; We do have a link at point, and we are going to edit it.
+ (setq remove (list (match-beginning 0) (match-end 0)))
+ (setq desc (when (match-end 2) (match-string-no-properties 2)))
+ (setq link (read-string "Link: "
+ (org-link-unescape
+ (match-string-no-properties 1)))))
+ ((or (org-in-regexp org-link-angle-re)
+ (org-in-regexp org-link-plain-re))
+ ;; Convert to bracket link
+ (setq remove (list (match-beginning 0) (match-end 0))
+ link (read-string "Link: "
+ (org-unbracket-string "<" ">" (match-string 0)))))
+ ((member complete-file '((4) (16)))
+ ;; Completing read for file names.
+ (setq link (org-link-complete-file complete-file)))
+ (t
+ ;; Read link, with completion for stored links.
+ (org-link--fontify-links-to-this-file)
+ (org-switch-to-buffer-other-window "*Org Links*")
+ (with-current-buffer "*Org Links*"
+ (erase-buffer)
+ (insert "Insert a link.
+Use TAB to complete link prefixes, then RET for type-specific completion support\n")
+ (when org-stored-links
+ (insert "\nStored links are available with <up>/<down> or M-p/n \
+\(most recent with RET):\n\n")
+ (insert (mapconcat #'org-link--prettify
+ (reverse org-stored-links)
+ "\n")))
+ (goto-char (point-min)))
+ (when (get-buffer-window "*Org Links*" 'visible)
+ (let ((cw (selected-window)))
+ (select-window (get-buffer-window "*Org Links*" 'visible))
+ (with-current-buffer "*Org Links*" (setq truncate-lines t))
+ (unless (pos-visible-in-window-p (point-max))
+ (org-fit-window-to-buffer))
+ (and (window-live-p cw) (select-window cw))))
+ (setq all-prefixes (append (mapcar #'car abbrevs)
+ (mapcar #'car org-link-abbrev-alist)
+ (org-link-types)))
+ (unwind-protect
+ ;; Fake a link history, containing the stored links.
+ (let ((org-link--history
+ (append (mapcar #'car org-stored-links)
+ org-link--insert-history)))
+ (setq link
+ (org-completing-read
+ "Link: "
+ (append
+ (mapcar (lambda (x) (concat x ":")) all-prefixes)
+ (mapcar #'car org-stored-links))
+ nil nil nil
+ 'org-link--history
+ (caar org-stored-links)))
+ (unless (org-string-nw-p link) (user-error "No link selected"))
+ (dolist (l org-stored-links)
+ (when (equal link (cadr l))
+ (setq link (car l))
+ (setq auto-desc t)))
+ (when (or (member link all-prefixes)
+ (and (equal ":" (substring link -1))
+ (member (substring link 0 -1) all-prefixes)
+ (setq link (substring link 0 -1))))
+ (setq link (with-current-buffer origbuf
+ (org-link--try-special-completion link)))))
+ (set-window-configuration wcf)
+ (kill-buffer "*Org Links*"))
+ (setq entry (assoc link org-stored-links))
+ (or entry (push link org-link--insert-history))
+ (setq desc (or desc (nth 1 entry)))))
+
+ (when (funcall (if (equal complete-file '(64)) 'not 'identity)
+ (not org-link-keep-stored-after-insertion))
+ (setq org-stored-links (delq (assoc link org-stored-links)
+ org-stored-links)))
+
+ (when (and (string-match org-link-plain-re link)
+ (not (string-match org-ts-regexp link)))
+ ;; URL-like link, normalize the use of angular brackets.
+ (setq link (org-unbracket-string "<" ">" link)))
+
+ ;; Check if we are linking to the current file with a search
+ ;; option If yes, simplify the link by using only the search
+ ;; option.
+ (when (and (buffer-file-name (buffer-base-buffer))
+ (let ((case-fold-search nil))
+ (string-match "\\`file:\\(.+?\\)::" link)))
+ (let ((path (match-string-no-properties 1 link))
+ (search (substring-no-properties link (match-end 0))))
+ (save-match-data
+ (when (equal (file-truename (buffer-file-name (buffer-base-buffer)))
+ (file-truename path))
+ ;; 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.
+ (let ((case-fold-search nil))
+ (when (string-match "\\`\\(file\\|docview\\):" link)
+ (let* ((type (match-string-no-properties 0 link))
+ (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)
+ (equal complete-file '(16)))
+ (setq path (abbreviate-file-name (expand-file-name path))))
+ ((eq org-link-file-path-type 'noabbrev)
+ (setq path (expand-file-name path)))
+ ((eq org-link-file-path-type 'relative)
+ (setq path (file-relative-name path)))
+ ((functionp org-link-file-path-type)
+ (setq path (funcall org-link-file-path-type
+ (expand-file-name path))))
+ (t
+ (save-match-data
+ (if (string-match (concat "^" (regexp-quote
+ (expand-file-name
+ (file-name-as-directory
+ default-directory))))
+ (expand-file-name path))
+ ;; We are linking a file with relative path name.
+ (setq path (substring (expand-file-name path)
+ (match-end 0)))
+ (setq path (abbreviate-file-name (expand-file-name path)))))))
+ (setq link (concat type path (and search (concat "::" search))))
+ (when (equal desc origpath)
+ (setq desc path)))))
+
+ (unless auto-desc
+ (let ((initial-input
+ (cond
+ (description)
+ ((not org-link-make-description-function) desc)
+ (t (condition-case nil
+ (funcall org-link-make-description-function link desc)
+ (error
+ (message "Can't get link description from %S"
+ (symbol-name org-link-make-description-function))
+ (sit-for 2)
+ nil))))))
+ (setq desc (if (called-interactively-p 'any)
+ (read-string "Description: " initial-input)
+ initial-input))))
+
+ (unless (org-string-nw-p desc) (setq desc nil))
+ (when remove (apply #'delete-region remove))
+ (insert (org-link-make-string link desc))
+ ;; Redisplay so as the new link has proper invisible characters.
+ (sit-for 0)))
+
+;;;###autoload
+(defun org-insert-all-links (arg &optional pre post)
+ "Insert all links in `org-stored-links'.
+When a universal prefix, do not delete the links from `org-stored-links'.
+When `ARG' is a number, insert the last N link(s).
+`PRE' and `POST' are optional arguments to define a string to
+prepend or to append."
+ (interactive "P")
+ (let ((org-link-keep-stored-after-insertion (equal arg '(4)))
+ (links (copy-sequence org-stored-links))
+ (pr (or pre "- "))
+ (po (or post "\n"))
+ (cnt 1) l)
+ (if (null org-stored-links)
+ (message "No link to insert")
+ (while (and (or (listp arg) (>= arg cnt))
+ (setq l (if (listp arg)
+ (pop links)
+ (pop org-stored-links))))
+ (setq cnt (1+ cnt))
+ (insert pr)
+ (org-insert-link nil (car l) (or (cadr l) "<no description>"))
+ (insert po)))))
+
+;;;###autoload
+(defun org-insert-last-stored-link (arg)
+ "Insert the last link stored in `org-stored-links'."
+ (interactive "p")
+ (org-insert-all-links arg "" "\n"))
+
+;;;###autoload
+(defun org-insert-link-global ()
+ "Insert a link like Org mode does.
+This command can be called in any mode to insert a link in Org syntax."
+ (interactive)
+ (org-load-modules-maybe)
+ (org-run-like-in-org-mode 'org-insert-link))
+
+;;;###autoload
+(defun org-update-radio-target-regexp ()
+ "Find all radio targets in this file and update the regular expression.
+Also refresh fontification if needed."
+ (interactive)
+ (let ((old-regexp org-target-link-regexp)
+ ;; 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))
+ (let (rtn)
+ (while (re-search-forward org-radio-target-regexp nil t)
+ ;; Make sure point is really within the object.
+ (backward-char)
+ (let ((obj (org-element-context)))
+ (when (eq (org-element-type obj) 'radio-target)
+ (cl-pushnew (org-element-property :value obj) rtn
+ :test #'equal))))
+ rtn))))
+ (setq org-target-link-regexp
+ (and targets
+ (concat before-re
+ (mapconcat
+ (lambda (x)
+ (replace-regexp-in-string
+ " +" "\\s-+" (regexp-quote x) t t))
+ targets
+ "\\|")
+ after-re)))
+ (unless (equal old-regexp org-target-link-regexp)
+ ;; Clean-up cache.
+ (let ((regexp (cond ((not old-regexp) org-target-link-regexp)
+ ((not org-target-link-regexp) old-regexp)
+ (t
+ (concat before-re
+ (mapconcat
+ (lambda (re)
+ (substring re (length before-re)
+ (- (length after-re))))
+ (list old-regexp org-target-link-regexp)
+ "\\|")
+ after-re)))))
+ (when (featurep 'org-element)
+ (org-with-point-at 1
+ (while (re-search-forward regexp nil t)
+ (org-element-cache-refresh (match-beginning 1))))))
+ ;; Re fontify buffer.
+ (when (memq 'radio org-highlight-links)
+ (org-restart-font-lock)))))
+
+
+;;; Initialize Regexps
+
+(org-link-make-regexps)
+
+(provide 'ol)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ol.el ends here
diff --git a/elpa/org-9.5.2/ol.elc b/elpa/org-9.5.2/ol.elc
new file mode 100644
index 0000000..f9c0371
--- /dev/null
+++ b/elpa/org-9.5.2/ol.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-agenda.el b/elpa/org-9.5.2/org-agenda.el
new file mode 100644
index 0000000..59bdd5b
--- /dev/null
+++ b/elpa/org-9.5.2/org-agenda.el
@@ -0,0 +1,10892 @@
+;;; org-agenda.el --- Dynamic task and appointment lists for Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file contains the code for creating and using the Agenda for Org.
+;;
+;; The functions `org-batch-agenda', `org-batch-agenda-csv', and
+;; `org-batch-store-agenda-views' are implemented as macros to provide
+;; a convenient way for extracting agenda information from the command
+;; line. The Lisp does not evaluate parameters of a macro call; thus
+;; it is not necessary to quote the parameters passed to one of those
+;; functions. E.g. you can write:
+;;
+;; emacs -batch -l ~/.emacs -eval '(org-batch-agenda "a" org-agenda-span 7)'
+;;
+;; To export an agenda spanning 7 days. If `org-batch-agenda' would
+;; have been implemented as a regular function you'd have to quote the
+;; symbol org-agenda-span. Moreover: To use a symbol as parameter
+;; value you would have to double quote the symbol.
+;;
+;; This is a hack, but it works even when running Org byte-compiled.
+;;
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ol)
+(require 'org)
+(require 'org-macs)
+(require 'org-refile)
+
+(declare-function diary-add-to-list "diary-lib"
+ (date string specifier &optional marker globcolor literal))
+(declare-function calendar-iso-to-absolute "cal-iso" (date))
+(declare-function calendar-astro-date-string "cal-julian" (&optional date))
+(declare-function calendar-bahai-date-string "cal-bahai" (&optional date))
+(declare-function calendar-chinese-date-string "cal-china" (&optional date))
+(declare-function calendar-coptic-date-string "cal-coptic" (&optional date))
+(declare-function calendar-ethiopic-date-string "cal-coptic" (&optional date))
+(declare-function calendar-french-date-string "cal-french" (&optional date))
+(declare-function calendar-goto-date "cal-move" (date))
+(declare-function calendar-hebrew-date-string "cal-hebrew" (&optional date))
+(declare-function calendar-islamic-date-string "cal-islam" (&optional date))
+(declare-function calendar-iso-date-string "cal-iso" (&optional date))
+(declare-function calendar-iso-from-absolute "cal-iso" (date))
+(declare-function calendar-julian-date-string "cal-julian" (&optional date))
+(declare-function calendar-mayan-date-string "cal-mayan" (&optional date))
+(declare-function calendar-persian-date-string "cal-persia" (&optional date))
+(declare-function calendar-check-holidays "holidays" (date))
+
+(declare-function org-columns-remove-overlays "org-colview" ())
+(declare-function org-datetree-find-date-create "org-datetree"
+ (date &optional keep-restriction))
+(declare-function org-columns-quit "org-colview" ())
+(declare-function diary-date-display-form "diary-lib" (&optional type))
+(declare-function org-mobile-write-agenda-for-mobile "org-mobile" (file))
+(declare-function org-habit-insert-consistency-graphs
+ "org-habit" (&optional line))
+(declare-function org-is-habit-p "org-habit" (&optional pom))
+(declare-function org-habit-parse-todo "org-habit" (&optional pom))
+(declare-function org-habit-get-priority "org-habit" (habit &optional moment))
+(declare-function org-agenda-columns "org-colview" ())
+(declare-function org-add-archive-files "org-archive" (files))
+(declare-function org-capture "org-capture" (&optional goto keys))
+(declare-function org-clock-modify-effort-estimate "org-clock" (&optional value))
+
+(defvar calendar-mode-map)
+(defvar org-clock-current-task)
+(defvar org-current-tag-alist)
+(defvar org-mobile-force-id-on-agenda-items)
+(defvar org-habit-show-habits)
+(defvar org-habit-show-habits-only-for-today)
+(defvar org-habit-show-all-today)
+(defvar org-habit-scheduled-past-days)
+
+;; Defined somewhere in this file, but used before definition.
+(defvar org-agenda-buffer-name "*Org Agenda*")
+(defvar org-agenda-overriding-header nil)
+(defvar org-agenda-title-append nil)
+;; (with-no-warnings (defvar entry)) ;; unprefixed, from calendar.el
+;; (with-no-warnings (defvar date)) ;; unprefixed, from calendar.el
+(defvar original-date) ; dynamically scoped, calendar.el does scope this
+
+(defvar org-agenda-undo-list nil
+ "List of undoable operations in the agenda since last refresh.")
+(defvar org-agenda-pending-undo-list nil
+ "In a series of undo commands, this is the list of remaining undo items.")
+
+(defcustom org-agenda-confirm-kill 1
+ "When set, remote killing from the agenda buffer needs confirmation.
+When t, a confirmation is always needed. When a number N, confirmation is
+only needed when the text to be killed contains more than N non-white lines."
+ :group 'org-agenda
+ :type '(choice
+ (const :tag "Never" nil)
+ (const :tag "Always" t)
+ (integer :tag "When more than N lines")))
+
+(defcustom org-agenda-compact-blocks nil
+ "Non-nil means make the block agenda more compact.
+This is done globally by leaving out lines like the agenda span
+name and week number or the separator lines."
+ :group 'org-agenda
+ :type 'boolean)
+
+(defcustom org-agenda-block-separator ?=
+ "The separator between blocks in the agenda.
+If this is a string, it will be used as the separator, with a newline added.
+If it is a character, it will be repeated to fill the window width.
+If nil the separator is disabled. In `org-agenda-custom-commands' this
+addresses the separator between the current and the previous block."
+ :group 'org-agenda
+ :type '(choice
+ (const :tag "Disabled" nil)
+ (character)
+ (string)))
+
+(defgroup org-agenda-export nil
+ "Options concerning exporting agenda views in Org mode."
+ :tag "Org Agenda Export"
+ :group 'org-agenda)
+
+(defcustom org-agenda-with-colors t
+ "Non-nil means use colors in agenda views."
+ :group 'org-agenda-export
+ :type 'boolean)
+
+(defcustom org-agenda-exporter-settings nil
+ ;; FIXME: Do we really want to evaluate those settings and thus force
+ ;; the user to use `quote' all the time?
+ "Alist of variable/value pairs that should be active during agenda export.
+This is a good place to set options for ps-print and for htmlize.
+Note that the way this is implemented, the values will be evaluated
+before assigned to the variables. So make sure to quote values you do
+*not* want evaluated, for example
+
+ (setq org-agenda-exporter-settings
+ \\='((ps-print-color-p \\='black-white)))"
+ :group 'org-agenda-export
+ :type '(repeat
+ (list
+ (variable)
+ (sexp :tag "Value"))))
+
+(defcustom org-agenda-before-write-hook '(org-agenda-add-entry-text)
+ "Hook run in a temporary buffer before writing the agenda to an export file.
+A useful function for this hook is `org-agenda-add-entry-text'."
+ :group 'org-agenda-export
+ :type 'hook
+ :options '(org-agenda-add-entry-text))
+
+(defcustom org-agenda-add-entry-text-maxlines 0
+ "Maximum number of entry text lines to be added to agenda.
+This is only relevant when `org-agenda-add-entry-text' is part of
+`org-agenda-before-write-hook', which is the default.
+When this is 0, nothing will happen. When it is greater than 0, it
+specifies the maximum number of lines that will be added for each entry
+that is listed in the agenda view.
+
+Note that this variable is not used during display, only when exporting
+the agenda. For agenda display, see the variables `org-agenda-entry-text-mode'
+and `org-agenda-entry-text-maxlines'."
+ :group 'org-agenda
+ :type 'integer)
+
+(defcustom org-agenda-add-entry-text-descriptive-links t
+ "Non-nil means export org-links as descriptive links in agenda added text.
+This variable applies to the text added to the agenda when
+`org-agenda-add-entry-text-maxlines' is larger than 0.
+When this variable is nil, the URL will (also) be shown."
+ :group 'org-agenda
+ :type 'boolean)
+
+(defcustom org-agenda-export-html-style nil
+ "The style specification for exported HTML Agenda files.
+If this variable contains a string, it will replace the default <style>
+section as produced by `htmlize'.
+Since there are different ways of setting style information, this variable
+needs to contain the full HTML structure to provide a style, including the
+surrounding HTML tags. The style specifications should include definitions
+the fonts used by the agenda, here is an example:
+
+ <style type=\"text/css\">
+ p { font-weight: normal; color: gray; }
+ .org-agenda-structure {
+ font-size: 110%;
+ color: #003399;
+ font-weight: 600;
+ }
+ .org-todo {
+ color: #cc6666;
+ font-weight: bold;
+ }
+ .org-agenda-done {
+ color: #339933;
+ }
+ .org-done {
+ color: #339933;
+ }
+ .title { text-align: center; }
+ .todo, .deadline { color: red; }
+ .done { color: green; }
+ </style>
+
+or, if you want to keep the style in a file,
+
+ <link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css\">
+
+As the value of this option simply gets inserted into the HTML <head> header,
+you can \"misuse\" it to also add other text to the header."
+ :group 'org-agenda-export
+ :group 'org-export-html
+ :type '(choice
+ (const nil)
+ (string)))
+
+(defcustom org-agenda-persistent-filter nil
+ "When set, keep filters from one agenda view to the next."
+ :group 'org-agenda
+ :type 'boolean)
+
+(defgroup org-agenda-custom-commands nil
+ "Options concerning agenda views in Org mode."
+ :tag "Org Agenda Custom Commands"
+ :group 'org-agenda)
+
+(defconst org-sorting-choice
+ '(choice
+ (const time-up) (const time-down)
+ (const timestamp-up) (const timestamp-down)
+ (const scheduled-up) (const scheduled-down)
+ (const deadline-up) (const deadline-down)
+ (const ts-up) (const ts-down)
+ (const tsia-up) (const tsia-down)
+ (const category-keep) (const category-up) (const category-down)
+ (const tag-down) (const tag-up)
+ (const priority-up) (const priority-down)
+ (const todo-state-up) (const todo-state-down)
+ (const effort-up) (const effort-down)
+ (const habit-up) (const habit-down)
+ (const alpha-up) (const alpha-down)
+ (const user-defined-up) (const user-defined-down))
+ "Sorting choices.")
+
+;; Keep custom values for `org-agenda-filter-preset' compatible with
+;; the new variable `org-agenda-tag-filter-preset'.
+(defvaralias 'org-agenda-filter-preset 'org-agenda-tag-filter-preset)
+(defvaralias 'org-agenda-filter 'org-agenda-tag-filter)
+
+(defvar org-agenda-entry-types '(:deadline :scheduled :timestamp :sexp)
+ "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
+
+ :timestamp List items containing a date stamp or date range matching
+ the selected date. This includes sexp entries in angular
+ brackets.
+
+ :sexp List entries resulting from plain diary-like sexps.
+
+ :deadline List deadline due on that date. When the date is today,
+ also list any deadlines past due, or due within
+ `org-deadline-warning-days'.
+
+ :deadline* Same as above, but only include the deadline if it has an
+ hour specification as [h]h:mm.
+
+ :scheduled List all items which are scheduled for the given date.
+ The diary for *today* also contains items which were
+ scheduled earlier and are not yet marked DONE.
+
+ :scheduled* Same as above, but only include the scheduled item if it
+ has an hour specification as [h]h:mm.
+
+By default, all four non-starred types are turned on.
+
+When :scheduled* or :deadline* are included, :schedule or :deadline
+will be ignored.
+
+Never set this variable globally using `setq', because then it
+will apply to all future agenda commands. Instead, bind it with
+`let' to scope it dynamically into the agenda-constructing
+command. A good way to set it is through options in
+`org-agenda-custom-commands'. For a more flexible (though
+somewhat less efficient) way of determining what is included in
+the daily/weekly agenda, see `org-agenda-skip-function'.")
+
+(defconst org-agenda-custom-commands-local-options
+ `(repeat :tag "Local settings for this command. Remember to quote values"
+ (choice :tag "Setting"
+ (list :tag "Heading for this block"
+ (const org-agenda-overriding-header)
+ (string :tag "Headline"))
+ (list :tag "Files to be searched"
+ (const org-agenda-files)
+ (list
+ (const :format "" quote)
+ (repeat (file))))
+ (list :tag "Sorting strategy"
+ (const org-agenda-sorting-strategy)
+ (list
+ (const :format "" quote)
+ (repeat
+ ,org-sorting-choice)))
+ (list :tag "Prefix format"
+ (const org-agenda-prefix-format :value " %-12:c%?-12t% s")
+ (string))
+ (list :tag "Number of days in agenda"
+ (const org-agenda-span)
+ (list
+ (const :format "" quote)
+ (choice (const :tag "Day" day)
+ (const :tag "Week" week)
+ (const :tag "Fortnight" fortnight)
+ (const :tag "Month" month)
+ (const :tag "Year" year)
+ (integer :tag "Custom"))))
+ (list :tag "Fixed starting date"
+ (const org-agenda-start-day)
+ (string :value "2007-11-01"))
+ (list :tag "Start on day of week"
+ (const org-agenda-start-on-weekday)
+ (choice :value 1
+ (const :tag "Today" nil)
+ (integer :tag "Weekday No.")))
+ (list :tag "Include data from diary"
+ (const org-agenda-include-diary)
+ (boolean))
+ (list :tag "Deadline Warning days"
+ (const org-deadline-warning-days)
+ (integer :value 1))
+ (list :tag "Category filter preset"
+ (const org-agenda-category-filter-preset)
+ (list
+ (const :format "" quote)
+ (repeat
+ (string :tag "+category or -category"))))
+ (list :tag "Tags filter preset"
+ (const org-agenda-tag-filter-preset)
+ (list
+ (const :format "" quote)
+ (repeat
+ (string :tag "+tag or -tag"))))
+ (list :tag "Effort filter preset"
+ (const org-agenda-effort-filter-preset)
+ (list
+ (const :format "" quote)
+ (repeat
+ (string :tag "+=10 or -=10 or +<10 or ->10"))))
+ (list :tag "Regexp filter preset"
+ (const org-agenda-regexp-filter-preset)
+ (list
+ (const :format "" quote)
+ (repeat
+ (string :tag "+regexp or -regexp"))))
+ (list :tag "Set daily/weekly entry types"
+ (const org-agenda-entry-types)
+ (list
+ (const :format "" quote)
+ (set :greedy t :value ,org-agenda-entry-types
+ (const :deadline)
+ (const :scheduled)
+ (const :deadline*)
+ (const :scheduled*)
+ (const :timestamp)
+ (const :sexp))))
+ (list :tag "Columns format"
+ (const org-overriding-columns-format)
+ (string :tag "Format"))
+ (list :tag "Standard skipping condition"
+ :value (org-agenda-skip-function '(org-agenda-skip-entry-if))
+ (const org-agenda-skip-function)
+ (list
+ (const :format "" quote)
+ (list
+ (choice
+ :tag "Skipping range"
+ (const :tag "Skip entry" org-agenda-skip-entry-if)
+ (const :tag "Skip subtree" org-agenda-skip-subtree-if))
+ (repeat :inline t :tag "Conditions for skipping"
+ (choice
+ :tag "Condition type"
+ (list :tag "Regexp matches" :inline t
+ (const :format "" regexp)
+ (regexp))
+ (list :tag "Regexp does not match" :inline t
+ (const :format "" notregexp)
+ (regexp))
+ (list :tag "TODO state is" :inline t
+ (const todo)
+ (choice
+ (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)
+ (choice
+ (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))))))
+ (list :tag "Non-standard skipping condition"
+ :value (org-agenda-skip-function)
+ (const org-agenda-skip-function)
+ (sexp :tag "Function or form (quoted!)"))
+ (list :tag "Any variable"
+ (variable :tag "Variable")
+ (sexp :tag "Value (sexp)"))))
+ "Selection of examples for agenda command settings.
+This will be spliced into the custom type of
+`org-agenda-custom-commands'.")
+
+
+(defcustom org-agenda-custom-commands
+ '(("n" "Agenda and all TODOs" ((agenda "") (alltodo ""))))
+ "Custom commands for the agenda.
+\\<org-mode-map>
+These commands will be offered on the splash screen displayed by the
+agenda dispatcher `\\[org-agenda]'. Each entry is a list like this:
+
+ (key desc type match settings files)
+
+key The key (one or more characters as a string) to be associated
+ with the command.
+desc A description of the command, when omitted or nil, a default
+ description is built using MATCH.
+type The command type, any of the following symbols:
+ agenda The daily/weekly agenda.
+ todo Entries with a specific TODO keyword, in all agenda files.
+ search Entries containing search words entry or headline.
+ tags Tags/Property/TODO match in all agenda files.
+ tags-todo Tags/P/T match in all agenda files, TODO entries only.
+ todo-tree Sparse tree of specific TODO keyword in *current* file.
+ tags-tree Sparse tree with all tags matches in *current* file.
+ occur-tree Occur sparse tree for *current* file.
+ ... A user-defined function.
+match What to search for:
+ - a single keyword for TODO keyword searches
+ - a tags/property/todo match expression for searches
+ - a word search expression for text searches.
+ - a regular expression for occur searches
+ For all other commands, this should be the empty string.
+settings A list of option settings, similar to that in a let form, so like
+ this: ((opt1 val1) (opt2 val2) ...). The values will be
+ evaluated at the moment of execution, so quote them when needed.
+files A list of files to write the produced agenda buffer to with
+ the command `org-store-agenda-views'.
+ If a file name ends in \".html\", an HTML version of the buffer
+ is written out. If it ends in \".ps\", a postscript version is
+ produced. Otherwise, only the plain text is written to the file.
+
+You can also define a set of commands, to create a composite agenda buffer.
+In this case, an entry looks like this:
+
+ (key desc (cmd1 cmd2 ...) general-settings-for-whole-set files)
+
+where
+
+desc A description string to be displayed in the dispatcher menu.
+cmd An agenda command, similar to the above. However, tree commands
+ are not allowed, but instead you can get agenda and global todo list.
+ So valid commands for a set are:
+ (agenda \"\" settings)
+ (alltodo \"\" settings)
+ (stuck \"\" settings)
+ (todo \"match\" settings files)
+ (search \"match\" settings files)
+ (tags \"match\" settings files)
+ (tags-todo \"match\" settings files)
+
+Each command can carry a list of options, and another set of options can be
+given for the whole set of commands. Individual command options take
+precedence over the general options.
+
+When using several characters as key to a command, the first characters
+are prefix commands. For the dispatcher to display useful information, you
+should provide a description for the prefix, like
+
+ (setq org-agenda-custom-commands
+ \\='((\"h\" . \"HOME + Name tag searches\") ; describe prefix \"h\"
+ (\"hl\" tags \"+HOME+Lisa\")
+ (\"hp\" tags \"+HOME+Peter\")
+ (\"hk\" tags \"+HOME+Kim\")))"
+ :group 'org-agenda-custom-commands
+ :type `(repeat
+ (choice :value ("x" "Describe command here" tags "" nil)
+ (list :tag "Single command"
+ (string :tag "Access Key(s) ")
+ (option (string :tag "Description"))
+ (choice
+ (const :tag "Agenda" agenda)
+ (const :tag "TODO list" alltodo)
+ (const :tag "Search words" search)
+ (const :tag "Stuck projects" stuck)
+ (const :tag "Tags/Property match (all agenda files)" tags)
+ (const :tag "Tags/Property match of TODO entries (all agenda files)" tags-todo)
+ (const :tag "TODO keyword search (all agenda files)" todo)
+ (const :tag "Tags sparse tree (current buffer)" tags-tree)
+ (const :tag "TODO keyword tree (current buffer)" todo-tree)
+ (const :tag "Occur tree (current buffer)" occur-tree)
+ (sexp :tag "Other, user-defined function"))
+ (string :tag "Match (only for some commands)")
+ ,org-agenda-custom-commands-local-options
+ (option (repeat :tag "Export" (file :tag "Export to"))))
+ (list :tag "Command series, all agenda files"
+ (string :tag "Access Key(s)")
+ (string :tag "Description ")
+ (repeat :tag "Component"
+ (choice
+ (list :tag "Agenda"
+ (const :format "" agenda)
+ (const :tag "" :format "" "")
+ ,org-agenda-custom-commands-local-options)
+ (list :tag "TODO list (all keywords)"
+ (const :format "" alltodo)
+ (const :tag "" :format "" "")
+ ,org-agenda-custom-commands-local-options)
+ (list :tag "Search words"
+ (const :format "" search)
+ (string :tag "Match")
+ ,org-agenda-custom-commands-local-options)
+ (list :tag "Stuck projects"
+ (const :format "" stuck)
+ (const :tag "" :format "" "")
+ ,org-agenda-custom-commands-local-options)
+ (list :tag "Tags/Property match (all agenda files)"
+ (const :format "" tags)
+ (string :tag "Match")
+ ,org-agenda-custom-commands-local-options)
+ (list :tag "Tags/Property match of TODO entries (all agenda files)"
+ (const :format "" tags-todo)
+ (string :tag "Match")
+ ,org-agenda-custom-commands-local-options)
+ (list :tag "TODO keyword search"
+ (const :format "" todo)
+ (string :tag "Match")
+ ,org-agenda-custom-commands-local-options)
+ (list :tag "Other, user-defined function"
+ (symbol :tag "function")
+ (string :tag "Match")
+ ,org-agenda-custom-commands-local-options)))
+
+ (repeat :tag "Settings for entire command set"
+ (list (variable :tag "Any variable")
+ (sexp :tag "Value")))
+ (option (repeat :tag "Export" (file :tag "Export to"))))
+ (cons :tag "Prefix key documentation"
+ (string :tag "Access Key(s)")
+ (string :tag "Description ")))))
+
+(defcustom org-agenda-query-register ?o
+ "The register holding the current query string.
+The purpose of this is that if you construct a query string interactively,
+you can then use it to define a custom command."
+ :group 'org-agenda-custom-commands
+ :type 'character)
+
+(defcustom org-stuck-projects
+ '("+LEVEL=2/-DONE" ("TODO" "NEXT" "NEXTACTION") nil "")
+ "How to identify stuck projects.
+This is a list of four items:
+1. A tags/todo/property matcher string that is used to identify a project.
+ See the manual for a description of tag and property searches.
+ The entire tree below a headline matched by this is considered one project.
+2. A list of TODO keywords identifying non-stuck projects.
+ If the project subtree contains any headline with one of these todo
+ keywords, the project is considered to be not stuck. If you specify
+ \"*\" as a keyword, any TODO keyword will mark the project unstuck.
+3. A list of tags identifying non-stuck projects.
+ If the project subtree contains any headline with one of these tags,
+ the project is considered to be not stuck. If you specify \"*\" as
+ a tag, any tag will mark the project unstuck. Note that this is about
+ the explicit presence of a tag somewhere in the subtree, inherited
+ tags do not count here. If inherited tags make a project not stuck,
+ use \"-TAG\" in the tags part of the matcher under (1.) above.
+4. An arbitrary regular expression matching non-stuck projects.
+
+If the project turns out to be not stuck, search continues also in the
+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 `\\[org-agenda] #') to produce the list."
+ :group 'org-agenda-custom-commands
+ :type '(list
+ (string :tag "Tags/TODO match to identify a project")
+ (repeat :tag "Projects are *not* stuck if they have an entry with \
+TODO keyword any of" (string))
+ (repeat :tag "Projects are *not* stuck if they have an entry with \
+TAG being any of" (string))
+ (regexp :tag "Projects are *not* stuck if this regexp matches inside \
+the subtree")))
+
+(defgroup org-agenda-skip nil
+ "Options concerning skipping parts of agenda files."
+ :tag "Org Agenda Skip"
+ :group 'org-agenda)
+
+(defcustom org-agenda-skip-function-global nil
+ "Function to be called at each match during agenda construction.
+If this function returns nil, the current match should not be skipped.
+If the function decided to skip an agenda match, is must return the
+buffer position from which the search should be continued.
+This may also be a Lisp form, which will be evaluated.
+
+This variable will be applied to every agenda match, including
+tags/property searches and TODO lists. So try to make the test function
+do its checking as efficiently as possible. To implement a skipping
+condition just for specific agenda commands, use the variable
+`org-agenda-skip-function' which can be set in the options section
+of custom agenda commands."
+ :group 'org-agenda-skip
+ :type 'sexp)
+
+(defgroup org-agenda-daily/weekly nil
+ "Options concerning the daily/weekly agenda."
+ :tag "Org Agenda Daily/Weekly"
+ :group 'org-agenda)
+(defgroup org-agenda-todo-list nil
+ "Options concerning the global todo list agenda view."
+ :tag "Org Agenda Todo List"
+ :group 'org-agenda)
+(defgroup org-agenda-match-view nil
+ "Options concerning the general tags/property/todo match agenda view."
+ :tag "Org Agenda Match View"
+ :group 'org-agenda)
+(defgroup org-agenda-search-view nil
+ "Options concerning the search agenda view."
+ :tag "Org Agenda Search View"
+ :group 'org-agenda)
+
+(defvar org-agenda-archives-mode nil
+ "Non-nil means the agenda will include archived items.
+If this is the symbol `trees', trees in the selected agenda scope
+that are marked with the ARCHIVE tag will be included anyway. When this is
+t, also all archive files associated with the current selection of agenda
+files will be included.")
+
+(defcustom org-agenda-restriction-lock-highlight-subtree t
+ "Non-nil means highlight the whole subtree when restriction is active.
+Otherwise only highlight the headline. Highlighting the whole subtree is
+useful to ensure no edits happen beyond the restricted region."
+ :group 'org-agenda
+ :type 'boolean)
+
+(defcustom org-agenda-skip-comment-trees t
+ "Non-nil means skip trees that start with the COMMENT keyword.
+When nil, these trees are also scanned by agenda commands."
+ :group 'org-agenda-skip
+ :type 'boolean)
+
+(defcustom org-agenda-todo-list-sublevels t
+ "Non-nil means check also the sublevels of a TODO entry for TODO entries.
+When nil, the sublevels of a TODO entry are not checked, resulting in
+potentially much shorter TODO lists."
+ :group 'org-agenda-skip
+ :group 'org-agenda-todo-list
+ :type 'boolean)
+
+(defcustom org-agenda-todo-ignore-with-date nil
+ "Non-nil means don't show entries with a date in the global todo list.
+You can use this if you prefer to mark mere appointments with a TODO keyword,
+but don't want them to show up in the TODO list.
+When this is set, it also covers deadlines and scheduled items, the settings
+of `org-agenda-todo-ignore-scheduled' and `org-agenda-todo-ignore-deadlines'
+will be ignored.
+See also the variable `org-agenda-tags-todo-honor-ignore-options'."
+ :group 'org-agenda-skip
+ :group 'org-agenda-todo-list
+ :type 'boolean)
+
+(defcustom org-agenda-todo-ignore-timestamp nil
+ "Non-nil means don't show entries with a timestamp.
+This applies when creating the global todo list.
+Valid values are:
+
+past Don't show entries for today or in the past.
+
+future Don't show entries with a timestamp in the future.
+ The idea behind this is that if it has a future
+ timestamp, you don't want to think about it until the
+ date.
+
+all Don't show any entries with a timestamp in the global todo list.
+ The idea behind this is that by setting a timestamp, you
+ have already \"taken care\" of this item.
+
+This variable can also have an integer as a value. If positive (N),
+todos with a timestamp N or more days in the future will be ignored. If
+negative (-N), todos with a timestamp N or more days in the past will be
+ignored. If 0, todos with a timestamp either today or in the future will
+be ignored. For example, a value of -1 will exclude todos with a
+timestamp in the past (yesterday or earlier), while a value of 7 will
+exclude todos with a timestamp a week or more in the future.
+
+See also `org-agenda-todo-ignore-with-date'.
+See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want
+to make his option also apply to the tags-todo list."
+ :group 'org-agenda-skip
+ :group 'org-agenda-todo-list
+ :version "24.1"
+ :type '(choice
+ (const :tag "Ignore future timestamp todos" future)
+ (const :tag "Ignore past or present timestamp todos" past)
+ (const :tag "Ignore all timestamp todos" all)
+ (const :tag "Show timestamp todos" nil)
+ (integer :tag "Ignore if N or more days in past(-) or future(+).")))
+
+(defcustom org-agenda-todo-ignore-scheduled nil
+ "Non-nil means, ignore some scheduled TODO items when making TODO list.
+This applies when creating the global todo list.
+Valid values are:
+
+past Don't show entries scheduled today or in the past.
+
+future Don't show entries scheduled in the future.
+ The idea behind this is that by scheduling it, you don't want to
+ think about it until the scheduled date.
+
+all Don't show any scheduled entries in the global todo list.
+ The idea behind this is that by scheduling it, you have already
+ \"taken care\" of this item.
+
+t Same as `all', for backward compatibility.
+
+This variable can also have an integer as a value. See
+`org-agenda-todo-ignore-timestamp' for more details.
+
+See also `org-agenda-todo-ignore-with-date'.
+See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want
+to make his option also apply to the tags-todo list."
+ :group 'org-agenda-skip
+ :group 'org-agenda-todo-list
+ :type '(choice
+ (const :tag "Ignore future-scheduled todos" future)
+ (const :tag "Ignore past- or present-scheduled todos" past)
+ (const :tag "Ignore all scheduled todos" all)
+ (const :tag "Ignore all scheduled todos (compatibility)" t)
+ (const :tag "Show scheduled todos" nil)
+ (integer :tag "Ignore if N or more days in past(-) or future(+).")))
+
+(defcustom org-agenda-todo-ignore-deadlines nil
+ "Non-nil means ignore some deadline TODO items when making TODO list.
+
+There are different motivations for using different values, please think
+carefully when configuring this variable.
+
+This applies when creating the global TODO list.
+
+Valid values are:
+
+near Don't show near deadline entries. A deadline is near when it is
+ closer than `org-deadline-warning-days' days. The idea behind this
+ is that such items will appear in the agenda anyway.
+
+far Don't show TODO entries where a deadline has been defined, but
+ is not going to happen anytime soon. This is useful if you want to use
+ the TODO list to figure out what to do now.
+
+past Don't show entries with a deadline timestamp for today or in the past.
+
+future Don't show entries with a deadline timestamp in the future, not even
+ when they become `near' ones. Use it with caution.
+
+all Ignore all TODO entries that do have a deadline.
+
+t Same as `near', for backward compatibility.
+
+This variable can also have an integer as a value. See
+`org-agenda-todo-ignore-timestamp' for more details.
+
+See also `org-agenda-todo-ignore-with-date'.
+See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want
+to make his option also apply to the tags-todo list."
+ :group 'org-agenda-skip
+ :group 'org-agenda-todo-list
+ :type '(choice
+ (const :tag "Ignore near deadlines" near)
+ (const :tag "Ignore near deadlines (compatibility)" t)
+ (const :tag "Ignore far deadlines" far)
+ (const :tag "Ignore all TODOs with a deadlines" all)
+ (const :tag "Show all TODOs, even if they have a deadline" nil)
+ (integer :tag "Ignore if N or more days in past(-) or future(+).")))
+
+(defcustom org-agenda-todo-ignore-time-comparison-use-seconds nil
+ "Time unit to use when possibly ignoring an agenda item.
+
+See the docstring of various `org-agenda-todo-ignore-*' options.
+The default is to compare time stamps using days. An item is thus
+considered to be in the future if it is at least one day after today.
+Non-nil means to compare time stamps using seconds. An item is then
+considered future if it has a time value later than current time."
+ :group 'org-agenda-skip
+ :group 'org-agenda-todo-list
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "Compare time with days" nil)
+ (const :tag "Compare time with seconds" t)))
+
+(defcustom org-agenda-tags-todo-honor-ignore-options nil
+ "Non-nil means honor todo-list ignores options also in tags-todo search.
+The variables
+ `org-agenda-todo-ignore-with-date',
+ `org-agenda-todo-ignore-timestamp',
+ `org-agenda-todo-ignore-scheduled',
+ `org-agenda-todo-ignore-deadlines'
+make the global TODO list skip entries that have time stamps of certain
+kinds. If this option is set, the same options will also apply for the
+tags-todo search, which is the general tags/property matcher
+restricted to unfinished TODO entries only."
+ :group 'org-agenda-skip
+ :group 'org-agenda-todo-list
+ :group 'org-agenda-match-view
+ :type 'boolean)
+
+(defcustom org-agenda-skip-scheduled-if-done nil
+ "Non-nil means don't show scheduled items in agenda when they are done.
+This is relevant for the daily/weekly agenda, not for the TODO list. It
+applies only to the actual date of the scheduling. Warnings about an item
+with a past scheduling dates are always turned off when the item is DONE."
+ :group 'org-agenda-skip
+ :group 'org-agenda-daily/weekly
+ :type 'boolean)
+
+(defcustom org-agenda-skip-scheduled-if-deadline-is-shown nil
+ "Non-nil means skip scheduling line if same entry shows because of deadline.
+
+In the agenda of today, an entry can show up multiple times
+because it is both scheduled and has a nearby deadline, and maybe
+a plain time stamp as well.
+
+When this variable is nil, the entry will be shown several times.
+
+When set to t, then only the deadline is shown and the fact that
+the entry is scheduled today or was scheduled previously is not
+shown.
+
+When set to the symbol `not-today', skip scheduled previously,
+but not scheduled today.
+
+When set to the symbol `repeated-after-deadline', skip scheduled
+items if they are repeated beyond the current deadline."
+ :group 'org-agenda-skip
+ :group 'org-agenda-daily/weekly
+ :type '(choice
+ (const :tag "Never" nil)
+ (const :tag "Always" t)
+ (const :tag "Not when scheduled today" not-today)
+ (const :tag "When repeated past deadline" repeated-after-deadline)))
+
+(defcustom org-agenda-skip-timestamp-if-deadline-is-shown nil
+ "Non-nil means skip timestamp line if same entry shows because of deadline.
+In the agenda of today, an entry can show up multiple times
+because it has both a plain timestamp and has a nearby deadline.
+When this variable is t, then only the deadline is shown and the
+fact that the entry has a timestamp for or including today is not
+shown. When this variable is nil, the entry will be shown
+several times."
+ :group 'org-agenda-skip
+ :group 'org-agenda-daily/weekly
+ :version "24.1"
+ :type '(choice
+ (const :tag "Never" nil)
+ (const :tag "Always" t)))
+
+(defcustom org-agenda-skip-deadline-if-done nil
+ "Non-nil means don't show deadlines when the corresponding item is done.
+When nil, the deadline is still shown and should give you a happy feeling.
+This is relevant for the daily/weekly agenda. It applies only to the
+actual date of the deadline. Warnings about approaching and past-due
+deadlines are always turned off when the item is DONE."
+ :group 'org-agenda-skip
+ :group 'org-agenda-daily/weekly
+ :type 'boolean)
+
+(defcustom org-agenda-skip-deadline-prewarning-if-scheduled nil
+ "Non-nil means skip deadline prewarning when entry is also scheduled.
+This will apply on all days where a prewarning for the deadline would
+be shown, but not at the day when the entry is actually due. On that day,
+the deadline will be shown anyway.
+This variable may be set to nil, t, the symbol `pre-scheduled',
+or a number which will then give the number of days before the actual
+deadline when the prewarnings should resume. The symbol `pre-scheduled'
+eliminates the deadline prewarning only prior to the scheduled date.
+This can be used in a workflow where the first showing of the deadline will
+trigger you to schedule it, and then you don't want to be reminded of it
+because you will take care of it on the day when scheduled."
+ :group 'org-agenda-skip
+ :group 'org-agenda-daily/weekly
+ :version "24.1"
+ :type '(choice
+ (const :tag "Always show prewarning" nil)
+ (const :tag "Remove prewarning prior to scheduled date" pre-scheduled)
+ (const :tag "Remove prewarning if entry is scheduled" t)
+ (integer :tag "Restart prewarning N days before deadline")))
+
+(defcustom org-agenda-skip-scheduled-delay-if-deadline nil
+ "Non-nil means skip scheduled delay when entry also has a deadline.
+This variable may be set to nil, t, the symbol `post-deadline',
+or a number which will then give the number of days after the actual
+scheduled date when the delay should expire. The symbol `post-deadline'
+eliminates the schedule delay when the date is posterior to the deadline."
+ :group 'org-agenda-skip
+ :group 'org-agenda-daily/weekly
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "Always honor delay" nil)
+ (const :tag "Ignore delay if posterior to the deadline" post-deadline)
+ (const :tag "Ignore delay if entry has a deadline" t)
+ (integer :tag "Honor delay up until N days after the scheduled date")))
+
+(defcustom org-agenda-skip-additional-timestamps-same-entry nil
+ "When nil, multiple same-day timestamps in entry make multiple agenda lines.
+When non-nil, after the search for timestamps has matched once in an
+entry, the rest of the entry will not be searched."
+ :group 'org-agenda-skip
+ :type 'boolean)
+
+(defcustom org-agenda-skip-timestamp-if-done nil
+ "Non-nil means don't select item by timestamp or -range if it is DONE."
+ :group 'org-agenda-skip
+ :group 'org-agenda-daily/weekly
+ :type 'boolean)
+
+(defcustom org-agenda-dim-blocked-tasks t
+ "Non-nil means dim blocked tasks in the agenda display.
+This causes some overhead during agenda construction, but if you
+have turned on `org-enforce-todo-dependencies',
+`org-enforce-todo-checkbox-dependencies', or any other blocking
+mechanism, this will create useful feedback in the agenda.
+
+Instead of t, this variable can also have the value `invisible'.
+Then blocked tasks will be invisible and only become visible when
+they become unblocked. An exemption to this behavior is when a task is
+blocked because of unchecked checkboxes below it. Since checkboxes do
+not show up in the agenda views, making this task invisible you remove any
+trace from agenda views that there is something to do. Therefore, a task
+that is blocked because of checkboxes will never be made invisible, it
+will only be dimmed."
+ :group 'org-agenda-daily/weekly
+ :group 'org-agenda-todo-list
+ :version "24.3"
+ :type '(choice
+ (const :tag "Do not dim" nil)
+ (const :tag "Dim to a gray face" t)
+ (const :tag "Make invisible" invisible)))
+
+(defgroup org-agenda-startup nil
+ "Options concerning initial settings in the Agenda in Org Mode."
+ :tag "Org Agenda Startup"
+ :group 'org-agenda)
+
+(defcustom org-agenda-menu-show-matcher t
+ "Non-nil means show the match string in the agenda dispatcher menu.
+When nil, the matcher string is not shown, but is put into the help-echo
+property so than moving the mouse over the command shows it.
+Setting it to nil is good if matcher strings are very long and/or if
+you want to use two-columns display (see `org-agenda-menu-two-columns')."
+ :group 'org-agenda
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-agenda-menu-two-columns nil
+ "Non-nil means, use two columns to show custom commands in the dispatcher.
+If you use this, you probably want to set `org-agenda-menu-show-matcher'
+to nil."
+ :group 'org-agenda
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-agenda-finalize-hook nil
+ "Hook run just before displaying an agenda buffer.
+The buffer is still writable when the hook is called.
+
+You can modify some of the buffer substrings but you should be
+extra careful not to modify the text properties of the agenda
+headlines as the agenda display heavily relies on them."
+ :group 'org-agenda-startup
+ :type 'hook)
+
+(defcustom org-agenda-filter-hook nil
+ "Hook run just after filtering with `org-agenda-filter'."
+ :group 'org-agenda-startup
+ :package-version '(Org . "9.4")
+ :type 'hook)
+
+(defcustom org-agenda-mouse-1-follows-link nil
+ "Non-nil means mouse-1 on a link will follow the link in the agenda.
+A longer mouse click will still set point. Needs to be set
+before org.el is loaded."
+ :group 'org-agenda-startup
+ :type 'boolean)
+
+(defcustom org-agenda-start-with-follow-mode nil
+ "The initial value of follow mode in a newly created agenda window."
+ :group 'org-agenda-startup
+ :type 'boolean)
+
+(defcustom org-agenda-follow-indirect nil
+ "Non-nil means `org-agenda-follow-mode' displays only the
+current item's tree, in an indirect buffer."
+ :group 'org-agenda
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-agenda-show-outline-path t
+ "Non-nil means show outline path in echo area after line motion."
+ :group 'org-agenda-startup
+ :type 'boolean)
+
+(defcustom org-agenda-start-with-entry-text-mode nil
+ "The initial value of entry-text-mode in a newly created agenda window."
+ :group 'org-agenda-startup
+ :type 'boolean)
+
+(defcustom org-agenda-entry-text-maxlines 5
+ "Number of text lines to be added when `E' is pressed in the agenda.
+
+Note that this variable only used during agenda display. To add entry text
+when exporting the agenda, configure the variable
+`org-agenda-add-entry-text-maxlines'."
+ :group 'org-agenda
+ :type 'integer)
+
+(defcustom org-agenda-entry-text-exclude-regexps nil
+ "List of regular expressions to clean up entry text.
+The complete matches of all regular expressions in this list will be
+removed from entry text before it is shown in the agenda."
+ :group 'org-agenda
+ :type '(repeat (regexp)))
+
+(defcustom org-agenda-entry-text-leaders " > "
+ "Text prepended to the entry text in agenda buffers."
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :group 'org-agenda
+ :type 'string)
+
+(defvar org-agenda-entry-text-cleanup-hook nil
+ "Hook that is run after basic cleanup of entry text to be shown in agenda.
+This cleanup is done in a temporary buffer, so the function may inspect and
+change the entire buffer.
+Some default stuff like drawers and scheduling/deadline dates will already
+have been removed when this is called, as will any matches for regular
+expressions listed in `org-agenda-entry-text-exclude-regexps'.")
+
+(defvar org-agenda-include-inactive-timestamps nil
+ "Non-nil means include inactive time stamps in agenda.
+Dynamically scoped.")
+
+(defgroup org-agenda-windows nil
+ "Options concerning the windows used by the Agenda in Org Mode."
+ :tag "Org Agenda Windows"
+ :group 'org-agenda)
+
+(defcustom org-agenda-window-setup 'reorganize-frame
+ "How the agenda buffer should be displayed.
+Possible values for this option are:
+
+current-window Show agenda in the current window, keeping all other windows.
+other-window Use `switch-to-buffer-other-window' to display agenda.
+only-window Show agenda, deleting all other windows.
+reorganize-frame Show only two windows on the current frame, the current
+ window and the agenda.
+other-frame Use `switch-to-buffer-other-frame' to display agenda.
+ Also, when exiting the agenda, kill that frame.
+other-tab Use `switch-to-buffer-other-tab' to display the
+ agenda, making use of the `tab-bar-mode' introduced
+ in Emacs version 27.1. Also, kill that tab when
+ exiting the agenda view.
+
+See also the variable `org-agenda-restore-windows-after-quit'."
+ :group 'org-agenda-windows
+ :type '(choice
+ (const current-window)
+ (const other-frame)
+ (const other-tab)
+ (const other-window)
+ (const only-window)
+ (const reorganize-frame))
+ :package-version '(Org . "9.4"))
+
+(defcustom org-agenda-window-frame-fractions '(0.5 . 0.75)
+ "The min and max height of the agenda window as a fraction of frame height.
+The value of the variable is a cons cell with two numbers between 0 and 1.
+It only matters if `org-agenda-window-setup' is `reorganize-frame'."
+ :group 'org-agenda-windows
+ :type '(cons (number :tag "Minimum") (number :tag "Maximum")))
+
+(defcustom org-agenda-restore-windows-after-quit nil
+ "Non-nil means restore window configuration upon exiting agenda.
+Before the window configuration is changed for displaying the
+agenda, the current status is recorded. When the agenda is
+exited with `q' or `x' and this option is set, the old state is
+restored. If `org-agenda-window-setup' is `other-frame' or
+`other-tab', the value of this option will be ignored."
+ :group 'org-agenda-windows
+ :type 'boolean)
+
+(defcustom org-agenda-span 'week
+ "Number of days to include in overview display.
+Can be day, week, month, year, or any number of days.
+Custom commands can set this variable in the options section."
+ :group 'org-agenda-daily/weekly
+ :type '(choice (const :tag "Day" day)
+ (const :tag "Week" week)
+ (const :tag "Fortnight" fortnight)
+ (const :tag "Month" month)
+ (const :tag "Year" year)
+ (integer :tag "Custom")))
+
+(defcustom org-agenda-start-on-weekday 1
+ "Non-nil means start the overview always on the specified weekday.
+0 denotes Sunday, 1 denotes Monday, etc.
+When nil, always start on the current day.
+Custom commands can set this variable in the options section."
+ :group 'org-agenda-daily/weekly
+ :type '(choice (const :tag "Today" nil)
+ (integer :tag "Weekday No.")))
+
+(defcustom org-agenda-show-all-dates t
+ "Non-nil means `org-agenda' shows every day in the selected range.
+When nil, only the days which actually have entries are shown."
+ :group 'org-agenda-daily/weekly
+ :type 'boolean)
+
+(defcustom org-agenda-format-date 'org-agenda-format-date-aligned
+ "Format string for displaying dates in the agenda.
+Used by the daily/weekly agenda. This should be a format string
+understood by `format-time-string', or a function returning the
+formatted date as a string. The function must take a single
+argument, a calendar-style date list like (month day year)."
+ :group 'org-agenda-daily/weekly
+ :type '(choice
+ (string :tag "Format string")
+ (function :tag "Function")))
+
+(defun org-agenda-end-of-line ()
+ "Go to the end of visible line."
+ (interactive)
+ (goto-char (line-end-position)))
+
+(defun org-agenda-format-date-aligned (date)
+ "Format a DATE string for display in the daily/weekly agenda.
+This function makes sure that dates are aligned for easy reading."
+ (require 'cal-iso)
+ (let* ((dayname (calendar-day-name date))
+ (day (cadr date))
+ (day-of-week (calendar-day-of-week date))
+ (month (car date))
+ (monthname (calendar-month-name month))
+ (year (nth 2 date))
+ (iso-week (org-days-to-iso-week
+ (calendar-absolute-from-gregorian date)))
+ ;; (weekyear (cond ((and (= month 1) (>= iso-week 52))
+ ;; (1- year))
+ ;; ((and (= month 12) (<= iso-week 1))
+ ;; (1+ year))
+ ;; (t year)))
+ (weekstring (if (= day-of-week 1)
+ (format " W%02d" iso-week)
+ "")))
+ (format "%-10s %2d %s %4d%s"
+ dayname day monthname year weekstring)))
+
+(defcustom org-agenda-time-leading-zero nil
+ "Non-nil means use leading zero for military times in agenda.
+For example, 9:30am would become 09:30 rather than 9:30."
+ :group 'org-agenda-daily/weekly
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-agenda-timegrid-use-ampm nil
+ "When set, show AM/PM style timestamps on the timegrid."
+ :group 'org-agenda
+ :version "24.1"
+ :type 'boolean)
+
+(defun org-agenda-time-of-day-to-ampm (time)
+ "Convert TIME of a string like \"13:45\" to an AM/PM style time string."
+ (let* ((hour-number (string-to-number (substring time 0 -3)))
+ (minute (substring time -2))
+ (ampm "am"))
+ (cond
+ ((equal hour-number 12)
+ (setq ampm "pm"))
+ ((> hour-number 12)
+ (setq ampm "pm")
+ (setq hour-number (- hour-number 12))))
+ (concat
+ (if org-agenda-time-leading-zero
+ (format "%02d" hour-number)
+ (format "%02s" (number-to-string hour-number)))
+ ":" minute ampm)))
+
+(defun org-agenda-time-of-day-to-ampm-maybe (time)
+ "Conditionally convert TIME to AM/PM format.
+This is based on `org-agenda-timegrid-use-ampm'."
+ (if org-agenda-timegrid-use-ampm
+ (org-agenda-time-of-day-to-ampm time)
+ time))
+
+(defcustom org-agenda-weekend-days '(6 0)
+ "Which days are weekend?
+These days get the special face `org-agenda-date-weekend' in the agenda."
+ :group 'org-agenda-daily/weekly
+ :type '(set :greedy t
+ (const :tag "Monday" 1)
+ (const :tag "Tuesday" 2)
+ (const :tag "Wednesday" 3)
+ (const :tag "Thursday" 4)
+ (const :tag "Friday" 5)
+ (const :tag "Saturday" 6)
+ (const :tag "Sunday" 0)))
+
+(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 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
+in the past."
+ :group 'org-agenda-daily/weekly
+ :version "24.1"
+ :type 'boolean)
+
+(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
+calendar will be used to add entries to the `diary-file'. But when this
+points to a file, `org-agenda-diary-entry' will be used instead."
+ :group 'org-agenda
+ :type '(choice
+ (const :tag "The standard Emacs diary file" diary-file)
+ (file :tag "Special Org file diary entries")))
+
+(defcustom org-agenda-include-diary nil
+ "If non-nil, include in the agenda entries from the Emacs Calendar's diary.
+Custom commands can set this variable in the options section."
+ :group 'org-agenda-daily/weekly
+ :type 'boolean)
+
+(defcustom org-agenda-include-deadlines t
+ "If non-nil, include entries within their deadline warning period.
+Custom commands can set this variable in the options section."
+ :group 'org-agenda-daily/weekly
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-agenda-show-future-repeats t
+ "Non-nil shows repeated entries in the future part of the agenda.
+When set to the symbol `next' only the first future repeat is shown."
+ :group 'org-agenda-daily/weekly
+ :type '(choice
+ (const :tag "Show all repeated entries" t)
+ (const :tag "Show next repeated entry" next)
+ (const :tag "Do not show repeated entries" nil))
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :safe #'symbolp)
+
+(defcustom org-agenda-prefer-last-repeat nil
+ "Non-nil sets date for repeated entries to their last repeat.
+
+When nil, display SCHEDULED and DEADLINE dates at their base
+date, and in today's agenda, as a reminder. Display plain
+time-stamps, on the other hand, at every repeat date in the past
+in addition to the base date.
+
+When non-nil, show a repeated entry at its latest repeat date,
+possibly being today even if it wasn't marked as done. This
+setting is useful if you do not always mark repeated entries as
+done and, yet, consider that reaching repeat date starts the task
+anew.
+
+When set to a list of strings, prefer last repeats only for
+entries with these TODO keywords."
+ :group 'org-agenda-daily/weekly
+ :type '(choice
+ (const :tag "Prefer last repeat" t)
+ (const :tag "Prefer base date" nil)
+ (repeat :tag "Prefer last repeat for entries with these TODO keywords"
+ (string :tag "TODO keyword")))
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :safe (lambda (x) (or (booleanp x) (consp x))))
+
+(defcustom org-scheduled-past-days 10000
+ "Number of days to continue listing scheduled items not marked DONE.
+When an item is scheduled on a date, it shows up in the agenda on
+this day and will be listed until it is marked done or for the
+number of days given here."
+ :group 'org-agenda-daily/weekly
+ :type 'integer
+ :safe 'integerp)
+
+(defcustom org-deadline-past-days 10000
+ "Number of days to warn about missed deadlines.
+When an item has deadline on a date, it shows up in the agenda on
+this day and will appear as a reminder until it is marked DONE or
+for the number of days given here."
+ :group 'org-agenda-daily/weekly
+ :type 'integer
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :safe 'integerp)
+
+(defcustom org-agenda-log-mode-items '(closed clock)
+ "List of items that should be shown in agenda log mode.
+\\<org-agenda-mode-map>\
+This list may contain the following symbols:
+
+ closed Show entries that have been closed on that day.
+ clock Show entries that have received clocked time on that day.
+ state Show all logged state changes.
+Note that instead of changing this variable, you can also press \
+`\\[universal-argument] \\[org-agenda-log-mode]' in
+the agenda to display all available LOG items temporarily."
+ :group 'org-agenda-daily/weekly
+ :type '(set :greedy t (const closed) (const clock) (const state)))
+
+(defcustom org-agenda-clock-consistency-checks
+ '(:max-duration "10:00" :min-duration 0 :max-gap "0:05"
+ :gap-ok-around ("4:00")
+ :default-face ((:background "DarkRed") (:foreground "white"))
+ :overlap-face nil :gap-face nil :no-end-time-face nil
+ :long-face nil :short-face nil)
+ "This is a property list, with the following keys:
+
+:max-duration Mark clocking chunks that are longer than this time.
+ This is a time string like \"HH:MM\", or the number
+ of minutes as an integer.
+
+:min-duration Mark clocking chunks that are shorter that this.
+ This is a time string like \"HH:MM\", or the number
+ of minutes as an integer.
+
+:max-gap Mark gaps between clocking chunks that are longer than
+ this duration. A number of minutes, or a string
+ like \"HH:MM\".
+
+:gap-ok-around List of times during the day which are usually not working
+ times. When a gap is detected, but the gap contains any
+ of these times, the gap is *not* reported. For example,
+ if this is (\"4:00\" \"13:00\") then gaps that contain
+ 4:00 in the morning (i.e. the night) and 13:00
+ (i.e. a typical lunch time) do not cause a warning.
+ You should have at least one time during the night in this
+ list, or otherwise the first task each morning will trigger
+ a warning because it follows a long gap.
+
+Furthermore, the following properties can be used to define faces for
+issue display.
+
+:default-face the default face, if the specific face is undefined
+:overlap-face face for overlapping clocks
+:gap-face face for gaps between clocks
+:no-end-time-face face for incomplete clocks
+:long-face face for clock intervals that are too long
+:short-face face for clock intervals that are too short"
+ :group 'org-agenda-daily/weekly
+ :group 'org-clock
+ :version "24.1"
+ :type 'plist)
+
+(defcustom org-agenda-log-mode-add-notes t
+ "Non-nil means add first line of notes to log entries in agenda views.
+If a log item like a state change or a clock entry is associated with
+notes, the first line of these notes will be added to the entry in the
+agenda display."
+ :group 'org-agenda-daily/weekly
+ :type 'boolean)
+
+(defcustom org-agenda-start-with-log-mode nil
+ "The initial value of log-mode in a newly created agenda window.
+See `org-agenda-log-mode' and `org-agenda-log-mode-items' for further
+explanations on the possible values."
+ :group 'org-agenda-startup
+ :group 'org-agenda-daily/weekly
+ :type '(choice (const :tag "Don't show log items" nil)
+ (const :tag "Show only log items" only)
+ (const :tag "Show all possible log items" clockcheck)
+ (repeat :tag "Choose among possible values for `org-agenda-log-mode-items'"
+ (choice (const :tag "Show closed log items" closed)
+ (const :tag "Show clocked log items" clock)
+ (const :tag "Show all logged state changes" state)))))
+
+(defcustom org-agenda-start-with-clockreport-mode nil
+ "The initial value of clockreport-mode in a newly created agenda window."
+ :group 'org-agenda-startup
+ :group 'org-agenda-daily/weekly
+ :type 'boolean)
+
+(defcustom org-agenda-clockreport-parameter-plist '(:link t :maxlevel 2)
+ "Property list with parameters for the clocktable in clockreport mode.
+This is the display mode that shows a clock table in the daily/weekly
+agenda, the properties for this dynamic block can be set here.
+The usual clocktable parameters are allowed here, but you cannot set
+the properties :name, :tstart, :tend, :block, and :scope - these will
+be overwritten to make sure the content accurately reflects the
+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.
+
+The search string for search view can either be interpreted as a phrase,
+or as a list of snippets that define a boolean search for a number of
+strings.
+
+When this is non-nil, the string will be split on whitespace, and each
+snippet will be searched individually, and all must match in order to
+select an entry. A snippet is then a single string of non-white
+characters, or a string in double quotes, or a regexp in {} braces.
+If a snippet is preceded by \"-\", the snippet must *not* match.
+\"+\" is syntactic sugar for positive selection. Each snippet may
+be found as a full word or a partial word, but see the variable
+`org-agenda-search-view-force-full-words'.
+
+When this is nil, search will look for the entire search phrase as one,
+with each space character matching any amount of whitespace, including
+line breaks.
+
+Even when this is nil, you can still switch to Boolean search dynamically
+by preceding the first snippet with \"+\" or \"-\". If the first snippet
+is a regexp marked with braces like \"{abc}\", this will also switch to
+boolean search."
+ :group 'org-agenda-search-view
+ :version "24.1"
+ :type '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."
+ :group 'org-agenda-search-view
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-agenda-search-view-max-outline-level 0
+ "Maximum outline level to display in search view.
+E.g. when this is set to 1, the search view will only
+show headlines of level 1. When set to 0, the default
+value, don't limit agenda view by outline level."
+ :group 'org-agenda-search-view
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'integer)
+
+(defgroup org-agenda-time-grid nil
+ "Options concerning the time grid in the Org Agenda."
+ :tag "Org Agenda Time Grid"
+ :group 'org-agenda)
+
+(defcustom org-agenda-search-headline-for-time t
+ "Non-nil means search headline for a time-of-day.
+If the headline contains a time-of-day in one format or another, it will
+be used to sort the entry into the time sequence of items for a day.
+Some people have time stamps in the headline that refer to the creation
+time or so, and then this produces an unwanted side effect. If this is
+the case for your, use this variable to turn off searching the headline
+for a time."
+ :group 'org-agenda-time-grid
+ :type 'boolean)
+
+(defcustom org-agenda-use-time-grid t
+ "Non-nil means show a time grid in the agenda schedule.
+A time grid is a set of lines for specific times (like every two hours between
+8:00 and 20:00). The items scheduled for a day at specific times are
+sorted in between these lines.
+For details about when the grid will be shown, and what it will look like, see
+the variable `org-agenda-time-grid'."
+ :group 'org-agenda-time-grid
+ :type 'boolean)
+
+(defcustom org-agenda-time-grid
+ '((daily today require-timed)
+ (800 1000 1200 1400 1600 1800 2000)
+ "......"
+ "----------------")
+
+ "The settings for time grid for agenda display.
+This is a list of four items. The first item is again a list. It contains
+symbols specifying conditions when the grid should be displayed:
+
+ daily if the agenda shows a single day
+ weekly if the agenda shows an entire week
+ today show grid on current date, independent of daily/weekly display
+ require-timed show grid only if at least one item has a time specification
+ remove-match skip grid times already present in an entry
+
+The second item is a list of integers, indicating the times that
+should have a grid line.
+
+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."
+ :group 'org-agenda-time-grid
+ :type
+ '(list
+ (set :greedy t :tag "Grid Display Options"
+ (const :tag "Show grid in single day agenda display" daily)
+ (const :tag "Show grid in weekly agenda display" weekly)
+ (const :tag "Always show grid for today" today)
+ (const :tag "Show grid only if any timed entries are present"
+ require-timed)
+ (const :tag "Skip grid times already present in an entry"
+ remove-match))
+ (repeat :tag "Grid Times" (integer :tag "Time"))
+ (string :tag "Grid String (after agenda times)")
+ (string :tag "Grid String (aligns with agenda items)")))
+
+(defcustom org-agenda-show-current-time-in-grid t
+ "Non-nil means show the current time in the time grid."
+ :group 'org-agenda-time-grid
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-agenda-current-time-string
+ "now - - - - - - - - - - - - - - - - - - - - - - - - -"
+ "The string for the current time marker in the agenda."
+ :group 'org-agenda-time-grid
+ :version "24.1"
+ :type 'string)
+
+(defgroup org-agenda-sorting nil
+ "Options concerning sorting in the Org Agenda."
+ :tag "Org Agenda Sorting"
+ :group 'org-agenda)
+
+(defcustom org-agenda-sorting-strategy
+ '((agenda habit-down time-up priority-down category-keep)
+ (todo priority-down category-keep)
+ (tags priority-down category-keep)
+ (search category-keep))
+ "Sorting structure for the agenda items of a single day.
+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.
+category-keep Keep the default order of categories, corresponding to the
+ sequence in `org-agenda-files'.
+category-up Sort alphabetically by category, A-Z.
+category-down Sort alphabetically by category, Z-A.
+tag-up Sort alphabetically by last tag, A-Z.
+tag-down Sort alphabetically by last tag, Z-A.
+priority-up Sort numerically by priority, high priority last.
+priority-down Sort numerically by priority, high priority first.
+todo-state-up Sort by todo state, tasks that are done last.
+todo-state-down Sort by todo state, tasks that are done first.
+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.
+
+The different possibilities will be tried in sequence, and testing stops
+if one comparison returns a \"not-equal\". For example, the default
+ '(time-up category-keep priority-down)
+means: Pull out all entries having a specified time of day and sort them,
+in order to make a time schedule for the current day the first thing in the
+agenda listing for the day. Of the entries without a time indication, keep
+the grouped in categories, don't sort the categories, but keep them in
+the sequence given in `org-agenda-files'. Within each category sort by
+priority.
+
+Leaving out `category-keep' would mean that items will be sorted across
+categories by priority.
+
+Instead of a single list, this can also be a set of list for specific
+contents, with a context symbol in the car of the list, any of
+`agenda', `todo', `tags', `search' for the corresponding agenda views.
+
+Custom commands can bind this variable in the options section."
+ :group 'org-agenda-sorting
+ :type `(choice
+ (repeat :tag "General" ,org-sorting-choice)
+ (list :tag "Individually"
+ (cons (const :tag "Strategy for Weekly/Daily agenda" agenda)
+ (repeat ,org-sorting-choice))
+ (cons (const :tag "Strategy for TODO lists" todo)
+ (repeat ,org-sorting-choice))
+ (cons (const :tag "Strategy for Tags matches" tags)
+ (repeat ,org-sorting-choice))
+ (cons (const :tag "Strategy for search matches" search)
+ (repeat ,org-sorting-choice)))))
+
+(defcustom org-agenda-cmp-user-defined nil
+ "A function to define the comparison `user-defined'.
+This function must receive two arguments, agenda entry a and b.
+If a>b, return +1. If a<b, return -1. If they are equal as seen by
+the user comparison, return nil.
+When this is defined, you can make `user-defined-up' and `user-defined-down'
+part of an agenda sorting strategy."
+ :group 'org-agenda-sorting
+ :type 'symbol)
+
+(defcustom org-agenda-sort-notime-is-late t
+ "Non-nil means items without time are considered late.
+This is only relevant for sorting. When t, items which have no explicit
+time like 15:30 will be considered as 99:01, i.e. later than any items which
+do have a time. When nil, the default time is before 0:00. You can use this
+option to decide if the schedule for today should come before or after timeless
+agenda entries."
+ :group 'org-agenda-sorting
+ :type 'boolean)
+
+(defcustom org-agenda-sort-noeffort-is-high t
+ "Non-nil means items without effort estimate are sorted as high effort.
+This also applies when filtering an agenda view with respect to the
+< or > effort operator. Then, tasks with no effort defined will be treated
+as tasks with high effort.
+When nil, such items are sorted as 0 minutes effort."
+ :group 'org-agenda-sorting
+ :type 'boolean)
+
+(defgroup org-agenda-line-format nil
+ "Options concerning the entry prefix in the Org agenda display."
+ :tag "Org Agenda Line Format"
+ :group 'org-agenda)
+
+(defcustom org-agenda-prefix-format
+ '((agenda . " %i %-12:c%?-12t% s")
+ (todo . " %i %-12:c")
+ (tags . " %i %-12:c")
+ (search . " %i %-12:c"))
+ "Format specifications for the prefix of items in the agenda views.
+
+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:
+
+ %c the category of the item, \"Diary\" for entries from the diary,
+ or as given by the CATEGORY keyword or derived from the file name
+ %e the effort required by the item
+ %l the level of the item (insert X space(s) if item is of level X)
+ %i the icon category of the item, see `org-agenda-category-icon-alist'
+ %T the last tag of the item (ignore inherited tags, which come first)
+ %t the HH:MM time-of-day specification if one applies to the entry
+ %s Scheduling/Deadline information, a short string
+ %b show breadcrumbs, i.e., the names of the higher levels
+ %(expression) Eval EXPRESSION and replace the control string
+ by the result
+
+All specifiers work basically like the standard `%s' of printf, but may
+contain two additional characters: a question mark just after the `%'
+and a whitespace/punctuation character just before the final letter.
+
+If the first character after `%' is a question mark, the entire field
+will only be included if the corresponding value applies to the current
+entry. This is useful for fields which should have fixed width when
+present, but zero width when absent. For example, \"%?-12t\" will
+result in a 12 character time field if a time of the day is specified,
+but will completely disappear in entries which do not contain a time.
+
+If there is punctuation or whitespace character just before the
+final format letter, this character will be appended to the field
+value if the value is not empty. For example, the format
+\"%-12:c\" leads to \"Diary: \" if the category is \"Diary\". If
+the category is empty, no additional colon is inserted.
+
+The default value for the agenda sublist is \" %-12:c%?-12t% s\",
+which means:
+
+- Indent the line with two space characters
+- Give the category a 12 chars wide field, padded with whitespace on
+ the right (because of `-'). Append a colon if there is a category
+ (because of `:').
+- If there is a time-of-day, put it into a 12 chars wide field. If no
+ time, don't put in an empty field, just skip it (because of '?').
+- Finally, put the scheduling information.
+
+See also the variables `org-agenda-remove-times-when-in-prefix' and
+`org-agenda-remove-tags'.
+
+Custom commands can set this variable in the options section."
+ :type '(choice
+ (string :tag "General format")
+ (list :greedy t :tag "View dependent"
+ (cons (const agenda) (string :tag "Format"))
+ (cons (const todo) (string :tag "Format"))
+ (cons (const tags) (string :tag "Format"))
+ (cons (const search) (string :tag "Format"))))
+ :group 'org-agenda-line-format
+ :version "26.1"
+ :package-version '(Org . "9.1"))
+
+(defcustom org-agenda-breadcrumbs-separator "->"
+ "The separator of breadcrumbs in agenda lines."
+ :group 'org-agenda-line-format
+ :package-version '(Org . "9.3")
+ :type 'string
+ :safe #'stringp)
+
+(defvar org-prefix-format-compiled nil
+ "The compiled prefix format and associated variables.
+This is a list where first element is a list of variable bindings, and second
+element is the compiled format expression. See the variable
+`org-agenda-prefix-format'.")
+
+(defcustom org-agenda-todo-keyword-format "%-1s"
+ "Format for the TODO keyword in agenda lines.
+Set this to something like \"%-12s\" if you want all TODO keywords
+to occupy a fixed space in the agenda display."
+ :group 'org-agenda-line-format
+ :type 'string)
+
+(defcustom org-agenda-diary-sexp-prefix nil
+ "A regexp that matches part of a diary sexp entry
+which should be treated as scheduling/deadline information in
+`org-agenda'.
+
+For example, you can use this to extract the `diary-remind-message' from
+`diary-remind' entries."
+ :group 'org-agenda-line-format
+ :type '(choice (const :tag "None" nil) (regexp :tag "Regexp")))
+
+(defcustom org-agenda-timerange-leaders '("" "(%d/%d): ")
+ "Text preceding timerange entries in the agenda view.
+This is a list with two strings. The first applies when the range
+is entirely on one day. The second applies if the range spans several days.
+The strings may have two \"%d\" format specifiers which will be filled
+with the sequence number of the days, and the total number of days in the
+range, respectively."
+ :group 'org-agenda-line-format
+ :type '(list
+ (string :tag "Deadline today ")
+ (choice :tag "Deadline relative"
+ (string :tag "Format string")
+ (function))))
+
+(defcustom org-agenda-scheduled-leaders '("Scheduled: " "Sched.%2dx: ")
+ "Text preceding scheduled items in the agenda view.
+This is a list with two strings. The first applies when the item is
+scheduled on the current day. The second applies when it has been scheduled
+previously, it may contain a %d indicating that this is the nth time that
+this item is scheduled, due to automatic rescheduling of unfinished items
+for the following day. So this number is one larger than the number of days
+that passed since this item was scheduled first."
+ :group 'org-agenda-line-format
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(list
+ (string :tag "Scheduled today ")
+ (string :tag "Scheduled previously")))
+
+(defcustom org-agenda-inactive-leader "["
+ "Text preceding item pulled into the agenda by inactive time stamps.
+These entries are added to the agenda when pressing \"[\"."
+ :group 'org-agenda-line-format
+ :version "24.1"
+ :type 'string)
+
+(defcustom org-agenda-deadline-leaders '("Deadline: " "In %3d d.: " "%2d d. ago: ")
+ "Text preceding deadline items in the agenda view.
+This is a list with three strings. The first applies when the item has its
+deadline on the current day. The second applies when the deadline is in the
+future, the third one when it is in the past. The strings may contain %d
+to capture the number of days."
+ :group 'org-agenda-line-format
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(list
+ (string :tag "Deadline today ")
+ (string :tag "Deadline in the future ")
+ (string :tag "Deadline in the past ")))
+
+(defcustom org-agenda-remove-times-when-in-prefix t
+ "Non-nil means remove duplicate time specifications in agenda items.
+When the format `org-agenda-prefix-format' contains a `%t' specifier, a
+time-of-day specification in a headline or diary entry is extracted and
+placed into the prefix. If this option is non-nil, the original specification
+\(a timestamp or -range, or just a plain time(range) specification like
+11:30-4pm) will be removed for agenda display. This makes the agenda less
+cluttered.
+The option can be t or nil. It may also be the symbol `beg', indicating
+that the time should only be removed when it is located at the beginning of
+the headline/diary entry."
+ :group 'org-agenda-line-format
+ :type '(choice
+ (const :tag "Always" t)
+ (const :tag "Never" nil)
+ (const :tag "When at beginning of entry" beg)))
+
+(defcustom org-agenda-remove-timeranges-from-blocks nil
+ "Non-nil means remove time ranges specifications in agenda
+items that span on several days."
+ :group 'org-agenda-line-format
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-agenda-default-appointment-duration nil
+ "Default duration for appointments that only have a starting time.
+When nil, no duration is specified in such cases.
+When non-nil, this must be the number of minutes, e.g. 60 for one hour."
+ :group 'org-agenda-line-format
+ :type '(choice
+ (integer :tag "Minutes")
+ (const :tag "No default duration")))
+
+(defcustom org-agenda-show-inherited-tags t
+ "Non-nil means show inherited tags in each agenda line.
+
+When this option is set to `always', it takes precedence over
+`org-agenda-use-tag-inheritance' and inherited tags are shown
+in every agenda.
+
+When this option is set to t (the default), inherited tags are
+shown when they are available, i.e. when the value of
+`org-agenda-use-tag-inheritance' enables tag inheritance for the
+given agenda type.
+
+This can be set to a list of agenda types in which the agenda
+must display the inherited tags. Available types are `todo',
+`agenda' and `search'.
+
+When set to nil, never show inherited tags in agenda lines."
+ :group 'org-agenda-line-format
+ :group 'org-agenda
+ :version "24.3"
+ :type '(choice
+ (const :tag "Show inherited tags when available" t)
+ (const :tag "Always show inherited tags" always)
+ (repeat :tag "Show inherited tags only in selected agenda types"
+ (symbol :tag "Agenda type"))))
+
+(defcustom org-agenda-use-tag-inheritance '(todo search agenda)
+ "List of agenda view types where to use tag inheritance.
+
+In tags/tags-todo/tags-tree agenda views, tag inheritance is
+controlled by `org-use-tag-inheritance'. In other agenda types,
+`org-use-tag-inheritance' is not used for the selection of the
+agenda entries. Still, you may want the agenda to be aware of
+the inherited tags anyway, e.g. for later tag filtering.
+
+Allowed value are `todo', `search' and `agenda'.
+
+This variable has no effect if `org-agenda-show-inherited-tags'
+is set to `always'. In that case, the agenda is aware of those
+tags.
+
+The default value sets tags in every agenda type. Setting this
+option to nil will speed up non-tags agenda view a lot."
+ :group 'org-agenda
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :type '(choice
+ (const :tag "Use tag inheritance in all agenda types" t)
+ (repeat :tag "Use tag inheritance in selected agenda types"
+ (symbol :tag "Agenda type"))))
+
+(defcustom org-agenda-hide-tags-regexp nil
+ "Regular expression used to filter away specific tags in agenda views.
+This means that these tags will be present, but not be shown in the agenda
+line. Secondary filtering will still work on the hidden tags.
+Nil means don't hide any tags."
+ :group 'org-agenda-line-format
+ :type '(choice
+ (const :tag "Hide none" nil)
+ (regexp :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
+`org-agenda-prefix-format' contains a `%T' specifier."
+ :group 'org-agenda-line-format
+ :type '(choice
+ (const :tag "Always" t)
+ (const :tag "Never" nil)
+ (const :tag "When prefix format contains %T" prefix)))
+
+(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.
+If set to `auto', tags will be automatically aligned to the right
+edge of the window.
+
+If set to a positive number, tags will be left-aligned to that
+column. If set to a negative number, tags will be right-aligned
+to that column. For example, -80 works well for a normal 80
+character screen."
+ :group 'org-agenda-line-format
+ :type '(choice
+ (const :tag "Automatically align to right edge of window" auto)
+ (integer :tag "Specific column" -80))
+ :package-version '(Org . "9.1")
+ :version "26.1")
+
+(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.
+However, settings in `org-priority-faces' will overrule these faces.
+When this variable is the symbol `cookies', only fontify the
+cookies, not the entire task.
+This may also be an association list of priority faces, whose
+keys are the character values of `org-priority-highest',
+`org-priority-default', and `org-priority-lowest' (the default values
+are ?A, ?B, and ?C, respectively). The face may be a named face, a
+color as a string, or a list like `(:background \"Red\")'.
+If it is a color, the variable `org-faces-easy-properties'
+determines if it is a foreground or a background color."
+ :group 'org-agenda-line-format
+ :type '(choice
+ (const :tag "Never" nil)
+ (const :tag "Defaults" t)
+ (const :tag "Cookies only" cookies)
+ (repeat :tag "Specify"
+ (list (character :tag "Priority" :value ?A)
+ (choice :tag "Face "
+ (string :tag "Color")
+ (sexp :tag "Face"))))))
+
+(defcustom org-agenda-day-face-function nil
+ "Function called to determine what face should be used to display a day.
+The only argument passed to that function is the day. It should
+returns a face, or nil if does not want to specify a face and let
+the normal rules apply."
+ :group 'org-agenda-line-format
+ :version "24.1"
+ :type '(choice (const nil) (function)))
+
+(defcustom org-agenda-category-icon-alist nil
+ "Alist of category icon to be displayed in agenda views.
+
+Each entry should have the following format:
+
+ (CATEGORY-REGEXP FILE-OR-DATA TYPE DATA-P PROPS)
+
+Where CATEGORY-REGEXP is a regexp matching the categories where
+the icon should be displayed.
+FILE-OR-DATA either a file path or a string containing image data.
+
+The other fields can be omitted safely if not needed:
+TYPE indicates the image type.
+DATA-P is a boolean indicating whether the FILE-OR-DATA string is
+image data.
+PROPS are additional image attributes to assign to the image,
+like, e.g. `:ascent center'.
+
+ (\"Org\" \"/path/to/icon.png\" nil nil :ascent center)
+
+If you want to set the display properties yourself, just put a
+list as second element:
+
+ (CATEGORY-REGEXP (MY PROPERTY LIST))
+
+For example, to display a 16px horizontal space for Emacs
+category, you can use:
+
+ (\"Emacs\" \\='(space . (:width (16))))"
+ :group 'org-agenda-line-format
+ :version "24.1"
+ :type '(alist :key-type (regexp :tag "Regexp matching category")
+ :value-type (choice (list :tag "Icon"
+ (string :tag "File or data")
+ (symbol :tag "Type")
+ (boolean :tag "Data?")
+ (repeat :tag "Extra image properties" :inline t sexp))
+ (list :tag "Display properties" sexp))))
+
+(defgroup org-agenda-column-view nil
+ "Options concerning column view in the agenda."
+ :tag "Org Agenda Column View"
+ :group 'org-agenda)
+
+(defcustom org-agenda-view-columns-initially nil
+ "When non-nil, switch to columns view right after creating the agenda."
+ :group 'org-agenda-column-view
+ :type 'boolean
+ :version "26.1"
+ :package-version '(Org . "9.0")
+ :safe #'booleanp)
+
+(defcustom org-agenda-columns-show-summaries t
+ "Non-nil means show summaries for columns displayed in the agenda view."
+ :group 'org-agenda-column-view
+ :type 'boolean)
+
+(defcustom org-agenda-columns-compute-summary-properties t
+ "Non-nil means recompute all summary properties before column view.
+When column view in the agenda is listing properties that have a summary
+operator, it can go to all relevant buffers and recompute the summaries
+there. This can mean overhead for the agenda column view, but is necessary
+to have thing up to date.
+As a special case, a CLOCKSUM property also makes sure that the clock
+computations are current."
+ :group 'org-agenda-column-view
+ :type 'boolean)
+
+(defcustom org-agenda-columns-add-appointments-to-effort-sum nil
+ "Non-nil means the duration of an appointment will add to day effort.
+The property to which appointment durations will be added is the one given
+in the option `org-effort-property'. If an appointment does not have
+an end time, `org-agenda-default-appointment-duration' will be used. If that
+is not set, an appointment without end time will not contribute to the time
+estimate."
+ :group 'org-agenda-column-view
+ :type 'boolean)
+
+(defcustom org-agenda-auto-exclude-function nil
+ "A function called with a tag to decide if it is filtered on \
+\\<org-agenda-mode-map>`\\[org-agenda-filter-by-tag] RET'.
+The sole argument to the function, which is called once for each
+possible tag, is a string giving the name of the tag. The
+function should return either nil if the tag should be included
+as normal, \"-<TAG>\" to exclude the tag, or \"+<TAG>\" to exclude
+lines not carrying this tag.
+Note that for the purpose of tag filtering, only the lower-case version of
+all tags will be considered, so that this function will only ever see
+the lower-case version of all tags."
+ :group 'org-agenda
+ :type '(choice (const nil) (function)))
+
+(defcustom org-agenda-bulk-custom-functions nil
+ "Alist of characters and custom functions for bulk actions.
+For example, this value makes those two functions available:
+
+ \\='((?R set-category)
+ (?C bulk-cut))
+
+With selected entries in an agenda buffer, `B R' will call
+the custom function `set-category' on the selected entries.
+Note that functions in this alist don't need to be quoted.
+
+You can also specify a function which collects arguments to be
+used for each call to your bulk custom function. The argument
+collecting function will be run once and should return a list of
+arguments to pass to the bulk function. For example:
+
+ \\='((?R set-category get-category))
+
+Now, `B R' will call the custom `get-category' which would prompt
+the user once for a category. That category is then passed as an
+argument to `set-category' for each entry it's called against."
+ :type
+ '(alist :key-type character
+ :value-type
+ (group (function :tag "Bulk Custom Function")
+ (choice (function :tag "Bulk Custom Argument Function")
+ (const :tag "No Bulk Custom Argument Function" nil))))
+ :package-version '(Org . "9.5")
+ :group 'org-agenda)
+
+(defmacro org-agenda-with-point-at-orig-entry (string &rest body)
+ "Execute BODY with point at location given by `org-hd-marker' property.
+If STRING is non-nil, the text property will be fetched from position 0
+in that string. If STRING is nil, it will be fetched from the beginning
+of the current line."
+ (declare (debug t))
+ (org-with-gensyms (marker)
+ `(let ((,marker (get-text-property (if ,string 0 (point-at-bol))
+ 'org-hd-marker ,string)))
+ (with-current-buffer (marker-buffer ,marker)
+ (save-excursion
+ (goto-char ,marker)
+ ,@body)))))
+
+(defun org-add-agenda-custom-command (entry)
+ "Replace or add a command in `org-agenda-custom-commands'.
+This is mostly for hacking and trying a new command - once the command
+works you probably want to add it to `org-agenda-custom-commands' for good."
+ (let ((ass (assoc (car entry) org-agenda-custom-commands)))
+ (if ass
+ (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. If a function, call it and insert the
+string that it returns."
+ (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"))
+ ((functionp org-agenda-overriding-header)
+ (insert (funcall org-agenda-overriding-header)))
+ (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'.")
+
+(org-remap org-agenda-mode-map 'move-end-of-line 'org-agenda-end-of-line)
+
+(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
+ "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
+ "Hook run after `org-agenda-mode' is turned on.
+The buffer is still writable when this hook is called.")
+(defvar org-agenda-type nil)
+(defvar org-agenda-force-single-file nil)
+(defvar org-agenda-bulk-marked-entries nil
+ "List of markers that refer to marked entries in the agenda.")
+(defvar org-agenda-current-date nil
+ "Active date when building the agenda.")
+
+;;; Multiple agenda buffers support
+
+(defcustom org-agenda-sticky nil
+ "Non-nil means agenda q key will bury agenda buffers.
+Agenda commands will then show existing buffer instead of generating new ones.
+When nil, `q' will kill the single agenda buffer."
+ :group 'org-agenda
+ :version "24.3"
+ :type 'boolean)
+
+
+;;;###autoload
+(defun org-toggle-sticky-agenda (&optional arg)
+ "Toggle `org-agenda-sticky'."
+ (interactive "P")
+ (let ((new-value (if arg
+ (> (prefix-numeric-value arg) 0)
+ (not org-agenda-sticky))))
+ (if (equal new-value org-agenda-sticky)
+ (and (called-interactively-p 'interactive)
+ (message "Sticky agenda was already %s"
+ (if org-agenda-sticky "enabled" "disabled")))
+ (setq org-agenda-sticky new-value)
+ (org-agenda-kill-all-agenda-buffers)
+ (and (called-interactively-p 'interactive)
+ (message "Sticky agenda %s"
+ (if org-agenda-sticky "enabled" "disabled"))))))
+
+(defvar org-agenda-buffer nil
+ "Agenda buffer currently being generated.")
+
+(defvar org-agenda-last-prefix-arg nil)
+(defvar org-agenda-this-buffer-name nil)
+(defvar org-agenda-doing-sticky-redo nil)
+(defvar org-agenda-this-buffer-is-sticky nil)
+(defvar org-agenda-last-indirect-buffer nil
+ "Last buffer loaded by `org-agenda-tree-to-indirect-buffer'.")
+
+(defconst org-agenda-local-vars
+ '(org-agenda-this-buffer-name
+ org-agenda-undo-list
+ org-agenda-pending-undo-list
+ org-agenda-follow-mode
+ org-agenda-entry-text-mode
+ org-agenda-clockreport-mode
+ org-agenda-show-log
+ org-agenda-redo-command
+ org-agenda-query-string
+ org-agenda-type
+ org-agenda-bulk-marked-entries
+ org-agenda-undo-has-started-in
+ org-agenda-info
+ org-agenda-pre-window-conf
+ org-agenda-columns-active
+ org-agenda-tag-filter
+ org-agenda-category-filter
+ org-agenda-top-headline-filter
+ org-agenda-regexp-filter
+ org-agenda-effort-filter
+ org-agenda-markers
+ org-agenda-last-search-view-search-was-boolean
+ org-agenda-last-indirect-buffer
+ org-agenda-filtered-by-category
+ org-agenda-filter-form
+ org-agenda-cycle-counter
+ org-agenda-last-prefix-arg)
+ "Variables that must be local in agenda buffers to allow multiple buffers.")
+
+(defun org-agenda-mode ()
+ "Mode for time-sorted view on action items in Org files.
+
+The following commands are available:
+
+\\{org-agenda-mode-map}"
+ (interactive)
+ (ignore-errors (require 'face-remap))
+ (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)
+ (setq major-mode 'org-agenda-mode)
+ ;; Keep global-font-lock-mode from turning on font-lock-mode
+ (setq-local font-lock-global-modes (list 'not major-mode))
+ (setq mode-name "Org-Agenda")
+ (setq indent-tabs-mode nil)
+ (use-local-map org-agenda-mode-map)
+ (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
+ (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
+ 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
+ '("Agenda") "Agenda Files"
+ (append
+ (list
+ (vector
+ (if (get 'org-agenda-files 'org-restrict)
+ "Restricted to single file"
+ "Edit File List")
+ '(org-edit-agenda-file-list)
+ (not (get 'org-agenda-files 'org-restrict)))
+ "--")
+ (mapcar #'org-file-menu-entry (org-agenda-files))))
+ (org-agenda-set-mode-name)
+ (run-mode-hooks 'org-agenda-mode-hook))
+
+(substitute-key-definition #'undo #'org-agenda-undo
+ org-agenda-mode-map global-map)
+(org-defkey org-agenda-mode-map "\C-i" #'org-agenda-goto)
+(org-defkey org-agenda-mode-map [(tab)] #'org-agenda-goto)
+(org-defkey org-agenda-mode-map "\C-m" #'org-agenda-switch-to)
+(org-defkey org-agenda-mode-map "\C-k" #'org-agenda-kill)
+(org-defkey org-agenda-mode-map "\C-c\C-w" #'org-agenda-refile)
+(org-defkey org-agenda-mode-map [(meta down)] #'org-agenda-drag-line-forward)
+(org-defkey org-agenda-mode-map [(meta up)] #'org-agenda-drag-line-backward)
+(org-defkey org-agenda-mode-map "m" #'org-agenda-bulk-mark)
+(org-defkey org-agenda-mode-map "\M-m" #'org-agenda-bulk-toggle)
+(org-defkey org-agenda-mode-map "*" #'org-agenda-bulk-mark-all)
+(org-defkey org-agenda-mode-map "\M-*" #'org-agenda-bulk-toggle-all)
+(org-defkey org-agenda-mode-map "#" #'org-agenda-dim-blocked-tasks)
+(org-defkey org-agenda-mode-map "%" #'org-agenda-bulk-mark-regexp)
+(org-defkey org-agenda-mode-map "u" #'org-agenda-bulk-unmark)
+(org-defkey org-agenda-mode-map "U" #'org-agenda-bulk-unmark-all)
+(org-defkey org-agenda-mode-map "B" #'org-agenda-bulk-action)
+(org-defkey org-agenda-mode-map "k" #'org-agenda-capture)
+(org-defkey org-agenda-mode-map "A" #'org-agenda-append-agenda)
+(org-defkey org-agenda-mode-map "\C-c\C-x!" #'org-reload)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-a" #'org-agenda-archive-default)
+(org-defkey org-agenda-mode-map "\C-c\C-xa" #'org-agenda-toggle-archive-tag)
+(org-defkey org-agenda-mode-map "\C-c\C-xA" #'org-agenda-archive-to-archive-sibling)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-s" #'org-agenda-archive)
+(org-defkey org-agenda-mode-map "\C-c$" #'org-agenda-archive)
+(org-defkey org-agenda-mode-map "$" #'org-agenda-archive)
+(org-defkey org-agenda-mode-map "\C-c\C-o" #'org-agenda-open-link)
+(org-defkey org-agenda-mode-map " " #'org-agenda-show-and-scroll-up)
+(org-defkey org-agenda-mode-map [backspace] #'org-agenda-show-scroll-down)
+(org-defkey org-agenda-mode-map "\d" #'org-agenda-show-scroll-down)
+(org-defkey org-agenda-mode-map [(control shift right)] #'org-agenda-todo-nextset)
+(org-defkey org-agenda-mode-map [(control shift left)] #'org-agenda-todo-previousset)
+(org-defkey org-agenda-mode-map "\C-c\C-xb" #'org-agenda-tree-to-indirect-buffer)
+(org-defkey org-agenda-mode-map "o" #'delete-other-windows)
+(org-defkey org-agenda-mode-map "L" #'org-agenda-recenter)
+(org-defkey org-agenda-mode-map "\C-c\C-t" #'org-agenda-todo)
+(org-defkey org-agenda-mode-map "t" #'org-agenda-todo)
+(org-defkey org-agenda-mode-map "a" #'org-agenda-archive-default-with-confirmation)
+(org-defkey org-agenda-mode-map ":" #'org-agenda-set-tags)
+(org-defkey org-agenda-mode-map "\C-c\C-q" #'org-agenda-set-tags)
+(org-defkey org-agenda-mode-map "." #'org-agenda-goto-today)
+(org-defkey org-agenda-mode-map "j" #'org-agenda-goto-date)
+(org-defkey org-agenda-mode-map "d" #'org-agenda-day-view)
+(org-defkey org-agenda-mode-map "w" #'org-agenda-week-view)
+(org-defkey org-agenda-mode-map "y" #'org-agenda-year-view)
+(org-defkey org-agenda-mode-map "\C-c\C-z" #'org-agenda-add-note)
+(org-defkey org-agenda-mode-map "z" #'org-agenda-add-note)
+(org-defkey org-agenda-mode-map [(shift right)] #'org-agenda-do-date-later)
+(org-defkey org-agenda-mode-map [(shift left)] #'org-agenda-do-date-earlier)
+(org-defkey org-agenda-mode-map [?\C-c ?\C-x (right)] #'org-agenda-do-date-later)
+(org-defkey org-agenda-mode-map [?\C-c ?\C-x (left)] #'org-agenda-do-date-earlier)
+(org-defkey org-agenda-mode-map ">" #'org-agenda-date-prompt)
+(org-defkey org-agenda-mode-map "\C-c\C-s" #'org-agenda-schedule)
+(org-defkey org-agenda-mode-map "\C-c\C-d" #'org-agenda-deadline)
+(let ((l '(1 2 3 4 5 6 7 8 9 0)))
+ (while l (org-defkey org-agenda-mode-map
+ (number-to-string (pop l)) #'digit-argument)))
+(org-defkey org-agenda-mode-map "F" #'org-agenda-follow-mode)
+(org-defkey org-agenda-mode-map "R" #'org-agenda-clockreport-mode)
+(org-defkey org-agenda-mode-map "E" #'org-agenda-entry-text-mode)
+(org-defkey org-agenda-mode-map "l" #'org-agenda-log-mode)
+(org-defkey org-agenda-mode-map "v" #'org-agenda-view-mode-dispatch)
+(org-defkey org-agenda-mode-map "D" #'org-agenda-toggle-diary)
+(org-defkey org-agenda-mode-map "!" #'org-agenda-toggle-deadlines)
+(org-defkey org-agenda-mode-map "G" #'org-agenda-toggle-time-grid)
+(org-defkey org-agenda-mode-map "r" #'org-agenda-redo)
+(org-defkey org-agenda-mode-map "g" #'org-agenda-redo-all)
+(org-defkey org-agenda-mode-map "e" #'org-agenda-set-effort)
+(org-defkey org-agenda-mode-map "\C-c\C-xe" #'org-agenda-set-effort)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-e"
+ #'org-clock-modify-effort-estimate)
+(org-defkey org-agenda-mode-map "\C-c\C-xp" #'org-agenda-set-property)
+(org-defkey org-agenda-mode-map "q" #'org-agenda-quit)
+(org-defkey org-agenda-mode-map "Q" #'org-agenda-Quit)
+(org-defkey org-agenda-mode-map "x" #'org-agenda-exit)
+(org-defkey org-agenda-mode-map "\C-x\C-w" #'org-agenda-write)
+(org-defkey org-agenda-mode-map "\C-x\C-s" #'org-save-all-org-buffers)
+(org-defkey org-agenda-mode-map "s" #'org-save-all-org-buffers)
+(org-defkey org-agenda-mode-map "T" #'org-agenda-show-tags)
+(org-defkey org-agenda-mode-map "n" #'org-agenda-next-line)
+(org-defkey org-agenda-mode-map "p" #'org-agenda-previous-line)
+(org-defkey org-agenda-mode-map "N" #'org-agenda-next-item)
+(org-defkey org-agenda-mode-map "P" #'org-agenda-previous-item)
+(substitute-key-definition #'next-line #'org-agenda-next-line
+ org-agenda-mode-map global-map)
+(substitute-key-definition #'previous-line #'org-agenda-previous-line
+ org-agenda-mode-map global-map)
+(org-defkey org-agenda-mode-map "\C-c\C-a" #'org-attach)
+(org-defkey org-agenda-mode-map "\C-c\C-n" #'org-agenda-next-date-line)
+(org-defkey org-agenda-mode-map "\C-c\C-p" #'org-agenda-previous-date-line)
+(org-defkey org-agenda-mode-map "\C-c," #'org-agenda-priority)
+(org-defkey org-agenda-mode-map "," #'org-agenda-priority)
+(org-defkey org-agenda-mode-map "i" #'org-agenda-diary-entry)
+(org-defkey org-agenda-mode-map "c" #'org-agenda-goto-calendar)
+(org-defkey org-agenda-mode-map "C" #'org-agenda-convert-date)
+(org-defkey org-agenda-mode-map "M" #'org-agenda-phases-of-moon)
+(org-defkey org-agenda-mode-map "S" #'org-agenda-sunrise-sunset)
+(org-defkey org-agenda-mode-map "h" #'org-agenda-holidays)
+(org-defkey org-agenda-mode-map "H" #'org-agenda-holidays)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-i" #'org-agenda-clock-in)
+(org-defkey org-agenda-mode-map "I" #'org-agenda-clock-in)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-o" #'org-agenda-clock-out)
+(org-defkey org-agenda-mode-map "O" #'org-agenda-clock-out)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-x" #'org-agenda-clock-cancel)
+(org-defkey org-agenda-mode-map "X" #'org-agenda-clock-cancel)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-j" #'org-clock-goto)
+(org-defkey org-agenda-mode-map "J" #'org-agenda-clock-goto)
+(org-defkey org-agenda-mode-map "+" #'org-agenda-priority-up)
+(org-defkey org-agenda-mode-map "-" #'org-agenda-priority-down)
+(org-defkey org-agenda-mode-map [(shift up)] #'org-agenda-priority-up)
+(org-defkey org-agenda-mode-map [(shift down)] #'org-agenda-priority-down)
+(org-defkey org-agenda-mode-map [?\C-c ?\C-x (up)] #'org-agenda-priority-up)
+(org-defkey org-agenda-mode-map [?\C-c ?\C-x (down)] #'org-agenda-priority-down)
+(org-defkey org-agenda-mode-map "f" #'org-agenda-later)
+(org-defkey org-agenda-mode-map "b" #'org-agenda-earlier)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-c" #'org-agenda-columns)
+(org-defkey org-agenda-mode-map "\C-c\C-x>" #'org-agenda-remove-restriction-lock)
+(org-defkey org-agenda-mode-map "\C-c\C-x<" #'org-agenda-set-restriction-lock-from-agenda)
+(org-defkey org-agenda-mode-map "[" #'org-agenda-manipulate-query-add)
+(org-defkey org-agenda-mode-map "]" #'org-agenda-manipulate-query-subtract)
+(org-defkey org-agenda-mode-map "{" #'org-agenda-manipulate-query-add-re)
+(org-defkey org-agenda-mode-map "}" #'org-agenda-manipulate-query-subtract-re)
+(org-defkey org-agenda-mode-map "\\" #'org-agenda-filter-by-tag)
+(org-defkey org-agenda-mode-map "_" #'org-agenda-filter-by-effort)
+(org-defkey org-agenda-mode-map "=" #'org-agenda-filter-by-regexp)
+(org-defkey org-agenda-mode-map "/" #'org-agenda-filter)
+(org-defkey org-agenda-mode-map "|" #'org-agenda-filter-remove-all)
+(org-defkey org-agenda-mode-map "~" #'org-agenda-limit-interactively)
+(org-defkey org-agenda-mode-map "<" #'org-agenda-filter-by-category)
+(org-defkey org-agenda-mode-map "^" #'org-agenda-filter-by-top-headline)
+(org-defkey org-agenda-mode-map ";" #'org-timer-set-timer)
+(org-defkey org-agenda-mode-map "\C-c\C-x_" #'org-timer-stop)
+(org-defkey 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)
+(org-defkey org-agenda-mode-map [remap forward-paragraph] #'org-agenda-forward-block)
+(org-defkey org-agenda-mode-map [remap backward-paragraph] #'org-agenda-backward-block)
+(org-defkey org-agenda-mode-map "\C-c\C-c" #'org-agenda-ctrl-c-ctrl-c)
+
+(when org-agenda-mouse-1-follows-link
+ (org-defkey org-agenda-mode-map [follow-link] 'mouse-face))
+
+(easy-menu-define org-agenda-menu org-agenda-mode-map "Agenda menu."
+ '("Agenda"
+ ("Agenda Files")
+ "--"
+ ("Agenda Dates"
+ ["Goto Today" org-agenda-goto-today (org-agenda-check-type nil 'agenda)]
+ ["Next Dates" org-agenda-later (org-agenda-check-type nil 'agenda)]
+ ["Previous Dates" org-agenda-earlier (org-agenda-check-type nil 'agenda)]
+ ["Jump to date" org-agenda-goto-date (org-agenda-check-type nil 'agenda)])
+ "--"
+ ("View"
+ ["Day View" org-agenda-day-view
+ :active (org-agenda-check-type nil 'agenda)
+ :style radio :selected (eq org-agenda-current-span 'day)
+ :keys "v d (or just d)"]
+ ["Week View" org-agenda-week-view
+ :active (org-agenda-check-type nil 'agenda)
+ :style radio :selected (eq org-agenda-current-span 'week)
+ :keys "v w"]
+ ["Fortnight View" org-agenda-fortnight-view
+ :active (org-agenda-check-type nil 'agenda)
+ :style radio :selected (eq org-agenda-current-span 'fortnight)
+ :keys "v t"]
+ ["Month View" org-agenda-month-view
+ :active (org-agenda-check-type nil 'agenda)
+ :style radio :selected (eq org-agenda-current-span 'month)
+ :keys "v m"]
+ ["Year View" org-agenda-year-view
+ :active (org-agenda-check-type nil 'agenda)
+ :style radio :selected (eq org-agenda-current-span 'year)
+ :keys "v y"]
+ "--"
+ ["Include Diary" org-agenda-toggle-diary
+ :style toggle :selected org-agenda-include-diary
+ :active (org-agenda-check-type nil 'agenda)]
+ ["Include Deadlines" org-agenda-toggle-deadlines
+ :style toggle :selected org-agenda-include-deadlines
+ :active (org-agenda-check-type nil 'agenda)]
+ ["Use Time Grid" org-agenda-toggle-time-grid
+ :style toggle :selected org-agenda-use-time-grid
+ :active (org-agenda-check-type nil 'agenda)]
+ "--"
+ ["Show clock report" org-agenda-clockreport-mode
+ :style toggle :selected org-agenda-clockreport-mode
+ :active (org-agenda-check-type nil 'agenda)]
+ ["Show some entry text" org-agenda-entry-text-mode
+ :style toggle :selected org-agenda-entry-text-mode
+ :active t]
+ "--"
+ ["Show Logbook entries" org-agenda-log-mode
+ :style toggle :selected org-agenda-show-log
+ :active (org-agenda-check-type nil 'agenda)
+ :keys "v l (or just l)"]
+ ["Include archived trees" org-agenda-archives-mode
+ :style toggle :selected org-agenda-archives-mode :active t
+ :keys "v a"]
+ ["Include archive files" (org-agenda-archives-mode t)
+ :style toggle :selected (eq org-agenda-archives-mode t) :active t
+ :keys "v A"]
+ "--"
+ ["Remove Restriction" org-agenda-remove-restriction-lock org-agenda-restrict])
+ ("Filter current view"
+ ["with generic interface" org-agenda-filter t]
+ "--"
+ ["by category at cursor" org-agenda-filter-by-category t]
+ ["by tag" org-agenda-filter-by-tag t]
+ ["by effort" org-agenda-filter-by-effort t]
+ ["by regexp" org-agenda-filter-by-regexp t]
+ ["by top-level headline" org-agenda-filter-by-top-headline t]
+ "--"
+ ["Remove all filtering" org-agenda-filter-remove-all t]
+ "--"
+ ["limit" org-agenda-limit-interactively t])
+ ["Rebuild buffer" org-agenda-redo t]
+ ["Write view to file" org-agenda-write t]
+ ["Save all Org buffers" org-save-all-org-buffers t]
+ "--"
+ ["Show original entry" org-agenda-show t]
+ ["Go To (other window)" org-agenda-goto t]
+ ["Go To (this window)" org-agenda-switch-to t]
+ ["Capture with cursor date" org-agenda-capture t]
+ ["Follow Mode" org-agenda-follow-mode
+ :style toggle :selected org-agenda-follow-mode :active t]
+ ;; ["Tree to indirect frame" org-agenda-tree-to-indirect-buffer t]
+ "--"
+ ("TODO"
+ ["Cycle TODO" org-agenda-todo t]
+ ["Next TODO set" org-agenda-todo-nextset t]
+ ["Previous TODO set" org-agenda-todo-previousset t]
+ ["Add note" org-agenda-add-note t])
+ ("Archive/Refile/Delete"
+ ["Archive default" org-agenda-archive-default t]
+ ["Archive default" org-agenda-archive-default-with-confirmation t]
+ ["Toggle ARCHIVE tag" org-agenda-toggle-archive-tag t]
+ ["Move to archive sibling" org-agenda-archive-to-archive-sibling t]
+ ["Archive subtree" org-agenda-archive t]
+ "--"
+ ["Refile" org-agenda-refile t]
+ "--"
+ ["Delete subtree" org-agenda-kill t])
+ ("Bulk action"
+ ["Mark entry" org-agenda-bulk-mark t]
+ ["Mark all" org-agenda-bulk-mark-all t]
+ ["Unmark entry" org-agenda-bulk-unmark t]
+ ["Unmark all" org-agenda-bulk-unmark-all :active t :keys "U"]
+ ["Toggle mark" org-agenda-bulk-toggle t]
+ ["Toggle all" org-agenda-bulk-toggle-all t]
+ ["Mark regexp" org-agenda-bulk-mark-regexp t])
+ ["Act on all marked" org-agenda-bulk-action t]
+ "--"
+ ("Tags and Properties"
+ ["Show all Tags" org-agenda-show-tags t]
+ ["Set Tags current line" org-agenda-set-tags (not (org-region-active-p))]
+ ["Change tag in region" org-agenda-set-tags (org-region-active-p)]
+ "--"
+ ["Column View" org-columns t])
+ ("Deadline/Schedule"
+ ["Schedule" org-agenda-schedule t]
+ ["Set Deadline" org-agenda-deadline t]
+ "--"
+ ["Change Date +1 day" org-agenda-date-later (org-agenda-check-type nil 'agenda)]
+ ["Change Date -1 day" org-agenda-date-earlier (org-agenda-check-type nil 'agenda)]
+ ["Change Time +1 hour" org-agenda-do-date-later :active (org-agenda-check-type nil 'agenda) :keys "C-u S-right"]
+ ["Change Time -1 hour" org-agenda-do-date-earlier :active (org-agenda-check-type nil 'agenda) :keys "C-u S-left"]
+ ["Change Time + min" org-agenda-date-later :active (org-agenda-check-type nil 'agenda) :keys "C-u C-u S-right"]
+ ["Change Time - min" org-agenda-date-earlier :active (org-agenda-check-type nil 'agenda) :keys "C-u C-u S-left"]
+ ["Change Date to ..." org-agenda-date-prompt (org-agenda-check-type nil 'agenda)])
+ ("Clock and Effort"
+ ["Clock in" org-agenda-clock-in t]
+ ["Clock out" org-agenda-clock-out t]
+ ["Clock cancel" org-agenda-clock-cancel t]
+ ["Goto running clock" org-clock-goto t]
+ "--"
+ ["Set Effort" org-agenda-set-effort t]
+ ["Change clocked effort" org-clock-modify-effort-estimate
+ (org-clock-is-active)])
+ ("Priority"
+ ["Set Priority" org-agenda-priority t]
+ ["Increase Priority" org-agenda-priority-up t]
+ ["Decrease Priority" org-agenda-priority-down t]
+ ["Show Priority" org-priority-show t])
+ ("Calendar/Diary"
+ ["New Diary Entry" org-agenda-diary-entry (org-agenda-check-type nil 'agenda)]
+ ["Goto Calendar" org-agenda-goto-calendar (org-agenda-check-type nil 'agenda)]
+ ["Phases of the Moon" org-agenda-phases-of-moon (org-agenda-check-type nil 'agenda)]
+ ["Sunrise/Sunset" org-agenda-sunrise-sunset (org-agenda-check-type nil 'agenda)]
+ ["Holidays" org-agenda-holidays (org-agenda-check-type nil 'agenda)]
+ ["Convert" org-agenda-convert-date (org-agenda-check-type nil 'agenda)]
+ "--"
+ ["Create iCalendar File" org-icalendar-combine-agenda-files t])
+ "--"
+ ["Undo Remote Editing" org-agenda-undo org-agenda-undo-list]
+ "--"
+ ("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 "\\[org-agenda] ?"]
+ ["Show note / unflag" org-agenda-show-the-flagging-note t]
+ "--"
+ ["Setup" (progn (require 'org-mobile) (customize-group 'org-mobile)) t])
+ "--"
+ ["Quit" org-agenda-quit t]
+ ["Exit and Release Buffers" org-agenda-exit t]
+ ))
+
+;;; Agenda undo
+
+(defvar org-agenda-allow-remote-undo t
+ "Non-nil means allow remote undo from the agenda buffer.")
+(defvar org-agenda-undo-has-started-in nil
+ "Buffers that have already seen `undo-start' in the current undo sequence.")
+
+(defun org-agenda-undo ()
+ "Undo a remote editing step in the agenda.
+This undoes changes both in the agenda buffer and in the remote buffer
+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"))
+ (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)))
+ (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))))
+
+(defun org-verify-change-for-undo (l1 l2)
+ "Verify that a real change occurred between the undo lists L1 and L2."
+ (while (and l1 (listp l1) (null (car l1))) (pop l1))
+ (while (and l2 (listp l2) (null (car l2))) (pop l2))
+ (not (eq l1 l2)))
+
+;;; Agenda dispatch
+
+(defvar org-agenda-restrict-begin (make-marker))
+(defvar org-agenda-restrict-end (make-marker))
+(defvar org-agenda-last-dispatch-buffer nil)
+(defvar org-agenda-overriding-restriction nil)
+
+(defcustom org-agenda-custom-commands-contexts nil
+ "Alist of custom agenda keys and contextual rules.
+
+For example, if you have a custom agenda command \"p\" and you
+want this command to be accessible only from plain text files,
+use this:
+
+ \\='((\"p\" ((in-file . \"\\\\.txt\\\\'\"))))
+
+Here are the available contexts definitions:
+
+ in-file: command displayed only in matching files
+ in-mode: command displayed only in matching modes
+ not-in-file: command not displayed in matching files
+ not-in-mode: command not displayed in matching modes
+ in-buffer: command displayed only in matching buffers
+not-in-buffer: command not displayed in matching buffers
+ [function]: a custom function taking no argument
+
+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.
+
+ \\='((\"p\" \"q\" ((in-file . \"\\\\.txt\\\\'\"))))
+
+Here it means: in .txt files, use \"p\" as the key for the
+agenda command otherwise associated with \"q\". (The command
+originally associated with \"q\" is not displayed to avoid
+duplicates.)"
+ :version "24.3"
+ :group 'org-agenda-custom-commands
+ :type '(repeat (list :tag "Rule"
+ (string :tag " Agenda key")
+ (string :tag "Replace by command")
+ (repeat :tag "Available when"
+ (choice
+ (cons :tag "Condition"
+ (choice
+ (const :tag "In file" in-file)
+ (const :tag "Not in file" not-in-file)
+ (const :tag "In buffer" in-buffer)
+ (const :tag "Not in buffer" not-in-buffer)
+ (const :tag "In mode" in-mode)
+ (const :tag "Not in mode" not-in-mode))
+ (regexp))
+ (function :tag "Custom function"))))))
+
+(defcustom org-agenda-max-entries nil
+ "Maximum number of entries to display in an agenda.
+This can be nil (no limit) or an integer or an alist of agenda
+types with an associated number of entries to display in this
+type."
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :group 'org-agenda-custom-commands
+ :type '(choice (symbol :tag "No limit" nil)
+ (integer :tag "Max number of entries")
+ (repeat
+ (cons (choice :tag "Agenda type"
+ (const agenda)
+ (const todo)
+ (const tags)
+ (const search))
+ (integer :tag "Max number of entries")))))
+
+(defcustom org-agenda-max-todos nil
+ "Maximum number of TODOs to display in an agenda.
+This can be nil (no limit) or an integer or an alist of agenda
+types with an associated number of entries to display in this
+type."
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :group 'org-agenda-custom-commands
+ :type '(choice (symbol :tag "No limit" nil)
+ (integer :tag "Max number of TODOs")
+ (repeat
+ (cons (choice :tag "Agenda type"
+ (const agenda)
+ (const todo)
+ (const tags)
+ (const search))
+ (integer :tag "Max number of TODOs")))))
+
+(defcustom org-agenda-max-tags nil
+ "Maximum number of tagged entries to display in an agenda.
+This can be nil (no limit) or an integer or an alist of agenda
+types with an associated number of entries to display in this
+type."
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :group 'org-agenda-custom-commands
+ :type '(choice (symbol :tag "No limit" nil)
+ (integer :tag "Max number of tagged entries")
+ (repeat
+ (cons (choice :tag "Agenda type"
+ (const agenda)
+ (const todo)
+ (const tags)
+ (const search))
+ (integer :tag "Max number of tagged entries")))))
+
+(defcustom org-agenda-max-effort nil
+ "Maximum cumulated effort duration for the agenda.
+This can be nil (no limit) or a number of minutes (as an integer)
+or an alist of agenda types with an associated number of minutes
+to limit entries to in this type."
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :group 'org-agenda-custom-commands
+ :type '(choice (symbol :tag "No limit" nil)
+ (integer :tag "Max number of minutes")
+ (repeat
+ (cons (choice :tag "Agenda type"
+ (const agenda)
+ (const todo)
+ (const tags)
+ (const search))
+ (integer :tag "Max number of minutes")))))
+
+(defvar org-agenda-keep-restricted-file-list nil)
+(defvar org-keys nil)
+(defvar org-match nil)
+;;;###autoload
+(defun org-agenda (&optional arg keys restriction)
+ "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)."
+ (interactive "P")
+ (catch 'exit
+ (let* ((org-keys keys)
+ (prefix-descriptions nil)
+ (org-agenda-buffer-name org-agenda-buffer-name)
+ (org-agenda-window-setup (if (equal (buffer-name)
+ org-agenda-buffer-name)
+ 'current-window
+ org-agenda-window-setup))
+ (org-agenda-custom-commands-orig org-agenda-custom-commands)
+ (org-agenda-custom-commands
+ ;; normalize different versions
+ (delq nil
+ (mapcar
+ (lambda (x)
+ (cond ((stringp (cdr x))
+ (push x prefix-descriptions)
+ nil)
+ ((stringp (nth 1 x)) x)
+ ((not (nth 1 x)) (cons (car x) (cons "" (cddr x))))
+ (t (cons (car x) (cons "" (cdr x))))))
+ org-agenda-custom-commands)))
+ (org-agenda-custom-commands
+ (org-contextualize-keys
+ org-agenda-custom-commands org-agenda-custom-commands-contexts))
+ ;; (buf (current-buffer))
+ (bfn (buffer-file-name (buffer-base-buffer)))
+ entry type org-match lprops ans) ;; key
+ ;; Turn off restriction unless there is an overriding one,
+ (unless org-agenda-overriding-restriction
+ (unless org-agenda-keep-restricted-file-list
+ ;; There is a request to keep the file list in place
+ (put 'org-agenda-files 'org-restrict nil))
+ (setq org-agenda-restrict nil)
+ (move-marker org-agenda-restrict-begin nil)
+ (move-marker org-agenda-restrict-end nil))
+ ;; Delete old local properties
+ (put 'org-agenda-redo-command 'org-lprops nil)
+ ;; Delete previously set last-arguments
+ (put 'org-agenda-redo-command 'last-args nil)
+ ;; Remember where this call originated
+ (setq org-agenda-last-dispatch-buffer (current-buffer))
+ (unless org-keys
+ (setq ans (org-agenda-get-restriction-and-command prefix-descriptions)
+ org-keys (car ans)
+ restriction (cdr ans)))
+ ;; 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.
+ (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))
+ (cond
+ ((eq restriction 'region)
+ (setq org-agenda-restrict (current-buffer))
+ (move-marker org-agenda-restrict-begin (region-beginning))
+ (move-marker org-agenda-restrict-end (region-end)))
+ ((eq restriction 'subtree)
+ (save-excursion
+ (setq org-agenda-restrict (current-buffer))
+ (org-back-to-heading t)
+ (move-marker org-agenda-restrict-begin (point))
+ (move-marker org-agenda-restrict-end
+ (progn (org-end-of-subtree t)))))
+ ((and (eq restriction 'buffer)
+ (or (< 1 (point-min))
+ (< (point-max) (1+ (buffer-size)))))
+ (setq org-agenda-restrict (current-buffer))
+ (move-marker org-agenda-restrict-begin (point-min))
+ (move-marker org-agenda-restrict-end (point-max)))))
+
+ ;; For example the todo list should not need it (but does...)
+ (cond
+ ((setq entry (assoc org-keys org-agenda-custom-commands))
+ (if (or (symbolp (nth 2 entry)) (functionp (nth 2 entry)))
+ (progn
+ ;; FIXME: Is (nth 3 entry) supposed to have access (via dynvars)
+ ;; to some of the local variables? There's no doc about
+ ;; that for `org-agenda-custom-commands'.
+ (setq type (nth 2 entry) org-match (eval (nth 3 entry) t)
+ lprops (nth 4 entry))
+ (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)
+ (cl-progv
+ (mapcar #'car lprops)
+ (mapcar (lambda (binding) (eval (cadr binding) t)) lprops)
+ (pcase type
+ (`agenda
+ (org-agenda-list current-prefix-arg))
+ (`agenda*
+ (org-agenda-list current-prefix-arg nil nil t))
+ (`alltodo
+ (org-todo-list current-prefix-arg))
+ (`search
+ (org-search-view current-prefix-arg org-match nil))
+ (`stuck
+ (org-agenda-list-stuck-projects current-prefix-arg))
+ (`tags
+ (org-tags-view current-prefix-arg org-match))
+ (`tags-todo
+ (org-tags-view '(4) org-match))
+ (`todo
+ (org-todo-list org-match))
+ (`tags-tree
+ (org-check-for-org-mode)
+ (org-match-sparse-tree current-prefix-arg org-match))
+ (`todo-tree
+ (org-check-for-org-mode)
+ (org-occur (concat "^" org-outline-regexp "[ \t]*"
+ (regexp-quote org-match) "\\>")))
+ (`occur-tree
+ (org-check-for-org-mode)
+ (org-occur org-match))
+ ((pred functionp)
+ (funcall type org-match))
+ ;; FIXME: Will signal an error since it's not `functionp'!
+ ((pred fboundp) (funcall type org-match))
+ (_ (user-error "Invalid custom agenda command type %s" type)))))
+ (org-agenda-run-series (nth 1 entry) (cddr entry))))
+ ((equal org-keys "C")
+ (setq org-agenda-custom-commands org-agenda-custom-commands-orig)
+ (customize-variable 'org-agenda-custom-commands))
+ ((equal org-keys "a") (call-interactively 'org-agenda-list))
+ ((equal org-keys "s") (call-interactively 'org-search-view))
+ ((equal org-keys "S") (org-call-with-arg 'org-search-view (or arg '(4))))
+ ((equal org-keys "t") (call-interactively 'org-todo-list))
+ ((equal org-keys "T") (org-call-with-arg 'org-todo-list (or arg '(4))))
+ ((equal org-keys "m") (call-interactively 'org-tags-view))
+ ((equal org-keys "M") (org-call-with-arg 'org-tags-view (or arg '(4))))
+ ((equal org-keys "e") (call-interactively 'org-store-agenda-views))
+ ((equal org-keys "?") (org-tags-view nil "+FLAGGED")
+ (add-hook
+ 'post-command-hook
+ (lambda ()
+ (unless (current-message)
+ (let* ((m (org-agenda-get-any-marker))
+ (note (and m (org-entry-get m "THEFLAGGINGNOTE"))))
+ (when note
+ (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))
+ ((equal org-keys "!") (customize-variable 'org-stuck-projects))
+ (t (user-error "Invalid agenda key"))))))
+
+(defvar org-agenda-multi)
+
+(defun org-agenda-append-agenda ()
+ "Append another agenda view to the current one.
+This function allows interactive building of block agendas.
+Agenda views are separated by `org-agenda-block-separator'."
+ (interactive)
+ (unless (derived-mode-p 'org-agenda-mode)
+ (user-error "Can only append from within agenda buffer"))
+ (let ((org-agenda-multi t))
+ (org-agenda)
+ (widen)
+ (org-agenda-finalize)
+ (setq buffer-read-only t)
+ (org-agenda-fit-window-to-buffer)))
+
+(defun org-agenda-normalize-custom-commands (cmds)
+ "Normalize custom commands CMDS."
+ (delq nil
+ (mapcar
+ (lambda (x)
+ (cond ((stringp (cdr x)) nil)
+ ((stringp (nth 1 x)) x)
+ ((not (nth 1 x)) (cons (car x) (cons "" (cddr x))))
+ (t (cons (car x) (cons "" (cdr x))))))
+ cmds)))
+
+(defun org-agenda-get-restriction-and-command (prefix-descriptions)
+ "The user interface for selecting an agenda command."
+ (catch 'exit
+ (let* ((bfn (buffer-file-name (buffer-base-buffer)))
+ (restrict-ok (and bfn (derived-mode-p 'org-mode)))
+ (region-p (org-region-active-p))
+ (custom org-agenda-custom-commands)
+ (selstring "")
+ restriction second-time
+ c entry key type match prefixes rmheader header-end custom1 desc
+ line lines left right n n1)
+ (save-window-excursion
+ (delete-other-windows)
+ (org-switch-to-buffer-other-window " *Agenda Commands*")
+ (erase-buffer)
+ (insert (eval-when-compile
+ (let ((header
+ (copy-sequence
+ "Press key for an agenda command:
+-------------------------------- < Buffer, subtree/region restriction
+a Agenda for current week or day > Remove restriction
+t List of all TODO entries e Export agenda views
+m Match a TAGS/PROP/TODO query T Entries with special TODO kwd
+s Search for keywords M Like m, but only TODO entries
+/ Multi-occur S Like s, but only TODO entries
+? Find :FLAGGED: entries C Configure custom agenda commands
+* Toggle sticky agenda views # List stuck projects (!=configure)
+"))
+ (start 0))
+ (while (string-match
+ "\\(^\\| \\|(\\)\\(\\S-\\)\\( \\|=\\)"
+ header start)
+ (setq start (match-end 0))
+ (add-text-properties (match-beginning 2) (match-end 2)
+ '(face bold) header))
+ header)))
+ (setq header-end (point-marker))
+ (while t
+ (setq custom1 custom)
+ (when (eq rmheader t)
+ (org-goto-line 1)
+ (re-search-forward ":" nil t)
+ (delete-region (match-end 0) (point-at-eol))
+ (forward-char 1)
+ (looking-at "-+")
+ (delete-region (match-end 0) (point-at-eol))
+ (move-marker header-end (match-end 0)))
+ (goto-char header-end)
+ (delete-region (point) (point-max))
+
+ ;; Produce all the lines that describe custom commands and prefixes
+ (setq lines nil)
+ (while (setq entry (pop custom1))
+ (setq key (car entry) desc (nth 1 entry)
+ type (nth 2 entry)
+ match (nth 3 entry))
+ (if (> (length key) 1)
+ (cl-pushnew (string-to-char key) prefixes :test #'equal)
+ (setq line
+ (format
+ "%-4s%-14s"
+ (org-add-props (copy-sequence key)
+ '(face bold))
+ (cond
+ ((string-match "\\S-" desc) desc)
+ ((eq type 'agenda) "Agenda for current week or day")
+ ((eq type 'agenda*) "Appointments for current week or day")
+ ((eq type 'alltodo) "List of all TODO entries")
+ ((eq type 'search) "Word search")
+ ((eq type 'stuck) "List of stuck projects")
+ ((eq type 'todo) "TODO keyword")
+ ((eq type 'tags) "Tags query")
+ ((eq type 'tags-todo) "Tags (TODO)")
+ ((eq type 'tags-tree) "Tags tree")
+ ((eq type 'todo-tree) "TODO kwd tree")
+ ((eq type 'occur-tree) "Occur tree")
+ ((functionp type) (if (symbolp type)
+ (symbol-name type)
+ "Lambda expression"))
+ (t "???"))))
+ (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
+ (mapc (lambda (x)
+ (push
+ (format "%s %s"
+ (org-add-props (char-to-string x)
+ nil 'face 'bold)
+ (or (cdr (assoc (concat selstring
+ (char-to-string x))
+ prefix-descriptions))
+ "Prefix key"))
+ lines))
+ prefixes))
+
+ ;; Check if we should display in two columns
+ (if org-agenda-menu-two-columns
+ (progn
+ (setq n (length lines)
+ n1 (+ (/ n 2) (mod n 2))
+ right (nthcdr n1 lines)
+ left (copy-sequence lines))
+ (setcdr (nthcdr (1- n1) left) nil))
+ (setq left lines right nil))
+ (while left
+ (insert "\n" (pop left))
+ (when right
+ (if (< (current-column) 40)
+ (move-to-column 40 t)
+ (insert " "))
+ (insert (pop right))))
+
+ ;; Make the window the right size
+ (goto-char (point-min))
+ (if second-time
+ (when (not (pos-visible-in-window-p (point-max)))
+ (org-fit-window-to-buffer))
+ (setq second-time t)
+ (org-fit-window-to-buffer))
+
+ ;; Hint to navigation if window too small for all information
+ (setq header-line-format
+ (when (not (pos-visible-in-window-p (point-max)))
+ "Use C-v, M-v, C-n or C-p to navigate."))
+
+ ;; Ask for selection
+ (cl-loop
+ do (progn
+ (message "Press key for agenda command%s:"
+ (if (or restrict-ok org-agenda-overriding-restriction)
+ (if org-agenda-overriding-restriction
+ " (restriction lock active)"
+ (if restriction
+ (format " (restricted to %s)" restriction)
+ " (unrestricted)"))
+ ""))
+ (setq c (read-char-exclusive)))
+ until (not (memq c '(14 16 22 134217846)))
+ do (org-scroll c))
+
+ (message "")
+ (cond
+ ((assoc (char-to-string c) custom)
+ (setq selstring (concat selstring (char-to-string c)))
+ (throw 'exit (cons selstring restriction)))
+ ((memq c prefixes)
+ (setq selstring (concat selstring (char-to-string c))
+ prefixes nil
+ rmheader (or rmheader t)
+ custom (delq nil (mapcar
+ (lambda (x)
+ (if (or (= (length (car x)) 1)
+ (/= (string-to-char (car x)) c))
+ nil
+ (cons (substring (car x) 1) (cdr x))))
+ custom))))
+ ((eq c ?*)
+ (call-interactively 'org-toggle-sticky-agenda)
+ (sit-for 2))
+ ((and (not restrict-ok) (memq c '(?1 ?0 ?<)))
+ (message "Restriction is only possible in Org buffers")
+ (ding) (sit-for 1))
+ ((eq c ?1)
+ (org-agenda-remove-restriction-lock 'noupdate)
+ (setq restriction 'buffer))
+ ((eq c ?0)
+ (org-agenda-remove-restriction-lock 'noupdate)
+ (setq restriction (if region-p 'region 'subtree)))
+ ((eq c ?<)
+ (org-agenda-remove-restriction-lock 'noupdate)
+ (setq restriction
+ (cond
+ ((eq restriction 'buffer)
+ (if region-p 'region 'subtree))
+ ((memq restriction '(subtree region))
+ nil)
+ (t 'buffer))))
+ ((eq c ?>)
+ (org-agenda-remove-restriction-lock 'noupdate)
+ (setq restriction nil))
+ ((and (equal selstring "") (memq c '(?s ?S ?a ?t ?m ?L ?C ?e ?T ?M ?# ?! ?/ ??)))
+ (throw 'exit (cons (setq selstring (char-to-string c)) restriction)))
+ ((and (> (length selstring) 0) (eq c ?\d))
+ (delete-window)
+ (org-agenda-get-restriction-and-command prefix-descriptions))
+
+ ((equal c ?q) (user-error "Abort"))
+ (t (user-error "Invalid key %c" c))))))))
+
+(defun org-agenda-fit-window-to-buffer ()
+ "Fit the window to the buffer size."
+ (and (memq org-agenda-window-setup '(reorganize-frame))
+ (fboundp 'fit-window-to-buffer)
+ (if (and (= (cdr org-agenda-window-frame-fractions) 1.0)
+ (= (car org-agenda-window-frame-fractions) 1.0))
+ (delete-other-windows)
+ (org-fit-window-to-buffer
+ nil
+ (floor (* (frame-height) (cdr org-agenda-window-frame-fractions)))
+ (floor (* (frame-height) (car org-agenda-window-frame-fractions)))))))
+
+(defvar org-cmd nil)
+(defvar org-agenda-overriding-cmd nil)
+(defvar org-agenda-overriding-arguments nil)
+(defvar org-agenda-overriding-cmd-arguments nil)
+
+(defun org-let (list &rest body) ;FIXME: So many kittens are suffering here.
+ (declare (indent 1) (obsolete cl-progv "2021"))
+ (eval (cons 'let (cons list body))))
+
+(defun org-let2 (list1 list2 &rest body) ;FIXME: Where did our karma go?
+ (declare (indent 2) (obsolete cl-progv "2021"))
+ (eval (cons 'let (cons list1 (list (cons 'let (cons list2 body)))))))
+
+(defun org-agenda-run-series (name series)
+ "Run agenda NAME as a SERIES of agenda commands."
+ (let* ((gprops (nth 1 series))
+ (gvars (mapcar #'car gprops))
+ (gvals (mapcar (lambda (binding) (eval (cadr binding) t)) gprops)))
+ (cl-progv gvars gvals (org-agenda-prepare name))
+ ;; We need to reset agenda markers here, because when constructing a
+ ;; block agenda, the individual blocks do not do that.
+ (org-agenda-reset-markers)
+ (with-no-warnings
+ (defvar match)) ;Used via the `eval' below.
+ (let* ((org-agenda-multi t)
+ ;; FIXME: Redo should contain lists of (FUNS . ARGS) rather
+ ;; than expressions, so you don't need to `quote' the args
+ ;; and you just need to `apply' instead of `eval' when using it.
+ (redo (list 'org-agenda-run-series name (list 'quote series)))
+ (cmds (car series))
+ match
+ org-cmd type lprops)
+ (while (setq org-cmd (pop cmds))
+ (setq type (car org-cmd))
+ (setq match (eval (nth 1 org-cmd) t))
+ (setq lprops (nth 2 org-cmd))
+ (let ((org-agenda-overriding-arguments
+ (if (eq org-agenda-overriding-cmd org-cmd)
+ (or org-agenda-overriding-arguments
+ org-agenda-overriding-cmd-arguments)))
+ (lvars (mapcar #'car lprops))
+ (lvals (mapcar (lambda (binding) (eval (cadr binding) t)) lprops)))
+ (cl-progv (append gvars lvars) (append gvals lvals)
+ (pcase type
+ (`agenda
+ (call-interactively 'org-agenda-list))
+ (`agenda*
+ (funcall 'org-agenda-list nil nil t))
+ (`alltodo
+ (call-interactively 'org-todo-list))
+ (`search
+ (org-search-view current-prefix-arg match nil))
+ (`stuck
+ (call-interactively 'org-agenda-list-stuck-projects))
+ (`tags
+ (org-tags-view current-prefix-arg match))
+ (`tags-todo
+ (org-tags-view '(4) match))
+ (`todo
+ (org-todo-list match))
+ ((pred fboundp)
+ (funcall type match))
+ (_ (error "Invalid type in command series"))))))
+ (widen)
+ (let ((inhibit-read-only t))
+ (add-text-properties (point-min) (point-max)
+ `(org-series t org-series-redo-cmd ,redo)))
+ (setq org-agenda-redo-command redo)
+ (goto-char (point-min)))
+ (org-agenda-fit-window-to-buffer)
+ (cl-progv gvars gvals (org-agenda-finalize))))
+
+(defun org-agenda--split-plist (plist)
+ ;; We could/should arguably use `map-keys' and `map-values'.
+ (let (keys vals)
+ (while plist
+ (push (pop plist) keys)
+ (push (pop plist) vals))
+ (cons (nreverse keys) (nreverse vals))))
+
+;;;###autoload
+(defmacro org-batch-agenda (cmd-key &rest parameters)
+ "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."
+ (pcase-let ((`(,vars . ,exps) (org-agenda--split-plist parameters)))
+ `(org--batch-agenda ,cmd-key ',vars (list ,@exps))))
+
+(defun org--batch-agenda (cmd-key vars vals)
+ ;; `org-batch-agenda' is a macro because every other "parameter" is
+ ;; a variable name rather than an expression to evaluate. Yuck!
+ (cl-progv vars vals
+ (let (org-agenda-sticky)
+ (if (> (length cmd-key) 1)
+ (org-tags-view nil cmd-key)
+ (org-agenda nil cmd-key))))
+ (set-buffer org-agenda-buffer-name)
+ (princ (buffer-string)))
+
+(defvar org-agenda-info nil)
+
+;;;###autoload
+(defmacro org-batch-agenda-csv (cmd-key &rest parameters)
+ "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 String 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"
+ (pcase-let ((`(,vars . ,exps) (org-agenda--split-plist parameters)))
+ `(org--batch-agenda-csv ,cmd-key ',vars (list ,@exps))))
+
+(defun org--batch-agenda-csv (cmd-key vars vals)
+ ;; `org-batch-agenda-csv' is a macro because every other "parameter" is
+ ;; a variable name rather than an expression to evaluate. Yuck!
+ (let ((org-agenda-remove-tags t))
+ (cl-progv vars vals
+ ;; FIXME: Shouldn't this be 1 (see commit 10173ad6d610b)?
+ (if (> (length cmd-key) 2)
+ (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")))
+ (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
+ (mapconcat #'org-agenda-export-csv-mapper
+ '(org-category txt type todo tags date time extra
+ priority-letter priority agenda-day)
+ ","))
+ (princ "\n")))))
+
+(defun org-fix-agenda-info (props)
+ "Make sure all properties on an agenda item have a canonical form.
+This ensures the export commands can easily use it."
+ (let (tmp re)
+ (when (setq tmp (plist-get props 'tags))
+ (setq props (plist-put props 'tags (mapconcat #'identity tmp ":"))))
+ (when (setq tmp (plist-get props 'date))
+ (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))
+ (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))
+ (setq props (plist-put props 'agenda-day tmp)))
+ (when (setq tmp (plist-get props 'txt))
+ (when (string-match "\\[#\\([A-Z0-9]\\)\\] ?" tmp)
+ (plist-put props 'priority-letter (match-string 1 tmp))
+ (setq tmp (replace-match "" t t tmp)))
+ (when (and (setq re (plist-get props 'org-todo-regexp))
+ (setq re (concat "\\`\\.*" re " ?"))
+ (let ((case-fold-search nil)) (string-match re tmp)))
+ (plist-put props 'todo (match-string 1 tmp))
+ (setq tmp (replace-match "" t t tmp)))
+ (plist-put props 'txt tmp)))
+ props)
+
+(defun org-agenda-export-csv-mapper (prop)
+ (let ((res (plist-get org-agenda-info prop)))
+ (setq res
+ (cond
+ ((not res) "")
+ ((stringp res) res)
+ (t (prin1-to-string res))))
+ (org-trim (replace-regexp-in-string "," ";" res nil t))))
+
+;;;###autoload
+(defun org-store-agenda-views (&rest _parameters)
+ "Store agenda views."
+ (interactive)
+ (org--batch-store-agenda-views nil nil))
+
+;;;###autoload
+(defmacro org-batch-store-agenda-views (&rest parameters)
+ "Run all custom agenda commands that have a file argument."
+ (pcase-let ((`(,vars . ,exps) (org-agenda--split-plist parameters)))
+ `(org--batch-store-agenda-views ',vars (list ,@exps))))
+
+(defun org--batch-store-agenda-views (vars vals)
+ (let ((cmds (org-agenda-normalize-custom-commands org-agenda-custom-commands))
+ (pop-up-frames nil)
+ (dir default-directory)
+ cmd thiscmdkey thiscmdcmd match files opts cmd-or-set bufname)
+ (save-window-excursion
+ (while cmds
+ (setq cmd (pop cmds)
+ thiscmdkey (car cmd)
+ thiscmdcmd (cdr cmd)
+ match (nth 2 thiscmdcmd)
+ bufname (if org-agenda-sticky
+ (or (and (stringp match)
+ (format "*Org Agenda(%s:%s)*" thiscmdkey match))
+ (format "*Org Agenda(%s)*" thiscmdkey))
+ org-agenda-buffer-name)
+ cmd-or-set (nth 2 cmd)
+ opts (nth (if (listp cmd-or-set) 3 4) cmd)
+ files (nth (if (listp cmd-or-set) 4 5) cmd))
+ (if (stringp files) (setq files (list files)))
+ (when files
+ (let* ((opts (append org-agenda-exporter-settings opts))
+ (vars (append (mapcar #'car opts) vars))
+ (vals (append (mapcar (lambda (binding) (eval (cadr binding) t))
+ opts)
+ vals)))
+ (cl-progv vars vals
+ (org-agenda nil thiscmdkey))
+ (set-buffer bufname)
+ (while files
+ (cl-progv vars vals
+ (org-agenda-write (expand-file-name (pop files) dir)
+ nil t bufname))))
+ (and (get-buffer bufname)
+ (kill-buffer bufname)))))))
+
+(defvar org-agenda-current-span nil
+ "The current span used in the agenda view.") ; local variable in the agenda buffer
+(defun org-agenda-mark-header-line (pos)
+ "Mark the line at POS as an agenda structure header."
+ (save-excursion
+ (goto-char pos)
+ (put-text-property (point-at-bol) (point-at-eol)
+ 'org-agenda-structural-header t)
+ (when org-agenda-title-append
+ (put-text-property (point-at-bol) (point-at-eol)
+ 'org-agenda-title-append org-agenda-title-append))))
+
+(defvar org-mobile-creating-agendas) ; defined in org-mobile.el
+(defvar org-agenda-write-buffer-name "Agenda View")
+(defun org-agenda-write (file &optional open nosettings agenda-bufname)
+ "Write the current buffer (an agenda view) as a file.
+
+Depending on the extension of the file name, plain text (.txt),
+HTML (.html or .htm), PDF (.pdf) or Postscript (.ps) is produced.
+If the extension is .ics, translate visible agenda into iCalendar
+format. If the extension is .org, collect all subtrees
+corresponding to the agenda entries and add them in an .org file.
+
+With prefix argument OPEN, open the new file immediately. If
+NOSETTINGS is given, do not scope the settings of
+`org-agenda-exporter-settings' into the export commands. This is
+used when the settings have already been scoped and we do not
+wish to overrule other, higher priority settings. If
+AGENDA-BUFFER-NAME is provided, use this as the buffer name for
+the agenda to write."
+ (interactive "FWrite agenda to file: \nP")
+ (if (or (not (file-writable-p file))
+ (and (file-exists-p file)
+ (if (called-interactively-p 'any)
+ (not (y-or-n-p (format "Overwrite existing file %s? " file))))))
+ (user-error "Cannot write agenda to file %s" file))
+ (cl-progv
+ (if nosettings nil (mapcar #'car org-agenda-exporter-settings))
+ (if nosettings nil (mapcar (lambda (binding) (eval (cadr binding) t))
+ org-agenda-exporter-settings))
+ (save-excursion
+ (save-window-excursion
+ (let ((bs (copy-sequence (buffer-string)))
+ (extension (file-name-extension file))
+ (default-directory (file-name-directory file))
+ ) ;; beg content
+ (with-temp-buffer
+ (rename-buffer org-agenda-write-buffer-name t)
+ (set-buffer-modified-p nil)
+ (insert bs)
+ (org-agenda-remove-marked-text 'invisible 'org-filtered)
+ (run-hooks 'org-agenda-before-write-hook)
+ (cond
+ ((bound-and-true-p org-mobile-creating-agendas)
+ (org-mobile-write-agenda-for-mobile file))
+ ((string= "org" extension)
+ (let (content p m message-log-max)
+ (goto-char (point-min))
+ (while (setq p (next-single-property-change (point) 'org-hd-marker nil))
+ (goto-char p)
+ (setq m (get-text-property (point) 'org-hd-marker))
+ (when m
+ (push (with-current-buffer (marker-buffer m)
+ (goto-char m)
+ (org-copy-subtree 1 nil t t)
+ org-subtree-clip)
+ content)))
+ (find-file file)
+ (erase-buffer)
+ (dolist (s content) (org-paste-subtree 1 s))
+ (write-file file)
+ (kill-buffer (current-buffer))
+ (message "Org file written to %s" file)))
+ ((member extension '("html" "htm"))
+ (or (require 'htmlize nil t)
+ (error "Please install htmlize from https://github.com/hniksic/emacs-htmlize"))
+ (declare-function htmlize-buffer "htmlize" (&optional buffer))
+ (set-buffer (htmlize-buffer (current-buffer)))
+ (when org-agenda-export-html-style
+ ;; replace <style> section with org-agenda-export-html-style
+ (goto-char (point-min))
+ (kill-region (- (search-forward "<style") 6)
+ (search-forward "</style>"))
+ (insert org-agenda-export-html-style))
+ (write-file file)
+ (kill-buffer (current-buffer))
+ (message "HTML written to %s" file))
+ ((string= "ps" extension)
+ (require 'ps-print)
+ (ps-print-buffer-with-faces file)
+ (message "Postscript written to %s" file))
+ ((string= "pdf" extension)
+ (require 'ps-print)
+ (ps-print-buffer-with-faces
+ (concat (file-name-sans-extension file) ".ps"))
+ (call-process "ps2pdf" nil nil nil
+ (expand-file-name
+ (concat (file-name-sans-extension file) ".ps"))
+ (expand-file-name file))
+ (delete-file (concat (file-name-sans-extension file) ".ps"))
+ (message "PDF written to %s" file))
+ ((string= "ics" extension)
+ (require 'ox-icalendar)
+ (declare-function org-icalendar-export-current-agenda
+ "ox-icalendar" (file))
+ (org-icalendar-export-current-agenda (expand-file-name file)))
+ (t
+ (let ((bs (buffer-string)))
+ (find-file file)
+ (erase-buffer)
+ (insert bs)
+ (save-buffer 0)
+ (kill-buffer (current-buffer))
+ (message "Plain text written to %s" file))))))))
+ (set-buffer (or agenda-bufname
+ ;; FIXME: I'm pretty sure called-interactively-p
+ ;; doesn't do what we want here!
+ (and (called-interactively-p 'any) (buffer-name))
+ org-agenda-buffer-name)))
+ (when open (org-open-file file)))
+
+(defun org-agenda-remove-marked-text (property &optional value)
+ "Delete all text marked with VALUE of PROPERTY.
+VALUE defaults to t."
+ (let (beg)
+ (setq value (or value t))
+ (while (setq beg (text-property-any (point-min) (point-max)
+ property value))
+ (delete-region
+ beg (or (next-single-property-change beg property)
+ (point-max))))))
+
+(defun org-agenda-add-entry-text ()
+ "Add entry text to agenda lines.
+This will add a maximum of `org-agenda-add-entry-text-maxlines' lines of the
+entry text following headings shown in the agenda.
+Drawers will be excluded, also the line with scheduling/deadline info."
+ (when (and (> org-agenda-add-entry-text-maxlines 0)
+ (not (bound-and-true-p org-mobile-creating-agendas)))
+ (let (m txt)
+ (goto-char (point-min))
+ (while (not (eobp))
+ (if (not (setq m (org-get-at-bol 'org-hd-marker)))
+ (beginning-of-line 2)
+ (setq txt (org-agenda-get-some-entry-text
+ m org-agenda-add-entry-text-maxlines " > "))
+ (end-of-line 1)
+ (if (string-match "\\S-" txt)
+ (insert "\n" txt)
+ (or (eobp) (forward-char 1))))))))
+
+(defun org-agenda-get-some-entry-text (marker n-lines &optional indent
+ &rest keep)
+ "Extract entry text from MARKER, at most N-LINES lines.
+This will ignore drawers etc, just get the text.
+If INDENT is given, prefix every line with this string. If KEEP is
+given, it is a list of symbols, defining stuff that should not be
+removed from the entry content. Currently only `planning' is allowed here."
+ (let (txt drawer-re kwd-time-re ind)
+ (save-excursion
+ (with-current-buffer (marker-buffer marker)
+ (if (not (derived-mode-p 'org-mode))
+ (setq txt "")
+ (org-with-wide-buffer
+ (goto-char marker)
+ (end-of-line 1)
+ (setq txt (buffer-substring
+ (min (1+ (point)) (point-max))
+ (progn (outline-next-heading) (point)))
+ drawer-re org-drawer-regexp
+ kwd-time-re (concat "^[ \t]*" org-keyword-time-regexp
+ ".*\n?"))
+ (with-temp-buffer
+ (insert txt)
+ (when org-agenda-add-entry-text-descriptive-links
+ (goto-char (point-min))
+ (while (org-activate-links (point-max))
+ (goto-char (match-end 0))))
+ (goto-char (point-min))
+ (while (re-search-forward org-link-bracket-re (point-max) t)
+ (set-text-properties (match-beginning 0) (match-end 0)
+ nil))
+ (goto-char (point-min))
+ (while (re-search-forward drawer-re nil t)
+ (delete-region
+ (match-beginning 0)
+ (progn (re-search-forward
+ "^[ \t]*:END:.*\n?" nil 'move)
+ (point))))
+ (unless (member 'planning keep)
+ (goto-char (point-min))
+ (while (re-search-forward kwd-time-re nil t)
+ (replace-match "")))
+ (goto-char (point-min))
+ (when org-agenda-entry-text-exclude-regexps
+ (let ((re-list org-agenda-entry-text-exclude-regexps) re)
+ (while (setq re (pop re-list))
+ (goto-char (point-min))
+ (while (re-search-forward re nil t)
+ (replace-match "")))))
+ (goto-char (point-max))
+ (skip-chars-backward " \t\n")
+ (when (looking-at "[ \t\n]+\\'") (replace-match ""))
+
+ ;; find and remove min common indentation
+ (goto-char (point-min))
+ (untabify (point-min) (point-max))
+ (setq ind (current-indentation))
+ (while (not (eobp))
+ (unless (looking-at "[ \t]*$")
+ (setq ind (min ind (current-indentation))))
+ (beginning-of-line 2))
+ (goto-char (point-min))
+ (while (not (eobp))
+ (unless (looking-at "[ \t]*$")
+ (move-to-column ind)
+ (delete-region (point-at-bol) (point)))
+ (beginning-of-line 2))
+
+ (run-hooks 'org-agenda-entry-text-cleanup-hook)
+
+ (goto-char (point-min))
+ (when indent
+ (while (and (not (eobp)) (re-search-forward "^" nil t))
+ (replace-match indent t t)))
+ (goto-char (point-min))
+ (while (looking-at "[ \t]*\n") (replace-match ""))
+ (goto-char (point-max))
+ (when (> (org-current-line)
+ n-lines)
+ (org-goto-line (1+ n-lines))
+ (backward-char 1))
+ (setq txt (buffer-substring (point-min) (point))))))))
+ txt))
+
+(defun org-check-for-org-mode ()
+ "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)))
+
+;;; Agenda prepare and finalize
+
+(defvar org-agenda-multi nil) ; dynamically scoped
+(defvar org-agenda-pre-window-conf nil)
+(defvar org-agenda-columns-active nil)
+(defvar org-agenda-name nil)
+(defvar org-agenda-tag-filter nil)
+(defvar org-agenda-category-filter nil)
+(defvar org-agenda-regexp-filter nil)
+(defvar org-agenda-effort-filter nil)
+(defvar org-agenda-top-headline-filter nil)
+
+(defvar org-agenda-represented-categories nil
+ "Cache for the list of all categories in the agenda.")
+(defvar org-agenda-represented-tags nil
+ "Cache for the list of all categories in the agenda.")
+(defvar org-agenda-tag-filter-preset nil
+ "A preset of the tags filter used for secondary agenda filtering.
+This must be a list of strings, each string must be a single tag preceded
+by \"+\" or \"-\".
+This variable should not be set directly, but agenda custom commands can
+bind it in the options section. The preset filter is a global property of
+the entire agenda view. In a block agenda, it will not work reliably to
+define a filter for one of the individual blocks. You need to set it in
+the global options and expect it to be applied to the entire view.")
+
+(defconst org-agenda-filter-variables
+ '((category . org-agenda-category-filter)
+ (tag . org-agenda-tag-filter)
+ (effort . org-agenda-effort-filter)
+ (regexp . org-agenda-regexp-filter))
+ "Alist of filter types and associated variables.")
+(defun org-agenda-filter-any ()
+ "Is any filter active?"
+ (cl-some (lambda (x)
+ (or (symbol-value (cdr x))
+ (get :preset-filter x)))
+ org-agenda-filter-variables))
+
+(defvar org-agenda-category-filter-preset nil
+ "A preset of the category filter used for secondary agenda filtering.
+This must be a list of strings, each string must be a single category
+preceded by \"+\" or \"-\".
+This variable should not be set directly, but agenda custom commands can
+bind it in the options section. The preset filter is a global property of
+the entire agenda view. In a block agenda, it will not work reliably to
+define a filter for one of the individual blocks. You need to set it in
+the global options and expect it to be applied to the entire view.")
+
+(defvar org-agenda-regexp-filter-preset nil
+ "A preset of the regexp filter used for secondary agenda filtering.
+This must be a list of strings, each string must be a single regexp
+preceded by \"+\" or \"-\".
+This variable should not be set directly, but agenda custom commands can
+bind it in the options section. The preset filter is a global property of
+the entire agenda view. In a block agenda, it will not work reliably to
+define a filter for one of the individual blocks. You need to set it in
+the global options and expect it to be applied to the entire view.")
+
+(defvar org-agenda-effort-filter-preset nil
+ "A preset of the effort condition used for secondary agenda filtering.
+This must be a list of strings, each string must be a single regexp
+preceded by \"+\" or \"-\".
+This variable should not be set directly, but agenda custom commands can
+bind it in the options section. The preset filter is a global property of
+the entire agenda view. In a block agenda, it will not work reliably to
+define a filter for one of the individual blocks. You need to set it in
+the global options and expect it to be applied to the entire view.")
+
+(defun org-agenda-use-sticky-p ()
+ "Return non-nil if an agenda buffer named
+`org-agenda-buffer-name' exists and should be shown instead of
+generating a new one."
+ (and
+ ;; turned off by user
+ org-agenda-sticky
+ ;; For multi-agenda buffer already exists
+ (not org-agenda-multi)
+ ;; buffer found
+ (get-buffer org-agenda-buffer-name)
+ ;; C-u parameter is same as last call
+ (with-current-buffer (get-buffer org-agenda-buffer-name)
+ (and
+ (equal current-prefix-arg
+ org-agenda-last-prefix-arg)
+ ;; In case user turned stickiness on, while having existing
+ ;; Agenda buffer active, don't reuse that buffer, because it
+ ;; does not have org variables local
+ org-agenda-this-buffer-is-sticky))))
+
+(defvar org-agenda-buffer-tmp-name nil)
+
+(defun org-agenda--get-buffer-name (sticky-name)
+ (or org-agenda-buffer-tmp-name
+ (and org-agenda-doing-sticky-redo org-agenda-buffer-name)
+ sticky-name
+ "*Org Agenda*"))
+
+(defun org-agenda-prepare-window (abuf filter-alist)
+ "Setup agenda buffer in the window.
+ABUF is the buffer for the agenda window.
+FILTER-ALIST is an alist of filters we need to apply when
+`org-agenda-persistent-filter' is non-nil."
+ (let* ((awin (get-buffer-window abuf)) wconf)
+ (cond
+ ((equal (current-buffer) abuf) nil)
+ (awin (select-window awin))
+ ((not (setq wconf (current-window-configuration))))
+ ((eq org-agenda-window-setup 'current-window)
+ (pop-to-buffer-same-window abuf))
+ ((eq org-agenda-window-setup 'other-window)
+ (org-switch-to-buffer-other-window abuf))
+ ((eq org-agenda-window-setup 'other-frame)
+ (switch-to-buffer-other-frame abuf))
+ ((eq org-agenda-window-setup 'other-tab)
+ (if (fboundp 'switch-to-buffer-other-tab)
+ (switch-to-buffer-other-tab abuf)
+ (user-error "Your version of Emacs does not have tab bar support")))
+ ((eq org-agenda-window-setup 'only-window)
+ (delete-other-windows)
+ (pop-to-buffer-same-window abuf))
+ ((eq org-agenda-window-setup 'reorganize-frame)
+ (delete-other-windows)
+ (org-switch-to-buffer-other-window abuf)))
+ (setq org-agenda-tag-filter (cdr (assq 'tag filter-alist)))
+ (setq org-agenda-category-filter (cdr (assq 'cat filter-alist)))
+ (setq org-agenda-effort-filter (cdr (assq 'effort filter-alist)))
+ (setq org-agenda-regexp-filter (cdr (assq 're filter-alist)))
+ ;; Additional test in case agenda is invoked from within agenda
+ ;; buffer via elisp link.
+ (unless (equal (current-buffer) abuf)
+ (pop-to-buffer-same-window abuf))
+ (setq org-agenda-pre-window-conf
+ (or wconf org-agenda-pre-window-conf))))
+
+(defun org-agenda-prepare (&optional name)
+ (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)
+ (put 'org-agenda-category-filter :preset-filter nil)
+ (put 'org-agenda-regexp-filter :preset-filter nil)
+ (put 'org-agenda-effort-filter :preset-filter nil)
+ ;; Popup existing buffer
+ (org-agenda-prepare-window (get-buffer org-agenda-buffer-name)
+ filter-alist)
+ (message "Sticky Agenda buffer, use `r' to refresh")
+ (or org-agenda-multi (org-agenda-fit-window-to-buffer))
+ (throw 'exit "Sticky Agenda buffer, use `r' to refresh"))
+ (setq org-todo-keywords-for-agenda nil)
+ (put 'org-agenda-tag-filter :preset-filter
+ org-agenda-tag-filter-preset)
+ (put 'org-agenda-category-filter :preset-filter
+ org-agenda-category-filter-preset)
+ (put 'org-agenda-regexp-filter :preset-filter
+ org-agenda-regexp-filter-preset)
+ (put 'org-agenda-effort-filter :preset-filter
+ org-agenda-effort-filter-preset)
+ (if org-agenda-multi
+ (progn
+ (setq buffer-read-only nil)
+ (goto-char (point-max))
+ (unless (or (bobp) org-agenda-compact-blocks
+ (not org-agenda-block-separator))
+ (insert "\n"
+ (if (stringp org-agenda-block-separator)
+ org-agenda-block-separator
+ (make-string (window-width) org-agenda-block-separator))
+ "\n"))
+ (narrow-to-region (point) (point-max)))
+ (setq org-done-keywords-for-agenda nil)
+ ;; Setting any org variables that are in org-agenda-local-vars
+ ;; list need to be done after the prepare call
+ (org-agenda-prepare-window
+ (get-buffer-create org-agenda-buffer-name) filter-alist)
+ (setq buffer-read-only nil)
+ (org-agenda-reset-markers)
+ (let ((inhibit-read-only t)) (erase-buffer))
+ (org-agenda-mode)
+ (setq org-agenda-buffer (current-buffer))
+ (setq org-agenda-contributing-files nil)
+ (setq org-agenda-columns-active nil)
+ (org-agenda-prepare-buffers (org-agenda-files nil 'ifmode))
+ (setq org-todo-keywords-for-agenda
+ (org-uniquify org-todo-keywords-for-agenda))
+ (setq org-done-keywords-for-agenda
+ (org-uniquify org-done-keywords-for-agenda))
+ (setq org-agenda-last-prefix-arg current-prefix-arg)
+ (setq org-agenda-this-buffer-name org-agenda-buffer-name)
+ (and name (not org-agenda-name)
+ (setq-local org-agenda-name name)))
+ (setq buffer-read-only nil))))
+
+(defvar org-overriding-columns-format)
+(defvar org-local-columns-format)
+(defun org-agenda-finalize ()
+ "Finishing touch for the agenda buffer.
+This function is called just before displaying the agenda. If
+you want to add your own functions to the finalization of the
+agenda display, configure `org-agenda-finalize-hook'."
+ (unless org-agenda-multi
+ (let ((inhibit-read-only t))
+ (save-excursion
+ (goto-char (point-min))
+ (save-excursion
+ (while (org-activate-links (point-max))
+ (goto-char (match-end 0))))
+ (unless (eq org-agenda-remove-tags t)
+ (org-agenda-align-tags))
+ (unless org-agenda-with-colors
+ (remove-text-properties (point-min) (point-max) '(face nil)))
+ (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)
+ (org-agenda-dim-blocked-tasks))
+ (org-agenda-mark-clocking-task)
+ (when org-agenda-entry-text-mode
+ (org-agenda-entry-text-hide)
+ (org-agenda-entry-text-show))
+ (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)
+ (memq org-agenda-type org-agenda-show-inherited-tags))
+ (and (eq org-agenda-show-inherited-tags t)
+ (or (eq org-agenda-use-tag-inheritance t)
+ (and (listp org-agenda-use-tag-inheritance)
+ (not (memq org-agenda-type
+ org-agenda-use-tag-inheritance))))))
+ (let (mrk)
+ (save-excursion
+ (goto-char (point-min))
+ (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
+ (org-get-tags))))))))
+ (setq org-agenda-represented-tags nil
+ org-agenda-represented-categories nil)
+ (when org-agenda-top-headline-filter
+ (org-agenda-filter-top-headline-apply
+ org-agenda-top-headline-filter))
+ (when org-agenda-tag-filter
+ (org-agenda-filter-apply org-agenda-tag-filter 'tag t))
+ (when (get 'org-agenda-tag-filter :preset-filter)
+ (org-agenda-filter-apply
+ (get 'org-agenda-tag-filter :preset-filter) 'tag t))
+ (when org-agenda-category-filter
+ (org-agenda-filter-apply org-agenda-category-filter 'category))
+ (when (get 'org-agenda-category-filter :preset-filter)
+ (org-agenda-filter-apply
+ (get 'org-agenda-category-filter :preset-filter) 'category))
+ (when org-agenda-regexp-filter
+ (org-agenda-filter-apply org-agenda-regexp-filter 'regexp))
+ (when (get 'org-agenda-regexp-filter :preset-filter)
+ (org-agenda-filter-apply
+ (get 'org-agenda-regexp-filter :preset-filter) 'regexp))
+ (when org-agenda-effort-filter
+ (org-agenda-filter-apply org-agenda-effort-filter 'effort))
+ (when (get 'org-agenda-effort-filter :preset-filter)
+ (org-agenda-filter-apply
+ (get 'org-agenda-effort-filter :preset-filter) 'effort))
+ (add-hook 'kill-buffer-hook #'org-agenda-reset-markers 'append 'local))
+ (run-hooks 'org-agenda-finalize-hook))))
+
+(defun org-agenda-mark-clocking-task ()
+ "Mark the current clock entry in the agenda if it is present."
+ ;; We need to widen when `org-agenda-finalize' is called from
+ ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in').
+ (when (bound-and-true-p org-clock-current-task)
+ (save-restriction
+ (widen)
+ (org-agenda-unmark-clocking-task)
+ (when (marker-buffer org-clock-hd-marker)
+ (save-excursion
+ (goto-char (point-min))
+ (let (s ov)
+ (while (setq s (next-single-property-change (point) 'org-hd-marker))
+ (goto-char s)
+ (when (equal (org-get-at-bol 'org-hd-marker)
+ org-clock-hd-marker)
+ (setq ov (make-overlay (point-at-bol) (1+ (point-at-eol))))
+ (overlay-put ov 'type 'org-agenda-clocking)
+ (overlay-put ov 'face 'org-agenda-clocking)
+ (overlay-put ov 'help-echo
+ "The clock is running in this item")))))))))
+
+(defun org-agenda-unmark-clocking-task ()
+ "Unmark the current clocking task."
+ (mapc (lambda (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) (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)
+ (goto-char (point-min))
+ (while (re-search-forward org-priority-regexp nil t)
+ (setq h (or (get-char-property (point) 'org-priority-highest)
+ org-priority-highest)
+ l (or (get-char-property (point) 'org-priority-lowest)
+ org-priority-lowest)
+ p (string-to-char (match-string 2))
+ b (match-beginning 1)
+ e (if (eq org-agenda-fontify-priorities 'cookies)
+ (1+ (match-end 2))
+ (point-at-eol))
+ ov (make-overlay b e))
+ (overlay-put
+ ov 'face
+ (let ((special-face
+ (cond ((org-face-from-face-or-color
+ 'priority 'org-priority
+ (cdr (assoc p org-priority-faces))))
+ ((and (listp org-agenda-fontify-priorities)
+ (org-face-from-face-or-color
+ 'priority 'org-priority
+ (cdr (assoc p org-agenda-fontify-priorities)))))
+ ((equal p l) 'italic)
+ ((equal p h) 'bold))))
+ (if special-face (list special-face 'org-priority) 'org-priority)))
+ (overlay-put ov 'org-type 'org-priority)))))
+
+(defvar org-depend-tag-blocked)
+
+(defun org-agenda-dim-blocked-tasks (&optional _invisible)
+ "Dim currently blocked TODOs in the agenda display.
+When INVISIBLE is non-nil, hide currently blocked TODO instead of
+dimming them." ;FIXME: The arg isn't used, actually!
+ (interactive "P")
+ (when (called-interactively-p 'interactive)
+ (message "Dim or hide blocked tasks..."))
+ (dolist (o (overlays-in (point-min) (point-max)))
+ (when (eq (overlay-get o 'face) 'org-agenda-dimmed-todo-face)
+ (delete-overlay o)))
+ (save-excursion
+ (let ((inhibit-read-only t))
+ (goto-char (point-min))
+ (while (let ((pos (text-property-not-all
+ (point) (point-max) 'org-todo-blocked nil)))
+ (when pos (goto-char pos)))
+ (let* ((invisible
+ (eq (org-get-at-bol 'org-todo-blocked) 'invisible))
+ (todo-blocked
+ (eq (org-get-at-bol 'org-filter-type) 'todo-blocked))
+ (ov (make-overlay (if invisible
+ (line-end-position 0)
+ (line-beginning-position))
+ (line-end-position))))
+ (when todo-blocked
+ (overlay-put ov 'face 'org-agenda-dimmed-todo-face))
+ (when invisible
+ (org-agenda-filter-hide-line 'todo-blocked)))
+ (if (= (point-max) (line-end-position))
+ (goto-char (point-max))
+ (move-beginning-of-line 2)))))
+ (when (called-interactively-p 'interactive)
+ (message "Dim or hide blocked tasks...done")))
+
+(defun org-agenda--mark-blocked-entry (entry)
+ "If ENTRY is blocked, mark it for fontification or invisibility.
+
+If the header at `org-hd-marker' is blocked according to
+`org-entry-blocked-p', then if `org-agenda-dim-blocked-tasks' is
+'invisible and the header is not blocked by checkboxes, set the
+text property `org-todo-blocked' to `invisible', otherwise set it
+to t."
+ (when (get-text-property 0 'todo-state entry)
+ (let ((entry-marker (get-text-property 0 'org-hd-marker entry))
+ (org-blocked-by-checkboxes nil)
+ ;; Necessary so that `org-entry-blocked-p' does not change
+ ;; the buffer.
+ (org-depend-tag-blocked nil))
+ (when entry-marker
+ (let ((blocked
+ (with-current-buffer (marker-buffer entry-marker)
+ (save-excursion
+ (goto-char entry-marker)
+ (org-entry-blocked-p)))))
+ (when blocked
+ (let ((really-invisible
+ (and (not org-blocked-by-checkboxes)
+ (eq org-agenda-dim-blocked-tasks 'invisible))))
+ (put-text-property
+ 0 (length entry) 'org-todo-blocked
+ (if really-invisible 'invisible t)
+ entry)
+ (put-text-property
+ 0 (length entry) 'org-filter-type 'todo-blocked entry)))))))
+ entry)
+
+(defvar org-agenda-skip-function nil
+ "Function to be called at each match during agenda construction.
+If this function returns nil, the current match should not be skipped.
+Otherwise, the function must return a position from where the search
+should be continued.
+This may also be a Lisp form, it will be evaluated.
+Never set this variable using `setq' or so, because then it will apply
+to all future agenda commands. If you do want a global skipping condition,
+use the option `org-agenda-skip-function-global' instead.
+The correct usage for `org-agenda-skip-function' is to bind it with
+`let' to scope it dynamically into the agenda-constructing command.
+A good way to set it is through options in `org-agenda-custom-commands'.")
+
+(defun org-agenda-skip ()
+ "Throw to `:skip' in places that should be skipped.
+Also moves point to the end of the skipped region, so that search can
+continue from there."
+ (let ((p (point-at-bol)) to)
+ (when (or
+ (save-excursion (goto-char p) (looking-at comment-start-skip))
+ (and org-agenda-skip-archived-trees (not org-agenda-archives-mode)
+ (or (and (get-text-property p :org-archived)
+ (org-end-of-subtree t))
+ (and (member org-archive-tag org-file-tags)
+ (goto-char (point-max)))))
+ (and org-agenda-skip-comment-trees
+ (get-text-property p :org-comment)
+ (org-end-of-subtree t))
+ (and (setq to (or (org-agenda-skip-eval org-agenda-skip-function-global)
+ (org-agenda-skip-eval org-agenda-skip-function)))
+ (goto-char to))
+ (org-in-src-block-p t))
+ (throw :skip t))))
+
+(defun org-agenda-skip-eval (form)
+ "If FORM is a function or a list, call (or eval) it and return the result.
+`save-excursion' and `save-match-data' are wrapped around the call, so point
+and match data are returned to the previous state no matter what these
+functions do."
+ (let (fp)
+ (and form
+ (or (setq fp (functionp form))
+ (consp form))
+ (save-excursion
+ (save-match-data
+ (if fp
+ (funcall form)
+ (eval form t)))))))
+
+(defvar org-agenda-markers nil
+ "List of all currently active markers created by `org-agenda'.")
+(defvar org-agenda-last-marker-time (float-time)
+ "Creation time of the last agenda marker.")
+
+(defun org-agenda-new-marker (&optional pos)
+ "Return a new agenda marker.
+Marker is at point, or at POS if non-nil. Org mode keeps a list
+of these markers and resets them when they are no longer in use."
+ (let ((m (copy-marker (or pos (point)) t)))
+ (setq org-agenda-last-marker-time (float-time))
+ (if org-agenda-buffer
+ (with-current-buffer org-agenda-buffer
+ (push m org-agenda-markers))
+ (push m org-agenda-markers))
+ m))
+
+(defun org-agenda-reset-markers ()
+ "Reset markers created by `org-agenda'."
+ (while org-agenda-markers
+ (move-marker (pop org-agenda-markers) nil)))
+
+(defun org-agenda-save-markers-for-cut-and-paste (beg end)
+ "Save relative positions of markers in region.
+This check for agenda markers in all agenda buffers currently active."
+ (dolist (buf (buffer-list))
+ (with-current-buffer buf
+ (when (eq major-mode 'org-agenda-mode)
+ (mapc (lambda (m) (org-check-and-save-marker m beg end))
+ org-agenda-markers)))))
+
+;;; Entry text mode
+
+(defun org-agenda-entry-text-show-here ()
+ "Add some text from the entry as context to the current line."
+ (let (m txt o)
+ (setq m (org-get-at-bol 'org-hd-marker))
+ (unless (marker-buffer m)
+ (error "No marker points to an entry here"))
+ (setq txt (concat "\n" (org-no-properties
+ (org-agenda-get-some-entry-text
+ m org-agenda-entry-text-maxlines
+ org-agenda-entry-text-leaders))))
+ (when (string-match "\\S-" txt)
+ (setq o (make-overlay (point-at-bol) (point-at-eol)))
+ (overlay-put o 'evaporate t)
+ (overlay-put o 'org-overlay-type 'agenda-entry-content)
+ (overlay-put o 'after-string txt))))
+
+(defun org-agenda-entry-text-show ()
+ "Add entry context for all agenda lines."
+ (interactive)
+ (save-excursion
+ (goto-char (point-max))
+ (beginning-of-line 1)
+ (while (not (bobp))
+ (when (org-get-at-bol 'org-hd-marker)
+ (org-agenda-entry-text-show-here))
+ (beginning-of-line 0))))
+
+(defun org-agenda-entry-text-hide ()
+ "Remove any shown entry context."
+ (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."
+ (cond ((and (functionp org-agenda-day-face-function)
+ (funcall org-agenda-day-face-function date)))
+ ((and (org-agenda-today-p date)
+ (memq (calendar-day-of-week date) org-agenda-weekend-days))
+ 'org-agenda-date-weekend-today)
+ ((org-agenda-today-p date) 'org-agenda-date-today)
+ ((memq (calendar-day-of-week date) org-agenda-weekend-days)
+ 'org-agenda-date-weekend)
+ (t 'org-agenda-date)))
+
+(defvar org-agenda-show-log-scoped)
+
+;;; Agenda Daily/Weekly
+
+(defvar org-agenda-start-day nil ; dynamically scoped parameter
+ "Start day for the agenda view.
+Custom commands can set this variable in the options section.
+This is usually a string like \"2007-11-01\", \"+2d\" or any other
+input allowed when reading a date through the Org calendar.
+See the docstring of `org-read-date' for details.")
+(defvar org-starting-day nil) ; local variable in the agenda buffer
+(defvar org-arg-loc nil) ; local variable
+
+;;;###autoload
+(defun org-agenda-list (&optional arg start-day span with-hour)
+ "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."
+ (interactive "P")
+ (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))
+ (when (numberp span)
+ (unless (< 0 span)
+ (user-error "Agenda creation impossible for this span(=%d days)" span)))
+ (catch 'exit
+ (setq org-agenda-buffer-name
+ (org-agenda--get-buffer-name
+ (and 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-prepare "Day/Week")
+ (setq start-day (or start-day org-agenda-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)))
+ (today (org-today))
+ (sd (or start-day today))
+ (ndays (org-agenda-span-to-ndays span sd))
+ (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)
+ (< ndays 7))
+ sd
+ (let* ((nt (calendar-day-of-week
+ (calendar-gregorian-from-absolute sd)))
+ (n1 org-agenda-start-on-weekday)
+ (d (- nt n1)))
+ (- sd (+ (if (< d 0) 7 0) d)))))
+ (day-numbers (list start))
+ (day-cnt 0)
+ (inhibit-redisplay (not debug-on-error))
+ (org-agenda-show-log-scoped org-agenda-show-log)
+ s rtn rtnall file date d start-pos end-pos todayp ;; e
+ clocktable-start clocktable-end) ;; filter
+ (setq org-agenda-redo-command
+ (list 'org-agenda-list (list 'quote arg) start-day (list 'quote span) with-hour))
+ (dotimes (_ (1- ndays))
+ (push (1+ (car day-numbers)) day-numbers))
+ (setq day-numbers (nreverse day-numbers))
+ (setq clocktable-start (car day-numbers)
+ clocktable-end (1+ (or (org-last day-numbers) 0)))
+ (setq-local org-starting-day (car day-numbers))
+ (setq-local org-arg-loc arg)
+ (setq-local org-agenda-current-span (org-agenda-ndays-to-span span))
+ (unless org-agenda-compact-blocks
+ (let* ((d1 (car day-numbers))
+ (d2 (org-last day-numbers))
+ (w1 (org-days-to-iso-week d1))
+ (w2 (org-days-to-iso-week d2)))
+ (setq s (point))
+ (org-agenda--insert-overriding-header
+ (concat (org-agenda-span-name span)
+ "-agenda"
+ (cond ((<= 350 (- d2 d1)) "")
+ ((= w1 w2) (format " (W%02d)" w1))
+ (t (format " (W%02d-W%02d)" w1 w2)))
+ ":\n")))
+ ;; 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))
+ (when (and start-pos (not end-pos))
+ (setq end-pos (point))))
+ (setq files thefiles
+ rtnall nil)
+ (while (setq file (pop files))
+ (catch 'nextfile
+ (org-check-agenda-file file)
+ (let ((org-agenda-entry-types org-agenda-entry-types))
+ ;; Starred types override non-starred equivalents
+ (when (member :deadline* org-agenda-entry-types)
+ (setq org-agenda-entry-types
+ (delq :deadline org-agenda-entry-types)))
+ (when (member :scheduled* org-agenda-entry-types)
+ (setq org-agenda-entry-types
+ (delq :scheduled org-agenda-entry-types)))
+ ;; Honor with-hour
+ (when with-hour
+ (when (member :deadline org-agenda-entry-types)
+ (setq org-agenda-entry-types
+ (delq :deadline org-agenda-entry-types))
+ (push :deadline* org-agenda-entry-types))
+ (when (member :scheduled org-agenda-entry-types)
+ (setq org-agenda-entry-types
+ (delq :scheduled org-agenda-entry-types))
+ (push :scheduled* org-agenda-entry-types)))
+ (unless org-agenda-include-deadlines
+ (setq org-agenda-entry-types
+ (delq :deadline* (delq :deadline org-agenda-entry-types))))
+ (cond
+ ((memq org-agenda-show-log-scoped '(only clockcheck))
+ (setq rtn (org-agenda-get-day-entries
+ file date :closed)))
+ (org-agenda-show-log-scoped
+ (setq rtn (apply #'org-agenda-get-day-entries
+ file date
+ (append '(:closed) org-agenda-entry-types))))
+ (t
+ (setq rtn (apply #'org-agenda-get-day-entries
+ file date
+ org-agenda-entry-types)))))
+ (setq rtnall (append rtnall rtn)))) ;; all entries
+ (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!
+ (p (copy-sequence org-agenda-clockreport-parameter-plist))
+ tbl)
+ (setq p (org-plist-delete p :block))
+ (setq p (plist-put p :tstart clocktable-start))
+ (setq p (plist-put p :tend clocktable-end))
+ (setq p (plist-put p :scope 'agenda))
+ (setq tbl (apply #'org-clock-get-clocktable p))
+ (insert tbl)))
+ (goto-char (point-min))
+ (or org-agenda-multi (org-agenda-fit-window-to-buffer))
+ (unless (or (not (get-buffer-window org-agenda-buffer-name))
+ (and (pos-visible-in-window-p (point-min))
+ (pos-visible-in-window-p (point-max))))
+ (goto-char (1- (point-max)))
+ (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))
+ (when (eq org-agenda-show-log-scoped 'clockcheck)
+ (org-agenda-show-clocking-issues))
+ (org-agenda-finalize)
+ (setq buffer-read-only t)
+ (message ""))))
+
+(defun org-agenda-ndays-to-span (n)
+ "Return a span symbol for a span of N days, or N if none matches."
+ (cond ((symbolp n) n)
+ ((= n 1) 'day)
+ ((= n 7) 'week)
+ ((= n 14) 'fortnight)
+ (t n)))
+
+(defun org-agenda-span-to-ndays (span &optional start-day)
+ "Return ndays from SPAN, possibly starting at START-DAY.
+START-DAY is an absolute time value."
+ (cond ((numberp span) span)
+ ((eq span 'day) 1)
+ ((eq span 'week) 7)
+ ((eq span 'fortnight) 14)
+ ((eq span 'month)
+ (let ((date (calendar-gregorian-from-absolute start-day)))
+ (calendar-last-day-of-month (car date) (cl-caddr date))))
+ ((eq span 'year)
+ (let ((date (calendar-gregorian-from-absolute start-day)))
+ (if (calendar-leap-year-p (cl-caddr date)) 366 365)))))
+
+(defun org-agenda-span-name (span)
+ "Return a SPAN name."
+ (if (null span)
+ ""
+ (if (symbolp span)
+ (capitalize (symbol-name span))
+ (format "%d days" span))))
+
+;;; Agenda word search
+
+(defvar org-agenda-search-history nil)
+
+(defvar org-search-syntax-table nil
+ "Special syntax table for Org search.
+In this table, we have single quotes not as word constituents, to
+that when \"+Ameli\" is searched as a work, it will also match \"Ameli's\"")
+
+(defvar org-mode-syntax-table) ; From org.el
+(defun org-search-syntax-table ()
+ (unless org-search-syntax-table
+ (setq org-search-syntax-table (copy-syntax-table org-mode-syntax-table))
+ (modify-syntax-entry ?' "." org-search-syntax-table)
+ (modify-syntax-entry ?` "." org-search-syntax-table))
+ org-search-syntax-table)
+
+(defvar org-agenda-last-search-view-search-was-boolean nil)
+
+;;;###autoload
+(defun org-search-view (&optional todo-only string edit-at)
+ "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."
+ (interactive "P")
+ (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
+ 'org-todo-regexp org-todo-regexp
+ 'org-complex-heading-regexp org-complex-heading-regexp
+ 'mouse-face 'highlight
+ 'help-echo "mouse-2 or RET jump to location"))
+ (full-words org-agenda-search-view-force-full-words)
+ (org-agenda-text-search-extra-files org-agenda-text-search-extra-files)
+ regexp rtn rtnall files file pos inherited-tags
+ marker category level tags c neg re boolean
+ ee txt beg end words regexps+ regexps- hdl-only buffer beg1 str)
+ (unless (and (not edit-at)
+ (stringp string)
+ (string-match "\\S-" string))
+ (setq string (read-string
+ (if org-agenda-search-view-always-boolean
+ "[+-]Word/{Regexp} ...: "
+ "Phrase or [+-]Word/{Regexp} ...: ")
+ (cond
+ ((integerp edit-at) (cons string edit-at))
+ (edit-at string))
+ 'org-agenda-search-history)))
+ (catch 'exit
+ (setq org-agenda-buffer-name
+ (org-agenda--get-buffer-name
+ (and org-agenda-sticky
+ (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)
+ (setq org-agenda-redo-command
+ (list 'org-search-view (if todo-only t nil)
+ (list 'if 'current-prefix-arg nil string)))
+ (setq org-agenda-query-string string)
+ (if (equal (string-to-char string) ?*)
+ (setq hdl-only t
+ words (substring string 1))
+ (setq words string))
+ (when (equal (string-to-char words) ?!)
+ (setq todo-only t
+ words (substring words 1)))
+ (when (equal (string-to-char words) ?:)
+ (setq full-words t
+ words (substring words 1)))
+ (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))
+ (while (and (string-match "\\\\\\'" w) words)
+ (setq w (concat (substring w 0 -1) " " (pop words))))
+ (push w www))
+ (setq words (nreverse www) www nil)
+ (while (setq w (pop words))
+ (when (and (string-match "\\`[-+]?{" w)
+ (not (string-match "}\\'" w)))
+ (while (and words (not (string-match "}\\'" (car words))))
+ (setq w (concat w " " (pop words))))
+ (setq w (concat w " " (pop words))))
+ (push w www))
+ (setq words (nreverse www)))
+ (setq org-agenda-last-search-view-search-was-boolean boolean)
+ (when boolean
+ (let (wds w)
+ (while (setq 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)))
+ (push w wds))
+ (setq words (nreverse wds))))
+ (if boolean
+ (mapc (lambda (w)
+ (setq c (string-to-char w))
+ (if (equal c ?-)
+ (setq neg t w (substring w 1))
+ (if (equal c ?+)
+ (setq neg nil w (substring w 1))
+ (setq neg nil)))
+ (if (string-match "\\`{.*}\\'" w)
+ (setq re (substring w 1 -1))
+ (if full-words
+ (setq re (concat "\\<" (regexp-quote (downcase w)) "\\>"))
+ (setq re (regexp-quote (downcase w)))))
+ (if neg (push re regexps-) (push re regexps+)))
+ words)
+ (push (mapconcat #'regexp-quote words "\\s-+")
+ regexps+))
+ (setq regexps+ (sort regexps+ (lambda (a b) (> (length a) (length b)))))
+ (if (not regexps+)
+ (setq regexp org-outline-regexp-bol)
+ (setq regexp (pop regexps+))
+ (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.
+ (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.
+ (setq files (cl-remove-duplicates
+ (append files org-agenda-text-search-extra-files)
+ :test (lambda (a b)
+ (and (file-exists-p a)
+ (file-exists-p b)
+ (file-equal-p a b))))
+ rtnall nil)
+ (while (setq file (pop files))
+ (setq ee nil)
+ (catch 'nextfile
+ (org-check-agenda-file file)
+ (setq buffer (if (file-exists-p file)
+ (org-get-agenda-file-buffer file)
+ (error "No such 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))
+ (let ((case-fold-search t))
+ (save-excursion
+ (save-restriction
+ (if (eq buffer org-agenda-restrict)
+ (narrow-to-region org-agenda-restrict-begin
+ org-agenda-restrict-end)
+ (widen))
+ (goto-char (point-min))
+ (unless (or (org-at-heading-p)
+ (outline-next-heading))
+ (throw 'nextfile t))
+ (goto-char (max (point-min) (1- (point))))
+ (while (re-search-forward regexp nil t)
+ (org-back-to-heading t)
+ (while (and (not (zerop org-agenda-search-view-max-outline-level))
+ (> (org-reduced-level (org-outline-level))
+ org-agenda-search-view-max-outline-level)
+ (forward-line -1)
+ (org-back-to-heading t)))
+ (skip-chars-forward "* ")
+ (setq beg (point-at-bol)
+ beg1 (point)
+ end (progn
+ (outline-next-heading)
+ (while (and (not (zerop org-agenda-search-view-max-outline-level))
+ (> (org-reduced-level (org-outline-level))
+ org-agenda-search-view-max-outline-level)
+ (forward-line 1)
+ (outline-next-heading)))
+ (point)))
+
+ (catch :skip
+ (goto-char beg)
+ (org-agenda-skip)
+ (setq str (buffer-substring-no-properties
+ (point-at-bol)
+ (if hdl-only (point-at-eol) end)))
+ (mapc (lambda (wr) (when (string-match wr str)
+ (goto-char (1- end))
+ (throw :skip t)))
+ regexps-)
+ (mapc (lambda (wr) (unless (string-match wr str)
+ (goto-char (1- end))
+ (throw :skip t)))
+ (if todo-only
+ (cons (concat "^\\*+[ \t]+"
+ org-not-done-regexp)
+ regexps+)
+ regexps+))
+ (goto-char beg)
+ (setq marker (org-agenda-new-marker (point))
+ category (org-get-category)
+ level (make-string (org-reduced-level (org-outline-level)) ? )
+ inherited-tags
+ (or (eq org-agenda-show-inherited-tags 'always)
+ (and (listp org-agenda-show-inherited-tags)
+ (memq 'todo org-agenda-show-inherited-tags))
+ (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 nil (not inherited-tags))
+ txt (org-agenda-format-item
+ ""
+ (buffer-substring-no-properties
+ beg1 (point-at-eol))
+ level category tags t))
+ (org-add-props txt props
+ 'org-marker marker 'org-hd-marker marker
+ 'org-todo-regexp org-todo-regexp
+ 'level level
+ 'org-complex-heading-regexp org-complex-heading-regexp
+ 'priority 1000
+ 'type "search")
+ (push txt ee)
+ (goto-char (1- end))))))))))
+ (setq rtn (nreverse ee))
+ (setq rtnall (append rtnall rtn)))
+ (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-agenda-structure-filter))
+ (setq pos (point))
+ (unless org-agenda-multi
+ (insert (substitute-command-keys "\\<org-agenda-mode-map>\
+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]' for a fresh search\n"))
+ (add-text-properties pos (1- (point))
+ (list 'face 'org-agenda-structure-secondary)))
+ (buffer-string)))
+ (org-agenda-mark-header-line (point-min))
+ (when rtnall
+ (insert (org-agenda-finalize-entries rtnall 'search) "\n"))
+ (goto-char (point-min))
+ (or org-agenda-multi (org-agenda-fit-window-to-buffer))
+ (add-text-properties (point-min) (point-max)
+ `(org-agenda-type search
+ org-last-args (,todo-only ,string ,edit-at)
+ org-redo-cmd ,org-agenda-redo-command
+ org-series-cmd ,org-cmd))
+ (org-agenda-finalize)
+ (setq buffer-read-only t))))
+
+;;; Agenda TODO list
+
+(defun org-agenda-propertize-selected-todo-keywords (keywords)
+ "Use `org-todo-keyword-faces' for the selected todo KEYWORDS."
+ (concat
+ (if (or (equal keywords "ALL") (not keywords))
+ (propertize "ALL" 'face 'org-agenda-structure-filter)
+ (mapconcat
+ (lambda (kw)
+ (propertize kw 'face (list (org-get-todo-face kw) 'org-agenda-structure)))
+ (org-split-string keywords "|")
+ "|"))
+ "\n"))
+
+(defvar org-select-this-todo-keyword nil)
+(defvar org-last-arg nil)
+
+(defvar crm-separator)
+
+;;;###autoload
+(defun org-todo-list (&optional arg)
+ "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'."
+ (interactive "P")
+ (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))
+ (completion-ignore-case t)
+ kwds org-select-this-todo-keyword rtn rtnall files file pos)
+ (catch 'exit
+ (setq org-agenda-buffer-name
+ (org-agenda--get-buffer-name
+ (and org-agenda-sticky
+ (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
+ (mapconcat #'identity
+ (let ((crm-separator "|"))
+ (completing-read-multiple
+ "Keyword (or KWD1|KWD2|...): "
+ (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
+ `(org-todo-list (or (and (numberp current-prefix-arg)
+ current-prefix-arg)
+ ,org-select-this-todo-keyword
+ current-prefix-arg ,arg)))
+ (setq files (org-agenda-files nil 'ifmode)
+ rtnall nil)
+ (while (setq file (pop files))
+ (catch 'nextfile
+ (org-check-agenda-file file)
+ (setq rtn (org-agenda-get-day-entries file date :todo))
+ (setq rtnall (append rtnall rtn))))
+ (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 \
+\\<org-agenda-mode-map>`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-secondary))
+ (buffer-string)))
+ (org-agenda-mark-header-line (point-min))
+ (when rtnall
+ (insert (org-agenda-finalize-entries rtnall 'todo) "\n"))
+ (goto-char (point-min))
+ (or org-agenda-multi (org-agenda-fit-window-to-buffer))
+ (add-text-properties (point-min) (point-max)
+ `(org-agenda-type todo
+ org-last-args ,arg
+ org-redo-cmd ,org-agenda-redo-command
+ org-series-cmd ,org-cmd))
+ (org-agenda-finalize)
+ (setq buffer-read-only t))))
+
+;;; Agenda tags match
+
+;;;###autoload
+(defun org-tags-view (&optional todo-only match)
+ "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")
+ (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)
+ (org--matcher-tags-todo-only todo-only)
+ rtn rtnall files file pos matcher
+ buffer)
+ (when (and (stringp match) (not (string-match "\\S-" match)))
+ (setq match nil))
+ (catch 'exit
+ (setq org-agenda-buffer-name
+ (org-agenda--get-buffer-name
+ (and org-agenda-sticky
+ (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 match (car matcher)
+ matcher (cdr matcher))
+ (org-compile-prefix-format 'tags)
+ (org-set-sorting-strategy 'tags)
+ (setq org-agenda-query-string match)
+ (setq org-agenda-redo-command
+ (list 'org-tags-view
+ `(quote ,org--matcher-tags-todo-only)
+ `(if current-prefix-arg nil ,org-agenda-query-string)))
+ (setq files (org-agenda-files nil 'ifmode)
+ rtnall nil)
+ (while (setq file (pop files))
+ (catch 'nextfile
+ (org-check-agenda-file file)
+ (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, error message to agenda
+ (setq rtn (list
+ (format "ORG-AGENDA-ERROR: No such org-file %s" file))
+ rtnall (append rtnall rtn))
+ (with-current-buffer buffer
+ (unless (derived-mode-p 'org-mode)
+ (error "Agenda file %s is not in Org mode" file))
+ (save-excursion
+ (save-restriction
+ (if (eq buffer org-agenda-restrict)
+ (narrow-to-region org-agenda-restrict-begin
+ org-agenda-restrict-end)
+ (widen))
+ (setq rtn (org-scan-tags 'agenda
+ matcher
+ org--matcher-tags-todo-only))
+ (setq rtnall (append rtnall rtn))))))))
+ (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-agenda-structure-filter))
+ (setq pos (point))
+ (unless org-agenda-multi
+ (insert (substitute-command-keys
+ "Press \
+\\<org-agenda-mode-map>`\\[universal-argument] \\[org-agenda-redo]' \
+to search again\n")))
+ (add-text-properties pos (1- (point))
+ (list 'face 'org-agenda-structure-secondary))
+ (buffer-string)))
+ (org-agenda-mark-header-line (point-min))
+ (when rtnall
+ (insert (org-agenda-finalize-entries rtnall 'tags) "\n"))
+ (goto-char (point-min))
+ (or org-agenda-multi (org-agenda-fit-window-to-buffer))
+ (add-text-properties
+ (point-min) (point-max)
+ `(org-agenda-type tags
+ org-last-args (,org--matcher-tags-todo-only ,match)
+ org-redo-cmd ,org-agenda-redo-command
+ org-series-cmd ,org-cmd))
+ (org-agenda-finalize)
+ (setq buffer-read-only t))))
+
+;;; Agenda Finding stuck projects
+
+(defvar org-agenda-skip-regexp nil
+ "Regular expression used in skipping subtrees for the agenda.
+This is basically a temporary global variable that can be set and then
+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.
+If an empty string, no header will be inserted. If any other
+string, it will be inserted as a header. If a function, insert
+the string returned by the function 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.
+See `org-agenda-skip-if' for details."
+ (org-agenda-skip-if nil conditions))
+
+(defun org-agenda-skip-subtree-if (&rest conditions)
+ "Skip subtree if any of CONDITIONS is true.
+See `org-agenda-skip-if' for details."
+ (org-agenda-skip-if t conditions))
+
+(defun org-agenda-skip-if (subtree conditions)
+ "Check current entity for CONDITIONS.
+If SUBTREE is non-nil, the entire subtree is checked. Otherwise, only
+the entry (i.e. the text before the next heading) is checked.
+
+CONDITIONS is a list of symbols, boolean OR is used to combine the results
+from different tests. Valid conditions are:
+
+scheduled Check if there is a scheduled cookie
+notscheduled Check if there is no scheduled cookie
+deadline Check if there is a deadline
+notdeadline Check if there is no deadline
+timestamp Check if there is a timestamp (also deadline or scheduled)
+nottimestamp Check if there is no timestamp (also deadline or scheduled)
+regexp Check if regexp matches
+notregexp Check if regexp does not match.
+todo Check if TODO keyword matches
+nottodo Check if TODO keyword does not match
+
+The regexp is taken from the conditions list, it must come right after
+the `regexp' or `notregexp' element.
+
+`todo' and `nottodo' accept as an argument a list of todo
+keywords, which may include \"*\" to match any todo keyword.
+
+ (org-agenda-skip-entry-if \\='todo \\='(\"TODO\" \"WAITING\"))
+
+would skip all entries with \"TODO\" or \"WAITING\" keywords.
+
+Instead of a list, a keyword class may be given. For example:
+
+ (org-agenda-skip-entry-if \\='nottodo \\='done)
+
+would skip entries that haven't been marked with any of \"DONE\"
+keywords. Possible classes are: `todo', `done', `any'.
+
+If any of these conditions is met, this function returns the end point of
+the entity, causing the search to continue from there. This is a function
+that can be put into `org-agenda-skip-function' for the duration of a command."
+ (org-back-to-heading t)
+ (let* (;; (beg (point))
+ (end (if subtree (save-excursion (org-end-of-subtree t) (point))
+ (org-entry-end-position)))
+ (planning-end (if subtree end (line-end-position 2)))
+ m)
+ (and
+ (or (and (memq 'scheduled conditions)
+ (re-search-forward org-scheduled-time-regexp planning-end t))
+ (and (memq 'notscheduled conditions)
+ (not
+ (save-excursion
+ (re-search-forward org-scheduled-time-regexp planning-end t))))
+ (and (memq 'deadline conditions)
+ (re-search-forward org-deadline-time-regexp planning-end t))
+ (and (memq 'notdeadline conditions)
+ (not
+ (save-excursion
+ (re-search-forward org-deadline-time-regexp planning-end t))))
+ (and (memq 'timestamp conditions)
+ (re-search-forward org-ts-regexp end t))
+ (and (memq 'nottimestamp conditions)
+ (not (save-excursion (re-search-forward org-ts-regexp end t))))
+ (and (setq m (memq 'regexp conditions))
+ (stringp (nth 1 m))
+ (re-search-forward (nth 1 m) end t))
+ (and (setq m (memq 'notregexp conditions))
+ (stringp (nth 1 m))
+ (not (save-excursion (re-search-forward (nth 1 m) end t))))
+ (and (or
+ (setq m (memq 'nottodo conditions))
+ (setq m (memq 'todo-unblocked conditions))
+ (setq m (memq 'nottodo-unblocked conditions))
+ (setq m (memq 'todo conditions)))
+ (org-agenda-skip-if-todo m end)))
+ end)))
+
+(defun org-agenda-skip-if-todo (args end)
+ "Helper function for `org-agenda-skip-if', do not use it directly.
+ARGS is a list with first element either `todo', `nottodo',
+`todo-unblocked' or `nottodo-unblocked'. The remainder is either
+a list of TODO keywords, or a state symbol `todo' or `done' or
+`any'."
+ (let ((todo-re
+ (concat "^\\*+[ \t]+"
+ (regexp-opt
+ (pcase args
+ (`(,_ todo)
+ (org-delete-all org-done-keywords
+ (copy-sequence org-todo-keywords-1)))
+ (`(,_ done) org-done-keywords)
+ (`(,_ any) org-todo-keywords-1)
+ (`(,_ ,(pred atom))
+ (error "Invalid TODO class or type: %S" args))
+ (`(,_ ,(pred (member "*"))) org-todo-keywords-1)
+ (`(,_ ,todo-list) todo-list))
+ 'words))))
+ (pcase args
+ (`(todo . ,_)
+ (let (case-fold-search) (re-search-forward todo-re end t)))
+ (`(nottodo . ,_)
+ (not (let (case-fold-search) (re-search-forward todo-re end t))))
+ (`(todo-unblocked . ,_)
+ (catch :unblocked
+ (while (let (case-fold-search) (re-search-forward todo-re end t))
+ (when (org-entry-blocked-p) (throw :unblocked t)))
+ nil))
+ (`(nottodo-unblocked . ,_)
+ (catch :unblocked
+ (while (let (case-fold-search) (re-search-forward todo-re end t))
+ (when (org-entry-blocked-p) (throw :unblocked nil)))
+ t))
+ (`(,type . ,_) (error "Unknown TODO skip type: %S" type)))))
+
+;;;###autoload
+(defun org-agenda-list-stuck-projects (&rest _ignore)
+ "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'."
+ (interactive)
+ (let* ((org-agenda-overriding-header
+ (or org-agenda-overriding-header "List of stuck projects: "))
+ (matcher (nth 0 org-stuck-projects))
+ (todo (nth 1 org-stuck-projects))
+ (tags (nth 2 org-stuck-projects))
+ (gen-re (org-string-nw-p (nth 3 org-stuck-projects)))
+ (todo-wds
+ (if (not (member "*" todo)) todo
+ (org-agenda-prepare-buffers (org-agenda-files nil 'ifmode))
+ (org-delete-all org-done-keywords-for-agenda
+ (copy-sequence org-todo-keywords-for-agenda))))
+ (todo-re (and todo
+ (format "^\\*+[ \t]+\\(%s\\)\\>"
+ (mapconcat #'identity todo-wds "\\|"))))
+ (tags-re (cond ((null tags) nil)
+ ((member "*" tags) org-tag-line-re)
+ (tags
+ (let ((other-tags (format "\\(?:%s:\\)*" org-tag-re)))
+ (concat org-outline-regexp-bol
+ ".*?[ \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
+ (if (null re-list)
+ (error "Missing information to identify unstuck projects")
+ (mapconcat #'identity re-list "\\|")))
+ (org-agenda-skip-function
+ ;; Skip entry if `org-agenda-skip-regexp' matches anywhere
+ ;; in the subtree.
+ (lambda ()
+ (and (save-excursion
+ (let ((case-fold-search nil))
+ (re-search-forward
+ skip-re (save-excursion (org-end-of-subtree t)) t)))
+ (progn (outline-next-heading) (point))))))
+ (org-tags-view nil matcher)
+ (setq org-agenda-buffer-name (buffer-name))
+ (with-current-buffer org-agenda-buffer-name
+ (setq org-agenda-redo-command
+ `(org-agenda-list-stuck-projects ,current-prefix-arg))
+ (let ((inhibit-read-only t))
+ (add-text-properties
+ (point-min) (point-max)
+ `(org-redo-cmd ,org-agenda-redo-command))))))
+
+;;; Diary integration
+
+(defvar org-disable-agenda-to-diary nil) ;Dynamically-scoped param.
+(defvar diary-list-entries-hook)
+(defvar diary-time-regexp)
+(defvar diary-modify-entry-list-string-function)
+(defvar diary-file-name-prefix)
+(defvar diary-display-function)
+
+(defun org-get-entries-from-diary (date)
+ "Get the (Emacs Calendar) diary entries for DATE."
+ (require 'diary-lib)
+ (declare-function diary-fancy-display "diary-lib" ())
+ (let* ((diary-fancy-buffer "*temporary-fancy-diary-buffer*")
+ (diary-display-function #'diary-fancy-display)
+ (pop-up-frames nil)
+ (diary-list-entries-hook
+ (cons 'org-diary-default-entry diary-list-entries-hook))
+ (diary-file-name-prefix nil) ; turn this feature off
+ (diary-modify-entry-list-string-function
+ #'org-modify-diary-entry-string)
+ (diary-time-regexp (concat "^" diary-time-regexp))
+ entries
+ (org-disable-agenda-to-diary t))
+ (save-excursion
+ (save-window-excursion
+ (diary-list-entries date 1)))
+ (if (not (get-buffer diary-fancy-buffer))
+ (setq entries nil)
+ (with-current-buffer diary-fancy-buffer
+ (setq buffer-read-only nil)
+ (if (zerop (buffer-size))
+ ;; No entries
+ (setq entries nil)
+ ;; Omit the date and other unnecessary stuff
+ (org-agenda-cleanup-fancy-diary)
+ ;; Add prefix to each line and extend the text properties
+ (if (zerop (buffer-size))
+ (setq entries nil)
+ (setq entries (buffer-substring (point-min) (- (point-max) 1)))
+ (setq entries
+ (with-temp-buffer
+ (insert entries) (goto-char (point-min))
+ (while (re-search-forward "\n[ \t]+\\(.+\\)$" nil t)
+ (unless (save-match-data (string-match diary-time-regexp (match-string 1)))
+ (replace-match (concat "; " (match-string 1)))))
+ (buffer-string)))))
+ (set-buffer-modified-p nil)
+ (kill-buffer diary-fancy-buffer)))
+ (when entries
+ (setq entries (org-split-string entries "\n"))
+ (setq entries
+ (mapcar
+ (lambda (x)
+ (setq x (org-agenda-format-item "" x nil "Diary" nil 'time))
+ ;; Extend the text properties to the beginning of the line
+ (org-add-props x (text-properties-at (1- (length x)) x)
+ 'type "diary" 'date date 'face 'org-agenda-diary))
+ entries)))))
+
+(defvar org-agenda-cleanup-fancy-diary-hook nil
+ "Hook run when the fancy diary buffer is cleaned up.")
+
+(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."
+ (goto-char (point-min))
+ (if (looking-at ".*?:[ \t]*")
+ (progn
+ (replace-match "")
+ (re-search-forward "\n=+$" nil t)
+ (replace-match "")
+ (while (re-search-backward "^ +\n?" nil t) (replace-match "")))
+ (re-search-forward "\n=+$" nil t)
+ (delete-region (point-min) (min (point-max) (1+ (match-end 0)))))
+ (goto-char (point-min))
+ (while (re-search-forward "^ +\n" nil t)
+ (replace-match ""))
+ (goto-char (point-min))
+ (when (re-search-forward "^Org mode dummy\n?" nil t)
+ (replace-match ""))
+ (run-hooks 'org-agenda-cleanup-fancy-diary-hook))
+
+(defun org-modify-diary-entry-string (string)
+ "Add text properties to string, allowing Org to act on it."
+ (org-add-props string nil
+ 'mouse-face 'highlight
+ 'help-echo (if buffer-file-name
+ (format "mouse-2 or RET jump to diary file %s"
+ (abbreviate-file-name buffer-file-name))
+ "")
+ 'org-agenda-diary-link t
+ 'org-marker (org-agenda-new-marker (point-at-bol))))
+
+(defun org-diary-default-entry ()
+ "Add a dummy entry to the diary.
+Needed to avoid empty dates which mess up holiday display."
+ ;; Catch the error if dealing with the new add-to-diary-alist
+ (when org-disable-agenda-to-diary
+ (diary-add-to-list original-date "Org mode dummy" "")))
+
+(defvar org-diary-last-run-time nil)
+
+;;;###autoload
+(defun org-diary (&rest args)
+ "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."
+ (with-no-warnings (defvar date) (defvar entry))
+ (when (> (- (float-time)
+ org-agenda-last-marker-time)
+ 5)
+ ;; I am not sure if this works with sticky agendas, because the marker
+ ;; list is then no longer a global variable.
+ (org-agenda-reset-markers))
+ (org-compile-prefix-format 'agenda)
+ (org-set-sorting-strategy 'agenda)
+ (setq args (or args org-agenda-entry-types))
+ (let* ((files (if (and entry (stringp entry) (string-match "\\S-" entry))
+ (list entry)
+ (org-agenda-files t)))
+ (time (float-time))
+ file rtn results)
+ (when (or (not org-diary-last-run-time)
+ (> (- time
+ org-diary-last-run-time)
+ 3))
+ (org-agenda-prepare-buffers files))
+ (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.
+ (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)))
+ (when results
+ (setq results
+ (mapcar (lambda (i) (replace-regexp-in-string
+ org-link-bracket-re "\\2" i))
+ results))
+ (concat (org-agenda-finalize-entries results) "\n"))))
+
+;;; Agenda entry finders
+
+(defun org-agenda--timestamp-to-absolute (&rest args)
+ "Call `org-time-string-to-absolute' with ARGS.
+However, throw `:skip' whenever an error is raised."
+ (condition-case e
+ (apply #'org-time-string-to-absolute args)
+ (org-diary-sexp-no-match (throw :skip nil))
+ (error
+ (message "%s; Skipping entry" (error-message-string e))
+ (throw :skip nil))))
+
+(defun org-agenda-get-day-entries (file date &rest args)
+ "Does the work for `org-diary' and `org-agenda'.
+FILE is the path to a file to be checked for entries. DATE is date like
+the one returned by `calendar-current-date'. ARGS are symbols indicating
+which kind of entries should be extracted. For details about these, see
+the documentation of `org-diary'."
+ (let* ((org-startup-folded nil)
+ (org-startup-align-all-tables nil)
+ (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, signal it in diary nonetheless.
+ (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))
+ (setq org-agenda-buffer (or org-agenda-buffer buffer))
+ (setf org-agenda-current-date date)
+ (save-excursion
+ (save-restriction
+ (if (eq buffer org-agenda-restrict)
+ (narrow-to-region org-agenda-restrict-begin
+ org-agenda-restrict-end)
+ (widen))
+ ;; Rationalize ARGS. Also make sure `:deadline' comes
+ ;; first in order to populate DEADLINES before passing it.
+ ;;
+ ;; We use `delq' since `org-uniquify' duplicates ARGS,
+ ;; guarding us from modifying `org-agenda-entry-types'.
+ (setf args (org-uniquify (or args org-agenda-entry-types)))
+ (when (and (memq :scheduled args) (memq :scheduled* args))
+ (setf args (delq :scheduled* args)))
+ (cond
+ ((memq :deadline args)
+ (setf args (cons :deadline
+ (delq :deadline (delq :deadline* args)))))
+ ((memq :deadline* args)
+ (setf args (cons :deadline* (delq :deadline* args)))))
+ ;; Collect list of headlines. Return them flattened.
+ (let ((case-fold-search nil) results deadlines)
+ (org-dlet
+ ((date date))
+ (dolist (arg args (apply #'nconc (nreverse results)))
+ (pcase arg
+ ((and :todo (guard (org-agenda-today-p date)))
+ (push (org-agenda-get-todos) results))
+ (:timestamp
+ (push (org-agenda-get-blocks) results)
+ (push (org-agenda-get-timestamps deadlines) results))
+ (:sexp
+ (push (org-agenda-get-sexps) results))
+ (:scheduled
+ (push (org-agenda-get-scheduled deadlines) results))
+ (:scheduled*
+ (push (org-agenda-get-scheduled deadlines t) results))
+ (:closed
+ (push (org-agenda-get-progress) results))
+ (:deadline
+ (setf deadlines (org-agenda-get-deadlines))
+ (push deadlines results))
+ (:deadline*
+ (setf deadlines (org-agenda-get-deadlines t))
+ (push deadlines results))))))))))))
+
+(defsubst org-em (x y list)
+ "Is X or Y a member of LIST?"
+ (or (memq x list) (memq y list)))
+
+(defvar org-heading-keyword-regexp-format) ; defined in org.el
+(defvar org-agenda-sorting-strategy-selected nil)
+
+(defun org-agenda-entry-get-agenda-timestamp (pom)
+ "Retrieve timestamp information for sorting agenda views.
+Given a point or marker POM, returns a cons cell of the timestamp
+and the timestamp type relevant for the sorting strategy in
+`org-agenda-sorting-strategy-selected'."
+ (let (ts ts-date-type)
+ (save-match-data
+ (cond ((org-em 'scheduled-up 'scheduled-down
+ org-agenda-sorting-strategy-selected)
+ (setq ts (org-entry-get pom "SCHEDULED")
+ ts-date-type " scheduled"))
+ ((org-em 'deadline-up 'deadline-down
+ org-agenda-sorting-strategy-selected)
+ (setq ts (org-entry-get pom "DEADLINE")
+ ts-date-type " deadline"))
+ ((org-em 'ts-up 'ts-down
+ org-agenda-sorting-strategy-selected)
+ (setq ts (org-entry-get pom "TIMESTAMP")
+ ts-date-type " timestamp"))
+ ((org-em 'tsia-up 'tsia-down
+ org-agenda-sorting-strategy-selected)
+ (setq ts (org-entry-get pom "TIMESTAMP_IA")
+ ts-date-type " timestamp_ia"))
+ ((org-em 'timestamp-up 'timestamp-down
+ org-agenda-sorting-strategy-selected)
+ (setq ts (or (org-entry-get pom "SCHEDULED")
+ (org-entry-get pom "DEADLINE")
+ (org-entry-get pom "TIMESTAMP")
+ (org-entry-get pom "TIMESTAMP_IA"))
+ ts-date-type ""))
+ (t (setq ts-date-type "")))
+ (cons (when ts (ignore-errors (org-time-string-to-absolute ts)))
+ ts-date-type))))
+
+(defun org-agenda-get-todos ()
+ "Return the TODO information for agenda display."
+ (let* ((props (list 'face nil
+ 'done-face 'org-agenda-done
+ 'org-not-done-regexp org-not-done-regexp
+ 'org-todo-regexp org-todo-regexp
+ 'org-complex-heading-regexp org-complex-heading-regexp
+ 'mouse-face 'highlight
+ 'help-echo
+ (format "mouse-2 or RET jump to org file %s"
+ (abbreviate-file-name buffer-file-name))))
+ (case-fold-search nil)
+ (regexp (format org-heading-keyword-regexp-format
+ (cond
+ ((and org-select-this-todo-keyword
+ (equal org-select-this-todo-keyword "*"))
+ org-todo-regexp)
+ (org-select-this-todo-keyword
+ (concat "\\("
+ (mapconcat #'identity
+ (org-split-string
+ org-select-this-todo-keyword
+ "|")
+ "\\|")
+ "\\)"))
+ (t org-not-done-regexp))))
+ marker priority category level tags todo-state
+ ts-date ts-date-type ts-date-pair
+ ee txt beg end inherited-tags todo-state-end-pos)
+ (goto-char (point-min))
+ (while (re-search-forward regexp nil t)
+ (catch :skip
+ (save-match-data
+ (beginning-of-line)
+ (org-agenda-skip)
+ (setq beg (point) end (save-excursion (outline-next-heading) (point)))
+ (unless (and (setq todo-state (org-get-todo-state))
+ (setq todo-state-end-pos (match-end 2)))
+ (goto-char end)
+ (throw :skip nil))
+ (when (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item end)
+ (goto-char (1+ beg))
+ (or org-agenda-todo-list-sublevels (org-end-of-subtree 'invisible))
+ (throw :skip nil)))
+ (goto-char (match-beginning 2))
+ (setq marker (org-agenda-new-marker (match-beginning 0))
+ category (org-get-category)
+ ts-date-pair (org-agenda-entry-get-agenda-timestamp (point))
+ ts-date (car ts-date-pair)
+ ts-date-type (cdr ts-date-pair)
+ txt (org-trim (buffer-substring (match-beginning 2) (match-end 0)))
+ inherited-tags
+ (or (eq org-agenda-show-inherited-tags 'always)
+ (and (listp org-agenda-show-inherited-tags)
+ (memq 'todo org-agenda-show-inherited-tags))
+ (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 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)))
+ (org-add-props txt props
+ 'org-marker marker 'org-hd-marker marker
+ 'priority priority
+ 'level level
+ 'ts-date ts-date
+ 'type (concat "todo" ts-date-type) 'todo-state todo-state)
+ (push txt ee)
+ (if org-agenda-todo-list-sublevels
+ (goto-char todo-state-end-pos)
+ (org-end-of-subtree 'invisible))))
+ (nreverse ee)))
+
+(defun org-agenda-todo-custom-ignore-p (time n)
+ "Check whether timestamp is farther away than n number of days.
+This function is invoked if `org-agenda-todo-ignore-deadlines',
+`org-agenda-todo-ignore-scheduled' or
+`org-agenda-todo-ignore-timestamp' is set to an integer."
+ (let ((days (org-time-stamp-to-now
+ time org-agenda-todo-ignore-time-comparison-use-seconds)))
+ (if (>= n 0)
+ (>= days n)
+ (<= days n))))
+
+;;;###autoload
+(defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
+ (&optional end)
+ "Do we have a reason to ignore this TODO entry because it has a time stamp?"
+ (when (or org-agenda-todo-ignore-with-date
+ org-agenda-todo-ignore-scheduled
+ org-agenda-todo-ignore-deadlines
+ org-agenda-todo-ignore-timestamp)
+ (setq end (or end (save-excursion (outline-next-heading) (point))))
+ (save-excursion
+ (or (and org-agenda-todo-ignore-with-date
+ (re-search-forward org-ts-regexp end t))
+ (and org-agenda-todo-ignore-scheduled
+ (re-search-forward org-scheduled-time-regexp end t)
+ (cond
+ ((eq org-agenda-todo-ignore-scheduled 'future)
+ (> (org-time-stamp-to-now
+ (match-string 1) org-agenda-todo-ignore-time-comparison-use-seconds)
+ 0))
+ ((eq org-agenda-todo-ignore-scheduled 'past)
+ (<= (org-time-stamp-to-now
+ (match-string 1) org-agenda-todo-ignore-time-comparison-use-seconds)
+ 0))
+ ((numberp org-agenda-todo-ignore-scheduled)
+ (org-agenda-todo-custom-ignore-p
+ (match-string 1) org-agenda-todo-ignore-scheduled))
+ (t)))
+ (and org-agenda-todo-ignore-deadlines
+ (re-search-forward org-deadline-time-regexp end t)
+ (cond
+ ((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)
+ (> (org-time-stamp-to-now
+ (match-string 1) org-agenda-todo-ignore-time-comparison-use-seconds)
+ 0))
+ ((eq org-agenda-todo-ignore-deadlines 'past)
+ (<= (org-time-stamp-to-now
+ (match-string 1) org-agenda-todo-ignore-time-comparison-use-seconds)
+ 0))
+ ((numberp org-agenda-todo-ignore-deadlines)
+ (org-agenda-todo-custom-ignore-p
+ (match-string 1) org-agenda-todo-ignore-deadlines))
+ (t (org-deadline-close-p (match-string 1)))))
+ (and org-agenda-todo-ignore-timestamp
+ (let ((buffer (current-buffer))
+ (regexp
+ (concat
+ org-scheduled-time-regexp "\\|" org-deadline-time-regexp))
+ (start (point)))
+ ;; Copy current buffer into a temporary one
+ (with-temp-buffer
+ (insert-buffer-substring buffer start end)
+ (goto-char (point-min))
+ ;; Delete SCHEDULED and DEADLINE items
+ (while (re-search-forward regexp end t)
+ (delete-region (match-beginning 0) (match-end 0)))
+ (goto-char (point-min))
+ ;; No search for timestamp left
+ (when (re-search-forward org-ts-regexp nil t)
+ (cond
+ ((eq org-agenda-todo-ignore-timestamp 'future)
+ (> (org-time-stamp-to-now
+ (match-string 1) org-agenda-todo-ignore-time-comparison-use-seconds)
+ 0))
+ ((eq org-agenda-todo-ignore-timestamp 'past)
+ (<= (org-time-stamp-to-now
+ (match-string 1) org-agenda-todo-ignore-time-comparison-use-seconds)
+ 0))
+ ((numberp org-agenda-todo-ignore-timestamp)
+ (org-agenda-todo-custom-ignore-p
+ (match-string 1) org-agenda-todo-ignore-timestamp))
+ (t))))))))))
+
+(defun org-agenda-get-timestamps (&optional deadlines)
+ "Return the date stamp information for agenda display.
+Optional argument DEADLINES is a list of deadline items to be
+displayed in agenda view."
+ (with-no-warnings (defvar date))
+ (let* ((props (list 'face 'org-agenda-calendar-event
+ 'org-not-done-regexp org-not-done-regexp
+ 'org-todo-regexp org-todo-regexp
+ 'org-complex-heading-regexp org-complex-heading-regexp
+ 'mouse-face 'highlight
+ 'help-echo
+ (format "mouse-2 or RET jump to Org file %s"
+ (abbreviate-file-name buffer-file-name))))
+ (current (calendar-absolute-from-gregorian date))
+ (today (org-today))
+ (deadline-position-alist
+ (mapcar (lambda (d)
+ (let ((m (get-text-property 0 'org-hd-marker d)))
+ (and m (marker-position m))))
+ deadlines))
+ ;; Match time-stamps set to current date, time-stamps with
+ ;; a repeater, and S-exp time-stamps.
+ (regexp
+ (concat
+ (if org-agenda-include-inactive-timestamps "[[<]" "<")
+ (regexp-quote
+ (substring
+ (format-time-string
+ (car org-time-stamp-formats)
+ (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]+)\\)>\\)"))
+ timestamp-items)
+ (goto-char (point-min))
+ (while (re-search-forward regexp nil t)
+ ;; Skip date ranges, scheduled and deadlines, which are handled
+ ;; specially. Also skip time-stamps before first headline as
+ ;; there would be no entry to add to the agenda. Eventually,
+ ;; ignore clock entries.
+ (catch :skip
+ (save-match-data
+ (when (or (org-at-date-range-p)
+ (org-at-planning-p)
+ (org-before-first-heading-p)
+ (and org-agenda-include-inactive-timestamps
+ (org-at-clock-log-p)))
+ (throw :skip nil))
+ (org-agenda-skip))
+ (let* ((pos (match-beginning 0))
+ (repeat (match-string 1))
+ (sexp-entry (match-string 3))
+ (time-stamp (if (or repeat sexp-entry) (match-string 0)
+ (save-excursion
+ (goto-char pos)
+ (looking-at org-ts-regexp-both)
+ (match-string 0))))
+ (todo-state (org-get-todo-state))
+ (warntime (get-text-property (point) 'org-appt-warntime))
+ (done? (member todo-state org-done-keywords)))
+ ;; Possibly skip done tasks.
+ (when (and done? org-agenda-skip-timestamp-if-done)
+ (throw :skip t))
+ ;; S-exp entry doesn't match current day: skip it.
+ (when (and sexp-entry (not (org-diary-sexp-entry sexp-entry "" date)))
+ (throw :skip nil))
+ (when repeat
+ (let* ((past
+ ;; A repeating time stamp is shown at its base
+ ;; date and every repeated date up to TODAY. If
+ ;; `org-agenda-prefer-last-repeat' is non-nil,
+ ;; however, only the last repeat before today
+ ;; (inclusive) is shown.
+ (org-agenda--timestamp-to-absolute
+ repeat
+ (if (or (> current today)
+ (eq org-agenda-prefer-last-repeat t)
+ (member todo-state org-agenda-prefer-last-repeat))
+ today
+ current)
+ 'past (current-buffer) pos))
+ (future
+ ;; Display every repeated date past TODAY
+ ;; (exclusive) unless
+ ;; `org-agenda-show-future-repeats' is nil. If
+ ;; this variable is set to `next', only display
+ ;; the first repeated date after TODAY
+ ;; (exclusive).
+ (cond
+ ((<= current today) past)
+ ((not org-agenda-show-future-repeats) past)
+ (t
+ (let ((base (if (eq org-agenda-show-future-repeats 'next)
+ (1+ today)
+ current)))
+ (org-agenda--timestamp-to-absolute
+ repeat base 'future (current-buffer) pos))))))
+ (when (and (/= current past) (/= current future))
+ (throw :skip nil))))
+ (save-excursion
+ (re-search-backward org-outline-regexp-bol nil t)
+ ;; Possibly skip time-stamp when a deadline is set.
+ (when (and org-agenda-skip-timestamp-if-deadline-is-shown
+ (assq (point) deadline-position-alist))
+ (throw :skip nil))
+ (let* ((category (org-get-category pos))
+ (inherited-tags
+ (or (eq org-agenda-show-inherited-tags 'always)
+ (and (consp 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)))
+ (level (make-string (org-reduced-level (org-outline-level))
+ ?\s))
+ (head (and (looking-at "\\*+[ \t]+\\(.*\\)")
+ (match-string 1)))
+ (inactive? (= (char-after pos) ?\[))
+ (habit? (and (fboundp 'org-is-habit-p) (org-is-habit-p)))
+ (item
+ (org-agenda-format-item
+ (and inactive? org-agenda-inactive-leader)
+ head level category tags time-stamp org-ts-regexp habit?)))
+ (org-add-props item props
+ 'priority (if habit?
+ (org-habit-get-priority (org-habit-parse-todo))
+ (org-get-priority item))
+ 'org-marker (org-agenda-new-marker pos)
+ 'org-hd-marker (org-agenda-new-marker)
+ 'date date
+ 'level level
+ 'ts-date (if repeat (org-agenda--timestamp-to-absolute repeat)
+ current)
+ 'todo-state todo-state
+ 'warntime warntime
+ 'type "timestamp")
+ (push item timestamp-items))))
+ (when org-agenda-skip-additional-timestamps-same-entry
+ (outline-next-heading))))
+ (nreverse timestamp-items)))
+
+(defun org-agenda-get-sexps ()
+ "Return the sexp information for agenda display."
+ (require 'diary-lib)
+ (with-no-warnings (defvar date) (defvar entry))
+ (let* ((props (list 'face 'org-agenda-calendar-sexp
+ 'mouse-face 'highlight
+ 'help-echo
+ (format "mouse-2 or RET jump to org file %s"
+ (abbreviate-file-name buffer-file-name))))
+ (regexp "^&?%%(")
+ ;; FIXME: Is this `entry' binding intended to be dynamic,
+ ;; so as to "hide" any current binding for it?
+ marker category extra level ee txt tags entry
+ result beg b sexp sexp-entry todo-state warntime inherited-tags)
+ (goto-char (point-min))
+ (while (re-search-forward regexp nil t)
+ (catch :skip
+ (org-agenda-skip)
+ (setq beg (match-beginning 0))
+ (goto-char (1- (match-end 0)))
+ (setq b (point))
+ (forward-sexp 1)
+ (setq sexp (buffer-substring b (point)))
+ (setq sexp-entry (if (looking-at "[ \t]*\\(\\S-.*\\)")
+ (org-trim (match-string 1))
+ ""))
+ (setq result (org-diary-sexp-entry sexp sexp-entry date))
+ (when result
+ (setq marker (org-agenda-new-marker beg)
+ level (make-string (org-reduced-level (org-outline-level)) ? )
+ category (org-get-category beg)
+ 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))
+ todo-state (org-get-todo-state)
+ warntime (get-text-property (point) 'org-appt-warntime)
+ extra nil)
+
+ (dolist (r (if (stringp result)
+ (list result)
+ result)) ;; we expect a list here
+ (when (and org-agenda-diary-sexp-prefix
+ (string-match org-agenda-diary-sexp-prefix r))
+ (setq extra (match-string 0 r)
+ r (replace-match "" nil nil r)))
+ (if (string-match "\\S-" r)
+ (setq txt r)
+ (setq txt "SEXP entry returned empty string"))
+ (setq txt (org-agenda-format-item extra txt level category tags 'time))
+ (org-add-props txt props 'org-marker marker
+ 'date date 'todo-state todo-state
+ 'level level 'type "sexp" 'warntime warntime)
+ (push txt ee)))))
+ (nreverse ee)))
+
+;; Calendar sanity: define some functions that are independent of
+;; `calendar-date-style'.
+(defun org-anniversary (year month day &optional mark)
+ "Like `diary-anniversary', but with fixed (ISO) order of arguments."
+ (with-no-warnings
+ (let ((calendar-date-style 'iso))
+ (diary-anniversary year month day mark))))
+(defun org-cyclic (N year month day &optional mark)
+ "Like `diary-cyclic', but with fixed (ISO) order of arguments."
+ (with-no-warnings
+ (let ((calendar-date-style 'iso))
+ (diary-cyclic N year month day mark))))
+(defun org-block (Y1 M1 D1 Y2 M2 D2 &optional mark)
+ "Like `diary-block', but with fixed (ISO) order of arguments."
+ (with-no-warnings
+ (let ((calendar-date-style 'iso))
+ (diary-block Y1 M1 D1 Y2 M2 D2 mark))))
+(defun org-date (year month day &optional mark)
+ "Like `diary-date', but with fixed (ISO) order of arguments."
+ (with-no-warnings
+ (let ((calendar-date-style 'iso))
+ (diary-date year month day mark))))
+
+;; Define the `org-class' function
+(defun org-class (y1 m1 d1 y2 m2 d2 dayname &rest skip-weeks)
+ "Entry applies if date is between dates on DAYNAME, but skips SKIP-WEEKS.
+DAYNAME is a number between 0 (Sunday) and 6 (Saturday).
+SKIP-WEEKS is any number of ISO weeks in the block period for which the
+item should be skipped. If any of the SKIP-WEEKS arguments is the symbol
+`holidays', then any date that is known by the Emacs calendar to be a
+holiday will also be skipped. If SKIP-WEEKS arguments are holiday strings,
+then those holidays will be skipped."
+ (with-no-warnings (defvar date) (defvar entry))
+ (let* ((date1 (calendar-absolute-from-gregorian (list m1 d1 y1)))
+ (date2 (calendar-absolute-from-gregorian (list m2 d2 y2)))
+ (d (calendar-absolute-from-gregorian date))
+ (h (when skip-weeks (calendar-check-holidays date))))
+ (and
+ (<= date1 d)
+ (<= d date2)
+ (= (calendar-day-of-week date) dayname)
+ (or (not skip-weeks)
+ (progn
+ (require 'cal-iso)
+ (not (member (car (calendar-iso-from-absolute d)) skip-weeks))))
+ (not (or (and h (memq 'holidays skip-weeks))
+ (delq nil (mapcar (lambda(g) (member g skip-weeks)) h))))
+ entry)))
+
+(defalias 'org-get-closed #'org-agenda-get-progress)
+(defun org-agenda-get-progress ()
+ "Return the logged TODO entries for agenda display."
+ (with-no-warnings (defvar date))
+ (let* ((props (list 'mouse-face 'highlight
+ 'org-not-done-regexp org-not-done-regexp
+ '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"
+ (abbreviate-file-name buffer-file-name))))
+ (items (if (consp org-agenda-show-log-scoped)
+ org-agenda-show-log-scoped
+ (if (eq org-agenda-show-log-scoped 'clockcheck)
+ '(clock)
+ org-agenda-log-mode-items)))
+ (parts
+ (delq nil
+ (list
+ (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
+ "\\(" parts-re "\\)"
+ " *\\["
+ (regexp-quote
+ (substring
+ (format-time-string
+ (car org-time-stamp-formats)
+ (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 type
+ statep clockp state ee txt extra timestr rest clocked inherited-tags)
+ (goto-char (point-min))
+ (while (re-search-forward regexp nil t)
+ (catch :skip
+ (org-agenda-skip)
+ (setq marker (org-agenda-new-marker (match-beginning 0))
+ closedp (equal (match-string 1) org-closed-string)
+ statep (equal (string-to-char (match-string 1)) ?-)
+ clockp (not (or closedp statep))
+ state (and statep (match-string 2))
+ category (org-get-category (match-beginning 0))
+ timestr (buffer-substring (match-beginning 0) (point-at-eol)))
+ (when (string-match "\\]" timestr)
+ ;; substring should only run to end of time stamp
+ (setq rest (substring timestr (match-end 0))
+ timestr (substring timestr 0 (match-end 0)))
+ (if (and (not closedp) (not statep)
+ (string-match "\\([0-9]\\{1,2\\}:[0-9]\\{2\\}\\)\\].*?\\([0-9]\\{1,2\\}:[0-9]\\{2\\}\\)"
+ rest))
+ (progn (setq timestr (concat (substring timestr 0 -1)
+ "-" (match-string 1 rest) "]"))
+ (setq clocked (match-string 2 rest)))
+ (setq clocked "-")))
+ (save-excursion
+ (setq extra
+ (cond
+ ((not org-agenda-log-mode-add-notes) nil)
+ (statep
+ (and (looking-at ".*\\\\\n[ \t]*\\([^-\n \t].*?\\)[ \t]*$")
+ (match-string 1)))
+ (clockp
+ (and (looking-at ".*\n[ \t]*-[ \t]+\\([^-\n \t].*?\\)[ \t]*$")
+ (match-string 1)))))
+ (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)
+ inherited-tags
+ (or (eq org-agenda-show-inherited-tags 'always)
+ (and (listp org-agenda-show-inherited-tags)
+ (memq 'todo org-agenda-show-inherited-tags))
+ (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 nil (not inherited-tags))
+ level (make-string (org-reduced-level (org-outline-level)) ? ))
+ (looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
+ (setq txt (match-string 1))
+ (when extra
+ (if (string-match "\\([ \t]+\\)\\(:[^ \n\t]*?:\\)[ \t]*$" txt)
+ (setq txt (concat (substring txt 0 (match-beginning 1))
+ " - " extra " " (match-string 2 txt)))
+ (setq txt (concat txt " - " extra))))
+ (setq txt (org-agenda-format-item
+ (cond
+ (closedp "Closed: ")
+ (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 type 'date date
+ 'undone-face 'org-warning 'done-face 'org-agenda-done)
+ (push txt ee))
+ (goto-char (point-at-eol))))
+ (nreverse ee)))
+
+(defun org-agenda-show-clocking-issues ()
+ "Add overlays, showing issues with clocking.
+See also the user option `org-agenda-clock-consistency-checks'."
+ (interactive)
+ (let* ((pl org-agenda-clock-consistency-checks)
+ (re (concat "^[ \t]*"
+ org-clock-string
+ "[ \t]+"
+ "\\(\\[.*?\\]\\)" ; group 1 is first stamp
+ "\\(-\\{1,3\\}\\(\\[.*?\\]\\)\\)?")) ; group 3 is second
+ (tlstart 0.)
+ (tlend 0.)
+ (maxtime (org-duration-to-minutes
+ (or (plist-get pl :max-duration) "24:00")))
+ (mintime (org-duration-to-minutes
+ (or (plist-get pl :min-duration) 0)))
+ (maxgap (org-duration-to-minutes
+ ;; default 30:00 means never complain
+ (or (plist-get pl :max-gap) "30:00")))
+ (gapok (mapcar #'org-duration-to-minutes
+ (plist-get pl :gap-ok-around)))
+ (def-face (or (plist-get pl :default-face)
+ '((:background "DarkRed") (:foreground "white"))))
+ issue face m te ts dt ov)
+ (goto-char (point-min))
+ (while (re-search-forward " Clocked: +(\\(?:-\\|\\([0-9]+:[0-9]+\\)\\))" nil t)
+ (setq issue nil face def-face)
+ (catch 'next
+ (setq m (org-get-at-bol 'org-marker)
+ te nil ts nil)
+ (unless (and m (markerp m))
+ (setq issue "No valid clock line") (throw 'next t))
+ (org-with-point-at m
+ (save-excursion
+ (goto-char (point-at-bol))
+ (unless (looking-at re)
+ (error "No valid Clock line")
+ (throw 'next t))
+ (unless (match-end 3)
+ (setq issue
+ (format
+ "No end time: (%s)"
+ (org-duration-from-minutes
+ (floor
+ (- (float-time (org-current-time))
+ (float-time (org-time-string-to-time (match-string 1))))
+ 60)))
+ face (or (plist-get pl :no-end-time-face) face))
+ (throw 'next t))
+ (setq ts (match-string 1)
+ te (match-string 3)
+ 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)))
+ 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)))
+ face (or (plist-get pl :short-face) face)))
+ ((and (> tlend 0) (< ts tlend))
+ ;; Two clock entries are overlapping
+ (setq issue (format "Clocking overlap: %d minutes"
+ (/ (- tlend ts) 60))
+ face (or (plist-get pl :overlap-face) face)))
+ ((and (> tlend 0) (> ts (+ tlend (* 60 maxgap))))
+ ;; There is a gap, lets see if we need to report it
+ (unless (org-agenda-check-clock-gap tlend ts gapok)
+ (setq issue (format "Clocking gap: %d minutes"
+ (/ (- ts tlend) 60))
+ face (or (plist-get pl :gap-face) face))))
+ (t nil)))
+ (setq tlend (or te tlend) tlstart (or ts tlstart))
+ (when issue
+ ;; OK, there was some issue, add an overlay to show the issue
+ (setq ov (make-overlay (point-at-bol) (point-at-eol)))
+ (overlay-put ov 'before-string
+ (concat
+ (org-add-props
+ (format "%-43s" (concat " " issue))
+ nil
+ 'face face)
+ "\n"))
+ (overlay-put ov 'evaporate t)))))
+
+(defun org-agenda-check-clock-gap (t1 t2 ok-list)
+ "Check if gap T1 -> T2 contains one of the OK-LIST time-of-day values."
+ (catch 'exit
+ (unless ok-list
+ ;; there are no OK times for gaps...
+ (throw 'exit nil))
+ (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 (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)))))
+ (when (< min2 min1)
+ ;; if min2 is smaller than min1, this means it is on the next day.
+ ;; Wrap it to after midnight.
+ (setq min2 (+ min2 1440)))
+ ;; Now check if any of the OK times is in the gap
+ (mapc (lambda (x)
+ ;; Wrap the time to after midnight if necessary
+ (when (< x min1) (setq x (+ x 1440)))
+ ;; Check if in interval
+ (and (<= min1 x) (>= min2 x) (throw 'exit t)))
+ ok-list)
+ ;; Nope, this gap is not OK
+ nil)))
+
+(defun org-agenda-get-deadlines (&optional with-hour)
+ "Return the deadline information for agenda display.
+When WITH-HOUR is non-nil, only return deadlines with an hour
+specification like [h]h:mm."
+ (with-no-warnings (defvar date))
+ (let* ((props (list 'mouse-face 'highlight
+ 'org-not-done-regexp org-not-done-regexp
+ '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"
+ (abbreviate-file-name buffer-file-name))))
+ (regexp (if with-hour
+ org-deadline-time-hour-regexp
+ org-deadline-time-regexp))
+ (today (org-today))
+ (today? (org-agenda-today-p date)) ; DATE bound by calendar.
+ (current (calendar-absolute-from-gregorian date))
+ deadline-items)
+ (goto-char (point-min))
+ (while (re-search-forward regexp nil t)
+ (catch :skip
+ (unless (save-match-data (org-at-planning-p)) (throw :skip nil))
+ (org-agenda-skip)
+ (let* ((s (match-string 1))
+ (pos (1- (match-beginning 1)))
+ (todo-state (save-match-data (org-get-todo-state)))
+ (done? (member todo-state org-done-keywords))
+ (sexp? (string-prefix-p "%%" s))
+ ;; DEADLINE is the deadline date for the entry. It is
+ ;; either the base date or the last repeat, according
+ ;; to `org-agenda-prefer-last-repeat'.
+ (deadline
+ (cond
+ (sexp? (org-agenda--timestamp-to-absolute s current))
+ ((or (eq org-agenda-prefer-last-repeat t)
+ (member todo-state org-agenda-prefer-last-repeat))
+ (org-agenda--timestamp-to-absolute
+ s today 'past (current-buffer) pos))
+ (t (org-agenda--timestamp-to-absolute s))))
+ ;; REPEAT is the future repeat closest from CURRENT,
+ ;; according to `org-agenda-show-future-repeats'. If
+ ;; the latter is nil, or if the time stamp has no
+ ;; repeat part, default to DEADLINE.
+ (repeat
+ (cond
+ (sexp? deadline)
+ ((<= current today) deadline)
+ ((not org-agenda-show-future-repeats) deadline)
+ (t
+ (let ((base (if (eq org-agenda-show-future-repeats 'next)
+ (1+ today)
+ current)))
+ (org-agenda--timestamp-to-absolute
+ s base 'future (current-buffer) pos)))))
+ (diff (- deadline current))
+ (suppress-prewarning
+ (let ((scheduled
+ (and org-agenda-skip-deadline-prewarning-if-scheduled
+ (org-entry-get nil "SCHEDULED"))))
+ (cond
+ ((not scheduled) nil)
+ ;; The current item has a scheduled date, so
+ ;; evaluate its prewarning lead time.
+ ((integerp org-agenda-skip-deadline-prewarning-if-scheduled)
+ ;; Use global prewarning-restart lead time.
+ org-agenda-skip-deadline-prewarning-if-scheduled)
+ ((eq org-agenda-skip-deadline-prewarning-if-scheduled
+ 'pre-scheduled)
+ ;; Set pre-warning to no earlier than SCHEDULED.
+ (min (- deadline
+ (org-agenda--timestamp-to-absolute scheduled))
+ org-deadline-warning-days))
+ ;; Set pre-warning to deadline.
+ (t 0))))
+ (wdays (or suppress-prewarning (org-get-wdays s))))
+ (cond
+ ;; Only display deadlines at their base date, at future
+ ;; repeat occurrences or in today agenda.
+ ((= current deadline) nil)
+ ((= current repeat) nil)
+ ((not today?) (throw :skip nil))
+ ;; Upcoming deadline: display within warning period WDAYS.
+ ((> deadline current) (when (> diff wdays) (throw :skip nil)))
+ ;; Overdue deadline: warn about it for
+ ;; `org-deadline-past-days' duration.
+ (t (when (< org-deadline-past-days (- diff)) (throw :skip nil))))
+ ;; Possibly skip done tasks.
+ (when (and done?
+ (or org-agenda-skip-deadline-if-done
+ (/= deadline current)))
+ (throw :skip nil))
+ (save-excursion
+ (re-search-backward "^\\*+[ \t]+" nil t)
+ (goto-char (match-end 0))
+ (let* ((category (org-get-category))
+ (level (make-string (org-reduced-level (org-outline-level))
+ ?\s))
+ (head (buffer-substring (point) (line-end-position)))
+ (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)))
+ (time
+ (cond
+ ;; No time of day designation if it is only
+ ;; a reminder.
+ ((and (/= current deadline) (/= current repeat)) nil)
+ ((string-match " \\([012]?[0-9]:[0-9][0-9]\\)" s)
+ (concat (substring s (match-beginning 1)) " "))
+ (t 'time)))
+ (item
+ (org-agenda-format-item
+ ;; Insert appropriate suffixes before deadlines.
+ ;; Those only apply to today agenda.
+ (pcase-let ((`(,now ,future ,past)
+ org-agenda-deadline-leaders))
+ (cond
+ ((and today? (< deadline today)) (format past (- diff)))
+ ((and today? (> deadline today)) (format future diff))
+ (t now)))
+ head level category tags time))
+ (face (org-agenda-deadline-face
+ (- 1 (/ (float diff) (max wdays 1)))))
+ (upcoming? (and today? (> deadline today)))
+ (warntime (get-text-property (point) 'org-appt-warntime)))
+ (org-add-props item props
+ 'org-marker (org-agenda-new-marker pos)
+ 'org-hd-marker (org-agenda-new-marker (line-beginning-position))
+ 'warntime warntime
+ 'level level
+ 'ts-date deadline
+ 'priority
+ ;; Adjust priority to today reminders about deadlines.
+ ;; Overdue deadlines get the highest priority
+ ;; increase, then imminent deadlines and eventually
+ ;; more distant deadlines.
+ (let ((adjust (if today? (- diff) 0)))
+ (+ adjust (org-get-priority item)))
+ 'todo-state todo-state
+ 'type (if upcoming? "upcoming-deadline" "deadline")
+ 'date (if upcoming? date deadline)
+ 'face (if done? 'org-agenda-done face)
+ 'undone-face face
+ 'done-face 'org-agenda-done)
+ (push item deadline-items))))))
+ (nreverse deadline-items)))
+
+(defun org-agenda-deadline-face (fraction)
+ "Return the face to displaying a deadline item.
+FRACTION is what fraction of the head-warning time has passed."
+ (assoc-default fraction org-agenda-deadline-faces #'<=))
+
+(defun org-agenda-get-scheduled (&optional deadlines with-hour)
+ "Return the scheduled information for agenda display.
+Optional argument DEADLINES is a list of deadline items to be
+displayed in agenda view. When WITH-HOUR is non-nil, only return
+scheduled items with an hour specification like [h]h:mm."
+ (with-no-warnings (defvar date))
+ (let* ((props (list 'org-not-done-regexp org-not-done-regexp
+ 'org-todo-regexp org-todo-regexp
+ 'org-complex-heading-regexp org-complex-heading-regexp
+ 'done-face 'org-agenda-done
+ 'mouse-face 'highlight
+ 'help-echo
+ (format "mouse-2 or RET jump to Org file %s"
+ (abbreviate-file-name buffer-file-name))))
+ (regexp (if with-hour
+ org-scheduled-time-hour-regexp
+ org-scheduled-time-regexp))
+ (today (org-today))
+ (todayp (org-agenda-today-p date)) ; DATE bound by calendar.
+ (current (calendar-absolute-from-gregorian date))
+ (deadline-pos
+ (mapcar (lambda (d)
+ (let ((m (get-text-property 0 'org-hd-marker d)))
+ (and m (marker-position m))))
+ deadlines))
+ scheduled-items)
+ (goto-char (point-min))
+ (while (re-search-forward regexp nil t)
+ (catch :skip
+ (unless (save-match-data (org-at-planning-p)) (throw :skip nil))
+ (org-agenda-skip)
+ (let* ((s (match-string 1))
+ (pos (1- (match-beginning 1)))
+ (todo-state (save-match-data (org-get-todo-state)))
+ (donep (member todo-state org-done-keywords))
+ (sexp? (string-prefix-p "%%" s))
+ ;; SCHEDULE is the scheduled date for the entry. It is
+ ;; either the bare date or the last repeat, according
+ ;; to `org-agenda-prefer-last-repeat'.
+ (schedule
+ (cond
+ (sexp? (org-agenda--timestamp-to-absolute s current))
+ ((or (eq org-agenda-prefer-last-repeat t)
+ (member todo-state org-agenda-prefer-last-repeat))
+ (org-agenda--timestamp-to-absolute
+ s today 'past (current-buffer) pos))
+ (t (org-agenda--timestamp-to-absolute s))))
+ ;; REPEAT is the future repeat closest from CURRENT,
+ ;; according to `org-agenda-show-future-repeats'. If
+ ;; the latter is nil, or if the time stamp has no
+ ;; repeat part, default to SCHEDULE.
+ (repeat
+ (cond
+ (sexp? schedule)
+ ((<= current today) schedule)
+ ((not org-agenda-show-future-repeats) schedule)
+ (t
+ (let ((base (if (eq org-agenda-show-future-repeats 'next)
+ (1+ today)
+ current)))
+ (org-agenda--timestamp-to-absolute
+ s base 'future (current-buffer) pos)))))
+ (diff (- current schedule))
+ (warntime (get-text-property (point) 'org-appt-warntime))
+ (pastschedp (< schedule today))
+ (futureschedp (> schedule today))
+ (habitp (and (fboundp 'org-is-habit-p) (org-is-habit-p)))
+ (suppress-delay
+ (let ((deadline (and org-agenda-skip-scheduled-delay-if-deadline
+ (org-entry-get nil "DEADLINE"))))
+ (cond
+ ((not deadline) nil)
+ ;; The current item has a deadline date, so
+ ;; evaluate its delay time.
+ ((integerp org-agenda-skip-scheduled-delay-if-deadline)
+ ;; Use global delay time.
+ (- org-agenda-skip-scheduled-delay-if-deadline))
+ ((eq org-agenda-skip-scheduled-delay-if-deadline
+ 'post-deadline)
+ ;; Set delay to no later than DEADLINE.
+ (min (- schedule
+ (org-agenda--timestamp-to-absolute deadline))
+ org-scheduled-delay-days))
+ (t 0))))
+ (ddays
+ (cond
+ ;; Nullify delay when a repeater triggered already
+ ;; and the delay is of the form --Xd.
+ ((and (string-match-p "--[0-9]+[hdwmy]" s)
+ (> schedule (org-agenda--timestamp-to-absolute s)))
+ 0)
+ (suppress-delay
+ (let ((org-scheduled-delay-days suppress-delay))
+ (org-get-wdays s t t)))
+ (t (org-get-wdays s t)))))
+ ;; Display scheduled items at base date (SCHEDULE), today if
+ ;; scheduled before the current date, and at any repeat past
+ ;; today. However, skip delayed items and items that have
+ ;; been displayed for more than `org-scheduled-past-days'.
+ (unless (and todayp
+ habitp
+ (bound-and-true-p org-habit-show-all-today))
+ (when (or (and (> ddays 0) (< diff ddays))
+ (> diff (or (and habitp org-habit-scheduled-past-days)
+ org-scheduled-past-days))
+ (> schedule current)
+ (and (/= current schedule)
+ (/= current today)
+ (/= current repeat)))
+ (throw :skip nil)))
+ ;; Possibly skip done tasks.
+ (when (and donep
+ (or org-agenda-skip-scheduled-if-done
+ (/= schedule current)))
+ (throw :skip nil))
+ ;; Skip entry if it already appears as a deadline, per
+ ;; `org-agenda-skip-scheduled-if-deadline-is-shown'. This
+ ;; doesn't apply to habits.
+ (when (pcase org-agenda-skip-scheduled-if-deadline-is-shown
+ ((guard
+ (or (not (memq (line-beginning-position 0) deadline-pos))
+ habitp))
+ nil)
+ (`repeated-after-deadline
+ (let ((deadline (time-to-days
+ (org-get-deadline-time (point)))))
+ (and (<= schedule deadline) (> current deadline))))
+ (`not-today pastschedp)
+ (`t t)
+ (_ nil))
+ (throw :skip nil))
+ ;; Skip habits if `org-habit-show-habits' is nil, or if we
+ ;; only show them for today. Also skip done habits.
+ (when (and habitp
+ (or donep
+ (not (bound-and-true-p org-habit-show-habits))
+ (and (not todayp)
+ (bound-and-true-p
+ org-habit-show-habits-only-for-today))))
+ (throw :skip nil))
+ (save-excursion
+ (re-search-backward "^\\*+[ \t]+" nil t)
+ (goto-char (match-end 0))
+ (let* ((category (org-get-category))
+ (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)))
+ (level (make-string (org-reduced-level (org-outline-level))
+ ?\s))
+ (head (buffer-substring (point) (line-end-position)))
+ (time
+ (cond
+ ;; No time of day designation if it is only a
+ ;; reminder, except for habits, which always show
+ ;; the time of day. Habits are an exception
+ ;; because if there is a time of day, that is
+ ;; interpreted to mean they should usually happen
+ ;; then, even if doing the habit was missed.
+ ((and
+ (not habitp)
+ (/= current schedule)
+ (/= current repeat))
+ nil)
+ ((string-match " \\([012]?[0-9]:[0-9][0-9]\\)" s)
+ (concat (substring s (match-beginning 1)) " "))
+ (t 'time)))
+ (item
+ (org-agenda-format-item
+ (pcase-let ((`(,first ,past) org-agenda-scheduled-leaders))
+ ;; Show a reminder of a past scheduled today.
+ (if (and todayp pastschedp)
+ (format past diff)
+ first))
+ head level category tags time nil habitp))
+ (face (cond ((and (not habitp) pastschedp)
+ 'org-scheduled-previously)
+ ((and habitp futureschedp)
+ 'org-agenda-done)
+ (todayp 'org-scheduled-today)
+ (t 'org-scheduled)))
+ (habitp (and habitp (org-habit-parse-todo))))
+ (org-add-props item props
+ 'undone-face face
+ 'face (if donep 'org-agenda-done face)
+ 'org-marker (org-agenda-new-marker pos)
+ 'org-hd-marker (org-agenda-new-marker (line-beginning-position))
+ 'type (if pastschedp "past-scheduled" "scheduled")
+ 'date (if pastschedp schedule date)
+ 'ts-date schedule
+ 'warntime warntime
+ 'level level
+ 'priority (if habitp (org-habit-get-priority habitp)
+ (+ 99 diff (org-get-priority item)))
+ 'org-habit-p habitp
+ 'todo-state todo-state)
+ (push item scheduled-items))))))
+ (nreverse scheduled-items)))
+
+(defun org-agenda-get-blocks ()
+ "Return the date-range information for agenda display."
+ (with-no-warnings (defvar date))
+ (let* ((props (list 'face nil
+ 'org-not-done-regexp org-not-done-regexp
+ 'org-todo-regexp org-todo-regexp
+ 'org-complex-heading-regexp org-complex-heading-regexp
+ 'mouse-face 'highlight
+ 'help-echo
+ (format "mouse-2 or RET jump to org file %s"
+ (abbreviate-file-name buffer-file-name))))
+ (regexp org-tr-regexp)
+ (d0 (calendar-absolute-from-gregorian date))
+ marker hdmarker ee txt d1 d2 s1 s2 category
+ level todo-state tags pos head donep inherited-tags)
+ (goto-char (point-min))
+ (while (re-search-forward regexp nil t)
+ (catch :skip
+ (org-agenda-skip)
+ (setq pos (point))
+ (let ((start-time (match-string 1))
+ (end-time (match-string 2)))
+ (setq s1 (match-string 1)
+ s2 (match-string 2)
+ d1 (time-to-days
+ (condition-case err
+ (org-time-string-to-time s1)
+ (error
+ (error
+ "Bad timestamp %S at %d in buffer %S\nError was: %s"
+ s1
+ pos
+ (current-buffer)
+ (error-message-string err)))))
+ d2 (time-to-days
+ (condition-case err
+ (org-time-string-to-time s2)
+ (error
+ (error
+ "Bad timestamp %S at %d in buffer %S\nError was: %s"
+ s2
+ pos
+ (current-buffer)
+ (error-message-string err))))))
+ (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
+ (save-match-data
+ (let ((hhmm1 (and (string-match org-ts-regexp1 s1)
+ (match-string 6 s1)))
+ (hhmm2 (and (string-match org-ts-regexp1 s2)
+ (match-string 6 s2))))
+ (cond ((string= hhmm1 hhmm2)
+ (concat "<" start-time ">--<" end-time ">"))
+ ((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)))
+
+;;; Agenda presentation and sorting
+
+(defvar org-prefix-has-time nil
+ "A flag, set by `org-compile-prefix-format'.
+The flag is set if the currently compiled format contains a `%t'.")
+(defvar org-prefix-has-tag nil
+ "A flag, set by `org-compile-prefix-format'.
+The flag is set if the currently compiled format contains a `%T'.")
+(defvar org-prefix-has-effort nil
+ "A flag, set by `org-compile-prefix-format'.
+The flag is set if the currently compiled format contains a `%e'.")
+(defvar org-prefix-has-breadcrumbs nil
+ "A flag, set by `org-compile-prefix-format'.
+The flag is set if the currently compiled format contains a `%b'.")
+(defvar org-prefix-category-length nil
+ "Used by `org-compile-prefix-format' to remember the category field width.")
+(defvar org-prefix-category-max-length nil
+ "Used by `org-compile-prefix-format' to remember the category field width.")
+
+(defun org-agenda-get-category-icon (category)
+ "Return an image for CATEGORY according to `org-agenda-category-icon-alist'."
+ (cl-dolist (entry org-agenda-category-icon-alist)
+ (when (string-match-p (car entry) category)
+ (if (listp (cadr entry))
+ (cl-return (cadr entry))
+ (cl-return (apply #'create-image (cdr entry)))))))
+
+(defun org-agenda-format-item (extra txt &optional with-level with-category tags dotime
+ remove-re habitp)
+ "Format TXT to be inserted into the agenda buffer.
+In particular, add the prefix and corresponding text properties.
+
+EXTRA must be a string to replace the `%s' specifier in the prefix format.
+WITH-LEVEL may be a string to replace the `%l' specifier.
+WITH-CATEGORY (a string, a symbol or nil) may be used to overrule the default
+category taken from local variable or file name. It will replace the `%c'
+specifier in the format.
+DOTIME, when non-nil, indicates that a time-of-day should be extracted from
+TXT for sorting of this entry, and for the `%t' specifier in the format.
+When DOTIME is a string, this string is searched for a time before TXT is.
+TAGS can be the tags of the headline.
+Any match of REMOVE-RE will be removed from TXT."
+ ;; We keep the org-prefix-* variable values along with a compiled
+ ;; formatter, so that multiple agendas existing at the same time do
+ ;; not step on each other toes.
+ ;;
+ ;; It was inconvenient to make these variables buffer local in
+ ;; Agenda buffers, because this function expects to be called with
+ ;; the buffer where item comes from being current, and not agenda
+ ;; buffer
+ (let* ((bindings (car org-prefix-format-compiled))
+ (formatter (cadr org-prefix-format-compiled)))
+ (cl-loop for (var value) in bindings
+ do (set var value))
+ (save-match-data
+ ;; Diary entries sometimes have extra whitespace at the beginning
+ (setq txt (org-trim txt))
+
+ ;; Fix the tags part in txt
+ (setq txt (org-agenda-fix-displayed-tags
+ txt tags
+ org-agenda-show-inherited-tags
+ org-agenda-hide-tags-regexp))
+
+ (with-no-warnings
+ ;; `time', `tag', `effort' are needed for the eval of the prefix format.
+ ;; Based on what I see in `org-compile-prefix-format', I added
+ ;; a few more.
+ (defvar breadcrumbs) (defvar category) (defvar category-icon)
+ (defvar effort) (defvar extra)
+ (defvar level) (defvar tag) (defvar time))
+ (let* ((category (or with-category
+ (if buffer-file-name
+ (file-name-sans-extension
+ (file-name-nondirectory buffer-file-name))
+ "")))
+ (category-icon (org-agenda-get-category-icon category))
+ (category-icon (if category-icon
+ (propertize " " 'display category-icon)
+ ""))
+ (effort (and (not (string= txt ""))
+ (get-text-property 1 'effort txt)))
+ (tag (if tags (nth (1- (length tags)) tags) ""))
+ (time-grid-trailing-characters (nth 2 org-agenda-time-grid))
+ (extra (or (and (not habitp) extra) ""))
+ time
+ (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)
+ (and (derived-mode-p 'org-mode) buffer-file-name
+ (add-to-list 'org-agenda-contributing-files buffer-file-name))
+ (when (and dotime time-of-day)
+ ;; Extract starting and ending time and move them to prefix
+ (when (or (setq stamp (string-match org-stamp-time-of-day-regexp ts))
+ (setq plain (string-match org-plain-time-of-day-regexp ts)))
+ (setq s0 (match-string 0 ts)
+ srp (and stamp (match-end 3))
+ s1 (match-string (if plain 1 2) ts)
+ s2 (match-string (if plain 8 (if srp 4 6)) ts))
+
+ ;; 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.
+ (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.
+ (when s1 (setq s1 (org-get-time-of-day s1 t)))
+ (when s2 (setq s2 (org-get-time-of-day s2 t)))
+ ;; Try to set s2 if s1 and
+ ;; `org-agenda-default-appointment-duration' are set
+ (when (and s1 (not s2) org-agenda-default-appointment-duration)
+ (setq s2
+ (org-duration-from-minutes
+ (+ (org-duration-to-minutes s1 t)
+ org-agenda-default-appointment-duration)
+ nil t)))
+ ;; Compute the duration
+ (when s2
+ (setq duration (- (org-duration-to-minutes s2)
+ (org-duration-to-minutes s1))))
+ ;; Format S1 and S2 for display.
+ (when s1 (setq s1 (format "%5s" (org-get-time-of-day s1 'overtime))))
+ (when s2 (setq s2 (org-get-time-of-day s2 'overtime))))
+ (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
+ org-prefix-has-tag))
+ (setq txt (replace-match "" t t txt))
+ (setq txt (replace-match
+ (concat (make-string (max (- 50 (length txt)) 1) ?\ )
+ (match-string 1 txt))
+ t t txt))))
+
+ (when remove-re
+ (while (string-match remove-re txt)
+ (setq txt (replace-match "" t t txt))))
+
+ ;; Set org-heading property on `txt' to mark the start of the
+ ;; heading.
+ (add-text-properties 0 (length txt) '(org-heading t) txt)
+
+ ;; Prepare the variables needed in the eval of the compiled format
+ (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 org-agenda-breadcrumbs-separator)))
+ (if (eq "" s) "" (concat s org-agenda-breadcrumbs-separator))))))
+ (setq time (cond (s2 (concat
+ (org-agenda-time-of-day-to-ampm-maybe s1)
+ "-" (org-agenda-time-of-day-to-ampm-maybe s2)
+ (when org-agenda-timegrid-use-ampm " ")))
+ (s1 (concat
+ (org-agenda-time-of-day-to-ampm-maybe s1)
+ (if org-agenda-timegrid-use-ampm
+ (concat time-grid-trailing-characters " ")
+ time-grid-trailing-characters)))
+ (t ""))
+ category (if (symbolp category) (symbol-name category) category)
+ level (or with-level ""))
+ (if (string-match org-link-bracket-re category)
+ (progn
+ (setq l (string-width (or (match-string 2) (match-string 1))))
+ (when (< l (or org-prefix-category-length 0))
+ (setq category (copy-sequence category))
+ (org-add-props category nil
+ 'extra-space (make-string
+ (- org-prefix-category-length l 1) ?\ ))))
+ (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 t) txt))
+
+ ;; And finally add the text properties
+ (remove-text-properties 0 (length rtn) '(line-prefix t wrap-prefix t) rtn)
+ (org-add-props rtn nil
+ 'org-category category
+ 'tags tags
+ 'org-priority-highest org-priority-highest
+ 'org-priority-lowest org-priority-lowest
+ 'time-of-day time-of-day
+ 'duration duration
+ 'breadcrumbs breadcrumbs
+ 'txt txt
+ 'level level
+ 'time time
+ 'extra extra
+ 'format org-prefix-format-compiled
+ 'dotime dotime)))))
+
+(defun org-agenda-fix-displayed-tags (txt tags add-inherited hide-re)
+ "Remove tags string from TXT, and add a modified list of tags.
+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)
+ (when (string-match org-tag-group-re txt)
+ (setq txt (substring txt 0 (match-beginning 0))))
+ (setq tags
+ (delq nil
+ (mapcar (lambda (tg)
+ (if (or (and hide-re (string-match hide-re tg))
+ (and (not add-inherited)
+ (get-text-property 0 'inherited tg)))
+ nil
+ tg))
+ tags)))
+ (when tags
+ (let ((have-i (get-text-property 0 'inherited (car tags)))
+ i)
+ (setq txt (concat txt " :"
+ (mapconcat
+ (lambda (x)
+ (setq i (get-text-property 0 'inherited x))
+ (if (and have-i (not i))
+ (progn
+ (setq have-i nil)
+ (concat ":" x))
+ x))
+ tags ":")
+ (if have-i "::" ":"))))))
+ txt)
+
+(defvar org-agenda-sorting-strategy) ;; because the def is in a let form
+
+(defun org-agenda-add-time-grid-maybe (list ndays todayp)
+ "Add a time-grid for agenda items which need it.
+
+LIST is the list of agenda items formatted by `org-agenda-list'.
+NDAYS is the span of the current agenda view.
+TODAYP is t when the current agenda view is on today."
+ (catch 'exit
+ (cond ((not org-agenda-use-time-grid) (throw 'exit list))
+ ((and todayp (member 'today (car org-agenda-time-grid))))
+ ((and (= ndays 1) (member 'daily (car org-agenda-time-grid))))
+ ((member 'weekly (car org-agenda-time-grid)))
+ (t (throw 'exit list)))
+ (let* ((have (delq nil (mapcar
+ (lambda (x) (get-text-property 1 'time-of-day x))
+ list)))
+ (string (nth 3 org-agenda-time-grid))
+ (gridtimes (nth 1 org-agenda-time-grid))
+ (req (car org-agenda-time-grid))
+ (remove (member 'remove-match req))
+ new time)
+ (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)))
+ (push (org-agenda-format-item
+ nil string nil "" nil
+ (concat (substring time 0 -2) ":" (substring time -2)))
+ new)
+ (put-text-property
+ 2 (length (car new)) 'face 'org-time-grid (car new))))
+ (when (and todayp org-agenda-show-current-time-in-grid)
+ (push (org-agenda-format-item
+ nil org-agenda-current-time-string nil "" nil
+ (format-time-string "%H:%M "))
+ new)
+ (put-text-property
+ 2 (length (car new)) 'face 'org-agenda-current-time (car new)))
+
+ (if (member 'time-up org-agenda-sorting-strategy-selected)
+ (append new list)
+ (append list new)))))
+
+(defun org-compile-prefix-format (key)
+ "Compile the prefix format into a Lisp form that can be evaluated.
+The resulting form and associated variable bindings is returned
+and stored in the variable `org-prefix-format-compiled'."
+ (setq org-prefix-has-time nil
+ org-prefix-has-tag nil
+ org-prefix-category-length nil
+ org-prefix-has-effort nil
+ org-prefix-has-breadcrumbs nil)
+ (let ((s (cond
+ ((stringp org-agenda-prefix-format)
+ org-agenda-prefix-format)
+ ((assq key org-agenda-prefix-format)
+ (cdr (assq key org-agenda-prefix-format)))
+ (t " %-12:c%?-12t% s")))
+ (start 0)
+ varform vars var c f opt) ;; e
+ (while (string-match "%\\(\\?\\)?\\([-+]?[0-9.]*\\)\\([ .;,:!?=|/<>]?\\)\\([cltseib]\\|(.+?)\\)"
+ s start)
+ (setq var (or (cdr (assoc (match-string 4 s)
+ '(("c" . category) ("t" . time) ("l" . level) ("s" . extra)
+ ("i" . category-icon) ("T" . tag) ("e" . effort) ("b" . breadcrumbs))))
+ 'eval)
+ c (or (match-string 3 s) "")
+ opt (match-beginning 1)
+ start (1+ (match-beginning 0)))
+ (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
+ (and (string-match "\\.[0-9]+" x)
+ (string-to-number (substring (match-string 0 x) 1)))))))
+ (if (eq var 'eval)
+ (setq varform `(format ,f (org-eval ,(read (substring s (match-beginning 4))))))
+ (if opt
+ (setq varform
+ `(if (member ,var '("" nil))
+ ""
+ (format ,f (concat ,var ,c))))
+ (setq varform
+ `(format ,f (if (member ,var '("" nil)) ""
+ (concat ,var ,c (get-text-property 0 'extra-space ,var)))))))
+ (if (eq var 'eval)
+ (setf (substring s (match-beginning 0)
+ (+ (match-beginning 4)
+ (length (format "%S" (read (substring s (match-beginning 4)))))))
+ "%s")
+ (setq s (replace-match "%s" t nil s)))
+ (push varform vars))
+ (setq vars (nreverse vars))
+ (with-current-buffer (or org-agenda-buffer (current-buffer))
+ (setq org-prefix-format-compiled
+ (list
+ `((org-prefix-has-time ,org-prefix-has-time)
+ (org-prefix-has-tag ,org-prefix-has-tag)
+ (org-prefix-category-length ,org-prefix-category-length)
+ (org-prefix-has-effort ,org-prefix-has-effort)
+ (org-prefix-has-breadcrumbs ,org-prefix-has-breadcrumbs))
+ `(format ,s ,@vars))))))
+
+(defun org-set-sorting-strategy (key)
+ (setq org-agenda-sorting-strategy-selected
+ (if (symbolp (car org-agenda-sorting-strategy))
+ ;; the old format
+ org-agenda-sorting-strategy
+ (or (cdr (assq key org-agenda-sorting-strategy))
+ (cdr (assq 'agenda org-agenda-sorting-strategy))
+ '(time-up category-keep priority-down)))))
+
+(defun org-get-time-of-day (s &optional string)
+ "Check string S for a time of day.
+
+If found, return it as a military time number between 0 and 2400.
+If not found, return nil.
+
+The optional STRING argument forces conversion into a 5 character wide string
+HH:MM. When it is `overtime', any time above 24:00 is turned into \"+H:MM\"
+where H:MM is the duration above midnight."
+ (let ((case-fold-search t)
+ (time-regexp
+ (rx word-start
+ (group (opt (any "012")) digit) ;group 1: hours
+ (or (and ":" (group (any "012345") digit) ;group 2: minutes
+ (opt (group (or "am" "pm")))) ;group 3: am/pm
+ ;; Special "HHam/pm" case.
+ (group-n 3 (or "am" "pm")))
+ word-end)))
+ (save-match-data
+ (when (and (string-match time-regexp s)
+ (not (eq 'org-link (get-text-property 1 'face s))))
+ (let ((hours
+ (let* ((ampm (and (match-end 3) (downcase (match-string 3 s))))
+ (am-p (equal ampm "am")))
+ (pcase (string-to-number (match-string 1 s))
+ ((and (guard (not ampm)) h) h)
+ (12 (if am-p 0 12))
+ (h (+ h (if am-p 0 12))))))
+ (minutes
+ (if (match-end 2)
+ (string-to-number (match-string 2 s))
+ 0)))
+ (pcase string
+ (`nil (+ minutes (* hours 100)))
+ ((and `overtime
+ (guard (or (> hours 24)
+ (and (= hours 24)
+ (> minutes 0)))))
+ (format "+%d:%02d" (- hours 24) minutes))
+ ((guard org-agenda-time-leading-zero)
+ (format "%02d:%02d" hours minutes))
+ (_
+ (format "%d:%02d" hours minutes))))))))
+
+(defvar org-agenda-before-sorting-filter-function nil
+ "Function to be applied to agenda items prior to sorting.
+Prior to sorting also means just before they are inserted into the agenda.
+
+To aid sorting, you may revisit the original entries and add more text
+properties which will later be used by the sorting functions.
+
+The function should take a string argument, an agenda line.
+It has access to the text properties in that line, which contain among
+other things, the property `org-hd-marker' that points to the entry
+where the line comes from. Note that not all lines going into the agenda
+have this property, only most.
+
+The function should return the modified string. It is probably best
+to ONLY change text properties.
+
+You can also use this function as a filter, by returning nil for lines
+you don't want to have in the agenda at all. For this application, you
+could bind the variable in the options section of a custom command.")
+
+(defun org-agenda-finalize-entries (list &optional type)
+ "Sort, limit and concatenate the LIST of agenda items.
+The optional argument TYPE tells the agenda type."
+ (let ((max-effort (cond ((listp org-agenda-max-effort)
+ (cdr (assoc type org-agenda-max-effort)))
+ (t org-agenda-max-effort)))
+ (max-todo (cond ((listp org-agenda-max-todos)
+ (cdr (assoc type org-agenda-max-todos)))
+ (t org-agenda-max-todos)))
+ (max-tags (cond ((listp org-agenda-max-tags)
+ (cdr (assoc type org-agenda-max-tags)))
+ (t org-agenda-max-tags)))
+ (max-entries (cond ((listp org-agenda-max-entries)
+ (cdr (assoc type org-agenda-max-entries)))
+ (t org-agenda-max-entries))))
+ (when org-agenda-before-sorting-filter-function
+ (setq list
+ (delq nil
+ (mapcar
+ org-agenda-before-sorting-filter-function list))))
+ (setq list (mapcar #'org-agenda-highlight-todo list)
+ list (mapcar #'identity (sort list #'org-entries-lessp)))
+ (when max-effort
+ (setq list (org-agenda-limit-entries
+ list 'effort-minutes max-effort
+ (lambda (e) (or e (if org-agenda-sort-noeffort-is-high
+ 32767 -1))))))
+ (when max-todo
+ (setq list (org-agenda-limit-entries list 'todo-state max-todo)))
+ (when max-tags
+ (setq list (org-agenda-limit-entries list 'tags max-tags)))
+ (when max-entries
+ (setq list (org-agenda-limit-entries list 'org-hd-marker max-entries)))
+ (when (and org-agenda-dim-blocked-tasks org-blocker-hook)
+ (setq list (mapcar #'org-agenda--mark-blocked-entry list)))
+ (mapconcat #'identity list "\n")))
+
+(defun org-agenda-limit-entries (list prop limit &optional fn)
+ "Limit the number of agenda entries."
+ (let ((include (and limit (< limit 0))))
+ (if limit
+ (let ((fun (or fn (lambda (p) (when p 1))))
+ (lim 0))
+ (delq nil
+ (mapcar
+ (lambda (e)
+ (let ((pval (funcall
+ fun (get-text-property (1- (length e))
+ prop e))))
+ (when pval (setq lim (+ lim pval)))
+ (cond ((and pval (<= lim (abs limit))) e)
+ ((and include (not pval)) e))))
+ list)))
+ list)))
+
+(defun org-agenda-limit-interactively (remove)
+ "In agenda, interactively limit entries to various maximums."
+ (interactive "P")
+ (if remove
+ (progn (setq org-agenda-max-entries nil
+ org-agenda-max-todos nil
+ org-agenda-max-tags nil
+ org-agenda-max-effort nil)
+ (org-agenda-redo))
+ (let* ((max (read-char "Number of [e]ntries [t]odos [T]ags [E]ffort? "))
+ (msg (cond ((= max ?E) "How many minutes? ")
+ ((= max ?e) "How many entries? ")
+ ((= max ?t) "How many TODO entries? ")
+ ((= max ?T) "How many tagged entries? ")
+ (t (user-error "Wrong input"))))
+ (num (string-to-number (read-from-minibuffer msg))))
+ (cond ((equal max ?e)
+ (let ((org-agenda-max-entries num)) (org-agenda-redo)))
+ ((equal max ?t)
+ (let ((org-agenda-max-todos num)) (org-agenda-redo)))
+ ((equal max ?T)
+ (let ((org-agenda-max-tags num)) (org-agenda-redo)))
+ ((equal max ?E)
+ (let ((org-agenda-max-effort num)) (org-agenda-redo))))))
+ (org-agenda-fit-window-to-buffer))
+
+(defun org-agenda-highlight-todo (x)
+ (let ((org-done-keywords org-done-keywords-for-agenda)
+ (case-fold-search nil)
+ re)
+ (if (eq x 'line)
+ (save-excursion
+ (beginning-of-line 1)
+ (setq re (org-get-at-bol 'org-todo-regexp))
+ (goto-char (or (text-property-any (point-at-bol) (point-at-eol) 'org-heading t) (point)))
+ (when (looking-at (concat "[ \t]*\\.*\\(" re "\\) +"))
+ (add-text-properties (match-beginning 0) (match-end 1)
+ (list 'face (org-get-todo-face 1)))
+ (let ((s (buffer-substring (match-beginning 1) (match-end 1))))
+ (delete-region (match-beginning 1) (1- (match-end 0)))
+ (goto-char (match-beginning 1))
+ (insert (format org-agenda-todo-keyword-format s)))))
+ (let ((pl (text-property-any 0 (length x) 'org-heading t x)))
+ (setq re (get-text-property 0 'org-todo-regexp x))
+ (when (and re
+ ;; Test `pl' because if there's no heading content,
+ ;; there's no point matching to highlight. Note
+ ;; that if we didn't test `pl' first, and there
+ ;; happened to be no keyword from `org-todo-regexp'
+ ;; on this heading line, then the `equal' comparison
+ ;; afterwards would spuriously succeed in the case
+ ;; where `pl' is nil -- causing an args-out-of-range
+ ;; error when we try to add text properties to text
+ ;; that isn't there.
+ pl
+ (equal (string-match (concat "\\(\\.*\\)" re "\\( +\\)")
+ x pl)
+ pl))
+ (add-text-properties
+ (or (match-end 1) (match-end 0)) (match-end 0)
+ (list 'face (org-get-todo-face (match-string 2 x)))
+ x)
+ (when (match-end 1)
+ (setq x
+ (concat
+ (substring x 0 (match-end 1))
+ (unless (string= org-agenda-todo-keyword-format "")
+ (format org-agenda-todo-keyword-format
+ (match-string 2 x)))
+ ;; Remove `display' property as the icon could leak
+ ;; on the white space.
+ (org-add-props " " (org-plist-delete (text-properties-at 0 x)
+ 'display))
+ (substring x (match-end 3)))))))
+ x)))
+
+(defsubst org-cmp-values (a b property)
+ "Compare the numeric value of text PROPERTY for string A and B."
+ (let ((pa (or (get-text-property (1- (length a)) property a) 0))
+ (pb (or (get-text-property (1- (length b)) property b) 0)))
+ (cond ((> pa pb) +1)
+ ((< pa pb) -1))))
+
+(defsubst org-cmp-effort (a b)
+ "Compare the effort values of string A and B."
+ (let* ((def (if org-agenda-sort-noeffort-is-high 32767 -1))
+ ;; `effort-minutes' property is not directly accessible from
+ ;; the strings, but is stored as a property in `txt'.
+ (ea (or (get-text-property
+ 0 'effort-minutes (get-text-property 0 'txt a))
+ def))
+ (eb (or (get-text-property
+ 0 'effort-minutes (get-text-property 0 'txt b))
+ def)))
+ (cond ((> ea eb) +1)
+ ((< ea eb) -1))))
+
+(defsubst org-cmp-category (a b)
+ "Compare the string values of categories of strings A and B."
+ (let ((ca (or (get-text-property (1- (length a)) 'org-category a) ""))
+ (cb (or (get-text-property (1- (length b)) 'org-category b) "")))
+ (cond ((string-lessp ca cb) -1)
+ ((string-lessp cb ca) +1))))
+
+(defsubst org-cmp-todo-state (a b)
+ "Compare the todo states of strings A and B."
+ (let* ((ma (or (get-text-property 1 'org-marker a)
+ (get-text-property 1 'org-hd-marker a)))
+ (mb (or (get-text-property 1 'org-marker b)
+ (get-text-property 1 'org-hd-marker b)))
+ (fa (and ma (marker-buffer ma)))
+ (fb (and mb (marker-buffer mb)))
+ (todo-kwds
+ (or (and fa (with-current-buffer fa org-todo-keywords-1))
+ (and fb (with-current-buffer fb org-todo-keywords-1))))
+ (ta (or (get-text-property 1 'todo-state a) ""))
+ (tb (or (get-text-property 1 'todo-state b) ""))
+ (la (- (length (member ta todo-kwds))))
+ (lb (- (length (member tb todo-kwds))))
+ (donepa (member ta org-done-keywords-for-agenda))
+ (donepb (member tb org-done-keywords-for-agenda)))
+ (cond ((and donepa (not donepb)) -1)
+ ((and (not donepa) donepb) +1)
+ ((< la lb) -1)
+ ((< lb la) +1))))
+
+(defsubst org-cmp-alpha (a b)
+ "Compare the headlines, alphabetically."
+ (let* ((pla (text-property-any 0 (length a) 'org-heading t a))
+ (plb (text-property-any 0 (length b) 'org-heading t b))
+ (ta (and pla (substring a pla)))
+ (tb (and plb (substring b plb)))
+ (case-fold-search nil))
+ (when pla
+ (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
+ (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 (or ta tb)) nil)
+ ((not ta) +1)
+ ((not tb) -1)
+ ((string-lessp ta tb) -1)
+ ((string-lessp tb ta) +1))))
+
+(defsubst org-cmp-tag (a b)
+ "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 (or ta tb)) nil)
+ ((not ta) +1)
+ ((not tb) -1)
+ ((string-lessp ta tb) -1)
+ ((string-lessp tb ta) +1))))
+
+(defsubst org-cmp-time (a b)
+ "Compare the time-of-day values of strings A and B."
+ (let* ((def (if org-agenda-sort-notime-is-late 9901 -1))
+ (ta (or (get-text-property 1 'time-of-day a) def))
+ (tb (or (get-text-property 1 'time-of-day b) def)))
+ (cond ((< ta tb) -1)
+ ((< tb ta) +1))))
+
+(defsubst org-cmp-ts (a b type)
+ "Compare the timestamps values of entries A and B.
+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 (and (not org-agenda-sort-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 ((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."
+ (let ((ha (get-text-property 1 'org-habit-p a))
+ (hb (get-text-property 1 'org-habit-p b)))
+ (cond ((and ha (not hb)) -1)
+ ((and (not ha) hb) +1))))
+
+(defun org-entries-lessp (a b)
+ "Predicate for sorting agenda entries."
+ ;; The following variables will be used when the form is evaluated.
+ ;; So even though the compiler complains, keep them.
+ (let ((ss org-agenda-sorting-strategy-selected))
+ (org-dlet
+ ((timestamp-up (and (org-em 'timestamp-up 'timestamp-down ss)
+ (org-cmp-ts a b "")))
+ (timestamp-down (if timestamp-up (- timestamp-up) nil))
+ (scheduled-up (and (org-em 'scheduled-up 'scheduled-down ss)
+ (org-cmp-ts a b "scheduled")))
+ (scheduled-down (if scheduled-up (- scheduled-up) nil))
+ (deadline-up (and (org-em 'deadline-up 'deadline-down ss)
+ (org-cmp-ts a b "deadline")))
+ (deadline-down (if deadline-up (- deadline-up) nil))
+ (tsia-up (and (org-em 'tsia-up 'tsia-down ss)
+ (org-cmp-ts a b "timestamp_ia")))
+ (tsia-down (if tsia-up (- tsia-up) nil))
+ (ts-up (and (org-em 'ts-up 'ts-down ss)
+ (org-cmp-ts a b "timestamp")))
+ (ts-down (if ts-up (- ts-up) nil))
+ (time-up (and (org-em 'time-up 'time-down ss)
+ (org-cmp-time a b)))
+ (time-down (if time-up (- time-up) nil))
+ (stats-up (and (org-em 'stats-up 'stats-down ss)
+ (org-cmp-values a b 'org-stats)))
+ (stats-down (if stats-up (- stats-up) nil))
+ (priority-up (and (org-em 'priority-up 'priority-down ss)
+ (org-cmp-values a b 'priority)))
+ (priority-down (if priority-up (- priority-up) nil))
+ (effort-up (and (org-em 'effort-up 'effort-down ss)
+ (org-cmp-effort a b)))
+ (effort-down (if effort-up (- effort-up) nil))
+ (category-up (and (or (org-em 'category-up 'category-down ss)
+ (memq 'category-keep ss))
+ (org-cmp-category a b)))
+ (category-down (if category-up (- category-up) nil))
+ (category-keep (if category-up +1 nil))
+ (tag-up (and (org-em 'tag-up 'tag-down ss)
+ (org-cmp-tag a b)))
+ (tag-down (if tag-up (- tag-up) nil))
+ (todo-state-up (and (org-em 'todo-state-up 'todo-state-down ss)
+ (org-cmp-todo-state a b)))
+ (todo-state-down (if todo-state-up (- todo-state-up) nil))
+ (habit-up (and (org-em 'habit-up 'habit-down ss)
+ (org-cmp-habit-p a b)))
+ (habit-down (if habit-up (- habit-up) nil))
+ (alpha-up (and (org-em 'alpha-up 'alpha-down ss)
+ (org-cmp-alpha a b)))
+ (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)
+ (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) t)
+ '((-1 . t) (1 . nil) (nil . nil)))))))
+
+;;; Agenda restriction lock
+
+(defvar org-agenda-restriction-lock-overlay (make-overlay 1 1)
+ "Overlay to mark the headline to which agenda commands are restricted.")
+(overlay-put org-agenda-restriction-lock-overlay
+ 'face 'org-agenda-restriction-lock)
+(overlay-put org-agenda-restriction-lock-overlay
+ 'help-echo "Agendas are currently limited to this subtree.")
+(delete-overlay org-agenda-restriction-lock-overlay)
+
+(defun org-agenda-set-restriction-lock-from-agenda (arg)
+ "Set the restriction lock to the agenda item at point from within the agenda.
+When called with a `\\[universal-argument]' prefix, restrict to
+the file which contains the item.
+Argument ARG is the prefix argument."
+ (interactive "P")
+ (unless (derived-mode-p 'org-agenda-mode)
+ (user-error "Not in an Org agenda buffer"))
+ (let* ((marker (or (org-get-at-bol 'org-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer marker))
+ (pos (marker-position marker)))
+ (with-current-buffer buffer
+ (goto-char pos)
+ (org-agenda-set-restriction-lock arg))))
+
+;;;###autoload
+(defun org-agenda-set-restriction-lock (&optional type)
+ "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")
+ (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 agenda restriction lock."
+ (interactive "P")
+ (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."
+ (let ((w (get-buffer-window (or org-agenda-this-buffer-name
+ org-agenda-buffer-name)
+ t))
+ (w0 (selected-window)))
+ (when w
+ (select-window w)
+ (org-agenda-redo)
+ (select-window w0)
+ (if org-agenda-overriding-restriction
+ (message "Agenda view shifted to new %s restriction"
+ org-agenda-overriding-restriction)
+ (message "Agenda restriction lock removed")))))
+
+;;; Agenda commands
+
+(defun org-agenda-check-type (error &rest types)
+ "Check if agenda buffer or component is of allowed type.
+If ERROR is non-nil, throw an error, otherwise just return nil.
+Allowed types are `agenda' `todo' `tags' `search'."
+ (cond ((not org-agenda-type)
+ (error "No Org agenda currently displayed"))
+ ((memq org-agenda-type types) t)
+ (error
+ (error "Not allowed in '%s'-type agenda buffer or component" org-agenda-type))
+ (t nil)))
+
+(defun org-agenda-Quit ()
+ "Exit the agenda, killing the agenda buffer.
+Like `org-agenda-quit', but kill the buffer even when
+`org-agenda-sticky' is non-nil."
+ (interactive)
+ (org-agenda--quit))
+
+(defun org-agenda-quit ()
+ "Exit the agenda.
+
+When `org-agenda-sticky' is non-nil, bury the agenda buffer
+instead of killing it.
+
+When `org-agenda-restore-windows-after-quit' is non-nil, restore
+the pre-agenda window configuration.
+
+When column view is active, exit column view instead of the
+agenda."
+ (interactive)
+ (org-agenda--quit org-agenda-sticky))
+
+(defun org-agenda--quit (&optional bury)
+ (if org-agenda-columns-active
+ (org-columns-quit)
+ (let ((wconf org-agenda-pre-window-conf)
+ (buf (current-buffer))
+ (org-agenda-last-indirect-window
+ (and (eq org-indirect-buffer-display 'other-window)
+ org-agenda-last-indirect-buffer
+ (get-buffer-window org-agenda-last-indirect-buffer))))
+ (cond
+ ((eq org-agenda-window-setup 'other-frame)
+ (delete-frame))
+ ((eq org-agenda-window-setup 'other-tab)
+ (if (fboundp 'tab-bar-close-tab)
+ (tab-bar-close-tab)
+ (user-error "Your version of Emacs does not have tab bar mode support")))
+ ((and org-agenda-restore-windows-after-quit
+ wconf)
+ ;; Maybe restore the pre-agenda window configuration. Reset
+ ;; `org-agenda-pre-window-conf' before running
+ ;; `set-window-configuration', which loses the current buffer.
+ (setq org-agenda-pre-window-conf nil)
+ (set-window-configuration wconf))
+ (t
+ (when org-agenda-last-indirect-window
+ (delete-window org-agenda-last-indirect-window))
+ (and (not (eq org-agenda-window-setup 'current-window))
+ (not (one-window-p))
+ (delete-window))))
+ (if bury
+ ;; Set the agenda buffer as the current buffer instead of
+ ;; passing it as an argument to `bury-buffer' so that
+ ;; `bury-buffer' removes it from the window.
+ (with-current-buffer buf
+ (bury-buffer))
+ (kill-buffer buf)
+ (setq org-agenda-archives-mode nil
+ org-agenda-buffer nil)))))
+
+(defun org-agenda-exit ()
+ "Exit the agenda, killing Org buffers loaded by the agenda.
+Like `org-agenda-Quit', but kill any buffers that were created by
+the agenda. Org buffers visited directly by the user will not be
+touched. Also, exit the agenda even if it is in column view."
+ (interactive)
+ (when org-agenda-columns-active
+ (org-columns-quit))
+ (org-release-buffers org-agenda-new-buffers)
+ (setq org-agenda-new-buffers nil)
+ (org-agenda-Quit))
+
+(defun org-agenda-kill-all-agenda-buffers ()
+ "Kill all buffers in `org-agenda-mode'.
+This is used when toggling sticky agendas."
+ (interactive)
+ (let (blist)
+ (dolist (buf (buffer-list))
+ (when (with-current-buffer buf (eq major-mode 'org-agenda-mode))
+ (push buf blist)))
+ (mapc #'kill-buffer blist)))
+
+(defun org-agenda-execute (arg)
+ "Execute another agenda command, keeping same window.
+So this is just a shortcut for \\<global-map>`\\[org-agenda]', available
+in the agenda."
+ (interactive "P")
+ (let ((org-agenda-window-setup 'current-window))
+ (org-agenda arg)))
+
+(defun org-agenda-redo (&optional all)
+ "Rebuild possibly ALL agenda view(s) in the current buffer."
+ (interactive "P")
+ (defvar org-agenda-tag-filter-while-redo) ;FIXME: Where is this var used?
+ (let* ((p (or (and (looking-at "\\'") (1- (point))) (point)))
+ (cpa (unless (eq all t) current-prefix-arg))
+ (org-agenda-doing-sticky-redo org-agenda-sticky)
+ (org-agenda-sticky nil)
+ (org-agenda-buffer-name (or org-agenda-this-buffer-name
+ org-agenda-buffer-name))
+ (org-agenda-keep-modes t)
+ (tag-filter org-agenda-tag-filter)
+ (tag-preset (get 'org-agenda-tag-filter :preset-filter))
+ (top-hl-filter org-agenda-top-headline-filter)
+ (cat-filter org-agenda-category-filter)
+ (cat-preset (get 'org-agenda-category-filter :preset-filter))
+ (re-filter org-agenda-regexp-filter)
+ (re-preset (get 'org-agenda-regexp-filter :preset-filter))
+ (effort-filter org-agenda-effort-filter)
+ (effort-preset (get 'org-agenda-effort-filter :preset-filter))
+ (org-agenda-tag-filter-while-redo (or tag-filter tag-preset))
+ (cols org-agenda-columns-active)
+ (line (org-current-line))
+ (window-line (- line (org-current-line (window-start))))
+ (lprops (get 'org-agenda-redo-command 'org-lprops))
+ (redo-cmd (get-text-property p 'org-redo-cmd))
+ (last-args (get-text-property p 'org-last-args))
+ (org-agenda-overriding-cmd (get-text-property p 'org-series-cmd))
+ (org-agenda-overriding-cmd-arguments
+ (unless (eq all t)
+ (cond ((listp last-args)
+ (cons (or cpa (car last-args)) (cdr last-args)))
+ ((stringp last-args)
+ last-args))))
+ (series-redo-cmd (get-text-property p 'org-series-redo-cmd)))
+ (put 'org-agenda-tag-filter :preset-filter nil)
+ (put 'org-agenda-category-filter :preset-filter nil)
+ (put 'org-agenda-regexp-filter :preset-filter nil)
+ (put 'org-agenda-effort-filter :preset-filter nil)
+ (and cols (org-columns-quit))
+ (message "Rebuilding agenda buffer...")
+ (if series-redo-cmd
+ (eval series-redo-cmd t)
+ (cl-progv
+ (mapcar #'car lprops)
+ (mapcar (lambda (binding) (eval (cadr binding) t)) lprops)
+ (eval redo-cmd t)))
+ (setq org-agenda-undo-list nil
+ org-agenda-pending-undo-list nil
+ org-agenda-tag-filter tag-filter
+ org-agenda-category-filter cat-filter
+ org-agenda-regexp-filter re-filter
+ org-agenda-effort-filter effort-filter
+ org-agenda-top-headline-filter top-hl-filter)
+ (message "Rebuilding agenda buffer...done")
+ (put 'org-agenda-tag-filter :preset-filter tag-preset)
+ (put 'org-agenda-category-filter :preset-filter cat-preset)
+ (put 'org-agenda-regexp-filter :preset-filter re-preset)
+ (put 'org-agenda-effort-filter :preset-filter effort-preset)
+ (let ((tag (or tag-filter tag-preset))
+ (cat (or cat-filter cat-preset))
+ (effort (or effort-filter effort-preset))
+ (re (or re-filter re-preset)))
+ (when tag (org-agenda-filter-apply tag 'tag t))
+ (when cat (org-agenda-filter-apply cat 'category))
+ (when effort (org-agenda-filter-apply effort 'effort))
+ (when re (org-agenda-filter-apply re 'regexp)))
+ (and top-hl-filter (org-agenda-filter-top-headline-apply top-hl-filter))
+ (and cols (called-interactively-p 'any) (org-agenda-columns))
+ (org-goto-line line)
+ (when (called-interactively-p 'any) (recenter window-line))))
+
+(defun org-agenda-redo-all (&optional exhaustive)
+ "Rebuild all agenda views in the current buffer.
+With a prefix argument, do so in all agenda buffers."
+ (interactive "P")
+ (if exhaustive
+ (dolist (buffer (buffer-list))
+ (with-current-buffer buffer
+ (when (derived-mode-p 'org-agenda-mode)
+ (org-agenda-redo t))))
+ (org-agenda-redo t)))
+
+(defvar org-global-tags-completion-table nil)
+(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.
+With a `\\[universal-argument]' prefix argument, exclude the lines of that category.
+When there is already a category filter in place, this command removes the
+filter."
+ (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))))
+ (cond
+ ((and cat strip)
+ (org-agenda-filter-apply
+ (push (concat "-" cat) org-agenda-category-filter) 'category))
+ (cat
+ (org-agenda-filter-apply
+ (setq org-agenda-category-filter
+ (list (concat "+" cat)))
+ 'category))
+ (t (error "No category at point"))))))
+
+(defun org-find-top-headline (&optional pos)
+ "Find the topmost parent headline and return it.
+POS when non-nil is the marker or buffer position to start the
+search from."
+ (save-excursion
+ (with-current-buffer (if (markerp pos) (marker-buffer pos) (current-buffer))
+ (when pos (goto-char pos))
+ ;; Skip up to the topmost parent.
+ (while (org-up-heading-safe))
+ (ignore-errors
+ (replace-regexp-in-string
+ "^\\[[0-9]+/[0-9]+\\] *\\|^\\[%[0-9]+\\] *" ""
+ (nth 4 (org-heading-components)))))))
+
+(defvar org-agenda-filtered-by-top-headline nil)
+(defun org-agenda-filter-by-top-headline (strip)
+ "Keep only those lines that are descendants from the same top headline.
+The top headline is that of the current line. With prefix arg STRIP, hide
+all lines of the category at point."
+ (interactive "P")
+ (if org-agenda-filtered-by-top-headline
+ (progn
+ (setq org-agenda-filtered-by-top-headline nil
+ org-agenda-top-headline-filter nil)
+ (org-agenda-filter-show-all-top-filter))
+ (let ((toph (org-find-top-headline (org-get-at-bol 'org-hd-marker))))
+ (if toph (org-agenda-filter-top-headline-apply toph strip)
+ (error "No top-level headline at point")))))
+
+(defvar org-agenda-regexp-filter nil)
+(defun org-agenda-filter-by-regexp (strip-or-accumulate)
+ "Filter agenda entries by a regular expressions.
+You will be prompted for the regular expression, and the agenda
+view will only show entries that are matched by that expression.
+
+With one `\\[universal-argument]' prefix argument, hide entries matching the regexp.
+When there is already a regexp filter active, this command removed the
+filter. However, with two `\\[universal-argument]' prefix arguments, add a new condition to
+an already existing regexp filter."
+ (interactive "P")
+ (let* ((strip (equal strip-or-accumulate '(4)))
+ (accumulate (equal strip-or-accumulate '(16))))
+ (cond
+ ((and org-agenda-regexp-filter (not accumulate))
+ (org-agenda-filter-show-all-re)
+ (message "Regexp filter removed"))
+ (t (let ((flt (concat (if strip "-" "+")
+ (read-from-minibuffer
+ (if strip
+ "Hide entries matching regexp: "
+ "Narrow to entries matching regexp: ")))))
+ (push flt org-agenda-regexp-filter)
+ (org-agenda-filter-apply org-agenda-regexp-filter 'regexp))))))
+
+(defvar org-agenda-effort-filter nil)
+(defun org-agenda-filter-by-effort (strip-or-accumulate)
+ "Filter agenda entries by effort.
+With no `\\[universal-argument]' prefix argument, keep entries matching the effort condition.
+With one `\\[universal-argument]' prefix argument, filter out entries matching the condition.
+With two `\\[universal-argument]' prefix arguments, add a second condition to the existing filter.
+This last option is in practice not very useful, but it is available for
+consistency with the other filter commands."
+ (interactive "P")
+ (let* ((efforts (split-string
+ (or (cdr (assoc-string (concat org-effort-property "_ALL")
+ org-global-properties
+ t))
+ "0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00")))
+ ;; XXX: the following handles only up to 10 different
+ ;; effort values.
+ (allowed-keys (if (null efforts) nil
+ (mapcar (lambda (n) (mod n 10)) ;turn 10 into 0
+ (number-sequence 1 (length efforts)))))
+ (keep (equal strip-or-accumulate '(16)))
+ (negative (equal strip-or-accumulate '(4)))
+ (current org-agenda-effort-filter)
+ (op nil))
+ (while (not (memq op '(?< ?> ?= ?_)))
+ (setq op (read-char-exclusive
+ "Effort operator? (> = or <) or press `_' again to remove filter")))
+ ;; Select appropriate duration. Ignore non-digit characters.
+ (if (eq op ?_)
+ (progn
+ (org-agenda-filter-show-all-effort)
+ (message "Effort filter removed"))
+ (let ((prompt
+ (apply #'format
+ (concat "Effort %c "
+ (mapconcat (lambda (s) (concat "[%d]" s))
+ efforts
+ " "))
+ op allowed-keys))
+ (eff -1))
+ (while (not (memq eff allowed-keys))
+ (message prompt)
+ (setq eff (- (read-char-exclusive) 48)))
+ (org-agenda-filter-show-all-effort)
+ (setq org-agenda-effort-filter
+ (append
+ (list (concat (if negative "-" "+")
+ (char-to-string op)
+ ;; Numbering is 1 2 3 ... 9 0, but we want
+ ;; 0 1 2 ... 8 9.
+ (nth (mod (1- eff) 10) efforts)))
+ (if keep current nil)))
+ (org-agenda-filter-apply org-agenda-effort-filter 'effort)))))
+
+(defun org-agenda-filter (&optional strip-or-accumulate)
+ "Prompt for a general filter string and apply it to the agenda.
+
+The string may contain filter elements like
+
++category
++tag
++<effort > and = are also allowed as effort operators
++/regexp/
+
+Instead of `+', `-' is allowed to strip the agenda of matching entries.
+`+' is optional if it is not required to separate two string parts.
+Multiple filter elements can be concatenated without spaces, for example
+
+ +work-John<0:10-/plot/
+
+selects entries with category `work' and effort estimates below 10 minutes,
+and deselects entries with tag `John' or matching the regexp `plot'.
+
+During entry of the filter, completion for tags, categories and effort
+values is offered. Since the syntax for categories and tags is identical
+there should be no overlap between categories and tags. If there is, tags
+get priority.
+
+A single `\\[universal-argument]' prefix arg STRIP-OR-ACCUMULATE will negate the
+entire filter, which can be useful in connection with the prompt history.
+
+A double `\\[universal-argument] \\[universal-argument]' prefix arg will add the new filter elements to the
+existing ones. A shortcut for this is to add an additional `+' at the
+beginning of the string, like `+-John'.
+
+With a triple prefix argument, execute the computed filtering defined in
+the variable `org-agenda-auto-exclude-function'."
+ (interactive "P")
+ (if (equal strip-or-accumulate '(64))
+ ;; Execute the auto-exclude action
+ (if (not org-agenda-auto-exclude-function)
+ (user-error "`org-agenda-auto-exclude-function' is undefined")
+ (org-agenda-filter-show-all-tag)
+ (setq org-agenda-tag-filter nil)
+ (dolist (tag (org-agenda-get-represented-tags))
+ (let ((modifier (funcall org-agenda-auto-exclude-function tag)))
+ (when modifier
+ (push modifier org-agenda-tag-filter))))
+ (unless (null org-agenda-tag-filter)
+ (org-agenda-filter-apply org-agenda-tag-filter 'tag 'expand)))
+ ;; Prompt for a filter and act
+ (let* ((tag-list (org-agenda-get-represented-tags))
+ (category-list (org-agenda-get-represented-categories))
+ (negate (equal strip-or-accumulate '(4)))
+ (cf (mapconcat #'identity org-agenda-category-filter ""))
+ (tf (mapconcat #'identity org-agenda-tag-filter ""))
+ ;; (rpl-fn (lambda (c) (replace-regexp-in-string "^\\+" "" (or (car c) ""))))
+ (ef (replace-regexp-in-string "^\\+" "" (or (car org-agenda-effort-filter) "")))
+ (rf (replace-regexp-in-string "^\\+" "" (or (car org-agenda-regexp-filter) "")))
+ (ff (concat cf tf ef (when (not (equal rf "")) (concat "/" rf "/"))))
+ (f-string (completing-read
+ (concat
+ (if negate "Negative filter" "Filter")
+ " [+cat-tag<0:10-/regexp/]: ")
+ #'org-agenda-filter-completion-function
+ nil nil ff))
+ (keep (or (if (string-match "^\\+[+-]" f-string)
+ (progn (setq f-string (substring f-string 1)) t))
+ (equal strip-or-accumulate '(16))))
+ (fc (if keep org-agenda-category-filter))
+ (ft (if keep org-agenda-tag-filter))
+ (fe (if keep org-agenda-effort-filter))
+ (fr (if keep org-agenda-regexp-filter))
+ pm s)
+ ;; If the filter contains a double-quoted string, replace a
+ ;; single hyphen by the arbitrary and temporary string "~~~"
+ ;; to disambiguate such hyphens from syntactic ones.
+ (setq f-string (replace-regexp-in-string
+ "\"\\([^\"]*\\)-\\([^\"]*\\)\"" "\"\\1~~~\\2\"" f-string))
+ (while (string-match "^[ \t]*\\([-+]\\)?\\(\\([^-+<>=/ \t]+\\)\\|\\([<>=][0-9:]+\\)\\|\\(/\\([^/]+\\)/?\\)\\)" f-string)
+ (setq pm (if (match-beginning 1) (match-string 1 f-string) "+"))
+ (when negate
+ (setq pm (if (equal pm "+") "-" "+")))
+ (cond
+ ((match-beginning 3)
+ ;; category or tag
+ (setq s (replace-regexp-in-string ; Remove the temporary special string.
+ "~~~" "-" (match-string 3 f-string)))
+ (cond
+ ((member s tag-list)
+ (org-pushnew-to-end (concat pm s) ft))
+ ((member s category-list)
+ (org-pushnew-to-end (concat pm ; Remove temporary double quotes.
+ (replace-regexp-in-string "\"\\(.*\\)\"" "\\1" s))
+ fc))
+ (t (message
+ "`%s%s' filter ignored because tag/category is not represented"
+ pm s))))
+ ((match-beginning 4)
+ ;; effort
+ (org-pushnew-to-end (concat pm (match-string 4 f-string)) fe))
+ ((match-beginning 5)
+ ;; regexp
+ (org-pushnew-to-end (concat pm (match-string 6 f-string)) fr)))
+ (setq f-string (substring f-string (match-end 0))))
+ (org-agenda-filter-remove-all)
+ (and fc (org-agenda-filter-apply
+ (setq org-agenda-category-filter fc) 'category))
+ (and ft (org-agenda-filter-apply
+ (setq org-agenda-tag-filter ft) 'tag 'expand))
+ (and fe (org-agenda-filter-apply
+ (setq org-agenda-effort-filter fe) 'effort))
+ (and fr (org-agenda-filter-apply
+ (setq org-agenda-regexp-filter fr) 'regexp))
+ (run-hooks 'org-agenda-filter-hook))))
+
+(defun org-agenda-filter-completion-function (string _predicate &optional flag)
+ "Complete a complex filter 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 t) ;tags are case-sensitive
+ (confirm (lambda (x) (stringp x)))
+ (prefix "")
+ (operator "")
+ table)
+ (when (string-match "^\\(.*\\([-+<>=]\\)\\)\\([^-+<>=]*\\)$" string)
+ (setq prefix (match-string 1 string)
+ operator (match-string 2 string)
+ string (match-string 3 string)))
+ (cond
+ ((member operator '("+" "-" "" nil))
+ (setq table (append (org-agenda-get-represented-categories)
+ (org-agenda-get-represented-tags))))
+ ((member operator '("<" ">" "="))
+ (setq table (split-string
+ (or (cdr (assoc-string (concat org-effort-property "_ALL")
+ org-global-properties
+ t))
+ "0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00")
+ " +")))
+ (t (setq table nil)))
+ (pcase flag
+ (`t (all-completions string table confirm))
+ (`lambda (assoc string table)) ;exact match?
+ (`nil
+ (pcase (try-completion string table confirm)
+ ((and completion (pred stringp))
+ (concat prefix completion))
+ (completion completion)))
+ (_ nil))))
+
+(defun org-agenda-filter-remove-all ()
+ "Remove all filters from the current agenda buffer."
+ (interactive)
+ (when org-agenda-tag-filter
+ (org-agenda-filter-show-all-tag))
+ (when org-agenda-category-filter
+ (org-agenda-filter-show-all-cat))
+ (when org-agenda-regexp-filter
+ (org-agenda-filter-show-all-re))
+ (when org-agenda-top-headline-filter
+ (org-agenda-filter-show-all-top-filter))
+ (when org-agenda-effort-filter
+ (org-agenda-filter-show-all-effort))
+ (org-agenda-finalize)
+ (when (called-interactively-p 'interactive)
+ (message "All agenda filters removed")))
+
+(defun org-agenda-filter-by-tag (strip-or-accumulate &optional char exclude)
+ "Keep only those lines in the agenda buffer that have a specific tag.
+
+The tag is selected with its fast selection letter, as configured.
+
+With a `\\[universal-argument]' prefix, apply the filter negatively, stripping all matches.
+
+With a `\\[universal-argument] \\[universal-argument]' prefix, add the new tag to the existing filter
+instead of replacing it.
+
+With a `\\[universal-argument] \\[universal-argument] \\[universal-argument]' prefix, filter the literal tag, \
+i.e. don't
+filter on all its group members.
+
+A Lisp caller can specify CHAR. EXCLUDE means that the new tag
+should be used to exclude the search - the interactive user can
+also press `-' or `+' to switch between filtering and excluding."
+ (interactive "P")
+ (let* ((alist org-tag-alist-for-agenda)
+ (seen-chars nil)
+ (tag-chars (mapconcat
+ (lambda (x) (if (and (not (symbolp (car x)))
+ (cdr x)
+ (not (member (cdr x) seen-chars)))
+ (progn
+ (push (cdr x) seen-chars)
+ (char-to-string (cdr x)))
+ ""))
+ org-tag-alist-for-agenda ""))
+ (valid-char-list (append '(?\t ?\r ?\\ ?. ?\s ?q)
+ (string-to-list tag-chars)))
+ (exclude (or exclude (equal strip-or-accumulate '(4))))
+ (accumulate (equal strip-or-accumulate '(16)))
+ (expand (not (equal strip-or-accumulate '(64))))
+ (inhibit-read-only t)
+ (current org-agenda-tag-filter)
+ a tag) ;; n
+ (unless char
+ (while (not (memq char valid-char-list))
+ (org-unlogged-message
+ "%s by tag%s: [%s ]tag-char [TAB]tag %s[\\]off [q]uit"
+ (if exclude "Exclude[+]" "Filter[-]")
+ (if expand "" " (no grouptag expand)")
+ tag-chars
+ (if org-agenda-auto-exclude-function "[RET] " ""))
+ (setq char (read-char-exclusive))
+ ;; Excluding or filtering down
+ (cond ((eq char ?-) (setq exclude t))
+ ((eq char ?+) (setq exclude nil)))))
+ (when (eq char ?\t)
+ (unless (local-variable-p 'org-global-tags-completion-table)
+ (setq-local org-global-tags-completion-table
+ (org-global-tags-completion-table)))
+ (let ((completion-ignore-case t))
+ (setq tag (completing-read
+ "Tag: " org-global-tags-completion-table nil t))))
+ (cond
+ ((eq char ?\r)
+ (org-agenda-filter-show-all-tag)
+ (when org-agenda-auto-exclude-function
+ (setq org-agenda-tag-filter nil)
+ (dolist (tag (org-agenda-get-represented-tags))
+ (let ((modifier (funcall org-agenda-auto-exclude-function tag)))
+ (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)
+ (org-agenda-filter-apply org-agenda-tag-filter 'tag expand)))
+ ((eq char ?.)
+ (setq org-agenda-tag-filter
+ (mapcar (lambda(tag) (concat "+" tag))
+ (org-get-at-bol 'tags)))
+ (org-agenda-filter-apply org-agenda-tag-filter 'tag expand))
+ ((eq char ?q)) ;If q, abort (even if there is a q-key for a tag...)
+ ((or (eq char ?\s)
+ (setq a (rassoc char alist))
+ (and tag (setq a (cons tag nil))))
+ (org-agenda-filter-show-all-tag)
+ (setq tag (car a))
+ (setq org-agenda-tag-filter
+ (cons (concat (if exclude "-" "+") tag)
+ (if accumulate current nil)))
+ (org-agenda-filter-apply org-agenda-tag-filter 'tag expand))
+ (t (error "Invalid tag selection character %c" char)))))
+
+(defun org-agenda-get-represented-categories ()
+ "Return a list of all categories used in this agenda buffer."
+ (or org-agenda-represented-categories
+ (when (derived-mode-p 'org-agenda-mode)
+ (let ((pos (point-min)) categories)
+ (while (and (< pos (point-max))
+ (setq pos (next-single-property-change
+ pos 'org-category nil (point-max))))
+ (push (get-text-property pos 'org-category) categories))
+ (setq org-agenda-represented-categories
+ ;; Enclose category names with a hyphen in double
+ ;; quotes to process them specially in `org-agenda-filter'.
+ (mapcar (lambda (s) (if (string-match-p "-" s) (format "\"%s\"" s) s))
+ (nreverse (org-uniquify (delq nil categories)))))))))
+
+(defvar org-tag-groups-alist-for-agenda)
+(defun org-agenda-get-represented-tags ()
+ "Return a list of all tags used in this agenda buffer.
+These will be lower-case, for filtering."
+ (or org-agenda-represented-tags
+ (when (derived-mode-p 'org-agenda-mode)
+ (let ((pos (point-min)) tags-lists tt)
+ (while (and (< pos (point-max))
+ (setq pos (next-single-property-change
+ pos 'tags nil (point-max))))
+ (setq tt (get-text-property pos 'tags))
+ (if tt (push tt tags-lists)))
+ (setq tags-lists
+ (nreverse (org-uniquify
+ (delq nil (apply #'append tags-lists)))))
+ (dolist (tag tags-lists)
+ (mapc
+ (lambda (group)
+ (when (member tag group)
+ (push (car group) tags-lists)))
+ org-tag-groups-alist-for-agenda))
+ (setq org-agenda-represented-tags tags-lists)))))
+
+(defun org-agenda-filter-make-matcher (filter type &optional expand)
+ "Create the form that tests a line for agenda filter.
+Optional 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."
+ (let ((multi-pos-cats
+ (and (eq type 'category)
+ (string-match-p "\\+.*\\+"
+ (mapconcat (lambda (cat) (substring cat 0 1))
+ filter ""))))
+ f f1)
+ (cond
+ ;; Tag filter
+ ((eq type 'tag)
+ (setq filter
+ (delete-dups
+ (append (get 'org-agenda-tag-filter :preset-filter)
+ filter)))
+ (dolist (x filter)
+ (let ((op (string-to-char x)))
+ (if expand (setq x (org-agenda-filter-expand-tags (list x) t))
+ (setq x (list x)))
+ (setq f1 (org-agenda-filter-make-matcher-tag-exp x op))
+ (push f1 f))))
+ ;; Category filter
+ ((eq type 'category)
+ (setq filter
+ (delete-dups
+ (append (get 'org-agenda-category-filter :preset-filter)
+ filter)))
+ (dolist (x filter)
+ (if (equal "-" (substring x 0 1))
+ (setq f1 (list 'not (list 'equal (substring x 1) 'cat)))
+ (setq f1 (list 'equal (substring x 1) 'cat)))
+ (push f1 f)))
+ ;; Regexp filter
+ ((eq type 'regexp)
+ (setq filter
+ (delete-dups
+ (append (get 'org-agenda-regexp-filter :preset-filter)
+ filter)))
+ (dolist (x filter)
+ (if (equal "-" (substring x 0 1))
+ (setq f1 (list 'not (list 'string-match (substring x 1) 'txt)))
+ (setq f1 (list 'string-match (substring x 1) 'txt)))
+ (push f1 f)))
+ ;; Effort filter
+ ((eq type 'effort)
+ (setq filter
+ (delete-dups
+ (append (get 'org-agenda-effort-filter :preset-filter)
+ filter)))
+ (dolist (x filter)
+ (push (org-agenda-filter-effort-form x) f))))
+ (cons (if multi-pos-cats 'or 'and) (nreverse f))))
+
+(defun org-agenda-filter-make-matcher-tag-exp (tags op)
+ "Return a form associated to tag-expression TAGS.
+Build a form testing a line for agenda filter for
+tag-expressions. OP is an operator of type CHAR that allows the
+function to set the right switches in the returned form."
+ (let (form)
+ ;; Any of the expressions can match if OP is +, all must match if
+ ;; the operator is -.
+ (dolist (x tags (cons (if (eq op ?-) 'and 'or) form))
+ (let* ((tag (substring x 1))
+ (f (cond
+ ((string= "" tag) 'tags)
+ ((and (string-match-p "\\`{" tag) (string-match-p "}\\'" tag))
+ ;; TAG is a regexp.
+ (list 'org-match-any-p (substring tag 1 -1) 'tags))
+ (t (list 'member tag 'tags)))))
+ (push (if (eq op ?-) (list 'not f) f) form)))))
+
+(defun org-agenda-filter-effort-form (e)
+ "Return the form to compare the effort of the current line with what E says.
+E looks like \"+<2:25\"."
+ (let (op)
+ (setq e (substring e 1))
+ (setq op (string-to-char e) e (substring e 1))
+ (setq op (cond ((equal op ?<) '<=)
+ ((equal op ?>) '>=)
+ ((equal op ??) op)
+ (t '=)))
+ (list 'org-agenda-compare-effort (list 'quote op)
+ (org-duration-to-minutes e))))
+
+(defun org-agenda-compare-effort (op value)
+ "Compare the effort of the current line with VALUE, using OP.
+If the line does not have an effort defined, return nil."
+ ;; `effort-minutes' property cannot be extracted directly from
+ ;; current line but is stored as a property in `txt'.
+ (let ((effort (get-text-property 0 'effort-minutes (org-get-at-bol 'txt))))
+ (funcall op
+ (or effort (if org-agenda-sort-noeffort-is-high 32767 -1))
+ value)))
+
+(defun org-agenda-filter-expand-tags (filter &optional no-operator)
+ "Expand group tags in FILTER for the agenda.
+When NO-OPERATOR is non-nil, do not add the + operator to
+returned tags."
+ (if org-group-tags
+ (let (case-fold-search rtn)
+ (mapc
+ (lambda (f)
+ (let (f0 dir)
+ (if (string-match "^\\([+-]\\)\\(.+\\)" f)
+ (setq dir (match-string 1 f) f0 (match-string 2 f))
+ (setq dir (if no-operator "" "+") f0 f))
+ (setq rtn (append (mapcar (lambda(f1) (concat dir f1))
+ (org-tags-expand f0 t))
+ rtn))))
+ filter)
+ (reverse rtn))
+ filter))
+
+(defun org-agenda-filter-apply (filter type &optional expand)
+ "Set FILTER as the new agenda filter and apply it.
+Optional 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
+ (when org-agenda-entry-text-mode (org-agenda-entry-text-mode))
+ (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
+ ;; category is used as the filter:
+ (setq org-agenda-filtered-by-category
+ (and (eq type 'category)
+ (not (equal (substring (car filter) 0 1) "-"))))
+ (org-agenda-set-mode-name)
+ (save-excursion
+ (goto-char (point-min))
+ (while (not (eobp))
+ (when (or (org-get-at-bol 'org-hd-marker)
+ (org-get-at-bol 'org-marker))
+ (org-dlet
+ ((tags (org-get-at-bol 'tags))
+ (cat (org-agenda-get-category))
+ (txt (or (org-get-at-bol 'txt) "")))
+ (unless (eval org-agenda-filter-form t)
+ (org-agenda-filter-hide-line type))))
+ (beginning-of-line 2)))
+ (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."
+ (org-agenda-set-mode-name)
+ (save-excursion
+ (goto-char (point-min))
+ (while (not (eobp))
+ (let* ((pos (org-get-at-bol 'org-hd-marker))
+ (tophl (and pos (org-find-top-headline pos))))
+ (when (and tophl (funcall (if negative 'identity 'not)
+ (string= hl tophl)))
+ (org-agenda-filter-hide-line 'top-headline)))
+ (beginning-of-line 2)))
+ (when (get-char-property (point) 'invisible)
+ (org-agenda-previous-line))
+ (setq org-agenda-top-headline-filter hl
+ org-agenda-filtered-by-top-headline t))
+
+(defun org-agenda-filter-hide-line (type)
+ "If current line is TYPE, hide it in the agenda buffer."
+ (let* (buffer-invisibility-spec
+ (beg (max (point-min) (1- (point-at-bol))))
+ (end (point-at-eol)))
+ (let ((inhibit-read-only t))
+ (add-text-properties
+ beg end `(invisible org-filtered org-filter-type ,type)))))
+
+(defun org-agenda-remove-filter (type)
+ "Remove filter of type TYPE from the agenda buffer."
+ (interactive)
+ (save-excursion
+ (goto-char (point-min))
+ (let ((inhibit-read-only t) pos)
+ (while (setq pos (text-property-any (point) (point-max)
+ 'org-filter-type type))
+ (goto-char pos)
+ (remove-text-properties
+ (point) (next-single-property-change (point) 'org-filter-type)
+ `(invisible org-filtered org-filter-type ,type))))
+ (set (intern (format "org-agenda-%s-filter" (intern-soft type))) nil)
+ (setq org-agenda-filter-form nil)
+ (org-agenda-set-mode-name)
+ (org-agenda-finalize)))
+
+(defun org-agenda-filter-show-all-tag nil
+ (org-agenda-remove-filter 'tag))
+(defun org-agenda-filter-show-all-re nil
+ (org-agenda-remove-filter 'regexp))
+(defun org-agenda-filter-show-all-effort nil
+ (org-agenda-remove-filter 'effort))
+(defun org-agenda-filter-show-all-cat nil
+ (org-agenda-remove-filter 'category))
+(defun org-agenda-filter-show-all-top-filter nil
+ (org-agenda-remove-filter 'top-headline))
+
+(defun org-agenda-manipulate-query-add ()
+ "Manipulate the query by adding a search term with positive selection.
+Positive selection means the term must be matched for selection of an entry."
+ (interactive)
+ (org-agenda-manipulate-query ?\[))
+(defun org-agenda-manipulate-query-subtract ()
+ "Manipulate the query by adding a search term with negative selection.
+Negative selection means term must not be matched for selection of an entry."
+ (interactive)
+ (org-agenda-manipulate-query ?\]))
+(defun org-agenda-manipulate-query-add-re ()
+ "Manipulate the query by adding a search regexp with positive selection.
+Positive selection means the regexp must match for selection of an entry."
+ (interactive)
+ (org-agenda-manipulate-query ?\{))
+(defun org-agenda-manipulate-query-subtract-re ()
+ "Manipulate the query by adding a search regexp with negative selection.
+Negative selection means regexp must not match for selection of an entry."
+ (interactive)
+ (org-agenda-manipulate-query ?\}))
+(defun org-agenda-manipulate-query (char)
+ (cond
+ ((eq org-agenda-type 'agenda)
+ (let ((org-agenda-include-inactive-timestamps t))
+ (org-agenda-redo))
+ (message "Display now includes inactive timestamps as well"))
+ ((eq org-agenda-type 'search)
+ (org-add-to-string
+ 'org-agenda-query-string
+ (if org-agenda-last-search-view-search-was-boolean
+ (cdr (assoc char '((?\[ . " +") (?\] . " -")
+ (?\{ . " +{}") (?\} . " -{}"))))
+ " "))
+ (setq org-agenda-redo-command
+ (list 'org-search-view
+ (car (get-text-property (min (1- (point-max)) (point))
+ 'org-last-args))
+ org-agenda-query-string
+ (+ (length org-agenda-query-string)
+ (if (member char '(?\{ ?\})) 0 1))))
+ (set-register org-agenda-query-register org-agenda-query-string)
+ (let ((org-agenda-overriding-arguments
+ (cdr org-agenda-redo-command)))
+ (org-agenda-redo)))
+ (t (error "Cannot manipulate query for %s-type agenda buffers"
+ org-agenda-type))))
+
+(defun org-add-to-string (var string)
+ (set var (concat (symbol-value var) string)))
+
+(defun org-agenda-goto-date (date)
+ "Jump to DATE in agenda."
+ (interactive
+ (list
+ (let ((org-read-date-prefer-future org-agenda-jump-prefer-future))
+ (org-read-date))))
+ (let* ((day (time-to-days (org-time-string-to-time date)))
+ (org-agenda-sticky-orig org-agenda-sticky)
+ (org-agenda-buffer-tmp-name (buffer-name))
+ (args (get-text-property (min (1- (point-max)) (point)) 'org-last-args))
+ (0-arg (or current-prefix-arg (car args)))
+ (2-arg (nth 2 args))
+ (with-hour-p (nth 4 org-agenda-redo-command))
+ (newcmd (list 'org-agenda-list 0-arg date
+ (org-agenda-span-to-ndays
+ 2-arg (org-time-string-to-absolute date))
+ with-hour-p))
+ (newargs (cdr newcmd))
+ (inhibit-read-only t)
+ org-agenda-sticky)
+ (if (not (org-agenda-check-type t 'agenda))
+ (error "Not available in non-agenda views")
+ (add-text-properties (point-min) (point-max)
+ `(org-redo-cmd ,newcmd org-last-args ,newargs))
+ (org-agenda-redo)
+ (goto-char (point-min))
+ (while (not (or (= (or (get-text-property (point) 'day) 0) day)
+ (save-excursion (move-beginning-of-line 2) (eobp))))
+ (move-beginning-of-line 2))
+ (setq org-agenda-sticky org-agenda-sticky-orig
+ org-agenda-this-buffer-is-sticky org-agenda-sticky))))
+
+(defun org-agenda-goto-today ()
+ "Go to today."
+ (interactive)
+ (org-agenda-check-type t 'agenda)
+ (let* ((args (get-text-property (min (1- (point-max)) (point)) 'org-last-args))
+ (curspan (nth 2 args))
+ (tdpos (text-property-any (point-min) (point-max) 'org-today t)))
+ (cond
+ (tdpos (goto-char tdpos))
+ ((eq org-agenda-type 'agenda)
+ (let* ((sd (org-agenda-compute-starting-span
+ (org-today) (or curspan org-agenda-span)))
+ (org-agenda-overriding-arguments args))
+ (setf (nth 1 org-agenda-overriding-arguments) sd)
+ (org-agenda-redo)
+ (org-agenda-find-same-or-today-or-agenda)))
+ (t (error "Cannot find today")))))
+
+(defun org-agenda-find-same-or-today-or-agenda (&optional cnt)
+ (goto-char
+ (or (and cnt (text-property-any (point-min) (point-max) 'org-day-cnt cnt))
+ (text-property-any (point-min) (point-max) 'org-today t)
+ (text-property-any (point-min) (point-max) 'org-agenda-type 'agenda)
+ (and (get-text-property (min (1- (point-max)) (point)) 'org-series)
+ (org-agenda-backward-block))
+ (point-min))))
+
+(defun org-agenda-backward-block ()
+ "Move backward by one agenda block."
+ (interactive)
+ (org-agenda-forward-block 'backward))
+
+(defun org-agenda-forward-block (&optional backward)
+ "Move forward by one agenda block.
+When optional argument BACKWARD is set, go backward."
+ (interactive)
+ (cond ((not (derived-mode-p 'org-agenda-mode))
+ (user-error
+ "Cannot execute this command outside of org-agenda-mode buffers"))
+ ((looking-at (if backward "\\`" "\\'"))
+ (message "Already at the %s block" (if backward "first" "last")))
+ (t (let ((_pos (prog1 (point)
+ (ignore-errors (if backward (backward-char 1)
+ (move-end-of-line 1)))))
+ (f (if backward
+ #'previous-single-property-change
+ #'next-single-property-change))
+ moved dest)
+ (while (and (setq dest (funcall
+ f (point) 'org-agenda-structural-header))
+ (not (get-text-property
+ (point) 'org-agenda-structural-header)))
+ (setq moved t)
+ (goto-char dest))
+ (if moved (move-beginning-of-line 1)
+ (goto-char (if backward (point-min) (point-max)))
+ (move-beginning-of-line 1)
+ (message "No %s block" (if backward "previous" "further")))))))
+
+(defun org-agenda-later (arg)
+ "Go forward in time by the current span.
+With prefix ARG, go forward that many times the current span."
+ (interactive "p")
+ (org-agenda-check-type t 'agenda)
+ (let* ((wstart (window-start))
+ (args (get-text-property (min (1- (point-max)) (point)) 'org-last-args))
+ (span (or (nth 2 args) org-agenda-current-span))
+ (sd (or (nth 1 args) (org-get-at-bol 'day) org-starting-day))
+ (greg (calendar-gregorian-from-absolute sd))
+ (cnt (org-get-at-bol 'org-day-cnt))
+ greg2)
+ (cond
+ ((numberp span)
+ (setq sd (+ (* span arg) sd)))
+ ((eq span 'day)
+ (setq sd (+ arg sd)))
+ ((eq span 'week)
+ (setq sd (+ (* 7 arg) sd)))
+ ((eq span 'fortnight)
+ (setq sd (+ (* 14 arg) sd)))
+ ((eq span 'month)
+ (setq greg2 (list (+ (car greg) arg) (nth 1 greg) (nth 2 greg))
+ sd (calendar-absolute-from-gregorian greg2))
+ (setcar greg2 (1+ (car greg2))))
+ ((eq span 'year)
+ (setq greg2 (list (car greg) (nth 1 greg) (+ arg (nth 2 greg)))
+ sd (calendar-absolute-from-gregorian greg2))
+ (setcar (nthcdr 2 greg2) (1+ (nth 2 greg2))))
+ (t
+ (setq sd (+ (* span arg) sd))))
+ (let ((org-agenda-overriding-cmd
+ ;; `cmd' may have been set by `org-agenda-run-series' which
+ ;; uses `org-agenda-overriding-cmd' to decide whether
+ ;; overriding is allowed for `cmd'
+ (get-text-property (min (1- (point-max)) (point)) 'org-series-cmd))
+ (org-agenda-overriding-arguments
+ (list (car args) sd span)))
+ (org-agenda-redo)
+ (org-agenda-find-same-or-today-or-agenda cnt))
+ (set-window-start nil wstart)))
+
+(defun org-agenda-earlier (arg)
+ "Go backward in time by the current span.
+With prefix ARG, go backward that many times the current span."
+ (interactive "p")
+ (org-agenda-later (- arg)))
+
+(defun org-agenda-view-mode-dispatch ()
+ "Call one of the view mode commands."
+ (interactive)
+ (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))
+ (?w (call-interactively 'org-agenda-week-view))
+ (?t (call-interactively 'org-agenda-fortnight-view))
+ (?m (call-interactively 'org-agenda-month-view))
+ (?y (call-interactively 'org-agenda-year-view))
+ (?l (call-interactively 'org-agenda-log-mode))
+ (?L (org-agenda-log-mode '(4)))
+ (?c (org-agenda-log-mode 'clockcheck))
+ ((or ?F ?f) (call-interactively 'org-agenda-follow-mode))
+ (?a (call-interactively 'org-agenda-archives-mode))
+ (?A (org-agenda-archives-mode 'files))
+ ((or ?R ?r) (call-interactively 'org-agenda-clockreport-mode))
+ ((or ?E ?e) (call-interactively 'org-agenda-entry-text-mode))
+ (?G (call-interactively 'org-agenda-toggle-time-grid))
+ (?D (call-interactively 'org-agenda-toggle-diary))
+ (?\! (call-interactively 'org-agenda-toggle-deadlines))
+ (?\[ (let ((org-agenda-include-inactive-timestamps t))
+ (org-agenda-check-type t 'agenda)
+ (org-agenda-redo))
+ (message "Display now includes inactive timestamps as well"))
+ (?q (message "Abort"))
+ (key (user-error "Invalid key: %s" key))))
+
+(defun org-agenda-reset-view ()
+ "Switch to default view for agenda."
+ (interactive)
+ (org-agenda-change-time-span org-agenda-span))
+
+(defun org-agenda-day-view (&optional day-of-month)
+ "Switch to daily view for agenda.
+With argument DAY-OF-MONTH, switch to that day of the month."
+ (interactive "P")
+ (org-agenda-change-time-span 'day day-of-month))
+
+(defun org-agenda-week-view (&optional iso-week)
+ "Switch to weekly view for agenda.
+With argument ISO-WEEK, switch to the corresponding ISO week.
+If ISO-WEEK has more then 2 digits, only the last two encode
+the week. Any digits before this encode a year. So 200712
+means week 12 of year 2007. Years ranging from 70 years ago
+to 30 years in the future can also be written as 2-digit years."
+ (interactive "P")
+ (org-agenda-change-time-span 'week iso-week))
+
+(defun org-agenda-fortnight-view (&optional iso-week)
+ "Switch to fortnightly view for agenda.
+With argument ISO-WEEK, switch to the corresponding ISO week.
+If ISO-WEEK has more then 2 digits, only the last two encode
+the week. Any digits before this encode a year. So 200712
+means week 12 of year 2007. Years ranging from 70 years ago
+to 30 years in the future can also be written as 2-digit years."
+ (interactive "P")
+ (org-agenda-change-time-span 'fortnight iso-week))
+
+(defun org-agenda-month-view (&optional month)
+ "Switch to monthly view for agenda.
+With argument MONTH, switch to that month. If MONTH has more
+then 2 digits, only the last two encode the month. Any digits
+before this encode a year. So 200712 means December year 2007.
+Years ranging from 70 years ago to 30 years in the future can
+also be written as 2-digit years."
+ (interactive "P")
+ (org-agenda-change-time-span 'month month))
+
+(defun org-agenda-year-view (&optional year)
+ "Switch to yearly view for agenda.
+With argument YEAR, switch to that year. Years ranging from 70
+years ago to 30 years in the future can also be written as
+2-digit years."
+ (interactive "P")
+ (when year
+ (setq year (org-small-year-to-year year)))
+ (if (y-or-n-p "Are you sure you want to compute the agenda for an entire year? ")
+ (org-agenda-change-time-span 'year year)
+ (error "Abort")))
+
+(defun org-agenda-change-time-span (span &optional n)
+ "Change the agenda view to SPAN.
+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)))
+ (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))
+ (sd (org-agenda-compute-starting-span sd span n))
+ (org-agenda-overriding-cmd
+ (get-text-property (min (1- (point-max)) (point)) 'org-series-cmd))
+ (org-agenda-overriding-arguments
+ (list (car args) sd span)))
+ (org-agenda-redo)
+ (org-agenda-find-same-or-today-or-agenda))
+ (org-agenda-set-mode-name)
+ (message "Switched to %s view" span)))
+
+(defun org-agenda-compute-starting-span (sd span &optional n)
+ "Compute starting date for agenda.
+SPAN may be `day', `week', `fortnight', `month', `year'. The return value
+is a cons cell with the starting date and the number of days,
+so that the date SD will be in that range."
+ (let* ((greg (calendar-gregorian-from-absolute sd))
+ ;; (dg (nth 1 greg))
+ (mg (car greg))
+ (yg (nth 2 greg)))
+ (cond
+ ((eq span 'day)
+ (when n
+ (setq sd (+ (calendar-absolute-from-gregorian
+ (list mg 1 yg))
+ n -1))))
+ ((or (eq span 'week) (eq span 'fortnight))
+ (let* ((nt (calendar-day-of-week
+ (calendar-gregorian-from-absolute sd)))
+ (d (if org-agenda-start-on-weekday
+ (- nt org-agenda-start-on-weekday)
+ 0))
+ y1)
+ (setq sd (- sd (+ (if (< d 0) 7 0) d)))
+ (when n
+ (require 'cal-iso)
+ (when (> n 99)
+ (setq y1 (org-small-year-to-year (/ n 100))
+ n (mod n 100)))
+ (setq sd
+ (calendar-iso-to-absolute
+ (list n 1
+ (or y1 (nth 2 (calendar-iso-from-absolute sd)))))))))
+ ((eq span 'month)
+ (let (y1)
+ (when (and n (> n 99))
+ (setq y1 (org-small-year-to-year (/ n 100))
+ n (mod n 100)))
+ (setq sd (calendar-absolute-from-gregorian
+ (list (or n mg) 1 (or y1 yg))))))
+ ((eq span 'year)
+ (setq sd (calendar-absolute-from-gregorian
+ (list 1 1 (or n yg))))))
+ sd))
+
+(defun org-agenda-next-date-line (&optional arg)
+ "Jump to the next line indicating a date in agenda buffer."
+ (interactive "p")
+ (org-agenda-check-type t 'agenda)
+ (beginning-of-line 1)
+ ;; This does not work if user makes date format that starts with a blank
+ (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)
+ "Jump to the previous line indicating a date in agenda buffer."
+ (interactive "p")
+ (org-agenda-check-type t 'agenda)
+ (beginning-of-line 1)
+ (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))
+(overlay-put org-hl 'face 'highlight)
+
+(defun org-highlight (begin end &optional buffer)
+ "Highlight a region with overlay."
+ (move-overlay org-hl begin end (or buffer (current-buffer))))
+
+(defun org-unhighlight ()
+ "Detach overlay INDEX."
+ (delete-overlay org-hl))
+
+(defun org-unhighlight-once ()
+ "Remove the highlight from its position, and this function from the hook."
+ (remove-hook 'pre-command-hook #'org-unhighlight-once)
+ (org-unhighlight))
+
+(defvar org-agenda-pre-follow-window-conf nil)
+(defun org-agenda-follow-mode ()
+ "Toggle follow mode in an agenda buffer."
+ (interactive)
+ (unless org-agenda-follow-mode
+ (setq org-agenda-pre-follow-window-conf
+ (current-window-configuration)))
+ (setq org-agenda-follow-mode (not org-agenda-follow-mode))
+ (unless org-agenda-follow-mode
+ (set-window-configuration org-agenda-pre-follow-window-conf))
+ (org-agenda-set-mode-name)
+ (org-agenda-do-context-action)
+ (message "Follow mode is %s"
+ (if org-agenda-follow-mode "on" "off")))
+
+(defun org-agenda-entry-text-mode (&optional arg)
+ "Toggle entry text mode in an agenda buffer."
+ (interactive "P")
+ (if (or org-agenda-tag-filter
+ org-agenda-category-filter
+ org-agenda-regexp-filter
+ org-agenda-top-headline-filter)
+ (user-error "Can't show entry text in filtered views")
+ (setq org-agenda-entry-text-mode (or (integerp arg)
+ (not org-agenda-entry-text-mode)))
+ (org-agenda-entry-text-hide)
+ (and org-agenda-entry-text-mode
+ (let ((org-agenda-entry-text-maxlines
+ (if (integerp arg) arg org-agenda-entry-text-maxlines)))
+ (org-agenda-entry-text-show)))
+ (org-agenda-set-mode-name)
+ (message "Entry text mode is %s%s"
+ (if org-agenda-entry-text-mode "on" "off")
+ (if (not org-agenda-entry-text-mode) ""
+ (format " (maximum number of lines is %d)"
+ (if (integerp arg) arg org-agenda-entry-text-maxlines))))))
+
+(defun org-agenda-clockreport-mode ()
+ "Toggle clocktable mode in an agenda buffer."
+ (interactive)
+ (org-agenda-check-type t 'agenda)
+ (setq org-agenda-clockreport-mode (not org-agenda-clockreport-mode))
+ (org-agenda-set-mode-name)
+ (org-agenda-redo)
+ (message "Clocktable mode is %s"
+ (if org-agenda-clockreport-mode "on" "off")))
+
+(defun org-agenda-log-mode (&optional special)
+ "Toggle log mode in an agenda buffer.
+
+With argument SPECIAL, show all possible log items, not only the ones
+configured in `org-agenda-log-mode-items'.
+
+With a `\\[universal-argument] \\[universal-argument]' prefix, show *only* \
+log items, nothing else."
+ (interactive "P")
+ (org-agenda-check-type t 'agenda)
+ (setq org-agenda-show-log
+ (cond
+ ((equal special '(16)) 'only)
+ ((eq special 'clockcheck)
+ (if (eq org-agenda-show-log 'clockcheck)
+ nil 'clockcheck))
+ (special '(closed clock state))
+ (t (not org-agenda-show-log))))
+ (org-agenda-set-mode-name)
+ (org-agenda-redo)
+ (message "Log mode is %s" (if org-agenda-show-log "on" "off")))
+
+(defun org-agenda-archives-mode (&optional with-files)
+ "Toggle inclusion of items in trees marked with :ARCHIVE:.
+When called with a prefix argument, include all archive files as well."
+ (interactive "P")
+ (setq org-agenda-archives-mode
+ (cond ((and with-files (eq org-agenda-archives-mode t)) nil)
+ (with-files t)
+ (org-agenda-archives-mode nil)
+ (t 'trees)))
+ (org-agenda-set-mode-name)
+ (org-agenda-redo)
+ (message
+ "%s"
+ (cond
+ ((eq org-agenda-archives-mode nil)
+ "No archives are included")
+ ((eq org-agenda-archives-mode 'trees)
+ (format "Trees with :%s: tag are included" org-archive-tag))
+ ((eq org-agenda-archives-mode t)
+ (format "Trees with :%s: tag and all active archive files are included"
+ org-archive-tag)))))
+
+(defun org-agenda-toggle-diary ()
+ "Toggle diary inclusion in an agenda buffer."
+ (interactive)
+ (org-agenda-check-type t 'agenda)
+ (setq org-agenda-include-diary (not org-agenda-include-diary))
+ (org-agenda-redo)
+ (org-agenda-set-mode-name)
+ (message "Diary inclusion turned %s"
+ (if org-agenda-include-diary "on" "off")))
+
+(defun org-agenda-toggle-deadlines ()
+ "Toggle inclusion of entries with a deadline in an agenda buffer."
+ (interactive)
+ (org-agenda-check-type t 'agenda)
+ (setq org-agenda-include-deadlines (not org-agenda-include-deadlines))
+ (org-agenda-redo)
+ (org-agenda-set-mode-name)
+ (message "Deadlines inclusion turned %s"
+ (if org-agenda-include-deadlines "on" "off")))
+
+(defun org-agenda-toggle-time-grid ()
+ "Toggle time grid in an agenda buffer."
+ (interactive)
+ (org-agenda-check-type t 'agenda)
+ (setq org-agenda-use-time-grid (not org-agenda-use-time-grid))
+ (org-agenda-redo)
+ (org-agenda-set-mode-name)
+ (message "Time-grid turned %s"
+ (if org-agenda-use-time-grid "on" "off")))
+
+(defun org-agenda-set-mode-name ()
+ "Set the mode name to indicate all the small mode settings."
+ (setq mode-name
+ (list "Org-Agenda"
+ (if (get 'org-agenda-files 'org-restrict) " []" "")
+ " "
+ '(:eval (org-agenda-span-name org-agenda-current-span))
+ (if org-agenda-follow-mode " Follow" "")
+ (if org-agenda-entry-text-mode " ETxt" "")
+ (if org-agenda-include-diary " Diary" "")
+ (if org-agenda-include-deadlines " Ddl" "")
+ (if org-agenda-use-time-grid " Grid" "")
+ (if (and (boundp 'org-habit-show-habits)
+ org-habit-show-habits)
+ " Habit" "")
+ (cond
+ ((consp org-agenda-show-log) " LogAll")
+ ((eq org-agenda-show-log 'clockcheck) " ClkCk")
+ (org-agenda-show-log " Log")
+ (t ""))
+ (if (org-agenda-filter-any) " " "")
+ (if (or org-agenda-category-filter
+ (get 'org-agenda-category-filter :preset-filter))
+ '(:eval (propertize
+ (concat "["
+ (mapconcat
+ #'identity
+ (append
+ (get 'org-agenda-category-filter :preset-filter)
+ org-agenda-category-filter)
+ "")
+ "]")
+ 'face 'org-agenda-filter-category
+ 'help-echo "Category used in filtering"))
+ "")
+ (if (or org-agenda-tag-filter
+ (get 'org-agenda-tag-filter :preset-filter))
+ '(:eval (propertize
+ (concat (mapconcat
+ #'identity
+ (append
+ (get 'org-agenda-tag-filter :preset-filter)
+ org-agenda-tag-filter)
+ ""))
+ 'face 'org-agenda-filter-tags
+ 'help-echo "Tags used in filtering"))
+ "")
+ (if (or org-agenda-effort-filter
+ (get 'org-agenda-effort-filter :preset-filter))
+ '(:eval (propertize
+ (concat (mapconcat
+ #'identity
+ (append
+ (get 'org-agenda-effort-filter :preset-filter)
+ org-agenda-effort-filter)
+ ""))
+ 'face 'org-agenda-filter-effort
+ 'help-echo "Effort conditions used in filtering"))
+ "")
+ (if (or org-agenda-regexp-filter
+ (get 'org-agenda-regexp-filter :preset-filter))
+ '(:eval (propertize
+ (concat (mapconcat
+ (lambda (x) (concat (substring x 0 1) "/" (substring x 1) "/"))
+ (append
+ (get 'org-agenda-regexp-filter :preset-filter)
+ org-agenda-regexp-filter)
+ ""))
+ 'face 'org-agenda-filter-regexp
+ 'help-echo "Regexp used in filtering"))
+ "")
+ (if org-agenda-archives-mode
+ (if (eq org-agenda-archives-mode t)
+ " Archives"
+ (format " :%s:" org-archive-tag))
+ "")
+ (if org-agenda-clockreport-mode " Clock" "")))
+ (force-mode-line-update))
+
+(defun org-agenda-update-agenda-type ()
+ "Update the agenda type after each command."
+ (setq org-agenda-type
+ (or (get-text-property (point) 'org-agenda-type)
+ (get-text-property (max (point-min) (1- (point))) 'org-agenda-type))))
+
+(defun org-agenda-next-line ()
+ "Move cursor to the next line, and show if follow mode is active."
+ (interactive)
+ (call-interactively 'next-line)
+ (org-agenda-do-context-action))
+
+(defun org-agenda-previous-line ()
+ "Move cursor to the previous line, and show if follow-mode is active."
+ (interactive)
+ (call-interactively 'previous-line)
+ (org-agenda-do-context-action))
+
+(defun org-agenda-next-item (n)
+ "Move cursor to next agenda item."
+ (interactive "p")
+ (let ((col (current-column)))
+ (dotimes (_ n)
+ (when (next-single-property-change (point-at-eol) 'org-marker)
+ (move-end-of-line 1)
+ (goto-char (next-single-property-change (point) 'org-marker))))
+ (org-move-to-column col))
+ (org-agenda-do-context-action))
+
+(defun org-agenda-previous-item (n)
+ "Move cursor to next agenda item."
+ (interactive "p")
+ (dotimes (_ n)
+ (let ((col (current-column))
+ (goto (save-excursion
+ (move-end-of-line 0)
+ (previous-single-property-change (point) 'org-marker))))
+ (when goto (goto-char goto))
+ (org-move-to-column col)))
+ (org-agenda-do-context-action))
+
+(defun org-agenda-do-context-action ()
+ "Show outline path and, maybe, follow mode window."
+ (let ((m (org-get-at-bol 'org-marker)))
+ (when (and (markerp m) (marker-buffer m))
+ (and org-agenda-follow-mode
+ (if org-agenda-follow-indirect
+ (org-agenda-tree-to-indirect-buffer nil)
+ (org-agenda-show)))
+ (and org-agenda-show-outline-path
+ (org-with-point-at m (org-display-outline-path t))))))
+
+(defun org-agenda-show-tags ()
+ "Show the tags applicable to the current item."
+ (interactive)
+ (let* ((tags (org-get-at-bol 'tags)))
+ (if tags
+ (message "Tags are :%s:"
+ (org-no-properties (mapconcat #'identity tags ":")))
+ (message "No tags associated with this line"))))
+
+(defun org-agenda-goto (&optional highlight)
+ "Go to the entry at point in the corresponding Org file."
+ (interactive)
+ (let* ((marker (or (org-get-at-bol 'org-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer marker))
+ (pos (marker-position marker)))
+ ;; FIXME: use `org-switch-to-buffer-other-window'?
+ (switch-to-buffer-other-window buffer)
+ (widen)
+ (push-mark)
+ (goto-char pos)
+ (when (derived-mode-p 'org-mode)
+ (org-show-context 'agenda)
+ (recenter (/ (window-height) 2))
+ (org-back-to-heading t)
+ (let ((case-fold-search nil))
+ (when (re-search-forward org-complex-heading-regexp nil t)
+ (goto-char (match-beginning 4)))))
+ (run-hooks 'org-agenda-after-show-hook)
+ (and highlight (org-highlight (point-at-bol) (point-at-eol)))))
+
+(defvar org-agenda-after-show-hook nil
+ "Normal hook run after an item has been shown from the agenda.
+Point is in the buffer where the item originated.")
+
+;; Defined later in org-agenda.el
+(defvar org-agenda-loop-over-headlines-in-active-region nil)
+
+(defun org-agenda-do-in-region (beg end cmd &optional arg force-arg delete)
+ "Between region BEG and END, call agenda command CMD.
+When optional argument ARG is non-nil or FORCE-ARG is t, pass
+ARG to CMD. When optional argument DELETE is non-nil, assume CMD
+deletes the agenda entry and don't move to the next entry."
+ (save-excursion
+ (goto-char beg)
+ (let ((mend (move-marker (make-marker) end))
+ (all (eq org-agenda-loop-over-headlines-in-active-region t))
+ (match (and (stringp org-agenda-loop-over-headlines-in-active-region)
+ org-agenda-loop-over-headlines-in-active-region))
+ (level (and (eq org-agenda-loop-over-headlines-in-active-region 'start-level)
+ (org-get-at-bol 'level))))
+ (while (< (point) mend)
+ (let ((ov (make-overlay (point) (point-at-eol))))
+ (if (not (or all
+ (and match (looking-at-p match))
+ (eq level (org-get-at-bol 'level))))
+ (org-agenda-next-item 1)
+ (overlay-put ov 'face 'region)
+ (if (or arg force-arg) (funcall cmd arg) (funcall cmd))
+ (when (not delete) (org-agenda-next-item 1))
+ (delete-overlay ov)))))))
+
+;; org-agenda-[schedule,deadline,date-prompt,todo,[toggle]archive*,
+;; kill,set-property,set-effort] commands may loop over agenda
+;; entries. Commands `org-agenda-set-tags' and `org-agenda-bulk-mark'
+;; use their own mechanisms on active regions.
+(defmacro org-agenda-maybe-loop (cmd arg force-arg delete &rest body)
+ "Maybe loop over agenda entries and perform CMD.
+Pass ARG, FORCE-ARG, DELETE and BODY to `org-agenda-do-in-region'."
+ (declare (debug t))
+ `(if (and (called-interactively-p 'any)
+ org-agenda-loop-over-headlines-in-active-region
+ (org-region-active-p))
+ (org-agenda-do-in-region
+ (region-beginning) (region-end) ,cmd ,arg ,force-arg ,delete)
+ ,@body))
+
+(defun org-agenda-kill ()
+ "Kill the entry or subtree belonging to the current agenda entry."
+ (interactive)
+ (or (eq major-mode 'org-agenda-mode) (user-error "Not in agenda"))
+ (org-agenda-maybe-loop
+ #'org-agenda-kill nil nil t
+ (let* ((bufname-orig (buffer-name))
+ (marker (or (org-get-at-bol 'org-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer marker))
+ (pos (marker-position marker))
+ (type (org-get-at-bol 'type))
+ dbeg dend (n 0))
+ (org-with-remote-undo buffer
+ (with-current-buffer buffer
+ (save-excursion
+ (goto-char pos)
+ (if (and (derived-mode-p 'org-mode) (not (member type '("sexp"))))
+ (setq dbeg (progn (org-back-to-heading t) (point))
+ dend (org-end-of-subtree t t))
+ (setq dbeg (point-at-bol)
+ dend (min (point-max) (1+ (point-at-eol)))))
+ (goto-char dbeg)
+ (while (re-search-forward "^[ \t]*\\S-" dend t) (setq n (1+ n)))))
+ (when (or (eq t org-agenda-confirm-kill)
+ (and (numberp org-agenda-confirm-kill)
+ (> n org-agenda-confirm-kill)))
+ (let ((win-conf (current-window-configuration)))
+ (unwind-protect
+ (and
+ (prog2
+ (org-agenda-tree-to-indirect-buffer nil)
+ (not (y-or-n-p
+ (format "Delete entry with %d lines in buffer \"%s\"? "
+ n (buffer-name buffer))))
+ (kill-buffer org-last-indirect-buffer))
+ (error "Abort"))
+ (set-window-configuration win-conf))))
+ (let ((org-agenda-buffer-name bufname-orig))
+ (org-remove-subtree-entries-from-agenda buffer dbeg dend))
+ (with-current-buffer buffer (delete-region dbeg dend))
+ (message "Agenda item and source killed")))))
+
+(defvar org-archive-default-command) ; defined in org-archive.el
+(defun org-agenda-archive-default ()
+ "Archive the entry or subtree belonging to the current agenda entry."
+ (interactive)
+ (require 'org-archive)
+ (funcall-interactively
+ #'org-agenda-archive-with org-archive-default-command))
+
+(defun org-agenda-archive-default-with-confirmation ()
+ "Archive the entry or subtree belonging to the current agenda entry."
+ (interactive)
+ (require 'org-archive)
+ (funcall-interactively
+ #'org-agenda-archive-with org-archive-default-command 'confirm))
+
+(defun org-agenda-archive ()
+ "Archive the entry or subtree belonging to the current agenda entry."
+ (interactive)
+ (funcall-interactively
+ #'org-agenda-archive-with 'org-archive-subtree))
+
+(defun org-agenda-archive-to-archive-sibling ()
+ "Move the entry to the archive sibling."
+ (interactive)
+ (funcall-interactively
+ #'org-agenda-archive-with 'org-archive-to-archive-sibling))
+
+(defvar org-archive-from-agenda)
+
+(defun org-agenda-archive-with (cmd &optional confirm)
+ "Move the entry to the archive sibling."
+ (interactive)
+ (or (eq major-mode 'org-agenda-mode) (user-error "Not in agenda"))
+ (org-agenda-maybe-loop
+ #'org-agenda-archive-with cmd nil t
+ (let* ((bufname-orig (buffer-name))
+ (marker (or (org-get-at-bol 'org-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer marker))
+ (pos (marker-position marker)))
+ (org-with-remote-undo buffer
+ (with-current-buffer buffer
+ (if (derived-mode-p 'org-mode)
+ (if (and confirm
+ (not (y-or-n-p "Archive this subtree or entry? ")))
+ (error "Abort")
+ (save-window-excursion
+ (goto-char pos)
+ (let ((org-agenda-buffer-name bufname-orig))
+ (org-remove-subtree-entries-from-agenda))
+ (org-back-to-heading t)
+ (let ((org-archive-from-agenda t))
+ (funcall cmd))))
+ (error "Archiving works only in Org files")))))))
+
+(defun org-remove-subtree-entries-from-agenda (&optional buf beg end)
+ "Remove all lines in the agenda that correspond to a given subtree.
+The subtree is the one in buffer BUF, starting at BEG and ending at END.
+If this information is not given, the function uses the tree at point."
+ (let ((buf (or buf (current-buffer))) m p)
+ (save-excursion
+ (unless (and beg end)
+ (org-back-to-heading t)
+ (setq beg (point))
+ (org-end-of-subtree t)
+ (setq end (point)))
+ (set-buffer (get-buffer org-agenda-buffer-name))
+ (save-excursion
+ (goto-char (point-max))
+ (beginning-of-line 1)
+ (while (not (bobp))
+ (when (and (setq m (org-get-at-bol 'org-marker))
+ (equal buf (marker-buffer m))
+ (setq p (marker-position m))
+ (>= p beg)
+ (< p end))
+ (let ((inhibit-read-only t))
+ (delete-region (point-at-bol) (1+ (point-at-eol)))))
+ (beginning-of-line 0))))))
+
+(defun org-agenda-refile (&optional goto rfloc no-update)
+ "Refile the item at point.
+
+When called with `\\[universal-argument] \\[universal-argument]', \
+go to the location of the last
+refiled item.
+
+When called with `\\[universal-argument] \\[universal-argument] \
+\\[universal-argument]' prefix or when GOTO is 0, clear
+the refile cache.
+
+RFLOC can be a refile location obtained in a different way.
+
+When NO-UPDATE is non-nil, don't redo the agenda buffer."
+ (interactive "P")
+ (cond
+ ((member goto '(0 (64)))
+ (org-refile-cache-clear))
+ ((equal goto '(16))
+ (org-refile-goto-last-stored))
+ (t
+ (let* ((buffer-orig (buffer-name))
+ (marker (or (org-get-at-bol 'org-hd-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer marker))
+ ;; (pos (marker-position marker))
+ (rfloc (or rfloc
+ (org-refile-get-location
+ (if goto "Goto" "Refile to") buffer
+ org-refile-allow-creating-parent-nodes))))
+ (with-current-buffer buffer
+ (org-with-wide-buffer
+ (goto-char marker)
+ (let ((org-agenda-buffer-name buffer-orig))
+ (org-remove-subtree-entries-from-agenda))
+ (org-refile goto buffer rfloc))))
+ (unless no-update (org-agenda-redo)))))
+
+(defun org-agenda-open-link (&optional arg)
+ "Open the link(s) in the current entry, if any.
+This looks for a link in the displayed line in the agenda.
+It also looks at the text of the entry itself."
+ (interactive "P")
+ (let* ((marker (or (org-get-at-bol 'org-hd-marker)
+ (org-get-at-bol 'org-marker)))
+ (buffer (and marker (marker-buffer marker)))
+ (prefix (buffer-substring (point-at-bol) (point-at-eol)))
+ (lkall (and buffer (org-offer-links-in-entry
+ buffer marker arg prefix)))
+ (lk0 (car lkall))
+ (lk (if (stringp lk0) (list lk0) lk0))
+ (lkend (cdr lkall))
+ trg)
+ (cond
+ ((and buffer lk)
+ (mapcar (lambda(l)
+ (with-current-buffer buffer
+ (setq trg (and (string-match org-link-bracket-re l)
+ (match-string 1 l)))
+ (if (or (not trg) (string-match org-link-any-re trg))
+ ;; Don't use `org-with-wide-buffer' here as
+ ;; opening the link may result in moving the point
+ (save-restriction
+ (widen)
+ (goto-char marker)
+ (when (search-forward l nil lkend)
+ (goto-char (match-beginning 0))
+ (org-open-at-point)))
+ ;; This is an internal link, widen the buffer
+ ;; FIXME: use `org-switch-to-buffer-other-window'?
+ (switch-to-buffer-other-window buffer)
+ (widen)
+ (goto-char marker)
+ (when (search-forward l nil lkend)
+ (goto-char (match-beginning 0))
+ (org-open-at-point)))))
+ lk))
+ ((or (org-in-regexp (concat "\\(" org-link-bracket-re "\\)"))
+ (save-excursion
+ (beginning-of-line 1)
+ (looking-at (concat ".*?\\(" org-link-bracket-re "\\)"))))
+ (org-link-open-from-string (match-string 1)))
+ (t (message "No link to open here")))))
+
+(defun org-agenda-copy-local-variable (var)
+ "Get a variable from a referenced buffer and install it here."
+ (let ((m (org-get-at-bol 'org-marker)))
+ (when (and m (buffer-live-p (marker-buffer m)))
+ (set (make-local-variable var)
+ (with-current-buffer (marker-buffer m)
+ (symbol-value var))))))
+
+(defun org-agenda-switch-to (&optional delete-other-windows)
+ "Go to the Org mode file which contains the item at point.
+When optional argument DELETE-OTHER-WINDOWS is non-nil, the
+displayed Org file fills the frame."
+ (interactive)
+ (if (and org-return-follows-link
+ (not (org-get-at-bol 'org-marker))
+ (org-in-regexp org-link-bracket-re))
+ (org-link-open-from-string (match-string 0))
+ (let* ((marker (or (org-get-at-bol 'org-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer marker))
+ (pos (marker-position marker)))
+ (unless buffer (user-error "Trying to switch to non-existent buffer"))
+ (pop-to-buffer-same-window buffer)
+ (when delete-other-windows (delete-other-windows))
+ (widen)
+ (goto-char pos)
+ (when (derived-mode-p 'org-mode)
+ (org-show-context 'agenda)
+ (run-hooks 'org-agenda-after-show-hook)))))
+
+(defun org-agenda-goto-mouse (ev)
+ "Go to the Org file which contains the item at the mouse click."
+ (interactive "e")
+ (mouse-set-point ev)
+ (org-agenda-goto))
+
+(defun org-agenda-show (&optional full-entry)
+ "Display the Org file which contains the item at point.
+With prefix argument FULL-ENTRY, make the entire entry visible
+if it was hidden in the outline."
+ (interactive "P")
+ (let ((win (selected-window)))
+ (org-agenda-goto t)
+ (when full-entry (org-show-entry))
+ (select-window win)))
+
+(defvar org-agenda-show-window nil)
+(defun org-agenda-show-and-scroll-up (&optional arg)
+ "Display the Org file which contains the item at point.
+
+When called repeatedly, scroll the window that is displaying the buffer.
+
+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)
+ (eq this-command last-command))
+ (progn
+ (select-window org-agenda-show-window)
+ (ignore-errors (scroll-up)))
+ (org-agenda-goto t)
+ (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))))
+ (setq org-agenda-show-window (selected-window)))
+ (select-window win)))
+
+(defun org-agenda-show-scroll-down ()
+ "Scroll down the window showing the agenda."
+ (interactive)
+ (let ((win (selected-window)))
+ (when (window-live-p org-agenda-show-window)
+ (select-window org-agenda-show-window)
+ (ignore-errors (scroll-down))
+ (select-window win))))
+
+(defun org-agenda-show-1 (&optional more)
+ "Display the Org file which contains the item at point.
+The prefix arg selects the amount of information to display:
+
+0 hide the subtree
+1 just show the entry according to defaults.
+2 show the children view
+3 show the subtree view
+4 show the entire subtree and any drawers
+With prefix argument FULL-ENTRY, make the entire entry visible
+if it was hidden in the outline."
+ (interactive "p")
+ (let ((win (selected-window)))
+ (org-agenda-goto t)
+ (org-back-to-heading)
+ (set-window-start (selected-window) (point-at-bol))
+ (cond
+ ((= more 0)
+ (org-flag-subtree t)
+ (save-excursion
+ (org-back-to-heading)
+ (run-hook-with-args 'org-cycle-hook 'folded))
+ (message "Remote: FOLDED"))
+ ((and (called-interactively-p 'any) (= more 1))
+ (message "Remote: show with default settings"))
+ ((= more 2)
+ (outline-show-entry)
+ (org-show-children)
+ (save-excursion
+ (org-back-to-heading)
+ (run-hook-with-args 'org-cycle-hook 'children))
+ (message "Remote: CHILDREN"))
+ ((= more 3)
+ (outline-show-subtree)
+ (save-excursion
+ (org-back-to-heading)
+ (run-hook-with-args 'org-cycle-hook 'subtree))
+ (message "Remote: SUBTREE"))
+ ((> more 3)
+ (outline-show-subtree)
+ (message "Remote: SUBTREE AND ALL DRAWERS")))
+ (select-window win)))
+
+(defvar org-agenda-cycle-counter nil)
+(defun org-agenda-cycle-show (&optional n)
+ "Show the current entry in another window, with default settings.
+
+Default settings are taken from `org-show-context-detail'. When
+use repeatedly in immediate succession, the remote entry will
+cycle through visibility
+
+ children -> subtree -> folded
+
+When called with a numeric prefix arg, that arg will be passed through to
+`org-agenda-show-1'. For the interpretation of that argument, see the
+docstring of `org-agenda-show-1'."
+ (interactive "P")
+ (if (integerp n)
+ (setq org-agenda-cycle-counter n)
+ (if (not (eq last-command this-command))
+ (setq org-agenda-cycle-counter 1)
+ (if (equal org-agenda-cycle-counter 0)
+ (setq org-agenda-cycle-counter 2)
+ (setq org-agenda-cycle-counter (1+ org-agenda-cycle-counter))
+ (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)
+ "Display the Org file which contains the item at point and recenter."
+ (interactive "P")
+ (let ((win (selected-window)))
+ (org-agenda-goto t)
+ (recenter arg)
+ (select-window win)))
+
+(defun org-agenda-show-mouse (ev)
+ "Display the Org file which contains the item at the mouse click."
+ (interactive "e")
+ (mouse-set-point ev)
+ (org-agenda-show))
+
+(defun org-agenda-check-no-diary ()
+ "Check if the entry is a diary link and abort if yes."
+ (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."
+ (user-error "Command not allowed in this line"))
+
+(defun org-agenda-tree-to-indirect-buffer (arg)
+ "Show the subtree corresponding to the current entry in an indirect buffer.
+This calls the command `org-tree-to-indirect-buffer' from the original buffer.
+
+With a numerical prefix ARG, go up to this level and then take that tree.
+With a negative numeric ARG, go up by this number of levels.
+
+With a `\\[universal-argument]' prefix, make a separate frame for this tree, \
+i.e. don't use
+the dedicated frame."
+ (interactive "P")
+ (if current-prefix-arg
+ (org-agenda-do-tree-to-indirect-buffer arg)
+ (let ((agenda-buffer (buffer-name))
+ (agenda-window (selected-window))
+ (indirect-window
+ (and org-last-indirect-buffer
+ (get-buffer-window org-last-indirect-buffer))))
+ (save-window-excursion (org-agenda-do-tree-to-indirect-buffer arg))
+ (unless (or (eq org-indirect-buffer-display 'new-frame)
+ (eq org-indirect-buffer-display 'dedicated-frame))
+ (unwind-protect
+ (unless (and indirect-window (window-live-p indirect-window))
+ (setq indirect-window (split-window agenda-window)))
+ (and indirect-window (select-window indirect-window))
+ (switch-to-buffer org-last-indirect-buffer :norecord)
+ (fit-window-to-buffer indirect-window)))
+ (select-window (get-buffer-window agenda-buffer))
+ (setq org-agenda-last-indirect-buffer org-last-indirect-buffer))))
+
+(defun org-agenda-do-tree-to-indirect-buffer (arg)
+ "Same as `org-agenda-tree-to-indirect-buffer' without saving window."
+ (org-agenda-check-no-diary)
+ (let* ((marker (or (org-get-at-bol 'org-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer marker))
+ (pos (marker-position marker)))
+ (with-current-buffer buffer
+ (save-excursion
+ (goto-char pos)
+ (org-tree-to-indirect-buffer arg)))))
+
+(defvar org-last-heading-marker (make-marker)
+ "Marker pointing to the headline that last changed its TODO state
+by a remote command from the agenda.")
+
+(defun org-agenda-todo-nextset ()
+ "Switch TODO entry to next sequence."
+ (interactive)
+ (org-agenda-todo 'nextset))
+
+(defun org-agenda-todo-previousset ()
+ "Switch TODO entry to previous sequence."
+ (interactive)
+ (org-agenda-todo 'previousset))
+
+(defvar org-agenda-headline-snapshot-before-repeat)
+
+(defun org-agenda-todo (&optional arg)
+ "Cycle TODO state of line at point, also in Org file.
+This changes the line at point, all other lines in the agenda referring to
+the same tree node, and the headline of the tree node in the Org file."
+ (interactive "P")
+ (org-agenda-check-no-diary)
+ (org-agenda-maybe-loop
+ #'org-agenda-todo arg nil nil
+ (let* ((col (current-column))
+ (marker (or (org-get-at-bol 'org-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer marker))
+ (pos (marker-position marker))
+ (hdmarker (org-get-at-bol 'org-hd-marker))
+ (todayp (org-agenda-today-p (org-get-at-bol 'day)))
+ (inhibit-read-only t)
+ org-loop-over-headlines-in-active-region
+ org-agenda-headline-snapshot-before-repeat newhead just-one)
+ (org-with-remote-undo buffer
+ (with-current-buffer buffer
+ (widen)
+ (goto-char pos)
+ (org-show-context 'agenda)
+ (let ((current-prefix-arg arg))
+ (call-interactively 'org-todo)
+ ;; Make sure that log is recorded in current undo.
+ (when (and org-log-setup
+ (not (eq org-log-note-how 'note)))
+ (org-add-log-note)))
+ (and (bolp) (forward-char 1))
+ (setq newhead (org-get-heading))
+ (when (and org-agenda-headline-snapshot-before-repeat
+ (not (equal org-agenda-headline-snapshot-before-repeat
+ newhead))
+ todayp)
+ (setq newhead org-agenda-headline-snapshot-before-repeat
+ just-one t))
+ (save-excursion
+ (org-back-to-heading)
+ (move-marker org-last-heading-marker (point))))
+ (beginning-of-line 1)
+ (save-window-excursion
+ (org-agenda-change-all-lines newhead hdmarker 'fixface just-one))
+ (when (bound-and-true-p org-clock-out-when-done)
+ (string-match (concat "^" (regexp-opt org-done-keywords-for-agenda))
+ newhead)
+ (org-agenda-unmark-clocking-task))
+ (org-move-to-column col)
+ (org-agenda-mark-clocking-task)))))
+
+(defun org-agenda-add-note (&optional _arg)
+ "Add a time-stamped note to the entry at point."
+ (interactive) ;; "P"
+ (org-agenda-check-no-diary)
+ (let* ((marker (or (org-get-at-bol 'org-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer marker))
+ (pos (marker-position marker))
+ (_hdmarker (org-get-at-bol 'org-hd-marker))
+ (inhibit-read-only t))
+ (with-current-buffer buffer
+ (widen)
+ (goto-char pos)
+ (org-show-context 'agenda)
+ (org-add-note))))
+
+(defun org-agenda-change-all-lines (newhead hdmarker
+ &optional fixface just-this)
+ "Change all lines in the agenda buffer which match HDMARKER.
+The new content of the line will be NEWHEAD (as modified by
+`org-agenda-format-item'). HDMARKER is checked with
+`equal' against all `org-hd-marker' text properties in the file.
+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."
+ (let* ((inhibit-read-only t)
+ (line (org-current-line))
+ (org-agenda-buffer (current-buffer))
+ (thetags (with-current-buffer (marker-buffer hdmarker)
+ (org-get-tags hdmarker)))
+ props m undone-face done-face finish new dotime level cat tags) ;; pl
+ (save-excursion
+ (goto-char (point-max))
+ (beginning-of-line 1)
+ (while (not finish)
+ (setq finish (bobp))
+ (when (and (setq m (org-get-at-bol 'org-hd-marker))
+ (or (not just-this) (= (org-current-line) line))
+ (equal m hdmarker))
+ (setq props (text-properties-at (point))
+ dotime (org-get-at-bol 'dotime)
+ cat (org-agenda-get-category)
+ level (org-get-at-bol 'level)
+ tags thetags
+ new
+ (let ((org-prefix-format-compiled
+ (or (get-text-property (min (1- (point-max)) (point)) 'format)
+ org-prefix-format-compiled))
+ (extra (org-get-at-bol 'extra)))
+ (with-current-buffer (marker-buffer hdmarker)
+ (org-with-wide-buffer
+ (org-agenda-format-item extra newhead level cat tags dotime))))
+ ;; pl (text-property-any (point-at-bol) (point-at-eol) 'org-heading t)
+ undone-face (org-get-at-bol 'undone-face)
+ done-face (org-get-at-bol 'done-face))
+ (beginning-of-line 1)
+ (cond
+ ((equal new "") (delete-region (point) (line-beginning-position 2)))
+ ((looking-at ".*")
+ ;; When replacing the whole line, preserve bulk mark
+ ;; overlay, if any.
+ (let ((mark (catch :overlay
+ (dolist (o (overlays-in (point) (+ 2 (point))))
+ (when (eq (overlay-get o 'type)
+ 'org-marked-entry-overlay)
+ (throw :overlay o))))))
+ (replace-match new t t)
+ (beginning-of-line)
+ (when mark (move-overlay mark (point) (+ 2 (point)))))
+ (add-text-properties (point-at-bol) (point-at-eol) props)
+ (when fixface
+ (add-text-properties
+ (point-at-bol) (point-at-eol)
+ (list 'face
+ (if org-last-todo-state-is-todo
+ undone-face done-face))))
+ (org-agenda-highlight-todo 'line)
+ (beginning-of-line 1))
+ (t (error "Line update did not work")))
+ (save-restriction
+ (narrow-to-region (point-at-bol) (point-at-eol))
+ (org-agenda-finalize)))
+ (beginning-of-line 0)))))
+
+(defun org-agenda-align-tags (&optional line)
+ "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 (line-beginning-position) (point-min)))
+ (while (re-search-forward org-tag-group-re end t)
+ (add-text-properties
+ (match-beginning 1) (match-end 1)
+ (list 'face (delq nil (let ((prop (get-text-property
+ (match-beginning 1) 'face)))
+ (or (listp prop) (setq prop (list prop)))
+ (if (memq 'org-tag prop)
+ prop
+ (cons 'org-tag prop))))))
+ (setq l (string-width (match-string 1))
+ c (if (< org-agenda-tags-column 0)
+ (- (abs org-agenda-tags-column) l)
+ org-agenda-tags-column))
+ (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))) ?\s)
+ (plist-put (copy-sequence (text-properties-at (point)))
+ 'face nil))))
+ (goto-char (point-min))
+ (org-font-lock-add-tag-faces (point-max)))))
+
+(defun org-agenda-priority-up ()
+ "Increase the priority of line at point, also in Org file."
+ (interactive)
+ (org-agenda-priority 'up))
+
+(defun org-agenda-priority-down ()
+ "Decrease the priority of line at point, also in Org file."
+ (interactive)
+ (org-agenda-priority 'down))
+
+(defun org-agenda-priority (&optional force-direction)
+ "Set the priority of line at point, also in Org file.
+This changes the line at point, all other lines in the agenda
+referring to the same tree node, and the headline of the tree
+node in the Org file.
+
+Called with one universal prefix arg, show the priority instead
+of setting it.
+
+When called programmatically, FORCE-DIRECTION can be `set', `up',
+`down', or a character."
+ (interactive "P")
+ (unless org-priority-enable-commands
+ (user-error "Priority commands are disabled"))
+ (org-agenda-check-no-diary)
+ (let* ((col (current-column))
+ (hdmarker (org-get-at-bol 'org-hd-marker))
+ (buffer (marker-buffer hdmarker))
+ (pos (marker-position hdmarker))
+ (inhibit-read-only t)
+ newhead)
+ (org-with-remote-undo buffer
+ (with-current-buffer buffer
+ (widen)
+ (goto-char pos)
+ (org-show-context 'agenda)
+ (org-priority force-direction)
+ (end-of-line 1)
+ (setq newhead (org-get-heading)))
+ (org-agenda-change-all-lines newhead hdmarker)
+ (org-move-to-column col))))
+
+;; FIXME: should fix the tags property of the agenda line.
+(defun org-agenda-set-tags (&optional tag onoff)
+ "Set tags for the current headline."
+ (interactive)
+ (org-agenda-check-no-diary)
+ (if (and (org-region-active-p) (called-interactively-p 'any))
+ (call-interactively 'org-change-tag-in-region)
+ (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer hdmarker))
+ (pos (marker-position hdmarker))
+ (inhibit-read-only t)
+ newhead)
+ (org-with-remote-undo buffer
+ (with-current-buffer buffer
+ (widen)
+ (goto-char pos)
+ (org-show-context 'agenda)
+ (if tag
+ (org-toggle-tag tag onoff)
+ (call-interactively #'org-set-tags-command))
+ (end-of-line 1)
+ (setq newhead (org-get-heading)))
+ (org-agenda-change-all-lines newhead hdmarker)
+ (beginning-of-line 1)))))
+
+(defun org-agenda-set-property ()
+ "Set a property for the current headline."
+ (interactive)
+ (org-agenda-check-no-diary)
+ (org-agenda-maybe-loop
+ #'org-agenda-set-property nil nil nil
+ (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer hdmarker))
+ (pos (marker-position hdmarker))
+ (inhibit-read-only t)
+ ) ;; newhead
+ (org-with-remote-undo buffer
+ (with-current-buffer buffer
+ (widen)
+ (goto-char pos)
+ (org-show-context 'agenda)
+ (call-interactively 'org-set-property))))))
+
+(defun org-agenda-set-effort ()
+ "Set the effort property for the current headline."
+ (interactive)
+ (org-agenda-check-no-diary)
+ (org-agenda-maybe-loop
+ #'org-agenda-set-effort nil nil nil
+ (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer hdmarker))
+ (pos (marker-position hdmarker))
+ (inhibit-read-only t)
+ newhead)
+ (org-with-remote-undo buffer
+ (with-current-buffer buffer
+ (widen)
+ (goto-char pos)
+ (org-show-context 'agenda)
+ (call-interactively 'org-set-effort)
+ (end-of-line 1)
+ (setq newhead (org-get-heading)))
+ (org-agenda-change-all-lines newhead hdmarker)))))
+
+(defun org-agenda-toggle-archive-tag ()
+ "Toggle the archive tag for the current entry."
+ (interactive)
+ (org-agenda-check-no-diary)
+ (org-agenda-maybe-loop
+ #'org-agenda-toggle-archive-tag nil nil nil
+ (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer hdmarker))
+ (pos (marker-position hdmarker))
+ (inhibit-read-only t)
+ newhead)
+ (org-with-remote-undo buffer
+ (with-current-buffer buffer
+ (widen)
+ (goto-char pos)
+ (org-show-context 'agenda)
+ (call-interactively 'org-toggle-archive-tag)
+ (end-of-line 1)
+ (setq newhead (org-get-heading)))
+ (org-agenda-change-all-lines newhead hdmarker)
+ (beginning-of-line 1)))))
+
+(defun org-agenda-do-date-later (arg)
+ (interactive "P")
+ (cond
+ ((or (equal arg '(16))
+ (memq last-command
+ '(org-agenda-date-later-minutes org-agenda-date-earlier-minutes)))
+ (setq this-command 'org-agenda-date-later-minutes)
+ (org-agenda-date-later-minutes 1))
+ ((or (equal arg '(4))
+ (memq last-command
+ '(org-agenda-date-later-hours org-agenda-date-earlier-hours)))
+ (setq this-command 'org-agenda-date-later-hours)
+ (org-agenda-date-later-hours 1))
+ (t
+ (org-agenda-date-later (prefix-numeric-value arg)))))
+
+(defun org-agenda-do-date-earlier (arg)
+ (interactive "P")
+ (cond
+ ((or (equal arg '(16))
+ (memq last-command
+ '(org-agenda-date-later-minutes org-agenda-date-earlier-minutes)))
+ (setq this-command 'org-agenda-date-earlier-minutes)
+ (org-agenda-date-earlier-minutes 1))
+ ((or (equal arg '(4))
+ (memq last-command
+ '(org-agenda-date-later-hours org-agenda-date-earlier-hours)))
+ (setq this-command 'org-agenda-date-earlier-hours)
+ (org-agenda-date-earlier-hours 1))
+ (t
+ (org-agenda-date-earlier (prefix-numeric-value arg)))))
+
+(defun org-agenda-date-later (arg &optional what)
+ "Change the date of this item to ARG day(s) later."
+ (interactive "p")
+ (org-agenda-check-type t 'agenda)
+ (org-agenda-check-no-diary)
+ (let* ((marker (or (org-get-at-bol 'org-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer marker))
+ (pos (marker-position marker))
+ cdate today)
+ (org-with-remote-undo buffer
+ (with-current-buffer buffer
+ (widen)
+ (goto-char pos)
+ (unless (org-at-timestamp-p 'lax) (error "Cannot find time stamp"))
+ (when (and org-agenda-move-date-from-past-immediately-to-today
+ (equal arg 1)
+ (or (not what) (eq what 'day))
+ (not (save-match-data (org-at-date-range-p))))
+ (setq cdate (org-parse-time-string (match-string 0) 'nodefault)
+ cdate (calendar-absolute-from-gregorian
+ (list (nth 4 cdate) (nth 3 cdate) (nth 5 cdate)))
+ today (org-today))
+ (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)))
+ (let ((end org-last-changed-timestamp))
+ (org-timestamp-change arg (or what 'day))
+ (setq org-last-changed-timestamp
+ (concat org-last-changed-timestamp "--" end)))))
+ (org-agenda-show-new-time marker org-last-changed-timestamp))
+ (message "Time stamp changed to %s" org-last-changed-timestamp)))
+
+(defun org-agenda-date-earlier (arg &optional what)
+ "Change the date of this item to ARG day(s) earlier."
+ (interactive "p")
+ (org-agenda-date-later (- arg) what))
+
+(defun org-agenda-date-later-minutes (arg)
+ "Change the time of this item, in units of `org-time-stamp-rounding-minutes'."
+ (interactive "p")
+ (setq arg (* arg (cadr org-time-stamp-rounding-minutes)))
+ (org-agenda-date-later arg 'minute))
+
+(defun org-agenda-date-earlier-minutes (arg)
+ "Change the time of this item, in units of `org-time-stamp-rounding-minutes'."
+ (interactive "p")
+ (setq arg (* arg (cadr org-time-stamp-rounding-minutes)))
+ (org-agenda-date-earlier arg 'minute))
+
+(defun org-agenda-date-later-hours (arg)
+ "Change the time of this item, in hour steps."
+ (interactive "p")
+ (org-agenda-date-later arg 'hour))
+
+(defun org-agenda-date-earlier-hours (arg)
+ "Change the time of this item, in hour steps."
+ (interactive "p")
+ (org-agenda-date-earlier arg 'hour))
+
+(defun org-agenda-show-new-time (marker stamp &optional prefix)
+ "Show new date stamp via text properties."
+ ;; We use text properties to make this undoable
+ (let ((inhibit-read-only t))
+ (setq stamp (concat prefix " => " stamp " "))
+ (save-excursion
+ (goto-char (point-max))
+ (while (not (bobp))
+ (when (equal marker (org-get-at-bol 'org-marker))
+ (remove-text-properties (line-beginning-position)
+ (line-end-position)
+ '(display nil))
+ (org-move-to-column
+ (- (if (fboundp 'window-font-width)
+ (/ (window-width nil t) (window-font-width))
+ ;; Fall back to pre-9.3.3 behavior on Emacs <25.
+ (window-width))
+ (length stamp))
+ t)
+ (add-text-properties
+ (1- (point)) (point-at-eol)
+ (list 'display (org-add-props stamp nil
+ 'face '(secondary-selection default))))
+ (beginning-of-line 1))
+ (beginning-of-line 0)))))
+
+(defun org-agenda-date-prompt (arg)
+ "Change the date of this item. Date is prompted for, with default today.
+The prefix ARG is passed to the `org-time-stamp' command and can therefore
+be used to request time specification in the time stamp."
+ (interactive "P")
+ (org-agenda-check-type t 'agenda)
+ (org-agenda-check-no-diary)
+ (org-agenda-maybe-loop
+ #'org-agenda-date-prompt arg t nil
+ (let* ((marker (or (org-get-at-bol 'org-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer marker))
+ (pos (marker-position marker)))
+ (org-with-remote-undo buffer
+ (with-current-buffer buffer
+ (widen)
+ (goto-char pos)
+ (unless (org-at-timestamp-p 'lax) (error "Cannot find time stamp"))
+ (org-time-stamp arg (equal (char-after (match-beginning 0)) ?\[)))
+ (org-agenda-show-new-time marker org-last-changed-timestamp))
+ (message "Time stamp changed to %s" org-last-changed-timestamp))))
+
+(defun org-agenda-schedule (arg &optional time)
+ "Schedule the item at point.
+ARG is passed through to `org-schedule'."
+ (interactive "P")
+ (org-agenda-check-type t 'agenda 'todo 'tags 'search)
+ (org-agenda-check-no-diary)
+ (org-agenda-maybe-loop
+ #'org-agenda-schedule arg t nil
+ (let* ((marker (or (org-get-at-bol 'org-marker)
+ (org-agenda-error)))
+ ;; (type (marker-insertion-type marker))
+ (buffer (marker-buffer marker))
+ (pos (marker-position marker))
+ ts)
+ (set-marker-insertion-type marker t)
+ (org-with-remote-undo buffer
+ (with-current-buffer buffer
+ (widen)
+ (goto-char pos)
+ (setq ts (org-schedule arg time)))
+ (org-agenda-show-new-time marker ts " S"))
+ (message "%s" ts))))
+
+(defun org-agenda-deadline (arg &optional time)
+ "Schedule the item at point.
+ARG is passed through to `org-deadline'."
+ (interactive "P")
+ (org-agenda-check-type t 'agenda 'todo 'tags 'search)
+ (org-agenda-check-no-diary)
+ (org-agenda-maybe-loop
+ #'org-agenda-deadline arg t nil
+ (let* ((marker (or (org-get-at-bol 'org-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer marker))
+ (pos (marker-position marker))
+ ts)
+ (org-with-remote-undo buffer
+ (with-current-buffer buffer
+ (widen)
+ (goto-char pos)
+ (setq ts (org-deadline arg time)))
+ (org-agenda-show-new-time marker ts " D"))
+ (message "%s" ts))))
+
+(defun org-agenda-clock-in (&optional arg)
+ "Start the clock on the currently selected item."
+ (interactive "P")
+ (org-agenda-check-no-diary)
+ (if (equal arg '(4))
+ (org-clock-in arg)
+ (let* ((marker (or (org-get-at-bol 'org-marker)
+ (org-agenda-error)))
+ (hdmarker (or (org-get-at-bol 'org-hd-marker) marker))
+ (pos (marker-position marker))
+ (col (current-column))
+ newhead)
+ (org-with-remote-undo (marker-buffer marker)
+ (with-current-buffer (marker-buffer marker)
+ (widen)
+ (goto-char pos)
+ (org-show-context 'agenda)
+ (org-clock-in arg)
+ (setq newhead (org-get-heading)))
+ (org-agenda-change-all-lines newhead hdmarker))
+ (org-move-to-column col))))
+
+(defun org-agenda-clock-out ()
+ "Stop the currently running clock."
+ (interactive)
+ (unless (marker-buffer org-clock-marker)
+ (user-error "No running clock"))
+ (let ((marker (make-marker)) (col (current-column)) newhead)
+ (org-with-remote-undo (marker-buffer org-clock-marker)
+ (with-current-buffer (marker-buffer org-clock-marker)
+ (org-with-wide-buffer
+ (goto-char org-clock-marker)
+ (org-back-to-heading t)
+ (move-marker marker (point))
+ (org-clock-out)
+ (setq newhead (org-get-heading)))))
+ (org-agenda-change-all-lines newhead marker)
+ (move-marker marker nil)
+ (org-move-to-column col)
+ (org-agenda-unmark-clocking-task)))
+
+(defun org-agenda-clock-cancel (&optional _arg)
+ "Cancel the currently running clock."
+ (interactive) ;; "P"
+ (unless (marker-buffer org-clock-marker)
+ (user-error "No running clock"))
+ (org-with-remote-undo (marker-buffer org-clock-marker)
+ (org-clock-cancel)))
+
+(defun org-agenda-clock-goto ()
+ "Jump to the currently clocked in task within the agenda.
+If the currently clocked in task is not listed in the agenda
+buffer, display it in another window."
+ (interactive)
+ (let (pos)
+ (mapc (lambda (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
+ ;; buffer, we visit it in another window:
+ ((bound-and-true-p org-clock-current-task)
+ (org-switch-to-buffer-other-window (org-clock-goto)))
+ (t (message "No running clock, use `C-c C-x C-j' to jump to the most recent one")))))
+
+(defun org-agenda-diary-entry-in-org-file ()
+ "Make a diary entry in the file `org-agenda-diary-file'."
+ (let (d1 d2 char (text "") dp1 dp2)
+ (if (equal (buffer-name) "*Calendar*")
+ (setq d1 (calendar-cursor-to-date t)
+ d2 (car calendar-mark-ring))
+ (setq dp1 (get-text-property (point-at-bol) 'day))
+ (unless dp1 (user-error "No date defined in current line"))
+ (setq d1 (calendar-gregorian-from-absolute dp1)
+ d2 (and (ignore-errors (mark))
+ (save-excursion
+ (goto-char (mark))
+ (setq dp2 (get-text-property (point-at-bol) 'day)))
+ (calendar-gregorian-from-absolute dp2))))
+ (message "Diary entry: [d]ay [a]nniversary [b]lock [j]ump to date tree")
+ (setq char (read-char-exclusive))
+ (cond
+ ((equal char ?d)
+ (setq text (read-string "Day entry: "))
+ (org-agenda-add-entry-to-org-agenda-diary-file 'day text d1)
+ (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo)))
+ ((equal char ?a)
+ (setq d1 (list (car d1) (nth 1 d1)
+ (read-number (format "Reference year [%d]: " (nth 2 d1))
+ (nth 2 d1))))
+ (setq text (read-string "Anniversary (use %d to show years): "))
+ (org-agenda-add-entry-to-org-agenda-diary-file 'anniversary text d1)
+ (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo)))
+ ((equal char ?b)
+ (setq text (read-string "Block entry: "))
+ (unless (and d1 d2 (not (equal d1 d2)))
+ (user-error "No block of days selected"))
+ (org-agenda-add-entry-to-org-agenda-diary-file 'block text d1 d2)
+ (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo)))
+ ((equal char ?j)
+ (org-switch-to-buffer-other-window
+ (find-file-noselect org-agenda-diary-file))
+ (require 'org-datetree)
+ (org-datetree-find-date-create d1)
+ (org-reveal t))
+ (t (user-error "Invalid selection character `%c'" char)))))
+
+(defcustom org-agenda-insert-diary-strategy 'date-tree
+ "Where in `org-agenda-diary-file' should new entries be added?
+Valid values:
+
+date-tree in the date tree, as first child of the date
+date-tree-last in the date tree, as last child of the date
+top-level as top-level entries at the end of the file."
+ :group 'org-agenda
+ :type '(choice
+ (const :tag "first in a date tree" date-tree)
+ (const :tag "last in a date tree" date-tree-last)
+ (const :tag "as top level at end of file" top-level)))
+
+(defcustom org-agenda-insert-diary-extract-time nil
+ "Non-nil means extract any time specification from the diary entry."
+ :group 'org-agenda
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-agenda-bulk-mark-char ">"
+ "A single-character string to be used as the bulk mark."
+ :group 'org-agenda
+ :version "24.1"
+ :type 'string)
+
+(defun org-agenda-add-entry-to-org-agenda-diary-file (type text &optional d1 d2)
+ "Add a diary entry with TYPE to `org-agenda-diary-file'.
+If TEXT is not empty, it will become the headline of the new entry, and
+the resulting entry will not be shown. When TEXT is empty, switch to
+`org-agenda-diary-file' and let the user finish the entry there."
+ (let ((cw (current-window-configuration)))
+ (org-switch-to-buffer-other-window
+ (find-file-noselect org-agenda-diary-file))
+ (widen)
+ (goto-char (point-min))
+ (cl-case type
+ (anniversary
+ (or (re-search-forward "^\\*[ \t]+Anniversaries" nil t)
+ (progn
+ (or (org-at-heading-p t)
+ (progn
+ (outline-next-heading)
+ (insert "* Anniversaries\n\n")
+ (beginning-of-line -1)))))
+ (outline-next-heading)
+ (org-back-over-empty-lines)
+ (backward-char 1)
+ (insert "\n")
+ (insert (format "%%%%(org-anniversary %d %2d %2d) %s"
+ (nth 2 d1) (car d1) (nth 1 d1) text)))
+ (day
+ (let ((org-prefix-has-time t)
+ (org-agenda-time-leading-zero t)
+ fmt time time2)
+ (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)
+ (org-datetree-find-date-create d1)
+ (org-agenda-insert-diary-make-new-entry text))
+ (org-insert-time-stamp (org-time-from-absolute
+ (calendar-absolute-from-gregorian d1))
+ nil nil nil nil time2))
+ (end-of-line 0))
+ ((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)
+ (org-datetree-find-date-create d1)
+ (org-agenda-insert-diary-make-new-entry text))
+ (org-insert-time-stamp (org-time-from-absolute
+ (calendar-absolute-from-gregorian d1)))
+ (insert "--")
+ (org-insert-time-stamp (org-time-from-absolute
+ (calendar-absolute-from-gregorian d2)))
+ (end-of-line 0)))
+ (if (string-match "\\S-" text)
+ (progn
+ (set-window-configuration cw)
+ (message "%s entry added to %s"
+ (capitalize (symbol-name type))
+ (abbreviate-file-name org-agenda-diary-file)))
+ (org-reveal t)
+ (message "Please finish entry here"))))
+
+(defun org-agenda-insert-diary-as-top-level (text)
+ "Make new entry as a top-level entry at the end of the file.
+Add TEXT as headline, and position the cursor in the second line so that
+a timestamp can be added there."
+ (widen)
+ (goto-char (point-max))
+ (unless (bolp) (insert "\n"))
+ (org-insert-heading nil t t)
+ (insert text)
+ (org-end-of-meta-data)
+ (unless (bolp) (insert "\n"))
+ (when org-adapt-indentation (indent-to-column 2)))
+
+(defun org-agenda-insert-diary-make-new-entry (text)
+ "Make a new entry with TEXT as a child of the current subtree.
+Position the point in the heading's first body line so that
+a timestamp can be added there."
+ (cond
+ ((eq org-agenda-insert-diary-strategy 'date-tree-last)
+ (end-of-line)
+ (org-insert-heading '(4) t)
+ (org-do-demote))
+ (t
+ (outline-next-heading)
+ (org-back-over-empty-lines)
+ (unless (looking-at "[ \t]*$") (save-excursion (insert "\n")))
+ (org-insert-heading nil t)
+ (org-do-demote)))
+ (let ((col (current-column)))
+ (insert text)
+ (org-end-of-meta-data)
+ ;; Ensure point is left on a blank line, at proper indentation.
+ (unless (bolp) (insert "\n"))
+ (unless (looking-at-p "^[ \t]*$") (save-excursion (insert "\n")))
+ (when org-adapt-indentation (indent-to-column col)))
+ (org-show-set-visibility 'lineage))
+
+(defun org-agenda-diary-entry ()
+ "Make a diary entry, like the `i' command from the calendar.
+All the standard commands work: block, weekly etc.
+When `org-agenda-diary-file' points to a file,
+`org-agenda-diary-entry-in-org-file' is called instead to create
+entries in that Org file."
+ (interactive)
+ (if (not (eq org-agenda-diary-file 'diary-file))
+ (org-agenda-diary-entry-in-org-file)
+ (require 'diary-lib)
+ (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)
+ (?m . diary-insert-monthly-entry)
+ (?y . diary-insert-yearly-entry)
+ (?a . diary-insert-anniversary-entry)
+ (?b . diary-insert-block-entry)
+ (?c . diary-insert-cyclic-entry)))))
+ (oldf (symbol-function 'calendar-cursor-to-date))
+ ;; (buf (get-file-buffer (substitute-in-file-name diary-file)))
+ (point (point))
+ (mark (or (mark t) (point))))
+ (unless cmd
+ (user-error "No command associated with <%c>" char))
+ (unless (and (get-text-property point 'day)
+ (or (not (equal ?b char))
+ (get-text-property mark 'day)))
+ (user-error "Don't know which date to use for diary entry"))
+ ;; We implement this by hacking the `calendar-cursor-to-date' function
+ ;; and the `calendar-mark-ring' variable. Saves a lot of code.
+ (let ((calendar-mark-ring
+ (list (calendar-gregorian-from-absolute
+ (or (get-text-property mark 'day)
+ (get-text-property point 'day))))))
+ (unwind-protect
+ (progn
+ (fset 'calendar-cursor-to-date
+ (lambda (&optional _error _dummy)
+ (calendar-gregorian-from-absolute
+ (get-text-property point 'day))))
+ (call-interactively cmd))
+ (fset 'calendar-cursor-to-date oldf))))))
+
+(defun org-agenda-execute-calendar-command (cmd)
+ "Execute a calendar command from the agenda with date from cursor."
+ (org-agenda-check-type t 'agenda)
+ (require 'diary-lib)
+ (unless (get-text-property (min (1- (point-max)) (point)) 'day)
+ (user-error "Don't know which date to use for the calendar command"))
+ (let* ((oldf (symbol-function 'calendar-cursor-to-date))
+ (point (point))
+ (date (calendar-gregorian-from-absolute
+ (get-text-property point 'day))))
+ ;; the following 2 vars are needed in the calendar
+ (org-dlet
+ ((displayed-month (car date))
+ (displayed-year (nth 2 date)))
+ (unwind-protect
+ (progn
+ (fset 'calendar-cursor-to-date
+ (lambda (&optional _error _dummy)
+ (calendar-gregorian-from-absolute
+ (get-text-property point 'day))))
+ (call-interactively cmd))
+ (fset 'calendar-cursor-to-date oldf)))))
+
+(defun org-agenda-phases-of-moon ()
+ "Display the phases of the moon for the 3 months around the cursor date."
+ (interactive)
+ (org-agenda-execute-calendar-command 'calendar-lunar-phases))
+
+(defun org-agenda-holidays ()
+ "Display the holidays for the 3 months around the cursor date."
+ (interactive)
+ (org-agenda-execute-calendar-command 'calendar-list-holidays))
+
+(defvar calendar-longitude) ; defined in calendar.el
+(defvar calendar-latitude) ; defined in calendar.el
+(defvar calendar-location-name) ; defined in calendar.el
+
+(defun org-agenda-sunrise-sunset (arg)
+ "Display sunrise and sunset for the cursor date.
+Latitude and longitude can be specified with the variables
+`calendar-latitude' and `calendar-longitude'. When called with prefix
+argument, latitude and longitude will be prompted for."
+ (interactive "P")
+ (require 'solar)
+ (let ((calendar-longitude (if arg nil calendar-longitude))
+ (calendar-latitude (if arg nil calendar-latitude))
+ (calendar-location-name
+ (if arg "the given coordinates" calendar-location-name)))
+ (org-agenda-execute-calendar-command 'calendar-sunrise-sunset)))
+
+(defun org-agenda-goto-calendar ()
+ "Open the Emacs calendar with the date at the cursor."
+ (interactive)
+ (org-agenda-check-type t 'agenda)
+ (let* ((day (or (get-text-property (min (1- (point-max)) (point)) 'day)
+ (user-error "Don't know which date to open in calendar")))
+ (date (calendar-gregorian-from-absolute day))
+ (calendar-move-hook nil)
+ (calendar-view-holidays-initially-flag nil)
+ (calendar-view-diary-initially-flag nil))
+ (calendar)
+ (calendar-goto-date date)))
+
+;;;###autoload
+(defun org-calendar-goto-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'."
+ (interactive)
+ ;; Temporarily disable sticky agenda since user clearly wants to
+ ;; refresh view anyway.
+ (let ((org-agenda-buffer-tmp-name "*Org Agenda(a)*")
+ (org-agenda-sticky nil))
+ (org-agenda-list nil (calendar-absolute-from-gregorian
+ (calendar-cursor-to-date))
+ nil)))
+
+(defun org-agenda-convert-date ()
+ (interactive)
+ (org-agenda-check-type t 'agenda)
+ (let ((day (get-text-property (min (1- (point-max)) (point)) 'day))
+ date s)
+ (unless day
+ (user-error "Don't know which date to convert"))
+ (setq date (calendar-gregorian-from-absolute day))
+ (setq s (concat
+ "Gregorian: " (calendar-date-string date) "\n"
+ "ISO: " (calendar-iso-date-string date) "\n"
+ "Day of Yr: " (calendar-day-of-year-string date) "\n"
+ "Julian: " (calendar-julian-date-string date) "\n"
+ "Astron. JD: " (calendar-astro-date-string date)
+ " (Julian date number at noon UTC)\n"
+ "Hebrew: " (calendar-hebrew-date-string date) " (until sunset)\n"
+ "Islamic: " (calendar-islamic-date-string date) " (until sunset)\n"
+ "French: " (calendar-french-date-string date) "\n"
+ "Bahá’í: " (calendar-bahai-date-string date) " (until sunset)\n"
+ "Mayan: " (calendar-mayan-date-string date) "\n"
+ "Coptic: " (calendar-coptic-date-string date) "\n"
+ "Ethiopic: " (calendar-ethiopic-date-string date) "\n"
+ "Persian: " (calendar-persian-date-string date) "\n"
+ "Chinese: " (calendar-chinese-date-string date) "\n"))
+ (with-output-to-temp-buffer "*Dates*"
+ (princ s))
+ (org-fit-window-to-buffer (get-buffer-window "*Dates*"))))
+
+;;; Bulk commands
+
+(defun org-agenda-bulk-marked-p ()
+ "Non-nil when current entry is marked for bulk action."
+ (eq (get-char-property (point-at-bol) 'type)
+ 'org-marked-entry-overlay))
+
+(defun org-agenda-bulk-mark (&optional arg)
+ "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 (_ (or arg 1))
+ (unless (org-get-at-bol 'org-agenda-diary-link)
+ (let* ((m (org-get-at-bol 'org-hd-marker))
+ ov)
+ (unless (org-agenda-bulk-marked-p)
+ (unless m (user-error "Nothing to mark at point"))
+ (push m org-agenda-bulk-marked-entries)
+ (setq ov (make-overlay (point-at-bol) (+ 2 (point-at-bol))))
+ (org-overlay-display ov (concat org-agenda-bulk-mark-char " ")
+ (org-get-todo-face "TODO")
+ 'evaporate)
+ (overlay-put ov 'type 'org-marked-entry-overlay))
+ (end-of-line 1)
+ (or (ignore-errors
+ (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)))
+
+(defun org-agenda-bulk-mark-all ()
+ "Mark all entries for future agenda bulk action."
+ (interactive)
+ (org-agenda-bulk-mark-regexp "."))
+
+(defun org-agenda-bulk-mark-regexp (regexp)
+ "Mark entries matching REGEXP for future agenda bulk action."
+ (interactive "sMark entries matching regexp: ")
+ (let ((entries-marked 0) txt-at-point)
+ (save-excursion
+ (goto-char (point-min))
+ (goto-char (next-single-property-change (point) 'org-hd-marker))
+ (while (and (re-search-forward regexp nil t)
+ (setq txt-at-point
+ (get-text-property (match-beginning 0) 'txt)))
+ (if (get-char-property (point) 'invisible)
+ (beginning-of-line 2)
+ (when (string-match-p regexp txt-at-point)
+ (setq entries-marked (1+ entries-marked))
+ (call-interactively 'org-agenda-bulk-mark)))))
+ (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."
+ (interactive "P")
+ (if arg
+ (org-agenda-bulk-unmark-all)
+ (cond ((org-agenda-bulk-marked-p)
+ (org-agenda-bulk-remove-overlays
+ (point-at-bol) (+ 2 (point-at-bol)))
+ (setq org-agenda-bulk-marked-entries
+ (delete (org-get-at-bol 'org-hd-marker)
+ org-agenda-bulk-marked-entries))
+ (end-of-line 1)
+ (or (ignore-errors
+ (goto-char (next-single-property-change (point) 'txt)))
+ (beginning-of-line 2))
+ (while (and (get-char-property (point) 'invisible) (not (eobp)))
+ (beginning-of-line 2))
+ (message "%d entries left marked for bulk action"
+ (length org-agenda-bulk-marked-entries)))
+ (t (message "No entry to unmark here")))))
+
+(defun org-agenda-bulk-toggle-all ()
+ "Toggle all marks for bulk action."
+ (interactive)
+ (save-excursion
+ (goto-char (point-min))
+ (while (ignore-errors
+ (goto-char (next-single-property-change (point) 'org-hd-marker)))
+ (org-agenda-bulk-toggle))))
+
+(defun org-agenda-bulk-toggle ()
+ "Toggle the mark at point for bulk action."
+ (interactive)
+ (if (org-agenda-bulk-marked-p)
+ (org-agenda-bulk-unmark)
+ (org-agenda-bulk-mark)))
+
+(defun org-agenda-bulk-remove-overlays (&optional beg end)
+ "Remove the mark overlays between BEG and END in the agenda buffer.
+BEG and END default to the buffer limits.
+
+This only removes the overlays, it does not remove the markers
+from the list in `org-agenda-bulk-marked-entries'."
+ (interactive)
+ (mapc (lambda (ov)
+ (and (eq (overlay-get ov 'type) 'org-marked-entry-overlay)
+ (delete-overlay ov)))
+ (overlays-in (or beg (point-min)) (or end (point-max)))))
+
+(defun org-agenda-bulk-unmark-all ()
+ "Remove all marks in the agenda buffer.
+This will remove the markers and the overlays."
+ (interactive)
+ (if (null org-agenda-bulk-marked-entries)
+ (message "No entry to unmark")
+ (setq org-agenda-bulk-marked-entries nil)
+ (org-agenda-bulk-remove-overlays (point-min) (point-max))))
+
+(defcustom org-agenda-persistent-marks nil
+ "Non-nil means marked items will stay marked after a bulk action.
+You can toggle this interactively by typing `p' when prompted for a
+bulk action."
+ :group 'org-agenda
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-agenda-loop-over-headlines-in-active-region t
+ "Shall some commands act upon headlines in the active region?
+
+When set to t, some commands will be performed in all headlines
+within the active region.
+
+When set to `start-level', some commands will be performed in all
+headlines within the active region, provided that these headlines
+are of the same level than the first one.
+
+When set to a regular expression, those commands will be
+performed on the matching headlines within the active region.
+
+The list of commands is: `org-agenda-schedule',
+`org-agenda-deadline', `org-agenda-date-prompt',
+`org-agenda-todo', `org-agenda-archive*', `org-agenda-kill'.
+
+See `org-loop-over-headlines-in-active-region' for the equivalent
+option for Org buffers."
+ :type '(choice (const :tag "Don't loop" nil)
+ (const :tag "All headlines in active region" t)
+ (const :tag "In active region, headlines at the same level than the first one" start-level)
+ (regexp :tag "Regular expression matcher"))
+ :version "27.1"
+ :package-version '(Org . "9.4")
+ :group 'org-agenda)
+
+(defun org-agenda-bulk-action (&optional arg)
+ "Execute an remote-editing action on all marked entries.
+The prefix arg is passed through to the command if possible."
+ (interactive "P")
+ ;; 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)
+ (buffer-live-p (marker-buffer m))
+ (marker-position m))
+ (user-error "Marker %s for bulk command is invalid" m)))
+
+ ;; Prompt for the bulk command.
+ (org-unlogged-message
+ (concat "Bulk (" (if org-agenda-persistent-marks "" "don't ") "[p]ersist marks): "
+ "[$]arch [A]rch->sib [t]odo [+/-]tag [s]chd [d]eadline [r]efile "
+ "[S]catter [f]unction "
+ (and org-agenda-bulk-custom-functions
+ (format " Custom: [%s]"
+ (mapconcat (lambda (f) (char-to-string (car f)))
+ org-agenda-bulk-custom-functions
+ "")))))
+ (catch 'exit
+ (let* ((org-log-refile (if org-log-refile 'time nil))
+ (entries (reverse org-agenda-bulk-marked-entries))
+ (org-overriding-default-time
+ (and (get-text-property (point) 'org-agenda-date-header)
+ (org-get-cursor-date)))
+ redo-at-end
+ cmd)
+ (pcase (read-char-exclusive)
+ (?p
+ (let ((org-agenda-persistent-marks
+ (not org-agenda-persistent-marks)))
+ (org-agenda-bulk-action)
+ (throw 'exit nil)))
+
+ (?$
+ (setq cmd #'org-agenda-archive))
+
+ (?A
+ (setq cmd #'org-agenda-archive-to-archive-sibling))
+
+ ((or ?r ?w)
+ (let ((refile-location
+ (org-refile-get-location
+ "Refile to"
+ (marker-buffer (car entries))
+ org-refile-allow-creating-parent-nodes)))
+ (when (nth 3 refile-location)
+ (setcar (nthcdr 3 refile-location)
+ (move-marker
+ (make-marker)
+ (nth 3 refile-location)
+ (or (get-file-buffer (nth 1 refile-location))
+ (find-buffer-visiting (nth 1 refile-location))
+ (error "This should not happen")))))
+
+ (setq cmd (lambda () (org-agenda-refile nil refile-location t)))
+ (setq redo-at-end t)))
+
+ (?t
+ (let ((state (completing-read
+ "Todo state: "
+ (with-current-buffer (marker-buffer (car entries))
+ (mapcar #'list org-todo-keywords-1)))))
+ (setq cmd (lambda ()
+ (let ((org-inhibit-blocking t)
+ (org-inhibit-logging 'note))
+ (org-agenda-todo state))))))
+
+ ((and (or ?- ?+) action)
+ (let ((tag (completing-read
+ (format "Tag to %s: " (if (eq action ?+) "add" "remove"))
+ (with-current-buffer (marker-buffer (car entries))
+ (delq nil
+ (mapcar (lambda (x) (and (stringp (car x)) x))
+ org-current-tag-alist))))))
+ (setq cmd
+ (lambda ()
+ (org-agenda-set-tags tag
+ (if (eq action ?+) 'on 'off))))))
+
+ ((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/resetting deadline as Org cannot cope with
+ ;; simultaneous notes. Besides, it could be annoying
+ ;; depending on the number of marked items.
+ (setq cmd
+ (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)
+ (user-error "Can't scatter tasks in \"%s\" agenda view" org-agenda-type))
+ (let ((days (read-number
+ (format "Scatter tasks across how many %sdays: "
+ (if arg "week" ""))
+ 7)))
+ (setq cmd
+ (lambda ()
+ (let ((distance (1+ (random days))))
+ (when arg
+ (let ((dist distance)
+ (day-of-week
+ (calendar-day-of-week
+ (calendar-gregorian-from-absolute (org-today)))))
+ (dotimes (_ (1+ dist))
+ (while (member day-of-week org-agenda-weekend-days)
+ (cl-incf distance)
+ (cl-incf day-of-week)
+ (when (= day-of-week 7)
+ (setq day-of-week 0)))
+ (cl-incf day-of-week)
+ (when (= day-of-week 7)
+ (setq day-of-week 0)))))
+ ;; Silently fail when try to replan a sexp entry.
+ (ignore-errors
+ (let* ((date (calendar-gregorian-from-absolute
+ (+ (org-today) distance)))
+ (time (encode-time 0 0 0 (nth 1 date) (nth 0 date)
+ (nth 2 date))))
+ (org-agenda-schedule nil time))))))))
+
+ (?f
+ (setq cmd
+ (intern
+ (completing-read "Function: " obarray #'fboundp t nil nil))))
+
+ (action
+ (setq cmd
+ (pcase (assoc action org-agenda-bulk-custom-functions)
+ (`(,_ ,fn)
+ fn)
+ (`(,_ ,fn ,arg-fn)
+ (apply #'apply-partially fn (funcall arg-fn)))
+ (_
+ (user-error "Invalid bulk action: %c" action))))
+ (setq redo-at-end t)))
+ ;; Sort the markers, to make sure that parents are handled
+ ;; before children.
+ (setq entries (sort entries
+ (lambda (a b)
+ (cond
+ ((eq (marker-buffer a) (marker-buffer b))
+ (< (marker-position a) (marker-position b)))
+ (t
+ (string< (buffer-name (marker-buffer a))
+ (buffer-name (marker-buffer b))))))))
+
+ ;; Now loop over all markers and apply CMD.
+ (let ((processed 0)
+ (skipped 0))
+ (dolist (e entries)
+ (let ((pos (text-property-any (point-min) (point-max) 'org-hd-marker e)))
+ (if (not pos)
+ (progn (message "Skipping removed entry at %s" e)
+ (cl-incf skipped))
+ (goto-char pos)
+ (let (org-loop-over-headlines-in-active-region) (funcall cmd))
+ ;; `post-command-hook' is not run yet. We make sure any
+ ;; pending log note is processed.
+ (when org-log-setup (org-add-log-note))
+ (cl-incf processed))))
+ (when redo-at-end (org-agenda-redo))
+ (unless org-agenda-persistent-marks (org-agenda-bulk-unmark-all))
+ (message "Acted on %d entries%s%s"
+ processed
+ (if (= skipped 0)
+ ""
+ (format ", skipped %d (disappeared before their turn)"
+ skipped))
+ (if (not org-agenda-persistent-marks) "" " (kept marked)"))))))
+
+(defun org-agenda-capture (&optional with-time)
+ "Call `org-capture' with the date at point.
+With a `C-1' prefix, use the HH:MM value at point (if any) or the
+current HH:MM time."
+ (interactive "P")
+ (if (not (eq major-mode 'org-agenda-mode))
+ (user-error "You cannot do this outside of agenda buffers")
+ (let ((org-overriding-default-time
+ (org-get-cursor-date (equal with-time 1))))
+ (call-interactively 'org-capture))))
+
+;;; Dragging agenda lines forward/backward
+
+(defun org-agenda-reapply-filters ()
+ "Re-apply all agenda filters."
+ (mapcar
+ (lambda(f) (when (car f) (org-agenda-filter-apply (car f) (cadr f) t)))
+ `((,org-agenda-tag-filter tag)
+ (,org-agenda-category-filter category)
+ (,org-agenda-regexp-filter regexp)
+ (,org-agenda-effort-filter effort)
+ (,(get 'org-agenda-tag-filter :preset-filter) tag)
+ (,(get 'org-agenda-category-filter :preset-filter) category)
+ (,(get 'org-agenda-effort-filter :preset-filter) effort)
+ (,(get 'org-agenda-regexp-filter :preset-filter) regexp))))
+
+(defun org-agenda-drag-line-forward (arg &optional backward)
+ "Drag an agenda line forward by ARG lines.
+When the optional argument `backward' is non-nil, move backward."
+ (interactive "p")
+ (let ((inhibit-read-only t) lst line)
+ (if (or (not (get-text-property (point) 'txt))
+ (save-excursion
+ (dotimes (_ arg)
+ (move-beginning-of-line (if backward 0 2))
+ (push (not (get-text-property (point) 'txt)) lst))
+ (delq nil lst)))
+ (message "Cannot move line forward")
+ (let ((end (save-excursion (move-beginning-of-line 2) (point))))
+ (move-beginning-of-line 1)
+ (setq line (buffer-substring (point) end))
+ (delete-region (point) end)
+ (move-beginning-of-line (funcall (if backward '1- '1+) arg))
+ (insert line)
+ (org-agenda-reapply-filters)
+ (org-agenda-mark-clocking-task)
+ (move-beginning-of-line 0)))))
+
+(defun org-agenda-drag-line-backward (arg)
+ "Drag an agenda line backward by ARG lines."
+ (interactive "p")
+ (org-agenda-drag-line-forward arg t))
+
+;;; Flagging notes
+
+(defun org-agenda-show-the-flagging-note ()
+ "Display the flagging note in the other window.
+When called a second time in direct sequence, offer to remove the FLAGGING
+tag and (if present) the flagging note."
+ (interactive)
+ (let ((hdmarker (org-get-at-bol 'org-hd-marker))
+ (win (selected-window))
+ note) ;; heading newhead
+ (unless hdmarker
+ (user-error "No linked entry at point"))
+ (if (and (eq this-command last-command)
+ (y-or-n-p "Unflag and remove any flagging note? "))
+ (progn
+ (org-agenda-remove-flag hdmarker)
+ (let ((win (get-buffer-window "*Flagging Note*")))
+ (and win (delete-window win)))
+ (message "Entry unflagged"))
+ (setq note (org-entry-get hdmarker "THEFLAGGINGNOTE"))
+ (unless note
+ (user-error "No flagging note"))
+ (org-kill-new note)
+ (org-switch-to-buffer-other-window "*Flagging Note*")
+ (erase-buffer)
+ (insert note)
+ (goto-char (point-min))
+ (while (re-search-forward "\\\\n" nil t)
+ (replace-match "\n" t t))
+ (goto-char (point-min))
+ (select-window win)
+ (message "%s" (substitute-command-keys "Flagging note pushed to \
+kill ring. Press `\\[org-agenda-show-the-flagging-note]' again to remove \
+tag and note")))))
+
+(defun org-agenda-remove-flag (marker)
+ "Remove the FLAGGED tag and any flagging note in the entry."
+ (let ((newhead
+ (org-with-point-at marker
+ (org-toggle-tag "FLAGGED" 'off)
+ (org-entry-delete nil "THEFLAGGINGNOTE")
+ (org-get-heading))))
+ (org-agenda-change-all-lines newhead marker)
+ (message "Entry unflagged")))
+
+(defun org-agenda-get-any-marker (&optional pos)
+ (or (get-text-property (or pos (point-at-bol)) 'org-hd-marker)
+ (get-text-property (or pos (point-at-bol)) 'org-marker)))
+
+;;; Appointment reminders
+
+(defvar appt-time-msg-list) ; defined in appt.el
+
+;;;###autoload
+(defun org-agenda-to-appt (&optional refresh filter &rest args)
+ "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'."
+ (interactive "P")
+ (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)
+ (org-deadline-warning-days 0)
+ ;; Do not use `org-today' here because appt only takes
+ ;; time and without date as argument, so it may pass wrong
+ ;; information otherwise
+ (today (org-date-to-gregorian
+ (time-to-days nil)))
+ (org-agenda-restrict nil)
+ (files (org-agenda-files 'unrestricted)) entries file
+ (org-agenda-buffer nil))
+ ;; Get all entries which may contain an appt
+ (org-agenda-prepare-buffers files)
+ (while (setq file (pop files))
+ (setq entries
+ (delq nil
+ (append entries
+ (apply #'org-agenda-get-day-entries
+ file today scope)))))
+ ;; Map through entries and find if we should filter them out
+ (mapc
+ (lambda (x)
+ (let* ((evt (org-trim
+ (replace-regexp-in-string
+ org-link-bracket-re "\\2"
+ (or (get-text-property 1 'txt x) ""))))
+ (cat (get-text-property (1- (length x)) 'org-category x))
+ (tod (get-text-property 1 'time-of-day x))
+ (ok (or (null filter)
+ (and (stringp filter) (string-match filter evt))
+ (and (functionp filter) (funcall filter x))
+ (and (listp filter)
+ (let ((cat-filter (cadr (assq 'category filter)))
+ (evt-filter (cadr (assq 'headline filter))))
+ (or (and (stringp cat-filter)
+ (string-match cat-filter cat))
+ (and (stringp evt-filter)
+ (string-match evt-filter evt)))))))
+ (wrn (get-text-property 1 'warntime x)))
+ ;; FIXME: Shall we remove text-properties for the appt text?
+ ;; (setq evt (set-text-properties 0 (length evt) nil evt))
+ (when (and ok tod (not (string-match "\\`DONE\\|CANCELLED" evt)))
+ (setq tod (concat "00" (number-to-string tod)))
+ (setq tod (when (string-match
+ "\\([0-9]\\{1,2\\}\\)\\([0-9]\\{2\\}\\)\\'" tod)
+ (concat (match-string 1 tod) ":"
+ (match-string 2 tod))))
+ (when (appt-add tod evt wrn)
+ (setq cnt (1+ cnt))))))
+ entries)
+ (org-release-buffers org-agenda-new-buffers)
+ (if (eq cnt 0)
+ (message "No event to add")
+ (message "Added %d event%s for today" cnt (if (> cnt 1) "s" "")))))
+
+(defun org-agenda-today-p (date)
+ "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'
+when defining today."
+ (eq (org-today)
+ (if (consp date) (calendar-absolute-from-gregorian date) date)))
+
+(defun org-agenda-todo-yesterday (&optional arg)
+ "Like `org-agenda-todo' but the time of change will be 23:59 of yesterday."
+ (interactive "P")
+ (let* ((org-use-effective-time t)
+ (hour (nth 2 (decode-time (org-current-time))))
+ (org-extend-today-until (1+ hour)))
+ (org-agenda-todo arg)))
+
+(defun org-agenda-ctrl-c-ctrl-c ()
+ "Set tags in agenda buffer."
+ (interactive)
+ (org-agenda-set-tags))
+
+(provide 'org-agenda)
+
+;;; org-agenda.el ends here
diff --git a/elpa/org-9.5.2/org-agenda.elc b/elpa/org-9.5.2/org-agenda.elc
new file mode 100644
index 0000000..9aef299
--- /dev/null
+++ b/elpa/org-9.5.2/org-agenda.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-archive.el b/elpa/org-9.5.2/org-archive.el
new file mode 100644
index 0000000..0943869
--- /dev/null
+++ b/elpa/org-9.5.2/org-archive.el
@@ -0,0 +1,639 @@
+;;; org-archive.el --- Archiving for Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file contains the archive functionality for Org.
+
+;;; 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))
+(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
+
+(defcustom org-archive-default-command 'org-archive-subtree
+ "The default archiving command."
+ :group 'org-archive
+ :type '(choice
+ (const org-archive-subtree)
+ (const org-archive-to-archive-sibling)
+ (const org-archive-set-tag)))
+
+(defcustom org-archive-reversed-order nil
+ "Non-nil means make the tree first child under the archive heading, not last."
+ :group 'org-archive
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-archive-sibling-heading "Archive"
+ "Name of the local archive sibling that is used to archive entries locally.
+Locally means: in the tree, under a sibling.
+See `org-archive-to-archive-sibling' for more information."
+ :group 'org-archive
+ :type 'string)
+
+(defcustom org-archive-mark-done nil
+ "Non-nil means mark entries as DONE when they are moved to the archive file.
+This can be a string to set the keyword to use. When non-nil, Org will
+use the first keyword in its list that means done."
+ :group 'org-archive
+ :type '(choice
+ (const :tag "No" nil)
+ (const :tag "Yes" t)
+ (string :tag "Use this keyword")))
+
+(defcustom org-archive-stamp-time t
+ "Non-nil means add a time stamp to entries moved to an archive file.
+This variable is obsolete and has no effect anymore, instead add or remove
+`time' from the variable `org-archive-save-context-info'."
+ :group 'org-archive
+ :type 'boolean)
+
+(defcustom org-archive-file-header-format "\nArchived entries from file %s\n\n"
+ "The header format string for newly created archive files.
+When nil, no header will be inserted.
+When a string, a %s formatter will be replaced by the file name."
+ :group 'org-archive
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string)
+
+(defcustom org-archive-subtree-add-inherited-tags 'infile
+ "Non-nil means append inherited tags when archiving a subtree."
+ :group 'org-archive
+ :version "24.1"
+ :type '(choice
+ (const :tag "Never" nil)
+ (const :tag "When archiving a subtree to the same file" infile)
+ (const :tag "Always" t)))
+
+(defcustom org-archive-subtree-save-file-p 'from-org
+ "Conditionally save the archive file after archiving a subtree.
+This variable can be any of the following symbols:
+
+t saves in all cases.
+`from-org' prevents saving from an agenda-view.
+`from-agenda' saves only when the archive is initiated from an agenda-view.
+nil prevents saving in all cases.
+
+Note that, regardless of this value, the archive buffer is never
+saved when archiving into a location in the current buffer."
+ :group 'org-archive
+ :package-version '(Org . "9.4")
+ :type '(choice
+ (const :tag "Save archive buffer" t)
+ (const :tag "Save when archiving from agenda" from-agenda)
+ (const :tag "Save when archiving from an Org buffer" from-org)
+ (const :tag "Do not save")))
+
+(defcustom org-archive-save-context-info '(time file olpath category todo itags)
+ "Parts of context info that should be stored as properties when archiving.
+When a subtree is moved to an archive file, it loses information given by
+context, like inherited tags, the category, and possibly also the TODO
+state (depending on the variable `org-archive-mark-done').
+This variable can be a list of any of the following symbols:
+
+time The time of archiving.
+file The file where the entry originates.
+ltags The local tags, in the headline of the subtree.
+itags The tags the subtree inherits from further up the hierarchy.
+todo The pre-archive TODO state.
+category The category, taken from file name or #+CATEGORY lines.
+olpath The outline path to the item. These are all headlines above
+ the current item, separated by /, like a file path.
+
+For each symbol present in the list, a property will be created in
+the archived entry, with a prefix \"ARCHIVE_\", to remember this
+information."
+ :group 'org-archive
+ :type '(set :greedy t
+ (const :tag "Time" time)
+ (const :tag "File" file)
+ (const :tag "Category" category)
+ (const :tag "TODO state" todo)
+ (const :tag "Priority" priority)
+ (const :tag "Inherited tags" itags)
+ (const :tag "Outline path" olpath)
+ (const :tag "Local tags" ltags)))
+
+(defvar org-archive-hook nil
+ "Hook run after successfully archiving a subtree.
+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.")
+
+;;;###autoload
+(defun org-add-archive-files (files)
+ "Splice the archive files into the list of files.
+This implies visiting all these files and finding out what the
+archive file is."
+ (org-uniquify
+ (apply
+ 'append
+ (mapcar
+ (lambda (f)
+ (if (not (file-exists-p f))
+ nil
+ (with-current-buffer (org-get-agenda-file-buffer f)
+ (cons f (org-all-archive-files)))))
+ files))))
+
+(defun org-all-archive-files ()
+ "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)
+ "Move the current subtree to the archive.
+The archive can be a certain top-level heading in the current
+file, or in a different file. The tree will be moved to that
+location, the subtree heading be marked DONE, and the current
+time will be added.
+
+When called with a single prefix argument FIND-DONE, find whole
+trees without any open TODO items and archive them (after getting
+confirmation from the user). When called with a double prefix
+argument, find whole trees with timestamps before today and
+archive them (after getting confirmation from the user). If the
+cursor is not at a headline when these commands are called, try
+all level 1 trees. If the cursor is on a headline, only try the
+direct children of this heading."
+ (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
+ `(progn (setq org-map-continue-from (progn (org-back-to-heading) (point)))
+ (org-archive-subtree ,find-done))
+ org-loop-over-headlines-in-active-region
+ cl (if (org-invisible-p) (org-end-of-subtree nil t))))
+ (cond
+ ((equal find-done '(4)) (org-archive-all-done))
+ ((equal find-done '(16)) (org-archive-all-old))
+ (t
+ ;; 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)
+ (tr-org-todo-regexp org-todo-regexp)
+ (tr-org-todo-line-regexp org-todo-line-regexp)
+ (tr-org-odd-levels-only org-odd-levels-only)
+ (this-buffer (current-buffer))
+ (time (format-time-string
+ (substring (cdr org-time-stamp-formats) 1 -1)))
+ (file (abbreviate-file-name
+ (or (buffer-file-name (buffer-base-buffer))
+ (error "No file associated to buffer"))))
+ (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))))
+ (buffer (cond ((not (org-string-nw-p afile)) this-buffer)
+ ((find-buffer-visiting afile))
+ ((find-file-noselect afile))
+ (t (error "Cannot access file \"%s\"" afile))))
+ (org-odd-levels-only
+ (if (local-variable-p 'org-odd-levels-only (current-buffer))
+ org-odd-levels-only
+ tr-org-odd-levels-only))
+ level datetree-date datetree-subheading-p)
+ (when (string-match "\\`datetree/\\(\\**\\)" heading)
+ ;; "datetree/" corresponds to 3 levels of headings.
+ (let ((nsub (length (match-string 1 heading))))
+ (setq heading (concat (make-string
+ (+ (if org-odd-levels-only 5 3)
+ (* (org-level-increment) nsub))
+ ?*)
+ (substring heading (match-end 0))))
+ (setq datetree-subheading-p (> nsub 0)))
+ (setq datetree-date (org-date-to-gregorian
+ (or (org-entry-get nil "CLOSED" t) time))))
+ (if (and (> (length heading) 0)
+ (string-match "^\\*+" heading))
+ (setq level (match-end 0))
+ (setq heading nil level 0))
+ (save-excursion
+ (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))
+ (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)
+ (itags . ,(mapconcat #'identity inherited-tags " "))
+ (ltags . ,(mapconcat #'identity local-tags " "))
+ (olpath . ,(mapconcat #'identity
+ (org-get-outline-path)
+ "/"))
+ (time . ,time)
+ (todo . ,(org-entry-get (point) "TODO")))))
+ ;; We first only copy, in case something goes wrong
+ ;; we need to protect `this-command', to avoid kill-region sets it,
+ ;; which would lead to duplication of subtrees
+ (let (this-command) (org-copy-subtree 1 nil t))
+ (set-buffer buffer)
+ ;; Enforce Org mode for the archive buffer
+ (if (not (derived-mode-p 'org-mode))
+ ;; Force the mode for future visits.
+ (let ((org-insert-mode-line-in-empty-file t)
+ (org-inhibit-startup t))
+ (call-interactively 'org-mode)))
+ (when (and newfile-p org-archive-file-header-format)
+ (goto-char (point-max))
+ (insert (format org-archive-file-header-format
+ (buffer-file-name this-buffer))))
+ (when datetree-date
+ (require 'org-datetree)
+ (org-datetree-find-date-create datetree-date)
+ (org-narrow-to-subtree))
+ ;; Force the TODO keywords of the original buffer
+ (let ((org-todo-line-regexp tr-org-todo-line-regexp)
+ (org-todo-keywords-1 tr-org-todo-keywords-1)
+ (org-todo-kwd-alist tr-org-todo-kwd-alist)
+ (org-done-keywords tr-org-done-keywords)
+ (org-todo-regexp tr-org-todo-regexp)
+ (org-todo-line-regexp tr-org-todo-line-regexp))
+ (goto-char (point-min))
+ (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]+:\\(" org-tag-re ":\\)+\\)?[ \t]*$")
+ nil t)
+ (goto-char (match-end 0))
+ ;; Heading not found, just insert it at the end
+ (goto-char (point-max))
+ (or (bolp) (insert "\n"))
+ ;; datetrees don't need too much spacing
+ (insert (if datetree-date "" "\n") heading "\n")
+ (end-of-line 0))
+ ;; Make the subtree visible
+ (outline-show-subtree)
+ (if org-archive-reversed-order
+ (progn
+ (org-back-to-heading t)
+ (outline-next-heading))
+ (org-end-of-subtree t))
+ (skip-chars-backward " \t\r\n")
+ (and (looking-at "[ \t\r\n]*")
+ ;; datetree archives don't need so much spacing.
+ (replace-match (if datetree-date "\n" "\n\n"))))
+ ;; No specific heading, just go to end of file, or to the
+ ;; beginning, depending on `org-archive-reversed-order'.
+ (if org-archive-reversed-order
+ (progn
+ (goto-char (point-min))
+ (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.
+ ;; To prevent this, make sure visible part of buffer
+ ;; always terminates on a new line, while limiting
+ ;; number of blank lines in a date tree.
+ (unless (and datetree-date (bolp)) (insert "\n"))))
+ ;; Paste
+ (org-paste-subtree (org-get-valid-level level (and heading 1)))
+ ;; Shall we append inherited tags?
+ (and inherited-tags
+ (or (and (eq org-archive-subtree-add-inherited-tags 'infile)
+ infile-p)
+ (eq org-archive-subtree-add-inherited-tags t))
+ (org-set-tags all-tags))
+ ;; Mark the entry as done
+ (when (and org-archive-mark-done
+ (let ((case-fold-search nil))
+ (looking-at org-todo-line-regexp))
+ (or (not (match-end 2))
+ (not (member (match-string 2) org-done-keywords))))
+ (let (org-log-done org-todo-log-states)
+ (org-todo
+ (car (or (member org-archive-mark-done org-done-keywords)
+ org-done-keywords)))))
+
+ ;; Add the context info.
+ (dolist (item org-archive-save-context-info)
+ (let ((value (cdr (assq item context))))
+ (when (org-string-nw-p value)
+ (org-entry-put
+ (point)
+ (concat "ARCHIVE_" (upcase (symbol-name item)))
+ value))))
+ ;; Save the buffer, if it is not the same buffer and
+ ;; depending on `org-archive-subtree-save-file-p'.
+ (unless (eq this-buffer buffer)
+ (when (or (eq org-archive-subtree-save-file-p t)
+ (eq org-archive-subtree-save-file-p
+ (if (boundp 'org-archive-from-agenda)
+ 'from-agenda
+ 'from-org)))
+ (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.
+ (run-hooks 'org-archive-hook)
+ (let (this-command) (org-cut-subtree))
+ (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)
+ (concat "in file: " (abbreviate-file-name afile)))))))
+ (org-reveal)
+ (if (looking-at "^[ \t]*$")
+ (outline-next-visible-heading 1))))
+
+;;;###autoload
+(defun org-archive-to-archive-sibling ()
+ "Archive the current heading by moving it under the archive sibling.
+
+The archive sibling is a sibling of the heading with the heading name
+`org-archive-sibling-heading' and an `org-archive-tag' tag. If this
+sibling does not exist, it will be created at the end of the subtree.
+
+Archiving time is retained in the ARCHIVE_TIME node property."
+ (interactive)
+ (if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
+ (let ((cl (when (eq org-loop-over-headlines-in-active-region 'start-level)
+ 'region-start-level 'region))
+ org-loop-over-headlines-in-active-region)
+ (org-map-entries
+ '(progn (setq org-map-continue-from
+ (progn (org-back-to-heading)
+ (if (looking-at (concat "^.*:" org-archive-tag ":.*$"))
+ (org-end-of-subtree t)
+ (point))))
+ (when (org-at-heading-p)
+ (org-archive-to-archive-sibling)))
+ org-loop-over-headlines-in-active-region
+ cl (if (org-invisible-p) (org-end-of-subtree nil t))))
+ (save-restriction
+ (widen)
+ (let (b e pos leader level)
+ (org-back-to-heading t)
+ (looking-at org-outline-regexp)
+ (setq leader (match-string 0)
+ level (funcall outline-level))
+ (setq pos (point-marker))
+ (condition-case nil
+ (outline-up-heading 1 t)
+ (error (setq e (point-max)) (goto-char (point-min))))
+ (setq b (point))
+ (unless e
+ (condition-case nil
+ (org-end-of-subtree t t)
+ (error (goto-char (point-max))))
+ (setq e (point)))
+ (goto-char b)
+ (unless (re-search-forward
+ (concat "^" (regexp-quote leader)
+ "[ \t]*"
+ org-archive-sibling-heading
+ "[ \t]*:"
+ org-archive-tag ":") e t)
+ (goto-char e)
+ (or (bolp) (newline))
+ (insert leader org-archive-sibling-heading "\n")
+ (beginning-of-line 0)
+ (org-toggle-tag org-archive-tag 'on))
+ (beginning-of-line 1)
+ (if org-archive-reversed-order
+ (outline-next-heading)
+ (org-end-of-subtree t t))
+ (save-excursion
+ (goto-char pos)
+ (let ((this-command this-command)) (org-cut-subtree)))
+ (org-paste-subtree (org-get-valid-level level 1))
+ (org-set-property
+ "ARCHIVE_TIME"
+ (format-time-string
+ (substring (cdr org-time-stamp-formats) 1 -1)))
+ (outline-up-heading 1 t)
+ (org-flag-subtree t)
+ (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]*$")
+ (outline-next-visible-heading 1))))
+
+(defun org-archive-all-done (&optional tag)
+ "Archive sublevels of the current tree without open TODO items.
+If the cursor is not on a headline, try all level 1 trees. If
+it is on a headline, try all direct children.
+When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag."
+ (org-archive-all-matches
+ (lambda (_beg end)
+ (let ((case-fold-search nil))
+ (unless (re-search-forward org-not-done-heading-regexp end t)
+ "no open TODO items")))
+ tag))
+
+(defun org-archive-all-old (&optional tag)
+ "Archive sublevels of the current tree with timestamps prior to today.
+If the cursor is not on a headline, try all level 1 trees. If
+it is on a headline, try all direct children.
+When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag."
+ (org-archive-all-matches
+ (lambda (_beg end)
+ (let (ts)
+ (and (re-search-forward org-ts-regexp end t)
+ (setq ts (match-string 0))
+ (< (org-time-stamp-to-now ts) 0)
+ (if (not (looking-at
+ (concat "--\\(" org-ts-regexp "\\)")))
+ (concat "old timestamp " ts)
+ (setq ts (concat "old timestamp " ts (match-string 0)))
+ (and (< (org-time-stamp-to-now (match-string 1)) 0)
+ ts)))))
+ tag))
+
+(defun org-archive-all-matches (predicate &optional tag)
+ "Archive sublevels of the current tree that match PREDICATE.
+
+PREDICATE is a function of two arguments, BEG and END, which
+specify the beginning and end of the headline being considered.
+It is called with point positioned at BEG. The headline will be
+archived if PREDICATE returns non-nil. If the return value of
+PREDICATE is a string, it should describe the reason for
+archiving the heading.
+
+If the cursor is not on a headline, try all level 1 trees. If it
+is on a headline, try all direct children. When TAG is non-nil,
+don't move trees, but mark them with the ARCHIVE tag."
+ (let ((rea (concat ".*:" org-archive-tag ":")) re1
+ (begm (make-marker))
+ (endm (make-marker))
+ (question (if tag "Set ARCHIVE tag? "
+ "Move subtree to archive? "))
+ reason beg end (cntarch 0))
+ (if (org-at-heading-p)
+ (progn
+ (setq re1 (concat "^" (regexp-quote
+ (make-string
+ (+ (- (match-end 0) (match-beginning 0) 1)
+ (if org-odd-levels-only 2 1))
+ ?*))
+ " "))
+ (move-marker begm (point))
+ (move-marker endm (org-end-of-subtree t)))
+ (setq re1 "^* ")
+ (move-marker begm (point-min))
+ (move-marker endm (point-max)))
+ (save-excursion
+ (goto-char begm)
+ (while (re-search-forward re1 endm t)
+ (setq beg (match-beginning 0)
+ end (save-excursion (org-end-of-subtree t) (point)))
+ (goto-char beg)
+ (if (not (setq reason (funcall predicate beg end)))
+ (goto-char end)
+ (goto-char beg)
+ (if (and (or (not tag) (not (looking-at rea)))
+ (y-or-n-p
+ (if (stringp reason)
+ (concat question "(" reason ")")
+ question)))
+ (progn
+ (if tag
+ (org-toggle-tag org-archive-tag 'on)
+ (org-archive-subtree))
+ (setq cntarch (1+ cntarch)))
+ (goto-char end)))))
+ (message "%d trees archived" cntarch)))
+
+;;;###autoload
+(defun org-toggle-archive-tag (&optional find-done)
+ "Toggle the archive tag for the current headline.
+With prefix ARG, check all children of current headline and offer tagging
+the children that do not contain any open TODO items."
+ (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
+ `(org-toggle-archive-tag ,find-done)
+ org-loop-over-headlines-in-active-region
+ cl (if (org-invisible-p) (org-end-of-subtree nil t))))
+ (if find-done
+ (org-archive-all-done 'tag)
+ (let (set)
+ (save-excursion
+ (org-back-to-heading t)
+ (setq set (org-toggle-tag org-archive-tag))
+ (when set (org-flag-subtree t)))
+ (and set (beginning-of-line 1))
+ (message "Subtree %s" (if set "archived" "unarchived"))))))
+
+(defun org-archive-set-tag ()
+ "Set the ARCHIVE tag."
+ (interactive)
+ (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
+ 'org-archive-set-tag
+ org-loop-over-headlines-in-active-region
+ cl (if (org-invisible-p) (org-end-of-subtree nil t))))
+ (org-toggle-tag org-archive-tag 'on)))
+
+;;;###autoload
+(defun org-archive-subtree-default ()
+ "Archive the current subtree with the default command.
+This command is set with the variable `org-archive-default-command'."
+ (interactive)
+ (call-interactively org-archive-default-command))
+
+;;;###autoload
+(defun org-archive-subtree-default-with-confirmation ()
+ "Archive the current subtree with the default command.
+This command is set with the variable `org-archive-default-command'."
+ (interactive)
+ (if (y-or-n-p "Archive this subtree or entry? ")
+ (call-interactively org-archive-default-command)
+ (error "Abort")))
+
+(provide 'org-archive)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-archive.el ends here
diff --git a/elpa/org-9.5.2/org-archive.elc b/elpa/org-9.5.2/org-archive.elc
new file mode 100644
index 0000000..51f54e1
--- /dev/null
+++ b/elpa/org-9.5.2/org-archive.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-attach-git.el b/elpa/org-9.5.2/org-attach-git.el
new file mode 100644
index 0000000..4c6bdc9
--- /dev/null
+++ b/elpa/org-9.5.2/org-attach-git.el
@@ -0,0 +1,142 @@
+;;; org-attach-git.el --- Automatic git commit extension to org-attach -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+;; Original Author: John Wiegley <johnw@newartisans.com>
+;; Restructurer: Gustav Wikström <gustav@whil.se>
+;; Keywords: org data git
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; An extension to org-attach. If `org-attach-id-dir' is initialized
+;; as a Git repository, then `org-attach-git' will automatically commit
+;; changes when it sees them. Requires git-annex.
+
+;;; Code:
+
+(require 'org-attach)
+(require 'vc-git)
+
+(defcustom org-attach-git-annex-cutoff (* 32 1024)
+ "If non-nil, files larger than this will be annexed instead of stored."
+ :group 'org-attach
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "None" nil)
+ (integer :tag "Bytes")))
+
+(defcustom org-attach-git-annex-auto-get 'ask
+ "Confirmation preference for automatically getting annex files.
+If \\='ask, prompt using `y-or-n-p'. If t, always get. If nil, never get."
+ :group 'org-attach
+ :package-version '(Org . "9.0")
+ :version "26.1"
+ :type '(choice
+ (const :tag "confirm with `y-or-n-p'" ask)
+ (const :tag "always get from annex if necessary" t)
+ (const :tag "never get from annex" nil)))
+
+(defcustom org-attach-git-dir 'default
+ "Attachment directory with the Git repository to use.
+The default value is to use `org-attach-id-dir'. When set to
+`individual-repository', then the directory attached to the
+current node, if correctly initialized as a Git repository, will
+be used instead."
+ :group 'org-attach
+ :package-version '(Org . "9.5")
+ :type '(choice
+ (const :tag "Default" default)
+ (const :tag "Individual repository" individual-repository)))
+
+(defun org-attach-git-use-annex ()
+ "Return non-nil if git annex can be used."
+ (let ((git-dir (vc-git-root
+ (cond ((eq org-attach-git-dir 'default)
+ (expand-file-name org-attach-id-dir))
+ ((eq org-attach-git-dir 'individual-repository)
+ (org-attach-dir))))))
+ (and org-attach-git-annex-cutoff
+ (or (file-exists-p (expand-file-name "annex" git-dir))
+ (file-exists-p (expand-file-name ".git/annex" git-dir))))))
+
+(defun org-attach-git-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* ((default-directory
+ (cond ((eq org-attach-git-dir 'default)
+ (expand-file-name org-attach-id-dir))
+ ((eq org-attach-git-dir 'individual-repository)
+ (org-attach-dir))))
+ (path-relative (file-relative-name path)))
+ (when (and (org-attach-git-use-annex)
+ (not
+ (string-equal
+ "found"
+ (shell-command-to-string
+ (format "git annex find --format=found --in=here %s"
+ (shell-quote-argument path-relative))))))
+ (let ((should-get
+ (if (eq org-attach-git-annex-auto-get 'ask)
+ (y-or-n-p (format "Run git annex get %s? " path-relative))
+ org-attach-git-annex-auto-get)))
+ (unless should-get
+ (error "File %s stored in git annex but unavailable" path))
+ (message "Running git annex get \"%s\"." path-relative)
+ (call-process "git" nil nil nil "annex" "get" path-relative)))))
+
+(defun org-attach-git-commit (&optional _)
+ "Commit changes to git if `org-attach-id-dir' is properly initialized.
+This checks for the existence of a \".git\" directory in that directory.
+
+Takes an unused optional argument for the sake of being compatible
+with hook `org-attach-after-change-hook'."
+ (let* ((dir (cond ((eq org-attach-git-dir 'default)
+ (expand-file-name org-attach-id-dir))
+ ((eq org-attach-git-dir 'individual-repository)
+ (org-attach-dir))))
+ (git-dir (vc-git-root dir))
+ (use-annex (org-attach-git-use-annex))
+ (changes 0))
+ (when (and git-dir (executable-find "git"))
+ (with-temp-buffer
+ (cd dir)
+ (dolist (new-or-modified
+ (split-string
+ (shell-command-to-string
+ "git ls-files -zmo --exclude-standard") "\0" t))
+ (if (and use-annex
+ (>= (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))
+ (cl-incf changes))
+ (dolist (deleted
+ (split-string
+ (shell-command-to-string "git ls-files -z --deleted") "\0" t))
+ (call-process "git" nil nil nil "rm" deleted)
+ (cl-incf changes))
+ (when (> changes 0)
+ (shell-command "git commit -m 'Synchronized attachments'"))))))
+
+(add-hook 'org-attach-after-change-hook 'org-attach-git-commit)
+(add-hook 'org-attach-open-hook 'org-attach-git-annex-get-maybe)
+
+(provide 'org-attach-git)
+
+;;; org-attach-git.el ends here
diff --git a/elpa/org-9.5.2/org-attach-git.elc b/elpa/org-9.5.2/org-attach-git.elc
new file mode 100644
index 0000000..e7c7f7e
--- /dev/null
+++ b/elpa/org-9.5.2/org-attach-git.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-attach.el b/elpa/org-9.5.2/org-attach.el
new file mode 100644
index 0000000..75db69c
--- /dev/null
+++ b/elpa/org-9.5.2/org-attach.el
@@ -0,0 +1,787 @@
+;;; org-attach.el --- Manage file attachments to Org outlines -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+;; Author: John Wiegley <johnw@newartisans.com>
+;; Keywords: org data attachment
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; See the Org manual for information on how to use it.
+;;
+;; Attachments are managed either by using a custom property DIR or by
+;; using property ID from org-id. When DIR is defined, a location in
+;; the filesystem is directly attached to the outline node. When
+;; org-id is used, attachments are stored in a folder named after the
+;; ID, in a location defined by `org-attach-id-dir'. DIR has
+;; precedence over ID when both parameters are defined for the current
+;; outline node (also when inherited parameters are taken into
+;; account).
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'org)
+(require 'ol)
+(require 'org-id)
+
+(declare-function dired-dwim-target-directory "dired-aux")
+(declare-function dired-get-marked-files "dired" (&optional localp arg filter distinguish-one-marked error))
+(declare-function org-element-property "org-element" (property element))
+(declare-function org-element-type "org-element" (element))
+(declare-function org-inlinetask-goto-beginning "org-inlinetask" ())
+(declare-function org-inlinetask-in-task-p "org-inlinetask" ())
+
+(defgroup org-attach nil
+ "Options concerning attachments in Org mode."
+ :tag "Org Attach"
+ :group 'org)
+
+(defcustom org-attach-id-dir "data/"
+ "The directory where attachments are stored.
+If this is a relative path, it will be interpreted relative to the directory
+where the Org file lives."
+ :group 'org-attach
+ :type 'directory
+ :safe #'stringp)
+
+(defcustom org-attach-dir-relative nil
+ "Non-nil means directories in DIR property are added as relative links.
+Defaults to absolute location."
+ :group 'org-attach
+ :type 'boolean
+ :package-version '(Org . "9.3")
+ :safe #'booleanp)
+
+(defcustom org-attach-auto-tag "ATTACH"
+ "Tag that will be triggered automatically when an entry has an attachment."
+ :group 'org-attach
+ :type '(choice
+ (const :tag "None" nil)
+ (string :tag "Tag")))
+
+(defcustom org-attach-preferred-new-method 'id
+ "Preferred way to attach to nodes without existing ID and DIR property.
+This choice is used when adding attachments to nodes without ID
+and DIR properties.
+
+Allowed values are:
+
+id Create and use an ID parameter
+dir Create and use a DIR parameter
+ask Ask the user for input of which method to choose
+nil Prefer to not create a new parameter
+
+ nil means that ID or DIR has to be created explicitly
+ before attaching files."
+ :group 'org-attach
+ :package-version '(org . "9.3")
+ :type '(choice
+ (const :tag "ID parameter" id)
+ (const :tag "DIR parameter" dir)
+ (const :tag "Ask user" ask)
+ (const :tag "Don't create" nil)))
+
+(defcustom org-attach-method 'cp
+ "The preferred method to attach a file.
+Allowed values are:
+
+mv rename the file to move it into the attachment directory
+cp copy the file
+ln create a hard link. Note that this is not supported
+ on all systems, and then the result is not defined.
+lns create a symbol link. Note that this is not supported
+ on all systems, and then the result is not defined."
+ :group 'org-attach
+ :type '(choice
+ (const :tag "Copy" cp)
+ (const :tag "Move/Rename" mv)
+ (const :tag "Hard Link" ln)
+ (const :tag "Symbol Link" lns)))
+
+(defcustom org-attach-expert nil
+ "Non-nil means do not show the splash buffer with the attach dispatcher."
+ :group 'org-attach
+ :type 'boolean)
+
+(defcustom org-attach-use-inheritance 'selective
+ "Attachment inheritance for the outline.
+
+Enabling inheritance for `org-attach' implies two things. First,
+that attachment links will look through all parent headings until
+it finds the linked attachment. Second, that running org-attach
+inside a node without attachments will make org-attach operate on
+the first parent heading it finds with an attachment.
+
+Selective means to respect the inheritance setting in
+`org-use-property-inheritance'."
+ :group 'org-attach
+ :type '(choice
+ (const :tag "Don't use inheritance" nil)
+ (const :tag "Inherit parent node attachments" t)
+ (const :tag "Respect org-use-property-inheritance" selective)))
+
+(defcustom org-attach-store-link-p nil
+ "Non-nil means store a link to a file when attaching it."
+ :group 'org-attach
+ :version "24.1"
+ :type '(choice
+ (const :tag "Don't store link" nil)
+ (const :tag "Link to origin location" t)
+ (const :tag "Attachment link to the attach-dir location" attached)
+ (const :tag "File link to the attach-dir location" file)))
+
+(defcustom org-attach-archive-delete nil
+ "Non-nil means attachments are deleted upon archiving a subtree.
+When set to `query', ask the user instead."
+ :group 'org-attach
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(choice
+ (const :tag "Never delete attachments" nil)
+ (const :tag "Always delete attachments" t)
+ (const :tag "Query the user" query)))
+
+(defun org-attach-id-uuid-folder-format (id)
+ "Translate an UUID ID into a folder-path.
+Default format for how Org translates ID properties to a path for
+attachments. Useful if ID is generated with UUID."
+ (format "%s/%s"
+ (substring id 0 2)
+ (substring id 2)))
+
+(defun org-attach-id-ts-folder-format (id)
+ "Translate an ID based on a timestamp to a folder-path.
+Useful way of translation if ID is generated based on ISO8601
+timestamp. Splits the attachment folder hierarchy into
+year-month, the rest."
+ (format "%s/%s"
+ (substring id 0 6)
+ (substring id 6)))
+
+(defcustom org-attach-id-to-path-function-list '(org-attach-id-uuid-folder-format
+ org-attach-id-ts-folder-format)
+ "List of functions parsing an ID string into a folder-path.
+The first function in this list defines the preferred function
+which will be used when creating new attachment folders. All
+functions of this list will be tried when looking for existing
+attachment folders based on ID."
+ :group 'org-attach
+ :package-version '(Org . "9.3")
+ :type '(repeat (function :tag "Function with ID as input")))
+
+(defvar org-attach-after-change-hook nil
+ "Hook called when files have been added or removed to the attachment folder.")
+
+(defvar org-attach-open-hook nil
+ "Hook that is invoked by `org-attach-open'.
+
+Created mostly to be compatible with org-attach-git after removing
+git-functionality from this file.")
+
+(defcustom org-attach-commands
+ '(((?a ?\C-a) org-attach-attach
+ "Select a file and attach it to the task, using `org-attach-method'.")
+ ((?c ?\C-c) org-attach-attach-cp
+ "Attach a file using copy method.")
+ ((?m ?\C-m) org-attach-attach-mv
+ "Attach a file using move method.")
+ ((?l ?\C-l) org-attach-attach-ln
+ "Attach a file using link method.")
+ ((?y ?\C-y) org-attach-attach-lns
+ "Attach a file using symbolic-link method.")
+ ((?u ?\C-u) org-attach-url
+ "Attach a file from URL (downloading it).")
+ ((?b) org-attach-buffer
+ "Select a buffer and attach its contents to the task.")
+ ((?n ?\C-n) org-attach-new
+ "Create a new attachment, as an Emacs buffer.")
+ ((?z ?\C-z) org-attach-sync
+ "Synchronize the current node with its attachment\n directory, in case \
+you added attachments yourself.\n")
+ ((?o ?\C-o) org-attach-open
+ "Open current node's attachments.")
+ ((?O) org-attach-open-in-emacs
+ "Like \"o\", but force opening in Emacs.")
+ ((?f ?\C-f) org-attach-reveal
+ "Open current node's attachment directory. Create if missing.")
+ ((?F) org-attach-reveal-in-emacs
+ "Like \"f\", but force using Dired in Emacs.\n")
+ ((?d ?\C-d) org-attach-delete-one
+ "Delete one attachment, you will be prompted for a file name.")
+ ((?D) org-attach-delete-all
+ "Delete all of a node's attachments. A safer way is\n to open the \
+directory in dired and delete from there.\n")
+ ((?s ?\C-s) org-attach-set-directory
+ "Set a specific attachment directory for this entry. Sets DIR property.")
+ ((?S ?\C-S) org-attach-unset-directory
+ "Unset the attachment directory for this entry. Removes DIR property.")
+ ((?q) (lambda () (interactive) (message "Abort")) "Abort."))
+ "The list of commands for the attachment dispatcher.
+Each entry in this list is a list of three elements:
+- A list of keys (characters) to select the command (the fist
+ character in the list is shown in the attachment dispatcher's
+ splash buffer and minibuffer prompt).
+- A command that is called interactively when one of these keys
+ is pressed.
+- A docstring for this command in the attachment dispatcher's
+ splash buffer."
+ :group 'org-attach
+ :package-version '(Org . "9.3")
+ :type '(repeat (list (repeat :tag "Keys" character)
+ (function :tag "Command")
+ (string :tag "Docstring"))))
+
+(defcustom org-attach-sync-delete-empty-dir 'query
+ "Determine what to do with an empty attachment directory on sync.
+When set to nil, don't touch the directory. When set to `query',
+ask the user instead, else remove without asking."
+ :group 'org-attach
+ :package-version '(Org . "9.5")
+ :type '(choice
+ (const :tag "Never delete" nil)
+ (const :tag "Always delete" t)
+ (const :tag "Query the user" query)))
+
+;;;###autoload
+(defun org-attach ()
+ "The dispatcher for attachment commands.
+Shows a list of commands and prompts for another key to execute a command."
+ (interactive)
+ (let ((dir (org-attach-dir nil 'no-fs-check))
+ c marker)
+ (when (eq major-mode 'org-agenda-mode)
+ (setq marker (or (get-text-property (point) 'org-hd-marker)
+ (get-text-property (point) 'org-marker)))
+ (unless marker
+ (error "No item in current line")))
+ (org-with-point-at marker
+ (if (and (featurep 'org-inlinetask)
+ (not (org-inlinetask-in-task-p)))
+ (org-with-limited-levels
+ (org-back-to-heading-or-point-min t))
+ (if (and (featurep 'org-inlinetask)
+ (org-inlinetask-in-task-p))
+ (org-inlinetask-goto-beginning)
+ (org-back-to-heading-or-point-min t)))
+ (save-excursion
+ (save-window-excursion
+ (unless org-attach-expert
+ (org-switch-to-buffer-other-window "*Org Attach*")
+ (erase-buffer)
+ (setq cursor-type nil
+ header-line-format "Use C-v, M-v, C-n or C-p to navigate.")
+ (insert
+ (concat "Attachment folder:\n"
+ (or dir
+ "Can't find an existing attachment-folder")
+ (unless (and dir (file-directory-p dir))
+ "\n(Not yet created)")
+ "\n\n"
+ (format "Select an Attachment Command:\n\n%s"
+ (mapconcat
+ (lambda (entry)
+ (pcase entry
+ (`((,key . ,_) ,_ ,docstring)
+ (format "%c %s"
+ key
+ (replace-regexp-in-string "\n\\([\t ]*\\)"
+ " "
+ docstring
+ nil nil 1)))
+ (_
+ (user-error
+ "Invalid `org-attach-commands' item: %S"
+ entry))))
+ org-attach-commands
+ "\n")))))
+ (org-fit-window-to-buffer (get-buffer-window "*Org Attach*"))
+ (let ((msg (format "Select command: [%s]"
+ (concat (mapcar #'caar org-attach-commands)))))
+ (message msg)
+ (while (and (setq c (read-char-exclusive))
+ (memq c '(14 16 22 134217846)))
+ (org-scroll c t)))
+ (and (get-buffer "*Org Attach*") (kill-buffer "*Org Attach*"))))
+ (let ((command (cl-some (lambda (entry)
+ (and (memq c (nth 0 entry)) (nth 1 entry)))
+ org-attach-commands)))
+ (if (commandp command t)
+ (call-interactively command)
+ (error "No such attachment command: %c" c))))))
+
+(defun org-attach-dir (&optional create-if-not-exists-p no-fs-check)
+ "Return the directory associated with the current outline node.
+First check for DIR property, then ID property.
+`org-attach-use-inheritance' determines whether inherited
+properties also will be considered.
+
+If an ID property is found the default mechanism using that ID
+will be invoked to access the directory for the current entry.
+Note that this method returns the directory as declared by ID or
+DIR even if the directory doesn't exist in the filesystem.
+
+If CREATE-IF-NOT-EXIST-P is non-nil, `org-attach-dir-get-create'
+is run. If NO-FS-CHECK is non-nil, the function returns the path
+to the attachment even if it has not yet been initialized in the
+filesystem.
+
+If no attachment directory can be derived, return nil."
+ (let (attach-dir id)
+ (cond
+ (create-if-not-exists-p
+ (setq attach-dir (org-attach-dir-get-create)))
+ ((setq attach-dir (org-entry-get nil "DIR" org-attach-use-inheritance))
+ (org-attach-check-absolute-path attach-dir))
+ ;; Deprecated and removed from documentation, but still
+ ;; works. FIXME: Remove after major nr change.
+ ((setq attach-dir (org-entry-get nil "ATTACH_DIR" org-attach-use-inheritance))
+ (org-attach-check-absolute-path attach-dir))
+ ((setq id (org-entry-get nil "ID" org-attach-use-inheritance))
+ (org-attach-check-absolute-path nil)
+ (setq attach-dir (org-attach-dir-from-id id 'try-all))))
+ (if no-fs-check
+ attach-dir
+ (when (and attach-dir (file-directory-p attach-dir))
+ attach-dir))))
+
+(defun org-attach-dir-get-create ()
+ "Return existing or new directory associated with the current outline node.
+`org-attach-preferred-new-method' decides how to attach new
+directory if neither ID nor DIR property exist.
+
+If the attachment by some reason cannot be created an error will be raised."
+ (interactive)
+ (let ((attach-dir (org-attach-dir nil 'no-fs-check)))
+ (unless attach-dir
+ (let (answer)
+ (when (eq org-attach-preferred-new-method 'ask)
+ (message "Create new ID [1] property or DIR [2] property for attachments?")
+ (setq answer (read-char-exclusive)))
+ (cond
+ ((or (eq org-attach-preferred-new-method 'id) (eq answer ?1))
+ (setq attach-dir (org-attach-dir-from-id (org-id-get nil t))))
+ ((or (eq org-attach-preferred-new-method 'dir) (eq answer ?2))
+ (setq attach-dir (org-attach-set-directory)))
+ ((eq org-attach-preferred-new-method 'nil)
+ (error "No existing directory. DIR or ID property has to be explicitly created")))))
+ (unless attach-dir
+ (error "No attachment directory is associated with the current node"))
+ (unless (file-directory-p attach-dir)
+ (make-directory attach-dir t))
+ attach-dir))
+
+(defun org-attach-dir-from-id (id &optional try-all)
+ "Return a folder path based on `org-attach-id-dir' and ID.
+If TRY-ALL is non-nil, try all id-to-path functions in
+`org-attach-id-to-path-function-list' and return the first path
+that exist in the filesystem, or the first one if none exist.
+Otherwise only use the first function in that list."
+ (let ((attach-dir-preferred (expand-file-name
+ (funcall (car org-attach-id-to-path-function-list) id)
+ (expand-file-name org-attach-id-dir))))
+ (if try-all
+ (let ((attach-dir attach-dir-preferred)
+ (fun-list (cdr org-attach-id-to-path-function-list)))
+ (while (and fun-list (not (file-directory-p attach-dir)))
+ (setq attach-dir (expand-file-name
+ (funcall (car fun-list) id)
+ (expand-file-name org-attach-id-dir)))
+ (setq fun-list (cdr fun-list)))
+ (if (file-directory-p attach-dir)
+ attach-dir
+ attach-dir-preferred))
+ attach-dir-preferred)))
+
+(defun org-attach-check-absolute-path (dir)
+ "Check if we have enough information to root the attachment directory.
+When DIR is given, check also if it is already absolute. Otherwise,
+assume that it will be relative, and check if `org-attach-id-dir' is
+absolute, or if at least the current buffer has a file name.
+Throw an error if we cannot root the directory."
+ (or (and dir (file-name-absolute-p dir))
+ (file-name-absolute-p org-attach-id-dir)
+ (buffer-file-name (buffer-base-buffer))
+ (error "Need absolute `org-attach-id-dir' to attach in buffers without filename")))
+
+(defun org-attach-set-directory ()
+ "Set the DIR node property and ask to move files there.
+The property defines the directory that is used for attachments
+of the entry. Creates relative links if `org-attach-dir-relative'
+is non-nil.
+
+Return the directory."
+ (interactive)
+ (let ((old (org-attach-dir))
+ (new
+ (let* ((attach-dir (read-directory-name
+ "Attachment directory: "
+ (org-entry-get nil "DIR")))
+ (current-dir (file-name-directory (or default-directory
+ buffer-file-name)))
+ (attach-dir-relative (file-relative-name attach-dir current-dir)))
+ (org-entry-put nil "DIR" (if org-attach-dir-relative
+ attach-dir-relative
+ attach-dir))
+ attach-dir)))
+ (unless (or (string= old new)
+ (not old))
+ (when (yes-or-no-p "Copy over attachments from old directory? ")
+ (copy-directory old new t t t))
+ (when (yes-or-no-p (concat "Delete " old))
+ (delete-directory old t)))
+ new))
+
+(defun org-attach-unset-directory ()
+ "Remove DIR node property.
+If attachment folder is changed due to removal of DIR-property
+ask to move attachments to new location and ask to delete old
+attachment-folder.
+
+Change of attachment-folder due to unset might be if an ID
+property is set on the node, or if a separate inherited
+DIR-property exists (that is different from the unset one)."
+ (interactive)
+ (let ((old (org-attach-dir))
+ (new
+ (progn
+ (org-entry-delete nil "DIR")
+ ;; ATTACH-DIR is deprecated and removed from documentation,
+ ;; but still works. Remove code for it after major nr change.
+ (org-entry-delete nil "ATTACH_DIR")
+ (org-attach-dir))))
+ (unless (or (string= old new)
+ (not old))
+ (when (and new (yes-or-no-p "Copy over attachments from old directory? "))
+ (copy-directory old new t nil t))
+ (when (yes-or-no-p (concat "Delete " old))
+ (delete-directory old t)))))
+
+(defun org-attach-tag (&optional off)
+ "Turn the autotag on or (if OFF is set) off."
+ (when org-attach-auto-tag
+ (save-excursion
+ (org-back-to-heading t)
+ (org-toggle-tag org-attach-auto-tag (if off 'off 'on)))))
+
+(defun org-attach-untag ()
+ "Turn the autotag off."
+ (org-attach-tag 'off))
+
+(defun org-attach-url (url)
+ (interactive "MURL of the file to attach: \n")
+ (let ((org-attach-method 'url))
+ (org-attach-attach url)))
+
+(defun org-attach-buffer (buffer-name)
+ "Attach BUFFER-NAME's contents to current outline node.
+BUFFER-NAME is a string. Signals a `file-already-exists' error
+if it would overwrite an existing filename."
+ (interactive "bBuffer whose contents should be attached: ")
+ (let* ((attach-dir (org-attach-dir 'get-create))
+ (output (expand-file-name buffer-name attach-dir)))
+ (when (file-exists-p output)
+ (signal 'file-already-exists (list "File exists" output)))
+ (run-hook-with-args 'org-attach-after-change-hook attach-dir)
+ (org-attach-tag)
+ (with-temp-file output
+ (insert-buffer-substring buffer-name))))
+
+(defun org-attach-attach (file &optional visit-dir method)
+ "Move/copy/link FILE into the attachment directory of the current outline node.
+If VISIT-DIR is non-nil, visit the directory with dired.
+METHOD may be `cp', `mv', `ln', `lns' or `url' default taken from
+`org-attach-method'."
+ (interactive
+ (list
+ (read-file-name "File to keep as an attachment: "
+ (or (progn
+ (require 'dired-aux)
+ (dired-dwim-target-directory))
+ default-directory))
+ current-prefix-arg
+ nil))
+ (setq method (or method org-attach-method))
+ (let ((basename (file-name-nondirectory file)))
+ (let* ((attach-dir (org-attach-dir 'get-create))
+ (attach-file (expand-file-name basename attach-dir)))
+ (cond
+ ((eq method 'mv) (rename-file file attach-file))
+ ((eq method 'cp) (copy-file file attach-file))
+ ((eq method 'ln) (add-name-to-file file attach-file))
+ ((eq method 'lns) (make-symbolic-link file attach-file))
+ ((eq method 'url) (url-copy-file file attach-file)))
+ (run-hook-with-args 'org-attach-after-change-hook attach-dir)
+ (org-attach-tag)
+ (cond ((eq org-attach-store-link-p 'attached)
+ (push (list (concat "attachment:" (file-name-nondirectory attach-file))
+ (file-name-nondirectory attach-file))
+ org-stored-links))
+ ((eq org-attach-store-link-p t)
+ (push (list (concat "file:" file)
+ (file-name-nondirectory file))
+ org-stored-links))
+ ((eq org-attach-store-link-p 'file)
+ (push (list (concat "file:" attach-file)
+ (file-name-nondirectory attach-file))
+ org-stored-links)))
+ (if visit-dir
+ (dired attach-dir)
+ (message "File %S is now an attachment" basename)))))
+
+(defun org-attach-attach-cp ()
+ "Attach a file by copying it."
+ (interactive)
+ (let ((org-attach-method 'cp)) (call-interactively 'org-attach-attach)))
+(defun org-attach-attach-mv ()
+ "Attach a file by moving (renaming) it."
+ (interactive)
+ (let ((org-attach-method 'mv)) (call-interactively 'org-attach-attach)))
+(defun org-attach-attach-ln ()
+ "Attach a file by creating a hard link to it.
+Beware that this does not work on systems that do not support hard links.
+On some systems, this apparently does copy the file instead."
+ (interactive)
+ (let ((org-attach-method 'ln)) (call-interactively 'org-attach-attach)))
+(defun org-attach-attach-lns ()
+ "Attach a file by creating a symbolic link to it.
+
+Beware that this does not work on systems that do not support symbolic links.
+On some systems, this apparently does copy the file instead."
+ (interactive)
+ (let ((org-attach-method 'lns)) (call-interactively 'org-attach-attach)))
+
+(defun org-attach-new (file)
+ "Create a new attachment FILE for the current outline node.
+The attachment is created as an Emacs buffer."
+ (interactive "sCreate attachment named: ")
+ (let ((attach-dir (org-attach-dir 'get-create)))
+ (org-attach-tag)
+ (find-file (expand-file-name file attach-dir))
+ (message "New attachment %s" file)))
+
+(defun org-attach-delete-one (&optional file)
+ "Delete a single attachment."
+ (interactive)
+ (let* ((attach-dir (org-attach-dir))
+ (files (org-attach-file-list attach-dir))
+ (file (or file
+ (completing-read
+ "Delete attachment: "
+ (mapcar (lambda (f)
+ (list (file-name-nondirectory f)))
+ files)))))
+ (setq file (expand-file-name file attach-dir))
+ (unless (file-exists-p file)
+ (error "No such attachment: %s" file))
+ (delete-file file)
+ (run-hook-with-args 'org-attach-after-change-hook attach-dir)))
+
+(defun org-attach-delete-all (&optional force)
+ "Delete all attachments from the current outline node.
+This actually deletes the entire attachment directory.
+A safer way is to open the directory in dired and delete from there.
+
+With prefix argument FORCE, directory will be recursively deleted
+with no prompts."
+ (interactive "P")
+ (let ((attach-dir (org-attach-dir)))
+ (when (and attach-dir
+ (or force
+ (yes-or-no-p "Really remove all attachments of this entry? ")))
+ (delete-directory attach-dir
+ (or force (yes-or-no-p "Recursive?"))
+ t)
+ (message "Attachment directory removed")
+ (run-hook-with-args 'org-attach-after-change-hook attach-dir)
+ (org-attach-untag))))
+
+(defun org-attach-sync ()
+ "Synchronize the current outline node with its attachments.
+Useful after files have been added/removed externally. Option
+`org-attach-sync-delete-empty-dir' controls the behavior for
+empty attachment directories."
+ (interactive)
+ (let ((attach-dir (org-attach-dir)))
+ (if (not attach-dir)
+ (org-attach-tag 'off)
+ (run-hook-with-args 'org-attach-after-change-hook attach-dir)
+ (let ((files (org-attach-file-list attach-dir)))
+ (org-attach-tag (not files)))
+ (when org-attach-sync-delete-empty-dir
+ (when (and (org-directory-empty-p attach-dir)
+ (if (eq 'query org-attach-sync-delete-empty-dir)
+ (yes-or-no-p "Attachment directory is empty. Delete?")
+ t))
+ (delete-directory attach-dir))))))
+
+(defun org-attach-file-list (dir)
+ "Return a list of files in the attachment directory.
+This ignores files ending in \"~\"."
+ (delq nil
+ (mapcar (lambda (x) (if (string-match "^\\.\\.?\\'" x) nil x))
+ (directory-files dir nil "[^~]\\'"))))
+
+(defun org-attach-reveal ()
+ "Show the attachment directory of the current outline node.
+This will attempt to use an external program to show the
+directory. Will create an attachment and folder if it doesn't
+exist yet. Respects `org-attach-preferred-new-method'."
+ (interactive)
+ (org-open-file (org-attach-dir-get-create)))
+
+(defun org-attach-reveal-in-emacs ()
+ "Show the attachment directory of the current outline node in dired.
+Will create an attachment and folder if it doesn't exist yet.
+Respects `org-attach-preferred-new-method'."
+ (interactive)
+ (dired (org-attach-dir-get-create)))
+
+(defun org-attach-open (&optional in-emacs)
+ "Open an attachment of the current outline node.
+If there are more than one attachment, you will be prompted for the file name.
+This command will open the file using the settings in `org-file-apps'
+and in the system-specific variants of this variable.
+If IN-EMACS is non-nil, force opening in Emacs."
+ (interactive "P")
+ (let ((attach-dir (org-attach-dir)))
+ (if attach-dir
+ (let* ((file (pcase (org-attach-file-list attach-dir)
+ (`(,file) file)
+ (files (completing-read "Open attachment: "
+ (mapcar #'list files) nil t))))
+ (path (expand-file-name file attach-dir)))
+ (run-hook-with-args 'org-attach-open-hook path)
+ (org-open-file path in-emacs))
+ (error "No attachment directory exist"))))
+
+(defun org-attach-open-in-emacs ()
+ "Open attachment, force opening in Emacs.
+See `org-attach-open'."
+ (interactive)
+ (org-attach-open 'in-emacs))
+
+(defun org-attach-expand (file)
+ "Return the full path to the current entry's attachment file FILE.
+Basically, this adds the path to the attachment directory."
+ (expand-file-name file (org-attach-dir)))
+
+(defun org-attach-expand-links (_)
+ "Expand links in current buffer.
+It is meant to be added to `org-export-before-parsing-hook'."
+ (save-excursion
+ (while (re-search-forward "attachment:" nil t)
+ (let ((link (org-element-context)))
+ (when (and (eq 'link (org-element-type link))
+ (string-equal "attachment"
+ (org-element-property :type link)))
+ (let* ((description (and (org-element-property :contents-begin link)
+ (buffer-substring-no-properties
+ (org-element-property :contents-begin link)
+ (org-element-property :contents-end link))))
+ (file (org-element-property :path link))
+ (new-link (org-link-make-string
+ (concat "file:" (org-attach-expand file))
+ description)))
+ (goto-char (org-element-property :end link))
+ (skip-chars-backward " \t")
+ (delete-region (org-element-property :begin link) (point))
+ (insert new-link)))))))
+
+(defun org-attach-follow (file arg)
+ "Open FILE attachment.
+See `org-open-file' for details about ARG."
+ (org-link-open-as-file (org-attach-expand file) arg))
+
+(org-link-set-parameters "attachment"
+ :follow #'org-attach-follow
+ :complete #'org-attach-complete-link)
+
+(defun org-attach-complete-link ()
+ "Advise the user with the available files in the attachment directory."
+ (let ((attach-dir (org-attach-dir)))
+ (if attach-dir
+ (let* ((attached-dir (expand-file-name attach-dir))
+ (file (read-file-name "File: " attached-dir))
+ (pwd (file-name-as-directory attached-dir))
+ (pwd-relative (file-name-as-directory
+ (abbreviate-file-name attached-dir))))
+ (cond
+ ((string-match (concat "^" (regexp-quote pwd-relative) "\\(.+\\)") file)
+ (concat "attachment:" (match-string 1 file)))
+ ((string-match (concat "^" (regexp-quote pwd) "\\(.+\\)")
+ (expand-file-name file))
+ (concat "attachment:" (match-string 1 (expand-file-name file))))
+ (t (concat "attachment:" file))))
+ (error "No attachment directory exist"))))
+
+(defun org-attach-archive-delete-maybe ()
+ "Maybe delete subtree attachments when archiving.
+This function is called by `org-archive-hook'. The option
+`org-attach-archive-delete' controls its behavior."
+ (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)
+ (when (eq 'mv org-attach-method)
+ (revert-buffer))))
+
+
+
+(add-hook 'org-archive-hook 'org-attach-archive-delete-maybe)
+(add-hook 'org-export-before-parsing-hook 'org-attach-expand-links)
+
+(provide 'org-attach)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-attach.el ends here
diff --git a/elpa/org-9.5.2/org-attach.elc b/elpa/org-9.5.2/org-attach.elc
new file mode 100644
index 0000000..7e375cf
--- /dev/null
+++ b/elpa/org-9.5.2/org-attach.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-autoloads.el b/elpa/org-9.5.2/org-autoloads.el
new file mode 100644
index 0000000..ace0628
--- /dev/null
+++ b/elpa/org-9.5.2/org-autoloads.el
@@ -0,0 +1,1528 @@
+;;; 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-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-" "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" '("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 "actual autoloads are elsewhere" "ob-core" "ob-core.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from ob-core.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-core" '("org-")))
+
+;;;***
+
+;;;### (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-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-eshell" "ob-eshell.el" (0 0 0 0))
+;;; Generated autoloads from ob-eshell.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-eshell" '("ob-eshell-session-live-p" "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-gnuplot-" "org-babel-")))
+
+;;;***
+
+;;;### (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-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-julia" "ob-julia.el" (0 0 0 0))
+;;; Generated autoloads from ob-julia.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-julia" '("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-lilypond" "ob-lilypond.el" (0 0 0 0))
+;;; Generated autoloads from ob-lilypond.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-lilypond" '("lilypond-mode" "ob-lilypond-header-args" "org-babel-")))
+
+;;;***
+
+;;;### (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 "actual autoloads are elsewhere" "ob-lob" "ob-lob.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from ob-lob.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-lob" '("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-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-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-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-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 "actual autoloads are elsewhere" "ob-tangle" "ob-tangle.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from ob-tangle.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-tangle" '("org-")))
+
+;;;***
+
+;;;### (autoloads nil "oc" "oc.el" (0 0 0 0))
+;;; Generated autoloads from oc.el
+
+(autoload 'org-cite-insert "oc" "\
+Insert a citation at point.
+Insertion is done according to the processor set in `org-cite-insert-processor'.
+ARG is the prefix argument received when calling interactively the function.
+
+\(fn ARG)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "oc" '("org-cite-")))
+
+;;;***
+
+;;;### (autoloads nil "oc-basic" "oc-basic.el" (0 0 0 0))
+;;; Generated autoloads from oc-basic.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "oc-basic" '("org-cite-basic-")))
+
+;;;***
+
+;;;### (autoloads nil "oc-biblatex" "oc-biblatex.el" (0 0 0 0))
+;;; Generated autoloads from oc-biblatex.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "oc-biblatex" '("org-cite-biblatex-")))
+
+;;;***
+
+;;;### (autoloads nil "oc-csl" "oc-csl.el" (0 0 0 0))
+;;; Generated autoloads from oc-csl.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "oc-csl" '("org-cite-csl-")))
+
+;;;***
+
+;;;### (autoloads nil "oc-natbib" "oc-natbib.el" (0 0 0 0))
+;;; Generated autoloads from oc-natbib.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "oc-natbib" '("org-cite-natbib-")))
+
+;;;***
+
+;;;### (autoloads "actual autoloads are elsewhere" "ol" "ol.el" (0
+;;;;;; 0 0 0))
+;;; Generated autoloads from ol.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol" '("org-")))
+
+;;;***
+
+;;;### (autoloads "actual autoloads are elsewhere" "ol-bbdb" "ol-bbdb.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from ol-bbdb.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-bbdb" '("org-bbdb-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-bibtex" "ol-bibtex.el" (0 0 0 0))
+;;; Generated autoloads from ol-bibtex.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-bibtex" '("org-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-docview" "ol-docview.el" (0 0 0 0))
+;;; Generated autoloads from ol-docview.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-docview" '("org-docview-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-doi" "ol-doi.el" (0 0 0 0))
+;;; Generated autoloads from ol-doi.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-doi" '("org-link-doi-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-eshell" "ol-eshell.el" (0 0 0 0))
+;;; Generated autoloads from ol-eshell.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-eshell" '("org-eshell-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-eww" "ol-eww.el" (0 0 0 0))
+;;; Generated autoloads from ol-eww.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-eww" '("org-eww-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-gnus" "ol-gnus.el" (0 0 0 0))
+;;; Generated autoloads from ol-gnus.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-gnus" '("org-gnus-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-info" "ol-info.el" (0 0 0 0))
+;;; Generated autoloads from ol-info.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-info" '("org-info-")))
+
+;;;***
+
+;;;### (autoloads "actual autoloads are elsewhere" "ol-irc" "ol-irc.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from ol-irc.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-irc" '("org-irc-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-man" "ol-man.el" (0 0 0 0))
+;;; Generated autoloads from ol-man.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-man" '("org-man-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-mhe" "ol-mhe.el" (0 0 0 0))
+;;; Generated autoloads from ol-mhe.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-mhe" '("org-mhe-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-rmail" "ol-rmail.el" (0 0 0 0))
+;;; Generated autoloads from ol-rmail.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-rmail" '("org-rmail-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-w3m" "ol-w3m.el" (0 0 0 0))
+;;; Generated autoloads from ol-w3m.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-w3m" '("org-w3m-")))
+
+;;;***
+
+;;;### (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
+optional prefix argument COMPILE, the tangled Emacs Lisp file is
+byte-compiled 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 'org-load-modules-maybe "org" "\
+Load all extensions listed in `org-modules'.
+
+\(fn &optional FORCE)" nil nil)
+
+(autoload 'org-clock-persistence-insinuate "org" "\
+Set up hooks for clock persistence." 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 very beginning of the buffer, if
+there is no headline there, and if the variable `org-cycle-global-at-bob'
+is non-nil, this function acts as if called with prefix argument (`\\[universal-argument] TAB',
+same as `S-TAB') also when called without prefix argument.
+
+\(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-open-file "org" "\
+Open the file at PATH.
+First, this expands any special file name abbreviations. Then the
+configuration variable `org-file-apps' is checked if it contains an
+entry for this file type, and if yes, the corresponding command is launched.
+
+If no application is found, Emacs simply visits the file.
+
+With optional prefix argument IN-EMACS, Emacs will visit the file.
+With a double \\[universal-argument] \\[universal-argument] prefix arg, Org tries to avoid opening in Emacs
+and to use an external application to visit the file.
+
+Optional LINE specifies a line to go to, optional SEARCH a string
+to search for. If LINE or SEARCH is given, the file will be
+opened in Emacs, unless an entry from `org-file-apps' that makes
+use of groups in a regexp matches.
+
+If you want to change the way frames are used when following a
+link, please customize `org-link-frame-setup'.
+
+If the file does not exist, throw an error.
+
+\(fn PATH &optional IN-EMACS LINE SEARCH)" nil 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." t nil)
+
+(autoload 'org-offer-links-in-entry "org" "\
+Offer links in the current entry and return the selected link.
+If there is only one link, return it.
+If NTH is an integer, return the NTH link found.
+If ZERO is a string, check also this string for a link, and if
+there is one, return it.
+
+\(fn BUFFER MARKER &optional NTH ZERO)" nil 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." 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." 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." 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 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 String 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'." 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 "actual autoloads are elsewhere" "org-archive"
+;;;;;; "org-archive.el" (0 0 0 0))
+;;; Generated autoloads from org-archive.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-archive" '("org-a")))
+
+;;;***
+
+;;;### (autoloads "actual autoloads are elsewhere" "org-attach" "org-attach.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from org-attach.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-attach" '("org-attach-")))
+
+;;;***
+
+;;;### (autoloads nil "org-attach-git" "org-attach-git.el" (0 0 0
+;;;;;; 0))
+;;; Generated autoloads from org-attach-git.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-attach-git" '("org-attach-git-")))
+
+;;;***
+
+;;;### (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.
+\\<org-capture-mode-map>
+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'." t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-capture" '("org-capture-")))
+
+;;;***
+
+;;;### (autoloads "actual autoloads are elsewhere" "org-clock" "org-clock.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from org-clock.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-clock" '("org-")))
+
+;;;***
+
+;;;### (autoloads "actual autoloads are elsewhere" "org-colview"
+;;;;;; "org-colview.el" (0 0 0 0))
+;;; Generated autoloads from org-colview.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-colview" '("org-")))
+
+;;;***
+
+;;;### (autoloads "actual autoloads are elsewhere" "org-compat" "org-compat.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from org-compat.el
+
+(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
+
+(autoload 'org-encrypt-entry "org-crypt" "\
+Encrypt the content of the current headline." t nil)
+
+(autoload 'org-decrypt-entry "org-crypt" "\
+Decrypt the content of the current headline." t nil)
+
+(autoload 'org-encrypt-entries "org-crypt" "\
+Encrypt all top-level entries in the current buffer." t nil)
+
+(autoload 'org-decrypt-entries "org-crypt" "\
+Decrypt all entries in the current buffer." t nil)
+
+(autoload 'org-crypt-use-before-save-magic "org-crypt" "\
+Add a hook to automatically encrypt entries before a file is saved to disk." nil nil)
+
+(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 "actual autoloads are elsewhere" "org-datetree"
+;;;;;; "org-datetree.el" (0 0 0 0))
+;;; Generated autoloads from org-datetree.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-datetree" '("org-datetree-")))
+
+;;;***
+
+;;;### (autoloads "actual autoloads are elsewhere" "org-duration"
+;;;;;; "org-duration.el" (0 0 0 0))
+;;; Generated autoloads from org-duration.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-duration" '("org-duration-")))
+
+;;;***
+
+;;;### (autoloads "actual autoloads are elsewhere" "org-element"
+;;;;;; "org-element.el" (0 0 0 0))
+;;; Generated autoloads from org-element.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-element" '("org-element-")))
+
+;;;***
+
+;;;### (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-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 "actual autoloads are elsewhere" "org-feed" "org-feed.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from org-feed.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-feed" '("org-feed-")))
+
+;;;***
+
+;;;### (autoloads "actual autoloads are elsewhere" "org-footnote"
+;;;;;; "org-footnote.el" (0 0 0 0))
+;;; Generated autoloads from org-footnote.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-footnote" '("org-footnote-")))
+
+;;;***
+
+;;;### (autoloads "actual autoloads are elsewhere" "org-goto" "org-goto.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from org-goto.el
+
+(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 "actual autoloads are elsewhere" "org-id" "org-id.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from org-id.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-id" '("org-id-")))
+
+;;;***
+
+;;;### (autoloads "actual autoloads are elsewhere" "org-indent" "org-indent.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from org-indent.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-indent" '("org-indent-")))
+
+;;;***
+
+;;;### (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 "actual autoloads are elsewhere" "org-keys" "org-keys.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from org-keys.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-keys" '("org-")))
+
+;;;***
+
+;;;### (autoloads "actual autoloads are elsewhere" "org-lint" "org-lint.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from org-lint.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-lint" '("org-lint-")))
+
+;;;***
+
+;;;### (autoloads "actual autoloads are elsewhere" "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 "actual autoloads are elsewhere" "org-macs" "org-macs.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from org-macs.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-macs" '("org-")))
+
+;;;***
+
+;;;### (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 "actual autoloads are elsewhere" "org-num" "org-num.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from org-num.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-num" '("org-num-")))
+
+;;;***
+
+;;;### (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" '("org-" "pcomplete/org-mode/")))
+
+;;;***
+
+;;;### (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-")))
+
+;;;***
+
+;;;### (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 "actual autoloads are elsewhere" "org-refile" "org-refile.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from org-refile.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-refile" '("org-")))
+
+;;;***
+
+;;;### (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." nil nil)
+
+(autoload 'org-git-version "org-version" "\
+The Git version of Org mode.
+Inserted by installing Org or when a release is made." nil nil)
+
+;;;***
+
+;;;### (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 nil "ox-koma-letter" "ox-koma-letter.el" (0 0 0
+;;;;;; 0))
+;;; Generated autoloads from ox-koma-letter.el
+
+(autoload 'org-koma-letter-export-as-latex "ox-koma-letter" "\
+Export current buffer as a KOMA Scrlttr2 letter.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{letter}\" and \"\\end{letter}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Export is done in a buffer named \"*Org KOMA-LETTER Export*\". It
+will be displayed if `org-export-show-temporary-export-buffer' is
+non-nil.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-koma-letter-export-to-latex "ox-koma-letter" "\
+Export current buffer as a KOMA Scrlttr2 letter (tex).
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{letter}\" and \"\\end{letter}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+When optional argument PUB-DIR is set, use it as the publishing
+directory.
+
+Return output file's name.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-koma-letter-export-to-pdf "ox-koma-letter" "\
+Export current buffer as a KOMA Scrlttr2 letter (pdf).
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{letter}\" and \"\\end{letter}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return PDF file's name.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox-koma-letter" '("org-koma-letter-")))
+
+;;;***
+
+;;;### (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 nil "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-lob.el" "ob-matlab.el"
+;;;;;; "ob-tangle.el" "ob.el" "ol-bbdb.el" "ol-irc.el" "ol.el" "org-archive.el"
+;;;;;; "org-attach.el" "org-clock.el" "org-colview.el" "org-compat.el"
+;;;;;; "org-datetree.el" "org-duration.el" "org-element.el" "org-feed.el"
+;;;;;; "org-footnote.el" "org-goto.el" "org-id.el" "org-indent.el"
+;;;;;; "org-keys.el" "org-lint.el" "org-list.el" "org-loaddefs.el"
+;;;;;; "org-macs.el" "org-mobile.el" "org-num.el" "org-pkg.el" "org-plot.el"
+;;;;;; "org-refile.el" "org-table.el" "org-timer.el" "ox-ascii.el"
+;;;;;; "ox-beamer.el" "ox-html.el" "ox-icalendar.el" "ox-latex.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-9.5.2/org-capture.el b/elpa/org-9.5.2/org-capture.el
new file mode 100644
index 0000000..a9350c5
--- /dev/null
+++ b/elpa/org-9.5.2/org-capture.el
@@ -0,0 +1,1965 @@
+;;; org-capture.el --- Fast note taking in Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file contains an alternative implementation of the functionality
+;; that used to be provided by org-remember.el. The implementation is more
+;; streamlined, can produce more target types (e.g. plain list items or
+;; table lines). Also, it does not use a temporary buffer for editing
+;; the captured entry - instead it uses an indirect buffer that visits
+;; the new entry already in the target buffer (this was an idea by Samuel
+;; Wales). John Wiegley's excellent `remember.el' is not needed anymore
+;; for this implementation, even though we borrow heavily from its ideas.
+
+;; This implementation heavily draws on ideas by James TD Smith and
+;; Samuel Wales, and, of cause, uses John Wiegley's remember.el as inspiration.
+
+;;; TODO
+
+;; - find a clever way to not always insert an annotation maybe a
+;; predicate function that can check for conditions for %a to be
+;; used. This could be one of the properties.
+
+;; - Should there be plist members that arrange for properties to be
+;; asked for, like James proposed in his RFC?
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'org)
+(require 'org-refile)
+
+(declare-function org-at-encrypted-entry-p "org-crypt" ())
+(declare-function org-at-table-p "org-table" (&optional table-type))
+(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-datetree-find-month-create (d &optional keep-restriction))
+(declare-function org-decrypt-entry "org-crypt" ())
+(declare-function org-element-at-point "org-element" ())
+(declare-function org-element-lineage "org-element" (datum &optional types with-self))
+(declare-function org-element-property "org-element" (property element))
+(declare-function org-encrypt-entry "org-crypt" ())
+(declare-function org-insert-link "ol" (&optional complete-file link-location default-description))
+(declare-function org-link-make-string "ol" (link &optional description))
+(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 crm-separator)
+(defvar org-end-time-was-given)
+(defvar org-keyword-properties)
+(defvar org-remember-default-headline)
+(defvar org-remember-templates)
+(defvar org-store-link-plist)
+(defvar org-table-border-regexp)
+(defvar org-table-current-begin-pos)
+(defvar org-table-dataline-regexp)
+(defvar org-table-fix-formulas-confirm)
+(defvar org-table-hline-regexp)
+(defvar org-table-hlines)
+
+(defvar org-capture-clock-was-started nil
+ "Internal flag, noting if the clock was started.")
+
+(defvar org-capture-last-stored-marker (make-marker)
+ "Marker pointing to the entry most recently stored with `org-capture'.")
+
+;; The following variable is scoped dynamically by org-protocol
+;; to indicate that the link properties have already been stored
+(defvar org-capture-link-is-already-stored nil)
+
+(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"
+ :group 'org)
+
+(defun org-capture-upgrade-templates (templates)
+ "Update the template list to the new format.
+TEMPLATES is a template list, as in `org-capture-templates'. The
+new format unifies all the date/week tree targets into one that
+also allows for an optional outline path to specify a target."
+ (let ((modified-templates
+ (mapcar
+ (lambda (entry)
+ (pcase entry
+ ;; Match templates with an obsolete "tree" target type. Replace
+ ;; it with common `file+olp-datetree'. Add new properties
+ ;; (i.e., `:time-prompt' and `:tree-type') if needed.
+ (`(,key ,desc ,type (file+datetree . ,path) ,tpl . ,props)
+ `(,key ,desc ,type (file+olp+datetree ,@path) ,tpl ,@props))
+ (`(,key ,desc ,type (file+datetree+prompt . ,path) ,tpl . ,props)
+ `(,key ,desc ,type (file+olp+datetree ,@path) ,tpl
+ :time-prompt t ,@props))
+ (`(,key ,desc ,type (file+weektree . ,path) ,tpl . ,props)
+ `(,key ,desc ,type (file+olp+datetree ,@path) ,tpl
+ :tree-type week ,@props))
+ (`(,key ,desc ,type (file+weektree+prompt . ,path) ,tpl . ,props)
+ `(,key ,desc ,type (file+olp+datetree ,@path) ,tpl
+ :tree-type week :time-prompt t ,@props))
+ ;; Other templates are left unchanged.
+ (_ entry)))
+ templates)))
+ (unless (equal modified-templates templates)
+ (message "Deprecated date/weektree capture templates changed to `file+olp+datetree'."))
+ modified-templates))
+
+(defcustom org-capture-templates nil
+ "Templates for the creation of new entries.
+
+Each entry 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 together
+ in the list and preceded by a 2-element entry explaining the
+ prefix key, for example
+
+ (\"b\" \"Templates for marking stuff to buy\")
+
+ The \"C\" key is used by default for quick access to the
+ customization of the template variable. But if you want to use
+ that key for a template, you can.
+
+description A short string describing the template, will be shown during
+ selection.
+
+type The type of entry. Valid types are:
+ entry an Org node, with a headline. Will be filed
+ as the child of the target entry or as a
+ top-level entry. Its default template is:
+ \"* %?\n %a\"
+ item a plain list item, will be placed in the
+ first plain list at the target location.
+ Its default template is:
+ \"- %?\"
+ checkitem a checkbox item. This differs from the
+ plain list item only in so far as it uses a
+ different default template. Its default
+ template is:
+ \"- [ ] %?\"
+ table-line a new line in the first table at target location.
+ Its default template is:
+ \"| %? |\"
+ 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\")
+ File 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 outline path is safer
+
+ (file+regexp \"path/to/file\" \"regexp to find location\")
+ File to the entry matching regexp
+
+ (file+olp+datetree \"path/to/file\" \"Level 1 heading\" ...)
+ Will create a heading in a date tree for today's date.
+ If no heading is given, the tree will be on top level.
+ To prompt for date instead of using TODAY, use the
+ :time-prompt property. To create a week-tree, use the
+ :tree-type property.
+
+ (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 it is an empty string or nil, a default template based on
+ the entry type will be used (see the \"type\" section above).
+ Instead of a string, this may also be one of:
+
+ (file \"/path/to/template-file\")
+ (function function-returning-the-template)
+
+ in order to get a template from a file, or dynamically
+ from a function.
+
+The rest of the entry is a property list of additional options. Recognized
+properties are:
+
+ :prepend Normally newly 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.
+
+ :jump-to-captured When set, jump to the captured entry when finished.
+
+ :refile-targets When exiting capture mode via `org-capture-refile', the
+ variable `org-refile-targets' will be temporarily bound
+ to the value of this property.
+
+ :empty-lines Set this to the number of lines that should be inserted
+ before and after the new item. Default 0, only common
+ other value is 1.
+
+ :empty-lines-before Set this to the number of lines that should be inserted
+ before the new item. Overrides :empty-lines for the
+ number lines inserted before.
+
+ :empty-lines-after Set this to the number of lines that should be inserted
+ after the new item. Overrides :empty-lines for the
+ number of lines inserted after.
+
+ :clock-in Start the clock in this item.
+
+ :clock-keep Keep the clock running when filing the captured entry.
+
+ :clock-resume Start the interrupted clock when finishing 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.
+
+ :tree-type When `week', make a week tree instead of the month-day
+ tree. When `month', make a month tree instead of the
+ month-day tree.
+
+ :unnarrowed Do not narrow the target buffer, simply show the
+ full buffer. Default is to narrow it so that you
+ only see the new stuff.
+
+ :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 by a buffer when
+ 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
+freely formatted text. Furthermore, the following %-escapes will
+be replaced with content and expanded:
+
+ %[pathname] Insert the contents of the file given by
+ `pathname'. These placeholders are expanded at the very
+ beginning of the process so they can be used to extend the
+ current template.
+ %(sexp) Evaluate elisp `(sexp)' and replace it with the results.
+ Only placeholders pre-existing within the template, or
+ introduced with %[pathname] 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 Time stamp, date only. The time stamp is the current
+ time, except when called from agendas with
+ `\\[org-agenda-capture]' or 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
+ 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.
+ %L Like %l, but without brackets (the link content itself).
+ %c Current kill ring head.
+ %x Content of the X clipboard.
+ %k Title of currently clocked task.
+ %K Link to currently clocked task.
+ %n User name (taken from the variable `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 on all tags in all agenda files.
+ %^t Like %t, but prompt for date. Similarly %^T, %^u, %^U.
+ You may define a prompt like: %^{Please specify birthday}t.
+ The default date is that of %t, see above.
+ %^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'.
+ A default value can be specified like this:
+ %^{prop|default}p.
+ %^{prompt} Prompt the user for a string and replace this sequence with it.
+ A default value and a completion table can be specified like this:
+ %^{prompt|default|completion2|completion3|...}.
+ %? After completing the template, position cursor here.
+ %\\1 ... %\\N Insert the text entered at the nth %^{prompt}, where N
+ is a number, starting from 1.
+
+Apart from these general escapes, you can access information specific to
+the link type that is created. For example, calling `org-capture' in emails
+or in Gnus will record the author and the subject of the message, which you
+can access with \"%:from\" and \"%:subject\", respectively. Here is a
+complete list of what is recorded for each link type.
+
+Link type | Available information
+------------------------+------------------------------------------------------
+bbdb | %:type %:name %:company
+vm, wl, mh, mew, rmail, | %:type %:subject %:message-id
+gnus | %:from %:fromname %:fromaddress
+ | %:to %:toname %:toaddress
+ | %:fromto (either \"to NAME\" or \"from NAME\")
+ | %:date %:date-timestamp (as active timestamp)
+ | %:date-timestamp-inactive (as inactive timestamp)
+gnus | %:group, for messages also all email fields
+eww, w3, w3m | %:type %:url
+info | %:type %:file %:node
+calendar | %:type %:date
+
+When you need to insert a literal percent sign in the template,
+you can escape ambiguous cases with a backward slash, e.g., \\%i."
+ :group 'org-capture
+ :package-version '(Org . "9.5")
+ :set (lambda (s v) (set s (org-capture-upgrade-templates v)))
+ :type
+ (let ((file-variants '(choice :tag "Filename "
+ (file :tag "Literal")
+ (function :tag "Function")
+ (variable :tag "Variable")
+ (sexp :tag "Form"))))
+ `(repeat
+ (choice :value ("" "" entry (file "~/org/notes.org") "")
+ (list :tag "Multikey description"
+ (string :tag "Keys ")
+ (string :tag "Description"))
+ (list :tag "Template entry"
+ (string :tag "Keys ")
+ (string :tag "Description ")
+ (choice :tag "Capture Type " :value entry
+ (const :tag "Org entry" entry)
+ (const :tag "Plain list item" item)
+ (const :tag "Checkbox item" checkitem)
+ (const :tag "Plain text" plain)
+ (const :tag "Table line" table-line))
+ (choice :tag "Target location"
+ (list :tag "File"
+ (const :format "" file)
+ ,file-variants)
+ (list :tag "ID"
+ (const :format "" id)
+ (string :tag " ID"))
+ (list :tag "File & Headline"
+ (const :format "" file+headline)
+ ,file-variants
+ (string :tag " Headline"))
+ (list :tag "File & Outline path"
+ (const :format "" file+olp)
+ ,file-variants
+ (repeat :tag "Outline path" :inline t
+ (string :tag "Headline")))
+ (list :tag "File & Regexp"
+ (const :format "" file+regexp)
+ ,file-variants
+ (regexp :tag " Regexp"))
+ (list :tag "File [ & Outline path ] & Date tree"
+ (const :format "" file+olp+datetree)
+ ,file-variants
+ (option (repeat :tag "Outline path" :inline t
+ (string :tag "Headline"))))
+ (list :tag "File & function"
+ (const :format "" file+function)
+ ,file-variants
+ (sexp :tag " Function"))
+ (list :tag "Current clocking task"
+ (const :format "" clock))
+ (list :tag "Function"
+ (const :format "" function)
+ (sexp :tag " Function")))
+ (choice :tag "Template "
+ (string)
+ (list :tag "File"
+ (const :format "" file)
+ (file :tag "Template file"))
+ (list :tag "Function"
+ (const :format "" function)
+ (function :tag "Template function")))
+ (plist :inline t
+ ;; Give the most common options as checkboxes
+ :options (((const :format "%v " :prepend) (const t))
+ ((const :format "%v " :immediate-finish) (const t))
+ ((const :format "%v " :jump-to-captured) (const t))
+ ((const :format "%v " :empty-lines) (const 1))
+ ((const :format "%v " :empty-lines-before) (const 1))
+ ((const :format "%v " :empty-lines-after) (const 1))
+ ((const :format "%v " :clock-in) (const t))
+ ((const :format "%v " :clock-keep) (const t))
+ ((const :format "%v " :clock-resume) (const t))
+ ((const :format "%v " :time-prompt) (const t))
+ ((const :format "%v " :tree-type) (const week))
+ ((const :format "%v " :unnarrowed) (const t))
+ ((const :format "%v " :table-line-pos) (string))
+ ((const :format "%v " :kill-buffer) (const t)))))))))
+
+(defcustom org-capture-before-finalize-hook nil
+ "Hook that is run right before a capture process is finalized.
+The capture buffer is still current when this hook runs and it is
+widened to the entire buffer."
+ :group 'org-capture
+ :version "24.1"
+ :type 'hook)
+
+(defcustom org-capture-after-finalize-hook nil
+ "Hook that is run right after a capture process is finalized.
+Suitable for window cleanup."
+ :group 'org-capture
+ :version "24.1"
+ :type 'hook)
+
+(defcustom org-capture-prepare-finalize-hook nil
+ "Hook that is run before the finalization starts.
+The capture buffer is current and still narrowed."
+ :group 'org-capture
+ :version "24.1"
+ :type 'hook)
+
+(defcustom org-capture-bookmark t
+ "When non-nil, add bookmark pointing at the last stored position when capturing."
+ :group 'org-capture
+ :version "24.3"
+ :type 'boolean)
+
+;;; The property list for keeping information about the capture process
+
+(defvar org-capture-plist nil
+ "Plist for the current capture process, global, to avoid having to pass it.")
+
+(defvar org-capture-current-plist nil
+ "Local variable holding the plist in a capture buffer.
+This is used to store the plist for use when finishing a capture process
+because another such process might have changed the global variable by then.
+
+Each time a new capture buffer has been set up, the global `org-capture-plist'
+is copied to this variable, which is local in the indirect buffer.")
+
+(defvar org-capture-clock-keep nil
+ "Local variable to store the value of the :clock-keep parameter.
+This is needed in case `org-capture-finalize' is called interactively.")
+
+(defun org-capture-put (&rest elements)
+ "Add ELEMENTS to the capture property list `org-capture-plist'."
+ (while elements
+ (setq org-capture-plist (plist-put org-capture-plist
+ (pop elements) (pop elements)))))
+(defun org-capture-get (property &optional local)
+ "Get PROPERTY from the capture property list `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) property))
+
+;;; The minor mode
+
+(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 `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'."
+ :lighter " Cap"
+ (setq-local
+ header-line-format
+ (substitute-command-keys
+ "\\<org-capture-mode-map>Capture buffer. Finish \
+`\\[org-capture-finalize]', refile `\\[org-capture-refile]', \
+abort `\\[org-capture-kill]'.")))
+
+;;; The main commands
+
+(defvar org-capture-initial nil)
+(defvar org-capture-entry nil)
+
+;;;###autoload
+(defun org-capture-string (string &optional keys)
+ "Capture STRING with the template selected by KEYS."
+ (interactive "sInitial text: \n")
+ (let ((org-capture-initial string)
+ (org-capture-entry (org-capture-select-template keys)))
+ (org-capture)))
+
+(defcustom org-capture-templates-contexts nil
+ "Alist of capture templates and valid contexts.
+
+For example, if you have a capture template \"c\" and you want
+this template to be accessible only from `message-mode' buffers,
+use this:
+
+ \\='((\"c\" ((in-mode . \"message-mode\"))))
+
+Here are the available contexts definitions:
+
+ in-file: command displayed only in matching files
+ in-mode: command displayed only in matching modes
+ not-in-file: command not displayed in matching files
+ not-in-mode: command not displayed in matching modes
+ in-buffer: command displayed only in matching buffers
+not-in-buffer: command not displayed in matching buffers
+ [function]: a custom function taking no argument
+
+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 capture template depending on
+contextual rules.
+
+ \\='((\"c\" \"d\" ((in-mode . \"message-mode\"))))
+
+Here it means: in `message-mode buffers', use \"c\" as the
+key for the capture template otherwise associated with \"d\".
+\(The template originally associated with \"d\" is not displayed
+to avoid duplicates.)"
+ :version "24.3"
+ :group 'org-capture
+ :type '(repeat (list :tag "Rule"
+ (string :tag " Capture key")
+ (string :tag "Replace by template")
+ (repeat :tag "Available when"
+ (choice
+ (cons :tag "Condition"
+ (choice
+ (const :tag "In file" in-file)
+ (const :tag "Not in file" not-in-file)
+ (const :tag "In buffer" in-buffer)
+ (const :tag "Not in buffer" not-in-buffer)
+ (const :tag "In mode" in-mode)
+ (const :tag "Not in mode" not-in-mode))
+ (regexp))
+ (function :tag "Custom function"))))))
+
+(defcustom org-capture-use-agenda-date nil
+ "Non-nil means use the date at point when capturing from agendas.
+When nil, you can still capture using the date at point with
+`\\[org-agenda-capture]'."
+ :group 'org-capture
+ :version "24.3"
+ :type 'boolean)
+
+;;;###autoload
+(defun org-capture (&optional goto keys)
+ "Capture something.
+\\<org-capture-mode-map>
+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."
+ (interactive "P")
+ (when (and org-capture-use-agenda-date
+ (eq major-mode 'org-agenda-mode))
+ (setq org-overriding-default-time
+ (org-get-cursor-date (equal goto 1))))
+ (cond
+ ((equal goto '(4)) (org-capture-goto-target keys))
+ ((equal goto '(16)) (org-capture-goto-last-stored))
+ (t
+ (let* ((orig-buf (current-buffer))
+ (annotation (if (and (boundp 'org-capture-link-is-already-stored)
+ org-capture-link-is-already-stored)
+ (plist-get org-store-link-plist :annotation)
+ (ignore-errors (org-store-link nil))))
+ (entry (or org-capture-entry (org-capture-select-template keys)))
+ initial)
+ (setq initial (or org-capture-initial
+ (and (org-region-active-p)
+ (buffer-substring (point) (mark)))))
+ (when (stringp initial)
+ (remove-text-properties 0 (length initial) '(read-only t) initial))
+ (when (stringp annotation)
+ (remove-text-properties 0 (length annotation)
+ '(read-only t) annotation))
+ (cond
+ ((equal entry "C")
+ (customize-variable 'org-capture-templates))
+ ((equal entry "q")
+ (user-error "Abort"))
+ (t
+ (org-capture-set-plist entry)
+ (org-capture-get-template)
+ (org-capture-put :original-buffer orig-buf
+ :original-file (or (buffer-file-name orig-buf)
+ (and (featurep 'dired)
+ (car (rassq orig-buf
+ dired-buffers))))
+ :original-file-nondirectory
+ (and (buffer-file-name orig-buf)
+ (file-name-nondirectory
+ (buffer-file-name orig-buf)))
+ :annotation annotation
+ :initial initial
+ :return-to-wconf (current-window-configuration)
+ :default-time (or org-overriding-default-time
+ (org-current-time)))
+ (org-capture-set-target-location (and (equal goto 0) 'here))
+ (condition-case error
+ (org-capture-put :template (org-capture-fill-template))
+ ((error quit)
+ (if (get-buffer "*Capture*") (kill-buffer "*Capture*"))
+ (error "Capture abort: %s" (error-message-string error))))
+
+ (setq org-capture-clock-keep (org-capture-get :clock-keep))
+ (condition-case error
+ (org-capture-place-template
+ (eq (car (org-capture-get :target)) 'function))
+ ((error quit)
+ (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)
+ (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."
+ (org-capture-put
+ :template
+ (pcase (org-capture-get :template)
+ (`nil "")
+ ((and (pred stringp) template) template)
+ (`(file ,file)
+ (let ((filename (expand-file-name file org-directory)))
+ (if (file-exists-p filename) (org-file-contents filename)
+ (format "* Template file %S not found" file))))
+ (`(function ,f)
+ (if (functionp f) (funcall f)
+ (format "* Template function %S not found" f)))
+ (_ "* Invalid capture template"))))
+
+(defun org-capture-finalize (&optional stay-with-capture)
+ "Finalize the capture process.
+With prefix argument STAY-WITH-CAPTURE, jump to the location of the
+captured item after finalizing."
+ (interactive "P")
+ (when (org-capture-get :jump-to-captured)
+ (setq stay-with-capture t))
+ (unless (and org-capture-mode
+ (buffer-base-buffer (current-buffer)))
+ (error "This does not seem to be a capture buffer for Org mode"))
+
+ (run-hooks 'org-capture-prepare-finalize-hook)
+
+ ;; Update `org-capture-plist' with the buffer-local value. Since
+ ;; captures can be run concurrently, this is to ensure that
+ ;; `org-capture-after-finalize-hook' accesses the proper plist.
+ (setq org-capture-plist org-capture-current-plist)
+
+ ;; Did we start the clock in this capture buffer?
+ (when (and org-capture-clock-was-started
+ 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.
+ (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)
+ ;; Store the insertion point in the target buffer
+ (org-capture-put :insertion-point (point))
+
+ (if org-note-abort
+ (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)
+ (save-excursion
+ (when (ignore-errors (org-back-to-heading))
+ (org-update-parent-todo-statistics)
+ (org-update-checkbox-count)))
+ ;; FIXME Here we should do the sorting
+ ;; If we have added a table line, maybe recompute?
+ (when (and (eq (org-capture-get :type 'local) 'table-line)
+ (org-at-table-p))
+ (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.
+ (org-capture-store-last-position)
+
+ ;; Run the hook
+ (run-hooks 'org-capture-before-finalize-hook))
+
+ (when (org-capture-get :decrypted)
+ (save-excursion
+ (goto-char (org-capture-get :decrypted))
+ (org-encrypt-entry)))
+
+ (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))
+ (base-buffer (buffer-base-buffer (current-buffer))))
+
+ ;; Kill the indirect buffer
+ (kill-buffer (current-buffer))
+
+ ;; Narrow back the target buffer to its previous state
+ (with-current-buffer (org-capture-get :buffer)
+ (let ((reg (org-capture-get :initial-target-region))
+ (pos (org-capture-get :initial-target-position))
+ (ipt (org-capture-get :insertion-point))
+ (size (org-capture-get :captured-entry-size)))
+ (if (not reg)
+ (widen)
+ (cond ((< ipt (car reg))
+ ;; insertion point is before the narrowed region
+ (narrow-to-region (+ size (car reg)) (+ size (cdr reg))))
+ ((> ipt (cdr reg))
+ ;; insertion point is after the narrowed region
+ (narrow-to-region (car reg) (cdr reg)))
+ (t
+ ;; insertion point is within the narrowed region
+ (narrow-to-region (car reg) (+ size (cdr reg)))))
+ ;; now place back the point at its original position
+ (if (< ipt (car reg))
+ (goto-char (+ size pos))
+ (goto-char (if (< ipt pos) (+ size pos) pos))))))
+
+ ;; Kill the target buffer if that is desired
+ (when (and base-buffer new-buffer kill-buffer)
+ (with-current-buffer base-buffer (save-buffer))
+ (kill-buffer base-buffer))
+
+ ;; Restore the window configuration before capture
+ (set-window-configuration return-wconf))
+
+ (run-hooks 'org-capture-after-finalize-hook)
+ ;; Special cases
+ (cond
+ (abort-note
+ (cl-case abort-note
+ (clean
+ (message "Capture process aborted and target buffer cleaned up"))
+ (dirty
+ (error "Capture process aborted, but target buffer could not be \
+cleaned up correctly"))))
+ (stay-with-capture
+ (org-capture-goto-last-stored)))
+ ;; Return if we did store something
+ (not abort-note)))
+
+(defun org-capture-refile ()
+ "Finalize the current capture and then refile the entry.
+Refiling is done from the base buffer, because the indirect buffer is then
+already gone. Any prefix argument will be passed to the refile command."
+ (interactive)
+ (unless (eq (org-capture-get :type 'local) 'entry)
+ (user-error "Refiling from a capture buffer makes only sense \
+for `entry'-type templates"))
+ (let* ((base (or (buffer-base-buffer) (current-buffer)))
+ (pos (make-marker))
+ (org-capture-is-refiling t)
+ (kill-buffer (org-capture-get :kill-buffer 'local))
+ (jump-to-captured (org-capture-get :jump-to-captured 'local))
+ (refile-targets (org-capture-get :refile-targets 'local)))
+ ;; Since `org-capture-finalize' may alter buffer contents (e.g.,
+ ;; empty lines) around entry, use a marker to refer to the
+ ;; headline to be refiled. Place the marker in the base buffer,
+ ;; as the current indirect one is going to be killed.
+ (set-marker pos (save-excursion (org-back-to-heading t) (point)) base)
+ ;; `org-capture-finalize' calls `org-capture-goto-last-stored' too
+ ;; 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)
+ (let ((org-refile-targets (or refile-targets org-refile-targets)))
+ (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."
+ (interactive)
+ ;; FIXME: This does not do the right thing, we need to remove the
+ ;; new stuff by hand it is easy: undo, then kill the buffer
+ (let ((org-note-abort t)
+ (org-capture-before-finalize-hook nil))
+ (org-capture-finalize)))
+
+(defun org-capture-goto-last-stored ()
+ "Go to the location where the last capture note was stored."
+ (interactive)
+ (org-goto-marker-or-bmk org-capture-last-stored-marker
+ (plist-get org-bookmark-names-plist
+ :last-capture))
+ (message "This is the last note stored by a capture process"))
+
+;;; Supporting functions for handling the process
+
+(defun org-capture-put-target-region-and-position ()
+ "Store the initial region with `org-capture-put'."
+ (org-capture-put
+ :initial-target-region
+ ;; Check if the buffer is currently narrowed
+ (when (org-buffer-narrowed-p)
+ (cons (point-min) (point-max))))
+ ;; store the current point
+ (org-capture-put :initial-target-position (point)))
+
+(defvar org-time-was-given) ; dynamically scoped parameter
+(defun org-capture-set-target-location (&optional target)
+ "Find TARGET buffer and position.
+Store them in the capture property list."
+ (let ((target-entry-p t))
+ (save-excursion
+ (pcase (or target (org-capture-get :target))
+ (`here
+ (org-capture-put :exact-position (point) :insert-here t))
+ (`(file ,path)
+ (set-buffer (org-capture-target-buffer path))
+ (org-capture-put-target-region-and-position)
+ (widen)
+ (setq target-entry-p nil))
+ (`(id ,id)
+ (pcase (org-id-find id)
+ (`(,path . ,position)
+ (set-buffer (org-capture-target-buffer path))
+ (widen)
+ (org-capture-put-target-region-and-position)
+ (goto-char position))
+ (_ (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)
+ (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)
+ (beginning-of-line)
+ (goto-char (point-max))
+ (unless (bolp) (insert "\n"))
+ (insert "* " headline "\n")
+ (beginning-of-line 0)))
+ (`(file+olp ,path . ,outline-path)
+ (let ((m (org-find-olp (cons (org-capture-expand-file path)
+ outline-path))))
+ (set-buffer (marker-buffer m))
+ (org-capture-put-target-region-and-position)
+ (widen)
+ (goto-char m)
+ (set-marker m nil)))
+ (`(file+regexp ,path ,regexp)
+ (set-buffer (org-capture-target-buffer path))
+ (org-capture-put-target-region-and-position)
+ (widen)
+ (goto-char (point-min))
+ (if (not (re-search-forward regexp nil t))
+ (error "No match for target regexp in file %s" path)
+ (goto-char (if (org-capture-get :prepend)
+ (match-beginning 0)
+ (match-end 0)))
+ (org-capture-put :exact-position (point))
+ (setq target-entry-p
+ (and (derived-mode-p 'org-mode) (org-at-heading-p)))))
+ (`(file+olp+datetree ,path . ,outline-path)
+ (let ((m (if outline-path
+ (org-find-olp (cons (org-capture-expand-file path)
+ outline-path))
+ (set-buffer (org-capture-target-buffer path))
+ (point-marker))))
+ (set-buffer (marker-buffer m))
+ (org-capture-put-target-region-and-position)
+ (widen)
+ (goto-char m)
+ (set-marker m nil)
+ (require 'org-datetree)
+ (org-capture-put-target-region-and-position)
+ (widen)
+ ;; Make a date/week tree entry, with the current date (or
+ ;; yesterday, if we are extending dates for a couple of
+ ;; hours)
+ (funcall
+ (pcase (org-capture-get :tree-type)
+ (`week #'org-datetree-find-iso-week-create)
+ (`month #'org-datetree-find-month-create)
+ (_ #'org-datetree-find-date-create))
+ (calendar-gregorian-from-absolute
+ (cond
+ (org-overriding-default-time
+ ;; Use the overriding default time.
+ (time-to-days org-overriding-default-time))
+ ((or (org-capture-get :time-prompt)
+ (equal current-prefix-arg 1))
+ ;; Prompt for date. Bind `org-end-time-was-given' so
+ ;; that `org-read-date-analyze' handles the time range
+ ;; case and returns `prompt-time' with the start value.
+ (let* ((org-time-was-given nil)
+ (org-end-time-was-given nil)
+ (prompt-time (org-read-date
+ nil t nil "Date for tree entry:")))
+ (org-capture-put
+ :default-time
+ (if (or org-time-was-given
+ (= (time-to-days prompt-time) (org-today)))
+ prompt-time
+ ;; Use 00:00 when no time is given for another
+ ;; date than today?
+ (apply #'encode-time 0 0
+ org-extend-today-until
+ (cl-cdddr (decode-time prompt-time)))))
+ (time-to-days prompt-time)))
+ (t
+ ;; Current date, possibly corrected for late night
+ ;; workers.
+ (org-today))))
+ ;; the following is the keep-restriction argument for
+ ;; org-datetree-find-date-create
+ (when outline-path 'subtree-at-point))))
+ (`(file+function ,path ,function)
+ (set-buffer (org-capture-target-buffer path))
+ (org-capture-put-target-region-and-position)
+ (widen)
+ (funcall function)
+ (org-capture-put :exact-position (point))
+ (setq target-entry-p
+ (and (derived-mode-p 'org-mode) (org-at-heading-p))))
+ (`(function ,fun)
+ (funcall fun)
+ (org-capture-put :exact-position (point))
+ (setq target-entry-p
+ (and (derived-mode-p 'org-mode) (org-at-heading-p))))
+ (`(clock)
+ (if (and (markerp org-clock-hd-marker)
+ (marker-buffer org-clock-hd-marker))
+ (progn (set-buffer (marker-buffer org-clock-hd-marker))
+ (org-capture-put-target-region-and-position)
+ (widen)
+ (goto-char org-clock-hd-marker))
+ (user-error "No running clock that could be used as capture target")))
+ (target (error "Invalid capture target specification: %S" target)))
+
+ (org-capture-put :buffer (current-buffer)
+ :pos (point)
+ :target-entry-p target-entry-p
+ :decrypted
+ (and (featurep 'org-crypt)
+ (org-at-encrypted-entry-p)
+ (save-excursion
+ (org-decrypt-entry)
+ (and (org-back-to-heading t) (point))))))))
+
+(defun org-capture-expand-file (file)
+ "Expand functions, symbols and file names for FILE.
+When FILE is a function, call it. When it is a form, evaluate
+it. When it is a variable, return its value. When it is
+a string, treat it as a file name, possibly expanding it
+according to `org-directory', and return it. If it is the empty
+string, however, return `org-default-notes-file'. In any other
+case, raise an error."
+ (let ((location (cond ((equal file "") org-default-notes-file)
+ ((stringp file) (expand-file-name file org-directory))
+ ((functionp file) (funcall file))
+ ((and (symbolp file) (boundp file)) (symbol-value file))
+ (t nil))))
+ (or (org-string-nw-p location)
+ (error "Invalid file location: %S" location))))
+
+(defun org-capture-target-buffer (file)
+ "Get a buffer for FILE.
+FILE is a generalized file location, as handled by
+`org-capture-expand-file'."
+ (let ((file (org-capture-expand-file file)))
+ (or (org-find-base-buffer-visiting file)
+ (progn (org-capture-put :new-buffer t)
+ (find-file-noselect file)))))
+
+(defun org-capture-place-template (&optional inhibit-wconf-store)
+ "Insert the template at the target location, and display the buffer.
+When INHIBIT-WCONF-STORE is non-nil, don't store the window configuration, as it
+may have been stored before."
+ (unless inhibit-wconf-store
+ (org-capture-put :return-to-wconf (current-window-configuration)))
+ (delete-other-windows)
+ (org-switch-to-buffer-other-window
+ (org-capture-get-indirect-buffer (org-capture-get :buffer) "CAPTURE"))
+ (widen)
+ (org-show-all)
+ (goto-char (org-capture-get :pos))
+ (setq-local outline-level 'org-outline-level)
+ (pcase (org-capture-get :type)
+ ((or `nil `entry) (org-capture-place-entry))
+ (`table-line (org-capture-place-table-line))
+ (`plain (org-capture-place-plain-text))
+ (`item (org-capture-place-item))
+ (`checkitem (org-capture-place-item)))
+ (setq-local org-capture-current-plist org-capture-plist)
+ (org-capture-mode 1))
+
+(defun org-capture-place-entry ()
+ "Place the template as a new Org entry."
+ (let ((template (org-capture-get :template))
+ (reversed? (org-capture-get :prepend))
+ (exact-position (org-capture-get :exact-position))
+ (insert-here? (org-capture-get :insert-here))
+ (level 1))
+ (org-capture-verify-tree template)
+ (when exact-position (goto-char exact-position))
+ (cond
+ ;; Force insertion at point.
+ (insert-here?
+ ;; FIXME: level should probably set directly within (let ...).
+ (setq level (org-get-valid-level
+ (if (or (org-at-heading-p)
+ (ignore-errors
+ (save-excursion (org-back-to-heading t))))
+ (org-outline-level)
+ 1))))
+ ;; Insert as a child of the current entry.
+ ((org-capture-get :target-entry-p)
+ (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 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))))
+ (let ((origin (point)))
+ (unless (bolp) (insert "\n"))
+ (org-capture-empty-lines-before)
+ (let ((beg (point)))
+ (save-restriction
+ (when insert-here? (narrow-to-region beg beg))
+ (org-paste-subtree level template 'for-yank))
+ (org-capture-position-for-last-stored beg)
+ (org-capture-empty-lines-after)
+ (unless (org-at-heading-p) (outline-next-heading))
+ (org-capture-mark-kill-region origin (point))
+ (org-capture-narrow beg (if (eobp) (point) (1- (point))))
+ (org-capture--position-cursor beg (point))))))
+
+(defun org-capture-place-item ()
+ "Place the template as a new plain list item."
+ (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.
+ (org-with-point-at (org-capture-get :exact-position)
+ (cons (line-beginning-position)
+ (if (org-capture-get :insert-here)
+ (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 ((org-capture-get :insert-here) beg)
+ ((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))
+ (org-capture--position-cursor beg end)))))
+
+(defun org-capture-place-table-line ()
+ "Place the template as a table line."
+ (require 'org-table)
+ (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)
+ (org-with-point-at (org-capture-get :exact-position)
+ (setq beg (line-beginning-position))
+ (setq end (if (org-capture-get :insert-here) beg
+ (org-entry-end-position)))))
+ ((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 (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)
+ (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
+ ((org-capture-get :insert-here) nil)
+ ((and table-line-pos
+ (string-match "\\(I+\\)\\([-+][0-9]+\\)" table-line-pos))
+ (goto-char (point-min))
+ (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))))
+ (forward-line (+ line delta (if (< delta 0) 0 -1)))
+ (forward-line))) ;insert below
+ ((org-capture-get :prepend)
+ (goto-char (point-min))
+ (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 (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))
+ (org-capture--position-cursor beg (1- end))))))
+
+(defun org-capture-place-plain-text ()
+ "Place the template plainly.
+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."
+ (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)
+ (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)
+ (org-capture--position-cursor beg end)))))
+
+(defun org-capture-mark-kill-region (beg end)
+ "Mark region between BEG and END to be killed on aborted capture."
+ (let ((m1 (copy-marker beg))
+ (m2 (copy-marker end t)))
+ (org-capture-put :begin-marker m1)
+ (org-capture-put :end-marker m2)))
+
+(defun org-capture-position-for-last-stored (position)
+ "Put POSITION on `org-capture-plist' for future use as `last capture`."
+ (cond
+ ((integerp position)
+ (org-capture-put :position-for-last-stored
+ (move-marker (make-marker) position
+ (or (buffer-base-buffer (current-buffer))
+ (current-buffer)))))
+ ((eq position 'table-line)
+ (org-capture-put :position-for-last-stored
+ (list 'table-line
+ (org-table-current-dline))))
+ (t (error "This should not happen"))))
+
+(defun org-capture-store-last-position ()
+ "Store the last-captured position."
+ (let* ((where (org-capture-get :position-for-last-stored 'local))
+ (pos (cond
+ ((markerp where)
+ (prog1 (marker-position where)
+ (move-marker where nil)))
+ ((and (listp where) (eq (car where) 'table-line))
+ (if (org-at-table-p)
+ (save-excursion
+ (org-table-goto-line (nth 1 where))
+ (point-at-bol))
+ (point))))))
+ (with-current-buffer (buffer-base-buffer (current-buffer))
+ (org-with-point-at pos
+ (when org-capture-bookmark
+ (let ((bookmark (plist-get org-bookmark-names-plist :last-capture)))
+ (when bookmark (with-demoted-errors (bookmark-set bookmark)))))
+ (move-marker org-capture-last-stored-marker (point))))))
+
+(defun org-capture-narrow (beg end)
+ "Possibly narrow to region between BEG and END.
+If configuration contains non-nil :unnarrowed property, do not narrow."
+ (unless (org-capture-get :unnarrowed)
+ (narrow-to-region beg end)))
+
+(defun org-capture--position-cursor (beg end)
+ "Move point to first \"%?\" location or at start of template.
+BEG and END are buffer positions at the beginning and end position
+of the template."
+ (goto-char beg)
+ (when (search-forward "%?" end t)
+ (replace-match "")))
+
+(defun org-capture-empty-lines-before (&optional n)
+ "Insert N empty lines before the insertion point.
+Point will be after the empty lines, so insertion can directly be done.
+If N is nil, :empty-lines-before or :empty-lines are considered."
+ (setq n (or n (org-capture-get :empty-lines-before)
+ (org-capture-get :empty-lines) 0))
+ (let ((pos (point)))
+ (org-back-over-empty-lines)
+ (delete-region (point) pos)
+ (when (> n 0) (newline n))))
+
+(defun org-capture-empty-lines-after (&optional n)
+ "Set the correct number of empty lines after the inserted string.
+Point will remain at the first line after the inserted text.
+If N is nil, :empty-lines-after or :empty-lines are considered."
+ (setq n (or n (org-capture-get :empty-lines-after)
+ (org-capture-get :empty-lines) 0))
+ (org-back-over-empty-lines)
+ (while (looking-at "[ \t]*\n") (replace-match ""))
+ (let ((pos (point)))
+ (when (> n 0) (newline n))
+ (goto-char pos)))
+
+(defvar org-clock-marker) ; Defined in org.el
+
+(defun org-capture-set-plist (entry)
+ "Initialize the property list for ENTRY from the template definition."
+ (setq org-capture-plist (copy-sequence (nthcdr 5 entry)))
+ (org-capture-put :key (car entry) :description (nth 1 entry)
+ :target (nth 3 entry))
+ (let ((txt (nth 4 entry)) (type (or (nth 2 entry) 'entry)))
+ (when (or (not txt) (and (stringp txt) (not (string-match "\\S-" txt))))
+ ;; The template may be empty or omitted for special types.
+ ;; Here we insert the default templates for such cases.
+ (cond
+ ((eq type 'item) (setq txt "- %?"))
+ ((eq type 'checkitem) (setq txt "- [ ] %?"))
+ ((eq type 'table-line) (setq txt "| %? |"))
+ ((member type '(nil entry)) (setq txt "* %?\n %a"))))
+ (org-capture-put :template txt :type type)))
+
+(defun org-capture-goto-target (&optional template-key)
+ "Go to the target location of a capture template.
+If TEMPLATE-KEY is nil, the user is queried for the template."
+ (interactive)
+ (let ((entry (org-capture-select-template template-key)))
+ (unless entry (error "No capture template selected"))
+ (org-capture-set-plist entry)
+ (org-capture-set-target-location)
+ (pop-to-buffer-same-window (org-capture-get :buffer))
+ (goto-char (org-capture-get :pos))))
+
+(defun org-capture-get-indirect-buffer (&optional buffer prefix)
+ "Make an indirect BUFFER for a capture process.
+Use PREFIX as a prefix for the name of the indirect buffer."
+ (setq buffer (or buffer (current-buffer)))
+ (let ((n 1) (base (buffer-name buffer)) bname)
+ (setq bname (concat prefix "-" base))
+ (while (buffer-live-p (get-buffer bname))
+ (setq bname (concat prefix "-" (number-to-string (cl-incf n)) "-" base)))
+ (condition-case nil
+ (make-indirect-buffer buffer bname 'clone)
+ (error
+ (let ((buf (make-indirect-buffer buffer bname)))
+ (with-current-buffer buf (org-mode))
+ buf)))))
+
+(defun org-capture-verify-tree (tree)
+ "Throw error if TREE is not a valid tree."
+ (unless (org-kill-is-subtree-p tree)
+ (error "Template is not a valid Org entry or tree")))
+
+;;; The template code
+(defun org-capture-select-template (&optional keys)
+ "Select a capture template.
+Lisp programs can force the template by setting KEYS to a string."
+ (let ((org-capture-templates
+ (or (org-contextualize-keys
+ (org-capture-upgrade-templates org-capture-templates)
+ org-capture-templates-contexts)
+ '(("t" "Task" entry (file+headline "" "Tasks")
+ "* TODO %?\n %u\n %a")))))
+ (if keys
+ (or (assoc keys org-capture-templates)
+ (error "No capture template referred to by \"%s\" keys" keys))
+ (org-mks org-capture-templates
+ "Select a capture template\n========================="
+ "Template key: "
+ '(("C" "Customize org-capture-templates")
+ ("q" "Abort"))))))
+
+(defvar org-capture--clipboards nil
+ "List various clipboards values.")
+
+(defun org-capture-fill-template (&optional template initial annotation)
+ "Fill a TEMPLATE and return the filled template as a string.
+The template may still contain \"%?\" for cursor positioning.
+INITIAL content and/or ANNOTATION may be specified, but will be overridden
+by their respective `org-store-link-plist' properties if present."
+ (let* ((template (or template (org-capture-get :template)))
+ (buffer (org-capture-get :buffer))
+ (file (buffer-file-name (or (buffer-base-buffer buffer) buffer)))
+ (time (let* ((c (or (org-capture-get :default-time) (current-time)))
+ (d (decode-time c)))
+ (if (< (nth 2 d) org-extend-today-until)
+ (encode-time 0 59 23 (1- (nth 3 d)) (nth 4 d) (nth 5 d))
+ c)))
+ (v-t (format-time-string (org-time-stamp-format nil) time))
+ (v-T (format-time-string (org-time-stamp-format t) time))
+ (v-u (format-time-string (org-time-stamp-format nil t) time))
+ (v-U (format-time-string (org-time-stamp-format t t) time))
+ (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)
+ "")) ;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)
+ (and (stringp initial) (org-no-properties initial))
+ (org-capture-get :initial)
+ ""))
+ (v-a
+ (let ((a (or (plist-get org-store-link-plist :annotation)
+ annotation
+ (org-capture-get :annotation)
+ "")))
+ ;; Is the link empty? Then we do not want it...
+ (if (equal a "[[]]") "" a)))
+ (l-re "\\[\\[\\(.*?\\)\\]\\(\\[.*?\\]\\)?\\]")
+ (v-A (if (and v-a (string-match l-re v-a))
+ (replace-match "[[\\1][%^{Link description}]]" nil nil v-a)
+ v-a))
+ (v-l (if (and v-a (string-match l-re v-a))
+ (replace-match "[[\\1]]" nil nil v-a)
+ v-a))
+ (v-L (if (and v-a (string-match l-re v-a))
+ (replace-match "\\1" nil nil v-a)
+ v-a))
+ (v-n user-full-name)
+ (v-k (if (marker-buffer org-clock-marker)
+ (org-no-properties org-clock-heading)
+ ""))
+ (v-K (if (marker-buffer org-clock-marker)
+ (org-link-make-string
+ (format "%s::*%s"
+ (buffer-file-name (marker-buffer org-clock-marker))
+ v-k)
+ v-k)
+ ""))
+ (v-f (or (org-capture-get :original-file-nondirectory) ""))
+ (v-F (or (org-capture-get :original-file) ""))
+ (org-capture--clipboards
+ (delq nil
+ (list v-i
+ (org-get-x-clipboard 'PRIMARY)
+ (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)
+ (sit-for 1))
+ (save-window-excursion
+ (org-switch-to-buffer-other-window (get-buffer-create "*Capture*"))
+ (erase-buffer)
+ (setq buffer-file-name nil)
+ (setq mark-active nil)
+ (insert template)
+ (goto-char (point-min))
+ ;; %[] insert contents of a file.
+ (save-excursion
+ (while (re-search-forward "%\\[\\(.+\\)\\]" nil t)
+ (let ((filename (expand-file-name (match-string 1)))
+ (beg (copy-marker (match-beginning 0)))
+ (end (copy-marker (match-end 0))))
+ (unless (org-capture-escaped-%)
+ (delete-region beg end)
+ (set-marker beg nil)
+ (set-marker end nil)
+ (condition-case error
+ (insert-file-contents filename)
+ (error
+ (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]+\\)>\\|[aAcfFikKlLntTuUx]\\)"))
+ (save-excursion
+ (while (re-search-forward regexp nil t)
+ ;; `org-capture-escaped-%' may modify buffer and cripple
+ ;; match-data. Use markers instead. Ditto for other
+ ;; templates.
+ (let ((pos (copy-marker (match-beginning 0)))
+ (end (copy-marker (match-end 0)))
+ (value (match-string 1))
+ (time-string (match-string 2)))
+ (unless (org-capture-escaped-%)
+ (delete-region pos end)
+ (set-marker pos nil)
+ (set-marker end nil)
+ (let* ((inside-sexp? (org-capture-inside-embedded-elisp-p))
+ (replacement
+ (pcase (string-to-char value)
+ (?< (format-time-string time-string time))
+ (?:
+ (or (plist-get org-store-link-plist (intern value))
+ ""))
+ (?i
+ (if inside-sexp? v-i
+ ;; Outside embedded Lisp, repeat leading
+ ;; characters before initial place holder
+ ;; every line.
+ (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)
+ (?f v-f)
+ (?F v-F)
+ (?k v-k)
+ (?K v-K)
+ (?l v-l)
+ (?L v-L)
+ (?n v-n)
+ (?t v-t)
+ (?T v-T)
+ (?u v-u)
+ (?U v-U)
+ (?x v-x))))
+ (insert
+ (if inside-sexp?
+ ;; 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
+ ;; completion in interactive prompts.
+ (let ((org-inhibit-startup t)) (org-mode))
+ (org-clone-local-variables buffer "\\`org-")
+ (let (strings) ; Stores interactive answers.
+ (save-excursion
+ (let ((regexp "%\\^\\(?:{\\([^}]*\\)}\\)?\\([CgGLptTuU]\\)?"))
+ (while (re-search-forward regexp nil t)
+ (let* ((items (and (match-end 1)
+ (save-match-data
+ (split-string (match-string-no-properties 1)
+ "|"))))
+ (key (match-string 2))
+ (beg (copy-marker (match-beginning 0)))
+ (end (copy-marker (match-end 0)))
+ (prompt (nth 0 items))
+ (default (nth 1 items))
+ (completions (nthcdr 2 items)))
+ (unless (org-capture-escaped-%)
+ (delete-region beg end)
+ (set-marker beg nil)
+ (set-marker end nil)
+ (pcase key
+ ((or "G" "g")
+ (let* ((org-last-tags-completion-table
+ (org-global-tags-completion-table
+ (cond ((equal key "G") (org-agenda-files))
+ (file (list file))
+ (t nil))))
+ (org-add-colon-after-tag-completion t)
+ (ins (mapconcat
+ #'identity
+ (let ((crm-separator "[ \t]*:[ \t]*"))
+ (completing-read-multiple
+ (if prompt (concat prompt ": ") "Tags: ")
+ org-last-tags-completion-table nil nil nil
+ 'org-tags-history))
+ ":")))
+ (when (org-string-nw-p ins)
+ (unless (eq (char-before) ?:) (insert ":"))
+ (insert ins)
+ (unless (eq (char-after) ?:) (insert ":"))
+ (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)))))
+ (pcase org-capture--clipboards
+ (`nil nil)
+ (`(,value) (funcall insert-fun value))
+ (`(,first-value . ,_)
+ (funcall insert-fun
+ (read-string "Clipboard/kill value: "
+ first-value
+ 'org-capture--clipboards
+ first-value)))
+ (_ (error "Invalid `org-capture--clipboards' value: %S"
+ org-capture--clipboards)))))
+ ("p"
+ ;; We remove keyword 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-keyword-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 default)))
+ (org-set-property prompt value)))
+ ((or "t" "T" "u" "U")
+ ;; These are the date/time related ones.
+ (let* ((upcase? (equal (upcase key) key))
+ (org-end-time-was-given nil)
+ (time (org-read-date upcase? t nil prompt)))
+ (org-insert-time-stamp
+ time (or org-time-was-given upcase?)
+ (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 'org-capture--prompt-history default)
+ 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
+ (while (re-search-forward "%\\\\\\([1-9][0-9]*\\)" nil t)
+ (unless (org-capture-escaped-%)
+ (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 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")
+ (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)
+ (prog1 (buffer-substring-no-properties (point-min) (point-max))
+ (kill-buffer (current-buffer))))))
+
+(defun org-capture-escaped-% ()
+ "Non-nil if % was escaped.
+If yes, unescape it now. Assume `match-data' contains the
+placeholder to check."
+ (save-excursion
+ (goto-char (match-beginning 0))
+ (let ((n (abs (skip-chars-backward "\\\\"))))
+ (delete-char (/ (1+ n) 2))
+ (= (% n 2) 1))))
+
+(defun org-capture-expand-embedded-elisp (&optional mark)
+ "Evaluate embedded elisp %(sexp) and replace with the result.
+When optional MARK argument is non-nil, mark Sexp with a text
+property (`org-embedded-elisp') for later evaluation. Only
+marked Sexp are evaluated when this argument is nil."
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward "%(" nil t)
+ (cond
+ ((get-text-property (match-beginning 0) 'org-embedded-elisp)
+ (goto-char (match-beginning 0))
+ (let ((template-start (point)))
+ (forward-char 1)
+ (let* ((sexp (read (current-buffer)))
+ (result (org-eval
+ (org-capture--expand-keyword-in-embedded-elisp
+ sexp))))
+ (delete-region template-start (point))
+ (cond
+ ((not result) nil)
+ ((stringp result) (insert result))
+ (t (error
+ "Capture template sexp `%s' must evaluate to string or nil"
+ sexp))))))
+ ((not mark) nil)
+ ;; Only mark valid and non-escaped sexp.
+ ((org-capture-escaped-%) nil)
+ (t
+ (let ((end (with-syntax-table emacs-lisp-mode-syntax-table
+ (ignore-errors (scan-sexps (1- (point)) 1)))))
+ (when end
+ (put-text-property (- (point) 2) end 'org-embedded-elisp t))))))))
+
+(defun org-capture--expand-keyword-in-embedded-elisp (attr)
+ "Recursively replace capture link keywords in ATTR sexp.
+Such keywords are prefixed with \"%:\". See
+`org-capture-template' for more information."
+ (cond ((consp attr)
+ (mapcar 'org-capture--expand-keyword-in-embedded-elisp attr))
+ ((symbolp attr)
+ (let* ((attr-symbol (symbol-name attr))
+ (key (and (string-match "%\\(:.*\\)" attr-symbol)
+ (intern (match-string 1 attr-symbol)))))
+ (or (plist-get org-store-link-plist key)
+ attr)))
+ (t attr)))
+
+(defun org-capture-inside-embedded-elisp-p ()
+ "Non-nil if point is inside of embedded elisp %(sexp).
+Assume sexps have been marked with
+`org-capture-expand-embedded-elisp' beforehand."
+ (get-text-property (point) 'org-embedded-elisp))
+
+;;;###autoload
+(defun org-capture-import-remember-templates ()
+ "Set `org-capture-templates' to be similar to `org-remember-templates'."
+ (interactive)
+ (when (and (yes-or-no-p
+ "Import old remember templates into org-capture-templates? ")
+ (yes-or-no-p
+ "Note that this will remove any templates currently defined in `org-capture-templates'. Do you still want to go ahead? "))
+ (require 'org-remember)
+ (setq org-capture-templates
+ (mapcar
+ (lambda (entry)
+ (let ((desc (car entry))
+ (key (char-to-string (nth 1 entry)))
+ (template (nth 2 entry))
+ (file (or (nth 3 entry) org-default-notes-file))
+ (position (or (nth 4 entry) org-remember-default-headline))
+ (type 'entry)
+ (prepend org-reverse-note-order)
+ immediate target jump-to-captured)
+ (cond
+ ((member position '(top bottom))
+ (setq target (list 'file file)
+ prepend (eq position 'top)))
+ ((eq position 'date-tree)
+ (setq target (list 'file+datetree file)
+ prepend nil))
+ (t (setq target (list 'file+headline file position))))
+
+ (when (string-match "%!" template)
+ (setq template (replace-match "" t t template)
+ immediate t))
+
+ (when (string-match "%&" template)
+ (setq jump-to-captured t))
+
+ (append (list key desc type target template)
+ (and prepend '(:prepend t))
+ (and immediate '(:immediate-finish t))
+ (and jump-to-captured '(:jump-to-captured t)))))
+
+ org-remember-templates))))
+
+
+(provide 'org-capture)
+
+;;; org-capture.el ends here
diff --git a/elpa/org-9.5.2/org-capture.elc b/elpa/org-9.5.2/org-capture.elc
new file mode 100644
index 0000000..81e653c
--- /dev/null
+++ b/elpa/org-9.5.2/org-capture.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-clock.el b/elpa/org-9.5.2/org-clock.el
new file mode 100644
index 0000000..143ed4f
--- /dev/null
+++ b/elpa/org-9.5.2/org-clock.el
@@ -0,0 +1,3149 @@
+;;; org-clock.el --- The time clocking code for Org mode -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file contains the time clocking code for Org mode
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'org)
+
+(declare-function calendar-iso-to-absolute "cal-iso" (date))
+(declare-function notifications-notify "notifications" (&rest params))
+(declare-function org-element-property "org-element" (property element))
+(declare-function org-element-type "org-element" (element))
+(declare-function org-inlinetask-at-task-p "org-inlinetask" ())
+(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" ())
+(declare-function org-link-display-format "ol" (s))
+(declare-function org-link-heading-search-string "ol" (&optional string))
+(declare-function org-link-make-string "ol" (link &optional description))
+(declare-function org-table-goto-line "org-table" (n))
+(declare-function org-dynamic-block-define "org" (type func))
+(declare-function w32-notification-notify "w32fns.c" (&rest params))
+(declare-function w32-notification-close "w32fns.c" (&rest params))
+
+(defvar org-frame-title-format-backup nil)
+(defvar org-state)
+(defvar org-link-bracket-re)
+(defvar org-time-stamp-formats)
+
+(defgroup org-clock nil
+ "Options concerning clocking working time in Org mode."
+ :tag "Org Clock"
+ :group 'org-progress)
+
+(defcustom org-clock-into-drawer t
+ "Non-nil when clocking info should be wrapped into a drawer.
+
+When non-nil, clocking info will be inserted into the same drawer
+as log notes (see variable `org-log-into-drawer'), if it exists,
+or \"LOGBOOK\" otherwise. If necessary, the drawer will be
+created.
+
+When an integer, the drawer is created only when the number of
+clocking entries in an item reaches or exceeds this value.
+
+When a string, it becomes the name of the drawer, ignoring the
+log notes drawer altogether.
+
+Do not check directly this variable in a Lisp program. Call
+function `org-clock-into-drawer' instead."
+ :group 'org-todo
+ :group 'org-clock
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(choice
+ (const :tag "Always" t)
+ (const :tag "Only when drawer exists" nil)
+ (integer :tag "When at least N clock entries")
+ (const :tag "Into LOGBOOK drawer" "LOGBOOK")
+ (string :tag "Into Drawer named...")))
+
+(defun org-clock-into-drawer ()
+ "Value of `org-clock-into-drawer', but let properties overrule.
+
+If the current entry has or inherits a CLOCK_INTO_DRAWER
+property, it will be used instead of the default value.
+
+Return value is either a string, an integer, or nil."
+ (let ((p (org-entry-get nil "CLOCK_INTO_DRAWER" 'inherit t)))
+ (cond ((equal p "nil") nil)
+ ((equal p "t") (or (org-log-into-drawer) "LOGBOOK"))
+ ((org-string-nw-p p)
+ (if (string-match-p "\\`[0-9]+\\'" p) (string-to-number p) p))
+ ((org-string-nw-p org-clock-into-drawer))
+ ((integerp org-clock-into-drawer) org-clock-into-drawer)
+ ((not org-clock-into-drawer) nil)
+ ((org-log-into-drawer))
+ (t "LOGBOOK"))))
+
+(defcustom org-clock-out-when-done t
+ "When non-nil, clock will be stopped when the clocked entry is marked DONE.
+\\<org-mode-map>\
+DONE here means any DONE-like state.
+A nil value means clock will keep running until stopped explicitly with
+`\\[org-clock-out]', or until the clock is started in a different item.
+Instead of t, this can also be a list of TODO states that should trigger
+clocking out."
+ :group 'org-clock
+ :type '(choice
+ (const :tag "No" nil)
+ (const :tag "Yes, when done" t)
+ (repeat :tag "State list"
+ (string :tag "TODO keyword"))))
+
+(defcustom org-clock-rounding-minutes 0
+ "Rounding minutes when clocking in or out.
+The default value is 0 so that no rounding is done.
+When set to a non-integer value, use the car of
+`org-time-stamp-rounding-minutes', like for setting a time-stamp.
+
+E.g. if `org-clock-rounding-minutes' is set to 5, time is 14:47
+and you clock in: then the clock starts at 14:45. If you clock
+out within the next 5 minutes, the clock line will be removed;
+if you clock out 8 minutes after your clocked in, the clock
+out time will be 14:50."
+ :group 'org-clock
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (integer :tag "Minutes (0 for no rounding)")
+ (symbol :tag "Use `org-time-stamp-rounding-minutes'" 'same-as-time-stamp)))
+
+(defcustom org-clock-out-remove-zero-time-clocks nil
+ "Non-nil means remove the clock line when the resulting time is zero."
+ :group 'org-clock
+ :type 'boolean)
+
+(defcustom org-clock-in-switch-to-state nil
+ "Set task to a special todo state while clocking it.
+The value should be the state to which the entry should be
+switched. If the value is a function, it must take one
+parameter (the current TODO state of the item) and return the
+state to switch it to."
+ :group 'org-clock
+ :group 'org-todo
+ :type '(choice
+ (const :tag "Don't force a state" nil)
+ (string :tag "State")
+ (symbol :tag "Function")))
+
+(defcustom org-clock-out-switch-to-state nil
+ "Set task to a special todo state after clocking out.
+The value should be the state to which the entry should be
+switched. If the value is a function, it must take one
+parameter (the current TODO state of the item) and return the
+state to switch it to."
+ :group 'org-clock
+ :group 'org-todo
+ :type '(choice
+ (const :tag "Don't force a state" nil)
+ (string :tag "State")
+ (symbol :tag "Function")))
+
+(defcustom org-clock-history-length 5
+ "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)
+
+(defcustom org-clock-goto-may-find-recent-task t
+ "Non-nil means `org-clock-goto' can go to recent task if no active clock."
+ :group 'org-clock
+ :type 'boolean)
+
+(defcustom org-clock-heading-function nil
+ "When non-nil, should be a function to create `org-clock-heading'.
+This is the string shown in the mode line when a clock is running.
+The function is called with point at the beginning of the headline."
+ :group 'org-clock
+ :type '(choice (const nil) (function)))
+
+(defcustom org-clock-string-limit 0
+ "Maximum length of clock strings in the mode line. 0 means no limit."
+ :group 'org-clock
+ :type 'integer)
+
+(defcustom org-clock-in-resume nil
+ "If non-nil, resume clock when clocking into task with open clock.
+When clocking into a task with a clock entry which has not been closed,
+the clock can be resumed from that point."
+ :group 'org-clock
+ :type 'boolean)
+
+(defcustom org-clock-persist nil
+ "When non-nil, save the running clock when Emacs is closed.
+The clock is resumed when Emacs restarts.
+When this is t, both the running clock, and the entire clock
+history are saved. When this is the symbol `clock', only the
+running clock is saved. When this is the symbol `history', only
+the clock history is saved.
+
+When Emacs restarts with saved clock information, the file containing
+the running clock as well as all files mentioned in the clock history
+will be visited.
+
+All this depends on running `org-clock-persistence-insinuate' in your
+Emacs initialization file."
+ :group 'org-clock
+ :type '(choice
+ (const :tag "Just the running clock" clock)
+ (const :tag "Just the history" history)
+ (const :tag "Clock and history" t)
+ (const :tag "No persistence" nil)))
+
+(defcustom org-clock-persist-file (convert-standard-filename
+ (concat user-emacs-directory "org-clock-save.el"))
+ "File to save clock data to."
+ :group 'org-clock
+ :type 'string)
+
+(defcustom org-clock-persist-query-save nil
+ "When non-nil, ask before saving the current clock on exit."
+ :group 'org-clock
+ :type 'boolean)
+
+(defcustom org-clock-persist-query-resume t
+ "When non-nil, ask before resuming any stored clock during load."
+ :group 'org-clock
+ :type 'boolean)
+
+(defcustom org-clock-sound nil
+ "Sound to use for notifications.
+Possible values are:
+
+nil No sound played
+t Standard Emacs beep
+file name Play this sound file, fall back to beep"
+ :group 'org-clock
+ :type '(choice
+ (const :tag "No sound" nil)
+ (const :tag "Standard beep" t)
+ (file :tag "Play sound file")))
+
+(defcustom org-clock-mode-line-total 'auto
+ "Default setting for the time included for the mode line clock.
+This can be overruled locally using the CLOCK_MODELINE_TOTAL property.
+Allowed values are:
+
+current Only the time in the current instance of the clock
+today All time clocked into this task today
+repeat All time clocked into this task since last repeat
+all All time ever recorded for this task
+auto Automatically, either `all', or `repeat' for repeating tasks"
+ :group 'org-clock
+ :type '(choice
+ (const :tag "Current clock" current)
+ (const :tag "Today's task time" today)
+ (const :tag "Since last repeat" repeat)
+ (const :tag "All task time" all)
+ (const :tag "Automatically, `all' or since `repeat'" auto)))
+
+(defvaralias 'org-task-overrun-text 'org-clock-task-overrun-text)
+(defcustom org-clock-task-overrun-text nil
+ "Extra mode line text to indicate that the clock is overrun.
+The can be nil to indicate that instead of adding text, the clock time
+should get a different face (`org-mode-line-clock-overrun').
+When this is a string, it is prepended to the clock string as an indication,
+also using the face `org-mode-line-clock-overrun'."
+ :group 'org-clock
+ :version "24.1"
+ :type '(choice
+ (const :tag "Just mark the time string" nil)
+ (string :tag "Text to prepend")))
+
+(defcustom org-show-notification-timeout 3
+ "Number of seconds to wait before closing Org notifications.
+This is applied to notifications sent with `notifications-notify'
+and `w32-notification-notify' only, not other mechanisms possibly
+set through `org-show-notification-handler'."
+ :group 'org-clock
+ :package-version '(Org . "9.4")
+ :type 'integer)
+
+(defcustom org-show-notification-handler nil
+ "Function or program to send notification with.
+The function or program will be called with the notification
+string as argument."
+ :group 'org-clock
+ :type '(choice
+ (const nil)
+ (string :tag "Program")
+ (function :tag "Function")))
+
+(defgroup org-clocktable nil
+ "Options concerning the clock table in Org mode."
+ :tag "Org Clock Table"
+ :group 'org-clock)
+
+(defcustom org-clocktable-defaults
+ (list
+ :maxlevel 2
+ :lang (or (bound-and-true-p org-export-default-language) "en")
+ :scope 'file
+ :block nil
+ :wstart 1
+ :mstart 1
+ :tstart nil
+ :tend nil
+ :step nil
+ :stepskip0 nil
+ :fileskip0 nil
+ :tags nil
+ :match nil
+ :emphasize nil
+ :link nil
+ :narrow '40!
+ :indent t
+ :hidefiles nil
+ :formula nil
+ :timestamp nil
+ :level nil
+ :tcolumns nil
+ :formatter nil)
+ "Default properties for clock tables."
+ :group 'org-clock
+ :version "24.1"
+ :type 'plist)
+
+(defcustom org-clock-clocktable-formatter 'org-clocktable-write-default
+ "Function to turn clocking data into a table.
+For more information, see `org-clocktable-write-default'."
+ :group 'org-clocktable
+ :version "24.1"
+ :type 'function)
+
+;; FIXME: translate es and nl last string "Clock summary at"
+(defcustom org-clock-clocktable-language-setup
+ '(("en" "File" "L" "Timestamp" "Headline" "Time" "ALL" "Total time" "File time" "Clock summary at")
+ ("es" "Archivo" "N" "Fecha y hora" "Tarea" "Tiempo" "TODO" "Tiempo total" "Tiempo archivo" "Clock summary at")
+ ("fr" "Fichier" "N" "Horodatage" "En-tête" "Durée" "TOUT" "Durée totale" "Durée fichier" "Horodatage sommaire à")
+ ("nl" "Bestand" "N" "Tijdstip" "Hoofding" "Duur" "ALLES" "Totale duur" "Bestandstijd" "Clock summary at")
+ ("de" "Datei" "E" "Zeitstempel" "Kopfzeile" "Dauer" "GESAMT"
+ "Gesamtdauer" "Dateizeit" "Erstellt am"))
+ "Terms used in clocktable, translated to different languages."
+ :group 'org-clocktable
+ :version "24.1"
+ :type 'alist)
+
+(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
+ "When non-nil, resolve open clocks if the user is idle more than X minutes."
+ :group 'org-clock
+ :type '(choice
+ (const :tag "Never" nil)
+ (integer :tag "After N minutes")))
+
+(defcustom org-clock-auto-clock-resolution 'when-no-clock-is-running
+ "When to automatically resolve open clocks found in Org buffers."
+ :group 'org-clock
+ :type '(choice
+ (const :tag "Never" nil)
+ (const :tag "Always" t)
+ (const :tag "When no clock is running" when-no-clock-is-running)))
+
+(defcustom org-clock-report-include-clocking-task nil
+ "When non-nil, include the current clocking task time in clock reports."
+ :group 'org-clock
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-clock-resolve-expert nil
+ "Non-nil means do not show the splash buffer with the clock resolver."
+ :group 'org-clock
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-clock-continuously nil
+ "Non-nil means to start clocking from the last clock-out time, if any."
+ :type 'boolean
+ :version "24.1"
+ :group 'org-clock)
+
+(defcustom org-clock-total-time-cell-format "*%s*"
+ "Format string for the total time cells."
+ :group 'org-clock
+ :version "24.1"
+ :type 'string)
+
+(defcustom org-clock-file-time-cell-format "*%s*"
+ "Format string for the file time cells."
+ :group 'org-clock
+ :version "24.1"
+ :type 'string)
+
+(defcustom org-clock-clocked-in-display 'mode-line
+ "When clocked in for a task, Org can display the current
+task and accumulated time in the mode line and/or frame title.
+Allowed values are:
+
+both displays in both mode line and frame title
+mode-line displays only in mode line (default)
+frame-title displays only in frame title
+nil current clock is not displayed"
+ :group 'org-clock
+ :type '(choice
+ (const :tag "Mode line" mode-line)
+ (const :tag "Frame title" frame-title)
+ (const :tag "Both" both)
+ (const :tag "None" nil)))
+
+(defcustom org-clock-frame-title-format '(t org-mode-line-string)
+ "The value for `frame-title-format' when clocking in.
+
+When `org-clock-clocked-in-display' is set to `frame-title'
+or `both', clocking in will replace `frame-title-format' with
+this value. Clocking out will restore `frame-title-format'.
+
+`org-frame-title-string' is a format string using the same
+specifications than `frame-title-format', which see."
+ :version "24.1"
+ :group 'org-clock
+ :type 'sexp)
+
+(defcustom org-clock-x11idle-program-name "x11idle"
+ "Name of the program which prints X11 idle time in milliseconds.
+
+you can do \"~$ sudo apt-get install xprintidle\" if you are using
+a Debian-based distribution.
+
+Alternatively, can find x11idle.c in the org-contrib repository at
+https://git.sr.ht/~bzg/org-contrib"
+ :group 'org-clock
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string)
+
+(defcustom org-clock-goto-before-context 2
+ "Number of lines of context to display before currently clocked-in entry.
+This applies when using `org-clock-goto'."
+ :group 'org-clock
+ :type 'integer)
+
+(defcustom org-clock-display-default-range 'thisyear
+ "Default range when displaying clocks with `org-clock-display'.
+Valid values are: `today', `yesterday', `thisweek', `lastweek',
+`thismonth', `lastmonth', `thisyear', `lastyear' and `untilnow'."
+ :group 'org-clock
+ :type '(choice (const today)
+ (const yesterday)
+ (const thisweek)
+ (const lastweek)
+ (const thismonth)
+ (const lastmonth)
+ (const thisyear)
+ (const lastyear)
+ (const untilnow)
+ (const :tag "Select range interactively" interactive))
+ :safe #'symbolp)
+
+(defcustom org-clock-auto-clockout-timer nil
+ "Timer for auto clocking out when Emacs is idle.
+When set to a number, auto clock out the currently clocked in
+task after this number of seconds of idle time.
+
+This is only effective when `org-clock-auto-clockout-insinuate'
+is added to the user configuration."
+ :group 'org-clock
+ :package-version '(Org . "9.4")
+ :type '(choice
+ (integer :tag "Clock out after Emacs is idle for X seconds")
+ (const :tag "Never auto clock out" nil)))
+
+(defcustom org-clock-ask-before-exiting t
+ "If non-nil, ask if the user wants to clock out before exiting Emacs.
+This variable only has effect if set with \\[customize]."
+ :set (lambda (symbol value)
+ (if value
+ (add-hook 'kill-emacs-query-functions #'org-clock-kill-emacs-query)
+ (remove-hook 'kill-emacs-query-functions #'org-clock-kill-emacs-query))
+ (set symbol value))
+ :type 'boolean
+ :package-version '(Org . "9.5"))
+
+(defvar org-clock-in-prepare-hook nil
+ "Hook run when preparing the clock.
+This hook is run before anything happens to the task that
+you want to clock in. For example, you can use this hook
+to add an effort property.")
+(defvar org-clock-in-hook nil
+ "Hook run when starting the clock.")
+(defvar org-clock-out-hook nil
+ "Hook run when stopping the current clock.")
+
+(defvar org-clock-cancel-hook nil
+ "Hook run when canceling the current clock.")
+(defvar org-clock-goto-hook nil
+ "Hook run when selecting the currently clocked-in entry.")
+(defvar org-clock-has-been-used nil
+ "Has the clock been used during the current Emacs session?")
+
+(defvar org-clock-stored-history nil
+ "Clock history, populated by `org-clock-load'.")
+(defvar org-clock-stored-resume-clock nil
+ "Clock to resume, saved by `org-clock-load'.")
+
+;;; The clock for measuring work time.
+
+(defvar org-mode-line-string "")
+(put 'org-mode-line-string 'risky-local-variable t)
+
+(defvar org-clock-mode-line-timer nil)
+(defvar org-clock-idle-timer nil)
+(defvar org-clock-heading) ; defined in org.el
+(defvar org-clock-start-time "")
+
+(defvar org-clock-leftover-time nil
+ "If non-nil, user canceled a clock; this is when leftover time started.")
+
+(defvar org-clock-effort ""
+ "Effort estimate of the currently clocking task.")
+
+(defvar org-clock-total-time nil
+ "Holds total time, spent previously on currently clocked item.
+This does not include the time in the currently running clock.")
+
+(defvar org-clock-history nil
+ "List of marker pointing to recent clocked tasks.")
+
+(defvar org-clock-default-task (make-marker)
+ "Marker pointing to the default task that should clock time.
+The clock can be made to switch to this task after clocking out
+of a different task.")
+
+(defvar org-clock-interrupted-task (make-marker)
+ "Marker pointing to the task that has been interrupted by the current clock.")
+
+(defvar org-clock-mode-line-map (make-sparse-keymap))
+(define-key org-clock-mode-line-map [mode-line mouse-2] #'org-clock-goto)
+(define-key org-clock-mode-line-map [mode-line mouse-1] #'org-clock-menu)
+
+(defun org-clock--translate (s language)
+ "Translate string S into using string LANGUAGE.
+Assume S in the English term to translate. Return S as-is if it
+cannot be translated."
+ (or (nth (pcase s
+ ("File" 1) ("L" 2) ("Timestamp" 3) ("Headline" 4) ("Time" 5)
+ ("ALL" 6) ("Total time" 7) ("File time" 8) ("Clock summary at" 9))
+ (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 (org-link-display-format
+ (org-no-properties (org-get-heading t t t t))))))
+
+(defun org-clock-menu ()
+ (interactive)
+ (popup-menu
+ '("Clock"
+ ["Clock out" org-clock-out t]
+ ["Change effort estimate" org-clock-modify-effort-estimate t]
+ ["Go to clock entry" org-clock-goto t]
+ ["Switch task" (lambda () (interactive) (org-clock-in '(4))) :active t :keys "C-u C-c C-x C-i"])))
+
+(defun org-clock-history-push (&optional pos buffer)
+ "Push a marker to the clock history."
+ (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)))))
+ n l)
+ (while (setq n (member m org-clock-history))
+ (move-marker (car n) nil))
+ (setq org-clock-history
+ (delq nil
+ (mapcar (lambda (x) (if (marker-buffer x) x nil))
+ org-clock-history)))
+ (when (>= (setq l (length org-clock-history)) org-clock-history-length)
+ (setq org-clock-history
+ (nreverse
+ (nthcdr (- l org-clock-history-length -1)
+ (nreverse org-clock-history)))))
+ (push m org-clock-history)))
+
+(defun org-clock-save-markers-for-cut-and-paste (beg end)
+ "Save relative positions of markers in region."
+ (org-check-and-save-marker org-clock-marker beg end)
+ (org-check-and-save-marker org-clock-hd-marker beg end)
+ (org-check-and-save-marker org-clock-default-task beg end)
+ (org-check-and-save-marker org-clock-interrupted-task beg end)
+ (dolist (m org-clock-history)
+ (org-check-and-save-marker m beg end)))
+
+(defun org-clock-drawer-name ()
+ "Return clock drawer's name for current entry, or nil."
+ (let ((drawer (org-clock-into-drawer)))
+ (cond ((integerp drawer)
+ (let ((log-drawer (org-log-into-drawer)))
+ (if (stringp log-drawer) log-drawer "LOGBOOK")))
+ ((stringp drawer) drawer)
+ (t nil))))
+
+(defun org-clocking-p ()
+ "Return t when clocking a task."
+ (not (equal (org-clocking-buffer) nil)))
+
+(defvar org-clock-before-select-task-hook nil
+ "Hook called in task selection just before prompting the user.")
+
+(defun org-clock-select-task (&optional prompt)
+ "Select a task that was recently associated with clocking.
+Return marker position of the selected task. Raise an error if
+there is no recent clock to choose from."
+ (let (och chl sel-list rpl (i 0) s)
+ ;; Remove successive dups from the clock history to consider
+ (dolist (c org-clock-history)
+ (unless (equal c (car och)) (push c och)))
+ (setq och (reverse och) chl (length och))
+ (if (zerop chl)
+ (user-error "No recent clock")
+ (save-window-excursion
+ (org-switch-to-buffer-other-window
+ (get-buffer-create "*Clock Task Select*"))
+ (erase-buffer)
+ (when (marker-buffer org-clock-default-task)
+ (insert (org-add-props "Default Task\n" nil 'face 'bold))
+ (setq s (org-clock-insert-selection-line ?d org-clock-default-task))
+ (push s sel-list))
+ (when (marker-buffer org-clock-interrupted-task)
+ (insert (org-add-props "The task interrupted by starting the last one\n" nil 'face 'bold))
+ (setq s (org-clock-insert-selection-line ?i org-clock-interrupted-task))
+ (push s sel-list))
+ (when (org-clocking-p)
+ (insert (org-add-props "Current Clocking Task\n" nil 'face 'bold))
+ (setq s (org-clock-insert-selection-line ?c org-clock-marker))
+ (push s sel-list))
+ (insert (org-add-props "Recent Tasks\n" nil 'face 'bold))
+ (dolist (m och)
+ (when (marker-buffer m)
+ (setq i (1+ i)
+ s (org-clock-insert-selection-line
+ (if (< i 10)
+ (+ i ?0)
+ (+ i (- ?A 10))) m))
+ (if (fboundp 'int-to-char) (setf (car s) (int-to-char (car s))))
+ (push s sel-list)))
+ (run-hooks 'org-clock-before-select-task-hook)
+ (goto-char (point-min))
+ ;; Set min-height relatively to circumvent a possible but in
+ ;; `fit-window-to-buffer'
+ (fit-window-to-buffer nil nil (if (< chl 10) chl (+ 5 chl)))
+ (message (or prompt "Select task for clocking:"))
+ (setq cursor-type nil rpl (read-char-exclusive))
+ (kill-buffer)
+ (cond
+ ((eq rpl ?q) nil)
+ ((eq rpl ?x) nil)
+ ((assoc rpl sel-list) (cdr (assoc rpl sel-list)))
+ (t (user-error "Invalid task choice %c" rpl)))))))
+
+(defun org-clock-insert-selection-line (i marker)
+ "Insert a line for the clock selection menu.
+And return a cons cell with the selection character integer and the marker
+pointing to it."
+ (when (marker-buffer marker)
+ (let (cat task heading prefix)
+ (with-current-buffer (org-base-buffer (marker-buffer marker))
+ (org-with-wide-buffer
+ (ignore-errors
+ (goto-char marker)
+ (setq cat (org-get-category)
+ heading (org-get-heading 'notags)
+ prefix (save-excursion
+ (org-back-to-heading t)
+ (looking-at org-outline-regexp)
+ (match-string 0))
+ task (substring
+ (org-fontify-like-in-org-mode
+ (concat prefix heading)
+ org-odd-levels-only)
+ (length prefix))))))
+ (when (and cat task)
+ (insert (format "[%c] %-12s %s\n" i cat task))
+ (cons i marker)))))
+
+(defvar org-clock-task-overrun nil
+ "Internal flag indicating if the clock has overrun the planned time.")
+(defvar org-clock-update-period 60
+ "Number of seconds between mode line clock string updates.")
+
+(defun org-clock-get-clock-string ()
+ "Form a clock-string, that will be shown in the mode line.
+If an effort estimate was defined for the current item, use
+01:30/01:50 format (clocked/estimated).
+If not, show simply the clocked time like 01:50."
+ (let ((clocked-time (org-clock-get-clocked-time)))
+ (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)))
+ (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."
+ (save-excursion
+ (let ((end (save-excursion (org-end-of-subtree))))
+ (when (re-search-forward (concat org-clock-string
+ ".*\\]--\\(\\[[^]]+\\]\\)")
+ end t)
+ (org-time-string-to-time (match-string 1))))))
+
+(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))
+ (help-text "Org mode clock is running.\nmouse-1 shows a \
+menu\nmouse-2 will jump to task"))
+ (if (and (> org-clock-string-limit 0)
+ (> (length clock-string) org-clock-string-limit))
+ (propertize
+ (substring clock-string 0 org-clock-string-limit)
+ 'help-echo (concat help-text ": " org-clock-heading))
+ (propertize clock-string 'help-echo help-text)))
+ 'local-map org-clock-mode-line-map
+ 'mouse-face 'mode-line-highlight))
+ (if (and org-clock-task-overrun org-clock-task-overrun-text)
+ (setq org-mode-line-string
+ (concat (propertize
+ org-clock-task-overrun-text
+ 'face 'org-mode-line-clock-overrun)
+ org-mode-line-string)))
+ (force-mode-line-update))
+
+(defun org-clock-get-clocked-time ()
+ "Get the clocked time for the current item in minutes.
+The time returned includes the time spent on this task in
+previous clocking intervals."
+ (let ((currently-clocked-time
+ (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)
+ "Add to or set the effort estimate of the item currently being clocked.
+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 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."
+ (interactive)
+ (if (org-clock-is-active)
+ (let ((current org-clock-effort) sign)
+ (unless value
+ ;; Prompt user for a value or a change
+ (setq value
+ (read-string
+ (format "Set effort (hh:mm or mm%s): "
+ (if current
+ (format ", prefix + to add to %s" org-clock-effort)
+ "")))))
+ (when (stringp value)
+ ;; A string. See if it is a delta
+ (setq sign (string-to-char value))
+ (if (member sign '(?- ?+))
+ (setq current (org-duration-to-minutes current)
+ value (substring value 1))
+ (setq current 0))
+ (setq value (org-duration-to-minutes value))
+ (if (equal ?- sign)
+ (setq value (- current value))
+ (if (equal ?+ sign) (setq value (+ current value)))))
+ (setq value (max 0 value)
+ org-clock-effort (org-duration-from-minutes value))
+ (org-entry-put org-clock-marker "Effort" org-clock-effort)
+ (org-clock-update-mode-line)
+ (message "Effort is now %s" org-clock-effort))
+ (message "Clock is not currently active")))
+
+(defvar org-clock-notification-was-shown nil
+ "Shows if we have shown notification already.")
+
+(defun org-clock-notify-once-if-expired ()
+ "Show notification if we spent more time than we estimated before.
+Notification is shown only once."
+ (when (org-clocking-p)
+ (let ((effort-in-minutes (org-duration-to-minutes org-clock-effort))
+ (clocked-time (org-clock-get-clocked-time)))
+ (if (setq org-clock-task-overrun
+ (if (or (null effort-in-minutes) (zerop effort-in-minutes))
+ nil
+ (>= clocked-time effort-in-minutes)))
+ (unless org-clock-notification-was-shown
+ (setq org-clock-notification-was-shown t)
+ (org-notify
+ (format-message "Task `%s' should be finished by now. (%s)"
+ org-clock-heading org-clock-effort)
+ org-clock-sound))
+ (setq org-clock-notification-was-shown nil)))))
+
+(defun org-notify (notification &optional play-sound)
+ "Send a NOTIFICATION and maybe PLAY-SOUND.
+If PLAY-SOUND is non-nil, it overrides `org-clock-sound'."
+ (org-show-notification notification)
+ (if play-sound (org-clock-play-sound play-sound)))
+
+(defun org-show-notification (notification)
+ "Show notification.
+Use `org-show-notification-handler' if defined,
+use libnotify if available, or fall back on a message."
+ (ignore-errors (require 'notifications))
+ (cond ((functionp org-show-notification-handler)
+ (funcall org-show-notification-handler notification))
+ ((stringp org-show-notification-handler)
+ (start-process "emacs-timer-notification" nil
+ org-show-notification-handler notification))
+ ((fboundp 'w32-notification-notify)
+ (let ((id (w32-notification-notify
+ :title "Org mode message"
+ :body notification
+ :urgency 'low)))
+ (run-with-timer
+ org-show-notification-timeout
+ nil
+ (lambda () (w32-notification-close id)))))
+ ((fboundp 'ns-do-applescript)
+ (ns-do-applescript
+ (format "display notification \"%s\" with title \"Org mode notification\""
+ (replace-regexp-in-string "\"" "#" notification))))
+ ((fboundp 'notifications-notify)
+ (notifications-notify
+ :title "Org mode message"
+ :body notification
+ :timeout (* org-show-notification-timeout 1000)
+ ;; FIXME how to link to the Org icon?
+ ;; :app-icon "~/.emacs.d/icons/mail.png"
+ :urgency 'low))
+ ((executable-find "notify-send")
+ (start-process "emacs-timer-notification" nil
+ "notify-send" notification))
+ ;; Maybe the handler will send a message, so only use message as
+ ;; a fall back option
+ (t (message "%s" notification))))
+
+(defun org-clock-play-sound (&optional clock-sound)
+ "Play sound as configured by `org-clock-sound'.
+Use alsa's aplay tool if available.
+If CLOCK-SOUND is non-nil, it overrides `org-clock-sound'."
+ (let ((org-clock-sound (or clock-sound org-clock-sound)))
+ (cond
+ ((not org-clock-sound))
+ ((eq org-clock-sound t) (beep t) (beep t))
+ ((stringp org-clock-sound)
+ (let ((file (expand-file-name org-clock-sound)))
+ (if (file-exists-p file)
+ (if (executable-find "aplay")
+ (start-process "org-clock-play-notification" nil
+ "aplay" file)
+ (condition-case nil
+ (play-sound-file file)
+ (error (beep t) (beep t))))))))))
+
+(defvar org-clock-mode-line-entry nil
+ "Information for the mode line about the running clock.")
+
+(defun org-find-open-clocks (file)
+ "Search through the given file and find all open clocks."
+ (let ((buf (or (get-file-buffer file)
+ (find-file-noselect file)))
+ (org-clock-re (concat org-clock-string " \\(\\[.*?\\]\\)$"))
+ clocks)
+ (with-current-buffer buf
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward org-clock-re nil t)
+ (push (cons (copy-marker (match-end 1) t)
+ (org-time-string-to-time (match-string 1)))
+ clocks))))
+ clocks))
+
+(defsubst org-is-active-clock (clock)
+ "Return t if CLOCK is the currently active clock."
+ (and (org-clock-is-active)
+ (= org-clock-marker (car clock))))
+
+(defmacro org-with-clock-position (clock &rest forms)
+ "Evaluate FORMS with CLOCK as the current active clock."
+ (declare (indent 1) (debug t))
+ `(with-current-buffer (marker-buffer (car ,clock))
+ (org-with-wide-buffer
+ (goto-char (car ,clock))
+ (beginning-of-line)
+ ,@forms)))
+
+(defmacro org-with-clock (clock &rest forms)
+ "Evaluate FORMS with CLOCK as the current active clock.
+This macro also protects the current active clock from being altered."
+ (declare (indent 1) (debug t))
+ `(org-with-clock-position ,clock
+ (let ((org-clock-start-time (cdr ,clock))
+ (org-clock-total-time)
+ (org-clock-history)
+ (org-clock-effort)
+ (org-clock-marker (car ,clock))
+ (org-clock-hd-marker (save-excursion
+ (org-back-to-heading t)
+ (point-marker))))
+ ,@forms)))
+
+(defsubst org-clock-clock-in (clock &optional resume start-time)
+ "Clock in to the clock located by CLOCK.
+If necessary, clock-out of the currently active clock."
+ (org-with-clock-position clock
+ (let ((org-clock-in-resume (or resume org-clock-in-resume)))
+ (org-clock-in nil start-time))))
+
+(defsubst org-clock-clock-out (clock &optional fail-quietly at-time)
+ "Clock out of the clock located by CLOCK."
+ (let ((temp (copy-marker (car clock)
+ (marker-insertion-type (car clock)))))
+ (if (org-is-active-clock clock)
+ (org-clock-out nil fail-quietly at-time)
+ (org-with-clock clock
+ (org-clock-out nil fail-quietly at-time)))
+ (setcar clock temp)))
+
+(defsubst org-clock-clock-cancel (clock)
+ "Cancel the clock located by CLOCK."
+ (let ((temp (copy-marker (car clock)
+ (marker-insertion-type (car clock)))))
+ (if (org-is-active-clock clock)
+ (org-clock-cancel)
+ (org-with-clock clock
+ (org-clock-cancel)))
+ (setcar clock temp)))
+
+(defvar org-clock-clocking-in nil)
+(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 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)
+ "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))
+ (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))
+ (when drawer
+ (org-with-wide-buffer
+ (let ((drawer-re (format "^[ \t]*:%s:[ \t]*$"
+ (regexp-quote (if (stringp drawer) drawer "LOGBOOK"))))
+ (beg (save-excursion (org-back-to-heading t) (point))))
+ (catch 'exit
+ (while (re-search-backward drawer-re beg t)
+ (let ((element (org-element-at-point)))
+ (when (eq (org-element-type element) 'drawer)
+ (when (> (org-element-property :end element) (car clock))
+ (org-hide-drawer-toggle 'off nil element))
+ (throw 'exit nil)))))))))))
+
+(defun org-clock-resolve (clock &optional prompt-fn last-valid fail-quietly)
+ "Resolve an open Org clock.
+An open clock was found, with `dangling' possibly being non-nil.
+If this function was invoked with a prefix argument, non-dangling
+open clocks are ignored. The given clock requires some sort of
+user intervention to resolve it, either because a clock was left
+dangling or due to an idle timeout. The clock resolution can
+either be:
+
+ (a) deleted, the user doesn't care about the clock
+ (b) restarted from the current time (if no other clock is open)
+ (c) closed, giving the clock X minutes
+ (d) closed and then restarted
+ (e) resumed, as if the user had never left
+
+The format of clock is (CONS MARKER START-TIME), where MARKER
+identifies the buffer and position the clock is open at (and
+thus, the heading it's under), and START-TIME is when the clock
+was started."
+ (cl-assert clock)
+ (let* ((ch
+ (save-window-excursion
+ (save-excursion
+ (unless org-clock-resolving-clocks-due-to-idleness
+ (org-clock-jump-to-current-clock clock))
+ (unless org-clock-resolve-expert
+ (with-output-to-temp-buffer "*Org Clock*"
+ (princ (format-message "Select a Clock Resolution Command:
+
+i/q Ignore this question; the same as keeping all the idle time.
+
+k/K Keep X minutes of the idle time (default is all). If this
+ amount is less than the default, you will be clocked out
+ that many minutes after the time that idling began, and then
+ clocked back in at the present time.
+
+t/T Like `k', but will ask you to specify a time (when you got
+ distracted away), instead of a number of minutes.
+
+g/G Indicate that you \"got back\" X minutes ago. This is quite
+ different from `k': it clocks you out from the beginning of
+ the idle period and clock you back in X minutes ago.
+
+s/S Subtract the idle time from the current clock. This is the
+ same as keeping 0 minutes.
+
+C Cancel the open timer altogether. It will be as though you
+ never clocked in.
+
+j/J Jump to the current clock, to make manual adjustments.
+
+For all these options, using uppercase makes your final state
+to be CLOCKED OUT."))))
+ (org-fit-window-to-buffer (get-buffer-window "*Org Clock*"))
+ (let (char-pressed)
+ (while (or (null char-pressed)
+ (and (not (memq char-pressed
+ '(?k ?K ?g ?G ?s ?S ?C
+ ?j ?J ?i ?q ?t ?T)))
+ (or (ding) t)))
+ (setq char-pressed
+ (read-char (concat (funcall prompt-fn clock)
+ " [jkKtTgGSscCiq]? ")
+ nil 45)))
+ (and (not (memq char-pressed '(?i ?q))) char-pressed)))))
+ (default
+ (floor (org-time-convert-to-integer (org-time-since last-valid))
+ 60))
+ (keep
+ (or (and (memq ch '(?k ?K))
+ (read-number "Keep how many minutes? " default))
+ (and (memq ch '(?t ?T))
+ (floor
+ (/ (float-time
+ (org-time-subtract (org-read-date t t) last-valid))
+ 60)))))
+ (gotback
+ (and (memq ch '(?g ?G))
+ (read-number "Got back how many minutes ago? " default)))
+ (subtractp (memq ch '(?s ?S)))
+ (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))
+ (if (eq ch ?J)
+ (org-clock-resolve-clock clock 'now nil t nil fail-quietly))
+ (org-clock-jump-to-current-clock clock))
+ ((or (null ch)
+ (not (memq ch '(?k ?K ?g ?G ?s ?S ?C ?t ?T))))
+ (message ""))
+ (t
+ (org-clock-resolve-clock
+ clock (cond
+ ((or (eq ch ?C)
+ ;; If the time on the clock was less than a minute before
+ ;; the user went away, and they've ask to subtract all the
+ ;; time...
+ start-over)
+ nil)
+ ((or subtractp
+ (and gotback (= gotback 0)))
+ last-valid)
+ ((or (and keep (= keep default))
+ (and gotback (= gotback default)))
+ 'now)
+ (keep
+ (org-time-add last-valid (* 60 keep)))
+ (gotback
+ (org-time-since (* 60 gotback)))
+ (t
+ (error "Unexpected, please report this as a bug")))
+ (and gotback last-valid)
+ (memq ch '(?K ?G ?S ?T))
+ (and start-over
+ (not (memq ch '(?K ?G ?S ?C))))
+ fail-quietly)))))
+
+;;;###autoload
+(defun org-resolve-clocks (&optional only-dangling-p prompt-fn last-valid)
+ "Resolve all currently open Org clocks.
+If `only-dangling-p' is non-nil, only ask to resolve dangling
+\(i.e., not currently open and valid) clocks."
+ (interactive "P")
+ (unless org-clock-resolving-clocks
+ (let ((org-clock-resolving-clocks t))
+ (dolist (file (org-files-list))
+ (let ((clocks (org-find-open-clocks file)))
+ (dolist (clock clocks)
+ (let ((dangling (or (not (org-clock-is-active))
+ (/= (car clock) org-clock-marker))))
+ (if (or (not only-dangling-p) dangling)
+ (org-clock-resolve
+ clock
+ (or prompt-fn
+ (lambda (clock)
+ (format
+ "Dangling clock started %d mins ago"
+ (floor (org-time-convert-to-integer
+ (org-time-since (cdr clock)))
+ 60))))
+ (or last-valid
+ (cdr clock)))))))))))
+
+(defun org-emacs-idle-seconds ()
+ "Return the current Emacs idle time in seconds, or nil if not idle."
+ (let ((idle-time (current-idle-time)))
+ (if idle-time
+ (float-time idle-time)
+ 0)))
+
+(defun org-mac-idle-seconds ()
+ "Return the current Mac idle time in seconds."
+ (string-to-number (shell-command-to-string "ioreg -c IOHIDSystem | perl -ane 'if (/Idle/) {$idle=(pop @F)/1000000000; print $idle; last}'")))
+
+(defvar org-x11idle-exists-p
+ ;; Check that x11idle exists
+ (and (eq window-system 'x)
+ (eq 0 (call-process-shell-command
+ (format "command -v %s" org-clock-x11idle-program-name)))
+ ;; Check that x11idle can retrieve the idle time
+ ;; FIXME: Why "..-shell-command" rather than just `call-process'?
+ (eq 0 (call-process-shell-command org-clock-x11idle-program-name))))
+
+(defun org-x11-idle-seconds ()
+ "Return the current X11 idle time in seconds."
+ (/ (string-to-number (shell-command-to-string org-clock-x11idle-program-name)) 1000))
+
+(defun org-user-idle-seconds ()
+ "Return the number of seconds the user has been idle for.
+This routine returns a floating point number."
+ (cond
+ ((eq system-type 'darwin)
+ (org-mac-idle-seconds))
+ ((and (eq window-system 'x) org-x11idle-exists-p)
+ (org-x11-idle-seconds))
+ (t
+ (org-emacs-idle-seconds))))
+
+(defvar org-clock-user-idle-seconds)
+
+(defun org-resolve-clocks-if-idle ()
+ "Resolve all currently open Org clocks.
+This is performed after `org-clock-idle-time' minutes, to check
+if the user really wants to stay clocked in after being idle for
+so long."
+ (when (and org-clock-idle-time (not org-clock-resolving-clocks)
+ org-clock-marker (marker-buffer org-clock-marker))
+ (let* ((org-clock-user-idle-seconds (org-user-idle-seconds))
+ (org-clock-user-idle-start
+ (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
+ (cons org-clock-marker
+ org-clock-start-time)
+ (lambda (_)
+ (format "Clocked in & idle for %.1f mins"
+ (/ (float-time
+ (time-since org-clock-user-idle-start))
+ 60)))
+ org-clock-user-idle-start)))))
+
+(defvar org-clock-current-task nil "Task currently clocked in.")
+(defvar org-clock-out-time nil) ; store the time of the last clock-out
+(defvar org--msg-extra)
+
+;;;###autoload
+(defun org-clock-in (&optional select start-time)
+ "Start the clock on the current item.
+
+If necessary, clock-out of the currently active clock.
+
+With a `\\[universal-argument]' prefix argument SELECT, offer a list of \
+recently clocked
+tasks to clock into.
+
+When SELECT is `\\[universal-argument] \ \\[universal-argument]', \
+clock into the current task and mark it as
+the default task, a special task that will always be offered in the
+clocking selection, associated with the letter `d'.
+
+When SELECT is `\\[universal-argument] \\[universal-argument] \
+\\[universal-argument]', clock in by using the last clock-out
+time as the start time. See `org-clock-continuously' to make this
+the default behavior."
+ (interactive "P")
+ (setq org-clock-notification-was-shown nil)
+ (org-refresh-effort-properties)
+ (catch 'abort
+ (let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness)
+ (org-clocking-p)))
+ ts selected-task target-pos (org--msg-extra "")
+ (leftover (and (not org-clock-resolving-clocks)
+ org-clock-leftover-time)))
+
+ (when (and org-clock-auto-clock-resolution
+ (or (not interrupting)
+ (eq t org-clock-auto-clock-resolution))
+ (not org-clock-clocking-in)
+ (not org-clock-resolving-clocks))
+ (setq org-clock-leftover-time nil)
+ (let ((org-clock-clocking-in t))
+ (org-resolve-clocks))) ; check if any clocks are dangling
+
+ (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)
+ (throw 'abort nil)))
+
+ (when (equal select '(4))
+ (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 (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))
+ (let ((org-clock-clocking-in t))
+ (org-clock-out nil t)))
+
+ ;; Clock in at which position?
+ (setq target-pos
+ (if (and (eobp) (not (org-at-heading-p)))
+ (point-at-bol 0)
+ (point)))
+ (save-excursion
+ (when (and selected-task (marker-buffer selected-task))
+ ;; There is a selected task, move to the correct buffer
+ ;; and set the new target position.
+ (set-buffer (org-base-buffer (marker-buffer selected-task)))
+ (setq target-pos (marker-position selected-task))
+ (move-marker selected-task nil))
+ (org-with-wide-buffer
+ (goto-char target-pos)
+ (org-back-to-heading t)
+ (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 (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))
+ (let ((newstate (funcall org-clock-in-switch-to-state
+ (match-string 2))))
+ (when newstate (org-todo newstate))))
+ ((and org-clock-in-switch-to-state
+ (not (looking-at (concat org-outline-regexp "[ \t]*"
+ org-clock-in-switch-to-state
+ "\\>"))))
+ (org-todo org-clock-in-switch-to-state)))
+ (setq org-clock-heading (org-clock--mode-line-heading))
+ (org-clock-find-position org-clock-in-resume)
+ (cond
+ ((and org-clock-in-resume
+ (looking-at
+ (concat "^[ \t]*" org-clock-string
+ " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}"
+ " *\\sw+.? +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$")))
+ (message "Matched %s" (match-string 1))
+ (setq ts (concat "[" (match-string 1) "]"))
+ (goto-char (match-end 1))
+ (setq org-clock-start-time
+ (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))))
+ ((eq org-clock-in-resume 'auto-restart)
+ ;; called from org-clock-load during startup,
+ ;; do not interrupt, but warn!
+ (message "Cannot restart clock because task does not contain unfinished clock")
+ (ding)
+ (sit-for 2)
+ (throw 'abort nil))
+ (t
+ (insert-before-markers "\n")
+ (backward-char 1)
+ (when (and (save-excursion
+ (end-of-line 0)
+ (org-in-item-p)))
+ (beginning-of-line 1)
+ (indent-line-to (max 0 (- (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
+ (org-clock-get-sum-start)))
+ (setq org-clock-start-time
+ (or (and org-clock-continuously org-clock-out-time)
+ (and leftover
+ (y-or-n-p
+ (format
+ "You stopped another clock %d mins ago; start this one from then? "
+ (/ (org-time-convert-to-integer
+ (org-time-subtract
+ (org-current-time org-clock-rounding-minutes t)
+ leftover))
+ 60)))
+ leftover)
+ start-time
+ (org-current-time org-clock-rounding-minutes t)))
+ (setq ts (org-insert-time-stamp org-clock-start-time
+ 'with-hm 'inactive))
+ (org-indent-line)))
+ (move-marker org-clock-marker (point) (buffer-base-buffer))
+ (move-marker org-clock-hd-marker
+ (save-excursion (org-back-to-heading t) (point))
+ (buffer-base-buffer))
+ (setq org-clock-has-been-used t)
+ ;; add to mode line
+ (when (or (eq org-clock-clocked-in-display 'mode-line)
+ (eq org-clock-clocked-in-display 'both))
+ (or global-mode-string (setq global-mode-string '("")))
+ (or (memq 'org-mode-line-string global-mode-string)
+ (setq global-mode-string
+ (append global-mode-string '(org-mode-line-string)))))
+ ;; add to frame title
+ (when (or (eq org-clock-clocked-in-display 'frame-title)
+ (eq org-clock-clocked-in-display 'both))
+ (setq org-frame-title-format-backup frame-title-format)
+ (setq frame-title-format org-clock-frame-title-format))
+ (org-clock-update-mode-line)
+ (when org-clock-mode-line-timer
+ (cancel-timer org-clock-mode-line-timer)
+ (setq org-clock-mode-line-timer nil))
+ (when org-clock-clocked-in-display
+ (setq org-clock-mode-line-timer
+ (run-with-timer org-clock-update-period
+ org-clock-update-period
+ #'org-clock-update-mode-line)))
+ (when org-clock-idle-timer
+ (cancel-timer org-clock-idle-timer)
+ (setq org-clock-idle-timer nil))
+ (setq org-clock-idle-timer
+ (run-with-timer 60 60 #'org-resolve-clocks-if-idle))
+ (message "Clock starts at %s - %s" ts org--msg-extra)
+ (run-hooks 'org-clock-in-hook))))))
+
+(defun org-clock-auto-clockout ()
+ "Clock out the currently clocked in task if Emacs is idle.
+See `org-clock-auto-clockout-timer' to set the idle time span.
+
+This is only effective when `org-clock-auto-clockout-insinuate'
+is present in the user configuration."
+ (when (and (numberp org-clock-auto-clockout-timer)
+ org-clock-current-task)
+ (run-with-idle-timer
+ org-clock-auto-clockout-timer nil #'org-clock-out)))
+
+;;;###autoload
+(defun org-clock-toggle-auto-clockout ()
+ (interactive)
+ (if (memq 'org-clock-auto-clockout org-clock-in-hook)
+ (progn (remove-hook 'org-clock-in-hook #'org-clock-auto-clockout)
+ (message "Auto clock-out after idle time turned off"))
+ (add-hook 'org-clock-in-hook #'org-clock-auto-clockout t)
+ (message "Auto clock-out after idle time turned on")))
+
+;;;###autoload
+(defun org-clock-in-last (&optional arg)
+ "Clock in the last closed clocked item.
+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
+last clock-out time, if any.
+With three universal prefix arguments, interactively prompt
+for a todo state to switch to, overriding the existing value
+`org-clock-in-switch-to-state'."
+ (interactive "P")
+ (if (equal arg '(4)) (org-clock-in arg)
+ (let ((start-time (if (or org-clock-continuously (equal arg '(16)))
+ (or org-clock-out-time
+ (org-current-time org-clock-rounding-minutes t))
+ (org-current-time org-clock-rounding-minutes t))))
+ (if (null org-clock-history)
+ (message "No last clock")
+ (let ((org-clock-in-switch-to-state
+ (if (and (not org-clock-current-task) (equal arg '(64)))
+ (completing-read "Switch to state: "
+ (and org-clock-history
+ (with-current-buffer
+ (marker-buffer (car org-clock-history))
+ org-todo-keywords-1)))
+ org-clock-in-switch-to-state))
+ (already-clocking org-clock-current-task))
+ (org-clock-clock-in (list (car org-clock-history)) nil start-time)
+ (or already-clocking
+ ;; Don't display a message if we are already clocking in
+ (message "Clocking back: %s (in %s)"
+ org-clock-current-task
+ (buffer-name (marker-buffer org-clock-marker)))))))))
+
+(defun org-clock-mark-default-task ()
+ "Mark current task as default task."
+ (interactive)
+ (save-excursion
+ (org-back-to-heading t)
+ (move-marker org-clock-default-task (point))))
+
+(defun org-clock-get-sum-start ()
+ "Return the time from which clock times should be counted.
+
+This is for the currently running clock as it is displayed in the
+mode line. This function looks at the properties LAST_REPEAT and
+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" 'selective)
+ (symbol-name org-clock-mode-line-total)))
+ (lr (org-entry-get nil "LAST_REPEAT")))
+ (cond
+ ((equal cmt "current")
+ (setq org--msg-extra "showing time in current clock instance")
+ (current-time))
+ ((equal cmt "today")
+ (setq org--msg-extra "showing today's task time.")
+ (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)
+ (apply #'encode-time 0 0 (nthcdr 2 dt))))
+ ((or (equal cmt "all")
+ (and (or (not cmt) (equal cmt "auto"))
+ (not lr)))
+ (setq org--msg-extra "showing entire task time.")
+ nil)
+ ((or (equal cmt "repeat")
+ (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 nil))))
+
+(defun org-clock-find-position (find-unclosed)
+ "Find the location where the next clock line should be inserted.
+When FIND-UNCLOSED is non-nil, first check if there is an unclosed clock
+line and position cursor in that line."
+ (org-back-to-heading t)
+ (catch 'exit
+ (let* ((beg (line-beginning-position))
+ (end (save-excursion (outline-next-heading) (point)))
+ (org-clock-into-drawer (org-clock-into-drawer))
+ (drawer (org-clock-drawer-name)))
+ ;; Look for a running clock if FIND-UNCLOSED in non-nil.
+ (when find-unclosed
+ (let ((open-clock-re
+ (concat "^[ \t]*"
+ org-clock-string
+ " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}"
+ " *\\sw+ +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$")))
+ (while (re-search-forward open-clock-re end t)
+ (let ((element (org-element-at-point)))
+ (when (and (eq (org-element-type element) 'clock)
+ (eq (org-element-property :status element) 'running))
+ (beginning-of-line)
+ (throw 'exit t))))))
+ ;; Look for an existing clock drawer.
+ (when drawer
+ (goto-char beg)
+ (let ((drawer-re (concat "^[ \t]*:" (regexp-quote drawer) ":[ \t]*$")))
+ (while (re-search-forward drawer-re end t)
+ (let ((element (org-element-at-point)))
+ (when (eq (org-element-type element) 'drawer)
+ (let ((cend (org-element-property :contents-end element)))
+ (if (and (not org-log-states-order-reversed) cend)
+ (goto-char cend)
+ (forward-line))
+ (throw 'exit t)))))))
+ (goto-char beg)
+ (let ((clock-re (concat "^[ \t]*" org-clock-string))
+ (count 0)
+ positions)
+ ;; Count the CLOCK lines and store their positions.
+ (save-excursion
+ (while (re-search-forward clock-re end t)
+ (let ((element (org-element-at-point)))
+ (when (eq (org-element-type element) 'clock)
+ (setq positions (cons (line-beginning-position) positions)
+ count (1+ count))))))
+ (cond
+ ((null positions)
+ ;; Skip planning line and property drawer, if any.
+ (org-end-of-meta-data)
+ (unless (bolp) (insert "\n"))
+ ;; Create a new drawer if necessary.
+ (when (and org-clock-into-drawer
+ (or (not (wholenump org-clock-into-drawer))
+ (< org-clock-into-drawer 2)))
+ (let ((beg (point)))
+ (insert ":" drawer ":\n:END:\n")
+ (org-indent-region beg (point))
+ (org-flag-region
+ (line-end-position -1) (1- (point)) t 'outline)
+ (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.
+ ((if (wholenump org-clock-into-drawer)
+ (>= (1+ count) org-clock-into-drawer)
+ drawer)
+ ;; Skip planning line and property drawer, if any.
+ (org-end-of-meta-data)
+ (let ((beg (point)))
+ (insert
+ (mapconcat
+ (lambda (p)
+ (save-excursion
+ (goto-char p)
+ (org-trim (delete-and-extract-region
+ (save-excursion (skip-chars-backward " \r\t\n")
+ (line-beginning-position 2))
+ (line-beginning-position 2)))))
+ positions "\n")
+ "\n:END:\n")
+ (let ((end (point-marker)))
+ (goto-char beg)
+ (save-excursion (insert ":" drawer ":\n"))
+ (org-flag-region (line-end-position) (1- end) t 'outline)
+ (org-indent-region (point) end)
+ (forward-line)
+ (unless org-log-states-order-reversed
+ (goto-char end)
+ (beginning-of-line -1))
+ (set-marker end nil))))
+ (org-log-states-order-reversed (goto-char (car (last positions))))
+ (t (goto-char (car positions))))))))
+
+(defun org-clock-restore-frame-title-format ()
+ "Restore `frame-title-format' from `org-frame-title-format-backup'.
+`frame-title-format' is restored if `org-frame-title-format-backup' is not nil
+and current `frame-title-format' is equal to `org-clock-frame-title-format'."
+ (when (and org-frame-title-format-backup
+ (equal frame-title-format org-clock-frame-title-format))
+ (setq frame-title-format org-frame-title-format-backup)))
+
+;;;###autoload
+(defun org-clock-out (&optional switch-to-state fail-quietly at-time)
+ "Stop the currently running clock.
+Throw an error if there is no running clock and FAIL-QUIETLY is nil.
+With a universal prefix, prompt for a state to switch the clocked out task
+to, overriding the existing value of `org-clock-out-switch-to-state'."
+ (interactive "P")
+ (catch 'exit
+ (when (not (org-clocking-p))
+ (setq global-mode-string
+ (delq 'org-mode-line-string global-mode-string))
+ (org-clock-restore-frame-title-format)
+ (force-mode-line-update)
+ (if fail-quietly (throw 'exit t) (user-error "No active clock")))
+ (let ((org-clock-out-switch-to-state
+ (if switch-to-state
+ (completing-read "Switch to state: "
+ (with-current-buffer
+ (marker-buffer org-clock-marker)
+ org-todo-keywords-1)
+ nil t "DONE")
+ org-clock-out-switch-to-state))
+ (now (org-current-time org-clock-rounding-minutes))
+ ts te s h m remove)
+ (setq org-clock-out-time (or at-time now))
+ (save-excursion ; Do not replace this with `with-current-buffer'.
+ (with-no-warnings (set-buffer (org-clocking-buffer)))
+ (save-restriction
+ (widen)
+ (goto-char org-clock-marker)
+ (beginning-of-line 1)
+ (if (and (looking-at (concat "[ \t]*" org-keyword-time-regexp))
+ (equal (match-string 1) org-clock-string))
+ (setq ts (match-string 2))
+ (if fail-quietly (throw 'exit nil) (error "Clock start time is gone")))
+ (goto-char (match-end 0))
+ (delete-region (point) (point-at-eol))
+ (insert "--")
+ (setq te (org-insert-time-stamp (or at-time now) 'with-hm 'inactive))
+ (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.
+ (when (and org-clock-out-remove-zero-time-clocks
+ (= 0 h m))
+ (setq remove t)
+ (delete-region (line-beginning-position)
+ (line-beginning-position 2)))
+ (org-clock-remove-empty-clock-drawer)
+ (when org-clock-mode-line-timer
+ (cancel-timer org-clock-mode-line-timer)
+ (setq org-clock-mode-line-timer nil))
+ (when org-clock-idle-timer
+ (cancel-timer org-clock-idle-timer)
+ (setq org-clock-idle-timer nil))
+ (setq global-mode-string
+ (delq 'org-mode-line-string global-mode-string))
+ (org-clock-restore-frame-title-format)
+ (when org-clock-out-switch-to-state
+ (save-excursion
+ (org-back-to-heading t)
+ (let ((org-clock-out-when-done nil))
+ (cond
+ ((functionp org-clock-out-switch-to-state)
+ (let ((case-fold-search nil))
+ (looking-at org-complex-heading-regexp))
+ (let ((newstate (funcall org-clock-out-switch-to-state
+ (match-string 2))))
+ (when newstate (org-todo newstate))))
+ ((and org-clock-out-switch-to-state
+ (not (looking-at (concat org-outline-regexp "[ \t]*"
+ org-clock-out-switch-to-state
+ "\\>"))))
+ (org-todo org-clock-out-switch-to-state))))))
+ (force-mode-line-update)
+ (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)))
+ (unless (org-clocking-p)
+ (setq org-clock-current-task nil))
+ (run-hooks 'org-clock-out-hook)
+ ;; Add a note, but only if we didn't remove the clock line.
+ (when (and org-log-note-clock-out (not remove))
+ (org-add-log-setup
+ 'clock-out nil nil nil
+ (concat "# Task: " (org-get-heading t) "\n\n"))))))))
+
+(defun org-clock-remove-empty-clock-drawer ()
+ "Remove empty clock drawers in current subtree."
+ (save-excursion
+ (org-back-to-heading t)
+ (org-map-tree
+ (lambda ()
+ (let ((drawer (org-clock-drawer-name))
+ (case-fold-search t))
+ (when drawer
+ (let ((re (format "^[ \t]*:%s:[ \t]*$" (regexp-quote drawer)))
+ (end (save-excursion (outline-next-heading))))
+ (while (re-search-forward re end t)
+ (org-remove-empty-drawer-at (point))))))))))
+
+(defun org-clock-timestamps-up (&optional n)
+ "Increase CLOCK timestamps at cursor.
+Optional argument N tells to change by that many units."
+ (interactive "P")
+ (org-clock-timestamps-change 'up n))
+
+(defun org-clock-timestamps-down (&optional n)
+ "Increase CLOCK timestamps at cursor.
+Optional argument N tells to change by that many units."
+ (interactive "P")
+ (org-clock-timestamps-change 'down n))
+
+(defun org-clock-timestamps-change (updown &optional n)
+ "Change CLOCK timestamps synchronously at cursor.
+UPDOWN tells whether to change `up' or `down'.
+Optional argument N tells to change by that many units."
+ (let ((tschange (if (eq updown 'up) 'org-timestamp-up
+ 'org-timestamp-down))
+ (timestamp? (org-at-timestamp-p 'lax))
+ ts1 begts1 ts2 begts2 updatets1 tdiff)
+ (when timestamp?
+ (save-excursion
+ (move-beginning-of-line 1)
+ (re-search-forward org-ts-regexp3 nil t)
+ (setq ts1 (match-string 0) begts1 (match-beginning 0))
+ (when (re-search-forward org-ts-regexp3 nil t)
+ (setq ts2 (match-string 0) begts2 (match-beginning 0))))
+ ;; Are we on the second timestamp?
+ (if (<= begts2 (point)) (setq updatets1 t))
+ (if (not ts2)
+ ;; fall back on org-timestamp-up if there is only one
+ (funcall tschange n)
+ (funcall tschange n)
+ (let ((ts (if updatets1 ts2 ts1))
+ (begts (if updatets1 begts1 begts2)))
+ (setq tdiff
+ (time-subtract
+ (org-time-string-to-time org-last-changed-timestamp)
+ (org-time-string-to-time ts)))
+ (save-excursion
+ (goto-char begts)
+ (org-timestamp-change
+ (round (/ (float-time tdiff)
+ (pcase timestamp?
+ (`minute 60)
+ (`hour 3600)
+ (`day (* 24 3600))
+ (`month (* 24 3600 31))
+ (`year (* 24 3600 365.2)))))
+ timestamp? 'updown)))))))
+
+;;;###autoload
+(defun org-clock-cancel ()
+ "Cancel the running clock by removing the start timestamp."
+ (interactive)
+ (when (not (org-clocking-p))
+ (setq global-mode-string
+ (delq 'org-mode-line-string global-mode-string))
+ (org-clock-restore-frame-title-format)
+ (force-mode-line-update)
+ (user-error "No active clock"))
+ (save-excursion ; Do not replace this with `with-current-buffer'.
+ (with-no-warnings (set-buffer (org-clocking-buffer)))
+ (goto-char org-clock-marker)
+ (if (looking-back (concat "^[ \t]*" org-clock-string ".*")
+ (line-beginning-position))
+ (progn (delete-region (1- (point-at-bol)) (point-at-eol))
+ (org-remove-empty-drawer-at (point)))
+ (message "Clock gone, cancel the timer anyway")
+ (sit-for 2)))
+ (move-marker org-clock-marker nil)
+ (move-marker org-clock-hd-marker nil)
+ (setq org-clock-current-task nil)
+ (setq global-mode-string
+ (delq 'org-mode-line-string global-mode-string))
+ (org-clock-restore-frame-title-format)
+ (force-mode-line-update)
+ (message "Clock canceled")
+ (run-hooks 'org-clock-cancel-hook))
+
+;;;###autoload
+(defun org-clock-goto (&optional select)
+ "Go to the currently clocked-in entry, or to the most recently clocked one.
+With prefix arg SELECT, offer recently clocked tasks for selection."
+ (interactive "@P")
+ (let* ((recent nil)
+ (m (cond
+ (select
+ (or (org-clock-select-task "Select task to go to: ")
+ (user-error "No task selected")))
+ ((org-clocking-p) org-clock-marker)
+ ((and org-clock-goto-may-find-recent-task
+ (car org-clock-history)
+ (marker-buffer (car org-clock-history)))
+ (setq recent t)
+ (car org-clock-history))
+ (t (user-error "No active or recent clock task")))))
+ (pop-to-buffer-same-window (marker-buffer m))
+ (if (or (< m (point-min)) (> m (point-max))) (widen))
+ (goto-char m)
+ (org-show-entry)
+ (org-back-to-heading t)
+ (recenter org-clock-goto-before-context)
+ (org-reveal)
+ (if recent
+ (message "No running clock, this is the most recently clocked task"))
+ (run-hooks 'org-clock-goto-hook)))
+
+(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)))
+ (org-clock-sum (car range) (cadr range)
+ headline-filter :org-clock-minutes-today)))
+
+(defun org-clock-sum-custom (&optional headline-filter range propname)
+ "Sum the times for each subtree for today."
+ (let ((r (or (and (symbolp range) (org-clock-special-range range))
+ (org-clock-special-range
+ (intern (completing-read
+ "Range: "
+ '("today" "yesterday" "thisweek" "lastweek"
+ "thismonth" "lastmonth" "thisyear" "lastyear"
+ "interactive")
+ nil t))))))
+ (org-clock-sum (car r) (cadr r)
+ headline-filter (or propname :org-clock-minutes-custom))))
+
+;;;###autoload
+(defun org-clock-sum (&optional tstart tend headline-filter propname)
+ "Sum the times for each subtree.
+Puts the resulting times in minutes as a text property on each headline.
+TSTART and TEND can mark a time range to be considered.
+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."
+ (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."
+ (save-excursion
+ (save-restriction
+ (if (and (featurep 'org-inlinetask)
+ (or (org-inlinetask-at-task-p)
+ (org-inlinetask-in-task-p)))
+ (narrow-to-region (save-excursion (org-inlinetask-goto-beginning) (point))
+ (save-excursion (org-inlinetask-goto-end) (point)))
+ (org-narrow-to-subtree))
+ (org-clock-sum tstart)
+ org-clock-file-total-minutes)))
+
+;;;###autoload
+(defun org-clock-display (&optional arg)
+ "Show subtree times in the entire buffer.
+
+By default, show the total time for the range defined in
+`org-clock-display-default-range'. With `\\[universal-argument]' \
+prefix, show
+the total time for today instead.
+
+With `\\[universal-argument] \\[universal-argument]' prefix, \
+use a custom range, entered at prompt.
+
+With `\\[universal-argument] \ \\[universal-argument] \
+\\[universal-argument]' prefix, display the total time in the
+echo area.
+
+Use `\\[org-clock-remove-overlays]' to remove the subtree times."
+ (interactive "P")
+ (org-clock-remove-overlays)
+ (let* ((todayp (equal arg '(4)))
+ (customp (member arg '((16) today yesterday
+ thisweek lastweek thismonth
+ lastmonth thisyear lastyear
+ untilnow interactive)))
+ (prop (cond ((not arg) :org-clock-minutes-default)
+ (todayp :org-clock-minutes-today)
+ (customp :org-clock-minutes-custom)
+ (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 (equal arg '(64))
+ (save-excursion
+ (goto-char (point-min))
+ (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))))
+ (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 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)
+ "Remove the occur highlights from the buffer.
+If NOREMOVE is nil, remove this function from the
+`before-change-functions' in the current buffer."
+ (interactive)
+ (unless org-inhibit-highlight-removal
+ (mapc #'delete-overlay org-clock-overlays)
+ (setq org-clock-overlays nil)
+ (unless noremove
+ (remove-hook 'before-change-functions
+ #'org-clock-remove-overlays 'local))))
+
+;;;###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,
+and is only done if the variable `org-clock-out-when-done' is not nil."
+ (when (and (org-clocking-p)
+ org-clock-out-when-done
+ (marker-buffer org-clock-marker)
+ (or (and (eq t org-clock-out-when-done)
+ (member org-state org-done-keywords))
+ (and (listp org-clock-out-when-done)
+ (member org-state org-clock-out-when-done)))
+ (equal (or (buffer-base-buffer (org-clocking-buffer))
+ (org-clocking-buffer))
+ (or (buffer-base-buffer (current-buffer))
+ (current-buffer)))
+ (< (point) org-clock-marker)
+ (> (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))))
+
+;;;###autoload
+(defun org-clock-get-clocktable (&rest props)
+ "Get a formatted clocktable with parameters according to PROPS.
+The table is created in a temporary buffer, fully formatted and
+fontified, and then returned."
+ ;; Set the defaults
+ (setq props (plist-put props :name "clocktable"))
+ (unless (plist-member props :maxlevel)
+ (setq props (plist-put props :maxlevel 2)))
+ (unless (plist-member props :scope)
+ (setq props (plist-put props :scope 'agenda)))
+ (with-temp-buffer
+ (org-mode)
+ (org-create-dblock props)
+ (org-update-dblock)
+ (org-font-lock-ensure)
+ (forward-line 2)
+ (buffer-substring (point) (progn
+ (re-search-forward "^[ \t]*#\\+END" nil t)
+ (point-at-bol)))))
+
+;;;###autoload
+(defun org-clock-report (&optional arg)
+ "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))
+ (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))
+
+;;;###autoload
+(eval-after-load 'org
+ '(progn
+ (org-dynamic-block-define "clocktable" #'org-clock-report)))
+
+(defun org-day-of-week (day month year)
+ "Return the day of the week as an integer."
+ (nth 6
+ (decode-time
+ (date-to-time
+ (format "%d-%02d-%02dT00:00:00" year month day)))))
+
+(defun org-quarter-to-date (quarter year)
+ "Get the date (week day year) of the first day of a given quarter."
+ (let (startday)
+ (cond
+ ((= quarter 1)
+ (setq startday (org-day-of-week 1 1 year))
+ (cond
+ ((= startday 0)
+ (list 52 7 (- year 1)))
+ ((= startday 6)
+ (list 52 6 (- year 1)))
+ ((<= startday 4)
+ (list 1 startday year))
+ ((> startday 4)
+ (list 53 startday (- year 1)))
+ )
+ )
+ ((= quarter 2)
+ (setq startday (org-day-of-week 1 4 year))
+ (cond
+ ((= startday 0)
+ (list 13 startday year))
+ ((< startday 4)
+ (list 14 startday year))
+ ((>= startday 4)
+ (list 13 startday year))
+ )
+ )
+ ((= quarter 3)
+ (setq startday (org-day-of-week 1 7 year))
+ (cond
+ ((= startday 0)
+ (list 26 startday year))
+ ((< startday 4)
+ (list 27 startday year))
+ ((>= startday 4)
+ (list 26 startday year))
+ )
+ )
+ ((= quarter 4)
+ (setq startday (org-day-of-week 1 10 year))
+ (cond
+ ((= startday 0)
+ (list 39 startday year))
+ ((<= startday 4)
+ (list 40 startday year))
+ ((> startday 4)
+ (list 39 startday year)))))))
+
+(defun org-clock-special-range (key &optional time as-strings wstart mstart)
+ "Return two times bordering a special time range.
+
+KEY is a symbol specifying the range and can be one of `today',
+`yesterday', `thisweek', `lastweek', `thismonth', `lastmonth',
+`thisyear', `lastyear' or `untilnow'. If set to `interactive',
+user is prompted for range boundaries. It can be a string or an
+integer.
+
+By default, a week starts Monday 0:00 and ends Sunday 24:00. The
+range is determined relative to TIME, which defaults to current
+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
+display information. If AS-STRINGS is non-nil, the returned
+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
+to specify the starting day of a month (1 is the first day of the
+month). If you can combine both, the month starting day will
+have priority."
+ (let* ((tm (decode-time time))
+ (m (nth 1 tm))
+ (h (nth 2 tm))
+ (d (nth 3 tm))
+ (month (nth 4 tm))
+ (y (nth 5 tm))
+ (dow (nth 6 tm))
+ (skey (format "%s" key))
+ (shift 0)
+ (q (cond ((>= month 10) 4)
+ ((>= month 7) 3)
+ ((>= month 4) 2)
+ (t 1)))
+ h1 d1 month1 y1 shiftedy shiftedm shiftedq) ;; m1
+ (cond
+ ((string-match "\\`[0-9]+\\'" skey)
+ (setq y (string-to-number skey) month 1 d 1 key 'year))
+ ((string-match "\\`\\([0-9]+\\)-\\([0-9]\\{1,2\\}\\)\\'" skey)
+ (setq y (string-to-number (match-string 1 skey))
+ month (string-to-number (match-string 2 skey))
+ d 1
+ key 'month))
+ ((string-match "\\`\\([0-9]+\\)-[wW]\\([0-9]\\{1,2\\}\\)\\'" skey)
+ (require 'cal-iso)
+ (let ((date (calendar-gregorian-from-absolute
+ (calendar-iso-to-absolute
+ (list (string-to-number (match-string 2 skey))
+ 1
+ (string-to-number (match-string 1 skey)))))))
+ (setq d (nth 1 date)
+ month (car date)
+ y (nth 2 date)
+ dow 1
+ key 'week)))
+ ((string-match "\\`\\([0-9]+\\)-[qQ]\\([1-4]\\)\\'" skey)
+ (require 'cal-iso)
+ (setq q (string-to-number (match-string 2 skey)))
+ (let ((date (calendar-gregorian-from-absolute
+ (calendar-iso-to-absolute
+ (org-quarter-to-date
+ q (string-to-number (match-string 1 skey)))))))
+ (setq d (nth 1 date)
+ month (car date)
+ y (nth 2 date)
+ dow 1
+ key 'quarter)))
+ ((string-match
+ "\\`\\([0-9]+\\)-\\([0-9]\\{1,2\\}\\)-\\([0-9]\\{1,2\\}\\)\\'"
+ skey)
+ (setq y (string-to-number (match-string 1 skey))
+ month (string-to-number (match-string 2 skey))
+ d (string-to-number (match-string 3 skey))
+ key 'day))
+ ((string-match "\\([-+][0-9]+\\)\\'" skey)
+ (setq shift (string-to-number (match-string 1 skey))
+ key (intern (substring skey 0 (match-beginning 1))))
+ (when (and (memq key '(quarter thisq)) (> shift 0))
+ (error "Looking forward with quarters isn't implemented"))))
+ (when (= shift 0)
+ (pcase key
+ (`yesterday (setq key 'today shift -1))
+ (`lastweek (setq key 'week shift -1))
+ (`lastmonth (setq key 'month shift -1))
+ (`lastyear (setq key 'year shift -1))
+ (`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 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 org-extend-today-until d (- d diff) d1 (+ 7 d))))
+ ((or `month `thismonth)
+ (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
+ ;; compute the shifted years, months and quarters.
+ (cond
+ ((< (+ (- q 1) shift) 0) ; Shift not in this year.
+ (let* ((interval (* -1 (+ (- q 1) shift)))
+ ;; Set tmp to ((years to shift) (quarters to shift)).
+ (tmp (cl-floor interval 4)))
+ ;; Due to the use of floor, 0 quarters actually means 4.
+ (if (= 0 (nth 1 tmp))
+ (setq shiftedy (- y (nth 0 tmp))
+ shiftedm 1
+ shiftedq 1)
+ (setq shiftedy (- y (+ 1 (nth 0 tmp)))
+ shiftedm (- 13 (* 3 (nth 1 tmp)))
+ shiftedq (- 5 (nth 1 tmp)))))
+ (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 org-extend-today-until d 1
+ month (+ 1 qshift) month1 (+ 4 qshift))))))
+ ((or `year `thisyear)
+ (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 nil)
+ (_ (encode-time 0 m h d month y))))
+ (end (pcase key
+ (`interactive (org-read-date nil t nil "Range end? "))
+ (`untilnow (current-time))
+ (_ (encode-time 0
+ m ;; (or m1 m)
+ (or h1 h)
+ (or d1 d)
+ (or month1 month)
+ (or y1 y)))))
+ (text
+ (pcase key
+ ((or `day `today) (format-time-string "%A, %B %d, %Y" start))
+ ((or `week `thisweek) (format-time-string "week %G-W%V" start))
+ ((or `month `thismonth) (format-time-string "%B %Y" start))
+ ((or `year `thisyear) (format-time-string "the year %Y" start))
+ ((or `quarter `thisq)
+ (concat (org-count-quarter shiftedq)
+ " quarter of " (number-to-string shiftedy)))
+ (`interactive "(Range interactively set)")
+ (`untilnow "now"))))
+ (if (not as-strings) (list start end text)
+ (let ((f (cdr org-time-stamp-formats)))
+ (list (and start (format-time-string f start))
+ (format-time-string f end)
+ text))))))
+
+(defun org-count-quarter (n)
+ (cond
+ ((= n 1) "1st")
+ ((= n 2) "2nd")
+ ((= n 3) "3rd")
+ ((= n 4) "4th")))
+
+;;;###autoload
+(defun org-clocktable-shift (dir n)
+ "Try to shift the :block date of the clocktable at point.
+Point must be in the #+BEGIN: line of a clocktable, or this function
+will throw an error.
+DIR is a direction, a symbol `left', `right', `up', or `down'.
+Both `left' and `down' shift the block toward the past, `up' and `right'
+push it toward the future.
+N is the number of shift steps to take. The size of the step depends on
+the currently selected interval size."
+ (setq n (prefix-numeric-value n))
+ (and (memq dir '(left down)) (setq n (- n)))
+ (save-excursion
+ (goto-char (point-at-bol))
+ (if (not (looking-at "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>.*?:block[ \t]+\\(\\S-+\\)"))
+ (user-error "Line needs a :block definition before this command works")
+ (let* ((b (match-beginning 1)) (e (match-end 1))
+ (s (match-string 1))
+ block shift ins y mw d date wp) ;; m
+ (cond
+ ((equal s "yesterday") (setq s "today-1"))
+ ((equal s "lastweek") (setq s "thisweek-1"))
+ ((equal s "lastmonth") (setq s "thismonth-1"))
+ ((equal s "lastyear") (setq s "thisyear-1"))
+ ((equal s "lastq") (setq s "thisq-1")))
+
+ (cond
+ ((string-match "^\\(today\\|thisweek\\|thismonth\\|thisyear\\|thisq\\)\\([-+][0-9]+\\)?$" s)
+ (setq block (match-string 1 s)
+ shift (if (match-end 2)
+ (string-to-number (match-string 2 s))
+ 0))
+ (setq shift (+ shift n))
+ (setq ins (if (= shift 0) block (format "%s%+d" block shift))))
+ ((string-match "\\([0-9]+\\)\\(-\\([wWqQ]?\\)\\([0-9]\\{1,2\\}\\)\\(-\\([0-9]\\{1,2\\}\\)\\)?\\)?" s)
+ ;; 1 1 2 3 3 4 4 5 6 6 5 2
+ (setq y (string-to-number (match-string 1 s))
+ wp (and (match-end 3) (match-string 3 s))
+ mw (and (match-end 4) (string-to-number (match-string 4 s)))
+ d (and (match-end 6) (string-to-number (match-string 6 s))))
+ (cond
+ (d (setq ins (format-time-string
+ "%Y-%m-%d"
+ (encode-time 0 0 0 (+ d n) nil y)))) ;; m
+ ((and wp (string-match "w\\|W" wp) mw (> (length wp) 0))
+ (require 'cal-iso)
+ (setq date (calendar-gregorian-from-absolute
+ (calendar-iso-to-absolute (list (+ mw n) 1 y))))
+ (setq ins (format-time-string
+ "%G-W%V"
+ (encode-time 0 0 0 (nth 1 date) (car date) (nth 2 date)))))
+ ((and wp (string-match "q\\|Q" wp) mw (> (length wp) 0))
+ (require 'cal-iso)
+ ; if the 4th + 1 quarter is requested we flip to the 1st quarter of the next year
+ (if (> (+ mw n) 4)
+ (setq mw 0
+ y (+ 1 y))
+ ())
+ ; if the 1st - 1 quarter is requested we flip to the 4th quarter of the previous year
+ (if (= (+ mw n) 0)
+ (setq mw 5
+ y (- y 1))
+ ())
+ (setq date (calendar-gregorian-from-absolute
+ (calendar-iso-to-absolute (org-quarter-to-date (+ mw n) y))))
+ (setq ins (format-time-string
+ (concat (number-to-string y) "-Q" (number-to-string (+ mw n)))
+ (encode-time 0 0 0 (nth 1 date) (car date) (nth 2 date)))))
+ (mw
+ (setq ins (format-time-string
+ "%Y-%m"
+ (encode-time 0 0 0 1 (+ mw n) y))))
+ (y
+ (setq ins (number-to-string (+ y n))))))
+ (t (user-error "Cannot shift clocktable block")))
+ (when ins
+ (goto-char b)
+ (insert ins)
+ (delete-region (point) (+ (point) (- e b)))
+ (beginning-of-line 1)
+ (org-update-dblock)
+ t)))))
+
+;;;###autoload
+(defun org-dblock-write:clocktable (params)
+ "Write the standard clocktable."
+ (setq params (org-combine-plists org-clocktable-defaults params))
+ (catch 'exit
+ (let* ((scope (plist-get params :scope))
+ (base-buffer (org-base-buffer (current-buffer)))
+ (files (pcase scope
+ (`agenda
+ (org-agenda-files t))
+ (`agenda-with-archives
+ (org-add-archive-files (org-agenda-files t)))
+ (`file-with-archives
+ (let ((base-file (buffer-file-name base-buffer)))
+ (and base-file
+ (org-add-archive-files (list base-file)))))
+ ((or `nil `file `subtree `tree
+ (and (pred symbolp)
+ (guard (string-match "\\`tree\\([0-9]+\\)\\'"
+ (symbol-name scope)))))
+ base-buffer)
+ ((pred functionp) (funcall scope))
+ ((pred consp) scope)
+ (_ (user-error "Unknown scope: %S" scope))))
+ (block (plist-get params :block))
+ (ts (plist-get params :tstart))
+ (te (plist-get params :tend))
+ (ws (plist-get params :wstart))
+ (ms (plist-get params :mstart))
+ (step (plist-get params :step))
+ (hide-files (plist-get params :hidefiles))
+ (formatter (or (plist-get params :formatter)
+ org-clock-clocktable-formatter
+ 'org-clocktable-write-default))
+ cc)
+ ;; Check if we need to do steps
+ (when block
+ ;; Get the range text for the header
+ (setq cc (org-clock-special-range block nil t ws ms)
+ ts (car cc)
+ te (nth 1 cc)))
+ (when step
+ ;; Write many tables, in steps
+ (unless (or block (and ts te))
+ (user-error "Clocktable `:step' can only be used with `:block' or `:tstart, :end'"))
+ (org-clocktable-steps params)
+ (throw 'exit nil))
+
+ (org-agenda-prepare-buffers (if (consp files) files (list files)))
+
+ (let ((origin (point))
+ (tables
+ (if (consp files)
+ (mapcar (lambda (file)
+ (with-current-buffer (find-buffer-visiting file)
+ (save-excursion
+ (save-restriction
+ (org-clock-get-table-data file params)))))
+ files)
+ ;; Get the right restriction for the scope.
+ (save-restriction
+ (cond
+ ((not scope)) ;use the restriction as it is now
+ ((eq scope 'file) (widen))
+ ((eq scope 'subtree) (org-narrow-to-subtree))
+ ((eq scope 'tree)
+ (while (org-up-heading-safe))
+ (org-narrow-to-subtree))
+ ((and (symbolp scope)
+ (string-match "\\`tree\\([0-9]+\\)\\'"
+ (symbol-name scope)))
+ (let ((level (string-to-number
+ (match-string 1 (symbol-name scope)))))
+ (catch 'exit
+ (while (org-up-heading-safe)
+ (looking-at org-outline-regexp)
+ (when (<= (org-reduced-level (funcall outline-level))
+ level)
+ (throw 'exit nil))))
+ (org-narrow-to-subtree))))
+ (list (org-clock-get-table-data nil params)))))
+ (multifile
+ ;; Even though `file-with-archives' can consist of
+ ;; multiple files, we consider this is one extended file
+ ;; instead.
+ (and (not hide-files)
+ (consp files)
+ (not (eq scope 'file-with-archives)))))
+
+ (funcall formatter
+ origin
+ tables
+ (org-combine-plists params `(:multifile ,multifile)))))))
+
+(defun org-clocktable-write-default (ipos tables params)
+ "Write out a clock table at position IPOS in the current buffer.
+TABLES is a list of tables with clocking data as produced by
+`org-clock-get-table-data'. PARAMS is the parameter property list obtained
+from the dynamic block definition."
+ ;; This function looks quite complicated, mainly because there are a
+ ;; lot of options which can add or remove columns. I have massively
+ ;; commented this function, the I hope it is understandable. If
+ ;; someone wants to write their own special formatter, this maybe
+ ;; much easier because there can be a fixed format with a
+ ;; well-defined number of columns...
+ (let* ((lang (or (plist-get params :lang) "en"))
+ (multifile (plist-get params :multifile))
+ (block (plist-get params :block))
+ (sort (plist-get params :sort))
+ (header (plist-get params :header))
+ (link (plist-get params :link))
+ (maxlevel (or (plist-get params :maxlevel) 3))
+ (emph (plist-get params :emphasize))
+ (compact? (plist-get params :compact))
+ (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
+ ;; Deepest headline level is a hard limit for the number
+ ;; of time columns.
+ (let ((levels
+ (cl-mapcan
+ (lambda (table)
+ (pcase table
+ (`(,_ ,(and (pred wholenump) (pred (/= 0))) ,entries)
+ (mapcar #'car entries))))
+ tables)))
+ (min maxlevel
+ (or (plist-get params :tcolumns) 100)
+ (if (null levels) 1 (apply #'max levels))))))
+ (indent (or compact? (plist-get params :indent)))
+ (formula (plist-get params :formula))
+ (case-fold-search t)
+ (total-time (apply #'+ (mapcar #'cadr tables)))
+ recalc narrow-cut-p)
+
+ (when (and narrow (integerp narrow) link)
+ ;; We cannot have both integer narrow and link.
+ (message "Using hard narrowing in clocktable to allow for links")
+ (setq narrow (intern (format "%d!" narrow))))
+
+ (pcase narrow
+ ((or `nil (pred integerp)) nil) ;nothing to do
+ ((and (pred symbolp)
+ (guard (string-match-p "\\`[0-9]+!\\'" (symbol-name narrow))))
+ (setq narrow-cut-p t)
+ (setq narrow (string-to-number (symbol-name narrow))))
+ (_ (user-error "Invalid value %s of :narrow property in clock table" narrow)))
+
+ ;; Now we need to output this table stuff.
+ (goto-char ipos)
+
+ ;; Insert the text *before* the actual table.
+ (insert-before-markers
+ (or header
+ ;; Format the standard header.
+ (format "#+CAPTION: %s %s%s\n"
+ (org-clock--translate "Clock summary at" lang)
+ (format-time-string (org-time-stamp-format t t))
+ (if block
+ (let ((range-text
+ (nth 2 (org-clock-special-range
+ block nil t
+ (plist-get params :wstart)
+ (plist-get params :mstart)))))
+ (format ", for %s." range-text))
+ ""))))
+
+ ;; Insert the narrowing line
+ (when (and narrow (integerp narrow) (not narrow-cut-p))
+ (insert-before-markers
+ "|" ;table line starter
+ (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) ?|)
+ "")
+ (format "<%d>| |\n" narrow))) ;headline and time columns
+
+ ;; Insert the table header line
+ (insert-before-markers
+ "|" ;table line starter
+ (if multifile ;file column, maybe
+ (concat (org-clock--translate "File" lang) "|")
+ "")
+ (if level? ;level column, maybe
+ (concat (org-clock--translate "L" lang) "|")
+ "")
+ (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 "|") "|")
+ "")
+ (concat (org-clock--translate "Headline" lang)"|")
+ (concat (org-clock--translate "Time" lang) "|")
+ (make-string (max 0 (1- time-columns)) ?|) ;other time columns
+ (if (eq formula '%) "%|\n" "\n"))
+
+ ;; Insert the total time in the table
+ (insert-before-markers
+ "|-\n" ;a hline
+ "|" ;table line starter
+ (if multifile (format "| %s " (org-clock--translate "ALL" lang)) "")
+ ;file 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))
+ "| ")
+ (format org-clock-total-time-cell-format
+ (org-duration-from-minutes (or total-time 0))) ;time
+ "|"
+ (make-string (max 0 (1- time-columns)) ?|)
+ (cond ((not (eq formula '%)) "")
+ ((or (not total-time) (= total-time 0)) "0.0|")
+ (t "100.0|"))
+ "\n")
+
+ ;; Now iterate over the tables and insert the data but only if any
+ ;; time has been collected.
+ (when (and total-time (> total-time 0))
+ (pcase-dolist (`(,file-name ,file-time ,entries) tables)
+ (when (or (and file-time (> file-time 0))
+ (not (plist-get params :fileskip0)))
+ (insert-before-markers "|-\n") ;hline at new file
+ ;; First the file time, if we have multiple files.
+ (when multifile
+ ;; Summarize the time collected from this file.
+ (insert-before-markers
+ (format (concat "| %s %s | %s%s%s"
+ (format org-clock-file-time-cell-format
+ (org-clock--translate "File time" lang))
+
+ ;; The file-time rollup value goes in the first time
+ ;; column (of which there is always at least one)...
+ " | *%s*|"
+ ;; ...and the remaining file time cols (if any) are blank.
+ (make-string (max 0 (1- time-columns)) ?|)
+
+ ;; Optionally show the percentage contribution of "this"
+ ;; file time to the total time.
+ (if (eq formula '%) " %s |" "")
+ "\n")
+
+ (file-name-nondirectory file-name)
+ (if level? "| " "") ;level column, maybe
+ (if timestamp "| " "") ;timestamp column, maybe
+ (if tags "| " "") ;tags column, maybe
+ (if properties ;properties columns, maybe
+ (make-string (length properties) ?|)
+ "")
+ (org-duration-from-minutes file-time) ;time
+
+ (cond ((not (eq formula '%)) "") ;time percentage, maybe
+ ((or (not total-time) (= total-time 0)) "0.0")
+ (t
+ (format "%.1f" (* 100 (/ file-time (float total-time)))))))))
+
+ ;; Get the list of node entries and iterate over it
+ (when (> maxlevel 0)
+ (pcase-dolist (`(,level ,headline ,tgs ,ts ,time ,props) entries)
+ (when narrow-cut-p
+ (setq headline
+ (if (and (string-match
+ (format "\\`%s\\'" org-link-bracket-re)
+ headline)
+ (match-end 2))
+ (format "[[%s][%s]]"
+ (match-string 1 headline)
+ (org-shorten-string (match-string 2 headline)
+ narrow))
+ (org-shorten-string headline narrow))))
+ (cl-flet ((format-field (f) (format (cond ((not emph) "%s |")
+ ((= level 1) "*%s* |")
+ ((= level 2) "/%s/ |")
+ (t "%s |"))
+ f)))
+ (insert-before-markers
+ "|" ;start the table line
+ (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
+ "|")
+ "|")
+ "")
+ (if indent ;indentation
+ (org-clocktable-indent-string level)
+ "")
+ (format-field headline)
+ ;; Empty fields for higher levels.
+ (make-string (max 0 (1- (min time-columns level))) ?|)
+ (format-field (org-duration-from-minutes time))
+ (make-string (max 0 (- time-columns level)) ?|)
+ (if (eq formula '%)
+ (format "%.1f |" (* 100 (/ time (float total-time))))
+ "")
+ "\n")))))))
+ (delete-char -1)
+ (cond
+ ;; Possibly rescue old formula?
+ ((or (not formula) (eq formula '%))
+ (let ((contents (org-string-nw-p (plist-get params :content))))
+ (when (and contents (string-match "^\\([ \t]*#\\+tblfm:.*\\)" contents))
+ (setq recalc t)
+ (insert "\n" (match-string 1 contents))
+ (beginning-of-line 0))))
+ ;; Insert specified formula line.
+ ((stringp formula)
+ (insert "\n#+TBLFM: " formula)
+ (setq recalc t))
+ (t
+ (user-error "Invalid :formula parameter in clocktable")))
+ ;; Back to beginning, align the table, recalculate if necessary.
+ (goto-char ipos)
+ (skip-chars-forward "^|")
+ (org-table-align)
+ (when org-hide-emphasis-markers
+ ;; We need to align a second time.
+ (org-table-align))
+ (when sort
+ (save-excursion
+ (org-table-goto-line 3)
+ (org-table-goto-column (car sort))
+ (org-table-sort-lines nil (cdr sort))))
+ (when recalc (org-table-recalculate 'all))
+ total-time))
+
+(defun org-clocktable-indent-string (level)
+ "Return indentation string according to LEVEL.
+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-steps (params)
+ "Create one or more clock tables, according to PARAMS.
+Step through the range specifications in plist PARAMS to make
+a number of clock tables."
+ (let* ((ignore-empty-tables (plist-get params :stepskip0))
+ (step (plist-get params :step))
+ (step-header
+ (pcase step
+ (`day "Daily report: ")
+ (`week "Weekly report starting on: ")
+ (`semimonth "Semimonthly report starting on: ")
+ (`month "Monthly report starting on: ")
+ (`year "Annual report starting on: ")
+ (_ (user-error "Unknown `:step' specification: %S" step))))
+ (week-start (or (plist-get params :wstart) 1))
+ (month-start (or (plist-get params :mstart) 1))
+ (range
+ (pcase (plist-get params :block)
+ (`nil nil)
+ (range
+ (org-clock-special-range range nil t week-start month-start))))
+ ;; For both START and END, any number is an absolute day
+ ;; number from Agenda. Otherwise, consider value to be an Org
+ ;; timestamp string. The `:block' property has precedence
+ ;; over `:tstart' and `:tend'.
+ (start
+ (pcase (if range (car range) (plist-get params :tstart))
+ ((and (pred numberp) n)
+ (pcase-let ((`(,m ,d ,y) (calendar-gregorian-from-absolute n)))
+ (apply #'encode-time (list 0 0 org-extend-today-until d m y))))
+ (timestamp
+ (seconds-to-time
+ (org-matcher-time (or timestamp
+ ;; The year Org was born.
+ "<2003-01-01 Thu 00:00>"))))))
+ (end
+ (pcase (if range (nth 1 range) (plist-get params :tend))
+ ((and (pred numberp) n)
+ (pcase-let ((`(,m ,d ,y) (calendar-gregorian-from-absolute n)))
+ (apply #'encode-time (list 0 0 org-extend-today-until d m y))))
+ (timestamp (seconds-to-time (org-matcher-time timestamp))))))
+ (while (time-less-p start end)
+ (unless (bolp) (insert "\n"))
+ ;; Insert header before each clock table.
+ (insert "\n"
+ step-header
+ (format-time-string (org-time-stamp-format nil t) start)
+ "\n")
+ ;; Compute NEXT, which is the end of the current clock table,
+ ;; according to step.
+ (let* ((next
+ (apply #'encode-time
+ (pcase-let
+ ((`(,_ ,_ ,_ ,d ,m ,y ,dow . ,_) (decode-time start)))
+ (pcase step
+ (`day (list 0 0 org-extend-today-until (1+ d) m y))
+ (`week
+ (let ((offset (if (= dow week-start) 7
+ (mod (- week-start dow) 7))))
+ (list 0 0 org-extend-today-until (+ d offset) m y)))
+ (`semimonth (list 0 0 0
+ (if (< d 16) 16 1)
+ (if (< d 16) m (1+ m)) y))
+ (`month (list 0 0 0 month-start (1+ m) y))
+ (`year (list 0 0 org-extend-today-until 1 1 (1+ y)))))))
+ (table-begin (line-beginning-position 0))
+ (step-time
+ ;; Write clock table between START and NEXT.
+ (org-dblock-write:clocktable
+ (org-combine-plists
+ params (list :header ""
+ :step nil
+ :block nil
+ :tstart (format-time-string
+ (org-time-stamp-format t t)
+ start)
+ :tend (format-time-string
+ (org-time-stamp-format t t)
+ ;; Never include clocks past END.
+ (if (time-less-p end next) end next)))))))
+ (let ((case-fold-search t)) (re-search-forward "^[ \t]*#\\+END:"))
+ ;; Remove the table if it is empty and `:stepskip0' is
+ ;; non-nil.
+ (when (and ignore-empty-tables (equal step-time 0))
+ (delete-region (line-beginning-position) table-begin))
+ (setq start next))
+ (end-of-line 0))))
+
+(defun org-clock-get-table-data (file params)
+ "Get the clocktable data for file FILE, with parameters PARAMS.
+FILE is only for identification - this function assumes that
+the correct buffer is current, and that the wanted restriction is
+in place.
+The return value will be a list with the file name and the total
+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 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.
+TIME: The sum of all time spend in this tree, in minutes. This time
+ will of cause be restricted to the time block and tags match
+ specified in PARAMS.
+PROPERTIES: The list properties specified in the `:properties' parameter
+ along with their value, as an alist following the pattern
+ (NAME . VALUE)."
+ (let* ((maxlevel (or (plist-get params :maxlevel) 3))
+ (timestamp (plist-get params :timestamp))
+ (ts (plist-get params :tstart))
+ (te (plist-get params :tend))
+ (ws (plist-get params :wstart))
+ (ms (plist-get params :mstart))
+ (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 match (cdr (org-make-tags-matcher match))))
+ cc st p tbl)
+
+ (setq org-clock-file-total-minutes nil)
+ (when block
+ (setq cc (org-clock-special-range block nil t ws ms)
+ ts (car cc)
+ te (nth 1 cc)))
+ (when (integerp ts) (setq ts (calendar-gregorian-from-absolute ts)))
+ (when (integerp te) (setq te (calendar-gregorian-from-absolute te)))
+ (when (and ts (listp ts))
+ (setq ts (format "%4d-%02d-%02d" (nth 2 ts) (car ts) (nth 1 ts))))
+ (when (and te (listp te))
+ (setq te (format "%4d-%02d-%02d" (nth 2 te) (car te) (nth 1 te))))
+ ;; Now the times are strings we can parse.
+ (if ts (setq ts (org-matcher-time ts)))
+ (if te (setq te (org-matcher-time te)))
+ (save-excursion
+ (org-clock-sum ts te
+ (when matcher
+ (lambda ()
+ (let* ((todo (org-get-todo-state))
+ (tags-list (org-get-tags))
+ (org-scanner-tags tags-list)
+ (org-trust-scanner-tags t))
+ (funcall matcher todo tags-list nil)))))
+ (goto-char (point-min))
+ (setq st t)
+ (while (or (and (bobp) (prog1 st (setq st nil))
+ (get-text-property (point) :org-clock-minutes)
+ (setq p (point-min)))
+ (setq p (next-single-property-change
+ (point) :org-clock-minutes)))
+ (goto-char p)
+ (let ((time (get-text-property p :org-clock-minutes)))
+ (when (and time (> time 0) (org-at-heading-p))
+ (let ((level (org-reduced-level (org-current-level))))
+ (when (<= level maxlevel)
+ (let* ((headline (org-get-heading t t t t))
+ (hdl
+ (if (not link) headline
+ (let ((search
+ (org-link-heading-search-string headline)))
+ (org-link-make-string
+ (if (not (buffer-file-name)) search
+ (format "file:%s::%s" (buffer-file-name) search))
+ ;; Prune statistics cookies. Replace
+ ;; links with their description, or
+ ;; a plain link if there is none.
+ (org-trim
+ (org-link-display-format
+ (replace-regexp-in-string
+ "\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]" ""
+ headline)))))))
+ (tgs (and tags (org-get-tags)))
+ (tsp
+ (and timestamp
+ (cl-some (lambda (p) (org-entry-get (point) p))
+ '("SCHEDULED" "DEADLINE" "TIMESTAMP"
+ "TIMESTAMP_IA"))))
+ (props
+ (and properties
+ (delq nil
+ (mapcar
+ (lambda (p)
+ (let ((v (org-entry-get
+ (point) p inherit-property-p)))
+ (and v (cons p v))))
+ properties)))))
+ (push (list level hdl tgs tsp time props) tbl)))))))
+ (list file org-clock-file-total-minutes (nreverse tbl)))))
+
+;; Saving and loading the clock
+
+(defvar org-clock-loaded nil
+ "Was the clock file loaded?")
+
+;;;###autoload
+(defun org-clock-update-time-maybe ()
+ "If this is a CLOCK line, update it and return t.
+Otherwise, return nil."
+ (interactive)
+ (save-excursion
+ (beginning-of-line 1)
+ (skip-chars-forward " \t")
+ (when (looking-at org-clock-string)
+ (let ((re (concat "[ \t]*" org-clock-string
+ " *[[<]\\([^]>]+\\)[]>]\\(-+[[<]\\([^]>]+\\)[]>]"
+ "\\([ \t]*=>.*\\)?\\)?"))
+ ts te h m s neg)
+ (cond
+ ((not (looking-at re))
+ nil)
+ ((not (match-end 2))
+ (when (and (equal (marker-buffer org-clock-marker) (current-buffer))
+ (> org-clock-marker (point))
+ (<= org-clock-marker (point-at-eol)))
+ ;; The clock is running here
+ (setq org-clock-start-time
+ (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)))
+ (end-of-line 1)
+ (setq ts (match-string 1)
+ te (match-string 3))
+ (setq s (- (float-time
+ (apply #'encode-time (org-parse-time-string te)))
+ (float-time
+ (apply #'encode-time (org-parse-time-string ts))))
+ neg (< s 0)
+ s (abs s)
+ h (floor (/ s 3600))
+ s (- s (* 3600 h))
+ m (floor (/ s 60))
+ s (- s (* 60 s)))
+ (insert " => " (format (if neg "-%d:%02d" "%2d:%02d") h m))
+ t))))))
+
+(defun org-clock-save ()
+ "Persist various clock-related data to disk.
+The details of what will be saved are regulated by the variable
+`org-clock-persist'."
+ (when (and org-clock-persist
+ (or org-clock-loaded
+ org-clock-has-been-used
+ (not (file-exists-p org-clock-persist-file))))
+ (with-temp-file org-clock-persist-file
+ (insert (format ";; %s - %s at %s\n"
+ (file-name-nondirectory org-clock-persist-file)
+ (system-name)
+ (format-time-string (org-time-stamp-format t))))
+ ;; Store clock to be resumed.
+ (when (and (memq org-clock-persist '(t clock))
+ (let ((b (org-base-buffer (org-clocking-buffer))))
+ (and (buffer-live-p b)
+ (buffer-file-name b)
+ (or (not org-clock-persist-query-save)
+ (y-or-n-p (format "Save current clock (%s) "
+ org-clock-heading))))))
+ (insert
+ (format "(setq org-clock-stored-resume-clock '(%S . %d))\n"
+ (buffer-file-name (org-base-buffer (org-clocking-buffer)))
+ (marker-position org-clock-marker))))
+ ;; Store clocked task history. Tasks are stored reversed to
+ ;; make reading simpler.
+ (when (and (memq org-clock-persist '(t history))
+ org-clock-history)
+ (insert
+ (format "(setq org-clock-stored-history '(%s))\n"
+ (mapconcat
+ (lambda (m)
+ (let ((b (org-base-buffer (marker-buffer m))))
+ (when (and (buffer-live-p b)
+ (buffer-file-name b))
+ (format "(%S . %d)"
+ (buffer-file-name b)
+ (marker-position m)))))
+ (reverse org-clock-history)
+ " ")))))))
+
+(defun org-clock-load ()
+ "Load clock-related data from disk, maybe resuming a stored clock."
+ (when (and org-clock-persist (not org-clock-loaded))
+ (if (not (file-readable-p org-clock-persist-file))
+ (message "Not restoring clock data; %S not found" org-clock-persist-file)
+ (message "Restoring clock data")
+ ;; Load history.
+ (load-file org-clock-persist-file)
+ (setq org-clock-loaded t)
+ (pcase-dolist (`(,(and file (pred file-exists-p)) . ,position)
+ org-clock-stored-history)
+ (org-clock-history-push position (find-file-noselect file)))
+ ;; Resume clock.
+ (pcase org-clock-stored-resume-clock
+ (`(,(and file (pred file-exists-p)) . ,position)
+ (with-current-buffer (find-file-noselect file)
+ (when (or (not org-clock-persist-query-resume)
+ (y-or-n-p (format "Resume clock (%s) "
+ (save-excursion
+ (goto-char position)
+ (org-get-heading t t)))))
+ (goto-char position)
+ (let ((org-clock-in-resume 'auto-restart)
+ (org-clock-auto-clock-resolution nil))
+ (org-clock-in)
+ (when (org-invisible-p) (org-show-context))))))
+ (_ nil)))))
+
+(defun org-clock-kill-emacs-query ()
+ "Query user when killing Emacs.
+This function is added to `kill-emacs-query-functions'."
+ (let ((buf (org-clocking-buffer)))
+ (when (and buf (yes-or-no-p "Clock out and save? "))
+ (with-current-buffer buf
+ (org-clock-out)
+ (save-buffer))))
+ ;; Unconditionally return t for `kill-emacs-query-functions'.
+ t)
+
+;; Suggested bindings
+(org-defkey org-mode-map "\C-c\C-x\C-e" 'org-clock-modify-effort-estimate)
+
+(provide 'org-clock)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; coding: utf-8
+;; End:
+
+;;; org-clock.el ends here
diff --git a/elpa/org-9.5.2/org-clock.elc b/elpa/org-9.5.2/org-clock.elc
new file mode 100644
index 0000000..413b4f5
--- /dev/null
+++ b/elpa/org-9.5.2/org-clock.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-colview.el b/elpa/org-9.5.2/org-colview.el
new file mode 100644
index 0000000..9794382
--- /dev/null
+++ b/elpa/org-9.5.2/org-colview.el
@@ -0,0 +1,1738 @@
+;;; org-colview.el --- Column View in Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file contains the column view for Org.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'org)
+
+(declare-function org-agenda-redo "org-agenda" (&optional all))
+(declare-function org-agenda-do-context-action "org-agenda" ())
+(declare-function org-clock-sum-today "org-clock" (&optional headline-filter))
+(declare-function org-element-extract-element "org-element" (element))
+(declare-function org-element-interpret-data "org-element" (data))
+(declare-function org-element-map "org-element" (data types fun &optional info first-match no-recursion with-affiliated))
+(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-dynamic-block-define "org" (type func))
+(declare-function org-link-display-format "ol" (s))
+(declare-function org-link-open-from-string "ol" (s &optional arg))
+(declare-function face-remap-remove-relative "face-remap" (cookie))
+(declare-function face-remap-add-relative "face-remap" (face &rest specs))
+
+(defvar org-agenda-columns-add-appointments-to-effort-sum)
+(defvar org-agenda-columns-compute-summary-properties)
+(defvar org-agenda-columns-show-summaries)
+(defvar org-agenda-view-columns-initially)
+(defvar org-inlinetask-min-level)
+
+
+;;; Configuration
+
+(defcustom org-columns-modify-value-for-display-function nil
+ "Function that modifies values for display in column view.
+For example, it can be used to cut out a certain part from a time stamp.
+The function must take 2 arguments:
+
+column-title The title of the column (*not* the property name)
+value The value that should be modified.
+
+The function should return the value that should be displayed,
+or nil if the normal value should be used."
+ :group 'org-properties
+ :type '(choice (const nil) (function)))
+
+(defcustom org-columns-summary-types nil
+ "Alist between operators and summarize functions.
+
+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
+ case-sensitive.
+
+ SUMMARIZE is a function called with two arguments. The first
+ argument is a non-empty list of values, as non-empty strings.
+ 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.
+
+Types defined in this variable take precedence over those defined
+in `org-columns-summary-types-default', which see."
+ :group 'org-properties
+ :version "26.1"
+ :package-version '(Org . "9.0")
+ :type '(alist :key-type (string :tag " Label")
+ :value-type
+ (choice (function :tag "Summarize")
+ (list :tag "Collect and summarize"
+ (function :tag "Summarize")
+ (function :tag "Collect")))))
+
+
+
+;;; Column View
+
+(defvar-local org-columns-overlays nil
+ "Holds the list of current column overlays.")
+
+(defvar-local org-columns-current-fmt nil
+ "Local variable, holds the currently active column format.")
+
+(defvar-local org-columns-current-fmt-compiled nil
+ "Local variable, holds the currently active column format.
+This is the compiled version of the format.")
+
+(defvar-local org-columns-current-maxwidths nil
+ "Currently active maximum column widths, as a vector.")
+
+(defvar-local org-columns-begin-marker nil
+ "Points to the position where last a column creation command was called.")
+
+(defvar-local org-columns-top-level-marker nil
+ "Points to the position where current columns region starts.")
+
+(defvar org-columns--time 0.0
+ "Number of seconds since the epoch, as a floating point number.")
+
+(defvar org-columns-map (make-sparse-keymap)
+ "The keymap valid in column display.")
+
+(defconst org-columns-summary-types-default
+ '(("+" . org-columns--summary-sum)
+ ("$" . org-columns--summary-currencies)
+ ("X" . org-columns--summary-checkbox)
+ ("X/" . org-columns--summary-checkbox-count)
+ ("X%" . org-columns--summary-checkbox-percent)
+ ("max" . org-columns--summary-max)
+ ("mean" . org-columns--summary-mean)
+ ("min" . org-columns--summary-min)
+ (":" . org-columns--summary-sum-times)
+ (":max" . org-columns--summary-max-time)
+ (":mean" . org-columns--summary-mean-time)
+ (":min" . org-columns--summary-min-time)
+ ("@max" . org-columns--summary-max-age)
+ ("@mean" . org-columns--summary-mean-age)
+ ("@min" . org-columns--summary-min-age)
+ ("est+" . org-columns--summary-estimate))
+ "Map operators to summarize functions.
+See `org-columns-summary-types' for details.")
+
+(defun org-columns-content ()
+ "Switch to contents view while in columns view."
+ (interactive)
+ (org-overview)
+ (org-content))
+
+(org-defkey org-columns-map "c" #'org-columns-content)
+(org-defkey org-columns-map "o" #'org-overview)
+(org-defkey org-columns-map "e" #'org-columns-edit-value)
+(org-defkey org-columns-map "\C-c\C-t" #'org-columns-todo)
+(org-defkey org-columns-map "\C-c\C-c" #'org-columns-toggle-or-columns-quit)
+(org-defkey org-columns-map "\C-c\C-o" #'org-columns-open-link)
+(org-defkey org-columns-map "v" #'org-columns-show-value)
+(org-defkey org-columns-map "q" #'org-columns-quit)
+(org-defkey org-columns-map "r" #'org-columns-redo)
+(org-defkey org-columns-map "g" #'org-columns-redo)
+(org-defkey org-columns-map [left] #'backward-char)
+(org-defkey org-columns-map "\M-b" #'backward-char)
+(org-defkey org-columns-map "a" #'org-columns-edit-allowed)
+(org-defkey org-columns-map "s" #'org-columns-edit-attributes)
+(org-defkey org-columns-map "\M-f"
+ (lambda () (interactive) (goto-char (1+ (point)))))
+(org-defkey org-columns-map [right]
+ (lambda () (interactive) (goto-char (1+ (point)))))
+(org-defkey org-columns-map [down]
+ (lambda () (interactive)
+ (let ((col (current-column)))
+ (beginning-of-line 2)
+ (while (and (org-invisible-p2) (not (eobp)))
+ (beginning-of-line 2))
+ (move-to-column col)
+ (if (derived-mode-p 'org-agenda-mode)
+ (org-agenda-do-context-action)))))
+(org-defkey org-columns-map [up]
+ (lambda () (interactive)
+ (let ((col (current-column)))
+ (beginning-of-line 0)
+ (while (and (org-invisible-p2) (not (bobp)))
+ (beginning-of-line 0))
+ (move-to-column col)
+ (if (eq major-mode 'org-agenda-mode)
+ (org-agenda-do-context-action)))))
+(org-defkey org-columns-map [(shift right)] #'org-columns-next-allowed-value)
+(org-defkey org-columns-map "n" #'org-columns-next-allowed-value)
+(org-defkey org-columns-map [(shift left)] #'org-columns-previous-allowed-value)
+(org-defkey org-columns-map "p" #'org-columns-previous-allowed-value)
+(org-defkey org-columns-map "<" #'org-columns-narrow)
+(org-defkey org-columns-map ">" #'org-columns-widen)
+(org-defkey org-columns-map [(meta right)] #'org-columns-move-right)
+(org-defkey org-columns-map [(meta left)] #'org-columns-move-left)
+(org-defkey org-columns-map [(shift meta right)] #'org-columns-new)
+(org-defkey org-columns-map [(shift meta left)] #'org-columns-delete)
+(dotimes (i 10)
+ (org-defkey org-columns-map (number-to-string i)
+ (lambda () (interactive)
+ (org-columns-next-allowed-value nil i))))
+
+(easy-menu-define org-columns-menu org-columns-map "Org Column Menu."
+ '("Column"
+ ["Edit property" org-columns-edit-value t]
+ ["Next allowed value" org-columns-next-allowed-value t]
+ ["Previous allowed value" org-columns-previous-allowed-value t]
+ ["Show full value" org-columns-show-value t]
+ ["Edit allowed values" org-columns-edit-allowed t]
+ "--"
+ ["Edit column attributes" org-columns-edit-attributes t]
+ ["Increase column width" org-columns-widen t]
+ ["Decrease column width" org-columns-narrow t]
+ "--"
+ ["Move column right" org-columns-move-right t]
+ ["Move column left" org-columns-move-left t]
+ ["Add column" org-columns-new t]
+ ["Delete column" org-columns-delete t]
+ "--"
+ ["CONTENTS" org-columns-content t]
+ ["OVERVIEW" org-overview t]
+ ["Refresh columns display" org-columns-redo t]
+ "--"
+ ["Open link" org-columns-open-link t]
+ "--"
+ ["Quit" org-columns-quit t]))
+
+(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.
+
+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" . ,_)
+ (let ((stars
+ (and (not no-star)
+ (concat (make-string (1- (org-current-level))
+ (if org-hide-leading-stars ?\s ?*))
+ "* "))))
+ (concat stars (org-link-display-format value))))
+ (`(,(or "DEADLINE" "SCHEDULED" "TIMESTAMP") . ,_)
+ (replace-regexp-in-string org-ts-regexp "[\\1]" value))
+ (`(,_ ,_ ,_ ,_ nil) value)
+ ;; If PRINTF is set, assume we are displaying a number and
+ ;; obey to the format string.
+ (`(,_ ,_ ,_ ,_ ,printf) (format printf (string-to-number value)))
+ (_ (error "Invalid column specification format: %S" spec)))))
+
+(defun org-columns--collect-values (&optional compiled-fmt)
+ "Collect values for columns on the current line.
+
+Return a list of triplets (SPEC VALUE DISPLAYED) suitable for
+`org-columns--display-here'.
+
+This function assumes `org-columns-current-fmt-compiled' is
+initialized is set in the current buffer. However, it is
+possible to override it with optional argument COMPILED-FMT."
+ (let ((summaries (get-text-property (point) 'org-summaries)))
+ (mapcar
+ (lambda (spec)
+ (pcase spec
+ (`(,p . ,_)
+ (let* ((v (or (cdr (assoc spec summaries))
+ (org-entry-get (point) p 'selective t)
+ (and compiled-fmt ;assume `org-agenda-columns'
+ ;; Effort property is not defined. Try
+ ;; to use appointment duration.
+ org-agenda-columns-add-appointments-to-effort-sum
+ (string= p (upcase org-effort-property))
+ (get-text-property (point) 'duration)
+ (propertize (org-duration-from-minutes
+ (get-text-property (point) 'duration))
+ 'face 'org-warning))
+ "")))
+ ;; 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)
+ "Compute the maximum column widths from the format and CACHE.
+This function sets `org-columns-current-maxwidths' as a vector of
+integers greater than 0."
+ (setq org-columns-current-maxwidths
+ (apply #'vector
+ (mapcar
+ (lambda (spec)
+ (pcase spec
+ (`(,_ ,_ ,(and width (pred wholenump)) . ,_) width)
+ (`(,_ ,name . ,_)
+ ;; No width is specified in the columns format.
+ ;; Compute it by checking all possible values for
+ ;; PROPERTY.
+ (let ((width (length name)))
+ (dolist (entry cache width)
+ (let ((value (nth 2 (assoc spec (cdr entry)))))
+ (setq width (max (length value) width))))))))
+ org-columns-current-fmt-compiled))))
+
+(defun org-columns--new-overlay (beg end &optional string face)
+ "Create a new column overlay and add it to the list."
+ (let ((ov (make-overlay beg end)))
+ (overlay-put ov 'face (or face 'secondary-selection))
+ (org-overlay-display ov string face)
+ (push ov org-columns-overlays)
+ ov))
+
+(defun org-columns--summarize (operator)
+ "Return summary function associated to string 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 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
+ ("PRIORITY"
+ (propertize v 'face (org-get-priority-face original)))
+ ("TAGS"
+ (if (not org-tags-special-faces-re)
+ (propertize v 'face 'org-tag)
+ (replace-regexp-in-string
+ org-tags-special-faces-re
+ (lambda (m) (propertize m 'face (org-get-tag-face m)))
+ v nil nil 1)))
+ ("TODO" (propertize v 'face (org-get-todo-face original)))
+ (_ v)))))
+
+(defvar org-columns-header-line-remap nil
+ "Store the relative remapping of column header-line.
+This is needed to later remove this relative remapping.")
+
+(defun org-columns--display-here (columns &optional dateline)
+ "Overlay the current line with column display.
+COLUMNS is an alist (SPEC VALUE DISPLAYED). Optional argument
+DATELINE is non-nil when the face used should be
+`org-agenda-column-dateline'."
+ (when (ignore-errors (require 'face-remap))
+ (setq org-columns-header-line-remap
+ (face-remap-add-relative 'header-line '(:inherit default))))
+ (save-excursion
+ (beginning-of-line)
+ (let* ((level-face (and (looking-at "\\(\\**\\)\\(\\* \\)")
+ (org-get-level-face 2)))
+ (ref-face (or level-face
+ (and (eq major-mode 'org-agenda-mode)
+ (org-get-at-bol 'face))
+ 'default))
+ (color (list :foreground (face-attribute ref-face :foreground)))
+ (font (list :family (face-attribute 'default :family)))
+ (face (list color font 'org-column ref-face))
+ (face1 (list color font 'org-agenda-column-dateline ref-face)))
+ ;; Each column is an overlay on top of a character. So there has
+ ;; to be at least as many characters available on the line as
+ ;; columns to display.
+ (let ((columns (length org-columns-current-fmt-compiled))
+ (chars (- (line-end-position) (line-beginning-position))))
+ (when (> columns chars)
+ (save-excursion
+ (end-of-line)
+ (let ((inhibit-read-only t))
+ (insert (make-string (- columns chars) ?\s))))))
+ ;; Display columns. Create and install the overlay for the
+ ;; current column on the next character.
+ (let ((i 0)
+ (last (1- (length columns))))
+ (dolist (column columns)
+ (pcase column
+ (`(,spec ,original ,value)
+ (let* ((property (car spec))
+ (width (aref org-columns-current-maxwidths i))
+ (fmt (format (if (= i last) "%%-%d.%ds |"
+ "%%-%d.%ds | ")
+ width width))
+ (ov (org-columns--new-overlay
+ (point) (1+ (point))
+ (org-columns--overlay-text
+ value fmt width property original)
+ (if dateline face1 face))))
+ (overlay-put ov 'keymap org-columns-map)
+ (overlay-put ov 'org-columns-key property)
+ (overlay-put ov 'org-columns-value original)
+ (overlay-put ov 'org-columns-value-modified value)
+ (overlay-put ov 'org-columns-format fmt)
+ (overlay-put ov 'line-prefix "")
+ (overlay-put ov 'wrap-prefix "")
+ (forward-char))))
+ (cl-incf i)))
+ ;; Make the rest of the line disappear.
+ (let ((ov (org-columns--new-overlay (point) (line-end-position))))
+ (overlay-put ov 'invisible t)
+ (overlay-put ov 'keymap org-columns-map)
+ (overlay-put ov 'line-prefix "")
+ (overlay-put ov 'wrap-prefix ""))
+ (let ((ov (make-overlay (1- (line-end-position))
+ (line-beginning-position 2))))
+ (overlay-put ov 'keymap org-columns-map)
+ (push ov org-columns-overlays))
+ (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-map>`\\[org-columns-edit-value]' \
+to edit property")))))))
+
+(defun org-columns-add-ellipses (string width)
+ "Truncate STRING with WIDTH characters, with ellipses."
+ (cond
+ ((<= (length string) width) string)
+ ((<= width (length org-columns-ellipses))
+ (substring org-columns-ellipses 0 width))
+ (t (concat (substring string 0 (- width (length org-columns-ellipses)))
+ org-columns-ellipses))))
+
+(defvar org-columns-full-header-line-format nil
+ "The full header line format, will be shifted by horizontal scrolling." )
+(defvar org-previous-header-line-format nil
+ "The header line format before column view was turned on.")
+(defvar org-columns-inhibit-recalculation nil
+ "Inhibit recomputing of columns on column view startup.")
+(defvar org-columns-flyspell-was-active nil
+ "Remember the state of `flyspell-mode' before column view.
+Flyspell-mode can cause problems in columns view, so it is turned off
+for the duration of the command.")
+
+(defvar header-line-format)
+(defvar org-columns-previous-hscroll 0)
+
+(defun org-columns--display-here-title ()
+ "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
+ (`(,property ,name . ,_)
+ (let* ((width (aref org-columns-current-maxwidths i))
+ (fmt (format "%%-%d.%ds | " width width)))
+ (setq title (concat title (format fmt (or name property)))))))
+ (cl-incf i))
+ (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 ,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)))
+
+(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
+ (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.")
+
+;;;###autoload
+(defun org-columns-remove-overlays ()
+ "Remove all currently active column overlays."
+ (interactive)
+ (when (and (fboundp 'face-remap-remove-relative)
+ org-columns-header-line-remap)
+ (face-remap-remove-relative org-columns-header-line-remap))
+ (when org-columns-overlays
+ (when (local-variable-p 'org-previous-header-line-format)
+ (setq header-line-format org-previous-header-line-format)
+ (kill-local-variable 'org-previous-header-line-format)
+ (remove-hook 'post-command-hook #'org-columns-hscroll-title 'local))
+ (set-marker org-columns-begin-marker nil)
+ (when (markerp org-columns-top-level-marker)
+ (set-marker org-columns-top-level-marker nil))
+ (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)
+ (setq truncate-lines org-colview-initial-truncate-line-value))))
+
+(defun org-columns-show-value ()
+ "Show the full value of the property."
+ (interactive)
+ (let ((value (get-char-property (point) 'org-columns-value)))
+ (message "Value is: %s" (or value ""))))
+
+(defvar org-agenda-columns-active) ;; defined in org-agenda.el
+
+(defun org-columns-quit ()
+ "Remove the column overlays and in this way exit column editing."
+ (interactive)
+ (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)
+ (message
+ "Modification not yet reflected in Agenda buffer, use `r' to refresh")))
+
+(defun org-columns-check-computed ()
+ "Throw an error if current column value is computed."
+ (let ((spec (nth (current-column) org-columns-current-fmt-compiled)))
+ (and
+ (nth 3 spec)
+ (assoc spec (get-text-property (line-beginning-position) 'org-summaries))
+ (error "This value is computed from the entry's children"))))
+
+(defun org-columns-todo (&optional _arg)
+ "Change the TODO state during column view."
+ (interactive "P")
+ (org-columns-edit-value "TODO"))
+
+(defun org-columns-toggle-or-columns-quit ()
+ "Toggle checkbox at point, or quit column view."
+ (interactive)
+ (or (org-columns--toggle)
+ (org-columns-quit)))
+
+(defun org-columns--toggle ()
+ "Toggle checkbox at point. Return non-nil if toggle happened, else nil.
+See info documentation about realizing a suitable checkbox."
+ (when (string-match "\\`\\[[ xX-]\\]\\'"
+ (get-char-property (point) 'org-columns-value))
+ (org-columns-next-allowed-value)
+ t))
+
+(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. Set
+`org-columns-default-format' and `org-columns-default-format-for-agenda'
+instead. You should use this variable only in the local settings
+section for a custom agenda view.")
+
+(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.
+Where possible, use the standard interface for changing this line."
+ (interactive)
+ (org-columns-check-computed)
+ (let* ((col (current-column))
+ (bol (line-beginning-position))
+ (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))
+ (action
+ (pcase key
+ ("CLOCKSUM"
+ (user-error "This special column cannot be edited"))
+ ("ITEM"
+ (lambda () (org-with-point-at pom (org-edit-headline))))
+ ("TODO"
+ (lambda ()
+ (org-with-point-at pom (call-interactively #'org-todo))))
+ ("PRIORITY"
+ (lambda ()
+ (org-with-point-at pom
+ (call-interactively #'org-priority))))
+ ("TAGS"
+ (lambda ()
+ (org-with-point-at pom
+ (let ((org-fast-tag-selection-single-key
+ (if (eq org-fast-tag-selection-single-key 'expert)
+ t
+ org-fast-tag-selection-single-key)))
+ (call-interactively #'org-set-tags-command)))))
+ ("DEADLINE"
+ (lambda ()
+ (org-with-point-at pom (call-interactively #'org-deadline))))
+ ("SCHEDULED"
+ (lambda ()
+ (org-with-point-at pom (call-interactively #'org-schedule))))
+ ("BEAMER_ENV"
+ (lambda ()
+ (org-with-point-at pom
+ (call-interactively #'org-beamer-select-environment))))
+ (_
+ (let* ((allowed (org-property-get-allowed-values pom key 'table))
+ (value (get-char-property (point) 'org-columns-value))
+ (nval (org-trim
+ (if (null allowed) (read-string "Edit: " value)
+ (completing-read
+ "Value: " allowed nil
+ (not (get-text-property
+ 0 'org-unrestricted (caar allowed))))))))
+ (and (not (equal nval value))
+ (lambda () (org-entry-put pom key nval))))))))
+ (cond
+ ((null action))
+ ((eq major-mode 'org-agenda-mode)
+ (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-overriding-columns-format org-columns-current-fmt)
+ (buffer (marker-buffer pom))
+ (org-agenda-contributing-files
+ (list (with-current-buffer buffer
+ (buffer-file-name (buffer-base-buffer))))))
+ (org-agenda-columns)))
+ (t
+ (let ((inhibit-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
+ ;; the right place on the current line.
+ (let ((org-columns-inhibit-recalculation)) (org-columns-redo))
+ (org-columns-update key)
+ (org-move-to-column col)))))
+
+(defun org-columns-edit-allowed ()
+ "Edit the list of allowed values for the current property."
+ (interactive)
+ (let* ((pom (or (org-get-at-bol 'org-marker)
+ (org-get-at-bol 'org-hd-marker)
+ (point)))
+ (key (concat (or (get-char-property (point) 'org-columns-key)
+ (user-error "No column to edit at point"))
+ "_ALL"))
+ (allowed (org-entry-get pom key t))
+ (new-value (read-string "Allowed: " allowed)))
+ ;; FIXME: Cover editing TODO, TAGS etc in-buffer settings.????
+ ;; FIXME: Write back to #+PROPERTY setting if that is needed.
+ (org-entry-put
+ (cond ((marker-position org-entry-property-inherited-from)
+ org-entry-property-inherited-from)
+ ((marker-position org-columns-top-level-marker)
+ org-columns-top-level-marker)
+ (t pom))
+ key new-value)))
+
+(defun org-columns--call (fun)
+ "Call function FUN while preserving heading visibility.
+FUN is a function called with no argument."
+ (let ((hide-body (and (/= (line-end-position) (point-max))
+ (save-excursion
+ (move-beginning-of-line 2)
+ (org-at-heading-p t)))))
+ (unwind-protect (funcall fun)
+ (when hide-body (outline-hide-entry)))))
+
+(defun org-columns-previous-allowed-value ()
+ "Switch to the previous allowed value for this column."
+ (interactive)
+ (org-columns-next-allowed-value t))
+
+(defun org-columns-next-allowed-value (&optional previous nth)
+ "Switch to the next allowed value for this column.
+When PREVIOUS is set, go to the previous value. When NTH is
+an integer, select that value."
+ (interactive)
+ (org-columns-check-computed)
+ (let* ((column (current-column))
+ (key (get-char-property (point) 'org-columns-key))
+ (value (get-char-property (point) 'org-columns-value))
+ (pom (or (get-text-property (line-beginning-position) 'org-hd-marker)
+ (point)))
+ (allowed
+ (let ((all
+ (or (org-property-get-allowed-values pom key)
+ (pcase (nth column org-columns-current-fmt-compiled)
+ (`(,_ ,_ ,_ ,(or "X" "X/" "X%") ,_) '("[ ]" "[X]")))
+ (org-colview-construct-allowed-dates value))))
+ (if previous (reverse all) all))))
+ (when (equal key "ITEM") (error "Cannot edit item headline from here"))
+ (unless (or allowed (member key '("SCHEDULED" "DEADLINE" "CLOCKSUM")))
+ (error "Allowed values for this property have not been defined"))
+ (let* ((l (length allowed))
+ (new
+ (cond
+ ((member key '("SCHEDULED" "DEADLINE" "CLOCKSUM"))
+ (if previous 'earlier 'later))
+ ((integerp nth)
+ (when (> (abs nth) l)
+ (user-error "Only %d allowed values for property `%s'" l key))
+ (nth (mod (1- nth) l) allowed))
+ ((member value allowed)
+ (when (= l 1) (error "Only one allowed value for this property"))
+ (or (nth 1 (member value allowed)) (car allowed)))
+ (t (car allowed))))
+ (action (lambda () (org-entry-put pom key new))))
+ (cond
+ ((eq major-mode 'org-agenda-mode)
+ (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-overriding-columns-format org-columns-current-fmt)
+ (buffer (marker-buffer pom))
+ (org-agenda-contributing-files
+ (list (with-current-buffer buffer
+ (buffer-file-name (buffer-base-buffer))))))
+ (org-agenda-columns)))
+ (t
+ (let ((inhibit-read-only t))
+ (remove-text-properties (line-end-position 0) (line-end-position)
+ '(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
+ ;; the right place on the current line.
+ (let ((org-columns-inhibit-recalculation)) (org-columns-redo))
+ (org-columns-update key)
+ (org-move-to-column column))))))
+
+(defun org-colview-construct-allowed-dates (s)
+ "Construct a list of three dates around the date in S.
+This respects the format of the time stamp in S, active or non-active,
+and also including time or not. S must be just a time stamp, no text
+around it."
+ (when (and s (string-match (concat "^" org-ts-regexp3 "$") s))
+ (let* ((time (org-parse-time-string s 'nodefaults))
+ (active (equal (string-to-char s) ?<))
+ (fmt (funcall (if (nth 1 time) 'cdr 'car) org-time-stamp-formats))
+ time-before time-after)
+ (unless active (setq fmt (concat "[" (substring fmt 1 -1) "]")))
+ (setf (car time) (or (car time) 0))
+ (setf (nth 1 time) (or (nth 1 time) 0))
+ (setf (nth 2 time) (or (nth 2 time) 0))
+ (setq time-before (copy-sequence time))
+ (setq time-after (copy-sequence time))
+ (setf (nth 3 time-before) (1- (nth 3 time)))
+ (setf (nth 3 time-after) (1+ (nth 3 time)))
+ (mapcar (lambda (x) (format-time-string fmt (apply #'encode-time x)))
+ (list time-before time time-after)))))
+
+(defun org-columns-open-link (&optional arg)
+ (interactive "P")
+ (let ((value (get-char-property (point) 'org-columns-value)))
+ (org-link-open-from-string value arg)))
+
+;;;###autoload
+(defun org-columns-get-format-and-top-level ()
+ (let ((fmt (org-columns-get-format)))
+ (org-columns-goto-top-level)
+ fmt))
+
+(defun org-columns-get-format (&optional fmt-string)
+ "Return columns format specifications.
+When optional argument FMT-STRING is non-nil, use it as the
+current specifications. This function also sets
+`org-columns-current-fmt-compiled' and
+`org-columns-current-fmt'."
+ (interactive)
+ (let ((format
+ (or fmt-string
+ (org-entry-get nil "COLUMNS" t)
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (catch :found
+ (let ((case-fold-search t))
+ (while (re-search-forward "^[ \t]*#\\+COLUMNS: .+$" nil t)
+ (let ((element (org-element-at-point)))
+ (when (eq (org-element-type element) 'keyword)
+ (throw :found (org-element-property :value element)))))
+ nil)))
+ org-columns-default-format)))
+ (setq org-columns-current-fmt format)
+ (org-columns-compile-format format)
+ format))
+
+(defun org-columns-goto-top-level ()
+ "Move to the beginning of the column view area.
+Also sets `org-columns-top-level-marker' to the new position."
+ (unless (markerp org-columns-top-level-marker)
+ (setq org-columns-top-level-marker (make-marker)))
+ (goto-char
+ (move-marker
+ org-columns-top-level-marker
+ (cond ((org-before-first-heading-p) (point-min))
+ ((org-entry-get nil "COLUMNS" t) org-entry-property-inherited-from)
+ (t (org-back-to-heading) (point))))))
+
+;;;###autoload
+(defun org-columns (&optional global columns-fmt-string)
+ "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, GLOBAL,
+turn on column 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)
+ (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)))
+ (when (assoc "CLOCKSUM" org-columns-current-fmt-compiled)
+ (org-clock-sum))
+ (when (assoc "CLOCKSUM_T" org-columns-current-fmt-compiled)
+ (org-clock-sum-today))
+ (let ((cache
+ ;; Collect contents of columns ahead of time so as to
+ ;; compute their maximum width.
+ (org-scan-tags
+ (lambda () (cons (point) (org-columns--collect-values))) t org--matcher-tags-todo-only)))
+ (when cache
+ (org-columns--set-widths cache)
+ (org-columns--display-here-title)
+ (when (setq-local org-columns-flyspell-was-active
+ (bound-and-true-p flyspell-mode))
+ (flyspell-mode 0))
+ (unless (local-variable-p 'org-colview-initial-truncate-line-value)
+ (setq-local org-colview-initial-truncate-line-value
+ truncate-lines))
+ (if (not global-visual-line-mode)
+ (setq truncate-lines t))
+ (dolist (entry cache)
+ (goto-char (car entry))
+ (org-columns--display-here (cdr entry)))))))))
+
+(defun org-columns-new (&optional spec &rest attributes)
+ "Insert a new column, to the left of the current column.
+Interactively fill attributes for new column. When column format
+specification SPEC is provided, edit it instead.
+
+When optional argument attributes can be a list of columns
+specifications attributes to create the new column
+non-interactively. See `org-columns-compile-format' for
+details."
+ (interactive)
+ (let ((new (or attributes
+ (let ((prop
+ (completing-read
+ "Property: "
+ (mapcar #'list (org-buffer-property-keys t nil t))
+ nil nil (nth 0 spec))))
+ (list prop
+ (read-string (format "Column title [%s]: " prop)
+ (nth 1 spec))
+ ;; Use `read-string' instead of `read-number'
+ ;; to allow empty width.
+ (let ((w (read-string
+ "Column width: "
+ (and (nth 2 spec)
+ (number-to-string (nth 2 spec))))))
+ (and (org-string-nw-p w) (string-to-number w)))
+ (org-string-nw-p
+ (completing-read
+ "Summary: "
+ (delete-dups
+ (cons '("") ;Allow empty operator.
+ (mapcar (lambda (x) (list (car x)))
+ (append
+ org-columns-summary-types
+ org-columns-summary-types-default))))
+ nil t (nth 3 spec)))
+ (org-string-nw-p
+ (read-string "Format: " (nth 4 spec))))))))
+ (if spec
+ (progn (setcar spec (car new))
+ (setcdr spec (cdr new)))
+ (push new (nthcdr (current-column) org-columns-current-fmt-compiled)))
+ (org-columns-store-format)
+ (org-columns-redo)))
+
+(defun org-columns-delete ()
+ "Delete the column at point from columns view."
+ (interactive)
+ (let ((spec (nth (current-column) org-columns-current-fmt-compiled)))
+ (when (y-or-n-p (format "Are you sure you want to remove column %S? "
+ (nth 1 spec)))
+ (setq org-columns-current-fmt-compiled
+ (delq spec org-columns-current-fmt-compiled))
+ (org-columns-store-format)
+ ;; This may leave a now wrong value in a node property. However
+ ;; updating it may prove counter-intuitive. See comments in
+ ;; `org-columns-move-right' for details.
+ (let ((org-columns-inhibit-recalculation t)) (org-columns-redo))
+ (when (>= (current-column) (length org-columns-current-fmt-compiled))
+ (backward-char)))))
+
+(defun org-columns-edit-attributes ()
+ "Edit the attributes of the current column."
+ (interactive)
+ (org-columns-new (nth (current-column) org-columns-current-fmt-compiled)))
+
+(defun org-columns-widen (arg)
+ "Make the column wider by ARG characters."
+ (interactive "p")
+ (let* ((n (current-column))
+ (entry (nth n org-columns-current-fmt-compiled))
+ (width (aref org-columns-current-maxwidths n)))
+ (setq width (max 1 (+ width arg)))
+ (setcar (nthcdr 2 entry) width)
+ (org-columns-store-format)
+ (let ((org-columns-inhibit-recalculation t)) (org-columns-redo))))
+
+(defun org-columns-narrow (arg)
+ "Make the column narrower by ARG characters."
+ (interactive "p")
+ (org-columns-widen (- arg)))
+
+(defun org-columns-move-right ()
+ "Swap this column with the one to the right."
+ (interactive)
+ (let* ((n (current-column))
+ (cell (nthcdr n org-columns-current-fmt-compiled))
+ e)
+ (when (>= n (1- (length org-columns-current-fmt-compiled)))
+ (error "Cannot shift this column further to the right"))
+ (setq e (car cell))
+ (setcar cell (car (cdr cell)))
+ (setcdr cell (cons e (cdr (cdr cell))))
+ (org-columns-store-format)
+ ;; Do not compute again properties, since we're just moving
+ ;; columns around. It can put a property value a bit off when
+ ;; switching between an non-computed and a computed value for the
+ ;; same property, e.g. from "%A %A{+}" to "%A{+} %A".
+ ;;
+ ;; In this case, the value needs to be updated since the first
+ ;; column related to a property determines how its value is
+ ;; computed. However, (correctly) updating the value could be
+ ;; surprising, so we leave it as-is nonetheless.
+ (let ((org-columns-inhibit-recalculation t)) (org-columns-redo))
+ (forward-char 1)))
+
+(defun org-columns-move-left ()
+ "Swap this column with the one to the left."
+ (interactive)
+ (let* ((n (current-column)))
+ (when (= n 0)
+ (error "Cannot shift this column further to the left"))
+ (backward-char 1)
+ (org-columns-move-right)
+ (backward-char 1)))
+
+(defun org-columns-store-format ()
+ "Store the text version of the current columns format.
+The format is stored either in the COLUMNS property of the node
+starting the current column display, or in a #+COLUMNS line of
+the current buffer."
+ (let ((fmt (org-columns-uncompile-format org-columns-current-fmt-compiled)))
+ (setq-local org-columns-current-fmt fmt)
+ (when org-columns-overlays
+ (org-with-point-at org-columns-top-level-marker
+ (if (and (org-at-heading-p) (org-entry-get nil "COLUMNS"))
+ (org-entry-put nil "COLUMNS" fmt)
+ (goto-char (point-min))
+ (let ((case-fold-search t))
+ ;; Try to replace the first COLUMNS keyword available.
+ (catch :found
+ (while (re-search-forward "^[ \t]*#\\+COLUMNS:\\(.*\\)" nil t)
+ (let ((element (save-match-data (org-element-at-point))))
+ (when (and (eq (org-element-type element) 'keyword)
+ (equal (org-element-property :key element)
+ "COLUMNS"))
+ (replace-match (concat " " fmt) t t nil 1)
+ (throw :found nil))))
+ ;; No COLUMNS keyword in the buffer. Insert one at the
+ ;; beginning, right before the first heading, if any.
+ (goto-char (point-min))
+ (unless (org-at-heading-p t) (outline-next-heading))
+ (let ((inhibit-read-only t))
+ (insert-before-markers "#+COLUMNS: " fmt "\n"))))
+ (setq-local org-columns-default-format fmt))))))
+
+(defun org-columns-update (property)
+ "Recompute PROPERTY, and update the columns display for it."
+ (org-columns-compute property)
+ (org-with-wide-buffer
+ (let ((p (upcase property)))
+ (dolist (ov org-columns-overlays)
+ (let ((key (overlay-get ov 'org-columns-key)))
+ (when (and key (equal key p) (overlay-start ov))
+ (goto-char (overlay-start ov))
+ (let* ((spec (nth (current-column) org-columns-current-fmt-compiled))
+ (value
+ (or (cdr (assoc spec
+ (get-text-property (line-beginning-position)
+ 'org-summaries)))
+ (org-entry-get (point) key))))
+ (when value
+ (let ((displayed (org-columns--displayed-value spec value))
+ (format (overlay-get ov 'org-columns-format))
+ (width
+ (aref org-columns-current-maxwidths (current-column))))
+ (overlay-put ov 'org-columns-value value)
+ (overlay-put ov 'org-columns-value-modified displayed)
+ (overlay-put ov
+ 'display
+ (org-columns--overlay-text
+ displayed format width property value)))))))))))
+
+(defun org-columns-redo ()
+ "Construct the column display again."
+ (interactive)
+ (when org-columns-overlays
+ (message "Recomputing columns...")
+ (org-with-point-at org-columns-begin-marker
+ (org-columns-remove-overlays)
+ (if (derived-mode-p 'org-mode)
+ ;; Since we already know the columns format, provide it
+ ;; instead of computing again.
+ (call-interactively #'org-columns org-columns-current-fmt)
+ (org-agenda-redo)
+ (call-interactively #'org-agenda-columns)))
+ (message "Recomputing columns...done")))
+
+(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'."
+ (mapconcat
+ (lambda (spec)
+ (pcase spec
+ (`(,prop ,title ,width ,op ,printf)
+ (concat "%"
+ (and width (number-to-string width))
+ prop
+ (and title (not (equal prop title)) (format "(%s)" title))
+ (cond ((not op) nil)
+ (printf (format "{%s;%s}" op printf))
+ (t (format "{%s}" op)))))))
+ compiled " "))
+
+(defun org-columns-compile-format (fmt)
+ "Turn a column format string FMT into an alist of specifications.
+
+The alist has one entry for each column in the format. The elements of
+that list are:
+property the property name, as an upper-case string
+title the title field for the columns, as a string
+width the column width in characters, can be nil for automatic width
+operator the summary operator, as a string, or nil
+printf a printf format for computed values, as a string, or nil
+
+This function updates `org-columns-current-fmt-compiled'."
+ (setq org-columns-current-fmt-compiled nil)
+ (let ((start 0))
+ (while (string-match
+ "%\\([0-9]+\\)?\\([[:alnum:]_-]+\\)\\(?:(\\([^)]+\\))\\)?\
+\\(?:{\\([^}]+\\)}\\)?\\s-*"
+ fmt start)
+ (setq start (match-end 0))
+ (let* ((width (and (match-end 1) (string-to-number (match-string 1 fmt))))
+ (prop (match-string-no-properties 2 fmt))
+ (title (or (match-string-no-properties 3 fmt) prop))
+ (operator (match-string-no-properties 4 fmt)))
+ (push (if (not operator) (list (upcase prop) title width nil nil)
+ (let (printf)
+ (when (string-match ";" operator)
+ (setq printf (substring operator (match-end 0)))
+ (setq operator (substring operator 0 (match-beginning 0))))
+ (list (upcase prop) title width operator printf)))
+ org-columns-current-fmt-compiled)))
+ (setq org-columns-current-fmt-compiled
+ (nreverse org-columns-current-fmt-compiled))))
+
+
+;;;; Column View Summary
+
+(defun org-columns--age-to-minutes (s)
+ "Turn age string S into a number of minutes.
+An age is either computed from a given time-stamp, or indicated
+as a canonical duration, i.e., using units defined in
+`org-duration-canonical-units'."
+ (cond
+ ((string-match-p org-ts-regexp s)
+ (/ (- org-columns--time
+ (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))))
+
+(defun org-columns--format-age (minutes)
+ "Format MINUTES float as an age string."
+ (org-duration-from-minutes minutes
+ '(("d" . nil) ("h" . nil) ("min" . nil))
+ t)) ;ignore user's custom units
+
+(defun org-columns--summary-apply-times (fun times)
+ "Apply FUN to time values TIMES.
+Return the result as a duration."
+ (org-duration-from-minutes
+ (apply fun (mapcar #'org-duration-to-minutes times))
+ (org-duration-h:mm-only-p times)))
+
+(defun org-columns--compute-spec (spec &optional update)
+ "Update tree according to SPEC.
+SPEC is a column format specification. When optional argument
+UPDATE is non-nil, summarized values can replace existing ones in
+properties drawers."
+ (let* ((lmax (if (bound-and-true-p org-inlinetask-min-level)
+ org-inlinetask-min-level
+ 29)) ;Hard-code deepest level.
+ (lvals (make-vector (1+ lmax) nil))
+ (level 0)
+ (inminlevel lmax)
+ (last-level lmax)
+ (property (car spec))
+ (printf (nth 4 spec))
+ ;; Special properties cannot be collected nor summarized, as
+ ;; they have their own way to be computed. Therefore, ignore
+ ;; any operator attached to them.
+ (operator (and (not (member property org-special-properties))
+ (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)
+ (goto-char (condition-case nil (org-end-of-subtree t) (error (point-max))))
+ ;; Walk the tree from the back and do the computations.
+ (while (re-search-backward
+ org-outline-regexp-bol org-columns-top-level-marker t)
+ (unless (or (= level 0) (eq level inminlevel))
+ (setq last-level level))
+ (setq level (org-reduced-level (org-outline-level)))
+ (let* ((pos (match-beginning 0))
+ (value (if collect (funcall collect property)
+ (org-entry-get (point) property)))
+ (value-set (org-string-nw-p value)))
+ (cond
+ ((< level last-level)
+ ;; Collect values from lower levels and inline tasks here
+ ;; and summarize them using SUMMARIZE. Store them in text
+ ;; property `org-summaries', in alist whose key is SPEC.
+ (let* ((summary
+ (and summarize
+ (let ((values (append (and (/= last-level inminlevel)
+ (aref lvals last-level))
+ (aref lvals inminlevel))))
+ (and values (funcall summarize values printf))))))
+ ;; Leaf values are not summaries: do not mark them.
+ (when summary
+ (let* ((summaries-alist (get-text-property pos 'org-summaries))
+ (old (assoc spec summaries-alist)))
+ (if old (setcdr old summary)
+ (push (cons spec summary) 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.
+ ;;
+ ;; Ignore leading or trailing white spaces that might
+ ;; have been introduced in summary, since those are not
+ ;; significant in properties value.
+ (let ((new-value (org-trim summary)))
+ (when (and update value (not (equal value new-value)))
+ (org-entry-put (point) property new-value))))
+ ;; Add current to current level accumulator.
+ (when (or summary value-set)
+ (push (or summary value) (aref lvals level)))
+ ;; Clear accumulators for deeper levels.
+ (cl-loop for l from (1+ level) to lmax do (aset lvals l nil))))
+ (value-set (push value (aref lvals level)))
+ (t nil)))))))
+
+;;;###autoload
+(defun org-columns-compute (property)
+ "Summarize the values of PROPERTY hierarchically.
+Also update existing values for PROPERTY according to the first
+column specification."
+ (interactive)
+ (let ((main-flag t)
+ (upcase-prop (upcase property)))
+ (dolist (spec org-columns-current-fmt-compiled)
+ (pcase spec
+ (`(,(pred (equal upcase-prop)) . ,_)
+ (org-columns--compute-spec spec main-flag)
+ ;; Only the first summary can update the property value.
+ (when main-flag (setq main-flag nil)))))))
+
+(defun org-columns-compute-all ()
+ "Compute all columns that have operators defined."
+ (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)))
+ ;; Property value is updated only the first time a given
+ ;; property is encountered.
+ (org-columns--compute-spec spec (not (member property seen)))
+ (push property seen)))))
+
+(defun org-columns--summary-sum (values printf)
+ "Compute the sum of VALUES.
+When PRINTF is non-nil, use it to format the result."
+ (format (or printf "%s") (apply #'+ (mapcar #'string-to-number values))))
+
+(defun org-columns--summary-currencies (values _)
+ "Compute the sum of VALUES, with two decimals."
+ (format "%.2f" (apply #'+ (mapcar #'string-to-number values))))
+
+(defun org-columns--summary-checkbox (check-boxes _)
+ "Summarize CHECK-BOXES with a check-box."
+ (let ((done (cl-count "[X]" check-boxes :test #'equal))
+ (all (length check-boxes)))
+ (cond ((= done all) "[X]")
+ ((> done 0) "[-]")
+ (t "[ ]"))))
+
+(defun org-columns--summary-checkbox-count (check-boxes _)
+ "Summarize CHECK-BOXES with a check-box cookie."
+ (format "[%d/%d]"
+ (cl-count-if (lambda (b) (or (equal b "[X]")
+ (string-match-p "\\[\\([1-9]\\)/\\1\\]" b)))
+ check-boxes)
+ (length check-boxes)))
+
+(defun org-columns--summary-checkbox-percent (check-boxes _)
+ "Summarize CHECK-BOXES with a check-box percent."
+ (format "[%d%%]"
+ (round (* 100.0 (cl-count-if (lambda (b) (member b '("[X]" "[100%]")))
+ check-boxes))
+ (length check-boxes))))
+
+(defun org-columns--summary-min (values printf)
+ "Compute the minimum of VALUES.
+When PRINTF is non-nil, use it to format the result."
+ (format (or printf "%s")
+ (apply #'min (mapcar #'string-to-number values))))
+
+(defun org-columns--summary-max (values printf)
+ "Compute the maximum of VALUES.
+When PRINTF is non-nil, use it to format the result."
+ (format (or printf "%s")
+ (apply #'max (mapcar #'string-to-number values))))
+
+(defun org-columns--summary-mean (values printf)
+ "Compute the mean of VALUES.
+When PRINTF is non-nil, use it to format the result."
+ (format (or printf "%s")
+ (/ (apply #'+ (mapcar #'string-to-number values))
+ (float (length values)))))
+
+(defun org-columns--summary-sum-times (times _)
+ "Sum TIMES."
+ (org-columns--summary-apply-times #'+ times))
+
+(defun org-columns--summary-min-time (times _)
+ "Compute the minimum time among TIMES."
+ (org-columns--summary-apply-times #'min times))
+
+(defun org-columns--summary-max-time (times _)
+ "Compute the maximum time among TIMES."
+ (org-columns--summary-apply-times #'max times))
+
+(defun org-columns--summary-mean-time (times _)
+ "Compute the mean time among TIMES."
+ (org-columns--summary-apply-times
+ (lambda (&rest values) (/ (apply #'+ values) (float (length values))))
+ times))
+
+(defun org-columns--summary-min-age (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 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 mean age among AGES."
+ (org-columns--format-age
+ (/ (apply #'+ (mapcar #'org-columns--age-to-minutes ages))
+ (float (length ages)))))
+
+(defun org-columns--summary-estimate (estimates _)
+ "Combine a list of estimates, using mean and variance.
+The mean and variance of the result will be the sum of the means
+and variances (respectively) of the individual estimates."
+ (let ((mean 0)
+ (var 0))
+ (dolist (e estimates)
+ (pcase (mapcar #'string-to-number (split-string e "-"))
+ (`(,low ,high)
+ (let ((m (/ (+ low high) 2.0)))
+ (cl-incf mean m)
+ (cl-incf var (- (/ (+ (* low low) (* high high)) 2.0) (* m m)))))
+ (`(,value) (cl-incf mean value))))
+ (let ((sd (sqrt var)))
+ (format "%s-%s"
+ (format "%.0f" (- mean sd))
+ (format "%.0f" (+ mean sd))))))
+
+
+
+;;; Dynamic block for Column view
+
+(defun org-columns--capture-view (maxlevel match skip-empty exclude-tags format local)
+ "Get the column view of the current buffer.
+
+MAXLEVEL sets the level limit. SKIP-EMPTY tells whether to skip
+empty rows, an empty row being one where all the column view
+specifiers but ITEM are empty. EXCLUDE-TAGS is a list of tags
+that will be excluded from the resulting view. FORMAT is a
+format string for columns, or nil. When LOCAL is non-nil, only
+capture headings in current subtree.
+
+This function returns a list containing the title row and all
+other rows. Each row is a list of fields, as strings, or
+`hline'."
+ (org-columns (not local) format)
+ (goto-char org-columns-top-level-marker)
+ (let ((columns (length org-columns-current-fmt-compiled))
+ (has-item (assoc "ITEM" org-columns-current-fmt-compiled))
+ table)
+ (org-map-entries
+ (lambda ()
+ (when (get-char-property (point) 'org-columns-key)
+ (let (row)
+ (dotimes (i columns)
+ (let* ((col (+ (line-beginning-position) i))
+ (p (get-char-property col 'org-columns-key)))
+ (push (org-quote-vert
+ (get-char-property col
+ (if (string= p "ITEM")
+ 'org-columns-value
+ 'org-columns-value-modified)))
+ row)))
+ (unless (or
+ (and skip-empty
+ (let ((r (delete-dups (remove "" row))))
+ (or (null r) (and has-item (= (length r) 1)))))
+ (and exclude-tags
+ (cl-some (lambda (tag) (member tag exclude-tags))
+ (org-get-tags))))
+ (push (cons (org-reduced-level (org-current-level)) (nreverse row))
+ table)))))
+ (if match
+ (concat match (and maxlevel (format "+LEVEL<=%d" maxlevel)))
+ (and maxlevel (format "LEVEL<=%d" maxlevel)))
+ (and local 'tree)
+ 'archive 'comment)
+ (org-columns-quit)
+ ;; Add column titles and a horizontal rule in front of the table.
+ (cons (mapcar #'cadr org-columns-current-fmt-compiled)
+ (cons 'hline (nreverse table)))))
+
+(defun org-columns--clean-item (item)
+ "Remove sensitive contents from string ITEM.
+This includes objects that may not be duplicated within
+a document, e.g., a target, or those forbidden in tables, e.g.,
+an inline src-block."
+ (let ((data (org-element-parse-secondary-string
+ item (org-element-restriction 'headline))))
+ (org-element-map data
+ '(footnote-reference inline-babel-call inline-src-block target
+ radio-target statistics-cookie)
+ #'org-element-extract-element)
+ (org-no-properties (org-element-interpret-data data))))
+
+;;;###autoload
+(defun org-dblock-write:columnview (params)
+ "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."
+ (let ((table
+ (let ((id (plist-get params :id))
+ view-file view-pos)
+ (pcase id
+ (`global nil)
+ ((or `local `nil) (setq view-pos (point)))
+ ((and (let id-string (format "%s" id))
+ (guard (string-match "^file:\\(.*\\)" id-string)))
+ (setq view-file (match-string-no-properties 1 id-string))
+ (unless (file-exists-p view-file)
+ (user-error "No such file: %S" id-string)))
+ ((and (let idpos (org-find-entry-with-id id)) (guard idpos))
+ (setq view-pos idpos))
+ ((let `(,filename . ,position) (org-id-find id))
+ (setq view-file filename)
+ (setq view-pos position))
+ (_ (user-error "Cannot find entry with :ID: %s" id)))
+ (with-current-buffer (if view-file (get-file-buffer view-file)
+ (current-buffer))
+ (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 :exclude-tags)
+ (plist-get params :format)
+ view-pos))))))
+ (when table
+ ;; Prune level information from the table. Also normalize
+ ;; headings: remove stars, add indentation entities, if
+ ;; required, and possibly precede some of them with a horizontal
+ ;; rule.
+ (let ((item-index
+ (let ((p (assoc "ITEM" org-columns-current-fmt-compiled)))
+ (and p (cl-position p
+ org-columns-current-fmt-compiled
+ :test #'equal))))
+ (hlines (plist-get params :hlines))
+ (indent (plist-get params :indent))
+ new-table)
+ ;; Copy header and first rule.
+ (push (pop table) new-table)
+ (push (pop table) new-table)
+ (dolist (row table (setq table (nreverse new-table)))
+ (let ((level (car row)))
+ (when (and (not (eq (car new-table) 'hline))
+ (or (eq hlines t)
+ (and (numberp hlines) (<= level hlines))))
+ (push 'hline new-table))
+ (when item-index
+ (let ((item (org-columns--clean-item (nth item-index (cdr row)))))
+ (setf (nth item-index (cdr row))
+ (if (and indent (> level 1))
+ (concat "\\_" (make-string (* 2 (1- level)) ?\s) item)
+ item))))
+ (push (cdr row) new-table))))
+ (when (plist-get params :vlines)
+ (setq table
+ (let ((size (length org-columns-current-fmt-compiled)))
+ (append (mapcar (lambda (x) (if (eq 'hline x) x (cons "" x)))
+ table)
+ (list (cons "/" (make-list size "<>")))))))
+ (let ((content-lines (org-split-string (plist-get params :content) "\n"))
+ recalc)
+ ;; Insert affiliated keywords before the table.
+ (when content-lines
+ (while (string-match-p "\\`[ \t]*#\\+" (car content-lines))
+ (insert (pop content-lines) "\n")))
+ (save-excursion
+ ;; Insert table at point.
+ (insert
+ (mapconcat (lambda (row)
+ (if (eq row 'hline) "|-|"
+ (format "|%s|" (mapconcat #'identity row "|"))))
+ table
+ "\n"))
+ ;; Insert TBLFM lines following table.
+ (let ((case-fold-search t))
+ (dolist (line content-lines)
+ (when (string-match-p "\\`[ \t]*#\\+TBLFM:" line)
+ (insert "\n" line)
+ (unless recalc (setq recalc t))))))
+ (when recalc (org-table-recalculate 'all t))
+ (org-table-align)))))
+
+;;;###autoload
+(defun org-columns-insert-dblock ()
+ "Create a dynamic block capturing a column view table."
+ (interactive)
+ (let ((id (completing-read
+ "Capture columns (local, global, entry with :ID: property) [local]: "
+ (append '(("global") ("local"))
+ (mapcar #'list (org-property-values "ID"))))))
+ (org-create-dblock
+ (list :name "columnview"
+ :hlines 1
+ :id (cond ((string= id "global") 'global)
+ ((member id '("" "local")) 'local)
+ (id)))))
+ (org-update-dblock))
+
+;;;###autoload
+(eval-after-load 'org
+ '(progn
+ (org-dynamic-block-define "columnview" #'org-columns-insert-dblock)))
+
+
+;;; Column view in the agenda
+
+;;;###autoload
+(defun org-agenda-columns ()
+ "Turn on or update column view in the agenda."
+ (interactive)
+ (org-columns-remove-overlays)
+ (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))
+ (org-done-keywords org-done-keywords-for-agenda)
+ (fmt
+ (cond
+ ((bound-and-true-p org-overriding-columns-format))
+ ((bound-and-true-p org-local-columns-format))
+ ((bound-and-true-p org-columns-default-format-for-agenda))
+ ((let ((m (org-get-at-bol 'org-hd-marker)))
+ (and m
+ (or (org-entry-get m "COLUMNS" t)
+ (with-current-buffer (marker-buffer m)
+ org-columns-default-format)))))
+ ((and (local-variable-p 'org-columns-current-fmt)
+ org-columns-current-fmt))
+ ((let ((m (next-single-property-change (point-min) 'org-hd-marker)))
+ (and m
+ (let ((m (get-text-property m 'org-hd-marker)))
+ (or (org-entry-get m "COLUMNS" t)
+ (with-current-buffer (marker-buffer m)
+ org-columns-default-format))))))
+ (t org-columns-default-format)))
+ (compiled-fmt (org-columns-compile-format fmt)))
+ (setq org-columns-current-fmt fmt)
+ (when org-agenda-columns-compute-summary-properties
+ (org-agenda-colview-compute org-columns-current-fmt-compiled))
+ (save-excursion
+ ;; Collect properties for each headline in current view.
+ (goto-char (point-min))
+ (let (cache)
+ (while (not (eobp))
+ (let ((m (org-get-at-bol 'org-hd-marker)))
+ (when m
+ (push (cons (line-beginning-position)
+ ;; `org-columns-current-fmt-compiled' is
+ ;; initialized but only set locally to the
+ ;; agenda buffer. Since current buffer is
+ ;; changing, we need to force the original
+ ;; compiled-fmt there.
+ (org-with-point-at m
+ (org-columns--collect-values compiled-fmt)))
+ cache)))
+ (forward-line))
+ (when cache
+ (org-columns--set-widths cache)
+ (org-columns--display-here-title)
+ (when (setq-local org-columns-flyspell-was-active
+ (bound-and-true-p flyspell-mode))
+ (flyspell-mode 0))
+ (dolist (entry cache)
+ (goto-char (car entry))
+ (org-columns--display-here (cdr entry)))
+ (setq-local org-agenda-columns-active t)
+ (when org-agenda-columns-show-summaries
+ (org-agenda-colview-summarize cache)))))))
+
+(defun org-agenda-colview-summarize (cache)
+ "Summarize the summarizable columns in column view in the agenda.
+This will add overlays to the date lines, to show the summary for each day."
+ (let ((fmt (mapcar
+ (lambda (spec)
+ (pcase spec
+ (`(,property ,title ,width . ,_)
+ (if (member property '("CLOCKSUM" "CLOCKSUM_T"))
+ (list property title width ":" nil)
+ spec))))
+ org-columns-current-fmt-compiled)))
+ ;; Ensure there's at least one summation column.
+ (when (cl-some (lambda (spec) (nth 3 spec)) fmt)
+ (goto-char (point-max))
+ (catch :complete
+ (while t
+ (when (or (get-text-property (point) 'org-date-line)
+ (eq (get-text-property (point) 'face)
+ 'org-agenda-structure))
+ ;; OK, this is a date line that should be used.
+ (let (entries)
+ (let (rest)
+ (dolist (c cache)
+ (if (> (car c) (point))
+ (push c entries)
+ (push c rest)))
+ (setq cache rest))
+ ;; ENTRIES contains entries below the current one.
+ ;; CACHE is the rest. Compute the summaries for the
+ ;; properties we want, set nil properties for the rest.
+ (when (setq entries (mapcar #'cdr entries))
+ (org-columns--display-here
+ (mapcar
+ (lambda (spec)
+ (pcase spec
+ (`("ITEM" . ,_)
+ ;; Replace ITEM with current date. Preserve
+ ;; properties for fontification.
+ (let ((date (buffer-substring
+ (line-beginning-position)
+ (line-end-position))))
+ (list spec date date)))
+ (`(,_ ,_ ,_ nil ,_) (list spec "" ""))
+ (`(,_ ,_ ,_ ,operator ,printf)
+ (let* ((summarize (org-columns--summarize operator))
+ (values
+ ;; Use real values for summary, not
+ ;; those prepared for display.
+ (delq nil
+ (mapcar
+ (lambda (e) (org-string-nw-p
+ (nth 1 (assoc spec e))))
+ entries)))
+ (final (if values
+ (funcall summarize values printf)
+ "")))
+ (unless (equal final "")
+ (put-text-property 0 (length final)
+ 'face 'bold final))
+ (list spec final final)))))
+ fmt)
+ 'dateline))))
+ (if (bobp) (throw :complete t) (forward-line -1)))))))
+
+(defun org-agenda-colview-compute (fmt)
+ "Compute the relevant columns in the contributing source buffers."
+ (dolist (file org-agenda-contributing-files)
+ (let ((b (find-buffer-visiting file)))
+ (with-current-buffer (or (buffer-base-buffer b) b)
+ (org-with-wide-buffer
+ (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)
+ (let ((prop (car spec)))
+ (cond
+ ((equal prop "CLOCKSUM") (org-clock-sum))
+ ((equal prop "CLOCKSUM_T") (org-clock-sum-today))
+ ((and (nth 3 spec)
+ (let ((a (assoc prop org-columns-current-fmt-compiled)))
+ (equal (nth 3 a) (nth 3 spec))))
+ (org-columns-compute prop))))))))))
+
+
+(provide 'org-colview)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-colview.el ends here
diff --git a/elpa/org-9.5.2/org-colview.elc b/elpa/org-9.5.2/org-colview.elc
new file mode 100644
index 0000000..e0474b8
--- /dev/null
+++ b/elpa/org-9.5.2/org-colview.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-compat.el b/elpa/org-9.5.2/org-compat.el
new file mode 100644
index 0000000..d230ee2
--- /dev/null
+++ b/elpa/org-9.5.2/org-compat.el
@@ -0,0 +1,1256 @@
+;;; org-compat.el --- Compatibility Code for Older Emacsen -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; 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-set-restriction-lock "org-agenda" (&optional type))
+(declare-function org-agenda-remove-restriction-lock "org-agenda" (&optional noupdate))
+(declare-function org-calendar-goto-agenda "org-agenda" ())
+(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-hide-block-toggle "org" (&optional force no-error element))
+(declare-function org-link-display-format "ol" (s))
+(declare-function org-link-set-parameters "ol" (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-return "org" (&optional indent arg interactive))
+(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 < 28.1 compatibility
+
+(if (fboundp 'directory-empty-p)
+ (defalias 'org-directory-empty-p #'directory-empty-p)
+ (defun org-directory-empty-p (dir)
+ "Return t if DIR names an existing directory containing no other files."
+ (and (file-directory-p dir)
+ (null (directory-files dir nil directory-files-no-dot-files-regexp t)))))
+
+
+;;; 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))))
+
+;; `newline-and-indent' did not take a numeric argument before 27.1.
+(if (version< emacs-version "27")
+ (defsubst org-newline-and-indent (&optional _arg)
+ (newline-and-indent))
+ (defalias 'org-newline-and-indent #'newline-and-indent))
+
+(defun org--set-faces-extend (faces extend-p)
+ "Set the :extend attribute of FACES to EXTEND-P.
+
+This is a no-op for Emacs versions lower than 27, since face
+extension beyond end of line was not controllable."
+ (when (fboundp 'set-face-extend)
+ (mapc (lambda (f) (set-face-extend f extend-p)) faces)))
+
+(if (fboundp 'string-distance)
+ (defalias 'org-string-distance 'string-distance)
+ (defun org-string-distance (s1 s2)
+ "Return the edit (levenshtein) distance between strings S1 S2."
+ (let* ((l1 (length s1))
+ (l2 (length s2))
+ (dist (vconcat (mapcar (lambda (_) (make-vector (1+ l2) nil))
+ (number-sequence 1 (1+ l1)))))
+ (in (lambda (i j) (aref (aref dist i) j))))
+ (setf (aref (aref dist 0) 0) 0)
+ (dolist (j (number-sequence 1 l2))
+ (setf (aref (aref dist 0) j) j))
+ (dolist (i (number-sequence 1 l1))
+ (setf (aref (aref dist i) 0) i)
+ (dolist (j (number-sequence 1 l2))
+ (setf (aref (aref dist i) j)
+ (min
+ (1+ (funcall in (1- i) j))
+ (1+ (funcall in i (1- j)))
+ (+ (if (equal (aref s1 (1- i)) (aref s2 (1- j))) 0 1)
+ (funcall in (1- i) (1- j)))))))
+ (funcall in l1 l2))))
+
+(define-obsolete-function-alias 'org-babel-edit-distance 'org-string-distance
+ "9.5")
+
+
+;;; 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))
+
+(if (fboundp 'buffer-hash)
+ (defalias 'org-buffer-hash 'buffer-hash)
+ (defun org-buffer-hash () (md5 (current-buffer))))
+
+(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 "9.0")
+(define-obsolete-function-alias 'org-add-hook 'add-hook "9.0")
+(define-obsolete-function-alias 'org-bound-and-true-p 'bound-and-true-p "9.0")
+(define-obsolete-function-alias 'org-decompose-region 'decompose-region "9.0")
+(define-obsolete-function-alias 'org-defvaralias 'defvaralias "9.0")
+(define-obsolete-function-alias 'org-detach-overlay 'delete-overlay "9.0")
+(define-obsolete-function-alias 'org-file-equal-p 'file-equal-p "9.0")
+(define-obsolete-function-alias 'org-float-time 'float-time "9.0")
+(define-obsolete-function-alias 'org-indent-line-to 'indent-line-to "9.0")
+(define-obsolete-function-alias 'org-indent-to-column 'indent-to-column "9.0")
+(define-obsolete-function-alias 'org-looking-at-p 'looking-at-p "9.0")
+(define-obsolete-function-alias 'org-looking-back 'looking-back "9.0")
+(define-obsolete-function-alias 'org-match-string-no-properties 'match-string-no-properties "9.0")
+(define-obsolete-function-alias 'org-propertize 'propertize "9.0")
+(define-obsolete-function-alias 'org-select-frame-set-input-focus 'select-frame-set-input-focus "9.0")
+(define-obsolete-function-alias 'org-file-remote-p 'file-remote-p "9.2")
+
+(defmacro org-re (s)
+ "Replace posix classes in regular expression S."
+ (declare (debug (form))
+ (obsolete "you can safely remove it." "9.0"))
+ s)
+
+;;;; Functions from cl-lib that Org used to have its own implementation of.
+(define-obsolete-function-alias 'org-count 'cl-count "9.0")
+(define-obsolete-function-alias 'org-every 'cl-every "9.0")
+(define-obsolete-function-alias 'org-find-if 'cl-find-if "9.0")
+(define-obsolete-function-alias 'org-reduce 'cl-reduce "9.0")
+(define-obsolete-function-alias 'org-remove-if 'cl-remove-if "9.0")
+(define-obsolete-function-alias 'org-remove-if-not 'cl-remove-if-not "9.0")
+(define-obsolete-function-alias 'org-some 'cl-some "9.0")
+(define-obsolete-function-alias 'org-floor* 'cl-floor "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)."
+ "9.0")
+
+
+;;;; Functions available since Emacs 24.3
+(define-obsolete-function-alias 'org-buffer-narrowed-p 'buffer-narrowed-p "9.0")
+(define-obsolete-function-alias 'org-called-interactively-p 'called-interactively-p "9.0")
+(define-obsolete-function-alias 'org-char-to-string 'char-to-string "9.0")
+(define-obsolete-function-alias 'org-delete-directory 'delete-directory "9.0")
+(define-obsolete-function-alias 'org-format-seconds 'format-seconds "9.0")
+(define-obsolete-function-alias 'org-link-escape-browser 'url-encode-url "9.0")
+(define-obsolete-function-alias 'org-no-warnings 'with-no-warnings "9.0")
+(define-obsolete-function-alias 'org-number-sequence 'number-sequence "9.0")
+(define-obsolete-function-alias 'org-pop-to-buffer-same-window 'pop-to-buffer-same-window "9.0")
+(define-obsolete-function-alias 'org-string-match-p 'string-match-p "9.0")
+
+;;;; Functions and variables from previous releases now obsolete.
+(define-obsolete-function-alias 'org-element-remove-indentation
+ 'org-remove-indentation "9.0")
+(define-obsolete-variable-alias 'org-latex-create-formula-image-program
+ 'org-preview-latex-default-process "9.0")
+(define-obsolete-variable-alias 'org-latex-preview-ltxpng-directory
+ 'org-preview-latex-image-directory "9.0")
+(define-obsolete-function-alias 'org-table-p 'org-at-table-p "9.0")
+(define-obsolete-function-alias 'org-on-heading-p 'org-at-heading-p "9.0")
+(define-obsolete-function-alias 'org-at-regexp-p 'org-in-regexp "8.3")
+(define-obsolete-function-alias 'org-image-file-name-regexp
+ 'image-file-name-regexp "9.0")
+(define-obsolete-function-alias 'org-completing-read-no-i
+ 'completing-read "9.0")
+(define-obsolete-function-alias 'org-icompleting-read
+ 'completing-read "9.0")
+(define-obsolete-function-alias 'org-iread-file-name 'read-file-name "9.0")
+(define-obsolete-function-alias 'org-days-to-time
+ 'org-time-stamp-to-now "8.2")
+(define-obsolete-variable-alias 'org-agenda-ignore-drawer-properties
+ 'org-agenda-ignore-properties "9.0")
+(define-obsolete-function-alias 'org-preview-latex-fragment
+ 'org-toggle-latex-fragment "8.3")
+(define-obsolete-function-alias 'org-export-get-genealogy
+ 'org-element-lineage "9.0")
+(define-obsolete-variable-alias 'org-latex-with-hyperref
+ 'org-latex-hyperref-template "9.0")
+(define-obsolete-variable-alias 'hfy-optimisations 'hfy-optimizations "9.0")
+(define-obsolete-variable-alias 'org-export-htmlized-org-css-url
+ 'org-org-htmlized-css-url "8.2")
+(define-obsolete-function-alias 'org-list-parse-list 'org-list-to-lisp "9.0")
+(define-obsolete-function-alias 'org-agenda-todayp
+ 'org-agenda-today-p "9.0")
+(define-obsolete-function-alias 'org-babel-examplize-region
+ 'org-babel-examplify-region "9.0")
+(define-obsolete-variable-alias 'org-babel-capitalize-example-region-markers
+ 'org-babel-uppercase-example-markers "9.1")
+
+(define-obsolete-function-alias 'org-babel-trim 'org-trim "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 "9.0")
+(define-obsolete-variable-alias 'org-export-babel-evaluate
+ 'org-export-use-babel "9.1")
+(define-obsolete-function-alias 'org-activate-bracket-links
+ 'org-activate-links "9.0")
+(define-obsolete-function-alias 'org-activate-plain-links 'ignore "9.0")
+(define-obsolete-function-alias 'org-activate-angle-links 'ignore "9.0")
+(define-obsolete-function-alias 'org-remove-double-quotes 'org-strip-quotes "9.0")
+(define-obsolete-function-alias 'org-get-indentation
+ 'current-indentation "9.2")
+(define-obsolete-function-alias 'org-capture-member 'org-capture-get "9.2")
+(define-obsolete-function-alias 'org-remove-from-invisibility-spec
+ 'remove-from-invisibility-spec "9.2")
+
+(define-obsolete-variable-alias 'org-effort-durations 'org-duration-units
+ "9.2")
+
+(define-obsolete-function-alias 'org-toggle-latex-fragment 'org-latex-preview
+ "9.3")
+
+(define-obsolete-function-alias 'org-remove-latex-fragment-image-overlays
+ 'org-clear-latex-preview "9.3")
+
+(define-obsolete-variable-alias 'org-attach-directory
+ 'org-attach-id-dir "9.3")
+(make-obsolete 'org-attach-store-link "No longer used" "9.4")
+(make-obsolete 'org-attach-expand-link "No longer used" "9.4")
+
+(define-obsolete-function-alias 'org-file-url-p 'org-url-p "9.5")
+
+(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"
+ "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." "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." "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 (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."
+ "9.0")
+
+(defmacro org-preserve-lc (&rest body)
+ (declare (debug (body))
+ (obsolete "please notify Org mailing list if you use this function."
+ "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."
+ "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 "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."
+ "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." "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." "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." "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 "9.1")
+
+(define-obsolete-function-alias 'org-hh:mm-string-to-minutes
+ 'org-duration-to-minutes "9.1")
+
+(define-obsolete-function-alias 'org-duration-string-to-minutes
+ 'org-duration-to-minutes "9.1")
+
+(make-obsolete-variable 'org-time-clocksum-format
+ "set `org-duration-format' instead." "9.1")
+
+(make-obsolete-variable 'org-time-clocksum-use-fractional
+ "set `org-duration-format' instead." "9.1")
+
+(make-obsolete-variable 'org-time-clocksum-fractional-format
+ "set `org-duration-format' instead." "9.1")
+
+(make-obsolete-variable 'org-time-clocksum-use-effort-durations
+ "set `org-duration-units' instead." "9.1")
+
+(define-obsolete-function-alias 'org-babel-number-p
+ 'org-babel--string-to-number "9.0")
+
+(define-obsolete-variable-alias 'org-usenet-links-prefer-google
+ 'org-gnus-prefer-web-links "9.1")
+
+(define-obsolete-variable-alias 'org-texinfo-def-table-markup
+ 'org-texinfo-table-default-markup "9.1")
+
+(define-obsolete-variable-alias 'org-agenda-overriding-columns-format
+ 'org-overriding-columns-format "9.2.2")
+
+(define-obsolete-variable-alias 'org-doi-server-url
+ 'org-link-doi-server-url "9.3")
+
+(define-obsolete-variable-alias 'org-email-link-description-format
+ 'org-link-email-description-format "9.3")
+
+(define-obsolete-variable-alias 'org-make-link-description-function
+ 'org-link-make-description-function "9.3")
+
+(define-obsolete-variable-alias 'org-from-is-user-regexp
+ 'org-link-from-user-regexp "9.3")
+
+(define-obsolete-variable-alias 'org-descriptive-links
+ 'org-link-descriptive "9.3")
+
+(define-obsolete-variable-alias 'org-context-in-file-links
+ 'org-link-context-for-files "9.3")
+
+(define-obsolete-variable-alias 'org-keep-stored-link-after-insertion
+ 'org-link-keep-stored-after-insertion "9.3")
+
+(define-obsolete-variable-alias 'org-display-internal-link-with-indirect-buffer
+ 'org-link-use-indirect-buffer-for-internals "9.3")
+
+(define-obsolete-variable-alias 'org-confirm-shell-link-function
+ 'org-link-shell-confirm-function "9.3")
+
+(define-obsolete-variable-alias 'org-confirm-shell-link-not-regexp
+ 'org-link-shell-skip-confirm-regexp "9.3")
+
+(define-obsolete-variable-alias 'org-confirm-elisp-link-function
+ 'org-link-elisp-confirm-function "9.3")
+
+(define-obsolete-variable-alias 'org-confirm-elisp-link-not-regexp
+ 'org-link-elisp-skip-confirm-regexp "9.3")
+
+(define-obsolete-function-alias 'org-file-complete-link
+ 'org-link-complete-file "9.3")
+
+(define-obsolete-function-alias 'org-email-link-description
+ 'org-link-email-description "9.3")
+
+(define-obsolete-function-alias 'org-make-link-string
+ 'org-link-make-string "9.3")
+
+(define-obsolete-function-alias 'org-store-link-props
+ 'org-link-store-props "9.3")
+
+(define-obsolete-function-alias 'org-add-link-props
+ 'org-link-add-props "9.3")
+
+(define-obsolete-function-alias 'org-make-org-heading-search-string
+ 'org-link-heading-search-string "9.3")
+
+(define-obsolete-function-alias 'org-make-link-regexps
+ 'org-link-make-regexps "9.3")
+
+(define-obsolete-function-alias 'org-property-global-value
+ 'org-property-global-or-keyword-value "9.3")
+
+(make-obsolete-variable 'org-file-properties 'org-keyword-properties "9.3")
+
+(define-obsolete-variable-alias 'org-angle-link-re
+ 'org-link-angle-re "9.3")
+
+(define-obsolete-variable-alias 'org-plain-link-re
+ 'org-link-plain-re "9.3")
+
+(define-obsolete-variable-alias 'org-bracket-link-regexp
+ 'org-link-bracket-re "9.3")
+
+(define-obsolete-variable-alias 'org-bracket-link-analytic-regexp
+ 'org-link-bracket-re "9.3")
+
+(define-obsolete-variable-alias 'org-any-link-re
+ 'org-link-any-re "9.3")
+
+(define-obsolete-function-alias 'org-open-link-from-string
+ 'org-link-open-from-string "9.3")
+
+(define-obsolete-function-alias 'org-add-angle-brackets
+ 'org-link-add-angle-brackets "9.3")
+
+;; 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."
+ "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."
+ "9.2")
+
+(define-obsolete-function-alias 'org-get-tags-at 'org-get-tags "9.2")
+
+(defun org-get-local-tags ()
+ "Get a list of tags defined in the current headline."
+ (declare (obsolete "use `org-get-tags' instead." "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." "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." "9.2"))
+ (org-make-tag-string (org-get-tags nil t)))
+
+(define-obsolete-function-alias 'org-set-tags-to 'org-set-tags "9.2")
+
+(defun org-align-all-tags ()
+ "Align the tags in all headings."
+ (declare (obsolete "use `org-align-tags' instead." "9.2"))
+ (org-align-tags t))
+
+(define-obsolete-function-alias
+ 'org-at-property-block-p 'org-at-property-drawer-p "9.4")
+
+(defun org-flag-drawer (flag &optional element beg end)
+ "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.
+
+When buffer positions BEG and END are provided, hide or show that
+region as a drawer without further ado."
+ (declare (obsolete "use `org-hide-drawer-toggle' instead." "9.4"))
+ (if (and beg end) (org-flag-region beg end flag 'outline)
+ (let ((drawer
+ (or element
+ (and (save-excursion
+ (beginning-of-line)
+ (looking-at-p "^[ \t]*:\\(\\(?:\\w\\|[-_]\\)+\\):[ \t]*$"))
+ (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 'outline)
+ ;; 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)))))))
+
+(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."
+ (declare (obsolete "use `org-hide-block-toggle' instead." "9.4"))
+ (interactive)
+ (org-hide-block-toggle nil t))
+
+(defun org-hide-block-toggle-all ()
+ "Toggle the visibility of all blocks in the current buffer."
+ (declare (obsolete "please notify Org mailing list if you use this function."
+ "9.4"))
+ (let ((start (point-min))
+ (end (point-max)))
+ (save-excursion
+ (goto-char start)
+ (while (and (< (point) end)
+ (re-search-forward "^[ \t]*#\\+begin_?\
+\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\([^\000]+?\\)#\\+end_?\\1[ \t]*$" end t))
+ (save-excursion
+ (save-match-data
+ (goto-char (match-beginning 0))
+ (org-hide-block-toggle)))))))
+
+(defun org-return-indent ()
+ "Goto next table row or insert a newline and indent.
+Calls `org-table-next-row' or `newline-and-indent', depending on
+context. See the individual commands for more information."
+ (declare (obsolete "use `org-return' with INDENT set to t instead."
+ "9.4"))
+ (interactive)
+ (org-return t))
+
+(defmacro org-with-silent-modifications (&rest body)
+ (declare (obsolete "use `with-silent-modifications' instead." "9.2")
+ (debug (body)))
+ `(with-silent-modifications ,@body))
+
+(define-obsolete-function-alias 'org-babel-strip-quotes
+ 'org-strip-quotes "9.2")
+
+(define-obsolete-variable-alias 'org-sort-agenda-notime-is-late
+ 'org-agenda-sort-notime-is-late "9.4")
+
+(define-obsolete-variable-alias 'org-sort-agenda-noeffort-is-high
+ 'org-agenda-sort-noeffort-is-high "9.4")
+
+(defconst org-maybe-keyword-time-regexp
+ (concat "\\(\\<\\(\\(?:CLO\\(?:CK\\|SED\\)\\|DEADLINE\\|SCHEDULED\\):\\)\\)?"
+ " *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^]\r\n>]*[]>]"
+ "\\|"
+ "<%%([^\r\n>]*>\\)")
+ "Matches a timestamp, possibly preceded by a keyword.")
+(make-obsolete-variable
+ 'org-maybe-keyword-time-regexp
+ "use `org-planning-line-re', followed by `org-ts-regexp-both' instead."
+ "9.4")
+
+(define-obsolete-function-alias 'org-copy 'org-refile-copy "9.4")
+
+(define-obsolete-function-alias 'org-get-last-sibling 'org-get-previous-sibling "9.4")
+
+;;;; Obsolete link types
+
+(eval-after-load 'ol
+ '(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.
+ (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)))
+ ;; Ignore checks in code, verbatim and others.
+ (org--flyspell-object-check-p (org-element-at-point)))
+ (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.
+(add-hook 'bookmark-after-jump-hook '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))
+ (when (and (boundp 'org-agenda-diary-file)
+ (not (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))
+
+;;;; Speed commands
+
+(make-obsolete-variable 'org-speed-commands-user
+ "configure `org-speed-commands' instead." "9.5")
+
+(provide 'org-compat)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-compat.el ends here
diff --git a/elpa/org-9.5.2/org-compat.elc b/elpa/org-9.5.2/org-compat.elc
new file mode 100644
index 0000000..9d984bc
--- /dev/null
+++ b/elpa/org-9.5.2/org-compat.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-crypt.el b/elpa/org-9.5.2/org-crypt.el
new file mode 100644
index 0000000..48f76b7
--- /dev/null
+++ b/elpa/org-9.5.2/org-crypt.el
@@ -0,0 +1,320 @@
+;;; org-crypt.el --- Public Key Encryption for Org Entries -*- lexical-binding: t; -*-
+;;
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+;; Author: John Wiegley <johnw@gnu.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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Right now this is just a set of functions to play with. It depends
+;; on the epg library. Here's how you would use it:
+;;
+;; 1. To mark an entry for encryption, tag the heading with "crypt".
+;; You can change the tag to any complex tag matching string by
+;; setting the `org-crypt-tag-matcher' variable.
+;;
+;; 2. Set the encryption key to use in the `org-crypt-key' variable,
+;; or use `M-x org-set-property' to set the property CRYPTKEY to
+;; any address in your public keyring. The text of the entry (but
+;; not its properties or headline) will be encrypted for this user.
+;; For them to read it, the corresponding secret key must be
+;; located in the secret key ring of the account where you try to
+;; decrypt it. This makes it possible to leave secure notes that
+;; only the intended recipient can read in a shared-org-mode-files
+;; scenario.
+;; If the key is not set, org-crypt will default to symmetric encryption.
+;;
+;; 3. To later decrypt an entry, use `org-decrypt-entries' or
+;; `org-decrypt-entry'. It might be useful to bind this to a key,
+;; like C-c C-/.
+;;
+;; 4. To automatically encrypt all necessary entries when saving a
+;; file, call `org-crypt-use-before-save-magic' after loading
+;; org-crypt.el.
+
+;;; Thanks:
+
+;; - Carsten Dominik
+;; - Vitaly Ostanin
+
+;;; Code:
+
+(require 'org-macs)
+(require 'org-compat)
+
+(declare-function epg-decrypt-string "epg" (context cipher))
+(declare-function epg-list-keys "epg" (context &optional name mode))
+(declare-function epg-make-context "epg"
+ (&optional protocol armor textmode include-certs
+ cipher-algorithm digest-algorithm
+ compress-algorithm))
+(declare-function epg-encrypt-string "epg"
+ (context plain recipients &optional sign always-trust))
+(defvar epg-context)
+
+(declare-function org-back-over-empty-lines "org" ())
+(declare-function org-back-to-heading "org" (&optional invisible-ok))
+(declare-function org-before-first-heading-p "org" ())
+(declare-function org-end-of-meta-data "org" (&optional full))
+(declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading))
+(declare-function org-entry-get "org" (pom property &optional inherit literal-nil))
+(declare-function org-flag-subtree "org" (flag))
+(declare-function org-make-tags-matcher "org" (match))
+(declare-function org-previous-visible-heading "org" (arg))
+(declare-function org-scan-tags "org" (action matcher todo-only &optional start-level))
+(declare-function org-set-property "org" (property value))
+
+(defgroup org-crypt nil
+ "Org Crypt."
+ :tag "Org Crypt"
+ :group 'org)
+
+(defcustom org-crypt-tag-matcher "crypt"
+ "The tag matcher used to find headings whose contents should be encrypted.
+
+See the \"Match syntax\" section of the org manual for more details."
+ :type 'string
+ :group 'org-crypt)
+
+(defcustom org-crypt-key ""
+ "The default key to use when encrypting the contents of a heading.
+
+If this variable is nil, always use symmetric encryption, unconditionally.
+
+Otherwise, The string is matched against all keys in the key ring.
+In particular, the empty string matches no key. If no key is found,
+look for the `epa-file-encrypt-to' local variable. Ultimately fall back
+to symmetric encryption.
+
+This setting can be overridden in the CRYPTKEY property."
+ :group 'org-crypt
+ :type '(choice
+ (string :tag "Public key(s) matching")
+ (const :tag "Symmetric encryption" nil)))
+
+(defcustom org-crypt-disable-auto-save 'ask
+ "What org-decrypt should do if `auto-save-mode' is enabled.
+
+t : Disable auto-save-mode for the current buffer
+ prior to decrypting an entry.
+
+nil : Leave auto-save-mode enabled.
+ This may cause data to be written to disk unencrypted!
+
+`ask' : Ask user whether or not to disable auto-save-mode
+ for the current buffer.
+
+`encrypt': Leave auto-save-mode enabled for the current buffer,
+ but automatically re-encrypt all decrypted entries
+ *before* auto-saving.
+ NOTE: This only works for entries which have a tag
+ that matches `org-crypt-tag-matcher'."
+ :group 'org-crypt
+ :version "24.1"
+ :type '(choice (const :tag "Always" t)
+ (const :tag "Never" nil)
+ (const :tag "Ask" ask)
+ (const :tag "Encrypt" encrypt)))
+
+(defun org-crypt--encrypted-text (beg end)
+ "Return encrypted text in between BEG and END."
+ ;; Ignore indentation.
+ (replace-regexp-in-string
+ "^[ \t]*" ""
+ (buffer-substring-no-properties beg end)))
+
+(defun org-at-encrypted-entry-p ()
+ "Is the current entry encrypted?
+When the entry is encrypted, return a pair (BEG . END) where BEG
+and END are buffer positions delimiting the encrypted area."
+ (org-with-wide-buffer
+ (unless (org-before-first-heading-p)
+ (org-back-to-heading t)
+ (org-end-of-meta-data 'standard)
+ (let ((case-fold-search nil)
+ (banner-start (rx (seq bol
+ (zero-or-more (any "\t "))
+ "-----BEGIN PGP MESSAGE-----"
+ eol))))
+ (when (looking-at banner-start)
+ (let ((start (point))
+ (banner-end (rx (seq bol
+ (or (group (zero-or-more (any "\t "))
+ "-----END PGP MESSAGE-----"
+ eol)
+ (seq (one-or-more "*") " "))))))
+ (when (and (re-search-forward banner-end nil t) (match-string 1))
+ (cons start (line-beginning-position 2)))))))))
+
+(defun org-crypt-check-auto-save ()
+ "Check whether auto-save-mode is enabled for the current buffer.
+
+`auto-save-mode' may cause leakage when decrypting entries, so
+check whether it's enabled, and decide what to do about it.
+
+See `org-crypt-disable-auto-save'."
+ (when buffer-auto-save-file-name
+ (cond
+ ((or
+ (eq org-crypt-disable-auto-save t)
+ (and
+ (eq org-crypt-disable-auto-save 'ask)
+ (y-or-n-p "org-decrypt: auto-save-mode may cause leakage. Disable it for current buffer? ")))
+ (message "org-decrypt: Disabling auto-save-mode for %s"
+ (or (buffer-file-name) (current-buffer)))
+ ;; The argument to auto-save-mode has to be "-1", since
+ ;; giving a "nil" argument toggles instead of disabling.
+ (auto-save-mode -1))
+ ((eq org-crypt-disable-auto-save nil)
+ (message "org-decrypt: Decrypting entry with auto-save-mode enabled. This may cause leakage."))
+ ((eq org-crypt-disable-auto-save 'encrypt)
+ (message "org-decrypt: Enabling re-encryption on auto-save.")
+ (add-hook 'auto-save-hook
+ (lambda ()
+ (message "org-crypt: Re-encrypting all decrypted entries due to auto-save.")
+ (org-encrypt-entries))
+ nil t))
+ (t nil))))
+
+(defun org-crypt-key-for-heading ()
+ "Return the encryption key(s) for the current heading.
+Assume `epg-context' is set."
+ (and org-crypt-key
+ (or (epg-list-keys epg-context
+ (or (org-entry-get nil "CRYPTKEY" 'selective)
+ org-crypt-key))
+ (bound-and-true-p epa-file-encrypt-to)
+ (progn
+ (message "No crypt key set, using symmetric encryption.")
+ nil))))
+
+;;;###autoload
+(defun org-encrypt-entry ()
+ "Encrypt the content of the current headline."
+ (interactive)
+ (unless (org-at-encrypted-entry-p)
+ (require 'epg)
+ (setq-local epg-context (epg-make-context nil t t))
+ (org-with-wide-buffer
+ (org-back-to-heading t)
+ (let ((start-heading (point))
+ (crypt-key (org-crypt-key-for-heading))
+ (folded? (org-invisible-p (line-beginning-position))))
+ (org-end-of-meta-data 'standard)
+ (let ((beg (point))
+ (folded-heading
+ (and folded?
+ (save-excursion
+ (org-previous-visible-heading 1)
+ (point)))))
+ (goto-char start-heading)
+ (org-end-of-subtree t t)
+ (org-back-over-empty-lines)
+ (let* ((contents (delete-and-extract-region beg (point)))
+ (key (get-text-property 0 'org-crypt-key contents))
+ (checksum (get-text-property 0 'org-crypt-checksum contents)))
+ (condition-case err
+ (insert
+ ;; Text and key have to be identical, otherwise we
+ ;; re-crypt.
+ (if (and (equal crypt-key key)
+ (string= checksum (sha1 contents)))
+ (get-text-property 0 'org-crypt-text contents)
+ (epg-encrypt-string epg-context contents crypt-key)))
+ ;; If encryption failed, make sure to insert back entry
+ ;; contents in the buffer.
+ (error
+ (insert contents)
+ (error (error-message-string err)))))
+ (when folded-heading
+ (goto-char folded-heading)
+ (org-flag-subtree t))
+ nil)))))
+
+;;;###autoload
+(defun org-decrypt-entry ()
+ "Decrypt the content of the current headline."
+ (interactive)
+ (pcase (org-at-encrypted-entry-p)
+ (`(,beg . ,end)
+ (require 'epg)
+ (setq-local epg-context (epg-make-context nil t t))
+ (org-with-point-at beg
+ (org-crypt-check-auto-save)
+ (let* ((folded-heading
+ (and (org-invisible-p)
+ (save-excursion
+ (org-previous-visible-heading 1)
+ (point))))
+ (encrypted-text (org-crypt--encrypted-text beg end))
+ (decrypted-text
+ (decode-coding-string
+ (epg-decrypt-string epg-context encrypted-text)
+ 'utf-8)))
+ ;; Delete region starting just before point, because the
+ ;; outline property starts at the \n of the heading.
+ (delete-region (1- (point)) end)
+ ;; Store a checksum of the decrypted and the encrypted text
+ ;; value. This allows reusing the same encrypted text if the
+ ;; text does not change, and therefore avoid a re-encryption
+ ;; process.
+ (insert "\n"
+ (propertize decrypted-text
+ 'org-crypt-checksum (sha1 decrypted-text)
+ 'org-crypt-key (org-crypt-key-for-heading)
+ 'org-crypt-text encrypted-text))
+ (when folded-heading
+ (goto-char folded-heading)
+ (org-flag-subtree t))
+ nil)))
+ (_ nil)))
+
+(defvar org--matcher-tags-todo-only)
+
+;;;###autoload
+(defun org-encrypt-entries ()
+ "Encrypt all top-level entries in the current buffer."
+ (interactive)
+ (let ((org--matcher-tags-todo-only nil))
+ (org-scan-tags
+ 'org-encrypt-entry
+ (cdr (org-make-tags-matcher org-crypt-tag-matcher))
+ org--matcher-tags-todo-only)))
+
+;;;###autoload
+(defun org-decrypt-entries ()
+ "Decrypt all entries in the current buffer."
+ (interactive)
+ (let ((org--matcher-tags-todo-only nil))
+ (org-scan-tags
+ 'org-decrypt-entry
+ (cdr (org-make-tags-matcher org-crypt-tag-matcher))
+ org--matcher-tags-todo-only)))
+
+;;;###autoload
+(defun org-crypt-use-before-save-magic ()
+ "Add a hook to automatically encrypt entries before a file is saved to disk."
+ (add-hook
+ 'org-mode-hook
+ (lambda () (add-hook 'before-save-hook 'org-encrypt-entries nil t))))
+
+(add-hook 'org-reveal-start-hook 'org-decrypt-entry)
+
+(provide 'org-crypt)
+
+;;; org-crypt.el ends here
diff --git a/elpa/org-9.5.2/org-crypt.elc b/elpa/org-9.5.2/org-crypt.elc
new file mode 100644
index 0000000..8602773
--- /dev/null
+++ b/elpa/org-9.5.2/org-crypt.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-ctags.el b/elpa/org-9.5.2/org-ctags.el
new file mode 100644
index 0000000..7876c6e
--- /dev/null
+++ b/elpa/org-9.5.2/org-ctags.el
@@ -0,0 +1,534 @@
+;;; org-ctags.el --- Integrate Emacs "tags" Facility with Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+;; Author: Paul Sexton <eeeickythump@gmail.com>
+;; Keywords: org, 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;
+;; Synopsis
+;; ========
+;;
+;; Allows Org mode to make use of the Emacs `etags' system. Defines
+;; tag destinations in Org files as any text between <<double angled
+;; brackets>>. This allows the tags-generation program `exuberant
+;; ctags' to parse these files and create tag tables that record where
+;; these destinations are found. Plain [[links]] in org mode files
+;; which do not have <<matching destinations>> within the same file
+;; will then be interpreted as links to these 'tagged' destinations,
+;; allowing seamless navigation between multiple Org files. Topics
+;; can be created in any org mode file and will always be found by
+;; plain links from other files. Other file types recognized by ctags
+;; (source code files, latex files, etc) will also be available as
+;; destinations for plain links, and similarly, Org links will be
+;; available as tags from source files. Finally, the function
+;; `org-ctags-find-tag-interactive' lets you choose any known tag,
+;; using autocompletion, and quickly jump to it.
+;;
+;; Installation
+;; ============
+;;
+;; Install org mode
+;; Ensure org-ctags.el is somewhere in your emacs load path.
+;; Download and install Exuberant ctags -- "http://ctags.sourceforge.net/"
+;; Edit your .emacs file (see next section) and load emacs.
+
+;; To put in your init file (.emacs):
+;; ==================================
+;;
+;; Assuming you already have org mode installed and set up:
+;;
+;; (setq org-ctags-path-to-ctags "/path/to/ctags/executable")
+;; (add-hook 'org-mode-hook
+;; (lambda ()
+;; (define-key org-mode-map "\C-co" 'org-ctags-find-tag-interactive)))
+;;
+;; By default, with org-ctags loaded, org will first try and visit the tag
+;; with the same name as the link; then, if unsuccessful, ask the user if
+;; he/she wants to rebuild the 'TAGS' database and try again; then ask if
+;; the user wishes to append 'tag' as a new toplevel heading at the end of
+;; the buffer; and finally, defer to org's default behavior which is to
+;; search the entire text of the current buffer for 'tag'.
+;;
+;; This behavior can be modified by changing the value of
+;; ORG-CTAGS-OPEN-LINK-FUNCTIONS. For example I have the following in my
+;; .emacs, which describes the same behavior as the above paragraph with
+;; one difference:
+;;
+;; (setq org-ctags-open-link-functions
+;; '(org-ctags-find-tag
+;; org-ctags-ask-rebuild-tags-file-then-find-tag
+;; org-ctags-ask-append-topic
+;; org-ctags-fail-silently)) ; <-- prevents org default behavior
+;;
+;;
+;; Usage
+;; =====
+;;
+;; When you click on a link "[[foo]]" and org cannot find a matching "<<foo>>"
+;; in the current buffer, the tags facility will take over. The file TAGS in
+;; the active directory is examined to see if the tags facility knows about
+;; "<<foo>>" in any other files. If it does, the matching file will be opened
+;; and the cursor will jump to the position of "<<foo>>" in that file.
+;;
+;; User-visible functions:
+;; - `org-ctags-find-tag-interactive': type a tag (plain link) name and visit
+;; it. With autocompletion. Bound to ctrl-O in the above setup.
+;; - All the etags functions should work. These include:
+;;
+;; M-. `find-tag' -- finds the tag at point
+;;
+;; C-M-. find-tag based on regular expression
+;;
+;; M-x tags-search RET -- like C-M-. but searches through ENTIRE TEXT
+;; of ALL the files referenced in the TAGS file. A quick way to
+;; search through an entire 'project'.
+;;
+;; M-* "go back" from a tag jump. Like `org-mark-ring-goto'.
+;; You may need to bind this key yourself with (eg)
+;; (global-set-key (kbd "<M-kp-multiply>") 'pop-tag-mark)
+;;
+;; (see etags chapter in Emacs manual for more)
+;;
+;;
+;; Keeping the TAGS file up to date
+;; ================================
+;;
+;; Tags mode has no way of knowing that you have created new tags by
+;; typing in your Org buffer. New tags make it into the TAGS file in
+;; 3 ways:
+;;
+;; 1. You re-run (org-ctags-create-tags "directory") to rebuild the file.
+;; 2. You put the function `org-ctags-ask-rebuild-tags-file-then-find-tag' in
+;; your `org-open-link-functions' list, as is done in the setup
+;; above. This will cause the TAGS file to be rebuilt whenever a link
+;; cannot be found. This may be slow with large file collections however.
+;; 3. You run the following from the command line (all 1 line):
+;;
+;; ctags --langdef=orgmode --langmap=orgmode:.org
+;; --regex-orgmode="/<<([^>]+)>>/\1/d,definition/"
+;; -f /your/path/TAGS -e -R /your/path/*.org
+;;
+;; If you are paranoid, you might want to run (org-ctags-create-tags
+;; "/path/to/org/files") at startup, by including the following toplevel form
+;; in .emacs. However this can cause a pause of several seconds if ctags has
+;; to scan lots of files.
+;;
+;; (progn
+;; (message "-- rebuilding tags tables...")
+;; (mapc 'org-ctags-create-tags tags-table-list))
+
+;;; Code:
+
+(eval-when-compile (require 'cl-lib))
+(require 'org)
+
+(defgroup org-ctags nil
+ "Options concerning use of ctags within org mode."
+ :tag "Org-Ctags"
+ :group 'org-link)
+
+(defvar org-ctags-enabled-p t
+ "Activate ctags support in org mode?")
+
+(defvar org-ctags-tag-regexp "/<<([^>]+)>>/\\1/d,definition/"
+ "Regexp expression used by ctags external program.
+The regexp matches tag destinations in Org files.
+Format is: /REGEXP/TAGNAME/FLAGS,TAGTYPE/
+See the ctags documentation for more information.")
+
+(defcustom org-ctags-path-to-ctags
+ (if (executable-find "ctags-exuberant") "ctags-exuberant" "ctags")
+ "Name of the ctags executable file."
+ :group 'org-ctags
+ :version "24.1"
+ :type 'file)
+
+(defcustom org-ctags-open-link-functions
+ '(org-ctags-find-tag
+ org-ctags-ask-rebuild-tags-file-then-find-tag
+ org-ctags-ask-append-topic)
+ "List of functions to be prepended to ORG-OPEN-LINK-FUNCTIONS by ORG-CTAGS."
+ :group 'org-ctags
+ :version "24.1"
+ :type 'hook
+ :options '(org-ctags-find-tag
+ org-ctags-ask-rebuild-tags-file-then-find-tag
+ org-ctags-rebuild-tags-file-then-find-tag
+ org-ctags-ask-append-topic
+ org-ctags-append-topic
+ org-ctags-ask-visit-buffer-or-file
+ org-ctags-visit-buffer-or-file
+ org-ctags-fail-silently))
+
+
+(defvar org-ctags-tag-list nil
+ "List of all tags in the active TAGS file.
+Created as a local variable in each buffer.")
+
+(defcustom org-ctags-new-topic-template
+ "* <<%t>>\n\n\n\n\n\n"
+ "Text to insert when creating a new org file via opening a hyperlink.
+The following patterns are replaced in the string:
+ `%t' - replaced with the capitalized title of the hyperlink"
+ :group 'org-ctags
+ :version "24.1"
+ :type 'string)
+
+
+(add-hook 'org-mode-hook
+ (lambda ()
+ (when (and org-ctags-enabled-p
+ (buffer-file-name))
+ ;; Make sure this file's directory is added to default
+ ;; directories in which to search for tags.
+ (let ((tags-filename
+ (expand-file-name
+ (concat (file-name-directory (buffer-file-name))
+ "/TAGS"))))
+ (when (file-exists-p tags-filename)
+ (visit-tags-table tags-filename))))))
+
+
+(defadvice visit-tags-table (after org-ctags-load-tag-list activate compile)
+ (when (and org-ctags-enabled-p tags-file-name)
+ (setq-local org-ctags-tag-list
+ (org-ctags-all-tags-in-current-tags-table))))
+
+
+(defun org-ctags-enable ()
+ (put 'org-mode 'find-tag-default-function 'org-ctags-find-tag-at-point)
+ (setq org-ctags-enabled-p t)
+ (dolist (fn org-ctags-open-link-functions)
+ (add-hook 'org-open-link-functions fn t)))
+
+
+;;; General utility functions. ===============================================
+;; These work outside org-ctags mode.
+
+(defun org-ctags-get-filename-for-tag (tag)
+ "TAG is a string. Search the active TAGS file for a matching tag.
+If the tag is found, return a list containing the filename, line number, and
+buffer position where the tag is found."
+ (interactive "sTag: ")
+ (unless tags-file-name
+ (call-interactively (visit-tags-table)))
+ (save-excursion
+ (visit-tags-table-buffer 'same)
+ (when tags-file-name
+ (with-current-buffer (get-file-buffer tags-file-name)
+ (goto-char (point-min))
+ (cond
+ ((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))))
+ (cond
+ ((re-search-backward " \n\\(.*\\),[0-9]+\n")
+ (list (match-string 1) line pos))
+ (t ; can't find a file name preceding the matched
+ ; tag??
+ (error "Malformed TAGS file: %s" (buffer-name))))))
+ (t ; tag not found
+ nil))))))
+
+
+(defun org-ctags-all-tags-in-current-tags-table ()
+ "Read all tags defined in the active TAGS file, into a list of strings.
+Return the list."
+ (interactive)
+ (let ((taglist nil))
+ (unless tags-file-name
+ (call-interactively (visit-tags-table)))
+ (save-excursion
+ (visit-tags-table-buffer 'same)
+ (with-current-buffer (get-file-buffer tags-file-name)
+ (goto-char (point-min))
+ (while (re-search-forward "^.*\^?\\(.*\\)\^A\\([0-9]+\\),\\([0-9]+\\)$"
+ nil t)
+ (push (substring-no-properties (match-string 1)) taglist)))
+ taglist)))
+
+
+(defun org-ctags-string-search-and-replace (search replace string)
+ "Replace all instances of SEARCH with REPLACE in STRING."
+ (replace-regexp-in-string (regexp-quote search) replace string t t))
+
+
+;;; Internal functions =======================================================
+
+
+(defun org-ctags-open-file (name &optional title)
+ "Visit or create a file called `NAME.org', and insert a new topic.
+The new topic will be titled NAME (or TITLE if supplied)."
+ (interactive "sFile name: ")
+ (condition-case v
+ (progn
+ (org-open-file name t)
+ (message "Opened file OK")
+ (goto-char (point-max))
+ (insert (org-ctags-string-search-and-replace
+ "%t" (capitalize (or title name))
+ org-ctags-new-topic-template))
+ (message "Inserted new file text OK")
+ (org-mode-restart))
+ (error (error "Error %S in org-ctags-open-file" v))))
+
+
+;;;; Misc interoperability with etags system =================================
+
+
+(defadvice xref-find-definitions
+ (before org-ctags-set-org-mark-before-finding-tag activate compile)
+ "Before trying to find a tag, save our current position on org mark ring."
+ (save-excursion
+ (when (and (derived-mode-p 'org-mode) org-ctags-enabled-p)
+ (org-mark-ring-push))))
+
+
+
+(defun org-ctags-find-tag-at-point ()
+ "Determine default tag to search for, based on text at point.
+If there is no plausible default, return nil."
+ (let (from to bound)
+ (when (or (ignore-errors
+ ;; Look for hyperlink around `point'.
+ (save-excursion
+ (search-backward "[[") (setq from (+ 2 (point))))
+ (save-excursion
+ (goto-char from)
+ (search-forward "]") (setq to (- (point) 1)))
+ (and (> to from) (>= (point) from) (<= (point) to)))
+ (progn
+ ;; Look at text around `point'.
+ (save-excursion
+ (skip-syntax-backward "w_") (setq from (point)))
+ (save-excursion
+ (skip-syntax-forward "w_") (setq to (point)))
+ (> to from))
+ ;; Look between `line-beginning-position' and `point'.
+ (save-excursion
+ (and (setq bound (line-beginning-position))
+ (skip-syntax-backward "^w_" bound)
+ (> (setq to (point)) bound)
+ (skip-syntax-backward "w_")
+ (setq from (point))))
+ ;; Look between `point' and `line-end-position'.
+ (save-excursion
+ (and (setq bound (line-end-position))
+ (skip-syntax-forward "^w_" bound)
+ (< (setq from (point)) bound)
+ (skip-syntax-forward "w_")
+ (setq to (point)))))
+ (buffer-substring-no-properties from to))))
+
+
+;;; Functions for use with 'org-open-link-functions' hook =================
+
+
+(defun org-ctags-find-tag (name)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Look for a tag called `NAME' in the current TAGS table. If it is found,
+visit the file and location where the tag is found."
+ (interactive "sTag: ")
+ (let ((old-buf (current-buffer))
+ (old-pnt (point-marker))
+ (old-mark (copy-marker (mark-marker))))
+ (condition-case nil
+ (progn (xref-find-definitions name)
+ t)
+ (error
+ ;; only restore old location if find-tag raises error
+ (set-buffer old-buf)
+ (goto-char old-pnt)
+ (set-marker (mark-marker) old-mark)
+ nil))))
+
+
+(defun org-ctags-visit-buffer-or-file (name &optional create)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Visit buffer named `NAME.org'. If there is no such buffer, visit the file
+with the same name if it exists. If the file does not exist, then behavior
+depends on the value of CREATE.
+
+If CREATE is nil (default), then return nil. Do not create a new file.
+If CREATE is t, create the new file and visit it.
+If CREATE is the symbol `ask', then ask the user if they wish to create
+the new file."
+ (interactive)
+ (let ((filename (concat (substitute-in-file-name
+ (expand-file-name name))
+ ".org")))
+ (cond
+ ((get-buffer (concat name ".org"))
+ ;; Buffer is already open
+ (pop-to-buffer-same-window (get-buffer (concat name ".org"))))
+ ((file-exists-p filename)
+ ;; File exists but is not open --> open it
+ (message "Opening existing org file `%S'..."
+ filename)
+ (org-open-file filename t))
+ ((or (eql create t)
+ (and (eql create 'ask)
+ (y-or-n-p (format-message
+ "File `%s.org' not found; create?" name))))
+ (org-ctags-open-file filename name))
+ (t ;; File does not exist, and we don't want to create it.
+ nil))))
+
+
+(defun org-ctags-ask-visit-buffer-or-file (name)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Wrapper for org-ctags-visit-buffer-or-file, which ensures the user is
+asked before creating a new file."
+ (org-ctags-visit-buffer-or-file name 'ask))
+
+
+(defun org-ctags-append-topic (name &optional narrowp)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Append a new toplevel heading to the end of the current buffer. The
+heading contains NAME surrounded by <<angular brackets>>, thus making
+the heading a destination for the tag `NAME'."
+ (interactive "sTopic: ")
+ (widen)
+ (goto-char (point-max))
+ (newline 2)
+ (message "Adding topic in buffer %s" (buffer-name))
+ (insert (org-ctags-string-search-and-replace
+ "%t" (capitalize name) org-ctags-new-topic-template))
+ (backward-char 4)
+ (end-of-line)
+ (forward-line 2)
+ (when narrowp
+ ;;(org-tree-to-indirect-buffer 1) ;; opens new frame
+ (org-narrow-to-subtree))
+ t)
+
+
+(defun org-ctags-ask-append-topic (name &optional narrowp)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Wrapper for org-ctags-append-topic, which first asks the user if they want
+to append a new topic."
+ (if (y-or-n-p (format-message
+ "Topic `%s' not found; append to end of buffer?" name))
+ (org-ctags-append-topic name narrowp)
+ nil))
+
+
+(defun org-ctags-rebuild-tags-file-then-find-tag (name)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Like ORG-CTAGS-FIND-TAG, but calls the external ctags program first,
+to rebuild (update) the TAGS file."
+ (unless tags-file-name
+ (call-interactively (visit-tags-table)))
+ (when (buffer-file-name)
+ (org-ctags-create-tags))
+ (org-ctags-find-tag name))
+
+
+(defun org-ctags-ask-rebuild-tags-file-then-find-tag (name)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Wrapper for org-ctags-rebuild-tags-file-then-find-tag."
+ (if (and (buffer-file-name)
+ (y-or-n-p
+ (format-message
+ "Tag `%s' not found. Rebuild table `%s/TAGS' and look again?"
+ name
+ (file-name-directory (buffer-file-name)))))
+ (org-ctags-rebuild-tags-file-then-find-tag name)
+ nil))
+
+
+(defun org-ctags-fail-silently (_name)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Put as the last function in the list if you want to prevent Org's
+default behavior of free text search."
+ t)
+
+
+;;; User-visible functions ===================================================
+
+
+(defun org-ctags-create-tags (&optional directory-name)
+ "(Re)create tags file in the directory of the active buffer.
+The file will contain tag definitions for all the files in the
+directory and its subdirectories which are recognized by ctags.
+This will include files ending in `.org' as well as most other
+source files (.C, .H, .EL, .LISP, etc). All the resulting tags
+end up in one file, called TAGS, located in the directory. This
+function may take several seconds to finish if the directory or
+its subdirectories contain large numbers of taggable files."
+ (interactive)
+ (cl-assert (buffer-file-name))
+ (let ((dir-name (or directory-name
+ (file-name-directory (buffer-file-name))))
+ (exitcode nil))
+ (save-excursion
+ (setq exitcode
+ (shell-command
+ (format (concat "%s --langdef=orgmode --langmap=orgmode:.org "
+ "--regex-orgmode=\"%s\" -f \"%s\" -e -R \"%s\"")
+ org-ctags-path-to-ctags
+ org-ctags-tag-regexp
+ (expand-file-name (concat dir-name "/TAGS"))
+ (expand-file-name (concat dir-name "/*")))))
+ (cond
+ ((eql 0 exitcode)
+ (setq-local org-ctags-tag-list
+ (org-ctags-all-tags-in-current-tags-table)))
+ (t
+ ;; This seems to behave differently on Linux, so just ignore
+ ;; error codes for now
+ ;;(error "Calling ctags executable resulted in error code: %s"
+ ;; exitcode)
+ nil)))))
+
+
+(defvar org-ctags-find-tag-history nil
+ "History of tags visited by org-ctags-find-tag-interactive.")
+
+(defun org-ctags-find-tag-interactive ()
+ "Prompt for the name of a tag, with autocompletion, then visit the named tag.
+Uses `ido-mode' if available.
+If the user enters a string that does not match an existing tag, create
+a new topic."
+ (interactive)
+ (let* ((completing-read-fn (if (fboundp 'ido-completing-read)
+ 'ido-completing-read
+ 'completing-read))
+ (tag (funcall completing-read-fn "Topic: " org-ctags-tag-list
+ nil 'confirm nil 'org-ctags-find-tag-history)))
+ (when tag
+ (cond
+ ((member tag org-ctags-tag-list)
+ ;; Existing tag
+ (push tag org-ctags-find-tag-history)
+ (xref-find-definitions tag))
+ (t
+ ;; New tag
+ (run-hook-with-args-until-success
+ 'org-open-link-functions tag))))))
+
+
+(org-ctags-enable)
+
+(provide 'org-ctags)
+
+;;; org-ctags.el ends here
diff --git a/elpa/org-9.5.2/org-ctags.elc b/elpa/org-9.5.2/org-ctags.elc
new file mode 100644
index 0000000..fbcc974
--- /dev/null
+++ b/elpa/org-9.5.2/org-ctags.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-datetree.el b/elpa/org-9.5.2/org-datetree.el
new file mode 100644
index 0000000..74442b0
--- /dev/null
+++ b/elpa/org-9.5.2/org-datetree.el
@@ -0,0 +1,270 @@
+;;; org-datetree.el --- Create date entries in a tree -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file contains code to create entries in a tree where the top-level
+;; nodes represent years, the level 2 nodes represent the months, and the
+;; level 1 entries days.
+
+;;; Code:
+
+(require 'org)
+
+(defvar org-datetree-base-level 1
+ "The level at which years should be placed in the date tree.
+This is normally one, but if the buffer has an entry with a
+DATE_TREE (or WEEK_TREE for ISO week entries) property (any
+value), the date tree will become a subtree under that entry, so
+the base level will be properly adjusted.")
+
+(defcustom org-datetree-add-timestamp nil
+ "When non-nil, add a time stamp matching date of entry.
+Added time stamp is active unless value is `inactive'."
+ :group 'org-capture
+ :version "24.3"
+ :type '(choice
+ (const :tag "Do not add a time stamp" nil)
+ (const :tag "Add an inactive time stamp" inactive)
+ (const :tag "Add an active time stamp" active)))
+
+;;;###autoload
+(defun org-datetree-find-date-create (d &optional keep-restriction)
+ "Find or create a day entry for date D.
+If KEEP-RESTRICTION is non-nil, do not widen the buffer.
+When it is nil, the buffer will be widened to make sure an existing date
+tree can be found. If it is the symbol `subtree-at-point', then the tree
+will be built under the headline at point."
+ (org-datetree--find-create-group d 'day keep-restriction))
+
+;;;###autoload
+(defun org-datetree-find-month-create (d &optional keep-restriction)
+ "Find or create a month entry for date D.
+Compared to `org-datetree-find-date-create' this function creates
+entries grouped by month instead of days.
+If KEEP-RESTRICTION is non-nil, do not widen the buffer.
+When it is nil, the buffer will be widened to make sure an existing date
+tree can be found. If it is the symbol `subtree-at-point', then the tree
+will be built under the headline at point."
+ (org-datetree--find-create-group d 'month keep-restriction))
+
+(defun org-datetree--find-create-group
+ (d time-grouping &optional keep-restriction)
+ "Find or create an entry for date D.
+If time-period is day, group entries by day.
+If time-period is month, then group entries by month."
+ (setq-local org-datetree-base-level 1)
+ (save-restriction
+ (if (eq keep-restriction 'subtree-at-point)
+ (progn
+ (unless (org-at-heading-p) (error "Not at heading"))
+ (widen)
+ (org-narrow-to-subtree)
+ (setq-local org-datetree-base-level
+ (org-get-valid-level (org-current-level) 1)))
+ (unless keep-restriction (widen))
+ ;; Support the old way of tree placement, using a property
+ (let ((prop (org-find-property "DATE_TREE")))
+ (when prop
+ (goto-char prop)
+ (setq-local org-datetree-base-level
+ (org-get-valid-level (org-current-level) 1))
+ (org-narrow-to-subtree))))
+ (goto-char (point-min))
+ (let ((year (calendar-extract-year d))
+ (month (calendar-extract-month d))
+ (day (calendar-extract-day d)))
+ (org-datetree--find-create
+ "^\\*+[ \t]+\\([12][0-9]\\{3\\}\\)\\(\\s-*?\
+\\([ \t]:[[:alnum:]:_@#%%]+:\\)?\\s-*$\\)"
+ year)
+ (org-datetree--find-create
+ "^\\*+[ \t]+%d-\\([01][0-9]\\) \\w+$"
+ year month)
+ (when (eq time-grouping 'day)
+ (org-datetree--find-create
+ "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\) \\w+$"
+ year month day)))))
+
+;;;###autoload
+(defun org-datetree-find-iso-week-create (d &optional keep-restriction)
+ "Find or create an ISO week entry for date D.
+Compared to `org-datetree-find-date-create' this function creates
+entries ordered by week instead of months.
+When it is nil, the buffer will be widened to make sure an existing date
+tree can be found. If it is the symbol `subtree-at-point', then the tree
+will be built under the headline at point."
+ (setq-local org-datetree-base-level 1)
+ (save-restriction
+ (if (eq keep-restriction 'subtree-at-point)
+ (progn
+ (unless (org-at-heading-p) (error "Not at heading"))
+ (widen)
+ (org-narrow-to-subtree)
+ (setq-local org-datetree-base-level
+ (org-get-valid-level (org-current-level) 1)))
+ (unless keep-restriction (widen))
+ ;; Support the old way of tree placement, using a property
+ (let ((prop (org-find-property "WEEK_TREE")))
+ (when prop
+ (goto-char prop)
+ (setq-local org-datetree-base-level
+ (org-get-valid-level (org-current-level) 1))
+ (org-narrow-to-subtree))))
+ (goto-char (point-min))
+ (require 'cal-iso)
+ (let* ((year (calendar-extract-year d))
+ (month (calendar-extract-month d))
+ (day (calendar-extract-day d))
+ (time (encode-time 0 0 0 day month year))
+ (iso-date (calendar-iso-from-absolute
+ (calendar-absolute-from-gregorian d)))
+ (weekyear (nth 2 iso-date))
+ (week (nth 0 iso-date)))
+ ;; ISO 8601 week format is %G-W%V(-%u)
+ (org-datetree--find-create
+ "^\\*+[ \t]+\\([12][0-9]\\{3\\}\\)\\(\\s-*?\
+\\([ \t]:[[:alnum:]:_@#%%]+:\\)?\\s-*$\\)"
+ weekyear nil nil
+ (format-time-string "%G" time))
+ (org-datetree--find-create
+ "^\\*+[ \t]+%d-W\\([0-5][0-9]\\)$"
+ weekyear week nil
+ (format-time-string "%G-W%V" time))
+ ;; For the actual day we use the regular date instead of ISO week.
+ (org-datetree--find-create
+ "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\) \\w+$"
+ year month day))))
+
+(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-template year month day))
+ match)
+ (goto-char (point-min))
+ (while (and (setq match (re-search-forward re nil t))
+ (goto-char (match-beginning 1))
+ (< (string-to-number (match-string 1)) (or day month year))))
+ (cond
+ ((not match)
+ (goto-char (point-max))
+ (unless (bolp) (insert "\n"))
+ (org-datetree-insert-line year month day insert))
+ ((= (string-to-number (match-string 1)) (or day month year))
+ (beginning-of-line))
+ (t
+ (beginning-of-line)
+ (org-datetree-insert-line year month day insert)))))
+
+(defun org-datetree-insert-line (year &optional month day text)
+ (delete-region (save-excursion (skip-chars-backward " \t\n") (point)) (point))
+ (when (assq 'heading org-blank-before-new-entry)
+ (insert "\n"))
+ (insert "\n" (make-string org-datetree-base-level ?*) " \n")
+ (backward-char)
+ (when month (org-do-demote))
+ (when day (org-do-demote))
+ (if text
+ (insert text)
+ (insert (format "%d" year))
+ (when month
+ (insert
+ (if day
+ (format-time-string "-%m-%d %A" (encode-time 0 0 0 day month year))
+ (format-time-string "-%m %B" (encode-time 0 0 0 1 month year))))))
+ (when (and day org-datetree-add-timestamp)
+ (save-excursion
+ (insert "\n")
+ (org-indent-line)
+ (org-insert-time-stamp
+ (encode-time 0 0 0 day month year)
+ nil
+ (eq org-datetree-add-timestamp 'inactive))))
+ (beginning-of-line))
+
+(defun org-datetree-file-entry-under (txt d)
+ "Insert a node TXT into the date tree under date D."
+ (org-datetree-find-date-create d)
+ (let ((level (org-get-valid-level (funcall outline-level) 1)))
+ (org-end-of-subtree t t)
+ (org-back-over-empty-lines)
+ (org-paste-subtree level txt)))
+
+(defun org-datetree-cleanup ()
+ "Make sure all entries in the current tree are under the correct date.
+It may be useful to restrict the buffer to the applicable portion
+before running this command, even though the command tries to be smart."
+ (interactive)
+ (goto-char (point-min))
+ (let ((dre (concat "\\<" org-deadline-string "\\>[ \t]*\\'"))
+ (sre (concat "\\<" org-scheduled-string "\\>[ \t]*\\'")))
+ (while (re-search-forward org-ts-regexp nil t)
+ (catch 'next
+ (let ((tmp (buffer-substring
+ (max (line-beginning-position)
+ (- (match-beginning 0) org-ds-keyword-length))
+ (match-beginning 0))))
+ (when (or (string-suffix-p "-" tmp)
+ (string-match dre tmp)
+ (string-match sre tmp))
+ (throw 'next nil))
+ (let* ((dct (decode-time (org-time-string-to-time (match-string 0))))
+ (date (list (nth 4 dct) (nth 3 dct) (nth 5 dct)))
+ (year (nth 2 date))
+ (month (car date))
+ (day (nth 1 date))
+ (pos (point))
+ (hdl-pos (progn (org-back-to-heading t) (point))))
+ (unless (org-up-heading-safe)
+ ;; No parent, we are not in a date tree.
+ (goto-char pos)
+ (throw 'next nil))
+ (unless (looking-at "\\*+[ \t]+[0-9]+-[0-1][0-9]-[0-3][0-9]")
+ ;; Parent looks wrong, we are not in a date tree.
+ (goto-char pos)
+ (throw 'next nil))
+ (when (looking-at (format "\\*+[ \t]+%d-%02d-%02d" year month day))
+ ;; At correct date already, do nothing.
+ (goto-char pos)
+ (throw 'next nil))
+ ;; OK, we need to refile this entry.
+ (goto-char hdl-pos)
+ (org-cut-subtree)
+ (save-excursion
+ (save-restriction
+ (org-datetree-file-entry-under (current-kill 0) date)))))))))
+
+(provide 'org-datetree)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-datetree.el ends here
diff --git a/elpa/org-9.5.2/org-datetree.elc b/elpa/org-9.5.2/org-datetree.elc
new file mode 100644
index 0000000..ddf4d62
--- /dev/null
+++ b/elpa/org-9.5.2/org-datetree.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-duration.el b/elpa/org-9.5.2/org-duration.el
new file mode 100644
index 0000000..e627d09
--- /dev/null
+++ b/elpa/org-9.5.2/org-duration.el
@@ -0,0 +1,460 @@
+;;; org-duration.el --- Library handling durations -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library provides tools to manipulate durations. A duration
+;; can have multiple formats:
+;;
+;; - 3:12
+;; - 1:23:45
+;; - 1y 3d 3h 4min
+;; - 1d3h5min
+;; - 3d 13:35
+;; - 2.35h
+;;
+;; More accurately, it consists of numbers and units, as defined in
+;; variable `org-duration-units', possibly separated with white
+;; spaces, and an optional "H:MM" or "H:MM:SS" part, which always
+;; comes last. White spaces are tolerated between the number and its
+;; relative unit. Variable `org-duration-format' controls durations
+;; default representation.
+;;
+;; The library provides functions allowing to convert a duration to,
+;; and from, a number of minutes: `org-duration-to-minutes' and
+;; `org-duration-from-minutes'. It also provides two lesser tools:
+;; `org-duration-p', and `org-duration-h:mm-only-p'.
+;;
+;; Users can set the number of minutes per unit, or define new units,
+;; in `org-duration-units'. The library also supports canonical
+;; duration, i.e., a duration that doesn't depend on user's settings,
+;; through optional arguments.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'org-macs)
+
+
+;;; Public variables
+
+(defconst org-duration-canonical-units
+ `(("min" . 1)
+ ("h" . 60)
+ ("d" . ,(* 60 24)))
+ "Canonical time duration units.
+See `org-duration-units' for details.")
+
+(defcustom org-duration-units
+ `(("min" . 1)
+ ("h" . 60)
+ ("d" . ,(* 60 24))
+ ("w" . ,(* 60 24 7))
+ ("m" . ,(* 60 24 30))
+ ("y" . ,(* 60 24 365.25)))
+ "Conversion factor to minutes for a duration.
+
+Each entry has the form (UNIT . MODIFIER).
+
+In a duration string, a number followed by UNIT is multiplied by
+the specified number of MODIFIER to obtain a duration in minutes.
+
+For example, the following value
+
+ \\=`((\"min\" . 1)
+ (\"h\" . 60)
+ (\"d\" . ,(* 60 8))
+ (\"w\" . ,(* 60 8 5))
+ (\"m\" . ,(* 60 8 5 4))
+ (\"y\" . ,(* 60 8 5 4 10)))
+
+is meaningful if you work an average of 8 hours per day, 5 days
+a week, 4 weeks a month and 10 months a year.
+
+When setting this variable outside the Customize interface, make
+sure to call the following command:
+
+ \\[org-duration-set-regexps]"
+ :group 'org-agenda
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :set (lambda (var val)
+ (set-default var val)
+ ;; Avoid recursive load at startup.
+ (when (featurep 'org-duration)
+ (org-duration-set-regexps)))
+ :initialize 'custom-initialize-changed
+ :type '(choice
+ (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"))))
+
+(defcustom org-duration-format '(("d" . nil) (special . h:mm))
+ "Format definition for a duration.
+
+The value can be set to, respectively, the symbols `h:mm:ss' or
+`h:mm', which means a duration is expressed as, respectively,
+a \"H:MM:SS\" or \"H:MM\" string.
+
+Alternatively, the value can be a list of entries following the
+pattern:
+
+ (UNIT . REQUIRED?)
+
+UNIT is a unit string, as defined in `org-duration-units'. The
+time duration is formatted using only the time components that
+are specified here.
+
+Units with a zero value are skipped, unless REQUIRED? is non-nil.
+In that case, the unit is always used.
+
+The list can also contain one of the following special entries:
+
+ (special . h:mm)
+ (special . h:mm:ss)
+
+ Units shorter than an hour are ignored. The hours and
+ minutes part of the duration is expressed unconditionally
+ with H:MM, or H:MM:SS, pattern.
+
+ (special . PRECISION)
+
+ A duration is expressed with a single unit, PRECISION being
+ the number of decimal places to show. The unit chosen is the
+ first one required or with a non-zero integer part. If there
+ is no such unit, the smallest one is used.
+
+Eventually, if the list contains the symbol `compact', the
+duration is expressed in a compact form, without any white space
+between units.
+
+For example,
+
+ ((\"d\" . nil) (\"h\" . t) (\"min\" . t))
+
+means a duration longer than a day is expressed in days, hours
+and minutes, whereas a duration shorter than a day is always
+expressed in hours and minutes, even when shorter than an hour.
+
+On the other hand, the value
+
+ ((\"d\" . nil) (\"min\" . nil))
+
+means a duration longer than a day is expressed in days and
+minutes, whereas a duration shorter than a day is expressed
+entirely in minutes, even when longer than an hour.
+
+The following format
+
+ ((\"d\" . nil) (special . h:mm))
+
+means that any duration longer than a day is expressed with both
+a \"d\" unit and a \"H:MM\" part, whereas a duration shorter than
+a day is expressed only as a \"H:MM\" string.
+
+Eventually,
+
+ ((\"d\" . nil) (\"h\" . nil) (special . 2))
+
+expresses a duration longer than a day as a decimal number, with
+a 2-digits fractional part, of \"d\" unit. A duration shorter
+than a day uses \"h\" unit instead."
+ :group 'org-time
+ :group 'org-clock
+ :package-version '(Org . "9.1")
+ :type '(choice
+ (const :tag "Use H:MM" h:mm)
+ (const :tag "Use H:MM:SS" h:mm:ss)
+ (repeat :tag "Use units"
+ (choice
+ (cons :tag "Use units"
+ (string :tag "Unit")
+ (choice (const :tag "Skip when zero" nil)
+ (const :tag "Always used" t)))
+ (cons :tag "Use a single decimal unit"
+ (const special)
+ (integer :tag "Number of decimals"))
+ (cons :tag "Use both units and H:MM"
+ (const special)
+ (const h:mm))
+ (cons :tag "Use both units and H:MM:SS"
+ (const special)
+ (const h:mm:ss))
+ (const :tag "Use compact form" compact)))))
+
+
+;;; Internal variables and functions
+
+(defconst org-duration--h:mm-re
+ "\\`[ \t]*[0-9]+\\(?::[0-9]\\{2\\}\\)\\{1,2\\}[ \t]*\\'"
+ "Regexp matching a duration expressed with H:MM or H:MM:SS format.
+See `org-duration--h:mm:ss-re' to only match the latter. Hours
+can use any number of digits.")
+
+(defconst org-duration--h:mm:ss-re
+ "\\`[ \t]*[0-9]+\\(?::[0-9]\\{2\\}\\)\\{2\\}[ \t]*\\'"
+ "Regexp matching a duration expressed H:MM:SS format.
+See `org-duration--h:mm-re' to also support H:MM format. Hours
+can use any number of digits.")
+
+(defvar org-duration--unit-re nil
+ "Regexp matching a duration with an unit.
+Allowed units are defined in `org-duration-units'. Match group
+1 contains the bare number. Match group 2 contains the unit.")
+
+(defvar org-duration--full-re nil
+ "Regexp matching a duration expressed with units.
+Allowed units are defined in `org-duration-units'.")
+
+(defvar org-duration--mixed-re nil
+ "Regexp matching a duration expressed with units and H:MM or H:MM:SS format.
+Allowed units are defined in `org-duration-units'. Match group
+1 contains units part. Match group 2 contains H:MM or H:MM:SS
+part.")
+
+(defun org-duration--modifier (unit &optional canonical)
+ "Return modifier associated to string UNIT.
+When optional argument CANONICAL is non-nil, refer to
+`org-duration-canonical-units' instead of `org-duration-units'."
+ (or (cdr (assoc unit (if canonical
+ org-duration-canonical-units
+ org-duration-units)))
+ (error "Unknown unit: %S" unit)))
+
+
+;;; Public functions
+
+;;;###autoload
+(defun org-duration-set-regexps ()
+ "Set duration related regexps."
+ (interactive)
+ (setq org-duration--unit-re
+ (concat "\\([0-9]+\\(?:\\.[0-9]*\\)?\\)[ \t]*"
+ ;; Since user-defined units in `org-duration-units'
+ ;; can differ from canonical units in
+ ;; `org-duration-canonical-units', include both in
+ ;; regexp.
+ (regexp-opt (mapcar #'car (append org-duration-canonical-units
+ org-duration-units))
+ t)))
+ (setq org-duration--full-re
+ (format "\\`\\(?:[ \t]*%s\\)+[ \t]*\\'" org-duration--unit-re))
+ (setq org-duration--mixed-re
+ (format "\\`\\(?1:\\([ \t]*%s\\)+\\)[ \t]*\
+\\(?2:[0-9]+\\(?::[0-9][0-9]\\)\\{1,2\\}\\)[ \t]*\\'"
+ org-duration--unit-re)))
+
+;;;###autoload
+(defun org-duration-p (s)
+ "Non-nil when string S is a time duration."
+ (and (stringp s)
+ (or (string-match-p org-duration--full-re s)
+ (string-match-p org-duration--mixed-re s)
+ (string-match-p org-duration--h:mm-re s))))
+
+;;;###autoload
+(defun org-duration-to-minutes (duration &optional canonical)
+ "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."
+ (cond
+ ((equal duration "") 0.0)
+ ((numberp duration) (float duration))
+ ((string-match-p org-duration--h:mm-re duration)
+ (pcase-let ((`(,hours ,minutes ,seconds)
+ (mapcar #'string-to-number (split-string duration ":"))))
+ (+ (/ (or seconds 0) 60.0) minutes (* 60 hours))))
+ ((string-match-p org-duration--full-re duration)
+ (let ((minutes 0)
+ (s 0))
+ (while (string-match org-duration--unit-re duration s)
+ (setq s (match-end 0))
+ (let ((value (string-to-number (match-string 1 duration)))
+ (unit (match-string 2 duration)))
+ (cl-incf minutes (* value (org-duration--modifier unit canonical)))))
+ (float minutes)))
+ ((string-match org-duration--mixed-re duration)
+ (let ((units-part (match-string 1 duration))
+ (hms-part (match-string 2 duration)))
+ (+ (org-duration-to-minutes units-part)
+ (org-duration-to-minutes hms-part))))
+ ((string-match-p "\\`[0-9]+\\(\\.[0-9]*\\)?\\'" duration)
+ (float (string-to-number duration)))
+ (t (error "Invalid duration format: %S" duration))))
+
+;;;###autoload
+(defun org-duration-from-minutes (minutes &optional fmt canonical)
+ "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."
+ (pcase (or fmt org-duration-format)
+ (`h:mm
+ (format "%d:%02d" (/ minutes 60) (mod minutes 60)))
+ (`h:mm:ss
+ (let* ((whole-minutes (floor minutes))
+ (seconds (mod (* 60 minutes) 60)))
+ (format "%s:%02d"
+ (org-duration-from-minutes whole-minutes 'h:mm)
+ seconds)))
+ ((pred atom) (error "Invalid duration format specification: %S" fmt))
+ ;; Mixed format. Call recursively the function on both parts.
+ ((and duration-format
+ (let `(special . ,(and mode (or `h:mm:ss `h:mm)))
+ (assq 'special duration-format)))
+ (let* ((truncated-format
+ ;; Remove "special" mode from duration format in order to
+ ;; recurse properly. Also remove units smaller or equal
+ ;; to an hour since H:MM part takes care of it.
+ (cl-remove-if-not
+ (lambda (pair)
+ (pcase pair
+ (`(,(and unit (pred stringp)) . ,_)
+ (> (org-duration--modifier unit canonical) 60))
+ (_ nil)))
+ duration-format))
+ (min-modifier ;smallest modifier above hour
+ (and truncated-format
+ (apply #'min
+ (mapcar (lambda (p)
+ (org-duration--modifier (car p) canonical))
+ truncated-format)))))
+ (if (or (null min-modifier) (< minutes min-modifier))
+ ;; There is not unit above the hour or the smallest unit
+ ;; above the hour is too large for the number of minutes we
+ ;; need to represent. Use H:MM or H:MM:SS syntax.
+ (org-duration-from-minutes minutes mode canonical)
+ ;; Represent minutes above hour using provided units and H:MM
+ ;; or H:MM:SS below.
+ (let* ((units-part (* min-modifier (/ (floor minutes) min-modifier)))
+ (minutes-part (- minutes units-part))
+ (compact (memq 'compact duration-format)))
+ (concat
+ (org-duration-from-minutes units-part truncated-format canonical)
+ (and (not compact) " ")
+ (org-duration-from-minutes minutes-part mode))))))
+ ;; Units format.
+ (duration-format
+ (let* ((fractional
+ (let ((digits (cdr (assq 'special duration-format))))
+ (and digits
+ (or (wholenump digits)
+ (error "Unknown formatting directive: %S" digits))
+ (format "%%.%df" digits))))
+ (selected-units
+ (sort (cl-remove-if
+ ;; Ignore special format cells and compact option.
+ (lambda (pair)
+ (pcase pair
+ ((or `compact `(special . ,_)) t)
+ (_ nil)))
+ duration-format)
+ (lambda (a b)
+ (> (org-duration--modifier (car a) canonical)
+ (org-duration--modifier (car b) canonical)))))
+ (separator (if (memq 'compact duration-format) "" " ")))
+ (cond
+ ;; Fractional duration: use first unit that is either required
+ ;; or smaller than MINUTES.
+ (fractional
+ (let* ((unit (car
+ (or (cl-find-if
+ (lambda (pair)
+ (pcase pair
+ (`(,u . ,req?)
+ (or req?
+ (<= (org-duration--modifier u canonical)
+ minutes)))))
+ selected-units)
+ ;; Fall back to smallest unit.
+ (org-last selected-units))))
+ (modifier (org-duration--modifier unit canonical)))
+ (concat (format fractional (/ (float minutes) modifier)) unit)))
+ ;; Otherwise build duration string according to available
+ ;; units.
+ ((org-string-nw-p
+ (org-trim
+ (mapconcat
+ (lambda (units)
+ (pcase-let* ((`(,unit . ,required?) units)
+ (modifier (org-duration--modifier unit canonical)))
+ (cond ((<= modifier minutes)
+ (let ((value (floor minutes modifier)))
+ (cl-decf minutes (* value modifier))
+ (format "%s%d%s" separator value unit)))
+ (required? (concat separator "0" unit))
+ (t ""))))
+ selected-units
+ ""))))
+ ;; No unit can properly represent MINUTES. Use the smallest
+ ;; one anyway.
+ (t
+ (pcase-let ((`((,unit . ,_)) (last selected-units)))
+ (concat "0" unit))))))))
+
+;;;###autoload
+(defun org-duration-h:mm-only-p (times)
+ "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'."
+ (let (hms-flag)
+ (catch :exit
+ (dolist (time times)
+ (cond ((string-match-p org-duration--full-re time)
+ (throw :exit nil))
+ ((string-match-p org-duration--mixed-re time)
+ (throw :exit nil))
+ (hms-flag nil)
+ ((string-match-p org-duration--h:mm:ss-re time)
+ (setq hms-flag 'h:mm:ss))))
+ (or hms-flag 'h:mm))))
+
+
+;;; Initialization
+
+(org-duration-set-regexps)
+
+(provide 'org-duration)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-duration.el ends here
diff --git a/elpa/org-9.5.2/org-duration.elc b/elpa/org-9.5.2/org-duration.elc
new file mode 100644
index 0000000..f5b1ac3
--- /dev/null
+++ b/elpa/org-9.5.2/org-duration.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-element.el b/elpa/org-9.5.2/org-element.el
new file mode 100644
index 0000000..f8334cc
--- /dev/null
+++ b/elpa/org-9.5.2/org-element.el
@@ -0,0 +1,6265 @@
+;;; org-element.el --- Parser for Org Syntax -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <n.goaziou at gmail dot com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; See <https://orgmode.org/worg/dev/org-syntax.html> for details about
+;; Org syntax.
+;;
+;; Lisp-wise, a syntax object can be represented as a list.
+;; It follows the pattern (TYPE PROPERTIES CONTENTS), where:
+;; TYPE is a symbol describing the object.
+;; PROPERTIES is the property list attached to it. See docstring of
+;; appropriate parsing function to get an exhaustive list.
+;; CONTENTS is a list of syntax objects or raw strings contained
+;; in the current object, when applicable.
+;;
+;; For the whole document, TYPE is `org-data' and PROPERTIES is nil.
+;;
+;; The first part of this file defines constants for the Org syntax,
+;; while the second one provide accessors and setters functions.
+;;
+;; The next part implements a parser and an interpreter for each
+;; element and object type in Org syntax.
+;;
+;; The following part creates a fully recursive buffer parser. It
+;; also provides a tool to map a function to elements or objects
+;; matching some criteria in the parse tree. Functions of interest
+;; are `org-element-parse-buffer', `org-element-map' and, to a lesser
+;; extent, `org-element-parse-secondary-string'.
+;;
+;; The penultimate part is the cradle of an interpreter for the
+;; obtained parse tree: `org-element-interpret-data'.
+;;
+;; The library ends by furnishing `org-element-at-point' function, and
+;; a way to give information about document structure around point
+;; with `org-element-context'. A cache mechanism is also provided for
+;; these functions.
+
+
+;;; Code:
+
+(require 'avl-tree)
+(require 'cl-lib)
+(require 'ol)
+(require 'org)
+(require 'org-compat)
+(require 'org-entities)
+(require 'org-footnote)
+(require 'org-list)
+(require 'org-macs)
+(require 'org-table)
+
+(declare-function org-at-heading-p "org" (&optional _))
+(declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading))
+(declare-function org-escape-code-in-string "org-src" (s))
+(declare-function org-macro-escape-arguments "org-macro" (&rest args))
+(declare-function org-macro-extract-arguments "org-macro" (s))
+(declare-function org-reduced-level "org" (l))
+(declare-function org-unescape-code-in-string "org-src" (s))
+(declare-function outline-next-heading "outline" ())
+(declare-function outline-previous-heading "outline" ())
+
+(defvar org-archive-tag)
+(defvar org-clock-line-re)
+(defvar org-closed-string)
+(defvar org-comment-string)
+(defvar org-complex-heading-regexp)
+(defvar org-dblock-start-re)
+(defvar org-deadline-string)
+(defvar org-done-keywords)
+(defvar org-drawer-regexp)
+(defvar org-edit-src-content-indentation)
+(defvar org-emph-re)
+(defvar org-emphasis-regexp-components)
+(defvar org-keyword-time-not-clock-regexp)
+(defvar org-match-substring-regexp)
+(defvar org-odd-levels-only)
+(defvar org-outline-regexp-bol)
+(defvar org-planning-line-re)
+(defvar org-property-drawer-re)
+(defvar org-property-format)
+(defvar org-property-re)
+(defvar org-scheduled-string)
+(defvar org-src-preserve-indentation)
+(defvar org-tags-column)
+(defvar org-time-stamp-formats)
+(defvar org-todo-regexp)
+(defvar org-ts-regexp-both)
+(defvar org-verbatim-re)
+
+
+;;; Definitions And Rules
+;;
+;; Define elements, greater elements and specify recursive objects,
+;; along with the affiliated keywords recognized. Also set up
+;; restrictions on recursive objects combinations.
+;;
+;; `org-element-update-syntax' builds proper syntax regexps according
+;; to current setup.
+
+(defconst org-element-citation-key-re
+ (rx "@" (group (one-or-more (any word "-.:?!`'/*@+|(){}<>&_^$#%~"))))
+ "Regexp matching a citation key.
+Key is located in match group 1.")
+
+(defconst org-element-citation-prefix-re
+ (rx "[cite"
+ (opt "/" (group (one-or-more (any "/_-" alnum)))) ;style
+ ":"
+ (zero-or-more (any "\t\n ")))
+ "Regexp matching a citation prefix.
+Style, if any, is located in match group 1.")
+
+(defvar org-element-paragraph-separate nil
+ "Regexp to separate paragraphs in an Org buffer.
+In the case of lines starting with \"#\" and \":\", this regexp
+is not sufficient to know if point is at a paragraph ending. See
+`org-element-paragraph-parser' for more information.")
+
+(defvar org-element--object-regexp nil
+ "Regexp possibly matching the beginning of an object.
+This regexp allows false positives. Dedicated parser (e.g.,
+`org-export-bold-parser') will take care of further filtering.
+Radio links are not matched by this regexp, as they are treated
+specially in `org-element--object-lex'.")
+
+(defun org-element--set-regexps ()
+ "Build variable syntax regexps."
+ (setq org-element-paragraph-separate
+ (concat "^\\(?:"
+ ;; Headlines, inlinetasks.
+ "\\*+ " "\\|"
+ ;; Footnote definitions.
+ "\\[fn:[-_[:word:]]+\\]" "\\|"
+ ;; Diary sexps.
+ "%%(" "\\|"
+ "[ \t]*\\(?:"
+ ;; Empty lines.
+ "$" "\\|"
+ ;; Tables (any type).
+ "|" "\\|"
+ "\\+\\(?:-+\\+\\)+[ \t]*$" "\\|"
+ ;; Comments, keyword-like or block-like constructs.
+ ;; Blocks and keywords with dual values need to be
+ ;; double-checked.
+ "#\\(?: \\|$\\|\\+\\(?:"
+ "BEGIN_\\S-+" "\\|"
+ "\\S-+\\(?:\\[.*\\]\\)?:[ \t]*\\)\\)"
+ "\\|"
+ ;; Drawers (any type) and fixed-width areas. Drawers
+ ;; need to be double-checked.
+ ":\\(?: \\|$\\|[-_[:word:]]+:[ \t]*$\\)" "\\|"
+ ;; Horizontal rules.
+ "-\\{5,\\}[ \t]*$" "\\|"
+ ;; LaTeX environments.
+ "\\\\begin{\\([A-Za-z0-9*]+\\)}" "\\|"
+ ;; Clock lines.
+ "CLOCK:" "\\|"
+ ;; Lists.
+ (let ((term (pcase org-plain-list-ordered-item-terminator
+ (?\) ")") (?. "\\.") (_ "[.)]")))
+ (alpha (and org-list-allow-alphabetical "\\|[A-Za-z]")))
+ (concat "\\(?:[-+*]\\|\\(?:[0-9]+" alpha "\\)" term "\\)"
+ "\\(?:[ \t]\\|$\\)"))
+ "\\)\\)")
+ org-element--object-regexp
+ (mapconcat #'identity
+ (let ((link-types (regexp-opt (org-link-types))))
+ (list
+ ;; Sub/superscript.
+ "\\(?:[_^][-{(*+.,[:alnum:]]\\)"
+ ;; Bold, code, italic, strike-through, underline
+ ;; and verbatim.
+ (concat "[*~=+_/]"
+ (format "[^%s]"
+ (nth 2 org-emphasis-regexp-components)))
+ ;; Plain links.
+ (concat "\\<" link-types ":")
+ ;; Objects starting with "[": citations,
+ ;; footnote reference, statistics cookie,
+ ;; timestamp (inactive) and regular link.
+ (format "\\[\\(?:%s\\)"
+ (mapconcat
+ #'identity
+ (list "cite[:/]"
+ "fn:"
+ "\\(?:[0-9]\\|\\(?:%\\|/[0-9]*\\)\\]\\)"
+ "\\[")
+ "\\|"))
+ ;; Objects starting with "@": export snippets.
+ "@@"
+ ;; Objects starting with "{": macro.
+ "{{{"
+ ;; Objects starting with "<" : timestamp
+ ;; (active, diary), target, radio target and
+ ;; angular links.
+ (concat "<\\(?:%%\\|<\\|[0-9]\\|" link-types "\\)")
+ ;; Objects starting with "$": latex fragment.
+ "\\$"
+ ;; Objects starting with "\": line break,
+ ;; entity, latex fragment.
+ "\\\\\\(?:[a-zA-Z[(]\\|\\\\[ \t]*$\\|_ +\\)"
+ ;; Objects starting with raw text: inline Babel
+ ;; source block, inline Babel call.
+ "\\(?:call\\|src\\)_"))
+ "\\|")))
+
+(org-element--set-regexps)
+
+;;;###autoload
+(defun org-element-update-syntax ()
+ "Update parser internals."
+ (interactive)
+ (org-element--set-regexps)
+ (org-element-cache-reset 'all))
+
+(defconst org-element-all-elements
+ '(babel-call center-block clock comment comment-block diary-sexp drawer
+ dynamic-block example-block export-block fixed-width
+ footnote-definition headline horizontal-rule inlinetask item
+ keyword latex-environment node-property paragraph plain-list
+ planning property-drawer quote-block section
+ special-block src-block table table-row verse-block)
+ "Complete list of element types.")
+
+(defconst org-element-greater-elements
+ '(center-block drawer dynamic-block footnote-definition headline inlinetask
+ item plain-list property-drawer quote-block section
+ special-block table)
+ "List of recursive element types aka Greater Elements.")
+
+(defconst org-element-all-objects
+ '(bold citation citation-reference code entity export-snippet
+ footnote-reference inline-babel-call inline-src-block italic line-break
+ latex-fragment link macro radio-target statistics-cookie strike-through
+ subscript superscript table-cell target timestamp underline verbatim)
+ "Complete list of object types.")
+
+(defconst org-element-recursive-objects
+ '(bold citation footnote-reference italic link subscript radio-target
+ strike-through superscript table-cell underline)
+ "List of recursive object types.")
+
+(defconst org-element-object-containers
+ (append org-element-recursive-objects '(paragraph table-row verse-block))
+ "List of object or element types that can directly contain objects.")
+
+(defconst org-element-affiliated-keywords
+ '("CAPTION" "DATA" "HEADER" "HEADERS" "LABEL" "NAME" "PLOT" "RESNAME" "RESULT"
+ "RESULTS" "SOURCE" "SRCNAME" "TBLNAME")
+ "List of affiliated keywords as strings.
+By default, all keywords setting attributes (e.g., \"ATTR_LATEX\")
+are affiliated keywords and need not to be in this list.")
+
+(defconst org-element-keyword-translation-alist
+ '(("DATA" . "NAME") ("LABEL" . "NAME") ("RESNAME" . "NAME")
+ ("SOURCE" . "NAME") ("SRCNAME" . "NAME") ("TBLNAME" . "NAME")
+ ("RESULT" . "RESULTS") ("HEADERS" . "HEADER"))
+ "Alist of usual translations for keywords.
+The key is the old name and the value the new one. The property
+holding their value will be named after the translated name.")
+
+(defconst org-element-multiple-keywords '("CAPTION" "HEADER")
+ "List of affiliated keywords that can occur more than once in an element.
+
+Their value will be consed into a list of strings, which will be
+returned as the value of the property.
+
+This list is checked after translations have been applied. See
+`org-element-keyword-translation-alist'.
+
+By default, all keywords setting attributes (e.g., \"ATTR_LATEX\")
+allow multiple occurrences and need not to be in this list.")
+
+(defconst org-element-parsed-keywords '("CAPTION")
+ "List of affiliated keywords whose value can be parsed.
+
+Their value will be stored as a secondary string: a list of
+strings and objects.
+
+This list is checked after translations have been applied. See
+`org-element-keyword-translation-alist'.")
+
+(defconst org-element--parsed-properties-alist
+ (mapcar (lambda (k) (cons k (intern (concat ":" (downcase k)))))
+ org-element-parsed-keywords)
+ "Alist of parsed keywords and associated properties.
+This is generated from `org-element-parsed-keywords', which
+see.")
+
+(defconst org-element-dual-keywords '("CAPTION" "RESULTS")
+ "List of affiliated keywords which can have a secondary value.
+
+In Org syntax, they can be written with optional square brackets
+before the colons. For example, RESULTS keyword can be
+associated to a hash value with the following:
+
+ #+RESULTS[hash-string]: some-source
+
+This list is checked after translations have been applied. See
+`org-element-keyword-translation-alist'.")
+
+(defconst org-element--affiliated-re
+ (format "[ \t]*#\\+\\(?:%s\\):[ \t]*"
+ (concat
+ ;; Dual affiliated keywords.
+ (format "\\(?1:%s\\)\\(?:\\[\\(.*\\)\\]\\)?"
+ (regexp-opt org-element-dual-keywords))
+ "\\|"
+ ;; Regular affiliated keywords.
+ (format "\\(?1:%s\\)"
+ (regexp-opt
+ (cl-remove-if
+ (lambda (k) (member k org-element-dual-keywords))
+ org-element-affiliated-keywords)))
+ "\\|"
+ ;; Export attributes.
+ "\\(?1:ATTR_[-_A-Za-z0-9]+\\)"))
+ "Regexp matching any affiliated keyword.
+
+Keyword name is put in match group 1. Moreover, if keyword
+belongs to `org-element-dual-keywords', put the dual value in
+match group 2.
+
+Don't modify it, set `org-element-affiliated-keywords' instead.")
+
+(defconst org-element-object-restrictions
+ (let* ((minimal-set '(bold code entity italic latex-fragment strike-through
+ subscript superscript underline verbatim))
+ (standard-set
+ (remq 'citation-reference (remq 'table-cell org-element-all-objects)))
+ (standard-set-no-line-break (remq 'line-break standard-set)))
+ `((bold ,@standard-set)
+ (citation citation-reference)
+ (citation-reference ,@minimal-set)
+ (footnote-reference ,@standard-set)
+ (headline ,@standard-set-no-line-break)
+ (inlinetask ,@standard-set-no-line-break)
+ (italic ,@standard-set)
+ (item ,@standard-set-no-line-break)
+ (keyword ,@(remq 'footnote-reference standard-set))
+ ;; Ignore all links in a link description. Also ignore
+ ;; radio-targets and line breaks.
+ (link export-snippet inline-babel-call inline-src-block macro
+ statistics-cookie ,@minimal-set)
+ (paragraph ,@standard-set)
+ ;; Remove any variable object from radio target as it would
+ ;; prevent it from being properly recognized.
+ (radio-target ,@minimal-set)
+ (strike-through ,@standard-set)
+ (subscript ,@standard-set)
+ (superscript ,@standard-set)
+ ;; Ignore inline babel call and inline source block as formulas
+ ;; are possible. Also ignore line breaks and statistics
+ ;; cookies.
+ (table-cell citation export-snippet footnote-reference link macro
+ radio-target target timestamp ,@minimal-set)
+ (table-row table-cell)
+ (underline ,@standard-set)
+ (verse-block ,@standard-set)))
+ "Alist of objects restrictions.
+
+key is an element or object type containing objects and value is
+a list of types that can be contained within an element or object
+of such type.
+
+This alist also applies to secondary string. For example, an
+`headline' type element doesn't directly contain objects, but
+still has an entry since one of its properties (`:title') does.")
+
+(defconst org-element-secondary-value-alist
+ '((citation :prefix :suffix)
+ (headline :title)
+ (inlinetask :title)
+ (item :tag)
+ (citation-reference :prefix :suffix))
+ "Alist between element types and locations of secondary values.")
+
+(defconst org-element--pair-round-table
+ (let ((table (make-syntax-table)))
+ (modify-syntax-entry ?\( "()" table)
+ (modify-syntax-entry ?\) ")(" table)
+ (dolist (char '(?\{ ?\} ?\[ ?\] ?\< ?\>) table)
+ (modify-syntax-entry char " " table)))
+ "Table used internally to pair only round brackets.
+Other brackets are treated as spaces.")
+
+(defconst org-element--pair-square-table
+ (let ((table (make-syntax-table)))
+ (modify-syntax-entry ?\[ "(]" table)
+ (modify-syntax-entry ?\] ")[" table)
+ (dolist (char '(?\{ ?\} ?\( ?\) ?\< ?\>) table)
+ (modify-syntax-entry char " " table)))
+ "Table used internally to pair only square brackets.
+Other brackets are treated as spaces.")
+
+(defconst org-element--pair-curly-table
+ (let ((table (make-syntax-table)))
+ (modify-syntax-entry ?\{ "(}" table)
+ (modify-syntax-entry ?\} "){" table)
+ (dolist (char '(?\[ ?\] ?\( ?\) ?\< ?\>) table)
+ (modify-syntax-entry char " " table)))
+ "Table used internally to pair only curly brackets.
+Other brackets are treated as spaces.")
+
+(defun org-element--parse-paired-brackets (char)
+ "Parse paired brackets at point.
+CHAR is the opening bracket to consider, as a character. Return
+contents between brackets, as a string, or nil. Also move point
+past the brackets."
+ (when (eq char (char-after))
+ (let ((syntax-table (pcase char
+ (?\{ org-element--pair-curly-table)
+ (?\[ org-element--pair-square-table)
+ (?\( org-element--pair-round-table)
+ (_ nil)))
+ (pos (point)))
+ (when syntax-table
+ (with-syntax-table syntax-table
+ (let ((end (ignore-errors (scan-lists pos 1 0))))
+ (when end
+ (goto-char end)
+ (buffer-substring-no-properties (1+ pos) (1- end)))))))))
+
+
+;;; Accessors and Setters
+;;
+;; Provide four accessors: `org-element-type', `org-element-property'
+;; `org-element-contents' and `org-element-restriction'.
+;;
+;; Setter functions allow modification of elements by side effect.
+;; There is `org-element-put-property', `org-element-set-contents'.
+;; These low-level functions are useful to build a parse tree.
+;;
+;; `org-element-adopt-elements', `org-element-set-element',
+;; `org-element-extract-element' and `org-element-insert-before' are
+;; high-level functions useful to modify a parse tree.
+;;
+;; `org-element-secondary-p' is a predicate used to know if a given
+;; object belongs to a secondary string. `org-element-class' tells if
+;; some parsed data is an element or an object, handling pseudo
+;; elements and objects. `org-element-copy' returns an element or
+;; object, stripping its parent property in the process.
+
+(defsubst org-element-type (element)
+ "Return type of ELEMENT.
+
+The function returns the type of the element or object provided.
+It can also return the following special value:
+ `plain-text' for a string
+ `org-data' for a complete document
+ nil in any other case."
+ (cond
+ ((not (consp element)) (and (stringp element) 'plain-text))
+ ((symbolp (car element)) (car element))))
+
+(defsubst org-element-property (property element)
+ "Extract the value from the PROPERTY of an ELEMENT."
+ (if (stringp element) (get-text-property 0 property element)
+ (plist-get (nth 1 element) property)))
+
+(defsubst org-element-contents (element)
+ "Extract contents from an ELEMENT."
+ (cond ((not (consp element)) nil)
+ ((symbolp (car element)) (nthcdr 2 element))
+ (t element)))
+
+(defsubst org-element-restriction (element)
+ "Return restriction associated to ELEMENT.
+ELEMENT can be an element, an object or a symbol representing an
+element or object type."
+ (cdr (assq (if (symbolp element) element (org-element-type element))
+ org-element-object-restrictions)))
+
+(defsubst org-element-put-property (element property value)
+ "In ELEMENT set PROPERTY to VALUE.
+Return modified element."
+ (if (stringp element) (org-add-props element nil property value)
+ (setcar (cdr element) (plist-put (nth 1 element) property value))
+ element))
+
+(defsubst org-element-set-contents (element &rest contents)
+ "Set ELEMENT's contents to CONTENTS.
+Return ELEMENT."
+ (cond ((null element) contents)
+ ((not (symbolp (car element))) contents)
+ ((cdr element) (setcdr (cdr element) contents) element)
+ (t (nconc element contents))))
+
+(defun org-element-secondary-p (object)
+ "Non-nil when OBJECT directly belongs to a secondary string.
+Return value is the property name, as a keyword, or nil."
+ (let* ((parent (org-element-property :parent object))
+ (properties (cdr (assq (org-element-type parent)
+ org-element-secondary-value-alist))))
+ (catch 'exit
+ (dolist (p properties)
+ (and (memq object (org-element-property p parent))
+ (throw 'exit p))))))
+
+(defsubst org-element-class (datum &optional parent)
+ "Return class for ELEMENT, as a symbol.
+Class is either `element' or `object'. Optional argument PARENT
+is the element or object containing DATUM. It defaults to the
+value of DATUM `:parent' property."
+ (let ((type (org-element-type datum))
+ (parent (or parent (org-element-property :parent datum))))
+ (cond
+ ;; Trivial cases.
+ ((memq type org-element-all-objects) 'object)
+ ((memq type org-element-all-elements) 'element)
+ ;; Special cases.
+ ((eq type 'org-data) 'element)
+ ((eq type 'plain-text) 'object)
+ ((not type) 'object)
+ ;; Pseudo object or elements. Make a guess about its class.
+ ;; Basically a pseudo object is contained within another object,
+ ;; a secondary string or a container element.
+ ((not parent) 'element)
+ (t
+ (let ((parent-type (org-element-type parent)))
+ (cond ((not parent-type) 'object)
+ ((memq parent-type org-element-object-containers) 'object)
+ ((org-element-secondary-p datum) 'object)
+ (t 'element)))))))
+
+(defsubst org-element-adopt-elements (parent &rest children)
+ "Append elements to the contents of another element.
+
+PARENT is an element or object. CHILDREN can be elements,
+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.
+ (dolist (child children)
+ (org-element-put-property child :parent (or parent children)))
+ ;; Add CHILDREN at the end of PARENT contents.
+ (when parent
+ (apply #'org-element-set-contents
+ parent
+ (nconc (org-element-contents parent) children)))
+ ;; Return modified PARENT element.
+ (or parent children)))
+
+(defun org-element-extract-element (element)
+ "Extract ELEMENT from parse tree.
+Remove element from the parse tree by side-effect, and return it
+with its `:parent' property stripped out."
+ (let ((parent (org-element-property :parent element))
+ (secondary (org-element-secondary-p element)))
+ (if secondary
+ (org-element-put-property
+ parent secondary
+ (delq element (org-element-property secondary parent)))
+ (apply #'org-element-set-contents
+ parent
+ (delq element (org-element-contents parent))))
+ ;; Return ELEMENT with its :parent removed.
+ (org-element-put-property element :parent nil)))
+
+(defun org-element-insert-before (element location)
+ "Insert ELEMENT before LOCATION in parse tree.
+LOCATION is an element, object or string within the parse tree.
+Parse tree is modified by side effect."
+ (let* ((parent (org-element-property :parent location))
+ (property (org-element-secondary-p location))
+ (siblings (if property (org-element-property property parent)
+ (org-element-contents parent)))
+ ;; Special case: LOCATION is the first element of an
+ ;; independent secondary string (e.g. :title property). Add
+ ;; ELEMENT in-place.
+ (specialp (and (not property)
+ (eq siblings parent)
+ (eq (car parent) location))))
+ ;; Install ELEMENT at the appropriate LOCATION within SIBLINGS.
+ (cond (specialp)
+ ((or (null siblings) (eq (car siblings) location))
+ (push element siblings))
+ ((null location) (nconc siblings (list element)))
+ (t
+ (let ((index (cl-position location siblings)))
+ (unless index (error "No location found to insert element"))
+ (push element (cdr (nthcdr (1- index) siblings))))))
+ ;; Store SIBLINGS at appropriate place in parse tree.
+ (cond
+ (specialp (setcdr parent (copy-sequence parent)) (setcar parent element))
+ (property (org-element-put-property parent property siblings))
+ (t (apply #'org-element-set-contents parent siblings)))
+ ;; Set appropriate :parent property.
+ (org-element-put-property element :parent parent)))
+
+(defun org-element-set-element (old new)
+ "Replace element or object OLD with element or object NEW.
+The function takes care of setting `:parent' property for NEW."
+ ;; Ensure OLD and NEW have the same parent.
+ (org-element-put-property new :parent (org-element-property :parent old))
+ (if (or (memq (org-element-type old) '(plain-text nil))
+ (memq (org-element-type new) '(plain-text nil)))
+ ;; We cannot replace OLD with NEW since one of them is not an
+ ;; object or element. We take the long path.
+ (progn (org-element-insert-before new old)
+ (org-element-extract-element old))
+ ;; Since OLD is going to be changed into NEW by side-effect, first
+ ;; make sure that every element or object within NEW has OLD as
+ ;; parent.
+ (dolist (blob (org-element-contents new))
+ (org-element-put-property blob :parent old))
+ ;; Transfer contents.
+ (apply #'org-element-set-contents old (org-element-contents new))
+ ;; Overwrite OLD's properties with NEW's.
+ (setcar (cdr old) (nth 1 new))
+ ;; Transfer type.
+ (setcar old (car new))))
+
+(defun org-element-create (type &optional props &rest children)
+ "Create a new element of type TYPE.
+Optional argument PROPS, when non-nil, is a plist defining the
+properties of the element. CHILDREN can be elements, objects or
+strings."
+ (apply #'org-element-adopt-elements (list type props) children))
+
+(defun org-element-copy (datum)
+ "Return a copy of DATUM.
+DATUM is an element, object, string or nil. `:parent' property
+is cleared and contents are removed in the process."
+ (when datum
+ (let ((type (org-element-type datum)))
+ (pcase type
+ (`org-data (list 'org-data nil))
+ (`plain-text (substring-no-properties datum))
+ (`nil (copy-sequence datum))
+ (_
+ (list type (plist-put (copy-sequence (nth 1 datum)) :parent nil)))))))
+
+
+
+;;; Greater elements
+;;
+;; For each greater element type, we define a parser and an
+;; interpreter.
+;;
+;; A parser returns the element or object as the list described above.
+;; Most of them accepts no argument. Though, exceptions exist. Hence
+;; every element containing a secondary string (see
+;; `org-element-secondary-value-alist') will accept an optional
+;; argument to toggle parsing of these secondary strings. Moreover,
+;; `item' parser requires current list's structure as its first
+;; element.
+;;
+;; An interpreter accepts two arguments: the list representation of
+;; the element or object, and its contents. The latter may be nil,
+;; depending on the element or object considered. It returns the
+;; appropriate Org syntax, as a string.
+;;
+;; Parsing functions must follow the naming convention:
+;; org-element-TYPE-parser, where TYPE is greater element's type, as
+;; defined in `org-element-greater-elements'.
+;;
+;; Similarly, interpreting functions must follow the naming
+;; convention: org-element-TYPE-interpreter.
+;;
+;; With the exception of `headline' and `item' types, greater elements
+;; cannot contain other greater elements of their own type.
+;;
+;; Beside implementing a parser and an interpreter, adding a new
+;; greater element requires tweaking `org-element--current-element'.
+;; Moreover, the newly defined type must be added to both
+;; `org-element-all-elements' and `org-element-greater-elements'.
+
+
+;;;; Center Block
+
+(defun org-element-center-block-parser (limit affiliated)
+ "Parse a center block.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `center-block' and CDR is a plist
+containing `:begin', `:end', `:contents-begin', `:contents-end',
+`:post-blank' and `:post-affiliated' keywords.
+
+Assume point is at the beginning of the block."
+ (let ((case-fold-search t))
+ (if (not (save-excursion
+ (re-search-forward "^[ \t]*#\\+END_CENTER[ \t]*$" limit t)))
+ ;; Incomplete block: parse it as a paragraph.
+ (org-element-paragraph-parser limit affiliated)
+ (let ((block-end-line (match-beginning 0)))
+ (let* ((begin (car affiliated))
+ (post-affiliated (point))
+ ;; Empty blocks have no contents.
+ (contents-begin (progn (forward-line)
+ (and (< (point) block-end-line)
+ (point))))
+ (contents-end (and contents-begin block-end-line))
+ (pos-before-blank (progn (goto-char block-end-line)
+ (forward-line)
+ (point)))
+ (end (save-excursion
+ (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'center-block
+ (nconc
+ (list :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank (count-lines pos-before-blank end)
+ :post-affiliated post-affiliated)
+ (cdr affiliated))))))))
+
+(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))
+
+
+;;;; Drawer
+
+(defun org-element-drawer-parser (limit affiliated)
+ "Parse a drawer.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `drawer' and CDR is a plist containing
+`:drawer-name', `:begin', `:end', `:contents-begin',
+`:contents-end', `:post-blank' and `:post-affiliated' keywords.
+
+Assume point is at beginning of drawer."
+ (let ((case-fold-search t))
+ (if (not (save-excursion
+ (goto-char (min limit (line-end-position)))
+ (re-search-forward "^[ \t]*:END:[ \t]*$" limit t)))
+ ;; Incomplete drawer: parse it as a paragraph.
+ (org-element-paragraph-parser limit affiliated)
+ (save-excursion
+ (let* ((drawer-end-line (match-beginning 0))
+ (name (progn (looking-at org-drawer-regexp)
+ (match-string-no-properties 1)))
+ (begin (car affiliated))
+ (post-affiliated (point))
+ ;; Empty drawers have no contents.
+ (contents-begin (progn (forward-line)
+ (and (< (point) drawer-end-line)
+ (point))))
+ (contents-end (and contents-begin drawer-end-line))
+ (pos-before-blank (progn (goto-char drawer-end-line)
+ (forward-line)
+ (point)))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'drawer
+ (nconc
+ (list :begin begin
+ :end end
+ :drawer-name name
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank (count-lines pos-before-blank end)
+ :post-affiliated post-affiliated)
+ (cdr affiliated))))))))
+
+(defun org-element-drawer-interpreter (drawer contents)
+ "Interpret DRAWER element as Org syntax.
+CONTENTS is the contents of the element."
+ (format ":%s:\n%s:END:"
+ (org-element-property :drawer-name drawer)
+ contents))
+
+
+;;;; Dynamic Block
+
+(defun org-element-dynamic-block-parser (limit affiliated)
+ "Parse a dynamic block.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `dynamic-block' and CDR is a plist
+containing `:block-name', `:begin', `:end', `:contents-begin',
+`:contents-end', `:arguments', `:post-blank' and
+`:post-affiliated' keywords.
+
+Assume point is at beginning of dynamic block."
+ (let ((case-fold-search t))
+ (if (not (save-excursion
+ (re-search-forward "^[ \t]*#\\+END:?[ \t]*$" limit t)))
+ ;; Incomplete block: parse it as a paragraph.
+ (org-element-paragraph-parser limit affiliated)
+ (let ((block-end-line (match-beginning 0)))
+ (save-excursion
+ (let* ((name (progn (looking-at org-dblock-start-re)
+ (match-string-no-properties 1)))
+ (arguments (match-string-no-properties 3))
+ (begin (car affiliated))
+ (post-affiliated (point))
+ ;; Empty blocks have no contents.
+ (contents-begin (progn (forward-line)
+ (and (< (point) block-end-line)
+ (point))))
+ (contents-end (and contents-begin block-end-line))
+ (pos-before-blank (progn (goto-char block-end-line)
+ (forward-line)
+ (point)))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'dynamic-block
+ (nconc
+ (list :begin begin
+ :end end
+ :block-name name
+ :arguments arguments
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank (count-lines pos-before-blank end)
+ :post-affiliated post-affiliated)
+ (cdr affiliated)))))))))
+
+(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:"
+ (org-element-property :block-name dynamic-block)
+ (let ((args (org-element-property :arguments dynamic-block)))
+ (if args (concat " " args) ""))
+ contents))
+
+
+;;;; Footnote Definition
+
+(defconst org-element--footnote-separator
+ (concat org-outline-regexp-bol "\\|"
+ org-footnote-definition-re "\\|"
+ "^\\([ \t]*\n\\)\\{2,\\}")
+ "Regexp used as a footnote definition separator.")
+
+(defun org-element-footnote-definition-parser (limit affiliated)
+ "Parse a footnote definition.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `footnote-definition' and CDR is
+a plist containing `:label', `:begin' `:end', `:contents-begin',
+`:contents-end', `:pre-blank',`:post-blank' and
+`:post-affiliated' keywords.
+
+Assume point is at the beginning of the footnote definition."
+ (save-excursion
+ (let* ((label (progn (looking-at org-footnote-definition-re)
+ (match-string-no-properties 1)))
+ (begin (car affiliated))
+ (post-affiliated (point))
+ (end
+ (save-excursion
+ (end-of-line)
+ (cond
+ ((not
+ (re-search-forward org-element--footnote-separator limit t))
+ limit)
+ ((eq ?\[ (char-after (match-beginning 0)))
+ ;; At a new footnote definition, make sure we end
+ ;; before any affiliated keyword above.
+ (forward-line -1)
+ (while (and (> (point) post-affiliated)
+ (looking-at-p org-element--affiliated-re))
+ (forward-line -1))
+ (line-beginning-position 2))
+ ((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
+ (setq pre-blank
+ (count-lines (line-beginning-position) begin))
+ (line-beginning-position)))))
+ (contents-end
+ (progn (goto-char end)
+ (skip-chars-backward " \r\t\n")
+ (line-beginning-position 2))))
+ (list 'footnote-definition
+ (nconc
+ (list :label label
+ :begin begin
+ :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))))))
+
+(defun org-element-footnote-definition-interpreter (footnote-definition contents)
+ "Interpret FOOTNOTE-DEFINITION element as Org syntax.
+CONTENTS is the contents of the footnote-definition."
+ (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
+
+(defun org-element--get-node-properties ()
+ "Return node properties associated to headline at point.
+Upcase property names. It avoids confusion between properties
+obtained through property drawer and default properties from the
+parser (e.g. `:end' and :END:). Return value is a plist."
+ (save-excursion
+ (forward-line)
+ (when (looking-at-p org-planning-line-re) (forward-line))
+ (when (looking-at org-property-drawer-re)
+ (forward-line)
+ (let ((end (match-end 0)) properties)
+ (while (< (line-end-position) end)
+ (looking-at org-property-re)
+ (push (match-string-no-properties 3) properties)
+ (push (intern (concat ":" (upcase (match-string 2)))) properties)
+ (forward-line))
+ properties))))
+
+(defun org-element--get-time-properties ()
+ "Return time properties associated to headline at point.
+Return value is a plist."
+ (save-excursion
+ (when (progn (forward-line) (looking-at org-planning-line-re))
+ (let ((end (line-end-position)) plist)
+ (while (re-search-forward org-keyword-time-not-clock-regexp end t)
+ (goto-char (match-end 1))
+ (skip-chars-forward " \t")
+ (let ((keyword (match-string 1))
+ (time (org-element-timestamp-parser)))
+ (cond ((equal keyword org-scheduled-string)
+ (setq plist (plist-put plist :scheduled time)))
+ ((equal keyword org-deadline-string)
+ (setq plist (plist-put plist :deadline time)))
+ (t (setq plist (plist-put plist :closed time))))))
+ plist))))
+
+(defun org-element-headline-parser (limit &optional raw-secondary-p)
+ "Parse a headline.
+
+Return a list whose CAR is `headline' and CDR is a plist
+containing `:raw-value', `:title', `:begin', `:end',
+`:pre-blank', `:contents-begin' and `:contents-end', `:level',
+`:priority', `:tags', `:todo-keyword', `:todo-type', `:scheduled',
+`:deadline', `:closed', `:archivedp', `:commentedp'
+`:footnote-section-p', `:post-blank' and `:post-affiliated'
+keywords.
+
+The plist also contains any property set in the property drawer,
+with its name in upper cases and colons added at the
+beginning (e.g., `:CUSTOM_ID').
+
+LIMIT is a buffer position bounding the search.
+
+When RAW-SECONDARY-P is non-nil, headline's title will not be
+parsed as a secondary string, but as a plain string instead.
+
+Assume point is at beginning of the headline."
+ (save-excursion
+ (let* ((begin (point))
+ (level (prog1 (org-reduced-level (skip-chars-forward "*"))
+ (skip-chars-forward " \t")))
+ (todo (and 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 1))))
+ (todo-type
+ (and todo (if (member todo org-done-keywords) 'done 'todo)))
+ (priority (and (looking-at "\\[#.\\][ \t]*")
+ (progn (goto-char (match-end 0))
+ (aref (match-string 0) 2))))
+ (commentedp
+ (and (let (case-fold-search) (looking-at org-comment-string))
+ (goto-char (match-end 0))))
+ (title-start (prog1 (point)
+ (unless (or todo priority commentedp)
+ ;; Headline like "* :tag:"
+ (skip-chars-backward " \t"))))
+ (tags (when (re-search-forward
+ "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"
+ (line-end-position)
+ 'move)
+ (goto-char (match-beginning 0))
+ (org-split-string (match-string 1) ":")))
+ (title-end (point))
+ (raw-value (org-trim
+ (buffer-substring-no-properties title-start title-end)))
+ (archivedp (member org-archive-tag tags))
+ (footnote-section-p (and org-footnote-section
+ (string= org-footnote-section raw-value)))
+ (standard-props (org-element--get-node-properties))
+ (time-props (org-element--get-time-properties))
+ (end (min (save-excursion (org-end-of-subtree t t)) limit))
+ (contents-begin (save-excursion
+ (forward-line)
+ (skip-chars-forward " \r\t\n" end)
+ (and (/= (point) end) (line-beginning-position))))
+ (contents-end (and contents-begin
+ (progn (goto-char end)
+ (skip-chars-backward " \r\t\n")
+ (line-beginning-position 2)))))
+ (let ((headline
+ (list 'headline
+ (nconc
+ (list :raw-value raw-value
+ :begin begin
+ :end end
+ :pre-blank
+ (if (not contents-begin) 0
+ (1- (count-lines begin contents-begin)))
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :level level
+ :priority priority
+ :tags tags
+ :todo-keyword todo
+ :todo-type todo-type
+ :post-blank
+ (if contents-end
+ (count-lines contents-end end)
+ (1- (count-lines begin end)))
+ :footnote-section-p footnote-section-p
+ :archivedp archivedp
+ :commentedp commentedp
+ :post-affiliated begin)
+ time-props
+ standard-props))))
+ (org-element-put-property
+ headline :title
+ (if raw-secondary-p raw-value
+ (org-element--parse-objects
+ (progn (goto-char title-start)
+ (skip-chars-forward " \t")
+ (point))
+ (progn (goto-char title-end)
+ (skip-chars-backward " \t")
+ (point))
+ nil
+ (org-element-restriction 'headline)
+ headline)))))))
+
+(defun org-element-headline-interpreter (headline contents)
+ "Interpret HEADLINE element as Org syntax.
+CONTENTS is the contents of the element."
+ (let* ((level (org-element-property :level headline))
+ (todo (org-element-property :todo-keyword headline))
+ (priority (org-element-property :priority headline))
+ (title (org-element-interpret-data
+ (org-element-property :title headline)))
+ (tags (let ((tag-list (org-element-property :tags headline)))
+ (and tag-list
+ (format ":%s:" (mapconcat #'identity tag-list ":")))))
+ (commentedp (org-element-property :commentedp headline))
+ (pre-blank (or (org-element-property :pre-blank headline) 0))
+ (heading
+ (concat (make-string (if org-odd-levels-only (1- (* level 2)) level)
+ ?*)
+ (and todo (concat " " todo))
+ (and commentedp (concat " " org-comment-string))
+ (and priority (format " [#%c]" priority))
+ " "
+ (if (and org-footnote-section
+ (org-element-property :footnote-section-p headline))
+ org-footnote-section
+ title))))
+ (concat
+ heading
+ ;; Align tags.
+ (when tags
+ (cond
+ ((zerop org-tags-column) (format " %s" tags))
+ ((< org-tags-column 0)
+ (concat
+ (make-string
+ (max (- (+ org-tags-column (length heading) (length tags))) 1)
+ ?\s)
+ tags))
+ (t
+ (concat
+ (make-string (max (- org-tags-column (length heading)) 1) ?\s)
+ tags))))
+ (make-string (1+ pre-blank) ?\n)
+ contents)))
+
+
+;;;; Inlinetask
+
+(defun org-element-inlinetask-parser (limit &optional raw-secondary-p)
+ "Parse an inline task.
+
+Return a list whose CAR is `inlinetask' and CDR is a plist
+containing `:title', `:begin', `:end', `:pre-blank',
+`:contents-begin' and `:contents-end', `:level', `:priority',
+`:raw-value', `:tags', `:todo-keyword', `:todo-type',
+`:scheduled', `:deadline', `:closed', `:post-blank' and
+`:post-affiliated' keywords.
+
+The plist also contains any property set in the property drawer,
+with its name in upper cases and colons added at the
+beginning (e.g., `:CUSTOM_ID').
+
+When optional argument RAW-SECONDARY-P is non-nil, inline-task's
+title will not be parsed as a secondary string, but as a plain
+string instead.
+
+Assume point is at beginning of the inline task."
+ (save-excursion
+ (let* ((begin (point))
+ (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))
+ (progn (goto-char (match-end 0))
+ (skip-chars-forward " \t")
+ (match-string 0))))
+ (todo-type (and todo
+ (if (member todo org-done-keywords) 'done 'todo)))
+ (priority (and (looking-at "\\[#.\\][ \t]*")
+ (progn (goto-char (match-end 0))
+ (aref (match-string 0) 2))))
+ (title-start (point))
+ (tags (when (re-search-forward
+ "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"
+ (line-end-position)
+ 'move)
+ (goto-char (match-beginning 0))
+ (org-split-string (match-string 1) ":")))
+ (title-end (point))
+ (raw-value (org-trim
+ (buffer-substring-no-properties title-start title-end)))
+ (task-end (save-excursion
+ (end-of-line)
+ (and (re-search-forward org-outline-regexp-bol limit t)
+ (looking-at-p "[ \t]*END[ \t]*$")
+ (line-beginning-position))))
+ (standard-props (and task-end (org-element--get-node-properties)))
+ (time-props (and task-end (org-element--get-time-properties)))
+ (contents-begin (and task-end
+ (< (point) task-end)
+ (progn
+ (forward-line)
+ (skip-chars-forward " \t\n")
+ (line-beginning-position))))
+ (contents-end (and contents-begin task-end))
+ (end (progn (when task-end (goto-char task-end))
+ (forward-line)
+ (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position))))
+ (inlinetask
+ (list 'inlinetask
+ (nconc
+ (list :raw-value raw-value
+ :begin begin
+ :end end
+ :pre-blank
+ (if (not contents-begin) 0
+ (1- (count-lines begin contents-begin)))
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :level level
+ :priority priority
+ :tags tags
+ :todo-keyword todo
+ :todo-type todo-type
+ :post-blank (1- (count-lines (or task-end begin) end))
+ :post-affiliated begin)
+ time-props
+ standard-props))))
+ (org-element-put-property
+ inlinetask :title
+ (if raw-secondary-p raw-value
+ (org-element--parse-objects
+ (progn (goto-char title-start)
+ (skip-chars-forward " \t")
+ (point))
+ (progn (goto-char title-end)
+ (skip-chars-backward " \t")
+ (point))
+ nil
+ (org-element-restriction 'inlinetask)
+ inlinetask))))))
+
+(defun org-element-inlinetask-interpreter (inlinetask contents)
+ "Interpret INLINETASK element as Org syntax.
+CONTENTS is the contents of inlinetask."
+ (let* ((level (org-element-property :level inlinetask))
+ (todo (org-element-property :todo-keyword inlinetask))
+ (priority (org-element-property :priority inlinetask))
+ (title (org-element-interpret-data
+ (org-element-property :title inlinetask)))
+ (tags (let ((tag-list (org-element-property :tags inlinetask)))
+ (and tag-list
+ (format ":%s:" (mapconcat 'identity tag-list ":")))))
+ (task (concat (make-string level ?*)
+ (and todo (concat " " todo))
+ (and priority (format " [#%c]" priority))
+ (and title (concat " " title)))))
+ (concat task
+ ;; Align tags.
+ (when tags
+ (cond
+ ((zerop org-tags-column) (format " %s" tags))
+ ((< org-tags-column 0)
+ (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) ?\s)
+ tags))))
+ ;; Prefer degenerate inlinetasks when there are no
+ ;; contents.
+ (when contents
+ (concat "\n"
+ contents
+ (make-string level ?*) " end")))))
+
+
+;;;; Item
+
+(defun org-element-item-parser (_ struct &optional raw-secondary-p)
+ "Parse an item.
+
+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', `: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
+string instead.
+
+Assume point is at the beginning of the item."
+ (save-excursion
+ (beginning-of-line)
+ (looking-at org-list-full-item-re)
+ (let* ((begin (point))
+ (bullet (match-string-no-properties 1))
+ (checkbox (let ((box (match-string 3)))
+ (cond ((equal "[ ]" box) 'off)
+ ((equal "[X]" box) 'on)
+ ((equal "[-]" box) 'trans))))
+ (counter (let ((c (match-string 2)))
+ (save-match-data
+ (cond
+ ((not c) nil)
+ ((string-match "[A-Za-z]" c)
+ (- (string-to-char (upcase (match-string 0 c)))
+ 64))
+ ((string-match "[0-9]+" c)
+ (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
+ (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")
+ (line-beginning-position 2))))
+ (item
+ (list 'item
+ (list :bullet bullet
+ :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :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
+ item :tag
+ (let ((raw (org-list-get-tag begin struct)))
+ (when raw
+ (if raw-secondary-p raw
+ (org-element--parse-objects
+ (match-beginning 4) (match-end 4) nil
+ (org-element-restriction 'item)
+ item))))))))
+
+(defun org-element-item-interpreter (item contents)
+ "Interpret ITEM element as Org syntax.
+CONTENTS is the contents of the element."
+ (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
+ (pcase (org-element-property :counter item)
+ (`nil nil)
+ (counter (format "[@%d] " counter)))
+ (pcase (org-element-property :checkbox item)
+ (`on "[X] ")
+ (`off "[ ] ")
+ (`trans "[-] ")
+ (_ nil))
+ tag
+ (when 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
+
+(defun org-element--list-struct (limit)
+ ;; Return structure of list at point. Internal function. See
+ ;; `org-list-struct' for details.
+ (let ((case-fold-search t)
+ (top-ind limit)
+ (item-re (org-item-re))
+ (inlinetask-re (and (featurep 'org-inlinetask) "^\\*+ "))
+ items struct)
+ (save-excursion
+ (catch :exit
+ (while t
+ (cond
+ ;; At limit: end all items.
+ ((>= (point) limit)
+ (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)
+ (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")
+ (current-column))))
+ (setq top-ind (min top-ind ind))
+ (while (and items (<= ind (nth 1 (car items))))
+ (let ((item (pop items)))
+ (setcar (nthcdr 6 item) (point))
+ (push item struct)))
+ (push (progn (looking-at org-list-full-item-re)
+ (let ((bullet (match-string-no-properties 1)))
+ (list (point)
+ ind
+ bullet
+ (match-string-no-properties 2) ; counter
+ (match-string-no-properties 3) ; checkbox
+ ;; Description tag.
+ (and (save-match-data
+ (string-match "[-+*]" bullet))
+ (match-string-no-properties 4))
+ ;; Ending position, unknown so far.
+ nil)))
+ items))
+ (forward-line))
+ ;; Skip empty lines.
+ ((looking-at "^[ \t]*$") (forward-line))
+ ;; Skip inline tasks and blank lines along the way.
+ ((and inlinetask-re (looking-at inlinetask-re))
+ (forward-line)
+ (let ((origin (point)))
+ (when (re-search-forward inlinetask-re limit t)
+ (if (looking-at-p "END[ \t]*$") (forward-line)
+ (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)))
+ (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) end)
+ (push item struct)
+ (unless items
+ (throw :exit (sort struct #'car-less-than-car))))))
+ ;; Skip blocks (any type) and drawers contents.
+ (cond
+ ((and (looking-at "[ \t]*#\\+BEGIN\\(:\\|_\\S-+\\)")
+ (re-search-forward
+ (format "^[ \t]*#\\+END%s[ \t]*$" (match-string 1))
+ limit t)))
+ ((and (looking-at org-drawer-regexp)
+ (re-search-forward "^[ \t]*:END:[ \t]*$" limit t))))
+ (forward-line))))))))
+
+(defun org-element-plain-list-parser (limit affiliated structure)
+ "Parse a plain list.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value. STRUCTURE is the structure of the plain list being
+parsed.
+
+Return a list whose CAR is `plain-list' and CDR is a plist
+containing `:type', `:begin', `:end', `:contents-begin' and
+`:contents-end', `:structure', `:post-blank' and
+`:post-affiliated' keywords.
+
+Assume point is at the beginning of the list."
+ (save-excursion
+ (let* ((struct (or structure (org-element--list-struct limit)))
+ (type (cond ((looking-at-p "[ \t]*[A-Za-z0-9]") 'ordered)
+ ((nth 5 (assq (point) struct)) 'descriptive)
+ (t 'unordered)))
+ (contents-begin (point))
+ (begin (car affiliated))
+ (contents-end (let* ((item (assq contents-begin struct))
+ (ind (nth 1 item))
+ (pos (nth 6 item)))
+ (while (and (setq item (assq pos struct))
+ (= (nth 1 item) ind))
+ (setq pos (nth 6 item)))
+ pos))
+ (end (progn (goto-char contents-end)
+ (skip-chars-forward " \r\t\n" limit)
+ (if (= (point) limit) limit (line-beginning-position)))))
+ ;; Return value.
+ (list 'plain-list
+ (nconc
+ (list :type type
+ :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :structure struct
+ :post-blank (count-lines contents-end end)
+ :post-affiliated contents-begin)
+ (cdr affiliated))))))
+
+(defun org-element-plain-list-interpreter (_ contents)
+ "Interpret plain-list element as Org syntax.
+CONTENTS is the contents of the element."
+ (with-temp-buffer
+ (insert contents)
+ (goto-char (point-min))
+ (org-list-repair)
+ (buffer-string)))
+
+
+;;;; Property Drawer
+
+(defun org-element-property-drawer-parser (limit)
+ "Parse a property drawer.
+
+LIMIT bounds the search.
+
+Return a list whose car is `property-drawer' and cdr is a plist
+containing `:begin', `:end', `:contents-begin', `:contents-end',
+`:post-blank' and `:post-affiliated' keywords.
+
+Assume point is at the beginning of the property drawer."
+ (save-excursion
+ (let ((case-fold-search t)
+ (begin (point))
+ (contents-begin (line-beginning-position 2)))
+ (re-search-forward "^[ \t]*:END:[ \t]*$" limit t)
+ (let ((contents-end (and (> (match-beginning 0) contents-begin)
+ (match-beginning 0)))
+ (before-blank (progn (forward-line) (point)))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'property-drawer
+ (list :begin begin
+ :end end
+ :contents-begin (and contents-end contents-begin)
+ :contents-end contents-end
+ :post-blank (count-lines before-blank end)
+ :post-affiliated begin))))))
+
+(defun org-element-property-drawer-interpreter (_ contents)
+ "Interpret property-drawer element as Org syntax.
+CONTENTS is the properties within the drawer."
+ (format ":PROPERTIES:\n%s:END:" contents))
+
+
+;;;; Quote Block
+
+(defun org-element-quote-block-parser (limit affiliated)
+ "Parse a quote block.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `quote-block' and CDR is a plist
+containing `:begin', `:end', `:contents-begin', `:contents-end',
+`:post-blank' and `:post-affiliated' keywords.
+
+Assume point is at the beginning of the block."
+ (let ((case-fold-search t))
+ (if (not (save-excursion
+ (re-search-forward "^[ \t]*#\\+END_QUOTE[ \t]*$" limit t)))
+ ;; Incomplete block: parse it as a paragraph.
+ (org-element-paragraph-parser limit affiliated)
+ (let ((block-end-line (match-beginning 0)))
+ (save-excursion
+ (let* ((begin (car affiliated))
+ (post-affiliated (point))
+ ;; Empty blocks have no contents.
+ (contents-begin (progn (forward-line)
+ (and (< (point) block-end-line)
+ (point))))
+ (contents-end (and contents-begin block-end-line))
+ (pos-before-blank (progn (goto-char block-end-line)
+ (forward-line)
+ (point)))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'quote-block
+ (nconc
+ (list :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank (count-lines pos-before-blank end)
+ :post-affiliated post-affiliated)
+ (cdr affiliated)))))))))
+
+(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))
+
+
+;;;; Section
+
+(defun org-element-section-parser (_)
+ "Parse a section.
+
+Return a list whose CAR is `section' and CDR is a plist
+containing `:begin', `:end', `:contents-begin', `contents-end',
+`:post-blank' and `:post-affiliated' keywords."
+ (save-excursion
+ ;; Beginning of section is the beginning of the first non-blank
+ ;; line after previous headline.
+ (let ((begin (point))
+ (end (progn (org-with-limited-levels (outline-next-heading))
+ (point)))
+ (pos-before-blank (progn (skip-chars-backward " \r\t\n")
+ (line-beginning-position 2))))
+ (list 'section
+ (list :begin begin
+ :end end
+ :contents-begin begin
+ :contents-end pos-before-blank
+ :post-blank (count-lines pos-before-blank end)
+ :post-affiliated begin)))))
+
+(defun org-element-section-interpreter (_ contents)
+ "Interpret section element as Org syntax.
+CONTENTS is the contents of the element."
+ contents)
+
+
+;;;; Special Block
+
+(defun org-element-special-block-parser (limit affiliated)
+ "Parse a special block.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `special-block' and CDR is a plist
+containing `:type', `:begin', `:end', `:contents-begin',
+`:contents-end', `:post-blank' and `:post-affiliated' keywords.
+
+Assume point is at the beginning of the block."
+ (let* ((case-fold-search t)
+ (type (progn (looking-at "[ \t]*#\\+BEGIN_\\(\\S-+\\)")
+ (match-string-no-properties 1))))
+ (if (not (save-excursion
+ (re-search-forward
+ (format "^[ \t]*#\\+END_%s[ \t]*$" (regexp-quote type))
+ limit t)))
+ ;; Incomplete block: parse it as a paragraph.
+ (org-element-paragraph-parser limit affiliated)
+ (let ((block-end-line (match-beginning 0)))
+ (save-excursion
+ (let* ((begin (car affiliated))
+ (post-affiliated (point))
+ ;; Empty blocks have no contents.
+ (contents-begin (progn (forward-line)
+ (and (< (point) block-end-line)
+ (point))))
+ (contents-end (and contents-begin block-end-line))
+ (pos-before-blank (progn (goto-char block-end-line)
+ (forward-line)
+ (point)))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'special-block
+ (nconc
+ (list :type type
+ :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank (count-lines pos-before-blank end)
+ :post-affiliated post-affiliated)
+ (cdr affiliated)))))))))
+
+(defun org-element-special-block-interpreter (special-block contents)
+ "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)))
+
+
+
+;;; Elements
+;;
+;; For each element, a parser and an interpreter are also defined.
+;; Both follow the same naming convention used for greater elements.
+;;
+;; Also, as for greater elements, adding a new element type is done
+;; through the following steps: implement a parser and an interpreter,
+;; tweak `org-element--current-element' so that it recognizes the new
+;; type and add that new type to `org-element-all-elements'.
+
+
+;;;; Babel Call
+
+(defun org-element-babel-call-parser (limit affiliated)
+ "Parse a babel call.
+
+LIMIT bounds the search. AFFILIATED is a list of which car is
+the buffer position at the beginning of the first affiliated
+keyword and cdr is a plist of affiliated keywords along with
+their value.
+
+Return a list whose car is `babel-call' and cdr is a plist
+containing `:call', `:inside-header', `:arguments',
+`:end-header', `:begin', `:end', `:value', `:post-blank' and
+`:post-affiliated' as keywords."
+ (save-excursion
+ (let* ((begin (car affiliated))
+ (post-affiliated (point))
+ (before-blank (line-beginning-position 2))
+ (value (progn (search-forward ":" before-blank t)
+ (skip-chars-forward " \t")
+ (org-trim
+ (buffer-substring-no-properties
+ (point) (line-end-position)))))
+ (call
+ (or (org-string-nw-p
+ (buffer-substring-no-properties
+ (point) (progn (skip-chars-forward "^[]()" before-blank)
+ (point))))))
+ (inside-header (org-element--parse-paired-brackets ?\[))
+ (arguments (org-string-nw-p
+ (org-element--parse-paired-brackets ?\()))
+ (end-header
+ (org-string-nw-p
+ (org-trim
+ (buffer-substring-no-properties (point) (line-end-position)))))
+ (end (progn (forward-line)
+ (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'babel-call
+ (nconc
+ (list :call call
+ :inside-header inside-header
+ :arguments arguments
+ :end-header end-header
+ :begin begin
+ :end end
+ :value value
+ :post-blank (count-lines before-blank end)
+ :post-affiliated post-affiliated)
+ (cdr affiliated))))))
+
+(defun org-element-babel-call-interpreter (babel-call _)
+ "Interpret BABEL-CALL element as Org syntax."
+ (concat "#+call: "
+ (org-element-property :call babel-call)
+ (let ((h (org-element-property :inside-header babel-call)))
+ (and h (format "[%s]" h)))
+ (concat "(" (org-element-property :arguments babel-call) ")")
+ (let ((h (org-element-property :end-header babel-call)))
+ (and h (concat " " h)))))
+
+
+;;;; Clock
+
+(defun org-element-clock-parser (limit)
+ "Parse a clock.
+
+LIMIT bounds the search.
+
+Return a list whose CAR is `clock' and CDR is a plist containing
+`:status', `:value', `:time', `:begin', `:end', `:post-blank' and
+`:post-affiliated' as keywords."
+ (save-excursion
+ (let* ((case-fold-search nil)
+ (begin (point))
+ (value (progn (search-forward "CLOCK:" (line-end-position) t)
+ (skip-chars-forward " \t")
+ (org-element-timestamp-parser)))
+ (duration (and (search-forward " => " (line-end-position) t)
+ (progn (skip-chars-forward " \t")
+ (looking-at "\\(\\S-+\\)[ \t]*$"))
+ (match-string-no-properties 1)))
+ (status (if duration 'closed 'running))
+ (post-blank (let ((before-blank (progn (forward-line) (point))))
+ (skip-chars-forward " \r\t\n" limit)
+ (skip-chars-backward " \t")
+ (unless (bolp) (end-of-line))
+ (count-lines before-blank (point))))
+ (end (point)))
+ (list 'clock
+ (list :status status
+ :value value
+ :duration duration
+ :begin begin
+ :end end
+ :post-blank post-blank
+ :post-affiliated begin)))))
+
+(defun org-element-clock-interpreter (clock _)
+ "Interpret CLOCK element as Org syntax."
+ (concat "CLOCK: "
+ (org-element-timestamp-interpreter
+ (org-element-property :value clock) nil)
+ (let ((duration (org-element-property :duration clock)))
+ (and duration
+ (concat " => "
+ (apply 'format
+ "%2s:%02s"
+ (org-split-string duration ":")))))))
+
+
+;;;; Comment
+
+(defun org-element-comment-parser (limit)
+ "Parse a comment.
+
+LIMIT bounds the search.
+
+Return a list whose CAR is `comment' and CDR is a plist
+containing `:begin', `:end', `:value', `:post-blank',
+`:post-affiliated' keywords.
+
+Assume point is at comment beginning."
+ (save-excursion
+ (let* ((begin (point))
+ (value (prog2 (looking-at "[ \t]*# ?")
+ (buffer-substring-no-properties
+ (match-end 0) (line-end-position))
+ (forward-line)))
+ (com-end
+ ;; Get comments ending.
+ (progn
+ (while (and (< (point) limit) (looking-at "[ \t]*#\\( \\|$\\)"))
+ ;; Accumulate lines without leading hash and first
+ ;; whitespace.
+ (setq value
+ (concat value
+ "\n"
+ (buffer-substring-no-properties
+ (match-end 0) (line-end-position))))
+ (forward-line))
+ (point)))
+ (end (progn (goto-char com-end)
+ (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'comment
+ (list :begin begin
+ :end end
+ :value value
+ :post-blank (count-lines com-end end)
+ :post-affiliated begin)))))
+
+(defun org-element-comment-interpreter (comment _)
+ "Interpret COMMENT element as Org syntax.
+CONTENTS is nil."
+ (replace-regexp-in-string "^" "# " (org-element-property :value comment)))
+
+
+;;;; Comment Block
+
+(defun org-element-comment-block-parser (limit affiliated)
+ "Parse an export block.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `comment-block' and CDR is a plist
+containing `:begin', `:end', `:value', `:post-blank' and
+`:post-affiliated' keywords.
+
+Assume point is at comment block beginning."
+ (let ((case-fold-search t))
+ (if (not (save-excursion
+ (re-search-forward "^[ \t]*#\\+END_COMMENT[ \t]*$" limit t)))
+ ;; Incomplete block: parse it as a paragraph.
+ (org-element-paragraph-parser limit affiliated)
+ (let ((contents-end (match-beginning 0)))
+ (save-excursion
+ (let* ((begin (car affiliated))
+ (post-affiliated (point))
+ (contents-begin (progn (forward-line) (point)))
+ (pos-before-blank (progn (goto-char contents-end)
+ (forward-line)
+ (point)))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position))))
+ (value (buffer-substring-no-properties
+ contents-begin contents-end)))
+ (list 'comment-block
+ (nconc
+ (list :begin begin
+ :end end
+ :value value
+ :post-blank (count-lines pos-before-blank end)
+ :post-affiliated post-affiliated)
+ (cdr affiliated)))))))))
+
+(defun org-element-comment-block-interpreter (comment-block _)
+ "Interpret COMMENT-BLOCK element as Org syntax."
+ (format "#+begin_comment\n%s#+end_comment"
+ (org-element-normalize-string
+ (org-remove-indentation
+ (org-element-property :value comment-block)))))
+
+
+;;;; Diary Sexp
+
+(defun org-element-diary-sexp-parser (limit affiliated)
+ "Parse a diary sexp.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `diary-sexp' and CDR is a plist
+containing `:begin', `:end', `:value', `:post-blank' and
+`:post-affiliated' keywords."
+ (save-excursion
+ (let ((begin (car affiliated))
+ (post-affiliated (point))
+ (value (progn (looking-at "\\(%%(.*\\)[ \t]*$")
+ (match-string-no-properties 1)))
+ (pos-before-blank (progn (forward-line) (point)))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'diary-sexp
+ (nconc
+ (list :value value
+ :begin begin
+ :end end
+ :post-blank (count-lines pos-before-blank end)
+ :post-affiliated post-affiliated)
+ (cdr affiliated))))))
+
+(defun org-element-diary-sexp-interpreter (diary-sexp _)
+ "Interpret DIARY-SEXP as Org syntax."
+ (org-element-property :value diary-sexp))
+
+
+;;;; Example Block
+
+(defun org-element-example-block-parser (limit affiliated)
+ "Parse an example block.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `example-block' and CDR is a plist
+containing `:begin', `:end', `:number-lines', `:preserve-indent',
+`:retain-labels', `:use-labels', `:label-fmt', `:switches',
+`:value', `:post-blank' and `:post-affiliated' keywords."
+ (let ((case-fold-search t))
+ (if (not (save-excursion
+ (re-search-forward "^[ \t]*#\\+END_EXAMPLE[ \t]*$" limit t)))
+ ;; Incomplete block: parse it as a paragraph.
+ (org-element-paragraph-parser limit affiliated)
+ (let ((contents-end (match-beginning 0)))
+ (save-excursion
+ (let* ((switches
+ (progn
+ (looking-at "^[ \t]*#\\+BEGIN_EXAMPLE\\(?: +\\(.*\\)\\)?")
+ (match-string-no-properties 1)))
+ ;; Switches analysis.
+ (number-lines
+ (and switches
+ (string-match "\\([-+]\\)n\\(?: *\\([0-9]+\\)\\)?\\>"
+ switches)
+ (cons
+ (if (equal (match-string 1 switches) "-")
+ 'new
+ 'continued)
+ (if (not (match-end 2)) 0
+ ;; Subtract 1 to give number of lines before
+ ;; first line.
+ (1- (string-to-number (match-string 2 switches)))))))
+ (preserve-indent
+ (and switches (string-match "-i\\>" switches)))
+ ;; Should labels be retained in (or stripped from) example
+ ;; blocks?
+ (retain-labels
+ (or (not switches)
+ (not (string-match "-r\\>" switches))
+ (and number-lines (string-match "-k\\>" switches))))
+ ;; What should code-references use - labels or
+ ;; line-numbers?
+ (use-labels
+ (or (not switches)
+ (and retain-labels
+ (not (string-match "-k\\>" switches)))))
+ (label-fmt
+ (and switches
+ (string-match "-l +\"\\([^\"\n]+\\)\"" switches)
+ (match-string 1 switches)))
+ ;; Standard block parsing.
+ (begin (car affiliated))
+ (post-affiliated (point))
+ (contents-begin (line-beginning-position 2))
+ (value (org-unescape-code-in-string
+ (buffer-substring-no-properties
+ contents-begin contents-end)))
+ (pos-before-blank (progn (goto-char contents-end)
+ (forward-line)
+ (point)))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'example-block
+ (nconc
+ (list :begin begin
+ :end end
+ :value value
+ :switches switches
+ :number-lines number-lines
+ :preserve-indent preserve-indent
+ :retain-labels retain-labels
+ :use-labels use-labels
+ :label-fmt label-fmt
+ :post-blank (count-lines pos-before-blank end)
+ :post-affiliated post-affiliated)
+ (cdr affiliated)))))))))
+
+(defun org-element-example-block-interpreter (example-block _)
+ "Interpret EXAMPLE-BLOCK element as Org syntax."
+ (let ((switches (org-element-property :switches example-block))
+ (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
+
+(defun org-element-export-block-parser (limit affiliated)
+ "Parse an export block.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `export-block' and CDR is a plist
+containing `:begin', `:end', `:type', `:value', `:post-blank' and
+`:post-affiliated' keywords.
+
+Assume point is at export-block beginning."
+ (let* ((case-fold-search t))
+ (if (not (save-excursion
+ (re-search-forward "^[ \t]*#\\+END_EXPORT[ \t]*$" limit t)))
+ ;; Incomplete block: parse it as a paragraph.
+ (org-element-paragraph-parser limit affiliated)
+ (save-excursion
+ (let* ((contents-end (match-beginning 0))
+ (backend
+ (progn
+ (looking-at
+ "[ \t]*#\\+BEGIN_EXPORT\\(?:[ \t]+\\(\\S-+\\)\\)?[ \t]*$")
+ (match-string-no-properties 1)))
+ (begin (car affiliated))
+ (post-affiliated (point))
+ (contents-begin (progn (forward-line) (point)))
+ (pos-before-blank (progn (goto-char contents-end)
+ (forward-line)
+ (point)))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position))))
+ (value (org-unescape-code-in-string
+ (buffer-substring-no-properties contents-begin
+ contents-end))))
+ (list 'export-block
+ (nconc
+ (list :type (and backend (upcase backend))
+ :begin begin
+ :end end
+ :value value
+ :post-blank (count-lines pos-before-blank end)
+ :post-affiliated post-affiliated)
+ (cdr affiliated))))))))
+
+(defun org-element-export-block-interpreter (export-block _)
+ "Interpret EXPORT-BLOCK element as Org syntax."
+ (format "#+begin_export %s\n%s#+end_export"
+ (org-element-property :type export-block)
+ (org-element-property :value export-block)))
+
+
+;;;; Fixed-width
+
+(defun org-element-fixed-width-parser (limit affiliated)
+ "Parse a fixed-width section.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `fixed-width' and CDR is a plist
+containing `:begin', `:end', `:value', `:post-blank' and
+`:post-affiliated' keywords.
+
+Assume point is at the beginning of the fixed-width area."
+ (save-excursion
+ (let* ((begin (car affiliated))
+ (post-affiliated (point))
+ (end-area
+ (progn
+ (while (and (< (point) limit)
+ (looking-at "[ \t]*:\\( \\|$\\)"))
+ (forward-line))
+ (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 (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))))))
+
+(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 "^" ": " value))))
+
+
+;;;; Horizontal Rule
+
+(defun org-element-horizontal-rule-parser (limit affiliated)
+ "Parse an horizontal rule.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `horizontal-rule' and CDR is a plist
+containing `:begin', `:end', `:post-blank' and `:post-affiliated'
+keywords."
+ (save-excursion
+ (let ((begin (car affiliated))
+ (post-affiliated (point))
+ (post-hr (progn (forward-line) (point)))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'horizontal-rule
+ (nconc
+ (list :begin begin
+ :end end
+ :post-blank (count-lines post-hr end)
+ :post-affiliated post-affiliated)
+ (cdr affiliated))))))
+
+(defun org-element-horizontal-rule-interpreter (&rest _)
+ "Interpret HORIZONTAL-RULE element as Org syntax."
+ "-----")
+
+
+;;;; Keyword
+
+(defun org-element-keyword-parser (limit affiliated)
+ "Parse a keyword at point.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is a normalized `keyword' (uppercase) and
+CDR is a plist containing `:key', `:value', `:begin', `:end',
+`:post-blank' and `:post-affiliated' keywords."
+ (save-excursion
+ ;; An orphaned affiliated keyword is considered as a regular
+ ;; keyword. In this case AFFILIATED is nil, so we take care of
+ ;; this corner case.
+ (let ((begin (or (car affiliated) (point)))
+ (post-affiliated (point))
+ (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))))
+ (pos-before-blank (progn (forward-line) (point)))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'keyword
+ (nconc
+ (list :key key
+ :value value
+ :begin begin
+ :end end
+ :post-blank (count-lines pos-before-blank end)
+ :post-affiliated post-affiliated)
+ (cdr affiliated))))))
+
+(defun org-element-keyword-interpreter (keyword _)
+ "Interpret KEYWORD element as Org syntax."
+ (format "#+%s: %s"
+ (downcase (org-element-property :key keyword))
+ (org-element-property :value keyword)))
+
+
+;;;; Latex Environment
+
+(defconst org-element--latex-begin-environment
+ "^[ \t]*\\\\begin{\\([A-Za-z0-9*]+\\)}"
+ "Regexp matching the beginning of a LaTeX environment.
+The environment is captured by the first group.
+
+See also `org-element--latex-end-environment'.")
+
+(defconst org-element--latex-end-environment
+ "\\\\end{%s}[ \t]*$"
+ "Format string matching the ending of a LaTeX environment.
+See also `org-element--latex-begin-environment'.")
+
+(defun org-element-latex-environment-parser (limit affiliated)
+ "Parse a LaTeX environment.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `latex-environment' and CDR is a plist
+containing `:begin', `:end', `:value', `:post-blank' and
+`:post-affiliated' keywords.
+
+Assume point is at the beginning of the latex environment."
+ (save-excursion
+ (let ((case-fold-search t)
+ (code-begin (point)))
+ (looking-at org-element--latex-begin-environment)
+ (if (not (re-search-forward (format org-element--latex-end-environment
+ (regexp-quote (match-string 1)))
+ limit t))
+ ;; Incomplete latex environment: parse it as a paragraph.
+ (org-element-paragraph-parser limit affiliated)
+ (let* ((code-end (progn (forward-line) (point)))
+ (begin (car affiliated))
+ (value (buffer-substring-no-properties code-begin code-end))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'latex-environment
+ (nconc
+ (list :begin begin
+ :end end
+ :value value
+ :post-blank (count-lines code-end end)
+ :post-affiliated code-begin)
+ (cdr affiliated))))))))
+
+(defun org-element-latex-environment-interpreter (latex-environment _)
+ "Interpret LATEX-ENVIRONMENT element as Org syntax."
+ (org-element-property :value latex-environment))
+
+
+;;;; Node Property
+
+(defun org-element-node-property-parser (limit)
+ "Parse a node-property at point.
+
+LIMIT bounds the search.
+
+Return a list whose CAR is `node-property' and CDR is a plist
+containing `:key', `:value', `:begin', `:end', `:post-blank' and
+`:post-affiliated' keywords."
+ (looking-at org-property-re)
+ (let ((case-fold-search t)
+ (begin (point))
+ (key (match-string-no-properties 2))
+ (value (match-string-no-properties 3))
+ (end (save-excursion
+ (end-of-line)
+ (if (re-search-forward org-property-re limit t)
+ (line-beginning-position)
+ limit))))
+ (list 'node-property
+ (list :key key
+ :value value
+ :begin begin
+ :end end
+ :post-blank 0
+ :post-affiliated begin))))
+
+(defun org-element-node-property-interpreter (node-property _)
+ "Interpret NODE-PROPERTY element as Org syntax."
+ (format org-property-format
+ (format ":%s:" (org-element-property :key node-property))
+ (or (org-element-property :value node-property) "")))
+
+
+;;;; Paragraph
+
+(defun org-element-paragraph-parser (limit affiliated)
+ "Parse a paragraph.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `paragraph' and CDR is a plist
+containing `:begin', `:end', `:contents-begin' and
+`:contents-end', `:post-blank' and `:post-affiliated' keywords.
+
+Assume point is at the beginning of the paragraph."
+ (save-excursion
+ (let* ((begin (car affiliated))
+ (contents-begin (point))
+ (before-blank
+ (let ((case-fold-search t))
+ (end-of-line)
+ ;; A matching `org-element-paragraph-separate' is not
+ ;; necessarily the end of the paragraph. In particular,
+ ;; drawers, blocks or LaTeX environments opening lines
+ ;; must be closed. Moreover keywords with a secondary
+ ;; value must belong to "dual keywords".
+ (while (not
+ (cond
+ ((not (and (re-search-forward
+ org-element-paragraph-separate limit 'move)
+ (progn (beginning-of-line) t))))
+ ((looking-at org-drawer-regexp)
+ (save-excursion
+ (re-search-forward "^[ \t]*:END:[ \t]*$" limit t)))
+ ((looking-at "[ \t]*#\\+BEGIN_\\(\\S-+\\)")
+ (save-excursion
+ (re-search-forward
+ (format "^[ \t]*#\\+END_%s[ \t]*$"
+ (regexp-quote (match-string 1)))
+ limit t)))
+ ((looking-at org-element--latex-begin-environment)
+ (save-excursion
+ (re-search-forward
+ (format org-element--latex-end-environment
+ (regexp-quote (match-string 1)))
+ limit t)))
+ ((looking-at "[ \t]*#\\+\\(\\S-+\\)\\[.*\\]:")
+ (member-ignore-case (match-string 1)
+ org-element-dual-keywords))
+ ;; Everything else is unambiguous.
+ (t)))
+ (end-of-line))
+ (if (= (point) limit) limit
+ (goto-char (line-beginning-position)))))
+ (contents-end (save-excursion
+ (skip-chars-backward " \r\t\n" contents-begin)
+ (line-beginning-position 2)))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'paragraph
+ (nconc
+ (list :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank (count-lines before-blank end)
+ :post-affiliated contents-begin)
+ (cdr affiliated))))))
+
+(defun org-element-paragraph-interpreter (_ contents)
+ "Interpret paragraph element as Org syntax.
+CONTENTS is the contents of the element."
+ contents)
+
+
+;;;; Planning
+
+(defun org-element-planning-parser (limit)
+ "Parse a planning.
+
+LIMIT bounds the search.
+
+Return a list whose CAR is `planning' and CDR is a plist
+containing `:closed', `:deadline', `:scheduled', `:begin',
+`:end', `:post-blank' and `:post-affiliated' keywords."
+ (save-excursion
+ (let* ((case-fold-search nil)
+ (begin (point))
+ (post-blank (let ((before-blank (progn (forward-line) (point))))
+ (skip-chars-forward " \r\t\n" limit)
+ (skip-chars-backward " \t")
+ (unless (bolp) (end-of-line))
+ (count-lines before-blank (point))))
+ (end (point))
+ closed deadline scheduled)
+ (goto-char begin)
+ (while (re-search-forward org-keyword-time-not-clock-regexp end t)
+ (goto-char (match-end 1))
+ (skip-chars-forward " \t" end)
+ (let ((keyword (match-string 1))
+ (time (org-element-timestamp-parser)))
+ (cond ((equal keyword org-closed-string) (setq closed time))
+ ((equal keyword org-deadline-string) (setq deadline time))
+ (t (setq scheduled time)))))
+ (list 'planning
+ (list :closed closed
+ :deadline deadline
+ :scheduled scheduled
+ :begin begin
+ :end end
+ :post-blank post-blank
+ :post-affiliated begin)))))
+
+(defun org-element-planning-interpreter (planning _)
+ "Interpret PLANNING element as Org syntax."
+ (mapconcat
+ #'identity
+ (delq nil
+ (list (let ((deadline (org-element-property :deadline planning)))
+ (when deadline
+ (concat org-deadline-string " "
+ (org-element-timestamp-interpreter deadline nil))))
+ (let ((scheduled (org-element-property :scheduled planning)))
+ (when scheduled
+ (concat org-scheduled-string " "
+ (org-element-timestamp-interpreter scheduled nil))))
+ (let ((closed (org-element-property :closed planning)))
+ (when closed
+ (concat org-closed-string " "
+ (org-element-timestamp-interpreter closed nil))))))
+ " "))
+
+
+;;;; Src Block
+
+(defun org-element-src-block-parser (limit affiliated)
+ "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
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `src-block' and CDR is a plist
+containing `:language', `:switches', `:parameters', `:begin',
+`:end', `:number-lines', `:retain-labels', `:use-labels',
+`:label-fmt', `:preserve-indent', `:value', `:post-blank' and
+`:post-affiliated' keywords.
+
+Assume point is at the beginning of the block."
+ (let ((case-fold-search t))
+ (if (not (save-excursion (re-search-forward "^[ \t]*#\\+END_SRC[ \t]*$"
+ limit t)))
+ ;; Incomplete block: parse it as a paragraph.
+ (org-element-paragraph-parser limit affiliated)
+ (let ((contents-end (match-beginning 0)))
+ (save-excursion
+ (let* ((begin (car affiliated))
+ (post-affiliated (point))
+ ;; Get language as a string.
+ (language
+ (progn
+ (looking-at
+ "^[ \t]*#\\+BEGIN_SRC\
+\\(?: +\\(\\S-+\\)\\)?\
+\\(\\(?: +\\(?:-\\(?:l \".+\"\\|[ikr]\\)\\|[-+]n\\(?: *[0-9]+\\)?\\)\\)+\\)?\
+\\(.*\\)[ \t]*$")
+ (match-string-no-properties 1)))
+ ;; Get switches.
+ (switches (match-string-no-properties 2))
+ ;; Get parameters.
+ (parameters (match-string-no-properties 3))
+ ;; Switches analysis.
+ (number-lines
+ (and switches
+ (string-match "\\([-+]\\)n\\(?: *\\([0-9]+\\)\\)?\\>"
+ switches)
+ (cons
+ (if (equal (match-string 1 switches) "-")
+ 'new
+ 'continued)
+ (if (not (match-end 2)) 0
+ ;; Subtract 1 to give number of lines before
+ ;; first line.
+ (1- (string-to-number (match-string 2 switches)))))))
+ (preserve-indent (and switches
+ (string-match "-i\\>" switches)))
+ (label-fmt
+ (and switches
+ (string-match "-l +\"\\([^\"\n]+\\)\"" switches)
+ (match-string 1 switches)))
+ ;; Should labels be retained in (or stripped from)
+ ;; source blocks?
+ (retain-labels
+ (or (not switches)
+ (not (string-match "-r\\>" switches))
+ (and number-lines (string-match "-k\\>" switches))))
+ ;; What should code-references use - labels or
+ ;; line-numbers?
+ (use-labels
+ (or (not switches)
+ (and retain-labels
+ (not (string-match "-k\\>" switches)))))
+ ;; Retrieve code.
+ (value (org-unescape-code-in-string
+ (buffer-substring-no-properties
+ (line-beginning-position 2) contents-end)))
+ (pos-before-blank (progn (goto-char contents-end)
+ (forward-line)
+ (point)))
+ ;; Get position after ending blank lines.
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'src-block
+ (nconc
+ (list :language language
+ :switches (and (org-string-nw-p switches)
+ (org-trim switches))
+ :parameters (and (org-string-nw-p parameters)
+ (org-trim parameters))
+ :begin begin
+ :end end
+ :number-lines number-lines
+ :preserve-indent preserve-indent
+ :retain-labels retain-labels
+ :use-labels use-labels
+ :label-fmt label-fmt
+ :value value
+ :post-blank (count-lines pos-before-blank end)
+ :post-affiliated post-affiliated)
+ (cdr affiliated)))))))))
+
+(defun org-element-src-block-interpreter (src-block _)
+ "Interpret SRC-BLOCK element as Org syntax."
+ (let ((lang (org-element-property :language src-block))
+ (switches (org-element-property :switches src-block))
+ (params (org-element-property :parameters src-block))
+ (value
+ (let ((val (org-element-property :value src-block)))
+ (cond
+ ((or org-src-preserve-indentation
+ (org-element-property :preserve-indent src-block))
+ val)
+ ((zerop 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))))))))
+ (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
+
+(defun org-element-table-parser (limit affiliated)
+ "Parse a table at point.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `table' and CDR is a plist containing
+`:begin', `:end', `:tblfm', `:type', `:contents-begin',
+`:contents-end', `:value', `:post-blank' and `:post-affiliated'
+keywords.
+
+Assume point is at the beginning of the table."
+ (save-excursion
+ (let* ((case-fold-search t)
+ (table-begin (point))
+ (type (if (looking-at "[ \t]*|") 'org 'table.el))
+ (end-re (format "^[ \t]*\\($\\|[^| \t%s]\\)"
+ (if (eq type 'org) "" "+")))
+ (begin (car affiliated))
+ (table-end
+ (if (re-search-forward end-re limit 'move)
+ (goto-char (match-beginning 0))
+ (point)))
+ (tblfm (let (acc)
+ (while (looking-at "[ \t]*#\\+TBLFM: +\\(.*\\)[ \t]*$")
+ (push (match-string-no-properties 1) acc)
+ (forward-line))
+ acc))
+ (pos-before-blank (point))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'table
+ (nconc
+ (list :begin begin
+ :end end
+ :type type
+ :tblfm tblfm
+ ;; Only `org' tables have contents. `table.el' tables
+ ;; use a `:value' property to store raw table as
+ ;; a string.
+ :contents-begin (and (eq type 'org) table-begin)
+ :contents-end (and (eq type 'org) table-end)
+ :value (and (eq type 'table.el)
+ (buffer-substring-no-properties
+ table-begin table-end))
+ :post-blank (count-lines pos-before-blank end)
+ :post-affiliated table-begin)
+ (cdr affiliated))))))
+
+(defun org-element-table-interpreter (table contents)
+ "Interpret TABLE element as Org syntax.
+CONTENTS is a string, if table's type is `org', or nil."
+ (if (eq (org-element-property :type table) 'table.el)
+ (org-remove-indentation (org-element-property :value table))
+ (concat (with-temp-buffer (insert contents)
+ (org-table-align)
+ (buffer-string))
+ (mapconcat (lambda (fm) (concat "#+TBLFM: " fm))
+ (reverse (org-element-property :tblfm table))
+ "\n"))))
+
+
+;;;; Table Row
+
+(defun org-element-table-row-parser (_)
+ "Parse table row at point.
+
+Return a list whose CAR is `table-row' and CDR is a plist
+containing `:begin', `:end', `:contents-begin', `:contents-end',
+`:type', `:post-blank' and `:post-affiliated' keywords."
+ (save-excursion
+ (let* ((type (if (looking-at "^[ \t]*|-") 'rule 'standard))
+ (begin (point))
+ ;; A table rule has no contents. In that case, ensure
+ ;; CONTENTS-BEGIN matches CONTENTS-END.
+ (contents-begin (and (eq type 'standard) (search-forward "|")))
+ (contents-end (and (eq type 'standard)
+ (progn
+ (end-of-line)
+ (skip-chars-backward " \t")
+ (point))))
+ (end (line-beginning-position 2)))
+ (list 'table-row
+ (list :type type
+ :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank 0
+ :post-affiliated begin)))))
+
+(defun org-element-table-row-interpreter (table-row contents)
+ "Interpret TABLE-ROW element as Org syntax.
+CONTENTS is the contents of the table row."
+ (if (eq (org-element-property :type table-row) 'rule) "|-"
+ (concat "|" contents)))
+
+
+;;;; Verse Block
+
+(defun org-element-verse-block-parser (limit affiliated)
+ "Parse a verse block.
+
+LIMIT bounds the search. AFFILIATED is a list of which CAR is
+the buffer position at the beginning of the first affiliated
+keyword and CDR is a plist of affiliated keywords along with
+their value.
+
+Return a list whose CAR is `verse-block' and CDR is a plist
+containing `:begin', `:end', `:contents-begin', `:contents-end',
+`:post-blank' and `:post-affiliated' keywords.
+
+Assume point is at beginning of the block."
+ (let ((case-fold-search t))
+ (if (not (save-excursion
+ (re-search-forward "^[ \t]*#\\+END_VERSE[ \t]*$" limit t)))
+ ;; Incomplete block: parse it as a paragraph.
+ (org-element-paragraph-parser limit affiliated)
+ (let ((contents-end (match-beginning 0)))
+ (save-excursion
+ (let* ((begin (car affiliated))
+ (post-affiliated (point))
+ (contents-begin (progn (forward-line) (point)))
+ (pos-before-blank (progn (goto-char contents-end)
+ (forward-line)
+ (point)))
+ (end (progn (skip-chars-forward " \r\t\n" limit)
+ (if (eobp) (point) (line-beginning-position)))))
+ (list 'verse-block
+ (nconc
+ (list :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank (count-lines pos-before-blank end)
+ :post-affiliated post-affiliated)
+ (cdr affiliated)))))))))
+
+(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))
+
+
+
+;;; Objects
+;;
+;; Unlike to elements, raw text can be found between objects. Hence,
+;; `org-element--object-lex' is provided to find the next object in
+;; buffer.
+;;
+;; Some object types (e.g., `italic') are recursive. Restrictions on
+;; object types they can contain will be specified in
+;; `org-element-object-restrictions'.
+;;
+;; Creating a new type of object requires to alter
+;; `org-element--object-regexp' and `org-element--object-lex', add the
+;; new type in `org-element-all-objects', and possibly add
+;; restrictions in `org-element-object-restrictions'.
+
+;;;; Bold
+
+(defun org-element-bold-parser ()
+ "Parse bold object at point, if any.
+
+When at a bold object, return a list whose car is `bold' and cdr
+is a plist with `:begin', `:end', `:contents-begin' and
+`:contents-end' and `:post-blank' keywords. Otherwise, return
+nil.
+
+Assume point is at the first star marker."
+ (save-excursion
+ (unless (bolp) (backward-char 1))
+ (when (looking-at org-emph-re)
+ (let ((begin (match-beginning 2))
+ (contents-begin (match-beginning 4))
+ (contents-end (match-end 4))
+ (post-blank (progn (goto-char (match-end 2))
+ (skip-chars-forward " \t")))
+ (end (point)))
+ (list 'bold
+ (list :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank post-blank))))))
+
+(defun org-element-bold-interpreter (_ contents)
+ "Interpret bold object as Org syntax.
+CONTENTS is the contents of the object."
+ (format "*%s*" contents))
+
+
+;;;; Citation
+
+(defun org-element-citation-parser ()
+ "Parse citation object at point, if any.
+
+When at a citation object, return a list whose car is `citation'
+and cdr is a plist with `:style', `:prefix', `:suffix', `:begin',
+`:end', `:contents-begin', `:contents-end', and `:post-blank'
+keywords. Otherwise, return nil.
+
+Assume point is at the beginning of the citation."
+ (when (looking-at org-element-citation-prefix-re)
+ (let* ((begin (point))
+ (style (and (match-end 1)
+ (match-string-no-properties 1)))
+ ;; Ignore blanks between cite type and prefix or key.
+ (start (match-end 0))
+ (closing (with-syntax-table org-element--pair-square-table
+ (ignore-errors (scan-lists begin 1 0)))))
+ (save-excursion
+ (when (and closing
+ (re-search-forward org-element-citation-key-re closing t))
+ ;; Find prefix, if any.
+ (let ((first-key-end (match-end 0))
+ (types (org-element-restriction 'citation-reference))
+ (cite
+ (list 'citation
+ (list :style style
+ :begin begin
+ :post-blank (progn
+ (goto-char closing)
+ (skip-chars-forward " \t"))
+ :end (point)))))
+ ;; `:contents-begin' depends on the presence of
+ ;; a non-empty common prefix.
+ (goto-char first-key-end)
+ (if (not (search-backward ";" start t))
+ (org-element-put-property cite :contents-begin start)
+ (when (< start (point))
+ (org-element-put-property
+ cite :prefix
+ (org-element--parse-objects start (point) nil types cite)))
+ (forward-char)
+ (org-element-put-property cite :contents-begin (point)))
+ ;; `:contents-end' depends on the presence of a non-empty
+ ;; common suffix.
+ (goto-char (1- closing))
+ (skip-chars-backward " \r\t\n")
+ (let ((end (point)))
+ (if (or (not (search-backward ";" first-key-end t))
+ (re-search-forward org-element-citation-key-re end t))
+ (org-element-put-property cite :contents-end end)
+ (forward-char)
+ (when (< (point) end)
+ (org-element-put-property
+ cite :suffix
+ (org-element--parse-objects (point) end nil types cite)))
+ (org-element-put-property cite :contents-end (point))))
+ cite))))))
+
+(defun org-element-citation-interpreter (citation contents)
+ "Interpret CITATION object as Org syntax.
+CONTENTS is the contents of the object, as a string."
+ (let ((prefix (org-element-property :prefix citation))
+ (suffix (org-element-property :suffix citation))
+ (style (org-element-property :style citation)))
+ (concat "[cite"
+ (and style (concat "/" style))
+ ":"
+ (and prefix (concat (org-element-interpret-data prefix) ";"))
+ (if suffix
+ (concat contents (org-element-interpret-data suffix))
+ ;; Remove spurious semicolon.
+ (substring contents nil -1))
+ "]")))
+
+
+;;;; Citation Reference
+
+(defun org-element-citation-reference-parser ()
+ "Parse citation reference object at point, if any.
+
+When at a reference, return a list whose car is
+`citation-reference', and cdr is a plist with `:key',
+`:prefix', `:suffix', `:begin', `:end', and `:post-blank' keywords.
+
+Assume point is at the beginning of the reference."
+ (save-excursion
+ (let ((begin (point)))
+ (when (re-search-forward org-element-citation-key-re nil t)
+ (let* ((key (match-string-no-properties 1))
+ (key-start (match-beginning 0))
+ (key-end (match-end 0))
+ (separator (search-forward ";" nil t))
+ (end (or separator (point-max)))
+ (suffix-end (if separator (1- end) end))
+ (types (org-element-restriction 'citation-reference))
+ (reference
+ (list 'citation-reference
+ (list :key key
+ :begin begin
+ :end end
+ :post-blank 0))))
+ (when (< begin key-start)
+ (org-element-put-property
+ reference :prefix
+ (org-element--parse-objects begin key-start nil types reference)))
+ (when (< key-end suffix-end)
+ (org-element-put-property
+ reference :suffix
+ (org-element--parse-objects key-end suffix-end nil types reference)))
+ reference)))))
+
+(defun org-element-citation-reference-interpreter (citation-reference _)
+ "Interpret CITATION-REFERENCE object as Org syntax."
+ (concat (org-element-interpret-data
+ (org-element-property :prefix citation-reference))
+ "@" (org-element-property :key citation-reference)
+ (org-element-interpret-data
+ (org-element-property :suffix citation-reference))
+ ";"))
+
+
+;;;; Code
+
+(defun org-element-code-parser ()
+ "Parse code object at point, if any.
+
+When at a code object, return a list whose car is `code' and cdr
+is a plist with `:value', `:begin', `:end' and `:post-blank'
+keywords. Otherwise, return nil.
+
+Assume point is at the first tilde marker."
+ (save-excursion
+ (unless (bolp) (backward-char 1))
+ (when (looking-at org-verbatim-re)
+ (let ((begin (match-beginning 2))
+ (value (match-string-no-properties 4))
+ (post-blank (progn (goto-char (match-end 2))
+ (skip-chars-forward " \t")))
+ (end (point)))
+ (list 'code
+ (list :value value
+ :begin begin
+ :end end
+ :post-blank post-blank))))))
+
+(defun org-element-code-interpreter (code _)
+ "Interpret CODE object as Org syntax."
+ (format "~%s~" (org-element-property :value code)))
+
+
+;;;; Entity
+
+(defun org-element-entity-parser ()
+ "Parse entity at point, if any.
+
+When at an entity, return a list whose car is `entity' and cdr
+a plist with `:begin', `:end', `:latex', `:latex-math-p',
+`:html', `:latin1', `:utf-8', `:ascii', `:use-brackets-p' and
+`:post-blank' as keywords. Otherwise, return nil.
+
+Assume point is at the beginning of the entity."
+ (catch 'no-object
+ (when (looking-at "\\\\\\(?:\\(?1:_ +\\)\\|\\(?1:there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\\(?2:$\\|{}\\|[^[:alpha:]]\\)\\)")
+ (save-excursion
+ (let* ((value (or (org-entity-get (match-string 1))
+ (throw 'no-object nil)))
+ (begin (match-beginning 0))
+ (bracketsp (string= (match-string 2) "{}"))
+ (post-blank (progn (goto-char (match-end 1))
+ (when bracketsp (forward-char 2))
+ (skip-chars-forward " \t")))
+ (end (point)))
+ (list 'entity
+ (list :name (car value)
+ :latex (nth 1 value)
+ :latex-math-p (nth 2 value)
+ :html (nth 3 value)
+ :ascii (nth 4 value)
+ :latin1 (nth 5 value)
+ :utf-8 (nth 6 value)
+ :begin begin
+ :end end
+ :use-brackets-p bracketsp
+ :post-blank post-blank)))))))
+
+(defun org-element-entity-interpreter (entity _)
+ "Interpret ENTITY object as Org syntax."
+ (concat "\\"
+ (org-element-property :name entity)
+ (when (org-element-property :use-brackets-p entity) "{}")))
+
+
+;;;; Export Snippet
+
+(defun org-element-export-snippet-parser ()
+ "Parse export snippet at point.
+
+When at an export snippet, return a list whose car is
+`export-snippet' and cdr a plist with `:begin', `:end',
+`:back-end', `:value' and `:post-blank' as keywords. Otherwise,
+return nil.
+
+Assume point is at the beginning of the snippet."
+ (save-excursion
+ (let (contents-end)
+ (when (and (looking-at "@@\\([-A-Za-z0-9]+\\):")
+ (setq contents-end
+ (save-match-data (goto-char (match-end 0))
+ (re-search-forward "@@" nil t)
+ (match-beginning 0))))
+ (let* ((begin (match-beginning 0))
+ (back-end (match-string-no-properties 1))
+ (value (buffer-substring-no-properties
+ (match-end 0) contents-end))
+ (post-blank (skip-chars-forward " \t"))
+ (end (point)))
+ (list 'export-snippet
+ (list :back-end back-end
+ :value value
+ :begin begin
+ :end end
+ :post-blank post-blank)))))))
+
+(defun org-element-export-snippet-interpreter (export-snippet _)
+ "Interpret EXPORT-SNIPPET object as Org syntax."
+ (format "@@%s:%s@@"
+ (org-element-property :back-end export-snippet)
+ (org-element-property :value export-snippet)))
+
+
+;;;; Footnote Reference
+
+(defun org-element-footnote-reference-parser ()
+ "Parse footnote reference at point, if any.
+
+When at a footnote reference, return a list whose car is
+`footnote-reference' and cdr a plist with `:label', `:type',
+`:begin', `:end', `:contents-begin', `:contents-end' and
+`:post-blank' as keywords. Otherwise, return nil."
+ (when (looking-at org-footnote-re)
+ (let ((closing (with-syntax-table org-element--pair-square-table
+ (ignore-errors (scan-lists (point) 1 0)))))
+ (when closing
+ (save-excursion
+ (let* ((begin (point))
+ (label (match-string-no-properties 1))
+ (inner-begin (match-end 0))
+ (inner-end (1- closing))
+ (type (if (match-end 2) 'inline 'standard))
+ (post-blank (progn (goto-char closing)
+ (skip-chars-forward " \t")))
+ (end (point)))
+ (list 'footnote-reference
+ (list :label label
+ :type type
+ :begin begin
+ :end end
+ :contents-begin (and (eq type 'inline) inner-begin)
+ :contents-end (and (eq type 'inline) inner-end)
+ :post-blank post-blank))))))))
+
+(defun org-element-footnote-reference-interpreter (footnote-reference contents)
+ "Interpret FOOTNOTE-REFERENCE object as Org syntax.
+CONTENTS is its definition, when inline, or nil."
+ (format "[fn:%s%s]"
+ (or (org-element-property :label footnote-reference) "")
+ (if contents (concat ":" contents) "")))
+
+
+;;;; Inline Babel Call
+
+(defun org-element-inline-babel-call-parser ()
+ "Parse inline babel call at point, if any.
+
+When at an inline babel call, return a list whose car is
+`inline-babel-call' and cdr a plist with `:call',
+`:inside-header', `:arguments', `:end-header', `:begin', `:end',
+`:value' and `:post-blank' as keywords. Otherwise, return nil.
+
+Assume point is at the beginning of the babel call."
+ (save-excursion
+ (catch :no-object
+ (when (let ((case-fold-search nil))
+ (looking-at "\\<call_\\([^ \t\n[(]+\\)[([]"))
+ (goto-char (match-end 1))
+ (let* ((begin (match-beginning 0))
+ (call (match-string-no-properties 1))
+ (inside-header
+ (let ((p (org-element--parse-paired-brackets ?\[)))
+ (and (org-string-nw-p p)
+ (replace-regexp-in-string "\n[ \t]*" " " (org-trim p)))))
+ (arguments (org-string-nw-p
+ (or (org-element--parse-paired-brackets ?\()
+ ;; Parenthesis are mandatory.
+ (throw :no-object nil))))
+ (end-header
+ (let ((p (org-element--parse-paired-brackets ?\[)))
+ (and (org-string-nw-p p)
+ (replace-regexp-in-string "\n[ \t]*" " " (org-trim p)))))
+ (value (buffer-substring-no-properties begin (point)))
+ (post-blank (skip-chars-forward " \t"))
+ (end (point)))
+ (list 'inline-babel-call
+ (list :call call
+ :inside-header inside-header
+ :arguments arguments
+ :end-header end-header
+ :begin begin
+ :end end
+ :value value
+ :post-blank post-blank)))))))
+
+(defun org-element-inline-babel-call-interpreter (inline-babel-call _)
+ "Interpret INLINE-BABEL-CALL object as Org syntax."
+ (concat "call_"
+ (org-element-property :call inline-babel-call)
+ (let ((h (org-element-property :inside-header inline-babel-call)))
+ (and h (format "[%s]" h)))
+ "(" (org-element-property :arguments inline-babel-call) ")"
+ (let ((h (org-element-property :end-header inline-babel-call)))
+ (and h (format "[%s]" h)))))
+
+
+;;;; Inline Src Block
+
+(defun org-element-inline-src-block-parser ()
+ "Parse inline source block at point, if any.
+
+When at an inline source block, return a list whose car is
+`inline-src-block' and cdr a plist with `:begin', `:end',
+`:language', `:value', `:parameters' and `:post-blank' as
+keywords. Otherwise, return nil.
+
+Assume point is at the beginning of the inline source block."
+ (save-excursion
+ (catch :no-object
+ (when (let ((case-fold-search nil))
+ (looking-at "\\<src_\\([^ \t\n[{]+\\)[{[]"))
+ (goto-char (match-end 1))
+ (let ((begin (match-beginning 0))
+ (language (match-string-no-properties 1))
+ (parameters
+ (let ((p (org-element--parse-paired-brackets ?\[)))
+ (and (org-string-nw-p p)
+ (replace-regexp-in-string "\n[ \t]*" " " (org-trim p)))))
+ (value (or (org-element--parse-paired-brackets ?\{)
+ (throw :no-object nil)))
+ (post-blank (skip-chars-forward " \t")))
+ (list 'inline-src-block
+ (list :language language
+ :value value
+ :parameters parameters
+ :begin begin
+ :end (point)
+ :post-blank post-blank)))))))
+
+(defun org-element-inline-src-block-interpreter (inline-src-block _)
+ "Interpret INLINE-SRC-BLOCK object as Org syntax."
+ (let ((language (org-element-property :language inline-src-block))
+ (arguments (org-element-property :parameters inline-src-block))
+ (body (org-element-property :value inline-src-block)))
+ (format "src_%s%s{%s}"
+ language
+ (if arguments (format "[%s]" arguments) "")
+ body)))
+
+;;;; Italic
+
+(defun org-element-italic-parser ()
+ "Parse italic object at point, if any.
+
+When at an italic object, return a list whose car is `italic' and
+cdr is a plist with `:begin', `:end', `:contents-begin' and
+`:contents-end' and `:post-blank' keywords. Otherwise, return
+nil.
+
+Assume point is at the first slash marker."
+ (save-excursion
+ (unless (bolp) (backward-char 1))
+ (when (looking-at org-emph-re)
+ (let ((begin (match-beginning 2))
+ (contents-begin (match-beginning 4))
+ (contents-end (match-end 4))
+ (post-blank (progn (goto-char (match-end 2))
+ (skip-chars-forward " \t")))
+ (end (point)))
+ (list 'italic
+ (list :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank post-blank))))))
+
+(defun org-element-italic-interpreter (_ contents)
+ "Interpret italic object as Org syntax.
+CONTENTS is the contents of the object."
+ (format "/%s/" contents))
+
+
+;;;; Latex Fragment
+
+(defun org-element-latex-fragment-parser ()
+ "Parse LaTeX fragment at point, if any.
+
+When at a LaTeX fragment, return a list whose car is
+`latex-fragment' and cdr a plist with `:value', `:begin', `:end',
+and `:post-blank' as keywords. Otherwise, return nil.
+
+Assume point is at the beginning of the LaTeX fragment."
+ (catch 'no-object
+ (save-excursion
+ (let* ((begin (point))
+ (after-fragment
+ (cond
+ ((not (eq ?$ (char-after)))
+ (pcase (char-after (1+ (point)))
+ (?\( (search-forward "\\)" nil t))
+ (?\[ (search-forward "\\]" nil t))
+ (_
+ ;; Macro.
+ (and (looking-at "\\\\[a-zA-Z]+\\*?\\(\\(\\[[^][\n{}]*\\]\\)\
+\\|\\({[^{}\n]*}\\)\\)*")
+ (match-end 0)))))
+ ((eq ?$ (char-after (1+ (point))))
+ (search-forward "$$" nil t 2))
+ (t
+ (and (not (eq ?$ (char-before)))
+ (not (memq (char-after (1+ (point)))
+ '(?\s ?\t ?\n ?, ?. ?\;)))
+ (search-forward "$" nil t 2)
+ (not (memq (char-before (match-beginning 0))
+ '(?\s ?\t ?\n ?, ?.)))
+ (looking-at-p
+ "\\(\\s.\\|\\s-\\|\\s(\\|\\s)\\|\\s\"\\|'\\|$\\)")
+ (point)))))
+ (post-blank
+ (if (not after-fragment) (throw 'no-object nil)
+ (goto-char after-fragment)
+ (skip-chars-forward " \t")))
+ (end (point)))
+ (list 'latex-fragment
+ (list :value (buffer-substring-no-properties begin after-fragment)
+ :begin begin
+ :end end
+ :post-blank post-blank))))))
+
+(defun org-element-latex-fragment-interpreter (latex-fragment _)
+ "Interpret LATEX-FRAGMENT object as Org syntax."
+ (org-element-property :value latex-fragment))
+
+;;;; Line Break
+
+(defun org-element-line-break-parser ()
+ "Parse line break at point, if any.
+
+When at a line break, return a list whose car is `line-break',
+and cdr a plist with `:begin', `:end' and `:post-blank' keywords.
+Otherwise, return nil.
+
+Assume point is at the beginning of the line break."
+ (when (and (looking-at-p "\\\\\\\\[ \t]*$")
+ (not (eq (char-before) ?\\)))
+ (list 'line-break
+ (list :begin (point)
+ :end (line-beginning-position 2)
+ :post-blank 0))))
+
+(defun org-element-line-break-interpreter (&rest _)
+ "Interpret LINE-BREAK object as Org syntax."
+ "\\\\\n")
+
+
+;;;; Link
+
+(defun org-element-link-parser ()
+ "Parse link at point, if any.
+
+When at a link, return a list whose car is `link' and cdr a plist
+with `:type', `:path', `:format', `:raw-link', `:application',
+`:search-option', `:begin', `:end', `:contents-begin',
+`:contents-end' and `:post-blank' as keywords. Otherwise, return
+nil.
+
+Assume point is at the beginning of the link."
+ (catch 'no-object
+ (let ((begin (point))
+ end contents-begin contents-end link-end post-blank path type format
+ raw-link search-option application)
+ (cond
+ ;; Type 1: Text targeted from a radio target.
+ ((and org-target-link-regexp
+ (save-excursion (or (bolp) (backward-char))
+ (looking-at org-target-link-regexp)))
+ (setq type "radio")
+ (setq format 'plain)
+ (setq link-end (match-end 1))
+ (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. [[https://orgmode.org][homepage]]
+ ((looking-at org-link-bracket-re)
+ (setq format 'bracket)
+ (setq contents-begin (match-beginning 2))
+ (setq contents-end (match-end 2))
+ (setq link-end (match-end 0))
+ ;; 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
+ ;; compatible with RFC 3986, which requires to ignore
+ ;; them altogether. However, doing so would require
+ ;; users to encode spaces on the fly when writing links
+ ;; (e.g., insert [[shell:ls%20*.org]] instead of
+ ;; [[shell:ls *.org]], which defeats Org's focus on
+ ;; simplicity.
+ (setq raw-link (org-link-expand-abbrev
+ (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.
+ (cond
+ ;; File type.
+ ((or (file-name-absolute-p raw-link)
+ (string-match "\\`\\.\\.?/" raw-link))
+ (setq type "file")
+ (setq path raw-link))
+ ;; Explicit type (http, irc, bbdb...).
+ ((string-match org-link-types-re raw-link)
+ (setq type (match-string 1 raw-link))
+ (setq path (substring raw-link (match-end 0))))
+ ;; Code-ref type: PATH is the name of the reference.
+ ((and (string-match-p "\\`(" raw-link)
+ (string-match-p ")\\'" raw-link))
+ (setq type "coderef")
+ (setq path (substring raw-link 1 -1)))
+ ;; Custom-id type: PATH is the name of the custom id.
+ ((= (string-to-char raw-link) ?#)
+ (setq type "custom-id")
+ (setq path (substring raw-link 1)))
+ ;; Fuzzy type: Internal link either matches a target, an
+ ;; headline name or nothing. PATH is the target or
+ ;; headline's name.
+ (t
+ (setq type "fuzzy")
+ (setq path raw-link))))
+ ;; Type 3: Plain link, e.g., https://orgmode.org
+ ((looking-at org-link-plain-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., <https://orgmode.org>. Unlike to
+ ;; bracket links, follow RFC 3986 and remove any extra
+ ;; whitespace in URI.
+ ((looking-at org-link-angle-re)
+ (setq format 'angle)
+ (setq type (match-string-no-properties 1))
+ (setq link-end (match-end 0))
+ (setq raw-link
+ (buffer-substring-no-properties
+ (match-beginning 1) (match-end 2)))
+ (setq path (replace-regexp-in-string
+ "[ \t]*\n[ \t]*" "" (match-string-no-properties 2))))
+ (t (throw 'no-object nil)))
+ ;; In any case, deduce end point after trailing white space from
+ ;; LINK-END variable.
+ (save-excursion
+ (setq post-blank
+ (progn (goto-char link-end) (skip-chars-forward " \t")))
+ (setq end (point)))
+ ;; Special "file"-type link processing. Extract opening
+ ;; application and search option, if any. Also normalize URI.
+ (when (string-match "\\`file\\(?:\\+\\(.+\\)\\)?\\'" type)
+ (setq application (match-string 1 type))
+ (setq type "file")
+ (when (string-match "::\\(.*\\)\\'" path)
+ (setq search-option (match-string 1 path))
+ (setq path (replace-match "" nil nil path)))
+ (setq path (replace-regexp-in-string "\\`///*\\(.:\\)?/" "\\1/" path)))
+ ;; Translate link, if `org-link-translation-function' is set.
+ (let ((trans (and (functionp org-link-translation-function)
+ (funcall org-link-translation-function type path))))
+ (when trans
+ (setq type (car trans))
+ (setq path (cdr trans))))
+ (list 'link
+ (list :type type
+ :path path
+ :format format
+ :raw-link (or raw-link path)
+ :application application
+ :search-option search-option
+ :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank post-blank)))))
+
+(defun org-element-link-interpreter (link contents)
+ "Interpret LINK object as Org syntax.
+CONTENTS is the contents of the object, or nil."
+ (let ((type (org-element-property :type link))
+ (path (org-element-property :path link)))
+ (if (string= type "radio") path
+ (let ((fmt (pcase (org-element-property :format link)
+ ;; Links with contents and internal links have to
+ ;; use bracket syntax. Ignore `:format' in these
+ ;; cases. This is also the default syntax when the
+ ;; property is not defined, e.g., when the object
+ ;; was crafted by the user.
+ ((guard contents)
+ (format "[[%%s][%s]]"
+ ;; Since this is going to be used as
+ ;; a format string, escape percent signs
+ ;; in description.
+ (replace-regexp-in-string "%" "%%" contents)))
+ ((or `bracket
+ `nil
+ (guard (member type '("coderef" "custom-id" "fuzzy"))))
+ "[[%s]]")
+ ;; Otherwise, just obey to `:format'.
+ (`angle "<%s>")
+ (`plain "%s")
+ (f (error "Wrong `:format' value: %s" f)))))
+ (format fmt
+ (pcase type
+ ("coderef" (format "(%s)" path))
+ ("custom-id" (concat "#" path))
+ ("file"
+ (let ((app (org-element-property :application link))
+ (opt (org-element-property :search-option link)))
+ (concat type (and app (concat "+" app)) ":"
+ path
+ (and opt (concat "::" opt)))))
+ ("fuzzy" path)
+ (_ (concat type ":" path))))))))
+
+
+;;;; Macro
+
+(defun org-element-macro-parser ()
+ "Parse macro at point, if any.
+
+When at a macro, return a list whose car is `macro' and cdr
+a plist with `:key', `:args', `:begin', `:end', `:value' and
+`:post-blank' as keywords. Otherwise, return nil.
+
+Assume point is at the macro."
+ (save-excursion
+ (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 (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
+ :args args
+ :begin begin
+ :end end
+ :post-blank post-blank))))))
+
+(defun org-element-macro-interpreter (macro _)
+ "Interpret MACRO object as Org syntax."
+ (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
+
+(defun org-element-radio-target-parser ()
+ "Parse radio target at point, if any.
+
+When at a radio target, return a list whose car is `radio-target'
+and cdr a plist with `:begin', `:end', `:contents-begin',
+`:contents-end', `:value' and `:post-blank' as keywords.
+Otherwise, return nil.
+
+Assume point is at the radio target."
+ (save-excursion
+ (when (looking-at org-radio-target-regexp)
+ (let ((begin (point))
+ (contents-begin (match-beginning 1))
+ (contents-end (match-end 1))
+ (value (match-string-no-properties 1))
+ (post-blank (progn (goto-char (match-end 0))
+ (skip-chars-forward " \t")))
+ (end (point)))
+ (list 'radio-target
+ (list :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank post-blank
+ :value value))))))
+
+(defun org-element-radio-target-interpreter (_ contents)
+ "Interpret target object as Org syntax.
+CONTENTS is the contents of the object."
+ (concat "<<<" contents ">>>"))
+
+
+;;;; Statistics Cookie
+
+(defun org-element-statistics-cookie-parser ()
+ "Parse statistics cookie at point, if any.
+
+When at a statistics cookie, return a list whose car is
+`statistics-cookie', and cdr a plist with `:begin', `:end',
+`:value' and `:post-blank' keywords. Otherwise, return nil.
+
+Assume point is at the beginning of the statistics-cookie."
+ (save-excursion
+ (when (looking-at "\\[[0-9]*\\(%\\|/[0-9]*\\)\\]")
+ (let* ((begin (point))
+ (value (buffer-substring-no-properties
+ (match-beginning 0) (match-end 0)))
+ (post-blank (progn (goto-char (match-end 0))
+ (skip-chars-forward " \t")))
+ (end (point)))
+ (list 'statistics-cookie
+ (list :begin begin
+ :end end
+ :value value
+ :post-blank post-blank))))))
+
+(defun org-element-statistics-cookie-interpreter (statistics-cookie _)
+ "Interpret STATISTICS-COOKIE object as Org syntax."
+ (org-element-property :value statistics-cookie))
+
+
+;;;; Strike-Through
+
+(defun org-element-strike-through-parser ()
+ "Parse strike-through object at point, if any.
+
+When at a strike-through object, return a list whose car is
+`strike-through' and cdr is a plist with `:begin', `:end',
+`:contents-begin' and `:contents-end' and `:post-blank' keywords.
+Otherwise, return nil.
+
+Assume point is at the first plus sign marker."
+ (save-excursion
+ (unless (bolp) (backward-char 1))
+ (when (looking-at org-emph-re)
+ (let ((begin (match-beginning 2))
+ (contents-begin (match-beginning 4))
+ (contents-end (match-end 4))
+ (post-blank (progn (goto-char (match-end 2))
+ (skip-chars-forward " \t")))
+ (end (point)))
+ (list 'strike-through
+ (list :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank post-blank))))))
+
+(defun org-element-strike-through-interpreter (_ contents)
+ "Interpret strike-through object as Org syntax.
+CONTENTS is the contents of the object."
+ (format "+%s+" contents))
+
+
+;;;; Subscript
+
+(defun org-element-subscript-parser ()
+ "Parse subscript at point, if any.
+
+When at a subscript object, return a list whose car is
+`subscript' and cdr a plist with `:begin', `:end',
+`:contents-begin', `:contents-end', `:use-brackets-p' and
+`:post-blank' as keywords. Otherwise, return nil.
+
+Assume point is at the underscore."
+ (save-excursion
+ (unless (bolp) (backward-char))
+ (when (looking-at org-match-substring-regexp)
+ (let ((bracketsp (match-beginning 4))
+ (begin (match-beginning 2))
+ (contents-begin (or (match-beginning 4)
+ (match-beginning 3)))
+ (contents-end (or (match-end 4) (match-end 3)))
+ (post-blank (progn (goto-char (match-end 0))
+ (skip-chars-forward " \t")))
+ (end (point)))
+ (list 'subscript
+ (list :begin begin
+ :end end
+ :use-brackets-p bracketsp
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank post-blank))))))
+
+(defun org-element-subscript-interpreter (subscript contents)
+ "Interpret SUBSCRIPT object as Org syntax.
+CONTENTS is the contents of the object."
+ (format
+ (if (org-element-property :use-brackets-p subscript) "_{%s}" "_%s")
+ contents))
+
+
+;;;; Superscript
+
+(defun org-element-superscript-parser ()
+ "Parse superscript at point, if any.
+
+When at a superscript object, return a list whose car is
+`superscript' and cdr a plist with `:begin', `:end',
+`:contents-begin', `:contents-end', `:use-brackets-p' and
+`:post-blank' as keywords. Otherwise, return nil.
+
+Assume point is at the caret."
+ (save-excursion
+ (unless (bolp) (backward-char))
+ (when (looking-at org-match-substring-regexp)
+ (let ((bracketsp (match-beginning 4))
+ (begin (match-beginning 2))
+ (contents-begin (or (match-beginning 4)
+ (match-beginning 3)))
+ (contents-end (or (match-end 4) (match-end 3)))
+ (post-blank (progn (goto-char (match-end 0))
+ (skip-chars-forward " \t")))
+ (end (point)))
+ (list 'superscript
+ (list :begin begin
+ :end end
+ :use-brackets-p bracketsp
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank post-blank))))))
+
+(defun org-element-superscript-interpreter (superscript contents)
+ "Interpret SUPERSCRIPT object as Org syntax.
+CONTENTS is the contents of the object."
+ (format
+ (if (org-element-property :use-brackets-p superscript) "^{%s}" "^%s")
+ contents))
+
+
+;;;; Table Cell
+
+(defun org-element-table-cell-parser ()
+ "Parse table cell at point.
+Return a list whose car is `table-cell' and cdr is a plist
+containing `:begin', `:end', `:contents-begin', `:contents-end'
+and `:post-blank' keywords."
+ (looking-at "[ \t]*\\(.*?\\)[ \t]*\\(?:|\\|$\\)")
+ (let* ((begin (match-beginning 0))
+ (end (match-end 0))
+ (contents-begin (match-beginning 1))
+ (contents-end (match-end 1)))
+ (list 'table-cell
+ (list :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank 0))))
+
+(defun org-element-table-cell-interpreter (_ contents)
+ "Interpret table-cell element as Org syntax.
+CONTENTS is the contents of the cell, or nil."
+ (concat " " contents " |"))
+
+
+;;;; Target
+
+(defun org-element-target-parser ()
+ "Parse target at point, if any.
+
+When at a target, return a list whose car is `target' and cdr
+a plist with `:begin', `:end', `:value' and `:post-blank' as
+keywords. Otherwise, return nil.
+
+Assume point is at the target."
+ (save-excursion
+ (when (looking-at org-target-regexp)
+ (let ((begin (point))
+ (value (match-string-no-properties 1))
+ (post-blank (progn (goto-char (match-end 0))
+ (skip-chars-forward " \t")))
+ (end (point)))
+ (list 'target
+ (list :begin begin
+ :end end
+ :value value
+ :post-blank post-blank))))))
+
+(defun org-element-target-interpreter (target _)
+ "Interpret TARGET object as Org syntax."
+ (format "<<%s>>" (org-element-property :value target)))
+
+
+;;;; Timestamp
+
+(defconst org-element--timestamp-regexp
+ (concat org-ts-regexp-both
+ "\\|"
+ "\\(?:<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[dwmy]>\\)"
+ "\\|"
+ "\\(?:<%%\\(?:([^>\n]+)\\)>\\)")
+ "Regexp matching any timestamp type object.")
+
+(defun org-element-timestamp-parser ()
+ "Parse time stamp at point, if any.
+
+When at a time stamp, return a list whose car is `timestamp', and
+cdr a plist with `:type', `:raw-value', `:year-start',
+`:month-start', `:day-start', `:hour-start', `:minute-start',
+`:year-end', `:month-end', `:day-end', `:hour-end',
+`:minute-end', `:repeater-type', `:repeater-value',
+`:repeater-unit', `:warning-type', `:warning-value',
+`:warning-unit', `:begin', `:end' and `:post-blank' keywords.
+Otherwise, return nil.
+
+Assume point is at the beginning of the timestamp."
+ (when (looking-at-p org-element--timestamp-regexp)
+ (save-excursion
+ (let* ((begin (point))
+ (activep (eq (char-after) ?<))
+ (raw-value
+ (progn
+ (looking-at "\\([<[]\\(%%\\)?.*?\\)[]>]\\(?:--\\([<[].*?[]>]\\)\\)?")
+ (match-string-no-properties 0)))
+ (date-start (match-string-no-properties 1))
+ (date-end (match-string 3))
+ (diaryp (match-beginning 2))
+ (post-blank (progn (goto-char (match-end 0))
+ (skip-chars-forward " \t")))
+ (end (point))
+ (time-range
+ (and (not diaryp)
+ (string-match
+ "[012]?[0-9]:[0-5][0-9]\\(-\\([012]?[0-9]\\):\\([0-5][0-9]\\)\\)"
+ date-start)
+ (cons (string-to-number (match-string 2 date-start))
+ (string-to-number (match-string 3 date-start)))))
+ (type (cond (diaryp 'diary)
+ ((and activep (or date-end time-range)) 'active-range)
+ (activep 'active)
+ ((or date-end time-range) 'inactive-range)
+ (t 'inactive)))
+ (repeater-props
+ (and (not diaryp)
+ (string-match "\\([.+]?\\+\\)\\([0-9]+\\)\\([hdwmy]\\)"
+ raw-value)
+ (list
+ :repeater-type
+ (let ((type (match-string 1 raw-value)))
+ (cond ((equal "++" type) 'catch-up)
+ ((equal ".+" type) 'restart)
+ (t 'cumulate)))
+ :repeater-value (string-to-number (match-string 2 raw-value))
+ :repeater-unit
+ (pcase (string-to-char (match-string 3 raw-value))
+ (?h 'hour) (?d 'day) (?w 'week) (?m 'month) (_ 'year)))))
+ (warning-props
+ (and (not diaryp)
+ (string-match "\\(-\\)?-\\([0-9]+\\)\\([hdwmy]\\)" raw-value)
+ (list
+ :warning-type (if (match-string 1 raw-value) 'first 'all)
+ :warning-value (string-to-number (match-string 2 raw-value))
+ :warning-unit
+ (pcase (string-to-char (match-string 3 raw-value))
+ (?h 'hour) (?d 'day) (?w 'week) (?m 'month) (_ 'year)))))
+ year-start month-start day-start hour-start minute-start year-end
+ month-end day-end hour-end minute-end)
+ ;; Parse date-start.
+ (unless diaryp
+ (let ((date (org-parse-time-string date-start t)))
+ (setq year-start (nth 5 date)
+ month-start (nth 4 date)
+ day-start (nth 3 date)
+ hour-start (nth 2 date)
+ minute-start (nth 1 date))))
+ ;; Compute date-end. It can be provided directly in time-stamp,
+ ;; or extracted from time range. Otherwise, it defaults to the
+ ;; same values as date-start.
+ (unless diaryp
+ (let ((date (and date-end (org-parse-time-string date-end t))))
+ (setq year-end (or (nth 5 date) year-start)
+ month-end (or (nth 4 date) month-start)
+ day-end (or (nth 3 date) day-start)
+ hour-end (or (nth 2 date) (car time-range) hour-start)
+ minute-end (or (nth 1 date) (cdr time-range) minute-start))))
+ (list 'timestamp
+ (nconc (list :type type
+ :raw-value raw-value
+ :year-start year-start
+ :month-start month-start
+ :day-start day-start
+ :hour-start hour-start
+ :minute-start minute-start
+ :year-end year-end
+ :month-end month-end
+ :day-end day-end
+ :hour-end hour-end
+ :minute-end minute-end
+ :begin begin
+ :end end
+ :post-blank post-blank)
+ repeater-props
+ warning-props))))))
+
+(defun org-element-timestamp-interpreter (timestamp _)
+ "Interpret TIMESTAMP object as Org syntax."
+ (let* ((repeat-string
+ (concat
+ (pcase (org-element-property :repeater-type timestamp)
+ (`cumulate "+") (`catch-up "++") (`restart ".+"))
+ (let ((val (org-element-property :repeater-value timestamp)))
+ (and val (number-to-string val)))
+ (pcase (org-element-property :repeater-unit timestamp)
+ (`hour "h") (`day "d") (`week "w") (`month "m") (`year "y"))))
+ (warning-string
+ (concat
+ (pcase (org-element-property :warning-type timestamp)
+ (`first "--") (`all "-"))
+ (let ((val (org-element-property :warning-value timestamp)))
+ (and val (number-to-string val)))
+ (pcase (org-element-property :warning-unit timestamp)
+ (`hour "h") (`day "d") (`week "w") (`month "m") (`year "y"))))
+ (build-ts-string
+ ;; Build an Org timestamp string from TIME. ACTIVEP is
+ ;; non-nil when time stamp is active. If WITH-TIME-P is
+ ;; non-nil, add a time part. HOUR-END and MINUTE-END
+ ;; specify a time range in the timestamp. REPEAT-STRING is
+ ;; the repeater string, if any.
+ (lambda (time activep &optional with-time-p hour-end minute-end)
+ (let ((ts (format-time-string
+ (funcall (if with-time-p #'cdr #'car)
+ org-time-stamp-formats)
+ time)))
+ (when (and hour-end minute-end)
+ (string-match "[012]?[0-9]:[0-5][0-9]" ts)
+ (setq ts
+ (replace-match
+ (format "\\&-%02d:%02d" hour-end minute-end)
+ nil nil ts)))
+ (unless activep (setq ts (format "[%s]" (substring ts 1 -1))))
+ (dolist (s (list repeat-string warning-string))
+ (when (org-string-nw-p s)
+ (setq ts (concat (substring ts 0 -1)
+ " "
+ s
+ (substring ts -1)))))
+ ;; Return value.
+ ts)))
+ (type (org-element-property :type timestamp)))
+ (pcase type
+ ((or `active `inactive)
+ (let* ((minute-start (org-element-property :minute-start timestamp))
+ (minute-end (org-element-property :minute-end timestamp))
+ (hour-start (org-element-property :hour-start timestamp))
+ (hour-end (org-element-property :hour-end timestamp))
+ (time-range-p (and hour-start hour-end minute-start minute-end
+ (or (/= hour-start hour-end)
+ (/= minute-start minute-end)))))
+ (funcall
+ build-ts-string
+ (encode-time 0
+ (or minute-start 0)
+ (or hour-start 0)
+ (org-element-property :day-start timestamp)
+ (org-element-property :month-start timestamp)
+ (org-element-property :year-start timestamp))
+ (eq type 'active)
+ (and hour-start minute-start)
+ (and time-range-p hour-end)
+ (and time-range-p minute-end))))
+ ((or `active-range `inactive-range)
+ (let ((minute-start (org-element-property :minute-start timestamp))
+ (minute-end (org-element-property :minute-end timestamp))
+ (hour-start (org-element-property :hour-start timestamp))
+ (hour-end (org-element-property :hour-end timestamp)))
+ (concat
+ (funcall
+ build-ts-string (encode-time
+ 0
+ (or minute-start 0)
+ (or hour-start 0)
+ (org-element-property :day-start timestamp)
+ (org-element-property :month-start timestamp)
+ (org-element-property :year-start timestamp))
+ (eq type 'active-range)
+ (and hour-start minute-start))
+ "--"
+ (funcall build-ts-string
+ (encode-time 0
+ (or minute-end 0)
+ (or hour-end 0)
+ (org-element-property :day-end timestamp)
+ (org-element-property :month-end timestamp)
+ (org-element-property :year-end timestamp))
+ (eq type 'active-range)
+ (and hour-end minute-end)))))
+ (_ (org-element-property :raw-value timestamp)))))
+
+
+;;;; Underline
+
+(defun org-element-underline-parser ()
+ "Parse underline object at point, if any.
+
+When at an underline object, return a list whose car is
+`underline' and cdr is a plist with `:begin', `:end',
+`:contents-begin' and `:contents-end' and `:post-blank' keywords.
+Otherwise, return nil.
+
+Assume point is at the first underscore marker."
+ (save-excursion
+ (unless (bolp) (backward-char 1))
+ (when (looking-at org-emph-re)
+ (let ((begin (match-beginning 2))
+ (contents-begin (match-beginning 4))
+ (contents-end (match-end 4))
+ (post-blank (progn (goto-char (match-end 2))
+ (skip-chars-forward " \t")))
+ (end (point)))
+ (list 'underline
+ (list :begin begin
+ :end end
+ :contents-begin contents-begin
+ :contents-end contents-end
+ :post-blank post-blank))))))
+
+(defun org-element-underline-interpreter (_ contents)
+ "Interpret underline object as Org syntax.
+CONTENTS is the contents of the object."
+ (format "_%s_" contents))
+
+
+;;;; Verbatim
+
+(defun org-element-verbatim-parser ()
+ "Parse verbatim object at point, if any.
+
+When at a verbatim object, return a list whose car is `verbatim'
+and cdr is a plist with `:value', `:begin', `:end' and
+`:post-blank' keywords. Otherwise, return nil.
+
+Assume point is at the first equal sign marker."
+ (save-excursion
+ (unless (bolp) (backward-char 1))
+ (when (looking-at org-verbatim-re)
+ (let ((begin (match-beginning 2))
+ (value (match-string-no-properties 4))
+ (post-blank (progn (goto-char (match-end 2))
+ (skip-chars-forward " \t")))
+ (end (point)))
+ (list 'verbatim
+ (list :value value
+ :begin begin
+ :end end
+ :post-blank post-blank))))))
+
+(defun org-element-verbatim-interpreter (verbatim _)
+ "Interpret VERBATIM object as Org syntax."
+ (format "=%s=" (org-element-property :value verbatim)))
+
+
+
+;;; Parsing Element Starting At Point
+;;
+;; `org-element--current-element' is the core function of this section.
+;; It returns the Lisp representation of the element starting at
+;; point.
+
+(defun org-element--current-element (limit &optional granularity mode structure)
+ "Parse the element starting at point.
+
+Return value is a list like (TYPE PROPS) where TYPE is the type
+of the element and PROPS a plist of properties associated to the
+element.
+
+Possible types are defined in `org-element-all-elements'.
+
+LIMIT bounds the search.
+
+Optional argument GRANULARITY determines the depth of the
+recursion. Allowed values are `headline', `greater-element',
+`element', `object' or nil. When it is broader than `object' (or
+nil), secondary values will not be parsed, since they only
+contain objects.
+
+Optional argument MODE, when non-nil, can be either
+`first-section', `item', `node-property', `planning',
+`property-drawer', `section', `table-row', or `top-comment'.
+
+
+If STRUCTURE isn't provided but MODE is set to `item', it will be
+computed.
+
+This function assumes point is always at the beginning of the
+element it has to parse."
+ (save-excursion
+ (let ((case-fold-search t)
+ ;; Determine if parsing depth allows for secondary strings
+ ;; parsing. It only applies to elements referenced in
+ ;; `org-element-secondary-value-alist'.
+ (raw-secondary-p (and granularity (not (eq granularity 'object)))))
+ (cond
+ ;; Item.
+ ((eq mode 'item)
+ (org-element-item-parser limit structure raw-secondary-p))
+ ;; Table Row.
+ ((eq mode 'table-row) (org-element-table-row-parser limit))
+ ;; Node Property.
+ ((eq mode 'node-property) (org-element-node-property-parser limit))
+ ;; Headline.
+ ((org-with-limited-levels (org-at-heading-p))
+ (org-element-headline-parser limit raw-secondary-p))
+ ;; Sections (must be checked after headline).
+ ((eq mode 'section) (org-element-section-parser limit))
+ ((eq mode 'first-section)
+ (org-element-section-parser
+ (or (save-excursion (org-with-limited-levels (outline-next-heading)))
+ limit)))
+ ;; Comments.
+ ((looking-at "^[ \t]*#\\(?: \\|$\\)")
+ (org-element-comment-parser limit))
+ ;; Planning.
+ ((and (eq mode 'planning)
+ (eq ?* (char-after (line-beginning-position 0)))
+ (looking-at org-planning-line-re))
+ (org-element-planning-parser limit))
+ ;; Property drawer.
+ ((and (pcase mode
+ (`planning (eq ?* (char-after (line-beginning-position 0))))
+ ((or `property-drawer `top-comment)
+ (save-excursion
+ (beginning-of-line 0)
+ (not (looking-at "[[:blank:]]*$"))))
+ (_ nil))
+ (looking-at org-property-drawer-re))
+ (org-element-property-drawer-parser limit))
+ ;; When not at bol, point is at the beginning of an item or
+ ;; a footnote definition: next item is always a paragraph.
+ ((not (bolp)) (org-element-paragraph-parser limit (list (point))))
+ ;; Clock.
+ ((looking-at org-clock-line-re) (org-element-clock-parser limit))
+ ;; Inlinetask.
+ ((looking-at "^\\*+ ")
+ (org-element-inlinetask-parser limit raw-secondary-p))
+ ;; From there, elements can have affiliated keywords.
+ (t (let ((affiliated (org-element--collect-affiliated-keywords
+ limit (memq granularity '(nil object)))))
+ (cond
+ ;; Jumping over affiliated keywords put point off-limits.
+ ;; Parse them as regular keywords.
+ ((and (cdr affiliated) (>= (point) limit))
+ (goto-char (car affiliated))
+ (org-element-keyword-parser limit nil))
+ ;; LaTeX Environment.
+ ((looking-at org-element--latex-begin-environment)
+ (org-element-latex-environment-parser limit affiliated))
+ ;; Drawer.
+ ((looking-at org-drawer-regexp)
+ (org-element-drawer-parser limit affiliated))
+ ;; Fixed Width
+ ((looking-at "[ \t]*:\\( \\|$\\)")
+ (org-element-fixed-width-parser limit affiliated))
+ ;; Inline Comments, Blocks, Babel Calls, Dynamic Blocks and
+ ;; Keywords.
+ ((looking-at "[ \t]*#\\+")
+ (goto-char (match-end 0))
+ (cond
+ ((looking-at "BEGIN_\\(\\S-+\\)")
+ (beginning-of-line)
+ (funcall (pcase (upcase (match-string 1))
+ ("CENTER" #'org-element-center-block-parser)
+ ("COMMENT" #'org-element-comment-block-parser)
+ ("EXAMPLE" #'org-element-example-block-parser)
+ ("EXPORT" #'org-element-export-block-parser)
+ ("QUOTE" #'org-element-quote-block-parser)
+ ("SRC" #'org-element-src-block-parser)
+ ("VERSE" #'org-element-verse-block-parser)
+ (_ #'org-element-special-block-parser))
+ limit
+ affiliated))
+ ((looking-at "CALL:")
+ (beginning-of-line)
+ (org-element-babel-call-parser limit affiliated))
+ ((looking-at "BEGIN:? ")
+ (beginning-of-line)
+ (org-element-dynamic-block-parser limit affiliated))
+ ((looking-at "\\S-+:")
+ (beginning-of-line)
+ (org-element-keyword-parser limit affiliated))
+ (t
+ (beginning-of-line)
+ (org-element-paragraph-parser limit affiliated))))
+ ;; Footnote Definition.
+ ((looking-at org-footnote-definition-re)
+ (org-element-footnote-definition-parser limit affiliated))
+ ;; Horizontal Rule.
+ ((looking-at "[ \t]*-\\{5,\\}[ \t]*$")
+ (org-element-horizontal-rule-parser limit affiliated))
+ ;; Diary Sexp.
+ ((looking-at "%%(")
+ (org-element-diary-sexp-parser limit affiliated))
+ ;; Table.
+ ((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
+ (rx (zero-or-more (any " \t"))
+ "+"
+ (one-or-more (one-or-more "-") "+")
+ (zero-or-more (any " \t"))
+ eol))
+ (non-table.el-line
+ (rx bol
+ (zero-or-more (any " \t"))
+ (or eol (not (any "+| \t")))))
+ (next (line-beginning-position 2)))
+ ;; Start with a full rule.
+ (and
+ (looking-at rule-regexp)
+ (< next limit) ;no room for a table.el table
+ (save-excursion
+ (end-of-line)
+ (cond
+ ;; Must end with a full rule.
+ ((not (re-search-forward non-table.el-line limit 'move))
+ (if (bolp) (forward-line -1) (beginning-of-line))
+ (looking-at rule-regexp))
+ ;; Ignore pseudo-tables with a single
+ ;; rule.
+ ((= next (line-beginning-position))
+ nil)
+ ;; Must end with a full rule.
+ (t
+ (forward-line -1)
+ (looking-at rule-regexp)))))))
+ (org-element-table-parser limit affiliated))
+ ;; List.
+ ((looking-at (org-item-re))
+ (org-element-plain-list-parser
+ limit affiliated
+ (or structure (org-element--list-struct limit))))
+ ;; Default element: Paragraph.
+ (t (org-element-paragraph-parser limit affiliated)))))))))
+
+
+;; Most elements can have affiliated keywords. When looking for an
+;; element beginning, we want to move before them, as they belong to
+;; that element, and, in the meantime, collect information they give
+;; into appropriate properties. Hence the following function.
+
+(defun org-element--collect-affiliated-keywords (limit parse)
+ "Collect affiliated keywords from point down to LIMIT.
+
+Return a list whose CAR is the position at the first of them and
+CDR a plist of keywords and values and move point to the
+beginning of the first line after them.
+
+As a special case, if element doesn't start at the beginning of
+the line (e.g., a paragraph starting an item), CAR is current
+position of point and CDR is nil.
+
+When PARSE is non-nil, values from keywords belonging to
+`org-element-parsed-keywords' are parsed as secondary strings."
+ (if (not (bolp)) (list (point))
+ (let ((case-fold-search t)
+ (origin (point))
+ ;; RESTRICT is the list of objects allowed in parsed
+ ;; keywords value. If PARSE is nil, no object is allowed.
+ (restrict (and parse (org-element-restriction 'keyword)))
+ output)
+ (while (and (< (point) limit) (looking-at org-element--affiliated-re))
+ (let* ((raw-kwd (upcase (match-string 1)))
+ ;; Apply translation to RAW-KWD. From there, KWD is
+ ;; the official keyword.
+ (kwd (or (cdr (assoc raw-kwd
+ org-element-keyword-translation-alist))
+ raw-kwd))
+ ;; PARSED? is non-nil when keyword should have its
+ ;; value parsed.
+ (parsed? (member kwd org-element-parsed-keywords))
+ ;; Find main value for any keyword.
+ (value
+ (let ((beg (match-end 0))
+ (end (save-excursion
+ (end-of-line)
+ (skip-chars-backward " \t")
+ (point))))
+ (if parsed?
+ (save-match-data
+ (org-element--parse-objects beg end nil restrict))
+ (org-trim (buffer-substring-no-properties beg end)))))
+ ;; If KWD is a dual keyword, find its secondary value.
+ ;; Maybe parse it.
+ (dual? (member kwd org-element-dual-keywords))
+ (dual-value
+ (and dual?
+ (let ((sec (match-string-no-properties 2)))
+ (cond
+ ((and sec parsed?)
+ (save-match-data
+ (org-element--parse-objects
+ (match-beginning 2) (match-end 2) nil restrict)))
+ (sec sec)))))
+ ;; Attribute a property name to KWD.
+ (kwd-sym (and kwd (intern (concat ":" (downcase kwd))))))
+ ;; Now set final shape for VALUE.
+ (when dual?
+ (setq value (and (or value dual-value) (cons value dual-value))))
+ (when (or (member kwd org-element-multiple-keywords)
+ ;; Attributes can always appear on multiple lines.
+ (string-match "^ATTR_" kwd))
+ (setq value (cons value (plist-get output kwd-sym))))
+ ;; Eventually store the new value in OUTPUT.
+ (setq output (plist-put output kwd-sym value))
+ ;; Move to next keyword.
+ (forward-line)))
+ ;; If affiliated keywords are orphaned: move back to first one.
+ ;; They will be parsed as a paragraph.
+ (when (looking-at "[ \t]*$") (goto-char origin) (setq output nil))
+ ;; Return value.
+ (cons origin output))))
+
+
+
+;;; The Org Parser
+;;
+;; The two major functions here are `org-element-parse-buffer', which
+;; parses Org syntax inside the current buffer, taking into account
+;; region, narrowing, or even visibility if specified, and
+;; `org-element-parse-secondary-string', which parses objects within
+;; a given string.
+;;
+;; The (almost) almighty `org-element-map' allows applying a function
+;; on elements or objects matching some type, and accumulating the
+;; resulting values. In an export situation, it also skips unneeded
+;; parts of the parse tree.
+
+(defun org-element-parse-buffer (&optional granularity visible-only)
+ "Recursively parse the buffer and return structure.
+If narrowing is in effect, only parse the visible part of the
+buffer.
+
+Optional argument GRANULARITY determines the depth of the
+recursion. It can be set to the following symbols:
+
+`headline' Only parse headlines.
+`greater-element' Don't recurse into greater elements except
+ headlines and sections. Thus, elements
+ parsed are the top-level ones.
+`element' Parse everything but objects and plain text.
+`object' Parse the complete buffer (default).
+
+When VISIBLE-ONLY is non-nil, don't parse contents of hidden
+elements.
+
+An element or object is represented as a list with the
+pattern (TYPE PROPERTIES CONTENTS), where :
+
+ TYPE is a symbol describing the element or object. See
+ `org-element-all-elements' and `org-element-all-objects' for an
+ exhaustive list of such symbols. One can retrieve it with
+ `org-element-type' function.
+
+ PROPERTIES is the list of attributes attached to the element or
+ object, as a plist. Although most of them are specific to the
+ element or object type, all types share `:begin', `:end',
+ `:post-blank' and `:parent' properties, which respectively
+ refer to buffer position where the element or object starts,
+ ends, the number of white spaces or blank lines after it, and
+ the element or object containing it. Properties values can be
+ obtained by using `org-element-property' function.
+
+ CONTENTS is a list of elements, objects or raw strings
+ contained in the current element or object, when applicable.
+ One can access them with `org-element-contents' function.
+
+The Org buffer has `org-data' as type and nil as properties.
+`org-element-map' function can be used to find specific elements
+or objects within the parse tree.
+
+This function assumes that current major mode is `org-mode'."
+ (save-excursion
+ (goto-char (point-min))
+ (org-skip-whitespace)
+ (org-element--parse-elements
+ (point-at-bol) (point-max)
+ ;; Start in `first-section' mode so text before the first
+ ;; headline belongs to a section.
+ 'first-section nil granularity visible-only (list 'org-data nil))))
+
+(defun org-element-parse-secondary-string (string restriction &optional parent)
+ "Recursively parse objects in STRING and return structure.
+
+RESTRICTION is a symbol limiting the object types that will be
+looked after.
+
+Optional argument PARENT, when non-nil, is the element or object
+containing the secondary string. It is used to set correctly
+`:parent' property within the string.
+
+If STRING is the empty string or nil, return nil."
+ (cond
+ ((not string) nil)
+ ((equal string "") nil)
+ (t (let ((local-variables (buffer-local-variables)))
+ (with-temp-buffer
+ (dolist (v local-variables)
+ (ignore-errors
+ (if (symbolp v) (makunbound v)
+ ;; Don't set file name to avoid mishandling hooks (bug#44524)
+ (unless (memq (car v) '(buffer-file-name buffer-file-truename))
+ (set (make-local-variable (car v)) (cdr v))))))
+ ;; 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))))))
+
+(defun org-element-map
+ (data types fun &optional info first-match no-recursion with-affiliated)
+ "Map a function on selected elements or objects.
+
+DATA is a parse tree, an element, an object, a string, or a list
+of such constructs. TYPES is a symbol or list of symbols of
+elements or objects types (see `org-element-all-elements' and
+`org-element-all-objects' for a complete list of types). FUN is
+the function called on the matching element or object. It has to
+accept one argument: the element or object itself.
+
+When optional argument INFO is non-nil, it should be a plist
+holding export options. In that case, parts of the parse tree
+not exportable according to that property list will be skipped.
+
+When optional argument FIRST-MATCH is non-nil, stop at the first
+match for which FUN doesn't return nil, and return that value.
+
+Optional argument NO-RECURSION is a symbol or a list of symbols
+representing elements or objects types. `org-element-map' won't
+enter any recursive element or object whose type belongs to that
+list. Though, FUN can still be applied on them.
+
+When optional argument WITH-AFFILIATED is non-nil, FUN will also
+apply to matching objects within parsed affiliated keywords (see
+`org-element-parsed-keywords').
+
+Nil values returned from FUN do not appear in the results.
+
+
+Examples:
+---------
+
+Assuming TREE is a variable containing an Org buffer parse tree,
+the following example will return a flat list of all `src-block'
+and `example-block' elements in it:
+
+ (org-element-map tree \\='(example-block src-block) #\\='identity)
+
+The following snippet will find the first headline with a level
+of 1 and a \"phone\" tag, and will return its beginning position:
+
+ (org-element-map tree \\='headline
+ (lambda (hl)
+ (and (= (org-element-property :level hl) 1)
+ (member \"phone\" (org-element-property :tags hl))
+ (org-element-property :begin hl)))
+ nil t)
+
+The next example will return a flat list of all `plain-list' type
+elements in TREE that are not a sub-list themselves:
+
+ (org-element-map tree \\='plain-list #\\='identity nil nil \\='plain-list)
+
+Eventually, this example will return a flat list of all `bold'
+type objects containing a `latex-snippet' type object, even
+looking into captions:
+
+ (org-element-map tree \\='bold
+ (lambda (b)
+ (and (org-element-map b \\='latex-snippet #\\='identity nil t) b))
+ nil nil nil t)"
+ (declare (indent 2))
+ ;; Ensure TYPES and NO-RECURSION are a list, even of one element.
+ (let* ((types (if (listp types) types (list types)))
+ (no-recursion (if (listp no-recursion) no-recursion
+ (list no-recursion)))
+ ;; Recursion depth is determined by --CATEGORY.
+ (--category
+ (catch :--found
+ (let ((category 'greater-elements)
+ (all-objects (cons 'plain-text org-element-all-objects)))
+ (dolist (type types category)
+ (cond ((memq type all-objects)
+ ;; If one object is found, the function has
+ ;; to recurse into every object.
+ (throw :--found 'objects))
+ ((not (memq type org-element-greater-elements))
+ ;; If one regular element is found, the
+ ;; function has to recurse, at least, into
+ ;; every element it encounters.
+ (and (not (eq category 'elements))
+ (setq category 'elements))))))))
+ --acc)
+ (letrec ((--walk-tree
+ (lambda (--data)
+ ;; Recursively walk DATA. INFO, if non-nil, is a plist
+ ;; holding contextual information.
+ (let ((--type (org-element-type --data)))
+ (cond
+ ((not --data))
+ ;; Ignored element in an export context.
+ ((and info (memq --data (plist-get info :ignore-list))))
+ ;; List of elements or objects.
+ ((not --type) (mapc --walk-tree --data))
+ ;; Unconditionally enter parse trees.
+ ((eq --type 'org-data)
+ (mapc --walk-tree (org-element-contents --data)))
+ (t
+ ;; Check if TYPE is matching among TYPES. If so,
+ ;; apply FUN to --DATA and accumulate return value
+ ;; into --ACC (or exit if FIRST-MATCH is non-nil).
+ (when (memq --type types)
+ (let ((result (funcall fun --data)))
+ (cond ((not result))
+ (first-match (throw :--map-first-match result))
+ (t (push result --acc)))))
+ ;; If --DATA has a secondary string that can contain
+ ;; objects with their type among TYPES, look inside.
+ (when (and (eq --category 'objects) (not (stringp --data)))
+ (dolist (p (cdr (assq --type
+ org-element-secondary-value-alist)))
+ (funcall --walk-tree (org-element-property p --data))))
+ ;; If --DATA has any parsed affiliated keywords and
+ ;; WITH-AFFILIATED is non-nil, look for objects in
+ ;; them.
+ (when (and with-affiliated
+ (eq --category 'objects)
+ (eq (org-element-class --data) 'element))
+ (dolist (kwd-pair org-element--parsed-properties-alist)
+ (let ((kwd (car kwd-pair))
+ (value (org-element-property (cdr kwd-pair) --data)))
+ ;; Pay attention to the type of parsed
+ ;; keyword. In particular, preserve order for
+ ;; multiple keywords.
+ (cond
+ ((not value))
+ ((member kwd org-element-dual-keywords)
+ (if (member kwd org-element-multiple-keywords)
+ (dolist (line (reverse value))
+ (funcall --walk-tree (cdr line))
+ (funcall --walk-tree (car line)))
+ (funcall --walk-tree (cdr value))
+ (funcall --walk-tree (car value))))
+ ((member kwd org-element-multiple-keywords)
+ (mapc --walk-tree (reverse value)))
+ (t (funcall --walk-tree value))))))
+ ;; Determine if a recursion into --DATA is possible.
+ (cond
+ ;; --TYPE is explicitly removed from recursion.
+ ((memq --type no-recursion))
+ ;; --DATA has no contents.
+ ((not (org-element-contents --data)))
+ ;; Looking for greater elements but --DATA is
+ ;; simply an element or an object.
+ ((and (eq --category 'greater-elements)
+ (not (memq --type org-element-greater-elements))))
+ ;; Looking for elements but --DATA is an object.
+ ((and (eq --category 'elements)
+ (eq (org-element-class --data) 'object)))
+ ;; In any other case, map contents.
+ (t (mapc --walk-tree (org-element-contents --data))))))))))
+ (catch :--map-first-match
+ (funcall --walk-tree data)
+ ;; Return value in a proper order.
+ (nreverse --acc)))))
+
+;; The following functions are internal parts of the parser.
+;;
+;; The first one, `org-element--parse-elements' acts at the element's
+;; level.
+;;
+;; The second one, `org-element--parse-objects' applies on all objects
+;; of a paragraph or a secondary string. It calls
+;; `org-element--object-lex' to find the next object in the current
+;; container.
+
+(defsubst org-element--next-mode (mode type parent?)
+ "Return next mode according to current one.
+
+MODE is a symbol representing the expectation about the next
+element or object. Meaningful values are `first-section',
+`item', `node-property', `planning', `property-drawer',
+`section', `table-row', `top-comment', and nil.
+
+TYPE is the type of the current element or object.
+
+If PARENT? is non-nil, assume the next element or object will be
+located inside the current one."
+ (if parent?
+ (pcase type
+ (`headline 'section)
+ ((and (guard (eq mode 'first-section)) `section) 'top-comment)
+ (`inlinetask 'planning)
+ (`plain-list 'item)
+ (`property-drawer 'node-property)
+ (`section 'planning)
+ (`table 'table-row))
+ (pcase mode
+ (`item 'item)
+ (`node-property 'node-property)
+ ((and `planning (guard (eq type 'planning))) 'property-drawer)
+ (`table-row 'table-row)
+ ((and `top-comment (guard (eq type 'comment))) 'property-drawer))))
+
+(defun org-element--parse-elements
+ (beg end mode structure granularity visible-only acc)
+ "Parse elements between BEG and END positions.
+
+MODE prioritizes some elements over the others. It can be set to
+`first-section', `item', `node-property', `planning',
+`property-drawer', `section', `table-row', `top-comment', or nil.
+
+When value is `item', STRUCTURE will be used as the current list
+structure.
+
+GRANULARITY determines the depth of the recursion. See
+`org-element-parse-buffer' for more information.
+
+When VISIBLE-ONLY is non-nil, don't parse contents of hidden
+elements.
+
+Elements are accumulated into ACC."
+ (save-excursion
+ (goto-char beg)
+ ;; When parsing only headlines, skip any text before first one.
+ (when (and (eq granularity 'headline) (not (org-at-heading-p)))
+ (org-with-limited-levels (outline-next-heading)))
+ (let (elements)
+ (while (< (point) end)
+ ;; Visible only: skip invisible parts due to folding.
+ (if (and visible-only (org-invisible-p nil t))
+ (progn
+ (goto-char (org-find-visible))
+ (when (and (eolp) (not (eobp))) (forward-char)))
+ ;; Find current element's type and parse it accordingly to
+ ;; its category.
+ (let* ((element (org-element--current-element
+ end granularity mode structure))
+ (type (org-element-type element))
+ (cbeg (org-element-property :contents-begin element)))
+ (goto-char (org-element-property :end element))
+ ;; Fill ELEMENT contents by side-effect.
+ (cond
+ ;; If element has no contents, don't modify it.
+ ((not cbeg))
+ ;; Greater element: parse it between `contents-begin' and
+ ;; `contents-end'. Ensure GRANULARITY allows recursion,
+ ;; or ELEMENT is a headline, in which case going inside
+ ;; is mandatory, in order to get sub-level headings.
+ ((and (memq type org-element-greater-elements)
+ (or (memq granularity '(element object nil))
+ (and (eq granularity 'greater-element)
+ (eq type 'section))
+ (eq type 'headline)))
+ (org-element--parse-elements
+ cbeg (org-element-property :contents-end element)
+ ;; Possibly switch to a special mode.
+ (org-element--next-mode mode type t)
+ (and (memq type '(item plain-list))
+ (org-element-property :structure element))
+ granularity visible-only element))
+ ;; ELEMENT has contents. Parse objects inside, if
+ ;; GRANULARITY allows it.
+ ((memq granularity '(object nil))
+ (org-element--parse-objects
+ cbeg (org-element-property :contents-end element) element
+ (org-element-restriction type))))
+ (push (org-element-put-property element :parent acc) elements)
+ ;; Update mode.
+ (setq mode (org-element--next-mode mode type nil)))))
+ ;; Return result.
+ (apply #'org-element-set-contents acc (nreverse elements)))))
+
+(defun org-element--object-lex (restriction)
+ "Return next object in current buffer or nil.
+RESTRICTION is a list of object types, as symbols, that should be
+looked after. This function assumes that the buffer is narrowed
+to an appropriate container (e.g., a paragraph)."
+ (cond
+ ((memq 'table-cell restriction) (org-element-table-cell-parser))
+ ((memq 'citation-reference restriction)
+ (org-element-citation-reference-parser))
+ (t
+ (let* ((start (point))
+ (limit
+ ;; Object regexp sometimes needs to have a peek at
+ ;; a character ahead. Therefore, when there is a hard
+ ;; limit, make it one more than the true beginning of the
+ ;; radio target.
+ (save-excursion
+ (cond ((not org-target-link-regexp) nil)
+ ((not (memq 'link restriction)) nil)
+ ((progn
+ (unless (bolp) (forward-char -1))
+ (not (re-search-forward org-target-link-regexp nil t)))
+ nil)
+ ;; Since we moved backward, we do not want to
+ ;; match again an hypothetical 1-character long
+ ;; radio link before us. Realizing that this can
+ ;; only happen if such a radio link starts at
+ ;; beginning of line, we prevent this here.
+ ((and (= start (1+ (line-beginning-position)))
+ (= start (match-end 1)))
+ (and (re-search-forward org-target-link-regexp nil t)
+ (1+ (match-beginning 1))))
+ (t (1+ (match-beginning 1))))))
+ found)
+ (save-excursion
+ (while (and (not found)
+ (re-search-forward org-element--object-regexp limit 'move))
+ (goto-char (match-beginning 0))
+ (let ((result (match-string 0)))
+ (setq found
+ (cond
+ ((string-prefix-p "call_" result t)
+ (and (memq 'inline-babel-call restriction)
+ (org-element-inline-babel-call-parser)))
+ ((string-prefix-p "src_" result t)
+ (and (memq 'inline-src-block restriction)
+ (org-element-inline-src-block-parser)))
+ (t
+ (pcase (char-after)
+ (?^ (and (memq 'superscript restriction)
+ (org-element-superscript-parser)))
+ (?_ (or (and (memq 'subscript restriction)
+ (org-element-subscript-parser))
+ (and (memq 'underline restriction)
+ (org-element-underline-parser))))
+ (?* (and (memq 'bold restriction)
+ (org-element-bold-parser)))
+ (?/ (and (memq 'italic restriction)
+ (org-element-italic-parser)))
+ (?~ (and (memq 'code restriction)
+ (org-element-code-parser)))
+ (?= (and (memq 'verbatim restriction)
+ (org-element-verbatim-parser)))
+ (?+ (and (memq 'strike-through restriction)
+ (org-element-strike-through-parser)))
+ (?@ (and (memq 'export-snippet restriction)
+ (org-element-export-snippet-parser)))
+ (?{ (and (memq 'macro restriction)
+ (org-element-macro-parser)))
+ (?$ (and (memq 'latex-fragment restriction)
+ (org-element-latex-fragment-parser)))
+ (?<
+ (if (eq (aref result 1) ?<)
+ (or (and (memq 'radio-target restriction)
+ (org-element-radio-target-parser))
+ (and (memq 'target restriction)
+ (org-element-target-parser)))
+ (or (and (memq 'timestamp restriction)
+ (org-element-timestamp-parser))
+ (and (memq 'link restriction)
+ (org-element-link-parser)))))
+ (?\\
+ (if (eq (aref result 1) ?\\)
+ (and (memq 'line-break restriction)
+ (org-element-line-break-parser))
+ (or (and (memq 'entity restriction)
+ (org-element-entity-parser))
+ (and (memq 'latex-fragment restriction)
+ (org-element-latex-fragment-parser)))))
+ (?\[
+ (pcase (aref result 1)
+ ((and ?\[
+ (guard (memq 'link restriction)))
+ (org-element-link-parser))
+ ((and ?f
+ (guard (memq 'footnote-reference restriction)))
+ (org-element-footnote-reference-parser))
+ ((and ?c
+ (guard (memq 'citation restriction)))
+ (org-element-citation-parser))
+ ((and (or ?% ?/)
+ (guard (memq 'statistics-cookie restriction)))
+ (org-element-statistics-cookie-parser))
+ (_
+ (or (and (memq 'timestamp restriction)
+ (org-element-timestamp-parser))
+ (and (memq 'statistics-cookie restriction)
+ (org-element-statistics-cookie-parser))))))
+ ;; This is probably a plain link.
+ (_ (and (memq 'link restriction)
+ (org-element-link-parser)))))))
+ (or (eobp) (forward-char))))
+ (cond (found)
+ (limit (forward-char -1)
+ (org-element-link-parser)) ;radio link
+ (t nil)))))))
+
+(defun org-element--parse-objects (beg end acc restriction &optional parent)
+ "Parse objects between BEG and END and return recursive structure.
+
+Objects are accumulated in ACC. RESTRICTION is a list of object
+successors which are allowed in the current object.
+
+ACC becomes the parent for all parsed objects. However, if ACC
+is nil (i.e., a secondary string is being parsed) and optional
+argument PARENT is non-nil, use it as the parent for all objects.
+Eventually, if both ACC and PARENT are nil, the common parent is
+the list of objects itself."
+ (save-excursion
+ (save-restriction
+ (narrow-to-region beg end)
+ (goto-char (point-min))
+ (let (next-object contents)
+ (while (and (not (eobp))
+ (setq next-object (org-element--object-lex restriction)))
+ ;; Text before any object.
+ (let ((obj-beg (org-element-property :begin next-object)))
+ (unless (= (point) obj-beg)
+ (let ((text (buffer-substring-no-properties (point) obj-beg)))
+ (push (if acc (org-element-put-property text :parent acc) text)
+ contents))))
+ ;; Object...
+ (let ((obj-end (org-element-property :end next-object))
+ (cont-beg (org-element-property :contents-begin next-object)))
+ (when acc (org-element-put-property next-object :parent acc))
+ (push (if cont-beg
+ ;; Fill contents of NEXT-OBJECT if possible.
+ (org-element--parse-objects
+ cont-beg
+ (org-element-property :contents-end next-object)
+ next-object
+ (org-element-restriction next-object))
+ next-object)
+ contents)
+ (goto-char obj-end)))
+ ;; Text after last object.
+ (unless (eobp)
+ (let ((text (buffer-substring-no-properties (point) end)))
+ (push (if acc (org-element-put-property text :parent acc) text)
+ contents)))
+ ;; Result. Set appropriate parent.
+ (if acc (apply #'org-element-set-contents acc (nreverse contents))
+ (let* ((contents (nreverse contents))
+ (parent (or parent contents)))
+ (dolist (datum contents contents)
+ (org-element-put-property datum :parent parent))))))))
+
+
+
+;;; Towards A Bijective Process
+;;
+;; The parse tree obtained with `org-element-parse-buffer' is really
+;; a snapshot of the corresponding Org buffer. Therefore, it can be
+;; interpreted and expanded into a string with canonical Org syntax.
+;; Hence `org-element-interpret-data'.
+;;
+;; The function relies internally on
+;; `org-element--interpret-affiliated-keywords'.
+
+;;;###autoload
+(defun org-element-interpret-data (data)
+ "Interpret DATA as Org syntax.
+DATA is a parse tree, an element, an object or a secondary string
+to interpret. Return Org syntax as a string."
+ (letrec ((fun
+ (lambda (data parent)
+ (let* ((type (org-element-type data))
+ ;; Find interpreter for current object or
+ ;; element. If it doesn't exist (e.g. this is
+ ;; a pseudo object or element), return contents,
+ ;; if any.
+ (interpret
+ (let ((fun (intern
+ (format "org-element-%s-interpreter" type))))
+ (if (fboundp fun) fun (lambda (_ contents) contents))))
+ (results
+ (cond
+ ;; Secondary string.
+ ((not type)
+ (mapconcat (lambda (obj) (funcall fun obj parent))
+ data
+ ""))
+ ;; Full Org document.
+ ((eq type 'org-data)
+ (mapconcat (lambda (obj) (funcall fun obj parent))
+ (org-element-contents data)
+ ""))
+ ;; Plain text: return it.
+ ((stringp data) data)
+ ;; Element or object without contents.
+ ((not (org-element-contents data))
+ (funcall interpret data nil))
+ ;; Element or object with contents.
+ (t
+ (funcall
+ interpret
+ data
+ ;; Recursively interpret contents.
+ (mapconcat
+ (lambda (datum) (funcall fun datum data))
+ (org-element-contents
+ (if (not (memq type '(paragraph verse-block)))
+ data
+ ;; Fix indentation of elements containing
+ ;; objects. We ignore `table-row'
+ ;; elements as they are one line long
+ ;; anyway.
+ (org-element-normalize-contents
+ data
+ ;; When normalizing first paragraph of
+ ;; an item or a footnote-definition,
+ ;; ignore first line's indentation.
+ (and (eq type 'paragraph)
+ (memq (org-element-type parent)
+ '(footnote-definition item))
+ (eq data (car (org-element-contents parent)))
+ (eq (org-element-property :pre-blank parent)
+ 0)))))
+ ""))))))
+ (if (memq type '(org-data nil)) results
+ ;; Build white spaces. If no `:post-blank' property
+ ;; is specified, assume its value is 0.
+ (let ((blank (or (org-element-property :post-blank data) 0)))
+ (if (eq (org-element-class data parent) 'object)
+ (concat results (make-string blank ?\s))
+ (concat (org-element--interpret-affiliated-keywords data)
+ (org-element-normalize-string results)
+ (make-string blank ?\n)))))))))
+ (funcall fun data nil)))
+
+(defun org-element--interpret-affiliated-keywords (element)
+ "Return ELEMENT's affiliated keywords as Org syntax.
+If there is no affiliated keyword, return the empty string."
+ (let ((keyword-to-org
+ (lambda (key value)
+ (let (dual)
+ (when (member key org-element-dual-keywords)
+ (setq dual (cdr value) value (car value)))
+ (concat "#+" (downcase key)
+ (and dual
+ (format "[%s]" (org-element-interpret-data dual)))
+ ": "
+ (if (member key org-element-parsed-keywords)
+ (org-element-interpret-data value)
+ value)
+ "\n")))))
+ (mapconcat
+ (lambda (prop)
+ (let ((value (org-element-property prop element))
+ (keyword (upcase (substring (symbol-name prop) 1))))
+ (when value
+ (if (or (member keyword org-element-multiple-keywords)
+ ;; All attribute keywords can have multiple lines.
+ (string-match "^ATTR_" keyword))
+ (mapconcat (lambda (line) (funcall keyword-to-org keyword line))
+ (reverse value)
+ "")
+ (funcall keyword-to-org keyword value)))))
+ ;; List all ELEMENT's properties matching an attribute line or an
+ ;; affiliated keyword, but ignore translated keywords since they
+ ;; cannot belong to the property list.
+ (cl-loop for prop in (nth 1 element) by 'cddr
+ when (let ((keyword (upcase (substring (symbol-name prop) 1))))
+ (or (string-match "^ATTR_" keyword)
+ (and
+ (member keyword org-element-affiliated-keywords)
+ (not (assoc keyword
+ org-element-keyword-translation-alist)))))
+ collect prop)
+ "")))
+
+;; Because interpretation of the parse tree must return the same
+;; number of blank lines between elements and the same number of white
+;; space after objects, some special care must be given to white
+;; spaces.
+;;
+;; The first function, `org-element-normalize-string', ensures any
+;; string different from the empty string will end with a single
+;; newline character.
+;;
+;; The second function, `org-element-normalize-contents', removes
+;; global indentation from the contents of the current element.
+
+(defun org-element-normalize-string (s)
+ "Ensure string S ends with a single newline character.
+
+If S isn't a string return it unchanged. If S is the empty
+string, return it. Otherwise, return a new string with a single
+newline character at its end."
+ (cond
+ ((not (stringp s)) s)
+ ((string= "" s) "")
+ (t (and (string-match "\\(\n[ \t]*\\)*\\'" s)
+ (replace-match "\n" nil nil s)))))
+
+(defun org-element-normalize-contents (element &optional ignore-first)
+ "Normalize plain text in ELEMENT's contents.
+
+ELEMENT must only contain plain text and objects.
+
+If optional argument IGNORE-FIRST is non-nil, ignore first line's
+indentation to compute maximal common indentation.
+
+Return the normalized element that is element with global
+indentation removed from its contents."
+ (letrec ((find-min-ind
+ ;; Return minimal common indentation within BLOB. This is
+ ;; done by walking recursively BLOB and updating MIN-IND
+ ;; along the way. FIRST-FLAG is non-nil when the next
+ ;; object is expected to be a string that doesn't start
+ ;; with a newline character. It happens for strings at
+ ;; the beginnings of the contents or right after a line
+ ;; break.
+ (lambda (blob first-flag min-ind)
+ (dolist (datum (org-element-contents blob) min-ind)
+ (when first-flag
+ (setq first-flag nil)
+ (cond
+ ;; Objects cannot start with spaces: in this
+ ;; case, indentation is 0.
+ ((not (stringp datum)) (throw :zero 0))
+ ((not (string-match
+ "\\`\\([ \t]+\\)\\([^ \t\n]\\|\n\\|\\'\\)" datum))
+ (throw :zero 0))
+ ((equal (match-string 2 datum) "\n")
+ (put-text-property
+ (match-beginning 1) (match-end 1) 'org-ind 'empty datum))
+ (t
+ (let ((i (string-width (match-string 1 datum))))
+ (put-text-property
+ (match-beginning 1) (match-end 1) 'org-ind i datum)
+ (setq min-ind (min i min-ind))))))
+ (cond
+ ((stringp datum)
+ (let ((s 0))
+ (while (string-match
+ "\n\\([ \t]*\\)\\([^ \t\n]\\|\n\\|\\'\\)" datum s)
+ (setq s (match-end 1))
+ (cond
+ ((equal (match-string 1 datum) "")
+ (unless (member (match-string 2 datum) '("" "\n"))
+ (throw :zero 0)))
+ ((equal (match-string 2 datum) "\n")
+ (put-text-property (match-beginning 1) (match-end 1)
+ 'org-ind 'empty datum))
+ (t
+ (let ((i (string-width (match-string 1 datum))))
+ (put-text-property (match-beginning 1) (match-end 1)
+ 'org-ind i datum)
+ (setq min-ind (min i min-ind))))))))
+ ((eq (org-element-type datum) 'line-break)
+ (setq first-flag t))
+ ((memq (org-element-type datum) org-element-recursive-objects)
+ (setq min-ind
+ (funcall find-min-ind datum first-flag min-ind)))))))
+ (min-ind
+ (catch :zero
+ (funcall find-min-ind
+ element (not ignore-first) most-positive-fixnum))))
+ (if (or (zerop min-ind) (= min-ind most-positive-fixnum)) element
+ ;; Build ELEMENT back, replacing each string with the same
+ ;; string minus common indentation.
+ (letrec ((build
+ (lambda (datum)
+ ;; Return DATUM with all its strings indentation
+ ;; shortened from MIN-IND white spaces.
+ (setcdr
+ (cdr datum)
+ (mapcar
+ (lambda (object)
+ (cond
+ ((stringp object)
+ (with-temp-buffer
+ (insert object)
+ (let ((s (point-min)))
+ (while (setq s (text-property-not-all
+ s (point-max) 'org-ind nil))
+ (goto-char s)
+ (let ((i (get-text-property s 'org-ind)))
+ (delete-region s (progn
+ (skip-chars-forward " \t")
+ (point)))
+ (when (integerp i) (indent-to (- i min-ind))))))
+ (buffer-string)))
+ ((memq (org-element-type object)
+ org-element-recursive-objects)
+ (funcall build object))
+ (t object)))
+ (org-element-contents datum)))
+ datum)))
+ (funcall build element)))))
+
+
+
+;;; Cache
+;;
+;; Implement a caching mechanism for `org-element-at-point' and
+;; `org-element-context', which see.
+;;
+;; A single public function is provided: `org-element-cache-reset'.
+;;
+;; Cache is disabled by default for now because it sometimes triggers
+;; freezes, but it can be enabled 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
+;; behavior.
+;;
+;; Internally, parsed elements are stored in an AVL tree,
+;; `org-element--cache'. This tree is updated lazily: whenever
+;; a change happens to the buffer, a synchronization request is
+;; registered in `org-element--cache-sync-requests' (see
+;; `org-element--cache-submit-request'). During idle time, requests
+;; are processed by `org-element--cache-sync'. Synchronization also
+;; happens when an element is required from the cache. In this case,
+;; the process stops as soon as the needed element is up-to-date.
+;;
+;; A synchronization request can only apply on a synchronized part of
+;; the cache. Therefore, the cache is updated at least to the
+;; location where the new request applies. Thus, requests are ordered
+;; from left to right and all elements starting before the first
+;; request are correct. This property is used by functions like
+;; `org-element--cache-find' to retrieve elements in the part of the
+;; cache that can be trusted.
+;;
+;; A request applies to every element, starting from its original
+;; location (or key, see below). When a request is processed, it
+;; moves forward and may collide the next one. In this case, both
+;; requests are merged into a new one that starts from that element.
+;; As a consequence, the whole synchronization complexity does not
+;; depend on the number of pending requests, but on the number of
+;; elements the very first request will be applied on.
+;;
+;; Elements cannot be accessed through their beginning position, which
+;; may or may not be up-to-date. Instead, each element in the tree is
+;; associated to a key, obtained with `org-element--cache-key'. This
+;; mechanism is robust enough to preserve total order among elements
+;; even when the tree is only partially synchronized.
+
+
+(defvar org-element-use-cache nil
+ "Non-nil when Org parser should cache its results.
+
+WARNING: for the time being, using cache sometimes triggers
+freezes. Therefore, it is disabled by default. Activate it if
+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 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 0.3
+ "Duration, as a time value, of the pause between synchronizations.
+See `org-element-cache-sync-duration' for more information.")
+
+
+;;;; Data Structure
+
+(defvar org-element--cache nil
+ "AVL tree used to cache elements.
+Each node of the tree contains an element. Comparison is done
+with `org-element--cache-compare'. This cache is used in
+`org-element-at-point'.")
+
+(defvar org-element--cache-sync-requests nil
+ "List of pending synchronization requests.
+
+A request is a vector with the following pattern:
+
+ [NEXT BEG END OFFSET PARENT PHASE]
+
+Processing a synchronization request consists of three phases:
+
+ 0. Delete modified elements,
+ 1. Fill missing area in cache,
+ 2. Shift positions and re-parent elements after the changes.
+
+During phase 0, NEXT is the key of the first element to be
+removed, BEG and END is buffer position delimiting the
+modifications. Elements starting between them (inclusive) are
+removed. So are elements whose parent is removed. PARENT, when
+non-nil, is the parent of the first element to be removed.
+
+During phase 1, NEXT is the key of the next known element in
+cache and BEG its beginning position. Parse buffer between that
+element and the one before it in order to determine the parent of
+the next element. Set PARENT to the element containing NEXT.
+
+During phase 2, NEXT is the key of the next element to shift in
+the parse tree. All elements starting from this one have their
+properties relatives to buffer positions shifted by integer
+OFFSET and, if they belong to element PARENT, are adopted by it.
+
+PHASE specifies the phase number, as an integer.")
+
+(defvar org-element--cache-sync-timer nil
+ "Timer used for cache synchronization.")
+
+(defvar org-element--cache-sync-keys nil
+ "Hash table used to store keys during synchronization.
+See `org-element--cache-key' for more information.")
+
+(defsubst org-element--cache-key (element)
+ "Return a unique key for ELEMENT in cache tree.
+
+Keys are used to keep a total order among elements in the cache.
+Comparison is done with `org-element--cache-key-less-p'.
+
+When no synchronization is taking place, a key is simply the
+beginning position of the element, or that position plus one in
+the case of an first item (respectively row) in
+a list (respectively a table).
+
+During a synchronization, the key is the one the element had when
+the cache was synchronized for the last time. Elements added to
+cache during the synchronization get a new key generated with
+`org-element--cache-generate-key'.
+
+Such keys are stored in `org-element--cache-sync-keys'. The hash
+table is cleared once the synchronization is complete."
+ (or (gethash element org-element--cache-sync-keys)
+ (let* ((begin (org-element-property :begin element))
+ ;; Increase beginning position of items (respectively
+ ;; table rows) by one, so the first item can get
+ ;; a different key from its parent list (respectively
+ ;; table).
+ (key (if (memq (org-element-type element) '(item table-row))
+ (1+ begin)
+ begin)))
+ (if org-element--cache-sync-requests
+ (puthash element key org-element--cache-sync-keys)
+ key))))
+
+(defun org-element--cache-generate-key (lower upper)
+ "Generate a key between LOWER and UPPER.
+
+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
+the following rules:
+
+ - LOWER and UPPER are compared level-wise until values differ.
+
+ - If, at a given level, LOWER and UPPER differ from more than
+ 2, the new key shares all the levels above with LOWER and
+ gets a new level. Its value is the mean between LOWER and
+ UPPER:
+
+ (1 2) + (1 4) --> (1 3)
+
+ - If LOWER has no value to compare with, it is assumed that its
+ value is `most-negative-fixnum'. E.g.,
+
+ (1 1) + (1 1 2)
+
+ is equivalent to
+
+ (1 1 m) + (1 1 2)
+
+ where m is `most-negative-fixnum'. Likewise, if UPPER is
+ short of levels, the current value is `most-positive-fixnum'.
+
+ - If they differ from only one, the new key inherits from
+ current LOWER level and fork it at the next level. E.g.,
+
+ (2 1) + (3 3)
+
+ is equivalent to
+
+ (2 1) + (2 M)
+
+ where M is `most-positive-fixnum'.
+
+ - If the key is only one level long, it is returned as an
+ integer:
+
+ (1 2) + (3 2) --> 2
+
+When they are not equals, the function assumes that LOWER is
+lesser than UPPER, per `org-element--cache-key-less-p'."
+ (if (equal lower upper) lower
+ (let ((lower (if (integerp lower) (list lower) lower))
+ (upper (if (integerp upper) (list upper) upper))
+ skip-upper key)
+ (catch 'exit
+ (while t
+ (let ((min (or (car lower) most-negative-fixnum))
+ (max (cond (skip-upper most-positive-fixnum)
+ ((car upper))
+ (t most-positive-fixnum))))
+ (if (< (1+ min) max)
+ (let ((mean (+ (ash min -1) (ash max -1) (logand min max 1))))
+ (throw 'exit (if key (nreverse (cons mean key)) mean)))
+ (when (and (< min max) (not skip-upper))
+ ;; When at a given level, LOWER and UPPER differ from
+ ;; 1, ignore UPPER altogether. Instead create a key
+ ;; between LOWER and the greatest key with the same
+ ;; prefix as LOWER so far.
+ (setq skip-upper t))
+ (push min key)
+ (setq lower (cdr lower) upper (cdr upper)))))))))
+
+(defsubst org-element--cache-key-less-p (a b)
+ "Non-nil if key A is less than key B.
+A and B are either integers or lists of integers, as returned by
+`org-element--cache-key'."
+ (if (integerp a) (if (integerp b) (< a b) (<= a (car b)))
+ (if (integerp b) (< (car a) b)
+ (catch 'exit
+ (while (and a b)
+ (cond ((car-less-than-car a b) (throw 'exit t))
+ ((car-less-than-car b a) (throw 'exit nil))
+ (t (setq a (cdr a) b (cdr b)))))
+ ;; If A is empty, either keys are equal (B is also empty) and
+ ;; we return nil, or A is lesser than B (B is longer) and we
+ ;; return a non-nil value.
+ ;;
+ ;; If A is not empty, B is necessarily empty and A is greater
+ ;; than B (A is longer). Therefore, return nil.
+ (and (null a) b)))))
+
+(defun org-element--cache-compare (a b)
+ "Non-nil when element A is located before element B."
+ (org-element--cache-key-less-p (org-element--cache-key a)
+ (org-element--cache-key b)))
+
+(defsubst org-element--cache-root ()
+ "Return root value in cache.
+This function assumes `org-element--cache' is a valid AVL tree."
+ (avl-tree--node-left (avl-tree--dummyroot org-element--cache)))
+
+
+;;;; Tools
+
+(defsubst org-element--cache-active-p ()
+ "Non-nil when cache is active in current buffer."
+ (and org-element-use-cache
+ org-element--cache
+ (derived-mode-p 'org-mode)))
+
+(defun org-element--cache-find (pos &optional side)
+ "Find element in cache starting at POS or before.
+
+POS refers to a buffer position.
+
+When optional argument SIDE is non-nil, the function checks for
+elements starting at or past POS instead. If SIDE is `both', the
+function returns a cons cell where car is the first element
+starting at or before POS and cdr the first element starting
+after POS.
+
+The function can only find elements in the synchronized part of
+the cache."
+ (let ((limit (and org-element--cache-sync-requests
+ (aref (car org-element--cache-sync-requests) 0)))
+ (node (org-element--cache-root))
+ lower upper)
+ (while node
+ (let* ((element (avl-tree--node-data node))
+ (begin (org-element-property :begin element)))
+ (cond
+ ((and limit
+ (not (org-element--cache-key-less-p
+ (org-element--cache-key element) limit)))
+ (setq node (avl-tree--node-left node)))
+ ((> begin pos)
+ (setq upper element
+ node (avl-tree--node-left node)))
+ ((< begin pos)
+ (setq lower element
+ node (avl-tree--node-right node)))
+ ;; We found an element in cache starting at POS. If `side'
+ ;; is `both' we also want the next one in order to generate
+ ;; a key in-between.
+ ;;
+ ;; If the element is the first row or item in a table or
+ ;; a plain list, we always return the table or the plain
+ ;; list.
+ ;;
+ ;; In any other case, we return the element found.
+ ((eq side 'both)
+ (setq lower element)
+ (setq node (avl-tree--node-right node)))
+ ((and (memq (org-element-type element) '(item table-row))
+ (let ((parent (org-element-property :parent element)))
+ (and (= (org-element-property :begin element)
+ (org-element-property :contents-begin parent))
+ (setq node nil
+ lower parent
+ upper parent)))))
+ (t
+ (setq node nil
+ lower element
+ upper element)))))
+ (pcase side
+ (`both (cons lower upper))
+ (`nil lower)
+ (_ upper))))
+
+(defun org-element--cache-put (element)
+ "Store ELEMENT in current buffer's cache, if allowed."
+ (when (org-element--cache-active-p)
+ (when org-element--cache-sync-requests
+ ;; During synchronization, first build an appropriate key for
+ ;; the new element so `avl-tree-enter' can insert it at the
+ ;; right spot in the cache.
+ (let ((keys (org-element--cache-find
+ (org-element-property :begin element) 'both)))
+ (puthash element
+ (org-element--cache-generate-key
+ (and (car keys) (org-element--cache-key (car keys)))
+ (cond ((cdr keys) (org-element--cache-key (cdr keys)))
+ (org-element--cache-sync-requests
+ (aref (car org-element--cache-sync-requests) 0))))
+ org-element--cache-sync-keys)))
+ (avl-tree-enter org-element--cache element)))
+
+(defsubst org-element--cache-remove (element)
+ "Remove ELEMENT from cache.
+Assume ELEMENT belongs to cache and that a cache is active."
+ (avl-tree-delete org-element--cache element))
+
+
+;;;; Synchronization
+
+(defsubst org-element--cache-set-timer (buffer)
+ "Set idle timer for cache synchronization in BUFFER."
+ (when org-element--cache-sync-timer
+ (cancel-timer org-element--cache-sync-timer))
+ (setq org-element--cache-sync-timer
+ (run-with-idle-timer
+ (let ((idle (current-idle-time)))
+ (if idle (org-time-add idle org-element-cache-sync-break)
+ org-element-cache-sync-idle-time))
+ nil
+ #'org-element--cache-sync
+ buffer)))
+
+(defsubst org-element--cache-interrupt-p (time-limit)
+ "Non-nil when synchronization process should be interrupted.
+TIME-LIMIT is a time value or nil."
+ (and time-limit
+ (or (input-pending-p)
+ (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.
+
+Properties containing buffer positions are `:begin', `:end',
+`:contents-begin', `:contents-end' and `:structure'. When
+optional argument PROPS is a list of keywords, only shift
+properties provided in that list.
+
+Properties are modified by side-effect."
+ (let ((properties (nth 1 element)))
+ ;; Shift `:structure' property for the first plain list only: it
+ ;; is the only one that really matters and it prevents from
+ ;; shifting it more than once.
+ (when (and (or (not props) (memq :structure props))
+ (eq (org-element-type element) 'plain-list)
+ (not (eq (org-element-type (plist-get properties :parent))
+ 'item)))
+ (dolist (item (plist-get properties :structure))
+ (cl-incf (car item) offset)
+ (cl-incf (nth 6 item) offset)))
+ (dolist (key '(:begin :contents-begin :contents-end :end :post-affiliated))
+ (let ((value (and (or (not props) (memq key props))
+ (plist-get properties key))))
+ (and value (plist-put properties key (+ offset value)))))))
+
+(defun org-element--cache-sync (buffer &optional threshold future-change)
+ "Synchronize cache with recent modification in BUFFER.
+
+When optional argument THRESHOLD is non-nil, do the
+synchronization for all elements starting before or at threshold,
+then exit. Otherwise, synchronize cache for as long as
+`org-element-cache-sync-duration' or until Emacs leaves idle
+state.
+
+FUTURE-CHANGE, when non-nil, is a buffer position where changes
+not registered yet in the cache are going to happen. It is used
+in `org-element--cache-submit-request', where cache is partially
+updated before current modification are actually submitted."
+ (when (buffer-live-p buffer)
+ (with-current-buffer buffer
+ (let ((inhibit-quit t) request next)
+ (when org-element--cache-sync-timer
+ (cancel-timer org-element--cache-sync-timer))
+ (catch 'interrupt
+ (while org-element--cache-sync-requests
+ (setq request (car org-element--cache-sync-requests)
+ next (nth 1 org-element--cache-sync-requests))
+ (org-element--cache-process-request
+ request
+ (and next (aref next 0))
+ threshold
+ (and (not threshold)
+ (org-time-add nil
+ org-element-cache-sync-duration))
+ future-change)
+ ;; Request processed. Merge current and next offsets and
+ ;; transfer ending position.
+ (when next
+ (cl-incf (aref next 3) (aref request 3))
+ (aset next 2 (aref request 2)))
+ (setq org-element--cache-sync-requests
+ (cdr org-element--cache-sync-requests))))
+ ;; If more requests are awaiting, set idle timer accordingly.
+ ;; Otherwise, reset keys.
+ (if org-element--cache-sync-requests
+ (org-element--cache-set-timer buffer)
+ (clrhash org-element--cache-sync-keys))))))
+
+(defun org-element--cache-process-request
+ (request next threshold time-limit future-change)
+ "Process synchronization REQUEST for all entries before NEXT.
+
+REQUEST is a vector, built by `org-element--cache-submit-request'.
+
+NEXT is a cache key, as returned by `org-element--cache-key'.
+
+When non-nil, THRESHOLD is a buffer position. Synchronization
+stops as soon as a shifted element begins after it.
+
+When non-nil, TIME-LIMIT is a time value. Synchronization stops
+after this time or when Emacs exits idle state.
+
+When non-nil, FUTURE-CHANGE is a buffer position where changes
+not registered yet in the cache are going to happen. See
+`org-element--cache-submit-request' for more information.
+
+Throw `interrupt' if the process stops before completing the
+request."
+ (catch 'quit
+ (when (= (aref request 5) 0)
+ ;; Phase 0.
+ ;;
+ ;; Delete all elements starting after BEG, but not after buffer
+ ;; position END or past element with key NEXT. Also delete
+ ;; elements contained within a previously removed element
+ ;; (stored in `last-container').
+ ;;
+ ;; At each iteration, we start again at tree root since
+ ;; a deletion modifies structure of the balanced tree.
+ (catch 'end-phase
+ (while t
+ (when (org-element--cache-interrupt-p time-limit)
+ (throw 'interrupt nil))
+ ;; Find first element in cache with key BEG or after it.
+ (let ((beg (aref request 0))
+ (end (aref request 2))
+ (node (org-element--cache-root))
+ data data-key last-container)
+ (while node
+ (let* ((element (avl-tree--node-data node))
+ (key (org-element--cache-key element)))
+ (cond
+ ((org-element--cache-key-less-p key beg)
+ (setq node (avl-tree--node-right node)))
+ ((org-element--cache-key-less-p beg key)
+ (setq data element
+ data-key key
+ node (avl-tree--node-left node)))
+ (t (setq data element
+ data-key key
+ node nil)))))
+ (if data
+ (let ((pos (org-element-property :begin data)))
+ (if (if (or (not next)
+ (org-element--cache-key-less-p data-key next))
+ (<= pos end)
+ (and last-container
+ (let ((up data))
+ (while (and up (not (eq up last-container)))
+ (setq up (org-element-property :parent up)))
+ up)))
+ (progn (when (and (not last-container)
+ (> (org-element-property :end data)
+ end))
+ (setq last-container data))
+ (org-element--cache-remove data))
+ (aset request 0 data-key)
+ (aset request 1 pos)
+ (aset request 5 1)
+ (throw 'end-phase nil)))
+ ;; No element starting after modifications left in
+ ;; cache: further processing is futile.
+ (throw 'quit t))))))
+ (when (= (aref request 5) 1)
+ ;; Phase 1.
+ ;;
+ ;; Phase 0 left a hole in the cache. Some elements after it
+ ;; could have parents within. For example, in the following
+ ;; buffer:
+ ;;
+ ;; - item
+ ;;
+ ;;
+ ;; Paragraph1
+ ;;
+ ;; Paragraph2
+ ;;
+ ;; if we remove a blank line between "item" and "Paragraph1",
+ ;; everything down to "Paragraph2" is removed from cache. But
+ ;; the paragraph now belongs to the list, and its `:parent'
+ ;; property no longer is accurate.
+ ;;
+ ;; Therefore we need to parse again elements in the hole, or at
+ ;; least in its last section, so that we can re-parent
+ ;; subsequent elements, during phase 2.
+ ;;
+ ;; Note that we only need to get the parent from the first
+ ;; element in cache after the hole.
+ ;;
+ ;; When next key is lesser or equal to the current one, delegate
+ ;; phase 1 processing to next request in order to preserve key
+ ;; order among requests.
+ (let ((key (aref request 0)))
+ (when (and next (not (org-element--cache-key-less-p key next)))
+ (let ((next-request (nth 1 org-element--cache-sync-requests)))
+ (aset next-request 0 key)
+ (aset next-request 1 (aref request 1))
+ (aset next-request 5 1))
+ (throw 'quit t)))
+ ;; Next element will start at its beginning position plus
+ ;; offset, since it hasn't been shifted yet. Therefore, LIMIT
+ ;; contains the real beginning position of the first element to
+ ;; shift and re-parent.
+ (let ((limit (+ (aref request 1) (aref request 3))))
+ (cond ((and threshold (> limit threshold)) (throw 'interrupt nil))
+ ((and future-change (>= limit future-change))
+ ;; Changes are going to happen around this element and
+ ;; they will trigger another phase 1 request. Skip the
+ ;; current one.
+ (aset request 5 2))
+ (t
+ (let ((parent (org-element--parse-to limit t time-limit)))
+ (aset request 4 parent)
+ (aset request 5 2))))))
+ ;; Phase 2.
+ ;;
+ ;; Shift all elements starting from key START, but before NEXT, by
+ ;; OFFSET, and re-parent them when appropriate.
+ ;;
+ ;; Elements are modified by side-effect so the tree structure
+ ;; remains intact.
+ ;;
+ ;; Once THRESHOLD, if any, is reached, or once there is an input
+ ;; pending, exit. Before leaving, the current synchronization
+ ;; request is updated.
+ (let ((start (aref request 0))
+ (offset (aref request 3))
+ (parent (aref request 4))
+ (node (org-element--cache-root))
+ (stack (list nil))
+ (leftp t)
+ exit-flag)
+ ;; No re-parenting nor shifting planned: request is over.
+ (when (and (not parent) (zerop offset)) (throw 'quit t))
+ (while node
+ (let* ((data (avl-tree--node-data node))
+ (key (org-element--cache-key data)))
+ (if (and leftp (avl-tree--node-left node)
+ (not (org-element--cache-key-less-p key start)))
+ (progn (push node stack)
+ (setq node (avl-tree--node-left node)))
+ (unless (org-element--cache-key-less-p key start)
+ ;; We reached NEXT. Request is complete.
+ (when (equal key next) (throw 'quit t))
+ ;; Handle interruption request. Update current request.
+ (when (or exit-flag (org-element--cache-interrupt-p time-limit))
+ (aset request 0 key)
+ (aset request 4 parent)
+ (throw 'interrupt nil))
+ ;; Shift element.
+ (unless (zerop offset)
+ (org-element--cache-shift-positions data offset))
+ (let ((begin (org-element-property :begin data)))
+ ;; Update PARENT and re-parent DATA, only when
+ ;; necessary. Propagate new structures for lists.
+ (while (and parent
+ (<= (org-element-property :end parent) begin))
+ (setq parent (org-element-property :parent parent)))
+ (cond ((and (not parent) (zerop offset)) (throw 'quit nil))
+ ((and parent
+ (let ((p (org-element-property :parent data)))
+ (or (not p)
+ (< (org-element-property :begin p)
+ (org-element-property :begin parent)))))
+ (org-element-put-property data :parent parent)
+ (let ((s (org-element-property :structure parent)))
+ (when (and s (org-element-property :structure data))
+ (org-element-put-property data :structure s)))))
+ ;; Cache is up-to-date past THRESHOLD. Request
+ ;; interruption.
+ (when (and threshold (> begin threshold)) (setq exit-flag t))))
+ (setq node (if (setq leftp (avl-tree--node-right node))
+ (avl-tree--node-right node)
+ (pop stack))))))
+ ;; We reached end of tree: synchronization complete.
+ t)))
+
+(defun org-element--parse-to (pos &optional syncp time-limit)
+ "Parse elements in current section, down to POS.
+
+Start parsing from the closest between the last known element in
+cache or headline above. Return the smallest element containing
+POS.
+
+When optional argument SYNCP is non-nil, return the parent of the
+element containing POS instead. In that case, it is also
+possible to provide TIME-LIMIT, which is a time value specifying
+when the parsing should stop. The function throws `interrupt' if
+the process stopped before finding the expected result."
+ (catch 'exit
+ (org-with-wide-buffer
+ (goto-char pos)
+ (let* ((cached (and (org-element--cache-active-p)
+ (org-element--cache-find pos nil)))
+ (begin (org-element-property :begin cached))
+ element next mode)
+ (cond
+ ;; Nothing in cache before point: start parsing from first
+ ;; element following headline above, or first element in
+ ;; buffer.
+ ((not cached)
+ (if (org-with-limited-levels (outline-previous-heading))
+ (progn
+ (setq mode 'planning)
+ (forward-line))
+ (setq mode 'top-comment))
+ (skip-chars-forward " \r\t\n")
+ (beginning-of-line))
+ ;; Cache returned exact match: return it.
+ ((= pos begin)
+ (throw 'exit (if syncp (org-element-property :parent cached) cached)))
+ ;; There's a headline between cached value and POS: cached
+ ;; value is invalid. Start parsing from first element
+ ;; following the headline.
+ ((re-search-backward
+ (org-with-limited-levels org-outline-regexp-bol) begin t)
+ (forward-line)
+ (skip-chars-forward " \r\t\n")
+ (beginning-of-line)
+ (setq mode 'planning))
+ ;; Check if CACHED or any of its ancestors contain point.
+ ;;
+ ;; If there is such an element, we inspect it in order to know
+ ;; if we return it or if we need to parse its contents.
+ ;; Otherwise, we just start parsing from current location,
+ ;; which is right after the top-most element containing
+ ;; CACHED.
+ ;;
+ ;; As a special case, if POS is at the end of the buffer, we
+ ;; want to return the innermost element ending there.
+ ;;
+ ;; Also, if we find an ancestor and discover that we need to
+ ;; parse its contents, make sure we don't start from
+ ;; `:contents-begin', as we would otherwise go past CACHED
+ ;; again. Instead, in that situation, we will resume parsing
+ ;; from NEXT, which is located after CACHED or its higher
+ ;; ancestor not containing point.
+ (t
+ (let ((up cached)
+ (pos (if (= (point-max) pos) (1- pos) pos)))
+ (goto-char (or (org-element-property :contents-begin cached) begin))
+ (while (let ((end (org-element-property :end up)))
+ (and (<= end pos)
+ (goto-char end)
+ (setq up (org-element-property :parent up)))))
+ (cond ((not up))
+ ((eobp) (setq element up))
+ (t (setq element up next (point)))))))
+ ;; Parse successively each element until we reach POS.
+ (let ((end (or (org-element-property :end element)
+ (save-excursion
+ (org-with-limited-levels (outline-next-heading))
+ (point))))
+ (parent element))
+ (while t
+ (when syncp
+ (cond ((= (point) pos) (throw 'exit parent))
+ ((org-element--cache-interrupt-p time-limit)
+ (throw 'interrupt nil))))
+ (unless element
+ (setq element (org-element--current-element
+ end 'element mode
+ (org-element-property :structure parent)))
+ (org-element-put-property element :parent parent)
+ (org-element--cache-put element))
+ (let ((elem-end (org-element-property :end element))
+ (type (org-element-type element)))
+ (cond
+ ;; Skip any element ending before point. Also skip
+ ;; element ending at point (unless it is also the end of
+ ;; buffer) since we're sure that another element begins
+ ;; after it.
+ ((and (<= elem-end pos) (/= (point-max) elem-end))
+ (goto-char elem-end)
+ (setq mode (org-element--next-mode mode type nil)))
+ ;; A non-greater element contains point: return it.
+ ((not (memq type org-element-greater-elements))
+ (throw 'exit element))
+ ;; Otherwise, we have to decide if ELEMENT really
+ ;; contains POS. In that case we start parsing from
+ ;; contents' beginning.
+ ;;
+ ;; If POS is at contents' beginning but it is also at
+ ;; the beginning of the first item in a list or a table.
+ ;; In that case, we need to create an anchor for that
+ ;; list or table, so return it.
+ ;;
+ ;; Also, if POS is at the end of the buffer, no element
+ ;; can start after it, but more than one may end there.
+ ;; Arbitrarily, we choose to return the innermost of
+ ;; such elements.
+ ((let ((cbeg (org-element-property :contents-begin element))
+ (cend (org-element-property :contents-end element)))
+ (when (or syncp
+ (and cbeg cend
+ (or (< cbeg pos)
+ (and (= cbeg pos)
+ (not (memq type '(plain-list table)))))
+ (or (> cend pos)
+ (and (= cend pos) (= (point-max) pos)))))
+ (goto-char (or next cbeg))
+ (setq next nil
+ mode (org-element--next-mode mode type t)
+ parent element
+ end cend))))
+ ;; Otherwise, return ELEMENT as it is the smallest
+ ;; element containing POS.
+ (t (throw 'exit element))))
+ (setq element nil)))))))
+
+
+;;;; Staging Buffer Changes
+
+(defconst org-element--cache-sensitive-re
+ (concat
+ "^\\*+ " "\\|"
+ "\\\\end{[A-Za-z0-9*]+}[ \t]*$" "\\|"
+ "^[ \t]*\\(?:"
+ "#\\+\\(?:BEGIN[:_]\\|END\\(?:_\\|:?[ \t]*$\\)\\)" "\\|"
+ "\\\\begin{[A-Za-z0-9*]+}" "\\|"
+ ":\\(?:\\w\\|[-_]\\)+:[ \t]*$"
+ "\\)")
+ "Regexp matching a sensitive line, structure wise.
+A sensitive line is a headline, inlinetask, block, drawer, or
+latex-environment boundary. When such a line is modified,
+structure changes in the document may propagate in the whole
+section, possibly making cache invalid.")
+
+(defvar org-element--cache-change-warning nil
+ "Non-nil when a sensitive line is about to be changed.
+It is a symbol among nil, t and `headline'.")
+
+(defun org-element--cache-before-change (beg end)
+ "Request extension of area going to be modified if needed.
+BEG and END are the beginning and end of the range of changed
+text. See `before-change-functions' for more information."
+ (when (org-element--cache-active-p)
+ (org-with-wide-buffer
+ (goto-char beg)
+ (beginning-of-line)
+ (let ((bottom (save-excursion (goto-char end) (line-end-position))))
+ (setq org-element--cache-change-warning
+ (save-match-data
+ (if (and (org-with-limited-levels (org-at-heading-p))
+ (= (line-end-position) bottom))
+ 'headline
+ (let ((case-fold-search t))
+ (re-search-forward
+ org-element--cache-sensitive-re bottom t)))))))))
+
+(defun org-element--cache-after-change (beg end pre)
+ "Update buffer modifications for current buffer.
+BEG and END are the beginning and end of the range of changed
+text, and the length in bytes of the pre-change text replaced by
+that range. See `after-change-functions' for more information."
+ (when (org-element--cache-active-p)
+ (org-with-wide-buffer
+ (goto-char beg)
+ (beginning-of-line)
+ (save-match-data
+ (let ((top (point))
+ (bottom (save-excursion (goto-char end) (line-end-position))))
+ ;; Determine if modified area needs to be extended, according
+ ;; to both previous and current state. We make a special
+ ;; case for headline editing: if a headline is modified but
+ ;; not removed, do not extend.
+ (when (pcase org-element--cache-change-warning
+ (`t t)
+ (`headline
+ (not (and (org-with-limited-levels (org-at-heading-p))
+ (= (line-end-position) bottom))))
+ (_
+ (let ((case-fold-search t))
+ (re-search-forward
+ org-element--cache-sensitive-re bottom t))))
+ ;; Effectively extend modified area.
+ (org-with-limited-levels
+ (setq top (progn (goto-char top)
+ (when (outline-previous-heading) (forward-line))
+ (point)))
+ (setq bottom (progn (goto-char bottom)
+ (if (outline-next-heading) (1- (point))
+ (point))))))
+ ;; Store synchronization request.
+ (let ((offset (- end beg pre)))
+ (org-element--cache-submit-request top (- bottom offset) offset)))))
+ ;; Activate a timer to process the request during idle time.
+ (org-element--cache-set-timer (current-buffer))))
+
+(defun org-element--cache-for-removal (beg end offset)
+ "Return first element to remove from cache.
+
+BEG and END are buffer positions delimiting buffer modifications.
+OFFSET is the size of the changes.
+
+Returned element is usually the first element in cache containing
+any position between BEG and END. As an exception, greater
+elements around the changes that are robust to contents
+modifications are preserved and updated according to the
+changes."
+ (let* ((elements (org-element--cache-find (1- beg) 'both))
+ (before (car elements))
+ (after (cdr elements)))
+ (if (not before) after
+ (let ((up before)
+ (robust-flag t))
+ (while up
+ (if (let ((type (org-element-type up)))
+ (and (or (memq type '(center-block dynamic-block quote-block
+ special-block))
+ ;; Drawers named "PROPERTIES" are probably
+ ;; a properties drawer being edited. Force
+ ;; parsing to check if editing is over.
+ (and (eq type 'drawer)
+ (not (string=
+ (org-element-property :drawer-name up)
+ "PROPERTIES"))))
+ (let ((cbeg (org-element-property :contents-begin up)))
+ (and cbeg
+ (<= cbeg beg)
+ (> (org-element-property :contents-end up) end)))))
+ ;; UP is a robust greater element containing changes.
+ ;; We only need to extend its ending boundaries.
+ (org-element--cache-shift-positions
+ up offset '(:contents-end :end))
+ (setq before up)
+ (when robust-flag (setq robust-flag nil)))
+ (setq up (org-element-property :parent up)))
+ ;; We're at top level element containing ELEMENT: if it's
+ ;; altered by buffer modifications, it is first element in
+ ;; cache to be removed. Otherwise, that first element is the
+ ;; following one.
+ ;;
+ ;; As a special case, do not remove BEFORE if it is a robust
+ ;; container for current changes.
+ (if (or (< (org-element-property :end before) beg) robust-flag) after
+ before)))))
+
+(defun org-element--cache-submit-request (beg end offset)
+ "Submit a new cache synchronization request for current buffer.
+BEG and END are buffer positions delimiting the minimal area
+where cache data should be removed. OFFSET is the size of the
+change, as an integer."
+ (let ((next (car org-element--cache-sync-requests))
+ delete-to delete-from)
+ (if (and next
+ (zerop (aref next 5))
+ (> (setq delete-to (+ (aref next 2) (aref next 3))) end)
+ (<= (setq delete-from (aref next 1)) end))
+ ;; Current changes can be merged with first sync request: we
+ ;; can save a partial cache synchronization.
+ (progn
+ (cl-incf (aref next 3) offset)
+ ;; If last change happened within area to be removed, extend
+ ;; boundaries of robust parents, if any. Otherwise, find
+ ;; first element to remove and update request accordingly.
+ (if (> beg delete-from)
+ (let ((up (aref next 4)))
+ (while up
+ (org-element--cache-shift-positions
+ up offset '(:contents-end :end))
+ (setq up (org-element-property :parent up))))
+ (let ((first (org-element--cache-for-removal beg delete-to offset)))
+ (when first
+ (aset next 0 (org-element--cache-key first))
+ (aset next 1 (org-element-property :begin first))
+ (aset next 4 (org-element-property :parent first))))))
+ ;; Ensure cache is correct up to END. Also make sure that NEXT,
+ ;; if any, is no longer a 0-phase request, thus ensuring that
+ ;; phases are properly ordered. We need to provide OFFSET as
+ ;; optional parameter since current modifications are not known
+ ;; yet to the otherwise correct part of the cache (i.e, before
+ ;; the first request).
+ (when next (org-element--cache-sync (current-buffer) end beg))
+ (let ((first (org-element--cache-for-removal beg end offset)))
+ (if first
+ (push (let ((beg (org-element-property :begin first))
+ (key (org-element--cache-key first)))
+ (cond
+ ;; When changes happen before the first known
+ ;; element, re-parent and shift the rest of the
+ ;; cache.
+ ((> beg end) (vector key beg nil offset nil 1))
+ ;; Otherwise, we find the first non robust
+ ;; element containing END. All elements between
+ ;; FIRST and this one are to be removed.
+ ((let ((first-end (org-element-property :end first)))
+ (and (> first-end end)
+ (vector key beg first-end offset first 0))))
+ (t
+ (let* ((element (org-element--cache-find end))
+ (end (org-element-property :end element))
+ (up element))
+ (while (and (setq up (org-element-property :parent up))
+ (>= (org-element-property :begin up) beg))
+ (setq end (org-element-property :end up)
+ element up))
+ (vector key beg end offset element 0)))))
+ org-element--cache-sync-requests)
+ ;; No element to remove. No need to re-parent either.
+ ;; Simply shift additional elements, if any, by OFFSET.
+ (when org-element--cache-sync-requests
+ (cl-incf (aref (car org-element--cache-sync-requests) 3)
+ offset)))))))
+
+
+;;;; Public Functions
+
+;;;###autoload
+(defun org-element-cache-reset (&optional all)
+ "Reset cache in current buffer.
+When optional argument ALL is non-nil, reset cache in all Org
+buffers."
+ (interactive "P")
+ (dolist (buffer (if all (buffer-list) (list (current-buffer))))
+ (with-current-buffer buffer
+ (when (and org-element-use-cache (derived-mode-p 'org-mode))
+ (setq-local org-element--cache
+ (avl-tree-create #'org-element--cache-compare))
+ (setq-local org-element--cache-sync-keys
+ (make-hash-table :weakness 'key :test #'eq))
+ (setq-local org-element--cache-change-warning nil)
+ (setq-local org-element--cache-sync-requests nil)
+ (setq-local org-element--cache-sync-timer nil)
+ (add-hook 'before-change-functions
+ #'org-element--cache-before-change nil t)
+ (add-hook 'after-change-functions
+ #'org-element--cache-after-change nil t)))))
+
+;;;###autoload
+(defun org-element-cache-refresh (pos)
+ "Refresh cache at position POS."
+ (when (org-element--cache-active-p)
+ (org-element--cache-sync (current-buffer) pos)
+ (org-element--cache-submit-request pos pos 0)
+ (org-element--cache-set-timer (current-buffer))))
+
+
+
+;;; The Toolbox
+;;
+;; The first move is to implement a way to obtain the smallest element
+;; containing point. This is the job of `org-element-at-point'. It
+;; basically jumps back to the beginning of section containing point
+;; and proceed, one element after the other, with
+;; `org-element--current-element' until the container is found. Note:
+;; When using `org-element-at-point', secondary values are never
+;; parsed since the function focuses on elements, not on objects.
+;;
+;; At a deeper level, `org-element-context' lists all elements and
+;; objects containing point.
+;;
+;; `org-element-nested-p' and `org-element-swap-A-B' may be used
+;; internally by navigation and manipulation tools.
+
+
+;;;###autoload
+(defun org-element-at-point ()
+ "Determine closest element around point.
+
+Return value is a list like (TYPE PROPS) where TYPE is the type
+of the element and PROPS a plist of properties associated to the
+element.
+
+Possible types are defined in `org-element-all-elements'.
+Properties depend on element or object type, but always include
+`:begin', `:end', and `:post-blank' properties.
+
+As a special case, if point is at the very beginning of the first
+item in a list or sub-list, returned element will be that list
+instead of the item. Likewise, if point is at the beginning of
+the first row of a table, returned element will be the table
+instead of the first row.
+
+When point is at the end of the buffer, return the innermost
+element ending there."
+ (org-with-wide-buffer
+ (let ((origin (point)))
+ (end-of-line)
+ (skip-chars-backward " \r\t\n")
+ (cond
+ ;; Within blank lines at the beginning of buffer, return nil.
+ ((bobp) nil)
+ ;; Within blank lines right after a headline, return that
+ ;; headline.
+ ((org-with-limited-levels (org-at-heading-p))
+ (beginning-of-line)
+ (org-element-headline-parser (point-max) t))
+ ;; Otherwise parse until we find element containing ORIGIN.
+ (t
+ (when (org-element--cache-active-p)
+ (if (not org-element--cache) (org-element-cache-reset)
+ (org-element--cache-sync (current-buffer) origin)))
+ (org-element--parse-to origin))))))
+
+;;;###autoload
+(defun org-element-context (&optional element)
+ "Return smallest element or object around point.
+
+Return value is a list like (TYPE PROPS) where TYPE is the type
+of the element or object and PROPS a plist of properties
+associated to it.
+
+Possible types are defined in `org-element-all-elements' and
+`org-element-all-objects'. Properties depend on element or
+object type, but always include `:begin', `:end', `:parent' and
+`:post-blank'.
+
+As a special case, if point is right after an object and not at
+the beginning of any other object, return that object.
+
+Optional argument ELEMENT, when non-nil, is the closest element
+containing point, as returned by `org-element-at-point'.
+Providing it allows for quicker computation."
+ (catch 'objects-forbidden
+ (org-with-wide-buffer
+ (let* ((pos (point))
+ (element (or element (org-element-at-point)))
+ (type (org-element-type element))
+ (post (org-element-property :post-affiliated element)))
+ ;; If point is inside an element containing objects or
+ ;; a secondary string, narrow buffer to the container and
+ ;; proceed with parsing. Otherwise, return ELEMENT.
+ (cond
+ ;; At a parsed affiliated keyword, check if we're inside main
+ ;; or dual value.
+ ((and post (< pos post))
+ (beginning-of-line)
+ (let ((case-fold-search t)) (looking-at org-element--affiliated-re))
+ (cond
+ ((not (member-ignore-case (match-string 1)
+ org-element-parsed-keywords))
+ (throw 'objects-forbidden element))
+ ((< (match-end 0) pos)
+ (narrow-to-region (match-end 0) (line-end-position)))
+ ((and (match-beginning 2)
+ (>= pos (match-beginning 2))
+ (< pos (match-end 2)))
+ (narrow-to-region (match-beginning 2) (match-end 2)))
+ (t (throw 'objects-forbidden element)))
+ ;; Also change type to retrieve correct restrictions.
+ (setq type 'keyword))
+ ;; At an item, objects can only be located within tag, if any.
+ ((eq type 'item)
+ (let ((tag (org-element-property :tag element)))
+ (if (or (not tag) (/= (line-beginning-position) post))
+ (throw 'objects-forbidden element)
+ (beginning-of-line)
+ (search-forward tag (line-end-position))
+ (goto-char (match-beginning 0))
+ (if (and (>= pos (point)) (< pos (match-end 0)))
+ (narrow-to-region (point) (match-end 0))
+ (throw 'objects-forbidden element)))))
+ ;; At an headline or inlinetask, objects are in title.
+ ((memq type '(headline inlinetask))
+ (let ((case-fold-search nil))
+ (goto-char (org-element-property :begin element))
+ (looking-at org-complex-heading-regexp)
+ (let ((end (match-end 4)))
+ (if (not end) (throw 'objects-forbidden element)
+ (goto-char (match-beginning 4))
+ (when (looking-at org-comment-string)
+ (goto-char (match-end 0)))
+ (if (>= (point) end) (throw 'objects-forbidden element)
+ (narrow-to-region (point) end))))))
+ ;; At a paragraph, a table-row or a verse block, objects are
+ ;; located within their contents.
+ ((memq type '(paragraph table-row verse-block))
+ (let ((cbeg (org-element-property :contents-begin element))
+ (cend (org-element-property :contents-end element)))
+ ;; CBEG is nil for table rules.
+ (if (and cbeg cend (>= pos cbeg)
+ (or (< pos cend) (and (= pos cend) (eobp))))
+ (narrow-to-region cbeg cend)
+ (throw 'objects-forbidden element))))
+ (t (throw 'objects-forbidden element)))
+ (goto-char (point-min))
+ (let ((restriction (org-element-restriction type))
+ (parent element)
+ last)
+ (catch 'exit
+ (while t
+ (let ((next (org-element--object-lex restriction)))
+ (when next (org-element-put-property next :parent parent))
+ ;; Process NEXT, if any, in order to know if we need to
+ ;; skip it, return it or move into it.
+ (if (or (not next) (> (org-element-property :begin next) pos))
+ (throw 'exit (or last parent))
+ (let ((end (org-element-property :end next))
+ (cbeg (org-element-property :contents-begin next))
+ (cend (org-element-property :contents-end next)))
+ (cond
+ ;; Skip objects ending before point. Also skip
+ ;; objects ending at point unless it is also the
+ ;; end of buffer, since we want to return the
+ ;; innermost object.
+ ((and (<= end pos) (/= (point-max) end))
+ (goto-char end)
+ ;; For convenience, when object ends at POS,
+ ;; without any space, store it in LAST, as we
+ ;; will return it if no object starts here.
+ (when (and (= end pos)
+ (not (memq (char-before) '(?\s ?\t))))
+ (setq last next)))
+ ;; If POS is within a container object, move into
+ ;; that object.
+ ((and cbeg cend
+ (>= pos cbeg)
+ (or (< pos cend)
+ ;; At contents' end, if there is no
+ ;; space before point, also move into
+ ;; object, for consistency with
+ ;; convenience feature above.
+ (and (= pos cend)
+ (or (= (point-max) pos)
+ (not (memq (char-before pos)
+ '(?\s ?\t)))))))
+ (goto-char cbeg)
+ (narrow-to-region (point) cend)
+ (setq parent next)
+ (setq restriction (org-element-restriction next)))
+ ;; Otherwise, return NEXT.
+ (t (throw 'exit next)))))))))))))
+
+(defun org-element-lineage (datum &optional types with-self)
+ "List all ancestors of a given element or object.
+
+DATUM is an object or element.
+
+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
+DATUM itself as the first element, and TYPES, if provided, also
+apply to it.
+
+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 DATUM belongs to a full
+parse tree."
+ (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))
+ (setq up (org-element-property :parent up)))
+ (if types up (nreverse ancestors))))
+
+(defun org-element-nested-p (elem-A elem-B)
+ "Non-nil when elements ELEM-A and ELEM-B are nested."
+ (let ((beg-A (org-element-property :begin elem-A))
+ (beg-B (org-element-property :begin elem-B))
+ (end-A (org-element-property :end elem-A))
+ (end-B (org-element-property :end elem-B)))
+ (or (and (>= beg-A beg-B) (<= end-A end-B))
+ (and (>= beg-B beg-A) (<= end-B end-A)))))
+
+(defun org-element-swap-A-B (elem-A elem-B)
+ "Swap elements ELEM-A and ELEM-B.
+Assume ELEM-B is after ELEM-A in the buffer. Leave point at the
+end of ELEM-A."
+ (goto-char (org-element-property :begin elem-A))
+ ;; There are two special cases when an element doesn't start at bol:
+ ;; the first paragraph in an item or in a footnote definition.
+ (let ((specialp (not (bolp))))
+ ;; Only a paragraph without any affiliated keyword can be moved at
+ ;; 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.
+ (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))
+ (current-indentation)))
+ (beg-A (org-element-property :begin elem-A))
+ (end-A (save-excursion
+ (goto-char (org-element-property :end elem-A))
+ (skip-chars-backward " \r\t\n")
+ (point-at-eol)))
+ (beg-B (org-element-property :begin elem-B))
+ (end-B (save-excursion
+ (goto-char (org-element-property :end elem-B))
+ (skip-chars-backward " \r\t\n")
+ (point-at-eol)))
+ ;; Store inner overlays responsible for visibility status.
+ ;; We also need to store their boundaries as they will be
+ ;; removed from buffer.
+ (overlays
+ (cons
+ (delq nil
+ (mapcar (lambda (o)
+ (and (>= (overlay-start o) beg-A)
+ (<= (overlay-end o) end-A)
+ (list o (overlay-start o) (overlay-end o))))
+ (overlays-in beg-A end-A)))
+ (delq nil
+ (mapcar (lambda (o)
+ (and (>= (overlay-start o) beg-B)
+ (<= (overlay-end o) end-B)
+ (list o (overlay-start o) (overlay-end o))))
+ (overlays-in beg-B end-B)))))
+ ;; Get contents.
+ (body-A (buffer-substring beg-A end-A))
+ (body-B (delete-and-extract-region beg-B end-B)))
+ (goto-char beg-B)
+ (when specialp
+ (setq body-B (replace-regexp-in-string "\\`[ \t]*" "" body-B))
+ (indent-to-column ind-B))
+ (insert body-A)
+ ;; Restore ex ELEM-A overlays.
+ (let ((offset (- beg-B beg-A)))
+ (dolist (o (car overlays))
+ (move-overlay (car o) (+ (nth 1 o) offset) (+ (nth 2 o) offset)))
+ (goto-char beg-A)
+ (delete-region beg-A end-A)
+ (insert body-B)
+ ;; Restore ex ELEM-B overlays.
+ (dolist (o (cdr overlays))
+ (move-overlay (car o) (- (nth 1 o) offset) (- (nth 2 o) offset))))
+ (goto-char (org-element-property :end elem-B)))))
+
+
+(provide 'org-element)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-element.el ends here
diff --git a/elpa/org-9.5.2/org-element.elc b/elpa/org-9.5.2/org-element.elc
new file mode 100644
index 0000000..71ad8df
--- /dev/null
+++ b/elpa/org-9.5.2/org-element.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-entities.el b/elpa/org-9.5.2/org-entities.el
new file mode 100644
index 0000000..9c5f626
--- /dev/null
+++ b/elpa/org-9.5.2/org-entities.el
@@ -0,0 +1,602 @@
+;;; org-entities.el --- Support for Special Entities -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>,
+;; Ulf Stegemann <ulf at zeitform dot de>
+;; Keywords: outlines, 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;;; Code:
+
+(declare-function org-mode "org" ())
+(declare-function org-toggle-pretty-entities "org" ())
+(declare-function org-table-align "org-table" ())
+
+(defgroup org-entities nil
+ "Options concerning entities in Org mode."
+ :tag "Org Entities"
+ :group 'org)
+
+(defun org-entities--user-safe-p (v)
+ "Non-nil if V is a safe value for `org-entities-user'."
+ (pcase v
+ (`nil t)
+ (`(,(and (pred stringp)
+ (pred (string-match-p "\\`[a-zA-Z][a-zA-Z0-9]*\\'")))
+ ,(pred stringp) ,(pred booleanp) ,(pred stringp)
+ ,(pred stringp) ,(pred stringp) ,(pred stringp))
+ t)
+ (_ nil)))
+
+(defcustom org-entities-user nil
+ "User-defined entities used in Org to produce special characters.
+Each entry in this list is a list of strings. It associates the name
+of the entity that can be inserted into an Org file as \\name with the
+appropriate replacements for the different export backends. The order
+of the fields is the following
+
+name As a string, without the leading backslash.
+LaTeX replacement In ready LaTeX, no further processing will take place.
+LaTeX mathp Either t or nil. When t this entity needs to be in
+ math mode.
+HTML replacement In ready HTML, no further processing will take place.
+ Usually this will be an &...; entity.
+ASCII replacement Plain ASCII, no extensions.
+Latin1 replacement Use the special characters available in latin1.
+utf-8 replacement Use the special characters available in utf-8.
+
+If you define new entities here that require specific LaTeX
+packages to be loaded, add these packages to `org-latex-packages-alist'."
+ :group 'org-entities
+ :version "24.1"
+ :type '(repeat
+ (list
+ (string :tag "name ")
+ (string :tag "LaTeX ")
+ (boolean :tag "Require LaTeX math?")
+ (string :tag "HTML ")
+ (string :tag "ASCII ")
+ (string :tag "Latin1")
+ (string :tag "utf-8 ")))
+ :safe #'org-entities--user-safe-p)
+
+(defconst org-entities
+ (append
+ '("* Letters"
+ "** Latin"
+ ("Agrave" "\\`{A}" nil "&Agrave;" "A" "À" "À")
+ ("agrave" "\\`{a}" nil "&agrave;" "a" "à" "à")
+ ("Aacute" "\\'{A}" nil "&Aacute;" "A" "Á" "Á")
+ ("aacute" "\\'{a}" nil "&aacute;" "a" "á" "á")
+ ("Acirc" "\\^{A}" nil "&Acirc;" "A" "Â" "Â")
+ ("acirc" "\\^{a}" nil "&acirc;" "a" "â" "â")
+ ("Amacr" "\\bar{A}" nil "&Amacr;" "A" "Ã" "Ã")
+ ("amacr" "\\bar{a}" nil "&amacr;" "a" "ã" "ã")
+ ("Atilde" "\\~{A}" nil "&Atilde;" "A" "Ã" "Ã")
+ ("atilde" "\\~{a}" nil "&atilde;" "a" "ã" "ã")
+ ("Auml" "\\\"{A}" nil "&Auml;" "Ae" "Ä" "Ä")
+ ("auml" "\\\"{a}" nil "&auml;" "ae" "ä" "ä")
+ ("Aring" "\\AA{}" nil "&Aring;" "A" "Å" "Å")
+ ("AA" "\\AA{}" nil "&Aring;" "A" "Å" "Å")
+ ("aring" "\\aa{}" nil "&aring;" "a" "å" "å")
+ ("AElig" "\\AE{}" nil "&AElig;" "AE" "Æ" "Æ")
+ ("aelig" "\\ae{}" nil "&aelig;" "ae" "æ" "æ")
+ ("Ccedil" "\\c{C}" nil "&Ccedil;" "C" "Ç" "Ç")
+ ("ccedil" "\\c{c}" nil "&ccedil;" "c" "ç" "ç")
+ ("Egrave" "\\`{E}" nil "&Egrave;" "E" "È" "È")
+ ("egrave" "\\`{e}" nil "&egrave;" "e" "è" "è")
+ ("Eacute" "\\'{E}" nil "&Eacute;" "E" "É" "É")
+ ("eacute" "\\'{e}" nil "&eacute;" "e" "é" "é")
+ ("Ecirc" "\\^{E}" nil "&Ecirc;" "E" "Ê" "Ê")
+ ("ecirc" "\\^{e}" nil "&ecirc;" "e" "ê" "ê")
+ ("Euml" "\\\"{E}" nil "&Euml;" "E" "Ë" "Ë")
+ ("euml" "\\\"{e}" nil "&euml;" "e" "ë" "ë")
+ ("Igrave" "\\`{I}" nil "&Igrave;" "I" "Ì" "Ì")
+ ("igrave" "\\`{i}" nil "&igrave;" "i" "ì" "ì")
+ ("Iacute" "\\'{I}" nil "&Iacute;" "I" "Í" "Í")
+ ("iacute" "\\'{i}" nil "&iacute;" "i" "í" "í")
+ ("Idot" "\\.{I}" nil "&idot;" "I" "İ" "İ")
+ ("inodot" "\\i" nil "&inodot;" "i" "ı" "ı")
+ ("Icirc" "\\^{I}" nil "&Icirc;" "I" "Î" "Î")
+ ("icirc" "\\^{i}" nil "&icirc;" "i" "î" "î")
+ ("Iuml" "\\\"{I}" nil "&Iuml;" "I" "Ï" "Ï")
+ ("iuml" "\\\"{i}" nil "&iuml;" "i" "ï" "ï")
+ ("Ntilde" "\\~{N}" nil "&Ntilde;" "N" "Ñ" "Ñ")
+ ("ntilde" "\\~{n}" nil "&ntilde;" "n" "ñ" "ñ")
+ ("Ograve" "\\`{O}" nil "&Ograve;" "O" "Ò" "Ò")
+ ("ograve" "\\`{o}" nil "&ograve;" "o" "ò" "ò")
+ ("Oacute" "\\'{O}" nil "&Oacute;" "O" "Ó" "Ó")
+ ("oacute" "\\'{o}" nil "&oacute;" "o" "ó" "ó")
+ ("Ocirc" "\\^{O}" nil "&Ocirc;" "O" "Ô" "Ô")
+ ("ocirc" "\\^{o}" nil "&ocirc;" "o" "ô" "ô")
+ ("Otilde" "\\~{O}" nil "&Otilde;" "O" "Õ" "Õ")
+ ("otilde" "\\~{o}" nil "&otilde;" "o" "õ" "õ")
+ ("Ouml" "\\\"{O}" nil "&Ouml;" "Oe" "Ö" "Ö")
+ ("ouml" "\\\"{o}" nil "&ouml;" "oe" "ö" "ö")
+ ("Oslash" "\\O" nil "&Oslash;" "O" "Ø" "Ø")
+ ("oslash" "\\o{}" nil "&oslash;" "o" "ø" "ø")
+ ("OElig" "\\OE{}" nil "&OElig;" "OE" "OE" "Œ")
+ ("oelig" "\\oe{}" nil "&oelig;" "oe" "oe" "œ")
+ ("Scaron" "\\v{S}" nil "&Scaron;" "S" "S" "Š")
+ ("scaron" "\\v{s}" nil "&scaron;" "s" "s" "š")
+ ("szlig" "\\ss{}" nil "&szlig;" "ss" "ß" "ß")
+ ("Ugrave" "\\`{U}" nil "&Ugrave;" "U" "Ù" "Ù")
+ ("ugrave" "\\`{u}" nil "&ugrave;" "u" "ù" "ù")
+ ("Uacute" "\\'{U}" nil "&Uacute;" "U" "Ú" "Ú")
+ ("uacute" "\\'{u}" nil "&uacute;" "u" "ú" "ú")
+ ("Ucirc" "\\^{U}" nil "&Ucirc;" "U" "Û" "Û")
+ ("ucirc" "\\^{u}" nil "&ucirc;" "u" "û" "û")
+ ("Uuml" "\\\"{U}" nil "&Uuml;" "Ue" "Ü" "Ü")
+ ("uuml" "\\\"{u}" nil "&uuml;" "ue" "ü" "ü")
+ ("Yacute" "\\'{Y}" nil "&Yacute;" "Y" "Ý" "Ý")
+ ("yacute" "\\'{y}" nil "&yacute;" "y" "ý" "ý")
+ ("Yuml" "\\\"{Y}" nil "&Yuml;" "Y" "Y" "Ÿ")
+ ("yuml" "\\\"{y}" nil "&yuml;" "y" "ÿ" "ÿ")
+
+ "** Latin (special face)"
+ ("fnof" "\\textit{f}" nil "&fnof;" "f" "f" "ƒ")
+ ("real" "\\Re" t "&real;" "R" "R" "ℜ")
+ ("image" "\\Im" t "&image;" "I" "I" "ℑ")
+ ("weierp" "\\wp" t "&weierp;" "P" "P" "℘")
+ ("ell" "\\ell" t "&ell;" "ell" "ell" "ℓ")
+ ("imath" "\\imath" t "&imath;" "[dotless i]" "dotless i" "ı")
+ ("jmath" "\\jmath" t "&jmath;" "[dotless j]" "dotless j" "ȷ")
+
+ "** Greek"
+ ("Alpha" "A" nil "&Alpha;" "Alpha" "Alpha" "Α")
+ ("alpha" "\\alpha" t "&alpha;" "alpha" "alpha" "α")
+ ("Beta" "B" nil "&Beta;" "Beta" "Beta" "Β")
+ ("beta" "\\beta" t "&beta;" "beta" "beta" "β")
+ ("Gamma" "\\Gamma" t "&Gamma;" "Gamma" "Gamma" "Γ")
+ ("gamma" "\\gamma" t "&gamma;" "gamma" "gamma" "γ")
+ ("Delta" "\\Delta" t "&Delta;" "Delta" "Delta" "Δ")
+ ("delta" "\\delta" t "&delta;" "delta" "delta" "δ")
+ ("Epsilon" "E" nil "&Epsilon;" "Epsilon" "Epsilon" "Ε")
+ ("epsilon" "\\epsilon" t "&epsilon;" "epsilon" "epsilon" "ε")
+ ("varepsilon" "\\varepsilon" t "&epsilon;" "varepsilon" "varepsilon" "ε")
+ ("Zeta" "Z" nil "&Zeta;" "Zeta" "Zeta" "Ζ")
+ ("zeta" "\\zeta" t "&zeta;" "zeta" "zeta" "ζ")
+ ("Eta" "H" nil "&Eta;" "Eta" "Eta" "Η")
+ ("eta" "\\eta" t "&eta;" "eta" "eta" "η")
+ ("Theta" "\\Theta" t "&Theta;" "Theta" "Theta" "Θ")
+ ("theta" "\\theta" t "&theta;" "theta" "theta" "θ")
+ ("thetasym" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
+ ("vartheta" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
+ ("Iota" "I" nil "&Iota;" "Iota" "Iota" "Ι")
+ ("iota" "\\iota" t "&iota;" "iota" "iota" "ι")
+ ("Kappa" "K" nil "&Kappa;" "Kappa" "Kappa" "Κ")
+ ("kappa" "\\kappa" t "&kappa;" "kappa" "kappa" "κ")
+ ("Lambda" "\\Lambda" t "&Lambda;" "Lambda" "Lambda" "Λ")
+ ("lambda" "\\lambda" t "&lambda;" "lambda" "lambda" "λ")
+ ("Mu" "M" nil "&Mu;" "Mu" "Mu" "Μ")
+ ("mu" "\\mu" t "&mu;" "mu" "mu" "μ")
+ ("nu" "\\nu" t "&nu;" "nu" "nu" "ν")
+ ("Nu" "N" nil "&Nu;" "Nu" "Nu" "Ν")
+ ("Xi" "\\Xi" t "&Xi;" "Xi" "Xi" "Ξ")
+ ("xi" "\\xi" t "&xi;" "xi" "xi" "ξ")
+ ("Omicron" "O" nil "&Omicron;" "Omicron" "Omicron" "Ο")
+ ("omicron" "\\textit{o}" nil "&omicron;" "omicron" "omicron" "ο")
+ ("Pi" "\\Pi" t "&Pi;" "Pi" "Pi" "Π")
+ ("pi" "\\pi" t "&pi;" "pi" "pi" "π")
+ ("Rho" "P" nil "&Rho;" "Rho" "Rho" "Ρ")
+ ("rho" "\\rho" t "&rho;" "rho" "rho" "ρ")
+ ("Sigma" "\\Sigma" t "&Sigma;" "Sigma" "Sigma" "Σ")
+ ("sigma" "\\sigma" t "&sigma;" "sigma" "sigma" "σ")
+ ("sigmaf" "\\varsigma" t "&sigmaf;" "sigmaf" "sigmaf" "ς")
+ ("varsigma" "\\varsigma" t "&sigmaf;" "varsigma" "varsigma" "ς")
+ ("Tau" "T" nil "&Tau;" "Tau" "Tau" "Τ")
+ ("Upsilon" "\\Upsilon" t "&Upsilon;" "Upsilon" "Upsilon" "Υ")
+ ("upsih" "\\Upsilon" t "&upsih;" "upsilon" "upsilon" "ϒ")
+ ("upsilon" "\\upsilon" t "&upsilon;" "upsilon" "upsilon" "υ")
+ ("Phi" "\\Phi" t "&Phi;" "Phi" "Phi" "Φ")
+ ("phi" "\\phi" t "&phi;" "phi" "phi" "ɸ")
+ ("varphi" "\\varphi" t "&varphi;" "varphi" "varphi" "φ")
+ ("Chi" "X" nil "&Chi;" "Chi" "Chi" "Χ")
+ ("chi" "\\chi" t "&chi;" "chi" "chi" "χ")
+ ("acutex" "\\acute x" t "&acute;x" "'x" "'x" "𝑥́")
+ ("Psi" "\\Psi" t "&Psi;" "Psi" "Psi" "Ψ")
+ ("psi" "\\psi" t "&psi;" "psi" "psi" "ψ")
+ ("tau" "\\tau" t "&tau;" "tau" "tau" "τ")
+ ("Omega" "\\Omega" t "&Omega;" "Omega" "Omega" "Ω")
+ ("omega" "\\omega" t "&omega;" "omega" "omega" "ω")
+ ("piv" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "ϖ")
+ ("varpi" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "ϖ")
+ ("partial" "\\partial" t "&part;" "[partial differential]" "[partial differential]" "∂")
+
+ "** Hebrew"
+ ("alefsym" "\\aleph" t "&alefsym;" "aleph" "aleph" "ℵ")
+ ("aleph" "\\aleph" t "&aleph;" "aleph" "aleph" "ℵ")
+ ("gimel" "\\gimel" t "&gimel;" "gimel" "gimel" "ℷ")
+ ("beth" "\\beth" t "&beth;" "beth" "beth" "ב")
+ ("dalet" "\\daleth" t "&daleth;" "dalet" "dalet" "ד")
+
+ "** Icelandic"
+ ("ETH" "\\DH{}" nil "&ETH;" "D" "Ð" "Ð")
+ ("eth" "\\dh{}" nil "&eth;" "dh" "ð" "ð")
+ ("THORN" "\\TH{}" nil "&THORN;" "TH" "Þ" "Þ")
+ ("thorn" "\\th{}" nil "&thorn;" "th" "þ" "þ")
+
+ "* Punctuation"
+ "** Dots and Marks"
+ ("dots" "\\dots{}" nil "&hellip;" "..." "..." "…")
+ ("cdots" "\\cdots{}" t "&ctdot;" "..." "..." "⋯")
+ ("hellip" "\\dots{}" nil "&hellip;" "..." "..." "…")
+ ("middot" "\\textperiodcentered{}" nil "&middot;" "." "·" "·")
+ ("iexcl" "!`" nil "&iexcl;" "!" "¡" "¡")
+ ("iquest" "?`" nil "&iquest;" "?" "¿" "¿")
+
+ "** Dash-like"
+ ("shy" "\\-" nil "&shy;" "" "" "")
+ ("ndash" "--" nil "&ndash;" "-" "-" "–")
+ ("mdash" "---" nil "&mdash;" "--" "--" "—")
+
+ "** Quotations"
+ ("quot" "\\textquotedbl{}" nil "&quot;" "\"" "\"" "\"")
+ ("acute" "\\textasciiacute{}" nil "&acute;" "'" "´" "´")
+ ("ldquo" "\\textquotedblleft{}" nil "&ldquo;" "\"" "\"" "“")
+ ("rdquo" "\\textquotedblright{}" nil "&rdquo;" "\"" "\"" "”")
+ ("bdquo" "\\quotedblbase{}" nil "&bdquo;" "\"" "\"" "„")
+ ("lsquo" "\\textquoteleft{}" nil "&lsquo;" "`" "`" "‘")
+ ("rsquo" "\\textquoteright{}" nil "&rsquo;" "'" "'" "’")
+ ("sbquo" "\\quotesinglbase{}" nil "&sbquo;" "," "," "‚")
+ ("laquo" "\\guillemotleft{}" nil "&laquo;" "<<" "«" "«")
+ ("raquo" "\\guillemotright{}" nil "&raquo;" ">>" "»" "»")
+ ("lsaquo" "\\guilsinglleft{}" nil "&lsaquo;" "<" "<" "‹")
+ ("rsaquo" "\\guilsinglright{}" nil "&rsaquo;" ">" ">" "›")
+
+ "* Other"
+ "** Misc. (often used)"
+ ("circ" "\\^{}" nil "&circ;" "^" "^" "∘")
+ ("vert" "\\vert{}" t "&vert;" "|" "|" "|")
+ ("vbar" "|" nil "|" "|" "|" "|")
+ ("brvbar" "\\textbrokenbar{}" nil "&brvbar;" "|" "¦" "¦")
+ ("S" "\\S" nil "&sect;" "paragraph" "§" "§")
+ ("sect" "\\S" nil "&sect;" "paragraph" "§" "§")
+ ("amp" "\\&" nil "&amp;" "&" "&" "&")
+ ("lt" "\\textless{}" nil "&lt;" "<" "<" "<")
+ ("gt" "\\textgreater{}" nil "&gt;" ">" ">" ">")
+ ("tilde" "\\textasciitilde{}" nil "~" "~" "~" "~")
+ ("slash" "/" nil "/" "/" "/" "/")
+ ("plus" "+" nil "+" "+" "+" "+")
+ ("under" "\\_" nil "_" "_" "_" "_")
+ ("equal" "=" nil "=" "=" "=" "=")
+ ("asciicirc" "\\textasciicircum{}" nil "^" "^" "^" "^")
+ ("dagger" "\\textdagger{}" nil "&dagger;" "[dagger]" "[dagger]" "†")
+ ("dag" "\\dag{}" nil "&dagger;" "[dagger]" "[dagger]" "†")
+ ("Dagger" "\\textdaggerdbl{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
+ ("ddag" "\\ddag{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
+
+ "** Whitespace"
+ ("nbsp" "~" nil "&nbsp;" " " "\x00A0" "\x00A0")
+ ("ensp" "\\hspace*{.5em}" nil "&ensp;" " " " " " ")
+ ("emsp" "\\hspace*{1em}" nil "&emsp;" " " " " " ")
+ ("thinsp" "\\hspace*{.2em}" nil "&thinsp;" " " " " " ")
+
+ "** Currency"
+ ("curren" "\\textcurrency{}" nil "&curren;" "curr." "¤" "¤")
+ ("cent" "\\textcent{}" nil "&cent;" "cent" "¢" "¢")
+ ("pound" "\\pounds{}" nil "&pound;" "pound" "£" "£")
+ ("yen" "\\textyen{}" nil "&yen;" "yen" "¥" "¥")
+ ("euro" "\\texteuro{}" nil "&euro;" "EUR" "EUR" "€")
+ ("EUR" "\\texteuro{}" nil "&euro;" "EUR" "EUR" "€")
+ ("dollar" "\\$" nil "$" "$" "$" "$")
+ ("USD" "\\$" nil "$" "$" "$" "$")
+
+ "** Property Marks"
+ ("copy" "\\textcopyright{}" nil "&copy;" "(c)" "©" "©")
+ ("reg" "\\textregistered{}" nil "&reg;" "(r)" "®" "®")
+ ("trade" "\\texttrademark{}" nil "&trade;" "TM" "TM" "™")
+
+ "** Science et al."
+ ("minus" "\\minus" t "&minus;" "-" "-" "−")
+ ("pm" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
+ ("plusmn" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
+ ("times" "\\texttimes{}" nil "&times;" "*" "×" "×")
+ ("frasl" "/" nil "&frasl;" "/" "/" "⁄")
+ ("colon" "\\colon" t ":" ":" ":" ":")
+ ("div" "\\textdiv{}" nil "&divide;" "/" "÷" "÷")
+ ("frac12" "\\textonehalf{}" nil "&frac12;" "1/2" "½" "½")
+ ("frac14" "\\textonequarter{}" nil "&frac14;" "1/4" "¼" "¼")
+ ("frac34" "\\textthreequarters{}" nil "&frac34;" "3/4" "¾" "¾")
+ ("permil" "\\textperthousand{}" nil "&permil;" "per thousand" "per thousand" "‰")
+ ("sup1" "\\textonesuperior{}" nil "&sup1;" "^1" "¹" "¹")
+ ("sup2" "\\texttwosuperior{}" nil "&sup2;" "^2" "²" "²")
+ ("sup3" "\\textthreesuperior{}" nil "&sup3;" "^3" "³" "³")
+ ("radic" "\\sqrt{\\,}" t "&radic;" "[square root]" "[square root]" "√")
+ ("sum" "\\sum" t "&sum;" "[sum]" "[sum]" "∑")
+ ("prod" "\\prod" t "&prod;" "[product]" "[n-ary product]" "∏")
+ ("micro" "\\textmu{}" nil "&micro;" "micro" "µ" "µ")
+ ("macr" "\\textasciimacron{}" nil "&macr;" "[macron]" "¯" "¯")
+ ("deg" "\\textdegree{}" nil "&deg;" "degree" "°" "°")
+ ("prime" "\\prime" t "&prime;" "'" "'" "′")
+ ("Prime" "\\prime{}\\prime" t "&Prime;" "''" "''" "″")
+ ("infin" "\\infty" t "&infin;" "[infinity]" "[infinity]" "∞")
+ ("infty" "\\infty" t "&infin;" "[infinity]" "[infinity]" "∞")
+ ("prop" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "∝")
+ ("propto" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "∝")
+ ("not" "\\textlnot{}" nil "&not;" "[angled dash]" "¬" "¬")
+ ("neg" "\\neg{}" t "&not;" "[angled dash]" "¬" "¬")
+ ("land" "\\land" t "&and;" "[logical and]" "[logical and]" "∧")
+ ("wedge" "\\wedge" t "&and;" "[logical and]" "[logical and]" "∧")
+ ("lor" "\\lor" t "&or;" "[logical or]" "[logical or]" "∨")
+ ("vee" "\\vee" t "&or;" "[logical or]" "[logical or]" "∨")
+ ("cap" "\\cap" t "&cap;" "[intersection]" "[intersection]" "∩")
+ ("cup" "\\cup" t "&cup;" "[union]" "[union]" "∪")
+ ("smile" "\\smile" t "&smile;" "[cup product]" "[cup product]" "⌣")
+ ("frown" "\\frown" t "&frown;" "[Cap product]" "[cap product]" "⌢")
+ ("int" "\\int" t "&int;" "[integral]" "[integral]" "∫")
+ ("therefore" "\\therefore" t "&there4;" "[therefore]" "[therefore]" "∴")
+ ("there4" "\\therefore" t "&there4;" "[therefore]" "[therefore]" "∴")
+ ("because" "\\because" t "&because;" "[because]" "[because]" "∵")
+ ("sim" "\\sim" t "&sim;" "~" "~" "∼")
+ ("cong" "\\cong" t "&cong;" "[approx. equal to]" "[approx. equal to]" "≅")
+ ("simeq" "\\simeq" t "&cong;" "[approx. equal to]" "[approx. equal to]" "≅")
+ ("asymp" "\\asymp" t "&asymp;" "[almost equal to]" "[almost equal to]" "≈")
+ ("approx" "\\approx" t "&asymp;" "[almost equal to]" "[almost equal to]" "≈")
+ ("ne" "\\ne" t "&ne;" "[not equal to]" "[not equal to]" "≠")
+ ("neq" "\\neq" t "&ne;" "[not equal to]" "[not equal to]" "≠")
+ ("equiv" "\\equiv" t "&equiv;" "[identical to]" "[identical to]" "≡")
+
+ ("triangleq" "\\triangleq" t "&triangleq;" "[defined to]" "[defined to]" "≜")
+ ("le" "\\le" t "&le;" "<=" "<=" "≤")
+ ("leq" "\\le" t "&le;" "<=" "<=" "≤")
+ ("ge" "\\ge" t "&ge;" ">=" ">=" "≥")
+ ("geq" "\\ge" t "&ge;" ">=" ">=" "≥")
+ ("lessgtr" "\\lessgtr" t "&lessgtr;" "[less than or greater than]" "[less than or greater than]" "≶")
+ ("lesseqgtr" "\\lesseqgtr" t "&lesseqgtr;" "[less than or equal or greater than or equal]" "[less than or equal or greater than or equal]" "⋚")
+ ("ll" "\\ll" t "&Lt;" "<<" "<<" "≪")
+ ("Ll" "\\lll" t "&Ll;" "<<<" "<<<" "⋘")
+ ("lll" "\\lll" t "&Ll;" "<<<" "<<<" "⋘")
+ ("gg" "\\gg" t "&Gt;" ">>" ">>" "≫")
+ ("Gg" "\\ggg" t "&Gg;" ">>>" ">>>" "⋙")
+ ("ggg" "\\ggg" t "&Gg;" ">>>" ">>>" "⋙")
+ ("prec" "\\prec" t "&pr;" "[precedes]" "[precedes]" "≺")
+ ("preceq" "\\preceq" t "&prcue;" "[precedes or equal]" "[precedes or equal]" "≼")
+ ("preccurlyeq" "\\preccurlyeq" t "&prcue;" "[precedes or equal]" "[precedes or equal]" "≼")
+ ("succ" "\\succ" t "&sc;" "[succeeds]" "[succeeds]" "≻")
+ ("succeq" "\\succeq" t "&sccue;" "[succeeds or equal]" "[succeeds or equal]" "≽")
+ ("succcurlyeq" "\\succcurlyeq" t "&sccue;" "[succeeds or equal]" "[succeeds or equal]" "≽")
+ ("sub" "\\subset" t "&sub;" "[subset of]" "[subset of]" "⊂")
+ ("subset" "\\subset" t "&sub;" "[subset of]" "[subset of]" "⊂")
+ ("sup" "\\supset" t "&sup;" "[superset of]" "[superset of]" "⊃")
+ ("supset" "\\supset" t "&sup;" "[superset of]" "[superset of]" "⊃")
+ ("nsub" "\\not\\subset" t "&nsub;" "[not a subset of]" "[not a subset of" "⊄")
+ ("sube" "\\subseteq" t "&sube;" "[subset of or equal to]" "[subset of or equal to]" "⊆")
+ ("nsup" "\\not\\supset" t "&nsup;" "[not a superset of]" "[not a superset of]" "⊅")
+ ("supe" "\\supseteq" t "&supe;" "[superset of or equal to]" "[superset of or equal to]" "⊇")
+ ("setminus" "\\setminus" t "&setminus;" "\" "\" "⧵")
+ ("forall" "\\forall" t "&forall;" "[for all]" "[for all]" "∀")
+ ("exist" "\\exists" t "&exist;" "[there exists]" "[there exists]" "∃")
+ ("exists" "\\exists" t "&exist;" "[there exists]" "[there exists]" "∃")
+ ("nexist" "\\nexists" t "&exist;" "[there does not exists]" "[there does not exists]" "∄")
+ ("nexists" "\\nexists" t "&exist;" "[there does not exists]" "[there does not exists]" "∄")
+ ("empty" "\\emptyset" t "&empty;" "[empty set]" "[empty set]" "∅")
+ ("emptyset" "\\emptyset" t "&empty;" "[empty set]" "[empty set]" "∅")
+ ("isin" "\\in" t "&isin;" "[element of]" "[element of]" "∈")
+ ("in" "\\in" t "&isin;" "[element of]" "[element of]" "∈")
+ ("notin" "\\notin" t "&notin;" "[not an element of]" "[not an element of]" "∉")
+ ("ni" "\\ni" t "&ni;" "[contains as member]" "[contains as member]" "∋")
+ ("nabla" "\\nabla" t "&nabla;" "[nabla]" "[nabla]" "∇")
+ ("ang" "\\angle" t "&ang;" "[angle]" "[angle]" "∠")
+ ("angle" "\\angle" t "&ang;" "[angle]" "[angle]" "∠")
+ ("perp" "\\perp" t "&perp;" "[up tack]" "[up tack]" "⊥")
+ ("parallel" "\\parallel" t "&parallel;" "||" "||" "∥")
+ ("sdot" "\\cdot" t "&sdot;" "[dot]" "[dot]" "⋅")
+ ("cdot" "\\cdot" t "&sdot;" "[dot]" "[dot]" "⋅")
+ ("lceil" "\\lceil" t "&lceil;" "[left ceiling]" "[left ceiling]" "⌈")
+ ("rceil" "\\rceil" t "&rceil;" "[right ceiling]" "[right ceiling]" "⌉")
+ ("lfloor" "\\lfloor" t "&lfloor;" "[left floor]" "[left floor]" "⌊")
+ ("rfloor" "\\rfloor" t "&rfloor;" "[right floor]" "[right floor]" "⌋")
+ ("lang" "\\langle" t "&lang;" "<" "<" "⟨")
+ ("rang" "\\rangle" t "&rang;" ">" ">" "⟩")
+ ("langle" "\\langle" t "&lang;" "<" "<" "⟨")
+ ("rangle" "\\rangle" t "&rang;" ">" ">" "⟩")
+ ("hbar" "\\hbar" t "&hbar;" "hbar" "hbar" "ℏ")
+ ("mho" "\\mho" t "&mho;" "mho" "mho" "℧")
+
+ "** Arrows"
+ ("larr" "\\leftarrow" t "&larr;" "<-" "<-" "←")
+ ("leftarrow" "\\leftarrow" t "&larr;" "<-" "<-" "←")
+ ("gets" "\\gets" t "&larr;" "<-" "<-" "←")
+ ("lArr" "\\Leftarrow" t "&lArr;" "<=" "<=" "⇐")
+ ("Leftarrow" "\\Leftarrow" t "&lArr;" "<=" "<=" "⇐")
+ ("uarr" "\\uparrow" t "&uarr;" "[uparrow]" "[uparrow]" "↑")
+ ("uparrow" "\\uparrow" t "&uarr;" "[uparrow]" "[uparrow]" "↑")
+ ("uArr" "\\Uparrow" t "&uArr;" "[dbluparrow]" "[dbluparrow]" "⇑")
+ ("Uparrow" "\\Uparrow" t "&uArr;" "[dbluparrow]" "[dbluparrow]" "⇑")
+ ("rarr" "\\rightarrow" t "&rarr;" "->" "->" "→")
+ ("to" "\\to" t "&rarr;" "->" "->" "→")
+ ("rightarrow" "\\rightarrow" t "&rarr;" "->" "->" "→")
+ ("rArr" "\\Rightarrow" t "&rArr;" "=>" "=>" "⇒")
+ ("Rightarrow" "\\Rightarrow" t "&rArr;" "=>" "=>" "⇒")
+ ("darr" "\\downarrow" t "&darr;" "[downarrow]" "[downarrow]" "↓")
+ ("downarrow" "\\downarrow" t "&darr;" "[downarrow]" "[downarrow]" "↓")
+ ("dArr" "\\Downarrow" t "&dArr;" "[dbldownarrow]" "[dbldownarrow]" "⇓")
+ ("Downarrow" "\\Downarrow" t "&dArr;" "[dbldownarrow]" "[dbldownarrow]" "⇓")
+ ("harr" "\\leftrightarrow" t "&harr;" "<->" "<->" "↔")
+ ("leftrightarrow" "\\leftrightarrow" t "&harr;" "<->" "<->" "↔")
+ ("hArr" "\\Leftrightarrow" t "&hArr;" "<=>" "<=>" "⇔")
+ ("Leftrightarrow" "\\Leftrightarrow" t "&hArr;" "<=>" "<=>" "⇔")
+ ("crarr" "\\hookleftarrow" t "&crarr;" "<-'" "<-'" "↵")
+ ("hookleftarrow" "\\hookleftarrow" t "&crarr;" "<-'" "<-'" "↵")
+
+ "** Function names"
+ ("arccos" "\\arccos" t "arccos" "arccos" "arccos" "arccos")
+ ("arcsin" "\\arcsin" t "arcsin" "arcsin" "arcsin" "arcsin")
+ ("arctan" "\\arctan" t "arctan" "arctan" "arctan" "arctan")
+ ("arg" "\\arg" t "arg" "arg" "arg" "arg")
+ ("cos" "\\cos" t "cos" "cos" "cos" "cos")
+ ("cosh" "\\cosh" t "cosh" "cosh" "cosh" "cosh")
+ ("cot" "\\cot" t "cot" "cot" "cot" "cot")
+ ("coth" "\\coth" t "coth" "coth" "coth" "coth")
+ ("csc" "\\csc" t "csc" "csc" "csc" "csc")
+ ("deg" "\\deg" t "&deg;" "deg" "deg" "deg")
+ ("det" "\\det" t "det" "det" "det" "det")
+ ("dim" "\\dim" t "dim" "dim" "dim" "dim")
+ ("exp" "\\exp" t "exp" "exp" "exp" "exp")
+ ("gcd" "\\gcd" t "gcd" "gcd" "gcd" "gcd")
+ ("hom" "\\hom" t "hom" "hom" "hom" "hom")
+ ("inf" "\\inf" t "inf" "inf" "inf" "inf")
+ ("ker" "\\ker" t "ker" "ker" "ker" "ker")
+ ("lg" "\\lg" t "lg" "lg" "lg" "lg")
+ ("lim" "\\lim" t "lim" "lim" "lim" "lim")
+ ("liminf" "\\liminf" t "liminf" "liminf" "liminf" "liminf")
+ ("limsup" "\\limsup" t "limsup" "limsup" "limsup" "limsup")
+ ("ln" "\\ln" t "ln" "ln" "ln" "ln")
+ ("log" "\\log" t "log" "log" "log" "log")
+ ("max" "\\max" t "max" "max" "max" "max")
+ ("min" "\\min" t "min" "min" "min" "min")
+ ("Pr" "\\Pr" t "Pr" "Pr" "Pr" "Pr")
+ ("sec" "\\sec" t "sec" "sec" "sec" "sec")
+ ("sin" "\\sin" t "sin" "sin" "sin" "sin")
+ ("sinh" "\\sinh" t "sinh" "sinh" "sinh" "sinh")
+ ("sup" "\\sup" t "&sup;" "sup" "sup" "sup")
+ ("tan" "\\tan" t "tan" "tan" "tan" "tan")
+ ("tanh" "\\tanh" t "tanh" "tanh" "tanh" "tanh")
+
+ "** Signs & Symbols"
+ ("bull" "\\textbullet{}" nil "&bull;" "*" "*" "•")
+ ("bullet" "\\textbullet{}" nil "&bull;" "*" "*" "•")
+ ("star" "\\star" t "*" "*" "*" "⋆")
+ ("lowast" "\\ast" t "&lowast;" "*" "*" "∗")
+ ("ast" "\\ast" t "&lowast;" "*" "*" "*")
+ ("odot" "\\odot" t "o" "[circled dot]" "[circled dot]" "ʘ")
+ ("oplus" "\\oplus" t "&oplus;" "[circled plus]" "[circled plus]" "⊕")
+ ("otimes" "\\otimes" t "&otimes;" "[circled times]" "[circled times]" "⊗")
+ ("check" "\\checkmark" t "&checkmark;" "[checkmark]" "[checkmark]" "✓")
+ ("checkmark" "\\checkmark" t "&check;" "[checkmark]" "[checkmark]" "✓")
+
+ "** Miscellaneous (seldom used)"
+ ("para" "\\P{}" nil "&para;" "[pilcrow]" "¶" "¶")
+ ("ordf" "\\textordfeminine{}" nil "&ordf;" "_a_" "ª" "ª")
+ ("ordm" "\\textordmasculine{}" nil "&ordm;" "_o_" "º" "º")
+ ("cedil" "\\c{}" nil "&cedil;" "[cedilla]" "¸" "¸")
+ ("oline" "\\overline{~}" t "&oline;" "[overline]" "¯" "‾")
+ ("uml" "\\textasciidieresis{}" nil "&uml;" "[diaeresis]" "¨" "¨")
+ ("zwnj" "\\/{}" nil "&zwnj;" "" "" "‌")
+ ("zwj" "" nil "&zwj;" "" "" "‍")
+ ("lrm" "" nil "&lrm;" "" "" "‎")
+ ("rlm" "" nil "&rlm;" "" "" "‏")
+
+ "** Smilies"
+ ("smiley" "\\ddot\\smile" t "&#9786;" ":-)" ":-)" "☺")
+ ("blacksmile" "\\ddot\\smile" t "&#9787;" ":-)" ":-)" "☻")
+ ("sad" "\\ddot\\frown" t "&#9785;" ":-(" ":-(" "☹")
+ ("frowny" "\\ddot\\frown" t "&#9785;" ":-(" ":-(" "☹")
+
+ "** Suits"
+ ("clubs" "\\clubsuit" t "&clubs;" "[clubs]" "[clubs]" "♣")
+ ("clubsuit" "\\clubsuit" t "&clubs;" "[clubs]" "[clubs]" "♣")
+ ("spades" "\\spadesuit" t "&spades;" "[spades]" "[spades]" "♠")
+ ("spadesuit" "\\spadesuit" t "&spades;" "[spades]" "[spades]" "♠")
+ ("hearts" "\\heartsuit" t "&hearts;" "[hearts]" "[hearts]" "♥")
+ ("heartsuit" "\\heartsuit" t "&heartsuit;" "[hearts]" "[hearts]" "♥")
+ ("diams" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "◆")
+ ("diamondsuit" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "◆")
+ ("diamond" "\\diamondsuit" t "&diamond;" "[diamond]" "[diamond]" "◆")
+ ("Diamond" "\\diamondsuit" t "&diamond;" "[diamond]" "[diamond]" "◆")
+ ("loz" "\\lozenge" t "&loz;" "[lozenge]" "[lozenge]" "⧫"))
+ ;; Add "\_ "-entity family for spaces.
+ (let (space-entities html-spaces (entity "_"))
+ (dolist (n (number-sequence 1 20) (nreverse space-entities))
+ (let ((spaces (make-string n ?\s)))
+ (push (list (setq entity (concat entity " "))
+ (format "\\hspace*{%sem}" (* n .5))
+ nil
+ (setq html-spaces (concat "&ensp;" html-spaces))
+ spaces
+ spaces
+ (make-string n ?\x2002))
+ space-entities)))))
+ "Default entities used in Org mode to produce special characters.
+For details see `org-entities-user'.")
+
+(defsubst org-entity-get (name)
+ "Get the proper association for NAME from the entity lists.
+This first checks the user list, then the built-in list."
+ (or (assoc name org-entities-user)
+ (assoc name org-entities)))
+
+;; Helpfunctions to create a table for orgmode.org/worg/org-symbols.org
+
+(defun org-entities-create-table ()
+ "Create an Org mode table with all entities."
+ (interactive)
+ (let ((pos (point)))
+ (insert "|Name|LaTeX code|LaTeX|HTML code |HTML|ASCII|Latin1|UTF-8\n|-\n")
+ (dolist (e org-entities)
+ (pcase e
+ (`(,name ,latex ,mathp ,html ,ascii ,latin ,utf8)
+ (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)
+ "|" (format "=%s=" html) "|" html
+ "|" ascii "|" latin "|" utf8
+ "|\n"))))
+ (goto-char pos)
+ (org-table-align)))
+
+(defvar org-pretty-entities) ;; declare defcustom from org
+(defun org-entities-help ()
+ "Create a Help buffer with all available entities."
+ (interactive)
+ (with-output-to-temp-buffer "*Org Entity Help*"
+ (princ "Org mode entities\n=================\n\n")
+ (let ((ll (append '("* User-defined additions (variable org-entities-user)")
+ org-entities-user
+ org-entities))
+ (lastwasstring t)
+ (head (concat
+ "\n"
+ " Symbol Org entity LaTeX code HTML code\n"
+ " -----------------------------------------------------------\n")))
+ (dolist (e ll)
+ (pcase e
+ (`(,name ,latex ,_ ,html ,_ ,_ ,utf8)
+ (when lastwasstring
+ (princ head)
+ (setq lastwasstring nil))
+ (princ (format " %-8s \\%-16s %-22s %-13s\n"
+ utf8 name latex html)))
+ ((pred stringp)
+ (princ e)
+ (princ "\n")
+ (setq lastwasstring t))))))
+ (with-current-buffer "*Org Entity Help*"
+ (org-mode)
+ (when org-pretty-entities
+ (org-toggle-pretty-entities)))
+ (select-window (get-buffer-window "*Org Entity Help*")))
+
+
+(provide 'org-entities)
+
+;; Local variables:
+;; coding: utf-8
+;; End:
+
+;;; org-entities.el ends here
diff --git a/elpa/org-9.5.2/org-entities.elc b/elpa/org-9.5.2/org-entities.elc
new file mode 100644
index 0000000..f43ecfa
--- /dev/null
+++ b/elpa/org-9.5.2/org-entities.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-faces.el b/elpa/org-9.5.2/org-faces.el
new file mode 100644
index 0000000..b151045
--- /dev/null
+++ b/elpa/org-9.5.2/org-faces.el
@@ -0,0 +1,730 @@
+;;; org-faces.el --- Face definitions -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file contains the face definitions for Org.
+
+;;; Code:
+
+(defgroup org-faces nil
+ "Faces in Org mode."
+ :tag "Org Faces"
+ :group 'org-appearance)
+
+(defface org-default '((t :inherit default))
+ "Face used for default text."
+ :group 'org-faces)
+
+(defface org-hide
+ '((default :inherit fixed-pitch)
+ (((background light)) (:foreground "white"))
+ (((background dark)) (:foreground "black")))
+ "Face used to hide leading stars in headlines.
+The foreground color of this face should be equal to the background
+color of the frame."
+ :group 'org-faces)
+
+(defface org-dispatcher-highlight
+ '((default :weight bold)
+ (((class color) (min-colors 88) (background dark))
+ :background "gray20" :foreground "gold1")
+ (((class color) (min-colors 88) (background light))
+ :background "SlateGray1" :foreground "DarkBlue")
+ (((class color) (min-colors 16) (background dark))
+ :foreground "yellow")
+ (((class color) (min-colors 16) (background light))
+ :foreground "blue")
+ (t :inverse-video t))
+ "Face for highlighted keys in the dispatcher."
+ :group 'org-faces)
+
+(defface org-level-1 '((t :inherit outline-1))
+ "Face used for level 1 headlines."
+ :group 'org-faces)
+
+(defface org-level-2 '((t :inherit outline-2))
+ "Face used for level 2 headlines."
+ :group 'org-faces)
+
+(defface org-level-3 '((t :inherit outline-3))
+ "Face used for level 3 headlines."
+ :group 'org-faces)
+
+(defface org-level-4 '((t :inherit outline-4))
+ "Face used for level 4 headlines."
+ :group 'org-faces)
+
+(defface org-level-5 '((t :inherit outline-5))
+ "Face used for level 5 headlines."
+ :group 'org-faces)
+
+(defface org-level-6 '((t :inherit outline-6))
+ "Face used for level 6 headlines."
+ :group 'org-faces)
+
+(defface org-level-7 '((t :inherit outline-7))
+ "Face used for level 7 headlines."
+ :group 'org-faces)
+
+(defface org-level-8 '((t :inherit outline-8))
+ "Face used for level 8 headlines."
+ :group 'org-faces)
+
+(defface org-special-keyword '((t :inherit font-lock-keyword-face))
+ "Face used for special keywords."
+ :group 'org-faces)
+
+(defface org-drawer ;Copied from `font-lock-function-name-face'
+ '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
+ (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
+ (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
+ (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
+ (((class color) (min-colors 8)) (:foreground "blue" :bold t))
+ (t (:bold t)))
+ "Face used for drawers."
+ :group 'org-faces)
+
+(defface org-property-value nil
+ "Face used for the value of a property."
+ :group 'org-faces)
+
+(defface org-column
+ '((((class color) (min-colors 16) (background light))
+ (:background "grey90" :weight normal :slant normal :strike-through nil
+ :underline nil))
+ (((class color) (min-colors 16) (background dark))
+ (:background "grey30" :weight normal :slant normal :strike-through nil
+ :underline nil))
+ (((class color) (min-colors 8))
+ (:background "cyan" :foreground "black"
+ :weight normal :slant normal :strike-through nil
+ :underline nil))
+ (t (:inverse-video t)))
+ "Face for column display of entry properties.
+This is actually only part of the face definition for the text in column view.
+The following faces apply, with this priority.
+
+1. The color of the reference face. This is normally the level fact that
+ is used in the outline. In agenda-mode, it will be the face of the
+ first character in the line. The color is explicitly retained to
+ make sure that the column line still looks a bit like the structure
+ line it is masking.
+
+2. The `org-column' face.
+
+3. The remaining properties of the reference face.
+
+Since column view works by putting overlays with a display property
+over individual characters in the buffer, the face of the underlining
+character (this might for example be the a TODO keyword) might still
+shine through in some properties. So when your column view looks
+funny, with \"random\" colors, weight, strike-through, try to explicitly
+set the properties in the `org-column' face. For example, set
+:underline to nil, or the :slant to `normal'."
+ :group 'org-faces)
+
+(defface org-column-title
+ '((((class color) (min-colors 16) (background light))
+ (:background "grey90" :underline t :weight bold))
+ (((class color) (min-colors 16) (background dark))
+ (:background "grey30" :underline t :weight bold))
+ (((class color) (min-colors 8))
+ (:background "cyan" :foreground "black" :underline t :weight bold))
+ (t (:inverse-video t)))
+ "Face for column display of entry properties."
+ :group 'org-faces)
+
+(defface org-agenda-column-dateline '((t :inherit org-column))
+ "Face used in agenda column view for datelines with summaries."
+ :group 'org-faces)
+
+(defface org-warning '((t :inherit font-lock-warning-face))
+ "Face for deadlines and TODO keywords."
+ :group 'org-faces)
+
+(defface org-archived '((t :inherit shadow))
+ "Face for headline with the ARCHIVE tag."
+ :group 'org-faces)
+
+(defface org-cite '((t :inherit link))
+ "Face for citations."
+ :group 'org-faces)
+
+(defface org-cite-key '((t :inherit link))
+ "Face for citation keys."
+ :group 'org-faces)
+
+(defface org-link '((t :inherit link))
+ "Face for links."
+ :group 'org-faces)
+
+(defface org-footnote
+ '((((class color) (background light)) (:foreground "Purple" :underline t))
+ (((class color) (background dark)) (:foreground "Cyan" :underline t))
+ (t (:underline t)))
+ "Face for footnotes."
+ :group 'org-faces)
+
+(defface org-ellipsis
+ '((((class color) (background light)) (:foreground "DarkGoldenrod" :underline t))
+ (((class color) (background dark)) (:foreground "LightGoldenrod" :underline t))
+ (t (:strike-through t)))
+ "Face for the ellipsis in folded text."
+ :group 'org-faces)
+
+(defface org-target
+ '((((class color) (background light)) (:underline t))
+ (((class color) (background dark)) (:underline t))
+ (t (:underline t)))
+ "Face for link targets."
+ :group 'org-faces)
+
+(defface org-date
+ '((default :inherit fixed-pitch)
+ (((class color) (background light)) (:foreground "Purple" :underline t))
+ (((class color) (background dark)) (:foreground "Cyan" :underline t))
+ (t (:underline t)))
+ "Face for date/time stamps."
+ :group 'org-faces)
+
+(defface org-date-selected
+ '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :inverse-video t))
+ (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :inverse-video t))
+ (((class color) (min-colors 8) (background light)) (:foreground "red" :inverse-video t))
+ (((class color) (min-colors 8) (background dark)) (:foreground "red" :inverse-video t))
+ (t (:inverse-video t)))
+ "Face for highlighting the calendar day when using `org-read-date'.
+Using a bold face here might cause discrepancies while displaying the
+calendar."
+ :group 'org-faces)
+
+(defface org-sexp-date
+ '((((class color) (background light)) (:foreground "Purple"))
+ (((class color) (background dark)) (:foreground "Cyan"))
+ (t (:underline t)))
+ "Face for diary-like sexp date specifications."
+ :group 'org-faces)
+
+(defface org-tag '((t (:bold t)))
+ "Default face for tags.
+Note that the variable `org-tag-faces' can be used to overrule this face for
+specific tags."
+ :group 'org-faces)
+
+(defface org-list-dt '((t (:bold t)))
+ "Default face for definition terms in lists."
+ :group 'org-faces)
+
+(defface org-todo ;Copied from `font-lock-warning-face'
+ '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :bold t))
+ (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :bold t))
+ (((class color) (min-colors 8) (background light)) (:foreground "red" :bold t))
+ (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
+ (t (:inverse-video t :bold t)))
+ "Face for TODO keywords."
+ :group 'org-faces)
+
+(defface org-done ;Copied from `font-lock-type-face'
+ '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen" :bold t))
+ (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen" :bold t))
+ (((class color) (min-colors 8)) (:foreground "green"))
+ (t (:bold t)))
+ "Face used for todo keywords that indicate DONE items."
+ :group 'org-faces)
+
+(defface org-agenda-done ;Copied from `font-lock-type-face'
+ '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen"))
+ (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen"))
+ (((class color) (min-colors 8)) (:foreground "green"))
+ (t (:bold nil)))
+ "Face used in agenda, to indicate lines switched to DONE.
+This face is used to de-emphasize items that where brightly colored in the
+agenda because they were things to do, or overdue. The DONE state itself
+is of course immediately visible, but for example a passed deadline is
+\(by default) very bright read. This face could be simply the default face
+of the frame, for example."
+ :group 'org-faces)
+
+(defface org-headline-todo ;Copied from `font-lock-string-face'
+ '((((class color) (min-colors 16) (background light)) (:foreground "Red4"))
+ (((class color) (min-colors 16) (background dark)) (:foreground "Pink2"))
+ (((class color) (min-colors 8) (background light)) (:bold t)))
+ "Face used to indicate that a headline is marked as TODO.
+This face is only used if `org-fontify-todo-headline' is set. If applies
+to the part of the headline after the TODO keyword."
+ :group 'org-faces)
+
+(defface org-headline-done ;Copied from `font-lock-string-face'
+ '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
+ (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
+ (((class color) (min-colors 8) (background light)) (:bold nil)))
+ "Face used to indicate that a headline is DONE.
+This face is only used if `org-fontify-done-headline' is set. If applies
+to the part of the headline after the DONE keyword."
+ :group 'org-faces)
+
+(defcustom org-faces-easy-properties
+ '((todo . :foreground) (tag . :foreground) (priority . :foreground))
+ "The property changes by easy faces.
+This is an alist, the keys show the area of application, the values
+can be `:foreground' or `:background'. A color string for special
+keywords will then be interpreted as either foreground or background
+color."
+ :group 'org-faces
+ :group 'org-todo
+ :version "24.1"
+ :type '(repeat
+ (cons (choice (const todo) (const tag) (const priority))
+ (choice (const :foreground) (const :background)))))
+
+(defcustom org-todo-keyword-faces nil
+ "Faces for specific TODO keywords.
+This is a list of cons cells, with TODO keywords in the car
+and faces in the cdr. The face can be a symbol, a color
+as a string (in which case the rest is inherited from the `org-todo' face),
+or a property list of attributes, like
+ (:foreground \"blue\" :weight bold :underline t).
+If it is a color string, the variable `org-faces-easy-properties'
+determines if it is a foreground or a background color."
+ :group 'org-faces
+ :group 'org-todo
+ :type '(repeat
+ (cons
+ (string :tag "Keyword")
+ (choice :tag "Face "
+ (string :tag "Color")
+ (sexp :tag "Face")))))
+
+(defface org-priority '((t :inherit font-lock-keyword-face))
+ "Face used for priority cookies."
+ :group 'org-faces)
+
+(defcustom org-priority-faces nil
+ "Faces for specific Priorities.
+This is a list of cons cells, with priority character in the car
+and faces in the cdr. The face can be a symbol, a color
+as a string, or a property list of attributes, like
+ (:foreground \"blue\" :weight bold :underline t).
+If it is a color string, the variable `org-faces-easy-properties'
+determines if it is a foreground or a background color."
+ :group 'org-faces
+ :group 'org-todo
+ :type '(repeat
+ (cons
+ (character :tag "Priority")
+ (choice :tag "Face "
+ (string :tag "Color")
+ (sexp :tag "Face")))))
+
+(defvar org-tags-special-faces-re nil)
+(defun org-set-tag-faces (var value)
+ (set var value)
+ (if (not value)
+ (setq org-tags-special-faces-re nil)
+ (setq org-tags-special-faces-re
+ (concat ":" (regexp-opt (mapcar #'car value) t) ":"))))
+
+(defface org-checkbox '((t :inherit bold))
+ "Face for checkboxes."
+ :group 'org-faces)
+
+(defface org-checkbox-statistics-todo '((t (:inherit org-todo)))
+ "Face used for unfinished checkbox statistics."
+ :group 'org-faces)
+
+(defface org-checkbox-statistics-done '((t (:inherit org-done)))
+ "Face used for finished checkbox statistics."
+ :group 'org-faces)
+
+(defcustom org-tag-faces nil
+ "Faces for specific tags.
+This is a list of cons cells, with tags in the car and faces in the cdr.
+The face can be a symbol, a foreground color (in which case the rest is
+inherited from the `org-tag' face) or a property list of attributes,
+like (:foreground \"blue\" :weight bold :underline t).
+If you set this variable through customize, it will immediately be effective
+in new buffers and in modified lines.
+If you set it with Lisp, a restart of Emacs is required to activate the
+changes."
+ :group 'org-faces
+ :group 'org-tags
+ :set 'org-set-tag-faces
+ :type '(repeat
+ (cons
+ (string :tag "Tag ")
+ (choice :tag "Face"
+ (string :tag "Foreground color")
+ (sexp :tag "Face")))))
+
+(defface org-table ;Copied from `font-lock-function-name-face'
+ '((default :inherit fixed-pitch)
+ (((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
+ (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
+ (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
+ (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
+ (((class color) (min-colors 8) (background light)) (:foreground "blue"))
+ (((class color) (min-colors 8) (background dark))))
+ "Face used for tables."
+ :group 'org-faces)
+
+(defface org-table-header '((t :inherit org-table
+ :background "LightGray"
+ :foreground "Black"))
+ "Face for table header."
+ :group 'org-faces)
+
+(defface org-formula
+ '((default :inherit fixed-pitch)
+ (((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
+ (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
+ (((class color) (min-colors 8) (background light)) (:foreground "red"))
+ (((class color) (min-colors 8) (background dark)) (:foreground "red"))
+ (t (:bold t :italic t)))
+ "Face for formulas."
+ :group 'org-faces)
+
+(defface org-code '((t :inherit (fixed-pitch shadow)))
+ "Face for fixed-width text like code snippets."
+ :group 'org-faces
+ :version "22.1")
+
+(defface org-meta-line '((t :inherit (fixed-pitch font-lock-comment-face)))
+ "Face for meta lines starting with \"#+\"."
+ :group 'org-faces
+ :version "22.1")
+
+(defface org-document-title
+ '((((class color) (background light)) (:foreground "midnight blue" :weight bold))
+ (((class color) (background dark)) (:foreground "pale turquoise" :weight bold))
+ (t (:weight bold)))
+ "Face for document title, i.e. that which follows the #+TITLE: keyword."
+ :group 'org-faces)
+
+(defface org-document-info
+ '((((class color) (background light)) (:foreground "midnight blue"))
+ (((class color) (background dark)) (:foreground "pale turquoise"))
+ (t nil))
+ "Face for document information such as the author and date.
+This applies to the text that follows a #+SUBTITLE:, #+DATE:,
+#+AUTHOR: or #+EMAIL: keyword."
+ :group 'org-faces)
+
+(defface org-document-info-keyword '((t :inherit shadow))
+ "Face for document information keywords.
+This face applies to the #+TITLE:, #+SUBTITLE:, #+AUTHOR:,
+#+EMAIL: and #+DATE: keywords."
+ :group 'org-faces)
+
+(defface org-block `((t :inherit (fixed-pitch shadow)
+ ,@(and (>= emacs-major-version 27) '(:extend t))))
+ "Face used for text inside various blocks.
+
+It is always used for source blocks. You can refine what face
+should be used depending on the source block language by setting,
+`org-src-block-faces', which takes precedence.
+
+When `org-fontify-quote-and-verse-blocks' is not nil, text inside
+verse and quote blocks are fontified using the `org-verse' and
+`org-quote' faces, which inherit from `org-block'."
+ :group 'org-faces
+ :version "26.1")
+
+(defface org-block-begin-line '((t (:inherit org-meta-line)))
+ "Face used for the line delimiting the begin of source blocks."
+ :group 'org-faces)
+
+(defface org-block-end-line '((t (:inherit org-block-begin-line)))
+ "Face used for the line delimiting the end of source blocks."
+ :group 'org-faces)
+
+(defface org-verbatim '((t (:inherit (fixed-pitch shadow))))
+ "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.
+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.
+Active when `org-fontify-quote-and-verse-blocks' is set."
+ :group 'org-faces)
+
+(defcustom org-fontify-quote-and-verse-blocks nil
+ "Non-nil means, add a special face to #+begin_quote and #+begin_verse block.
+When nil, format these as normal Org. This is the default, because the
+content of these blocks will still be treated as Org syntax."
+ :group 'org-faces
+ :version "24.1"
+ :type 'boolean)
+
+(defface org-clock-overlay ;Copied from `secondary-selection'
+ '((((class color) (min-colors 88) (background light))
+ (:background "LightGray" :foreground "black"))
+ (((class color) (min-colors 88) (background dark))
+ (:background "SkyBlue4" :foreground "white"))
+ (((class color) (min-colors 16) (background light))
+ (:background "gray" :foreground "black"))
+ (((class color) (min-colors 16) (background dark))
+ (:background "SkyBlue4" :foreground "white"))
+ (((class color) (min-colors 8))
+ (:background "cyan" :foreground "black"))
+ (t (:inverse-video t)))
+ "Basic face for displaying the secondary selection."
+ :group 'org-faces)
+
+(defface org-agenda-structure ;Copied from `font-lock-function-name-face'
+ '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
+ (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
+ (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
+ (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
+ (((class color) (min-colors 8)) (:foreground "blue" :bold t))
+ (t (:bold t)))
+ "Face used in agenda for captions and dates."
+ :group 'org-faces)
+
+(defface org-agenda-structure-secondary '((t (:inherit org-agenda-structure)))
+ "Face used for secondary information in agenda block headers."
+ :group 'org-faces)
+
+(defface org-agenda-structure-filter '((t (:inherit (org-warning org-agenda-structure))))
+ "Face used for the current type of task filter in the agenda.
+It inherits from `org-agenda-structure' so it can adapt to
+it (e.g. if that is assigned a diffent font height or family)."
+ :group 'org-faces)
+
+(defface org-agenda-date '((t (:inherit org-agenda-structure)))
+ "Face used in agenda for normal days."
+ :group 'org-faces)
+
+(defface org-agenda-date-today
+ '((t (:inherit org-agenda-date :weight bold :italic t)))
+ "Face used in agenda for today."
+ :group 'org-faces)
+
+(defface org-agenda-date-weekend-today '((t (:inherit org-agenda-date-today)))
+ "Face used in agenda for today during weekends."
+ :group 'org-faces)
+
+(defface org-agenda-clocking '((t (:inherit secondary-selection)))
+ "Face marking the current clock item in the agenda."
+ :group 'org-faces)
+
+(defface org-agenda-date-weekend '((t (:inherit org-agenda-date :weight bold)))
+ "Face used in agenda for weekend days.
+
+See the variable `org-agenda-weekend-days' for a definition of
+which days belong to the weekend."
+ :group 'org-faces)
+
+(defface org-scheduled
+ '((((class color) (min-colors 88) (background light)) (:foreground "DarkGreen"))
+ (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen"))
+ (((class color) (min-colors 8)) (:foreground "green"))
+ (t (:bold t :italic t)))
+ "Face for items scheduled for a certain day."
+ :group 'org-faces)
+
+(defface org-scheduled-today
+ '((((class color) (min-colors 88) (background light)) (:foreground "DarkGreen"))
+ (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen"))
+ (((class color) (min-colors 8)) (:foreground "green"))
+ (t (:bold t :italic t)))
+ "Face for items scheduled for a certain day."
+ :group 'org-faces)
+
+(defface org-agenda-dimmed-todo-face
+ '((((background light)) (:foreground "grey50"))
+ (((background dark)) (:foreground "grey50")))
+ "Face used to dim blocked tasks in the agenda."
+ :group 'org-faces)
+
+(defface org-scheduled-previously
+ '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
+ (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
+ (((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."
+ :group 'org-faces)
+
+(defface org-imminent-deadline '((t :inherit org-warning))
+ "Face for current deadlines in the agenda.
+See also `org-agenda-deadline-faces'."
+ :group 'org-faces)
+
+(defface org-upcoming-deadline
+ '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
+ (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
+ (((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.
+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-imminent-deadline)
+ (0.5 . org-upcoming-deadline)
+ (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\").
+Each car is a fraction of the head-warning time that must have passed for
+this the face in the cdr to be used for display. The numbers must be
+given in descending order. The head-warning time is normally taken
+from `org-deadline-warning-days', but can also be specified in the deadline
+timestamp itself, like this:
+
+ DEADLINE: <2007-08-13 Mon -8d>
+
+You may use d for days, w for weeks, m for months and y for years. Months
+and years will only be treated in an approximate fashion (30.4 days for a
+month and 365.24 days for a year)."
+ :group 'org-faces
+ :group 'org-agenda-daily/weekly
+ :type '(repeat
+ (cons
+ (number :tag "Fraction of head-warning time passed")
+ (sexp :tag "Face"))))
+
+(defface org-agenda-restriction-lock
+ '((((class color) (min-colors 88) (background light)) (:background "#eeeeee"))
+ (((class color) (min-colors 88) (background dark)) (:background "#1C1C1C"))
+ (((class color) (min-colors 16) (background light)) (:background "#eeeeee"))
+ (((class color) (min-colors 16) (background dark)) (:background "#1C1C1C"))
+ (((class color) (min-colors 8)) (:background "cyan" :foreground "black"))
+ (t (:inverse-video t)))
+ "Face for showing the agenda restriction lock."
+ :group 'org-faces)
+
+(defface org-agenda-filter-tags '((t :inherit mode-line))
+ "Face for tag(s) in the mode-line when filtering the agenda."
+ :group 'org-faces)
+
+(defface org-agenda-filter-category '((t :inherit mode-line))
+ "Face for categories in the mode-line when filtering the agenda."
+ :group 'org-faces)
+
+(defface org-agenda-filter-effort '((t :inherit mode-line))
+ "Face for effort in the mode-line when filtering the agenda."
+ :group 'org-faces)
+
+(defface org-agenda-filter-regexp '((t :inherit mode-line))
+ "Face for regexp(s) in the mode-line when filtering the agenda."
+ :group 'org-faces)
+
+(defface org-time-grid ;Copied from `font-lock-variable-name-face'
+ '((((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod"))
+ (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod"))
+ (((class color) (min-colors 8)) (:foreground "yellow" :weight light)))
+ "Face used for time grids."
+ :group 'org-faces)
+
+(defface org-agenda-current-time '((t (:inherit org-time-grid)))
+ "Face used to show the current time in the time grid."
+ :group 'org-faces)
+
+(defface org-agenda-diary '((t :inherit default))
+ "Face used for agenda entries that come from the Emacs diary."
+ :group 'org-faces)
+
+(defface org-agenda-calendar-event '((t :inherit default))
+ "Face used to show events and appointments in the agenda."
+ :group 'org-faces)
+
+(defface org-agenda-calendar-sexp '((t :inherit default))
+ "Face used to show events computed from a S-expression."
+ :group 'org-faces)
+
+(defconst org-level-faces
+ '(org-level-1 org-level-2 org-level-3 org-level-4
+ org-level-5 org-level-6 org-level-7 org-level-8))
+
+(defcustom org-n-level-faces (length org-level-faces)
+ "The number of different faces to be used for headlines.
+Org mode defines 8 different headline faces, so this can be at most 8.
+If it is less than 8, the level-1 face gets re-used for level N+1 etc."
+ :type 'integer
+ :group 'org-faces)
+
+(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."
+ :group 'org-appearance
+ :group 'org-faces
+ :version "24.1"
+ :type 'boolean)
+
+(defface org-latex-and-related
+ (let ((font (cond ((assq :inherit custom-face-attributes)
+ '(:inherit underline))
+ (t '(:underline t)))))
+ `((((class grayscale) (background light))
+ (:foreground "DimGray" ,@font))
+ (((class grayscale) (background dark))
+ (:foreground "LightGray" ,@font))
+ (((class color) (background light))
+ (:foreground "SaddleBrown"))
+ (((class color) (background dark))
+ (:foreground "burlywood"))
+ (t (,@font))))
+ "Face used to highlight LaTeX data, entities and sub/superscript."
+ :group 'org-faces
+ :version "24.4"
+ :package-version '(Org . "8.0"))
+
+(defface org-macro '((t :inherit org-latex-and-related))
+ "Face for macros."
+ :group 'org-faces
+ :version "24.4"
+ :package-version '(Org . "8.0"))
+
+(defface org-tag-group '((t :inherit org-tag))
+ "Face for group tags."
+ :group 'org-faces
+ :version "24.4"
+ :package-version '(Org . "8.0"))
+
+(defface org-mode-line-clock '((t (:inherit mode-line)))
+ "Face used for clock display in mode line."
+ :group 'org-faces)
+
+(defface org-mode-line-clock-overrun
+ '((t (:inherit mode-line :background "red")))
+ "Face used for clock display for overrun tasks in mode line."
+ :group 'org-faces)
+
+(provide 'org-faces)
+
+;;; org-faces.el ends here
diff --git a/elpa/org-9.5.2/org-faces.elc b/elpa/org-9.5.2/org-faces.elc
new file mode 100644
index 0000000..607a866
--- /dev/null
+++ b/elpa/org-9.5.2/org-faces.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-feed.el b/elpa/org-9.5.2/org-feed.el
new file mode 100644
index 0000000..5df3b69
--- /dev/null
+++ b/elpa/org-9.5.2/org-feed.el
@@ -0,0 +1,719 @@
+;;; org-feed.el --- Add RSS feed items to Org files -*- lexical-binding: t; -*-
+;;
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+;;
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+;;
+;; This module allows entries to be created and changed in an Org mode
+;; file triggered by items in an RSS feed. The basic functionality
+;; is geared toward simply adding new items found in a feed as
+;; outline nodes to an Org file. Using hooks, arbitrary actions can
+;; be triggered for new or changed items.
+;;
+;; Selecting feeds and target locations
+;; ------------------------------------
+;;
+;; This module is configured through a single variable, `org-feed-alist'.
+;; Here is an example, using a notes/tasks feed from reQall.com.
+;;
+;; (setq org-feed-alist
+;; '(("ReQall"
+;; "http://www.reqall.com/user/feeds/rss/a1b2c3....."
+;; "~/org/feeds.org" "ReQall Entries")
+;;
+;; With this setup, the command `M-x org-feed-update-all' will
+;; collect new entries in the feed at the given URL and create
+;; entries as subheadings under the "ReQall Entries" heading in the
+;; file "~/org/feeds.org". Each feed should normally have its own
+;; heading - however see the `:drawer' parameter.
+;;
+;; Besides these standard elements that need to be specified for each
+;; feed, keyword-value pairs can set additional options. For example,
+;; to de-select transitional entries with a title containing
+;;
+;; "reQall is typing what you said",
+;;
+;; you could use the `:filter' argument:
+;;
+;; (setq org-feed-alist
+;; '(("ReQall"
+;; "http://www.reqall.com/user/feeds/rss/a1b2c3....."
+;; "~/org/feeds.org" "ReQall Entries"
+;; :filter my-reqall-filter)))
+;;
+;; (defun my-reqall-filter (e)
+;; (if (string-match "reQall is typing what you said"
+;; (plist-get e :title))
+;; nil
+;; e))
+;;
+;; See the docstring for `org-feed-alist' for more details.
+;;
+;;
+;; Keeping track of previously added entries
+;; -----------------------------------------
+;;
+;; Since Org allows you to delete, archive, or move outline nodes,
+;; org-feed.el needs to keep track of which feed items have been handled
+;; before, so that they will not be handled again. For this, org-feed.el
+;; stores information in a special drawer, FEEDSTATUS, under the heading
+;; that received the input of the feed.
+;;
+;;
+;; Acknowledgments
+;; ---------------
+;;
+;; org-feed.el is based on ideas by Brad Bozarth who implemented a
+;; similar mechanism using shell and awk scripts.
+
+;;; Code:
+
+(require 'org)
+(require 'sha1)
+
+(declare-function url-retrieve-synchronously "url"
+ (url &optional silent inhibit-cookies timeout))
+(declare-function xml-node-children "xml" (node))
+(declare-function xml-get-children "xml" (node child-name))
+(declare-function xml-get-attribute "xml" (node attribute))
+(declare-function xml-get-attribute-or-nil "xml" (node attribute))
+(declare-function xml-substitute-special "xml" (string))
+
+(declare-function org-capture-escaped-% "org-capture" ())
+(declare-function org-capture-expand-embedded-elisp "org-capture" (&optional mark))
+(declare-function org-capture-inside-embedded-elisp-p "org-capture" ())
+
+(defgroup org-feed nil
+ "Options concerning RSS feeds as inputs for Org files."
+ :tag "Org Feed"
+ :group 'org)
+
+(defcustom org-feed-alist nil
+ "Alist specifying RSS feeds that should create inputs for Org.
+Each entry in this list specified an RSS feed tat should be queried
+to create inbox items in Org. Each entry is a list with the following items:
+
+name a custom name for this feed
+URL the Feed URL
+file the target Org file where entries should be listed, when
+ nil the target becomes the current buffer (may be an
+ indirect buffer) each time the feed update is invoked
+headline the headline under which entries should be listed
+
+Additional arguments can be given using keyword-value pairs. Many of these
+specify functions that receive one or a list of \"entries\" as their single
+argument. An entry is a property list that describes a feed item. The
+property list has properties for each field in the item, for example `:title'
+for the `<title>' field and `:pubDate' for the publication date. In addition,
+it contains the following properties:
+
+`:item-full-text' the full text in the <item> tag
+`:guid-permalink' t when the guid property is a permalink
+
+Here are the keyword-value pair allows in `org-feed-alist'.
+
+:drawer drawer-name
+ The name of the drawer for storing feed information. The default is
+ \"FEEDSTATUS\". Using different drawers for different feeds allows
+ several feeds to target the same inbox heading.
+
+:filter filter-function
+ A function to select interesting entries in the feed. It gets a single
+ entry as parameter. It should return the entry if it is relevant, or
+ nil if it is not.
+
+:template template-string
+ The default action on new items in the feed is to add them as children
+ under the headline for the feed. The template describes how the entry
+ should be formatted. If not given, it defaults to
+ `org-feed-default-template'.
+
+:formatter formatter-function
+ Instead of relying on a template, you may specify a function to format
+ the outline node to be inserted as a child. This function gets passed
+ a property list describing a single feed item, and it should return a
+ string that is a properly formatted Org outline node of level 1.
+
+:new-handler function
+ If adding new items as children to the outline is not what you want
+ to do with new items, define a handler function that is called with
+ a list of all new items in the feed, each one represented as a property
+ list. The handler should do what needs to be done, and org-feed will
+ mark all items given to this handler as \"handled\", i.e. they will not
+ be passed to this handler again in future readings of the feed.
+ When the handler is called, point will be at the feed headline.
+
+:changed-handler function
+ This function gets passed a list of all entries that have been
+ handled before, but are now still in the feed and have *changed*
+ since last handled (as evidenced by a different sha1 hash).
+ When the handler is called, point will be at the feed headline.
+
+:parse-feed function
+ This function gets passed a buffer, and should return a list
+ of entries, each being a property list containing the
+ `:guid' and `:item-full-text' keys. The default is
+ `org-feed-parse-rss-feed'; `org-feed-parse-atom-feed' is an
+ alternative.
+
+:parse-entry function
+ This function gets passed an entry as returned by the parse-feed
+ function, and should return the entry with interesting properties added.
+ The default is `org-feed-parse-rss-entry'; `org-feed-parse-atom-entry'
+ is an alternative."
+ :group 'org-feed
+ :type '(repeat
+ (list :value ("" "http://" "" "")
+ (string :tag "Name")
+ (string :tag "Feed URL")
+ (file :tag "File for inbox")
+ (string :tag "Headline for inbox")
+ (repeat :inline t
+ (choice
+ (list :inline t :tag "Filter"
+ (const :filter)
+ (symbol :tag "Filter Function"))
+ (list :inline t :tag "Template"
+ (const :template)
+ (string :tag "Template"))
+ (list :inline t :tag "Formatter"
+ (const :formatter)
+ (symbol :tag "Formatter Function"))
+ (list :inline t :tag "New items handler"
+ (const :new-handler)
+ (symbol :tag "Handler Function"))
+ (list :inline t :tag "Changed items"
+ (const :changed-handler)
+ (symbol :tag "Handler Function"))
+ (list :inline t :tag "Parse Feed"
+ (const :parse-feed)
+ (symbol :tag "Parse Feed Function"))
+ (list :inline t :tag "Parse Entry"
+ (const :parse-entry)
+ (symbol :tag "Parse Entry Function"))
+ )))))
+
+(defcustom org-feed-drawer "FEEDSTATUS"
+ "The name of the drawer for feed status information.
+Each feed may also specify its own drawer name using the `:drawer'
+parameter in `org-feed-alist'."
+ :group 'org-feed
+ :type '(string :tag "Drawer Name"))
+
+(defcustom org-feed-default-template "\n* %h\n %U\n %description\n %a\n"
+ "Template for the Org node created from RSS feed items.
+This is just the default, each feed can specify its own.
+Any fields from the feed item can be interpolated into the template with
+%name, for example %title, %description, %pubDate etc. In addition, the
+following special escapes are valid as well:
+
+%h The title, or the first line of the description
+%t The date as a stamp, either from <pubDate> (if present), or
+ the current date
+%T Date and time
+%u,%U Like %t,%T, but inactive time stamps
+%a A link, from <guid> if that is a permalink, else from <link>
+%(sexp) Evaluate elisp `(sexp)' and replace with the result, the simple
+ %-escapes above can be used as arguments, e.g. %(capitalize \\\"%h\\\")"
+ :group 'org-feed
+ :type '(string :tag "Template"))
+
+(defcustom org-feed-save-after-adding t
+ "Non-nil means save buffer after adding new feed items."
+ :group 'org-feed
+ :type 'boolean)
+
+(defcustom org-feed-retrieve-method 'url-retrieve-synchronously
+ "The method to be used to retrieve a feed URL.
+This can be `curl' or `wget' to call these external programs, or it can be
+an Emacs Lisp function that will return a buffer containing the content
+of the file pointed to by the URL."
+ :group 'org-feed
+ :type '(choice
+ (const :tag "Internally with url.el" url-retrieve-synchronously)
+ (const :tag "Externally with curl" curl)
+ (const :tag "Externally with wget" wget)
+ (function :tag "Function")))
+
+(defcustom org-feed-before-adding-hook nil
+ "Hook that is run before adding new feed items to a file.
+You might want to commit the file in its current state to version control,
+for example."
+ :group 'org-feed
+ :type 'hook)
+
+(defcustom org-feed-after-adding-hook nil
+ "Hook that is run after new items have been added to a file.
+Depending on `org-feed-save-after-adding', the buffer will already
+have been saved."
+ :group 'org-feed
+ :type 'hook)
+
+(defvar org-feed-buffer "*Org feed*"
+ "The buffer used to retrieve a feed.")
+
+;;;###autoload
+(defun org-feed-update-all ()
+ "Get inbox items from all feeds in `org-feed-alist'."
+ (interactive)
+ (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)
+ "Get inbox items from FEED.
+FEED can be a string with an association in `org-feed-alist', or
+it can be a list structured like an entry in `org-feed-alist'."
+ (interactive (list (org-completing-read "Feed name: " org-feed-alist)))
+ (if (stringp feed) (setq feed (assoc feed org-feed-alist)))
+ (unless feed
+ (error "No such feed in `org-feed-alist"))
+ (catch 'exit
+ (let ((name (car feed))
+ (url (nth 1 feed))
+ (file (or (nth 2 feed) (buffer-file-name (or (buffer-base-buffer)
+ (current-buffer)))))
+ (headline (nth 3 feed))
+ (filter (nth 1 (memq :filter feed)))
+ (formatter (nth 1 (memq :formatter feed)))
+ (new-handler (nth 1 (memq :new-handler feed)))
+ (changed-handler (nth 1 (memq :changed-handler feed)))
+ (template (or (nth 1 (memq :template feed))
+ org-feed-default-template))
+ (drawer (or (nth 1 (memq :drawer feed))
+ org-feed-drawer))
+ (parse-feed (or (nth 1 (memq :parse-feed feed))
+ 'org-feed-parse-rss-feed))
+ (parse-entry (or (nth 1 (memq :parse-entry feed))
+ 'org-feed-parse-rss-entry))
+ feed-buffer inbox-pos new-formatted
+ entries old-status status new changed guid-alist guid olds)
+ (setq feed-buffer (org-feed-get-feed url))
+ (unless (and feed-buffer (bufferp (get-buffer feed-buffer)))
+ (error "Cannot get feed %s" name))
+ (when retrieve-only
+ (throw 'exit feed-buffer))
+ (setq entries (funcall parse-feed feed-buffer))
+ (ignore-errors (kill-buffer feed-buffer))
+ (save-excursion
+ (save-window-excursion
+ (setq inbox-pos (org-feed-goto-inbox-internal file headline))
+ (setq old-status (org-feed-read-previous-status inbox-pos drawer))
+ ;; Add the "handled" status to the appropriate entries
+ (setq entries (mapcar (lambda (e)
+ (setq e
+ (plist-put e :handled
+ (nth 1 (assoc
+ (plist-get e :guid)
+ old-status)))))
+ entries))
+ ;; Find out which entries are new and which are changed
+ (dolist (e entries)
+ (if (not (plist-get e :handled))
+ (push e new)
+ (setq olds (nth 2 (assoc (plist-get e :guid) old-status)))
+ (if (and olds
+ (not (string= (sha1
+ (plist-get e :item-full-text))
+ olds)))
+ (push e changed))))
+
+ ;; Parse the relevant entries fully
+ (setq new (mapcar parse-entry new)
+ changed (mapcar parse-entry changed))
+
+ ;; Run the filter
+ (when filter
+ (setq new (delq nil (mapcar filter new))
+ changed (delq nil (mapcar filter new))))
+
+ (when (not (or new changed))
+ (message "No new items in feed %s" name)
+ (throw 'exit 0))
+
+ ;; Get alist based on guid, to look up entries
+ (setq guid-alist
+ (append
+ (mapcar (lambda (e) (list (plist-get e :guid) e)) new)
+ (mapcar (lambda (e) (list (plist-get e :guid) e)) changed)))
+
+ ;; Construct the new status
+ (setq status
+ (mapcar
+ (lambda (e)
+ (setq guid (plist-get e :guid))
+ (list guid
+ ;; things count as handled if we handle them now,
+ ;; or if they were handled previously
+ (if (assoc guid guid-alist) t (plist-get e :handled))
+ ;; A hash, to detect changes
+ (sha1 (plist-get e :item-full-text))))
+ entries))
+
+ ;; Handle new items in the feed
+ (when new
+ (if new-handler
+ (progn
+ (goto-char inbox-pos)
+ (funcall new-handler new))
+ ;; No custom handler, do the default adding
+ ;; Format the new entries into an alist with GUIDs in the car
+ (setq new-formatted
+ (mapcar
+ (lambda (e) (org-feed-format-entry e template formatter))
+ new)))
+
+ ;; Insert the new items
+ (org-feed-add-items inbox-pos new-formatted))
+
+ ;; Handle changed items in the feed
+ (when (and changed-handler changed)
+ (goto-char inbox-pos)
+ (funcall changed-handler changed))
+
+ ;; Write the new status
+ ;; We do this only now, in case something goes wrong above, so
+ ;; that would would end up with a status that does not reflect
+ ;; which items truly have been handled
+ (org-feed-write-status inbox-pos drawer status)
+
+ ;; Normalize the visibility of the inbox tree
+ (goto-char inbox-pos)
+ (org-flag-subtree t)
+ (org-show-children)
+
+ ;; Hooks and messages
+ (when org-feed-save-after-adding (save-buffer))
+ (message "Added %d new item%s from feed %s to file %s, heading %s"
+ (length new) (if (> (length new) 1) "s" "")
+ name
+ (file-name-nondirectory file) headline)
+ (run-hooks 'org-feed-after-adding-hook)
+ (length new))))))
+
+;;;###autoload
+(defun org-feed-goto-inbox (feed)
+ "Go to the inbox that captures the feed named FEED."
+ (interactive
+ (list (if (= (length org-feed-alist) 1)
+ (car org-feed-alist)
+ (org-completing-read "Feed name: " org-feed-alist))))
+ (if (stringp feed) (setq feed (assoc feed org-feed-alist)))
+ (unless feed
+ (error "No such feed in `org-feed-alist"))
+ (org-feed-goto-inbox-internal (nth 2 feed) (nth 3 feed)))
+
+;;;###autoload
+(defun org-feed-show-raw-feed (feed)
+ "Show the raw feed buffer of a feed."
+ (interactive
+ (list (if (= (length org-feed-alist) 1)
+ (car org-feed-alist)
+ (org-completing-read "Feed name: " org-feed-alist))))
+ (if (stringp feed) (setq feed (assoc feed org-feed-alist)))
+ (unless feed
+ (error "No such feed in `org-feed-alist"))
+ (pop-to-buffer-same-window
+ (org-feed-update feed 'retrieve-only))
+ (goto-char (point-min)))
+
+(defun org-feed-goto-inbox-internal (file heading)
+ "Find or create HEADING in FILE.
+Switch to that buffer, and return the position of that headline."
+ (find-file file)
+ (widen)
+ (goto-char (point-min))
+ (if (re-search-forward
+ (concat "^\\*+[ \t]+" heading "[ \t]*\\(:.*?:[ \t]*\\)?$")
+ nil t)
+ (goto-char (match-beginning 0))
+ (goto-char (point-max))
+ (insert "\n\n* " heading "\n\n")
+ (org-back-to-heading t))
+ (point))
+
+(defun org-feed-read-previous-status (pos drawer)
+ "Get the alist of old GUIDs from the entry at POS.
+This will find DRAWER and extract the alist."
+ (save-excursion
+ (goto-char pos)
+ (let ((end (save-excursion (org-end-of-subtree t t))))
+ (if (re-search-forward
+ (concat "^[ \t]*:" drawer ":[ \t]*\n\\([^\000]*?\\)\n[ \t]*:END:")
+ end t)
+ (read (match-string 1))
+ nil))))
+
+(defun org-feed-write-status (pos drawer status)
+ "Write the feed STATUS to DRAWER in entry at POS."
+ (save-excursion
+ (goto-char pos)
+ (let ((end (save-excursion (org-end-of-subtree t t))))
+ (if (re-search-forward (concat "^[ \t]*:" drawer ":[ \t]*\n")
+ end t)
+ (progn
+ (goto-char (match-end 0))
+ (delete-region (point)
+ (save-excursion
+ (and (re-search-forward "^[ \t]*:END:" nil t)
+ (match-beginning 0)))))
+ (outline-next-heading)
+ (insert " :" drawer ":\n :END:\n")
+ (beginning-of-line 0))
+ (insert (pp-to-string status)))))
+
+(defun org-feed-add-items (pos entries)
+ "Add the formatted items to the headline as POS."
+ (let (entry level)
+ (save-excursion
+ (goto-char pos)
+ (unless (looking-at org-complex-heading-regexp)
+ (error "Wrong position"))
+ (setq level (org-get-valid-level (length (match-string 1)) 1))
+ (org-end-of-subtree t t)
+ (skip-chars-backward " \t\n")
+ (beginning-of-line 2)
+ (setq pos (point))
+ (while (setq entry (pop entries))
+ (org-paste-subtree level entry 'yank))
+ (org-mark-ring-push pos))))
+
+(defun org-feed-format-entry (entry template formatter)
+ "Format ENTRY so that it can be inserted into an Org file.
+ENTRY is a property list. This function adds a `:formatted-for-org' property
+and returns the full property list.
+If that property is already present, nothing changes."
+ (require 'org-capture)
+ (if formatter (funcall formatter entry)
+ (let* ((dlines
+ (org-split-string (or (plist-get entry :description) "???")
+ "\n"))
+ (time (or (if (plist-get entry :pubDate)
+ (org-read-date t t (plist-get entry :pubDate)))
+ (current-time)))
+ (v-h (or (plist-get entry :title) (car dlines) "???"))
+ (v-t (format-time-string (org-time-stamp-format nil nil) time))
+ (v-T (format-time-string (org-time-stamp-format t nil) time))
+ (v-u (format-time-string (org-time-stamp-format nil t) time))
+ (v-U (format-time-string (org-time-stamp-format t t) time))
+ (v-a (let ((tmp (or (and (plist-get entry :guid-permalink)
+ (plist-get entry :guid))
+ (plist-get entry :link))))
+ (if tmp (format "[[%s]]\n" tmp ) ""))))
+ (with-temp-buffer
+ (insert template)
+ (goto-char (point-min))
+
+ ;; Mark %() embedded elisp for later evaluation.
+ (org-capture-expand-embedded-elisp 'mark)
+
+ ;; Simple %-escapes. `org-capture-escaped-%' may modify
+ ;; buffer and cripple match-data. Use markers instead.
+ (while (re-search-forward "%\\([a-zA-Z]+\\)" nil t)
+ (let ((key (match-string 1))
+ (beg (copy-marker (match-beginning 0)))
+ (end (copy-marker (match-end 0))))
+ (unless (org-capture-escaped-%)
+ (delete-region beg end)
+ (set-marker beg nil)
+ (set-marker end nil)
+ (let ((replacement
+ (pcase key
+ ("h" v-h)
+ ("t" v-t)
+ ("T" v-T)
+ ("u" v-u)
+ ("U" v-U)
+ ("a" v-a)
+ (name
+ (let ((v (plist-get entry (intern (concat ":" name)))))
+ (save-excursion
+ (save-match-data
+ (beginning-of-line)
+ (if (looking-at
+ (concat "^\\([ \t]*\\)%" name "[ \t]*$"))
+ (org-feed-make-indented-block
+ v (current-indentation))
+ v))))))))
+ (when replacement
+ (insert
+ ;; Escape string delimiters within embedded lisp.
+ (if (org-capture-inside-embedded-elisp-p)
+ (replace-regexp-in-string "\"" "\\\\\"" replacement)
+ replacement)))))))
+
+ ;; %() embedded elisp
+ (org-capture-expand-embedded-elisp)
+
+ (decode-coding-string
+ (buffer-string) (detect-coding-region (point-min) (point-max) t))))))
+
+(defun org-feed-make-indented-block (s n)
+ "Add indentation of N spaces to a multiline string S."
+ (if (not (string-match "\n" s))
+ s
+ (mapconcat 'identity
+ (org-split-string s "\n")
+ (concat "\n" (make-string n ?\ )))))
+
+(defun org-feed-skip-http-headers (buffer)
+ "Remove HTTP headers from BUFFER, and return it.
+Assumes headers are indeed present!"
+ (with-current-buffer buffer
+ (widen)
+ (goto-char (point-min))
+ (search-forward "\n\n")
+ (delete-region (point-min) (point))
+ buffer))
+
+(defun org-feed-get-feed (url)
+ "Get the RSS feed file at URL and return the buffer."
+ (cond
+ ((eq org-feed-retrieve-method 'url-retrieve-synchronously)
+ (org-feed-skip-http-headers (url-retrieve-synchronously url)))
+ ((eq org-feed-retrieve-method 'curl)
+ (ignore-errors (kill-buffer org-feed-buffer))
+ (call-process "curl" nil org-feed-buffer nil "--silent" url)
+ org-feed-buffer)
+ ((eq org-feed-retrieve-method 'wget)
+ (ignore-errors (kill-buffer org-feed-buffer))
+ (call-process "wget" nil org-feed-buffer nil "-q" "-O" "-" url)
+ org-feed-buffer)
+ ((functionp org-feed-retrieve-method)
+ (funcall org-feed-retrieve-method url))))
+
+(defun org-feed-parse-rss-feed (buffer)
+ "Parse BUFFER for RSS feed entries.
+Returns a list of entries, with each entry a property list,
+containing the properties `:guid' and `:item-full-text'."
+ (require 'xml)
+ (let ((case-fold-search t)
+ entries beg end item guid entry)
+ (with-current-buffer buffer
+ (widen)
+ (goto-char (point-min))
+ (while (re-search-forward "<item\\>.*?>" nil t)
+ (setq beg (point)
+ end (and (re-search-forward "</item>" nil t)
+ (match-beginning 0)))
+ (setq item (buffer-substring beg end)
+ guid (if (string-match "<guid\\>.*?>\\([^\000]*?\\)</guid>" item)
+ (xml-substitute-special (match-string-no-properties 1 item))))
+ (setq entry (list :guid guid :item-full-text item))
+ (push entry entries)
+ (widen)
+ (goto-char end))
+ (nreverse entries))))
+
+(defun org-feed-parse-rss-entry (entry)
+ "Parse the `:item-full-text' field for xml tags and create new properties."
+ (require 'xml)
+ (with-temp-buffer
+ (insert (plist-get entry :item-full-text))
+ (goto-char (point-min))
+ (while (re-search-forward "<\\([a-zA-Z]+\\>\\).*?>\\([^\000]*?\\)</\\1>"
+ nil t)
+ (setq entry (plist-put entry
+ (intern (concat ":" (match-string 1)))
+ (xml-substitute-special (match-string 2)))))
+ (goto-char (point-min))
+ (unless (re-search-forward "isPermaLink[ \t]*=[ \t]*\"false\"" nil t)
+ (setq entry (plist-put entry :guid-permalink t))))
+ entry)
+
+(defun org-feed-parse-atom-feed (buffer)
+ "Parse BUFFER for Atom feed entries.
+Returns a list of entries, with each entry a property list,
+containing the properties `:guid' and `:item-full-text'.
+
+The `:item-full-text' property actually contains the sexp
+formatted as a string, not the original XML data."
+ (require 'xml)
+ (with-current-buffer buffer
+ (widen)
+ (let ((feed (car (xml-parse-region (point-min) (point-max)))))
+ (mapcar
+ (lambda (entry)
+ (list
+ :guid (car (xml-node-children (car (xml-get-children entry 'id))))
+ :item-full-text (prin1-to-string entry)))
+ (xml-get-children feed 'entry)))))
+
+(defun org-feed-parse-atom-entry (entry)
+ "Parse the `:item-full-text' as a sexp and create new properties."
+ (let ((xml (car (read-from-string (plist-get entry :item-full-text)))))
+ ;; Get first <link href='foo'/>.
+ (setq entry (plist-put entry :link
+ (xml-get-attribute
+ (car (xml-get-children xml 'link))
+ 'href)))
+ ;; Add <title/> as :title.
+ (setq entry (plist-put entry :title
+ (xml-substitute-special
+ (car (xml-node-children
+ (car (xml-get-children xml 'title)))))))
+ (let* ((content (car (xml-get-children xml 'content)))
+ (type (xml-get-attribute-or-nil content 'type)))
+ (when content
+ (cond
+ ((string= type "text")
+ ;; We like plain text.
+ (setq entry (plist-put entry :description
+ (xml-substitute-special
+ (car (xml-node-children content))))))
+ ((string= type "html")
+ ;; TODO: convert HTML to Org markup.
+ (setq entry (plist-put entry :description
+ (xml-substitute-special
+ (car (xml-node-children content))))))
+ ((string= type "xhtml")
+ ;; TODO: convert XHTML to Org markup.
+ (setq entry (plist-put entry :description
+ (prin1-to-string
+ (xml-node-children content)))))
+ (t
+ (setq entry (plist-put entry :description
+ (format-message
+ "Unknown `%s' content." type)))))))
+ entry))
+
+(provide 'org-feed)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-feed.el ends here
diff --git a/elpa/org-9.5.2/org-feed.elc b/elpa/org-9.5.2/org-feed.elc
new file mode 100644
index 0000000..cde50ff
--- /dev/null
+++ b/elpa/org-9.5.2/org-feed.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-footnote.el b/elpa/org-9.5.2/org-footnote.el
new file mode 100644
index 0000000..fcc7579
--- /dev/null
+++ b/elpa/org-9.5.2/org-footnote.el
@@ -0,0 +1,1023 @@
+;;; org-footnote.el --- Footnote support in Org -*- lexical-binding: t; -*-
+;;
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+;;
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file contains the code dealing with footnotes in Org mode.
+
+;;; Code:
+
+;;;; Declarations
+
+(require 'cl-lib)
+(require 'org-macs)
+(require 'org-compat)
+
+(declare-function org-at-comment-p "org" ())
+(declare-function org-at-heading-p "org" (&optional ignored))
+(declare-function org-back-over-empty-lines "org" ())
+(declare-function org-end-of-meta-data "org" (&optional full))
+(declare-function org-edit-footnote-reference "org-src" ())
+(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))
+(declare-function org-element-lineage "org-element" (blob &optional types with-self))
+(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 region))
+(declare-function org-in-block-p "org" (names))
+(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 outline-next-heading "outline")
+
+(defvar electric-indent-mode)
+(defvar org-blank-before-new-entry) ; defined in org.el
+(defvar org-link-bracket-re) ; defined in org.el
+(defvar org-complex-heading-regexp) ; defined in org.el
+(defvar org-odd-levels-only) ; defined in org.el
+(defvar org-outline-regexp) ; defined in org.el
+(defvar org-outline-regexp-bol) ; defined in org.el
+
+
+;;;; Constants
+
+(defconst org-footnote-re
+ "\\[fn:\\(?:\\(?1:[-_[:word:]]+\\)?\\(:\\)\\|\\(?1:[-_[:word:]]+\\)\\]\\)"
+ "Regular expression for matching footnotes.
+Match group 1 contains footnote's label. It is nil for anonymous
+footnotes. Match group 2 is non-nil only when footnote is
+inline, i.e., it contains its own definition.")
+
+(defconst org-footnote-definition-re "^\\[fn:\\([-_[:word:]]+\\)\\]"
+ "Regular expression matching the definition of a footnote.
+Match group 1 contains definition's label.")
+
+(defconst org-footnote-forbidden-blocks '("comment" "example" "export" "src")
+ "Names of blocks where footnotes are not allowed.")
+
+
+;;;; Customization
+
+(defgroup org-footnote nil
+ "Footnotes in Org mode."
+ :tag "Org Footnote"
+ :group 'org)
+
+(defcustom org-footnote-section "Footnotes"
+ "Outline heading containing footnote definitions.
+
+This can be nil, to place footnotes locally at the end of the
+current outline node. If can also be the name of a special
+outline heading under which footnotes should be put.
+
+This variable defines the place where Org puts the definition
+automatically, i.e. when creating the footnote, and when sorting
+the notes. However, by hand you may place definitions
+*anywhere*.
+
+If this is a string, during export, all subtrees starting with
+this heading will be ignored.
+
+If you don't use the customize interface to change this variable,
+you will need to run the following command after the change:
+
+ `\\[universal-argument] \\[org-element-cache-reset]'"
+ :group 'org-footnote
+ :initialize 'custom-initialize-default
+ :set (lambda (var val)
+ (set var val)
+ (when (fboundp 'org-element-cache-reset)
+ (org-element-cache-reset 'all)))
+ :type '(choice
+ (string :tag "Collect footnotes under heading")
+ (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.
+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
+ :safe #'booleanp)
+
+(defcustom org-footnote-auto-label t
+ "Non-nil means define automatically new labels for footnotes.
+Possible values are:
+
+nil Prompt the user for each label.
+t Create unique labels of the form [fn:1], [fn:2], etc.
+confirm Like t, but let the user edit the created value.
+ The label can be removed from the minibuffer to create
+ an anonymous footnote.
+random Automatically generate a unique, random label."
+ :group 'org-footnote
+ :type '(choice
+ (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))
+ :safe #'symbolp)
+
+(defcustom org-footnote-auto-adjust nil
+ "Non-nil means automatically adjust footnotes after insert/delete.
+When this is t, after each insertion or deletion of a footnote,
+simple fn:N footnotes will be renumbered, and all footnotes will be sorted.
+If you want to have just sorting or just renumbering, set this variable
+to `sort' or `renumber'.
+
+The main values of this variable can be set with in-buffer options:
+
+#+STARTUP: fnadjust
+#+STARTUP: nofnadjust"
+ :group 'org-footnote
+ :type '(choice
+ (const :tag "No adjustment" nil)
+ (const :tag "Renumber" renumber)
+ (const :tag "Sort" sort)
+ (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.
+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
+ :safe #'booleanp)
+
+
+;;;; Predicates
+
+(defun org-footnote-in-valid-context-p ()
+ "Is point in a context where footnotes are allowed?"
+ (save-match-data
+ (not (or (org-at-comment-p)
+ (org-inside-LaTeX-fragment-p)
+ ;; Avoid literal example.
+ (org-in-verbatim-emphasis)
+ (save-excursion
+ (beginning-of-line)
+ (looking-at "[ \t]*:[ \t]+"))
+ ;; Avoid forbidden blocks.
+ (org-in-block-p org-footnote-forbidden-blocks)))))
+
+(defun org-footnote-at-reference-p ()
+ "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 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 ()
+ "Non-nil if point is within a footnote definition.
+
+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 is nil if not at a footnote definition, and
+a list with label, start, end and definition of the footnote
+otherwise."
+ (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
+
+(defun org-footnote--allow-reference-p ()
+ "Non-nil when a footnote reference can be inserted at point."
+ ;; XXX: This is similar to `org-footnote-in-valid-context-p' but
+ ;; more accurate and usually faster, except in some corner cases.
+ ;; It may replace it after doing proper benchmarks as it would be
+ ;; used in fontification.
+ (unless (bolp)
+ (let* ((context (org-element-context))
+ (type (org-element-type context)))
+ (cond
+ ;; No footnote reference in attributes.
+ ((let ((post (org-element-property :post-affiliated context)))
+ (and post (< (point) post)))
+ nil)
+ ;; Paragraphs and blank lines at top of document are fine.
+ ((memq type '(nil paragraph)))
+ ;; So are contents of verse blocks.
+ ((eq type 'verse-block)
+ (and (>= (point) (org-element-property :contents-begin context))
+ (< (point) (org-element-property :contents-end context))))
+ ;; In an headline or inlinetask, point must be either on the
+ ;; heading itself or on the blank lines below.
+ ((memq type '(headline inlinetask))
+ (or (not (org-at-heading-p))
+ (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))))))
+ ;; White spaces after an object or blank lines after an element
+ ;; are OK.
+ ((>= (point)
+ (save-excursion (goto-char (org-element-property :end context))
+ (skip-chars-backward " \r\t\n")
+ (if (eq (org-element-class context) 'object) (point)
+ (line-beginning-position 2)))))
+ ;; At the beginning of a footnote definition, right after the
+ ;; label, is OK.
+ ((eq type 'footnote-definition) (looking-at (rx space)))
+ ;; Other elements are invalid.
+ ((eq (org-element-class context) 'element) nil)
+ ;; Just before object is fine.
+ ((= (point) (org-element-property :begin context)))
+ ;; Within recursive object too, but not in a link.
+ ((eq type 'link) nil)
+ ((eq type 'table-cell)
+ ;; :contents-begin is not reliable on empty cells, so special
+ ;; case it.
+ (<= (save-excursion (skip-chars-backward " \t") (point))
+ (org-element-property :contents-end context)))
+ ((let ((cbeg (org-element-property :contents-begin context))
+ (cend (org-element-property :contents-end context)))
+ (and cbeg (>= (point) cbeg) (<= (point) cend))))))))
+
+(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. Leave point
+within the new section."
+ (when org-footnote-section
+ (goto-char (point-min))
+ (let ((regexp (format "^\\*+ +%s[ \t]*$"
+ (regexp-quote org-footnote-section))))
+ (while (re-search-forward regexp nil t)
+ (delete-region
+ (match-beginning 0)
+ (org-end-of-subtree t t))))
+ (goto-char (point-max))
+ ;; 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"))
+ (insert "* " org-footnote-section "\n")))
+
+(defun org-footnote--set-label (label)
+ "Set label of footnote at point to string LABEL.
+Assume point is at the beginning of the reference or definition
+to rename."
+ (forward-char 4)
+ (cond ((eq (char-after) ?:) (insert label))
+ ((looking-at "\\([-_[:word:]]+\\)") (replace-match label nil nil nil 1))
+ (t nil)))
+
+(defun org-footnote--collect-references (&optional anonymous)
+ "Collect all labeled footnote references in current buffer.
+
+Return an alist where associations follow the pattern
+
+ (LABEL MARKER TOP-LEVEL SIZE)
+
+with
+
+ LABEL the label of the of the definition,
+ MARKER a marker pointing to its beginning,
+ TOP-LEVEL a boolean, nil when the footnote is contained within
+ another one,
+ SIZE the length of the inline definition, in characters,
+ or nil for non-inline references.
+
+When optional ANONYMOUS is non-nil, also collect anonymous
+references. In such cases, LABEL is nil.
+
+References are sorted according to a deep-reading order."
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (let ((regexp (if anonymous org-footnote-re "\\[fn:[-_[:word:]]+[]:]"))
+ references nested)
+ (save-excursion
+ (while (re-search-forward regexp nil t)
+ ;; Ignore definitions.
+ (unless (and (eq (char-before) ?\])
+ (= (line-beginning-position) (match-beginning 0)))
+ ;; Ensure point is within the reference before parsing it.
+ (backward-char)
+ (let ((object (org-element-context)))
+ (when (eq (org-element-type object) 'footnote-reference)
+ (let* ((label (org-element-property :label object))
+ (begin (org-element-property :begin object))
+ (size
+ (and (eq (org-element-property :type object) 'inline)
+ (- (org-element-property :contents-end object)
+ (org-element-property :contents-begin object)))))
+ (let ((d (org-element-lineage object '(footnote-definition))))
+ (push (list label (copy-marker begin) (not d) size)
+ references)
+ (when d
+ ;; Nested references are stored in alist NESTED.
+ ;; Associations there follow the pattern
+ ;;
+ ;; (DEFINITION-LABEL . REFERENCES)
+ (let* ((def-label (org-element-property :label d))
+ (labels (assoc def-label nested)))
+ (if labels (push label (cdr labels))
+ (push (list def-label label) nested)))))))))))
+ ;; Sort the list of references. Nested footnotes have priority
+ ;; over top-level ones.
+ (letrec ((ordered nil)
+ (add-reference
+ (lambda (ref allow-nested)
+ (when (or allow-nested (nth 2 ref))
+ (push ref ordered)
+ (dolist (r (mapcar (lambda (l) (assoc l references))
+ (reverse
+ (cdr (assoc (nth 0 ref) nested)))))
+ (funcall add-reference r t))))))
+ (dolist (r (reverse references) (nreverse ordered))
+ (funcall add-reference r nil))))))
+
+(defun org-footnote--collect-definitions (&optional delete)
+ "Collect all footnote definitions in current buffer.
+
+Return an alist where associations follow the pattern
+
+ (LABEL . DEFINITION)
+
+with LABEL and DEFINITION being, respectively, the label and the
+definition of the footnote, as strings.
+
+When optional argument DELETE is non-nil, delete the definition
+while collecting them."
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (let (definitions seen)
+ (while (re-search-forward org-footnote-definition-re nil t)
+ (backward-char)
+ (let ((element (org-element-at-point)))
+ (let ((label (org-element-property :label element)))
+ (when (and (eq (org-element-type element) 'footnote-definition)
+ (not (member label seen)))
+ (push label seen)
+ (let* ((beg (progn
+ (goto-char (org-element-property :begin element))
+ (skip-chars-backward " \r\t\n")
+ (if (bobp) (point) (line-beginning-position 2))))
+ (end (progn
+ (goto-char (org-element-property :end element))
+ (skip-chars-backward " \r\t\n")
+ (line-beginning-position 2)))
+ (def (org-trim (buffer-substring-no-properties beg end))))
+ (push (cons label def) definitions)
+ (when delete (delete-region beg end)))))))
+ definitions)))
+
+(defun org-footnote--goto-local-insertion-point ()
+ "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-chars-backward " \t\n")
+ (unless (bobp) (forward-line))
+ (unless (bolp) (insert "\n")))
+
+
+;;;; Navigation
+
+(defun org-footnote-get-next-reference (&optional label backward limit)
+ "Return complete reference of the next footnote.
+
+If LABEL is provided, get the next reference of that footnote. If
+BACKWARD is non-nil, find previous reference instead. LIMIT is
+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."
+ (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))
+ (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.
+
+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.
+
+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)
+ (goto-char origin)
+ (throw 'exit nil))
+ ;; Beware: with non-inline footnotes point will be just after
+ ;; the closing square bracket.
+ (backward-char)
+ (cond
+ ((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-link-bracket-re))))
+ (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.
+ ((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.
+
+LOCATION, when non-nil specifies the buffer position of the
+definition.
+
+Throw an error if there is no definition or if it cannot be
+reached from current narrowed part of buffer. Return a non-nil
+value if point was successfully moved."
+ (interactive "sLabel: ")
+ (let* ((label (org-footnote-normalize-label label))
+ (def-start (or location (nth 1 (org-footnote-get-definition label)))))
+ (cond
+ ((not def-start)
+ (user-error "Cannot find definition of footnote %s" label))
+ ((or (> def-start (point-max)) (< def-start (point-min)))
+ (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)))
+ (goto-char (match-end 0))
+ (org-show-context 'link-search)
+ (when (derived-mode-p 'org-mode)
+ (message "%s" (substitute-command-keys
+ "Edit definition and go back with \
+`\\[org-mark-ring-goto]' or, if unique, with `\\[org-ctrl-c-ctrl-c]'.")))
+ t))
+
+(defun org-footnote-goto-previous-reference (label)
+ "Find the first closest (to point) reference of footnote with label LABEL."
+ (interactive "sLabel: ")
+ (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
+
+(defun org-footnote-normalize-label (label)
+ "Return LABEL without \"fn:\" prefix.
+If LABEL is the empty string or constituted of white spaces only,
+return nil instead."
+ (pcase (org-trim label)
+ ("" nil)
+ ((pred (string-prefix-p "fn:")) (substring label 3))
+ (_ label)))
+
+(defun org-footnote-get-definition (label)
+ "Return label, boundaries and definition of the footnote LABEL."
+ (let* ((label (regexp-quote (org-footnote-normalize-label label)))
+ (re (format "^\\[fn:%s\\]\\|.\\[fn:%s:" label label)))
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (catch 'found
+ (while (re-search-forward re nil t)
+ (let* ((datum (progn (backward-char) (org-element-context)))
+ (type (org-element-type datum)))
+ (when (memq type '(footnote-definition footnote-reference))
+ (throw 'found
+ (list
+ label
+ (org-element-property :begin datum)
+ (org-element-property :end datum)
+ (let ((cbeg (org-element-property :contents-begin datum)))
+ (if (not cbeg) ""
+ (replace-regexp-in-string
+ "[ \t\n]*\\'"
+ ""
+ (buffer-substring-no-properties
+ cbeg
+ (org-element-property :contents-end datum))))))))))
+ nil))))
+
+(defun org-footnote-all-labels ()
+ "List all defined footnote labels used throughout the buffer.
+This function ignores narrowing, if any."
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (let (all)
+ (while (re-search-forward org-footnote-re nil t)
+ (backward-char)
+ (let ((context (org-element-context)))
+ (when (memq (org-element-type context)
+ '(footnote-definition footnote-reference))
+ (let ((label (org-element-property :label context)))
+ (when label (cl-pushnew label all :test #'equal))))))
+ all)))
+
+(defun org-footnote-unique-label (&optional current)
+ "Return a new unique footnote label.
+
+The function returns the first numeric label currently unused.
+
+Optional argument CURRENT is the list of labels active in the
+buffer."
+ (let ((current (or current (org-footnote-all-labels))))
+ (let ((count 1))
+ (while (member (number-to-string count) current)
+ (cl-incf count))
+ (number-to-string count))))
+
+
+;;;; Adding, Deleting Footnotes
+
+(defun org-footnote-new ()
+ "Insert a new footnote.
+This command prompts for a label. If this is a label referencing an
+existing label, only insert the label. If the footnote label is empty
+or new, let the user edit the definition of the footnote."
+ (interactive)
+ (unless (org-footnote--allow-reference-p)
+ (user-error "Cannot insert a footnote here"))
+ (let* ((all (org-footnote-all-labels))
+ (label
+ (if (eq org-footnote-auto-label 'random)
+ (format "%x" (abs (random)))
+ (org-footnote-normalize-label
+ (let ((propose (org-footnote-unique-label all)))
+ (if (eq org-footnote-auto-label t) propose
+ (completing-read
+ "Label (leave empty for anonymous): "
+ (mapcar #'list all) nil nil
+ (and (eq org-footnote-auto-label 'confirm) propose))))))))
+ (cond ((not label)
+ (insert "[fn::]")
+ (backward-char 1))
+ ((member label all)
+ (insert "[fn:" label "]")
+ (message "New reference to existing note"))
+ (org-footnote-define-inline
+ (insert "[fn:" label ":]")
+ (backward-char 1)
+ (org-footnote-auto-adjust-maybe))
+ (t
+ (insert "[fn:" label "]")
+ (let ((p (org-footnote-create-definition label)))
+ ;; `org-footnote-goto-definition' needs to be called
+ ;; after `org-footnote-auto-adjust-maybe'. Otherwise
+ ;; both label and location of the definition are lost.
+ ;; On the contrary, it needs to be called before
+ ;; `org-edit-footnote-reference' so that the remote
+ ;; editing buffer can display the correct label.
+ (if (ignore-errors (org-footnote-goto-definition label p))
+ (org-footnote-auto-adjust-maybe)
+ ;; Definition was created outside current scope: edit
+ ;; it remotely.
+ (org-footnote-auto-adjust-maybe)
+ (org-edit-footnote-reference)))))))
+
+(defun org-footnote-create-definition (label)
+ "Start the definition of a footnote with label LABEL.
+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-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))
+ (org-end-of-meta-data t)
+ (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.
+Return the number of footnotes removed."
+ (save-excursion
+ (goto-char (point-min))
+ (let (ref (nref 0))
+ (while (setq ref (org-footnote-get-next-reference label))
+ (goto-char (nth 1 ref))
+ (delete-region (nth 1 ref) (nth 2 ref))
+ (cl-incf nref))
+ nref)))
+
+(defun org-footnote-delete-definitions (label)
+ "Delete every definition of the footnote LABEL.
+Return the number of footnotes removed."
+ (save-excursion
+ (goto-char (point-min))
+ (let ((def-re (format "^\\[fn:%s\\]" (regexp-quote label)))
+ (ndef 0))
+ (while (re-search-forward def-re nil t)
+ (pcase (org-footnote-at-definition-p)
+ (`(,_ ,start ,end ,_)
+ ;; Remove the footnote, and all blank lines before it.
+ (delete-region (progn
+ (goto-char start)
+ (skip-chars-backward " \r\t\n")
+ (if (bobp) (point) (line-beginning-position 2)))
+ (progn
+ (goto-char end)
+ (skip-chars-backward " \r\t\n")
+ (if (bobp) (point) (line-beginning-position 2))))
+ (cl-incf ndef))))
+ ndef)))
+
+(defun org-footnote-delete (&optional label)
+ "Delete the footnote at point.
+This will remove the definition (even multiple definitions if they exist)
+and all references of a footnote label.
+
+If LABEL is non-nil, delete that footnote instead."
+ (catch 'done
+ (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
+
+(defun org-footnote-renumber-fn:N ()
+ "Order numbered footnotes into a sequence in the document."
+ (interactive)
+ (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.
+Sort footnote definitions so they match order of footnote
+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)))
+ (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)
+ (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."
+ (when (memq org-footnote-auto-adjust '(t renumber))
+ (org-footnote-renumber-fn:N))
+ (when (memq org-footnote-auto-adjust '(t sort))
+ (let ((label (car (org-footnote-at-definition-p))))
+ (org-footnote-sort)
+ (when label
+ (goto-char (point-min))
+ (and (re-search-forward (format "^\\[fn:%s\\]" (regexp-quote label))
+ nil t)
+ (progn (insert " ")
+ (just-one-space)))))))
+
+
+;;;; End-user interface
+
+;;;###autoload
+(defun org-footnote-action (&optional special)
+ "Do the right thing for footnotes.
+
+When at a footnote reference, jump to the definition.
+
+When at a definition, jump to the references if they exist, offer
+to create them otherwise.
+
+When neither at definition or reference, create a new footnote,
+interactively if possible.
+
+With prefix arg SPECIAL, or when no footnote can be created,
+offer additional commands in a menu."
+ (interactive "P")
+ (let* ((context (and (not special) (org-element-context)))
+ (type (org-element-type context)))
+ (cond
+ ;; On white space after element, insert a new footnote.
+ ((and context
+ (> (point)
+ (save-excursion
+ (goto-char (org-element-property :end context))
+ (skip-chars-backward " \t")
+ (point))))
+ (org-footnote-new))
+ ((eq type 'footnote-reference)
+ (let ((label (org-element-property :label context)))
+ (cond
+ ;; Anonymous footnote: move point at the beginning of its
+ ;; definition.
+ ((not label)
+ (goto-char (org-element-property :contents-begin context)))
+ ;; Check if a definition exists: then move to it.
+ ((let ((p (nth 1 (org-footnote-get-definition label))))
+ (when p (org-footnote-goto-definition label p))))
+ ;; No definition exists: offer to create it.
+ ((yes-or-no-p (format "No definition for %s. Create one? " label))
+ (let ((p (org-footnote-create-definition label)))
+ (or (ignore-errors (org-footnote-goto-definition label p))
+ ;; Since definition was created outside current scope,
+ ;; edit it remotely.
+ (org-edit-footnote-reference)))))))
+ ((eq type 'footnote-definition)
+ (org-footnote-goto-previous-reference
+ (org-element-property :label context)))
+ ((or special (not (org-footnote--allow-reference-p)))
+ (message "Footnotes: [s]ort | [r]enumber fn:N | [S]=r+s | [n]ormalize | \
+\[d]elete")
+ (pcase (read-char-exclusive)
+ (?s (org-footnote-sort))
+ (?r (org-footnote-renumber-fn:N))
+ (?S (org-footnote-renumber-fn:N)
+ (org-footnote-sort))
+ (?n (org-footnote-normalize))
+ (?d (org-footnote-delete))
+ (char (error "No such footnote command %c" char))))
+ (t (org-footnote-new)))))
+
+
+(provide 'org-footnote)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-footnote.el ends here
diff --git a/elpa/org-9.5.2/org-footnote.elc b/elpa/org-9.5.2/org-footnote.elc
new file mode 100644
index 0000000..8ab5965
--- /dev/null
+++ b/elpa/org-9.5.2/org-footnote.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-goto.el b/elpa/org-9.5.2/org-goto.el
new file mode 100644
index 0000000..352bf9f
--- /dev/null
+++ b/elpa/org-9.5.2/org-goto.el
@@ -0,0 +1,291 @@
+;;; org-goto.el --- Fast navigation in an Org buffer -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'org)
+(require 'org-refile)
+
+(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)
+ (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."
+ (let ((isearch-mode-map org-goto-local-auto-isearch-map)
+ (isearch-hide-immediately nil)
+ (isearch-search-fun-function
+ (lambda () #'org-goto--local-search-headings))
+ (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*" t)
+ (error (make-indirect-buffer (current-buffer) "*org-goto*" t))))
+ (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*"))
+ (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)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-goto.el ends here
diff --git a/elpa/org-9.5.2/org-goto.elc b/elpa/org-9.5.2/org-goto.elc
new file mode 100644
index 0000000..bd12424
--- /dev/null
+++ b/elpa/org-9.5.2/org-goto.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-habit.el b/elpa/org-9.5.2/org-habit.el
new file mode 100644
index 0000000..3ce8068
--- /dev/null
+++ b/elpa/org-9.5.2/org-habit.el
@@ -0,0 +1,476 @@
+;;; org-habit.el --- The habit tracking code for Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+;; Author: John Wiegley <johnw at gnu dot org>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file contains the habit tracking code for Org mode
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'org)
+(require 'org-agenda)
+
+(defgroup org-habit nil
+ "Options concerning habit tracking in Org mode."
+ :tag "Org Habit"
+ :group 'org-progress)
+
+(defcustom org-habit-graph-column 40
+ "The absolute column at which to insert habit consistency graphs.
+Note that consistency graphs will overwrite anything else in the buffer."
+ :group 'org-habit
+ :type 'integer)
+
+(defcustom org-habit-preceding-days 21
+ "Number of days before today to appear in consistency graphs."
+ :group 'org-habit
+ :type 'integer)
+
+(defcustom org-habit-following-days 7
+ "Number of days after today to appear in consistency graphs."
+ :group 'org-habit
+ :type 'integer)
+
+(defcustom org-habit-show-habits t
+ "If non-nil, show habits in agenda buffers."
+ :group 'org-habit
+ :type 'boolean)
+
+(defcustom org-habit-show-habits-only-for-today t
+ "If non-nil, only show habits on today's agenda, and not for future days.
+Note that even when shown for future days, the graph is always
+relative to the current effective date."
+ :group 'org-habit
+ :type 'boolean)
+
+(defcustom org-habit-show-all-today nil
+ "If non-nil, will show the consistency graph of all habits on
+today's agenda, even if they are not scheduled."
+ :group 'org-habit
+ :type 'boolean)
+
+(defcustom org-habit-today-glyph ?!
+ "Glyph character used to identify today."
+ :group 'org-habit
+ :version "24.1"
+ :type 'character)
+
+(defcustom org-habit-completed-glyph ?*
+ "Glyph character used to show completed days on which a task was done."
+ :group 'org-habit
+ :version "24.1"
+ :type 'character)
+
+(defcustom org-habit-show-done-always-green nil
+ "Non-nil means DONE days will always be green in the consistency graph.
+It will be green even if it was done after the deadline."
+ :group 'org-habit
+ :type 'boolean)
+
+(defcustom org-habit-scheduled-past-days nil
+ "Value to use instead of `org-scheduled-past-days', for habits only.
+
+If nil, `org-scheduled-past-days' is used.
+
+Setting this to say 10000 is a way to make habits always show up
+as a reminder, even if you set `org-scheduled-past-days' to a
+small value because you regard scheduled items as a way of
+\"turning on\" TODO items on a particular date, rather than as a
+means of creating calendar-based reminders."
+ :group 'org-habit
+ :type '(choice integer (const nil))
+ :package-version '(Org . "9.3")
+ :safe (lambda (v) (or (integerp v) (null v))))
+
+(defface org-habit-clear-face
+ '((((background light)) (:background "#8270f9"))
+ (((background dark)) (:background "blue")))
+ "Face for days on which a task shouldn't be done yet."
+ :group 'org-habit
+ :group 'org-faces)
+(defface org-habit-clear-future-face
+ '((((background light)) (:background "#d6e4fc"))
+ (((background dark)) (:background "midnightblue")))
+ "Face for future days on which a task shouldn't be done yet."
+ :group 'org-habit
+ :group 'org-faces)
+
+(defface org-habit-ready-face
+ '((((background light)) (:background "#4df946"))
+ (((background dark)) (:background "forestgreen")))
+ "Face for days on which a task should start to be done."
+ :group 'org-habit
+ :group 'org-faces)
+(defface org-habit-ready-future-face
+ '((((background light)) (:background "#acfca9"))
+ (((background dark)) (:background "darkgreen")))
+ "Face for days on which a task should start to be done."
+ :group 'org-habit
+ :group 'org-faces)
+
+(defface org-habit-alert-face
+ '((((background light)) (:background "#f5f946"))
+ (((background dark)) (:background "gold")))
+ "Face for days on which a task is due."
+ :group 'org-habit
+ :group 'org-faces)
+(defface org-habit-alert-future-face
+ '((((background light)) (:background "#fafca9"))
+ (((background dark)) (:background "darkgoldenrod")))
+ "Face for days on which a task is due."
+ :group 'org-habit
+ :group 'org-faces)
+
+(defface org-habit-overdue-face
+ '((((background light)) (:background "#f9372d"))
+ (((background dark)) (:background "firebrick")))
+ "Face for days on which a task is overdue."
+ :group 'org-habit
+ :group 'org-faces)
+(defface org-habit-overdue-future-face
+ '((((background light)) (:background "#fc9590"))
+ (((background dark)) (:background "darkred")))
+ "Face for days on which a task is overdue."
+ :group 'org-habit
+ :group 'org-faces)
+
+(defun org-habit-duration-to-days (ts)
+ (if (string-match "\\([0-9]+\\)\\([dwmy]\\)" ts)
+ ;; lead time is specified.
+ (floor (* (string-to-number (match-string 1 ts))
+ (cdr (assoc (match-string 2 ts)
+ '(("d" . 1) ("w" . 7)
+ ("m" . 30.4) ("y" . 365.25))))))
+ (error "Invalid duration string: %s" ts)))
+
+(defun org-is-habit-p (&optional pom)
+ "Is the task at POM or point a habit?"
+ (string= "habit" (org-entry-get (or pom (point)) "STYLE")))
+
+(defun org-habit-parse-todo (&optional pom)
+ "Parse the TODO surrounding point for its habit-related data.
+Returns a list with the following elements:
+
+ 0: Scheduled date for the habit (may be in the past)
+ 1: \".+\"-style repeater for the schedule, in days
+ 2: Optional deadline (nil if not present)
+ 3: If deadline, the repeater for the deadline, otherwise nil
+ 4: A list of all the past dates this todo was mark closed
+ 5: Repeater type as a string
+
+This list represents a \"habit\" for the rest of this module."
+ (save-excursion
+ (if pom (goto-char pom))
+ (cl-assert (org-is-habit-p (point)))
+ (let* ((scheduled (org-get-scheduled-time (point)))
+ (scheduled-repeat (org-get-repeat (org-entry-get (point) "SCHEDULED")))
+ (end (org-entry-end-position))
+ (habit-entry (org-no-properties (nth 4 (org-heading-components))))
+ closed-dates deadline dr-days sr-days sr-type)
+ (if scheduled
+ (setq scheduled (time-to-days scheduled))
+ (error "Habit %s has no scheduled date" habit-entry))
+ (unless scheduled-repeat
+ (error
+ "Habit `%s' has no scheduled repeat period or has an incorrect one"
+ habit-entry))
+ (setq sr-days (org-habit-duration-to-days scheduled-repeat)
+ sr-type (progn (string-match "[\\.+]?\\+" scheduled-repeat)
+ (match-string-no-properties 0 scheduled-repeat)))
+ (unless (> sr-days 0)
+ (error "Habit %s scheduled repeat period is less than 1d" habit-entry))
+ (when (string-match "/\\([0-9]+[dwmy]\\)" scheduled-repeat)
+ (setq dr-days (org-habit-duration-to-days
+ (match-string-no-properties 1 scheduled-repeat)))
+ (if (<= dr-days sr-days)
+ (error "Habit %s deadline repeat period is less than or equal to scheduled (%s)"
+ habit-entry scheduled-repeat))
+ (setq deadline (+ scheduled (- dr-days sr-days))))
+ (org-back-to-heading t)
+ (let* ((maxdays (+ org-habit-preceding-days org-habit-following-days))
+ (reversed org-log-states-order-reversed)
+ (search (if reversed 're-search-forward 're-search-backward))
+ (limit (if reversed end (point)))
+ (count 0)
+ (re (format
+ "^[ \t]*-[ \t]+\\(?:State \"%s\".*%s%s\\)"
+ (regexp-opt org-done-keywords)
+ org-ts-regexp-inactive
+ (let ((value (cdr (assq 'done org-log-note-headings))))
+ (if (not value) ""
+ (concat "\\|"
+ (org-replace-escapes
+ (regexp-quote value)
+ `(("%d" . ,org-ts-regexp-inactive)
+ ("%D" . ,org-ts-regexp)
+ ("%s" . "\"\\S-+\"")
+ ("%S" . "\"\\S-+\"")
+ ("%t" . ,org-ts-regexp-inactive)
+ ("%T" . ,org-ts-regexp)
+ ("%u" . ".*?")
+ ("%U" . ".*?")))))))))
+ (unless reversed (goto-char end))
+ (while (and (< count maxdays) (funcall search re limit t))
+ (push (time-to-days
+ (org-time-string-to-time
+ (or (match-string-no-properties 1)
+ (match-string-no-properties 2))))
+ closed-dates)
+ (setq count (1+ count))))
+ (list scheduled sr-days deadline dr-days closed-dates sr-type))))
+
+(defsubst org-habit-scheduled (habit)
+ (nth 0 habit))
+(defsubst org-habit-scheduled-repeat (habit)
+ (nth 1 habit))
+(defsubst org-habit-deadline (habit)
+ (let ((deadline (nth 2 habit)))
+ (or deadline
+ (if (nth 3 habit)
+ (+ (org-habit-scheduled habit)
+ (1- (org-habit-scheduled-repeat habit)))
+ (org-habit-scheduled habit)))))
+(defsubst org-habit-deadline-repeat (habit)
+ (or (nth 3 habit)
+ (org-habit-scheduled-repeat habit)))
+(defsubst org-habit-done-dates (habit)
+ (nth 4 habit))
+(defsubst org-habit-repeat-type (habit)
+ (nth 5 habit))
+
+(defsubst org-habit-get-priority (habit &optional moment)
+ "Determine the relative priority of a habit.
+This must take into account not just urgency, but consistency as well."
+ (let ((pri 1000)
+ (now (if moment (time-to-days moment) (org-today)))
+ (scheduled (org-habit-scheduled habit))
+ (deadline (org-habit-deadline habit)))
+ ;; add 10 for every day past the scheduled date, and subtract for every
+ ;; day before it
+ (setq pri (+ pri (* (- now scheduled) 10)))
+ ;; add 50 if the deadline is today
+ (if (and (/= scheduled deadline)
+ (= now deadline))
+ (setq pri (+ pri 50)))
+ ;; add 100 for every day beyond the deadline date, and subtract 10 for
+ ;; every day before it
+ (let ((slip (- now (1- deadline))))
+ (if (> slip 0)
+ (setq pri (+ pri (* slip 100)))
+ (setq pri (+ pri (* slip 10)))))
+ pri))
+
+(defun org-habit-get-faces (habit &optional now-days scheduled-days donep)
+ "Return faces for HABIT relative to NOW-DAYS and SCHEDULED-DAYS.
+NOW-DAYS defaults to the current time's days-past-the-epoch if nil.
+SCHEDULED-DAYS defaults to the habit's actual scheduled days if nil.
+
+Habits are assigned colors on the following basis:
+ Blue Task is before the scheduled date.
+ Green Task is on or after scheduled date, but before the
+ end of the schedule's repeat period.
+ Yellow If the task has a deadline, then it is after schedule's
+ repeat period, but before the deadline.
+ Orange The task has reached the deadline day, or if there is
+ no deadline, the end of the schedule's repeat period.
+ Red The task has gone beyond the deadline day or the
+ schedule's repeat period."
+ (let* ((scheduled (or scheduled-days (org-habit-scheduled habit)))
+ (s-repeat (org-habit-scheduled-repeat habit))
+ (d-repeat (org-habit-deadline-repeat habit))
+ (deadline (if scheduled-days
+ (+ scheduled-days (- d-repeat s-repeat))
+ (org-habit-deadline habit)))
+ (m-days (or now-days (time-to-days nil))))
+ (cond
+ ((< m-days scheduled)
+ '(org-habit-clear-face . org-habit-clear-future-face))
+ ((< m-days deadline)
+ '(org-habit-ready-face . org-habit-ready-future-face))
+ ((= m-days deadline)
+ (if donep
+ '(org-habit-ready-face . org-habit-ready-future-face)
+ '(org-habit-alert-face . org-habit-alert-future-face)))
+ ((and org-habit-show-done-always-green donep)
+ '(org-habit-ready-face . org-habit-ready-future-face))
+ (t '(org-habit-overdue-face . org-habit-overdue-future-face)))))
+
+(defun org-habit-build-graph (habit starting current ending)
+ "Build a graph for the given HABIT, from STARTING to ENDING.
+CURRENT gives the current time between STARTING and ENDING, for
+the purpose of drawing the graph. It need not be the actual
+current time."
+ (let* ((all-done-dates (sort (org-habit-done-dates habit) #'<))
+ (done-dates all-done-dates)
+ (scheduled (org-habit-scheduled habit))
+ (s-repeat (org-habit-scheduled-repeat habit))
+ (start (time-to-days starting))
+ (now (time-to-days current))
+ (end (time-to-days ending))
+ (graph (make-string (1+ (- end start)) ?\s))
+ (index 0)
+ last-done-date)
+ (while (and done-dates (< (car done-dates) start))
+ (setq last-done-date (car done-dates)
+ done-dates (cdr done-dates)))
+ (while (< start end)
+ (let* ((in-the-past-p (< start now))
+ (todayp (= start now))
+ (donep (and done-dates (= start (car done-dates))))
+ (faces
+ (if (and in-the-past-p
+ (not last-done-date)
+ (not (< scheduled now)))
+ (if (and all-done-dates (= (car all-done-dates) start))
+ ;; This is the very first done of this habit.
+ '(org-habit-ready-face . org-habit-ready-future-face)
+ '(org-habit-clear-face . org-habit-clear-future-face))
+ (org-habit-get-faces
+ habit start
+ (and in-the-past-p
+ last-done-date
+ ;; Compute scheduled time for habit at the time
+ ;; START was current.
+ (let ((type (org-habit-repeat-type habit)))
+ (cond
+ ;; At the last done date, use current
+ ;; scheduling in all cases.
+ ((null done-dates) scheduled)
+ ((equal type ".+") (+ last-done-date s-repeat))
+ ((equal type "+")
+ ;; Since LAST-DONE-DATE, each done mark
+ ;; shifted scheduled date by S-REPEAT.
+ (- scheduled (* (length done-dates) s-repeat)))
+ (t
+ ;; Compute the scheduled time after the
+ ;; first repeat. This is the closest time
+ ;; past FIRST-DONE which can reach SCHEDULED
+ ;; by a number of S-REPEAT hops.
+ ;;
+ ;; Then, play TODO state change history from
+ ;; the beginning in order to find current
+ ;; scheduled time.
+ (let* ((first-done (car all-done-dates))
+ (s (let ((shift (mod (- scheduled first-done)
+ s-repeat)))
+ (+ (if (= shift 0) s-repeat shift)
+ first-done))))
+ (if (= first-done last-done-date) s
+ (catch :exit
+ (dolist (done (cdr all-done-dates) s)
+ ;; Each repeat shifts S by any
+ ;; number of S-REPEAT hops it takes
+ ;; to get past DONE, with a minimum
+ ;; of one hop.
+ (cl-incf s (* (1+ (/ (max (- done s) 0)
+ s-repeat))
+ s-repeat))
+ (when (= done last-done-date)
+ (throw :exit s))))))))))
+ donep)))
+ markedp face)
+ (cond
+ (donep
+ (aset graph index org-habit-completed-glyph)
+ (setq markedp t)
+ (while (and done-dates (= start (car done-dates)))
+ (setq last-done-date (car done-dates))
+ (setq done-dates (cdr done-dates))))
+ (todayp
+ (aset graph index org-habit-today-glyph)))
+ (setq face (if (or in-the-past-p todayp)
+ (car faces)
+ (cdr faces)))
+ (when (and in-the-past-p
+ (not (eq face 'org-habit-overdue-face))
+ (not markedp))
+ (setq face (cdr faces)))
+ (put-text-property index (1+ index) 'face face graph)
+ (put-text-property index (1+ index)
+ 'help-echo
+ (concat (format-time-string
+ (org-time-stamp-format)
+ (time-add starting (days-to-time (- start (time-to-days starting)))))
+ (if donep " DONE" ""))
+ graph))
+ (setq start (1+ start)
+ index (1+ index)))
+ graph))
+
+(defun org-habit-insert-consistency-graphs (&optional line)
+ "Insert consistency graph for any habitual tasks."
+ (let ((inhibit-read-only t)
+ (buffer-invisibility-spec '(org-link))
+ (moment (org-time-subtract nil
+ (* 3600 org-extend-today-until))))
+ (save-excursion
+ (goto-char (if line (point-at-bol) (point-min)))
+ (while (not (eobp))
+ (let ((habit (get-text-property (point) 'org-habit-p))
+ (invisible-prop (get-text-property (point) 'invisible)))
+ (when habit
+ (move-to-column org-habit-graph-column t)
+ (delete-char (min (+ 1 org-habit-preceding-days
+ org-habit-following-days)
+ (- (line-end-position) (point))))
+ (insert-before-markers
+ (org-habit-build-graph
+ habit
+ (time-subtract moment (days-to-time org-habit-preceding-days))
+ moment
+ (time-add moment (days-to-time org-habit-following-days))))
+ ;; Inherit invisible state of hidden entries.
+ (when invisible-prop
+ (put-text-property
+ (- (point) org-habit-graph-column) (point)
+ 'invisible invisible-prop))))
+ (forward-line)))))
+
+(defun org-habit-toggle-habits ()
+ "Toggle display of habits in an agenda buffer."
+ (interactive)
+ (org-agenda-check-type t 'agenda)
+ (setq org-habit-show-habits (not org-habit-show-habits))
+ (org-agenda-redo)
+ (org-agenda-set-mode-name)
+ (message "Habits turned %s"
+ (if org-habit-show-habits "on" "off")))
+
+(defun org-habit-toggle-display-in-agenda (arg)
+ "Toggle display of habits in agenda.
+With ARG toggle display of all vs. undone scheduled habits.
+See `org-habit-show-all-today'."
+ (interactive "P")
+ (if (not arg)
+ (org-habit-toggle-habits)
+ (org-agenda-check-type t 'agenda)
+ (setq org-habit-show-all-today (not org-habit-show-all-today))
+ (when org-habit-show-habits (org-agenda-redo))))
+
+(org-defkey org-agenda-mode-map "K" 'org-habit-toggle-display-in-agenda)
+
+(provide 'org-habit)
+
+;;; org-habit.el ends here
diff --git a/elpa/org-9.5.2/org-habit.elc b/elpa/org-9.5.2/org-habit.elc
new file mode 100644
index 0000000..c05224a
--- /dev/null
+++ b/elpa/org-9.5.2/org-habit.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-id.el b/elpa/org-9.5.2/org-id.el
new file mode 100644
index 0000000..56783d1
--- /dev/null
+++ b/elpa/org-9.5.2/org-id.el
@@ -0,0 +1,755 @@
+;;; org-id.el --- Global identifiers for Org entries -*- lexical-binding: t; -*-
+;;
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
+;;
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file implements globally unique identifiers for Org entries.
+;; Identifiers are stored in the entry as an :ID: property. Functions
+;; are provided that create and retrieve such identifiers, and that find
+;; entries based on the identifier.
+
+;; Identifiers consist of a prefix (default "Org" given by the variable
+;; `org-id-prefix') and a unique part that can be created by a number
+;; of different methods, see the variable `org-id-method'.
+;; Org has a builtin method that uses a compact encoding of the creation
+;; time of the ID, with microsecond accuracy. This virtually
+;; guarantees globally unique identifiers, even if several people are
+;; creating IDs at the same time in files that will eventually be used
+;; together.
+;;
+;; By default Org uses UUIDs as global unique identifiers.
+;;
+;; This file defines the following API:
+;;
+;; org-id-get-create
+;; Create an ID for the entry at point if it does not yet have one.
+;; Returns the ID (old or new). This function can be used
+;; interactively, with prefix argument the creation of a new ID is
+;; forced, even if there was an old one.
+;;
+;; org-id-get
+;; Get the ID property of an entry. Using appropriate arguments
+;; to the function, it can also create the ID for this entry.
+;;
+;; org-id-goto
+;; Command to go to a specific ID, this command can be used
+;; interactively.
+;;
+;; org-id-get-with-outline-path-completion
+;; Retrieve the ID of an entry, using outline path completion.
+;; This function can work for multiple files.
+;;
+;; org-id-get-with-outline-drilling
+;; Retrieve the ID of an entry, using outline path completion.
+;; This function only works for the current file.
+;;
+;; org-id-find
+;; Find the location of an entry with specific id.
+;;
+
+;;; Code:
+
+(require 'org)
+(require 'org-refile)
+(require 'ol)
+
+(declare-function message-make-fqdn "message" ())
+(declare-function org-goto-location "org-goto" (&optional _buf help))
+
+;;; Customization
+
+(defgroup org-id nil
+ "Options concerning global entry identifiers in Org mode."
+ :tag "Org ID"
+ :group 'org)
+
+(defcustom org-id-link-to-org-use-id nil
+ "Non-nil means storing a link to an Org file will use entry IDs.
+\\<org-mode-map>
+The variable can have the following values:
+
+t Create an ID if needed to make a link to the current entry.
+
+create-if-interactive
+ If `org-store-link' is called directly (interactively, as a user
+ command), do create an ID to support the link. But when doing the
+ job for capture, only use the ID if it already exists. The
+ purpose of this setting is to avoid proliferation of unwanted
+ IDs, just because you happen to be in an Org file when you
+ call `org-capture' that automatically and preemptively creates a
+ link. If you do want to get an ID link in a capture template to
+ an entry not having an ID, create it first by explicitly creating
+ a link to it, using `\\[org-store-link]' first.
+
+create-if-interactive-and-no-custom-id
+ Like create-if-interactive, but do not create an ID if there is
+ a CUSTOM_ID property defined in the entry.
+
+use-existing
+ Use existing ID, do not create one.
+
+nil Never use an ID to make a link, instead link using a text search for
+ the headline text."
+ :group 'org-link-store
+ :group 'org-id
+ :version "24.3"
+ :type '(choice
+ (const :tag "Create ID to make link" t)
+ (const :tag "Create if storing link interactively"
+ create-if-interactive)
+ (const :tag "Create if storing link interactively and no CUSTOM_ID is present"
+ create-if-interactive-and-no-custom-id)
+ (const :tag "Only use existing" use-existing)
+ (const :tag "Do not use ID to create link" nil)))
+
+(defcustom org-id-uuid-program "uuidgen"
+ "The uuidgen program."
+ :group 'org-id
+ :type 'string)
+
+(defcustom org-id-ts-format "%Y%m%dT%H%M%S.%6N"
+ "Timestamp format for IDs generated using `ts' `org-id-method'.
+The format should be suitable to pass as an argument to `format-time-string'.
+
+Defaults to ISO8601 timestamps without separators and without
+timezone, local time and precision down to 1e-6 seconds."
+ :type 'string
+ :package-version '(Org . "9.5"))
+
+(defcustom org-id-method 'uuid
+ "The method that should be used to create new IDs.
+
+An ID will consist of the optional prefix specified in `org-id-prefix',
+and a unique part created by the method this variable specifies.
+
+Allowed values are:
+
+org Org's own internal method, using an encoding of the current time to
+ microsecond accuracy, and optionally the current domain of the
+ computer. See the variable `org-id-include-domain'.
+
+uuid Create random (version 4) UUIDs. If the program defined in
+ `org-id-uuid-program' is available it is used to create the ID.
+ Otherwise an internal functions is used.
+
+ts Create ID's based on timestamps as specified in `org-id-ts-format'."
+ :group 'org-id
+ :type '(choice
+ (const :tag "Org's internal method" org)
+ (const :tag "external: uuidgen" uuid)
+ (const :tag "Timestamp with format `org-id-ts-format'" ts)))
+
+(defcustom org-id-prefix nil
+ "The prefix for IDs.
+
+This may be a string, or it can be nil to indicate that no prefix is required.
+When a string, the string should have no space characters as IDs are expected
+to have no space characters in them."
+ :group 'org-id
+ :type '(choice
+ (const :tag "No prefix")
+ (string :tag "Prefix")))
+
+(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
+the relevant RFCs. This is relevant only if `org-id-method' is
+`org' or `ts'. 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."
+ :group 'org-id
+ :type 'boolean)
+
+(defcustom org-id-track-globally t
+ "Non-nil means track IDs through files, so that links work globally.
+This work by maintaining a hash table for IDs and writing this table
+to disk when exiting Emacs. Because of this, it works best if you use
+a single Emacs process, not many.
+
+When nil, IDs are not tracked. Links to IDs will still work within
+a buffer, but not if the entry is located in another file.
+IDs can still be used if the entry with the id is in the same file as
+the link."
+ :group 'org-id
+ :type 'boolean)
+
+(defcustom org-id-locations-file (convert-standard-filename
+ (concat user-emacs-directory ".org-id-locations"))
+ "The file for remembering in which file an ID was defined.
+This variable is only relevant when `org-id-track-globally' is set."
+ :group 'org-id
+ :type 'file)
+
+(defcustom org-id-locations-file-relative nil
+ "Determine if `org-id-locations' should be stored as relative links.
+Non-nil means that links to locations are stored as links
+relative to the location of where `org-id-locations-file' is
+stored.
+
+Nil means to store absolute paths to files.
+
+This customization is useful when folders are shared across
+systems but mounted at different roots. Relative path to
+`org-id-locations-file' still has to be maintained across
+systems."
+ :group 'org-id
+ :type 'boolean
+ :package-version '(Org . "9.3"))
+
+(defvar org-id-locations nil
+ "List of files with IDs in those files.")
+
+(defvar org-id-files nil
+ "List of files that contain IDs.")
+
+(defcustom org-id-extra-files 'org-agenda-text-search-extra-files
+ "Files to be searched for IDs, besides the agenda files.
+When Org reparses files to remake the list of files and IDs it is tracking,
+it will normally scan the agenda files, the archives related to agenda files,
+any files that are listed as ID containing in the current register, and
+any Org file currently visited by Emacs.
+You can list additional files here.
+This variable is only relevant when `org-id-track-globally' is set."
+ :group 'org-id
+ :type
+ '(choice
+ (symbol :tag "Variable")
+ (repeat :tag "List of files"
+ (file))))
+
+(defcustom org-id-search-archives t
+ "Non-nil means search also the archive files of agenda files for entries.
+This is a possibility to reduce overhead, but it means that entries moved
+to the archives can no longer be found by ID.
+This variable is only relevant when `org-id-track-globally' is set."
+ :group 'org-id
+ :type 'boolean)
+
+;;; The API functions
+
+;;;###autoload
+(defun org-id-get-create (&optional force)
+ "Create an ID for the current entry and return it.
+If the entry already has an ID, just return it.
+With optional argument FORCE, force the creation of a new ID."
+ (interactive "P")
+ (when force
+ (org-entry-put (point) "ID" nil))
+ (org-id-get (point) 'create))
+
+;;;###autoload
+(defun org-id-copy ()
+ "Copy the ID of the entry at point to the kill ring.
+Create an ID if necessary."
+ (interactive)
+ (org-kill-new (org-id-get nil 'create)))
+
+(defvar org-id-overriding-file-name nil
+ "Tell `org-id-get' to use this as the file name when creating an ID.
+This is useful when working with contents in a temporary buffer
+that will be copied back to the original.")
+
+;;;###autoload
+(defun org-id-get (&optional pom create prefix)
+ "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.
+PREFIX will be passed through to `org-id-new'.
+In any case, the ID of the entry is returned."
+ (org-with-point-at pom
+ (let ((id (org-entry-get nil "ID")))
+ (cond
+ ((and id (stringp id) (string-match "\\S-" id))
+ id)
+ (create
+ (setq id (org-id-new prefix))
+ (org-entry-put pom "ID" id)
+ (org-id-add-location id
+ (or org-id-overriding-file-name
+ (buffer-file-name (buffer-base-buffer))))
+ id)))))
+
+;;;###autoload
+(defun org-id-get-with-outline-path-completion (&optional targets)
+ "Use `outline-path-completion' to retrieve the ID of an entry.
+TARGETS may be a setting for `org-refile-targets' to define
+eligible headlines. When omitted, all headlines in the current
+file are eligible. This function returns the ID of the entry.
+If necessary, the ID is created."
+ (let* ((org-refile-targets (or targets '((nil . (:maxlevel . 10)))))
+ (org-refile-use-outline-path
+ (if (caar org-refile-targets) 'file t))
+ (org-refile-target-verify-function nil)
+ (spos (org-refile-get-location "Entry"))
+ (pom (and spos (move-marker (make-marker) (or (nth 3 spos) 1)
+ (get-file-buffer (nth 1 spos))))))
+ (prog1 (org-id-get pom 'create)
+ (move-marker pom nil))))
+
+;;;###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-goto-location'.
+It returns the ID of the entry. If necessary, the ID is created."
+ (let* ((spos (org-goto-location))
+ (pom (and spos (move-marker (make-marker) (car spos)))))
+ (prog1 (org-id-get pom 'create)
+ (move-marker pom nil))))
+
+;;;###autoload
+(defun org-id-goto (id)
+ "Switch to the buffer containing the entry with id ID.
+Move the cursor to that entry in that buffer."
+ (interactive "sID: ")
+ (let ((m (org-id-find id 'marker)))
+ (unless m
+ (error "Cannot find entry with ID \"%s\"" id))
+ (pop-to-buffer-same-window (marker-buffer m))
+ (goto-char m)
+ (move-marker m nil)
+ (org-show-context)))
+
+;;;###autoload
+(defun org-id-find (id &optional markerp)
+ "Return the location of the entry with the id ID.
+The return value is a cons cell (file-name . position), or nil
+if there is no entry with that ID.
+With optional argument MARKERP, return the position as a new marker."
+ (cond
+ ((symbolp id) (setq id (symbol-name id)))
+ ((numberp id) (setq id (number-to-string id))))
+ (let ((file (org-id-find-id-file id))
+ org-agenda-new-buffers where)
+ (when file
+ (setq where (org-id-find-id-in-file id file markerp)))
+ (unless where
+ (org-id-update-id-locations nil t)
+ (setq file (org-id-find-id-file id))
+ (when file
+ (setq where (org-id-find-id-in-file id file markerp))))
+ where))
+
+;;; Internal functions
+
+;; Creating new IDs
+
+;;;###autoload
+(defun org-id-new (&optional prefix)
+ "Create a new globally unique ID.
+
+An ID consists of two parts separated by a colon:
+- a prefix
+- a unique part that will be created according to `org-id-method'.
+
+PREFIX can specify the prefix, the default is given by the variable
+`org-id-prefix'. However, if PREFIX is the symbol `none', don't use any
+prefix even if `org-id-prefix' specifies one.
+
+So a typical ID could look like \"Org:4nd91V40HI\"."
+ (let* ((prefix (if (eq prefix 'none)
+ ""
+ (concat (or prefix org-id-prefix) ":")))
+ unique)
+ (if (equal prefix ":") (setq prefix ""))
+ (cond
+ ((memq org-id-method '(uuidgen uuid))
+ (setq unique (org-trim (shell-command-to-string org-id-uuid-program)))
+ (unless (org-uuidgen-p unique)
+ (setq unique (org-id-uuid))))
+ ((eq org-id-method 'org)
+ (let* ((etime (org-reverse-string (org-id-time-to-b36)))
+ (postfix (when org-id-include-domain
+ (require 'message)
+ (concat "@" (message-make-fqdn)))))
+ (setq unique (concat etime postfix))))
+ ((eq org-id-method 'ts)
+ (let ((ts (format-time-string org-id-ts-format))
+ (postfix (when org-id-include-domain
+ (require 'message)
+ (concat "@" (message-make-fqdn)))))
+ (setq unique (concat ts postfix))))
+ (t (error "Invalid `org-id-method'")))
+ (concat prefix unique)))
+
+(defun org-id-uuid ()
+ "Return string with random (version 4) UUID."
+ (let ((rnd (md5 (format "%s%s%s%s%s%s%s"
+ (random)
+ (org-time-convert-to-list nil)
+ (user-uid)
+ (emacs-pid)
+ (user-full-name)
+ user-mail-address
+ (recent-keys)))))
+ (format "%s-%s-4%s-%s%s-%s"
+ (substring rnd 0 8)
+ (substring rnd 8 12)
+ (substring rnd 13 16)
+ (format "%x"
+ (logior
+ #b10000000
+ (logand
+ #b10111111
+ (string-to-number
+ (substring rnd 16 18) 16))))
+ (substring rnd 18 20)
+ (substring rnd 20 32))))
+
+(defun org-id-int-to-b36-one-digit (integer)
+ "Convert INTEGER between 0 and 61 into a single character 0..9, A..Z, a..z."
+ (cond
+ ((< integer 10) (+ ?0 integer))
+ ((< integer 36) (+ ?a integer -10))
+ (t (error "Larger that 35"))))
+
+(defun org-id-b36-to-int-one-digit (i)
+ "Convert character 0..9, A..Z, a..z into a number 0..61.
+The input I may be a character, or a single-letter string."
+ (and (stringp i) (setq i (string-to-char i)))
+ (cond
+ ((and (>= i ?0) (<= i ?9)) (- i ?0))
+ ((and (>= i ?a) (<= i ?z)) (+ (- i ?a) 10))
+ (t (error "Invalid b36 letter"))))
+
+(defun org-id-int-to-b36 (integer &optional length)
+ "Convert an INTEGER to a base-36 number represented as a string.
+The returned string is padded with leading zeros to LENGTH if necessary."
+ (let ((s "")
+ (i integer))
+ (while (> i 0)
+ (setq s (concat (char-to-string
+ (org-id-int-to-b36-one-digit (mod i 36))) s)
+ i (/ i 36)))
+ (setq length (max 1 (or length 1)))
+ (if (< (length s) length)
+ (setq s (concat (make-string (- length (length s)) ?0) s)))
+ s))
+
+(defun org-id-b36-to-int (string)
+ "Convert a base-36 STRING into the corresponding integer."
+ (let ((r 0))
+ (mapc (lambda (i) (setq r (+ (* r 36) (org-id-b36-to-int-one-digit i))))
+ string)
+ r))
+
+(defun org-id-time-to-b36 (&optional time)
+ "Encode TIME as a 12-digit string.
+This string holds the time to micro-second accuracy, and can be decoded
+using `org-id-decode'."
+ ;; 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 (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 a Lisp time value (HI LO USEC)."
+ (let (prefix time parts)
+ (setq parts (org-split-string id ":"))
+ (if (= 2 (length parts))
+ (setq prefix (car parts) time (nth 1 parts))
+ (setq prefix nil time (nth 0 parts)))
+ (setq time (org-reverse-string time))
+ (setq time (list (org-id-b36-to-int (substring time 0 4))
+ (org-id-b36-to-int (substring time 4 8))
+ (org-id-b36-to-int (substring time 8 12))))
+ (cons prefix time)))
+
+;; Storing ID locations (files)
+
+;;;###autoload
+(defun org-id-update-id-locations (&optional files silent)
+ "Scan relevant files for IDs.
+Store the relation between files and corresponding IDs.
+This will scan all agenda files, all associated archives, and all
+files currently mentioned in `org-id-locations'.
+When FILES is given, scan also these files.
+If SILENT is non-nil, messages are suppressed."
+ (interactive)
+ (unless org-id-track-globally
+ (error "Please turn on `org-id-track-globally' if you want to track IDs"))
+ (setq org-id-locations nil)
+ (let* ((files
+ (delete-dups
+ (mapcar #'file-truename
+ (cl-remove-if-not
+ ;; Default `org-id-extra-files' value contains
+ ;; `agenda-archives' symbol.
+ #'stringp
+ (append
+ ;; Agenda files and all associated archives.
+ (org-agenda-files t org-id-search-archives)
+ ;; Explicit extra files.
+ (if (symbolp org-id-extra-files)
+ (symbol-value org-id-extra-files)
+ org-id-extra-files)
+ ;; All files known to have IDs.
+ org-id-files
+ ;; Additional files from function call.
+ files)))))
+ (nfiles (length files))
+ (id-regexp
+ (rx (seq bol (0+ (any "\t ")) ":ID:" (1+ " ") (not (any " ")))))
+ (seen-ids nil)
+ (ndup 0)
+ (i 0))
+ (with-temp-buffer
+ (delay-mode-hooks
+ (org-mode)
+ (dolist (file files)
+ (when (file-exists-p file)
+ (unless silent
+ (cl-incf i)
+ (message "Finding ID locations (%d/%d files): %s" i nfiles file))
+ (insert-file-contents file nil nil nil 'replace)
+ (let ((ids nil)
+ (case-fold-search t))
+ (org-with-point-at 1
+ (while (re-search-forward id-regexp nil t)
+ (when (org-at-property-p)
+ (push (org-entry-get (point) "ID") ids)))
+ (when ids
+ (push (cons (abbreviate-file-name file) ids)
+ org-id-locations)
+ (dolist (id ids)
+ (cond
+ ((not (member id seen-ids)) (push id seen-ids))
+ (silent nil)
+ (t
+ (message "Duplicate ID %S" id)
+ (cl-incf ndup)))))))))))
+ (setq org-id-files (mapcar #'car org-id-locations))
+ (org-id-locations-save)
+ ;; Now convert to a hash table.
+ (setq org-id-locations (org-id-alist-to-hash org-id-locations))
+ (when (and (not silent) (> ndup 0))
+ (warn "WARNING: %d duplicate IDs found, check *Messages* buffer" ndup))
+ (message "%d files scanned, %d files contains IDs, and %d IDs found."
+ nfiles (length org-id-files) (hash-table-count org-id-locations))
+ org-id-locations))
+
+(defun org-id-locations-save ()
+ "Save `org-id-locations' in `org-id-locations-file'."
+ (when (and org-id-track-globally org-id-locations)
+ (let ((out (if (hash-table-p org-id-locations)
+ (org-id-hash-to-alist org-id-locations)
+ org-id-locations)))
+ (when (and org-id-locations-file-relative out)
+ (setq out (mapcar
+ (lambda (item)
+ (if (file-name-absolute-p (car item))
+ (cons (file-relative-name
+ (car item) (file-name-directory
+ org-id-locations-file))
+ (cdr item))
+ item))
+ out)))
+ (with-temp-file org-id-locations-file
+ (let ((print-level nil)
+ (print-length nil))
+ (print out (current-buffer)))))))
+
+(defun org-id-locations-load ()
+ "Read the data from `org-id-locations-file'."
+ (setq org-id-locations nil)
+ (when org-id-track-globally
+ (with-temp-buffer
+ (condition-case nil
+ (progn
+ (insert-file-contents org-id-locations-file)
+ (setq org-id-locations (read (current-buffer)))
+ (let ((loc (file-name-directory org-id-locations-file)))
+ (mapc (lambda (item)
+ (unless (file-name-absolute-p (car item))
+ (setf (car item) (expand-file-name (car item) loc))))
+ org-id-locations)))
+ (error
+ (message "Could not read `org-id-values' from %s, setting it to nil"
+ org-id-locations-file))))
+ (setq org-id-files (mapcar 'car org-id-locations))
+ (setq org-id-locations (org-id-alist-to-hash org-id-locations))))
+
+(defun org-id-add-location (id file)
+ "Add the ID with location FILE to the database of ID locations."
+ ;; Only if global tracking is on, and when the buffer has a file
+ (unless file
+ (error "`org-id-get' expects a file-visiting buffer"))
+ (let ((afile (abbreviate-file-name file)))
+ (when (and org-id-track-globally id)
+ (unless org-id-locations (org-id-locations-load))
+ (puthash id afile org-id-locations)
+ (unless (member afile org-id-files)
+ (add-to-list 'org-id-files afile)))))
+
+(unless noninteractive
+ (add-hook 'kill-emacs-hook 'org-id-locations-save))
+
+(defun org-id-hash-to-alist (hash)
+ "Turn an org-id HASH into an alist.
+This is to be able to write it to a file."
+ (let (res x)
+ (maphash
+ (lambda (k v)
+ (if (setq x (assoc v res))
+ (setcdr x (cons k (cdr x)))
+ (push (list v k) res)))
+ hash)
+ res))
+
+(defun org-id-alist-to-hash (list)
+ "Turn an org-id location LIST into a hash table."
+ (let ((res (make-hash-table
+ :test 'equal
+ :size (apply '+ (mapcar 'length list))))
+ f)
+ (mapc
+ (lambda (x)
+ (setq f (car x))
+ (mapc (lambda (i) (puthash i f res)) (cdr x)))
+ list)
+ res))
+
+(defun org-id-paste-tracker (txt &optional buffer-or-file)
+ "Update any ids in TXT and assign BUFFER-OR-FILE to them."
+ (when org-id-track-globally
+ (save-match-data
+ (setq buffer-or-file (or buffer-or-file (current-buffer)))
+ (when (bufferp buffer-or-file)
+ (setq buffer-or-file (or (buffer-base-buffer buffer-or-file)
+ buffer-or-file))
+ (setq buffer-or-file (buffer-file-name buffer-or-file)))
+ (when buffer-or-file
+ (let ((fname (abbreviate-file-name buffer-or-file))
+ (s 0))
+ (while (string-match "^[ \t]*:ID:[ \t]+\\([^ \t\n\r]+\\)" txt s)
+ (setq s (match-end 0))
+ (org-id-add-location (match-string 1 txt) fname)))))))
+
+;; Finding entries with specified id
+
+;;;###autoload
+(defun org-id-find-id-file (id)
+ "Query the id database for the file in which ID is located."
+ (unless org-id-locations (org-id-locations-load))
+ (or (and org-id-locations
+ (hash-table-p org-id-locations)
+ (gethash id org-id-locations))
+ ;; Fall back on current buffer
+ (buffer-file-name (or (buffer-base-buffer (current-buffer))
+ (current-buffer)))))
+
+(defun org-id-find-id-in-file (id file &optional markerp)
+ "Return the position of the entry ID in FILE.
+
+If that files does not exist, or if it does not contain this ID,
+return nil.
+
+The position is returned as a cons cell (file-name . position). With
+optional argument MARKERP, return the position as a new marker."
+ (cond
+ ((not file) nil)
+ ((not (file-exists-p file)) nil)
+ (t
+ (let* ((visiting (find-buffer-visiting file))
+ (buffer (or visiting (find-file-noselect file))))
+ (unwind-protect
+ (with-current-buffer buffer
+ (let ((pos (org-find-entry-with-id id)))
+ (cond
+ ((null pos) nil)
+ (markerp (move-marker (make-marker) pos buffer))
+ (t (cons file pos)))))
+ ;; Remove opened buffer in the process.
+ (unless (or visiting markerp) (kill-buffer buffer)))))))
+
+;; id link type
+
+;; Calling the following function is hard-coded into `org-store-link',
+;; so we do have to add it to `org-store-link-functions'.
+
+;;;###autoload
+(defun org-id-store-link ()
+ "Store a link to the current entry, using its ID.
+
+If before first heading store first title-keyword as description
+or filename if no title."
+ (interactive)
+ (when (and (buffer-file-name (buffer-base-buffer)) (derived-mode-p 'org-mode))
+ (let* ((link (concat "id:" (org-id-get-create)))
+ (case-fold-search nil)
+ (desc (save-excursion
+ (org-back-to-heading-or-point-min t)
+ (cond ((org-before-first-heading-p)
+ (let ((keywords (org-collect-keywords '("TITLE"))))
+ (if keywords
+ (cadr (assoc "TITLE" keywords))
+ (file-name-nondirectory
+ (buffer-file-name (buffer-base-buffer))))))
+ ((looking-at org-complex-heading-regexp)
+ (if (match-end 4)
+ (match-string 4)
+ (match-string 0)))
+ (t link)))))
+ (org-link-store-props :link link :description desc :type "id")
+ link)))
+
+(defun org-id-open (id _)
+ "Go to the entry with id ID."
+ (org-mark-ring-push)
+ (let ((m (org-id-find id 'marker))
+ cmd)
+ (unless m
+ (error "Cannot find entry with ID \"%s\"" id))
+ ;; Use a buffer-switching command in analogy to finding files
+ (setq cmd
+ (or
+ (cdr
+ (assq
+ (cdr (assq 'file org-link-frame-setup))
+ '((find-file . switch-to-buffer)
+ (find-file-other-window . switch-to-buffer-other-window)
+ (find-file-other-frame . switch-to-buffer-other-frame))))
+ 'switch-to-buffer-other-window))
+ (if (not (equal (current-buffer) (marker-buffer m)))
+ (funcall cmd (marker-buffer m)))
+ (goto-char m)
+ (move-marker m nil)
+ (org-show-context)))
+
+(org-link-set-parameters "id" :follow #'org-id-open)
+
+(provide 'org-id)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-id.el ends here
diff --git a/elpa/org-9.5.2/org-id.elc b/elpa/org-9.5.2/org-id.elc
new file mode 100644
index 0000000..ffb9e10
--- /dev/null
+++ b/elpa/org-9.5.2/org-id.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-indent.el b/elpa/org-9.5.2/org-indent.el
new file mode 100644
index 0000000..e0cb697
--- /dev/null
+++ b/elpa/org-9.5.2/org-indent.el
@@ -0,0 +1,428 @@
+;;; org-indent.el --- Dynamic indentation for Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+;;
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This is an implementation of dynamic virtual indentation. It works
+;; by adding text properties to a buffer to make sure lines are
+;; indented according to outline structure.
+;;
+;; The process is synchronous, toggled at every buffer modification.
+;; Though, the initialization (indentation of text already in the
+;; buffer), which can take a few seconds in large buffers, happens on
+;; idle time.
+;;
+;;; Code:
+
+(require 'org-macs)
+(require 'org-compat)
+(require 'org)
+
+(require 'cl-lib)
+
+(declare-function org-inlinetask-get-task-level "org-inlinetask" ())
+(declare-function org-inlinetask-in-task-p "org-inlinetask" ())
+(declare-function org-list-item-body-column "org-list" (item))
+(defvar org-inlinetask-show-first-star)
+
+(defgroup org-indent nil
+ "Options concerning dynamic virtual outline indentation."
+ :tag "Org Indent"
+ :group 'org)
+
+(defvar org-indent-inlinetask-first-star (org-add-props "*" '(face org-warning))
+ "First star of inline tasks, with correct face.")
+(defvar org-indent-agent-timer nil
+ "Timer running the initialize agent.")
+(defvar org-indent-agentized-buffers nil
+ "List of buffers watched by the initialize agent.")
+(defvar org-indent-agent-resume-timer nil
+ "Timer to reschedule agent after switching to other idle processes.")
+(defvar org-indent-agent-active-delay '(0 2 0)
+ "Time to run agent before switching to other idle processes.
+Delay used when the buffer to initialize is current.")
+(defvar org-indent-agent-passive-delay '(0 0 400000)
+ "Time to run agent before switching to other idle processes.
+Delay used when the buffer to initialize isn't current.")
+(defvar org-indent-agent-resume-delay '(0 0 100000)
+ "Minimal time for other idle processes before switching back to agent.")
+(defvar org-indent--initial-marker nil
+ "Position of initialization before interrupt.
+This is used locally in each buffer being initialized.")
+(defvar org-indent-modified-headline-flag nil
+ "Non-nil means the last deletion operated on a headline.
+It is modified by `org-indent-notify-modified-headline'.")
+
+
+(defcustom org-indent-boundary-char ?\s
+ "The end of the virtual indentation strings, a single-character string.
+The default is just a space, but if you wish, you can use \"|\" or so.
+This can be useful on a terminal window - under a windowing system,
+it may be prettier to customize the `org-indent' face."
+ :group 'org-indent
+ :type 'character)
+
+(defcustom org-indent-mode-turns-off-org-adapt-indentation t
+ "Non-nil means setting `org-indent-mode' will turn off indentation adaptation.
+For details see the variable `org-adapt-indentation'."
+ :group 'org-indent
+ :type 'boolean)
+
+(defcustom org-indent-mode-turns-on-hiding-stars t
+ "Non-nil means setting `org-indent-mode' will turn on `org-hide-leading-stars'."
+ :group 'org-indent
+ :type 'boolean)
+
+(defcustom org-indent-indentation-per-level 2
+ "Indentation per level in number of characters."
+ :group 'org-indent
+ :type 'integer)
+
+(defface org-indent '((t (:inherit org-hide)))
+ "Face for outline indentation.
+The default is to make it look like whitespace. But you may find it
+useful to make it ever so slightly different."
+ :group 'org-faces)
+
+(defvar org-indent--text-line-prefixes nil
+ "Vector containing line prefixes strings for regular text.")
+
+(defvar org-indent--heading-line-prefixes nil
+ "Vector containing line prefix strings for headlines.")
+
+(defvar org-indent--inlinetask-line-prefixes nil
+ "Vector containing line prefix strings for inline tasks.")
+
+(defconst org-indent--deepest-level 50
+ "Maximum theoretical headline depth.")
+
+(defun org-indent--compute-prefixes ()
+ "Compute prefix strings for regular text and headlines."
+ (setq org-indent--heading-line-prefixes
+ (make-vector org-indent--deepest-level nil))
+ (setq org-indent--inlinetask-line-prefixes
+ (make-vector org-indent--deepest-level nil))
+ (setq org-indent--text-line-prefixes
+ (make-vector org-indent--deepest-level nil))
+ (when (> org-indent-indentation-per-level 0)
+ (dotimes (n org-indent--deepest-level)
+ (let ((indentation (if (<= n 1) 0
+ (* (1- org-indent-indentation-per-level)
+ (1- n)))))
+ ;; Headlines line prefixes.
+ (let ((heading-prefix (make-string indentation ?*)))
+ (aset org-indent--heading-line-prefixes
+ n
+ (org-add-props heading-prefix nil 'face 'org-indent))
+ ;; Inline tasks line prefixes
+ (aset org-indent--inlinetask-line-prefixes
+ n
+ (cond ((<= n 1) "")
+ ((bound-and-true-p org-inlinetask-show-first-star)
+ (concat org-indent-inlinetask-first-star
+ (substring heading-prefix 1)))
+ (t (org-add-props heading-prefix nil 'face 'org-indent)))))
+ ;; Text line prefixes.
+ (aset org-indent--text-line-prefixes
+ n
+ (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."
+ (with-silent-modifications
+ (remove-text-properties beg end '(line-prefix nil wrap-prefix nil))))
+
+;;;###autoload
+(define-minor-mode org-indent-mode
+ "When active, indent text according to outline structure.
+
+Internally this works by adding `line-prefix' and `wrap-prefix'
+properties, after each buffer modification, on the modified zone.
+
+The process is synchronous. Though, initial indentation of
+buffer, which can take a few seconds on large buffers, is done
+during idle time."
+ :lighter " Ind"
+ (cond
+ (org-indent-mode
+ ;; mode was turned on.
+ (setq-local indent-tabs-mode nil)
+ (setq-local org-indent--initial-marker (copy-marker 1))
+ (when org-indent-mode-turns-off-org-adapt-indentation
+ ;; Don't turn off `org-adapt-indentation' when its value is
+ ;; 'headline-data, just indent headline data specially.
+ (or (eq org-adapt-indentation 'headline-data)
+ (setq-local org-adapt-indentation nil)))
+ (when org-indent-mode-turns-on-hiding-stars
+ (setq-local org-hide-leading-stars t))
+ (org-indent--compute-prefixes)
+ (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)
+ (and font-lock-mode (org-restart-font-lock))
+ (org-indent-remove-properties (point-min) (point-max))
+ ;; Submit current buffer to initialize agent. If it's the first
+ ;; buffer submitted, also start the agent. Current buffer is
+ ;; pushed in both cases to avoid a race condition.
+ (if org-indent-agentized-buffers
+ (push (current-buffer) org-indent-agentized-buffers)
+ (push (current-buffer) org-indent-agentized-buffers)
+ (setq org-indent-agent-timer
+ (run-with-idle-timer 0.2 t #'org-indent-initialize-agent))))
+ (t
+ ;; Mode was turned off (or we refused to turn it on)
+ (kill-local-variable 'org-adapt-indentation)
+ (setq org-indent-agentized-buffers
+ (delq (current-buffer) org-indent-agentized-buffers))
+ (when (markerp org-indent--initial-marker)
+ (set-marker org-indent--initial-marker nil))
+ (when (local-variable-p 'org-hide-leading-stars)
+ (kill-local-variable 'org-hide-leading-stars))
+ (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)
+ (org-with-wide-buffer
+ (org-indent-remove-properties (point-min) (point-max)))
+ (and font-lock-mode (org-restart-font-lock))
+ (redraw-display))))
+
+(defun org-indent-indent-buffer ()
+ "Add indentation properties to the accessible part of the buffer."
+ (interactive)
+ (if (not (derived-mode-p 'org-mode))
+ (error "Not in Org mode")
+ (message "Setting buffer indentation. It may take a few seconds...")
+ (org-indent-remove-properties (point-min) (point-max))
+ (org-indent-add-properties (point-min) (point-max))
+ (message "Indentation of buffer set.")))
+
+(defun org-indent-remove-properties-from-string (string)
+ "Remove indentation properties from STRING."
+ (remove-text-properties 0 (length string)
+ '(line-prefix nil wrap-prefix nil) string)
+ string)
+
+(defun org-indent-initialize-agent ()
+ "Start or resume current buffer initialization.
+Only buffers in `org-indent-agentized-buffers' trigger an action.
+When no more buffer is being watched, the agent suppress itself."
+ (when org-indent-agent-resume-timer
+ (cancel-timer org-indent-agent-resume-timer))
+ (setq org-indent-agentized-buffers
+ (cl-remove-if-not #'buffer-live-p org-indent-agentized-buffers))
+ (cond
+ ;; Job done: kill agent.
+ ((not org-indent-agentized-buffers) (cancel-timer org-indent-agent-timer))
+ ;; Current buffer is agentized: start/resume initialization
+ ;; somewhat aggressively.
+ ((memq (current-buffer) org-indent-agentized-buffers)
+ (org-indent-initialize-buffer (current-buffer)
+ org-indent-agent-active-delay))
+ ;; Else, start/resume initialization of the last agentized buffer,
+ ;; softly.
+ (t (org-indent-initialize-buffer (car org-indent-agentized-buffers)
+ org-indent-agent-passive-delay))))
+
+(defun org-indent-initialize-buffer (buffer delay)
+ "Set virtual indentation for the buffer BUFFER, asynchronously.
+Give hand to other idle processes if it takes longer than DELAY,
+a time value."
+ (with-current-buffer buffer
+ (when org-indent-mode
+ (org-with-wide-buffer
+ (let ((interruptp
+ ;; Always nil unless interrupted.
+ (catch 'interrupt
+ (and org-indent--initial-marker
+ (marker-position org-indent--initial-marker)
+ (equal (marker-buffer org-indent--initial-marker)
+ buffer)
+ (org-indent-add-properties org-indent--initial-marker
+ (point-max)
+ delay)
+ nil))))
+ (move-marker org-indent--initial-marker interruptp)
+ ;; Job is complete: un-agentize buffer.
+ (unless interruptp
+ (setq org-indent-agentized-buffers
+ (delq buffer org-indent-agentized-buffers))))))))
+
+(defun org-indent-set-line-properties (level indentation &optional heading)
+ "Set prefix properties on current line an move to next one.
+
+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 it is `inlinetask', the first star will
+have `org-warning' face."
+ (let* ((line (aref (pcase heading
+ (`nil org-indent--text-line-prefixes)
+ (`inlinetask org-indent--inlinetask-line-prefixes)
+ (_ org-indent--heading-line-prefixes))
+ level))
+ (wrap
+ (org-add-props
+ (concat line
+ (if heading (concat (make-string level ?*) " ")
+ (make-string indentation ?\s)))
+ nil 'face 'org-indent)))
+ ;; Add properties down to the next line to indent empty lines.
+ (add-text-properties (line-beginning-position) (line-beginning-position 2)
+ `(line-prefix ,line wrap-prefix ,wrap)))
+ (forward-line))
+
+(defun org-indent-add-properties (beg end &optional delay)
+ "Add indentation properties between BEG and END.
+
+When DELAY is non-nil, it must be a time value. In that case,
+the process is asynchronous and can be interrupted, either by
+user request, or after DELAY. This is done by throwing the
+`interrupt' tag along with the buffer position where the process
+stopped."
+ (save-match-data
+ (org-with-wide-buffer
+ (goto-char beg)
+ (beginning-of-line)
+ ;; Initialize prefix at BEG, according to current entry's level.
+ (let* ((case-fold-search t)
+ (limited-re (org-get-limited-outline-regexp))
+ (level (or (org-current-level) 0))
+ (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).
+ (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)
+ ;; When adapt indentation is 'headline-data, use
+ ;; `org-indent--heading-line-prefixes' for setting
+ ;; headline data indentation.
+ (and (eq org-adapt-indentation 'headline-data)
+ (or (org-at-planning-p)
+ (org-at-clock-log-p)
+ (looking-at-p org-property-start-re)
+ (looking-at-p org-property-end-re)
+ (looking-at-p org-property-re))))))))))))
+
+(defun org-indent-notify-modified-headline (beg end)
+ "Set `org-indent-modified-headline-flag' depending on context.
+
+BEG and END are the positions of the beginning and end of the
+range of deleted text.
+
+This function is meant to be called by `before-change-functions'.
+Flag will be non-nil if command is going to modify or delete an
+headline."
+ (when org-indent-mode
+ (setq org-indent-modified-headline-flag
+ (org-with-wide-buffer
+ (goto-char beg)
+ (save-match-data
+ (or (and (org-at-heading-p) (< beg (match-end 0)))
+ (re-search-forward
+ (org-with-limited-levels org-outline-regexp-bol) end t)))))))
+
+(defun org-indent-refresh-maybe (beg end _)
+ "Refresh indentation properties in an adequate portion of buffer.
+BEG and END are the positions of the beginning and end of the
+range of inserted text. DUMMY is an unused argument.
+
+This function is meant to be called by `after-change-functions'."
+ (when org-indent-mode
+ (save-match-data
+ ;; If a headline was modified or inserted, set properties until
+ ;; next headline.
+ (org-with-wide-buffer
+ (if (or org-indent-modified-headline-flag
+ (save-excursion
+ (goto-char beg)
+ (beginning-of-line)
+ (re-search-forward
+ (org-with-limited-levels org-outline-regexp-bol) end t)))
+ (let ((end (save-excursion
+ (goto-char end)
+ (org-with-limited-levels (outline-next-heading))
+ (point))))
+ (setq org-indent-modified-headline-flag nil)
+ (org-indent-add-properties beg end))
+ ;; Otherwise, only set properties on modified area.
+ (org-indent-add-properties beg end))))))
+
+(provide 'org-indent)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-indent.el ends here
diff --git a/elpa/org-9.5.2/org-indent.elc b/elpa/org-9.5.2/org-indent.elc
new file mode 100644
index 0000000..08bf535
--- /dev/null
+++ b/elpa/org-9.5.2/org-indent.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-inlinetask.el b/elpa/org-9.5.2/org-inlinetask.el
new file mode 100644
index 0000000..3379a2e
--- /dev/null
+++ b/elpa/org-9.5.2/org-inlinetask.el
@@ -0,0 +1,354 @@
+;;; org-inlinetask.el --- Tasks Independent of Outline Hierarchy -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+;;
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+;;
+;; This module implements inline tasks in Org mode. Inline tasks are
+;; tasks that have all the properties of normal outline nodes,
+;; including the ability to store meta data like scheduling dates,
+;; TODO state, tags and properties. However, these nodes are treated
+;; specially by the visibility cycling.
+;;
+;; Visibility cycling exempts these nodes from cycling. So whenever
+;; their parent is opened, so are these tasks. This will only work
+;; with `org-cycle', so if you are also using other commands to
+;; show/hide entries, you will occasionally find these tasks to behave
+;; like all other outline nodes, seemingly splitting the text of the
+;; parent into children.
+;;
+;; Special fontification of inline tasks, so that they can be
+;; 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.
+;;
+;; If you need to have a time planning line (DEADLINE etc), drawers,
+;; for example LOGBOOK of PROPERTIES, or even normal text as part of
+;; the inline task, you must add an "END" headline with the same
+;; number of stars.
+;;
+;; As an example, here are two valid inline tasks:
+;;
+;; **************** TODO A small task
+;;
+;; and
+;;
+;; **************** TODO Another small task
+;; DEADLINE: <2009-03-30 Mon>
+;; :PROPERTIES:
+;; :SOMETHING: another thing
+;; :END:
+;; And here is some extra text
+;; **************** END
+;;
+;; Also, if you want to use refiling and archiving for inline tasks,
+;; The END line must be present to make things work properly.
+;;
+;; Note that you should not try to use inline tasks within plain list,
+;; visibility cycling is known to be problematic when doing so.
+;;
+;; This package installs one new command:
+;;
+;; C-c C-x t Insert a new inline task with END line
+
+;;; Code:
+
+(require 'org)
+
+(defgroup org-inlinetask nil
+ "Options concerning inline tasks in Org mode."
+ :tag "Org Inline Tasks"
+ :group 'org-structure)
+
+(defcustom org-inlinetask-min-level 15
+ "Minimum level a headline must have before it is treated as an inline task.
+Don't set it to something higher than `29' or clocking will break since this
+is the hardcoded maximum number of stars `org-clock-sum' will work with.
+
+It is strongly recommended that you set `org-cycle-max-level' not at all,
+or to a number smaller than this one. In fact, when `org-cycle-max-level' is
+not set, it will be assumed to be one less than the value of smaller than
+the value of this variable."
+ :group 'org-inlinetask
+ :type '(choice
+ (const :tag "Off" nil)
+ (integer)))
+
+(defcustom org-inlinetask-show-first-star nil
+ "Non-nil means display the first star of an inline task as additional marker.
+When nil, the first star is not shown."
+ :tag "Org Inline Tasks"
+ :group 'org-structure
+ :type 'boolean)
+
+(defvar org-odd-levels-only)
+(defvar org-keyword-time-regexp)
+(defvar org-complex-heading-regexp)
+(defvar org-property-end-re)
+
+(defcustom org-inlinetask-default-state nil
+ "Non-nil means make inline tasks have a TODO keyword initially.
+This should be the state `org-inlinetask-insert-task' should use by
+default, or nil if no state should be assigned."
+ :group 'org-inlinetask
+ :version "24.1"
+ :type '(choice
+ (const :tag "No state" nil)
+ (string :tag "Specific state")))
+
+(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 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
+ ;; before this one.
+ (when (and (org-inlinetask-in-task-p)
+ (not (and (org-inlinetask-at-task-p) (bolp))))
+ (user-error "Cannot nest inline tasks"))
+ (or (bolp) (newline))
+ (let* ((indent (if org-odd-levels-only
+ (1- (* 2 org-inlinetask-min-level))
+ org-inlinetask-min-level))
+ (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))
+ ""
+ (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 ()
+ "Return string matching an inline task heading.
+The number of levels is controlled by `org-inlinetask-min-level'."
+ (let ((nstars (if org-odd-levels-only
+ (1- (* org-inlinetask-min-level 2))
+ 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 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))
+ (or (looking-at-p (concat (org-inlinetask-outline-regexp) "\\(?:.*\\)"))
+ (and (re-search-forward "^\\*+[ \t]+" nil t)
+ (org-inlinetask-end-p))))))
+
+(defun org-inlinetask-goto-beginning ()
+ "Go to the beginning of the inline task at point."
+ (end-of-line)
+ (let ((case-fold-search t)
+ (inlinetask-re (org-inlinetask-outline-regexp)))
+ (re-search-backward inlinetask-re nil 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."
+ (save-match-data
+ (beginning-of-line)
+ (let ((case-fold-search t)
+ (inlinetask-re (org-inlinetask-outline-regexp)))
+ (cond
+ ((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.
+This assumes the point is inside an inline task."
+ (save-excursion
+ (end-of-line)
+ (re-search-backward (org-inlinetask-outline-regexp) nil t)
+ (- (match-end 1) (match-beginning 1))))
+
+(defun org-inlinetask-promote ()
+ "Promote the inline task at point.
+If the task has an end part, promote it. Also, prevents level from
+going below `org-inlinetask-min-level'."
+ (interactive)
+ (if (not (org-inlinetask-in-task-p))
+ (user-error "Not in an inline task")
+ (save-excursion
+ (let* ((lvl (org-inlinetask-get-task-level))
+ (next-lvl (org-get-valid-level lvl -1))
+ (diff (- next-lvl lvl))
+ (down-task (concat (make-string next-lvl ?*)))
+ beg)
+ (if (< next-lvl org-inlinetask-min-level)
+ (user-error "Cannot promote an inline task at minimum level")
+ (org-inlinetask-goto-beginning)
+ (setq beg (point))
+ (replace-match down-task nil t nil 1)
+ (org-inlinetask-goto-end)
+ (if (and (eobp) (looking-back "END\\s-*" (point-at-bol)))
+ (beginning-of-line)
+ (forward-line -1))
+ (unless (= (point) beg)
+ (looking-at (org-inlinetask-outline-regexp))
+ (replace-match down-task nil t nil 1)
+ (when (eq org-adapt-indentation t)
+ (goto-char beg)
+ (org-fixup-indentation diff))))))))
+
+(defun org-inlinetask-demote ()
+ "Demote the inline task at point.
+If the task has an end part, also demote it."
+ (interactive)
+ (if (not (org-inlinetask-in-task-p))
+ (user-error "Not in an inline task")
+ (save-excursion
+ (let* ((lvl (org-inlinetask-get-task-level))
+ (next-lvl (org-get-valid-level lvl 1))
+ (diff (- next-lvl lvl))
+ (down-task (concat (make-string next-lvl ?*)))
+ beg)
+ (org-inlinetask-goto-beginning)
+ (setq beg (point))
+ (replace-match down-task nil t nil 1)
+ (org-inlinetask-goto-end)
+ (if (and (eobp) (looking-back "END\\s-*" (point-at-bol)))
+ (beginning-of-line)
+ (forward-line -1))
+ (unless (= (point) beg)
+ (looking-at (org-inlinetask-outline-regexp))
+ (replace-match down-task nil t nil 1)
+ (when (eq org-adapt-indentation t)
+ (goto-char beg)
+ (org-fixup-indentation diff)))))))
+
+(defvar org-indent-indentation-per-level) ; defined in org-indent.el
+
+(defface org-inlinetask '((t :inherit shadow))
+ "Face for inlinetask headlines."
+ :group 'org-faces)
+
+(defun org-inlinetask-fontify (limit)
+ "Fontify the inline tasks down to LIMIT."
+ (let* ((nstars (if org-odd-levels-only
+ (1- (* 2 (or org-inlinetask-min-level 200)))
+ (or org-inlinetask-min-level 200)))
+ (re (concat "^\\(\\*\\)\\(\\*\\{"
+ (format "%d" (- nstars 3))
+ ",\\}\\)\\(\\*\\* .*\\)"))
+ ;; Virtual indentation will add the warning face on the first
+ ;; star. Thus, in that case, only hide it.
+ (start-face (if (and (bound-and-true-p org-indent-mode)
+ (> org-indent-indentation-per-level 1))
+ 'org-hide
+ 'org-warning)))
+ (while (re-search-forward re limit t)
+ (if org-inlinetask-show-first-star
+ (add-text-properties (match-beginning 1) (match-end 1)
+ `(face ,start-face font-lock-fontified t)))
+ (add-text-properties (match-beginning
+ (if org-inlinetask-show-first-star 2 1))
+ (match-end 2)
+ '(face org-hide font-lock-fontified t))
+ (add-text-properties (match-beginning 3) (match-end 3)
+ '(face org-inlinetask font-lock-fontified t)))))
+
+(defun org-inlinetask-toggle-visibility ()
+ "Toggle visibility of inline task at point."
+ (let ((end (save-excursion
+ (org-inlinetask-goto-end)
+ (if (bolp) (1- (point)) (point))))
+ (start (save-excursion
+ (org-inlinetask-goto-beginning)
+ (point-at-eol))))
+ (cond
+ ;; Nothing to show/hide.
+ ((= end start))
+ ;; Inlinetask was folded: expand it.
+ ((eq (get-char-property (1+ start) 'invisible) 'outline)
+ (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'.
+This function is meant to be used in `org-cycle-hook'."
+ (pcase state
+ (`contents
+ (let ((regexp (org-inlinetask-outline-regexp)))
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward regexp nil t)
+ (org-inlinetask-toggle-visibility)
+ (org-inlinetask-goto-end)))))
+ (`children
+ (save-excursion
+ (while
+ (or (org-inlinetask-at-task-p)
+ (and (outline-next-heading) (org-inlinetask-at-task-p)))
+ (org-inlinetask-toggle-visibility)
+ (org-inlinetask-goto-end))))))
+
+(defun org-inlinetask-remove-END-maybe ()
+ "Remove an END line when present."
+ (when (looking-at (format "\\([ \t]*\n\\)*\\*\\{%d,\\}[ \t]+END[ \t]*$"
+ org-inlinetask-min-level))
+ (replace-match "")))
+
+(add-hook 'org-font-lock-hook 'org-inlinetask-fontify)
+(add-hook 'org-cycle-hook 'org-inlinetask-hide-tasks)
+
+(provide 'org-inlinetask)
+
+;;; org-inlinetask.el ends here
diff --git a/elpa/org-9.5.2/org-inlinetask.elc b/elpa/org-9.5.2/org-inlinetask.elc
new file mode 100644
index 0000000..2fb6904
--- /dev/null
+++ b/elpa/org-9.5.2/org-inlinetask.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-keys.el b/elpa/org-9.5.2/org-keys.el
new file mode 100644
index 0000000..a3d9576
--- /dev/null
+++ b/elpa/org-9.5.2/org-keys.el
@@ -0,0 +1,931 @@
+;;; org-keys.el --- Key bindings for Org mode -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library adds bindings for Org mode buffers. It also
+;; implements both Speed keys and Babel speed keys. See manual for
+;; details.
+
+;;; Code:
+
+(require 'cl-lib)
+
+(defvar org-outline-regexp)
+
+(require 'oc)
+
+(declare-function org-add-note "org" ())
+(declare-function org-agenda "org" (&optional arg org-keys restriction))
+(declare-function org-agenda-file-to-front "org" (&optional to-end))
+(declare-function org-agenda-remove-restriction-lock "org" (&optional noupdate))
+(declare-function org-agenda-set-restriction-lock "org" (&optional type))
+(declare-function org-archive-subtree "org" (&optional find-done))
+(declare-function org-archive-subtree-default "org" ())
+(declare-function org-archive-subtree-default-with-confirmation "org" ())
+(declare-function org-archive-to-archive-sibling "org" ())
+(declare-function org-at-heading-p "org" (&optional ignored))
+(declare-function org-attach "org" ())
+(declare-function org-backward-element "org" ())
+(declare-function org-backward-heading-same-level "org" (arg &optional invisible-ok))
+(declare-function org-backward-paragraph "org" ())
+(declare-function org-backward-sentence "org" (&optional arg))
+(declare-function org-beginning-of-line "org" (&optional n))
+(declare-function org-clock-cancel "org" ())
+(declare-function org-clock-display "org" (&optional arg))
+(declare-function org-clock-goto "org" (&optional select))
+(declare-function org-clock-in "org" (&optional select start-time))
+(declare-function org-clock-in-last "org" (&optional arg))
+(declare-function org-clock-out "org" (&optional switch-to-state fail-quietly at-time))
+(declare-function org-clone-subtree-with-time-shift "org" (n &optional shift))
+(declare-function org-columns "org" (&optional global columns-fmt-string))
+(declare-function org-comment-dwim "org" (arg))
+(declare-function org-copy-special "org" ())
+(declare-function org-copy-visible "org" (beg end))
+(declare-function org-ctrl-c-ctrl-c "org" (&optional arg))
+(declare-function org-ctrl-c-minus "org" ())
+(declare-function org-ctrl-c-ret "org" ())
+(declare-function org-ctrl-c-star "org" ())
+(declare-function org-ctrl-c-tab "org" (&optional arg))
+(declare-function org-cut-special "org" ())
+(declare-function org-cut-subtree "org" (&optional n))
+(declare-function org-cycle "org" (&optional arg))
+(declare-function org-cycle-agenda-files "org" ())
+(declare-function org-date-from-calendar "org" ())
+(declare-function org-dynamic-block-insert-dblock "org" (&optional arg))
+(declare-function org-dblock-update "org" (&optional arg))
+(declare-function org-deadline "org" (arg1 &optional time))
+(declare-function org-decrease-number-at-point "org" (&optional inc))
+(declare-function org-delete-backward-char "org" (n))
+(declare-function org-delete-char "org" (n))
+(declare-function org-delete-indentation "org" (&optional arg))
+(declare-function org-demote-subtree "org" ())
+(declare-function org-display-outline-path "org" (&optional file current separator just-return-string))
+(declare-function org-down-element "org" ())
+(declare-function org-edit-special "org" (&optional arg))
+(declare-function org-element-at-point "org-element" ())
+(declare-function org-element-type "org-element" (element))
+(declare-function org-emphasize "org" (&optional char))
+(declare-function org-end-of-line "org" (&optional n))
+(declare-function org-entry-put "org" (pom property value))
+(declare-function org-eval-in-calendar "org" (form &optional keepdate))
+(declare-function org-evaluate-time-range "org" (&optional to-buffer))
+(declare-function org-export-dispatch "org" (&optional arg))
+(declare-function org-feed-goto-inbox "org" (feed))
+(declare-function org-feed-update-all "org" ())
+(declare-function org-fill-paragraph "org" (&optional justify region))
+(declare-function org-find-file-at-mouse "org" (ev))
+(declare-function org-footnote-action "org" (&optional special))
+(declare-function org-force-cycle-archived "org" ())
+(declare-function org-force-self-insert "org" (n))
+(declare-function org-forward-element "org" ())
+(declare-function org-forward-heading-same-level "org" (arg &optional invisible-ok))
+(declare-function org-forward-paragraph "org" ())
+(declare-function org-forward-sentence "org" (&optional arg))
+(declare-function org-goto "org" (&optional alternative-interface))
+(declare-function org-goto-calendar "org" (&optional arg))
+(declare-function org-inc-effort "org" ())
+(declare-function org-increase-number-at-point "org" (&optional inc))
+(declare-function org-info-find-node "org" (&optional nodename))
+(declare-function org-insert-all-links "org" (arg &optional pre post))
+(declare-function org-insert-drawer "org" (&optional arg drawer))
+(declare-function org-insert-heading-respect-content "org" (&optional invisible-ok))
+(declare-function org-insert-last-stored-link "org" (arg))
+(declare-function org-insert-link "org" (&optional complete-file link-location default-description))
+(declare-function org-insert-structure-template "org" (type))
+(declare-function org-insert-todo-heading "org" (arg &optional force-heading))
+(declare-function org-insert-todo-heading-respect-content "org" (&optional force-state))
+(declare-function org-kill-line "org" (&optional arg))
+(declare-function org-kill-note-or-show-branches "org" ())
+(declare-function org-list-make-subtree "org" ())
+(declare-function org-mark-element "org" ())
+(declare-function org-mark-ring-goto "org" (&optional n))
+(declare-function org-mark-ring-push "org" (&optional pos buffer))
+(declare-function org-mark-subtree "org" (&optional up))
+(declare-function org-match-sparse-tree "org" (&optional todo-only match))
+(declare-function org-meta-return "org" (&optional arg))
+(declare-function org-metadown "org" (&optional _arg))
+(declare-function org-metaleft "org" (&optional _))
+(declare-function org-metaright "org" (&optional _arg))
+(declare-function org-metaup "org" (&optional _arg))
+(declare-function org-narrow-to-block "org" ())
+(declare-function org-narrow-to-element "org" ())
+(declare-function org-narrow-to-subtree "org" ())
+(declare-function org-next-block "org" (arg &optional backward block-regexp))
+(declare-function org-next-link "org" (&optional search-backward))
+(declare-function org-next-visible-heading "org" (arg))
+(declare-function org-open-at-mouse "org" (ev))
+(declare-function org-open-at-point "org" (&optional arg reference-buffer))
+(declare-function org-open-line "org" (n))
+(declare-function org-paste-special "org" (arg))
+(declare-function org-plot/gnuplot "org-plot" (&optional params))
+(declare-function org-previous-block "org" (arg &optional block-regexp))
+(declare-function org-previous-link "org" ())
+(declare-function org-previous-visible-heading "org" (arg))
+(declare-function org-priority "org" (&optional action show))
+(declare-function org-promote-subtree "org" ())
+(declare-function org-redisplay-inline-images "org" ())
+(declare-function org-refile "org" (&optional arg1 default-buffer rfloc msg))
+(declare-function org-refile-copy "org" ())
+(declare-function org-refile-reverse "org-refile" (&optional arg default-buffer rfloc msg))
+(declare-function org-reftex-citation "org" ())
+(declare-function org-reload "org" (&optional arg1))
+(declare-function org-remove-file "org" (&optional file))
+(declare-function org-resolve-clocks "org" (&optional only-dangling-p prompt-fn last-valid))
+(declare-function org-return "org" (&optional indent))
+(declare-function org-return-and-maybe-indent "org" ())
+(declare-function org-reveal "org" (&optional siblings))
+(declare-function org-schedule "org" (arg &optional time))
+(declare-function org-self-insert-command "org" (N))
+(declare-function org-set-effort "org" (&optional increment value))
+(declare-function org-set-property "org" (property value))
+(declare-function org-set-property-and-value "org" (use-last))
+(declare-function org-set-tags-command "org" (&optional arg))
+(declare-function org-shiftcontroldown "org" (&optional n))
+(declare-function org-shiftcontrolleft "org" ())
+(declare-function org-shiftcontrolright "org" ())
+(declare-function org-shiftcontrolup "org" (&optional n))
+(declare-function org-shiftdown "org" (&optional arg))
+(declare-function org-shiftleft "org" (&optional arg))
+(declare-function org-shiftmetadown "org" (&optional _arg))
+(declare-function org-shiftmetaleft "org" ())
+(declare-function org-shiftmetaright "org" ())
+(declare-function org-shiftmetaup "org" (&optional arg))
+(declare-function org-shiftright "org" (&optional arg))
+(declare-function org-shifttab "org" (&optional arg))
+(declare-function org-shiftup "org" (&optional arg))
+(declare-function org-show-all "org" (&optional types))
+(declare-function org-show-children "org" (&optional level))
+(declare-function org-show-subtree "org" ())
+(declare-function org-sort "org" (&optional with-case))
+(declare-function org-sparse-tree "org" (&optional arg type))
+(declare-function org-table-copy-down "org" (n))
+(declare-function org-table-create-or-convert-from-region "org" (arg))
+(declare-function org-table-create-with-table\.el "org-table" ())
+(declare-function org-table-edit-field "org" (arg))
+(declare-function org-table-eval-formula "org" (&optional arg equation suppress-align suppress-const suppress-store suppress-analysis))
+(declare-function org-table-field-info "org" (arg))
+(declare-function org-table-rotate-recalc-marks "org" (&optional newchar))
+(declare-function org-table-sum "org" (&optional beg end nlast))
+(declare-function org-table-toggle-coordinate-overlays "org" ())
+(declare-function org-table-toggle-formula-debugger "org" ())
+(declare-function org-time-stamp "org" (arg &optional inactive))
+(declare-function org-time-stamp-inactive "org" (&optional arg))
+(declare-function org-timer "org" (&optional restart no-insert))
+(declare-function org-timer-item "org" (&optional arg))
+(declare-function org-timer-pause-or-continue "org" (&optional stop))
+(declare-function org-timer-set-timer "org" (&optional opt))
+(declare-function org-timer-start "org" (&optional offset))
+(declare-function org-timer-stop "org" ())
+(declare-function org-todo "org" (&optional arg1))
+(declare-function org-toggle-archive-tag "org" (&optional find-done))
+(declare-function org-toggle-checkbox "org" (&optional toggle-presence))
+(declare-function org-toggle-radio-button "org" (&optional arg))
+(declare-function org-toggle-comment "org" ())
+(declare-function org-toggle-fixed-width "org" ())
+(declare-function org-toggle-inline-images "org" (&optional include-linked))
+(declare-function org-latex-preview "org" (&optional arg))
+(declare-function org-toggle-narrow-to-subtree "org" ())
+(declare-function org-toggle-ordered-property "org" ())
+(declare-function org-toggle-pretty-entities "org" ())
+(declare-function org-toggle-tags-groups "org" ())
+(declare-function org-toggle-time-stamp-overlays "org" ())
+(declare-function org-transpose-element "org" ())
+(declare-function org-transpose-words "org" ())
+(declare-function org-tree-to-indirect-buffer "org" (&optional arg))
+(declare-function org-up-element "org" ())
+(declare-function org-update-statistics-cookies "org" (all))
+(declare-function org-yank "org" (&optional arg))
+(declare-function orgtbl-ascii-plot "org-table" (&optional ask))
+
+
+
+;;; Variables
+
+(defvar org-mode-map (make-sparse-keymap)
+ "Keymap for Org mode.")
+
+(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-<cursor> keys for changing timestamps and priorities.
+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
+become effective."
+ :group 'org-startup
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-use-extra-keys nil
+ "Non-nil means use extra key sequence definitions for certain commands.
+This happens automatically if `window-system' is nil. This
+variable lets you do the same manually. You must set it before
+loading Org."
+ :group 'org-startup
+ :type 'boolean
+ :safe #'booleanp)
+
+(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 left)] . [(meta shift -)]))
+ "Keys for which Org mode and other modes compete.
+This is an alist, cars are the default keys, second element specifies
+the alternative to use when `org-replace-disputed-keys' is t.
+
+Keys can be specified in any syntax supported by `define-key'.
+The value of this option takes effect only at Org mode startup,
+therefore you'll have to restart Emacs to apply it after changing."
+ :group 'org-startup
+ :type 'alist)
+
+(defcustom org-mouse-1-follows-link
+ (if (boundp 'mouse-1-click-follows-link) mouse-1-click-follows-link t)
+ "Non-nil means mouse-1 on a link will follow the link.
+A longer mouse click will still set point. Needs to be set
+before org.el is loaded."
+ :group 'org-link-follow
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(choice
+ (const :tag "A double click follows the link" double)
+ (const :tag "Unconditionally follow the link with mouse-1" t)
+ (integer :tag "mouse-1 click does not follow the link if longer than N ms" 450)))
+
+(defcustom org-tab-follows-link nil
+ "Non-nil means on links TAB will follow the link.
+Needs to be set before Org is loaded.
+This really should not be used, it does not make sense, and the
+implementation is bad."
+ :group 'org-link-follow
+ :type 'boolean)
+
+(defcustom org-follow-link-hook nil
+ "Hook that is run after a link has been followed."
+ :group 'org-link-follow
+ :type 'hook)
+
+(defcustom org-return-follows-link nil
+ "Non-nil means on links RET will follow the link.
+In tables, the special behavior of RET has precedence."
+ :group 'org-link-follow
+ :type 'boolean
+ :safe #'booleanp)
+
+
+;;; Functions
+
+;;;; Base functions
+(defun org-key (key)
+ "Select key according to `org-replace-disputed-keys' and `org-disputed-keys'.
+Or return the original if not disputed."
+ (when org-replace-disputed-keys
+ (let* ((nkey (key-description key))
+ (x (cl-find-if (lambda (x) (equal (key-description (car x)) nkey))
+ org-disputed-keys)))
+ (setq key (if x (cdr x) key))))
+ key)
+
+(defun org-defkey (keymap key def)
+ "Define a key, possibly translated, as returned by `org-key'."
+ (define-key keymap (org-key key) def))
+
+(defun org-remap (map &rest commands)
+ "In MAP, remap the functions given in COMMANDS.
+COMMANDS is a list of alternating OLDDEF NEWDEF command names."
+ (let (new old)
+ (while commands
+ (setq old (pop commands) new (pop commands))
+ (org-defkey map (vector 'remap old) new))))
+
+
+;;; Mouse map
+
+(defvar org-mouse-map (make-sparse-keymap))
+(org-defkey org-mouse-map [mouse-2] 'org-open-at-mouse)
+(org-defkey org-mouse-map [mouse-3] 'org-find-file-at-mouse)
+
+(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 (kbd "TAB") #'org-open-at-point))
+
+
+;;; Read date map
+
+(defvar org-read-date-minibuffer-local-map
+ (let* ((map (make-sparse-keymap)))
+ (set-keymap-parent map minibuffer-local-map)
+ (org-defkey map (kbd ".")
+ (lambda () (interactive)
+ ;; Are we at the beginning of the prompt?
+ (if (looking-back "^[^:]+: "
+ (let ((inhibit-field-text-motion t))
+ (line-beginning-position)))
+ (org-eval-in-calendar '(calendar-goto-today))
+ (insert "."))))
+ (org-defkey map (kbd "C-.")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-goto-today))))
+ (org-defkey map (kbd "M-S-<left>")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-backward-month 1))))
+ (org-defkey map (kbd "ESC S-<left>")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-backward-month 1))))
+ (org-defkey map (kbd "M-S-<right>")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-forward-month 1))))
+ (org-defkey map (kbd "ESC S-<right>")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-forward-month 1))))
+ (org-defkey map (kbd "M-S-<up>")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-backward-year 1))))
+ (org-defkey map (kbd "ESC S-<up>")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-backward-year 1))))
+ (org-defkey map (kbd "M-S-<down>")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-forward-year 1))))
+ (org-defkey map (kbd "ESC S-<down>")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-forward-year 1))))
+ (org-defkey map (kbd "S-<up>")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-backward-week 1))))
+ (org-defkey map (kbd "S-<down>")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-forward-week 1))))
+ (org-defkey map (kbd "S-<left>")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-backward-day 1))))
+ (org-defkey map (kbd "S-<right>")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-forward-day 1))))
+ (org-defkey map (kbd "!")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(diary-view-entries))
+ (message "")))
+ (org-defkey map (kbd ">")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-scroll-left 1))))
+ (org-defkey map (kbd "<")
+ (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-scroll-right 1))))
+ (org-defkey map (kbd "C-v")
+ (lambda () (interactive)
+ (org-eval-in-calendar
+ '(calendar-scroll-left-three-months 1))))
+ (org-defkey map (kbd "M-v")
+ (lambda () (interactive)
+ (org-eval-in-calendar
+ '(calendar-scroll-right-three-months 1))))
+ map)
+ "Keymap for minibuffer commands when using `org-read-date'.")
+
+
+;;; Global bindings
+
+;;;; Outline functions
+(define-key org-mode-map [menu-bar headings] 'undefined)
+(define-key org-mode-map [menu-bar hide] 'undefined)
+(define-key org-mode-map [menu-bar show] 'undefined)
+
+(define-key org-mode-map [remap outline-mark-subtree] #'org-mark-subtree)
+(define-key org-mode-map [remap outline-show-subtree] #'org-show-subtree)
+(define-key org-mode-map [remap outline-forward-same-level]
+ #'org-forward-heading-same-level)
+(define-key org-mode-map [remap outline-backward-same-level]
+ #'org-backward-heading-same-level)
+(define-key org-mode-map [remap outline-show-branches]
+ #'org-kill-note-or-show-branches)
+(define-key org-mode-map [remap outline-promote] #'org-promote-subtree)
+(define-key org-mode-map [remap outline-demote] #'org-demote-subtree)
+(define-key org-mode-map [remap outline-insert-heading] #'org-ctrl-c-ret)
+(define-key org-mode-map [remap outline-next-visible-heading]
+ #'org-next-visible-heading)
+(define-key org-mode-map [remap outline-previous-visible-heading]
+ #'org-previous-visible-heading)
+(define-key org-mode-map [remap show-children] #'org-show-children)
+
+;;;; Make `C-c C-x' a prefix key
+(org-defkey org-mode-map (kbd "C-c C-x") (make-sparse-keymap))
+
+;;;; TAB key with modifiers
+(org-defkey org-mode-map (kbd "TAB") #'org-cycle)
+(org-defkey org-mode-map (kbd "C-c C-<tab>") #'org-force-cycle-archived)
+;; Override text-mode binding to expose `complete-symbol' for
+;; pcomplete functionality.
+(org-defkey org-mode-map (kbd "M-TAB") nil)
+(org-defkey org-mode-map (kbd "ESC TAB") nil)
+
+(org-defkey org-mode-map (kbd "S-TAB") #'org-shifttab)
+(define-key org-mode-map (kbd "<backtab>") #'org-shifttab)
+
+;;;; RET/<return> key with modifiers
+(org-defkey org-mode-map (kbd "S-<return>") #'org-table-copy-down)
+(org-defkey org-mode-map (kbd "S-RET") #'org-table-copy-down)
+(org-defkey org-mode-map (kbd "M-S-<return>") #'org-insert-todo-heading)
+(org-defkey org-mode-map (kbd "M-S-RET") #'org-insert-todo-heading)
+(org-defkey org-mode-map (kbd "M-RET") #'org-meta-return)
+
+;;;; Cursor keys with modifiers
+(org-defkey org-mode-map (kbd "M-<left>") #'org-metaleft)
+(org-defkey org-mode-map (kbd "M-<right>") #'org-metaright)
+(org-defkey org-mode-map (kbd "ESC <right>") #'org-metaright)
+(org-defkey org-mode-map (kbd "M-<up>") #'org-metaup)
+(org-defkey org-mode-map (kbd "ESC <up>") #'org-metaup)
+(org-defkey org-mode-map (kbd "M-<down>") #'org-metadown)
+(org-defkey org-mode-map (kbd "ESC <down>") #'org-metadown)
+
+(org-defkey org-mode-map (kbd "C-M-S-<right>") #'org-increase-number-at-point)
+(org-defkey org-mode-map (kbd "C-M-S-<left>") #'org-decrease-number-at-point)
+(org-defkey org-mode-map (kbd "M-S-<left>") #'org-shiftmetaleft)
+(org-defkey org-mode-map (kbd "ESC S-<left>") #'org-shiftmetaleft)
+(org-defkey org-mode-map (kbd "M-S-<right>") #'org-shiftmetaright)
+(org-defkey org-mode-map (kbd "ESC S-<right>") #'org-shiftmetaright)
+(org-defkey org-mode-map (kbd "M-S-<up>") #'org-shiftmetaup)
+(org-defkey org-mode-map (kbd "ESC S-<up>") #'org-shiftmetaup)
+(org-defkey org-mode-map (kbd "M-S-<down>") #'org-shiftmetadown)
+(org-defkey org-mode-map (kbd "ESC S-<down>") #'org-shiftmetadown)
+
+(org-defkey org-mode-map (kbd "S-<up>") #'org-shiftup)
+(org-defkey org-mode-map (kbd "S-<down>") #'org-shiftdown)
+(org-defkey org-mode-map (kbd "S-<left>") #'org-shiftleft)
+(org-defkey org-mode-map (kbd "S-<right>") #'org-shiftright)
+
+(org-defkey org-mode-map (kbd "C-S-<right>") #'org-shiftcontrolright)
+(org-defkey org-mode-map (kbd "C-S-<left>") #'org-shiftcontrolleft)
+(org-defkey org-mode-map (kbd "C-S-<up>") #'org-shiftcontrolup)
+(org-defkey org-mode-map (kbd "C-S-<down>") #'org-shiftcontroldown)
+
+;;;; 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 (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 <left>") #'org-metaleft)
+ (org-defkey org-mode-map (kbd "C-c C-x l") #'org-metaleft)
+ (org-defkey org-mode-map (kbd "ESC <right>") #'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 <up>") #'org-shiftup)
+ (org-defkey org-mode-map (kbd "C-c <down>") #'org-shiftdown)
+ (org-defkey org-mode-map (kbd "C-c <left>") #'org-shiftleft)
+ (org-defkey org-mode-map (kbd "C-c <right>") #'org-shiftright)
+ (org-defkey org-mode-map (kbd "C-c C-x <right>") #'org-shiftcontrolright)
+ (org-defkey org-mode-map (kbd "C-c C-x <left>") #'org-shiftcontrolleft))
+
+;;;; Narrowing bindings
+(org-defkey org-mode-map (kbd "C-x n s") #'org-narrow-to-subtree)
+(org-defkey org-mode-map (kbd "C-x n b") #'org-narrow-to-block)
+(org-defkey org-mode-map (kbd "C-x n 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
+ '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-refile-copy)
+(org-defkey org-mode-map (kbd "C-c C-M-w") #'org-refile-reverse)
+(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-<return>") #'org-insert-heading-respect-content)
+(org-defkey org-mode-map (kbd "C-S-<return>") #'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-and-maybe-indent)
+(org-defkey org-mode-map (kbd "C-c ?") #'org-table-field-info)
+(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 x") #'org-dynamic-block-insert-dblock)
+(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-latex-preview)
+(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 C-r") #'org-toggle-radio-button)
+(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-,") #'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-cite-insert)
+(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 keys
+
+(defcustom org-use-speed-commands nil
+ "Non-nil means activate single letter commands at beginning of a headline.
+This may also be a function to test for appropriate locations where speed
+commands should be active.
+
+For example, to activate speed commands when the point is on any
+star at the beginning of the headline, you can do this:
+
+ (setq org-use-speed-commands
+ (lambda () (and (looking-at org-outline-regexp) (looking-back \"^\\**\"))))"
+ :group 'org-structure
+ :type '(choice
+ (const :tag "Never" nil)
+ (const :tag "At beginning of headline stars" t)
+ (function)))
+
+(defcustom org-speed-command-hook
+ '(org-speed-command-activate org-babel-speed-command-activate)
+ "Hook for activating speed commands at strategic locations.
+Hook functions are called in sequence until a valid handler is
+found.
+
+Each hook takes a single argument, a user-pressed command key
+which is also a `self-insert-command' from the global map.
+
+Within the hook, examine the cursor position and the command key
+and return nil or a valid handler as appropriate. Handler could
+be one of an interactive command, a function, or a form.
+
+Set `org-use-speed-commands' to non-nil value to enable this
+hook. The default setting is `org-speed-command-activate'."
+ :group 'org-structure
+ :version "24.1"
+ :type 'hook)
+
+(defcustom org-speed-commands
+ '(("Outline Navigation")
+ ("n" . (org-speed-move-safe 'org-next-visible-heading))
+ ("p" . (org-speed-move-safe 'org-previous-visible-heading))
+ ("f" . (org-speed-move-safe 'org-forward-heading-same-level))
+ ("b" . (org-speed-move-safe 'org-backward-heading-same-level))
+ ("F" . org-next-block)
+ ("B" . org-previous-block)
+ ("u" . (org-speed-move-safe 'outline-up-heading))
+ ("j" . org-goto)
+ ("g" . (org-refile '(4)))
+ ("Outline Visibility")
+ ("c" . org-cycle)
+ ("C" . org-shifttab)
+ (" " . org-display-outline-path)
+ ("s" . org-toggle-narrow-to-subtree)
+ ("k" . org-cut-subtree)
+ ("=" . org-columns)
+ ("Outline Structure Editing")
+ ("U" . org-metaup)
+ ("D" . org-metadown)
+ ("r" . org-metaright)
+ ("l" . org-metaleft)
+ ("R" . org-shiftmetaright)
+ ("L" . org-shiftmetaleft)
+ ("i" . (progn (forward-char 1) (call-interactively 'org-insert-heading-respect-content)))
+ ("^" . org-sort)
+ ("w" . org-refile)
+ ("a" . org-archive-subtree-default-with-confirmation)
+ ("@" . org-mark-subtree)
+ ("#" . org-toggle-comment)
+ ("Clock Commands")
+ ("I" . org-clock-in)
+ ("O" . org-clock-out)
+ ("Meta Data Editing")
+ ("t" . org-todo)
+ ("," . (org-priority))
+ ("0" . (org-priority ?\ ))
+ ("1" . (org-priority ?A))
+ ("2" . (org-priority ?B))
+ ("3" . (org-priority ?C))
+ (":" . org-set-tags-command)
+ ("e" . org-set-effort)
+ ("E" . org-inc-effort)
+ ("W" . (lambda (m) (interactive "sMinutes before warning: ") (org-entry-put (point) "APPT_WARNTIME" m)))
+ ("Agenda Views etc")
+ ("v" . org-agenda)
+ ("/" . org-sparse-tree)
+ ("Misc")
+ ("o" . org-open-at-point)
+ ("?" . org-speed-command-help)
+ ("<" . (org-agenda-set-restriction-lock 'subtree))
+ (">" . (org-agenda-remove-restriction-lock)))
+ "Alist of speed commands.
+
+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.
+
+An entry that is just a list with a single string will be
+interpreted as a descriptive headline that will be added when
+listing the speed commands in the Help buffer using the `?' speed
+command."
+ :group 'org-structure
+ :package-version '(Org . "9.5")
+ :type '(repeat :value ("k" . ignore)
+ (choice :value ("k" . ignore)
+ (list :tag "Descriptive Headline" (string :tag "Headline"))
+ (cons :tag "Letter and Command"
+ (string :tag "Command letter")
+ (choice
+ (function)
+ (sexp))))))
+
+(defun org-print-speed-command (e)
+ (if (> (length (car e)) 1)
+ (progn
+ (princ "\n")
+ (princ (car e))
+ (princ "\n")
+ (princ (make-string (length (car e)) ?-))
+ (princ "\n"))
+ (princ (car e))
+ (princ " ")
+ (if (symbolp (cdr e))
+ (princ (symbol-name (cdr e)))
+ (prin1 (cdr e)))
+ (princ "\n")))
+
+(defun org-speed-command-help ()
+ "Show the available speed commands."
+ (interactive)
+ (unless org-use-speed-commands
+ (user-error "Speed commands are not activated, customize `org-use-speed-commands'"))
+ ;; FIXME: remove this warning for 9.6
+ (when (boundp 'org-speed-commands-user)
+ (message "`org-speed-command-user' is obsolete, please use `org-speed-commands'")
+ (sit-for 3))
+ (with-output-to-temp-buffer "*Help*"
+ (princ "Speed commands\n==============\n")
+ (mapc #'org-print-speed-command
+ ;; FIXME: don't check `org-speed-commands-user' past 9.6
+ (if (boundp 'org-speed-commands-user)
+ (append org-speed-commands
+ org-speed-commands-user)
+ org-speed-commands)))
+ (with-current-buffer "*Help*"
+ (setq truncate-lines t)))
+
+(defun org-speed-move-safe (cmd)
+ "Execute CMD, but make sure that the cursor always ends up in a headline.
+If not, return to the original position and throw an error."
+ (interactive)
+ (let ((pos (point)))
+ (call-interactively cmd)
+ (unless (and (bolp) (org-at-heading-p))
+ (goto-char pos)
+ (error "Boundary reached while executing %s" cmd))))
+
+(defun org-speed-command-activate (keys)
+ "Hook for activating single-letter speed commands.
+See `org-speed-commands' for configuring them."
+ (when (or (and (bolp) (looking-at org-outline-regexp))
+ (and (functionp org-use-speed-commands)
+ (funcall org-use-speed-commands)))
+ (cdr (assoc keys
+ ;; FIXME: don't check `org-speed-commands-user' past 9.6
+ (if (boundp 'org-speed-commands-user)
+ (append org-speed-commands
+ org-speed-commands-user)
+ org-speed-commands)))))
+
+
+;;; Babel speed keys
+
+(defvar org-babel-key-prefix "\C-c\C-v"
+ "The key prefix for Babel interactive key-bindings.
+See `org-babel-key-bindings' for the list of interactive Babel
+functions which are assigned key bindings, and see
+`org-babel-map' for the actual babel keymap.")
+
+(defvar org-babel-map (make-sparse-keymap)
+ "The keymap for interactive Babel functions.")
+
+(defvar org-babel-key-bindings
+ '(("p" . org-babel-previous-src-block)
+ ("\C-p" . org-babel-previous-src-block)
+ ("n" . org-babel-next-src-block)
+ ("\C-n" . org-babel-next-src-block)
+ ("e" . org-babel-execute-maybe)
+ ("\C-e" . org-babel-execute-maybe)
+ ("o" . org-babel-open-src-block-result)
+ ("\C-o" . org-babel-open-src-block-result)
+ ("\C-v" . org-babel-expand-src-block)
+ ("v" . org-babel-expand-src-block)
+ ("u" . org-babel-goto-src-block-head)
+ ("\C-u" . org-babel-goto-src-block-head)
+ ("g" . org-babel-goto-named-src-block)
+ ("r" . org-babel-goto-named-result)
+ ("\C-r" . org-babel-goto-named-result)
+ ("\C-b" . org-babel-execute-buffer)
+ ("b" . org-babel-execute-buffer)
+ ("\C-s" . org-babel-execute-subtree)
+ ("s" . org-babel-execute-subtree)
+ ("\C-d" . org-babel-demarcate-block)
+ ("d" . org-babel-demarcate-block)
+ ("\C-t" . org-babel-tangle)
+ ("t" . org-babel-tangle)
+ ("\C-f" . org-babel-tangle-file)
+ ("f" . org-babel-tangle-file)
+ ("\C-c" . org-babel-check-src-block)
+ ("c" . org-babel-check-src-block)
+ ("\C-j" . org-babel-insert-header-arg)
+ ("j" . org-babel-insert-header-arg)
+ ("\C-l" . org-babel-load-in-session)
+ ("l" . org-babel-load-in-session)
+ ("\C-i" . org-babel-lob-ingest)
+ ("i" . org-babel-lob-ingest)
+ ("\C-I" . org-babel-view-src-block-info)
+ ("I" . org-babel-view-src-block-info)
+ ("\C-z" . org-babel-switch-to-session)
+ ("z" . org-babel-switch-to-session-with-code)
+ ("\C-a" . org-babel-sha1-hash)
+ ("a" . org-babel-sha1-hash)
+ ("h" . org-babel-describe-bindings)
+ ("\C-x" . org-babel-do-key-sequence-in-edit-buffer)
+ ("x" . org-babel-do-key-sequence-in-edit-buffer)
+ ("k" . org-babel-remove-result-one-or-many)
+ ("\C-\M-h" . org-babel-mark-block))
+ "Alist of key bindings and interactive Babel functions.
+This list associates interactive Babel functions
+with keys. Each element of this list will add an entry to the
+`org-babel-map' using the letter key which is the `car' of the
+a-list placed behind the generic `org-babel-key-prefix'.")
+
+(define-key org-mode-map org-babel-key-prefix org-babel-map)
+(pcase-dolist (`(,key . ,def) org-babel-key-bindings)
+ (define-key org-babel-map key def))
+
+(defun org-babel-speed-command-activate (keys)
+ "Hook for activating single-letter code block commands."
+ (when (and (bolp)
+ (let ((case-fold-search t)) (looking-at "[ \t]*#\\+begin_src"))
+ (eq 'src-block (org-element-type (org-element-at-point))))
+ (cdr (assoc keys org-babel-key-bindings))))
+
+;;;###autoload
+(defun org-babel-describe-bindings ()
+ "Describe all keybindings behind `org-babel-key-prefix'."
+ (interactive)
+ (describe-bindings org-babel-key-prefix))
+
+(provide 'org-keys)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-keys.el ends here
diff --git a/elpa/org-9.5.2/org-keys.elc b/elpa/org-9.5.2/org-keys.elc
new file mode 100644
index 0000000..7249255
--- /dev/null
+++ b/elpa/org-9.5.2/org-keys.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-lint.el b/elpa/org-9.5.2/org-lint.el
new file mode 100644
index 0000000..da5e6ae
--- /dev/null
+++ b/elpa/org-9.5.2/org-lint.el
@@ -0,0 +1,1321 @@
+;;; org-lint.el --- Linting for Org documents -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library implements linting for Org syntax. The sole public
+;; function is `org-lint', which see.
+
+;; Internally, the library defines a new structure:
+;; `org-lint-checker', with the following slots:
+
+;; - NAME: Unique check identifier, as a non-nil symbol that doesn't
+;; start with an hyphen.
+;;
+;; The check is done calling the function `org-lint-NAME' with one
+;; mandatory argument, the parse tree describing the current Org
+;; buffer. Such function calls are wrapped within
+;; a `save-excursion' and point is always at `point-min'. Its
+;; return value has to be an alist (POSITION MESSAGE) when
+;; POSITION refer to the buffer position of the error, as an
+;; integer, and MESSAGE is a string describing the error.
+
+;; - DESCRIPTION: Summary about the check, as a string.
+
+;; - CATEGORIES: Categories relative to the check, as a list of
+;; symbol. They are used for filtering when calling `org-lint'.
+;; Checkers not explicitly associated to a category are collected
+;; in the `default' one.
+
+;; - TRUST: The trust level one can have in the check. It is either
+;; `low' or `high', depending on the heuristics implemented and
+;; the nature of the check. This has an indicative value only and
+;; is displayed along reports.
+
+;; All checks have to be listed in `org-lint--checkers'.
+
+;; Results are displayed in a special "*Org Lint*" buffer with
+;; a dedicated major mode, derived from `tabulated-list-mode'.
+;;
+;; In addition to the usual key-bindings inherited from it, "C-j" and
+;; "TAB" display problematic line reported under point whereas "RET"
+;; jumps to it. Also, "h" hides all reports similar to the current
+;; one. Additionally, "i" removes them from subsequent reports.
+
+;; Checks currently implemented are:
+
+;; - duplicate CUSTOM_ID properties
+;; - duplicate NAME values
+;; - duplicate targets
+;; - duplicate footnote definitions
+;; - orphaned affiliated keywords
+;; - obsolete affiliated keywords
+;; - 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 source blocks
+;; - misuse of CATEGORY keyword
+;; - "coderef" links with unknown destination
+;; - "custom-id" links with unknown destination
+;; - "fuzzy" links with unknown destination
+;; - "id" links with unknown destination
+;; - links to non-existent local files
+;; - SETUPFILE keywords with non-existent file parameter
+;; - INCLUDE keywords with wrong link parameter
+;; - obsolete markup in INCLUDE keyword
+;; - unknown items in OPTIONS keyword
+;; - spurious macro arguments or invalid macro templates
+;; - special properties in properties drawer
+;; - obsolete syntax for PROPERTIES drawers
+;; - Invalid EFFORT property value
+;; - missing definition for footnote references
+;; - missing reference for footnote definitions
+;; - non-footnote definitions in footnote section
+;; - probable invalid keywords
+;; - invalid blocks
+;; - misplaced planning info line
+;; - incomplete drawers
+;; - indented diary-sexps
+;; - obsolete QUOTE section
+;; - obsolete "file+application" link
+;; - spurious colons in tags
+
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ob)
+(require 'ol)
+(require 'org-attach)
+(require 'org-macro)
+(require 'ox)
+
+
+;;; Checkers
+
+(cl-defstruct (org-lint-checker (:copier nil))
+ (name 'missing-checker-name)
+ (description "")
+ (categories '(default))
+ (trust 'high)) ; `low' or `high'
+
+(defun org-lint-missing-checker-name (_)
+ (error
+ "`A checker has no `:name' property. Please verify `org-lint--checkers'"))
+
+(defconst org-lint--checkers
+ (list
+ (make-org-lint-checker
+ :name 'duplicate-custom-id
+ :description "Report duplicates CUSTOM_ID properties"
+ :categories '(link))
+ (make-org-lint-checker
+ :name 'duplicate-name
+ :description "Report duplicate NAME values"
+ :categories '(babel link))
+ (make-org-lint-checker
+ :name 'duplicate-target
+ :description "Report duplicate targets"
+ :categories '(link))
+ (make-org-lint-checker
+ :name 'duplicate-footnote-definition
+ :description "Report duplicate footnote definitions"
+ :categories '(footnote))
+ (make-org-lint-checker
+ :name 'orphaned-affiliated-keywords
+ :description "Report orphaned affiliated keywords"
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'obsolete-affiliated-keywords
+ :description "Report obsolete affiliated keywords"
+ :categories '(obsolete))
+ (make-org-lint-checker
+ :name 'deprecated-export-blocks
+ :description "Report deprecated export block syntax"
+ :categories '(obsolete export)
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'deprecated-header-syntax
+ :description "Report deprecated Babel header syntax"
+ :categories '(obsolete babel)
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'missing-language-in-src-block
+ :description "Report missing language in source blocks"
+ :categories '(babel))
+ (make-org-lint-checker
+ :name 'missing-backend-in-export-block
+ :description "Report missing back-end in export blocks"
+ :categories '(export))
+ (make-org-lint-checker
+ :name 'invalid-babel-call-block
+ :description "Report invalid Babel call blocks"
+ :categories '(babel))
+ (make-org-lint-checker
+ :name 'colon-in-name
+ :description "Report NAME values with a colon"
+ :categories '(babel))
+ (make-org-lint-checker
+ :name 'wrong-header-argument
+ :description "Report wrong babel headers"
+ :categories '(babel))
+ (make-org-lint-checker
+ :name 'wrong-header-value
+ :description "Report invalid value in babel headers"
+ :categories '(babel)
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'deprecated-category-setup
+ :description "Report misuse of CATEGORY keyword"
+ :categories '(obsolete))
+ (make-org-lint-checker
+ :name 'invalid-coderef-link
+ :description "Report \"coderef\" links with unknown destination"
+ :categories '(link))
+ (make-org-lint-checker
+ :name 'invalid-custom-id-link
+ :description "Report \"custom-id\" links with unknown destination"
+ :categories '(link))
+ (make-org-lint-checker
+ :name 'invalid-fuzzy-link
+ :description "Report \"fuzzy\" links with unknown destination"
+ :categories '(link))
+ (make-org-lint-checker
+ :name 'invalid-id-link
+ :description "Report \"id\" links with unknown destination"
+ :categories '(link))
+ (make-org-lint-checker
+ :name 'link-to-local-file
+ :description "Report links to non-existent local files"
+ :categories '(link)
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'non-existent-setupfile-parameter
+ :description "Report SETUPFILE keywords with non-existent file parameter"
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'wrong-include-link-parameter
+ :description "Report INCLUDE keywords with misleading link parameter"
+ :categories '(export)
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'obsolete-include-markup
+ :description "Report obsolete markup in INCLUDE keyword"
+ :categories '(obsolete export)
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'unknown-options-item
+ :description "Report unknown items in OPTIONS keyword"
+ :categories '(export)
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'invalid-macro-argument-and-template
+ :description "Report spurious macro arguments or invalid macro templates"
+ :categories '(export)
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'special-property-in-properties-drawer
+ :description "Report special properties in properties drawers"
+ :categories '(properties))
+ (make-org-lint-checker
+ :name 'obsolete-properties-drawer
+ :description "Report obsolete syntax for properties drawers"
+ :categories '(obsolete properties))
+ (make-org-lint-checker
+ :name 'invalid-effort-property
+ :description "Report invalid duration in EFFORT property"
+ :categories '(properties))
+ (make-org-lint-checker
+ :name 'undefined-footnote-reference
+ :description "Report missing definition for footnote references"
+ :categories '(footnote))
+ (make-org-lint-checker
+ :name 'unreferenced-footnote-definition
+ :description "Report missing reference for footnote definitions"
+ :categories '(footnote))
+ (make-org-lint-checker
+ :name 'extraneous-element-in-footnote-section
+ :description "Report non-footnote definitions in footnote section"
+ :categories '(footnote))
+ (make-org-lint-checker
+ :name 'invalid-keyword-syntax
+ :description "Report probable invalid keywords"
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'invalid-block
+ :description "Report invalid blocks"
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'misplaced-planning-info
+ :description "Report misplaced planning info line"
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'incomplete-drawer
+ :description "Report probable incomplete drawers"
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'indented-diary-sexp
+ :description "Report probable indented diary-sexps"
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'quote-section
+ :description "Report obsolete QUOTE section"
+ :categories '(obsolete)
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'file-application
+ :description "Report obsolete \"file+application\" link"
+ :categories '(link obsolete))
+ (make-org-lint-checker
+ :name 'percent-encoding-link-escape
+ :description "Report obsolete escape syntax in links"
+ :categories '(link obsolete)
+ :trust 'low)
+ (make-org-lint-checker
+ :name 'spurious-colons
+ :description "Report spurious colons in tags"
+ :categories '(tags)))
+ "List of all available checkers.")
+
+(defun org-lint--collect-duplicates
+ (ast type extract-key extract-position build-message)
+ "Helper function to collect duplicates in parse tree AST.
+
+EXTRACT-KEY is a function extracting key. It is called with
+a single argument: the element or object. Comparison is done
+with `equal'.
+
+EXTRACT-POSITION is a function returning position for the report.
+It is called with two arguments, the object or element, and the
+key.
+
+BUILD-MESSAGE is a function creating the report message. It is
+called with one argument, the key used for comparison."
+ (let* (keys
+ originals
+ reports
+ (make-report
+ (lambda (position value)
+ (push (list position (funcall build-message value)) reports))))
+ (org-element-map ast type
+ (lambda (datum)
+ (let ((key (funcall extract-key datum)))
+ (cond
+ ((not key))
+ ((assoc key keys) (cl-pushnew (assoc key keys) originals)
+ (funcall make-report (funcall extract-position datum key) key))
+ (t (push (cons key (funcall extract-position datum key)) keys))))))
+ (dolist (e originals reports) (funcall make-report (cdr e) (car e)))))
+
+(defun org-lint-duplicate-custom-id (ast)
+ (org-lint--collect-duplicates
+ ast
+ 'node-property
+ (lambda (property)
+ (and (eq (compare-strings "CUSTOM_ID" nil nil
+ (org-element-property :key property) nil nil
+ t)
+ t)
+ (org-element-property :value property)))
+ (lambda (property _) (org-element-property :begin property))
+ (lambda (key) (format "Duplicate CUSTOM_ID property \"%s\"" key))))
+
+(defun org-lint-duplicate-name (ast)
+ (org-lint--collect-duplicates
+ ast
+ org-element-all-elements
+ (lambda (datum) (org-element-property :name datum))
+ (lambda (datum name)
+ (goto-char (org-element-property :begin datum))
+ (re-search-forward
+ (format "^[ \t]*#\\+[A-Za-z]+:[ \t]*%s[ \t]*$" (regexp-quote name)))
+ (match-beginning 0))
+ (lambda (key) (format "Duplicate NAME \"%s\"" key))))
+
+(defun org-lint-duplicate-target (ast)
+ (org-lint--collect-duplicates
+ ast
+ 'target
+ (lambda (target) (split-string (org-element-property :value target)))
+ (lambda (target _) (org-element-property :begin target))
+ (lambda (key)
+ (format "Duplicate target <<%s>>" (mapconcat #'identity key " ")))))
+
+(defun org-lint-duplicate-footnote-definition (ast)
+ (org-lint--collect-duplicates
+ ast
+ 'footnote-definition
+ (lambda (definition) (org-element-property :label definition))
+ (lambda (definition _) (org-element-property :post-affiliated definition))
+ (lambda (key) (format "Duplicate footnote definition \"%s\"" key))))
+
+(defun org-lint-orphaned-affiliated-keywords (ast)
+ ;; Ignore orphan RESULTS keywords, which could be generated from
+ ;; a source block returning no value.
+ (let ((keywords (cl-set-difference org-element-affiliated-keywords
+ '("RESULT" "RESULTS")
+ :test #'equal)))
+ (org-element-map ast 'keyword
+ (lambda (k)
+ (let ((key (org-element-property :key k)))
+ (and (or (let ((case-fold-search t))
+ (string-match-p "\\`ATTR_[-_A-Za-z0-9]+\\'" key))
+ (member key keywords))
+ (list (org-element-property :post-affiliated k)
+ (format "Orphaned affiliated keyword: \"%s\"" key))))))))
+
+(defun org-lint-obsolete-affiliated-keywords (_)
+ (let ((regexp (format "^[ \t]*#\\+%s:"
+ (regexp-opt '("DATA" "LABEL" "RESNAME" "SOURCE"
+ "SRCNAME" "TBLNAME" "RESULT" "HEADERS")
+ t)))
+ reports)
+ (while (re-search-forward regexp nil t)
+ (let ((key (upcase (match-string-no-properties 1))))
+ (when (< (point)
+ (org-element-property :post-affiliated (org-element-at-point)))
+ (push
+ (list (line-beginning-position)
+ (format
+ "Obsolete affiliated keyword: \"%s\". Use \"%s\" instead"
+ key
+ (pcase key
+ ("HEADERS" "HEADER")
+ ("RESULT" "RESULTS")
+ (_ "NAME"))))
+ reports))))
+ reports))
+
+(defun org-lint-deprecated-export-blocks (ast)
+ (let ((deprecated '("ASCII" "BEAMER" "HTML" "LATEX" "MAN" "MARKDOWN" "MD"
+ "ODT" "ORG" "TEXINFO")))
+ (org-element-map ast 'special-block
+ (lambda (b)
+ (let ((type (org-element-property :type b)))
+ (when (member-ignore-case type deprecated)
+ (list
+ (org-element-property :post-affiliated b)
+ (format
+ "Deprecated syntax for export block. Use \"BEGIN_EXPORT %s\" \
+instead"
+ type))))))))
+
+(defun org-lint-deprecated-header-syntax (ast)
+ (let* ((deprecated-babel-properties
+ ;; DIR is also used for attachments.
+ (delete "dir"
+ (mapcar (lambda (arg) (downcase (symbol-name (car arg))))
+ org-babel-common-header-args-w-values)))
+ (deprecated-re
+ (format "\\`%s[ \t]" (regexp-opt deprecated-babel-properties t))))
+ (org-element-map ast '(keyword node-property)
+ (lambda (datum)
+ (let ((key (org-element-property :key datum)))
+ (pcase (org-element-type datum)
+ (`keyword
+ (let ((value (org-element-property :value datum)))
+ (and (string= key "PROPERTY")
+ (string-match deprecated-re value)
+ (list (org-element-property :begin datum)
+ (format "Deprecated syntax for \"%s\". \
+Use header-args instead"
+ (match-string-no-properties 1 value))))))
+ (`node-property
+ (and (member-ignore-case key deprecated-babel-properties)
+ (list
+ (org-element-property :begin datum)
+ (format "Deprecated syntax for \"%s\". \
+Use :header-args: instead"
+ key))))))))))
+
+(defun org-lint-missing-language-in-src-block (ast)
+ (org-element-map ast 'src-block
+ (lambda (b)
+ (unless (org-element-property :language b)
+ (list (org-element-property :post-affiliated b)
+ "Missing language in source block")))))
+
+(defun org-lint-missing-backend-in-export-block (ast)
+ (org-element-map ast 'export-block
+ (lambda (b)
+ (unless (org-element-property :type b)
+ (list (org-element-property :post-affiliated b)
+ "Missing back-end in export block")))))
+
+(defun org-lint-invalid-babel-call-block (ast)
+ (org-element-map ast 'babel-call
+ (lambda (b)
+ (cond
+ ((not (org-element-property :call b))
+ (list (org-element-property :post-affiliated b)
+ "Invalid syntax in babel call block"))
+ ((let ((h (org-element-property :end-header b)))
+ (and h (string-match-p "\\`\\[.*\\]\\'" h)))
+ (list
+ (org-element-property :post-affiliated b)
+ "Babel call's end header must not be wrapped within brackets"))))))
+
+(defun org-lint-deprecated-category-setup (ast)
+ (org-element-map ast 'keyword
+ (let (category-flag)
+ (lambda (k)
+ (cond
+ ((not (string= (org-element-property :key k) "CATEGORY")) nil)
+ (category-flag
+ (list (org-element-property :post-affiliated k)
+ "Spurious CATEGORY keyword. Set :CATEGORY: property instead"))
+ (t (setf category-flag t) nil))))))
+
+(defun org-lint-invalid-coderef-link (ast)
+ (let ((info (list :parse-tree ast)))
+ (org-element-map ast 'link
+ (lambda (link)
+ (let ((ref (org-element-property :path link)))
+ (and (equal (org-element-property :type link) "coderef")
+ (not (ignore-errors (org-export-resolve-coderef ref info)))
+ (list (org-element-property :begin link)
+ (format "Unknown coderef \"%s\"" ref))))))))
+
+(defun org-lint-invalid-custom-id-link (ast)
+ (let ((info (list :parse-tree ast)))
+ (org-element-map ast 'link
+ (lambda (link)
+ (and (equal (org-element-property :type link) "custom-id")
+ (not (ignore-errors (org-export-resolve-id-link link info)))
+ (list (org-element-property :begin link)
+ (format "Unknown custom ID \"%s\""
+ (org-element-property :path link))))))))
+
+(defun org-lint-invalid-fuzzy-link (ast)
+ (let ((info (list :parse-tree ast)))
+ (org-element-map ast 'link
+ (lambda (link)
+ (and (equal (org-element-property :type link) "fuzzy")
+ (not (ignore-errors (org-export-resolve-fuzzy-link link info)))
+ (list (org-element-property :begin link)
+ (format "Unknown fuzzy location \"%s\""
+ (let ((path (org-element-property :path link)))
+ (if (string-prefix-p "*" path)
+ (substring path 1)
+ path)))))))))
+
+(defun org-lint-invalid-id-link (ast)
+ (org-element-map ast 'link
+ (lambda (link)
+ (let ((id (org-element-property :path link)))
+ (and (equal (org-element-property :type link) "id")
+ (not (org-id-find id))
+ (list (org-element-property :begin link)
+ (format "Unknown ID \"%s\"" id)))))))
+
+(defun org-lint-special-property-in-properties-drawer (ast)
+ (org-element-map ast 'node-property
+ (lambda (p)
+ (let ((key (org-element-property :key p)))
+ (and (member-ignore-case key org-special-properties)
+ (list (org-element-property :begin p)
+ (format
+ "Special property \"%s\" found in a properties drawer"
+ key)))))))
+
+(defun org-lint-obsolete-properties-drawer (ast)
+ (org-element-map ast 'drawer
+ (lambda (d)
+ (when (equal (org-element-property :drawer-name d) "PROPERTIES")
+ (let ((headline? (org-element-lineage d '(headline)))
+ (before
+ (mapcar #'org-element-type
+ (assq d (reverse (org-element-contents
+ (org-element-property :parent d)))))))
+ (list (org-element-property :post-affiliated d)
+ (if (or (and headline? (member before '(nil (planning))))
+ (and (null headline?) (member before '(nil (comment)))))
+ "Incorrect contents for PROPERTIES drawer"
+ "Incorrect location for PROPERTIES drawer")))))))
+
+(defun org-lint-invalid-effort-property (ast)
+ (org-element-map ast 'node-property
+ (lambda (p)
+ (when (equal "EFFORT" (org-element-property :key p))
+ (let ((value (org-element-property :value p)))
+ (and (org-string-nw-p value)
+ (not (org-duration-p value))
+ (list (org-element-property :begin p)
+ (format "Invalid effort duration format: %S" value))))))))
+
+(defun org-lint-link-to-local-file (ast)
+ (org-element-map ast 'link
+ (lambda (l)
+ (let ((type (org-element-property :type l)))
+ (pcase type
+ ((or "attachment" "file")
+ (let* ((path (org-element-property :path l))
+ (file (if (string= type "file")
+ path
+ (org-with-point-at (org-element-property :begin l)
+ (org-attach-expand path)))))
+ (and (not (file-remote-p file))
+ (not (file-exists-p file))
+ (list (org-element-property :begin l)
+ (format (if (org-element-lineage l '(link))
+ "Link to non-existent image file %S \
+in description"
+ "Link to non-existent local file %S")
+ file)))))
+ (_ nil))))))
+
+(defun org-lint-non-existent-setupfile-parameter (ast)
+ (org-element-map ast 'keyword
+ (lambda (k)
+ (when (equal (org-element-property :key k) "SETUPFILE")
+ (let ((file (org-unbracket-string
+ "\"" "\""
+ (org-element-property :value k))))
+ (and (not (org-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))))))))
+
+(defun org-lint-wrong-include-link-parameter (ast)
+ (org-element-map ast 'keyword
+ (lambda (k)
+ (when (equal (org-element-property :key k) "INCLUDE")
+ (let* ((value (org-element-property :value k))
+ (path
+ (and (string-match "^\\(\".+\"\\|\\S-+\\)[ \t]*" value)
+ (save-match-data
+ (org-strip-quotes (match-string 1 value))))))
+ (if (not path)
+ (list (org-element-property :post-affiliated k)
+ "Missing location argument in INCLUDE keyword")
+ (let* ((file (org-string-nw-p
+ (if (string-match "::\\(.*\\)\\'" path)
+ (substring path 0 (match-beginning 0))
+ path)))
+ (search (and (not (equal file path))
+ (org-string-nw-p (match-string 1 path)))))
+ (if (and file
+ (not (file-remote-p file))
+ (not (file-exists-p file)))
+ (list (org-element-property :post-affiliated k)
+ "Non-existent file argument in INCLUDE keyword")
+ (let* ((visiting (if file (find-buffer-visiting file)
+ (current-buffer)))
+ (buffer (or visiting (find-file-noselect file)))
+ (org-link-search-must-match-exact-headline t))
+ (unwind-protect
+ (with-current-buffer buffer
+ (when (and search
+ (not (ignore-errors
+ (org-link-search search nil t))))
+ (list (org-element-property :post-affiliated k)
+ (format
+ "Invalid search part \"%s\" in INCLUDE keyword"
+ search))))
+ (unless visiting (kill-buffer buffer))))))))))))
+
+(defun org-lint-obsolete-include-markup (ast)
+ (let ((regexp (format "\\`\\(?:\".+\"\\|\\S-+\\)[ \t]+%s"
+ (regexp-opt
+ '("ASCII" "BEAMER" "HTML" "LATEX" "MAN" "MARKDOWN" "MD"
+ "ODT" "ORG" "TEXINFO")
+ t))))
+ (org-element-map ast 'keyword
+ (lambda (k)
+ (when (equal (org-element-property :key k) "INCLUDE")
+ (let ((case-fold-search t)
+ (value (org-element-property :value k)))
+ (when (string-match regexp value)
+ (let ((markup (match-string-no-properties 1 value)))
+ (list (org-element-property :post-affiliated k)
+ (format "Obsolete markup \"%s\" in INCLUDE keyword. \
+Use \"export %s\" instead"
+ markup
+ markup))))))))))
+
+(defun org-lint-unknown-options-item (ast)
+ (let ((allowed (delq nil
+ (append
+ (mapcar (lambda (o) (nth 2 o)) org-export-options-alist)
+ (cl-mapcan
+ (lambda (b)
+ (mapcar (lambda (o) (nth 2 o))
+ (org-export-backend-options b)))
+ org-export-registered-backends))))
+ reports)
+ (org-element-map ast 'keyword
+ (lambda (k)
+ (when (string= (org-element-property :key k) "OPTIONS")
+ (let ((value (org-element-property :value k))
+ (start 0))
+ (while (string-match "\\(.+?\\):\\((.*?)\\|\\S-+\\)?[ \t]*"
+ value
+ start)
+ (setf start (match-end 0))
+ (let ((item (match-string 1 value)))
+ (unless (member item allowed)
+ (push (list (org-element-property :post-affiliated k)
+ (format "Unknown OPTIONS item \"%s\"" item))
+ reports))
+ (unless (match-string 2 value)
+ (push (list (org-element-property :post-affiliated k)
+ (format "Missing value for option item %S" item))
+ reports))))))))
+ reports))
+
+(defun org-lint-invalid-macro-argument-and-template (ast)
+ (let* ((reports nil)
+ (extract-placeholders
+ (lambda (template)
+ (let ((start 0)
+ args)
+ (while (string-match "\\$\\([1-9][0-9]*\\)" template start)
+ (setf start (match-end 0))
+ (push (string-to-number (match-string 1 template)) args))
+ (sort (org-uniquify args) #'<))))
+ (check-arity
+ (lambda (arity macro)
+ (let* ((name (org-element-property :key macro))
+ (pos (org-element-property :begin macro))
+ (args (org-element-property :args macro))
+ (l (length args)))
+ (cond
+ ((< l (1- (car arity)))
+ (push (list pos (format "Missing arguments in macro %S" name))
+ reports))
+ ((< l (car arity))
+ (push (list pos (format "Missing argument in macro %S" name))
+ reports))
+ ((> l (1+ (cdr arity)))
+ (push (let ((spurious-args (nthcdr (cdr arity) args)))
+ (list pos
+ (format "Spurious arguments in macro %S: %s"
+ name
+ (mapconcat #'org-trim spurious-args ", "))))
+ reports))
+ ((> l (cdr arity))
+ (push (list pos
+ (format "Spurious argument in macro %S: %s"
+ name
+ (org-last args)))
+ reports))
+ (t nil))))))
+ ;; Check arguments for macro templates.
+ (org-element-map ast 'keyword
+ (lambda (k)
+ (when (string= (org-element-property :key k) "MACRO")
+ (let* ((value (org-element-property :value k))
+ (name (and (string-match "^\\S-+" value)
+ (match-string 0 value)))
+ (template (and name
+ (org-trim (substring value (match-end 0))))))
+ (cond
+ ((not name)
+ (push (list (org-element-property :post-affiliated k)
+ "Missing name in MACRO keyword")
+ reports))
+ ((not (org-string-nw-p template))
+ (push (list (org-element-property :post-affiliated k)
+ "Missing template in macro \"%s\"" name)
+ reports))
+ (t
+ (unless (let ((args (funcall extract-placeholders template)))
+ (equal (number-sequence 1 (or (org-last args) 0)) args))
+ (push (list (org-element-property :post-affiliated k)
+ (format "Unused placeholders in macro \"%s\""
+ name))
+ reports))))))))
+ ;; Check arguments for macros.
+ (org-macro-initialize-templates)
+ (let ((templates (append
+ (mapcar (lambda (m) (cons m "$1"))
+ '("author" "date" "email" "title" "results"))
+ org-macro-templates)))
+ (org-element-map ast 'macro
+ (lambda (macro)
+ (let* ((name (org-element-property :key macro))
+ (template (cdr (assoc-string name templates t))))
+ (pcase template
+ (`nil
+ (push (list (org-element-property :begin macro)
+ (format "Undefined macro %S" name))
+ reports))
+ ((guard (string= name "keyword"))
+ (funcall check-arity '(1 . 1) macro))
+ ((guard (string= name "modification-time"))
+ (funcall check-arity '(1 . 2) macro))
+ ((guard (string= name "n"))
+ (funcall check-arity '(0 . 2) macro))
+ ((guard (string= name "property"))
+ (funcall check-arity '(1 . 2) macro))
+ ((guard (string= name "time"))
+ (funcall check-arity '(1 . 1) macro))
+ ((pred functionp)) ;ignore (eval ...) templates
+ (_
+ (let* ((arg-numbers (funcall extract-placeholders template))
+ (arity (if (null arg-numbers)
+ '(0 . 0)
+ (let ((m (apply #'max arg-numbers)))
+ (cons m m)))))
+ (funcall check-arity arity macro))))))))
+ reports))
+
+(defun org-lint-undefined-footnote-reference (ast)
+ (let ((definitions (org-element-map ast 'footnote-definition
+ (lambda (f) (org-element-property :label f)))))
+ (org-element-map ast 'footnote-reference
+ (lambda (f)
+ (let ((label (org-element-property :label f)))
+ (and (eq 'standard (org-element-property :type f))
+ (not (member label definitions))
+ (list (org-element-property :begin f)
+ (format "Missing definition for footnote [%s]"
+ label))))))))
+
+(defun org-lint-unreferenced-footnote-definition (ast)
+ (let ((references (org-element-map ast 'footnote-reference
+ (lambda (f) (org-element-property :label f)))))
+ (org-element-map ast 'footnote-definition
+ (lambda (f)
+ (let ((label (org-element-property :label f)))
+ (and label
+ (not (member label references))
+ (list (org-element-property :post-affiliated f)
+ (format "No reference for footnote definition [%s]"
+ label))))))))
+
+(defun org-lint-colon-in-name (ast)
+ (org-element-map ast org-element-all-elements
+ (lambda (e)
+ (let ((name (org-element-property :name e)))
+ (and name
+ (string-match-p ":" name)
+ (list (progn
+ (goto-char (org-element-property :begin e))
+ (re-search-forward
+ (format "^[ \t]*#\\+\\w+: +%s *$" (regexp-quote name)))
+ (match-beginning 0))
+ (format
+ "Name \"%s\" contains a colon; Babel cannot use it as input"
+ name)))))))
+
+(defun org-lint-misplaced-planning-info (_)
+ (let ((case-fold-search t)
+ reports)
+ (while (re-search-forward org-planning-line-re nil t)
+ (unless (memq (org-element-type (org-element-at-point))
+ '(comment-block example-block export-block planning
+ src-block verse-block))
+ (push (list (line-beginning-position) "Misplaced planning info line")
+ reports)))
+ reports))
+
+(defun org-lint-incomplete-drawer (_)
+ (let (reports)
+ (while (re-search-forward org-drawer-regexp nil t)
+ (let ((name (org-trim (match-string-no-properties 0)))
+ (element (org-element-at-point)))
+ (pcase (org-element-type element)
+ (`drawer
+ ;; Find drawer opening lines within non-empty drawers.
+ (let ((end (org-element-property :contents-end element)))
+ (when end
+ (while (re-search-forward org-drawer-regexp end t)
+ (let ((n (org-trim (match-string-no-properties 0))))
+ (push (list (line-beginning-position)
+ (format "Possible misleading drawer entry %S" n))
+ reports))))
+ (goto-char (org-element-property :end element))))
+ (`property-drawer
+ (goto-char (org-element-property :end element)))
+ ((or `comment-block `example-block `export-block `src-block
+ `verse-block)
+ nil)
+ (_
+ ;; Find drawer opening lines outside of any drawer.
+ (push (list (line-beginning-position)
+ (format "Possible incomplete drawer %S" name))
+ reports)))))
+ reports))
+
+(defun org-lint-indented-diary-sexp (_)
+ (let (reports)
+ (while (re-search-forward "^[ \t]+%%(" nil t)
+ (unless (memq (org-element-type (org-element-at-point))
+ '(comment-block diary-sexp example-block export-block
+ src-block verse-block))
+ (push (list (line-beginning-position) "Possible indented diary-sexp")
+ reports)))
+ reports))
+
+(defun org-lint-invalid-block (_)
+ (let ((case-fold-search t)
+ (regexp "^[ \t]*#\\+\\(BEGIN\\|END\\)\\(?::\\|_[^[:space:]]*\\)?[ \t]*")
+ reports)
+ (while (re-search-forward regexp nil t)
+ (let ((name (org-trim (buffer-substring-no-properties
+ (line-beginning-position) (line-end-position)))))
+ (cond
+ ((and (string-prefix-p "END" (match-string 1) t)
+ (not (eolp)))
+ (push (list (line-beginning-position)
+ (format "Invalid block closing line \"%s\"" name))
+ reports))
+ ((not (memq (org-element-type (org-element-at-point))
+ '(center-block comment-block dynamic-block example-block
+ export-block quote-block special-block
+ src-block verse-block)))
+ (push (list (line-beginning-position)
+ (format "Possible incomplete block \"%s\""
+ name))
+ reports)))))
+ reports))
+
+(defun org-lint-invalid-keyword-syntax (_)
+ (let ((regexp "^[ \t]*#\\+\\([^[:space:]:]*\\)\\(?: \\|$\\)")
+ (exception-re
+ (format "[ \t]*#\\+%s\\(\\[.*\\]\\)?:\\(?: \\|$\\)"
+ (regexp-opt org-element-dual-keywords)))
+ reports)
+ (while (re-search-forward regexp nil t)
+ (let ((name (match-string-no-properties 1)))
+ (unless (or (string-prefix-p "BEGIN" name t)
+ (string-prefix-p "END" name t)
+ (save-excursion
+ (beginning-of-line)
+ (let ((case-fold-search t)) (looking-at exception-re))))
+ (push (list (match-beginning 0)
+ (format "Possible missing colon in keyword \"%s\"" name))
+ reports))))
+ reports))
+
+(defun org-lint-extraneous-element-in-footnote-section (ast)
+ (org-element-map ast 'headline
+ (lambda (h)
+ (and (org-element-property :footnote-section-p h)
+ (org-element-map (org-element-contents h)
+ (cl-remove-if
+ (lambda (e)
+ (memq e '(comment comment-block footnote-definition
+ property-drawer section)))
+ org-element-all-elements)
+ (lambda (e)
+ (not (and (eq (org-element-type e) 'headline)
+ (org-element-property :commentedp e))))
+ nil t '(footnote-definition property-drawer))
+ (list (org-element-property :begin h)
+ "Extraneous elements in footnote section are not exported")))))
+
+(defun org-lint-quote-section (ast)
+ (org-element-map ast '(headline inlinetask)
+ (lambda (h)
+ (let ((title (org-element-property :raw-value h)))
+ (and (or (string-prefix-p "QUOTE " title)
+ (string-prefix-p (concat org-comment-string " QUOTE ") title))
+ (list (org-element-property :begin h)
+ "Deprecated QUOTE section"))))))
+
+(defun org-lint-file-application (ast)
+ (org-element-map ast 'link
+ (lambda (l)
+ (let ((app (org-element-property :application l)))
+ (and app
+ (list (org-element-property :begin l)
+ (format "Deprecated \"file+%s\" link type" app)))))))
+
+(defun org-lint-percent-encoding-link-escape (ast)
+ (org-element-map ast 'link
+ (lambda (l)
+ (when (eq 'bracket (org-element-property :format l))
+ (let* ((uri (org-element-property :path l))
+ (start 0)
+ (obsolete-flag
+ (catch :obsolete
+ (while (string-match "%\\(..\\)?" uri start)
+ (setq start (match-end 0))
+ (unless (member (match-string 1 uri) '("25" "5B" "5D" "20"))
+ (throw :obsolete nil)))
+ (string-match-p "%" uri))))
+ (when obsolete-flag
+ (list (org-element-property :begin l)
+ "Link escaped with obsolete percent-encoding syntax")))))))
+
+(defun org-lint-wrong-header-argument (ast)
+ (let* ((reports)
+ (verify
+ (lambda (datum language headers)
+ (let ((allowed
+ ;; If LANGUAGE is specified, restrict allowed
+ ;; headers to both LANGUAGE-specific and default
+ ;; ones. Otherwise, accept headers from any loaded
+ ;; language.
+ (append
+ org-babel-header-arg-names
+ (cl-mapcan
+ (lambda (l)
+ (let ((v (intern (format "org-babel-header-args:%s" l))))
+ (and (boundp v) (mapcar #'car (symbol-value v)))))
+ (if language (list language)
+ (mapcar #'car org-babel-load-languages))))))
+ (dolist (header headers)
+ (let ((h (symbol-name (car header)))
+ (p (or (org-element-property :post-affiliated datum)
+ (org-element-property :begin datum))))
+ (cond
+ ((not (string-prefix-p ":" h))
+ (push
+ (list p
+ (format "Missing colon in header argument \"%s\"" h))
+ reports))
+ ((assoc-string (substring h 1) allowed))
+ (t (push (list p (format "Unknown header argument \"%s\"" h))
+ reports)))))))))
+ (org-element-map ast '(babel-call inline-babel-call inline-src-block keyword
+ node-property src-block)
+ (lambda (datum)
+ (pcase (org-element-type datum)
+ ((or `babel-call `inline-babel-call)
+ (funcall verify
+ datum
+ nil
+ (cl-mapcan #'org-babel-parse-header-arguments
+ (list
+ (org-element-property :inside-header datum)
+ (org-element-property :end-header datum)))))
+ (`inline-src-block
+ (funcall verify
+ datum
+ (org-element-property :language datum)
+ (org-babel-parse-header-arguments
+ (org-element-property :parameters datum))))
+ (`keyword
+ (when (string= (org-element-property :key datum) "PROPERTY")
+ (let ((value (org-element-property :value datum)))
+ (when (string-match "\\`header-args\\(?::\\(\\S-+\\)\\)?\\+? *"
+ value)
+ (funcall verify
+ datum
+ (match-string 1 value)
+ (org-babel-parse-header-arguments
+ (substring value (match-end 0))))))))
+ (`node-property
+ (let ((key (org-element-property :key datum)))
+ (when (let ((case-fold-search t))
+ (string-match "\\`HEADER-ARGS\\(?::\\(\\S-+\\)\\)?\\+?"
+ key))
+ (funcall verify
+ datum
+ (match-string 1 key)
+ (org-babel-parse-header-arguments
+ (org-element-property :value datum))))))
+ (`src-block
+ (funcall verify
+ datum
+ (org-element-property :language datum)
+ (cl-mapcan #'org-babel-parse-header-arguments
+ (cons (org-element-property :parameters datum)
+ (org-element-property :header datum))))))))
+ reports))
+
+(defun org-lint-wrong-header-value (ast)
+ (let (reports)
+ (org-element-map ast
+ '(babel-call inline-babel-call inline-src-block src-block)
+ (lambda (datum)
+ (let* ((type (org-element-type datum))
+ (language (org-element-property :language datum))
+ (allowed-header-values
+ (append (and language
+ (let ((v (intern (concat "org-babel-header-args:"
+ language))))
+ (and (boundp v) (symbol-value v))))
+ org-babel-common-header-args-w-values))
+ (datum-header-values
+ (org-babel-parse-header-arguments
+ (org-trim
+ (pcase type
+ (`src-block
+ (mapconcat
+ #'identity
+ (cons (org-element-property :parameters datum)
+ (org-element-property :header datum))
+ " "))
+ (`inline-src-block
+ (or (org-element-property :parameters datum) ""))
+ (_
+ (concat
+ (org-element-property :inside-header datum)
+ " "
+ (org-element-property :end-header datum))))))))
+ (dolist (header datum-header-values)
+ (let ((allowed-values
+ (cdr (assoc-string (substring (symbol-name (car header)) 1)
+ allowed-header-values))))
+ (unless (memq allowed-values '(:any nil))
+ (let ((values (cdr header))
+ groups-alist)
+ (dolist (v (if (stringp values) (split-string values)
+ (list values)))
+ (let ((valid-value nil))
+ (catch 'exit
+ (dolist (group allowed-values)
+ (cond
+ ((not (funcall
+ (if (stringp v) #'assoc-string #'assoc)
+ v group))
+ (when (memq :any group)
+ (setf valid-value t)
+ (push (cons group v) groups-alist)))
+ ((assq group groups-alist)
+ (push
+ (list
+ (or (org-element-property :post-affiliated datum)
+ (org-element-property :begin datum))
+ (format
+ "Forbidden combination in header \"%s\": %s, %s"
+ (car header)
+ (cdr (assq group groups-alist))
+ v))
+ reports)
+ (throw 'exit nil))
+ (t (push (cons group v) groups-alist)
+ (setf valid-value t))))
+ (unless valid-value
+ (push
+ (list
+ (or (org-element-property :post-affiliated datum)
+ (org-element-property :begin datum))
+ (format "Unknown value \"%s\" for header \"%s\""
+ v
+ (car header)))
+ reports))))))))))))
+ reports))
+
+(defun org-lint-spurious-colons (ast)
+ (org-element-map ast '(headline inlinetask)
+ (lambda (h)
+ (when (member "" (org-element-property :tags h))
+ (list (org-element-property :begin h)
+ "Tags contain a spurious colon")))))
+
+
+
+;;; Reports UI
+
+(defvar org-lint--report-mode-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map tabulated-list-mode-map)
+ (define-key map (kbd "RET") 'org-lint--jump-to-source)
+ (define-key map (kbd "TAB") 'org-lint--show-source)
+ (define-key map (kbd "C-j") 'org-lint--show-source)
+ (define-key map (kbd "h") 'org-lint--hide-checker)
+ (define-key map (kbd "i") 'org-lint--ignore-checker)
+ map)
+ "Local keymap for `org-lint--report-mode' buffers.")
+
+(define-derived-mode org-lint--report-mode tabulated-list-mode "OrgLint"
+ "Major mode used to display reports emitted during linting.
+\\{org-lint--report-mode-map}"
+ (setf tabulated-list-format
+ `[("Line" 6
+ (lambda (a b)
+ (< (string-to-number (aref (cadr a) 0))
+ (string-to-number (aref (cadr b) 0))))
+ :right-align t)
+ ("Trust" 5 t)
+ ("Warning" 0 t)])
+ (tabulated-list-init-header))
+
+(defun org-lint--generate-reports (buffer checkers)
+ "Generate linting report for BUFFER.
+
+CHECKERS is the list of checkers used.
+
+Return an alist (ID [LINE TRUST DESCRIPTION CHECKER]), suitable
+for `tabulated-list-printer'."
+ (with-current-buffer buffer
+ (save-excursion
+ (goto-char (point-min))
+ (let ((ast (org-element-parse-buffer))
+ (id 0)
+ (last-line 1)
+ (last-pos 1))
+ ;; Insert unique ID for each report. Replace buffer positions
+ ;; with line numbers.
+ (mapcar
+ (lambda (report)
+ (list
+ (cl-incf id)
+ (apply #'vector
+ (cons
+ (progn
+ (goto-char (car report))
+ (beginning-of-line)
+ (prog1 (number-to-string
+ (cl-incf last-line
+ (count-lines last-pos (point))))
+ (setf last-pos (point))))
+ (cdr report)))))
+ ;; Insert trust level in generated reports. Also sort them
+ ;; by buffer position in order to optimize lines computation.
+ (sort (cl-mapcan
+ (lambda (c)
+ (let ((trust (symbol-name (org-lint-checker-trust c))))
+ (mapcar
+ (lambda (report)
+ (list (car report) trust (nth 1 report) c))
+ (save-excursion
+ (funcall
+ (intern (format "org-lint-%s"
+ (org-lint-checker-name c)))
+ ast)))))
+ checkers)
+ #'car-less-than-car))))))
+
+(defvar-local org-lint--source-buffer nil
+ "Source buffer associated to current report buffer.")
+
+(defvar-local org-lint--local-checkers nil
+ "List of checkers used to build current report.")
+
+(defun org-lint--refresh-reports ()
+ (setq tabulated-list-entries
+ (org-lint--generate-reports org-lint--source-buffer
+ org-lint--local-checkers))
+ (tabulated-list-print))
+
+(defun org-lint--current-line ()
+ "Return current report line, as a number."
+ (string-to-number (aref (tabulated-list-get-entry) 0)))
+
+(defun org-lint--current-checker (&optional entry)
+ "Return current report checker.
+When optional argument ENTRY is non-nil, use this entry instead
+of current one."
+ (aref (if entry (nth 1 entry) (tabulated-list-get-entry)) 3))
+
+(defun org-lint--display-reports (source checkers)
+ "Display linting reports for buffer SOURCE.
+CHECKERS is the list of checkers used."
+ (let ((buffer (get-buffer-create "*Org Lint*")))
+ (with-current-buffer buffer
+ (org-lint--report-mode)
+ (setf org-lint--source-buffer source)
+ (setf org-lint--local-checkers checkers)
+ (org-lint--refresh-reports)
+ (add-hook 'tabulated-list-revert-hook #'org-lint--refresh-reports nil t))
+ (pop-to-buffer buffer)))
+
+(defun org-lint--jump-to-source ()
+ "Move to source line that generated the report at point."
+ (interactive)
+ (let ((l (org-lint--current-line)))
+ (switch-to-buffer-other-window org-lint--source-buffer)
+ (org-goto-line l)
+ (org-show-set-visibility 'local)
+ (recenter)))
+
+(defun org-lint--show-source ()
+ "Show source line that generated the report at point."
+ (interactive)
+ (let ((buffer (current-buffer)))
+ (org-lint--jump-to-source)
+ (switch-to-buffer-other-window buffer)))
+
+(defun org-lint--hide-checker ()
+ "Hide all reports from checker that generated the report at point."
+ (interactive)
+ (let ((c (org-lint--current-checker)))
+ (setf tabulated-list-entries
+ (cl-remove-if (lambda (e) (equal c (org-lint--current-checker e)))
+ tabulated-list-entries))
+ (tabulated-list-print)))
+
+(defun org-lint--ignore-checker ()
+ "Ignore all reports from checker that generated the report at point.
+Checker will also be ignored in all subsequent reports."
+ (interactive)
+ (setf org-lint--local-checkers
+ (remove (org-lint--current-checker) org-lint--local-checkers))
+ (org-lint--hide-checker))
+
+
+;;; Public function
+
+;;;###autoload
+(defun org-lint (&optional arg)
+ "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."
+ (interactive "P")
+ (unless (derived-mode-p 'org-mode) (user-error "Not in an Org buffer"))
+ (when (called-interactively-p 'any)
+ (message "Org linting process starting..."))
+ (let ((checkers
+ (pcase arg
+ (`nil org-lint--checkers)
+ (`(4)
+ (let ((category
+ (completing-read
+ "Checker category: "
+ (mapcar #'org-lint-checker-categories org-lint--checkers)
+ nil t)))
+ (cl-remove-if-not
+ (lambda (c)
+ (assoc-string (org-lint-checker-categories c) category))
+ org-lint--checkers)))
+ (`(16)
+ (list
+ (let ((name (completing-read
+ "Checker name: "
+ (mapcar #'org-lint-checker-name org-lint--checkers)
+ nil t)))
+ (catch 'exit
+ (dolist (c org-lint--checkers)
+ (when (string= (org-lint-checker-name c) name)
+ (throw 'exit c)))))))
+ ((pred consp)
+ (cl-remove-if-not (lambda (c) (memq (org-lint-checker-name c) arg))
+ org-lint--checkers))
+ (_ (user-error "Invalid argument `%S' for `org-lint'" arg)))))
+ (if (not (called-interactively-p 'any))
+ (org-lint--generate-reports (current-buffer) checkers)
+ (org-lint--display-reports (current-buffer) checkers)
+ (message "Org linting process completed"))))
+
+(provide 'org-lint)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-lint.el ends here
diff --git a/elpa/org-9.5.2/org-lint.elc b/elpa/org-9.5.2/org-lint.elc
new file mode 100644
index 0000000..ffed70a
--- /dev/null
+++ b/elpa/org-9.5.2/org-lint.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-list.el b/elpa/org-9.5.2/org-list.el
new file mode 100644
index 0000000..2bd9dc4
--- /dev/null
+++ b/elpa/org-9.5.2/org-list.el
@@ -0,0 +1,3582 @@
+;;; org-list.el --- Plain lists for Org -*- lexical-binding: t; -*-
+;;
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+;;
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; Bastien Guerry <bzg@gnu.org>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file contains the code dealing with plain lists in Org mode.
+
+;; The core concept behind lists is their structure. A structure is
+;; a snapshot of the list, in the shape of a data tree (see
+;; `org-list-struct').
+
+;; Once the list structure is stored, it is possible to make changes
+;; on it that will be mirrored to the real list or to get information
+;; about the list, using accessors and methods provided in the
+;; library. Most of them require the use of one or two helper
+;; functions, namely `org-list-parents-alist' and
+;; `org-list-prevs-alist'.
+
+;; Structure is eventually applied to the buffer with
+;; `org-list-write-struct'. This function repairs (bullets,
+;; indentation, checkboxes) the list in the process. It should be
+;; called near the end of any function working on structures.
+
+;; Thus, a function applying to lists should usually follow this
+;; template:
+
+;; 1. Verify point is in a list and grab item beginning (with the same
+;; function `org-in-item-p'). If the function requires the cursor
+;; to be at item's bullet, `org-at-item-p' is more selective. It
+;; is also possible to move point to the closest item with
+;; `org-list-search-backward', or `org-list-search-forward',
+;; applied to the function `org-item-beginning-re'.
+
+;; 2. Get list structure with `org-list-struct'.
+
+;; 3. Compute one, or both, helper functions,
+;; (`org-list-parents-alist', `org-list-prevs-alist') depending on
+;; needed accessors.
+
+;; 4. Proceed with the modifications, using methods and accessors.
+
+;; 5. Verify and apply structure to buffer, using
+;; `org-list-write-struct'.
+
+;; 6. If changes made to the list might have modified check-boxes,
+;; call `org-update-checkbox-count-maybe'.
+
+;; Computing a structure can be a costly operation on huge lists (a
+;; few thousand lines long). Thus, code should follow the rule:
+;; "collect once, use many". As a corollary, it is usually a bad idea
+;; to use directly an interactive function inside the code, as those,
+;; being independent entities, read the whole list structure another
+;; time.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'org-macs)
+(require 'org-compat)
+
+(defvar org-M-RET-may-split-line)
+(defvar org-adapt-indentation)
+(defvar org-auto-align-tags)
+(defvar org-blank-before-new-entry)
+(defvar org-clock-string)
+(defvar org-closed-string)
+(defvar org-deadline-string)
+(defvar org-done-keywords)
+(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)
+(defvar org-todo-line-regexp)
+(defvar org-ts-regexp)
+(defvar org-ts-regexp-both)
+
+(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-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-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-normalize-string "org-element" (s))
+(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-set-element "org-element" (old new))
+(declare-function org-element-type "org-element" (element))
+(declare-function org-element-update-syntax "org-element" ())
+(declare-function org-end-of-meta-data "org" (&optional full))
+(declare-function org-entry-get "org" (pom property &optional inherit literal-nil))
+(declare-function org-export-create-backend "ox" (&rest rest) t)
+(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-fix-tags-on-the-fly "org" ())
+(declare-function org-get-todo-state "org" ())
+(declare-function org-in-block-p "org" (names))
+(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" ())
+(declare-function org-inlinetask-outline-regexp "org-inlinetask" ())
+(declare-function org-level-increment "org" ())
+(declare-function org-mode "org" ())
+(declare-function org-narrow-to-subtree "org" ())
+(declare-function org-outline-level "org" ())
+(declare-function org-previous-line-empty-p "org" ())
+(declare-function org-reduced-level "org" (L))
+(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))
+(declare-function org-timer-hms-to-secs "org-timer" (hms))
+(declare-function org-timer-item "org-timer" (&optional arg))
+(declare-function outline-next-heading "outline" ())
+(declare-function outline-previous-heading "outline" ())
+
+
+
+;;; Configuration variables
+
+(defgroup org-plain-lists nil
+ "Options concerning plain lists in Org mode."
+ :tag "Org Plain lists"
+ :group 'org-structure)
+
+(defcustom org-cycle-include-plain-lists t
+ "When t, make TAB cycle visibility on plain list items.
+Cycling plain lists works only when the cursor is on a plain list
+item. When the cursor is on an outline heading, plain lists are
+treated as text. This is the most stable way of handling this,
+which is why it is the default.
+
+When this is the symbol `integrate', then integrate plain list
+items when cycling, as if they were children of outline headings.
+
+This setting can lead to strange effects when switching visibility
+to `children', because the first \"child\" in a subtree decides
+what children should be listed. If that first \"child\" is a
+plain list item with an implied large level number, all true
+children and grand children of the outline heading will be
+exposed in a children' view."
+ :group 'org-plain-lists
+ :group 'org-cycle
+ :type '(choice
+ (const :tag "Never" nil)
+ (const :tag "With cursor in plain list (recommended)" t)
+ (const :tag "As children of outline headings" integrate)))
+
+(defcustom org-list-demote-modify-bullet nil
+ "Default bullet type installed when demoting an item.
+This is an association list, for each bullet type, this alist will point
+to the bullet that should be used when this item is demoted.
+For example,
+
+ (setq org-list-demote-modify-bullet
+ \\='((\"+\" . \"-\") (\"-\" . \"+\") (\"*\" . \"+\")))
+
+will make
+
+ + Movies
+ + Silence of the Lambs
+ + My Cousin Vinny
+ + Books
+ + The Hunt for Red October
+ + The Road to Omaha
+
+into
+
+ + Movies
+ - Silence of the Lambs
+ - My Cousin Vinny
+ + Books
+ - The Hunt for Red October
+ - The Road to Omaha"
+ :group 'org-plain-lists
+ :type '(repeat
+ (cons
+ (choice :tag "If the current bullet is "
+ (const "-")
+ (const "+")
+ (const "*")
+ (const "1.")
+ (const "1)"))
+ (choice :tag "demotion will change it to"
+ (const "-")
+ (const "+")
+ (const "*")
+ (const "1.")
+ (const "1)")))))
+
+(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.
+
+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
+interface or run the following code after updating it:
+
+ `\\[org-element-update-syntax]'"
+ :group 'org-plain-lists
+ :type '(choice (const :tag "dot like in \"2.\"" ?.)
+ (const :tag "paren like in \"2)\"" ?\))
+ (const :tag "both" t))
+ :set (lambda (var val) (set var val)
+ (when (featurep 'org-element) (org-element-update-syntax))))
+
+(defcustom org-list-allow-alphabetical nil
+ "Non-nil means single character alphabetical bullets are allowed.
+
+Both uppercase and lowercase are handled. Lists with more than
+26 items will fallback to standard numbering. Alphabetical
+counters like \"[@c]\" will be recognized.
+
+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
+interface or run the following code after updating it:
+
+ `\\[org-element-update-syntax]'"
+ :group 'org-plain-lists
+ :version "24.1"
+ :type 'boolean
+ :set (lambda (var val) (set var val)
+ (when (featurep 'org-element) (org-element-update-syntax))))
+
+(defcustom org-list-two-spaces-after-bullet-regexp nil
+ "A regular expression matching bullets that should have 2 spaces after them.
+When nil, no bullet will have two spaces after them. When
+a string, it will be used as a regular expression. When the
+bullet type of a list is changed, the new bullet type will be
+matched against this regexp. If it matches, there will be two
+spaces instead of one after the bullet in each item of the list."
+ :group 'org-plain-lists
+ :type '(choice
+ (const :tag "never" nil)
+ (regexp)))
+
+(defcustom org-list-automatic-rules '((checkbox . t)
+ (indent . t))
+ "Non-nil means apply set of rules when acting on lists.
+\\<org-mode-map>
+By default, automatic actions are taken when using
+ `\\[org-meta-return]',
+ `\\[org-metaright]',
+ `\\[org-metaleft]',
+ `\\[org-shiftmetaright]',
+ `\\[org-shiftmetaleft]',
+ `\\[org-ctrl-c-minus]',
+ `\\[org-toggle-checkbox]',
+ `\\[org-insert-todo-heading]'.
+
+You can disable individually these rules by setting them to nil.
+Valid rules are:
+
+checkbox when non-nil, checkbox statistics is updated each time
+ you either insert a new checkbox or toggle a checkbox.
+indent when non-nil, indenting or outdenting list top-item
+ with its subtree will move the whole list and
+ outdenting a list whose bullet is * to column 0 will
+ change that bullet to \"-\"."
+ :group 'org-plain-lists
+ :version "24.1"
+ :type '(alist :tag "Sets of rules"
+ :key-type
+ (choice
+ (const :tag "Checkbox" checkbox)
+ (const :tag "Indent" indent))
+ :value-type
+ (boolean :tag "Activate" :value t)))
+
+(defcustom org-list-use-circular-motion nil
+ "Non-nil means commands implying motion in lists should be cyclic.
+\\<org-mode-map>
+In that case, the item following the last item is the first one,
+and the item preceding the first item is the last one.
+
+This affects the behavior of
+ `\\[org-move-item-up]',
+ `\\[org-move-item-down]',
+ `\\[org-next-item]',
+ `\\[org-previous-item]'."
+ :group 'org-plain-lists
+ :version "24.1"
+ :type 'boolean)
+
+(defvar org-checkbox-statistics-hook nil
+ "Hook that is run whenever Org thinks checkbox statistics should be updated.
+This hook runs even if checkbox rule in
+`org-list-automatic-rules' does not apply, so it can be used to
+implement alternative ways of collecting statistics
+information.")
+
+(defcustom org-checkbox-hierarchical-statistics t
+ "Non-nil means checkbox statistics counts only the state of direct children.
+When nil, all boxes below the cookie are counted.
+This can be set to nil on a per-node basis using a COOKIE_DATA property
+with the word \"recursive\" in the value."
+ :group 'org-plain-lists
+ :type 'boolean)
+
+(defcustom org-list-indent-offset 0
+ "Additional indentation for sub-items in a list.
+By setting this to a small number, usually 1 or 2, one can more
+clearly distinguish sub-items in a list."
+ :group 'org-plain-lists
+ :version "24.1"
+ :type 'integer)
+
+(defvar org-list-forbidden-blocks '("example" "verse" "src" "export")
+ "Names of blocks where lists are not allowed.
+Names must be in lower case.")
+
+
+;;; Predicates and regexps
+
+(defconst org-list-end-re "^[ \t]*\n[ \t]*\n"
+ "Regex matching the end of a plain list.")
+
+(defconst org-list-full-item-re
+ (concat "^[ \t]*\\(\\(?:[-+*]\\|\\(?:[0-9]+\\|[A-Za-z]\\)[.)]\\)\\(?:[ \t]+\\|$\\)\\)"
+ "\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\][ \t]*\\)?"
+ "\\(?:\\(\\[[ X-]\\]\\)\\(?:[ \t]+\\|$\\)\\)?"
+ "\\(?:\\(.*\\)[ \t]+::\\(?:[ \t]+\\|$\\)\\)?")
+ "Matches a list item and puts everything into groups:
+group 1: bullet
+group 2: counter
+group 3: checkbox
+group 4: description tag")
+
+(defun org-item-re ()
+ "Return the correct regular expression for plain lists."
+ (let ((term (cond
+ ((eq org-plain-list-ordered-item-terminator t) "[.)]")
+ ((= org-plain-list-ordered-item-terminator ?\)) ")")
+ ((= org-plain-list-ordered-item-terminator ?.) "\\.")
+ (t "[.)]")))
+ (alpha (if org-list-allow-alphabetical "\\|[A-Za-z]" "")))
+ (concat "\\([ \t]*\\([-+]\\|\\(\\([0-9]+" alpha "\\)" term
+ "\\)\\)\\|[ \t]+\\*\\)\\([ \t]+\\|$\\)")))
+
+(defsubst org-item-beginning-re ()
+ "Regexp matching the beginning of a plain list item."
+ (concat "^" (org-item-re)))
+
+(defun org-list-at-regexp-after-bullet-p (regexp)
+ "Is point at a list item with REGEXP after bullet?"
+ (and (org-at-item-p)
+ (save-excursion
+ (goto-char (match-end 0))
+ (let ((counter-re (concat "\\(?:\\[@\\(?:start:\\)?"
+ (if org-list-allow-alphabetical
+ "\\([0-9]+\\|[A-Za-z]\\)"
+ "[0-9]+")
+ "\\][ \t]*\\)")))
+ ;; Ignore counter if any
+ (when (looking-at counter-re) (goto-char (match-end 0))))
+ (looking-at regexp))))
+
+(defun org-list-in-valid-context-p ()
+ "Is point in a context where lists are allowed?"
+ (not (org-in-block-p org-list-forbidden-blocks)))
+
+(defun org-in-item-p ()
+ "Return item beginning position when in a plain list, nil otherwise."
+ (save-excursion
+ (beginning-of-line)
+ (let* ((case-fold-search t)
+ (context (org-list-context))
+ (lim-up (car context))
+ (inlinetask-re (and (featurep 'org-inlinetask)
+ (org-inlinetask-outline-regexp)))
+ (item-re (org-item-re))
+ ;; Indentation isn't meaningful when point starts at an empty
+ ;; line or an inline task.
+ (ind-ref (if (or (looking-at "^[ \t]*$")
+ (and inlinetask-re (looking-at inlinetask-re)))
+ 10000
+ (current-indentation))))
+ (cond
+ ((eq (nth 2 context) 'invalid) nil)
+ ((looking-at item-re) (point))
+ (t
+ ;; Detect if cursor in amidst `org-list-end-re'. First, count
+ ;; number HL of hard lines it takes, then call `org-in-regexp'
+ ;; to compute its boundaries END-BOUNDS. When point is
+ ;; in-between, move cursor before regexp beginning.
+ (let ((hl 0) (i -1) end-bounds)
+ (when (and (progn
+ (while (setq i (string-match
+ "[\r\n]" org-list-end-re (1+ i)))
+ (setq hl (1+ hl)))
+ (setq end-bounds (org-in-regexp org-list-end-re hl)))
+ (>= (point) (car end-bounds))
+ (< (point) (cdr end-bounds)))
+ (goto-char (car end-bounds))
+ (forward-line -1)))
+ ;; Look for an item, less indented that reference line.
+ (catch 'exit
+ (while t
+ (let ((ind (current-indentation)))
+ (cond
+ ;; This is exactly what we want.
+ ((and (looking-at item-re) (< ind ind-ref))
+ (throw 'exit (point)))
+ ;; At upper bound of search or looking at the end of a
+ ;; previous list: search is over.
+ ((<= (point) lim-up) (throw 'exit nil))
+ ((looking-at org-list-end-re) (throw 'exit nil))
+ ;; Skip blocks, drawers, inline-tasks, blank lines
+ ((and (looking-at "^[ \t]*#\\+end_")
+ (re-search-backward "^[ \t]*#\\+begin_" lim-up t)))
+ ((and (looking-at "^[ \t]*:END:")
+ (re-search-backward org-drawer-regexp lim-up t))
+ (beginning-of-line))
+ ((and inlinetask-re (looking-at inlinetask-re))
+ (org-inlinetask-goto-beginning)
+ (forward-line -1))
+ ((looking-at "^[ \t]*$") (forward-line -1))
+ ;; Text at column 0 cannot belong to a list: stop.
+ ((zerop ind) (throw 'exit nil))
+ ;; Normal text less indented than reference line, take
+ ;; it as new reference.
+ ((< ind ind-ref)
+ (setq ind-ref ind)
+ (forward-line -1))
+ (t (forward-line -1)))))))))))
+
+(defun org-at-item-p ()
+ "Is point in a line starting a hand-formatted item?"
+ (save-excursion
+ (beginning-of-line)
+ (and (looking-at (org-item-re)) (org-list-in-valid-context-p))))
+
+(defun org-at-item-bullet-p ()
+ "Is point at the bullet of a plain list item?"
+ (and (org-at-item-p)
+ (not (member (char-after) '(?\ ?\t)))
+ (< (point) (match-end 0))))
+
+(defun org-at-item-timer-p ()
+ "Is point at a line starting a plain list item with a timer?"
+ (org-list-at-regexp-after-bullet-p
+ "\\([0-9]+:[0-9]+:[0-9]+\\)[ \t]+::[ \t]+"))
+
+(defun org-at-item-description-p ()
+ "Is point at a description list item?"
+ (org-list-at-regexp-after-bullet-p "\\(\\S-.+\\)[ \t]+::\\([ \t]+\\|$\\)"))
+
+(defun org-at-item-checkbox-p ()
+ "Is point at a line starting a plain-list item with a checklet?"
+ (org-list-at-regexp-after-bullet-p "\\(\\[[- X]\\]\\)[ \t]+"))
+
+(defun org-at-item-counter-p ()
+ "Is point at a line starting a plain-list item with a counter?"
+ (and (org-at-item-p)
+ (looking-at org-list-full-item-re)
+ (match-string 2)))
+
+
+
+;;; Structures and helper functions
+
+(defun org-list-context ()
+ "Determine context, and its boundaries, around point.
+
+Context will be a cell like (MIN MAX CONTEXT) where MIN and MAX
+are boundaries and CONTEXT is a symbol among `drawer', `block',
+`invalid', `inlinetask' and nil.
+
+Contexts `block' and `invalid' refer to `org-list-forbidden-blocks'."
+ (save-match-data
+ (save-excursion
+ (org-with-limited-levels
+ (beginning-of-line)
+ (let ((case-fold-search t) (pos (point)) beg end context-type
+ ;; Get positions of surrounding headings. This is the
+ ;; default context.
+ (lim-up (or (save-excursion (and (ignore-errors (org-back-to-heading t))
+ (point)))
+ (point-min)))
+ (lim-down (or (save-excursion (outline-next-heading)) (point-max))))
+ ;; Is point inside a drawer?
+ (let ((end-re "^[ \t]*:END:")
+ (beg-re org-drawer-regexp))
+ (when (save-excursion
+ (and (not (looking-at beg-re))
+ (not (looking-at end-re))
+ (setq beg (and (re-search-backward beg-re lim-up t)
+ (1+ (point-at-eol))))
+ (setq end (or (and (re-search-forward end-re lim-down t)
+ (1- (match-beginning 0)))
+ lim-down))
+ (>= end pos)))
+ (setq lim-up beg lim-down end context-type 'drawer)))
+ ;; Is point strictly in a block, and of which type?
+ (let ((block-re "^[ \t]*#\\+\\(begin\\|end\\)_") type)
+ (when (save-excursion
+ (and (not (looking-at block-re))
+ (setq beg (and (re-search-backward block-re lim-up t)
+ (1+ (point-at-eol))))
+ (looking-at "^[ \t]*#\\+begin_\\(\\S-+\\)")
+ (setq type (downcase (match-string 1)))
+ (goto-char beg)
+ (setq end (or (and (re-search-forward block-re lim-down t)
+ (1- (point-at-bol)))
+ lim-down))
+ (>= end pos)
+ (equal (downcase (match-string 1)) "end")))
+ (setq lim-up beg lim-down end
+ context-type (if (member type org-list-forbidden-blocks)
+ 'invalid 'block))))
+ ;; Is point in an inlinetask?
+ (when (and (featurep 'org-inlinetask)
+ (save-excursion
+ (let* ((beg-re (org-inlinetask-outline-regexp))
+ (end-re (concat beg-re "END[ \t]*$")))
+ (and (not (looking-at "^\\*+"))
+ (setq beg (and (re-search-backward beg-re lim-up t)
+ (1+ (point-at-eol))))
+ (not (looking-at end-re))
+ (setq end (and (re-search-forward end-re lim-down t)
+ (1- (match-beginning 0))))
+ (> (point) pos)))))
+ (setq lim-up beg lim-down end context-type 'inlinetask))
+ ;; Return context boundaries and type.
+ (list lim-up lim-down context-type))))))
+
+(defun org-list-struct ()
+ "Return structure of list at point.
+
+A list structure is an alist where key is point at item, and
+values are:
+1. indentation,
+2. bullet with trailing whitespace,
+3. bullet counter, if any,
+4. checkbox, if any,
+5. description tag, if any,
+6. position at item end.
+
+Thus the following list, where numbers in parens are
+point-at-bol:
+
+- [X] first item (1)
+ 1. sub-item 1 (18)
+ 5. [@5] sub-item 2 (34)
+ some other text belonging to first item (55)
+- last item (97)
+ + tag :: description (109)
+ (131)
+
+will get the following structure:
+
+ ((1 0 \"- \" nil \"[X]\" nil 97)
+ (18 2 \"1. \" nil nil nil 34)
+ (34 2 \"5. \" \"5\" nil nil 55)
+ (97 0 \"- \" nil nil nil 131)
+ (109 2 \"+ \" nil nil \"tag\" 131))
+
+Assume point is at an item."
+ (save-excursion
+ (beginning-of-line)
+ (let* ((case-fold-search t)
+ (context (org-list-context))
+ (lim-up (car context))
+ (lim-down (nth 1 context))
+ (text-min-ind 10000)
+ (item-re (org-item-re))
+ (inlinetask-re (and (featurep 'org-inlinetask)
+ (org-inlinetask-outline-regexp)))
+ (beg-cell (cons (point) (current-indentation)))
+ itm-lst itm-lst-2 end-lst end-lst-2 struct
+ (assoc-at-point
+ ;; Return association at point.
+ (lambda (ind)
+ (looking-at org-list-full-item-re)
+ (let ((bullet (match-string-no-properties 1)))
+ (list (point)
+ ind
+ bullet
+ (match-string-no-properties 2) ; counter
+ (match-string-no-properties 3) ; checkbox
+ ;; Description tag.
+ (and (string-match-p "[-+*]" bullet)
+ (match-string-no-properties 4))))))
+ (end-before-blank
+ ;; Ensure list ends at the first blank line.
+ (lambda ()
+ (skip-chars-backward " \r\t\n")
+ (min (1+ (point-at-eol)) lim-down))))
+ ;; 1. Read list from starting item to its beginning, and save
+ ;; top item position and indentation in BEG-CELL. Also store
+ ;; ending position of items in END-LST.
+ (save-excursion
+ (catch 'exit
+ (while t
+ (let ((ind (current-indentation)))
+ (cond
+ ((<= (point) lim-up)
+ ;; At upward limit: if we ended at an item, store it,
+ ;; else dismiss useless data recorded above BEG-CELL.
+ ;; Jump to part 2.
+ (throw 'exit
+ (setq itm-lst
+ (if (not (looking-at item-re))
+ (memq (assq (car beg-cell) itm-lst) itm-lst)
+ (setq beg-cell (cons (point) ind))
+ (cons (funcall assoc-at-point ind) itm-lst)))))
+ ;; Looking at a list ending regexp. Dismiss useless
+ ;; data recorded above BEG-CELL. Jump to part 2.
+ ((looking-at org-list-end-re)
+ (throw 'exit
+ (setq itm-lst
+ (memq (assq (car beg-cell) itm-lst) itm-lst))))
+ ;; Point is at an item. Add data to ITM-LST. It may
+ ;; also end a previous item: save it in END-LST. If
+ ;; ind is less or equal than BEG-CELL and there is no
+ ;; end at this ind or lesser, this item becomes the new
+ ;; BEG-CELL.
+ ((looking-at item-re)
+ (push (funcall assoc-at-point ind) itm-lst)
+ (push (cons ind (point)) end-lst)
+ (when (< ind text-min-ind) (setq beg-cell (cons (point) ind)))
+ (forward-line -1))
+ ;; Skip blocks, drawers, inline tasks, blank lines.
+ ((and (looking-at "^[ \t]*#\\+end_")
+ (re-search-backward "^[ \t]*#\\+begin_" lim-up t)))
+ ((and (looking-at "^[ \t]*:END:")
+ (re-search-backward org-drawer-regexp lim-up t))
+ (beginning-of-line))
+ ((and inlinetask-re (looking-at inlinetask-re))
+ (org-inlinetask-goto-beginning)
+ (forward-line -1))
+ ((looking-at "^[ \t]*$")
+ (forward-line -1))
+ ;; From there, point is not at an item. Interpret
+ ;; line's indentation:
+ ;; - text at column 0 is necessarily out of any list.
+ ;; Dismiss data recorded above BEG-CELL. Jump to
+ ;; part 2.
+ ;; - any other case may be an ending position for an
+ ;; hypothetical item above. Store it and proceed.
+ ((zerop ind)
+ (throw 'exit
+ (setq itm-lst
+ (memq (assq (car beg-cell) itm-lst) itm-lst))))
+ (t
+ (when (< ind text-min-ind) (setq text-min-ind ind))
+ (push (cons ind (point)) end-lst)
+ (forward-line -1)))))))
+ ;; 2. Read list from starting point to its end, that is until we
+ ;; get out of context, or that a non-item line is less or
+ ;; equally indented than BEG-CELL's cdr. Also, store ending
+ ;; position of items in END-LST-2.
+ (catch 'exit
+ (while t
+ (let ((ind (current-indentation)))
+ (cond
+ ((>= (point) lim-down)
+ ;; At downward limit: this is de facto the end of the
+ ;; list. Save point as an ending position, and jump to
+ ;; part 3.
+ (throw 'exit
+ (push (cons 0 (funcall end-before-blank)) end-lst-2)))
+ ;; Looking at a list ending regexp. Save point as an
+ ;; ending position and jump to part 3.
+ ((looking-at org-list-end-re)
+ (throw 'exit (push (cons 0 (point)) end-lst-2)))
+ ((looking-at item-re)
+ ;; Point is at an item. Add data to ITM-LST-2. It may
+ ;; also end a previous item, so save it in END-LST-2.
+ (push (funcall assoc-at-point ind) itm-lst-2)
+ (push (cons ind (point)) end-lst-2)
+ (forward-line 1))
+ ;; Skip inline tasks and blank lines along the way
+ ((and inlinetask-re (looking-at inlinetask-re))
+ (org-inlinetask-goto-end))
+ ((looking-at "^[ \t]*$")
+ (forward-line 1))
+ ;; Ind is lesser or equal than BEG-CELL's. The list is
+ ;; over: store point as an ending position and jump to
+ ;; part 3.
+ ((<= ind (cdr beg-cell))
+ (throw 'exit
+ (push (cons 0 (funcall end-before-blank)) end-lst-2)))
+ ;; Else, if ind is lesser or equal than previous item's,
+ ;; this is an ending position: store it. In any case,
+ ;; skip block or drawer at point, and move to next line.
+ (t
+ (when (<= ind (nth 1 (car itm-lst-2)))
+ (push (cons ind (point)) end-lst-2))
+ (cond
+ ((and (looking-at "^[ \t]*#\\+begin_")
+ (re-search-forward "^[ \t]*#\\+end_" lim-down t)))
+ ((and (looking-at org-drawer-regexp)
+ (re-search-forward "^[ \t]*:END:" lim-down t))))
+ (forward-line 1))))))
+ (setq struct (append itm-lst (cdr (nreverse itm-lst-2)))
+ end-lst (append end-lst (cdr (nreverse end-lst-2))))
+ ;; 3. Associate each item to its end position.
+ (org-list-struct-assoc-end struct end-lst)
+ ;; 4. Return STRUCT
+ struct)))
+
+(defun org-list-struct-assoc-end (struct end-list)
+ "Associate proper ending point to items in STRUCT.
+
+END-LIST is a pseudo-alist where car is indentation and cdr is
+ending position.
+
+This function modifies STRUCT."
+ (let ((endings end-list))
+ (mapc
+ (lambda (elt)
+ (let ((pos (car elt))
+ (ind (nth 1 elt)))
+ ;; Remove end candidates behind current item.
+ (while (or (<= (cdar endings) pos))
+ (pop endings))
+ ;; Add end position to item assoc.
+ (let ((old-end (nthcdr 6 elt))
+ (new-end (assoc-default ind endings '<=)))
+ (if old-end
+ (setcar old-end new-end)
+ (setcdr elt (append (cdr elt) (list new-end)))))))
+ struct)))
+
+(defun org-list-prevs-alist (struct)
+ "Return alist between item and previous item in STRUCT."
+ (let ((item-end-alist (mapcar (lambda (e) (cons (car e) (nth 6 e)))
+ struct)))
+ (mapcar (lambda (e)
+ (let ((prev (car (rassq (car e) item-end-alist))))
+ (cons (car e) prev)))
+ struct)))
+
+(defun org-list-parents-alist (struct)
+ "Return alist between item and parent in STRUCT."
+ (let* ((ind-to-ori (list (list (nth 1 (car struct)))))
+ (top-item (org-list-get-top-point struct))
+ (prev-pos (list top-item)))
+ (cons prev-pos
+ (mapcar (lambda (item)
+ (let ((pos (car item))
+ (ind (nth 1 item))
+ (prev-ind (caar ind-to-ori)))
+ (push pos prev-pos)
+ (cond
+ ((> prev-ind ind)
+ ;; A sub-list is over. Find the associated
+ ;; origin in IND-TO-ORI. If it cannot be
+ ;; found (ill-formed list), set its parent as
+ ;; the first item less indented. If there is
+ ;; none, make it a top-level item.
+ (setq ind-to-ori
+ (or (member (assq ind ind-to-ori) ind-to-ori)
+ (catch 'exit
+ (mapc
+ (lambda (e)
+ (when (< (car e) ind)
+ (throw 'exit (member e ind-to-ori))))
+ ind-to-ori)
+ (list (list ind)))))
+ (cons pos (cdar ind-to-ori)))
+ ;; A sub-list starts. Every item at IND will
+ ;; have previous item as its parent.
+ ((< prev-ind ind)
+ (let ((origin (nth 1 prev-pos)))
+ (push (cons ind origin) ind-to-ori)
+ (cons pos origin)))
+ ;; Another item in the same sub-list: it shares
+ ;; the same parent as the previous item.
+ (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
+
+(defsubst org-list-get-nth (n key struct)
+ "Return the Nth value of KEY in STRUCT."
+ (nth n (assq key struct)))
+
+(defun org-list-set-nth (n key struct new)
+ "Set the Nth value of KEY in STRUCT to NEW.
+\nThis function modifies STRUCT."
+ (setcar (nthcdr n (assq key struct)) new))
+
+(defsubst org-list-get-ind (item struct)
+ "Return indentation of ITEM in STRUCT."
+ (org-list-get-nth 1 item struct))
+
+(defun org-list-set-ind (item struct ind)
+ "Set indentation of ITEM in STRUCT to IND.
+\nThis function modifies STRUCT."
+ (org-list-set-nth 1 item struct ind))
+
+(defsubst org-list-get-bullet (item struct)
+ "Return bullet of ITEM in STRUCT."
+ (org-list-get-nth 2 item struct))
+
+(defun org-list-set-bullet (item struct bullet)
+ "Set bullet of ITEM in STRUCT to BULLET.
+\nThis function modifies STRUCT."
+ (org-list-set-nth 2 item struct bullet))
+
+(defsubst org-list-get-counter (item struct)
+ "Return counter of ITEM in STRUCT."
+ (org-list-get-nth 3 item struct))
+
+(defsubst org-list-get-checkbox (item struct)
+ "Return checkbox of ITEM in STRUCT or nil."
+ (org-list-get-nth 4 item struct))
+
+(defun org-list-set-checkbox (item struct checkbox)
+ "Set checkbox of ITEM in STRUCT to CHECKBOX.
+\nThis function modifies STRUCT."
+ (org-list-set-nth 4 item struct checkbox))
+
+(defsubst org-list-get-tag (item struct)
+ "Return end position of ITEM in STRUCT."
+ (org-list-get-nth 5 item struct))
+
+(defun org-list-get-item-end (item struct)
+ "Return end position of ITEM in STRUCT."
+ (org-list-get-nth 6 item struct))
+
+(defun org-list-get-item-end-before-blank (item struct)
+ "Return point at end of ITEM in STRUCT, before any blank line.
+Point returned is at end of line."
+ (save-excursion
+ (goto-char (org-list-get-item-end item struct))
+ (skip-chars-backward " \r\t\n")
+ (point-at-eol)))
+
+(defun org-list-get-parent (item struct parents)
+ "Return parent of ITEM or nil.
+STRUCT is the list structure. PARENTS is the alist of parents,
+as returned by `org-list-parents-alist'."
+ (let ((parents (or parents (org-list-parents-alist struct))))
+ (cdr (assq item parents))))
+
+(defun org-list-has-child-p (item struct)
+ "Non-nil if ITEM has a child.
+
+STRUCT is the list structure.
+
+Value returned is the position of the first child of ITEM."
+ (let ((ind (org-list-get-ind item struct))
+ (child-maybe (car (nth 1 (member (assq item struct) struct)))))
+ (when (and child-maybe
+ (< ind (org-list-get-ind child-maybe struct)))
+ child-maybe)))
+
+(defun org-list-get-next-item (item _struct prevs)
+ "Return next item in same sub-list as ITEM, or nil.
+STRUCT is the list structure. PREVS is the alist of previous
+items, as returned by `org-list-prevs-alist'."
+ (car (rassq item prevs)))
+
+(defun org-list-get-prev-item (item _struct prevs)
+ "Return previous item in same sub-list as ITEM, or nil.
+STRUCT is the list structure. PREVS is the alist of previous
+items, as returned by `org-list-prevs-alist'."
+ (cdr (assq item prevs)))
+
+(defun org-list-get-subtree (item struct)
+ "List all items having ITEM as a common ancestor, or nil.
+STRUCT is the list structure."
+ (let* ((item-end (org-list-get-item-end item struct))
+ (sub-struct (cdr (member (assq item struct) struct)))
+ items)
+ (catch :exit
+ (pcase-dolist (`(,pos . ,_) sub-struct)
+ (if (< pos item-end)
+ (push pos items)
+ (throw :exit nil))))
+ (nreverse items)))
+
+(defun org-list-get-all-items (item struct prevs)
+ "List all items in the same sub-list as ITEM.
+STRUCT is the list structure. PREVS is the alist of previous
+items, as returned by `org-list-prevs-alist'."
+ (let ((prev-item item)
+ (next-item item)
+ before-item after-item)
+ (while (setq prev-item (org-list-get-prev-item prev-item struct prevs))
+ (push prev-item before-item))
+ (while (setq next-item (org-list-get-next-item next-item struct prevs))
+ (push next-item after-item))
+ (append before-item (list item) (nreverse after-item))))
+
+(defun org-list-get-children (item _struct parents)
+ "List all children of ITEM, or nil.
+STRUCT is the list structure. PARENTS is the alist of parents,
+as returned by `org-list-parents-alist'."
+ (let (all child)
+ (while (setq child (car (rassq item parents)))
+ (setq parents (cdr (member (assq child parents) parents)))
+ (push child all))
+ (nreverse all)))
+
+(defun org-list-get-top-point (struct)
+ "Return point at beginning of list.
+STRUCT is the list structure."
+ (caar struct))
+
+(defun org-list-get-bottom-point (struct)
+ "Return point at bottom of list.
+STRUCT is the list structure."
+ (apply #'max
+ (mapcar (lambda (e) (org-list-get-item-end (car e) struct)) struct)))
+
+(defun org-list-get-list-begin (item struct prevs)
+ "Return point at beginning of sub-list ITEM belongs.
+STRUCT is the list structure. PREVS is the alist of previous
+items, as returned by `org-list-prevs-alist'."
+ (let ((first-item item) prev-item)
+ (while (setq prev-item (org-list-get-prev-item first-item struct prevs))
+ (setq first-item prev-item))
+ first-item))
+
+(defalias 'org-list-get-first-item 'org-list-get-list-begin)
+
+(defun org-list-get-last-item (item struct prevs)
+ "Return point at last item of sub-list ITEM belongs.
+STRUCT is the list structure. PREVS is the alist of previous
+items, as returned by `org-list-prevs-alist'."
+ (let ((last-item item) next-item)
+ (while (setq next-item (org-list-get-next-item last-item struct prevs))
+ (setq last-item next-item))
+ last-item))
+
+(defun org-list-get-list-end (item struct prevs)
+ "Return point at end of sub-list ITEM belongs.
+STRUCT is the list structure. PREVS is the alist of previous
+items, as returned by `org-list-prevs-alist'."
+ (org-list-get-item-end (org-list-get-last-item item struct prevs) struct))
+
+(defun org-list-get-list-type (item struct prevs)
+ "Return the type of the list containing ITEM, as a symbol.
+
+STRUCT is the list structure. PREVS is the alist of previous
+items, as returned by `org-list-prevs-alist'.
+
+Possible types are `descriptive', `ordered' and `unordered'. The
+type is determined by the first item of the list."
+ (let ((first (org-list-get-list-begin item struct prevs)))
+ (cond
+ ((string-match-p "[[:alnum:]]" (org-list-get-bullet first struct)) 'ordered)
+ ((org-list-get-tag first struct) 'descriptive)
+ (t 'unordered))))
+
+(defun org-list-get-item-number (item struct prevs parents)
+ "Return ITEM's sequence number.
+
+STRUCT is the list structure. PREVS is the alist of previous
+items, as returned by `org-list-prevs-alist'. PARENTS is the
+alist of ancestors, as returned by `org-list-parents-alist'.
+
+Return value is a list of integers. Counters have an impact on
+that value."
+ (let ((get-relative-number
+ (lambda (item struct prevs)
+ ;; Return relative sequence number of ITEM in the sub-list
+ ;; it belongs. STRUCT is the list structure. PREVS is
+ ;; the alist of previous items.
+ (let ((seq 0) (pos item) counter)
+ (while (and (not (setq counter (org-list-get-counter pos struct)))
+ (setq pos (org-list-get-prev-item pos struct prevs)))
+ (cl-incf seq))
+ (if (not counter) (1+ seq)
+ (cond
+ ((string-match "[A-Za-z]" counter)
+ (+ (- (string-to-char (upcase (match-string 0 counter))) 64)
+ seq))
+ ((string-match "[0-9]+" counter)
+ (+ (string-to-number (match-string 0 counter)) seq))
+ (t (1+ seq))))))))
+ ;; Cons each parent relative number into return value (OUT).
+ (let ((out (list (funcall get-relative-number item struct prevs)))
+ (parent item))
+ (while (setq parent (org-list-get-parent parent struct parents))
+ (push (funcall get-relative-number parent struct prevs) out))
+ ;; Return value.
+ out)))
+
+
+
+;;; Searching
+
+(defun org-list-search-generic (search re bound noerr)
+ "Search a string in valid contexts for lists.
+Arguments SEARCH, RE, BOUND and NOERR are similar to those used
+in `re-search-forward'."
+ (catch 'exit
+ (let ((origin (point)))
+ (while t
+ ;; 1. No match: return to origin or bound, depending on NOERR.
+ (unless (funcall search re bound noerr)
+ (throw 'exit (and (goto-char (if (memq noerr '(t nil)) origin bound))
+ nil)))
+ ;; 2. Match in valid context: return point. Else, continue
+ ;; searching.
+ (when (org-list-in-valid-context-p) (throw 'exit (point)))))))
+
+(defun org-list-search-backward (regexp &optional bound noerror)
+ "Like `re-search-backward' but stop only where lists are recognized.
+Arguments REGEXP, BOUND and NOERROR are similar to those used in
+`re-search-backward'."
+ (org-list-search-generic #'re-search-backward
+ regexp (or bound (point-min)) noerror))
+
+(defun org-list-search-forward (regexp &optional bound noerror)
+ "Like `re-search-forward' but stop only where lists are recognized.
+Arguments REGEXP, BOUND and NOERROR are similar to those used in
+`re-search-forward'."
+ (org-list-search-generic #'re-search-forward
+ regexp (or bound (point-max)) noerror))
+
+
+
+;;; Methods on structures
+
+(defsubst org-list-bullet-string (bullet)
+ "Return BULLET with the correct number of whitespaces.
+It determines the number of whitespaces to append by looking at
+`org-list-two-spaces-after-bullet-regexp'."
+ (save-match-data
+ (let ((spaces (if (and org-list-two-spaces-after-bullet-regexp
+ (string-match
+ org-list-two-spaces-after-bullet-regexp bullet))
+ " "
+ " ")))
+ (if (string-match "\\S-+\\([ \t]*\\)" bullet)
+ (replace-match spaces nil nil bullet 1)
+ bullet))))
+
+(defun org-list-swap-items (beg-A beg-B struct)
+ "Swap item starting at BEG-A with item starting at BEG-B in STRUCT.
+
+Blank lines at the end of items are left in place. Item
+visibility is preserved. Return the new structure after the
+changes.
+
+Assume BEG-A is lesser than BEG-B and that BEG-A and BEG-B belong
+to the same sub-list.
+
+This function modifies STRUCT."
+ (save-excursion
+ (let* ((end-A-no-blank (org-list-get-item-end-before-blank beg-A struct))
+ (end-B-no-blank (org-list-get-item-end-before-blank beg-B struct))
+ (end-A (org-list-get-item-end beg-A struct))
+ (end-B (org-list-get-item-end beg-B struct))
+ (size-A (- end-A-no-blank beg-A))
+ (size-B (- end-B-no-blank beg-B))
+ (body-A (buffer-substring beg-A end-A-no-blank))
+ (body-B (buffer-substring beg-B end-B-no-blank))
+ (between-A-no-blank-and-B (buffer-substring end-A-no-blank beg-B))
+ (sub-A (cons beg-A (org-list-get-subtree beg-A struct)))
+ (sub-B (cons beg-B (org-list-get-subtree beg-B struct)))
+ ;; Store overlays responsible for visibility status. We
+ ;; also need to store their boundaries as they will be
+ ;; removed from buffer.
+ (overlays
+ (cons
+ (delq nil
+ (mapcar (lambda (o)
+ (and (>= (overlay-start o) beg-A)
+ (<= (overlay-end o) end-A)
+ (list o (overlay-start o) (overlay-end o))))
+ (overlays-in beg-A end-A)))
+ (delq nil
+ (mapcar (lambda (o)
+ (and (>= (overlay-start o) beg-B)
+ (<= (overlay-end o) end-B)
+ (list o (overlay-start o) (overlay-end o))))
+ (overlays-in beg-B end-B))))))
+ ;; 1. Move effectively items in buffer.
+ (goto-char beg-A)
+ (delete-region beg-A end-B-no-blank)
+ (insert (concat body-B between-A-no-blank-and-B body-A))
+ ;; 2. Now modify struct. No need to re-read the list, the
+ ;; transformation is just a shift of positions. Some special
+ ;; attention is required for items ending at END-A and END-B
+ ;; as empty spaces are not moved there. In others words,
+ ;; item BEG-A will end with whitespaces that were at the end
+ ;; of BEG-B and the same applies to BEG-B.
+ (dolist (e struct)
+ (let ((pos (car e)))
+ (cond
+ ((< pos beg-A))
+ ((memq pos sub-A)
+ (let ((end-e (nth 6 e)))
+ (setcar e (+ pos (- end-B-no-blank end-A-no-blank)))
+ (setcar (nthcdr 6 e)
+ (+ end-e (- end-B-no-blank end-A-no-blank)))
+ (when (= end-e end-A) (setcar (nthcdr 6 e) end-B))))
+ ((memq pos sub-B)
+ (let ((end-e (nth 6 e)))
+ (setcar e (- (+ pos beg-A) beg-B))
+ (setcar (nthcdr 6 e) (+ end-e (- beg-A beg-B)))
+ (when (= end-e end-B)
+ (setcar (nthcdr 6 e)
+ (+ beg-A size-B (- end-A end-A-no-blank))))))
+ ((< pos beg-B)
+ (let ((end-e (nth 6 e)))
+ (setcar e (+ pos (- size-B size-A)))
+ (setcar (nthcdr 6 e) (+ end-e (- size-B size-A))))))))
+ (setq struct (sort struct #'car-less-than-car))
+ ;; Restore visibility status, by moving overlays to their new
+ ;; position.
+ (dolist (ov (car overlays))
+ (move-overlay
+ (car ov)
+ (+ (nth 1 ov) (- (+ beg-B (- size-B size-A)) beg-A))
+ (+ (nth 2 ov) (- (+ beg-B (- size-B size-A)) beg-A))))
+ (dolist (ov (cdr overlays))
+ (move-overlay (car ov)
+ (+ (nth 1 ov) (- beg-A beg-B))
+ (+ (nth 2 ov) (- beg-A beg-B))))
+ ;; Return structure.
+ struct)))
+
+(defun org-list-separating-blank-lines-number (pos struct prevs)
+ "Return number of blank lines that should separate items in list.
+
+POS is the position of point where `org-list-insert-item' was called.
+
+STRUCT is the list structure. PREVS is the alist of previous
+items, as returned by `org-list-prevs-alist'.
+
+Assume point is at item's beginning. If the item is alone, apply
+some heuristics to guess the result."
+ (save-excursion
+ (let ((item (point))
+ (insert-blank-p
+ (cdr (assq 'plain-list-item org-blank-before-new-entry)))
+ usr-blank
+ (count-blanks
+ (lambda ()
+ ;; Count blank lines above beginning of line.
+ (save-excursion
+ (count-lines (goto-char (point-at-bol))
+ (progn (skip-chars-backward " \r\t\n")
+ (forward-line)
+ (point)))))))
+ (cond
+ ;; Trivial cases where there should be none.
+ ((not insert-blank-p) 0)
+ ;; When `org-blank-before-new-entry' says so, it is 1.
+ ((eq insert-blank-p t) 1)
+ ;; `plain-list-item' is 'auto. Count blank lines separating
+ ;; neighbors' items in list.
+ (t (let ((next-p (org-list-get-next-item item struct prevs)))
+ (cond
+ ;; Is there a next item?
+ (next-p (goto-char next-p)
+ (funcall count-blanks))
+ ;; Is there a previous item?
+ ((org-list-get-prev-item item struct prevs)
+ (funcall count-blanks))
+ ;; User inserted blank lines, trust him.
+ ((and (> pos (org-list-get-item-end-before-blank item struct))
+ (> (save-excursion (goto-char pos)
+ (setq usr-blank (funcall count-blanks)))
+ 0))
+ usr-blank)
+ ;; Are there blank lines inside the list so far?
+ ((save-excursion
+ (goto-char (org-list-get-top-point struct))
+ ;; Do not use `org-list-search-forward' so blank lines
+ ;; in blocks can be counted in.
+ (re-search-forward
+ "^[ \t]*$" (org-list-get-item-end-before-blank item struct) t))
+ 1)
+ ;; Default choice: no blank line.
+ (t 0))))))))
+
+(defun org-list-insert-item (pos struct prevs &optional checkbox after-bullet)
+ "Insert a new list item at POS and return the new structure.
+If POS is before first character after bullet of the item, the
+new item will be created before the current one.
+
+STRUCT is the list structure. PREVS is the alist of previous
+items, as returned by `org-list-prevs-alist'.
+
+Insert a checkbox if CHECKBOX is non-nil, and string AFTER-BULLET
+after the bullet. Cursor will be after this text once the
+function ends.
+
+This function modifies STRUCT."
+ (let* ((case-fold-search t)
+ ;; 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).
+ (item
+ (catch :exit
+ (let ((i nil))
+ (pcase-dolist (`(,start ,_ ,_ ,_ ,_ ,_ ,end) struct)
+ (cond
+ ((> start pos) (throw :exit i))
+ ((< end pos) nil) ;skip sub-lists before point
+ (t (setq i start))))
+ ;; If no suitable item is found, insert a sibling of the
+ ;; last item in buffer.
+ (or i (caar (reverse struct))))))
+ (item-end (org-list-get-item-end item struct))
+ (item-end-no-blank (org-list-get-item-end-before-blank item struct))
+ (beforep
+ (progn
+ (goto-char item)
+ (looking-at org-list-full-item-re)
+ (<= pos
+ (cond
+ ((not (match-beginning 4)) (match-end 0))
+ ;; Ignore tag in a non-descriptive list.
+ ((save-match-data (string-match "[.)]" (match-string 1)))
+ (match-beginning 4))
+ (t (save-excursion
+ (goto-char (match-end 4))
+ (skip-chars-forward " \t")
+ (point)))))))
+ (split-line-p (org-get-alist-option org-M-RET-may-split-line 'item))
+ (blank-nb (org-list-separating-blank-lines-number pos struct prevs))
+ ;; Build the new item to be created. Concatenate same bullet
+ ;; as item, checkbox, text AFTER-BULLET if provided, and text
+ ;; cut from point to end of item (TEXT-CUT) to form item's
+ ;; BODY. TEXT-CUT depends on BEFOREP and SPLIT-LINE-P. The
+ ;; difference of size between what was cut and what was
+ ;; inserted in buffer is stored in SIZE-OFFSET.
+ (ind (org-list-get-ind item struct))
+ (ind-size (if indent-tabs-mode
+ (+ (/ ind tab-width) (mod ind tab-width))
+ ind))
+ (bullet (org-list-bullet-string (org-list-get-bullet item struct)))
+ (box (and checkbox "[ ]"))
+ (text-cut
+ (and (not beforep)
+ split-line-p
+ (progn
+ (goto-char pos)
+ ;; If POS is greater than ITEM-END, then point is in
+ ;; some white lines after the end of the list. Those
+ ;; must be removed, or they will be left, stacking up
+ ;; after the list.
+ (when (< item-end pos)
+ (delete-region (1- item-end) (point-at-eol)))
+ (skip-chars-backward " \r\t\n")
+ ;; Cut position is after any blank on the line.
+ (save-excursion
+ (skip-chars-forward " \t")
+ (setq pos (point)))
+ (delete-and-extract-region (point) item-end-no-blank))))
+ (body
+ (concat bullet
+ (and box (concat box " "))
+ after-bullet
+ (and text-cut
+ (if (string-match "\\`[ \t]+" text-cut)
+ (replace-match "" t t text-cut)
+ text-cut))))
+ (item-sep (make-string (1+ blank-nb) ?\n))
+ (item-size (+ ind-size (length body) (length item-sep)))
+ (size-offset (- item-size (length text-cut))))
+ ;; Insert effectively item into buffer.
+ (goto-char item)
+ (indent-to-column ind)
+ (insert body item-sep)
+ ;; Add new item to STRUCT.
+ (dolist (e struct)
+ (let ((p (car e)) (end (nth 6 e)))
+ (cond
+ ;; Before inserted item, positions don't change but an item
+ ;; ending after insertion has its end shifted by SIZE-OFFSET.
+ ((< p item)
+ (when (> end item)
+ (setcar (nthcdr 6 e) (+ end size-offset))))
+ ;; Item where insertion happens may be split in two parts.
+ ;; In this case, move start by ITEM-SIZE and end by
+ ;; SIZE-OFFSET.
+ ((and (= p item) (not beforep) split-line-p)
+ (setcar e (+ p item-size))
+ (setcar (nthcdr 6 e) (+ end size-offset)))
+ ;; Items starting after modified item fall into two
+ ;; categories.
+ ;;
+ ;; If modified item was split, and current sub-item was
+ ;; located after split point, it was moved to the new item:
+ ;; the part between body start and split point (POS) was
+ ;; removed. So we compute the length of that part and shift
+ ;; item's positions accordingly.
+ ;;
+ ;; Otherwise, the item was simply shifted by SIZE-OFFSET.
+ ((and split-line-p (not beforep) (>= p pos) (<= p item-end-no-blank))
+ (let ((offset (- pos item ind (length bullet) (length after-bullet))))
+ (setcar e (- p offset))
+ (setcar (nthcdr 6 e) (- end offset))))
+ (t
+ (setcar e (+ p size-offset))
+ (setcar (nthcdr 6 e) (+ end size-offset))))))
+ (push (list item ind bullet nil box nil (+ item item-size)) struct)
+ (setq struct (sort struct #'car-less-than-car))
+ ;; If not BEFOREP, new item must appear after ITEM, so exchange
+ ;; ITEM with the next item in list. Position cursor after bullet,
+ ;; counter, checkbox, and label.
+ (if beforep
+ (goto-char item)
+ (setq struct (org-list-swap-items item (+ item item-size) struct))
+ (goto-char (org-list-get-next-item
+ item struct (org-list-prevs-alist struct))))
+ struct))
+
+(defun org-list-delete-item (item struct)
+ "Remove ITEM from the list and return the new structure.
+
+STRUCT is the list structure."
+ (let* ((end (org-list-get-item-end item struct))
+ (beg (if (= (org-list-get-bottom-point struct) end)
+ ;; If ITEM ends with the list, delete blank lines
+ ;; before it.
+ (save-excursion
+ (goto-char item)
+ (skip-chars-backward " \r\t\n")
+ (min (1+ (point-at-eol)) (point-max)))
+ item)))
+ ;; Remove item from buffer.
+ (delete-region beg end)
+ ;; Remove item from structure and shift others items accordingly.
+ ;; Don't forget to shift also ending position when appropriate.
+ (let ((size (- end beg)))
+ (delq nil (mapcar (lambda (e)
+ (let ((pos (car e)))
+ (cond
+ ((< pos item)
+ (let ((end-e (nth 6 e)))
+ (cond
+ ((< end-e item) e)
+ ((= end-e item)
+ (append (butlast e) (list beg)))
+ (t
+ (append (butlast e) (list (- end-e size)))))))
+ ((< pos end) nil)
+ (t
+ (cons (- pos size)
+ (append (butlast (cdr e))
+ (list (- (nth 6 e) size))))))))
+ struct)))))
+
+(defun org-list-send-item (item dest struct)
+ "Send ITEM to destination DEST.
+
+STRUCT is the list structure.
+
+DEST can have various values.
+
+If DEST is a buffer position, the function will assume it points
+to another item in the same list as ITEM, and will move the
+latter just before the former.
+
+If DEST is `begin' (respectively `end'), ITEM will be moved at
+the beginning (respectively end) of the list it belongs to.
+
+If DEST is a string like \"N\", where N is an integer, ITEM will
+be moved at the Nth position in the list.
+
+If DEST is `kill', ITEM will be deleted and its body will be
+added to the kill-ring.
+
+If DEST is `delete', ITEM will be deleted.
+
+Visibility of item is preserved.
+
+This function returns, destructively, the new list structure."
+ (let* ((prevs (org-list-prevs-alist struct))
+ (item-end (org-list-get-item-end item struct))
+ ;; Grab full item body minus its bullet.
+ (body (org-trim
+ (buffer-substring
+ (save-excursion
+ (goto-char item)
+ (looking-at
+ (concat "[ \t]*"
+ (regexp-quote (org-list-get-bullet item struct))))
+ (match-end 0))
+ item-end)))
+ ;; Change DEST into a buffer position. A trick is needed
+ ;; when ITEM is meant to be sent at the end of the list.
+ ;; Indeed, by setting locally `org-M-RET-may-split-line' to
+ ;; nil and insertion point (INS-POINT) to the first line's
+ ;; end of the last item, we ensure the new item will be
+ ;; inserted after the last item, and not after any of its
+ ;; hypothetical sub-items.
+ (ins-point (cond
+ ((or (eq dest 'kill) (eq dest 'delete)))
+ ((eq dest 'begin)
+ (setq dest (org-list-get-list-begin item struct prevs)))
+ ((eq dest 'end)
+ (setq dest (org-list-get-list-end item struct prevs))
+ (save-excursion
+ (goto-char (org-list-get-last-item item struct prevs))
+ (point-at-eol)))
+ ((string-match-p "\\`[0-9]+\\'" dest)
+ (let* ((all (org-list-get-all-items item struct prevs))
+ (len (length all))
+ (index (mod (string-to-number dest) len)))
+ (if (not (zerop index))
+ (setq dest (nth (1- index) all))
+ ;; Send ITEM at the end of the list.
+ (setq dest (org-list-get-list-end item struct prevs))
+ (save-excursion
+ (goto-char
+ (org-list-get-last-item item struct prevs))
+ (point-at-eol)))))
+ (t dest)))
+ (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))))
+ (cond
+ ((eq dest 'delete) (org-list-delete-item item struct))
+ ((eq dest 'kill)
+ (kill-new body)
+ (org-list-delete-item item struct))
+ ((and (integerp dest) (/= item ins-point))
+ (setq item (copy-marker item))
+ (setq struct (org-list-insert-item ins-point struct prevs nil body))
+ ;; 1. Structure returned by `org-list-insert-item' may not be
+ ;; accurate, as it cannot see sub-items included in BODY.
+ ;; Thus, first compute the real structure so far.
+ (let ((moved-items
+ (cons (marker-position item)
+ (org-list-get-subtree (marker-position item) struct)))
+ (new-end (org-list-get-item-end (point) struct))
+ (old-end (org-list-get-item-end (marker-position item) struct))
+ (new-item (point))
+ (shift (- (point) item)))
+ ;; 1.1. Remove the item just created in structure.
+ (setq struct (delete (assq new-item struct) struct))
+ ;; 1.2. Copy ITEM and any of its sub-items at NEW-ITEM.
+ (setq struct (sort
+ (append
+ struct
+ (mapcar (lambda (e)
+ (let* ((cell (assq e struct))
+ (pos (car cell))
+ (end (nth 6 cell)))
+ (cons (+ pos shift)
+ (append (butlast (cdr cell))
+ (list (if (= end old-end)
+ new-end
+ (+ end shift)))))))
+ moved-items))
+ #'car-less-than-car)))
+ ;; 2. Restore inner overlays.
+ (dolist (o overlays)
+ (move-overlay o
+ (+ (overlay-start o) (- (point) item))
+ (+ (overlay-end o) (- (point) item))))
+ ;; 3. Eventually delete extra copy of the item and clean marker.
+ (prog1 (org-list-delete-item (marker-position item) struct)
+ (move-marker item nil)))
+ (t struct))))
+
+(defun org-list-struct-outdent (start end struct parents)
+ "Outdent items between positions START and END.
+
+STRUCT is the list structure. PARENTS is the alist of items'
+parents, as returned by `org-list-parents-alist'.
+
+START is included, END excluded."
+ (let* (acc
+ (out (lambda (cell)
+ (let* ((item (car cell))
+ (parent (cdr cell)))
+ (cond
+ ;; Item not yet in zone: keep association.
+ ((< item start) cell)
+ ;; Item out of zone: follow associations in ACC.
+ ((>= item end)
+ (let ((convert (and parent (assq parent acc))))
+ (if convert (cons item (cdr convert)) cell)))
+ ;; Item has no parent: error
+ ((not parent)
+ (error "Cannot outdent top-level items"))
+ ;; Parent is outdented: keep association.
+ ((>= parent start)
+ (push (cons parent item) acc) cell)
+ (t
+ ;; Parent isn't outdented: reparent to grand-parent.
+ (let ((grand-parent (org-list-get-parent
+ parent struct parents)))
+ (push (cons parent item) acc)
+ (cons item grand-parent))))))))
+ (mapcar out parents)))
+
+(defun org-list-struct-indent (start end struct parents prevs)
+ "Indent items between positions START and END.
+
+STRUCT is the list structure. PARENTS is the alist of parents
+and PREVS is the alist of previous items, returned by,
+respectively, `org-list-parents-alist' and
+`org-list-prevs-alist'.
+
+START is included and END excluded.
+
+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))
+ (ind
+ (lambda (cell)
+ (let* ((item (car cell))
+ (parent (cdr cell)))
+ (cond
+ ;; Item not yet in zone: keep association.
+ ((< item start) cell)
+ ((>= item end)
+ ;; Item out of zone: follow associations in ACC.
+ (let ((convert (assq parent acc)))
+ (if convert (cons item (cdr convert)) cell)))
+ (t
+ ;; Item is in zone...
+ (let ((prev (org-list-get-prev-item item struct prevs)))
+ ;; Check if bullet needs to be changed.
+ (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) (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))
+ ;; Previous item not indented: reparent to it.
+ ((< prev start) (funcall set-assoc (cons item prev)))
+ ;; Previous item indented: reparent like it.
+ (t
+ (funcall set-assoc
+ (cons item (cdr (assq prev acc)))))))))))))
+ (mapcar ind parents)))
+
+
+
+;;; Repairing structures
+
+(defun org-list-use-alpha-bul-p (first struct prevs)
+ "Non-nil if list starting at FIRST can have alphabetical bullets.
+
+STRUCT is list structure. PREVS is the alist of previous items,
+as returned by `org-list-prevs-alist'."
+ (and org-list-allow-alphabetical
+ (catch 'exit
+ (let ((item first) (ascii 64) (case-fold-search nil))
+ ;; Pretend that bullets are uppercase and check if alphabet
+ ;; is sufficient, taking counters into account.
+ (while item
+ (let ((count (org-list-get-counter item struct)))
+ ;; Virtually determine current bullet
+ (if (and count (string-match-p "[a-zA-Z]" count))
+ ;; Counters are not case-sensitive.
+ (setq ascii (string-to-char (upcase count)))
+ (setq ascii (1+ ascii)))
+ ;; Test if bullet would be over z or Z.
+ (if (> ascii 90)
+ (throw 'exit nil)
+ (setq item (org-list-get-next-item item struct prevs)))))
+ ;; All items checked. All good.
+ t))))
+
+(defun org-list-inc-bullet-maybe (bullet)
+ "Increment BULLET if applicable."
+ (let ((case-fold-search nil))
+ (cond
+ ;; Num bullet: increment it.
+ ((string-match "[0-9]+" bullet)
+ (replace-match
+ (number-to-string (1+ (string-to-number (match-string 0 bullet))))
+ nil nil bullet))
+ ;; Alpha bullet: increment it.
+ ((string-match "[A-Za-z]" bullet)
+ (replace-match
+ (char-to-string (1+ (string-to-char (match-string 0 bullet))))
+ nil nil bullet))
+ ;; Unordered bullet: leave it.
+ (t bullet))))
+
+(defun org-list-struct-fix-bul (struct prevs)
+ "Verify and correct bullets in STRUCT.
+PREVS is the alist of previous items, as returned by
+`org-list-prevs-alist'.
+
+This function modifies STRUCT."
+ (let ((case-fold-search nil)
+ (fix-bul
+ ;; Set bullet of ITEM in STRUCT, depending on the type of
+ ;; first item of the list, the previous bullet and counter
+ ;; if any.
+ (lambda (item)
+ (let* ((prev (org-list-get-prev-item item struct prevs))
+ (prev-bul (and prev (org-list-get-bullet prev struct)))
+ (counter (org-list-get-counter item struct))
+ (bullet (org-list-get-bullet item struct))
+ (alphap (and (not prev)
+ (org-list-use-alpha-bul-p item struct prevs))))
+ (org-list-set-bullet
+ item struct
+ (org-list-bullet-string
+ (cond
+ ;; Alpha counter in alpha list: use counter.
+ ((and prev counter
+ (string-match "[a-zA-Z]" counter)
+ (string-match "[a-zA-Z]" prev-bul))
+ ;; Use cond to be sure `string-match' is used in
+ ;; both cases.
+ (let ((real-count
+ (cond
+ ((string-match "[a-z]" prev-bul) (downcase counter))
+ ((string-match "[A-Z]" prev-bul) (upcase counter)))))
+ (replace-match real-count nil nil prev-bul)))
+ ;; Num counter in a num list: use counter.
+ ((and prev counter
+ (string-match "[0-9]+" counter)
+ (string-match "[0-9]+" prev-bul))
+ (replace-match counter nil nil prev-bul))
+ ;; No counter: increase, if needed, previous bullet.
+ (prev
+ (org-list-inc-bullet-maybe (org-list-get-bullet prev struct)))
+ ;; Alpha counter at first item: use counter.
+ ((and counter (org-list-use-alpha-bul-p item struct prevs)
+ (string-match "[A-Za-z]" counter)
+ (string-match "[A-Za-z]" bullet))
+ (let ((real-count
+ (cond
+ ((string-match "[a-z]" bullet) (downcase counter))
+ ((string-match "[A-Z]" bullet) (upcase counter)))))
+ (replace-match real-count nil nil bullet)))
+ ;; Num counter at first item: use counter.
+ ((and counter
+ (string-match "[0-9]+" counter)
+ (string-match "[0-9]+" bullet))
+ (replace-match counter nil nil bullet))
+ ;; First bullet is alpha uppercase: use "A".
+ ((and alphap (string-match "[A-Z]" bullet))
+ (replace-match "A" nil nil bullet))
+ ;; First bullet is alpha lowercase: use "a".
+ ((and alphap (string-match "[a-z]" bullet))
+ (replace-match "a" nil nil bullet))
+ ;; First bullet is num: use "1".
+ ((string-match "\\([0-9]+\\|[A-Za-z]\\)" bullet)
+ (replace-match "1" nil nil bullet))
+ ;; Not an ordered list: keep bullet.
+ (t bullet))))))))
+ (mapc fix-bul (mapcar #'car struct))))
+
+(defun org-list-struct-fix-ind (struct parents &optional bullet-size)
+ "Verify and correct indentation in STRUCT.
+
+PARENTS is the alist of parents, as returned by
+`org-list-parents-alist'.
+
+If numeric optional argument BULLET-SIZE is set, assume all
+bullets in list have this length to determine new indentation.
+
+This function modifies STRUCT."
+ (let* ((ancestor (org-list-get-top-point struct))
+ (top-ind (org-list-get-ind ancestor struct))
+ (new-ind
+ (lambda (item)
+ (let ((parent (org-list-get-parent item struct parents)))
+ (if parent
+ ;; Indent like parent + length of parent's bullet +
+ ;; sub-list offset.
+ (org-list-set-ind
+ item struct (+ (or bullet-size
+ (length
+ (org-list-get-bullet parent struct)))
+ (org-list-get-ind parent struct)
+ org-list-indent-offset))
+ ;; If no parent, indent like top-point.
+ (org-list-set-ind item struct top-ind))))))
+ (mapc new-ind (mapcar #'car (cdr struct)))))
+
+(defun org-list-struct-fix-box (struct parents prevs &optional ordered)
+ "Verify and correct checkboxes in STRUCT.
+
+PARENTS is the alist of parents and PREVS is the alist of
+previous items, as returned by, respectively,
+`org-list-parents-alist' and `org-list-prevs-alist'.
+
+If ORDERED is non-nil, a checkbox can only be checked when every
+checkbox before it is checked too. If there was an attempt to
+break this rule, the function will return the blocking item. In
+all others cases, the return value will be nil.
+
+This function modifies STRUCT."
+ (let ((all-items (mapcar #'car struct))
+ (set-parent-box
+ (lambda (item)
+ (let* ((box-list
+ (mapcar (lambda (child)
+ (org-list-get-checkbox child struct))
+ (org-list-get-children item struct parents))))
+ (org-list-set-checkbox
+ item struct
+ (cond
+ ((and (member "[ ]" box-list) (member "[X]" box-list)) "[-]")
+ ((member "[-]" box-list) "[-]")
+ ((member "[X]" box-list) "[X]")
+ ((member "[ ]" box-list) "[ ]")
+ ;; Parent has no boxed child: leave box as-is.
+ (t (org-list-get-checkbox item struct)))))))
+ parent-list)
+ ;; 1. List all parents with a checkbox.
+ (mapc
+ (lambda (e)
+ (let* ((parent (org-list-get-parent e struct parents))
+ (parent-box-p (org-list-get-checkbox parent struct)))
+ (when (and parent-box-p (not (memq parent parent-list)))
+ (push parent parent-list))))
+ all-items)
+ ;; 2. Sort those parents by decreasing indentation.
+ (setq parent-list (sort parent-list
+ (lambda (e1 e2)
+ (> (org-list-get-ind e1 struct)
+ (org-list-get-ind e2 struct)))))
+ ;; 3. For each parent, get all children's checkboxes to determine
+ ;; and set its checkbox accordingly.
+ (mapc set-parent-box parent-list)
+ ;; 4. If ORDERED is set, see if we need to uncheck some boxes.
+ (when ordered
+ (let* ((box-list
+ (mapcar (lambda (e) (org-list-get-checkbox e struct)) all-items))
+ (after-unchecked (member "[ ]" box-list)))
+ ;; There are boxes checked after an unchecked one: fix that.
+ (when (member "[X]" after-unchecked)
+ (let ((index (- (length struct) (length after-unchecked))))
+ (dolist (e (nthcdr index all-items))
+ (when (org-list-get-checkbox e struct)
+ (org-list-set-checkbox e struct "[ ]")))
+ ;; Verify once again the structure, without ORDERED.
+ (org-list-struct-fix-box struct parents prevs nil)
+ ;; Return blocking item.
+ (nth index all-items)))))))
+
+(defun org-list-struct-fix-item-end (struct)
+ "Verify and correct each item end position in STRUCT.
+
+This function modifies STRUCT."
+ (let (end-list acc-end)
+ (pcase-dolist (`(,pos . ,_) struct)
+ (let ((ind-pos (org-list-get-ind pos struct))
+ (end-pos (org-list-get-item-end pos struct)))
+ (unless (assq end-pos struct)
+ ;; To determine real ind of an ending position that is not
+ ;; at an item, we have to find the item it belongs to: it is
+ ;; the last item (ITEM-UP), whose ending is further than the
+ ;; position we're interested in.
+ (let ((item-up (assoc-default end-pos acc-end #'>)))
+ (push (cons
+ ;; Else part is for the bottom point.
+ (if item-up (+ (org-list-get-ind item-up struct) 2) 0)
+ end-pos)
+ end-list)))
+ (push (cons ind-pos pos) end-list)
+ (push (cons end-pos pos) acc-end)))
+ (setq end-list (sort end-list (lambda (e1 e2) (< (cdr e1) (cdr e2)))))
+ (org-list-struct-assoc-end struct end-list)))
+
+(defun org-list-struct-apply-struct (struct old-struct)
+ "Apply set difference between STRUCT and OLD-STRUCT to the buffer.
+
+OLD-STRUCT is the structure before any modifications, and STRUCT
+the structure to be applied. The function will only modify parts
+of the list which have changed.
+
+Initial position of cursor is restored after the changes."
+ (let* ((origin (point-marker))
+ (inlinetask-re (and (featurep 'org-inlinetask)
+ (org-inlinetask-outline-regexp)))
+ (item-re (org-item-re))
+ (shift-body-ind
+ ;; Shift the indentation between END and BEG by DELTA.
+ ;; Start from the line before END.
+ (lambda (end beg delta)
+ (goto-char end)
+ (skip-chars-backward " \r\t\n")
+ (beginning-of-line)
+ (while (or (> (point) beg)
+ (and (= (point) beg)
+ (not (looking-at item-re))))
+ (cond
+ ;; Skip inline tasks.
+ ((and inlinetask-re (looking-at inlinetask-re))
+ (org-inlinetask-goto-beginning))
+ ;; Shift only non-empty lines.
+ ((looking-at-p "^[ \t]*\\S-")
+ (indent-line-to (+ (current-indentation) delta))))
+ (forward-line -1))))
+ (modify-item
+ ;; Replace ITEM first line elements with new elements from
+ ;; STRUCT, if appropriate.
+ (lambda (item)
+ (goto-char item)
+ (let* ((new-ind (org-list-get-ind item struct))
+ (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))
+ (new-box (org-list-get-checkbox item struct)))
+ (looking-at org-list-full-item-re)
+ ;; a. Replace bullet
+ (unless (equal old-bul new-bul)
+ (replace-match new-bul nil nil nil 1))
+ ;; b. Replace checkbox.
+ (cond
+ ((equal (match-string 3) new-box))
+ ((and (match-string 3) new-box)
+ (replace-match new-box nil nil nil 3))
+ ((match-string 3)
+ (looking-at ".*?\\([ \t]*\\[[ X-]\\]\\)")
+ (replace-match "" nil nil nil 1))
+ (t (let ((counterp (match-end 2)))
+ (goto-char (if counterp (1+ counterp) (match-end 1)))
+ (insert (concat new-box (unless counterp " "))))))
+ ;; c. Indent item to appropriate column.
+ (unless (= new-ind old-ind)
+ (delete-region (goto-char (point-at-bol))
+ (progn (skip-chars-forward " \t") (point)))
+ (indent-to new-ind))))))
+ ;; 1. First get list of items and position endings. We maintain
+ ;; two alists: ITM-SHIFT, determining indentation shift needed
+ ;; at item, and END-LIST, a pseudo-alist where key is ending
+ ;; position and value point.
+ (let (end-list acc-end itm-shift all-ends sliced-struct)
+ (dolist (e old-struct)
+ (let* ((pos (car e))
+ (ind-pos (org-list-get-ind pos struct))
+ (ind-old (org-list-get-ind pos old-struct))
+ (bul-pos (org-list-get-bullet pos struct))
+ (bul-old (org-list-get-bullet pos old-struct))
+ (ind-shift (- (+ ind-pos (length bul-pos))
+ (+ ind-old (length bul-old))))
+ (end-pos (org-list-get-item-end pos old-struct)))
+ (push (cons pos ind-shift) itm-shift)
+ (unless (assq end-pos old-struct)
+ ;; To determine real ind of an ending position that
+ ;; is not at an item, we have to find the item it
+ ;; belongs to: it is the last item (ITEM-UP), whose
+ ;; ending is further than the position we're
+ ;; interested in.
+ (let ((item-up (assoc-default end-pos acc-end #'>)))
+ (push (cons end-pos item-up) end-list)))
+ (push (cons end-pos pos) acc-end)))
+ ;; 2. Slice the items into parts that should be shifted by the
+ ;; same amount of indentation. Each slice follow the pattern
+ ;; (END BEG DELTA). Slices are returned in reverse order.
+ (setq all-ends (sort (append (mapcar #'car itm-shift)
+ (org-uniquify (mapcar #'car end-list)))
+ #'<)
+ acc-end (nreverse acc-end))
+ (while (cdr all-ends)
+ (let* ((up (pop all-ends))
+ (down (car all-ends))
+ (itemp (assq up struct))
+ (delta
+ (if itemp (cdr (assq up itm-shift))
+ ;; If we're not at an item, there's a child of the
+ ;; item point belongs to above. Make sure the less
+ ;; indented line in this slice has the same column
+ ;; as that child.
+ (let* ((child (cdr (assq up acc-end)))
+ (ind (org-list-get-ind child struct))
+ (min-ind most-positive-fixnum))
+ (save-excursion
+ (goto-char up)
+ (while (< (point) down)
+ ;; Ignore empty lines. Also ignore blocks and
+ ;; drawers contents.
+ (unless (looking-at-p "[ \t]*$")
+ (setq min-ind (min (current-indentation) min-ind))
+ (cond
+ ((and (looking-at "#\\+BEGIN\\(:\\|_\\S-+\\)")
+ (re-search-forward
+ (format "^[ \t]*#\\+END%s[ \t]*$"
+ (match-string 1))
+ down t)))
+ ((and (looking-at org-drawer-regexp)
+ (re-search-forward "^[ \t]*:END:[ \t]*$"
+ down t)))))
+ (forward-line)))
+ (- ind min-ind)))))
+ (push (list down up delta) sliced-struct)))
+ ;; 3. Shift each slice in buffer, provided delta isn't 0, from
+ ;; end to beginning. Take a special action when beginning is
+ ;; at item bullet.
+ (dolist (e sliced-struct)
+ (unless (zerop (nth 2 e)) (apply shift-body-ind e))
+ (let* ((beg (nth 1 e))
+ (cell (assq beg struct)))
+ (unless (or (not cell) (equal cell (assq beg old-struct)))
+ (funcall modify-item beg)))))
+ ;; 4. Go back to initial position and clean marker.
+ (goto-char origin)
+ (move-marker origin nil)))
+
+(defun org-list-write-struct (struct parents &optional old-struct)
+ "Correct bullets, checkboxes and indentation in list at point.
+
+STRUCT is the list structure. PARENTS is the alist of parents,
+as returned by `org-list-parents-alist'.
+
+When non-nil, optional argument OLD-STRUCT is the reference
+structure of the list. It should be provided whenever STRUCT
+doesn't correspond anymore to the real list in buffer."
+ ;; Order of functions matters here: checkboxes and endings need
+ ;; correct indentation to be set, and indentation needs correct
+ ;; bullets.
+ ;;
+ ;; 0. Save a copy of structure before modifications
+ (let ((old-struct (or old-struct (copy-tree struct))))
+ ;; 1. Set a temporary, but coherent with PARENTS, indentation in
+ ;; order to get items endings and bullets properly
+ (org-list-struct-fix-ind struct parents 2)
+ ;; 2. Fix each item end to get correct prevs alist.
+ (org-list-struct-fix-item-end struct)
+ ;; 3. Get bullets right.
+ (let ((prevs (org-list-prevs-alist struct)))
+ (org-list-struct-fix-bul struct prevs)
+ ;; 4. Now get real indentation.
+ (org-list-struct-fix-ind struct parents)
+ ;; 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))
+ ;; 7. Return the updated structure
+ struct)
+
+
+
+;;; Misc Tools
+
+(defun org-apply-on-list (function init-value &rest args)
+ "Call FUNCTION on each item of the list at point.
+FUNCTION must be called with at least one argument: INIT-VALUE,
+that will contain the value returned by the function at the
+previous item, plus ARGS extra arguments.
+
+FUNCTION is applied on items in reverse order.
+
+As an example, \(org-apply-on-list \(lambda \(result) \(1+ result)) 0)
+will return the number of items in the current list.
+
+Sublists of the list are skipped. Cursor is always at the
+beginning of the item."
+ (let* ((struct (org-list-struct))
+ (prevs (org-list-prevs-alist struct))
+ (item (copy-marker (point-at-bol)))
+ (all (org-list-get-all-items (marker-position item) struct prevs))
+ (value init-value))
+ (dolist (e (nreverse all))
+ (goto-char e)
+ (setq value (apply function value args)))
+ (goto-char item)
+ (move-marker item nil)
+ value))
+
+(defun org-list-set-item-visibility (item struct view)
+ "Set visibility of ITEM in STRUCT to VIEW.
+
+Possible values are: `folded', `children' or `subtree'. See
+`org-cycle' for more information."
+ (cond
+ ((eq view 'folded)
+ (let ((item-end (org-list-get-item-end-before-blank item struct)))
+ ;; Hide from eol
+ (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)
+ ;; Then fold every child.
+ (let* ((parents (org-list-parents-alist struct))
+ (children (org-list-get-children item struct parents)))
+ (dolist (child children)
+ (org-list-set-item-visibility child struct 'folded))))
+ ((eq view 'subtree)
+ ;; Show everything
+ (let ((item-end (org-list-get-item-end item struct)))
+ (org-flag-region item item-end nil 'outline)))))
+
+(defun org-list-item-body-column (item)
+ "Return column at which body of ITEM should start."
+ (save-excursion
+ (goto-char item)
+ (looking-at "[ \t]*\\(\\S-+\\)")
+ (+ (progn (goto-char (match-end 1)) (current-column))
+ (if (and org-list-two-spaces-after-bullet-regexp
+ (string-match-p org-list-two-spaces-after-bullet-regexp
+ (match-string 1)))
+ 2
+ 1))))
+
+
+
+;;; Interactive functions
+
+(defalias 'org-list-get-item-begin 'org-in-item-p)
+
+(defun org-beginning-of-item ()
+ "Go to the beginning of the current item.
+Throw an error when not in a list."
+ (interactive)
+ (let ((begin (org-in-item-p)))
+ (if begin (goto-char begin) (error "Not in an item"))))
+
+(defun org-beginning-of-item-list ()
+ "Go to the beginning item of the current list or sublist.
+Throw an error when not in a list."
+ (interactive)
+ (let ((begin (org-in-item-p)))
+ (if (not begin)
+ (error "Not in an item")
+ (goto-char begin)
+ (let* ((struct (org-list-struct))
+ (prevs (org-list-prevs-alist struct)))
+ (goto-char (org-list-get-list-begin begin struct prevs))))))
+
+(defun org-end-of-item-list ()
+ "Go to the end of the current list or sublist.
+Throw an error when not in a list."
+ (interactive)
+ (let ((begin (org-in-item-p)))
+ (if (not begin)
+ (error "Not in an item")
+ (goto-char begin)
+ (let* ((struct (org-list-struct))
+ (prevs (org-list-prevs-alist struct)))
+ (goto-char (org-list-get-list-end begin struct prevs))))))
+
+(defun org-end-of-item ()
+ "Go to the end of the current item.
+Throw an error when not in a list."
+ (interactive)
+ (let ((begin (org-in-item-p)))
+ (if (not begin)
+ (error "Not in an item")
+ (goto-char begin)
+ (let ((struct (org-list-struct)))
+ (goto-char (org-list-get-item-end begin struct))))))
+
+(defun org-previous-item ()
+ "Move to the beginning of the previous item.
+Throw an error when not in a list. Also throw an error when at
+first item, unless `org-list-use-circular-motion' is non-nil."
+ (interactive)
+ (let ((item (org-in-item-p)))
+ (if (not item)
+ (error "Not in an item")
+ (goto-char item)
+ (let* ((struct (org-list-struct))
+ (prevs (org-list-prevs-alist struct))
+ (prevp (org-list-get-prev-item item struct prevs)))
+ (cond
+ (prevp (goto-char prevp))
+ (org-list-use-circular-motion
+ (goto-char (org-list-get-last-item item struct prevs)))
+ (t (error "On first item")))))))
+
+(defun org-next-item ()
+ "Move to the beginning of the next item.
+Throw an error when not in a list. Also throw an error when at
+last item, unless `org-list-use-circular-motion' is non-nil."
+ (interactive)
+ (let ((item (org-in-item-p)))
+ (if (not item)
+ (error "Not in an item")
+ (goto-char item)
+ (let* ((struct (org-list-struct))
+ (prevs (org-list-prevs-alist struct))
+ (prevp (org-list-get-next-item item struct prevs)))
+ (cond
+ (prevp (goto-char prevp))
+ (org-list-use-circular-motion
+ (goto-char (org-list-get-first-item item struct prevs)))
+ (t (error "On last item")))))))
+
+(defun org-move-item-down ()
+ "Move the item at point down, i.e. swap with following item.
+Sub-items (items with larger indentation) are considered part of
+the item, so this really moves item trees."
+ (interactive)
+ (unless (org-at-item-p) (error "Not at an item"))
+ (let* ((col (current-column))
+ (item (point-at-bol))
+ (struct (org-list-struct))
+ (prevs (org-list-prevs-alist struct))
+ (next-item (org-list-get-next-item (point-at-bol) struct prevs)))
+ (unless (or next-item org-list-use-circular-motion)
+ (user-error "Cannot move this item further down"))
+ (if (not next-item)
+ (setq struct (org-list-send-item item 'begin struct))
+ (setq struct (org-list-swap-items item next-item struct))
+ (goto-char
+ (org-list-get-next-item item struct (org-list-prevs-alist struct))))
+ (org-list-write-struct struct (org-list-parents-alist struct))
+ (org-move-to-column col)))
+
+(defun org-move-item-up ()
+ "Move the item at point up, i.e. swap with previous item.
+Sub-items (items with larger indentation) are considered part of
+the item, so this really moves item trees."
+ (interactive)
+ (unless (org-at-item-p) (error "Not at an item"))
+ (let* ((col (current-column))
+ (item (point-at-bol))
+ (struct (org-list-struct))
+ (prevs (org-list-prevs-alist struct))
+ (prev-item (org-list-get-prev-item (point-at-bol) struct prevs)))
+ (unless (or prev-item org-list-use-circular-motion)
+ (user-error "Cannot move this item further up"))
+ (if (not prev-item)
+ (setq struct (org-list-send-item item 'end struct))
+ (setq struct (org-list-swap-items prev-item item struct)))
+ (org-list-write-struct struct (org-list-parents-alist struct))
+ (org-move-to-column col)))
+
+(defun org-insert-item (&optional checkbox)
+ "Insert a new item at the current level.
+If cursor is before first character after bullet of the item, the
+new item will be created before the current one.
+
+If CHECKBOX is non-nil, add a checkbox next to the bullet.
+
+Return t when things worked, nil when we are not in an item, or
+item is invisible."
+ (interactive "P")
+ (let ((itemp (org-in-item-p))
+ (pos (point)))
+ ;; If cursor isn't is a list or if list is invisible, return nil.
+ (unless (or (not itemp)
+ (save-excursion
+ (goto-char itemp)
+ (org-invisible-p)))
+ (if (save-excursion
+ (goto-char itemp)
+ (org-at-item-timer-p))
+ ;; Timer list: delegate to `org-timer-item'.
+ (progn (org-timer-item) t)
+ (let* ((struct (save-excursion (goto-char itemp)
+ (org-list-struct)))
+ (prevs (org-list-prevs-alist struct))
+ ;; If we're in a description list, ask for the new term.
+ (desc (when (eq (org-list-get-list-type itemp struct prevs)
+ 'descriptive)
+ " :: ")))
+ (setq struct (org-list-insert-item pos struct prevs checkbox desc))
+ (org-list-write-struct struct (org-list-parents-alist struct))
+ (when checkbox (org-update-checkbox-count-maybe))
+ (looking-at org-list-full-item-re)
+ (goto-char (if (and (match-beginning 4)
+ (save-match-data
+ (string-match "[.)]" (match-string 1))))
+ (match-beginning 4)
+ (match-end 0)))
+ (when desc (backward-char 1))
+ t)))))
+
+(defun org-list-repair ()
+ "Fix indentation, bullets and checkboxes in the list at point."
+ (interactive)
+ (unless (org-at-item-p) (error "This is not a list"))
+ (let* ((struct (org-list-struct))
+ (parents (org-list-parents-alist struct)))
+ (org-list-write-struct struct parents)))
+
+(defun org-cycle-list-bullet (&optional which)
+ "Cycle through the different itemize/enumerate bullets.
+This cycle the entire list level through the sequence:
+
+ `-' -> `+' -> `*' -> `1.' -> `1)'
+
+If WHICH is a valid string, use that as the new bullet. If WHICH
+is an integer, 0 means `-', 1 means `+' etc. If WHICH is
+`previous', cycle backwards."
+ (interactive "P")
+ (unless (org-at-item-p) (error "Not at an item"))
+ (save-excursion
+ (beginning-of-line)
+ (let* ((struct (org-list-struct))
+ (parents (org-list-parents-alist struct))
+ (prevs (org-list-prevs-alist struct))
+ (list-beg (org-list-get-first-item (point) struct prevs))
+ (bullet (org-list-get-bullet list-beg struct))
+ (alpha-p (org-list-use-alpha-bul-p list-beg struct prevs))
+ (case-fold-search nil)
+ (current (cond
+ ((string-match "[a-z]\\." bullet) "a.")
+ ((string-match "[a-z])" bullet) "a)")
+ ((string-match "[A-Z]\\." bullet) "A.")
+ ((string-match "[A-Z])" bullet) "A)")
+ ((string-match "\\." bullet) "1.")
+ ((string-match ")" bullet) "1)")
+ (t (org-trim bullet))))
+ ;; Compute list of possible bullets, depending on context.
+ (bullet-list
+ (append '("-" "+" )
+ ;; *-bullets are not allowed at column 0.
+ (unless (looking-at "\\S-") '("*"))
+ ;; Description items cannot be numbered.
+ (unless (or (eq org-plain-list-ordered-item-terminator ?\))
+ (org-at-item-description-p))
+ '("1."))
+ (unless (or (eq org-plain-list-ordered-item-terminator ?.)
+ (org-at-item-description-p))
+ '("1)"))
+ (unless (or (not alpha-p)
+ (eq org-plain-list-ordered-item-terminator ?\))
+ (org-at-item-description-p))
+ '("a." "A."))
+ (unless (or (not alpha-p)
+ (eq org-plain-list-ordered-item-terminator ?.)
+ (org-at-item-description-p))
+ '("a)" "A)"))))
+ (len (length bullet-list))
+ (item-index (- len (length (member current bullet-list))))
+ (get-value (lambda (index) (nth (mod index len) bullet-list)))
+ (new (cond
+ ((member which bullet-list) which)
+ ((numberp which) (funcall get-value which))
+ ((eq 'previous which) (funcall get-value (1- item-index)))
+ (t (funcall get-value (1+ item-index))))))
+ ;; Use a short variation of `org-list-write-struct' as there's
+ ;; no need to go through all the steps.
+ (let ((old-struct (copy-tree struct)))
+ (org-list-set-bullet list-beg struct (org-list-bullet-string new))
+ (org-list-struct-fix-bul struct prevs)
+ (org-list-struct-fix-ind struct parents)
+ (org-list-struct-apply-struct struct old-struct)))))
+
+;;;###autoload
+(define-minor-mode org-list-checkbox-radio-mode
+ "When turned on, use list checkboxes as radio buttons."
+ :lighter " CheckBoxRadio"
+ (unless (eq major-mode 'org-mode)
+ (user-error "Cannot turn this mode outside org-mode buffers")))
+
+(defun org-toggle-radio-button (&optional arg)
+ "Toggle off all checkboxes and toggle on the one at point."
+ (interactive "P")
+ (if (not (org-at-item-p))
+ (user-error "Cannot toggle checkbox outside of a list")
+ (let* ((cpos (org-in-item-p))
+ (struct (org-list-struct))
+ (orderedp (org-entry-get nil "ORDERED"))
+ (parents (org-list-parents-alist struct))
+ (old-struct (copy-tree struct))
+ (cbox (org-list-get-checkbox cpos struct))
+ (prevs (org-list-prevs-alist struct))
+ (start (org-list-get-list-begin (point-at-bol) struct prevs))
+ (new (unless (and cbox (equal arg '(4)) (equal start cpos))
+ "[ ]")))
+ (dolist (pos (org-list-get-all-items
+ start struct (org-list-prevs-alist struct)))
+ (org-list-set-checkbox pos struct new))
+ (when new
+ (org-list-set-checkbox
+ cpos struct
+ (cond ((equal arg '(4)) (unless cbox "[ ]"))
+ ((equal arg '(16)) (unless cbox "[-]"))
+ (t (if (equal cbox "[X]") "[ ]" "[X]")))))
+ (org-list-struct-fix-box struct parents prevs orderedp)
+ (org-list-struct-apply-struct struct old-struct)
+ (org-update-checkbox-count-maybe))))
+
+(defun org-at-radio-list-p ()
+ "Is point at a list item with radio buttons?"
+ (when (org-match-line (org-item-re)) ;short-circuit
+ (let* ((e (save-excursion (beginning-of-line) (org-element-at-point))))
+ ;; Check we're really on a line with a bullet.
+ (when (memq (org-element-type e) '(item plain-list))
+ ;; Look for ATTR_ORG attribute in the current plain list.
+ (let ((plain-list (org-element-lineage e '(plain-list) t)))
+ (org-with-point-at (org-element-property :post-affiliated plain-list)
+ (let ((case-fold-search t)
+ (regexp "^[ \t]*#\\+attr_org:.* :radio \\(\\S-+\\)")
+ (begin (org-element-property :begin plain-list)))
+ (and (re-search-backward regexp begin t)
+ (not (string-equal "nil" (match-string 1)))))))))))
+
+(defun org-toggle-checkbox (&optional toggle-presence)
+ "Toggle the checkbox in the current line.
+
+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 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")
+ (if (org-at-radio-list-p)
+ (org-toggle-radio-button toggle-presence)
+ (save-excursion
+ (let* (singlep
+ block-item
+ lim-up
+ lim-down
+ (orderedp (org-entry-get nil "ORDERED"))
+ (_bounds
+ ;; In a region, start at first item in region.
+ (cond
+ ((org-region-active-p)
+ (let ((limit (region-end)))
+ (goto-char (region-beginning))
+ (if (org-list-search-forward (org-item-beginning-re) limit t)
+ (setq lim-up (point-at-bol))
+ (error "No item in region"))
+ (setq lim-down (copy-marker limit))))
+ ((org-at-heading-p)
+ ;; On a heading, start at first item after drawers and
+ ;; time-stamps (scheduled, etc.).
+ (let ((limit (save-excursion (outline-next-heading) (point))))
+ (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"))
+ (setq lim-down (copy-marker limit))))
+ ;; Just one item: set SINGLEP flag.
+ ((org-at-item-p)
+ (setq singlep t)
+ (setq lim-up (point-at-bol)
+ lim-down (copy-marker (point-at-eol))))
+ (t (error "Not at an item or heading, and no active region"))))
+ ;; Determine the checkbox going to be applied to all items
+ ;; within bounds.
+ (ref-checkbox
+ (progn
+ (goto-char lim-up)
+ (let ((cbox (and (org-at-item-checkbox-p) (match-string 1))))
+ (cond
+ ((equal toggle-presence '(16)) "[-]")
+ ((equal toggle-presence '(4))
+ (unless cbox "[ ]"))
+ ((equal "[X]" cbox) "[ ]")
+ (t "[X]"))))))
+ ;; When an item is found within bounds, grab the full list at
+ ;; point structure, then: (1) set check-box of all its items
+ ;; within bounds to REF-CHECKBOX, (2) fix check-boxes of the
+ ;; whole list, (3) move point after the list.
+ (goto-char lim-up)
+ (while (and (< (point) lim-down)
+ (org-list-search-forward (org-item-beginning-re)
+ lim-down 'move))
+ (let* ((struct (org-list-struct))
+ (struct-copy (copy-tree struct))
+ (parents (org-list-parents-alist struct))
+ (prevs (org-list-prevs-alist struct))
+ (bottom (copy-marker (org-list-get-bottom-point struct)))
+ (items-to-toggle (cl-remove-if
+ (lambda (e) (or (< e lim-up) (> e lim-down)))
+ (mapcar #'car struct))))
+ (dolist (e items-to-toggle)
+ (org-list-set-checkbox
+ e struct
+ ;; If there is no box at item, leave as-is unless
+ ;; function was called with C-u prefix.
+ (let ((cur-box (org-list-get-checkbox e struct)))
+ (if (or cur-box (equal toggle-presence '(4)))
+ ref-checkbox
+ cur-box))))
+ (setq block-item (org-list-struct-fix-box
+ struct parents prevs orderedp))
+ ;; Report some problems due to ORDERED status of subtree.
+ ;; If only one box was being checked, throw an error, else,
+ ;; only signal problems.
+ (cond
+ ((and singlep block-item (> lim-up block-item))
+ (error
+ "Checkbox blocked because of unchecked box at line %d"
+ (org-current-line block-item)))
+ (block-item
+ (message
+ "Checkboxes were removed due to unchecked box at line %d"
+ (org-current-line block-item))))
+ (goto-char bottom)
+ (move-marker bottom nil)
+ (org-list-struct-apply-struct struct struct-copy)))
+ (move-marker lim-down nil))))
+ (org-update-checkbox-count-maybe))
+
+(defun org-reset-checkbox-state-subtree ()
+ "Reset all checkboxes in an entry subtree."
+ (interactive "*")
+ (if (org-before-first-heading-p)
+ (error "Not inside a tree")
+ (save-restriction
+ (save-excursion
+ (org-narrow-to-subtree)
+ (org-show-subtree)
+ (goto-char (point-min))
+ (let ((end (point-max)))
+ (while (< (point) end)
+ (when (org-at-item-checkbox-p)
+ (replace-match "[ ]" t t nil 1))
+ (beginning-of-line 2)))
+ (org-update-checkbox-count-maybe 'all)))))
+
+(defun org-update-checkbox-count (&optional all)
+ "Update the checkbox statistics in the current section.
+
+This will find all statistic cookies like [57%] and [6/12] and
+update them with the current numbers.
+
+With optional prefix argument ALL, do this for the whole buffer."
+ (interactive "P")
+ (org-with-wide-buffer
+ (let* ((cookie-re "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)")
+ (box-re "^[ \t]*\\([-+*]\\|\\([0-9]+\\|[A-Za-z]\\)[.)]\\)[ \t]+\
+\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\][ \t]*\\)?\\(\\[[- X]\\]\\)")
+ (cookie-data (or (org-entry-get nil "COOKIE_DATA") ""))
+ (recursivep
+ (or (not org-checkbox-hierarchical-statistics)
+ (string-match-p "\\<recursive\\>" cookie-data)))
+ (within-inlinetask (and (not all)
+ (featurep 'org-inlinetask)
+ (org-inlinetask-in-task-p)))
+ (end (cond (all (point-max))
+ (within-inlinetask
+ (save-excursion (outline-next-heading) (point)))
+ (t (save-excursion
+ (org-with-limited-levels (outline-next-heading))
+ (point)))))
+ (count-boxes
+ (lambda (item structs recursivep)
+ ;; Return number of checked boxes and boxes of all types
+ ;; in all structures in STRUCTS. If RECURSIVEP is
+ ;; non-nil, also count boxes in sub-lists. If ITEM is
+ ;; nil, count across the whole structure, else count only
+ ;; across subtree whose ancestor is ITEM.
+ (let ((c-on 0) (c-all 0))
+ (dolist (s structs (list c-on c-all))
+ (let* ((pre (org-list-prevs-alist s))
+ (par (org-list-parents-alist s))
+ (items
+ (cond
+ ((and recursivep item) (org-list-get-subtree item s))
+ (recursivep (mapcar #'car s))
+ (item (org-list-get-children item s par))
+ (t (org-list-get-all-items
+ (org-list-get-top-point s) s pre))))
+ (cookies (delq nil (mapcar
+ (lambda (e)
+ (org-list-get-checkbox e s))
+ items))))
+ (cl-incf c-all (length cookies))
+ (cl-incf c-on (cl-count "[X]" cookies :test #'equal)))))))
+ cookies-list cache)
+ ;; Move to start.
+ (cond (all (goto-char (point-min)))
+ (within-inlinetask (org-back-to-heading t))
+ (t (org-with-limited-levels (outline-previous-heading))))
+ ;; Build an alist for each cookie found. The key is the position
+ ;; at beginning of cookie and values ending position, format of
+ ;; cookie, number of checked boxes to report and total number of
+ ;; boxes.
+ (while (re-search-forward cookie-re end t)
+ (let ((context (save-excursion (backward-char)
+ (save-match-data (org-element-context)))))
+ (when (and (eq (org-element-type context) 'statistics-cookie)
+ (not (string-match-p "\\<todo\\>" cookie-data)))
+ (push
+ (append
+ (list (match-beginning 1) (match-end 1) (match-end 2))
+ (let* ((container
+ (org-element-lineage
+ context
+ '(drawer center-block dynamic-block inlinetask item
+ quote-block special-block verse-block)))
+ (beg (if container
+ (org-element-property :contents-begin container)
+ (save-excursion
+ (org-with-limited-levels
+ (outline-previous-heading))
+ (point)))))
+ (or (cdr (assq beg cache))
+ (save-excursion
+ (goto-char beg)
+ (let ((end
+ (if container
+ (org-element-property :contents-end container)
+ (save-excursion
+ (org-with-limited-levels (outline-next-heading))
+ (point))))
+ structs)
+ (while (re-search-forward box-re end t)
+ (let ((element (org-element-at-point)))
+ (when (eq (org-element-type element) 'item)
+ (push (org-element-property :structure element)
+ structs)
+ ;; Skip whole list since we have its
+ ;; structure anyway.
+ (while (setq element (org-element-lineage
+ element '(plain-list)))
+ (goto-char
+ (min (org-element-property :end element)
+ end))))))
+ ;; Cache count for cookies applying to the same
+ ;; area. Then return it.
+ (let ((count
+ (funcall count-boxes
+ (and (eq (org-element-type container)
+ 'item)
+ (org-element-property
+ :begin container))
+ structs
+ recursivep)))
+ (push (cons beg count) cache)
+ count))))))
+ cookies-list))))
+ ;; Apply alist to buffer.
+ (dolist (cookie cookies-list)
+ (let* ((beg (car cookie))
+ (end (nth 1 cookie))
+ (percent (nth 2 cookie))
+ (checked (nth 3 cookie))
+ (total (nth 4 cookie)))
+ (goto-char beg)
+ (insert
+ (if percent (format "[%d%%]" (floor (* 100.0 checked)
+ (max 1 total)))
+ (format "[%d/%d]" checked total)))
+ (delete-region (point) (+ (point) (- end beg)))
+ (when org-auto-align-tags (org-fix-tags-on-the-fly)))))))
+
+(defun org-get-checkbox-statistics-face ()
+ "Select the face for checkbox statistics.
+The face will be `org-done' when all relevant boxes are checked.
+Otherwise it will be `org-todo'."
+ (if (match-end 1)
+ (if (equal (match-string 1) "100%")
+ 'org-checkbox-statistics-done
+ 'org-checkbox-statistics-todo)
+ (if (and (> (match-end 2) (match-beginning 2))
+ (equal (match-string 2) (match-string 3)))
+ 'org-checkbox-statistics-done
+ 'org-checkbox-statistics-todo)))
+
+(defun org-update-checkbox-count-maybe (&optional all)
+ "Update checkbox statistics unless turned off by user.
+With an optional argument ALL, update them in the whole buffer."
+ (when (cdr (assq 'checkbox org-list-automatic-rules))
+ (org-update-checkbox-count all))
+ (run-hooks 'org-checkbox-statistics-hook))
+
+(defvar org-last-indent-begin-marker (make-marker))
+(defvar org-last-indent-end-marker (make-marker))
+(defun org-list-indent-item-generic (arg no-subtree struct)
+ "Indent a local list item including its children.
+When number ARG is a negative, item will be outdented, otherwise
+it will be indented.
+
+If a region is active, all items inside will be moved.
+
+If NO-SUBTREE is non-nil, only indent the item itself, not its
+children.
+
+STRUCT is the list structure.
+
+Return t if successful."
+ (save-excursion
+ (let* ((regionp (org-region-active-p))
+ (rbeg (and regionp (region-beginning)))
+ (rend (and regionp (region-end)))
+ (top (org-list-get-top-point struct))
+ (parents (org-list-parents-alist struct))
+ (prevs (org-list-prevs-alist struct))
+ ;; Are we going to move the whole list?
+ (specialp
+ (and (not regionp)
+ (= top (point-at-bol))
+ (cdr (assq 'indent org-list-automatic-rules))
+ (if no-subtree
+ (user-error
+ "At first item: use S-M-<left/right> to move the whole list")
+ t))))
+ ;; Determine begin and end points of zone to indent. If moving
+ ;; more than one item, save them for subsequent moves.
+ (unless (and (memq last-command '(org-shiftmetaright org-shiftmetaleft))
+ (memq this-command '(org-shiftmetaright org-shiftmetaleft)))
+ (if regionp
+ (progn
+ (set-marker org-last-indent-begin-marker rbeg)
+ (set-marker org-last-indent-end-marker rend))
+ (set-marker org-last-indent-begin-marker (point-at-bol))
+ (set-marker org-last-indent-end-marker
+ (cond
+ (specialp (org-list-get-bottom-point struct))
+ (no-subtree (1+ (point-at-bol)))
+ (t (org-list-get-item-end (point-at-bol) struct))))))
+ (let* ((beg (marker-position org-last-indent-begin-marker))
+ (end (marker-position org-last-indent-end-marker)))
+ (cond
+ ;; Special case: moving top-item with indent rule.
+ (specialp
+ (let* ((level-skip (org-level-increment))
+ (offset (if (< arg 0) (- level-skip) level-skip))
+ (top-ind (org-list-get-ind beg struct))
+ (old-struct (copy-tree struct)))
+ (if (< (+ top-ind offset) 0)
+ (error "Cannot outdent beyond margin")
+ ;; Change bullet if necessary.
+ (when (and (= (+ top-ind offset) 0)
+ (string-match "\\*"
+ (org-list-get-bullet beg struct)))
+ (org-list-set-bullet beg struct
+ (org-list-bullet-string "-")))
+ ;; Shift every item by OFFSET and fix bullets. Then
+ ;; apply changes to buffer.
+ (pcase-dolist (`(,pos . ,_) struct)
+ (let ((ind (org-list-get-ind pos struct)))
+ (org-list-set-ind pos struct (+ ind offset))))
+ (org-list-struct-fix-bul struct prevs)
+ (org-list-struct-apply-struct struct old-struct))))
+ ;; Forbidden move:
+ ((and (< arg 0)
+ ;; If only one item is moved, it mustn't have a child.
+ (or (and no-subtree
+ (not regionp)
+ (org-list-has-child-p beg struct))
+ ;; If a subtree or region is moved, the last item
+ ;; of the subtree mustn't have a child.
+ (let ((last-item (caar
+ (reverse
+ (cl-remove-if
+ (lambda (e) (>= (car e) end))
+ struct)))))
+ (org-list-has-child-p last-item struct))))
+ (error "Cannot outdent an item without its children"))
+ ;; Normal shifting
+ (t
+ (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 old-struct))
+ (org-update-checkbox-count-maybe))))))
+ t)
+
+(defun org-outdent-item ()
+ "Outdent a local list item, but not its children.
+If a region is active, all items inside will be moved."
+ (interactive)
+ (let ((regionp (org-region-active-p)))
+ (cond
+ ((or (org-at-item-p)
+ (and regionp
+ (save-excursion (goto-char (region-beginning))
+ (org-at-item-p))))
+ (let ((struct (if (not regionp) (org-list-struct)
+ (save-excursion (goto-char (region-beginning))
+ (org-list-struct)))))
+ (org-list-indent-item-generic -1 t struct)))
+ (regionp (error "Region not starting at an item"))
+ (t (error "Not at an item")))))
+
+(defun org-indent-item ()
+ "Indent a local list item, but not its children.
+If a region is active, all items inside will be moved."
+ (interactive)
+ (let ((regionp (org-region-active-p)))
+ (cond
+ ((or (org-at-item-p)
+ (and regionp
+ (save-excursion (goto-char (region-beginning))
+ (org-at-item-p))))
+ (let ((struct (if (not regionp) (org-list-struct)
+ (save-excursion (goto-char (region-beginning))
+ (org-list-struct)))))
+ (org-list-indent-item-generic 1 t struct)))
+ (regionp (error "Region not starting at an item"))
+ (t (error "Not at an item")))))
+
+(defun org-outdent-item-tree ()
+ "Outdent a local list item including its children.
+If a region is active, all items inside will be moved."
+ (interactive)
+ (let ((regionp (org-region-active-p)))
+ (cond
+ ((or (org-at-item-p)
+ (and regionp
+ (save-excursion (goto-char (region-beginning))
+ (org-at-item-p))))
+ (let ((struct (if (not regionp) (org-list-struct)
+ (save-excursion (goto-char (region-beginning))
+ (org-list-struct)))))
+ (org-list-indent-item-generic -1 nil struct)))
+ (regionp (error "Region not starting at an item"))
+ (t (error "Not at an item")))))
+
+(defun org-indent-item-tree ()
+ "Indent a local list item including its children.
+If a region is active, all items inside will be moved."
+ (interactive)
+ (let ((regionp (org-region-active-p)))
+ (cond
+ ((or (org-at-item-p)
+ (and regionp
+ (save-excursion (goto-char (region-beginning))
+ (org-at-item-p))))
+ (let ((struct (if (not regionp) (org-list-struct)
+ (save-excursion (goto-char (region-beginning))
+ (org-list-struct)))))
+ (org-list-indent-item-generic 1 nil struct)))
+ (regionp (error "Region not starting at an item"))
+ (t (error "Not at an item")))))
+
+(defvar org-tab-ind-state)
+(defun org-cycle-item-indentation ()
+ "Cycle levels of indentation of an empty item.
+
+The first run indents the item, if applicable. Subsequent runs
+outdent it at meaningful levels in the list. When done, item is
+put back at its original position with its original bullet.
+
+Return t at each successful move."
+ (when (org-at-item-p)
+ (let* ((struct (org-list-struct))
+ (item (line-beginning-position))
+ (ind (org-list-get-ind item struct)))
+ ;; Accept empty items or if cycle has already started.
+ (when (or (eq last-command 'org-cycle-item-indentation)
+ (and (org-match-line org-list-full-item-re)
+ (>= (match-end 0)
+ (save-excursion
+ (goto-char (org-list-get-item-end item struct))
+ (skip-chars-backward " \t\n")
+ (point)))))
+ (setq this-command 'org-cycle-item-indentation)
+ (let ((prevs (org-list-prevs-alist struct))
+ (parents (org-list-parents-alist struct)))
+ (if (eq last-command 'org-cycle-item-indentation)
+ ;; When in the middle of the cycle, try to outdent. If
+ ;; it fails, move point back to its initial position and
+ ;; reset cycle.
+ (pcase-let ((`(,old-ind . ,old-bul) org-tab-ind-state)
+ (allow-outdent
+ (lambda (struct prevs parents)
+ ;; Non-nil if current item can be
+ ;; outdented.
+ (and (not (org-list-get-next-item item nil prevs))
+ (not (org-list-has-child-p item struct))
+ (org-list-get-parent item struct parents)))))
+ (cond
+ ((and (> ind old-ind)
+ (org-list-get-prev-item item nil prevs))
+ (org-list-indent-item-generic 1 t struct))
+ ((and (< ind old-ind)
+ (funcall allow-outdent struct prevs parents))
+ (org-list-indent-item-generic -1 t struct))
+ (t
+ (delete-region (line-beginning-position) (line-end-position))
+ (indent-to-column old-ind)
+ (insert old-bul " ")
+ (let* ((struct (org-list-struct))
+ (parents (org-list-parents-alist struct)))
+ (if (and (> ind old-ind)
+ ;; We were previously indenting item. It
+ ;; is no longer possible. Try to outdent
+ ;; from initial position.
+ (funcall allow-outdent
+ struct
+ (org-list-prevs-alist struct)
+ parents))
+ (org-list-indent-item-generic -1 t struct)
+ (org-list-write-struct struct parents)
+ ;; Start cycle over.
+ (setq this-command 'identity)
+ t)))))
+ ;; If a cycle is starting, remember initial indentation
+ ;; and bullet, then try to indent. If it fails, try to
+ ;; outdent.
+ (setq org-tab-ind-state
+ (cons ind (org-trim (org-current-line-string))))
+ (cond
+ ((org-list-get-prev-item item nil prevs)
+ (org-list-indent-item-generic 1 t struct))
+ ((and (not (org-list-get-next-item item nil prevs))
+ (org-list-get-parent item struct parents))
+ (org-list-indent-item-generic -1 t struct))
+ (t
+ ;; This command failed. So will the following one.
+ ;; There's no point in starting the cycle.
+ (setq this-command 'identity)
+ (user-error "Cannot move item")))))))))
+
+(defun org-sort-list
+ (&optional with-case sorting-type getkey-func compare-func interactive?)
+ "Sort list items.
+The cursor may be at any item of the list that should be sorted.
+Sublists are not sorted. Checkboxes, if any, are ignored.
+
+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,
+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
+be a character, among ?n ?N ?a ?A ?t ?T ?f ?F ?x or ?X. Here is
+the detailed meaning of each character:
+
+n Numerically, by converting the beginning of the item to a number.
+a Alphabetically. Only the first line of item is checked.
+t By date/time, either the first active time stamp in the entry, if
+ any, or by the first inactive one. In a timer list, sort the timers.
+x By \"checked\" status of a check list.
+
+Capital letters will reverse the sort order.
+
+If the SORTING-TYPE is ?f or ?F, then GETKEY-FUNC specifies
+a function to be called with point at the beginning of the
+record. It must return a value that is compatible with COMPARE-FUNC,
+the function used to compare entries.
+
+Sorting is done against the visible part of the headlines, it
+ignores hidden links.
+
+A non-nil value for INTERACTIVE? is used to signal that this
+function is being called interactively."
+ (interactive (list current-prefix-arg nil nil nil t))
+ (let* ((case-func (if with-case 'identity 'downcase))
+ (struct (org-list-struct))
+ (prevs (org-list-prevs-alist struct))
+ (start (org-list-get-list-begin (point-at-bol) struct prevs))
+ (end (org-list-get-list-end (point-at-bol) struct prevs))
+ (sorting-type
+ (or sorting-type
+ (progn
+ (message
+ "Sort plain list: [a]lpha [n]umeric [t]ime [f]unc [x]checked A/N/T/F/X means reversed:")
+ (read-char-exclusive))))
+ (dcst (downcase sorting-type))
+ (getkey-func
+ (and (= dcst ?f)
+ (or getkey-func
+ (and interactive?
+ (org-read-function "Function for extracting keys: "))
+ (error "Missing key extractor"))))
+ (sort-func
+ (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))))
+ ((= dcst ?t) #'<)
+ ((= dcst ?x) #'string<))))
+ (message "Sorting items...")
+ (save-restriction
+ (narrow-to-region start end)
+ (goto-char (point-min))
+ (let* ((case-fold-search nil)
+ (now (current-time))
+ (next-record (lambda ()
+ (skip-chars-forward " \r\t\n")
+ (or (eobp) (beginning-of-line))))
+ (end-record (lambda ()
+ (goto-char (org-list-get-item-end-before-blank
+ (point) struct))))
+ (value-to-sort
+ (lambda ()
+ (when (looking-at "[ \t]*[-+*0-9.)]+\\([ \t]+\\[[- X]\\]\\)?[ \t]+")
+ (cond
+ ((= dcst ?n)
+ (string-to-number
+ (org-sort-remove-invisible
+ (buffer-substring (match-end 0) (point-at-eol)))))
+ ((= dcst ?a)
+ (funcall case-func
+ (org-sort-remove-invisible
+ (buffer-substring
+ (match-end 0) (point-at-eol)))))
+ ((= dcst ?t)
+ (cond
+ ;; If it is a timer list, convert timer to seconds
+ ((org-at-item-timer-p)
+ (org-timer-hms-to-secs (match-string 1)))
+ ((or (save-excursion
+ (re-search-forward org-ts-regexp (point-at-eol) t))
+ (save-excursion (re-search-forward org-ts-regexp-both
+ (point-at-eol) t)))
+ (org-time-string-to-seconds (match-string 0)))
+ (t (float-time now))))
+ ((= dcst ?x) (or (and (stringp (match-string 1))
+ (match-string 1))
+ ""))
+ ((= dcst ?f)
+ (if getkey-func
+ (let ((value (funcall getkey-func)))
+ (if (stringp value)
+ (funcall case-func value)
+ value))
+ (error "Invalid key function `%s'" getkey-func)))
+ (t (error "Invalid sorting type `%c'" sorting-type)))))))
+ (sort-subr (/= dcst sorting-type)
+ next-record
+ end-record
+ value-to-sort
+ nil
+ sort-func)
+ ;; Read and fix list again, as `sort-subr' probably destroyed
+ ;; its structure.
+ (org-list-repair)
+ (run-hooks 'org-after-sorting-entries-or-items-hook)
+ (message "Sorting items...done")))))
+
+(defun org-toggle-item (arg)
+ "Convert headings or normal lines to items, items to normal lines.
+If there is no active region, only the current line is considered.
+
+If the first non blank line in the region is a headline, convert
+all headlines to items, shifting text accordingly.
+
+If it is an item, convert all items to normal lines.
+
+If it is normal text, change region into a list of items.
+With a prefix argument ARG, change the region in a single item."
+ (interactive "P")
+ (let ((shift-text
+ (lambda (ind end)
+ ;; Shift text in current section to IND, from point to END.
+ ;; The function leaves point to END line.
+ (let ((min-i 1000) (end (copy-marker end)))
+ ;; First determine the minimum indentation (MIN-I) of
+ ;; the text.
+ (save-excursion
+ (catch 'exit
+ (while (< (point) end)
+ (let ((i (current-indentation)))
+ (cond
+ ;; Skip blank lines and inline tasks.
+ ((looking-at "^[ \t]*$"))
+ ((looking-at org-outline-regexp-bol))
+ ;; We can't find less than 0 indentation.
+ ((zerop i) (throw 'exit (setq min-i 0)))
+ ((< i min-i) (setq min-i i))))
+ (forward-line))))
+ ;; Then indent each line so that a line indented to
+ ;; MIN-I becomes indented to IND. Ignore blank lines
+ ;; and inline tasks in the process.
+ (let ((delta (- ind min-i)))
+ (while (< (point) end)
+ (unless (or (looking-at "^[ \t]*$")
+ (looking-at org-outline-regexp-bol))
+ (indent-line-to (+ (current-indentation) delta)))
+ (forward-line))))))
+ (skip-blanks
+ (lambda (pos)
+ ;; Return beginning of first non-blank line, starting from
+ ;; line at POS.
+ (save-excursion
+ (goto-char pos)
+ (skip-chars-forward " \r\t\n")
+ (point-at-bol))))
+ beg end)
+ ;; Determine boundaries of changes.
+ (if (org-region-active-p)
+ (setq beg (funcall skip-blanks (region-beginning))
+ end (copy-marker (region-end)))
+ (setq beg (point-at-bol)
+ end (copy-marker (point-at-eol))))
+ ;; Depending on the starting line, choose an action on the text
+ ;; between BEG and END.
+ (org-with-limited-levels
+ (save-excursion
+ (goto-char beg)
+ (cond
+ ;; Case 1. Start at an item: de-itemize. Note that it only
+ ;; happens when a region is active: `org-ctrl-c-minus'
+ ;; would call `org-cycle-list-bullet' otherwise.
+ ((org-at-item-p)
+ (while (< (point) end)
+ (when (org-at-item-p)
+ (skip-chars-forward " \t")
+ (delete-region (point) (match-end 0)))
+ (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
+ ;; relative to the indentation of its parent, if any.
+ (start-ind (save-excursion
+ (cond
+ ((not org-adapt-indentation) 0)
+ ((not (outline-previous-heading)) 0)
+ (t (length (match-string 0))))))
+ ;; Level of first heading. Further headings will be
+ ;; compared to it to determine hierarchy in the list.
+ (ref-level (org-reduced-level (org-outline-level))))
+ (while (< (point) end)
+ (let* ((level (org-reduced-level (org-outline-level)))
+ (delta (max 0 (- level ref-level)))
+ (todo-state (org-get-todo-state)))
+ ;; If current headline is less indented than the first
+ ;; 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)
+ (line-end-position)))
+ (insert bul)
+ (indent-line-to (+ start-ind (* delta bul-len)))
+ ;; Turn TODO keyword into a check box.
+ (when todo-state
+ (let* ((struct (org-list-struct))
+ (old (copy-tree struct)))
+ (org-list-set-checkbox
+ (line-beginning-position)
+ struct
+ (if (member todo-state org-done-keywords)
+ "[X]"
+ "[ ]"))
+ (org-list-write-struct struct
+ (org-list-parents-alist struct)
+ old)))
+ ;; Ensure all text down to END (or SECTION-END) belongs
+ ;; to the newly created item.
+ (let ((section-end (save-excursion
+ (or (outline-next-heading) (point)))))
+ (forward-line)
+ (funcall shift-text
+ (+ start-ind (* (1+ delta) bul-len))
+ (min end section-end)))))))
+ ;; Case 3. Normal line with ARG: make the first line of region
+ ;; an item, and shift indentation of others lines to
+ ;; set them as item's body.
+ (arg (let* ((bul (org-list-bullet-string "-"))
+ (bul-len (length bul))
+ (ref-ind (current-indentation)))
+ (skip-chars-forward " \t")
+ (insert bul)
+ (forward-line)
+ (while (< (point) end)
+ ;; Ensure that lines less indented than first one
+ ;; still get included in item body.
+ (funcall shift-text
+ (+ ref-ind bul-len)
+ (min end (save-excursion (or (outline-next-heading)
+ (point)))))
+ (forward-line))))
+ ;; Case 4. Normal line without ARG: turn each non-item line
+ ;; into an item.
+ (t
+ (while (< (point) end)
+ (unless (or (org-at-heading-p) (org-at-item-p))
+ (when (looking-at "\\([ \t]*\\)\\(\\S-\\)")
+ (replace-match
+ (concat "\\1" (org-list-bullet-string "-") "\\2"))))
+ (forward-line))))))))
+
+
+;;; Send and receive lists
+
+(defun org-list-to-lisp (&optional delete)
+ "Parse the list at point and maybe DELETE it.
+
+Return a list whose car is a symbol of list type, among
+`ordered', `unordered' and `descriptive'. Then, each item is
+a list of strings and other sub-lists.
+
+For example, the following list:
+
+ 1. first item
+ + sub-item one
+ + [X] sub-item two
+ more text in first item
+ 2. [@3] last item
+
+is parsed as
+
+ (ordered
+ (\"first item\"
+ (unordered
+ (\"sub-item one\")
+ (\"[X] sub-item two\"))
+ \"more text in first item\")
+ (\"[@3] last item\"))
+
+Point is left at list's end."
+ (letrec ((struct (org-list-struct))
+ (prevs (org-list-prevs-alist struct))
+ (parents (org-list-parents-alist struct))
+ (top (org-list-get-top-point struct))
+ (bottom (org-list-get-bottom-point struct))
+ (trim
+ (lambda (text)
+ ;; Remove indentation and final newline from TEXT.
+ (org-remove-indentation
+ (if (string-match-p "\n\\'" text)
+ (substring text 0 -1)
+ text))))
+ (parse-sublist
+ (lambda (e)
+ ;; Return a list whose car is list type and cdr a list
+ ;; of items' body.
+ (cons (org-list-get-list-type (car e) struct prevs)
+ (mapcar parse-item e))))
+ (parse-item
+ (lambda (e)
+ ;; Return a list containing counter of item, if any,
+ ;; text and any sublist inside it.
+ (let* ((end (org-list-get-item-end e struct))
+ (children (org-list-get-children e struct parents))
+ (body
+ (save-excursion
+ (goto-char e)
+ (looking-at "[ \t]*\\S-+[ \t]*")
+ (list
+ (funcall
+ trim
+ (concat
+ (make-string (string-width (match-string 0)) ?\s)
+ (buffer-substring-no-properties
+ (match-end 0) (or (car children) end))))))))
+ (while children
+ (let* ((child (car children))
+ (sub (org-list-get-all-items child struct prevs))
+ (last-in-sub (car (last sub))))
+ (push (funcall parse-sublist sub) body)
+ ;; Remove whole sub-list from children.
+ (setq children (cdr (memq last-in-sub children)))
+ ;; There is a chunk of text belonging to the item
+ ;; if last child doesn't end where next child
+ ;; starts or where item ends.
+ (let ((sub-end (org-list-get-item-end last-in-sub struct))
+ (next (or (car children) end)))
+ (when (/= sub-end next)
+ (push (funcall
+ trim
+ (buffer-substring-no-properties sub-end next))
+ body)))))
+ (nreverse body)))))
+ ;; Store output, take care of cursor position and deletion of
+ ;; list, then return output.
+ (prog1 (funcall parse-sublist (org-list-get-all-items top struct prevs))
+ (goto-char top)
+ (when delete
+ (delete-region top bottom)
+ (when (and (not (looking-at "[ \t]*$")) (looking-at org-list-end-re))
+ (replace-match ""))))))
+
+(defun org-list-make-subtree ()
+ "Convert the plain list at point into a subtree."
+ (interactive)
+ (let ((item (org-in-item-p)))
+ (unless item (error "Not in a list"))
+ (goto-char item)
+ (let ((level (pcase (org-current-level)
+ (`nil 1)
+ (l (1+ (org-reduced-level l)))))
+ (list (save-excursion (org-list-to-lisp t))))
+ (insert (org-list-to-subtree list level) "\n"))))
+
+(defun org-list-to-generic (list params)
+ "Convert a LIST parsed through `org-list-to-lisp' to a custom format.
+
+LIST is a list as returned by `org-list-to-lisp', which see.
+PARAMS is a property list of parameters used to tweak the output
+format.
+
+Valid parameters are:
+
+:backend, :raw
+
+ Export back-end used as a basis to transcode elements of the
+ list, when no specific parameter applies to it. It is also
+ used to translate its contents. You can prevent this by
+ setting :raw property to a non-nil value.
+
+:splice
+
+ When non-nil, only export the contents of the top most plain
+ list, effectively ignoring its opening and closing lines.
+
+:ustart, :uend
+
+ Strings to start and end an unordered list. They can also be
+ set to a function returning a string or nil, which will be
+ called with the depth of the list, counting from 1.
+
+:ostart, :oend
+
+ Strings to start and end an ordered list. They can also be set
+ to a function returning a string or nil, which will be called
+ with the depth of the list, counting from 1.
+
+:dstart, :dend
+
+ Strings to start and end a descriptive list. They can also be
+ set to a function returning a string or nil, which will be
+ called with the depth of the list, counting from 1.
+
+:dtstart, :dtend, :ddstart, :ddend
+
+ Strings to start and end a descriptive term.
+
+:istart, :iend
+
+ Strings to start or end a list item, and to start a list item
+ with a counter. They can also be set to a function returning
+ a string or nil, which will be called with two arguments: the
+ type of list and the depth of the item, counting from 1.
+
+:icount
+
+ Strings to start a list item with a counter. It can also be
+ set to a function returning a string or nil, which will be
+ called with three arguments: the type of list, the depth of the
+ item, counting from 1, and the counter. Its value, when
+ non-nil, has precedence over `:istart'.
+
+:isep
+
+ String used to separate items. It can also be set to
+ a function returning a string or nil, which will be called with
+ two arguments: the type of list and the depth of the item,
+ counting from 1. It always start on a new line.
+
+:ifmt
+
+ Function to be applied to the contents of every item. It is
+ called with two arguments: the type of list and the contents.
+
+:cbon, :cboff, :cbtrans
+
+ String to insert, respectively, an un-checked check-box,
+ a checked check-box and a check-box in transitional state."
+ (require 'ox)
+ (let* ((backend (plist-get params :backend))
+ (custom-backend
+ (org-export-create-backend
+ :parent (or backend 'org)
+ :transcoders
+ `((plain-list . ,(org-list--to-generic-plain-list params))
+ (item . ,(org-list--to-generic-item params))
+ (macro . (lambda (m c i) (org-element-macro-interpreter m nil))))))
+ data info)
+ ;; Write LIST back into Org syntax and parse it.
+ (with-temp-buffer
+ (let ((org-inhibit-startup t)) (org-mode))
+ (letrec ((insert-list
+ (lambda (l)
+ (dolist (i (cdr l))
+ (funcall insert-item i (car l)))))
+ (insert-item
+ (lambda (i type)
+ (let ((start (point)))
+ (insert (if (eq type 'ordered) "1. " "- "))
+ (dolist (e i)
+ (if (consp e) (funcall insert-list e)
+ (insert e)
+ (insert "\n")))
+ (beginning-of-line)
+ (save-excursion
+ (let ((ind (if (eq type 'ordered) 3 2)))
+ (while (> (point) start)
+ (unless (looking-at-p "[ \t]*$")
+ (indent-to ind))
+ (forward-line -1))))))))
+ (funcall insert-list list))
+ (setf data
+ (org-element-map (org-element-parse-buffer) 'plain-list
+ #'identity nil t))
+ (setf info (org-export-get-environment backend nil params)))
+ (when (and backend (symbolp backend) (not (org-export-get-backend backend)))
+ (user-error "Unknown :backend value"))
+ (unless backend (require 'ox-org))
+ ;; When ':raw' property has a non-nil value, turn all objects back
+ ;; into Org syntax.
+ (when (and backend (plist-get params :raw))
+ (org-element-map data org-element-all-objects
+ (lambda (object)
+ (org-element-set-element
+ object (org-element-interpret-data object)))))
+ ;; We use a low-level mechanism to export DATA so as to skip all
+ ;; usual pre-processing and post-processing, i.e., hooks, filters,
+ ;; Babel code evaluation, include keywords and macro expansion,
+ ;; and filters.
+ (let ((output (org-export-data-with-backend data custom-backend info)))
+ ;; Remove final newline.
+ (if (org-string-nw-p output) (substring-no-properties output 0 -1) ""))))
+
+(defun org-list--depth (element)
+ "Return the level of ELEMENT within current plain list.
+ELEMENT is either an item or a plain list."
+ (cl-count-if (lambda (ancestor) (eq (org-element-type ancestor) 'plain-list))
+ (org-element-lineage element nil t)))
+
+(defun org-list--trailing-newlines (string)
+ "Return the number of trailing newlines in STRING."
+ (with-temp-buffer
+ (insert string)
+ (skip-chars-backward " \t\n")
+ (count-lines (line-beginning-position 2) (point-max))))
+
+(defun org-list--generic-eval (value &rest args)
+ "Evaluate VALUE according to its type.
+VALUE is either nil, a string or a function. In the latter case,
+it is called with arguments ARGS."
+ (cond ((null value) nil)
+ ((stringp value) value)
+ ((functionp value) (apply value args))
+ (t (error "Wrong value: %s" value))))
+
+(defun org-list--to-generic-plain-list (params)
+ "Return a transcoder for `plain-list' elements.
+PARAMS is a plist used to tweak the behavior of the transcoder."
+ (let ((ustart (plist-get params :ustart))
+ (uend (plist-get params :uend))
+ (ostart (plist-get params :ostart))
+ (oend (plist-get params :oend))
+ (dstart (plist-get params :dstart))
+ (dend (plist-get params :dend))
+ (splice (plist-get params :splice))
+ (backend (plist-get params :backend)))
+ (lambda (plain-list contents info)
+ (let* ((type (org-element-property :type plain-list))
+ (depth (org-list--depth plain-list))
+ (start (and (not splice)
+ (org-list--generic-eval
+ (pcase type
+ (`ordered ostart)
+ (`unordered ustart)
+ (_ dstart))
+ depth)))
+ (end (and (not splice)
+ (org-list--generic-eval
+ (pcase type
+ (`ordered oend)
+ (`unordered uend)
+ (_ dend))
+ depth))))
+ ;; Make sure trailing newlines in END appear in the output by
+ ;; setting `:post-blank' property to their number.
+ (when end
+ (org-element-put-property
+ plain-list :post-blank (org-list--trailing-newlines end)))
+ ;; Build output.
+ (concat (and start (concat start "\n"))
+ (if (or start end splice (not backend))
+ contents
+ (org-export-with-backend backend plain-list contents info))
+ end)))))
+
+(defun org-list--to-generic-item (params)
+ "Return a transcoder for `item' elements.
+PARAMS is a plist used to tweak the behavior of the transcoder."
+ (let ((backend (plist-get params :backend))
+ (istart (plist-get params :istart))
+ (iend (plist-get params :iend))
+ (isep (plist-get params :isep))
+ (icount (plist-get params :icount))
+ (ifmt (plist-get params :ifmt))
+ (cboff (plist-get params :cboff))
+ (cbon (plist-get params :cbon))
+ (cbtrans (plist-get params :cbtrans))
+ (dtstart (plist-get params :dtstart))
+ (dtend (plist-get params :dtend))
+ (ddstart (plist-get params :ddstart))
+ (ddend (plist-get params :ddend)))
+ (lambda (item contents info)
+ (let* ((type
+ (org-element-property :type (org-element-property :parent item)))
+ (tag (org-element-property :tag item))
+ (depth (org-list--depth item))
+ (separator (and (org-export-get-next-element item info)
+ (org-list--generic-eval isep type depth)))
+ (closing (pcase (org-list--generic-eval iend type depth)
+ ((or `nil "") "\n")
+ ((and (guard separator) s)
+ (if (equal (substring s -1) "\n") s (concat s "\n")))
+ (s s))))
+ ;; When a closing line or a separator is provided, make sure
+ ;; its trailing newlines are taken into account when building
+ ;; output. This is done by setting `:post-blank' property to
+ ;; the number of such lines in the last line to be added.
+ (let ((last-string (or separator closing)))
+ (when last-string
+ (org-element-put-property
+ item
+ :post-blank
+ (max (1- (org-list--trailing-newlines last-string)) 0))))
+ ;; Build output.
+ (concat
+ (let ((c (org-element-property :counter item)))
+ (if (and c icount) (org-list--generic-eval icount type depth c)
+ (org-list--generic-eval istart type depth)))
+ (let ((body
+ (if (or istart iend icount ifmt cbon cboff cbtrans (not backend)
+ (and (eq type 'descriptive)
+ (or dtstart dtend ddstart ddend)))
+ (concat
+ (pcase (org-element-property :checkbox item)
+ (`on cbon)
+ (`off cboff)
+ (`trans cbtrans))
+ (and tag
+ (concat dtstart
+ (if backend
+ (org-export-data-with-backend
+ tag backend info)
+ (org-element-interpret-data tag))
+ dtend))
+ (and tag ddstart)
+ (let ((contents
+ (if (= (length contents) 0) ""
+ (substring contents 0 -1))))
+ (if ifmt (org-list--generic-eval ifmt type contents)
+ contents))
+ (and tag ddend))
+ (org-export-with-backend backend item contents info))))
+ ;; Remove final newline.
+ (if (equal body "") ""
+ (substring (org-element-normalize-string body) 0 -1)))
+ closing
+ separator)))))
+
+(defun org-list-to-latex (list &optional params)
+ "Convert LIST into a LaTeX list.
+LIST is a parsed plain list, as returned by `org-list-to-lisp'.
+PARAMS is a property list with overruling parameters for
+`org-list-to-generic'. Return converted list as a string."
+ (require 'ox-latex)
+ (org-list-to-generic list (org-combine-plists '(:backend latex) params)))
+
+(defun org-list-to-html (list &optional params)
+ "Convert LIST into a HTML list.
+LIST is a parsed plain list, as returned by `org-list-to-lisp'.
+PARAMS is a property list with overruling parameters for
+`org-list-to-generic'. Return converted list as a string."
+ (require 'ox-html)
+ (org-list-to-generic list (org-combine-plists '(:backend html) params)))
+
+(defun org-list-to-texinfo (list &optional params)
+ "Convert LIST into a Texinfo list.
+LIST is a parsed plain list, as returned by `org-list-to-lisp'.
+PARAMS is a property list with overruling parameters for
+`org-list-to-generic'. Return converted list as a string."
+ (require 'ox-texinfo)
+ (org-list-to-generic list (org-combine-plists '(:backend texinfo) params)))
+
+(defun org-list-to-org (list &optional params)
+ "Convert LIST into an Org plain list.
+LIST is as returned by `org-list-parse-list'. PARAMS is a property list
+with overruling parameters for `org-list-to-generic'."
+ (let* ((make-item
+ (lambda (type _depth &optional c)
+ (concat (if (eq type 'ordered) "1. " "- ")
+ (and c (format "[@%d] " c)))))
+ (defaults
+ (list :istart make-item
+ :icount make-item
+ :ifmt (lambda (_type contents)
+ (replace-regexp-in-string "\n" "\n " contents))
+ :dtend " :: "
+ :cbon "[X] "
+ :cboff "[ ] "
+ :cbtrans "[-] ")))
+ (org-list-to-generic list (org-combine-plists defaults params))))
+
+(defun org-list-to-subtree (list &optional start-level params)
+ "Convert LIST into an Org subtree.
+LIST is as returned by `org-list-to-lisp'. Subtree starts at
+START-LEVEL or level 1 if nil. PARAMS is a property list with
+overruling parameters for `org-list-to-generic'."
+ (let* ((blank (pcase (cdr (assq 'heading org-blank-before-new-entry))
+ (`t t)
+ (`auto (save-excursion
+ (org-with-limited-levels (outline-previous-heading))
+ (org-previous-line-empty-p)))))
+ (level (or start-level 1))
+ (make-stars
+ (lambda (_type depth &optional _count)
+ ;; Return the string for the heading, depending on DEPTH
+ ;; of current sub-list.
+ (let ((oddeven-level (+ level (1- depth))))
+ (concat (make-string (if org-odd-levels-only
+ (1- (* 2 oddeven-level))
+ oddeven-level)
+ ?*)
+ " ")))))
+ (org-list-to-generic
+ list
+ (org-combine-plists
+ (list :splice t
+ :istart make-stars
+ :icount make-stars
+ :dtstart " " :dtend " "
+ :isep (if blank "\n\n" "\n")
+ :cbon "DONE " :cboff "TODO " :cbtrans "TODO ")
+ params))))
+
+(provide 'org-list)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-list.el ends here
diff --git a/elpa/org-9.5.2/org-list.elc b/elpa/org-9.5.2/org-list.elc
new file mode 100644
index 0000000..72da99f
--- /dev/null
+++ b/elpa/org-9.5.2/org-list.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-loaddefs.el b/elpa/org-9.5.2/org-loaddefs.el
new file mode 100644
index 0000000..169f897
--- /dev/null
+++ b/elpa/org-9.5.2/org-loaddefs.el
@@ -0,0 +1,4612 @@
+;;; org-loaddefs.el --- autogenerated file, do not edit
+;;
+;;; Code:
+
+;;;### (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-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-" "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" '("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-core" "ob-core.el" "6ed35c309cede94731f23c7d075ec53d")
+;;; Generated autoloads from ob-core.el
+
+(autoload 'org-babel-execute-safely-maybe "ob-core" nil nil nil)
+
+(autoload 'org-babel-execute-maybe "ob-core" nil t nil)
+
+(autoload 'org-babel-view-src-block-info "ob-core" "\
+Display information on the current source block.
+This includes header arguments, language and name, and is largely
+a window into the `org-babel-get-src-block-info' function." t nil)
+
+(autoload 'org-babel-expand-src-block-maybe "ob-core" "\
+Conditionally expand a source block.
+Detect if this is context for an org-babel src-block and if so
+then run `org-babel-expand-src-block'." 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 an org-babel src-block and if so
+then run `org-babel-load-in-session'." t nil)
+
+(autoload 'org-babel-pop-to-session-maybe "ob-core" "\
+Conditionally pop to a session.
+Detect if this is context for an org-babel src-block and if so
+then run `org-babel-switch-to-session'." t nil)
+
+(autoload 'org-babel-execute-src-block "ob-core" "\
+Execute the current source code block.
+Insert the results of execution into the buffer. Source code
+execution and the collection and formatting of results can be
+controlled through a variety of header arguments.
+
+With prefix argument ARG, force re-execution even if an existing
+result cached in the buffer would otherwise have been returned.
+
+Optionally supply a value for INFO in the form returned by
+`org-babel-get-src-block-info'.
+
+Optionally supply a value for PARAMS which will be merged with
+the header arguments specified at the front of the source code
+block.
+
+\(fn &optional ARG INFO PARAMS)" t nil)
+
+(autoload 'org-babel-expand-src-block "ob-core" "\
+Expand the current source code block.
+Expand according to the source code block's header
+arguments and pop open the results in a preview buffer.
+
+\(fn &optional ARG INFO PARAMS)" t nil)
+
+(autoload 'org-babel-check-src-block "ob-core" "\
+Check for misspelled header arguments in the current code block." t nil)
+
+(autoload 'org-babel-insert-header-arg "ob-core" "\
+Insert a header argument selecting from lists of common args and values.
+
+\(fn &optional HEADER-ARG VALUE)" t nil)
+
+(autoload 'org-babel-load-in-session "ob-core" "\
+Load the body of the current source-code block.
+Evaluate the header arguments for the source block before
+entering the session. After loading the body this pops open the
+session.
+
+\(fn &optional ARG INFO)" t nil)
+
+(autoload 'org-babel-initiate-session "ob-core" "\
+Initiate session for current code block.
+If called with a prefix argument then resolve any variable
+references in the header arguments and assign these variables in
+the session. Copy the body of the code block to the kill ring.
+
+\(fn &optional ARG INFO)" t nil)
+
+(autoload 'org-babel-switch-to-session "ob-core" "\
+Switch to the session of the current code block.
+Uses `org-babel-initiate-session' to start the session. If called
+with a prefix argument then this is passed on to
+`org-babel-initiate-session'.
+
+\(fn &optional ARG INFO)" t nil)
+
+(autoload 'org-babel-switch-to-session-with-code "ob-core" "\
+Switch to code buffer and display session.
+
+\(fn &optional ARG INFO)" t nil)
+
+(autoload 'org-babel-do-in-edit-buffer "ob-core" "\
+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.
+
+\(fn &rest BODY)" nil t)
+
+(autoload 'org-babel-open-src-block-result "ob-core" "\
+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)
+
+(autoload 'org-babel-map-src-blocks "ob-core" "\
+Evaluate BODY forms on each source-block in FILE.
+If FILE is nil evaluate BODY forms on source blocks in current
+buffer. During evaluation of BODY the following local variables
+are set relative to the currently matched code block.
+
+full-block ------- string holding the entirety of the code block
+beg-block -------- point at the beginning of the code block
+end-block -------- point at the end of the matched code block
+lang ------------- string holding the language of the code block
+beg-lang --------- point at the beginning of the lang
+end-lang --------- point at the end of the lang
+switches --------- string holding the switches
+beg-switches ----- point at the beginning of the switches
+end-switches ----- point at the end of the switches
+header-args ------ string holding the header-args
+beg-header-args -- point at the beginning of the header-args
+end-header-args -- point at the end of the header-args
+body ------------- string holding the body of the code block
+beg-body --------- point at the beginning of the body
+end-body --------- point at the end of the body
+
+\(fn FILE &rest BODY)" nil t)
+
+(function-put 'org-babel-map-src-blocks 'lisp-indent-function '1)
+
+(autoload 'org-babel-map-inline-src-blocks "ob-core" "\
+Evaluate BODY forms on each inline source block in FILE.
+If FILE is nil evaluate BODY forms on source blocks in current
+buffer.
+
+\(fn FILE &rest BODY)" nil t)
+
+(function-put 'org-babel-map-inline-src-blocks 'lisp-indent-function '1)
+
+(autoload 'org-babel-map-call-lines "ob-core" "\
+Evaluate BODY forms on each call line in FILE.
+If FILE is nil evaluate BODY forms on source blocks in current
+buffer.
+
+\(fn FILE &rest BODY)" nil t)
+
+(function-put 'org-babel-map-call-lines 'lisp-indent-function '1)
+
+(autoload 'org-babel-map-executables "ob-core" "\
+Evaluate BODY forms on each active Babel code in FILE.
+If FILE is nil evaluate BODY forms on source blocks in current
+buffer.
+
+\(fn FILE &rest BODY)" nil t)
+
+(function-put 'org-babel-map-executables 'lisp-indent-function '1)
+
+(autoload 'org-babel-execute-buffer "ob-core" "\
+Execute source code blocks in a buffer.
+Call `org-babel-execute-src-block' on every source block in
+the current buffer.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'org-babel-execute-subtree "ob-core" "\
+Execute source code blocks in a subtree.
+Call `org-babel-execute-src-block' on every source block in
+the current subtree.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'org-babel-sha1-hash "ob-core" "\
+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 CONTEXT)" t nil)
+
+(autoload 'org-babel-hide-result-toggle-maybe "ob-core" "\
+Toggle visibility of result at point." t nil)
+
+(autoload 'org-babel-goto-src-block-head "ob-core" "\
+Go to the beginning of the current code block." t nil)
+
+(autoload 'org-babel-goto-named-src-block "ob-core" "\
+Go to a named source-code block.
+
+\(fn NAME)" t nil)
+
+(autoload 'org-babel-goto-named-result "ob-core" "\
+Go to a named result.
+
+\(fn NAME)" t nil)
+
+(autoload 'org-babel-next-src-block "ob-core" "\
+Jump to the next source block.
+With optional prefix argument ARG, jump forward ARG many source blocks.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'org-babel-previous-src-block "ob-core" "\
+Jump to the previous source block.
+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 source block." t nil)
+
+;;;***
+
+;;;### (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-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-eshell" "ob-eshell.el" (0 0 0 0))
+;;; Generated autoloads from ob-eshell.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-eshell" '("ob-eshell-session-live-p" "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-gnuplot-" "org-babel-")))
+
+;;;***
+
+;;;### (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-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-julia" "ob-julia.el" (0 0 0 0))
+;;; Generated autoloads from ob-julia.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-julia" '("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-lilypond" "ob-lilypond.el" (0 0 0 0))
+;;; Generated autoloads from ob-lilypond.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-lilypond" '("lilypond-mode" "ob-lilypond-header-args" "org-babel-")))
+
+;;;***
+
+;;;### (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-lob" "ob-lob.el" "f88c2277aca81467214c57a5217e41ef")
+;;; Generated autoloads from ob-lob.el
+
+(autoload 'org-babel-lob-execute-maybe "ob-lob" "\
+Execute a Library of Babel source block, if appropriate.
+Detect if this is context for a Library Of Babel source block and
+if so then run the appropriate source block from the Library." t nil)
+
+(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 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)
+
+;;;***
+
+;;;### (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-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-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-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-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-tangle" "ob-tangle.el" "9590fffd5730d1959a335157d8fd8522")
+;;; Generated autoloads from ob-tangle.el
+
+(autoload 'org-babel-tangle-file "ob-tangle" "\
+Extract the bodies of source code blocks in FILE.
+Source code blocks are extracted with `org-babel-tangle'.
+
+Optional argument TARGET-FILE can be used to specify a default
+export file for all source blocks.
+
+Optional argument LANG-RE can be used to limit the exported
+source code blocks by languages matching a regular expression.
+
+Return a list whose CAR is the tangled file name.
+
+\(fn FILE &optional TARGET-FILE LANG-RE)" t nil)
+
+(autoload 'org-babel-tangle "ob-tangle" "\
+Write code blocks to source-specific files.
+Extract the bodies of all source code blocks from the current
+file into their own source-specific files.
+With one universal prefix argument, only tangle the block at point.
+When two universal prefix arguments, only tangle blocks for the
+tangle file of the block at point.
+Optional argument TARGET-FILE can be used to specify a default
+export file for all source blocks. Optional argument LANG-RE can
+be used to limit the exported source code blocks by languages
+matching a regular expression.
+
+\(fn &optional ARG TARGET-FILE LANG-RE)" t nil)
+
+;;;***
+
+;;;### (autoloads nil "ol" "ol.el" "975aba699c0e378e9081eb750bf034aa")
+;;; Generated autoloads from ol.el
+
+(autoload 'org-next-link "ol" "\
+Move forward to the next link.
+If the link is in hidden text, expose it. When SEARCH-BACKWARD
+is non-nil, move backward.
+
+\(fn &optional SEARCH-BACKWARD)" t nil)
+
+(autoload 'org-previous-link "ol" "\
+Move backward to the previous link.
+If the link is in hidden text, expose it." t nil)
+
+(autoload 'org-toggle-link-display "ol" "\
+Toggle the literal or descriptive display of links." t nil)
+
+(autoload 'org-store-link "ol" "\
+Store a link to the current location.
+\\<org-mode-map>
+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 "ol" "\
+Insert a link. At the prompt, enter the link.
+
+Completion can be used to insert any of the link protocol prefixes in use.
+
+The history can be used to select a link previously stored with
+`org-store-link'. When the empty string is entered (i.e. if you just
+press `RET' at the prompt), the link defaults to the most recently
+stored link. As `SPC' triggers completion in the minibuffer, you need to
+use `M-SPC' or `C-q SPC' to force the insertion of a space character.
+
+You will also be prompted for a description, and if one is given, it will
+be displayed in the buffer instead of the link.
+
+If there is already a link at point, this command will allow you to edit
+link and description parts.
+
+With a `\\[universal-argument]' prefix, prompts for a file to link to. The file name can be
+selected using completion. The path to the file will be relative to the
+current directory if the file is in the current directory or a subdirectory.
+Otherwise, the link will be the absolute path as completed in the minibuffer
+\(i.e. normally ~/path/to/file). You can configure this behavior using the
+option `org-link-file-path-type'.
+
+With a `\\[universal-argument] \\[universal-argument]' prefix, enforce an absolute path even if the file is in
+the current directory or below.
+
+A `\\[universal-argument] \\[universal-argument] \\[universal-argument]' prefix negates `org-link-keep-stored-after-insertion'.
+
+If the LINK-LOCATION parameter is non-nil, this value will be used as
+the link location instead of reading one interactively.
+
+If the DESCRIPTION parameter is non-nil, this value will be used as the
+default description. Otherwise, if `org-link-make-description-function'
+is non-nil, this function will be called with the link target, and the
+result will be the default link description. When called non-interactively,
+don't allow to edit the default description.
+
+\(fn &optional COMPLETE-FILE LINK-LOCATION DESCRIPTION)" t nil)
+
+(autoload 'org-insert-all-links "ol" "\
+Insert all links in `org-stored-links'.
+When a universal prefix, do not delete the links from `org-stored-links'.
+When `ARG' is a number, insert the last N link(s).
+`PRE' and `POST' are optional arguments to define a string to
+prepend or to append.
+
+\(fn ARG &optional PRE POST)" t nil)
+
+(autoload 'org-insert-last-stored-link "ol" "\
+Insert the last link stored in `org-stored-links'.
+
+\(fn ARG)" t nil)
+
+(autoload 'org-insert-link-global "ol" "\
+Insert a link like Org mode does.
+This command can be called in any mode to insert a link in Org syntax." t nil)
+
+(autoload 'org-update-radio-target-regexp "ol" "\
+Find all radio targets in this file and update the regular expression.
+Also refresh fontification if needed." t nil)
+
+;;;***
+
+;;;### (autoloads nil "ol-bbdb" "ol-bbdb.el" "b523fedbd6ad3117faaf0dfdaa09ea8c")
+;;; Generated autoloads from ol-bbdb.el
+
+(autoload 'org-bbdb-anniversaries "ol-bbdb" "\
+Extract anniversaries from BBDB for display in the agenda.
+When called programmatically, this function expects the `date'
+variable to be globally bound." nil nil)
+
+;;;***
+
+;;;### (autoloads nil "ol-bibtex" "ol-bibtex.el" (0 0 0 0))
+;;; Generated autoloads from ol-bibtex.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-bibtex" '("org-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-docview" "ol-docview.el" (0 0 0 0))
+;;; Generated autoloads from ol-docview.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-docview" '("org-docview-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-doi" "ol-doi.el" (0 0 0 0))
+;;; Generated autoloads from ol-doi.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-doi" '("org-link-doi-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-eshell" "ol-eshell.el" (0 0 0 0))
+;;; Generated autoloads from ol-eshell.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-eshell" '("org-eshell-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-eww" "ol-eww.el" (0 0 0 0))
+;;; Generated autoloads from ol-eww.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-eww" '("org-eww-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-gnus" "ol-gnus.el" (0 0 0 0))
+;;; Generated autoloads from ol-gnus.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-gnus" '("org-gnus-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-info" "ol-info.el" (0 0 0 0))
+;;; Generated autoloads from ol-info.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-info" '("org-info-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-irc" "ol-irc.el" "e1dcb3decf43f174ed65f8b171acac80")
+;;; Generated autoloads from ol-irc.el
+
+(autoload 'org-irc-store-link "ol-irc" "\
+Dispatch to the appropriate function to store a link to an IRC session." nil nil)
+
+;;;***
+
+;;;### (autoloads nil "ol-man" "ol-man.el" (0 0 0 0))
+;;; Generated autoloads from ol-man.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-man" '("org-man-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-mhe" "ol-mhe.el" (0 0 0 0))
+;;; Generated autoloads from ol-mhe.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-mhe" '("org-mhe-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-rmail" "ol-rmail.el" (0 0 0 0))
+;;; Generated autoloads from ol-rmail.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-rmail" '("org-rmail-")))
+
+;;;***
+
+;;;### (autoloads nil "ol-w3m" "ol-w3m.el" (0 0 0 0))
+;;; Generated autoloads from ol-w3m.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol-w3m" '("org-w3m-")))
+
+;;;***
+
+;;;### (autoloads nil "ol" "ol.el" (0 0 0 0))
+;;; Generated autoloads from ol.el
+
+(autoload 'org-next-link "ol" "\
+Move forward to the next link.
+If the link is in hidden text, expose it. When SEARCH-BACKWARD
+is non-nil, move backward.
+
+\(fn &optional SEARCH-BACKWARD)" t nil)
+
+(autoload 'org-previous-link "ol" "\
+Move backward to the previous link.
+If the link is in hidden text, expose it." t nil)
+
+(autoload 'org-toggle-link-display "ol" "\
+Toggle the literal or descriptive display of links." t nil)
+
+(autoload 'org-store-link "ol" "\
+Store a link to the current location.
+\\<org-mode-map>
+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 "ol" "\
+Insert a link. At the prompt, enter the link.
+
+Completion can be used to insert any of the link protocol prefixes in use.
+
+The history can be used to select a link previously stored with
+`org-store-link'. When the empty string is entered (i.e. if you just
+press `RET' at the prompt), the link defaults to the most recently
+stored link. As `SPC' triggers completion in the minibuffer, you need to
+use `M-SPC' or `C-q SPC' to force the insertion of a space character.
+
+You will also be prompted for a description, and if one is given, it will
+be displayed in the buffer instead of the link.
+
+If there is already a link at point, this command will allow you to edit
+link and description parts.
+
+With a `\\[universal-argument]' prefix, prompts for a file to link to. The file name can be
+selected using completion. The path to the file will be relative to the
+current directory if the file is in the current directory or a subdirectory.
+Otherwise, the link will be the absolute path as completed in the minibuffer
+\(i.e. normally ~/path/to/file). You can configure this behavior using the
+option `org-link-file-path-type'.
+
+With a `\\[universal-argument] \\[universal-argument]' prefix, enforce an absolute path even if the file is in
+the current directory or below.
+
+A `\\[universal-argument] \\[universal-argument] \\[universal-argument]' prefix negates `org-link-keep-stored-after-insertion'.
+
+If the LINK-LOCATION parameter is non-nil, this value will be used as
+the link location instead of reading one interactively.
+
+If the DESCRIPTION parameter is non-nil, this value will be used as the
+default description. Otherwise, if `org-link-make-description-function'
+is non-nil, this function will be called with the link target, and the
+result will be the default link description. When called non-interactively,
+don't allow to edit the default description.
+
+\(fn &optional COMPLETE-FILE LINK-LOCATION DESCRIPTION)" t nil)
+
+(autoload 'org-insert-all-links "ol" "\
+Insert all links in `org-stored-links'.
+When a universal prefix, do not delete the links from `org-stored-links'.
+When `ARG' is a number, insert the last N link(s).
+`PRE' and `POST' are optional arguments to define a string to
+prepend or to append.
+
+\(fn ARG &optional PRE POST)" t nil)
+
+(autoload 'org-insert-last-stored-link "ol" "\
+Insert the last link stored in `org-stored-links'.
+
+\(fn ARG)" t nil)
+
+(autoload 'org-insert-link-global "ol" "\
+Insert a link like Org mode does.
+This command can be called in any mode to insert a link in Org syntax." t nil)
+
+(autoload 'org-update-radio-target-regexp "ol" "\
+Find all radio targets in this file and update the regular expression.
+Also refresh fontification if needed." t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ol" '("org-")))
+
+;;;***
+
+;;;### (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 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 String 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'." 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-archive" "org-archive.el" "65479c6644844adb44ca51a27466dc21")
+;;; Generated autoloads from org-archive.el
+
+(autoload 'org-add-archive-files "org-archive" "\
+Splice the archive files into the list of files.
+This implies visiting all these files and finding out what the
+archive file is.
+
+\(fn FILES)" nil nil)
+
+(autoload 'org-archive-subtree "org-archive" "\
+Move the current subtree to the archive.
+The archive can be a certain top-level heading in the current
+file, or in a different file. The tree will be moved to that
+location, the subtree heading be marked DONE, and the current
+time will be added.
+
+When called with a single prefix argument FIND-DONE, find whole
+trees without any open TODO items and archive them (after getting
+confirmation from the user). When called with a double prefix
+argument, find whole trees with timestamps before today and
+archive them (after getting confirmation from the user). If the
+cursor is not at a headline when these commands are called, try
+all level 1 trees. If the cursor is on a headline, only try the
+direct children of this heading.
+
+\(fn &optional FIND-DONE)" t nil)
+
+(autoload 'org-archive-to-archive-sibling "org-archive" "\
+Archive the current heading by moving it under the archive sibling.
+
+The archive sibling is a sibling of the heading with the heading name
+`org-archive-sibling-heading' and an `org-archive-tag' tag. If this
+sibling does not exist, it will be created at the end of the subtree.
+
+Archiving time is retained in the ARCHIVE_TIME node property." t nil)
+
+(autoload 'org-toggle-archive-tag "org-archive" "\
+Toggle the archive tag for the current headline.
+With prefix ARG, check all children of current headline and offer tagging
+the children that do not contain any open TODO items.
+
+\(fn &optional FIND-DONE)" t nil)
+
+(autoload 'org-archive-subtree-default "org-archive" "\
+Archive the current subtree with the default command.
+This command is set with the variable `org-archive-default-command'." t nil)
+
+(autoload 'org-archive-subtree-default-with-confirmation "org-archive" "\
+Archive the current subtree with the default command.
+This command is set with the variable `org-archive-default-command'." t nil)
+
+;;;***
+
+;;;### (autoloads nil "org-attach" "org-attach.el" "5c9d4d7993c6b2e103a1189f04539280")
+;;; Generated autoloads from org-attach.el
+
+(autoload 'org-attach "org-attach" "\
+The dispatcher for attachment commands.
+Shows a list of commands and prompts for another key to execute a command." 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)
+
+;;;***
+
+;;;### (autoloads nil "org-attach-git" "org-attach-git.el" (0 0 0
+;;;;;; 0))
+;;; Generated autoloads from org-attach-git.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-attach-git" '("org-attach-git-")))
+
+;;;***
+
+;;;### (autoloads nil "org-attach" "org-attach.el" (0 0 0 0))
+;;; Generated autoloads from org-attach.el
+
+(autoload 'org-attach "org-attach" "\
+The dispatcher for attachment commands.
+Shows a list of commands and prompts for another key to execute a command." 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-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.
+\\<org-capture-mode-map>
+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'." t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org-capture" '("org-capture-")))
+
+;;;***
+
+;;;### (autoloads nil "org-clock" "org-clock.el" "3045e2086764060ba0e9bba14a9d82c0")
+;;; Generated autoloads from org-clock.el
+
+(autoload 'org-resolve-clocks "org-clock" "\
+Resolve all currently open Org clocks.
+If `only-dangling-p' is non-nil, only ask to resolve dangling
+\(i.e., not currently open and valid) clocks.
+
+\(fn &optional ONLY-DANGLING-P PROMPT-FN LAST-VALID)" t nil)
+
+(autoload 'org-clock-in "org-clock" "\
+Start the clock on the current item.
+
+If necessary, clock-out of the currently active clock.
+
+With a `\\[universal-argument]' prefix argument SELECT, offer a list of recently clocked
+tasks to clock into.
+
+When SELECT is `\\[universal-argument] \\[universal-argument]', clock into the current task and mark it as
+the default task, a special task that will always be offered in the
+clocking selection, associated with the letter `d'.
+
+When SELECT is `\\[universal-argument] \\[universal-argument] \\[universal-argument]', clock in by using the last clock-out
+time as the start time. See `org-clock-continuously' to make this
+the default behavior.
+
+\(fn &optional SELECT START-TIME)" t nil)
+
+(autoload 'org-clock-toggle-auto-clockout "org-clock" nil t nil)
+
+(autoload 'org-clock-in-last "org-clock" "\
+Clock in the last closed clocked item.
+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
+last clock-out time, if any.
+With three universal prefix arguments, interactively prompt
+for a todo state to switch to, overriding the existing value
+`org-clock-in-switch-to-state'.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'org-clock-out "org-clock" "\
+Stop the currently running clock.
+Throw an error if there is no running clock and FAIL-QUIETLY is nil.
+With a universal prefix, prompt for a state to switch the clocked out task
+to, overriding the existing value of `org-clock-out-switch-to-state'.
+
+\(fn &optional SWITCH-TO-STATE FAIL-QUIETLY AT-TIME)" t nil)
+
+(autoload 'org-clock-cancel "org-clock" "\
+Cancel the running clock by removing the start timestamp." t nil)
+
+(autoload 'org-clock-goto "org-clock" "\
+Go to the currently clocked-in entry, or to the most recently clocked one.
+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.
+TSTART and TEND can mark a time range to be considered.
+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.
+
+\(fn &optional TSTART TEND HEADLINE-FILTER PROPNAME)" nil nil)
+
+(autoload 'org-clock-display "org-clock" "\
+Show subtree times in the entire buffer.
+
+By default, show the total time for the range defined in
+`org-clock-display-default-range'. With `\\[universal-argument]' prefix, show
+the total time for today instead.
+
+With `\\[universal-argument] \\[universal-argument]' prefix, use a custom range, entered at prompt.
+
+With `\\[universal-argument] \\[universal-argument] \\[universal-argument]' prefix, display the total time in the
+echo area.
+
+Use `\\[org-clock-remove-overlays]' to remove the subtree times.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'org-clock-remove-overlays "org-clock" "\
+Remove the occur highlights from the buffer.
+If NOREMOVE is nil, remove this function from the
+`before-change-functions' in the current buffer.
+
+\(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." 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
+fontified, and then returned.
+
+\(fn &rest PROPS)" nil nil)
+
+(autoload 'org-clock-report "org-clock" "\
+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.
+
+\(fn &optional ARG)" t nil)
+
+(eval-after-load 'org '(progn (org-dynamic-block-define "clocktable" #'org-clock-report)))
+
+(autoload 'org-clocktable-shift "org-clock" "\
+Try to shift the :block date of the clocktable at point.
+Point must be in the #+BEGIN: line of a clocktable, or this function
+will throw an error.
+DIR is a direction, a symbol `left', `right', `up', or `down'.
+Both `left' and `down' shift the block toward the past, `up' and `right'
+push it toward the future.
+N is the number of shift steps to take. The size of the step depends on
+the currently selected interval size.
+
+\(fn DIR N)" nil nil)
+
+(autoload 'org-dblock-write:clocktable "org-clock" "\
+Write the standard clocktable.
+
+\(fn PARAMS)" nil nil)
+
+(autoload 'org-clock-update-time-maybe "org-clock" "\
+If this is a CLOCK line, update it and return t.
+Otherwise, return nil." t nil)
+
+;;;***
+
+;;;### (autoloads nil "org-colview" "org-colview.el" "8b8cff156cbeb45bc1b67244c28741c6")
+;;; Generated autoloads from org-colview.el
+
+(autoload 'org-columns-remove-overlays "org-colview" "\
+Remove all currently active column overlays." t nil)
+
+(autoload 'org-columns-get-format-and-top-level "org-colview" nil 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, GLOBAL,
+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." t nil)
+
+(eval-after-load 'org '(progn (org-dynamic-block-define "columnview" #'org-columns-insert-dblock)))
+
+(autoload 'org-agenda-columns "org-colview" "\
+Turn on or update column view in the agenda." t nil)
+
+;;;***
+
+;;;### (autoloads nil "org-compat" "org-compat.el" "2343a564c1268fa269dc2dc05ca32722")
+;;; Generated autoloads from org-compat.el
+
+(autoload 'org-check-version "org-compat" "\
+Try very hard to provide sensible version strings." nil t)
+
+;;;***
+
+;;;### (autoloads nil "org-crypt" "org-crypt.el" (0 0 0 0))
+;;; Generated autoloads from org-crypt.el
+
+(autoload 'org-encrypt-entry "org-crypt" "\
+Encrypt the content of the current headline." t nil)
+
+(autoload 'org-decrypt-entry "org-crypt" "\
+Decrypt the content of the current headline." t nil)
+
+(autoload 'org-encrypt-entries "org-crypt" "\
+Encrypt all top-level entries in the current buffer." t nil)
+
+(autoload 'org-decrypt-entries "org-crypt" "\
+Decrypt all entries in the current buffer." t nil)
+
+(autoload 'org-crypt-use-before-save-magic "org-crypt" "\
+Add a hook to automatically encrypt entries before a file is saved to disk." nil nil)
+
+(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-datetree" "org-datetree.el" "6c41420f6ee1e056210adbe3f33e15b1")
+;;; Generated autoloads from org-datetree.el
+
+(autoload 'org-datetree-find-date-create "org-datetree" "\
+Find or create a day entry for date D.
+If KEEP-RESTRICTION is non-nil, do not widen the buffer.
+When it is nil, the buffer will be widened to make sure an existing date
+tree can be found. If it is the symbol `subtree-at-point', then the tree
+will be built under the headline at point.
+
+\(fn D &optional KEEP-RESTRICTION)" nil nil)
+
+(autoload 'org-datetree-find-month-create "org-datetree" "\
+Find or create a month entry for date D.
+Compared to `org-datetree-find-date-create' this function creates
+entries grouped by month instead of days.
+If KEEP-RESTRICTION is non-nil, do not widen the buffer.
+When it is nil, the buffer will be widened to make sure an existing date
+tree can be found. If it is the symbol `subtree-at-point', then the tree
+will be built under the headline at point.
+
+\(fn D &optional KEEP-RESTRICTION)" nil nil)
+
+(autoload 'org-datetree-find-iso-week-create "org-datetree" "\
+Find or create an ISO week entry for date D.
+Compared to `org-datetree-find-date-create' this function creates
+entries ordered by week instead of months.
+When it is nil, the buffer will be widened to make sure an existing date
+tree can be found. If it is the symbol `subtree-at-point', then the tree
+will be built under the headline at point.
+
+\(fn D &optional KEEP-RESTRICTION)" nil nil)
+
+;;;***
+
+;;;### (autoloads nil "org-duration" "org-duration.el" "92f81152132375166a8cb1135d1607a2")
+;;; Generated autoloads from org-duration.el
+
+(autoload 'org-duration-set-regexps "org-duration" "\
+Set duration related regexps." 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-element" "org-element.el" "3e68d96e30ad3c40c4c8ab5edfd50d74")
+;;; Generated autoloads from org-element.el
+
+(autoload 'org-element-update-syntax "org-element" "\
+Update parser internals." t nil)
+
+(autoload 'org-element-interpret-data "org-element" "\
+Interpret DATA as Org syntax.
+DATA is a parse tree, an element, an object or a secondary string
+to interpret. Return Org syntax as a string.
+
+\(fn DATA)" nil nil)
+
+(autoload 'org-element-cache-reset "org-element" "\
+Reset cache in current buffer.
+When optional argument ALL is non-nil, reset cache in all Org
+buffers.
+
+\(fn &optional ALL)" t nil)
+
+(autoload 'org-element-cache-refresh "org-element" "\
+Refresh cache at position POS.
+
+\(fn POS)" nil nil)
+
+(autoload 'org-element-at-point "org-element" "\
+Determine closest element around point.
+
+Return value is a list like (TYPE PROPS) where TYPE is the type
+of the element and PROPS a plist of properties associated to the
+element.
+
+Possible types are defined in `org-element-all-elements'.
+Properties depend on element or object type, but always include
+`:begin', `:end', and `:post-blank' properties.
+
+As a special case, if point is at the very beginning of the first
+item in a list or sub-list, returned element will be that list
+instead of the item. Likewise, if point is at the beginning of
+the first row of a table, returned element will be the table
+instead of the first row.
+
+When point is at the end of the buffer, return the innermost
+element ending there." nil nil)
+
+(autoload 'org-element-context "org-element" "\
+Return smallest element or object around point.
+
+Return value is a list like (TYPE PROPS) where TYPE is the type
+of the element or object and PROPS a plist of properties
+associated to it.
+
+Possible types are defined in `org-element-all-elements' and
+`org-element-all-objects'. Properties depend on element or
+object type, but always include `:begin', `:end', `:parent' and
+`:post-blank'.
+
+As a special case, if point is right after an object and not at
+the beginning of any other object, return that object.
+
+Optional argument ELEMENT, when non-nil, is the closest element
+containing point, as returned by `org-element-at-point'.
+Providing it allows for quicker computation.
+
+\(fn &optional ELEMENT)" nil nil)
+
+;;;***
+
+;;;### (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-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-feed" "org-feed.el" "2fe8531b7a85d6d58c04c106eb5a4957")
+;;; Generated autoloads from org-feed.el
+
+(autoload 'org-feed-update-all "org-feed" "\
+Get inbox items from all feeds in `org-feed-alist'." t nil)
+
+(autoload 'org-feed-update "org-feed" "\
+Get inbox items from FEED.
+FEED can be a string with an association in `org-feed-alist', or
+it can be a list structured like an entry in `org-feed-alist'.
+
+\(fn FEED &optional RETRIEVE-ONLY)" t nil)
+
+(autoload 'org-feed-goto-inbox "org-feed" "\
+Go to the inbox that captures the feed named FEED.
+
+\(fn FEED)" t nil)
+
+(autoload 'org-feed-show-raw-feed "org-feed" "\
+Show the raw feed buffer of a feed.
+
+\(fn FEED)" t nil)
+
+;;;***
+
+;;;### (autoloads nil "org-footnote" "org-footnote.el" "0213602f0b8b463d562a4caf2721491b")
+;;; Generated autoloads from org-footnote.el
+
+(autoload 'org-footnote-action "org-footnote" "\
+Do the right thing for footnotes.
+
+When at a footnote reference, jump to the definition.
+
+When at a definition, jump to the references if they exist, offer
+to create them otherwise.
+
+When neither at definition or reference, create a new footnote,
+interactively if possible.
+
+With prefix arg SPECIAL, or when no footnote can be created,
+offer additional commands in a menu.
+
+\(fn &optional SPECIAL)" t nil)
+
+;;;***
+
+;;;### (autoloads nil "org-goto" "org-goto.el" "adbb2396243174923803514cf5c190b4")
+;;; 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)
+
+;;;***
+
+;;;### (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-id" "org-id.el" "113f5d6f60577662c87fbd6df64ee9e9")
+;;; Generated autoloads from org-id.el
+
+(autoload 'org-id-get-create "org-id" "\
+Create an ID for the current entry and return it.
+If the entry already has an ID, just return it.
+With optional argument FORCE, force the creation of a new ID.
+
+\(fn &optional FORCE)" t nil)
+
+(autoload 'org-id-copy "org-id" "\
+Copy the ID of the entry at point to the kill ring.
+Create an ID if necessary." t nil)
+
+(autoload 'org-id-get "org-id" "\
+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.
+PREFIX will be passed through to `org-id-new'.
+In any case, the ID of the entry is returned.
+
+\(fn &optional POM CREATE PREFIX)" nil nil)
+
+(autoload 'org-id-get-with-outline-path-completion "org-id" "\
+Use `outline-path-completion' to retrieve the ID of an entry.
+TARGETS may be a setting for `org-refile-targets' to define
+eligible headlines. When omitted, all headlines in the current
+file are eligible. This function returns the ID of the entry.
+If necessary, the ID is created.
+
+\(fn &optional TARGETS)" nil nil)
+
+(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-goto-location'.
+It returns the ID of the entry. If necessary, the ID is created." nil nil)
+
+(autoload 'org-id-goto "org-id" "\
+Switch to the buffer containing the entry with id ID.
+Move the cursor to that entry in that buffer.
+
+\(fn ID)" t nil)
+
+(autoload 'org-id-find "org-id" "\
+Return the location of the entry with the id ID.
+The return value is a cons cell (file-name . position), or nil
+if there is no entry with that ID.
+With optional argument MARKERP, return the position as a new marker.
+
+\(fn ID &optional MARKERP)" nil nil)
+
+(autoload 'org-id-new "org-id" "\
+Create a new globally unique ID.
+
+An ID consists of two parts separated by a colon:
+- a prefix
+- a unique part that will be created according to `org-id-method'.
+
+PREFIX can specify the prefix, the default is given by the variable
+`org-id-prefix'. However, if PREFIX is the symbol `none', don't use any
+prefix even if `org-id-prefix' specifies one.
+
+So a typical ID could look like \"Org:4nd91V40HI\".
+
+\(fn &optional PREFIX)" nil nil)
+
+(autoload 'org-id-update-id-locations "org-id" "\
+Scan relevant files for IDs.
+Store the relation between files and corresponding IDs.
+This will scan all agenda files, all associated archives, and all
+files currently mentioned in `org-id-locations'.
+When FILES is given, scan also these files.
+If SILENT is non-nil, messages are suppressed.
+
+\(fn &optional FILES SILENT)" t nil)
+
+(autoload 'org-id-find-id-file "org-id" "\
+Query the id database for the file in which ID is located.
+
+\(fn ID)" nil nil)
+
+(autoload 'org-id-store-link "org-id" "\
+Store a link to the current entry, using its ID.
+
+If before first heading store first title-keyword as description
+or filename if no title." t nil)
+
+;;;***
+
+;;;### (autoloads nil "org-indent" "org-indent.el" "357fb56462ce4eaec7a2ea8aad6c64a3")
+;;; 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.
+
+The process is synchronous. Though, initial indentation of
+buffer, which can take a few seconds on large buffers, is done
+during idle time.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (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-keys" "org-keys.el" "74211ba8b1b00995f3de35dbd5104e88")
+;;; Generated autoloads from org-keys.el
+
+(autoload 'org-babel-describe-bindings "org-keys" "\
+Describe all keybindings behind `org-babel-key-prefix'." t nil)
+
+;;;***
+
+;;;### (autoloads nil "org-lint" "org-lint.el" "ef9470da9d3e9882e1c1b96873e92418")
+;;; 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-list" "org-list.el" "47875c38e3722e913a52e17a36e35b23")
+;;; Generated autoloads from org-list.el
+
+(autoload 'org-list-checkbox-radio-mode "org-list" "\
+When turned on, use list checkboxes as radio buttons.
+
+If called interactively, enable Org-List-Checkbox-Radio 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.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (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" "c0b87b38400d6e7f5b3e7a61de8a7b7e")
+;;; 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-mobile" "org-mobile.el" "9a68b969d5c5d3f89dfd4dce19753452")
+;;; Generated autoloads from org-mobile.el
+
+(autoload 'org-mobile-push "org-mobile" "\
+Push the current state of Org affairs to the target directory.
+This will create the index file, copy all agenda files there, and also
+create all custom agenda views, for upload to the mobile phone." t nil)
+
+(autoload 'org-mobile-pull "org-mobile" "\
+Pull the contents of `org-mobile-capture-file' and integrate them.
+Apply all flagged actions, flag entries to be flagged and then call an
+agenda view showing the flagged items." t nil)
+
+;;;***
+
+;;;### (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-num" "org-num.el" "e60a3e53d2eab60841976baaa9ca6585")
+;;; Generated autoloads from org-num.el
+
+(autoload 'org-num-default-format "org-num" "\
+Default numbering display function.
+NUMBERING is a list of numbers.
+
+\(fn NUMBERING)" nil nil)
+
+(autoload 'org-num-mode "org-num" "\
+Dynamic numbering of headlines in an Org buffer.
+
+If called interactively, enable Org-Num 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.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (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" '("org-" "pcomplete/org-mode/")))
+
+;;;***
+
+;;;### (autoloads nil "org-plot" "org-plot.el" "57b93f7fc561fa842d313207fae716d8")
+;;; Generated autoloads from org-plot.el
+
+(autoload 'org-plot/gnuplot "org-plot" "\
+Plot table using gnuplot. Gnuplot options can be specified with PARAMS.
+If not given options will be taken from the +PLOT
+line directly before or after the table.
+
+\(fn &optional PARAMS)" t nil)
+
+;;;***
+
+;;;### (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-refile" "org-refile.el" "5df09bd1d8e278b9b8b29a266833de56")
+;;; Generated autoloads from org-refile.el
+
+(autoload 'org-refile-copy "org-refile" "\
+Like `org-refile', but preserve the refiled subtree." t nil)
+
+(autoload 'org-refile-reverse "org-refile" "\
+Refile while temporarily toggling `org-reverse-note-order'.
+So if `org-refile' would append the entry as the last entry under
+the target heading, `org-refile-reverse' will prepend it as the
+first entry, and vice-versa.
+
+\(fn &optional ARG DEFAULT-BUFFER RFLOC MSG)" t nil)
+
+(autoload 'org-refile "org-refile" "\
+Move the entry or entries at point to another heading.
+
+The list of target headings is compiled using the information in
+`org-refile-targets', which see.
+
+At the target location, the entry is filed as a subitem of the
+target heading. Depending on `org-reverse-note-order', the new
+subitem will either be the first or the last subitem.
+
+If there is an active region, all entries in that region will be
+refiled. However, the region must fulfill the requirement that
+the first heading sets the top-level of the moved text.
+
+With a `\\[universal-argument]' ARG, the command will only visit the target location
+and not actually move anything.
+
+With a prefix `\\[universal-argument] \\[universal-argument]', go to the location where the last
+refiling operation has put the subtree.
+
+With a numeric prefix argument of `2', refile to the running clock.
+
+With a numeric prefix argument of `3', emulate `org-refile-keep'
+being set to t and copy to the target location, don't move it.
+Beware that keeping refiled entries may result in duplicated ID
+properties.
+
+RFLOC can be a refile location obtained in a different way. It
+should be a list with the following 4 elements:
+
+1. Name - an identifier for the refile location, typically the
+headline text
+2. File - the file the refile location is in
+3. nil - used for generating refile location candidates, not
+needed when passing RFLOC
+4. Position - the position in the specified file of the
+headline to refile under
+
+MSG is a string to replace \"Refile\" in the default prompt with
+another verb. E.g. `org-refile-copy' sets this parameter to \"Copy\".
+
+See also `org-refile-use-outline-path'.
+
+If you are using target caching (see `org-refile-use-cache'), you
+have to clear the target cache in order to find new targets.
+This can be done with a `0' prefix (`C-0 C-c C-w') or a triple
+prefix argument (`C-u C-u C-u C-c C-w').
+
+\(fn &optional ARG DEFAULT-BUFFER RFLOC MSG)" t nil)
+
+;;;***
+
+;;;### (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 nil "org-table" "org-table.el" "7abbbe0fc8b35c584e97ccfd854ece6f")
+;;; Generated autoloads from org-table.el
+
+(autoload 'org-table-header-line-mode "org-table" "\
+Display the first row of the table at point in the header line.
+
+If called interactively, enable Org-Table-Header-Line 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.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'org-table-create-with-table\.el "org-table" "\
+Use the table.el package to insert a new table.
+If there is already a table at point, convert between Org tables
+and table.el tables." t nil)
+
+(autoload 'org-table-create-or-convert-from-region "org-table" "\
+Convert region to table, or create an empty table.
+If there is an active region, convert it to a table, using the function
+`org-table-convert-region'. See the documentation of that function
+to learn how the prefix argument is interpreted to determine the field
+separator.
+If there is no such region, create an empty table with `org-table-create'.
+
+\(fn ARG)" t nil)
+
+(autoload 'org-table-create "org-table" "\
+Query for a size and insert a table skeleton.
+SIZE is a string Columns x Rows like for example \"3x2\".
+
+\(fn &optional SIZE)" t nil)
+
+(autoload 'org-table-convert-region "org-table" "\
+Convert region to a table.
+
+The region goes from BEG0 to END0, but these borders will be moved
+slightly, to make sure a beginning of line in the first line is included.
+
+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
+nil When 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.
+
+\(fn BEG0 END0 &optional SEPARATOR)" t nil)
+
+(autoload 'org-table-import "org-table" "\
+Import FILE as a table.
+
+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-begin "org-table" "\
+Find the beginning of the table and return its position.
+With a non-nil optional argument TABLE-TYPE, return the beginning
+of a table.el-type table. This function assumes point is on
+a table.
+
+\(fn &optional TABLE-TYPE)" nil nil)
+
+(autoload 'org-table-end "org-table" "\
+Find the end of the table and return its position.
+With a non-nil optional argument TABLE-TYPE, return the end of
+a table.el-type table. This function assumes point is on
+a table.
+
+\(fn &optional TABLE-TYPE)" nil nil)
+
+(autoload 'org-table-next-field "org-table" "\
+Go to the next field in the current table, creating new lines as needed.
+Before doing so, re-align the table if necessary." t nil)
+
+(autoload 'org-table-previous-field "org-table" "\
+Go to the previous field in the table.
+Before doing so, re-align the table if necessary." t nil)
+
+(autoload 'org-table-next-row "org-table" "\
+Go to the next row (same column) in the current table.
+Before doing so, re-align the table if necessary." t nil)
+
+(autoload 'org-table-blank-field "org-table" "\
+Blank the current table field or active region." t nil)
+
+(autoload 'org-table-field-info "org-table" "\
+Show info about the current field, and highlight any reference at point.
+
+\(fn ARG)" t nil)
+
+(autoload 'org-table-goto-column "org-table" "\
+Move the cursor to the Nth column in the current table line.
+With optional argument ON-DELIM, stop with point before the left delimiter
+of the field.
+If there are less than N fields, just go to after the last delimiter.
+However, when FORCE is non-nil, create new columns if necessary.
+
+\(fn N &optional ON-DELIM FORCE)" t nil)
+
+(autoload 'org-table-insert-column "org-table" "\
+Insert a new column into the table." t nil)
+
+(autoload 'org-table-move-cell-up "org-table" "\
+Move a single cell up in a table.
+Swap with anything in target cell." t nil)
+
+(autoload 'org-table-move-cell-down "org-table" "\
+Move a single cell down in a table.
+Swap with anything in target cell." t nil)
+
+(autoload 'org-table-move-cell-left "org-table" "\
+Move a single cell left in a table.
+Swap with anything in target cell." t nil)
+
+(autoload 'org-table-move-cell-right "org-table" "\
+Move a single cell right in a table.
+Swap with anything in target cell." t nil)
+
+(autoload 'org-table-delete-column "org-table" "\
+Delete a column from the table." t nil)
+
+(autoload 'org-table-move-column-right "org-table" "\
+Move column to the right." t nil)
+
+(autoload 'org-table-move-column-left "org-table" "\
+Move column to the left." t nil)
+
+(autoload 'org-table-move-column "org-table" "\
+Move the current column to the right. With arg LEFT, move to the left.
+
+\(fn &optional LEFT)" t nil)
+
+(autoload 'org-table-move-row-down "org-table" "\
+Move table row down." t nil)
+
+(autoload 'org-table-move-row-up "org-table" "\
+Move table row up." t nil)
+
+(autoload 'org-table-move-row "org-table" "\
+Move the current table line down. With arg UP, move it up.
+
+\(fn &optional UP)" t nil)
+
+(autoload 'org-table-insert-row "org-table" "\
+Insert a new row above the current line into the table.
+With prefix ARG, insert below the current line.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'org-table-insert-hline "org-table" "\
+Insert a horizontal-line below the current line into the table.
+With prefix ABOVE, insert above the current line.
+
+\(fn &optional ABOVE)" t nil)
+
+(autoload 'org-table-hline-and-move "org-table" "\
+Insert a hline and move to the row below that line.
+
+\(fn &optional SAME-COLUMN)" t nil)
+
+(autoload 'org-table-kill-row "org-table" "\
+Delete the current row or horizontal line from the table." t nil)
+
+(autoload 'org-table-cut-region "org-table" "\
+Copy region in table to the clipboard and blank all relevant fields.
+If there is no active region, use just the field at point.
+
+\(fn BEG END)" t nil)
+
+(autoload 'org-table-copy-down "org-table" "\
+Copy the value of the current field one row below.
+
+If the field at the cursor is empty, copy the content of the
+nearest non-empty field above. With argument N, use the Nth
+non-empty field.
+
+If the current field is not empty, it is copied down to the next
+row, and the cursor is moved with it. Therefore, repeating this
+command causes the column to be filled row-by-row.
+
+If the variable `org-table-copy-increment' is non-nil and the
+field is a number, a timestamp, or is either prefixed or suffixed
+with a number, it will be incremented while copying. By default,
+increment by the difference between the value in the current
+field and the one in the field above, if any. To increment using
+a fixed integer, set `org-table-copy-increment' to a number. In
+the case of a timestamp, increment by days.
+
+However, when N is 0, do not increment the field at all.
+
+\(fn N)" t nil)
+
+(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'. Return the region copied, as a list
+of lists of fields.
+
+\(fn BEG END &optional CUT)" t nil)
+
+(autoload 'org-table-paste-rectangle "org-table" "\
+Paste a rectangular region into a table.
+The upper right 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." t nil)
+
+(autoload 'org-table-edit-field "org-table" "\
+Edit table field in a different window.
+This is mainly useful for fields that contain hidden parts.
+
+When called with a `\\[universal-argument]' prefix, just make the full field
+visible so that it can be edited in place.
+
+When called with a `\\[universal-argument] \\[universal-argument]' prefix, toggle `org-table-follow-field-mode'.
+
+\(fn ARG)" t nil)
+
+(autoload 'org-table-get-stored-formulas "org-table" "\
+Return an alist with the stored formulas directly after current table.
+By default, only return active formulas, i.e., formulas located
+on the first line after the table. However, if optional argument
+LOCATION is a buffer position, consider the formulas there.
+
+\(fn &optional NOERROR LOCATION)" nil nil)
+
+(autoload 'org-table-maybe-eval-formula "org-table" "\
+Check if the current field starts with \"=\" or \":=\".
+If yes, store the formula and apply it." nil nil)
+
+(autoload 'org-table-rotate-recalc-marks "org-table" "\
+Rotate the recalculation mark in the first column.
+If in any row, the first field is not consistent with a mark,
+insert a new column for the markers.
+When there is an active region, change all the lines in the region,
+after prompting for the marking character.
+After each change, a message will be displayed indicating the meaning
+of the new mark.
+
+\(fn &optional NEWCHAR)" t nil)
+
+(autoload 'org-table-maybe-recalculate-line "org-table" "\
+Recompute the current line if marked for it, and if we haven't just done it." t nil)
+
+(autoload 'org-table-eval-formula "org-table" "\
+Replace the table field value at the cursor by the result of a calculation.
+
+In a table, this command replaces the value in the current field with the
+result of a formula. It also installs the formula as the \"current\" column
+formula, by storing it in a special line below the table. When called
+with a `\\[universal-argument]' prefix the formula is installed as a field formula.
+
+When called with a `\\[universal-argument] \\[universal-argument]' prefix, insert the active equation for the field
+back into the current field, so that it can be edited there. This is useful
+in order to use \\<org-table-fedit-map>`\\[org-table-show-reference]' to check the referenced fields.
+
+When called, the command first prompts for a formula, which is read in
+the minibuffer. Previously entered formulas are available through the
+history list, and the last used formula is offered as a default.
+These stored formulas are adapted correctly when moving, inserting, or
+deleting columns with the corresponding commands.
+
+The formula can be any algebraic expression understood by the Calc package.
+For details, see the Org mode manual.
+
+This function can also be called from Lisp programs and offers
+additional arguments: EQUATION can be the formula to apply. If this
+argument is given, the user will not be prompted.
+
+SUPPRESS-ALIGN is used to speed-up recursive calls by by-passing
+unnecessary aligns.
+
+SUPPRESS-CONST suppresses the interpretation of constants in the
+formula, assuming that this has been done already outside the
+function.
+
+SUPPRESS-STORE means the formula should not be stored, either
+because it is already stored, or because it is a modified
+equation that should not overwrite the stored one.
+
+SUPPRESS-ANALYSIS prevents analyzing the table and checking
+location of point.
+
+\(fn &optional ARG EQUATION SUPPRESS-ALIGN SUPPRESS-CONST SUPPRESS-STORE SUPPRESS-ANALYSIS)" t nil)
+
+(autoload 'org-table-recalculate "org-table" "\
+Recalculate the current table line by applying all stored formulas.
+
+With prefix arg ALL, do this for all lines in the table.
+
+When called with a `\\[universal-argument] \\[universal-argument]' prefix, or if ALL is the symbol `iterate',
+recompute the table until it no longer changes.
+
+If NOALIGN is not nil, do not re-align the table after the computations
+are done. This is typically used internally to save time, if it is
+known that the table will be realigned a little later anyway.
+
+\(fn &optional ALL NOALIGN)" t nil)
+
+(autoload 'org-table-iterate "org-table" "\
+Recalculate the table until it does not change anymore.
+The maximum number of iterations is 10, but you can choose a different value
+with the prefix ARG.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'org-table-recalculate-buffer-tables "org-table" "\
+Recalculate all tables in the current buffer." t nil)
+
+(autoload 'org-table-iterate-buffer-tables "org-table" "\
+Iterate all tables in the buffer, to converge inter-table dependencies." t nil)
+
+(autoload 'org-table-edit-formulas "org-table" "\
+Edit the formulas of the current table in a separate buffer." t nil)
+
+(autoload 'org-table-toggle-coordinate-overlays "org-table" "\
+Toggle the display of Row/Column numbers in tables." t nil)
+
+(autoload 'org-table-toggle-formula-debugger "org-table" "\
+Toggle the formula debugger in tables." 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-map-tables "org-table" "\
+Apply function F to the start of all tables in the buffer.
+
+\(fn F &optional QUIETLY)" nil nil)
+
+(autoload 'org-table-export "org-table" "\
+Export table to a file, with configurable format.
+Such a file can be imported into usual spreadsheet programs.
+
+FILE can be the output file name. If not given, it will be taken
+from a TABLE_EXPORT_FILE property in the current entry or higher
+up in the hierarchy, or the user will be prompted for a file
+name. FORMAT can be an export format, of the same kind as it
+used when `-mode' sends a table in a different format.
+
+The command suggests a format depending on TABLE_EXPORT_FORMAT,
+whether it is set locally or up in the hierarchy, then on the
+extension of the given file name, and finally on the variable
+`org-table-export-default-format'.
+
+\(fn &optional FILE FORMAT)" t nil)
+
+(autoload 'org-table--align-field "org-table" "\
+Format FIELD according to column WIDTH and alignment ALIGN.
+FIELD is a string. WIDTH is a number. ALIGN is either \"c\",
+\"l\" or\"r\".
+
+\(fn FIELD WIDTH ALIGN)" nil nil)
+
+(autoload 'org-table-justify-field-maybe "org-table" "\
+Justify the current field, text to left, number to right.
+Optional argument NEW may specify text to replace the current field content.
+
+\(fn &optional NEW)" nil nil)
+
+(autoload 'org-table-sort-lines "org-table" "\
+Sort table lines according to the column at point.
+
+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 of no such lines
+exist. 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 then prompts for the sorting type which can be
+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
+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,
+any of (?a ?A ?n ?N ?t ?T ?f ?F) where the capital letters indicate that
+sorting should be done in reverse order.
+
+If the SORTING-TYPE is ?f or ?F, then GETKEY-FUNC specifies
+a function to be called to extract the key. It must return a value
+that is compatible with COMPARE-FUNC, the function used to compare
+entries.
+
+A non-nil value for INTERACTIVE? is used to signal that this
+function is being called interactively.
+
+\(fn &optional WITH-CASE SORTING-TYPE GETKEY-FUNC COMPARE-FUNC INTERACTIVE\\=\\?)" t nil)
+
+(autoload 'org-table-wrap-region "org-table" "\
+Wrap several fields in a column like a paragraph.
+This is useful if you'd like to spread the contents of a field over several
+lines, in order to keep the table compact.
+
+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. Generally, this makes the table more compact. A prefix ARG may be
+used to change the number of desired lines. For example, `C-2 \\[org-table-wrap-region]'
+formats the selected text to two lines. If the region was longer than two
+lines, the remaining lines remain empty. A negative prefix argument reduces
+the current number of lines by that amount. The wrapped text is pasted back
+into the table. If you formatted it to more lines than it was before, fields
+further down in the table get overwritten - so you might need to make space in
+the table first.
+
+If there is no region, the current field is split at the cursor position and
+the text fragment to the right of the cursor is prepended to the field one
+line down.
+
+If there is no region, but you specify a prefix ARG, the current field gets
+blank, and the content is appended to the field above.
+
+\(fn ARG)" t nil)
+
+(autoload 'org-table-sum "org-table" "\
+Sum numbers in region of current table column.
+The result will be displayed in the echo area, and will be available
+as kill to be inserted with \\[yank].
+
+If there is an active region, it is interpreted as a rectangle and all
+numbers in that rectangle will be summed. If there is no active
+region and point is located in a table column, sum all numbers in that
+column.
+
+If at least one number looks like a time HH:MM or HH:MM:SS, all other
+numbers are assumed to be times as well (in decimal hours) and the
+numbers are added as such.
+
+If NLAST is a number, only the NLAST fields will actually be summed.
+
+\(fn &optional BEG END NLAST)" t nil)
+
+(autoload 'org-table-analyze "org-table" "\
+Analyze table at point and store results.
+
+This function sets up the following dynamically scoped variables:
+
+ `org-table-column-name-regexp',
+ `org-table-column-names',
+ `org-table-current-begin-pos',
+ `org-table-current-line-types',
+ `org-table-current-ncol',
+ `org-table-dlines',
+ `org-table-hlines',
+ `org-table-local-parameters',
+ `org-table-named-field-locations'." nil nil)
+
+(autoload 'turn-on-orgtbl "org-table" "\
+Unconditionally turn on `orgtbl-mode'." nil nil)
+
+(autoload 'orgtbl-mode "org-table" "\
+The Org mode table editor as a minor mode for use in other modes.
+
+If called interactively, enable Orgtbl 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.
+
+\(fn &optional ARG)" t nil)
+
+(defvar orgtbl-exp-regexp "^\\([-+]?[0-9][0-9.]*\\)[eE]\\([-+]?[0-9]+\\)$" "\
+Regular expression matching exponentials as produced by calc.")
+
+(autoload 'org-table-to-lisp "org-table" "\
+Convert the table at point to a Lisp structure.
+
+The structure will be a list. Each item is either the symbol `hline'
+for a horizontal separator line, or a list of field values as strings.
+The table is taken from the parameter TXT, or from the buffer at point.
+
+\(fn &optional TXT)" nil nil)
+
+(autoload 'orgtbl-to-generic "org-table" "\
+Convert the `orgtbl-mode' TABLE to some other format.
+
+This generic routine can be used for many standard cases.
+
+TABLE is a list, each entry either the symbol `hline' for
+a horizontal separator line, or a list of fields for that
+line. PARAMS is a property list of parameters that can
+influence the conversion.
+
+Valid parameters are:
+
+:backend, :raw
+
+ Export back-end used as a basis to transcode elements of the
+ table, when no specific parameter applies to it. It is also
+ used to translate cells contents. You can prevent this by
+ setting :raw property to a non-nil value.
+
+:splice
+
+ When non-nil, only convert rows, not the table itself. This is
+ equivalent to setting to the empty string both :tstart
+ and :tend, which see.
+
+:skip
+
+ When set to an integer N, skip the first N lines of the table.
+ Horizontal separation lines do count for this parameter!
+
+:skipcols
+
+ List of columns that should be skipped. If the table has
+ a column with calculation marks, that column is automatically
+ discarded beforehand.
+
+:hline
+
+ String to be inserted on horizontal separation lines. May be
+ nil to ignore these lines altogether.
+
+:sep
+
+ Separator between two fields, as a string.
+
+Each in the following group may be either a string or a function
+of no arguments returning a string:
+
+:tstart, :tend
+
+ Strings to start and end the table. Ignored when :splice is t.
+
+:lstart, :lend
+
+ Strings to start and end a new table line.
+
+:llstart, :llend
+
+ Strings to start and end the last table line. Default,
+ respectively, to :lstart and :lend.
+
+Each in the following group may be a string or a function of one
+argument (either the cells in the current row, as a list of
+strings, or the current cell) returning a string:
+
+:lfmt
+
+ Format string for an entire row, with enough %s to capture all
+ fields. When non-nil, :lstart, :lend, and :sep are ignored.
+
+:llfmt
+
+ Format for the entire last line, defaults to :lfmt.
+
+:fmt
+
+ A format to be used to wrap the field, should contain %s for
+ the original field value. For example, to wrap everything in
+ dollars, you could use :fmt \"$%s$\". This may also be
+ a property list with column numbers and format strings, or
+ functions, e.g.,
+
+ (:fmt (2 \"$%s$\" 4 (lambda (c) (format \"$%s$\" c))))
+
+:hlstart :hllstart :hlend :hllend :hsep :hlfmt :hllfmt :hfmt
+
+ Same as above, specific for the header lines in the table.
+ All lines before the first hline are treated as header. If
+ any of these is not present, the data line value is used.
+
+This may be either a string or a function of two arguments:
+
+:efmt
+
+ Use this format to print numbers with exponential. The format
+ 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 format strings or functions.
+ :fmt will still be applied after :efmt.
+
+\(fn TABLE PARAMS)" nil nil)
+
+(autoload 'orgtbl-to-tsv "org-table" "\
+Convert the `orgtbl-mode' TABLE to TAB separated material.
+
+\(fn TABLE PARAMS)" nil nil)
+
+(autoload 'orgtbl-to-csv "org-table" "\
+Convert the `orgtbl-mode' TABLE to CSV material.
+This does take care of the proper quoting of fields with comma or quotes.
+
+\(fn TABLE PARAMS)" nil nil)
+
+(autoload 'orgtbl-to-latex "org-table" "\
+Convert the `orgtbl-mode' TABLE to LaTeX.
+
+TABLE is a list, each entry either the symbol `hline' for
+a horizontal separator line, or a list of fields for that line.
+PARAMS is a property list of parameters that can influence the
+conversion. All parameters from `orgtbl-to-generic' are
+supported. It is also possible to use the following ones:
+
+:booktabs
+
+ When non-nil, use formal \"booktabs\" style.
+
+:environment
+
+ Specify environment to use, as a string. If you use
+ \"longtable\", you may also want to specify :language property,
+ as a string, to get proper continuation strings.
+
+\(fn TABLE PARAMS)" nil nil)
+
+(autoload 'orgtbl-to-html "org-table" "\
+Convert the `orgtbl-mode' TABLE to HTML.
+
+TABLE is a list, each entry either the symbol `hline' for
+a horizontal separator line, or a list of fields for that line.
+PARAMS is a property list of parameters that can influence the
+conversion. All parameters from `orgtbl-to-generic' are
+supported. It is also possible to use the following one:
+
+:attributes
+
+ Attributes and values, as a plist, which will be used in
+ <table> tag.
+
+\(fn TABLE PARAMS)" nil nil)
+
+(autoload 'orgtbl-to-texinfo "org-table" "\
+Convert the `orgtbl-mode' TABLE to Texinfo.
+
+TABLE is a list, each entry either the symbol `hline' for
+a horizontal separator line, or a list of fields for that line.
+PARAMS is a property list of parameters that can influence the
+conversion. All parameters from `orgtbl-to-generic' are
+supported. It is also possible to use the following one:
+
+:columns
+
+ Column widths, as a string. When providing column fractions,
+ \"@columnfractions\" command can be omitted.
+
+\(fn TABLE PARAMS)" nil nil)
+
+(autoload 'orgtbl-to-orgtbl "org-table" "\
+Convert the `orgtbl-mode' TABLE into another orgtbl-mode table.
+
+TABLE is a list, each entry either the symbol `hline' for
+a horizontal separator line, or a list of fields for that line.
+PARAMS is a property list of parameters that can influence the
+conversion. All parameters from `orgtbl-to-generic' are
+supported.
+
+Useful when slicing one table into many. The :hline, :sep,
+:lstart, and :lend provide orgtbl framing. :tstart and :tend can
+be set to provide ORGTBL directives for the generated table.
+
+\(fn TABLE PARAMS)" nil nil)
+
+(autoload 'orgtbl-ascii-plot "org-table" "\
+Draw an ASCII bar plot in a column.
+
+With cursor in a column containing numerical values, this function
+will draw a plot in a new column.
+
+ASK, if given, is a numeric prefix to override the default 12
+characters width of the plot. ASK may also be the `\\[universal-argument]' prefix,
+which will prompt for the width.
+
+\(fn &optional ASK)" t nil)
+
+;;;***
+
+;;;### (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" "75e6b4a24097d5c0fcac8b141b65ca47")
+;;; Generated autoloads from org-timer.el
+
+(autoload 'org-timer-start "org-timer" "\
+Set the starting time for the relative timer to now.
+When called with prefix argument OFFSET, prompt the user for an offset time,
+with the default taken from a timer stamp at point, if any.
+If OFFSET is a string or an integer, it is directly taken to be the offset
+without user interaction.
+When called with a double prefix arg, all timer strings in the active
+region will be shifted by a specific amount. You will be prompted for
+the amount, with the default to make the first timer string in
+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." 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.
+
+When used with a `\\[universal-argument]' prefix, force restarting the timer.
+
+When used with a `\\[universal-argument] \\[universal-argument]' prefix, change all the timer strings
+in the region by a fixed amount. This can be used to re-calibrate
+a timer that was not started at the correct moment.
+
+If NO-INSERT is non-nil, return the string instead of inserting
+it in the buffer.
+
+\(fn &optional RESTART NO-INSERT)" t nil)
+
+(autoload 'org-timer-change-times-in-region "org-timer" "\
+Change all h:mm:ss time in region by a DELTA.
+
+\(fn BEG END DELTA)" t nil)
+
+(autoload 'org-timer-item "org-timer" "\
+Insert a description-type item with the current timer value.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'org-timer-set-timer "org-timer" "\
+Prompt for a duration in minutes or hh:mm:ss and set a timer.
+
+If `org-timer-default-timer' is not \"0\", suggest this value as
+the default duration for the timer. If a timer is already set,
+prompt the user if she wants to replace it.
+
+Called with a numeric prefix argument, use this numeric value as
+the duration of the timer in minutes.
+
+Called with a \\[universal-argument] prefix arguments, use `org-timer-default-timer'
+without prompting the user for a duration.
+
+With two \\[universal-argument] prefix arguments, use `org-timer-default-timer'
+without prompting the user for a duration and automatically
+replace any running timer.
+
+By default, the timer duration will be set to the number of
+minutes in the Effort property, if any. You can ignore this by
+using three \\[universal-argument] prefix arguments.
+
+\(fn &optional OPT)" t nil)
+
+;;;***
+
+;;;### (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." nil nil)
+
+(autoload 'org-git-version "org-version" "\
+The Git version of Org mode.
+Inserted by installing Org or when a release is made." nil nil)
+
+;;;***
+
+;;;### (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
+optional prefix argument COMPILE, the tangled Emacs Lisp file is
+byte-compiled 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 'org-load-modules-maybe "org" "\
+Load all extensions listed in `org-modules'.
+
+\(fn &optional FORCE)" nil nil)
+
+(autoload 'org-clock-persistence-insinuate "org" "\
+Set up hooks for clock persistence." 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 very beginning of the buffer, if
+there is no headline there, and if the variable `org-cycle-global-at-bob'
+is non-nil, this function acts as if called with prefix argument (`\\[universal-argument] TAB',
+same as `S-TAB') also when called without prefix argument.
+
+\(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-open-file "org" "\
+Open the file at PATH.
+First, this expands any special file name abbreviations. Then the
+configuration variable `org-file-apps' is checked if it contains an
+entry for this file type, and if yes, the corresponding command is launched.
+
+If no application is found, Emacs simply visits the file.
+
+With optional prefix argument IN-EMACS, Emacs will visit the file.
+With a double \\[universal-argument] \\[universal-argument] prefix arg, Org tries to avoid opening in Emacs
+and to use an external application to visit the file.
+
+Optional LINE specifies a line to go to, optional SEARCH a string
+to search for. If LINE or SEARCH is given, the file will be
+opened in Emacs, unless an entry from `org-file-apps' that makes
+use of groups in a regexp matches.
+
+If you want to change the way frames are used when following a
+link, please customize `org-link-frame-setup'.
+
+If the file does not exist, throw an error.
+
+\(fn PATH &optional IN-EMACS LINE SEARCH)" nil 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." t nil)
+
+(autoload 'org-offer-links-in-entry "org" "\
+Offer links in the current entry and return the selected link.
+If there is only one link, return it.
+If NTH is an integer, return the NTH link found.
+If ZERO is a string, check also this string for a link, and if
+there is one, return it.
+
+\(fn BUFFER MARKER &optional NTH ZERO)" nil 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." 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." 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." t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org" '("org-" "turn-on-org-cdlatex")))
+
+;;;***
+
+;;;### (autoloads nil "ox" "ox.el" "fce0b99b801c9b81cf28c50bc6218e8e")
+;;; Generated autoloads from ox.el
+
+(autoload 'org-export-get-backend "ox" "\
+Return export back-end named after NAME.
+NAME is a symbol. Return nil if no such back-end is found.
+
+\(fn NAME)" nil nil)
+
+(autoload 'org-export-derived-backend-p "ox" "\
+Non-nil if BACKEND is derived from one of BACKENDS.
+BACKEND is an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end. BACKENDS is constituted of symbols.
+
+\(fn BACKEND &rest BACKENDS)" nil nil)
+
+(autoload 'org-export-get-environment "ox" "\
+Collect export options from the current buffer.
+
+Optional argument BACKEND is an export back-end, as returned by
+`org-export-create-backend'.
+
+When optional argument SUBTREEP is non-nil, assume the export is
+done against the current sub-tree.
+
+Third optional argument EXT-PLIST is a property list with
+external parameters overriding Org default settings, but still
+inferior to file-local settings.
+
+\(fn &optional BACKEND SUBTREEP EXT-PLIST)" nil nil)
+
+(autoload 'org-export-data "ox" "\
+Convert DATA into current back-end format.
+
+DATA is a parse tree, an element or an object or a secondary
+string. INFO is a plist holding export options.
+
+Return a string.
+
+\(fn DATA INFO)" nil nil)
+
+(autoload 'org-export-as "ox" "\
+Transcode current Org buffer into BACKEND code.
+
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end.
+
+If narrowing is active in the current buffer, only transcode its
+narrowed part.
+
+If a region is active, transcode that region.
+
+When optional argument SUBTREEP is non-nil, transcode the
+sub-tree at point, extracting information from the headline
+properties first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only return body
+code, without surrounding template.
+
+Optional argument EXT-PLIST, when provided, is a property list
+with external parameters overriding Org default settings, but
+still inferior to file-local settings.
+
+Return code as a string.
+
+\(fn BACKEND &optional SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" nil nil)
+
+(autoload 'org-export-string-as "ox" "\
+Transcode STRING into BACKEND code.
+
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end.
+
+When optional argument BODY-ONLY is non-nil, only return body
+code, without preamble nor postamble.
+
+Optional argument EXT-PLIST, when provided, is a property list
+with external parameters overriding Org default settings, but
+still inferior to file-local settings.
+
+Return code as a string.
+
+\(fn STRING BACKEND &optional BODY-ONLY EXT-PLIST)" nil nil)
+
+(autoload 'org-export-replace-region-by "ox" "\
+Replace the active region by its export to BACKEND.
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end.
+
+\(fn BACKEND)" nil nil)
+
+(autoload 'org-export-insert-default-template "ox" "\
+Insert all export keywords with default values at beginning of line.
+
+BACKEND is a symbol referring to the name of a registered export
+back-end, for which specific export options should be added to
+the template, or `default' for default template. When it is nil,
+the user will be prompted for a category.
+
+If SUBTREEP is non-nil, export configuration will be set up
+locally for the subtree through node properties.
+
+\(fn &optional BACKEND SUBTREEP)" t nil)
+
+(autoload 'org-export-raw-string "ox" "\
+Return a raw object containing string S.
+A raw string is exported as-is, with no additional processing
+from the export back-end.
+
+\(fn S)" nil nil)
+
+(autoload 'org-export-to-buffer "ox" "\
+Call `org-export-as' with output to a specified buffer.
+
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end.
+
+BUFFER is the name of the output buffer. If it already exists,
+it will be erased first, otherwise, it will be created.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should then be accessible
+through the `org-export-stack' interface. When ASYNC is nil, the
+buffer is displayed if `org-export-show-temporary-export-buffer'
+is non-nil.
+
+Optional arguments SUBTREEP, VISIBLE-ONLY, BODY-ONLY and
+EXT-PLIST are similar to those used in `org-export-as', which
+see.
+
+Optional argument POST-PROCESS is a function which should accept
+no argument. It is always called within the current process,
+from BUFFER, with point at its beginning. Export back-ends can
+use it to set a major mode there, e.g,
+
+ (defun org-latex-export-as-latex
+ (&optional async subtreep visible-only body-only ext-plist)
+ (interactive)
+ (org-export-to-buffer \\='latex \"*Org LATEX Export*\"
+ async subtreep visible-only body-only ext-plist
+ #'LaTeX-mode))
+
+When expressed as an anonymous function, using `lambda',
+POST-PROCESS needs to be quoted.
+
+This function returns BUFFER.
+
+\(fn BACKEND BUFFER &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST POST-PROCESS)" nil nil)
+
+(function-put 'org-export-to-buffer 'lisp-indent-function '2)
+
+(autoload 'org-export-to-file "ox" "\
+Call `org-export-as' with output to a specified file.
+
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end. FILE is the name of the output file, as
+a string.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer will then be accessible
+through the `org-export-stack' interface.
+
+Optional arguments SUBTREEP, VISIBLE-ONLY, BODY-ONLY and
+EXT-PLIST are similar to those used in `org-export-as', which
+see.
+
+Optional argument POST-PROCESS is called with FILE as its
+argument and happens asynchronously when ASYNC is non-nil. It
+has to return a file name, or nil. Export back-ends can use this
+to send the output file through additional processing, e.g,
+
+ (defun org-latex-export-to-latex
+ (&optional async subtreep visible-only body-only ext-plist)
+ (interactive)
+ (let ((outfile (org-export-output-file-name \".tex\" subtreep)))
+ (org-export-to-file \\='latex outfile
+ async subtreep visible-only body-only ext-plist
+ #'org-latex-compile)))
+
+When expressed as an anonymous function, using `lambda',
+POST-PROCESS needs to be quoted.
+
+The function returns either a file name returned by POST-PROCESS,
+or FILE.
+
+\(fn BACKEND FILE &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST POST-PROCESS)" nil nil)
+
+(function-put 'org-export-to-file 'lisp-indent-function '2)
+
+(autoload 'org-export-dispatch "ox" "\
+Export dispatcher for Org mode.
+
+It provides an access to common export related tasks in a buffer.
+Its interface comes in two flavors: standard and expert.
+
+While both share the same set of bindings, only the former
+displays the valid keys associations in a dedicated buffer.
+Scrolling (resp. line-wise motion) in this buffer is done with
+SPC and DEL (resp. C-n and C-p) keys.
+
+Set variable `org-export-dispatch-use-expert-ui' to switch to one
+flavor or the other.
+
+When ARG is `\\[universal-argument]', repeat the last export action, with the same
+set of options used back then, on the current buffer.
+
+When ARG is `\\[universal-argument] \\[universal-argument]', display the asynchronous export stack.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads nil "ox-ascii" "ox-ascii.el" "6da0b9d11d3a8bbf67418522ae750701")
+;;; 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." t nil)
+
+(autoload 'org-ascii-convert-region-to-utf8 "ox-ascii" "\
+Assume region has Org syntax, and convert it to UTF-8." t nil)
+
+(autoload 'org-ascii-export-as-ascii "ox-ascii" "\
+Export current buffer to a text buffer.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, strip title and
+table of contents from output.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Export is done in a buffer named \"*Org ASCII Export*\", which
+will be displayed when `org-export-show-temporary-export-buffer'
+is non-nil.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-ascii-export-to-ascii "ox-ascii" "\
+Export current buffer to a text file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, strip title and
+table of contents from output.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return output file's name.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-ascii-publish-to-ascii "ox-ascii" "\
+Publish an Org file to ASCII.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name.
+
+\(fn PLIST FILENAME PUB-DIR)" nil nil)
+
+(autoload 'org-ascii-publish-to-latin1 "ox-ascii" "\
+Publish an Org file to Latin-1.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name.
+
+\(fn PLIST FILENAME PUB-DIR)" nil nil)
+
+(autoload 'org-ascii-publish-to-utf8 "ox-ascii" "\
+Publish an org file to UTF-8.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name.
+
+\(fn PLIST FILENAME PUB-DIR)" nil nil)
+
+;;;***
+
+;;;### (autoloads nil "ox-beamer" "ox-beamer.el" "807324453f67944065d6e758022d94fa")
+;;; Generated autoloads from ox-beamer.el
+
+(autoload 'org-beamer-mode "ox-beamer" "\
+Support for editing Beamer oriented Org mode files.
+
+If called interactively, enable Org-Beamer 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.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'org-beamer-export-as-latex "ox-beamer" "\
+Export current buffer as a Beamer buffer.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Export is done in a buffer named \"*Org BEAMER Export*\", which
+will be displayed when `org-export-show-temporary-export-buffer'
+is non-nil.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-beamer-export-to-latex "ox-beamer" "\
+Export current buffer as a Beamer presentation (tex).
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return output file's name.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-beamer-export-to-pdf "ox-beamer" "\
+Export current buffer as a Beamer presentation (PDF).
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return PDF file's name.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-beamer-select-environment "ox-beamer" "\
+Select the environment to be used by beamer for this entry.
+While this uses (for convenience) a tag selection interface, the
+result of this command will be that the BEAMER_env *property* of
+the entry is set.
+
+In addition to this, the command will also set a tag as a visual
+aid, but the tag does not have any semantic meaning." t nil)
+
+(autoload 'org-beamer-publish-to-latex "ox-beamer" "\
+Publish an Org file to a Beamer presentation (LaTeX).
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name.
+
+\(fn PLIST FILENAME PUB-DIR)" nil nil)
+
+(autoload 'org-beamer-publish-to-pdf "ox-beamer" "\
+Publish an Org file to a Beamer presentation (PDF, via LaTeX).
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name.
+
+\(fn PLIST FILENAME PUB-DIR)" nil nil)
+
+;;;***
+
+;;;### (autoloads nil "ox-html" "ox-html.el" "f7468dd6deceb9c83ecb7f97defdcfaf")
+;;; Generated autoloads from ox-html.el
+
+(put 'org-html-head-include-default-style 'safe-local-variable 'booleanp)
+
+(put 'org-html-head 'safe-local-variable 'stringp)
+
+(put 'org-html-head-extra 'safe-local-variable 'stringp)
+
+(autoload 'org-html-htmlize-generate-css "ox-html" "\
+Create the CSS for all font definitions in the current Emacs session.
+Use this to create face definitions in your CSS style file that can then
+be used by code snippets transformed by htmlize.
+This command just produces a buffer that contains class definitions for all
+faces used in the current Emacs session. You can copy and paste the ones you
+need into your CSS file.
+
+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." t nil)
+
+(autoload 'org-html-export-as-html "ox-html" "\
+Export current buffer to an HTML buffer.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"<body>\" and \"</body>\" tags.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Export is done in a buffer named \"*Org HTML Export*\", which
+will be displayed when `org-export-show-temporary-export-buffer'
+is non-nil.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-html-convert-region-to-html "ox-html" "\
+Assume the current region has Org syntax, and convert it to HTML.
+This can be used in any buffer. For example, you can write an
+itemized list in Org syntax in an HTML buffer and use this command
+to convert it." t nil)
+
+(autoload 'org-html-export-to-html "ox-html" "\
+Export current buffer to a HTML file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"<body>\" and \"</body>\" tags.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return output file's name.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-html-publish-to-html "ox-html" "\
+Publish an org file to HTML.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name.
+
+\(fn PLIST FILENAME PUB-DIR)" nil nil)
+
+;;;***
+
+;;;### (autoloads nil "ox-icalendar" "ox-icalendar.el" "650f4a57adb693d64b07f18d5a4664b4")
+;;; Generated autoloads from ox-icalendar.el
+
+(autoload 'org-icalendar-export-to-ics "ox-icalendar" "\
+Export current buffer to an iCalendar file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"BEGIN:VCALENDAR\" and \"END:VCALENDAR\".
+
+Return ICS file name.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY)" t nil)
+
+(autoload 'org-icalendar-export-agenda-files "ox-icalendar" "\
+Export all agenda files to iCalendar files.
+When optional argument ASYNC is non-nil, export happens in an
+external process.
+
+\(fn &optional ASYNC)" t nil)
+
+(autoload 'org-icalendar-combine-agenda-files "ox-icalendar" "\
+Combine all agenda files into a single iCalendar file.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+The file is stored under the name chosen in
+`org-icalendar-combined-agenda-file'.
+
+\(fn &optional ASYNC)" t nil)
+
+;;;***
+
+;;;### (autoloads nil "ox-koma-letter" "ox-koma-letter.el" (0 0 0
+;;;;;; 0))
+;;; Generated autoloads from ox-koma-letter.el
+
+(autoload 'org-koma-letter-export-as-latex "ox-koma-letter" "\
+Export current buffer as a KOMA Scrlttr2 letter.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{letter}\" and \"\\end{letter}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Export is done in a buffer named \"*Org KOMA-LETTER Export*\". It
+will be displayed if `org-export-show-temporary-export-buffer' is
+non-nil.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-koma-letter-export-to-latex "ox-koma-letter" "\
+Export current buffer as a KOMA Scrlttr2 letter (tex).
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{letter}\" and \"\\end{letter}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+When optional argument PUB-DIR is set, use it as the publishing
+directory.
+
+Return output file's name.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-koma-letter-export-to-pdf "ox-koma-letter" "\
+Export current buffer as a KOMA Scrlttr2 letter (pdf).
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{letter}\" and \"\\end{letter}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return PDF file's name.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox-koma-letter" '("org-koma-letter-")))
+
+;;;***
+
+;;;### (autoloads nil "ox-latex" "ox-latex.el" "607c6ea48b6de117fe755f8f3be63ee9")
+;;; Generated autoloads from ox-latex.el
+
+(autoload 'org-latex-make-preamble "ox-latex" "\
+Return a formatted LaTeX preamble.
+INFO is a plist used as a communication channel. Optional
+argument TEMPLATE, when non-nil, is the header template string,
+as expected by `org-splice-latex-header'. When SNIPPET? is
+non-nil, only includes packages relevant to image generation, as
+specified in `org-latex-default-packages-alist' or
+`org-latex-packages-alist'.
+
+\(fn INFO &optional TEMPLATE SNIPPET\\=\\?)" nil nil)
+
+(autoload 'org-latex-export-as-latex "ox-latex" "\
+Export current buffer as a LaTeX buffer.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Export is done in a buffer named \"*Org LATEX Export*\", which
+will be displayed when `org-export-show-temporary-export-buffer'
+is non-nil.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-latex-convert-region-to-latex "ox-latex" "\
+Assume the current region has Org syntax, and convert it to LaTeX.
+This can be used in any buffer. For example, you can write an
+itemized list in Org syntax in an LaTeX buffer and use this
+command to convert it." t nil)
+
+(autoload 'org-latex-export-to-latex "ox-latex" "\
+Export current buffer to a LaTeX file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-latex-export-to-pdf "ox-latex" "\
+Export current buffer to LaTeX then process through to PDF.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return PDF file's name.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-latex-publish-to-latex "ox-latex" "\
+Publish an Org file to LaTeX.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name.
+
+\(fn PLIST FILENAME PUB-DIR)" nil nil)
+
+(autoload 'org-latex-publish-to-pdf "ox-latex" "\
+Publish an Org file to PDF (via LaTeX).
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name.
+
+\(fn PLIST FILENAME PUB-DIR)" nil nil)
+
+;;;***
+
+;;;### (autoloads nil "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 nil "ox-md" "ox-md.el" "2b399d8c10668d24b7733db17b2861c2")
+;;; Generated autoloads from ox-md.el
+
+(autoload 'org-md-export-as-markdown "ox-md" "\
+Export current buffer to a Markdown buffer.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+Export is done in a buffer named \"*Org MD Export*\", which will
+be displayed when `org-export-show-temporary-export-buffer' is
+non-nil.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY)" t nil)
+
+(autoload 'org-md-convert-region-to-md "ox-md" "\
+Assume the current region has Org syntax, and convert it to Markdown.
+This can be used in any buffer. For example, you can write an
+itemized list in Org syntax in a Markdown buffer and use
+this command to convert it." t nil)
+
+(autoload 'org-md-export-to-markdown "ox-md" "\
+Export current buffer to a Markdown file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+Return output file's name.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY)" t nil)
+
+(autoload 'org-md-publish-to-md "ox-md" "\
+Publish an org file to Markdown.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name.
+
+\(fn PLIST FILENAME PUB-DIR)" nil nil)
+
+;;;***
+
+;;;### (autoloads nil "ox-odt" "ox-odt.el" "2fea0df26eda2199b93c7af143ff5bd6")
+;;; Generated autoloads from ox-odt.el
+
+(put 'org-odt-preferred-output-format 'safe-local-variable 'stringp)
+
+(autoload 'org-odt-export-as-odf "ox-odt" "\
+Export LATEX-FRAG as OpenDocument formula file ODF-FILE.
+Use `org-create-math-formula' to convert LATEX-FRAG first to
+MathML. When invoked as an interactive command, use
+`org-latex-regexps' to infer LATEX-FRAG from currently active
+region. If no LaTeX fragments are found, prompt for it. Push
+MathML source to kill ring depending on the value of
+`org-export-copy-to-kill-ring'.
+
+\(fn LATEX-FRAG &optional ODF-FILE)" t nil)
+
+(autoload 'org-odt-export-as-odf-and-open "ox-odt" "\
+Export LaTeX fragment as OpenDocument formula and immediately open it.
+Use `org-odt-export-as-odf' to read LaTeX fragment and OpenDocument
+formula file." t nil)
+
+(autoload 'org-odt-export-to-odt "ox-odt" "\
+Export current buffer to a ODT file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return output file's name.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-odt-convert "ox-odt" "\
+Convert IN-FILE to format OUT-FMT using a command line converter.
+IN-FILE is the file to be converted. If unspecified, it defaults
+to variable `buffer-file-name'. OUT-FMT is the desired output
+format. Use `org-odt-convert-process' as the converter. If OPEN
+is non-nil then the newly converted file is opened using
+`org-open-file'.
+
+\(fn &optional IN-FILE OUT-FMT OPEN)" t nil)
+
+;;;***
+
+;;;### (autoloads nil "ox-org" "ox-org.el" "06cc9b2debce400a895409334551f10c")
+;;; Generated autoloads from ox-org.el
+
+(autoload 'org-org-export-as-org "ox-org" "\
+Export current buffer to an Org buffer.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, strip document
+keywords from output.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Export is done in a buffer named \"*Org ORG Export*\", which will
+be displayed when `org-export-show-temporary-export-buffer' is
+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.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, strip document
+keywords from output.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+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.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name.
+
+\(fn PLIST FILENAME PUB-DIR)" nil nil)
+
+;;;***
+
+;;;### (autoloads nil "ox-publish" "ox-publish.el" "5a31bb72e99716b09561f75cfdf6f8ca")
+;;; Generated autoloads from ox-publish.el
+
+(defalias 'org-publish-project 'org-publish)
+
+(autoload 'org-publish "ox-publish" "\
+Publish PROJECT.
+
+PROJECT is either a project name, as a string, or a project
+alist (see `org-publish-project-alist' variable).
+
+When optional argument FORCE is non-nil, force publishing all
+files in PROJECT. With a non-nil optional argument ASYNC,
+publishing will be done asynchronously, in another process.
+
+\(fn PROJECT &optional FORCE ASYNC)" t nil)
+
+(autoload 'org-publish-all "ox-publish" "\
+Publish all projects.
+With prefix argument FORCE, remove all files in the timestamp
+directory and force publishing all projects. With a non-nil
+optional argument ASYNC, publishing will be done asynchronously,
+in another process.
+
+\(fn &optional FORCE ASYNC)" t nil)
+
+(autoload 'org-publish-current-file "ox-publish" "\
+Publish the current file.
+With prefix argument FORCE, force publish the file. When
+optional argument ASYNC is non-nil, publishing will be done
+asynchronously, in another process.
+
+\(fn &optional FORCE ASYNC)" t nil)
+
+(autoload 'org-publish-current-project "ox-publish" "\
+Publish the project associated with the current file.
+With a prefix argument, force publishing of all files in
+the project.
+
+\(fn &optional FORCE ASYNC)" t nil)
+
+;;;***
+
+;;;### (autoloads nil "ox-texinfo" "ox-texinfo.el" "e166211f62dbf7117777f8840ff4c2a6")
+;;; Generated autoloads from ox-texinfo.el
+
+(autoload 'org-texinfo-export-to-texinfo "ox-texinfo" "\
+Export current buffer to a Texinfo file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return output file's name.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-texinfo-export-to-info "ox-texinfo" "\
+Export current buffer to Texinfo then process through to INFO.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+When optional argument PUB-DIR is set, use it as the publishing
+directory.
+
+Return INFO file's name.
+
+\(fn &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" t nil)
+
+(autoload 'org-texinfo-publish-to-texinfo "ox-texinfo" "\
+Publish an org file to Texinfo.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name.
+
+\(fn PLIST FILENAME PUB-DIR)" nil nil)
+
+(autoload 'org-texinfo-convert-region-to-texinfo "ox-texinfo" "\
+Assume the current region has Org syntax, and convert it to Texinfo.
+This can be used in any buffer. For example, you can write an
+itemized list in Org syntax in an Texinfo buffer and use this
+command to convert it." t nil)
+
+;;;***
+
+;;;### (autoloads nil "ox" "ox.el" (0 0 0 0))
+;;; Generated autoloads from ox.el
+
+(autoload 'org-export-get-backend "ox" "\
+Return export back-end named after NAME.
+NAME is a symbol. Return nil if no such back-end is found.
+
+\(fn NAME)" nil nil)
+
+(autoload 'org-export-derived-backend-p "ox" "\
+Non-nil if BACKEND is derived from one of BACKENDS.
+BACKEND is an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end. BACKENDS is constituted of symbols.
+
+\(fn BACKEND &rest BACKENDS)" nil nil)
+
+(autoload 'org-export-get-environment "ox" "\
+Collect export options from the current buffer.
+
+Optional argument BACKEND is an export back-end, as returned by
+`org-export-create-backend'.
+
+When optional argument SUBTREEP is non-nil, assume the export is
+done against the current sub-tree.
+
+Third optional argument EXT-PLIST is a property list with
+external parameters overriding Org default settings, but still
+inferior to file-local settings.
+
+\(fn &optional BACKEND SUBTREEP EXT-PLIST)" nil nil)
+
+(autoload 'org-export-data "ox" "\
+Convert DATA into current back-end format.
+
+DATA is a parse tree, an element or an object or a secondary
+string. INFO is a plist holding export options.
+
+Return a string.
+
+\(fn DATA INFO)" nil nil)
+
+(autoload 'org-export-as "ox" "\
+Transcode current Org buffer into BACKEND code.
+
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end.
+
+If narrowing is active in the current buffer, only transcode its
+narrowed part.
+
+If a region is active, transcode that region.
+
+When optional argument SUBTREEP is non-nil, transcode the
+sub-tree at point, extracting information from the headline
+properties first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only return body
+code, without surrounding template.
+
+Optional argument EXT-PLIST, when provided, is a property list
+with external parameters overriding Org default settings, but
+still inferior to file-local settings.
+
+Return code as a string.
+
+\(fn BACKEND &optional SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST)" nil nil)
+
+(autoload 'org-export-string-as "ox" "\
+Transcode STRING into BACKEND code.
+
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end.
+
+When optional argument BODY-ONLY is non-nil, only return body
+code, without preamble nor postamble.
+
+Optional argument EXT-PLIST, when provided, is a property list
+with external parameters overriding Org default settings, but
+still inferior to file-local settings.
+
+Return code as a string.
+
+\(fn STRING BACKEND &optional BODY-ONLY EXT-PLIST)" nil nil)
+
+(autoload 'org-export-replace-region-by "ox" "\
+Replace the active region by its export to BACKEND.
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end.
+
+\(fn BACKEND)" nil nil)
+
+(autoload 'org-export-insert-default-template "ox" "\
+Insert all export keywords with default values at beginning of line.
+
+BACKEND is a symbol referring to the name of a registered export
+back-end, for which specific export options should be added to
+the template, or `default' for default template. When it is nil,
+the user will be prompted for a category.
+
+If SUBTREEP is non-nil, export configuration will be set up
+locally for the subtree through node properties.
+
+\(fn &optional BACKEND SUBTREEP)" t nil)
+
+(autoload 'org-export-raw-string "ox" "\
+Return a raw object containing string S.
+A raw string is exported as-is, with no additional processing
+from the export back-end.
+
+\(fn S)" nil nil)
+
+(autoload 'org-export-to-buffer "ox" "\
+Call `org-export-as' with output to a specified buffer.
+
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end.
+
+BUFFER is the name of the output buffer. If it already exists,
+it will be erased first, otherwise, it will be created.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should then be accessible
+through the `org-export-stack' interface. When ASYNC is nil, the
+buffer is displayed if `org-export-show-temporary-export-buffer'
+is non-nil.
+
+Optional arguments SUBTREEP, VISIBLE-ONLY, BODY-ONLY and
+EXT-PLIST are similar to those used in `org-export-as', which
+see.
+
+Optional argument POST-PROCESS is a function which should accept
+no argument. It is always called within the current process,
+from BUFFER, with point at its beginning. Export back-ends can
+use it to set a major mode there, e.g,
+
+ (defun org-latex-export-as-latex
+ (&optional async subtreep visible-only body-only ext-plist)
+ (interactive)
+ (org-export-to-buffer \\='latex \"*Org LATEX Export*\"
+ async subtreep visible-only body-only ext-plist
+ #'LaTeX-mode))
+
+When expressed as an anonymous function, using `lambda',
+POST-PROCESS needs to be quoted.
+
+This function returns BUFFER.
+
+\(fn BACKEND BUFFER &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST POST-PROCESS)" nil nil)
+
+(function-put 'org-export-to-buffer 'lisp-indent-function '2)
+
+(autoload 'org-export-to-file "ox" "\
+Call `org-export-as' with output to a specified file.
+
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end. FILE is the name of the output file, as
+a string.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer will then be accessible
+through the `org-export-stack' interface.
+
+Optional arguments SUBTREEP, VISIBLE-ONLY, BODY-ONLY and
+EXT-PLIST are similar to those used in `org-export-as', which
+see.
+
+Optional argument POST-PROCESS is called with FILE as its
+argument and happens asynchronously when ASYNC is non-nil. It
+has to return a file name, or nil. Export back-ends can use this
+to send the output file through additional processing, e.g,
+
+ (defun org-latex-export-to-latex
+ (&optional async subtreep visible-only body-only ext-plist)
+ (interactive)
+ (let ((outfile (org-export-output-file-name \".tex\" subtreep)))
+ (org-export-to-file \\='latex outfile
+ async subtreep visible-only body-only ext-plist
+ #'org-latex-compile)))
+
+When expressed as an anonymous function, using `lambda',
+POST-PROCESS needs to be quoted.
+
+The function returns either a file name returned by POST-PROCESS,
+or FILE.
+
+\(fn BACKEND FILE &optional ASYNC SUBTREEP VISIBLE-ONLY BODY-ONLY EXT-PLIST POST-PROCESS)" nil nil)
+
+(function-put 'org-export-to-file 'lisp-indent-function '2)
+
+(autoload 'org-export-dispatch "ox" "\
+Export dispatcher for Org mode.
+
+It provides an access to common export related tasks in a buffer.
+Its interface comes in two flavors: standard and expert.
+
+While both share the same set of bindings, only the former
+displays the valid keys associations in a dedicated buffer.
+Scrolling (resp. line-wise motion) in this buffer is done with
+SPC and DEL (resp. C-n and C-p) keys.
+
+Set variable `org-export-dispatch-use-expert-ui' to switch to one
+flavor or the other.
+
+When ARG is `\\[universal-argument]', repeat the last export action, with the same
+set of options used back then, on the current buffer.
+
+When ARG is `\\[universal-argument] \\[universal-argument]', display the asynchronous export stack.
+
+\(fn &optional ARG)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ox" '("org-export-")))
+
+;;;***
+
+(provide 'org-loaddefs)
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; org-loaddefs.el ends here
diff --git a/elpa/org-9.5.2/org-macro.el b/elpa/org-9.5.2/org-macro.el
new file mode 100644
index 0000000..c0287a2
--- /dev/null
+++ b/elpa/org-9.5.2/org-macro.el
@@ -0,0 +1,421 @@
+;;; org-macro.el --- Macro Replacement Code for Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <n.goaziou@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Macros are expanded with `org-macro-replace-all', which relies
+;; internally on `org-macro-expand'.
+
+;; Default templates for expansion are stored in the buffer-local
+;; variable `org-macro-templates'. This variable is updated by
+;; `org-macro-initialize-templates', which recursively calls
+;; `org-macro--collect-macros' in order to read setup files.
+
+;; Argument in macros are separated with commas. Proper escaping rules
+;; are implemented in `org-macro-escape-arguments' and arguments can
+;; be extracted from a string with `org-macro-extract-arguments'.
+
+;; Along with macros defined through #+MACRO: keyword, default
+;; templates include the following hard-coded macros:
+;; {{{time(format-string)}}},
+;; {{{property(node-property)}}},
+;; {{{input-file}}},
+;; {{{modification-time(format-string)}}},
+;; {{{n(counter,action}}}.
+
+;; Upon exporting, "ox.el" will also provide {{{author}}}, {{{date}}},
+;; {{{email}}} and {{{title}}} macros.
+
+;;; Code:
+(require 'cl-lib)
+(require 'org-macs)
+(require 'org-compat)
+
+(declare-function org-collect-keywords "org" (keywords &optional unique directory))
+(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-in-commented-heading-p "org" (&optional no-inheritance))
+(declare-function org-link-search "ol" (s &optional avoid-pos stealth))
+(declare-function org-mode "org" ())
+(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
+ "Alist containing all macro templates in current buffer.
+Associations are in the shape of (NAME . TEMPLATE) where NAME
+stands for macro's name and template for its replacement value,
+both as strings. This is an internal variable. Do not set it
+directly, use instead:
+
+ #+MACRO: name template")
+
+;;; Functions
+
+(defun org-macro--makeargs (template)
+ "Compute the formal arglist to use for TEMPLATE."
+ (let ((max 0) (i 0))
+ (while (string-match "\\$\\([0-9]+\\)" template i)
+ (setq i (match-end 0))
+ (setq max (max max (string-to-number (match-string 1 template)))))
+ (let ((args '(&rest _)))
+ (if (< max 1) args ;Avoid `&optional &rest', refused by Emacs-26!
+ (while (> max 0)
+ (push (intern (format "$%d" max)) args)
+ (setq max (1- max)))
+ (cons '&optional args)))))
+
+(defun org-macro--set-templates (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. Return the updated list."
+ (let ((new-templates nil))
+ (pcase-dolist (`(,name . ,value) templates)
+ (let ((old-definition (assoc name new-templates)))
+ (when (and (stringp value) (string-match-p "\\`(eval\\>" value))
+ ;; Pre-process the evaluation form for faster macro expansion.
+ (let* ((args (org-macro--makeargs value))
+ (body
+ (condition-case nil
+ ;; `value' is of the form "(eval ...)" but we
+ ;; don't want this to mean to pass the result to
+ ;; `eval' (which would cause double evaluation),
+ ;; so we strip the `eval' away with `cadr'.
+ (cadr (read value))
+ (error
+ (user-error "Invalid definition for macro %S" name)))))
+ (setq value (eval (macroexpand-all `(lambda ,args ,body)) t))))
+ (cond ((and value old-definition) (setcdr old-definition value))
+ (old-definition)
+ (t (push (cons name (or value "")) new-templates)))))
+ new-templates))
+
+(defun org-macro--collect-macros ()
+ "Collect macro definitions in current buffer and setup files.
+Return an alist containing all macro templates found."
+ (let ((templates
+ `(("author" . ,(org-macro--find-keyword-value "AUTHOR" t))
+ ("email" . ,(org-macro--find-keyword-value "EMAIL"))
+ ("title" . ,(org-macro--find-keyword-value "TITLE" t))
+ ("date" . ,(org-macro--find-date)))))
+ (pcase (org-collect-keywords '("MACRO"))
+ (`(("MACRO" . ,values))
+ (dolist (value values)
+ (when (string-match "^\\(\\S-+\\)[ \t]*" value)
+ (let ((name (match-string 1 value))
+ (definition (substring value (match-end 0))))
+ (push (cons name definition) templates))))))
+ templates))
+
+(defun org-macro-initialize-templates (&optional default)
+ "Collect macro templates defined in current buffer.
+
+DEFAULT is a list of globally available templates.
+
+Templates are stored in buffer-local variable `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\"."
+ (require 'org-element)
+ (org-macro--counter-initialize) ;for "n" macro
+ (setq org-macro-templates
+ (nconc
+ ;; Install user-defined macros. Local macros have higher
+ ;; precedence than global ones.
+ (org-macro--set-templates (append default (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" .
+ ,(let ((modtime (file-attribute-modification-time
+ (file-attributes visited-file))))
+ (lambda (arg1 &optional arg2 &rest _)
+ (format-time-string
+ arg1
+ (or (and (org-string-nw-p arg2)
+ (org-macro--vc-modified-time visited-file))
+ modtime))))))))
+ ;; Install generic macros.
+ '(("keyword" . (lambda (arg1 &rest _)
+ (org-macro--find-keyword-value arg1 t)))
+ ("n" . (lambda (&optional arg1 arg2 &rest _)
+ (org-macro--counter-increment arg1 arg2)))
+ ("property" . (lambda (arg1 &optional arg2 &rest _)
+ (org-macro--get-property arg1 arg2)))
+ ("time" . (lambda (arg1 &rest _)
+ (format-time-string arg1)))))))
+
+(defun org-macro-expand (macro templates)
+ "Return expanded MACRO, as a string.
+MACRO is an object, obtained, for example, with
+`org-element-context'. TEMPLATES is an alist of templates used
+for expansion. See `org-macro-templates' for a buffer-local
+default value. Return nil if no template was found."
+ (let ((template
+ ;; Macro names are case-insensitive.
+ (cdr (assoc-string (org-element-property :key macro) templates t))))
+ (when template
+ (let* ((value
+ (if (functionp template)
+ (apply template (org-element-property :args macro))
+ (replace-regexp-in-string
+ "\\$[0-9]+"
+ (lambda (m)
+ (or (nth (1- (string-to-number (substring m 1)))
+ (org-element-property :args macro))
+ ;; No argument: remove place-holder.
+ ""))
+ template nil 'literal))))
+ ;; Force return value to be a string.
+ (format "%s" (or value ""))))))
+
+(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.
+
+Optional argument KEYWORDS, when non-nil is a list of keywords,
+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\\+?\\'"
+ (regexp-opt keywords)))
+ record)
+ (while (re-search-forward "{{{[-A-Za-z0-9_]" nil t)
+ (unless (save-match-data (org-in-commented-heading-p))
+ (let* ((datum (save-match-data (org-element-context)))
+ (type (org-element-type datum))
+ (macro
+ (cond
+ ((eq type 'macro) datum)
+ ;; In parsed keywords and associated node
+ ;; properties, force macro recognition.
+ ((or (and (eq type 'keyword)
+ (member (org-element-property :key datum) keywords))
+ (and (eq type 'node-property)
+ (string-match-p properties-regexp
+ (org-element-property :key datum))))
+ (save-excursion
+ (goto-char (match-beginning 0))
+ (org-element-macro-parser))))))
+ (when macro
+ (let* ((key (org-element-property :key macro))
+ (value (org-macro-expand macro templates))
+ (begin (org-element-property :begin macro))
+ (signature (list begin
+ macro
+ (org-element-property :args macro))))
+ ;; Avoid circular dependencies by checking if the same
+ ;; macro with the same arguments is expanded at the
+ ;; same position twice.
+ (cond ((member signature record)
+ (error "Circular macro expansion: %s" key))
+ (value
+ (push signature record)
+ (delete-region
+ begin
+ ;; Preserve white spaces after the macro.
+ (progn (goto-char (org-element-property :end macro))
+ (skip-chars-backward " \t")
+ (point)))
+ ;; Leave point before replacement in case of
+ ;; recursive expansions.
+ (save-excursion (insert value)))
+ ;; 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))))))))))))
+
+(defun org-macro-escape-arguments (&rest args)
+ "Build macro's arguments string from ARGS.
+ARGS are strings. Return value is a string with arguments
+properly escaped and separated with commas. This is the opposite
+of `org-macro-extract-arguments'."
+ (let ((s ""))
+ (dolist (arg (reverse args) (substring s 1))
+ (setq s
+ (concat
+ ","
+ (replace-regexp-in-string
+ "\\(\\\\*\\),"
+ (lambda (m)
+ (concat (make-string (1+ (* 2 (length (match-string 1 m)))) ?\\)
+ ","))
+ ;; If a non-terminal argument ends on backslashes, make
+ ;; sure to also escape them as they will be followed by
+ ;; a comma.
+ (concat arg (and (not (equal s ""))
+ (string-match "\\\\+\\'" arg)
+ (match-string 0 arg)))
+ nil t)
+ s)))))
+
+(defun org-macro-extract-arguments (s)
+ "Extract macro arguments from string S.
+S is a string containing comma separated values properly escaped.
+Return a list of arguments, as strings. This is the opposite of
+`org-macro-escape-arguments'."
+ ;; Do not use `org-split-string' since empty strings are
+ ;; meaningful here.
+ (split-string
+ (replace-regexp-in-string
+ "\\(\\\\*\\),"
+ (lambda (str)
+ (let ((len (length (match-string 1 str))))
+ (concat (make-string (/ len 2) ?\\)
+ (if (zerop (mod len 2)) "\000" ","))))
+ s nil t)
+ "\000"))
+
+
+;;; 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)
+ (let ((buf (get-buffer-create " *org-vc*"))
+ (case-fold-search t)
+ date)
+ (unwind-protect
+ (progn
+ (vc-call print-log (list file) buf nil nil 1)
+ (with-current-buffer buf
+ (vc-exec-after
+ (lambda ()
+ (goto-char (point-min))
+ (when (re-search-forward "Date:?[ \t]*" nil t)
+ (let ((time (parse-time-string
+ (buffer-substring
+ (point) (line-end-position)))))
+ (when (cl-some #'identity time)
+ (setq date (apply #'encode-time time))))))))
+ (let ((proc (get-buffer-process buf)))
+ (while (and proc (accept-process-output proc .5 nil t)))))
+ (kill-buffer buf))
+ date))))
+
+(defvar org-macro--counter-table nil
+ "Hash table containing counter value per name.")
+
+(defun org-macro--counter-initialize ()
+ "Initialize `org-macro--counter-table'."
+ (setq org-macro--counter-table (make-hash-table :test #'equal)))
+
+(defun org-macro--counter-increment (name &optional action)
+ "Increment counter NAME.
+NAME is a string identifying the counter.
+
+When non-nil, optional argument ACTION is a string.
+
+If the string is \"-\", keep the NAME counter at its current
+value, i.e. do not increment.
+
+If the string represents an integer, set the counter to this number.
+
+Any other non-empty string resets the counter to 1."
+ (let ((name-trimmed (if (stringp name) (org-trim name) ""))
+ (action-trimmed (when (org-string-nw-p action)
+ (org-trim action))))
+ (puthash name-trimmed
+ (cond ((not (org-string-nw-p action-trimmed))
+ (1+ (gethash name-trimmed org-macro--counter-table 0)))
+ ((string= "-" action-trimmed)
+ (gethash name-trimmed org-macro--counter-table 1))
+ ((string-match-p "\\`[0-9]+\\'" action-trimmed)
+ (string-to-number action-trimmed))
+ (t 1))
+ org-macro--counter-table)))
+
+(provide 'org-macro)
+
+;;; org-macro.el ends here
diff --git a/elpa/org-9.5.2/org-macro.elc b/elpa/org-9.5.2/org-macro.elc
new file mode 100644
index 0000000..c4fc9b6
--- /dev/null
+++ b/elpa/org-9.5.2/org-macro.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-macs.el b/elpa/org-9.5.2/org-macs.el
new file mode 100644
index 0000000..0779c3a
--- /dev/null
+++ b/elpa/org-9.5.2/org-macs.el
@@ -0,0 +1,1308 @@
+;;; org-macs.el --- Top-level Definitions for Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; 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-mode "org" ())
+(declare-function org-show-context "org" (&optional key))
+(declare-function org-string-collate-lessp "org-compat" (s1 s2 &optional locale ignore-case))
+
+(defvar org-ts-regexp0)
+(defvar ffap-url-regexp)
+
+
+;;; 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 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) (obsolete cl-progv "2021"))
+ `(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 pop-up-windows)
+ ,@body))
+
+
+;;; 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 skip-fl)
+ "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. When
+optional argument SKIP-FL is non-nil, skip the first
+line. 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
+ (when skip-fl (forward-line))
+ (while (re-search-forward "^[ \t]*\\S-" nil t)
+ (let ((ind (current-indentation)))
+ (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.
+ (when skip-fl (forward-line))
+ (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")))))
+
+(declare-function org-time-stamp-inactive "org" (&optional arg))
+
+(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 navigation-keys)
+ "Read a key and ensure it is a member of ALLOWED-KEYS.
+Enable keys to scroll the window if NAVIGATION-KEYS is set.
+TAB, SPC and RET are treated equivalently."
+ (setq header-line-format (when navigation-keys "Use C-n, C-p, C-v, M-v to navigate."))
+ (let ((char-key (read-char-exclusive prompt)))
+ (if (and navigation-keys (memq char-key '(14 16 22 134217846)))
+ (progn
+ (org-scroll char-key)
+ (org--mks-read-key allowed-keys prompt navigation-keys))
+ (let ((key (char-to-string
+ (pcase char-key
+ ((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 navigation-keys))))))
+
+(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: "))
+ case-fold-search
+ 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))
+ (org-fit-window-to-buffer)
+ (message "") ; With this line the prompt appears in
+ ; the minibuffer. Else keystrokes may
+ ; appear, which is spurious.
+ (let ((pressed (org--mks-read-key
+ allowed-keys prompt
+ (not (pos-visible-in-window-p (1- (point-max)))))))
+ (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-all (plist props)
+ "Delete all elements in PROPS from PLIST."
+ (dolist (e props plist)
+ (setq plist (org-plist-delete plist e))))
+
+(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)))
+
+(defmacro org-dlet (binders &rest body)
+ "Like `let*' but using dynamic scoping."
+ (declare (indent 1) (debug let))
+ (let ((vars (mapcar (lambda (binder)
+ (if (consp binder) (car binder) binder))
+ binders)))
+ `(progn
+ (with-no-warnings
+ ,@(mapcar (lambda (var) `(defvar ,var)) vars))
+ (let* ,binders ,@body))))
+
+(defmacro org-pushnew-to-end (val var)
+ "Like `cl-pushnew' but pushes to the end of the list.
+Uses `equal' for comparisons.
+
+Beware: this performs O(N) memory allocations, so if you use it in a loop, you
+get an unnecessary O(N²) space complexity, so you're usually better off using
+`cl-pushnew' (with a final `reverse' if you care about the order of elements)."
+ (declare (debug (form gv-place)))
+ (let ((v (make-symbol "v")))
+ `(let ((,v ,val))
+ (unless (member ,v ,var)
+ (setf ,var (append ,var (list ,v)))))))
+
+(defun org-eval (form)
+ "Eval FORM and return result."
+ (condition-case error
+ (eval form t)
+ (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)))))
+
+(defun org--line-empty-p (n)
+ "Is the Nth next line empty?
+Counts the current line as N = 1 and the previous line as N = 0;
+see `beginning-of-line'."
+ (and (not (bobp))
+ (save-excursion
+ (beginning-of-line n)
+ (looking-at-p "[ \t]*$"))))
+
+(defun org-previous-line-empty-p ()
+ "Is the previous line a blank line?
+When NEXT is non-nil, check the next line instead."
+ (org--line-empty-p 0))
+
+(defun org-next-line-empty-p ()
+ "Is the previous line a blank line?
+When NEXT is non-nil, check the next line instead."
+ (org--line-empty-p 2))
+
+
+
+;;; 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
+ (lambda (&rest _) (org-show-context 'isearch))))))
+
+
+
+;;; 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)))
+
+(defun org-url-p (s)
+ "Non-nil if string S is a URL."
+ (require 'ffap)
+ (and ffap-url-regexp (string-match-p ffap-url-regexp s)))
+
+
+;;; 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 . ,_)
+ (and (fboundp 'image-size)
+ (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," (number-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)))
+
+(defun org-fill-template (template alist)
+ "Find each %key of ALIST in TEMPLATE and replace it."
+ (let ((case-fold-search nil))
+ (dolist (entry (sort (copy-sequence alist)
+ (lambda (a b) (< (length (car a)) (length (car b))))))
+ (setq template
+ (replace-regexp-in-string
+ (concat "%" (regexp-quote (car entry)))
+ (or (cdr entry) "") template t t)))
+ template))
+
+(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.
+The sequences in STRING may contain normal field width and padding information,
+for example \"%-5s\". Replacements happen in the sequence given by TABLE,
+so values can contain further %-escapes if they are define later in TABLE."
+ (let ((tbl (copy-alist table))
+ (case-fold-search nil)
+ (pchg 0)
+ re rpl)
+ (dolist (e tbl)
+ (setq re (concat "%-?[0-9.]*" (substring (car e) 1)))
+ (when (and (cdr e) (string-match re (cdr e)))
+ (let ((sref (substring (cdr e) (match-beginning 0) (match-end 0)))
+ (safe "SREF"))
+ (add-text-properties 0 3 (list 'sref sref) safe)
+ (setcdr e (replace-match safe t t (cdr e)))))
+ (while (string-match re string)
+ (setq rpl (format (concat (substring (match-string 0 string) 0 -1) "s")
+ (cdr e)))
+ (setq string (replace-match rpl t t string))))
+ (while (setq pchg (next-property-change pchg string))
+ (let ((sref (get-text-property pchg 'sref string)))
+ (when (and sref (string-match "SREF" string pchg))
+ (setq string (replace-match sref t t string)))))
+ string))
+
+
+;;; 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)
+ ;; FIXME: "flat" is called a "plist"!
+ "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 cadr."
+ (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 folding-only)
+ "Non-nil if the character after POS is invisible.
+If POS is nil, use `point' instead. When optional argument
+FOLDING-ONLY is non-nil, only consider invisible parts due to
+folding of a headline, a block or a drawer, i.e., not because of
+fontification."
+ (let ((value (get-char-property (or pos (point)) 'invisible)))
+ (cond ((not value) nil)
+ (folding-only (memq value '(org-hide-block outline)))
+ (t value))))
+
+(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-find-visible ()
+ "Return closest visible buffer position, or `point-max'."
+ (if (org-invisible-p)
+ (next-single-char-property-change (point) 'invisible)
+ (point)))
+
+(defun org-find-invisible ()
+ "Return closest invisible buffer position, or `point-max'."
+ (if (org-invisible-p)
+ (point)
+ (next-single-char-property-change (point) 'invisible)))
+
+
+;;; 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 (apply #'encode-time (org-parse-time-string 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: \"<now>\", \"<today>\",
+\"<tomorrow>\", and \"<yesterday>\".
+
+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 "<now>") (float-time))
+ ((string= s "<today>") today)
+ ((string= s "<tomorrow>") (+ 86400.0 today))
+ ((string= s "<yesterday>") (- today 86400.0))
+ ((string-match "\\`<\\([-+][0-9]+\\)\\([hdwmy]\\)>\\'" s)
+ (+ (if (string= (match-string 2 s) "h") (float-time) today)
+ (* (string-to-number (match-string 1 s))
+ (cdr (assoc (match-string 2 s)
+ '(("h" . 3600.0)
+ ("d" . 86400.0) ("w" . 604800.0)
+ ("m" . 2678400.0) ("y" . 31557600.0)))))))
+ ((string-match org-ts-regexp0 s) (org-2ft s))
+ (t 0.)))))
+
+(defun org-scroll (key &optional additional-keys)
+ "Receive KEY and scroll the current window accordingly.
+When ADDITIONAL-KEYS is not nil, also include SPC and DEL in the
+allowed keys for scrolling, as expected in the export dispatch
+window."
+ (let ((scrlup (if additional-keys '(?\s ?\C-v) ?\C-v))
+ (scrldn (if additional-keys `(?\d ?\M-v) ?\M-v)))
+ (pcase key
+ (?\C-n (if (not (pos-visible-in-window-p (point-max)))
+ (ignore-errors (scroll-up 1))
+ (message "End of buffer")
+ (sit-for 1)))
+ (?\C-p (if (not (pos-visible-in-window-p (point-min)))
+ (ignore-errors (scroll-down 1))
+ (message "Beginning of buffer")
+ (sit-for 1)))
+ ;; SPC or
+ ((guard (memq key scrlup))
+ (if (not (pos-visible-in-window-p (point-max)))
+ (scroll-up nil)
+ (message "End of buffer")
+ (sit-for 1)))
+ ;; DEL
+ ((guard (memq key scrldn))
+ (if (not (pos-visible-in-window-p (point-min)))
+ (scroll-down nil)
+ (message "Beginning of buffer")
+ (sit-for 1))))))
+
+(provide 'org-macs)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-macs.el ends here
diff --git a/elpa/org-9.5.2/org-macs.elc b/elpa/org-9.5.2/org-macs.elc
new file mode 100644
index 0000000..513660c
--- /dev/null
+++ b/elpa/org-9.5.2/org-macs.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-mobile.el b/elpa/org-9.5.2/org-mobile.el
new file mode 100644
index 0000000..e51258a
--- /dev/null
+++ b/elpa/org-9.5.2/org-mobile.el
@@ -0,0 +1,1141 @@
+;;; org-mobile.el --- Code for Asymmetric Sync With a Mobile Device -*- lexical-binding: t; -*-
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
+;;
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+;;
+;; 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 'cl-lib)
+(require 'org)
+(require 'org-agenda)
+(require 'ol)
+
+;;; Code:
+
+(defgroup org-mobile nil
+ "Options concerning support for a viewer/editor on a mobile device."
+ :tag "Org Mobile"
+ :group 'org)
+
+(defcustom org-mobile-files '(org-agenda-files)
+ "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\".
+In addition to this, the list may also contain the following symbols:
+
+`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'
+ Include the files given in the variable
+ `org-agenda-text-search-extra-files'."
+ :group 'org-mobile
+ :type '(list :greedy t
+ (option (const :tag "org-agenda-files" org-agenda-files))
+ (option (const :tag "org-agenda-text-search-extra-files"
+ org-agenda-text-search-extra-files))
+ (repeat :inline t :tag "Additional files"
+ (file))))
+
+(defcustom org-mobile-files-exclude-regexp ""
+ "A regexp to exclude files from `org-mobile-files'."
+ :group 'org-mobile
+ :version "24.1"
+ :type 'regexp)
+
+(defcustom org-mobile-directory ""
+ "The WebDAV directory where the interaction with the mobile takes place."
+ :group 'org-mobile
+ :type 'directory)
+
+(defcustom org-mobile-allpriorities "A B C"
+ "Default set of priority cookies for the index file."
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string
+ :group 'org-mobile)
+
+(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
+mobile application. Before turning this on, check if the mobile
+application does support it."
+ :group 'org-mobile
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-mobile-encryption-tempfile "~/orgtmpcrypt"
+ "File that is being used as a temporary file for encryption.
+This must be local file on your local machine (not on the WebDAV server).
+You might want to put this file into a directory where only you have access."
+ :group 'org-mobile
+ :version "24.1"
+ :type 'directory)
+
+(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 mobile application. All Org files,
+including \"mobileorg.org\" will be encrypted using this password.
+
+SECURITY CONSIDERATIONS:
+
+Note that, when Org runs the encryption commands, the password could
+be visible briefly on your system with the `ps' command. So this method is
+only intended to keep the files secure on the server, not on your own machine.
+
+Also, if you set this variable in an init file (.emacs or .emacs.d/init.el
+or custom.el...) and if that file is stored in a way so that other can read
+it, this also limits the security of this approach. You can also leave
+this variable empty - Org will then ask for the password once per Emacs
+session."
+ :group 'org-mobile
+ :version "24.1"
+ :type '(string :tag "Password"))
+
+(defvar org-mobile-encryption-password-session nil)
+
+(defun org-mobile-encryption-password ()
+ (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 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' 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
+ :type 'file)
+
+(defconst org-mobile-capture-file "mobileorg.org"
+ "The capture file where the mobile stores captured notes and flags.
+This must not be changed, because the mobile application assumes this name.")
+
+(defcustom org-mobile-index-file "index.org"
+ "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 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."
+ :group 'org-mobile
+ :version "24.1"
+ :type '(choice
+ (const :tag "Default Agendas" default)
+ (const :tag "Custom Agendas" custom)
+ (const :tag "Default and Custom Agendas" all)
+ (repeat :tag "Selected"
+ (string :tag "Selection Keys"))))
+
+(defcustom org-mobile-force-id-on-agenda-items t
+ "Non-nil means make all agenda items carry an ID."
+ :group 'org-mobile
+ :type 'boolean)
+
+(defcustom org-mobile-force-mobile-change nil
+ "Non-nil means force the change made on the mobile device.
+So even if there have been changes to the computer version of the entry,
+force the new value set on the mobile.
+When nil, mark the entry from the mobile with an error message.
+Instead of nil or t, this variable can also be a list of symbols, indicating
+the editing types for which the mobile version should always dominate."
+ :group 'org-mobile
+ :type '(choice
+ (const :tag "Always" t)
+ (const :tag "Never" nil)
+ (set :greedy t :tag "Specify"
+ (const todo)
+ (const tags)
+ (const priority)
+ (const heading)
+ (const body))))
+
+(defcustom org-mobile-checksum-binary (or (executable-find "shasum")
+ (executable-find "sha1sum")
+ (executable-find "md5sum")
+ (executable-find "md5"))
+ "Executable used for computing checksums of agenda files."
+ :group 'org-mobile
+ :type 'string)
+
+(defvar org-mobile-pre-push-hook nil
+ "Hook run before running `org-mobile-push'.
+This could be used to clean up `org-mobile-directory', for example to
+remove files that used to be included in the agenda but no longer are.
+The presence of such files would not really be a problem, but after time
+they may accumulate.")
+
+(defvar org-mobile-post-push-hook nil
+ "Hook run after running `org-mobile-push'.
+If Emacs does not have direct write access to the WebDAV directory used
+by the mobile device, this hook should be used to copy all files from the
+local staging directory `org-mobile-directory' to the WebDAV directory,
+for example using `rsync' or `scp'.")
+
+(defvar org-mobile-pre-pull-hook nil
+ "Hook run before executing `org-mobile-pull'.
+If Emacs does not have direct write access to the WebDAV directory used
+by the mobile device, this hook should be used to copy the capture file
+`mobileorg.org' from the WebDAV location to the local staging
+directory `org-mobile-directory'.")
+
+(defvar org-mobile-post-pull-hook nil
+ "Hook run after running `org-mobile-pull', only if new items were found.
+If Emacs does not have direct write access to the WebDAV directory used
+by the mobile device, this hook should be used to copy the emptied
+capture file `mobileorg.org' back to the WebDAV directory, for example
+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, the mobile application creates entries
+that look like
+
+ * F(action:data) [[id:entry-id][entry title]]
+
+This alist defines that the ACTION in the parentheses of F()
+should mean, i.e. what action should be taken. The :data part in
+the parenthesis is optional. If present, the string after the
+colon will be passed to the action function as the first argument
+variable.
+
+The car of each elements of the alist is an actions string. The
+cdr is a function that is called with the cursor on the headline
+of that entry. It should accept three arguments, the :data part,
+the old and new values for the entry.")
+
+(defvar org-mobile-last-flagged-files nil
+ "List of files containing entries flagged in the latest pull.")
+
+(defvar org-mobile-files-alist nil)
+(defvar org-mobile-checksum-files nil)
+
+;; Add org mobile commands to the main org menu
+(easy-menu-add-item
+ org-org-menu
+ nil
+ '("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 "\\[org-agenda] ?"]
+ "--"
+ ["Setup" (customize-group 'org-mobile) t]))
+
+(defun org-mobile-prepare-file-lists ()
+ (setq org-mobile-files-alist (org-mobile-files-alist))
+ (setq org-mobile-checksum-files nil))
+
+(defun org-mobile-files-alist ()
+ "Expand the list in `org-mobile-files' to a list of existing files.
+Also exclude files matching `org-mobile-files-exclude-regexp'."
+ (let* ((include-archives
+ (and (member 'org-agenda-text-search-extra-files org-mobile-files)
+ (member 'agenda-archives org-agenda-text-search-extra-files)
+ t))
+ (files
+ (apply 'append
+ (mapcar
+ (lambda (f)
+ (cond
+ ((eq f 'org-agenda-files)
+ (org-agenda-files t include-archives))
+ ((eq f 'org-agenda-text-search-extra-files)
+ (delq 'agenda-archives
+ (copy-sequence
+ org-agenda-text-search-extra-files)))
+ ((and (stringp f) (file-directory-p f))
+ (directory-files f 'full "\\.org\\'"))
+ ((and (stringp f) (file-exists-p f))
+ (list f))
+ (t nil)))
+ org-mobile-files)))
+ (files (delq
+ nil
+ (mapcar (lambda (f)
+ (unless (and (not (string= org-mobile-files-exclude-regexp ""))
+ (string-match org-mobile-files-exclude-regexp f))
+ (identity f)))
+ files)))
+ (orgdir-uname (file-name-as-directory (file-truename org-directory)))
+ (orgdir-re (concat "\\`" (regexp-quote orgdir-uname)))
+ uname seen rtn file link-name)
+ ;; Make the files unique, and determine the name under which they will
+ ;; be listed.
+ (while (setq file (pop files))
+ (if (not (file-name-absolute-p file))
+ (setq file (expand-file-name file org-directory)))
+ (setq uname (file-truename file))
+ (unless (member uname seen)
+ (push uname seen)
+ (if (string-match orgdir-re uname)
+ (setq link-name (substring uname (match-end 0)))
+ (setq link-name (file-name-nondirectory uname)))
+ (push (cons file link-name) rtn)))
+ (nreverse rtn)))
+
+;;;###autoload
+(defun org-mobile-push ()
+ "Push the current state of Org affairs to the target directory.
+This will create the index file, copy all agenda files there, and also
+create all custom agenda views, for upload to the mobile phone."
+ (interactive)
+ (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
+ (run-hooks 'org-mobile-pre-push-hook)
+ (org-mobile-check-setup)
+ (org-mobile-prepare-file-lists)
+ (message "Creating agendas...")
+ (let ((inhibit-redisplay t)
+ (org-agenda-files (mapcar 'car org-mobile-files-alist)))
+ (org-mobile-create-sumo-agenda))
+ (message "Creating agendas...done")
+ (org-save-all-org-buffers) ; to save any IDs created by this process
+ (message "Copying files...")
+ (org-mobile-copy-agenda-files)
+ (message "Writing index file...")
+ (org-mobile-create-index-file)
+ (message "Writing checksums...")
+ (org-mobile-write-checksums)
+ (run-hooks 'org-mobile-post-push-hook)))))
+ (org-agenda-maybe-redo)
+ (message "Files for mobile viewer staged"))
+
+(defvar org-mobile-before-process-capture-hook nil
+ "Hook that is run after content was moved to `org-mobile-inbox-for-pull'.
+The inbox file is visited by the current buffer, and the buffer is
+narrowed to the newly captured data.")
+
+;;;###autoload
+(defun org-mobile-pull ()
+ "Pull the contents of `org-mobile-capture-file' and integrate them.
+Apply all flagged actions, flag entries to be flagged and then call an
+agenda view showing the flagged items."
+ (interactive)
+ (org-mobile-check-setup)
+ (run-hooks 'org-mobile-pre-pull-hook)
+ (let ((insertion-marker (org-mobile-move-capture)))
+ (if (not (markerp insertion-marker))
+ (message "No new items")
+ (org-with-point-at insertion-marker
+ (save-restriction
+ (narrow-to-region (point) (point-max))
+ (run-hooks 'org-mobile-before-process-capture-hook)))
+ (org-with-point-at insertion-marker
+ (org-mobile-apply (point) (point-max)))
+ (move-marker insertion-marker nil)
+ (run-hooks 'org-mobile-post-pull-hook)
+ (when org-mobile-last-flagged-files
+ ;; Make an agenda view of flagged entries, but only in the files
+ ;; where stuff has been added.
+ (put 'org-agenda-files 'org-restrict org-mobile-last-flagged-files)
+ (let ((org-agenda-keep-restricted-file-list t))
+ (org-agenda nil "?"))))))
+
+(defun org-mobile-check-setup ()
+ "Check if org-mobile-directory has been set up."
+ (org-mobile-cleanup-encryption-tempfile)
+ (unless (and org-directory
+ (stringp org-directory)
+ (string-match "\\S-" org-directory)
+ (file-exists-p org-directory)
+ (file-directory-p org-directory))
+ (error
+ "Please set `org-directory' to the directory where your org files live"))
+ (unless (and org-mobile-directory
+ (stringp org-mobile-directory)
+ (string-match "\\S-" org-mobile-directory)
+ (file-exists-p org-mobile-directory)
+ (file-directory-p org-mobile-directory))
+ (error
+ "Variable `org-mobile-directory' must point to an existing directory"))
+ (unless (and org-mobile-inbox-for-pull
+ (stringp org-mobile-inbox-for-pull)
+ (string-match "\\S-" org-mobile-inbox-for-pull)
+ (file-exists-p
+ (file-name-directory org-mobile-inbox-for-pull)))
+ (error
+ "Variable `org-mobile-inbox-for-pull' must point to a file in an existing directory"))
+ (unless (and org-mobile-checksum-binary
+ (string-match "\\S-" org-mobile-checksum-binary))
+ (error "No executable found to compute checksums"))
+ (when org-mobile-use-encryption
+ (unless (string-match "\\S-" (org-mobile-encryption-password))
+ (error
+ "To use encryption, you must set `org-mobile-encryption-password'"))
+ (unless (file-writable-p org-mobile-encryption-tempfile)
+ (error "Cannot write to encryption tempfile %s"
+ org-mobile-encryption-tempfile))
+ (unless (executable-find "openssl")
+ (error "OpenSSL is needed to encrypt files"))))
+
+(defun org-mobile-create-index-file ()
+ "Write the index file in the WebDAV directory."
+ (let ((files-alist (sort (copy-sequence org-mobile-files-alist)
+ (lambda (a b) (string< (cdr a) (cdr b)))))
+ (def-todo (default-value 'org-todo-keywords))
+ (def-tags org-tag-alist)
+ (target-file (expand-file-name org-mobile-index-file
+ org-mobile-directory))
+ todo-kwds done-kwds tags)
+ (when (stringp (car def-todo))
+ (setq def-todo (list (cons 'sequence def-todo))))
+ (org-agenda-prepare-buffers (mapcar 'car files-alist))
+ (setq done-kwds (org-uniquify org-done-keywords-for-agenda))
+ (setq todo-kwds (org-delete-all
+ done-kwds
+ (org-uniquify org-todo-keywords-for-agenda)))
+ (setq tags (mapcar 'car (org-global-tags-completion-table
+ (mapcar 'car files-alist))))
+ (with-temp-file (if org-mobile-use-encryption org-mobile-encryption-tempfile
+ target-file)
+ (insert "#+READONLY\n")
+ (dolist (entry def-todo)
+ (let ((kwds (mapcar (lambda (x)
+ (if (string-match "(" x)
+ (substring x 0 (match-beginning 0))
+ x))
+ (cdr entry))))
+ (insert "#+TODO: " (mapconcat #'identity kwds " ") "\n")
+ (let* ((dwds (or (member "|" kwds) (last kwds)))
+ (twds (org-delete-all dwds kwds)))
+ (setq todo-kwds (org-delete-all twds todo-kwds))
+ (setq done-kwds (org-delete-all dwds done-kwds)))))
+ (when (or todo-kwds done-kwds)
+ (insert "#+TODO: " (mapconcat 'identity todo-kwds " ") " | "
+ (mapconcat 'identity done-kwds " ") "\n"))
+ (setq def-tags (split-string (org-tag-alist-to-string def-tags t)))
+ (setq tags (org-delete-all def-tags tags))
+ (setq tags (sort tags (lambda (a b) (string< (downcase a) (downcase b)))))
+ (setq tags (append def-tags tags nil))
+ (insert "#+TAGS: " (mapconcat 'identity tags " ") "\n")
+ (insert "#+ALLPRIORITIES: " org-mobile-allpriorities "\n")
+ (when (file-exists-p (expand-file-name
+ org-mobile-directory "agendas.org"))
+ (insert "* [[file:agendas.org][Agenda Views]]\n"))
+ (pcase-dolist (`(,_ . ,link-name) files-alist)
+ (insert (format "* [[file:%s][%s]]\n" link-name link-name)))
+ (push (cons org-mobile-index-file (md5 (buffer-string)))
+ org-mobile-checksum-files))
+ (when org-mobile-use-encryption
+ (org-mobile-encrypt-and-move org-mobile-encryption-tempfile
+ target-file)
+ (org-mobile-cleanup-encryption-tempfile))))
+
+(defun org-mobile-copy-agenda-files ()
+ "Copy all agenda files to the stage or WebDAV directory."
+ (let ((files-alist org-mobile-files-alist)
+ file buf entry link-name target-path target-dir check)
+ (while (setq entry (pop files-alist))
+ (setq file (car entry) link-name (cdr entry))
+ (when (file-exists-p file)
+ (setq target-path (expand-file-name link-name org-mobile-directory)
+ target-dir (file-name-directory target-path))
+ (unless (file-directory-p target-dir)
+ (make-directory target-dir 'parents))
+ (if org-mobile-use-encryption
+ (org-mobile-encrypt-and-move file target-path)
+ (copy-file file target-path 'ok-if-already-exists))
+ (setq check (shell-command-to-string
+ (concat (shell-quote-argument org-mobile-checksum-binary)
+ " "
+ (shell-quote-argument (expand-file-name file)))))
+ (when (string-match "[[:xdigit:]]\\{30,40\\}" check)
+ (push (cons link-name (match-string 0 check))
+ org-mobile-checksum-files))))
+
+ (setq file (expand-file-name org-mobile-capture-file
+ org-mobile-directory))
+ (save-excursion
+ (setq buf (find-file file))
+ (when (and (= (point-min) (point-max)))
+ (insert "\n")
+ (save-buffer)
+ (when org-mobile-use-encryption
+ (write-file org-mobile-encryption-tempfile)
+ (org-mobile-encrypt-and-move org-mobile-encryption-tempfile file)))
+ (push (cons org-mobile-capture-file (md5 (buffer-string)))
+ org-mobile-checksum-files))
+ (org-mobile-cleanup-encryption-tempfile)
+ (kill-buffer buf)))
+
+(defun org-mobile-write-checksums ()
+ "Create checksums for all files in `org-mobile-directory'.
+The table of checksums is written to the file mobile-checksums."
+ (let ((sumfile (expand-file-name "checksums.dat" org-mobile-directory))
+ (files org-mobile-checksum-files)
+ entry file sum)
+ (with-temp-file sumfile
+ (set-buffer-file-coding-system 'undecided-unix nil)
+ (while (setq entry (pop files))
+ (setq file (car entry) sum (cdr entry))
+ (insert (format "%s %s\n" sum file))))))
+
+(defun org-mobile-sumo-agenda-command ()
+ "Return an agenda custom command that comprises all custom commands."
+ (let ((custom-list
+ ;; normalize different versions
+ (delq nil
+ (mapcar
+ (lambda (x)
+ (cond ((stringp (cdr x)) nil)
+ ((stringp (nth 1 x)) x)
+ ((not (nth 1 x)) (cons (car x) (cons "" (cddr x))))
+ (t (cons (car x) (cons "" (cdr x))))))
+ org-agenda-custom-commands)))
+ (default-list '(("a" "Agenda" agenda) ("t" "All TODO" alltodo)))
+ thelist atitle new e key desc type match settings cmds gkey gdesc gsettings cnt)
+ (cond
+ ((eq org-mobile-agendas 'custom)
+ (setq thelist custom-list))
+ ((eq org-mobile-agendas 'default)
+ (setq thelist default-list))
+ ((eq org-mobile-agendas 'all)
+ (setq thelist custom-list)
+ (unless (assoc "t" thelist) (push '("t" "ALL TODO" alltodo) thelist))
+ (unless (assoc "a" thelist) (push '("a" "Agenda" agenda) thelist)))
+ ((listp org-mobile-agendas)
+ (setq thelist (append custom-list default-list))
+ (setq thelist (delq nil (mapcar (lambda (k) (assoc k thelist))
+ org-mobile-agendas)))))
+ (while (setq e (pop thelist))
+ (cond
+ ((stringp (cdr e))
+ ;; this is a description entry - skip it
+ )
+ ((eq (nth 2 e) 'search)
+ ;; Search view is interactive, skip
+ )
+ ((memq (nth 2 e) '(todo-tree tags-tree occur-tree))
+ ;; These are trees, not really agenda commands
+ )
+ ((and (memq (nth 2 e) '(todo tags tags-todo))
+ (or (null (nth 3 e))
+ (not (string-match "\\S-" (nth 3 e)))))
+ ;; These would be interactive because the match string is empty
+ )
+ ((memq (nth 2 e) '(agenda alltodo todo tags tags-todo))
+ ;; a normal command
+ (setq key (car e) desc (nth 1 e) type (nth 2 e) match (nth 3 e)
+ settings (nth 4 e))
+ (setq settings
+ (cons (list 'org-agenda-title-append
+ (concat "<after>KEYS=" key " TITLE: "
+ (if (and (stringp desc) (> (length desc) 0))
+ desc (symbol-name type))
+ "</after>"))
+ settings))
+ (push (list type match settings) new))
+ ((or (functionp (nth 2 e)) (symbolp (nth 2 e)))
+ ;; A user-defined function, which can do anything, so simply
+ ;; ignore it.
+ )
+ (t
+ ;; a block agenda
+ (setq gkey (car e) gdesc (nth 1 e) gsettings (nth 3 e) cmds (nth 2 e))
+ (setq cnt 0)
+ (while (setq e (pop cmds))
+ (setq type (car e) match (nth 1 e) settings (nth 2 e))
+ (setq atitle (if (string= "" gdesc) match gdesc))
+ (setq settings (append gsettings settings))
+ (setq settings
+ (cons (list 'org-agenda-title-append
+ (concat "<after>KEYS=" gkey "#" (number-to-string
+ (setq cnt (1+ cnt)))
+ " TITLE: " atitle "</after>"))
+ settings))
+ (push (list type match settings) new)))))
+ (and new (list "X" "SUMO" (reverse new)
+ '((org-agenda-compact-blocks nil))))))
+
+(defvar org-mobile-creating-agendas nil)
+(defun org-mobile-write-agenda-for-mobile (file)
+ (let ((all (buffer-string)) in-date id pl prefix line app short m sexp)
+ (with-temp-file file
+ (org-mode)
+ (insert "#+READONLY\n")
+ (insert all)
+ (goto-char (point-min))
+ (while (not (eobp))
+ (cond
+ ((looking-at "[ \t]*$")) ; keep empty lines
+ ((looking-at "=+$")
+ ;; remove underlining
+ (delete-region (point) (point-at-eol)))
+ ((get-text-property (point) 'org-agenda-structural-header)
+ (setq in-date nil)
+ (setq app (get-text-property (point) 'org-agenda-title-append))
+ (setq short (get-text-property (point) 'short-heading))
+ (when (and short (looking-at ".+"))
+ (replace-match short nil t)
+ (beginning-of-line 1))
+ (when app
+ (end-of-line 1)
+ (insert app)
+ (beginning-of-line 1))
+ (insert "* "))
+ ((get-text-property (point) 'org-agenda-date-header)
+ (setq in-date t)
+ (insert "** "))
+ ((setq m (or (get-text-property (point) 'org-hd-marker)
+ (get-text-property (point) 'org-marker)))
+ (setq sexp (member (get-text-property (point) 'type)
+ '("diary" "sexp")))
+ (if (setq pl (text-property-any (point) (point-at-eol) 'org-heading t))
+ (progn
+ (setq prefix (org-trim (buffer-substring
+ (point) pl))
+ line (org-trim (buffer-substring
+ pl
+ (point-at-eol))))
+ (delete-region (point-at-bol) (point-at-eol))
+ (insert line "<before>" prefix "</before>")
+ (beginning-of-line 1))
+ (and (looking-at "[ \t]+") (replace-match "")))
+ (insert (if in-date "*** " "** "))
+ (end-of-line 1)
+ (insert "\n")
+ (unless sexp
+ (insert (org-agenda-get-some-entry-text
+ m 10 " " 'planning)
+ "\n")
+ (when (setq id
+ (if (bound-and-true-p
+ org-mobile-force-id-on-agenda-items)
+ (org-id-get m 'create)
+ (or (org-entry-get m "ID")
+ (org-mobile-get-outline-path-link m))))
+ (insert " :PROPERTIES:\n :ORIGINAL_ID: " id
+ "\n :END:\n")))))
+ (beginning-of-line 2))
+ (push (cons "agendas.org" (md5 (buffer-string)))
+ org-mobile-checksum-files))
+ (message "Agenda written to Org file %s" file)))
+
+(defun org-mobile-get-outline-path-link (pom)
+ (org-with-point-at pom
+ (concat "olp:"
+ (org-mobile-escape-olp (file-name-nondirectory buffer-file-name))
+ ":"
+ (mapconcat 'org-mobile-escape-olp
+ (org-get-outline-path)
+ "/")
+ "/"
+ (org-mobile-escape-olp (nth 4 (org-heading-components))))))
+
+(defun org-mobile-escape-olp (s)
+ (org-link-encode s '(?: ?/)))
+
+(defun org-mobile-create-sumo-agenda ()
+ "Create a file that contains all custom agenda views."
+ (interactive)
+ (let* ((file (expand-file-name "agendas.org"
+ org-mobile-directory))
+ (file1 (if org-mobile-use-encryption
+ org-mobile-encryption-tempfile
+ file))
+ (sumo (org-mobile-sumo-agenda-command))
+ (org-agenda-custom-commands
+ (list (append sumo (list (list file1)))))
+ (org-mobile-creating-agendas t))
+ (unless (file-writable-p file1)
+ (error "Cannot write to file %s" file1))
+ (when sumo
+ (org-store-agenda-views))
+ (when org-mobile-use-encryption
+ (org-mobile-encrypt-and-move file1 file)
+ (delete-file file1)
+ (org-mobile-cleanup-encryption-tempfile))))
+
+(defun org-mobile-encrypt-and-move (infile outfile)
+ "Encrypt INFILE locally to INFILE_enc, then move it to OUTFILE.
+We do this in two steps so that remote paths will work, even if the
+encryption program does not understand them."
+ (let ((encfile (concat infile "_enc")))
+ (org-mobile-encrypt-file infile encfile)
+ (when outfile
+ (copy-file encfile outfile 'ok-if-already-exists)
+ (delete-file encfile))))
+
+(defun org-mobile-encrypt-file (infile outfile)
+ "Encrypt INFILE to OUTFILE, using `org-mobile-encryption-password'."
+ (shell-command
+ (format "openssl enc -md md5 -aes-256-cbc -salt -pass %s -in %s -out %s"
+ (shell-quote-argument (concat "pass:"
+ (org-mobile-encryption-password)))
+ (shell-quote-argument (expand-file-name infile))
+ (shell-quote-argument (expand-file-name outfile)))))
+
+(defun org-mobile-decrypt-file (infile outfile)
+ "Decrypt INFILE to OUTFILE, using `org-mobile-encryption-password'."
+ (shell-command
+ (format "openssl enc -md md5 -d -aes-256-cbc -salt -pass %s -in %s -out %s"
+ (shell-quote-argument (concat "pass:"
+ (org-mobile-encryption-password)))
+ (shell-quote-argument (expand-file-name infile))
+ (shell-quote-argument (expand-file-name outfile)))))
+
+(defun org-mobile-cleanup-encryption-tempfile ()
+ "Remove the encryption tempfile if it exists."
+ (and (stringp org-mobile-encryption-tempfile)
+ (file-exists-p org-mobile-encryption-tempfile)
+ (delete-file org-mobile-encryption-tempfile)))
+
+(defun org-mobile-move-capture ()
+ "Move the contents of the capture file to the inbox file.
+Return a marker to the location where the new content has been added.
+If nothing new has been added, return nil."
+ (interactive)
+ (let* ((encfile nil)
+ (capture-file (expand-file-name org-mobile-capture-file
+ org-mobile-directory))
+ (inbox-buffer (find-file-noselect org-mobile-inbox-for-pull))
+ (capture-buffer
+ (if (not org-mobile-use-encryption)
+ (find-file-noselect capture-file)
+ (org-mobile-cleanup-encryption-tempfile)
+ (setq encfile (concat org-mobile-encryption-tempfile "_enc"))
+ (copy-file capture-file encfile)
+ (org-mobile-decrypt-file encfile org-mobile-encryption-tempfile)
+ (find-file-noselect org-mobile-encryption-tempfile)))
+ (insertion-point (make-marker))
+ not-empty content)
+ (with-current-buffer capture-buffer
+ (setq content (buffer-string))
+ (setq not-empty (string-match "\\S-" content))
+ (when not-empty
+ (set-buffer inbox-buffer)
+ (widen)
+ (goto-char (point-max))
+ (or (bolp) (newline))
+ (move-marker insertion-point
+ (prog1 (point) (insert content)))
+ (save-buffer)
+ (set-buffer capture-buffer)
+ (erase-buffer)
+ (save-buffer)
+ (org-mobile-update-checksum-for-capture-file (buffer-string))))
+ (kill-buffer capture-buffer)
+ (when org-mobile-use-encryption
+ (org-mobile-encrypt-and-move org-mobile-encryption-tempfile
+ capture-file)
+ (org-mobile-cleanup-encryption-tempfile))
+ (if not-empty insertion-point)))
+
+(defun org-mobile-update-checksum-for-capture-file (buffer-string)
+ "Find the checksum line and modify it to match BUFFER-STRING."
+ (let* ((file (expand-file-name "checksums.dat" org-mobile-directory))
+ (buffer (find-file-noselect file)))
+ (when buffer
+ (with-current-buffer buffer
+ (when (re-search-forward (concat "\\([[:xdigit:]]\\{30,\\}\\).*?"
+ (regexp-quote org-mobile-capture-file)
+ "[ \t]*$") nil t)
+ (goto-char (match-beginning 1))
+ (delete-region (match-beginning 1) (match-end 1))
+ (insert (md5 buffer-string))
+ (save-buffer)))
+ (kill-buffer buffer))))
+
+(defun org-mobile-apply (&optional beg end)
+ "Apply all change requests in the current buffer.
+If BEG and END are given, only do this in that region."
+ (interactive)
+ (require 'org-archive)
+ (setq org-mobile-last-flagged-files nil)
+ (setq beg (or beg (point-min)) end (or end (point-max)))
+
+ ;; Remove all Note IDs
+ (goto-char beg)
+ (while (re-search-forward "^\\*\\* Note ID: [-0-9A-F]+[ \t]*\n" end t)
+ (replace-match ""))
+
+ ;; Find all the referenced entries, without making any changes yet
+ (let ((marker (make-marker))
+ (bos-marker (make-marker))
+ (end (move-marker (make-marker) end))
+ (cnt-new 0)
+ (cnt-edit 0)
+ (cnt-flag 0)
+ (cnt-error 0)
+ buf-list
+ org-mobile-error)
+
+ ;; Count the new captures
+ (goto-char beg)
+ (while (re-search-forward "^\\* \\(.*\\)" end t)
+ (and (>= (- (match-end 1) (match-beginning 1)) 2)
+ (not (equal (downcase (substring (match-string 1) 0 2)) "f("))
+ (cl-incf cnt-new)))
+
+ ;; Find and apply the edits
+ (goto-char beg)
+ (while (re-search-forward
+ "^\\*+[ \t]+F(\\([^():\n]*\\)\\(:\\([^()\n]*\\)\\)?)[ \t]+\\[\\[\\(\\(id\\|olp\\):\\([^]\n]+\\)\\)" end t)
+ (catch 'next
+ (let* ((action (match-string 1))
+ (data (and (match-end 3) (match-string 3)))
+ (id-pos (condition-case msg
+ (org-mobile-locate-entry (match-string 4))
+ (error (nth 1 msg))))
+ (bos (line-beginning-position))
+ (eos (save-excursion (org-end-of-subtree t t)))
+ (cmd (if (equal action "")
+ (let ((note (buffer-substring-no-properties
+ (line-beginning-position 2) eos)))
+ (lambda (_data _old _new)
+ (cl-incf cnt-flag)
+ (org-toggle-tag "FLAGGED" 'on)
+ (org-entry-put
+ nil "THEFLAGGINGNOTE"
+ (replace-regexp-in-string "\n" "\\\\n" note))))
+ (cl-incf cnt-edit)
+ (cdr (assoc action org-mobile-action-alist))))
+ ;; Do not take notes interactively.
+ (org-inhibit-logging 'note)
+ old new)
+
+ (goto-char bos)
+ (when (and (markerp id-pos)
+ (not (member (marker-buffer id-pos) buf-list)))
+ (org-mobile-timestamp-buffer (marker-buffer id-pos))
+ (push (marker-buffer id-pos) buf-list))
+ (unless (markerp id-pos)
+ (goto-char (+ 2 (point-at-bol)))
+ (if (stringp id-pos)
+ (insert id-pos " ")
+ (insert "BAD REFERENCE "))
+ (cl-incf cnt-error)
+ (throw 'next t))
+ (unless cmd
+ (insert "BAD FLAG ")
+ (cl-incf cnt-error)
+ (throw 'next t))
+ (move-marker bos-marker (point))
+ (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)
+ (setq new (buffer-substring
+ (1+ (match-end 0))
+ (progn (outline-next-heading)
+ (if (eobp) (org-back-over-empty-lines))
+ (point)))))
+ (setq old (org-string-nw-p old))
+ (setq new (org-string-nw-p new))
+ (unless (equal data "body")
+ (setq new (and new (org-trim new)))
+ (setq old (and old (org-trim old))))
+ (goto-char (+ 2 bos-marker))
+ ;; Remember this place so that we can return
+ (move-marker marker (point))
+ (setq org-mobile-error nil)
+ (condition-case msg
+ (org-with-point-at id-pos
+ (funcall cmd data old new)
+ (unless (member data '("delete" "archive" "archive-sibling"
+ "addheading"))
+ (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)))
+ (when org-mobile-error
+ (pop-to-buffer-same-window (marker-buffer marker))
+ (goto-char marker)
+ (cl-incf cnt-error)
+ (insert (if (stringp (nth 1 org-mobile-error))
+ (nth 1 org-mobile-error)
+ "EXECUTION FAILED")
+ " ")
+ (throw 'next t))
+ ;; If we get here, the action has been applied successfully
+ ;; So remove the entry
+ (goto-char bos-marker)
+ (delete-region (point) (org-end-of-subtree t t)))))
+ (save-buffer)
+ (move-marker marker nil)
+ (move-marker end nil)
+ (message "%d new, %d edits, %d flags, %d errors"
+ cnt-new cnt-edit cnt-flag cnt-error)
+ (sit-for 1)))
+
+(defun org-mobile-timestamp-buffer (buf)
+ "Time stamp buffer BUF, just to make sure its checksum will change."
+ (with-current-buffer buf
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (if (re-search-forward
+ "^\\([ \t]*\\)#\\+LAST_MOBILE_CHANGE:.*\n?" nil t)
+ (progn
+ (goto-char (match-end 1))
+ (delete-region (point) (match-end 0)))
+ (if (looking-at ".*?-\\*-.*-\\*-")
+ (forward-line 1)))
+ (insert "#+LAST_MOBILE_CHANGE: "
+ (format-time-string "%Y-%m-%d %T") "\n")))))
+
+(defun org-mobile-smart-read ()
+ "Parse the entry at point for shortcuts and expand them.
+These shortcuts are meant for fast and easy typing on the limited
+keyboards of a mobile device. Below we show a list of the shortcuts
+currently implemented.
+
+The entry is expected to contain an inactive time stamp indicating when
+the entry was created. When setting dates and
+times (for example for deadlines), the time strings are interpreted
+relative to that creation date.
+Abbreviations are expected to take up entire lines, just because it is so
+easy to type RET on a mobile device. Abbreviations start with one or two
+letters, followed immediately by a dot and then additional information.
+Generally the entire shortcut line is removed after action have been taken.
+Time stamps will be constructed using `org-read-date'. So for example a
+line \"dd. 2tue\" will set a deadline on the second Tuesday after the
+creation date.
+
+Here are the shortcuts currently implemented:
+
+dd. string set deadline
+ss. string set scheduling
+tt. string set time tamp, here.
+ti. string set inactive time
+
+tg. tag1 tag2 tag3 set all these tags, change case where necessary
+td. kwd set this todo keyword, change case where necessary
+
+FIXME: Hmmm, not sure if we can make his work against the
+auto-correction feature. Needs a bit more thinking. So this function
+is currently a noop.")
+
+(defun org-mobile-locate-entry (link)
+ (if (string-match "\\`id:\\(.*\\)$" link)
+ (org-id-find (match-string 1 link) 'marker)
+ (if (not (string-match "\\`olp:\\(.*?\\):\\(.*\\)$" link))
+ ; not found with path, but maybe it is to be inserted
+ ; in top level of the file?
+ (if (not (string-match "\\`olp:\\(.*?\\)$" link))
+ nil
+ (let ((file (match-string 1 link)))
+ (setq file (org-link-decode file))
+ (setq file (expand-file-name file org-directory))
+ (save-excursion
+ (find-file file)
+ (goto-char (point-max))
+ (newline)
+ (goto-char (point-max))
+ (point-marker))))
+ (let ((file (match-string 1 link))
+ (path (match-string 2 link)))
+ (setq file (org-link-decode file))
+ (setq file (expand-file-name file org-directory))
+ (setq path (mapcar #'org-link-decode
+ (org-split-string path "/")))
+ (org-find-olp (cons file path))))))
+
+(defun org-mobile-edit (what old new)
+ "Edit item WHAT in the current entry by replacing OLD with NEW.
+WHAT can be \"heading\", \"todo\", \"tags\", \"priority\", or \"body\".
+The edit only takes place if the current value is equal (except for
+white space) the OLD. If this is so, OLD will be replace by NEW
+and the command will return t. If something goes wrong, a string will
+be returned that indicates what went wrong."
+ (let (current old1 new1 level)
+ (if (stringp what) (setq what (intern what)))
+
+ (cond
+
+ ((memq what '(todo todostate))
+ (setq current (org-get-todo-state))
+ (cond
+ ((equal new "DONEARCHIVE")
+ (org-todo 'done)
+ (org-archive-subtree-default))
+ ((equal new current) t) ; nothing needs to be done
+ ((or (equal current old)
+ (eq org-mobile-force-mobile-change t)
+ (memq 'todo org-mobile-force-mobile-change))
+ (org-todo (or new 'none)) t)
+ (t (error "State before change was expected as \"%s\", but is \"%s\""
+ old current))))
+
+ ((eq what 'tags)
+ (setq current (org-get-tags nil t)
+ new1 (and new (org-split-string new ":+"))
+ old1 (and old (org-split-string old ":+")))
+ (cond
+ ((org-mobile-tags-same-p current new1) t) ; no change needed
+ ((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 new1) t)
+ (t (error "Tags before change were expected as \"%s\", but are \"%s\""
+ (or old "") (or current "")))))
+
+ ((eq what 'priority)
+ (let ((case-fold-search nil))
+ (when (looking-at org-complex-heading-regexp)
+ (let ((current (and (match-end 3) (substring (match-string 3) 2 3))))
+ (cond
+ ((equal current new) t) ;no action required
+ ((or (equal current old)
+ (eq org-mobile-force-mobile-change t)
+ (memq 'tags org-mobile-force-mobile-change))
+ (org-priority (and new (string-to-char new))))
+ (t (error "Priority was expected to be %s, but is %s"
+ old current)))))))
+
+ ((eq what 'heading)
+ (let ((case-fold-search nil))
+ (when (looking-at org-complex-heading-regexp)
+ (let ((current (match-string 4)))
+ (cond
+ ((equal current new) t) ;no action required
+ ((or (equal current old)
+ (eq org-mobile-force-mobile-change t)
+ (memq 'heading org-mobile-force-mobile-change))
+ (goto-char (match-beginning 4))
+ (insert new)
+ (delete-region (point) (+ (point) (length current)))
+ (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
+ (progn
+ ;; Workaround a `org-insert-heading-respect-content' bug
+ ;; which prevents correct insertion when point is invisible
+ (org-show-subtree)
+ (end-of-line 1)
+ (org-insert-heading-respect-content t)
+ (org-demote))
+ (beginning-of-line)
+ (insert "* "))
+ (insert new))
+
+ ((eq what 'refile)
+ (org-copy-subtree)
+ (org-with-point-at (org-mobile-locate-entry new)
+ (if (org-at-heading-p) ; if false we are in top-level of file
+ (progn
+ (setq level (org-get-valid-level (funcall outline-level) 1))
+ (org-end-of-subtree t t)
+ (org-paste-subtree level))
+ (org-paste-subtree 1)))
+ (org-cut-subtree))
+
+ ((eq what 'delete)
+ (org-cut-subtree))
+
+ ((eq what 'archive)
+ (org-archive-subtree))
+
+ ((eq what 'archive-sibling)
+ (org-archive-to-archive-sibling))
+
+ ((eq what 'body)
+ (setq current (buffer-substring (min (1+ (point-at-eol)) (point-max))
+ (save-excursion (outline-next-heading)
+ (point))))
+ (if (not (string-match "\\S-" current)) (setq current nil))
+ (cond
+ ((org-mobile-bodies-same-p current new) t) ; no action necessary
+ ((or (org-mobile-bodies-same-p current old)
+ (eq org-mobile-force-mobile-change t)
+ (memq 'body org-mobile-force-mobile-change))
+ (save-excursion
+ (end-of-line 1)
+ (insert "\n" new)
+ (or (bolp) (insert "\n"))
+ (delete-region (point) (progn (org-back-to-heading t)
+ (outline-next-heading)
+ (point))))
+ t)
+ (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?"
+ (not (or (org-delete-all list1 list2)
+ (org-delete-all list2 list1))))
+
+(defun org-mobile-bodies-same-p (a b)
+ "Compare if A and B are visually equal strings.
+We first remove leading and trailing white space from the entire strings.
+Then we split the strings into lines and remove leading/trailing whitespace
+from each line. Then we compare.
+A and B must be strings or nil."
+ (cond
+ ((and (not a) (not b)) t)
+ ((or (not a) (not b)) nil)
+ (t (setq a (org-trim a) b (org-trim b))
+ (setq a (mapconcat 'identity (org-split-string a "[ \t]*\n[ \t]*") "\n"))
+ (setq b (mapconcat 'identity (org-split-string b "[ \t]*\n[ \t]*") "\n"))
+ (equal a b))))
+
+(provide 'org-mobile)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-mobile.el ends here
diff --git a/elpa/org-9.5.2/org-mobile.elc b/elpa/org-9.5.2/org-mobile.elc
new file mode 100644
index 0000000..17d630a
--- /dev/null
+++ b/elpa/org-9.5.2/org-mobile.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-mouse.el b/elpa/org-9.5.2/org-mouse.el
new file mode 100644
index 0000000..a35a19b
--- /dev/null
+++ b/elpa/org-9.5.2/org-mouse.el
@@ -0,0 +1,1100 @@
+;;; org-mouse.el --- Better mouse support for Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
+
+;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
+;; Maintainer: Carsten Dominik <carsten.dominik@gmail.com>
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Org-mouse provides mouse support for org-mode.
+;;
+;; https://orgmode.org
+;;
+;; Org mouse implements the following features:
+;; * following links with the left mouse button
+;; * subtree expansion/collapse (org-cycle) with the left mouse button
+;; * several context menus on the right mouse button:
+;; + general text
+;; + headlines
+;; + timestamps
+;; + priorities
+;; + links
+;; + tags
+;; * promoting/demoting/moving subtrees with mouse-3
+;; + if the drag starts and ends in the same line then promote/demote
+;; + otherwise move the subtree
+;;
+;; Use
+;; ---
+;;
+;; To use this package, put the following line in your .emacs:
+;;
+;; (require 'org-mouse)
+;;
+
+;; FIXME:
+;; + deal with folding / unfolding issues
+
+;; TODO (This list is only theoretical, if you'd like to have some
+;; feature implemented or a bug fix please send me an email, even if
+;; something similar appears in the list below. This will help me get
+;; the priorities right.):
+;;
+;; + org-store-link, insert link
+;; + org tables
+;; + occur with the current word/tag (same menu item)
+;; + ctrl-c ctrl-c, for example, renumber the current list
+;; + internal links
+
+;; Please email the maintainer with new feature suggestions / bugs
+
+;; History:
+;;
+;; Since version 5.10: Changes are listed in the general Org docs.
+;;
+;; Version 5.09;; + Version number synchronization with Org mode.
+;;
+;; Version 0.25
+;; + made compatible with Org 4.70 (thanks to Carsten for the patch)
+;;
+;; Version 0.24
+;; + minor changes to the table menu
+;;
+;; Version 0.23
+;; + preliminary support for tables and calculation marks
+;; + context menu support for org-agenda-undo & org-sort-entries
+;;
+;; Version 0.22
+;; + handles undo support for the agenda buffer (requires Org >=4.58)
+;;
+;; Version 0.21
+;; + selected text activates its context menu
+;; + shift-middleclick or right-drag inserts the text from the clipboard in the form of a link
+;;
+;; Version 0.20
+;; + the new "TODO Status" submenu replaces the "Cycle TODO" menu item
+;; + the TODO menu can now list occurrences of a specific TODO keyword
+;; + #+STARTUP line is now recognized
+;;
+;; Version 0.19
+;; + added support for dragging URLs to the org-buffer
+;;
+;; Version 0.18
+;; + added support for agenda blocks
+;;
+;; Version 0.17
+;; + toggle checkboxes with a single click
+;;
+;; Version 0.16
+;; + added support for checkboxes
+;;
+;; Version 0.15
+;; + Org now works with the Agenda buffer as well
+;;
+;; Version 0.14
+;; + added a menu option that converts plain list items to outline items
+;;
+;; Version 0.13
+;; + "Insert Heading" now inserts a sibling heading if the point is
+;; on "***" and a child heading otherwise
+;;
+;; Version 0.12
+;; + compatible with Emacs 21
+;; + custom agenda commands added to the main menu
+;; + moving trees should now work between windows in the same frame
+;;
+;; Version 0.11
+;; + fixed org-mouse-at-link (thanks to Carsten)
+;; + removed [follow-link] bindings
+;;
+;; Version 0.10
+;; + added a menu option to remove highlights
+;; + compatible with Org 4.21 now
+;;
+;; Version 0.08:
+;; + trees can be moved/promoted/demoted by dragging with the right
+;; mouse button (mouse-3)
+;; + small changes in the above function
+;;
+;; Versions 0.01 -- 0.07: (I don't remember)
+
+;;; Code:
+
+(require 'org)
+(require 'cl-lib)
+
+(defvar org-agenda-allow-remote-undo)
+(defvar org-agenda-undo-list)
+(defvar org-agenda-custom-commands)
+(declare-function org-agenda-change-all-lines "org-agenda"
+ (newhead hdmarker &optional fixface just-this))
+(declare-function org-verify-change-for-undo "org-agenda" (l1 l2))
+(declare-function org-apply-on-list "org-list" (function init-value &rest args))
+(declare-function org-agenda-earlier "org-agenda" (arg))
+(declare-function org-agenda-later "org-agenda" (arg))
+
+(defvar org-mouse-main-buffer nil
+ "Active buffer for mouse operations.")
+(defvar org-mouse-plain-list-regexp "\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) "
+ "Regular expression that matches a plain list.")
+(defvar org-mouse-direct t
+ "Internal variable indicating whether the current action is direct.
+
+If t, then the current action has been invoked directly through the buffer
+it is intended to operate on. If nil, then the action has been invoked
+indirectly, for example, through the agenda buffer.")
+
+(defgroup org-mouse nil
+ "Mouse support for `org-mode'."
+ :tag "Org Mouse"
+ :group 'org)
+
+(defcustom org-mouse-punctuation ":"
+ "Punctuation used when inserting text by drag and drop."
+ :type 'string)
+
+(defcustom org-mouse-features
+ '(context-menu yank-link activate-stars activate-bullets activate-checkboxes)
+ "The features of org-mouse that should be activated.
+Changing this variable requires a restart of Emacs to get activated."
+ :type '(set :greedy t
+ (const :tag "Mouse-3 shows context menu" context-menu)
+ (const :tag "C-mouse-1 and mouse-3 move trees" move-tree)
+ (const :tag "S-mouse-2 and drag-mouse-3 yank link" yank-link)
+ (const :tag "Activate headline stars" activate-stars)
+ (const :tag "Activate item bullets" activate-bullets)
+ (const :tag "Activate checkboxes" activate-checkboxes)))
+
+(defun org-mouse-re-search-line (regexp)
+ "Search the current line for a given regular expression."
+ (beginning-of-line)
+ (re-search-forward regexp (point-at-eol) t))
+
+(defun org-mouse-end-headline ()
+ "Go to the end of current headline (ignoring tags)."
+ (interactive)
+ (end-of-line)
+ (skip-chars-backward "\t ")
+ (when (looking-back ":[A-Za-z]+:" (line-beginning-position))
+ (skip-chars-backward ":A-Za-z")
+ (skip-chars-backward "\t ")))
+
+(defvar-local org-mouse-context-menu-function nil
+ "Function to create the context menu.
+The value of this variable is the function invoked by
+`org-mouse-context-menu' as the context menu.")
+
+(defun org-mouse-show-context-menu (event prefix)
+ "Invoke the context menu.
+
+If the value of `org-mouse-context-menu-function' is a function, then
+this function is called. Otherwise, the current major mode menu is used."
+ (interactive "@e \nP")
+ (if (and (= (event-click-count event) 1)
+ (or (not mark-active)
+ (sit-for (/ double-click-time 1000.0))))
+ (progn
+ (select-window (posn-window (event-start event)))
+ (when (not (org-mouse-mark-active))
+ (goto-char (posn-point (event-start event)))
+ (when (not (eolp)) (save-excursion (run-hooks 'post-command-hook)))
+ (sit-for 0))
+ (if (functionp org-mouse-context-menu-function)
+ (funcall org-mouse-context-menu-function event)
+ (if (fboundp 'mouse-menu-major-mode-map)
+ (popup-menu (mouse-menu-major-mode-map) event prefix)
+ (with-no-warnings ; don't warn about fallback, obsolete since 23.1
+ (mouse-major-mode-menu event prefix)))))
+ (setq this-command 'mouse-save-then-kill)
+ (mouse-save-then-kill event)))
+
+(defun org-mouse-line-position ()
+ "Return `:beginning' or `:middle' or `:end', depending on the point position.
+
+If the point is at the end of the line, return `:end'.
+If the point is separated from the beginning of the line only by white
+space and *'s (`org-mouse-bolp'), return `:beginning'. Otherwise,
+return `:middle'."
+ (cond
+ ((eolp) :end)
+ ((org-mouse-bolp) :beginning)
+ (t :middle)))
+
+(defun org-mouse-empty-line ()
+ "Return non-nil iff the line contains only white space."
+ (save-excursion (beginning-of-line) (looking-at "[ \t]*$")))
+
+(defun org-mouse-next-heading ()
+ "Go to the next heading.
+If there is none, ensure that the point is at the beginning of an empty line."
+ (unless (outline-next-heading)
+ (beginning-of-line)
+ (unless (org-mouse-empty-line)
+ (end-of-line)
+ (newline))))
+
+(defun org-mouse-insert-heading ()
+ "Insert a new heading, as `org-insert-heading'.
+
+If the point is at the :beginning (`org-mouse-line-position') of the line,
+insert the new heading before the current line. Otherwise, insert it
+after the current heading."
+ (interactive)
+ (cl-case (org-mouse-line-position)
+ (:beginning (beginning-of-line)
+ (org-insert-heading))
+ (t (org-mouse-next-heading)
+ (org-insert-heading))))
+
+(defun org-mouse-timestamp-today (&optional shift units)
+ "Change the timestamp into SHIFT UNITS in the future.
+
+For the acceptable UNITS, see `org-timestamp-change'."
+ (interactive)
+ (org-time-stamp nil)
+ (when shift (org-timestamp-change shift units)))
+
+(defun org-mouse-keyword-menu (keywords function &optional selected itemformat)
+ "A helper function.
+
+Returns a menu fragment consisting of KEYWORDS. When a keyword
+is selected by the user, FUNCTION is called with the selected
+keyword as the only argument.
+
+If SELECTED is nil, then all items are normal menu items. If
+SELECTED is a function, then each item is a checkbox, which is
+enabled for a given keyword iff (funcall SELECTED keyword) return
+non-nil. If SELECTED is neither nil nor a function, then the
+items are radio buttons. A radio button is enabled for the
+keyword `equal' to SELECTED.
+
+ITEMFORMAT governs formatting of the elements of KEYWORDS. If it
+is a function, it is invoked with the keyword as the only
+argument. If it is a string, it is interpreted as the format
+string to (format ITEMFORMAT keyword). If it is neither a string
+nor a function, elements of KEYWORDS are used directly."
+ (mapcar
+ (lambda (keyword)
+ (vector (cond
+ ((functionp itemformat) (funcall itemformat keyword))
+ ((stringp itemformat) (format itemformat keyword))
+ (t keyword))
+ (list 'funcall function keyword)
+ :style (cond
+ ((null selected) t)
+ ((functionp selected) 'toggle)
+ (t 'radio))
+ :selected (if (functionp selected)
+ (and (funcall selected keyword) t)
+ (equal selected keyword))))
+ keywords))
+
+(defun org-mouse-remove-match-and-spaces ()
+ "Remove the match, make just one space around the point."
+ (interactive)
+ (replace-match "")
+ (just-one-space))
+
+(defvar org-mouse-rest)
+(defun org-mouse-replace-match-and-surround
+ (_newtext &optional _fixedcase _literal _string subexp)
+ "The same as `replace-match', but surrounds the replacement with spaces."
+ (apply #'replace-match org-mouse-rest)
+ (save-excursion
+ (goto-char (match-beginning (or subexp 0)))
+ (just-one-space)
+ (goto-char (match-end (or subexp 0)))
+ (just-one-space)))
+
+(defun org-mouse-keyword-replace-menu (keywords &optional group itemformat
+ nosurround)
+ "A helper function.
+
+Returns a menu fragment consisting of KEYWORDS. When a keyword
+is selected, group GROUP of the current match is replaced by the
+keyword. The method ensures that both ends of the replacement
+are separated from the rest of the text in the buffer by
+individual spaces (unless NOSURROUND is non-nil).
+
+The final entry of the menu is always \"None\", which removes the
+match.
+
+ITEMFORMAT governs formatting of the elements of KEYWORDS. If it
+is a function, it is invoked with the keyword as the only
+argument. If it is a string, it is interpreted as the format
+string to (format ITEMFORMAT keyword). If it is neither a string
+nor a function, elements of KEYWORDS are used directly."
+ (setq group (or group 0))
+ (let ((replace (org-mouse-match-closure
+ (if nosurround #'replace-match
+ #'org-mouse-replace-match-and-surround))))
+ (append
+ (org-mouse-keyword-menu
+ keywords
+ (lambda (keyword) (funcall replace keyword t t nil group))
+ (match-string group)
+ itemformat)
+ `(["None" org-mouse-remove-match-and-spaces
+ :style radio
+ :selected ,(not (member (match-string group) keywords))]))))
+
+(defun org-mouse-show-headlines ()
+ "Change the visibility of the current org buffer to only show headlines."
+ (interactive)
+ (let ((this-command 'org-cycle)
+ (last-command 'org-cycle)
+ (org-cycle-global-status nil))
+ (org-cycle '(4))
+ (org-cycle '(4))))
+
+(defun org-mouse-show-overview ()
+ "Change visibility of current org buffer to first-level headlines only."
+ (interactive)
+ (let ((org-cycle-global-status nil))
+ (org-cycle '(4))))
+
+(defun org-mouse-set-priority (priority)
+ "Set the priority of the current headline to PRIORITY."
+ (org-priority priority))
+
+(defvar org-mouse-priority-regexp "\\[#\\([A-Z]\\)\\]"
+ "Regular expression matching the priority indicator.
+Differs from `org-priority-regexp' in that it doesn't contain the
+leading `.*?'.")
+
+(defun org-mouse-get-priority (&optional default)
+ "Return the priority of the current headline.
+DEFAULT is returned if no priority is given in the headline."
+ (save-excursion
+ (if (org-mouse-re-search-line org-mouse-priority-regexp)
+ (match-string 1)
+ (when default (char-to-string org-priority-default)))))
+
+(defun org-mouse-delete-timestamp ()
+ "Deletes the current timestamp as well as the preceding keyword.
+SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
+ (when (or (org-at-date-range-p) (org-at-timestamp-p 'lax))
+ (replace-match "") ;delete the timestamp
+ (skip-chars-backward " :A-Z")
+ (when (looking-at " *[A-Z][A-Z]+:")
+ (replace-match ""))))
+
+(defun org-mouse-looking-at (regexp skipchars &optional movechars)
+ (save-excursion
+ (let ((point (point)))
+ (if (looking-at regexp) t
+ (skip-chars-backward skipchars)
+ (forward-char (or movechars 0))
+ (when (looking-at regexp)
+ (> (match-end 0) point))))))
+
+(defun org-mouse-priority-list ()
+ (cl-loop for priority from ?A to org-priority-lowest
+ collect (char-to-string priority)))
+
+(defun org-mouse-todo-menu (state)
+ "Create the menu with TODO keywords."
+ (append
+ (let ((kwds org-todo-keywords-1))
+ (org-mouse-keyword-menu
+ kwds
+ #'org-todo
+ (lambda (kwd) (equal state kwd))))))
+
+(defun org-mouse-tag-menu () ;todo
+ "Create the tags menu."
+ (append
+ (let ((tags (org-get-tags nil t)))
+ (org-mouse-keyword-menu
+ (sort (mapcar #'car (org-get-buffer-tags)) #'string-lessp)
+ (lambda (tag)
+ (org-mouse-set-tags
+ (sort (if (member tag tags)
+ (delete tag tags)
+ (cons tag tags))
+ #'string-lessp)))
+ (lambda (tag) (member tag tags))
+ ))
+ '("--"
+ ["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)
+ (org-set-tags tags))
+
+(defun org-mouse-insert-checkbox ()
+ (interactive)
+ (and (org-at-item-p)
+ (goto-char (match-end 0))
+ (unless (org-at-item-checkbox-p)
+ (delete-horizontal-space)
+ (insert " [ ] "))))
+
+(defun org-mouse-agenda-type (type)
+ (pcase type
+ (`tags "Tags: ")
+ (`todo "TODO: ")
+ (`tags-tree "Tags tree: ")
+ (`todo-tree "TODO tree: ")
+ (`occur-tree "Occur tree: ")
+ (_ "Agenda command ???")))
+
+(defun org-mouse-list-options-menu (alloptions &optional function)
+ (let ((options (save-match-data
+ (split-string (match-string-no-properties 1)))))
+ (print options)
+ (cl-loop for name in alloptions
+ collect
+ (vector name
+ `(progn
+ (replace-match
+ (mapconcat 'identity
+ (sort (if (member ',name ',options)
+ (delete ',name ',options)
+ (cons ',name ',options))
+ 'string-lessp)
+ " ")
+ nil nil nil 1)
+ (when (functionp ',function) (funcall ',function)))
+ :style 'toggle
+ :selected (and (member name options) t)))))
+
+(defun org-mouse-clip-text (text maxlength)
+ (if (> (length text) maxlength)
+ (concat (substring text 0 (- maxlength 3)) "...")
+ text))
+
+(defun org-mouse-popup-global-menu ()
+ (popup-menu
+ `("Main Menu"
+ ["Show Overview" org-mouse-show-overview t]
+ ["Show Headlines" org-mouse-show-headlines t]
+ ["Show All" org-show-all t]
+ ["Remove Highlights" org-remove-occur-highlights
+ :visible org-occur-highlights]
+ "--"
+ ["Check Deadlines"
+ (if (functionp 'org-check-deadlines-and-todos)
+ (org-check-deadlines-and-todos org-deadline-warning-days)
+ (org-check-deadlines org-deadline-warning-days))
+ t]
+ ["Check TODOs" org-show-todo-tree t]
+ ("Check Tags"
+ ,@(org-mouse-keyword-menu
+ (sort (mapcar #'car (org-get-buffer-tags)) #'string-lessp)
+ (lambda (tag) (org-tags-sparse-tree nil tag)))
+ "--"
+ ["Custom Tag ..." org-tags-sparse-tree t])
+ ["Check Phrase ..." org-occur]
+ "--"
+ ["Display Agenda" org-agenda-list t]
+ ["Display TODO List" org-todo-list t]
+ ("Display Tags"
+ ,@(org-mouse-keyword-menu
+ (sort (mapcar #'car (org-get-buffer-tags)) #'string-lessp)
+ (lambda (tag) (org-tags-view nil tag)))
+ "--"
+ ["Custom Tag ..." org-tags-view t])
+ ["Display Calendar" org-goto-calendar t]
+ "--"
+ ,@(org-mouse-keyword-menu
+ (mapcar #'car org-agenda-custom-commands)
+ (lambda (key)
+ (org-agenda nil (string-to-char key)))
+ nil
+ (lambda (key)
+ (let ((entry (assoc key org-agenda-custom-commands)))
+ (org-mouse-clip-text
+ (cond
+ ((stringp (nth 1 entry)) (nth 1 entry))
+ ((stringp (nth 2 entry))
+ (concat (org-mouse-agenda-type (nth 1 entry))
+ (nth 2 entry)))
+ (t "Agenda Command `%s'"))
+ 30))))
+ "--"
+ ["Delete Blank Lines" delete-blank-lines
+ :visible (org-mouse-empty-line)]
+ ["Insert Checkbox" org-mouse-insert-checkbox
+ :visible (and (org-at-item-p) (not (org-at-item-checkbox-p)))]
+ ["Insert Checkboxes"
+ (org-mouse-for-each-item 'org-mouse-insert-checkbox)
+ :visible (and (org-at-item-p) (not (org-at-item-checkbox-p)))]
+ ["Plain List to Outline" org-mouse-transform-to-outline
+ :visible (org-at-item-p)])))
+
+(defun org-mouse-get-context (contextlist context)
+ (let ((contextdata (assq context contextlist)))
+ (when contextdata
+ (save-excursion
+ (goto-char (nth 1 contextdata))
+ (re-search-forward ".*" (nth 2 contextdata))))))
+
+(defun org-mouse-for-each-item (funct)
+ ;; Functions called by `org-apply-on-list' need an argument.
+ (let ((wrap-fun (lambda (_) (funcall funct))))
+ (when (ignore-errors (goto-char (org-in-item-p)))
+ (save-excursion (org-apply-on-list wrap-fun nil)))))
+
+(defun org-mouse-bolp ()
+ "Return true if there only spaces, tabs, and `*' before point.
+This means, between the beginning of line and the point."
+ (save-excursion
+ (skip-chars-backward " \t*") (bolp)))
+
+(defun org-mouse-insert-item (text)
+ (cl-case (org-mouse-line-position)
+ (:beginning ; insert before
+ (beginning-of-line)
+ (looking-at "[ \t]*")
+ (open-line 1)
+ (indent-to-column (- (match-end 0) (match-beginning 0)))
+ (insert "+ "))
+ (:middle ; insert after
+ (end-of-line)
+ (newline t)
+ (indent-relative)
+ (insert "+ "))
+ (:end ; insert text here
+ (skip-chars-backward " \t")
+ (kill-region (point) (point-at-eol))
+ (unless (looking-back org-mouse-punctuation (line-beginning-position))
+ (insert (concat org-mouse-punctuation " ")))))
+ (insert text)
+ (beginning-of-line))
+
+(defadvice dnd-insert-text (around org-mouse-dnd-insert-text activate)
+ (if (derived-mode-p 'org-mode)
+ (org-mouse-insert-item text)
+ ad-do-it))
+
+(defadvice dnd-open-file (around org-mouse-dnd-open-file activate)
+ (if (derived-mode-p 'org-mode)
+ (org-mouse-insert-item uri)
+ ad-do-it))
+
+(defun org-mouse-match-closure (function)
+ (let ((match (match-data t)))
+ (lambda (&rest rest)
+ (save-match-data
+ (set-match-data match)
+ (apply function rest)))))
+
+(defun org-mouse-yank-link (click)
+ (interactive "e")
+ ;; Give temporary modes such as isearch a chance to turn off.
+ (run-hooks 'mouse-leave-buffer-hook)
+ (mouse-set-point click)
+ (setq mouse-selection-click-count 0)
+ (delete-horizontal-space)
+ (insert-for-yank (concat " [[" (current-kill 0) "]] ")))
+
+(defun org-mouse-context-menu (&optional event)
+ (let* ((stamp-prefixes (list org-deadline-string org-scheduled-string))
+ (contextlist (org-context))
+ (get-context (lambda (context) (org-mouse-get-context contextlist context))))
+ (cond
+ ((org-mouse-mark-active)
+ (let ((region-string (buffer-substring (region-beginning) (region-end))))
+ (popup-menu
+ `(nil
+ ["Sparse Tree" (org-occur ',region-string)]
+ ["Find in Buffer" (occur ',region-string)]
+ ["Grep in Current Dir"
+ (grep (format "grep -rnH -e '%s' *" ',region-string))]
+ ["Grep in Parent Dir"
+ (grep (format "grep -rnH -e '%s' ../*" ',region-string))]
+ "--"
+ ["Convert to Link"
+ (progn (save-excursion (goto-char (region-beginning)) (insert "[["))
+ (save-excursion (goto-char (region-end)) (insert "]]")))]
+ ["Insert Link Here" (org-mouse-yank-link ',event)]))))
+ ((save-excursion (beginning-of-line) (looking-at "[ \t]*#\\+STARTUP: \\(.*\\)"))
+ (popup-menu
+ `(nil
+ ,@(org-mouse-list-options-menu (mapcar #'car org-startup-options)
+ 'org-mode-restart))))
+ ((or (eolp)
+ (and (looking-at "\\( \\|\t\\)\\(\\+:[0-9a-zA-Z_:]+\\)?\\( \\|\t\\)+$")
+ (looking-back " \\|\t" (- (point) 2)
+ (line-beginning-position))))
+ (org-mouse-popup-global-menu))
+ ((funcall get-context :checkbox)
+ (popup-menu
+ '(nil
+ ["Toggle" org-toggle-checkbox t]
+ ["Remove" org-mouse-remove-match-and-spaces t]
+ ""
+ ["All Clear" (org-mouse-for-each-item
+ (lambda ()
+ (when (save-excursion (org-at-item-checkbox-p))
+ (replace-match "[ ] "))))]
+ ["All Set" (org-mouse-for-each-item
+ (lambda ()
+ (when (save-excursion (org-at-item-checkbox-p))
+ (replace-match "[X] "))))]
+ ["All Toggle" (org-mouse-for-each-item 'org-toggle-checkbox) t]
+ ["All Remove" (org-mouse-for-each-item
+ (lambda ()
+ (when (save-excursion (org-at-item-checkbox-p))
+ (org-mouse-remove-match-and-spaces))))]
+ )))
+ ((and (org-mouse-looking-at "\\b\\w+" "a-zA-Z0-9_")
+ (member (match-string 0) org-todo-keywords-1))
+ (popup-menu
+ `(nil
+ ,@(org-mouse-todo-menu (match-string 0))
+ "--"
+ ["Check TODOs" org-show-todo-tree t]
+ ["List all TODO keywords" org-todo-list t]
+ [,(format "List only %s" (match-string 0))
+ (org-todo-list (match-string 0)) t]
+ )))
+ ((and (org-mouse-looking-at "\\b[A-Z]+:" "A-Z")
+ (member (match-string 0) stamp-prefixes))
+ (popup-menu
+ `(nil
+ ,@(org-mouse-keyword-replace-menu stamp-prefixes)
+ "--"
+ ["Check Deadlines" org-check-deadlines t]
+ )))
+ ((org-mouse-looking-at org-mouse-priority-regexp "[]A-Z#") ; priority
+ (popup-menu `(nil ,@(org-mouse-keyword-replace-menu
+ (org-mouse-priority-list) 1 "Priority %s" t))))
+ ((funcall get-context :link)
+ (popup-menu
+ '(nil
+ ["Open" org-open-at-point t]
+ ["Open in Emacs" (org-open-at-point t) t]
+ "--"
+ ["Copy link" (org-kill-new (match-string 0))]
+ ["Cut link"
+ (progn
+ (kill-region (match-beginning 0) (match-end 0))
+ (just-one-space))]
+ "--"
+ ["Grep for TODOs"
+ (grep (format "grep -nH -i 'todo\\|fixme' %s*" (match-string 2)))]
+ ; ["Paste file link" ((insert "file:") (yank))]
+ )))
+ ((org-mouse-looking-at ":\\([A-Za-z0-9_]+\\):" "A-Za-z0-9_" -1) ;tags
+ (popup-menu
+ `(nil
+ [,(format-message "Display `%s'" (match-string 1))
+ (org-tags-view nil ,(match-string 1))]
+ [,(format-message "Sparse Tree `%s'" (match-string 1))
+ (org-tags-sparse-tree nil ,(match-string 1))]
+ "--"
+ ,@(org-mouse-tag-menu))))
+ ((org-at-timestamp-p 'lax)
+ (popup-menu
+ '(nil
+ ["Show Day" org-open-at-point t]
+ ["Change Timestamp" org-time-stamp t]
+ ["Delete Timestamp" (org-mouse-delete-timestamp) t]
+ ["Compute Time Range" org-evaluate-time-range (org-at-date-range-p)]
+ "--"
+ ["Set for Today" org-mouse-timestamp-today]
+ ["Set for Tomorrow" (org-mouse-timestamp-today 1 'day)]
+ ["Set in 1 Week" (org-mouse-timestamp-today 7 'day)]
+ ["Set in 2 Weeks" (org-mouse-timestamp-today 14 'day)]
+ ["Set in a Month" (org-mouse-timestamp-today 1 'month)]
+ "--"
+ ["+ 1 Day" (org-timestamp-change 1 'day)]
+ ["+ 1 Week" (org-timestamp-change 7 'day)]
+ ["+ 1 Month" (org-timestamp-change 1 'month)]
+ "--"
+ ["- 1 Day" (org-timestamp-change -1 'day)]
+ ["- 1 Week" (org-timestamp-change -7 'day)]
+ ["- 1 Month" (org-timestamp-change -1 'month)])))
+ ((funcall get-context :table-special)
+ (let ((mdata (match-data)))
+ (cl-incf (car mdata) 2)
+ (store-match-data mdata))
+ (message "match: %S" (match-string 0))
+ (popup-menu `(nil ,@(org-mouse-keyword-replace-menu
+ '(" " "!" "^" "_" "$" "#" "*" "'") 0
+ (lambda (mark)
+ (cl-case (string-to-char mark)
+ (? "( ) Nothing Special")
+ (?! "(!) Column Names")
+ (?^ "(^) Field Names Above")
+ (?_ "(^) Field Names Below")
+ (?$ "($) Formula Parameters")
+ (?# "(#) Recalculation: Auto")
+ (?* "(*) Recalculation: Manual")
+ (?' "(') Recalculation: None")))
+ t))))
+ ((assq :table contextlist)
+ (popup-menu
+ '(nil
+ ["Align Table" org-ctrl-c-ctrl-c]
+ ["Blank Field" org-table-blank-field]
+ ["Edit Field" org-table-edit-field]
+ "--"
+ ("Column"
+ ["Move Column Left" org-metaleft]
+ ["Move Column Right" org-metaright]
+ ["Delete Column" org-shiftmetaleft]
+ ["Insert Column" org-shiftmetaright]
+ "--"
+ ["Enable Narrowing" (setq org-table-limit-column-width (not org-table-limit-column-width)) :selected org-table-limit-column-width :style toggle])
+ ("Row"
+ ["Move Row Up" org-metaup]
+ ["Move Row Down" org-metadown]
+ ["Delete Row" org-shiftmetaup]
+ ["Insert Row" org-shiftmetadown]
+ ["Sort lines in region" org-table-sort-lines (org-at-table-p)]
+ "--"
+ ["Insert Hline" org-table-insert-hline])
+ ("Rectangle"
+ ["Copy Rectangle" org-copy-special]
+ ["Cut Rectangle" org-cut-special]
+ ["Paste Rectangle" org-paste-special]
+ ["Fill Rectangle" org-table-wrap-region])
+ "--"
+ ["Set Column Formula" org-table-eval-formula]
+ ["Set Field Formula" (org-table-eval-formula '(4))]
+ ["Edit Formulas" org-table-edit-formulas]
+ "--"
+ ["Recalculate Line" org-table-recalculate]
+ ["Recalculate All" (org-table-recalculate '(4))]
+ ["Iterate All" (org-table-recalculate '(16))]
+ "--"
+ ["Toggle Recalculate Mark" org-table-rotate-recalc-marks]
+ ["Sum Column/Rectangle" org-table-sum
+ :active (or (org-at-table-p) (org-region-active-p))]
+ ["Field Info" org-table-field-info]
+ ["Debug Formulas"
+ (setq org-table-formula-debug (not org-table-formula-debug))
+ :style toggle :selected org-table-formula-debug]
+ )))
+ ((and (assq :headline contextlist) (not (eolp)))
+ (let ((priority (org-mouse-get-priority t)))
+ (popup-menu
+ `("Headline Menu"
+ ("Tags and Priorities"
+ ,@(org-mouse-keyword-menu
+ (org-mouse-priority-list)
+ (lambda (keyword)
+ (org-mouse-set-priority (string-to-char keyword)))
+ priority "Priority %s")
+ "--"
+ ,@(org-mouse-tag-menu))
+ ("TODO Status"
+ ,@(org-mouse-todo-menu (org-get-todo-state)))
+ ["Show Tags"
+ (with-current-buffer org-mouse-main-buffer (org-agenda-show-tags))
+ :visible (not org-mouse-direct)]
+ ["Show Priority"
+ (with-current-buffer org-mouse-main-buffer (org-agenda-show-priority))
+ :visible (not org-mouse-direct)]
+ ,@(if org-mouse-direct '("--") nil)
+ ["New Heading" org-mouse-insert-heading :visible org-mouse-direct]
+ ["Set Deadline"
+ (progn (org-mouse-end-headline) (insert " ") (org-deadline))
+ :active (not (save-excursion
+ (org-mouse-re-search-line org-deadline-regexp)))]
+ ["Schedule Task"
+ (progn (org-mouse-end-headline) (insert " ") (org-schedule))
+ :active (not (save-excursion
+ (org-mouse-re-search-line org-scheduled-regexp)))]
+ ["Insert Timestamp"
+ (progn (org-mouse-end-headline) (insert " ") (org-time-stamp nil)) t]
+ ; ["Timestamp (inactive)" org-time-stamp-inactive t]
+ "--"
+ ["Archive Subtree" org-archive-subtree]
+ ["Cut Subtree" org-cut-special]
+ ["Copy Subtree" org-copy-special]
+ ["Paste Subtree" org-paste-special :visible org-mouse-direct]
+ ("Sort Children"
+ ["Alphabetically" (org-sort-entries nil ?a)]
+ ["Numerically" (org-sort-entries nil ?n)]
+ ["By Time/Date" (org-sort-entries nil ?t)]
+ "--"
+ ["Reverse Alphabetically" (org-sort-entries nil ?A)]
+ ["Reverse Numerically" (org-sort-entries nil ?N)]
+ ["Reverse By Time/Date" (org-sort-entries nil ?T)])
+ "--"
+ ["Move Trees" org-mouse-move-tree :active nil]
+ ))))
+ (t
+ (org-mouse-popup-global-menu)))))
+
+(defun org-mouse-mark-active ()
+ (and mark-active transient-mark-mode))
+
+(defun org-mouse-in-region-p (pos)
+ (and (org-mouse-mark-active)
+ (>= pos (region-beginning))
+ (< pos (region-end))))
+
+(defun org-mouse-down-mouse (event)
+ (interactive "e")
+ (setq this-command last-command)
+ (unless (and (= 1 (event-click-count event))
+ (org-mouse-in-region-p (posn-point (event-start event))))
+ (mouse-drag-region event)))
+
+(add-hook 'org-mode-hook
+ (lambda ()
+ (setq org-mouse-context-menu-function #'org-mouse-context-menu)
+
+ (when (memq 'context-menu org-mouse-features)
+ (org-defkey org-mouse-map [mouse-3] nil)
+ (org-defkey org-mode-map [mouse-3] #'org-mouse-show-context-menu))
+ (org-defkey org-mode-map [down-mouse-1] #'org-mouse-down-mouse)
+ (when (memq 'context-menu org-mouse-features)
+ (org-defkey org-mouse-map [C-drag-mouse-1] #'org-mouse-move-tree)
+ (org-defkey org-mouse-map [C-down-mouse-1] #'org-mouse-move-tree-start))
+ (when (memq 'yank-link org-mouse-features)
+ (org-defkey org-mode-map [S-mouse-2] #'org-mouse-yank-link)
+ (org-defkey org-mode-map [drag-mouse-3] #'org-mouse-yank-link))
+ (when (memq 'move-tree org-mouse-features)
+ (org-defkey org-mouse-map [drag-mouse-3] #'org-mouse-move-tree)
+ (org-defkey org-mouse-map [down-mouse-3] #'org-mouse-move-tree-start))
+
+ (when (memq 'activate-stars org-mouse-features)
+ (font-lock-add-keywords
+ nil
+ `((,org-outline-regexp
+ 0 `(face org-link mouse-face highlight keymap ,org-mouse-map)
+ 'prepend))
+ t))
+
+ (when (memq 'activate-bullets org-mouse-features)
+ (font-lock-add-keywords
+ nil
+ `(("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +"
+ (1 `(face org-link keymap ,org-mouse-map mouse-face highlight)
+ 'prepend)))
+ t))
+
+ (when (memq 'activate-checkboxes org-mouse-features)
+ (font-lock-add-keywords
+ nil
+ `(("^[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\)[ \t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\(\\[[- X]\\]\\)"
+ (1 `(face nil keymap ,org-mouse-map mouse-face highlight) prepend)))
+ t))
+
+ (defadvice org-open-at-point (around org-mouse-open-at-point activate)
+ (let ((context (org-context)))
+ (cond
+ ((assq :headline-stars context) (org-cycle))
+ ((assq :checkbox context) (org-toggle-checkbox))
+ ((assq :item-bullet context)
+ (let ((org-cycle-include-plain-lists t)) (org-cycle)))
+ ((org-footnote-at-reference-p) nil)
+ (t ad-do-it))))))
+
+(defun org-mouse-move-tree-start (_event)
+ (interactive "e")
+ (message "Same line: promote/demote, (***):move before, (text): make a child"))
+
+
+(defun org-mouse-make-marker (position)
+ (with-current-buffer (window-buffer (posn-window position))
+ (copy-marker (posn-point position))))
+
+(defun org-mouse-move-tree (event)
+ ;; todo: handle movements between different buffers
+ (interactive "e")
+ (save-excursion
+ (let* ((start (org-mouse-make-marker (event-start event)))
+ (end (org-mouse-make-marker (event-end event)))
+ (sbuf (marker-buffer start))
+ (ebuf (marker-buffer end)))
+
+ (when (and sbuf ebuf)
+ (set-buffer sbuf)
+ (goto-char start)
+ (org-back-to-heading)
+ (if (and (eq sbuf ebuf)
+ (equal
+ (point)
+ (save-excursion (goto-char end) (org-back-to-heading) (point))))
+ ;; if the same line then promote/demote
+ (if (>= end start) (org-demote-subtree) (org-promote-subtree))
+ ;; if different lines then move
+ (org-cut-subtree)
+
+ (set-buffer ebuf)
+ (goto-char end)
+ (org-back-to-heading)
+ (when (and (eq sbuf ebuf)
+ (equal
+ (point)
+ (save-excursion (goto-char start)
+ (org-back-to-heading) (point))))
+ (progn (org-end-of-subtree nil t)
+ (unless (eobp) (backward-char)))
+ (end-of-line)
+ (if (eobp) (newline) (forward-char)))
+
+ (when (looking-at org-outline-regexp)
+ (let ((level (- (match-end 0) (match-beginning 0))))
+ (when (> end (match-end 0))
+ (progn (org-end-of-subtree nil t)
+ (unless (eobp) (backward-char)))
+ (end-of-line)
+ (if (eobp) (newline) (forward-char))
+ (setq level (1+ level)))
+ (org-paste-subtree level)
+ (save-excursion
+ (progn (org-end-of-subtree nil t)
+ (unless (eobp) (backward-char)))
+ (when (bolp) (delete-char -1))))))))))
+
+
+(defun org-mouse-transform-to-outline ()
+ (interactive)
+ (org-back-to-heading)
+ (let ((minlevel 1000)
+ (replace-text (concat (match-string 0) "* ")))
+ (beginning-of-line 2)
+ (save-excursion
+ (while (not (or (eobp) (looking-at org-outline-regexp)))
+ (when (looking-at org-mouse-plain-list-regexp)
+ (setq minlevel (min minlevel (- (match-end 1) (match-beginning 1)))))
+ (forward-line)))
+ (while (not (or (eobp) (looking-at org-outline-regexp)))
+ (when (and (looking-at org-mouse-plain-list-regexp)
+ (eq minlevel (- (match-end 1) (match-beginning 1))))
+ (replace-match replace-text))
+ (forward-line))))
+
+(defvar org-mouse-cmd) ;dynamically scoped from `org-with-remote-undo'.
+
+(defun org-mouse-do-remotely (command)
+ ;; (org-agenda-check-no-diary)
+ (when (get-text-property (point) 'org-marker)
+ (let* ((anticol (- (point-at-eol) (point)))
+ (marker (get-text-property (point) 'org-marker))
+ (buffer (marker-buffer marker))
+ (pos (marker-position marker))
+ (hdmarker (get-text-property (point) 'org-hd-marker))
+ (buffer-read-only nil)
+ (newhead "--- removed ---")
+ (org-mouse-direct nil)
+ (org-mouse-main-buffer (current-buffer)))
+ (when (eq (with-current-buffer buffer major-mode) 'org-mode)
+ (let ((endmarker (with-current-buffer buffer
+ (org-end-of-subtree nil t)
+ (unless (eobp) (forward-char 1))
+ (point-marker))))
+ (org-with-remote-undo buffer
+ (with-current-buffer buffer
+ (widen)
+ (goto-char pos)
+ (org-show-hidden-entry)
+ (save-excursion
+ (and (outline-next-heading)
+ (org-flag-heading nil))) ; show the next heading
+ (org-back-to-heading)
+ (setq marker (point-marker))
+ (goto-char (max (point-at-bol) (- (point-at-eol) anticol)))
+ (funcall command)
+ (message "_cmd: %S" org-mouse-cmd)
+ (message "this-command: %S" this-command)
+ (unless (eq (marker-position marker) (marker-position endmarker))
+ (setq newhead (org-get-heading))))
+
+ (beginning-of-line 1)
+ (save-excursion
+ (org-agenda-change-all-lines newhead hdmarker 'fixface))))
+ t))))
+
+(defun org-mouse-agenda-context-menu (&optional _event)
+ (or (org-mouse-do-remotely 'org-mouse-context-menu)
+ (popup-menu
+ '("Agenda"
+ ("Agenda Files")
+ "--"
+ ["Undo" (progn (message "last command: %S" last-command) (setq this-command 'org-agenda-undo) (org-agenda-undo))
+ :visible (if (eq last-command 'org-agenda-undo)
+ org-agenda-pending-undo-list
+ org-agenda-undo-list)]
+ ["Rebuild Buffer" org-agenda-redo t]
+ ["New Diary Entry"
+ org-agenda-diary-entry (org-agenda-check-type nil 'agenda) t]
+ "--"
+ ["Goto Today" org-agenda-goto-today
+ (org-agenda-check-type nil 'agenda) t]
+ ["Display Calendar" org-agenda-goto-calendar
+ (org-agenda-check-type nil 'agenda) t]
+ ("Calendar Commands"
+ ["Phases of the Moon" org-agenda-phases-of-moon
+ (org-agenda-check-type nil 'agenda)]
+ ["Sunrise/Sunset" org-agenda-sunrise-sunset
+ (org-agenda-check-type nil 'agenda)]
+ ["Holidays" org-agenda-holidays
+ (org-agenda-check-type nil 'agenda)]
+ ["Convert" org-agenda-convert-date
+ (org-agenda-check-type nil 'agenda)]
+ "--"
+ ["Create iCalendar file" org-icalendar-combine-agenda-files t])
+ "--"
+ ["Day View" org-agenda-day-view
+ :active (org-agenda-check-type nil 'agenda)
+ :style radio :selected (eq org-agenda-current-span 'day)]
+ ["Week View" org-agenda-week-view
+ :active (org-agenda-check-type nil 'agenda)
+ :style radio :selected (eq org-agenda-current-span 'week)]
+ "--"
+ ["Show Logbook entries" org-agenda-log-mode
+ :style toggle :selected org-agenda-show-log
+ :active (org-agenda-check-type nil 'agenda)]
+ ["Include Diary" org-agenda-toggle-diary
+ :style toggle :selected org-agenda-include-diary
+ :active (org-agenda-check-type nil 'agenda)]
+ ["Use Time Grid" org-agenda-toggle-time-grid
+ :style toggle :selected org-agenda-use-time-grid
+ :active (org-agenda-check-type nil 'agenda)]
+ ["Follow Mode" org-agenda-follow-mode
+ :style toggle :selected org-agenda-follow-mode]
+ "--"
+ ["Quit" org-agenda-quit t]
+ ["Exit and Release Buffers" org-agenda-exit t]
+ ))))
+
+(defun org-mouse-get-gesture (event)
+ (let ((startxy (posn-x-y (event-start event)))
+ (endxy (posn-x-y (event-end event))))
+ (if (< (car startxy) (car endxy)) :right :left)))
+
+
+ ; (setq org-agenda-mode-hook nil)
+(defvar org-agenda-mode-map)
+(add-hook 'org-agenda-mode-hook
+ (lambda ()
+ (setq org-mouse-context-menu-function #'org-mouse-agenda-context-menu)
+ (org-defkey org-agenda-mode-map [mouse-3] #'org-mouse-show-context-menu)
+ (org-defkey org-agenda-mode-map [down-mouse-3] #'org-mouse-move-tree-start)
+ (org-defkey org-agenda-mode-map [C-mouse-4] #'org-agenda-earlier)
+ (org-defkey org-agenda-mode-map [C-mouse-5] #'org-agenda-later)
+ (org-defkey org-agenda-mode-map [drag-mouse-3]
+ (lambda (event) (interactive "e")
+ (cl-case (org-mouse-get-gesture event)
+ (:left (org-agenda-earlier 1))
+ (:right (org-agenda-later 1)))))))
+
+(provide 'org-mouse)
+
+;;; org-mouse.el ends here
diff --git a/elpa/org-9.5.2/org-mouse.elc b/elpa/org-9.5.2/org-mouse.elc
new file mode 100644
index 0000000..207ed19
--- /dev/null
+++ b/elpa/org-9.5.2/org-mouse.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-num.el b/elpa/org-9.5.2/org-num.el
new file mode 100644
index 0000000..f00e6c4
--- /dev/null
+++ b/elpa/org-9.5.2/org-num.el
@@ -0,0 +1,476 @@
+;;; org-num.el --- Dynamic Headlines Numbering -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library provides dynamic numbering for Org headlines. Use
+;;
+;; <M-x org-num-mode>
+;;
+;; to toggle it.
+;;
+;; You can select what is numbered according to level, tags, COMMENT
+;; keyword, or UNNUMBERED property. You can also skip footnotes
+;; sections. See `org-num-max-level', `org-num-skip-tags',
+;; `org-num-skip-commented', `org-num-skip-unnumbered', and
+;; `org-num-skip-footnotes' for details.
+;;
+;; You can also control how the numbering is displayed by setting
+;;`org-num-face' and `org-num-format-function'.
+;;
+;; Internally, the library handles an ordered list, per buffer
+;; position, of overlays in `org-num--overlays'. These overlays are
+;; marked with the `org-num' property set to a non-nil value.
+;;
+;; Overlays store the level of the headline in the `level' property,
+;; and the face used for the numbering in `numbering-face'.
+;;
+;; The `skip' property is set to t when the corresponding headline has
+;; some characteristic -- e.g., a node property, or a tag -- that
+;; prevents it from being numbered.
+;;
+;; An overlay with `org-num' property set to `invalid' is called an
+;; invalid overlay. Modified overlays automatically become invalid
+;; and set `org-num--invalid-flag' to a non-nil value. After
+;; a change, `org-num--invalid-flag' indicates numbering needs to be
+;; updated and invalid overlays indicate where the buffer needs to be
+;; parsed. So does `org-num--missing-overlay' variable. See
+;; `org-num--verify' function for details.
+;;
+;; Numbering display is done through the `after-string' property.
+
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'org-macs)
+(require 'org) ;Otherwise `org-num--comment-re' burps on `org-comment-string'
+
+(defvar org-comment-string)
+(defvar org-complex-heading-regexp)
+(defvar org-cycle-level-faces)
+(defvar org-footnote-section)
+(defvar org-level-faces)
+(defvar org-n-level-faces)
+(defvar org-odd-levels-only)
+
+(declare-function org-back-to-heading "org" (&optional invisible-ok))
+(declare-function org-entry-get "org" (pom property &optional inherit literal-nil))
+(declare-function org-reduced-level "org" (l))
+
+
+;;; Customization
+
+(defcustom org-num-face nil
+ "Face to use for numbering.
+When nil, use the same face as the headline. This value is
+ignored if `org-num-format-function' specifies a face for its
+output."
+ :group 'org-appearance
+ :package-version '(Org . "9.3")
+ :type '(choice (const :tag "Like the headline" nil)
+ (face :tag "Use face"))
+ :safe (lambda (val) (or (null val) (facep val))))
+
+(defcustom org-num-format-function #'org-num-default-format
+ "Function used to display numbering.
+It is called with one argument, a list of numbers, and should
+return a string, or nil. When nil, no numbering is displayed.
+Any `face' text property on the returned string overrides
+`org-num-face'."
+ :group 'org-appearance
+ :package-version '(Org . "9.3")
+ :type 'function)
+
+(defcustom org-num-max-level nil
+ "Level below which headlines are not numbered.
+When set to nil, all headlines are numbered."
+ :group 'org-appearance
+ :package-version '(Org . "9.3")
+ :type '(choice (const :tag "Number everything" nil)
+ (integer :tag "Stop numbering at level"))
+ :safe (lambda (val) (or (null val) (wholenump val))))
+
+(defcustom org-num-skip-commented nil
+ "Non-nil means commented sub-trees are not numbered."
+ :group 'org-appearance
+ :package-version '(Org . "9.3")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-num-skip-footnotes nil
+ "Non-nil means footnotes sections are not numbered."
+ :group 'org-appearance
+ :package-version '(Org . "9.3")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-num-skip-tags nil
+ "List of tags preventing the numbering of sub-trees.
+
+For example, add \"ARCHIVE\" to this list to avoid numbering
+archived sub-trees.
+
+Tag in this list prevent numbering the whole sub-tree,
+irrespective to `org-use-tag-inheritance', or other means to
+control tag inheritance."
+ :group 'org-appearance
+ :package-version '(Org . "9.3")
+ :type '(repeat (string :tag "Tag"))
+ :safe (lambda (val) (and (listp val) (cl-every #'stringp val))))
+
+(defcustom org-num-skip-unnumbered nil
+ "Non-nil means numbering obeys to UNNUMBERED property."
+ :group 'org-appearance
+ :package-version '(Org . "9.3")
+ :type 'boolean
+ :safe #'booleanp)
+
+
+;;; Internal Variables
+
+(defconst org-num--comment-re (format "\\`%s\\(?: \\|$\\)" org-comment-string)
+ "Regexp matching a COMMENT keyword at headline beginning.")
+
+(defvar-local org-num--overlays nil
+ "Ordered list of overlays used for numbering outlines.")
+
+(defvar-local org-num--skip-level nil
+ "Level below which headlines from current tree are not numbered.
+When nil, all headlines are numbered. It is used to handle
+inheritance of no-numbering attributes.")
+
+(defvar-local org-num--numbering nil
+ "Current headline numbering.
+A numbering is a list of integers, in reverse order. So numbering
+for headline \"1.2.3\" is (3 2 1).")
+
+(defvar-local org-num--missing-overlay nil
+ "Buffer position signaling a headline without an overlay.")
+
+(defvar-local org-num--invalid-flag nil
+ "Non-nil means an overlay became invalid since last update.")
+
+
+;;; Internal Functions
+
+(defsubst org-num--headline-regexp ()
+ "Return regexp matching a numbered headline."
+ (if (null org-num-max-level) (org-with-limited-levels org-outline-regexp-bol)
+ (format "^\\*\\{1,%d\\} "
+ (if org-odd-levels-only (1- (* 2 org-num-max-level))
+ org-num-max-level))))
+
+(defsubst org-num--overlay-p (o)
+ "Non-nil if overlay O is a numbering overlay."
+ (overlay-get o 'org-num))
+
+(defsubst org-num--valid-overlay-p (o)
+ "Non-nil if overlay O is still active in the buffer."
+ (not (eq 'invalid (overlay-get o 'org-num))))
+
+(defsubst org-num--invalidate-overlay (o)
+ "Mark overlay O as invalid.
+Update `org-num--invalid-flag' accordingly."
+ (overlay-put o 'org-num 'invalid)
+ (setq org-num--invalid-flag t))
+
+(defun org-num--clear ()
+ "Remove all numbering overlays in current buffer."
+ (mapc #'delete-overlay org-num--overlays)
+ (setq org-num--overlays nil))
+
+(defun org-num--make-overlay (numbering level skip)
+ "Return overlay for numbering headline at point.
+
+NUMBERING is the numbering to use, as a list of integers, or nil
+if nothing should be displayed. LEVEL is the level of the
+headline. SKIP is its skip value.
+
+Assume point is at a headline."
+ (let ((after-edit-functions
+ (list (lambda (o &rest _) (org-num--invalidate-overlay o))))
+ (o (save-excursion
+ (beginning-of-line)
+ (skip-chars-forward "*")
+ (make-overlay (line-beginning-position) (1+ (point))))))
+ (overlay-put o 'org-num t)
+ (overlay-put o 'skip skip)
+ (overlay-put o 'level level)
+ (overlay-put o 'numbering-face
+ (or org-num-face
+ ;; Compute face that would be used at the
+ ;; headline. We cannot extract it from the
+ ;; buffer: at the time the overlay is created,
+ ;; Font Lock has not proceeded yet.
+ (nth (if org-cycle-level-faces
+ (% (1- level) org-n-level-faces)
+ (1- (min level org-n-level-faces)))
+ org-level-faces)))
+ (overlay-put o 'modification-hooks after-edit-functions)
+ (overlay-put o 'insert-in-front-hooks after-edit-functions)
+ (org-num--refresh-display o numbering)
+ o))
+
+(defun org-num--refresh-display (overlay numbering)
+ "Refresh OVERLAY's display.
+NUMBERING specifies the new numbering, as a list of integers, or
+nil if nothing should be displayed. Assume OVERLAY is valid."
+ (let ((display (and numbering
+ (funcall org-num-format-function (reverse numbering)))))
+ (when (and display (not (get-text-property 0 'face display)))
+ (org-add-props display `(face ,(overlay-get overlay 'numbering-face))))
+ (overlay-put overlay 'after-string display)))
+
+(defun org-num--skip-value ()
+ "Return skip value for headline at point.
+Value is t when headline should not be numbered, and nil
+otherwise."
+ (org-match-line org-complex-heading-regexp)
+ (let ((title (match-string 4))
+ (tags (and org-num-skip-tags
+ (match-end 5)
+ (org-split-string (match-string 5) ":"))))
+ (or (and org-num-skip-footnotes
+ org-footnote-section
+ (equal title org-footnote-section))
+ (and org-num-skip-commented
+ title
+ (let ((case-fold-search nil))
+ (string-match org-num--comment-re title))
+ t)
+ (and org-num-skip-tags
+ (cl-some (lambda (tag) (member tag org-num-skip-tags))
+ tags)
+ t)
+ (and org-num-skip-unnumbered
+ (org-entry-get (point) "UNNUMBERED")
+ t))))
+
+(defun org-num--current-numbering (level skip)
+ "Return numbering for current headline.
+LEVEL is headline's level, and SKIP its skip value. Return nil
+if headline should be skipped."
+ (cond
+ ;; Skipped by inheritance.
+ ((and org-num--skip-level (> level org-num--skip-level)) nil)
+ ;; Skipped by a non-nil skip value; set `org-num--skip-level'
+ ;; to skip the whole sub-tree later on.
+ (skip (setq org-num--skip-level level) nil)
+ (t
+ (setq org-num--skip-level nil)
+ ;; Compute next numbering, and update `org-num--numbering'.
+ (let ((last-level (length org-num--numbering)))
+ (setq org-num--numbering
+ (cond
+ ;; First headline : nil => (1), or (1 0)...
+ ((null org-num--numbering) (cons 1 (make-list (1- level) 0)))
+ ;; Sibling: (1 1) => (2 1).
+ ((= level last-level)
+ (cons (1+ (car org-num--numbering)) (cdr org-num--numbering)))
+ ;; Parent: (1 1 1) => (2 1), or (2).
+ ((< level last-level)
+ (let ((suffix (nthcdr (- last-level level) org-num--numbering)))
+ (cons (1+ (car suffix)) (cdr suffix))))
+ ;; Child: (1 1) => (1 1 1), or (1 0 1 1)...
+ (t
+ (append (cons 1 (make-list (- level last-level 1) 0))
+ org-num--numbering))))))))
+
+(defun org-num--number-region (start end)
+ "Add numbering overlays between START and END positions.
+When START or END are nil, use buffer boundaries. Narrowing, if
+any, is ignored. Return the list of created overlays, newest
+first."
+ (org-with-point-at (or start 1)
+ ;; Do not match headline starting at START.
+ (when start (end-of-line))
+ (let ((regexp (org-num--headline-regexp))
+ (new nil))
+ (while (re-search-forward regexp end t)
+ (let* ((level (org-reduced-level
+ (- (match-end 0) (match-beginning 0) 1)))
+ (skip (org-num--skip-value))
+ (numbering (org-num--current-numbering level skip)))
+ ;; Apply numbering to current headline. Store overlay for
+ ;; the return value.
+ (push (org-num--make-overlay numbering level skip)
+ new)))
+ new)))
+
+(defun org-num--update ()
+ "Update buffer's numbering.
+This function removes invalid overlays and refreshes numbering
+for the valid ones in the numbering overlays list. It also adds
+missing overlays to that list."
+ (setq org-num--skip-level nil)
+ (setq org-num--numbering nil)
+ (let ((new-overlays nil)
+ (overlay nil))
+ (while (setq overlay (pop org-num--overlays))
+ (cond
+ ;; Valid overlay.
+ ;;
+ ;; First handle possible missing overlays OVERLAY. If missing
+ ;; overlay marker is pointing before next overlay and after the
+ ;; last known overlay, make sure to parse the buffer between
+ ;; these two overlays.
+ ((org-num--valid-overlay-p overlay)
+ (let ((next (overlay-start overlay))
+ (last (and new-overlays (overlay-start (car new-overlays)))))
+ (cond
+ ((null org-num--missing-overlay))
+ ((> org-num--missing-overlay next))
+ ((or (null last) (> org-num--missing-overlay last))
+ (setq org-num--missing-overlay nil)
+ (setq new-overlays (nconc (org-num--number-region last next)
+ new-overlays)))
+ ;; If it is already after the last known overlay, reset it:
+ ;; some previous invalid overlay already triggered the
+ ;; necessary parsing.
+ (t
+ (setq org-num--missing-overlay nil))))
+ ;; Update OVERLAY's numbering.
+ (let* ((level (overlay-get overlay 'level))
+ (skip (overlay-get overlay 'skip))
+ (numbering (org-num--current-numbering level skip)))
+ (org-num--refresh-display overlay numbering)
+ (push overlay new-overlays)))
+ ;; Invalid overlay. It indicates that the buffer needs to be
+ ;; parsed again between the two surrounding valid overlays or
+ ;; buffer boundaries.
+ (t
+ ;; Delete all consecutive invalid overlays: we re-create all
+ ;; overlays between last valid overlay and the next one.
+ (delete-overlay overlay)
+ (while (and org-num--overlays
+ (not (org-num--valid-overlay-p (car org-num--overlays))))
+ (delete-overlay (pop org-num--overlays)))
+ ;; Create and register new overlays.
+ (let ((last (and new-overlays (overlay-start (car new-overlays))))
+ (next (and org-num--overlays
+ (overlay-start (car org-num--overlays)))))
+ (setq new-overlays (nconc (org-num--number-region last next)
+ new-overlays))))))
+ ;; If invalid position hasn't been handled yet, it must be located
+ ;; between last valid overlay and end of the buffer. Parse that
+ ;; area before returning.
+ (when org-num--missing-overlay
+ (let ((last (and new-overlays (overlay-start (car new-overlays)))))
+ (setq new-overlays (nconc (org-num--number-region last nil)
+ new-overlays))))
+ ;; Numbering is now up-to-date. Reset invalid flag. Also return
+ ;; `org-num--overlays' in a sorted fashion.
+ (setq org-num--invalid-flag nil)
+ (setq org-num--overlays (nreverse new-overlays))))
+
+(defun org-num--verify (beg end _)
+ "Check numbering integrity; update it if necessary.
+This function is meant to be used in `after-change-functions'.
+See this variable for the meaning of BEG and END."
+ (setq org-num--missing-overlay nil)
+ (save-match-data
+ (org-with-point-at beg
+ (let ((regexp (org-num--headline-regexp)))
+ ;; At this point, directly altered overlays between BEG and
+ ;; END are marked as invalid and will trigger a full update.
+ ;; However, there are still two cases to handle.
+ ;;
+ ;; First, some valid overlays may need to be invalidated, due
+ ;; to an indirect change. That happens when the skip value --
+ ;; see `org-num--skip-value' -- of the heading BEG belongs to
+ ;; is altered, or when deleting the newline character right
+ ;; before the next headline.
+ (save-excursion
+ ;; Bail out if we're before first headline or within
+ ;; a headline too deep to be numbered.
+ (when (and (org-with-limited-levels
+ (ignore-errors (org-back-to-heading t)))
+ (looking-at regexp))
+ (pcase (get-char-property-and-overlay (point) 'org-num)
+ (`(nil)
+ ;; At a headline, without a numbering overlay: change
+ ;; just created one. Mark it for parsing.
+ (setq org-num--missing-overlay (point)))
+ (`(t . ,o)
+ ;; Check if skip value changed. Invalidate overlay
+ ;; accordingly.
+ (unless (eq (org-num--skip-value) (overlay-get o 'skip))
+ (org-num--invalidate-overlay o)))
+ (_ nil))))
+ ;; Deleting the newline character before a numbering overlay
+ ;; doesn't invalidate it, even though it could land in the
+ ;; middle of a line. Be sure to catch this case.
+ (when (and (= beg end) (not (bolp)))
+ (pcase (get-char-property-and-overlay (point) 'org-num)
+ (`(t . ,o) (org-num--invalidate-overlay o))
+ (_ nil)))
+ ;; Second, if nothing is marked as invalid, and therefore if
+ ;; no full update is due so far, changes may still have
+ ;; created new headlines, at BEG -- which is actually handled
+ ;; by the previous phase --, or, in case of a multi-line
+ ;; insertion, at END, or in-between.
+ (unless (or org-num--invalid-flag
+ org-num--missing-overlay
+ (<= end (line-end-position))) ;single line change
+ (forward-line)
+ (when (or (re-search-forward regexp end 'move)
+ ;; Check if change created a headline after END.
+ (progn (skip-chars-backward "*") (looking-at regexp)))
+ (setq org-num--missing-overlay (line-beginning-position))))))
+ ;; Update numbering only if a headline was altered or created.
+ (when (or org-num--missing-overlay org-num--invalid-flag)
+ (org-num--update))))
+
+
+;;; Public Functions
+
+;;;###autoload
+(defun org-num-default-format (numbering)
+ "Default numbering display function.
+NUMBERING is a list of numbers."
+ (concat (mapconcat #'number-to-string numbering ".") " "))
+
+;;;###autoload
+(define-minor-mode org-num-mode
+ "Dynamic numbering of headlines in an Org buffer."
+ :lighter " o#"
+ (cond
+ (org-num-mode
+ (unless (derived-mode-p 'org-mode)
+ (user-error "Cannot activate headline numbering outside Org mode"))
+ (setq org-num--numbering nil)
+ (setq org-num--overlays (nreverse (org-num--number-region nil nil)))
+ (add-hook 'after-change-functions #'org-num--verify nil t)
+ (add-hook 'change-major-mode-hook #'org-num--clear nil t))
+ (t
+ (org-num--clear)
+ (remove-hook 'after-change-functions #'org-num--verify t)
+ (remove-hook 'change-major-mode-hook #'org-num--clear t))))
+
+(provide 'org-num)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-num.el ends here
diff --git a/elpa/org-9.5.2/org-num.elc b/elpa/org-9.5.2/org-num.elc
new file mode 100644
index 0000000..72a882d
--- /dev/null
+++ b/elpa/org-9.5.2/org-num.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-pcomplete.el b/elpa/org-9.5.2/org-pcomplete.el
new file mode 100644
index 0000000..b31dc33
--- /dev/null
+++ b/elpa/org-9.5.2/org-pcomplete.el
@@ -0,0 +1,451 @@
+;;; org-pcomplete.el --- In-buffer Completion Code -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+;;
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; John Wiegley <johnw at gnu dot org>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+;;;; Require other packages
+
+(require 'org-macs)
+(require 'org-compat)
+(require 'pcomplete)
+
+(declare-function org-at-heading-p "org" (&optional ignored))
+(declare-function org-babel-combine-header-arg-lists "ob-core" (original &rest others))
+(declare-function org-babel-get-src-block-info "ob-core" (&optional light datum))
+(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-link-heading-search-string "ol" (&optional string))
+(declare-function org-tag-alist-to-string "org" (alist &optional skip-key))
+
+(defvar org-babel-common-header-args-w-values)
+(defvar org-current-tag-alist)
+(defvar org-priority-default)
+(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-priority-highest)
+(defvar org-link-abbrev-alist)
+(defvar org-link-abbrev-alist-local)
+(defvar org-priority-lowest)
+(defvar org-options-keywords)
+(defvar org-outline-regexp)
+(defvar org-property-re)
+(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 ((line-to-here (org-current-line-string t))
+ (case-fold-search t))
+ (cond
+ ;; Parameters on a clock table opening line.
+ ((org-match-line "[ \t]*#\\+BEGIN: clocktable[ \t]")
+ (cons "block-option" "clocktable"))
+ ;; Flags and parameters on a source block opening line.
+ ((org-match-line "[ \t]*#\\+BEGIN_SRC[ \t]")
+ (cons "block-option" "src"))
+ ;; Value for a known keyword.
+ ((org-match-line "[ \t]*#\\+\\(\\S-+\\):")
+ (cons "file-option" (match-string-no-properties 1)))
+ ;; Keyword name.
+ ((and (org-match-line "[ \t]*#\\+[a-zA-Z_]*$")
+ (looking-at-p "[ \t]*$"))
+ (cons "file-option" nil))
+ ;; Link abbreviation.
+ ((save-excursion
+ (skip-chars-backward "-A-Za-z0-9_")
+ (and (eq ?\[ (char-before))
+ (eq ?\[ (char-before (1- (point))))))
+ (cons "link" nil))
+ ;; 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))
+ ;; 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))
+ ;; 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))
+ ;; 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
+\"file-option/startup\"."
+ (let ((thing (org-thing-at-point)))
+ (cond
+ ((string= "file-option" (car thing))
+ (concat (car thing)
+ (and (cdr thing) (concat "/" (downcase (cdr thing))))))
+ ((string= "block-option" (car thing))
+ (concat (car thing) "/" (downcase (cdr thing))))
+ (t (car thing)))))
+
+(defun org-parse-arguments ()
+ "Parse whitespace separated arguments in the current region."
+ (let ((begin (line-beginning-position))
+ (end (line-end-position))
+ begins args)
+ (save-restriction
+ (narrow-to-region begin end)
+ (save-excursion
+ (goto-char (point-min))
+ (while (not (eobp))
+ (skip-chars-forward " \t\n[")
+ (setq begins (cons (point) begins))
+ (skip-chars-forward "^ \t\n[")
+ (setq args (cons (buffer-substring-no-properties
+ (car begins) (point))
+ args)))
+ (cons (reverse args) (reverse begins))))))
+
+(defun org-pcomplete-initial ()
+ "Call the right completion function for first argument completions."
+ (ignore
+ (funcall (or (pcomplete-find-completion-function
+ (car (org-thing-at-point)))
+ pcomplete-default-completion-function))))
+
+
+;;; Completion functions
+
+(defun pcomplete/org-mode/file-option ()
+ "Complete against all valid file options."
+ (require 'org-element)
+ (pcomplete-here
+ (org-pcomplete-case-double
+ (append (mapcar (lambda (keyword) (concat keyword " "))
+ org-options-keywords)
+ (mapcar (lambda (keyword) (concat keyword ": "))
+ org-element-affiliated-keywords)
+ (let (block-names)
+ (dolist (name
+ '("CENTER" "COMMENT" "EXAMPLE" "EXPORT" "QUOTE" "SRC"
+ "VERSE")
+ block-names)
+ (push (format "END_%s" name) block-names)
+ (push (concat "BEGIN_"
+ name
+ ;; Since language is compulsory in
+ ;; export blocks source blocks, add
+ ;; a space.
+ (and (member name '("EXPORT" "SRC")) " "))
+ block-names)
+ (push (format "ATTR_%s: " name) block-names)))
+ (mapcar (lambda (keyword) (concat keyword ": "))
+ (org-get-export-keywords))))
+ (substring pcomplete-stub 2)))
+
+(defun pcomplete/org-mode/file-option/author ()
+ "Complete arguments for the #+AUTHOR file option."
+ (pcomplete-here (list user-full-name)))
+
+(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)))))
+
+(defun pcomplete/org-mode/file-option/email ()
+ "Complete arguments for the #+EMAIL file option."
+ (pcomplete-here (list user-mail-address)))
+
+(defun pcomplete/org-mode/file-option/exclude_tags ()
+ "Complete arguments for the #+EXCLUDE_TAGS file option."
+ (require 'ox)
+ (pcomplete-here
+ (and org-export-exclude-tags
+ (list (mapconcat #'identity org-export-exclude-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 " "))))
+
+(defun pcomplete/org-mode/file-option/language ()
+ "Complete arguments for the #+LANGUAGE file option."
+ (require 'ox)
+ (pcomplete-here
+ (pcomplete-uniquify-list
+ (list org-export-default-language "en"))))
+
+(defun pcomplete/org-mode/file-option/priorities ()
+ "Complete arguments for the #+PRIORITIES file option."
+ (pcomplete-here (list (format "%c %c %c"
+ org-priority-highest
+ org-priority-lowest
+ org-priority-default))))
+
+(defun pcomplete/org-mode/file-option/select_tags ()
+ "Complete arguments for the #+SELECT_TAGS file option."
+ (require 'ox)
+ (pcomplete-here
+ (and org-export-select-tags
+ (list (mapconcat #'identity org-export-select-tags " ")))))
+
+(defun pcomplete/org-mode/file-option/startup ()
+ "Complete arguments for the #+STARTUP file option."
+ (while (pcomplete-here
+ (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.
+ (dolist (arg pcomplete-args)
+ (cond
+ ((string= arg "hidestars")
+ (setq opts (delete "showstars" opts)))))
+ opts))))
+
+(defun pcomplete/org-mode/file-option/tags ()
+ "Complete arguments for the #+TAGS file option."
+ (pcomplete-here
+ (list (org-tag-alist-to-string org-current-tag-alist))))
+
+(defun pcomplete/org-mode/file-option/title ()
+ "Complete arguments for the #+TITLE file option."
+ (pcomplete-here
+ (let ((visited-file (buffer-file-name (buffer-base-buffer))))
+ (list (or (and visited-file
+ (file-name-sans-extension
+ (file-name-nondirectory visited-file)))
+ (buffer-name (buffer-base-buffer)))))))
+
+
+(defun pcomplete/org-mode/file-option/options ()
+ "Complete arguments for the #+OPTIONS file option."
+ (while (pcomplete-here
+ (pcomplete-uniquify-list
+ (append
+ ;; Hard-coded OPTION items always available.
+ '("H:" "\\n:" "num:" "timestamp:" "arch:" "author:" "c:"
+ "creator:" "date:" "d:" "email:" "*:" "e:" "::" "f:"
+ "inline:" "tex:" "p:" "pri:" "':" "-:" "stat:" "^:" "toc:"
+ "|:" "tags:" "tasks:" "<:" "todo:")
+ ;; OPTION items from registered back-ends.
+ (let (items)
+ (dolist (backend (bound-and-true-p
+ org-export-registered-backends))
+ (dolist (option (org-export-backend-options backend))
+ (let ((item (nth 2 option)))
+ (when item (push (concat item ":") items)))))
+ items))))))
+
+(defun pcomplete/org-mode/file-option/infojs_opt ()
+ "Complete arguments for the #+INFOJS_OPT file option."
+ (while (pcomplete-here
+ (pcomplete-uniquify-list
+ (mapcar (lambda (item) (format "%s:" (car item)))
+ (bound-and-true-p org-html-infojs-opts-table))))))
+
+(defun pcomplete/org-mode/file-option/bind ()
+ "Complete arguments for the #+BIND file option, which are variable names."
+ (let (vars)
+ (mapatoms
+ (lambda (a) (when (boundp a) (setq vars (cons (symbol-name a) vars)))))
+ (pcomplete-here vars)))
+
+(defun pcomplete/org-mode/link ()
+ "Complete against defined #+LINK patterns."
+ (pcomplete-here
+ (pcomplete-uniquify-list
+ (copy-sequence
+ (mapcar (lambda (e) (concat (car e) ":"))
+ (append org-link-abbrev-alist-local
+ org-link-abbrev-alist))))))
+
+(defun pcomplete/org-mode/tex ()
+ "Complete against TeX-style HTML entity names."
+ (require 'org-entities)
+ (while (pcomplete-here
+ (pcomplete-uniquify-list
+ (remove nil (mapcar #'car-safe org-entities)))
+ (substring pcomplete-stub 1))))
+
+(defun pcomplete/org-mode/todo ()
+ "Complete against known TODO keywords."
+ (pcomplete-here (pcomplete-uniquify-list (copy-sequence org-todo-keywords-1))))
+
+(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)
+ (while (re-search-forward org-outline-regexp nil t)
+ ;; Remove the leading asterisk from
+ ;; `org-link-heading-search-string' result.
+ (push (substring (org-link-heading-search-string) 1) 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-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 nil t))
+ (setq lst (delete tag lst)))
+ lst))
+ (and (string-match ".*:" pcomplete-stub)
+ (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
+ (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 source block.
+Complete a language in the first field, the header arguments and
+switches."
+ (pcomplete-here
+ (mapcar
+ (lambda(x) (symbol-name (nth 3 x)))
+ (cdr (car (cdr (memq :key-type (plist-get
+ (symbol-plist
+ 'org-babel-load-languages)
+ 'custom-type)))))))
+ (let* ((info (org-babel-get-src-block-info 'light))
+ (lang (car info))
+ (lang-headers (intern (concat "org-babel-header-args:" lang)))
+ (headers (org-babel-combine-header-arg-lists
+ org-babel-common-header-args-w-values
+ (and (boundp lang-headers) (eval lang-headers t)))))
+ (while (pcomplete-here
+ (append (mapcar
+ (lambda (arg) (format ":%s" (symbol-name (car arg))))
+ headers)
+ '("-n" "-r" "-l"))))))
+
+(defun pcomplete/org-mode/block-option/clocktable ()
+ "Complete keywords in a clocktable line."
+ (while (pcomplete-here '(":maxlevel" ":scope" ":lang"
+ ":tstart" ":tend" ":block" ":step"
+ ":stepskip0" ":fileskip0"
+ ":emphasize" ":link" ":narrow" ":indent"
+ ":hidefiles" ":tcolumns" ":level" ":compact"
+ ":timestamp" ":formula" ":formatter"
+ ":wstart" ":mstart"))))
+
+
+;;; Finish up
+
+(provide 'org-pcomplete)
+
+;;; org-pcomplete.el ends here
diff --git a/elpa/org-9.5.2/org-pcomplete.elc b/elpa/org-9.5.2/org-pcomplete.elc
new file mode 100644
index 0000000..554d729
--- /dev/null
+++ b/elpa/org-9.5.2/org-pcomplete.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-pkg.el b/elpa/org-9.5.2/org-pkg.el
new file mode 100644
index 0000000..68f10a5
--- /dev/null
+++ b/elpa/org-9.5.2/org-pkg.el
@@ -0,0 +1,2 @@
+;; Generated package description from org.el -*- no-byte-compile: t -*-
+(define-package "org" "9.5.2" "Outline-based notes management and organizer" '((emacs "25.1")) :authors '(("Carsten Dominik" . "carsten.dominik@gmail.com")) :maintainer '("Bastien Guerry" . "bzg@gnu.org") :keywords '("outlines" "hypermedia" "calendar" "wp") :url "https://orgmode.org")
diff --git a/elpa/org-9.5.2/org-plot.el b/elpa/org-9.5.2/org-plot.el
new file mode 100644
index 0000000..4f14c7d
--- /dev/null
+++ b/elpa/org-9.5.2/org-plot.el
@@ -0,0 +1,730 @@
+;;; org-plot.el --- Support for Plotting from Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
+;;
+;; Author: Eric Schulte <schulte dot eric at gmail dot com>
+;; Maintainer: TEC <tecosaur@gmail.com>
+;; Keywords: tables, plotting
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Borrows ideas and a couple of lines of code from org-exp.el.
+
+;; Thanks to the Org mailing list for testing and implementation and
+;; feature suggestions
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'org)
+(require 'org-table)
+
+(declare-function gnuplot-delchar-or-maybe-eof "ext:gnuplot" (arg))
+(declare-function gnuplot-mode "ext:gnuplot" ())
+(declare-function gnuplot-send-buffer-to-gnuplot "ext:gnuplot" ())
+
+(defvar org-plot/gnuplot-default-options
+ '((:plot-type . 2d)
+ (:with . lines)
+ (:ind . 0))
+ "Default options to gnuplot used by `org-plot/gnuplot'.")
+
+(defvar org-plot-timestamp-fmt nil)
+
+(defun org-plot/add-options-to-plist (p options)
+ "Parse an OPTIONS line and set values in the property list P.
+Returns the resulting property list."
+ (when options
+ (let ((op '(("type" . :plot-type)
+ ("script" . :script)
+ ("line" . :line)
+ ("set" . :set)
+ ("title" . :title)
+ ("ind" . :ind)
+ ("deps" . :deps)
+ ("with" . :with)
+ ("file" . :file)
+ ("labels" . :labels)
+ ("map" . :map)
+ ("timeind" . :timeind)
+ ("timefmt" . :timefmt)
+ ("min" . :ymin)
+ ("ymin" . :ymin)
+ ("max" . :ymax)
+ ("ymax" . :ymax)
+ ("xmin" . :xmin)
+ ("xmax" . :xmax)
+ ("ticks" . :ticks)
+ ("trans" . :transpose)
+ ("transpose" . :transpose)))
+ (multiples '("set" "line"))
+ (regexp ":\\([\"][^\"]+?[\"]\\|[(][^)]+?[)]\\|[^ \t\n\r;,.]*\\)")
+ (start 0))
+ (dolist (o op)
+ (if (member (car o) multiples) ;; keys with multiple values
+ (while (string-match
+ (concat (regexp-quote (car o)) regexp)
+ options start)
+ (setq start (match-end 0))
+ (setq p (plist-put p (cdr o)
+ (cons (car (read-from-string
+ (match-string 1 options)))
+ (plist-get p (cdr o)))))
+ p)
+ (if (string-match (concat (regexp-quote (car o)) regexp)
+ options)
+ (setq p (plist-put p (cdr o)
+ (car (read-from-string
+ (match-string 1 options))))))))))
+ p)
+
+(defun org-plot/goto-nearest-table ()
+ "Move the point forward to the beginning of nearest table.
+Return value is the point at the beginning of the table."
+ (interactive) (move-beginning-of-line 1)
+ (while (not (or (org-at-table-p) (< 0 (forward-line 1)))))
+ (goto-char (org-table-begin)))
+
+(defun org-plot/collect-options (&optional params)
+ "Collect options from an org-plot `#+Plot:' line.
+Accepts an optional property list PARAMS, to which the options
+will be added. Returns the resulting property list."
+ (interactive)
+ (let ((line (thing-at-point 'line)))
+ (if (string-match "#\\+PLOT: +\\(.*\\)$" line)
+ (org-plot/add-options-to-plist params (match-string 1 line))
+ params)))
+
+(defun org-plot-quote-timestamp-field (s)
+ "Convert field S from timestamp to Unix time and export to gnuplot."
+ (format-time-string org-plot-timestamp-fmt (org-time-string-to-time s)))
+
+(defun org-plot-quote-tsv-field (s)
+ "Quote field S for export to gnuplot."
+ (if (string-match org-table-number-regexp s) s
+ (if (string-match org-ts-regexp3 s)
+ (org-plot-quote-timestamp-field s)
+ (concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"") "\""))))
+
+(defun org-plot/gnuplot-to-data (table data-file params)
+ "Export TABLE to DATA-FILE in a format readable by gnuplot.
+Pass PARAMS through to `orgtbl-to-generic' when exporting TABLE."
+ (with-temp-file
+ data-file
+ (setq-local org-plot-timestamp-fmt (or
+ (plist-get params :timefmt)
+ "%Y-%m-%d-%H:%M:%S"))
+ (insert (orgtbl-to-generic
+ table
+ (org-combine-plists
+ '(:sep "\t" :fmt org-plot-quote-tsv-field)
+ params))))
+ nil)
+
+(defun org-plot/gnuplot-to-grid-data (table data-file params)
+ "Export the data in TABLE to DATA-FILE for gnuplot.
+This means in a format appropriate for grid plotting by gnuplot.
+PARAMS specifies which columns of TABLE should be plotted as independent
+and dependent variables."
+ (interactive)
+ (let* ((ind (- (plist-get params :ind) 1))
+ (deps (if (plist-member params :deps)
+ (mapcar (lambda (val) (- val 1)) (plist-get params :deps))
+ (let (collector)
+ (dotimes (col (length (nth 0 table)))
+ (setf collector (cons col collector)))
+ collector)))
+ (counter 0)
+ row-vals)
+ (when (>= ind 0) ;; collect values of ind col
+ (setf row-vals (mapcar (lambda (row) (setf counter (+ 1 counter))
+ (cons counter (nth ind row)))
+ table)))
+ (when (or deps (>= ind 0)) ;; remove non-plotting columns
+ (setf deps (delq ind deps))
+ (setf table (mapcar (lambda (row)
+ (dotimes (col (length row))
+ (unless (memq col deps)
+ (setf (nth col row) nil)))
+ (delq nil row))
+ table)))
+ ;; write table to gnuplot grid datafile format
+ (with-temp-file data-file
+ (let ((num-rows (length table)) (num-cols (length (nth 0 table)))
+ (gnuplot-row (lambda (col row value)
+ (setf col (+ 1 col)) (setf row (+ 1 row))
+ (format "%f %f %f\n%f %f %f\n"
+ col (- row 0.5) value ;; lower edge
+ col (+ row 0.5) value))) ;; upper edge
+ front-edge back-edge)
+ (dotimes (col num-cols)
+ (dotimes (row num-rows)
+ (setf back-edge
+ (concat back-edge
+ (funcall gnuplot-row (- col 1) row
+ (string-to-number (nth col (nth row table))))))
+ (setf front-edge
+ (concat front-edge
+ (funcall gnuplot-row col row
+ (string-to-number (nth col (nth row table)))))))
+ ;; only insert once per row
+ (insert back-edge) (insert "\n") ;; back edge
+ (insert front-edge) (insert "\n") ;; front edge
+ (setf back-edge "") (setf front-edge ""))))
+ row-vals))
+
+(defun org--plot/values-stats (nums &optional hard-min hard-max)
+ "Rudimentary statistics about NUMS, useful for guessing axis ticks.
+If HARD-MIN or HARD-MAX are set, they will be used instead of the min/max
+of the NUMS."
+ (let* ((minimum (or hard-min (apply #'min nums)))
+ (maximum (or hard-max (apply #'max nums)))
+ (range (- maximum minimum))
+ (rangeOrder (if (= range 0) 0
+ (ceiling (- 1 (log range 10)))))
+ (range-factor (expt 10 rangeOrder))
+ (nice-min (if (= range 0) (car nums)
+ (/ (float (floor (* minimum range-factor))) range-factor)))
+ (nice-max (if (= range 0) (car nums)
+ (/ (float (ceiling (* maximum range-factor))) range-factor))))
+ `(:min ,minimum :max ,maximum :range ,range
+ :range-factor ,range-factor
+ :nice-min ,nice-min :nice-max ,nice-max :nice-range ,(- nice-max nice-min))))
+
+(defun org--plot/sensible-tick-num (table &optional hard-min hard-max)
+ "From a the values in a TABLE of data, guess an appropriate number of ticks.
+If HARD-MIN and HARD-MAX can be used to fix the ends of the axis."
+ (let* ((row-data
+ (mapcar (lambda (row) (org--plot/values-stats
+ (mapcar #'string-to-number (cdr row))
+ hard-min
+ hard-max)) table))
+ (row-normalised-ranges (mapcar (lambda (r-data)
+ (let ((val (round (*
+ (plist-get r-data :range-factor)
+ (plist-get r-data :nice-range)))))
+ (if (= (% val 10) 0) (/ val 10) val)))
+ row-data))
+ (range-prime-decomposition (mapcar #'org--plot/prime-factors row-normalised-ranges))
+ (weighted-factors (sort (apply #'org--plot/merge-alists #'+ 0
+ (mapcar (lambda (factors) (org--plot/item-frequencies factors t))
+ range-prime-decomposition))
+ (lambda (a b) (> (cdr a) (cdr b))))))
+ (apply #'* (org--plot/nice-frequency-pick weighted-factors))))
+
+(defun org--plot/nice-frequency-pick (frequencies)
+ "From a list of FREQUENCIES, try to sensibly pick a sample of the most frequent."
+ ;; TODO this mosly works decently, but could do with some tweaking to work more consistently.
+ (cl-case (length frequencies)
+ (1 (list (car (nth 0 frequencies))))
+ (2 (if (<= 3 (/ (cdr (nth 0 frequencies))
+ (cdr (nth 1 frequencies))))
+ (make-list 2
+ (car (nth 0 frequencies)))
+ (list (car (nth 0 frequencies))
+ (car (nth 1 frequencies)))))
+ (t
+ (let* ((total-count (apply #'+ (mapcar #'cdr frequencies)))
+ (n-freq (mapcar (lambda (freq) `(,(car freq) . ,(/ (float (cdr freq)) total-count))) frequencies))
+ (f-pick (list (car (car n-freq))))
+ (1-2-ratio (/ (cdr (nth 0 n-freq))
+ (cdr (nth 1 n-freq))))
+ (2-3-ratio (/ (cdr (nth 1 n-freq))
+ (cdr (nth 2 n-freq))))
+ (1-3-ratio (* 1-2-ratio 2-3-ratio))
+ (1-val (car (nth 0 n-freq)))
+ (2-val (car (nth 1 n-freq)))
+ (3-val (car (nth 2 n-freq))))
+ (when (> 1-2-ratio 4) (push 1-val f-pick))
+ (when (and (< 1-2-ratio 2-val)
+ (< (* (apply #'* f-pick) 2-val) 30))
+ (push 2-val f-pick))
+ (when (and (< 1-3-ratio 3-val)
+ (< (* (apply #'* f-pick) 3-val) 30))
+ (push 3-val f-pick))
+ f-pick))))
+
+(defun org--plot/merge-alists (function default alist1 alist2 &rest alists)
+ "Using FUNCTION, combine the elements of ALIST1, ALIST2 and any other ALISTS.
+When an element is only present in one alist, DEFAULT is used as the second
+argument for the FUNCTION."
+ (when (> (length alists) 0)
+ (setq alist2 (apply #'org--plot/merge-alists function default alist2 alists)))
+ (cl-flet ((keys (alist) (mapcar #'car alist))
+ (lookup (key alist) (or (cdr (assoc key alist)) default)))
+ (cl-loop with keys = (cl-union (keys alist1) (keys alist2) :test 'equal)
+ for k in keys collect
+ (cons k (funcall function (lookup k alist1) (lookup k alist2))))))
+
+(defun org--plot/item-frequencies (values &optional normalise)
+ "Return an alist indicating the frequency of values in VALUES list.
+When NORMALISE is non-nil, the count is divided by the number of values."
+ (let ((normaliser (if normalise (float (length values)) 1)))
+ (cl-loop for (n . m) in (seq-group-by #'identity values)
+ collect (cons n (/ (length m) normaliser)))))
+
+(defun org--plot/prime-factors (value)
+ "Return the prime decomposition of VALUE, e.g. for 12, '(3 2 2)."
+ (let ((factors '(1)) (i 1))
+ (while (/= 1 value)
+ (setq i (1+ i))
+ (when (eq 0 (% value i))
+ (push i factors)
+ (setq value (/ value i))
+ (setq i (1- i))
+ ))
+ (cl-subseq factors 0 -1)))
+
+(defcustom org-plot/gnuplot-script-preamble ""
+ "String of function to be inserted before the gnuplot plot command is run.
+
+Note that this is in addition to, not instead of other content generated in
+`org-plot/gnuplot-script'. If a function, it is called with the plot type as
+the argument, and must return a string to be used."
+ :group 'org-plot
+ :type '(choice string function))
+
+(defcustom org-plot/preset-plot-types
+ '((2d :plot-cmd "plot"
+ :check-ind-type t
+ :plot-func
+ (lambda (_table data-file num-cols params plot-str)
+ (let* ((type (plist-get params :plot-type))
+ (with (if (eq type 'grid) 'pm3d (plist-get params :with)))
+ (ind (plist-get params :ind))
+ (deps (if (plist-member params :deps) (plist-get params :deps)))
+ (text-ind (or (plist-get params :textind)
+ (eq (plist-get params :with) 'histograms)))
+ (col-labels (plist-get params :labels))
+ res)
+ (dotimes (col num-cols res)
+ (unless (and (eq type '2d)
+ (or (and ind (equal (1+ col) ind))
+ (and deps (not (member (1+ col) deps)))))
+ (setf res
+ (cons
+ (format plot-str data-file
+ (or (and ind (> ind 0)
+ (not text-ind)
+ (format "%d:" ind)) "")
+ (1+ col)
+ (if text-ind (format ":xticlabel(%d)" ind) "")
+ with
+ (or (nth col col-labels)
+ (format "%d" (1+ col))))
+ res)))))))
+ (3d :plot-cmd "splot"
+ :plot-pre (lambda (_table _data-file _num-cols params _plot-str)
+ (if (plist-get params :map) "set map"))
+ :plot-func
+ (lambda (_table data-file _num-cols params _plot-str)
+ (let* ((type (plist-get params :plot-type))
+ (with (if (eq type 'grid) 'pm3d (plist-get params :with))))
+ (list (format "'%s' matrix with %s title ''"
+ data-file with)))))
+ (grid :plot-cmd "splot"
+ :plot-pre (lambda (_table _data-file _num-cols params _plot-str)
+ (if (plist-get params :map) "set pm3d map" "set map"))
+ :data-dump (lambda (table data-file params _num-cols)
+ (let ((y-labels (org-plot/gnuplot-to-grid-data
+ table data-file params)))
+ (when y-labels (plist-put params :ylabels y-labels))))
+ :plot-func
+ (lambda (table data-file _num-cols params _plot-str)
+ (let* ((type (plist-get params :plot-type))
+ (with (if (eq type 'grid) 'pm3d (plist-get params :with))))
+ (list (format "'%s' with %s title ''"
+ data-file with)))))
+ (radar :plot-func
+ (lambda (table _data-file _num-cols params plot-str)
+ (list (org--plot/radar table params)))))
+ "List of plists describing the available plot types.
+The car is the type name, and the property :plot-func must be
+set. The value of :plot-func is a lambda which yields plot-lines
+\(a list of strings) as the cdr.
+
+All lambda functions have the parameters of
+`org-plot/gnuplot-script' and PLOT-STR passed to them. i.e. they
+are called with the following signature: (TABLE DATA-FILE
+NUM-COLS PARAMS PLOT-STR)
+
+Potentially useful parameters in PARAMS include:
+ :set :line :map :title :file :ind :timeind :timefmt :textind
+ :deps :labels :xlabels :ylabels :xmin :xmax :ymin :ymax :ticks
+
+In addition to :plot-func, the following optional properties may
+be set.
+
+- :plot-cmd - A gnuplot command appended to each plot-line.
+ Accepts string or nil. Default value: nil.
+
+- :check-ind-type - Whether the types of ind values should be checked.
+ Accepts boolean.
+
+- :plot-str - the formula string passed to :plot-func as PLOT-STR
+ Accepts string. Default value: \"'%s' using %s%d%s with %s title '%s'\"
+
+- :data-dump - Function to dump the table to a datafile for ease of
+ use.
+
+ Accepts lambda function. Default lambda body:
+ (org-plot/gnuplot-to-data table data-file params)
+
+- :plot-pre - Gnuplot code to be inserted early into the script, just
+ after term and output have been set.
+
+ Accepts string, nil, or lambda function which returns string
+ or nil. Defaults to nil."
+ :group 'org-plot
+ :type 'alist)
+
+(defvar org--plot/radar-template
+ "### spider plot/chart with gnuplot
+# also known as: radar chart, web chart, star chart, cobweb chart,
+# radar plot, web plot, star plot, cobweb plot, etc. ...
+set datafile separator ' '
+set size square
+unset tics
+set angles degree
+set key bmargin center horizontal
+unset border
+
+# Load data and setup
+load \"%s\"
+
+# General settings
+DataColCount = words($Data[1])-1
+AxesCount = |$Data|-HeaderLines-1
+AngleOffset = 90
+Max = 1
+d=0.1*Max
+Direction = -1 # counterclockwise=1, clockwise = -1
+
+# Tic settings
+TicCount = %s
+TicOffset = 0.1
+TicValue(axis,i) = real(i)*(word($Settings[axis],3)-word($Settings[axis],2)) \\
+ / word($Settings[axis],4)+word($Settings[axis],2)
+TicLabelPosX(axis,i) = PosX(axis,i/TicCount) + PosY(axis, TicOffset)
+TicLabelPosY(axis,i) = PosY(axis,i/TicCount) - PosX(axis, TicOffset)
+TicLen = 0.03
+TicdX(axis,i) = 0.5*TicLen*cos(alpha(axis)-90)
+TicdY(axis,i) = 0.5*TicLen*sin(alpha(axis)-90)
+
+# Label
+LabOffset = 0.10
+LabX(axis) = PosX(axis+1,Max+2*d) + PosY(axis, LabOffset)
+LabY(axis) = PosY($0+1,Max+2*d)
+
+# Functions
+alpha(axis) = (axis-1)*Direction*360.0/AxesCount+AngleOffset
+PosX(axis,R) = R*cos(alpha(axis))
+PosY(axis,R) = R*sin(alpha(axis))
+Scale(axis,value) = real(value-word($Settings[axis],2))/(word($Settings[axis],3)-word($Settings[axis],2))
+
+# Spider settings
+set style arrow 1 dt 1 lw 1.0 @fgal head filled size 0.06,25 # style for axes
+set style arrow 2 dt 2 lw 0.5 @fgal nohead # style for weblines
+set style arrow 3 dt 1 lw 1 @fgal nohead # style for axis tics
+set samples AxesCount
+set isosamples TicCount
+set urange[1:AxesCount]
+set vrange[1:TicCount]
+set style fill transparent solid 0.2
+
+set xrange[-Max-4*d:Max+4*d]
+set yrange[-Max-4*d:Max+4*d]
+plot \\
+ '+' u (0):(0):(PosX($0,Max+d)):(PosY($0,Max+d)) w vec as 1 not, \\
+ $Data u (LabX($0)): \\
+ (LabY($0)):1 every ::HeaderLines w labels center enhanced @fgt not, \\
+ for [i=1:DataColCount] $Data u (PosX($0+1,Scale($0+1,column(i+1)))): \\
+ (PosY($0+1,Scale($0+1,column(i+1)))) every ::HeaderLines w filledcurves lt i title word($Data[1],i+1), \\
+%s
+# '++' u (PosX($1,$2/TicCount)-TicdX($1,$2/TicCount)): \\
+# (PosY($1,$2/TicCount)-TicdY($1,$2/TicCount)): \\
+# (2*TicdX($1,$2/TicCount)):(2*TicdY($1,$2/TicCount)) \\
+# w vec as 3 not, \\
+### end of code
+")
+
+(defvar org--plot/radar-ticks
+ " '++' u (PosX($1,$2/TicCount)):(PosY($1,$2/TicCount)): \\
+ (PosX($1+1,$2/TicCount)-PosX($1,$2/TicCount)): \\
+ (PosY($1+1,$2/TicCount)-PosY($1,$2/TicCount)) w vec as 2 not, \\
+ '++' u (TicLabelPosX(%s,$2)):(TicLabelPosY(%s,$2)): \\
+ (sprintf('%%g',TicValue(%s,$2))) w labels font ',8' @fgat not")
+
+(defvar org--plot/radar-setup-template
+ "# Data
+$Data <<HEREHAVESOMEDATA
+%s
+HEREHAVESOMEDATA
+HeaderLines = 1
+
+# Settings for scale and offset adjustments
+# axis min max tics axisLabelXoff axisLabelYoff
+$Settings <<EOD
+%s
+EOD
+")
+
+(defun org--plot/radar (table params)
+ "Create gnuplot code for a radar plot of TABLE with PARAMS."
+ (let* ((data
+ (concat "\"" (mapconcat #'identity (plist-get params :labels) "\" \"") "\""
+ "\n"
+ (mapconcat (lambda (row)
+ (format
+ "\"%s\" %s"
+ (car row)
+ (mapconcat #'identity (cdr row) " ")))
+ (append table (list (car table)))
+ "\n")))
+ (ticks (or (plist-get params :ticks)
+ (org--plot/sensible-tick-num table
+ (plist-get params :ymin)
+ (plist-get params :ymax))))
+ (settings
+ (mapconcat (lambda (row)
+ (let ((data (org--plot/values-stats
+ (mapcar #'string-to-number (cdr row)))))
+ (format
+ "\"%s\" %s %s %s"
+ (car row)
+ (or (plist-get params :ymin)
+ (plist-get data :nice-min))
+ (or (plist-get params :ymax)
+ (plist-get data :nice-max))
+ (if (eq ticks 0) 2 ticks)
+ )))
+ (append table (list (car table)))
+ "\n"))
+ (setup-file (make-temp-file "org-plot-setup")))
+ (let ((coding-system-for-write 'utf-8))
+ (write-region (format org--plot/radar-setup-template data settings) nil setup-file nil :silent))
+ (format org--plot/radar-template
+ setup-file
+ (if (eq ticks 0) 2 ticks)
+ (if (eq ticks 0) ""
+ (apply #'format org--plot/radar-ticks
+ (make-list 3 (if (and (plist-get params :ymin)
+ (plist-get params :ymax))
+ ;; FIXME multi-drawing of tick labels with "1"
+ "1" "$1")))))))
+
+(defcustom org-plot/gnuplot-term-extra ""
+ "String or function which provides the extra term options.
+E.g. a value of \"size 1050,650\" would cause
+\"set term ... size 1050,650\" to be used.
+If a function, it is called with the plot type as the argument."
+ :group 'org-plot
+ :type '(choice string function))
+
+(defun org-plot/gnuplot-script (table data-file num-cols params &optional preface)
+ "Write a gnuplot script for TABLE to DATA-FILE respecting options in PARAMS.
+NUM-COLS controls the number of columns plotted in a 2-d plot.
+Optional argument PREFACE returns only option parameters in a
+manner suitable for prepending to a user-specified script."
+ (let* ((type-name (plist-get params :plot-type))
+ (type (cdr (assoc type-name org-plot/preset-plot-types))))
+ (unless type
+ (user-error "Org-plot type `%s' is undefined" type-name))
+ (let* ((sets (plist-get params :set))
+ (lines (plist-get params :line))
+ (title (plist-get params :title))
+ (file (plist-get params :file))
+ (time-ind (plist-get params :timeind))
+ (timefmt (plist-get params :timefmt))
+ (x-labels (plist-get params :xlabels))
+ (y-labels (plist-get params :ylabels))
+ (plot-str (or (plist-get type :plot-str)
+ "'%s' using %s%d%s with %s title '%s'"))
+ (plot-cmd (plist-get type :plot-cmd))
+ (plot-pre (plist-get type :plot-pre))
+ (script "reset")
+ ;; ats = add-to-script
+ (ats (lambda (line) (when line (setf script (concat script "\n" line)))))
+ plot-lines)
+
+
+ ;; handle output file, background, and size
+ (funcall ats (format "set term %s %s"
+ (if file (file-name-extension file) "GNUTERM")
+ (if (stringp org-plot/gnuplot-term-extra)
+ org-plot/gnuplot-term-extra
+ (funcall org-plot/gnuplot-term-extra type))))
+ (when file ; output file
+ (funcall ats (format "set output '%s'" (expand-file-name file))))
+
+ (when plot-pre
+ (funcall ats (funcall plot-pre table data-file num-cols params plot-str)))
+
+ (funcall ats
+ (if (stringp org-plot/gnuplot-script-preamble)
+ org-plot/gnuplot-script-preamble
+ (funcall org-plot/gnuplot-script-preamble type)))
+
+ (when title (funcall ats (format "set title '%s'" title))) ; title
+ (mapc ats lines) ; line
+ (dolist (el sets) (funcall ats (format "set %s" el))) ; set
+ ;; Unless specified otherwise, values are TAB separated.
+ (unless (string-match-p "^set datafile separator" script)
+ (funcall ats "set datafile separator \"\\t\""))
+ (when x-labels ; x labels (xtics)
+ (funcall ats
+ (format "set xtics (%s)"
+ (mapconcat (lambda (pair)
+ (format "\"%s\" %d" (cdr pair) (car pair)))
+ x-labels ", "))))
+ (when y-labels ; y labels (ytics)
+ (funcall ats
+ (format "set ytics (%s)"
+ (mapconcat (lambda (pair)
+ (format "\"%s\" %d" (cdr pair) (car pair)))
+ y-labels ", "))))
+ (when time-ind ; timestamp index
+ (funcall ats "set xdata time")
+ (funcall ats (concat "set timefmt \""
+ (or timefmt ; timefmt passed to gnuplot
+ "%Y-%m-%d-%H:%M:%S") "\"")))
+ (unless preface
+ (let ((type-func (plist-get type :plot-func)))
+ (when type-func
+ (setq plot-lines
+ (funcall type-func table data-file num-cols params plot-str))))
+ (funcall ats
+ (concat plot-cmd
+ (when plot-cmd " ")
+ (mapconcat #'identity
+ (reverse plot-lines)
+ ",\\\n "))))
+ script)))
+
+(defun org-plot/redisplay-img-in-buffer (img-file)
+ "Find any overlays for IMG-FILE in the current Org buffer, and refresh them."
+ (dolist (img-overlay org-inline-image-overlays)
+ (when (string= img-file (plist-get (cdr (overlay-get img-overlay 'display)) :file))
+ (when (file-exists-p img-file)
+ (image-refresh (overlay-get img-overlay 'display))))))
+
+;;-----------------------------------------------------------------------------
+;; facade functions
+;;;###autoload
+(defun org-plot/gnuplot (&optional params)
+ "Plot table using gnuplot. Gnuplot options can be specified with PARAMS.
+If not given options will be taken from the +PLOT
+line directly before or after the table."
+ (interactive)
+ (require 'gnuplot)
+ (save-window-excursion
+ (delete-other-windows)
+ (when (get-buffer "*gnuplot*") ; reset *gnuplot* if it already running
+ (with-current-buffer "*gnuplot*"
+ (goto-char (point-max))))
+ (save-excursion
+ (org-plot/goto-nearest-table)
+ ;; Set default options.
+ (dolist (pair org-plot/gnuplot-default-options)
+ (unless (plist-member params (car pair))
+ (setf params (plist-put params (car pair) (cdr pair)))))
+ ;; Collect options.
+ (while (and (equal 0 (forward-line -1))
+ (looking-at "[[:space:]]*#\\+"))
+ (setf params (org-plot/collect-options params))))
+ ;; collect table and table information
+ (let* ((data-file (make-temp-file "org-plot"))
+ (table (let ((tbl (save-excursion
+ (org-plot/goto-nearest-table)
+ (org-table-to-lisp))))
+ (when (pcase (plist-get params :transpose)
+ (`y t)
+ (`yes t)
+ (`t t))
+ (if (not (memq 'hline tbl))
+ (setq tbl (apply #'cl-mapcar #'list tbl))
+ ;; When present, remove hlines as they can't (currentily) be easily transposed.
+ (setq tbl (apply #'cl-mapcar #'list
+ (remove 'hline tbl)))
+ (push 'hline (cdr tbl))))
+ tbl))
+ (num-cols (length (if (eq (nth 0 table) 'hline) (nth 1 table)
+ (nth 0 table))))
+ (type (assoc (plist-get params :plot-type)
+ org-plot/preset-plot-types)))
+
+ (unless type
+ (user-error "Org-plot type `%s' is undefined" (plist-get params :plot-type)))
+
+ (run-with-idle-timer 0.1 nil #'delete-file data-file)
+ (when (eq (cadr table) 'hline)
+ (setf params
+ (plist-put params :labels (car table))) ; headers to labels
+ (setf table (delq 'hline (cdr table)))) ; clean non-data from table
+ ;; Collect options.
+ (save-excursion (while (and (equal 0 (forward-line -1))
+ (looking-at "[[:space:]]*#\\+"))
+ (setf params (org-plot/collect-options params))))
+ ;; Dump table to datafile
+ (if-let ((dump-func (plist-get type :data-dump)))
+ (funcall dump-func table data-file num-cols params)
+ (org-plot/gnuplot-to-data table data-file params))
+ ;; Check type of ind column (timestamp? text?)
+ (when (plist-get params :check-ind-type)
+ (let* ((ind (1- (plist-get params :ind)))
+ (ind-column (mapcar (lambda (row) (nth ind row)) table)))
+ (cond ((< ind 0) nil) ; ind is implicit
+ ((cl-every (lambda (el)
+ (string-match org-ts-regexp3 el))
+ ind-column)
+ (plist-put params :timeind t)) ; ind holds timestamps
+ ((or (string= (plist-get params :with) "hist")
+ (cl-notevery (lambda (el)
+ (string-match org-table-number-regexp el))
+ ind-column))
+ (plist-put params :textind t))))) ; ind holds text
+ ;; Write script.
+ (with-temp-buffer
+ (if (plist-get params :script) ; user script
+ (progn (insert
+ (org-plot/gnuplot-script table data-file num-cols params t))
+ (insert "\n")
+ (insert-file-contents (plist-get params :script))
+ (goto-char (point-min))
+ (while (re-search-forward "\\$datafile" nil t)
+ (replace-match data-file nil nil)))
+ (insert (org-plot/gnuplot-script table data-file num-cols params)))
+ ;; Graph table.
+ (gnuplot-mode)
+ (condition-case nil
+ (gnuplot-send-buffer-to-gnuplot)
+ (buffer-read-only nil)))
+ ;; Cleanup.
+ (bury-buffer (get-buffer "*gnuplot*"))
+ ;; Refresh any displayed images
+ (when (plist-get params :file)
+ (org-plot/redisplay-img-in-buffer (expand-file-name (plist-get params :file)))))))
+
+(provide 'org-plot)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-plot.el ends here
diff --git a/elpa/org-9.5.2/org-plot.elc b/elpa/org-9.5.2/org-plot.elc
new file mode 100644
index 0000000..68aed45
--- /dev/null
+++ b/elpa/org-9.5.2/org-plot.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-protocol.el b/elpa/org-9.5.2/org-protocol.el
new file mode 100644
index 0000000..ca3249d
--- /dev/null
+++ b/elpa/org-9.5.2/org-protocol.el
@@ -0,0 +1,777 @@
+;;; org-protocol.el --- Intercept Calls from Emacsclient to Trigger Custom Actions -*- lexical-binding: t; -*-
+;;
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
+;;
+;; Authors: Bastien Guerry <bzg@gnu.org>
+;; Daniel M German <dmg AT uvic DOT org>
+;; Sebastian Rose <sebastian_rose AT gmx DOT de>
+;; Ross Patterson <me AT rpatterson DOT net>
+;; Maintainer: Sebastian Rose <sebastian_rose AT gmx DOT de>
+;; Keywords: org, emacsclient, 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 <https://www.gnu.org/licenses/>.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Commentary:
+;;
+;; Intercept calls from emacsclient to trigger custom actions.
+;;
+;; This is done by advising `server-visit-files' to scan the list of filenames
+;; for `org-protocol-the-protocol' and sub-protocols defined in
+;; `org-protocol-protocol-alist' and `org-protocol-protocol-alist-default'.
+;;
+;; Any application that supports calling external programs with an URL
+;; as argument may be used with this functionality.
+;;
+;;
+;; Usage:
+;; ------
+;;
+;; 1.) Add this to your init file (.emacs probably):
+;;
+;; (add-to-list 'load-path "/path/to/org-protocol/")
+;; (require 'org-protocol)
+;;
+;; 3.) Ensure emacs-server is up and running.
+;; 4.) Try this from the command line (adjust the URL as needed):
+;;
+;; $ emacsclient \
+;; "org-protocol://store-link?url=http:%2F%2Flocalhost%2Findex.html&title=The%20title"
+;;
+;; 5.) Optionally add custom sub-protocols and handlers:
+;;
+;; (setq org-protocol-protocol-alist
+;; '(("my-protocol"
+;; :protocol "my-protocol"
+;; :function my-protocol-handler-function)))
+;;
+;; A "sub-protocol" will be found in URLs like this:
+;;
+;; org-protocol://sub-protocol?key=val&key2=val2
+;;
+;; If it works, you can now setup other applications for using this feature.
+;;
+;;
+;; As of March 2009 Firefox users follow the steps documented on
+;; http://kb.mozillazine.org/Register_protocol, Opera setup is described here:
+;; http://www.opera.com/support/kb/view/535/
+;;
+;;
+;; Documentation
+;; -------------
+;;
+;; org-protocol.el comes with and installs handlers to open sources of published
+;; online content, store and insert the browser's URLs and cite online content
+;; by clicking on a bookmark in Firefox, Opera and probably other browsers and
+;; applications:
+;;
+;; * `org-protocol-open-source' uses the sub-protocol \"open-source\" and maps
+;; URLs to local filenames defined in `org-protocol-project-alist'.
+;;
+;; * `org-protocol-store-link' stores an Org link (if Org is present) and
+;; pushes the browsers URL to the `kill-ring' for yanking. This handler is
+;; triggered through the sub-protocol \"store-link\".
+;;
+;; * Call `org-protocol-capture' by using the sub-protocol \"capture\". If
+;; Org is loaded, Emacs will pop-up a capture buffer and fill the
+;; template with the data provided. I.e. the browser's URL is inserted as an
+;; Org-link of which the page title will be the description part. If text
+;; was select in the browser, that text will be the body of the entry.
+;;
+;; You may use the same bookmark URL for all those standard handlers and just
+;; adjust the sub-protocol used:
+;;
+;; javascript:location.href='org-protocol://sub-protocol?'+
+;; new URLSearchParams({
+;; url: location.href,
+;; title: document.title,
+;; body: window.getSelection()})
+;;
+;; Alternatively use the following expression that encodes space as \"%20\"
+;; instead of \"+\", so it is compatible with Org versions from 9.0 to 9.4:
+;;
+;; location.href='org-protocol://sub-protocol?url='+
+;; encodeURIComponent(location.href)+'&title='+
+;; encodeURIComponent(document.title)+'&body='+
+;; encodeURIComponent(window.getSelection())
+;;
+;; The handler for the sub-protocol \"capture\" detects an optional template
+;; char that, if present, triggers the use of a special template.
+;; Example:
+;;
+;; location.href='org-protocol://capture?'+
+;; new URLSearchParams({template:'x', /* ... */})
+;;
+;; or
+;;
+;; location.href='org-protocol://capture?template=x'+ ...
+;;
+;; uses template ?x.
+;;
+;; Note that using double slashes is optional from org-protocol.el's point of
+;; view because emacsclient squashes the slashes to one.
+;;
+;;
+;; provides: 'org-protocol
+;;
+;;; Code:
+
+(require 'org)
+(require 'ol)
+
+(declare-function org-publish-get-project-from-filename "ox-publish"
+ (filename &optional up))
+(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.
+
+This is done by advising `server-visit-files' to scan the list of filenames
+for `org-protocol-the-protocol' and sub-protocols defined in
+`org-protocol-protocol-alist' and `org-protocol-protocol-alist-default'."
+ :version "22.1"
+ :group 'convenience
+ :group 'org)
+
+
+;;; Variables:
+
+(defconst org-protocol-protocol-alist-default
+ '(("org-capture" :protocol "capture" :function org-protocol-capture :kill-client t)
+ ("org-store-link" :protocol "store-link" :function org-protocol-store-link)
+ ("org-open-source" :protocol "open-source" :function org-protocol-open-source))
+ "Default protocols to use.
+See `org-protocol-protocol-alist' for a description of this variable.")
+
+(defconst org-protocol-the-protocol "org-protocol"
+ "This is the protocol to detect if org-protocol.el is loaded.
+`org-protocol-protocol-alist-default' and `org-protocol-protocol-alist' hold
+the sub-protocols that trigger the required action. You will have to define
+just one protocol handler OS-wide (MS-Windows) or per application (Linux).
+That protocol handler should call emacsclient.")
+
+;;; User variables:
+
+(defcustom org-protocol-reverse-list-of-files t
+ "Non-nil means re-reverse the list of filenames passed on the command line.
+The filenames passed on the command line are passed to the emacs-server in
+reverse order. Set to t (default) to re-reverse the list, i.e. use the
+sequence on the command line. If nil, the sequence of the filenames is
+unchanged."
+ :group 'org-protocol
+ :type 'boolean)
+
+(defcustom org-protocol-project-alist nil
+ "Map URLs to local filenames for `org-protocol-open-source' (open-source).
+
+Each element of this list must be of the form:
+
+ (module-name :property value property: value ...)
+
+where module-name is an arbitrary name. All the values are strings.
+
+Possible properties are:
+
+ :online-suffix - the suffix to strip from the published URLs
+ :working-suffix - the replacement for online-suffix
+ :base-url - the base URL, e.g. https://www.example.com/project/
+ Last slash required.
+ :working-directory - the local working directory. This is what
+ base-url will be replaced with.
+ :redirects - A list of cons cells, each of which maps a
+ regular expression to match to a path relative
+ to `:working-directory'.
+
+Example:
+
+ (setq org-protocol-project-alist
+ \\='((\"https://orgmode.org/worg/\"
+ :online-suffix \".php\"
+ :working-suffix \".org\"
+ :base-url \"https://orgmode.org/worg/\"
+ :working-directory \"/home/user/org/Worg/\")
+ (\"localhost org-notes/\"
+ :online-suffix \".html\"
+ :working-suffix \".org\"
+ :base-url \"http://localhost/org/\"
+ :working-directory \"/home/user/org/\"
+ :rewrites ((\"org/?$\" . \"index.php\")))
+ (\"Hugo based blog\"
+ :base-url \"https://www.site.com/\"
+ :working-directory \"~/site/content/post/\"
+ :online-suffix \".html\"
+ :working-suffix \".md\"
+ :rewrites ((\"\\(https://site.com/[0-9]+/[0-9]+/[0-9]+/\\)\"
+ . \".md\")))
+ (\"GNU emacs OpenGrok\"
+ :base-url \"https://opengrok.housegordon.com/source/xref/emacs/\"
+ :working-directory \"~/dev/gnu-emacs/\")))
+
+ The :rewrites line of \"localhost org-notes\" entry tells
+ `org-protocol-open-source' to open /home/user/org/index.php,
+ if the URL cannot be mapped to an existing file, and ends with
+ either \"org\" or \"org/\". The \"GNU emacs OpenGrok\" entry
+ does not include any suffix properties, allowing local source
+ file to be opened as found by OpenGrok.
+
+Consider using the interactive functions `org-protocol-create'
+and `org-protocol-create-for-org' to help you filling this
+variable with valid contents."
+ :group 'org-protocol
+ :type 'alist)
+
+(defcustom org-protocol-protocol-alist nil
+ "Register custom handlers for org-protocol.
+
+Each element of this list must be of the form:
+
+ (module-name :protocol protocol :function func :kill-client nil)
+
+protocol - protocol to detect in a filename without trailing
+ colon and slashes. See rfc1738 section 2.1 for more
+ on this. If you define a protocol \"my-protocol\",
+ `org-protocol-check-filename-for-protocol' will search
+ filenames for \"org-protocol:/my-protocol\" and
+ trigger your action for every match. `org-protocol'
+ is defined in `org-protocol-the-protocol'. Double and
+ triple slashes are compressed to one by emacsclient.
+
+function - function that handles requests with protocol and takes
+ one argument. If a new-style link (key=val&key2=val2)
+ is given, the argument will be a property list with
+ the values from the link. If an old-style link is
+ given (val1/val2), the argument will be the filename
+ with all protocols stripped.
+
+ If the function returns nil, emacsclient and -server
+ do nothing. Any non-nil return value is considered a
+ valid filename and thus passed to the server.
+
+ `org-protocol.el' provides some support for handling
+ old-style filenames, if you follow the conventions
+ used for the standard handlers in
+ `org-protocol-protocol-alist-default'. See
+ `org-protocol-parse-parameters'.
+
+kill-client - If t, kill the client immediately, once the sub-protocol is
+ detected. This is necessary for actions that can be interrupted by
+ `C-g' to avoid dangling emacsclients. Note that all other command
+ line arguments but the this one will be discarded. Greedy handlers
+ still receive the whole list of arguments though.
+
+Here is an example:
+
+ (setq org-protocol-protocol-alist
+ \\='((\"my-protocol\"
+ :protocol \"my-protocol\"
+ :function my-protocol-handler-function)
+ (\"your-protocol\"
+ :protocol \"your-protocol\"
+ :function your-protocol-handler-function)))"
+ :group 'org-protocol
+ :type '(alist))
+
+(defcustom org-protocol-default-template-key nil
+ "The default template key to use.
+This is usually a single character string but can also be a
+string with two characters."
+ :group 'org-protocol
+ :type '(choice (const nil) (string)))
+
+(defcustom org-protocol-data-separator "/+\\|\\?"
+ "The default data separator to use.
+This should be a single regexp string."
+ :group 'org-protocol
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'regexp)
+
+;;; Helper functions:
+
+(defun org-protocol-sanitize-uri (uri)
+ "Sanitize slashes to double-slashes in URI.
+Emacsclient compresses double and triple slashes."
+ (when (string-match "^\\([a-z]+\\):/" uri)
+ (let* ((splitparts (split-string uri "/+")))
+ (setq uri (concat (car splitparts) "//" (mapconcat 'identity (cdr splitparts) "/")))))
+ uri)
+
+(defun org-protocol-split-data (data &optional unhexify separator)
+ "Split the DATA argument for an org-protocol handler function.
+If UNHEXIFY is non-nil, hex-decode each split part. If UNHEXIFY
+is a function, use that function to decode each split part. The
+string is split at each occurrence of SEPARATOR (regexp). If no
+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)))
+ (cond ((not unhexify) split-parts)
+ ((fboundp unhexify) (mapcar unhexify split-parts))
+ (t (mapcar #'org-link-decode split-parts)))))
+
+(defun org-protocol-flatten-greedy (param-list &optional strip-path replacement)
+ "Transform PARAM-LIST into a flat list for greedy handlers.
+
+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 emacsclient's working directory. This
+function transforms it into a flat list using `org-protocol-flatten' and
+transforms the elements of that list as follows:
+
+If STRIP-PATH is non-nil, remove the \"/dir/\" prefix from all members of
+param-list.
+
+If REPLACEMENT is string, replace the \"/dir/\" prefix with it.
+
+The first parameter, the one that contains the protocols, is always changed.
+Everything up to the end of the protocols is stripped.
+
+Note, that this function will always behave as if
+`org-protocol-reverse-list-of-files' was set to t and the returned list will
+reflect that. emacsclient's first parameter will be the first one in the
+returned list."
+ (let* ((l (org-protocol-flatten (if org-protocol-reverse-list-of-files
+ param-list
+ (reverse param-list))))
+ (trigger (car l))
+ (len 0)
+ dir
+ ret)
+ (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))))
+ (if strip-path
+ (progn
+ (dolist (e l ret)
+ (setq ret
+ (append ret
+ (list
+ (if (stringp e)
+ (if (stringp replacement)
+ (setq e (concat replacement (substring e len)))
+ (setq e (substring e len)))
+ e)))))
+ ret)
+ l)))
+
+(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 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.
+If NEW-STYLE is non-nil, treat INFO as a query string (ex:
+url=URL&title=TITLE). If old-style links are used (ex:
+org-protocol://store-link/url/title), assign them to attributes
+following DEFAULT-ORDER.
+
+If no DEFAULT-ORDER is specified, return the list of values.
+
+If INFO is already a property list, return it unchanged."
+ (if (listp info)
+ info
+ (if new-style
+ (let ((data (org-protocol-convert-query-to-plist info))
+ result)
+ (while data
+ (setq result
+ (append result
+ (list (pop data) (org-link-decode (pop data))))))
+ result)
+ (let ((data (org-protocol-split-data info t org-protocol-data-separator)))
+ (if default-order
+ (org-protocol-assign-parameters data default-order)
+ data)))))
+
+(defun org-protocol-assign-parameters (data default-order)
+ "Return a property list of parameters from DATA.
+Key names are taken from DEFAULT-ORDER, which should be a list of
+symbols. If DEFAULT-ORDER is shorter than the number of values
+specified, the rest of the values are treated as :key value pairs."
+ (let (result)
+ (while default-order
+ (setq result
+ (append result
+ (list (pop default-order)
+ (pop data)))))
+ (while data
+ (setq result
+ (append result
+ (list (intern (concat ":" (pop data)))
+ (pop data)))))
+ result))
+
+;;; Standard protocol handlers:
+
+(defun org-protocol-store-link (fname)
+ "Process an org-protocol://store-link style url.
+Additionally store a browser URL as an org link. Also pushes the
+link's URL to the `kill-ring'.
+
+Parameters: url, title (optional), body (optional)
+
+Old-style links such as org-protocol://store-link://URL/TITLE are
+also recognized.
+
+The location for a browser's bookmark may look like this:
+
+ javascript:location.href = \\='org-protocol://store-link?\\=' +
+ new URLSearchParams({url:location.href, title:document.title});
+
+or to keep compatibility with Org versions from 9.0 to 9.4 it may be:
+
+ javascript:location.href = \\
+ \\='org-protocol://store-link?url=\\=' + \\
+ encodeURIComponent(location.href) + \\='&title=\\=' + \\
+ encodeURIComponent(document.title);
+
+Don't use `escape()'! Use `encodeURIComponent()' instead. The
+title of the page could contain slashes and the location
+definitely will. Org 9.4 and earlier could not decode \"+\"
+to space, that is why less readable latter expression may be necessary
+for backward compatibility.
+
+The sub-protocol used to reach this function is set in
+`org-protocol-protocol-alist'.
+
+FNAME should be a property list. If not, an old-style link of the
+form URL/TITLE can also be used."
+ (let* ((splitparts (org-protocol-parse-parameters fname nil '(:url :title)))
+ (uri (org-protocol-sanitize-uri (plist-get splitparts :url)))
+ (title (plist-get splitparts :title)))
+ (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]")
+ uri))
+ nil)
+
+(defun org-protocol-capture (info)
+ "Process an org-protocol://capture style url with INFO.
+
+The sub-protocol used to reach this function is set in
+`org-protocol-protocol-alist'.
+
+This function detects an URL, title and optional text, separated
+by `/'. The location for a browser's bookmark looks like this:
+
+ javascript:location.href = \\='org-protocol://capture?\\=' +
+ new URLSearchParams({
+ url: location.href,
+ title: document.title,
+ body: window.getSelection()})
+
+or to keep compatibility with Org versions from 9.0 to 9.4:
+
+ javascript:location.href = \\='org-protocol://capture?url=\\='+ \\
+ encodeURIComponent(location.href) + \\='&title=\\=' + \\
+ encodeURIComponent(document.title) + \\='&body=\\=' + \\
+ encodeURIComponent(window.getSelection())
+
+By default, it uses the character `org-protocol-default-template-key',
+which should be associated with a template in `org-capture-templates'.
+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."
+ (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
+ (string-match "^\\([a-z]+\\):" url)
+ (match-string 1 url)))
+ (title (or (plist-get parts :title) ""))
+ (region (or (plist-get parts :body) ""))
+ (orglink
+ (if (null url) title
+ (org-link-make-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-link-store-props :type type
+ :link url
+ :description title
+ :annotation orglink
+ :initial region
+ :query parts)
+ (raise-frame)
+ (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
+ (let ((plus-decoded (replace-regexp-in-string "\\+" " " query t t)))
+ (apply 'append (mapcar (lambda (x)
+ (let ((c (split-string x "=")))
+ (list (intern (concat ":" (car c))) (cadr c))))
+ (split-string plus-decoded "&"))))))
+
+(defun org-protocol-open-source (fname)
+ "Process an org-protocol://open-source?url= style URL with FNAME.
+
+Change a filename by mapping URLs to local filenames as set
+in `org-protocol-project-alist'.
+
+The location for a browser's bookmark should look like this:
+
+ javascript:location.href = \\='org-protocol://open-source?\\=' +
+ new URLSearchParams({url: location.href})
+
+or if you prefer to keep compatibility with older Org versions (9.0 to 9.4),
+consider the following expression:
+
+ javascript:location.href = \\='org-protocol://open-source?url=\\=' + \\
+ encodeURIComponent(location.href)"
+ ;; As we enter this function for a match on our protocol, the return value
+ ;; defaults to nil.
+ (let (;; (result nil)
+ (f (org-protocol-sanitize-uri
+ (plist-get (org-protocol-parse-parameters fname nil '(:url))
+ :url))))
+ (catch 'result
+ (dolist (prolist org-protocol-project-alist)
+ (let* ((base-url (plist-get (cdr prolist) :base-url))
+ (wsearch (regexp-quote base-url)))
+
+ (when (string-match wsearch f)
+ (let* ((wdir (plist-get (cdr prolist) :working-directory))
+ (strip-suffix (plist-get (cdr prolist) :online-suffix))
+ (add-suffix (plist-get (cdr prolist) :working-suffix))
+ ;; Strip "[?#].*$" if `f' is a redirect with another
+ ;; ending than strip-suffix here:
+ (f1 (substring f 0 (string-match "\\([\\?#].*\\)?$" f)))
+ (start-pos (+ (string-match wsearch f1) (length base-url)))
+ (end-pos (if strip-suffix
+ (string-match (regexp-quote strip-suffix) f1)
+ (length f1)))
+ ;; We have to compare redirects without suffix below:
+ (f2 (concat wdir (substring f1 start-pos end-pos)))
+ (the-file (if add-suffix (concat f2 add-suffix) f2)))
+
+ ;; Note: the-file may still contain `%C3' et al here because browsers
+ ;; tend to encode `&auml;' in URLs to `%25C3' - `%25' being `%'.
+ ;; So the results may vary.
+
+ ;; -- start redirects --
+ (unless (file-exists-p the-file)
+ (message "File %s does not exist.\nTesting for rewritten URLs." the-file)
+ (let ((rewrites (plist-get (cdr prolist) :rewrites)))
+ (when rewrites
+ (message "Rewrites found: %S" rewrites)
+ (dolist (rewrite rewrites)
+ ;; Try to match a rewritten URL and map it to
+ ;; a real file. Compare redirects without
+ ;; suffix.
+ (when (string-match (car rewrite) f1)
+ (let ((replacement
+ (concat (directory-file-name
+ (replace-match "" nil nil f1 1))
+ (cdr rewrite))))
+ (throw 'result (concat wdir replacement))))))))
+ ;; -- end of redirects --
+
+ (if (file-readable-p the-file)
+ (throw 'result the-file))
+ (if (file-exists-p the-file)
+ (message "%s: permission denied!" the-file)
+ (message "%s: no such file or directory." the-file))))))
+ nil))) ;; FIXME: Really?
+
+
+;;; Core functions:
+
+(defun org-protocol-check-filename-for-protocol (fname restoffiles _client)
+ "Check if `org-protocol-the-protocol' and a valid protocol are used in FNAME.
+Sub-protocols are registered in `org-protocol-protocol-alist' and
+`org-protocol-protocol-alist-default'. This is how the matching is done:
+
+ (string-match \"protocol:/+sub-protocol\\\\(://\\\\|\\\\?\\\\)\" ...)
+
+protocol and sub-protocol are regexp-quoted.
+
+Old-style links such as \"protocol://sub-protocol://param1/param2\" are
+also recognized.
+
+If a matching protocol is found, the protocol is stripped from
+fname and the result is passed to the protocol function as the
+first parameter. The second parameter will be non-nil if FNAME
+uses key=val&key2=val2-type arguments, or nil if FNAME uses
+val/val2-type arguments. If the function returns nil, the
+filename is removed from the list of filenames passed from
+emacsclient to the server. If the function returns a non-nil
+value, that value is passed to the server as filename.
+
+If the handler function is greedy, RESTOFFILES will also be passed to it.
+
+CLIENT is ignored."
+ (let ((sub-protocols (append org-protocol-protocol-alist
+ org-protocol-protocol-alist-default)))
+ (catch 'fname
+ (let ((the-protocol (concat (regexp-quote org-protocol-the-protocol)
+ ":/+")))
+ (when (string-match the-protocol fname)
+ (dolist (prolist sub-protocols)
+ (let ((proto
+ (concat the-protocol
+ (regexp-quote (plist-get (cdr prolist) :protocol))
+ "\\(:/+\\|/*\\?\\)")))
+ (when (string-match proto fname)
+ (let* ((func (plist-get (cdr prolist) :function))
+ (greedy (plist-get (cdr prolist) :greedy))
+ (split (split-string fname proto))
+ (result (if greedy restoffiles (cadr split)))
+ (new-style (not (= ?: (aref (match-string 1 fname) 0)))))
+ (when (plist-get (cdr prolist) :kill-client)
+ (message "Greedy org-protocol handler. Killing client.")
+ (server-edit))
+ (when (fboundp func)
+ (unless greedy
+ (throw 'fname
+ (if new-style
+ (funcall func (org-protocol-parse-parameters
+ result new-style))
+ (warn "Please update your Org Protocol handler \
+to deal with new-style links.")
+ (funcall func result))))
+ ;; Greedy protocol handlers are responsible for
+ ;; parsing their own filenames.
+ (funcall func result)
+ (throw 'fname t))))))))
+ fname)))
+
+(defadvice server-visit-files (before org-protocol-detect-protocol-server activate)
+ "Advice server-visit-flist to call `org-protocol-modify-filename-for-protocol'."
+ (let ((flist (if org-protocol-reverse-list-of-files
+ (reverse (ad-get-arg 0))
+ (ad-get-arg 0)))
+ (client (ad-get-arg 1)))
+ (catch 'greedy
+ (dolist (var flist)
+ ;; `\' to `/' on windows. FIXME: could this be done any better?
+ (let ((fname (expand-file-name (car var))))
+ (setq fname (org-protocol-check-filename-for-protocol
+ fname (member var flist) client))
+ (if (eq fname t) ;; greedy? We need the t return value.
+ (progn
+ (ad-set-arg 0 nil)
+ (throw 'greedy t))
+ (if (stringp fname) ;; probably filename
+ (setcar var fname)
+ (ad-set-arg 0 (delq var (ad-get-arg 0))))))))))
+
+;;; Org specific functions:
+
+(defun org-protocol-create-for-org ()
+ "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'."
+ (interactive)
+ (require 'ox-publish)
+ (let ((all (or (org-publish-get-project-from-filename buffer-file-name))))
+ (if all (org-protocol-create (cdr all))
+ (message "%s"
+ (substitute-command-keys
+ "Not in an Org project. \
+Did you mean `\\[org-protocol-create]'?")))))
+
+(defun org-protocol-create (&optional project-plist)
+ "Create a new org-protocol project interactively.
+An org-protocol project is an entry in
+`org-protocol-project-alist' which is used by
+`org-protocol-open-source'. Optionally use PROJECT-PLIST to
+initialize the defaults for this project. If PROJECT-PLIST is
+the cdr of an element in `org-publish-project-alist', reuse
+:base-directory, :html-extension and :base-extension."
+ (interactive)
+ (let ((working-dir (expand-file-name
+ (or (plist-get project-plist :base-directory)
+ default-directory)))
+ (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))
+ ".org"))
+ (insert-default-directory t)
+ (minibuffer-allow-text-properties nil))
+
+ (setq base-url (read-string "Base URL of published content: " base-url nil base-url t))
+ (or (string-suffix-p "/" base-url)
+ (setq base-url (concat base-url "/")))
+
+ (setq working-dir
+ (expand-file-name
+ (read-directory-name "Local working directory: " working-dir working-dir t)))
+ (or (string-suffix-p "/" working-dir)
+ (setq working-dir (concat working-dir "/")))
+
+ (setq strip-suffix
+ (read-string
+ (concat "Extension to strip from published URLs (" strip-suffix "): ")
+ strip-suffix nil strip-suffix t))
+
+ (setq working-suffix
+ (read-string
+ (concat "Extension of editable files (" working-suffix "): ")
+ working-suffix nil working-suffix t))
+
+ (when (yes-or-no-p "Save the new org-protocol-project to your init file? ")
+ (setq org-protocol-project-alist
+ (cons `(,base-url . (:base-url ,base-url
+ :working-directory ,working-dir
+ :online-suffix ,strip-suffix
+ :working-suffix ,working-suffix))
+ org-protocol-project-alist))
+ (customize-save-variable 'org-protocol-project-alist org-protocol-project-alist))))
+
+(provide 'org-protocol)
+
+;;; org-protocol.el ends here
diff --git a/elpa/org-9.5.2/org-protocol.elc b/elpa/org-9.5.2/org-protocol.elc
new file mode 100644
index 0000000..4b8f26c
--- /dev/null
+++ b/elpa/org-9.5.2/org-protocol.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-refile.el b/elpa/org-9.5.2/org-refile.el
new file mode 100644
index 0000000..678759e
--- /dev/null
+++ b/elpa/org-9.5.2/org-refile.el
@@ -0,0 +1,752 @@
+;;; org-refile.el --- Refile Org Subtrees -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org Refile allows you to refile subtrees to various locations.
+
+;;; Code:
+
+(require 'org)
+
+(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
+
+(defgroup org-refile nil
+ "Options concerning refiling entries in Org mode."
+ :tag "Org Refile"
+ :group 'org)
+
+(defcustom org-log-refile nil
+ "Information to record when a task is refiled.
+
+Possible values are:
+
+nil Don't add anything
+time Add a time stamp to the task
+note Prompt for a note and add it with template `org-log-note-headings'
+
+This option can also be set with on a per-file-basis with
+
+ #+STARTUP: nologrefile
+ #+STARTUP: logrefile
+ #+STARTUP: lognoterefile
+
+You can have local logging settings for a subtree by setting the LOGGING
+property to one or more of these keywords.
+
+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"
+ :type '(choice
+ (const :tag "No logging" nil)
+ (const :tag "Record timestamp" time)
+ (const :tag "Record timestamp with note." note)))
+
+(defcustom org-refile-targets nil
+ "Targets for refiling entries with `\\[org-refile]'.
+This is a list of cons cells. Each cell contains:
+- a specification of the files to be considered, either a list of files,
+ or a symbol whose function or variable value will be used to retrieve
+ a file name or a list of file names. If you use `org-agenda-files' for
+ that, all agenda files will be scanned for targets. Nil means consider
+ headings in the current buffer.
+- A specification of how to find candidate refile targets. This may be
+ any of:
+ - a cons cell (:tag . \"TAG\") to identify refile targets by a tag.
+ This tag has to be present in all target headlines, inheritance will
+ not be considered.
+ - a cons cell (:todo . \"KEYWORD\") to identify refile targets by
+ todo keyword.
+ - a cons cell (:regexp . \"REGEXP\") with a regular expression matching
+ headlines that are refiling targets.
+ - a cons cell (:level . N). Any headline of level N is considered a target.
+ Note that, when `org-odd-levels-only' is set, level corresponds to
+ order in hierarchy, not to the number of stars.
+ - a cons cell (:maxlevel . N). Any headline with level <= N is a target.
+ Note that, when `org-odd-levels-only' is set, level corresponds to
+ order in hierarchy, not to the number of stars.
+
+Each element of this list generates a set of possible targets.
+The union of these sets is presented (with completion) to
+the user by `org-refile'.
+
+You can set the variable `org-refile-target-verify-function' to a function
+to verify each headline found by the simple criteria above.
+
+When this variable is nil, all top-level headlines in the current buffer
+are used, equivalent to the value `((nil . (:level . 1))'."
+ :group 'org-refile
+ :type '(repeat
+ (cons
+ (choice :value org-agenda-files
+ (const :tag "All agenda files" org-agenda-files)
+ (const :tag "Current buffer" nil)
+ (function) (variable) (file))
+ (choice :tag "Identify target headline by"
+ (cons :tag "Specific tag" (const :value :tag) (string))
+ (cons :tag "TODO keyword" (const :value :todo) (string))
+ (cons :tag "Regular expression" (const :value :regexp) (regexp))
+ (cons :tag "Level number" (const :value :level) (integer))
+ (cons :tag "Max Level number" (const :value :maxlevel) (integer))))))
+
+(defcustom org-refile-target-verify-function nil
+ "Function to verify if the headline at point should be a refile target.
+The function will be called without arguments, with point at the
+beginning of the headline. It should return t and leave point
+where it is if the headline is a valid target for refiling.
+
+If the target should not be selected, the function must return nil.
+In addition to this, it may move point to a place from where the search
+should be continued. For example, the function may decide that the entire
+subtree of the current entry should be excluded and move point to the end
+of the subtree."
+ :group 'org-refile
+ :type '(choice
+ (const nil)
+ (function)))
+
+(defcustom org-refile-use-cache nil
+ "Non-nil means cache refile targets to speed up the process.
+\\<org-mode-map>\
+The cache for a particular file will be updated automatically when
+the buffer has been killed, or when any of the marker used for flagging
+refile targets no longer points at a live buffer.
+If you have added new entries to a buffer that might themselves be targets,
+you need to clear the cache manually by pressing `C-0 \\[org-refile]' or,
+if you find that easier, \
+`\\[universal-argument] \\[universal-argument] \\[universal-argument] \
+\\[org-refile]'."
+ :group 'org-refile
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-refile-use-outline-path nil
+ "Non-nil means provide refile targets as paths.
+So a level 3 headline will be available as level1/level2/level3.
+
+When the value is `file', also include the file name (without directory)
+into the path. In this case, you can also stop the completion after
+the file name, to get entries inserted as top level in the file.
+
+When `full-file-path', include the full file path.
+
+When `buffer-name', use the buffer name."
+ :group 'org-refile
+ :type '(choice
+ (const :tag "Not" nil)
+ (const :tag "Yes" t)
+ (const :tag "Start with file name" file)
+ (const :tag "Start with full file path" full-file-path)
+ (const :tag "Start with buffer name" buffer-name)))
+
+(defcustom org-outline-path-complete-in-steps t
+ "Non-nil means complete the outline path in hierarchical steps.
+When Org uses the refile interface to select an outline path (see
+`org-refile-use-outline-path'), the completion of the path can be
+done in a single go, or it can be done in steps down the headline
+hierarchy. Going in steps is probably the best if you do not use
+a special completion package like `ido' or `icicles'. However,
+when using these packages, going in one step can be very fast,
+while still showing the whole path to the entry."
+ :group 'org-refile
+ :type 'boolean)
+
+(defcustom org-refile-allow-creating-parent-nodes nil
+ "Non-nil means allow the creation of new nodes as refile targets.
+New nodes are then created by adding \"/new node name\" to the completion
+of an existing node. When the value of this variable is `confirm',
+new node creation must be confirmed by the user (recommended).
+When nil, the completion must match an existing entry.
+
+Note that, if the new heading is not seen by the criteria
+listed in `org-refile-targets', multiple instances of the same
+heading would be created by trying again to file under the new
+heading."
+ :group 'org-refile
+ :type '(choice
+ (const :tag "Never" nil)
+ (const :tag "Always" t)
+ (const :tag "Prompt for confirmation" confirm)))
+
+(defcustom org-refile-active-region-within-subtree nil
+ "Non-nil means also refile active region within a subtree.
+
+By default `org-refile' doesn't allow refiling regions if they
+don't contain a set of subtrees, but it might be convenient to
+do so sometimes: in that case, the first line of the region is
+converted to a headline before refiling."
+ :group 'org-refile
+ :version "24.1"
+ :type 'boolean)
+
+(defvar org-refile-target-table nil
+ "The list of refile targets, created by `org-refile'.")
+
+(defvar org-refile-cache nil
+ "Cache for refile targets.")
+
+(defvar org-refile-markers nil
+ "All the markers used for caching refile locations.")
+
+;; Add org refile commands to the main org menu
+(mapc (lambda (i) (easy-menu-add-item
+ org-org-menu
+ '("Edit Structure") i))
+ '(["Refile Subtree" org-refile (org-in-subtree-not-table-p)]
+ ["Refile and copy Subtree" org-refile-copy (org-in-subtree-not-table-p)]))
+
+(defun org-refile-marker (pos)
+ "Get a new refile marker, but only if caching is in use."
+ (if (not org-refile-use-cache)
+ pos
+ (let ((m (make-marker)))
+ (move-marker m pos)
+ (push m org-refile-markers)
+ m)))
+
+(defun org-refile-cache-clear ()
+ "Clear the refile cache and disable all the markers."
+ (dolist (m org-refile-markers) (move-marker m nil))
+ (setq org-refile-markers nil)
+ (setq org-refile-cache nil)
+ (message "Refile cache has been cleared"))
+
+(defun org-refile-cache-check-set (set)
+ "Check if all the markers in the cache still have live buffers."
+ (let (marker)
+ (catch 'exit
+ (while (and set (setq marker (nth 3 (pop set))))
+ ;; If `org-refile-use-outline-path' is 'file, marker may be nil
+ (when (and marker (null (marker-buffer marker)))
+ (message "Please regenerate the refile cache with `C-0 C-c C-w'")
+ (sit-for 3)
+ (throw 'exit nil)))
+ t)))
+
+(defun org-refile-cache-put (set &rest identifiers)
+ "Push the refile targets SET into the cache, under IDENTIFIERS."
+ (let* ((key (sha1 (prin1-to-string identifiers)))
+ (entry (assoc key org-refile-cache)))
+ (if entry
+ (setcdr entry set)
+ (push (cons key set) org-refile-cache))))
+
+(defun org-refile-cache-get (&rest identifiers)
+ "Retrieve the cached value for refile targets given by IDENTIFIERS."
+ (cond
+ ((not org-refile-cache) nil)
+ ((not org-refile-use-cache) (org-refile-cache-clear) nil)
+ (t
+ (let ((set (cdr (assoc (sha1 (prin1-to-string identifiers))
+ org-refile-cache))))
+ (and set (org-refile-cache-check-set set) set)))))
+
+(defun org-refile-get-targets (&optional default-buffer)
+ "Produce a table with refile targets."
+ (let ((case-fold-search nil)
+ ;; otherwise org confuses "TODO" as a kw and "Todo" as a word
+ (entries (or org-refile-targets '((nil . (:level . 1)))))
+ targets tgs files desc descre)
+ (message "Getting targets...")
+ (with-current-buffer (or default-buffer (current-buffer))
+ (dolist (entry entries)
+ (setq files (car entry) desc (cdr entry))
+ (cond
+ ((null files) (setq files (list (current-buffer))))
+ ((eq files 'org-agenda-files)
+ (setq files (org-agenda-files 'unrestricted)))
+ ((and (symbolp files) (fboundp files))
+ (setq files (funcall files)))
+ ((and (symbolp files) (boundp files))
+ (setq files (symbol-value files))))
+ (when (stringp files) (setq files (list files)))
+ (cond
+ ((eq (car desc) :tag)
+ (setq descre (concat "^\\*+[ \t]+.*?:" (regexp-quote (cdr desc)) ":")))
+ ((eq (car desc) :todo)
+ (setq descre (concat "^\\*+[ \t]+" (regexp-quote (cdr desc)) "[ \t]")))
+ ((eq (car desc) :regexp)
+ (setq descre (cdr desc)))
+ ((eq (car desc) :level)
+ (setq descre (concat "^\\*\\{" (number-to-string
+ (if org-odd-levels-only
+ (1- (* 2 (cdr desc)))
+ (cdr desc)))
+ "\\}[ \t]")))
+ ((eq (car desc) :maxlevel)
+ (setq descre (concat "^\\*\\{1," (number-to-string
+ (if org-odd-levels-only
+ (1- (* 2 (cdr desc)))
+ (cdr desc)))
+ "\\}[ \t]")))
+ (t (error "Bad refiling target description %s" desc)))
+ (dolist (f files)
+ (with-current-buffer (if (bufferp f) f (org-get-agenda-file-buffer f))
+ (or
+ (setq tgs (org-refile-cache-get (buffer-file-name) descre))
+ (progn
+ (when (bufferp f)
+ (setq f (buffer-file-name (buffer-base-buffer f))))
+ (setq f (and f (expand-file-name f)))
+ (when (eq org-refile-use-outline-path 'file)
+ (push (list (and f (file-name-nondirectory f)) f nil nil) tgs))
+ (when (eq org-refile-use-outline-path 'buffer-name)
+ (push (list (buffer-name (buffer-base-buffer)) f nil nil) tgs))
+ (when (eq org-refile-use-outline-path 'full-file-path)
+ (push (list (and (buffer-file-name (buffer-base-buffer))
+ (file-truename (buffer-file-name (buffer-base-buffer))))
+ f nil nil) tgs))
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (setq org-outline-path-cache nil)
+ (while (re-search-forward descre nil t)
+ (beginning-of-line)
+ (let ((case-fold-search nil))
+ (looking-at org-complex-heading-regexp))
+ (let ((begin (point))
+ (heading (match-string-no-properties 4)))
+ (unless (or (and
+ org-refile-target-verify-function
+ (not
+ (funcall org-refile-target-verify-function)))
+ (not heading))
+ (let ((re (format org-complex-heading-regexp-format
+ (regexp-quote heading)))
+ (target
+ (if (not org-refile-use-outline-path) heading
+ (mapconcat
+ #'identity
+ (append
+ (pcase org-refile-use-outline-path
+ (`file (list
+ (and (buffer-file-name (buffer-base-buffer))
+ (file-name-nondirectory
+ (buffer-file-name (buffer-base-buffer))))))
+ (`full-file-path
+ (list (buffer-file-name
+ (buffer-base-buffer))))
+ (`buffer-name
+ (list (buffer-name
+ (buffer-base-buffer))))
+ (_ nil))
+ (mapcar (lambda (s) (replace-regexp-in-string
+ "/" "\\/" s nil t))
+ (org-get-outline-path t t)))
+ "/"))))
+ (push (list target f re (org-refile-marker (point)))
+ tgs)))
+ (when (= (point) begin)
+ ;; Verification function has not moved point.
+ (end-of-line)))))))
+ (when org-refile-use-cache
+ (org-refile-cache-put tgs (buffer-file-name) descre))
+ (setq targets (append tgs targets))))))
+ (message "Getting targets...done")
+ (delete-dups (nreverse targets))))
+
+(defvar org-refile-history nil
+ "History for refiling operations.")
+
+(defvar org-after-refile-insert-hook nil
+ "Hook run after `org-refile' has inserted its stuff at the new location.
+Note that this is still *before* the stuff will be removed from
+the *old* location.")
+
+(defvar org-refile-keep nil
+ "Non-nil means `org-refile' will copy instead of refile.")
+
+;;;###autoload
+(defun org-refile-copy ()
+ "Like `org-refile', but preserve the refiled subtree."
+ (interactive)
+ (let ((org-refile-keep t))
+ (org-refile nil nil nil "Copy")))
+
+;;;###autoload
+(defun org-refile-reverse (&optional arg default-buffer rfloc msg)
+ "Refile while temporarily toggling `org-reverse-note-order'.
+So if `org-refile' would append the entry as the last entry under
+the target heading, `org-refile-reverse' will prepend it as the
+first entry, and vice-versa."
+ (interactive "P")
+ (let ((org-reverse-note-order (not (org-notes-order-reversed-p))))
+ (org-refile arg default-buffer rfloc msg)))
+
+(defvar org-capture-last-stored-marker)
+
+
+;;;###autoload
+(defun org-refile (&optional arg default-buffer rfloc msg)
+ "Move the entry or entries at point to another heading.
+
+The list of target headings is compiled using the information in
+`org-refile-targets', which see.
+
+At the target location, the entry is filed as a subitem of the
+target heading. Depending on `org-reverse-note-order', the new
+subitem will either be the first or the last subitem.
+
+If there is an active region, all entries in that region will be
+refiled. However, the region must fulfill the requirement that
+the first heading sets the top-level of the moved text.
+
+With a `\\[universal-argument]' ARG, the command will only visit the target \
+location
+and not actually move anything.
+
+With a prefix `\\[universal-argument] \\[universal-argument]', go to the \
+location where the last
+refiling operation has put the subtree.
+
+With a numeric prefix argument of `2', refile to the running clock.
+
+With a numeric prefix argument of `3', emulate `org-refile-keep'
+being set to t and copy to the target location, don't move it.
+Beware that keeping refiled entries may result in duplicated ID
+properties.
+
+RFLOC can be a refile location obtained in a different way. It
+should be a list with the following 4 elements:
+
+1. Name - an identifier for the refile location, typically the
+headline text
+2. File - the file the refile location is in
+3. nil - used for generating refile location candidates, not
+needed when passing RFLOC
+4. Position - the position in the specified file of the
+headline to refile under
+
+MSG is a string to replace \"Refile\" in the default prompt with
+another verb. E.g. `org-refile-copy' sets this parameter to \"Copy\".
+
+See also `org-refile-use-outline-path'.
+
+If you are using target caching (see `org-refile-use-cache'), you
+have to clear the target cache in order to find new targets.
+This can be done with a `0' prefix (`C-0 C-c C-w') or a triple
+prefix argument (`C-u C-u C-u C-c C-w')."
+ (interactive "P")
+ (if (member arg '(0 (64)))
+ (org-refile-cache-clear)
+ (let* ((actionmsg (cond (msg msg)
+ ((equal arg 3) "Refile (and keep)")
+ (t "Refile")))
+ (regionp (org-region-active-p))
+ (region-start (and regionp (region-beginning)))
+ (region-end (and regionp (region-end)))
+ (org-refile-keep (if (equal arg 3) t org-refile-keep))
+ pos it nbuf file level reversed)
+ (setq last-command nil)
+ (when regionp
+ (goto-char region-start)
+ (beginning-of-line)
+ (setq region-start (point))
+ (unless (or (org-kill-is-subtree-p
+ (buffer-substring region-start region-end))
+ (prog1 org-refile-active-region-within-subtree
+ (let ((s (point-at-eol)))
+ (org-toggle-heading)
+ (setq region-end (+ (- (point-at-eol) s) region-end)))))
+ (user-error "The region is not a (sequence of) subtree(s)")))
+ (if (equal arg '(16))
+ (org-refile-goto-last-stored)
+ (when (or
+ (and (equal arg 2)
+ org-clock-hd-marker (marker-buffer org-clock-hd-marker)
+ (prog1
+ (setq it (list (or org-clock-heading "running clock")
+ (buffer-file-name
+ (marker-buffer org-clock-hd-marker))
+ ""
+ (marker-position org-clock-hd-marker)))
+ (setq arg nil)))
+ (setq it
+ (or rfloc
+ (let (heading-text)
+ (save-excursion
+ (unless (and arg (listp arg))
+ (org-back-to-heading t)
+ (setq heading-text
+ (replace-regexp-in-string
+ org-link-bracket-re
+ "\\2"
+ (or (nth 4 (org-heading-components))
+ ""))))
+ (org-refile-get-location
+ (cond ((and arg (listp arg)) "Goto")
+ (regionp (concat actionmsg " region to"))
+ (t (concat actionmsg " subtree \""
+ heading-text "\" to")))
+ default-buffer
+ (and (not (equal '(4) arg))
+ org-refile-allow-creating-parent-nodes)))))))
+ (setq file (nth 1 it)
+ pos (nth 3 it))
+ (when (and (not arg)
+ pos
+ (equal (buffer-file-name) file)
+ (if regionp
+ (and (>= pos region-start)
+ (<= pos region-end))
+ (and (>= pos (point))
+ (< pos (save-excursion
+ (org-end-of-subtree t t))))))
+ (error "Cannot refile to position inside the tree or region"))
+ (setq nbuf (or (find-buffer-visiting file)
+ (find-file-noselect file)))
+ (if (and arg (not (equal arg 3)))
+ (progn
+ (pop-to-buffer-same-window nbuf)
+ (goto-char (cond (pos)
+ ((org-notes-order-reversed-p) (point-min))
+ (t (point-max))))
+ (org-show-context 'org-goto))
+ (if regionp
+ (progn
+ (org-kill-new (buffer-substring region-start region-end))
+ (org-save-markers-in-region region-start region-end))
+ (org-copy-subtree 1 nil t))
+ (with-current-buffer (setq nbuf (or (find-buffer-visiting file)
+ (find-file-noselect file)))
+ (setq reversed (org-notes-order-reversed-p))
+ (org-with-wide-buffer
+ (if pos
+ (progn
+ (goto-char pos)
+ (setq level (org-get-valid-level (funcall outline-level) 1))
+ (goto-char
+ (if reversed
+ (or (outline-next-heading) (point-max))
+ (or (save-excursion (org-get-next-sibling))
+ (org-end-of-subtree t t)
+ (point-max)))))
+ (setq level 1)
+ (if (not reversed)
+ (goto-char (point-max))
+ (goto-char (point-min))
+ (or (outline-next-heading) (goto-char (point-max)))))
+ (unless (bolp) (newline))
+ (org-paste-subtree level nil nil t)
+ ;; 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-align-tags)))
+ (let ((bookmark-name (plist-get org-bookmark-names-plist
+ :last-refile)))
+ (when bookmark-name
+ (with-demoted-errors
+ (bookmark-set bookmark-name))))
+ ;; If we are refiling for capture, make sure that the
+ ;; last-capture pointers point here
+ (when (bound-and-true-p org-capture-is-refiling)
+ (let ((bookmark-name (plist-get org-bookmark-names-plist
+ :last-capture-marker)))
+ (when bookmark-name
+ (with-demoted-errors
+ (bookmark-set bookmark-name))))
+ (move-marker org-capture-last-stored-marker (point)))
+ (when (fboundp 'deactivate-mark) (deactivate-mark))
+ (run-hooks 'org-after-refile-insert-hook)))
+ (unless org-refile-keep
+ (if regionp
+ (delete-region (point) (+ (point) (- region-end region-start)))
+ (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 "%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."
+ (interactive)
+ (bookmark-jump (plist-get org-bookmark-names-plist :last-refile))
+ (message "This is the location of the last refile"))
+
+(defun org-refile--get-location (refloc tbl)
+ "When user refile to REFLOC, find the associated target in TBL.
+Also check `org-refile-target-table'."
+ (car (delq
+ nil
+ (mapcar
+ (lambda (r) (or (assoc r tbl)
+ (assoc r org-refile-target-table)))
+ (list (replace-regexp-in-string "/$" "" refloc)
+ (replace-regexp-in-string "\\([^/]\\)$" "\\1/" refloc))))))
+
+(defun org-refile-get-location (&optional prompt default-buffer new-nodes)
+ "Prompt the user for a refile location, using PROMPT.
+PROMPT should not be suffixed with a colon and a space, because
+this function appends the default value from
+`org-refile-history' automatically, if that is not empty."
+ (let ((org-refile-targets org-refile-targets)
+ (org-refile-use-outline-path org-refile-use-outline-path))
+ (setq org-refile-target-table (org-refile-get-targets default-buffer)))
+ (unless org-refile-target-table
+ (user-error "No refile targets"))
+ (let* ((cbuf (current-buffer))
+ (cfn (buffer-file-name (buffer-base-buffer cbuf)))
+ (cfunc (if (and org-refile-use-outline-path
+ org-outline-path-complete-in-steps)
+ #'org-olpath-completing-read
+ #'completing-read))
+ (extra (if org-refile-use-outline-path "/" ""))
+ (cbnex (concat (buffer-name) extra))
+ (filename (and cfn (expand-file-name cfn)))
+ (tbl (mapcar
+ (lambda (x)
+ (if (and (not (member org-refile-use-outline-path
+ '(file full-file-path)))
+ (not (equal filename (nth 1 x))))
+ (cons (concat (car x) extra " ("
+ (file-name-nondirectory (nth 1 x)) ")")
+ (cdr x))
+ (cons (concat (car x) extra) (cdr x))))
+ org-refile-target-table))
+ (completion-ignore-case t)
+ cdef
+ (prompt (concat prompt
+ (or (and (car org-refile-history)
+ (concat " (default " (car org-refile-history) ")"))
+ (and (assoc cbnex tbl) (setq cdef cbnex)
+ (concat " (default " cbnex ")"))) ": "))
+ pa answ parent-target child parent old-hist)
+ (setq old-hist org-refile-history)
+ (setq answ (funcall cfunc prompt tbl nil (not new-nodes)
+ nil 'org-refile-history
+ (or cdef (car org-refile-history))))
+ (if (setq pa (org-refile--get-location answ tbl))
+ (let ((last-refile-loc (car org-refile-history)))
+ (org-refile-check-position pa)
+ (when (or (not org-refile-history)
+ (not (eq old-hist org-refile-history))
+ (not (equal (car pa) last-refile-loc)))
+ (setq org-refile-history
+ (cons (car pa) (if (assoc last-refile-loc tbl)
+ org-refile-history
+ (cdr org-refile-history))))
+ (when (equal last-refile-loc (nth 1 org-refile-history))
+ (pop org-refile-history)))
+ pa)
+ (if (string-match "\\`\\(.*\\)/\\([^/]+\\)\\'" answ)
+ (progn
+ (setq parent (match-string 1 answ)
+ child (match-string 2 answ))
+ (setq parent-target (org-refile--get-location parent tbl))
+ (when (and parent-target
+ (or (eq new-nodes t)
+ (and (eq new-nodes 'confirm)
+ (y-or-n-p (format "Create new node \"%s\"? "
+ child)))))
+ (org-refile-new-child parent-target child)))
+ (user-error "Invalid target location")))))
+
+(defun org-refile-check-position (refile-pointer)
+ "Check if the refile pointer matches the headline to which it points."
+ (let* ((file (nth 1 refile-pointer))
+ (re (nth 2 refile-pointer))
+ (pos (nth 3 refile-pointer))
+ buffer)
+ (if (and (not (markerp pos)) (not file))
+ (user-error "Please indicate a target file in the refile path")
+ (when (org-string-nw-p re)
+ (setq buffer (if (markerp pos)
+ (marker-buffer pos)
+ (or (find-buffer-visiting file)
+ (find-file-noselect file))))
+ (with-current-buffer buffer
+ (org-with-wide-buffer
+ (goto-char pos)
+ (beginning-of-line 1)
+ (unless (looking-at-p re)
+ (user-error "Invalid refile position, please clear the cache with `C-0 C-c C-w' before refiling"))))))))
+
+(defun org-refile-new-child (parent-target child)
+ "Use refile target PARENT-TARGET to add new CHILD below it."
+ (unless parent-target
+ (error "Cannot find parent for new node"))
+ (let ((file (nth 1 parent-target))
+ (pos (nth 3 parent-target))
+ level)
+ (with-current-buffer (or (find-buffer-visiting file)
+ (find-file-noselect file))
+ (org-with-wide-buffer
+ (if pos
+ (goto-char pos)
+ (goto-char (point-max))
+ (unless (bolp) (newline)))
+ (when (looking-at org-outline-regexp)
+ (setq level (funcall outline-level))
+ (org-end-of-subtree t t))
+ (org-back-over-empty-lines)
+ (insert "\n" (make-string
+ (if pos (org-get-valid-level level 1) 1) ?*)
+ " " child "\n")
+ (beginning-of-line 0)
+ (list (concat (car parent-target) "/" child) file "" (point))))))
+
+(defun org-olpath-completing-read (prompt collection &rest args)
+ "Read an outline path like a file name."
+ (let ((thetable collection))
+ (apply #'completing-read
+ prompt
+ (lambda (string predicate &optional flag)
+ (cond
+ ((eq flag nil) (try-completion string thetable))
+ ((eq flag t)
+ (let ((l (length string)))
+ (mapcar (lambda (x)
+ (let ((r (substring x l))
+ (f (if (string-match " ([^)]*)$" x)
+ (match-string 0 x)
+ "")))
+ (if (string-match "/" r)
+ (concat string (substring r 0 (match-end 0)) f)
+ x)))
+ (all-completions string thetable predicate))))
+ ;; Exact match?
+ ((eq flag 'lambda) (assoc string thetable))))
+ args)))
+
+(provide 'org-refile)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-refile.el ends here
diff --git a/elpa/org-9.5.2/org-refile.elc b/elpa/org-9.5.2/org-refile.elc
new file mode 100644
index 0000000..df7fc03
--- /dev/null
+++ b/elpa/org-9.5.2/org-refile.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-src.el b/elpa/org-9.5.2/org-src.el
new file mode 100644
index 0000000..8d02cf4
--- /dev/null
+++ b/elpa/org-9.5.2/org-src.el
@@ -0,0 +1,1311 @@
+;;; org-src.el --- Source code examples in Org -*- lexical-binding: t; -*-
+;;
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+;;
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; Bastien Guerry <bzg@gnu.org>
+;; Dan Davison <davison at stats dot ox dot ac dot uk>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file contains the code dealing with source code examples in
+;; Org mode.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ob-comint)
+(require 'org-macs)
+(require 'org-compat)
+(require 'org-keys)
+
+(declare-function org-mode "org" ())
+(declare-function org--get-expected-indentation "org" (element contentsp))
+(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))
+(declare-function org-element-lineage "org-element"
+ (blob &optional types with-self))
+(declare-function org-element-property "org-element" (property element))
+(declare-function org-element-type "org-element" (element))
+(declare-function org-footnote-goto-definition "org-footnote"
+ (label &optional location))
+
+(defvar org-inhibit-startup)
+
+(defcustom org-edit-src-turn-on-auto-save nil
+ "Non-nil means turn `auto-save-mode' on when editing a source block.
+This will save the content of the source code editing buffer into
+a newly created file, not the base buffer for this source block.
+
+If you want to regularly save the base buffer instead of the source
+code editing buffer, see `org-edit-src-auto-save-idle-delay' instead."
+ :group 'org-edit-structure
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defcustom org-edit-src-auto-save-idle-delay 0
+ "Delay before saving a source code buffer back into its base buffer.
+When a positive integer N, save after N seconds of idle time.
+When 0 (the default), don't auto-save.
+
+If you want to save the source code buffer itself, don't use this.
+Check `org-edit-src-turn-on-auto-save' instead."
+ :group 'org-edit-structure
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'integer)
+
+(defcustom org-coderef-label-format "(ref:%s)"
+ "The default coderef format.
+This format string will be used to search for coderef labels in literal
+examples (EXAMPLE and SRC blocks). The format can be overwritten in
+an individual literal example with the -l option, like
+
+#+BEGIN_SRC pascal +n -r -l \"((%s))\"
+...
+#+END_SRC
+
+If you want to use this for HTML export, make sure that the format does
+not introduce special font-locking, and avoid the HTML special
+characters `<', `>', and `&'. The reason for this restriction is that
+the labels are searched for only after htmlize has done its job."
+ :group 'org-edit-structure ; FIXME this is not in the right group
+ :type 'string)
+
+(defcustom org-edit-fixed-width-region-mode 'artist-mode
+ "The mode that should be used to edit fixed-width regions.
+These are the regions where each line starts with a colon."
+ :group 'org-edit-structure
+ :type '(choice
+ (const artist-mode)
+ (const picture-mode)
+ (const fundamental-mode)
+ (function :tag "Other (specify)")))
+
+(defcustom org-src-preserve-indentation nil
+ "If non-nil preserve leading whitespace characters on export.
+\\<org-mode-map>
+If non-nil leading whitespace characters in source code blocks
+are preserved on export, and when switching between the org
+buffer and the language mode edit buffer.
+
+When this variable is nil, after editing with `\\[org-edit-src-code]',
+the minimum (across-lines) number of leading whitespace characters
+are removed from all lines, and the code block is uniformly indented
+according to the value of `org-edit-src-content-indentation'."
+ :group 'org-edit-structure
+ :type 'boolean)
+
+(defcustom org-edit-src-content-indentation 2
+ "Indentation for the content of a source code block.
+
+This should be the number of spaces added to the indentation of the #+begin
+line in order to compute the indentation of the block content after
+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
+ :safe #'wholenump)
+
+(defcustom org-edit-src-persistent-message t
+ "Non-nil means show persistent exit help message while editing src examples.
+The message is shown in the header-line, which will be created in the
+first line of the window showing the editing buffer."
+ :group 'org-edit-structure
+ :type 'boolean)
+
+(defcustom org-src-ask-before-returning-to-edit-buffer t
+ "Non-nil means ask before switching to an existing edit buffer.
+If nil, when `org-edit-src-code' is used on a block that already
+has an active edit buffer, it will switch to that edit buffer
+immediately; otherwise it will ask whether you want to return to
+the existing edit buffer."
+ :group 'org-edit-structure
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defcustom org-src-window-setup 'reorganize-frame
+ "How the source code edit buffer should be displayed.
+Possible values for this option are:
+
+plain Show edit buffer using `display-buffer'. Users can
+ further control the display behavior by modifying
+ `display-buffer-alist' and its relatives.
+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.
+split-window-right Show edit buffer to the right of 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.
+other-frame Use `switch-to-buffer-other-frame' to display edit buffer.
+ Also, when exiting the edit buffer, kill that frame.
+
+Values that modify the window layout (reorganize-frame, split-window-below,
+split-window-right) will restore the layout after exiting the edit buffer."
+ :group 'org-edit-structure
+ :type '(choice
+ (const current-window)
+ (const split-window-below)
+ (const split-window-right)
+ (const other-frame)
+ (const other-window)
+ (const reorganize-frame)))
+
+(defvar org-src-mode-hook nil
+ "Hook run after Org switched a source code snippet to its Emacs mode.
+\\<org-mode-map>
+This hook will run:
+- when editing a source code snippet with `\\[org-edit-special]'
+- when formatting a source code snippet for export with htmlize.
+
+You may want to use this hook for example to turn off `outline-minor-mode'
+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
+ '(("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 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
+ (string "Language name")
+ (symbol "Major mode"))))
+
+(defcustom org-src-block-faces nil
+ "Alist of faces to be used for source-block.
+Each element is a cell of the format
+
+ (\"language\" FACE)
+
+Where FACE is either a defined face or an anonymous face.
+
+For instance, the following value would color the background of
+emacs-lisp source blocks and python source blocks in purple and
+green, respectability.
+
+ \\='((\"emacs-lisp\" (:background \"#EEE2FF\"))
+ (\"python\" (:background \"#e5ffb8\")))"
+ :group 'org-edit-structure
+ :type '(repeat (list (string :tag "language")
+ (choice
+ (face :tag "Face")
+ (sexp :tag "Anonymous face"))))
+ :version "26.1"
+ :package-version '(Org . "9.0"))
+
+(defcustom org-src-tab-acts-natively t
+ "If non-nil, the effect of TAB in a code block is as if it were
+issued in the language major mode buffer."
+ :type 'boolean
+ :package-version '(Org . "9.4")
+ :group 'org-babel)
+
+
+
+;;; Internal functions and variables
+
+(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--content-indentation nil)
+(put 'org-src--content-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.")
+(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)
+
+(defvar-local org-src--preserve-blank-line nil)
+(put 'org-src--preserve-blank-line 'permanent-local t)
+
+(defun org-src--construct-edit-buffer-name (org-buffer-name lang)
+ "Construct the buffer name for a source editing buffer."
+ (concat "*Org Src " org-buffer-name "[ " lang " ]*"))
+
+(defun org-src--edit-buffer (beg end)
+ "Return buffer editing area between BEG and END.
+Return nil if there is no such buffer."
+ (catch 'exit
+ (dolist (b (buffer-list))
+ (with-current-buffer b
+ (and (org-src-edit-buffer-p)
+ (= beg org-src--beg-marker)
+ (eq (marker-buffer beg) (marker-buffer org-src--beg-marker))
+ (= end org-src--end-marker)
+ (eq (marker-buffer end) (marker-buffer org-src--end-marker))
+ (throw 'exit b))))))
+
+(defun org-src--coordinates (pos beg end)
+ "Return coordinates of POS relatively to BEG and END.
+POS, BEG and END are buffer positions. Return value is either
+a cons cell (LINE . COLUMN) or symbol `end'. See also
+`org-src--goto-coordinates'."
+ (if (>= pos end) 'end
+ (org-with-wide-buffer
+ (goto-char (max beg pos))
+ (cons (count-lines (save-excursion (goto-char beg) (line-beginning-position))
+ (line-beginning-position))
+ ;; Column is relative to the end of line to avoid problems of
+ ;; comma escaping or colons appended in front of the line.
+ (- (point) (min end (line-end-position)))))))
+
+(defun org-src--goto-coordinates (coord beg end)
+ "Move to coordinates COORD relatively to BEG and END.
+COORD are coordinates, as returned by `org-src--coordinates',
+which see. BEG and END are buffer positions."
+ (goto-char
+ (if (eq coord 'end) (max (1- end) beg)
+ ;; If BEG happens to be located outside of the narrowed part of
+ ;; the buffer, widen it first.
+ (org-with-wide-buffer
+ (goto-char beg)
+ (forward-line (car coord))
+ (max (point)
+ (+ (min end (line-end-position))
+ (cdr coord)))))))
+
+(defun org-src--contents-area (datum)
+ "Return contents boundaries of DATUM.
+DATUM is an element or object. Return a list (BEG END CONTENTS)
+where BEG and END are buffer positions and CONTENTS is a string."
+ (let ((type (org-element-type datum)))
+ (org-with-wide-buffer
+ (cond
+ ((eq type 'footnote-definition)
+ (let* ((beg (progn
+ (goto-char (org-element-property :post-affiliated datum))
+ (search-forward "]")))
+ (end (or (org-element-property :contents-end datum) beg)))
+ (list beg end (buffer-substring-no-properties beg end))))
+ ((eq type 'inline-src-block)
+ (let ((beg (progn (goto-char (org-element-property :begin datum))
+ (search-forward "{" (line-end-position) t)))
+ (end (progn (goto-char (org-element-property :end datum))
+ (search-backward "}" (line-beginning-position) t))))
+ (list beg end (buffer-substring-no-properties beg end))))
+ ((eq type 'latex-fragment)
+ (let ((beg (org-element-property :begin datum))
+ (end (org-with-point-at (org-element-property :end datum)
+ (skip-chars-backward " \t")
+ (point))))
+ (list beg end (buffer-substring-no-properties beg end))))
+ ((org-element-property :contents-begin datum)
+ (let ((beg (org-element-property :contents-begin datum))
+ (end (org-element-property :contents-end datum)))
+ (list beg end (buffer-substring-no-properties beg end))))
+ ((memq type '(example-block export-block src-block))
+ (list (progn (goto-char (org-element-property :post-affiliated datum))
+ (line-beginning-position 2))
+ (progn (goto-char (org-element-property :end datum))
+ (skip-chars-backward " \r\t\n")
+ (line-beginning-position 1))
+ (org-element-property :value datum)))
+ ((memq type '(fixed-width latex-environment table))
+ (let ((beg (org-element-property :post-affiliated datum))
+ (end (progn (goto-char (org-element-property :end datum))
+ (skip-chars-backward " \r\t\n")
+ (line-beginning-position 2))))
+ (list beg
+ end
+ (if (eq type 'fixed-width) (org-element-property :value datum)
+ (buffer-substring-no-properties beg end)))))
+ (t (error "Unsupported element or object: %s" type))))))
+
+(defun org-src--make-source-overlay (beg end edit-buffer)
+ "Create overlay between BEG and END positions and return it.
+EDIT-BUFFER is the buffer currently editing area between BEG and
+END."
+ (let ((overlay (make-overlay beg end)))
+ (overlay-put overlay 'face 'secondary-selection)
+ (overlay-put overlay 'edit-buffer edit-buffer)
+ (overlay-put overlay 'help-echo
+ "Click with mouse-1 to switch to buffer editing this segment")
+ (overlay-put overlay 'face 'secondary-selection)
+ (overlay-put overlay 'keymap
+ (let ((map (make-sparse-keymap)))
+ (define-key map [mouse-1] 'org-edit-src-continue)
+ map))
+ (let ((read-only
+ (list
+ (lambda (&rest _)
+ (user-error
+ "Cannot modify an area being edited in a dedicated buffer")))))
+ (overlay-put overlay 'modification-hooks read-only)
+ (overlay-put overlay 'insert-in-front-hooks read-only)
+ (overlay-put overlay 'insert-behind-hooks read-only))
+ overlay))
+
+(defun org-src--remove-overlay ()
+ "Remove overlay from current source buffer."
+ (when (overlayp org-src--overlay) (delete-overlay org-src--overlay)))
+
+(defun org-src--on-datum-p (datum)
+ "Non-nil when point is on DATUM.
+DATUM is an element or an object. Consider blank lines or white
+spaces after it as being outside."
+ (and (>= (point) (org-element-property :begin datum))
+ (<= (point)
+ (org-with-wide-buffer
+ (goto-char (org-element-property :end datum))
+ (skip-chars-backward " \r\t\n")
+ (if (eq (org-element-class datum) 'element)
+ (line-end-position)
+ (point))))))
+
+(defun org-src--contents-for-write-back (write-back-buf)
+ "Populate WRITE-BACK-BUF with contents in the appropriate format.
+Assume point is in the corresponding edit buffer."
+ (let ((indentation-offset
+ (if org-src--preserve-indentation 0
+ (+ (or org-src--block-indentation 0)
+ (if (memq org-src--source-type '(example-block src-block))
+ org-src--content-indentation
+ 0))))
+ (use-tabs? (and (> org-src--tab-width 0) t))
+ (preserve-fl (eq org-src--source-type 'latex-fragment))
+ (source-tab-width org-src--tab-width)
+ (contents (org-with-wide-buffer
+ (let ((eol (line-end-position)))
+ (list (buffer-substring (point-min) eol)
+ (buffer-substring eol (point-max))))))
+ (write-back org-src--allow-write-back)
+ (preserve-blank-line org-src--preserve-blank-line)
+ marker)
+ (with-current-buffer write-back-buf
+ ;; Reproduce indentation parameters from source buffer.
+ (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 (car contents)))
+ (setq marker (point-marker))
+ (insert (org-no-properties (car (cdr contents))))
+ (goto-char (point-min))
+ (when (functionp write-back) (save-excursion (funcall write-back)))
+ ;; Add INDENTATION-OFFSET to every line in buffer,
+ ;; unless indentation is meant to be preserved.
+ (when (> indentation-offset 0)
+ (when preserve-fl (forward-line))
+ (while (not (eobp))
+ (skip-chars-forward " \t")
+ (when (or (not (eolp)) ; not a blank line
+ (and (eq (point) (marker-position marker)) ; current line
+ preserve-blank-line))
+ (let ((i (current-column)))
+ (delete-region (line-beginning-position) (point))
+ (indent-to (+ i indentation-offset))))
+ (forward-line)))
+ (set-marker marker nil))))
+
+(defun org-src--edit-element
+ (datum name &optional initialize write-back contents remote)
+ "Edit DATUM contents in a dedicated buffer NAME.
+
+INITIALIZE is a function to call upon creating the buffer.
+
+When WRITE-BACK is non-nil, assume contents will replace original
+region. Moreover, if it is a function, apply it in the edit
+buffer, from point min, before returning the contents.
+
+When CONTENTS is non-nil, display them in the edit buffer.
+Otherwise, show DATUM contents as specified by
+`org-src--contents-area'.
+
+When REMOTE is non-nil, do not try to preserve point or mark when
+moving from the edit area to the source.
+
+Leave point in edit buffer."
+ (when (memq org-src-window-setup '(reorganize-frame
+ split-window-below
+ split-window-right))
+ (setq org-src--saved-temp-window-config (current-window-configuration)))
+ (let* ((area (org-src--contents-area datum))
+ (beg (copy-marker (nth 0 area)))
+ (end (copy-marker (nth 1 area) t))
+ (old-edit-buffer (org-src--edit-buffer beg end))
+ (contents (or contents (nth 2 area))))
+ (if (and old-edit-buffer
+ (or (not org-src-ask-before-returning-to-edit-buffer)
+ (y-or-n-p "Return to existing edit buffer ([n] will revert changes)? ")))
+ ;; Move to existing buffer.
+ (org-src-switch-to-buffer old-edit-buffer 'return)
+ ;; Discard old edit buffer.
+ (when old-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))
+ (block-ind (org-with-point-at (org-element-property :begin datum)
+ (cond
+ ((save-excursion (skip-chars-backward " \t") (bolp))
+ (current-indentation))
+ ((org-element-property :parent datum)
+ (org--get-expected-indentation
+ (org-element-property :parent datum) nil))
+ (t (current-indentation)))))
+ (content-ind org-edit-src-content-indentation)
+ (blank-line (save-excursion (beginning-of-line)
+ (looking-at-p "^[[:space:]]*$")))
+ (empty-line (and blank-line (looking-at-p "^$")))
+ (preserve-blank-line (or (and blank-line (not empty-line))
+ (and empty-line (= (+ block-ind content-ind) 0))))
+ (preserve-ind
+ (and (memq type '(example-block src-block))
+ (or (org-element-property :preserve-indent datum)
+ org-src-preserve-indentation)))
+ ;; Store relative positions of mark (if any) and point
+ ;; within the edited area.
+ (point-coordinates (and (not remote)
+ (org-src--coordinates (point) beg end)))
+ (mark-coordinates (and (not remote)
+ (org-region-active-p)
+ (let ((m (mark)))
+ (and (>= m beg) (>= end m)
+ (org-src--coordinates m beg end)))))
+ ;; Generate a new edit buffer.
+ (buffer (generate-new-buffer name))
+ ;; Add an overlay on top of source.
+ (overlay (org-src--make-source-overlay beg end buffer)))
+ ;; Switch to edit buffer.
+ (org-src-switch-to-buffer buffer 'edit)
+ ;; Insert contents.
+ (insert contents)
+ (remove-text-properties (point-min) (point-max)
+ '(display nil invisible nil intangible nil))
+ (let ((lf (eq type 'latex-fragment)))
+ (unless preserve-ind (org-do-remove-indentation (and lf block-ind) lf)))
+ (set-buffer-modified-p nil)
+ (setq buffer-file-name nil)
+ ;; Initialize buffer.
+ (when (functionp initialize)
+ (let ((org-inhibit-startup t))
+ (condition-case e
+ (funcall initialize)
+ (error (message "Initialization fails with: %S"
+ (error-message-string e))))))
+ ;; Transmit buffer-local variables for exit function. It must
+ ;; be done after initializing major mode, as this operation
+ ;; may reset them otherwise.
+ (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 block-ind)
+ (setq org-src--content-indentation content-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)
+ (setq org-src--preserve-blank-line preserve-blank-line)
+ ;; Start minor mode.
+ (org-src-mode)
+ ;; Clear undo information so we cannot undo back to the
+ ;; initial empty buffer.
+ (buffer-disable-undo (current-buffer))
+ (buffer-enable-undo)
+ ;; Move mark and point in edit buffer to the corresponding
+ ;; location.
+ (if remote
+ (progn
+ ;; Put point at first non read-only character after
+ ;; leading blank.
+ (goto-char
+ (or (text-property-any (point-min) (point-max) 'read-only nil)
+ (point-max)))
+ (skip-chars-forward " \r\t\n"))
+ ;; Set mark and point.
+ (when mark-coordinates
+ (org-src--goto-coordinates mark-coordinates (point-min) (point-max))
+ (push-mark (point) 'no-message t)
+ (setq deactivate-mark nil))
+ (org-src--goto-coordinates
+ point-coordinates (point-min) (point-max)))))))
+
+
+
+;;; Fontification of source blocks
+
+(defun org-src-font-lock-fontify-block (lang start end)
+ "Fontify code block.
+This function is called by Emacs' automatic fontification, as long
+as `org-src-fontify-natively' is non-nil."
+ (let ((lang-mode (org-src-get-lang-mode lang)))
+ (when (fboundp lang-mode)
+ (let ((string (buffer-substring-no-properties start end))
+ (modified (buffer-modified-p))
+ (org-buffer (current-buffer)))
+ (remove-text-properties start end '(face nil))
+ (with-current-buffer
+ (get-buffer-create
+ (format " *org-src-fontification:%s*" lang-mode))
+ (let ((inhibit-modification-hooks nil))
+ (erase-buffer)
+ ;; Add string and a final space to ensure property change.
+ (insert string " "))
+ (unless (eq major-mode lang-mode) (funcall lang-mode))
+ (org-font-lock-ensure)
+ (let ((pos (point-min)) next)
+ (while (setq next (next-property-change pos))
+ ;; Handle additional properties from font-lock, so as to
+ ;; preserve, e.g., composition.
+ (dolist (prop (cons 'face font-lock-extra-managed-props))
+ (let ((new-prop (get-text-property pos prop)))
+ (put-text-property
+ (+ start (1- pos)) (1- (+ start next)) prop new-prop
+ org-buffer)))
+ (setq pos next))))
+ ;; Add Org faces.
+ (let ((src-face (nth 1 (assoc-string lang org-src-block-faces t))))
+ (when (or (facep src-face) (listp src-face))
+ (font-lock-append-text-property start end 'face src-face))
+ (font-lock-append-text-property start end 'face 'org-block))
+ (add-text-properties
+ start end
+ '(font-lock-fontified t fontified t font-lock-multiline t))
+ (set-buffer-modified-p modified)))))
+
+
+;;; Escape contents
+
+(defun org-escape-code-in-region (beg end)
+ "Escape lines between BEG and END.
+Escaping happens when a line starts with \"*\", \"#+\", \",*\" or
+\",#+\" by appending a comma to it."
+ (interactive "r")
+ (save-excursion
+ (goto-char end)
+ (while (re-search-backward "^[ \t]*\\(,*\\(?:\\*\\|#\\+\\)\\)" beg t)
+ (save-excursion (replace-match ",\\1" nil nil nil 1)))))
+
+(defun org-escape-code-in-string (s)
+ "Escape lines in string S.
+Escaping happens when a line starts with \"*\", \"#+\", \",*\" or
+\",#+\" by appending a comma to it."
+ (replace-regexp-in-string "^[ \t]*\\(,*\\(?:\\*\\|#\\+\\)\\)" ",\\1"
+ s nil nil 1))
+
+(defun org-unescape-code-in-region (beg end)
+ "Un-escape lines between BEG and END.
+Un-escaping happens by removing the first comma on lines starting
+with \",*\", \",#+\", \",,*\" and \",,#+\"."
+ (interactive "r")
+ (save-excursion
+ (goto-char end)
+ (while (re-search-backward "^[ \t]*,*\\(,\\)\\(?:\\*\\|#\\+\\)" beg t)
+ (save-excursion (replace-match "" nil nil nil 1)))))
+
+(defun org-unescape-code-in-string (s)
+ "Un-escape lines in string S.
+Un-escaping happens by removing the first comma on lines starting
+with \",*\", \",#+\", \",,*\" and \",,#+\"."
+ (replace-regexp-in-string
+ "^[ \t]*,*\\(,\\)\\(?:\\*\\|#\\+\\)" "" s nil nil 1))
+
+
+
+;;; Org src minor mode
+
+(defvar org-src-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "\C-c'" 'org-edit-src-exit)
+ (define-key map "\C-c\C-k" 'org-edit-src-abort)
+ (define-key map "\C-x\C-s" 'org-edit-src-save)
+ map))
+
+(define-minor-mode org-src-mode
+ "Minor mode for language major mode buffers generated by Org.
+\\<org-mode-map>
+This minor mode is turned on in two situations:
+ - when editing a source code snippet with `\\[org-edit-special]'
+ - when formatting a source code snippet for export with htmlize.
+
+\\{org-src-mode-map}
+
+See also `org-src-mode-hook'."
+ :lighter " OrgSrc"
+ (when org-edit-src-persistent-message
+ (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 \
+`\\[org-edit-src-abort]'"))))
+ ;; Possibly activate various auto-save features (for the edit buffer
+ ;; or the source buffer).
+ (when org-edit-src-turn-on-auto-save
+ (setq buffer-auto-save-file-name
+ (concat (make-temp-name "org-src-")
+ (format-time-string "-%Y-%d-%m")
+ ".txt")))
+ (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
+ (lambda ()
+ (save-excursion
+ (let (edit-flag)
+ (dolist (b (buffer-list))
+ (with-current-buffer b
+ (when (org-src-edit-buffer-p)
+ (unless edit-flag (setq edit-flag t))
+ (when (buffer-modified-p) (org-edit-src-save)))))
+ (unless edit-flag
+ (cancel-timer org-src--auto-save-timer)
+ (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 write-contents-functions '(org-edit-src-save)))
+ (setq buffer-read-only t))))
+
+(add-hook 'org-src-mode-hook #'org-src-mode-configure-edit-buffer)
+
+
+
+;;; Babel related functions
+
+(defun org-src-associate-babel-session (info)
+ "Associate edit buffer with comint session."
+ (interactive)
+ (let ((session (cdr (assq :session (nth 2 info)))))
+ (and session (not (string= session "none"))
+ (org-babel-comint-buffer-livep session)
+ (let ((f (intern (format "org-babel-%s-associate-session"
+ (nth 0 info)))))
+ (and (fboundp f) (funcall f session))))))
+
+(defun org-src-babel-configure-edit-buffer ()
+ (when org-src--babel-info
+ (org-src-associate-babel-session org-src--babel-info)))
+
+(add-hook 'org-src-mode-hook #'org-src-babel-configure-edit-buffer)
+
+
+;;; Public API
+
+(defmacro org-src-do-at-code-block (&rest body)
+ "Execute BODY from an edit buffer in the Org mode buffer."
+ (declare (debug (body)))
+ `(let ((beg-marker org-src--beg-marker))
+ (when beg-marker
+ (with-current-buffer (marker-buffer beg-marker)
+ (goto-char beg-marker)
+ ,@body))))
+
+(defun org-src-do-key-sequence-at-code-block (&optional key)
+ "Execute key sequence at code block in the source Org buffer.
+The command bound to KEY in the Org-babel key map is executed
+remotely with point temporarily at the start of the code block in
+the Org buffer.
+
+This command is not bound to a key by default, to avoid conflicts
+with language major mode bindings. To bind it to C-c @ in all
+language major modes, you could use
+
+ (add-hook \\='org-src-mode-hook
+ (lambda () (define-key org-src-mode-map \"\\C-c@\"
+ \\='org-src-do-key-sequence-at-code-block)))
+
+In that case, for example, C-c @ t issued in code edit buffers
+would tangle the current Org code block, C-c @ e would execute
+the block and C-c @ h would display the other available
+Org-babel commands."
+ (interactive "kOrg-babel key: ")
+ (if (equal key (kbd "C-g")) (keyboard-quit)
+ (org-edit-src-save)
+ (org-src-do-at-code-block
+ (call-interactively (lookup-key org-babel-map key)))))
+
+(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."
+ (intern
+ (concat
+ (let ((l (or (cdr (assoc lang org-src-lang-modes)) lang)))
+ (if (symbolp l) (symbol-name l) l))
+ "-mode")))
+
+(defun org-src-edit-buffer-p (&optional buffer)
+ "Non-nil when current buffer is a source editing buffer.
+If BUFFER is non-nil, test it instead."
+ (let ((buffer (org-base-buffer (or buffer (current-buffer)))))
+ (and (buffer-live-p buffer)
+ (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
+ (`plain
+ (when (eq context 'exit) (quit-restore-window))
+ (pop-to-buffer buffer))
+ (`current-window (pop-to-buffer-same-window buffer))
+ (`other-window
+ (let ((cur-win (selected-window)))
+ (org-switch-to-buffer-other-window buffer)
+ (when (eq context 'exit) (quit-restore-window cur-win))))
+ (`split-window-below
+ (if (eq context 'exit)
+ (delete-window)
+ (select-window (split-window-vertically)))
+ (pop-to-buffer-same-window buffer))
+ (`split-window-right
+ (if (eq context 'exit)
+ (delete-window)
+ (select-window (split-window-horizontally)))
+ (pop-to-buffer-same-window buffer))
+ (`other-frame
+ (pcase context
+ (`exit
+ (let ((frame (selected-frame)))
+ (switch-to-buffer-other-frame buffer)
+ (delete-frame frame)))
+ (`save
+ (kill-buffer (current-buffer))
+ (pop-to-buffer-same-window buffer))
+ (_ (switch-to-buffer-other-frame buffer))))
+ (`reorganize-frame
+ (when (eq context 'edit) (delete-other-windows))
+ (org-switch-to-buffer-other-window buffer)
+ (when (eq context 'exit) (delete-other-windows)))
+ (`switch-invisibly (set-buffer buffer))
+ (_
+ (message "Invalid value %s for `org-src-window-setup'"
+ org-src-window-setup)
+ (pop-to-buffer-same-window buffer))))
+
+(defun org-src-coderef-format (&optional element)
+ "Return format string for block at point.
+
+When optional argument ELEMENT is provided, use that block.
+Otherwise, assume point is either at a source block, at an
+example block.
+
+If point is in an edit buffer, retrieve format string associated
+to the remote source block."
+ (cond
+ ((and element (org-element-property :label-fmt element)))
+ ((org-src-edit-buffer-p) (org-src-do-at-code-block (org-src-coderef-format)))
+ ((org-element-property :label-fmt (org-element-at-point)))
+ (t org-coderef-label-format)))
+
+(defun org-src-coderef-regexp (fmt &optional label)
+ "Return regexp matching a coderef format string FMT.
+
+When optional argument LABEL is non-nil, match coderef for that
+label only.
+
+Match group 1 contains the full coderef string with surrounding
+white spaces. Match group 2 contains the same string without any
+surrounding space. Match group 3 contains the label.
+
+A coderef format regexp can only match at the end of a line."
+ (format "\\([ \t]*\\(%s\\)[ \t]*\\)$"
+ (replace-regexp-in-string
+ "%s"
+ (if label (regexp-quote label) "\\([-a-zA-Z0-9_][-a-zA-Z0-9_ ]*\\)")
+ (regexp-quote fmt)
+ nil t)))
+
+(defun org-edit-footnote-reference ()
+ "Edit definition of footnote reference at point."
+ (interactive)
+ (let* ((context (org-element-context))
+ (label (org-element-property :label context)))
+ (unless (and (eq (org-element-type context) 'footnote-reference)
+ (org-src--on-datum-p context))
+ (user-error "Not on a footnote reference"))
+ (unless label (user-error "Cannot edit remotely anonymous footnotes"))
+ (let* ((definition (org-with-wide-buffer
+ (org-footnote-goto-definition label)
+ (backward-char)
+ (org-element-context)))
+ (inline? (eq 'footnote-reference (org-element-type definition)))
+ (contents
+ (org-with-wide-buffer
+ (buffer-substring-no-properties
+ (or (org-element-property :post-affiliated definition)
+ (org-element-property :begin definition))
+ (cond
+ (inline? (1+ (org-element-property :contents-end definition)))
+ ((org-element-property :contents-end definition))
+ (t (goto-char (org-element-property :post-affiliated definition))
+ (line-end-position)))))))
+ (add-text-properties
+ 0
+ (progn (string-match (if inline? "\\`\\[fn:.*?:" "\\`.*?\\]") contents)
+ (match-end 0))
+ '(read-only "Cannot edit footnote label" front-sticky t rear-nonsticky t)
+ contents)
+ (when inline?
+ (let ((l (length contents)))
+ (add-text-properties
+ (1- l) l
+ '(read-only "Cannot edit past footnote reference"
+ front-sticky nil rear-nonsticky nil)
+ contents)))
+ (org-src--edit-element
+ definition
+ (format "*Edit footnote [%s]*" label)
+ (let ((source (current-buffer)))
+ (lambda ()
+ (org-mode)
+ (org-clone-local-variables source)))
+ (lambda ()
+ (if (not inline?) (delete-region (point) (search-forward "]"))
+ (delete-region (point) (search-forward ":" nil t 2))
+ (delete-region (1- (point-max)) (point-max))
+ (when (re-search-forward "\n[ \t]*\n" nil t)
+ (user-error "Inline definitions cannot contain blank lines"))
+ ;; If footnote reference belongs to a table, make sure to
+ ;; remove any newline characters in order to preserve
+ ;; table's structure.
+ (when (org-element-lineage definition '(table-cell))
+ (while (search-forward "\n" nil t) (replace-match " ")))))
+ contents
+ 'remote))
+ ;; Report success.
+ t))
+
+(defun org-edit-table.el ()
+ "Edit \"table.el\" table at point.
+\\<org-src-mode-map>
+A new buffer is created and the table is copied into it. Then
+the table is recognized with `table-recognize'. When done
+editing, exit with `\\[org-edit-src-exit]'. The edited text will \
+then replace
+the area in the Org mode buffer.
+
+Throw an error when not at such a table."
+ (interactive)
+ (let ((element (org-element-at-point)))
+ (unless (and (eq (org-element-type element) 'table)
+ (eq (org-element-property :type element) 'table.el)
+ (org-src--on-datum-p element))
+ (user-error "Not in a table.el table"))
+ (org-src--edit-element
+ element
+ (org-src--construct-edit-buffer-name (buffer-name) "Table")
+ #'text-mode t)
+ (when (bound-and-true-p flyspell-mode) (flyspell-mode -1))
+ (table-recognize)
+ t))
+
+(defun org-edit-latex-fragment ()
+ "Edit LaTeX fragment at point."
+ (interactive)
+ (let ((context (org-element-context)))
+ (unless (and (eq 'latex-fragment (org-element-type context))
+ (org-src--on-datum-p context))
+ (user-error "Not on a LaTeX fragment"))
+ (let* ((contents
+ (buffer-substring-no-properties
+ (org-element-property :begin context)
+ (- (org-element-property :end context)
+ (org-element-property :post-blank context))))
+ (delim-length (if (string-match "\\`\\$[^$]" contents) 1 2)))
+ ;; Make the LaTeX deliminators read-only.
+ (add-text-properties 0 delim-length
+ (list 'read-only "Cannot edit LaTeX deliminator"
+ 'front-sticky t
+ 'rear-nonsticky t)
+ contents)
+ (let ((l (length contents)))
+ (add-text-properties (- l delim-length) l
+ (list 'read-only "Cannot edit LaTeX deliminator"
+ 'front-sticky nil
+ 'rear-nonsticky nil)
+ contents))
+ (org-src--edit-element
+ context
+ (org-src--construct-edit-buffer-name (buffer-name) "LaTeX fragment")
+ (org-src-get-lang-mode "latex")
+ (lambda ()
+ ;; Blank lines break things, replace with a single newline.
+ (while (re-search-forward "\n[ \t]*\n" nil t) (replace-match "\n"))
+ ;; If within a table a newline would disrupt the structure,
+ ;; so remove newlines.
+ (goto-char (point-min))
+ (when (org-element-lineage context '(table-cell))
+ (while (search-forward "\n" nil t) (replace-match " "))))
+ contents))
+ t))
+
+(defun org-edit-latex-environment ()
+ "Edit LaTeX environment at point.
+\\<org-src-mode-map>
+The LaTeX environment is copied into a new buffer. Major mode is
+set to the one associated to \"latex\" in `org-src-lang-modes',
+or to `latex-mode' if there is none.
+
+When done, exit with `\\[org-edit-src-exit]'. The edited text \
+will then replace
+the LaTeX environment in the Org mode buffer."
+ (interactive)
+ (let ((element (org-element-at-point)))
+ (unless (and (eq (org-element-type element) 'latex-environment)
+ (org-src--on-datum-p element))
+ (user-error "Not in a LaTeX environment"))
+ (org-src--edit-element
+ element
+ (org-src--construct-edit-buffer-name (buffer-name) "LaTeX environment")
+ (org-src-get-lang-mode "latex")
+ t)
+ t))
+
+(defun org-edit-export-block ()
+ "Edit export block at point.
+\\<org-src-mode-map>
+A new buffer is created and the block is copied into it, and the
+buffer is switched into an appropriate major mode. See also
+`org-src-lang-modes'.
+
+When done, exit with `\\[org-edit-src-exit]'. The edited text \
+will then replace
+the area in the Org mode buffer.
+
+Throw an error when not at an export block."
+ (interactive)
+ (let ((element (org-element-at-point)))
+ (unless (and (eq (org-element-type element) 'export-block)
+ (org-src--on-datum-p element))
+ (user-error "Not in an export block"))
+ (let* ((type (downcase (or (org-element-property :type element)
+ ;; Missing export-block type. Fallback
+ ;; to default mode.
+ "fundamental")))
+ (mode (org-src-get-lang-mode type)))
+ (unless (functionp mode) (error "No such language mode: %s" mode))
+ (org-src--edit-element
+ element
+ (org-src--construct-edit-buffer-name (buffer-name) type)
+ mode
+ (lambda () (org-escape-code-in-region (point-min) (point-max)))))
+ t))
+
+(defun org-edit-src-code (&optional code edit-buffer-name)
+ "Edit the source or example block at point.
+\\<org-src-mode-map>
+The code is copied to a separate buffer and the appropriate mode
+is turned on. When done, exit with `\\[org-edit-src-exit]'. This \
+will remove the
+original code in the Org buffer, and replace it with the edited
+version. See `org-src-window-setup' to configure the display of
+windows containing the Org buffer and the code buffer.
+
+When optional argument CODE is a string, edit it in a dedicated
+buffer instead.
+
+When optional argument EDIT-BUFFER-NAME is non-nil, use it as the
+name of the sub-editing buffer."
+ (interactive)
+ (let* ((element (org-element-at-point))
+ (type (org-element-type element)))
+ (unless (and (memq type '(example-block src-block))
+ (org-src--on-datum-p element))
+ (user-error "Not in a source or example block"))
+ (let* ((lang
+ (if (eq type 'src-block) (org-element-property :language element)
+ "example"))
+ (lang-f (and (eq type 'src-block) (org-src-get-lang-mode lang)))
+ (babel-info (and (eq type 'src-block)
+ (org-babel-get-src-block-info 'light)))
+ deactivate-mark)
+ (when (and (eq type 'src-block) (not (functionp lang-f)))
+ (error "No such language mode: %s" lang-f))
+ (org-src--edit-element
+ element
+ (or edit-buffer-name
+ (org-src--construct-edit-buffer-name (buffer-name) lang))
+ lang-f
+ (and (null code)
+ (lambda () (org-escape-code-in-region (point-min) (point-max))))
+ (and code (org-unescape-code-in-string code)))
+ ;; Finalize buffer.
+ (setq-local org-coderef-label-format
+ (or (org-element-property :label-fmt element)
+ org-coderef-label-format))
+ (when (eq type 'src-block)
+ (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))))
+ t)))
+
+(defun org-edit-inline-src-code ()
+ "Edit inline source code at point."
+ (interactive)
+ (let ((context (org-element-context)))
+ (unless (and (eq (org-element-type context) 'inline-src-block)
+ (org-src--on-datum-p context))
+ (user-error "Not on inline source code"))
+ (let* ((lang (org-element-property :language context))
+ (lang-f (org-src-get-lang-mode lang))
+ (babel-info (org-babel-get-src-block-info 'light))
+ deactivate-mark)
+ (unless (functionp lang-f) (error "No such language mode: %s" lang-f))
+ (org-src--edit-element
+ context
+ (org-src--construct-edit-buffer-name (buffer-name) lang)
+ lang-f
+ (lambda ()
+ ;; Inline source blocks are limited to one line.
+ (while (re-search-forward "\n[ \t]*" nil t) (replace-match " "))
+ ;; Trim contents.
+ (goto-char (point-min))
+ (skip-chars-forward " \t")
+ (delete-region (point-min) (point))
+ (goto-char (point-max))
+ (skip-chars-backward " \t")
+ (delete-region (point) (point-max))))
+ ;; Finalize buffer.
+ (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.
+ t)))
+
+(defun org-edit-fixed-width-region ()
+ "Edit the fixed-width ASCII drawing at point.
+\\<org-src-mode-map>
+This must be a region where each line starts with a colon
+followed by a space or a newline character.
+
+A new buffer is created and the fixed-width region is copied into
+it, and the buffer is switched into the major mode defined in
+`org-edit-fixed-width-region-mode', which see.
+
+When done, exit with `\\[org-edit-src-exit]'. The edited text \
+will then replace
+the area in the Org mode buffer."
+ (interactive)
+ (let ((element (org-element-at-point)))
+ (unless (and (eq (org-element-type element) 'fixed-width)
+ (org-src--on-datum-p element))
+ (user-error "Not in a fixed-width area"))
+ (org-src--edit-element
+ element
+ (org-src--construct-edit-buffer-name (buffer-name) "Fixed Width")
+ org-edit-fixed-width-region-mode
+ (lambda () (while (not (eobp)) (insert ": ") (forward-line))))
+ ;; Return success.
+ t))
+
+(defun org-edit-src-abort ()
+ "Abort editing of the src code and return to the Org buffer."
+ (interactive)
+ (let (org-src--allow-write-back) (org-edit-src-exit)))
+
+(defun org-edit-src-continue (e)
+ "Unconditionally return to buffer editing area under point.
+Throw an error if there is no such buffer."
+ (interactive "e")
+ (mouse-set-point e)
+ (let ((buf (get-char-property (point) 'edit-buffer)))
+ (if buf (org-src-switch-to-buffer buf 'continue)
+ (user-error "No sub-editing buffer for area at point"))))
+
+(defun org-edit-src-save ()
+ "Save parent buffer with current state source-code buffer."
+ (interactive)
+ (unless (org-src-edit-buffer-p) (user-error "Not in a sub-editing buffer"))
+ (set-buffer-modified-p nil)
+ (let ((write-back-buf (generate-new-buffer "*org-src-write-back*"))
+ (beg org-src--beg-marker)
+ (end org-src--end-marker)
+ (overlay org-src--overlay))
+ (org-src--contents-for-write-back write-back-buf)
+ (with-current-buffer (org-src-source-buffer)
+ (undo-boundary)
+ (goto-char beg)
+ ;; Temporarily disable read-only features of OVERLAY in order to
+ ;; insert new contents.
+ (delete-overlay overlay)
+ (let ((expecting-bol (bolp)))
+ (if (version< emacs-version "27.1")
+ (progn (delete-region beg end)
+ (insert (with-current-buffer write-back-buf (buffer-string))))
+ (save-restriction
+ (narrow-to-region beg end)
+ (replace-buffer-contents write-back-buf 0.1 nil)
+ (goto-char (point-max))))
+ (when (and expecting-bol (not (bolp))) (insert "\n")))
+ (kill-buffer write-back-buf)
+ (save-buffer)
+ (move-overlay overlay beg (point))))
+ ;; `write-contents-functions' requires the function to return
+ ;; a non-nil value so that other functions are not called.
+ t)
+
+(defun org-edit-src-exit ()
+ "Kill current sub-editing buffer and return to source buffer."
+ (interactive)
+ (unless (org-src-edit-buffer-p)
+ (error "Not in a sub-editing buffer"))
+ (let* ((beg org-src--beg-marker)
+ (end org-src--end-marker)
+ (write-back org-src--allow-write-back)
+ (remote org-src--remote)
+ (coordinates (and (not remote)
+ (org-src--coordinates (point) 1 (point-max))))
+ (write-back-buf
+ (and write-back (generate-new-buffer "*org-src-write-back*"))))
+ (when write-back (org-src--contents-for-write-back write-back-buf))
+ (set-buffer-modified-p nil)
+ ;; Switch to source buffer. Kill sub-editing buffer.
+ (let ((edit-buffer (current-buffer))
+ (source-buffer (marker-buffer beg)))
+ (unless source-buffer
+ (when write-back-buf (kill-buffer write-back-buf))
+ (error "Source buffer disappeared. Aborting"))
+ (org-src-switch-to-buffer source-buffer 'exit)
+ (kill-buffer edit-buffer))
+ ;; Insert modified code. Ensure it ends with a newline character.
+ (org-with-wide-buffer
+ (when (and write-back
+ (not (equal (buffer-substring beg end)
+ (with-current-buffer write-back-buf
+ (buffer-string)))))
+ (undo-boundary)
+ (goto-char beg)
+ (let ((expecting-bol (bolp)))
+ (if (version< emacs-version "27.1")
+ (progn (delete-region beg end)
+ (insert (with-current-buffer write-back-buf
+ (buffer-string))))
+ (save-restriction
+ (narrow-to-region beg end)
+ (replace-buffer-contents write-back-buf 0.1 nil)
+ (goto-char (point-max))))
+ (when (and expecting-bol (not (bolp))) (insert "\n")))))
+ (when write-back-buf (kill-buffer write-back-buf))
+ ;; If we are to return to source buffer, put point at an
+ ;; appropriate location. In particular, if block is hidden, move
+ ;; to the beginning of the block opening line.
+ (unless remote
+ (goto-char beg)
+ (cond
+ ;; Block is hidden; move at start of block.
+ ((cl-some (lambda (o) (eq (overlay-get o 'invisible) 'org-hide-block))
+ (overlays-at (point)))
+ (beginning-of-line 0))
+ (write-back (org-src--goto-coordinates coordinates beg end))))
+ ;; Clean up left-over markers and restore window configuration.
+ (set-marker beg nil)
+ (set-marker end nil)
+ (when org-src--saved-temp-window-config
+ (unwind-protect
+ (set-window-configuration org-src--saved-temp-window-config)
+ (setq org-src--saved-temp-window-config nil)))))
+
+(provide 'org-src)
+
+;;; org-src.el ends here
diff --git a/elpa/org-9.5.2/org-src.elc b/elpa/org-9.5.2/org-src.elc
new file mode 100644
index 0000000..a473a80
--- /dev/null
+++ b/elpa/org-9.5.2/org-src.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-table.el b/elpa/org-9.5.2/org-table.el
new file mode 100644
index 0000000..e34872f
--- /dev/null
+++ b/elpa/org-9.5.2/org-table.el
@@ -0,0 +1,6340 @@
+;;; org-table.el --- The Table Editor for Org -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file contains the table editor and spreadsheet for Org mode.
+
+;; Watch out: Here we are talking about two different kind of tables.
+;; Most of the code is for the tables created with the Org mode table editor.
+;; Sometimes, we talk about tables created and edited with the table.el
+;; Emacs package. We call the former org-type tables, and the latter
+;; table.el-type tables.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'org-macs)
+(require 'org-compat)
+(require 'org-keys)
+
+(declare-function calc-eval "calc" (str &optional separator &rest args))
+(declare-function face-remap-remove-relative "face-remap" (cookie))
+(declare-function face-remap-add-relative "face-remap" (face &rest specs))
+(declare-function org-at-timestamp-p "org" (&optional extended))
+(declare-function org-delete-backward-char "org" (N))
+(declare-function org-mode "org" ())
+(declare-function org-duration-p "org-duration" (duration &optional canonical))
+(declare-function org-duration-to-minutes "org-duration" (duration &optional canonical))
+(declare-function org-element-at-point "org-element" ())
+(declare-function org-element-contents "org-element" (element))
+(declare-function org-element-extract-element "org-element" (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-map "org-element" (data types fun &optional info first-match no-recursion with-affiliated))
+(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-type "org-element" (element))
+(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-filter-apply-functions "ox" (filters value info))
+(declare-function org-export-first-sibling-p "ox" (blob 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-install-filters "ox" (info))
+(declare-function org-export-table-has-special-column-p "ox" (table))
+(declare-function org-export-table-row-is-special-p "ox" (table-row info))
+(declare-function org-forward-paragraph "org" (&optional arg))
+(declare-function org-id-find "org-id" (id &optional markerp))
+(declare-function org-indent-line "org" ())
+(declare-function org-load-modules-maybe "org" (&optional force))
+(declare-function org-restart-font-lock "org" ())
+(declare-function org-sort-remove-invisible "org" (s))
+(declare-function org-time-stamp-format "org" (&optional long inactive))
+(declare-function org-time-string-to-absolute "org" (s &optional daynr prefer buffer pos))
+(declare-function org-time-string-to-time "org" (s))
+(declare-function org-timestamp-up-day "org" (&optional arg))
+
+(defvar constants-unit-system)
+(defvar org-M-RET-may-split-line)
+(defvar org-element-use-cache)
+(defvar org-export-filters-alist)
+(defvar org-finish-function)
+(defvar org-inhibit-highlight-removal)
+(defvar org-inhibit-startup)
+(defvar org-selected-window)
+(defvar org-self-insert-cluster-for-undo)
+(defvar org-self-insert-command-undo-counter)
+(defvar org-ts-regexp)
+(defvar org-ts-regexp-both)
+(defvar org-ts-regexp-inactive)
+(defvar org-ts-regexp3)
+(defvar org-window-configuration)
+(defvar sort-fold-case)
+
+
+;;; Customizables
+
+(defgroup org-table nil
+ "Options concerning tables in Org mode."
+ :tag "Org Table"
+ :group 'org)
+
+(defcustom orgtbl-optimized t
+ "Non-nil means use the optimized table editor version for `orgtbl-mode'.
+
+In the optimized version, the table editor takes over all simple keys that
+normally just insert a character. In tables, the characters are inserted
+in a way to minimize disturbing the table structure (i.e. in overwrite mode
+for empty fields). Outside tables, the correct binding of the keys is
+restored.
+
+Changing this variable requires a restart of Emacs to become
+effective."
+ :group 'org-table
+ :type 'boolean)
+
+(defcustom orgtbl-radio-table-templates
+ '((latex-mode "% BEGIN RECEIVE ORGTBL %n
+% END RECEIVE ORGTBL %n
+\\begin{comment}
+#+ORGTBL: SEND %n orgtbl-to-latex :splice nil :skip 0
+| | |
+\\end{comment}\n")
+ (texinfo-mode "@c BEGIN RECEIVE ORGTBL %n
+@c END RECEIVE ORGTBL %n
+@ignore
+#+ORGTBL: SEND %n orgtbl-to-html :splice nil :skip 0
+| | |
+@end ignore\n")
+ (html-mode "<!-- BEGIN RECEIVE ORGTBL %n -->
+<!-- END RECEIVE ORGTBL %n -->
+<!--
+#+ORGTBL: SEND %n orgtbl-to-html :splice nil :skip 0
+| | |
+-->\n")
+ (org-mode "#+ BEGIN RECEIVE ORGTBL %n
+#+ END RECEIVE ORGTBL %n
+
+#+ORGTBL: SEND %n orgtbl-to-orgtbl :splice nil :skip 0
+| | |
+"))
+ "Templates for radio tables in different major modes.
+Each template must define lines that will be treated as a comment and that
+must contain the \"BEGIN RECEIVE ORGTBL %n\" and \"END RECEIVE ORGTBL\"
+lines where \"%n\" will be replaced with the name of the table during
+insertion of the template. The transformed table will later be inserted
+between these lines.
+
+The template should also contain a minimal table in a multiline comment.
+If multiline comments are not possible in the buffer language,
+you can pack it into a string that will not be used when the code
+is compiled or executed. Above the table will you need a line with
+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
+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."
+ :group 'org-table
+ :type '(repeat
+ (list (symbol :tag "Major mode")
+ (string :tag "Format"))))
+
+(defgroup org-table-settings nil
+ "Settings for tables in Org mode."
+ :tag "Org Table Settings"
+ :group 'org-table)
+
+(defcustom org-table-header-line-p nil
+ "Activate `org-table-header-line-mode' by default?"
+ :type 'boolean
+ :package-version '(Org . "9.4")
+ :group 'org-table)
+
+(defcustom org-table-default-size "5x2"
+ "The default size for newly created tables, Columns x Rows."
+ :group 'org-table-settings
+ :type 'string)
+
+(defcustom org-table-number-regexp
+ "^\\([<>]?[-+^.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.
+
+The default value of this option is a regular expression which allows
+anything which looks remotely like a number as used in scientific
+context. For example, all of the following will be considered a
+number:
+ 12 12.2 2.4e-08 2x10^12 4.034+-0.02 2.7(10) >3.5
+
+Other options offered by the customize interface are more restrictive."
+ :group 'org-table-settings
+ :type '(choice
+ (const :tag "Positive Integers"
+ "^[0-9]+$")
+ (const :tag "Integers"
+ "^[-+]?[0-9]+$")
+ (const :tag "Floating Point Numbers"
+ "^[-+]?\\([0-9]*\\.[0-9]+\\|[0-9]+\\.[0-9]*\\)$")
+ (const :tag "Floating Point Number or Integer"
+ "^[-+]?\\([0-9]*\\.[0-9]+\\|[0-9]+\\.?[0-9]*\\)$")
+ (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][[: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][[:xdigit:].]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$")
+ (regexp :tag "Regexp:")))
+
+(defcustom org-table-number-fraction 0.5
+ "Fraction of numbers in a column required to make the column align right.
+In a column all non-white fields are considered. If at least
+this fraction of fields is matched by `org-table-number-regexp',
+alignment to the right border applies."
+ :group 'org-table-settings
+ :type 'number)
+
+(defcustom org-table-formula-field-format "%s"
+ "Format for fields which contain the result of a formula.
+For example, using \"~%s~\" will display the result within tilde
+characters. Beware that modifying the display can prevent the
+field from being used in another formula."
+ :group 'org-table-settings
+ :version "24.1"
+ :type 'string)
+
+(defgroup org-table-editing nil
+ "Behavior of tables during editing in Org mode."
+ :tag "Org Table Editing"
+ :group 'org-table)
+
+(defcustom org-table-automatic-realign t
+ "Non-nil means automatically re-align table when pressing TAB or RETURN.
+When nil, aligning is only done with `\\[org-table-align]', or after column
+removal/insertion."
+ :group 'org-table-editing
+ :type 'boolean)
+
+(defcustom org-table-auto-blank-field t
+ "Non-nil means automatically blank table field when starting to type into it.
+This only happens when typing immediately after a field motion
+command (TAB, S-TAB or RET)."
+ :group 'org-table-editing
+ :type 'boolean)
+
+(defcustom org-table-exit-follow-field-mode-when-leaving-table t
+ "Non-nil means automatically exit the follow mode.
+When nil, the follow mode will stay on and be active in any table
+the cursor enters. Since the table follow filed mode messes with the
+window configuration, it is not recommended to set this variable to nil,
+except maybe locally in a special file that has mostly tables with long
+fields."
+ :group 'org-table
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-table-fix-formulas-confirm nil
+ "Whether the user should confirm when Org fixes formulas."
+ :group 'org-table-editing
+ :version "24.1"
+ :type '(choice
+ (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)))
+
+(defcustom org-table-tab-jumps-over-hlines t
+ "Non-nil means tab in the last column of a table with jump over a hline.
+If a horizontal separator line is following the current line,
+`org-table-next-field' can either create a new row before that line, or jump
+over the line. When this option is nil, a new line will be created before
+this line."
+ :group 'org-table-editing
+ :type 'boolean)
+
+(defcustom org-table-shrunk-column-indicator "…"
+ "String to be displayed in a shrunk column."
+ :group 'org-table-editing
+ :type 'string
+ :package-version '(Org . "9.2")
+ :safe (lambda (v) (and (stringp v) (not (equal v "")))))
+
+(defgroup org-table-calculation nil
+ "Options concerning tables in Org mode."
+ :tag "Org Table Calculation"
+ :group 'org-table)
+
+(defcustom org-table-use-standard-references 'from
+ "Non-nil means using table references like B3 instead of @3$2.
+Possible values are:
+nil never use them
+from accept as input, do not present for editing
+t accept as input and present for editing"
+ :group 'org-table-calculation
+ :type '(choice
+ (const :tag "Never, don't even check user input for them" nil)
+ (const :tag "Always, both as user input, and when editing" t)
+ (const :tag "Convert user input, don't offer during editing" from)))
+
+(defcustom org-table-copy-increment t
+ "Non-nil means increment when copying current field with \
+`\\[org-table-copy-down]'."
+ :group 'org-table-calculation
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(choice
+ (const :tag "Use the difference between the current and the above fields" t)
+ (integer :tag "Use a number" 1)
+ (const :tag "Don't increment the value when copying a field" nil)))
+
+(defcustom org-calc-default-modes
+ '(calc-internal-prec 12
+ calc-float-format (float 8)
+ calc-angle-mode deg
+ calc-prefer-frac nil
+ calc-symbolic-mode nil
+ calc-date-format (YYYY "-" MM "-" DD " " Www (" " hh ":" mm))
+ calc-display-working-message t)
+ "List with Calc mode settings for use in `calc-eval' for table formulas.
+The list must contain alternating symbols (Calc modes variables and values).
+Don't remove any of the default settings, just change the values. Org mode
+relies on the variables to be present in the list."
+ :group 'org-table-calculation
+ :type 'plist)
+
+(defcustom org-table-duration-custom-format 'hours
+ "Format for the output of calc computations like $1+$2;t.
+The default value is `hours', and will output the results as a
+number of hours. Other allowed values are `seconds', `minutes' and
+`days', and the output will be a fraction of seconds, minutes or
+days. `hh:mm' selects to use hours and minutes, ignoring seconds.
+The `U' flag in a table formula will select this specific format for
+a single formula."
+ :group 'org-table-calculation
+ :version "24.1"
+ :type '(choice (symbol :tag "Seconds" 'seconds)
+ (symbol :tag "Minutes" 'minutes)
+ (symbol :tag "Hours " 'hours)
+ (symbol :tag "Days " 'days)
+ (symbol :tag "HH:MM " 'hh:mm)))
+
+(defcustom org-table-duration-hour-zero-padding t
+ "Non-nil means hours in table duration computations should be zero-padded.
+So this is about 08:32:34 versus 8:33:34."
+ :group 'org-table-calculation
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-table-formula-evaluate-inline t
+ "Non-nil means TAB and RET evaluate a formula in current table field.
+If the current field starts with an equal sign, it is assumed to be a formula
+which should be evaluated as described in the manual and in the documentation
+string of the command `org-table-eval-formula'. This feature requires the
+Emacs calc package.
+When this variable is nil, formula calculation is only available through
+the command `\\[org-table-eval-formula]'."
+ :group 'org-table-calculation
+ :type 'boolean)
+
+(defcustom org-table-formula-use-constants t
+ "Non-nil means interpret constants in formulas in tables.
+A constant looks like `$c' or `$Grav' and will be replaced before evaluation
+by the value given in `org-table-formula-constants', or by a value obtained
+from the `constants.el' package."
+ :group 'org-table-calculation
+ :type 'boolean)
+
+(defcustom org-table-formula-constants nil
+ "Alist with constant names and values, for use in table formulas.
+The car of each element is a name of a constant, without the `$' before it.
+The cdr is the value as a string. For example, if you'd like to use the
+speed of light in a formula, you would configure
+
+ (setq org-table-formula-constants \\='((\"c\" . \"299792458.\")))
+
+and then use it in an equation like `$1*$c'.
+
+Constants can also be defined on a per-file basis using a line like
+
+#+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6"
+ :group 'org-table-calculation
+ :type '(repeat
+ (cons (string :tag "name")
+ (string :tag "value"))))
+
+(defcustom org-table-allow-automatic-line-recalculation t
+ "Non-nil means lines marked with |#| or |*| will be recomputed automatically.
+\\<org-mode-map>\
+Automatically means when `TAB' or `RET' or `\\[org-ctrl-c-ctrl-c]' \
+are pressed in the line."
+ :group 'org-table-calculation
+ :type 'boolean)
+
+(defcustom org-table-relative-ref-may-cross-hline t
+ "Non-nil means relative formula references may cross hlines.
+Here are the allowed values:
+
+nil Relative references may not cross hlines. They will reference the
+ field next to the hline instead. Coming from below, the reference
+ will be to the field below the hline. Coming from above, it will be
+ to the field above.
+t Relative references may cross hlines.
+error An attempt to cross a hline will throw an error.
+
+It is probably good to never set this variable to nil, for the sake of
+portability of tables."
+ :group 'org-table-calculation
+ :type '(choice
+ (const :tag "Allow to cross" t)
+ (const :tag "Stick to hline" nil)
+ (const :tag "Error on attempt to cross" error)))
+
+(defcustom org-table-formula-create-columns nil
+ "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
+ :package-version '(Org . "8.3")
+ :type '(choice
+ (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."
+ :tag "Org Table Import Export"
+ :group 'org-table)
+
+(defcustom org-table-export-default-format "orgtbl-to-tsv"
+ "Default export parameters for `org-table-export'.
+These can be overridden for a specific table by setting the
+TABLE_EXPORT_FORMAT property. See the manual section on orgtbl
+radio tables for the different export transformations and
+available parameters."
+ :group 'org-table-import-export
+ :type 'string)
+
+(defcustom org-table-convert-region-max-lines 999
+ "Max lines that `org-table-convert-region' will attempt to process.
+
+The function can be slow on larger regions; this safety feature
+prevents it from hanging Emacs."
+ :group 'org-table-import-export
+ :type 'integer
+ :package-version '(Org . "8.3"))
+
+
+;;; Org table header minor mode
+(defun org-table-row-get-visible-string (&optional pos)
+ "Get the visible string of a table row.
+This may be useful when columns have been shrunk."
+ (save-excursion
+ (when pos (goto-char pos))
+ (goto-char (line-beginning-position))
+ (let ((end (line-end-position)) str)
+ (backward-char)
+ (while (progn (forward-char 1) (< (point) end))
+ (let ((ov (car (overlays-at (point)))))
+ (if (not ov)
+ (push (char-to-string (char-after)) str)
+ (push (overlay-get ov 'display) str)
+ (goto-char (1- (overlay-end ov))))))
+ (format "%s" (mapconcat #'identity (reverse str) "")))))
+
+(defvar-local org-table-header-overlay nil)
+(defun org-table-header-set-header ()
+ "Display the header of the table at point."
+ (let ((gcol temporary-goal-column))
+ (unwind-protect
+ (progn
+ (when (overlayp org-table-header-overlay)
+ (delete-overlay org-table-header-overlay))
+ (let* ((ws (window-start))
+ (beg (save-excursion
+ (goto-char (org-table-begin))
+ (while (or (org-at-table-hline-p)
+ (looking-at-p ".*|\\s-+<[rcl]?\\([0-9]+\\)?>"))
+ (move-beginning-of-line 2))
+ (line-beginning-position)))
+ (end (save-excursion (goto-char beg) (point-at-eol))))
+ (if (pos-visible-in-window-p beg)
+ (when (overlayp org-table-header-overlay)
+ (delete-overlay org-table-header-overlay))
+ (setq org-table-header-overlay
+ (make-overlay ws (+ ws (- end beg))))
+ (org-overlay-display
+ org-table-header-overlay
+ (org-table-row-get-visible-string beg)
+ 'org-table-header))))
+ (setq temporary-goal-column gcol))))
+
+;;;###autoload
+(define-minor-mode org-table-header-line-mode
+ "Display the first row of the table at point in the header line."
+ :lighter " TblHeader"
+ (unless (eq major-mode 'org-mode)
+ (user-error "Cannot turn org table header mode outside org-mode buffers"))
+ (if org-table-header-line-mode
+ (add-hook 'post-command-hook #'org-table-header-set-header nil t)
+ (when (overlayp org-table-header-overlay)
+ (delete-overlay org-table-header-overlay)
+ (setq org-table-header-overlay nil))
+ (remove-hook 'post-command-hook #'org-table-header-set-header t)))
+
+
+;;; Regexps Constants
+
+(defconst org-table-any-line-regexp "^[ \t]*\\(|\\|\\+-[-+]\\)"
+ "Detect an org-type or table-type table.")
+
+(defconst org-table-line-regexp "^[ \t]*|"
+ "Detect an org-type table line.")
+
+(defconst org-table-dataline-regexp "^[ \t]*|[^-]"
+ "Detect an org-type table line.")
+
+(defconst org-table-hline-regexp "^[ \t]*|-"
+ "Detect an org-type table hline.")
+
+(defconst org-table1-hline-regexp "^[ \t]*\\+-[-+]"
+ "Detect a table-type table hline.")
+
+(defconst org-table-any-border-regexp "^[ \t]*[^|+ \t]"
+ "Detect the first line outside a table when searching from within it.
+This works for both table types.")
+
+(defconst org-TBLFM-regexp "^[ \t]*#\\+TBLFM: "
+ "Detect a #+TBLFM line.")
+
+(defvar org-table-TBLFM-begin-regexp "^[ \t]*|.*\n[ \t]*#\\+TBLFM: ")
+
+(defconst org-table-auto-recalculate-regexp "^[ \t]*| *# *\\(|\\|$\\)"
+ "Regexp matching a line marked for automatic recalculation.")
+
+(defconst org-table-recalculate-regexp "^[ \t]*| *[#*] *\\(|\\|$\\)"
+ "Regexp matching a line marked for recalculation.")
+
+(defconst org-table-calculate-mark-regexp "^[ \t]*| *[!$^_#*] *\\(|\\|$\\)"
+ "Regexp matching a line marked for calculation.")
+
+(defconst org-table-border-regexp "^[ \t]*[^| \t]"
+ "Regexp matching any line outside an Org table.")
+
+(defconst org-table-range-regexp
+ "@\\([-+]?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
+ (concat
+ "\\(" "@[-0-9I$&]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\|" "\\$[a-zA-Z0-9]+" "\\)"
+ "\\.\\."
+ "\\(" "@?[-0-9I$&]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\|" "\\$[a-zA-Z0-9]+" "\\)")
+ "Match a range for reference display.")
+
+(defconst org-table-translate-regexp
+ (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.")
+
+
+;;; Internal Variables
+
+(defvar org-table-last-highlighted-reference nil)
+
+(defvar org-table-formula-history nil)
+
+(defvar org-field-marker nil)
+(defvar org-table-buffer-is-an nil)
+
+(defvar-local org-table-formula-constants-local nil
+ "Local version of `org-table-formula-constants'.")
+
+(defvar org-table-may-need-update t
+ "Indicates that a table might need an update.
+This variable is set by `org-before-change-function'.
+`org-table-align' sets it back to nil.")
+
+(defvar orgtbl-after-send-table-hook nil
+ "Hook for functions attaching to `C-c C-c', if the table is sent.
+This can be used to add additional functionality after the table is sent
+to the receiver position, otherwise, if table is not sent, the functions
+are not run.")
+
+(defvar org-table-column-names nil
+ "Alist with column names, derived from the `!' line.
+This variable is initialized with `org-table-analyze'.")
+
+(defvar org-table-column-name-regexp nil
+ "Regular expression matching the current column names.
+This variable is initialized with `org-table-analyze'.")
+
+(defvar org-table-local-parameters nil
+ "Alist with parameter names, derived from the `$' line.
+This variable is initialized with `org-table-analyze'.")
+
+(defvar org-table-named-field-locations nil
+ "Alist with locations of named fields.
+Associations follow the pattern (NAME LINE COLUMN) where
+ NAME is the name of the field as a string,
+ LINE is the number of lines from the beginning of the table,
+ COLUMN is the column of the field, as an integer.
+This variable is initialized with `org-table-analyze'.")
+
+(defvar org-table-current-line-types nil
+ "Table row types in current table.
+This variable is initialized with `org-table-analyze'.")
+
+(defvar org-table-current-begin-pos nil
+ "Current table begin position, as a marker.
+This variable is initialized with `org-table-analyze'.")
+
+(defvar org-table-current-ncol nil
+ "Number of columns in current table.
+This variable is initialized with `org-table-analyze'.")
+
+(defvar org-table-dlines nil
+ "Vector of data line line numbers in the current table.
+Line numbers are counted from the beginning of the table. This
+variable is initialized with `org-table-analyze'.")
+
+(defvar org-table-hlines nil
+ "Vector of hline line numbers in the current table.
+Line numbers are counted from the beginning of the table. This
+variable is initialized with `org-table-analyze'.")
+
+(defvar org-table-aligned-begin-marker (make-marker)
+ "Marker at the beginning of the table last aligned.
+Used to check if cursor still is in that table, to minimize realignment.")
+
+(defvar org-table-aligned-end-marker (make-marker)
+ "Marker at the end of the table last aligned.
+Used to check if cursor still is in that table, to minimize realignment.")
+
+(defvar org-table-last-alignment nil
+ "List of flags for flushright alignment, from the last re-alignment.
+This is being used to correctly align a single field after TAB or RET.")
+
+(defvar org-table-last-column-widths nil
+ "List of max width of fields in each column.
+This is being used to correctly align a single field after TAB or RET.")
+
+(defvar-local org-table-formula-debug nil
+ "Non-nil means debug table formulas.
+When nil, simply write \"#ERROR\" in corrupted fields.")
+
+(defvar-local org-table-overlay-coordinates nil
+ "Overlay coordinates after each align of a table.")
+
+(defvar org-last-recalc-line nil)
+
+(defvar org-show-positions nil)
+
+(defvar org-table-rectangle-overlays nil)
+
+(defvar org-table-clip nil
+ "Clipboard for table regions.")
+
+(defvar org-timecnt nil)
+
+(defvar org-recalc-commands nil
+ "List of commands triggering the recalculation of a line.
+Will be filled automatically during use.")
+
+(defvar org-recalc-marks
+ '((" " . "Unmarked: no special line, no automatic recalculation")
+ ("#" . "Automatically recalculate this line upon TAB, RET, and C-c C-c in the line")
+ ("*" . "Recalculate only when entire table is recalculated with `C-u C-c *'")
+ ("!" . "Column name definition line. Reference in formula as $name.")
+ ("$" . "Parameter definition line name=value. Reference in formula as $name.")
+ ("_" . "Names for values in row below this one.")
+ ("^" . "Names for values in row above this one.")))
+
+(defvar org-pos nil)
+
+
+;;; Macros and Inlined Functions
+
+(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)))))
+
+(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))))))
+
+(defmacro org-table-save-field (&rest body)
+ "Save current field; execute BODY; restore field.
+Field is restored even in case of abnormal exit."
+ (declare (debug (body)))
+ (org-with-gensyms (line column)
+ `(let ((,line (copy-marker (line-beginning-position)))
+ (,column (org-table-current-column)))
+ (unwind-protect
+ (progn ,@body)
+ (goto-char ,line)
+ (org-table-goto-column ,column)
+ (set-marker ,line nil)))))
+
+
+;;; Predicates
+
+(defun org-at-TBLFM-p (&optional pos)
+ "Non-nil when point (or POS) is in #+TBLFM line."
+ (save-excursion
+ (goto-char (or pos (point)))
+ (beginning-of-line)
+ (and (let ((case-fold-search t)) (looking-at org-TBLFM-regexp))
+ (eq (org-element-type (org-element-at-point)) 'table))))
+
+(defun org-at-table-p (&optional table-type)
+ "Non-nil if the cursor is inside an Org table.
+If TABLE-TYPE is non-nil, also check for table.el-type tables."
+ (and (org-match-line (if table-type "[ \t]*[|+]" "[ \t]*|"))
+ (or (not (derived-mode-p 'org-mode))
+ (let ((e (org-element-lineage (org-element-at-point) '(table) t)))
+ (and e (or table-type
+ (eq 'org (org-element-property :type e))))))))
+
+(defun org-at-table.el-p ()
+ "Non-nil when point is at a table.el table."
+ (and (org-match-line "[ \t]*[|+]")
+ (let ((element (org-element-at-point)))
+ (and (eq (org-element-type element) 'table)
+ (eq (org-element-property :type element) 'table.el)))))
+
+(defun org-at-table-hline-p ()
+ "Non-nil when point is inside a hline in a table.
+Assume point is already in a table."
+ (org-match-line org-table-hline-regexp))
+
+(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-p "[ \t]*$"))))
+ (noerror nil)
+ (t (user-error "Not in table data field"))))
+
+
+;;; Create, Import, and Convert Tables
+
+;;;###autoload
+(defun org-table-create-with-table.el ()
+ "Use the table.el package to insert a new table.
+If there is already a table at point, convert between Org tables
+and table.el tables."
+ (interactive)
+ (require 'table)
+ (cond
+ ((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
+(defun org-table-create-or-convert-from-region (arg)
+ "Convert region to table, or create an empty table.
+If there is an active region, convert it to a table, using the function
+`org-table-convert-region'. See the documentation of that function
+to learn how the prefix argument is interpreted to determine the field
+separator.
+If there is no such region, create an empty table with `org-table-create'."
+ (interactive "P")
+ (if (org-region-active-p)
+ (org-table-convert-region (region-beginning) (region-end) arg)
+ (org-table-create arg)))
+
+;;;###autoload
+(defun org-table-create (&optional size)
+ "Query for a size and insert a table skeleton.
+SIZE is a string Columns x Rows like for example \"3x2\"."
+ (interactive "P")
+ (unless size
+ (setq size (read-string
+ (concat "Table size Columns x Rows [e.g. "
+ org-table-default-size "]: ")
+ "" nil org-table-default-size)))
+
+ (let* ((pos (point))
+ (indent (make-string (current-column) ?\ ))
+ (split (org-split-string size " *x *"))
+ (rows (string-to-number (nth 1 split)))
+ (columns (string-to-number (car split)))
+ (line (concat (apply 'concat indent "|" (make-list columns " |"))
+ "\n")))
+ (if (string-match "^[ \t]*$" (buffer-substring-no-properties
+ (point-at-bol) (point)))
+ (beginning-of-line 1)
+ (newline))
+ ;; (mapcar (lambda (x) (insert line)) (make-list rows t))
+ (dotimes (_ rows) (insert line))
+ (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
+(defun org-table-convert-region (beg0 end0 &optional separator)
+ "Convert region to a table.
+
+The region goes from BEG0 to END0, but these borders will be moved
+slightly, to make sure a beginning of line in the first line is included.
+
+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
+nil When 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."
+ (interactive "r\nP")
+ (let* ((beg (min beg0 end0))
+ (end (max beg0 end0))
+ re)
+ (when (> (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))
+ (when (equal separator '(64))
+ (setq separator (read-regexp "Regexp for field separator")))
+ (goto-char beg)
+ (beginning-of-line 1)
+ (setq beg (point-marker))
+ (goto-char end)
+ (if (bolp) (backward-char 1) (end-of-line 1))
+ (setq end (point-marker))
+ ;; Get the right field separator
+ (unless separator
+ (goto-char beg)
+ (setq separator
+ (cond
+ ((not (re-search-forward "^[^\n\t]+$" end t)) '(16))
+ ((not (re-search-forward "^[^\n,]+$" end t)) '(4))
+ (t 1))))
+ (goto-char beg)
+ (if (equal separator '(4))
+ (while (< (point) end)
+ ;; parse the csv stuff
+ (cond
+ ((looking-at "^") (insert "| "))
+ ((looking-at "[ \t]*$") (replace-match " |") (beginning-of-line 2))
+ ((looking-at "[ \t]*\"\\([^\"\n]*\\)\"")
+ (replace-match "\\1")
+ (if (looking-at "\"") (insert "\"")))
+ ((looking-at "[^,\n]+") (goto-char (match-end 0)))
+ ((looking-at "[ \t]*,") (replace-match " | "))
+ (t (beginning-of-line 2))))
+ (setq re (cond
+ ((equal separator '(4)) "^\\|\"?[ \t]*,[ \t]*\"?")
+ ((equal separator '(16)) "^\\|\t")
+ ((integerp separator)
+ (if (< separator 1)
+ (user-error "Number of spaces in separator must be >= 1")
+ (format "^ *\\| *\t *\\| \\{%d,\\}" separator)))
+ ((stringp separator)
+ (format "^ *\\|%s" separator))
+ (t (error "This should not happen"))))
+ (while (re-search-forward re end t)
+ (replace-match "| " t t)))
+ (goto-char beg)
+ (org-table-align)))
+
+;;;###autoload
+(defun org-table-import (file separator)
+ "Import FILE as a table.
+
+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")
+ (when (and (called-interactively-p 'any)
+ (not (string-match-p (rx "." (or "txt" "tsv" "csv") eos) file))
+ (not (yes-or-no-p "The file's extension is not .txt, .tsv or .csv. Import? ")))
+ (user-error "Cannot import such file"))
+ (unless (bolp) (insert "\n"))
+ (let ((beg (point))
+ (pm (point-max)))
+ (insert-file-contents file)
+ (org-table-convert-region beg (+ (point) (- (point-max) pm)) separator)))
+
+(defun org-table-convert ()
+ "Convert from Org table to table.el and back.
+Obviously, this only works within limits. When an Org table is converted
+to table.el, all horizontal separator lines get lost, because table.el uses
+these as cell boundaries and has no notion of horizontal lines. A table.el
+table can be converted to an Org table only if it does not do row or column
+spanning. Multiline cells will become multiple cells. Beware, Org mode
+does not test if the table can be successfully converted - it blindly
+applies a recipe that works for simple tables."
+ (interactive)
+ (require 'table)
+ (if (org-at-table.el-p)
+ ;; convert to Org table
+ (let ((beg (copy-marker (org-table-begin t)))
+ (end (copy-marker (org-table-end t))))
+ (table-unrecognize-region beg end)
+ (goto-char beg)
+ (while (re-search-forward "^\\([ \t]*\\)\\+-.*\n" end t)
+ (replace-match ""))
+ (goto-char beg))
+ (if (org-at-table-p)
+ ;; convert to table.el table
+ (let ((beg (copy-marker (org-table-begin)))
+ (end (copy-marker (org-table-end))))
+ ;; first, get rid of all horizontal lines
+ (goto-char beg)
+ (while (re-search-forward "^\\([ \t]*\\)|-.*\n" end t)
+ (replace-match ""))
+ ;; insert a hline before first
+ (goto-char beg)
+ (org-table-insert-hline 'above)
+ (beginning-of-line -1)
+ ;; insert a hline after each line
+ (while (progn (beginning-of-line 3) (< (point) end))
+ (org-table-insert-hline))
+ (goto-char beg)
+ (setq end (move-marker end (org-table-end)))
+ ;; replace "+" at beginning and ending of hlines
+ (while (re-search-forward "^\\([ \t]*\\)|-" end t)
+ (replace-match "\\1+-"))
+ (goto-char beg)
+ (while (re-search-forward "-|[ \t]*$" end t)
+ (replace-match "-+"))
+ (goto-char beg)))))
+
+
+;;; Navigation and Structure Editing
+
+;;;###autoload
+(defun org-table-begin (&optional table-type)
+ "Find the beginning of the table and return its position.
+With a non-nil optional argument TABLE-TYPE, return the beginning
+of a table.el-type table. This function assumes point is on
+a table."
+ (cond (table-type
+ (org-element-property :post-affiliated (org-element-at-point)))
+ ((save-excursion
+ (and (re-search-backward org-table-border-regexp nil t)
+ (line-beginning-position 2))))
+ (t (point-min))))
+
+;;;###autoload
+(defun org-table-end (&optional table-type)
+ "Find the end of the table and return its position.
+With a non-nil optional argument TABLE-TYPE, return the end of
+a table.el-type table. This function assumes point is on
+a table."
+ (save-excursion
+ (cond (table-type
+ (goto-char (org-element-property :end (org-element-at-point)))
+ (skip-chars-backward " \t\n")
+ (line-beginning-position 2))
+ ((re-search-forward org-table-border-regexp nil t)
+ (match-beginning 0))
+ ;; When the line right after the table is the last line in
+ ;; the buffer with trailing spaces but no final newline
+ ;; character, be sure to catch the correct ending at its
+ ;; beginning. In any other case, ending is expected to be
+ ;; at point max.
+ (t (goto-char (point-max))
+ (skip-chars-backward " \t")
+ (if (bolp) (point) (line-end-position))))))
+
+;;;###autoload
+(defun org-table-next-field ()
+ "Go to the next field in the current table, creating new lines as needed.
+Before doing so, re-align the table if necessary."
+ (interactive)
+ (org-table-maybe-eval-formula)
+ (org-table-maybe-recalculate-line)
+ (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))
+ (condition-case nil
+ (progn
+ (re-search-forward "|" end)
+ (if (looking-at "[ \t]*$")
+ (re-search-forward "|" end))
+ (if (and (looking-at "-")
+ org-table-tab-jumps-over-hlines
+ (re-search-forward "^[ \t]*|\\([^-]\\)" end t))
+ (goto-char (match-beginning 1)))
+ (if (looking-at "-")
+ (progn
+ (beginning-of-line 0)
+ (org-table-insert-row 'below))
+ (if (looking-at " ") (forward-char 1))))
+ (error
+ (org-table-insert-row 'below)))))
+
+;;;###autoload
+(defun org-table-previous-field ()
+ "Go to the previous field in the table.
+Before doing so, re-align the table if necessary."
+ (interactive)
+ (org-table-justify-field-maybe)
+ (org-table-maybe-recalculate-line)
+ (when (and org-table-automatic-realign
+ org-table-may-need-update)
+ (org-table-align))
+ (when (org-at-table-hline-p)
+ (end-of-line))
+ (let ((start (org-table-begin))
+ (origin (point)))
+ (condition-case nil
+ (progn
+ (search-backward "|" start nil 2)
+ (while (looking-at-p "|\\(?:-\\|[ \t]*$\\)")
+ (search-backward "|" start)))
+ (error
+ (goto-char origin)
+ (user-error "Cannot move to previous table field"))))
+ (when (looking-at "| ?")
+ (goto-char (match-end 0))))
+
+(defun org-table-beginning-of-field (&optional n)
+ "Move to the beginning of the current table field.
+If already at or before the beginning, move to the beginning of the
+previous field.
+With numeric argument N, move N-1 fields backward first."
+ (interactive "p")
+ (let ((pos (point)))
+ (while (> n 1)
+ (setq n (1- n))
+ (org-table-previous-field))
+ (if (not (re-search-backward "|" (point-at-bol 0) t))
+ (user-error "No more table fields before the current")
+ (goto-char (match-end 0))
+ (and (looking-at " ") (forward-char 1)))
+ (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.
+If already at or after the end, move to the end of the next table field.
+With numeric argument N, move N-1 fields forward first."
+ (interactive "p")
+ (let ((pos (point)))
+ (while (> n 1)
+ (setq n (1- n))
+ (org-table-next-field))
+ (when (re-search-forward "|" (point-at-eol 1) t)
+ (backward-char 1)
+ (skip-chars-backward " ")
+ (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 ()
+ "Go to the next row (same column) in the current table.
+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))
+ (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))
+ (beginning-of-line 0)
+ (org-table-insert-row 'below))
+ (org-table-goto-column col)
+ (skip-chars-backward "^|\n\r")
+ (when (looking-at " ") (forward-char))))
+
+(defun org-table-get (line column)
+ "Get the field in table line LINE, column COLUMN.
+If LINE is larger than the number of data lines in the table, the function
+returns nil. However, if COLUMN is too large, we will simply return an
+empty string.
+If LINE is nil, use the current line.
+If COLUMN is nil, use the current column."
+ (setq column (or column (org-table-current-column)))
+ (save-excursion
+ (and (or (not line) (org-table-goto-line line))
+ (org-trim (org-table-get-field column)))))
+
+(defun org-table-put (line column value &optional align)
+ "Put VALUE into line LINE, column COLUMN.
+When ALIGN is set, also realign the table."
+ (setq column (or column (org-table-current-column)))
+ (prog1 (save-excursion
+ (and (or (not line) (org-table-goto-line line))
+ (progn (org-table-goto-column column nil 'force) t)
+ (org-table-get-field column value)))
+ (and align (org-table-align))))
+
+(defun org-table-current-line ()
+ "Return the index of the current data line."
+ (let ((pos (point)) (end (org-table-end)) (cnt 0))
+ (save-excursion
+ (goto-char (org-table-begin))
+ (while (and (re-search-forward org-table-dataline-regexp end t)
+ (setq cnt (1+ cnt))
+ (< (point-at-eol) pos))))
+ cnt))
+
+(defun org-table-current-column ()
+ "Return current column number."
+ (interactive)
+ (save-excursion
+ (let ((pos (point)))
+ (beginning-of-line)
+ (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.
+Only data lines count for this."
+ (save-excursion
+ (let ((c 0)
+ (pos (line-beginning-position)))
+ (goto-char (org-table-begin))
+ (while (<= (point) pos)
+ (when (looking-at org-table-dataline-regexp) (cl-incf c))
+ (forward-line))
+ c)))
+
+(defun org-table-goto-line (N)
+ "Go to the Nth data line in the current table.
+Return t when the line exists, nil if it does not exist."
+ (goto-char (org-table-begin))
+ (let ((end (org-table-end)) (cnt 0))
+ (while (and (re-search-forward org-table-dataline-regexp end t)
+ (< (setq cnt (1+ cnt)) N)))
+ (= cnt N)))
+
+;;;###autoload
+(defun org-table-blank-field ()
+ "Blank the current table field or active region."
+ (interactive)
+ (org-table-check-inside-data-field)
+ (if (and (called-interactively-p 'any) (org-region-active-p))
+ (let (org-table-clip)
+ (org-table-cut-region (region-beginning) (region-end)))
+ (skip-chars-backward "^|")
+ (backward-char 1)
+ (if (looking-at "|[^|\n]+")
+ (let* ((pos (match-beginning 0))
+ (match (match-string 0))
+ (len (org-string-width match)))
+ (replace-match (concat "|" (make-string (1- len) ?\ )))
+ (goto-char (+ 2 pos))
+ (substring match 1)))))
+
+(defun org-table-get-field (&optional n replace)
+ "Return the value of the field in column N of current row.
+N defaults to current column. If REPLACE is a string, replace
+field with this value. The return value is always the old
+value."
+ (when n (org-table-goto-column n))
+ (skip-chars-backward "^|\n")
+ (if (or (bolp) (looking-at-p "[ \t]*$"))
+ ;; Before first column or after last one.
+ ""
+ (looking-at "[^|\r\n]*")
+ (let* ((pos (match-beginning 0))
+ (val (buffer-substring pos (match-end 0))))
+ (when replace
+ (org-table-with-shrunk-field
+ (replace-match (if (equal replace "") " " replace) t t)))
+ (goto-char (min (line-end-position) (1+ pos)))
+ val)))
+
+;;;###autoload
+(defun org-table-field-info (_arg)
+ "Show info about the current field, and highlight any reference at point."
+ (interactive "P")
+ (unless (org-at-table-p) (user-error "Not at a table"))
+ (org-table-analyze)
+ (save-excursion
+ (let* ((pos (point))
+ (col (org-table-current-column))
+ (cname (car (rassoc (number-to-string col) org-table-column-names)))
+ (name (car (rassoc (list (count-lines org-table-current-begin-pos
+ (line-beginning-position))
+ col)
+ org-table-named-field-locations)))
+ (eql (org-table-expand-lhs-ranges
+ (mapcar
+ (lambda (e)
+ (cons (org-table-formula-handle-first/last-rc (car e))
+ (cdr e)))
+ (org-table-get-stored-formulas))))
+ (dline (org-table-current-dline))
+ (ref (format "@%d$%d" dline col))
+ (ref1 (org-table-convert-refs-to-an ref))
+ ;; Prioritize field formulas over column formulas.
+ (fequation (or (assoc name eql) (assoc ref eql)))
+ (cequation (assoc (format "$%d" col) eql))
+ (eqn (or fequation cequation)))
+ (let ((p (and eqn (get-text-property 0 :orig-eqn (car eqn)))))
+ (when p (setq eqn p)))
+ (goto-char pos)
+ (ignore-errors (org-table-show-reference 'local))
+ (message "line @%d, col $%s%s, ref @%d$%d or %s%s%s"
+ dline col
+ (if cname (concat " or $" cname) "")
+ dline col ref1
+ (if name (concat " or $" name) "")
+ ;; FIXME: formula info not correct if special table line
+ (if eqn
+ (concat ", formula: "
+ (org-table-formula-to-user
+ (concat
+ (if (or (string-prefix-p "$" (car eqn))
+ (string-prefix-p "@" (car eqn)))
+ ""
+ "$")
+ (car eqn) "=" (cdr eqn))))
+ "")))))
+
+(defun org-table-goto-field (ref &optional create-column-p)
+ "Move point to a specific field in the current table.
+
+REF is either the name of a field its absolute reference, as
+a string. No column is created unless CREATE-COLUMN-P is
+non-nil. If it is a function, it is called with the column
+number as its argument as is used as a predicate to know if the
+column can be created.
+
+This function assumes the table is already analyzed (i.e., using
+`org-table-analyze')."
+ (let* ((coordinates
+ (cond
+ ((cdr (assoc ref org-table-named-field-locations)))
+ ((string-match "\\`@\\([1-9][0-9]*\\)\\$\\([1-9][0-9]*\\)\\'" ref)
+ (list (condition-case nil
+ (aref org-table-dlines
+ (string-to-number (match-string 1 ref)))
+ (error (user-error "Invalid row number in %s" ref)))
+ (string-to-number (match-string 2 ref))))
+ (t (user-error "Unknown field: %s" ref))))
+ (line (car coordinates))
+ (column (nth 1 coordinates))
+ (create-new-column (if (functionp create-column-p)
+ (funcall create-column-p column)
+ create-column-p)))
+ (when coordinates
+ (goto-char org-table-current-begin-pos)
+ (forward-line line)
+ (org-table-goto-column column nil create-new-column))))
+
+;;;###autoload
+(defun org-table-goto-column (n &optional on-delim force)
+ "Move the cursor to the Nth column in the current table line.
+With optional argument ON-DELIM, stop with point before the left delimiter
+of the field.
+If there are less than N fields, just go to after the last delimiter.
+However, when FORCE is non-nil, create new columns if necessary."
+ (interactive "p")
+ (beginning-of-line 1)
+ (when (> n 0)
+ (while (and (> (setq n (1- n)) -1)
+ (or (search-forward "|" (point-at-eol) t)
+ (and force
+ (progn (end-of-line 1)
+ (skip-chars-backward "^|")
+ (insert " | ")
+ t)))))
+ (when (and force (not (looking-at ".*|")))
+ (save-excursion (end-of-line 1) (insert " | ")))
+ (if on-delim
+ (backward-char 1)
+ (if (looking-at " ") (forward-char 1)))))
+
+;;;###autoload
+(defun org-table-insert-column ()
+ "Insert a new column into the table."
+ (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)))
+ (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)
+ (insert "|"))
+ (forward-line)))
+ (org-table-goto-column 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))))
+
+(defun org-table-find-dataline ()
+ "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.
+
+If there is no data line in this line, return nil.
+
+If there is no matching dline (most likely the reference was
+a hline), the first dline below it is used. When ABOVE is
+non-nil, the one above is used."
+ (let ((min 1)
+ (max (1- (length org-table-dlines))))
+ (cond ((or (> (aref org-table-dlines min) line)
+ (< (aref org-table-dlines max) line))
+ nil)
+ ((= line (aref org-table-dlines max)) max)
+ (t (catch 'exit
+ (while (> (- max min) 1)
+ (let* ((mean (/ (+ max min) 2))
+ (v (aref org-table-dlines mean)))
+ (cond ((= v line) (throw 'exit mean))
+ ((> v line) (setq max mean))
+ (t (setq min mean)))))
+ (cond ((= line (aref org-table-dlines max)) max)
+ ((= line (aref org-table-dlines min)) min)
+ (above min)
+ (t max)))))))
+
+(defun org-table--swap-cells (row1 col1 row2 col2)
+ "Swap two cells indicated by the coordinates provided.
+ROW1, COL1, ROW2, COL2 are integers indicating the row/column
+position of the two cells that will be swapped in the table."
+ (let ((content1 (org-table-get row1 col1))
+ (content2 (org-table-get row2 col2)))
+ (org-table-put row1 col1 content2)
+ (org-table-put row2 col2 content1)))
+
+(defun org-table--move-cell (direction)
+ "Move the current cell in a cardinal direction.
+DIRECTION is a symbol among `up', `down', `left', and `right'.
+The contents the current cell are swapped with cell in the
+indicated direction. Raise an error if the move cannot be done."
+ (let ((row-shift (pcase direction (`up -1) (`down 1) (_ 0)))
+ (column-shift (pcase direction (`left -1) (`right 1) (_ 0))))
+ (when (and (= 0 row-shift) (= 0 column-shift))
+ (error "Invalid direction: %S" direction))
+ ;; Initialize `org-table-current-ncol' and `org-table-dlines'.
+ (org-table-analyze)
+ (let* ((row (org-table-current-line))
+ (column (org-table-current-column))
+ (target-row (+ row row-shift))
+ (target-column (+ column column-shift))
+ (org-table-current-nrow (1- (length org-table-dlines))))
+ (when (or (< target-column 1)
+ (< target-row 1)
+ (> target-column org-table-current-ncol)
+ (> target-row org-table-current-nrow))
+ (user-error "Cannot move cell further"))
+ (org-table--swap-cells row column target-row target-column)
+ (org-table-goto-line target-row)
+ (org-table-goto-column target-column))))
+
+;;;###autoload
+(defun org-table-move-cell-up ()
+ "Move a single cell up in a table.
+Swap with anything in target cell."
+ (interactive)
+ (unless (org-table-check-inside-data-field)
+ (error "No table at point"))
+ (org-table--move-cell 'up)
+ (org-table-align))
+
+;;;###autoload
+(defun org-table-move-cell-down ()
+ "Move a single cell down in a table.
+Swap with anything in target cell."
+ (interactive)
+ (unless (org-table-check-inside-data-field)
+ (error "No table at point"))
+ (org-table--move-cell 'down)
+ (org-table-align))
+
+;;;###autoload
+(defun org-table-move-cell-left ()
+ "Move a single cell left in a table.
+Swap with anything in target cell."
+ (interactive)
+ (unless (org-table-check-inside-data-field)
+ (error "No table at point"))
+ (org-table--move-cell 'left)
+ (org-table-align))
+
+;;;###autoload
+(defun org-table-move-cell-right ()
+ "Move a single cell right in a table.
+Swap with anything in target cell."
+ (interactive)
+ (unless (org-table-check-inside-data-field)
+ (error "No table at point"))
+ (org-table--move-cell 'right)
+ (org-table-align))
+
+;;;###autoload
+(defun org-table-delete-column ()
+ "Delete a column from the table."
+ (interactive)
+ (unless (org-at-table-p) (user-error "Not at a table"))
+ (org-table-find-dataline)
+ (when (save-excursion (skip-chars-forward " \t") (eolp))
+ (search-backward "|")) ;snap into last column
+ (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)
+ (if (org-at-table-hline-p)
+ nil
+ (org-table-goto-column col t)
+ (and (looking-at "|[^|\n]+|")
+ (replace-match "|")))
+ (forward-line)))
+ (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
+ "$" (list (cons (number-to-string col) "INVALID")) col -1 col))))
+
+;;;###autoload
+(defun org-table-move-column-right ()
+ "Move column to the right."
+ (interactive)
+ (org-table-move-column nil))
+
+;;;###autoload
+(defun org-table-move-column-left ()
+ "Move column to the left."
+ (interactive)
+ (org-table-move-column 'left))
+
+;;;###autoload
+(defun org-table-move-column (&optional left)
+ "Move the current column to the right. With arg LEFT, move to the left."
+ (interactive "P")
+ (unless (org-at-table-p) (user-error "Not at a table"))
+ (org-table-find-dataline)
+ (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)))
+ (beg (org-table-begin))
+ (end (copy-marker (org-table-end))))
+ (when (and left (= col 1))
+ (user-error "Cannot move column further left"))
+ (when (and (not left) (looking-at "[^|\n]*|[^|\n]*$"))
+ (user-error "Cannot move column further right"))
+ (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))))))))
+
+;;;###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."
+ (interactive)
+ (org-table-move-row 'up))
+
+;;;###autoload
+(defun org-table-move-row (&optional up)
+ "Move the current table line down. With arg UP, move it up."
+ (interactive "P")
+ (let* ((col (current-column))
+ (pos (point))
+ (hline1p (save-excursion (beginning-of-line 1)
+ (looking-at org-table-hline-regexp)))
+ (dline1 (org-table-current-dline))
+ (dline2 (+ dline1 (if up -1 1)))
+ (tonew (if up 0 2))
+ hline2p)
+ (when (and up (= (point-min) (line-beginning-position)))
+ (user-error "Cannot move row further"))
+ (beginning-of-line tonew)
+ (when (or (and (not up) (eobp)) (not (org-at-table-p)))
+ (goto-char pos)
+ (user-error "Cannot move row further"))
+ (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)
+ "Insert a new row above the current line into the table.
+With prefix ARG, insert below the current line."
+ (interactive "P")
+ (unless (org-at-table-p) (user-error "Not at a table"))
+ (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")
+ (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)
+ "Insert a hline and move to the row below that line."
+ (interactive "P")
+ (let ((col (org-table-current-column)))
+ (org-table-maybe-eval-formula)
+ (org-table-maybe-recalculate-line)
+ (org-table-insert-hline)
+ (end-of-line 2)
+ (if (looking-at "\n[ \t]*|-")
+ (progn (insert "\n|") (org-table-align))
+ (org-table-next-field))
+ (if same-column (org-table-goto-column col))))
+
+(defun org-table-clean-line (s)
+ "Convert a table line S into a string with only \"|\" and space.
+In particular, this does handle wide and invisible characters."
+ (if (string-match "^[ \t]*|-" s)
+ ;; It's a hline, just map the characters
+ (setq s (mapconcat (lambda (x) (if (member x '(?| ?+)) "|" " ")) s ""))
+ (while (string-match "|\\([ \t]*?[^ \t\r\n|][^\r\n|]*\\)|" s)
+ (setq s (replace-match
+ (concat "|" (make-string (org-string-width (match-string 1 s))
+ ?\ ) "|")
+ t t s)))
+ s))
+
+;;;###autoload
+(defun org-table-kill-row ()
+ "Delete the current row or horizontal line from the table."
+ (interactive)
+ (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))))
+ (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-cut-region (beg end)
+ "Copy region in table to the clipboard and blank all relevant fields.
+If there is no active region, use just the field at point."
+ (interactive (list
+ (if (org-region-active-p) (region-beginning) (point))
+ (if (org-region-active-p) (region-end) (point))))
+ (org-table-copy-region beg end 'cut))
+
+(defun org-table--increment-field (field previous)
+ "Increment string FIELD according to PREVIOUS field.
+
+Increment FIELD only if it is a string representing a number, per
+Emacs Lisp syntax, a timestamp, or is either prefixed or suffixed
+with a number. In any other case, return FIELD as-is.
+
+If PREVIOUS has the same structure as FIELD, e.g.,
+a number-prefixed string with the same pattern, the increment
+step is the difference between numbers (or timestamps, measured
+in days) in PREVIOUS and FIELD. Otherwise, it uses
+`org-table-copy-increment', if the variable contains a number, or
+default to 1.
+
+The function assumes `org-table-copy-increment' is non-nil."
+ (let* ((default-step (if (numberp org-table-copy-increment)
+ org-table-copy-increment
+ 1))
+ (number-regexp ;Lisp read syntax for numbers
+ (rx (and string-start
+ (opt (any "+-"))
+ (or (and (one-or-more digit) (opt "."))
+ (and (zero-or-more digit) "." (one-or-more digit)))
+ (opt (any "eE") (opt (opt (any "+-")) (one-or-more digit)))
+ string-end)))
+ (number-prefix-regexp (rx (and string-start (one-or-more digit))))
+ (number-suffix-regexp (rx (and (one-or-more digit) string-end)))
+ (analyze
+ (lambda (field)
+ ;; Analyze string FIELD and return information related to
+ ;; increment or nil. When non-nil, return value has the
+ ;; following scheme: (TYPE VALUE PATTERN) where
+ ;; - TYPE is a symbol among `number', `prefix', `suffix'
+ ;; and `timestamp',
+ ;; - VALUE is a timestamp if TYPE is `timestamp', or
+ ;; a number otherwise,
+ ;; - PATTERN is the field without its prefix, or suffix if
+ ;; TYPE is either `prefix' or `suffix' , or nil
+ ;; otherwise.
+ (cond ((not (org-string-nw-p field)) nil)
+ ((string-match-p number-regexp field)
+ (list 'number
+ (string-to-number field)
+ nil))
+ ((string-match number-prefix-regexp field)
+ (list 'prefix
+ (string-to-number (match-string 0 field))
+ (substring field (match-end 0))))
+ ((string-match number-suffix-regexp field)
+ (list 'suffix
+ (string-to-number (match-string 0 field))
+ (substring field 0 (match-beginning 0))))
+ ((string-match-p org-ts-regexp3 field)
+ (list 'timestamp field nil))
+ (t nil))))
+ (next-number-string
+ (lambda (n1 &optional n2)
+ ;; Increment number N1 and return it as a string. If N2
+ ;; is also a number, deduce increment step from the
+ ;; difference between N1 and N2. Otherwise, increment
+ ;; step is `default-step'.
+ (number-to-string (if n2 (+ n1 (- n1 n2)) (+ n1 default-step)))))
+ (shift-timestamp
+ (lambda (t1 &optional t2)
+ ;; Increment timestamp T1 and return it. If T2 is also
+ ;; a timestamp, deduce increment step from the difference,
+ ;; in days, between T1 and T2. Otherwise, increment by
+ ;; `default-step' days.
+ (with-temp-buffer
+ (insert t1)
+ (org-timestamp-up-day (if (not t2) default-step
+ (- (org-time-string-to-absolute t1)
+ (org-time-string-to-absolute t2))))
+ (buffer-string)))))
+ ;; Check if both PREVIOUS and FIELD have the same type. Also, if
+ ;; the case of prefixed or suffixed numbers, make sure their
+ ;; pattern, i.e., the part of the string without the prefix or the
+ ;; suffix, is the same.
+ (pcase (cons (funcall analyze field) (funcall analyze previous))
+ (`((number ,n1 ,_) . (number ,n2 ,_))
+ (funcall next-number-string n1 n2))
+ (`((number ,n ,_) . ,_)
+ (funcall next-number-string n))
+ (`((prefix ,n1 ,p1) . (prefix ,n2 ,p2))
+ (concat (funcall next-number-string n1 (and (equal p1 p2) n2)) p1))
+ (`((prefix ,n ,p) . ,_)
+ (concat (funcall next-number-string n) p))
+ (`((suffix ,n1 ,p1) . (suffix ,n2 ,p2))
+ (concat p1 (funcall next-number-string n1 (and (equal p1 p2) n2))))
+ (`((suffix ,n ,p) . ,_)
+ (concat p (funcall next-number-string n)))
+ (`((timestamp ,t1 ,_) . (timestamp ,t2 ,_))
+ (funcall shift-timestamp t1 t2))
+ (`((timestamp ,t1 ,_) . ,_)
+ (funcall shift-timestamp t1))
+ (_ field))))
+
+;;;###autoload
+(defun org-table-copy-down (n)
+ "Copy the value of the current field one row below.
+
+If the field at the cursor is empty, copy the content of the
+nearest non-empty field above. With argument N, use the Nth
+non-empty field.
+
+If the current field is not empty, it is copied down to the next
+row, and the cursor is moved with it. Therefore, repeating this
+command causes the column to be filled row-by-row.
+
+If the variable `org-table-copy-increment' is non-nil and the
+field is a number, a timestamp, or is either prefixed or suffixed
+with a number, it will be incremented while copying. By default,
+increment by the difference between the value in the current
+field and the one in the field above, if any. To increment using
+a fixed integer, set `org-table-copy-increment' to a number. In
+the case of a timestamp, increment by days.
+
+However, when N is 0, do not increment the field at all."
+ (interactive "p")
+ (org-table-check-inside-data-field)
+ (let* ((beg (org-table-begin))
+ (column (org-table-current-column))
+ (initial-field (save-excursion
+ (let ((f (org-string-nw-p (org-table-get-field))))
+ (and f (org-trim f)))))
+ field field-above next-field)
+ (save-excursion
+ ;; Get reference field.
+ (if initial-field (setq field initial-field)
+ (beginning-of-line)
+ (setq field
+ (catch :exit
+ (while (re-search-backward org-table-dataline-regexp beg t)
+ (let ((f (org-string-nw-p (org-table-get-field column))))
+ (cond ((and (> n 1) f) (cl-decf n))
+ (f (throw :exit (org-trim f)))
+ (t nil))
+ (beginning-of-line)))
+ (user-error "No non-empty field found"))))
+ ;; Check if increment is appropriate, and how it should be done.
+ (when (and org-table-copy-increment (/= n 0))
+ ;; If increment step is not explicit, get non-empty field just
+ ;; above the field being incremented to guess it.
+ (unless (numberp org-table-copy-increment)
+ (setq field-above
+ (let ((f (unless (= beg (line-beginning-position))
+ (forward-line -1)
+ (not (org-at-table-hline-p))
+ (org-table-get-field column))))
+ (and (org-string-nw-p f)
+ (org-trim f)))))
+ ;; Compute next field.
+ (setq next-field (org-table--increment-field field field-above))))
+ ;; Since initial field in not empty, we modify row below instead.
+ ;; Skip alignment since we do it at the end of the process anyway.
+ (when initial-field
+ (let ((org-table-may-need-update nil)) (org-table-next-row))
+ (org-table-blank-field))
+ ;; Insert the new field. NEW-FIELD may be nil if
+ ;; `org-table-increment' is nil, or N = 0. In that case, copy
+ ;; FIELD.
+ (insert (or next-field field))
+ (org-table-maybe-recalculate-line)
+ (org-table-align)))
+
+;;;###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'. 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))
+ current-prefix-arg))
+ (goto-char (min beg end))
+ (org-table-check-inside-data-field)
+ (let ((beg (line-beginning-position))
+ (c01 (org-table-current-column))
+ region)
+ (goto-char (max beg end))
+ (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))
+ (column-end (max c01 c02))
+ (column-number (1+ (- column-end column-start)))
+ (rpl (and cut " ")))
+ (goto-char beg)
+ (while (< (point) end)
+ (unless (org-at-table-hline-p)
+ ;; Collect every cell between COLUMN-START and COLUMN-END.
+ (let (cols)
+ (dotimes (c column-number)
+ (push (org-table-get-field (+ c column-start) rpl) cols))
+ (push (nreverse cols) region)))
+ (forward-line))
+ (set-marker end nil))
+ (when cut (org-table-align))
+ (when (called-interactively-p 'any)
+ (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
+(defun org-table-paste-rectangle ()
+ "Paste a rectangular region into a table.
+The upper right 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."
+ (interactive)
+ (unless (consp org-table-clip)
+ (user-error "First cut/copy a region to paste!"))
+ (org-table-check-inside-data-field)
+ (let* ((column (org-table-current-column))
+ (org-table-automatic-realign nil))
+ (org-table-save-field
+ (dolist (row org-table-clip)
+ (while (org-at-table-hline-p) (forward-line))
+ ;; If we left the table, create a new row.
+ (when (and (bolp) (not (looking-at "[ \t]*|")))
+ (end-of-line 0)
+ (org-table-next-field))
+ (let ((c column))
+ (dolist (field row)
+ (org-table-goto-column c nil 'force)
+ (org-table-get-field nil field)
+ (cl-incf c)))
+ (forward-line)))
+ (org-table-align)))
+
+
+;;; Follow Field minor mode
+
+(define-minor-mode org-table-follow-field-mode
+ "Minor mode to make the table field editor window follow the cursor.
+When this mode is active, the field editor window will always show the
+current field. The mode exits automatically when the cursor leaves the
+table (but see `org-table-exit-follow-field-mode-when-leaving-table')."
+ :lighter " TblFollow"
+ (if org-table-follow-field-mode
+ (add-hook 'post-command-hook 'org-table-follow-fields-with-editor
+ 'append 'local)
+ (remove-hook 'post-command-hook 'org-table-follow-fields-with-editor 'local)
+ (let* ((buf (get-buffer "*Org Table Edit Field*"))
+ (win (and buf (get-buffer-window buf))))
+ (when win (delete-window win))
+ (when buf
+ (with-current-buffer buf
+ (move-marker org-field-marker nil))
+ (kill-buffer buf)))))
+
+;;;###autoload
+(defun org-table-edit-field (arg)
+ "Edit table field in a different window.
+This is mainly useful for fields that contain hidden parts.
+
+When called with a `\\[universal-argument]' prefix, just make the full field
+visible so that it can be edited in place.
+
+When called with a `\\[universal-argument] \\[universal-argument]' prefix, \
+toggle `org-table-follow-field-mode'."
+ (interactive "P")
+ (unless (org-at-table-p) (user-error "Not at a table"))
+ (cond
+ ((equal arg '(16))
+ (org-table-follow-field-mode (if org-table-follow-field-mode -1 1)))
+ (arg
+ (let ((b (save-excursion (skip-chars-backward "^|") (point)))
+ (e (save-excursion (skip-chars-forward "^|\r\n") (point))))
+ (remove-text-properties b e '(invisible t intangible t))
+ (if font-lock-mode
+ (font-lock-fontify-block))))
+ (t
+ (let ((pos (point-marker))
+ (coord
+ (if (eq org-table-use-standard-references t)
+ (concat (org-number-to-letters (org-table-current-column))
+ (number-to-string (org-table-current-dline)))
+ (concat "@" (number-to-string (org-table-current-dline))
+ "$" (number-to-string (org-table-current-column)))))
+ (field (org-table-get-field))
+ (cw (current-window-configuration))
+ p)
+ (goto-char pos)
+ (org-switch-to-buffer-other-window "*Org Table Edit Field*")
+ (when (and (local-variable-p 'org-field-marker)
+ (markerp org-field-marker))
+ (move-marker org-field-marker nil))
+ (erase-buffer)
+ (insert "#\n# Edit field " coord " and finish with C-c C-c\n#\n")
+ (let ((org-inhibit-startup t)) (org-mode))
+ (auto-fill-mode -1)
+ (setq truncate-lines nil)
+ (setq word-wrap t)
+ (goto-char (setq p (point-max)))
+ (insert (org-trim field))
+ (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)
+ (setq-local org-field-marker pos)
+ (message "Edit and finish with C-c C-c")))))
+
+(defun org-table-follow-fields-with-editor ()
+ (if (and org-table-exit-follow-field-mode-when-leaving-table
+ (not (org-at-table-p)))
+ ;; We have left the table, exit the follow mode
+ (org-table-follow-field-mode -1)
+ (when (org-table-check-inside-data-field 'noerror)
+ (let ((win (selected-window)))
+ (org-table-edit-field nil)
+ (org-fit-window-to-buffer)
+ (select-window win)))))
+
+(defun org-table-finish-edit-field ()
+ "Finish editing a table data field.
+Remove all newline characters, insert the result into the table, realign
+the table and kill the editing buffer."
+ (let ((pos org-field-marker)
+ (cw org-window-configuration)
+ (cb (current-buffer))
+ text)
+ (goto-char (point-min))
+ (while (re-search-forward "^#.*\n?" nil t) (replace-match ""))
+ (while (re-search-forward "[ \t]*\n[ \t\n]*" nil t)
+ (replace-match " "))
+ (setq text (org-trim (buffer-string)))
+ (set-window-configuration cw)
+ (kill-buffer cb)
+ (select-window (get-buffer-window (marker-buffer pos)))
+ (goto-char pos)
+ (move-marker pos nil)
+ (org-table-check-inside-data-field)
+ (org-table-get-field nil text)
+ (org-table-align)
+ (message "New field value inserted")))
+
+
+;;; Formulas
+
+(defun org-table-current-field-formula (&optional key noerror)
+ "Return the formula active for the current field.
+
+Assumes that table is already analyzed. If KEY is given, return
+the key to this formula. Otherwise return the formula preceded
+with \"=\" or \":=\"."
+ (let* ((line (count-lines org-table-current-begin-pos
+ (line-beginning-position)))
+ (row (org-table-line-to-dline line)))
+ (cond
+ (row
+ (let* ((col (org-table-current-column))
+ (name (car (rassoc (list line col)
+ org-table-named-field-locations)))
+ (scol (format "$%d" col))
+ (ref (format "@%d$%d" (org-table-current-dline) col))
+ (stored-list (org-table-get-stored-formulas noerror))
+ (ass (or (assoc name stored-list)
+ (assoc ref stored-list)
+ (assoc scol stored-list))))
+ (cond (key (car ass))
+ (ass (concat (if (string-match-p "^[0-9]+$" (car ass)) "=" ":=")
+ (cdr ass))))))
+ (noerror nil)
+ (t (error "No formula active for the current field")))))
+
+(defun org-table-get-formula (&optional equation named)
+ "Read a formula from the minibuffer, offer stored formula as default.
+When NAMED is non-nil, look for a named equation."
+ (let* ((stored-list (org-table-get-stored-formulas))
+ (name (car (rassoc (list (count-lines org-table-current-begin-pos
+ (line-beginning-position))
+ (org-table-current-column))
+ org-table-named-field-locations)))
+ (ref (format "@%d$%d"
+ (org-table-current-dline)
+ (org-table-current-column)))
+ (scol (cond
+ ((not named) (format "$%d" (org-table-current-column)))
+ (name)
+ (t ref)))
+ (name (or name ref))
+ (org-table-may-need-update nil)
+ (stored (cdr (assoc scol stored-list)))
+ (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)))))
+ mustsave)
+ (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"))
+ (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)))
+ (when (or mustsave (not (equal stored eq)))
+ (org-table-store-formulas stored-list))
+ eq))
+
+(defun org-table-store-formulas (alist &optional location)
+ "Store the list of formulas below the current table.
+If optional argument LOCATION is a buffer position, insert it at
+LOCATION instead."
+ (save-excursion
+ (if location
+ (progn (goto-char location) (beginning-of-line))
+ (goto-char (org-table-end)))
+ (let ((case-fold-search t))
+ (if (looking-at "\\([ \t]*\n\\)*[ \t]*\\(#\\+TBLFM:\\)\\(.*\n?\\)")
+ (progn
+ ;; Don't overwrite TBLFM, we might use text properties to
+ ;; store stuff.
+ (goto-char (match-beginning 3))
+ (delete-region (match-beginning 3) (match-end 0)))
+ (org-indent-line)
+ (insert "#+TBLFM:"))
+ (insert " "
+ (mapconcat (lambda (x) (concat (car x) "=" (cdr x)))
+ (sort alist #'org-table-formula-less-p)
+ "::")
+ "\n"))))
+
+(defsubst org-table-formula-make-cmp-string (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))
+ (setq a (format "$%d" (+ 10000
+ (if (= arrow ?<) -1000 0)
+ (string-to-number (substring a 1)))))))
+ (when (string-match
+ "^\\(@\\([0-9]+\\)\\)?\\(\\$?\\([0-9]+\\)\\)?\\(\\$?[a-zA-Z0-9]+\\)?"
+ a)
+ (concat
+ (if (match-end 2)
+ (format "@%05d" (string-to-number (match-string 2 a))) "")
+ (if (match-end 4)
+ (format "$%05d" (string-to-number (match-string 4 a))) "")
+ (if (match-end 5)
+ (concat "@@" (match-string 5 a))))))
+
+(defun org-table-formula-less-p (a b)
+ "Compare two formulas for sorting."
+ (let ((as (org-table-formula-make-cmp-string (car a)))
+ (bs (org-table-formula-make-cmp-string (car b))))
+ (and as bs (string< as bs))))
+
+;;;###autoload
+(defun org-table-get-stored-formulas (&optional noerror location)
+ "Return an alist with the stored formulas directly after current table.
+By default, only return active formulas, i.e., formulas located
+on the first line after the table. However, if optional argument
+LOCATION is a buffer position, consider the formulas there."
+ (save-excursion
+ (if location
+ (progn (goto-char location) (beginning-of-line))
+ (goto-char (org-table-end)))
+ (let ((case-fold-search t))
+ (when (looking-at "\\([ \t]*\n\\)*[ \t]*#\\+TBLFM: *\\(.*\\)")
+ (let ((strings (org-split-string (match-string-no-properties 2)
+ " *:: *"))
+ eq-alist seen)
+ (dolist (string strings (nreverse eq-alist))
+ (when (string-match "\\`\\(@[-+I<>0-9.$@]+\\|\\$\\([_a-zA-Z0-9]+\\|\
+\[<>]+\\)\\) *= *\\(.*[^ \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)
+ ;; Since named columns are not possible in
+ ;; LHS, assume this is a named field.
+ (t (match-string 2 string)))))
+ (rhs (match-string 3 string)))
+ (push (cons lhs rhs) eq-alist)
+ (cond
+ ((not (member lhs seen)) (push lhs seen))
+ (noerror
+ (message
+ "Double definition `%s=' in TBLFM line, please fix by hand"
+ lhs)
+ (ding)
+ (sit-for 2))
+ (t
+ (user-error
+ "Double definition `%s=' in TBLFM line, please fix by hand"
+ lhs)))))))))))
+
+(defun org-table-fix-formulas (key replace &optional limit delta remove)
+ "Modify the equations after the table structure has been edited.
+KEY is \"@\" or \"$\". REPLACE is an alist of numbers to replace.
+For all numbers larger than LIMIT, shift them by DELTA."
+ (save-excursion
+ (goto-char (org-table-end))
+ (while (let ((case-fold-search t)) (looking-at "[ \t]*#\\+tblfm:"))
+ (let ((re (concat key "\\([0-9]+\\)"))
+ (re2
+ (when remove
+ (if (equal key "$")
+ (format "\\(@[0-9]+\\)?%s%d=.*?\\(::\\|$\\)"
+ (regexp-quote key) remove)
+ (format "@%d\\$[0-9]+=.*?\\(::\\|$\\)" remove))))
+ s n a)
+ (when remove
+ (while (re-search-forward re2 (point-at-eol) t)
+ (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
+ (if (equal (char-before (match-beginning 0)) ?.)
+ (user-error
+ "Change makes TBLFM term %s invalid, use undo to recover"
+ (match-string 0))
+ (replace-match "")))))
+ (while (re-search-forward re (point-at-eol) t)
+ (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
+ (setq s (match-string 1) n (string-to-number s))
+ (cond
+ ((setq a (assoc s replace))
+ (replace-match (concat key (cdr a)) t t))
+ ((and limit (> n limit))
+ (replace-match (concat key (number-to-string (+ n delta))) t t)))))
+ (message "The formulas in #+TBLFM have been updated"))
+ (forward-line))))
+
+;;;###autoload
+(defun org-table-maybe-eval-formula ()
+ "Check if the current field starts with \"=\" or \":=\".
+If yes, store the formula and apply it."
+ ;; We already know we are in a table. Get field will only return a formula
+ ;; when appropriate. It might return a separator line, but no problem.
+ (when org-table-formula-evaluate-inline
+ (let* ((field (org-trim (or (org-table-get-field) "")))
+ named eq)
+ (when (string-match "^:?=\\(.*[^=]\\)$" field)
+ (setq named (equal (string-to-char field) ?:)
+ eq (match-string 1 field))
+ (org-table-eval-formula (and named '(4))
+ (org-table-formula-from-user eq))))))
+
+;;;###autoload
+(defun org-table-rotate-recalc-marks (&optional newchar)
+ "Rotate the recalculation mark in the first column.
+If in any row, the first field is not consistent with a mark,
+insert a new column for the markers.
+When there is an active region, change all the lines in the region,
+after prompting for the marking character.
+After each change, a message will be displayed indicating the meaning
+of the new mark."
+ (interactive)
+ (unless (org-at-table-p) (user-error "Not at a table"))
+ (let* ((region (org-region-active-p))
+ (l1 (and region
+ (save-excursion (goto-char (region-beginning))
+ (copy-marker (line-beginning-position)))))
+ (l2 (and region
+ (save-excursion (goto-char (region-end))
+ (copy-marker (line-beginning-position)))))
+ (l (copy-marker (line-beginning-position)))
+ (col (org-table-current-column))
+ (newchar (if region
+ (char-to-string
+ (read-char-exclusive
+ "Change region to what mark? Type # * ! $ or SPC: "))
+ newchar))
+ (no-special-column
+ (save-excursion
+ (goto-char (org-table-begin))
+ (re-search-forward
+ "^[ \t]*|[^-|][^|]*[^#!$*_^| \t][^|]*|" (org-table-end) t))))
+ (when (and newchar (not (assoc newchar org-recalc-marks)))
+ (user-error "Invalid character `%s' in `org-table-rotate-recalc-marks'"
+ newchar))
+ (when l1 (goto-char l1))
+ (save-excursion
+ (beginning-of-line)
+ (unless (looking-at org-table-dataline-regexp)
+ (user-error "Not at a table data line")))
+ (when no-special-column
+ (org-table-goto-column 1)
+ (org-table-insert-column))
+ (let ((previous-line-end (line-end-position))
+ (newchar
+ (save-excursion
+ (beginning-of-line)
+ (cond ((not (looking-at "^[ \t]*| *\\([#!$*^_ ]\\) *|")) "#")
+ (newchar)
+ (t (cadr (member (match-string 1)
+ (append (mapcar #'car org-recalc-marks)
+ '(" ")))))))))
+ ;; Rotate mark in first row.
+ (org-table-get-field 1 (format " %s " newchar))
+ ;; Rotate marks in additional rows if a region is active.
+ (when region
+ (save-excursion
+ (forward-line)
+ (while (<= (point) l2)
+ (when (looking-at org-table-dataline-regexp)
+ (org-table-get-field 1 (format " %s " newchar)))
+ (forward-line))))
+ ;; Only align if rotation actually changed lines' length.
+ (when (/= previous-line-end (line-end-position)) (org-table-align)))
+ (goto-char l)
+ (org-table-goto-column (if no-special-column (1+ col) col))
+ (when l1 (set-marker l1 nil))
+ (when l2 (set-marker l2 nil))
+ (set-marker l nil)
+ (when (called-interactively-p 'interactive)
+ (message "%s" (cdr (assoc newchar org-recalc-marks))))))
+
+;;;###autoload
+(defun org-table-maybe-recalculate-line ()
+ "Recompute the current line if marked for it, and if we haven't just done it."
+ (interactive)
+ (and org-table-allow-automatic-line-recalculation
+ (not (and (memq last-command org-recalc-commands)
+ (eq org-last-recalc-line (line-beginning-position))))
+ (save-excursion (beginning-of-line 1)
+ (looking-at org-table-auto-recalculate-regexp))
+ (org-table-recalculate) t))
+
+;;;###autoload
+(defun org-table-eval-formula (&optional arg equation
+ suppress-align suppress-const
+ suppress-store suppress-analysis)
+ "Replace the table field value at the cursor by the result of a calculation.
+
+In a table, this command replaces the value in the current field with the
+result of a formula. It also installs the formula as the \"current\" column
+formula, by storing it in a special line below the table. When called
+with a `\\[universal-argument]' prefix the formula is installed as a \
+field formula.
+
+When called with a `\\[universal-argument] \\[universal-argument]' prefix, \
+insert the active equation for the field
+back into the current field, so that it can be edited there. This is \
+useful
+in order to use \\<org-table-fedit-map>`\\[org-table-show-reference]' to \
+check the referenced fields.
+
+When called, the command first prompts for a formula, which is read in
+the minibuffer. Previously entered formulas are available through the
+history list, and the last used formula is offered as a default.
+These stored formulas are adapted correctly when moving, inserting, or
+deleting columns with the corresponding commands.
+
+The formula can be any algebraic expression understood by the Calc package.
+For details, see the Org mode manual.
+
+This function can also be called from Lisp programs and offers
+additional arguments: EQUATION can be the formula to apply. If this
+argument is given, the user will not be prompted.
+
+SUPPRESS-ALIGN is used to speed-up recursive calls by by-passing
+unnecessary aligns.
+
+SUPPRESS-CONST suppresses the interpretation of constants in the
+formula, assuming that this has been done already outside the
+function.
+
+SUPPRESS-STORE means the formula should not be stored, either
+because it is already stored, or because it is a modified
+equation that should not overwrite the stored one.
+
+SUPPRESS-ANALYSIS prevents analyzing the table and checking
+location of point."
+ (interactive "P")
+ (unless suppress-analysis
+ (org-table-check-inside-data-field nil t)
+ (org-table-analyze))
+ (if (equal arg '(16))
+ (let ((eq (org-table-current-field-formula)))
+ (org-table-get-field nil eq)
+ (org-table-align)
+ (setq org-table-may-need-update t))
+ (let* (fields
+ (ndown (if (integerp arg) arg 1))
+ (org-table-automatic-realign nil)
+ (case-fold-search nil)
+ (down (> ndown 1))
+ (formula (if (and equation suppress-store)
+ equation
+ (org-table-get-formula equation (equal arg '(4)))))
+ (n0 (org-table-current-column))
+ (calc-modes (copy-sequence org-calc-default-modes))
+ (numbers nil) ; was a variable, now fixed default
+ (keep-empty nil)
+ form form0 formrpl formrg bw fmt ev orig lispp literal
+ duration duration-output-format)
+ ;; Parse the format string. Since we have a lot of modes, this is
+ ;; a lot of work. However, I think calc still uses most of the time.
+ (if (string-match "\\(.*\\);\\(.*\\)" formula)
+ (progn
+ (setq fmt (concat (cdr (assoc "%" org-table-local-parameters))
+ (match-string-no-properties 2 formula)))
+ (setq formula (match-string-no-properties 1 formula))
+ (while (string-match "\\([pnfse]\\)\\(-?[0-9]+\\)" fmt)
+ (let ((c (string-to-char (match-string 1 fmt)))
+ (n (string-to-number (match-string 2 fmt))))
+ (cl-case c
+ (?p (setf (cl-getf calc-modes 'calc-internal-prec) n))
+ (?n (setf (cl-getf calc-modes 'calc-float-format) (list 'float n)))
+ (?f (setf (cl-getf calc-modes 'calc-float-format) (list 'fix n)))
+ (?s (setf (cl-getf calc-modes 'calc-float-format) (list 'sci n)))
+ (?e (setf (cl-getf calc-modes 'calc-float-format) (list 'eng n)))))
+ ;; Remove matched flags from the mode string.
+ (setq fmt (replace-match "" t t fmt)))
+ (while (string-match "\\([tTUNLEDRFSu]\\)" fmt)
+ (let ((c (string-to-char (match-string 1 fmt))))
+ (cl-case c
+ (?t (setq duration t numbers t
+ duration-output-format org-table-duration-custom-format))
+ (?T (setq duration t numbers t duration-output-format nil))
+ (?U (setq duration t numbers t duration-output-format 'hh:mm))
+ (?N (setq numbers t))
+ (?L (setq literal t))
+ (?E (setq keep-empty t))
+ (?D (setf (cl-getf calc-modes 'calc-angle-mode) 'deg))
+ (?R (setf (cl-getf calc-modes 'calc-angle-mode) 'rad))
+ (?F (setf (cl-getf calc-modes 'calc-prefer-frac) t))
+ (?S (setf (cl-getf calc-modes 'calc-symbolic-mode) t))
+ (?u (setf (cl-getf calc-modes 'calc-simplify-mode) 'units))))
+ ;; Remove matched flags from the mode string.
+ (setq fmt (replace-match "" t t fmt)))
+ (unless (string-match "\\S-" fmt)
+ (setq fmt nil))))
+ (when (and (not suppress-const) org-table-formula-use-constants)
+ (setq formula (org-table-formula-substitute-names formula)))
+ (setq orig (or (get-text-property 1 :orig-formula formula) "?"))
+ (setq formula (org-table-formula-handle-first/last-rc formula))
+ (while (> ndown 0)
+ (setq fields (org-split-string
+ (org-trim
+ (buffer-substring-no-properties
+ (line-beginning-position) (line-end-position)))
+ " *| *"))
+ ;; replace fields with duration values if relevant
+ (if duration
+ (setq fields
+ (mapcar (lambda (x) (org-table-time-string-to-seconds x))
+ fields)))
+ (if (eq numbers t)
+ (setq fields (mapcar
+ (lambda (x)
+ (if (string-match "\\S-" x)
+ (number-to-string (string-to-number x))
+ x))
+ fields)))
+ (setq ndown (1- ndown))
+ (setq form (copy-sequence formula)
+ lispp (and (> (length form) 2) (equal (substring form 0 2) "'(")))
+ (if (and lispp literal) (setq lispp 'literal))
+
+ ;; Insert row and column number of formula result field
+ (while (string-match "[@$]#" form)
+ (setq form
+ (replace-match
+ (format "%d"
+ (save-match-data
+ (if (equal (substring form (match-beginning 0)
+ (1+ (match-beginning 0)))
+ "@")
+ (org-table-current-dline)
+ (org-table-current-column))))
+ t t form)))
+
+ ;; Check for old vertical references
+ (org-table--error-on-old-row-references form)
+ ;; Insert remote references
+ (setq form (org-table-remote-reference-indirection form))
+ (while (string-match "\\<remote([ \t]*\\([^,)]+\\)[ \t]*,[ \t]*\\([^\n)]+\\))" form)
+ (setq form
+ (replace-match
+ (save-match-data
+ (org-table-make-reference
+ (let ((rmtrng (org-table-get-remote-range
+ (match-string 1 form) (match-string 2 form))))
+ (if duration
+ (if (listp rmtrng)
+ (mapcar (lambda(x) (org-table-time-string-to-seconds x)) rmtrng)
+ (org-table-time-string-to-seconds rmtrng))
+ rmtrng))
+ keep-empty numbers lispp))
+ t t form)))
+ ;; Insert complex ranges
+ (while (and (string-match org-table-range-regexp form)
+ (> (length (match-string 0 form)) 1))
+ (setq formrg
+ (save-match-data
+ (org-table-get-range
+ (match-string 0 form) org-table-current-begin-pos n0)))
+ (setq formrpl
+ (save-match-data
+ (org-table-make-reference
+ ;; possibly handle durations
+ (if duration
+ (if (listp formrg)
+ (mapcar (lambda(x) (org-table-time-string-to-seconds x)) formrg)
+ (org-table-time-string-to-seconds formrg))
+ formrg)
+ keep-empty numbers lispp)))
+ (if (not (save-match-data
+ (string-match (regexp-quote form) formrpl)))
+ (setq form (replace-match formrpl t t form))
+ (user-error "Spreadsheet error: invalid reference \"%s\"" form)))
+ ;; Insert simple ranges, i.e. included in the current row.
+ (while (string-match
+ "\\$\\(\\([-+]\\)?[0-9]+\\)\\.\\.\\$\\(\\([-+]\\)?[0-9]+\\)"
+ form)
+ (setq form
+ (replace-match
+ (save-match-data
+ (org-table-make-reference
+ (cl-subseq fields
+ (+ (if (match-end 2) n0 0)
+ (string-to-number (match-string 1 form))
+ -1)
+ (+ (if (match-end 4) n0 0)
+ (string-to-number (match-string 3 form))))
+ keep-empty numbers lispp))
+ t t form)))
+ (setq form0 form)
+ ;; Insert the references to fields in same row
+ (while (string-match "\\$\\(\\([-+]\\)?[0-9]+\\)" form)
+ (let* ((n (+ (string-to-number (match-string 1 form))
+ (if (match-end 2) n0 0)))
+ (x (nth (1- (if (= n 0) n0 (max n 1))) fields)))
+ (setq formrpl (save-match-data
+ (org-table-make-reference
+ x keep-empty numbers lispp)))
+ (when (or (not x)
+ (save-match-data
+ (string-match (regexp-quote formula) formrpl)))
+ (user-error "Invalid field specifier \"%s\""
+ (match-string 0 form))))
+ (setq form (replace-match formrpl t t form)))
+
+ (if lispp
+ (setq ev (condition-case nil
+ (eval (eval (read form)))
+ (error "#ERROR"))
+ ev (if (numberp ev) (number-to-string ev) ev)
+ ev (if duration (org-table-time-seconds-to-string
+ (string-to-number ev)
+ duration-output-format)
+ ev))
+
+ ;; Use <...> time-stamps so that Calc can handle them.
+ (setq form
+ (replace-regexp-in-string org-ts-regexp-inactive "<\\1>" form))
+ ;; Internationalize local time-stamps by setting locale to
+ ;; "C".
+ (setq form
+ (replace-regexp-in-string
+ org-ts-regexp
+ (lambda (ts)
+ (let ((system-time-locale "C"))
+ (format-time-string
+ (org-time-stamp-format
+ (string-match-p "[0-9]\\{1,2\\}:[0-9]\\{2\\}" ts))
+ (apply #'encode-time
+ (save-match-data (org-parse-time-string ts))))))
+ form t t))
+
+ (setq ev (if (and duration (string-match "^[0-9]+:[0-9]+\\(?::[0-9]+\\)?$" form))
+ form
+ (calc-eval (cons form calc-modes)
+ (when (and (not keep-empty) numbers) 'num)))
+ ev (if duration (org-table-time-seconds-to-string
+ (if (string-match "^[0-9]+:[0-9]+\\(?::[0-9]+\\)?$" ev)
+ (string-to-number (org-table-time-string-to-seconds ev))
+ (string-to-number ev))
+ duration-output-format)
+ ev)))
+
+ (when org-table-formula-debug
+ (let ((wcf (current-window-configuration)))
+ (with-output-to-temp-buffer "*Substitution History*"
+ (princ (format "Substitution history of formula
+Orig: %s
+$xyz-> %s
+@r$c-> %s
+$1-> %s\n" orig formula form0 form))
+ (if (consp ev)
+ (princ (format " %s^\nError: %s"
+ (make-string (car ev) ?\-) (nth 1 ev)))
+ (princ (format "Result: %s\nFormat: %s\nFinal: %s"
+ ev (or fmt "NONE")
+ (if fmt (format fmt (string-to-number ev)) ev)))))
+ (setq bw (get-buffer-window "*Substitution History*"))
+ (org-fit-window-to-buffer bw)
+ (unless (and (called-interactively-p 'any) (not ndown))
+ (unless (let (inhibit-redisplay)
+ (y-or-n-p "Debugging Formula. Continue to next? "))
+ (org-table-align)
+ (user-error "Abort"))
+ (delete-window bw)
+ (message "")
+ (set-window-configuration wcf))))
+ (when (consp ev) (setq fmt nil ev "#ERROR"))
+ (org-table-justify-field-maybe
+ (format org-table-formula-field-format
+ (cond
+ ((not (stringp ev)) ev)
+ (fmt (format fmt (string-to-number ev)))
+ ;; Replace any active time stamp in the result with
+ ;; an inactive one. Dates in tables are likely
+ ;; piece of regular data, not meant to appear in the
+ ;; agenda.
+ (t (replace-regexp-in-string org-ts-regexp "[\\1]" ev)))))
+ (if (and down (> ndown 0) (looking-at ".*\n[ \t]*|[^-]"))
+ (call-interactively 'org-return)
+ (setq ndown 0)))
+ (and down (org-table-maybe-recalculate-line))
+ (or suppress-align (and org-table-may-need-update
+ (org-table-align))))))
+
+(defun org-table-put-field-property (prop value)
+ (save-excursion
+ (put-text-property (progn (skip-chars-backward "^|") (point))
+ (progn (skip-chars-forward "^|") (point))
+ prop value)))
+
+(defun org-table-get-range (desc &optional tbeg col highlight corners-only)
+ "Get a calc vector from a column, according to descriptor DESC.
+
+Optional arguments TBEG and COL can give the beginning of the table and
+the current column, to avoid unnecessary parsing.
+
+HIGHLIGHT means just highlight the range.
+
+When CORNERS-ONLY is set, only return the corners of the range as
+a list (line1 column1 line2 column2) where line1 and line2 are
+line numbers relative to beginning of table, or TBEG, and column1
+and column2 are table column numbers."
+ (let* ((desc (if (string-match-p "\\`\\$[0-9]+\\.\\.\\$[0-9]+\\'" desc)
+ (replace-regexp-in-string "\\$" "@0$" desc)
+ desc))
+ (col (or col (org-table-current-column)))
+ (tbeg (or tbeg (org-table-begin)))
+ (thisline (count-lines tbeg (line-beginning-position))))
+ (unless (string-match org-table-range-regexp desc)
+ (user-error "Invalid table range specifier `%s'" desc))
+ (let ((rangep (match-end 3))
+ (r1 (let ((r (and (match-end 1) (match-string 1 desc))))
+ (or (save-match-data
+ (and (org-string-nw-p r)
+ (org-table--descriptor-line r thisline)))
+ thisline)))
+ (r2 (let ((r (and (match-end 4) (match-string 4 desc))))
+ (or (save-match-data
+ (and (org-string-nw-p r)
+ (org-table--descriptor-line r thisline)))
+ thisline)))
+ (c1 (let ((c (and (match-end 2) (substring (match-string 2 desc) 1))))
+ (if (or (not c) (= (string-to-number c) 0)) col
+ (+ (string-to-number c)
+ (if (memq (string-to-char c) '(?- ?+)) col 0)))))
+ (c2 (let ((c (and (match-end 5) (substring (match-string 5 desc) 1))))
+ (if (or (not c) (= (string-to-number c) 0)) col
+ (+ (string-to-number c)
+ (if (memq (string-to-char c) '(?- ?+)) col 0))))))
+ (save-excursion
+ (if (and (not corners-only)
+ (or (not rangep) (and (= r1 r2) (= c1 c2))))
+ ;; Just one field.
+ (progn
+ (forward-line (- r1 thisline))
+ (while (not (looking-at org-table-dataline-regexp))
+ (forward-line))
+ (prog1 (org-trim (org-table-get-field c1))
+ (when highlight (org-table-highlight-rectangle))))
+ ;; A range, return a vector. First sort the numbers to get
+ ;; a regular rectangle.
+ (let ((first-row (min r1 r2))
+ (last-row (max r1 r2))
+ (first-column (min c1 c2))
+ (last-column (max c1 c2)))
+ (if corners-only (list first-row first-column last-row last-column)
+ ;; Copy the range values into a list.
+ (forward-line (- first-row thisline))
+ (while (not (looking-at org-table-dataline-regexp))
+ (forward-line)
+ (cl-incf first-row))
+ (org-table-goto-column first-column)
+ (let ((beg (point)))
+ (forward-line (- last-row first-row))
+ (while (not (looking-at org-table-dataline-regexp))
+ (forward-line -1))
+ (org-table-goto-column last-column)
+ (let ((end (point)))
+ (when highlight
+ (org-table-highlight-rectangle
+ beg (progn (skip-chars-forward "^|\n") (point))))
+ ;; Return string representation of calc vector.
+ (mapcar #'org-trim
+ (apply #'append
+ (org-table-copy-region beg end))))))))))))
+
+(defun org-table--descriptor-line (desc cline)
+ "Return relative line number corresponding to descriptor DESC.
+The cursor is currently in relative line number CLINE."
+ (if (string-match "\\`[0-9]+\\'" desc)
+ (aref org-table-dlines (string-to-number desc))
+ (when (or (not (string-match
+ "^\\(\\([-+]\\)?\\(I+\\)\\)?\\(\\([-+]\\)?\\([0-9]+\\)\\)?"
+ ;; 1 2 3 4 5 6
+ desc))
+ (and (not (match-end 3)) (not (match-end 6)))
+ (and (match-end 3) (match-end 6) (not (match-end 5))))
+ (user-error "Invalid row descriptor `%s'" desc))
+ (let* ((hn (and (match-end 3) (- (match-end 3) (match-beginning 3))))
+ (hdir (match-string 2 desc))
+ (odir (match-string 5 desc))
+ (on (and (match-end 6) (string-to-number (match-string 6 desc))))
+ (rel (and (match-end 6)
+ (or (and (match-end 1) (not (match-end 3)))
+ (match-end 5)))))
+ (when (and hn (not hdir))
+ (setq cline 0)
+ (setq hdir "+")
+ (when (eq (aref org-table-current-line-types 0) 'hline) (cl-decf hn)))
+ (when (and (not hn) on (not odir)) (user-error "Should never happen"))
+ (when hn
+ (setq cline
+ (org-table--row-type 'hline hn cline (equal hdir "-") nil desc)))
+ (when on
+ (setq cline
+ (org-table--row-type 'dline on cline (equal odir "-") rel desc)))
+ cline)))
+
+(defun org-table--row-type (type n i backwards relative desc)
+ "Return relative line of Nth row with type TYPE.
+Search starts from relative line I. When BACKWARDS in non-nil,
+look before I. When RELATIVE is non-nil, the reference is
+relative. DESC is the original descriptor that started the
+search, as a string."
+ (let ((l (length org-table-current-line-types)))
+ (catch :exit
+ (dotimes (_ n)
+ (while (and (cl-incf i (if backwards -1 1))
+ (>= i 0)
+ (< i l)
+ (not (eq (aref org-table-current-line-types i) type))
+ ;; We are going to cross a hline. Check if this is
+ ;; an authorized move.
+ (cond
+ ((not relative))
+ ((not (eq (aref org-table-current-line-types i) 'hline)))
+ ((eq org-table-relative-ref-may-cross-hline t))
+ ((eq org-table-relative-ref-may-cross-hline 'error)
+ (user-error "Row descriptor %s crosses hline" desc))
+ (t (cl-decf i (if backwards -1 1)) ; Step back.
+ (throw :exit nil)))))))
+ (cond ((or (< i 0) (>= i l))
+ (user-error "Row descriptor %s leads outside table" desc))
+ ;; The last hline doesn't exist. Instead, point to last row
+ ;; in table.
+ ((= i (1- l)) (1- i))
+ (t i))))
+
+(defun org-table--error-on-old-row-references (s)
+ (when (string-match "&[-+0-9I]" s)
+ (user-error "Formula contains old &row reference, please rewrite using @-syntax")))
+
+(defun org-table-make-reference (elements keep-empty numbers lispp)
+ "Convert list ELEMENTS to something appropriate to insert into formula.
+KEEP-EMPTY indicated to keep empty fields, default is to skip them.
+NUMBERS indicates that everything should be converted to numbers.
+LISPP non-nil means to return something appropriate for a Lisp
+list, `literal' is for the format specifier L."
+ ;; Calc nan (not a number) is used for the conversion of the empty
+ ;; field to a reference for several reasons: (i) It is accepted in a
+ ;; Calc formula (e. g. "" or "()" would result in a Calc error).
+ ;; (ii) In a single field (not in range) it can be distinguished
+ ;; from "(nan)" which is the reference made from a single field
+ ;; containing "nan".
+ (if (stringp elements)
+ ;; field reference
+ (if lispp
+ (if (eq lispp 'literal)
+ elements
+ (if (and (eq elements "") (not keep-empty))
+ ""
+ (prin1-to-string
+ (if numbers (string-to-number elements) elements))))
+ (if (string-match "\\S-" elements)
+ (progn
+ (when numbers (setq elements (number-to-string
+ (string-to-number elements))))
+ (concat "(" elements ")"))
+ (if (or (not keep-empty) numbers) "(0)" "nan")))
+ ;; range reference
+ (unless keep-empty
+ (setq elements
+ (delq nil
+ (mapcar (lambda (x) (if (string-match "\\S-" x) x nil))
+ elements))))
+ (setq elements (or elements '())) ; if delq returns nil then we need '()
+ (if lispp
+ (mapconcat
+ (lambda (x)
+ (if (eq lispp 'literal)
+ x
+ (prin1-to-string (if numbers (string-to-number x) x))))
+ elements " ")
+ (concat "[" (mapconcat
+ (lambda (x)
+ (if (string-match "\\S-" x)
+ (if numbers
+ (number-to-string (string-to-number x))
+ x)
+ (if (or (not keep-empty) numbers) "0" "nan")))
+ elements
+ ",") "]"))))
+
+(defun org-table-message-once-per-second (t1 &rest args)
+ "If there has been more than one second since T1, display message.
+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) (org-time-less-p 1 (org-time-subtract curtime t1)))
+ (progn (apply 'message args)
+ curtime)
+ t1)))
+
+;;;###autoload
+(defun org-table-recalculate (&optional all noalign)
+ "Recalculate the current table line by applying all stored formulas.
+
+With prefix arg ALL, do this for all lines in the table.
+
+When called with a `\\[universal-argument] \\[universal-argument]' prefix, or \
+if ALL is the symbol `iterate',
+recompute the table until it no longer changes.
+
+If NOALIGN is not nil, do not re-align the table after the computations
+are done. This is typically used internally to save time, if it is
+known that the table will be realigned a little later anyway."
+ (interactive "P")
+ (unless (memq this-command org-recalc-commands)
+ (push this-command org-recalc-commands))
+ (unless (org-at-table-p) (user-error "Not at a table"))
+ (if (or (eq all 'iterate) (equal all '(16)))
+ (org-table-iterate)
+ (org-table-analyze)
+ (let* ((eqlist (sort (org-table-get-stored-formulas)
+ (lambda (a b) (string< (car a) (car b)))))
+ (inhibit-redisplay (not debug-on-error))
+ (line-re org-table-dataline-regexp)
+ (log-first-time (current-time))
+ (log-last-time log-first-time)
+ (cnt 0)
+ beg end eqlcol eqlfield)
+ ;; Insert constants in all formulas.
+ (when eqlist
+ (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? "))
+ (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
+ (org-table-message-once-per-second
+ log-first-time "Re-applying formulas to %d lines... done" cnt)))
+ (org-table-message-once-per-second
+ (and all log-first-time) "Re-applying formulas... done")))))
+
+;;;###autoload
+(defun org-table-iterate (&optional arg)
+ "Recalculate the table until it does not change anymore.
+The maximum number of iterations is 10, but you can choose a different value
+with the prefix ARG."
+ (interactive "P")
+ (let ((imax (if arg (prefix-numeric-value arg) 10))
+ (i 0)
+ (lasttbl (buffer-substring (org-table-begin) (org-table-end)))
+ thistbl)
+ (catch 'exit
+ (while (< i imax)
+ (setq i (1+ i))
+ (org-table-recalculate 'all)
+ (setq thistbl (buffer-substring (org-table-begin) (org-table-end)))
+ (if (not (string= lasttbl thistbl))
+ (setq lasttbl thistbl)
+ (if (> i 1)
+ (message "Convergence after %d iterations" i)
+ (message "Table was already stable"))
+ (throw 'exit t)))
+ (user-error "No convergence after %d iterations" i))))
+
+;;;###autoload
+(defun org-table-recalculate-buffer-tables ()
+ "Recalculate all tables in the current buffer."
+ (interactive)
+ (org-with-wide-buffer
+ (org-table-map-tables
+ (lambda ()
+ ;; Reason for separate `org-table-align': When repeating
+ ;; (org-table-recalculate t) `org-table-may-need-update' gets in
+ ;; the way.
+ (org-table-recalculate t t)
+ (org-table-align))
+ t)))
+
+;;;###autoload
+(defun org-table-iterate-buffer-tables ()
+ "Iterate all tables in the buffer, to converge inter-table dependencies."
+ (interactive)
+ (let* ((imax 10)
+ (i imax)
+ (checksum (md5 (buffer-string)))
+ c1)
+ (org-with-wide-buffer
+ (catch 'exit
+ (while (> i 0)
+ (setq i (1- i))
+ (org-table-map-tables (lambda () (org-table-recalculate t t)) t)
+ (if (equal checksum (setq c1 (md5 (buffer-string))))
+ (progn
+ (org-table-map-tables #'org-table-align t)
+ (message "Convergence after %d iterations" (- imax i))
+ (throw 'exit t))
+ (setq checksum c1)))
+ (org-table-map-tables #'org-table-align t)
+ (user-error "No convergence after %d iterations" imax)))))
+
+(defun org-table-calc-current-TBLFM (&optional arg)
+ "Apply the #+TBLFM in the line at point to the table."
+ (interactive "P")
+ (unless (org-at-TBLFM-p) (user-error "Not at a #+TBLFM line"))
+ (let ((formula (buffer-substring
+ (line-beginning-position)
+ (line-end-position))))
+ (save-excursion
+ ;; Insert a temporary formula at right after the table
+ (goto-char (org-table-TBLFM-begin))
+ (let ((s (point-marker)))
+ (insert formula "\n")
+ (let ((e (point-marker)))
+ ;; Recalculate the table.
+ (beginning-of-line 0) ; move to the inserted line
+ (skip-chars-backward " \r\n\t")
+ (unwind-protect
+ (org-call-with-arg #'org-table-recalculate (or arg t))
+ ;; Delete the formula inserted temporarily.
+ (delete-region s e)
+ (set-marker s nil)
+ (set-marker e nil)))))))
+
+(defun org-table-TBLFM-begin ()
+ "Find the beginning of the TBLFM lines and return its position.
+Return nil when the beginning of TBLFM line was not found."
+ (save-excursion
+ (when (progn (forward-line 1)
+ (re-search-backward org-table-TBLFM-begin-regexp nil t))
+ (line-beginning-position 2))))
+
+(defun org-table-expand-lhs-ranges (equations)
+ "Expand list of formulas.
+If some of the RHS in the formulas are ranges or a row reference,
+expand them to individual field equations for each field. This
+function assumes the table is already analyzed (i.e., using
+`org-table-analyze')."
+ (let (res)
+ (dolist (e equations (nreverse res))
+ (let ((lhs (car e))
+ (rhs (cdr e)))
+ (cond
+ ((string-match-p "\\`@[-+0-9]+\\$-?[0-9]+\\'" lhs)
+ ;; This just refers to one fixed field.
+ (push e res))
+ ((string-match-p "\\`[a-zA-Z][_a-zA-Z0-9]*\\'" lhs)
+ ;; This just refers to one fixed named field.
+ (push e res))
+ ((string-match-p "\\`\\$[0-9]+\\'" lhs)
+ ;; Column formulas are treated specially and are not
+ ;; expanded.
+ (push e res))
+ ((string-match "\\`@[0-9]+\\'" lhs)
+ (dotimes (ic org-table-current-ncol)
+ (push (cons (propertize (format "%s$%d" lhs (1+ ic)) :orig-eqn e)
+ rhs)
+ res)))
+ (t
+ (let* ((range (org-table-get-range
+ lhs org-table-current-begin-pos 1 nil 'corners))
+ (r1 (org-table-line-to-dline (nth 0 range)))
+ (c1 (nth 1 range))
+ (r2 (org-table-line-to-dline (nth 2 range) 'above))
+ (c2 (nth 3 range)))
+ (cl-loop for ir from r1 to r2 do
+ (cl-loop for ic from c1 to c2 do
+ (push (cons (propertize
+ (format "@%d$%d" ir ic) :orig-eqn e)
+ rhs)
+ res))))))))))
+
+(defun org-table-formula-handle-first/last-rc (s)
+ "Replace @<, @>, $<, $> with first/last row/column of the table.
+So @< and $< will always be replaced with @1 and $1, respectively.
+The advantage of these special markers are that structure editing of
+the table will not change them, while @1 and $1 will be modified
+when a line/row is swapped out of that privileged position. So for
+formulas that use a range of rows or columns, it may often be better
+to anchor the formula with \"I\" row markers, or to offset from the
+borders of the table using the @< @> $< $> makers."
+ (let (n nmax len char (start 0))
+ (while (string-match "\\([@$]\\)\\(<+\\|>+\\)\\|\\(remote([^)]+)\\)"
+ s start)
+ (if (match-end 3)
+ (setq start (match-end 3))
+ (setq nmax (if (equal (match-string 1 s) "@")
+ (1- (length org-table-dlines))
+ org-table-current-ncol)
+ len (- (match-end 2) (match-beginning 2))
+ char (string-to-char (match-string 2 s))
+ n (if (= char ?<)
+ len
+ (- nmax len -1)))
+ (if (or (< n 1) (> n nmax))
+ (user-error "Reference \"%s\" in expression \"%s\" points outside table"
+ (match-string 0 s) s))
+ (setq start (match-beginning 0))
+ (setq s (replace-match (format "%s%d" (match-string 1 s) n) t t s)))))
+ s)
+
+(defun org-table-formula-substitute-names (f)
+ "Replace $const with values in string F."
+ (let ((start 0)
+ (pp (/= (string-to-char f) ?'))
+ (duration (string-match-p ";.*[Tt].*\\'" f))
+ (new (replace-regexp-in-string ; Check for column names.
+ org-table-column-name-regexp
+ (lambda (m)
+ (concat "$" (cdr (assoc (match-string 1 m)
+ org-table-column-names))))
+ f t t)))
+ ;; Parameters and constants.
+ (while (setq start
+ (string-match
+ "\\$\\([a-zA-Z][_a-zA-Z0-9]*\\)\\|\\(\\<remote([^)]*)\\)"
+ new start))
+ (if (match-end 2) (setq start (match-end 2))
+ (cl-incf start)
+ ;; When a duration is expected, convert value on the fly.
+ (let ((value
+ (save-match-data
+ (let ((v (org-table-get-constant (match-string 1 new))))
+ (if (and (org-string-nw-p v) duration)
+ (org-table-time-string-to-seconds v)
+ v)))))
+ (when value
+ (setq new (replace-match
+ (concat (and pp "(") value (and pp ")")) t t new))))))
+ (if org-table-formula-debug (propertize new :orig-formula f) new)))
+
+(defun org-table-get-constant (const)
+ "Find the value for a parameter or constant in a formula.
+Parameters get priority."
+ (or (cdr (assoc const org-table-local-parameters))
+ (cdr (assoc const org-table-formula-constants-local))
+ (cdr (assoc const org-table-formula-constants))
+ (and (fboundp 'constants-get) (constants-get const))
+ (and (string= (substring const 0 (min 5 (length const))) "PROP_")
+ (org-entry-get nil (substring const 5) 'inherit))
+ "#UNDEFINED_NAME"))
+
+(defvar org-table-fedit-map
+ (let ((map (make-sparse-keymap)))
+ (org-defkey map "\C-x\C-s" 'org-table-fedit-finish)
+ (org-defkey map "\C-c\C-s" 'org-table-fedit-finish)
+ (org-defkey map "\C-c\C-c" 'org-table-fedit-finish)
+ (org-defkey map "\C-c'" 'org-table-fedit-finish)
+ (org-defkey map "\C-c\C-q" 'org-table-fedit-abort)
+ (org-defkey map "\C-c?" 'org-table-show-reference)
+ (org-defkey map [(meta shift up)] 'org-table-fedit-line-up)
+ (org-defkey map [(meta shift down)] 'org-table-fedit-line-down)
+ (org-defkey map [(shift up)] 'org-table-fedit-ref-up)
+ (org-defkey map [(shift down)] 'org-table-fedit-ref-down)
+ (org-defkey map [(shift left)] 'org-table-fedit-ref-left)
+ (org-defkey map [(shift right)] 'org-table-fedit-ref-right)
+ (org-defkey map [(meta up)] 'org-table-fedit-scroll-down)
+ (org-defkey map [(meta down)] 'org-table-fedit-scroll)
+ (org-defkey map [(meta tab)] 'lisp-complete-symbol)
+ (org-defkey map "\M-\C-i" 'lisp-complete-symbol)
+ (org-defkey map [(tab)] 'org-table-fedit-lisp-indent)
+ (org-defkey map "\C-i" 'org-table-fedit-lisp-indent)
+ (org-defkey map "\C-c\C-r" 'org-table-fedit-toggle-ref-type)
+ (org-defkey map "\C-c}" 'org-table-fedit-toggle-coordinates)
+ map))
+
+(easy-menu-define org-table-fedit-menu org-table-fedit-map "Org Edit Formulas Menu."
+ '("Edit-Formulas"
+ ["Finish and Install" org-table-fedit-finish t]
+ ["Finish, Install, and Apply" (org-table-fedit-finish t) :keys "C-u C-c C-c"]
+ ["Abort" org-table-fedit-abort t]
+ "--"
+ ["Pretty-Print Lisp Formula" org-table-fedit-lisp-indent t]
+ ["Complete Lisp Symbol" lisp-complete-symbol t]
+ "--"
+ "Shift Reference at Point"
+ ["Up" org-table-fedit-ref-up t]
+ ["Down" org-table-fedit-ref-down t]
+ ["Left" org-table-fedit-ref-left t]
+ ["Right" org-table-fedit-ref-right t]
+ "-"
+ "Change Test Row for Column Formulas"
+ ["Up" org-table-fedit-line-up t]
+ ["Down" org-table-fedit-line-down t]
+ "--"
+ ["Scroll Table Window" org-table-fedit-scroll t]
+ ["Scroll Table Window down" org-table-fedit-scroll-down t]
+ ["Show Table Grid" org-table-fedit-toggle-coordinates
+ :style toggle :selected (with-current-buffer (marker-buffer org-pos)
+ org-table-overlay-coordinates)]
+ "--"
+ ["Standard Refs (B3 instead of @3$2)" org-table-fedit-toggle-ref-type
+ :style toggle :selected org-table-buffer-is-an]))
+
+(defvar org-table--fedit-source nil
+ "Position of the TBLFM line being edited.")
+
+;;;###autoload
+(defun org-table-edit-formulas ()
+ "Edit the formulas of the current table in a separate buffer."
+ (interactive)
+ (let ((at-tblfm (org-at-TBLFM-p)))
+ (unless (or at-tblfm (org-at-table-p))
+ (user-error "Not at a table"))
+ (save-excursion
+ ;; Move point within the table before analyzing it.
+ (when at-tblfm (re-search-backward "^[ \t]*|"))
+ (org-table-analyze))
+ (let ((key (org-table-current-field-formula 'key 'noerror))
+ (eql (sort (org-table-get-stored-formulas t (and at-tblfm (point)))
+ #'org-table-formula-less-p))
+ (pos (point-marker))
+ (source (copy-marker (line-beginning-position)))
+ (startline 1)
+ (wc (current-window-configuration))
+ (sel-win (selected-window))
+ (titles '((column . "# Column Formulas\n")
+ (field . "# Field and Range Formulas\n")
+ (named . "# Named Field Formulas\n"))))
+ (org-switch-to-buffer-other-window "*Edit Formulas*")
+ (erase-buffer)
+ ;; Keep global-font-lock-mode from turning on font-lock-mode
+ (let ((font-lock-global-modes '(not fundamental-mode)))
+ (fundamental-mode))
+ (setq-local font-lock-global-modes (list 'not major-mode))
+ (setq-local org-pos pos)
+ (setq-local org-table--fedit-source source)
+ (setq-local org-window-configuration wc)
+ (setq-local org-selected-window sel-win)
+ (use-local-map org-table-fedit-map)
+ (add-hook 'post-command-hook #'org-table-fedit-post-command t t)
+ (setq startline (org-current-line))
+ (dolist (entry eql)
+ (let* ((type (cond
+ ((string-match "\\`\\$\\([0-9]+\\|[<>]+\\)\\'"
+ (car entry))
+ 'column)
+ ((equal (string-to-char (car entry)) ?@) 'field)
+ (t 'named)))
+ (title (assq type titles)))
+ (when title
+ (unless (bobp) (insert "\n"))
+ (insert
+ (org-add-props (cdr title) nil 'face font-lock-comment-face))
+ (setq titles (remove title titles)))
+ (when (equal key (car entry)) (setq startline (org-current-line)))
+ (let ((s (concat
+ (if (memq (string-to-char (car entry)) '(?@ ?$)) "" "$")
+ (car entry) " = " (cdr entry) "\n")))
+ (remove-text-properties 0 (length s) '(face nil) s)
+ (insert s))))
+ (when (eq org-table-use-standard-references t)
+ (org-table-fedit-toggle-ref-type))
+ (org-goto-line startline)
+ (message "%s" (substitute-command-keys "\\<org-mode-map>\
+Edit formulas, finish with `\\[org-ctrl-c-ctrl-c]' or `\\[org-edit-special]'. \
+See menu for more commands.")))))
+
+(defun org-table-fedit-post-command ()
+ (when (not (memq this-command '(lisp-complete-symbol)))
+ (let ((win (selected-window)))
+ (save-excursion
+ (ignore-errors (org-table-show-reference))
+ (select-window win)))))
+
+(defun org-table-formula-to-user (s)
+ "Convert a formula from internal to user representation."
+ (if (eq org-table-use-standard-references t)
+ (org-table-convert-refs-to-an s)
+ s))
+
+(defun org-table-formula-from-user (s)
+ "Convert a formula from user to internal representation."
+ (if org-table-use-standard-references
+ (org-table-convert-refs-to-rc s)
+ s))
+
+(defun org-table-convert-refs-to-rc (s)
+ "Convert spreadsheet references from A7 to @7$28.
+Works for single references, but also for entire formulas and even the
+full TBLFM line."
+ (let ((start 0))
+ (while (string-match "\\<\\([a-zA-Z]+\\)\\([0-9]+\\>\\|&\\)\\|\\(;[^\r\n:]+\\|\\<remote([^,)]*)\\)" s start)
+ (cond
+ ((match-end 3)
+ ;; format match, just advance
+ (setq start (match-end 0)))
+ ((and (> (match-beginning 0) 0)
+ (equal ?. (aref s (max (1- (match-beginning 0)) 0)))
+ (not (equal ?. (aref s (max (- (match-beginning 0) 2) 0)))))
+ ;; 3.e5 or something like this.
+ (setq start (match-end 0)))
+ ((or (> (- (match-end 1) (match-beginning 1)) 2)
+ ;; (member (match-string 1 s)
+ ;; '("arctan" "exp" "expm" "lnp" "log" "stir"))
+ )
+ ;; function name, just advance
+ (setq start (match-end 0)))
+ (t
+ (setq start (match-beginning 0)
+ s (replace-match
+ (if (equal (match-string 2 s) "&")
+ (format "$%d" (org-letters-to-number (match-string 1 s)))
+ (format "@%d$%d"
+ (string-to-number (match-string 2 s))
+ (org-letters-to-number (match-string 1 s))))
+ t t s)))))
+ s))
+
+(defun org-table-convert-refs-to-an (s)
+ "Convert spreadsheet references from to @7$28 to AB7.
+Works for single references, but also for entire formulas and even the
+full TBLFM line."
+ (while (string-match "@\\([0-9]+\\)\\$\\([0-9]+\\)" s)
+ (setq s (replace-match
+ (format "%s%d"
+ (org-number-to-letters
+ (string-to-number (match-string 2 s)))
+ (string-to-number (match-string 1 s)))
+ t t s)))
+ (while (string-match "\\(^\\|[^0-9a-zA-Z]\\)\\$\\([0-9]+\\)" s)
+ (setq s (replace-match (concat "\\1"
+ (org-number-to-letters
+ (string-to-number (match-string 2 s))) "&")
+ t nil s)))
+ s)
+
+(defun org-letters-to-number (s)
+ "Convert a base 26 number represented by letters into an integer.
+For example: AB -> 28."
+ (let ((n 0))
+ (setq s (upcase s))
+ (while (> (length s) 0)
+ (setq n (+ (* n 26) (string-to-char s) (- ?A) 1)
+ s (substring s 1)))
+ n))
+
+(defun org-number-to-letters (n)
+ "Convert an integer into a base 26 number represented by letters.
+For example: 28 -> AB."
+ (let ((s ""))
+ (while (> n 0)
+ (setq s (concat (char-to-string (+ (mod (1- n) 26) ?A)) s)
+ n (/ (1- n) 26)))
+ s))
+
+(defun org-table-time-string-to-seconds (s)
+ "Convert a time string into numerical duration in seconds.
+S can be a string matching either -?HH:MM:SS or -?HH:MM.
+If S is a string representing a number, keep this number."
+ (if (equal s "")
+ s
+ (let (hour minus min sec res)
+ (cond
+ ((and (string-match "\\(-?\\)\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\)" s))
+ (setq minus (< 0 (length (match-string 1 s)))
+ hour (string-to-number (match-string 2 s))
+ min (string-to-number (match-string 3 s))
+ sec (string-to-number (match-string 4 s)))
+ (if minus
+ (setq res (- (+ (* hour 3600) (* min 60) sec)))
+ (setq res (+ (* hour 3600) (* min 60) sec))))
+ ((and (not (string-match org-ts-regexp-both s))
+ (string-match "\\(-?\\)\\([0-9]+\\):\\([0-9]+\\)" s))
+ (setq minus (< 0 (length (match-string 1 s)))
+ hour (string-to-number (match-string 2 s))
+ min (string-to-number (match-string 3 s)))
+ (if minus
+ (setq res (- (+ (* hour 3600) (* min 60))))
+ (setq res (+ (* hour 3600) (* min 60)))))
+ (t (setq res (string-to-number s))))
+ (number-to-string res))))
+
+(defun org-table-time-seconds-to-string (secs &optional output-format)
+ "Convert a number of seconds to a time string.
+If OUTPUT-FORMAT is non-nil, return a number of days, hours,
+minutes or seconds."
+ (let* ((secs0 (abs secs))
+ (res
+ (cond ((eq output-format 'days)
+ (format "%.3f" (/ (float secs0) 86400)))
+ ((eq output-format 'hours)
+ (format "%.2f" (/ (float secs0) 3600)))
+ ((eq output-format 'minutes)
+ (format "%.1f" (/ (float secs0) 60)))
+ ((eq output-format 'seconds)
+ (format "%d" secs0))
+ ((eq output-format 'hh:mm)
+ ;; Ignore seconds
+ (substring (format-seconds
+ (if org-table-duration-hour-zero-padding
+ "%.2h:%.2m:%.2s" "%h:%.2m:%.2s")
+ secs0)
+ 0 -3))
+ (t (format-seconds
+ (if org-table-duration-hour-zero-padding
+ "%.2h:%.2m:%.2s" "%h:%.2m:%.2s")
+ secs0)))))
+ (if (< secs 0) (concat "-" res) res)))
+
+(defun org-table-fedit-convert-buffer (function)
+ "Convert all references in this buffer, using FUNCTION."
+ (let ((origin (copy-marker (line-beginning-position))))
+ (goto-char (point-min))
+ (while (not (eobp))
+ (insert (funcall function (buffer-substring (point) (line-end-position))))
+ (delete-region (point) (line-end-position))
+ (forward-line))
+ (goto-char origin)
+ (set-marker origin nil)))
+
+(defun org-table-fedit-toggle-ref-type ()
+ "Convert all references in the buffer from B3 to @3$2 and back."
+ (interactive)
+ (setq-local org-table-buffer-is-an (not org-table-buffer-is-an))
+ (org-table-fedit-convert-buffer
+ (if org-table-buffer-is-an
+ 'org-table-convert-refs-to-an 'org-table-convert-refs-to-rc))
+ (message "Reference type switched to %s"
+ (if org-table-buffer-is-an "A1 etc" "@row$column")))
+
+(defun org-table-fedit-ref-up ()
+ "Shift the reference at point one row/hline up."
+ (interactive)
+ (org-table-fedit-shift-reference 'up))
+
+(defun org-table-fedit-ref-down ()
+ "Shift the reference at point one row/hline down."
+ (interactive)
+ (org-table-fedit-shift-reference 'down))
+
+(defun org-table-fedit-ref-left ()
+ "Shift the reference at point one field to the left."
+ (interactive)
+ (org-table-fedit-shift-reference 'left))
+
+(defun org-table-fedit-ref-right ()
+ "Shift the reference at point one field to the right."
+ (interactive)
+ (org-table-fedit-shift-reference 'right))
+
+(defun org-table--rematch-and-replace (n &optional decr hline)
+ "Re-match the group N, and replace it with the shifted reference."
+ (or (match-end n) (user-error "Cannot shift reference in this direction"))
+ (goto-char (match-beginning n))
+ (and (looking-at (regexp-quote (match-string n)))
+ (replace-match (org-table-shift-refpart (match-string 0) decr hline)
+ t t)))
+
+(defun org-table-fedit-shift-reference (dir)
+ (cond
+ ((org-in-regexp "\\(\\<[a-zA-Z]\\)&")
+ (if (memq dir '(left right))
+ (org-table--rematch-and-replace 1 (eq dir 'left))
+ (user-error "Cannot shift reference in this direction")))
+ ((org-in-regexp "\\(\\<[a-zA-Z]\\{1,2\\}\\)\\([0-9]+\\)")
+ ;; A B3-like reference
+ (if (memq dir '(up down))
+ (org-table--rematch-and-replace 2 (eq dir 'up))
+ (org-table--rematch-and-replace 1 (eq dir 'left))))
+ ((org-in-regexp
+ "\\(@\\|\\.\\.\\)\\([-+]?\\(I+\\>\\|[0-9]+\\)\\)\\(\\$\\([-+]?[0-9]+\\)\\)?")
+ ;; An internal reference
+ (if (memq dir '(up down))
+ (org-table--rematch-and-replace 2 (eq dir 'up) (match-end 3))
+ (org-table--rematch-and-replace 5 (eq dir 'left))))))
+
+(defun org-table-shift-refpart (ref &optional decr hline)
+ "Shift a reference part REF.
+If DECR is set, decrease the references row/column, else increase.
+If HLINE is set, this may be a hline reference, it certainly is not
+a translation reference."
+ (save-match-data
+ (let* ((sign (string-match "^[-+]" ref)) n)
+
+ (if sign (setq sign (substring ref 0 1) ref (substring ref 1)))
+ (cond
+ ((and hline (string-match "^I+" ref))
+ (setq n (string-to-number (concat sign (number-to-string (length ref)))))
+ (setq n (+ n (if decr -1 1)))
+ (if (= n 0) (setq n (+ n (if decr -1 1))))
+ (if sign
+ (setq sign (if (< n 0) "-" "+") n (abs n))
+ (setq n (max 1 n)))
+ (concat sign (make-string n ?I)))
+
+ ((string-match "^[0-9]+" ref)
+ (setq n (string-to-number (concat sign ref)))
+ (setq n (+ n (if decr -1 1)))
+ (if sign
+ (concat (if (< n 0) "-" "+") (number-to-string (abs n)))
+ (number-to-string (max 1 n))))
+
+ ((string-match "^[a-zA-Z]+" ref)
+ (org-number-to-letters
+ (max 1 (+ (org-letters-to-number ref) (if decr -1 1)))))
+
+ (t (user-error "Cannot shift reference"))))))
+
+(defun org-table-fedit-toggle-coordinates ()
+ "Toggle the display of coordinates in the referenced table."
+ (interactive)
+ (let ((pos (marker-position org-pos)))
+ (with-current-buffer (marker-buffer org-pos)
+ (save-excursion
+ (goto-char pos)
+ (org-table-toggle-coordinate-overlays)))))
+
+(defun org-table-fedit-finish (&optional arg)
+ "Parse the buffer for formula definitions and install them.
+With prefix ARG, apply the new formulas to the table."
+ (interactive "P")
+ (org-table-remove-rectangle-highlight)
+ (when org-table-use-standard-references
+ (org-table-fedit-convert-buffer 'org-table-convert-refs-to-rc)
+ (setq org-table-buffer-is-an nil))
+ (let ((pos org-pos)
+ (sel-win org-selected-window)
+ (source org-table--fedit-source)
+ eql)
+ (goto-char (point-min))
+ (while (re-search-forward
+ "^\\(@[-+I<>0-9.$@]+\\|@?[0-9]+\\|\\$\\([a-zA-Z0-9]+\\|[<>]+\\)\\) *= *\\(.*\\(\n[ \t]+.*$\\)*\\)"
+ nil t)
+ (let ((var (match-string 1))
+ (form (org-trim (match-string 3))))
+ (unless (equal form "")
+ (while (string-match "[ \t]*\n[ \t]*" form)
+ (setq form (replace-match " " t t form)))
+ (when (assoc var eql)
+ (user-error "Double formulas for %s" var))
+ (push (cons var form) eql))))
+ (set-window-configuration org-window-configuration)
+ (select-window sel-win)
+ (goto-char source)
+ (org-table-store-formulas eql)
+ (set-marker pos nil)
+ (set-marker source nil)
+ (kill-buffer "*Edit Formulas*")
+ (if arg
+ (org-table-recalculate 'all)
+ (message "New formulas installed - press C-u C-c C-c to apply."))))
+
+(defun org-table-fedit-abort ()
+ "Abort editing formulas, without installing the changes."
+ (interactive)
+ (org-table-remove-rectangle-highlight)
+ (let ((pos org-pos) (sel-win org-selected-window))
+ (set-window-configuration org-window-configuration)
+ (select-window sel-win)
+ (goto-char pos)
+ (move-marker pos nil)
+ (message "Formula editing aborted without installing changes")))
+
+(defun org-table-fedit-lisp-indent ()
+ "Pretty-print and re-indent Lisp expressions in the Formula Editor."
+ (interactive)
+ (let ((pos (point)) beg end ind)
+ (beginning-of-line 1)
+ (cond
+ ((looking-at "[ \t]")
+ (goto-char pos)
+ (call-interactively 'lisp-indent-line))
+ ((looking-at "[$&@0-9a-zA-Z]+ *= *[^ \t\n']") (goto-char pos))
+ ((not (fboundp 'pp-buffer))
+ (user-error "Cannot pretty-print. Command `pp-buffer' is not available"))
+ ((looking-at "[$&@0-9a-zA-Z]+ *= *'(")
+ (goto-char (- (match-end 0) 2))
+ (setq beg (point))
+ (setq ind (make-string (current-column) ?\ ))
+ (condition-case nil (forward-sexp 1)
+ (error
+ (user-error "Cannot pretty-print Lisp expression: Unbalanced parenthesis")))
+ (setq end (point))
+ (save-restriction
+ (narrow-to-region beg end)
+ (if (eq last-command this-command)
+ (progn
+ (goto-char (point-min))
+ (setq this-command nil)
+ (while (re-search-forward "[ \t]*\n[ \t]*" nil t)
+ (replace-match " ")))
+ (pp-buffer)
+ (untabify (point-min) (point-max))
+ (goto-char (1+ (point-min)))
+ (while (re-search-forward "^." nil t)
+ (beginning-of-line 1)
+ (insert ind))
+ (goto-char (point-max))
+ (org-delete-backward-char 1)))
+ (goto-char beg))
+ (t nil))))
+
+(defun org-table-fedit-line-up ()
+ "Move cursor one line up in the window showing the table."
+ (interactive)
+ (org-table-fedit-move 'previous-line))
+
+(defun org-table-fedit-line-down ()
+ "Move cursor one line down in the window showing the table."
+ (interactive)
+ (org-table-fedit-move 'next-line))
+
+(defun org-table-fedit-move (command)
+ "Move the cursor in the window showing the table.
+Use COMMAND to do the motion, repeat if necessary to end up in a data line."
+ (let ((org-table-allow-automatic-line-recalculation nil)
+ (pos org-pos) (win (selected-window)) p)
+ (select-window (get-buffer-window (marker-buffer org-pos)))
+ (setq p (point))
+ (call-interactively command)
+ (while (and (org-at-table-p)
+ (org-at-table-hline-p))
+ (call-interactively command))
+ (or (org-at-table-p) (goto-char p))
+ (move-marker pos (point))
+ (select-window win)))
+
+(defun org-table-fedit-scroll (N)
+ (interactive "p")
+ (let ((other-window-scroll-buffer (marker-buffer org-pos)))
+ (scroll-other-window N)))
+
+(defun org-table-fedit-scroll-down (N)
+ (interactive "p")
+ (org-table-fedit-scroll (- N)))
+
+(defun org-table-add-rectangle-overlay (beg end &optional face)
+ "Add a new overlay."
+ (let ((ov (make-overlay beg end)))
+ (overlay-put ov 'face (or face 'secondary-selection))
+ (push ov org-table-rectangle-overlays)))
+
+(defun org-table-highlight-rectangle (&optional beg end face)
+ "Highlight rectangular region in a table.
+When buffer positions BEG and END are provided, use them to
+delimit the region to highlight. Otherwise, refer to point. Use
+FACE, when non-nil, for the highlight."
+ (let* ((beg (or beg (point)))
+ (end (or end (point)))
+ (b (min beg end))
+ (e (max beg end))
+ (start-coordinates
+ (save-excursion
+ (goto-char b)
+ (cons (line-beginning-position) (org-table-current-column))))
+ (end-coordinates
+ (save-excursion
+ (goto-char e)
+ (cons (line-beginning-position) (org-table-current-column)))))
+ (when (boundp 'org-show-positions)
+ (setq org-show-positions (cons b (cons e org-show-positions))))
+ (goto-char (car start-coordinates))
+ (let ((column-start (min (cdr start-coordinates) (cdr end-coordinates)))
+ (column-end (max (cdr start-coordinates) (cdr end-coordinates)))
+ (last-row (car end-coordinates)))
+ (while (<= (point) last-row)
+ (when (looking-at org-table-dataline-regexp)
+ (org-table-goto-column column-start)
+ (skip-chars-backward "^|\n")
+ (let ((p (point)))
+ (org-table-goto-column column-end)
+ (skip-chars-forward "^|\n")
+ (org-table-add-rectangle-overlay p (point) face)))
+ (forward-line)))
+ (goto-char (car start-coordinates)))
+ (add-hook 'before-change-functions #'org-table-remove-rectangle-highlight))
+
+(defun org-table-remove-rectangle-highlight (&rest _ignore)
+ "Remove the rectangle overlays."
+ (unless org-inhibit-highlight-removal
+ (remove-hook 'before-change-functions 'org-table-remove-rectangle-highlight)
+ (mapc 'delete-overlay org-table-rectangle-overlays)
+ (setq org-table-rectangle-overlays nil)))
+
+(defvar-local org-table-coordinate-overlays nil
+ "Collects the coordinate grid overlays, so that they can be removed.")
+
+(defun org-table-overlay-coordinates ()
+ "Add overlays to the table at point, to show row/column coordinates."
+ (interactive)
+ (mapc 'delete-overlay org-table-coordinate-overlays)
+ (setq org-table-coordinate-overlays nil)
+ (save-excursion
+ (let ((id 0) (ih 0) hline eol str ov)
+ (goto-char (org-table-begin))
+ (while (org-at-table-p)
+ (setq eol (point-at-eol))
+ (setq ov (make-overlay (point-at-bol) (1+ (point-at-bol))))
+ (push ov org-table-coordinate-overlays)
+ (setq hline (looking-at org-table-hline-regexp))
+ (setq str (if hline (format "I*%-2d" (setq ih (1+ ih)))
+ (format "%4d" (setq id (1+ id)))))
+ (org-overlay-before-string ov str 'org-special-keyword 'evaporate)
+ (when hline
+ (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 ()
+ "Toggle the display of Row/Column numbers in tables."
+ (interactive)
+ (if (not (org-at-table-p))
+ (user-error "Not on a table")
+ (setq org-table-overlay-coordinates (not org-table-overlay-coordinates))
+ (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))
+ (message "Tables Row/Column numbers display turned %s"
+ (if org-table-overlay-coordinates "on" "off"))))
+
+;;;###autoload
+(defun org-table-toggle-formula-debugger ()
+ "Toggle the formula debugger in tables."
+ (interactive)
+ (setq org-table-formula-debug (not org-table-formula-debug))
+ (message "Formula debugging has been turned %s"
+ (if org-table-formula-debug "on" "off")))
+
+
+;;; 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))))
+
+
+;;; Generic Tools
+
+;;;###autoload
+(defun org-table-map-tables (f &optional quietly)
+ "Apply function F to the start of all tables in the buffer."
+ (org-with-point-at 1
+ (while (re-search-forward org-table-line-regexp nil t)
+ (let ((table (org-element-lineage (org-element-at-point) '(table) t)))
+ (when table
+ (unless quietly
+ (message "Mapping tables: %d%%"
+ (floor (* 100.0 (point)) (buffer-size))))
+ (goto-char (org-element-property :post-affiliated table))
+ (let ((end (copy-marker (org-element-property :end table))))
+ (unwind-protect
+ (progn (funcall f) (goto-char end))
+ (set-marker end nil)))))))
+ (unless quietly (message "Mapping tables: done")))
+
+;;;###autoload
+(defun org-table-export (&optional file format)
+ "Export table to a file, with configurable format.
+Such a file can be imported into usual spreadsheet programs.
+
+FILE can be the output file name. If not given, it will be taken
+from a TABLE_EXPORT_FILE property in the current entry or higher
+up in the hierarchy, or the user will be prompted for a file
+name. FORMAT can be an export format, of the same kind as it
+used when `-mode' sends a table in a different format.
+
+The command suggests a format depending on TABLE_EXPORT_FORMAT,
+whether it is set locally or up in the hierarchy, then on the
+extension of the given file name, and finally on the variable
+`org-table-export-default-format'."
+ (interactive)
+ (unless (org-at-table-p) (user-error "No table at point"))
+ (org-table-align) ; Make sure we have everything we need.
+ (let ((file (or file (org-entry-get (point) "TABLE_EXPORT_FILE" t))))
+ (unless file
+ (setq file (read-file-name "Export table to: "))
+ (unless (or (not (file-exists-p file))
+ (y-or-n-p (format "Overwrite file %s? " file)))
+ (user-error "File not written")))
+ (when (file-directory-p file)
+ (user-error "This is a directory path, not a file"))
+ (when (and (buffer-file-name (buffer-base-buffer))
+ (file-equal-p
+ (file-truename file)
+ (file-truename (buffer-file-name (buffer-base-buffer)))))
+ (user-error "Please specify a file name that is different from current"))
+ (let ((fileext (concat (file-name-extension file) "$"))
+ (format (or format (org-entry-get (point) "TABLE_EXPORT_FORMAT" t))))
+ (unless format
+ (let* ((formats '("orgtbl-to-tsv" "orgtbl-to-csv" "orgtbl-to-latex"
+ "orgtbl-to-html" "orgtbl-to-generic"
+ "orgtbl-to-texinfo" "orgtbl-to-orgtbl"
+ "orgtbl-to-unicode"))
+ (deffmt-readable
+ (replace-regexp-in-string
+ "\t" "\\t"
+ (replace-regexp-in-string
+ "\n" "\\n"
+ (or (car (delq nil
+ (mapcar
+ (lambda (f)
+ (and (string-match-p fileext f) f))
+ formats)))
+ org-table-export-default-format)
+ t t)
+ t t)))
+ (setq format
+ (org-completing-read
+ "Format: " formats nil nil deffmt-readable))))
+ (if (string-match "\\([^ \t\r\n]+\\)\\( +.*\\)?" format)
+ (let ((transform (intern (match-string 1 format)))
+ (params (and (match-end 2)
+ (read (concat "(" (match-string 2 format) ")"))))
+ (table (org-table-to-lisp)))
+ (unless (fboundp transform)
+ (user-error "No such transformation function %s" transform))
+ (let (buf)
+ (with-current-buffer (find-file-noselect file)
+ (setq buf (current-buffer))
+ (erase-buffer)
+ (fundamental-mode)
+ (insert (funcall transform table params) "\n")
+ (save-buffer))
+ (kill-buffer buf))
+ (message "Export done."))
+ (user-error "TABLE_EXPORT_FORMAT invalid")))))
+
+;;;###autoload
+(defun org-table--align-field (field width align)
+ "Format FIELD according to column WIDTH and alignment 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)))
+
+(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))))
+ (org-table-save-field
+ ;; Make sure invisible characters in the table are at the right
+ ;; place since column widths take them into account.
+ (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)
+ (org-table-with-shrunk-columns
+ (let* ((table (org-table-to-lisp))
+ (rows (remq 'hline table))
+ (widths nil)
+ (alignments nil)
+ (columns-number 1))
+ (if (null rows)
+ ;; Table contains only horizontal rules. Compute the
+ ;; number of columns anyway, and choose an arbitrary width
+ ;; and alignment.
+ (let ((end (line-end-position)))
+ (save-excursion
+ (while (search-forward "+" end t)
+ (cl-incf columns-number)))
+ (setq widths (make-list columns-number 1))
+ (setq alignments (make-list columns-number "l")))
+ ;; Compute alignment and width for each column.
+ (setq columns-number (apply #'max (mapcar #'length rows)))
+ (dotimes (i columns-number)
+ (let ((max-width 1)
+ (fixed-align? nil)
+ (numbers 0)
+ (non-empty 0))
+ (dolist (row rows)
+ (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.
+ (let ((rule (and (memq 'hline table)
+ (mapconcat (lambda (w) (make-string (+ 2 w) ?-))
+ widths
+ "+")))
+ (indent (progn (looking-at "[ \t]*|") (match-string 0))))
+ (dolist (row table)
+ (let ((previous (buffer-substring (point) (line-end-position)))
+ (new
+ (concat indent
+ (if (eq row 'hline) rule
+ (let* ((offset (- columns-number (length row)))
+ (fields (if (= 0 offset) row
+ ;; Add missing fields.
+ (append row
+ (make-list offset "")))))
+ (mapconcat #'identity
+ (cl-mapcar #'org-table--align-field
+ fields
+ 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-justify-field-maybe (&optional new)
+ "Justify the current field, text to left, number to right.
+Optional argument NEW may specify text to replace the current field content."
+ (cond
+ ((and (not new) org-table-may-need-update)) ; Realignment will happen anyway
+ ((org-at-table-hline-p))
+ ((and (not new)
+ (or (not (eq (marker-buffer org-table-aligned-begin-marker)
+ (current-buffer)))
+ (< (point) org-table-aligned-begin-marker)
+ (>= (point) org-table-aligned-end-marker)))
+ ;; This is not the same table, force a full re-align.
+ (setq org-table-may-need-update t))
+ (t
+ ;; Realign the current field, based on previous full realign.
+ (let ((pos (point))
+ (col (org-table-current-column)))
+ (when (> col 0)
+ (skip-chars-backward "^|")
+ (if (not (looking-at " *\\(?:\\([^|\n]*?\\) *\\(|\\)\\|\\([^|\n]+?\\) *\\($\\)\\)"))
+ (setq org-table-may-need-update t)
+ (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))
+ (properly-closed? (/= (match-beginning 2) (match-end 2)))
+ (new-cell
+ (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)
+ "|"))
+ ((and width (<= (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)))
+ (goto-char pos))))))))
+
+;;;###autoload
+(defun org-table-sort-lines
+ (&optional with-case sorting-type getkey-func compare-func interactive?)
+ "Sort table lines according to the column at point.
+
+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 of no such lines
+exist. 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 then prompts for the sorting type which can be
+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
+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,
+any of (?a ?A ?n ?N ?t ?T ?f ?F) where the capital letters indicate that
+sorting should be done in reverse order.
+
+If the SORTING-TYPE is ?f or ?F, then GETKEY-FUNC specifies
+a function to be called to extract the key. It must return a value
+that is compatible with COMPARE-FUNC, the function used to compare
+entries.
+
+A non-nil value for INTERACTIVE? is used to signal that this
+function is being called interactively."
+ (interactive (list current-prefix-arg nil nil nil t))
+ (when (org-region-active-p) (goto-char (region-beginning)))
+ ;; Point must be either within a field or before a data line.
+ (save-excursion
+ (skip-chars-backward " \t")
+ (when (bolp) (search-forward "|" (line-end-position) t))
+ (org-table-check-inside-data-field))
+ ;; Set appropriate case sensitivity and column used for sorting.
+ (let ((column (let ((c (org-table-current-column)))
+ (cond ((> c 0) c)
+ (interactive?
+ (read-number "Use column N for sorting: "))
+ (t 1))))
+ (sorting-type
+ (or sorting-type
+ (read-char-exclusive "Sort Table: [a]lphabetic, [n]umeric, \
+\[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)
+ (progn (goto-char (region-beginning))
+ (narrow-to-region
+ (point)
+ (save-excursion (goto-char (region-end))
+ (line-beginning-position 2))))
+ (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* ((coordinates
+ (cons (count-lines (point-min) (line-beginning-position))
+ (current-column)))
+ (extract-key-from-field
+ ;; Function to be called on the contents of the field
+ ;; used for sorting in the current row.
+ (cl-case sorting-type
+ ((?n ?N) #'string-to-number)
+ ((?a ?A) #'org-sort-remove-invisible)
+ ((?t ?T)
+ (lambda (f)
+ (cond ((string-match org-ts-regexp-both f)
+ (float-time
+ (org-time-string-to-time (match-string 0 f))))
+ ((org-duration-p f) (org-duration-to-minutes f))
+ ((string-match "\\<[0-9]+:[0-9]\\{2\\}\\>" f)
+ (org-duration-to-minutes (match-string 0 f)))
+ (t 0))))
+ ((?f ?F)
+ (or getkey-func
+ (and interactive?
+ (org-read-function "Function for extracting keys: "))
+ (error "Missing key extractor to sort rows")))
+ (t (user-error "Invalid sorting type `%c'" sorting-type))))
+ (predicate
+ (cl-case sorting-type
+ ((?n ?N ?t ?T) #'<)
+ ((?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
+ "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 ()
+ (forward-line)
+ (while (and (not (eobp))
+ (not (looking-at org-table-dataline-regexp)))
+ (forward-line)))
+ #'end-of-line
+ (lambda ()
+ (funcall extract-key-from-field
+ (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))))))
+
+(defun org-table-transpose-table-at-point ()
+ "Transpose Org table at point and eliminate hlines.
+So a table like
+
+| 1 | 2 | 4 | 5 |
+|---+---+---+---|
+| a | b | c | d |
+| e | f | g | h |
+
+will be transposed as
+
+| 1 | a | e |
+| 2 | b | f |
+| 4 | c | g |
+| 5 | d | h |
+
+Note that horizontal lines disappear."
+ (interactive)
+ (let* ((table (delete 'hline (org-table-to-lisp)))
+ (dline_old (org-table-current-line))
+ (col_old (org-table-current-column))
+ (contents (mapcar (lambda (_)
+ (let ((tp table))
+ (mapcar
+ (lambda (_)
+ (prog1
+ (pop (car tp))
+ (setq tp (cdr tp))))
+ table)))
+ (car table))))
+ (goto-char (org-table-begin))
+ (re-search-forward "|")
+ (backward-char)
+ (delete-region (point) (org-table-end))
+ (insert (mapconcat
+ (lambda(x)
+ (concat "| " (mapconcat 'identity x " | " ) " |\n" ))
+ contents ""))
+ (org-table-goto-line col_old)
+ (org-table-goto-column dline_old))
+ (org-table-align))
+
+;;;###autoload
+(defun org-table-wrap-region (arg)
+ "Wrap several fields in a column like a paragraph.
+This is useful if you'd like to spread the contents of a field over several
+lines, in order to keep the table compact.
+
+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. Generally, this makes the table more compact. A prefix ARG may be
+used to change the number of desired lines. For example, \
+`C-2 \\[org-table-wrap-region]'
+formats the selected text to two lines. If the region was longer than two
+lines, the remaining lines remain empty. A negative prefix argument reduces
+the current number of lines by that amount. The wrapped text is pasted back
+into the table. If you formatted it to more lines than it was before, fields
+further down in the table get overwritten - so you might need to make space in
+the table first.
+
+If there is no region, the current field is split at the cursor position and
+the text fragment to the right of the cursor is prepended to the field one
+line down.
+
+If there is no region, but you specify a prefix ARG, the current field gets
+blank, and the content is appended to the field above."
+ (interactive "P")
+ (org-table-check-inside-data-field)
+ (if (org-region-active-p)
+ ;; There is a region: fill as a paragraph.
+ (let ((start (region-beginning)))
+ (save-restriction
+ (narrow-to-region
+ (save-excursion (goto-char start) (move-beginning-of-line 1))
+ (save-excursion (org-forward-paragraph) (point)))
+ (org-table-cut-region (region-beginning) (region-end))
+ (when (> (length (car org-table-clip)) 1)
+ (user-error "Region must be limited to single column"))
+ (let ((nlines (cond ((not arg) (length org-table-clip))
+ ((< arg 1) (+ (length org-table-clip) arg))
+ (t arg))))
+ (setq org-table-clip
+ (mapcar #'list
+ (org-wrap (mapconcat #'car org-table-clip " ")
+ nil
+ nlines))))
+ (goto-char start)
+ (org-table-paste-rectangle))
+ (org-table-align))
+ ;; No region, split the current field at point.
+ (unless (org-get-alist-option org-M-RET-may-split-line 'table)
+ (skip-chars-forward "^\r\n|"))
+ (cond
+ (arg ; Combine with field above.
+ (let ((s (org-table-blank-field))
+ (col (org-table-current-column)))
+ (forward-line -1)
+ (while (org-at-table-hline-p) (forward-line -1))
+ (org-table-goto-column col)
+ (skip-chars-forward "^|")
+ (skip-chars-backward " ")
+ (insert " " (org-trim s))
+ (org-table-align)))
+ ((looking-at "\\([^|]+\\)|") ; Split field.
+ (let ((s (match-string 1)))
+ (replace-match " |")
+ (goto-char (match-beginning 0))
+ (org-table-next-row)
+ (insert (org-trim s) " ")
+ (org-table-align)))
+ (t (org-table-next-row)))))
+
+(defun org-table--number-for-summing (s)
+ (let (n)
+ (if (string-match "^ *|? *" s)
+ (setq s (replace-match "" nil nil s)))
+ (if (string-match " *|? *$" s)
+ (setq s (replace-match "" nil nil s)))
+ (setq n (string-to-number s))
+ (cond
+ ((and (string-match "0" s)
+ (string-match "\\`[-+ \t0.edED]+\\'" s)) 0)
+ ((string-match "\\`[ \t]+\\'" s) nil)
+ ((string-match "\\`\\([0-9]+\\):\\([0-9]+\\)\\(:\\([0-9]+\\)\\)?\\'" s)
+ (let ((h (string-to-number (or (match-string 1 s) "0")))
+ (m (string-to-number (or (match-string 2 s) "0")))
+ (s (string-to-number (or (match-string 4 s) "0"))))
+ (if (boundp 'org-timecnt) (setq org-timecnt (1+ org-timecnt)))
+ (* 1.0 (+ h (/ m 60.0) (/ s 3600.0)))))
+ ((equal n 0) nil)
+ (t n))))
+
+;;;###autoload
+(defun org-table-sum (&optional beg end nlast)
+ "Sum numbers in region of current table column.
+The result will be displayed in the echo area, and will be available
+as kill to be inserted with \\[yank].
+
+If there is an active region, it is interpreted as a rectangle and all
+numbers in that rectangle will be summed. If there is no active
+region and point is located in a table column, sum all numbers in that
+column.
+
+If at least one number looks like a time HH:MM or HH:MM:SS, all other
+numbers are assumed to be times as well (in decimal hours) and the
+numbers are added as such.
+
+If NLAST is a number, only the NLAST fields will actually be summed."
+ (interactive)
+ (save-excursion
+ (let (col (org-timecnt 0) diff h m s org-table-clip)
+ (cond
+ ((and beg end)) ; beg and end given explicitly
+ ((org-region-active-p)
+ (setq beg (region-beginning) end (region-end)))
+ (t
+ (setq col (org-table-current-column))
+ (goto-char (org-table-begin))
+ (unless (re-search-forward "^[ \t]*|[^-]" nil t)
+ (user-error "No table data"))
+ (org-table-goto-column col)
+ (setq beg (point))
+ (goto-char (org-table-end))
+ (unless (re-search-backward "^[ \t]*|[^-]" nil t)
+ (user-error "No table data"))
+ (org-table-goto-column col)
+ (setq end (point))))
+ (let* ((items (apply 'append (org-table-copy-region beg end)))
+ (items1 (cond ((not nlast) items)
+ ((>= nlast (length items)) items)
+ (t (setq items (reverse items))
+ (setcdr (nthcdr (1- nlast) items) nil)
+ (nreverse items))))
+ (numbers (delq nil (mapcar #'org-table--number-for-summing
+ items1)))
+ (res (apply '+ numbers))
+ (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)
+ s diff)
+ (format "%.0f:%02.0f:%02.0f" h m s))))
+ (kill-new sres)
+ (when (called-interactively-p 'interactive)
+ (message (substitute-command-keys
+ (format "Sum of %d items: %-20s \
+\(\\[yank] will insert result into buffer)"
+ (length numbers)
+ sres))))
+ sres))))
+
+;;;###autoload
+(defun org-table-analyze ()
+ "Analyze table at point and store results.
+
+This function sets up the following dynamically scoped variables:
+
+ `org-table-column-name-regexp',
+ `org-table-column-names',
+ `org-table-current-begin-pos',
+ `org-table-current-line-types',
+ `org-table-current-ncol',
+ `org-table-dlines',
+ `org-table-hlines',
+ `org-table-local-parameters',
+ `org-table-named-field-locations'."
+ (let ((beg (org-table-begin))
+ (end (org-table-end)))
+ (save-excursion
+ (goto-char beg)
+ ;; Extract column names.
+ (setq org-table-column-names nil)
+ (when (save-excursion
+ (re-search-forward "^[ \t]*| *! *\\(|.*\\)" end t))
+ (let ((c 1))
+ (dolist (name (org-split-string (match-string 1) " *| *"))
+ (cl-incf c)
+ (when (string-match "\\`[a-zA-Z][_a-zA-Z0-9]*\\'" name)
+ (push (cons name (number-to-string c)) org-table-column-names)))))
+ (setq org-table-column-names (nreverse org-table-column-names))
+ (setq org-table-column-name-regexp
+ (format "\\$\\(%s\\)\\>"
+ (regexp-opt (mapcar #'car org-table-column-names) t)))
+ ;; Extract local parameters.
+ (setq org-table-local-parameters nil)
+ (save-excursion
+ (while (re-search-forward "^[ \t]*| *\\$ *\\(|.*\\)" end t)
+ (dolist (field (org-split-string (match-string 1) " *| *"))
+ (when (string-match
+ "\\`\\([a-zA-Z][_a-zA-Z0-9]*\\|%\\) *= *\\(.*\\)" field)
+ (push (cons (match-string 1 field) (match-string 2 field))
+ org-table-local-parameters)))))
+ ;; Update named fields locations. We minimize `count-lines'
+ ;; processing by storing last known number of lines in LAST.
+ (setq org-table-named-field-locations nil)
+ (save-excursion
+ (let ((last (cons (point) 0)))
+ (while (re-search-forward "^[ \t]*| *\\([_^]\\) *\\(|.*\\)" end t)
+ (let ((c (match-string 1))
+ (fields (org-split-string (match-string 2) " *| *")))
+ (save-excursion
+ (forward-line (if (equal c "_") 1 -1))
+ (let ((fields1
+ (and (looking-at "^[ \t]*|[^|]*\\(|.*\\)")
+ (org-split-string (match-string 1) " *| *")))
+ (line (cl-incf (cdr last) (count-lines (car last) (point))))
+ (col 1))
+ (setcar last (point)) ; Update last known position.
+ (while (and fields fields1)
+ (let ((field (pop fields))
+ (v (pop fields1)))
+ (cl-incf col)
+ (when (and (stringp field)
+ (stringp v)
+ (string-match "\\`[a-zA-Z][_a-zA-Z0-9]*\\'"
+ field))
+ (push (cons field v) org-table-local-parameters)
+ (push (list field line col)
+ org-table-named-field-locations))))))))))
+ ;; Re-use existing markers when possible.
+ (if (markerp org-table-current-begin-pos)
+ (move-marker org-table-current-begin-pos (point))
+ (setq org-table-current-begin-pos (point-marker)))
+ ;; Analyze the line types.
+ (let ((l 0) hlines dlines types)
+ (while (looking-at "[ \t]*|\\(-\\)?")
+ (push (if (match-end 1) 'hline 'dline) types)
+ (if (match-end 1) (push l hlines) (push l dlines))
+ (forward-line)
+ (cl-incf l))
+ (push 'hline types) ; Add an imaginary extra hline to the end.
+ (setq org-table-current-line-types (apply #'vector (nreverse types)))
+ (setq org-table-dlines (apply #'vector (cons nil (nreverse dlines))))
+ (setq org-table-hlines (apply #'vector (cons nil (nreverse hlines)))))
+ ;; Get the number of columns from the first data line in table.
+ (goto-char beg)
+ (forward-line (aref org-table-dlines 1))
+ (setq org-table-current-ncol
+ (length (org-split-string
+ (buffer-substring (line-beginning-position) (line-end-position))
+ "[ \t]*|[ \t]*"))))))
+
+(defun org-table--force-dataline ()
+ "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)
+ (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)))
+ ((or p1 p2) (goto-char (or p1 p2)))
+ (t (user-error "No table data line around here")))
+ (org-move-to-column column))))
+
+(defun org-table-show-reference (&optional local)
+ "Show the location/value of the $ expression at point.
+When LOCAL is non-nil, show references for the table at point."
+ (interactive)
+ (org-table-remove-rectangle-highlight)
+ (when local (org-table-analyze))
+ (catch 'exit
+ (let ((pos (if local (point) org-pos))
+ (face2 'highlight)
+ (org-inhibit-highlight-removal t)
+ (win (selected-window))
+ (org-show-positions nil)
+ var name e what match dest)
+ (setq what (cond
+ ((org-in-regexp "^@[0-9]+[ \t=]")
+ (setq match (concat (substring (match-string 0) 0 -1)
+ "$1.."
+ (substring (match-string 0) 0 -1)
+ "$100"))
+ 'range)
+ ((or (org-in-regexp org-table-range-regexp2)
+ (org-in-regexp org-table-translate-regexp)
+ (org-in-regexp org-table-range-regexp))
+ (setq match
+ (save-match-data
+ (org-table-convert-refs-to-rc (match-string 0))))
+ 'range)
+ ((org-in-regexp "\\$[a-zA-Z][a-zA-Z0-9]*") 'name)
+ ((org-in-regexp "\\$[0-9]+") 'column)
+ ((not local) nil)
+ (t (user-error "No reference at point")))
+ match (and what (or match (match-string 0))))
+ (when (and match (not (equal (match-beginning 0) (point-at-bol))))
+ (org-table-add-rectangle-overlay (match-beginning 0) (match-end 0)
+ 'secondary-selection))
+ (add-hook 'before-change-functions
+ #'org-table-remove-rectangle-highlight)
+ (when (eq what 'name) (setq var (substring match 1)))
+ (when (eq what 'range)
+ (unless (eq (string-to-char match) ?@) (setq match (concat "@" match)))
+ (setq match (org-table-formula-substitute-names match)))
+ (unless local
+ (save-excursion
+ (end-of-line)
+ (re-search-backward "^\\S-" nil t)
+ (beginning-of-line)
+ (when (looking-at "\\(\\$[0-9a-zA-Z]+\\|@[0-9]+\\$[0-9]+\\|[a-zA-Z]+\
+\\([0-9]+\\|&\\)\\) *=")
+ (setq dest
+ (save-match-data
+ (org-table-convert-refs-to-rc (match-string 1))))
+ (org-table-add-rectangle-overlay
+ (match-beginning 1) (match-end 1) face2))))
+ (if (and (markerp pos) (marker-buffer pos))
+ (if (get-buffer-window (marker-buffer pos))
+ (select-window (get-buffer-window (marker-buffer pos)))
+ (org-switch-to-buffer-other-window (get-buffer-window
+ (marker-buffer pos)))))
+ (goto-char pos)
+ (org-table--force-dataline)
+ (let ((table-start
+ (if local org-table-current-begin-pos (org-table-begin))))
+ (when dest
+ (setq name (substring dest 1))
+ (cond
+ ((string-match-p "\\`\\$[a-zA-Z][a-zA-Z0-9]*" dest)
+ (org-table-goto-field dest))
+ ((string-match-p "\\`@\\([1-9][0-9]*\\)\\$\\([1-9][0-9]*\\)\\'"
+ dest)
+ (org-table-goto-field dest))
+ (t (org-table-goto-column (string-to-number name))))
+ (move-marker pos (point))
+ (org-table-highlight-rectangle nil nil face2))
+ (cond
+ ((equal dest match))
+ ((not match))
+ ((eq what 'range)
+ (ignore-errors (org-table-get-range match table-start nil 'highlight)))
+ ((setq e (assoc var org-table-named-field-locations))
+ (org-table-goto-field var)
+ (org-table-highlight-rectangle)
+ (message "Named field, column %d of line %d" (nth 2 e) (nth 1 e)))
+ ((setq e (assoc var org-table-column-names))
+ (org-table-goto-column (string-to-number (cdr e)))
+ (org-table-highlight-rectangle)
+ (goto-char table-start)
+ (if (re-search-forward (concat "^[ \t]*| *! *.*?| *\\(" var "\\) *|")
+ (org-table-end) t)
+ (progn
+ (goto-char (match-beginning 1))
+ (org-table-highlight-rectangle)
+ (message "Named column (column %s)" (cdr e)))
+ (user-error "Column name not found")))
+ ((eq what 'column)
+ ;; Column number.
+ (org-table-goto-column (string-to-number (substring match 1)))
+ (org-table-highlight-rectangle)
+ (message "Column %s" (substring match 1)))
+ ((setq e (assoc var org-table-local-parameters))
+ (goto-char table-start)
+ (if (re-search-forward (concat "^[ \t]*| *\\$ *.*?| *\\(" var "=\\)") nil t)
+ (progn
+ (goto-char (match-beginning 1))
+ (org-table-highlight-rectangle)
+ (message "Local parameter."))
+ (user-error "Parameter not found")))
+ ((not var) (user-error "No reference at point"))
+ ((setq e (assoc var org-table-formula-constants-local))
+ (message "Local Constant: $%s=%s in #+CONSTANTS line."
+ var (cdr e)))
+ ((setq e (assoc var org-table-formula-constants))
+ (message "Constant: $%s=%s in `org-table-formula-constants'."
+ var (cdr e)))
+ ((setq e (and (fboundp 'constants-get) (constants-get var)))
+ (message "Constant: $%s=%s, from `constants.el'%s."
+ var e (format " (%s units)" constants-unit-system)))
+ (t (user-error "Undefined name $%s" var)))
+ (goto-char pos)
+ (when (and org-show-positions
+ (not (memq this-command '(org-table-fedit-scroll
+ org-table-fedit-scroll-down))))
+ (push pos org-show-positions)
+ (push table-start org-show-positions)
+ (let ((min (apply 'min org-show-positions))
+ (max (apply 'max org-show-positions)))
+ (set-window-start (selected-window) min)
+ (goto-char max)
+ (or (pos-visible-in-window-p max)
+ (set-window-start (selected-window) max)))))
+ (select-window win))))
+
+
+;;; The Orgtbl minor mode
+
+;; Define a minor mode which can be used in other modes in order to
+;; integrate the Org table editor.
+
+;; This is really a hack, because the Org table editor uses several
+;; keys which normally belong to the major mode, for example the TAB
+;; and RET keys. Here is how it works: The minor mode defines all the
+;; keys necessary to operate the table editor, but wraps the commands
+;; into a function which tests if the cursor is currently inside
+;; a table. If that is the case, the table editor command is
+;; executed. However, when any of those keys is used outside a table,
+;; the 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 used by the table editor is otherwise
+;; used as a prefix key.
+
+;; Another challenge is that the key binding for TAB can be tab or \C-i,
+;; likewise the binding for RET can be return or \C-m. Orgtbl-mode
+;; addresses this by checking explicitly for both bindings.
+
+;; The optimized version (see variable `orgtbl-optimized') takes over
+;; all keys which are bound to `self-insert-command' in the *global map*.
+;; Some modes bind other commands to simple characters, for example
+;; AUCTeX binds the double quote to `Tex-insert-quote'. With orgtbl-mode
+;; active, this binding is ignored inside tables and replaced with a
+;; modified self-insert.
+
+(defvar orgtbl-mode-map (make-keymap)
+ "Keymap for `orgtbl-mode'.")
+
+(defvar org-old-auto-fill-inhibit-regexp nil
+ "Local variable used by `orgtbl-mode'.")
+
+(defconst orgtbl-line-start-regexp
+ "[ \t]*\\(|\\|#\\+\\(tblfm\\|orgtbl\\|tblname\\):\\)"
+ "Matches a line belonging to an orgtbl.")
+
+(defconst orgtbl-extra-font-lock-keywords
+ (list (list (concat "^" orgtbl-line-start-regexp ".*")
+ 0 (quote 'org-table) 'prepend))
+ "Extra `font-lock-keywords' to be added when `orgtbl-mode' is active.")
+
+;;;###autoload
+(defun turn-on-orgtbl ()
+ "Unconditionally turn on `orgtbl-mode'."
+ (require 'org-table)
+ (orgtbl-mode 1))
+
+;; Install it as a minor mode.
+(put 'orgtbl-mode :included t)
+(put 'orgtbl-mode :menu-tag "Org Table Mode")
+
+(easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu."
+ '("OrgTbl"
+ ["Create or convert" org-table-create-or-convert-from-region
+ :active (not (org-at-table-p)) :keys "C-c |" ]
+ "--"
+ ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"]
+ ["Next Field" org-cycle :active (org-at-table-p) :keys "TAB"]
+ ["Previous Field" org-shifttab :active (org-at-table-p) :keys "S-TAB"]
+ ["Next Row" org-return :active (org-at-table-p) :keys "RET"]
+ "--"
+ ["Blank Field" org-table-blank-field :active (org-at-table-p) :keys "C-c SPC"]
+ ["Edit Field" org-table-edit-field :active (org-at-table-p) :keys "C-c ` "]
+ ["Copy Field from Above"
+ org-table-copy-down :active (org-at-table-p) :keys "S-RET"]
+ "--"
+ ("Column"
+ ["Move Column Left" org-metaleft :active (org-at-table-p) :keys "M-<left>"]
+ ["Move Column Right" org-metaright :active (org-at-table-p) :keys "M-<right>"]
+ ["Delete Column" org-shiftmetaleft :active (org-at-table-p) :keys "M-S-<left>"]
+ ["Insert Column" org-shiftmetaright :active (org-at-table-p) :keys "M-S-<right>"])
+ ("Row"
+ ["Move Row Up" org-metaup :active (org-at-table-p) :keys "M-<up>"]
+ ["Move Row Down" org-metadown :active (org-at-table-p) :keys "M-<down>"]
+ ["Delete Row" org-shiftmetaup :active (org-at-table-p) :keys "M-S-<up>"]
+ ["Insert Row" org-shiftmetadown :active (org-at-table-p) :keys "M-S-<down>"]
+ ["Sort lines in region" org-table-sort-lines :active (org-at-table-p) :keys "C-c ^"]
+ "--"
+ ["Insert Hline" org-table-insert-hline :active (org-at-table-p) :keys "C-c -"])
+ ("Rectangle"
+ ["Copy Rectangle" org-copy-special :active (org-at-table-p)]
+ ["Cut Rectangle" org-cut-special :active (org-at-table-p)]
+ ["Paste Rectangle" org-paste-special :active (org-at-table-p)]
+ ["Fill Rectangle" org-table-wrap-region :active (org-at-table-p)])
+ "--"
+ ("Radio tables"
+ ["Insert table template" orgtbl-insert-radio-table
+ (cl-assoc-if #'derived-mode-p orgtbl-radio-table-templates)]
+ ["Comment/uncomment table" orgtbl-toggle-comment t])
+ "--"
+ ["Set Column Formula" org-table-eval-formula :active (org-at-table-p) :keys "C-c ="]
+ ["Set Field Formula" (org-table-eval-formula '(4)) :active (org-at-table-p) :keys "C-u C-c ="]
+ ["Edit Formulas" org-table-edit-formulas :active (org-at-table-p) :keys "C-c '"]
+ ["Recalculate line" org-table-recalculate :active (org-at-table-p) :keys "C-c *"]
+ ["Recalculate all" (org-table-recalculate '(4)) :active (org-at-table-p) :keys "C-u C-c *"]
+ ["Iterate all" (org-table-recalculate '(16)) :active (org-at-table-p) :keys "C-u C-u C-c *"]
+ ["Toggle Recalculate Mark" org-table-rotate-recalc-marks :active (org-at-table-p) :keys "C-c #"]
+ ["Sum Column/Rectangle" org-table-sum
+ :active (or (org-at-table-p) (org-region-active-p)) :keys "C-c +"]
+ ["Which Column?" org-table-current-column :active (org-at-table-p) :keys "C-c ?"]
+ ["Debug Formulas"
+ org-table-toggle-formula-debugger :active (org-at-table-p)
+ :keys "C-c {"
+ :style toggle :selected org-table-formula-debug]
+ ["Show Col/Row Numbers"
+ org-table-toggle-coordinate-overlays :active (org-at-table-p)
+ :keys "C-c }"
+ :style toggle :selected org-table-overlay-coordinates]
+ "--"
+ ("Plot"
+ ["Ascii plot" orgtbl-ascii-plot :active (org-at-table-p) :keys "C-c \" a"]
+ ["Gnuplot" org-plot/gnuplot :active (org-at-table-p) :keys "C-c \" g"])))
+
+;;;###autoload
+(define-minor-mode orgtbl-mode
+ "The Org mode table editor as a minor mode for use in other modes."
+ :lighter " OrgTbl"
+ (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"))
+ (orgtbl-mode
+ (and (orgtbl-setup) (defun orgtbl-setup () nil)) ;; FIXME: Yuck!?!
+ ;; Make sure we are first in minor-mode-map-alist
+ (let ((c (assq 'orgtbl-mode minor-mode-map-alist)))
+ ;; FIXME: maybe it should use emulation-mode-map-alists?
+ (and c (setq minor-mode-map-alist
+ (cons c (delq c minor-mode-map-alist)))))
+ (setq-local org-table-may-need-update t)
+ (add-hook 'before-change-functions 'org-before-change-function
+ nil 'local)
+ (setq-local org-old-auto-fill-inhibit-regexp
+ auto-fill-inhibit-regexp)
+ (setq-local auto-fill-inhibit-regexp
+ (if auto-fill-inhibit-regexp
+ (concat orgtbl-line-start-regexp "\\|"
+ auto-fill-inhibit-regexp)
+ orgtbl-line-start-regexp))
+ (when (fboundp 'font-lock-add-keywords)
+ (font-lock-add-keywords nil orgtbl-extra-font-lock-keywords)
+ (org-restart-font-lock)))
+ (t
+ (setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp)
+ (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)
+ (org-restart-font-lock))
+ (force-mode-line-update 'all))))
+
+(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
+command name. KEYS are keys that should be checked in for a command
+to execute outside of tables."
+ (eval
+ (list 'defun
+ (intern (concat "orgtbl-hijacker-command-" (number-to-string n)))
+ '(arg)
+ (concat "In tables, run `" (symbol-name fun) "'.\n"
+ "Outside of tables, run the binding of `"
+ (mapconcat #'key-description keys "' or `")
+ "'.")
+ '(interactive "p")
+ (list 'if
+ '(org-at-table-p)
+ (list 'call-interactively (list 'quote fun))
+ (list 'let '(orgtbl-mode)
+ (list 'call-interactively
+ (append '(or)
+ (mapcar (lambda (k)
+ (list 'key-binding k))
+ keys)
+ '('orgtbl-error))))))))
+
+(defun orgtbl-error ()
+ "Error when there is no default binding for a table key."
+ (interactive)
+ (user-error "This key has no function outside tables"))
+
+(defun orgtbl-setup ()
+ "Setup orgtbl keymaps."
+ (let ((nfunc 0)
+ (bindings
+ '(([(meta shift left)] org-table-delete-column)
+ ([(meta left)] org-table-move-column-left)
+ ([(meta right)] org-table-move-column-right)
+ ([(meta shift right)] org-table-insert-column)
+ ([(meta shift up)] org-table-kill-row)
+ ([(meta shift down)] org-table-insert-row)
+ ([(meta up)] org-table-move-row-up)
+ ([(meta down)] org-table-move-row-down)
+ ("\C-c\C-w" org-table-cut-region)
+ ("\C-c\M-w" org-table-copy-region)
+ ("\C-c\C-y" org-table-paste-rectangle)
+ ("\C-c\C-w" org-table-wrap-region)
+ ("\C-c-" org-table-insert-hline)
+ ("\C-c}" org-table-toggle-coordinate-overlays)
+ ("\C-c{" org-table-toggle-formula-debugger)
+ ("\C-m" org-table-next-row)
+ ([(shift return)] org-table-copy-down)
+ ("\C-c?" org-table-field-info)
+ ("\C-c " org-table-blank-field)
+ ("\C-c+" org-table-sum)
+ ("\C-c=" org-table-eval-formula)
+ ("\C-c'" org-table-edit-formulas)
+ ("\C-c`" org-table-edit-field)
+ ("\C-c*" org-table-recalculate)
+ ("\C-c^" org-table-sort-lines)
+ ("\M-a" org-table-beginning-of-field)
+ ("\M-e" org-table-end-of-field)
+ ([(control ?#)] org-table-rotate-recalc-marks)))
+ elt key fun cmd)
+ (while (setq elt (pop bindings))
+ (setq nfunc (1+ nfunc))
+ (setq key (org-key (car elt))
+ fun (nth 1 elt)
+ cmd (orgtbl-make-binding fun nfunc key))
+ (org-defkey orgtbl-mode-map key cmd))
+
+ ;; Special treatment needed for TAB, RET and DEL
+ (org-defkey orgtbl-mode-map [(return)]
+ (orgtbl-make-binding 'orgtbl-ret 100 [(return)] "\C-m"))
+ (org-defkey orgtbl-mode-map "\C-m"
+ (orgtbl-make-binding 'orgtbl-ret 101 "\C-m" [(return)]))
+ (org-defkey orgtbl-mode-map [(tab)]
+ (orgtbl-make-binding 'orgtbl-tab 102 [(tab)] "\C-i"))
+ (org-defkey orgtbl-mode-map "\C-i"
+ (orgtbl-make-binding 'orgtbl-tab 103 "\C-i" [(tab)]))
+ (org-defkey orgtbl-mode-map [(shift tab)]
+ (orgtbl-make-binding 'org-table-previous-field 104
+ [(shift tab)] [(tab)] "\C-i"))
+ (org-defkey orgtbl-mode-map [backspace]
+ (orgtbl-make-binding 'org-delete-backward-char 109
+ [backspace] (kbd "DEL")))
+
+ (org-defkey orgtbl-mode-map [S-iso-lefttab]
+ (orgtbl-make-binding 'org-table-previous-field 107
+ [S-iso-lefttab] [backtab] [(shift tab)]
+ [(tab)] "\C-i"))
+
+ (org-defkey orgtbl-mode-map [backtab]
+ (orgtbl-make-binding 'org-table-previous-field 108
+ [backtab] [S-iso-lefttab] [(shift tab)]
+ [(tab)] "\C-i"))
+
+ (org-defkey orgtbl-mode-map "\M-\C-m"
+ (orgtbl-make-binding 'org-table-wrap-region 105
+ "\M-\C-m" [(meta return)]))
+ (org-defkey orgtbl-mode-map [(meta return)]
+ (orgtbl-make-binding 'org-table-wrap-region 106
+ [(meta return)] "\M-\C-m"))
+
+ (org-defkey orgtbl-mode-map "\C-c\C-c" 'orgtbl-ctrl-c-ctrl-c)
+ (org-defkey orgtbl-mode-map "\C-c|" 'orgtbl-create-or-convert-from-region)
+
+ (when orgtbl-optimized
+ ;; If the user wants maximum table support, we need to hijack
+ ;; some standard editing functions
+ (org-remap orgtbl-mode-map
+ 'self-insert-command 'orgtbl-self-insert-command
+ 'delete-char 'org-delete-char
+ 'delete-backward-char 'org-delete-backward-char)
+ (org-defkey orgtbl-mode-map "|" 'org-force-self-insert))
+ t))
+
+(defun orgtbl-ctrl-c-ctrl-c (arg)
+ "If the cursor is inside a table, realign the table.
+If it is a table to be sent away to a receiver, do it.
+With prefix arg, also recompute table."
+ (interactive "P")
+ (let ((case-fold-search t) (pos (point)) action)
+ (save-excursion
+ (beginning-of-line 1)
+ (setq action (cond
+ ((looking-at "[ \t]*#\\+ORGTBL:.*\n[ \t]*|") (match-end 0))
+ ((looking-at "[ \t]*|") pos)
+ ((looking-at "[ \t]*#\\+tblfm:") 'recalc))))
+ (cond
+ ((integerp action)
+ (goto-char action)
+ (org-table-maybe-eval-formula)
+ (if arg
+ (call-interactively 'org-table-recalculate)
+ (org-table-maybe-recalculate-line))
+ (call-interactively 'org-table-align)
+ (when (orgtbl-send-table 'maybe)
+ (run-hooks 'orgtbl-after-send-table-hook)))
+ ((eq action 'recalc)
+ (save-excursion
+ (beginning-of-line 1)
+ (skip-chars-backward " \r\n\t")
+ (if (org-at-table-p)
+ (org-call-with-arg 'org-table-recalculate t))))
+ (t (let (orgtbl-mode)
+ (call-interactively (key-binding "\C-c\C-c")))))))
+
+(defun orgtbl-create-or-convert-from-region (_arg)
+ "Create table or convert region to table, if no conflicting binding.
+This installs the table binding `C-c |', but only if there is no
+conflicting binding to this key outside `orgtbl-mode'."
+ (interactive "P")
+ (let* (orgtbl-mode (cmd (key-binding "\C-c|")))
+ (if cmd
+ (call-interactively cmd)
+ (call-interactively 'org-table-create-or-convert-from-region))))
+
+(defun orgtbl-tab (arg)
+ "Justification and field motion for `orgtbl-mode'."
+ (interactive "P")
+ (if arg (org-table-edit-field t)
+ (org-table-justify-field-maybe)
+ (org-table-next-field)))
+
+(defun orgtbl-ret ()
+ "Justification and field motion for `orgtbl-mode'."
+ (interactive)
+ (if (bobp)
+ (newline)
+ (org-table-justify-field-maybe)
+ (org-table-next-row)))
+
+(defun orgtbl-self-insert-command (N)
+ "Like `self-insert-command', use overwrite-mode for whitespace in tables.
+If the cursor is in a table looking at whitespace, the whitespace is
+overwritten, and the table is not marked as requiring realignment."
+ (interactive "p")
+ (if (and (org-at-table-p)
+ (or
+ (and org-table-auto-blank-field
+ (member last-command
+ '(orgtbl-hijacker-command-100
+ orgtbl-hijacker-command-101
+ orgtbl-hijacker-command-102
+ orgtbl-hijacker-command-103
+ orgtbl-hijacker-command-104
+ orgtbl-hijacker-command-105
+ yas/expand))
+ (org-table-blank-field))
+ t)
+ (eq N 1)
+ (looking-at "[^|\n]* \\( \\)|"))
+ (let (org-table-may-need-update)
+ (delete-region (match-beginning 1) (match-end 1))
+ (self-insert-command N))
+ (setq org-table-may-need-update t)
+ (let* (orgtbl-mode
+ a
+ (cmd (or (key-binding
+ (or (and (listp function-key-map)
+ (setq a (assoc last-input-event function-key-map))
+ (cdr a))
+ (vector last-input-event)))
+ 'self-insert-command)))
+ (call-interactively cmd)
+ (if (and org-self-insert-cluster-for-undo
+ (eq cmd 'self-insert-command))
+ (if (not (eq last-command 'orgtbl-self-insert-command))
+ (setq org-self-insert-command-undo-counter 1)
+ (if (>= org-self-insert-command-undo-counter 20)
+ (setq org-self-insert-command-undo-counter 1)
+ (and (> org-self-insert-command-undo-counter 0)
+ buffer-undo-list
+ (not (cadr buffer-undo-list)) ; remove nil entry
+ (setcdr buffer-undo-list (cddr buffer-undo-list)))
+ (setq org-self-insert-command-undo-counter
+ (1+ org-self-insert-command-undo-counter))))))))
+
+;;;###autoload
+(defvar orgtbl-exp-regexp "^\\([-+]?[0-9][0-9.]*\\)[eE]\\([-+]?[0-9]+\\)$"
+ "Regular expression matching exponentials as produced by calc.")
+
+(defun orgtbl-gather-send-defs ()
+ "Gather a plist of :name, :transform, :params for each destination before
+a radio table."
+ (save-excursion
+ (goto-char (org-table-begin))
+ (let (rtn)
+ (beginning-of-line 0)
+ (while (looking-at "[ \t]*#\\+ORGTBL[: \t][ \t]*SEND[ \t]+\\([^ \t\r\n]+\\)[ \t]+\\([^ \t\r\n]+\\)\\([ \t]+.*\\)?")
+ (let ((name (org-no-properties (match-string 1)))
+ (transform (intern (match-string 2)))
+ (params (if (match-end 3)
+ (read (concat "(" (match-string 3) ")")))))
+ (push (list :name name :transform transform :params params)
+ rtn)
+ (beginning-of-line 0)))
+ rtn)))
+
+(defun orgtbl-send-replace-tbl (name text)
+ "Find and replace table NAME with TEXT."
+ (save-excursion
+ (goto-char (point-min))
+ (let* ((location-flag nil)
+ (name (regexp-quote name))
+ (begin-re (format "BEGIN +RECEIVE +ORGTBL +%s\\([ \t]\\|$\\)" name))
+ (end-re (format "END +RECEIVE +ORGTBL +%s\\([ \t]\\|$\\)" name)))
+ (while (re-search-forward begin-re nil t)
+ (unless location-flag (setq location-flag t))
+ (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 text "\n")))
+ (unless location-flag
+ (user-error "No valid receiver location found in the buffer")))))
+
+;;;###autoload
+(defun org-table-to-lisp (&optional txt)
+ "Convert the table at point to a Lisp structure.
+
+The structure will be a list. Each item is either the symbol `hline'
+for a horizontal separator line, or a list of field values as strings.
+The table is taken from the parameter TXT, or from the buffer at point."
+ (if txt
+ (with-temp-buffer
+ (insert txt)
+ (goto-char (point-min))
+ (org-table-to-lisp))
+ (save-excursion
+ (goto-char (org-table-begin))
+ (let ((table nil))
+ (while (re-search-forward "\\=[ \t]*|" nil t)
+ (let ((row nil))
+ (if (looking-at "-")
+ (push 'hline table)
+ (while (not (progn (skip-chars-forward " \t") (eolp)))
+ (push (buffer-substring
+ (point)
+ (progn (re-search-forward "[ \t]*\\(|\\|$\\)")
+ (match-beginning 0)))
+ row))
+ (push (nreverse row) table)))
+ (forward-line))
+ (nreverse table)))))
+
+(defun org-table-collapse-header (table &optional separator max-header-lines)
+ "Collapse the lines before 'hline into a single header.
+
+The given TABLE is a list of lists as returned by `org-table-to-lisp'.
+The leading lines before the first `hline' symbol are considered
+forming the table header. This function collapses all leading header
+lines into a single header line, followed by the `hline' symbol, and
+the rest of the TABLE. Header cells are glued together with a space,
+or the given SEPARATOR."
+ (while (eq (car table) 'hline) (pop table))
+ (let* ((separator (or separator " "))
+ (max-header-lines (or max-header-lines 4))
+ (trailer table)
+ (header-lines (cl-loop for line in table
+ until (eq 'hline line)
+ collect (pop trailer))))
+ (if (and trailer (<= (length header-lines) max-header-lines))
+ (cons (apply #'cl-mapcar
+ (lambda (&rest x)
+ (org-trim
+ (mapconcat #'identity x separator)))
+ header-lines)
+ trailer)
+ table)))
+
+(defun orgtbl-send-table (&optional maybe)
+ "Send a transformed version of table at point to the receiver position.
+With argument MAYBE, fail quietly if no transformation is defined
+for this table."
+ (interactive)
+ (catch 'exit
+ (unless (org-at-table-p) (user-error "Not at a table"))
+ ;; when non-interactive, we assume align has just happened.
+ (when (called-interactively-p 'any) (org-table-align))
+ (let ((dests (orgtbl-gather-send-defs))
+ (table (org-table-to-lisp))
+ (ntbl 0))
+ (unless dests
+ (if maybe (throw 'exit nil)
+ (user-error "Don't know how to transform this table")))
+ (dolist (dest dests)
+ (let ((name (plist-get dest :name))
+ (transform (plist-get dest :transform))
+ (params (plist-get dest :params)))
+ (unless (fboundp transform)
+ (user-error "No such transformation function %s" transform))
+ (orgtbl-send-replace-tbl name (funcall transform table params)))
+ (cl-incf ntbl))
+ (message "Table converted and installed at %d receiver location%s"
+ ntbl (if (> ntbl 1) "s" ""))
+ (and (> ntbl 0) ntbl))))
+
+(defun org-remove-by-index (list indices &optional i0)
+ "Remove the elements in LIST with indices in INDICES.
+First element has index 0, or I0 if given."
+ (if (not indices)
+ list
+ (if (integerp indices) (setq indices (list indices)))
+ (setq i0 (1- (or i0 0)))
+ (delq :rm (mapcar (lambda (x)
+ (setq i0 (1+ i0))
+ (if (memq i0 indices) :rm x))
+ list))))
+
+(defun orgtbl-toggle-comment ()
+ "Comment or uncomment the orgtbl at point."
+ (interactive)
+ (let* ((case-fold-search t)
+ (re1 (concat "^" (regexp-quote comment-start) orgtbl-line-start-regexp))
+ (re2 (concat "^" orgtbl-line-start-regexp))
+ (commented (save-excursion (beginning-of-line 1)
+ (cond ((looking-at re1) t)
+ ((looking-at re2) nil)
+ (t (user-error "Not at an org table")))))
+ (re (if commented re1 re2))
+ beg end)
+ (save-excursion
+ (beginning-of-line 1)
+ (while (looking-at re) (beginning-of-line 0))
+ (beginning-of-line 2)
+ (setq beg (point))
+ (while (looking-at re) (beginning-of-line 2))
+ (setq end (point)))
+ (comment-region beg end (if commented '(4) nil))))
+
+(defun orgtbl-insert-radio-table ()
+ "Insert a radio table template appropriate for this major mode."
+ (interactive)
+ (let* ((e (cl-assoc-if #'derived-mode-p orgtbl-radio-table-templates))
+ (txt (nth 1 e))
+ name pos)
+ (unless e (user-error "No radio table setup defined for %s" major-mode))
+ (setq name (read-string "Table 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)))
+
+;;;###autoload
+(defun orgtbl-to-generic (table params)
+ "Convert the `orgtbl-mode' TABLE to some other format.
+
+This generic routine can be used for many standard cases.
+
+TABLE is a list, each entry either the symbol `hline' for
+a horizontal separator line, or a list of fields for that
+line. PARAMS is a property list of parameters that can
+influence the conversion.
+
+Valid parameters are:
+
+:backend, :raw
+
+ Export back-end used as a basis to transcode elements of the
+ table, when no specific parameter applies to it. It is also
+ used to translate cells contents. You can prevent this by
+ setting :raw property to a non-nil value.
+
+:splice
+
+ When non-nil, only convert rows, not the table itself. This is
+ equivalent to setting to the empty string both :tstart
+ and :tend, which see.
+
+:skip
+
+ When set to an integer N, skip the first N lines of the table.
+ Horizontal separation lines do count for this parameter!
+
+:skipcols
+
+ List of columns that should be skipped. If the table has
+ a column with calculation marks, that column is automatically
+ discarded beforehand.
+
+:hline
+
+ String to be inserted on horizontal separation lines. May be
+ nil to ignore these lines altogether.
+
+:sep
+
+ Separator between two fields, as a string.
+
+Each in the following group may be either a string or a function
+of no arguments returning a string:
+
+:tstart, :tend
+
+ Strings to start and end the table. Ignored when :splice is t.
+
+:lstart, :lend
+
+ Strings to start and end a new table line.
+
+:llstart, :llend
+
+ Strings to start and end the last table line. Default,
+ respectively, to :lstart and :lend.
+
+Each in the following group may be a string or a function of one
+argument (either the cells in the current row, as a list of
+strings, or the current cell) returning a string:
+
+:lfmt
+
+ Format string for an entire row, with enough %s to capture all
+ fields. When non-nil, :lstart, :lend, and :sep are ignored.
+
+:llfmt
+
+ Format for the entire last line, defaults to :lfmt.
+
+:fmt
+
+ A format to be used to wrap the field, should contain %s for
+ the original field value. For example, to wrap everything in
+ dollars, you could use :fmt \"$%s$\". This may also be
+ a property list with column numbers and format strings, or
+ functions, e.g.,
+
+ (:fmt (2 \"$%s$\" 4 (lambda (c) (format \"$%s$\" c))))
+
+:hlstart :hllstart :hlend :hllend :hsep :hlfmt :hllfmt :hfmt
+
+ Same as above, specific for the header lines in the table.
+ All lines before the first hline are treated as header. If
+ any of these is not present, the data line value is used.
+
+This may be either a string or a function of two arguments:
+
+:efmt
+
+ Use this format to print numbers with exponential. The format
+ 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 format strings or functions.
+ :fmt will still be applied after :efmt."
+ ;; Make sure `org-export-create-backend' is available.
+ (require 'ox)
+ (let* ((backend (plist-get params :backend))
+ (custom-backend
+ ;; Build a custom back-end according to PARAMS. Before
+ ;; defining a translator, check if there is anything to do.
+ ;; When there isn't, let BACKEND handle the element.
+ (org-export-create-backend
+ :parent (or backend 'org)
+ :transcoders
+ `((table . ,(org-table--to-generic-table params))
+ (table-row . ,(org-table--to-generic-row params))
+ (table-cell . ,(org-table--to-generic-cell params))
+ ;; Macros are not going to be expanded. However, no
+ ;; regular back-end has a transcoder for them. We
+ ;; provide one so they are not ignored, but displayed
+ ;; as-is instead.
+ (macro . (lambda (m c i) (org-element-macro-interpreter m nil))))))
+ data info)
+ ;; Store TABLE as Org syntax in DATA. Tolerate non-string cells.
+ ;; Initialize communication channel in INFO.
+ (with-temp-buffer
+ (let ((org-inhibit-startup t)) (org-mode))
+ (let ((standard-output (current-buffer))
+ (org-element-use-cache nil))
+ (dolist (e table)
+ (cond ((eq e 'hline) (princ "|--\n"))
+ ((consp e)
+ (princ "| ") (dolist (c e) (princ c) (princ " |"))
+ (princ "\n")))))
+ ;; Add back-end specific filters, but not user-defined ones. In
+ ;; particular, make sure to call parse-tree filters on the
+ ;; table.
+ (setq info
+ (let ((org-export-filters-alist nil))
+ (org-export-install-filters
+ (org-combine-plists
+ (org-export-get-environment backend nil params)
+ `(:back-end ,(org-export-get-backend backend))))))
+ (setq data
+ (org-export-filter-apply-functions
+ (plist-get info :filter-parse-tree)
+ (org-element-map (org-element-parse-buffer) 'table
+ #'identity nil t)
+ info)))
+ (when (and backend (symbolp backend) (not (org-export-get-backend backend)))
+ (user-error "Unknown :backend value"))
+ (when (or (not backend) (plist-get info :raw)) (require 'ox-org))
+ ;; Handle :skip parameter.
+ (let ((skip (plist-get info :skip)))
+ (when skip
+ (unless (wholenump skip) (user-error "Wrong :skip value"))
+ (let ((n 0))
+ (org-element-map data 'table-row
+ (lambda (row)
+ (if (>= n skip) t
+ (org-element-extract-element row)
+ (cl-incf n)
+ nil))
+ nil t))))
+ ;; Handle :skipcols parameter.
+ (let ((skipcols (plist-get info :skipcols)))
+ (when skipcols
+ (unless (consp skipcols) (user-error "Wrong :skipcols value"))
+ (org-element-map data 'table
+ (lambda (table)
+ (let ((specialp (org-export-table-has-special-column-p table)))
+ (dolist (row (org-element-contents table))
+ (when (eq (org-element-property :type row) 'standard)
+ (let ((c 1))
+ (dolist (cell (nthcdr (if specialp 1 0)
+ (org-element-contents row)))
+ (when (memq c skipcols)
+ (org-element-extract-element cell))
+ (cl-incf c))))))))))
+ ;; Since we are going to export using a low-level mechanism,
+ ;; ignore special column and special rows manually.
+ (let ((special? (org-export-table-has-special-column-p data))
+ ignore)
+ (org-element-map data (if special? '(table-cell table-row) 'table-row)
+ (lambda (datum)
+ (when (if (eq (org-element-type datum) 'table-row)
+ (org-export-table-row-is-special-p datum nil)
+ (org-export-first-sibling-p datum nil))
+ (push datum ignore))))
+ (setq info (plist-put info :ignore-list ignore)))
+ ;; We use a low-level mechanism to export DATA so as to skip all
+ ;; usual pre-processing and post-processing, i.e., hooks, Babel
+ ;; code evaluation, include keywords and macro expansion. Only
+ ;; back-end specific filters are retained.
+ (let ((output (org-export-data-with-backend data custom-backend info)))
+ ;; Remove final newline.
+ (if (org-string-nw-p output) (substring-no-properties output 0 -1) ""))))
+
+(defun org-table--generic-apply (value name &optional with-cons &rest args)
+ (cond ((null value) nil)
+ ((functionp value) `(funcall ',value ,@args))
+ ((stringp value)
+ (cond ((consp (car args)) `(apply #'format ,value ,@args))
+ (args `(format ,value ,@args))
+ (t value)))
+ ((and with-cons (consp value))
+ `(let ((val (cadr (memq column ',value))))
+ (cond ((null val) contents)
+ ((stringp val) (format val ,@args))
+ ((functionp val) (funcall val ,@args))
+ (t (user-error "Wrong %s value" ,name)))))
+ (t (user-error "Wrong %s value" name))))
+
+(defun org-table--to-generic-table (params)
+ "Return custom table transcoder according to PARAMS.
+PARAMS is a plist. See `orgtbl-to-generic' for more
+information."
+ (let ((backend (plist-get params :backend))
+ (splice (plist-get params :splice))
+ (tstart (plist-get params :tstart))
+ (tend (plist-get params :tend)))
+ `(lambda (table contents info)
+ (concat
+ ,(and tstart (not splice)
+ `(concat ,(org-table--generic-apply tstart ":tstart") "\n"))
+ ,(if (or (not backend) tstart tend splice) 'contents
+ `(org-export-with-backend ',backend table contents info))
+ ,(org-table--generic-apply (and (not splice) tend) ":tend")))))
+
+(defun org-table--to-generic-row (params)
+ "Return custom table row transcoder according to PARAMS.
+PARAMS is a plist. See `orgtbl-to-generic' for more
+information."
+ (let* ((backend (plist-get params :backend))
+ (lstart (plist-get params :lstart))
+ (llstart (plist-get params :llstart))
+ (hlstart (plist-get params :hlstart))
+ (hllstart (plist-get params :hllstart))
+ (lend (plist-get params :lend))
+ (llend (plist-get params :llend))
+ (hlend (plist-get params :hlend))
+ (hllend (plist-get params :hllend))
+ (lfmt (plist-get params :lfmt))
+ (llfmt (plist-get params :llfmt))
+ (hlfmt (plist-get params :hlfmt))
+ (hllfmt (plist-get params :hllfmt)))
+ `(lambda (row contents info)
+ (if (eq (org-element-property :type row) 'rule)
+ ,(cond
+ ((plist-member params :hline)
+ (org-table--generic-apply (plist-get params :hline) ":hline"))
+ (backend `(org-export-with-backend ',backend row nil info)))
+ (let ((headerp ,(and (or hlfmt hlstart hlend)
+ '(org-export-table-row-in-header-p row info)))
+ (last-header-p
+ ,(and (or hllfmt hllstart hllend)
+ '(org-export-table-row-ends-header-p row info)))
+ (lastp (not (org-export-get-next-element row info))))
+ (when contents
+ ;; Check if we can apply `:lfmt', `:llfmt', `:hlfmt', or
+ ;; `:hllfmt' to CONTENTS. Otherwise, fallback on
+ ;; `:lstart', `:lend' and their relatives.
+ ,(let ((cells
+ '(org-element-map row 'table-cell
+ (lambda (cell)
+ ;; Export all cells, without separators.
+ ;;
+ ;; Use `org-export-data-with-backend'
+ ;; instead of `org-export-data' to eschew
+ ;; cached values, which
+ ;; ignore :orgtbl-ignore-sep parameter.
+ (org-export-data-with-backend
+ cell
+ (plist-get info :back-end)
+ (org-combine-plists info '(:orgtbl-ignore-sep t))))
+ info)))
+ `(cond
+ ,(and hllfmt
+ `(last-header-p ,(org-table--generic-apply
+ hllfmt ":hllfmt" nil cells)))
+ ,(and hlfmt
+ `(headerp ,(org-table--generic-apply
+ hlfmt ":hlfmt" nil cells)))
+ ,(and llfmt
+ `(lastp ,(org-table--generic-apply
+ llfmt ":llfmt" nil cells)))
+ (t
+ ,(if lfmt (org-table--generic-apply lfmt ":lfmt" nil cells)
+ `(concat
+ (cond
+ ,(and
+ (or hllstart hllend)
+ `(last-header-p
+ (concat
+ ,(org-table--generic-apply hllstart ":hllstart")
+ contents
+ ,(org-table--generic-apply hllend ":hllend"))))
+ ,(and
+ (or hlstart hlend)
+ `(headerp
+ (concat
+ ,(org-table--generic-apply hlstart ":hlstart")
+ contents
+ ,(org-table--generic-apply hlend ":hlend"))))
+ ,(and
+ (or llstart llend)
+ `(lastp
+ (concat
+ ,(org-table--generic-apply llstart ":llstart")
+ contents
+ ,(org-table--generic-apply llend ":llend"))))
+ (t
+ ,(cond
+ ((or lstart lend)
+ `(concat
+ ,(org-table--generic-apply lstart ":lstart")
+ contents
+ ,(org-table--generic-apply lend ":lend")))
+ (backend
+ `(org-export-with-backend
+ ',backend row contents info))
+ (t 'contents)))))))))))))))
+
+(defun org-table--to-generic-cell (params)
+ "Return custom table cell transcoder according to PARAMS.
+PARAMS is a plist. See `orgtbl-to-generic' for more
+information."
+ (let* ((backend (plist-get params :backend))
+ (efmt (plist-get params :efmt))
+ (fmt (plist-get params :fmt))
+ (hfmt (plist-get params :hfmt))
+ (sep (plist-get params :sep))
+ (hsep (plist-get params :hsep)))
+ `(lambda (cell contents info)
+ ;; Make sure that contents are exported as Org data when :raw
+ ;; parameter is non-nil.
+ ,(when (and backend (plist-get params :raw))
+ `(setq contents
+ ;; Since we don't know what are the pseudo object
+ ;; types defined in backend, we cannot pass them to
+ ;; `org-element-interpret-data'. As a consequence,
+ ;; they will be treated as pseudo elements, and will
+ ;; have newlines appended instead of spaces.
+ ;; Therefore, we must make sure :post-blank value is
+ ;; really turned into spaces.
+ (replace-regexp-in-string
+ "\n" " "
+ (org-trim
+ (org-element-interpret-data
+ (org-element-contents cell))))))
+
+ (let ((headerp ,(and (or hfmt hsep)
+ '(org-export-table-row-in-header-p
+ (org-export-get-parent-element cell) info)))
+ (column
+ ;; Call costly `org-export-table-cell-address' only if
+ ;; absolutely necessary, i.e., if one
+ ;; of :fmt :efmt :hfmt has a "plist type" value.
+ ,(and (cl-some (lambda (v) (integerp (car-safe v)))
+ (list efmt hfmt fmt))
+ '(1+ (cdr (org-export-table-cell-address cell info))))))
+ (when contents
+ ;; Check if we can apply `:efmt' on CONTENTS.
+ ,(when efmt
+ `(when (string-match orgtbl-exp-regexp contents)
+ (let ((mantissa (match-string 1 contents))
+ (exponent (match-string 2 contents)))
+ (setq contents ,(org-table--generic-apply
+ efmt ":efmt" t 'mantissa 'exponent)))))
+ ;; Check if we can apply FMT (or HFMT) on CONTENTS.
+ (cond
+ ,(and hfmt `(headerp (setq contents ,(org-table--generic-apply
+ hfmt ":hfmt" t 'contents))))
+ ,(and fmt `(t (setq contents ,(org-table--generic-apply
+ fmt ":fmt" t 'contents))))))
+ ;; If a separator is provided, use it instead of BACKEND's.
+ ;; Separators are ignored when LFMT (or equivalent) is
+ ;; provided.
+ ,(cond
+ ((or hsep sep)
+ `(if (or ,(and (not sep) '(not headerp))
+ (plist-get info :orgtbl-ignore-sep)
+ (not (org-export-get-next-element cell info)))
+ ,(if (not backend) 'contents
+ `(org-export-with-backend ',backend cell contents info))
+ (concat contents
+ ,(if (and sep hsep) `(if headerp ,hsep ,sep)
+ (or hsep sep)))))
+ (backend `(org-export-with-backend ',backend cell contents info))
+ (t 'contents))))))
+
+;;;###autoload
+(defun orgtbl-to-tsv (table params)
+ "Convert the `orgtbl-mode' TABLE to TAB separated material."
+ (orgtbl-to-generic table (org-combine-plists '(:sep "\t") params)))
+
+;;;###autoload
+(defun orgtbl-to-csv (table params)
+ "Convert the `orgtbl-mode' TABLE to CSV material.
+This does take care of the proper quoting of fields with comma or quotes."
+ (orgtbl-to-generic table
+ (org-combine-plists '(:sep "," :fmt org-quote-csv-field)
+ params)))
+
+;;;###autoload
+(defun orgtbl-to-latex (table params)
+ "Convert the `orgtbl-mode' TABLE to LaTeX.
+
+TABLE is a list, each entry either the symbol `hline' for
+a horizontal separator line, or a list of fields for that line.
+PARAMS is a property list of parameters that can influence the
+conversion. All parameters from `orgtbl-to-generic' are
+supported. It is also possible to use the following ones:
+
+:booktabs
+
+ When non-nil, use formal \"booktabs\" style.
+
+:environment
+
+ Specify environment to use, as a string. If you use
+ \"longtable\", you may also want to specify :language property,
+ as a string, to get proper continuation strings."
+ (require 'ox-latex)
+ (orgtbl-to-generic
+ table
+ (org-combine-plists
+ ;; Provide sane default values.
+ (list :backend 'latex
+ :latex-default-table-mode 'table
+ :latex-tables-centered nil
+ :latex-tables-booktabs (plist-get params :booktabs)
+ :latex-table-scientific-notation nil
+ :latex-default-table-environment
+ (or (plist-get params :environment) "tabular"))
+ params)))
+
+;;;###autoload
+(defun orgtbl-to-html (table params)
+ "Convert the `orgtbl-mode' TABLE to HTML.
+
+TABLE is a list, each entry either the symbol `hline' for
+a horizontal separator line, or a list of fields for that line.
+PARAMS is a property list of parameters that can influence the
+conversion. All parameters from `orgtbl-to-generic' are
+supported. It is also possible to use the following one:
+
+:attributes
+
+ Attributes and values, as a plist, which will be used in
+ <table> tag."
+ (require 'ox-html)
+ (orgtbl-to-generic
+ table
+ (org-combine-plists
+ ;; Provide sane default values.
+ (list :backend 'html
+ :html-table-data-tags '("<td%s>" . "</td>")
+ :html-table-use-header-tags-for-first-column nil
+ :html-table-align-individual-fields t
+ :html-table-row-tags '("<tr>" . "</tr>")
+ :html-table-attributes
+ (if (plist-member params :attributes)
+ (plist-get params :attributes)
+ '(:border "2" :cellspacing "0" :cellpadding "6" :rules "groups"
+ :frame "hsides")))
+ params)))
+
+;;;###autoload
+(defun orgtbl-to-texinfo (table params)
+ "Convert the `orgtbl-mode' TABLE to Texinfo.
+
+TABLE is a list, each entry either the symbol `hline' for
+a horizontal separator line, or a list of fields for that line.
+PARAMS is a property list of parameters that can influence the
+conversion. All parameters from `orgtbl-to-generic' are
+supported. It is also possible to use the following one:
+
+:columns
+
+ Column widths, as a string. When providing column fractions,
+ \"@columnfractions\" command can be omitted."
+ (require 'ox-texinfo)
+ (let ((output
+ (orgtbl-to-generic
+ table
+ (org-combine-plists
+ (list :backend 'texinfo
+ :texinfo-tables-verbatim nil
+ :texinfo-table-scientific-notation nil)
+ params)))
+ (columns (let ((w (plist-get params :columns)))
+ (cond ((not w) nil)
+ ((string-match-p "{\\|@columnfractions " w) w)
+ (t (concat "@columnfractions " w))))))
+ (if (not columns) output
+ (replace-regexp-in-string
+ "@multitable \\(.*\\)" columns output t nil 1))))
+
+;;;###autoload
+(defun orgtbl-to-orgtbl (table params)
+ "Convert the `orgtbl-mode' TABLE into another orgtbl-mode table.
+
+TABLE is a list, each entry either the symbol `hline' for
+a horizontal separator line, or a list of fields for that line.
+PARAMS is a property list of parameters that can influence the
+conversion. All parameters from `orgtbl-to-generic' are
+supported.
+
+Useful when slicing one table into many. The :hline, :sep,
+:lstart, and :lend provide orgtbl framing. :tstart and :tend can
+be set to provide ORGTBL directives for the generated table."
+ (require 'ox-org)
+ (orgtbl-to-generic table (org-combine-plists params (list :backend 'org))))
+
+(defun orgtbl-to-table.el (table params)
+ "Convert the `orgtbl-mode' TABLE into a table.el table.
+TABLE is a list, each entry either the symbol `hline' for
+a horizontal separator line, or a list of fields for that line.
+PARAMS is a property list of parameters that can influence the
+conversion. All parameters from `orgtbl-to-generic' are
+supported."
+ (with-temp-buffer
+ (insert (orgtbl-to-orgtbl table params))
+ (org-table-align)
+ (replace-regexp-in-string
+ "-|" "-+"
+ (replace-regexp-in-string "|-" "+-" (buffer-substring 1 (buffer-size))))))
+
+(defun orgtbl-to-unicode (table params)
+ "Convert the `orgtbl-mode' TABLE into a table with unicode characters.
+
+TABLE is a list, each entry either the symbol `hline' for
+a horizontal separator line, or a list of fields for that line.
+PARAMS is a property list of parameters that can influence the
+conversion. All parameters from `orgtbl-to-generic' are
+supported. It is also possible to use the following ones:
+
+:ascii-art
+
+ When non-nil, use \"ascii-art-to-unicode\" package to translate
+ the table. You can download it here:
+ https://gnuvola.org/software/j/aa2u/ascii-art-to-unicode.el.
+
+:narrow
+
+ When non-nil, narrow columns width than provided width cookie,
+ using \"=>\" as an ellipsis, just like in an Org mode buffer."
+ (require 'ox-ascii)
+ (orgtbl-to-generic
+ table
+ (org-combine-plists
+ (list :backend 'ascii
+ :ascii-charset 'utf-8
+ :ascii-table-widen-columns (not (plist-get params :narrow))
+ :ascii-table-use-ascii-art (plist-get params :ascii-art))
+ params)))
+
+;; Put the cursor in a column containing numerical values
+;; of an Org table,
+;; type C-c " a
+;; A new column is added with a bar plot.
+;; When the table is refreshed (C-u C-c *),
+;; the plot is updated to reflect the new values.
+
+(defun orgtbl-ascii-draw (value min max &optional width characters)
+ "Draw an ascii bar in a table.
+VALUE is the value to plot, it determines the width of the bar to draw.
+MIN is the value that will be displayed as empty (zero width bar).
+MAX is the value that will draw a bar filling all the WIDTH.
+WIDTH is the span in characters from MIN to MAX.
+CHARACTERS is a string that will compose the bar, with shades of grey
+from pure white to pure black. It defaults to a 10 characters string
+of regular ascii characters."
+ (let* ((width (ceiling (or width 12)))
+ (characters (or characters " .:;c!lhVHW"))
+ (len (1- (length characters)))
+ (value (float (if (numberp value)
+ value (string-to-number value))))
+ (relative (/ (- value min) (- max min)))
+ (steps (round (* relative width len))))
+ (cond ((< steps 0) "too small")
+ ((> steps (* width len)) "too large")
+ (t (let* ((int-division (/ steps len))
+ (remainder (- steps (* int-division len))))
+ (concat (make-string int-division (elt characters len))
+ (string (elt characters remainder))))))))
+
+;;;###autoload
+(defun orgtbl-ascii-plot (&optional ask)
+ "Draw an ASCII bar plot in a column.
+
+With cursor in a column containing numerical values, this function
+will draw a plot in a new column.
+
+ASK, if given, is a numeric prefix to override the default 12
+characters width of the plot. ASK may also be the `\\[universal-argument]' \
+prefix,
+which will prompt for the width."
+ (interactive "P")
+ (let ((col (org-table-current-column))
+ (min 1e999) ; 1e999 will be converted to infinity
+ (max -1e999) ; which is the desired result
+ (table (org-table-to-lisp))
+ (length
+ (cond ((consp ask)
+ (read-number "Length of column " 12))
+ ((numberp ask) ask)
+ (t 12))))
+ ;; Skip any hline a the top of table.
+ (while (eq (car table) 'hline) (pop table))
+ ;; Skip table header if any.
+ (dolist (x (or (cdr (memq 'hline table)) table))
+ (when (consp x)
+ (setq x (nth (1- col) x))
+ (when (string-match
+ "^[-+]?\\([0-9]*[.]\\)?[0-9]*\\([eE][+-]?[0-9]+\\)?$"
+ x)
+ (setq x (string-to-number x))
+ (when (> min x) (setq min x))
+ (when (< max x) (setq max x)))))
+ (org-table-insert-column)
+ (org-table-move-column-right)
+ (org-table-store-formulas
+ (cons
+ (cons
+ (concat "$" (number-to-string (1+ col)))
+ (format "'(%s $%s %s %s %s)"
+ "orgtbl-ascii-draw" col min max length))
+ (org-table-get-stored-formulas)))
+ (org-table-recalculate t)))
+
+;; Example of extension: unicode characters
+;; Here are two examples of different styles.
+
+;; Unicode block characters are used to give a smooth effect.
+;; See https://en.wikipedia.org/wiki/Block_Elements
+;; Use one of those drawing functions
+;; - orgtbl-ascii-draw (the default ascii)
+;; - orgtbl-uc-draw-grid (unicode with a grid effect)
+;; - orgtbl-uc-draw-cont (smooth unicode)
+
+;; This is best viewed with the "DejaVu Sans Mono" 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.
+It is a variant of `orgtbl-ascii-draw' with Unicode block
+characters, for a smooth display. Bars appear as grids (to the
+extent the font allows)."
+ ;; https://en.wikipedia.org/wiki/Block_Elements
+ ;; best viewed with the "DejaVu Sans Mono" font.
+ (orgtbl-ascii-draw value min max width
+ " \u258F\u258E\u258D\u258C\u258B\u258A\u2589"))
+
+(defun orgtbl-uc-draw-cont (value min max &optional width)
+ "Draw a bar in a table using block unicode characters.
+It is a variant of `orgtbl-ascii-draw' with Unicode block
+characters, for a smooth display. Bars are solid (to the extent
+the font allows)."
+ (orgtbl-ascii-draw value min max width
+ " \u258F\u258E\u258D\u258C\u258B\u258A\u2589\u2588"))
+
+(defun org-table-get-remote-range (name-or-id form)
+ "Get a field value or a list of values in a range from table at ID.
+
+NAME-OR-ID may be the name of a table in the current file as set
+by a \"#+NAME:\" directive. The first table following this line
+will then be used. Alternatively, it may be an ID referring to
+any entry, also in a different file. In this case, the first
+table in that entry will be referenced.
+FORM is a field or range descriptor like \"@2$3\" or \"B3\" or
+\"@I$2..@II$2\". All the references must be absolute, not relative.
+
+The return value is either a single string for a single field, or a
+list of the fields in the rectangle."
+ (save-match-data
+ (let ((case-fold-search t) (id-loc nil)
+ ;; Protect a bunch of variables from being overwritten by
+ ;; the context of the remote table.
+ org-table-column-names org-table-column-name-regexp
+ org-table-local-parameters org-table-named-field-locations
+ org-table-current-line-types
+ org-table-current-begin-pos org-table-dlines
+ org-table-current-ncol
+ 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
+ (goto-char (point-min))
+ (if (re-search-forward
+ (concat "^[ \t]*#\\+\\(tbl\\)?name:[ \t]*"
+ (regexp-quote name-or-id) "[ \t]*$")
+ nil t)
+ (setq buffer (current-buffer) loc (match-beginning 0))
+ (setq id-loc (org-id-find name-or-id 'marker))
+ (unless (and id-loc (markerp id-loc))
+ (user-error "Can't find remote table \"%s\"" name-or-id))
+ (setq buffer (marker-buffer id-loc)
+ loc (marker-position id-loc))
+ (move-marker id-loc nil))
+ (with-current-buffer buffer
+ (org-with-wide-buffer
+ (goto-char loc)
+ (forward-char 1)
+ (unless (and (re-search-forward "^\\(\\*+ \\)\\|^[ \t]*|" nil t)
+ (not (match-beginning 1)))
+ (user-error "Cannot find a table at NAME or ID %s" name-or-id))
+ (org-table-analyze)
+ (setq form (org-table-formula-substitute-names
+ (org-table-formula-handle-first/last-rc form)))
+ (if (and (string-match org-table-range-regexp form)
+ (> (length (match-string 0 form)) 1))
+ (org-table-get-range
+ (match-string 0 form) org-table-current-begin-pos 1)
+ form)))))))
+
+(defun org-table-remote-reference-indirection (form)
+ "Return formula with table remote references substituted by indirection.
+For example \"remote($1, @>$2)\" => \"remote(year_2013, @>$1)\".
+This indirection works only with the format @ROW$COLUMN. The
+format \"B3\" is not supported because it can not be
+distinguished from a plain table name or ID."
+ (let ((regexp
+ ;; Same as in `org-table-eval-formula'.
+ (concat "\\<remote([ \t]*\\("
+ ;; Allow "$1", "@<", "$-1", "@<<$1" etc.
+ "[@$][^ \t,]+"
+ "\\)[ \t]*,[ \t]*\\([^\n)]+\\))")))
+ (replace-regexp-in-string
+ regexp
+ (lambda (m)
+ (save-match-data
+ (let ((eq (org-table-formula-handle-first/last-rc (match-string 1 m))))
+ (org-table-get-range
+ (if (string-match-p "\\`\\$[0-9]+\\'" eq)
+ (concat "@0" eq)
+ eq)))))
+ form t t 1)))
+
+(defmacro org-define-lookup-function (mode)
+ (let ((mode-str (symbol-name mode))
+ (first-p (eq mode 'first))
+ (all-p (eq mode 'all)))
+ (let ((plural-str (if all-p "s" "")))
+ `(defun ,(intern (format "org-lookup-%s" mode-str)) (val s-list r-list &optional predicate)
+ ,(format "Find %s occurrence%s of VAL in S-LIST; return corresponding element%s of R-LIST.
+If R-LIST is nil, return matching element%s of S-LIST.
+If PREDICATE is not nil, use it instead of `equal' to match VAL.
+Matching is done by (PREDICATE VAL S), where S is an element of S-LIST.
+This function is generated by a call to the macro `org-define-lookup-function'."
+ mode-str plural-str plural-str plural-str)
+ (let ,(let ((lvars '((p (or predicate 'equal))
+ (sl s-list)
+ (rl (or r-list s-list))
+ (ret nil))))
+ (if first-p (cons '(match-p nil) lvars) lvars))
+ (while ,(if first-p '(and (not match-p) sl) 'sl)
+ (when (funcall p val (car sl))
+ ,(when first-p '(setq match-p t))
+ (let ((rval (car rl)))
+ (setq ret ,(if all-p '(append ret (list rval)) 'rval))))
+ (setq sl (cdr sl) rl (cdr rl)))
+ ret)))))
+
+(org-define-lookup-function first)
+(org-define-lookup-function last)
+(org-define-lookup-function all)
+
+(provide 'org-table)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-table.el ends here
diff --git a/elpa/org-9.5.2/org-table.elc b/elpa/org-9.5.2/org-table.elc
new file mode 100644
index 0000000..ffb9f72
--- /dev/null
+++ b/elpa/org-9.5.2/org-table.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-tempo.el b/elpa/org-9.5.2/org-tempo.el
new file mode 100644
index 0000000..c121b8e
--- /dev/null
+++ b/elpa/org-9.5.2/org-tempo.el
@@ -0,0 +1,188 @@
+;;; org-tempo.el --- Template expansion for Org structures -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
+;;
+;; Author: Rasmus Pank Roulund <emacs at pank dot eu>
+;; 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 <https://www.gnu.org/licenses/>.
+;;
+;;; 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 "<e" at the beginning of the line will be
+;; expanded to an example block.
+;;
+;; All blocks defined in `org-structure-template-alist' are added as
+;; Org Tempo shortcuts, in addition to keywords defined in
+;; `org-tempo-keywords-alist'.
+;;
+;; `tempo' can also be used to define more sophisticated keywords
+;; completions. See the section "Additional keywords" below for
+;; examples.
+;;
+;;; Code:
+
+(require 'tempo)
+(require 'cl-lib)
+(require 'org)
+
+(defvar org-structure-template-alist)
+
+
+(defgroup org-tempo nil
+ "Template expansion of Org structures."
+ :tag "Org structure"
+ :group 'org)
+
+(defvar org-tempo-tags nil
+ "Tempo tags for Org mode.")
+
+(defcustom org-tempo-keywords-alist
+ '(("L" . "latex")
+ ("H" . "html")
+ ("A" . "ascii")
+ ("i" . "index"))
+ "Keyword completion elements.
+
+This is an alist of KEY characters and corresponding KEYWORDS,
+just like `org-structure-template-alist'. The tempo snippet
+\"<KEY\" will be expanded using the KEYWORD value. For example
+\"<L\" at the beginning of a line is expanded to \"#+latex:\".
+
+Do not use \"I\" as a KEY, as it is reserved for expanding
+\"#+include\"."
+ :group 'org-tempo
+ :type '(repeat (cons (string :tag "Key")
+ (string :tag "Keyword")))
+ :package-version '(Org . "9.2"))
+
+
+
+;;; Org Tempo functions and setup.
+
+(defun org-tempo-setup ()
+ "Setup tempo tags and match finder for the current buffer."
+ (org-tempo--update-maybe)
+ (tempo-use-tag-list 'org-tempo-tags)
+ (setq-local tempo-match-finder "^ *\\(<[[:word:]]+\\)\\="))
+
+(defun org-tempo--keys ()
+ "Return a list of all Org Tempo expansion strings, like \"<s\"."
+ (mapcar (lambda (pair) (format "<%s" (car pair)))
+ (append org-structure-template-alist
+ org-tempo-keywords-alist)))
+
+(defun org-tempo--update-maybe ()
+ "Check and add new Org Tempo templates if necessary.
+In particular, if new entries were added to
+`org-structure-template-alist' or `org-tempo-keywords-alist', new
+Tempo templates will be added."
+ (unless (cl-every (lambda (key) (assoc key org-tempo-tags))
+ (org-tempo--keys))
+ (org-tempo-add-templates)))
+
+(defun org-tempo-add-templates ()
+ "Update all Org Tempo templates.
+
+Go through `org-structure-template-alist' and
+`org-tempo-keywords-alist' and update tempo templates."
+ (mapc 'org--check-org-structure-template-alist '(org-structure-template-alist
+ org-tempo-keywords-alist))
+ (let ((keys (org-tempo--keys)))
+ ;; Check for duplicated snippet keys and warn if any are found.
+ (when (> (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 "<I")
+ (setq quit-flag nil))))
+
+(tempo-define-template "org-include"
+ '((org-tempo--include-file)
+ p >)
+ "<I"
+ "Include keyword"
+ 'org-tempo-tags)
+
+;;; Setup of Org Tempo
+;;
+;; Org Tempo is set up with each new Org buffer and potentially in the
+;; current Org buffer.
+
+(add-hook 'org-mode-hook 'org-tempo-setup)
+(add-hook 'org-tab-before-tab-emulation-hook 'org-tempo-complete-tag)
+
+;; Enable Org Tempo in all open Org buffers.
+(dolist (b (org-buffer-list 'files))
+ (with-current-buffer b (org-tempo-setup)))
+
+(provide 'org-tempo)
+
+;;; org-tempo.el ends here
diff --git a/elpa/org-9.5.2/org-tempo.elc b/elpa/org-9.5.2/org-tempo.elc
new file mode 100644
index 0000000..da9bb85
--- /dev/null
+++ b/elpa/org-9.5.2/org-tempo.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-timer.el b/elpa/org-9.5.2/org-timer.el
new file mode 100644
index 0000000..bfcea44
--- /dev/null
+++ b/elpa/org-9.5.2/org-timer.el
@@ -0,0 +1,494 @@
+;;; org-timer.el --- Timer code for Org mode -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+
+;; This file implements two types of timers for Org buffers:
+;;
+;; - A relative timer that counts up (from 0 or a specified offset)
+;; - A countdown timer that counts down from a specified time
+;;
+;; The relative and countdown timers differ in their entry points.
+;; Use `org-timer' or `org-timer-start' to start the relative timer,
+;; and `org-timer-set-timer' to start the countdown timer.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'org-clock)
+
+(declare-function org-agenda-error "org-agenda" ())
+
+(defvar org-timer-start-time nil
+ "t=0 for the running timer.")
+
+(defvar org-timer-pause-time nil
+ "Time when the timer was paused.")
+
+(defvar org-timer-countdown-timer nil
+ "Current countdown timer.
+This is a timer object if there is an active countdown timer,
+`paused' if there is a paused countdown timer, and nil
+otherwise.")
+
+(defvar org-timer-countdown-timer-title nil
+ "Title for notification displayed when a countdown finishes.")
+
+(defconst org-timer-re "\\([-+]?[0-9]+\\):\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)"
+ "Regular expression used to match timer stamps.")
+
+(defcustom org-timer-format "%s "
+ "The format to insert the time of the timer.
+This format must contain one instance of \"%s\" which will be replaced by
+the value of the timer."
+ :group 'org-time
+ :type 'string)
+
+(defcustom org-timer-default-timer "0"
+ "The default timer when a timer is set, in minutes or hh:mm:ss format.
+When 0, the user is prompted for a value."
+ :group 'org-time
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'string)
+
+(defcustom org-timer-display 'mode-line
+ "Define where running timer is displayed, if at all.
+When a timer is running, Org can display it in the mode line
+and/or frame title. Allowed values are:
+
+both displays in both mode line and frame title
+mode-line displays only in mode line (default)
+frame-title displays only in frame title
+nil current timer is not displayed"
+ :group 'org-time
+ :type '(choice
+ (const :tag "Mode line" mode-line)
+ (const :tag "Frame title" frame-title)
+ (const :tag "Both" both)
+ (const :tag "None" nil)))
+
+(defvar org-timer-start-hook nil
+ "Hook run after relative timer is started.")
+
+(defvar org-timer-stop-hook nil
+ "Hook run before relative or countdown timer is stopped.")
+
+(defvar org-timer-pause-hook nil
+ "Hook run before relative or countdown timer is paused.")
+
+(defvar org-timer-continue-hook nil
+ "Hook run after relative or countdown timer is continued.")
+
+(defvar org-timer-set-hook nil
+ "Hook run after countdown timer is set.")
+
+(defvar org-timer-done-hook nil
+ "Hook run after countdown timer reaches zero.")
+
+;;;###autoload
+(defun org-timer-start (&optional offset)
+ "Set the starting time for the relative timer to now.
+When called with prefix argument OFFSET, prompt the user for an offset time,
+with the default taken from a timer stamp at point, if any.
+If OFFSET is a string or an integer, it is directly taken to be the offset
+without user interaction.
+When called with a double prefix arg, all timer strings in the active
+region will be shifted by a specific amount. You will be prompted for
+the amount, with the default to make the first timer string in
+the region 0:00:00."
+ (interactive "P")
+ (cond
+ ((equal offset '(16))
+ (call-interactively 'org-timer-change-times-in-region))
+ (org-timer-countdown-timer
+ (user-error "Countdown timer is running. Cancel first"))
+ (t
+ (let (delta def s)
+ (if (not offset)
+ (setq org-timer-start-time (current-time))
+ (cond
+ ((integerp offset) (setq delta offset))
+ ((stringp offset) (setq delta (org-timer-hms-to-secs offset)))
+ (t
+ (setq def (if (org-in-regexp org-timer-re)
+ (match-string 0)
+ "0:00:00")
+ s (read-string
+ (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 (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"
+ (format-time-string "%T" org-timer-start-time)
+ (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."
+ (interactive "P")
+ (cond
+ (stop (org-timer-stop))
+ ((not org-timer-start-time) (error "No timer is running"))
+ (org-timer-pause-time
+ (let ((start-secs (float-time org-timer-start-time))
+ (pause-secs (float-time org-timer-pause-time)))
+ (if org-timer-countdown-timer
+ (let ((new-secs (- start-secs pause-secs)))
+ (setq org-timer-countdown-timer
+ (org-timer--run-countdown-timer
+ new-secs org-timer-countdown-timer-title))
+ (setq org-timer-start-time (org-time-add nil new-secs)))
+ (setq org-timer-start-time
+ (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)
+ (message "Timer continues at %s" (org-timer-value-string))))
+ (t
+ ;; pause timer
+ (when org-timer-countdown-timer
+ (cancel-timer org-timer-countdown-timer)
+ (setq org-timer-countdown-timer 'paused))
+ (run-hooks 'org-timer-pause-hook)
+ (setq org-timer-pause-time (current-time))
+ (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)
+ (unless org-timer-start-time
+ (user-error "No timer running"))
+ (when (timerp org-timer-countdown-timer)
+ (cancel-timer org-timer-countdown-timer))
+ (run-hooks 'org-timer-stop-hook)
+ (setq org-timer-start-time nil
+ org-timer-pause-time nil
+ org-timer-countdown-timer nil)
+ (org-timer-set-mode-line 'off)
+ (message "Timer stopped"))
+
+;;;###autoload
+(defun org-timer (&optional restart no-insert)
+ "Insert a H:MM:SS string from the timer into the buffer.
+The first time this command is used, the timer is started.
+
+When used with a `\\[universal-argument]' prefix, force restarting the timer.
+
+When used with a `\\[universal-argument] \\[universal-argument]' \
+prefix, change all the timer strings
+in the region by a fixed amount. This can be used to re-calibrate
+a timer that was not started at the correct moment.
+
+If NO-INSERT is non-nil, return the string instead of inserting
+it in the buffer."
+ (interactive "P")
+ (if (equal restart '(16))
+ (org-timer-start restart)
+ (when (or (equal restart '(4)) (not org-timer-start-time))
+ (org-timer-start))
+ (if no-insert
+ (org-timer-value-string)
+ (insert (org-timer-value-string)))))
+
+(defun org-timer-value-string ()
+ "Return current timer string."
+ (format org-timer-format
+ (org-timer-secs-to-hms
+ (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)
+ "Change all h:mm:ss time in region by a DELTA."
+ (interactive
+ "r\nsEnter time difference like \"-1:08:26\". Default is first time to zero: ")
+ (let ((re "[-+]?[0-9]+:[0-9]\\{2\\}:[0-9]\\{2\\}") p)
+ (unless (string-match "\\S-" delta)
+ (save-excursion
+ (goto-char beg)
+ (when (re-search-forward re end t)
+ (setq delta (match-string 0))
+ (if (equal (string-to-char delta) ?-)
+ (setq delta (substring delta 1))
+ (setq delta (concat "-" delta))))))
+ (setq delta (org-timer-hms-to-secs (org-timer-fix-incomplete delta)))
+ (when (= delta 0) (error "No change"))
+ (save-excursion
+ (goto-char end)
+ (while (re-search-backward re beg t)
+ (setq p (point))
+ (replace-match
+ (save-match-data
+ (org-timer-secs-to-hms (+ (org-timer-hms-to-secs (match-string 0)) delta)))
+ t t)
+ (goto-char p)))))
+
+;;;###autoload
+(defun org-timer-item (&optional arg)
+ "Insert a description-type item with the current timer value."
+ (interactive "P")
+ (let ((itemp (org-in-item-p)) (pos (point)))
+ (cond
+ ;; In a timer list, insert with `org-list-insert-item',
+ ;; then fix the list.
+ ((and itemp (goto-char itemp) (org-at-item-timer-p))
+ (let* ((struct (org-list-struct))
+ (prevs (org-list-prevs-alist struct))
+ (s (concat (org-timer (when arg '(4)) t) ":: ")))
+ (setq struct (org-list-insert-item pos struct prevs nil s))
+ (org-list-write-struct struct (org-list-parents-alist struct))
+ (looking-at org-list-full-item-re)
+ (goto-char (match-end 0))))
+ ;; In a list of another type, don't break anything: throw an error.
+ (itemp (goto-char pos) (error "This is not a timer list"))
+ ;; Else, start a new list.
+ (t
+ (beginning-of-line)
+ (org-indent-line)
+ (insert "- ")
+ (org-timer (when arg '(4)))
+ (insert ":: ")))))
+
+(defun org-timer-fix-incomplete (hms)
+ "If hms is a H:MM:SS string with missing hour or hour and minute, fix it."
+ (if (string-match "\\(?:\\([0-9]+:\\)?\\([0-9]+:\\)\\)?\\([0-9]+\\)" hms)
+ (replace-match
+ (format "%d:%02d:%02d"
+ (if (match-end 1) (string-to-number (match-string 1 hms)) 0)
+ (if (match-end 2) (string-to-number (match-string 2 hms)) 0)
+ (string-to-number (match-string 3 hms)))
+ t t hms)
+ (error "Cannot parse HMS string \"%s\"" hms)))
+
+(defun org-timer-hms-to-secs (hms)
+ "Convert h:mm:ss string to an integer time.
+If the string starts with a minus sign, the integer will be negative."
+ (if (not (string-match
+ "\\([-+]?[0-9]+\\):\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)"
+ hms))
+ 0
+ (let* ((h (string-to-number (match-string 1 hms)))
+ (m (string-to-number (match-string 2 hms)))
+ (s (string-to-number (match-string 3 hms)))
+ (sign (equal (substring (match-string 1 hms) 0 1) "-")))
+ (setq h (abs h))
+ (* (if sign -1 1) (+ s (* 60 (+ m (* 60 h))))))))
+
+(defun org-timer-secs-to-hms (s)
+ "Convert integer S into h:mm:ss.
+If the integer is negative, the string will start with \"-\"."
+ (let (sign m h)
+ (setq sign (if (< s 0) "-" "")
+ s (abs s)
+ m (/ s 60) s (- s (* 60 m))
+ h (/ m 60) m (- m (* 60 h)))
+ (format "%s%d:%02d:%02d" sign h m s)))
+
+(defvar org-timer-mode-line-timer nil)
+(defvar org-timer-mode-line-string nil)
+
+(defun org-timer-set-mode-line (value)
+ "Set the mode-line display for relative or countdown timer.
+VALUE can be `on', `off', or `paused'."
+ (when (or (eq org-timer-display 'mode-line)
+ (eq org-timer-display 'both))
+ (or global-mode-string (setq global-mode-string '("")))
+ (or (memq 'org-timer-mode-line-string global-mode-string)
+ (setq global-mode-string
+ (append global-mode-string '(org-timer-mode-line-string)))))
+ (when (or (eq org-timer-display 'frame-title)
+ (eq org-timer-display 'both))
+ (or (memq 'org-timer-mode-line-string frame-title-format)
+ (setq frame-title-format
+ (append frame-title-format '(org-timer-mode-line-string)))))
+ (cl-case value
+ (off
+ (when org-timer-mode-line-timer
+ (cancel-timer org-timer-mode-line-timer)
+ (setq org-timer-mode-line-timer nil))
+ (when (or (eq org-timer-display 'mode-line)
+ (eq org-timer-display 'both))
+ (setq global-mode-string
+ (delq 'org-timer-mode-line-string global-mode-string)))
+ (when (or (eq org-timer-display 'frame-title)
+ (eq org-timer-display 'both))
+ (setq frame-title-format
+ (delq 'org-timer-mode-line-string frame-title-format)))
+ (force-mode-line-update))
+ (paused
+ (when org-timer-mode-line-timer
+ (cancel-timer org-timer-mode-line-timer)
+ (setq org-timer-mode-line-timer nil)))
+ (on
+ (when (or (eq org-timer-display 'mode-line)
+ (eq org-timer-display 'both))
+ (or global-mode-string (setq global-mode-string '("")))
+ (or (memq 'org-timer-mode-line-string global-mode-string)
+ (setq global-mode-string
+ (append global-mode-string '(org-timer-mode-line-string)))))
+ (when (or (eq org-timer-display 'frame-title)
+ (eq org-timer-display 'both))
+ (or (memq 'org-timer-mode-line-string frame-title-format)
+ (setq frame-title-format
+ (append frame-title-format '(org-timer-mode-line-string)))))
+ (org-timer-update-mode-line)
+ (when org-timer-mode-line-timer
+ (cancel-timer org-timer-mode-line-timer)
+ (setq org-timer-mode-line-timer nil))
+ (when org-timer-display
+ (setq org-timer-mode-line-timer
+ (run-with-timer 1 1 #'org-timer-update-mode-line))))))
+
+(defun org-timer-update-mode-line ()
+ "Update the timer time in the mode line."
+ (if org-timer-pause-time
+ nil
+ (setq org-timer-mode-line-string
+ (concat " <" (substring (org-timer-value-string) 0 -1) ">"))
+ (force-mode-line-update)))
+
+(defun org-timer-show-remaining-time ()
+ "Display the remaining time before the timer ends."
+ (interactive)
+ (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)
+ "Prompt for a duration in minutes or hh:mm:ss and set a timer.
+
+If `org-timer-default-timer' is not \"0\", suggest this value as
+the default duration for the timer. If a timer is already set,
+prompt the user if she wants to replace it.
+
+Called with a numeric prefix argument, use this numeric value as
+the duration of the timer in minutes.
+
+Called with a \\[universal-argument] prefix arguments, use `org-timer-default-timer'
+without prompting the user for a duration.
+
+With two \\[universal-argument] prefix arguments, use `org-timer-default-timer'
+without prompting the user for a duration and automatically
+replace any running timer.
+
+By default, the timer duration will be set to the number of
+minutes in the Effort property, if any. You can ignore this by
+using three \\[universal-argument] prefix arguments."
+ (interactive "P")
+ (when (and org-timer-start-time
+ (not org-timer-countdown-timer))
+ (user-error "Relative timer is running. Stop first"))
+ (let* ((default-timer
+ ;; `org-timer-default-timer' used to be a number, don't choke:
+ (if (numberp org-timer-default-timer)
+ (number-to-string org-timer-default-timer)
+ org-timer-default-timer))
+ (effort-minutes (let ((effort (org-entry-get nil org-effort-property)))
+ (when (org-string-nw-p effort)
+ (floor (org-duration-to-minutes effort)))))
+ (minutes (or (and (numberp opt) (number-to-string opt))
+ (and (not (equal opt '(64)))
+ effort-minutes
+ (number-to-string effort-minutes))
+ (and (consp opt) default-timer)
+ (and (stringp opt) opt)
+ (read-from-minibuffer
+ "How much time left? (minutes or h:mm:ss) "
+ (and (not (string-equal default-timer "0")) default-timer)))))
+ (when (string-match "\\`[0-9]+\\'" minutes)
+ (setq minutes (concat minutes ":00")))
+ (if (not (string-match "[0-9]+" minutes))
+ (org-timer-show-remaining-time)
+ (let ((secs (org-timer-hms-to-secs (org-timer-fix-incomplete minutes))))
+ (if (and org-timer-countdown-timer
+ (not (or (equal opt '(16))
+ (y-or-n-p "Replace current timer? "))))
+ (message "No timer set")
+ (when (timerp org-timer-countdown-timer)
+ (cancel-timer org-timer-countdown-timer))
+ (setq org-timer-countdown-timer-title
+ (org-timer--get-timer-title))
+ (setq org-timer-countdown-timer
+ (org-timer--run-countdown-timer
+ secs org-timer-countdown-timer-title))
+ (run-hooks 'org-timer-set-hook)
+ (setq org-timer-start-time (org-time-add nil secs))
+ (setq org-timer-pause-time nil)
+ (org-timer-set-mode-line 'on))))))
+
+(defun org-timer--run-countdown-timer (secs title)
+ "Start countdown timer that will last SECS.
+TITLE will be appended to the notification message displayed when
+time is up."
+ (let ((msg (format "%s: time out" title))
+ (sound org-clock-sound))
+ (run-with-timer
+ secs nil (lambda ()
+ (setq org-timer-countdown-timer nil
+ org-timer-start-time nil)
+ (org-notify msg sound)
+ (org-timer-set-mode-line 'off)
+ (run-hooks 'org-timer-done-hook)))))
+
+(defun org-timer--get-timer-title ()
+ "Construct timer title.
+Try to use an Org header, otherwise use the buffer name."
+ (cond
+ ((derived-mode-p 'org-agenda-mode)
+ (let* ((marker (or (get-text-property (point) 'org-marker)))
+ (hdmarker (or (get-text-property (point) 'org-hd-marker)
+ marker)))
+ (when (and marker (marker-buffer marker))
+ (with-current-buffer (marker-buffer marker)
+ (org-with-wide-buffer
+ (goto-char hdmarker)
+ (org-show-entry)
+ (or (ignore-errors (org-get-heading))
+ (buffer-name (buffer-base-buffer))))))))
+ ((derived-mode-p 'org-mode)
+ (ignore-errors (org-get-heading)))
+ (t (buffer-name (buffer-base-buffer)))))
+
+(provide 'org-timer)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-timer.el ends here
diff --git a/elpa/org-9.5.2/org-timer.elc b/elpa/org-9.5.2/org-timer.elc
new file mode 100644
index 0000000..3d3d7b0
--- /dev/null
+++ b/elpa/org-9.5.2/org-timer.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org-version.el b/elpa/org-9.5.2/org-version.el
new file mode 100644
index 0000000..a80e50a
--- /dev/null
+++ b/elpa/org-9.5.2/org-version.el
@@ -0,0 +1,24 @@
+;;; org-version.el --- autogenerated file, do not edit -*- lexical-binding: t -*-
+;;
+;;; Code:
+;;;###autoload
+(defun org-release ()
+ "The release version of Org.
+Inserted by installing Org mode or when a release is made."
+ (let ((org-release "9.5.2"))
+ org-release))
+;;;###autoload
+(defun org-git-version ()
+ "The Git version of Org mode.
+Inserted by installing Org or when a release is made."
+ (let ((org-git-version "9.5.2-gfbff08"))
+ org-git-version))
+
+(provide 'org-version)
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; coding: utf-8
+;; End:
+;;; org-version.el ends here
diff --git a/elpa/org-9.5.2/org.el b/elpa/org-9.5.2/org.el
new file mode 100644
index 0000000..d58f6af
--- /dev/null
+++ b/elpa/org-9.5.2/org.el
@@ -0,0 +1,21484 @@
+;;; org.el --- Outline-based notes management and organizer -*- lexical-binding: t; -*-
+
+;; Carstens outline-mode for keeping track of everything.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+;;
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; Maintainer: Bastien Guerry <bzg@gnu.org>
+;; Keywords: outlines, hypermedia, calendar, wp
+;; Homepage: https://orgmode.org
+;; Package-Requires: ((emacs "25.1"))
+
+;; Version: 9.5.2
+
+;; 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 <https://www.gnu.org/licenses/>.
+;;
+;;; Commentary:
+;;
+;; Org is a mode for keeping notes, maintaining ToDo lists, and doing
+;; project planning with a fast and effective plain-text system.
+;;
+;; Org mode develops organizational tasks around NOTES files that
+;; contain information about projects as plain text. Org mode 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. Org mode supports ToDo
+;; items, deadlines, time stamps, and scheduling. It dynamically
+;; compiles entries into an agenda that utilizes and smoothly
+;; integrates much of the Emacs calendar and diary. Plain text
+;; URL-like links connect to websites, emails, Usenet messages, BBDB
+;; entries, and any files related to the projects. For printing and
+;; sharing of notes, an Org file can be exported as a structured ASCII
+;; file, as HTML, or (todo and agenda items only) as an iCalendar
+;; file. It can also serve as a publishing tool for a set of linked
+;; webpages.
+;;
+;; Installation and Activation
+;; ---------------------------
+;; See the corresponding sections in the manual at
+;;
+;; https://orgmode.org/org.html#Installation
+;;
+;; Documentation
+;; -------------
+;; The documentation of Org mode can be found in the TeXInfo file. The
+;; distribution also contains a PDF version of it. At the homepage of
+;; Org mode, you can read the same text online as HTML. There is also an
+;; excellent reference card made by Philip Rooke. This card can be found
+;; in the doc/ directory.
+;;
+;; A list of recent changes can be found at
+;; https://orgmode.org/Changes.html
+;;
+;;; Code:
+
+(defvar org-inhibit-highlight-removal nil) ; dynamically scoped param
+(defvar org-inlinetask-min-level)
+
+;;;; Require other packages
+
+(require 'cl-lib)
+
+(eval-when-compile (require 'gnus-sum))
+
+(require 'calendar)
+(require 'find-func)
+(require 'format-spec)
+
+(or (eq this-command 'eval-buffer)
+ (condition-case nil
+ (load (concat (file-name-directory load-file-name)
+ "org-loaddefs.el")
+ nil t t t)
+ (error
+ (message "WARNING: No org-loaddefs.el file could be found from where org.el is loaded.")
+ (sit-for 3)
+ (message "You need to run \"make\" or \"make autoloads\" from Org lisp directory")
+ (sit-for 3))))
+
+(eval-and-compile (require 'org-macs))
+(require 'org-compat)
+(require 'org-keys)
+(require 'ol)
+(require 'oc)
+(require 'oc-basic)
+(require 'org-table)
+
+;; `org-outline-regexp' ought to be a defconst but is let-bound in
+;; some places -- e.g. see the macro `org-with-limited-levels'.
+(defvar org-outline-regexp "\\*+ "
+ "Regexp to match Org headlines.")
+
+(defvar org-outline-regexp-bol "^\\*+ "
+ "Regexp to match Org headlines.
+This is similar to `org-outline-regexp' but additionally makes
+sure that we are at the beginning of the line.")
+
+(defvar org-heading-regexp "^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$"
+ "Matches a headline, putting stars and text into groups.
+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-attach-dir "org-attach"
+ (&optional create-if-not-exists-p no-fs-check))
+(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-auto-clockout "org-clock" ())
+(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))
+(declare-function org-clock-timestamps-up "org-clock" (&optional n))
+(declare-function org-clock-update-time-maybe "org-clock" ())
+(declare-function org-clocktable-shift "org-clock" (dir n))
+(declare-function org-columns-quit "org-colview" ())
+(declare-function org-columns-insert-dblock "org-colview" ())
+(declare-function org-duration-from-minutes "org-duration" (minutes &optional fmt canonical))
+(declare-function org-duration-to-minutes "org-duration" (duration &optional 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-extract-element "org-element" (element))
+(declare-function org-element-insert-before "org-element" (element location))
+(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" ())
+(declare-function org-element-map "org-element" (data types fun &optional info first-match no-recursion with-affiliated))
+(declare-function org-element-nested-p "org-element" (elem-a elem-b))
+(declare-function org-element-parse-buffer "org-element" (&optional granularity visible-only))
+(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-put-property "org-element" (element property value))
+(declare-function org-element-restriction "org-element" (element))
+(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-export-dispatch "ox" (&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-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-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-num-mode "org-num" (&optional arg))
+(declare-function org-plot/gnuplot "org-plot" (&optional params))
+(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-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-toggle-archive-tag "org-archive" (&optional find-done))
+(declare-function org-update-radio-target-regexp "ol" ())
+
+(defvar org-element-paragraph-separate)
+(defvar org-indent-indentation-per-level)
+(defvar org-radio-target-regexp)
+(defvar org-target-link-regexp)
+(defvar org-target-regexp)
+(defvar org-id-overriding-file-name)
+
+;; load languages based on value of `org-babel-load-languages'
+(defvar org-babel-load-languages)
+
+(defvar crm-separator) ; dynamically scoped param
+
+;;;###autoload
+(defun org-babel-do-load-languages (sym value)
+ "Load the languages defined in `org-babel-load-languages'."
+ (set-default sym value)
+ (dolist (pair org-babel-load-languages)
+ (let ((active (cdr pair)) (lang (symbol-name (car pair))))
+ (if active
+ (require (intern (concat "ob-" lang)))
+ (fmakunbound
+ (intern (concat "org-babel-execute:" lang)))
+ (fmakunbound
+ (intern (concat "org-babel-expand-body:" lang)))))))
+
+
+;;;###autoload
+(defun org-babel-load-file (file &optional compile)
+ "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
+optional prefix argument COMPILE, the tangled Emacs Lisp file is
+byte-compiled before it is loaded."
+ (interactive "fFile to load: \nP")
+ (let ((tangled-file (concat (file-name-sans-extension file) ".el")))
+ ;; Tangle only if the Org file is newer than the Elisp file.
+ (unless (org-file-newer-than-p
+ tangled-file
+ (file-attribute-modification-time
+ (file-attributes (file-truename file))))
+ (org-babel-tangle-file file
+ tangled-file
+ (rx string-start
+ (or "emacs-lisp" "elisp")
+ string-end)))
+ (if compile
+ (progn
+ (byte-compile-file tangled-file)
+ (load tangled-file)
+ (message "Compiled and loaded %s" tangled-file))
+ (load-file tangled-file)
+ (message "Loaded %s" tangled-file))))
+
+(defcustom org-babel-load-languages '((emacs-lisp . t))
+ "Languages which can be evaluated in Org buffers.
+\\<org-mode-map>
+This list can be used to load support for any of the languages
+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"
+ :type '(alist :tag "Babel Languages"
+ :key-type
+ (choice
+ (const :tag "Awk" awk)
+ (const :tag "C" C)
+ (const :tag "R" R)
+ (const :tag "Calc" calc)
+ (const :tag "Clojure" clojure)
+ (const :tag "CSS" css)
+ (const :tag "Ditaa" ditaa)
+ (const :tag "Dot" dot)
+ (const :tag "Emacs Lisp" emacs-lisp)
+ (const :tag "Forth" forth)
+ (const :tag "Fortran" fortran)
+ (const :tag "Gnuplot" gnuplot)
+ (const :tag "Haskell" haskell)
+ (const :tag "Java" java)
+ (const :tag "Javascript" js)
+ (const :tag "LaTeX" latex)
+ (const :tag "Lilypond" lilypond)
+ (const :tag "Lisp" lisp)
+ (const :tag "Makefile" makefile)
+ (const :tag "Maxima" maxima)
+ (const :tag "Matlab" matlab)
+ (const :tag "Ocaml" ocaml)
+ (const :tag "Octave" octave)
+ (const :tag "Org" org)
+ (const :tag "Perl" perl)
+ (const :tag "Pico Lisp" picolisp)
+ (const :tag "PlantUML" plantuml)
+ (const :tag "Python" python)
+ (const :tag "Ruby" ruby)
+ (const :tag "Sass" sass)
+ (const :tag "Scala" scala)
+ (const :tag "Scheme" scheme)
+ (const :tag "Screen" screen)
+ (const :tag "Shell Script" shell)
+ (const :tag "Sql" sql)
+ (const :tag "Sqlite" sqlite)
+ (const :tag "Stan" stan))
+ :value-type (boolean :tag "Activate" :value t)))
+
+;;;; Customization variables
+(defcustom org-clone-delete-id nil
+ "Remove ID property of clones of a subtree.
+When non-nil, clones of a subtree don't inherit the ID property.
+Otherwise they inherit the ID property with a new unique
+identifier."
+ :type 'boolean
+ :version "24.1"
+ :group 'org-id)
+
+;;; Version
+(org-check-version)
+
+;;;###autoload
+(defun org-version (&optional here full message)
+ "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."
+ (interactive (list current-prefix-arg t (not current-prefix-arg)))
+ (let ((org-dir (ignore-errors (org-find-library-dir "org")))
+ (save-load-suffixes (when (boundp 'load-suffixes) load-suffixes))
+ (load-suffixes (list ".el"))
+ (org-install-dir
+ (ignore-errors (org-find-library-dir "org-loaddefs"))))
+ (unless (and (fboundp 'org-release) (fboundp 'org-git-version))
+ (org-load-noerror-mustsuffix (concat org-dir "org-version")))
+ (let* ((load-suffixes save-load-suffixes)
+ (release (org-release))
+ (git-version (org-git-version))
+ (version (format "Org mode version %s (%s @ %s)"
+ release
+ git-version
+ (if org-install-dir
+ (if (string= org-dir org-install-dir)
+ org-install-dir
+ (concat "mixed installation! "
+ org-install-dir
+ " and "
+ org-dir))
+ "org-loaddefs.el can not be found!")))
+ (version1 (if full version release)))
+ (when here (insert version1))
+ (when message (message "%s" version1))
+ version1)))
+
+(defconst org-version (org-version))
+
+
+;;; Syntax Constants
+;;;; Comments
+(defconst org-comment-regexp
+ (rx (seq bol (zero-or-more (any "\t ")) "#" (or " " eol)))
+ "Regular expression for comment lines.")
+
+;;;; Keyword
+(defconst org-keyword-regexp "^[ \t]*#\\+\\(\\S-+?\\):[ \t]*\\(.*\\)$"
+ "Regular expression for keyword-lines.")
+
+;;;; Block
+
+(defconst org-block-regexp
+ "^[ \t]*#\\+begin_?\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\([^\000]+?\\)#\\+end_?\\1[ \t]*$"
+ "Regular expression for hiding blocks.")
+
+(defconst org-dblock-start-re
+ "^[ \t]*#\\+\\(?:BEGIN\\|begin\\):[ \t]+\\(\\S-+\\)\\([ \t]+\\(.*\\)\\)?"
+ "Matches the start line of a dynamic block, with parameters.")
+
+(defconst org-dblock-end-re "^[ \t]*#\\+\\(?:END\\|end\\)\\([: \t\r\n]\\|$\\)"
+ "Matches the end of a dynamic block.")
+
+;;;; Timestamp
+
+(defconst org-ts--internal-regexp
+ (rx (seq
+ (= 4 digit) "-" (= 2 digit) "-" (= 2 digit)
+ (optional " " (*? nonl))))
+ "Regular expression matching the innards of a time stamp.")
+
+(defconst org-ts-regexp (format "<\\(%s\\)>" org-ts--internal-regexp)
+ "Regular expression for fast time stamp matching.")
+
+(defconst org-ts-regexp-inactive
+ (format "\\[\\(%s\\)\\]" org-ts--internal-regexp)
+ "Regular expression for fast inactive time stamp matching.")
+
+(defconst org-ts-regexp-both (format "[[<]\\(%s\\)[]>]" org-ts--internal-regexp)
+ "Regular expression for fast time stamp matching.")
+
+(defconst org-ts-regexp0
+ "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\)\\( +[^]+0-9>\r\n -]+\\)?\\( +\\([0-9]\\{1,2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
+ "Regular expression matching time strings for analysis.
+This one does not require the space after the date, so it can be used
+on a string that terminates immediately after the date.")
+
+(defconst org-ts-regexp1 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) *\\([^]+0-9>\r\n -]*\\)\\( \\([0-9]\\{1,2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
+ "Regular expression matching time strings for analysis.")
+
+(defconst org-ts-regexp2 (concat "<" org-ts-regexp1 "[^>\n]\\{0,16\\}>")
+ "Regular expression matching time stamps, with groups.")
+
+(defconst org-ts-regexp3 (concat "[[<]" org-ts-regexp1 "[^]>\n]\\{0,16\\}[]>]")
+ "Regular expression matching time stamps (also [..]), with groups.")
+
+(defconst org-tr-regexp (concat org-ts-regexp "--?-?" org-ts-regexp)
+ "Regular expression matching a time stamp range.")
+
+(defconst org-tr-regexp-both
+ (concat org-ts-regexp-both "--?-?" org-ts-regexp-both)
+ "Regular expression matching a time stamp range.")
+
+(defconst org-tsr-regexp (concat org-ts-regexp "\\(--?-?"
+ org-ts-regexp "\\)?")
+ "Regular expression matching a time stamp or time stamp range.")
+
+(defconst org-tsr-regexp-both
+ (concat org-ts-regexp-both "\\(--?-?"
+ org-ts-regexp-both "\\)?")
+ "Regular expression matching a time stamp or time stamp range.
+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]\\)?\\)"
+ "Regular expression for specifying repeated events.
+After a match, group 1 contains the repeat expression.")
+
+(defconst org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a %H:%M>")
+ "Formats for `format-time-string' which are used for time stamps.")
+
+;;;; Clock and Planning
+
+(defconst org-clock-string "CLOCK:"
+ "String used as prefix for timestamps clocking work hours on an item.")
+
+(defvar org-closed-string "CLOSED:"
+ "String used as the prefix for timestamps logging closing a TODO entry.")
+
+(defvar org-deadline-string "DEADLINE:"
+ "String to mark deadline entries.
+\\<org-mode-map>
+A deadline is this string, followed by a time stamp. It must be
+a word, terminated by a colon. You can insert a schedule keyword
+and a timestamp with `\\[org-deadline]'.")
+
+(defvar org-scheduled-string "SCHEDULED:"
+ "String to mark scheduled TODO entries.
+\\<org-mode-map>
+A schedule is this string, followed by a time stamp. It must be
+a word, terminated by a colon. You can insert a schedule keyword
+and a timestamp with `\\[org-schedule]'.")
+
+(defconst org-ds-keyword-length
+ (+ 2
+ (apply #'max
+ (mapcar #'length
+ (list org-deadline-string org-scheduled-string
+ org-clock-string org-closed-string))))
+ "Maximum length of the DEADLINE and SCHEDULED keywords.")
+
+(defconst org-planning-line-re
+ (concat "^[ \t]*"
+ (regexp-opt
+ (list org-closed-string org-deadline-string org-scheduled-string)
+ t))
+ "Matches a line with planning info.
+Matched keyword is in group 1.")
+
+(defconst org-clock-line-re
+ (concat "^[ \t]*" org-clock-string)
+ "Matches a line with clock info.")
+
+(defconst org-deadline-regexp (concat "\\<" org-deadline-string)
+ "Matches the DEADLINE keyword.")
+
+(defconst org-deadline-time-regexp
+ (concat "\\<" org-deadline-string " *<\\([^>]+\\)>")
+ "Matches the DEADLINE keyword together with a time stamp.")
+
+(defconst org-deadline-time-hour-regexp
+ (concat "\\<" org-deadline-string
+ " *<\\([^>]+[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
+ (concat "\\<\\(" org-deadline-string "\\).*")
+ "Matches the DEADLINE keyword and the rest of the line.")
+
+(defconst org-scheduled-regexp (concat "\\<" org-scheduled-string)
+ "Matches the SCHEDULED keyword.")
+
+(defconst org-scheduled-time-regexp
+ (concat "\\<" org-scheduled-string " *<\\([^>]+\\)>")
+ "Matches the SCHEDULED keyword together with a time stamp.")
+
+(defconst org-scheduled-time-hour-regexp
+ (concat "\\<" org-scheduled-string
+ " *<\\([^>]+[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
+ (concat "\\<" org-closed-string " *\\[\\([^]]+\\)\\]")
+ "Matches the CLOSED keyword together with a time stamp.")
+
+(defconst org-keyword-time-regexp
+ (concat "\\<"
+ (regexp-opt
+ (list org-scheduled-string org-deadline-string org-closed-string
+ org-clock-string)
+ t)
+ " *[[<]\\([^]>]+\\)[]>]")
+ "Matches any of the 4 keywords, together with the time stamp.")
+
+(defconst org-keyword-time-not-clock-regexp
+ (concat
+ "\\<"
+ (regexp-opt
+ (list org-scheduled-string org-deadline-string org-closed-string) t)
+ " *[[<]\\([^]>]+\\)[]>]")
+ "Matches any of the 3 keywords, together with the time stamp.")
+
+(defconst org-all-time-keywords
+ (mapcar (lambda (w) (substring w 0 -1))
+ (list org-scheduled-string org-deadline-string
+ org-clock-string org-closed-string))
+ "List of time keywords.")
+
+;;;; Drawer
+
+(defconst org-drawer-regexp "^[ \t]*:\\(\\(?:\\w\\|[-_]\\)+\\):[ \t]*$"
+ "Matches first or last line of a hidden block.
+Group 1 contains drawer's name or \"END\".")
+
+(defconst org-property-start-re "^[ \t]*:PROPERTIES:[ \t]*$"
+ "Regular expression matching the first line of a property drawer.")
+
+(defconst org-property-end-re "^[ \t]*:END:[ \t]*$"
+ "Regular expression matching the last line of a property drawer.")
+
+(defconst org-clock-drawer-start-re "^[ \t]*:CLOCK:[ \t]*$"
+ "Regular expression matching the first line of a clock drawer.")
+
+(defconst org-clock-drawer-end-re "^[ \t]*:END:[ \t]*$"
+ "Regular expression matching the last line of a clock drawer.")
+
+(defconst org-logbook-drawer-re
+ (rx (seq bol (0+ (any "\t ")) ":LOGBOOK:" (0+ (any "\t ")) "\n"
+ (*? (0+ nonl) "\n")
+ (0+ (any "\t ")) ":END:" (0+ (any "\t ")) eol))
+ "Matches an entire LOGBOOK drawer.")
+
+(defconst org-property-drawer-re
+ (concat "^[ \t]*:PROPERTIES:[ \t]*\n"
+ "\\(?:[ \t]*:\\S-+:\\(?: .*\\)?[ \t]*\n\\)*?"
+ "[ \t]*:END:[ \t]*$")
+ "Matches an entire property drawer.")
+
+(defconst org-clock-drawer-re
+ (concat "\\(" org-clock-drawer-start-re "\\)[^\000]*?\\("
+ org-clock-drawer-end-re "\\)\n?")
+ "Matches an entire clock drawer.")
+
+;;;; Headline
+
+(defconst org-heading-keyword-regexp-format
+ "^\\(\\*+\\)\\(?: +%s\\)\\(?: +\\(.*?\\)\\)?[ \t]*$"
+ "Printf format for a regexp matching a headline with some keyword.
+This regexp will match the headline of any node which has the
+exact keyword that is put into the format. The keyword isn't in
+any group by default, but the stars and the body are.")
+
+(defconst org-heading-keyword-maybe-regexp-format
+ "^\\(\\*+\\)\\(?: +%s\\)?\\(?: +\\(.*?\\)\\)?[ \t]*$"
+ "Printf format for a regexp matching a headline, possibly with some keyword.
+This regexp can match any headline with the specified keyword, or
+without a keyword. The keyword isn't in any group by default,
+but the stars and the body are.")
+
+(defconst org-archive-tag "ARCHIVE"
+ "The tag that marks a subtree as archived.
+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.
+\\<org-mode-map>
+An entry can be toggled between COMMENT and normal with
+`\\[org-toggle-comment]'."))
+
+
+;;;; LaTeX Environments and Fragments
+
+(defconst org-latex-regexps
+ '(("begin" "^[ \t]*\\(\\\\begin{\\([a-zA-Z0-9\\*]+\\)[^\000]+?\\\\end{\\2}\\)" 1 t)
+ ;; ("$" "\\([ \t(]\\|^\\)\\(\\(\\([$]\\)\\([^ \t\n,.$].*?\\(\n.*?\\)\\{0,5\\}[^ \t\n,.$]\\)\\4\\)\\)\\([ \t.,?;:'\")]\\|$\\)" 2 nil)
+ ;; \000 in the following regex is needed for org-inside-LaTeX-fragment-p
+ ("$1" "\\([^$]\\|^\\)\\(\\$[^ \t\r\n,;.$]\\$\\)\\(\\s.\\|\\s-\\|\\s(\\|\\s)\\|\\s\"\\|\000\\|'\\|$\\)" 2 nil)
+ ("$" "\\([^$]\\|^\\)\\(\\(\\$\\([^ \t\n,;.$][^$\n\r]*?\\(\n[^$\n\r]*?\\)\\{0,2\\}[^ \t\n,.$]\\)\\$\\)\\)\\(\\s.\\|\\s-\\|\\s(\\|\\s)\\|\\s\"\\|\000\\|'\\|$\\)" 2 nil)
+ ("\\(" "\\\\([^\000]*?\\\\)" 0 nil)
+ ("\\[" "\\\\\\[[^\000]*?\\\\\\]" 0 nil)
+ ("$$" "\\$\\$[^\000]*?\\$\\$" 0 nil))
+ "Regular expressions for matching embedded LaTeX.")
+
+;;;; Node Property
+
+(defconst org-effort-property "Effort"
+ "The property that is being used to keep track of effort estimates.
+Effort estimates given in this property need to be in the format
+defined in org-duration.el.")
+
+
+;;; The custom variables
+
+(defgroup org nil
+ "Outline-based notes management and organizer."
+ :tag "Org"
+ :group 'outlines
+ :group 'calendar)
+
+(defcustom org-mode-hook nil
+ "Mode hook for Org mode, run after the mode was turned on."
+ :group 'org
+ :type 'hook)
+
+(defcustom org-load-hook nil
+ "Hook that is run after org.el has been loaded."
+ :group 'org
+ :type 'hook)
+
+(make-obsolete-variable
+ 'org-load-hook
+ "use `with-eval-after-load' instead." "9.5")
+
+(defcustom org-log-buffer-setup-hook nil
+ "Hook that is run after an Org log buffer is created."
+ :group 'org
+ :version "24.1"
+ :type 'hook)
+
+(defvar org-modules) ; defined below
+(defvar org-modules-loaded nil
+ "Have the modules been loaded already?")
+
+;;;###autoload
+(defun org-load-modules-maybe (&optional force)
+ "Load all extensions listed in `org-modules'."
+ (when (or force (not org-modules-loaded))
+ (dolist (ext org-modules)
+ (condition-case nil (require ext)
+ (error (message "Problems while trying to load feature `%s'" ext))))
+ (setq org-modules-loaded t)))
+
+(defun org-set-modules (var value)
+ "Set VAR to VALUE and call `org-load-modules-maybe' with the force flag."
+ (set var value)
+ (when (featurep 'org)
+ (org-load-modules-maybe 'force)
+ (org-element-cache-reset 'all)))
+
+(defcustom org-modules '(ol-doi ol-w3m ol-bbdb ol-bibtex ol-docview ol-gnus ol-info ol-irc ol-mhe ol-rmail ol-eww)
+ "Modules that should always be loaded together with org.el.
+
+If a description starts with <C>, the file is not part of Emacs and Org mode,
+so loading it will require that you have properly installed org-contrib
+package from NonGNU Emacs Lisp Package Archive
+https://elpa.nongnu.org/nongnu/org-contrib.html
+
+You can also use this system to load external packages (i.e. neither Org
+core modules, nor org-contrib modules). Just add symbols
+to the end of the list. If the package is called org-xyz.el, then you need
+to add the symbol `xyz', and the package must have a call to:
+
+ (provide \\='org-xyz)
+
+For export specific modules, see also `org-export-backends'."
+ :group 'org
+ :set 'org-set-modules
+ :package-version '(Org . "9.5")
+ :type
+ '(set :greedy t
+ (const :tag " bbdb: Links to BBDB entries" ol-bbdb)
+ (const :tag " bibtex: Links to BibTeX entries" ol-bibtex)
+ (const :tag " crypt: Encryption of subtrees" org-crypt)
+ (const :tag " ctags: Access to Emacs tags with links" org-ctags)
+ (const :tag " docview: Links to Docview buffers" ol-docview)
+ (const :tag " doi: Links to DOI references" ol-doi)
+ (const :tag " eww: Store link to URL of Eww" ol-eww)
+ (const :tag " gnus: Links to GNUS folders/messages" ol-gnus)
+ (const :tag " habit: Track your consistency with habits" org-habit)
+ (const :tag " id: Global IDs for identifying entries" org-id)
+ (const :tag " info: Links to Info nodes" ol-info)
+ (const :tag " inlinetask: Tasks independent of outline hierarchy" org-inlinetask)
+ (const :tag " irc: Links to IRC/ERC chat sessions" ol-irc)
+ (const :tag " mhe: Links to MHE folders/messages" ol-mhe)
+ (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" ol-rmail)
+ (const :tag " tempo: Fast completion for structures" org-tempo)
+ (const :tag " w3m: Special cut/paste from w3m to Org mode." ol-w3m)
+ (const :tag " eshell: Links to working directories in Eshell" ol-eshell)
+
+ (const :tag "C annotate-file: Annotate a file with Org syntax" org-annotate-file)
+ (const :tag "C bookmark: Links to bookmarks" ol-bookmark)
+ (const :tag "C checklist: Extra functions for checklists in repeated tasks" org-checklist)
+ (const :tag "C choose: Use TODO keywords to mark decisions states" org-choose)
+ (const :tag "C collector: Collect properties into tables" org-collector)
+ (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 elisp-symbol: Links to emacs-lisp symbols" ol-elisp-symbol)
+ (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 git-link: Links to specific file version" ol-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-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: Links to man pages in Org mode" ol-man)
+ (const :tag "C mew: Links to Mew folders/messages" ol-mew)
+ (const :tag "C notify: Notifications for Org mode" org-notify)
+ (const :tag "C notmuch: Provide Org links to notmuch searches or messages" ol-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 links" org-screen)
+ (const :tag "C screenshot: Take and manage screenshots in Org 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)
+ (const :tag "C velocity Something like Notational Velocity for Org" org-velocity)
+ (const :tag "C vm: Links to VM folders/messages" ol-vm)
+ (const :tag "C wikinodes: CamelCase wiki-like links" org-wikinodes)
+ (const :tag "C wl: Links to Wanderlust folders/messages" ol-wl)
+ (repeat :tag "External packages" :inline t (symbol :tag "Package"))))
+
+(defvar org-export-registered-backends) ; From ox.el.
+(declare-function org-export-derived-backend-p "ox" (backend &rest backends))
+(declare-function org-export-backend-name "ox" (backend) t)
+(defcustom org-export-backends '(ascii html icalendar latex odt)
+ "List of export back-ends that should be always available.
+
+If a description starts with <C>, the file is not part of Emacs and Org mode,
+so loading it will require that you have properly installed org-contrib
+package from NonGNU Emacs Lisp Package Archive
+https://elpa.nongnu.org/nongnu/org-contrib.html
+
+Unlike to `org-modules', libraries in this list will not be
+loaded along with Org, but only once the export framework is
+needed.
+
+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
+interface or run the following code, where VAL stands for the new
+value of the variable, after updating it:
+
+ (progn
+ (setq org-export-registered-backends
+ (cl-remove-if-not
+ (lambda (backend)
+ (let ((name (org-export-backend-name backend)))
+ (or (memq name val)
+ (catch \\='parentp
+ (dolist (b val)
+ (and (org-export-derived-backend-p b name)
+ (throw \\='parentp t)))))))
+ org-export-registered-backends))
+ (let ((new-list (mapcar #\\='org-export-backend-name
+ org-export-registered-backends)))
+ (dolist (backend val)
+ (cond
+ ((not (load (format \"ox-%s\" backend) t t))
+ (message \"Problems while trying to load export back-end \\=`%s\\='\"
+ backend))
+ ((not (memq backend new-list)) (push backend new-list))))
+ (set-default \\='org-export-backends new-list)))
+
+Adding a back-end to this list will also pull the back-end it
+depends on, if any."
+ :group 'org
+ :group 'org-export
+ :version "26.1"
+ :package-version '(Org . "9.0")
+ :initialize 'custom-initialize-set
+ :set (lambda (var val)
+ (if (not (featurep 'ox)) (set-default var val)
+ ;; Any back-end not required anymore (not present in VAL and not
+ ;; a parent of any back-end in the new value) is removed from the
+ ;; list of registered back-ends.
+ (setq org-export-registered-backends
+ (cl-remove-if-not
+ (lambda (backend)
+ (let ((name (org-export-backend-name backend)))
+ (or (memq name val)
+ (catch 'parentp
+ (dolist (b val)
+ (and (org-export-derived-backend-p b name)
+ (throw 'parentp t)))))))
+ org-export-registered-backends))
+ ;; Now build NEW-LIST of both new back-ends and required
+ ;; parents.
+ (let ((new-list (mapcar #'org-export-backend-name
+ org-export-registered-backends)))
+ (dolist (backend val)
+ (cond
+ ((not (load (format "ox-%s" backend) t t))
+ (message "Problems while trying to load export back-end `%s'"
+ backend))
+ ((not (memq backend new-list)) (push backend new-list))))
+ ;; Set VAR to that list with fixed dependencies.
+ (set-default var new-list))))
+ :type '(set :greedy t
+ (const :tag " ascii Export buffer to ASCII format" ascii)
+ (const :tag " beamer Export buffer to Beamer presentation" beamer)
+ (const :tag " html Export buffer to HTML format" html)
+ (const :tag " icalendar Export buffer to iCalendar format" icalendar)
+ (const :tag " latex Export buffer to LaTeX format" latex)
+ (const :tag " man Export buffer to MAN format" man)
+ (const :tag " md Export buffer to Markdown format" md)
+ (const :tag " odt Export buffer to ODT format" odt)
+ (const :tag " org Export buffer to Org format" org)
+ (const :tag " texinfo Export buffer to Texinfo format" texinfo)
+ (const :tag "C confluence Export buffer to Confluence Wiki format" confluence)
+ (const :tag "C deck Export buffer to deck.js presentations" deck)
+ (const :tag "C freemind Export buffer to Freemind mindmap format" freemind)
+ (const :tag "C groff Export buffer to Groff format" groff)
+ (const :tag "C koma-letter Export buffer to KOMA Scrlttrl2 format" koma-letter)
+ (const :tag "C RSS 2.0 Export buffer to RSS 2.0 format" rss)
+ (const :tag "C s5 Export buffer to s5 presentations" s5)
+ (const :tag "C taskjuggler Export buffer to TaskJuggler format" taskjuggler)))
+
+(eval-after-load 'ox
+ '(dolist (backend org-export-backends)
+ (condition-case nil (require (intern (format "ox-%s" backend)))
+ (error (message "Problems while trying to load export back-end `%s'"
+ backend)))))
+
+(defcustom org-support-shift-select nil
+ "Non-nil means make shift-cursor commands select text when possible.
+\\<org-mode-map>
+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
+other purposes, important enough to compete with shift selection.
+Org tries to balance these needs by supporting `shift-select-mode'
+outside these special contexts, under control of this variable.
+
+The default of this variable is nil, to avoid confusing behavior. Shifted
+cursor keys will then execute Org commands in the following contexts:
+- on a headline, changing TODO state (left/right) and priority (up/down)
+- on a time stamp, changing the time
+- in a plain list item, changing the bullet type
+- in a property definition line, switching between allowed values
+- in the BEGIN line of a clock table (changing the time block).
+- in a table, moving the cell in the specified direction.
+Outside these contexts, the commands will throw an error.
+
+When this variable is t and the cursor is not in a special
+context, Org mode will support shift-selection for making and
+enlarging regions. To make this more effective, the bullet
+cycling will no longer happen anywhere in an item line, but only
+if the cursor is exactly on the bullet.
+
+If you set this variable to the symbol `always', then the keys
+will not be special in headlines, property lines, item lines, and
+table cells, to make shift selection work there as well. If this is
+what you want, you can use the following alternative commands:
+`\\[org-todo]' and `\\[org-priority]' \
+to change TODO state and priority,
+`\\[universal-argument] \\[universal-argument] \\[org-todo]' \
+can be used to switch TODO sets,
+`\\[org-ctrl-c-minus]' to cycle item bullet types,
+and properties can be edited by hand or in column view.
+
+However, when the cursor is on a timestamp, shift-cursor commands
+will still edit the time stamp - this is just too good to give up."
+ :group 'org
+ :type '(choice
+ (const :tag "Never" nil)
+ (const :tag "When outside special context" t)
+ (const :tag "Everywhere except timestamps" always)))
+
+(defcustom org-loop-over-headlines-in-active-region t
+ "Shall some commands act upon headlines in the active region?
+
+When set to t, some commands will be performed in all headlines
+within the active region.
+
+When set to `start-level', some commands will be performed in all
+headlines within the active region, provided that these headlines
+are of the same level than the first one.
+
+When set to a string, those commands will be performed on the
+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-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.
+
+See `org-agenda-loop-over-headlines-in-active-region' for the
+equivalent option for agenda views."
+ :type '(choice (const :tag "Don't loop" nil)
+ (const :tag "All headlines in active region" t)
+ (const :tag "In active region, headlines at the same level than the first one" start-level)
+ (string :tag "Tags/Property/Todo matcher"))
+ :package-version '(Org . "9.4")
+ :group 'org-todo
+ :group 'org-archive)
+
+(defcustom org-startup-folded 'showeverything
+ "Non-nil means entering Org mode will switch to OVERVIEW.
+
+This can also be configured on a per-file basis by adding one of
+the following lines anywhere in the buffer:
+
+ #+STARTUP: fold (or `overview', this is equivalent)
+ #+STARTUP: nofold (or `showall', this is equivalent)
+ #+STARTUP: content
+ #+STARTUP: show<n>levels (<n> = 2..5)
+ #+STARTUP: showeverything
+
+Set `org-agenda-inhibit-startup' to a non-nil value if you want
+to ignore this option when Org opens agenda files for the first
+time."
+ :group 'org-startup
+ :package-version '(Org . "9.4")
+ :type '(choice
+ (const :tag "nofold: show all" nil)
+ (const :tag "fold: overview" t)
+ (const :tag "fold: show two levels" show2levels)
+ (const :tag "fold: show three levels" show3levels)
+ (const :tag "fold: show four levels" show4evels)
+ (const :tag "fold: show five levels" show5levels)
+ (const :tag "content: all headlines" content)
+ (const :tag "show everything, even drawers" showeverything)))
+
+(defcustom org-startup-truncated t
+ "Non-nil means entering Org mode will set `truncate-lines'.
+This is useful since some lines containing links can be very long and
+uninteresting. Also tables look terrible when wrapped.
+
+The variable `org-startup-truncated' allows to configure
+truncation for Org mode different to the other modes that use the
+variable `truncate-lines' and as a shortcut instead of putting
+the variable `truncate-lines' into the `org-mode-hook'. If one
+wants to configure truncation for Org mode not statically but
+dynamically e.g. in a hook like `ediff-prepare-buffer-hook' then
+the variable `truncate-lines' has to be used because in such a
+case it is too late to set the variable `org-startup-truncated'."
+ :group 'org-startup
+ :type 'boolean)
+
+(defcustom org-startup-indented nil
+ "Non-nil means turn on `org-indent-mode' on startup.
+This can also be configured on a per-file basis by adding one of
+the following lines anywhere in the buffer:
+
+ #+STARTUP: indent
+ #+STARTUP: noindent"
+ :group 'org-structure
+ :type '(choice
+ (const :tag "Not" nil)
+ (const :tag "Globally (slow on startup in large files)" t)))
+
+(defcustom org-startup-numerated nil
+ "Non-nil means turn on `org-num-mode' on startup.
+This can also be configured on a per-file basis by adding one of
+the following lines anywhere in the buffer:
+
+ #+STARTUP: num
+ #+STARTUP: nonum"
+ :group 'org-structure
+ :package-version '(Org . "9.4")
+ :type '(choice
+ (const :tag "Not" nil)
+ (const :tag "Globally" t)))
+
+(defcustom org-use-sub-superscripts t
+ "Non-nil means interpret \"_\" and \"^\" for display.
+
+If you want to control how Org exports those characters, see
+`org-export-with-sub-superscripts'.
+
+When this option is turned on, you can use TeX-like syntax for
+sub- and superscripts within the buffer. Several characters after
+\"_\" or \"^\" will be considered as a single item - so grouping
+with {} is normally not needed. For example, the following things
+will be parsed as single sub- or superscripts:
+
+ 10^24 or 10^tau several digits will be considered 1 item.
+ 10^-12 or 10^-tau a leading sign with digits or a word
+ x^2-y^3 will be read as x^2 - y^3, because items are
+ terminated by almost any nonword/nondigit char.
+ x_{i^2} or x^(2-i) braces or parenthesis do grouping.
+
+Still, ambiguity is possible. So when in doubt, use {} to enclose
+the sub/superscript. If you set this variable to the symbol `{}',
+the braces are *required* in order to trigger interpretations as
+sub/superscript. This can be helpful in documents that need \"_\"
+frequently in plain text."
+ :group 'org-startup
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "Always interpret" t)
+ (const :tag "Only with braces" {})
+ (const :tag "Never interpret" nil)))
+
+(defcustom org-startup-with-beamer-mode nil
+ "Non-nil means turn on `org-beamer-mode' on startup.
+This can also be configured on a per-file basis by adding one of
+the following lines anywhere in the buffer:
+
+ #+STARTUP: beamer"
+ :group 'org-startup
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-startup-align-all-tables nil
+ "Non-nil means align all tables when visiting a file.
+This can also be configured on a per-file basis by adding one of
+the following lines anywhere in the buffer:
+ #+STARTUP: align
+ #+STARTUP: noalign"
+ :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
+the following lines anywhere in the buffer:
+ #+STARTUP: inlineimages
+ #+STARTUP: noinlineimages"
+ :group 'org-startup
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-startup-with-latex-preview nil
+ "Non-nil means preview LaTeX fragments when loading a new Org file.
+
+This can also be configured on a per-file basis by adding one of
+the following lines anywhere in the buffer:
+ #+STARTUP: latexpreview
+ #+STARTUP: nolatexpreview"
+ :group 'org-startup
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defcustom org-insert-mode-line-in-empty-file nil
+ "Non-nil means insert the first line setting Org mode in empty files.
+When the function `org-mode' is called interactively in an empty file, this
+normally means that the file name does not automatically trigger Org mode.
+To ensure that the file will always be in Org mode in the future, a
+line enforcing Org mode will be inserted into the buffer, if this option
+has been set."
+ :group 'org-startup
+ :type 'boolean)
+
+(defcustom org-ellipsis nil
+ "The ellipsis to use in the Org mode outline.
+
+When nil, just use the standard three dots. When a non-empty string,
+use that string instead.
+
+The change affects only Org mode (which will then use its own display table).
+Changing this requires executing `\\[org-mode]' in a buffer to become
+effective. It cannot be set as a local variable."
+ :group 'org-startup
+ :type '(choice (const :tag "Default" nil)
+ (string :tag "String" :value "...#")))
+
+(defvar org-display-table nil
+ "The display table for Org mode, in case `org-ellipsis' is non-nil.")
+
+(defcustom org-directory "~/org"
+ "Directory with Org files.
+This is just a default location to look for Org files. There is no need
+at all to put your files into this directory. It is used in the
+following situations:
+
+1. When a capture template specifies a target file that is not an
+ absolute path. The path will then be interpreted relative to
+ `org-directory'
+2. When the value of variable `org-agenda-files' is a single file, any
+ relative paths in this file will be taken as relative to
+ `org-directory'."
+ :group 'org-refile
+ :group 'org-capture
+ :type 'directory)
+
+(defcustom org-default-notes-file (convert-standard-filename "~/.notes")
+ "Default target for storing notes.
+Used as a fall back file for org-capture.el, for templates that
+do not specify a target file."
+ :group 'org-refile
+ :group 'org-capture
+ :type 'file)
+
+(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.
+This can also be a list with cons cells of regular expressions that
+are matched against file names, and values."
+ :group 'org-capture
+ :group 'org-refile
+ :type '(choice
+ (const :tag "Reverse always" t)
+ (const :tag "Reverse never" nil)
+ (repeat :tag "By file name regexp"
+ (cons regexp boolean))))
+
+(defgroup org-keywords nil
+ "Keywords in Org mode."
+ :tag "Org Keywords"
+ :group 'org)
+
+(defcustom org-closed-keep-when-no-todo nil
+ "Remove CLOSED: time-stamp when switching back to a non-todo state?"
+ :group 'org-todo
+ :group 'org-keywords
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defgroup org-structure nil
+ "Options concerning the general structure of Org files."
+ :tag "Org Structure"
+ :group 'org)
+
+(defgroup org-reveal-location nil
+ "Options about how to make context of a location visible."
+ :tag "Org Reveal Location"
+ :group 'org-structure)
+
+(defcustom org-show-context-detail '((agenda . local)
+ (bookmark-jump . lineage)
+ (isearch . lineage)
+ (default . ancestors))
+ "Alist between context and visibility span when revealing a location.
+
+\\<org-mode-map>Some actions may move point into invisible
+locations. As a consequence, Org always exposes a neighborhood
+around point. How much is shown depends on the initial action,
+or context. Valid contexts are
+
+ agenda when exposing an entry from the agenda
+ org-goto when using the command `org-goto' (`\\[org-goto]')
+ occur-tree when using the command `org-occur' (`\\[org-sparse-tree] /')
+ tags-tree when constructing a sparse tree based on tags matches
+ link-search when exposing search matches associated with a link
+ mark-goto when exposing the jump goal of a mark
+ bookmark-jump when exposing a bookmark location
+ isearch when exiting from an incremental search
+ default default for all contexts not set explicitly
+
+Allowed visibility spans are
+
+ minimal show current headline; if point is not on headline,
+ also show entry
+
+ local show current headline, entry and next headline
+
+ ancestors show current headline and its direct ancestors; if
+ point is not on headline, also show entry
+
+ ancestors-full show current subtree and its direct ancestors
+
+ lineage show current headline, its direct ancestors and all
+ their children; if point is not on headline, also show
+ entry and first child
+
+ tree show current headline, its direct ancestors and all
+ their children; if point is not on headline, also show
+ entry and all children
+
+ canonical show current headline, its direct ancestors along with
+ their entries and children; if point is not located on
+ the headline, also show current entry and all children
+
+As special cases, a nil or t value means show all contexts in
+`minimal' or `canonical' view, respectively.
+
+Some views can make displayed information very compact, but also
+make it harder to edit the location of the match. In such
+a case, use the command `org-reveal' (`\\[org-reveal]') to show
+more context."
+ :group 'org-reveal-location
+ :version "26.1"
+ :package-version '(Org . "9.0")
+ :type '(choice
+ (const :tag "Canonical" t)
+ (const :tag "Minimal" nil)
+ (repeat :greedy t :tag "Individual contexts"
+ (cons
+ (choice :tag "Context"
+ (const agenda)
+ (const org-goto)
+ (const occur-tree)
+ (const tags-tree)
+ (const link-search)
+ (const mark-goto)
+ (const bookmark-jump)
+ (const isearch)
+ (const default))
+ (choice :tag "Detail level"
+ (const minimal)
+ (const local)
+ (const ancestors)
+ (const ancestors-full)
+ (const lineage)
+ (const tree)
+ (const canonical))))))
+
+(defcustom org-indirect-buffer-display 'other-window
+ "How should indirect tree buffers be displayed?
+
+This applies to indirect buffers created with the commands
+`org-tree-to-indirect-buffer' and `org-agenda-tree-to-indirect-buffer'.
+
+Valid values are:
+current-window Display in the current window
+other-window Just display in another window.
+dedicated-frame Create one new frame, and re-use it each time.
+new-frame Make a new frame each time. Note that in this case
+ previously-made indirect buffers are kept, and you need to
+ kill these buffers yourself."
+ :group 'org-structure
+ :group 'org-agenda-windows
+ :type '(choice
+ (const :tag "In current window" current-window)
+ (const :tag "In current frame, other window" other-window)
+ (const :tag "Each time a new frame" new-frame)
+ (const :tag "One dedicated frame" dedicated-frame)))
+
+(defconst org-file-apps-gnu
+ '((remote . emacs)
+ (system . mailcap)
+ (t . mailcap))
+ "Default file applications on a UNIX or GNU/Linux system.
+See `org-file-apps'.")
+
+(defconst org-file-apps-macos
+ '((remote . emacs)
+ (system . "open %s")
+ ("ps.gz" . "gv %s")
+ ("eps.gz" . "gv %s")
+ ("dvi" . "xdvi %s")
+ ("fig" . "xfig %s")
+ (t . "open %s"))
+ "Default file applications on a macOS system.
+The system \"open\" is known as a default, but we use X11 applications
+for some files for which the OS does not have a good default.
+See `org-file-apps'.")
+
+(defconst org-file-apps-windowsnt
+ (list '(remote . emacs)
+ (cons 'system (lambda (file _path)
+ (with-no-warnings (w32-shell-execute "open" file))))
+ (cons t (lambda (file _path)
+ (with-no-warnings (w32-shell-execute "open" file)))))
+ "Default file applications on a Windows NT system.
+The system \"open\" is used for most files.
+See `org-file-apps'.")
+
+(defcustom org-file-apps
+ '((auto-mode . emacs)
+ (directory . emacs)
+ ("\\.mm\\'" . default)
+ ("\\.x?html?\\'" . default)
+ ("\\.pdf\\'" . default))
+ "Applications for opening `file:path' items in a document.
+
+\\<org-mode-map>
+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 files and the cdr the corresponding command.
+
+Possible values for the file identifier are:
+
+ \"string\" A string as a file identifier can be interpreted in different
+ ways, depending on its contents:
+
+ - Alphanumeric characters only:
+ Match links with this file extension.
+ Example: (\"pdf\" . \"evince %s\")
+ to open PDFs with evince.
+
+ - Regular expression: Match links where the
+ filename matches the regexp. If you want to
+ use groups here, use shy groups.
+
+ Example: (\"\\\\.x?html\\\\\\='\" . \"firefox %s\")
+ (\"\\\\(?:xhtml\\\\|html\\\\)\\\\\\='\" . \"firefox %s\")
+ to open *.html and *.xhtml with firefox.
+
+ - Regular expression which contains (non-shy) groups:
+ Match links where the whole link, including \"::\", and
+ anything after that, matches the regexp.
+ In a custom command string, %1, %2, etc. are replaced with
+ the parts of the link that were matched by the groups.
+ For backwards compatibility, if a command string is given
+ that does not use any of the group matches, this case is
+ handled identically to the second one (i.e. match against
+ file name only).
+ In a custom function, you can access the group matches with
+ (match-string n link).
+
+ Example: (\"\\\\.pdf::\\\\([0-9]+\\\\)\\\\\\='\" . \
+\"evince -p %1 %s\")
+ to open [[file:document.pdf::5]] with evince at page 5.
+
+ `directory' Matches a directory
+ `remote' Matches a remote file, accessible through tramp or efs.
+ Remote files most likely should be visited through Emacs
+ because external applications cannot handle such paths.
+`auto-mode' Matches files that are matched by any entry in `auto-mode-alist',
+ so all files Emacs knows how to handle. Using this with
+ command `emacs' will open most files in Emacs. Beware that this
+ will also open html files inside Emacs, unless you add
+ (\"html\" . default) to the list as well.
+ `system' The system command to open files, like `open' on Windows
+ and macOS, and mailcap under GNU/Linux. This is the command
+ that will be selected if you call `org-open-at-point' with a
+ double prefix argument (`\\[universal-argument] \
+\\[universal-argument] \\[org-open-at-point]').
+ t Default for files not matched by any of the other options.
+
+Possible values for the command are:
+
+ `emacs' The file will be visited by the current Emacs process.
+ `default' Use the default application for this file type, which is the
+ association for t in the list, most likely in the system-specific
+ part. This can be used to overrule an unwanted setting in the
+ system-specific variable.
+ `system' Use the system command for opening files, like \"open\".
+ This command is specified by the entry whose car is `system'.
+ Most likely, the system-specific version of this variable
+ does define this command, but you can overrule/replace it
+ here.
+`mailcap' Use command specified in the mailcaps.
+ string A command to be executed by a shell; %s will be replaced
+ by the path to the file.
+ function A Lisp function, which will be called with two arguments:
+ the file path and the original link string, without the
+ \"file:\" prefix.
+
+For more examples, see the system specific constants
+`org-file-apps-macos'
+`org-file-apps-windowsnt'
+`org-file-apps-gnu'."
+ :group 'org
+ :package-version '(Org . "9.4")
+ :type '(repeat
+ (cons (choice :value ""
+ (string :tag "Extension")
+ (const :tag "System command to open files" system)
+ (const :tag "Default for unrecognized files" t)
+ (const :tag "Remote file" remote)
+ (const :tag "Links to a directory" directory)
+ (const :tag "Any files that have Emacs modes"
+ auto-mode))
+ (choice :value ""
+ (const :tag "Visit with Emacs" emacs)
+ (const :tag "Use default" default)
+ (const :tag "Use the system command" system)
+ (string :tag "Command")
+ (function :tag "Function")))))
+
+(defcustom org-open-non-existing-files nil
+ "Non-nil means `org-open-file' opens non-existing files.
+
+When nil, an error is thrown.
+
+This variable applies only to external applications because they
+might choke on non-existing files. If the link is to a file that
+will be opened in Emacs, the variable is ignored."
+ :group 'org
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-open-directory-means-index-dot-org nil
+ "When non-nil a link to a directory really means to \"index.org\".
+When nil, following a directory link runs Dired or opens
+a finder/explorer window on that directory."
+ :group 'org
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-bookmark-names-plist
+ '(:last-capture "org-capture-last-stored"
+ :last-refile "org-refile-last-stored"
+ :last-capture-marker "org-capture-last-stored-marker")
+ "Names for bookmarks automatically set by some Org commands.
+This can provide strings as names for a number of bookmarks Org sets
+automatically. The following keys are currently implemented:
+ :last-capture
+ :last-capture-marker
+ :last-refile
+When a key does not show up in the property list, the corresponding bookmark
+is not set."
+ :group 'org-structure
+ :type 'plist)
+
+(defgroup org-cycle nil
+ "Options concerning visibility cycling in Org mode."
+ :tag "Org Cycle"
+ :group 'org-structure)
+
+(defcustom org-cycle-skip-children-state-if-no-children t
+ "Non-nil means skip CHILDREN state in entries that don't have any."
+ :group 'org-cycle
+ :type 'boolean)
+
+(defcustom org-cycle-max-level nil
+ "Maximum level which should still be subject to visibility cycling.
+Levels higher than this will, for cycling, be treated as text, not a headline.
+When `org-odd-levels-only' is set, a value of N in this variable actually
+means 2N-1 stars as the limiting headline.
+When nil, cycle all levels.
+Note that the limiting level of cycling is also influenced by
+`org-inlinetask-min-level'. When `org-cycle-max-level' is not set but
+`org-inlinetask-min-level' is, cycling will be limited to levels one less
+than its value."
+ :group 'org-cycle
+ :type '(choice
+ (const :tag "No limit" nil)
+ (integer :tag "Maximum level")))
+
+(defcustom org-hide-block-startup nil
+ "Non-nil means entering Org mode will fold all blocks.
+This can also be set in on a per-file basis with
+
+#+STARTUP: hideblocks
+#+STARTUP: showblocks"
+ :group 'org-startup
+ :group 'org-cycle
+ :type 'boolean)
+
+(defcustom org-cycle-global-at-bob nil
+ "Cycle globally if cursor is at beginning of buffer and not at a headline.
+
+This makes it possible to do global cycling without having to use `S-TAB'
+or `\\[universal-argument] TAB'. For this special case to work, the first \
+line of the buffer
+must not be a headline -- it may be empty or some other text.
+
+When used in this way, `org-cycle-hook' is disabled temporarily to make
+sure the cursor stays at the beginning of the buffer.
+
+When this option is nil, don't do anything special at the beginning of
+the buffer."
+ :group 'org-cycle
+ :type 'boolean)
+
+(defcustom org-cycle-level-after-item/entry-creation t
+ "Non-nil means cycle entry level or item indentation in new empty entries.
+
+When the cursor is at the end of an empty headline, i.e., with only stars
+and maybe a TODO keyword, TAB will then switch the entry to become a child,
+and then all possible ancestor states, before returning to the original state.
+This makes data entry extremely fast: M-RET to create a new headline,
+on TAB to make it a child, two or more tabs to make it a (grand-)uncle.
+
+When the cursor is at the end of an empty plain list item, one TAB will
+make it a subitem, two or more tabs will back up to make this an item
+higher up in the item hierarchy."
+ :group 'org-cycle
+ :type 'boolean)
+
+(defcustom org-cycle-emulate-tab t
+ "Where should `org-cycle' emulate TAB.
+nil Never
+white Only in completely white lines
+whitestart Only at the beginning of lines, before the first non-white char
+t Everywhere except in headlines
+exc-hl-bol Everywhere except at the start of a headline
+If TAB is used in a place where it does not emulate TAB, the current subtree
+visibility is cycled."
+ :group 'org-cycle
+ :type '(choice (const :tag "Never" nil)
+ (const :tag "Only in completely white lines" white)
+ (const :tag "Before first char in a line" whitestart)
+ (const :tag "Everywhere except in headlines" t)
+ (const :tag "Everywhere except at bol in headlines" exc-hl-bol)))
+
+(defcustom org-cycle-separator-lines 2
+ "Number of empty lines needed to keep an empty line between collapsed trees.
+If you leave an empty line between the end of a subtree and the following
+headline, this empty line is hidden when the subtree is folded.
+Org mode will leave (exactly) one empty line visible if the number of
+empty lines is equal or larger to the number given in this variable.
+So the default 2 means at least 2 empty lines after the end of a subtree
+are needed to produce free space between a collapsed subtree and the
+following headline.
+
+If the number is negative, and the number of empty lines is at least -N,
+all empty lines are shown.
+
+Special case: when 0, never leave empty lines in collapsed view."
+ :group 'org-cycle
+ :type 'integer)
+(put 'org-cycle-separator-lines 'safe-local-variable 'integerp)
+
+(defcustom org-pre-cycle-hook nil
+ "Hook that is run before visibility cycling is happening.
+The function(s) in this hook must accept a single argument which indicates
+the new state that will be set right after running this hook. The
+argument is a symbol. Before a global state change, it can have the values
+`overview', `content', or `all'. Before a local state change, it can have
+the values `folded', `children', or `subtree'."
+ :group 'org-cycle
+ :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.
+The function(s) in this hook must accept a single argument which indicates
+the new state that was set by the most recent `org-cycle' command. The
+argument is a symbol. After a global state change, it can have the values
+`overview', `contents', or `all'. After a local state change, it can have
+the values `folded', `children', or `subtree'."
+ :group 'org-cycle
+ :package-version '(Org . "9.4")
+ :type 'hook)
+
+(defgroup org-edit-structure nil
+ "Options concerning structure editing in Org mode."
+ :tag "Org Edit Structure"
+ :group 'org-structure)
+
+(defcustom org-odd-levels-only nil
+ "Non-nil means skip even levels and only use odd levels for the outline.
+This has the effect that two stars are being added/taken away in
+promotion/demotion commands. It also influences how levels are
+handled by the exporters.
+Changing it requires restart of `font-lock-mode' to become effective
+for fontification also in regions already fontified.
+You may also set this on a per-file basis by adding one of the following
+lines to the buffer:
+
+ #+STARTUP: odd
+ #+STARTUP: oddeven"
+ :group 'org-edit-structure
+ :group 'org-appearance
+ :type 'boolean)
+
+(defcustom org-adapt-indentation nil
+ "Non-nil means adapt indentation to outline node level.
+
+When set to t, Org assumes that you write outlines by indenting
+text in each node to align with the headline, after the stars.
+
+When this variable is set to `headline-data', Org only adapts the
+indentation of the data lines right below the headline, such as
+planning/clock lines and property/logbook drawers.
+
+The following issues are influenced by this variable:
+
+- The indentation is increased by one space in a demotion
+ command, and decreased by one in a promotion command. However,
+ in the latter case, if shifting some line in the entry body
+ would alter document structure (e.g., insert a new headline),
+ indentation is not changed at all.
+
+- Property drawers and planning information is inserted indented
+ when this variable is set. When nil, they will not be indented.
+
+- TAB indents a line relative to current level. The lines below
+ a headline will be indented when this variable is set to t.
+
+Note that this is all about true indentation, by adding and
+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 '(choice
+ (const :tag "Adapt indentation for all lines" t)
+ (const :tag "Adapt indentation for headline data lines"
+ headline-data)
+ (const :tag "Do not adapt indentation at all" nil))
+ :safe (lambda (x) (memq x '(t nil headline-data))))
+
+(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.
+
+When t, `C-a' will bring back the cursor to the beginning of the
+headline text, i.e. after the stars and after a possible TODO
+keyword. In an item, this will be the position after bullet and
+check-box, if any. When the cursor is already at that position,
+another `C-a' will bring it to the beginning of the line.
+
+`C-e' will jump to the end of the headline, ignoring the presence
+of tags in the headline. A second `C-e' will then jump to the
+true end of the line, after any tags. This also means that, when
+this variable is non-nil, `C-e' also will never jump beyond the
+end of the heading of a folded section, i.e. not after the
+ellipses.
+
+When set to the symbol `reversed', the first `C-a' or `C-e' works
+normally, going to the true line boundary first. Only a directly
+following, identical keypress will bring the cursor to the
+special positions.
+
+This may also be a cons cell where the behavior for `C-a' and
+`C-e' is set separately."
+ :group 'org-edit-structure
+ :type '(choice
+ (const :tag "off" nil)
+ (const :tag "on: after stars/bullet and before tags first" t)
+ (const :tag "reversed: true line boundary first" reversed)
+ (cons :tag "Set C-a and C-e separately"
+ (choice :tag "Special C-a"
+ (const :tag "off" nil)
+ (const :tag "on: after stars/bullet first" t)
+ (const :tag "reversed: before stars/bullet first" reversed))
+ (choice :tag "Special C-e"
+ (const :tag "off" nil)
+ (const :tag "on: before tags first" t)
+ (const :tag "reversed: after tags first" reversed)))))
+
+(defcustom org-special-ctrl-k nil
+ "Non-nil means `C-k' will behave specially in headlines.
+When nil, `C-k' will call the default `kill-line' command.
+When t, the following will happen while the cursor is in the headline:
+
+- When at the beginning of a headline, kill the entire subtree.
+- When in the middle of the headline text, kill the text up to the tags.
+- When after the headline text and before the tags, kill all the tags."
+ :group 'org-edit-structure
+ :type 'boolean)
+
+(defcustom org-ctrl-k-protect-subtree nil
+ "Non-nil means, do not delete a hidden subtree with `C-k'.
+When set to the symbol `error', simply throw an error when `C-k' is
+used to kill (part-of) a headline that has hidden text behind it.
+Any other non-nil value will result in a query to the user, if it is
+OK to kill that hidden subtree. When nil, kill without remorse."
+ :group 'org-edit-structure
+ :version "24.1"
+ :type '(choice
+ (const :tag "Do not protect hidden subtrees" nil)
+ (const :tag "Protect hidden subtrees with a security query" t)
+ (const :tag "Never kill a hidden subtree with C-k" error)))
+
+(defcustom org-special-ctrl-o t
+ "Non-nil means, make `C-o' insert a row in tables."
+ :group 'org-edit-structure
+ :type 'boolean)
+
+(defcustom org-catch-invisible-edits nil
+ "Check if in invisible region before inserting or deleting a character.
+Valid values are:
+
+nil Do not check, so just do invisible edits.
+error Throw an error and do nothing.
+show Make point visible, and do the requested edit.
+show-and-error Make point visible, then throw an error and abort the edit.
+smart Make point visible, and do insertion/deletion if it is
+ adjacent to visible text and the change feels predictable.
+ Never delete a previously invisible character or add in the
+ middle or right after an invisible region. Basically, this
+ allows insertion and backward-delete right before ellipses.
+ FIXME: maybe in this case we should not even show?"
+ :group 'org-edit-structure
+ :version "24.1"
+ :type '(choice
+ (const :tag "Do not check" nil)
+ (const :tag "Throw error when trying to edit" error)
+ (const :tag "Unhide, but do not do the edit" show-and-error)
+ (const :tag "Show invisible part and do the edit" show)
+ (const :tag "Be smart and do the right thing" smart)))
+
+(defcustom org-yank-folded-subtrees t
+ "Non-nil means when yanking subtrees, fold them.
+If the kill is a single subtree, or a sequence of subtrees, i.e. if
+it starts with a heading and all other headings in it are either children
+or siblings, then fold all the subtrees. However, do this only if no
+text after the yank would be swallowed into a folded tree by this action."
+ :group 'org-edit-structure
+ :type 'boolean)
+
+(defcustom org-yank-adjusted-subtrees nil
+ "Non-nil means when yanking subtrees, adjust the level.
+With this setting, `org-paste-subtree' is used to insert the subtree, see
+this function for details."
+ :group 'org-edit-structure
+ :type 'boolean)
+
+(defcustom org-M-RET-may-split-line '((default . t))
+ "Non-nil means M-RET will split the line at the cursor position.
+When nil, it will go to the end of the line before making a
+new line.
+You may also set this option in a different way for different
+contexts. Valid contexts are:
+
+headline when creating a new headline
+item when creating a new item
+table in a table field
+default the value to be used for all contexts not explicitly
+ customized"
+ :group 'org-structure
+ :group 'org-table
+ :type '(choice
+ (const :tag "Always" t)
+ (const :tag "Never" nil)
+ (repeat :greedy t :tag "Individual contexts"
+ (cons
+ (choice :tag "Context"
+ (const headline)
+ (const item)
+ (const table)
+ (const default))
+ (boolean)))))
+
+
+(defcustom org-insert-heading-respect-content nil
+ "Non-nil means insert new headings after the current subtree.
+\\<org-mode-map>
+When nil, the new heading is created directly after the current line.
+The commands `\\[org-insert-heading-respect-content]' and \
+`\\[org-insert-todo-heading-respect-content]' turn this variable on
+for the duration of the command."
+ :group 'org-structure
+ :type 'boolean)
+
+(defcustom org-blank-before-new-entry '((heading . auto)
+ (plain-list-item . auto))
+ "Should `org-insert-heading' leave a blank line before new heading/item?
+The value is an alist, with `heading' and `plain-list-item' as CAR,
+and a boolean flag as CDR. The cdr may also be the symbol `auto', in
+which case Org will look at the surrounding headings/items and try to
+make an intelligent decision whether to insert a blank line or not."
+ :group 'org-edit-structure
+ :type '(list
+ (cons (const heading)
+ (choice (const :tag "Never" nil)
+ (const :tag "Always" t)
+ (const :tag "Auto" auto)))
+ (cons (const plain-list-item)
+ (choice (const :tag "Never" nil)
+ (const :tag "Always" t)
+ (const :tag "Auto" auto)))))
+
+(defcustom org-insert-heading-hook nil
+ "Hook being run after inserting a new heading."
+ :group 'org-edit-structure
+ :type 'hook)
+
+(defgroup org-sparse-trees nil
+ "Options concerning sparse trees in Org mode."
+ :tag "Org Sparse Trees"
+ :group 'org-structure)
+
+(defcustom org-highlight-sparse-tree-matches t
+ "Non-nil means highlight all matches that define a sparse tree.
+The highlights will automatically disappear the next time the buffer is
+changed by an edit command."
+ :group 'org-sparse-trees
+ :type 'boolean)
+
+(defcustom org-remove-highlights-with-change t
+ "Non-nil means any change to the buffer will remove temporary highlights.
+\\<org-mode-map>\
+Such highlights are created by `org-occur' and `org-clock-display'.
+When nil, `\\[org-ctrl-c-ctrl-c]' needs to be used \
+to get rid of the highlights.
+The highlights created by `org-latex-preview' always need
+`\\[org-latex-preview]' to be removed."
+ :group 'org-sparse-trees
+ :group 'org-time
+ :type 'boolean)
+
+(defcustom org-occur-case-fold-search t
+ "Non-nil means `org-occur' should be case-insensitive.
+If set to `smart' the search will be case-insensitive only if it
+doesn't specify any upper case character."
+ :group 'org-sparse-trees
+ :version "26.1"
+ :type '(choice
+ (const :tag "Case-sensitive" nil)
+ (const :tag "Case-insensitive" t)
+ (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.
+This can be used to recenter the window to show as much of the structure
+as possible."
+ :group 'org-sparse-trees
+ :type 'hook)
+
+(defcustom org-self-insert-cluster-for-undo nil
+ "Non-nil means cluster self-insert commands for undo when possible.
+If this is set, then, like in the Emacs command loop, 20 consecutive
+characters will be undone together.
+This is configurable, because there is some impact on typing performance."
+ :group 'org-table
+ :type 'boolean)
+
+(defvaralias 'org-activate-links 'org-highlight-links)
+(defcustom org-highlight-links '(bracket angle plain radio tag date footnote)
+ "Types of links that should be highlighted in Org files.
+
+This is a list of symbols, each one of them leading to the
+highlighting of a certain link type.
+
+You can still open links that are not highlighted.
+
+In principle, it does not hurt to turn on highlighting for all
+link types. There may be a small gain when turning off unused
+link types. The types are:
+
+bracket The recommended [[link][description]] or [[link]] links with hiding.
+angle Links in angular brackets that may contain whitespace like
+ <bbdb:Carsten Dominik>.
+plain Plain links in normal text, no whitespace, like https://gnu.org.
+radio Text that is matched by a radio target, see manual for details.
+tag Tag settings in a headline (link to tag search).
+date Time stamps (link to calendar).
+footnote Footnote labels.
+
+If you set this variable during an Emacs session, use `org-mode-restart'
+in the Org buffer so that the change takes effect."
+ :group 'org-appearance
+ :type '(set :greedy t
+ (const :tag "Double bracket links" bracket)
+ (const :tag "Angular bracket links" angle)
+ (const :tag "Plain text links" plain)
+ (const :tag "Radio target matches" radio)
+ (const :tag "Tags" tag)
+ (const :tag "Timestamps" date)
+ (const :tag "Footnotes" footnote)))
+
+(defcustom org-mark-ring-length 4
+ "Number of different positions to be recorded in the ring.
+Changing this requires a restart of Emacs to work correctly."
+ :group 'org-link-follow
+ :type 'integer)
+
+(defgroup org-todo nil
+ "Options concerning TODO items in Org mode."
+ :tag "Org TODO"
+ :group 'org)
+
+(defgroup org-progress nil
+ "Options concerning Progress logging in Org mode."
+ :tag "Org Progress"
+ :group 'org-time)
+
+(defvar org-todo-interpretation-widgets
+ '((:tag "Sequence (cycling hits every state)" sequence)
+ (:tag "Type (cycling directly to DONE)" type))
+ "The available interpretation symbols for customizing `org-todo-keywords'.
+Interested libraries should add to this list.")
+
+(defcustom org-todo-keywords '((sequence "TODO" "DONE"))
+ "List of TODO entry keyword sequences and their interpretation.
+\\<org-mode-map>This is a list of sequences.
+
+Each sequence starts with a symbol, either `sequence' or `type',
+indicating if the keywords should be interpreted as a sequence of
+action steps, or as different types of TODO items. The first
+keywords are states requiring action - these states will select a headline
+for inclusion into the global TODO list Org produces. If one of the
+\"keywords\" is the vertical bar, \"|\", the remaining keywords
+signify that no further action is necessary. If \"|\" is not found,
+the last keyword is treated as the only DONE state of the sequence.
+
+The command `\\[org-todo]' cycles an entry through these states, and one
+additional state where no keyword is present. For details about this
+cycling, see the manual.
+
+TODO keywords and interpretation can also be set on a per-file basis with
+the special #+SEQ_TODO and #+TYP_TODO lines.
+
+Each keyword can optionally specify a character for fast state selection
+\(in combination with the variable `org-use-fast-todo-selection')
+and specifiers for state change logging, using the same syntax that
+is used in the \"#+TODO:\" lines. For example, \"WAIT(w)\" says that
+the WAIT state can be selected with the \"w\" key. \"WAIT(w!)\"
+indicates to record a time stamp each time this state is selected.
+
+Each keyword may also specify if a timestamp or a note should be
+recorded when entering or leaving the state, by adding additional
+characters in the parenthesis after the keyword. This looks like this:
+\"WAIT(w@/!)\". \"@\" means to add a note (with time), \"!\" means to
+record only the time of the state change. With X and Y being either
+\"@\" or \"!\", \"X/Y\" means use X when entering the state, and use
+Y when leaving the state if and only if the *target* state does not
+define X. You may omit any of the fast-selection key or X or /Y,
+so WAIT(w@), WAIT(w/@) and WAIT(@/@) are all valid.
+
+For backward compatibility, this variable may also be just a list
+of keywords. In this case the interpretation (sequence or type) will be
+taken from the (otherwise obsolete) variable `org-todo-interpretation'."
+ :group 'org-todo
+ :group 'org-keywords
+ :type '(choice
+ (repeat :tag "Old syntax, just keywords"
+ (string :tag "Keyword"))
+ (repeat :tag "New syntax"
+ (cons
+ (choice
+ :tag "Interpretation"
+ ;;Quick and dirty way to see
+ ;;`org-todo-interpretation'. This takes the
+ ;;place of item arguments
+ :convert-widget
+ (lambda (widget)
+ (widget-put widget
+ :args (mapcar
+ (lambda (x)
+ (widget-convert
+ (cons 'const x)))
+ org-todo-interpretation-widgets))
+ widget))
+ (repeat
+ (string :tag "Keyword"))))))
+
+(defvar-local org-todo-keywords-1 nil
+ "All TODO and DONE keywords active in a buffer.")
+(defvar org-todo-keywords-for-agenda nil)
+(defvar org-done-keywords-for-agenda nil)
+(defvar org-todo-keyword-alist-for-agenda nil)
+(defvar org-tag-alist-for-agenda nil
+ "Alist of all tags from all agenda files.")
+(defvar org-tag-groups-alist-for-agenda nil
+ "Alist of all groups tags from all current agenda files.")
+(defvar-local org-tag-groups-alist nil)
+(defvar org-agenda-contributing-files nil)
+(defvar-local org-current-tag-alist nil
+ "Alist of all tag groups in current buffer.
+This variable takes into consideration `org-tag-alist',
+`org-tag-persistent-alist' and TAGS keywords in the buffer.")
+(defvar-local org-not-done-keywords nil)
+(defvar-local org-done-keywords nil)
+(defvar-local org-todo-heads nil)
+(defvar-local org-todo-sets nil)
+(defvar-local org-todo-log-states nil)
+(defvar-local org-todo-kwd-alist nil)
+(defvar-local org-todo-key-alist nil)
+(defvar-local org-todo-key-trigger nil)
+
+(defcustom org-todo-interpretation 'sequence
+ "Controls how TODO keywords are interpreted.
+This variable is in principle obsolete and is only used for
+backward compatibility, if the interpretation of todo keywords is
+not given already in `org-todo-keywords'. See that variable for
+more information."
+ :group 'org-todo
+ :group 'org-keywords
+ :type '(choice (const sequence)
+ (const type)))
+
+(defcustom org-use-fast-todo-selection 'auto
+ "\\<org-mode-map>\
+Non-nil means use the fast todo selection scheme with `\\[org-todo]'.
+This variable describes if and under what circumstances the cycling
+mechanism for TODO keywords will be replaced by a single-key, direct
+selection scheme, where the choices are displayed in a little window.
+
+When nil, fast selection is never used. This means that the command
+will always switch to the next state.
+
+When it is the symbol `auto', fast selection is whenever selection
+keys have been defined.
+
+`expert' is like `auto', but no special window with the keyword
+will be shown, choices will only be listed in the prompt.
+
+In all cases, the special interface is only used if access keys have
+actually been assigned by the user, i.e. if keywords in the configuration
+are followed by a letter in parenthesis, like TODO(t)."
+ :group 'org-todo
+ :set (lambda (var val)
+ (cond
+ ((eq var t) (set var 'auto))
+ ((eq var 'prefix) (set var nil))
+ (t (set var val))))
+ :type '(choice
+ (const :tag "Never" nil)
+ (const :tag "Automatically, when key letter have been defined" auto)
+ (const :tag "Automatically, but don't show the selection window" expert)))
+
+(defcustom org-provide-todo-statistics t
+ "Non-nil means update todo statistics after insert and toggle.
+ALL-HEADLINES means update todo statistics by including headlines
+with no TODO keyword as well, counting them as not done.
+A list of TODO keywords means the same, but skip keywords that are
+not in this list.
+When set to a list of two lists, the first list contains keywords
+to consider as TODO keywords, the second list contains keywords
+to consider as DONE keywords.
+
+When this is set, todo statistics is updated in the parent of the
+current entry each time a todo state is changed."
+ :group 'org-todo
+ :type '(choice
+ (const :tag "Yes, only for TODO entries" t)
+ (const :tag "Yes, including all entries" all-headlines)
+ (repeat :tag "Yes, for TODOs in this list"
+ (string :tag "TODO keyword"))
+ (list :tag "Yes, for TODOs and DONEs in these lists"
+ (repeat (string :tag "TODO keyword"))
+ (repeat (string :tag "DONE keyword")))
+ (other :tag "No TODO statistics" nil)))
+
+(defcustom org-hierarchical-todo-statistics t
+ "Non-nil means TODO statistics covers just direct children.
+When nil, all entries in the subtree are considered.
+This has only an effect if `org-provide-todo-statistics' is set.
+To set this to nil for only a single subtree, use a COOKIE_DATA
+property and include the word \"recursive\" into the value."
+ :group 'org-todo
+ :type 'boolean)
+
+(defcustom org-after-todo-state-change-hook nil
+ "Hook which is run after the state of a TODO item was changed.
+The new state (a string with a TODO keyword, or nil) is available in the
+Lisp variable `org-state'."
+ :group 'org-todo
+ :type 'hook)
+
+(defvar org-blocker-hook nil
+ "Hook for functions that are allowed to block a state change.
+
+Functions in this hook should not modify the buffer.
+Each function gets as its single argument a property list,
+see `org-trigger-hook' for more information about this list.
+
+If any of the functions in this hook returns nil, the state change
+is blocked.")
+
+(defvar org-trigger-hook nil
+ "Hook for functions that are triggered by a state change.
+
+Each function gets as its single argument a property list with at
+least the following elements:
+
+ (:type type-of-change :position pos-at-entry-start
+ :from old-state :to new-state)
+
+Depending on the type, more properties may be present.
+
+This mechanism is currently implemented for:
+
+TODO state changes
+------------------
+:type todo-state-change
+:from previous state (keyword as a string), or nil, or a symbol
+ `todo' or `done', to indicate the general type of state.
+:to new state, like in :from")
+
+(defcustom org-enforce-todo-dependencies nil
+ "Non-nil means undone TODO entries will block switching the parent to DONE.
+Also, if a parent has an :ORDERED: property, switching an entry to DONE will
+be blocked if any prior sibling is not yet done.
+Finally, if the parent is blocked because of ordered siblings of its own,
+the child will also be blocked."
+ :set (lambda (var val)
+ (set var val)
+ (if val
+ (add-hook 'org-blocker-hook
+ 'org-block-todo-from-children-or-siblings-or-parent)
+ (remove-hook 'org-blocker-hook
+ 'org-block-todo-from-children-or-siblings-or-parent)))
+ :group 'org-todo
+ :type 'boolean)
+
+(defcustom org-enforce-todo-checkbox-dependencies nil
+ "Non-nil means unchecked boxes will block switching the parent to DONE.
+When this is nil, checkboxes have no influence on switching TODO states.
+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 it while Emacs is running is through the customize interface."
+ :set (lambda (var val)
+ (set var val)
+ (if val
+ (add-hook 'org-blocker-hook
+ 'org-block-todo-from-checkboxes)
+ (remove-hook 'org-blocker-hook
+ 'org-block-todo-from-checkboxes)))
+ :group 'org-todo
+ :type 'boolean)
+
+(defcustom org-treat-insert-todo-heading-as-state-change nil
+ "Non-nil means inserting a TODO heading is treated as state change.
+So when the command `\\[org-insert-todo-heading]' is used, state change
+logging will apply if appropriate. When nil, the new TODO item will
+be inserted directly, and no logging will take place."
+ :group 'org-todo
+ :type 'boolean)
+
+(defcustom org-treat-S-cursor-todo-selection-as-state-change t
+ "Non-nil means switching TODO states with S-cursor counts as state change.
+This is the default behavior. However, setting this to nil allows a
+convenient way to select a TODO state and bypass any logging associated
+with that."
+ :group 'org-todo
+ :type 'boolean)
+
+(defcustom org-todo-state-tags-triggers nil
+ "Tag changes that should be triggered by TODO state changes.
+This is a list. Each entry is
+
+ (state-change (tag . flag) .......)
+
+State-change can be a string with a state, and empty string to indicate the
+state that has no TODO keyword, or it can be one of the symbols `todo'
+or `done', meaning any not-done or done state, respectively."
+ :group 'org-todo
+ :group 'org-tags
+ :type '(repeat
+ (cons (choice :tag "When changing to"
+ (const :tag "Not-done state" todo)
+ (const :tag "Done state" done)
+ (string :tag "State"))
+ (repeat
+ (cons :tag "Tag action"
+ (string :tag "Tag")
+ (choice (const :tag "Add" t) (const :tag "Remove" nil)))))))
+
+(defcustom org-log-done nil
+ "Information to record when a task moves to the DONE state.
+
+Possible values are:
+
+nil Don't add anything, just change the keyword
+time Add a time stamp to the task
+note Prompt for a note and add it with template `org-log-note-headings'
+
+This option can also be set with on a per-file-basis with
+
+ #+STARTUP: nologdone
+ #+STARTUP: logdone
+ #+STARTUP: lognotedone
+
+You can have local logging settings for a subtree by setting the LOGGING
+property to one or more of these keywords."
+ :group 'org-todo
+ :group 'org-progress
+ :type '(choice
+ (const :tag "No logging" nil)
+ (const :tag "Record CLOSED timestamp" time)
+ (const :tag "Record CLOSED timestamp with note." note)))
+
+;; Normalize old uses of org-log-done.
+(cond
+ ((eq org-log-done t) (setq org-log-done 'time))
+ ((and (listp org-log-done) (memq 'done org-log-done))
+ (setq org-log-done 'note)))
+
+(defcustom org-log-reschedule nil
+ "Information to record when the scheduling date of a task is modified.
+
+Possible values are:
+
+nil Don't add anything, just change the date
+time Add a time stamp to the task
+note Prompt for a note and add it with template `org-log-note-headings'
+
+This option can also be set with on a per-file-basis with
+
+ #+STARTUP: nologreschedule
+ #+STARTUP: logreschedule
+ #+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)))
+
+(defcustom org-log-redeadline nil
+ "Information to record when the deadline date of a task is modified.
+
+Possible values are:
+
+nil Don't add anything, just change the date
+time Add a time stamp to the task
+note Prompt for a note and add it with template `org-log-note-headings'
+
+This option can also be set with on a per-file-basis with
+
+ #+STARTUP: nologredeadline
+ #+STARTUP: logredeadline
+ #+STARTUP: lognoteredeadline
+
+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-deadline' or
+`org-agenda-deadline' 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)))
+
+(defcustom org-log-note-clock-out nil
+ "Non-nil means record a note when clocking out of an item.
+This can also be configured on a per-file basis by adding one of
+the following lines anywhere in the buffer:
+
+ #+STARTUP: lognoteclock-out
+ #+STARTUP: nolognoteclock-out"
+ :group 'org-todo
+ :group 'org-progress
+ :type 'boolean)
+
+(defcustom org-log-done-with-time t
+ "Non-nil means the CLOSED time stamp will contain date and time.
+When nil, only the date will be recorded."
+ :group 'org-progress
+ :type 'boolean)
+
+(defcustom org-log-note-headings
+ '((done . "CLOSING NOTE %t")
+ (state . "State %-12s from %-12S %t")
+ (note . "Note taken on %t")
+ (reschedule . "Rescheduled from %S on %t")
+ (delschedule . "Not scheduled, was %S on %t")
+ (redeadline . "New deadline from %S on %t")
+ (deldeadline . "Removed deadline, was %S on %t")
+ (refile . "Refiled on %t")
+ (clock-out . ""))
+ "Headings for notes added to entries.
+
+The value is an alist, with the car being a symbol indicating the
+note context, and the cdr is the heading to be used. The heading
+may also be the empty string. The following placeholders can be
+used:
+
+ %t a time stamp.
+ %T an active time stamp instead the default inactive one
+ %d a short-format time stamp.
+ %D an active short-format time stamp.
+ %s the new TODO state or time stamp (inactive), in double quotes.
+ %S the old TODO state or time stamp (inactive), in double quotes.
+ %u the user name.
+ %U full user name.
+
+In fact, it is not a good idea to change the `state' entry,
+because Agenda Log mode depends on the format of these entries."
+ :group 'org-todo
+ :group 'org-progress
+ :type '(list :greedy t
+ (cons (const :tag "Heading when closing an item" done) string)
+ (cons (const :tag
+ "Heading when changing todo state (todo sequence only)"
+ state) string)
+ (cons (const :tag "Heading when just taking a note" note) string)
+ (cons (const :tag "Heading when rescheduling" reschedule) string)
+ (cons (const :tag "Heading when an item is no longer scheduled" delschedule) string)
+ (cons (const :tag "Heading when changing deadline" redeadline) string)
+ (cons (const :tag "Heading when deleting a deadline" deldeadline) string)
+ (cons (const :tag "Heading when refiling" refile) string)
+ (cons (const :tag "Heading when clocking out" clock-out) string)))
+
+(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
+any scheduling and clock lines, but not inside a drawer.
+
+The value of this variable should be the name of the drawer to use.
+LOGBOOK is proposed as the default drawer for this purpose, you can
+also set this to a string to define the drawer of your choice.
+
+A value of t is also allowed, representing \"LOGBOOK\".
+
+A value of t or nil can also be set with on a per-file-basis with
+
+ #+STARTUP: logdrawer
+ #+STARTUP: nologdrawer
+
+If this variable is set, `org-log-state-notes-insert-after-drawers'
+will be ignored.
+
+You can set the property LOG_INTO_DRAWER to overrule this setting for
+a subtree.
+
+Do not check directly this variable in a Lisp program. Call
+function `org-log-into-drawer' instead."
+ :group 'org-todo
+ :group 'org-progress
+ :type '(choice
+ (const :tag "Not into a drawer" nil)
+ (const :tag "LOGBOOK" t)
+ (string :tag "Other")))
+
+(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
+current entry has or inherits a LOG_INTO_DRAWER property, it will
+be used instead of the default value."
+ (let ((p (org-entry-get nil "LOG_INTO_DRAWER" 'inherit t)))
+ (cond ((equal p "nil") nil)
+ ((equal p "t") "LOGBOOK")
+ ((stringp p) p)
+ (p "LOGBOOK")
+ ((stringp org-log-into-drawer) org-log-into-drawer)
+ (org-log-into-drawer "LOGBOOK"))))
+
+(defcustom org-log-state-notes-insert-after-drawers nil
+ "Non-nil means insert state change notes after any drawers in entry.
+Only the drawers that *immediately* follow the headline and the
+deadline/scheduled line are skipped.
+When nil, insert notes right after the heading and perhaps the line
+with deadline/scheduling if present.
+
+This variable will have no effect if `org-log-into-drawer' is
+set."
+ :group 'org-todo
+ :group 'org-progress
+ :type 'boolean)
+
+(defcustom org-log-states-order-reversed t
+ "Non-nil means the latest state note will be directly after heading.
+When nil, the state change notes will be ordered according to time.
+
+This option can also be set with on a per-file-basis with
+
+ #+STARTUP: logstatesreversed
+ #+STARTUP: nologstatesreversed"
+ :group 'org-todo
+ :group 'org-progress
+ :type 'boolean)
+
+(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 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 "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.
+An auto-repeating task is immediately switched back to TODO when
+marked DONE. If you are not logging state changes (by adding \"@\"
+or \"!\" to the TODO keyword definition), or set `org-log-done' to
+record a closing note, there will be no record of the task moving
+through DONE. This variable forces taking a note anyway.
+
+nil Don't force a record
+time Record a time stamp
+note Prompt for a note and add it with template `org-log-note-headings'
+
+This option can also be set with on a per-file-basis with
+
+ #+STARTUP: nologrepeat
+ #+STARTUP: logrepeat
+ #+STARTUP: lognoterepeat
+
+You can have local logging settings for a subtree by setting the LOGGING
+property to one or more of these keywords."
+ :group 'org-todo
+ :group 'org-progress
+ :type '(choice
+ (const :tag "Don't force a record" nil)
+ (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."
+ :tag "Org Priorities"
+ :group 'org-todo)
+
+(defvaralias 'org-enable-priority-commands 'org-priority-enable-commands)
+(defcustom org-priority-enable-commands t
+ "Non-nil means priority commands are active.
+When nil, these commands will be disabled, so that you never accidentally
+set a priority."
+ :group 'org-priorities
+ :type 'boolean)
+
+(defvaralias 'org-highest-priority 'org-priority-highest)
+
+(defcustom org-priority-highest ?A
+ "The highest priority of TODO items.
+
+A character like ?A, ?B, etc., or a numeric value like 1, 2, etc.
+
+The default is the character ?A, which is 65 as a numeric value.
+
+If you set `org-priority-highest' to a numeric value inferior to
+65, Org assumes you want to use digits for the priority cookie.
+If you set it to >=65, Org assumes you want to use alphabetical
+characters.
+
+In both cases, the value of `org-priority-highest' must be
+smaller than `org-priority-lowest': for example, if \"A\" is the
+highest priority, it is smaller than the lowest \"C\" priority:
+65 < 67."
+ :group 'org-priorities
+ :type '(choice
+ (character :tag "Character")
+ (integer :tag "Integer (< 65)")))
+
+(defvaralias 'org-lowest-priority 'org-priority-lowest)
+(defcustom org-priority-lowest ?C
+ "The lowest priority of TODO items.
+
+A character like ?C, ?B, etc., or a numeric value like 9, 8, etc.
+
+The default is the character ?C, which is 67 as a numeric value.
+
+If you set `org-priority-lowest' to a numeric value inferior to
+65, Org assumes you want to use digits for the priority cookie.
+If you set it to >=65, Org assumes you want to use alphabetical
+characters.
+
+In both cases, the value of `org-priority-lowest' must be greater
+than `org-priority-highest': for example, if \"C\" is the lowest
+priority, it is greater than the highest \"A\" priority: 67 >
+65."
+ :group 'org-priorities
+ :type '(choice
+ (character :tag "Character")
+ (integer :tag "Integer (< 65)")))
+
+(defvaralias 'org-default-priority 'org-priority-default)
+(defcustom org-priority-default ?B
+ "The default priority of TODO items.
+This is the priority an item gets if no explicit priority is given.
+When starting to cycle on an empty priority the first step in the cycle
+depends on `org-priority-start-cycle-with-default'. The resulting first
+step priority must not exceed the range from `org-priority-highest' to
+`org-priority-lowest' which means that `org-priority-default' has to be
+in this range exclusive or inclusive to the range boundaries. Else the
+first step refuses to set the default and the second will fall back on
+\(depending on the command used) the highest or lowest priority."
+ :group 'org-priorities
+ :type '(choice
+ (character :tag "Character")
+ (integer :tag "Integer (< 65)")))
+
+(defcustom org-priority-start-cycle-with-default t
+ "Non-nil means start with default priority when starting to cycle.
+When this is nil, the first step in the cycle will be (depending on the
+command used) one higher or lower than the default priority.
+See also `org-priority-default'."
+ :group 'org-priorities
+ :type 'boolean)
+
+(defvaralias 'org-get-priority-function 'org-priority-get-priority-function)
+(defcustom org-priority-get-priority-function nil
+ "Function to extract the priority from a string.
+The string is normally the headline. If this is nil, Org
+computes the priority from the priority cookie like [#A] in the
+headline. It returns an integer, increasing by 1000 for each
+priority level.
+
+The user can set a different function here, which should take a
+string as an argument and return the numeric priority."
+ :group 'org-priorities
+ :version "24.1"
+ :type '(choice
+ (const nil)
+ (function)))
+
+(defgroup org-time nil
+ "Options concerning time stamps and deadlines in Org mode."
+ :tag "Org Time"
+ :group 'org)
+
+(defcustom org-time-stamp-rounding-minutes '(0 5)
+ "Number of minutes to round time stamps to.
+\\<org-mode-map>\
+These are two values, the first applies when first creating a time stamp.
+The second applies when changing it with the commands `S-up' and `S-down'.
+When changing the time stamp, this means that it will change in steps
+of N minutes, as given by the second value.
+
+When a setting is 0 or 1, insert the time unmodified. Useful rounding
+numbers should be factors of 60, so for example 5, 10, 15.
+
+When this is larger than 1, you can still force an exact time stamp by using
+a double prefix argument to a time stamp command like \
+`\\[org-time-stamp]' or `\\[org-time-stamp-inactive],
+and by using a prefix arg to `S-up/down' to specify the exact number
+of minutes to shift."
+ :group 'org-time
+ :get (lambda (var) ; Make sure both elements are there
+ (if (integerp (default-value var))
+ (list (default-value var) 5)
+ (default-value var)))
+ :type '(list
+ (integer :tag "when inserting times")
+ (integer :tag "when modifying times")))
+
+;; Normalize old customizations of this variable.
+(when (integerp org-time-stamp-rounding-minutes)
+ (setq org-time-stamp-rounding-minutes
+ (list org-time-stamp-rounding-minutes
+ org-time-stamp-rounding-minutes)))
+
+(defcustom org-display-custom-times nil
+ "Non-nil means overlay custom formats over all time stamps.
+The formats are defined through the variable `org-time-stamp-custom-formats'.
+To turn this on on a per-file basis, insert anywhere in the file:
+ #+STARTUP: customtime"
+ :group 'org-time
+ :set 'set-default
+ :type 'sexp)
+(make-variable-buffer-local 'org-display-custom-times)
+
+(defcustom org-time-stamp-custom-formats
+ '("<%m/%d/%y %a>" . "<%m/%d/%y %a %H:%M>") ; american
+ "Custom formats for time stamps. See `format-time-string' for the syntax.
+These are overlaid over the default ISO format if the variable
+`org-display-custom-times' is set. Time like %H:%M should be at the
+end of the second format. The custom formats are also honored by export
+commands, if custom time display is turned on at the time of export."
+ :group 'org-time
+ :type 'sexp)
+
+(defun org-time-stamp-format (&optional long inactive)
+ "Get the right format for a time string."
+ (let ((f (if long (cdr org-time-stamp-formats)
+ (car org-time-stamp-formats))))
+ (if inactive
+ (concat "[" (substring f 1 -1) "]")
+ f)))
+
+(defcustom org-deadline-warning-days 14
+ "Number of days before expiration during which a deadline becomes active.
+This variable governs the display in sparse trees and in the agenda.
+When 0 or negative, it means use this number (the absolute value of it)
+even if a deadline has a different individual lead time specified.
+
+Custom commands can set this variable in the options section."
+ :group 'org-time
+ :group 'org-agenda-daily/weekly
+ :type 'integer)
+
+(defcustom org-scheduled-delay-days 0
+ "Number of days before a scheduled item becomes active.
+This variable governs the display in sparse trees and in the agenda.
+The default value (i.e. 0) means: don't delay scheduled item.
+When negative, it means use this number (the absolute value of it)
+even if a scheduled item has a different individual delay time
+specified.
+
+Custom commands can set this variable in the options section."
+ :group 'org-time
+ :group 'org-agenda-daily/weekly
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'integer)
+
+(defcustom org-read-date-prefer-future t
+ "Non-nil means assume future for incomplete date input from user.
+This affects the following situations:
+1. The user gives a month but not a year.
+ For example, if it is April and you enter \"feb 2\", this will be read
+ as Feb 2, *next* year. \"May 5\", however, will be this year.
+2. The user gives a day, but no month.
+ For example, if today is the 15th, and you enter \"3\", Org will read
+ this as the third of *next* month. However, if you enter \"17\",
+ it will be considered as *this* month.
+
+If you set this variable to the symbol `time', then also the following
+will work:
+
+3. If the user gives a time.
+ If the time is before now, it will be interpreted as tomorrow.
+
+Currently none of this works for ISO week specifications.
+
+When this option is nil, the current day, month and year will always be
+used as defaults.
+
+See also `org-agenda-jump-prefer-future'."
+ :group 'org-time
+ :type '(choice
+ (const :tag "Never" nil)
+ (const :tag "Check month and day" t)
+ (const :tag "Check month, day, and time" time)))
+
+(defcustom org-agenda-jump-prefer-future 'org-read-date-prefer-future
+ "Should the agenda jump command prefer the future for incomplete dates?
+The default is to do the same as configured in `org-read-date-prefer-future'.
+But you can also set a deviating value here.
+This may t or nil, or the symbol `org-read-date-prefer-future'."
+ :group 'org-agenda
+ :group 'org-time
+ :version "24.1"
+ :type '(choice
+ (const :tag "Use org-read-date-prefer-future"
+ org-read-date-prefer-future)
+ (const :tag "Never" nil)
+ (const :tag "Always" t)))
+
+(defcustom org-read-date-force-compatible-dates t
+ "Should date/time prompt force dates that are guaranteed to work in Emacs?
+
+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 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.
+
+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
+a message and beep.
+
+When this variable is nil, Org will check if the date is
+representable in the specific Emacs implementation you are using.
+If not, it will force a year, usually the current year, and beep
+to remind you. Currently this setting is not recommended because
+the likelihood that you will open your Org files in an Emacs that
+has limited date range is not negligible.
+
+A workaround for this problem is to use diary sexp dates for time
+stamps outside of this range."
+ :group 'org-time
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-read-date-display-live t
+ "Non-nil means display current interpretation of date prompt live.
+This display will be in an overlay, in the minibuffer. Note that
+live display is only active when `org-read-date-popup-calendar'
+is non-nil."
+ :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
+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)
+
+(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\". 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.
+ Also, timestamps inserted in capture templates follow this rule.
+
+IMPORTANT: This is a feature whose implementation is and likely will
+remain incomplete. Really, it is only here because past midnight seems to
+be the favorite working time of John Wiegley :-)"
+ :group 'org-time
+ :type 'integer)
+
+(defcustom org-use-effective-time nil
+ "If non-nil, consider `org-extend-today-until' when creating timestamps.
+For example, if `org-extend-today-until' is 8, and it's 4am, then the
+\"effective time\" of any timestamps between midnight and 8am will be
+23:59 of the previous day."
+ :group 'org-time
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-use-last-clock-out-time-as-effective-time nil
+ "When non-nil, use the last clock out time for `org-todo'.
+Note that this option has precedence over the combined use of
+`org-use-effective-time' and `org-extend-today-until'."
+ :group 'org-time
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defcustom org-edit-timestamp-down-means-later nil
+ "Non-nil means S-down will increase the time in a time stamp.
+When nil, S-up will increase."
+ :group 'org-time
+ :type 'boolean)
+
+(defcustom org-calendar-follow-timestamp-change t
+ "Non-nil means make the calendar window follow timestamp changes.
+When a timestamp is modified and the calendar window is visible, it will be
+moved to the new date."
+ :group 'org-time
+ :type 'boolean)
+
+(defgroup org-tags nil
+ "Options concerning tags in Org mode."
+ :tag "Org Tags"
+ :group 'org)
+
+(defcustom org-tag-alist nil
+ "Default tags available in Org files.
+
+The value of this variable is an alist. Associations either:
+
+ (TAG)
+ (TAG . SELECT)
+ (SPECIAL)
+
+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', `:endgroup', `:endgrouptag' or
+`:newline'. These keywords are used to define a hierarchy of
+tags. See manual for details.
+
+When this variable is nil, Org mode bases tag input on what is
+already in the buffer. The value can be overridden locally by
+using a TAGS keyword, e.g.,
+
+ #+TAGS: tag1 tag2
+
+See also `org-tag-persistent-alist' to sidestep this behavior."
+ :group 'org-tags
+ :type '(repeat
+ (choice
+ (cons :tag "Tag with key"
+ (string :tag "Tag name")
+ (character :tag "Access char"))
+ (list :tag "Tag" (string :tag "Tag name"))
+ (const :tag "Start radio group" (:startgroup))
+ (const :tag "Start tag group, non distinct" (:startgrouptag))
+ (const :tag "Group tags delimiter" (:grouptags))
+ (const :tag "End radio group" (:endgroup))
+ (const :tag "End tag group, non distinct" (:endgrouptag))
+ (const :tag "New line" (:newline)))))
+
+(defcustom org-tag-persistent-alist nil
+ "Tags always available in Org files.
+
+The value of this variable is an alist. Associations either:
+
+ (TAG)
+ (TAG . SELECT)
+ (SPECIAL)
+
+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', `:endgroup', `:endgrouptag' or
+`:newline'. These keywords are used to define a hierarchy of
+tags. See manual for details.
+
+Unlike to `org-tag-alist', tags defined in this variable do not
+depend on a local TAGS keyword. Instead, to disable these tags
+on a per-file basis, insert anywhere in the file:
+
+ #+STARTUP: noptag"
+ :group 'org-tags
+ :type '(repeat
+ (choice
+ (cons :tag "Tag with key"
+ (string :tag "Tag name")
+ (character :tag "Access char"))
+ (list :tag "Tag" (string :tag "Tag name"))
+ (const :tag "Start radio group" (:startgroup))
+ (const :tag "Start tag group, non distinct" (:startgrouptag))
+ (const :tag "Group tags delimiter" (:grouptags))
+ (const :tag "End radio group" (:endgroup))
+ (const :tag "End tag group, non distinct" (:endgrouptag))
+ (const :tag "New line" (:newline)))))
+
+(defcustom org-complete-tags-always-offer-all-agenda-tags nil
+ "If non-nil, always offer completion for all tags of all agenda files.
+
+Setting this variable locally allows for dynamic generation of tag
+completions in capture buffers.
+
+ (add-hook \\='org-capture-mode-hook
+ (lambda ()
+ (setq-local org-complete-tags-always-offer-all-agenda-tags t)))"
+ :group 'org-tags
+ :version "24.1"
+ :type 'boolean)
+
+(defvar org-file-tags nil
+ "List of tags that can be inherited by all entries in the file.
+The tags will be inherited if the variable `org-use-tag-inheritance'
+says they should be.
+This variable is populated from #+FILETAGS lines.")
+
+(defcustom org-use-fast-tag-selection 'auto
+ "Non-nil means use fast tag selection scheme.
+This is a special interface to select and deselect tags with single keys.
+When nil, fast selection is never used.
+When the symbol `auto', fast selection is used if and only if selection
+characters for tags have been configured, either through the variable
+`org-tag-alist' or through a #+TAGS line in the buffer.
+When t, fast selection is always used and selection keys are assigned
+automatically if necessary."
+ :group 'org-tags
+ :type '(choice
+ (const :tag "Always" t)
+ (const :tag "Never" nil)
+ (const :tag "When selection characters are configured" auto)))
+
+(defcustom org-fast-tag-selection-single-key nil
+ "Non-nil means fast tag selection exits after first change.
+When nil, you have to press RET to exit it.
+During fast tag selection, you can toggle this flag with `C-c'.
+This variable can also have the value `expert'. In this case, the window
+displaying the tags menu is not even shown, until you press `C-c' again."
+ :group 'org-tags
+ :type '(choice
+ (const :tag "No" nil)
+ (const :tag "Yes" t)
+ (const :tag "Expert" expert)))
+
+(defvar org-fast-tag-selection-include-todo nil
+ "Non-nil means fast tags selection interface will also offer TODO states.
+This is an undocumented feature, you should not rely on it.")
+
+(defcustom org-tags-column -77
+ "The column to which tags should be indented in a headline.
+If this number is positive, it specifies the column. If it is negative,
+it means that the tags should be flushright to that column. For example,
+-80 works well for a normal 80 character screen.
+When 0, place tags directly after headline text, with only one space in
+between."
+ :group 'org-tags
+ :type 'integer)
+
+(defcustom org-auto-align-tags t
+ "Non-nil keeps tags aligned when modifying headlines.
+Some operations (i.e. demoting) change the length of a headline and
+therefore shift the tags around. With this option turned on, after
+each such operation the tags are again aligned to `org-tags-column'."
+ :group 'org-tags
+ :type 'boolean)
+
+(defcustom org-use-tag-inheritance t
+ "Non-nil means tags in levels apply also for sublevels.
+When nil, only the tags directly given in a specific line apply there.
+This may also be a list of tags that should be inherited, or a regexp that
+matches tags that should be inherited. Additional control is possible
+with the variable `org-tags-exclude-from-inheritance' which gives an
+explicit list of tags to be excluded from inheritance, even if the value of
+`org-use-tag-inheritance' would select it for inheritance.
+
+If this option is t, a match early-on in a tree can lead to a large
+number of matches in the subtree when constructing the agenda or creating
+a sparse tree. If you only want to see the first match in a tree during
+a search, check out the variable `org-tags-match-list-sublevels'."
+ :group 'org-tags
+ :type '(choice
+ (const :tag "Not" nil)
+ (const :tag "Always" t)
+ (repeat :tag "Specific tags" (string :tag "Tag"))
+ (regexp :tag "Tags matched by regexp")))
+
+(defcustom org-tags-exclude-from-inheritance nil
+ "List of tags that should never be inherited.
+This is a way to exclude a few tags from inheritance. For way to do
+the opposite, to actively allow inheritance for selected tags,
+see the variable `org-use-tag-inheritance'."
+ :group 'org-tags
+ :type '(repeat (string :tag "Tag")))
+
+(defun org-tag-inherit-p (tag)
+ "Check if TAG is one that should be inherited."
+ (cond
+ ((member tag org-tags-exclude-from-inheritance) nil)
+ ((eq org-use-tag-inheritance t) t)
+ ((not org-use-tag-inheritance) nil)
+ ((stringp org-use-tag-inheritance)
+ (string-match org-use-tag-inheritance tag))
+ ((listp org-use-tag-inheritance)
+ (member tag org-use-tag-inheritance))
+ (t (error "Invalid setting of `org-use-tag-inheritance'"))))
+
+(defcustom org-tags-match-list-sublevels t
+ "Non-nil means list also sublevels of headlines matching a search.
+This variable applies to tags/property searches, and also to stuck
+projects because this search is based on a tags match as well.
+
+When set to the symbol `indented', sublevels are indented with
+leading dots.
+
+Because of tag inheritance (see variable `org-use-tag-inheritance'),
+the sublevels of a headline matching a tag search often also match
+the same search. Listing all of them can create very long lists.
+Setting this variable to nil causes subtrees of a match to be skipped.
+
+This variable is semi-obsolete and probably should always be true. It
+is better to limit inheritance to certain tags using the variables
+`org-use-tag-inheritance' and `org-tags-exclude-from-inheritance'."
+ :group 'org-tags
+ :type '(choice
+ (const :tag "No, don't list them" nil)
+ (const :tag "Yes, do list them" t)
+ (const :tag "List them, indented with leading dots" indented)))
+
+(defcustom org-tags-sort-function nil
+ "When set, tags are sorted using this function as a comparator."
+ :group 'org-tags
+ :type '(choice
+ (const :tag "No sorting" nil)
+ (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
+ "History of minibuffer reads for tags.")
+(defvar org-last-tags-completion-table nil
+ "The last used completion table for tags.")
+(defvar org-after-tags-change-hook nil
+ "Hook that is run after the tags in a line have changed.")
+
+(defgroup org-properties nil
+ "Options concerning properties in Org mode."
+ :tag "Org Properties"
+ :group 'org)
+
+(defcustom org-property-format "%-10s %s"
+ "How property key/value pairs should be formatted by `indent-line'.
+When `indent-line' hits a property definition, it will format the line
+according to this format, mainly to make sure that the values are
+lined-up with respect to each other."
+ :group 'org-properties
+ :type 'string)
+
+(defcustom org-properties-postprocess-alist nil
+ "Alist of properties and functions to adjust inserted values.
+Elements of this alist must be of the form
+
+ ([string] [function])
+
+where [string] must be a property name and [function] must be a
+lambda expression: this lambda expression must take one argument,
+the value to adjust, and return the new value as a string.
+
+For example, this element will allow the property \"Remaining\"
+to be updated wrt the relation between the \"Effort\" property
+and the clock summary:
+
+ ((\"Remaining\" (lambda(value)
+ (let ((clocksum (org-clock-sum-current-item))
+ (effort (org-duration-to-minutes
+ (org-entry-get (point) \"Effort\"))))
+ (org-minutes-to-clocksum-string (- effort clocksum))))))"
+ :group 'org-properties
+ :version "24.1"
+ :type '(alist :key-type (string :tag "Property")
+ :value-type (function :tag "Function")))
+
+(defcustom org-use-property-inheritance nil
+ "Non-nil means properties apply also for sublevels.
+
+This setting is chiefly used during property searches. Turning it on can
+cause significant overhead when doing a search, which is why it is not
+on by default.
+
+When nil, only the properties directly given in the current entry count.
+When t, every property is inherited. The value may also be a list of
+properties that should have inheritance, or a regular expression matching
+properties that should be inherited.
+
+However, note that some special properties use inheritance under special
+circumstances (not in searches). Examples are CATEGORY, ARCHIVE, COLUMNS,
+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
+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
+in this variable)."
+ :group 'org-properties
+ :type '(choice
+ (const :tag "Not" nil)
+ (const :tag "Always" t)
+ (repeat :tag "Specific properties" (string :tag "Property"))
+ (regexp :tag "Properties matched by regexp")))
+
+(defun org-property-inherit-p (property)
+ "Return a non-nil value if PROPERTY should be inherited."
+ (cond
+ ((eq org-use-property-inheritance t) t)
+ ((not org-use-property-inheritance) nil)
+ ((stringp org-use-property-inheritance)
+ (string-match org-use-property-inheritance property))
+ ((listp org-use-property-inheritance)
+ (member-ignore-case property org-use-property-inheritance))
+ (t (error "Invalid setting of `org-use-property-inheritance'"))))
+
+(defcustom org-columns-default-format "%25ITEM %TODO %3PRIORITY %TAGS"
+ "The default column format, if no other format has been defined.
+This variable can be set on the per-file basis by inserting a line
+
+#+COLUMNS: %25ITEM ....."
+ :group 'org-properties
+ :type 'string)
+
+(defcustom org-columns-default-format-for-agenda nil
+ "The default column format in an agenda buffer.
+This will be used for column view in the agenda unless a format has
+been set by adding `org-overriding-columns-format' to the local
+settings list of a custom agenda view. When nil, the columns format
+for the first item in the agenda list will be used, or as a fall-back,
+`org-columns-default-format'."
+ :group 'org-properties
+ :type '(choice
+ (const :tag "No default" nil)
+ (string :tag "Format string")))
+
+(defcustom org-columns-ellipses ".."
+ "The ellipses to be used when a field in column view is truncated.
+When this is the empty string, as many characters as possible are shown,
+but then there will be no visual indication that the field has been truncated.
+When this is a string of length N, the last N characters of a truncated
+field are replaced by this string. If the column is narrower than the
+ellipses string, only part of the ellipses string will be shown."
+ :group 'org-properties
+ :type 'string)
+
+(defconst org-global-properties-fixed
+ '(("VISIBILITY_ALL" . "folded children content all")
+ ("CLOCK_MODELINE_TOTAL_ALL" . "current today repeat all auto"))
+ "List of property/value pairs that can be inherited by any entry.
+
+These are fixed values, for the preset properties. The user variable
+that can be used to add to this list is `org-global-properties'.
+
+The entries in this list are cons cells where the car is a property
+name and cdr is a string with the value. If the value represents
+multiple items like an \"_ALL\" property, separate the items by
+spaces.")
+
+(defcustom org-global-properties nil
+ "List of property/value pairs that can be inherited by any entry.
+
+This list will be combined with the constant `org-global-properties-fixed'.
+
+The entries in this list are cons cells where the car is a property
+name and cdr is a string with the value.
+
+Buffer local properties are added either by a document property drawer
+
+:PROPERTIES:
+:NAME: VALUE
+:END:
+
+or by adding lines like
+
+#+PROPERTY: NAME VALUE"
+ :group 'org-properties
+ :type '(repeat
+ (cons (string :tag "Property")
+ (string :tag "Value"))))
+
+(defvar-local org-keyword-properties nil
+ "List of property/value pairs inherited by any entry.
+
+Valid for the current buffer. This variable is populated from
+PROPERTY keywords.
+
+Note that properties are defined also in property drawers.
+Properties defined there take precedence over properties defined
+as keywords.")
+
+(defgroup org-agenda nil
+ "Options concerning agenda views in Org mode."
+ :tag "Org Agenda"
+ :group 'org)
+
+(defvar-local org-category nil
+ "Variable used by Org files to set a category for agenda display.
+There are multiple ways to set the category. One way is to set
+it in the document property drawer. For example:
+
+:PROPERTIES:
+:CATEGORY: ELisp
+:END:
+
+Other ways to define it is as an Emacs file variable, for example
+
+# -*- mode: org; org-category: \"ELisp\"
+
+or for the file to contain a special line:
+
+#+CATEGORY: ELisp
+
+If the file does not specify a category, then file's base name
+is used instead.")
+(put 'org-category 'safe-local-variable (lambda (x) (or (symbolp x) (stringp x))))
+
+(defcustom org-agenda-files nil
+ "The files to be used for agenda display.
+
+If an entry is a directory, all files in that directory that are matched
+by `org-agenda-file-regexp' will be part of the file list.
+
+If the value of the variable is not a list but a single file name, then
+the list of agenda files is actually stored and maintained in that file,
+one agenda file per line. In this file paths can be given relative to
+`org-directory'. Tilde expansion and environment variable substitution
+are also made.
+
+Entries may be added to this list with `\\[org-agenda-file-to-front]'
+and removed with `\\[org-remove-file]'."
+ :group 'org-agenda
+ :type '(choice
+ (repeat :tag "List of files and directories" file)
+ (file :tag "Store list in a file\n" :value "~/.agenda_files")))
+
+(defcustom org-agenda-file-regexp "\\`[^.].*\\.org\\'"
+ "Regular expression to match files for `org-agenda-files'.
+If any element in the list in that variable contains a directory instead
+of a normal file, all files in that directory that are matched by this
+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
+commands `org-search-view' (`\\[org-agenda] s') \
+and `org-occur-in-agenda-files'.
+Note that these files will only be searched for text search commands,
+not for the other agenda views like todo lists, tag searches or the weekly
+agenda. This variable is intended to list notes and possibly archive files
+that should also be searched by these two commands.
+In fact, if the first element in the list is the symbol `agenda-archives',
+then all archive files of all agenda files will be added to the search
+scope."
+ :group 'org-agenda
+ :type '(set :greedy t
+ (const :tag "Agenda Archives" agenda-archives)
+ (repeat :inline t (file))))
+
+(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)
+
+(defgroup org-latex nil
+ "Options for embedding LaTeX code into Org mode."
+ :tag "Org LaTeX"
+ :group 'org)
+
+(defcustom org-format-latex-options
+ '(:foreground default :background default :scale 1.0
+ :html-foreground "Black" :html-background "Transparent"
+ :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\["))
+ "Options for creating images from LaTeX fragments.
+This is a property list with the following properties:
+:foreground the foreground color for images embedded in Emacs, e.g. \"Black\".
+ `default' means use the foreground of the default face.
+ `auto' means use the foreground from the text face.
+:background the background color, or \"Transparent\".
+ `default' means use the background of the default face.
+ `auto' means use the background from the text face.
+:scale a scaling factor for the size of the images, to get more pixels
+:html-foreground, :html-background, :html-scale
+ the same numbers for HTML export.
+:matchers a list indicating which matchers should be used to
+ find LaTeX fragments. Valid members of this list are:
+ \"begin\" find environments
+ \"$1\" find single characters surrounded by $.$
+ \"$\" find math expressions surrounded by $...$
+ \"$$\" find math expressions surrounded by $$....$$
+ \"\\(\" find math expressions surrounded by \\(...\\)
+ \"\\=\\[\" find math expressions surrounded by \\=\\[...\\]"
+ :group 'org-latex
+ :type 'plist)
+
+(defcustom org-format-latex-signal-error t
+ "Non-nil means signal an error when image creation of LaTeX snippets fails.
+When nil, just push out a message."
+ :group 'org-latex
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-latex-to-mathml-jar-file nil
+ "Value of\"%j\" in `org-latex-to-mathml-convert-command'.
+Use this to specify additional executable file say a jar file.
+
+When using MathToWeb as the converter, specify the full-path to
+your mathtoweb.jar file."
+ :group 'org-latex
+ :version "24.1"
+ :type '(choice
+ (const :tag "None" nil)
+ (file :tag "JAR file" :must-match t)))
+
+(defcustom org-latex-to-mathml-convert-command nil
+ "Command to convert LaTeX fragments to MathML.
+Replace format-specifiers in the command as noted below and use
+`shell-command' to convert LaTeX to MathML.
+%j: Executable file in fully expanded form as specified by
+ `org-latex-to-mathml-jar-file'.
+%I: Input LaTeX file in fully expanded form.
+%i: The latex fragment to be converted.
+%o: Output MathML file.
+
+This command is used by `org-create-math-formula'.
+
+When using MathToWeb as the converter, set this option to
+\"java -jar %j -unicode -force -df %o %I\".
+
+When using LaTeXML set this option to
+\"latexmlmath \"%i\" --presentationmathml=%o\"."
+ :group 'org-latex
+ :version "24.1"
+ :type '(choice
+ (const :tag "None" nil)
+ (string :tag "\nShell command")))
+
+(defcustom org-latex-to-html-convert-command nil
+ "Command to convert LaTeX fragments to HTML.
+This command is very open-ended: the output of the command will
+directly replace the LaTeX fragment in the resulting HTML.
+Replace format-specifiers in the command as noted below and use
+`shell-command' to convert LaTeX to HTML.
+%i: The LaTeX fragment to be converted.
+
+For example, this could be used with LaTeXML as
+\"latexmlc 'literal:%i' --profile=math --preload=siunitx.sty 2>/dev/null\"."
+ :group 'org-latex
+ :package-version '(Org . "9.4")
+ :type '(choice
+ (const :tag "None" nil)
+ (string :tag "Shell command")))
+
+(defcustom org-preview-latex-default-process 'dvipng
+ "The default process to convert LaTeX fragments to image files.
+All available processes and theirs documents can be found in
+`org-preview-latex-process-alist', which see."
+ :group 'org-latex
+ :version "26.1"
+ :package-version '(Org . "9.0")
+ :type 'symbol)
+
+(defcustom org-preview-latex-process-alist
+ '((dvipng
+ :programs ("latex" "dvipng")
+ :description "dvi > png"
+ :message "you need to install the programs: latex and dvipng."
+ :image-input-type "dvi"
+ :image-output-type "png"
+ :image-size-adjust (1.0 . 1.0)
+ :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f")
+ :image-converter ("dvipng -D %D -T tight -bg Transparent -o %O %f"))
+ (dvisvgm
+ :programs ("latex" "dvisvgm")
+ :description "dvi > svg"
+ :message "you need to install the programs: latex and dvisvgm."
+ :image-input-type "dvi"
+ :image-output-type "svg"
+ :image-size-adjust (1.7 . 1.5)
+ :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f")
+ :image-converter ("dvisvgm %f -n -b min -c %S -o %O"))
+ (imagemagick
+ :programs ("latex" "convert")
+ :description "pdf > png"
+ :message "you need to install the programs: latex and imagemagick."
+ :image-input-type "pdf"
+ :image-output-type "png"
+ :image-size-adjust (1.0 . 1.0)
+ :latex-compiler ("pdflatex -interaction nonstopmode -output-directory %o %f")
+ :image-converter
+ ("convert -density %D -trim -antialias %f -quality 100 %O")))
+ "Definitions of external processes for LaTeX previewing.
+Org mode can use some external commands to generate TeX snippet's images for
+previewing or inserting into HTML files, e.g., \"dvipng\". This variable tells
+`org-create-formula-image' how to call them.
+
+The value is an alist with the pattern (NAME . PROPERTIES). NAME is a symbol.
+PROPERTIES accepts the following attributes:
+
+ :programs list of strings, required programs.
+ :description string, describe the process.
+ :message string, message it when required programs cannot be found.
+ :image-input-type string, input file type of image converter (e.g., \"dvi\").
+ :image-output-type string, output file type of image converter (e.g., \"png\").
+ :image-size-adjust cons of numbers, the car element is used to adjust LaTeX
+ image size showed in buffer and the cdr element is for
+ HTML file. This option is only useful for process
+ developers, users should use variable
+ `org-format-latex-options' instead.
+ :post-clean list of strings, files matched are to be cleaned up once
+ the image is generated. When nil, the files with \".dvi\",
+ \".xdv\", \".pdf\", \".tex\", \".aux\", \".log\", \".svg\",
+ \".png\", \".jpg\", \".jpeg\" or \".out\" extension will
+ be cleaned up.
+ :latex-header list of strings, the LaTeX header of the snippet file.
+ When nil, the fallback value is used instead, which is
+ controlled by `org-format-latex-header',
+ `org-latex-default-packages-alist' and
+ `org-latex-packages-alist', which see.
+ :latex-compiler list of LaTeX commands, as strings. Each of them is given
+ to the shell. Place-holders \"%t\", \"%b\" and \"%o\" are
+ replaced with values defined below.
+ :image-converter list of image converter commands strings. Each of them is
+ given to the shell and supports any of the following
+ place-holders defined below.
+
+Place-holders used by `:image-converter' and `:latex-compiler':
+
+ %f input file name
+ %b base name of input file
+ %o base directory of input file
+ %O absolute output file name
+
+Place-holders only used by `:image-converter':
+
+ %D dpi, which is used to adjust image size by some processing commands.
+ %S the image size scale ratio, which is used to adjust image size by some
+ processing commands."
+ :group 'org-latex
+ :version "26.1"
+ :package-version '(Org . "9.0")
+ :type '(alist :tag "LaTeX to image backends"
+ :value-type (plist)))
+
+(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
+images at the same place."
+ :group 'org-latex
+ :version "26.1"
+ :package-version '(Org . "9.0")
+ :type 'string)
+
+(defun org-format-latex-mathml-available-p ()
+ "Return t if `org-latex-to-mathml-convert-command' is usable."
+ (save-match-data
+ (when (and (boundp 'org-latex-to-mathml-convert-command)
+ org-latex-to-mathml-convert-command)
+ (let ((executable (car (split-string
+ org-latex-to-mathml-convert-command))))
+ (when (executable-find executable)
+ (if (string-match
+ "%j" org-latex-to-mathml-convert-command)
+ (file-readable-p org-latex-to-mathml-jar-file)
+ t))))))
+
+(defcustom org-format-latex-header "\\documentclass{article}
+\\usepackage[usenames]{color}
+\[PACKAGES]
+\[DEFAULT-PACKAGES]
+\\pagestyle{empty} % do not remove
+% The settings below are copied from fullpage.sty
+\\setlength{\\textwidth}{\\paperwidth}
+\\addtolength{\\textwidth}{-3cm}
+\\setlength{\\oddsidemargin}{1.5cm}
+\\addtolength{\\oddsidemargin}{-2.54cm}
+\\setlength{\\evensidemargin}{\\oddsidemargin}
+\\setlength{\\textheight}{\\paperheight}
+\\addtolength{\\textheight}{-\\headheight}
+\\addtolength{\\textheight}{-\\headsep}
+\\addtolength{\\textheight}{-\\footskip}
+\\addtolength{\\textheight}{-3cm}
+\\setlength{\\topmargin}{1.5cm}
+\\addtolength{\\topmargin}{-2.54cm}"
+ "The document header used for processing LaTeX fragments.
+It is imperative that this header make sure that no page number
+appears on the page. The package defined in the variables
+`org-latex-default-packages-alist' and `org-latex-packages-alist'
+will either replace the placeholder \"[PACKAGES]\" in this
+header, or they will be appended."
+ :group 'org-latex
+ :type 'string)
+
+(defun org-set-packages-alist (var val)
+ "Set the packages alist and make sure it has 3 elements per entry."
+ (set var (mapcar (lambda (x)
+ (if (and (consp x) (= (length x) 2))
+ (list (car x) (nth 1 x) t)
+ x))
+ val)))
+
+(defun org-get-packages-alist (var)
+ "Get the packages alist and make sure it has 3 elements per entry."
+ (mapcar (lambda (x)
+ (if (and (consp x) (= (length x) 2))
+ (list (car x) (nth 1 x) t)
+ x))
+ (default-value var)))
+
+(defcustom org-latex-default-packages-alist
+ '(("AUTO" "inputenc" t ("pdflatex"))
+ ("T1" "fontenc" t ("pdflatex"))
+ ("" "graphicx" t)
+ ("" "longtable" nil)
+ ("" "wrapfig" nil)
+ ("" "rotating" nil)
+ ("normalem" "ulem" t)
+ ("" "amsmath" t)
+ ("" "amssymb" t)
+ ("" "capt-of" nil)
+ ("" "hyperref" nil))
+ "Alist of default packages to be inserted in the header.
+
+Change this only if one of the packages here causes an
+incompatibility with another package you are using.
+
+The packages in this list are needed by one part or another of
+Org mode to function properly:
+
+- inputenc, fontenc: for basic font and character selection
+- graphicx: for including images
+- longtable: For multipage tables
+- wrapfig: for figure placement
+- rotating: for sideways figures and tables
+- ulem: for underline and strike-through
+- amsmath: for subscript and superscript and math environments
+- amssymb: for various symbols used for interpreting the entities
+ in `org-entities'. You can skip some of this package if you don't
+ use any of the symbols.
+- capt-of: for captions outside of floats
+- hyperref: for cross references
+
+Therefore you should not modify this variable unless you know
+what you are doing. The one reason to change it anyway is that
+you might be loading some other package that conflicts with one
+of the default packages. Each element is either a cell or
+a string.
+
+A cell is of the format
+
+ (\"options\" \"package\" SNIPPET-FLAG COMPILERS)
+
+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.
+
+A string will be inserted as-is in the header of the document."
+ :group 'org-latex
+ :group 'org-export-latex
+ :set 'org-set-packages-alist
+ :get 'org-get-packages-alist
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(repeat
+ (choice
+ (list :tag "options/package pair"
+ (string :tag "options")
+ (string :tag "package")
+ (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
+ "Alist of packages to be inserted in every LaTeX header.
+
+These will be inserted after `org-latex-default-packages-alist'.
+Each element is either a cell or a string.
+
+A cell is of the format:
+
+ (\"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:
+
+ - you want in every file;
+ - do not conflict with the setup in `org-format-latex-header';
+ - do not conflict with the default packages in
+ `org-latex-default-packages-alist'."
+ :group 'org-latex
+ :group 'org-export-latex
+ :set 'org-set-packages-alist
+ :get 'org-get-packages-alist
+ :type '(repeat
+ (choice
+ (list :tag "options/package pair"
+ (string :tag "options")
+ (string :tag "package")
+ (boolean :tag "Snippet"))
+ (string :tag "A line of LaTeX"))))
+
+(defgroup org-appearance nil
+ "Settings for Org mode appearance."
+ :tag "Org Appearance"
+ :group 'org)
+
+(defcustom org-level-color-stars-only nil
+ "Non-nil means fontify only the stars in each headline.
+When nil, the entire headline is fontified.
+Changing it requires restart of `font-lock-mode' to become effective
+also in regions already fontified."
+ :group 'org-appearance
+ :type 'boolean)
+
+(defcustom org-hide-leading-stars nil
+ "Non-nil means hide the first N-1 stars in a headline.
+This works by using the face `org-hide' for these stars. This
+face is white for a light background, and black for a dark
+background. You may have to customize the face `org-hide' to
+make this work.
+Changing it requires restart of `font-lock-mode' to become effective
+also in regions already fontified.
+You may also set this on a per-file basis by adding one of the following
+lines to the buffer:
+
+ #+STARTUP: hidestars
+ #+STARTUP: showstars"
+ :group 'org-appearance
+ :type 'boolean)
+
+(defcustom org-hidden-keywords nil
+ "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
+ :package-version '(Org . "9.5")
+ :type '(set (const :tag "#+AUTHOR" author)
+ (const :tag "#+DATE" date)
+ (const :tag "#+EMAIL" email)
+ (const :tag "#+SUBTITLE" subtitle)
+ (const :tag "#+TITLE" title)))
+
+(defcustom org-custom-properties nil
+ "List of properties (as strings) with a special meaning.
+The default use of these custom properties is to let the user
+hide them with `org-toggle-custom-properties-visibility'."
+ :group 'org-properties
+ :group 'org-appearance
+ :version "24.3"
+ :type '(repeat (string :tag "Property Name")))
+
+(defcustom org-fontify-todo-headline nil
+ "Non-nil means change the face of a headline if it is marked as TODO.
+Normally, only the TODO/DONE keyword indicates the state of a headline.
+When this is non-nil, the headline after the keyword is set to the
+`org-headline-todo' as an additional indication."
+ :group 'org-appearance
+ :package-version '(Org . "9.4")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-fontify-done-headline t
+ "Non-nil means change the face of a headline if it is marked DONE.
+Normally, only the TODO/DONE keyword indicates the state of a headline.
+When this is non-nil, the headline after the keyword is set to the
+`org-headline-done' as an additional indication."
+ :group 'org-appearance
+ :package-version '(Org . "9.4")
+ :type 'boolean)
+
+(defcustom org-fontify-emphasized-text t
+ "Non-nil means fontify *bold*, /italic/ and _underlined_ text.
+Changing this variable requires a restart of Emacs to take effect."
+ :group 'org-appearance
+ :type 'boolean)
+
+(defcustom org-fontify-whole-heading-line nil
+ "Non-nil means fontify the whole line for headings.
+This is useful when setting a background color for the
+org-level-* faces."
+ :group 'org-appearance
+ :type 'boolean)
+
+(defcustom org-fontify-whole-block-delimiter-line t
+ "Non-nil means fontify the whole line for begin/end lines of blocks.
+This is useful when setting a background color for the
+org-block-begin-line and org-block-end-line faces."
+ :group 'org-appearance
+ :type 'boolean)
+
+(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
+following symbols:
+ `native' Highlight LaTeX snippets and environments natively.
+ `latex' Highlight LaTeX snippets and environments.
+ `script' Highlight subscript and superscript.
+ `entities' Highlight entities."
+ :group 'org-appearance
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "No highlighting" nil)
+ (set :greedy t :tag "Highlight"
+ (const :tag "LaTeX snippets and environments (native)" native)
+ (const :tag "LaTeX snippets and environments" latex)
+ (const :tag "Subscript and superscript" script)
+ (const :tag "Entities" entities))))
+
+(defcustom org-hide-emphasis-markers nil
+ "Non-nil mean font-lock should hide the emphasis marker characters."
+ :group 'org-appearance
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-hide-macro-markers nil
+ "Non-nil mean font-lock should hide the brackets marking macro calls."
+ :group 'org-appearance
+ :type 'boolean)
+
+(defcustom org-pretty-entities nil
+ "Non-nil means show entities as UTF8 characters.
+When nil, the \\name form remains in the buffer."
+ :group 'org-appearance
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-pretty-entities-include-sub-superscripts t
+ "Non-nil means, pretty entity display includes formatting sub/superscripts."
+ :group 'org-appearance
+ :version "24.1"
+ :type 'boolean)
+
+(defvar org-emph-re nil
+ "Regular expression for matching emphasis.
+After a match, the match groups contain these elements:
+0 The match of the full regular expression, including the characters
+ before and after the proper match
+1 The character before the proper match, or empty at beginning of line
+2 The proper match, including the leading and trailing markers
+3 The leading marker like * or /, indicating the type of highlighting
+4 The text between the emphasis markers, not including the markers
+5 The character after the match, empty at the end of a line")
+
+(defvar org-verbatim-re nil
+ "Regular expression for matching verbatim text.")
+
+(defvar org-emphasis-regexp-components) ; defined just below
+(defvar org-emphasis-alist) ; defined just below
+(defun org-set-emph-re (var val)
+ "Set variable and compute the emphasis regular expression."
+ (set var val)
+ (when (and (boundp 'org-emphasis-alist)
+ (boundp 'org-emphasis-regexp-components)
+ org-emphasis-alist org-emphasis-regexp-components)
+ (pcase-let*
+ ((`(,pre ,post ,border ,body ,nl) org-emphasis-regexp-components)
+ (body (if (<= nl 0) body
+ (format "%s*?\\(?:\n%s*?\\)\\{0,%d\\}" body body nl)))
+ (template
+ (format (concat "\\([%s]\\|^\\)" ;before markers
+ "\\(\\([%%s]\\)\\([^%s]\\|[^%s]%s[^%s]\\)\\3\\)"
+ "\\([%s]\\|$\\)") ;after markers
+ pre border border body border post)))
+ (setq org-emph-re (format template "*/_+"))
+ (setq org-verbatim-re (format template "=~")))))
+
+;; This used to be a defcustom (Org <8.0) but allowing the users to
+;; set this option proved cumbersome. See this message/thread:
+;; https://orgmode.org/list/B72CDC2B-72F6-43A8-AC70-E6E6295766EC@gmail.com
+(defvar org-emphasis-regexp-components
+ '("-[: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
+space POSTMATCH, the stars MARKERS, \"s\" and \"d\" are BORDER characters
+and \"trong wor\" is the body. The different components in this variable
+specify what is allowed/forbidden in each part:
+
+pre Chars allowed as prematch. Beginning of line will be allowed too.
+post Chars allowed as postmatch. End of line will be allowed too.
+border The chars *forbidden* as border characters.
+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 setting this.")
+
+(defcustom org-emphasis-alist
+ '(("*" bold)
+ ("/" italic)
+ ("_" underline)
+ ("=" org-verbatim verbatim)
+ ("~" org-code verbatim)
+ ("+" (:strike-through t)))
+ "Alist of characters and faces to emphasize text.
+Text starting and ending with a special character will be emphasized,
+for example *bold*, _underlined_ and /italic/. This variable sets the
+marker characters and the face to be used by font-lock for highlighting
+in Org buffers.
+
+You need to reload Org or to restart Emacs after customizing this."
+ :group 'org-appearance
+ :set 'org-set-emph-re
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(repeat
+ (list
+ (string :tag "Marker character")
+ (choice
+ (face :tag "Font-lock-face")
+ (plist :tag "Face property list"))
+ (option (const verbatim)))))
+
+(defvar org-protecting-blocks '("src" "example" "export")
+ "Blocks that contain text that is quoted, i.e. not processed as Org syntax.
+This is needed for font-lock setup.")
+
+;;; Functions and variables from their packages
+;; Declared here to avoid compiler warnings
+(defvar mark-active)
+
+;; Various packages
+(declare-function calc-eval "calc" (str &optional separator &rest args))
+(declare-function calendar-forward-day "cal-move" (arg))
+(declare-function calendar-goto-date "cal-move" (date))
+(declare-function calendar-goto-today "cal-move" ())
+(declare-function calendar-iso-from-absolute "cal-iso" (date))
+(declare-function calendar-iso-to-absolute "cal-iso" (date))
+(declare-function cdlatex-compute-tables "ext:cdlatex" ())
+(declare-function cdlatex-tab "ext:cdlatex" ())
+(declare-function dired-get-filename
+ "dired"
+ (&optional localp no-error-if-not-filep))
+(declare-function iswitchb-read-buffer
+ "iswitchb"
+ (prompt &optional
+ default require-match _predicate start matches-set))
+(declare-function org-agenda-change-all-lines
+ "org-agenda"
+ (newhead hdmarker &optional fixface just-this))
+(declare-function org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
+ "org-agenda"
+ (&optional end))
+(declare-function org-agenda-copy-local-variable "org-agenda" (var))
+(declare-function org-agenda-format-item
+ "org-agenda"
+ (extra txt &optional level category tags dotime
+ remove-re habitp))
+(declare-function org-agenda-new-marker "org-agenda" (&optional pos))
+(declare-function org-agenda-save-markers-for-cut-and-paste
+ "org-agenda"
+ (beg end))
+(declare-function org-agenda-set-restriction-lock "org-agenda" (&optional type))
+(declare-function org-agenda-skip "org-agenda" ())
+(declare-function org-attach-expand "org-attach" (file))
+(declare-function org-attach-reveal "org-attach" ())
+(declare-function org-attach-reveal-in-emacs "org-attach" ())
+(declare-function org-gnus-follow-link "org-gnus" (&optional group article))
+(declare-function org-indent-mode "org-indent" (&optional arg))
+(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" ())
+(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
+(declare-function parse-time-string "parse-time" (string))
+
+(defvar align-mode-rules-list)
+(defvar calc-embedded-close-formula)
+(defvar calc-embedded-open-formula)
+(defvar calc-embedded-open-mode)
+(defvar font-lock-unfontify-region-function)
+(defvar iswitchb-temp-buflist)
+(defvar org-agenda-tags-todo-honor-ignore-options)
+(defvar remember-data-file)
+(defvar texmathp-why)
+
+(declare-function org-clock-save-markers-for-cut-and-paste "org-clock" (beg end))
+(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))
+
+(defvar org-clock-start-time)
+(defvar org-clock-marker (make-marker)
+ "Marker recording the last clock-in.")
+(defvar org-clock-hd-marker (make-marker)
+ "Marker recording the last clock-in, but the headline position.")
+(defvar org-clock-heading ""
+ "The heading of the current clock entry.")
+(defun org-clocking-buffer ()
+ "Return the buffer where the clock is currently running.
+Return nil if no clock is running."
+ (marker-buffer org-clock-marker))
+(defalias 'org-clock-is-active #'org-clocking-buffer)
+
+(defun org-check-running-clock ()
+ "Check if the current buffer contains the running clock.
+If yes, offer to stop it and to save the buffer with the changes."
+ (when (and (equal (marker-buffer org-clock-marker) (current-buffer))
+ (y-or-n-p (format "Clock-out in buffer %s before killing it? "
+ (buffer-name))))
+ (org-clock-out)
+ (when (y-or-n-p "Save changed buffer?")
+ (save-buffer))))
+
+(defun org-clocktable-try-shift (dir n)
+ "Check if this line starts a clock table, if yes, shift the time block."
+ (when (org-match-line "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>")
+ (org-clocktable-shift dir n)))
+
+;;;###autoload
+(defun org-clock-persistence-insinuate ()
+ "Set up hooks for clock persistence."
+ (require 'org-clock)
+ (add-hook 'org-mode-hook 'org-clock-load)
+ (add-hook 'kill-emacs-hook 'org-clock-save))
+
+(defun org-clock-auto-clockout-insinuate ()
+ "Set up hook for auto clocking out when Emacs is idle.
+See `org-clock-auto-clockout-timer'.
+
+This function is meant to be added to the user configuration."
+ (require 'org-clock)
+ (add-hook 'org-clock-in-hook #'org-clock-auto-clockout t))
+
+(defgroup org-archive nil
+ "Options concerning archiving in Org mode."
+ :tag "Org Archive"
+ :group 'org-structure)
+
+(defcustom org-archive-location "%s_archive::"
+ "The location where subtrees should be archived.
+
+The value of this variable is a string, consisting of two parts,
+separated by a double-colon. The first part is a filename and
+the second part is a headline.
+
+When the filename is omitted, archiving happens in the same file.
+%s in the filename will be replaced by the current file
+name (without the directory part). Archiving to a different file
+is useful to keep archived entries from contributing to the
+Org Agenda.
+
+The archived entries will be filed as subtrees of the specified
+headline. When the headline is omitted, the subtrees are simply
+filed away at the end of the file, as top-level entries. Also in
+the heading you can use %s to represent the file name, this can be
+useful when using the same archive for a number of different files.
+
+Here are a few examples:
+\"%s_archive::\"
+ If the current file is Projects.org, archive in file
+ Projects.org_archive, as top-level trees. This is the default.
+
+\"::* Archived Tasks\"
+ Archive in the current file, under the top-level headline
+ \"* Archived Tasks\".
+
+\"~/org/archive.org::\"
+ Archive in file ~/org/archive.org (absolute path), as top-level trees.
+
+\"~/org/archive.org::* From %s\"
+ Archive in file ~/org/archive.org (absolute path), under headlines
+ \"From FILENAME\" where file name is the current file name.
+
+\"~/org/datetree.org::datetree/* Finished Tasks\"
+ The \"datetree/\" string is special, signifying to archive
+ items to the datetree. Items are placed in either the CLOSED
+ date of the item, or the current date if there is no CLOSED date.
+ The heading will be a subentry to the current date. There doesn't
+ need to be a heading, but there always needs to be a slash after
+ datetree. For example, to store archived items directly in the
+ datetree, use \"~/org/datetree.org::datetree/\".
+
+\"basement::** Finished Tasks\"
+ Archive in file ./basement (relative path), as level 3 trees
+ below the level 2 heading \"** Finished Tasks\".
+
+You may define it locally by setting an ARCHIVE property. If
+such a property is found in the file or in an entry, and anywhere
+up the hierarchy, it will be used.
+
+You can also set it for the whole file using the keyword-syntax:
+
+#+ARCHIVE: basement::** Finished Tasks"
+ :group 'org-archive
+ :type 'string)
+
+(defcustom org-agenda-skip-archived-trees t
+ "Non-nil means the agenda will skip any items located in archived trees.
+An archived tree is a tree marked with the tag ARCHIVE. The use of this
+variable is no longer recommended, you should leave it at the value t.
+Instead, use the key `v' to cycle the archives-mode in the agenda."
+ :group 'org-archive
+ :group 'org-agenda-skip
+ :type 'boolean)
+
+(defcustom org-columns-skip-archived-trees t
+ "Non-nil means ignore archived trees when creating column view."
+ :group 'org-archive
+ :group 'org-properties
+ :type 'boolean)
+
+(defcustom org-cycle-open-archived-trees nil
+ "Non-nil means `org-cycle' will open archived trees.
+An archived tree is a tree marked with the tag ARCHIVE.
+When nil, archived trees will stay folded. You can still open them with
+normal outline commands like `show-all', but not with the cycling commands."
+ :group 'org-archive
+ :group 'org-cycle
+ :type 'boolean)
+
+(defcustom org-sparse-tree-open-archived-trees nil
+ "Non-nil means sparse tree construction shows matches in archived trees.
+When nil, matches in these trees are highlighted, but the trees are kept in
+collapsed state."
+ :group 'org-archive
+ :group 'org-sparse-trees
+ :type 'boolean)
+
+(defcustom org-sparse-tree-default-date-type nil
+ "The default date type when building a sparse tree.
+When this is nil, a date is a scheduled or a deadline timestamp.
+Otherwise, these types are allowed:
+
+ all: all timestamps
+ active: only active timestamps (<...>)
+ inactive: only inactive timestamps ([...])
+ scheduled: only scheduled timestamps
+ deadline: only deadline timestamps"
+ :type '(choice (const :tag "Scheduled or deadline" nil)
+ (const :tag "All timestamps" all)
+ (const :tag "Only active timestamps" active)
+ (const :tag "Only inactive timestamps" inactive)
+ (const :tag "Only scheduled timestamps" scheduled)
+ (const :tag "Only deadline timestamps" deadline)
+ (const :tag "Only closed timestamps" closed))
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :group 'org-sparse-trees)
+
+(defun org-cycle-hide-archived-subtrees (state)
+ "Re-hide all archived subtrees after a visibility state change.
+STATE should be one of the symbols listed in the docstring of
+`org-cycle-hook'."
+ (when (and (not org-cycle-open-archived-trees)
+ (not (memq state '(overview folded))))
+ (save-excursion
+ (let* ((globalp (memq state '(contents all)))
+ (beg (if globalp (point-min) (point)))
+ (end (if globalp (point-max) (org-end-of-subtree t))))
+ (org-hide-archived-subtrees beg end)
+ (goto-char beg)
+ (when (looking-at-p (concat ".*:" org-archive-tag ":"))
+ (message "%s" (substitute-command-keys
+ "Subtree is archived and stays closed. Use \
+`\\[org-force-cycle-archived]' to cycle it anyway.")))))))
+
+(defun org-force-cycle-archived ()
+ "Cycle subtree even if it is archived."
+ (interactive)
+ (setq this-command 'org-cycle)
+ (let ((org-cycle-open-archived-trees t))
+ (call-interactively 'org-cycle)))
+
+(defun org-hide-archived-subtrees (beg end)
+ "Re-hide all archived subtrees after a visibility state change."
+ (org-with-wide-buffer
+ (let ((case-fold-search nil)
+ (re (concat org-outline-regexp-bol ".*:" org-archive-tag ":")))
+ (goto-char beg)
+ ;; 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 nil t))
+ (org-flag-subtree t)
+ (org-end-of-subtree t))))))
+
+(defun org-flag-subtree (flag)
+ (save-excursion
+ (org-back-to-heading t)
+ (org-flag-region (line-end-position)
+ (progn (org-end-of-subtree t) (point))
+ flag
+ 'outline)))
+
+(defalias 'org-advertized-archive-subtree 'org-archive-subtree)
+
+;; Declare Column View Code
+
+(declare-function org-columns-get-format-and-top-level "org-colview" ())
+(declare-function org-columns-compute "org-colview" (property))
+
+;; Declare ID code
+
+(declare-function org-id-store-link "org-id")
+(declare-function org-id-locations-load "org-id")
+(declare-function org-id-locations-save "org-id")
+(defvar org-id-track-globally)
+
+;;; Variables for pre-computed regular expressions, all buffer local
+
+(defvar-local org-todo-regexp nil
+ "Matches any of the TODO state keywords.
+Since TODO keywords are case-sensitive, `case-fold-search' is
+expected to be bound to nil when matching against this regexp.")
+
+(defvar-local org-not-done-regexp nil
+ "Matches any of the TODO state keywords except the last one.
+Since TODO keywords are case-sensitive, `case-fold-search' is
+expected to be bound to nil when matching against this regexp.")
+
+(defvar-local org-not-done-heading-regexp nil
+ "Matches a TODO headline that is not done.
+Since TODO keywords are case-sensitive, `case-fold-search' is
+expected to be bound to nil when matching against this regexp.")
+
+(defvar-local org-todo-line-regexp nil
+ "Matches a headline and puts TODO state into group 2 if present.
+Since TODO keywords are case-sensitive, `case-fold-search' is
+expected to be bound to nil when matching against this regexp.")
+
+(defvar-local org-complex-heading-regexp nil
+ "Matches a headline and puts everything into groups:
+
+group 1: Stars
+group 2: The TODO keyword, maybe
+group 3: Priority cookie
+group 4: True headline
+group 5: Tags
+
+Since TODO keywords are case-sensitive, `case-fold-search' is
+expected to be bound to nil when matching against this regexp.")
+
+(defvar-local org-complex-heading-regexp-format nil
+ "Printf format to make regexp to match an exact headline.
+This regexp will match the headline of any node which has the
+exact headline text that is put into the format, but may have any
+TODO state, priority and tags.")
+
+(defvar-local org-todo-line-tags-regexp nil
+ "Matches a headline and puts TODO state into group 2 if present.
+Also put tags into group 4 if tags are present.")
+
+(defconst org-plain-time-of-day-regexp
+ (concat
+ "\\(\\<[012]?[0-9]"
+ "\\(\\(:\\([0-5][0-9]\\([AaPp][Mm]\\)?\\)\\)\\|\\([AaPp][Mm]\\)\\)\\>\\)"
+ "\\(--?"
+ "\\(\\<[012]?[0-9]"
+ "\\(\\(:\\([0-5][0-9]\\([AaPp][Mm]\\)?\\)\\)\\|\\([AaPp][Mm]\\)\\)\\>\\)"
+ "\\)?")
+ "Regular expression to match a plain time or time range.
+Examples: 11:45 or 8am-13:15 or 2:45-2:45pm. After a match, the following
+groups carry important information:
+0 the full match
+1 the first time, range or not
+8 the second time, if it is a range.")
+
+(defconst org-plain-time-extension-regexp
+ (concat
+ "\\(\\<[012]?[0-9]"
+ "\\(\\(:\\([0-5][0-9]\\([AaPp][Mm]\\)?\\)\\)\\|\\([AaPp][Mm]\\)\\)\\>\\)"
+ "\\+\\([0-9]+\\)\\(:\\([0-5][0-9]\\)\\)?")
+ "Regular expression to match a time range like 13:30+2:10 = 13:30-15:40.
+Examples: 11:45 or 8am-13:15 or 2:45-2:45pm. After a match, the following
+groups carry important information:
+0 the full match
+7 hours of duration
+9 minutes of duration")
+
+(defconst org-stamp-time-of-day-regexp
+ (concat
+ "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} +\\sw+ +\\)"
+ "\\([012][0-9]:[0-5][0-9]\\)\\(-\\([012][0-9]:[0-5][0-9]\\)\\)?[^\n\r>]*?>"
+ "\\(--?"
+ "<\\1\\([012][0-9]:[0-5][0-9]\\)>\\)?")
+ "Regular expression to match a timestamp time or time range.
+After a match, the following groups carry important information:
+0 the full match
+1 date plus weekday, for back referencing to make sure
+ both times are on the same day
+2 the first time, range or not
+4 the second time, if it is a range.")
+
+(defconst org-startup-options
+ '(("fold" org-startup-folded t)
+ ("overview" org-startup-folded t)
+ ("nofold" org-startup-folded nil)
+ ("showall" org-startup-folded nil)
+ ("show2levels" org-startup-folded show2levels)
+ ("show3levels" org-startup-folded show3levels)
+ ("show4levels" org-startup-folded show4levels)
+ ("show5levels" org-startup-folded show5levels)
+ ("showeverything" org-startup-folded showeverything)
+ ("content" org-startup-folded content)
+ ("indent" org-startup-indented t)
+ ("noindent" org-startup-indented nil)
+ ("num" org-startup-numerated t)
+ ("nonum" org-startup-numerated nil)
+ ("hidestars" org-hide-leading-stars t)
+ ("showstars" org-hide-leading-stars nil)
+ ("odd" org-odd-levels-only t)
+ ("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)
+ ("nolatexpreview" org-startup-with-latex-preview nil)
+ ("customtime" org-display-custom-times t)
+ ("logdone" org-log-done time)
+ ("lognotedone" org-log-done note)
+ ("nologdone" org-log-done nil)
+ ("lognoteclock-out" org-log-note-clock-out t)
+ ("nolognoteclock-out" org-log-note-clock-out nil)
+ ("logrepeat" org-log-repeat state)
+ ("lognoterepeat" org-log-repeat note)
+ ("logdrawer" org-log-into-drawer t)
+ ("nologdrawer" org-log-into-drawer nil)
+ ("logstatesreversed" org-log-states-order-reversed t)
+ ("nologstatesreversed" org-log-states-order-reversed nil)
+ ("nologrepeat" org-log-repeat nil)
+ ("logreschedule" org-log-reschedule time)
+ ("lognotereschedule" org-log-reschedule note)
+ ("nologreschedule" org-log-reschedule nil)
+ ("logredeadline" org-log-redeadline time)
+ ("lognoteredeadline" org-log-redeadline note)
+ ("nologredeadline" org-log-redeadline nil)
+ ("logrefile" org-log-refile time)
+ ("lognoterefile" org-log-refile note)
+ ("nologrefile" org-log-refile nil)
+ ("fninline" org-footnote-define-inline t)
+ ("nofninline" org-footnote-define-inline nil)
+ ("fnlocal" org-footnote-section nil)
+ ("fnauto" org-footnote-auto-label t)
+ ("fnprompt" org-footnote-auto-label nil)
+ ("fnconfirm" org-footnote-auto-label confirm)
+ ("fnplain" org-footnote-auto-label plain)
+ ("fnadjust" org-footnote-auto-adjust t)
+ ("nofnadjust" org-footnote-auto-adjust nil)
+ ("constcgs" constants-unit-system cgs)
+ ("constSI" constants-unit-system SI)
+ ("noptag" org-tag-persistent-alist nil)
+ ("hideblocks" org-hide-block-startup t)
+ ("nohideblocks" org-hide-block-startup nil)
+ ("beamer" org-startup-with-beamer-mode t)
+ ("entitiespretty" org-pretty-entities t)
+ ("entitiesplain" org-pretty-entities nil))
+ "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 fourth element PUSH
+means to push this value onto the list in the variable.")
+
+(defcustom org-group-tags t
+ "When non-nil (the default), use group tags.
+This can be turned on/off through `org-toggle-tags-groups'."
+ :group 'org-tags
+ :group 'org-startup
+ :type 'boolean)
+
+(defvar org-inhibit-startup nil) ; Dynamically-scoped param.
+
+(defun org-toggle-tags-groups ()
+ "Toggle support for group tags.
+Support for group tags is controlled by the option
+`org-group-tags', which is non-nil by default."
+ (interactive)
+ (setq org-group-tags (not org-group-tags))
+ (cond ((and (derived-mode-p 'org-agenda-mode)
+ org-group-tags)
+ (org-agenda-redo))
+ ((derived-mode-p 'org-mode)
+ (let ((org-inhibit-startup t)) (org-mode))))
+ (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-priority-to-value (s)
+ "Convert priority string S to its numeric value."
+ (or (save-match-data
+ (and (string-match "\\([0-9]+\\)" s)
+ (string-to-number (match-string 1 s))))
+ (string-to-char s)))
+
+(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
+related expressions."
+ (when (derived-mode-p 'org-mode)
+ (let ((alist (org-collect-keywords
+ (append '("FILETAGS" "TAGS")
+ (and (not tags-only)
+ '("ARCHIVE" "CATEGORY" "COLUMNS" "CONSTANTS"
+ "LINK" "OPTIONS" "PRIORITIES" "PROPERTY"
+ "SEQ_TODO" "STARTUP" "TODO" "TYP_TODO")))
+ '("ARCHIVE" "CATEGORY" "COLUMNS" "PRIORITIES"))))
+ ;; Startup options. Get this early since it does change
+ ;; behavior for other options (e.g., tags).
+ (let ((startup (cl-mapcan (lambda (value) (split-string value))
+ (cdr (assoc "STARTUP" alist)))))
+ (dolist (option startup)
+ (pcase (assoc-string option org-startup-options t)
+ (`(,_ ,variable ,value t)
+ (unless (listp (symbol-value variable))
+ (set (make-local-variable variable) nil))
+ (add-to-list variable value))
+ (`(,_ ,variable ,value . ,_)
+ (set (make-local-variable variable) value))
+ (_ nil))))
+ (setq-local org-file-tags
+ (mapcar #'org-add-prop-inherited
+ (cl-mapcan (lambda (value)
+ (cl-mapcan
+ (lambda (k) (org-split-string k ":"))
+ (split-string value)))
+ (cdr (assoc "FILETAGS" alist)))))
+ (setq org-current-tag-alist
+ (org--tag-add-to-alist
+ org-tag-persistent-alist
+ (let ((tags (cdr (assoc "TAGS" alist))))
+ (if tags
+ (org-tag-string-to-alist
+ (mapconcat #'identity tags "\n"))
+ org-tag-alist))))
+ (setq org-tag-groups-alist
+ (org-tag-alist-to-groups org-current-tag-alist))
+ (unless tags-only
+ ;; Properties.
+ (let ((properties nil))
+ (dolist (value (cdr (assoc "PROPERTY" alist)))
+ (when (string-match "\\(\\S-+\\)[ \t]+\\(.*\\)" value)
+ (setq properties (org--update-property-plist
+ (match-string-no-properties 1 value)
+ (match-string-no-properties 2 value)
+ properties))))
+ (setq-local org-keyword-properties properties))
+ ;; Archive location.
+ (let ((archive (cdr (assoc "ARCHIVE" alist))))
+ (when archive (setq-local org-archive-location archive)))
+ ;; Category.
+ (let ((category (cdr (assoc "CATEGORY" alist))))
+ (when category
+ (setq-local org-category (intern category))
+ (setq-local org-keyword-properties
+ (org--update-property-plist
+ "CATEGORY" category org-keyword-properties))))
+ ;; Columns.
+ (let ((column (cdr (assoc "COLUMNS" alist))))
+ (when column (setq-local org-columns-default-format column)))
+ ;; Constants.
+ (let ((store nil))
+ (dolist (pair (cl-mapcan #'split-string
+ (cdr (assoc "CONSTANTS" alist))))
+ (when (string-match "^\\([a-zA-Z0][_a-zA-Z0-9]*\\)=\\(.*\\)" pair)
+ (let* ((name (match-string 1 pair))
+ (value (match-string 2 pair))
+ (old (assoc name store)))
+ (if old (setcdr old value)
+ (push (cons name value) store)))))
+ (setq org-table-formula-constants-local store))
+ ;; Link abbreviations.
+ (let ((links
+ (delq nil
+ (mapcar
+ (lambda (value)
+ (and (string-match "\\`\\(\\S-+\\)[ \t]+\\(.+\\)" value)
+ (cons (match-string-no-properties 1 value)
+ (match-string-no-properties 2 value))))
+ (cdr (assoc "LINK" alist))))))
+ (when links (setq org-link-abbrev-alist-local (nreverse links))))
+ ;; Priorities.
+ (let ((value (cdr (assoc "PRIORITIES" alist))))
+ (pcase (and value (split-string value))
+ (`(,high ,low ,default . ,_)
+ (setq-local org-priority-highest (org-priority-to-value high))
+ (setq-local org-priority-lowest (org-priority-to-value low))
+ (setq-local org-priority-default (org-priority-to-value default)))))
+ ;; Scripts.
+ (let ((value (cdr (assoc "OPTIONS" alist))))
+ (dolist (option value)
+ (when (string-match "\\^:\\(t\\|nil\\|{}\\)" option)
+ (setq-local org-use-sub-superscripts
+ (read (match-string 1 option))))))
+ ;; TODO keywords.
+ (setq-local org-todo-kwd-alist nil)
+ (setq-local org-todo-key-alist nil)
+ (setq-local org-todo-key-trigger nil)
+ (setq-local org-todo-keywords-1 nil)
+ (setq-local org-done-keywords nil)
+ (setq-local org-todo-heads nil)
+ (setq-local org-todo-sets nil)
+ (setq-local org-todo-log-states nil)
+ (let ((todo-sequences
+ (or (append (mapcar (lambda (value)
+ (cons 'type (split-string value)))
+ (cdr (assoc "TYP_TODO" alist)))
+ (mapcar (lambda (value)
+ (cons 'sequence (split-string value)))
+ (append (cdr (assoc "TODO" alist))
+ (cdr (assoc "SEQ_TODO" alist)))))
+ (let ((d (default-value 'org-todo-keywords)))
+ (if (not (stringp (car d))) d
+ ;; XXX: Backward compatibility code.
+ (list (cons org-todo-interpretation d)))))))
+ (dolist (sequence todo-sequences)
+ (let* ((sequence (or (run-hook-with-args-until-success
+ 'org-todo-setup-filter-hook sequence)
+ sequence))
+ (sequence-type (car sequence))
+ (keywords (cdr sequence))
+ (sep (member "|" keywords))
+ names alist)
+ (dolist (k (remove "|" keywords))
+ (unless (string-match "^\\(.*?\\)\\(?:(\\([^!@/]\\)?.*?)\\)?$"
+ k)
+ (error "Invalid TODO keyword %s" k))
+ (let ((name (match-string 1 k))
+ (key (match-string 2 k))
+ (log (org-extract-log-state-settings k)))
+ (push name names)
+ (push (cons name (and key (string-to-char key))) alist)
+ (when log (push log org-todo-log-states))))
+ (let* ((names (nreverse names))
+ (done (if sep (org-remove-keyword-keys (cdr sep))
+ (last names)))
+ (head (car names))
+ (tail (list sequence-type head (car done) (org-last done))))
+ (add-to-list 'org-todo-heads head 'append)
+ (push names org-todo-sets)
+ (setq org-done-keywords (append org-done-keywords done nil))
+ (setq org-todo-keywords-1 (append org-todo-keywords-1 names nil))
+ (setq org-todo-key-alist
+ (append org-todo-key-alist
+ (and alist
+ (append '((:startgroup))
+ (nreverse alist)
+ '((:endgroup))))))
+ (dolist (k names) (push (cons k tail) org-todo-kwd-alist))))))
+ (setq org-todo-sets (nreverse org-todo-sets)
+ org-todo-kwd-alist (nreverse org-todo-kwd-alist)
+ org-todo-key-trigger (delq nil (mapcar #'cdr org-todo-key-alist))
+ org-todo-key-alist (org-assign-fast-keys org-todo-key-alist))
+ ;; Compute the regular expressions and other local variables.
+ ;; Using `org-outline-regexp-bol' would complicate them much,
+ ;; because of the fixed white space at the end of that string.
+ (unless org-done-keywords
+ (setq org-done-keywords
+ (and org-todo-keywords-1 (last org-todo-keywords-1))))
+ (setq org-not-done-keywords
+ (org-delete-all org-done-keywords
+ (copy-sequence org-todo-keywords-1))
+ org-todo-regexp (regexp-opt org-todo-keywords-1 t)
+ org-not-done-regexp (regexp-opt org-not-done-keywords t)
+ org-not-done-heading-regexp
+ (format org-heading-keyword-regexp-format org-not-done-regexp)
+ org-todo-line-regexp
+ (format org-heading-keyword-maybe-regexp-format org-todo-regexp)
+ org-complex-heading-regexp
+ (concat "^\\(\\*+\\)"
+ "\\(?: +" org-todo-regexp "\\)?"
+ "\\(?: +\\(\\[#.\\]\\)\\)?"
+ "\\(?: +\\(.*?\\)\\)??"
+ "\\(?:[ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)?"
+ "[ \t]*$")
+ org-complex-heading-regexp-format
+ (concat "^\\(\\*+\\)"
+ "\\(?: +" org-todo-regexp "\\)?"
+ "\\(?: +\\(\\[#.\\]\\)\\)?"
+ "\\(?: +"
+ ;; Stats cookies can be stuck to body.
+ "\\(?:\\[[0-9%%/]+\\] *\\)*"
+ "\\(%s\\)"
+ "\\(?: *\\[[0-9%%/]+\\]\\)*"
+ "\\)"
+ "\\(?:[ \t]+\\(:[[:alnum:]_@#%%:]+:\\)\\)?"
+ "[ \t]*$")
+ org-todo-line-tags-regexp
+ (concat "^\\(\\*+\\)"
+ "\\(?: +" org-todo-regexp "\\)?"
+ "\\(?: +\\(.*?\\)\\)??"
+ "\\(?:[ \t]+\\(:[[:alnum:]:_@#%]+:\\)\\)?"
+ "[ \t]*$"))
+ (org-compute-latex-and-related-regexp)))))
+
+(defun org-collect-keywords (keywords &optional unique directory)
+ "Return values for KEYWORDS in current buffer, as an alist.
+
+KEYWORDS is a list of strings. Return value is a list of
+elements with the pattern:
+
+ (NAME . LIST-OF-VALUES)
+
+where NAME is the upcase name of the keyword, and LIST-OF-VALUES
+is a list of non-empty values, as strings, in order of appearance
+in the buffer.
+
+When KEYWORD appears in UNIQUE list, LIST-OF-VALUE is its first
+value, empty or not, appearing in the buffer, as a string.
+
+When KEYWORD appears in DIRECTORIES, each value is a cons cell:
+
+ (VALUE . DIRECTORY)
+
+where VALUE is the regular value, and DIRECTORY is the variable
+`default-directory' for the buffer containing the keyword. This
+is important for values containing relative file names, since the
+function follows SETUPFILE keywords, and may change its working
+directory."
+ (let* ((keywords (cons "SETUPFILE" (mapcar #'upcase keywords)))
+ (unique (mapcar #'upcase unique))
+ (alist (org--collect-keywords-1
+ keywords unique directory
+ (and buffer-file-name (list buffer-file-name))
+ nil)))
+ ;; Re-order results.
+ (dolist (entry alist)
+ (pcase entry
+ (`(,_ . ,(and value (pred consp)))
+ (setcdr entry (nreverse value)))))
+ (nreverse alist)))
+
+(defun org--collect-keywords-1 (keywords unique directory files alist)
+ (org-with-point-at 1
+ (let ((case-fold-search t)
+ (regexp (org-make-options-regexp keywords)))
+ (while (and keywords (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)))
+ (pcase (org-element-property :key element)
+ ("SETUPFILE"
+ (when (and (org-string-nw-p value)
+ (not buffer-read-only)) ;FIXME: bug in Gnus?
+ (let* ((uri (org-strip-quotes value))
+ (uri-is-url (org-url-p uri))
+ (uri (if uri-is-url
+ uri
+ (expand-file-name uri))))
+ (unless (member uri files)
+ (with-temp-buffer
+ (unless uri-is-url
+ (setq default-directory (file-name-directory uri)))
+ (let ((contents (org-file-contents uri :noerror)))
+ (when contents
+ (insert contents)
+ ;; Fake Org mode: `org-element-at-point'
+ ;; doesn't need full set-up.
+ (let ((major-mode 'org-mode))
+ (setq alist
+ (org--collect-keywords-1
+ keywords unique directory
+ (cons uri files)
+ alist))))))))))
+ (keyword
+ (let ((entry (assoc keyword alist))
+ (final
+ (cond ((not (member keyword directory)) value)
+ (buffer-file-name
+ (cons value
+ (file-name-directory buffer-file-name)))
+ (t (cons value default-directory)))))
+ (cond ((member keyword unique)
+ (push (cons keyword final) alist)
+ (setq keywords (remove keyword keywords))
+ (setq regexp (org-make-options-regexp keywords)))
+ ((null entry) (push (list keyword final) alist))
+ (t (push final (cdr entry)))))))))))
+ alist)))
+
+(defun org-tag-string-to-alist (s)
+ "Return tag alist associated to string S.
+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 "\\`\\(" org-tag-re "\\|{.+?}\\)" ; regular expression
+ "\\(?:(\\(.\\))\\)?\\'"))
+ alist group-flag)
+ (dolist (tokens lines (cdr (nreverse alist)))
+ (push '(:newline) alist)
+ (while tokens
+ (let ((token (pop tokens)))
+ (pcase token
+ ("{"
+ (push '(:startgroup) alist)
+ (when (equal (nth 1 tokens) ":") (setq group-flag t)))
+ ("}"
+ (push '(:endgroup) alist)
+ (setq group-flag nil))
+ ("["
+ (push '(:startgrouptag) alist)
+ (when (equal (nth 1 tokens) ":") (setq group-flag t)))
+ ("]"
+ (push '(:endgrouptag) alist)
+ (setq group-flag nil))
+ (":"
+ (push '(:grouptags) alist))
+ ((guard (string-match tag-re token))
+ (let ((tag (match-string 1 token))
+ (key (and (match-beginning 2)
+ (string-to-char (match-string 2 token)))))
+ ;; Push all tags in groups, no matter if they already
+ ;; appear somewhere else in the list.
+ (when (or group-flag (not (assoc tag alist)))
+ (push (cons tag key) alist))))))))))
+
+(defun org-tag-alist-to-string (alist &optional skip-key)
+ "Return tag string associated to ALIST.
+
+ALIST is an alist, as defined in `org-tag-alist' or
+`org-tag-persistent-alist', or produced with
+`org-tag-string-to-alist'.
+
+Return value is a string suitable as a value for \"TAGS\"
+keyword.
+
+When optional argument SKIP-KEY is non-nil, skip selection keys
+next to tags."
+ (mapconcat (lambda (token)
+ (pcase token
+ (`(:startgroup) "{")
+ (`(:endgroup) "}")
+ (`(:startgrouptag) "[")
+ (`(:endgrouptag) "]")
+ (`(:grouptags) ":")
+ (`(:newline) "\\n")
+ ((and
+ (guard (not skip-key))
+ `(,(and tag (pred stringp)) . ,(and key (pred characterp))))
+ (format "%s(%c)" tag key))
+ (`(,(and tag (pred stringp)) . ,_) tag)
+ (_ (user-error "Invalid tag token: %S" token))))
+ alist
+ " "))
+
+(defun org-tag-alist-to-groups (alist)
+ "Return group alist from tag ALIST.
+ALIST is an alist, as defined in `org-tag-alist' or
+`org-tag-persistent-alist', or produced with
+`org-tag-string-to-alist'. Return value is an alist following
+the pattern (GROUP-TAG TAGS) where GROUP-TAG is the tag, as
+a string, summarizing TAGS, as a list of strings."
+ (let (groups group-status current-group)
+ (dolist (token alist (nreverse groups))
+ (pcase token
+ (`(,(or :startgroup :startgrouptag)) (setq group-status t))
+ (`(,(or :endgroup :endgrouptag))
+ (when (eq group-status 'append)
+ (push (nreverse current-group) groups))
+ (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)
+ (setq current-group (list tag))))
+ (_ nil)))))
+
+(defvar org--file-cache (make-hash-table :test #'equal)
+ "Hash table to store contents of files referenced via a URL.
+This is the cache of file URLs read using `org-file-contents'.")
+
+(defun org-reset-file-cache ()
+ "Reset the cache of files downloaded by `org-file-contents'."
+ (clrhash org--file-cache))
+
+(defun org-file-contents (file &optional noerror nocache)
+ "Return the contents of FILE, as a string.
+
+FILE can be a file name or URL.
+
+If FILE is a URL, download the contents. If the URL contents are
+already cached in the `org--file-cache' hash table, the download step
+is skipped.
+
+If NOERROR is non-nil, ignore the error when unable to read the FILE
+from file or URL, and return nil.
+
+If NOCACHE is non-nil, do a fresh fetch of FILE even if cached version
+is available. This option applies only if FILE is a URL."
+ (let* ((is-url (org-url-p file))
+ (cache (and is-url
+ (not nocache)
+ (gethash file org--file-cache))))
+ (cond
+ (cache)
+ (is-url
+ (with-current-buffer (url-retrieve-synchronously file)
+ (goto-char (point-min))
+ ;; Move point to after the url-retrieve header.
+ (search-forward "\n\n" nil :move)
+ ;; Search for the success code only in the url-retrieve header.
+ (if (save-excursion
+ (re-search-backward "HTTP.*\\s-+200\\s-OK" nil :noerror))
+ ;; Update the cache `org--file-cache' and return contents.
+ (puthash file
+ (buffer-substring-no-properties (point) (point-max))
+ org--file-cache)
+ (funcall (if noerror #'message #'user-error)
+ "Unable to fetch file from %S"
+ file)
+ nil)))
+ (t
+ (with-temp-buffer
+ (condition-case nil
+ (progn
+ (insert-file-contents file)
+ (buffer-string))
+ (file-error
+ (funcall (if noerror #'message #'user-error)
+ "Unable to read file %S"
+ file)
+ nil)))))))
+
+(defun org-extract-log-state-settings (x)
+ "Extract the log state setting from a TODO keyword string.
+This will extract info from a string like \"WAIT(w@/!)\"."
+ (when (string-match "^\\(.*?\\)\\(?:(\\([^!@/]\\)?\\([!@]\\)?\\(?:/\\([!@]\\)\\)?)\\)?$" x)
+ (let ((kw (match-string 1 x))
+ (log1 (and (match-end 3) (match-string 3 x)))
+ (log2 (and (match-end 4) (match-string 4 x))))
+ (and (or log1 log2)
+ (list kw
+ (and log1 (if (equal log1 "!") 'time 'note))
+ (and log2 (if (equal log2 "!") 'time 'note)))))))
+
+(defun org-remove-keyword-keys (list)
+ "Remove a pair of parenthesis at the end of each string in LIST."
+ (mapcar (lambda (x)
+ (if (string-match "(.*)$" x)
+ (substring x 0 (match-beginning 0))
+ x))
+ list))
+
+(defun org-assign-fast-keys (alist)
+ "Assign fast keys to a keyword-key alist.
+Respect keys that are already there."
+ (let (new e (alt ?0))
+ (while (setq e (pop alist))
+ (if (or (memq (car e) '(:newline :grouptags :endgroup :startgroup))
+ (cdr e)) ;; Key already assigned.
+ (push e new)
+ (let ((clist (string-to-list (downcase (car e))))
+ (used (append new alist)))
+ (when (= (car clist) ?@)
+ (pop clist))
+ (while (and clist (rassoc (car clist) used))
+ (pop clist))
+ (unless clist
+ (while (rassoc alt used)
+ (cl-incf alt)))
+ (push (cons (car e) (or (car clist) alt)) new))))
+ (nreverse new)))
+
+;;; Some variables used in various places
+
+(defvar org-window-configuration nil
+ "Used in various places to store a window configuration.")
+(defvar org-selected-window nil
+ "Used in various places to store a window configuration.")
+(defvar org-finish-function nil
+ "Function to be called when `C-c C-c' is used.
+This is for getting out of special buffers like capture.")
+(defvar org-last-state)
+
+;; Defined somewhere in this file, but used before definition.
+(defvar org-entities) ;; defined in org-entities.el
+(defvar org-struct-menu)
+(defvar org-org-menu)
+(defvar org-tbl-menu)
+
+;;;; Define the Org mode
+
+(defun org-before-change-function (_beg _end)
+ "Every change indicates that a table might need an update."
+ (setq org-table-may-need-update t))
+(defvar org-mode-map)
+(defvar org-inhibit-startup-visibility-stuff nil) ; Dynamically-scoped param.
+(defvar org-agenda-keep-modes nil) ; Dynamically-scoped param.
+(defvar org-inhibit-logging nil) ; Dynamically-scoped param.
+(defvar org-inhibit-blocking nil) ; Dynamically-scoped param.
+
+(defvar bidi-paragraph-direction)
+(defvar buffer-face-mode-face)
+
+(require 'outline)
+
+;; Other stuff we need.
+(require 'time-date)
+(unless (fboundp 'time-subtract) (defalias 'time-subtract 'subtract-time))
+(when (< emacs-major-version 28) ; preloaded in Emacs 28
+ (require 'easymenu))
+
+(require 'org-entities)
+(require 'org-faces)
+(require 'org-list)
+(require 'org-pcomplete)
+(require 'org-src)
+(require 'org-footnote)
+(require 'org-macro)
+
+;; babel
+(require 'ob)
+
+;;;###autoload
+(define-derived-mode org-mode outline-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}"
+ (org-load-modules-maybe)
+ (org-install-agenda-files-menu)
+ (when org-link-descriptive (add-to-invisibility-spec '(org-link)))
+ (make-local-variable 'org-link-descriptive)
+ (add-to-invisibility-spec '(org-hide-block . t))
+ (setq-local outline-regexp org-outline-regexp)
+ (setq-local outline-level 'org-outline-level)
+ (setq bidi-paragraph-direction 'left-to-right)
+ (when (and (stringp org-ellipsis) (not (equal "" org-ellipsis)))
+ (unless org-display-table
+ (setq org-display-table (make-display-table)))
+ (set-display-table-slot
+ org-display-table 4
+ (vconcat (mapcar (lambda (c) (make-glyph-code c 'org-ellipsis))
+ org-ellipsis)))
+ (setq buffer-display-table org-display-table))
+ (org-set-regexps-and-options)
+ (org-set-font-lock-defaults)
+ (when (and org-tag-faces (not org-tags-special-faces-re))
+ ;; tag faces set outside customize.... force initialization.
+ (org-set-tag-faces 'org-tag-faces org-tag-faces))
+ ;; Calc embedded
+ (setq-local calc-embedded-open-mode "# ")
+ ;; Modify a few syntax entries
+ (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)
+ (add-hook 'before-change-functions 'org-before-change-function nil 'local)
+ ;; Check for running clock before killing a buffer
+ (add-hook 'kill-buffer-hook 'org-check-running-clock nil 'local)
+ ;; Initialize macros templates.
+ (org-macro-initialize-templates)
+ ;; Initialize radio targets.
+ (org-update-radio-target-regexp)
+ ;; Indentation.
+ (setq-local indent-line-function 'org-indent-line)
+ (setq-local indent-region-function 'org-indent-region)
+ ;; Filling and auto-filling.
+ (org-setup-filling)
+ ;; Comments.
+ (org-setup-comments-handling)
+ ;; Initialize cache.
+ (org-element-cache-reset)
+ ;; Beginning/end of defun
+ (setq-local beginning-of-defun-function 'org-backward-element)
+ (setq-local end-of-defun-function
+ (lambda ()
+ (if (not (org-at-heading-p))
+ (org-forward-element)
+ (org-forward-element)
+ (forward-char -1))))
+ ;; Next error for sparse trees
+ (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
+ (add-hook 'org-blocker-hook
+ 'org-block-todo-from-children-or-siblings-or-parent)
+ (remove-hook 'org-blocker-hook
+ 'org-block-todo-from-children-or-siblings-or-parent))
+ (if org-enforce-todo-checkbox-dependencies
+ (add-hook 'org-blocker-hook
+ 'org-block-todo-from-checkboxes)
+ (remove-hook 'org-blocker-hook
+ 'org-block-todo-from-checkboxes))
+
+ ;; Align options lines
+ (setq-local
+ align-mode-rules-list
+ '((org-in-buffer-settings
+ (regexp . "^[ \t]*#\\+[A-Z_]+:\\(\\s-*\\)\\S-+")
+ (modes . '(org-mode)))))
+
+ ;; Setup the pcomplete hooks
+ (setq-local pcomplete-command-completion-function #'org-pcomplete-initial)
+ (setq-local pcomplete-command-name-function #'org-command-at-point)
+ (setq-local pcomplete-default-completion-function #'ignore)
+ (setq-local pcomplete-parse-arguments-function #'org-parse-arguments)
+ (setq-local pcomplete-termination-string "")
+ (add-hook 'completion-at-point-functions
+ #'pcomplete-completions-at-point nil t)
+ (setq-local buffer-face-mode-face 'org-default)
+
+ ;; If empty file that did not turn on Org mode automatically, make
+ ;; it to.
+ (when (and org-insert-mode-line-in-empty-file
+ (called-interactively-p 'any)
+ (= (point-min) (point-max)))
+ (insert "# -*- mode: org -*-\n\n"))
+ (unless org-inhibit-startup
+ (org-unmodified
+ (when org-startup-with-beamer-mode (org-beamer-mode))
+ (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-latex-preview '(16)))
+ (unless org-inhibit-startup-visibility-stuff (org-set-startup-visibility))
+ (when org-startup-truncated (setq truncate-lines t))
+ (when org-startup-numerated (require 'org-num) (org-num-mode 1))
+ (when org-startup-indented (require 'org-indent) (org-indent-mode 1))))
+
+ ;; Add a custom keymap for `visual-line-mode' so that activating
+ ;; this minor mode does not override Org's keybindings.
+ ;; FIXME: Probably `visual-line-mode' should take care of this.
+ (let ((oldmap (cdr (assoc 'visual-line-mode minor-mode-map-alist)))
+ (newmap (make-sparse-keymap)))
+ (set-keymap-parent newmap oldmap)
+ (define-key newmap [remap move-beginning-of-line] nil)
+ (define-key newmap [remap move-end-of-line] nil)
+ (define-key newmap [remap kill-line] nil)
+ (make-local-variable 'minor-mode-overriding-map-alist)
+ (push `(visual-line-mode . ,newmap) minor-mode-overriding-map-alist))
+
+ ;; Activate `org-table-header-line-mode'
+ (when org-table-header-line-p
+ (org-table-header-line-mode 1))
+ ;; Try to set `org-hide' face correctly.
+ (let ((foreground (org-find-invisible-foreground)))
+ (when foreground
+ (set-face-foreground 'org-hide foreground)))
+ ;; Set face extension as requested.
+ (org--set-faces-extend '(org-block-begin-line org-block-end-line)
+ org-fontify-whole-block-delimiter-line)
+ (org--set-faces-extend org-level-faces org-fontify-whole-heading-line))
+
+;; Update `customize-package-emacs-version-alist'
+(add-to-list 'customize-package-emacs-version-alist
+ '(Org ("8.0" . "24.4")
+ ("8.1" . "24.4")
+ ("8.2" . "24.4")
+ ("8.2.7" . "24.4")
+ ("8.3" . "26.1")
+ ("9.0" . "26.1")
+ ("9.1" . "26.1")
+ ("9.2" . "27.1")
+ ("9.3" . "27.1")
+ ("9.4" . "27.2")
+ ("9.5" . "28.1")))
+
+(defvar org-mode-transpose-word-syntax-table
+ (let ((st (make-syntax-table text-mode-syntax-table)))
+ (dolist (c org-emphasis-alist st)
+ (modify-syntax-entry (string-to-char (car c)) "w p" st))))
+
+(when (fboundp 'abbrev-table-put)
+ (abbrev-table-put org-mode-abbrev-table
+ :parents (list text-mode-abbrev-table)))
+
+(defun org-find-invisible-foreground ()
+ (let ((candidates (remove
+ "unspecified-bg"
+ (nconc
+ (list (face-background 'default)
+ (face-background 'org-default))
+ (mapcar
+ (lambda (alist)
+ (when (boundp alist)
+ (cdr (assq 'background-color (symbol-value alist)))))
+ '(default-frame-alist initial-frame-alist window-system-default-frame-alist))
+ (list (face-foreground 'org-hide))))))
+ (car (remove nil candidates))))
+
+(defun org-current-time (&optional rounding-minutes past)
+ "Current time, possibly rounded to ROUNDING-MINUTES.
+When ROUNDING-MINUTES is not an integer, fall back on the car of
+`org-time-stamp-rounding-minutes'. When PAST is non-nil, ensure
+the rounding returns a past time."
+ (let ((r (or (and (integerp rounding-minutes) rounding-minutes)
+ (car org-time-stamp-rounding-minutes)))
+ (now (current-time)))
+ (if (< r 1)
+ 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
+ (org-time-since (* 3600 org-extend-today-until))))
+
+;;;; Font-Lock stuff, including the activators
+
+(defconst org-match-sexp-depth 3
+ "Number of stacked braces for sub/superscript matching.")
+
+(defun org-create-multibrace-regexp (left right n)
+ "Create a regular expression which will match a balanced sexp.
+Opening delimiter is LEFT, and closing delimiter is RIGHT, both given
+as single character strings.
+The regexp returned will match the entire expression including the
+delimiters. It will also define a single group which contains the
+match except for the outermost delimiters. The maximum depth of
+stacked delimiters is N. Escaping delimiters is not possible."
+ (let* ((nothing (concat "[^" left right "]*?"))
+ (or "\\|")
+ (re nothing)
+ (next (concat "\\(?:" nothing left nothing right "\\)+" nothing)))
+ (while (> n 1)
+ (setq n (1- n)
+ re (concat re or next)
+ next (concat "\\(?:" nothing left next right "\\)+" nothing)))
+ (concat left "\\(" re "\\)" right)))
+
+(defconst org-match-substring-regexp
+ (concat
+ "\\(\\S-\\)\\([_^]\\)\\("
+ "\\(?:" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)"
+ "\\|"
+ "\\(?:" (org-create-multibrace-regexp "(" ")" org-match-sexp-depth) "\\)"
+ "\\|"
+ "\\(?:\\*\\|[+-]?[[:alnum:].,\\]*[[:alnum:]]\\)\\)")
+ "The regular expression matching a sub- or superscript.")
+
+(defconst org-match-substring-with-braces-regexp
+ (concat
+ "\\(\\S-\\)\\([_^]\\)"
+ "\\(" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)")
+ "The regular expression matching a sub- or superscript, forcing braces.")
+
+(defvar org-emph-face nil)
+
+(defun org-do-emphasis-faces (limit)
+ "Run through the buffer and emphasize strings."
+ (let ((quick-re (format "\\([%s]\\|^\\)\\([~=*/_+]\\)"
+ (car org-emphasis-regexp-components))))
+ (catch :exit
+ (while (re-search-forward quick-re limit t)
+ (let* ((marker (match-string 2))
+ (verbatim? (member marker '("~" "="))))
+ (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.
+ (not (and (equal marker "*")
+ (save-excursion
+ (forward-char)
+ (skip-chars-backward "*")
+ (looking-at-p org-outline-regexp-bol))))
+ ;; Match full emphasis markup regexp.
+ (looking-at (if verbatim? org-verbatim-re org-emph-re))
+ ;; 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))
+ (m (if org-hide-emphasis-markers 4 2)))
+ (font-lock-prepend-text-property
+ (match-beginning m) (match-end m) 'face face)
+ (when verbatim?
+ (org-remove-flyspell-overlays-in
+ (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 (and org-hide-emphasis-markers
+ (not (org-at-comment-p)))
+ (add-text-properties (match-end 4) (match-beginning 5)
+ '(invisible t))
+ (add-text-properties (match-beginning 3) (match-end 3)
+ '(invisible t)))
+ (throw :exit t))))))))
+
+(defun org-emphasize (&optional char)
+ "Insert or change an emphasis, i.e. a font like bold or italic.
+If there is an active region, change that region to a new emphasis.
+If there is no region, just insert the marker characters and position
+the cursor between them.
+CHAR should be the marker character. If it is a space, it means to
+remove the emphasis of the selected region.
+If CHAR is not given (for example in an interactive call) it will be
+prompted for."
+ (interactive)
+ (let ((erc org-emphasis-regexp-components)
+ (string "") beg end move s)
+ (if (org-region-active-p)
+ (setq beg (region-beginning)
+ end (region-end)
+ string (buffer-substring beg end))
+ (setq move t))
+
+ (unless char
+ (message "Emphasis marker or tag: [%s]"
+ (mapconcat #'car org-emphasis-alist ""))
+ (setq char (read-char-exclusive)))
+ (if (equal char ?\s)
+ (setq s ""
+ move nil)
+ (unless (assoc (char-to-string char) org-emphasis-alist)
+ (user-error "No such emphasis marker: \"%c\"" char))
+ (setq s (char-to-string char)))
+ (while (and (> (length string) 1)
+ (equal (substring string 0 1) (substring string -1))
+ (assoc (substring string 0 1) org-emphasis-alist))
+ (setq string (substring string 1 -1)))
+ (setq string (concat s string s))
+ (when beg (delete-region beg end))
+ (unless (or (bolp)
+ (string-match (concat "[" (nth 0 erc) "\n]")
+ (char-to-string (char-before (point)))))
+ (insert " "))
+ (unless (or (eobp)
+ (string-match (concat "[" (nth 1 erc) "\n]")
+ (char-to-string (char-after (point)))))
+ (insert " ") (backward-char 1))
+ (insert string)
+ (and move (backward-char 1))))
+
+(defconst org-nonsticky-props
+ '(mouse-face highlight keymap invisible intangible help-echo org-linked-text htmlize-link))
+
+(defsubst org-rear-nonsticky-at (pos)
+ (add-text-properties (1- pos) pos (list 'rear-nonsticky org-nonsticky-props)))
+
+(defun org-activate-links (limit)
+ "Add link properties to links.
+This includes angle, plain, and bracket links."
+ (catch :exit
+ (while (re-search-forward org-link-any-re limit t)
+ (let* ((start (match-beginning 0))
+ (end (match-end 0))
+ (visible-start (or (match-beginning 3) (match-beginning 2)))
+ (visible-end (or (match-end 3) (match-end 2)))
+ (style (cond ((eq ?< (char-after start)) 'angle)
+ ((eq ?\[ (char-after (1+ start))) 'bracket)
+ (t 'plain))))
+ (when (and (memq style org-highlight-links)
+ ;; Do not span over paragraph boundaries.
+ (not (string-match-p org-element-paragraph-separate
+ (match-string 0)))
+ ;; Do not confuse plain links with tags.
+ (not (and (eq style 'plain)
+ (let ((face (get-text-property
+ (max (1- start) (point-min)) 'face)))
+ (if (consp face) (memq 'org-tag face)
+ (eq 'org-tag face))))))
+ (let* ((link-object (save-excursion
+ (goto-char start)
+ (save-match-data (org-element-link-parser))))
+ (link (org-element-property :raw-link link-object))
+ (type (org-element-property :type link-object))
+ (path (org-element-property :path link-object))
+ (face-property (pcase (org-link-get-parameter type :face)
+ ((and (pred functionp) face) (funcall face path))
+ ((and (pred facep) face) face)
+ ((and (pred consp) face) face) ;anonymous
+ (_ 'org-link)))
+ (properties ;for link's visible part
+ (list 'mouse-face (or (org-link-get-parameter type :mouse-face)
+ 'highlight)
+ 'keymap (or (org-link-get-parameter type :keymap)
+ org-mouse-map)
+ 'help-echo (pcase (org-link-get-parameter type :help-echo)
+ ((and (pred stringp) echo) echo)
+ ((and (pred functionp) echo) echo)
+ (_ (concat "LINK: " link)))
+ 'htmlize-link (pcase (org-link-get-parameter type
+ :htmlize-link)
+ ((and (pred functionp) f) (funcall f))
+ (_ `(:uri ,link)))
+ 'font-lock-multiline t)))
+ (org-remove-flyspell-overlays-in start end)
+ (org-rear-nonsticky-at end)
+ (if (not (eq 'bracket style))
+ (progn
+ (add-face-text-property start end face-property)
+ (add-text-properties start end properties))
+ ;; Handle invisible parts in bracket links.
+ (remove-text-properties start end '(invisible nil))
+ (let ((hidden
+ (append `(invisible
+ ,(or (org-link-get-parameter type :display)
+ 'org-link))
+ properties)))
+ (add-text-properties start visible-start hidden)
+ (add-face-text-property start end face-property)
+ (add-text-properties visible-start visible-end properties)
+ (add-text-properties visible-end end hidden)
+ (org-rear-nonsticky-at visible-start)
+ (org-rear-nonsticky-at visible-end)))
+ (let ((f (org-link-get-parameter type :activate-func)))
+ (when (functionp f)
+ (funcall f start end path (eq style 'bracket))))
+ (throw :exit t))))) ;signal success
+ nil))
+
+(defun org-activate-code (limit)
+ (when (re-search-forward "^[ \t]*\\(:\\(?: .*\\|$\\)\n?\\)" limit t)
+ (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
+ (remove-text-properties (match-beginning 0) (match-end 0)
+ '(display t invisible t intangible t))
+ t))
+
+(defcustom org-src-fontify-natively t
+ "When non-nil, fontify code in code blocks.
+See also the `org-block' face."
+ :type 'boolean
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :group 'org-appearance
+ :group 'org-babel)
+
+(defcustom org-allow-promoting-top-level-subtree nil
+ "When non-nil, allow promoting a top level subtree.
+The leading star of the top level headline will be replaced
+by a #."
+ :type 'boolean
+ :version "24.1"
+ :group 'org-appearance)
+
+(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"
+ (current-buffer)
+ (line-number-at-pos)))))
+
+(defun org-fontify-meta-lines-and-blocks-1 (limit)
+ "Fontify #+ lines and blocks."
+ (let ((case-fold-search t))
+ (when (re-search-forward
+ (rx bol (group (zero-or-more (any " \t")) "#"
+ (group (group (or (seq "+" (one-or-more (any "a-zA-Z")) (optional ":"))
+ (any " \t")
+ eol))
+ (optional (group "_" (group (one-or-more (any "a-zA-Z"))))))
+ (zero-or-more (any " \t"))
+ (group (group (zero-or-more (not (any " \t\n"))))
+ (zero-or-more (any " \t"))
+ (group (zero-or-more any)))))
+ limit t)
+ (let ((beg (match-beginning 0))
+ (end-of-beginline (match-end 0))
+ ;; Including \n at end of #+begin line will include \n
+ ;; after the end of block content.
+ (block-start (match-end 0))
+ (block-end nil)
+ (lang (match-string 7)) ; The language, if it is a source block.
+ (bol-after-beginline (line-beginning-position 2))
+ (dc1 (downcase (match-string 2)))
+ (dc3 (downcase (match-string 3)))
+ (whole-blockline org-fontify-whole-block-delimiter-line)
+ beg-of-endline end-of-endline nl-before-endline quoting block-type)
+ (cond
+ ((and (match-end 4) (equal dc3 "+begin"))
+ ;; Truly a block
+ (setq block-type (downcase (match-string 5))
+ ;; Src, example, export, maybe more.
+ quoting (member block-type org-protecting-blocks))
+ (when (re-search-forward
+ (rx-to-string `(group bol (or (seq (one-or-more "*") space)
+ (seq (zero-or-more (any " \t"))
+ "#+end"
+ ,(match-string 4)
+ word-end
+ (zero-or-more any)))))
+ ;; We look further than LIMIT on purpose.
+ nil t)
+ ;; We do have a matching #+end line.
+ (setq beg-of-endline (match-beginning 0)
+ end-of-endline (match-end 0)
+ nl-before-endline (1- (match-beginning 0)))
+ (setq block-end (match-beginning 0)) ; Include the final newline.
+ (when quoting
+ (org-remove-flyspell-overlays-in bol-after-beginline nl-before-endline)
+ (remove-text-properties beg end-of-endline
+ '(display t invisible t intangible t)))
+ (add-text-properties
+ beg end-of-endline '(font-lock-fontified t font-lock-multiline t))
+ (org-remove-flyspell-overlays-in beg bol-after-beginline)
+ (org-remove-flyspell-overlays-in nl-before-endline end-of-endline)
+ (cond
+ ((and lang (not (string= lang "")) org-src-fontify-natively)
+ (save-match-data
+ (org-src-font-lock-fontify-block lang block-start block-end))
+ (add-text-properties bol-after-beginline block-end '(src-block t)))
+ (quoting
+ (add-text-properties
+ bol-after-beginline beg-of-endline
+ (list 'face
+ (list :inherit
+ (let ((face-name
+ (intern (format "org-block-%s" lang))))
+ (append (and (facep face-name) (list face-name))
+ '(org-block)))))))
+ ((not org-fontify-quote-and-verse-blocks))
+ ((string= block-type "quote")
+ (add-face-text-property
+ bol-after-beginline beg-of-endline 'org-quote t))
+ ((string= block-type "verse")
+ (add-face-text-property
+ bol-after-beginline beg-of-endline 'org-verse t)))
+ ;; Fontify the #+begin and #+end lines of the blocks
+ (add-text-properties
+ beg (if whole-blockline bol-after-beginline end-of-beginline)
+ '(face org-block-begin-line))
+ (unless (eq (char-after beg-of-endline) ?*)
+ (add-text-properties
+ beg-of-endline
+ (if whole-blockline
+ (let ((beg-of-next-line (1+ end-of-endline)))
+ (min (point-max) beg-of-next-line))
+ (min (point-max) end-of-endline))
+ '(face org-block-end-line)))
+ t))
+ ((member dc1 '("+title:" "+subtitle:" "+author:" "+email:" "+date:"))
+ (org-remove-flyspell-overlays-in
+ (match-beginning 0)
+ (if (equal "+title:" dc1) (match-end 2) (match-end 0)))
+ (add-text-properties
+ beg (match-end 3)
+ (if (member (intern (substring dc1 1 -1)) org-hidden-keywords)
+ '(font-lock-fontified t invisible t)
+ '(font-lock-fontified t face org-document-info-keyword)))
+ (add-text-properties
+ (match-beginning 6) (min (point-max) (1+ (match-end 6)))
+ (if (string-equal dc1 "+title:")
+ '(font-lock-fontified t face org-document-title)
+ '(font-lock-fontified t face org-document-info))))
+ ((string-prefix-p "+caption" dc1)
+ (org-remove-flyspell-overlays-in (match-end 2) (match-end 0))
+ (remove-text-properties (match-beginning 0) (match-end 0)
+ '(display t invisible t intangible t))
+ ;; Handle short captions
+ (save-excursion
+ (beginning-of-line)
+ (looking-at (rx (group (zero-or-more (any " \t"))
+ "#+caption"
+ (optional "[" (zero-or-more any) "]")
+ ":")
+ (zero-or-more (any " \t")))))
+ (add-text-properties (line-beginning-position) (match-end 1)
+ '(font-lock-fontified t face org-meta-line))
+ (add-text-properties (match-end 0) (line-end-position)
+ '(font-lock-fontified t face org-block))
+ t)
+ ((member dc3 '(" " ""))
+ ;; Just a comment, the plus was not there
+ (org-remove-flyspell-overlays-in beg (match-end 0))
+ (add-text-properties
+ beg (match-end 0)
+ '(font-lock-fontified t face font-lock-comment-face)))
+ (t ;; Just any other in-buffer setting, but not indented
+ (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
+ (remove-text-properties (match-beginning 0) (match-end 0)
+ '(display t invisible t intangible t))
+ (add-text-properties beg (match-end 0)
+ '(font-lock-fontified t face org-meta-line))
+ t))))))
+
+(defun org-fontify-drawers (limit)
+ "Fontify drawers."
+ (when (re-search-forward org-drawer-regexp limit t)
+ (add-text-properties (1- (match-beginning 1)) (1+ (match-end 1))
+ '(font-lock-fontified t face org-drawer))
+ (org-remove-flyspell-overlays-in
+ (line-beginning-position) (line-beginning-position 2))
+ t))
+
+(defun org-fontify-macros (limit)
+ "Fontify macros."
+ (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-fontify-extend-region (beg end _old-len)
+ (let ((end (if (progn (goto-char end) (looking-at-p "^[*#]"))
+ (1+ end) end))
+ (begin-re "\\(\\\\\\[\\|\\(#\\+begin_\\|\\\\begin{\\)\\S-+\\)")
+ (end-re "\\(\\\\\\]\\|\\(#\\+end_\\|\\\\end{\\)\\S-+\\)")
+ (extend
+ (lambda (r1 r2 dir)
+ (let ((re (replace-regexp-in-string
+ "\\(begin\\|end\\)" r1
+ (replace-regexp-in-string
+ "[][]" r2
+ (match-string-no-properties 0)))))
+ (re-search-forward (regexp-quote re) nil t dir)))))
+ (goto-char beg)
+ (back-to-indentation)
+ (save-match-data
+ (cond ((looking-at end-re)
+ (cons (or (funcall extend "begin" "[" -1) beg) end))
+ ((looking-at begin-re)
+ (cons beg (or (funcall extend "end" "]" 1) end)))
+ (t (cons beg end))))))
+
+(defun org-activate-footnote-links (limit)
+ "Add text properties for footnotes."
+ (let ((fn (org-footnote-next-reference-or-definition limit)))
+ (when fn
+ (let* ((beg (nth 1 fn))
+ (end (nth 2 fn))
+ (label (car fn))
+ (referencep (/= (line-beginning-position) beg)))
+ (when (and referencep (nth 3 fn))
+ (save-excursion
+ (goto-char beg)
+ (search-forward (or label "fn:"))
+ (org-remove-flyspell-overlays-in beg (match-end 0))))
+ (add-text-properties beg end
+ (list 'mouse-face 'highlight
+ 'keymap org-mouse-map
+ 'help-echo
+ (if referencep "Footnote reference"
+ "Footnote definition")
+ 'font-lock-fontified t
+ 'font-lock-multiline t
+ 'face 'org-footnote))))))
+
+(defun org-activate-dates (limit)
+ "Add text properties for dates."
+ (when (and (re-search-forward org-tsr-regexp-both limit t)
+ (not (equal (char-before (match-beginning 0)) 91)))
+ (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
+ (add-text-properties (match-beginning 0) (match-end 0)
+ (list 'mouse-face 'highlight
+ 'keymap org-mouse-map))
+ (org-rear-nonsticky-at (match-end 0))
+ (when org-display-custom-times
+ ;; If it's a date range, activate custom time for second date.
+ (when (match-end 3)
+ (org-display-custom-time (match-beginning 3) (match-end 3)))
+ (org-display-custom-time (match-beginning 1) (match-end 1)))
+ t))
+
+(defun org-activate-target-links (limit)
+ "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)
+ (list 'mouse-face 'highlight
+ 'keymap org-mouse-map
+ 'help-echo "Radio target link"
+ 'org-linked-text t))
+ (org-rear-nonsticky-at (match-end 1))
+ 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'."
+ (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 (or (memq 'latex org-highlight-latex-and-related)
+ (memq 'native 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:]]\\)"))))
+ (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.
+Stop at first highlighted object, if any. Return t if some
+highlighting was done, nil otherwise."
+ (when (org-string-nw-p org-latex-and-related-regexp)
+ (let ((latex-prefix-re (rx (or "$" "\\(" "\\[")))
+ (blank-line-re (rx (and "\n" (zero-or-more (or " " "\t")) "\n"))))
+ (catch 'found
+ (while (and (< (point) limit)
+ (re-search-forward org-latex-and-related-regexp nil t))
+ (cond
+ ((>= (match-beginning 0) limit)
+ (throw 'found nil))
+ ((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))))
+ ;; Try to limit false positives. In this case, ignore
+ ;; $$...$$, \(...\), and \[...\] LaTeX constructs if they
+ ;; contain an empty line.
+ ((save-excursion
+ (goto-char (match-beginning 0))
+ (and (looking-at-p latex-prefix-re)
+ (save-match-data
+ (re-search-forward blank-line-re (1- (match-end 0)) t)))))
+ (t
+ (let* ((offset (if (memq (char-after (1+ (match-beginning 0)))
+ '(?_ ?^))
+ 1
+ 0))
+ (start (+ offset (match-beginning 0)))
+ (end (match-end 0)))
+ (if (memq 'native org-highlight-latex-and-related)
+ (org-src-font-lock-fontify-block "latex" start end)
+ (font-lock-prepend-text-property start end
+ 'face 'org-latex-and-related))
+ (add-text-properties (+ offset (match-beginning 0)) (match-end 0)
+ '(font-lock-multiline t))
+ (throw 'found t)))))
+ nil))))
+
+(defun org-restart-font-lock ()
+ "Restart `font-lock-mode', to force refontification."
+ (when font-lock-mode
+ (font-lock-mode -1)
+ (font-lock-mode 1)))
+
+(defun org-activate-tags (limit)
+ (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
+ 'keymap org-mouse-map))
+ (org-rear-nonsticky-at (match-end 1))
+ t))
+
+(defun org-outline-level ()
+ "Compute the outline level of the heading at point.
+
+If this is called at a normal headline, the level is the number
+of stars. Use `org-reduced-level' to remove the effect of
+`org-odd-levels'. Unlike to `org-current-level', this function
+takes into consideration inlinetasks."
+ (org-with-wide-buffer
+ (end-of-line)
+ (if (re-search-backward org-outline-regexp-bol nil t)
+ (1- (- (match-end 0) (match-beginning 0)))
+ 0)))
+
+(defvar org-font-lock-keywords nil)
+
+(defsubst org-re-property (property &optional literal allow-null value)
+ "Return a regexp matching a PROPERTY line.
+
+When optional argument LITERAL is non-nil, do not quote PROPERTY.
+This is useful when PROPERTY is a regexp. When ALLOW-NULL is
+non-nil, match properties even without a value.
+
+Match group 3 is set to the value when it exists. If there is no
+value and ALLOW-NULL is non-nil, it is set to the empty string.
+
+With optional argument VALUE, match only property lines with
+that value; in this case, ALLOW-NULL is ignored. VALUE is quoted
+unless LITERAL is non-nil."
+ (concat
+ "^\\(?4:[ \t]*\\)"
+ (format "\\(?1::\\(?2:%s\\):\\)"
+ (if literal property (regexp-quote property)))
+ (cond (value
+ (format "[ \t]+\\(?3:%s\\)\\(?5:[ \t]*\\)$"
+ (if literal value (regexp-quote value))))
+ (allow-null
+ "\\(?:\\(?3:$\\)\\|[ \t]+\\(?3:.*?\\)\\)\\(?5:[ \t]*\\)$")
+ (t
+ "[ \t]+\\(?3:[^ \r\t\n]+.*?\\)\\(?5:[ \t]*\\)$"))))
+
+(defconst org-property-re
+ (org-re-property "\\S-+" 'literal t)
+ "Regular expression matching a property line.
+There are four matching groups:
+1: :PROPKEY: including the leading and trailing colon,
+2: PROPKEY without the leading and trailing colon,
+3: PROPVAL without leading or trailing spaces,
+4: the indentation of the current line,
+5: trailing whitespace.")
+
+(defvar org-font-lock-hook nil
+ "Functions to be called for special font lock stuff.")
+
+(defvar org-font-lock-extra-keywords nil) ;Dynamically scoped.
+
+(defvar org-font-lock-set-keywords-hook nil
+ "Functions that can manipulate `org-font-lock-extra-keywords'.
+This is called after `org-font-lock-extra-keywords' is defined, but before
+it is installed to be used by font lock. This can be useful if something
+needs to be inserted at a specific position in the font-lock sequence.")
+
+(defun org-font-lock-hook (limit)
+ "Run `org-font-lock-hook' within LIMIT."
+ (run-hook-with-args 'org-font-lock-hook limit))
+
+(defun org-set-font-lock-defaults ()
+ "Set font lock defaults for the current buffer."
+ (let ((org-font-lock-extra-keywords
+ (list
+ ;; Call the hook
+ '(org-font-lock-hook)
+ ;; Headlines
+ `(,(if org-fontify-whole-heading-line
+ "^\\(\\**\\)\\(\\* \\)\\(.*\n?\\)"
+ "^\\(\\**\\)\\(\\* \\)\\(.*\\)")
+ (1 (org-get-level-face 1))
+ (2 (org-get-level-face 2))
+ (3 (org-get-level-face 3)))
+ ;; Table lines
+ '("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)"
+ (1 'org-table t))
+ ;; Table internals
+ '("^[ \t]*|\\(?:.*?|\\)? *\\(:?=[^|\n]*\\)" (1 'org-formula t))
+ '("^[ \t]*| *\\([#*]\\) *|" (1 'org-formula t))
+ '("^[ \t]*|\\( *\\([$!_^/]\\) *|.*\\)|" (1 'org-formula t))
+ '("| *\\(<[lrc]?[0-9]*>\\)" (1 'org-formula t))
+ ;; Properties
+ (list org-property-re
+ '(1 'org-special-keyword t)
+ '(3 'org-property-value t))
+ ;; Drawers
+ '(org-fontify-drawers)
+ ;; Link related fontification.
+ '(org-activate-links)
+ (when (memq 'tag org-highlight-links) '(org-activate-tags (1 'org-tag prepend)))
+ (when (memq 'radio org-highlight-links) '(org-activate-target-links (1 'org-link t)))
+ (when (memq 'date org-highlight-links) '(org-activate-dates (0 'org-date t)))
+ (when (memq 'footnote org-highlight-links) '(org-activate-footnote-links))
+ ;; Targets.
+ (list org-radio-target-regexp '(0 'org-target t))
+ (list org-target-regexp '(0 'org-target t))
+ ;; Diary sexps.
+ '("^&?%%(.*\\|<%%([^>\n]*?>" (0 'org-sexp-date t))
+ ;; Macro
+ '(org-fontify-macros)
+ ;; TODO keyword
+ (list (format org-heading-keyword-regexp-format
+ org-todo-regexp)
+ '(2 (org-get-todo-face 2) prepend))
+ ;; TODO
+ (when org-fontify-todo-headline
+ (list (format org-heading-keyword-regexp-format
+ (concat
+ "\\(?:"
+ (mapconcat 'regexp-quote org-not-done-keywords "\\|")
+ "\\)"))
+ '(2 'org-headline-todo prepend)))
+ ;; DONE
+ (when org-fontify-done-headline
+ (list (format org-heading-keyword-regexp-format
+ (concat
+ "\\(?:"
+ (mapconcat 'regexp-quote org-done-keywords "\\|")
+ "\\)"))
+ '(2 'org-headline-done prepend)))
+ ;; Priorities
+ '(org-font-lock-add-priority-faces)
+ ;; Tags
+ '(org-font-lock-add-tag-faces)
+ ;; Tags groups
+ (when (and org-group-tags org-tag-groups-alist)
+ (list (concat org-outline-regexp-bol ".+\\(:"
+ (regexp-opt (mapcar 'car org-tag-groups-alist))
+ ":\\).*$")
+ '(1 'org-tag-group prepend)))
+ ;; Special keywords
+ (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t))
+ (list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t))
+ (list (concat "\\<" org-closed-string) '(0 'org-special-keyword t))
+ (list (concat "\\<" org-clock-string) '(0 'org-special-keyword t))
+ ;; Emphasis
+ (when org-fontify-emphasized-text '(org-do-emphasis-faces))
+ ;; Checkboxes
+ '("^[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\)[ \t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\(\\[[- X]\\]\\)"
+ 1 'org-checkbox prepend)
+ (when (cdr (assq 'checkbox org-list-automatic-rules))
+ '("\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]"
+ (0 (org-get-checkbox-statistics-face) prepend)))
+ ;; Description list items
+ '("\\(?:^[ \t]*[-+]\\|^[ \t]+[*]\\)[ \t]+\\(.*?[ \t]+::\\)\\([ \t]+\\|$\\)"
+ 1 'org-list-dt prepend)
+ ;; Inline export snippets
+ '("\\(@@\\)\\([a-z-]+:\\).*?\\(@@\\)"
+ (1 'font-lock-comment-face t)
+ (2 'org-tag t)
+ (3 'font-lock-comment-face t))
+ ;; ARCHIVEd headings
+ (list (concat
+ org-outline-regexp-bol
+ "\\(.*:" org-archive-tag ":.*\\)")
+ '(1 'org-archived prepend))
+ ;; Specials
+ '(org-do-latex-and-related)
+ '(org-fontify-entities)
+ '(org-raise-scripts)
+ ;; Code
+ '(org-activate-code (1 'org-code t))
+ ;; COMMENT
+ (list (format
+ "^\\*+\\(?: +%s\\)?\\(?: +\\[#[A-Z0-9]\\]\\)? +\\(?9:%s\\)\\(?: \\|$\\)"
+ org-todo-regexp
+ org-comment-string)
+ '(9 'org-special-keyword t))
+ ;; Blocks and meta lines
+ '(org-fontify-meta-lines-and-blocks)
+ ;; Citations
+ '(org-cite-activate))))
+ (setq org-font-lock-extra-keywords (delq nil org-font-lock-extra-keywords))
+ (run-hooks 'org-font-lock-set-keywords-hook)
+ ;; Now set the full font-lock-keywords
+ (setq-local org-font-lock-keywords org-font-lock-extra-keywords)
+ (setq-local font-lock-defaults
+ '(org-font-lock-keywords t nil nil backward-paragraph))
+ (setq-local font-lock-extend-after-change-region-function
+ #'org-fontify-extend-region)
+ (kill-local-variable 'font-lock-keywords)
+ nil))
+
+(defun org-toggle-pretty-entities ()
+ "Toggle the composition display of entities as UTF8 characters."
+ (interactive)
+ (setq-local org-pretty-entities (not org-pretty-entities))
+ (org-restart-font-lock)
+ (if org-pretty-entities
+ (message "Entities are now displayed as UTF8 characters")
+ (save-restriction
+ (widen)
+ (decompose-region (point-min) (point-max))
+ (message "Entities are now displayed as plain text"))))
+
+(defvar-local org-custom-properties-overlays nil
+ "List of overlays used for custom properties.")
+
+(defun org-toggle-custom-properties-visibility ()
+ "Display or hide properties in `org-custom-properties'."
+ (interactive)
+ (if org-custom-properties-overlays
+ (progn (mapc #'delete-overlay org-custom-properties-overlays)
+ (setq org-custom-properties-overlays nil))
+ (when org-custom-properties
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (let ((regexp (org-re-property (regexp-opt org-custom-properties) t t)))
+ (while (re-search-forward regexp nil t)
+ (let ((end (cdr (save-match-data (org-get-property-block)))))
+ (when (and end (< (point) end))
+ ;; Hide first custom property in current drawer.
+ (let ((o (make-overlay (match-beginning 0) (1+ (match-end 0)))))
+ (overlay-put o 'invisible t)
+ (overlay-put o 'org-custom-property t)
+ (push o org-custom-properties-overlays))
+ ;; Hide additional custom properties in the same drawer.
+ (while (re-search-forward regexp end t)
+ (let ((o (make-overlay (match-beginning 0) (1+ (match-end 0)))))
+ (overlay-put o 'invisible t)
+ (overlay-put o 'org-custom-property t)
+ (push o org-custom-properties-overlays)))))
+ ;; Each entry is limited to a single property drawer.
+ (outline-next-heading)))))))
+
+(defun org-fontify-entities (limit)
+ "Find an entity to fontify."
+ (let (ee)
+ (when org-pretty-entities
+ (catch 'match
+ ;; "\_ "-family is left out on purpose. Only the first one,
+ ;; i.e., "\_ ", could be fontified anyway, and it would be
+ ;; confusing when adding a second white space character.
+ (while (re-search-forward
+ "\\\\\\(there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]\n]\\)"
+ limit t)
+ (when (and (not (org-at-comment-p))
+ (setq ee (org-entity-get (match-string 1)))
+ (= (length (nth 6 ee)) 1))
+ (let* ((end (if (equal (match-string 2) "{}")
+ (match-end 2)
+ (match-end 1))))
+ (add-text-properties
+ (match-beginning 0) end
+ (list 'font-lock-fontified t))
+ (compose-region (match-beginning 0) end
+ (nth 6 ee) nil)
+ (backward-char 1)
+ (throw 'match t))))
+ nil))))
+
+(defun org-fontify-like-in-org-mode (s &optional odd-levels)
+ "Fontify string S like in Org mode."
+ (with-temp-buffer
+ (insert s)
+ (let ((org-odd-levels-only odd-levels))
+ (org-mode)
+ (org-font-lock-ensure)
+ (buffer-string))))
+
+(defun org-get-level-face (n)
+ "Get the right face for match N in font-lock matching of headlines."
+ (let* ((org-l0 (- (match-end 2) (match-beginning 1) 1))
+ (org-l (if org-odd-levels-only (1+ (/ org-l0 2)) org-l0))
+ (org-f (if org-cycle-level-faces
+ (nth (% (1- org-l) org-n-level-faces) org-level-faces)
+ (nth (1- (min org-l org-n-level-faces)) org-level-faces))))
+ (cond
+ ((eq n 1) (if org-hide-leading-stars 'org-hide org-f))
+ ((eq n 2) org-f)
+ (t (unless org-level-color-stars-only org-f)))))
+
+(defun org-face-from-face-or-color (context inherit face-or-color)
+ "Create a face list that inherits INHERIT, but sets the foreground color.
+When FACE-OR-COLOR is not a string, just return it."
+ (if (stringp face-or-color)
+ (list :inherit inherit
+ (cdr (assoc context org-faces-easy-properties))
+ face-or-color)
+ face-or-color))
+
+(defun org-get-todo-face (kwd)
+ "Get the right face for a TODO keyword KWD.
+If KWD is a number, get the corresponding match group."
+ (when (numberp kwd) (setq kwd (match-string kwd)))
+ (or (org-face-from-face-or-color
+ 'todo 'org-todo (cdr (assoc kwd org-todo-keyword-faces)))
+ (and (member kwd org-done-keywords) 'org-done)
+ 'org-todo))
+
+(defun org-get-priority-face (priority)
+ "Get the right face for PRIORITY.
+PRIORITY is a character."
+ (or (org-face-from-face-or-color
+ 'priority 'org-priority (cdr (assq priority org-priority-faces)))
+ 'org-priority))
+
+(defun org-get-tag-face (tag)
+ "Get the right face for TAG.
+If TAG is a number, get the corresponding match group."
+ (let ((tag (if (wholenump tag) (match-string tag) tag)))
+ (or (org-face-from-face-or-color
+ 'tag 'org-tag (cdr (assoc tag org-tag-faces)))
+ 'org-tag)))
+
+(defvar org-priority-regexp) ; defined later in the file
+
+(defun org-font-lock-add-priority-faces (limit)
+ "Add the special priority faces."
+ (while (re-search-forward (concat "^\\*+" org-priority-regexp) limit t)
+ (let ((beg (match-beginning 1))
+ (end (1+ (match-end 2))))
+ (add-face-text-property
+ beg end
+ (org-get-priority-face (string-to-char (match-string 2))))
+ (add-text-properties
+ beg end
+ (list 'font-lock-fontified t)))))
+
+(defun org-font-lock-add-tag-faces (limit)
+ "Add the special tag faces."
+ (when (and org-tag-faces org-tags-special-faces-re)
+ (while (re-search-forward org-tags-special-faces-re limit t)
+ (add-face-text-property
+ (match-beginning 1)
+ (match-end 1)
+ (org-get-tag-face 1))
+ (add-text-properties (match-beginning 1) (match-end 1)
+ (list 'font-lock-fontified t))
+ (backward-char 1))))
+
+(defun org-unfontify-region (beg end &optional _maybe_loudly)
+ "Remove fontification and activation overlays from links."
+ (font-lock-default-unfontify-region beg end)
+ (let* ((buffer-undo-list t)
+ (inhibit-read-only t) (inhibit-point-motion-hooks t)
+ (inhibit-modification-hooks t)
+ deactivate-mark buffer-file-name buffer-file-truename)
+ (decompose-region beg end)
+ (remove-text-properties beg end
+ '(mouse-face t keymap t org-linked-text t
+ invisible t intangible t
+ org-emphasis t))
+ (org-remove-font-lock-display-properties beg end)))
+
+(defconst org-script-display '(((raise -0.3) (height 0.7))
+ ((raise 0.3) (height 0.7))
+ ((raise -0.5))
+ ((raise 0.5)))
+ "Display properties for showing superscripts and subscripts.")
+
+(defun org-remove-font-lock-display-properties (beg end)
+ "Remove specific display properties that have been added by font lock.
+The will remove the raise properties that are used to show superscripts
+and subscripts."
+ (let (next prop)
+ (while (< beg end)
+ (setq next (next-single-property-change beg 'display nil end)
+ prop (get-text-property beg 'display))
+ (when (member prop org-script-display)
+ (put-text-property beg next 'display nil))
+ (setq beg next))))
+
+(defun org-raise-scripts (limit)
+ "Add raise properties to sub/superscripts."
+ (when (and org-pretty-entities org-pretty-entities-include-sub-superscripts
+ (re-search-forward
+ (if (eq org-use-sub-superscripts t)
+ org-match-substring-regexp
+ org-match-substring-with-braces-regexp)
+ limit t))
+ (let* ((pos (point)) table-p comment-p
+ (mpos (match-beginning 3))
+ (emph-p (get-text-property mpos 'org-emphasis))
+ (link-p (get-text-property mpos 'mouse-face))
+ (keyw-p (eq 'org-special-keyword (get-text-property mpos 'face))))
+ (goto-char (point-at-bol))
+ (setq table-p (looking-at-p org-table-dataline-regexp)
+ comment-p (looking-at-p "^[ \t]*#[ +]"))
+ (goto-char pos)
+ ;; Handle a_b^c
+ (when (member (char-after) '(?_ ?^)) (goto-char (1- pos)))
+ (unless (or comment-p emph-p link-p keyw-p)
+ (put-text-property (match-beginning 3) (match-end 0)
+ 'display
+ (if (equal (char-after (match-beginning 2)) ?^)
+ (nth (if table-p 3 1) org-script-display)
+ (nth (if table-p 2 0) org-script-display)))
+ (add-text-properties (match-beginning 2) (match-end 2)
+ (list 'invisible t))
+ (when (and (eq (char-after (match-beginning 3)) ?{)
+ (eq (char-before (match-end 3)) ?}))
+ (add-text-properties (match-beginning 3) (1+ (match-beginning 3))
+ (list 'invisible t))
+ (add-text-properties (1- (match-end 3)) (match-end 3)
+ (list 'invisible t))))
+ t)))
+
+(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-p
+ "\\S-" (buffer-substring (overlay-start o)
+ (overlay-end o))))
+ (delete-overlay o))))
+
+(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
+ :test #'equal))))
+ 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-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))))))
+
+
+;;; Visibility (headlines, blocks, drawers)
+
+;;;; Headlines visibility
+
+(defun org-show-entry ()
+ "Show the body directly following its heading.
+Show the heading too, if it is currently invisible."
+ (interactive)
+ (save-excursion
+ (org-back-to-heading-or-point-min 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)
+ (org-cycle-hide-drawers 'children)))
+
+(defun org-hide-entry ()
+ "Hide the body directly following its heading."
+ (interactive)
+ (save-excursion
+ (org-back-to-heading-or-point-min t)
+ (when (org-at-heading-p) (forward-line))
+ (org-flag-region
+ (line-end-position 0)
+ (save-excursion
+ (if (re-search-forward
+ (concat "[\r\n]" org-outline-regexp) nil t)
+ (line-end-position 0)
+ (point-max)))
+ t
+ 'outline)))
+
+(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")
+ (unless (org-before-first-heading-p)
+ (save-excursion
+ (org-with-limited-levels (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))))))
+
+(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))
+
+;;;; Blocks and drawers visibility
+
+(defun org--hide-wrapper-toggle (element category force no-error)
+ "Toggle visibility for ELEMENT.
+
+ELEMENT is a block or drawer type parsed element. CATEGORY is
+either `block' or `drawer'. When FORCE is `off', show the block
+or drawer. If it is non-nil, hide it unconditionally. Throw an
+error when not at a block or drawer, unless NO-ERROR is non-nil.
+
+Return a non-nil value when toggling is successful."
+ (let ((type (org-element-type element)))
+ (cond
+ ((memq type
+ (pcase category
+ (`drawer '(drawer property-drawer))
+ (`block '(center-block
+ comment-block dynamic-block example-block export-block
+ quote-block special-block src-block verse-block))
+ (_ (error "Unknown category: %S" category))))
+ (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)))
+ (let* ((spec (if (eq category 'block) 'org-hide-block 'outline))
+ (flag
+ (cond ((eq force 'off) nil)
+ (force t)
+ ((eq spec (get-char-property start 'invisible)) nil)
+ (t t))))
+ (org-flag-region start end flag spec))
+ ;; 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)))
+ (no-error nil)
+ (t
+ (user-error (if (eq category 'drawer)
+ "Not at a drawer"
+ "Not at a block"))))))
+
+(defun org-hide-block-toggle (&optional force no-error element)
+ "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, unless NO-ERROR is non-nil. When optional argument
+ELEMENT is provided, consider it instead of the current block.
+
+Return a non-nil value when toggling is successful."
+ (interactive)
+ (org--hide-wrapper-toggle
+ (or element (org-element-at-point)) 'block force no-error))
+
+(defun org-hide-drawer-toggle (&optional force no-error element)
+ "Toggle the visibility of the current drawer.
+
+When optional argument FORCE is `off', make drawer visible. If
+it is non-nil, hide it unconditionally. Throw an error when not
+at a drawer, unless NO-ERROR is non-nil. When optional argument
+ELEMENT is provided, consider it instead of the current drawer.
+
+Return a non-nil value when toggling is successful."
+ (interactive)
+ (org--hide-wrapper-toggle
+ (or element (org-element-at-point)) 'drawer force no-error))
+
+(defun org-hide-block-all ()
+ "Fold all blocks in the current buffer."
+ (interactive)
+ (org-show-all '(blocks))
+ (org-block-map 'org-hide-block-toggle))
+
+(defun org-hide-drawer-all ()
+ "Fold all drawers in the current buffer."
+ (let ((begin (point-min))
+ (end (point-max)))
+ (org--hide-drawers begin end)))
+
+(defun org-cycle-hide-drawers (state)
+ "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 (derived-mode-p 'org-mode)
+ (cond ((not (memq state '(overview folded contents)))
+ (let* ((global? (eq state 'all))
+ (beg (if global? (point-min) (line-beginning-position)))
+ (end (cond (global? (point-max))
+ ((eq state 'children) (org-entry-end-position))
+ (t (save-excursion (org-end-of-subtree t t))))))
+ (org--hide-drawers beg end)))
+ ((memq state '(overview contents))
+ ;; Hide drawers before first heading.
+ (let ((beg (point-min))
+ (end (save-excursion
+ (goto-char (point-min))
+ (if (org-before-first-heading-p)
+ (org-entry-end-position)
+ (point-min)))))
+ (when (< beg end)
+ (org--hide-drawers beg end)))))))
+
+(defun org--hide-drawers (begin end)
+ "Hide all drawers between BEGIN and END."
+ (save-excursion
+ (goto-char begin)
+ (while (re-search-forward org-drawer-regexp end t)
+ (let* ((pair (get-char-property-and-overlay (line-beginning-position)
+ 'invisible))
+ (o (cdr-safe pair)))
+ (if (overlayp o) (goto-char (overlay-end o)) ;invisible drawer
+ (pcase (get-char-property-and-overlay (point) 'invisible)
+ (`(outline . ,o) (goto-char (overlay-end o))) ;already folded
+ (_
+ (let* ((drawer (org-element-at-point))
+ (type (org-element-type drawer)))
+ (when (memq type '(drawer property-drawer))
+ (org-hide-drawer-toggle t nil 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)))))))))))
+
+;;;; 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)
+ (let ((types (or types '(blocks drawers headings))))
+ (when (memq 'blocks types)
+ (org-flag-region (point-min) (point-max) nil 'org-hide-block))
+ (cond
+ ;; Fast path. Since headings and drawers share the same
+ ;; invisible spec, clear everything in one go.
+ ((and (memq 'headings types)
+ (memq 'drawers types))
+ (org-flag-region (point-min) (point-max) nil 'outline))
+ ((memq 'headings types)
+ (org-flag-region (point-min) (point-max) nil 'outline)
+ (org-cycle-hide-drawers 'all))
+ ((memq 'drawers types)
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward org-drawer-regexp nil t)
+ (let* ((pair (get-char-property-and-overlay (line-beginning-position)
+ 'invisible))
+ (o (cdr-safe pair)))
+ (if (overlayp o) (goto-char (overlay-end o))
+ (pcase (get-char-property-and-overlay (point) 'invisible)
+ (`(outline . ,o)
+ (goto-char (overlay-end o))
+ (delete-overlay o))
+ (_ nil))))))))))
+
+;;;###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 very beginning of the buffer, if
+there is no headline there, and if the variable `org-cycle-global-at-bob'
+is non-nil, this function acts as if called with prefix argument \
+\(`\\[universal-argument] TAB',
+same as `S-TAB') also when called without prefix argument."
+ (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
+ (if org-odd-levels-only
+ (1- (* 2 limit-level))
+ limit-level)))
+ (org-outline-regexp
+ (format "\\*%s " (if nstars (format "\\{1,%d\\}" nstars) "+"))))
+ (cond
+ ((equal arg '(16))
+ (setq last-command 'dummy)
+ (org-set-startup-visibility)
+ (org-unlogged-message "Startup visibility, plus VISIBILITY properties"))
+ ((equal arg '(64))
+ (org-show-all)
+ (org-unlogged-message "Entire buffer visible, including drawers"))
+ ((equal arg '(4)) (org-cycle-internal-global))
+ ;; Show-subtree, ARG levels up from here.
+ ((integerp arg)
+ (save-excursion
+ (org-back-to-heading)
+ (outline-up-heading (if (< arg 0) (- arg)
+ (- (funcall outline-level) arg)))
+ (org-show-subtree)))
+ ;; Global cycling at BOB: delegate to `org-cycle-internal-global'.
+ ((and org-cycle-global-at-bob
+ (bobp)
+ (not (looking-at org-outline-regexp)))
+ (let ((org-cycle-hook
+ (remq 'org-optimize-window-after-visibility-change
+ org-cycle-hook)))
+ (org-cycle-internal-global)))
+ ;; Try CDLaTeX TAB completion.
+ ((org-try-cdlatex-tab))
+ ;; Inline task: delegate to `org-inlinetask-toggle-visibility'.
+ ((and (featurep 'org-inlinetask)
+ (org-inlinetask-at-task-p)
+ (or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol))))
+ (org-inlinetask-toggle-visibility))
+ (t
+ (let ((pos (point))
+ (element (org-element-at-point)))
+ (cond
+ ;; Try toggling visibility for block at point.
+ ((org-hide-block-toggle nil t element))
+ ;; Try toggling visibility for drawer at point.
+ ((org-hide-drawer-toggle nil t element))
+ ;; Table: enter it or move to the next field.
+ ((and (org-match-line "[ \t]*[|+]")
+ (org-element-lineage element '(table) t))
+ (if (and (eq 'table (org-element-type element))
+ (eq 'table.el (org-element-property :type element)))
+ (message (substitute-command-keys "\\<org-mode-map>\
+Use `\\[org-edit-special]' to edit table.el tables"))
+ (org-table-justify-field-maybe)
+ (call-interactively #'org-table-next-field)))
+ ((run-hook-with-args-until-success
+ 'org-tab-after-check-for-table-hook))
+ ;; At an item/headline: delegate to `org-cycle-internal-local'.
+ ((and (or (and org-cycle-include-plain-lists
+ (let ((item (org-element-lineage element
+ '(item plain-list)
+ t)))
+ (and item
+ (= (line-beginning-position)
+ (org-element-property :post-affiliated
+ item)))))
+ (org-match-line org-outline-regexp))
+ (or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol))))
+ (org-cycle-internal-local))
+ ;; From there: TAB emulation and template completion.
+ (buffer-read-only (org-back-to-heading))
+ ((run-hook-with-args-until-success
+ 'org-tab-after-check-for-cycling-hook))
+ ((run-hook-with-args-until-success
+ 'org-tab-before-tab-emulation-hook))
+ ((and (eq org-cycle-emulate-tab 'exc-hl-bol)
+ (or (not (bolp))
+ (not (looking-at org-outline-regexp))))
+ (call-interactively (global-key-binding (kbd "TAB"))))
+ ((or (eq org-cycle-emulate-tab t)
+ (and (memq org-cycle-emulate-tab '(white whitestart))
+ (save-excursion (beginning-of-line 1) (looking-at "[ \t]*"))
+ (or (and (eq org-cycle-emulate-tab 'white)
+ (= (match-end 0) (point-at-eol)))
+ (and (eq org-cycle-emulate-tab 'whitestart)
+ (>= (match-end 0) pos)))))
+ (call-interactively (global-key-binding (kbd "TAB"))))
+ (t
+ (save-excursion
+ (org-back-to-heading)
+ (org-cycle))))))))))
+
+(defun org-cycle-internal-global ()
+ "Do the global cycling action."
+ ;; Hack to avoid display of messages for .org attachments in Gnus
+ (let ((ga (string-match-p "\\*fontification" (buffer-name))))
+ (cond
+ ((and (eq last-command this-command)
+ (eq org-cycle-global-status 'overview))
+ ;; We just created the overview - now do table of contents
+ ;; This can be slow in very large buffers, so indicate action
+ (run-hook-with-args 'org-pre-cycle-hook 'contents)
+ (unless ga (org-unlogged-message "CONTENTS..."))
+ (org-content)
+ (unless ga (org-unlogged-message "CONTENTS...done"))
+ (setq org-cycle-global-status 'contents)
+ (run-hook-with-args 'org-cycle-hook 'contents))
+
+ ((and (eq last-command this-command)
+ (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)
+ (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))
+
+ (t
+ ;; Default action: go to overview
+ (run-hook-with-args 'org-pre-cycle-hook 'overview)
+ (org-overview)
+ (unless ga (org-unlogged-message "OVERVIEW"))
+ (setq org-cycle-global-status 'overview)
+ (run-hook-with-args 'org-cycle-hook 'overview)))))
+
+(defvar org-called-with-limited-levels nil
+ "Non-nil when `org-with-limited-levels' is currently active.")
+
+(defun org-cycle-internal-local ()
+ "Do the local cycling action."
+ (let ((goal-column 0) eoh eol eos has-children children-skipped struct)
+ ;; First, determine end of headline (EOH), end of subtree or item
+ ;; (EOS), and if item or heading has children (HAS-CHILDREN).
+ (save-excursion
+ (if (org-at-item-p)
+ (progn
+ (beginning-of-line)
+ (setq struct (org-list-struct))
+ (setq eoh (point-at-eol))
+ (setq eos (org-list-get-item-end-before-blank (point) struct))
+ (setq has-children (org-list-has-child-p (point) struct)))
+ (org-back-to-heading)
+ (setq eoh (save-excursion (outline-end-of-heading) (point)))
+ (setq eos (save-excursion
+ (org-end-of-subtree t t)
+ (unless (eobp) (forward-char -1))
+ (point)))
+ (setq has-children
+ (or
+ (save-excursion
+ (let ((level (funcall outline-level)))
+ (outline-next-heading)
+ (and (org-at-heading-p t)
+ (> (funcall outline-level) level))))
+ (and (eq org-cycle-include-plain-lists 'integrate)
+ (save-excursion
+ (org-list-search-forward (org-item-beginning-re) eos t))))))
+ ;; Determine end invisible part of buffer (EOL)
+ (beginning-of-line 2)
+ (while (and (not (eobp)) ;this is like `next-line'
+ (get-char-property (1- (point)) 'invisible))
+ (goto-char (next-single-char-property-change (point) 'invisible))
+ (and (eolp) (beginning-of-line 2)))
+ (setq eol (point)))
+ ;; Find out what to do next and set `this-command'
+ (cond
+ ((= eos eoh)
+ ;; Nothing is hidden behind this heading
+ (unless (org-before-first-heading-p)
+ (run-hook-with-args 'org-pre-cycle-hook 'empty))
+ (org-unlogged-message "EMPTY ENTRY")
+ (setq org-cycle-subtree-status nil)
+ (save-excursion
+ (goto-char eos)
+ (outline-next-heading)
+ (when (org-invisible-p) (org-flag-heading nil))))
+ ((and (or (>= eol eos)
+ (not (string-match "\\S-" (buffer-substring eol eos))))
+ (or has-children
+ (not (setq children-skipped
+ org-cycle-skip-children-state-if-no-children))))
+ ;; Entire subtree is hidden in one line: children view
+ (unless (org-before-first-heading-p)
+ (run-hook-with-args 'org-pre-cycle-hook 'children))
+ (if (org-at-item-p)
+ (org-list-set-item-visibility (point-at-bol) struct 'children)
+ (org-show-entry)
+ (org-with-limited-levels (org-show-children))
+ (org-show-set-visibility 'tree)
+ ;; Fold every list in subtree to top-level items.
+ (when (eq org-cycle-include-plain-lists 'integrate)
+ (save-excursion
+ (org-back-to-heading)
+ (while (org-list-search-forward (org-item-beginning-re) eos t)
+ (beginning-of-line 1)
+ (let* ((struct (org-list-struct))
+ (prevs (org-list-prevs-alist struct))
+ (end (org-list-get-bottom-point struct)))
+ (dolist (e (org-list-get-all-items (point) struct prevs))
+ (org-list-set-item-visibility e struct 'folded))
+ (goto-char (if (< end eos) end eos)))))))
+ (org-unlogged-message "CHILDREN")
+ (save-excursion
+ (goto-char eos)
+ (outline-next-heading)
+ (when (org-invisible-p) (org-flag-heading nil)))
+ (setq org-cycle-subtree-status 'children)
+ (unless (org-before-first-heading-p)
+ (run-hook-with-args 'org-cycle-hook 'children)))
+ ((or children-skipped
+ (and (eq last-command this-command)
+ (eq org-cycle-subtree-status 'children)))
+ ;; We just showed the children, or no children are there,
+ ;; now show everything.
+ (unless (org-before-first-heading-p)
+ (run-hook-with-args 'org-pre-cycle-hook 'subtree))
+ (org-flag-region eoh eos nil 'outline)
+ (org-unlogged-message
+ (if children-skipped "SUBTREE (NO CHILDREN)" "SUBTREE"))
+ (setq org-cycle-subtree-status 'subtree)
+ (unless (org-before-first-heading-p)
+ (run-hook-with-args 'org-cycle-hook 'subtree)))
+ (t
+ ;; Default action: hide the subtree.
+ (run-hook-with-args 'org-pre-cycle-hook 'folded)
+ (org-flag-region eoh eos t 'outline)
+ (org-unlogged-message "FOLDED")
+ (setq org-cycle-subtree-status 'folded)
+ (unless (org-before-first-heading-p)
+ (run-hook-with-args 'org-cycle-hook 'folded))))))
+
+;;;###autoload
+(defun org-global-cycle (&optional arg)
+ "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."
+ (interactive "P")
+ (cond
+ ((integerp arg)
+ (org-content arg)
+ (setq org-cycle-global-status 'contents))
+ ((equal arg '(4))
+ (org-set-startup-visibility)
+ (org-unlogged-message "Startup visibility, plus VISIBILITY properties."))
+ (t
+ (org-cycle '(4)))))
+
+(defun org-set-startup-visibility ()
+ "Set the visibility required by startup options and properties."
+ (cond
+ ((eq org-startup-folded t)
+ (org-overview))
+ ((eq org-startup-folded 'content)
+ (org-content))
+ ((eq org-startup-folded 'show2levels)
+ (org-content 2))
+ ((eq org-startup-folded 'show3levels)
+ (org-content 3))
+ ((eq org-startup-folded 'show4levels)
+ (org-content 4))
+ ((eq org-startup-folded 'show5levels)
+ (org-content 5))
+ ((or (eq org-startup-folded 'showeverything)
+ (eq org-startup-folded nil))
+ (org-show-all)))
+ (unless (eq org-startup-folded 'showeverything)
+ (when org-hide-block-startup (org-hide-block-all))
+ (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 ()
+ "Switch subtree visibility according to VISIBILITY property."
+ (interactive)
+ (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)
+ (org-flag-subtree t)
+ (org-reveal)
+ (pcase state
+ ("folded"
+ (org-flag-subtree t))
+ ("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."
+ (interactive)
+ (org-show-all '(headings drawers))
+ (save-excursion
+ (goto-char (point-min))
+ (when (re-search-forward org-outline-regexp-bol nil t)
+ (let* ((last (line-end-position))
+ (level (- (match-end 0) (match-beginning 0) 1))
+ (regexp (format "^\\*\\{1,%d\\} " level)))
+ (while (re-search-forward regexp nil :move)
+ (org-flag-region last (line-end-position 0) t 'outline)
+ (setq last (line-end-position))
+ (setq level (- (match-end 0) (match-beginning 0) 1))
+ (setq regexp (format "^\\*\\{1,%d\\} " level)))
+ (org-flag-region last (point) t 'outline)))))
+
+(defun org-content (&optional arg)
+ "Show all headlines in the buffer, like a table of contents.
+With numerical argument N, show content up to level N."
+ (interactive "p")
+ (org-show-all '(headings drawers))
+ (save-excursion
+ (goto-char (point-max))
+ (let ((regexp (if (and (wholenump arg) (> arg 0))
+ (format "^\\*\\{1,%d\\} " arg)
+ "^\\*+ "))
+ (last (point)))
+ (while (re-search-backward regexp nil t)
+ (org-flag-region (line-end-position) last t 'outline)
+ (setq last (line-end-position 0))))))
+
+(defvar org-scroll-position-to-restore nil
+ "Temporarily store scroll position to restore.")
+(defun org-optimize-window-after-visibility-change (state)
+ "Adjust the window after a change in outline visibility.
+This function is the default value of the hook `org-cycle-hook'."
+ (when (get-buffer-window (current-buffer))
+ (let ((repeat (eq last-command this-command)))
+ (unless repeat
+ (setq org-scroll-position-to-restore nil))
+ (cond
+ ((eq state 'content) nil)
+ ((eq state 'all) nil)
+ ((and org-scroll-position-to-restore repeat
+ (eq state 'folded))
+ (set-window-start nil org-scroll-position-to-restore))
+ ((eq state 'folded) nil)
+ ((eq state 'children)
+ (setq org-scroll-position-to-restore (window-start))
+ (or (org-subtree-end-visible-p) (recenter 1)))
+ ((eq state 'subtree)
+ (unless repeat
+ (setq org-scroll-position-to-restore (window-start)))
+ (or (org-subtree-end-visible-p) (recenter 1)))))))
+
+(defun org-clean-visibility-after-subtree-move ()
+ "Fix visibility issues after moving a subtree."
+ ;; First, find a reasonable region to look at:
+ ;; Start two siblings above, end three below
+ (let* ((beg (save-excursion
+ (and (org-get-previous-sibling)
+ (org-get-previous-sibling))
+ (point)))
+ (end (save-excursion
+ (and (org-get-next-sibling)
+ (org-get-next-sibling)
+ (org-get-next-sibling))
+ (if (org-at-heading-p)
+ (point-at-eol)
+ (point))))
+ (level (looking-at "\\*+"))
+ (re (when level (concat "^" (regexp-quote (match-string 0)) " "))))
+ (save-excursion
+ (save-restriction
+ (narrow-to-region beg end)
+ (when re
+ ;; Properly fold already folded siblings
+ (goto-char (point-min))
+ (while (re-search-forward re nil t)
+ (when (and (not (org-invisible-p))
+ (org-invisible-p (line-end-position)))
+ (outline-hide-entry))))
+ (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.
+The region to be covered depends on STATE when called through
+`org-cycle-hook'. Lisp program can use t for STATE to get the
+entire buffer covered. Note that an empty line is only shown if there
+are at least `org-cycle-separator-lines' empty lines before the headline."
+ (when (/= org-cycle-separator-lines 0)
+ (save-excursion
+ (let* ((n (abs org-cycle-separator-lines))
+ (re (cond
+ ((= n 1) "\\(\n[ \t]*\n\\*+\\) ")
+ ((= n 2) "^[ \t]*\\(\n[ \t]*\n\\*+\\) ")
+ (t (let ((ns (number-to-string (- n 2))))
+ (concat "^\\(?:[ \t]*\n\\)\\{" ns "," ns "\\}"
+ "[ \t]*\\(\n[ \t]*\n\\*+\\) ")))))
+ beg end)
+ (cond
+ ((memq state '(overview contents t))
+ (setq beg (point-min) end (point-max)))
+ ((memq state '(children folded))
+ (setq beg (point)
+ end (progn (org-end-of-subtree t t)
+ (line-beginning-position 2)))))
+ (when beg
+ (goto-char beg)
+ (while (re-search-forward re end t)
+ (unless (get-char-property (match-end 1) 'invisible)
+ (let ((e (match-end 1))
+ (b (if (>= org-cycle-separator-lines 0)
+ (match-beginning 1)
+ (save-excursion
+ (goto-char (match-beginning 0))
+ (skip-chars-backward " \t\n")
+ (line-end-position)))))
+ (org-flag-region b e nil 'outline))))))))
+ ;; Never hide empty lines at the end of the file.
+ (save-excursion
+ (goto-char (point-max))
+ (outline-previous-heading)
+ (outline-end-of-heading)
+ (when (and (looking-at "[ \t\n]+")
+ (= (match-end 0) (point-max)))
+ (org-flag-region (point) (match-end 0) nil 'outline))))
+
+;;;; Reveal point location
+
+(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',
+`ancestors-full', `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 ancestors-full))
+ (t (save-excursion
+ (outline-next-heading)
+ (org-flag-heading nil)))))))
+ ;; Show whole subtree.
+ (when (eq detail 'ancestors-full) (org-show-subtree))
+ ;; Show all siblings.
+ (when (eq detail 'lineage) (org-show-siblings))
+ ;; Show ancestors, possibly with their children.
+ (when (memq detail '(ancestors ancestors-full 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'.
+
+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))))
+
+
+;;; Indirect buffer display of subtrees
+
+(defvar org-indirect-dedicated-frame nil
+ "This is the frame being used for indirect tree display.")
+(defvar org-last-indirect-buffer nil)
+
+(defun org-tree-to-indirect-buffer (&optional arg)
+ "Create indirect buffer and narrow it to current subtree.
+
+With a numerical prefix ARG, go up to this level and then take that tree.
+If ARG is negative, go up that many levels.
+
+If `org-indirect-buffer-display' is not `new-frame', the command removes the
+indirect buffer previously made with this command, to avoid proliferation of
+indirect buffers. However, when you call the command with a \
+`\\[universal-argument]' prefix, or
+when `org-indirect-buffer-display' is `new-frame', the last buffer is kept
+so that you can work with several indirect buffers at the same time. If
+`org-indirect-buffer-display' is `dedicated-frame', the \
+`\\[universal-argument]' prefix also
+requests that a new frame be made for the new buffer, so that the dedicated
+frame is not changed."
+ (interactive "P")
+ (let ((cbuf (current-buffer))
+ (cwin (selected-window))
+ (pos (point))
+ beg end level heading ibuf)
+ (save-excursion
+ (org-back-to-heading t)
+ (when (numberp arg)
+ (setq level (org-outline-level))
+ (when (< arg 0) (setq arg (+ level arg)))
+ (while (> (setq level (org-outline-level)) arg)
+ (org-up-heading-safe)))
+ (setq beg (point)
+ heading (org-get-heading 'no-tags))
+ (org-end-of-subtree t t)
+ (when (and (not (eobp)) (org-at-heading-p)) (backward-char 1))
+ (setq end (point)))
+ (when (and (buffer-live-p org-last-indirect-buffer)
+ (not (eq org-indirect-buffer-display 'new-frame))
+ (not arg))
+ (kill-buffer org-last-indirect-buffer))
+ (setq ibuf (org-get-indirect-buffer cbuf heading)
+ org-last-indirect-buffer ibuf)
+ (cond
+ ((or (eq org-indirect-buffer-display 'new-frame)
+ (and arg (eq org-indirect-buffer-display 'dedicated-frame)))
+ (select-frame (make-frame))
+ (delete-other-windows)
+ (pop-to-buffer-same-window ibuf)
+ (org-set-frame-title heading))
+ ((eq org-indirect-buffer-display 'dedicated-frame)
+ (raise-frame
+ (select-frame (or (and org-indirect-dedicated-frame
+ (frame-live-p org-indirect-dedicated-frame)
+ org-indirect-dedicated-frame)
+ (setq org-indirect-dedicated-frame (make-frame)))))
+ (delete-other-windows)
+ (pop-to-buffer-same-window ibuf)
+ (org-set-frame-title (concat "Indirect: " heading)))
+ ((eq org-indirect-buffer-display 'current-window)
+ (pop-to-buffer-same-window ibuf))
+ ((eq org-indirect-buffer-display 'other-window)
+ (pop-to-buffer ibuf))
+ (t (error "Invalid value")))
+ (narrow-to-region beg end)
+ (org-show-all '(headings drawers blocks))
+ (goto-char pos)
+ (run-hook-with-args 'org-cycle-hook 'all)
+ (and (window-live-p cwin) (select-window cwin))))
+
+(defun org-get-indirect-buffer (&optional buffer heading)
+ (setq buffer (or buffer (current-buffer)))
+ (let ((n 1) (base (buffer-name buffer)) bname)
+ (while (buffer-live-p
+ (get-buffer
+ (setq bname
+ (concat base "-"
+ (if heading (concat heading "-" (number-to-string n))
+ (number-to-string n))))))
+ (setq n (1+ n)))
+ (condition-case nil
+ (make-indirect-buffer buffer bname 'clone)
+ (error (make-indirect-buffer buffer bname)))))
+
+(defun org-set-frame-title (title)
+ "Set the title of the current frame to the string TITLE."
+ (modify-frame-parameters (selected-frame) (list (cons 'name title))))
+
+;;;; Structure editing
+
+;;; Inserting headlines
+
+(defun org--blank-before-heading-p (&optional parent)
+ "Non-nil when an empty line should precede a new heading here.
+When optional argument PARENT is non-nil, consider parent
+headline instead of current one."
+ (pcase (assq 'heading org-blank-before-new-entry)
+ (`(heading . auto)
+ (save-excursion
+ (org-with-limited-levels
+ (unless (and (org-before-first-heading-p)
+ (not (outline-next-heading)))
+ (org-back-to-heading t)
+ (when parent (org-up-heading-safe))
+ (cond ((not (bobp))
+ (org-previous-line-empty-p))
+ ((outline-next-heading)
+ (org-previous-line-empty-p))
+ ;; Ignore trailing spaces on last buffer line.
+ ((progn (skip-chars-backward " \t") (bolp))
+ (org-previous-line-empty-p))
+ (t nil))))))
+ (`(heading . ,value) value)
+ (_ nil)))
+
+(defun org-insert-heading (&optional arg invisible-ok top)
+ "Insert a new heading or an item with the same depth at point.
+
+If point is at the beginning of a heading, insert a new heading
+or a new headline above the current one. When at the beginning
+of a regular line of text, turn it into a heading.
+
+If point is in the middle of a line, split it and create a new
+headline with the text in the current line after point (see
+`org-M-RET-may-split-line' on how to modify this behavior). As
+a special case, on a headline, splitting can only happen on the
+title itself. E.g., this excludes breaking stars or tags.
+
+With a `\\[universal-argument]' prefix, set \
+`org-insert-heading-respect-content' to
+a non-nil value for the duration of the command. This forces the
+insertion of a heading after the current subtree, independently
+on the location of point.
+
+With a `\\[universal-argument] \\[universal-argument]' prefix, \
+insert the heading at the end of the tree
+above the current heading. For example, if point is within a
+2nd-level heading, then it will insert a 2nd-level heading at
+the end of the 1st-level parent subtree.
+
+When INVISIBLE-OK is set, stop at invisible headlines when going
+back. This is important for non-interactive uses of the
+command.
+
+When optional argument TOP is non-nil, insert a level 1 heading,
+unconditionally."
+ (interactive "P")
+ (let* ((blank? (org--blank-before-heading-p (equal arg '(16))))
+ (level (org-current-level))
+ (stars (make-string (if (and level (not top)) level 1) ?*)))
+ (cond
+ ((or org-insert-heading-respect-content
+ (member arg '((4) (16)))
+ (and (not invisible-ok)
+ (invisible-p (max (1- (point)) (point-min)))))
+ ;; 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"))
+ (when (and blank? (save-excursion
+ (backward-char)
+ (org-before-first-heading-p)))
+ (insert "\n")
+ (backward-char))
+ (when (and (not level) (not (eobp)) (not (bobp)))
+ (when (org-at-heading-p) (insert "\n"))
+ (backward-char))
+ (unless (and blank? (org-previous-line-empty-p))
+ (org-N-empty-lines-before-current (if blank? 1 0)))
+ (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)
+ (when blank? (save-excursion (insert "\n")))
+ (save-excursion (insert stars " \n"))
+ (unless (and blank? (org-previous-line-empty-p))
+ (org-N-empty-lines-before-current (if blank? 1 0)))
+ (end-of-line))
+ ((and (org-get-alist-option org-M-RET-may-split-line 'headline)
+ (org-match-line org-complex-heading-regexp)
+ (org-pos-in-match-range (point) 4))
+ ;; Grab the text that should moved to the new headline.
+ ;; Preserve tags.
+ (let ((split (delete-and-extract-region (point) (match-end 4))))
+ (if (looking-at "[ \t]*$") (replace-match "")
+ (org-align-tags))
+ (end-of-line)
+ (when blank? (insert "\n"))
+ (insert "\n" stars " ")
+ (when (org-string-nw-p split) (insert split))))
+ (t
+ (end-of-line)
+ (when blank? (insert "\n"))
+ (insert "\n" stars " "))))
+ ;; On regular text, turn line into a headline or split, if
+ ;; appropriate.
+ ((bolp)
+ (insert stars " ")
+ (unless (and blank? (org-previous-line-empty-p))
+ (org-N-empty-lines-before-current (if blank? 1 0))))
+ (t
+ (unless (org-get-alist-option org-M-RET-may-split-line 'headline)
+ (end-of-line))
+ (insert "\n" stars " ")
+ (unless (and blank? (org-previous-line-empty-p))
+ (org-N-empty-lines-before-current (if blank? 1 0))))))
+ (run-hooks 'org-insert-heading-hook))
+
+(defun org-N-empty-lines-before-current (n)
+ "Make the number of empty lines before current exactly N.
+So this will delete or add empty lines."
+ (let ((column (current-column)))
+ (beginning-of-line)
+ (unless (bobp)
+ (let ((start (save-excursion
+ (skip-chars-backward " \r\t\n")
+ (line-end-position))))
+ (delete-region start (line-end-position 0))))
+ (insert (make-string n ?\n))
+ (move-to-column column)))
+
+(defun org-get-heading (&optional no-tags no-todo no-priority no-comment)
+ "Return the heading of the current entry, without the stars.
+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.
+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.
+This is a list with the following elements:
+- the level as an integer
+- the reduced level, different if `org-odd-levels-only' is set.
+- the TODO keyword, or nil
+- the priority character, like ?A, or nil if no priority is given
+- the headline text itself, or the tags string if no headline text
+- the tags string, or nil."
+ (save-excursion
+ (org-back-to-heading t)
+ (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."
+ (save-excursion
+ (org-back-to-heading t)
+ (buffer-substring (point-at-bol 2) (org-end-of-subtree t))))
+
+(defun org-edit-headline (&optional heading)
+ "Edit the current headline.
+Set it to HEADING when provided."
+ (interactive)
+ (org-with-wide-buffer
+ (org-back-to-heading t)
+ (let ((case-fold-search nil))
+ (when (looking-at org-complex-heading-regexp)
+ (let* ((old (match-string-no-properties 4))
+ (new (save-match-data
+ (org-trim (or heading (read-string "Edit: " old))))))
+ (unless (equal old new)
+ (if old (replace-match new t t nil 4)
+ (goto-char (or (match-end 3) (match-end 2) (match-end 1)))
+ (insert " " new))
+ (org-align-tags)
+ (when (looking-at "[ \t]*$") (replace-match ""))))))))
+
+(defun org-insert-heading-after-current ()
+ "Insert a new heading with same level as current, after current subtree."
+ (interactive)
+ (org-back-to-heading)
+ (org-insert-heading)
+ (org-move-subtree-down)
+ (end-of-line 1))
+
+(defun org-insert-heading-respect-content (&optional invisible-ok)
+ "Insert heading with `org-insert-heading-respect-content' set to t."
+ (interactive)
+ (org-insert-heading '(4) invisible-ok))
+
+(defun org-insert-todo-heading-respect-content (&optional force-state)
+ "Insert TODO heading with `org-insert-heading-respect-content' set to t."
+ (interactive)
+ (org-insert-todo-heading force-state '(4)))
+
+(defun org-insert-todo-heading (arg &optional force-heading)
+ "Insert a new heading with the same level and TODO state as current heading.
+
+If the heading has no TODO state, or if the state is DONE, use
+the first state (TODO by default). Also with one prefix arg,
+force first state. With two prefix args, force inserting at the
+end of the parent subtree.
+
+When called at a plain list item, insert a new item with an
+unchecked check box."
+ (interactive "P")
+ (when (or force-heading (not (org-insert-item 'checkbox)))
+ (org-insert-heading (or (and (equal arg '(16)) '(16))
+ force-heading))
+ (save-excursion
+ (org-forward-heading-same-level -1)
+ (let ((case-fold-search nil)) (looking-at org-todo-line-regexp)))
+ (let* ((new-mark-x
+ (if (or (equal arg '(4))
+ (not (match-beginning 2))
+ (member (match-string 2) org-done-keywords))
+ (car org-todo-keywords-1)
+ (match-string 2)))
+ (new-mark
+ (or
+ (run-hook-with-args-until-success
+ 'org-todo-get-default-hook new-mark-x nil)
+ new-mark-x)))
+ (beginning-of-line 1)
+ (and (looking-at org-outline-regexp) (goto-char (match-end 0))
+ (if org-treat-insert-todo-heading-as-state-change
+ (org-todo new-mark)
+ (insert new-mark " "))))
+ (when org-provide-todo-statistics
+ (org-update-parent-todo-statistics))))
+
+(defun org-insert-subheading (arg)
+ "Insert a new subheading and demote it.
+Works for outline headings and for plain lists alike."
+ (interactive "P")
+ (org-insert-heading arg)
+ (cond
+ ((org-at-heading-p) (org-do-demote))
+ ((org-at-item-p) (org-indent-item))))
+
+(defun org-insert-todo-subheading (arg)
+ "Insert a new subheading with TODO keyword or checkbox and demote it.
+Works for outline headings and for plain lists alike."
+ (interactive "P")
+ (org-insert-todo-heading arg)
+ (cond
+ ((org-at-heading-p) (org-do-demote))
+ ((org-at-item-p) (org-indent-item))))
+
+;;; Promotion and Demotion
+
+(defvar org-after-demote-entry-hook nil
+ "Hook run after an entry has been demoted.
+The cursor will be at the beginning of the entry.
+When a subtree is being demoted, the hook will be called for each node.")
+
+(defvar org-after-promote-entry-hook nil
+ "Hook run after an entry has been promoted.
+The cursor will be at the beginning of the entry.
+When a subtree is being promoted, the hook will be called for each node.")
+
+(defun org-promote-subtree ()
+ "Promote the entire subtree.
+See also `org-promote'."
+ (interactive)
+ (save-excursion
+ (org-with-limited-levels (org-map-tree 'org-promote)))
+ (org-fix-position-after-promote))
+
+(defun org-demote-subtree ()
+ "Demote the entire subtree.
+See `org-demote' and `org-promote'."
+ (interactive)
+ (save-excursion
+ (org-with-limited-levels (org-map-tree 'org-demote)))
+ (org-fix-position-after-promote))
+
+(defun org-do-promote ()
+ "Promote the current heading higher up the tree.
+If the region is active in `transient-mark-mode', promote all
+headings in the region."
+ (interactive)
+ (save-excursion
+ (if (org-region-active-p)
+ (org-map-region 'org-promote (region-beginning) (region-end))
+ (org-promote)))
+ (org-fix-position-after-promote))
+
+(defun org-do-demote ()
+ "Demote the current heading lower down the tree.
+If the region is active in `transient-mark-mode', demote all
+headings in the region."
+ (interactive)
+ (save-excursion
+ (if (org-region-active-p)
+ (org-map-region 'org-demote (region-beginning) (region-end))
+ (org-demote)))
+ (org-fix-position-after-promote))
+
+(defun org-fix-position-after-promote ()
+ "Fix cursor position and indentation after demoting/promoting."
+ (let ((pos (point)))
+ (when (save-excursion
+ (beginning-of-line)
+ (let ((case-fold-search nil)) (looking-at org-todo-line-regexp))
+ (or (eq pos (match-end 1)) (eq pos (match-end 2))))
+ (cond ((eobp) (insert " "))
+ ((eolp) (insert " "))
+ ((equal (char-after) ?\s) (forward-char 1))))))
+
+(defun org-current-level ()
+ "Return the level of the current entry, or nil if before the first headline.
+The level is the number of stars at the beginning of the
+headline. Use `org-reduced-level' to remove the effect of
+`org-odd-levels'. Unlike to `org-outline-level', this function
+ignores inlinetasks."
+ (let ((level (org-with-limited-levels (org-outline-level))))
+ (and (> level 0) level)))
+
+(defun org-get-previous-line-level ()
+ "Return the outline depth of the last headline before the current line.
+Returns 0 for the first headline in the buffer, and nil if before the
+first headline."
+ (and (org-current-level)
+ (or (and (/= (line-beginning-position) (point-min))
+ (save-excursion (beginning-of-line 0) (org-current-level)))
+ 0)))
+
+(defun org-reduced-level (l)
+ "Compute the effective level of a heading.
+This takes into account the setting of `org-odd-levels-only'."
+ (cond
+ ((zerop l) 0)
+ (org-odd-levels-only (1+ (floor (/ l 2))))
+ (t l)))
+
+(defun org-level-increment ()
+ "Return the number of stars that will be added or removed at a
+time to headlines when structure editing, based on the value of
+`org-odd-levels-only'."
+ (if org-odd-levels-only 2 1))
+
+(defun org-get-valid-level (level &optional change)
+ "Rectify a level change under the influence of `org-odd-levels-only'.
+LEVEL is a current level, CHANGE is by how much the level should
+be modified. Even if CHANGE is nil, LEVEL may be returned
+modified because even level numbers will become the next higher
+odd number. Returns values greater than 0."
+ (if org-odd-levels-only
+ (cond ((or (not change) (= 0 change)) (1+ (* 2 (/ level 2))))
+ ((> change 0) (1+ (* 2 (/ (+ (1- level) (* 2 change)) 2))))
+ ((< change 0) (max 1 (1+ (* 2 (/ (+ level (* 2 change)) 2))))))
+ (max 1 (+ level (or change 0)))))
+
+(defun org-promote ()
+ "Promote the current heading higher up the tree."
+ (org-with-wide-buffer
+ (org-back-to-heading t)
+ (let* ((after-change-functions (remq 'flyspell-after-change-function
+ after-change-functions))
+ (level (save-match-data (funcall outline-level)))
+ (up-head (concat (make-string (org-get-valid-level level -1) ?*) " "))
+ (diff (abs (- level (length up-head) -1))))
+ (cond
+ ((and (= level 1) org-allow-promoting-top-level-subtree)
+ (replace-match "# " nil t))
+ ((= level 1)
+ (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-align-tags))
+ (when org-adapt-indentation (org-fixup-indentation (- diff))))
+ (run-hooks 'org-after-promote-entry-hook))))
+
+(defun org-demote ()
+ "Demote the current heading lower down the tree."
+ (org-with-wide-buffer
+ (org-back-to-heading t)
+ (let* ((after-change-functions (remq 'flyspell-after-change-function
+ after-change-functions))
+ (level (save-match-data (funcall outline-level)))
+ (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-align-tags))
+ (when org-adapt-indentation (org-fixup-indentation diff))
+ (run-hooks 'org-after-demote-entry-hook))))
+
+(defun org-cycle-level ()
+ "Cycle the level of an empty headline through possible states.
+This goes first to child, then to parent, level, then up the hierarchy.
+After top level, it switches back to sibling level."
+ (interactive)
+ (let ((org-adapt-indentation nil))
+ (when (org-point-at-end-of-empty-headline)
+ (setq this-command 'org-cycle-level) ; Only needed for caching
+ (let ((cur-level (org-current-level))
+ (prev-level (org-get-previous-line-level)))
+ (cond
+ ;; If first headline in file, promote to top-level.
+ ((= prev-level 0)
+ (cl-loop repeat (/ (- cur-level 1) (org-level-increment))
+ do (org-do-promote)))
+ ;; If same level as prev, demote one.
+ ((= prev-level cur-level)
+ (org-do-demote))
+ ;; If parent is top-level, promote to top level if not already.
+ ((= prev-level 1)
+ (cl-loop repeat (/ (- cur-level 1) (org-level-increment))
+ do (org-do-promote)))
+ ;; If top-level, return to prev-level.
+ ((= cur-level 1)
+ (cl-loop repeat (/ (- prev-level 1) (org-level-increment))
+ do (org-do-demote)))
+ ;; If less than prev-level, promote one.
+ ((< cur-level prev-level)
+ (org-do-promote))
+ ;; If deeper than prev-level, promote until higher than
+ ;; prev-level.
+ ((> cur-level prev-level)
+ (cl-loop repeat (+ 1 (/ (- cur-level prev-level) (org-level-increment)))
+ do (org-do-promote))))
+ t))))
+
+(defun org-map-tree (fun)
+ "Call FUN for every heading underneath the current one."
+ (org-back-to-heading t)
+ (let ((level (funcall outline-level)))
+ (save-excursion
+ (funcall fun)
+ (while (and (progn
+ (outline-next-heading)
+ (> (funcall outline-level) level))
+ (not (eobp)))
+ (funcall fun)))))
+
+(defun org-map-region (fun beg end)
+ "Call FUN for every heading between BEG and END."
+ (let ((org-ignore-region t))
+ (save-excursion
+ (setq end (copy-marker end))
+ (goto-char beg)
+ (when (and (re-search-forward org-outline-regexp-bol nil t)
+ (< (point) end))
+ (funcall fun))
+ (while (and (progn
+ (outline-next-heading)
+ (< (point) end))
+ (not (eobp)))
+ (funcall fun)))))
+
+(defun org-fixup-indentation (diff)
+ "Change the indentation in the current entry by DIFF.
+
+DIFF is an integer. Indentation is done according to the
+following rules:
+
+ - Planning information and property drawers are always indented
+ according to the new level of the headline;
+
+ - Footnote definitions and their contents are ignored;
+
+ - Inlinetasks' boundaries are not shifted;
+
+ - Empty lines are ignored;
+
+ - Other lines' indentation are shifted by DIFF columns, unless
+ it would introduce a structural change in the document, in
+ which case no shifting is done at all.
+
+Assume point is at a heading or an inlinetask beginning."
+ (org-with-wide-buffer
+ (narrow-to-region (line-beginning-position)
+ (save-excursion
+ (if (org-with-limited-levels (org-at-heading-p))
+ (org-with-limited-levels (outline-next-heading))
+ (org-inlinetask-goto-end))
+ (point)))
+ (forward-line)
+ ;; Indent properly planning info and property drawer.
+ (when (looking-at-p org-planning-line-re)
+ (org-indent-line)
+ (forward-line))
+ (when (looking-at org-property-drawer-re)
+ (goto-char (match-end 0))
+ (forward-line)
+ (org-indent-region (match-beginning 0) (match-end 0)))
+ (when (looking-at org-logbook-drawer-re)
+ (let ((end-marker (move-marker (make-marker) (match-end 0)))
+ (col (+ (current-indentation) diff)))
+ (when (wholenump col)
+ (while (< (point) end-marker)
+ (if (natnump diff)
+ (insert (make-string diff 32))
+ (delete-char (abs diff)))
+ (forward-line)))))
+ (catch 'no-shift
+ (when (or (zerop diff) (not (eq org-adapt-indentation t)))
+ (throw 'no-shift nil))
+ ;; If DIFF is negative, first check if a shift is possible at all
+ ;; (e.g., it doesn't break structure). This can only happen if
+ ;; some contents are not properly indented.
+ (let ((case-fold-search t))
+ (when (< diff 0)
+ (let ((diff (- diff))
+ (forbidden-re (concat org-outline-regexp
+ "\\|"
+ (substring org-footnote-definition-re 1))))
+ (save-excursion
+ (while (not (eobp))
+ (cond
+ ((looking-at-p "[ \t]*$") (forward-line))
+ ((and (looking-at-p org-footnote-definition-re)
+ (let ((e (org-element-at-point)))
+ (and (eq (org-element-type e) 'footnote-definition)
+ (goto-char (org-element-property :end e))))))
+ ((looking-at-p org-outline-regexp) (forward-line))
+ ;; Give up if shifting would move before column 0 or
+ ;; if it would introduce a headline or a footnote
+ ;; definition.
+ (t
+ (skip-chars-forward " \t")
+ (let ((ind (current-column)))
+ (when (or (< ind diff)
+ (and (= ind diff) (looking-at-p forbidden-re)))
+ (throw 'no-shift nil)))
+ ;; Ignore contents of example blocks and source
+ ;; blocks if their indentation is meant to be
+ ;; preserved. Jump to block's closing line.
+ (beginning-of-line)
+ (or (and (looking-at-p "[ \t]*#\\+BEGIN_\\(EXAMPLE\\|SRC\\)")
+ (let ((e (org-element-at-point)))
+ (and (memq (org-element-type e)
+ '(example-block src-block))
+ (or org-src-preserve-indentation
+ (org-element-property :preserve-indent e))
+ (goto-char (org-element-property :end e))
+ (progn (skip-chars-backward " \r\t\n")
+ (beginning-of-line)
+ t))))
+ (forward-line))))))))
+ ;; Shift lines but footnote definitions, inlinetasks boundaries
+ ;; by DIFF. Also skip contents of source or example blocks
+ ;; when indentation is meant to be preserved.
+ (while (not (eobp))
+ (cond
+ ((and (looking-at-p org-footnote-definition-re)
+ (let ((e (org-element-at-point)))
+ (and (eq (org-element-type e) 'footnote-definition)
+ (goto-char (org-element-property :end e))))))
+ ((looking-at-p org-outline-regexp) (forward-line))
+ ((looking-at-p "[ \t]*$") (forward-line))
+ (t
+ (indent-line-to (+ (current-indentation) diff))
+ (beginning-of-line)
+ (or (and (looking-at-p "[ \t]*#\\+BEGIN_\\(EXAMPLE\\|SRC\\)")
+ (let ((e (org-element-at-point)))
+ (and (memq (org-element-type e)
+ '(example-block src-block))
+ (or org-src-preserve-indentation
+ (org-element-property :preserve-indent e))
+ (goto-char (org-element-property :end e))
+ (progn (skip-chars-backward " \r\t\n")
+ (beginning-of-line)
+ t))))
+ (forward-line)))))))))
+
+(defun org-convert-to-odd-levels ()
+ "Convert an Org file with all levels allowed to one with odd levels.
+This will leave level 1 alone, convert level 2 to level 3, level 3 to
+level 5 etc."
+ (interactive)
+ (when (yes-or-no-p "Are you sure you want to globally change levels to odd? ")
+ (let ((outline-level 'org-outline-level)
+ (org-odd-levels-only nil) n)
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward "^\\*\\*+ " nil t)
+ (setq n (- (length (match-string 0)) 2))
+ (while (>= (setq n (1- n)) 0)
+ (org-demote))
+ (end-of-line 1))))))
+
+(defun org-convert-to-oddeven-levels ()
+ "Convert an Org file with only odd levels to one with odd/even levels.
+This promotes level 3 to level 2, level 5 to level 3 etc. If the
+file contains a section with an even level, conversion would
+destroy the structure of the file. An error is signaled in this
+case."
+ (interactive)
+ (goto-char (point-min))
+ ;; First check if there are no even levels
+ (when (re-search-forward "^\\(\\*\\*\\)+ " nil t)
+ (org-show-set-visibility 'canonical)
+ (error "Not all levels are odd in this file. Conversion not possible"))
+ (when (yes-or-no-p "Are you sure you want to globally change levels to odd-even? ")
+ (let ((outline-regexp org-outline-regexp)
+ (outline-level 'org-outline-level)
+ (org-odd-levels-only nil) n)
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward "^\\*\\*+ " nil t)
+ (setq n (/ (1- (length (match-string 0))) 2))
+ (while (>= (setq n (1- n)) 0)
+ (org-promote))
+ (end-of-line 1))))))
+
+(defun org-tr-level (n)
+ "Make N odd if required."
+ (if org-odd-levels-only (1+ (/ n 2)) n))
+
+;;; Vertical tree motion, cutting and pasting of subtrees
+
+(defun org-move-subtree-up (&optional arg)
+ "Move the current subtree up past ARG headlines of the same level."
+ (interactive "p")
+ (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))
+ (org-preserve-local-variables
+ (let ((movfunc (if (> arg 0) 'org-get-next-sibling
+ 'org-get-previous-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
+ (org-flag-subtree t)
+ (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.
+This is actually only a copy of the kill, because we use the normal kill
+ring. We need it to check if the kill was created by `org-copy-subtree'.")
+
+(defvar org-subtree-clip-folded nil
+ "Was the last copied subtree folded?
+This is used to fold the tree back after pasting.")
+
+(defun org-cut-subtree (&optional n)
+ "Cut the current subtree into the clipboard.
+With prefix arg N, cut this many sequential subtrees.
+This is a short-hand for marking the subtree and then cutting it."
+ (interactive "p")
+ (org-copy-subtree n 'cut))
+
+(defun org-copy-subtree (&optional n cut force-store-markers nosubtrees)
+ "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.
+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")
+ (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.
+
+If the cursor is at the beginning of a headline, the same level as
+that headline is used to paste the tree.
+
+If not, the new level is derived from the *visible* headings
+before and after the insertion point, and taken to be the inferior headline
+level of the two. So if the previous visible heading is level 3 and the
+next is level 4 (or vice versa), level 4 will be used for insertion.
+This makes sure that the subtree remains an independent subtree and does
+not swallow low level entries.
+
+You can also force a different level, either by using a numeric prefix
+argument, or by inserting the heading marker by hand. For example, if the
+cursor is after \"*****\", then the tree will be shifted to level 5.
+
+If optional TREE is given, use this text instead of the kill ring.
+
+When FOR-YANK is set, this is called by `org-yank'. In this case, do not
+move back over whitespace before inserting, and move point to the end of
+the inserted text when done.
+
+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
+ (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)
+ (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))
+ ;; 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)
+ (= old-level new-level))
+ 0
+ (- new-level old-level)))
+ (delta (if (> shift 0) -1 1))
+ (func (if (> shift 0) #'org-demote #'org-promote))
+ (org-odd-levels-only nil)
+ beg end newend)
+ ;; 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))
+ (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))
+ (org-reinstall-markers-in-region beg)
+ (setq end (point))
+ (goto-char beg)
+ (skip-chars-forward " \t\n\r")
+ (setq beg (point))
+ (when (and (org-invisible-p) visp)
+ (save-excursion (outline-show-heading)))
+ ;; Shift if necessary.
+ (unless (= shift 0)
+ (save-restriction
+ (narrow-to-region beg end)
+ (while (not (= shift 0))
+ (org-map-region func (point-min) (point-max))
+ (setq shift (+ delta shift)))
+ (goto-char (point-min))
+ (setq newend (point-max))))
+ (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
+ (equal org-subtree-clip (current-kill 0))
+ org-subtree-clip-folded)
+ ;; The tree was folded before it was killed/copied
+ (org-flag-subtree t))
+ (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.
+Returns nil if kill does not start with a headline, or if the first
+headline level is not the largest headline level in the tree.
+So this will actually accept several entries of equal levels as well,
+which is OK for `org-paste-subtree'.
+If optional TXT is given, check this string instead of the current kill."
+ (let* ((kill (or txt (and kill-ring (current-kill 0)) ""))
+ (re (org-get-limited-outline-regexp))
+ (^re (concat "^" re))
+ (start-level (and kill
+ (string-match
+ (concat "\\`\\([ \t\n\r]*?\n\\)?\\(" re "\\)")
+ kill)
+ (- (match-end 2) (match-beginning 2) 1)))
+ (start (1+ (or (match-beginning 2) -1))))
+ (if (not start-level)
+ (progn
+ nil) ;; does not even start with a heading
+ (catch 'exit
+ (while (setq start (string-match ^re kill (1+ start)))
+ (when (< (- (match-end 0) (match-beginning 0) 1) start-level)
+ (throw 'exit nil)))
+ t))))
+
+(defvar org-markers-to-move nil
+ "Markers that should be moved with a cut-and-paste operation.
+Those markers are stored together with their positions relative to
+the start of the region.")
+
+(defun org-save-markers-in-region (beg end)
+ "Check markers in region.
+If these markers are between BEG and END, record their position relative
+to BEG, so that after moving the block of text, we can put the markers back
+into place.
+This function gets called just before an entry or tree gets cut from the
+buffer. After re-insertion, `org-reinstall-markers-in-region' must be
+called immediately, to move the markers with the entries."
+ (setq org-markers-to-move nil)
+ (when (featurep 'org-clock)
+ (org-clock-save-markers-for-cut-and-paste beg end))
+ (when (featurep 'org-agenda)
+ (org-agenda-save-markers-for-cut-and-paste beg end)))
+
+(defun org-check-and-save-marker (marker beg end)
+ "Check if MARKER is between BEG and END.
+If yes, remember the marker and the distance to BEG."
+ (when (and (marker-buffer marker)
+ (or (equal (marker-buffer marker) (current-buffer))
+ (equal (marker-buffer marker) (buffer-base-buffer (current-buffer))))
+ (>= marker beg) (< marker end))
+ (push (cons marker (- marker beg)) org-markers-to-move)))
+
+(defun org-reinstall-markers-in-region (beg)
+ "Move all remembered markers to their position relative to BEG."
+ (dolist (x org-markers-to-move)
+ (move-marker (car x) (+ beg (cdr x))))
+ (setq org-markers-to-move nil))
+
+(defun org-narrow-to-subtree ()
+ "Narrow buffer to the current subtree."
+ (interactive)
+ (save-excursion
+ (save-match-data
+ (org-with-limited-levels
+ (narrow-to-region
+ (progn (org-back-to-heading t) (point))
+ (progn (org-end-of-subtree t t)
+ (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)
+ (progn (widen) (message "Buffer widen"))
+ (org-narrow-to-subtree)
+ (message "Buffer narrowed to current subtree")))
+
+(defun org-narrow-to-block ()
+ "Narrow buffer to the current block."
+ (interactive)
+ (let* ((case-fold-search t)
+ (blockp (org-between-regexps-p "^[ \t]*#\\+begin_.*"
+ "^[ \t]*#\\+end_.*")))
+ (if blockp
+ (narrow-to-region (car blockp) (cdr blockp))
+ (user-error "Not in a block"))))
+
+(defun org-clone-subtree-with-time-shift (n &optional shift)
+ "Clone the task (subtree) at point N times.
+The clones will be inserted as siblings.
+
+In interactive use, the user will be prompted for the number of
+clones to be produced. If the entry has a timestamp, the user
+will also be prompted for a time shift, which may be a repeater
+as used in time stamps, for example `+3d'. To disable this,
+you can call the function with a universal prefix argument.
+
+When a valid repeater is given and the entry contains any time
+stamps, the clones will become a sequence in time, with time
+stamps in the subtree shifted for each clone produced. If SHIFT
+is nil or the empty string, time stamps will be left alone. The
+ID property of the original subtree is removed.
+
+In each clone, all the CLOCK entries will be removed. This
+prevents Org from considering that the clocked times overlap.
+
+If the original subtree did contain time stamps with a repeater,
+the following will happen:
+- the repeater will be removed in each clone
+- an additional clone will be produced, with the current, unshifted
+ date(s) in the entry.
+- the original entry will be placed *after* all the clones, with
+ repeater intact.
+- the start days in the repeater in the original entry will be shifted
+ to past the last clone.
+In this way you can spell out a number of instances of a repeating task,
+and still retain the repeater to cover future instances of the task.
+
+As described above, N+1 clones are produced when the original
+subtree has a repeater. Setting N to 0, then, can be used to
+remove the repeater from a subtree and create a shifted clone
+with the original repeater."
+ (interactive "nNumber of clones to produce: ")
+ (unless (wholenump n) (user-error "Invalid number of replications %s" n))
+ (when (org-before-first-heading-p) (user-error "No subtree to clone"))
+ (let* ((beg (save-excursion (org-back-to-heading t) (point)))
+ (end-of-tree (save-excursion (org-end-of-subtree t t) (point)))
+ (shift
+ (or shift
+ (if (and (not (equal current-prefix-arg '(4)))
+ (save-excursion
+ (goto-char beg)
+ (re-search-forward org-ts-regexp-both end-of-tree t)))
+ (read-from-minibuffer
+ "Date shift per clone (e.g. +1w, empty to copy unchanged): ")
+ ""))) ;No time shift
+ (doshift
+ (and (org-string-nw-p shift)
+ (or (string-match "\\`[ \t]*\\([+-]?[0-9]+\\)\\([hdwmy]\\)[ \t]*\\'"
+ shift)
+ (user-error "Invalid shift specification %s" shift)))))
+ (goto-char end-of-tree)
+ (unless (bolp) (insert "\n"))
+ (let* ((end (point))
+ (template (buffer-substring beg end))
+ (shift-n (and doshift (string-to-number (match-string 1 shift))))
+ (shift-what (pcase (and doshift (match-string 2 shift))
+ (`nil nil)
+ ("h" 'hour)
+ ("d" 'day)
+ ("w" (setq shift-n (* 7 shift-n)) 'day)
+ ("m" 'month)
+ ("y" 'year)
+ (_ (error "Unsupported time unit"))))
+ (nmin 1)
+ (nmax n)
+ (n-no-remove -1)
+ (org-id-overriding-file-name (buffer-file-name (buffer-base-buffer)))
+ (idprop (org-entry-get beg "ID")))
+ (when (and doshift
+ (string-match-p "<[^<>\n]+ [.+]?\\+[0-9]+[hdwmy][^<>\n]*>"
+ template))
+ (delete-region beg end)
+ (setq end beg)
+ (setq nmin 0)
+ (setq nmax (1+ nmax))
+ (setq n-no-remove nmax))
+ (goto-char end)
+ (cl-loop for n from nmin to nmax do
+ (insert
+ ;; Prepare clone.
+ (with-temp-buffer
+ (insert template)
+ (org-mode)
+ (goto-char (point-min))
+ (org-show-subtree)
+ (and idprop (if org-clone-delete-id
+ (org-entry-delete nil "ID")
+ (org-id-get-create t)))
+ (unless (= n 0)
+ (while (re-search-forward org-clock-line-re nil t)
+ (delete-region (line-beginning-position)
+ (line-beginning-position 2)))
+ (goto-char (point-min))
+ (while (re-search-forward org-drawer-regexp nil t)
+ (org-remove-empty-drawer-at (point))))
+ (goto-char (point-min))
+ (when doshift
+ (while (re-search-forward org-ts-regexp-both nil t)
+ (org-timestamp-change (* n shift-n) shift-what))
+ (unless (= n n-no-remove)
+ (goto-char (point-min))
+ (while (re-search-forward org-ts-regexp nil t)
+ (save-excursion
+ (goto-char (match-beginning 0))
+ (when (looking-at "<[^<>\n]+\\( +[.+]?\\+[0-9]+[hdwmy]\\)")
+ (delete-region (match-beginning 1) (match-end 1)))))))
+ (buffer-string)))))
+ (goto-char beg)))
+
+;;; Outline path
+
+(defvar org-outline-path-cache nil
+ "Alist between buffer positions and outline paths.
+It value is an alist (POSITION . PATH) where POSITION is the
+buffer position at the beginning of an entry and PATH is a list
+of strings describing the outline path for that entry, in reverse
+order.")
+
+(defun org--get-outline-path-1 (&optional use-cache)
+ "Return outline path to current headline.
+
+Outline path is a list of strings, in reverse order. When
+optional argument USE-CACHE is non-nil, make use of a cache. See
+`org-get-outline-path' for details.
+
+Assume buffer is widened and point is on a headline."
+ (or (and use-cache (cdr (assq (point) org-outline-path-cache)))
+ (let ((p (point))
+ (heading (let ((case-fold-search nil))
+ (looking-at org-complex-heading-regexp)
+ (if (not (match-end 4)) ""
+ ;; Remove statistics cookies.
+ (org-trim
+ (org-link-display-format
+ (replace-regexp-in-string
+ "\\[[0-9]+%\\]\\|\\[[0-9]+/[0-9]+\\]" ""
+ (match-string-no-properties 4))))))))
+ (if (org-up-heading-safe)
+ (let ((path (cons heading (org--get-outline-path-1 use-cache))))
+ (when use-cache
+ (push (cons p path) org-outline-path-cache))
+ path)
+ ;; This is a new root node. Since we assume we are moving
+ ;; forward, we can drop previous cache so as to limit number
+ ;; of associations there.
+ (let ((path (list heading)))
+ (when use-cache (setq org-outline-path-cache (list (cons p path))))
+ path)))))
+
+(defun org-get-outline-path (&optional with-self use-cache)
+ "Return the outline path to the current entry.
+
+An outline path is a list of ancestors for current headline, as
+a list of strings. Statistics cookies are removed and links are
+replaced with their description, if any, or their path otherwise.
+
+When optional argument WITH-SELF is non-nil, the path also
+includes the current headline.
+
+When optional argument USE-CACHE is non-nil, cache outline paths
+between calls to this function so as to avoid backtracking. This
+argument is useful when planning to find more than one outline
+path in the same document. In that case, there are two
+conditions to satisfy:
+ - `org-outline-path-cache' is set to nil before starting the
+ process;
+ - outline paths are computed by increasing buffer positions."
+ (org-with-wide-buffer
+ (and (or (and with-self (org-back-to-heading t))
+ (org-up-heading-safe))
+ (reverse (org--get-outline-path-1 use-cache)))))
+
+(defun org-format-outline-path (path &optional width prefix separator)
+ "Format the outline path PATH for display.
+WIDTH is the maximum number of characters that is available.
+PREFIX is a prefix to be included in the returned string,
+such as the file name.
+SEPARATOR is inserted between the different parts of the path,
+the default is \"/\"."
+ (setq width (or width 79))
+ (setq path (delq nil path))
+ (unless (> width 0)
+ (user-error "Argument `width' must be positive"))
+ (setq separator (or separator "/"))
+ (let* ((org-odd-levels-only nil)
+ (fpath (concat
+ prefix (and prefix path separator)
+ (mapconcat
+ (lambda (s) (replace-regexp-in-string "[ \t]+\\'" "" s))
+ (cl-loop for head in path
+ for n from 0
+ collect (org-add-props
+ head nil 'face
+ (nth (% n org-n-level-faces) org-level-faces)))
+ separator))))
+ (when (> (length fpath) width)
+ (if (< width 7)
+ ;; It's unlikely that `width' will be this small, but don't
+ ;; waste characters by adding ".." if it is.
+ (setq fpath (substring fpath 0 width))
+ (setf (substring fpath (- width 2)) "..")))
+ fpath))
+
+(defun org-display-outline-path (&optional file current separator just-return-string)
+ "Display the current outline path in the echo area.
+
+If FILE is non-nil, prepend the output with the file name.
+If CURRENT is non-nil, append the current heading to the output.
+SEPARATOR is passed through to `org-format-outline-path'. It separates
+the different parts of the path and defaults to \"/\".
+If JUST-RETURN-STRING is non-nil, return a string, don't display a message."
+ (interactive "P")
+ (let* (case-fold-search
+ (bfn (buffer-file-name (buffer-base-buffer)))
+ (path (and (derived-mode-p 'org-mode) (org-get-outline-path)))
+ res)
+ (when current (setq path (append path
+ (save-excursion
+ (org-back-to-heading t)
+ (when (looking-at org-complex-heading-regexp)
+ (list (match-string 4)))))))
+ (setq res
+ (org-format-outline-path
+ path
+ (1- (frame-width))
+ (and file bfn (concat (file-name-nondirectory bfn) separator))
+ separator))
+ (add-face-text-property 0 (length res)
+ `(:height ,(face-attribute 'default :height))
+ nil res)
+ (if just-return-string
+ res
+ (org-unlogged-message "%s" res))))
+
+;;; Outline Sorting
+
+(defun org-sort (&optional with-case)
+ "Call `org-sort-entries', `org-table-sort-lines' or `org-sort-list'.
+Optional argument WITH-CASE means sort case-sensitively."
+ (interactive "P")
+ (org-call-with-arg
+ (cond ((org-at-table-p) #'org-table-sort-lines)
+ ((org-at-item-p) #'org-sort-list)
+ (t #'org-sort-entries))
+ with-case))
+
+(defun org-sort-remove-invisible (s)
+ "Remove emphasis markers and any invisible property from string S.
+Assume S may contain only objects."
+ ;; org-element-interpret-data clears any text property, including
+ ;; invisible part.
+ (org-element-interpret-data
+ (let ((tree (org-element-parse-secondary-string
+ s (org-element-restriction 'paragraph))))
+ (org-element-map tree '(bold code italic link strike-through underline verbatim)
+ (lambda (o)
+ (pcase (org-element-type o)
+ ;; Terminal object. Replace it with its value.
+ ((or `code `verbatim)
+ (let ((new (org-element-property :value o)))
+ (org-element-insert-before new o)
+ (org-element-put-property
+ new :post-blank (org-element-property :post-blank o))))
+ ;; Non-terminal objects. Splice contents.
+ (type
+ (let ((contents
+ (or (org-element-contents o)
+ (and (eq type 'link)
+ (list (org-element-property :raw-link o)))))
+ (c nil))
+ (while contents
+ (setq c (pop contents))
+ (org-element-insert-before c o))
+ (org-element-put-property
+ c :post-blank (org-element-property :post-blank o)))))
+ (org-element-extract-element o)))
+ ;; Return modified tree.
+ tree)))
+
+(defvar org-after-sorting-entries-or-items-hook nil
+ "Hook that is run after a bunch of entries or items have been sorted.
+When children are sorted, the cursor is in the parent line when this
+hook gets called. When a region or a plain list is sorted, the cursor
+will be in the first entry of the sorted region/list.")
+
+(defun org-sort-entries
+ (&optional with-case sorting-type getkey-func compare-func property
+ interactive?)
+ "Sort entries on a certain level of an outline tree.
+If there is an active region, the entries in the region are sorted.
+Else, if the cursor is before the first entry, sort the top-level items.
+Else, the children of the entry at point are sorted.
+
+Sorting can be alphabetically, numerically, by date/time as given by
+a time stamp, by a property, by priority order, or by a custom function.
+
+The command prompts for the sorting type unless it has been given to the
+function through the SORTING-TYPE argument, which needs to be a character,
+\(?n ?N ?a ?A ?t ?T ?s ?S ?d ?D ?p ?P ?o ?O ?r ?R ?f ?F ?k ?K). Here is
+the precise meaning of each character:
+
+a Alphabetically, ignoring the TODO keyword and the priority, if any.
+c By creation time, which is assumed to be the first inactive time stamp
+ at the beginning of a line.
+d By deadline date/time.
+k By clocking time.
+n Numerically, by converting the beginning of the entry/item to a number.
+o By order of TODO keywords.
+p By priority according to the cookie.
+r By the value of a property.
+s By scheduled date/time.
+t By date/time, either the first active time stamp in the entry, or, if
+ none exist, by the first inactive one.
+
+Capital letters will reverse the sort order.
+
+If the SORTING-TYPE is ?f or ?F, then GETKEY-FUNC specifies a function to be
+called with point at the beginning of the record. It must return a
+value that is compatible with COMPARE-FUNC, the function used to
+compare entries.
+
+Comparing entries ignores case by default. However, with an optional argument
+WITH-CASE, the sorting considers case as well.
+
+Sorting is done against the visible part of the headlines, it ignores hidden
+links.
+
+When sorting is done, call `org-after-sorting-entries-or-items-hook'.
+
+A non-nil value for INTERACTIVE? is used to signal that this
+function is being called interactively."
+ (interactive (list current-prefix-arg nil nil nil nil t))
+ (let ((case-func (if with-case 'identity 'downcase))
+ start beg end stars re re2
+ txt what tmp)
+ ;; Find beginning and end of region to sort
+ (cond
+ ((org-region-active-p)
+ ;; we will sort the region
+ (setq end (region-end)
+ what "region")
+ (goto-char (region-beginning))
+ (unless (org-at-heading-p) (outline-next-heading))
+ (setq start (point)))
+ ((or (org-at-heading-p)
+ (ignore-errors (progn (org-back-to-heading) t)))
+ ;; we will sort the children of the current headline
+ (org-back-to-heading)
+ (setq start (point)
+ end (progn (org-end-of-subtree t t)
+ (or (bolp) (insert "\n"))
+ (when (>= (org-back-over-empty-lines) 1)
+ (forward-line 1))
+ (point))
+ what "children")
+ (goto-char start)
+ (outline-show-subtree)
+ (outline-next-heading))
+ (t
+ ;; we will sort the top-level entries in this file
+ (goto-char (point-min))
+ (or (org-at-heading-p) (outline-next-heading))
+ (setq start (point))
+ (goto-char (point-max))
+ (beginning-of-line 1)
+ (when (looking-at ".*?\\S-")
+ ;; File ends in a non-white line
+ (end-of-line 1)
+ (insert "\n"))
+ (setq end (point-max))
+ (setq what "top-level")
+ (goto-char start)
+ (org-show-all '(headings drawers blocks))))
+
+ (setq beg (point))
+ (when (>= beg end) (goto-char start) (user-error "Nothing to sort"))
+
+ (looking-at "\\(\\*+\\)")
+ (setq stars (match-string 1)
+ re (concat "^" (regexp-quote stars) " +")
+ re2 (concat "^" (regexp-quote (substring stars 0 -1)) "[ \t\n]")
+ txt (buffer-substring beg end))
+ (unless (equal (substring txt -1) "\n") (setq txt (concat txt "\n")))
+ (when (and (not (equal stars "*")) (string-match re2 txt))
+ (user-error "Region to sort contains a level above the first entry"))
+
+ (unless sorting-type
+ (message
+ "Sort %s: [a]lpha [n]umeric [p]riority p[r]operty todo[o]rder [f]unc
+ [t]ime [s]cheduled [d]eadline [c]reated cloc[k]ing
+ A/N/P/R/O/F/T/S/D/C/K means reversed:"
+ what)
+ (setq sorting-type (read-char-exclusive)))
+
+ (unless getkey-func
+ (and (= (downcase sorting-type) ?f)
+ (setq getkey-func
+ (or (and interactive?
+ (org-read-function
+ "Function for extracting keys: "))
+ (error "Missing key extractor")))))
+
+ (and (= (downcase sorting-type) ?r)
+ (not property)
+ (setq property
+ (completing-read "Property: "
+ (mapcar #'list (org-buffer-property-keys t))
+ nil t)))
+
+ (when (member sorting-type '(?k ?K)) (org-clock-sum))
+ (message "Sorting entries...")
+
+ (save-restriction
+ (narrow-to-region start end)
+ (let ((restore-clock?
+ ;; The clock marker is lost when using `sort-subr'; mark
+ ;; the clock with temporary `:org-clock-marker-backup'
+ ;; text property.
+ (when (and (eq (org-clocking-buffer) (current-buffer))
+ (<= start (marker-position org-clock-marker))
+ (>= end (marker-position org-clock-marker)))
+ (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)))
+ (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-priority-default))
+ ((= 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)) '<))))
+ (org-cycle-hide-drawers 'all)
+ (when restore-clock?
+ (move-marker org-clock-marker
+ (1+ (next-single-property-change
+ start :org-clock-marker-backup)))
+ (remove-text-properties (1- org-clock-marker) org-clock-marker
+ '(:org-clock-marker-backup t)))))
+ (run-hooks 'org-after-sorting-entries-or-items-hook)
+ (message "Sorting entries...done")))
+
+(defun org-contextualize-keys (alist contexts)
+ "Return valid elements in ALIST depending on CONTEXTS.
+
+`org-agenda-custom-commands' or `org-capture-templates' are the
+values used for ALIST, and `org-agenda-custom-commands-contexts'
+or `org-capture-templates-contexts' are the associated contexts
+definitions."
+ (let ((contexts
+ ;; normalize contexts
+ (mapcar
+ (lambda(c) (cond ((listp (cadr c))
+ (list (car c) (car c) (nth 1 c)))
+ ((string= "" (cadr c))
+ (list (car c) (car c) (nth 2 c)))
+ (t c)))
+ contexts))
+ (a alist) r s)
+ ;; loop over all commands or templates
+ (dolist (c a)
+ (let (vrules repl)
+ (cond
+ ((not (assoc (car c) contexts))
+ (push c r))
+ ((and (assoc (car c) contexts)
+ (setq vrules (org-contextualize-validate-key
+ (car c) contexts)))
+ (mapc (lambda (vr)
+ (unless (equal (car vr) (cadr vr))
+ (setq repl vr)))
+ vrules)
+ (if (not repl) (push c r)
+ (push (cadr repl) s)
+ (push
+ (cons (car c)
+ (cdr (or (assoc (cadr repl) alist)
+ (error "Undefined key `%s' as contextual replacement for `%s'"
+ (cadr repl) (car c)))))
+ r))))))
+ ;; Return limited ALIST, possibly with keys modified, and deduplicated
+ (delq
+ nil
+ (delete-dups
+ (mapcar (lambda (x)
+ (let ((tpl (car x)))
+ (unless (delq
+ nil
+ (mapcar (lambda (y)
+ (equal y tpl))
+ s))
+ x)))
+ (reverse r))))))
+
+(defun org-contextualize-validate-key (key contexts)
+ "Check CONTEXTS for agenda or capture KEY."
+ (let (res)
+ (dolist (r contexts)
+ (dolist (rr (car (last r)))
+ (when
+ (and (equal key (car r))
+ (if (functionp rr) (funcall rr)
+ (or (and (eq (car rr) 'in-file)
+ (buffer-file-name)
+ (string-match (cdr rr) (buffer-file-name)))
+ (and (eq (car rr) 'in-mode)
+ (string-match (cdr rr) (symbol-name major-mode)))
+ (and (eq (car rr) 'in-buffer)
+ (string-match (cdr rr) (buffer-name)))
+ (when (and (eq (car rr) 'not-in-file)
+ (buffer-file-name))
+ (not (string-match (cdr rr) (buffer-file-name))))
+ (when (eq (car rr) 'not-in-mode)
+ (not (string-match (cdr rr) (symbol-name major-mode))))
+ (when (eq (car rr) 'not-in-buffer)
+ (not (string-match (cdr rr) (buffer-name)))))))
+ (push r res))))
+ (delete-dups (delq nil res))))
+
+;; 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)
+ "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."
+ (org-load-modules-maybe)
+ (let (binds)
+ (dolist (var (org-get-local-variables))
+ (when (or (not (boundp (car var)))
+ (eq (symbol-value (car var))
+ (default-value (car var))))
+ (push (list (car var) `(quote ,(cadr var))) binds)))
+ (eval `(let ,binds
+ (call-interactively (quote ,cmd))))))
+
+(defun org-get-category (&optional pos force-refresh)
+ "Get the category applying to position POS."
+ (save-match-data
+ (when force-refresh (org-refresh-category-properties))
+ (let ((pos (or pos (point))))
+ (or (get-text-property pos 'org-category)
+ (progn (org-refresh-category-properties)
+ (get-text-property pos 'org-category))))))
+
+;;; Refresh properties
+
+(defun org-refresh-properties (dprop tprop)
+ "Refresh buffer text properties.
+DPROP is the drawer property and TPROP is either the
+corresponding text property to set, or an alist with each element
+being a text property (as a symbol) and a function to apply to
+the value of the drawer property."
+ (let* ((case-fold-search t)
+ (inhibit-read-only t)
+ (inherit? (org-property-inherit-p dprop))
+ (property-re (org-re-property (concat (regexp-quote dprop) "\\+?") t))
+ (global-or-keyword (and inherit?
+ (org--property-global-or-keyword-value dprop nil))))
+ (with-silent-modifications
+ (org-with-point-at 1
+ ;; Set global and keyword based values to the whole buffer.
+ (when global-or-keyword
+ (put-text-property (point-min) (point-max) tprop global-or-keyword))
+ ;; Set values based on property-drawers throughout the document.
+ (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.
+
+The refresh happens only for the current entry, or the whole
+sub-tree if optional argument INHERIT is non-nil.
+
+If point is before first headline, the function applies to the
+part before the first headline. In that particular case, when
+optional argument INHERIT is non-nil, it refreshes properties for
+the whole buffer."
+ (save-excursion
+ (org-back-to-heading-or-point-min t)
+ (let ((start (point))
+ (end (save-excursion
+ (cond ((and inherit (org-before-first-heading-p))
+ (point-max))
+ (inherit
+ (org-end-of-subtree t t))
+ ((outline-next-heading))
+ ((point-max))))))
+ (if (symbolp tprop)
+ ;; TPROP is a text property symbol.
+ (put-text-property start end tprop p)
+ ;; TPROP is an alist with (property . function) elements.
+ (pcase-dolist (`(,prop . ,f) tprop)
+ (put-text-property start end prop (funcall f p)))))))
+
+(defun org-refresh-category-properties ()
+ "Refresh category text properties in the buffer."
+ (let ((case-fold-search t)
+ (inhibit-read-only t)
+ (default-category
+ (cond ((null org-category)
+ (if buffer-file-name
+ (file-name-sans-extension
+ (file-name-nondirectory buffer-file-name))
+ "???"))
+ ((symbolp org-category) (symbol-name org-category))
+ (t org-category))))
+ (with-silent-modifications
+ (org-with-wide-buffer
+ ;; Set buffer-wide property from keyword. Search last #+CATEGORY
+ ;; keyword. If none is found, fall-back to `org-category' or
+ ;; buffer file name, or set it by the document property drawer.
+ (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 categories from the document property drawer or
+ ;; property drawers in the outline. If category is found in
+ ;; the property drawer for the whole buffer that value
+ ;; overrides the keyword-based value set above.
+ (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-or-point-min t))
+ (save-excursion (if (org-before-first-heading-p)
+ (point-max)
+ (org-end-of-subtree t t)))
+ 'org-category
+ value)))))))))
+
+(defun org-refresh-stats-properties ()
+ "Refresh stats text properties in the buffer."
+ (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."
+ (org-refresh-properties
+ org-effort-property
+ '((effort . identity)
+ (effort-minutes . org-duration-to-minutes))))
+
+(defun org-find-file-at-mouse (ev)
+ "Open file link or URL at mouse."
+ (interactive "e")
+ (mouse-set-point ev)
+ (org-open-at-point 'in-emacs))
+
+(defun org-open-at-mouse (ev)
+ "Open file link or URL at mouse.
+See the docstring of `org-open-file' for details."
+ (interactive "e")
+ (mouse-set-point ev)
+ (when (eq major-mode 'org-agenda-mode)
+ (org-agenda-copy-local-variable 'org-link-abbrev-alist-local))
+ (org-open-at-point))
+
+(defvar org-window-config-before-follow-link nil
+ "The window configuration before following a link.
+This is saved in case the need arises to restore it.")
+
+(defun org--file-default-apps ()
+ "Return the default applications for this operating system."
+ (pcase system-type
+ (`darwin org-file-apps-macos)
+ (`windows-nt org-file-apps-windowsnt)
+ (_ org-file-apps-gnu)))
+
+(defun org--file-apps-entry-dlink-p (entry)
+ "Non-nil if ENTRY should be matched against the link by `org-open-file'.
+
+It assumes that is the case when the entry uses a regular
+expression which has at least one grouping construct and the
+action is either a Lisp form or a command string containing
+\"%1\", i.e., using at least one subexpression match as
+a parameter."
+ (pcase entry
+ (`(,selector . ,action)
+ (and (stringp selector)
+ (> (regexp-opt-depth selector) 0)
+ (or (and (stringp action)
+ (string-match "%[0-9]" action))
+ (consp action))))
+ (_ nil)))
+
+(defun org--file-apps-regexp-alist (list &optional add-auto-mode)
+ "Convert extensions to regular expressions in the cars of LIST.
+
+Also, weed out any non-string entries, because the return value
+is used only for regexp matching.
+
+When ADD-AUTO-MODE is non-nil, make all matches in `auto-mode-alist'
+point to the symbol `emacs', indicating that the file should be
+opened in Emacs."
+ (append
+ (delq nil
+ (mapcar (lambda (x)
+ (unless (not (stringp (car x)))
+ (if (string-match "\\W" (car x))
+ x
+ (cons (concat "\\." (car x) "\\'") (cdr x)))))
+ list))
+ (when add-auto-mode
+ (mapcar (lambda (x) (cons (car x) 'emacs)) auto-mode-alist))))
+
+;;;###autoload
+(defun org-open-file (path &optional in-emacs line search)
+ "Open the file at PATH.
+First, this expands any special file name abbreviations. Then the
+configuration variable `org-file-apps' is checked if it contains an
+entry for this file type, and if yes, the corresponding command is launched.
+
+If no application is found, Emacs simply visits the file.
+
+With optional prefix argument IN-EMACS, Emacs will visit the file.
+With a double \\[universal-argument] \\[universal-argument] \
+prefix arg, Org tries to avoid opening in Emacs
+and to use an external application to visit the file.
+
+Optional LINE specifies a line to go to, optional SEARCH a string
+to search for. If LINE or SEARCH is given, the file will be
+opened in Emacs, unless an entry from `org-file-apps' that makes
+use of groups in a regexp matches.
+
+If you want to change the way frames are used when following a
+link, please customize `org-link-frame-setup'.
+
+If the file does not exist, throw an error."
+ (let* ((file (if (equal path "") buffer-file-name
+ (substitute-in-file-name (expand-file-name path))))
+ (file-apps (append org-file-apps (org--file-default-apps)))
+ (apps (cl-remove-if #'org--file-apps-entry-dlink-p file-apps))
+ (apps-dlink (cl-remove-if-not #'org--file-apps-entry-dlink-p
+ file-apps))
+ (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")
+ file))
+ (a-m-a-p (assq 'auto-mode apps))
+ (dfile (downcase file))
+ ;; Reconstruct the original link from the PATH, LINE and
+ ;; SEARCH args.
+ (link (cond (line (concat file "::" (number-to-string line)))
+ (search (concat file "::" search))
+ (t file)))
+ (dlink (downcase link))
+ (ext
+ (and (string-match "\\`.*?\\.\\([a-zA-Z0-9]+\\(\\.gz\\)?\\)\\'" dfile)
+ (match-string 1 dfile)))
+ (save-position-maybe
+ (let ((old-buffer (current-buffer))
+ (old-pos (point))
+ (old-mode major-mode))
+ (lambda ()
+ (and (derived-mode-p 'org-mode)
+ (eq old-mode 'org-mode)
+ (or (not (eq old-buffer (current-buffer)))
+ (not (eq old-pos (point))))
+ (org-mark-ring-push old-pos old-buffer)))))
+ cmd link-match-data)
+ (cond
+ ((member in-emacs '((16) system))
+ (setq cmd (cdr (assq 'system apps))))
+ (in-emacs (setq cmd 'emacs))
+ (t
+ (setq cmd (or (and remp (cdr (assq 'remote apps)))
+ (and dirp (cdr (assq 'directory apps)))
+ ;; First, try matching against apps-dlink if we
+ ;; get a match here, store the match data for
+ ;; later.
+ (let ((match (assoc-default dlink apps-dlink
+ 'string-match)))
+ (if match
+ (progn (setq link-match-data (match-data))
+ match)
+ (progn (setq in-emacs (or in-emacs line search))
+ nil))) ; if we have no match in apps-dlink,
+ ; always open the file in emacs if line or search
+ ; is given (for backwards compatibility)
+ (assoc-default dfile
+ (org--file-apps-regexp-alist apps a-m-a-p)
+ 'string-match)
+ (cdr (assoc ext apps))
+ (cdr (assq t apps))))))
+ (when (eq cmd 'system)
+ (setq cmd (cdr (assq 'system apps))))
+ (when (eq cmd 'default)
+ (setq cmd (cdr (assoc t apps))))
+ (when (eq cmd 'mailcap)
+ (require 'mailcap)
+ (mailcap-parse-mailcaps)
+ (let* ((mime-type (mailcap-extension-to-mime (or ext "")))
+ (command (mailcap-mime-info mime-type)))
+ (if (stringp command)
+ (setq cmd command)
+ (setq cmd 'emacs))))
+ (when (and (not (eq cmd 'emacs)) ; Emacs has no problems with non-ex files
+ (not (file-exists-p file))
+ (not org-open-non-existing-files))
+ (user-error "No such file: %s" file))
+ (cond
+ ((and (stringp cmd) (not (string-match "^\\s-*$" cmd)))
+ ;; Remove quotes around the file name - we'll use shell-quote-argument.
+ (while (string-match "['\"]%s['\"]" cmd)
+ (setq cmd (replace-match "%s" t t cmd)))
+ (setq cmd (replace-regexp-in-string
+ "%s"
+ (shell-quote-argument (convert-standard-filename file))
+ cmd
+ nil t))
+
+ ;; Replace "%1", "%2" etc. in command with group matches from regex
+ (save-match-data
+ (let ((match-index 1)
+ (number-of-groups (- (/ (length link-match-data) 2) 1)))
+ (set-match-data link-match-data)
+ (while (<= match-index number-of-groups)
+ (let ((regex (concat "%" (number-to-string match-index)))
+ (replace-with (match-string match-index dlink)))
+ (while (string-match regex cmd)
+ (setq cmd (replace-match replace-with t t cmd))))
+ (setq match-index (+ match-index 1)))))
+
+ (save-window-excursion
+ (message "Running %s...done" cmd)
+ ;; Handlers such as "gio open" and kde-open5 start viewer in background
+ ;; and exit immediately. Use pipe connection type instead of pty to
+ ;; avoid killing children processes with SIGHUP when temporary terminal
+ ;; session is finished.
+ ;;
+ ;; TODO: Once minimum Emacs version is 25.1 or above, consider using
+ ;; the `make-process' invocation from 5db61eb0f929 to get more helpful
+ ;; error messages.
+ (let ((process-connection-type nil))
+ (start-process-shell-command cmd nil cmd))
+ (and (boundp 'org-wait) (numberp org-wait) (sit-for org-wait))))
+ ((or (stringp cmd)
+ (eq cmd 'emacs))
+ (funcall (cdr (assq 'file org-link-frame-setup)) file)
+ (widen)
+ (cond (line (org-goto-line line)
+ (when (derived-mode-p 'org-mode) (org-reveal)))
+ (search (condition-case err
+ (org-link-search search)
+ ;; Save position before error-ing out so user
+ ;; can easily move back to the original buffer.
+ (error (funcall save-position-maybe)
+ (error (nth 1 err)))))))
+ ((functionp cmd)
+ (save-match-data
+ (set-match-data link-match-data)
+ (condition-case nil
+ (funcall cmd file link)
+ ;; FIXME: Remove this check when most default installations
+ ;; of Emacs have at least Org 9.0.
+ ((debug wrong-number-of-arguments wrong-type-argument
+ invalid-function)
+ (user-error "Please see Org News for version 9.0 about \
+`org-file-apps'--Lisp error: %S" cmd)))))
+ ((consp cmd)
+ ;; FIXME: Remove this check when most default installations of
+ ;; Emacs have at least Org 9.0. Heads-up instead of silently
+ ;; fall back to `org-link-frame-setup' for an old usage of
+ ;; `org-file-apps' with sexp instead of a function for `cmd'.
+ (user-error "Please see Org News for version 9.0 about \
+`org-file-apps'--Error: Deprecated usage of %S" cmd))
+ (t (funcall (cdr (assq 'file org-link-frame-setup)) file)))
+ (funcall save-position-maybe)))
+
+;;;###autoload
+(defun org-open-at-point-global ()
+ "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)
+ (let ((tap-url (thing-at-point 'url))
+ (tap-email (thing-at-point 'email)))
+ (cond ((org-in-regexp org-link-any-re)
+ (org-link-open-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-link-open-from-string tap-url))
+ (tap-email (org-link-open-from-string
+ (concat "mailto:" tap-email)))
+ (t (user-error "No link found")))))
+
+(defvar org-open-at-point-functions nil
+ "Hook that is run when following a link at point.
+
+Functions in this hook must return t if they identify and follow
+a link at point. If they don't find anything interesting at point,
+they must return nil.")
+
+(defun org-open-at-point (&optional arg)
+ "Open link, timestamp, footnote or tags at point.
+
+When point is on a link, follow it. Normally, files will be
+opened by an appropriate application. If the optional prefix
+argument ARG is non-nil, Emacs will visit the file. With
+a double prefix argument, try to open outside of Emacs, in the
+application the system uses for this file type.
+
+When point is on a timestamp, open the agenda at the day
+specified.
+
+When point is a footnote definition, move to the first reference
+found. If it is on a reference, move to the associated
+definition.
+
+When point is on a headline, display a list of every link in the
+entry, so it is possible to pick one, or all, of them. If point
+is on a tag, call `org-tags-view' instead.
+
+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")
+ (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)
+ '(citation citation-reference 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 or a citation.
+ ((memq type '(headline inlinetask))
+ (org-match-line org-complex-heading-regexp)
+ (let ((tags-beg (match-beginning 5))
+ (tags-end (match-end 5)))
+ (if (and tags-beg (>= (point) tags-beg) (< (point) tags-end))
+ ;; On tags.
+ (org-tags-view
+ arg
+ (save-excursion
+ (let* ((beg-tag (or (search-backward ":" tags-beg 'at-limit) (point)))
+ (end-tag (search-forward ":" tags-end nil 2)))
+ (buffer-substring (1+ beg-tag) (1- end-tag)))))
+ ;; Not on tags.
+ (pcase (org-offer-links-in-entry (current-buffer) (point) arg)
+ (`(nil . ,_)
+ (require 'org-attach)
+ (when (org-attach-dir)
+ (message "Opening attachment")
+ (if (equal arg '(4))
+ (org-attach-reveal-in-emacs)
+ (org-attach-reveal))))
+ (`(,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 arg)))))))
+ ;; 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) (org-link-open context arg))
+ ((memq type '(citation citation-reference)) (org-cite-follow context arg))
+ (t (user-error "No link found")))))
+ (run-hook-with-args 'org-follow-link-hook))
+
+;;;###autoload
+(defun org-offer-links-in-entry (buffer marker &optional nth zero)
+ "Offer links in the current entry and return the selected link.
+If there is only one link, return it.
+If NTH is an integer, return the NTH link found.
+If ZERO is a string, check also this string for a link, and if
+there is one, return it."
+ (with-current-buffer buffer
+ (org-with-wide-buffer
+ (goto-char marker)
+ (let ((cnt ?0)
+ have-zero end links link c)
+ (when (and (stringp zero) (string-match org-link-bracket-re zero))
+ (push (match-string 0 zero) links)
+ (setq cnt (1- cnt) have-zero t))
+ (save-excursion
+ (org-back-to-heading t)
+ (setq end (save-excursion (outline-next-heading) (point)))
+ (while (re-search-forward org-link-any-re end t)
+ (push (match-string 0) links))
+ (setq links (org-uniquify (reverse links))))
+ (cond
+ ((null links)
+ (message "No links"))
+ ((equal (length links) 1)
+ (setq link (car links)))
+ ((and (integerp nth) (>= (length links) (if have-zero (1+ nth) nth)))
+ (setq link (nth (if have-zero nth (1- nth)) links)))
+ (t ; we have to select a link
+ (save-excursion
+ (save-window-excursion
+ (delete-other-windows)
+ (with-output-to-temp-buffer "*Select Link*"
+ (dolist (l links)
+ (cond
+ ((not (string-match org-link-bracket-re l))
+ (princ (format "[%c] %s\n" (cl-incf cnt)
+ (org-unbracket-string "<" ">" l))))
+ ((match-end 2)
+ (princ (format "[%c] %s (%s)\n" (cl-incf cnt)
+ (match-string 2 l) (match-string 1 l))))
+ (t (princ (format "[%c] %s\n" (cl-incf cnt)
+ (match-string 1 l)))))))
+ (org-fit-window-to-buffer (get-buffer-window "*Select Link*"))
+ (message "Select link to open, RET to open all:")
+ (setq c (read-char-exclusive))
+ (and (get-buffer "*Select Link*") (kill-buffer "*Select Link*"))))
+ (when (equal c ?q) (user-error "Abort"))
+ (if (equal c ?\C-m)
+ (setq link links)
+ (setq nth (- c ?0))
+ (when have-zero (setq nth (1+ nth)))
+ (unless (and (integerp nth) (>= (length links) nth))
+ (user-error "Invalid link selection"))
+ (setq link (nth (1- nth) links)))))
+ (cons link end)))))
+
+;;; File search
+
+(defun org-do-occur (regexp &optional cleanup)
+ "Call the Emacs command `occur'.
+If CLEANUP is non-nil, remove the printout of the regular expression
+in the *Occur* buffer. This is useful if the regex is long and not useful
+to read."
+ (occur regexp)
+ (when cleanup
+ (let ((cwin (selected-window)) win beg end)
+ (when (setq win (get-buffer-window "*Occur*"))
+ (select-window win))
+ (goto-char (point-min))
+ (when (re-search-forward "match[a-z]+" nil t)
+ (setq beg (match-end 0))
+ (when (re-search-forward "^[ \t]*[0-9]+" nil t)
+ (setq end (1- (match-beginning 0)))))
+ (and beg end (let ((inhibit-read-only t)) (delete-region beg end)))
+ (goto-char (point-min))
+ (select-window cwin))))
+
+
+;;; 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)
+(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 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)
+ (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.
+With prefix arg N, jump back that many stored positions. When
+called several times in succession, walk through the entire ring.
+Org mode commands jumping to a different position in the current file,
+or to another Org file, automatically push the old position onto the ring."
+ (interactive "p")
+ (let (p m)
+ (if (eq last-command this-command)
+ (setq p (nthcdr n (or org-mark-ring-last-goto org-mark-ring)))
+ (setq p org-mark-ring))
+ (setq org-mark-ring-last-goto p)
+ (setq m (car p))
+ (pop-to-buffer-same-window (marker-buffer m))
+ (goto-char m)
+ (when (or (org-invisible-p) (org-invisible-p2)) (org-show-context 'mark-goto))))
+
+;;; Following specific links
+
+(defvar org-agenda-buffer-tmp-name)
+(defvar org-agenda-start-on-weekday)
+(defvar org-agenda-buffer-name)
+(defun org-follow-timestamp-link ()
+ "Open an agenda view for the time-stamp date/range at point."
+ ;; Avoid changing the global value.
+ (let ((org-agenda-buffer-name org-agenda-buffer-name))
+ (cond
+ ((org-at-date-range-p t)
+ (let ((org-agenda-start-on-weekday)
+ (t1 (match-string 1))
+ (t2 (match-string 2)) tt1 tt2)
+ (setq tt1 (time-to-days (org-time-string-to-time t1))
+ tt2 (time-to-days (org-time-string-to-time t2)))
+ (let ((org-agenda-buffer-tmp-name
+ (format "*Org Agenda(a:%s)"
+ (concat (substring t1 0 10) "--" (substring t2 0 10)))))
+ (org-agenda-list nil tt1 (1+ (- tt2 tt1))))))
+ ((org-at-timestamp-p 'lax)
+ (let ((org-agenda-buffer-tmp-name
+ (format "*Org Agenda(a:%s)" (substring (match-string 1) 0 10))))
+ (org-agenda-list nil (time-to-days (org-time-string-to-time
+ (substring (match-string 1) 0 10)))
+ 1)))
+ (t (error "This should not happen")))))
+
+
+;;; Following file links
+(declare-function mailcap-parse-mailcaps "mailcap" (&optional path force))
+(declare-function mailcap-extension-to-mime "mailcap" (extn))
+(declare-function mailcap-mime-info
+ "mailcap" (string &optional request no-decode))
+(defvar org-wait nil)
+
+;;;; Refiling
+
+(defun org-get-org-file ()
+ "Read a filename, with default directory `org-directory'."
+ (let ((default (or org-default-notes-file remember-data-file)))
+ (read-file-name (format "File name [%s]: " default)
+ (file-name-as-directory org-directory)
+ default)))
+
+(defun org-notes-order-reversed-p ()
+ "Check if the current file should receive notes in reversed order."
+ (cond
+ ((not org-reverse-note-order) nil)
+ ((eq t org-reverse-note-order) t)
+ ((not (listp org-reverse-note-order)) nil)
+ (t (catch 'exit
+ (dolist (entry org-reverse-note-order)
+ (when (string-match (car entry) buffer-file-name)
+ (throw 'exit (cdr entry))))))))
+
+(defvar org-agenda-new-buffers nil
+ "Buffers created to visit agenda files.")
+
+(declare-function org-string-nw-p "org-macs" (s))
+;;;; Dynamic blocks
+
+(defun org-find-dblock (name)
+ "Find the first dynamic block with name NAME in the buffer.
+If not found, stay at current position and return nil."
+ (let ((case-fold-search t) pos)
+ (save-excursion
+ (goto-char (point-min))
+ (setq pos (and (re-search-forward
+ (concat "^[ \t]*#\\+\\(?:BEGIN\\|begin\\):[ \t]+" name "\\>") nil t)
+ (match-beginning 0))))
+ (when pos (goto-char pos))
+ pos))
+
+(defun org-create-dblock (plist)
+ "Create a dynamic block section, with parameters taken from PLIST.
+PLIST must contain a :name entry which is used as the name of the block."
+ (when (string-match "\\S-" (buffer-substring (point-at-bol) (point-at-eol)))
+ (end-of-line 1)
+ (newline))
+ (let ((col (current-column))
+ (name (plist-get plist :name)))
+ (insert "#+BEGIN: " name)
+ (while plist
+ (if (eq (car plist) :name)
+ (setq plist (cddr plist))
+ (insert " " (prin1-to-string (pop plist)))))
+ (insert "\n\n" (make-string col ?\ ) "#+END:\n")
+ (beginning-of-line -2)))
+
+(defun org-prepare-dblock ()
+ "Prepare dynamic block for refresh.
+This empties the block, puts the cursor at the insert position and returns
+the property list including an extra property :name with the block name."
+ (unless (looking-at org-dblock-start-re)
+ (user-error "Not at a dynamic block"))
+ (let* ((begdel (1+ (match-end 0)))
+ (name (org-no-properties (match-string 1)))
+ (params (append (list :name name)
+ (read (concat "(" (match-string 3) ")")))))
+ (save-excursion
+ (beginning-of-line 1)
+ (skip-chars-forward " \t")
+ (setq params (plist-put params :indentation-column (current-column))))
+ (unless (re-search-forward org-dblock-end-re nil t)
+ (error "Dynamic block not terminated"))
+ (setq params
+ (append params
+ (list :content (buffer-substring
+ begdel (match-beginning 0)))))
+ (delete-region begdel (match-beginning 0))
+ (goto-char begdel)
+ (open-line 1)
+ params))
+
+(defun org-map-dblocks (&optional command)
+ "Apply COMMAND to all dynamic blocks in the current buffer.
+If COMMAND is not given, use `org-update-dblock'."
+ (let ((cmd (or command 'org-update-dblock)))
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward org-dblock-start-re nil t)
+ (goto-char (match-beginning 0))
+ (save-excursion
+ (condition-case nil
+ (funcall cmd)
+ (error (message "Error during update of dynamic block"))))
+ (unless (re-search-forward org-dblock-end-re nil t)
+ (error "Dynamic block not terminated"))))))
+
+(defvar org-dynamic-block-alist nil
+ "Alist defining all the Org dynamic blocks.
+
+The key is the dynamic block type name, as a string. The value
+is the function used to insert the dynamic block.
+
+Use `org-dynamic-block-define' to populate it.")
+
+(defun org-dynamic-block-function (type)
+ "Return function associated to a given dynamic block type.
+TYPE is the dynamic block type, as a string."
+ (cdr (assoc type org-dynamic-block-alist)))
+
+(defun org-dynamic-block-types ()
+ "List all defined dynamic block types."
+ (mapcar #'car org-dynamic-block-alist))
+
+(defun org-dynamic-block-define (type func)
+ "Define dynamic block TYPE with FUNC.
+TYPE is a string. FUNC is the function creating the dynamic
+block of such type."
+ (pcase (assoc type org-dynamic-block-alist)
+ (`nil (push (cons type func) org-dynamic-block-alist))
+ (def (setcdr def func))))
+
+(defun org-dynamic-block-insert-dblock (type &optional interactive-p)
+ "Insert a dynamic block of type TYPE.
+When used interactively, select the dynamic block types among
+defined types, per `org-dynamic-block-define'. If INTERACTIVE-P
+is non-nil, call the dynamic block function interactively."
+ (interactive (list (completing-read "Dynamic block: "
+ (org-dynamic-block-types))
+ t))
+ (pcase (org-dynamic-block-function type)
+ (`nil (error "No such dynamic block: %S" type))
+ ((and f (pred functionp))
+ (if interactive-p (call-interactively f) (funcall f)))
+ (_ (error "Invalid function for dynamic block %S" type))))
+
+(defun org-dblock-update (&optional arg)
+ "User command for updating dynamic blocks.
+Update the dynamic block at point. With prefix ARG, update all dynamic
+blocks in the buffer."
+ (interactive "P")
+ (if arg
+ (org-update-all-dblocks)
+ (or (looking-at org-dblock-start-re)
+ (org-beginning-of-dblock))
+ (org-update-dblock)))
+
+(defun org-update-dblock ()
+ "Update the dynamic block at point.
+This means to empty the block, parse for parameters and then call
+the correct writing function."
+ (interactive)
+ (save-excursion
+ (let* ((win (selected-window))
+ (pos (point))
+ (line (org-current-line))
+ (params (org-prepare-dblock))
+ (name (plist-get params :name))
+ (indent (plist-get params :indentation-column))
+ (cmd (intern (concat "org-dblock-write:" name))))
+ (message "Updating dynamic block `%s' at line %d..." name line)
+ (funcall cmd params)
+ (message "Updating dynamic block `%s' at line %d...done" name line)
+ (goto-char pos)
+ (when (and indent (> indent 0))
+ (setq indent (make-string indent ?\ ))
+ (save-excursion
+ (select-window win)
+ (org-beginning-of-dblock)
+ (forward-line 1)
+ (while (not (looking-at org-dblock-end-re))
+ (insert indent)
+ (beginning-of-line 2))
+ (when (looking-at org-dblock-end-re)
+ (and (looking-at "[ \t]+")
+ (replace-match ""))
+ (insert indent)))))))
+
+(defun org-beginning-of-dblock ()
+ "Find the beginning of the dynamic block at point.
+Error if there is no such block at point."
+ (let ((pos (point))
+ beg)
+ (end-of-line 1)
+ (if (and (re-search-backward org-dblock-start-re nil t)
+ (setq beg (match-beginning 0))
+ (re-search-forward org-dblock-end-re nil t)
+ (> (match-end 0) pos))
+ (goto-char beg)
+ (goto-char pos)
+ (error "Not in a dynamic block"))))
+
+(defun org-update-all-dblocks ()
+ "Update all dynamic blocks in the buffer.
+This function can be used in a hook."
+ (interactive)
+ (when (derived-mode-p 'org-mode)
+ (org-map-dblocks 'org-update-dblock)))
+
+
+;;;; Completion
+
+(declare-function org-export-backend-options "ox" (cl-x) t)
+(defun org-get-export-keywords ()
+ "Return a list of all currently understood export keywords.
+Export keywords include options, block names, attributes and
+keywords relative to each registered export back-end."
+ (let (keywords)
+ (dolist (backend
+ (bound-and-true-p org-export-registered-backends)
+ (delq nil keywords))
+ ;; Back-end name (for keywords, like #+LATEX:)
+ (push (upcase (symbol-name (org-export-backend-name backend))) keywords)
+ (dolist (option-entry (org-export-backend-options backend))
+ ;; Back-end options.
+ (push (nth 1 option-entry) keywords)))))
+
+(defconst org-options-keywords
+ '("ARCHIVE:" "AUTHOR:" "BIND:" "CATEGORY:" "COLUMNS:" "CREATOR:" "DATE:"
+ "DESCRIPTION:" "DRAWERS:" "EMAIL:" "EXCLUDE_TAGS:" "FILETAGS:" "INCLUDE:"
+ "INDEX:" "KEYWORDS:" "LANGUAGE:" "MACRO:" "OPTIONS:" "PROPERTY:"
+ "PRIORITIES:" "SELECT_TAGS:" "SEQ_TODO:" "SETUPFILE:" "STARTUP:" "TAGS:"
+ "TITLE:" "TODO:" "TYP_TODO:" "SELECT_TAGS:" "EXCLUDE_TAGS:"))
+
+(defcustom org-structure-template-alist
+ '(("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 \"<KEY\"."
+ :group 'org-edit-structure
+ :type '(repeat
+ (cons (string :tag "Key")
+ (string :tag "Template")))
+ :package-version '(Org . "9.2"))
+
+(defun org--check-org-structure-template-alist (&optional checklist)
+ "Check whether `org-structure-template-alist' is set up correctly.
+In particular, check if the Org 9.2 format is used as opposed to
+previous format."
+ (let ((elm (cl-remove-if-not (lambda (x) (listp (cdr x)))
+ (or (eval checklist)
+ org-structure-template-alist))))
+ (when elm
+ (org-display-warning
+ (format "
+Please update the entries of `%s'.
+
+In Org 9.2 the format was changed from something like
+
+ (\"s\" \"#+BEGIN_SRC ?\\n#+END_SRC\")
+
+to something like
+
+ (\"s\" . \"src\")
+
+Please refer to the documentation of `org-structure-template-alist'.
+
+The following entries must be updated:
+
+%s"
+ (or checklist 'org-structure-template-alist)
+ (pp-to-string elm))))))
+
+(defun org--insert-structure-template-mks ()
+ "Present `org-structure-template-alist' with `org-mks'.
+
+Menus are added if keys require more than one keystroke. Tabs
+are added to single key entries when more than one stroke is
+needed. Keys longer than two characters are reduced to two
+characters."
+ (org--check-org-structure-template-alist)
+ (let* (case-fold-search
+ (templates (append org-structure-template-alist
+ '(("\t" . "Press TAB, RET or SPC to write block name"))))
+ (keys (mapcar #'car templates))
+ (start-letters
+ (delete-dups (mapcar (lambda (key) (substring key 0 1)) keys)))
+ ;; Sort each element of `org-structure-template-alist' into
+ ;; sublists according to the first letter.
+ (superlist
+ (mapcar (lambda (letter)
+ (list letter
+ (cl-remove-if-not
+ (apply-partially #'string-match-p (concat "^" letter))
+ templates :key #'car)))
+ start-letters)))
+ (org-mks
+ (apply #'append
+ ;; Make an `org-mks' table. If only one element is
+ ;; present in a sublist, make it part of the top-menu,
+ ;; otherwise make a submenu according to the starting
+ ;; letter and populate it.
+ (mapcar (lambda (sublist)
+ (if (eq 1 (length (cadr sublist)))
+ (mapcar (lambda (elm)
+ (list (substring (car elm) 0 1)
+ (cdr elm) ""))
+ (cadr sublist))
+ ;; Create submenu.
+ (let* ((topkey (car sublist))
+ (elms (cadr sublist))
+ (keys (mapcar #'car elms))
+ (long (> (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 ((ordered-keys (cl-sort (copy-sequence keys) #'< :key #'length))
+ menu-keys)
+ (dolist (key ordered-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")))))
+
+
+;;;; TODO, DEADLINE, Comments
+
+(defun org-toggle-comment ()
+ "Change the COMMENT state of an entry."
+ (interactive)
+ (save-excursion
+ (org-back-to-heading)
+ (let ((case-fold-search nil))
+ (looking-at org-complex-heading-regexp))
+ (goto-char (or (match-end 3) (match-end 2) (match-end 1)))
+ (skip-chars-forward " \t")
+ (unless (memq (char-before) '(?\s ?\t)) (insert " "))
+ (if (org-in-commented-heading-p t)
+ (delete-region (point)
+ (progn (search-forward " " (line-end-position) 'move)
+ (skip-chars-forward " \t")
+ (point)))
+ (insert org-comment-string)
+ (unless (eolp) (insert " ")))))
+
+(defvar org-last-todo-state-is-todo nil
+ "This is non-nil when the last TODO state change led to a TODO state.
+If the last change removed the TODO tag or switched to DONE, then
+this is nil.")
+
+(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
+transformed into canonical form." )
+
+(defvar org-todo-get-default-hook nil
+ "Hook for functions that get a default item for todo.
+Each function takes arguments (NEW-MARK OLD-MARK) and returns either
+nil or a string to be used for the todo mark." )
+
+(defvar org-agenda-headline-snapshot-before-repeat)
+
+(defun org-current-effective-time ()
+ "Return current time adjusted for `org-extend-today-until' variable."
+ (let* ((ct (org-current-time))
+ (dct (decode-time ct))
+ (ct1
+ (cond
+ (org-use-last-clock-out-time-as-effective-time
+ (or (org-clock-get-last-clock-out-time) ct))
+ ((and org-use-effective-time (< (nth 2 dct) org-extend-today-until))
+ (encode-time 0 59 23 (1- (nth 3 dct)) (nth 4 dct) (nth 5 dct)))
+ (t ct))))
+ ct1))
+
+(defun org-todo-yesterday (&optional arg)
+ "Like `org-todo' but the time of change will be 23:59 of yesterday."
+ (interactive "P")
+ (if (eq major-mode 'org-agenda-mode)
+ (apply 'org-agenda-todo-yesterday arg)
+ (let* ((org-use-effective-time t)
+ (hour (nth 2 (decode-time (org-current-time))))
+ (org-extend-today-until (1+ hour)))
+ (org-todo arg))))
+
+(defvar org-block-entry-blocking ""
+ "First entry preventing the TODO state change.")
+
+(defun org-cancel-repeater ()
+ "Cancel a repeater by setting its numeric value to zero."
+ (interactive)
+ (save-excursion
+ (org-back-to-heading t)
+ (let ((bound1 (point))
+ (bound0 (save-excursion (outline-next-heading) (point))))
+ (when (and (re-search-forward
+ (concat "\\(" org-scheduled-time-regexp "\\)\\|\\("
+ org-deadline-time-regexp "\\)\\|\\("
+ org-ts-regexp "\\)")
+ bound0 t)
+ (re-search-backward "[ \t]+\\(?:[.+]\\)?\\+\\([0-9]+\\)[hdwmy]"
+ bound1 t))
+ (replace-match "0" t nil nil 1)))))
+
+(defvar org-state)
+(defvar org-blocked-by-checkboxes)
+(defun org-todo (&optional arg)
+ "Change the TODO state of an item.
+
+The state of an item is given by a keyword at the start of the heading,
+like
+ *** TODO Write paper
+ *** DONE Call mom
+
+The different keywords are specified in the variable `org-todo-keywords'.
+By default the available states are \"TODO\" and \"DONE\". So, for this
+example: when the item starts with TODO, it is changed to DONE.
+When it starts with DONE, the DONE is removed. And when neither TODO nor
+DONE are present, add TODO at the beginning of the heading.
+You can set up single-character keys to fast-select the new state. See the
+`org-todo-keywords' and `org-use-fast-todo-selection' for details.
+
+With `\\[universal-argument]' prefix ARG, force logging the state change \
+and take a
+logging note.
+With a `\\[universal-argument] \\[universal-argument]' prefix, switch to the \
+next set of TODO \
+keywords (nextset).
+Another way to achieve this is `S-C-<right>'.
+With a `\\[universal-argument] \\[universal-argument] \\[universal-argument]' \
+prefix, circumvent any state blocking.
+With numeric prefix arg, switch to the Nth state.
+
+With a numeric prefix arg of 0, inhibit note taking for the change.
+With a numeric prefix arg of -1, cancel repeater to allow marking as DONE.
+
+When called through ELisp, arg is also interpreted in the following way:
+`none' -> empty state
+\"\" -> switch to empty state
+`done' -> switch to DONE
+`nextset' -> switch to the next set of keywords
+`previousset' -> switch to the previous set of keywords
+\"WAITING\" -> switch to the specified keyword, but only if it
+ really is a member of `org-todo-keywords'."
+ (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
+ (lambda () (org-todo arg))
+ nil cl
+ (when (org-invisible-p) (org-end-of-subtree nil t))))
+ (when (equal arg '(16)) (setq arg 'nextset))
+ (when (equal arg -1) (org-cancel-repeater) (setq arg nil))
+ (let ((org-blocker-hook org-blocker-hook)
+ commentp
+ case-fold-search)
+ (when (equal arg '(64))
+ (setq arg nil org-blocker-hook nil))
+ (when (and org-blocker-hook
+ (or org-inhibit-blocking
+ (org-entry-get nil "NOBLOCKING")))
+ (setq org-blocker-hook nil))
+ (save-excursion
+ (catch 'exit
+ (org-back-to-heading t)
+ (when (org-in-commented-heading-p t)
+ (org-toggle-comment)
+ (setq commentp t))
+ (when (looking-at org-outline-regexp) (goto-char (1- (match-end 0))))
+ (or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ \t]*$\\)"))
+ (looking-at "\\(?: *\\|[ \t]*$\\)"))
+ (let* ((match-data (match-data))
+ (startpos (copy-marker (line-beginning-position)))
+ (force-log (and (equal arg '(4)) (prog1 t (setq arg nil))))
+ (logging (save-match-data (org-entry-get nil "LOGGING" t t)))
+ (org-log-done org-log-done)
+ (org-log-repeat org-log-repeat)
+ (org-todo-log-states org-todo-log-states)
+ (org-inhibit-logging
+ (if (equal arg 0)
+ (progn (setq arg nil) 'note) org-inhibit-logging))
+ (this (match-string 1))
+ (hl-pos (match-beginning 0))
+ (head (org-get-todo-sequence-head this))
+ (ass (assoc head org-todo-kwd-alist))
+ (interpret (nth 1 ass))
+ (done-word (nth 3 ass))
+ (final-done-word (nth 4 ass))
+ (org-last-state (or this ""))
+ (completion-ignore-case t)
+ (member (member this org-todo-keywords-1))
+ (tail (cdr member))
+ (org-state (cond
+ ((eq arg 'right)
+ ;; Next state
+ (if this
+ (if tail (car tail) nil)
+ (car org-todo-keywords-1)))
+ ((eq arg 'left)
+ ;; Previous state
+ (unless (equal member org-todo-keywords-1)
+ (if this
+ (nth (- (length org-todo-keywords-1)
+ (length tail) 2)
+ org-todo-keywords-1)
+ (org-last org-todo-keywords-1))))
+ (arg
+ ;; User or caller requests a specific state.
+ (cond
+ ((equal arg "") nil)
+ ((eq arg 'none) nil)
+ ((eq arg 'done) (or done-word (car org-done-keywords)))
+ ((eq arg 'nextset)
+ (or (car (cdr (member head org-todo-heads)))
+ (car org-todo-heads)))
+ ((eq arg 'previousset)
+ (let ((org-todo-heads (reverse org-todo-heads)))
+ (or (car (cdr (member head org-todo-heads)))
+ (car org-todo-heads))))
+ ((car (member arg org-todo-keywords-1)))
+ ((stringp arg)
+ (user-error "State `%s' not valid in this file" arg))
+ ((nth (1- (prefix-numeric-value arg))
+ org-todo-keywords-1))))
+ ((and org-todo-key-trigger org-use-fast-todo-selection)
+ ;; Use fast selection.
+ (org-fast-todo-selection this))
+ ((null member) (or head (car org-todo-keywords-1)))
+ ((equal this final-done-word) nil) ;-> make empty
+ ((null tail) nil) ;-> first entry
+ ((memq interpret '(type priority))
+ (if (eq this-command last-command)
+ (car tail)
+ (if (> (length tail) 0)
+ (or done-word (car org-done-keywords))
+ nil)))
+ (t
+ (car tail))))
+ (org-state (or
+ (run-hook-with-args-until-success
+ 'org-todo-get-default-hook org-state org-last-state)
+ 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)
+ (when org-blocker-hook
+ (let (org-blocked-by-checkboxes block-reason)
+ (setq org-last-todo-state-is-todo
+ (not (member this org-done-keywords)))
+ (unless (save-excursion
+ (save-match-data
+ (org-with-wide-buffer
+ (run-hook-with-args-until-failure
+ 'org-blocker-hook change-plist))))
+ (setq block-reason (if org-blocked-by-checkboxes
+ "contained checkboxes"
+ (format "\"%s\"" org-block-entry-blocking)))
+ (if (called-interactively-p 'interactive)
+ (user-error "TODO state change from %s to %s blocked (by %s)"
+ this org-state block-reason)
+ ;; Fail silently.
+ (message "TODO state change from %s to %s blocked (by %s)"
+ this org-state block-reason)
+ (throw 'exit nil)))))
+ (store-match-data match-data)
+ (replace-match next t t)
+ (cond ((and org-state (equal this org-state))
+ (message "TODO state was already %s" (org-trim next)))
+ ((not (pos-visible-in-window-p hl-pos))
+ (message "TODO state changed to %s" (org-trim next))))
+ (unless head
+ (setq head (org-get-todo-sequence-head org-state)
+ ass (assoc head org-todo-kwd-alist)
+ interpret (nth 1 ass)
+ done-word (nth 3 ass)
+ final-done-word (nth 4 ass)))
+ (when (memq arg '(nextset previousset))
+ (message "Keyword-Set %d/%d: %s"
+ (- (length org-todo-sets) -1
+ (length (memq (assoc org-state org-todo-sets) org-todo-sets)))
+ (length org-todo-sets)
+ (mapconcat 'identity (assoc org-state org-todo-sets) " ")))
+ (setq org-last-todo-state-is-todo
+ (not (member org-state org-done-keywords)))
+ (setq now-done-p (and (member org-state org-done-keywords)
+ (not (member this org-done-keywords))))
+ (and logging (org-local-logging logging))
+ (when (or (and (or org-todo-log-states org-log-done)
+ (not (eq org-inhibit-logging t))
+ (not (memq arg '(nextset previousset))))
+ force-log)
+ ;; We need to look at recording a time and note.
+ (setq dolog (or (if force-log 'note)
+ (nth 1 (assoc org-state org-todo-log-states))
+ (nth 2 (assoc this org-todo-log-states))))
+ (when (and (eq dolog 'note) (eq org-inhibit-logging 'note))
+ (setq dolog 'time))
+ (when (or (and (not org-state) (not org-closed-keep-when-no-todo))
+ (and org-state
+ (member org-state org-not-done-keywords)
+ (not (member this org-not-done-keywords))))
+ ;; This is now a todo state and was not one before
+ ;; If there was a CLOSED time stamp, get rid of it.
+ (org-add-planning-info nil nil 'closed))
+ (when (and now-done-p org-log-done)
+ ;; It is now done, and it was not done before.
+ (org-add-planning-info 'closed (org-current-effective-time))
+ (when (and (not dolog) (eq 'note org-log-done))
+ (org-add-log-setup 'done org-state this 'note)))
+ (when (and org-state dolog)
+ ;; This is a non-nil state, and we need to log it.
+ (org-add-log-setup 'state org-state this dolog)))
+ ;; Fixup tag positioning.
+ (org-todo-trigger-tag-changes org-state)
+ (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)))
+ (put-text-property (point-at-bol) (point-at-eol) 'org-todo-head head)
+ ;; Do we need to trigger a repeat?
+ (when now-done-p
+ (when (boundp 'org-agenda-headline-snapshot-before-repeat)
+ ;; This is for the agenda, take a snapshot of the headline.
+ (save-match-data
+ (setq org-agenda-headline-snapshot-before-repeat
+ (org-get-heading))))
+ (org-auto-repeat-maybe org-state))
+ ;; Fixup cursor location if close to the keyword.
+ (when (and (outline-on-heading-p)
+ (not (bolp))
+ (save-excursion (beginning-of-line 1)
+ (looking-at org-todo-line-regexp))
+ (< (point) (+ 2 (or (match-end 2) (match-end 1)))))
+ (goto-char (or (match-end 2) (match-end 1)))
+ (and (looking-at " ")
+ (not (looking-at " *:"))
+ (just-one-space)))
+ (when org-trigger-hook
+ (save-excursion
+ (run-hook-with-args 'org-trigger-hook change-plist)))
+ (when commentp (org-toggle-comment))))))))
+
+(defun org-block-todo-from-children-or-siblings-or-parent (change-plist)
+ "Block turning an entry into a TODO, using the hierarchy.
+This checks whether the current task should be blocked from state
+changes. Such blocking occurs when:
+
+ 1. The task has children which are not all in a completed state.
+
+ 2. A task has a parent with the property :ORDERED:, and there
+ are siblings prior to the current task with incomplete
+ status.
+
+ 3. The parent of the task is blocked because it has siblings that should
+ be done first, or is child of a block grandparent TODO entry."
+
+ (if (not org-enforce-todo-dependencies)
+ t ; if locally turned off don't block
+ (catch 'dont-block
+ ;; If this is not a todo state change, or if this entry is already DONE,
+ ;; do not block
+ (when (or (not (eq (plist-get change-plist :type) 'todo-state-change))
+ (member (plist-get change-plist :from)
+ (cons 'done org-done-keywords))
+ (member (plist-get change-plist :to)
+ (cons 'todo org-not-done-keywords))
+ (not (plist-get change-plist :to)))
+ (throw 'dont-block t))
+ ;; If this task has children, and any are undone, it's blocked
+ (save-excursion
+ (org-back-to-heading t)
+ (let ((this-level (funcall outline-level)))
+ (outline-next-heading)
+ (let ((child-level (funcall outline-level)))
+ (while (and (not (eobp))
+ (> child-level this-level))
+ ;; this todo has children, check whether they are all
+ ;; completed
+ (when (and (not (org-entry-is-done-p))
+ (org-entry-is-todo-p))
+ (setq org-block-entry-blocking (org-get-heading))
+ (throw 'dont-block nil))
+ (outline-next-heading)
+ (setq child-level (funcall outline-level))))))
+ ;; Otherwise, if the task's parent has the :ORDERED: property, and
+ ;; any previous siblings are undone, it's blocked
+ (save-excursion
+ (org-back-to-heading t)
+ (let* ((pos (point))
+ (parent-pos (and (org-up-heading-safe) (point)))
+ (case-fold-search nil))
+ (unless parent-pos (throw 'dont-block t)) ; no parent
+ (when (and (org-not-nil (org-entry-get (point) "ORDERED"))
+ (forward-line 1)
+ (re-search-forward org-not-done-heading-regexp pos t))
+ (setq org-block-entry-blocking (match-string 0))
+ (throw 'dont-block nil)) ; block, there is an older sibling not done.
+ ;; Search further up the hierarchy, to see if an ancestor is blocked
+ (while t
+ (goto-char parent-pos)
+ (unless (looking-at org-not-done-heading-regexp)
+ (throw 'dont-block t)) ; do not block, parent is not a TODO
+ (setq pos (point))
+ (setq parent-pos (and (org-up-heading-safe) (point)))
+ (unless parent-pos (throw 'dont-block t)) ; no parent
+ (when (and (org-not-nil (org-entry-get (point) "ORDERED"))
+ (forward-line 1)
+ (re-search-forward org-not-done-heading-regexp pos t)
+ (setq org-block-entry-blocking (org-get-heading)))
+ (throw 'dont-block nil)))))))) ; block, older sibling not done.
+
+(defcustom org-track-ordered-property-with-tag nil
+ "Should the ORDERED property also be shown as a tag?
+The ORDERED property decides if an entry should require subtasks to be
+completed in sequence. Since a property is not very visible, setting
+this option means that toggling the ORDERED property with the command
+`org-toggle-ordered-property' will also toggle a tag ORDERED. That tag is
+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
+string to select a different tag for this task."
+ :group 'org-todo
+ :type '(choice
+ (const :tag "No tracking" nil)
+ (const :tag "Track with ORDERED tag" t)
+ (string :tag "Use other tag")))
+
+(defun org-toggle-ordered-property ()
+ "Toggle the ORDERED property of the current entry.
+For better visibility, you can track the value of this property with a tag.
+See variable `org-track-ordered-property-with-tag'."
+ (interactive)
+ (let* ((t1 org-track-ordered-property-with-tag)
+ (tag (and t1 (if (stringp t1) t1 "ORDERED"))))
+ (save-excursion
+ (org-back-to-heading)
+ (if (org-entry-get nil "ORDERED")
+ (progn
+ (org-delete-property "ORDERED")
+ (and tag (org-toggle-tag tag 'off))
+ (message "Subtasks can be completed in arbitrary order"))
+ (org-entry-put nil "ORDERED" "t")
+ (and tag (org-toggle-tag tag 'on))
+ (message "Subtasks must be completed in sequence")))))
+
+(defun org-block-todo-from-checkboxes (change-plist)
+ "Block turning an entry into a TODO, using checkboxes.
+This checks whether the current task should be blocked from state
+changes because there are unchecked boxes in this entry."
+ (if (not org-enforce-todo-checkbox-dependencies)
+ t ; if locally turned off don't block
+ (catch 'dont-block
+ ;; If this is not a todo state change, or if this entry is already DONE,
+ ;; do not block
+ (when (or (not (eq (plist-get change-plist :type) 'todo-state-change))
+ (member (plist-get change-plist :from)
+ (cons 'done org-done-keywords))
+ (member (plist-get change-plist :to)
+ (cons 'todo org-not-done-keywords))
+ (not (plist-get change-plist :to)))
+ (throw 'dont-block t))
+ ;; If this task has checkboxes that are not checked, it's blocked
+ (save-excursion
+ (org-back-to-heading t)
+ (let ((beg (point)) end)
+ (outline-next-heading)
+ (setq end (point))
+ (goto-char beg)
+ (when (org-list-search-forward
+ (concat (org-item-beginning-re)
+ "\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\][ \t]*\\)?"
+ "\\[[- ]\\]")
+ end t)
+ (when (boundp 'org-blocked-by-checkboxes)
+ (setq org-blocked-by-checkboxes t))
+ (throw 'dont-block nil))))
+ t))) ; do not block
+
+(defun org-entry-blocked-p ()
+ "Non-nil if entry at point is blocked."
+ (and (not (org-entry-get nil "NOBLOCKING"))
+ (member (org-entry-get nil "TODO") org-not-done-keywords)
+ (not (run-hook-with-args-until-failure
+ 'org-blocker-hook
+ (list :type 'todo-state-change
+ :position (point)
+ :from 'todo
+ :to 'done)))))
+
+(defun org-update-statistics-cookies (all)
+ "Update the statistics cookie, either from TODO or from checkboxes.
+This should be called with the cursor in a line with a statistics
+cookie. When called with a \\[universal-argument] prefix, update
+all statistics cookies in the buffer."
+ (interactive "P")
+ (if all
+ (progn
+ (org-update-checkbox-count 'all)
+ (org-map-region 'org-update-parent-todo-statistics
+ (point-min) (point-max)))
+ (if (not (org-at-heading-p))
+ (org-update-checkbox-count)
+ (let ((pos (point-marker))
+ end l1 l2)
+ (ignore-errors (org-back-to-heading t))
+ (if (not (org-at-heading-p))
+ (org-update-checkbox-count)
+ (setq l1 (org-outline-level))
+ (setq end
+ (save-excursion
+ (outline-next-heading)
+ (when (org-at-heading-p) (setq l2 (org-outline-level)))
+ (point)))
+ (if (and (save-excursion
+ (re-search-forward
+ "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) \\[[- X]\\]" end t))
+ (not (save-excursion
+ (re-search-forward
+ ":COOKIE_DATA:.*\\<todo\\>" end t))))
+ (org-update-checkbox-count)
+ (if (and l2 (> l2 l1))
+ (progn
+ (goto-char end)
+ (org-update-parent-todo-statistics))
+ (goto-char pos)
+ (beginning-of-line 1)
+ (while (re-search-forward
+ "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)"
+ (point-at-eol) t)
+ (replace-match (if (match-end 2) "[100%]" "[0/0]") t t)))))
+ (goto-char pos)
+ (move-marker pos nil)))))
+
+(defvar org-entry-property-inherited-from) ;; defined below
+(defun org-update-parent-todo-statistics ()
+ "Update any statistics cookie in the parent of the current headline.
+When `org-hierarchical-todo-statistics' is nil, statistics will cover
+the entire subtree and this will travel up the hierarchy and update
+statistics everywhere."
+ (let* ((prop (save-excursion
+ (org-up-heading-safe)
+ (org-entry-get nil "COOKIE_DATA" 'inherit)))
+ (recursive (or (not org-hierarchical-todo-statistics)
+ (and prop (string-match "\\<recursive\\>" prop))))
+ (lim (or (and prop (marker-position org-entry-property-inherited-from))
+ 0))
+ (first t)
+ (box-re "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)")
+ level ltoggle l1 new ndel
+ (cnt-all 0) (cnt-done 0) is-percent kwd
+ checkbox-beg cookie-present)
+ (catch 'exit
+ (save-excursion
+ (beginning-of-line 1)
+ (setq ltoggle (funcall outline-level))
+ ;; Three situations are to consider:
+
+ ;; 1. if `org-hierarchical-todo-statistics' is nil, repeat up
+ ;; to the top-level ancestor on the headline;
+
+ ;; 2. If parent has "recursive" property, repeat up to the
+ ;; headline setting that property, taking inheritance into
+ ;; account;
+
+ ;; 3. Else, move up to direct parent and proceed only once.
+ (while (and (setq level (org-up-heading-safe))
+ (or recursive first)
+ (>= (point) lim))
+ (setq first nil cookie-present nil)
+ (unless (and level
+ (not (string-match
+ "\\<checkbox\\>"
+ (downcase (or (org-entry-get nil "COOKIE_DATA")
+ "")))))
+ (throw 'exit nil))
+ (while (re-search-forward box-re (point-at-eol) t)
+ (setq cnt-all 0 cnt-done 0 cookie-present t)
+ (setq is-percent (match-end 2) checkbox-beg (match-beginning 0))
+ (save-match-data
+ (unless (outline-next-heading) (throw 'exit nil))
+ (while (and (looking-at org-complex-heading-regexp)
+ (> (setq l1 (length (match-string 1))) level))
+ (setq kwd (and (or recursive (= l1 ltoggle))
+ (match-string 2)))
+ (if (or (eq org-provide-todo-statistics 'all-headlines)
+ (and (eq org-provide-todo-statistics t)
+ (or (member kwd org-done-keywords)))
+ (and (listp org-provide-todo-statistics)
+ (stringp (car org-provide-todo-statistics))
+ (or (member kwd org-provide-todo-statistics)
+ (member kwd org-done-keywords)))
+ (and (listp org-provide-todo-statistics)
+ (listp (car org-provide-todo-statistics))
+ (or (member kwd (car org-provide-todo-statistics))
+ (and (member kwd org-done-keywords)
+ (member kwd (cadr org-provide-todo-statistics))))))
+ (setq cnt-all (1+ cnt-all))
+ (and (eq org-provide-todo-statistics t)
+ kwd
+ (setq cnt-all (1+ cnt-all))))
+ (when (or (and (member org-provide-todo-statistics '(t all-headlines))
+ (member kwd org-done-keywords))
+ (and (listp org-provide-todo-statistics)
+ (listp (car org-provide-todo-statistics))
+ (member kwd org-done-keywords)
+ (member kwd (cadr org-provide-todo-statistics)))
+ (and (listp org-provide-todo-statistics)
+ (stringp (car org-provide-todo-statistics))
+ (member kwd org-done-keywords)))
+ (setq cnt-done (1+ cnt-done)))
+ (outline-next-heading)))
+ (setq new
+ (if is-percent
+ (format "[%d%%]" (floor (* 100.0 cnt-done)
+ (max 1 cnt-all)))
+ (format "[%d/%d]" cnt-done cnt-all))
+ ndel (- (match-end 0) checkbox-beg))
+ (goto-char checkbox-beg)
+ (insert new)
+ (delete-region (point) (+ (point) ndel))
+ (when org-auto-align-tags (org-fix-tags-on-the-fly)))
+ (when cookie-present
+ (run-hook-with-args 'org-after-todo-statistics-hook
+ cnt-done (- cnt-all cnt-done))))))
+ (run-hooks 'org-todo-statistics-hook)))
+
+(defvar org-after-todo-statistics-hook nil
+ "Hook that is called after a TODO statistics cookie has been updated.
+Each function is called with two arguments: the number of not-done entries
+and the number of done entries.
+
+For example, the following function, when added to this hook, will switch
+an entry to DONE when all children are done, and back to TODO when new
+entries are set to a TODO status. Note that this hook is only called
+when there is a statistics cookie in the headline!
+
+ (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\"))))")
+
+(defvar org-todo-statistics-hook nil
+ "Hook that is run whenever Org thinks TODO statistics should be updated.
+This hook runs even if there is no statistics cookie present, in which case
+`org-after-todo-statistics-hook' would not run.")
+
+(defun org-todo-trigger-tag-changes (state)
+ "Apply the changes defined in `org-todo-state-tags-triggers'."
+ (let ((l org-todo-state-tags-triggers)
+ changes)
+ (when (or (not state) (equal state ""))
+ (setq changes (append changes (cdr (assoc "" l)))))
+ (when (and (stringp state) (> (length state) 0))
+ (setq changes (append changes (cdr (assoc state l)))))
+ (when (member state org-not-done-keywords)
+ (setq changes (append changes (cdr (assq 'todo l)))))
+ (when (member state org-done-keywords)
+ (setq changes (append changes (cdr (assq 'done l)))))
+ (dolist (c changes)
+ (org-toggle-tag (car c) (if (cdr c) 'on 'off)))))
+
+(defun org-local-logging (value)
+ "Get logging settings from a property VALUE."
+ ;; Directly set the variables, they are already local.
+ (setq org-log-done nil
+ org-log-repeat nil
+ org-todo-log-states nil)
+ (dolist (w (split-string value))
+ (let (a)
+ (cond
+ ((setq a (assoc w org-startup-options))
+ (and (member (nth 1 a) '(org-log-done org-log-repeat))
+ (set (nth 1 a) (nth 2 a))))
+ ((setq a (org-extract-log-state-settings w))
+ (and (member (car a) org-todo-keywords-1)
+ (push a org-todo-log-states)))))))
+
+(defun org-get-todo-sequence-head (kwd)
+ "Return the head of the TODO sequence to which KWD belongs.
+If KWD is not set, check if there is a text property remembering the
+right sequence."
+ (let (p)
+ (cond
+ ((not kwd)
+ (or (get-text-property (point-at-bol) 'org-todo-head)
+ (progn
+ (setq p (next-single-property-change (point-at-bol) 'org-todo-head
+ nil (point-at-eol)))
+ (get-text-property p 'org-todo-head))))
+ ((not (member kwd org-todo-keywords-1))
+ (car org-todo-keywords-1))
+ (t (nth 2 (assoc kwd org-todo-kwd-alist))))))
+
+(defun org-fast-todo-selection (&optional current-state)
+ "Fast TODO keyword selection with single keys.
+Returns the new TODO keyword, or nil if no state change should occur.
+When CURRENT-STATE is given and selection letters are not unique globally,
+prefer a state in the current sequence over on in another sequence."
+ (let* ((fulltable org-todo-key-alist)
+ (head (org-get-todo-sequence-head current-state))
+ (done-keywords org-done-keywords) ;; needed for the faces.
+ (maxlen (apply 'max (mapcar
+ (lambda (x)
+ (if (stringp (car x)) (string-width (car x)) 0))
+ fulltable)))
+ (expert (equal org-use-fast-todo-selection 'expert))
+ (prompt "")
+ (fwidth (+ maxlen 3 1 3))
+ (ncol (/ (- (window-width) 4) fwidth))
+ tg cnt e c tbl subtable
+ groups ingroup in-current-sequence)
+ (save-excursion
+ (save-window-excursion
+ (if expert
+ (set-buffer (get-buffer-create " *Org todo*"))
+ (delete-other-windows)
+ (set-window-buffer (split-window-vertically) (get-buffer-create " *Org todo*"))
+ (org-switch-to-buffer-other-window " *Org todo*"))
+ (erase-buffer)
+ (setq-local org-done-keywords done-keywords)
+ (setq tbl fulltable cnt 0)
+ (while (setq e (pop tbl))
+ (cond
+ ((equal e '(:startgroup))
+ (push '() groups) (setq ingroup t)
+ (unless (= cnt 0)
+ (setq cnt 0)
+ (insert "\n"))
+ (setq prompt (concat prompt "{"))
+ (insert "{ "))
+ ((equal e '(:endgroup))
+ (setq ingroup nil cnt 0 in-current-sequence nil)
+ (setq prompt (concat prompt "}"))
+ (insert "}\n"))
+ ((equal e '(:newline))
+ (unless (= cnt 0)
+ (setq cnt 0)
+ (insert "\n")
+ (setq e (car tbl))
+ (while (equal (car tbl) '(:newline))
+ (insert "\n")
+ (setq tbl (cdr tbl)))))
+ (t
+ (setq tg (car e) c (cdr e))
+ (if (equal tg head) (setq in-current-sequence t))
+ (when ingroup (push tg (car groups)))
+ (when in-current-sequence (push e subtable))
+ (setq tg (org-add-props tg nil 'face
+ (org-get-todo-face tg)))
+ (when (and (= cnt 0) (not ingroup)) (insert " "))
+ (setq prompt (concat prompt "[" (char-to-string c) "] " tg " "))
+ (insert "[" c "] " tg (make-string
+ (- fwidth 4 (length tg)) ?\ ))
+ (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)))))
+ (insert "\n")
+ (goto-char (point-min))
+ (unless expert (org-fit-window-to-buffer))
+ (message (concat "[a-z..]:Set [SPC]:clear"
+ (if expert (concat "\n" prompt) "")))
+ (setq c (let ((inhibit-quit t)) (read-char-exclusive)))
+ (setq subtable (nreverse subtable))
+ (cond
+ ((or (= c ?\C-g)
+ (and (= c ?q) (not (rassoc c fulltable))))
+ (setq quit-flag t))
+ ((= c ?\ ) nil)
+ ((setq e (or (rassoc c subtable) (rassoc c fulltable))
+ tg (car e))
+ tg)
+ (t (setq quit-flag t)))))))
+
+(defun org-entry-is-todo-p ()
+ (member (org-get-todo-state) org-not-done-keywords))
+
+(defun org-entry-is-done-p ()
+ (member (org-get-todo-state) org-done-keywords))
+
+(defun org-get-todo-state ()
+ "Return the TODO keyword of the current subtree."
+ (save-excursion
+ (org-back-to-heading t)
+ (and (let ((case-fold-search nil))
+ (looking-at org-todo-line-regexp))
+ (match-end 2)
+ (match-string 2))))
+
+(defun org-at-date-range-p (&optional inactive-ok)
+ "Non-nil if point is inside a date range.
+
+When optional argument INACTIVE-OK is non-nil, also consider
+inactive time ranges.
+
+When this function returns a non-nil value, match data is set
+according to `org-tr-regexp-both' or `org-tr-regexp', depending
+on INACTIVE-OK."
+ (interactive)
+ (save-excursion
+ (catch 'exit
+ (let ((pos (point)))
+ (skip-chars-backward "^[<\r\n")
+ (skip-chars-backward "<[")
+ (and (looking-at (if inactive-ok org-tr-regexp-both org-tr-regexp))
+ (>= (match-end 0) pos)
+ (throw 'exit t))
+ (skip-chars-backward "^<[\r\n")
+ (skip-chars-backward "<[")
+ (and (looking-at (if inactive-ok org-tr-regexp-both org-tr-regexp))
+ (>= (match-end 0) pos)
+ (throw 'exit t)))
+ nil)))
+
+(defun org-get-repeat (&optional timestamp)
+ "Check if there is a time-stamp with repeater in this entry.
+
+Return the repeater, as a string, or nil. Also return nil when
+this function is called before first heading.
+
+When optional argument TIMESTAMP is a string, extract the
+repeater from there instead."
+ (save-match-data
+ (cond
+ (timestamp
+ (and (string-match org-repeat-re timestamp)
+ (match-string-no-properties 1 timestamp)))
+ ((org-before-first-heading-p) nil)
+ (t
+ (save-excursion
+ (org-back-to-heading t)
+ (let ((end (org-entry-end-position)))
+ (catch :repeat
+ (while (re-search-forward org-repeat-re end t)
+ (when (save-match-data (org-at-timestamp-p 'agenda))
+ (throw :repeat (match-string-no-properties 1)))))))))))
+
+(defvar org-last-changed-timestamp)
+(defvar org-last-inserted-timestamp)
+(defvar org-log-post-message)
+(defvar org-log-note-purpose)
+(defvar org-log-note-how nil)
+(defvar org-log-note-extra)
+(defvar org-log-setup nil)
+(defun org-auto-repeat-maybe (done-word)
+ "Check if the current headline contains a repeated time-stamp.
+
+If yes, set TODO state back to what it was and change the base date
+of repeating deadline/scheduled time stamps to new date.
+
+This function is run automatically after each state change to a DONE state."
+ (let* ((repeat (org-get-repeat))
+ (aa (assoc org-last-state org-todo-kwd-alist))
+ (interpret (nth 1 aa))
+ (head (nth 2 aa))
+ (whata '(("h" . hour) ("d" . day) ("m" . month) ("y" . year)))
+ (msg "Entry repeats: ")
+ (org-log-done nil)
+ (org-todo-log-states nil)
+ (end (copy-marker (org-entry-end-position))))
+ (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 org-log-setup
+ ;; 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, or now if
+ ;; repeater is by hours.
+ (if (equal what "h")
+ (org-timestamp-change
+ (floor (- (org-time-stamp-to-now ts t)) 60) 'minute)
+ (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.
+ (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.
+The tree will show the lines where the regexp matches, and all higher
+headlines above the match.
+With a `\\[universal-argument]' prefix, prompt for a regexp to match.
+With a numeric prefix N, construct a sparse tree for the Nth element
+of `org-todo-keywords-1'."
+ (interactive "P")
+ (let ((case-fold-search nil)
+ (kwd-re
+ (cond ((null arg) (concat org-not-done-regexp "\\s-"))
+ ((equal arg '(4))
+ (let ((kwd
+ (completing-read "Keyword (or KWD1|KWD2|...): "
+ (mapcar #'list org-todo-keywords-1))))
+ (concat "\\("
+ (mapconcat 'identity (org-split-string kwd "|") "\\|")
+ "\\)\\>")))
+ ((<= (prefix-numeric-value arg) (length org-todo-keywords-1))
+ (regexp-quote (nth (1- (prefix-numeric-value arg))
+ org-todo-keywords-1)))
+ (t (user-error "Invalid prefix argument: %s" arg)))))
+ (message "%d TODO entries found"
+ (org-occur (concat "^" org-outline-regexp " *" kwd-re )))))
+
+(defun org--deadline-or-schedule (arg type time)
+ "Insert DEADLINE or SCHEDULE information in current entry.
+TYPE is either `deadline' or `scheduled'. See `org-deadline' or
+`org-schedule' for information about ARG and TIME arguments."
+ (let* ((deadline? (eq type 'deadline))
+ (keyword (if deadline? org-deadline-string org-scheduled-string))
+ (log (if deadline? org-log-redeadline org-log-reschedule))
+ (old-date (org-entry-get nil (if deadline? "DEADLINE" "SCHEDULED")))
+ (old-date-time (and old-date (org-time-string-to-time old-date)))
+ ;; Save repeater cookie from either TIME or current scheduled
+ ;; time stamp. We are going to insert it back at the end of
+ ;; the process.
+ (repeater (or (and (org-string-nw-p time)
+ ;; We use `org-repeat-re' because we need
+ ;; to tell the difference between a real
+ ;; repeater and a time delta, e.g. "+2d".
+ (string-match org-repeat-re time)
+ (match-string 1 time))
+ (and (org-string-nw-p old-date)
+ (string-match "\\([.+-]+[0-9]+[hdwmy]\
+\\(?:[/ ][-+]?[0-9]+[hdwmy]\\)?\\)"
+ old-date)
+ (match-string 1 old-date)))))
+ (pcase arg
+ (`(4)
+ (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)
+ (let ((regexp (if deadline? org-deadline-time-regexp
+ org-scheduled-time-regexp)))
+ (if (not (re-search-forward regexp (line-end-position 2) t))
+ (user-error (if deadline? "No deadline information to update"
+ "No scheduled information to update"))
+ (let* ((rpl0 (match-string 1))
+ (rpl (replace-regexp-in-string " -[0-9]+[hdwmy]" "" rpl0))
+ (msg (if deadline? "Warn starting from" "Delay until")))
+ (replace-match
+ (concat keyword
+ " <" rpl
+ (format " -%dd"
+ (abs (- (time-to-days
+ (save-match-data
+ (org-read-date
+ nil t nil msg old-date-time)))
+ (time-to-days old-date-time))))
+ ">") t t))))))
+ (_
+ (org-add-planning-info type time 'closed)
+ (when (and old-date
+ log
+ (not (equal old-date org-last-inserted-timestamp)))
+ (org-add-log-setup (if deadline? 'redeadline 'reschedule)
+ org-last-inserted-timestamp
+ old-date
+ log))
+ (when repeater
+ (save-excursion
+ (org-back-to-heading t)
+ (when (re-search-forward
+ (concat keyword " " org-last-inserted-timestamp)
+ (line-end-position 2)
+ t)
+ (goto-char (1- (match-end 0)))
+ (insert " " repeater)
+ (setq org-last-inserted-timestamp
+ (concat (substring org-last-inserted-timestamp 0 -1)
+ " " repeater
+ (substring org-last-inserted-timestamp -1))))))
+ (message (if deadline? "Deadline on %s" "Scheduled to %s")
+ org-last-inserted-timestamp)))))
+
+(defun org-deadline (arg &optional time)
+ "Insert a \"DEADLINE:\" string with a timestamp to make a deadline.
+
+When called interactively, this command pops up the Emacs calendar to let
+the user select a date.
+
+With one universal prefix argument, remove any deadline from the item.
+With two universal prefix arguments, prompt for a warning delay.
+With argument TIME, set the deadline at the corresponding date. TIME
+can either be an Org date like \"2011-07-24\" or a delta like \"+2d\"."
+ (interactive "P")
+ (if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
+ (org-map-entries
+ (lambda () (org--deadline-or-schedule arg 'deadline time))
+ 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))))
+ (org--deadline-or-schedule arg 'deadline time)))
+
+(defun org-schedule (arg &optional time)
+ "Insert a \"SCHEDULED:\" string with a timestamp to schedule an item.
+
+When called interactively, this command pops up the Emacs calendar to let
+the user select a date.
+
+With one universal prefix argument, remove any scheduling date from the item.
+With two universal prefix arguments, prompt for a delay cookie.
+With argument TIME, scheduled at the corresponding date. TIME can
+either be an Org date like \"2011-07-24\" or a delta like \"+2d\"."
+ (interactive "P")
+ (if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
+ (org-map-entries
+ (lambda () (org--deadline-or-schedule arg 'scheduled time))
+ 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))))
+ (org--deadline-or-schedule arg 'scheduled time)))
+
+(defun org-get-scheduled-time (pom &optional inherit)
+ "Get the scheduled time as a time tuple, of a format suitable
+for calling org-schedule with, or if there is no scheduling,
+returns nil."
+ (let ((time (org-entry-get pom "SCHEDULED" inherit)))
+ (when 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
+calling org-deadline with, or if there is no scheduling, returns
+nil."
+ (let ((time (org-entry-get pom "DEADLINE" inherit)))
+ (when time
+ (org-time-string-to-time time))))
+
+(defun org-remove-timestamp-with-keyword (keyword)
+ "Remove all time stamps with KEYWORD in the current entry."
+ (let ((re (concat "\\<" (regexp-quote keyword) " +<[^>\n]+>[ \t]*"))
+ beg)
+ (save-excursion
+ (org-back-to-heading t)
+ (setq beg (point))
+ (outline-next-heading)
+ (while (re-search-backward re beg t)
+ (replace-match "")
+ (if (and (string-match "\\S-" (buffer-substring (point-at-bol) (point)))
+ (equal (char-before) ?\ ))
+ (backward-delete-char 1)
+ (when (string-match "^[ \t]*$" (buffer-substring
+ (point-at-bol) (point-at-eol)))
+ (delete-region (point-at-bol)
+ (min (point-max) (1+ (point-at-eol))))))))))
+
+(defvar org-time-was-given) ; dynamically scoped parameter
+(defvar org-end-time-was-given) ; dynamically scoped parameter
+
+(defun org-at-planning-p ()
+ "Non-nil when point is on a planning info line."
+ ;; This is as accurate and faster than `org-element-at-point' since
+ ;; planning info location is fixed in the section.
+ (org-with-wide-buffer
+ (beginning-of-line)
+ (and (looking-at-p org-planning-line-re)
+ (eq (point)
+ (ignore-errors
+ (if (and (featurep 'org-inlinetask) (org-inlinetask-in-task-p))
+ (org-back-to-heading t)
+ (org-with-limited-levels (org-back-to-heading t)))
+ (line-beginning-position 2))))))
+
+(defun org-add-planning-info (what &optional time &rest remove)
+ "Insert new timestamp with keyword in the planning line.
+WHAT indicates what kind of time stamp to add. It is a symbol
+among `closed', `deadline', `scheduled' and nil. TIME indicates
+the time to use. If none is given, the user is prompted for
+a date. REMOVE indicates what kind of entries to remove. An old
+WHAT entry will also be removed."
+ (let (org-time-was-given org-end-time-was-given default-time default-input)
+ (when (and (memq what '(scheduled deadline))
+ (or (not time)
+ (and (stringp time)
+ (string-match "^[-+]+[0-9]" time))))
+ ;; Try to get a default date/time from existing timestamp
+ (save-excursion
+ (org-back-to-heading t)
+ (let ((end (save-excursion (outline-next-heading) (point))) ts)
+ (when (re-search-forward (if (eq what 'scheduled)
+ org-scheduled-time-regexp
+ org-deadline-time-regexp)
+ end t)
+ (setq ts (match-string 1)
+ default-time (org-time-string-to-time ts)
+ default-input (and ts (org-get-compact-tod ts)))))))
+ (when what
+ (setq time
+ (if (stringp time)
+ ;; This is a string (relative or absolute), set
+ ;; proper date.
+ (apply #'encode-time
+ (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
+ (cl-case what
+ (deadline "DEADLINE")
+ (scheduled "SCHEDULED")
+ (otherwise nil))
+ default-time default-input)))))
+ (org-with-wide-buffer
+ (org-back-to-heading t)
+ (let ((planning? (save-excursion
+ (forward-line)
+ (looking-at-p org-planning-line-re))))
+ (cond
+ (planning?
+ (forward-line)
+ ;; Move to current indentation.
+ (skip-chars-forward " \t")
+ ;; Check if we have to remove something.
+ (dolist (type (if what (cons what remove) remove))
+ (save-excursion
+ (when (re-search-forward
+ (cl-case type
+ (closed org-closed-time-regexp)
+ (deadline org-deadline-time-regexp)
+ (scheduled org-scheduled-time-regexp)
+ (otherwise (error "Invalid planning type: %s" type)))
+ (line-end-position)
+ t)
+ ;; Delete until next keyword or end of line.
+ (delete-region
+ (match-beginning 0)
+ (if (re-search-forward org-keyword-time-not-clock-regexp
+ (line-end-position)
+ t)
+ (match-beginning 0)
+ (line-end-position))))))
+ ;; If there is nothing more to add and no more keyword is
+ ;; left, remove the line completely.
+ (if (and (looking-at-p "[ \t]*$") (not what))
+ (delete-region (line-end-position 0)
+ (line-end-position))
+ ;; If we removed last keyword, do not leave trailing white
+ ;; space at the end of line.
+ (let ((p (point)))
+ (save-excursion
+ (end-of-line)
+ (unless (= (skip-chars-backward " \t" p) 0)
+ (delete-region (point) (line-end-position)))))))
+ (what
+ (end-of-line)
+ (insert "\n")
+ (when org-adapt-indentation
+ (indent-to-column (1+ (org-outline-level)))))
+ (t nil)))
+ (when what
+ ;; Insert planning keyword.
+ (insert (cl-case what
+ (closed org-closed-string)
+ (deadline org-deadline-string)
+ (scheduled org-scheduled-string)
+ (otherwise (error "Invalid planning type: %s" what)))
+ " ")
+ ;; Insert associated timestamp.
+ (let ((ts (org-insert-time-stamp
+ time
+ (or org-time-was-given
+ (and (eq what 'closed) org-log-done-with-time))
+ (eq what 'closed)
+ nil nil (list org-end-time-was-given))))
+ (unless (eolp) (insert " "))
+ ts)))))
+
+(defvar org-log-note-marker (make-marker)
+ "Marker pointing at the entry where the note is to be inserted.")
+(defvar org-log-note-purpose nil)
+(defvar org-log-note-state nil)
+(defvar org-log-note-previous-state nil)
+(defvar org-log-note-extra nil)
+(defvar org-log-note-window-configuration nil)
+(defvar org-log-note-return-to (make-marker))
+(defvar org-log-note-effective-time nil
+ "Remembered current time.
+So that dynamically scoped `org-extend-today-until' affects
+timestamps in state change log.")
+
+(defvar org-log-post-message nil
+ "Message to be displayed after a log note has been stored.
+The auto-repeater uses this.")
+
+(defun org-add-note ()
+ "Add a note to the current entry.
+This is done in the same way as adding a state change note."
+ (interactive)
+ (org-add-log-setup 'note))
+
+(defun org-log-beginning (&optional create)
+ "Return expected start of log notes in current entry.
+When optional argument CREATE is non-nil, the function creates
+a drawer to store notes, if necessary. Returned position ignores
+narrowing."
+ (org-with-wide-buffer
+ (let ((drawer (org-log-into-drawer)))
+ (cond
+ (drawer
+ (org-end-of-meta-data)
+ (let ((regexp (concat "^[ \t]*:" (regexp-quote drawer) ":[ \t]*$"))
+ (end (if (org-at-heading-p) (point)
+ (save-excursion (outline-next-heading) (point))))
+ (case-fold-search t))
+ (catch 'exit
+ ;; Try to find existing drawer.
+ (while (re-search-forward regexp end t)
+ (let ((element (org-element-at-point)))
+ (when (eq (org-element-type element) 'drawer)
+ (let ((cend (org-element-property :contents-end element)))
+ (when (and (not org-log-states-order-reversed) cend)
+ (goto-char cend)))
+ (throw 'exit nil))))
+ ;; No drawer found. Create one, if permitted.
+ (when create
+ (unless (bolp) (insert "\n"))
+ (let ((beg (point)))
+ (insert ":" drawer ":\n:END:\n")
+ (org-indent-region beg (point))
+ (org-flag-region (line-end-position -1)
+ (1- (point)) t 'outline))
+ (end-of-line -1)))))
+ (t
+ (org-end-of-meta-data org-log-state-notes-insert-after-drawers)
+ (skip-chars-forward " \t\n")
+ (beginning-of-line)
+ (unless org-log-states-order-reversed
+ (org-skip-over-state-notes)
+ (skip-chars-backward " \t\n")
+ (forward-line)))))
+ (if (bolp) (point) (line-beginning-position 2))))
+
+(defun org-add-log-setup (&optional purpose state prev-state how extra)
+ "Set up the post command hook to take a note.
+If this is about to TODO state change, the new state is expected in STATE.
+HOW is an indicator what kind of note should be created.
+EXTRA is additional text that will be inserted into the notes buffer."
+ (move-marker org-log-note-marker (point))
+ (setq org-log-note-purpose purpose
+ org-log-note-state state
+ org-log-note-previous-state prev-state
+ org-log-note-how how
+ org-log-note-extra extra
+ org-log-note-effective-time (org-current-effective-time)
+ org-log-setup t)
+ (add-hook 'post-command-hook 'org-add-log-note 'append))
+
+(defun org-skip-over-state-notes ()
+ "Skip past the list of State notes in an entry."
+ (when (ignore-errors (goto-char (org-in-item-p)))
+ (let* ((struct (org-list-struct))
+ (prevs (org-list-prevs-alist struct))
+ (regexp
+ (concat "[ \t]*- +"
+ (replace-regexp-in-string
+ " +" " +"
+ (org-replace-escapes
+ (regexp-quote (cdr (assq 'state org-log-note-headings)))
+ `(("%d" . ,org-ts-regexp-inactive)
+ ("%D" . ,org-ts-regexp)
+ ("%s" . "\\(?:\"\\S-+\"\\)?")
+ ("%S" . "\\(?:\"\\S-+\"\\)?")
+ ("%t" . ,org-ts-regexp-inactive)
+ ("%T" . ,org-ts-regexp)
+ ("%u" . ".*?")
+ ("%U" . ".*?")))))))
+ (while (looking-at-p regexp)
+ (goto-char (or (org-list-get-next-item (point) struct prevs)
+ (org-list-get-item-end (point) struct)))))))
+
+(defun org-add-log-note (&optional _purpose)
+ "Pop up a window for taking a note, and add this note later."
+ (remove-hook 'post-command-hook 'org-add-log-note)
+ (setq org-log-setup nil)
+ (setq org-log-note-window-configuration (current-window-configuration))
+ (delete-other-windows)
+ (move-marker org-log-note-return-to (point))
+ (pop-to-buffer-same-window (marker-buffer org-log-note-marker))
+ (goto-char org-log-note-marker)
+ (org-switch-to-buffer-other-window "*Org Note*")
+ (erase-buffer)
+ (if (memq org-log-note-how '(time state))
+ (org-store-log-note)
+ (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"
+ (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 "")))
+ (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)
+ (run-hooks 'org-log-buffer-setup-hook)))
+
+(defvar org-note-abort nil) ; dynamically scoped
+(defun org-store-log-note ()
+ "Finish taking a log note, and insert it to where it belongs."
+ (let ((txt (prog1 (buffer-string)
+ (kill-buffer)))
+ (note (cdr (assq org-log-note-purpose org-log-note-headings)))
+ lines)
+ (while (string-match "\\`# .*\n[ \t\n]*" txt)
+ (setq txt (replace-match "" t t txt)))
+ (when (string-match "\\s-+\\'" txt)
+ (setq txt (replace-match "" t t txt)))
+ (setq lines (and (not (equal "" txt)) (org-split-string txt "\n")))
+ (when (org-string-nw-p note)
+ (setq note
+ (org-replace-escapes
+ note
+ (list (cons "%u" (user-login-name))
+ (cons "%U" user-full-name)
+ (cons "%t" (format-time-string
+ (org-time-stamp-format 'long 'inactive)
+ org-log-note-effective-time))
+ (cons "%T" (format-time-string
+ (org-time-stamp-format 'long nil)
+ org-log-note-effective-time))
+ (cons "%d" (format-time-string
+ (org-time-stamp-format nil 'inactive)
+ org-log-note-effective-time))
+ (cons "%D" (format-time-string
+ (org-time-stamp-format nil nil)
+ org-log-note-effective-time))
+ (cons "%s" (cond
+ ((not org-log-note-state) "")
+ ((string-match-p org-ts-regexp
+ org-log-note-state)
+ (format "\"[%s]\""
+ (substring org-log-note-state 1 -1)))
+ (t (format "\"%s\"" org-log-note-state))))
+ (cons "%S"
+ (cond
+ ((not org-log-note-previous-state) "")
+ ((string-match-p org-ts-regexp
+ org-log-note-previous-state)
+ (format "\"[%s]\""
+ (substring
+ org-log-note-previous-state 1 -1)))
+ (t (format "\"%s\""
+ org-log-note-previous-state)))))))
+ (when lines (setq note (concat note " \\\\")))
+ (push note lines))
+ (when (and lines (not org-note-abort))
+ (with-current-buffer (marker-buffer org-log-note-marker)
+ (org-with-wide-buffer
+ ;; Find location for the new note.
+ (goto-char org-log-note-marker)
+ (set-marker org-log-note-marker nil)
+ ;; Note associated to a clock is to be located right after
+ ;; the clock. Do not move point.
+ (unless (eq org-log-note-purpose 'clock-out)
+ (goto-char (org-log-beginning t)))
+ ;; Make sure point is at the beginning of an empty line.
+ (cond ((not (bolp)) (let ((inhibit-read-only t)) (insert "\n")))
+ ((looking-at "[ \t]*\\S-") (save-excursion (insert "\n"))))
+ ;; In an existing list, add a new item at the top level.
+ ;; Otherwise, indent line like a regular one.
+ (let ((itemp (org-in-item-p)))
+ (if itemp
+ (indent-line-to
+ (let ((struct (save-excursion
+ (goto-char itemp) (org-list-struct))))
+ (org-list-get-ind (org-list-get-top-point struct) struct)))
+ (org-indent-line)))
+ (insert (org-list-bullet-string "-") (pop lines))
+ (let ((ind (org-list-item-body-column (line-beginning-position))))
+ (dolist (line lines)
+ (insert "\n")
+ (indent-line-to ind)
+ (insert line)))
+ (message "Note stored")
+ (org-back-to-heading t)))))
+ ;; Don't add undo information when called from `org-agenda-todo'.
+ (set-window-configuration org-log-note-window-configuration)
+ (with-current-buffer (marker-buffer org-log-note-return-to)
+ (goto-char org-log-note-return-to))
+ (move-marker org-log-note-return-to nil)
+ (when org-log-post-message (message "%s" org-log-post-message)))
+
+(defun org-remove-empty-drawer-at (pos)
+ "Remove an empty drawer at position POS.
+POS may also be a marker."
+ (with-current-buffer (if (markerp pos) (marker-buffer pos) (current-buffer))
+ (org-with-wide-buffer
+ (goto-char pos)
+ (let ((drawer (org-element-at-point)))
+ (when (and (memq (org-element-type drawer) '(drawer property-drawer))
+ (not (org-element-property :contents-begin drawer)))
+ (delete-region (org-element-property :begin drawer)
+ (progn (goto-char (org-element-property :end drawer))
+ (skip-chars-backward " \r\t\n")
+ (forward-line)
+ (point))))))))
+
+(defvar org-ts-type nil)
+(defun org-sparse-tree (&optional arg type)
+ "Create a sparse tree, prompt for the details.
+This command can create sparse trees. You first need to select the type
+of match used to create the tree:
+
+t Show all TODO entries.
+T Show entries with a specific TODO keyword.
+m Show entries selected by a tags/property match.
+p Enter a property name and its value (both with completion on existing
+ names/values) and show entries with that property.
+r Show entries matching a regular expression (`/' can be used as well).
+b Show deadlines and scheduled items before a date.
+a Show deadlines and scheduled items after a date.
+d Show deadlines due within `org-deadline-warning-days'.
+D Show deadlines and scheduled items between a date range."
+ (interactive "P")
+ (setq type (or type org-sparse-tree-default-date-type))
+ (setq org-ts-type type)
+ (message "Sparse tree: [r]egexp [t]odo [T]odo-kwd [m]atch [p]roperty
+ [d]eadlines [b]efore-date [a]fter-date [D]ates range
+ [c]ycle through date types: %s"
+ (cl-case type
+ (all "all timestamps")
+ (scheduled "only scheduled")
+ (deadline "only deadline")
+ (active "only active timestamps")
+ (inactive "only inactive timestamps")
+ (closed "with a closed time-stamp")
+ (otherwise "scheduled/deadline")))
+ (let ((answer (read-char-exclusive)))
+ (cl-case answer
+ (?c
+ (org-sparse-tree
+ arg
+ (cadr
+ (memq type '(nil all scheduled deadline active inactive closed)))))
+ (?d (call-interactively 'org-check-deadlines))
+ (?b (call-interactively 'org-check-before-date))
+ (?a (call-interactively 'org-check-after-date))
+ (?D (call-interactively 'org-check-dates-range))
+ (?t (call-interactively 'org-show-todo-tree))
+ (?T (org-show-todo-tree '(4)))
+ (?m (call-interactively 'org-match-sparse-tree))
+ ((?p ?P)
+ (let* ((kwd (completing-read
+ "Property: " (mapcar #'list (org-buffer-property-keys))))
+ (value (completing-read
+ "Value: " (mapcar #'list (org-property-values kwd)))))
+ (unless (string-match "\\`{.*}\\'" value)
+ (setq value (concat "\"" value "\"")))
+ (org-match-sparse-tree arg (concat kwd "=" value))))
+ ((?r ?R ?/) (call-interactively 'org-occur))
+ (otherwise (user-error "No such sparse tree command \"%c\"" answer)))))
+
+(defvar-local org-occur-highlights nil
+ "List of overlays used for occur matches.")
+(defvar-local org-occur-parameters nil
+ "Parameters of the active org-occur calls.
+This is a list, each call to org-occur pushes as cons cell,
+containing the regular expression and the callback, onto the list.
+The list can contain several entries if `org-occur' has been called
+several time with the KEEP-PREVIOUS argument. Otherwise, this list
+will only contain one set of parameters. When the highlights are
+removed (for example with `C-c C-c', or with the next edit (depending
+on `org-remove-highlights-with-change'), this variable is emptied
+as well.")
+
+(defun org-occur (regexp &optional keep-previous callback)
+ "Make a compact tree showing all matches of REGEXP.
+
+The tree will show the lines where the regexp matches, and any other context
+defined in `org-show-context-detail', which see.
+
+When optional argument KEEP-PREVIOUS is non-nil, highlighting and exposing
+done by a previous call to `org-occur' will be kept, to allow stacking of
+calls to this command.
+
+Optional argument CALLBACK can be a function of no argument. In this case,
+it is called with point at the end of the match, match data being set
+accordingly. Current match is shown only if the return value is non-nil.
+The function must neither move point nor alter narrowing."
+ (interactive "sRegexp: \nP")
+ (when (equal regexp "")
+ (user-error "Regexp cannot be empty"))
+ (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-highlight-new-match (beg end)
+ "Highlight from BEG to END and mark the highlight is an occur headline."
+ (let ((ov (make-overlay beg end)))
+ (overlay-put ov 'face 'secondary-selection)
+ (overlay-put ov 'org-type 'org-occur)
+ (push ov org-occur-highlights)))
+
+(defun org-remove-occur-highlights (&optional _beg _end noremove)
+ "Remove the occur highlights from the buffer.
+BEG and END are ignored. If NOREMOVE is nil, remove this function
+from the `before-change-functions' in the current buffer."
+ (interactive)
+ (unless org-inhibit-highlight-removal
+ (mapc #'delete-overlay org-occur-highlights)
+ (setq org-occur-highlights nil)
+ (setq org-occur-parameters nil)
+ (unless noremove
+ (remove-hook 'before-change-functions
+ 'org-remove-occur-highlights 'local))))
+
+;;;; Priorities
+
+(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]+\\)\\] ?\\)"
+ "Regular expression matching the priority indicator.
+A priority indicator can be e.g. [#A] or [#1].
+This regular expression matches these groups:
+0 : the whole match, e.g. \"TODO [#A] Hack\"
+1 : the priority cookie, e.g. \"[#A]\"
+2 : the value of the priority cookie, e.g. \"A\".")
+
+(defun org-priority-up ()
+ "Increase the priority of the current item."
+ (interactive)
+ (org-priority 'up))
+
+(defun org-priority-down ()
+ "Decrease the priority of the current item."
+ (interactive)
+ (org-priority 'down))
+
+(defun org-priority (&optional action show)
+ "Change the priority of an item.
+
+When called interactively with a `\\[universal-argument]' prefix,
+show the priority in the minibuffer instead of changing it.
+
+When called programmatically, 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-priority-show)
+ (unless org-priority-enable-commands
+ (user-error "Priority commands are disabled"))
+ (setq action (or action 'set))
+ (let ((nump (< org-priority-lowest 65))
+ current new news have remove)
+ (save-excursion
+ (org-back-to-heading t)
+ (when (looking-at org-priority-regexp)
+ (let ((ms (match-string 2)))
+ (setq current (org-priority-to-value ms)
+ have t)))
+ (cond
+ ((eq action 'remove)
+ (setq remove t new ?\ ))
+ ((or (eq action 'set)
+ (integerp action))
+ (if (not (eq action 'set))
+ (setq new action)
+ (setq
+ new
+ (if nump
+ (let* ((msg (format "Priority %s-%s, SPC to remove: "
+ (number-to-string org-priority-highest)
+ (number-to-string org-priority-lowest)))
+ (s (if (< 9 org-priority-lowest)
+ (read-string msg)
+ (message msg)
+ (char-to-string (read-char-exclusive)))))
+ (if (equal s " ") ?\s (string-to-number s)))
+ (progn (message "Priority %c-%c, SPC to remove: "
+ org-priority-highest org-priority-lowest)
+ (save-match-data
+ (setq new (read-char-exclusive)))))))
+ (when (and (= (upcase org-priority-highest) org-priority-highest)
+ (= (upcase org-priority-lowest) org-priority-lowest))
+ (setq new (upcase new)))
+ (cond ((equal new ?\s) (setq remove t))
+ ((or (< (upcase new) org-priority-highest) (> (upcase new) org-priority-lowest))
+ (user-error
+ (if nump
+ "Priority must be between `%s' and `%s'"
+ "Priority must be between `%c' and `%c'")
+ org-priority-highest org-priority-lowest))))
+ ((eq action 'up)
+ (setq new (if have
+ (1- current) ; normal cycling
+ ;; last priority was empty
+ (if (eq last-command this-command)
+ org-priority-lowest ; wrap around empty to lowest
+ ;; default
+ (if org-priority-start-cycle-with-default
+ org-priority-default
+ (1- org-priority-default))))))
+ ((eq action 'down)
+ (setq new (if have
+ (1+ current) ; normal cycling
+ ;; last priority was empty
+ (if (eq last-command this-command)
+ org-priority-highest ; wrap around empty to highest
+ ;; default
+ (if org-priority-start-cycle-with-default
+ org-priority-default
+ (1+ org-priority-default))))))
+ (t (user-error "Invalid action")))
+ (when (or (< (upcase new) org-priority-highest)
+ (> (upcase new) org-priority-lowest))
+ (if (and (memq action '(up down))
+ (not have) (not (eq last-command this-command)))
+ ;; `new' is from default priority
+ (error
+ "The default can not be set, see `org-priority-default' why")
+ ;; normal cycling: `new' is beyond highest/lowest priority
+ ;; and is wrapped around to the empty priority
+ (setq remove t)))
+ ;; Numerical priorities are limited to 64, beyond that number,
+ ;; assume the priority cookie is a character.
+ (setq news (if (> new 64) (format "%c" new) (format "%s" new)))
+ (if have
+ (if remove
+ (replace-match "" t t nil 1)
+ (replace-match news t t nil 2))
+ (if remove
+ (user-error "No priority cookie found in line")
+ (let ((case-fold-search nil)) (looking-at org-todo-line-regexp))
+ (if (match-end 2)
+ (progn
+ (goto-char (match-end 2))
+ (insert " [#" news "]"))
+ (goto-char (match-beginning 3))
+ (insert "[#" news "] "))))
+ (org-align-tags))
+ (if remove
+ (message "Priority removed")
+ (message "Priority of current item set to %s" news)))))
+
+(defalias 'org-show-priority 'org-priority-show)
+(defun org-priority-show ()
+ "Show the priority of the current item.
+This priority is composed of the main priority given with the [#A] cookies,
+and by additional input from the age of a schedules or deadline entry."
+ (interactive)
+ (let ((pri (if (eq major-mode 'org-agenda-mode)
+ (org-get-at-bol 'priority)
+ (save-excursion
+ (save-match-data
+ (beginning-of-line)
+ (and (looking-at org-heading-regexp)
+ (org-get-priority (match-string 0))))))))
+ (message "Priority is %d" (if pri pri -1000))))
+
+(defun org-get-priority (s)
+ "Find priority cookie and return priority.
+S is a string against which you can match `org-priority-regexp'.
+If `org-priority-get-priority-function' is set to a custom
+function, use it. Otherwise process S and output the priority
+value, an integer."
+ (save-match-data
+ (if (functionp org-priority-get-priority-function)
+ (funcall org-priority-get-priority-function s)
+ (if (not (string-match org-priority-regexp s))
+ (* 1000 (- org-priority-lowest org-priority-default))
+ (* 1000 (- org-priority-lowest
+ (org-priority-to-value (match-string 2 s))))))))
+
+;;;; Tags
+
+(defvar org-agenda-archives-mode)
+(defvar org-map-continue-from nil
+ "Position from where mapping should continue.
+Can be set by the action argument to `org-scan-tags' and `org-map-entries'.")
+
+(defvar org-scanner-tags nil
+ "The current tag list while the tags scanner is running.")
+
+(defvar org-trust-scanner-tags nil
+ "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' 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
+obtain a list of properties. Building the tags list for each entry in such
+a file becomes an N^2 operation - but with this variable set, it scales
+as N.")
+
+(defvar org--matcher-tags-todo-only nil)
+
+(defun org-scan-tags (action matcher todo-only &optional start-level)
+ "Scan headline tags with inheritance and produce output ACTION.
+
+ACTION can be `sparse-tree' to produce a sparse tree in the current buffer,
+or `agenda' to produce an entry list for an agenda view. It can also be
+a Lisp form or a function that should be called at each matched headline, in
+this case the return value is a list of all return values from these calls.
+
+MATCHER is a function accepting three arguments, returning
+a non-nil value whenever a given set of tags qualifies a headline
+for inclusion. See `org-make-tags-matcher' for more information.
+As a special case, it can also be set to t (respectively nil) in
+order to match all (respectively none) headline.
+
+When TODO-ONLY is non-nil, only lines with a TODO keyword are
+included in the output.
+
+START-LEVEL can be a string with asterisks, reducing the scope to
+headlines matching this string."
+ (require 'org-agenda)
+ (let* ((re (concat "^"
+ (if start-level
+ ;; Get the correct level to match
+ (concat "\\*\\{" (number-to-string start-level) "\\} ")
+ org-outline-regexp)
+ " *\\(" (regexp-opt org-todo-keywords-1 'words) "\\)?"
+ " *\\(.*?\\)\\([ \t]:\\(?:" org-tag-re ":\\)+\\)?[ \t]*$"))
+ (props (list 'face 'default
+ 'done-face 'org-agenda-done
+ 'undone-face 'default
+ 'mouse-face 'highlight
+ 'org-not-done-regexp org-not-done-regexp
+ '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"
+ (abbreviate-file-name
+ (or (buffer-file-name (buffer-base-buffer))
+ (buffer-name (buffer-base-buffer)))))))
+ (org-map-continue-from nil)
+ lspos tags tags-list
+ (tags-alist (list (cons 0 org-file-tags)))
+ (llast 0) rtn rtn1 level category i txt
+ todo marker entry priority
+ ts-date ts-date-type ts-date-pair)
+ (unless (or (member action '(agenda sparse-tree)) (functionp action))
+ (setq action (list 'lambda nil action)))
+ (save-excursion
+ (goto-char (point-min))
+ (when (eq action 'sparse-tree)
+ (org-overview)
+ (org-remove-occur-highlights))
+ (while (let (case-fold-search)
+ (re-search-forward re nil t))
+ (setq org-map-continue-from nil)
+ (catch :skip
+ ;; 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))
+ (when (eq action 'agenda)
+ (setq ts-date-pair (org-agenda-entry-get-agenda-timestamp (point))
+ ts-date (car ts-date-pair)
+ ts-date-type (cdr ts-date-pair)))
+ (setq i llast llast level)
+ ;; remove tag lists from same and sublevels
+ (while (>= i level)
+ (when (setq entry (assoc i tags-alist))
+ (setq tags-alist (delete entry tags-alist)))
+ (setq i (1- i)))
+ ;; add the next tags
+ (when tags
+ (setq tags (org-split-string tags ":")
+ tags-alist
+ (cons (cons level tags) tags-alist)))
+ ;; compile tags for current headline
+ (setq tags-list
+ (if org-use-tag-inheritance
+ (apply 'append (mapcar 'cdr (reverse tags-alist)))
+ tags)
+ org-scanner-tags tags-list)
+ (when org-use-tag-inheritance
+ (setcdr (car tags-alist)
+ (mapcar (lambda (x)
+ (setq x (copy-sequence x))
+ (org-add-prop-inherited x))
+ (cdar tags-alist))))
+ (when (and tags org-use-tag-inheritance
+ (or (not (eq t org-use-tag-inheritance))
+ org-tags-exclude-from-inheritance))
+ ;; Selective inheritance, remove uninherited ones.
+ (setcdr (car tags-alist)
+ (org-remove-uninherited-tags (cdar tags-alist))))
+ (when (and
+
+ ;; eval matcher only when the todo condition is OK
+ (and (or (not todo-only) (member todo org-todo-keywords-1))
+ (if (functionp matcher)
+ (let ((case-fold-search t) (org-trust-scanner-tags t))
+ (funcall matcher todo tags-list level))
+ matcher))
+
+ ;; Call the skipper, but return t if it does not
+ ;; skip, so that the `and' form continues evaluating.
+ (progn
+ (unless (eq action 'sparse-tree) (org-agenda-skip))
+ t)
+
+ ;; Check if timestamps are deselecting this entry
+ (or (not todo-only)
+ (and (member todo org-todo-keywords-1)
+ (or (not org-agenda-tags-todo-honor-ignore-options)
+ (not (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item))))))
+
+ ;; select this headline
+ (cond
+ ((eq action 'sparse-tree)
+ (and org-highlight-sparse-tree-matches
+ (org-get-heading) (match-end 0)
+ (org-highlight-new-match
+ (match-beginning 1) (match-end 1)))
+ (org-show-context 'tags-tree))
+ ((eq action 'agenda)
+ (setq txt (org-agenda-format-item
+ ""
+ (concat
+ (if (eq org-tags-match-list-sublevels 'indented)
+ (make-string (1- level) ?.) "")
+ (org-get-heading))
+ (make-string level ?\s)
+ category
+ tags-list)
+ priority (org-get-priority txt))
+ (goto-char lspos)
+ (setq marker (org-agenda-new-marker))
+ (org-add-props txt props
+ 'org-marker marker 'org-hd-marker marker 'org-category category
+ 'todo-state todo
+ 'ts-date ts-date
+ 'priority priority
+ 'type (concat "tagsmatch" ts-date-type))
+ (push txt rtn))
+ ((functionp action)
+ (setq org-map-continue-from nil)
+ (save-excursion
+ (setq rtn1 (funcall action))
+ (push rtn1 rtn)))
+ (t (user-error "Invalid action")))
+
+ ;; if we are to skip sublevels, jump to end of subtree
+ (unless org-tags-match-list-sublevels
+ (org-end-of-subtree t)
+ (backward-char 1))))
+ ;; Get the correct position from where to continue
+ (if org-map-continue-from
+ (goto-char org-map-continue-from)
+ (and (= (point) lspos) (end-of-line 1)))))
+ (when (and (eq action 'sparse-tree)
+ (not org-sparse-tree-open-archived-trees))
+ (org-hide-archived-subtrees (point-min) (point-max)))
+ (nreverse rtn)))
+
+(defun org-remove-uninherited-tags (tags)
+ "Remove all tags that are not inherited from the list TAGS."
+ (cond
+ ((eq org-use-tag-inheritance t)
+ (if org-tags-exclude-from-inheritance
+ (org-delete-all org-tags-exclude-from-inheritance tags)
+ tags))
+ ((not org-use-tag-inheritance) nil)
+ ((stringp org-use-tag-inheritance)
+ (delq nil (mapcar
+ (lambda (x)
+ (if (and (string-match org-use-tag-inheritance x)
+ (not (member x org-tags-exclude-from-inheritance)))
+ x nil))
+ tags)))
+ ((listp org-use-tag-inheritance)
+ (delq nil (mapcar
+ (lambda (x)
+ (if (member x org-use-tag-inheritance) x nil))
+ tags)))))
+
+(defun org-match-sparse-tree (&optional todo-only match)
+ "Create a sparse tree according to tags string MATCH.
+
+MATCH is a string with match syntax. It can contain a selection
+of tags (\"+work+urgent-boss\"), properties (\"LEVEL>3\"), and
+TODO keywords (\"TODO=\\\"WAITING\\\"\") or a combination of
+those. See the manual for details.
+
+If optional argument TODO-ONLY is non-nil, only select lines that
+are also TODO tasks."
+ (interactive "P")
+ (org-agenda-prepare-buffers (list (current-buffer)))
+ (let ((org--matcher-tags-todo-only todo-only))
+ (org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match t))
+ org--matcher-tags-todo-only)))
+
+(defalias 'org-tags-sparse-tree 'org-match-sparse-tree)
+
+(defvar org-cached-props nil)
+(defun org-cached-entry-get (pom property)
+ (if (or (eq t org-use-property-inheritance)
+ (and (stringp org-use-property-inheritance)
+ (let ((case-fold-search t))
+ (string-match-p org-use-property-inheritance property)))
+ (and (listp org-use-property-inheritance)
+ (member-ignore-case property org-use-property-inheritance)))
+ ;; Caching is not possible, check it directly.
+ (org-entry-get pom property 'inherit)
+ ;; Get all properties, so we can do complicated checks easily.
+ (cdr (assoc-string property
+ (or org-cached-props
+ (setq org-cached-props (org-entry-properties pom)))
+ t))))
+
+(defun org-global-tags-completion-table (&optional files)
+ "Return the list of all tags in all agenda buffer/files.
+Optional FILES argument is a list of files which can be used
+instead of the agenda files."
+ (save-excursion
+ (org-uniquify
+ (delq nil
+ (apply #'append
+ (mapcar
+ (lambda (file)
+ (set-buffer (find-file-noselect file))
+ (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))))))))
+
+(defun org-make-tags-matcher (match &optional only-local-tags)
+ "Create the TAGS/TODO matcher form for the selection string MATCH.
+
+Returns a cons of the selection string MATCH and a function
+implementing the matcher.
+
+The matcher is to be called at an Org entry, with point on the
+headline, and returns non-nil if the entry matches the selection
+string MATCH. It must be called with three arguments: the TODO
+keyword at the entry (or nil if none), the list of all tags at
+the entry including inherited ones and the reduced level of the
+headline. Additionally, the category of the entry, if any, must
+be specified as the text property `org-category' on the headline.
+
+This function sets the variable `org--matcher-tags-todo-only' to
+a non-nil value if the matcher restricts matching to TODO
+entries, otherwise it is not touched.
+
+When ONLY-LOCAL-TAGS is non-nil, ignore the global tag completion
+table, only get buffer tags.
+
+See also `org-scan-tags'."
+ (unless match
+ ;; 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--tag-add-to-alist
+ (org-get-buffer-tags)
+ (unless only-local-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 (concat
+ "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL\\([<=>]\\{1,2\\}\\)"
+ "\\([0-9]+\\)\\|\\(\\(?:[[:alnum:]_]+\\(?:\\\\-\\)*\\)+\\)"
+ "\\([<>=]\\{1,2\\}\\)"
+ "\\({[^}]+}\\|\"[^\"]*\"\\|-?[.0-9]+\\(?:[eE][-+]?[0-9]+\\)?\\)"
+ "\\|" org-tag-re "\\)"))
+ (start 0)
+ tagsmatch todomatch tagsmatcher todomatcher)
+
+ ;; Expand group tags.
+ (setq match (org-tags-expand match))
+
+ ;; Check if there is a TODO part of this match, which would be the
+ ;; part after a "/". To make sure that this slash is not part of
+ ;; a property value to be matched against, we also check that
+ ;; there is no / after that slash. First, find the last slash.
+ (let ((s 0))
+ (while (string-match "/+" match s)
+ (setq start (match-beginning 0))
+ (setq s (match-end 0))))
+ (if (and (string-match "/+" match start)
+ (not (string-match-p "\"" match start)))
+ ;; Match contains also a TODO-matching request.
+ (progn
+ (setq tagsmatch (substring match 0 (match-beginning 0)))
+ (setq todomatch (substring match (match-end 0)))
+ (when (string-prefix-p "!" todomatch)
+ (setq org--matcher-tags-todo-only t)
+ (setq todomatch (substring todomatch 1)))
+ (when (string-match "\\`\\s-*\\'" todomatch)
+ (setq todomatch nil)))
+ ;; Only matching tags.
+ (setq tagsmatch match)
+ (setq todomatch nil))
+
+ ;; Make the tags matcher.
+ (when (org-string-nw-p tagsmatch)
+ (let ((orlist nil)
+ (orterms (org-split-string tagsmatch "|"))
+ term)
+ (while (setq term (pop orterms))
+ (while (and (equal (substring term -1) "\\") orterms)
+ (setq term (concat term "|" (pop orterms)))) ;repair bad split.
+ (while (string-match re term)
+ (let* ((rest (substring term (match-end 0)))
+ (minus (and (match-end 1)
+ (equal (match-string 1 term) "-")))
+ (tag (save-match-data
+ (replace-regexp-in-string
+ "\\\\-" "-" (match-string 2 term))))
+ (regexp (eq (string-to-char tag) ?{))
+ (levelp (match-end 4))
+ (propp (match-end 5))
+ (mm
+ (cond
+ (regexp `(org-match-any-p ,(substring tag 1 -1) tags-list))
+ (levelp
+ `(,(org-op-to-function (match-string 3 term))
+ level
+ ,(string-to-number (match-string 4 term))))
+ (propp
+ (let* ((gv (pcase (upcase (match-string 5 term))
+ ("CATEGORY"
+ '(get-text-property (point) 'org-category))
+ ("TODO" 'todo)
+ (p `(org-cached-entry-get nil ,p))))
+ (pv (match-string 7 term))
+ (regexp (eq (string-to-char pv) ?{))
+ (strp (eq (string-to-char pv) ?\"))
+ (timep (string-match-p "^\"[[<].*[]>]\"$" pv))
+ (po (org-op-to-function (match-string 6 term)
+ (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 '/=))
+ `(not (string-match ,pv (or ,gv ""))))
+ (regexp `(string-match ,pv (or ,gv "")))
+ (strp `(,po (or ,gv "") ,pv))
+ (t
+ `(,po
+ (string-to-number (or ,gv ""))
+ ,(string-to-number pv))))))
+ (t `(member ,tag tags-list)))))
+ (push (if minus `(not ,mm) mm) tagsmatcher)
+ (setq term rest)))
+ (push `(and ,@tagsmatcher) orlist)
+ (setq tagsmatcher nil))
+ (setq tagsmatcher `(progn (setq org-cached-props nil) (or ,@orlist)))))
+
+ ;; Make the TODO matcher.
+ (when (org-string-nw-p todomatch)
+ (let ((orlist nil))
+ (dolist (term (org-split-string todomatch "|"))
+ (while (string-match re term)
+ (let* ((minus (and (match-end 1)
+ (equal (match-string 1 term) "-")))
+ (kwd (match-string 2 term))
+ (regexp (eq (string-to-char kwd) ?{))
+ (mm (if regexp `(string-match ,(substring kwd 1 -1) todo)
+ `(equal todo ,kwd))))
+ (push (if minus `(not ,mm) mm) todomatcher))
+ (setq term (substring term (match-end 0))))
+ (push (if (> (length todomatcher) 1)
+ (cons 'and todomatcher)
+ (car todomatcher))
+ orlist)
+ (setq todomatcher nil))
+ (setq todomatcher (cons 'or orlist))))
+
+ ;; Return the string and function of the matcher. If no
+ ;; tags-specific or todo-specific matcher exists, match
+ ;; everything.
+ (let ((matcher (if (and tagsmatcher todomatcher)
+ `(and ,tagsmatcher ,todomatcher)
+ (or tagsmatcher todomatcher t))))
+ (when org--matcher-tags-todo-only
+ (setq matcher `(and (member todo org-not-done-keywords) ,matcher)))
+ (cons match0 `(lambda (todo tags-list level) ,matcher)))))
+
+(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)
+ "Expand group tags in MATCH.
+
+This replaces every group tag in MATCH with a regexp tag search.
+For example, a group tag \"Work\" defined as { Work : Lab Conf }
+will be replaced like this:
+
+ Work => {\\<\\(?:Work\\|Lab\\|Conf\\)\\>}
+ +Work => +{\\<\\(?:Work\\|Lab\\|Conf\\)\\>}
+ -Work => -{\\<\\(?:Work\\|Lab\\|Conf\\)\\>}
+
+Replacing by a regexp preserves the structure of the match.
+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\".
+
+A group tag in MATCH can contain regular expressions of its own.
+For example, a group tag \"Proj\" defined as { Proj : {P@.+} }
+will be replaced like this:
+
+ Proj => {\\<\\(?:Proj\\)\\>\\|P@.+}
+
+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."
+ (unless (org-string-nw-p match) (error "Invalid match tag: %S" match))
+ (let ((tag-groups
+ (or org-tag-groups-alist-for-agenda org-tag-groups-alist)))
+ (cond
+ (single-as-list (org--tags-expand-group (list match) tag-groups nil))
+ (org-group-tags
+ (let* ((case-fold-search t)
+ (tag-syntax org-mode-syntax-table)
+ (group-keys (mapcar #'car tag-groups))
+ (key-regexp (concat "\\([+-]?\\)" (regexp-opt group-keys 'words)))
+ (return-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" 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 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 "<" ) '(< 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-string<> org-time<>))))
+ (nth (if (eq stringp 'time) 2 (if stringp 1 0)) op))
+
+(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-add-prop-inherited (s)
+ (add-text-properties 0 (length s) '(inherited t) s)
+ s)
+
+(defun org-toggle-tag (tag &optional onoff)
+ "Toggle the tag TAG for the current line.
+If ONOFF is `on' or `off', don't toggle but set to this state."
+ (save-excursion
+ (org-back-to-heading t)
+ (let ((current
+ ;; 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)))
+ ((or `on (guard (not (member tag current))))
+ (setq res t)
+ (cl-pushnew tag current :test #'equal))
+ (_ (setq current (delete tag current))))
+ (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. 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.
+
+When called with `\\[universal-argument] \\[universal-argument]' prefix argument, \
+unconditionally do not
+offer the fast tag selection interface.
+
+If a region is active, set tags in the region according to the
+setting of `org-loop-over-headlines-in-active-region'.
+
+This function is for interactive use only;
+in Lisp code use `org-set-tags' instead."
+ (interactive "P")
+ (let ((org-use-fast-tag-selection
+ (unless (equal '(16) arg) org-use-fast-tag-selection)))
+ (cond
+ ((equal '(4) arg) (org-align-tags t))
+ ((and (org-region-active-p) org-loop-over-headlines-in-active-region)
+ (let (org-loop-over-headlines-in-active-region) ; hint: infinite recursion.
+ (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)
+ (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)))
+ (crm-separator "[ \t]*:[ \t]*"))
+ (mapconcat #'identity
+ (completing-read-multiple
+ "Tags: "
+ org-last-tags-completion-table
+ nil nil (org-make-tag-string current-tags)
+ 'org-tags-history)
+ ":"))))))
+ (org-set-tags tags)))))
+ ;; `save-excursion' may not replace the point at the right
+ ;; position.
+ (when (and (save-excursion (skip-chars-backward "*") (bolp))
+ (looking-at-p " "))
+ (forward-char))))
+
+(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 (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-set-tags (tags)
+ "Set the tags of the current entry to TAGS, replacing current tags.
+
+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.
+This works in the agenda, and also in an Org buffer."
+ (interactive
+ (list (region-beginning) (region-end)
+ (let ((org-last-tags-completion-table
+ (if (derived-mode-p 'org-mode)
+ (org--tag-add-to-alist
+ (org-get-buffer-tags)
+ (org-global-tags-completion-table))
+ (org-global-tags-completion-table))))
+ (completing-read
+ "Tag: " org-last-tags-completion-table nil nil nil
+ 'org-tags-history))
+ (progn
+ (message "[s]et or [r]emove? ")
+ (equal (read-char-exclusive) ?r))))
+ (when (fboundp 'deactivate-mark) (deactivate-mark))
+ (let ((agendap (equal major-mode 'org-agenda-mode))
+ l1 l2 m buf pos newhead (cnt 0))
+ (goto-char end)
+ (setq l2 (1- (org-current-line)))
+ (goto-char beg)
+ (setq l1 (org-current-line))
+ (cl-loop for l from l1 to l2 do
+ (org-goto-line l)
+ (setq m (get-text-property (point) 'org-hd-marker))
+ (when (or (and (derived-mode-p 'org-mode) (org-at-heading-p))
+ (and agendap m))
+ (setq buf (if agendap (marker-buffer m) (current-buffer))
+ pos (if agendap m (point)))
+ (with-current-buffer buf
+ (save-excursion
+ (save-restriction
+ (goto-char pos)
+ (setq cnt (1+ cnt))
+ (org-toggle-tag tag (if off 'off 'on))
+ (setq newhead (org-get-heading)))))
+ (and agendap (org-agenda-change-all-lines newhead m))))
+ (message "Tag :%s: %s in %d headings" tag (if off "removed" "set") cnt)))
+
+(defun org-tags-completion-function (string _predicate &optional flag)
+ "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 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)
+ (or end "")))
+
+(defun org-fast-tag-show-exit (flag)
+ (save-excursion
+ (org-goto-line 3)
+ (when (re-search-forward "[ \t]+Next change exits" (point-at-eol) t)
+ (replace-match ""))
+ (when flag
+ (end-of-line 1)
+ (org-move-to-column (- (window-width) 19) t)
+ (insert (org-add-props " Next change exits" nil 'face 'org-warning)))))
+
+(defun org-set-current-tags-overlay (current prefix)
+ "Add an overlay to CURRENT tag with PREFIX."
+ (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))))
+
+(defvar org-last-tag-selection-key nil)
+(defun org-fast-tag-selection (current inherited table &optional todo-table)
+ "Fast tag selection with single keys.
+CURRENT is the current list of tags in the headline, INHERITED is the
+list of inherited tags, and TABLE is an alist of tags and corresponding keys,
+possibly with grouping information. TODO-TABLE is a similar table with
+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 (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))
+ (tab-tags nil)
+ (fwidth (+ maxlen 3 1 3))
+ (ncol (/ (- (window-width) 4) fwidth))
+ (i-face 'org-done)
+ (c-face 'org-todo)
+ tg cnt e c char c1 c2 ntable tbl rtn
+ ov-start ov-end ov-prefix
+ (exit-after-next org-fast-tag-selection-single-key)
+ (done-keywords org-done-keywords)
+ groups ingroup intaggroup)
+ (save-excursion
+ (beginning-of-line)
+ (if (looking-at org-tag-line-re)
+ (setq ov-start (match-beginning 1)
+ ov-end (match-end 1)
+ ov-prefix "")
+ (setq ov-start (1- (point-at-eol))
+ ov-end (1+ ov-start))
+ (skip-chars-forward "^\n\r")
+ (setq ov-prefix
+ (concat
+ (buffer-substring (1- (point)) (point))
+ (if (> (current-column) org-tags-column)
+ " "
+ (make-string (- org-tags-column (current-column)) ?\ ))))))
+ (move-overlay org-tags-overlay ov-start ov-end)
+ (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 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
+ (unless tab-tags
+ (setq tab-tags
+ (delq nil
+ (mapcar (lambda (x)
+ (let ((item (car-safe x)))
+ (and (stringp item)
+ (list item))))
+ (org--tag-add-to-alist
+ (with-current-buffer buf
+ (org-get-buffer-tags))
+ table))))))
+ (setq tg (completing-read "Tag: " tab-tags))
+ (when (string-match "\\S-" tg)
+ (cl-pushnew (list tg) tab-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))
+ (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. If a tag appears multiple times,
+only the most local tag is returned.
+
+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 (nconc (mapcar #'org-add-prop-inherited
+ (org--get-local-tags))
+ itags)))
+ (setq itags (append org-file-tags itags))
+ (nreverse
+ (delete-dups
+ (nreverse (nconc (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-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
+
+(defvar org-agenda-skip-comment-trees)
+(defvar org-agenda-skip-function)
+(defun 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. The function will be called without
+arguments, with the cursor positioned at the beginning of the headline.
+The return values of all calls to the function will be collected and
+returned as a list.
+
+The call to FUNC will be wrapped into a `save-excursion' form, so FUNC
+does not need to preserve point. After evaluation, the cursor will be
+moved to the end of the line (presumably of the headline of the
+processed entry) and search continues from there. Under some
+circumstances, this may not produce the wanted results. For example,
+if you have removed (e.g. archived) the current (sub)tree it could
+mean that the next entry will be skipped entirely. In such cases, you
+can specify the position from where search should continue by making
+FUNC set the variable `org-map-continue-from' to the desired buffer
+position.
+
+MATCH is a tags/property/todo match as it is used in the agenda tags view.
+Only headlines that are matched by this query will be considered during
+the iteration. When MATCH is nil or t, all headlines will be
+visited by the iteration.
+
+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
+region-start-level
+ The entries within the active region, but only those at
+ the same level than the first one.
+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 skipping facilities of
+the scanner. The following items can be given here:
+
+ archive skip trees with the archive tag
+ comment skip trees with the COMMENT keyword
+ function or Emacs Lisp form:
+ will be used as value for `org-agenda-skip-function', so
+ whenever the function returns a position, FUNC will not be
+ called for that entry and search will continue from the
+ position returned
+
+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'. 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
+a *different* entry, you cannot use these techniques."
+ (unless (and (or (eq scope 'region) (eq scope 'region-start-level))
+ (not (org-region-active-p)))
+ (let* ((org-agenda-archives-mode nil) ; just to make sure
+ (org-agenda-skip-archived-trees (memq 'archive skip))
+ (org-agenda-skip-comment-trees (memq 'comment skip))
+ (org-agenda-skip-function
+ (car (org-delete-all '(comment archive) skip)))
+ (org-tags-match-list-sublevels t)
+ (start-level (eq scope 'region-start-level))
+ matcher res
+ org-todo-keywords-for-agenda
+ org-done-keywords-for-agenda
+ org-todo-keyword-alist-for-agenda
+ org-tag-alist-for-agenda
+ org--matcher-tags-todo-only)
+
+ (cond
+ ((eq match t) (setq matcher t))
+ ((eq match nil) (setq matcher t))
+ (t (setq matcher (if match (cdr (org-make-tags-matcher match)) t))))
+
+ (save-excursion
+ (save-restriction
+ (cond ((eq scope 'tree)
+ (org-back-to-heading t)
+ (org-narrow-to-subtree)
+ (setq scope nil))
+ ((and (or (eq scope 'region) (eq scope 'region-start-level))
+ (org-region-active-p))
+ ;; If needed, set start-level to a string like "2"
+ (when start-level
+ (save-excursion
+ (goto-char (region-beginning))
+ (unless (org-at-heading-p) (outline-next-heading))
+ (setq start-level (org-current-level))))
+ (narrow-to-region (region-beginning)
+ (save-excursion
+ (goto-char (region-end))
+ (unless (and (bolp) (org-at-heading-p))
+ (outline-next-heading))
+ (point)))
+ (setq scope nil)))
+
+ (if (not scope)
+ (progn
+ (org-agenda-prepare-buffers
+ (and buffer-file-name (list buffer-file-name)))
+ (setq res
+ (org-scan-tags
+ func matcher org--matcher-tags-todo-only start-level)))
+ ;; Get the right scope
+ (cond
+ ((and scope (listp scope) (symbolp (car scope)))
+ (setq scope (eval scope)))
+ ((eq scope 'agenda)
+ (setq scope (org-agenda-files t)))
+ ((eq scope 'agenda-with-archives)
+ (setq scope (org-agenda-files t))
+ (setq scope (org-add-archive-files scope)))
+ ((eq scope 'file)
+ (setq scope (and buffer-file-name (list buffer-file-name))))
+ ((eq scope 'file-with-archives)
+ (setq scope (org-add-archive-files (list (buffer-file-name))))))
+ (org-agenda-prepare-buffers scope)
+ (dolist (file scope)
+ (with-current-buffer (org-find-base-buffer-visiting file)
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (setq res
+ (append
+ res
+ (org-scan-tags
+ func matcher org--matcher-tags-todo-only)))))))))
+ res)))
+
+;;; Properties API
+
+(defconst org-special-properties
+ '("ALLTAGS" "BLOCKED" "CLOCKSUM" "CLOCKSUM_T" "CLOSED" "DEADLINE" "FILE"
+ "ITEM" "PRIORITY" "SCHEDULED" "TAGS" "TIMESTAMP" "TIMESTAMP_IA" "TODO")
+ "The special properties valid in Org mode.
+These are properties that are not defined in the property drawer,
+but in some other way.")
+
+(defconst org-default-properties
+ '("ARCHIVE" "CATEGORY" "SUMMARY" "DESCRIPTION" "CUSTOM_ID"
+ "LOCATION" "LOGGING" "COLUMNS" "VISIBILITY"
+ "TABLE_EXPORT_FORMAT" "TABLE_EXPORT_FILE"
+ "EXPORT_OPTIONS" "EXPORT_TEXT" "EXPORT_FILE_NAME"
+ "EXPORT_TITLE" "EXPORT_AUTHOR" "EXPORT_DATE" "UNNUMBERED"
+ "ORDERED" "NOBLOCKING" "COOKIE_DATA" "LOG_INTO_DRAWER" "REPEAT_TO_STATE"
+ "CLOCK_MODELINE_TOTAL" "STYLE" "HTML_CONTAINER_CLASS")
+ "Some properties that are used by Org mode for various purposes.
+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."
+ (not
+ (or (equal property "")
+ (string-match-p "\\s-" property))))
+
+(defun org--update-property-plist (key val props)
+ "Associate KEY to VAL in alist PROPS.
+Modifications are made by side-effect. Return new alist."
+ (let* ((appending (string= (substring key -1) "+"))
+ (key (if appending (substring key 0 -1) key))
+ (old (assoc-string key props t)))
+ (if (not old) (cons (cons key val) props)
+ (setcdr old (if appending (concat (cdr old) " " val) val))
+ props)))
+
+(defun org-get-property-block (&optional beg force)
+ "Return the (beg . end) range of the body of the property drawer.
+BEG is the beginning of the current subtree or the beginning of
+the document if before the first headline. If it is not given,
+it will be found. If the drawer does not exist, create it if
+FORCE is non-nil, or return nil."
+ (org-with-wide-buffer
+ (let ((beg (cond (beg (goto-char beg))
+ ((or (not (featurep 'org-inlinetask))
+ (org-inlinetask-in-task-p))
+ (org-back-to-heading-or-point-min t) (point))
+ (t (org-with-limited-levels
+ (org-back-to-heading-or-point-min t))
+ (point)))))
+ ;; Move point to its position according to its positional rules.
+ (cond ((org-before-first-heading-p)
+ (while (and (org-at-comment-p) (bolp)) (forward-line)))
+ (t (forward-line)
+ (when (looking-at-p org-planning-line-re) (forward-line))))
+ (cond ((looking-at org-property-drawer-re)
+ (forward-line)
+ (cons (point) (progn (goto-char (match-end 0))
+ (line-beginning-position))))
+ (force
+ (goto-char beg)
+ (org-insert-property-drawer)
+ (let ((pos (save-excursion (re-search-forward org-property-drawer-re)
+ (line-beginning-position))))
+ (cons pos pos)))))))
+
+(defun org-at-property-drawer-p ()
+ "Non-nil when point is at the first line of a property drawer."
+ (org-with-wide-buffer
+ (beginning-of-line)
+ (and (looking-at org-property-drawer-re)
+ (or (bobp)
+ (progn
+ (forward-line -1)
+ (cond ((org-at-heading-p))
+ ((looking-at org-planning-line-re)
+ (forward-line -1)
+ (org-at-heading-p))
+ ((looking-at org-comment-regexp)
+ (forward-line -1)
+ (while (and (not (bobp)) (looking-at org-comment-regexp))
+ (forward-line -1))
+ (looking-at org-comment-regexp))
+ (t nil)))))))
+
+(defun org-at-property-p ()
+ "Non-nil when point is inside a property drawer.
+See `org-property-re' for match data, if applicable."
+ (save-excursion
+ (beginning-of-line)
+ (and (looking-at org-property-re)
+ (let ((property-drawer (save-match-data (org-get-property-block))))
+ (and property-drawer
+ (>= (point) (car property-drawer))
+ (< (point) (cdr property-drawer)))))))
+
+(defun org-property-action ()
+ "Do an action on properties."
+ (interactive)
+ (message "Property Action: [s]et [d]elete [D]elete globally [c]ompute")
+ (let ((c (read-char-exclusive)))
+ (cl-case c
+ (?s (call-interactively #'org-set-property))
+ (?d (call-interactively #'org-delete-property))
+ (?D (call-interactively #'org-delete-property-globally))
+ (?c (call-interactively #'org-compute-property-at-point))
+ (otherwise (user-error "No such property action %c" c)))))
+
+(defun org-inc-effort ()
+ "Increment the value of the effort property in the current entry."
+ (interactive)
+ (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 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."
+ (interactive "P")
+ (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))))))
+ ;; Test whether the value can be interpreted as a duration before
+ ;; inserting it in the buffer:
+ (org-duration-to-minutes value)
+ ;; Maybe update the effort value:
+ (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 value)
+ (org-clock-update-mode-line))
+ (message "%s is now %s" org-effort-property value)))
+
+(defun org-entry-properties (&optional pom which)
+ "Get all properties of the current entry.
+
+When POM is a buffer position, get all properties from the entry
+there instead.
+
+This includes the TODO keyword, the tags, time strings for
+deadline, scheduled, and clocking, and any additional properties
+defined in the entry.
+
+If WHICH is nil or `all', get all properties. If WHICH is
+`special' or `standard', only get that subclass. If WHICH is
+a string, only get that property.
+
+Return value is an alist. Keys are properties, as upcased
+strings."
+ (org-with-point-at pom
+ (when (and (derived-mode-p 'org-mode)
+ (org-back-to-heading-or-point-min t))
+ (catch 'exit
+ (let* ((beg (point))
+ (specific (and (stringp which) (upcase which)))
+ (which (cond ((not specific) which)
+ ((member specific org-special-properties) 'special)
+ (t 'standard)))
+ props)
+ ;; Get the special properties, like TODO and TAGS.
+ (when (memq which '(nil all special))
+ (when (or (not specific) (string= specific "CLOCKSUM"))
+ (let ((clocksum (get-text-property (point) :org-clock-minutes)))
+ (when clocksum
+ (push (cons "CLOCKSUM" (org-duration-from-minutes clocksum))
+ props)))
+ (when specific (throw 'exit props)))
+ (when (or (not specific) (string= specific "CLOCKSUM_T"))
+ (let ((clocksumt (get-text-property (point)
+ :org-clock-minutes-today)))
+ (when clocksumt
+ (push (cons "CLOCKSUM_T"
+ (org-duration-from-minutes clocksumt))
+ props)))
+ (when specific (throw 'exit props)))
+ (when (or (not specific) (string= specific "ITEM"))
+ (let ((case-fold-search nil))
+ (when (looking-at org-complex-heading-regexp)
+ (push (cons "ITEM"
+ (let ((title (match-string-no-properties 4)))
+ (if (org-string-nw-p title)
+ (org-remove-tabs title)
+ "")))
+ props)))
+ (when specific (throw 'exit props)))
+ (when (or (not specific) (string= specific "TODO"))
+ (let ((case-fold-search nil))
+ (when (and (looking-at org-todo-line-regexp) (match-end 2))
+ (push (cons "TODO" (match-string-no-properties 2)) props)))
+ (when specific (throw 'exit props)))
+ (when (or (not specific) (string= specific "PRIORITY"))
+ (push (cons "PRIORITY"
+ (if (looking-at org-priority-regexp)
+ (match-string-no-properties 2)
+ (char-to-string org-priority-default)))
+ props)
+ (when specific (throw 'exit props)))
+ (when (or (not specific) (string= specific "FILE"))
+ (push (cons "FILE" (buffer-file-name (buffer-base-buffer)))
+ props)
+ (when specific (throw 'exit props)))
+ (when (or (not specific) (string= specific "TAGS"))
+ (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 ((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"))
+ (push (cons "BLOCKED" (if (org-entry-blocked-p) "t" "")) props)
+ (when specific (throw 'exit props)))
+ (when (or (not specific)
+ (member specific '("CLOSED" "DEADLINE" "SCHEDULED")))
+ (forward-line)
+ (when (looking-at-p org-planning-line-re)
+ (end-of-line)
+ (let ((bol (line-beginning-position))
+ ;; Backward compatibility: time keywords used to
+ ;; be configurable (before 8.3). Make sure we
+ ;; get the correct keyword.
+ (key-assoc `(("CLOSED" . ,org-closed-string)
+ ("DEADLINE" . ,org-deadline-string)
+ ("SCHEDULED" . ,org-scheduled-string))))
+ (dolist (pair (if specific (list (assoc specific key-assoc))
+ key-assoc))
+ (save-excursion
+ (when (search-backward (cdr pair) bol t)
+ (goto-char (match-end 0))
+ (skip-chars-forward " \t")
+ (and (looking-at org-ts-regexp-both)
+ (push (cons (car pair)
+ (match-string-no-properties 0))
+ props)))))))
+ (when specific (throw 'exit props)))
+ (when (or (not specific)
+ (member specific '("TIMESTAMP" "TIMESTAMP_IA")))
+ (let ((find-ts
+ (lambda (end ts)
+ ;; Fix next time-stamp before END. TS is the
+ ;; list of time-stamps found so far.
+ (let ((ts ts)
+ (regexp (cond
+ ((string= specific "TIMESTAMP")
+ org-ts-regexp)
+ ((string= specific "TIMESTAMP_IA")
+ org-ts-regexp-inactive)
+ ((assoc "TIMESTAMP_IA" ts)
+ org-ts-regexp)
+ ((assoc "TIMESTAMP" ts)
+ org-ts-regexp-inactive)
+ (t org-ts-regexp-both))))
+ (catch 'next
+ (while (re-search-forward regexp end t)
+ (backward-char)
+ (let ((object (org-element-context)))
+ ;; Accept to match timestamps in node
+ ;; properties, too.
+ (when (memq (org-element-type object)
+ '(node-property timestamp))
+ (let ((type
+ (org-element-property :type object)))
+ (cond
+ ((and (memq type '(active active-range))
+ (not (equal specific "TIMESTAMP_IA")))
+ (unless (assoc "TIMESTAMP" ts)
+ (push (cons "TIMESTAMP"
+ (org-element-property
+ :raw-value object))
+ ts)
+ (when specific (throw 'exit ts))))
+ ((and (memq type '(inactive inactive-range))
+ (not (string= specific "TIMESTAMP")))
+ (unless (assoc "TIMESTAMP_IA" ts)
+ (push (cons "TIMESTAMP_IA"
+ (org-element-property
+ :raw-value object))
+ ts)
+ (when specific (throw 'exit ts))))))
+ ;; Both timestamp types are found,
+ ;; move to next part.
+ (when (= (length ts) 2) (throw 'next ts)))))
+ ts)))))
+ (goto-char beg)
+ ;; First look for timestamps within headline.
+ (let ((ts (funcall find-ts (line-end-position) nil)))
+ (if (= (length ts) 2) (setq props (nconc ts props))
+ ;; Then find timestamps in the section, skipping
+ ;; planning line.
+ (let ((end (save-excursion (outline-next-heading))))
+ (forward-line)
+ (when (looking-at-p org-planning-line-re) (forward-line))
+ (setq props (nconc (funcall find-ts end ts) props))))))))
+ ;; Get the standard properties, like :PROP:.
+ (when (memq which '(nil all standard))
+ ;; If we are looking after a specific property, delegate
+ ;; to `org-entry-get', which is faster. However, make an
+ ;; exception for "CATEGORY", since it can be also set
+ ;; through keywords (i.e. #+CATEGORY).
+ (if (and specific (not (equal specific "CATEGORY")))
+ (let ((value (org-entry-get beg specific nil t)))
+ (throw 'exit (and value (list (cons specific value)))))
+ (let ((range (org-get-property-block beg)))
+ (when range
+ (let ((end (cdr range)) seen-base)
+ (goto-char (car range))
+ ;; Unlike to `org--update-property-plist', we
+ ;; handle the case where base values is found
+ ;; after its extension. We also forbid standard
+ ;; properties to be named as special properties.
+ (while (re-search-forward org-property-re end t)
+ (let* ((key (upcase (match-string-no-properties 2)))
+ (extendp (string-match-p "\\+\\'" key))
+ (key-base (if extendp (substring key 0 -1) key))
+ (value (match-string-no-properties 3)))
+ (cond
+ ((member-ignore-case key-base org-special-properties))
+ (extendp
+ (setq props
+ (org--update-property-plist key value props)))
+ ((member key seen-base))
+ (t (push key seen-base)
+ (let ((p (assoc-string key props t)))
+ (if p (setcdr p (concat value " " (cdr p)))
+ (push (cons key value) props))))))))))))
+ (unless (assoc "CATEGORY" props)
+ (push (cons "CATEGORY" (org-get-category beg)) props)
+ (when (string= specific "CATEGORY") (throw 'exit props)))
+ ;; Return value.
+ props)))))
+
+(defun org--property-local-values (property literal-nil)
+ "Return value for PROPERTY in current entry.
+Value is a list whose car is the base value for PROPERTY and cdr
+a list of accumulated values. Return nil if neither is found in
+the entry. Also return nil when PROPERTY is set to \"nil\",
+unless LITERAL-NIL is non-nil."
+ (let ((range (org-get-property-block)))
+ (when range
+ (goto-char (car range))
+ (let* ((case-fold-search t)
+ (end (cdr range))
+ (value
+ ;; Base value.
+ (save-excursion
+ (let ((v (and (re-search-forward
+ (org-re-property property nil t) end t)
+ (match-string-no-properties 3))))
+ (list (if literal-nil v (org-not-nil v)))))))
+ ;; Find additional values.
+ (let* ((property+ (org-re-property (concat property "+") nil t)))
+ (while (re-search-forward property+ end t)
+ (push (match-string-no-properties 3) value)))
+ ;; Return final values.
+ (and (not (equal value '(nil))) (nreverse value))))))
+
+(defun org--property-global-or-keyword-value (property literal-nil)
+ "Return value for PROPERTY as defined by global properties or by keyword.
+Return value is a string. Return nil if property is not set
+globally or by keyword. Also return nil when PROPERTY is set to
+\"nil\", unless LITERAL-NIL is non-nil."
+ (let ((global
+ (cdr (or (assoc-string property org-keyword-properties t)
+ (assoc-string property org-global-properties t)
+ (assoc-string property org-global-properties-fixed t)))))
+ (if literal-nil global (org-not-nil global))))
+
+(defun org-entry-get (pom property &optional inherit literal-nil)
+ "Get value of PROPERTY for entry or content at point-or-marker POM.
+
+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 only if the setting in
+`org-use-property-inheritance' selects PROPERTY for inheritance.
+
+If the property is present but empty, the return value is the
+empty string. If the property is not present at all, nil is
+returned. In any other case, return the value as a string.
+Search is case-insensitive.
+
+If LITERAL-NIL is set, return the string value \"nil\" as
+a string, do not interpret it as the list atom nil. This is used
+for inheritance when a \"nil\" value can supersede a non-nil
+value higher up the hierarchy."
+ (org-with-point-at pom
+ (cond
+ ((member-ignore-case property (cons "CATEGORY" org-special-properties))
+ ;; We need a special property. Use `org-entry-properties' to
+ ;; retrieve it, but specify the wanted property.
+ (cdr (assoc-string property (org-entry-properties nil property))))
+ ((and inherit
+ (or (not (eq inherit 'selective)) (org-property-inherit-p property)))
+ (org-entry-get-with-inheritance property literal-nil))
+ (t
+ (let* ((local (org--property-local-values property literal-nil))
+ (value (and local (mapconcat #'identity (delq nil local) " "))))
+ (if literal-nil value (org-not-nil value)))))))
+
+(defun org-property-or-variable-value (var &optional inherit)
+ "Check if there is a property fixing the value of VAR.
+If yes, return this value. If not, return the current value of the variable."
+ (let ((prop (org-entry-get nil (symbol-name var) inherit)))
+ (if (and prop (stringp prop) (string-match "\\S-" prop))
+ (read prop)
+ (symbol-value var))))
+
+(defun org-entry-delete (pom property)
+ "Delete PROPERTY from entry at point-or-marker POM.
+Accumulated properties, i.e. PROPERTY+, are also removed. Return
+non-nil when a property was removed."
+ (org-with-point-at pom
+ (pcase (org-get-property-block)
+ (`(,begin . ,origin)
+ (let* ((end (copy-marker origin))
+ (re (org-re-property
+ (concat (regexp-quote property) "\\+?") t t)))
+ (goto-char begin)
+ (while (re-search-forward re end t)
+ (delete-region (match-beginning 0) (line-beginning-position 2)))
+ ;; If drawer is empty, remove it altogether.
+ (when (= begin end)
+ (delete-region (line-beginning-position 0)
+ (line-beginning-position 2)))
+ ;; Return non-nil if some property was removed.
+ (prog1 (/= end origin) (set-marker end nil))))
+ (_ nil))))
+
+;; Multi-values properties are properties that contain multiple values
+;; These values are assumed to be single words, separated by whitespace.
+(defun org-entry-add-to-multivalued-property (pom property value)
+ "Add VALUE to the words in the PROPERTY in entry at point-or-marker POM."
+ (let* ((old (org-entry-get pom property))
+ (values (and old (split-string old))))
+ (setq value (org-entry-protect-space value))
+ (unless (member value values)
+ (setq values (append values (list value)))
+ (org-entry-put pom property (mapconcat #'identity values " ")))))
+
+(defun org-entry-remove-from-multivalued-property (pom property value)
+ "Remove VALUE from words in the PROPERTY in entry at point-or-marker POM."
+ (let* ((old (org-entry-get pom property))
+ (values (and old (split-string old))))
+ (setq value (org-entry-protect-space value))
+ (when (member value values)
+ (setq values (delete value values))
+ (org-entry-put pom property (mapconcat #'identity values " ")))))
+
+(defun org-entry-member-in-multivalued-property (pom property value)
+ "Is VALUE one of the words in the PROPERTY in entry at point-or-marker POM?"
+ (let* ((old (org-entry-get pom property))
+ (values (and old (split-string old))))
+ (setq value (org-entry-protect-space value))
+ (member value values)))
+
+(defun org-entry-get-multivalued-property (pom property)
+ "Return a list of values in a multivalued property."
+ (let* ((value (org-entry-get pom property))
+ (values (and value (split-string value))))
+ (mapcar #'org-entry-restore-space values)))
+
+(defun org-entry-put-multivalued-property (pom property &rest values)
+ "Set multivalued PROPERTY at point-or-marker POM to VALUES.
+VALUES should be a list of strings. Spaces will be protected."
+ (org-entry-put pom property (mapconcat #'org-entry-protect-space values " "))
+ (let* ((value (org-entry-get pom property))
+ (values (and value (split-string value))))
+ (mapcar #'org-entry-restore-space values)))
+
+(defun org-entry-protect-space (s)
+ "Protect spaces and newline in string S."
+ (while (string-match " " s)
+ (setq s (replace-match "%20" t t s)))
+ (while (string-match "\n" s)
+ (setq s (replace-match "%0A" t t s)))
+ s)
+
+(defun org-entry-restore-space (s)
+ "Restore spaces and newline in string S."
+ (while (string-match "%20" s)
+ (setq s (replace-match " " t t s)))
+ (while (string-match "%0A" s)
+ (setq s (replace-match "\n" t t s)))
+ s)
+
+(defvar org-entry-property-inherited-from (make-marker)
+ "Marker pointing to the entry from where a property was inherited.
+Each call to `org-entry-get-with-inheritance' will set this marker to the
+location of the entry where the inheritance search matched. If there was
+no match, the marker will point nowhere.
+Note that also `org-entry-get' calls this function, if the INHERIT flag
+is set.")
+
+(defun org-entry-get-with-inheritance (property &optional literal-nil)
+ "Get PROPERTY of entry or content at point, search higher levels if needed.
+The search will stop at the first ancestor which has the property defined.
+If the value found is \"nil\", return nil to show that the property
+should be considered as undefined (this is the meaning of nil here).
+However, if LITERAL-NIL is set, return the string value \"nil\" instead."
+ (move-marker org-entry-property-inherited-from nil)
+ (org-with-wide-buffer
+ (let (value)
+ (catch 'exit
+ (while t
+ (let ((v (org--property-local-values property literal-nil)))
+ (when v
+ (setq value
+ (concat (mapconcat #'identity (delq nil v) " ")
+ (and value " ")
+ value)))
+ (cond
+ ((car v)
+ (org-back-to-heading-or-point-min t)
+ (move-marker org-entry-property-inherited-from (point))
+ (throw 'exit nil))
+ ((org-up-heading-or-point-min))
+ (t
+ (let ((global (org--property-global-or-keyword-value property literal-nil)))
+ (cond ((not global))
+ (value (setq value (concat global " " value)))
+ (t (setq value global))))
+ (throw 'exit nil))))))
+ (if literal-nil value (org-not-nil value)))))
+
+(defvar org-property-changed-functions nil
+ "Hook called when the value of a property has changed.
+Each hook function should accept two arguments, the name of the property
+and the new value.")
+
+(defun org-entry-put (pom property value)
+ "Set PROPERTY to VALUE for entry at point-or-marker POM.
+
+If the value is nil, it is converted to the empty string. If it
+is not a string, an error is raised. Also raise an error on
+invalid property names.
+
+PROPERTY can be any regular property (see
+`org-special-properties'). It can also be \"TODO\",
+\"PRIORITY\", \"SCHEDULED\" and \"DEADLINE\".
+
+For the last two properties, VALUE may have any of the special
+values \"earlier\" and \"later\". The function then increases or
+decreases scheduled or deadline date by one day."
+ (cond ((null value) (setq value ""))
+ ((not (stringp value)) (error "Properties values should be strings"))
+ ((not (org--valid-property-p property))
+ (user-error "Invalid property name: \"%s\"" property)))
+ (org-no-read-only
+ (org-with-point-at pom
+ (if (or (not (featurep 'org-inlinetask)) (org-inlinetask-in-task-p))
+ (org-back-to-heading-or-point-min t)
+ (org-with-limited-levels (org-back-to-heading-or-point-min t)))
+ (let ((beg (point)))
+ (cond
+ ((equal property "TODO")
+ (cond ((not (org-string-nw-p value)) (setq value 'none))
+ ((not (member value org-todo-keywords-1))
+ (user-error "\"%s\" is not a valid TODO state" value)))
+ (org-todo value)
+ (org-align-tags))
+ ((equal property "PRIORITY")
+ (org-priority (if (org-string-nw-p value) (string-to-char value) ?\s))
+ (org-align-tags))
+ ((equal property "SCHEDULED")
+ (forward-line)
+ (if (and (looking-at-p org-planning-line-re)
+ (re-search-forward
+ org-scheduled-time-regexp (line-end-position) t))
+ (cond ((string= value "earlier") (org-timestamp-change -1 'day))
+ ((string= value "later") (org-timestamp-change 1 'day))
+ ((string= value "") (org-schedule '(4)))
+ (t (org-schedule nil value)))
+ (if (member value '("earlier" "later" ""))
+ (call-interactively #'org-schedule)
+ (org-schedule nil value))))
+ ((equal property "DEADLINE")
+ (forward-line)
+ (if (and (looking-at-p org-planning-line-re)
+ (re-search-forward
+ org-deadline-time-regexp (line-end-position) t))
+ (cond ((string= value "earlier") (org-timestamp-change -1 'day))
+ ((string= value "later") (org-timestamp-change 1 'day))
+ ((string= value "") (org-deadline '(4)))
+ (t (org-deadline nil value)))
+ (if (member value '("earlier" "later" ""))
+ (call-interactively #'org-deadline)
+ (org-deadline nil value))))
+ ((member property org-special-properties)
+ (error "The %s property cannot be set with `org-entry-put'" property))
+ (t
+ (let* ((range (org-get-property-block beg 'force))
+ (end (cdr range))
+ (case-fold-search t))
+ (goto-char (car range))
+ (if (re-search-forward (org-re-property property nil t) end t)
+ (progn (delete-region (match-beginning 0) (match-end 0))
+ (goto-char (match-beginning 0)))
+ (goto-char end)
+ (insert "\n")
+ (backward-char))
+ (insert ":" property ":")
+ (when value (insert " " value))
+ (org-indent-line)))))
+ (run-hook-with-args 'org-property-changed-functions property value))))
+
+(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
+reflect things like tags and TODO state.
+
+When DEFAULTS is non-nil, also include properties that has
+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."
+ (let ((case-fold-search t)
+ (props (append
+ (and specials org-special-properties)
+ (and defaults (cons org-effort-property org-default-properties))
+ ;; Get property names from #+PROPERTY keywords as well
+ (mapcar (lambda (s)
+ (nth 0 (split-string s)))
+ (cdar (org-collect-keywords '("PROPERTY")))))))
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (while (re-search-forward org-property-start-re nil t)
+ (catch :skip
+ (let ((range (org-get-property-block)))
+ (unless range (throw :skip nil))
+ (goto-char (car range))
+ (let ((begin (car range))
+ (end (cdr range)))
+ ;; Make sure that found property block is not located
+ ;; before current point, as it would generate an infloop.
+ ;; It can happen, for example, in the following
+ ;; situation:
+ ;;
+ ;; * Headline
+ ;; :PROPERTIES:
+ ;; ...
+ ;; :END:
+ ;; *************** Inlinetask
+ ;; #+BEGIN_EXAMPLE
+ ;; :PROPERTIES:
+ ;; #+END_EXAMPLE
+ ;;
+ (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))))
+ ;; Only add true property name, not extension symbol.
+ (push (if (not (string-match-p "\\+\\'" p)) p
+ (substring p 0 -1))
+ props))
+ (forward-line))))
+ (outline-next-heading)))
+ (when columns
+ (goto-char (point-min))
+ (while (re-search-forward "^[ \t]*\\(?:#\\+\\|:\\)COLUMNS:" nil t)
+ (let ((element (org-element-at-point)))
+ (when (memq (org-element-type element) '(keyword node-property))
+ (let ((value (org-element-property :value element))
+ (start 0))
+ (while (string-match "%[0-9]*\\([[:alnum:]_-]+\\)\\(([^)]+)\\)?\
+\\(?:{[^}]+}\\)?"
+ value start)
+ (setq start (match-end 0))
+ (let ((p (match-string-no-properties 1 value)))
+ (unless (member-ignore-case p org-special-properties)
+ (push p props))))))))))
+ (sort (delete-dups
+ (append props
+ ;; for each xxx_ALL property, make sure the bare
+ ;; xxx property is also included
+ (delq nil (mapcar (lambda (p)
+ (and (string-match-p "._ALL\\'" p)
+ (substring p 0 -4)))
+ props))))
+ (lambda (a b) (string< (upcase a) (upcase b))))))
+
+(defun org-property-values (key)
+ "List all non-nil values of property KEY in current buffer."
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (let ((case-fold-search t)
+ (re (org-re-property key))
+ values)
+ (while (re-search-forward re nil t)
+ (push (org-entry-get (point) key) values))
+ (delete-dups values))))
+
+(defun org-insert-property-drawer ()
+ "Insert a property drawer into the current entry.
+Do nothing if the drawer already exists. The newly created
+drawer is immediately hidden."
+ (org-with-wide-buffer
+ ;; Set point to the position where the drawer should be inserted.
+ (if (or (not (featurep 'org-inlinetask)) (org-inlinetask-in-task-p))
+ (org-back-to-heading-or-point-min t)
+ (org-with-limited-levels (org-back-to-heading-or-point-min t)))
+ (if (org-before-first-heading-p)
+ (while (and (org-at-comment-p) (bolp)) (forward-line))
+ (progn
+ (forward-line)
+ (when (looking-at-p org-planning-line-re) (forward-line))))
+ (unless (looking-at-p org-property-drawer-re)
+ ;; Make sure we start editing a line from current entry, not from
+ ;; next one. It prevents extending text properties or overlays
+ ;; belonging to the latter.
+ (when (and (bolp) (> (point) (point-min))) (backward-char))
+ (let ((begin (if (bobp) (point) (1+ (point))))
+ (inhibit-read-only t))
+ (unless (bobp) (insert "\n"))
+ (insert ":PROPERTIES:\n:END:")
+ (org-flag-region (line-end-position 0) (point) t 'outline)
+ (when (or (eobp) (= begin (point-min))) (insert "\n"))
+ (org-indent-region begin (point))))))
+
+(defun org-insert-drawer (&optional arg drawer)
+ "Insert a drawer at point.
+
+When optional argument ARG is non-nil, insert a property drawer.
+
+Optional argument DRAWER, when non-nil, is a string representing
+drawer's name. Otherwise, the user is prompted for a name.
+
+If a region is active, insert the drawer around that region
+instead.
+
+Point is left between drawer's boundaries."
+ (interactive "P")
+ (let* ((drawer (if arg "PROPERTIES"
+ (or drawer (read-from-minibuffer "Drawer: ")))))
+ (cond
+ ;; With C-u, fall back on `org-insert-property-drawer'
+ (arg (org-insert-property-drawer))
+ ;; Check validity of suggested drawer's name.
+ ((not (string-match-p org-drawer-regexp (format ":%s:" drawer)))
+ (user-error "Invalid drawer name"))
+ ;; With an active region, insert a drawer at point.
+ ((not (org-region-active-p))
+ (progn
+ (unless (bolp) (insert "\n"))
+ (insert (format ":%s:\n\n:END:\n" drawer))
+ (forward-line -2)))
+ ;; Otherwise, insert the drawer at point
+ (t
+ (let ((rbeg (region-beginning))
+ (rend (copy-marker (region-end))))
+ (unwind-protect
+ (progn
+ (goto-char rbeg)
+ (beginning-of-line)
+ (when (save-excursion
+ (re-search-forward org-outline-regexp-bol rend t))
+ (user-error "Drawers cannot contain headlines"))
+ ;; Position point at the beginning of the first
+ ;; non-blank line in region. Insert drawer's opening
+ ;; there, then indent it.
+ (org-skip-whitespace)
+ (beginning-of-line)
+ (insert ":" drawer ":\n")
+ (forward-line -1)
+ (indent-for-tab-command)
+ ;; Move point to the beginning of the first blank line
+ ;; after the last non-blank line in region. Insert
+ ;; drawer's closing, then indent it.
+ (goto-char rend)
+ (skip-chars-backward " \r\t\n")
+ (insert "\n:END:")
+ (deactivate-mark t)
+ (indent-for-tab-command)
+ (unless (eolp) (insert "\n")))
+ ;; Clear marker, whatever the outcome of insertion is.
+ (set-marker rend nil)))))))
+
+(defvar org-property-set-functions-alist nil
+ "Property set function alist.
+Each entry should have the following format:
+
+ (PROPERTY . READ-FUNCTION)
+
+The read function will be called with the same argument as
+`org-completing-read'.")
+
+(defun org-set-property-function (property)
+ "Get the function that should be used to set PROPERTY.
+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 &optional pom default)
+ "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.
+Optional argument DEFAULT provides a default value for PROPERTY."
+ (let* ((completion-ignore-case t)
+ (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)))
+ default nil default)
+ (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)
+(defun org-read-property-name ()
+ "Read a property name."
+ (let ((completion-ignore-case t)
+ (default-prop (or (and (org-at-property-p)
+ (match-string-no-properties 2))
+ org-last-set-property)))
+ (org-completing-read
+ (concat "Property"
+ (if default-prop (concat " [" default-prop "]") "")
+ ": ")
+ (mapcar #'list (org-buffer-property-keys nil t t))
+ nil nil nil nil default-prop)))
+
+(defun org-set-property-and-value (use-last)
+ "Allow to set [PROPERTY]: [value] direction from prompt.
+When use-default, don't even ask, just use the last
+\"[PROPERTY]: [value]\" string from the history."
+ (interactive "P")
+ (let* ((completion-ignore-case t)
+ (pv (or (and use-last org-last-set-property-value)
+ (org-completing-read
+ "Enter a \"[Property]: [value]\" pair: "
+ nil nil nil nil nil
+ org-last-set-property-value)))
+ prop val)
+ (when (string-match "^[ \t]*\\([^:]+\\):[ \t]*\\(.*\\)[ \t]*$" pv)
+ (setq prop (match-string 1 pv)
+ val (match-string 2 pv))
+ (org-set-property prop val))))
+
+(defun org-set-property (property value)
+ "In the current entry, set PROPERTY to VALUE.
+
+When called interactively, this will prompt for a property name, offering
+completion on existing and default properties. And then it will prompt
+for a value, offering completion either on allowed values (via an inherited
+xxx_ALL property) or on existing values in other instances of this property
+in the current file.
+
+Throw an error when trying to set a property with an invalid name."
+ (interactive (list nil nil))
+ (let ((property (or property (org-read-property-name))))
+ ;; `org-entry-put' also makes the following check, but this one
+ ;; avoids polluting `org-last-set-property' and
+ ;; `org-last-set-property-value' needlessly.
+ (unless (org--valid-property-p property)
+ (user-error "Invalid property name: \"%s\"" property))
+ (let ((value (or value (org-read-property-value property)))
+ (fn (cdr (assoc-string property org-properties-postprocess-alist t))))
+ (setq org-last-set-property property)
+ (setq org-last-set-property-value (concat property ": " value))
+ ;; Possibly postprocess the inserted value:
+ (when fn (setq value (funcall fn value)))
+ (unless (equal (org-entry-get nil property) value)
+ (org-entry-put nil property value)))))
+
+(defun org-find-property (property &optional value)
+ "Find first entry in buffer that sets PROPERTY.
+
+When optional argument VALUE is non-nil, only consider an entry
+if it contains PROPERTY set to this value. If PROPERTY should be
+explicitly set to nil, use string \"nil\" for VALUE.
+
+Return position where the entry begins, or nil if there is no
+such entry. If narrowing is in effect, only search the visible
+part of the buffer."
+ (save-excursion
+ (goto-char (point-min))
+ (let ((case-fold-search t)
+ (re (org-re-property property nil (not value) value)))
+ (catch 'exit
+ (while (re-search-forward re nil t)
+ (when (if value (org-at-property-p)
+ (org-entry-get (point) property nil t))
+ (throw 'exit (progn (org-back-to-heading-or-point-min t)
+ (point)))))))))
+
+(defun org-delete-property (property)
+ "In the current entry, delete PROPERTY."
+ (interactive
+ (let* ((completion-ignore-case t)
+ (cat (org-entry-get (point) "CATEGORY"))
+ (props0 (org-entry-properties nil 'standard))
+ (props (if cat props0
+ (delete `("CATEGORY" . ,(org-get-category)) props0)))
+ (prop (if (< 1 (length props))
+ (completing-read "Property: " props nil t)
+ (caar props))))
+ (list prop)))
+ (if (not property)
+ (message "No property to delete in this entry")
+ (org-entry-delete nil property)
+ (message "Property \"%s\" deleted" property)))
+
+(defun org-delete-property-globally (property)
+ "Remove PROPERTY globally, from all entries.
+This function ignores narrowing, if any."
+ (interactive
+ (let* ((completion-ignore-case t)
+ (prop (completing-read
+ "Globally remove property: "
+ (mapcar #'list (org-buffer-property-keys)))))
+ (list prop)))
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (let ((count 0)
+ (re (org-re-property (concat (regexp-quote property) "\\+?") t t)))
+ (while (re-search-forward re nil t)
+ (when (org-entry-delete (point) property) (cl-incf count)))
+ (message "Property \"%s\" removed from %d entries" property count))))
+
+(defvar org-columns-current-fmt-compiled) ; defined in org-colview.el
+
+(defun org-compute-property-at-point ()
+ "Compute the property at point.
+This looks for an enclosing column format, extracts the operator and
+then applies it to the property in the column format's scope."
+ (interactive)
+ (unless (org-at-property-p)
+ (user-error "Not at a property"))
+ (let ((prop (match-string-no-properties 2)))
+ (org-columns-get-format-and-top-level)
+ (unless (nth 3 (assoc-string prop org-columns-current-fmt-compiled t))
+ (user-error "No operator defined for property %s" prop))
+ (org-columns-compute prop)))
+
+(defvar org-property-allowed-value-functions nil
+ "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, this means that these values are intended as defaults for
+completion, but that other values should be allowed too.
+The functions must return nil if they are not responsible for this
+property.")
+
+(defun org-property-get-allowed-values (pom property &optional table)
+ "Get allowed values for the property PROPERTY.
+When TABLE is non-nil, return an alist that can directly be used for
+completion."
+ (let (vals)
+ (cond
+ ((equal property "TODO")
+ (setq vals (org-with-point-at pom
+ (append org-todo-keywords-1 '("")))))
+ ((equal property "PRIORITY")
+ (let ((n org-priority-lowest))
+ (while (>= n org-priority-highest)
+ (push (char-to-string n) vals)
+ (setq n (1- n)))))
+ ((equal property "CATEGORY"))
+ ((member property org-special-properties))
+ ((setq vals (run-hook-with-args-until-success
+ 'org-property-allowed-value-functions property)))
+ (t
+ (setq vals (org-entry-get pom (concat property "_ALL") 'inherit))
+ (when (and vals (string-match "\\S-" vals))
+ (setq vals (car (read-from-string (concat "(" vals ")"))))
+ (setq vals (mapcar (lambda (x)
+ (cond ((stringp x) x)
+ ((numberp x) (number-to-string x))
+ ((symbolp x) (symbol-name x))
+ (t "???")))
+ vals)))))
+ (when (member ":ETC" vals)
+ (setq vals (remove ":ETC" vals))
+ (org-add-props (car vals) '(org-unrestricted t)))
+ (if table (mapcar 'list vals) vals)))
+
+(defun org-property-previous-allowed-value (&optional _previous)
+ "Switch to the next allowed value for this property."
+ (interactive)
+ (org-property-next-allowed-value t))
+
+(defun org-property-next-allowed-value (&optional previous)
+ "Switch to the next allowed value for this property."
+ (interactive)
+ (unless (org-at-property-p)
+ (user-error "Not at a property"))
+ (let* ((prop (car (save-match-data (org-split-string (match-string 1) ":"))))
+ (key (match-string 2))
+ (value (match-string 3))
+ (allowed (or (org-property-get-allowed-values (point) key)
+ (and (member value '("[ ]" "[-]" "[X]"))
+ '("[ ]" "[X]"))))
+ (heading (save-match-data (nth 4 (org-heading-components))))
+ nval)
+ (unless allowed
+ (user-error "Allowed values for this property have not been defined"))
+ (when previous (setq allowed (reverse allowed)))
+ (when (member value allowed)
+ (setq nval (car (cdr (member value allowed)))))
+ (setq nval (or nval (car allowed)))
+ (when (equal nval value)
+ (user-error "Only one allowed value for this property"))
+ (org-at-property-p)
+ (replace-match (concat " :" key ": " nval) t t)
+ (org-indent-line)
+ (beginning-of-line 1)
+ (skip-chars-forward " \t")
+ (when (equal prop org-effort-property)
+ (org-refresh-property
+ '((effort . identity)
+ (effort-minutes . org-duration-to-minutes))
+ nval)
+ (when (string= org-clock-current-task heading)
+ (setq org-clock-effort nval)
+ (org-clock-update-mode-line)))
+ (run-hook-with-args 'org-property-changed-functions key nval)))
+
+(defun org-find-olp (path &optional this-buffer)
+ "Return a marker pointing to the entry at outline path OLP.
+If anything goes wrong, throw an error, and if you need to do
+something based on this error, you can catch it with
+`condition-case'.
+
+If THIS-BUFFER is set, the outline path does not contain a file,
+only headings."
+ (let* ((file (if this-buffer buffer-file-name (pop path)))
+ (buffer (if this-buffer (current-buffer) (find-file-noselect file)))
+ (level 1)
+ (lmin 1)
+ (lmax 1)
+ end found flevel)
+ (unless buffer (error "File not found :%s" file))
+ (with-current-buffer buffer
+ (unless (derived-mode-p 'org-mode)
+ (error "Buffer %s needs to be in Org mode" buffer))
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (dolist (heading path)
+ (let ((re (format org-complex-heading-regexp-format
+ (regexp-quote heading)))
+ (cnt 0))
+ (while (re-search-forward re end t)
+ (setq level (- (match-end 1) (match-beginning 1)))
+ (when (and (>= level lmin) (<= level lmax))
+ (setq found (match-beginning 0) flevel level cnt (1+ cnt))))
+ (when (= cnt 0)
+ (error "Heading not found on level %d: %s" lmax heading))
+ (when (> cnt 1)
+ (error "Heading not unique on level %d: %s" lmax heading))
+ (goto-char found)
+ (setq lmin (1+ flevel) lmax (+ lmin (if org-odd-levels-only 1 0)))
+ (setq end (save-excursion (org-end-of-subtree t t)))))
+ (when (org-at-heading-p)
+ (point-marker))))))
+
+(defun org-find-exact-headline-in-buffer (heading &optional buffer pos-only)
+ "Find node HEADING in BUFFER.
+Return a marker to the heading if it was found, or nil if not.
+If POS-ONLY is set, return just the position instead of a marker.
+
+The heading text must match exact, but it may have a TODO keyword,
+a priority cookie and tags in the standard locations."
+ (with-current-buffer (or buffer (current-buffer))
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (let (case-fold-search)
+ (when (re-search-forward
+ (format org-complex-heading-regexp-format
+ (regexp-quote heading)) nil t)
+ (if pos-only
+ (match-beginning 0)
+ (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.
+When the target headline is found, return a marker to this location."
+ (let ((files (directory-files (or dir default-directory)
+ t "\\`[^.#].*\\.org\\'"))
+ visiting m buffer)
+ (catch 'found
+ (dolist (file files)
+ (message "trying %s" file)
+ (setq visiting (org-find-base-buffer-visiting file))
+ (setq buffer (or visiting (find-file-noselect file)))
+ (setq m (org-find-exact-headline-in-buffer
+ heading buffer))
+ (when (and (not m) (not visiting)) (kill-buffer buffer))
+ (and m (throw 'found m))))))
+
+(defun org-find-entry-with-id (ident)
+ "Locate the entry that contains the ID property with exact value IDENT.
+IDENT can be a string, a symbol or a number, this function will search for
+the string representation of it.
+Return the position where this entry starts, or nil if there is no such entry."
+ (interactive "sID: ")
+ (let ((id (cond
+ ((stringp ident) ident)
+ ((symbolp ident) (symbol-name ident))
+ ((numberp ident) (number-to-string ident))
+ (t (error "IDENT %s must be a string, symbol or number" ident)))))
+ (org-with-wide-buffer (org-find-property "ID" id))))
+
+;;;; Timestamps
+
+(defvar org-last-changed-timestamp nil)
+(defvar org-last-inserted-timestamp nil
+ "The last time stamp inserted with `org-insert-time-stamp'.")
+
+(defun org-time-stamp (arg &optional inactive)
+ "Prompt for a date/time and insert a time stamp.
+
+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.
+
+All parts of a date not specified by the user are filled in from
+the timestamp at point, if any, or the current date/time
+otherwise.
+
+If there is already a timestamp at the cursor, it is replaced.
+
+With two universal prefix arguments, insert an active timestamp
+with the current time without prompting the user.
+
+When called from Lisp, the timestamp is inactive if INACTIVE is
+non-nil."
+ (interactive "P")
+ (let* ((ts (cond
+ ((org-at-date-range-p t)
+ (match-string (if (< (point) (- (match-beginning 2) 2)) 1 2)))
+ ((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 (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)
+ (match-string 0 ts)))
+ org-time-was-given
+ org-end-time-was-given
+ (time
+ (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))
+ (memq this-command '(org-time-stamp org-time-stamp-inactive)))
+ (insert "--")
+ (org-insert-time-stamp time (or org-time-was-given arg) inactive))
+ (ts
+ ;; Make sure we're on a timestamp. When in the middle of a date
+ ;; range, move arbitrarily to range end.
+ (unless (org-at-timestamp-p 'lax)
+ (skip-chars-forward "-")
+ (org-at-timestamp-p 'lax))
+ (replace-match "")
+ (setq org-last-changed-timestamp
+ (org-insert-time-stamp
+ time (or org-time-was-given arg)
+ inactive nil nil (list org-end-time-was-given)))
+ (when repeater
+ (backward-char)
+ (insert " " repeater)
+ (setq org-last-changed-timestamp
+ (concat (substring org-last-inserted-timestamp 0 -1)
+ " " repeater ">")))
+ (message "Timestamp updated"))
+ ((equal arg '(16)) (org-insert-time-stamp time t inactive))
+ (t (org-insert-time-stamp
+ time (or org-time-was-given arg) inactive nil nil
+ (list org-end-time-was-given))))))
+
+;; FIXME: can we use this for something else, like computing time differences?
+(defun org-get-compact-tod (s)
+ (when (string-match "\\(\\([012]?[0-9]\\):\\([0-5][0-9]\\)\\)\\(-\\(\\([012]?[0-9]\\):\\([0-5][0-9]\\)\\)\\)?" s)
+ (let* ((t1 (match-string 1 s))
+ (h1 (string-to-number (match-string 2 s)))
+ (m1 (string-to-number (match-string 3 s)))
+ (t2 (and (match-end 4) (match-string 5 s)))
+ (h2 (and t2 (string-to-number (match-string 6 s))))
+ (m2 (and t2 (string-to-number (match-string 7 s))))
+ dh dm)
+ (if (not t2)
+ t1
+ (setq dh (- h2 h1) dm (- m2 m1))
+ (when (< dm 0) (setq dm (+ dm 60) dh (1- dh)))
+ (concat t1 "+" (number-to-string dh)
+ (and (/= 0 dm) (format ":%02d" dm)))))))
+
+(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. 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 inactive time stamp
+with the current time without prompting the user."
+ (interactive "P")
+ (org-time-stamp arg 'inactive))
+
+(defvar org-date-ovl (make-overlay 1 1))
+(overlay-put org-date-ovl 'face 'org-date-selected)
+(delete-overlay org-date-ovl)
+
+(defvar org-ans1) ; dynamically scoped parameter
+(defvar org-ans2) ; dynamically scoped parameter
+
+(defvar org-plain-time-of-day-regexp) ; defined below
+
+(defvar org-overriding-default-time nil) ; dynamically scoped
+(defvar org-read-date-overlay nil)
+(defvar org-read-date-history nil)
+(defvar org-read-date-final-answer nil)
+(defvar org-read-date-analyze-futurep nil)
+(defvar org-read-date-analyze-forced-year nil)
+(defvar org-read-date-inactive)
+(defvar org-def)
+(defvar org-defdecode)
+(defvar org-with-time)
+
+(defvar calendar-setup) ; Dynamically scoped.
+(defun org-read-date (&optional with-time to-time from-string prompt
+ default-time default-input inactive)
+ "Read a date, possibly a time, and make things smooth for the user.
+The prompt will suggest to enter an ISO date, but you can also enter anything
+which will at least partially be understood by `parse-time-string'.
+Unrecognized parts of the date will default to the current day, month, year,
+hour and minute. If this command is called to replace a timestamp at point,
+or to enter the second timestamp of a range, the default time is taken
+from the existing stamp. Furthermore, the command prefers the future,
+so if you are giving a date where the year is not given, and the day-month
+combination is already past in the current year, it will assume you
+mean next year. For details, see the manual. A few examples:
+
+ 3-2-5 --> 2003-02-05
+ feb 15 --> currentyear-02-15
+ 2/15 --> currentyear-02-15
+ sep 12 9 --> 2009-09-12
+ 12:45 --> today 12:45
+ 22 sept 0:34 --> currentyear-09-22 0:34
+ 12 --> currentyear-currentmonth-12
+ Fri --> nearest Friday after today
+ -Tue --> last Tuesday
+ etc.
+
+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 days weeks, months, years.
+With a single plus or minus, the date is relative to today. With a double
+plus or minus, it is relative to the date in DEFAULT-TIME. E.g.
+ +4d --> four days from today
+ +4 --> same as above
+ +2w --> two weeks from today
+ ++5 --> five days from default date
+
+The function understands only English month and weekday abbreviations.
+
+While prompting, a calendar is popped up - you can also select the
+date with the mouse (button 1). The calendar shows a period of three
+months. To scroll it to other months, use the keys `>' and `<'.
+If you don't like the calendar, turn it off with
+ (setq org-read-date-popup-calendar nil)
+
+With optional argument TO-TIME, the date will immediately be converted
+to an internal time.
+With an optional argument WITH-TIME, the prompt will suggest to
+also insert a time. Note that when WITH-TIME is not set, you can
+still enter a time, and this function will inform the calling routine
+about this change. The calling routine may then choose to change the
+format used to insert the time stamp into the buffer to include the time.
+With optional argument FROM-STRING, read from this string instead from
+the user. PROMPT can overwrite the default prompt. DEFAULT-TIME is
+the time/date that is used for everything that is not specified by the
+user."
+ (require 'parse-time)
+ (let* ((org-with-time with-time)
+ (org-time-stamp-rounding-minutes
+ (if (equal org-with-time '(16))
+ '(0 0)
+ org-time-stamp-rounding-minutes))
+ (ct (org-current-time))
+ (org-def (or org-overriding-default-time default-time ct))
+ (org-defdecode (decode-time org-def))
+ (cur-frame (selected-frame))
+ (mouse-autoselect-window nil) ; Don't let the mouse jump
+ (calendar-setup
+ (and (eq calendar-setup 'calendar-only) 'calendar-only))
+ (calendar-move-hook nil)
+ (calendar-view-diary-initially-flag nil)
+ (calendar-view-holidays-initially-flag nil)
+ ans (org-ans0 "") org-ans1 org-ans2 final cal-frame)
+ ;; Rationalize `org-def' and `org-defdecode', if required.
+ (when (< (nth 2 org-defdecode) org-extend-today-until)
+ (setf (nth 2 org-defdecode) -1)
+ (setf (nth 1 org-defdecode) 59)
+ (setq org-def (apply #'encode-time org-defdecode))
+ (setq org-defdecode (decode-time org-def)))
+ (let* ((timestr (format-time-string
+ (if org-with-time "%Y-%m-%d %H:%M" "%Y-%m-%d")
+ org-def))
+ (prompt (concat (if prompt (concat prompt " ") "")
+ (format "Date+time [%s]: " timestr))))
+ (cond
+ (from-string (setq ans from-string))
+ (org-read-date-popup-calendar
+ (save-excursion
+ (save-window-excursion
+ (calendar)
+ (when (eq calendar-setup 'calendar-only)
+ (setq cal-frame
+ (window-frame (get-buffer-window "*Calendar*" 'visible)))
+ (select-frame cal-frame))
+ (org-eval-in-calendar '(setq cursor-type nil) t)
+ (unwind-protect
+ (progn
+ (calendar-forward-day (- (time-to-days org-def)
+ (calendar-absolute-from-gregorian
+ (calendar-current-date))))
+ (org-eval-in-calendar nil t)
+ (let* ((old-map (current-local-map))
+ (map (copy-keymap calendar-mode-map))
+ (minibuffer-local-map
+ (copy-keymap org-read-date-minibuffer-local-map)))
+ (org-defkey map (kbd "RET") 'org-calendar-select)
+ (org-defkey map [mouse-1] 'org-calendar-select-mouse)
+ (org-defkey map [mouse-2] 'org-calendar-select-mouse)
+ (unwind-protect
+ (progn
+ (use-local-map map)
+ (setq org-read-date-inactive inactive)
+ (add-hook 'post-command-hook 'org-read-date-display)
+ (setq org-ans0
+ (read-string prompt
+ default-input
+ 'org-read-date-history
+ nil))
+ ;; org-ans0: from prompt
+ ;; org-ans1: from mouse click
+ ;; org-ans2: from calendar motion
+ (setq ans
+ (concat org-ans0 " " (or org-ans1 org-ans2))))
+ (remove-hook 'post-command-hook 'org-read-date-display)
+ (use-local-map old-map)
+ (when org-read-date-overlay
+ (delete-overlay org-read-date-overlay)
+ (setq org-read-date-overlay nil)))))
+ (bury-buffer "*Calendar*")
+ (when cal-frame
+ (delete-frame cal-frame)
+ (select-frame-set-input-focus cur-frame))))))
+
+ (t ; Naked prompt only
+ (unwind-protect
+ (setq ans (read-string prompt default-input
+ 'org-read-date-history timestr))
+ (when org-read-date-overlay
+ (delete-overlay org-read-date-overlay)
+ (setq org-read-date-overlay nil))))))
+
+ (setq final (org-read-date-analyze ans org-def org-defdecode))
+
+ (when org-read-date-analyze-forced-year
+ (message "Year was forced into %s"
+ (if org-read-date-force-compatible-dates
+ "compatible range (1970-2037)"
+ "range representable on this machine"))
+ (ding))
+
+ (setq final (apply #'encode-time final))
+
+ (setq org-read-date-final-answer ans)
+
+ (if to-time
+ 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)
+ (nth 2 final) (nth 1 final))
+ (format "%04d-%02d-%02d" (nth 5 final) (nth 4 final) (nth 3 final))))))
+
+(defun org-read-date-display ()
+ "Display the current date prompt interpretation in the minibuffer."
+ (when org-read-date-display-live
+ (when org-read-date-overlay
+ (delete-overlay org-read-date-overlay))
+ (when (minibufferp (current-buffer))
+ (save-excursion
+ (end-of-line 1)
+ (while (not (equal (buffer-substring
+ (max (point-min) (- (point) 4)) (point))
+ " "))
+ (insert " ")))
+ (let* ((ans (concat (buffer-substring (point-at-bol) (point-max))
+ " " (or org-ans1 org-ans2)))
+ (org-end-time-was-given nil)
+ (f (org-read-date-analyze ans org-def org-defdecode))
+ (fmts (if org-display-custom-times
+ org-time-stamp-custom-formats
+ org-time-stamp-formats))
+ (fmt (if (or org-with-time
+ (and (boundp 'org-time-was-given) org-time-was-given))
+ (cdr fmts)
+ (car fmts)))
+ (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
+ (string-match org-plain-time-of-day-regexp txt))
+ (setq txt (concat (substring txt 0 (match-end 0)) "-"
+ org-end-time-was-given
+ (substring txt (match-end 0)))))
+ (when org-read-date-analyze-futurep
+ (setq txt (concat txt " (=>F)")))
+ (setq org-read-date-overlay
+ (make-overlay (1- (point-at-eol)) (point-at-eol)))
+ (org-overlay-display org-read-date-overlay txt 'secondary-selection)))))
+
+(defun org-read-date-analyze (ans def defdecode)
+ "Analyze the combined answer of the date prompt."
+ ;; FIXME: cleanup and comment
+ (let ((org-def def)
+ (org-defdecode defdecode)
+ (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)
+ (setq org-read-date-analyze-futurep nil
+ org-read-date-analyze-forced-year nil)
+ (when (string-match "\\`[ \t]*\\.[ \t]*\\'" ans)
+ (setq ans "+0"))
+
+ (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)
+ deltadef (nth 2 delta)))
+
+ ;; Check if there is an iso week date in there. If yes, store the
+ ;; info and postpone interpreting it until the rest of the parsing
+ ;; is done.
+ (when (string-match "\\<\\(?:\\([0-9]+\\)-\\)?[wW]\\([0-9]\\{1,2\\}\\)\\(?:-\\([0-6]\\)\\)?\\([ \t]\\|$\\)" ans)
+ (setq iso-year (when (match-end 1)
+ (org-small-year-to-year
+ (string-to-number (match-string 1 ans))))
+ iso-weekday (when (match-end 3)
+ (string-to-number (match-string 3 ans)))
+ iso-week (string-to-number (match-string 2 ans)))
+ (setq ans (replace-match "" t t ans)))
+
+ ;; Help matching ISO dates with single digit month or day, like 2006-8-11.
+ (when (string-match
+ "^ *\\(\\([0-9]+\\)-\\)?\\([0-1]?[0-9]\\)-\\([0-3]?[0-9]\\)\\([^-0-9]\\|$\\)" ans)
+ (setq year (if (match-end 2)
+ (string-to-number (match-string 2 ans))
+ (progn (setq kill-year t)
+ (string-to-number (format-time-string "%Y"))))
+ month (string-to-number (match-string 3 ans))
+ day (string-to-number (match-string 4 ans)))
+ (setq year (org-small-year-to-year year))
+ (setq ans (replace-match (format "%04d-%02d-%02d\\5" year month day)
+ t nil ans)))
+
+ ;; Help matching dotted european dates
+ (when (string-match
+ "^ *\\(3[01]\\|0?[1-9]\\|[12][0-9]\\)\\. ?\\(0?[1-9]\\|1[012]\\)\\.\\( ?[1-9][0-9]\\{3\\}\\)?" ans)
+ (setq year (if (match-end 3) (string-to-number (match-string 3 ans))
+ (setq kill-year t)
+ (string-to-number (format-time-string "%Y")))
+ day (string-to-number (match-string 1 ans))
+ month (string-to-number (match-string 2 ans))
+ ans (replace-match (format "%04d-%02d-%02d" year month day)
+ t nil ans)))
+
+ ;; Help matching american dates, like 5/30 or 5/30/7
+ (when (string-match
+ "^ *\\(0?[1-9]\\|1[012]\\)/\\(0?[1-9]\\|[12][0-9]\\|3[01]\\)\\(/\\([0-9]+\\)\\)?\\([^/0-9]\\|$\\)" ans)
+ (setq year (if (match-end 4)
+ (string-to-number (match-string 4 ans))
+ (progn (setq kill-year t)
+ (string-to-number (format-time-string "%Y"))))
+ month (string-to-number (match-string 1 ans))
+ day (string-to-number (match-string 2 ans)))
+ (setq year (org-small-year-to-year year))
+ (setq ans (replace-match (format "%04d-%02d-%02d\\5" year month day)
+ t nil ans)))
+ ;; Help matching am/pm times, because `parse-time-string' does not do that.
+ ;; If there is a time with am/pm, and *no* time without it, we convert
+ ;; so that matching will be successful.
+ (cl-loop for i from 1 to 2 do ; twice, for end time as well
+ (when (and (not (string-match "\\(\\`\\|[^+]\\)[012]?[0-9]:[0-9][0-9]\\([ \t\n]\\|$\\)" ans))
+ (string-match "\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\(am\\|AM\\|pm\\|PM\\)\\>" ans))
+ (setq hour (string-to-number (match-string 1 ans))
+ minute (if (match-end 3)
+ (string-to-number (match-string 3 ans))
+ 0)
+ pm (equal ?p
+ (string-to-char (downcase (match-string 4 ans)))))
+ (if (and (= hour 12) (not pm))
+ (setq hour 0)
+ (when (and pm (< hour 12)) (setq hour (+ 12 hour))))
+ (setq ans (replace-match (format "%02d:%02d" hour minute)
+ t t ans))))
+
+ ;; Help matching HHhMM times, similarly as for am/pm times.
+ (cl-loop for i from 1 to 2 do ; twice, for end time as well
+ (when (and (not (string-match "\\(\\`\\|[^+]\\)[012]?[0-9]:[0-9][0-9]\\([ \t\n]\\|$\\)" ans))
+ (string-match "\\(?:\\(?1:[012]?[0-9]\\)?h\\(?2:[0-5][0-9]\\)\\)\\|\\(?:\\(?1:[012]?[0-9]\\)h\\(?2:[0-5][0-9]\\)?\\)\\>" ans))
+ (setq hour (if (match-end 1)
+ (string-to-number (match-string 1 ans))
+ 0)
+ minute (if (match-end 2)
+ (string-to-number (match-string 2 ans))
+ 0))
+ (setq ans (replace-match (format "%02d:%02d" hour minute)
+ t t ans))))
+
+ ;; Check if a time range is given as a duration
+ (when (string-match "\\([012]?[0-9]\\):\\([0-6][0-9]\\)\\+\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?" ans)
+ (setq hour (string-to-number (match-string 1 ans))
+ h2 (+ hour (string-to-number (match-string 3 ans)))
+ minute (string-to-number (match-string 2 ans))
+ m2 (+ minute (if (match-end 5) (string-to-number
+ (match-string 5 ans))0)))
+ (when (>= m2 60) (setq h2 (1+ h2) m2 (- m2 60)))
+ (setq ans (replace-match (format "%02d:%02d-%02d:%02d" hour minute h2 m2)
+ t t ans)))
+
+ ;; Check if there is a time range
+ (when (boundp 'org-end-time-was-given)
+ (setq org-time-was-given nil)
+ (when (and (string-match org-plain-time-of-day-regexp ans)
+ (match-end 8))
+ (setq org-end-time-was-given (match-string 8 ans))
+ (setq ans (concat (substring ans 0 (match-beginning 7))
+ (substring ans (match-end 7))))))
+
+ (setq tl (parse-time-string ans)
+ day (or (nth 3 tl) (nth 3 org-defdecode))
+ month
+ (cond ((nth 4 tl))
+ ((not org-read-date-prefer-future) (nth 4 org-defdecode))
+ ;; Day was specified. Make sure DAY+MONTH
+ ;; combination happens in the future.
+ ((nth 3 tl)
+ (setq futurep t)
+ (if (< day (nth 3 nowdecode)) (1+ (nth 4 nowdecode))
+ (nth 4 nowdecode)))
+ (t (nth 4 org-defdecode)))
+ year
+ (cond ((and (not kill-year) (nth 5 tl)))
+ ((not org-read-date-prefer-future) (nth 5 org-defdecode))
+ ;; Month was guessed in the future and is at least
+ ;; equal to NOWDECODE's. Fix year accordingly.
+ (futurep
+ (if (or (> month (nth 4 nowdecode))
+ (>= day (nth 3 nowdecode)))
+ (nth 5 nowdecode)
+ (1+ (nth 5 nowdecode))))
+ ;; Month was specified. Make sure MONTH+YEAR
+ ;; combination happens in the future.
+ ((nth 4 tl)
+ (setq futurep t)
+ (cond ((> month (nth 4 nowdecode)) (nth 5 nowdecode))
+ ((< month (nth 4 nowdecode)) (1+ (nth 5 nowdecode)))
+ ((< day (nth 3 nowdecode)) (1+ (nth 5 nowdecode)))
+ (t (nth 5 nowdecode))))
+ (t (nth 5 org-defdecode)))
+ hour (or (nth 2 tl) (nth 2 org-defdecode))
+ minute (or (nth 1 tl) (nth 1 org-defdecode))
+ second (or (nth 0 tl) 0)
+ wday (nth 6 tl))
+
+ (when (and (eq org-read-date-prefer-future 'time)
+ (not (nth 3 tl)) (not (nth 4 tl)) (not (nth 5 tl))
+ (equal day (nth 3 nowdecode))
+ (equal month (nth 4 nowdecode))
+ (equal year (nth 5 nowdecode))
+ (nth 2 tl)
+ (or (< (nth 2 tl) (nth 2 nowdecode))
+ (and (= (nth 2 tl) (nth 2 nowdecode))
+ (nth 1 tl)
+ (< (nth 1 tl) (nth 1 nowdecode)))))
+ (setq day (1+ day)
+ futurep t))
+
+ ;; Special date definitions below
+ (cond
+ (iso-week
+ ;; There was an iso week
+ (require 'cal-iso)
+ (setq futurep nil)
+ (setq year (or iso-year year)
+ day (or iso-weekday wday 1)
+ wday nil ; to make sure that the trigger below does not match
+ iso-date (calendar-gregorian-from-absolute
+ (calendar-iso-to-absolute
+ (list iso-week day year))))
+ ; FIXME: Should we also push ISO weeks into the future?
+ ; (when (and org-read-date-prefer-future
+ ; (not iso-year)
+ ; (< (calendar-absolute-from-gregorian iso-date)
+ ; (time-to-days nil)))
+ ; (setq year (1+ year)
+ ; iso-date (calendar-gregorian-from-absolute
+ ; (calendar-iso-to-absolute
+ ; (list iso-week day year)))))
+ (setq month (car iso-date)
+ year (nth 2 iso-date)
+ day (nth 1 iso-date)))
+ (deltan
+ (setq futurep nil)
+ (unless deltadef
+ (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))))
+ ((equal deltaw "m") (setq month (+ month deltan)))
+ ((equal deltaw "y") (setq year (+ year deltan)))))
+ ((and wday (not (nth 3 tl)))
+ ;; Weekday was given, but no day, so pick that day in the week
+ ;; on or after the derived date.
+ (setq wday1 (nth 6 (decode-time (encode-time 0 0 0 day month year))))
+ (unless (equal wday wday1)
+ (setq day (+ day (% (- wday wday1 -7) 7))))))
+ (when (and (boundp 'org-time-was-given)
+ (nth 2 tl))
+ (setq org-time-was-given t))
+ (when (< year 100) (setq year (+ 2000 year)))
+ ;; Check of the date is representable
+ (if org-read-date-force-compatible-dates
+ (progn
+ (when (< year 1970)
+ (setq year 1970 org-read-date-analyze-forced-year t))
+ (when (> year 2037)
+ (setq year 2037 org-read-date-analyze-forced-year t)))
+ (condition-case nil
+ (ignore (encode-time second minute hour day month year))
+ (error
+ (setq year (nth 5 org-defdecode))
+ (setq org-read-date-analyze-forced-year t))))
+ (setq org-read-date-analyze-futurep futurep)
+ (list second minute hour day month year)))
+
+(defvar parse-time-weekdays)
+(defun org-read-date-get-relative (s today default)
+ "Check string S for special relative date string.
+TODAY and DEFAULT are internal times, for today and for a default.
+Return shift list (N what def-flag)
+WHAT is \"d\", \"w\", \"m\", or \"y\" for day, week, month, year.
+N is the number of WHATs to shift.
+DEF-FLAG is t when a double ++ or -- indicates shift relative to
+ the DEFAULT date rather than TODAY."
+ (require 'parse-time)
+ (when (and
+ (string-match
+ (concat
+ "\\`[ \t]*\\([-+]\\{0,2\\}\\)"
+ "\\([0-9]+\\)?"
+ "\\([hdwmy]\\|\\(" (mapconcat 'car parse-time-weekdays "\\|") "\\)\\)?"
+ "\\([ \t]\\|$\\)") s)
+ (or (> (match-end 1) (match-beginning 1)) (match-end 4)))
+ (let* ((dir (if (> (match-end 1) (match-beginning 1))
+ (string-to-char (substring (match-string 1 s) -1))
+ ?+))
+ (rel (and (match-end 1) (= 2 (- (match-end 1) (match-beginning 1)))))
+ (n (if (match-end 2) (string-to-number (match-string 2 s)) 1))
+ (what (if (match-end 3) (match-string 3 s) "d"))
+ (wday1 (cdr (assoc (downcase what) parse-time-weekdays)))
+ (date (if rel default today))
+ (wday (nth 6 (decode-time date)))
+ delta)
+ (if wday1
+ (progn
+ (setq delta (mod (+ 7 (- wday1 wday)) 7))
+ (when (= delta 0) (setq delta 7))
+ (when (= dir ?-)
+ (setq delta (- delta 7))
+ (when (= delta 0) (setq delta -7)))
+ (when (> n 1) (setq delta (+ delta (* (1- n) (if (= dir ?-) -7 7)))))
+ (list delta "d" rel))
+ (list (* n (if (= dir ?-) -1 1)) what rel)))))
+
+(defun org-order-calendar-date-args (arg1 arg2 arg3)
+ "Turn a user-specified date into the internal representation.
+The internal representation needed by the calendar is (month day year).
+This is a wrapper to handle the brain-dead convention in calendar that
+user function argument order change dependent on argument order."
+ (pcase calendar-date-style
+ (`american (list arg1 arg2 arg3))
+ (`european (list arg2 arg1 arg3))
+ (`iso (list arg2 arg3 arg1))))
+
+(defun org-eval-in-calendar (form &optional keepdate)
+ "Eval FORM in the calendar window and return to current window.
+Unless KEEPDATE is non-nil, update `org-ans2' to the cursor date."
+ (let ((sf (selected-frame))
+ (sw (selected-window)))
+ (select-window (get-buffer-window "*Calendar*" t))
+ (eval form)
+ (when (and (not keepdate) (calendar-cursor-to-date))
+ (let* ((date (calendar-cursor-to-date))
+ (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
+ (setq org-ans2 (format-time-string "%Y-%m-%d" time))))
+ (move-overlay org-date-ovl (1- (point)) (1+ (point)) (current-buffer))
+ (select-window sw)
+ (select-frame-set-input-focus sf)))
+
+(defun org-calendar-select ()
+ "Return to `org-read-date' with the date currently selected.
+This is used by `org-read-date' in a temporary keymap for the calendar buffer."
+ (interactive)
+ (when (calendar-cursor-to-date)
+ (let* ((date (calendar-cursor-to-date))
+ (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
+ (setq org-ans1 (format-time-string "%Y-%m-%d" time)))
+ (when (active-minibuffer-window) (exit-minibuffer))))
+
+(defun org-insert-time-stamp (time &optional with-hm inactive pre post extra)
+ "Insert a date stamp for the date given by the internal TIME.
+See `format-time-string' for the format of TIME.
+WITH-HM means use the stamp format that includes the time of the day.
+INACTIVE means use square brackets instead of angular ones, so that the
+stamp will not contribute to the agenda.
+PRE and POST are optional strings to be inserted before and after the
+stamp.
+The command returns the inserted time stamp."
+ (let ((fmt (funcall (if with-hm 'cdr 'car) org-time-stamp-formats))
+ stamp)
+ (when inactive (setq fmt (concat "[" (substring fmt 1 -1) "]")))
+ (insert-before-markers (or pre ""))
+ (when (listp extra)
+ (setq extra (car extra))
+ (if (and (stringp extra)
+ (string-match "\\([0-9]+\\):\\([0-9]+\\)" extra))
+ (setq extra (format "-%02d:%02d"
+ (string-to-number (match-string 1 extra))
+ (string-to-number (match-string 2 extra))))
+ (setq extra nil)))
+ (when extra
+ (setq fmt (concat (substring fmt 0 -1) extra (substring fmt -1))))
+ (insert-before-markers (setq stamp (format-time-string fmt time)))
+ (insert-before-markers (or post ""))
+ (setq org-last-inserted-timestamp stamp)))
+
+(defun org-toggle-time-stamp-overlays ()
+ "Toggle the use of custom time stamp formats."
+ (interactive)
+ (setq org-display-custom-times (not org-display-custom-times))
+ (unless org-display-custom-times
+ (let ((p (point-min)) (bmp (buffer-modified-p)))
+ (while (setq p (next-single-property-change p 'display))
+ (when (and (get-text-property p 'display)
+ (eq (get-text-property p 'face) 'org-date))
+ (remove-text-properties
+ p (setq p (next-single-property-change p 'display))
+ '(display t))))
+ (set-buffer-modified-p bmp)))
+ (org-restart-font-lock)
+ (setq org-table-may-need-update t)
+ (if org-display-custom-times
+ (message "Time stamps are overlaid with custom format")
+ (message "Time stamp overlays removed")))
+
+(defun org-display-custom-time (beg end)
+ "Overlay modified time stamp format over timestamp between BEG and END."
+ (let* ((ts (buffer-substring beg end))
+ t1 with-hm tf time str (off 0))
+ (save-match-data
+ (setq t1 (org-parse-time-string ts t))
+ (when (string-match "\\(-[0-9]+:[0-9]+\\)?\\( [.+]?\\+[0-9]+[hdwmy]\\(/[0-9]+[hdwmy]\\)?\\)?\\'" ts)
+ (setq off (- (match-end 0) (match-beginning 0)))))
+ (setq end (- end off))
+ (setq with-hm (and (nth 1 t1) (nth 2 t1))
+ tf (funcall (if with-hm 'cdr 'car) org-time-stamp-custom-formats)
+ time (org-fix-decoded-time t1)
+ str (org-add-props
+ (format-time-string
+ (substring tf 1 -1) (apply 'encode-time time))
+ nil 'mouse-face 'highlight))
+ (put-text-property beg end 'display str)))
+
+(defun org-fix-decoded-time (time)
+ "Set 0 instead of nil for the first 6 elements of time.
+Don't touch the rest."
+ (let ((n 0))
+ (mapcar (lambda (x) (if (< (setq n (1+ n)) 7) (or x 0) x)) time)))
+
+(defun org-time-stamp-to-now (timestamp-string &optional seconds)
+ "Difference between TIMESTAMP-STRING and now in days.
+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 nil))))
+
+(defun org-deadline-close-p (timestamp-string &optional ndays)
+ "Is the time in TIMESTAMP-STRING close to the current date?"
+ (setq ndays (or ndays (org-get-wdays timestamp-string)))
+ (and (<= (org-time-stamp-to-now timestamp-string) ndays)
+ (not (org-entry-is-done-p))))
+
+(defun org-get-wdays (ts &optional delay zero-delay)
+ "Get the deadline lead time appropriate for timestring TS.
+When DELAY is non-nil, get the delay time for scheduled items
+instead of the deadline lead time. When ZERO-DELAY is non-nil
+and `org-scheduled-delay-days' is 0, enforce 0 as the delay,
+don't try to find the delay cookie in the scheduled timestamp."
+ (let ((tv (if delay org-scheduled-delay-days
+ org-deadline-warning-days)))
+ (cond
+ ((or (and delay (< tv 0))
+ (and delay zero-delay (<= tv 0))
+ (and (not delay) (<= tv 0)))
+ ;; Enforce this value no matter what
+ (- tv))
+ ((string-match "-\\([0-9]+\\)\\([hdwmy]\\)\\(\\'\\|>\\| \\)" ts)
+ ;; lead time is specified.
+ (floor (* (string-to-number (match-string 1 ts))
+ (cdr (assoc (match-string 2 ts)
+ '(("d" . 1) ("w" . 7)
+ ("m" . 30.4) ("y" . 365.25)
+ ("h" . 0.041667)))))))
+ ;; go for the default.
+ (t tv))))
+
+(defun org-calendar-select-mouse (ev)
+ "Return to `org-read-date' with the date currently selected.
+This is used by `org-read-date' in a temporary keymap for the calendar buffer."
+ (interactive "e")
+ (mouse-set-point ev)
+ (when (calendar-cursor-to-date)
+ (let* ((date (calendar-cursor-to-date))
+ (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
+ (setq org-ans1 (format-time-string "%Y-%m-%d" time)))
+ (when (active-minibuffer-window) (exit-minibuffer))))
+
+(defun org-check-deadlines (ndays)
+ "Check if there are any deadlines due or past due.
+A deadline is considered due if it happens within `org-deadline-warning-days'
+days from today's date. If the deadline appears in an entry marked DONE,
+it is not shown. A numeric prefix argument NDAYS can be used to test that
+many days. If the prefix is a raw `\\[universal-argument]', all deadlines \
+are shown."
+ (interactive "P")
+ (let* ((org-warn-days
+ (cond
+ ((equal ndays '(4)) 100000)
+ (ndays (prefix-numeric-value ndays))
+ (t (abs org-deadline-warning-days))))
+ (case-fold-search nil)
+ (regexp (concat "\\<" org-deadline-string " *<\\([^>]+\\)>"))
+ (callback
+ (lambda () (org-deadline-close-p (match-string 1) org-warn-days))))
+ (message "%d deadlines past-due or due within %d days"
+ (org-occur regexp nil callback)
+ org-warn-days)))
+
+(defsubst org-re-timestamp (type)
+ "Return a regexp for timestamp TYPE.
+Allowed values for TYPE are:
+
+ all: all timestamps
+ active: only active timestamps (<...>)
+ inactive: only inactive timestamps ([...])
+ scheduled: only scheduled timestamps
+ deadline: only deadline timestamps
+ closed: only closed time-stamps
+
+When TYPE is nil, fall back on returning a regexp that matches
+both scheduled and deadline timestamps."
+ (cl-case type
+ (all org-ts-regexp-both)
+ (active org-ts-regexp)
+ (inactive org-ts-regexp-inactive)
+ (scheduled org-scheduled-time-regexp)
+ (deadline org-deadline-time-regexp)
+ (closed org-closed-time-regexp)
+ (otherwise
+ (concat "\\<"
+ (regexp-opt (list org-deadline-string org-scheduled-string))
+ " *<\\([^>]+\\)>"))))
+
+(defun org-check-before-date (d)
+ "Check if there are deadlines or scheduled entries before date D."
+ (interactive (list (org-read-date)))
+ (let* ((case-fold-search nil)
+ (regexp (org-re-timestamp org-ts-type))
+ (ts-type org-ts-type)
+ (callback
+ (lambda ()
+ (let ((match (match-string 1)))
+ (and (if (memq ts-type '(active inactive all))
+ (eq (org-element-type (save-excursion
+ (backward-char)
+ (org-element-context)))
+ 'timestamp)
+ (org-at-planning-p))
+ (time-less-p
+ (org-time-string-to-time match)
+ (org-time-string-to-time d)))))))
+ (message "%d entries before %s"
+ (org-occur regexp nil callback)
+ d)))
+
+(defun org-check-after-date (d)
+ "Check if there are deadlines or scheduled entries after date D."
+ (interactive (list (org-read-date)))
+ (let* ((case-fold-search nil)
+ (regexp (org-re-timestamp org-ts-type))
+ (ts-type org-ts-type)
+ (callback
+ (lambda ()
+ (let ((match (match-string 1)))
+ (and (if (memq ts-type '(active inactive all))
+ (eq (org-element-type (save-excursion
+ (backward-char)
+ (org-element-context)))
+ 'timestamp)
+ (org-at-planning-p))
+ (not (time-less-p
+ (org-time-string-to-time match)
+ (org-time-string-to-time d))))))))
+ (message "%d entries after %s"
+ (org-occur regexp nil callback)
+ d)))
+
+(defun org-check-dates-range (start-date end-date)
+ "Check for deadlines/scheduled entries between START-DATE and END-DATE."
+ (interactive (list (org-read-date nil nil nil "Range starts")
+ (org-read-date nil nil nil "Range end")))
+ (let ((case-fold-search nil)
+ (regexp (org-re-timestamp org-ts-type))
+ (callback
+ (let ((type org-ts-type))
+ (lambda ()
+ (let ((match (match-string 1)))
+ (and
+ (if (memq type '(active inactive all))
+ (eq (org-element-type (save-excursion
+ (backward-char)
+ (org-element-context)))
+ 'timestamp)
+ (org-at-planning-p))
+ (not (time-less-p
+ (org-time-string-to-time match)
+ (org-time-string-to-time start-date)))
+ (time-less-p
+ (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)))
+
+(defun org-evaluate-time-range (&optional to-buffer)
+ "Evaluate a time range by computing the difference between start and end.
+Normally the result is just printed in the echo area, but with prefix arg
+TO-BUFFER, the result is inserted just after the date stamp into the buffer.
+If the time range is actually in a table, the result is inserted into the
+next column.
+For time difference computation, a year is assumed to be exactly 365
+days in order to avoid rounding problems."
+ (interactive "P")
+ (or
+ (org-clock-update-time-maybe)
+ (save-excursion
+ (unless (org-at-date-range-p t)
+ (goto-char (point-at-bol))
+ (re-search-forward org-tr-regexp-both (point-at-eol) t))
+ (unless (org-at-date-range-p t)
+ (user-error "Not at a time-stamp range, and none found in current line")))
+ (let* ((ts1 (match-string 1))
+ (ts2 (match-string 2))
+ (havetime (or (> (length ts1) 15) (> (length ts2) 15)))
+ (match-end (match-end 0))
+ (time1 (org-time-string-to-time ts1))
+ (time2 (org-time-string-to-time ts2))
+ (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))
+ (fy "%dy %dd %02d:%02d")
+ (fy1 "%dy %dd")
+ (fd "%dd %02d:%02d")
+ (fd1 "%dd")
+ (fh "%02d:%02d")
+ y d h m align)
+ (if havetime
+ (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)
+ y 0
+ d (round diff ds)
+ h 0 m 0))
+ (if (not to-buffer)
+ (message "%s" (org-make-tdiff-string y d h m))
+ (if (org-at-table-p)
+ (progn
+ (goto-char match-end)
+ (setq align t)
+ (and (looking-at " *|") (goto-char (match-end 0))))
+ (goto-char match-end))
+ (when (looking-at
+ "\\( *-? *[0-9]+y\\)?\\( *[0-9]+d\\)? *[0-9][0-9]:[0-9][0-9]")
+ (replace-match ""))
+ (when negative (insert " -"))
+ (if (> y 0) (insert " " (format (if havetime fy fy1) y d h m))
+ (if (> d 0) (insert " " (format (if havetime fd fd1) d h m))
+ (insert " " (format fh h m))))
+ (when align (org-table-align))
+ (message "Time difference inserted")))))
+
+(defun org-make-tdiff-string (y d h m)
+ (let ((fmt "")
+ (l nil))
+ (when (> y 0)
+ (setq fmt (concat fmt "%d year" (if (> y 1) "s" "") " "))
+ (push y l))
+ (when (> d 0)
+ (setq fmt (concat fmt "%d day" (if (> d 1) "s" "") " "))
+ (push d l))
+ (when (> h 0)
+ (setq fmt (concat fmt "%d hour" (if (> h 1) "s" "") " "))
+ (push h l))
+ (when (> m 0)
+ (setq fmt (concat fmt "%d minute" (if (> m 1) "s" "") " "))
+ (push m l))
+ (apply 'format fmt (nreverse l))))
+
+(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)
+ "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")
+
+(defun org-time-string-to-absolute (s &optional daynr prefer buffer pos)
+ "Convert time stamp S to an absolute day number.
+
+If DAYNR in non-nil, and there is a specifier for a cyclic time
+stamp, get the closest date to DAYNR. If PREFER is
+`past' (respectively `future') return a date past (respectively
+after) or equal to DAYNR.
+
+POS is the location of time stamp S, as a buffer position in
+BUFFER.
+
+Diary sexp timestamps are matched against DAYNR, when non-nil.
+If matching fails or DAYNR is nil, `org-diary-sexp-no-match' is
+signaled."
+ (cond
+ ((string-match "\\`%%\\((.*)\\)" s)
+ ;; Sexp timestamp: try to match DAYNR, if available, since we're
+ ;; only able to match individual dates. If it fails, raise an
+ ;; error.
+ (if (and daynr
+ (org-diary-sexp-entry
+ (match-string 1 s) "" (calendar-gregorian-from-absolute daynr)))
+ daynr
+ (signal 'org-diary-sexp-no-match (list s))))
+ (daynr (org-closest-date s daynr prefer))
+ (t (time-to-days
+ (condition-case errdata
+ (org-time-string-to-time s)
+ (error (error "Bad timestamp `%s'%s\nError was: %s"
+ s
+ (if (not (and buffer pos)) ""
+ (format-message " at %d in buffer `%s'" pos buffer))
+ (cdr errdata))))))))
+
+(defun org-days-to-iso-week (days)
+ "Return the ISO week number."
+ (require 'cal-iso)
+ (car (calendar-iso-from-absolute days)))
+
+(defun org-small-year-to-year (year)
+ "Convert 2-digit years into 4-digit years.
+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")))
+ (century (/ current 100))
+ (offset (- year (% current 100))))
+ (cond ((> offset 30) (+ (* (1- century) 100) year))
+ ((> offset -70) (+ (* century 100) year))
+ (t (+ (* (1+ century) 100) year))))))
+
+(defun org-time-from-absolute (d)
+ "Return the time corresponding to date D.
+D may be an absolute day number, or a calendar-type list (month day year)."
+ (when (numberp d) (setq d (calendar-gregorian-from-absolute d)))
+ (encode-time 0 0 0 (nth 1 d) (car d) (nth 2 d)))
+
+(defvar org-agenda-current-date)
+(defun org-calendar-holiday ()
+ "List of holidays, for Diary display in Org mode."
+ (require 'holidays)
+ (let ((hl (calendar-check-holidays org-agenda-current-date)))
+ (and hl (mapconcat #'identity hl "; "))))
+
+(defun org-diary-sexp-entry (sexp entry d)
+ "Process a SEXP diary ENTRY for date D."
+ (require 'diary-lib)
+ ;; `org-anniversary' and alike expect ENTRY and DATE to be bound
+ ;; dynamically.
+ (let* ((sexp `(let ((entry ,entry)
+ (date ',d))
+ ,(car (read-from-string sexp))))
+ (result (if calendar-debug-sexp (eval sexp)
+ (condition-case nil
+ (eval sexp)
+ (error
+ (beep)
+ (message "Bad sexp at line %d in %s: %s"
+ (org-current-line)
+ (buffer-file-name) sexp)
+ (sleep-for 2))))))
+ (cond ((stringp result) (split-string result "; "))
+ ((and (consp result)
+ (not (consp (cdr result)))
+ (stringp (cdr result))) (cdr result))
+ ((and (consp result)
+ (stringp (car result))) result)
+ (result entry))))
+
+(defun org-diary-to-ical-string (frombuf)
+ "Get iCalendar entries from diary entries in buffer FROMBUF.
+This uses the icalendar.el library."
+ (let* ((tmpdir temporary-file-directory)
+ (tmpfile (make-temp-name
+ (expand-file-name "orgics" tmpdir)))
+ buf rtn b e)
+ (with-current-buffer frombuf
+ (icalendar-export-region (point-min) (point-max) tmpfile)
+ (setq buf (find-buffer-visiting tmpfile))
+ (set-buffer buf)
+ (goto-char (point-min))
+ (when (re-search-forward "^BEGIN:VEVENT" nil t)
+ (setq b (match-beginning 0)))
+ (goto-char (point-max))
+ (when (re-search-backward "^END:VEVENT" nil t)
+ (setq e (match-end 0)))
+ (setq rtn (if (and b e) (concat (buffer-substring b e) "\n") "")))
+ (kill-buffer buf)
+ (delete-file tmpfile)
+ rtn))
+
+(defun org-closest-date (start current prefer)
+ "Return closest date to CURRENT starting from START.
+
+CURRENT and START are both time stamps.
+
+When PREFER is `past', return a date that is either CURRENT or
+past. When PREFER is `future', return a date that is either
+CURRENT or future.
+
+Only time stamps with a repeater are modified. Any other time
+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 (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 (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))
+ (cday (calendar-absolute-from-gregorian target))
+ n1 n2)
+ ;; If START is already past CURRENT, just return START.
+ (if (<= cday sday) sday
+ ;; Compute closest date before (N1) and closest date past
+ ;; (N2) CURRENT.
+ (pcase type
+ ("h"
+ (let ((missing-hours
+ (mod (+ (- (* 24 (- cday sday))
+ (nth 2 (org-parse-time-string start)))
+ org-extend-today-until)
+ value)))
+ (setf n1 (if (= missing-hours 0) cday
+ (- cday (1+ (/ missing-hours 24)))))
+ (setf n2 (+ cday (/ (- value missing-hours) 24)))))
+ ((or "d" "w")
+ (let ((value (if (equal type "w") (* 7 value) value)))
+ (setf n1 (+ sday (* value (/ (- cday sday) value))))
+ (setf n2 (+ n1 value))))
+ ("m"
+ (let* ((add-months
+ (lambda (d n)
+ ;; Add N months to gregorian date D, i.e.,
+ ;; a list (MONTH DAY YEAR). Return a valid
+ ;; gregorian date.
+ (let ((m (+ (nth 0 d) n)))
+ (list (mod m 12)
+ (nth 1 d)
+ (+ (/ m 12) (nth 2 d))))))
+ (months ; Complete months to TARGET.
+ (* (/ (+ (* 12 (- (nth 2 target) (nth 2 base)))
+ (- (nth 0 target) (nth 0 base))
+ ;; If START's day is greater than
+ ;; TARGET's, remove incomplete month.
+ (if (> (nth 1 target) (nth 1 base)) 0 -1))
+ value)
+ value))
+ (before (funcall add-months base months)))
+ (setf n1 (calendar-absolute-from-gregorian before))
+ (setf n2
+ (calendar-absolute-from-gregorian
+ (funcall add-months before value)))))
+ (_
+ (let* ((d (nth 1 base))
+ (m (nth 0 base))
+ (y (nth 2 base))
+ (years ; Complete years to TARGET.
+ (* (/ (- (nth 2 target)
+ y
+ ;; If START's month and day are
+ ;; greater than TARGET's, remove
+ ;; incomplete year.
+ (if (or (> (nth 0 target) m)
+ (and (= (nth 0 target) m)
+ (> (nth 1 target) d)))
+ 0
+ 1))
+ value)
+ value))
+ (before (list m d (+ y years))))
+ (setf n1 (calendar-absolute-from-gregorian before))
+ (setf n2 (calendar-absolute-from-gregorian
+ (list m d (+ (nth 2 before) value)))))))
+ ;; Handle PREFER parameter, if any.
+ (cond
+ ((eq prefer 'past) (if (= cday n2) n2 n1))
+ ((eq prefer 'future) (if (= cday n1) n1 n2))
+ (t (if (> (abs (- cday n1)) (abs (- cday n2))) n2 n1)))))))))
+
+(defun org-date-to-gregorian (d)
+ "Turn any specification of date D into a Gregorian date for the calendar."
+ (cond ((integerp d) (calendar-gregorian-from-absolute d))
+ ((and (listp d) (= (length d) 3)) d)
+ ((stringp d)
+ (let ((d (org-parse-time-string d)))
+ (list (nth 4 d) (nth 3 d) (nth 5 d))))
+ ((listp d) (list (nth 4 d) (nth 3 d) (nth 5 d)))))
+
+(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. 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))
+
+(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. 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))
+
+(defun org-timestamp-up-day (&optional arg)
+ "Increase the date in the time stamp by one day.
+With prefix ARG, change that many days."
+ (interactive "p")
+ (if (and (not (org-at-timestamp-p 'lax))
+ (org-at-heading-p))
+ (org-todo 'up)
+ (org-timestamp-change (prefix-numeric-value arg) 'day 'updown)))
+
+(defun org-timestamp-down-day (&optional arg)
+ "Decrease the date in the time stamp by one day.
+With prefix ARG, change that many days."
+ (interactive "p")
+ (if (and (not (org-at-timestamp-p 'lax))
+ (org-at-heading-p))
+ (org-todo 'down)
+ (org-timestamp-change (- (prefix-numeric-value arg)) 'day) 'updown))
+
+(defun org-at-timestamp-p (&optional extended)
+ "Non-nil if point is inside a timestamp.
+
+By default, the function only consider syntactically valid active
+timestamps. However, the caller may have a broader definition
+for timestamps. As a consequence, optional argument EXTENDED can
+be set to the following values
+
+ `inactive'
+
+ Include also syntactically valid inactive timestamps.
+
+ `agenda'
+
+ Include timestamps allowed in Agenda, i.e., those in
+ properties drawers, planning lines and clock lines.
+
+ `lax'
+
+ Ignore context. The function matches any part of the
+ document looking like a timestamp. This includes comments,
+ example blocks...
+
+For backward-compatibility with Org 9.0, every other non-nil
+value is equivalent to `inactive'.
+
+When at a timestamp, return the position of the point as a symbol
+among `bracket', `after', `year', `month', `hour', `minute',
+`day' or a number of character from the last know part of the
+time stamp.
+
+When matching, the match groups are the following:
+ group 1: year
+ group 2: month
+ group 3: day number
+ group 4: day name
+ group 5: hours, if any
+ group 6: minutes, if any"
+ (let* ((regexp (if extended org-ts-regexp3 org-ts-regexp2))
+ (pos (point))
+ (match?
+ (let ((boundaries (org-in-regexp regexp)))
+ (save-match-data
+ (cond ((null boundaries) nil)
+ ((eq extended 'lax) t)
+ (t
+ (or (and (eq extended 'agenda)
+ (or (org-at-planning-p)
+ (org-at-property-p)
+ (and (bound-and-true-p
+ org-agenda-include-inactive-timestamps)
+ (org-at-clock-log-p))))
+ (eq 'timestamp
+ (save-excursion
+ (when (= pos (cdr boundaries)) (forward-char -1))
+ (org-element-type (org-element-context)))))))))))
+ (cond
+ ((not match?) nil)
+ ((= pos (match-beginning 0)) 'bracket)
+ ;; Distinguish location right before the closing bracket from
+ ;; right after it.
+ ((= pos (1- (match-end 0))) 'bracket)
+ ((= pos (match-end 0)) 'after)
+ ((org-pos-in-match-range pos 2) 'year)
+ ((org-pos-in-match-range pos 3) 'month)
+ ((org-pos-in-match-range pos 7) 'hour)
+ ((org-pos-in-match-range pos 8) 'minute)
+ ((or (org-pos-in-match-range pos 4)
+ (org-pos-in-match-range pos 5)) 'day)
+ ((and (> pos (or (match-end 8) (match-end 5)))
+ (< pos (match-end 0)))
+ (- pos (or (match-end 8) (match-end 5))))
+ (t 'day))))
+
+(defun org-toggle-timestamp-type ()
+ "Toggle the type (<active> or [inactive]) of a time stamp."
+ (interactive)
+ (when (org-at-timestamp-p 'lax)
+ (let ((beg (match-beginning 0)) (end (match-end 0))
+ (map '((?\[ . "<") (?\] . ">") (?< . "[") (?> . "]"))))
+ (save-excursion
+ (goto-char beg)
+ (while (re-search-forward "[][<>]" end t)
+ (replace-match (cdr (assoc (char-after (match-beginning 0)) map))
+ t t)))
+ (message "Timestamp is now %sactive"
+ (if (equal (char-after beg) ?<) "" "in")))))
+
+(defun org-at-clock-log-p ()
+ "Non-nil if point is on a clock log line."
+ (and (org-match-line org-clock-line-re)
+ (eq (org-element-type (save-match-data (org-element-at-point))) 'clock)))
+
+(defvar org-clock-history) ; defined in org-clock.el
+(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 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
+ with-hm inactive
+ (dm (max (nth 1 org-time-stamp-rounding-minutes) 1))
+ extra rem
+ ts time time0 fixnext clrgx)
+ (unless timestamp? (user-error "Not at a timestamp"))
+ (if (and (not what) (eq timestamp? 'bracket))
+ (org-toggle-timestamp-type)
+ ;; Point isn't on brackets. Remember the part of the time-stamp
+ ;; the point was in. Indeed, size of time-stamps may change,
+ ;; but point must be kept in the same category nonetheless.
+ (setq origin-cat timestamp?)
+ (when (and (not what) (not (eq timestamp? 'day))
+ org-display-custom-times
+ (get-text-property (point) 'display)
+ (not (get-text-property (1- (point)) 'display)))
+ (setq timestamp? 'day))
+ (setq timestamp? (or what timestamp?)
+ inactive (= (char-after (match-beginning 0)) ?\[)
+ ts (match-string 0))
+ (replace-match "")
+ (when (string-match
+ "\\(\\(-[012][0-9]:[0-5][0-9]\\)?\\( +[.+]?-?[-+][0-9]+[hdwmy]\\(/[0-9]+[hdwmy]\\)?\\)*\\)[]>]"
+ ts)
+ (setq extra (match-string 1 ts))
+ (when suppress-tmp-delay
+ (setq extra (replace-regexp-in-string " --[0-9]+[hdwmy]" "" extra))))
+ (when (string-match "^.\\{10\\}.*?[0-9]+:[0-9][0-9]" ts)
+ (setq with-hm t))
+ (setq time0 (org-parse-time-string ts))
+ (when (and updown
+ (eq timestamp? 'minute)
+ (not current-prefix-arg))
+ ;; This looks like s-up and s-down. Change by one rounding step.
+ (setq n (* dm (cond ((> n 0) 1) ((< n 0) -1) (t 0))))
+ (unless (= 0 (setq rem (% (nth 1 time0) dm)))
+ (setcar (cdr time0) (+ (nth 1 time0)
+ (if (> n 0) (- rem) (- dm rem))))))
+ (setq time
+ (apply #'encode-time
+ (or (car time0) 0)
+ (+ (if (eq timestamp? 'minute) n 0) (nth 1 time0))
+ (+ (if (eq timestamp? 'hour) n 0) (nth 2 time0))
+ (+ (if (eq timestamp? 'day) n 0) (nth 3 time0))
+ (+ (if (eq timestamp? 'month) n 0) (nth 4 time0))
+ (+ (if (eq timestamp? 'year) n 0) (nth 5 time0))
+ (nthcdr 6 time0)))
+ (when (and (memq timestamp? '(hour minute))
+ extra
+ (string-match "-\\([012][0-9]\\):\\([0-5][0-9]\\)" extra))
+ (setq extra (org-modify-ts-extra
+ extra
+ (if (eq timestamp? 'hour) 2 5)
+ n dm)))
+ (when (integerp timestamp?)
+ (setq extra (org-modify-ts-extra extra timestamp? n dm)))
+ (when (eq what 'calendar)
+ (let ((cal-date (org-get-date-from-calendar)))
+ (setcar (nthcdr 4 time0) (nth 0 cal-date)) ; month
+ (setcar (nthcdr 3 time0) (nth 1 cal-date)) ; day
+ (setcar (nthcdr 5 time0) (nth 2 cal-date)) ; year
+ (setcar time0 (or (car time0) 0))
+ (setcar (nthcdr 1 time0) (or (nth 1 time0) 0))
+ (setcar (nthcdr 2 time0) (or (nth 2 time0) 0))
+ (setq time (apply 'encode-time time0))))
+ ;; Insert the new time-stamp, and ensure point stays in the same
+ ;; category as before (i.e. not after the last position in that
+ ;; category).
+ (let ((pos (point)))
+ ;; Stay before inserted string. `save-excursion' is of no use.
+ (setq org-last-changed-timestamp
+ (org-insert-time-stamp time with-hm inactive nil nil extra))
+ (goto-char pos))
+ (save-match-data
+ (looking-at org-ts-regexp3)
+ (goto-char
+ (pcase origin-cat
+ ;; `day' category ends before `hour' if any, or at the end
+ ;; of the day name.
+ (`day (min (or (match-beginning 7) (1- (match-end 5))) origin))
+ (`hour (min (match-end 7) origin))
+ (`minute (min (1- (match-end 8)) origin))
+ ((pred integerp) (min (1- (match-end 0)) origin))
+ ;; Point was right after the time-stamp. However, the
+ ;; time-stamp length might have changed, so refer to
+ ;; (match-end 0) instead.
+ (`after (match-end 0))
+ ;; `year' and `month' have both fixed size: point couldn't
+ ;; have moved into another part.
+ (_ origin))))
+ ;; Update clock if on a CLOCK line.
+ (org-clock-update-time-maybe)
+ ;; Maybe adjust the closest clock in `org-clock-history'
+ (when org-clock-adjust-closest
+ (if (not (and (org-at-clock-log-p)
+ (< 1 (length (delq nil (mapcar 'marker-position
+ org-clock-history))))))
+ (message "No clock to adjust")
+ (cond ((save-excursion ; fix previous clock?
+ (re-search-backward org-ts-regexp0 nil t)
+ (looking-back (concat org-clock-string " \\[")
+ (line-beginning-position)))
+ (setq fixnext 1 clrgx (concat org-ts-regexp0 "\\] =>.*$")))
+ ((save-excursion ; fix next clock?
+ (re-search-backward org-ts-regexp0 nil t)
+ (looking-at (concat org-ts-regexp0 "\\] =>")))
+ (setq fixnext -1 clrgx (concat org-clock-string " \\[" org-ts-regexp0))))
+ (save-window-excursion
+ ;; Find closest clock to point, adjust the previous/next one in history
+ (let* ((p (save-excursion (org-back-to-heading t)))
+ (cl (mapcar (lambda(c) (abs (- (marker-position c) p))) org-clock-history))
+ (clfixnth
+ (+ fixnext (- (length cl) (or (length (member (apply 'min cl) cl)) 100))))
+ (clfixpos (unless (> 0 clfixnth) (nth clfixnth org-clock-history))))
+ (if (not clfixpos)
+ (message "No clock to adjust")
+ (save-excursion
+ (org-goto-marker-or-bmk clfixpos)
+ (org-show-subtree)
+ (when (re-search-forward clrgx nil t)
+ (goto-char (match-beginning 1))
+ (let (org-clock-adjust-closest)
+ (org-timestamp-change n timestamp? updown))
+ (message "Clock adjusted in %s for heading: %s"
+ (file-name-nondirectory (buffer-file-name))
+ (org-get-heading t t)))))))))
+ ;; Try to recenter the calendar window, if any.
+ (when (and org-calendar-follow-timestamp-change
+ (get-buffer-window "*Calendar*" t)
+ (memq timestamp? '(day month year)))
+ (org-recenter-calendar (time-to-days time))))))
+
+(defun org-modify-ts-extra (s pos n dm)
+ "Change the different parts of the lead-time and repeat fields in timestamp."
+ (let ((idx '(("d" . 0) ("w" . 1) ("m" . 2) ("y" . 3) ("d" . -1) ("y" . 4)))
+ ng h m new rem)
+ (when (string-match "\\(-\\([012][0-9]\\):\\([0-5][0-9]\\)\\)?\\( +\\+\\([0-9]+\\)\\([dmwy]\\)\\)?\\( +-\\([0-9]+\\)\\([dmwy]\\)\\)?" s)
+ (cond
+ ((or (org-pos-in-match-range pos 2)
+ (org-pos-in-match-range pos 3))
+ (setq m (string-to-number (match-string 3 s))
+ 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 (cl-signum n))))
+ (unless (= 0 (setq rem (% m dm)))
+ (setq m (+ m (if (> n 0) (- rem) (- dm rem)))))
+ (setq m (+ m n)))
+ (when (< m 0) (setq m (+ m 60) h (1- h)))
+ (when (> m 59) (setq m (- m 60) h (1+ h)))
+ (setq h (mod h 24))
+ (setq ng 1 new (format "-%02d:%02d" h m)))
+ ((org-pos-in-match-range pos 6)
+ (setq ng 6 new (car (rassoc (+ n (cdr (assoc (match-string 6 s) idx))) idx))))
+ ((org-pos-in-match-range pos 5)
+ (setq ng 5 new (format "%d" (max 1 (+ n (string-to-number (match-string 5 s)))))))
+
+ ((org-pos-in-match-range pos 9)
+ (setq ng 9 new (car (rassoc (+ n (cdr (assoc (match-string 9 s) idx))) idx))))
+ ((org-pos-in-match-range pos 8)
+ (setq ng 8 new (format "%d" (max 0 (+ n (string-to-number (match-string 8 s))))))))
+
+ (when ng
+ (setq s (concat
+ (substring s 0 (match-beginning ng))
+ new
+ (substring s (match-end ng))))))
+ s))
+
+(defun org-recenter-calendar (d)
+ "If the calendar is visible, recenter it to date D."
+ (let ((cwin (get-buffer-window "*Calendar*" t)))
+ (when cwin
+ (let ((calendar-move-hook nil))
+ (with-selected-window cwin
+ (calendar-goto-date
+ (if (listp d) d (calendar-gregorian-from-absolute d))))))))
+
+(defun org-goto-calendar (&optional arg)
+ "Go to the Emacs calendar at the current date.
+If there is a time stamp in the current line, go to that date.
+A prefix ARG can be used to force the current date."
+ (interactive "P")
+ (let ((calendar-move-hook nil)
+ (calendar-view-holidays-initially-flag nil)
+ (calendar-view-diary-initially-flag nil)
+ diff)
+ (when (or (org-at-timestamp-p 'lax)
+ (org-match-line (concat ".*" org-ts-regexp)))
+ (let ((d1 (time-to-days nil))
+ (d2 (time-to-days (org-time-string-to-time (match-string 1)))))
+ (setq diff (- d2 d1))))
+ (calendar)
+ (calendar-goto-today)
+ (when (and diff (not arg)) (calendar-forward-day diff))))
+
+(defun org-get-date-from-calendar ()
+ "Return a list (month day year) of date at point in calendar."
+ (with-current-buffer "*Calendar*"
+ (save-match-data
+ (calendar-cursor-to-date))))
+
+(defun org-date-from-calendar ()
+ "Insert time stamp corresponding to cursor date in *Calendar* buffer.
+If there is already a time stamp at the cursor position, update it."
+ (interactive)
+ (if (org-at-timestamp-p 'lax)
+ (org-timestamp-change 0 'calendar)
+ (let ((cal-date (org-get-date-from-calendar)))
+ (org-insert-time-stamp
+ (encode-time 0 0 0 (nth 1 cal-date) (car cal-date) (nth 2 cal-date))))))
+
+(defcustom org-image-actual-width t
+ "When non-nil, use the actual width of images when inlining them.
+
+When set to a number, use imagemagick (when available) to set the
+image's width to this value.
+
+When set to a number in a list, try to get the width from any
+#+ATTR.* keyword if it matches a width specification like
+
+ #+ATTR_HTML: :width 300px
+
+and fall back on that number if none is found.
+
+When set to nil, try to get the width from an #+ATTR.* keyword
+and fall back on the original width if none is found.
+
+When set to any other non-nil value, always use the image width.
+
+This requires Emacs >= 24.1, built with imagemagick support."
+ :group 'org-appearance
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "Use the image width" t)
+ (integer :tag "Use a number of pixels")
+ (list :tag "Use #+ATTR* or a number of pixels" (integer))
+ (const :tag "Use #+ATTR* or don't resize" nil)))
+
+(defcustom org-agenda-inhibit-startup nil
+ "Inhibit startup when preparing agenda buffers.
+When this variable is t, the initialization of the Org agenda
+buffers is inhibited: e.g. the visibility state is not set, the
+tables are not re-aligned, etc."
+ :type 'boolean
+ :version "24.3"
+ :group 'org-agenda)
+
+(defcustom org-agenda-ignore-properties nil
+ "Avoid updating text properties when building the agenda.
+Properties are used to prepare buffers for effort estimates,
+appointments, statistics and subtree-local categories.
+If you don't use these in the agenda, you can add them to this
+list and agenda building will be a bit faster.
+The value is a list, with zero or more of the symbols `effort', `appt',
+`stats' or `category'."
+ :type '(set :greedy t
+ (const effort)
+ (const appt)
+ (const stats)
+ (const category))
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :group 'org-agenda)
+
+;;;; Files
+
+(defun org-save-all-org-buffers ()
+ "Save all Org buffers without user confirmation."
+ (interactive)
+ (message "Saving all Org buffers...")
+ (save-some-buffers t (lambda () (and (derived-mode-p 'org-mode) t)))
+ (when (featurep 'org-id) (org-id-locations-save))
+ (message "Saving all Org buffers... done"))
+
+(defun org-revert-all-org-buffers ()
+ "Revert all Org buffers.
+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
+with a version control system, to revert on one machine after pulling
+changes from another. I believe the procedure must be like this:
+
+1. \\[org-save-all-org-buffers]
+2. Pull changes from the other machine, resolve conflicts
+3. \\[org-revert-all-org-buffers]"
+ (interactive)
+ (unless (yes-or-no-p "Revert all Org buffers from their files? ")
+ (user-error "Abort"))
+ (save-excursion
+ (save-window-excursion
+ (dolist (b (buffer-list))
+ (when (and (with-current-buffer b (derived-mode-p 'org-mode))
+ (with-current-buffer b buffer-file-name))
+ (pop-to-buffer-same-window b)
+ (revert-buffer t 'no-confirm)))
+ (when (and (featurep 'org-id) org-id-track-globally)
+ (org-id-locations-load)))))
+
+;;;; Agenda files
+
+;;;###autoload
+(defun org-switchb (&optional arg)
+ "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."
+ (interactive "P")
+ (let ((blist (org-buffer-list
+ (cond ((equal arg '(4)) 'files)
+ ((equal arg '(16)) 'agenda)))))
+ (pop-to-buffer-same-window
+ (completing-read "Org buffer: "
+ (mapcar #'list (mapcar #'buffer-name blist))
+ nil t))))
+
+(defun org-buffer-list (&optional predicate exclude-tmp)
+ "Return a list of Org buffers.
+PREDICATE can be `export', `files' or `agenda'.
+
+export restrict the list to Export buffers.
+files restrict the list to buffers visiting Org files.
+agenda restrict the list to buffers visiting agenda files.
+
+If EXCLUDE-TMP is non-nil, ignore temporary buffers."
+ (let* ((bfn nil)
+ (agenda-files (and (eq predicate 'agenda)
+ (mapcar 'file-truename (org-agenda-files t))))
+ (filter
+ (cond
+ ((eq predicate 'files)
+ (lambda (b) (with-current-buffer b (derived-mode-p 'org-mode))))
+ ((eq predicate 'export)
+ (lambda (b) (string-match "\\*Org .*Export" (buffer-name b))))
+ ((eq predicate 'agenda)
+ (lambda (b)
+ (with-current-buffer b
+ (and (derived-mode-p 'org-mode)
+ (setq bfn (buffer-file-name b))
+ (member (file-truename bfn) agenda-files)))))
+ (t (lambda (b) (with-current-buffer b
+ (or (derived-mode-p 'org-mode)
+ (string-match "\\*Org .*Export"
+ (buffer-name b)))))))))
+ (delq nil
+ (mapcar
+ (lambda(b)
+ (if (and (funcall filter b)
+ (or (not exclude-tmp)
+ (not (string-match "tmp" (buffer-name b)))))
+ b
+ nil))
+ (buffer-list)))))
+
+(defun org-agenda-files (&optional unrestricted archives)
+ "Get the list of agenda files.
+Optional UNRESTRICTED means return the full list even if a restriction
+is currently in place.
+When ARCHIVES is t, include all archive files that are really being
+used by the agenda files. If ARCHIVE is `ifmode', do this only if
+`org-agenda-archives-mode' is t."
+ (let ((files
+ (cond
+ ((and (not unrestricted) (get 'org-agenda-files 'org-restrict)))
+ ((stringp org-agenda-files) (org-read-agenda-file-list))
+ ((listp org-agenda-files) org-agenda-files)
+ (t (error "Invalid value of `org-agenda-files'")))))
+ (setq files (apply 'append
+ (mapcar (lambda (f)
+ (if (file-directory-p f)
+ (directory-files
+ f t org-agenda-file-regexp)
+ (list (expand-file-name f org-directory))))
+ files)))
+ (when org-agenda-skip-unavailable-files
+ (setq files (delq nil
+ (mapcar (lambda (file)
+ (and (file-readable-p file) file))
+ files))))
+ (when (or (eq archives t)
+ (and (eq archives 'ifmode) (eq org-agenda-archives-mode t)))
+ (setq files (org-add-archive-files files)))
+ files))
+
+(defun org-agenda-file-p (&optional file)
+ "Return non-nil, if FILE is an agenda file.
+If FILE is omitted, use the file associated with the current
+buffer."
+ (let ((fname (or file (buffer-file-name))))
+ (and fname
+ (member (file-truename fname)
+ (mapcar #'file-truename (org-agenda-files t))))))
+
+(defun org-edit-agenda-file-list ()
+ "Edit the list of agenda files.
+Depending on setup, this either uses customize to edit the variable
+`org-agenda-files', or it visits the file that is holding the list. In the
+latter case, the buffer is set up in a way that saving it automatically kills
+the buffer and restores the previous window configuration."
+ (interactive)
+ (if (stringp org-agenda-files)
+ (let ((cw (current-window-configuration)))
+ (find-file org-agenda-files)
+ (setq-local org-window-configuration cw)
+ (add-hook 'after-save-hook
+ (lambda ()
+ (set-window-configuration
+ (prog1 org-window-configuration
+ (kill-buffer (current-buffer))))
+ (org-install-agenda-files-menu)
+ (message "New agenda file list installed"))
+ nil 'local)
+ (message "%s" (substitute-command-keys
+ "Edit list and finish with \\[save-buffer]")))
+ (customize-variable 'org-agenda-files)))
+
+(defun org-store-new-agenda-file-list (list)
+ "Set new value for the agenda file list and save it correctly."
+ (if (stringp org-agenda-files)
+ (let ((fe (org-read-agenda-file-list t)) b u)
+ (while (setq b (find-buffer-visiting org-agenda-files))
+ (kill-buffer b))
+ (with-temp-file org-agenda-files
+ (insert
+ (mapconcat
+ (lambda (f) ;; Keep un-expanded entries.
+ (if (setq u (assoc f fe))
+ (cdr u)
+ f))
+ list "\n")
+ "\n")))
+ (let ((org-mode-hook nil) (org-inhibit-startup t)
+ (org-insert-mode-line-in-empty-file nil))
+ (setq org-agenda-files list)
+ (customize-save-variable 'org-agenda-files org-agenda-files))))
+
+(defun org-read-agenda-file-list (&optional pair-with-expansion)
+ "Read the list of agenda files from a file.
+If PAIR-WITH-EXPANSION is t return pairs with un-expanded
+filenames, used by `org-store-new-agenda-file-list' to write back
+un-expanded file names."
+ (when (file-directory-p org-agenda-files)
+ (error "`org-agenda-files' cannot be a single directory"))
+ (when (stringp org-agenda-files)
+ (with-temp-buffer
+ (insert-file-contents org-agenda-files)
+ (mapcar
+ (lambda (f)
+ (let ((e (expand-file-name (substitute-in-file-name f)
+ org-directory)))
+ (if pair-with-expansion
+ (cons e f)
+ e)))
+ (org-split-string (buffer-string) "[ \t\r\n]*?[\r\n][ \t\r\n]*")))))
+
+;;;###autoload
+(defun org-cycle-agenda-files ()
+ "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."
+ (interactive)
+ (let* ((fs (or (org-agenda-files t)
+ (user-error "No agenda files")))
+ (files (copy-sequence fs))
+ (tcf (and buffer-file-name (file-truename buffer-file-name)))
+ file)
+ (when tcf
+ (while (and (setq file (pop files))
+ (not (equal (file-truename file) tcf)))))
+ (find-file (car (or files fs)))
+ (when (buffer-base-buffer) (pop-to-buffer-same-window (buffer-base-buffer)))))
+
+(defun org-agenda-file-to-front (&optional to-end)
+ "Move/add the current file to the top of the agenda file list.
+If the file is not present in the list, it is added to the front. If it is
+present, it is moved there. With optional argument TO-END, add/move to the
+end of the list."
+ (interactive "P")
+ (let ((org-agenda-skip-unavailable-files nil)
+ (file-alist (mapcar (lambda (x)
+ (cons (file-truename x) x))
+ (org-agenda-files t)))
+ (ctf (file-truename
+ (or buffer-file-name
+ (user-error "Please save the current buffer to a file"))))
+ x had)
+ (setq x (assoc ctf file-alist) had x)
+
+ (unless x (setq x (cons ctf (abbreviate-file-name buffer-file-name))))
+ (if to-end
+ (setq file-alist (append (delq x file-alist) (list x)))
+ (setq file-alist (cons x (delq x file-alist))))
+ (org-store-new-agenda-file-list (mapcar 'cdr file-alist))
+ (org-install-agenda-files-menu)
+ (message "File %s to %s of agenda file list"
+ (if had "moved" "added") (if to-end "end" "front"))))
+
+(defun org-remove-file (&optional file)
+ "Remove current file from the list of files in variable `org-agenda-files'.
+These are the files which are being checked for agenda entries.
+Optional argument FILE means use this file instead of the current."
+ (interactive)
+ (let* ((org-agenda-skip-unavailable-files nil)
+ (file (or file buffer-file-name
+ (user-error "Current buffer does not visit a file")))
+ (true-file (file-truename file))
+ (afile (abbreviate-file-name file))
+ (files (delq nil (mapcar
+ (lambda (x)
+ (unless (equal true-file
+ (file-truename x))
+ x))
+ (org-agenda-files t)))))
+ (if (not (= (length files) (length (org-agenda-files t))))
+ (progn
+ (org-store-new-agenda-file-list files)
+ (org-install-agenda-files-menu)
+ (message "Removed from Org Agenda list: %s" afile))
+ (message "File was not in list: %s (not removed)" afile))))
+
+(defun org-file-menu-entry (file)
+ (vector file (list 'find-file file) t))
+
+(defun org-check-agenda-file (file)
+ "Make sure FILE exists. If not, ask user what to do."
+ (unless (file-exists-p file)
+ (message "Non-existent agenda file %s. [R]emove from list or [A]bort?"
+ (abbreviate-file-name file))
+ (let ((r (downcase (read-char-exclusive))))
+ (cond
+ ((equal r ?r)
+ (org-remove-file file)
+ (throw 'nextfile t))
+ (t (user-error "Abort"))))))
+
+(defun org-get-agenda-file-buffer (file)
+ "Get an agenda buffer visiting FILE.
+If the buffer needs to be created, add it to the list of buffers
+which might be released later."
+ (let ((buf (org-find-base-buffer-visiting file)))
+ (if buf
+ buf ; just return it
+ ;; Make a new buffer and remember it
+ (setq buf (find-file-noselect file))
+ (when buf (push buf org-agenda-new-buffers))
+ buf)))
+
+(defun org-release-buffers (blist)
+ "Release all buffers in list, asking the user for confirmation when needed.
+When a buffer is unmodified, it is just killed. When modified, it is saved
+\(if the user agrees) and then killed."
+ (let (file)
+ (dolist (buf blist)
+ (setq file (buffer-file-name buf))
+ (when (and (buffer-modified-p buf)
+ file
+ (y-or-n-p (format "Save file %s? " file)))
+ (with-current-buffer buf (save-buffer)))
+ (kill-buffer buf))))
+
+(defun org-agenda-prepare-buffers (files)
+ "Create buffers for all agenda files, protect archived trees and comments."
+ (interactive)
+ (let ((pa '(:org-archived t))
+ (pc '(:org-comment t))
+ (pall '(:org-archived t :org-comment t))
+ (inhibit-read-only t)
+ (org-inhibit-startup org-agenda-inhibit-startup)
+ (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)
+ (save-excursion
+ (save-restriction
+ (dolist (file files)
+ (catch 'nextfile
+ (if (bufferp file)
+ (set-buffer file)
+ (org-check-agenda-file file)
+ (set-buffer (org-get-agenda-file-buffer file)))
+ (widen)
+ (org-set-regexps-and-options 'tags-only)
+ (setq pos (point))
+ (or (memq 'category org-agenda-ignore-properties)
+ (org-refresh-category-properties))
+ (or (memq 'stats org-agenda-ignore-properties)
+ (org-refresh-stats-properties))
+ (or (memq 'effort org-agenda-ignore-properties)
+ (org-refresh-effort-properties))
+ (or (memq 'appt org-agenda-ignore-properties)
+ (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime))
+ (setq org-todo-keywords-for-agenda
+ (append org-todo-keywords-for-agenda org-todo-keywords-1))
+ (setq org-done-keywords-for-agenda
+ (append org-done-keywords-for-agenda org-done-keywords))
+ (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--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
+ (dolist (alist org-tag-groups-alist)
+ (let ((old (assoc (car alist) org-tag-groups-alist-for-agenda)))
+ (if old
+ (setcdr old (org-uniquify (append (cdr old) (cdr alist))))
+ (push alist org-tag-groups-alist-for-agenda)))))
+ (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))
+ (setq org-todo-keyword-alist-for-agenda
+ (org-uniquify org-todo-keyword-alist-for-agenda))))
+
+
+;;;; CDLaTeX minor mode
+
+(defvar org-cdlatex-mode-map (make-sparse-keymap)
+ "Keymap for the minor `org-cdlatex-mode'.")
+
+(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.")
+
+(define-minor-mode org-cdlatex-mode
+ "Toggle the minor `org-cdlatex-mode'.
+This mode supports entering LaTeX environment and math in LaTeX fragments
+in Org mode.
+\\{org-cdlatex-mode-map}"
+ :lighter " OCDL"
+ (when org-cdlatex-mode
+ (require 'cdlatex)
+ (run-hooks 'cdlatex-mode-hook)
+ (cdlatex-compute-tables))
+ (unless org-cdlatex-texmathp-advice-is-done
+ (setq org-cdlatex-texmathp-advice-is-done t)
+ (defadvice texmathp (around org-math-always-on activate)
+ "Always return t in Org buffers.
+This is because we want to insert math symbols without dollars even outside
+the LaTeX math segments. If Org mode thinks that point is actually inside
+an embedded LaTeX fragment, let `texmathp' do its job.
+`\\[org-cdlatex-mode-map]'"
+ (interactive)
+ (let (p)
+ (cond
+ ((not (derived-mode-p 'org-mode)) ad-do-it)
+ ((eq this-command 'cdlatex-math-symbol)
+ (setq ad-return-value t
+ texmathp-why '("cdlatex-math-symbol in org-mode" . 0)))
+ (t
+ (let ((p (org-inside-LaTeX-fragment-p)))
+ (if (and p (member (car p) (plist-get org-format-latex-options :matchers)))
+ (setq ad-return-value t
+ texmathp-why '("Org mode embedded math" . 0))
+ (when p ad-do-it)))))))))
+
+(defun turn-on-org-cdlatex ()
+ "Unconditionally turn on `org-cdlatex-mode'."
+ (org-cdlatex-mode 1))
+
+(defun org-try-cdlatex-tab ()
+ "Check if it makes sense to execute `cdlatex-tab', and do it if yes.
+It makes sense to do so if `org-cdlatex-mode' is active and if the cursor is
+ - inside a LaTeX fragment, or
+ - after the first word in a line, where an abbreviation expansion could
+ insert a LaTeX environment."
+ (when org-cdlatex-mode
+ (cond
+ ;; Before any word on the line: No expansion possible.
+ ((save-excursion (skip-chars-backward " \t") (bolp)) nil)
+ ;; Just after first word on the line: Expand it. Make sure it
+ ;; cannot happen on headlines, though.
+ ((save-excursion
+ (skip-chars-backward "a-zA-Z0-9*")
+ (skip-chars-backward " \t")
+ (and (bolp) (not (org-at-heading-p))))
+ (cdlatex-tab) t)
+ ((org-inside-LaTeX-fragment-p) (cdlatex-tab) t))))
+
+(defun org-cdlatex-underscore-caret (&optional _arg)
+ "Execute `cdlatex-sub-superscript' in LaTeX fragments.
+Revert to the normal definition outside of these fragments."
+ (interactive "P")
+ (if (org-inside-LaTeX-fragment-p)
+ (call-interactively 'cdlatex-sub-superscript)
+ (let (org-cdlatex-mode)
+ (call-interactively (key-binding (vector last-input-event))))))
+
+(defun org-cdlatex-math-modify (&optional _arg)
+ "Execute `cdlatex-math-modify' in LaTeX fragments.
+Revert to the normal definition outside of these fragments."
+ (interactive "P")
+ (if (org-inside-LaTeX-fragment-p)
+ (call-interactively 'cdlatex-math-modify)
+ (let (org-cdlatex-mode)
+ (call-interactively (key-binding (vector last-input-event))))))
+
+(defun org-cdlatex-environment-indent (&optional environment item)
+ "Execute `cdlatex-environment' and indent the inserted environment.
+
+ENVIRONMENT and ITEM are passed to `cdlatex-environment'.
+
+The inserted environment is indented to current indentation
+unless point is at the beginning of the line, in which the
+environment remains unintended."
+ (interactive)
+ ;; cdlatex-environment always return nil. Therefore, capture output
+ ;; first and determine if an environment was selected.
+ (let* ((beg (point-marker))
+ (end (copy-marker (point) t))
+ (inserted (progn
+ (ignore-errors (cdlatex-environment environment item))
+ (< beg end)))
+ ;; Figure out how many lines to move forward after the
+ ;; environment has been inserted.
+ (lines (when inserted
+ (save-excursion
+ (- (cl-loop while (< beg (point))
+ with x = 0
+ do (forward-line -1)
+ (cl-incf x)
+ finally return x)
+ (if (progn (goto-char beg)
+ (and (progn (skip-chars-forward " \t") (eolp))
+ (progn (skip-chars-backward " \t") (bolp))))
+ 1 0)))))
+ (env (org-trim (delete-and-extract-region beg end))))
+ (when inserted
+ ;; Get indentation of next line unless at column 0.
+ (let ((ind (if (bolp) 0
+ (save-excursion
+ (org-return t)
+ (prog1 (current-indentation)
+ (when (progn (skip-chars-forward " \t") (eolp))
+ (delete-region beg (point)))))))
+ (bol (progn (skip-chars-backward " \t") (bolp))))
+ ;; Insert a newline before environment unless at column zero
+ ;; to "escape" the current line. Insert a newline if
+ ;; something is one the same line as \end{ENVIRONMENT}.
+ (insert
+ (concat (unless bol "\n") env
+ (when (and (skip-chars-forward " \t") (not (eolp))) "\n")))
+ (unless (zerop ind)
+ (save-excursion
+ (goto-char beg)
+ (while (< (point) end)
+ (unless (eolp) (indent-line-to ind))
+ (forward-line))))
+ (goto-char beg)
+ (forward-line lines)
+ (indent-line-to ind)))
+ (set-marker beg nil)
+ (set-marker end nil)))
+
+
+;;;; LaTeX fragments
+
+(defun org-inside-LaTeX-fragment-p ()
+ "Test if point is inside a LaTeX fragment.
+I.e. after a \\begin, \\(, \\[, $, or $$, without the corresponding closing
+sequence appearing also before point.
+Even though the matchers for math are configurable, this function assumes
+that \\begin, \\(, \\[, and $$ are always used. Only the single dollar
+delimiters are skipped when they have been removed by customization.
+The return value is nil, or a cons cell with the delimiter and the
+position of this delimiter.
+
+This function does a reasonably good job, but can locally be fooled by
+for example currency specifications. For example it will assume being in
+inline math after \"$22.34\". The LaTeX fragment formatter will only format
+fragments that are properly closed, but during editing, we have to live
+with the uncertainty caused by missing closing delimiters. This function
+looks only before point, not after."
+ (catch 'exit
+ (let ((pos (point))
+ (dodollar (member "$" (plist-get org-format-latex-options :matchers)))
+ (lim (progn
+ (re-search-backward (concat "^\\(" paragraph-start "\\)") nil
+ 'move)
+ (point)))
+ dd-on str (start 0) m re)
+ (goto-char pos)
+ (when dodollar
+ (setq str (concat (buffer-substring lim (point)) "\000 X$.")
+ re (nth 1 (assoc "$" org-latex-regexps)))
+ (while (string-match re str start)
+ (cond
+ ((= (match-end 0) (length str))
+ (throw 'exit (cons "$" (+ lim (match-beginning 0) 1))))
+ ((= (match-end 0) (- (length str) 5))
+ (throw 'exit nil))
+ (t (setq start (match-end 0))))))
+ (when (setq m (re-search-backward "\\(\\\\begin{[^}]*}\\|\\\\(\\|\\\\\\[\\)\\|\\(\\\\end{[^}]*}\\|\\\\)\\|\\\\\\]\\)\\|\\(\\$\\$\\)" lim t))
+ (goto-char pos)
+ (and (match-beginning 1) (throw 'exit (cons (match-string 1) m)))
+ (and (match-beginning 2) (throw 'exit nil))
+ ;; count $$
+ (while (re-search-backward "\\$\\$" lim t)
+ (setq dd-on (not dd-on)))
+ (goto-char pos)
+ (when dd-on (cons "$$" m))))))
+
+(defun org-inside-latex-macro-p ()
+ "Is point inside a LaTeX macro or its arguments?"
+ (save-match-data
+ (org-in-regexp
+ "\\\\[a-zA-Z]+\\*?\\(\\(\\[[^][\n{}]*\\]\\)\\|\\({[^{}\n]*}\\)\\)*")))
+
+(defun org--make-preview-overlay (beg end image &optional imagetype)
+ "Build an overlay between BEG and END using IMAGE file.
+Argument IMAGETYPE is the extension of the displayed image,
+as a string. It defaults to \"png\"."
+ (let ((ov (make-overlay beg end))
+ (imagetype (or (intern imagetype) 'png)))
+ (overlay-put ov 'org-overlay-type 'org-latex-overlay)
+ (overlay-put ov 'evaporate t)
+ (overlay-put ov
+ 'modification-hooks
+ (list (lambda (o _flag _beg _end &optional _l)
+ (delete-overlay o))))
+ (overlay-put ov
+ 'display
+ (list 'image :type imagetype :file image :ascent 'center))))
+
+(defun org-clear-latex-preview (&optional beg end)
+ "Remove all overlays with LaTeX fragment images in current buffer.
+When optional arguments BEG and END are non-nil, remove all
+overlays between them instead. Return a non-nil value when some
+overlays were removed, nil otherwise."
+ (let ((overlays
+ (cl-remove-if-not
+ (lambda (o) (eq (overlay-get o 'org-overlay-type) 'org-latex-overlay))
+ (overlays-in (or beg (point-min)) (or end (point-max))))))
+ (mapc #'delete-overlay overlays)
+ overlays))
+
+(defun org--latex-preview-region (beg end)
+ "Preview LaTeX fragments between BEG and END.
+BEG and END are buffer positions."
+ (let ((file (buffer-file-name (buffer-base-buffer))))
+ (save-excursion
+ (org-format-latex
+ (concat org-preview-latex-image-directory "org-ltximg")
+ beg end
+ ;; Emacs cannot overlay images from remote hosts. Create it in
+ ;; `temporary-file-directory' instead.
+ (if (or (not file) (file-remote-p file))
+ temporary-file-directory
+ default-directory)
+ 'overlays nil 'forbuffer org-preview-latex-default-process))))
+
+(defun org-latex-preview (&optional arg)
+ "Toggle preview of the LaTeX fragment at point.
+
+If the cursor is on a LaTeX fragment, create the image and
+overlay it over the source code, if there is none. Remove it
+otherwise. If there is no fragment at point, display images for
+all fragments in the current section.
+
+With a `\\[universal-argument]' prefix argument ARG, clear images \
+for all fragments
+in the current section.
+
+With a `\\[universal-argument] \\[universal-argument]' prefix \
+argument ARG, display image for all
+fragments in the buffer.
+
+With a `\\[universal-argument] \\[universal-argument] \
+\\[universal-argument]' prefix argument ARG, clear image for all
+fragments in the buffer."
+ (interactive "P")
+ (cond
+ ((not (display-graphic-p)) nil)
+ ;; Clear whole buffer.
+ ((equal arg '(64))
+ (org-clear-latex-preview (point-min) (point-max))
+ (message "LaTeX previews removed from buffer"))
+ ;; Preview whole buffer.
+ ((equal arg '(16))
+ (message "Creating LaTeX previews in buffer...")
+ (org--latex-preview-region (point-min) (point-max))
+ (message "Creating LaTeX previews in buffer... done."))
+ ;; Clear current section.
+ ((equal arg '(4))
+ (org-clear-latex-preview
+ (if (org-before-first-heading-p) (point-min)
+ (save-excursion
+ (org-with-limited-levels (org-back-to-heading t) (point))))
+ (org-with-limited-levels (org-entry-end-position))))
+ ;; Toggle preview on LaTeX code at point.
+ ((let ((datum (org-element-context)))
+ (and (memq (org-element-type datum) '(latex-environment latex-fragment))
+ (let ((beg (org-element-property :begin datum))
+ (end (org-element-property :end datum)))
+ (if (org-clear-latex-preview beg end)
+ (message "LaTeX preview removed")
+ (message "Creating LaTeX preview...")
+ (org--latex-preview-region beg end)
+ (message "Creating LaTeX preview... done."))
+ t))))
+ ;; Preview current section.
+ (t
+ (let ((beg (if (org-before-first-heading-p) (point-min)
+ (save-excursion
+ (org-with-limited-levels (org-back-to-heading t) (point)))))
+ (end (org-with-limited-levels (org-entry-end-position))))
+ (message "Creating LaTeX previews in section...")
+ (org--latex-preview-region beg end)
+ (message "Creating LaTeX previews in section... done.")))))
+
+(defun org-format-latex
+ (prefix &optional beg end dir overlays msg forbuffer processing-type)
+ "Replace LaTeX fragments with links to an image.
+
+The function takes care of creating the replacement image.
+
+Only consider fragments between BEG and END when those are
+provided.
+
+When optional argument OVERLAYS is non-nil, display the image on
+top of the fragment instead of replacing it.
+
+PROCESSING-TYPE is the conversion method to use, as a symbol.
+
+Some of the options can be changed using the variable
+`org-format-latex-options', which see."
+ (when (and overlays (fboundp 'clear-image-cache)) (clear-image-cache))
+ (unless (eq processing-type 'verbatim)
+ (let* ((math-regexp "\\$\\|\\\\[([]\\|^[ \t]*\\\\begin{[A-Za-z0-9*]+}")
+ (cnt 0)
+ checkdir-flag)
+ (goto-char (or beg (point-min)))
+ ;; Optimize overlay creation: (info "(elisp) Managing Overlays").
+ (when (and overlays (memq processing-type '(dvipng imagemagick)))
+ (overlay-recenter (or end (point-max))))
+ (while (re-search-forward math-regexp end t)
+ (unless (and overlays
+ (eq (get-char-property (point) 'org-overlay-type)
+ 'org-latex-overlay))
+ (let* ((context (org-element-context))
+ (type (org-element-type context)))
+ (when (memq type '(latex-environment latex-fragment))
+ (let ((block-type (eq type 'latex-environment))
+ (value (org-element-property :value context))
+ (beg (org-element-property :begin context))
+ (end (save-excursion
+ (goto-char (org-element-property :end context))
+ (skip-chars-backward " \r\t\n")
+ (point))))
+ (cond
+ ((eq processing-type 'mathjax)
+ ;; Prepare for MathJax processing.
+ (if (not (string-match "\\`\\$\\$?" value))
+ (goto-char end)
+ (delete-region beg end)
+ (if (string= (match-string 0 value) "$$")
+ (insert "\\[" (substring value 2 -2) "\\]")
+ (insert "\\(" (substring value 1 -1) "\\)"))))
+ ((eq processing-type 'html)
+ (goto-char beg)
+ (delete-region beg end)
+ (insert (org-format-latex-as-html value)))
+ ((assq processing-type org-preview-latex-process-alist)
+ ;; Process to an image.
+ (cl-incf cnt)
+ (goto-char beg)
+ (let* ((processing-info
+ (cdr (assq processing-type org-preview-latex-process-alist)))
+ (face (face-at-point))
+ ;; Get the colors from the face at point.
+ (fg
+ (let ((color (plist-get org-format-latex-options
+ :foreground)))
+ (if forbuffer
+ (cond
+ ((eq color 'auto)
+ (face-attribute face :foreground nil 'default))
+ ((eq color 'default)
+ (face-attribute 'default :foreground nil))
+ (t color))
+ color)))
+ (bg
+ (let ((color (plist-get org-format-latex-options
+ :background)))
+ (if forbuffer
+ (cond
+ ((eq color 'auto)
+ (face-attribute face :background nil 'default))
+ ((eq color 'default)
+ (face-attribute 'default :background nil))
+ (t color))
+ color)))
+ (hash (sha1 (prin1-to-string
+ (list org-format-latex-header
+ org-latex-default-packages-alist
+ org-latex-packages-alist
+ org-format-latex-options
+ forbuffer value fg bg))))
+ (imagetype (or (plist-get processing-info :image-output-type) "png"))
+ (absprefix (expand-file-name prefix dir))
+ (linkfile (format "%s_%s.%s" prefix hash imagetype))
+ (movefile (format "%s_%s.%s" absprefix hash imagetype))
+ (sep (and block-type "\n\n"))
+ (link (concat sep "[[file:" linkfile "]]" sep))
+ (options
+ (org-combine-plists
+ org-format-latex-options
+ `(:foreground ,fg :background ,bg))))
+ (when msg (message msg cnt))
+ (unless checkdir-flag ; Ensure the directory exists.
+ (setq checkdir-flag t)
+ (let ((todir (file-name-directory absprefix)))
+ (unless (file-directory-p todir)
+ (make-directory todir t))))
+ (unless (file-exists-p movefile)
+ (org-create-formula-image
+ value movefile options forbuffer processing-type))
+ (if overlays
+ (progn
+ (dolist (o (overlays-in beg end))
+ (when (eq (overlay-get o 'org-overlay-type)
+ 'org-latex-overlay)
+ (delete-overlay o)))
+ (org--make-preview-overlay beg end movefile imagetype)
+ (goto-char end))
+ (delete-region beg end)
+ (insert
+ (org-add-props link
+ (list 'org-latex-src
+ (replace-regexp-in-string "\"" "" value)
+ 'org-latex-src-embed-type
+ (if block-type 'paragraph 'character)))))))
+ ((eq processing-type 'mathml)
+ ;; Process to MathML.
+ (unless (org-format-latex-mathml-available-p)
+ (user-error "LaTeX to MathML converter not configured"))
+ (cl-incf cnt)
+ (when msg (message msg cnt))
+ (goto-char beg)
+ (delete-region beg end)
+ (insert (org-format-latex-as-mathml
+ value block-type prefix dir)))
+ (t
+ (error "Unknown conversion process %s for LaTeX fragments"
+ processing-type)))))))))))
+
+(defun org-create-math-formula (latex-frag &optional mathml-file)
+ "Convert LATEX-FRAG to MathML and store it in MATHML-FILE.
+Use `org-latex-to-mathml-convert-command'. If the conversion is
+successful, return the portion between \"<math...> </math>\"
+elements otherwise return nil. When MATHML-FILE is specified,
+write the results in to that file. When invoked as an
+interactive command, prompt for LATEX-FRAG, with initial value
+set to the current active region and echo the results for user
+inspection."
+ (interactive (list (let ((frag (when (org-region-active-p)
+ (buffer-substring-no-properties
+ (region-beginning) (region-end)))))
+ (read-string "LaTeX Fragment: " frag nil frag))))
+ (unless latex-frag (user-error "Invalid LaTeX fragment"))
+ (let* ((tmp-in-file
+ (let ((file (file-relative-name
+ (make-temp-name (expand-file-name "ltxmathml-in")))))
+ (write-region latex-frag nil file)
+ file))
+ (tmp-out-file (file-relative-name
+ (make-temp-name (expand-file-name "ltxmathml-out"))))
+ (cmd (format-spec
+ org-latex-to-mathml-convert-command
+ `((?j . ,(and org-latex-to-mathml-jar-file
+ (shell-quote-argument
+ (expand-file-name
+ org-latex-to-mathml-jar-file))))
+ (?I . ,(shell-quote-argument tmp-in-file))
+ (?i . ,latex-frag)
+ (?o . ,(shell-quote-argument tmp-out-file)))))
+ mathml shell-command-output)
+ (when (called-interactively-p 'any)
+ (unless (org-format-latex-mathml-available-p)
+ (user-error "LaTeX to MathML converter not configured")))
+ (message "Running %s" cmd)
+ (setq shell-command-output (shell-command-to-string cmd))
+ (setq mathml
+ (when (file-readable-p tmp-out-file)
+ (with-current-buffer (find-file-noselect tmp-out-file t)
+ (goto-char (point-min))
+ (when (re-search-forward
+ (format "<math[^>]*?%s[^>]*?>\\(.\\|\n\\)*</math>"
+ (regexp-quote
+ "xmlns=\"http://www.w3.org/1998/Math/MathML\""))
+ nil t)
+ (prog1 (match-string 0) (kill-buffer))))))
+ (cond
+ (mathml
+ (setq mathml
+ (concat "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" mathml))
+ (when mathml-file
+ (write-region mathml nil mathml-file))
+ (when (called-interactively-p 'any)
+ (message mathml)))
+ ((warn "LaTeX to MathML conversion failed")
+ (message shell-command-output)))
+ (delete-file tmp-in-file)
+ (when (file-exists-p tmp-out-file)
+ (delete-file tmp-out-file))
+ mathml))
+
+(defun org-format-latex-as-mathml (latex-frag latex-frag-type
+ prefix &optional dir)
+ "Use `org-create-math-formula' but check local cache first."
+ (let* ((absprefix (expand-file-name prefix dir))
+ (print-length nil) (print-level nil)
+ (formula-id (concat
+ "formula-"
+ (sha1
+ (prin1-to-string
+ (list latex-frag
+ org-latex-to-mathml-convert-command)))))
+ (formula-cache (format "%s-%s.mathml" absprefix formula-id))
+ (formula-cache-dir (file-name-directory formula-cache)))
+
+ (unless (file-directory-p formula-cache-dir)
+ (make-directory formula-cache-dir t))
+
+ (unless (file-exists-p formula-cache)
+ (org-create-math-formula latex-frag formula-cache))
+
+ (if (file-exists-p formula-cache)
+ ;; Successful conversion. Return the link to MathML file.
+ (org-add-props
+ (format "[[file:%s]]" (file-relative-name formula-cache dir))
+ (list 'org-latex-src (replace-regexp-in-string "\"" "" latex-frag)
+ 'org-latex-src-embed-type (if latex-frag-type
+ 'paragraph 'character)))
+ ;; Failed conversion. Return the LaTeX fragment verbatim
+ latex-frag)))
+
+(defun org-format-latex-as-html (latex-fragment)
+ "Convert LATEX-FRAGMENT to HTML.
+This uses `org-latex-to-html-convert-command', which see."
+ (let ((cmd (format-spec org-latex-to-html-convert-command
+ `((?i . ,latex-fragment)))))
+ (message "Running %s" cmd)
+ (shell-command-to-string cmd)))
+
+(defun org--get-display-dpi ()
+ "Get the DPI of the display.
+The function assumes that the display has the same pixel width in
+the horizontal and vertical directions."
+ (if (display-graphic-p)
+ (round (/ (display-pixel-height)
+ (/ (display-mm-height) 25.4)))
+ (error "Attempt to calculate the dpi of a non-graphic display")))
+
+(defun org-create-formula-image
+ (string tofile options buffer &optional processing-type)
+ "Create an image from LaTeX source using external processes.
+
+The LaTeX STRING is saved to a temporary LaTeX file, then
+converted to an image file by process PROCESSING-TYPE defined in
+`org-preview-latex-process-alist'. A nil value defaults to
+`org-preview-latex-default-process'.
+
+The generated image file is eventually moved to TOFILE.
+
+The OPTIONS argument controls the size, foreground color and
+background color of the generated image.
+
+When BUFFER non-nil, this function is used for LaTeX previewing.
+Otherwise, it is used to deal with LaTeX snippets showed in
+a HTML file."
+ (let* ((processing-type (or processing-type
+ org-preview-latex-default-process))
+ (processing-info
+ (cdr (assq processing-type org-preview-latex-process-alist)))
+ (programs (plist-get processing-info :programs))
+ (error-message (or (plist-get processing-info :message) ""))
+ (image-input-type (plist-get processing-info :image-input-type))
+ (image-output-type (plist-get processing-info :image-output-type))
+ (post-clean (or (plist-get processing-info :post-clean)
+ '(".dvi" ".xdv" ".pdf" ".tex" ".aux" ".log"
+ ".svg" ".png" ".jpg" ".jpeg" ".out")))
+ (latex-header
+ (or (plist-get processing-info :latex-header)
+ (org-latex-make-preamble
+ (org-export-get-environment (org-export-get-backend 'latex))
+ org-format-latex-header
+ 'snippet)))
+ (latex-compiler (plist-get processing-info :latex-compiler))
+ (image-converter (plist-get processing-info :image-converter))
+ (tmpdir temporary-file-directory)
+ (texfilebase (make-temp-name
+ (expand-file-name "orgtex" tmpdir)))
+ (texfile (concat texfilebase ".tex"))
+ (image-size-adjust (or (plist-get processing-info :image-size-adjust)
+ '(1.0 . 1.0)))
+ (scale (* (if buffer (car image-size-adjust) (cdr image-size-adjust))
+ (or (plist-get options (if buffer :scale :html-scale)) 1.0)))
+ (dpi (* scale (if buffer (org--get-display-dpi) 140.0)))
+ (fg (or (plist-get options (if buffer :foreground :html-foreground))
+ "Black"))
+ (bg (or (plist-get options (if buffer :background :html-background))
+ "Transparent"))
+ (log-buf (get-buffer-create "*Org Preview LaTeX Output*"))
+ (resize-mini-windows nil)) ;Fix Emacs flicker when creating image.
+ (dolist (program programs)
+ (org-check-external-command program error-message))
+ (if (eq fg 'default)
+ (setq fg (org-latex-color :foreground))
+ (setq fg (org-latex-color-format fg)))
+ (setq bg (cond
+ ((eq bg 'default) (org-latex-color :background))
+ ((string= bg "Transparent") nil)
+ (t (org-latex-color-format bg))))
+ ;; Remove TeX \par at end of snippet to avoid trailing space.
+ (if (string-suffix-p string "\n")
+ (aset string (1- (length string)) ?%)
+ (setq string (concat string "%")))
+ (with-temp-file texfile
+ (insert latex-header)
+ (insert "\n\\begin{document}\n"
+ "\\definecolor{fg}{rgb}{" fg "}%\n"
+ (if bg
+ (concat "\\definecolor{bg}{rgb}{" bg "}%\n"
+ "\n\\pagecolor{bg}%\n")
+ "")
+ "\n{\\color{fg}\n"
+ string
+ "\n}\n"
+ "\n\\end{document}\n"))
+ (let* ((err-msg (format "Please adjust `%s' part of \
+`org-preview-latex-process-alist'."
+ processing-type))
+ (image-input-file
+ (org-compile-file
+ texfile latex-compiler image-input-type err-msg log-buf))
+ (image-output-file
+ (org-compile-file
+ image-input-file image-converter image-output-type err-msg log-buf
+ `((?D . ,(shell-quote-argument (format "%s" dpi)))
+ (?S . ,(shell-quote-argument (format "%s" (/ dpi 140.0))))))))
+ (copy-file image-output-file tofile 'replace)
+ (dolist (e post-clean)
+ (when (file-exists-p (concat texfilebase e))
+ (delete-file (concat texfilebase e))))
+ image-output-file)))
+
+(defun org-splice-latex-header (tpl def-pkg pkg snippets-p &optional extra)
+ "Fill a LaTeX header template TPL.
+In the template, the following place holders will be recognized:
+
+ [DEFAULT-PACKAGES] \\usepackage statements for DEF-PKG
+ [NO-DEFAULT-PACKAGES] do not include DEF-PKG
+ [PACKAGES] \\usepackage statements for PKG
+ [NO-PACKAGES] do not include PKG
+ [EXTRA] the string EXTRA
+ [NO-EXTRA] do not include EXTRA
+
+For backward compatibility, if both the positive and the negative place
+holder is missing, the positive one (without the \"NO-\") will be
+assumed to be present at the end of the template.
+DEF-PKG and PKG are assumed to be alists of options/packagename lists.
+EXTRA is a string.
+SNIPPETS-P indicates if this is run to create snippet images for HTML."
+ (let (rpl (end ""))
+ (if (string-match "^[ \t]*\\[\\(NO-\\)?DEFAULT-PACKAGES\\][ \t]*\n?" tpl)
+ (setq rpl (if (or (match-end 1) (not def-pkg))
+ "" (org-latex-packages-to-string def-pkg snippets-p t))
+ tpl (replace-match rpl t t tpl))
+ (when def-pkg (setq end (org-latex-packages-to-string def-pkg snippets-p))))
+
+ (if (string-match "\\[\\(NO-\\)?PACKAGES\\][ \t]*\n?" tpl)
+ (setq rpl (if (or (match-end 1) (not pkg))
+ "" (org-latex-packages-to-string pkg snippets-p t))
+ tpl (replace-match rpl t t tpl))
+ (when pkg (setq end
+ (concat end "\n"
+ (org-latex-packages-to-string pkg snippets-p)))))
+
+ (if (string-match "\\[\\(NO-\\)?EXTRA\\][ \t]*\n?" tpl)
+ (setq rpl (if (or (match-end 1) (not extra))
+ "" (concat extra "\n"))
+ tpl (replace-match rpl t t tpl))
+ (when (and extra (string-match "\\S-" extra))
+ (setq end (concat end "\n" extra))))
+
+ (if (string-match "\\S-" end)
+ (concat tpl "\n" end)
+ tpl)))
+
+(defun org-latex-packages-to-string (pkg &optional snippets-p newline)
+ "Turn an alist of packages into a string with the \\usepackage macros."
+ (setq pkg (mapconcat (lambda(p)
+ (cond
+ ((stringp p) p)
+ ((and snippets-p (>= (length p) 3) (not (nth 2 p)))
+ (format "%% Package %s omitted" (cadr p)))
+ ((equal "" (car p))
+ (format "\\usepackage{%s}" (cadr p)))
+ (t
+ (format "\\usepackage[%s]{%s}"
+ (car p) (cadr p)))))
+ pkg
+ "\n"))
+ (if newline (concat pkg "\n") pkg))
+
+(defun org-dvipng-color (attr)
+ "Return a RGB color specification for dvipng."
+ (org-dvipng-color-format (face-attribute 'default attr nil)))
+
+(defun org-dvipng-color-format (color-name)
+ "Convert COLOR-NAME to a RGB color value for dvipng."
+ (apply #'format "rgb %s %s %s"
+ (mapcar 'org-normalize-color
+ (color-values color-name))))
+
+(defun org-latex-color (attr)
+ "Return a RGB color for the LaTeX color package."
+ (org-latex-color-format (face-attribute 'default attr nil)))
+
+(defun org-latex-color-format (color-name)
+ "Convert COLOR-NAME to a RGB color value."
+ (apply #'format "%s,%s,%s"
+ (mapcar 'org-normalize-color
+ (color-values color-name))))
+
+(defun org-normalize-color (value)
+ "Return string to be used as color value for an RGB component."
+ (format "%g" (/ value 65535.0)))
+
+
+;; Image display
+
+(defvar-local org-inline-image-overlays nil)
+
+(defun org-toggle-inline-images (&optional include-linked)
+ "Toggle the display of inline images.
+INCLUDE-LINKED is passed to `org-display-inline-images'."
+ (interactive "P")
+ (if org-inline-image-overlays
+ (progn
+ (org-remove-inline-images)
+ (when (called-interactively-p 'interactive)
+ (message "Inline image display turned off")))
+ (org-display-inline-images include-linked)
+ (when (called-interactively-p 'interactive)
+ (message (if org-inline-image-overlays
+ (format "%d images displayed inline"
+ (length org-inline-image-overlays))
+ "No images to display inline")))))
+
+(defun org-redisplay-inline-images ()
+ "Assure display of inline images and refresh them."
+ (interactive)
+ (org-toggle-inline-images)
+ (unless org-inline-image-overlays
+ (org-toggle-inline-images)))
+
+;; For without-x builds.
+(declare-function image-refresh "image" (spec &optional frame))
+
+(defcustom org-display-remote-inline-images 'skip
+ "How to display remote inline images.
+Possible values of this option are:
+
+skip Don't display remote images.
+download Always download and display remote images.
+cache Display remote images, and open them in separate buffers
+ for caching. Silently update the image buffer when a file
+ change is detected."
+ :group 'org-appearance
+ :package-version '(Org . "9.4")
+ :type '(choice
+ (const :tag "Ignore remote images" skip)
+ (const :tag "Always display remote images" download)
+ (const :tag "Display and silently update remote images" cache))
+ :safe #'symbolp)
+
+(defun org--create-inline-image (file width)
+ "Create image located at FILE, or return nil.
+WIDTH is the width of the image. The image may not be created
+according to the value of `org-display-remote-inline-images'."
+ (let* ((remote? (file-remote-p file))
+ (file-or-data
+ (pcase org-display-remote-inline-images
+ ((guard (not remote?)) file)
+ (`download (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (insert-file-contents-literally file)
+ (buffer-string)))
+ (`cache (let ((revert-without-query '(".")))
+ (with-current-buffer (find-file-noselect file)
+ (buffer-string))))
+ (`skip nil)
+ (other
+ (message "Invalid value of `org-display-remote-inline-images': %S"
+ other)
+ nil))))
+ (when file-or-data
+ (create-image file-or-data
+ (and (image-type-available-p 'imagemagick)
+ width
+ 'imagemagick)
+ remote?
+ :width width))))
+
+(defun org-display-inline-images (&optional include-linked refresh beg end)
+ "Display inline images.
+
+An inline image is a link which follows either of these
+conventions:
+
+ 1. Its path is a file with an extension matching return value
+ from `image-file-name-regexp' and it has no contents.
+
+ 2. Its description consists in a single link of the previous
+ type. In this case, that link must be a well-formed plain
+ or angle link, i.e., it must have an explicit \"file\" type.
+
+Equip each image with the key-map `image-map'.
+
+When optional argument INCLUDE-LINKED is non-nil, also links with
+a text description part will be inlined. This can be nice for
+a quick look at those images, but it does not reflect what
+exported files will look like.
+
+When optional argument REFRESH is non-nil, refresh existing
+images between BEG and END. This will create new image displays
+only if necessary.
+
+BEG and END define the considered part. They default to the
+buffer boundaries with possible narrowing."
+ (interactive "P")
+ (when (display-graphic-p)
+ (unless refresh
+ (org-remove-inline-images)
+ (when (fboundp 'clear-image-cache) (clear-image-cache)))
+ (let ((end (or end (point-max))))
+ (org-with-point-at (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:\\|attachment:\\|[./~]\\)\\|\\]\\[\\(<?file:\\)"
+ (if (not link-abbrevs) ""
+ (concat "\\|" (regexp-opt link-abbrevs))))))
+ (while (re-search-forward file-types-re end t)
+ (let* ((link (org-element-lineage
+ (save-match-data (org-element-context))
+ '(link) t))
+ (linktype (org-element-property :type link))
+ (inner-start (match-beginning 1))
+ (path
+ (cond
+ ;; No link at point; no inline image.
+ ((not link) nil)
+ ;; File link without a description. Also handle
+ ;; INCLUDE-LINKED here since it should have
+ ;; precedence over the next case. I.e., if link
+ ;; contains filenames in both the path and the
+ ;; description, prioritize the path only when
+ ;; INCLUDE-LINKED is non-nil.
+ ((or (not (org-element-property :contents-begin link))
+ include-linked)
+ (and (or (equal "file" linktype)
+ (equal "attachment" linktype))
+ (org-element-property :path link)))
+ ;; Link with a description. Check if description
+ ;; is a filename. Even if Org doesn't have syntax
+ ;; for those -- clickable image -- constructs, fake
+ ;; them, as in `org-export-insert-image-links'.
+ ((not inner-start) nil)
+ (t
+ (org-with-point-at inner-start
+ (and (looking-at
+ (if (char-equal ?< (char-after inner-start))
+ org-link-angle-re
+ org-link-plain-re))
+ ;; File name must fill the whole
+ ;; description.
+ (= (org-element-property :contents-end link)
+ (match-end 0))
+ (match-string 2)))))))
+ (when (and path (string-match-p file-extension-re path))
+ (let ((file (if (equal "attachment" linktype)
+ (progn
+ (require 'org-attach)
+ (ignore-errors (org-attach-expand path)))
+ (expand-file-name path))))
+ (when (and file (file-exists-p file))
+ (let ((width (org-display-inline-image--width link))
+ (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 (org--create-inline-image file 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))
+ (when (boundp 'image-map)
+ (overlay-put ov 'keymap image-map))
+ (push ov org-inline-image-overlays))))))))))))))))
+
+(defvar visual-fill-column-width) ; Silence compiler warning
+(defun org-display-inline-image--width (link)
+ "Determine the display width of the image LINK, in pixels.
+- When `org-image-actual-width' is t, the image's pixel width is used.
+- When `org-image-actual-width' is a number, that value will is used.
+- When `org-image-actual-width' is nil or a list, the first :width attribute
+ set (if it exists) is used to set the image width. A width of X% is
+ divided by 100.
+ If no :width attribute is given and `org-image-actual-width' is a list with
+ a number as the car, then that number is used as the default value.
+ If the value is a float between 0 and 2, it interpreted as that proportion
+ of the text width in the buffer."
+ ;; Apply `org-image-actual-width' specifications.
+ (cond
+ ((eq org-image-actual-width t) nil)
+ ((listp org-image-actual-width)
+ (let* ((case-fold-search t)
+ (par (org-element-lineage link '(paragraph)))
+ (attr-re "^[ \t]*#\\+attr_.*?: +.*?:width +\\(\\S-+\\)")
+ (par-end (org-element-property :post-affiliated par))
+ ;; Try to find an attribute providing a :width.
+ (attr-width
+ (when (and par (org-with-point-at
+ (org-element-property :begin par)
+ (re-search-forward attr-re par-end t)))
+ (match-string 1)))
+ (attr-width-val
+ (cond
+ ((null attr-width) nil)
+ ((string-match-p "\\`[0-9.]+%" attr-width)
+ (/ (string-to-number attr-width) 100.0))
+ (t (string-to-number attr-width))))
+ ;; Fallback to `org-image-actual-width' if no explicit width is given.
+ (width (or attr-width-val (car org-image-actual-width))))
+ (if (and (floatp width) (<= 0.0 width 2.0))
+ ;; A float in [0,2] should be interpereted as this portion of
+ ;; the text width in the window. This works well with cases like
+ ;; #+attr_latex: :width 0.X\{line,page,column,etc.}width,
+ ;; as the "0.X" is pulled out as a float. We use 2 as the upper
+ ;; bound as cases such as 1.2\linewidth are feasible.
+ (round (* width
+ (window-pixel-width)
+ (/ (or (and (bound-and-true-p visual-fill-column-mode)
+ (or visual-fill-column-width auto-fill-function))
+ (when auto-fill-function fill-column)
+ (window-text-width))
+ (float (window-total-width)))))
+ width)))
+ ((numberp org-image-actual-width)
+ org-image-actual-width)
+ (t nil)))
+
+(defun org-display-inline-remove-overlay (ov after _beg _end &optional _len)
+ "Remove inline-display overlay if a corresponding region is modified."
+ (let ((inhibit-modification-hooks t))
+ (when (and ov after)
+ (delete ov org-inline-image-overlays)
+ (delete-overlay ov))))
+
+(defun org-remove-inline-images ()
+ "Remove inline display of images."
+ (interactive)
+ (mapc #'delete-overlay org-inline-image-overlays)
+ (setq org-inline-image-overlays nil))
+
+(defvar org-self-insert-command-undo-counter 0)
+(defvar org-speed-command nil)
+
+(defun org-self-insert-command (N)
+ "Like `self-insert-command', use overwrite-mode for whitespace in tables.
+If the cursor is in a table looking at whitespace, the whitespace is
+overwritten, and the table is not marked as requiring realignment."
+ (interactive "p")
+ (org-check-before-invisible-edit 'insert)
+ (cond
+ ((and org-use-speed-commands
+ (let ((kv (this-command-keys-vector)))
+ (setq org-speed-command
+ (run-hook-with-args-until-success
+ 'org-speed-command-hook
+ (make-string 1 (aref kv (1- (length kv))))))))
+ (cond
+ ((commandp org-speed-command)
+ (setq this-command org-speed-command)
+ (call-interactively org-speed-command))
+ ((functionp org-speed-command)
+ (funcall org-speed-command))
+ ((and org-speed-command (listp org-speed-command))
+ (eval org-speed-command))
+ (t (let (org-use-speed-commands)
+ (call-interactively 'org-self-insert-command)))))
+ ((and
+ (= 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
+ (memq last-command
+ '(org-cycle org-return org-shifttab org-ctrl-c-ctrl-c))
+ (if (or (eq (char-after) ?\s) (looking-at "[^|\n]* |"))
+ ;; Got extra space, this field does not determine
+ ;; column width.
+ (let (org-table-may-need-update) (org-table-blank-field))
+ ;; No extra space, this field may determine column
+ ;; width.
+ (org-table-blank-field)))
+ t)
+ (looking-at "[^|\n]* |"))
+ ;; There is room for insertion without re-aligning the table.
+ (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)
+ (org-fix-tags-on-the-fly)
+ (when org-self-insert-cluster-for-undo
+ (if (not (eq last-command 'org-self-insert-command))
+ (setq org-self-insert-command-undo-counter 1)
+ (if (>= org-self-insert-command-undo-counter 20)
+ (setq org-self-insert-command-undo-counter 1)
+ (and (> org-self-insert-command-undo-counter 0)
+ buffer-undo-list (listp buffer-undo-list)
+ (not (cadr buffer-undo-list)) ; remove nil entry
+ (setcdr buffer-undo-list (cddr buffer-undo-list)))
+ (setq org-self-insert-command-undo-counter
+ (1+ org-self-insert-command-undo-counter))))))))
+
+(defun org-check-before-invisible-edit (kind)
+ "Check if editing kind KIND would be dangerous with invisible text around.
+The detailed reaction depends on the user option `org-catch-invisible-edits'."
+ ;; First, try to get out of here as quickly as possible, to reduce overhead
+ (when (and org-catch-invisible-edits
+ (or (not (boundp 'visible-mode)) (not visible-mode))
+ (or (get-char-property (point) 'invisible)
+ (get-char-property (max (point-min) (1- (point))) 'invisible)))
+ ;; OK, we need to take a closer look. Do not consider
+ ;; invisibility obtained through text properties (e.g., link
+ ;; fontification), as it cannot be toggled.
+ (let* ((invisible-at-point
+ (pcase (get-char-property-and-overlay (point) 'invisible)
+ (`(,_ . ,(and (pred overlayp) o)) o)))
+ ;; Assume that point cannot land in the middle of an
+ ;; overlay, or between two overlays.
+ (invisible-before-point
+ (and (not invisible-at-point)
+ (not (bobp))
+ (pcase (get-char-property-and-overlay (1- (point)) 'invisible)
+ (`(,_ . ,(and (pred overlayp) o)) o))))
+ (border-and-ok-direction
+ (or
+ ;; Check if we are acting predictably before invisible
+ ;; text.
+ (and invisible-at-point
+ (memq kind '(insert delete-backward)))
+ ;; Check if we are acting predictably after invisible text
+ ;; This works not well, and I have turned it off. It seems
+ ;; better to always show and stop after invisible text.
+ ;; (and (not invisible-at-point) invisible-before-point
+ ;; (memq kind '(insert delete)))
+ )))
+ (when (or invisible-at-point invisible-before-point)
+ (when (eq org-catch-invisible-edits 'error)
+ (user-error "Editing in invisible areas is prohibited, make them visible first"))
+ (if (and org-custom-properties-overlays
+ (y-or-n-p "Display invisible properties in this buffer? "))
+ (org-toggle-custom-properties-visibility)
+ ;; Make the area visible
+ (save-excursion
+ (when invisible-before-point
+ (goto-char
+ (previous-single-char-property-change (point) 'invisible)))
+ ;; Remove whatever overlay is currently making yet-to-be
+ ;; edited text invisible. Also remove nested invisibility
+ ;; related overlays.
+ (delete-overlay (or invisible-at-point invisible-before-point))
+ (let ((origin (if invisible-at-point (point) (1- (point)))))
+ (while (pcase (get-char-property-and-overlay origin 'invisible)
+ (`(,_ . ,(and (pred overlayp) o))
+ (delete-overlay o)
+ t)))))
+ (cond
+ ((eq org-catch-invisible-edits 'show)
+ ;; That's it, we do the edit after showing
+ (message
+ "Unfolding invisible region around point before editing")
+ (sit-for 1))
+ ((and (eq org-catch-invisible-edits 'smart)
+ border-and-ok-direction)
+ (message "Unfolding invisible region around point before editing"))
+ (t
+ ;; Don't do the edit, make the user repeat it in full visibility
+ (user-error "Edit in invisible region aborted, repeat to confirm with text visible"))))))))
+
+(defun org-fix-tags-on-the-fly ()
+ "Align tags in headline at point.
+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.
+When deleting backwards, in tables this function will insert whitespace in
+front of the next \"|\" separator, to keep the table aligned. The table will
+still be marked for re-alignment if the field did fill the entire column,
+because, in this case the deletion might narrow the column."
+ (interactive "p")
+ (save-match-data
+ (org-check-before-invisible-edit 'delete-backward)
+ (if (and (= N 1)
+ (not overwrite-mode)
+ (not (org-region-active-p))
+ (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))))
+
+(defun org-delete-char (N)
+ "Like `delete-char', but insert whitespace at field end in tables.
+When deleting characters, in tables this function will insert whitespace in
+front of the next \"|\" separator, to keep the table aligned. The table will
+still be marked for re-alignment if the field did fill the entire column,
+because, in this case the deletion might narrow the column."
+ (interactive "p")
+ (save-match-data
+ (org-check-before-invisible-edit 'delete)
+ (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))
+ ((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
+ (lambda ()
+ (not (run-hook-with-args-until-success
+ 'self-insert-uses-region-functions))))
+(put 'orgtbl-self-insert-command 'delete-selection
+ (lambda ()
+ (not (run-hook-with-args-until-success
+ 'self-insert-uses-region-functions))))
+(put 'org-delete-char 'delete-selection 'supersede)
+(put 'org-delete-backward-char 'delete-selection 'supersede)
+(put 'org-yank 'delete-selection 'yank)
+(put 'org-return 'delete-selection t)
+
+;; Make `flyspell-mode' delay after some commands
+(put 'org-self-insert-command 'flyspell-delayed t)
+(put 'orgtbl-self-insert-command 'flyspell-delayed t)
+(put 'org-delete-char 'flyspell-delayed t)
+(put 'org-delete-backward-char 'flyspell-delayed t)
+
+;; Make pabbrev-mode expand after Org mode commands
+(put 'org-self-insert-command 'pabbrev-expand-after-command t)
+(put 'orgtbl-self-insert-command 'pabbrev-expand-after-command t)
+
+(defun org-transpose-words ()
+ "Transpose words for Org.
+This uses the `org-mode-transpose-word-syntax-table' syntax
+table, which interprets characters in `org-emphasis-alist' as
+word constituents."
+ (interactive)
+ (with-syntax-table org-mode-transpose-word-syntax-table
+ (call-interactively 'transpose-words)))
+
+(defvar org-ctrl-c-ctrl-c-hook nil
+ "Hook for functions attaching themselves to `C-c C-c'.
+
+This can be used to add additional functionality to the `C-c C-c'
+key which executes context-dependent commands. This hook is run
+before any other test, while `org-ctrl-c-ctrl-c-final-hook' is
+run after the last test.
+
+Each function will be called with no arguments. The function
+must check if the context is appropriate for it to act. If yes,
+it should do its thing and then return a non-nil value. If the
+context is wrong, just do nothing and return nil.")
+
+(defvar org-ctrl-c-ctrl-c-final-hook nil
+ "Hook for functions attaching themselves to `C-c C-c'.
+
+This can be used to add additional functionality to the `C-c C-c'
+key which executes context-dependent commands. This hook is run
+after any other test, while `org-ctrl-c-ctrl-c-hook' is run
+before the first test.
+
+Each function will be called with no arguments. The function
+must check if the context is appropriate for it to act. If yes,
+it should do its thing and then return a non-nil value. If the
+context is wrong, just do nothing and return nil.")
+
+(defvar org-tab-first-hook nil
+ "Hook for functions to attach themselves to TAB.
+See `org-ctrl-c-ctrl-c-hook' for more information.
+This hook runs as the first action when TAB is pressed, even before
+`org-cycle' messes around with the `outline-regexp' to cater for
+inline tasks and plain list item folding.
+If any function in this hook returns t, any other actions that
+would have been caused by TAB (such as table field motion or visibility
+cycling) will not occur.")
+
+(defvar org-tab-after-check-for-table-hook nil
+ "Hook for functions to attach themselves to TAB.
+See `org-ctrl-c-ctrl-c-hook' for more information.
+This hook runs after it has been established that the cursor is not in a
+table, but before checking if the cursor is in a headline or if global cycling
+should be done.
+If any function in this hook returns t, not other actions like visibility
+cycling will be done.")
+
+(defvar org-tab-after-check-for-cycling-hook nil
+ "Hook for functions to attach themselves to TAB.
+See `org-ctrl-c-ctrl-c-hook' for more information.
+This hook runs after it has been established that not table field motion and
+not visibility should be done because of current context. This is probably
+the place where a package like yasnippets can hook in.")
+
+(defvar org-tab-before-tab-emulation-hook nil
+ "Hook for functions to attach themselves to TAB.
+See `org-ctrl-c-ctrl-c-hook' for more information.
+This hook runs after every other options for TAB have been exhausted, but
+before indentation and \t insertion takes place.")
+
+(defvar org-metaleft-hook nil
+ "Hook for functions attaching themselves to `M-left'.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-metaright-hook nil
+ "Hook for functions attaching themselves to `M-right'.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-metaup-hook nil
+ "Hook for functions attaching themselves to `M-up'.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-metadown-hook nil
+ "Hook for functions attaching themselves to `M-down'.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-shiftmetaleft-hook nil
+ "Hook for functions attaching themselves to `M-S-left'.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-shiftmetaright-hook nil
+ "Hook for functions attaching themselves to `M-S-right'.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-shiftmetaup-hook nil
+ "Hook for functions attaching themselves to `M-S-up'.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-shiftmetadown-hook nil
+ "Hook for functions attaching themselves to `M-S-down'.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-metareturn-hook nil
+ "Hook for functions attaching themselves to `M-RET'.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-shiftup-hook nil
+ "Hook for functions attaching themselves to `S-up'.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-shiftup-final-hook nil
+ "Hook for functions attaching themselves to `S-up'.
+This one runs after all other options except shift-select have been excluded.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-shiftdown-hook nil
+ "Hook for functions attaching themselves to `S-down'.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-shiftdown-final-hook nil
+ "Hook for functions attaching themselves to `S-down'.
+This one runs after all other options except shift-select have been excluded.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-shiftleft-hook nil
+ "Hook for functions attaching themselves to `S-left'.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-shiftleft-final-hook nil
+ "Hook for functions attaching themselves to `S-left'.
+This one runs after all other options except shift-select have been excluded.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-shiftright-hook nil
+ "Hook for functions attaching themselves to `S-right'.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+(defvar org-shiftright-final-hook nil
+ "Hook for functions attaching themselves to `S-right'.
+This one runs after all other options except shift-select have been excluded.
+See `org-ctrl-c-ctrl-c-hook' for more information.")
+
+(defun org-modifier-cursor-error ()
+ "Throw an error, a modified cursor command was applied in wrong context."
+ (user-error "This command is active in special context like tables, headlines or items"))
+
+(defun org-shiftselect-error ()
+ "Throw an error because Shift-Cursor command was applied in wrong context."
+ (if (and (boundp 'shift-select-mode) shift-select-mode)
+ (user-error "To use shift-selection with Org mode, customize `org-support-shift-select'")
+ (user-error "This command works only in special context like headlines or timestamps")))
+
+(defun org-call-for-shift-select (cmd)
+ (let ((this-command-keys-shift-translated t))
+ (call-interactively cmd)))
+
+(defun org-shifttab (&optional arg)
+ "Global visibility cycling or move to previous table field.
+Call `org-table-previous-field' within a table.
+When ARG is nil, cycle globally through visibility states.
+When ARG is a numeric prefix, show contents of this level."
+ (interactive "P")
+ (cond
+ ((org-at-table-p) (call-interactively 'org-table-previous-field))
+ ((integerp arg)
+ (let ((arg2 (if org-odd-levels-only (1- (* 2 arg)) arg)))
+ (message "Content view to level: %d" arg)
+ (org-content (prefix-numeric-value arg2))
+ (org-cycle-show-empty-lines t)
+ (setq org-cycle-global-status 'overview)
+ (run-hook-with-args 'org-cycle-hook 'overview)))
+ (t (call-interactively 'org-global-cycle))))
+
+(defun org-shiftmetaleft ()
+ "Promote subtree or delete table column.
+Calls `org-promote-subtree', `org-outdent-item-tree', or
+`org-table-delete-column', depending on context. See the
+individual commands for more information."
+ (interactive)
+ (cond
+ ((run-hook-with-args-until-success 'org-shiftmetaleft-hook))
+ ((org-at-table-p) (call-interactively 'org-table-delete-column))
+ ((org-at-heading-p) (call-interactively 'org-promote-subtree))
+ ((if (not (org-region-active-p)) (org-at-item-p)
+ (save-excursion (goto-char (region-beginning))
+ (org-at-item-p)))
+ (call-interactively 'org-outdent-item-tree))
+ (t (org-modifier-cursor-error))))
+
+(defun org-shiftmetaright ()
+ "Demote subtree or insert table column.
+Calls `org-demote-subtree', `org-indent-item-tree', or
+`org-table-insert-column', depending on context. See the
+individual commands for more information."
+ (interactive)
+ (cond
+ ((run-hook-with-args-until-success 'org-shiftmetaright-hook))
+ ((org-at-table-p) (call-interactively 'org-table-insert-column))
+ ((org-at-heading-p) (call-interactively 'org-demote-subtree))
+ ((if (not (org-region-active-p)) (org-at-item-p)
+ (save-excursion (goto-char (region-beginning))
+ (org-at-item-p)))
+ (call-interactively 'org-indent-item-tree))
+ (t (org-modifier-cursor-error))))
+
+(defun org-shiftmetaup (&optional _arg)
+ "Drag the line at point up.
+In a table, kill the current row.
+On a clock timestamp, update the value of the timestamp like `S-<up>'
+but also adjust the previous clocked item in the clock history.
+Everywhere else, drag the line at point up."
+ (interactive "P")
+ (cond
+ ((run-hook-with-args-until-success 'org-shiftmetaup-hook))
+ ((org-at-table-p) (call-interactively 'org-table-kill-row))
+ ((org-at-clock-log-p) (let ((org-clock-adjust-closest t))
+ (call-interactively 'org-timestamp-up)))
+ (t (call-interactively 'org-drag-line-backward))))
+
+(defun org-shiftmetadown (&optional _arg)
+ "Drag the line at point down.
+In a table, insert an empty row at the current line.
+On a clock timestamp, update the value of the timestamp like `S-<down>'
+but also adjust the previous clocked item in the clock history.
+Everywhere else, drag the line at point down."
+ (interactive "P")
+ (cond
+ ((run-hook-with-args-until-success 'org-shiftmetadown-hook))
+ ((org-at-table-p) (call-interactively 'org-table-insert-row))
+ ((org-at-clock-log-p) (let ((org-clock-adjust-closest t))
+ (call-interactively 'org-timestamp-down)))
+ (t (call-interactively 'org-drag-line-forward))))
+
+(defsubst org-hidden-tree-error ()
+ (user-error
+ "Hidden subtree, open with TAB or use subtree command M-S-<left>/<right>"))
+
+(defun org-metaleft (&optional _arg)
+ "Promote heading, list item at point or move table column left.
+
+Calls `org-do-promote', `org-outdent-item' or `org-table-move-column',
+depending on context. With no specific context, calls the Emacs
+default `backward-word'. See the individual commands for more
+information.
+
+This function runs the hook `org-metaleft-hook' as a first step,
+and returns at first non-nil value."
+ (interactive "P")
+ (cond
+ ((run-hook-with-args-until-success 'org-metaleft-hook))
+ ((org-at-table-p) (org-call-with-arg 'org-table-move-column 'left))
+ ((org-with-limited-levels
+ (or (org-at-heading-p)
+ (and (org-region-active-p)
+ (save-excursion
+ (goto-char (region-beginning))
+ (org-at-heading-p)))))
+ (when (org-check-for-hidden 'headlines) (org-hidden-tree-error))
+ (call-interactively 'org-do-promote))
+ ;; At an inline task.
+ ((org-at-heading-p)
+ (call-interactively 'org-inlinetask-promote))
+ ((or (org-at-item-p)
+ (and (org-region-active-p)
+ (save-excursion
+ (goto-char (region-beginning))
+ (org-at-item-p))))
+ (when (org-check-for-hidden 'items) (org-hidden-tree-error))
+ (call-interactively 'org-outdent-item))
+ (t (call-interactively 'backward-word))))
+
+(defun org-metaright (&optional _arg)
+ "Demote heading, list item at point or move table column right.
+
+In front of a drawer or a block keyword, indent it correctly.
+
+Calls `org-do-demote', `org-indent-item', `org-table-move-column',
+`org-indent-drawer' or `org-indent-block' depending on context.
+With no specific context, calls the Emacs default `forward-word'.
+See the individual commands for more information.
+
+This function runs the hook `org-metaright-hook' as a first step,
+and returns at first non-nil value."
+ (interactive "P")
+ (cond
+ ((run-hook-with-args-until-success 'org-metaright-hook))
+ ((org-at-table-p) (call-interactively 'org-table-move-column))
+ ((org-at-drawer-p) (call-interactively 'org-indent-drawer))
+ ((org-at-block-p) (call-interactively 'org-indent-block))
+ ((org-with-limited-levels
+ (or (org-at-heading-p)
+ (and (org-region-active-p)
+ (save-excursion
+ (goto-char (region-beginning))
+ (org-at-heading-p)))))
+ (when (org-check-for-hidden 'headlines) (org-hidden-tree-error))
+ (call-interactively 'org-do-demote))
+ ;; At an inline task.
+ ((org-at-heading-p)
+ (call-interactively 'org-inlinetask-demote))
+ ((or (org-at-item-p)
+ (and (org-region-active-p)
+ (save-excursion
+ (goto-char (region-beginning))
+ (org-at-item-p))))
+ (when (org-check-for-hidden 'items) (org-hidden-tree-error))
+ (call-interactively 'org-indent-item))
+ (t (call-interactively 'forward-word))))
+
+(defun org-check-for-hidden (what)
+ "Check if there are hidden headlines/items in the current visual line.
+WHAT can be either `headlines' or `items'. If the current line is
+an outline or item heading and it has a folded subtree below it,
+this function returns t, nil otherwise."
+ (let ((re (cond
+ ((eq what 'headlines) org-outline-regexp-bol)
+ ((eq what 'items) (org-item-beginning-re))
+ (t (error "This should not happen"))))
+ beg end)
+ (save-excursion
+ (catch 'exit
+ (unless (org-region-active-p)
+ (setq beg (point-at-bol))
+ (beginning-of-line 2)
+ (while (and (not (eobp)) ;; this is like `next-line'
+ (get-char-property (1- (point)) 'invisible))
+ (beginning-of-line 2))
+ (setq end (point))
+ (goto-char beg)
+ (goto-char (point-at-eol))
+ (setq end (max end (point)))
+ (while (re-search-forward re end t)
+ (when (get-char-property (match-beginning 0) 'invisible)
+ (throw 'exit t))))
+ nil))))
+
+(defun org-metaup (&optional _arg)
+ "Move subtree up or move table row up.
+Calls `org-move-subtree-up' or `org-table-move-row' or
+`org-move-item-up', depending on context. See the individual commands
+for more information."
+ (interactive "P")
+ (cond
+ ((run-hook-with-args-until-success 'org-metaup-hook))
+ ((org-region-active-p)
+ (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))
+ ((and (featurep 'org-inlinetask)
+ (org-inlinetask-in-task-p))
+ (org-drag-element-backward))
+ ((org-at-heading-p) (call-interactively 'org-move-subtree-up))
+ ((org-at-item-p) (call-interactively 'org-move-item-up))
+ (t (org-drag-element-backward))))
+
+(defun org-metadown (&optional _arg)
+ "Move subtree down or move table row down.
+Calls `org-move-subtree-down' or `org-table-move-row' or
+`org-move-item-down', depending on context. See the individual
+commands for more information."
+ (interactive "P")
+ (cond
+ ((run-hook-with-args-until-success 'org-metadown-hook))
+ ((org-region-active-p)
+ (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))
+ ((and (featurep 'org-inlinetask)
+ (org-inlinetask-in-task-p))
+ (org-drag-element-forward))
+ ((org-at-heading-p) (call-interactively 'org-move-subtree-down))
+ ((org-at-item-p) (call-interactively 'org-move-item-down))
+ (t (org-drag-element-forward))))
+
+(defun org-shiftup (&optional arg)
+ "Act on current element according to context.
+Call `org-timestamp-up' or `org-priority-up', or
+`org-previous-item', or `org-table-move-cell-up'. See the
+individual commands for more information."
+ (interactive "P")
+ (cond
+ ((run-hook-with-args-until-success 'org-shiftup-hook))
+ ((and org-support-shift-select (org-region-active-p))
+ (org-call-for-shift-select 'previous-line))
+ ((org-at-timestamp-p 'lax)
+ (call-interactively (if org-edit-timestamp-down-means-later
+ 'org-timestamp-down 'org-timestamp-up)))
+ ((and (not (eq org-support-shift-select 'always))
+ org-priority-enable-commands
+ (org-at-heading-p))
+ (call-interactively 'org-priority-up))
+ ((and (not org-support-shift-select) (org-at-item-p))
+ (call-interactively 'org-previous-item))
+ ((org-clocktable-try-shift 'up arg))
+ ((and (not (eq org-support-shift-select 'always))
+ (org-at-table-p))
+ (org-table-move-cell-up))
+ ((run-hook-with-args-until-success 'org-shiftup-final-hook))
+ (org-support-shift-select
+ (org-call-for-shift-select 'previous-line))
+ (t (org-shiftselect-error))))
+
+(defun org-shiftdown (&optional arg)
+ "Act on current element according to context.
+Call `org-timestamp-down' or `org-priority-down', or
+`org-next-item', or `org-table-move-cell-down'. See the
+individual commands for more information."
+ (interactive "P")
+ (cond
+ ((run-hook-with-args-until-success 'org-shiftdown-hook))
+ ((and org-support-shift-select (org-region-active-p))
+ (org-call-for-shift-select 'next-line))
+ ((org-at-timestamp-p 'lax)
+ (call-interactively (if org-edit-timestamp-down-means-later
+ 'org-timestamp-up 'org-timestamp-down)))
+ ((and (not (eq org-support-shift-select 'always))
+ org-priority-enable-commands
+ (org-at-heading-p))
+ (call-interactively 'org-priority-down))
+ ((and (not org-support-shift-select) (org-at-item-p))
+ (call-interactively 'org-next-item))
+ ((org-clocktable-try-shift 'down arg))
+ ((and (not (eq org-support-shift-select 'always))
+ (org-at-table-p))
+ (org-table-move-cell-down))
+ ((run-hook-with-args-until-success 'org-shiftdown-final-hook))
+ (org-support-shift-select
+ (org-call-for-shift-select 'next-line))
+ (t (org-shiftselect-error))))
+
+(defun org-shiftright (&optional arg)
+ "Act on the current element according to 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 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
+- in a table, move a single cell right"
+ (interactive "P")
+ (cond
+ ((run-hook-with-args-until-success 'org-shiftright-hook))
+ ((and org-support-shift-select (org-region-active-p))
+ (org-call-for-shift-select 'forward-char))
+ ((org-at-timestamp-p 'lax) (call-interactively 'org-timestamp-up-day))
+ ((and (not (eq org-support-shift-select 'always))
+ (org-at-heading-p))
+ (let ((org-inhibit-logging
+ (not org-treat-S-cursor-todo-selection-as-state-change))
+ (org-inhibit-blocking
+ (not org-treat-S-cursor-todo-selection-as-state-change)))
+ (org-call-with-arg 'org-todo 'right)))
+ ((or (and org-support-shift-select
+ (not (eq org-support-shift-select 'always))
+ (org-at-item-bullet-p))
+ (and (not org-support-shift-select) (org-at-item-p)))
+ (org-call-with-arg 'org-cycle-list-bullet nil))
+ ((and (not (eq org-support-shift-select 'always))
+ (org-at-property-p))
+ (call-interactively 'org-property-next-allowed-value))
+ ((org-clocktable-try-shift 'right arg))
+ ((and (not (eq org-support-shift-select 'always))
+ (org-at-table-p))
+ (org-table-move-cell-right))
+ ((run-hook-with-args-until-success 'org-shiftright-final-hook))
+ (org-support-shift-select
+ (org-call-for-shift-select 'forward-char))
+ (t (org-shiftselect-error))))
+
+(defun org-shiftleft (&optional arg)
+ "Act on current element according to context.
+This does one of the following:
+
+- switch a timestamp at point one day into the past
+- on a headline, switch to the previous TODO keyword.
+- on an item, switch entire list to the previous bullet type
+- on a property line, switch to the previous allowed value
+- on a clocktable definition line, move time block into the past
+- in a table, move a single cell left"
+ (interactive "P")
+ (cond
+ ((run-hook-with-args-until-success 'org-shiftleft-hook))
+ ((and org-support-shift-select (org-region-active-p))
+ (org-call-for-shift-select 'backward-char))
+ ((org-at-timestamp-p 'lax) (call-interactively 'org-timestamp-down-day))
+ ((and (not (eq org-support-shift-select 'always))
+ (org-at-heading-p))
+ (let ((org-inhibit-logging
+ (not org-treat-S-cursor-todo-selection-as-state-change))
+ (org-inhibit-blocking
+ (not org-treat-S-cursor-todo-selection-as-state-change)))
+ (org-call-with-arg 'org-todo 'left)))
+ ((or (and org-support-shift-select
+ (not (eq org-support-shift-select 'always))
+ (org-at-item-bullet-p))
+ (and (not org-support-shift-select) (org-at-item-p)))
+ (org-call-with-arg 'org-cycle-list-bullet 'previous))
+ ((and (not (eq org-support-shift-select 'always))
+ (org-at-property-p))
+ (call-interactively 'org-property-previous-allowed-value))
+ ((org-clocktable-try-shift 'left arg))
+ ((and (not (eq org-support-shift-select 'always))
+ (org-at-table-p))
+ (org-table-move-cell-left))
+ ((run-hook-with-args-until-success 'org-shiftleft-final-hook))
+ (org-support-shift-select
+ (org-call-for-shift-select 'backward-char))
+ (t (org-shiftselect-error))))
+
+(defun org-shiftcontrolright ()
+ "Switch to next TODO set."
+ (interactive)
+ (cond
+ ((and org-support-shift-select (org-region-active-p))
+ (org-call-for-shift-select 'forward-word))
+ ((and (not (eq org-support-shift-select 'always))
+ (org-at-heading-p))
+ (org-call-with-arg 'org-todo 'nextset))
+ (org-support-shift-select
+ (org-call-for-shift-select 'forward-word))
+ (t (org-shiftselect-error))))
+
+(defun org-shiftcontrolleft ()
+ "Switch to previous TODO set."
+ (interactive)
+ (cond
+ ((and org-support-shift-select (org-region-active-p))
+ (org-call-for-shift-select 'backward-word))
+ ((and (not (eq org-support-shift-select 'always))
+ (org-at-heading-p))
+ (org-call-with-arg 'org-todo 'previousset))
+ (org-support-shift-select
+ (org-call-for-shift-select 'backward-word))
+ (t (org-shiftselect-error))))
+
+(defun org-shiftcontrolup (&optional n)
+ "Change timestamps synchronously up in CLOCK log lines.
+Optional argument N tells to change by that many units."
+ (interactive "P")
+ (if (and (org-at-clock-log-p) (org-at-timestamp-p 'lax))
+ (let (org-support-shift-select)
+ (org-clock-timestamps-up n))
+ (user-error "Not at a clock log")))
+
+(defun org-shiftcontroldown (&optional n)
+ "Change timestamps synchronously down in CLOCK log lines.
+Optional argument N tells to change by that many units."
+ (interactive "P")
+ (if (and (org-at-clock-log-p) (org-at-timestamp-p 'lax))
+ (let (org-support-shift-select)
+ (org-clock-timestamps-down n))
+ (user-error "Not at a clock log")))
+
+(defun org-increase-number-at-point (&optional inc)
+ "Increment the number at point.
+With an optional prefix numeric argument INC, increment using
+this numeric value."
+ (interactive "p")
+ (if (not (number-at-point))
+ (user-error "Not on a number")
+ (unless inc (setq inc 1))
+ (let ((pos (point))
+ (beg (skip-chars-backward "-+^/*0-9eE."))
+ (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))
+ (insert (calc-eval (concat (number-to-string inc) "+" nap))))
+ (when (org-at-table-p)
+ (org-table-align)
+ (org-table-end-of-field 1))))
+
+(defun org-decrease-number-at-point (&optional inc)
+ "Decrement the number at point.
+With an optional prefix numeric argument INC, decrement using
+this numeric value."
+ (interactive "p")
+ (org-increase-number-at-point (- (or inc 1))))
+
+(defun org-ctrl-c-ret ()
+ "Call `org-table-hline-and-move' or `org-insert-heading'."
+ (interactive)
+ (cond
+ ((org-at-table-p) (call-interactively 'org-table-hline-and-move))
+ (t (call-interactively 'org-insert-heading))))
+
+(defun org-copy-visible (beg end)
+ "Copy the visible parts of the region."
+ (interactive "r")
+ (let ((result ""))
+ (while (/= beg end)
+ (when (get-char-property beg 'invisible)
+ (setq beg (next-single-char-property-change beg 'invisible nil end)))
+ (let ((next (next-single-char-property-change beg 'invisible nil end)))
+ (setq result (concat result (buffer-substring beg next)))
+ (setq beg next)))
+ (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.
+Calls `org-table-copy-region' or `org-copy-subtree', depending on
+context. See the individual commands for more information."
+ (interactive)
+ (call-interactively
+ (if (org-at-table-p) #'org-table-copy-region #'org-copy-subtree)))
+
+(defun org-cut-special ()
+ "Cut region in table or cut current subtree.
+Calls `org-table-cut-region' or `org-cut-subtree', depending on
+context. See the individual commands for more information."
+ (interactive)
+ (call-interactively
+ (if (org-at-table-p) #'org-table-cut-region #'org-cut-subtree)))
+
+(defun org-paste-special (arg)
+ "Paste rectangular region into table, or past subtree relative to level.
+Calls `org-table-paste-rectangle' or `org-paste-subtree', depending on context.
+See the individual commands for more information."
+ (interactive "P")
+ (if (org-at-table-p)
+ (org-table-paste-rectangle)
+ (org-paste-subtree arg)))
+
+(defun org-edit-special (&optional arg)
+ "Call a special editor for the element at point.
+When at a table, call the formula editor with `org-table-edit-formulas'.
+When in a source code block, call `org-edit-src-code'.
+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, SETUPFILE or BIBLIOGRAPHY keyword, visit the included file.
+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")
+ (let ((element (org-element-at-point)))
+ (barf-if-buffer-read-only)
+ (pcase (org-element-type element)
+ (`src-block
+ (if (not arg) (org-edit-src-code)
+ (let* ((info (org-babel-get-src-block-info))
+ (lang (nth 0 info))
+ (params (nth 2 info))
+ (session (cdr (assq :session params))))
+ (if (not session) (org-edit-src-code)
+ ;; 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
+ (unless (member (org-element-property :key element)
+ '("BIBLIOGRAPHY" "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-url-p file)
+ (user-error "Files located with a URL cannot be edited"))
+ (org-link-open-from-string
+ (format "[[%s]]" (expand-file-name file))))))
+ (`table
+ (if (eq (org-element-property :type element) 'table.el)
+ (org-edit-table.el)
+ (call-interactively 'org-table-edit-formulas)))
+ ;; Only Org tables contain `table-row' type elements.
+ (`table-row (call-interactively 'org-table-edit-formulas))
+ (`example-block (org-edit-src-code))
+ (`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.
+ (let ((context (org-element-context element)))
+ (pcase (org-element-type context)
+ (`footnote-reference (org-edit-footnote-reference))
+ (`inline-src-block (org-edit-inline-src-code))
+ (`latex-fragment (org-edit-latex-fragment))
+ (`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"))))))))
+
+(defun org-ctrl-c-ctrl-c (&optional arg)
+ "Set tags in headline, or update according to changed information at point.
+
+This command does many different things, depending on context:
+
+- If column view is active, in agenda or org buffers, quit it.
+
+- If there are highlights, remove them.
+
+- If a function in `org-ctrl-c-ctrl-c-hook' recognizes this location,
+ this is what we do.
+
+- If the cursor is on a statistics cookie, update it.
+
+- If the cursor is in a headline, in an agenda or an org buffer,
+ prompt for tags and insert them into the current line, aligned
+ to `org-tags-column'. When called with prefix arg, realign all
+ tags in the current buffer.
+
+- If the cursor is in one of the special #+KEYWORD lines, this
+ triggers scanning the buffer for these lines and updating the
+ information.
+
+- If the cursor is inside a table, realign the table. This command
+ works even if the automatic table editor has been turned off.
+
+- If the cursor is on a #+TBLFM line, re-apply the formulas to
+ the entire table.
+
+- If the cursor is at a footnote reference or definition, jump to
+ the corresponding definition or references, respectively.
+
+- If the cursor is a the beginning of a dynamic block, update it.
+
+- If the current buffer is a capture buffer, close note and file it.
+
+- If the cursor is on a <<<target>>>, update radio targets and
+ corresponding links in this buffer.
+
+- If the cursor is on a numbered item in a plain list, renumber the
+ ordered list.
+
+- If the cursor is on a checkbox, toggle it.
+
+- If the cursor is on a code block, evaluate it. The variable
+ `org-confirm-babel-evaluate' can be used to control prompting
+ before code block evaluation, by default every code block
+ evaluation requires confirmation. Code block evaluation can be
+ inhibited by setting `org-babel-no-eval-on-ctrl-c-ctrl-c'."
+ (interactive "P")
+ (cond
+ ((bound-and-true-p org-columns-overlays) (org-columns-quit))
+ ((or (bound-and-true-p org-clock-overlays) org-occur-highlights)
+ (when (boundp 'org-clock-overlays) (org-clock-remove-overlays))
+ (org-remove-occur-highlights)
+ (message "Temporary highlights/overlays removed from current buffer"))
+ ((and (local-variable-p 'org-finish-function)
+ (fboundp org-finish-function))
+ (funcall org-finish-function))
+ ((org-babel-hash-at-point))
+ ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-hook))
+ (t
+ (let* ((context
+ (org-element-lineage
+ (org-element-context)
+ ;; Limit to supported contexts.
+ '(babel-call clock dynamic-block footnote-definition
+ footnote-reference inline-babel-call inline-src-block
+ inlinetask item keyword node-property paragraph
+ plain-list planning property-drawer radio-target
+ src-block statistics-cookie table table-cell table-row
+ timestamp)
+ t))
+ (radio-list-p (org-at-radio-list-p))
+ (type (org-element-type context)))
+ ;; For convenience: at the first line of a paragraph on the same
+ ;; line as an item, apply function on that item instead.
+ (when (eq type 'paragraph)
+ (let ((parent (org-element-property :parent context)))
+ (when (and (eq (org-element-type parent) 'item)
+ (= (line-beginning-position)
+ (org-element-property :begin parent)))
+ (setq context parent)
+ (setq type 'item))))
+ ;; Act according to type of element or object at point.
+ ;;
+ ;; Do nothing on a blank line, except if it is contained in
+ ;; 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)
+ (unless org-babel-no-eval-on-ctrl-c-ctrl-c
+ (org-babel-eval-wipe-error-buffer)
+ (org-babel-execute-src-block
+ current-prefix-arg (org-babel-get-src-block-info nil context))))
+ ((guard (org-match-line "[ \t]*$"))
+ (or (run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook)
+ (user-error
+ (substitute-command-keys
+ "`\\[org-ctrl-c-ctrl-c]' can do nothing useful here"))))
+ ((or `babel-call `inline-babel-call)
+ (let ((info (org-babel-lob-get-info context)))
+ (when info (org-babel-execute-src-block nil info))))
+ (`clock (org-clock-update-time-maybe))
+ (`dynamic-block
+ (save-excursion
+ (goto-char (org-element-property :post-affiliated context))
+ (org-update-dblock)))
+ (`footnote-definition
+ (goto-char (org-element-property :post-affiliated context))
+ (call-interactively 'org-footnote-action))
+ (`footnote-reference (call-interactively #'org-footnote-action))
+ ((or `headline `inlinetask)
+ (save-excursion (goto-char (org-element-property :begin context))
+ (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.
+ ;; Without a universal argument, if the item has a checkbox,
+ ;; toggle it. Otherwise repair the list.
+ (if (or radio-list-p
+ (and (boundp org-list-checkbox-radio-mode)
+ org-list-checkbox-radio-mode))
+ (org-toggle-radio-button arg)
+ (let* ((box (org-element-property :checkbox context))
+ (struct (org-element-property :structure context))
+ (old-struct (copy-tree struct))
+ (parents (org-list-parents-alist struct))
+ (prevs (org-list-prevs-alist struct))
+ (orderedp (org-not-nil (org-entry-get nil "ORDERED"))))
+ (org-list-set-checkbox
+ (org-element-property :begin context) struct
+ (cond ((equal arg '(16)) "[-]")
+ ((and (not box) (equal arg '(4))) "[ ]")
+ ((or (not box) (equal arg '(4))) nil)
+ ((eq box 'on) "[ ]")
+ (t "[X]")))
+ ;; Mimic `org-list-write-struct' but with grabbing a return
+ ;; value from `org-list-struct-fix-box'.
+ (org-list-struct-fix-ind struct parents 2)
+ (org-list-struct-fix-item-end struct)
+ (org-list-struct-fix-bul struct prevs)
+ (org-list-struct-fix-ind struct parents)
+ (let ((block-item
+ (org-list-struct-fix-box struct parents prevs orderedp)))
+ (if (and box (equal struct old-struct))
+ (if (equal arg '(16))
+ (message "Checkboxes already reset")
+ (user-error "Cannot toggle this checkbox: %s"
+ (if (eq box 'on)
+ "all subitems checked"
+ "unchecked subitems")))
+ (org-list-struct-apply-struct struct old-struct)
+ (org-update-checkbox-count-maybe))
+ (when block-item
+ (message "Checkboxes were removed due to empty box at line %d"
+ (org-current-line block-item)))))))
+ (`plain-list
+ ;; At a plain list, with a double C-u argument, set
+ ;; checkboxes of each item to "[-]", whereas a single one
+ ;; will toggle their presence according to the state of the
+ ;; first item in the list. Without an argument, repair the
+ ;; list.
+ (if (or radio-list-p
+ (and (boundp org-list-checkbox-radio-mode)
+ org-list-checkbox-radio-mode))
+ (org-toggle-radio-button arg)
+ (let* ((begin (org-element-property :contents-begin context))
+ (struct (org-element-property :structure context))
+ (old-struct (copy-tree struct))
+ (first-box (save-excursion
+ (goto-char begin)
+ (looking-at org-list-full-item-re)
+ (match-string-no-properties 3)))
+ (new-box (cond ((equal arg '(16)) "[-]")
+ ((equal arg '(4)) (unless first-box "[ ]"))
+ ((equal first-box "[X]") "[ ]")
+ (t "[X]"))))
+ (cond
+ (arg
+ (dolist (pos
+ (org-list-get-all-items
+ begin struct (org-list-prevs-alist struct)))
+ (org-list-set-checkbox pos struct new-box)))
+ ((and first-box (eq (point) begin))
+ ;; For convenience, when point is at bol on the first
+ ;; 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)))
+ (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))))
+ (`keyword
+ (let ((org-inhibit-startup-visibility-stuff t)
+ (org-startup-align-all-tables nil))
+ (when (boundp 'org-table-coordinate-overlays)
+ (mapc #'delete-overlay org-table-coordinate-overlays)
+ (setq org-table-coordinate-overlays nil))
+ (org-save-outline-visibility 'use-markers (org-mode-restart)))
+ (message "Local setup has been refreshed"))
+ ((or `property-drawer `node-property)
+ (call-interactively #'org-property-action))
+ (`radio-target
+ (call-interactively #'org-update-radio-target-regexp))
+ (`statistics-cookie
+ (call-interactively #'org-update-statistics-cookies))
+ ((or `table `table-cell `table-row)
+ ;; At a table, generate a plot if on the #+plot line,
+ ;; recalculate every field and align it otherwise. Also
+ ;; send the table if necessary.
+ (cond
+ ((and (org-match-line "[ \t]*#\\+plot:")
+ (< (point) (org-element-property :post-affiliated context)))
+ (org-plot/gnuplot))
+ ;; If the table has a `table.el' type, just give up.
+ ((eq (org-element-property :type context) 'table.el)
+ (message "%s" (substitute-command-keys "\\<org-mode-map>\
+Use `\\[org-edit-special]' to edit table.el tables")))
+ ;; At a table row or cell, maybe recalculate line but always
+ ;; align table.
+ ((or (eq type 'table)
+ ;; Check if point is at a TBLFM line.
+ (and (eq type 'table-row)
+ (= (point) (org-element-property :end context))))
+ (save-excursion
+ (if (org-at-TBLFM-p)
+ (progn (require 'org-table)
+ (org-table-calc-current-TBLFM))
+ (goto-char (org-element-property :contents-begin context))
+ (org-call-with-arg 'org-table-recalculate (or arg t))
+ (orgtbl-send-table 'maybe))))
+ (t
+ (org-table-maybe-eval-formula)
+ (cond (arg (call-interactively #'org-table-recalculate))
+ ((org-table-maybe-recalculate-line))
+ (t (org-table-align))))))
+ ((or `timestamp (and `planning (guard (org-at-timestamp-p 'lax))))
+ (org-timestamp-change 0 'day))
+ ((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-command))
+ ((guard
+ (run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook)))
+ (_
+ (user-error
+ (substitute-command-keys
+ "`\\[org-ctrl-c-ctrl-c]' can do nothing useful here"))))))))
+
+(defun org-mode-restart ()
+ "Restart `org-mode'."
+ (interactive)
+ (let ((indent-status (bound-and-true-p org-indent-mode)))
+ (funcall major-mode)
+ (hack-local-variables)
+ (when (and indent-status (not (bound-and-true-p org-indent-mode)))
+ (org-indent-mode -1))
+ (org-reset-file-cache))
+ (message "%s restarted" major-mode))
+
+(defun org-flag-above-first-heading (&optional arg)
+ "Hide from bob up to the first heading.
+Move point to the beginning of first heading or end of buffer."
+ (goto-char (point-min))
+ (unless (org-at-heading-p)
+ (outline-next-heading))
+ (unless (bobp)
+ (org-flag-region 1 (1- (point)) (not arg) 'outline)))
+
+(defun org-show-branches-buffer ()
+ "Show all branches in the buffer."
+ (org-flag-above-first-heading)
+ (outline-hide-sublevels 1)
+ (unless (eobp)
+ (outline-show-branches)
+ (while (outline-get-next-sibling)
+ (outline-show-branches)))
+ (goto-char (point-min)))
+
+(defun org-kill-note-or-show-branches ()
+ "Abort storing current note, or show just branches."
+ (interactive)
+ (cond (org-finish-function
+ (let ((org-note-abort t)) (funcall org-finish-function)))
+ ((org-before-first-heading-p)
+ (org-show-branches-buffer)
+ (org-hide-archived-subtrees (point-min) (point-max)))
+ (t
+ (let ((beg (progn (org-back-to-heading) (point)))
+ (end (save-excursion (org-end-of-subtree t t) (point))))
+ (outline-hide-subtree)
+ (outline-show-branches)
+ (org-hide-archived-subtrees beg end)))))
+
+(defun org-delete-indentation (&optional arg)
+ "Join current line to previous and fix whitespace at join.
+
+If previous line is a headline add to headline title. Otherwise
+the function calls `delete-indentation'.
+
+I.e. with a non-nil optional argument, join the line with the
+following one. If there is a region then join the lines in that
+region."
+ (interactive "*P")
+ (if (save-excursion
+ (beginning-of-line (if arg 1 0))
+ (let ((case-fold-search nil))
+ (looking-at org-complex-heading-regexp)))
+ ;; At headline.
+ (let ((tags-column (when (match-beginning 5)
+ (save-excursion (goto-char (match-beginning 5))
+ (current-column))))
+ (string (concat " " (progn (when arg (forward-line 1))
+ (org-trim (delete-and-extract-region
+ (line-beginning-position)
+ (line-end-position)))))))
+ (unless (bobp) (delete-region (point) (1- (point))))
+ (goto-char (or (match-end 4)
+ (match-beginning 5)
+ (match-end 0)))
+ (skip-chars-backward " \t")
+ (save-excursion (insert string))
+ ;; Adjust alignment of tags.
+ (cond
+ ((not tags-column)) ;no tags
+ (org-auto-align-tags (org-align-tags))
+ (t (org--align-tags-here tags-column)))) ;preserve tags column
+ (let ((current-prefix-arg arg))
+ (call-interactively #'delete-indentation))))
+
+(defun org-open-line (n)
+ "Insert a new row in tables, call `open-line' elsewhere.
+If `org-special-ctrl-o' is nil, just call `open-line' everywhere.
+As a special case, when a document starts with a table, allow to
+call `open-line' on the very first character."
+ (interactive "*p")
+ (if (and org-special-ctrl-o (/= (point) 1) (org-at-table-p))
+ (org-table-insert-row)
+ (open-line n)))
+
+(defun org--newline (indent arg interactive)
+ "Call `newline-and-indent' or just `newline'.
+If INDENT is non-nil, call `newline-and-indent' with ARG to
+indent unconditionally; otherwise, call `newline' with ARG and
+INTERACTIVE, which can trigger indentation if
+`electric-indent-mode' is enabled."
+ (if indent
+ (org-newline-and-indent arg)
+ (newline arg interactive)))
+
+(defun org-return (&optional indent arg interactive)
+ "Goto next table row or insert a newline.
+
+Calls `org-table-next-row' or `newline', depending on context.
+
+When optional INDENT argument is non-nil, call
+`newline-and-indent' with ARG, otherwise call `newline' with ARG
+and INTERACTIVE.
+
+When `org-return-follows-link' is non-nil and point is on
+a timestamp or a link, call `org-open-at-point'. However, it
+will not happen if point is in a table or on a \"dead\"
+object (e.g., within a comment). In these case, you need to use
+`org-open-at-point' directly."
+ (interactive "i\nP\np")
+ (let* ((context (if org-return-follows-link (org-element-context)
+ (org-element-at-point)))
+ (element-type (org-element-type context)))
+ (cond
+ ;; In a table, call `org-table-next-row'. However, before first
+ ;; column or after last one, split the table.
+ ((or (and (eq 'table element-type)
+ (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))
+ (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 (and (eq 'link element-type)
+ ;; 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-link-any-re nil t)))
+ (call-interactively #'org-open-at-point))
+ ;; Insert newline in heading, but preserve tags.
+ ((and (not (bolp))
+ (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.
+ (let ((tags-column (and (match-beginning 5)
+ (save-excursion (goto-char (match-beginning 5))
+ (current-column))))
+ (string
+ (when (and (match-end 4) (org-point-in-group (point) 4))
+ (delete-and-extract-region (point) (match-end 4)))))
+ ;; Adjust tag alignment.
+ (cond
+ ((not (and tags-column string)))
+ (org-auto-align-tags (org-align-tags))
+ (t (org--align-tags-here tags-column))) ;preserve tags column
+ (end-of-line)
+ (org-show-entry)
+ (org--newline indent arg interactive)
+ (when string (save-excursion (insert (org-trim string))))))
+ ;; In a list, make sure indenting keeps trailing text within.
+ ((and (not (eolp))
+ (org-element-lineage context '(item)))
+ (let ((trailing-data
+ (delete-and-extract-region (point) (line-end-position))))
+ (org--newline indent arg interactive)
+ (save-excursion (insert trailing-data))))
+ (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)))
+ (org--newline indent arg interactive))))))
+
+(defun org-return-and-maybe-indent ()
+ "Goto next table row, or insert a newline, maybe indented.
+Call `org-table-next-row' or `org-return', depending on context.
+See the individual commands for more information.
+
+When inserting a newline, if `org-adapt-indentation' is t:
+indent the line if `electric-indent-mode' is disabled, don't
+indent it if it is enabled."
+ (interactive)
+ (org-return (not electric-indent-mode)))
+
+(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 provide a compact view of the children. ARG is the
+level to hide."
+ (interactive "p")
+ (cond
+ ((org-at-table-p)
+ (call-interactively #'org-table-toggle-column-width))
+ ((org-before-first-heading-p)
+ (save-excursion
+ (org-flag-above-first-heading)
+ (outline-hide-sublevels (or arg 1))))
+ (t
+ (outline-hide-subtree)
+ (org-show-children arg))))
+
+(defun org-ctrl-c-star ()
+ "Compute table, or change heading status of lines.
+Calls `org-table-recalculate' or `org-toggle-heading',
+depending on context."
+ (interactive)
+ (cond
+ ((org-at-table-p)
+ (call-interactively 'org-table-recalculate))
+ (t
+ ;; Convert all lines in region to list items
+ (call-interactively 'org-toggle-heading))))
+
+(defun org-ctrl-c-minus ()
+ "Insert separator line in table or modify bullet status of line.
+Also turns a plain line or a region of lines into list items.
+Calls `org-table-insert-hline', `org-toggle-item', or
+`org-cycle-list-bullet', depending on context."
+ (interactive)
+ (cond
+ ((org-at-table-p)
+ (call-interactively 'org-table-insert-hline))
+ ((org-region-active-p)
+ (call-interactively 'org-toggle-item))
+ ((org-in-item-p)
+ (call-interactively 'org-cycle-list-bullet))
+ (t
+ (call-interactively 'org-toggle-item))))
+
+(defun org-toggle-heading (&optional nstars)
+ "Convert headings to normal text, or items or text to headings.
+If there is no active region, only convert the current line.
+
+With a `\\[universal-argument]' prefix, convert the whole list at
+point into heading.
+
+In a region:
+
+- If the first non blank line is a headline, remove the stars
+ from all headlines in the region.
+
+- If it is a normal line, turn each and every normal line (i.e.,
+ not an heading or an item) in the region into headings. If you
+ want to convert only the first line of this region, use one
+ universal prefix argument.
+
+- If it is a plain list item, turn all plain list items into headings.
+
+When converting a line into a heading, the number of stars is chosen
+such that the lines become children of the current entry. However,
+when a numeric prefix argument is given, its value determines the
+number of stars to add."
+ (interactive "P")
+ (let ((skip-blanks
+ ;; Return beginning of first non-blank line, starting from
+ ;; line at POS.
+ (lambda (pos)
+ (save-excursion
+ (goto-char pos)
+ (while (org-at-comment-p) (forward-line))
+ (skip-chars-forward " \r\t\n")
+ (point-at-bol))))
+ beg end toggled)
+ ;; Determine boundaries of changes. If a universal prefix has
+ ;; been given, put the list in a region. If region ends at a bol,
+ ;; do not consider the last line to be in the region.
+
+ (when (and current-prefix-arg (org-at-item-p))
+ (when (listp current-prefix-arg) (setq current-prefix-arg 1))
+ (org-mark-element))
+
+ (if (org-region-active-p)
+ (setq beg (funcall skip-blanks (region-beginning))
+ end (copy-marker (save-excursion
+ (goto-char (region-end))
+ (if (bolp) (point) (point-at-eol)))))
+ (setq beg (funcall skip-blanks (point-at-bol))
+ end (copy-marker (point-at-eol))))
+ ;; Ensure inline tasks don't count as headings.
+ (org-with-limited-levels
+ (save-excursion
+ (goto-char beg)
+ (cond
+ ;; Case 1. Started at an heading: de-star headings.
+ ((org-at-heading-p)
+ (while (< (point) end)
+ (when (org-at-heading-p t)
+ (looking-at org-outline-regexp) (replace-match "")
+ (setq toggled t))
+ (forward-line)))
+ ;; Case 2. Started at an item: change items into headlines.
+ ;; One star will be added by `org-list-to-subtree'.
+ ((org-at-item-p)
+ (while (< (point) end)
+ (when (org-at-item-p)
+ ;; Pay attention to cases when region ends before list.
+ (let* ((struct (org-list-struct))
+ (list-end
+ (min (org-list-get-bottom-point struct) (1+ end))))
+ (save-restriction
+ (narrow-to-region (point) list-end)
+ (insert (org-list-to-subtree
+ (org-list-to-lisp t)
+ (pcase (org-current-level)
+ (`nil 1)
+ (l (1+ (org-reduced-level l)))))
+ "\n")))
+ (setq toggled t))
+ (forward-line)))
+ ;; Case 3. Started at normal text: make every line an heading,
+ ;; skipping headlines and items.
+ (t (let* ((stars
+ (make-string
+ (if (numberp nstars) nstars (or (org-current-level) 0)) ?*))
+ (add-stars
+ (cond (nstars "") ; stars from prefix only
+ ((equal stars "") "*") ; before first heading
+ (org-odd-levels-only "**") ; inside heading, odd
+ (t "*"))) ; inside heading, oddeven
+ (rpl (concat stars add-stars " "))
+ (lend (when (listp nstars) (save-excursion (end-of-line) (point)))))
+ (while (< (point) (if (equal nstars '(4)) lend end))
+ (when (and (not (or (org-at-heading-p) (org-at-item-p) (org-at-comment-p)))
+ (looking-at "\\([ \t]*\\)\\(\\S-\\)"))
+ (replace-match (concat rpl (match-string 2))) (setq toggled t))
+ (forward-line)))))))
+ (unless toggled (message "Cannot toggle heading from here"))))
+
+(defun org-meta-return (&optional arg)
+ "Insert a new heading or wrap a region in a table.
+Calls `org-insert-heading', `org-insert-item' or
+`org-table-wrap-region', depending on context. When called with
+an argument, unconditionally call `org-insert-heading'."
+ (interactive "P")
+ (org-check-before-invisible-edit 'insert)
+ (or (run-hook-with-args-until-success 'org-metareturn-hook)
+ (call-interactively (cond (arg #'org-insert-heading)
+ ((org-at-table-p) #'org-table-wrap-region)
+ ((org-in-item-p) #'org-insert-item)
+ (t #'org-insert-heading)))))
+
+;;; Menu entries
+(defsubst org-in-subtree-not-table-p ()
+ "Are we in a subtree and not in a table?"
+ (and (not (org-before-first-heading-p))
+ (not (org-at-table-p))))
+
+;; Define the Org mode menus
+(easy-menu-define org-org-menu org-mode-map "Org menu."
+ `("Org"
+ ("Show/Hide"
+ ["Cycle Visibility" org-cycle :active (or (bobp) (outline-on-heading-p))]
+ ["Cycle Global Visibility" org-shifttab :active (not (org-at-table-p))]
+ ["Sparse Tree..." org-sparse-tree t]
+ ["Reveal Context" org-reveal t]
+ ["Show All" org-show-all t]
+ "--"
+ ["Subtree to indirect buffer" org-tree-to-indirect-buffer t])
+ "--"
+ ["New Heading" org-insert-heading t]
+ ("Navigate Headings"
+ ["Up" outline-up-heading t]
+ ["Next" outline-next-visible-heading t]
+ ["Previous" outline-previous-visible-heading t]
+ ["Next Same Level" outline-forward-same-level t]
+ ["Previous Same Level" outline-backward-same-level t]
+ "--"
+ ["Jump" org-goto t])
+ ("Edit Structure"
+ ["Move Subtree Up" org-metaup (org-at-heading-p)]
+ ["Move Subtree Down" org-metadown (org-at-heading-p)]
+ "--"
+ ["Copy Subtree" org-copy-special (org-in-subtree-not-table-p)]
+ ["Cut Subtree" org-cut-special (org-in-subtree-not-table-p)]
+ ["Paste Subtree" org-paste-special (not (org-at-table-p))]
+ "--"
+ ["Clone subtree, shift time" org-clone-subtree-with-time-shift t]
+ "--"
+ ["Copy visible text" org-copy-visible t]
+ "--"
+ ["Promote Heading" org-metaleft (org-in-subtree-not-table-p)]
+ ["Promote Subtree" org-shiftmetaleft (org-in-subtree-not-table-p)]
+ ["Demote Heading" org-metaright (org-in-subtree-not-table-p)]
+ ["Demote Subtree" org-shiftmetaright (org-in-subtree-not-table-p)]
+ "--"
+ ["Sort Region/Children" org-sort t]
+ "--"
+ ["Convert to odd levels" org-convert-to-odd-levels t]
+ ["Convert to odd/even levels" org-convert-to-oddeven-levels t])
+ ("Editing"
+ ["Emphasis..." org-emphasize t]
+ ["Add block structure" org-insert-structure-template t]
+ ["Edit Source Example" org-edit-special t]
+ "--"
+ ["Footnote new/jump" org-footnote-action t]
+ ["Footnote extra" (org-footnote-action t) :active t :keys "C-u C-c C-x f"])
+ ("Archive"
+ ["Archive (default method)" org-archive-subtree-default (org-in-subtree-not-table-p)]
+ "--"
+ ["Move Subtree to Archive file" org-archive-subtree (org-in-subtree-not-table-p)]
+ ["Toggle ARCHIVE tag" org-toggle-archive-tag (org-in-subtree-not-table-p)]
+ ["Move subtree to Archive sibling" org-archive-to-archive-sibling (org-in-subtree-not-table-p)])
+ "--"
+ ("Hyperlinks"
+ ["Store Link (Global)" org-store-link t]
+ ["Find existing link to here" org-occur-link-in-agenda-files t]
+ ["Insert Link" org-insert-link t]
+ ["Follow Link" org-open-at-point t]
+ "--"
+ ["Next link" org-next-link t]
+ ["Previous link" org-previous-link t]
+ "--"
+ ["Descriptive Links"
+ org-toggle-link-display
+ :style radio
+ :selected org-descriptive-links
+ ]
+ ["Literal Links"
+ org-toggle-link-display
+ :style radio
+ :selected (not org-descriptive-links)])
+ "--"
+ ("TODO Lists"
+ ["TODO/DONE/-" org-todo t]
+ ("Select keyword"
+ ["Next keyword" org-shiftright (org-at-heading-p)]
+ ["Previous keyword" org-shiftleft (org-at-heading-p)]
+ ["Complete Keyword" pcomplete (assq :todo-keyword (org-context))]
+ ["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 "\\[org-agenda] t"]
+ "--"
+ ["Enforce dependencies" (customize-variable 'org-enforce-todo-dependencies)
+ :selected org-enforce-todo-dependencies :style toggle :active t]
+ "Settings for tree at point"
+ ["Do Children sequentially" org-toggle-ordered-property :style radio
+ :selected (org-entry-get nil "ORDERED")
+ :active org-enforce-todo-dependencies :keys "C-c C-x o"]
+ ["Do Children parallel" org-toggle-ordered-property :style radio
+ :selected (not (org-entry-get nil "ORDERED"))
+ :active org-enforce-todo-dependencies :keys "C-c C-x o"]
+ "--"
+ ["Set Priority" org-priority t]
+ ["Priority Up" org-shiftup t]
+ ["Priority Down" org-shiftdown t]
+ "--"
+ ["Get news from all feeds" org-feed-update-all t]
+ ["Go to the inbox of a feed..." org-feed-goto-inbox t]
+ ["Customize feeds" (customize-variable 'org-feed-alist) t])
+ ("TAGS and Properties"
+ ["Set Tags" org-set-tags-command (not (org-before-first-heading-p))]
+ ["Change tag in region" org-change-tag-in-region (org-region-active-p)]
+ "--"
+ ["Set property" org-set-property (not (org-before-first-heading-p))]
+ ["Column view of properties" org-columns t]
+ ["Insert Column View DBlock" org-columns-insert-dblock t])
+ ("Dates and Scheduling"
+ ["Timestamp" org-time-stamp (not (org-before-first-heading-p))]
+ ["Timestamp (inactive)" org-time-stamp-inactive (not (org-before-first-heading-p))]
+ ("Change Date"
+ ["1 Day Later" org-shiftright (org-at-timestamp-p 'lax)]
+ ["1 Day Earlier" org-shiftleft (org-at-timestamp-p 'lax)]
+ ["1 ... Later" org-shiftup (org-at-timestamp-p 'lax)]
+ ["1 ... Earlier" org-shiftdown (org-at-timestamp-p 'lax)])
+ ["Compute Time Range" org-evaluate-time-range t]
+ ["Schedule Item" org-schedule (not (org-before-first-heading-p))]
+ ["Deadline" org-deadline (not (org-before-first-heading-p))]
+ "--"
+ ["Custom time format" org-toggle-time-stamp-overlays
+ :style radio :selected org-display-custom-times]
+ "--"
+ ["Goto Calendar" org-goto-calendar t]
+ ["Date from Calendar" org-date-from-calendar t]
+ "--"
+ ["Start/Restart Timer" org-timer-start t]
+ ["Pause/Continue Timer" org-timer-pause-or-continue t]
+ ["Stop Timer" org-timer-pause-or-continue :active t :keys "C-u C-c C-x ,"]
+ ["Insert Timer String" org-timer t]
+ ["Insert Timer Item" org-timer-item t])
+ ("Logging work"
+ ["Clock in" org-clock-in :active t :keys "C-c C-x C-i"]
+ ["Switch task" (lambda () (interactive) (org-clock-in '(4))) :active t :keys "C-u C-c C-x C-i"]
+ ["Clock out" org-clock-out t]
+ ["Clock cancel" org-clock-cancel t]
+ "--"
+ ["Mark as default task" org-clock-mark-default-task t]
+ ["Clock in, mark as default" (lambda () (interactive) (org-clock-in '(16))) :active t :keys "C-u C-u C-c C-x C-i"]
+ ["Goto running clock" org-clock-goto t]
+ "--"
+ ["Display times" org-clock-display t]
+ ["Create clock table" org-clock-report t]
+ "--"
+ ["Record DONE time"
+ (progn (setq org-log-done (not org-log-done))
+ (message "Switching to %s will %s record a timestamp"
+ (car org-done-keywords)
+ (if org-log-done "automatically" "not")))
+ :style toggle :selected org-log-done])
+ "--"
+ ["Agenda Command..." org-agenda t]
+ ["Set Restriction Lock" org-agenda-set-restriction-lock t]
+ ("File List for Agenda")
+ ("Special views current file"
+ ["TODO Tree" org-show-todo-tree t]
+ ["Check Deadlines" org-check-deadlines t]
+ ["Tags/Property tree" org-match-sparse-tree t])
+ "--"
+ ["Export/Publish..." org-export-dispatch t]
+ ("LaTeX"
+ ["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
+ (org-inside-LaTeX-fragment-p)]
+ ["Insert citation" org-reftex-citation t])
+ "--"
+ ("Documentation"
+ ["Show Version" org-version t]
+ ["Info Documentation" org-info t]
+ ["Browse Org News" org-browse-news t])
+ ("Customize"
+ ["Browse Org Group" org-customize t]
+ "--"
+ ["Expand This Menu" org-create-customize-menu t])
+ ["Send bug report" org-submit-bug-report t]
+ "--"
+ ("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 !"])))
+
+(easy-menu-define org-tbl-menu org-mode-map "Org Table menu."
+ '("Table"
+ ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p)]
+ ["Next Field" org-cycle (org-at-table-p)]
+ ["Previous Field" org-shifttab (org-at-table-p)]
+ ["Next Row" org-return (org-at-table-p)]
+ "--"
+ ["Blank Field" org-table-blank-field (org-at-table-p)]
+ ["Edit Field" org-table-edit-field (org-at-table-p)]
+ ["Copy Field from Above" org-table-copy-down (org-at-table-p)]
+ "--"
+ ("Column"
+ ["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)]
+ ["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)]
+ ["Delete Row" org-shiftmetaup (org-at-table-p)]
+ ["Insert Row" org-shiftmetadown (org-at-table-p)]
+ ["Sort lines in region" org-table-sort-lines (org-at-table-p)]
+ "--"
+ ["Insert Hline" org-ctrl-c-minus (org-at-table-p)])
+ ("Rectangle"
+ ["Copy Rectangle" org-copy-special (org-at-table-p)]
+ ["Cut Rectangle" org-cut-special (org-at-table-p)]
+ ["Paste Rectangle" org-paste-special (org-at-table-p)]
+ ["Fill Rectangle" org-table-wrap-region (org-at-table-p)])
+ "--"
+ ("Calculate"
+ ["Set Column Formula" org-table-eval-formula (org-at-table-p)]
+ ["Set Field Formula" (org-table-eval-formula '(4)) :active (org-at-table-p) :keys "C-u C-c ="]
+ ["Edit Formulas" org-edit-special (org-at-table-p)]
+ "--"
+ ["Recalculate line" org-table-recalculate (org-at-table-p)]
+ ["Recalculate all" (lambda () (interactive) (org-table-recalculate '(4))) :active (org-at-table-p) :keys "C-u C-c *"]
+ ["Iterate all" (lambda () (interactive) (org-table-recalculate '(16))) :active (org-at-table-p) :keys "C-u C-u C-c *"]
+ "--"
+ ["Toggle Recalculate Mark" org-table-rotate-recalc-marks (org-at-table-p)]
+ "--"
+ ["Sum Column/Rectangle" org-table-sum
+ (or (org-at-table-p) (org-region-active-p))]
+ ["Which Column?" org-table-current-column (org-at-table-p)])
+ ["Debug Formulas"
+ org-table-toggle-formula-debugger
+ :style toggle :selected (bound-and-true-p org-table-formula-debug)]
+ ["Show Col/Row Numbers"
+ org-table-toggle-coordinate-overlays
+ :style toggle
+ :selected (bound-and-true-p org-table-overlay-coordinates)]
+ "--"
+ ["Create" org-table-create (not (org-at-table-p))]
+ ["Convert Region" org-table-convert-region (not (org-at-table-p 'any))]
+ ["Import from File" org-table-import (not (org-at-table-p))]
+ ["Export to File" org-table-export (org-at-table-p)]
+ "--"
+ ["Create/Convert from/to table.el" org-table-create-with-table.el t]
+ "--"
+ ("Plot"
+ ["Ascii plot" orgtbl-ascii-plot :active (org-at-table-p) :keys "C-c \" a"]
+ ["Gnuplot" org-plot/gnuplot :active (org-at-table-p) :keys "C-c \" g"])))
+
+(defun org-info (&optional node)
+ "Read documentation for Org in the info system.
+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.
+
+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."
+ (interactive)
+ (require 'reporter)
+ (defvar reporter-prompt-for-summary-p)
+ (org-load-modules-maybe)
+ (org-require-autoloaded-modules)
+ (let ((reporter-prompt-for-summary-p "Bug report subject: "))
+ (reporter-submit-bug-report
+ "emacs-orgmode@gnu.org"
+ (org-version nil 'full)
+ (let (list)
+ (save-window-excursion
+ (pop-to-buffer-same-window (get-buffer-create "*Warn about privacy*"))
+ (delete-other-windows)
+ (erase-buffer)
+ (insert "You are about to submit a bug report to the Org mailing list.
+
+If your report is about Org installation, please read this section:
+https://orgmode.org/org.html#Installation
+
+Please read https://orgmode.org/org.html#Feedback on how to make
+a good report, it will help Org contributors fixing your problem.
+
+Search https://lists.gnu.org/archive/html/emacs-orgmode/ to see
+if the issue you are about to raise has already been dealt with.
+
+We also would like to add your full Org and Outline configuration
+to the bug report. It will help us debugging the issue.
+
+*HOWEVER*, some variables you have customized may contain private
+information. The names of customers, colleagues, or friends, might
+appear in the form of file names, tags, todo states or search strings.
+If you answer \"yes\" to the prompt, you might want to check and remove
+such private information before sending the email.")
+ (add-text-properties (point-min) (point-max) '(face org-warning))
+ (when (yes-or-no-p "Include your Org configuration ")
+ (mapatoms
+ (lambda (v)
+ (and (boundp v)
+ (string-match "\\`\\(org-\\|outline-\\)" (symbol-name v))
+ (or (and (symbol-value v)
+ (string-match "\\(-hook\\|-function\\)\\'" (symbol-name v)))
+ (and
+ (get v 'custom-type) (get v 'standard-value)
+ (not (equal (symbol-value v) (eval (car (get v 'standard-value)))))))
+ (push v list)))))
+ (kill-buffer (get-buffer "*Warn about privacy*"))
+ list))
+ nil nil
+ "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
+
+ https://orgmode.org/manual/Feedback.html#Feedback
+
+Your bug report will be posted to the Org mailing list.
+------------------------------------------------------------------------")
+ (save-excursion
+ (when (re-search-backward "^\\(Subject: \\)Org mode version \\(.*?\\);[ \t]*\\(.*\\)" nil t)
+ (replace-match "\\1[BUG] \\3 [\\2]")))))
+
+
+(defun org-install-agenda-files-menu ()
+ "Install agenda file menu."
+ (let ((bl (buffer-list)))
+ (save-excursion
+ (while bl
+ (set-buffer (pop bl))
+ (when (derived-mode-p 'org-mode) (setq bl nil)))
+ (when (derived-mode-p 'org-mode)
+ (easy-menu-change
+ '("Org") "File List for Agenda"
+ (append
+ (list
+ ["Edit File List" (org-edit-agenda-file-list) t]
+ ["Add/Move Current File to Front of List" org-agenda-file-to-front t]
+ ["Remove Current File from List" org-remove-file t]
+ ["Cycle through agenda files" org-cycle-agenda-files t]
+ ["Occur in all agenda files" org-occur-in-agenda-files t]
+ "--")
+ (mapcar 'org-file-menu-entry
+ ;; Prevent initialization from failing.
+ (ignore-errors (org-agenda-files t)))))))))
+
+;;;; Documentation
+
+(defun org-require-autoloaded-modules ()
+ (interactive)
+ (mapc #'require
+ '(org-agenda org-archive org-attach org-clock org-colview org-id
+ org-table org-timer)))
+
+;;;###autoload
+(defun org-reload (&optional uncompiled)
+ "Reload all Org Lisp files.
+With prefix arg UNCOMPILED, load the uncompiled versions."
+ (interactive "P")
+ (require 'loadhist)
+ (let* ((org-dir (org-find-library-dir "org"))
+ (contrib-dir (or (org-find-library-dir "org-contribdir") org-dir))
+ (feature-re "^\\(org\\|ob\\|ox\\)\\(-.*\\)?")
+ (remove-re (format "\\`%s\\'"
+ (regexp-opt '("org" "org-loaddefs" "org-version"))))
+ (feats (delete-dups
+ (mapcar 'file-name-sans-extension
+ (mapcar 'file-name-nondirectory
+ (delq nil
+ (mapcar 'feature-file
+ features))))))
+ (lfeat (append
+ (sort
+ (setq feats
+ (delq nil (mapcar
+ (lambda (f)
+ (if (and (string-match feature-re f)
+ (not (string-match remove-re f)))
+ f nil))
+ feats)))
+ 'string-lessp)
+ (list "org-version" "org")))
+ (load-suffixes (when (boundp 'load-suffixes) load-suffixes))
+ (load-suffixes (if uncompiled (reverse load-suffixes) load-suffixes))
+ load-uncore load-misses)
+ (setq load-misses
+ (delq 't
+ (mapcar (lambda (f)
+ (or (org-load-noerror-mustsuffix (concat org-dir f))
+ (and (string= org-dir contrib-dir)
+ (org-load-noerror-mustsuffix (concat contrib-dir f)))
+ (and (org-load-noerror-mustsuffix (concat (org-find-library-dir f) f))
+ (push f load-uncore)
+ 't)
+ f))
+ lfeat)))
+ (when load-uncore
+ (message "The following feature%s found in load-path, please check if that's correct:\n%s"
+ (if (> (length load-uncore) 1) "s were" " was")
+ (reverse load-uncore)))
+ (if load-misses
+ (message "Some error occurred while reloading Org feature%s\n%s\nPlease check *Messages*!\n%s"
+ (if (> (length load-misses) 1) "s" "") load-misses (org-version nil 'full))
+ (message "Successfully reloaded Org\n%s" (org-version nil 'full)))))
+
+;;;###autoload
+(defun org-customize ()
+ "Call the customize function with org as argument."
+ (interactive)
+ (org-load-modules-maybe)
+ (org-require-autoloaded-modules)
+ (customize-browse 'org))
+
+(defun org-create-customize-menu ()
+ "Create a full customization menu for Org mode, insert it into the menu."
+ (interactive)
+ (org-load-modules-maybe)
+ (org-require-autoloaded-modules)
+ (easy-menu-change
+ '("Org") "Customize"
+ `(["Browse Org group" org-customize t]
+ "--"
+ ,(customize-menu-create 'org)
+ ["Set" Custom-set t]
+ ["Save" Custom-save t]
+ ["Reset to Current" Custom-reset-current t]
+ ["Reset to Saved" Custom-reset-saved t]
+ ["Reset to Standard Settings" Custom-reset-standard t]))
+ (message "\"Org\"-menu now contains full customization menu"))
+
+;;;; Miscellaneous stuff
+
+;;; Generally useful functions
+
+(defun org-in-clocktable-p ()
+ "Check if the cursor is in a clocktable."
+ (let ((pos (point)) start)
+ (save-excursion
+ (end-of-line 1)
+ (and (re-search-backward "^[ \t]*#\\+BEGIN:[ \t]+clocktable" nil t)
+ (setq start (match-beginning 0))
+ (re-search-forward "^[ \t]*#\\+END:.*" nil t)
+ (>= (match-end 0) pos)
+ start))))
+
+(defun org-in-verbatim-emphasis ()
+ (save-match-data
+ (and (org-in-regexp org-verbatim-re 2)
+ (>= (point) (match-beginning 3))
+ (<= (point) (match-end 4)))))
+
+(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)
+ (buffer-live-p (marker-buffer marker)))
+ (progn
+ (pop-to-buffer-same-window (marker-buffer marker))
+ (when (or (> marker (point-max)) (< marker (point-min)))
+ (widen))
+ (goto-char marker)
+ (org-show-context 'org-goto))
+ (if bookmark
+ (bookmark-jump bookmark)
+ (error "Cannot find location"))))
+
+(defun org-quote-csv-field (s)
+ "Quote field for inclusion in CSV material."
+ (if (string-match "[\",]" s)
+ (concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"") "\"")
+ s))
+
+(defun org-force-self-insert (N)
+ "Needed to enforce self-insert under remapping."
+ (interactive "p")
+ (self-insert-command N))
+
+(defun org-quote-vert (s)
+ "Replace \"|\" with \"\\vert\"."
+ (while (string-match "|" s)
+ (setq s (replace-match "\\vert" t t s)))
+ s)
+
+(defun org-uuidgen-p (s)
+ "Is S an ID created by UUIDGEN?"
+ (string-match "\\`[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}\\'" (downcase s)))
+
+(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 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)
+ (save-match-data
+ (save-excursion
+ (beginning-of-line)
+ (looking-at ".*#\\+\\(begin\\|end\\)_src")))))))
+
+(defun org-context ()
+ "Return a list of contexts of the current cursor position.
+If several contexts apply, all are returned.
+Each context entry is a list with a symbol naming the context, and
+two positions indicating start and end of the context. Possible
+contexts are:
+
+:headline anywhere in a headline
+:headline-stars on the leading stars in a headline
+:todo-keyword on a TODO keyword (including DONE) in a headline
+:tags on the TAGS in a headline
+:priority on the priority cookie in a headline
+:item on the first line of a plain list item
+:item-bullet on the bullet/number of a plain list item
+:checkbox on the checkbox in a plain list item
+:table in an Org table
+:table-special on a special filed in a table
+:table-table in a table.el table
+:clocktable in a clocktable
+:src-block in a source block
+:link on a hyperlink
+:keyword on a keyword: SCHEDULED, DEADLINE, CLOSE, COMMENT.
+:latex-fragment on a LaTeX fragment
+:latex-preview on a LaTeX fragment with overlaid preview image
+
+This function expects the position to be visible because it uses font-lock
+faces as a help to recognize the following contexts: :table-special, :link,
+and :keyword."
+ (let* ((f (get-text-property (point) 'face))
+ (faces (if (listp f) f (list f)))
+ (case-fold-search t)
+ (p (point)) clist o)
+ ;; First the large context
+ (cond
+ ((org-at-heading-p t)
+ (push (list :headline (point-at-bol) (point-at-eol)) clist)
+ (when (progn
+ (beginning-of-line 1)
+ (looking-at org-todo-line-tags-regexp))
+ (push (org-point-in-group p 1 :headline-stars) clist)
+ (push (org-point-in-group p 2 :todo-keyword) clist)
+ (push (org-point-in-group p 4 :tags) clist))
+ (goto-char p)
+ (skip-chars-backward "^[\n\r \t") (or (bobp) (backward-char 1))
+ (when (looking-at "\\[#[A-Z0-9]\\]")
+ (push (org-point-in-group p 0 :priority) clist)))
+
+ ((org-at-item-p)
+ (push (org-point-in-group p 2 :item-bullet) clist)
+ (push (list :item (point-at-bol)
+ (save-excursion (org-end-of-item) (point)))
+ clist)
+ (and (org-at-item-checkbox-p)
+ (push (org-point-in-group p 0 :checkbox) clist)))
+
+ ((org-at-table-p)
+ (push (list :table (org-table-begin) (org-table-end)) clist)
+ (when (memq 'org-formula faces)
+ (push (list :table-special
+ (previous-single-property-change p 'face)
+ (next-single-property-change p 'face))
+ clist)))
+ ((org-at-table-p 'any)
+ (push (list :table-table) clist)))
+ (goto-char p)
+
+ (let ((case-fold-search t))
+ ;; New the "medium" contexts: clocktables, source blocks
+ (cond ((org-in-clocktable-p)
+ (push (list :clocktable
+ (and (or (looking-at "[ \t]*\\(#\\+BEGIN: clocktable\\)")
+ (re-search-backward "[ \t]*\\(#+BEGIN: clocktable\\)" nil t))
+ (match-beginning 1))
+ (and (re-search-forward "[ \t]*#\\+END:?" nil t)
+ (match-end 0)))
+ clist))
+ ((org-in-src-block-p)
+ (push (list :src-block
+ (and (or (looking-at "[ \t]*\\(#\\+BEGIN_SRC\\)")
+ (re-search-backward "[ \t]*\\(#+BEGIN_SRC\\)" nil t))
+ (match-beginning 1))
+ (and (search-forward "#+END_SRC" nil t)
+ (match-beginning 0)))
+ clist))))
+ (goto-char p)
+
+ ;; Now the small context
+ (cond
+ ((org-at-timestamp-p)
+ (push (org-point-in-group p 0 :timestamp) clist))
+ ((memq 'org-link faces)
+ (push (list :link
+ (previous-single-property-change p 'face)
+ (next-single-property-change p 'face))
+ clist))
+ ((memq 'org-special-keyword faces)
+ (push (list :keyword
+ (previous-single-property-change p 'face)
+ (next-single-property-change p 'face))
+ clist))
+ ((setq o (cl-some
+ (lambda (o)
+ (and (eq (overlay-get o 'org-overlay-type) 'org-latex-overlay)
+ o))
+ (overlays-at (point))))
+ (push (list :latex-fragment
+ (overlay-start o) (overlay-end o))
+ clist)
+ (push (list :latex-preview
+ (overlay-start o) (overlay-end o))
+ clist))
+ ((org-inside-LaTeX-fragment-p)
+ ;; FIXME: positions wrong.
+ (push (list :latex-fragment (point) (point)) clist)))
+
+ (setq clist (nreverse (delq nil clist)))
+ clist))
+
+(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.
+
+Also return a non-nil value when point is on one of the matches.
+
+Optional arguments LIM-UP and LIM-DOWN bound the search; they are
+buffer positions. Default values are the positions of headlines
+surrounding the point.
+
+The functions returns a cons cell whose car (resp. cdr) is the
+position before START-RE (resp. after END-RE)."
+ (save-match-data
+ (let ((pos (point))
+ (limit-up (or lim-up (save-excursion (outline-previous-heading))))
+ (limit-down (or lim-down (save-excursion (outline-next-heading))))
+ beg end)
+ (save-excursion
+ ;; Point is on a block when on START-RE or if START-RE can be
+ ;; found before it...
+ (and (or (org-in-regexp start-re)
+ (re-search-backward start-re limit-up t))
+ (setq beg (match-beginning 0))
+ ;; ... and END-RE after it...
+ (goto-char (match-end 0))
+ (re-search-forward end-re limit-down t)
+ (> (setq end (match-end 0)) pos)
+ ;; ... without another START-RE in-between.
+ (goto-char (match-beginning 0))
+ (not (re-search-backward start-re (1+ beg) t))
+ ;; Return value.
+ (cons beg end))))))
+
+(defun org-in-block-p (names)
+ "Non-nil when point belongs to a block whose name belongs to NAMES.
+
+NAMES is a list of strings containing names of blocks.
+
+Return first block name matched, or nil. Beware that in case of
+nested blocks, the returned name may not belong to the closest
+block from point."
+ (save-match-data
+ (catch 'exit
+ (let ((case-fold-search t)
+ (lim-up (save-excursion (outline-previous-heading)))
+ (lim-down (save-excursion (outline-next-heading))))
+ (dolist (name names)
+ (let ((n (regexp-quote name)))
+ (when (org-between-regexps-p
+ (concat "^[ \t]*#\\+begin_" n)
+ (concat "^[ \t]*#\\+end_" n)
+ lim-up lim-down)
+ (throw 'exit n)))))
+ nil)))
+
+(defun org-occur-in-agenda-files (regexp &optional _nlines)
+ "Call `multi-occur' with buffers for all agenda files."
+ (interactive "sOrg-files matching: ")
+ (let* ((files (org-agenda-files))
+ (tnames (mapcar #'file-truename files))
+ (extra org-agenda-text-search-extra-files))
+ (when (eq (car extra) 'agenda-archives)
+ (setq extra (cdr extra))
+ (setq files (org-add-archive-files files)))
+ (dolist (f extra)
+ (unless (member (file-truename f) tnames)
+ (unless (member f files) (setq files (append files (list f))))
+ (setq tnames (append tnames (list (file-truename f))))))
+ (multi-occur
+ (mapcar (lambda (x)
+ (with-current-buffer
+ ;; FIXME: Why not just (find-file-noselect x)?
+ ;; Is it to avoid the "revert buffer" prompt?
+ (or (get-file-buffer x) (find-file-noselect x))
+ (widen)
+ (current-buffer)))
+ files)
+ regexp)))
+
+(add-hook 'occur-mode-find-occurrence-hook
+ (lambda () (when (derived-mode-p 'org-mode) (org-reveal))))
+
+(defun org-occur-link-in-agenda-files ()
+ "Create a link and search for it in the agendas.
+The link is not stored in `org-stored-links', it is just created
+for the search purpose."
+ (interactive)
+ (let ((link (condition-case nil
+ (org-store-link nil)
+ (error "Unable to create a link to here"))))
+ (org-occur-in-agenda-files (regexp-quote link))))
+
+(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."
+ (let ((pos (point)))
+ (if (cdr (assq 'heading org-blank-before-new-entry))
+ (skip-chars-backward " \t\n\r")
+ (unless (eobp)
+ (forward-line -1)))
+ (beginning-of-line 2)
+ (goto-char (min (point) pos))
+ (count-lines (point) pos)))
+
+;;; TODO: Only called once, from ox-odt which should probably use
+;;; org-export-inline-image-p or something.
+(defun org-file-image-p (file)
+ "Return non-nil if FILE is an image."
+ (save-match-data
+ (string-match (image-file-name-regexp) file)))
+
+(defun org-get-cursor-date (&optional with-time)
+ "Return the date at cursor in as a time.
+This works in the calendar and in the agenda, anywhere else it just
+returns the current time.
+If WITH-TIME is non-nil, returns the time of the event at point (in
+the agenda) or the current time of the day; otherwise returns the
+earliest time on the cursor date that Org treats as that date
+(bearing in mind `org-extend-today-until')."
+ (let (date day defd tp hod mod)
+ (when with-time
+ (setq tp (get-text-property (point) 'time))
+ (when (and tp (string-match "\\([0-2]?[0-9]\\):\\([0-5][0-9]\\)" tp))
+ (setq hod (string-to-number (match-string 1 tp))
+ mod (string-to-number (match-string 2 tp))))
+ (or tp (let ((now (decode-time)))
+ (setq hod (nth 2 now)
+ mod (nth 1 now)))))
+ (cond
+ ((eq major-mode 'calendar-mode)
+ (setq date (calendar-cursor-to-date)
+ defd (encode-time 0 (or mod 0) (or hod org-extend-today-until)
+ (nth 1 date) (nth 0 date) (nth 2 date))))
+ ((eq major-mode 'org-agenda-mode)
+ (setq day (get-text-property (point) 'day))
+ (when day
+ (setq date (calendar-gregorian-from-absolute day)
+ defd (encode-time 0 (or mod 0) (or hod org-extend-today-until)
+ (nth 1 date) (nth 0 date) (nth 2 date))))))
+ (or defd (current-time))))
+
+(defun org-mark-subtree (&optional up)
+ "Mark the current subtree.
+This puts point at the start of the current subtree, and mark at
+the end. If a numeric prefix UP is given, move up into the
+hierarchy of headlines by UP levels before marking the subtree."
+ (interactive "P")
+ (org-with-limited-levels
+ (cond ((org-at-heading-p) (beginning-of-line))
+ ((org-before-first-heading-p) (user-error "Not in a subtree"))
+ (t (outline-previous-visible-heading 1))))
+ (when up (while (and (> up 0) (org-up-heading-safe)) (cl-decf up)))
+ (if (called-interactively-p 'any)
+ (call-interactively 'org-mark-element)
+ (org-mark-element)))
+
+;;; Indentation
+
+(defvar org-element-greater-elements)
+(defun org--get-expected-indentation (element contentsp)
+ "Expected indentation column for current line, according to ELEMENT.
+ELEMENT is an element containing point. CONTENTSP is non-nil
+when indentation is to be computed according to contents of
+ELEMENT."
+ (let ((type (org-element-type element))
+ (start (org-element-property :begin element))
+ (post-affiliated (org-element-property :post-affiliated element)))
+ (org-with-wide-buffer
+ (cond
+ (contentsp
+ (cl-case type
+ ((diary-sexp footnote-definition) 0)
+ ((headline inlinetask nil)
+ (if (not org-adapt-indentation) 0
+ (let ((level (org-current-level)))
+ (if level (1+ level) 0))))
+ ((item plain-list) (org-list-item-body-column post-affiliated))
+ (t
+ (goto-char start)
+ (current-indentation))))
+ ((memq type '(headline inlinetask nil))
+ (if (org-match-line "[ \t]*$")
+ (org--get-expected-indentation element t)
+ 0))
+ ((memq type '(diary-sexp footnote-definition)) 0)
+ ;; First paragraph of a footnote definition or an item.
+ ;; Indent like parent.
+ ((< (line-beginning-position) start)
+ (org--get-expected-indentation
+ (org-element-property :parent element) t))
+ ;; At first line: indent according to previous sibling, if any,
+ ;; ignoring footnote definitions and inline tasks, or parent's
+ ;; contents.
+ ((and ( = (line-beginning-position) start)
+ (eq org-adapt-indentation t))
+ (catch 'exit
+ (while t
+ (if (= (point-min) start) (throw 'exit 0)
+ (goto-char (1- start))
+ (let* ((previous (org-element-at-point))
+ (parent previous))
+ (while (and parent (<= (org-element-property :end parent) start))
+ (setq previous parent
+ parent (org-element-property :parent parent)))
+ (cond
+ ((not previous) (throw 'exit 0))
+ ((> (org-element-property :end previous) start)
+ (throw 'exit (org--get-expected-indentation previous t)))
+ ((memq (org-element-type previous)
+ '(footnote-definition inlinetask))
+ (setq start (org-element-property :begin previous)))
+ (t (goto-char (org-element-property :begin previous))
+ (throw 'exit
+ (if (bolp) (current-indentation)
+ ;; At first paragraph in an item or
+ ;; a footnote definition.
+ (org--get-expected-indentation
+ (org-element-property :parent previous) t))))))))))
+ ;; Otherwise, move to the first non-blank line above.
+ (t
+ (beginning-of-line)
+ (let ((pos (point)))
+ (skip-chars-backward " \r\t\n")
+ (cond
+ ;; Two blank lines end a footnote definition or a plain
+ ;; list. When we indent an empty line after them, the
+ ;; containing list or footnote definition is over, so it
+ ;; qualifies as a previous sibling. Therefore, we indent
+ ;; like its first line.
+ ((and (memq type '(footnote-definition plain-list))
+ (> (count-lines (point) pos) 2))
+ (goto-char start)
+ (current-indentation))
+ ;; Line above is the first one of a paragraph at the
+ ;; beginning of an item or a footnote definition. Indent
+ ;; like parent.
+ ((< (line-beginning-position) start)
+ (org--get-expected-indentation
+ (org-element-property :parent element) t))
+ ;; Line above is the beginning of an element, i.e., point
+ ;; was originally on the blank lines between element's start
+ ;; and contents.
+ ((= (line-beginning-position) post-affiliated)
+ (org--get-expected-indentation element t))
+ ;; POS is after contents in a greater element. Indent like
+ ;; the beginning of the element.
+ ((and (memq type org-element-greater-elements)
+ (let ((cend (org-element-property :contents-end element)))
+ (and cend (<= cend pos))))
+ ;; As a special case, if point is at the end of a footnote
+ ;; definition or an item, indent like the very last element
+ ;; within. If that last element is an item, indent like
+ ;; its contents.
+ (if (memq type '(footnote-definition item plain-list))
+ (let ((last (org-element-at-point)))
+ (goto-char pos)
+ (org--get-expected-indentation
+ last (eq (org-element-type last) 'item)))
+ (goto-char start)
+ (current-indentation)))
+ ;; In any other case, indent like the current line.
+ (t (current-indentation)))))
+ ;; Finally, no indentation is needed, fall back to 0.
+ (t (current-indentation))))))
+
+(defun org--align-node-property ()
+ "Align node property at point.
+Alignment is done according to `org-property-format', which see."
+ (when (save-excursion
+ (beginning-of-line)
+ (looking-at org-property-re))
+ (replace-match
+ (concat (match-string 4)
+ (org-trim
+ (format org-property-format (match-string 1) (match-string 3))))
+ t t)))
+
+(defun org-indent-line ()
+ "Indent line depending on context.
+
+Indentation is done according to the following rules:
+
+ - Footnote definitions, diary sexps, headlines and inline tasks
+ have to start at column 0.
+
+ - On the very first line of an element, consider, in order, the
+ next rules until one matches:
+
+ 1. If there's a sibling element before, ignoring footnote
+ definitions and inline tasks, indent like its first line.
+
+ 2. If element has a parent, indent like its contents. More
+ precisely, if parent is an item, indent after the bullet.
+ Else, indent like parent's first line.
+
+ 3. Otherwise, indent relatively to current level, if
+ `org-adapt-indentation' is t, or to left margin.
+
+ - On a blank line at the end of an element, indent according to
+ the type of the element. More precisely
+
+ 1. If element is a plain list, an item, or a footnote
+ definition, indent like the very last element within.
+
+ 2. If element is a paragraph, indent like its last non blank
+ line.
+
+ 3. Otherwise, indent like its very first line.
+
+ - In the code part of a source block, use language major mode
+ to indent current line if `org-src-tab-acts-natively' is
+ non-nil. If it is nil, do nothing.
+
+ - Otherwise, indent like the first non-blank line above.
+
+The function doesn't indent an item as it could break the whole
+list structure. Instead, use \\<org-mode-map>`\\[org-shiftmetaleft]' or \
+`\\[org-shiftmetaright]'.
+
+Also align node properties according to `org-property-format'."
+ (interactive)
+ (unless (or (org-at-heading-p)
+ (and (eq org-adapt-indentation 'headline-data)
+ (not (or (org-at-clock-log-p)
+ (org-at-planning-p)))
+ (save-excursion
+ (beginning-of-line 1)
+ (skip-chars-backward "\n")
+ (or (org-at-heading-p)
+ (looking-back ":END:.*" (point-at-bol))))))
+ (let* ((element (save-excursion (beginning-of-line) (org-element-at-point)))
+ (type (org-element-type element)))
+ (cond ((and (memq type '(plain-list item))
+ (= (line-beginning-position)
+ (org-element-property :post-affiliated element)))
+ nil)
+ ((and (eq type 'latex-environment)
+ (>= (point) (org-element-property :post-affiliated element))
+ (< (point)
+ (org-with-point-at (org-element-property :end element)
+ (skip-chars-backward " \t\n")
+ (line-beginning-position 2))))
+ nil)
+ ((and (eq type 'src-block)
+ org-src-tab-acts-natively
+ (> (line-beginning-position)
+ (org-element-property :post-affiliated element))
+ (< (line-beginning-position)
+ (org-with-point-at (org-element-property :end element)
+ (skip-chars-backward " \t\n")
+ (line-beginning-position))))
+ ;; At the beginning of a blank line, do some preindentation. This
+ ;; signals org-src--edit-element to preserve the indentation on exit
+ (when (and (looking-at-p "^[[:space:]]*$")
+ (not org-src-preserve-indentation))
+ (let ((element (org-element-at-point))
+ block-content-ind some-ind)
+ (org-with-point-at (org-element-property :begin element)
+ (setq block-content-ind (+ (current-indentation)
+ org-edit-src-content-indentation))
+ (forward-line)
+ (save-match-data (re-search-forward "^[ \t]*\\S-" nil t))
+ (backward-char)
+ (setq some-ind (if (looking-at-p "#\\+end_src")
+ block-content-ind (current-indentation))))
+ (indent-line-to (min block-content-ind some-ind))))
+ (org-babel-do-key-sequence-in-edit-buffer (kbd "TAB")))
+ (t
+ (let ((column (org--get-expected-indentation element nil)))
+ ;; Preserve current column.
+ (if (<= (current-column) (current-indentation))
+ (indent-line-to column)
+ (save-excursion (indent-line-to column))))
+ ;; Align node property. Also preserve current column.
+ (when (eq type 'node-property)
+ (let ((column (current-column)))
+ (org--align-node-property)
+ (org-move-to-column column))))))))
+
+(defun org-indent-region (start end)
+ "Indent each non-blank line in the region.
+Called from a program, START and END specify the region to
+indent. The function will not indent contents of example blocks,
+verse blocks and export blocks as leading white spaces are
+assumed to be significant there."
+ (interactive "r")
+ (save-excursion
+ (goto-char start)
+ (skip-chars-forward " \r\t\n")
+ (unless (eobp) (beginning-of-line))
+ (let ((indent-to
+ (lambda (ind pos)
+ ;; Set IND as indentation for all lines between point and
+ ;; POS. Blank lines are ignored. Leave point after POS
+ ;; once done.
+ (let ((limit (copy-marker pos)))
+ (while (< (point) limit)
+ (unless (looking-at-p "[ \t]*$") (indent-line-to ind))
+ (forward-line))
+ (set-marker limit nil))))
+ (end (copy-marker end)))
+ (while (< (point) end)
+ (if (or (looking-at-p " \r\t\n") (org-at-heading-p)) (forward-line)
+ (let* ((element (org-element-at-point))
+ (type (org-element-type element))
+ (element-end (copy-marker (org-element-property :end element)))
+ (ind (org--get-expected-indentation element nil)))
+ (cond
+ ;; Element indented as a single block. Example blocks
+ ;; preserving indentation are a special case since the
+ ;; "contents" must not be indented whereas the block
+ ;; boundaries can.
+ ((or (memq type '(export-block latex-environment))
+ (and (eq type 'example-block)
+ (not
+ (or org-src-preserve-indentation
+ (org-element-property :preserve-indent element)))))
+ (let ((offset (- ind (current-indentation))))
+ (unless (zerop offset)
+ (indent-rigidly (org-element-property :begin element)
+ (org-element-property :end element)
+ offset)))
+ (goto-char element-end))
+ ;; Elements indented line wise. Be sure to exclude
+ ;; example blocks (preserving indentation) and source
+ ;; blocks from this category as they are treated
+ ;; specially later.
+ ((or (memq type '(paragraph table table-row))
+ (not (or (org-element-property :contents-begin element)
+ (memq type '(example-block src-block)))))
+ (when (eq type 'node-property)
+ (org--align-node-property)
+ (beginning-of-line))
+ (funcall indent-to ind (min element-end end)))
+ ;; Elements consisting of three parts: before the
+ ;; contents, the contents, and after the contents. The
+ ;; contents are treated specially, according to the
+ ;; element type, or not indented at all. Other parts are
+ ;; indented as a single block.
+ (t
+ (let* ((post (copy-marker
+ (org-element-property :post-affiliated element)))
+ (cbeg
+ (copy-marker
+ (cond
+ ((not (org-element-property :contents-begin element))
+ ;; Fake contents for source blocks.
+ (org-with-wide-buffer
+ (goto-char post)
+ (line-beginning-position 2)))
+ ((memq type '(footnote-definition item plain-list))
+ ;; Contents in these elements could start on
+ ;; the same line as the beginning of the
+ ;; element. Make sure we start indenting
+ ;; from the second line.
+ (org-with-wide-buffer
+ (goto-char post)
+ (end-of-line)
+ (skip-chars-forward " \r\t\n")
+ (if (eobp) (point) (line-beginning-position))))
+ (t (org-element-property :contents-begin element)))))
+ (cend (copy-marker
+ (or (org-element-property :contents-end element)
+ ;; Fake contents for source blocks.
+ (org-with-wide-buffer
+ (goto-char element-end)
+ (skip-chars-backward " \r\t\n")
+ (line-beginning-position)))
+ t)))
+ ;; Do not change items indentation individually as it
+ ;; 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 (current-indentation))))
+ (unless (zerop offset)
+ (indent-rigidly (org-element-property :begin element)
+ (org-element-property :end element)
+ offset))
+ (goto-char cbeg)))
+ ((eq type 'item) (goto-char cbeg))
+ (t (funcall indent-to ind (min cbeg end))))
+ (when (< (point) end)
+ (cl-case type
+ ((example-block verse-block))
+ (src-block
+ ;; In a source block, indent source code
+ ;; according to language major mode, but only if
+ ;; `org-src-tab-acts-natively' is non-nil.
+ (when (and (< (point) end) org-src-tab-acts-natively)
+ (ignore-errors
+ (org-babel-do-in-edit-buffer
+ (indent-region (point-min) (point-max))))))
+ (t (org-indent-region (point) (min cend end))))
+ (goto-char (min cend end))
+ (when (< (point) end)
+ (funcall indent-to ind (min element-end end))))
+ (set-marker post nil)
+ (set-marker cbeg nil)
+ (set-marker cend nil))))
+ (set-marker element-end nil))))
+ (set-marker end nil))))
+
+(defun org-indent-drawer ()
+ "Indent the drawer at point."
+ (interactive)
+ (unless (save-excursion
+ (beginning-of-line)
+ (looking-at-p org-drawer-regexp))
+ (user-error "Not at a drawer"))
+ (let ((element (org-element-at-point)))
+ (unless (memq (org-element-type element) '(drawer property-drawer))
+ (user-error "Not at a drawer"))
+ (org-with-wide-buffer
+ (org-indent-region (org-element-property :begin element)
+ (org-element-property :end element))))
+ (message "Drawer at point indented"))
+
+(defun org-indent-block ()
+ "Indent the block at point."
+ (interactive)
+ (unless (save-excursion
+ (beginning-of-line)
+ (let ((case-fold-search t))
+ (looking-at-p "[ \t]*#\\+\\(begin\\|end\\)_")))
+ (user-error "Not at a block"))
+ (let ((element (org-element-at-point)))
+ (unless (memq (org-element-type element)
+ '(comment-block center-block dynamic-block example-block
+ export-block quote-block special-block
+ src-block verse-block))
+ (user-error "Not at a block"))
+ (org-with-wide-buffer
+ (org-indent-region (org-element-property :begin element)
+ (org-element-property :end element))))
+ (message "Block at point indented"))
+
+
+;;; Filling
+
+;; We use our own fill-paragraph and auto-fill functions.
+
+;; `org-fill-paragraph' relies on adaptive filling and context
+;; checking. Appropriate `fill-prefix' is computed with
+;; `org-adaptive-fill-function'.
+
+;; `org-auto-fill-function' takes care of auto-filling. It calls
+;; `do-auto-fill' only on valid areas with `fill-prefix' shadowed with
+;; `org-adaptive-fill-function' value. Internally,
+;; `org-comment-line-break-function' breaks the line.
+
+;; `org-setup-filling' installs filling and auto-filling related
+;; variables during `org-mode' initialization.
+
+(defun org-setup-filling ()
+ (require 'org-element)
+ ;; Prevent auto-fill from inserting unwanted new items.
+ (when (boundp 'fill-nobreak-predicate)
+ (setq-local
+ fill-nobreak-predicate
+ (org-uniquify
+ (append fill-nobreak-predicate
+ '(org-fill-line-break-nobreak-p
+ org-fill-n-macro-as-item-nobreak-p
+ org-fill-paragraph-with-timestamp-nobreak-p)))))
+ (let ((paragraph-ending (substring org-element-paragraph-separate 1)))
+ (setq-local paragraph-start paragraph-ending)
+ (setq-local paragraph-separate paragraph-ending))
+ (setq-local fill-paragraph-function 'org-fill-paragraph)
+ (setq-local auto-fill-inhibit-regexp nil)
+ (setq-local adaptive-fill-function 'org-adaptive-fill-function)
+ (setq-local normal-auto-fill-function 'org-auto-fill-function)
+ (setq-local comment-line-break-function 'org-comment-line-break-function))
+
+(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 "\\\\")
+ (looking-at "\\\\\\\\\\($\\|[^\\]\\)")))
+
+(defun org-fill-paragraph-with-timestamp-nobreak-p ()
+ "Non-nil when a new line at point would split a timestamp."
+ (and (org-at-timestamp-p 'lax)
+ (not (looking-at org-ts-regexp-both))))
+
+(defun org-fill-n-macro-as-item-nobreak-p ()
+ "Non-nil when a new line at point would create a new list."
+ ;; During export, a "n" macro followed by a dot or a closing
+ ;; parenthesis can end up being parsed as a new list item.
+ (looking-at-p "[ \t]*{{{n\\(?:([^\n)]*)\\)?}}}[.)]\\(?:$\\| \\)"))
+
+(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."
+ (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)
+ (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.
+
+This function only applies to comment blocks, comments, example
+blocks and paragraphs. Also, as a special case, re-align table
+when point is at one.
+
+If JUSTIFY is non-nil (interactively, with prefix argument),
+justify as well. If `sentence-end-double-space' is non-nil, then
+period followed by one space does not end a sentence, so don't
+break a line there. The variable `fill-column' controls the
+width for filling.
+
+For convenience, when point is at a plain list, an item or
+a footnote definition, try to fill the first paragraph within."
+ (with-syntax-table org-mode-transpose-word-syntax-table
+ ;; Move to end of line in order to get the first paragraph within
+ ;; a plain list or a footnote definition.
+ (let ((element (save-excursion (end-of-line) (org-element-at-point))))
+ ;; 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 source blocks.
+ (src-block (org-babel-do-in-edit-buffer
+ (push-mark (point-min))
+ (goto-char (point-max))
+ (setq mark-active t)
+ (funcall-interactively #'fill-paragraph justify 'region)))
+ ;; Align Org tables, leave table.el tables as-is.
+ (table-row (org-table-align) t)
+ (table
+ (when (eq (org-element-property :type element) 'org)
+ (save-excursion
+ (goto-char (org-element-property :post-affiliated element))
+ (org-table-align)))
+ t)
+ (paragraph
+ ;; Paragraphs may contain `line-break' type objects.
+ (let ((beg (max (point-min)
+ (org-element-property :contents-begin element)))
+ (end (min (point-max)
+ (org-element-property :contents-end element))))
+ ;; Do nothing if point is at an affiliated keyword.
+ (if (< (line-end-position) beg) t
+ ;; Fill paragraph, taking line breaks into account.
+ (save-excursion
+ (goto-char beg)
+ (let ((cuts (list beg)))
+ (while (re-search-forward "\\\\\\\\[ \t]*\n" end t)
+ (when (eq 'line-break
+ (org-element-type
+ (save-excursion (backward-char)
+ (org-element-context))))
+ (push (point) cuts)))
+ (dolist (c (delq end cuts))
+ (fill-region-as-paragraph c end justify)
+ (setq end c))))
+ t)))
+ ;; Contents of `comment-block' type elements should be
+ ;; filled as plain text, but only if point is within block
+ ;; markers.
+ (comment-block
+ (let* ((case-fold-search t)
+ (beg (save-excursion
+ (goto-char (org-element-property :begin element))
+ (re-search-forward "^[ \t]*#\\+begin_comment" nil t)
+ (forward-line)
+ (point)))
+ (end (save-excursion
+ (goto-char (org-element-property :end element))
+ (re-search-backward "^[ \t]*#\\+end_comment" nil t)
+ (line-beginning-position))))
+ (if (or (< (point) beg) (> (point) end)) t
+ (fill-region-as-paragraph
+ (save-excursion (end-of-line)
+ (re-search-backward "^[ \t]*$" beg 'move)
+ (line-beginning-position))
+ (save-excursion (beginning-of-line)
+ (re-search-forward "^[ \t]*$" end 'move)
+ (line-beginning-position))
+ justify))))
+ ;; Fill comments.
+ (comment
+ (let ((begin (org-element-property :post-affiliated element))
+ (end (org-element-property :end element)))
+ (when (and (>= (point) begin) (<= (point) end))
+ (let ((begin (save-excursion
+ (end-of-line)
+ (if (re-search-backward "^[ \t]*#[ \t]*$" begin t)
+ (progn (forward-line) (point))
+ begin)))
+ (end (save-excursion
+ (end-of-line)
+ (if (re-search-forward "^[ \t]*#[ \t]*$" end 'move)
+ (1- (line-beginning-position))
+ (skip-chars-backward " \r\t\n")
+ (line-end-position)))))
+ ;; Do not fill comments when at a blank line.
+ (when (> end begin)
+ (let ((fill-prefix
+ (save-excursion
+ (beginning-of-line)
+ (looking-at "[ \t]*#")
+ (let ((comment-prefix (match-string 0)))
+ (goto-char (match-end 0))
+ (if (looking-at adaptive-fill-regexp)
+ (concat comment-prefix (match-string 0))
+ (concat comment-prefix " "))))))
+ (save-excursion
+ (fill-region-as-paragraph begin end justify))))))
+ t))
+ ;; Ignore every other element.
+ (otherwise t)))))
+
+(defun org-fill-paragraph (&optional justify region)
+ "Fill element at point, when applicable.
+
+This function only applies to comment blocks, comments, example
+blocks and paragraphs. Also, as a special case, re-align table
+when point is at one.
+
+For convenience, when point is at a plain list, an item or
+a footnote definition, try to fill the first paragraph within.
+
+If JUSTIFY is non-nil (interactively, with prefix argument),
+justify as well. If `sentence-end-double-space' is non-nil, then
+period followed by one space does not end a sentence, so don't
+break a line there. The variable `fill-column' controls the
+width for filling.
+
+The REGION argument is non-nil if called interactively; in that
+case, if Transient Mark mode is enabled and the mark is active,
+fill each of the elements in the active region, instead of just
+filling the current element."
+ (interactive (progn
+ (barf-if-buffer-read-only)
+ (list (when current-prefix-arg 'full) t)))
+ (let ((hash (and (not (buffer-modified-p))
+ (org-buffer-hash))))
+ (cond
+ ((and region transient-mark-mode mark-active
+ (not (eq (region-beginning) (region-end))))
+ (let ((origin (point-marker))
+ (start (region-beginning)))
+ (unwind-protect
+ (progn
+ (goto-char (region-end))
+ (skip-chars-backward " \t\n")
+ (while (> (point) start)
+ (org-fill-element justify)
+ (org-backward-paragraph)))
+ (goto-char origin)
+ (set-marker origin nil))))
+ (t
+ (save-excursion
+ (when (org-match-line "[ \t]*$")
+ (skip-chars-forward " \t\n"))
+ (org-fill-element justify))))
+ ;; If we didn't change anything in the buffer (and the buffer was
+ ;; previously unmodified), then flip the modification status back
+ ;; to "unchanged".
+ (when (and hash (equal hash (org-buffer-hash)))
+ (set-buffer-modified-p nil))
+ ;; Return non-nil.
+ t))
+
+(defun org-auto-fill-function ()
+ "Auto-fill function."
+ ;; Check if auto-filling is meaningful.
+ (let ((fc (current-fill-column)))
+ (when (and fc (> (current-column) fc))
+ (let* ((fill-prefix (org-adaptive-fill-function))
+ ;; Enforce empty fill prefix, if required. Otherwise, it
+ ;; will be computed again.
+ (adaptive-fill-mode (not (equal fill-prefix ""))))
+ (when fill-prefix (do-auto-fill))))))
+
+(defun org-comment-line-break-function (&optional soft)
+ "Break line at point and indent, continuing comment if within one.
+The inserted newline is marked hard if variable
+`use-hard-newlines' is true, unless optional argument SOFT is
+non-nil."
+ (if soft (insert-and-inherit ?\n) (newline 1))
+ (save-excursion (forward-char -1) (delete-horizontal-space))
+ (delete-horizontal-space)
+ (indent-to-left-margin)
+ (insert-before-markers-and-inherit fill-prefix))
+
+
+;;; Fixed Width Areas
+
+(defun org-toggle-fixed-width ()
+ "Toggle fixed-width markup.
+
+Add or remove fixed-width markup on current line, whenever it
+makes sense. Return an error otherwise.
+
+If a region is active and if it contains only fixed-width areas
+or blank lines, remove all fixed-width markup in it. If the
+region contains anything else, convert all non-fixed-width lines
+to fixed-width ones.
+
+Blank lines at the end of the region are ignored unless the
+region only contains such lines."
+ (interactive)
+ (if (not (org-region-active-p))
+ ;; No region:
+ ;;
+ ;; Remove fixed width marker only in a fixed-with element.
+ ;;
+ ;; Add fixed width maker in paragraphs, in blank lines after
+ ;; elements or at the beginning of a headline or an inlinetask,
+ ;; and before any one-line elements (e.g., a clock).
+ (progn
+ (beginning-of-line)
+ (let* ((element (org-element-at-point))
+ (type (org-element-type element)))
+ (cond
+ ((and (eq type 'fixed-width)
+ (looking-at "[ \t]*\\(:\\(?: \\|$\\)\\)"))
+ (replace-match
+ "" nil nil nil (if (= (line-end-position) (match-end 0)) 0 1)))
+ ((and (memq type '(babel-call clock comment diary-sexp headline
+ horizontal-rule keyword paragraph
+ planning))
+ (<= (org-element-property :post-affiliated element) (point)))
+ (skip-chars-forward " \t")
+ (insert ": "))
+ ((and (looking-at-p "[ \t]*$")
+ (or (eq type 'inlinetask)
+ (save-excursion
+ (skip-chars-forward " \r\t\n")
+ (<= (org-element-property :end element) (point)))))
+ (delete-region (point) (line-end-position))
+ (org-indent-line)
+ (insert ": "))
+ (t (user-error "Cannot insert a fixed-width line here")))))
+ ;; Region active.
+ (let* ((begin (save-excursion
+ (goto-char (region-beginning))
+ (line-beginning-position)))
+ (end (copy-marker
+ (save-excursion
+ (goto-char (region-end))
+ (unless (eolp) (beginning-of-line))
+ (if (save-excursion (re-search-backward "\\S-" begin t))
+ (progn (skip-chars-backward " \r\t\n") (point))
+ (point)))))
+ (all-fixed-width-p
+ (catch 'not-all-p
+ (save-excursion
+ (goto-char begin)
+ (skip-chars-forward " \r\t\n")
+ (when (eobp) (throw 'not-all-p nil))
+ (while (< (point) end)
+ (let ((element (org-element-at-point)))
+ (if (eq (org-element-type element) 'fixed-width)
+ (goto-char (org-element-property :end element))
+ (throw 'not-all-p nil))))
+ t))))
+ (if all-fixed-width-p
+ (save-excursion
+ (goto-char begin)
+ (while (< (point) end)
+ (when (looking-at "[ \t]*\\(:\\(?: \\|$\\)\\)")
+ (replace-match
+ "" nil nil nil
+ (if (= (line-end-position) (match-end 0)) 0 1)))
+ (forward-line)))
+ (let ((min-ind (point-max)))
+ ;; Find minimum indentation across all lines.
+ (save-excursion
+ (goto-char begin)
+ (if (not (save-excursion (re-search-forward "\\S-" end t)))
+ (setq min-ind 0)
+ (catch 'zerop
+ (while (< (point) end)
+ (unless (looking-at-p "[ \t]*$")
+ (let ((ind (current-indentation)))
+ (setq min-ind (min min-ind ind))
+ (when (zerop ind) (throw 'zerop t))))
+ (forward-line)))))
+ ;; Loop over all lines and add fixed-width markup everywhere
+ ;; but in fixed-width lines.
+ (save-excursion
+ (goto-char begin)
+ (while (< (point) end)
+ (cond
+ ((org-at-heading-p)
+ (insert ": ")
+ (forward-line)
+ (while (and (< (point) end) (looking-at-p "[ \t]*$"))
+ (insert ":")
+ (forward-line)))
+ ((looking-at-p "[ \t]*:\\( \\|$\\)")
+ (let* ((element (org-element-at-point))
+ (element-end (org-element-property :end element)))
+ (if (eq (org-element-type element) 'fixed-width)
+ (progn (goto-char element-end)
+ (skip-chars-backward " \r\t\n")
+ (forward-line))
+ (let ((limit (min end element-end)))
+ (while (< (point) limit)
+ (org-move-to-column min-ind t)
+ (insert ": ")
+ (forward-line))))))
+ (t
+ (org-move-to-column min-ind t)
+ (insert ": ")
+ (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
+;; to be just a comment. Also, even with the right syntax at the
+;; beginning of line, some elements (e.g., verse-block or
+;; example-block) don't accept comments. Usual Emacs comment commands
+;; cannot cope with those requirements. Therefore, Org replaces them.
+
+;; Org still relies on 'comment-dwim', but cannot trust
+;; 'comment-only-p'. So, 'comment-region-function' and
+;; 'uncomment-region-function' both point
+;; to 'org-comment-or-uncomment-region'. Eventually,
+;; 'org-insert-comment' takes care of insertion of comments at the
+;; beginning of line.
+
+;; 'org-setup-comments-handling' install comments related variables
+;; during 'org-mode' initialization.
+
+(defun org-setup-comments-handling ()
+ (interactive)
+ (setq-local comment-use-syntax nil)
+ (setq-local comment-start "# ")
+ (setq-local comment-start-skip "^\\s-*#\\(?: \\|$\\)")
+ (setq-local comment-insert-comment-function 'org-insert-comment)
+ (setq-local comment-region-function 'org-comment-or-uncomment-region)
+ (setq-local uncomment-region-function 'org-comment-or-uncomment-region))
+
+(defun org-insert-comment ()
+ "Insert an empty comment above current line.
+If the line is empty, insert comment at its beginning. When
+point is within a source block, comment according to the related
+major mode."
+ (if (let ((element (org-element-at-point)))
+ (and (eq (org-element-type element) 'src-block)
+ (< (save-excursion
+ (goto-char (org-element-property :post-affiliated element))
+ (line-end-position))
+ (point))
+ (> (save-excursion
+ (goto-char (org-element-property :end element))
+ (skip-chars-backward " \r\t\n")
+ (line-beginning-position))
+ (point))))
+ (org-babel-do-in-edit-buffer (call-interactively 'comment-dwim))
+ (beginning-of-line)
+ (if (looking-at "\\s-*$") (delete-region (point) (point-at-eol))
+ (open-line 1))
+ (org-indent-line)
+ (insert "# ")))
+
+(defvar comment-empty-lines) ; From newcomment.el.
+(defun org-comment-or-uncomment-region (beg end &rest _)
+ "Comment or uncomment each non-blank line in the region.
+Uncomment each non-blank line between BEG and END if it only
+contains commented lines. Otherwise, comment them. If region is
+strictly within a source block, use appropriate comment syntax."
+ (if (let ((element (org-element-at-point)))
+ (and (eq (org-element-type element) 'src-block)
+ (< (save-excursion
+ (goto-char (org-element-property :post-affiliated element))
+ (line-end-position))
+ beg)
+ (>= (save-excursion
+ (goto-char (org-element-property :end element))
+ (skip-chars-backward " \r\t\n")
+ (line-beginning-position))
+ end)))
+ ;; Translate region boundaries for the Org buffer to the source
+ ;; buffer.
+ (let ((offset (- end beg)))
+ (save-excursion
+ (goto-char beg)
+ (org-babel-do-in-edit-buffer
+ (comment-or-uncomment-region (point) (+ offset (point))))))
+ (save-restriction
+ ;; Restrict region
+ (narrow-to-region (save-excursion (goto-char beg)
+ (skip-chars-forward " \r\t\n" end)
+ (line-beginning-position))
+ (save-excursion (goto-char end)
+ (skip-chars-backward " \r\t\n" beg)
+ (line-end-position)))
+ (let ((uncommentp
+ ;; UNCOMMENTP is non-nil when every non blank line between
+ ;; BEG and END is a comment.
+ (save-excursion
+ (goto-char (point-min))
+ (while (and (not (eobp))
+ (let ((element (org-element-at-point)))
+ (and (eq (org-element-type element) 'comment)
+ (goto-char (min (point-max)
+ (org-element-property
+ :end element)))))))
+ (eobp))))
+ (if uncommentp
+ ;; Only blank lines and comments in region: uncomment it.
+ (save-excursion
+ (goto-char (point-min))
+ (while (not (eobp))
+ (when (looking-at "[ \t]*\\(#\\(?: \\|$\\)\\)")
+ (replace-match "" nil nil nil 1))
+ (forward-line)))
+ ;; Comment each line in region.
+ (let ((min-indent (point-max)))
+ ;; First find the minimum indentation across all lines.
+ (save-excursion
+ (goto-char (point-min))
+ (while (and (not (eobp)) (not (zerop min-indent)))
+ (unless (looking-at "[ \t]*$")
+ (setq min-indent (min min-indent (current-indentation))))
+ (forward-line)))
+ ;; Then loop over all lines.
+ (save-excursion
+ (goto-char (point-min))
+ (while (not (eobp))
+ (unless (and (not comment-empty-lines) (looking-at "[ \t]*$"))
+ ;; Don't get fooled by invisible text (e.g. link path)
+ ;; when moving to column MIN-INDENT.
+ (let ((buffer-invisibility-spec nil))
+ (org-move-to-column min-indent t))
+ (insert comment-start))
+ (forward-line)))))))))
+
+(defun org-comment-dwim (_arg)
+ "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")
+ (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, or create, timestamp
+;; objects, as returned by, e.g. `org-element-context'.
+
+(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."
+ (org-element-property :hour-start timestamp))
+
+(defun org-timestamp-format (timestamp format &optional end utc)
+ "Format a TIMESTAMP object into a string.
+
+FORMAT is a format specifier to be passed to
+`format-time-string'.
+
+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 is be expressed as
+Universal Time."
+ (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.
+
+END, when non-nil, means extract the end of the range.
+Otherwise, extract its start.
+
+Return a new timestamp object."
+ (let ((type (org-element-property :type timestamp)))
+ (if (memq type '(active inactive diary)) timestamp
+ (let ((split-ts (org-element-copy timestamp)))
+ ;; Set new type.
+ (org-element-put-property
+ split-ts :type (if (eq type 'active-range) 'active 'inactive))
+ ;; Copy start properties over end properties if END is
+ ;; non-nil. Otherwise, copy end properties over `start' ones.
+ (let ((p-alist '((:minute-start . :minute-end)
+ (:hour-start . :hour-end)
+ (:day-start . :day-end)
+ (:month-start . :month-end)
+ (:year-start . :year-end))))
+ (dolist (p-cell p-alist)
+ (org-element-put-property
+ split-ts
+ (funcall (if end #'car #'cdr) p-cell)
+ (org-element-property
+ (funcall (if end #'cdr #'car) p-cell) split-ts)))
+ ;; Eventually refresh `:raw-value'.
+ (org-element-put-property split-ts :raw-value nil)
+ (org-element-put-property
+ split-ts :raw-value (org-element-interpret-data split-ts)))))))
+
+(defun org-timestamp-translate (timestamp &optional boundary)
+ "Translate TIMESTAMP object to custom format.
+
+Format string is defined in `org-time-stamp-custom-formats',
+which see.
+
+When optional argument BOUNDARY is non-nil, it is either the
+symbol `start' or `end'. In this case, only translate the
+starting or ending part of TIMESTAMP if it is a date or time
+range. Otherwise, translate both parts.
+
+Return timestamp as-is if `org-display-custom-times' is nil or if
+it has a `diary' type."
+ (let ((type (org-element-property :type timestamp)))
+ (if (or (not org-display-custom-times) (eq type 'diary))
+ (org-element-interpret-data timestamp)
+ (let ((fmt (funcall (if (org-timestamp-has-time-p timestamp) #'cdr #'car)
+ org-time-stamp-custom-formats)))
+ (if (and (not boundary) (memq type '(active-range inactive-range)))
+ (concat (org-timestamp-format timestamp fmt)
+ "--"
+ (org-timestamp-format timestamp fmt t))
+ (org-timestamp-format timestamp fmt (eq boundary 'end)))))))
+
+;;; Other stuff
+
+(defvar reftex-docstruct-symbol)
+(defvar org--rds)
+
+(defun org-reftex-citation ()
+ "Use `reftex-citation' to insert a citation into the buffer.
+This looks for a line like
+
+#+BIBLIOGRAPHY: foo plain option:-d
+
+and derives from it that foo.bib is the bibliography file relevant
+for this document. It then installs the necessary environment for RefTeX
+to work in this buffer and calls `reftex-citation' to insert a citation
+into the buffer.
+
+Export of such citations to both LaTeX and HTML is handled by the contributed
+package ox-bibtex by Taru Karttunen."
+ (interactive)
+ (let ((reftex-docstruct-symbol 'org--rds)
+ org--rds bib)
+ (org-with-wide-buffer
+ (let ((case-fold-search t)
+ (re "^[ \t]*#\\+BIBLIOGRAPHY:[ \t]+\\([^ \t\n]+\\)"))
+ (if (not (save-excursion
+ (or (re-search-forward re nil t)
+ (re-search-backward re nil t))))
+ (user-error "No bibliography defined in file")
+ (setq bib (concat (match-string 1) ".bib")
+ org--rds (list (list 'bib bib))))))
+ (call-interactively 'reftex-citation)))
+
+;;;; Functions extending outline functionality
+
+(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 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")
+ (let ((origin (point))
+ (special (pcase org-special-ctrl-a/e
+ (`(,C-a . ,_) C-a) (_ org-special-ctrl-a/e)))
+ deactivate-mark)
+ ;; First move to a visible line.
+ (if (bound-and-true-p visual-line-mode)
+ (beginning-of-visual-line n)
+ (move-beginning-of-line n)
+ ;; `move-beginning-of-line' may leave point after invisible
+ ;; characters if line starts with such of these (e.g., with
+ ;; a link at column 0). Really move to the beginning of the
+ ;; current visible line.
+ (beginning-of-line))
+ (cond
+ ;; No special behavior. Point is already at the beginning of
+ ;; a line, logical or visual.
+ ((not special))
+ ;; `beginning-of-visual-line' left point before logical beginning
+ ;; of line: point is at the beginning of a visual line. Bail
+ ;; out.
+ ((and (bound-and-true-p visual-line-mode) (not (bolp))))
+ ((let ((case-fold-search nil)) (looking-at org-complex-heading-regexp))
+ ;; At a headline, special position is before the title, but
+ ;; after any TODO keyword or priority cookie.
+ (let ((refpos (min (1+ (or (match-end 3) (match-end 2) (match-end 1)))
+ (line-end-position)))
+ (bol (point)))
+ (if (eq special 'reversed)
+ (when (and (= origin bol) (eq last-command this-command))
+ (goto-char refpos))
+ (when (or (> origin refpos) (= origin bol))
+ (goto-char refpos)))))
+ ((and (looking-at org-list-full-item-re)
+ (memq (org-element-type (save-match-data (org-element-at-point)))
+ '(item plain-list)))
+ ;; Set special position at first white space character after
+ ;; bullet, and check-box, if any.
+ (let ((after-bullet
+ (let ((box (match-end 3)))
+ (cond ((not box) (match-end 1))
+ ((eq (char-after box) ?\s) (1+ box))
+ (t box)))))
+ (if (eq special 'reversed)
+ (when (and (= (point) origin) (eq last-command this-command))
+ (goto-char after-bullet))
+ (when (or (> origin after-bullet) (= (point) origin))
+ (goto-char after-bullet)))))
+ ;; No special context. Point is already at beginning of line.
+ (t nil))))
+
+(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 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")
+ (let ((origin (point))
+ (special (pcase org-special-ctrl-a/e
+ (`(,_ . ,C-e) C-e) (_ org-special-ctrl-a/e)))
+ deactivate-mark)
+ ;; First move to a visible line.
+ (if (bound-and-true-p visual-line-mode)
+ (beginning-of-visual-line n)
+ (move-beginning-of-line n))
+ (cond
+ ;; At a headline, with tags.
+ ((and special
+ (save-excursion
+ (beginning-of-line)
+ (let ((case-fold-search nil))
+ (looking-at org-complex-heading-regexp)))
+ (match-end 5))
+ (let ((tags (save-excursion
+ (goto-char (match-beginning 5))
+ (skip-chars-backward " \t")
+ (point)))
+ (visual-end (and (bound-and-true-p visual-line-mode)
+ (save-excursion
+ (end-of-visual-line)
+ (point)))))
+ ;; If `end-of-visual-line' brings us before end of line or
+ ;; even tags, i.e., the headline spans over multiple visual
+ ;; lines, move there.
+ (cond ((and visual-end
+ (< visual-end tags)
+ (<= origin visual-end))
+ (goto-char visual-end))
+ ((eq special 'reversed)
+ (if (and (= origin (line-end-position))
+ (eq this-command last-command))
+ (goto-char tags)
+ (end-of-line)))
+ (t
+ (if (or (< origin tags) (= origin (line-end-position)))
+ (goto-char tags)
+ (end-of-line))))))
+ ((bound-and-true-p visual-line-mode)
+ (let ((bol (line-beginning-position)))
+ (end-of-visual-line)
+ ;; If `end-of-visual-line' gets us past the ellipsis at the
+ ;; end of a line, backtrack and use `end-of-line' instead.
+ (when (/= bol (line-beginning-position))
+ (goto-char bol)
+ (end-of-line))))
+ (t (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',
+depending on context."
+ (interactive)
+ (let* ((element (org-element-at-point))
+ (contents-begin (org-element-property :contents-begin element))
+ (table (org-element-lineage element '(table) t)))
+ (if (and table
+ (> (point) contents-begin)
+ (<= (point) (org-element-property :contents-end table)))
+ (call-interactively #'org-table-beginning-of-field)
+ (save-restriction
+ (when (and contents-begin
+ (< (point-min) contents-begin)
+ (> (point) contents-begin))
+ (narrow-to-region contents-begin
+ (org-element-property :contents-end element)))
+ (call-interactively #'backward-sentence)))))
+
+(defun org-forward-sentence (&optional _arg)
+ "Go to end of sentence, or end of table field.
+This will call `forward-sentence' or `org-table-end-of-field',
+depending on context."
+ (interactive)
+ (if (and (org-at-heading-p)
+ (save-restriction (skip-chars-forward " \t") (not (eolp))))
+ (save-restriction
+ (narrow-to-region (line-beginning-position) (line-end-position))
+ (call-interactively #'forward-sentence))
+ (let* ((element (org-element-at-point))
+ (contents-end (org-element-property :contents-end element))
+ (table (org-element-lineage element '(table) t)))
+ (if (and table
+ (>= (point) (org-element-property :contents-begin table))
+ (< (point) contents-end))
+ (call-interactively #'org-table-end-of-field)
+ (save-restriction
+ (when (and contents-end
+ (> (point-max) contents-end)
+ ;; Skip blank lines between elements.
+ (< (org-element-property :end element)
+ (save-excursion (goto-char contents-end)
+ (skip-chars-forward " \r\t\n"))))
+ (narrow-to-region (org-element-property :contents-begin element)
+ contents-end))
+ ;; End of heading is considered as the end of a sentence.
+ (let ((sentence-end (concat (sentence-end) "\\|^\\*+ .*$")))
+ (call-interactively #'forward-sentence)))))))
+
+(defun org-kill-line (&optional _arg)
+ "Kill line, to tags or end of line."
+ (interactive)
+ (cond
+ ((or (not org-special-ctrl-k)
+ (bolp)
+ (not (org-at-heading-p)))
+ (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
+ (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)))
+ ((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)))
+ ;; Only align tags when we are still on a heading:
+ (if (org-at-heading-p) (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.
+This command will look at the current kill and check if is a single
+subtree, or a series of subtrees[1]. If it passes the test, and if the
+cursor is at the beginning of a line or after the stars of a currently
+empty headline, then the yank is handled specially. How exactly depends
+on the value of the following variables.
+
+`org-yank-folded-subtrees'
+ By default, this variable is non-nil, which results in
+ subtree(s) being folded after insertion, except if doing so
+ would swallow text after the yanked text.
+
+`org-yank-adjusted-subtrees'
+ When non-nil (the default value is nil), the subtree will be
+ promoted or demoted in order to fit into the local outline tree
+ structure, which means that the level will be adjusted so that it
+ becomes the smaller one of the two *visible* surrounding headings.
+
+Any prefix to this command will cause `yank' to be called directly with
+no special treatment. In particular, a simple `\\[universal-argument]' prefix \
+will just
+plainly yank the text as it is.
+
+\[1] The test checks if the first non-white line is a heading
+ and if there are no other headings with fewer stars."
+ (interactive "P")
+ (org-yank-generic 'yank arg))
+
+(defun org-yank-generic (command arg)
+ "Perform some yank-like command.
+
+This function implements the behavior described in the `org-yank'
+documentation. However, it has been generalized to work for any
+interactive command with similar behavior."
+
+ ;; pretend to be command COMMAND
+ (setq this-command command)
+
+ (if arg
+ (call-interactively command)
+
+ (let ((subtreep ; is kill a subtree, and the yank position appropriate?
+ (and (org-kill-is-subtree-p)
+ (or (bolp)
+ (and (looking-at "[ \t]*$")
+ (string-match
+ "\\`\\*+\\'"
+ (buffer-substring (point-at-bol) (point)))))))
+ swallowp)
+ (cond
+ ((and subtreep org-yank-folded-subtrees)
+ (let ((beg (point))
+ end)
+ (if (and subtreep org-yank-adjusted-subtrees)
+ (org-paste-subtree nil nil 'for-yank)
+ (call-interactively command))
+
+ (setq end (point))
+ (goto-char beg)
+ (when (and (bolp) subtreep
+ (not (setq swallowp
+ (org-yank-folding-would-swallow-text beg end))))
+ (org-with-limited-levels
+ (or (looking-at org-outline-regexp)
+ (re-search-forward org-outline-regexp-bol end t))
+ (while (and (< (point) end) (looking-at org-outline-regexp))
+ (org-flag-subtree t)
+ (org-cycle-show-empty-lines 'folded)
+ (condition-case nil
+ (outline-forward-same-level 1)
+ (error (goto-char end))))))
+ (when swallowp
+ (message
+ "Inserted text not folded because that would swallow text"))
+
+ (goto-char end)
+ (skip-chars-forward " \t\n\r")
+ (beginning-of-line 1)
+ (push-mark beg 'nomsg)))
+ ((and subtreep org-yank-adjusted-subtrees)
+ (let ((beg (point-at-bol)))
+ (org-paste-subtree nil nil 'for-yank)
+ (push-mark beg 'nomsg)))
+ (t
+ (call-interactively command))))))
+
+(defun org-yank-folding-would-swallow-text (beg end)
+ "Would `hide-subtree' at BEG swallow any text after END?"
+ (let (level)
+ (org-with-limited-levels
+ (save-excursion
+ (goto-char beg)
+ (when (or (looking-at org-outline-regexp)
+ (re-search-forward org-outline-regexp-bol end t))
+ (setq level (org-outline-level)))
+ (goto-char end)
+ (skip-chars-forward " \t\r\n\v\f")
+ (not (or (eobp)
+ (and (bolp) (looking-at-p org-outline-regexp)
+ (<= (org-outline-level) level))))))))
+
+(defun org-back-to-heading (&optional invisible-ok)
+ "Call `outline-back-to-heading', but provide a better error message."
+ (condition-case nil
+ (outline-back-to-heading invisible-ok)
+ (error
+ (user-error "Before first headline at position %d in buffer %s"
+ (point) (current-buffer)))))
+
+(defun org-back-to-heading-or-point-min (&optional invisible-ok)
+ "Go back to heading or first point in buffer.
+If point is before first heading go to first point in buffer
+instead of back to heading."
+ (condition-case nil
+ (outline-back-to-heading invisible-ok)
+ (error
+ (goto-char (point-min)))))
+
+(defun org-before-first-heading-p ()
+ "Before first heading?"
+ (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 _)
+ "Non-nil when on a headline."
+ (outline-on-heading-p t))
+
+(defun org-in-commented-heading-p (&optional no-inheritance)
+ "Non-nil if point is under a commented heading.
+This function also checks ancestors of the current headline,
+unless optional argument NO-INHERITANCE is non-nil."
+ (cond
+ ((org-before-first-heading-p) nil)
+ ((let ((headline (nth 4 (org-heading-components))))
+ (and headline
+ (let ((case-fold-search nil))
+ (string-match-p (concat "^" org-comment-string "\\(?: \\|$\\)")
+ headline)))))
+ (no-inheritance nil)
+ (t
+ (save-excursion (and (org-up-heading-safe) (org-in-commented-heading-p))))))
+
+(defun org-in-archived-heading-p (&optional no-inheritance)
+ "Non-nil if point is under an archived heading.
+This function also checks ancestors of the current headline,
+unless optional argument NO-INHERITANCE is non-nil."
+ (cond
+ ((org-before-first-heading-p) nil)
+ ((let ((tags (org-get-tags nil 'local)))
+ (and tags
+ (cl-some (apply-partially #'string= org-archive-tag) tags))))
+ (no-inheritance nil)
+ (t
+ (save-excursion (and (org-up-heading-safe) (org-in-archived-heading-p))))))
+
+(defun org-at-comment-p nil
+ "Return t if cursor is in a commented line."
+ (save-excursion
+ (save-match-data
+ (beginning-of-line)
+ (looking-at org-comment-regexp))))
+
+(defun org-at-keyword-p nil
+ "Return t if cursor is at a keyword-line."
+ (save-excursion
+ (move-beginning-of-line 1)
+ (looking-at org-keyword-regexp)))
+
+(defun org-at-drawer-p nil
+ "Return t if cursor is at a drawer keyword."
+ (save-excursion
+ (move-beginning-of-line 1)
+ (looking-at org-drawer-regexp)))
+
+(defun org-at-block-p nil
+ "Return t if cursor is at a block keyword."
+ (save-excursion
+ (move-beginning-of-line 1)
+ (looking-at org-block-regexp)))
+
+(defun org-point-at-end-of-empty-headline ()
+ "If point is at the end of an empty headline, return t, else nil.
+If the heading only contains a TODO keyword, it is still considered
+empty."
+ (let ((case-fold-search nil))
+ (and (looking-at "[ \t]*$")
+ org-todo-line-regexp
+ (save-excursion
+ (beginning-of-line)
+ (looking-at org-todo-line-regexp)
+ (string= (match-string 3) "")))))
+
+(defun org-at-heading-or-item-p ()
+ (or (org-at-heading-p) (org-at-item-p)))
+
+(defun org-up-heading-all (arg)
+ "Move to the heading line of which the present line is a subheading.
+This function considers both visible and invisible heading lines.
+With argument, move up ARG levels."
+ (outline-up-heading arg t))
+
+(defvar-local org--up-heading-cache nil
+ "Buffer-local `org-up-heading-safe' cache.")
+(defvar-local org--up-heading-cache-tick nil
+ "Buffer `buffer-chars-modified-tick' in `org--up-heading-cache'.")
+(defun org-up-heading-safe ()
+ "Move to the heading line of which the present line is a subheading.
+This version will not throw an error. It will return the level of the
+headline found, or nil if no higher level is found.
+
+Also, this function will be a lot faster than `outline-up-heading',
+because it relies on stars being the outline starters. This can really
+make a significant difference in outlines with very many siblings."
+ (when (ignore-errors (org-back-to-heading t))
+ (let (level-cache)
+ (unless org--up-heading-cache
+ (setq org--up-heading-cache (make-hash-table)))
+ (if (and (eq (buffer-chars-modified-tick) org--up-heading-cache-tick)
+ (setq level-cache (gethash (point) org--up-heading-cache)))
+ (when (<= (point-min) (car level-cache) (point-max))
+ ;; Parent is inside accessible part of the buffer.
+ (progn (goto-char (car level-cache))
+ (cdr level-cache)))
+ ;; Buffer modified. Invalidate cache.
+ (unless (eq (buffer-chars-modified-tick) org--up-heading-cache-tick)
+ (setq-local org--up-heading-cache-tick
+ (buffer-chars-modified-tick))
+ (clrhash org--up-heading-cache))
+ (let* ((level-up (1- (funcall outline-level)))
+ (pos (point))
+ (result (and (> level-up 0)
+ (re-search-backward
+ (format "^\\*\\{1,%d\\} " level-up) nil t)
+ (funcall outline-level))))
+ (when result (puthash pos (cons (point) result) org--up-heading-cache))
+ result)))))
+
+(defun org-up-heading-or-point-min ()
+ "Move to the heading line of which the present is a subheading, or point-min.
+This version is needed to make point-min behave like a virtual
+heading of level 0 for property-inheritance. It will return the
+level of the headline found (down to 0) or nil if already at a
+point before the first headline or at point-min."
+ (when (ignore-errors (org-back-to-heading t))
+ (if (< 1 (funcall outline-level))
+ (org-up-heading-safe)
+ (unless (= (point) (point-min)) (goto-char (point-min))))))
+
+(defun org-first-sibling-p ()
+ "Is this heading the first child of its parents?"
+ (interactive)
+ (let ((re org-outline-regexp-bol)
+ level l)
+ (unless (org-at-heading-p t)
+ (user-error "Not at a heading"))
+ (setq level (funcall outline-level))
+ (save-excursion
+ (if (not (re-search-backward re nil t))
+ t
+ (setq l (funcall outline-level))
+ (< l level)))))
+
+(defun org-goto-sibling (&optional previous)
+ "Goto the next sibling, even if it is invisible.
+When PREVIOUS is set, go to the previous sibling instead. Returns t
+when a sibling was found. When none is found, return nil and don't
+move point."
+ (let ((fun (if previous 're-search-backward 're-search-forward))
+ (pos (point))
+ (re org-outline-regexp-bol)
+ level l)
+ (when (ignore-errors (org-back-to-heading t))
+ (setq level (funcall outline-level))
+ (catch 'exit
+ (or previous (forward-char 1))
+ (while (funcall fun re nil t)
+ (setq l (funcall outline-level))
+ (when (< l level) (goto-char pos) (throw 'exit nil))
+ (when (= l level) (goto-char (match-beginning 0)) (throw 'exit t)))
+ (goto-char pos)
+ nil))))
+
+(defun org-show-siblings ()
+ "Show all siblings of the current headline."
+ (save-excursion
+ (while (org-goto-sibling) (org-flag-heading nil)))
+ (save-excursion
+ (while (org-goto-sibling 'previous)
+ (org-flag-heading nil))))
+
+(defun org-goto-first-child ()
+ "Goto the first child, even if it is invisible.
+Return t when a child was found. Otherwise don't move point and
+return nil."
+ (let (level (pos (point)) (re org-outline-regexp-bol))
+ (when (org-back-to-heading-or-point-min t)
+ (setq level (org-outline-level))
+ (forward-char 1)
+ (if (and (re-search-forward re nil t) (> (org-outline-level) level))
+ (progn (goto-char (match-beginning 0)) t)
+ (goto-char pos) nil))))
+
+(defun org-show-hidden-entry ()
+ "Show an entry where even the heading is hidden."
+ (save-excursion
+ (org-show-entry)))
+
+(defun org-flag-heading (flag &optional entry)
+ "Flag the current heading. FLAG non-nil means make invisible.
+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 (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.
+If there is no such heading, return nil.
+This is like outline-next-sibling, but invisible headings are ok."
+ (let ((level (funcall outline-level)))
+ (outline-next-heading)
+ (while (and (not (eobp)) (> (funcall outline-level) level))
+ (outline-next-heading))
+ (unless (or (eobp) (< (funcall outline-level) level))
+ (point))))
+
+(defun org-get-previous-sibling ()
+ "Move to previous heading of the same level, and return point.
+If there is no such heading, return nil."
+ (let ((opoint (point))
+ (level (funcall outline-level)))
+ (outline-previous-heading)
+ (when (and (/= (point) opoint) (outline-on-heading-p t))
+ (while (and (> (funcall outline-level) level)
+ (not (bobp)))
+ (outline-previous-heading))
+ (unless (< (funcall outline-level) level)
+ (point)))))
+
+(defun org-end-of-subtree (&optional invisible-ok to-heading)
+ "Goto to the end of a subtree."
+ ;; This contains an exact copy of the original function, but it uses
+ ;; `org-back-to-heading-or-point-min', to make it work also in invisible
+ ;; trees and before first headline. And is uses an invisible-ok argument.
+ ;; Under Emacs this is not needed, but the old outline.el needs this fix.
+ ;; Furthermore, when used inside Org, finding the end of a large subtree
+ ;; with many children and grandchildren etc, this can be much faster
+ ;; than the outline version.
+ (org-back-to-heading-or-point-min invisible-ok)
+ (let ((first t)
+ (level (funcall outline-level)))
+ (cond ((= level 0)
+ (goto-char (point-max)))
+ ((and (derived-mode-p 'org-mode) (< level 1000))
+ ;; A true heading (not a plain list item), in Org
+ ;; This means we can easily find the end by looking
+ ;; only for the right number of stars. Using a regexp to do
+ ;; this is so much faster than using a Lisp loop.
+ (let ((re (concat "^\\*\\{1," (number-to-string level) "\\} ")))
+ (forward-char 1)
+ (and (re-search-forward re nil 'move) (beginning-of-line 1))))
+ (t
+ ;; something else, do it the slow way
+ (while (and (not (eobp))
+ (or first (> (funcall outline-level) level)))
+ (setq first nil)
+ (outline-next-heading))))
+ (unless to-heading
+ (when (memq (preceding-char) '(?\n ?\^M))
+ ;; Go to end of line before heading
+ (forward-char -1)
+ (when (memq (preceding-char) '(?\n ?\^M))
+ ;; leave blank line before heading
+ (forward-char -1)))))
+ (point))
+
+(defun org-end-of-meta-data (&optional full)
+ "Skip planning line and properties drawer in current entry.
+
+When optional argument FULL is t, also skip planning information,
+clocking lines and any kind of drawer.
+
+When FULL is non-nil but not t, skip planning information,
+properties, clocking lines and logbook drawers."
+ (org-back-to-heading t)
+ (forward-line)
+ ;; Skip planning information.
+ (when (looking-at-p org-planning-line-re) (forward-line))
+ ;; Skip property drawer.
+ (when (looking-at org-property-drawer-re)
+ (goto-char (match-end 0))
+ (forward-line))
+ ;; When FULL is not nil, skip more.
+ (when (and full (not (org-at-heading-p)))
+ (catch 'exit
+ (let ((end (save-excursion (outline-next-heading) (point)))
+ (re (concat "[ \t]*$" "\\|" org-clock-line-re)))
+ (while (not (eobp))
+ (cond ;; Skip clock lines.
+ ((looking-at-p re) (forward-line))
+ ;; Skip logbook drawer.
+ ((looking-at-p org-logbook-drawer-re)
+ (if (re-search-forward "^[ \t]*:END:[ \t]*$" end t)
+ (forward-line)
+ (throw 'exit t)))
+ ;; When FULL is t, skip regular drawer too.
+ ((and (eq full t) (looking-at-p org-drawer-regexp))
+ (if (re-search-forward "^[ \t]*:END:[ \t]*$" end t)
+ (forward-line)
+ (throw 'exit t)))
+ (t (throw 'exit t))))))))
+
+(defun org--line-fully-invisible-p ()
+ "Return non-nil if the current line is fully invisible."
+ (let ((line-beg (line-beginning-position))
+ (line-pos (1- (line-end-position)))
+ (is-invisible t))
+ (while (and (< line-beg line-pos) is-invisible)
+ (setq is-invisible (org-invisible-p line-pos))
+ (setq line-pos (1- line-pos)))
+ is-invisible))
+
+(defun org-forward-heading-same-level (arg &optional invisible-ok)
+ "Move forward to the ARG'th subheading at same level as this one.
+Stop at the first and last subheadings of a superior heading.
+Normally this only looks at visible headings, but when INVISIBLE-OK is
+non-nil it will also look at invisible ones."
+ (interactive "p")
+ (let ((backward? (and arg (< arg 0))))
+ (if (org-before-first-heading-p)
+ (if backward? (goto-char (point-min)) (outline-next-heading))
+ (org-back-to-heading invisible-ok)
+ (unless backward? (end-of-line)) ;do not match current headline
+ (let ((level (- (match-end 0) (match-beginning 0) 1))
+ (f (if backward? #'re-search-backward #'re-search-forward))
+ (count (if arg (abs arg) 1))
+ (result (point)))
+ (while (and (> count 0)
+ (funcall f org-outline-regexp-bol nil 'move))
+ (let ((l (- (match-end 0) (match-beginning 0) 1)))
+ (cond ((< l level) (setq count 0))
+ ((and (= l level)
+ (or invisible-ok
+ ;; FIXME: See commit a700fadd72 and the
+ ;; related discussion on why using
+ ;; `org--line-fully-invisible-p' is needed
+ ;; here, which is to serve the needs of an
+ ;; external package. If the change is
+ ;; wrong regarding Org itself, it should
+ ;; be removed.
+ (not (org--line-fully-invisible-p))))
+ (cl-decf count)
+ (when (= l level) (setq result (point)))))))
+ (goto-char result))
+ (beginning-of-line))))
+
+(defun org-backward-heading-same-level (arg &optional invisible-ok)
+ "Move backward to the ARG'th subheading at same level as this one.
+Stop at the first and last subheadings of a superior heading."
+ (interactive "p")
+ (org-forward-heading-same-level (if arg (- arg) -1) invisible-ok))
+
+(defun org-next-visible-heading (arg)
+ "Move to the next visible heading line.
+With ARG, repeats or can move backward if negative."
+ (interactive "p")
+ (let ((regexp (concat "^" (org-get-limited-outline-regexp))))
+ (if (< arg 0)
+ (beginning-of-line)
+ (end-of-line))
+ (while (and (< arg 0) (re-search-backward regexp nil :move))
+ (unless (bobp)
+ (while (pcase (get-char-property-and-overlay (point) 'invisible)
+ (`(outline . ,o)
+ (goto-char (overlay-start o))
+ (re-search-backward regexp nil :move))
+ (_ nil))))
+ (cl-incf arg))
+ (while (and (> arg 0) (re-search-forward regexp nil t))
+ (while (pcase (get-char-property-and-overlay (point) 'invisible)
+ (`(outline . ,o)
+ (goto-char (overlay-end o))
+ (re-search-forward regexp nil :move))
+ (_
+ (end-of-line)
+ nil))) ;leave the loop
+ (cl-decf arg))
+ (if (> arg 0) (goto-char (point-max)) (beginning-of-line))))
+
+(defun org-previous-visible-heading (arg)
+ "Move to the previous visible heading.
+With ARG, repeats or can move forward if negative."
+ (interactive "p")
+ (org-next-visible-heading (- arg)))
+
+(defun org-forward-paragraph (&optional arg)
+ "Move forward by a paragraph, or equivalent, unit.
+
+With argument ARG, do it ARG times;
+a negative argument ARG = -N means move backward N paragraphs.
+
+The function moves point between two structural
+elements (paragraphs, tables, lists, etc.).
+
+It also provides the following special moves for convenience:
+
+ - on a table or a property drawer, move to its beginning;
+ - on comment, example, export, source and verse blocks, stop
+ at blank lines;
+ - skip consecutive clocks, diary S-exps, and keywords."
+ (interactive "^p")
+ (unless arg (setq arg 1))
+ (if (< arg 0) (org-backward-paragraph (- arg))
+ (while (and (> arg 0) (not (eobp)))
+ (org--forward-paragraph-once)
+ (cl-decf arg))
+ ;; Return moves left.
+ arg))
+
+(defun org-backward-paragraph (&optional arg)
+ "Move backward by a paragraph, or equivalent, unit.
+
+With argument ARG, do it ARG times;
+a negative argument ARG = -N means move forward N paragraphs.
+
+The function moves point between two structural
+elements (paragraphs, tables, lists, etc.).
+
+It also provides the following special moves for convenience:
+
+ - on a table or a property drawer, move to its beginning;
+ - on comment, example, export, source and verse blocks, stop
+ at blank lines;
+ - skip consecutive clocks, diary S-exps, and keywords."
+ (interactive "^p")
+ (unless arg (setq arg 1))
+ (if (< arg 0) (org-forward-paragraph (- arg))
+ (while (and (> arg 0) (not (bobp)))
+ (org--backward-paragraph-once)
+ (cl-decf arg))
+ ;; Return moves left.
+ arg))
+
+(defun org--paragraph-at-point ()
+ "Return paragraph, or equivalent, element at point.
+
+Paragraph element at point is the element at point, with the
+following special cases:
+
+- treat table rows (resp. node properties) as the table
+ \(resp. property drawer) containing them.
+
+- treat plain lists with an item every line as a whole.
+
+- treat consecutive keywords, clocks, and diary-sexps as a single
+ block.
+
+Function may return a real element, or a pseudo-element with type
+`pseudo-paragraph'."
+ (let* ((e (org-element-at-point))
+ (type (org-element-type e))
+ ;; If we need to fake a new pseudo-element, triplet is
+ ;;
+ ;; (BEG END PARENT)
+ ;;
+ ;; where BEG and END are element boundaries, and PARENT the
+ ;; element containing it, or nil.
+ (triplet
+ (cond
+ ((memq type '(table property-drawer))
+ (list (org-element-property :begin e)
+ (org-element-property :end e)
+ (org-element-property :parent e)))
+ ((memq type '(node-property table-row))
+ (let ((e (org-element-property :parent e)))
+ (list (org-element-property :begin e)
+ (org-element-property :end e)
+ (org-element-property :parent e))))
+ ((memq type '(clock diary-sexp keyword))
+ (let* ((regexp (pcase type
+ (`clock org-clock-line-re)
+ (`diary-sexp "%%(")
+ (_ org-keyword-regexp)))
+ (end (if (< 0 (org-element-property :post-blank e))
+ (org-element-property :end e)
+ (org-with-wide-buffer
+ (forward-line)
+ (while (looking-at regexp) (forward-line))
+ (skip-chars-forward " \t\n")
+ (line-beginning-position))))
+ (begin (org-with-point-at (org-element-property :begin e)
+ (while (and (not (bobp)) (looking-at regexp))
+ (forward-line -1))
+ ;; We may have gotten one line too far.
+ (if (looking-at regexp)
+ (point)
+ (line-beginning-position 2)))))
+ (list begin end (org-element-property :parent e))))
+ ;; Find the full plain list containing point, the check it
+ ;; contains exactly one line per item.
+ ((let ((l (org-element-lineage e '(plain-list) t)))
+ (while (memq (org-element-type (org-element-property :parent l))
+ '(item plain-list))
+ (setq l (org-element-property :parent l)))
+ (and l
+ (org-with-point-at (org-element-property :post-affiliated l)
+ (forward-line (length (org-element-property :structure l)))
+ (= (point) (org-element-property :contents-end l)))
+ ;; Return value.
+ (list (org-element-property :begin l)
+ (org-element-property :end l)
+ (org-element-property :parent l)))))
+ (t nil)))) ;no triplet: return element
+ (pcase triplet
+ (`(,b ,e ,p)
+ (org-element-create
+ 'pseudo-paragraph
+ (list :begin b :end e :parent p :post-blank 0 :post-affiliated b)))
+ (_ e))))
+
+(defun org--forward-paragraph-once ()
+ "Move forward to end of paragraph or equivalent, once.
+See `org-forward-paragraph'."
+ (interactive)
+ (save-restriction
+ (widen)
+ (skip-chars-forward " \t\n")
+ (cond
+ ((eobp) nil)
+ ;; When inside a folded part, move out of it.
+ ((pcase (get-char-property-and-overlay (point) 'invisible)
+ (`(,(or `outline `org-hide-block) . ,o)
+ (goto-char (overlay-end o))
+ (forward-line)
+ t)
+ (_ nil)))
+ (t
+ (let* ((element (org--paragraph-at-point))
+ (type (org-element-type element))
+ (contents-begin (org-element-property :contents-begin element))
+ (end (org-element-property :end element))
+ (post-affiliated (org-element-property :post-affiliated element)))
+ (cond
+ ((eq type 'plain-list)
+ (forward-char)
+ (org--forward-paragraph-once))
+ ;; If the element is folded, skip it altogether.
+ ((pcase (org-with-point-at post-affiliated
+ (get-char-property-and-overlay (line-end-position)
+ 'invisible))
+ (`(,(or `outline `org-hide-block) . ,o)
+ (goto-char (overlay-end o))
+ (forward-line)
+ t)
+ (_ nil)))
+ ;; At a greater element, move inside.
+ ((and contents-begin
+ (> contents-begin (point))
+ (not (eq type 'paragraph)))
+ (goto-char contents-begin)
+ ;; Items and footnote definitions contents may not start at
+ ;; the beginning of the line. In this case, skip until the
+ ;; next paragraph.
+ (cond
+ ((not (bolp)) (org--forward-paragraph-once))
+ ((org-previous-line-empty-p) (forward-line -1))
+ (t nil)))
+ ;; Move between empty lines in some blocks.
+ ((memq type '(comment-block example-block export-block src-block
+ verse-block))
+ (let ((contents-start
+ (org-with-point-at post-affiliated
+ (line-beginning-position 2))))
+ (if (< (point) contents-start)
+ (goto-char contents-start)
+ (let ((contents-end
+ (org-with-point-at end
+ (skip-chars-backward " \t\n")
+ (line-beginning-position))))
+ (cond
+ ((>= (point) contents-end)
+ (goto-char end)
+ (skip-chars-backward " \t\n")
+ (forward-line))
+ ((re-search-forward "^[ \t]*\n" contents-end :move)
+ (forward-line -1))
+ (t nil))))))
+ (t
+ ;; Move to element's end.
+ (goto-char end)
+ (skip-chars-backward " \t\n")
+ (forward-line))))))))
+
+(defun org--backward-paragraph-once ()
+ "Move backward to start of paragraph or equivalent, once.
+See `org-backward-paragraph'."
+ (interactive)
+ (save-restriction
+ (widen)
+ (cond
+ ((bobp) nil)
+ ;; Blank lines at the beginning of the buffer.
+ ((and (org-match-line "^[ \t]*$")
+ (save-excursion (skip-chars-backward " \t\n") (bobp)))
+ (goto-char (point-min)))
+ ;; When inside a folded part, move out of it.
+ ((pcase (get-char-property-and-overlay (1- (point)) 'invisible)
+ (`(,(or `outline `org-hide-block) . ,o)
+ (goto-char (1- (overlay-start o)))
+ (org--backward-paragraph-once)
+ t)
+ (_ nil)))
+ (t
+ (let* ((element (org--paragraph-at-point))
+ (type (org-element-type element))
+ (begin (org-element-property :begin element))
+ (post-affiliated (org-element-property :post-affiliated element))
+ (contents-end (org-element-property :contents-end element))
+ (end (org-element-property :end element))
+ (parent (org-element-property :parent element))
+ (reach
+ ;; Move to the visible empty line above position P, or
+ ;; to position P. Return t.
+ (lambda (p)
+ (goto-char p)
+ (when (and (org-previous-line-empty-p)
+ (let ((end (line-end-position 0)))
+ (or (= end (point-min))
+ (not (org-invisible-p (1- end))))))
+ (forward-line -1))
+ t)))
+ (cond
+ ;; Already at the beginning of an element.
+ ((= begin (point))
+ (cond
+ ;; There is a blank line above. Move there.
+ ((and (org-previous-line-empty-p)
+ (let ((lep (line-end-position 0)))
+ ;; When the first headline start at point 2, don't choke while
+ ;; checking with `org-invisible-p'.
+ (or (= lep 1)
+ (not (org-invisible-p (1- (line-end-position 0)))))))
+ (forward-line -1))
+ ;; At the beginning of the first element within a greater
+ ;; element. Move to the beginning of the greater element.
+ ((and parent (= begin (org-element-property :contents-begin parent)))
+ (funcall reach (org-element-property :begin parent)))
+ ;; Since we have to move anyway, find the beginning
+ ;; position of the element above.
+ (t
+ (forward-char -1)
+ (org--backward-paragraph-once))))
+ ;; Skip paragraphs at the very beginning of footnote
+ ;; definitions or items.
+ ((and (eq type 'paragraph)
+ (org-with-point-at begin (not (bolp))))
+ (funcall reach (progn (goto-char begin) (line-beginning-position))))
+ ;; If the element is folded, skip it altogether.
+ ((org-with-point-at post-affiliated
+ (org-invisible-p (line-end-position) t))
+ (funcall reach begin))
+ ;; At the end of a greater element, move inside.
+ ((and contents-end
+ (<= contents-end (point))
+ (not (eq type 'paragraph)))
+ (cond
+ ((memq type '(footnote-definition plain-list))
+ (skip-chars-backward " \t\n")
+ (org--backward-paragraph-once))
+ ((= contents-end (point))
+ (forward-char -1)
+ (org--backward-paragraph-once))
+ (t
+ (goto-char contents-end))))
+ ;; Move between empty lines in some blocks.
+ ((and (memq type '(comment-block example-block export-block src-block
+ verse-block))
+ (let ((contents-start
+ (org-with-point-at post-affiliated
+ (line-beginning-position 2))))
+ (when (> (point) contents-start)
+ (let ((contents-end
+ (org-with-point-at end
+ (skip-chars-backward " \t\n")
+ (line-beginning-position))))
+ (if (> (point) contents-end)
+ (progn (goto-char contents-end) t)
+ (skip-chars-backward " \t\n" begin)
+ (re-search-backward "^[ \t]*\n" contents-start :move)
+ t))))))
+ ;; Move to element's start.
+ (t
+ (funcall reach begin))))))))
+
+(defun org-forward-element ()
+ "Move forward by one element.
+Move to the next element at the same level, when possible."
+ (interactive)
+ (cond ((eobp) (user-error "Cannot move further down"))
+ ((org-with-limited-levels (org-at-heading-p))
+ (let ((origin (point)))
+ (goto-char (org-end-of-subtree nil t))
+ (unless (org-with-limited-levels (org-at-heading-p))
+ (goto-char origin)
+ (user-error "Cannot move further down"))))
+ (t
+ (let* ((elem (org-element-at-point))
+ (end (org-element-property :end elem))
+ (parent (org-element-property :parent elem)))
+ (cond ((and parent (= (org-element-property :contents-end parent) end))
+ (goto-char (org-element-property :end parent)))
+ ((integer-or-marker-p end) (goto-char end))
+ (t (message "No element at point")))))))
+
+(defun org-backward-element ()
+ "Move backward by one element.
+Move to the previous element at the same level, when possible."
+ (interactive)
+ (cond ((bobp) (user-error "Cannot move further up"))
+ ((org-with-limited-levels (org-at-heading-p))
+ ;; At a headline, move to the previous one, if any, or stay
+ ;; here.
+ (let ((origin (point)))
+ (org-with-limited-levels (org-backward-heading-same-level 1))
+ ;; When current headline has no sibling above, move to its
+ ;; parent.
+ (when (= (point) origin)
+ (or (org-with-limited-levels (org-up-heading-safe))
+ (progn (goto-char origin)
+ (user-error "Cannot move further up"))))))
+ (t
+ (let* ((elem (org-element-at-point))
+ (beg (org-element-property :begin elem)))
+ (cond
+ ;; Move to beginning of current element if point isn't
+ ;; there already.
+ ((null beg) (message "No element at point"))
+ ((/= (point) beg) (goto-char beg))
+ (t (goto-char beg)
+ (skip-chars-backward " \r\t\n")
+ (unless (bobp)
+ (let ((prev (org-element-at-point)))
+ (goto-char (org-element-property :begin prev))
+ (while (and (setq prev (org-element-property :parent prev))
+ (<= (org-element-property :end prev) beg))
+ (goto-char (org-element-property :begin prev)))))))))))
+
+(defun org-up-element ()
+ "Move to upper element."
+ (interactive)
+ (if (org-with-limited-levels (org-at-heading-p))
+ (unless (org-up-heading-safe) (user-error "No surrounding element"))
+ (let* ((elem (org-element-at-point))
+ (parent (org-element-property :parent elem)))
+ (if parent (goto-char (org-element-property :begin parent))
+ (if (org-with-limited-levels (org-before-first-heading-p))
+ (user-error "No surrounding element")
+ (org-with-limited-levels (org-back-to-heading)))))))
+
+(defun org-down-element ()
+ "Move to inner element."
+ (interactive)
+ (let ((element (org-element-at-point)))
+ (cond
+ ((memq (org-element-type element) '(plain-list table))
+ (goto-char (org-element-property :contents-begin element))
+ (forward-char))
+ ((memq (org-element-type element) org-element-greater-elements)
+ ;; If contents are hidden, first disclose them.
+ (when (org-invisible-p (line-end-position)) (org-cycle))
+ (goto-char (or (org-element-property :contents-begin element)
+ (user-error "No content for this element"))))
+ (t (user-error "No inner element")))))
+
+(defun org-drag-element-backward ()
+ "Move backward element at point."
+ (interactive)
+ (let ((elem (or (org-element-at-point)
+ (user-error "No element at point"))))
+ (if (eq (org-element-type elem) 'headline)
+ ;; Preserve point when moving a whole tree, even if point was
+ ;; on blank lines below the headline.
+ (let ((offset (skip-chars-backward " \t\n")))
+ (unwind-protect (org-move-subtree-up)
+ (forward-char (- offset))))
+ (let ((prev-elem
+ (save-excursion
+ (goto-char (org-element-property :begin elem))
+ (skip-chars-backward " \r\t\n")
+ (unless (bobp)
+ (let* ((beg (org-element-property :begin elem))
+ (prev (org-element-at-point))
+ (up prev))
+ (while (and (setq up (org-element-property :parent up))
+ (<= (org-element-property :end up) beg))
+ (setq prev up))
+ prev)))))
+ ;; Error out if no previous element or previous element is
+ ;; a parent of the current one.
+ (if (or (not prev-elem) (org-element-nested-p elem prev-elem))
+ (user-error "Cannot drag element backward")
+ (let ((pos (point)))
+ (org-element-swap-A-B prev-elem elem)
+ (goto-char (+ (org-element-property :begin prev-elem)
+ (- pos (org-element-property :begin elem))))))))))
+
+(defun org-drag-element-forward ()
+ "Move forward element at point."
+ (interactive)
+ (let* ((pos (point))
+ (elem (or (org-element-at-point)
+ (user-error "No element at point"))))
+ (when (= (point-max) (org-element-property :end elem))
+ (user-error "Cannot drag element forward"))
+ (goto-char (org-element-property :end elem))
+ (let ((next-elem (org-element-at-point)))
+ (when (or (org-element-nested-p elem next-elem)
+ (and (eq (org-element-type next-elem) 'headline)
+ (not (eq (org-element-type elem) 'headline))))
+ (goto-char pos)
+ (user-error "Cannot drag element forward"))
+ ;; Compute new position of point: it's shifted by NEXT-ELEM
+ ;; body's length (without final blanks) and by the length of
+ ;; blanks between ELEM and NEXT-ELEM.
+ (let ((size-next (- (save-excursion
+ (goto-char (org-element-property :end next-elem))
+ (skip-chars-backward " \r\t\n")
+ (forward-line)
+ ;; Small correction if buffer doesn't end
+ ;; with a newline character.
+ (if (and (eolp) (not (bolp))) (1+ (point)) (point)))
+ (org-element-property :begin next-elem)))
+ (size-blank (- (org-element-property :end elem)
+ (save-excursion
+ (goto-char (org-element-property :end elem))
+ (skip-chars-backward " \r\t\n")
+ (forward-line)
+ (point)))))
+ (org-element-swap-A-B elem next-elem)
+ (goto-char (+ pos size-next size-blank))))))
+
+(defun org-drag-line-forward (arg)
+ "Drag the line at point ARG lines forward."
+ (interactive "p")
+ (dotimes (_ (abs arg))
+ (let ((c (current-column)))
+ (if (< 0 arg)
+ (progn
+ (beginning-of-line 2)
+ (transpose-lines 1)
+ (beginning-of-line 0))
+ (transpose-lines 1)
+ (beginning-of-line -1))
+ (org-move-to-column c))))
+
+(defun org-drag-line-backward (arg)
+ "Drag the line at point ARG lines backward."
+ (interactive "p")
+ (org-drag-line-forward (- arg)))
+
+(defun org-mark-element ()
+ "Put point at beginning of this element, mark at end.
+
+Interactively, if this command is repeated or (in Transient Mark
+mode) if the mark is active, it marks the next element after the
+ones already marked."
+ (interactive)
+ (let (deactivate-mark)
+ (if (and (called-interactively-p 'any)
+ (or (and (eq last-command this-command) (mark t))
+ (and transient-mark-mode mark-active)))
+ (set-mark
+ (save-excursion
+ (goto-char (mark))
+ (goto-char (org-element-property :end (org-element-at-point)))
+ (point)))
+ (let ((element (org-element-at-point)))
+ (end-of-line)
+ (push-mark (min (point-max) (org-element-property :end element)) t t)
+ (goto-char (org-element-property :begin element))))))
+
+(defun org-narrow-to-element ()
+ "Narrow buffer to current element."
+ (interactive)
+ (let ((elem (org-element-at-point)))
+ (cond
+ ((eq (car elem) 'headline)
+ (narrow-to-region
+ (org-element-property :begin elem)
+ (org-element-property :end elem)))
+ ((memq (car elem) org-element-greater-elements)
+ (narrow-to-region
+ (org-element-property :contents-begin elem)
+ (org-element-property :contents-end elem)))
+ (t
+ (narrow-to-region
+ (org-element-property :begin elem)
+ (org-element-property :end elem))))))
+
+(defun org-transpose-element ()
+ "Transpose current and previous elements, keeping blank lines between.
+Point is moved after both elements."
+ (interactive)
+ (org-skip-whitespace)
+ (let ((end (org-element-property :end (org-element-at-point))))
+ (org-drag-element-backward)
+ (goto-char end)))
+
+(defun org-unindent-buffer ()
+ "Un-indent the visible part of the buffer.
+Relative indentation (between items, inside blocks, etc.) isn't
+modified."
+ (interactive)
+ (unless (eq major-mode 'org-mode)
+ (user-error "Cannot un-indent a buffer not in Org mode"))
+ (letrec ((parse-tree (org-element-parse-buffer 'greater-element))
+ (unindent-tree
+ (lambda (contents)
+ (dolist (element (reverse contents))
+ (if (memq (org-element-type element) '(headline section))
+ (funcall unindent-tree (org-element-contents element))
+ (save-excursion
+ (save-restriction
+ (narrow-to-region
+ (org-element-property :begin element)
+ (org-element-property :end element))
+ (org-do-remove-indentation))))))))
+ (funcall unindent-tree (org-element-contents parse-tree))))
+
+(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,
+when non-nil, is a regexp matching keywords names."
+ (concat "^[ \t]*#\\+\\("
+ (regexp-opt kwds)
+ (and extra (concat (and kwds "\\|") extra))
+ "\\):[ \t]*\\(.*\\)"))
+
+
+;;; Conveniently switch to Info nodes
+
+(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))))))
+
+
+;;; 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)
+
+(run-hooks 'org-load-hook)
+
+;;; org.el ends here
diff --git a/elpa/org-9.5.2/org.elc b/elpa/org-9.5.2/org.elc
new file mode 100644
index 0000000..75a47f5
--- /dev/null
+++ b/elpa/org-9.5.2/org.elc
Binary files differ
diff --git a/elpa/org-9.5.2/org.info b/elpa/org-9.5.2/org.info
new file mode 100644
index 0000000..e7074e7
--- /dev/null
+++ b/elpa/org-9.5.2/org.info
@@ -0,0 +1,23626 @@
+This is org.info, produced by makeinfo version 6.7 from org.texi.
+
+This manual is for Org version 9.5.
+
+ Copyright © 2004–2021 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.info, Node: Top, Next: Introduction, Up: (dir)
+
+The Org Manual
+**************
+
+This manual is for Org version 9.5.
+
+ Copyright © 2004–2021 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.
+* Refiling and Archiving:: Moving and copying information with ease.
+* Capture and Attachments:: Dealing with external data.
+* 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.
+* Citation handling:: create, follow and export citations.
+* 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.
+
+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 as 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.
+
+Refiling and Archiving
+
+* Refile and Copy:: Moving/copying a tree from one place to another.
+* Archiving:: What to do with finished products.
+
+Archiving
+
+* Moving subtrees:: Moving a tree to an archive file.
+* Internal archiving:: Switch off a tree but keep it in the file.
+
+Capture and Attachments
+
+* Capture:: Capturing new stuff.
+* Attachments:: Attach files to outlines.
+* RSS Feeds:: Getting input from RSS feeds.
+
+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.
+
+Attachments
+
+* Attachment defaults and dispatcher:: How to access attachment commands
+* Attachment options:: Configuring the attachment system
+* Attachment links:: Hyperlink access to attachments
+* Automatic version-control with Git:: Everything safely stored away
+* Attach from Dired:: Using dired to select an attachment
+
+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 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 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.
+* Creating Footnotes:: Edit and read footnotes.
+
+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:: Producing presentations and slides.
+* 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.
+* Headlines in HTML export:: Formatting headlines.
+* 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.
+* Verse blocks in LaTeX export:: Attributes specific to special blocks.
+* Quote blocks in LaTeX export:: Attributes specific to quote blocks.
+
+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.
+
+Export in Foreign Buffers
+
+* Bare HTML:: Exporting HTML without CSS, Javascript, etc.
+
+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.
+
+Citation handling
+
+* Citations::
+* Citation export processors::
+
+Working with Source Code
+
+* Features Overview:: Enjoy the versatility of source blocks.
+* 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-<TAB>’ guesses completions.
+* Structure Templates:: Quick insertion of structural elements.
+* Speed Keys:: Electric commands at the beginning of a headline.
+* Clean View:: Getting rid of leading stars in the outline.
+* Execute commands in the active region:: Execute commands on multiple items in Org or agenda view.
+* Dynamic Headline Numbering:: Display and update outline numbering.
+* The Very Busy C-c C-c Key:: When in doubt, press ‘C-c C-c’.
+* In-buffer Settings:: Overview of keywords.
+* Regular Expressions:: Elisp regular expressions.
+* Org Syntax:: Formal description of Org’s syntax.
+* Documentation Access:: Read documentation about current syntax.
+* Escape Character:: Prevent Org from interpreting your writing.
+* Code Evaluation Security:: Org files evaluate in-line code.
+* Interaction:: With other Emacs packages.
+* TTY Keys:: Using Org on a tty.
+* Protocols:: External access to Emacs and Org.
+* Org Crypt:: Encrypting Org files.
+* Org Mobile:: Viewing and capture on a mobile device.
+
+Clean View
+
+* Org Indent Mode::
+* Hard indentation::
+
+Interaction
+
+* Cooperation:: Packages Org cooperates with.
+* Conflicts:: Packages that lead to conflicts.
+
+Protocols
+
+* The store-link protocol:: Store a link, push URL to kill-ring.
+* The capture protocol:: Fill a buffer with external information.
+* The open-source protocol:: Edit published contents.
+
+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:: 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.info, 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.info, 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
+<https://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.info, 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, you can use the Emacs package system or clone
+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 from the “package menu”,
+with ‘M-x list-packages’. See *note Package Menu: (emacs)Package Menu.
+
+ 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.
+
+Using Org’s git repository
+--------------------------
+
+You can clone Org’s repository and install Org like this:
+
+ $ cd ~/src/
+ $ git clone https://git.savannah.gnu.org/git/emacs/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).
+
+Installing Org’s contributed packages
+-------------------------------------
+
+Org’s repository used to contain ‘contrib/’ directory for add-ons
+contributed by others. As of Org 9.5, the directory has bee moved to
+this new dedicated org-contrib (https://git.sr.ht/~bzg/org-contrib)
+repository, which you can install separately.
+
+
+File: org.info, 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 it, you can create an active
+region by using the mouse to select a region, or pressing ‘C-<SPC>’
+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.info, 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
+<emacs-orgmode@gnu.org>. 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). We ask you to read and respect
+the GNU Kind Communications Guidelines
+(https://www.gnu.org/philosophy/kind-communication.html) when sending
+messages on this mailing list.
+
+ 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 <RET>
+
+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"))
+
+ 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 <RET>
+
+ or, from the menu: Org → Refresh/Reload → Reload Org uncompiled.
+
+ 2. Then, activate the debugger:
+
+ M-x toggle-debug-on-error <RET>
+
+ 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.info, 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 usually 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-<RIGHT>’ 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.info, 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 ‘<TAB>’ 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.
+
+
+File: org.info, Node: Headlines, Next: Visibility Cycling, Up: Document Structure
+
+2.1 Headlines
+=============
+
+Headlines define the structure of an outline tree. Org headlines start
+on the left margin(1) with one or more stars followed by a space. 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.
+This can be achieved using a Org Indent minor mode. See *note Clean
+View:: for more information.
+
+ Headlines are not numbered. However, you may want to dynamically
+number some, or all, of them. See *note Dynamic Headline Numbering::.
+
+ 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.info, 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.info, 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 ‘<TAB>’ and ‘S-<TAB>’ to change the
+visibility in the buffer.
+
+‘<TAB>’ (‘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-<TAB>’ (‘org-global-cycle’)
+‘C-u <TAB>’
+ _Global cycling_: Rotate the entire buffer among the states
+
+ ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
+ '--------------------------------------'
+
+ When ‘S-<TAB>’ is called with a numeric prefix argument N, view
+ contents only up to headlines of level N.
+
+ Note that inside tables (see *note Tables::), ‘S-<TAB>’ jumps to
+ the previous field instead.
+
+ You can run global cycling using ‘<TAB>’ 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 <TAB>’ (‘org-set-startup-visibility’)
+ Switch back to the startup visibility of the buffer (see *note
+ Initial visibility::).
+
+‘C-u C-u C-u <TAB>’ (‘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. It is 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, but not their bodies.
+
+‘C-c <TAB>’ (‘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.info, 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
+‘showeverything’, i.e., all file content is 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: show2levels
+ #+STARTUP: show3levels
+ #+STARTUP: show4levels
+ #+STARTUP: show5levels
+ #+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 <TAB>’ (‘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.info, 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.info, 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:
+
+ ‘<TAB>’ Cycle visibility.
+ ‘<DOWN>’ / ‘<UP>’ Next/previous visible headline.
+ ‘<RET>’ 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.info, Node: Structure Editing, Next: Sparse Trees, Prev: Motion, Up: Document Structure
+
+2.4 Structure Editing
+=====================
+
+‘M-<RET>’ (‘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-<RET>’ (‘org-insert-heading-respect-content’)
+ Insert a new heading at the end of the current subtree.
+
+‘M-S-<RET>’ (‘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-<RET>’ (‘org-insert-todo-heading-respect-content’)
+ Insert new TODO entry with same level as current heading. Like
+ ‘C-<RET>’, the new headline is inserted after the current subtree.
+
+‘<TAB>’ (‘org-cycle’)
+ In a new entry with no text yet, the first ‘<TAB>’ demotes the
+ entry to become a child of the previous one. The next ‘<TAB>’
+ makes it a parent, and so on, all the way to top level. Yet
+ another ‘<TAB>’, and you are back to the initial level.
+
+‘M-<LEFT>’ (‘org-do-promote’)
+‘M-<RIGHT>’ (‘org-do-demote’)
+ Promote or demote current heading by one level.
+
+ 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.
+
+‘M-S-<LEFT>’ (‘org-promote-subtree’)
+ Promote the current subtree by one level.
+
+‘M-S-<RIGHT>’ (‘org-demote-subtree’)
+ Demote the current subtree by one level.
+
+‘M-<UP>’ (‘org-move-subtree-up’)
+ Move subtree up, i.e., swap with previous subtree of same level.
+
+‘M-<DOWN>’ (‘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.
+
+ Note that when point is inside a table (see *note Tables::), the
+Meta-Cursor keys have different functionality.
+
+
+File: org.info, 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 (see *note Regular Expressions::) 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 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.info, 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.
+
+‘<TAB>’ (‘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 ‘<TAB>’ demotes the item
+ to become a child of the previous one. Subsequent ‘<TAB>’s move
+ the item to meaningful levels in the list and eventually get it
+ back to its initial position.
+
+‘M-<RET>’ (‘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-<RET>’
+ Insert a new item with a checkbox (see *note Checkboxes::).
+
+‘S-<UP>’
+‘S-<DOWN>’
+ 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-<UP>’ and ‘C-<DOWN>’ to quite
+ similar effect.
+
+‘M-<UP>’
+‘M-<DOWN>’
+ 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-<LEFT>’
+‘M-<RIGHT>’
+ Decrease/increase the indentation of an item, leaving children
+ alone.
+
+‘M-S-<LEFT>’
+‘M-S-<RIGHT>’
+ 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, all lines are converted to list items. With a prefix
+ argument, the selected text is changed into a single item. 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-<LEFT>’
+‘S-<RIGHT>’
+ 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.info, 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-<TAB>’(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 ‘<TAB>’ 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-<TAB>’ to switch windows. Use ‘C-M-i’
+or ‘<ESC> <TAB>’ instead.
+
+
+File: org.info, Node: Blocks, 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 ‘<TAB>’ 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.info, 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.info, 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 explicitly. 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 ‘<TAB>’,
+‘<RET>’ or ‘C-c C-c’ inside the table. ‘<TAB>’ also moves to the next
+field—‘<RET>’ 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 ‘<TAB>’ to align the table and start filling in fields.
+Even faster would be to type ‘|Name|Phone|Age’ followed by ‘C-c <RET>’.
+
+ 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 ‘<TAB>’, ‘S-<TAB>’ or ‘<RET>’, 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 ‘<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’ prompts 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 ‘| N a m e | P
+ h o n e | A g e <RET> | - <TAB>’.
+
+Re-aligning and field motion
+----------------------------
+
+‘C-c C-c’ (‘org-table-align’)
+ Re-align the table without moving point.
+
+‘<TAB>’ (‘org-table-next-field’)
+ Re-align the table, move to the next field. Creates a new row if
+ necessary.
+
+‘M-x org-table-blank-field’
+ Blank the field at point.
+
+‘S-<TAB>’ (‘org-table-previous-field’)
+ Re-align, move to previous field.
+
+‘<RET>’ (‘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, ‘<RET>’ 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-<LEFT>’ (‘org-table-move-column-left’)
+ Move the current column left.
+
+‘M-<RIGHT>’ (‘org-table-move-column-right’)
+ Move the current column right.
+
+‘M-S-<LEFT>’ (‘org-table-delete-column’)
+ Kill the current column.
+
+‘M-S-<RIGHT>’ (‘org-table-insert-column’)
+ Insert a new column at point position. Move the recent column and
+ all cells to the right of this column to the right.
+
+‘M-<UP>’ (‘org-table-move-row-up’)
+ Move the current row up.
+
+‘M-<DOWN>’ (‘org-table-move-row-down’)
+ Move the current row down.
+
+‘M-S-<UP>’ (‘org-table-kill-row’)
+ Kill the current row or horizontal line.
+
+‘S-<UP>’ (‘org-table-move-cell-up’)
+ Move cell up by swapping with adjacent cell.
+
+‘S-<DOWN>’ (‘org-table-move-cell-down’)
+ Move cell down by swapping with adjacent cell.
+
+‘S-<LEFT>’ (‘org-table-move-cell-left’)
+ Move cell left by swapping with adjacent cell.
+
+‘S-<RIGHT>’ (‘org-table-move-cell-right’)
+ Move cell right by swapping with adjacent cell.
+
+‘M-S-<DOWN>’ (‘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 <RET>’ (‘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-<RET>’ (‘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-<RET>’ (‘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 and
+ time stamp field values, and fields prefixed or suffixed with a
+ whole number, can be incremented during copy. 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.
+
+‘M-x org-table-header-line-mode’
+ Turn on the display of the first data row of the table at point in
+ the window header line when this first row is not visible anymore
+ in the buffer. You can activate this minor mode by default by
+ setting the option ‘org-table-header-line-p’ to ‘t’.
+
+‘M-x org-table-transpose-table-at-point’
+ Transpose the table at point and eliminate hlines.
+
+ ---------- Footnotes ----------
+
+ (1) To insert a vertical bar into a table field, use ‘\vert’ or,
+inside a word ‘abc\vert{}def’.
+
+
+File: org.info, 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 ‘<TAB>’ or ‘<RET>’—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 ‘<N>’ where N specifies the width as a number of
+characters. You control displayed width of columns with the following
+tools:
+
+‘C-c <TAB>’ (‘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 <TAB>’ (‘org-table-shrink’)
+ Shrink all columns with a column width. Expand the others.
+
+‘C-u C-u C-c <TAB>’ (‘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
+‘<r>’, ‘<c>’ or ‘<l>’ in a similar fashion. You may also combine
+alignment and field width like this: ‘<r10>’.
+
+ Lines which only contain these formatting cookies are removed
+automatically upon exporting the document.
+
+
+File: org.info, 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.info, 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.info, 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.info, 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 ‘..’. The ends are included in the
+range. 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’ nine 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.info, 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.
+
+‘u’
+ Units simplification mode of Calc. Calc is also a symbolic
+ calculator and is capable of working with values having a unit,
+ represented with numerals followed by a unit string in Org table
+ cells. This mode instructs Calc to simplify the units in the
+ computed expression before returning the result.
+
+‘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.info, 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.
+
+ A formula is evaluated as a Lisp form when it starts with a
+single-quote followed by an opening parenthesis. Cell table references
+are interpolated into the Lisp form before execution. The evaluation
+should return either a string or a number. Evaluation modes and a
+‘printf’ format used to render the returned values can be specified
+after a semicolon.
+
+ By default, references are interpolated as literal Lisp strings: the
+field content is replaced in the Lisp form stripped of leading and
+trailing white space and surrounded in double-quotes. For example:
+
+ '(concat $1 $2)
+
+concatenates the content of columns 1 and column 2.
+
+ When the ‘N’ flag is used, all referenced elements are parsed as
+numbers and interpolated as Lisp numbers, without quotes. Fields that
+cannot be parsed as numbers are interpolated as zeros. For example:
+
+ '(+ $1 $2);N
+
+adds columns 1 and 2, equivalent to Calc’s ‘$1+$2’. Ranges are inserted
+as space-separated fields, so they can be embedded in list or vector
+syntax. For example:
+
+ '(apply '+ '($1..$4));N
+
+computes the sum of columns 1 to 4, like Calc’s ‘vsum($1..$4)’.
+
+ When the ‘L’ flag is used, all fields are interpolated literally: the
+cell content is replaced in the Lisp form stripped of leading and
+trailing white space and without quotes. If a reference is intended to
+be interpreted as a string by the Lisp form, the reference operator
+itself should be enclosed in double-quotes, like ‘"$3"’. The ‘L’ flag
+is useful when strings and numbers are used in the same Lisp form. For
+example:
+
+ '(substring "$1" $2 $3);L
+
+extracts the part of the string in column 1 between the character
+positions specified in the integers in column 2 and 3 and it is easier
+to read than the equivalent:
+
+ '(substring $1 (string-to-number $2) (string-to-number $3))
+
+
+File: org.info, 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.info, 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
+‘<TAB>’ or ‘<RET>’ 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.info, 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
+‘<TAB>’ or ‘<RET>’ 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.info, 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.info, 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’).
+
+ ‘<TAB>’ (‘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 ‘<TAB>’ collapses the formula back
+ again. In the open formula, ‘<TAB>’ re-indents just like in
+ Emacs Lisp mode.
+
+ ‘M-<TAB>’ (‘lisp-complete-symbol’)
+ Complete Lisp symbols, just like in Emacs Lisp mode.
+
+ ‘S-<UP>’, ‘S-<DOWN>’, ‘S-<LEFT>’, ‘S-<RIGHT>’
+ Shift the reference at point. For example, if the reference
+ is ‘B3’ and you press ‘S-<RIGHT>’, it becomes ‘C3’. This also
+ works for relative references and for hline references.
+
+ ‘M-S-<UP>’ (‘org-table-fedit-line-up’)
+ Move the test line for column formulas up in the Org buffer.
+
+ ‘M-S-<DOWN>’ (‘org-table-fedit-line-down’)
+ Move the test line for column formulas down in the Org buffer.
+
+ ‘M-<UP>’ (‘org-table-fedit-scroll-up’)
+ Scroll up the window displaying the table.
+
+ ‘M-<DOWN>’ (‘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 = <RET>’ in a field. Detailed
+information are displayed.
+
+
+File: org.info, 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.info, 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
+ ‘<TAB>’ or ‘<RET>’ or ‘S-<TAB>’ 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 ‘<N>’ 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.info, 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 (https://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 |
+
+ Org Plot supports a range of plot types, and provides the ability to
+add more. For example, a radar plot can be generated like so:
+ #+PLOT: title:"An evaluation of plaintext document formats" transpose:yes type:radar min:0 max:4
+ | Format | Fine-grained-control | Initial Effort | Syntax simplicity | Editor Support | Integrations | Ease-of-referencing | Versatility |
+ |-------------------+----------------------+----------------+-------------------+----------------+--------------+---------------------+-------------|
+ | Word | 2 | 4 | 4 | 2 | 3 | 2 | 2 |
+ | LaTeX | 4 | 1 | 1 | 3 | 2 | 4 | 3 |
+ | Org Mode | 4 | 2 | 3.5 | 1 | 4 | 4 | 4 |
+ | Markdown | 1 | 3 | 3 | 4 | 3 | 3 | 1 |
+ | Markdown + Pandoc | 2.5 | 2.5 | 2.5 | 3 | 3 | 3 | 2 |
+
+ 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.
+
+transpose
+ When ‘y’, ‘yes’, or ‘t’ attempt to transpose the table data before
+ plotting. Also recognises the shorthand option ‘trans’.
+
+‘type’
+ Specify the type of the plot, by default one of ‘2d’, ‘3d’,
+ ‘radar’, or ‘grid’. Available types can be customised with
+ ‘org-plot/preset-plot-types’.
+
+‘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.
+
+min
+ Provides a minimum axis value that may be used by a plot type.
+ Implicitly assumes the ‘y’ axis is being referred to. Can
+ explicitly provide a value for a either the ‘x’ or ‘y’ axis with
+ ‘xmin’ and ‘ymin’.
+
+max
+ Provides a maximum axis value that may be used by a plot type.
+ Implicitly assumes the ‘y’ axis is being referred to. Can
+ explicitly provide a value for a either the ‘x’ or ‘y’ axis with
+ ‘xmax’ and ‘ymax’.
+
+ticks
+ Provides a desired number of axis ticks to display, that may be
+ used by a plot type. If none is given a plot type that requires
+ ticks will use ‘org--plot/sensible-tick-num’ to try to determine a
+ good value.
+
+‘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.info, 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.info, 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]]
+
+ Some ‘\’, ‘[’ and ‘]’ characters in the LINK part need to be
+“escaped”, i.e., preceded by another ‘\’ character. More specifically,
+the following characters, and only them, must be escaped:
+
+ 1. all ‘[’ and ‘]’ characters,
+ 2. every ‘\’ character preceding either ‘]’ or ‘[’,
+ 3. every ‘\’ character at the end of the link.
+
+ Functions inserting links (see *note Handling Links::) properly
+escape ambiguous characters. You only need to bother about the rules
+above when inserting directly, or yanking, a URI within square brackets.
+When in doubt, you may use the function ‘org-link-escape’, which turns a
+link string into its escaped form.
+
+ 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 ‘<BS>’, 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.info, Node: Internal Links, Next: Radio Targets, Prev: Link Format, Up: Hyperlinks
+
+4.2 Internal Links
+==================
+
+A link that does not look like a URL—i.e., does not start with a known
+scheme or a file name—refers to the current document. You can follow it
+with ‘C-c C-o’ when point is on the link, or with a mouse click (see
+*note Handling Links::).
+
+ Org provides several refinements to internal navigation within a
+document. Most notably, a construct like ‘[[#my-custom-id]]’
+specifically targets the entry with the ‘CUSTOM_ID’ property set to
+‘my-custom-id’. Also, an internal link looking like ‘[[*Some section]]’
+points to a headline with the name ‘Some section’(1).
+
+ When the link does not belong to any of the cases above, Org looks
+for a _dedicated target_: the same string in double angular brackets,
+like ‘<<My Target>>’.
+
+ If no dedicated target exists, the link tries to match the exact name
+of an element within the buffer. Naming is done, unsurprisingly, 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 |
+
+ Ultimately, 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, or initiates a plain text search, according to the
+value of ‘org-link-search-must-match-exact-headline’.
+
+ Note that you must make sure custom IDs, dedicated targets, and names
+are unique throughout the document. Org provides a linter to assist you
+in the process, if needed. See *note Org Syntax::.
+
+ 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. <<target>>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-<TAB>’. 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.info, 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 ‘<<<My
+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.info, 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.
+
+ Here is the full set of built-in link types:
+
+‘file’
+ File links. File name may be remote, absolute, or relative.
+
+ Additionally, you can specify a line number, or a text search. In
+ Org files, you may link to a headline name, a custom ID, or a code
+ reference instead.
+
+ As a special case, “file” prefix may be omitted if the file name is
+ complete, e.g., it starts with ‘./’, or ‘/’.
+
+‘attachment’
+ Same as file links but for files and folders attached to the
+ current node (see *note Attachments::). Attachment links are
+ intended to behave exactly as file links but for files relative to
+ the attachment directory.
+
+‘bbdb’
+ Link to a BBDB record, with possible regexp completion.
+
+‘docview’
+ Link to a document opened with DocView mode. You may specify a
+ page number.
+
+‘doi’
+ Link to an electronic resource, through its handle.
+
+‘elisp’
+ Execute an Elisp command upon activation.
+
+‘gnus’, ‘rmail’, ‘mhe’
+ Link to messages or folders from a given Emacs’ MUA.
+
+‘help’
+ Display documentation of a symbol in ‘*Help*’ buffer.
+
+‘http’, ‘https’
+ Web links.
+
+‘id’
+ Link to a specific headline by its ID property, in an Org file.
+
+‘info’
+ Link to an Info manual, or to a specific node.
+
+‘irc’
+ Link to an IRC channel.
+
+‘mailto’
+ Link to message composition.
+
+‘news’
+ Usenet links.
+
+‘shell’
+ Execute a shell command upon activation.
+
+ The following table illustrates the link types above, along with
+their options:
+
+Link Type Example
+------------------------------------------------------------------------
+http ‘http://staff.science.uva.nl/c.dominik/’
+https ‘https://orgmode.org/’
+doi ‘doi:10.1000/182’
+file ‘file:/home/dominik/images/jupiter.jpg’
+ ‘/home/dominik/images/jupiter.jpg’ (same as above)
+ ‘file:papers/last.pdf’
+ ‘./papers/last.pdf’ (same as above)
+ ‘file:/ssh:me@some.where:papers/last.pdf’ (remote)
+ ‘/ssh:me@some.where:papers/last.pdf’ (same as above)
+ ‘file:sometextfile::NNN’ (jump to line number)
+ ‘file:projects.org’
+ ‘file:projects.org::some words’ (text search)(1)
+ ‘file:projects.org::*task title’ (headline search)
+ ‘file:projects.org::#custom-id’ (headline search)
+attachment ‘attachment:projects.org’
+ ‘attachment:projects.org::some words’ (text search)
+docview ‘docview:papers/last.pdf::NNN’
+id ‘id:B7423F4D-2E8A-471B-8810-C40F074717E9’
+news ‘news:comp.emacs’
+mailto ‘mailto:adent@galaxy.net’
+mhe ‘mhe:folder’ (folder link)
+ ‘mhe:folder#id’ (message link)
+rmail ‘rmail:folder’ (folder link)
+ ‘rmail:folder#id’ (message link)
+gnus ‘gnus:group’ (group link)
+ ‘gnus:group#id’ (article link)
+bbdb ‘bbdb:R.*Stallman’ (record with regexp)
+irc ‘irc:/irc.com/#emacs/bob’
+help ‘help:org-store-link’
+info ‘info:org#External links’
+shell ‘shell:ls *.org’
+elisp ‘elisp:(find-file "Elisp.org")’ (Elisp form to evaluate)
+ ‘elisp:org-agenda’ (interactive Elisp command)
+
+ On top of these built-in link types, additional ones are available
+through the ‘org-contrib’ repository (see *note Installation::). For
+example, these links to VM or Wanderlust messages are available when you
+load the corresponding libraries from the ‘org-contrib’ repository:
+
+‘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:
+
+ [[https://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 recognizes external links amid normal text and activates
+them as links. If spaces must be part of the link (for example in
+‘bbdb:R.*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.info, 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 ‘<<target>>’ 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. The ‘ID’ property can be
+ either a UUID (default) or a timestamp, depending on
+ ‘org-id-method’. 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-link-email-description-format’. By default, it refers to the
+ addressee and the subject.
+
+_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 ‘<UP>’
+ and ‘<DOWN>’ (or ‘M-p’, ‘M-n’).
+
+ _Completion support_
+ Completion with ‘<TAB>’ 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 ‘<RET>’ after inserting only the prefix, Org
+ offers specific completion support for some link types(5).
+ For example, if you type ‘f i l e <RET>’—alternative access:
+ ‘C-u C-c C-l’, see below—Org offers file name completion, and
+ after ‘b b d b <RET>’ 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’.
+
+‘<RET>’
+ When ‘org-return-follows-link’ is set, ‘<RET>’ 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’.
+
+ (with-eval-after-load 'org
+ (define-key org-mode-map (kbd "M-n") #'org-next-link)
+ (define-key org-mode-map (kbd "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-link-keep-stored-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-link-use-indirect-buffer-for-internals’.
+
+
+File: org.info, 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.info, 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=")
+ ("Nu Html Checker" . "https://validator.w3.org/nu/?doc=%h")
+ ("duckduckgo" . "https://duckduckgo.com/?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
+‘[[duckduckgo: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: duckduckgo https://duckduckgo.com/?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.info, 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’.
+
+ Note that all search options apply for Attachment links in the same
+way that they apply for File links.
+
+ 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/]]
+ [[attachment:main.c::255]]
+
+‘255’
+ Jump to line 255.
+
+‘My Target’
+ Search for a link target ‘<<My 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 (see *note Regular
+ Expressions::). 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.info, 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 ‘ol-bibtex.el’.
+
+
+File: org.info, 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.info, 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 state changing can also be done “remotely” from the agenda
+ buffer with the ‘t’ command key (see *note Agenda Commands::).
+
+‘S-<RIGHT>’ ‘S-<LEFT>’
+ 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. 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-<RET>’ (‘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.info, 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.info, 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, possibly _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-<RIGHT>’ and ‘S-<LEFT>’ to go forward and
+backward through the states. If you define many keywords, you can use
+in-buffer completion (see *note Completion::) or 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.info, 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 type of
+functionality is actually much better served by using tags (see *note
+Tags::), so the TODO implementation is kept just for backward
+compatibility.
+
+ Using TODO types, it would be set up like this:
+
+ (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
+
+ In this case, different keywords do not indicate states, 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.info, 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-<RIGHT>’
+‘C-S-<LEFT>’
+ 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-<RIGHT>’ 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 (see *note Conflicts::).
+
+‘S-<RIGHT>’
+‘S-<LEFT>’
+ ‘S-<LEFT>’ and ‘S-<RIGHT>’ walk through _all_ keywords from all
+ sub-sequences, so for example ‘S-<RIGHT>’ would switch from ‘DONE’
+ to ‘REPORT’ in the example above. For a discussion of the
+ interaction with shift-selection, see *note Conflicts::.
+
+
+File: org.info, 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. ‘<SPC>’ 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.info, 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(t) | DONE(d)
+ #+TODO: REPORT(r) BUG(b) KNOWNCAUSE(k) | FIXED(f)
+ #+TODO: | CANCELED(c)
+
+ To make sure you are using the correct keyword, type ‘#+’ into the
+buffer and then use ‘M-<TAB>’ 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.info, 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.info, 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 as
+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 as
+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 as 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 as 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
+module ‘org-depend.el’ in the ‘org-contrib’ repository.
+
+
+File: org.info, Node: Progress Logging, Next: Priorities, Prev: TODO Extensions, Up: TODO Items
+
+5.3 Progress Logging
+====================
+
+To record a timestamp and a note when changing a TODO state, call the
+command ‘org-todo’ with a prefix argument.
+
+‘C-u C-c C-t’ (‘org-todo’)
+ Prompt for a note and record a the time of the TODO state change.
+ The note is inserted as a list item below the headline, but can
+ also be placed into a drawer, see *note Tracking TODO state
+ changes::.
+
+ If you want to be more systematic, 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 as done?
+* Tracking TODO state changes:: When did the status change?
+* Tracking your habits:: How consistent have you been?
+
+
+File: org.info, Node: Closing items, Next: Tracking TODO state changes, Up: Progress Logging
+
+5.3.1 Closing items
+-------------------
+
+The most basic automatic logging is to keep track of _when_ a certain
+TODO item was marked as 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 <SPC>’ 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 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.info, Node: Tracking TODO state changes, Next: Tracking your habits, Prev: Closing items, Up: Progress Logging
+
+5.3.2 Tracking TODO state changes
+---------------------------------
+
+You might want to automatically 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@)")))
+
+ 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@)
+
+ 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.
+
+ 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 ‘<SPC>’
+in the agenda to show an entry—use ‘C-u <SPC>’ 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.info, 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’. Pressing ‘C-u K’ in the agenda toggles this
+ variable.
+
+ 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.info, 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
+right after the TODO keyword, 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.
+
+ You can also use numeric values for priorities, such as
+
+ *** TODO [#1] Write letter to Sam Fortune
+
+ When using numeric priorities, you need to set
+‘org-priority-highest’, ‘org-priority-lowest’ and ‘org-priority-default’
+to integers, which must all be strictly inferior to 65.
+
+ 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 ‘<SPC>’
+ 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-<UP>’ (‘org-priority-up’)
+‘S-<DOWN>’ (‘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.
+
+ You can change the range of allowed priorities by setting the
+variables ‘org-priority-highest’, ‘org-priority-lowest’, and
+‘org-priority-default’. 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
+
+ Or, using numeric values:
+
+ #+PRIORITIES: 1 10 5
+
+ ---------- Footnotes ----------
+
+ (1) See also the option ‘org-priority-start-cycle-with-default’.
+
+
+File: org.info, 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 as 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.info, 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.
+
+ 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.
+
+‘C-c C-x C-r’ (‘org-toggle-radio-button’)
+ Toggle checkbox status by using the checkbox of the item at point
+ as a radio button: when the checkbox is turned on, all other
+ checkboxes on the same level will be turned off. With a universal
+ prefix argument, toggle the presence of the checkbox. With a
+ double prefix argument, set it to ‘[-]’.
+
+ ‘C-c C-c’ can be told to consider checkboxes as radio buttons by
+ setting ‘#+ATTR_ORG: :radio t’ right before the list or by calling
+ ‘M-x org-list-checkbox-radio-mode’ to activate this minor mode.
+
+‘M-S-<RET>’ (‘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-<RET>’. 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.info, 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.info, 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.info, 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-<TAB>’ 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 ‘<RET>’, 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:
+
+‘<TAB>’
+ 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 and globally pre-defined tags from ‘org-tag-alist’ and
+ ‘org-tag-persistent-alist’. You can also add several tags: just
+ separate them with a comma.
+
+‘<SPC>’
+ Clear all tags for this line.
+
+‘<RET>’
+ 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 <SPC> h l
+p <RET>’. Switching from ‘@home’ to ‘@work’ would be done with ‘C-c C-c
+w <RET>’ or alternatively with ‘C-c C-c C-c w’. Adding the
+non-predefined tag ‘sarah’ could be done with ‘C-c C-c <TAB> s a r a h
+<RET>’.
+
+ 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
+‘<RET>’ 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.info, 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 (see *note Regular Expressions::). 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.info, 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.info, 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 the whole buffer.
+
+ 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.info, 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:
+
+ Properties can be inserted on buffer level. That means they apply
+before the first headline and can be inherited by all entries in a file.
+Property blocks defined before first headline needs to be located at the
+top of the buffer, allowing only comments above.
+
+ Properties can also be defined using lines 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-<TAB>’ (‘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. If before first headline the drawer is
+ inserted at the top of the drawer after any potential comments.
+
+‘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-<RIGHT>’ (‘org-property-next-allowed-values’)
+‘S-<LEFT>’ (‘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.info, 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 timestamp.
+‘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.
+‘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.info, 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 (see *note Regular Expressions::).
+
+
+File: org.info, 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.info, 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-<TAB>’ ‘S-<TAB>’, 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.info, 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.info, Node: Scope of column definitions, Next: Column attributes, Up: Defining columns
+
+7.5.1.1 Scope of column definitions
+...................................
+
+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:
+
+ A ‘COLUMNS’ property within a property drawer before first headline
+will apply to the entire file. As an addition to property drawers,
+keywords can also be defined for an entire file using a line like:
+
+ #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
+
+ 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.info, 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 minutes.
+ ‘: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.info, 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’ on a columns view line (‘org-columns-redo’)
+ Recreate the column view, to include recent changes made in the
+ buffer.
+
+‘C-c C-c’ or ‘q’ on a columns view line (‘org-columns-quit’)
+ Exit column view.
+
+Editing values
+..............
+
+‘<LEFT>’, ‘<RIGHT>’, ‘<UP>’, ‘<DOWN>’
+ 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-<RIGHT>’ (‘org-columns-next-allowed-value’)
+‘p’ or ‘S-<LEFT>’ (‘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-toggle-or-columns-quit’)
+ When there is a checkbox at point, toggle it. Else exit column
+ view.
+
+‘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-<RIGHT>’ (‘org-columns-new’)
+ Insert a new column, to the left of the current column.
+
+‘S-M-<LEFT>’ (‘org-columns-delete’)
+ Delete the current column.
+
+
+File: org.info, 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.
+
+‘:match’
+ When set to a string, use this as a tags/property match filter to
+ select only a subset of the headlines in the scope set by the ‘:id’
+ parameter.
+
+‘: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’.
+
+‘:exclude-tags’
+ List of tags to exclude from column view table: entries with these
+ tags will be excluded from the column view.
+
+‘: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:
+
+‘org-columns-insert-dblock’
+ Insert a dynamic block capturing a column view. Prompt for the
+ scope or ID of the view.
+
+ This command can be invoked by calling
+ ‘org-dynamic-block-insert-dblock’ (‘C-c C-x x’) and selecting
+ “columnview” (see *note Dynamic Blocks::).
+
+‘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
+package in ‘org-contrib’(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 <https://orgmode.org>.
+
+
+File: org.info, Node: Dates and Times, Next: Refiling and Archiving, 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.info, Node: Timestamps, Next: Creating Timestamps, Up: Dates and Times
+
+8.1 Timestamps
+==============
+
+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 expression entries
+ For more complex date specifications, Org mode supports using the
+ special expression diary entries implemented in the Emacs Calendar
+ 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 expression 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.info, 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-<LEFT>’ (‘org-timestamp-down-day’)
+‘S-<RIGHT>’ (‘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-<UP>’ (‘org-timestamp-up’)
+‘S-<DOWN>’ (‘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.info, 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—‘h’, ‘d’,
+‘w’, ‘m’ or ‘y’—to indicate a change in hours, days, weeks, months, or
+years. With ‘h’ the date is relative to the current time, with the
+other letters and a single plus or minus, the date is relative to today
+at 00:00. 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
+‘+2h’ ⇒ two hours from now
+‘+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
+‘11h-13h15’ ⇒ same as above
+‘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 ‘<RET>’, the date selected in the calendar is combined
+with the information entered at the prompt. You can control the
+calendar fully from the minibuffer:
+
+‘<RET>’ Choose date at point in calendar.
+‘mouse-1’ Select date by clicking on it.
+‘S-<RIGHT>’ One day forward.
+‘S-<LEFT>’ One day backward.
+‘S-<DOWN>’ One week forward.
+‘S-<UP>’ One week backward.
+‘M-S-<RIGHT>’ One month forward.
+‘M-S-<LEFT>’ 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.
+‘C-.’ Select today’s date(3)
+
+ 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(4).
+
+ ---------- 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) You can also use the calendar command ‘.’ to jump to today’s
+date, but if you are inserting an hour specification for your timestamp,
+‘.’ will then insert a dot after the hour. By contrast, ‘C-.’ will
+always jump to today’s date.
+
+ (4) If you find this distracting, turn off the display with
+‘org-read-date-display-live’.
+
+
+File: org.info, 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-<UP>’ and ‘S-<DOWN>’ keys can no longer be used to adjust
+ each component of a timestamp. If point is at the beginning of the
+ stamp, ‘S-<UP>’ and ‘S-<DOWN>’ change the stamp by one day, just
+ like ‘S-<LEFT>’ ‘S-<RIGHT>’. 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.info, 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 as 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 as 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 expression entries like
+
+ <%%(diary-float t 42)>
+
+in scheduling and deadline timestamps is limited. Org mode does not
+know enough about the internals of each function to issue early and late
+warnings. However, it shows the item on each day where the expression
+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 as
+done. If you do not like this, set the variable
+‘org-agenda-skip-scheduled-if-done’.
+
+
+File: org.info, 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.info, 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’, ‘m’, ‘w’, ‘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 as 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 shifts the date to one month after today.
+
+ ** TODO Wash my hands
+ DEADLINE: <2019-04-05 08:00 Sun .+1h>
+ Marking this DONE shifts the date to exactly one hour from now.
+
+ 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.info, 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) 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.info, 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-<cursor>’ keys, the update is automatic.
+
+‘C-S-<UP>’ (‘org-clock-timestamps-up’)
+‘C-S-<DOWN>’ (‘org-clock-timestamps-down’)
+ On CLOCK log lines, increase/decrease both timestamps so that the
+ clock duration keeps the same value.
+
+‘S-M-<UP>’ (‘org-timestamp-up’)
+‘S-M-<DOWN>’ (‘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-<UP>’ 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.info, 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.
+
+‘org-clock-report’
+ Insert or update a clock table. When called with a prefix
+ argument, jump to the first clock table in the current document and
+ update it. The clock table includes archived trees.
+
+ This command can be invoked by calling
+ ‘org-dynamic-block-insert-dblock’ (‘C-c C-x x’) and selecting
+ “clocktable” (see *note Dynamic Blocks::).
+
+‘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-<LEFT>’
+‘S-<RIGHT>’ (‘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 by ‘org-clock-report’:
+
+ #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
+ #+END: clocktable
+
+ The ‘#+BEGIN’ line contains 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-<LEFT>’ or ‘S-<RIGHT>’ 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 ‘"<now>"’ 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 ‘day’, ‘week’, ‘semimonth’, ‘month’, or ‘year’ to split the
+ table into chunks. To use this, either ‘:block’, or ‘:tstart’ and
+ ‘:tend’ are required.
+
+‘: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.
+
+‘:hidefiles’
+ Hide the file column when multiple files are used to produce the
+ table.
+
+‘: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 "<now>"
+ #+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.info, 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 ‘<RET>’ 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 <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 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’.
+
+Clocking out automatically after some idle time
+...............................................
+
+When you often forget to clock out before being idle and you don’t want
+to manually set the clocking time to take into account, you can set
+‘org-clock-auto-clockout-timer’ to a number of seconds and add
+‘(org-clock-auto-clockout-insinuate)’ to your ‘.emacs’ file.
+
+ When the clock is running and Emacs is idle for more than this number
+of seconds, the clock will be clocked out automatically.
+
+ Use ‘M-x org-clock-toggle-auto-clockout RET’ to temporarily turn this
+on or off.
+
+ ---------- 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 ‘org-contrib/’ repository, 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.info, 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’. Multiple
+formats are supported, such as ‘3:12’, ‘1:23:45’, or ‘1d3h5min’; see the
+file ‘org-duration.el’ for more detailed information about the format.
+
+ 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-<RIGHT>’ and ‘S-<LEFT>’ 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.info, 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-<RET>’ (‘org-insert-heading’)
+ Once the timer list is started, you can also use ‘M-<RET>’ 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.info, Node: Refiling and Archiving, Next: Capture and Attachments, Prev: Dates and Times, Up: Top
+
+9 Refiling and Archiving
+************************
+
+Once information is in the system, it may need to be moved around. Org
+provides Refile, Copy and Archive commands for this. Refile and Copy
+helps with moving and copying outlines. Archiving helps to keep the
+system compact and fast.
+
+* Menu:
+
+* Refile and Copy:: Moving/copying a tree from one place to another.
+* Archiving:: What to do with finished products.
+
+
+File: org.info, Node: Refile and Copy, Next: Archiving, Up: Refiling and Archiving
+
+9.1 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 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.
+
+‘C-c M-w’ (‘org-refile-copy’)
+ Copying works like refiling, except that the original note is not
+ deleted.
+
+‘C-c C-M-w’ (‘org-refile-reverse’)
+ Works like refiling, except that it temporarily toggles how the
+ value of ‘org-reverse-note-order’ applies to the current buffer.
+ So if ‘org-refile’ would append the entry as the last entry under
+ the target header, ‘org-refile-reverse’ will prepend it as the
+ first entry, and vice-versa.
+
+ ---------- Footnotes ----------
+
+ (1) Note the corresponding ‘STARTUP’ options ‘logrefile’,
+‘lognoterefile’, and ‘nologrefile’.
+
+
+File: org.info, Node: Archiving, Prev: Refile and Copy, Up: Refiling and Archiving
+
+9.2 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.info, Node: Moving subtrees, Next: Internal archiving, Up: Archiving
+
+9.2.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.
+
+ When ‘org-archive-subtree-save-file-p’ is non-‘nil’, save the target
+archive buffer.
+
+
+File: org.info, Node: Internal archiving, Prev: Moving subtrees, Up: Archiving
+
+9.2.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-<TAB>’, 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-c 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 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.info, Node: Capture and Attachments, Next: Agenda Views, Prev: Refiling and Archiving, Up: Top
+
+10 Capture and Attachments
+**************************
+
+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.
+Finally, it can parse RSS feeds for information. To learn how to let
+external programs (for example a web browser) trigger Org to capture
+material, see *note Protocols::.
+
+* Menu:
+
+* Capture:: Capturing new stuff.
+* Attachments:: Attach files to outlines.
+* RSS Feeds:: Getting input from RSS feeds.
+
+
+File: org.info, Node: Capture, Next: Attachments, Up: Capture and Attachments
+
+10.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.info, Node: Setting up capture, Next: Using capture, Up: Capture
+
+10.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.info, Node: Using capture, Next: Capture templates, Prev: Setting up capture, Up: Capture
+
+10.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.info, Node: Capture templates, Prev: Using capture, Up: Capture
+
+10.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 (kbd "C-c x")
+ (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.info, Node: Template elements, Next: Template expansion, Up: Capture templates
+
+10.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. You may also
+ get this template string from a file(3), or dynamically, from a
+ function using either syntax:
+
+ (file "/path/to/template-file")
+ (function FUNCTION-RETURNING-THE-TEMPLATE)
+
+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.
+
+ ‘:jump-to-captured’
+ When set, jump to the captured entry when finished.
+
+ ‘: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.
+
+ ‘:empty-lines-after’
+ Set this to the number of lines that should be inserted after
+ the new item. Overrides ‘:empty-lines’ for the number of
+ lines inserted after.
+
+ ‘:empty-lines-before’
+ Set this to the number of lines that should be inserted before
+ the new item. Overrides ‘:empty-lines’ for the number lines
+ inserted before.
+
+ ‘: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’
+ Use ‘week’ to make a week tree instead of the month-day tree,
+ i.e., place the headings for each day under a heading with the
+ current ISO week. Use ‘month’ to group entries by month only.
+ Default is to group entries by day.
+
+ ‘: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.
+
+ ~:refile-targets
+ Temporarily set ‘org-refile-targets’ to the value of this
+ property.
+
+ ---------- 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.
+
+ (3) When the file name is not absolute, Org assumes it is relative to
+‘org-directory’.
+
+
+File: org.info, Node: Template expansion, Next: Templates in contexts, Prev: Template elements, Up: Capture templates
+
+10.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.
+
+‘%<FORMAT>’
+ 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.
+
+‘%L’
+ Like ‘%l’, but without brackets (the link content itself).
+
+‘%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. You may specify a
+ default value with ‘%^{PROP|default}’.
+
+‘%^{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-link-from-user-regexp’.
+
+
+File: org.info, Node: Templates in contexts, Prev: Template expansion, Up: Capture templates
+
+10.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.info, Node: Attachments, Next: RSS Feeds, Prev: Capture, Up: Capture and Attachments
+
+10.2 Attachments
+================
+
+It is often useful to associate reference material with an outline node.
+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 a local, or even remote, computer,
+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 either
+named by a unique ID of each entry, or by a ‘DIR’ property.
+
+* Menu:
+
+* Attachment defaults and dispatcher:: How to access attachment commands
+* Attachment options:: Configuring the attachment system
+* Attachment links:: Hyperlink access to attachments
+* Automatic version-control with Git:: Everything safely stored away
+* Attach from Dired:: Using dired to select an attachment
+
+
+File: org.info, Node: Attachment defaults and dispatcher, Next: Attachment options, Up: Attachments
+
+10.2.1 Attachment defaults and dispatcher
+-----------------------------------------
+
+By default, Org attach uses ID properties when adding attachments to
+outline nodes. This makes working with attachments fully automated.
+There is no decision needed for folder-name or location. ID-based
+directories are by default located in the ‘data/’ directory, which lives
+in the same directory where your Org file lives(1).
+
+ When attachments are made using ‘org-attach’ a default tag ‘ATTACH’
+is added to the node that gets the attachments.
+
+ For more control over the setup, see *note Attachment options::.
+
+ 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.
+
+ ‘b’ (‘org-attach-buffer’)
+ Select a buffer and save it as a file in the task’s attachment
+ directory.
+
+ ‘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 ‘DIR’
+ property.
+
+ ‘S’ (‘org-attach-unset-directory’)
+ Remove the attachment directory. This command removes the
+ ‘DIR’ property and asks the user to either move content inside
+ that folder, if an ‘ID’ property is set, delete the content,
+ or to leave the attachment directory as is but no longer
+ attached to the outline node.
+
+ ---------- Footnotes ----------
+
+ (1) If you move entries or Org files from one directory to another,
+you may want to configure ‘org-attach-id-dir’ to contain an absolute
+path.
+
+
+File: org.info, Node: Attachment options, Next: Attachment links, Prev: Attachment defaults and dispatcher, Up: Attachments
+
+10.2.2 Attachment options
+-------------------------
+
+There are a couple of options for attachments that are worth mentioning.
+
+‘org-attach-id-dir’
+ The directory where attachments are stored when ‘ID’ is used as
+ method.
+
+‘org-attach-dir-relative’
+ When setting the ‘DIR’ property on a node using ‘C-c C-a s’
+ (‘org-attach-set-directory’), absolute links are entered by
+ default. This option changes that to relative links.
+
+‘org-attach-use-inheritance’
+ By default folders attached to an outline node are inherited from
+ parents according to ‘org-use-property-inheritance’. If one
+ instead want to set inheritance specifically for Org attach that
+ can be done using ‘org-attach-use-inheritance’. Inheriting
+ documents through the node hierarchy makes a lot of sense in most
+ cases. Especially when using attachment links (see *note
+ Attachment links::). The following example shows one use case for
+ attachment inheritance:
+
+ * Chapter A ...
+ :PROPERTIES:
+ :DIR: Chapter A/
+ :END:
+ ** Introduction
+ Some text
+
+ #+NAME: Image 1
+ [[attachment:image 1.jpg]]
+
+ Without inheritance one would not be able to resolve the link to
+ ‘image 1.jpg’, since the link is inside a sub-heading to ‘Chapter
+ A’.
+
+ Inheritance works the same way for both ‘ID’ and ‘DIR’ property.
+ If both properties are defined on the same headline then ‘DIR’
+ takes precedence. This is also true if inheritance is enabled. If
+ ‘DIR’ is inherited from a parent node in the outline, that property
+ still takes precedence over an ‘ID’ property defined on the node
+ itself.
+
+‘org-attach-method’
+ When attaching files using the dispatcher ‘C-c C-a’ it defaults to
+ copying files. The behavior can be changed by customizing
+ ‘org-attach-method’. Options are Copy, Move/Rename, Hard link or
+ Symbolic link.
+
+‘org-attach-preferred-new-method’
+ This customization lets you choose the default way to attach to
+ nodes without existing ‘ID’ and ‘DIR’ property. It defaults to
+ ‘id’ but can also be set to ‘dir’, ‘ask’ or ‘nil’.
+
+‘org-attach-archive-delete’
+ Configure this to determine if attachments should be deleted or not
+ when a subtree that has attachments is archived.
+
+‘org-attach-auto-tag’
+ When attaching files to a heading it will be assigned a tag
+ according to what is set here.
+
+‘org-attach-id-to-path-function-list’
+ When ‘ID’ is used for attachments, the ID is parsed into a part of
+ a directory-path. See ‘org-attach-id-uuid-folder-format’ for the
+ default function. Define a new one and add it as first element in
+ ‘org-attach-id-to-path-function-list’ if you want the folder
+ structure in any other way. All functions in this list will be
+ tried when resolving existing ID’s into paths, to maintain backward
+ compatibility with existing folders in your system.
+
+‘org-attach-store-link-p’
+ Stores a link to the file that is being attached. The link is
+ stored in ‘org-stored-links’ for later insertion with ‘C-c C-l’
+ (see *note Handling Links::). Depending on what option is set in
+ ‘org-attach-store-link-p’, the link is stored to either the
+ original location as a file link, the attachment location as an
+ attachment link or to the attachment location as a file link.
+
+‘org-attach-commands’
+ List of all commands used in the attach dispatcher.
+
+‘org-attach-expert’
+ Do not show the splash buffer with the attach dispatcher when
+ ‘org-attach-expert’ is set to non-‘nil’.
+
+ See customization group ‘Org Attach’ if you want to change the
+default settings.
+
+
+File: org.info, Node: Attachment links, Next: Automatic version-control with Git, Prev: Attachment options, Up: Attachments
+
+10.2.3 Attachment links
+-----------------------
+
+Attached files and folders can be referenced using attachment links.
+This makes it easy to refer to the material added to an outline node.
+Especially if it was attached using the unique ID of the entry!
+
+ * TODO Some task
+ :PROPERTIES:
+ :ID: 95d50008-c12e-479f-a4f2-cc0238205319
+ :END:
+ See attached document for more information: [[attachment:info.org]]
+
+ See *note External Links:: for more information about these links.
+
+
+File: org.info, Node: Automatic version-control with Git, Next: Attach from Dired, Prev: Attachment links, Up: Attachments
+
+10.2.4 Automatic version-control with Git
+-----------------------------------------
+
+If the directory attached to an outline node is a Git repository, Org
+can be configured to automatically commit changes to that repository
+when it sees them.
+
+ To make Org mode take care of versioning of attachments for you, add
+the following to your Emacs config:
+
+ (require 'org-attach-git)
+
+
+File: org.info, Node: Attach from Dired, Prev: Automatic version-control with Git, Up: Attachments
+
+10.2.5 Attach from Dired
+------------------------
+
+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))))))
+
+
+File: org.info, Node: RSS Feeds, Prev: Attachments, Up: Capture and Attachments
+
+10.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"
+ "https://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.info, Node: Agenda Views, Next: Markup for Rich Contents, Prev: Capture and Attachments, Up: Top
+
+11 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.info, Node: Agenda Files, Next: Agenda Dispatcher, Up: Agenda Views
+
+11.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.info, Node: Agenda Dispatcher, Next: Built-in Agenda Views, Prev: Agenda Files, Up: Agenda Views
+
+11.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’
+‘T’
+ Create a list of all TODO items (see *note Global TODO list::).
+
+‘m’
+‘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.
+‘#’
+ Create a list of stuck projects (see *note Stuck projects::).
+
+‘!’
+ Configure the list of stuck projects (see *note Stuck projects::).
+
+‘<’
+ Restrict an agenda command to the current buffer(1). If narrowing
+ is in effect restrict to the narrowed part of the buffer. 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.info, Node: Built-in Agenda Views, Next: Presentation and Sorting, Prev: Agenda Dispatcher, Up: Agenda Views
+
+11.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.info, Node: Weekly/daily agenda, Next: Global TODO list, Up: Built-in Agenda Views
+
+11.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. ‘<SPC>’, ‘<TAB>’, and ‘<RET>’ 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 expression 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
+expression entries, and does it faster because there is no overhead for
+first creating the diary display. Note that the expression 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 ‘ol-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.info, Node: Global TODO list, Next: Matching tags and properties, Prev: Weekly/daily agenda, Up: Built-in Agenda Views
+
+11.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’ to exclude some or all scheduled
+ items from the global TODO list, ‘org-agenda-todo-ignore-deadlines’
+ to exclude some or all items with a deadline set,
+ ‘org-agenda-todo-ignore-timestamp’ to exclude some or all items
+ with an active timestamp other than a DEADLINE or a SCHEDULED
+ timestamp and/or ‘org-agenda-todo-ignore-with-date’ to exclude
+ items with at least one active timestamp.
+
+ • 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.info, Node: Matching tags and properties, Next: Search view, Prev: Global TODO list, Up: Built-in Agenda Views
+
+11.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 (see *note Regular Expressions::). 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
+ ‘"<now>"’ for now (including time), ‘"<today>"’, and ‘"<tomorrow>"’
+ 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.info, Node: Search view, Next: Stuck projects, Prev: Matching tags and properties, Up: Built-in Agenda Views
+
+11.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 and conveniently adjust a boolean search from
+the agenda search view 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.info, Node: Stuck projects, Prev: Search view, Up: Built-in Agenda Views
+
+11.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")
+ "\\<IGNORE\\>"))
+
+ Note that if a project is identified as non-stuck, the subtree of
+this entry is searched for stuck projects.
+
+
+File: org.info, Node: Presentation and Sorting, Next: Agenda Commands, Prev: Built-in Agenda Views, Up: Agenda Views
+
+11.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 items:: Dynamically narrow the agenda.
+
+
+File: org.info, Node: Categories, Next: Time-of-day specifications, Up: Presentation and Sorting
+
+11.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.info, Node: Time-of-day specifications, Next: Sorting of agenda items, Prev: Categories, Up: Presentation and Sorting
+
+11.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.info, Node: Sorting of agenda items, Next: Filtering/limiting agenda items, Prev: Time-of-day specifications, Up: Presentation and Sorting
+
+11.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.info, Node: Filtering/limiting agenda items, Prev: Sorting of agenda items, Up: Presentation and Sorting
+
+11.4.4 Filtering/limiting agenda items
+--------------------------------------
+
+Agenda built-in or custom commands are statically defined. Agenda
+filters and limits allow to flexibly narrow down the list of agenda
+entries.
+
+ _Filters_ only change the visibility of items, are very fast and are
+mostly used interactively(1). You can switch quickly between different
+filters without having to recreate the agenda. _Limits_ on the other
+hand take effect before the agenda buffer is populated, so they are
+mostly useful when defined as local variables within custom agenda
+commands.
+
+Filtering in the agenda
+.......................
+
+The general filtering command is ‘org-agenda-filter’, bound to ‘/’.
+Before we introduce it, we describe commands for individual filter
+types. All filtering commands handle prefix arguments in the same way:
+A single ‘C-u’ prefix negates the filter, so it removes lines selected
+by the filter. A double prefix adds the new filter condition to the
+one(s) already in place, so filter elements are accumulated.
+
+‘\’ (‘org-agenda-filter-by-tag’)
+ Filter the agenda view with respect to a tag. You are prompted for
+ a tag selection letter; ‘<SPC>’ means any tag at all. Pressing
+ ‘<TAB>’ 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.
+ Pressing ‘+’ or ‘-’ at the prompt switches between filtering for
+ and against the next tag. To clear the filter, press ‘\’ twice
+ (once to call the command again, and once at the prompt).
+
+‘<’ (‘org-agenda-filter-by-category’)
+ Filter by category of the line at point, and show only entries with
+ this category. When called with a prefix argument, hide all
+ entries with the category at point. To clear the filter, call this
+ command again by pressing ‘<’.
+
+‘=’ (‘org-agenda-filter-by-regexp’)
+ Filter the agenda view by a regular expression: only show agenda
+ entries matching the regular expression the user entered. To clear
+ the filter, call the command again by pressing ‘=’.
+
+‘_’ (‘org-agenda-filter-by-effort’)
+ Filter the agenda view with respect to effort estimates, so select
+ tasks that take the right amount of time. You first need to set up
+ a list of 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’. To clear the filter, press ‘_’
+ twice (once to call the command again, and once at the first
+ prompt).
+
+‘^’ (‘org-agenda-filter-by-top-headline’)
+ Filter the current agenda view and only display items that fall
+ under the same top-level headline as the current entry. To clear
+ the filter, call this command again by pressing ‘^’.
+
+‘/’ (‘org-agenda-filter’)
+ This is the unified interface to four of the five filter methods
+ described above. At the prompt, specify different filter elements
+ in a single string, with full completion support. For example,
+
+ +work-John+<0:10-/plot/
+
+ selects entries with category ‘work’ and effort estimates below 10
+ minutes, and deselects entries with tag ‘John’ or matching the
+ regexp ‘plot’ (see *note Regular Expressions::). You can leave ‘+’
+ out if that does not lead to ambiguities. The sequence of elements
+ is arbitrary. The filter syntax assumes that there is no overlap
+ between categories and tags. Otherwise, tags take priority. If
+ you reply to the prompt with the empty string, all filtering is
+ removed. If a filter is specified, it replaces all current
+ filters. But if you call the command with a double prefix
+ argument, or if you add an additional ‘+’ (e.g., ‘++work’) to the
+ front of the string, the new filter elements are added to the
+ active ones. A single prefix argument applies the entire filter in
+ a negative sense.
+
+‘|’ (‘org-agenda-filter-remove-all’)
+ Remove all filters in the current agenda view.
+
+Computed tag filtering
+......................
+
+If the variable ‘org-agenda-auto-exclude-function’ is set to a
+user-defined function, that function can select tags that should be used
+as a tag filter when requested. The function will be called with
+lower-case versions of all tags represented in the current view. The
+function should return ‘"-tag"’ if the filter should remove entries with
+that tag, ‘"+tag"’ if only entries with this tag should be kept, or
+‘nil’ if that tag is irrelevant. 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 my-auto-exclude-fn (tag)
+ (when (cond ((string= tag "net")
+ (/= 0 (call-process "/sbin/ping" nil nil nil
+ "-c1" "-q" "-t1" "mail.gnu.org")))
+ ((member tag '("errand" "call"))
+ (let ((hr (nth 2 (decode-time))))
+ (or (< hr 8) (> hr 21)))))
+ (concat "-" tag)))
+
+ (setq org-agenda-auto-exclude-function #'my-auto-exclude-fn)
+
+ You can apply this self-adapting filter by using a triple prefix
+argument to ‘org-agenda-filter’, i.e. press ‘C-u C-u C-u /’, or by
+pressing ‘<RET>’ in ‘org-agenda-filter-by-tag’.
+
+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 agenda commands can preset a filter by binding one of the
+variables ‘org-agenda-tag-filter-preset’,
+‘org-agenda-category-filter-preset’, ‘org-agenda-effort-filter-preset’
+or ‘org-agenda-regexp-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.info, Node: Agenda Commands, Next: Custom Agenda Views, Prev: Presentation and Sorting, Up: Agenda Views
+
+11.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 ‘<DOWN>’ and ‘C-n’).
+
+‘p’ (‘org-agenda-previous-line’)
+ Previous line (same as ‘<UP>’ and ‘C-p’).
+
+View/Go to Org file
+-------------------
+
+‘<SPC>’ 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.
+
+‘<TAB>’ or ‘mouse-2’ (‘org-agenda-goto’)
+ Go to the original location of the item in another window.
+
+‘<RET>’ (‘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 <SPC>’ (‘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 as
+ 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 argument, 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-<LEFT>’ and
+ ‘S-<RIGHT>’. 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-<UP>’ (‘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-<DOWN>’ (‘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. A prefix arg is passed through to the
+ ‘org-todo’ command, so for example a ‘C-u’ prefix are will trigger
+ taking a note to document the state change.
+
+‘C-S-<RIGHT>’ (‘org-agenda-todo-nextset’)
+ Switch to the next set of TODO keywords.
+
+‘C-S-<LEFT>’, ‘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 ‘<SPC>’, the priority cookie
+ is removed from the entry.
+
+‘+’ or ‘S-<UP>’ (‘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-<DOWN>’ (‘org-agenda-priority-down’)
+ Decrease the priority of the current item.
+
+‘C-c C-x e’ or short ‘e’ (‘org-agenda-set-effort’)
+ Set the effort property for 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-<RIGHT>’ (‘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-<RIGHT>’
+ 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-<LEFT>’ (‘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.
+
+ ‘p’
+ 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 ‘<RET>’ 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.info, Node: Custom Agenda Views, Next: Exporting Agenda Views, Prev: Agenda Commands, Up: Agenda Views
+
+11.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.info, Node: Storing searches, Next: Block agenda, Up: Custom Agenda Views
+
+11.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 "\\<FIXME\\>")
+ ("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 is 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.info, Node: Block agenda, Next: Setting options, Prev: Storing searches, Up: Custom Agenda Views
+
+11.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’), ‘stuck’ for the list of stuck projects (as
+obtained with ‘#’) 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.info, Node: Setting options, Prev: Block agenda, Up: Custom Agenda Views
+
+11.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.info, Node: Exporting Agenda Views, Next: Agenda Column View, Prev: Custom Agenda Views, Up: Agenda Views
+
+11.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’ as an
+Emacs package from MELPA or 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.info, Node: Agenda Column View, Prev: Exporting Agenda Views, Up: Agenda Views
+
+11.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
+ ‘org-overriding-columns-format’ is currently set, and if so, takes
+ the format from there. You should set this variable only in the
+ _local settings section_ of a custom agenda command (see *note
+ Custom Agenda Views::) to make it valid for that specific agenda
+ view. If no such binding exists, it checks, in sequence,
+ ‘org-columns-default-format-for-agenda’, the format associated with
+ the first item in the agenda (through a property or a ‘#+COLUMNS’
+ setting in that buffer) and finally ‘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.info, Node: Markup for Rich Contents, Next: Exporting, Prev: Agenda Views, Up: Top
+
+12 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.
+* Creating Footnotes:: Edit and read footnotes.
+
+
+File: org.info, Node: Paragraphs, Next: Emphasis and Monospace, Up: Markup for Rich Contents
+
+12.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.info, Node: Emphasis and Monospace, Next: Subscripts and Superscripts, Prev: Paragraphs, Up: Markup for Rich Contents
+
+12.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 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’.
+
+ Sometimes, when marked text also contains the marker character
+itself, the result may be unsettling. For example,
+
+ /One may expect this whole sentence to be italicized, but the
+ following ~user/?variable~ contains =/= character, which effectively
+ stops emphasis there./
+
+ You can use zero width space to help Org sorting out the ambiguity.
+See *note Escape Character:: for more details.
+
+
+File: org.info, Node: Subscripts and Superscripts, Next: Special Symbols, Prev: Emphasis and Monospace, Up: Markup for Rich Contents
+
+12.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.
+
+ You can set ‘org-use-sub-superscripts’ in a file using the export
+option ‘^:’ (see *note Export Settings::). For example, ‘#+OPTIONS:
+^:{}’ sets ‘org-use-sub-superscripts’ to ‘{}’ and limits super- and
+subscripts to the curly bracket notation.
+
+ You can also toggle the visual display of super- and subscripts:
+
+‘C-c C-x \’ (‘org-toggle-pretty-entities’)
+ This command formats sub- and superscripts in a WYSIWYM way.
+
+ Set both ‘org-pretty-entities’ and
+‘org-pretty-entities-include-sub-superscripts’ to ‘t’ to start with
+super- and subscripts _visually_ interpreted as specified by the option
+‘org-use-sub-superscripts’.
+
+
+File: org.info, Node: Special Symbols, Next: Embedded LaTeX, Prev: Subscripts and Superscripts, Up: Markup for Rich Contents
+
+12.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-<TAB>’ 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
+‘&alpha;’ in the HTML output, and as ‘\(\alpha\)’ in the LaTeX output.
+Similarly, ‘\nbsp’ becomes ‘&nbsp;’ 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.info, Node: Embedded LaTeX, Next: Literal Examples, Prev: Special Symbols, Up: Markup for Rich Contents
+
+12.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.info, Node: LaTeX fragments, Next: Previewing LaTeX fragments, Up: Embedded LaTeX
+
+12.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 (https://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.info, Node: Previewing LaTeX fragments, Next: CDLaTeX mode, Prev: LaTeX fragments, Up: Embedded LaTeX
+
+12.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-latex-preview’)
+
+ 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 single prefix argument, clear all images in the
+ current entry. Two prefix arguments produce a preview image for
+ all fragments in the buffer, while three of them clear all the
+ images in that 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
+<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.info, Node: CDLaTeX mode, Prev: Previewing LaTeX fragments, Up: Embedded LaTeX
+
+12.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) using MELPA
+(https://melpa.org/) with the Emacs packaging system
+(https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html)
+or alternatively from
+<https://staff.fnwi.uva.nl/c.dominik/Tools/cdlatex/>. Do not use
+CDLaTeX mode itself under Org mode, but use the special version Org
+CDLaTeX minor mode that comes as part of Org. 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.
+
+‘<TAB>’
+
+ The ‘<TAB>’ key expands the template if point is inside a LaTeX
+ fragment(1). For example, ‘<TAB>’ expands ‘fr’ to ‘\frac{}{}’ and
+ position point correctly inside the first brace. Another ‘<TAB>’
+ gets you into the second brace.
+
+ Even outside fragments, ‘<TAB>’ expands environment abbreviations
+ at the beginning of a line. For example, if you write ‘equ’ at the
+ beginning of a line and press ‘<TAB>’, 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 ‘<TAB>’ 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.info, Node: Literal Examples, Next: Images, Prev: Embedded LaTeX, Up: Markup for Rich Contents
+
+12.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
+
+ There is one limitation, however. You must insert a comma right
+before lines starting with either ‘*’, ‘,*’, ‘#+’ or ‘,#+’, as those may
+be interpreted as outlines nodes or some other special syntax. Org
+transparently strips these additional commas whenever it accesses the
+contents of the block.
+
+ #+BEGIN_EXAMPLE
+ ,* I am no real headline
+ #+END_EXAMPLE
+
+ 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.
+
+ Source code and examples may be _indented_ in order to align nicely
+with the surrounding text, and in particular with plain list structure
+(see *note Plain Lists::). By default, Org only retains the relative
+indentation between lines, e.g., when exporting the contents of the
+block. However, you can use the ‘-i’ switch to also preserve the global
+indentation, if it does matter. 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. 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(4) 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-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) You may select a different mode with the variable
+‘org-edit-fixed-width-region-mode’.
+
+
+File: org.info, Node: Images, Next: Captions, Prev: Literal Examples, Up: Markup for Rich Contents
+
+12.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.info, Node: Captions, Next: Horizontal Rules, Prev: Images, Up: Markup for Rich Contents
+
+12.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.info, Node: Horizontal Rules, Next: Creating Footnotes, Prev: Captions, Up: Markup for Rich Contents
+
+12.9 Horizontal Rules
+=====================
+
+A line consisting of only dashes, and at least 5 of them, is exported as
+a horizontal line.
+
+
+File: org.info, Node: Creating Footnotes, Prev: Horizontal Rules, Up: Markup for Rich Contents
+
+12.10 Creating 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]’
+ An 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.info, Node: Exporting, Next: Publishing, Prev: Markup for Rich Contents, Up: Top
+
+13 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 ‘org-contrib’ repository (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:: Producing presentations and slides.
+* 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.info, Node: The Export Dispatcher, Next: Export Settings, Up: Exporting
+
+13.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 ‘<head>...</head>’ 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. See also *note Sparse Trees::.
+
+
+File: org.info, Node: Export Settings, Next: Table of Contents, Prev: The Export Dispatcher, Up: Exporting
+
+13.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-<TAB>’(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-<TAB>’ to switch windows. Use ‘C-M-i’
+or ‘<ESC> <TAB>’ 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.info, Node: Table of Contents, Next: Include Files, Prev: Export Settings, Up: Exporting
+
+13.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.
+
+ The following example inserts a table of contents that links to the
+children of the specified target.
+
+ * Target
+ :PROPERTIES:
+ :CUSTOM_ID: TargetSection
+ :END:
+ ** Heading A
+ ** Heading B
+ * Another section
+ #+TOC: headlines 1 :target #TargetSection
+
+ The ‘:target’ attribute is supported in HTML, Markdown, ODT, and
+ASCII export.
+
+ 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.info, Node: Include Files, Next: Macro Replacement, Prev: Table of Contents, Up: Exporting
+
+13.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 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.info, Node: Macro Replacement, Next: Comment Lines, Prev: Include Files, Up: Exporting
+
+13.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.info, Node: Comment Lines, Next: ASCII/Latin-1/UTF-8 export, Prev: Macro Replacement, Up: Exporting
+
+13.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.info, Node: ASCII/Latin-1/UTF-8 export, Next: Beamer Export, Prev: Comment Lines, Up: Exporting
+
+13.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.info, Node: Beamer Export, Next: HTML Export, Prev: ASCII/Latin-1/UTF-8 export, Up: Exporting
+
+13.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.info, Node: Beamer export commands, Next: Beamer specific export settings, Up: Beamer Export
+
+13.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.info, Node: Beamer specific export settings, Next: Frames and Blocks in Beamer, Prev: Beamer export commands, Up: Beamer Export
+
+13.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.info, Node: Frames and Blocks in Beamer, Next: Beamer specific syntax, Prev: Beamer specific export settings, Up: Beamer Export
+
+13.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.info, Node: Beamer specific syntax, Next: Editing support, Prev: Frames and Blocks in Beamer, Up: Beamer Export
+
+13.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.info, Node: Editing support, Next: A Beamer example, Prev: Beamer specific syntax, Up: Beamer Export
+
+13.8.5 Editing support
+----------------------
+
+Org Beamer mode is a special minor mode for faster editing of Beamer
+documents.
+
+ #+STARTUP: beamer
+
+‘C-c C-b’ (‘org-beamer-select-environment’)
+
+ Org Beamer mode provides this key for quicker selections in Beamer
+ normal environments, and for selecting the ‘BEAMER_COL’ property.
+
+
+File: org.info, Node: A Beamer example, Prev: Editing support, Up: Beamer Export
+
+13.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.info, Node: HTML Export, Next: LaTeX Export, Prev: Beamer Export, Up: Exporting
+
+13.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.
+* Headlines in HTML export:: Formatting headlines.
+* 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.info, Node: HTML export commands, Next: HTML specific export settings, Up: HTML Export
+
+13.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.info, Node: HTML specific export settings, Next: HTML doctypes, Prev: HTML export commands, Up: HTML Export
+
+13.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.
+
+ The exporter includes a number of other meta tags, which can be
+ customized by modifying ‘org-html-meta-tags’.
+
+‘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.info, Node: HTML doctypes, Next: HTML preamble and postamble, Prev: HTML specific export settings, Up: HTML Export
+
+13.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:
+
+ <aside>
+ <p>Lorem ipsum</p>
+ </aside>
+
+while this:
+
+ #+ATTR_HTML: :controls controls :width 350
+ #+BEGIN_video
+ #+HTML: <source src="movie.mp4" type="video/mp4">
+ #+HTML: <source src="movie.ogg" type="video/ogg">
+ Your browser does not support the video tag.
+ #+END_video
+
+exports to:
+
+ <video controls="controls" width="350">
+ <source src="movie.mp4" type="video/mp4">
+ <source src="movie.ogg" type="video/ogg">
+ <p>Your browser does not support the video tag.</p>
+ </video>
+
+ 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 ‘<div class="lederhosen">’.
+
+ Special blocks cannot have headlines. For the HTML exporter to wrap
+the headline and its contents in ‘<section>’ or ‘<article>’ tags, set
+the ‘HTML_CONTAINER’ property for the headline.
+
+
+File: org.info, Node: HTML preamble and postamble, Next: Quoting HTML tags, Prev: HTML doctypes, Up: HTML Export
+
+13.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.info, Node: Quoting HTML tags, Next: Headlines in HTML export, Prev: HTML preamble and postamble, Up: HTML Export
+
+13.9.5 Quoting HTML tags
+------------------------
+
+The HTML export back-end transforms ‘<’ and ‘>’ to ‘&lt;’ and ‘&gt;’.
+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:<b>@@bold text@@html:</b>@@
+
+ 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.info, Node: Headlines in HTML export, Next: Links in HTML export, Prev: Quoting HTML tags, Up: HTML Export
+
+13.9.6 Headlines in HTML export
+-------------------------------
+
+Headlines are exported to ‘<h1>’, ‘<h2>’, etc. Each headline gets the
+‘id’ attribute from ‘CUSTOM_ID’ property, or a unique generated value,
+see *note Internal Links::.
+
+ When ‘org-html-self-link-headlines’ is set to a non-‘nil’ value, the
+text of the headlines is also wrapped in ‘<a>’ tags. These tags have a
+‘href’ attribute making the headlines link to themselves.
+
+
+File: org.info, Node: Links in HTML export, Next: Tables in HTML export, Prev: Headlines in HTML export, Up: HTML Export
+
+13.9.7 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 ‘<a>’ or ‘<img>’ 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.info, Node: Tables in HTML export, Next: Images in HTML export, Prev: Links in HTML export, Up: HTML Export
+
+13.9.8 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.info, Node: Images in HTML export, Next: Math formatting in HTML export, Prev: Tables in HTML export, Up: HTML Export
+
+13.9.9 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.info, Node: Math formatting in HTML export, Next: Text areas in HTML export, Prev: Images in HTML export, Up: HTML Export
+
+13.9.10 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
+(https://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 (https://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.info, Node: Text areas in HTML export, Next: CSS support, Prev: Math formatting in HTML export, Up: HTML Export
+
+13.9.11 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.info, Node: CSS support, Next: JavaScript support, Prev: Text areas in HTML export, Up: HTML Export
+
+13.9.12 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 <sup>)
+‘.footnum’ footnote number in footnote definition (always <sup>)
+‘.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: <link rel="stylesheet" type="text/css" href="style1.css" />
+ #+HTML_HEAD_EXTRA: <link rel="alternate stylesheet" type="text/css" href="style2.css" />
+
+ 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 ‘<style> ... </style>’ 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. You can also assign a specific class to a headline with the
+‘HTML_HEADLINE_CLASS’ 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.info, Node: JavaScript support, Prev: CSS support, Up: HTML Export
+
+13.9.13 JavaScript supported display of web pages
+-------------------------------------------------
+
+Sebastian Rose has written a JavaScript program especially designed to
+allow two different ways of viewing HTML files created with Org. 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 <https://orgmode.org/org-info.js> and the documentation
+at <https://orgmode.org/worg/code/org-info-js/>. The script is hosted
+on <https://orgmode.org>, but for reliability, prefer installing it on
+your own web server.
+
+ To use this program, just add this line to the Org file:
+
+ #+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
+ <https://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 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.info, Node: LaTeX Export, Next: Markdown Export, Prev: HTML Export, Up: Exporting
+
+13.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.
+* Verse blocks in LaTeX export:: Attributes specific to special blocks.
+* Quote blocks in LaTeX export:: Attributes specific to quote blocks.
+
+
+File: org.info, Node: LaTeX/PDF export commands, Next: LaTeX specific export settings, Up: LaTeX Export
+
+13.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.info, Node: LaTeX specific export settings, Next: LaTeX header and sectioning, Prev: LaTeX/PDF export commands, Up: LaTeX Export
+
+13.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 outside 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.info, Node: LaTeX header and sectioning, Next: Quoting LaTeX code, Prev: LaTeX specific export settings, Up: LaTeX Export
+
+13.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.info, Node: Quoting LaTeX code, Next: Tables in LaTeX export, Prev: LaTeX header and sectioning, Up: LaTeX Export
+
+13.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.info, Node: Tables in LaTeX export, Next: Images in LaTeX export, Prev: Quoting LaTeX code, Up: LaTeX Export
+
+13.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.info, Node: Images in LaTeX export, Next: Plain lists in LaTeX export, Prev: Tables in LaTeX export, Up: LaTeX Export
+
+13.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 (<http://sourceforge.net/projects/pgf/>)
+images, the back-end uses an ‘\input’ macro wrapped within a
+‘tikzpicture’ environment.
+
+ For specifying image ‘:width’, ‘:height’, ‘:scale’ and other
+‘:options’, use this syntax:
+
+ #+ATTR_LATEX: :width 5cm :options angle=90
+ [[./img/sed-hr4049.pdf]]
+
+ A ‘:scale’ attribute overrides both ‘:width’ and ‘:height’
+attributes.
+
+ 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 ‘nil’.
+
+ Set the ‘:comment-include’ attribute to non-‘nil’ value for the LaTeX
+export back-end to comment out the ‘\includegraphics’ macro.
+
+
+File: org.info, Node: Plain lists in LaTeX export, Next: Source blocks in LaTeX export, Prev: Images in LaTeX export, Up: LaTeX Export
+
+13.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.info, Node: Source blocks in LaTeX export, Next: Example blocks in LaTeX export, Prev: Plain lists in LaTeX export, Up: LaTeX Export
+
+13.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(1).
+
+ #+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.
+
+ ---------- Footnotes ----------
+
+ (1) Minted uses an external Python package for code highlighting,
+which requires the flag ‘-shell-escape’ to be added to
+‘org-latex-pdf-process’.
+
+
+File: org.info, Node: Example blocks in LaTeX export, Next: Special blocks in LaTeX export, Prev: Source blocks in LaTeX export, Up: LaTeX Export
+
+13.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.info, Node: Special blocks in LaTeX export, Next: Horizontal rules in LaTeX export, Prev: Example blocks in LaTeX export, Up: LaTeX Export
+
+13.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.info, Node: Horizontal rules in LaTeX export, Next: Verse blocks in LaTeX export, Prev: Special blocks in LaTeX export, Up: LaTeX Export
+
+13.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.info, Node: Verse blocks in LaTeX export, Next: Quote blocks in LaTeX export, Prev: Horizontal rules in LaTeX export, Up: LaTeX Export
+
+13.10.12 Verse blocks in LaTeX export
+-------------------------------------
+
+The LaTeX export back-end accepts four attributes for verse blocks:
+‘:lines’, ‘:center’, ‘:versewidth’ and ‘:latexcode’. The three first
+require the external LaTeX package ‘verse.sty’, which is an extension of
+the standard LaTeX environment.
+
+‘:lines’
+ To add marginal verse numbering. Its value is an integer, the
+ sequence in which the verses should be numbered.
+‘:center’
+ With value ‘t’ all the verses on the page are optically centered (a
+ typographic convention for poetry), taking as a reference the
+ longest verse, which must be indicated by the attribute
+ ‘:versewidth’.
+‘:versewidth’
+ Its value is a literal text string with the longest verse.
+‘:latexcode’
+ It accepts any arbitrary LaTeX code that can be included within a
+ LaTeX ‘verse’ environment.
+
+ A complete example with Shakespeare’s first sonnet:
+
+ #+ATTR_LATEX: :center t :latexcode \color{red} :lines 5
+ #+ATTR_LATEX: :versewidth Feed’st thy light’s flame with self-substantial fuel,
+ #+BEGIN_VERSE
+ From fairest creatures we desire increase,
+ That thereby beauty’s rose might never die,
+ But as the riper should by time decease
+ His tender heir might bear his memory
+ But thou, contracted to thine own bright eyes,
+ Feed’st thy light’s flame with self-substantial fuel,
+ Making a famine where abundance lies,
+ Thyself thy foe, to thy sweet self too cruel.
+ Thou that art now the world’s fresh ornament,
+ And only herald to the gaudy spring,
+ Within thine own bud buriest thy content,
+ And, tender churl, mak’st waste in niggardly.
+ Pity the world, or else this glutton be,
+ To eat the world’s due, by the grave and thee.
+ #+END_VERSE
+
+
+File: org.info, Node: Quote blocks in LaTeX export, Prev: Verse blocks in LaTeX export, Up: LaTeX Export
+
+13.10.13 Quote blocks in LaTeX export
+-------------------------------------
+
+The LaTeX export back-end accepts two attributes for quote blocks:
+‘:environment’, for an arbitrary quoting environment (the default value
+is that of ‘org-latex-default-quote-environment’: ‘"quote"’) and
+‘:options’. For example, to choose the environment ‘quotation’,
+included as an alternative to ‘quote’ in standard LaTeX classes:
+
+ #+ATTR_LATEX: :environment quotation
+ #+BEGIN_QUOTE
+ some text...
+ #+END_QUOTE
+
+ To choose the ‘foreigndisplayquote’ environment, included in the
+LaTeX package ‘csquotes’, with the ‘german’ option, use this syntax:
+
+ #+LATEX_HEADER:\usepackage[autostyle=true]{csquotes}
+ #+ATTR_LATEX: :environment foreigndisplayquote :options {german}
+ #+BEGIN_QUOTE
+ some text in German...
+ #+END_QUOTE
+
+which is exported to LaTeX as
+
+ \begin{foreigndisplayquote}{german}
+ some text in German...
+ \end{foreigndisplayquote}
+
+
+File: org.info, Node: Markdown Export, Next: OpenDocument Text Export, Prev: LaTeX Export, Up: Exporting
+
+13.11 Markdown Export
+=====================
+
+The Markdown export back-end, “md”, converts an Org file to Markdown
+format, as defined at <http://daringfireball.net/projects/markdown/>.
+
+ 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.info, Node: OpenDocument Text Export, Next: Org Export, Prev: Markdown Export, Up: Exporting
+
+13.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.info, Node: Pre-requisites for ODT export, Next: ODT export commands, Up: OpenDocument Text Export
+
+13.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.info, Node: ODT export commands, Next: ODT specific export settings, Prev: Pre-requisites for ODT export, Up: OpenDocument Text Export
+
+13.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.info, Node: ODT specific export settings, Next: Extending ODT export, Prev: ODT export commands, Up: OpenDocument Text Export
+
+13.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.info, Node: Extending ODT export, Next: Applying custom styles, Prev: ODT specific export settings, Up: OpenDocument Text Export
+
+13.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.info, Node: Applying custom styles, Next: Links in ODT export, Prev: Extending ODT export, Up: OpenDocument Text Export
+
+13.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.info, Node: Links in ODT export, Next: Tables in ODT export, Prev: Applying custom styles, Up: OpenDocument Text Export
+
+13.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.info, Node: Tables in ODT export, Next: Images in ODT export, Prev: Links in ODT export, Up: OpenDocument Text Export
+
+13.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 |
+ |---------------+-------+-------+-------+-------|
+ | / | < | | | < |
+ | <l13> | <r5> | <r5> | <r5> | <r6> |
+ | 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.info, Node: Images in ODT export, Next: Math formatting in ODT export, Prev: Tables in ODT export, Up: OpenDocument Text Export
+
+13.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 <https://orgmode.org> 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.info, Node: Math formatting in ODT export, Next: Labels and captions in ODT export, Prev: Images in ODT export, Up: OpenDocument Text Export
+
+13.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.info, Node: LaTeX math snippets, Next: MathML and OpenDocument formula files, Up: Math formatting in ODT export
+
+13.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 <http://dlmf.nist.gov/LaTeXML/>.
+
+
+File: org.info, Node: MathML and OpenDocument formula files, Prev: LaTeX math snippets, Up: Math formatting in ODT export
+
+13.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.info, Node: Labels and captions in ODT export, Next: Literal examples in ODT export, Prev: Math formatting in ODT export, Up: OpenDocument Text Export
+
+13.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.info, Node: Literal examples in ODT export, Next: Advanced topics in ODT export, Prev: Labels and captions in ODT export, Up: OpenDocument Text Export
+
+13.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.info, Node: Advanced topics in ODT export, Prev: Literal examples in ODT export, Up: OpenDocument Text Export
+
+13.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
+ ‘<office:text>’ ... ‘</office:text>’ 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 ‘<text:sequence-decl>’ ... ‘</text:sequence-decl>’
+ 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:<text:span text:style-name="Highlight">This is highlighted
+ text</text:span>@@. 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:
+
+ <style:style style:name="Highlight" style:family="text">
+ <style:text-properties fo:background-color="#ff0000"/>
+ </style:style>
+
+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: <text:p text:style-name="PageBreak"/>
+
+ *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.
+
+ <style:style style:name="PageBreak" style:family="paragraph"
+ style:parent-style-name="Text_20_body">
+ <style:paragraph-properties fo:break-before="page"/>
+ </style:style>
+
+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
+ <text:p text:style-name="Text_20_body_20_bold">
+ This paragraph is specially formatted and uses bold text.
+ </text:p>
+ #+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 ‘<office:automatic-styles>’ ...
+ ‘</office:automatic-styles>’ 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 ‘<table:table-template>’ 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 ‘<table:table>’ element in the OpenDocument-v1.2 specification.
+
+
+File: org.info, Node: Org Export, Next: Texinfo Export, Prev: OpenDocument Text Export, Up: Exporting
+
+13.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.info, Node: Texinfo Export, Next: iCalendar Export, Prev: Org Export, Up: Exporting
+
+13.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.info, Node: Texinfo export commands, Next: Texinfo specific export settings, Up: Texinfo Export
+
+13.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.info, Node: Texinfo specific export settings, Next: Texinfo file header, Prev: Texinfo export commands, Up: Texinfo Export
+
+13.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.info, Node: Texinfo file header, Next: Texinfo title and copyright page, Prev: Texinfo specific export settings, Up: Texinfo Export
+
+13.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.info, Node: Texinfo title and copyright page, Next: Info directory file, Prev: Texinfo file header, Up: Texinfo Export
+
+13.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.info, Node: Info directory file, Next: Headings and sectioning structure, Prev: Texinfo title and copyright page, Up: Texinfo Export
+
+13.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.info, Node: Headings and sectioning structure, Next: Indices, Prev: Info directory file, Up: Texinfo Export
+
+13.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.info, Node: Indices, Next: Quoting Texinfo code, Prev: Headings and sectioning structure, Up: Texinfo Export
+
+13.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.info, Node: Quoting Texinfo code, Next: Plain lists in Texinfo export, Prev: Indices, Up: Texinfo Export
+
+13.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.info, Node: Plain lists in Texinfo export, Next: Tables in Texinfo export, Prev: Quoting Texinfo code, Up: Texinfo Export
+
+13.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, set ‘:table-type’ attribute
+to either ‘ftable’ or ‘vtable’ value. 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
+
+ Ordered lists are numbered when exported to Texinfo format. Such
+numbering obeys any counter (see *note Plain Lists::) in the first item
+of the list. The ‘:enum’ attribute also let you start the list at a
+specific number, or switch to a lettered list, as illustrated here
+
+ #+ATTR_TEXINFO: :enum A
+ 1. Alpha
+ 2. Bravo
+ 3. Charlie
+
+
+File: org.info, Node: Tables in Texinfo export, Next: Images in Texinfo export, Prev: Plain lists in Texinfo export, Up: Texinfo Export
+
+13.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.info, Node: Images in Texinfo export, Next: Quotations in Texinfo export, Prev: Tables in Texinfo export, Up: Texinfo Export
+
+13.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.info, Node: Quotations in Texinfo export, Next: Special blocks in Texinfo export, Prev: Images in Texinfo export, Up: Texinfo Export
+
+13.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.info, Node: Special blocks in Texinfo export, Next: A Texinfo example, Prev: Quotations in Texinfo export, Up: Texinfo Export
+
+13.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.info, Node: A Texinfo example, Prev: Special blocks in Texinfo export, Up: Texinfo Export
+
+13.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:
+
+ #+INCLUDE: fdl.org
+
+ * Index
+ :PROPERTIES:
+ :INDEX: cp
+ :END:
+
+
+File: org.info, Node: iCalendar Export, Next: Other Built-in Back-ends, Prev: Texinfo Export, Up: Exporting
+
+13.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’, ‘TIMEZONE’ and ‘CLASS’ properties from the Org entries when
+exporting. To force the back-end to inherit the ‘LOCATION’, ‘TIMEZONE’
+and ‘CLASS’ properties, configure the ‘org-use-property-inheritance’
+variable.
+
+ When Org entries do not have ‘SUMMARY’, ‘DESCRIPTION’, ‘LOCATION’ and
+‘CLASS’ 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.
+
+ The ‘CLASS’ property can be used to specify a per-entry visibility
+class or access restrictions, and is applied to any entry with class
+information. The iCalendar standard defines three visibility classes:
+‘PUBLIC’
+ The entry is publicly visible (this is the default).
+‘CONFIDENTIAL’
+ Only a limited group of clients get access to the event.
+‘PRIVATE’
+ The entry can be retrieved only by its owner.
+ The server should treat unknown class properties the same as
+‘PRIVATE’.
+
+ 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.info, Node: Other Built-in Back-ends, Next: Advanced Export Configuration, Prev: iCalendar Export, Up: Exporting
+
+13.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.info, Node: Advanced Export Configuration, Next: Export in Foreign Buffers, Prev: Other Built-in Back-ends, Up: Exporting
+
+13.17 Advanced Export Configuration
+===================================
+
+Export 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.info, Node: Export in Foreign Buffers, Prev: Advanced Export Configuration, Up: Exporting
+
+13.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’.
+
+* Menu:
+
+* Bare HTML:: Exporting HTML without CSS, Javascript, etc.
+
+
+File: org.info, Node: Bare HTML, Up: Export in Foreign Buffers
+
+13.18.1 Exporting to minimal HTML
+---------------------------------
+
+If you want to output a minimal HTML file, with no CSS, no Javascript,
+no preamble or postamble, here are the variable you would need to set:
+
+ (setq org-html-head ""
+ org-html-head-extra ""
+ org-html-head-include-default-style nil
+ org-html-head-include-scripts nil
+ org-html-preamble nil
+ org-html-postamble nil
+ org-html-use-infojs nil)
+
+
+File: org.info, Node: Publishing, Next: Citation handling, Prev: Exporting, Up: Top
+
+14 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.info, Node: Configuration, Next: Uploading Files, Up: Publishing
+
+14.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.info, Node: Project alist, Next: Sources and destinations, Up: Configuration
+
+14.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.info, Node: Sources and destinations, Next: Selecting files, Prev: Project alist, Up: Configuration
+
+14.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.info, Node: Selecting files, Next: Publishing action, Prev: Sources and destinations, Up: Configuration
+
+14.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.info, Node: Publishing action, Next: Publishing options, Prev: Selecting files, Up: Configuration
+
+14.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 (see *note HTML
+Export::). But you can also 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
+_archived_, _commented_, and _tag-excluded_ trees removed, use
+‘org-org-publish-to-org’. This produces ‘file.org’ and puts 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.info, Node: Publishing options, Next: Publishing links, Prev: Publishing action, Up: Configuration
+
+14.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-equation-reference-format’ ‘org-html-equation-reference-format’
+‘: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-self-link-headlines’ ‘org-html-self-link-headlines’
+‘: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-wrap-src-lines’ ‘org-html-wrap-src-lines’
+‘: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.info, Node: Publishing links, Next: Site map, Prev: Publishing options, Up: Configuration
+
+14.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.info, Node: Site map, Next: Generating an index, Prev: Publishing links, Up: Configuration
+
+14.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.info, Node: Generating an index, Prev: Site map, Up: Configuration
+
+14.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.info, Node: Uploading Files, Next: Sample Configuration, Prev: Configuration, Up: Publishing
+
+14.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.info, Node: Sample Configuration, Next: Triggering Publication, Prev: Uploading Files, Up: Publishing
+
+14.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.info, Node: Simple example, Next: Complex example, Up: Sample Configuration
+
+14.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-function org-html-publish-to-html
+ :publishing-directory "~/public_html"
+ :section-numbers nil
+ :with-toc nil
+ :html-head "<link rel=\"stylesheet\"
+ href=\"../other/mystyle.css\"
+ type=\"text/css\"/>")))
+
+
+File: org.info, Node: Complex example, Prev: Simple example, Up: Sample Configuration
+
+14.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 "<link rel=\"stylesheet\"
+ href=\"../other/mystyle.css\" type=\"text/css\"/>"
+ :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.info, Node: Triggering Publication, Prev: Sample Configuration, Up: Publishing
+
+14.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’ keywords.
+
+
+File: org.info, Node: Citation handling, Next: Working with Source Code, Prev: Publishing, Up: Top
+
+15 Citation handling
+********************
+
+The ‘oc.el’ library provides tooling to handle citations in Org via
+“citation processors” that offer some or all of the following
+capabilities:
+
+activate
+ Fontification, tooltip preview, etc.
+follow
+ At-point actions on citations via ‘org-open-at-point’.
+insert
+ Add and edit citations via ‘org-cite-insert’.
+export
+ Via different libraries for different target formats.
+
+ The user can configure these with ‘org-cite-activate-processor’,
+‘org-cite-follow-processor’, ‘org-cite-insert-processor’, and
+‘org-cite-export-processors’ respectively.
+
+ The included “basic” processor provides all four capabilities.
+
+* Menu:
+
+* Citations::
+* Citation export processors::
+
+
+File: org.info, Node: Citations, Next: Citation export processors, Up: Citation handling
+
+15.1 Citations
+==============
+
+Before adding citations, first set one-or-more bibliographies, either
+globally with ‘org-cite-global-bibliography’, or locally using one or
+more “bibliography” keywords.
+
+ #+bibliography: SomeFile.bib
+ #+bibliography: /some/other/file.json
+ #+bibliography: "/some/file/with spaces/in its name.bib"
+
+ One can then insert and edit citations using ‘org-cite-insert’,
+called with ‘C-c C-x @’.
+
+ A _citation_ requires one or more citation _key(s)_, elements
+identifying a reference in the bibliography.
+
+ • Each citation is surrounded by brackets and uses the ‘cite’ type.
+
+ • Each key starts with the character ‘@’.
+
+ • Each key can be qualified by a _prefix_ (e.g. “see ”) and/or a
+ _suffix_ (e.g. “p. 123”), giving information useful or necessary fo
+ the comprehension of the citation but not included in the
+ reference.
+
+ • A single citation can cite more than one reference ; the keys are
+ separated by semicolons ; the formatting of such citation groups is
+ specified by the style.
+
+ • One can also specify a stylistic variation for the citations by
+ inserting a ‘/’ and a style name between the ‘cite’ keyword and the
+ colon; this usually makes sense only for the author-year styles.
+
+ [cite/style:common prefix ;prefix @key suffix; ... ; common suffix]
+
+ The only mandatory elements are:
+
+ • The ‘cite’ keyword and the colon.
+ • The ‘@’ character immediately preceding each key.
+ • The brackets surrounding the citation(s) (group).
+
+
+File: org.info, Node: Citation export processors, Prev: Citations, Up: Citation handling
+
+15.2 Citation export processors
+===============================
+
+Org currently includes the following export processors:
+
+ • Two processors can export to a variety of formats, including
+ ‘latex’ (and therefore ‘pdf’), ‘html’, ‘odt’ and plain (UTF8) text:
+
+ basic
+ a basic export processor, well adapted to situations where
+ backward compatibility is not a requirement and formatting
+ needs are minimal;
+
+ csl
+ this export processor uses format files written in Citation
+ Style Language
+ (https://en.wikipedia.org/wiki/Citation_Style_Language) via
+ citeproc-el (https://github.com/andras-simonyi/citeproc-el);
+
+ • In contrast, two other processors target LaTeX and LaTeX-derived
+ formats exclusively:
+
+ natbib
+ this export processor uses BibTeX, the historical
+ bibliographic processor used with LaTeX, thus allowing the use
+ of data and style files compatible with this processor
+ (including a large number of publishers’ styles). It uses
+ citation commands implemented in the LaTeX package ‘natbib’,
+ allowing more stylistic variants that LaTeX’s ‘\cite’ command.
+
+ biblatex
+ this backend allows the use of data and formats prepared for
+ BibLaTeX, an alternate bibliographic processor used with
+ LaTeX, which overcomes some serious BibTeX limitations, but
+ has not (yet?) been widely adopted by publishers.
+
+ The ‘CITE_EXPORT’ keyword specifies the export processor and the
+citation (and possibly reference) style(s); for example (all arguments
+are optional)
+
+ #+cite_export: basic author author-year
+
+specifies the “basic” export processor with citations inserted as
+author’s name and references indexed by author’s names and year;
+
+ #+cite_export: csl /some/path/to/vancouver-brackets.csl
+
+specifies the “csl” processor and CSL style, which in this case defines
+numeric citations and numeric references according to the ‘Vancouver’
+specification (as style used in many medical journals), following a
+typesetting variation putting citations between brackets;
+
+ #+cite_export: natbib kluwer
+
+specifies the ‘natbib’ export processor with a label citation style
+conformant to the Harvard style and the specification of the
+Wolkers-Kluwer publisher; since it relies on the ‘bibtex’ processor of
+your LaTeX installation, it won’t export to anything but PDF.
+
+
+File: org.info, Node: Working with Source Code, Next: Miscellaneous, Prev: Citation handling, Up: Top
+
+16 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
+
+ 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’.
+
+ Details of Org’s facilities for working with source code are
+described in the following sections.
+
+* Menu:
+
+* Features Overview:: Enjoy the versatility of source blocks.
+* 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.info, Node: Features Overview, Next: Structure of Code Blocks, Up: Working with Source Code
+
+16.1 Features Overview
+======================
+
+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 the “liveliness” of each source code
+block by tweaking the header arguments (see *note Using Header
+Arguments::) for compiling, execution, extraction, and exporting.
+
+ 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.
+
+
+File: org.info, Node: Structure of Code Blocks, Next: Using Header Arguments, Prev: Features Overview, Up: Working with Source Code
+
+16.2 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: <name>
+ #+BEGIN_SRC <language> <switches> <header arguments>
+ <body>
+ #+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_<language>{<body>}
+
+or
+
+ src_<language>[<header arguments>]{<body>}
+
+‘#+NAME: <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.
+
+‘<language>’
+ Mandatory. It is the identifier of the source code language in the
+ block. See *note Languages::, for identifiers of supported
+ languages.
+
+‘<switches>’
+ Optional. Switches provide finer control of the code execution,
+ export, and format (see the discussion of switches in *note Literal
+ Examples::).
+
+‘<header arguments>’
+ 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.
+
+‘<body>’
+ Source code in the dialect of the specified language identifier.
+
+
+File: org.info, Node: Using Header Arguments, Next: Environment of a Code Block, Prev: Structure of Code Blocks, Up: Working with Source Code
+
+16.3 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:<LANG>’, where
+<LANG> is the name of the language. For details, see the
+language-specific online documentation at
+<https://orgmode.org/worg/org-contrib/babel/>.
+
+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:<LANG>’ where <LANG> 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.info, Node: Environment of a Code Block, Next: Evaluating Code Blocks, Prev: Using Header Arguments, Up: Working with Source Code
+
+16.4 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. ASSIGN may specify
+a filename for references to elements in a different file, using a ‘:’
+to separate the filename from the reference.
+
+ :var NAME=FILE:REFERENCE
+
+ 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 |
+
+ To refer to a table in another file, join the filename and table name
+with a colon, for example: ‘:var table=other-file.org:example-table’.
+
+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 DIRECTORY’
+temporarily has the same effect as changing the current directory with
+‘M-x cd <RET> DIRECTORY’, and then not setting ‘dir’. Under the
+surface, ‘dir’ simply sets the value of the Emacs variable
+‘default-directory’. Setting ‘mkdirp’ header argument to a non-‘nil’
+value creates the directory, if necessary.
+
+ 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.info, Node: Evaluating Code Blocks, Next: Results of Evaluation, Prev: Environment of a Code Block, Up: Working with Source Code
+
+16.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::.
+
+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: <name>(<arguments>)
+ #+CALL: <name>[<inside header arguments>](<arguments>) <end header arguments>
+
+ The syntax for inline named code blocks is:
+
+ ... call_<name>(<arguments>) ...
+ ... call_<name>[<inside header arguments>](<arguments>)[<end header arguments>] ...
+
+ 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.
+
+‘<name>’
+ 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 ‘<name>’ 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()
+
+‘<arguments>’
+ 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.
+
+‘<inside header arguments>’
+ 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>’
+ 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::).
+
+ 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_<name>()’ and ‘src_<lang>{}’ are
+not evaluated when they appear in a keyword (see *note In-buffer
+Settings::).
+
+
+File: org.info, Node: Results of Evaluation, Next: Exporting Code Blocks, Prev: Evaluating Code Blocks, Up: Working with Source Code
+
+16.6 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 results;
+
+Handling
+ For inserting results once they are properly formatted.
+
+Collection
+----------
+
+Collection options specify the results. Choose one of the options; they
+are mutually exclusive.
+
+‘value’
+ Default for most Babel libraries(1). 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 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.
+
+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’ header argument 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.
+
+ #+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’ is present but has no
+ value, the ‘file’ value is used as the link description. When this
+ argument is not present, the description is omitted. If you want
+ to provide the ‘file-desc’ argument but omit the description, you
+ can provide it with an empty vector (i.e., :file-desc []).
+
+ 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.
+
+ The ‘file-mode’ header argument defines the file permissions. To
+ make it executable, use ‘:file-mode (identity #o755)’.
+
+ #+BEGIN_SRC shell :results file :file script.sh :file-mode (identity #o755)
+ echo "#!/bin/bash"
+ echo "echo Hello World"
+ #+END_SRC
+
+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’
+ When used along with ‘file’ type, the result is a link to the file
+ specified in ‘:file’ header argument. However, unlike plain ‘file’
+ type, nothing is written to the disk. The block is used for its
+ side-effects only, as in the following example:
+
+ #+begin_src shell :results file link :file "download.tar.gz"
+ wget -c "https://example.com/download.tar.gz"
+ #+end_src
+
+‘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’.
+
+‘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 unconditionally 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
+ "<blink>Welcome back to the 90's</blink>"
+ #+END_SRC
+
+ #+RESULTS:
+ #+BEGIN_EXPORT markdown
+ <blink>Welcome back to the 90's</blink>
+ #+END_EXPORT
+
+Handling
+--------
+
+Handling options after collecting the results.
+
+‘replace’
+ Default. Insert results in the Org buffer. Remove previous
+ results. Usage example: ‘:results output replace’.
+
+‘silent’
+ Do not insert results in the Org mode buffer, but echo them in the
+ minibuffer. Usage example: ‘:results output silent’.
+
+‘none’
+ Do not process results at all. No inserting in the Org mode buffer
+ nor echo them in the minibuffer. Usage example: ‘:results none’.
+
+‘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) Actually, the constructs ‘call_<name>()’ and ‘src_<lang>{}’ are
+not evaluated when they appear in a keyword (see *note In-buffer
+Settings::).
+
+
+File: org.info, Node: Exporting Code Blocks, Next: Extracting Source Code, Prev: Results of Evaluation, Up: Working with Source Code
+
+16.7 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.info, Node: Extracting Source Code, Next: Languages, Prev: Exporting Code Blocks, Up: Working with Source Code
+
+16.8 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. A ‘yes’ value enables directory
+creation whereas ‘no’ inhibits it.
+
+ 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’.
+
+Tangle 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.info, Node: Languages, Next: Editing Source Code, Prev: Extracting Source Code, Up: Working with Source Code
+
+16.9 Languages
+==============
+
+Code blocks in dozens of languages are supported. See Worg for language
+specific documentation
+(https://orgmode.org/worg/org-contrib/babel/languages/index.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.info, Node: Editing Source Code, Next: Noweb Reference Syntax, Prev: Languages, Up: Working with Source Code
+
+16.10 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 ‘<LANG>-mode’ exists, where <LANG> 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.info, Node: Noweb Reference Syntax, Next: Library of Babel, Prev: Editing Source Code, Up: Working with Source Code
+
+16.11 Noweb Reference Syntax
+============================
+
+Source code blocks can include references to other source code blocks,
+using a noweb(1) style syntax:
+
+ <<CODE-BLOCK-ID>>
+
+where CODE-BLOCK-ID refers to either the ‘NAME’ of a single source code
+block, or a collection of one or more source code blocks sharing the
+same ‘noweb-ref’ header argument (see *note Using Header Arguments::).
+Org can replace such references with the source code of the block or
+blocks being referenced, or, in the case of a single source code block
+named with ‘NAME’, with the results of an evaluation of that block.
+
+ 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 most simple case, the contents of a single source block is
+inserted within other blocks. Thus, in following example,
+
+ #+NAME: initialization
+ #+BEGIN_SRC emacs-lisp
+ (setq sentence "Never a foot too far, even.")
+ #+END_SRC
+
+ #+BEGIN_SRC emacs-lisp :noweb yes
+ <<initialization>>
+ (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
+
+ You may also include the contents of multiple blocks sharing a common
+‘noweb-ref’ header argument, which can be set at the file, sub-tree, or
+code block 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
+ <<fullest-disk>>
+ #+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 use a different separator, edit the ‘noweb-sep’ header argument.
+
+ Alternatively, Org can include the results of evaluation of a single
+code block rather than its body. Evaluation occurs when parentheses,
+possibly including arguments, are appended to the code block name, as
+shown below.
+
+ <<NAME(optional arguments)>>
+
+ Note that in this case, a code block name set by ‘NAME’ keyword is
+required; the reference set by ‘noweb-ref’ will not work when evaluation
+is desired.
+
+ Here is an example that demonstrates how the exported content changes
+when noweb style references are used with parentheses versus without.
+Given:
+
+ #+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
+ <<some-code>>
+ #+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
+ <<some-code(num=10)>>
+ #+END_SRC
+
+Note that the expansion now contains the results of the code block
+‘some-code’, not the code block itself:
+
+ 100
+
+ Noweb insertions honor prefix characters that appear before the noweb
+syntax reference. This behavior is illustrated in the following
+example. Because the ‘<<example>>’ 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
+ ---<<example>>
+ #+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:
+ <<if-true>>
+ else:
+ <<if-false>>
+ #+end_src
+
+expands to:
+
+ if true:
+ print('do things when true')
+ else:
+ print('do things when false')
+
+ When in doubt about the outcome of a source code block expansion, you
+can preview the results with the following command:
+
+‘C-c C-v v’ or ‘C-c C-v C-v’ (‘org-babel-expand-src-block’)
+ Expand the current source code block according to its header
+ arguments and pop open the results in a preview buffer.
+
+ ---------- Footnotes ----------
+
+ (1) For noweb literate programming details, see
+<http://www.cs.tufts.edu/~nr/noweb/>.
+
+
+File: org.info, Node: Library of Babel, Next: Key bindings and Useful Functions, Prev: Noweb Reference Syntax, Up: Working with Source Code
+
+16.12 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.info, Node: Key bindings and Useful Functions, Next: Batch Execution, Prev: Library of Babel, Up: Working with Source Code
+
+16.13 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-<UP>’ ‘org-babel-load-in-session’
+‘M-<DOWN>’ ‘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.info, Node: Batch Execution, Prev: Key bindings and Useful Functions, Up: Working with Source Code
+
+16.14 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.info, Node: Miscellaneous, Next: Hacking, Prev: Working with Source Code, Up: Top
+
+17 Miscellaneous
+****************
+
+* Menu:
+
+* Completion:: ‘M-<TAB>’ guesses completions.
+* Structure Templates:: Quick insertion of structural elements.
+* Speed Keys:: Electric commands at the beginning of a headline.
+* Clean View:: Getting rid of leading stars in the outline.
+* Execute commands in the active region:: Execute commands on multiple items in Org or agenda view.
+* Dynamic Headline Numbering:: Display and update outline numbering.
+* The Very Busy C-c C-c Key:: When in doubt, press ‘C-c C-c’.
+* In-buffer Settings:: Overview of keywords.
+* Regular Expressions:: Elisp regular expressions.
+* Org Syntax:: Formal description of Org’s syntax.
+* Documentation Access:: Read documentation about current syntax.
+* Escape Character:: Prevent Org from interpreting your writing.
+* Code Evaluation Security:: Org files evaluate in-line code.
+* Interaction:: With other Emacs packages.
+* TTY Keys:: Using Org on a tty.
+* Protocols:: External access to Emacs and Org.
+* Org Crypt:: Encrypting Org files.
+* Org Mobile:: Viewing and capture on a mobile device.
+
+
+File: org.info, Node: Completion, Next: Structure Templates, Up: Miscellaneous
+
+17.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-<TAB>’
+
+ Complete word at point.
+
+ • At the beginning of an empty headline, complete TODO keywords.
+
+ • After ‘\’, complete TeX symbols supported by the exporter.
+
+ • 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 headlines in the current buffer so that
+ they can be used in search links like: ‘[[*find this
+ headline]]’
+
+ • After ‘#+’, complete the special keywords like ‘TYP_TODO’ or
+ file-specific ‘OPTIONS’. After option keyword is complete,
+ pressing ‘M-<TAB>’ 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.info, Node: Structure Templates, Next: Speed Keys, Prev: Completion, Up: Miscellaneous
+
+17.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 ‘<TAB>’, ‘<RET>’, or
+ ‘<SPC>’, 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 <TAB>’ 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.info, Node: Speed Keys, Next: Clean View, Prev: Structure Templates, Up: Miscellaneous
+
+17.3 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 option ‘org-speed-commands’. 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.info, Node: Clean View, Next: Execute commands in the active region, Prev: Speed Keys, Up: Miscellaneous
+
+17.4 A Cleaner Outline View
+===========================
+
+Org’s outline with stars and no indents can look 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 displays only one star
+and indents text to line up 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
+
+ Org can achieve this in two ways, (1) by just displaying the buffer
+in this way without changing it, or (2) by actually indenting every line
+in the desired amount with hard spaces and hiding leading stars.
+
+* Menu:
+
+* Org Indent Mode::
+* Hard indentation::
+
+
+File: org.info, Node: Org Indent Mode, Next: Hard indentation, Up: Clean View
+
+17.4.1 Org Indent Mode
+----------------------
+
+To display the buffer in the indented view, activate Org Indent minor
+mode, using ‘M-x org-indent-mode’. Text lines that are not headlines
+are prefixed with virtual spaces to vertically align with the headline
+text(1).
+
+ To make more horizontal space, the headlines are shifted by two
+characters. Configure ‘org-indent-indentation-per-level’ variable for a
+different number.
+
+ By default, Org Indent mode turns off ‘org-adapt-indentation’ and
+does hide leading stars by locally setting ‘org-hide-leading-stars’ to
+‘t’: only one star on each headline is visible, the rest are masked with
+the same font color as the background. If you want to customize this
+default behavior, see ‘org-indent-mode-turns-on-hiding-stars’ and
+‘org-indent-mode-turns-off-org-adapt-indentation’.
+
+ To globally turn on Org Indent mode for all files, customize the
+variable ‘org-startup-indented’. To control it for individual files,
+use ‘STARTUP’ keyword as follows:
+
+ #+STARTUP: indent
+ #+STARTUP: noindent
+
+ ---------- Footnotes ----------
+
+ (1) Org Indent mode also sets ‘wrap-prefix’ correctly for indenting
+and wrapping long lines of headlines or text. This minor mode also
+handles Visual Line mode and directly applied settings through
+‘word-wrap’.
+
+
+File: org.info, Node: Hard indentation, Prev: Org Indent Mode, Up: Clean View
+
+17.4.2 Hard indentation
+-----------------------
+
+It is possible to use hard spaces to achieve the indentation instead, if
+the bare ASCII file should have the indented look also outside Emacs(1).
+With Org’s support, you have to indent all lines to line up with the
+outline headers. You would use these settings(2):
+
+ (setq org-adapt-indentation t
+ org-hide-leading-stars t
+ org-odd-levels-only t)
+
+_Indentation of text below headlines_ (‘org-adapt-indentation’)
+ The first setting modifies paragraph filling, line wrapping, and
+ structure editing commands to preserving or adapting the
+ indentation as appropriate.
+
+_Hiding leading stars_ (‘org-hide-leading-stars’)
+ The second setting makes leading stars invisible by applying the
+ face ‘org-hide’ to them. For per-file preference, use these file
+ ‘STARTUP’ options:
+
+ #+STARTUP: hidestars
+ #+STARTUP: showstars
+
+_Odd levels_ (‘org-odd-levels-only’)
+ The third setting makes Org use only odd levels, 1, 3, 5, ..., in
+ the outline to create more indentation. On a per-file level,
+ control this with:
+
+ #+STARTUP: odd
+ #+STARTUP: oddeven
+
+ To convert a file between single and double stars layouts, use ‘M-x
+ org-convert-to-odd-levels’ and ‘M-x org-convert-to-oddeven-levels’.
+
+ ---------- Footnotes ----------
+
+ (1) This works, but requires extra effort. Org Indent mode is more
+convenient for most applications.
+
+ (2) ‘org-adapt-indentation’ can also be set to ‘'headline-data’, in
+which case only data lines below the headline will be indented.
+
+
+File: org.info, Node: Execute commands in the active region, Next: Dynamic Headline Numbering, Prev: Clean View, Up: Miscellaneous
+
+17.5 Execute commands in the active region
+==========================================
+
+When in an Org buffer and the region is active, some commands will apply
+to all the subtrees in the active region. For example, hitting ‘C-c
+C-s’ when multiple headlines are within the active region will
+successively prompt you for a new schedule date and time. To disable
+this, set the option ‘org-loop-over-headlines-in-active-region’ to
+non-‘t’, activate the region and run the command normally.
+
+ ‘org-agenda-loop-over-headlines-in-active-region’ is the equivalent
+option of the agenda buffer, where you can also use *note bulk editing
+of selected entries: Bulk remote editing selected entries.
+
+ Not all commands can loop in the active region and what subtrees or
+headlines are considered can be refined: see the docstrings of these
+options for more details.
+
+
+File: org.info, Node: Dynamic Headline Numbering, Next: The Very Busy C-c C-c Key, Prev: Execute commands in the active region, Up: Miscellaneous
+
+17.6 Dynamic Headline Numbering
+===============================
+
+The Org Num minor mode, toggled with ‘M-x org-num-mode’, displays
+outline numbering on top of headlines. It also updates it automatically
+upon changes to the structure of the document.
+
+ By default, all headlines are numbered. You can limit numbering to
+specific headlines according to their level, tags, ‘COMMENT’ keyword, or
+‘UNNUMBERED’ property. Set ‘org-num-max-level’, ‘org-num-skip-tags’,
+‘org-num-skip-commented’, ‘org-num-skip-unnumbered’, or
+‘org-num-skip-footnotes’ accordingly.
+
+ If ‘org-num-skip-footnotes’ is non-‘nil’, footnotes sections (see
+*note Creating Footnotes::) are not numbered either.
+
+ You can control how the numbering is displayed by setting
+‘org-num-face’ and ‘org-num-format-function’.
+
+ You can also turn this mode globally for all Org files by setting the
+option ‘org-startup-numerated’ to ‘t’, or locally on a file by using
+‘#+startup: num’.
+
+
+File: org.info, Node: The Very Busy C-c C-c Key, Next: In-buffer Settings, Prev: Dynamic Headline Numbering, Up: Miscellaneous
+
+17.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 throughout this manual, but here is a
+consolidated list for easy reference.
+
+ • If column view (see *note Column View::) is on, exit column view.
+
+ • 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.
+
+ • 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 ‘<<<target>>>’, 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.info, Node: In-buffer Settings, Next: Regular Expressions, Prev: The Very Busy C-c C-c Key, Up: Miscellaneous
+
+17.8 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
+ ‘showeverything’.
+
+ ‘overview’ Top-level headlines only.
+ ‘content’ All headlines.
+ ‘showall’ No folding on any entry.
+ ‘show2levels’ Headline levels 1-2.
+ ‘show3levels’ Headline levels 1-3.
+ ‘show4levels’ Headline levels 1-4.
+ ‘show5levels’ Headline levels 1-5.
+ ‘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.
+
+ Dynamic virtual numeration of headlines is controlled by the
+ variable ‘org-startup-numerated’.
+
+ ‘num’ Start with Org num mode turned on.
+ ‘nonum’ Start with Org num 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 as done.
+ ‘lognotedone’ Record timestamp and a note when DONE.
+ ‘nologdone’ Do not record when items are marked as 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.info, Node: Regular Expressions, Next: Org Syntax, Prev: In-buffer Settings, Up: Miscellaneous
+
+17.9 Regular Expressions
+========================
+
+Org, as an Emacs mode, makes use of Elisp regular expressions for
+searching, matching and filtering. Elisp regular expressions have a
+somewhat different syntax then some common standards. Most notably,
+alternation is indicated using ‘\|’ and matching groups are denoted by
+‘\(...\)’. For example the string ‘home\|work’ matches either ‘home’ or
+‘work’.
+
+ For more information, see *note Regular Expressions in Emacs:
+(emacs)Regexps.
+
+
+File: org.info, Node: Org Syntax, Next: Documentation Access, Prev: Regular Expressions, Up: Miscellaneous
+
+17.10 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) <RET>
+
+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 <RET>
+
+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’, ‘<TAB>’ Display the offending line
+‘<RET>’ 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.info, Node: Documentation Access, Next: Escape Character, Prev: Org Syntax, Up: Miscellaneous
+
+17.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.info, Node: Escape Character, Next: Code Evaluation Security, Prev: Documentation Access, Up: Miscellaneous
+
+17.12 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, i.e., a backslash in macros (see *note
+Macro Replacement::) and links (see *note Link Format::), or a comma in
+source and example blocks (see *note Literal Examples::). In the
+general case, however, we suggest to use the zero width space. You can
+insert one with any of the following:
+
+ C-x 8 <RET> zero width space <RET>
+ C-x 8 <RET> 200B <RET>
+
+ For example, in order to write ‘[[1,2]]’ as-is in your document, you
+may write instead
+
+ [X[1,2]]
+
+ where ‘X’ denotes the zero width space character.
+
+
+File: org.info, Node: Code Evaluation Security, Next: Interaction, Prev: Escape Character, Up: Miscellaneous
+
+17.13 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-link-shell-confirm-function
+ Function that prompts the user before executing a shell link.
+
+ -- User Option: org-link-elisp-confirm-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.info, Node: Interaction, Next: TTY Keys, Prev: Code Evaluation Security, Up: Miscellaneous
+
+17.14 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.info, Node: Cooperation, Next: Conflicts, Up: Interaction
+
+17.14.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 <http://www.astro.uva.nl/~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 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.info, Node: Conflicts, Prev: Cooperation, Up: Interaction
+
+17.14.2 Packages that conflict with Org mode
+--------------------------------------------
+
+In Emacs, shift-selection combines motions of point with shift key to
+enlarge regions. Emacs sets this mode by default. This conflicts with
+Org’s use of ‘S-<cursor>’ commands to change timestamps, TODO keywords,
+priorities, and item bullet types, etc. Since ‘S-<cursor>’ 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-<cursor>’ 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. 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-<cursor>’ 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-<cursor>’, 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 ‘<TAB>’ 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.info, Node: TTY Keys, Next: Protocols, Prev: Interaction, Up: Miscellaneous
+
+17.15 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-<cursor>’ for editing
+timestamp might be better with ‘C-c .’ chord.
+
+Default Alternative 1 Speed key Alternative 2
+----------------------------------------------------------------
+‘S-<TAB>’ ‘C-u <TAB>’ ‘C’
+‘M-<LEFT>’ ‘C-c C-x l’ ‘l’ ‘Esc <LEFT>’
+‘M-S-<LEFT>’ ‘C-c C-x L’ ‘L’
+‘M-<RIGHT>’ ‘C-c C-x r’ ‘r’ ‘Esc <RIGHT>’
+‘M-S-<RIGHT>’ ‘C-c C-x R’ ‘R’
+‘M-<UP>’ ‘C-c C-x u’ ‘Esc <UP>’
+‘M-S-<UP>’ ‘C-c C-x U’ ‘U’
+‘M-<DOWN>’ ‘C-c C-x d’ ‘Esc <DOWN>’
+‘M-S-<DOWN>’ ‘C-c C-x D’ ‘D’
+‘S-<RET>’ ‘C-c C-x c’
+‘M-<RET>’ ‘C-c C-x m’ ‘Esc <RET>’
+‘M-S-<RET>’ ‘C-c C-x M’
+‘S-<LEFT>’ ‘C-c <LEFT>’
+‘S-<RIGHT>’ ‘C-c <RIGHT>’
+‘S-<UP>’ ‘C-c <UP>’
+‘S-<DOWN>’ ‘C-c <DOWN>’
+‘C-S-<LEFT>’ ‘C-c C-x <LEFT>’
+‘C-S-<RIGHT>’ ‘C-c C-x <RIGHT>’
+
+
+File: org.info, Node: Protocols, Next: Org Crypt, Prev: TTY Keys, Up: Miscellaneous
+
+17.16 Protocols for External Access
+===================================
+
+Org protocol is a tool 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:
+
+* The store-link protocol:: Store a link, push URL to kill-ring.
+* The capture protocol:: Fill a buffer with external information.
+* The open-source protocol:: Edit published contents.
+
+
+File: org.info, Node: The store-link protocol, Next: The capture protocol, Up: Protocols
+
+17.16.1 The ‘store-link’ protocol
+---------------------------------
+
+Using the ‘store-link’ handler, you can copy links, to that they can be
+inserted using ‘M-x org-insert-link’ or yanking. 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?' +
+ new URLSearchParams({url:location.href, title:document.title});
+
+ Title is an optional parameter. Another expression was recommended
+earlier:
+
+ javascript:location.href='org-protocol://store-link?url='+
+ encodeURIComponent(location.href);
+
+ The latter form is compatible with older Org versions from 9.0 to
+9.4.
+
+
+File: org.info, Node: The capture protocol, Next: The open-source protocol, Prev: The store-link protocol, Up: Protocols
+
+17.16.2 The ‘capture’ protocol
+------------------------------
+
+Activating the “capture” handler pops up a ‘Capture’ buffer in Emacs,
+using acapture template.
+
+ 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?' +
+ new URLSearchParams({
+ template: 'x', url: window.location.href,
+ title: document.title, body: window.getSelection()});
+
+ You might have seen another expression:
+
+ javascript:location.href='org-protocol://capture?template=x'+
+ '&url='+encodeURIComponent(window.location.href)+
+ '&title='+encodeURIComponent(document.title)+
+ '&body='+encodeURIComponent(window.getSelection());
+
+ It is a bit more cluttered than the former one, but it is compatible
+with previous Org versions 9.0-9.4. In these versions encoding of space
+as “+” character was not supported by URI decoder.
+
+ The capture template to be used can be specified in the bookmark
+(like ‘X’ above). If unspecified, the template key is set in the
+variable ‘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.info, Node: The open-source protocol, Prev: The capture protocol, Up: Protocols
+
+17.16.3 The ‘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 always yield the desired results.
+Suppose you maintain an online store located at ‘https://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 ‘https://example.com/print/posters.html’ might be
+rewritten on the server to something like
+‘https://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 "https://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.info, Node: Org Crypt, Next: Org Mobile, Prev: Protocols, Up: Miscellaneous
+
+17.17 Org Crypt
+===============
+
+Org Crypt encrypts the text of an entry, but not the headline, or
+properties. Behind the scene, it uses the *note Emacs EasyPG Library:
+(epa)Top. to encrypt and decrypt files, and EasyPG needs a correct *note
+GnuPG: (gnupg)Top. setup.
+
+ 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.info, Node: Org Mobile, Prev: Org Crypt, Up: Miscellaneous
+
+17.18 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’, ‘org-tag-alist’ and
+‘org-tag-persistent-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.info, Node: Setting up the staging area, Next: Pushing to the mobile application, Up: Org Mobile
+
+17.18.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.info, Node: Pushing to the mobile application, Next: Pulling from the mobile application, Prev: Setting up the staging area, Up: Org Mobile
+
+17.18.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.info, Node: Pulling from the mobile application, Prev: Pushing to the mobile application, Up: Org Mobile
+
+17.18.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.info, 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:: 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.info, 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
+<https://orgmode.org/worg/doc.html#hooks>.
+
+
+File: org.info, 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. Some
+of these packages used to be part of the ‘org-mode’ repository but are
+now hosted in a separate ‘org-contrib’ repository here
+(https://git.sr.ht/~bzg/org-contrib). A Worg page with more information
+is at: <https://orgmode.org/worg/org-contrib/>.
+
+
+File: org.info, 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 ‘ol-man.el’ file implements it
+
+ ;;; ol-man.el - Support for links to man pages in Org mode
+ (require 'ol)
+
+ (org-link-set-parameters "man"
+ :follow #'org-man-open
+ :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-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 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-link-store-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&section=all" link))
+ (desc (or description link)))
+ (pcase format
+ (`html (format "<a target=\"_blank\" href=\"%s\">%s</a>" 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 ol-man)
+ ;;; ol-man.el ends here
+
+To activate links to man pages in Org, enter this in the Emacs init
+file:
+
+ (require 'ol-man)
+
+A review of ‘ol-man.el’:
+
+ 1. First, ‘(require 'ol)’ ensures that ‘ol.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.info, 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.info, 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.info, 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.info, 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) <https://www.ctan.org/pkg/comment>
+
+ (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.info, 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 <emacs-orgmode@gnu.org>.
+
+
+File: org.info, 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.
+
+ You can insert a dynamic block with
+‘org-dynamic-block-insert-dblock’, which is bound to ‘C-c C-x x’ by
+default. For example, ‘C-c C-x x c l o c k t a b l e <RET>’ inserts a
+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 as a plist. The previous
+content of the dynamic block becomes erased from the buffer and appended
+to the plist under ‘:content’.
+
+ The syntax for naming a writer function with a dynamic block labeled
+‘myblock’ is: ‘org-dblock-write:myblock’.
+
+ 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.info, 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.info, 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.info, 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.info, 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.info, 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.info, 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 <emacs-orgmode@gnu.org> 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 JavaScript program 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
+=========================
+
+ • Russell Adams came up with the idea for drawers.
+
+ • Thomas Baumann wrote ‘ol-bbdb.el’ and ‘ol-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 ‘ol-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.
+
+ • Timothy E Chapman worked on a complete overhaul of the orgmode.org
+ website in 2020 and helped fixing various bugs.
+
+ • 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 ‘ol-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.
+
+ • Kyle Meyer helped setting up the public-inbox
+ (https://public-inbox.org/) archive of the Org mailing list
+ (https://orgmode.org/list/) and has been fixing many bugs.
+
+ • 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.
+
+ • Ihor Radchenko helped with fixing bugs and improving the user
+ experience regarding Org’s speed.
+
+ • 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 the org-contrib
+ (https://git.sr.ht/~bzg/org-contrib) repository.
+
+ • 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 ‘ol-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 ‘ol-eww.el’.
+
+
+File: org.info, 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 Free Software Foundation, Inc.
+ <https://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
+ <https://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.
+
+C.1 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.info, Node: Main Index, Next: Key Index, Prev: GNU Free Documentation License, Up: Top
+
+D Main Index
+************
+
+
+* Menu:
+
+* *this*, in post header argument: Results of Evaluation.
+ (line 253)
+* + suffix, in properties: Property Syntax. (line 52)
+* _ALL suffix, in properties: Property Syntax. (line 50)
+* 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 46)
+* 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 496)
+* agenda filtering: Filtering/limiting agenda items.
+ (line 20)
+* 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 68)
+* ALT_TITLE, property <1>: Headings and sectioning structure.
+ (line 24)
+* angle bracket links: Link Format. (line 6)
+* angular brackets, around links: External Links. (line 136)
+* 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: Refiling and Archiving.
+ (line 6)
+* archiving <1>: 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: Capture and Attachments.
+ (line 6)
+* Atom feeds <1>: RSS Feeds. (line 6)
+* attach from Dired: Attach from Dired. (line 6)
+* attachment links: External Links. (line 6)
+* attachment links, searching: Search Options. (line 6)
+* attachments: Capture and Attachments.
+ (line 6)
+* attachments <1>: Attachments. (line 6)
+* 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_LATEX, keyword <6>: Verse blocks in LaTeX export.
+ (line 6)
+* ATTR_LATEX, keyword <7>: Quote blocks 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 clocking out after idle time: Resolving idle time. (line 91)
+* 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)
+* backslashes, in links: Link Format. (line 17)
+* backtrace of an error: Feedback. (line 68)
+* 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 36)
+* 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 13)
+* 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 38)
+* 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 45)
+* 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 180)
+* calculations, in tables <1>: The Spreadsheet. (line 6)
+* calendar commands, from agenda: Agenda Commands. (line 446)
+* calendar integration: Weekly/daily agenda. (line 32)
+* calendar, for selecting date: The date/time prompt.
+ (line 78)
+* 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 and Attachments.
+ (line 6)
+* capture <1>: Capture. (line 6)
+* capture protocol: The capture protocol.
+ (line 6)
+* capturing, from agenda: Agenda Commands. (line 345)
+* category: Categories. (line 6)
+* category filtering, in agenda: Filtering/limiting agenda items.
+ (line 20)
+* category, for tags/property match: Matching tags and properties.
+ (line 65)
+* 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 60)
+* change agenda display: Agenda Commands. (line 63)
+* checkbox blocking: Checkboxes. (line 45)
+* checkbox statistics: Checkboxes. (line 29)
+* 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)
+* citation: Citation handling. (line 6)
+* CLASS, property: iCalendar Export. (line 51)
+* 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 32)
+* CLOCKSUM_T, special property: Special Properties. (line 13)
+* CLOCKSUM_T, special property <1>: Agenda Column View. (line 56)
+* clocktable, dynamic block: The clock table. (line 6)
+* CLOCK_MODELINE_TOTAL, property: Clocking commands. (line 21)
+* 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 52)
+* 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 90)
+* COLUMNS, keyword: Scope of column definitions.
+ (line 18)
+* COLUMNS, property: Property Inheritance.
+ (line 22)
+* COLUMNS, property <1>: In-buffer Settings. (line 23)
+* comma escape, in literal examples: Literal Examples. (line 14)
+* 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 94)
+* completion, of link abbreviations: Completion. (line 6)
+* completion, of links: Handling Links. (line 71)
+* 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 114)
+* CONSTANTS, keyword: References. (line 114)
+* 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 29)
+* coordinates, of field: References. (line 90)
+* copying notes: Refiling and Archiving.
+ (line 6)
+* copying notes <1>: 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)
+* CUSTOM_ID, property: Internal Links. (line 11)
+* 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 455)
+* 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 309)
+* DIR, property: Attachment defaults and dispatcher.
+ (line 68)
+* DIR, property <1>: Attachment defaults and dispatcher.
+ (line 73)
+* 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 items.
+ (line 20)
+* 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)
+* enum, Texinfo attribute: Plain lists in Texinfo export.
+ (line 35)
+* epilogue, header argument: Environment of a Code Block.
+ (line 359)
+* 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 90)
+* 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 94)
+* file, header argument: Results of Evaluation.
+ (line 119)
+* FILE, special property: Special Properties. (line 13)
+* file-desc, header argument: Results of Evaluation.
+ (line 140)
+* file-ext, header argument: Results of Evaluation.
+ (line 129)
+* file-mode, header argument: Results of Evaluation.
+ (line 151)
+* 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 items.
+ (line 20)
+* 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 104)
+* footers, in code blocks: Environment of a Code Block.
+ (line 351)
+* 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 31)
+* 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 180)
+* 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 58)
+* 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 351)
+* headline navigation: Motion. (line 6)
+* headline tagging: Tags. (line 6)
+* headline, promotion and demotion: Structure Editing. (line 6)
+* headlines: Headlines. (line 6)
+* headlines, in HTML export: Headlines in HTML export.
+ (line 6)
+* Help links: External Links. (line 6)
+* hide text: Visibility Cycling. (line 6)
+* hiding leading stars: Clean View. (line 6)
+* hlines, header argument: Results of Evaluation.
+ (line 69)
+* hooks: Hooks. (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 13)
+* html-style, OPTIONS item: CSS support. (line 56)
+* HTML5, export new elements: HTML doctypes. (line 25)
+* HTML_CONTAINER, keyword: HTML specific export settings.
+ (line 22)
+* HTML_CONTAINER_CLASS, property: CSS support. (line 62)
+* HTML_DOCTYPE, keyword: HTML specific export settings.
+ (line 19)
+* HTML_HEAD, keyword: HTML specific export settings.
+ (line 38)
+* HTML_HEAD, keyword <1>: CSS support. (line 49)
+* HTML_HEADLINE_CLASS, property: CSS support. (line 62)
+* HTML_HEAD_EXTRA, keyword: HTML specific export settings.
+ (line 42)
+* 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 26)
+* HTML_LINK_UP, keyword: HTML specific export settings.
+ (line 29)
+* HTML_MATHJAX, keyword: HTML specific export settings.
+ (line 33)
+* 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 60)
+* 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: Org Indent Mode. (line 6)
+* indentation, in code blocks: Editing Source Code. (line 32)
+* indentation, in source blocks: Literal Examples. (line 81)
+* index, in a publishing project: Generating an index. (line 6)
+* INDEX, keyword: Generating an index. (line 17)
+* INDEX, property: Indices. (line 14)
+* indic, Texinfo attribute: Plain lists in Texinfo export.
+ (line 12)
+* 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 19)
+* 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 71)
+* 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 46)
+* 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 21)
+* 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 51)
+* 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)
+* lettered lists, in Texinfo export: Plain lists in Texinfo export.
+ (line 35)
+* level, for tags/property match: Matching tags and properties.
+ (line 65)
+* LibreOffice: OpenDocument Text Export.
+ (line 6)
+* limits, in agenda: Filtering/limiting agenda items.
+ (line 129)
+* 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 71)
+* link format: Link Format. (line 6)
+* LINK, keyword: Link Abbreviations. (line 49)
+* LINK, keyword <1>: In-buffer Settings. (line 38)
+* links, external: External Links. (line 6)
+* links, finding next/previous: Handling Links. (line 153)
+* 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 146)
+* 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 45)
+* 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: The open-source protocol.
+ (line 67)
+* mark ring: Handling Links. (line 141)
+* 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: Environment of a Code Block.
+ (line 309)
+* mkdirp, header argument <1>: 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 135)
+* NAME, keyword <1>: Internal Links. (line 21)
+* name, of column or field: References. (line 114)
+* name, of column or field <1>: References. (line 135)
+* named references: References. (line 114)
+* 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 18)
+* noweb-ref, header argument: Noweb Reference Syntax.
+ (line 6)
+* noweb-sep, header argument: Noweb Reference Syntax.
+ (line 96)
+* number headlines: Dynamic Headline Numbering.
+ (line 6)
+* 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: The 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 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 45)
+* Org export: Org Export. (line 6)
+* Org mode, turning on: Activation. (line 24)
+* Org Num mode: Dynamic Headline Numbering.
+ (line 6)
+* Org protocol, set-up: Protocols. (line 14)
+* org-agenda, command: Weekly/daily agenda. (line 10)
+* org-latex-default-quote-environment: Quote blocks in LaTeX export.
+ (line 6)
+* 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 119)
+* 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 136)
+* plot tables using Gnuplot: Org Plot. (line 6)
+* PLOT, keyword: Org Plot. (line 12)
+* post, header argument: Results of Evaluation.
+ (line 253)
+* 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 52)
+* 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 351)
+* 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 50)
+* PROPERTY, keyword <1>: In-buffer Settings. (line 48)
+* property, macro: Macro Replacement. (line 68)
+* protocol, capture: The capture protocol.
+ (line 6)
+* protocol, new protocol: Protocols. (line 25)
+* protocol, open-source: The open-source protocol.
+ (line 6)
+* protocol, open-source rewritten URL: The open-source protocol.
+ (line 32)
+* protocol, open-source, set-up mapping: The open-source protocol.
+ (line 67)
+* protocol, store-link: The store-link protocol.
+ (line 6)
+* protocols, for external access: Capture and Attachments.
+ (line 6)
+* protocols, for external access <1>: Protocols. (line 6)
+* publishing: Publishing. (line 6)
+* publishing options: Publishing options. (line 6)
+* query editing, in agenda: Filtering/limiting agenda items.
+ (line 20)
+* quote blocks: Paragraphs. (line 25)
+* quote blocks, in LaTeX export: Quote blocks in LaTeX export.
+ (line 6)
+* radio button, checkbox as: Checkboxes. (line 75)
+* 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 114)
+* references, remote: References. (line 135)
+* references, to a different table: References. (line 135)
+* references, to fields: References. (line 15)
+* references, to ranges: References. (line 64)
+* refiling notes: Refiling and Archiving.
+ (line 6)
+* refiling notes <1>: Refile and Copy. (line 6)
+* refresh set-up: In-buffer Settings. (line 11)
+* region, active: Structure Editing. (line 46)
+* regular expressions syntax: Regular Expressions. (line 6)
+* regular expressions, in searches: Regular Expressions. (line 6)
+* 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 352)
+* remote editing, from agenda: Agenda Commands. (line 223)
+* remote editing, undo: Agenda Commands. (line 227)
+* remote references: References. (line 135)
+* 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 43)
+* rewritten URL in open-source protocol: The 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 90)
+* rownames, header argument: Environment of a Code Block.
+ (line 77)
+* RSS feeds: Capture and Attachments.
+ (line 6)
+* RSS feeds <1>: 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 147)
+* sep, Texinfo attribute: Plain lists in Texinfo export.
+ (line 17)
+* SEQ_TODO, keyword: Per-file keywords. (line 6)
+* SEQ_TODO, keyword <1>: In-buffer Settings. (line 190)
+* session, header argument: Environment of a Code Block.
+ (line 279)
+* 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: Conflicts. (line 6)
+* shift-selection-mode: Plain Lists. (line 95)
+* show all, command: Global and local cycling.
+ (line 40)
+* show all, global visibility state: Global and local cycling.
+ (line 20)
+* show branches, command: Global and local cycling.
+ (line 52)
+* 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 38)
+* 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 35)
+* 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, around links: External Links. (line 136)
+* startup visibility: Global and local cycling.
+ (line 36)
+* STARTUP, keyword: Initial visibility. (line 11)
+* STARTUP, keyword <1>: Blocks. (line 14)
+* STARTUP, keyword <2>: In-buffer Settings. (line 65)
+* statistics, for checkboxes: Checkboxes. (line 29)
+* statistics, for TODO items: Breaking Down Tasks. (line 6)
+* store-link protocol: The store-link protocol.
+ (line 6)
+* storing link, in a source code buffer: Literal Examples. (line 111)
+* 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 56)
+* 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 148)
+* 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-type, Texinfo attribute: 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 items.
+ (line 20)
+* 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 183)
+* 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 17)
+* 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 65)
+* 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 190)
+* TODO, special property: Special Properties. (line 13)
+* todo-tree: Storing searches. (line 11)
+* top headline filtering, in agenda: Filtering/limiting agenda items.
+ (line 20)
+* Top node, in Texinfo export: Headings and sectioning structure.
+ (line 37)
+* transient mark mode: Structure Editing. (line 46)
+* 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 190)
+* 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 279)
+* 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)
+* 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)
+* verse blocks, in LaTeX export: Verse blocks in LaTeX export.
+ (line 6)
+* 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 20)
+* visible text, printing: Sparse Trees. (line 52)
+* VM links: External Links. (line 109)
+* Wanderlust links: External Links. (line 109)
+* 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 309)
+* wrap, header argument: Results of Evaluation.
+ (line 208)
+* 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.info, Node: Key Index, Next: Command and Function Index, Prev: Main Index, Up: Top
+
+E Key Index
+***********
+
+
+* Menu:
+
+* !: Setting Tags. (line 127)
+* ! (Agenda dispatcher): Stuck projects. (line 17)
+* # (Agenda dispatcher): Stuck projects. (line 14)
+* $: Agenda Commands. (line 265)
+* %: Agenda Commands. (line 379)
+* ': CDLaTeX mode. (line 57)
+* *: Agenda Commands. (line 359)
+* * (Agenda dispatcher): Agenda Dispatcher. (line 55)
+* +: Agenda Commands. (line 284)
+* ,: Agenda Commands. (line 279)
+* -: Agenda Commands. (line 289)
+* .: The date/time prompt.
+ (line 84)
+* . <1>: Agenda Commands. (line 118)
+* / (Agenda dispatcher): Agenda Dispatcher. (line 30)
+* 1..9,0: Using column view. (line 35)
+* :: Agenda Commands. (line 275)
+* <: Using column view. (line 67)
+* < <1>: The date/time prompt.
+ (line 84)
+* < (Agenda dispatcher): Agenda Dispatcher. (line 43)
+* < < (Agenda dispatcher): Agenda Dispatcher. (line 49)
+* >: Using column view. (line 67)
+* > <1>: The date/time prompt.
+ (line 84)
+* > <2>: Agenda Commands. (line 328)
+* ? (Agenda dispatcher): Pulling from the mobile application.
+ (line 39)
+* [: Agenda Commands. (line 142)
+* ^: CDLaTeX mode. (line 43)
+* _: CDLaTeX mode. (line 43)
+* `: CDLaTeX mode. (line 51)
+* a: Using column view. (line 57)
+* A: Agenda Commands. (line 64)
+* a <1>: Agenda Commands. (line 252)
+* a (Agenda dispatcher): Weekly/daily agenda. (line 10)
+* b: Agenda Commands. (line 115)
+* B: Agenda Commands. (line 383)
+* C: Resolving idle time. (line 46)
+* c: Agenda Commands. (line 447)
+* c <1>: Agenda Commands. (line 450)
+* C <1>: Agenda Commands. (line 481)
+* 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-.: The date/time prompt.
+ (line 84)
+* C-0 C-c C-w: Refile and Copy. (line 46)
+* C-2 C-c C-w: Refile and Copy. (line 38)
+* C-3 C-c C-w: Refile and Copy. (line 41)
+* C-c !: Creating Timestamps. (line 25)
+* C-c #: Checkboxes. (line 98)
+* C-c $: Moving subtrees. (line 10)
+* C-c %: Handling Links. (line 141)
+* C-c &: Handling Links. (line 146)
+* C-c ': Editing and debugging formulas.
+ (line 37)
+* C-c ' <1>: Literal Examples. (line 102)
+* C-c ' <2>: Include Files. (line 63)
+* C-c ' <3>: Editing Source Code. (line 6)
+* C-c ' <4>: Cooperation. (line 59)
+* C-c *: Structure Editing. (line 129)
+* C-c * <1>: Plain Lists. (line 143)
+* C-c * <2>: Updating the table. (line 14)
+* C-c +: Built-in Table Editor.
+ (line 181)
+* C-c ,: Priorities. (line 33)
+* C-c -: Plain Lists. (line 131)
+* C-c - <1>: Built-in Table Editor.
+ (line 126)
+* 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 35)
+* 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 66)
+* C-c C-*: Plain Lists. (line 148)
+* C-c C-,: Structure Templates. (line 11)
+* C-c C-a: Attachment defaults and dispatcher.
+ (line 20)
+* C-c C-a <1>: Agenda Commands. (line 300)
+* C-c C-a a: Attachment defaults and dispatcher.
+ (line 25)
+* C-c C-a b: Attachment defaults and dispatcher.
+ (line 35)
+* C-c C-a c: Attachment defaults and dispatcher.
+ (line 31)
+* C-c C-a d: Attachment defaults and dispatcher.
+ (line 61)
+* C-c C-a D: Attachment defaults and dispatcher.
+ (line 64)
+* C-c C-a f: Attachment defaults and dispatcher.
+ (line 55)
+* C-c C-a F: Attachment defaults and dispatcher.
+ (line 58)
+* C-c C-a l: Attachment defaults and dispatcher.
+ (line 31)
+* C-c C-a m: Attachment defaults and dispatcher.
+ (line 31)
+* C-c C-a n: Attachment defaults and dispatcher.
+ (line 39)
+* C-c C-a o: Attachment defaults and dispatcher.
+ (line 46)
+* C-c C-a O: Attachment defaults and dispatcher.
+ (line 52)
+* C-c C-a s: Attachment defaults and dispatcher.
+ (line 68)
+* C-c C-a S: Attachment defaults and dispatcher.
+ (line 73)
+* C-c C-a z: Attachment defaults and dispatcher.
+ (line 42)
+* 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>: Built-in Table Editor.
+ (line 60)
+* C-c C-c <2>: Column Width and Alignment.
+ (line 17)
+* C-c C-c <3>: Editing and debugging formulas.
+ (line 45)
+* C-c C-c <4>: Editing and debugging formulas.
+ (line 91)
+* C-c C-c <5>: Editing and debugging formulas.
+ (line 98)
+* C-c C-c <6>: Checkboxes. (line 52)
+* C-c C-c <7>: Setting Tags. (line 20)
+* C-c C-c <8>: Setting Tags. (line 131)
+* C-c C-c <9>: Property Syntax. (line 100)
+* C-c C-c <10>: Using column view. (line 26)
+* C-c C-c <11>: Using column view. (line 49)
+* C-c C-c <12>: Capturing column view.
+ (line 80)
+* C-c C-c <13>: Creating Timestamps. (line 29)
+* C-c C-c <14>: Clocking commands. (line 53)
+* C-c C-c <15>: The clock table. (line 20)
+* C-c C-c <16>: Creating Footnotes. (line 65)
+* C-c C-c <17>: Evaluating Code Blocks.
+ (line 22)
+* C-c C-c <18>: Key bindings and Useful Functions.
+ (line 11)
+* C-c C-c <19>: 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 117)
+* C-c C-c d: Property Syntax. (line 111)
+* C-c C-c D: Property Syntax. (line 114)
+* 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 103)
+* C-c C-d: Inserting deadline/schedule.
+ (line 10)
+* C-c C-d <1>: Agenda Commands. (line 307)
+* 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: Sparse Trees. (line 52)
+* C-c C-e C-v <1>: The Export Dispatcher.
+ (line 64)
+* C-c C-e h h: HTML export commands.
+ (line 7)
+* C-c C-e h H: HTML export commands.
+ (line 13)
+* 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 a: Triggering Publication.
+ (line 19)
+* C-c C-e P f: Triggering Publication.
+ (line 16)
+* C-c C-e P p: Triggering Publication.
+ (line 13)
+* C-c C-e P x: Triggering Publication.
+ (line 9)
+* 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-f: Motion. (line 15)
+* C-c C-j: Motion. (line 24)
+* C-c C-k: Global and local cycling.
+ (line 52)
+* C-c C-k (Capture buffer): Using capture. (line 31)
+* C-c C-l: Handling Links. (line 71)
+* C-c C-M-w: Refile and Copy. (line 55)
+* C-c C-n: Motion. (line 9)
+* C-c C-o: Handling Links. (line 108)
+* C-c C-o <1>: Creating Timestamps. (line 40)
+* C-c C-o <2>: Agenda Commands. (line 56)
+* C-c C-o <3>: Creating Footnotes. (line 71)
+* 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 43)
+* 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 303)
+* C-c C-t: TODO Basics. (line 14)
+* C-c C-t <1>: Clocking commands. (line 71)
+* 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: Noweb Reference Syntax.
+ (line 202)
+* C-c C-v C-v <1>: 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: Noweb Reference Syntax.
+ (line 202)
+* C-c C-v v <1>: 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 104)
+* C-c C-w <1>: Refile and Copy. (line 13)
+* C-c C-w <2>: Agenda Commands. (line 249)
+* 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 @: Citations. (line 14)
+* 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 257)
+* C-c C-x A <1>: Agenda Commands. (line 261)
+* 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 96)
+* C-c C-x C-a: Archiving. (line 12)
+* C-c C-x C-a <1>: Agenda Commands. (line 252)
+* C-c C-x C-b: Checkboxes. (line 58)
+* 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 84)
+* C-c C-x C-e: Clocking commands. (line 50)
+* C-c C-x C-e <1>: Effort Estimates. (line 24)
+* C-c C-x C-i: Clocking commands. (line 7)
+* C-c C-x C-j: Clocking commands. (line 79)
+* C-c C-x C-l: Previewing LaTeX fragments.
+ (line 18)
+* C-c C-x C-n: Handling Links. (line 153)
+* C-c C-x C-o: Clocking commands. (line 36)
+* C-c C-x C-p: Handling Links. (line 153)
+* C-c C-x C-q: Clocking commands. (line 75)
+* C-c C-x C-r: Checkboxes. (line 75)
+* C-c C-x C-s: Moving subtrees. (line 10)
+* C-c C-x C-s <1>: Agenda Commands. (line 265)
+* C-c C-x C-t: Custom time format. (line 13)
+* C-c C-x C-u: Capturing column view.
+ (line 80)
+* C-c C-x C-u <1>: The clock table. (line 20)
+* C-c C-x C-u <2>: Dynamic Blocks. (line 25)
+* C-c C-x C-v: Images. (line 24)
+* C-c C-x C-w: Structure Editing. (line 70)
+* C-c C-x C-w <1>: Built-in Table Editor.
+ (line 157)
+* C-c C-x C-x: Clocking commands. (line 44)
+* C-c C-x C-y: Structure Editing. (line 78)
+* C-c C-x C-y <1>: Built-in Table Editor.
+ (line 161)
+* C-c C-x d: Drawers. (line 18)
+* C-c C-x e: Effort Estimates. (line 19)
+* C-c C-x e <1>: Agenda Commands. (line 292)
+* C-c C-x f: Creating Footnotes. (line 42)
+* C-c C-x g: RSS Feeds. (line 23)
+* C-c C-x G: RSS Feeds. (line 27)
+* C-c C-x I: Documentation Access.
+ (line 6)
+* C-c C-x M-w: Structure Editing. (line 74)
+* C-c C-x M-w <1>: Built-in Table Editor.
+ (line 151)
+* C-c C-x o: TODO dependencies. (line 38)
+* C-c C-x o <1>: Checkboxes. (line 90)
+* C-c C-x p: Property Syntax. (line 90)
+* C-c C-x p <1>: Using Header Arguments.
+ (line 70)
+* C-c C-x q: Tag Hierarchy. (line 87)
+* C-c C-x v: Global and local cycling.
+ (line 65)
+* C-c C-x x: Capturing column view.
+ (line 72)
+* C-c C-x x <1>: The clock table. (line 11)
+* C-c C-x x <2>: Dynamic Blocks. (line 10)
+* C-c C-x \: Subscripts and Superscripts.
+ (line 27)
+* 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 53)
+* C-c C-z: Drawers. (line 39)
+* C-c C-z <1>: Agenda Commands. (line 295)
+* C-c M-w: Refile and Copy. (line 51)
+* C-c RET: Built-in Table Editor.
+ (line 130)
+* 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 108)
+* C-c ^ <1>: Plain Lists. (line 159)
+* C-c ^ <2>: Built-in Table Editor.
+ (line 134)
+* C-c `: Built-in Table Editor.
+ (line 202)
+* C-c {: Editing and debugging formulas.
+ (line 34)
+* C-c { <1>: CDLaTeX mode. (line 25)
+* C-c |: Built-in Table Editor.
+ (line 42)
+* C-c | <1>: Built-in Table Editor.
+ (line 221)
+* 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 121)
+* C-k: Agenda Commands. (line 243)
+* C-RET: Structure Editing. (line 26)
+* C-S-DOWN: Clocking commands. (line 59)
+* C-S-LEFT: Multiple sets in one file.
+ (line 28)
+* C-S-LEFT <1>: Agenda Commands. (line 240)
+* C-S-RET: Structure Editing. (line 33)
+* C-S-RIGHT: Multiple sets in one file.
+ (line 28)
+* C-S-RIGHT <1>: Agenda Commands. (line 237)
+* C-S-UP: Clocking commands. (line 59)
+* 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 94)
+* C-u C-c C-t: Progress Logging. (line 10)
+* C-u C-c C-w: Refile and Copy. (line 32)
+* 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 84)
+* C-u C-c C-x C-u <1>: The clock table. (line 24)
+* C-u C-c C-x C-u <2>: Dynamic Blocks. (line 28)
+* 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 35)
+* 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-w: Refile and Copy. (line 46)
+* C-u C-u C-u C-u C-c C-t: TODO dependencies. (line 46)
+* C-u C-u C-u TAB: Global and local cycling.
+ (line 40)
+* C-u C-u TAB: Global and local cycling.
+ (line 36)
+* C-u C-u TAB <1>: Initial visibility. (line 26)
+* C-u TAB: Global and local cycling.
+ (line 20)
+* C-v: The date/time prompt.
+ (line 84)
+* 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 123)
+* C-x n s: Structure Editing. (line 120)
+* C-x n w: Structure Editing. (line 126)
+* C-y: Structure Editing. (line 84)
+* 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 <1>: Agenda Commands. (line 292)
+* 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 485)
+* I: Agenda Commands. (line 332)
+* i: Agenda Commands. (line 454)
+* j: Agenda Commands. (line 121)
+* J: Agenda Commands. (line 124)
+* J <1>: Agenda Commands. (line 342)
+* k: Resolving idle time. (line 23)
+* K: Resolving idle time. (line 29)
+* k <1>: Agenda Commands. (line 345)
+* k c (Agenda): Using capture. (line 33)
+* l: Agenda Commands. (line 131)
+* m: Agenda Commands. (line 353)
+* M: Agenda Commands. (line 472)
+* 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 375)
+* M-a: Built-in Table Editor.
+ (line 78)
+* M-DOWN: Structure Editing. (line 63)
+* M-DOWN <1>: Plain Lists. (line 102)
+* M-DOWN <2>: Built-in Table Editor.
+ (line 104)
+* 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 44)
+* M-LEFT <1>: Plain Lists. (line 108)
+* M-LEFT <2>: Built-in Table Editor.
+ (line 88)
+* M-m: Agenda Commands. (line 371)
+* M-RET: Structure Editing. (line 7)
+* M-RET <1>: Plain Lists. (line 83)
+* M-RET <2>: Built-in Table Editor.
+ (line 168)
+* M-RET <3>: Timers. (line 40)
+* M-RIGHT: Structure Editing. (line 44)
+* M-RIGHT <1>: Plain Lists. (line 108)
+* M-RIGHT <2>: Built-in Table Editor.
+ (line 91)
+* M-S-DOWN: Built-in Table Editor.
+ (line 122)
+* M-S-DOWN <1>: Editing and debugging formulas.
+ (line 74)
+* M-S-LEFT: Structure Editing. (line 54)
+* 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 84)
+* M-S-RET: Structure Editing. (line 29)
+* M-S-RET <1>: Plain Lists. (line 91)
+* M-S-RET <2>: Checkboxes. (line 86)
+* M-S-RIGHT: Structure Editing. (line 57)
+* 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 84)
+* M-S-UP: Built-in Table Editor.
+ (line 107)
+* 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 86)
+* M-TAB <4>: Completion. (line 15)
+* M-UP: Structure Editing. (line 60)
+* M-UP <1>: Plain Lists. (line 102)
+* M-UP <2>: Built-in Table Editor.
+ (line 101)
+* 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 84)
+* mouse-1: Handling Links. (line 133)
+* mouse-1 <1>: The date/time prompt.
+ (line 84)
+* mouse-1 <2>: Creating Footnotes. (line 71)
+* mouse-2: Handling Links. (line 133)
+* mouse-2 <1>: Agenda Commands. (line 36)
+* mouse-2 <2>: Creating Footnotes. (line 71)
+* mouse-3: Handling Links. (line 137)
+* 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 336)
+* p: Using column view. (line 39)
+* p <1>: Agenda Commands. (line 23)
+* q: Setting Tags. (line 124)
+* q <1>: Using column view. (line 26)
+* q <2>: Agenda Commands. (line 491)
+* 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 129)
+* RET <2>: Setting Tags. (line 118)
+* RET <3>: The date/time prompt.
+ (line 84)
+* 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 476)
+* s (Agenda dispatcher): Agenda Dispatcher. (line 25)
+* s (Agenda dispatcher) <1>: Search view. (line 10)
+* S-DOWN: Plain Lists. (line 95)
+* S-DOWN <1>: Built-in Table Editor.
+ (line 113)
+* S-DOWN <2>: Editing and debugging formulas.
+ (line 66)
+* S-DOWN <3>: Priorities. (line 41)
+* S-DOWN <4>: Creating Timestamps. (line 50)
+* S-DOWN <5>: The date/time prompt.
+ (line 84)
+* S-DOWN <6>: Agenda Commands. (line 289)
+* S-LEFT: Plain Lists. (line 154)
+* S-LEFT <1>: Built-in Table Editor.
+ (line 116)
+* S-LEFT <2>: Editing and debugging formulas.
+ (line 66)
+* S-LEFT <3>: TODO Basics. (line 28)
+* S-LEFT <4>: Multiple sets in one file.
+ (line 36)
+* S-LEFT <5>: Property Syntax. (line 108)
+* S-LEFT <6>: Using column view. (line 39)
+* S-LEFT <7>: Creating Timestamps. (line 45)
+* S-LEFT <8>: The date/time prompt.
+ (line 84)
+* S-LEFT <9>: The clock table. (line 29)
+* S-LEFT <10>: Agenda Commands. (line 324)
+* S-M-DOWN: Clocking commands. (line 64)
+* S-M-LEFT: Using column view. (line 73)
+* S-M-RET: TODO Basics. (line 54)
+* S-M-RIGHT: Using column view. (line 70)
+* S-M-UP: Clocking commands. (line 64)
+* S-RET: Built-in Table Editor.
+ (line 186)
+* S-RIGHT: Plain Lists. (line 154)
+* S-RIGHT <1>: Built-in Table Editor.
+ (line 119)
+* S-RIGHT <2>: Editing and debugging formulas.
+ (line 66)
+* S-RIGHT <3>: TODO Basics. (line 28)
+* S-RIGHT <4>: Multiple sets in one file.
+ (line 36)
+* S-RIGHT <5>: Property Syntax. (line 108)
+* S-RIGHT <6>: Using column view. (line 39)
+* S-RIGHT <7>: Creating Timestamps. (line 45)
+* S-RIGHT <8>: The date/time prompt.
+ (line 84)
+* S-RIGHT <9>: The clock table. (line 29)
+* S-RIGHT <10>: Agenda Commands. (line 311)
+* 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>: Built-in Table Editor.
+ (line 110)
+* S-UP <2>: Editing and debugging formulas.
+ (line 66)
+* S-UP <3>: Priorities. (line 41)
+* S-UP <4>: Creating Timestamps. (line 50)
+* S-UP <5>: The date/time prompt.
+ (line 84)
+* S-UP <6>: Agenda Commands. (line 284)
+* SPC: Setting Tags. (line 115)
+* SPC <1>: Agenda Commands. (line 29)
+* t: Agenda Commands. (line 231)
+* T: Agenda Commands. (line 270)
+* t (Agenda dispatcher): TODO Basics. (line 46)
+* 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 29)
+* u: Agenda Commands. (line 363)
+* U: Agenda Commands. (line 367)
+* v: Using column view. (line 53)
+* 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 339)
+* x: Agenda Commands. (line 495)
+* z: Agenda Commands. (line 295)
+
+
+File: org.info, Node: Command and Function Index, Next: Variable Index, Prev: Key Index, Up: Top
+
+F Command and Function Index
+****************************
+
+
+* Menu:
+
+* lisp-complete-symbol: Editing and debugging formulas.
+ (line 63)
+* next-error: Sparse Trees. (line 32)
+* or-clock-goto: Clocking commands. (line 79)
+* org-agenda: Activation. (line 13)
+* org-agenda-add-note: Agenda Commands. (line 295)
+* org-agenda-archive: Agenda Commands. (line 265)
+* org-agenda-archive-default-with-confirmation: Agenda Commands.
+ (line 252)
+* org-agenda-archive-to-archive-sibling: Agenda Commands. (line 261)
+* org-agenda-archives-mode: Agenda Commands. (line 146)
+* org-agenda-bulk-action: Agenda Commands. (line 383)
+* org-agenda-bulk-mark: Agenda Commands. (line 353)
+* org-agenda-bulk-mark-all: Agenda Commands. (line 359)
+* org-agenda-bulk-mark-regexp: Agenda Commands. (line 379)
+* org-agenda-bulk-remove-all-marks: Agenda Commands. (line 367)
+* org-agenda-bulk-toggle: Agenda Commands. (line 371)
+* org-agenda-bulk-toggle-all: Agenda Commands. (line 375)
+* org-agenda-bulk-unmark: Agenda Commands. (line 363)
+* org-agenda-capture: Agenda Commands. (line 345)
+* org-agenda-clock-cancel: Agenda Commands. (line 339)
+* org-agenda-clock-goto: Agenda Commands. (line 124)
+* org-agenda-clock-goto <1>: Agenda Commands. (line 342)
+* org-agenda-clock-in: Agenda Commands. (line 332)
+* org-agenda-clock-out: Agenda Commands. (line 336)
+* 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 481)
+* org-agenda-date-prompt: Agenda Commands. (line 328)
+* org-agenda-day-view: Agenda Commands. (line 71)
+* org-agenda-deadline: Agenda Commands. (line 307)
+* org-agenda-diary-entry: Agenda Commands. (line 454)
+* org-agenda-do-date-earlier: Agenda Commands. (line 324)
+* org-agenda-do-date-later: Agenda Commands. (line 311)
+* 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 495)
+* org-agenda-file-to-front: Agenda Files. (line 16)
+* org-agenda-filter: Filtering/limiting agenda items.
+ (line 73)
+* org-agenda-filter-by-category: Filtering/limiting agenda items.
+ (line 38)
+* org-agenda-filter-by-effort: Filtering/limiting agenda items.
+ (line 49)
+* org-agenda-filter-by-regexp: Filtering/limiting agenda items.
+ (line 44)
+* org-agenda-filter-by-tag: Filtering/limiting agenda items.
+ (line 28)
+* org-agenda-filter-by-top-headline: Filtering/limiting agenda items.
+ (line 68)
+* org-agenda-follow-mode: Agenda Commands. (line 42)
+* org-agenda-goto: Agenda Commands. (line 36)
+* org-agenda-goto-calendar: Agenda Commands. (line 447)
+* org-agenda-goto-date: Agenda Commands. (line 121)
+* org-agenda-goto-today: Agenda Commands. (line 118)
+* org-agenda-holidays: Agenda Commands. (line 485)
+* org-agenda-kill: Agenda Commands. (line 243)
+* org-agenda-later: Agenda Commands. (line 110)
+* org-agenda-limit-interactively: Filtering/limiting agenda items.
+ (line 165)
+* 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 472)
+* org-agenda-previous-line: Agenda Commands. (line 23)
+* org-agenda-priority: Agenda Commands. (line 279)
+* org-agenda-priority-down: Agenda Commands. (line 289)
+* org-agenda-priority-up: Agenda Commands. (line 284)
+* org-agenda-quit: Agenda Commands. (line 491)
+* org-agenda-recenter: Agenda Commands. (line 33)
+* org-agenda-redo: Agenda Commands. (line 186)
+* org-agenda-refile: Agenda Commands. (line 249)
+* 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 303)
+* org-agenda-set-effort: Agenda Commands. (line 292)
+* org-agenda-set-restriction-lock: Agenda Files. (line 43)
+* org-agenda-set-tags: Agenda Commands. (line 275)
+* org-agenda-show-and-scroll-up: Agenda Commands. (line 29)
+* org-agenda-show-tags: Agenda Commands. (line 270)
+* org-agenda-sunrise-sunset: Agenda Commands. (line 476)
+* org-agenda-switch-to: Agenda Commands. (line 39)
+* org-agenda-todo: Agenda Commands. (line 231)
+* org-agenda-todo-nextset: Agenda Commands. (line 237)
+* org-agenda-toggle-archive-tag: Agenda Commands. (line 257)
+* 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-as-ascii: ASCII/Latin-1/UTF-8 export.
+ (line 35)
+* org-ascii-export-to-ascii: ASCII/Latin-1/UTF-8 export.
+ (line 26)
+* org-attach: Attachment defaults and dispatcher.
+ (line 20)
+* org-attach <1>: Agenda Commands. (line 300)
+* org-attach-attach: Attachment defaults and dispatcher.
+ (line 25)
+* org-attach-buffer: Attachment defaults and dispatcher.
+ (line 35)
+* org-attach-dired-to-subtree: Attach from Dired. (line 6)
+* org-attach-new: Attachment defaults and dispatcher.
+ (line 39)
+* org-attach-open: Attachment defaults and dispatcher.
+ (line 46)
+* org-attach-open-in-emacs: Attachment defaults and dispatcher.
+ (line 52)
+* org-attach-reveal: Attachment defaults and dispatcher.
+ (line 55)
+* org-attach-reveal-in-emacs: Attachment defaults and dispatcher.
+ (line 58)
+* org-attach-sync: Attachment defaults and dispatcher.
+ (line 42)
+* 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: Noweb Reference Syntax.
+ (line 202)
+* org-babel-expand-src-block <1>: 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 450)
+* 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-cite-insert: Citations. (line 14)
+* org-clock-cancel: Clocking commands. (line 75)
+* org-clock-display: Clocking commands. (line 84)
+* org-clock-in: Clocking commands. (line 7)
+* org-clock-in-last: Clocking commands. (line 44)
+* org-clock-modify-effort-estimate: Clocking commands. (line 50)
+* org-clock-modify-effort-estimate <1>: Effort Estimates. (line 24)
+* org-clock-out: Clocking commands. (line 36)
+* org-clock-report: The clock table. (line 11)
+* org-clock-timestamp-down: Clocking commands. (line 64)
+* org-clock-timestamp-up: Clocking commands. (line 64)
+* org-clock-timestamps-down: Clocking commands. (line 59)
+* org-clock-timestamps-up: Clocking commands. (line 59)
+* org-clocktable-try-shift: The clock table. (line 29)
+* org-clocktable-write-default: The clock table. (line 118)
+* org-clone-subtree-with-time-shift: Structure Editing. (line 96)
+* org-columns-delete: Using column view. (line 73)
+* org-columns-edit-allowed: Using column view. (line 57)
+* org-columns-edit-value: Using column view. (line 43)
+* org-columns-insert-dblock: Capturing column view.
+ (line 72)
+* org-columns-narrow: Using column view. (line 67)
+* org-columns-new: Using column view. (line 70)
+* 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-show-value: Using column view. (line 53)
+* org-columns-toggle-or-columns-quit: Using column view. (line 49)
+* org-columns-widen: Using column view. (line 67)
+* org-compute-property-at-point: Property Syntax. (line 117)
+* org-copy-subtree: Structure Editing. (line 74)
+* org-copy-visible: Global and local cycling.
+ (line 65)
+* org-cut-subtree: Structure Editing. (line 70)
+* 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 80)
+* org-dblock-update <1>: The clock table. (line 20)
+* org-dblock-update <2>: Dynamic Blocks. (line 25)
+* org-deadline: Inserting deadline/schedule.
+ (line 10)
+* org-delete-property: Property Syntax. (line 111)
+* org-delete-property-globally: Property Syntax. (line 114)
+* org-demote: Using the Mapping API.
+ (line 93)
+* org-demote-subtree: Structure Editing. (line 57)
+* org-do-demote: Structure Editing. (line 44)
+* org-do-promote: Structure Editing. (line 44)
+* org-dynamic-block-insert-dblock: Dynamic Blocks. (line 10)
+* org-edit-special: Literal Examples. (line 102)
+* org-edit-special <1>: Include Files. (line 63)
+* 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 53)
+* 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 13)
+* 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: Org Indent Mode. (line 6)
+* org-info-find-node: Documentation Access.
+ (line 6)
+* org-insert-drawer: Drawers. (line 18)
+* org-insert-drawer <1>: Property Syntax. (line 94)
+* 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 71)
+* 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 54)
+* org-insert-todo-heading <2>: Checkboxes. (line 86)
+* 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-latex-preview: Previewing LaTeX fragments.
+ (line 18)
+* org-link-escape: Link Format. (line 25)
+* org-link-set-parameters: Adding Hyperlink Types.
+ (line 74)
+* org-lint: Org Syntax. (line 24)
+* org-list-checkbox-radio-mode: Checkboxes. (line 81)
+* 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 146)
+* org-mark-ring-push: Handling Links. (line 141)
+* org-mark-subtree: Structure Editing. (line 66)
+* 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 63)
+* org-move-subtree-up: Structure Editing. (line 60)
+* org-narrow-to-block: Structure Editing. (line 123)
+* org-narrow-to-block <1>: Dynamic Blocks. (line 58)
+* org-narrow-to-subtree: Structure Editing. (line 120)
+* org-next-link: Handling Links. (line 153)
+* 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 108)
+* 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 78)
+* org-previous-link: Handling Links. (line 153)
+* org-previous-visible-heading: Motion. (line 12)
+* org-priority: Priorities. (line 33)
+* org-priority <1>: Using the Mapping API.
+ (line 81)
+* org-priority-down: Priorities. (line 41)
+* org-priority-up: Priorities. (line 41)
+* org-promote: Using the Mapping API.
+ (line 90)
+* org-promote-subtree: Structure Editing. (line 54)
+* org-property-action: Property Syntax. (line 100)
+* org-protocol-create: The open-source protocol.
+ (line 67)
+* org-protocol-create-for-org: The 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 104)
+* org-refile <1>: Refile and Copy. (line 13)
+* org-refile-cache-clear: Refile and Copy. (line 46)
+* org-refile-copy: Refile and Copy. (line 51)
+* org-refile-goto-last-stored: Refile and Copy. (line 35)
+* org-refile-reverse: Refile and Copy. (line 55)
+* org-remove-file: Agenda Files. (line 22)
+* org-reveal: Global and local cycling.
+ (line 43)
+* 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 19)
+* org-set-property: Property Syntax. (line 90)
+* org-set-property <1>: Property Syntax. (line 103)
+* org-set-property <2>: Using Header Arguments.
+ (line 70)
+* org-set-startup-visibility: Global and local cycling.
+ (line 36)
+* org-set-startup-visibility <1>: Initial visibility. (line 26)
+* org-set-tags-command: Setting Tags. (line 11)
+* org-show-todo-tree: TODO Basics. (line 35)
+* org-sort: Structure Editing. (line 108)
+* 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 16)
+* 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 186)
+* org-table-copy-region: Built-in Table Editor.
+ (line 151)
+* 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 221)
+* org-table-create-with-table.el: Cooperation. (line 63)
+* org-table-cut-region: Built-in Table Editor.
+ (line 157)
+* org-table-delete-column: Built-in Table Editor.
+ (line 94)
+* org-table-edit-field: Built-in Table Editor.
+ (line 202)
+* 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 226)
+* 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-header-line-mode: Built-in Table Editor.
+ (line 237)
+* org-table-hline-and-move: Built-in Table Editor.
+ (line 130)
+* org-table-import: Built-in Table Editor.
+ (line 212)
+* org-table-insert-column: Built-in Table Editor.
+ (line 97)
+* org-table-insert-hline: Built-in Table Editor.
+ (line 126)
+* org-table-insert-row: Built-in Table Editor.
+ (line 122)
+* 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 107)
+* org-table-move-cell-down: Built-in Table Editor.
+ (line 113)
+* org-table-move-cell-left: Built-in Table Editor.
+ (line 116)
+* org-table-move-cell-right: Built-in Table Editor.
+ (line 119)
+* org-table-move-cell-up: Built-in Table Editor.
+ (line 110)
+* 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 104)
+* org-table-move-row-up: Built-in Table Editor.
+ (line 101)
+* 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 161)
+* 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 134)
+* org-table-sum: Built-in Table Editor.
+ (line 181)
+* 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-transpose-table-at-point: Built-in Table Editor.
+ (line 243)
+* org-table-wrap-region: Built-in Table Editor.
+ (line 168)
+* 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 71)
+* 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 52)
+* org-toggle-comment: Comment Lines. (line 20)
+* org-toggle-heading: Structure Editing. (line 129)
+* org-toggle-inline-images: Images. (line 24)
+* org-toggle-ordered-property: TODO dependencies. (line 38)
+* org-toggle-ordered-property <1>: Checkboxes. (line 90)
+* org-toggle-pretty-entities: Subscripts and Superscripts.
+ (line 27)
+* org-toggle-pretty-entities <1>: Special Symbols. (line 31)
+* org-toggle-radio-button: Checkboxes. (line 75)
+* org-toggle-sticky-agenda: Agenda Dispatcher. (line 55)
+* org-toggle-tag: Using the Mapping API.
+ (line 85)
+* org-toggle-tags-groups: Tag Hierarchy. (line 87)
+* 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 98)
+* org-version: Feedback. (line 16)
+* org-yank: Structure Editing. (line 84)
+* orgtbl-ascii-draw: Org Plot. (line 144)
+* 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 40)
+* outline-show-branches: Global and local cycling.
+ (line 52)
+* outline-show-children: Global and local cycling.
+ (line 55)
+* outline-up-heading: Motion. (line 21)
+* pcomplete: Property Syntax. (line 86)
+* previous-error: Sparse Trees. (line 35)
+* widen: Structure Editing. (line 126)
+
+
+File: org.info, 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.
+
+
+* Menu:
+
+* cdlatex-simplify-sub-super-scripts: CDLaTeX mode. (line 43)
+* constants-unit-system: References. (line 121)
+* constants-unit-system <1>: In-buffer Settings. (line 151)
+* LaTeX-verbatim-environments: A LaTeX example. (line 19)
+* org-adapt-indentation: Hard indentation. (line 16)
+* org-agenda-auto-exclude-function: Filtering/limiting agenda items.
+ (line 99)
+* org-agenda-bulk-custom-functions: Agenda Commands. (line 352)
+* org-agenda-bulk-custom-functions <1>: Agenda Commands. (line 431)
+* org-agenda-bulk-persistent-marks: Agenda Commands. (line 383)
+* org-agenda-category-filter-preset: Filtering/limiting agenda items.
+ (line 6)
+* org-agenda-category-icon-alist: Categories. (line 16)
+* org-agenda-clock-consistency-checks: Agenda Commands. (line 165)
+* org-agenda-columns-add-appointments-to-effort-sum: Effort Estimates.
+ (line 45)
+* org-agenda-confirm-kill: Agenda Commands. (line 243)
+* 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 460)
+* 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 items.
+ (line 6)
+* 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-loop-over-headlines-in-active-region: Execute commands in the active region.
+ (line 13)
+* org-agenda-max-effort: Filtering/limiting agenda items.
+ (line 136)
+* org-agenda-max-entries: Filtering/limiting agenda items.
+ (line 133)
+* org-agenda-max-tags: Filtering/limiting agenda items.
+ (line 142)
+* org-agenda-max-todos: Filtering/limiting agenda items.
+ (line 139)
+* 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 6)
+* 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 270)
+* 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 80)
+* 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 55)
+* org-agenda-tag-filter-preset: Filtering/limiting agenda items.
+ (line 6)
+* 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 30)
+* org-agenda-text-search-extra-files <1>: Search view. (line 34)
+* 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 53)
+* 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 252)
+* 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-archive-subtree-save-file-p: Moving subtrees. (line 47)
+* 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-archive-delete: Attachment options. (line 60)
+* org-attach-auto-tag: Attachment options. (line 64)
+* org-attach-commands: Attachment options. (line 85)
+* org-attach-dir-relative: Attachment options. (line 13)
+* org-attach-expert: Attachment options. (line 88)
+* org-attach-id-dir: Attachment options. (line 9)
+* org-attach-id-to-path-function-list: Attachment options. (line 68)
+* org-attach-method: Attachment defaults and dispatcher.
+ (line 25)
+* org-attach-method <1>: Attachment options. (line 49)
+* org-attach-preferred-new-method: Attachment options. (line 55)
+* org-attach-store-link-p: Attachment options. (line 77)
+* org-attach-use-inheritance: Attachment options. (line 18)
+* 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 10)
+* 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 345)
+* org-catch-invisible-edits: Catching invisible edits.
+ (line 6)
+* org-clock-auto-clockout-timer: Resolving idle time. (line 91)
+* org-clock-continuously: Clocking commands. (line 7)
+* org-clock-continuously <1>: Clocking commands. (line 44)
+* org-clock-continuously <2>: Resolving idle time. (line 78)
+* org-clock-display-default-range: The clock table. (line 80)
+* org-clock-idle-time: Resolving idle time. (line 14)
+* org-clock-in-prepare-hook: Clocking commands. (line 21)
+* org-clock-into-drawer: Clocking commands. (line 7)
+* org-clock-mode-line-total: Clocking commands. (line 21)
+* 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 39)
+* org-closed-keep-when-no-todo: Closing items. (line 11)
+* org-coderef-label-format: Literal Examples. (line 88)
+* org-columns: Using column view. (line 10)
+* org-columns-default-format: Using column view. (line 10)
+* org-columns-default-format <1>: Effort Estimates. (line 35)
+* org-columns-default-format <2>: Agenda Commands. (line 197)
+* org-columns-default-format <3>: Agenda Column View. (line 19)
+* org-columns-default-format-for-agenda: 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-create-file-search-functions: Custom Searches. (line 12)
+* org-crypt-tag-matcher: Org Crypt. (line 11)
+* 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 31)
+* org-cycle-include-plain-lists: Plain Lists. (line 70)
+* org-cycle-open-archived-trees: Internal archiving. (line 13)
+* org-cycle-separator-lines: Headlines. (line 29)
+* 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-directory: Template elements. (line 50)
+* org-display-custom-times: Custom time format. (line 6)
+* 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-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 70)
+* 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 142)
+* org-file-apps: Handling Links. (line 108)
+* org-file-apps <1>: Attachment defaults and dispatcher.
+ (line 46)
+* org-fontify-emphasized-text: Emphasis and Monospace.
+ (line 11)
+* org-footnote-auto-adjust: Creating Footnotes. (line 60)
+* org-footnote-auto-adjust <1>: In-buffer Settings. (line 157)
+* org-footnote-auto-label: Creating Footnotes. (line 32)
+* org-footnote-auto-label <1>: In-buffer Settings. (line 157)
+* org-footnote-define-inline: Creating Footnotes. (line 45)
+* org-footnote-define-inline <1>: In-buffer Settings. (line 157)
+* org-footnote-section: Headlines. (line 18)
+* org-footnote-section <1>: Creating Footnotes. (line 45)
+* 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-global-properties: Property Syntax. (line 80)
+* org-global-properties <1>: Effort Estimates. (line 35)
+* org-goto-auto-isearch: Motion. (line 24)
+* org-goto-interface: Motion. (line 41)
+* org-group-tags: Tag Hierarchy. (line 87)
+* 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: Hard indentation. (line 21)
+* org-hide-block-startup: Blocks. (line 6)
+* org-hide-block-startup <1>: In-buffer Settings. (line 170)
+* org-hide-leading-stars: Hard indentation. (line 21)
+* org-hide-leading-stars <1>: In-buffer Settings. (line 133)
+* org-hide-macro-markers: Macro Replacement. (line 88)
+* org-hierarchical-checkbox-statistics: Checkboxes. (line 29)
+* org-hierarchical-todo-statistics: Breaking Down Tasks. (line 25)
+* org-html-container-element: HTML specific export settings.
+ (line 22)
+* org-html-doctype: HTML specific export settings.
+ (line 19)
+* org-html-doctype <1>: HTML doctypes. (line 8)
+* org-html-doctype-alist: HTML doctypes. (line 8)
+* org-html-head: HTML specific export settings.
+ (line 38)
+* org-html-head <1>: CSS support. (line 44)
+* org-html-head <2>: Bare HTML. (line 9)
+* org-html-head-extra: HTML specific export settings.
+ (line 42)
+* org-html-head-extra <1>: CSS support. (line 44)
+* org-html-head-extra <2>: Bare HTML. (line 9)
+* org-html-head-include-default-style: CSS support. (line 52)
+* org-html-head-include-default-style <1>: Bare HTML. (line 9)
+* org-html-head-include-scripts: Bare HTML. (line 9)
+* 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 26)
+* org-html-link-org-files-as-html: Links in HTML export.
+ (line 12)
+* org-html-link-up: HTML specific export settings.
+ (line 29)
+* org-html-mathjax-options: HTML specific export settings.
+ (line 33)
+* 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 <1>: Bare HTML. (line 9)
+* org-html-postamble-format: HTML preamble and postamble.
+ (line 6)
+* org-html-preamble: HTML preamble and postamble.
+ (line 6)
+* org-html-preamble <1>: Bare HTML. (line 9)
+* org-html-preamble-format: HTML preamble and postamble.
+ (line 6)
+* org-html-self-link-headlines: Headlines in HTML export.
+ (line 10)
+* 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-use-infojs: Bare HTML. (line 9)
+* 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: Org Indent Mode. (line 11)
+* org-indent-mode-turns-off-org-adapt-indentation: Org Indent Mode.
+ (line 15)
+* org-indent-mode-turns-on-hiding-stars: Org Indent Mode. (line 15)
+* org-infojs-options: JavaScript support. (line 70)
+* org-insert-mode-line-in-empty-file: Activation. (line 30)
+* org-irc-links-to-logs: Handling Links. (line 47)
+* 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 60)
+* org-latex-listings: Literal Examples. (line 31)
+* org-latex-listings-options: Source blocks in LaTeX export.
+ (line 25)
+* org-latex-minted-options: Source blocks in LaTeX export.
+ (line 25)
+* org-latex-packages-alist: LaTeX specific export settings.
+ (line 20)
+* org-latex-packages-alist <1>: 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-elisp-confirm-function: Code Evaluation Security.
+ (line 52)
+* org-link-email-description-format: Handling Links. (line 33)
+* org-link-frame-setup: Handling Links. (line 123)
+* org-link-from-user-regexp: Template expansion. (line 108)
+* org-link-keep-stored-after-insertion: Handling Links. (line 71)
+* org-link-parameters: Adding Hyperlink Types.
+ (line 74)
+* org-link-search-must-match-exact-headline: Internal Links. (line 31)
+* org-link-shell-confirm-function: Code Evaluation Security.
+ (line 49)
+* org-link-use-indirect-buffer-for-internals: Handling Links. (line 137)
+* 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 25)
+* org-log-done <1>: Agenda Commands. (line 131)
+* org-log-done <2>: In-buffer Settings. (line 111)
+* org-log-into-drawer: Tracking TODO state changes.
+ (line 6)
+* org-log-into-drawer <1>: Agenda Commands. (line 295)
+* org-log-note-clock-out: Clocking commands. (line 36)
+* org-log-note-clock-out <1>: In-buffer Settings. (line 111)
+* org-log-redeadline: Inserting deadline/schedule.
+ (line 10)
+* org-log-refile: Refile and Copy. (line 13)
+* org-log-repeat: Repeated tasks. (line 40)
+* org-log-repeat <1>: In-buffer Settings. (line 111)
+* org-log-reschedule: Inserting deadline/schedule.
+ (line 18)
+* org-log-states-order-reversed: Tracking TODO state changes.
+ (line 6)
+* org-loop-over-headlines-in-active-region: Execute commands in the active region.
+ (line 6)
+* 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-num-face: Dynamic Headline Numbering.
+ (line 19)
+* org-num-format-function: Dynamic Headline Numbering.
+ (line 19)
+* org-num-max-level: Dynamic Headline Numbering.
+ (line 10)
+* org-num-skip-commented: Dynamic Headline Numbering.
+ (line 10)
+* org-num-skip-footnotes: Dynamic Headline Numbering.
+ (line 16)
+* org-num-skip-tags: Dynamic Headline Numbering.
+ (line 10)
+* org-num-skip-unnumbered: Dynamic Headline Numbering.
+ (line 10)
+* org-odd-levels-only: Matching tags and properties.
+ (line 65)
+* org-odd-levels-only <1>: Hard indentation. (line 29)
+* org-odd-levels-only <2>: In-buffer Settings. (line 133)
+* 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 13)
+* 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 78)
+* org-pretty-entities: Subscripts and Superscripts.
+ (line 29)
+* org-pretty-entities <1>: In-buffer Settings. (line 176)
+* org-pretty-entities-include-sub-superscripts: Subscripts and Superscripts.
+ (line 29)
+* org-preview-latex-default-process: Previewing LaTeX fragments.
+ (line 6)
+* org-priority-default: Priorities. (line 46)
+* org-priority-default <1>: In-buffer Settings. (line 43)
+* org-priority-faces: Priorities. (line 13)
+* org-priority-highest: Priorities. (line 46)
+* org-priority-highest <1>: In-buffer Settings. (line 43)
+* org-priority-lowest: Priorities. (line 46)
+* org-priority-lowest <1>: In-buffer Settings. (line 43)
+* org-priority-start-cycle-with-default: Priorities. (line 41)
+* org-property-allowed-value-functions: Using the Property API.
+ (line 63)
+* org-protocol-default-template-key: The capture protocol.
+ (line 30)
+* org-protocol-project-alist: The 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 145)
+* org-read-date-display-live: The date/time prompt.
+ (line 98)
+* org-read-date-force-compatible-dates: The date/time prompt.
+ (line 62)
+* org-read-date-prefer-future: The date/time prompt.
+ (line 6)
+* org-refile-allow-creating-parent-nodes: Refile and Copy. (line 13)
+* org-refile-keep: Refile and Copy. (line 41)
+* org-refile-targets: Refile and Copy. (line 13)
+* org-refile-use-cache: Refile and Copy. (line 46)
+* org-refile-use-outline-path: Refile and Copy. (line 13)
+* org-remove-highlights-with-change: Sparse Trees. (line 20)
+* org-remove-highlights-with-change <1>: Clocking commands. (line 84)
+* org-replace-disputed-keys: Conflicts. (line 17)
+* org-return-follows-link: Handling Links. (line 129)
+* org-reverse-note-order: Refile and Copy. (line 13)
+* 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 56)
+* 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: 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: Org Indent Mode. (line 22)
+* org-startup-indented <1>: In-buffer Settings. (line 81)
+* org-startup-numerated: Dynamic Headline Numbering.
+ (line 22)
+* org-startup-numerated <1>: In-buffer Settings. (line 87)
+* org-startup-shrink-all-tables: Column Width and Alignment.
+ (line 64)
+* org-startup-shrink-all-tables <1>: In-buffer Settings. (line 100)
+* org-startup-with-inline-images: Images. (line 24)
+* org-startup-with-inline-images <1>: In-buffer Settings. (line 104)
+* org-startup-with-latex-preview: Previewing LaTeX fragments.
+ (line 28)
+* org-store-link-props: Template expansion. (line 106)
+* 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 186)
+* org-table-current-column: References. (line 90)
+* org-table-current-dline: References. (line 90)
+* org-table-duration-custom-format: Durations and time values.
+ (line 6)
+* org-table-export-default-format: Built-in Table Editor.
+ (line 226)
+* org-table-formula: In-buffer Settings. (line 28)
+* org-table-formula-constants: References. (line 114)
+* org-table-formula-constants <1>: In-buffer Settings. (line 28)
+* org-table-formula-constants <2>: Cooperation. (line 14)
+* org-table-header-line-p: Built-in Table Editor.
+ (line 237)
+* 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 183)
+* 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 145)
+* 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 35)
+* 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 190)
+* org-todo-repeat-to-state: Repeated tasks. (line 22)
+* org-todo-state-tags-triggers: TODO Basics. (line 56)
+* org-track-ordered-property-with-tag: TODO dependencies. (line 38)
+* org-track-ordered-property-with-tag <1>: Checkboxes. (line 90)
+* org-treat-insert-todo-heading-as-state-change: Structure Editing.
+ (line 29)
+* org-treat-S-cursor-todo-selection-as-state-change: TODO Basics.
+ (line 28)
+* 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 84)
+* org-yank-folded-subtrees: Structure Editing. (line 84)
+* parse-time-months: The date/time prompt.
+ (line 58)
+* parse-time-weekdays: The date/time prompt.
+ (line 58)
+* user-full-name: Export Settings. (line 25)
+* user-mail-address: Export Settings. (line 35)
+
+
+
+Tag Table:
+Node: Top884
+Node: Introduction22812
+Node: Summary23274
+Node: Installation25991
+Ref: Using Emacs packaging system26533
+Ref: Using Org's git repository27041
+Ref: Installing Org's contributed packages27951
+Node: Activation28287
+Ref: Activation-Footnote-129910
+Node: Feedback30038
+Ref: How to create a useful backtrace32724
+Ref: Feedback-Footnote-133876
+Node: Conventions34002
+Ref: TODO keywords tags properties etc34173
+Ref: Key bindings and commands35066
+Node: Document Structure35696
+Node: Headlines36868
+Ref: Headlines-Footnote-138166
+Node: Visibility Cycling38445
+Node: Global and local cycling38835
+Ref: Global and local cycling-Footnote-141552
+Ref: Global and local cycling-Footnote-241614
+Node: Initial visibility41918
+Ref: Initial visibility-Footnote-143102
+Node: Catching invisible edits43295
+Node: Motion43771
+Node: Structure Editing45235
+Node: Sparse Trees51695
+Ref: Sparse Trees-Footnote-154292
+Ref: Sparse Trees-Footnote-254407
+Node: Plain Lists54483
+Ref: Plain Lists-Footnote-162008
+Ref: Plain Lists-Footnote-262372
+Ref: Plain Lists-Footnote-362472
+Ref: Plain Lists-Footnote-462729
+Ref: Plain Lists-Footnote-562906
+Ref: Plain Lists-Footnote-663010
+Ref: Plain Lists-Footnote-763116
+Node: Drawers63186
+Ref: Drawers-Footnote-164856
+Node: Blocks64968
+Node: Tables65561
+Node: Built-in Table Editor66244
+Ref: Creation and conversion67978
+Ref: Re-aligning and field motion68916
+Ref: Column and row editing69829
+Ref: Regions72259
+Ref: Calculations73658
+Ref: Miscellaneous (1)74471
+Ref: Built-in Table Editor-Footnote-176948
+Node: Column Width and Alignment77056
+Node: Column Groups80393
+Node: Orgtbl Mode81960
+Node: The Spreadsheet82775
+Node: References84249
+Ref: Field references84708
+Ref: Range references87147
+Ref: Field coordinates in formulas88406
+Ref: Named references89391
+Ref: Remote references90362
+Ref: References-Footnote-191284
+Ref: References-Footnote-291512
+Ref: References-Footnote-391615
+Node: Formula syntax for Calc91940
+Ref: Formula syntax for Calc-Footnote-197801
+Node: Formula syntax for Lisp98140
+Node: Durations and time values100373
+Node: Field and range formulas101760
+Node: Column formulas104229
+Node: Lookup functions106341
+Node: Editing and debugging formulas108310
+Ref: Using multiple TBLFM lines112827
+Ref: Debugging formulas113670
+Node: Updating the table114094
+Node: Advanced features115466
+Ref: Advanced features-Footnote-1119917
+Node: Org Plot120025
+Ref: Graphical plots using Gnuplot120226
+Ref: Plot options122749
+Ref: ASCII bar plots125541
+Node: Hyperlinks126791
+Node: Link Format127655
+Ref: Link Format-Footnote-1129718
+Ref: Link Format-Footnote-2129950
+Node: Internal Links130082
+Ref: Internal Links-Footnote-1132644
+Ref: Internal Links-Footnote-2132884
+Node: Radio Targets133025
+Node: External Links133742
+Ref: External Links-Footnote-1139226
+Node: Handling Links139650
+Ref: Handling Links-Footnote-1147413
+Ref: Handling Links-Footnote-2147574
+Ref: Handling Links-Footnote-3147764
+Ref: Handling Links-Footnote-4148060
+Ref: Handling Links-Footnote-5148322
+Ref: Handling Links-Footnote-6148444
+Node: Using Links Outside Org148519
+Node: Link Abbreviations148994
+Node: Search Options151830
+Ref: Search Options-Footnote-1153968
+Node: Custom Searches154049
+Node: TODO Items155083
+Ref: TODO Items-Footnote-1156208
+Node: TODO Basics156322
+Node: TODO Extensions158957
+Node: Workflow states160010
+Ref: Workflow states-Footnote-1161409
+Node: TODO types161525
+Ref: TODO types-Footnote-1163344
+Node: Multiple sets in one file163416
+Node: Fast access to TODO states165361
+Ref: Fast access to TODO states-Footnote-1166244
+Ref: Fast access to TODO states-Footnote-2166351
+Node: Per-file keywords166653
+Ref: Per-file keywords-Footnote-1168123
+Node: Faces for TODO keywords168327
+Node: TODO dependencies169400
+Node: Progress Logging171891
+Node: Closing items173028
+Ref: Closing items-Footnote-1174028
+Ref: Closing items-Footnote-2174102
+Node: Tracking TODO state changes174180
+Ref: Tracking TODO state changes-Footnote-1177315
+Ref: Tracking TODO state changes-Footnote-2177377
+Ref: Tracking TODO state changes-Footnote-3177535
+Node: Tracking your habits177813
+Node: Priorities182234
+Ref: Priorities-Footnote-1184746
+Node: Breaking Down Tasks184819
+Ref: Breaking Down Tasks-Footnote-1186861
+Node: Checkboxes186968
+Ref: Checkboxes-Footnote-1192111
+Ref: Checkboxes-Footnote-2192239
+Ref: Checkboxes-Footnote-3192419
+Node: Tags192533
+Node: Tag Inheritance193626
+Ref: Tag Inheritance-Footnote-1195498
+Ref: Tag Inheritance-Footnote-2195602
+Node: Setting Tags195732
+Ref: Setting Tags-Footnote-1202303
+Ref: Setting Tags-Footnote-2202481
+Node: Tag Hierarchy202559
+Node: Tag Searches206159
+Node: Properties and Columns207470
+Node: Property Syntax208858
+Node: Special Properties213464
+Node: Property Searches215154
+Node: Property Inheritance216629
+Node: Column View218501
+Node: Defining columns219752
+Node: Scope of column definitions220137
+Node: Column attributes221196
+Ref: Column attributes-Footnote-1225607
+Ref: Column attributes-Footnote-2225738
+Ref: Column attributes-Footnote-3225936
+Node: Using column view226075
+Ref: Turning column view on or off226241
+Ref: Editing values227282
+Ref: Modifying column view on-the-fly228685
+Node: Capturing column view229057
+Ref: Capturing column view-Footnote-1232785
+Node: Dates and Times232922
+Node: Timestamps233841
+Ref: Timestamps-Footnote-1236197
+Ref: Timestamps-Footnote-2236493
+Node: Creating Timestamps237242
+Node: The date/time prompt240256
+Ref: The date/time prompt-Footnote-1245217
+Ref: The date/time prompt-Footnote-2245388
+Ref: The date/time prompt-Footnote-3245499
+Ref: The date/time prompt-Footnote-4245754
+Node: Custom time format245852
+Node: Deadlines and Scheduling247621
+Ref: Deadlines and Scheduling-Footnote-1251191
+Node: Inserting deadline/schedule251354
+Ref: Inserting deadline/schedule-Footnote-1253346
+Ref: Inserting deadline/schedule-Footnote-2253507
+Ref: Inserting deadline/schedule-Footnote-3253633
+Node: Repeated tasks253759
+Ref: Repeated tasks-Footnote-1258394
+Ref: Repeated tasks-Footnote-2258477
+Ref: Repeated tasks-Footnote-3258760
+Node: Clocking Work Time258982
+Ref: Clocking Work Time-Footnote-1260187
+Ref: Clocking Work Time-Footnote-2260340
+Node: Clocking commands260482
+Ref: Clocking commands-Footnote-1265587
+Ref: Clocking commands-Footnote-2265702
+Ref: Clocking commands-Footnote-3265784
+Ref: Clocking commands-Footnote-4265847
+Node: The clock table265930
+Ref: The clock table-Footnote-1274013
+Ref: The clock table-Footnote-2274122
+Ref: The clock table-Footnote-3274220
+Node: Resolving idle time274346
+Ref: Resolving idle time (1)274542
+Ref: Continuous clocking277739
+Ref: Clocking out automatically after some idle time278245
+Ref: Resolving idle time-Footnote-1278877
+Node: Effort Estimates279325
+Ref: Effort Estimates-Footnote-1282282
+Node: Timers282393
+Node: Refiling and Archiving284612
+Node: Refile and Copy285175
+Ref: Refile and Copy-Footnote-1288003
+Node: Archiving288117
+Node: Moving subtrees288830
+Node: Internal archiving290956
+Node: Capture and Attachments293685
+Node: Capture294490
+Node: Setting up capture295014
+Node: Using capture295377
+Node: Capture templates297775
+Node: Template elements299814
+Ref: Template elements-Footnote-1307296
+Ref: Template elements-Footnote-2307629
+Ref: Template elements-Footnote-3307816
+Node: Template expansion307911
+Ref: Template expansion-Footnote-1311978
+Ref: Template expansion-Footnote-2312069
+Ref: Template expansion-Footnote-3312259
+Node: Templates in contexts312358
+Node: Attachments313203
+Node: Attachment defaults and dispatcher314233
+Ref: Attachment defaults and dispatcher-Footnote-1317583
+Node: Attachment options317734
+Node: Attachment links321753
+Node: Automatic version-control with Git322392
+Node: Attach from Dired322907
+Node: RSS Feeds324271
+Node: Agenda Views325722
+Node: Agenda Files328129
+Ref: Agenda Files-Footnote-1331040
+Ref: Agenda Files-Footnote-2331184
+Node: Agenda Dispatcher331382
+Ref: Agenda Dispatcher-Footnote-1334262
+Ref: Agenda Dispatcher-Footnote-2334360
+Node: Built-in Agenda Views334466
+Node: Weekly/daily agenda335063
+Ref: Calendar/Diary integration336403
+Ref: Anniversaries from BBDB338479
+Ref: Appointment reminders340270
+Ref: Weekly/daily agenda-Footnote-1340820
+Ref: Weekly/daily agenda-Footnote-2341064
+Node: Global TODO list341284
+Node: Matching tags and properties344134
+Node: Search view351243
+Node: Stuck projects352890
+Node: Presentation and Sorting355027
+Node: Categories356004
+Node: Time-of-day specifications356750
+Ref: Time-of-day specifications-Footnote-1358741
+Node: Sorting of agenda items358864
+Node: Filtering/limiting agenda items360482
+Ref: Filtering in the agenda361187
+Ref: Computed tag filtering365321
+Ref: Setting limits for the agenda366815
+Ref: Filtering/limiting agenda items-Footnote-1368364
+Node: Agenda Commands368916
+Ref: Motion (1)369649
+Ref: View/Go to Org file369852
+Ref: Change display371358
+Ref: Remote editing378868
+Ref: Bulk remote editing selected entries384221
+Ref: Calendar commands387316
+Ref: Quit and exit389197
+Ref: Agenda Commands-Footnote-1389559
+Ref: Agenda Commands-Footnote-2389635
+Ref: Agenda Commands-Footnote-3389739
+Node: Custom Agenda Views389826
+Node: Storing searches390478
+Ref: Storing searches-Footnote-1393430
+Ref: Storing searches-Footnote-2393547
+Node: Block agenda393794
+Node: Setting options395123
+Node: Exporting Agenda Views398737
+Ref: Exporting Agenda Views-Footnote-1403276
+Ref: Exporting Agenda Views-Footnote-2403464
+Ref: Exporting Agenda Views-Footnote-3403614
+Ref: Exporting Agenda Views-Footnote-4403801
+Node: Agenda Column View403883
+Node: Markup for Rich Contents407231
+Node: Paragraphs408529
+Node: Emphasis and Monospace409664
+Node: Subscripts and Superscripts410723
+Node: Special Symbols412341
+Ref: Special Symbols-Footnote-1414254
+Ref: Special Symbols-Footnote-2414419
+Node: Embedded LaTeX414516
+Ref: Embedded LaTeX-Footnote-1415365
+Node: LaTeX fragments415561
+Ref: LaTeX fragments-Footnote-1417718
+Node: Previewing LaTeX fragments417911
+Ref: Previewing LaTeX fragments-Footnote-1419394
+Node: CDLaTeX mode419642
+Ref: CDLaTeX mode-Footnote-1422373
+Node: Literal Examples422520
+Ref: Literal Examples-Footnote-1427631
+Ref: Literal Examples-Footnote-2427994
+Ref: Literal Examples-Footnote-3428172
+Ref: Literal Examples-Footnote-4428357
+Node: Images428455
+Ref: Images-Footnote-1429542
+Ref: Images-Footnote-2429665
+Node: Captions429826
+Node: Horizontal Rules430526
+Node: Creating Footnotes430782
+Ref: Creating Footnotes-Footnote-1433911
+Ref: Creating Footnotes-Footnote-2434017
+Node: Exporting434124
+Node: The Export Dispatcher436898
+Node: Export Settings439648
+Ref: Export Settings-Footnote-1447747
+Ref: Export Settings-Footnote-2447859
+Ref: Export Settings-Footnote-3447960
+Node: Table of Contents448158
+Ref: Table of Contents-Footnote-1450832
+Node: Include Files450999
+Ref: Include Files-Footnote-1453936
+Node: Macro Replacement454114
+Ref: Macro Replacement-Footnote-1457995
+Node: Comment Lines458212
+Ref: Comment Lines-Footnote-1459075
+Node: ASCII/Latin-1/UTF-8 export459179
+Ref: ASCII export commands460033
+Ref: ASCII specific export settings460566
+Ref: Header and sectioning structure461010
+Ref: Quoting ASCII text461284
+Ref: ASCII specific attributes461656
+Ref: ASCII special blocks461933
+Node: Beamer Export462280
+Node: Beamer export commands463030
+Node: Beamer specific export settings463735
+Node: Frames and Blocks in Beamer465640
+Ref: Frames and Blocks in Beamer-Footnote-1469012
+Node: Beamer specific syntax469171
+Node: Editing support471150
+Node: A Beamer example471621
+Node: HTML Export472875
+Node: HTML export commands473985
+Node: HTML specific export settings474527
+Node: HTML doctypes476746
+Node: HTML preamble and postamble478921
+Node: Quoting HTML tags480116
+Node: Headlines in HTML export480815
+Node: Links in HTML export481410
+Node: Tables in HTML export482880
+Node: Images in HTML export484337
+Node: Math formatting in HTML export485827
+Ref: Math formatting in HTML export-Footnote-1487368
+Ref: Math formatting in HTML export-Footnote-2487493
+Ref: Math formatting in HTML export-Footnote-3487754
+Node: Text areas in HTML export487926
+Node: CSS support489071
+Ref: CSS support-Footnote-1492723
+Node: JavaScript support492903
+Node: LaTeX Export496090
+Node: LaTeX/PDF export commands498010
+Ref: LaTeX/PDF export commands-Footnote-1499513
+Node: LaTeX specific export settings499715
+Node: LaTeX header and sectioning502947
+Node: Quoting LaTeX code505064
+Node: Tables in LaTeX export505860
+Node: Images in LaTeX export510278
+Node: Plain lists in LaTeX export512883
+Node: Source blocks in LaTeX export513903
+Ref: Source blocks in LaTeX export-Footnote-1515372
+Node: Example blocks in LaTeX export515530
+Node: Special blocks in LaTeX export516256
+Node: Horizontal rules in LaTeX export517519
+Node: Verse blocks in LaTeX export517956
+Node: Quote blocks in LaTeX export519970
+Node: Markdown Export521089
+Ref: Markdown export commands521556
+Ref: Header and sectioning structure (1)521993
+Node: OpenDocument Text Export522410
+Ref: OpenDocument Text Export-Footnote-1523516
+Node: Pre-requisites for ODT export523665
+Node: ODT export commands524043
+Node: ODT specific export settings525224
+Node: Extending ODT export526275
+Ref: Automatically exporting to other formats527086
+Ref: Converting between document formats527512
+Node: Applying custom styles528054
+Ref: Applying custom styles the easy way528586
+Ref: Using third-party styles and templates529544
+Node: Links in ODT export529841
+Node: Tables in ODT export530503
+Node: Images in ODT export532513
+Ref: Embedding images532717
+Ref: Embedding clickable images533034
+Ref: Sizing and scaling of embedded images533368
+Ref: Anchoring of images535052
+Node: Math formatting in ODT export535374
+Node: LaTeX math snippets535803
+Ref: LaTeX math snippets-Footnote-1538056
+Ref: LaTeX math snippets-Footnote-2538132
+Node: MathML and OpenDocument formula files538177
+Node: Labels and captions in ODT export538685
+Node: Literal examples in ODT export539961
+Node: Advanced topics in ODT export540802
+Ref: Configuring a document converter541112
+Ref: Working with OpenDocument style files542053
+Ref: x-orgodtstyles-xml542519
+Ref: x-orgodtcontenttemplate-xml542861
+Ref: x-overriding-factory-styles543505
+Ref: Creating one-off styles544749
+Ref: Customizing tables in ODT export546753
+Ref: Validating OpenDocument XML551613
+Ref: Advanced topics in ODT export-Footnote-1552410
+Ref: Advanced topics in ODT export-Footnote-2552514
+Ref: Advanced topics in ODT export-Footnote-3552607
+Node: Org Export552955
+Ref: Org export commands553311
+Node: Texinfo Export553617
+Node: Texinfo export commands554600
+Node: Texinfo specific export settings555225
+Node: Texinfo file header556378
+Node: Texinfo title and copyright page557361
+Node: Info directory file558725
+Node: Headings and sectioning structure559450
+Node: Indices561480
+Node: Quoting Texinfo code562509
+Node: Plain lists in Texinfo export563007
+Node: Tables in Texinfo export564733
+Node: Images in Texinfo export565229
+Node: Quotations in Texinfo export565867
+Node: Special blocks in Texinfo export566821
+Node: A Texinfo example567474
+Node: iCalendar Export569576
+Node: Other Built-in Back-ends573865
+Node: Advanced Export Configuration574497
+Ref: Export hooks574709
+Ref: Filters575647
+Ref: Defining filters for individual files578156
+Ref: Extending an existing back-end578962
+Node: Export in Foreign Buffers581202
+Node: Bare HTML582443
+Node: Publishing582985
+Node: Configuration583861
+Node: Project alist584643
+Node: Sources and destinations585785
+Node: Selecting files587103
+Node: Publishing action588058
+Ref: Publishing action-Footnote-1589891
+Node: Publishing options590054
+Ref: Generic properties590806
+Ref: ASCII specific properties592693
+Ref: Beamer specific properties594293
+Ref: HTML specific properties594858
+Ref: LaTeX specific properties599344
+Ref: Markdown specific properties602268
+Ref: ODT specific properties602506
+Ref: Texinfo specific properties603438
+Node: Publishing links604785
+Node: Site map606165
+Node: Generating an index609482
+Node: Uploading Files610274
+Node: Sample Configuration612057
+Node: Simple example612555
+Node: Complex example613271
+Node: Triggering Publication615320
+Node: Citation handling616346
+Node: Citations617215
+Node: Citation export processors618907
+Node: Working with Source Code621516
+Node: Features Overview623855
+Node: Structure of Code Blocks626614
+Node: Using Header Arguments629124
+Ref: System-wide header arguments629851
+Ref: Header arguments in Org mode properties630774
+Ref: Code block specific header arguments632602
+Ref: Header arguments in function calls634101
+Node: Environment of a Code Block634775
+Ref: Passing arguments634989
+Ref: Using sessions643178
+Ref: Choosing a working directory644577
+Ref: Inserting headers and footers646431
+Node: Evaluating Code Blocks646941
+Ref: How to evaluate source code647396
+Ref: Limit code block evaluation650298
+Ref: Cache results of evaluation651158
+Ref: Evaluating Code Blocks-Footnote-1653670
+Ref: Evaluating Code Blocks-Footnote-2653804
+Node: Results of Evaluation653962
+Ref: Collection654769
+Ref: Type656230
+Ref: Format660024
+Ref: Handling662326
+Ref: Post-processing663201
+Ref: Results of Evaluation-Footnote-1664951
+Node: Exporting Code Blocks665109
+Node: Extracting Source Code667462
+Ref: Header arguments668443
+Ref: Functions671984
+Ref: Tangle hooks672235
+Ref: Jumping between code and Org672484
+Node: Languages672994
+Node: Editing Source Code673987
+Node: Noweb Reference Syntax676717
+Ref: Noweb Reference Syntax-Footnote-1682865
+Node: Library of Babel682955
+Node: Key bindings and Useful Functions683673
+Node: Batch Execution686098
+Node: Miscellaneous686881
+Node: Completion688275
+Node: Structure Templates690200
+Ref: Structure Templates-Footnote-1691950
+Node: Speed Keys692042
+Node: Clean View693211
+Node: Org Indent Mode694413
+Ref: Org Indent Mode-Footnote-1695619
+Node: Hard indentation695843
+Ref: Hard indentation-Footnote-1697326
+Ref: Hard indentation-Footnote-2697432
+Node: Execute commands in the active region697576
+Node: Dynamic Headline Numbering698588
+Node: The Very Busy C-c C-c Key699754
+Node: In-buffer Settings701742
+Ref: In-buffer Settings-Footnote-1710848
+Node: Regular Expressions711046
+Node: Org Syntax711668
+Node: Documentation Access713326
+Node: Escape Character713747
+Node: Code Evaluation Security714608
+Node: Interaction717475
+Node: Cooperation717898
+Node: Conflicts720790
+Node: TTY Keys725392
+Node: Protocols726994
+Node: The store-link protocol728455
+Node: The capture protocol729598
+Node: The open-source protocol731231
+Node: Org Crypt734472
+Node: Org Mobile736085
+Node: Setting up the staging area737441
+Ref: Setting up the staging area-Footnote-1738681
+Ref: Setting up the staging area-Footnote-2738888
+Node: Pushing to the mobile application739060
+Ref: Pushing to the mobile application-Footnote-1740071
+Ref: Pushing to the mobile application-Footnote-2740162
+Ref: Pushing to the mobile application-Footnote-3740529
+Node: Pulling from the mobile application740605
+Ref: Pulling from the mobile application-Footnote-1742918
+Node: Hacking742971
+Node: Hooks743922
+Node: Add-on Packages744246
+Node: Adding Hyperlink Types744715
+Node: Adding Export Back-ends748310
+Node: Tables in Arbitrary Syntax749567
+Node: Radio tables750836
+Node: A LaTeX example752973
+Ref: A LaTeX example-Footnote-1756825
+Ref: A LaTeX example-Footnote-2756868
+Ref: A LaTeX example-Footnote-3757029
+Node: Translator functions757481
+Node: Dynamic Blocks759657
+Node: Special Agenda Views761903
+Ref: Special Agenda Views-Footnote-1765614
+Ref: Special Agenda Views-Footnote-2765821
+Node: Speeding Up Your Agendas765953
+Node: Extracting Agenda Information767012
+Node: Using the Property API770817
+Node: Using the Mapping API774172
+Node: History and Acknowledgments778208
+Ref: From Carsten778406
+Ref: From Bastien781837
+Ref: List of Contributions783969
+Node: GNU Free Documentation License792631
+Ref: ADDENDUM How to use this License for your documents816589
+Node: Main Index817982
+Node: Key Index915591
+Node: Command and Function Index972247
+Node: Variable Index1019293
+
+End Tag Table
+
+
+Local Variables:
+coding: utf-8
+End:
diff --git a/elpa/org-9.5.2/orgguide.info b/elpa/org-9.5.2/orgguide.info
new file mode 100644
index 0000000..d0eaa5f
--- /dev/null
+++ b/elpa/org-9.5.2/orgguide.info
@@ -0,0 +1,2642 @@
+This is orgguide.info, produced by makeinfo version 6.7 from
+orgguide.texi.
+
+Copyright © 2004–2021 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.” in the full Org manual, which is
+ distributed together with this compact guide.
+
+ (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 Guide: (orgguide). Abbreviated Org mode manual.
+END-INFO-DIR-ENTRY
+
+
+File: orgguide.info, Node: Top, Next: Introduction, Up: (dir)
+
+Org Mode Compact Guide
+**********************
+
+Copyright © 2004–2021 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.” in the full Org manual, which is
+ distributed together with this compact guide.
+
+ (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and
+ modify this GNU manual.”
+
+* Menu:
+
+* Introduction:: Welcome!
+* 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:: 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:: 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.
+
+— The Detailed Node Listing —
+
+Document Structure
+
+* Headlines:: How to typeset Org tree nodes.
+* 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.
+
+TODO Items
+
+* TODO Basics:: Marking and displaying TODO entries.
+* Multi-state Workflow:: More than just on/off.
+* 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.
+
+Dates and Times
+
+* Timestamps:: Assigning a time to a tree entry.
+* Creating Timestamps:: Commands that insert timestamps.
+* Deadlines and Scheduling:: Planning your work.
+* Clocking Work Time:: Tracking how long you spent on a task.
+
+Capture, Refile, Archive
+
+* Capture:: Capturing new stuff.
+* Refile and Copy:: Moving/copying a tree from one place to another.
+* Archiving:: What to do with finished products.
+
+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?
+* 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.
+* Agenda Commands:: Remote editing of Org trees.
+* Custom Agenda Views:: Defining special searches and views.
+
+Markup
+
+* Paragraphs:: The basic unit of text.
+* Emphasis and Monospace:: Bold, italic, etc.
+* Embedded LaTeX:: LaTeX can be freely used inside Org documents.
+* Literal examples:: Source code examples with special formatting.
+* Images:: Display an image.
+* Creating Footnotes:: Edit and read footnotes.
+
+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.
+* Comment Lines:: What will not be exported.
+* ASCII/UTF-8 Export:: Exporting to flat files with encoding.
+* HTML Export:: Exporting to HTML.
+* LaTeX Export:: Exporting to LaTeX and processing to PDF.
+* iCalendar Export:: Exporting to iCalendar.
+
+
+
+File: orgguide.info, Node: Introduction, Next: Document Structure, Prev: Top, Up: Top
+
+1 Introduction
+**************
+
+Org is a mode for keeping notes, maintaining TODO lists, and doing
+project planning with a fast and effective plain-text system. It is
+also an authoring and publishing system, and it supports working with
+source code for literal programming and reproducible research.
+
+ This document is a much compressed derivative of the *note
+comprehensive Org mode manual: (org)Top. It contains all basic features
+and commands, along with important hints for customization. It is
+intended for beginners who would shy back from a 200 pages manual
+because of sheer size.
+
+Installation
+============
+
+ Important: If you are using a version of Org that is part of the
+ Emacs distribution, please skip this section and go directly to
+ *note Activation::.
+
+ If you have downloaded Org from the web, either as a distribution
+‘.zip’ or ‘.tar’ file, or as a Git archive, it is best to run it
+directly from the distribution directory. You need to add the ‘lisp/’
+subdirectories to the Emacs load path. To do this, add the following
+line to your Emacs init file:
+
+ (add-to-list 'load-path "~/path/to/orgdir/lisp")
+
+If you have been using git or a tar ball to get Org, you need to run the
+following command to generate autoload information.
+
+ make autoloads
+
+Activation
+==========
+
+Add the following lines to your Emacs init file to define _global_ keys
+for three commands that are useful in any Emacs buffer, not just Org
+buffers. Please choose suitable keys yourself.
+
+ (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 extension ‘.org’ will be put into Org mode automatically.
+
+Feedback
+========
+
+If you find problems with Org, or if you have questions, remarks, or
+ideas about it, please mail to the Org mailing list
+<emacs-orgmode@gnu.org>. For information on how to submit bug reports,
+see the main manual.
+
+
+File: orgguide.info, 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 ‘<TAB>’ key.
+
+* Menu:
+
+* Headlines:: How to typeset Org tree nodes.
+* 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.
+
+
+File: orgguide.info, Node: Headlines, Next: Visibility Cycling, Up: Document Structure
+
+2.1 Headlines
+=============
+
+Headlines define the structure of an outline tree. The headlines in Org
+start on the left margin(1) with one or more stars followed by a space.
+For example:
+
+ * Top level headline
+ ** Second level
+ *** Third level
+ some text
+ *** Third 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. See
+*note Miscellaneous:: for a setup to realize this.
+
+ ---------- Footnotes ----------
+
+ (1) See the variable ‘org-special-ctrl-a/e’ to configure special
+behavior of ‘C-a’ and ‘C-e’ in headlines.
+
+
+File: orgguide.info, Node: Visibility Cycling, Next: Motion, Prev: Headlines, Up: Document Structure
+
+2.2 Visibility Cycling
+======================
+
+Outlines make it possible to hide parts of the text in the buffer. Org
+uses just two commands, bound to ‘<TAB>’ and {{{kbd{S-TAB)}}} to change
+the visibility in the buffer.
+
+‘<TAB>’
+ _Subtree cycling_: Rotate current subtree among the states
+
+ ,-> FOLDED -> CHILDREN -> SUBTREE --.
+ '-----------------------------------'
+
+ When called with a prefix argument (‘C-u <TAB>’), or with the Shift
+ key, global cycling is invoked.
+
+‘S-<TAB>’
+‘C-u <TAB>’
+ _Global cycling_: Rotate the entire buffer among the states
+
+ ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
+ '--------------------------------------'
+
+‘C-u C-u C-u <TAB>’
+ Show all, including drawers.
+
+ When Emacs first visits an Org file, the global state is set to
+OVERVIEW, i.e., only the top level headlines are visible. This can be
+configured through the variable ‘org-startup-folded’, or on a per-file
+basis by adding a ‘STARTUP’ keyword to ‘overview’, ‘content’, ‘showall’,
+‘showeverything’ or ‘show<n>levels’ (n = 2..5) like this:
+
+ #+STARTUP: content
+
+
+File: orgguide.info, 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’
+ Next heading.
+
+‘C-c C-p’
+ Previous heading.
+
+‘C-c C-f’
+ Next heading same level.
+
+‘C-c C-b’
+ Previous heading same level.
+
+‘C-c C-u’
+ Backward to higher level heading.
+
+
+File: orgguide.info, Node: Structure Editing, Next: Sparse Trees, Prev: Motion, Up: Document Structure
+
+2.4 Structure Editing
+=====================
+
+‘M-<RET>’
+ Insert new heading with same level as current. If point is in a
+ plain list item, a new item is created (see *note Plain Lists::).
+ When this command is used in the middle of a line, the line is
+ split and the rest of the line becomes the new headline(1).
+
+‘M-S-<RET>’
+ Insert new TODO entry with same level as current heading.
+
+‘<TAB>’ in new
+empty entry
+ In a new entry with no text yet, ‘<TAB>’ cycles through reasonable
+ levels.
+
+‘M-<LEFT>’
+‘M-<RIGHT>’
+ Promote or demote current heading by one level.
+
+‘M-<UP>’
+‘M-<DOWN>’
+ Move subtree up or down, i.e., swap with previous or next subtree
+ of same level.
+
+‘C-c C-w’
+ Refile entry or region to a different location. See *note Refile
+ and Copy::.
+
+‘C-x n s’
+‘C-x n w’
+ Narrow buffer to current subtree and widen it again.
+
+ When there is an active region (Transient Mark mode), promotion and
+demotion work on all headlines in the region.
+
+ ---------- Footnotes ----------
+
+ (1) If you do not want the line to be split, customize the variable
+‘org-M-RET-may-split-line’.
+
+
+File: orgguide.info, 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 /’
+ This prompts for an extra key to select a sparse-tree creating
+ command.
+
+‘C-c / r’
+ Occur. Prompts for a regexp and shows a sparse tree with all
+ matches. Each match is also highlighted; the highlights disappear
+ by pressing ‘C-c C-c’.
+
+ The other sparse tree commands select headings based on TODO
+ keywords, tags, or properties and will be discussed later in this
+ manual.
+
+ ---------- Footnotes ----------
+
+ (1) See also the variable ‘org-show-context-detail’ to decide how
+much context is shown around each match.
+
+
+File: orgguide.info, Node: Plain Lists, 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 ‘*’ as bullets.
+
+ • _Ordered_ list items start with ‘1.’, or ‘1)’.
+
+ • _Description_ list use ‘::’ to separate the _term_ from the
+ description.
+
+ Items belonging to the same list must have the same indentation on
+the first line. An item ends before the next line that is indented like
+its bullet/number, or less. A list ends when all items are closed, or
+before two blank lines. 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.
+ Important actors in this film are:
+ - Elijah Wood :: He plays Frodo
+ - Sean Astin :: He plays Sam, Frodo's friend.
+
+ The following commands act on items when point is in the first line
+of an item (the line with the bullet or number).
+
+‘<TAB>’
+ Items can be folded just like headline levels.
+
+‘M-<RET>’
+ Insert new item at current level. With a prefix argument, force a
+ new heading (see *note Structure Editing::).
+
+‘M-S-<RET>’
+ Insert a new item with a checkbox (see *note Checkboxes::).
+
+‘M-S-<UP>’
+‘M-S-<DOWN>’
+ Move the item including subitems up/down (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-<LEFT>’
+‘M-S-<RIGHT>’
+ Decrease/increase the indentation of the item, including subitems.
+
+‘C-c C-c’
+ If there is a checkbox (see *note Checkboxes::) in the item line,
+ toggle the state of the checkbox. Also verify bullets and
+ indentation consistency in the whole list.
+
+‘C-c -’
+ Cycle the entire list level through the different itemize/enumerate
+ bullets (‘-’, ‘+’, ‘*’, ‘1.’, ‘1)’).
+
+
+File: orgguide.info, 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 in connection with the Emacs Calc package
+(see *note GNU Emacs Calculator Manual: (calc)Top.).
+
+ 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. 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 ‘<TAB>’ or
+‘<RET>’ or ‘C-c C-c’ inside the table. ‘<TAB>’ also moves to the next
+field (‘<RET>’ 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 ‘<TAB>’ to align the table and start filling in fields.
+Even faster would be to type ‘|Name|Phone|Age’ followed by ‘C-c <RET>’.
+
+ 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 ‘<TAB>’, ‘S-<TAB>’ or ‘<RET>’_, the field is
+automatically made blank.
+
+Creation and conversion
+=======================
+
+‘C-c |’
+ Convert the active region to 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.
+
+ 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 <RET> | - <TAB>’.
+
+Re-aligning and field motion
+============================
+
+‘C-c C-c’
+ Re-align the table without moving point.
+
+‘<TAB>’
+ Re-align the table, move to the next field. Creates a new row if
+ necessary.
+
+‘S-<TAB>’
+ Re-align, move to previous field.
+
+‘<RET>’
+ Re-align the table and move down to next row. Creates a new row if
+ necessary.
+
+‘S-<UP>’
+‘S-<DOWN>’
+‘S-<LEFT>’
+‘S-<RIGHT>’
+ Move a cell up, down, left, and right by swapping with adjacent
+ cell.
+
+Column and row editing
+======================
+
+‘M-<LEFT>’, ‘M-<RIGHT>’
+ Move the current column left/right.
+
+‘M-S-<LEFT>’
+ Kill the current column.
+
+‘M-S-<RIGHT>’
+ Insert a new column to the left of point position.
+
+‘M-<UP>’, ‘M-<DOWN>’
+ Move the current row up/down.
+
+‘M-S-<UP>’
+ Kill the current row or horizontal line.
+
+‘M-S-<DOWN>’
+ Insert a new row above the current row. With a prefix argument,
+ the line is created below the current one.
+
+‘C-c -’
+ Insert a horizontal line below current row. With a prefix
+ argument, the line is created above the current line.
+
+‘C-c <RET>’
+ Insert a horizontal line below current row, and move the point into
+ the row below that line.
+
+‘C-c ^’
+ 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.
+
+
+File: orgguide.info, 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.
+
+ Org recognizes plain URIs, possibly wrapped within angle brackets,
+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, with all brackets present, Org
+changes the display so that ‘DESCRIPTION’ is displayed instead of
+‘[[LINK][DESCRIPTION]]’ and ‘LINK’ is displayed instead of ‘[[LINK]]’.
+To edit the invisible LINK part, use ‘C-c C-l’ with the point on the
+link.
+
+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’.
+
+ Links such as ‘[[My Target]]’ or ‘[[My Target][Find my target]]’ lead
+to a text search in the current file for the corresponding target, which
+looks like ‘<<My Target>>’.
+
+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. Here are some examples:
+
+‘http://www.astro.uva.nl/=dominik’ on the web
+‘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:projects.org’ another Org file
+‘docview:papers/last.pdf::NNN’ open in DocView mode at page NNN
+‘id:B7423F4D-2E8A-471B-8810-C40F074717E9’ link to heading by ID
+‘news:comp.emacs’ Usenet link
+‘mailto:adent@galaxy.net’ mail link
+‘mhe:folder#id’ MH-E message link
+‘rmail:folder#id’ Rmail message link
+‘gnus:group#id’ Gnus article link
+‘bbdb:R.*Stallman’ BBDB link (with regexp)
+‘irc:/irc.com/#emacs/bob’ IRC link
+‘info:org#Hyperlinks’ Info node link
+
+ 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. Here are a few
+examples,, together with an explanation:
+
+‘file:~/code/main.c::255’ Find line 255
+‘file:~/xx.org::My Target’ Find ‘<<My Target>>’
+‘[[file:~/xx.org::#my-custom-id]]’ Find entry with a custom ID
+
+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.
+
+ From an Org buffer, the following commands create, navigate or, more
+generally, act on links.
+
+‘C-c C-l’
+ Insert a link. This prompts for a link to be inserted into the
+ buffer. You can just type a link, or use history keys ‘<UP>’ and
+ ‘<DOWN>’ to access stored links. You will be prompted for the
+ description part of the link.
+
+ When called with a ‘C-u’ prefix argument, file name completion is
+ used to link to a file.
+
+‘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’
+ Open link at point.
+
+‘C-c &’
+ 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.
+
+
+File: orgguide.info, Node: TODO Items, Next: Tags, Prev: Hyperlinks, Up: Top
+
+5 TODO Items
+************
+
+Org mode does not require TODO lists to live in separate documents.
+Instead, TODO items are part of a 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 TODO items remain in the context from which they emerged.
+
+ Org mode provides methods to give you an overview of all the things
+that you have to do, collected from many files.
+
+* Menu:
+
+* TODO Basics:: Marking and displaying TODO entries.
+* Multi-state Workflow:: More than just on/off.
+* 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.
+
+
+File: orgguide.info, Node: TODO Basics, Next: Multi-state Workflow, 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’
+ Rotate the TODO state of the current item among
+
+ ,-> (unmarked) -> TODO -> DONE --.
+ '--------------------------------'
+
+ The same rotation can also be done “remotely” from the agenda
+ buffer with the ‘t’ command key (see *note Agenda Commands::).
+
+‘S-<RIGHT>’
+‘S-<LEFT>’
+ Select the following/preceding TODO state, similar to cycling.
+
+‘C-c / t’
+ 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.
+
+‘M-x org-agenda t’
+ 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. See *note Global TODO List::, for more information.
+
+‘S-M-<RET>’
+ 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: orgguide.info, Node: Multi-state Workflow, Next: Progress Logging, Prev: TODO Basics, Up: TODO Items
+
+5.2 Multi-state Workflow
+========================
+
+You can use TODO keywords to indicate @emph{sequential} working progress
+states:
+
+ (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’.
+
+ 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. Your setup would then look like
+this:
+
+ (setq org-todo-keywords
+ '((sequence "TODO(t)" "|" "DONE(d)")
+ (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")))
+
+The keywords should all be different, this helps Org mode to keep track
+of which subsequence should be used for a given entry. The example also
+shows how to define keys for fast access of a particular state, by
+adding a letter in parenthesis after each keyword—you will be prompted
+for the key after ‘C-c C-t’.
+
+ To define TODO keywords that are valid only in a single file, use the
+following text anywhere in the file.
+
+ #+TODO: TODO(t) | DONE(d)
+ #+TODO: REPORT(r) BUG(b) KNOWNCAUSE(k) | FIXED(f)
+ #+TODO: | CANCELED(c)
+
+ 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.
+
+
+File: orgguide.info, Node: Progress Logging, Next: Priorities, Prev: Multi-state Workflow, Up: TODO Items
+
+5.3 Progress Logging
+====================
+
+To record a timestamp and a note when changing a TODO state, call the
+command ‘org-todo’ with a prefix argument.
+
+‘C-u C-c C-t’
+ Prompt for a note and record a the time of the TODO state change.
+
+ Org mode can also 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::.
+
+Closing items
+-------------
+
+The most basic logging is to keep track of _when_ a certain TODO item
+was marked as 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 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.
+
+Tracking TODO state changes
+---------------------------
+
+You might want to keep track of TODO state changes. You can either
+record just a timestamp, or a time-stamped note for a change. These
+records are inserted after the headline as an itemized list. When
+taking a lot of notes, you might want to get the notes out of the way
+into a drawer. Customize the variable ‘org-log-into-drawer’ to get this
+behavior.
+
+ For state logging, Org mode expects configuration on a per-keyword
+basis. This is achieved by adding special markers ‘!’ (for a timestamp)
+and ‘@’ (for a note) in parentheses after each keyword. For example:
+
+ #+TODO: TODO(t) WAIT(w@/!) | DONE(d!) CANCELED(c@)
+
+defines TODO keywords and fast access keys, and 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’. The same syntax works also when
+setting ‘org-todo-keywords’.
+
+ ---------- Footnotes ----------
+
+ (1) The corresponding in-buffer setting is ‘#+STARTUP: logdone’.
+
+ (2) The corresponding in-buffer setting is ‘#+STARTUP: logenotedone’.
+
+
+File: orgguide.info, 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
+
+ Org mode supports three priorities: ‘A’, ‘B’, and ‘C’. ‘A’ is the
+highest, ‘B’ the default if none is given. Priorities make a difference
+only in the agenda.
+
+‘C-c ,’
+ Set the priority of the current headline. Press ‘A’, ‘B’ or ‘C’ to
+ select a priority, or ‘<SPC>’ to remove the cookie.
+
+‘S-<UP>’ (‘org-priority-up’)
+‘S-<DOWN>’ (‘org-priority-down’)
+ Increase/decrease the priority of the current headline.
+
+
+File: orgguide.info, 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. To keep an overview of the
+fraction of subtasks that have already been marked as 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
+
+
+File: orgguide.info, Node: Checkboxes, Prev: Breaking Down Tasks, Up: TODO Items
+
+5.6 Checkboxes
+==============
+
+Every item in a plain list (see *note Plain Lists::) can be made into a
+checkbox by starting it with the string ‘[ ]’. Checkboxes are not
+included into the global TODO list, so they are often great to split a
+task into a number of simple steps.
+
+ Here is an example of a checkbox list.
+
+ * TODO Organize party [2/4]
+ - [-] call people [1/2]
+ - [ ] Peter
+ - [X] Sarah
+ - [X] order food
+
+ 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 following commands work with checkboxes:
+
+‘C-c C-c’
+ Toggle checkbox status or—with prefix argument—checkbox presence at
+ point.
+
+‘M-S-<RET>’
+ Insert a new item with a checkbox. This works only if point is
+ already in a plain list item (see *note Plain Lists::).
+
+
+File: orgguide.info, Node: Tags, Next: Properties, 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.
+
+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:
+
+Setting tags
+============
+
+Tags can simply be typed into the buffer at the end of a headline.
+After a colon, ‘M-<TAB>’ offers completion on tags. There is also a
+special command for inserting tags:
+
+‘C-c C-q’
+ Enter new tags for the current headline. Org mode either offers
+ completion or a special single-key interface for setting tags, see
+ below.
+
+‘C-c C-c’
+ 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. 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
+
+ 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)
+
+Tag groups
+==========
+
+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.
+
+ You can set group tags by using brackets and inserting a colon
+between the group tag and its related tags:
+
+ #+TAGS: [ GTD : Control Persp ]
+
+or, if tags in the group should be mutually exclusive:
+
+ #+TAGS: { Context : @Home @Work }
+
+ 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.
+
+ If you want to ignore group tags temporarily, toggle group tags
+support with ‘org-toggle-tags-groups’, bound to ‘C-c C-x q’.
+
+Tag searches
+============
+
+‘C-c / m’ or ‘C-c \’
+ 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’
+ Create a global list of tag matches from all agenda files. See
+ *note Matching Tags and Properties::.
+
+‘M-x org-agenda M’
+ 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 more detailed description
+with many examples, see *note Matching Tags and Properties::.
+
+ ---------- Footnotes ----------
+
+ (1) As with all these in-buffer settings, pressing ‘C-c C-c’
+activates any changes in the line.
+
+
+File: orgguide.info, Node: Properties, Next: Dates and Times, Prev: Tags, Up: Top
+
+7 Properties
+************
+
+Properties are key-value pairs associated with an entry. They live in a
+special drawer with the name ‘PROPERTIES’. Each property is specified
+on a single line, with the key (surrounded by colons) first, and the
+value after it:
+
+ * CD collection
+ ** Classic
+ *** Goldberg Variations
+ :PROPERTIES:
+ :Title: Goldberg Variations
+ :Composer: J.S. Bach
+ :Publisher: Deutsche Grammophon
+ :NDisks: 1
+ :END:
+
+ 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
+
+ The following commands help to work with properties:
+
+‘C-c C-x p’
+ Set a property. This prompts for a property name and a value.
+
+‘C-c C-c d’
+ Remove a property from the current entry.
+
+ To create sparse trees and special lists with selection based on
+properties, the same commands are used as for tag searches (see *note
+Tags::). The syntax for the search string is described in *note
+Matching Tags and Properties::.
+
+
+File: orgguide.info, Node: Dates and Times, Next: Capture Refile Archive, Prev: Properties, 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.
+
+* Menu:
+
+* Timestamps:: Assigning a time to a tree entry.
+* Creating Timestamps:: Commands that insert timestamps.
+* Deadlines and Scheduling:: Planning your work.
+* Clocking Work Time:: Tracking how long you spent on a task.
+
+
+File: orgguide.info, Node: Timestamps, Next: Creating Timestamps, Up: Dates and Times
+
+8.1 Timestamps
+==============
+
+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>’. 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 [BROKEN
+LINK: *The 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.
+
+ * 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 expression entries
+ For more complex date specifications, Org mode supports using the
+ special expression diary entries implemented in the Emacs Calendar
+ package. 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.
+
+ ** 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]
+
+
+File: orgguide.info, 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 .’
+ 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.
+ With a prefix argument, it also adds the current time.
+
+‘C-c !’
+ Like ‘C-c .’, but insert an inactive timestamp that does not cause
+ an agenda entry.
+
+‘S-<LEFT>’
+‘S-<RIGHT>’
+ Change date at point by one day.
+
+‘S-<UP>’
+‘S-<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.
+
+ When Org mode prompts for a date/time, it accepts any string
+containing some date and/or time information, and intelligently
+interprets the string, deriving defaults for unspecified information
+from the current date and time. You can also select a date in the
+pop-up calendar. See the manual for more information on how exactly the
+date/time prompt works.
+
+
+File: orgguide.info, 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:
+
+‘C-c C-d’
+ Insert ‘DEADLINE’ keyword along with a time stamp, in the line
+ following the headline.
+
+ 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 as 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]]
+
+‘C-c C-s’
+ Insert ‘SCHEDULED’ keyword along with a stamp, in the line
+ following the headline.
+
+ Meaning: you are planning to start working on that task on the
+ given date(1).
+
+ The headline is listed under the given date(2). In addition, a
+ reminder that the scheduled date has passed is present in the
+ compilation for _today_, until the entry is marked as 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>
+
+ 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. 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.
+
+ ---------- Footnotes ----------
+
+ (1) This is quite different from what is normally understood by
+_scheduling a meeting_, which is done in Org by just inserting a time
+stamp without keyword.
+
+ (2) It will still be listed on that date after it has been marked as
+done. If you do not like this, set the variable
+‘org-agenda-skip-scheduled-if-done’.
+
+
+File: orgguide.info, Node: Clocking Work Time, 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.
+
+‘C-c C-x C-i’
+ Start the clock on the current item (clock-in). This inserts the
+ ‘CLOCK’ keyword together with a timestamp. When called with a
+ ‘C-u’ prefix argument, select the task from a list of recently
+ clocked tasks.
+
+‘C-c C-x C-o’
+ 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’.
+
+‘C-c C-x C-e’
+ Update the effort estimate for the current clock task.
+
+‘C-c C-x C-q’
+ 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’
+ 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.
+
+ The ‘l’ key may be used in the agenda (see [BROKEN LINK: *The
+Weekly/daily Agenda]) to show which tasks have been worked on or closed
+during a day.
+
+
+File: orgguide.info, 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.
+* Refile and Copy:: Moving/copying a tree from one place to another.
+* Archiving:: What to do with finished products.
+
+
+File: orgguide.info, Node: Capture, Next: Refile and Copy, Up: Capture Refile Archive
+
+9.1 Capture
+===========
+
+Capture lets you quickly store notes with little interruption of your
+work flow. You can define templates for new entries and associate them
+with different targets for storing notes.
+
+Setting up capture
+------------------
+
+The following customization sets a default target(1) 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::).
+
+Using capture
+-------------
+
+‘M-x org-capture’
+ Start a capture process, placing you into a narrowed indirect
+ buffer to edit.
+
+‘C-c C-c’
+ 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.
+
+‘C-c C-w’
+ Finalize the capture process by refiling the note to a different
+ place (see *note Refile and Copy::).
+
+‘C-c C-k’
+ Abort the capture process and return to the previous state.
+
+Capture templates
+-----------------
+
+You can use templates for different types of capture items, and for
+different target locations. 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, special %-escapes(2) allow dynamic
+insertion of content. Here is a small selection of the possibilities,
+consult the manual for more.
+
+‘%a’ annotation, normally the link created with ‘org-store-link’
+‘%i’ initial content, the region when capture is called with ‘C-u’
+‘%t’, ‘%T’ timestamp, date only, or date and time
+‘%u’, ‘%U’ like above, but inactive timestamps
+‘%?’ after completing the template, position point here
+
+ ---------- Footnotes ----------
+
+ (1) Using capture templates, you get finer control over capture
+locations. See *note Capture templates::.
+
+ (2) If you need one of these sequences literally, escape the ‘%’ with
+a backslash.
+
+
+File: orgguide.info, Node: Refile and Copy, Next: Archiving, Prev: Capture, Up: Capture Refile Archive
+
+9.2 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 C-w’
+ 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.
+
+ 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.
+
+‘C-u C-c C-w’
+ Use the refile interface to jump to a heading.
+
+‘C-u C-u C-c C-w’
+ Jump to the location where ‘org-refile’ last moved a tree to.
+
+‘C-c M-w’
+ Copying works like refiling, except that the original note is not
+ deleted.
+
+
+File: orgguide.info, Node: Archiving, Prev: Refile and Copy, Up: Capture Refile Archive
+
+9.3 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.
+
+ The most common archiving action is to move a project tree to another
+file, the archive file.
+
+‘C-c C-x C-a’
+ Archive the current entry using the command specified in the
+ variable ‘org-archive-default-command’.
+
+‘C-c C-x C-s’ or short ‘C-c $’
+ Archive the subtree starting at point position to the location
+ given by ‘org-archive-location’.
+
+ 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::
+
+
+File: orgguide.info, 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.
+
+ 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. Remote editing from the agenda buffer means, for
+example, that you can change the dates of deadlines and appointments
+from the agenda buffer. For commands available in the Agenda buffer,
+see *note Agenda Commands::.
+
+* 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?
+* 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.
+* Agenda Commands:: Remote editing of Org trees.
+* Custom Agenda Views:: Defining special searches and views.
+
+
+File: orgguide.info, 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’.
+
+‘C-c [’
+ 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 ]’
+ Remove current file from the list of agenda files.
+
+‘C-'’
+‘C-,’
+ Cycle through agenda file list, visiting one file after the other.
+
+
+File: orgguide.info, 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 [BROKEN LINK: *The
+ Weekly/daily Agenda]).
+
+‘t’
+‘T’
+ Create a list of all TODO items (see *note Global TODO List::).
+
+‘m’
+‘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.
+
+
+File: orgguide.info, Node: Built-in Agenda Views, Next: Global TODO List, Prev: Agenda Dispatcher, Up: Agenda Views
+
+10.3 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.
+
+‘M-x org-agenda a’
+ Compile an agenda for the current week from a list of Org files.
+ The agenda shows the entries for each day.
+
+ Org mode understands the syntax of the diary and allows you to use
+diary expression entries directly in Org files:
+
+ * 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
+
+ Org can interact with Emacs appointments notification facility. To
+add the appointments of your agenda files, use the command
+‘org-agenda-to-appt’.
+
+
+File: orgguide.info, Node: Global TODO List, Next: Matching Tags and Properties, Prev: Built-in Agenda Views, Up: Agenda Views
+
+10.4 The Global TODO List
+=========================
+
+The global TODO list contains all unfinished TODO items formatted and
+collected into a single place. Remote editing of TODO items lets you
+can change the state of a TODO entry with a single key press. For
+commands available in the TODO list, see *note Agenda Commands::.
+
+‘M-x org-agenda t’
+ Show the global TODO list. This collects the TODO items from all
+ agenda files (see *note Agenda Views::) into a single buffer.
+
+‘M-x org-agenda T’
+ Like the above, but allows selection of a specific TODO keyword.
+
+
+File: orgguide.info, Node: Matching Tags and Properties, Next: Search View, Prev: Global TODO List, Up: Agenda Views
+
+10.5 Matching Tags and Properties
+=================================
+
+If headlines in the agenda files are marked with _tags_ (see *note
+Tags::), or have properties (see *note Properties::), 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’
+ 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’
+ Like ‘m’, but only select headlines that are also TODO items.
+
+ 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’.
+
+ You may also test for properties at the same time as matching tags,
+see the manual for more information.
+
+
+File: orgguide.info, Node: Search View, Next: Agenda Commands, Prev: Matching Tags and Properties, Up: Agenda Views
+
+10.6 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.
+
+ 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’.
+
+ Note that in addition to the agenda files, this command also searches
+the files listed in ‘org-agenda-text-search-extra-files’.
+
+
+File: orgguide.info, Node: Agenda Commands, Next: Custom Agenda Views, Prev: Search View, Up: Agenda Views
+
+10.7 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. This is just a selection of the many commands, explore
+the agenda menu and the manual for a complete list.
+
+Motion
+------
+
+‘n’
+ Next line (same as ‘<DOWN>’ and ‘C-n’).
+
+‘p’
+ Previous line (same as ‘<UP>’ and ‘C-p’).
+
+View/Go to Org file
+-------------------
+
+‘<SPC>’
+ Display the original location of the item in another window. With
+ a prefix argument, make sure that drawers stay folded.
+
+‘<TAB>’
+ Go to the original location of the item in another window.
+
+‘<RET>’
+ Go to the original location of the item and delete other windows.
+
+Change display
+--------------
+
+‘o’
+ Delete other windows.
+
+‘v d’ or short ‘d’
+ Switch to day view.
+
+‘v w’ or short ‘w’
+ Switch to week view.
+
+‘f’
+ 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.
+
+‘b’
+ Go backward in time to display earlier dates.
+
+‘.’
+ Go to today.
+
+‘j’
+ Prompt for a date and go there.
+
+‘v l’ or ‘v L’ or short ‘l’
+ Toggle Logbook mode. In Logbook mode, entries that were marked as
+ 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. When called with a ‘C-u’ prefix argument, show all possible
+ logbook entries, including state changes.
+
+‘r’
+‘g’
+ Recreate the agenda buffer, for example to reflect the changes
+ after modification of the timestamps of items.
+
+‘s’
+ Save all Org buffers in the current Emacs session, and also the
+ locations of IDs.
+
+Remote editing
+--------------
+
+‘0--9’
+ Digit argument.
+
+‘t’
+ Change the TODO state of the item, both in the agenda and in the
+ original Org file.
+
+‘C-k’
+ Delete the current agenda item along with the entire subtree
+ belonging to it in the original Org file.
+
+‘C-c C-w’
+ Refile the entry at point.
+
+‘a’
+ Archive the subtree corresponding to the entry at point using the
+ default archiving command set in ‘org-archive-default-command’.
+
+‘$’
+ Archive the subtree corresponding to the current headline.
+
+‘C-c C-s’
+ Schedule this item. With a prefix argument, remove the scheduling
+ timestamp
+
+‘C-c C-d’
+ Set a deadline for this item. With a prefix argument, remove the
+ deadline.
+
+‘S-<RIGHT>’
+ Change the timestamp associated with the current line by one day
+ into the future.
+
+‘S-<LEFT>’
+ Change the timestamp associated with the current line by one day
+ into the past.
+
+‘I’
+ Start the clock on the current item.
+
+‘O’
+ Stop the previously started clock.
+
+‘X’
+ Cancel the currently running clock.
+
+‘J’
+ Jump to the running clock in another window.
+
+Quit and exit
+-------------
+
+‘q’
+ Quit agenda, remove the agenda buffer.
+
+‘x’
+ Exit agenda, remove the agenda buffer and all buffers loaded by
+ Emacs for the compilation of the agenda.
+
+
+File: orgguide.info, Node: Custom Agenda Views, Prev: Agenda Commands, Up: Agenda Views
+
+10.8 Custom Agenda Views
+========================
+
+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
+ '(("w" todo "WAITING")
+ ("u" tags "+boss-urgent")
+ ("v" tags-todo "+boss-urgent")))
+
+ 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 is just a single character. 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:
+
+‘w’
+ as a global search for TODO entries with ‘WAITING’ as the TODO
+ keyword.
+
+‘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.
+
+
+File: orgguide.info, Node: Markup, 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. Used in conjunction with
+the export framework (see *note Exporting::), you can author beautiful
+documents in Org.
+
+* Menu:
+
+* Paragraphs:: The basic unit of text.
+* Emphasis and Monospace:: Bold, italic, etc.
+* Embedded LaTeX:: LaTeX can be freely used inside Org documents.
+* Literal examples:: Source code examples with special formatting.
+* Images:: Display an image.
+* Creating Footnotes:: Edit and read footnotes.
+
+
+File: orgguide.info, Node: Paragraphs, Next: Emphasis and Monospace, Up: Markup
+
+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: orgguide.info, Node: Emphasis and Monospace, Next: Embedded LaTeX, 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 specific syntax; it is
+exported verbatim.
+
+
+File: orgguide.info, Node: Embedded LaTeX, Next: Literal examples, Prev: Emphasis and Monospace, Up: Markup
+
+11.3 Embedded LaTeX
+===================
+
+For scientific notes which need to be able to contain mathematical
+symbols and the occasional formula, Org mode supports embedding LaTeX
+code into its files. You can directly use TeX-like syntax for special
+symbols, enter formulas and entire LaTeX environments.
+
+ 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}.
+
+ \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} \].
+
+
+File: orgguide.info, Node: Literal examples, Next: Images, Prev: Embedded LaTeX, Up: Markup
+
+11.4 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
+
+ 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.
+
+ #+BEGIN_SRC emacs-lisp
+ (defun org-xor (a b)
+ "Exclusive or."
+ (if a (not b) b))
+ #+END_SRC
+
+ To edit the example in a special buffer supporting this language, use
+‘C-c '’ to both enter and leave the editing buffer.
+
+
+File: orgguide.info, Node: Images, Next: Creating Footnotes, Prev: Literal examples, Up: Markup
+
+11.5 Images
+===========
+
+An image is a link to an image file that does not have a description
+part, for example
+
+ ./img/cat.jpg
+
+ If you wish to define a caption for the image and maybe a label for
+internal cross references (see *note Hyperlinks::), 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]]
+
+
+File: orgguide.info, Node: Creating Footnotes, Prev: Images, Up: Markup
+
+11.6 Creating Footnotes
+=======================
+
+A footnote is defined in a paragraph that is started by a footnote
+marker in square brackets in column 0, no indentation allowed. The
+footnote reference is simply the marker in square brackets, inside text.
+For example:
+
+ The Org homepage[fn:1] now looks a lot better than it used to.
+ ...
+ [fn:1] The link is: https://orgmode.org
+
+ The following commands handle 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.
+ When this command is called with a prefix argument, a menu of
+ additional options including renumbering is offered.
+
+‘C-c C-c’
+ Jump between definition and reference.
+
+
+File: orgguide.info, Node: Exporting, Next: Publishing, Prev: Markup, Up: Top
+
+12 Exporting
+************
+
+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::) as possible.
+
+* 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.
+* Comment Lines:: What will not be exported.
+* ASCII/UTF-8 Export:: Exporting to flat files with encoding.
+* HTML Export:: Exporting to HTML.
+* LaTeX Export:: Exporting to LaTeX and processing to PDF.
+* iCalendar Export:: Exporting to iCalendar.
+
+
+File: orgguide.info, 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.
+
+‘C-c C-e’
+ Invokes the export dispatcher interface.
+
+ Org exports the entire buffer by default. If the Org buffer has an
+active region, then Org exports just that region.
+
+
+File: orgguide.info, Node: Export Settings, Next: Table of Contents, Prev: The Export Dispatcher, Up: Exporting
+
+12.2 Export Settings
+====================
+
+The exporter recognizes special lines in the buffer which provide
+additional information. These lines may be put anywhere in the file:
+
+ #+TITLE: I'm in the Mood for Org
+
+ Most proeminent export options include:
+
+‘TITLE’ the title to be shown
+‘AUTHOR’ the author (default taken from ‘user-full-name’)
+‘DATE’ a date, fixed, or an Org timestamp
+‘EMAIL’ email address (default from ‘user-mail-address’)
+‘LANGUAGE’ language code, e.g., ‘en’
+
+ Option keyword sets can be inserted from the export dispatcher (see
+*note The Export Dispatcher::) using the ‘Insert template’ command by
+pressing ‘#’.
+
+
+File: orgguide.info, 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 normally inserts the table of contents directly before the first
+headline of the file.
+
+
+File: orgguide.info, Node: Include Files, Next: Comment Lines, 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.
+
+ You can visit the included file with ‘C-c '’.
+
+
+File: orgguide.info, Node: Comment Lines, Next: ASCII/UTF-8 Export, Prev: Include Files, Up: Exporting
+
+12.5 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.
+The command below helps changing the comment status of a headline.
+
+‘C-c ;’
+ Toggle the ‘COMMENT’ keyword at the beginning of an entry.
+
+
+File: orgguide.info, Node: ASCII/UTF-8 Export, Next: HTML Export, Prev: Comment Lines, Up: Exporting
+
+12.6 ASCII/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. UTF-8 export uses additional characters and
+symbols available in this encoding standards.
+
+‘C-c C-e t a’
+‘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.
+
+
+File: orgguide.info, Node: HTML Export, Next: LaTeX Export, Prev: ASCII/UTF-8 Export, Up: Exporting
+
+12.7 HTML Export
+================
+
+Org mode contains an HTML exporter with extensive HTML formatting
+compatible with XHTML 1.0 strict standard.
+
+‘C-c C-e h h’
+ 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.
+
+ The HTML export back-end transforms ‘<’ and ‘>’ to ‘&lt;’ and ‘&gt;’.
+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:<b>@@bold text@@html:</b>@@
+
+ 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: orgguide.info, Node: LaTeX Export, Next: iCalendar Export, Prev: HTML Export, Up: Exporting
+
+12.8 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.
+
+ By default, the LaTeX output uses the _article_ class. You can
+change this by adding an option like ‘#+LATEX_CLASS: myclass’ in your
+file. The class must be listed in ‘org-latex-classes’.
+
+‘C-c C-e l l’
+ 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 p’
+ 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 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: orgguide.info, Node: iCalendar Export, Prev: LaTeX Export, Up: Exporting
+
+12.9 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.
+
+‘C-c C-e c f’
+ 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 c’
+ Create a combined iCalendar file from Org files in
+ ‘org-agenda-files’ and write it to
+ ‘org-icalendar-combined-agenda-file’ file name.
+
+
+File: orgguide.info, 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.
+
+ For detailed instructions about setup, see the manual. Here is an
+example:
+
+ (setq org-publish-project-alist
+ '(("org"
+ :base-directory "~/org/"
+ :publishing-function org-html-publish-to-html
+ :publishing-directory "~/public_html"
+ :section-numbers nil
+ :with-toc nil
+ :html-head "<link rel=\"stylesheet\"
+ href=\"../other/mystyle.css\"
+ type=\"text/css\"/>")))
+
+‘C-c C-e P x’
+ Prompt for a specific project and publish all files that belong to
+ it.
+
+‘C-c C-e P p’
+ Publish the project containing the current file.
+
+‘C-c C-e P f’
+ Publish only the current file.
+
+‘C-c C-e P a’
+ 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.
+
+
+File: orgguide.info, Node: Working with Source Code, Next: Miscellaneous, Prev: Publishing, Up: Top
+
+14 Working with Source Code
+***************************
+
+Org mode provides a number of features for working with source code,
+including editing of code blocks in their native major mode, evaluation
+of code blocks, tangling of code blocks, and exporting code blocks and
+their results in several formats.
+
+ A source code block conforms to this structure:
+
+ #+NAME: <name>
+ #+BEGIN_SRC <language> <switches> <header arguments>
+ <body>
+ #+END_SRC
+
+where:
+
+ • ‘<name>’ is a string used to uniquely name the code block,
+
+ • ‘<language>’ specifies the language of the code block, e.g.,
+ ‘emacs-lisp’, ‘shell’, ‘R’, ‘python’, etc.,
+
+ • ‘<switches>’ can be used to control export of the code block,
+
+ • ‘<header arguments>’ can be used to control many aspects of code
+ block behavior as demonstrated below,
+
+ • ‘<body>’ contains the actual 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.
+
+Using header arguments
+======================
+
+A header argument is specified with an initial colon followed by the
+argument’s name in lowercase.
+
+ Header arguments can be set in several ways; Org prioritizes them in
+case of overlaps or conflicts by giving local settings a higher
+priority.
+
+System-wide header arguments
+ Those are specified by customizing ‘org-babel-default-header-args’
+ variable, or, for a specific language LANG
+ ‘org-babel-default-header-args:LANG’.
+
+Header arguments in properties
+ You can set them using ‘header-args’ property (see *note
+ Properties::)—or ‘header-args:LANG’ for language LANG. Header
+ arguments set through properties drawers apply at the sub-tree
+ level on down.
+
+Header arguments in code blocks
+ Header arguments are most commonly set at the source code block
+ level, on the ‘BEGIN_SRC’ line:
+
+ #+NAME: factorial
+ #+BEGIN_SRC haskell :results silent :exports code :var n=0
+ fac 0 = 1
+ fac n = n * fac (n-1)
+ #+END_SRC
+
+ Code block header arguments can span multiple lines using ‘HEADER’
+ keyword on each line.
+
+Evaluating code blocks
+======================
+
+Use ‘C-c C-c’ to evaluate the current code block and insert its results
+in the Org document. By default, evaluation is only turned on for
+‘emacs-lisp’ code blocks, however support exists for evaluating blocks
+in many languages. For a complete list of supported languages see the
+manual. The following shows a code block and its results.
+
+ #+BEGIN_SRC emacs-lisp
+ (+ 1 2 3 4)
+ #+END_SRC
+
+ #+RESULTS:
+ : 10
+
+ 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.
+
+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 controls the _collection_, _type_,
+_format_, and _handling_ of code block results.
+
+Collection
+ How the results should be collected from the code block. You may
+ choose either ‘output’ or ‘value’ (the default).
+
+Type
+ What result types to expect from the execution of the code block.
+ You may choose among ‘table’, ‘list’, ‘scalar’, and ‘file’. Org
+ tries to guess it if you do not provide it.
+
+Format
+ How Org processes results. Some possible values are ‘code’,
+ ‘drawer’, ‘html’, ‘latex’, ‘link’, and ‘raw’.
+
+Handling
+ How to insert the results once properly formatted. Allowed values
+ are ‘silent’, ‘replace’ (the default), ‘append’, or ‘prepend’.
+
+ Code blocks which output results to files—e.g.: graphs, diagrams and
+figures—can accept a ‘:file FILENAME’ header argument, in which case the
+results are saved to the named file, and a link to the file is inserted
+into the buffer.
+
+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.
+
+ The ‘exports’ header argument is to specify if that part of the Org
+file is exported to, say, HTML or LaTeX formats. It can be set to
+either ‘code’, ‘results’, ‘both’ or ‘none’.
+
+Extracting source code
+======================
+
+Use ‘C-c C-v t’ to create pure source code files by extracting code from
+source blocks in the current buffer. This is referred to as
+“tangling”—a term adopted from the literate programming community.
+During tangling of code blocks their bodies are expanded using
+‘org-babel-expand-src-block’, which can expand both variable and “Noweb”
+style references. In order to tangle a code block it must have a
+‘tangle’ header argument, see the manual for details.
+
+
+File: orgguide.info, Node: Miscellaneous, Prev: Working with Source Code, Up: Top
+
+15 Miscellaneous
+****************
+
+Completion
+==========
+
+Org has in-buffer completions with ‘M-<TAB>’. No minibuffer is
+involved. Type one or more letters and invoke the hot key to complete
+the text in-place.
+
+ For example, this command will complete TeX symbols after ‘\’, TODO
+keywords at the beginning of a headline, and tags after ‘:’ in a
+headline.
+
+Structure Templates
+===================
+
+To quickly insert empty structural blocks, such as ‘#+BEGIN_SRC’ ...
+‘#+END_SRC’, or to wrap existing text in such a block, use
+
+‘C-c C-,’
+ Prompt for a type of block structure, and insert the block at
+ point. If the region is active, it is wrapped in the block.
+
+Clean 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
+
+ This kind of view can be achieved dynamically at display time using
+Org Indent mode (‘M-x org-indent-mode <RET>’), which prepends intangible
+space to each line. You can turn on Org Indent mode for all files by
+customizing the variable ‘org-startup-indented’, or you can turn it on
+for individual files using
+
+ #+STARTUP: indent
+
+ If you want the indentation to be hard space characters so that the
+plain text file looks as similar as possible to the Emacs display, Org
+supports you by helping to indent (with ‘<TAB>’) text below each
+headline, by hiding leading stars, and by only using levels 1, 3, etc to
+get two characters indentation for each level. To get this support in a
+file, use
+
+ #+STARTUP: hidestars odd
+
+
+
+Tag Table:
+Node: Top922
+Node: Introduction5668
+Ref: Installation6354
+Ref: Activation7066
+Ref: Feedback7509
+Node: Document Structure7743
+Node: Headlines8814
+Ref: Headlines-Footnote-19696
+Node: Visibility Cycling9819
+Node: Motion11094
+Node: Structure Editing11516
+Ref: Structure Editing-Footnote-112710
+Node: Sparse Trees12814
+Ref: Sparse Trees-Footnote-113882
+Node: Plain Lists13997
+Node: Tables16503
+Ref: Creation and conversion18194
+Ref: Re-aligning and field motion18746
+Ref: Column and row editing19262
+Node: Hyperlinks20267
+Ref: Internal links21025
+Ref: External Links21478
+Ref: Handling Links23308
+Node: TODO Items24697
+Node: TODO Basics25674
+Node: Multi-state Workflow27069
+Node: Progress Logging28865
+Ref: Closing items29612
+Ref: Tracking TODO state changes30167
+Ref: Progress Logging-Footnote-131166
+Ref: Progress Logging-Footnote-231239
+Node: Priorities31317
+Node: Breaking Down Tasks32213
+Node: Checkboxes33016
+Node: Tags34076
+Ref: Tag inheritance34701
+Ref: Setting tags35439
+Ref: Tag groups37159
+Ref: Tag searches37955
+Ref: Tags-Footnote-139047
+Node: Properties39151
+Node: Dates and Times40910
+Node: Timestamps41512
+Node: Creating Timestamps43569
+Node: Deadlines and Scheduling45230
+Ref: Deadlines and Scheduling-Footnote-147254
+Ref: Deadlines and Scheduling-Footnote-247415
+Node: Clocking Work Time47578
+Node: Capture Refile Archive48891
+Node: Capture49699
+Ref: Setting up capture50001
+Ref: Using capture50272
+Ref: Capture templates50867
+Ref: Capture-Footnote-152283
+Ref: Capture-Footnote-252394
+Node: Refile and Copy52485
+Node: Archiving53683
+Node: Agenda Views54995
+Node: Agenda Files56450
+Node: Agenda Dispatcher57110
+Node: Built-in Agenda Views58040
+Node: Global TODO List59129
+Node: Matching Tags and Properties59846
+Node: Search View61815
+Node: Agenda Commands62925
+Ref: Motion (1)63511
+Ref: View/Go to Org file63652
+Ref: Change display63999
+Ref: Remote editing65087
+Ref: Quit and exit66278
+Node: Custom Agenda Views66484
+Node: Markup67960
+Node: Paragraphs68786
+Node: Emphasis and Monospace69908
+Node: Embedded LaTeX70326
+Node: Literal examples71195
+Node: Images72285
+Node: Creating Footnotes72886
+Node: Exporting73807
+Node: The Export Dispatcher74683
+Node: Export Settings75213
+Node: Table of Contents76038
+Node: Include Files76771
+Node: Comment Lines77457
+Node: ASCII/UTF-8 Export78155
+Node: HTML Export78854
+Node: LaTeX Export79862
+Node: iCalendar Export81501
+Node: Publishing82202
+Node: Working with Source Code83804
+Ref: Using header arguments85071
+Ref: Evaluating code blocks86249
+Ref: Results of evaluation87124
+Ref: Exporting code blocks88346
+Ref: Extracting source code88810
+Node: Miscellaneous89337
+Ref: Completion89460
+Ref: Structure Templates89797
+Ref: Clean view90123
+
+End Tag Table
+
+
+Local Variables:
+coding: utf-8
+End:
diff --git a/elpa/org-9.5.2/ox-ascii.el b/elpa/org-9.5.2/ox-ascii.el
new file mode 100644
index 0000000..78e6fb4
--- /dev/null
+++ b/elpa/org-9.5.2/ox-ascii.el
@@ -0,0 +1,2205 @@
+;;; ox-ascii.el --- ASCII Back-End for Org Export Engine -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <n.goaziou at gmail dot com>
+;; Maintainer: Nicolas Goaziou <n.goaziou at gmail dot com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; This library implements an ASCII back-end for Org generic exporter.
+;; See Org manual for more information.
+
+;;; Code:
+
+(require 'ox)
+(require 'ox-publish)
+(require 'cl-lib)
+
+;;; Function Declarations
+
+(declare-function aa2u "ext:ascii-art-to-unicode" ())
+
+;;; Define Back-End
+;;
+;; The following setting won't allow modifying preferred charset
+;; through a buffer keyword or an option item, but, since the property
+;; will appear in communication channel nonetheless, it allows
+;; overriding `org-ascii-charset' variable on the fly by the ext-plist
+;; mechanism.
+;;
+;; We also install a filter for headlines and sections, in order to
+;; control blank lines separating them in output string.
+
+(org-export-define-backend 'ascii
+ '((bold . org-ascii-bold)
+ (center-block . org-ascii-center-block)
+ (clock . org-ascii-clock)
+ (code . org-ascii-code)
+ (drawer . org-ascii-drawer)
+ (dynamic-block . org-ascii-dynamic-block)
+ (entity . org-ascii-entity)
+ (example-block . org-ascii-example-block)
+ (export-block . org-ascii-export-block)
+ (export-snippet . org-ascii-export-snippet)
+ (fixed-width . org-ascii-fixed-width)
+ (footnote-reference . org-ascii-footnote-reference)
+ (headline . org-ascii-headline)
+ (horizontal-rule . org-ascii-horizontal-rule)
+ (inline-src-block . org-ascii-inline-src-block)
+ (inlinetask . org-ascii-inlinetask)
+ (inner-template . org-ascii-inner-template)
+ (italic . org-ascii-italic)
+ (item . org-ascii-item)
+ (keyword . org-ascii-keyword)
+ (latex-environment . org-ascii-latex-environment)
+ (latex-fragment . org-ascii-latex-fragment)
+ (line-break . org-ascii-line-break)
+ (link . org-ascii-link)
+ (node-property . org-ascii-node-property)
+ (paragraph . org-ascii-paragraph)
+ (plain-list . org-ascii-plain-list)
+ (plain-text . org-ascii-plain-text)
+ (planning . org-ascii-planning)
+ (property-drawer . org-ascii-property-drawer)
+ (quote-block . org-ascii-quote-block)
+ (radio-target . org-ascii-radio-target)
+ (section . org-ascii-section)
+ (special-block . org-ascii-special-block)
+ (src-block . org-ascii-src-block)
+ (statistics-cookie . org-ascii-statistics-cookie)
+ (strike-through . org-ascii-strike-through)
+ (subscript . org-ascii-subscript)
+ (superscript . org-ascii-superscript)
+ (table . org-ascii-table)
+ (table-cell . org-ascii-table-cell)
+ (table-row . org-ascii-table-row)
+ (target . org-ascii-target)
+ (template . org-ascii-template)
+ (timestamp . org-ascii-timestamp)
+ (underline . org-ascii-underline)
+ (verbatim . org-ascii-verbatim)
+ (verse-block . org-ascii-verse-block))
+ :menu-entry
+ '(?t "Export to Plain Text"
+ ((?A "As ASCII buffer"
+ (lambda (a s v b)
+ (org-ascii-export-as-ascii a s v b '(:ascii-charset ascii))))
+ (?a "As ASCII file"
+ (lambda (a s v b)
+ (org-ascii-export-to-ascii a s v b '(:ascii-charset ascii))))
+ (?L "As Latin1 buffer"
+ (lambda (a s v b)
+ (org-ascii-export-as-ascii a s v b '(:ascii-charset latin1))))
+ (?l "As Latin1 file"
+ (lambda (a s v b)
+ (org-ascii-export-to-ascii a s v b '(:ascii-charset latin1))))
+ (?U "As UTF-8 buffer"
+ (lambda (a s v b)
+ (org-ascii-export-as-ascii a s v b '(:ascii-charset utf-8))))
+ (?u "As UTF-8 file"
+ (lambda (a s v b)
+ (org-ascii-export-to-ascii a s v b '(:ascii-charset utf-8))))))
+ :filters-alist '((:filter-headline . org-ascii-filter-headline-blank-lines)
+ (:filter-parse-tree org-ascii-filter-paragraph-spacing
+ org-ascii-filter-comment-spacing)
+ (:filter-section . org-ascii-filter-headline-blank-lines))
+ :options-alist
+ '((:subtitle "SUBTITLE" nil nil parse)
+ (:ascii-bullets nil nil org-ascii-bullets)
+ (:ascii-caption-above nil nil org-ascii-caption-above)
+ (:ascii-charset nil nil org-ascii-charset)
+ (:ascii-global-margin nil nil org-ascii-global-margin)
+ (:ascii-format-drawer-function nil nil org-ascii-format-drawer-function)
+ (:ascii-format-inlinetask-function
+ nil nil org-ascii-format-inlinetask-function)
+ (:ascii-headline-spacing nil nil org-ascii-headline-spacing)
+ (:ascii-indented-line-width nil nil org-ascii-indented-line-width)
+ (:ascii-inlinetask-width nil nil org-ascii-inlinetask-width)
+ (:ascii-inner-margin nil nil org-ascii-inner-margin)
+ (:ascii-links-to-notes nil nil org-ascii-links-to-notes)
+ (:ascii-list-margin nil nil org-ascii-list-margin)
+ (:ascii-paragraph-spacing nil nil org-ascii-paragraph-spacing)
+ (:ascii-quote-margin nil nil org-ascii-quote-margin)
+ (:ascii-table-keep-all-vertical-lines
+ nil nil org-ascii-table-keep-all-vertical-lines)
+ (:ascii-table-use-ascii-art nil nil org-ascii-table-use-ascii-art)
+ (:ascii-table-widen-columns nil nil org-ascii-table-widen-columns)
+ (:ascii-text-width nil nil org-ascii-text-width)
+ (:ascii-underline nil nil org-ascii-underline)
+ (:ascii-verbatim-format nil nil org-ascii-verbatim-format)))
+
+
+
+;;; User Configurable Variables
+
+(defgroup org-export-ascii nil
+ "Options for exporting Org mode files to ASCII."
+ :tag "Org Export ASCII"
+ :group 'org-export)
+
+(defcustom org-ascii-text-width 72
+ "Maximum width of exported text.
+This number includes margin size, as set in
+`org-ascii-global-margin'."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'integer)
+
+(defcustom org-ascii-global-margin 0
+ "Width of the left margin, in number of characters."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'integer)
+
+(defcustom org-ascii-inner-margin 2
+ "Width of the inner margin, in number of characters.
+Inner margin is applied between each headline."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'integer)
+
+(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. 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")
+ :type 'integer)
+
+(defcustom org-ascii-list-margin 0
+ "Width of margin used for plain lists, in characters.
+This margin applies to top level list only, not to its
+sub-lists."
+ :group 'org-export-ascii
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'integer)
+
+(defcustom org-ascii-inlinetask-width 30
+ "Width of inline tasks, in number of characters.
+This number ignores any margin."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'integer)
+
+(defcustom org-ascii-headline-spacing '(1 . 2)
+ "Number of blank lines inserted around headlines.
+
+This variable can be set to a cons cell. In that case, its car
+represents the number of blank lines present before headline
+contents whereas its cdr reflects the number of blank lines after
+contents.
+
+A nil value replicates the number of blank lines found in the
+original Org buffer at the same place."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "Replicate original spacing" nil)
+ (cons :tag "Set a uniform spacing"
+ (integer :tag "Number of blank lines before contents")
+ (integer :tag "Number of blank lines after contents"))))
+
+(defcustom org-ascii-indented-line-width 'auto
+ "Additional indentation width for the first line in a paragraph.
+If the value is an integer, indent the first line of each
+paragraph by this width, unless it is located at the beginning of
+a section, in which case indentation is removed from that line.
+If it is the symbol `auto' preserve indentation from original
+document."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (integer :tag "Number of white spaces characters")
+ (const :tag "Preserve original width" auto)))
+
+(defcustom org-ascii-paragraph-spacing 'auto
+ "Number of white lines between paragraphs.
+If the value is an integer, add this number of blank lines
+between contiguous paragraphs. If is it the symbol `auto', keep
+the same number of blank lines as in the original document."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (integer :tag "Number of blank lines")
+ (const :tag "Preserve original spacing" auto)))
+
+(defcustom org-ascii-charset 'ascii
+ "The charset allowed to represent various elements and objects.
+Possible values are:
+`ascii' Only use plain ASCII characters
+`latin1' Include Latin-1 characters
+`utf-8' Use all UTF-8 characters"
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "ASCII" ascii)
+ (const :tag "Latin-1" latin1)
+ (const :tag "UTF-8" utf-8)))
+
+(defcustom org-ascii-underline '((ascii ?= ?~ ?-)
+ (latin1 ?= ?~ ?-)
+ (utf-8 ?═ ?─ ?╌ ?┄ ?┈))
+ "Characters for underlining headings in ASCII export.
+
+Alist whose key is a symbol among `ascii', `latin1' and `utf-8'
+and whose value is a list of characters.
+
+For each supported charset, this variable associates a sequence
+of underline characters. In a sequence, the characters will be
+used in order for headlines level 1, 2, ... If no character is
+available for a given level, the headline won't be underlined."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(list
+ (cons :tag "Underline characters sequence"
+ (const :tag "ASCII charset" ascii)
+ (repeat character))
+ (cons :tag "Underline characters sequence"
+ (const :tag "Latin-1 charset" latin1)
+ (repeat character))
+ (cons :tag "Underline characters sequence"
+ (const :tag "UTF-8 charset" utf-8)
+ (repeat character))))
+
+(defcustom org-ascii-bullets '((ascii ?* ?+ ?-)
+ (latin1 ?§ ?¶)
+ (utf-8 ?◊))
+ "Bullet characters for headlines converted to lists in ASCII export.
+
+Alist whose key is a symbol among `ascii', `latin1' and `utf-8'
+and whose value is a list of characters.
+
+The first character is used for the first level considered as low
+level, and so on. If there are more levels than characters given
+here, the list will be repeated.
+
+Note that this variable doesn't affect plain lists
+representation."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(list
+ (cons :tag "Bullet characters for low level headlines"
+ (const :tag "ASCII charset" ascii)
+ (repeat character))
+ (cons :tag "Bullet characters for low level headlines"
+ (const :tag "Latin-1 charset" latin1)
+ (repeat character))
+ (cons :tag "Bullet characters for low level headlines"
+ (const :tag "UTF-8 charset" utf-8)
+ (repeat character))))
+
+(defcustom org-ascii-links-to-notes t
+ "Non-nil means convert links to notes before the next headline.
+When nil, the link will be exported in place. If the line
+becomes long in this way, it will be wrapped."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defcustom org-ascii-table-keep-all-vertical-lines nil
+ "Non-nil means keep all vertical lines in ASCII tables.
+When nil, vertical lines will be removed except for those needed
+for column grouping."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defcustom org-ascii-table-widen-columns t
+ "Non-nil means widen narrowed columns for export.
+When nil, narrowed columns will look in ASCII export just like in
+Org mode, i.e. with \"=>\" as ellipsis."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defcustom org-ascii-table-use-ascii-art nil
+ "Non-nil means \"table.el\" tables are turned into ASCII art.
+It only makes sense when export charset is `utf-8'. It is nil by
+default since it requires \"ascii-art-to-unicode.el\" package,
+available through, e.g., GNU ELPA."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defcustom org-ascii-caption-above nil
+ "When non-nil, place caption string before the element.
+Otherwise, place it right after it."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defcustom org-ascii-verbatim-format "`%s'"
+ "Format string used for verbatim text and inline code."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string)
+
+(defcustom org-ascii-format-drawer-function
+ (lambda (_name contents _width) contents)
+ "Function called to format a drawer in ASCII.
+
+The function must accept three parameters:
+ NAME the drawer name, like \"LOGBOOK\"
+ CONTENTS the contents of the drawer.
+ WIDTH the text width within the drawer.
+
+The function should return either the string to be exported or
+nil to ignore the drawer.
+
+The default value simply returns the value of CONTENTS."
+ :group 'org-export-ascii
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'function)
+
+(defcustom org-ascii-format-inlinetask-function
+ 'org-ascii-format-inlinetask-default
+ "Function called to format an inlinetask in ASCII.
+
+The function must accept nine parameters:
+ TODO the todo keyword, as a string
+ TODO-TYPE the todo type, a symbol among `todo', `done' and nil.
+ PRIORITY the inlinetask priority, as a string
+ NAME the inlinetask name, as a string.
+ TAGS the inlinetask tags, as a list of strings.
+ CONTENTS the contents of the inlinetask, as a string.
+ WIDTH the width of the inlinetask, as a number.
+ INLINETASK the inlinetask itself.
+ INFO the info channel.
+
+The function should return either the string to be exported or
+nil to ignore the inline task."
+ :group 'org-export-ascii
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'function)
+
+
+
+;;; Internal Functions
+
+;; Internal functions fall into three categories.
+
+;; The first one is about text formatting. The core functions are
+;; `org-ascii--current-text-width' and
+;; `org-ascii--current-justification', which determine, respectively,
+;; the current text width allowed to a given element and its expected
+;; justification. Once this information is known,
+;; `org-ascii--fill-string', `org-ascii--justify-lines',
+;; `org-ascii--justify-element' `org-ascii--box-string' and
+;; `org-ascii--indent-string' can operate on a given output string.
+;; In particular, justification happens at the regular (i.e.,
+;; non-greater) element level, which means that when the exporting
+;; process reaches a container (e.g., a center block) content are
+;; already justified.
+
+;; The second category contains functions handling elements listings,
+;; triggered by "#+TOC:" keyword. As such, `org-ascii--build-toc'
+;; returns a complete table of contents, `org-ascii--list-listings'
+;; returns a list of referenceable src-block elements, and
+;; `org-ascii--list-tables' does the same for table elements.
+
+;; The third category includes general helper functions.
+;; `org-ascii--build-title' creates the title for a given headline
+;; or inlinetask element. `org-ascii--build-caption' returns the
+;; caption string associated to a table or a src-block.
+;; `org-ascii--describe-links' creates notes about links for
+;; insertion at the end of a section. It uses
+;; `org-ascii--unique-links' to get the list of links to describe.
+;; Eventually, `org-ascii--translate' translates a string according
+;; to language and charset specification.
+
+
+(defun org-ascii--fill-string (s text-width info &optional justify)
+ "Fill a string with specified text-width and return it.
+
+S is the string being filled. TEXT-WIDTH is an integer
+specifying maximum length of a line. INFO is the plist used as
+a communication channel.
+
+Optional argument JUSTIFY can specify any type of justification
+among `left', `center', `right' or `full'. A nil value is
+equivalent to `left'. For a justification that doesn't also fill
+string, see `org-ascii--justify-lines' and
+`org-ascii--justify-block'.
+
+Return nil if S isn't a string."
+ (when (stringp s)
+ (let ((double-space-p sentence-end-double-space))
+ (with-temp-buffer
+ (let ((fill-column text-width)
+ (use-hard-newlines t)
+ (sentence-end-double-space double-space-p))
+ (insert (if (plist-get info :preserve-breaks)
+ (replace-regexp-in-string "\n" hard-newline s)
+ s))
+ (fill-region (point-min) (point-max) justify))
+ (buffer-string)))))
+
+(defun org-ascii--justify-lines (s text-width how)
+ "Justify all lines in string S.
+TEXT-WIDTH is an integer specifying maximum length of a line.
+HOW determines the type of justification: it can be `left',
+`right', `full' or `center'."
+ (with-temp-buffer
+ (insert s)
+ (goto-char (point-min))
+ (let ((fill-column text-width)
+ ;; Ensure that `indent-tabs-mode' is nil so that indentation
+ ;; will always be achieved using spaces rather than tabs.
+ (indent-tabs-mode nil)
+ ;; Disable `adaptive-fill-mode' so it doesn't prevent
+ ;; filling lines matching `adaptive-fill-regexp'.
+ (adaptive-fill-mode nil))
+ (while (< (point) (point-max))
+ (justify-current-line how)
+ (forward-line)))
+ (buffer-string)))
+
+(defun org-ascii--justify-element (contents element info)
+ "Justify CONTENTS of ELEMENT.
+INFO is a plist used as a communication channel. Justification
+is done according to the type of element. More accurately,
+paragraphs are filled and other elements are justified as blocks,
+that is according to the widest non blank line in CONTENTS."
+ (if (not (org-string-nw-p contents)) contents
+ (let ((text-width (org-ascii--current-text-width element info))
+ (how (org-ascii--current-justification element)))
+ (cond
+ ((eq (org-element-type element) 'paragraph)
+ ;; Paragraphs are treated specially as they need to be filled.
+ (org-ascii--fill-string contents text-width info how))
+ ((eq how 'left) contents)
+ (t (with-temp-buffer
+ (insert contents)
+ (goto-char (point-min))
+ (catch 'exit
+ (let ((max-width 0))
+ ;; Compute maximum width. Bail out if it is greater
+ ;; than page width, since no justification is
+ ;; possible.
+ (save-excursion
+ (while (not (eobp))
+ (unless (looking-at-p "[ \t]*$")
+ (end-of-line)
+ (let ((column (current-column)))
+ (cond
+ ((>= column text-width) (throw 'exit contents))
+ ((> column max-width) (setq max-width column)))))
+ (forward-line)))
+ ;; Justify every line according to TEXT-WIDTH and
+ ;; MAX-WIDTH.
+ (let ((offset (/ (- text-width max-width)
+ (if (eq how 'right) 1 2))))
+ (if (zerop offset) (throw 'exit contents)
+ (while (not (eobp))
+ (unless (looking-at-p "[ \t]*$")
+ (indent-to-column offset))
+ (forward-line)))))
+ (buffer-string))))))))
+
+(defun org-ascii--indent-string (s width)
+ "Indent string S by WIDTH white spaces.
+Empty lines are not indented."
+ (when (stringp s)
+ (replace-regexp-in-string
+ "\\(^\\)[ \t]*\\S-" (make-string width ?\s) s nil nil 1)))
+
+(defun org-ascii--box-string (s info)
+ "Return string S with a partial box to its left.
+INFO is a plist used as a communication channel."
+ (let ((utf8p (eq (plist-get info :ascii-charset) 'utf-8)))
+ (format (if utf8p "┌────\n%s\n└────" ",----\n%s\n`----")
+ (replace-regexp-in-string
+ "^" (if utf8p "│ " "| ")
+ ;; Remove last newline character.
+ (replace-regexp-in-string "\n[ \t]*\\'" "" s)))))
+
+(defun org-ascii--current-text-width (element info)
+ "Return maximum text width for ELEMENT's contents.
+INFO is a plist used as a communication channel."
+ (pcase (org-element-type element)
+ ;; Elements with an absolute width: `headline' and `inlinetask'.
+ (`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)))))
+ ;; 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
+ ;; 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.
+Return value is a symbol among `left', `center', `right' and
+`full'."
+ (let (justification)
+ (while (and (not justification)
+ (setq element (org-element-property :parent element)))
+ (pcase (org-element-type element)
+ (`center-block (setq justification 'center))
+ (`special-block
+ (let ((name (org-element-property :type element)))
+ (cond ((string= name "JUSTIFYRIGHT") (setq justification 'right))
+ ((string= name "JUSTIFYLEFT") (setq justification 'left)))))))
+ (or justification 'left)))
+
+(defun org-ascii--build-title
+ (element info text-width &optional underline notags toc)
+ "Format ELEMENT title and return it.
+
+ELEMENT is either an `headline' or `inlinetask' element. INFO is
+a plist used as a communication channel. TEXT-WIDTH is an
+integer representing the maximum length of a line.
+
+When optional argument UNDERLINE is non-nil, underline title,
+without the tags, according to `org-ascii-underline'
+specifications.
+
+If optional argument NOTAGS is non-nil, no tags will be added to
+the title.
+
+When optional argument TOC is non-nil, use optional title if
+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)
+ (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
+ (if (and toc headlinep) (org-export-get-alt-title element info)
+ (org-element-property :title element))
+ info)))
+ (todo
+ (and (plist-get info :with-todo-keywords)
+ (let ((todo (org-element-property :todo-keyword element)))
+ (and todo (concat (org-export-data todo info) " ")))))
+ (tags (and (not notags)
+ (plist-get info :with-tags)
+ (let ((tag-list (org-export-get-tags element info)))
+ (and tag-list
+ (org-make-tag-string tag-list)))))
+ (priority
+ (and (plist-get info :with-priority)
+ (let ((char (org-element-property :priority element)))
+ (and char (format "(#%c) " char)))))
+ (first-part (concat numbers todo priority text)))
+ (concat
+ first-part
+ ;; Align tags, if any.
+ (when tags
+ (format
+ (format " %%%ds"
+ (max (- text-width (1+ (string-width first-part)))
+ (string-width tags)))
+ tags))
+ ;; Maybe underline text, if ELEMENT type is `headline' and an
+ ;; underline character has been defined.
+ (when (and underline headlinep)
+ (let ((under-char
+ (nth (1- (org-export-get-relative-level element info))
+ (cdr (assq (plist-get info :ascii-charset)
+ (plist-get info :ascii-underline))))))
+ (and under-char
+ (concat "\n"
+ (make-string (/ (string-width first-part)
+ (char-width under-char))
+ under-char))))))))
+
+(defun org-ascii--has-caption-p (element _info)
+ "Non-nil when ELEMENT has a caption affiliated keyword.
+INFO is a plist used as a communication channel. This function
+is meant to be used as a predicate for `org-export-get-ordinal'."
+ (org-element-property :caption element))
+
+(defun org-ascii--build-caption (element info)
+ "Return caption string for ELEMENT, if applicable.
+
+INFO is a plist used as a communication channel.
+
+The caption string contains the sequence number of ELEMENT along
+with its real caption. Return nil when ELEMENT has no affiliated
+caption keyword."
+ (let ((caption (org-export-get-caption element)))
+ (when caption
+ ;; Get sequence number of current src-block among every
+ ;; src-block with a caption.
+ (let ((reference
+ (org-export-get-ordinal
+ element info nil 'org-ascii--has-caption-p))
+ (title-fmt (org-ascii--translate
+ (pcase (org-element-type element)
+ (`table "Table %d:")
+ (`src-block "Listing %d:"))
+ info)))
+ (org-ascii--fill-string
+ (concat (format title-fmt reference)
+ " "
+ (org-export-data caption info))
+ (org-ascii--current-text-width element info) info)))))
+
+(defun org-ascii--build-toc (info &optional n keyword scope)
+ "Return a table of contents.
+
+INFO is a plist used as a communication channel.
+
+Optional argument N, when non-nil, is an integer specifying the
+depth of the table.
+
+Optional argument KEYWORD specifies the TOC keyword, if any, from
+which the table of contents generation has been initiated.
+
+When optional argument SCOPE is non-nil, build a table of
+contents according to the specified scope."
+ (concat
+ (unless scope
+ (let ((title (org-ascii--translate "Table of Contents" info)))
+ (concat title "\n"
+ (make-string
+ (string-width title)
+ (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_))
+ "\n\n")))
+ (let ((text-width
+ (if keyword (org-ascii--current-text-width keyword info)
+ (- (plist-get info :ascii-text-width)
+ (plist-get info :ascii-global-margin)))))
+ (mapconcat
+ (lambda (headline)
+ (let* ((level (org-export-get-relative-level headline info))
+ (indent (* (1- level) 3)))
+ (concat
+ (unless (zerop indent) (concat (make-string (1- indent) ?.) " "))
+ (org-ascii--build-title
+ headline info (- text-width indent) nil
+ (or (not (plist-get info :with-tags))
+ (eq (plist-get info :with-tags) 'not-in-toc))
+ 'toc))))
+ (org-export-collect-headlines info n scope) "\n"))))
+
+(defun org-ascii--list-listings (keyword info)
+ "Return a list of listings.
+
+KEYWORD is the keyword that initiated the list of listings
+generation. INFO is a plist used as a communication channel."
+ (let ((title (org-ascii--translate "List of Listings" info)))
+ (concat
+ title "\n"
+ (make-string (string-width title)
+ (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_))
+ "\n\n"
+ (let ((text-width
+ (if keyword (org-ascii--current-text-width keyword info)
+ (- (plist-get info :ascii-text-width)
+ (plist-get info :ascii-global-margin))))
+ ;; Use a counter instead of retrieving ordinal of each
+ ;; src-block.
+ (count 0))
+ (mapconcat
+ (lambda (src-block)
+ ;; Store initial text so its length can be computed. This is
+ ;; used to properly align caption right to it in case of
+ ;; filling (like contents of a description list item).
+ (let* ((initial-text
+ (format (org-ascii--translate "Listing %d:" info)
+ (cl-incf count)))
+ (initial-width (string-width initial-text)))
+ (concat
+ initial-text " "
+ (org-trim
+ (org-ascii--indent-string
+ (org-ascii--fill-string
+ ;; Use short name in priority, if available.
+ (let ((caption (or (org-export-get-caption src-block t)
+ (org-export-get-caption src-block))))
+ (org-export-data caption info))
+ (- text-width initial-width) info)
+ initial-width)))))
+ (org-export-collect-listings info) "\n")))))
+
+(defun org-ascii--list-tables (keyword info)
+ "Return a list of tables.
+
+KEYWORD is the keyword that initiated the list of tables
+generation. INFO is a plist used as a communication channel."
+ (let ((title (org-ascii--translate "List of Tables" info)))
+ (concat
+ title "\n"
+ (make-string (string-width title)
+ (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_))
+ "\n\n"
+ (let ((text-width
+ (if keyword (org-ascii--current-text-width keyword info)
+ (- (plist-get info :ascii-text-width)
+ (plist-get info :ascii-global-margin))))
+ ;; Use a counter instead of retrieving ordinal of each
+ ;; src-block.
+ (count 0))
+ (mapconcat
+ (lambda (table)
+ ;; Store initial text so its length can be computed. This is
+ ;; used to properly align caption right to it in case of
+ ;; filling (like contents of a description list item).
+ (let* ((initial-text
+ (format (org-ascii--translate "Table %d:" info)
+ (cl-incf count)))
+ (initial-width (string-width initial-text)))
+ (concat
+ initial-text " "
+ (org-trim
+ (org-ascii--indent-string
+ (org-ascii--fill-string
+ ;; Use short name in priority, if available.
+ (let ((caption (or (org-export-get-caption table t)
+ (org-export-get-caption table))))
+ (org-export-data caption info))
+ (- text-width initial-width) info)
+ initial-width)))))
+ (org-export-collect-tables info) "\n")))))
+
+(defun org-ascii--unique-links (element info)
+ "Return a list of unique link references in ELEMENT.
+ELEMENT is either a headline element or a section element. INFO
+is a plist used as a communication channel."
+ (let* (seen
+ (unique-link-p
+ ;; Return LINK if it wasn't referenced so far, or nil.
+ ;; Update SEEN links along the way.
+ (lambda (link)
+ (let ((footprint
+ ;; Normalize description in footprints.
+ (cons (org-element-property :raw-link link)
+ (let ((contents (org-element-contents link)))
+ (and contents
+ (replace-regexp-in-string
+ "[ \r\t\n]+" " "
+ (org-trim
+ (org-element-interpret-data contents))))))))
+ ;; Ignore LINK if it hasn't been translated already. It
+ ;; can happen if it is located in an affiliated keyword
+ ;; that was ignored.
+ (when (and (org-string-nw-p
+ (gethash link (plist-get info :exported-data)))
+ (not (member footprint seen)))
+ (push footprint seen) link)))))
+ (org-element-map (if (eq (org-element-type element) 'section)
+ element
+ ;; In a headline, only retrieve links in title
+ ;; and relative section, not in children.
+ (list (org-element-property :title element)
+ (car (org-element-contents element))))
+ 'link unique-link-p info nil 'headline t)))
+
+(defun org-ascii--describe-datum (datum info)
+ "Describe DATUM object or element.
+If DATUM is a string, consider it to be a file name, per
+`org-export-resolve-id-link'. INFO is the communication channel,
+as a plist."
+ (pcase (org-element-type datum)
+ (`plain-text (format "See file %s" datum)) ;External file
+ (`headline
+ (format (org-ascii--translate "See section %s" info)
+ (if (org-export-numbered-headline-p datum info)
+ (mapconcat #'number-to-string
+ (org-export-get-headline-number datum info)
+ ".")
+ (org-export-data (org-element-property :title datum) info))))
+ (_
+ (let ((number (org-export-get-ordinal
+ datum info nil #'org-ascii--has-caption-p))
+ ;; If destination is a target, make sure we can name the
+ ;; container it refers to.
+ (enumerable
+ (org-element-lineage datum
+ '(headline paragraph src-block table) t)))
+ (pcase (org-element-type enumerable)
+ (`headline
+ (format (org-ascii--translate "See section %s" info)
+ (if (org-export-numbered-headline-p enumerable info)
+ (mapconcat #'number-to-string number ".")
+ (org-export-data
+ (org-element-property :title enumerable) info))))
+ ((guard (not number))
+ (org-ascii--translate "Unknown reference" info))
+ (`paragraph
+ (format (org-ascii--translate "See figure %s" info) number))
+ (`src-block
+ (format (org-ascii--translate "See listing %s" info) number))
+ (`table
+ (format (org-ascii--translate "See table %s" info) number))
+ (_ (org-ascii--translate "Unknown reference" info)))))))
+
+(defun org-ascii--describe-links (links width info)
+ "Return a string describing a list of links.
+LINKS is a list of link type objects, as returned by
+`org-ascii--unique-links'. WIDTH is the text width allowed for
+the output string. INFO is a plist used as a communication
+channel."
+ (mapconcat
+ (lambda (link)
+ (let* ((type (org-element-property :type link))
+ (description (org-element-contents link))
+ (anchor (org-export-data
+ (or description (org-element-property :raw-link link))
+ info)))
+ (cond
+ ((member type '("coderef" "radio")) nil)
+ ((member type '("custom-id" "fuzzy" "id"))
+ ;; Only links with a description need an entry. Other are
+ ;; already handled in `org-ascii-link'.
+ (when description
+ (let ((dest (if (equal type "fuzzy")
+ (org-export-resolve-fuzzy-link link info)
+ (org-export-resolve-id-link link info))))
+ (concat
+ (org-ascii--fill-string
+ (format "[%s] %s" anchor (org-ascii--describe-datum dest info))
+ width info)
+ "\n\n"))))
+ ;; Do not add a link that cannot be resolved and doesn't have
+ ;; any description: destination is already visible in the
+ ;; paragraph.
+ ((not (org-element-contents link)) nil)
+ ;; Do not add a link already handled by custom export
+ ;; functions.
+ ((org-export-custom-protocol-maybe link anchor 'ascii info) nil)
+ (t
+ (concat
+ (org-ascii--fill-string
+ (format "[%s] <%s>" anchor (org-element-property :raw-link link))
+ width info)
+ "\n\n")))))
+ links ""))
+
+(defun org-ascii--checkbox (item info)
+ "Return checkbox string for ITEM or nil.
+INFO is a plist used as a communication channel."
+ (let ((utf8p (eq (plist-get info :ascii-charset) 'utf-8)))
+ (pcase (org-element-property :checkbox item)
+ (`on (if utf8p "☑ " "[X] "))
+ (`off (if utf8p "☐ " "[ ] "))
+ (`trans (if utf8p "☒ " "[-] ")))))
+
+
+
+;;; Template
+
+(defun org-ascii-template--document-title (info)
+ "Return document title, as a string.
+INFO is a plist used as a communication channel."
+ (let* ((text-width (plist-get info :ascii-text-width))
+ ;; Links in the title will not be resolved later, so we make
+ ;; sure their path is located right after them.
+ (info (org-combine-plists info '(:ascii-links-to-notes nil)))
+ (with-title (plist-get info :with-title))
+ (title (org-export-data
+ (when with-title (plist-get info :title)) info))
+ (subtitle (org-export-data
+ (when with-title (plist-get info :subtitle)) info))
+ (author (and (plist-get info :with-author)
+ (let ((auth (plist-get info :author)))
+ (and auth (org-export-data auth info)))))
+ (email (and (plist-get info :with-email)
+ (org-export-data (plist-get info :email) info)))
+ (date (and (plist-get info :with-date)
+ (org-export-data (org-export-get-date info) info))))
+ ;; There are two types of title blocks depending on the presence
+ ;; of a title to display.
+ (if (string= title "")
+ ;; Title block without a title. DATE is positioned at the top
+ ;; right of the document, AUTHOR to the top left and EMAIL
+ ;; just below.
+ (cond
+ ((and (org-string-nw-p date) (org-string-nw-p author))
+ (concat
+ author
+ (make-string (- text-width (string-width date) (string-width author))
+ ?\s)
+ date
+ (when (org-string-nw-p email) (concat "\n" email))
+ "\n\n\n"))
+ ((and (org-string-nw-p date) (org-string-nw-p email))
+ (concat
+ email
+ (make-string (- text-width (string-width date) (string-width email))
+ ?\s)
+ date "\n\n\n"))
+ ((org-string-nw-p date)
+ (concat
+ (org-ascii--justify-lines date text-width 'right)
+ "\n\n\n"))
+ ((and (org-string-nw-p author) (org-string-nw-p email))
+ (concat author "\n" email "\n\n\n"))
+ ((org-string-nw-p author) (concat author "\n\n\n"))
+ ((org-string-nw-p email) (concat email "\n\n\n")))
+ ;; Title block with a title. Document's TITLE, along with the
+ ;; AUTHOR and its EMAIL are both overlined and an underlined,
+ ;; centered. Date is just below, also centered.
+ (let* ((utf8p (eq (plist-get info :ascii-charset) 'utf-8))
+ ;; Format TITLE. It may be filled if it is too wide,
+ ;; that is wider than the two thirds of the total width.
+ (title-len (min (apply #'max
+ (mapcar #'string-width
+ (org-split-string
+ (concat title "\n" subtitle) "\n")))
+ (/ (* 2 text-width) 3)))
+ (formatted-title (org-ascii--fill-string title title-len info))
+ (formatted-subtitle (when (org-string-nw-p subtitle)
+ (org-ascii--fill-string subtitle title-len info)))
+ (line
+ (make-string
+ (min (+ (max title-len
+ (string-width (or author ""))
+ (string-width (or email "")))
+ 2)
+ text-width) (if utf8p ?━ ?_))))
+ (org-ascii--justify-lines
+ (concat line "\n"
+ (unless utf8p "\n")
+ (upcase formatted-title)
+ (and formatted-subtitle (concat "\n" formatted-subtitle))
+ (cond
+ ((and (org-string-nw-p author) (org-string-nw-p email))
+ (concat "\n\n" author "\n" email))
+ ((org-string-nw-p author) (concat "\n\n" author))
+ ((org-string-nw-p email) (concat "\n\n" email)))
+ "\n" line
+ (when (org-string-nw-p date) (concat "\n\n\n" date))
+ "\n\n\n") text-width 'center)))))
+
+(defun org-ascii-inner-template (contents info)
+ "Return complete document string after ASCII conversion.
+CONTENTS is the transcoded contents string. INFO is a plist
+holding export options."
+ (org-element-normalize-string
+ (let ((global-margin (plist-get info :ascii-global-margin)))
+ (org-ascii--indent-string
+ (concat
+ ;; 1. Document's body.
+ contents
+ ;; 2. Footnote definitions.
+ (let ((definitions (org-export-collect-footnote-definitions info))
+ ;; Insert full links right inside the footnote definition
+ ;; as they have no chance to be inserted later.
+ (info (org-combine-plists info '(:ascii-links-to-notes nil))))
+ (when definitions
+ (concat
+ "\n\n\n"
+ (let ((title (org-ascii--translate "Footnotes" info)))
+ (concat
+ title "\n"
+ (make-string
+ (string-width title)
+ (if (eq (plist-get info :ascii-charset) 'utf-8) ?─ ?_))))
+ "\n\n"
+ (let ((text-width (- (plist-get info :ascii-text-width)
+ global-margin)))
+ (mapconcat
+ (lambda (ref)
+ (let ((id (format "[%s] " (car ref))))
+ ;; Distinguish between inline definitions and
+ ;; full-fledged definitions.
+ (org-trim
+ (let ((def (nth 2 ref)))
+ (if (org-element-map def org-element-all-elements
+ #'identity info 'first-match)
+ ;; Full-fledged definition: footnote ID is
+ ;; inserted inside the first parsed
+ ;; paragraph (FIRST), if any, to be sure
+ ;; filling will take it into consideration.
+ (let ((first (car (org-element-contents def))))
+ (if (not (eq (org-element-type first) 'paragraph))
+ (concat id "\n" (org-export-data def info))
+ (push id (nthcdr 2 first))
+ (org-export-data def info)))
+ ;; Fill paragraph once footnote ID is inserted
+ ;; in order to have a correct length for first
+ ;; line.
+ (org-ascii--fill-string
+ (concat id (org-export-data def info))
+ text-width info))))))
+ definitions "\n\n"))))))
+ global-margin))))
+
+(defun org-ascii-template (contents info)
+ "Return complete document string after ASCII conversion.
+CONTENTS is the transcoded contents string. INFO is a plist
+holding export options."
+ (let ((global-margin (plist-get info :ascii-global-margin)))
+ (concat
+ ;; Build title block.
+ (org-ascii--indent-string
+ (concat (org-ascii-template--document-title info)
+ ;; 2. Table of contents.
+ (let ((depth (plist-get info :with-toc)))
+ (when depth
+ (concat
+ (org-ascii--build-toc info (and (wholenump depth) depth))
+ "\n\n\n"))))
+ global-margin)
+ ;; Document's body.
+ contents
+ ;; Creator. Justify it to the bottom right.
+ (and (plist-get info :with-creator)
+ (org-ascii--indent-string
+ (let ((text-width
+ (- (plist-get info :ascii-text-width) global-margin)))
+ (concat
+ "\n\n\n"
+ (org-ascii--fill-string
+ (plist-get info :creator) text-width info 'right)))
+ global-margin)))))
+
+(defun org-ascii--translate (s info)
+ "Translate string S according to specified language and charset.
+INFO is a plist used as a communication channel."
+ (let ((charset (intern (format ":%s" (plist-get info :ascii-charset)))))
+ (org-export-translate s charset info)))
+
+
+
+;;; Transcode Functions
+
+;;;; Bold
+
+(defun org-ascii-bold (_bold contents _info)
+ "Transcode BOLD from Org to ASCII.
+CONTENTS is the text with bold markup. INFO is a plist holding
+contextual information."
+ (format "*%s*" contents))
+
+
+;;;; Center Block
+
+(defun org-ascii-center-block (_center-block contents _info)
+ "Transcode a CENTER-BLOCK element from Org to ASCII.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ ;; Center has already been taken care of at a lower level, so
+ ;; there's nothing left to do.
+ contents)
+
+
+;;;; Clock
+
+(defun org-ascii-clock (clock _contents info)
+ "Transcode a CLOCK object from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (org-ascii--justify-element
+ (concat org-clock-string " "
+ (org-timestamp-translate (org-element-property :value clock))
+ (let ((time (org-element-property :duration clock)))
+ (and time
+ (concat " => "
+ (apply 'format
+ "%2s:%02s"
+ (org-split-string time ":"))))))
+ clock info))
+
+
+;;;; Code
+
+(defun org-ascii-code (code _contents info)
+ "Return a CODE object from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (format (plist-get info :ascii-verbatim-format)
+ (org-element-property :value code)))
+
+
+;;;; Drawer
+
+(defun org-ascii-drawer (drawer contents info)
+ "Transcode a DRAWER element from Org to ASCII.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (let ((name (org-element-property :drawer-name drawer))
+ (width (org-ascii--current-text-width drawer info)))
+ (funcall (plist-get info :ascii-format-drawer-function)
+ name contents width)))
+
+
+;;;; Dynamic Block
+
+(defun org-ascii-dynamic-block (_dynamic-block contents _info)
+ "Transcode a DYNAMIC-BLOCK element from Org to ASCII.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ contents)
+
+
+;;;; Entity
+
+(defun org-ascii-entity (entity _contents info)
+ "Transcode an ENTITY object from Org to ASCII.
+CONTENTS are the definition itself. INFO is a plist holding
+contextual information."
+ (org-element-property
+ (intern (concat ":" (symbol-name (plist-get info :ascii-charset))))
+ entity))
+
+
+;;;; Example Block
+
+(defun org-ascii-example-block (example-block _contents info)
+ "Transcode a EXAMPLE-BLOCK element from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (org-ascii--justify-element
+ (org-ascii--box-string
+ (org-export-format-code-default example-block info) info)
+ example-block info))
+
+
+;;;; Export Snippet
+
+(defun org-ascii-export-snippet (export-snippet _contents _info)
+ "Transcode a EXPORT-SNIPPET object from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (when (eq (org-export-snippet-backend export-snippet) 'ascii)
+ (org-element-property :value export-snippet)))
+
+
+;;;; Export Block
+
+(defun org-ascii-export-block (export-block _contents info)
+ "Transcode a EXPORT-BLOCK element from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (when (string= (org-element-property :type export-block) "ASCII")
+ (org-ascii--justify-element
+ (org-element-property :value export-block) export-block info)))
+
+
+;;;; Fixed Width
+
+(defun org-ascii-fixed-width (fixed-width _contents info)
+ "Transcode a FIXED-WIDTH element from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (org-ascii--justify-element
+ (org-ascii--box-string
+ (org-remove-indentation
+ (org-element-property :value fixed-width))
+ info)
+ fixed-width info))
+
+
+;;;; Footnote Definition
+
+;; Footnote Definitions are ignored. They are compiled at the end of
+;; the document, by `org-ascii-inner-template'.
+
+
+;;;; Footnote Reference
+
+(defun org-ascii-footnote-reference (footnote-reference _contents info)
+ "Transcode a FOOTNOTE-REFERENCE element from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (format "[%s]" (org-export-get-footnote-number footnote-reference info)))
+
+
+;;;; Headline
+
+(defun org-ascii-headline (headline contents info)
+ "Transcode a HEADLINE element from Org to ASCII.
+CONTENTS holds the contents of the headline. INFO is a plist
+holding contextual information."
+ ;; Don't export footnote section, which will be handled at the end
+ ;; of the template.
+ (unless (org-element-property :footnote-section-p headline)
+ (let* ((low-level (org-export-low-level-p headline info))
+ (width (org-ascii--current-text-width headline info))
+ ;; Export title early so that any link in it can be
+ ;; exported and seen in `org-ascii--unique-links'.
+ (title (org-ascii--build-title headline info width (not low-level)))
+ ;; Blank lines between headline and its contents.
+ ;; `org-ascii-headline-spacing', when set, overwrites
+ ;; original buffer's spacing.
+ (pre-blanks
+ (make-string (or (car (plist-get info :ascii-headline-spacing))
+ (org-element-property :pre-blank headline)
+ 0)
+ ?\n))
+ (links (and (plist-get info :ascii-links-to-notes)
+ (org-ascii--describe-links
+ (org-ascii--unique-links headline info) width info)))
+ ;; Re-build contents, inserting section links at the right
+ ;; place. The cost is low since build results are cached.
+ (body
+ (if (not (org-string-nw-p links)) contents
+ (let* ((contents (org-element-contents headline))
+ (section (let ((first (car contents)))
+ (and (eq (org-element-type first) 'section)
+ first))))
+ (concat (and section
+ (concat (org-element-normalize-string
+ (org-export-data section info))
+ "\n\n"))
+ links
+ (mapconcat (lambda (e) (org-export-data e info))
+ (if section (cdr contents) contents)
+ ""))))))
+ ;; Deep subtree: export it as a list item.
+ (if low-level
+ (let* ((bullets (cdr (assq (plist-get info :ascii-charset)
+ (plist-get info :ascii-bullets))))
+ (bullet
+ (format "%c "
+ (nth (mod (1- low-level) (length bullets)) bullets))))
+ (concat bullet title "\n" pre-blanks
+ ;; Contents, indented by length of bullet.
+ (org-ascii--indent-string body (length bullet))))
+ ;; Else: Standard headline.
+ (concat title "\n" pre-blanks body)))))
+
+
+;;;; Horizontal Rule
+
+(defun org-ascii-horizontal-rule (horizontal-rule _contents info)
+ "Transcode an HORIZONTAL-RULE object from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (let ((text-width (org-ascii--current-text-width horizontal-rule info))
+ (spec-width
+ (org-export-read-attribute :attr_ascii horizontal-rule :width)))
+ (org-ascii--justify-lines
+ (make-string (if (and spec-width (string-match "^[0-9]+$" spec-width))
+ (string-to-number spec-width)
+ text-width)
+ (if (eq (plist-get info :ascii-charset) 'utf-8) ?― ?-))
+ text-width 'center)))
+
+
+;;;; Inline Src Block
+
+(defun org-ascii-inline-src-block (inline-src-block _contents info)
+ "Transcode an INLINE-SRC-BLOCK element from Org to ASCII.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (format (plist-get info :ascii-verbatim-format)
+ (org-element-property :value inline-src-block)))
+
+
+;;;; Inlinetask
+
+(defun org-ascii-format-inlinetask-default
+ (_todo _type _priority _name _tags contents width inlinetask info)
+ "Format an inline task element for ASCII export.
+See `org-ascii-format-inlinetask-function' for a description
+of the parameters."
+ (let* ((utf8p (eq (plist-get info :ascii-charset) 'utf-8))
+ (width (or width (plist-get info :ascii-inlinetask-width))))
+ (org-ascii--indent-string
+ (concat
+ ;; Top line, with an additional blank line if not in UTF-8.
+ (make-string width (if utf8p ?━ ?_)) "\n"
+ (unless utf8p (concat (make-string width ? ) "\n"))
+ ;; Add title. Fill it if wider than inlinetask.
+ (let ((title (org-ascii--build-title inlinetask info width)))
+ (if (<= (string-width title) width) title
+ (org-ascii--fill-string title width info)))
+ "\n"
+ ;; If CONTENTS is not empty, insert it along with
+ ;; a separator.
+ (when (org-string-nw-p contents)
+ (concat (make-string width (if utf8p ?─ ?-)) "\n" contents))
+ ;; Bottom line.
+ (make-string width (if utf8p ?━ ?_)))
+ ;; Flush the inlinetask to the right.
+ (- (plist-get info :ascii-text-width) (plist-get info :ascii-global-margin)
+ (if (not (org-export-get-parent-headline inlinetask)) 0
+ (plist-get info :ascii-inner-margin))
+ (org-ascii--current-text-width inlinetask info)))))
+
+(defun org-ascii-inlinetask (inlinetask contents info)
+ "Transcode an INLINETASK element from Org to ASCII.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (let ((width (org-ascii--current-text-width inlinetask info)))
+ (funcall (plist-get info :ascii-format-inlinetask-function)
+ ;; todo.
+ (and (plist-get info :with-todo-keywords)
+ (let ((todo (org-element-property
+ :todo-keyword inlinetask)))
+ (and todo (org-export-data todo info))))
+ ;; todo-type
+ (org-element-property :todo-type inlinetask)
+ ;; priority
+ (and (plist-get info :with-priority)
+ (org-element-property :priority inlinetask))
+ ;; title
+ (org-export-data (org-element-property :title inlinetask) info)
+ ;; tags
+ (and (plist-get info :with-tags)
+ (org-element-property :tags inlinetask))
+ ;; contents and width
+ contents width inlinetask info)))
+
+
+;;;; Italic
+
+(defun org-ascii-italic (_italic contents _info)
+ "Transcode italic from Org to ASCII.
+CONTENTS is the text with italic markup. INFO is a plist holding
+contextual information."
+ (format "/%s/" contents))
+
+
+;;;; Item
+
+(defun org-ascii-item (item contents info)
+ "Transcode an ITEM element from Org to ASCII.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (let* ((utf8p (eq (plist-get info :ascii-charset) 'utf-8))
+ (checkbox (org-ascii--checkbox item info))
+ (list-type (org-element-property :type (org-export-get-parent item)))
+ (bullet
+ ;; First parent of ITEM is always the plain-list. Get
+ ;; `:type' property from it.
+ (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 "\\*" "‣" bul))))))))
+ (indentation (if (eq list-type 'descriptive) org-ascii-quote-margin
+ (string-width bullet))))
+ (concat
+ bullet
+ 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 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))))))
+
+
+;;;; Keyword
+
+(defun org-ascii-keyword (keyword _contents info)
+ "Transcode a KEYWORD element from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (let ((key (org-element-property :key keyword))
+ (value (org-element-property :value keyword)))
+ (cond
+ ((string= key "ASCII") (org-ascii--justify-element value keyword info))
+ ((string= key "TOC")
+ (org-ascii--justify-element
+ (let ((case-fold-search t))
+ (cond
+ ((string-match-p "\\<headlines\\>" value)
+ (let ((depth (and (string-match "\\<[0-9]+\\>" value)
+ (string-to-number (match-string 0 value))))
+ (scope
+ (cond
+ ((string-match ":target +\\(\".+?\"\\|\\S-+\\)" value) ;link
+ (org-export-resolve-link
+ (org-strip-quotes (match-string 1 value)) info))
+ ((string-match-p "\\<local\\>" value) keyword)))) ;local
+ (org-ascii--build-toc info depth keyword scope)))
+ ((string-match-p "\\<tables\\>" value)
+ (org-ascii--list-tables keyword info))
+ ((string-match-p "\\<listings\\>" value)
+ (org-ascii--list-listings keyword info))))
+ keyword info)))))
+
+
+;;;; Latex Environment
+
+(defun org-ascii-latex-environment (latex-environment _contents info)
+ "Transcode a LATEX-ENVIRONMENT element from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (when (plist-get info :with-latex)
+ (org-ascii--justify-element
+ (org-remove-indentation (org-element-property :value latex-environment))
+ latex-environment info)))
+
+
+;;;; Latex Fragment
+
+(defun org-ascii-latex-fragment (latex-fragment _contents info)
+ "Transcode a LATEX-FRAGMENT object from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (when (plist-get info :with-latex)
+ (org-element-property :value latex-fragment)))
+
+
+;;;; Line Break
+
+(defun org-ascii-line-break (_line-break _contents _info)
+ "Transcode a LINE-BREAK object from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual
+ information." hard-newline)
+
+
+;;;; Link
+
+(defun org-ascii-link (link desc info)
+ "Transcode a LINK object from Org to ASCII.
+
+DESC is the description part of the link, or the empty string.
+INFO is a plist holding contextual information."
+ (let ((type (org-element-property :type link)))
+ (cond
+ ((org-export-custom-protocol-maybe link desc 'ascii info))
+ ((string= type "coderef")
+ (let ((ref (org-element-property :path link)))
+ (format (org-export-get-coderef-format ref desc)
+ (org-export-resolve-coderef ref info))))
+ ;; Do not apply a special syntax on radio links. Though, use
+ ;; transcoded target's contents as output.
+ ((string= type "radio") desc)
+ ((member type '("custom-id" "fuzzy" "id"))
+ (let ((destination (if (string= type "fuzzy")
+ (org-export-resolve-fuzzy-link link info)
+ (org-export-resolve-id-link link info))))
+ (pcase (org-element-type destination)
+ ((guard desc)
+ (if (plist-get info :ascii-links-to-notes)
+ (format "[%s]" desc)
+ (concat desc
+ (format " (%s)"
+ (org-ascii--describe-datum destination info)))))
+ ;; External file.
+ (`plain-text destination)
+ (`headline
+ (if (org-export-numbered-headline-p destination info)
+ (mapconcat #'number-to-string
+ (org-export-get-headline-number destination info)
+ ".")
+ (org-export-data (org-element-property :title destination) info)))
+ ;; Handle enumerable elements and targets within them.
+ ((and (let number (org-export-get-ordinal
+ destination info nil #'org-ascii--has-caption-p))
+ (guard number))
+ (if (atom number) (number-to-string number)
+ (mapconcat #'number-to-string number ".")))
+ ;; Don't know what to do. Signal it.
+ (_ "???"))))
+ (t
+ (let ((path (org-element-property :raw-link link)))
+ (if (not (org-string-nw-p desc)) (format "<%s>" path)
+ (concat (format "[%s]" desc)
+ (and (not (plist-get info :ascii-links-to-notes))
+ (format " (<%s>)" path)))))))))
+
+
+;;;; Node Properties
+
+(defun org-ascii-node-property (node-property _contents _info)
+ "Transcode a NODE-PROPERTY element from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (format "%s:%s"
+ (org-element-property :key node-property)
+ (let ((value (org-element-property :value node-property)))
+ (if value (concat " " value) ""))))
+
+
+;;;; Paragraph
+
+(defun org-ascii-paragraph (paragraph contents info)
+ "Transcode a PARAGRAPH element from Org to ASCII.
+CONTENTS is the contents of the paragraph, as a string. INFO is
+the plist used as a communication channel."
+ (org-ascii--justify-element
+ (let ((indented-line-width (plist-get info :ascii-indented-line-width)))
+ (if (not (wholenump indented-line-width)) contents
+ (concat
+ ;; Do not indent first paragraph in a section.
+ (unless (and (not (org-export-get-previous-element paragraph info))
+ (eq (org-element-type (org-export-get-parent paragraph))
+ 'section))
+ (make-string indented-line-width ?\s))
+ (replace-regexp-in-string "\\`[ \t]+" "" contents))))
+ paragraph info))
+
+
+;;;; Plain List
+
+(defun org-ascii-plain-list (plain-list contents info)
+ "Transcode a PLAIN-LIST element from Org to ASCII.
+CONTENTS is the contents of the list. INFO is a plist holding
+contextual information."
+ (let ((margin (plist-get info :ascii-list-margin)))
+ (if (or (< margin 1)
+ (eq (org-element-type (org-export-get-parent plain-list)) 'item))
+ contents
+ (org-ascii--indent-string contents margin))))
+
+
+;;;; Plain Text
+
+(defun org-ascii-plain-text (text info)
+ "Transcode a TEXT string from Org to ASCII.
+INFO is a plist used as a communication channel."
+ (let ((utf8p (eq (plist-get info :ascii-charset) 'utf-8)))
+ (when (and utf8p (plist-get info :with-smart-quotes))
+ (setq text (org-export-activate-smart-quotes text :utf-8 info)))
+ (if (not (plist-get info :with-special-strings)) text
+ (setq text (replace-regexp-in-string "\\\\-" "" text))
+ (if (not utf8p) text
+ ;; Usual replacements in utf-8 with proper option set.
+ (replace-regexp-in-string
+ "\\.\\.\\." "…"
+ (replace-regexp-in-string
+ "--" "–"
+ (replace-regexp-in-string "---" "—" text)))))))
+
+
+;;;; Planning
+
+(defun org-ascii-planning (planning _contents info)
+ "Transcode a PLANNING element from Org to ASCII.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (org-ascii--justify-element
+ (mapconcat
+ #'identity
+ (delq nil
+ (list (let ((closed (org-element-property :closed planning)))
+ (when closed
+ (concat org-closed-string " "
+ (org-timestamp-translate closed))))
+ (let ((deadline (org-element-property :deadline planning)))
+ (when deadline
+ (concat org-deadline-string " "
+ (org-timestamp-translate deadline))))
+ (let ((scheduled (org-element-property :scheduled planning)))
+ (when scheduled
+ (concat org-scheduled-string " "
+ (org-timestamp-translate scheduled))))))
+ " ")
+ planning info))
+
+
+;;;; Property Drawer
+
+(defun org-ascii-property-drawer (property-drawer contents info)
+ "Transcode a PROPERTY-DRAWER element from Org to ASCII.
+CONTENTS holds the contents of the drawer. INFO is a plist
+holding contextual information."
+ (and (org-string-nw-p contents)
+ (org-ascii--justify-element contents property-drawer info)))
+
+
+;;;; Quote Block
+
+(defun org-ascii-quote-block (_quote-block contents info)
+ "Transcode a QUOTE-BLOCK element from Org to ASCII.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (org-ascii--indent-string contents (plist-get info :ascii-quote-margin)))
+
+
+;;;; Radio Target
+
+(defun org-ascii-radio-target (_radio-target contents _info)
+ "Transcode a RADIO-TARGET object from Org to ASCII.
+CONTENTS is the contents of the target. INFO is a plist holding
+contextual information."
+ contents)
+
+
+;;;; Section
+
+(defun org-ascii-section (section contents info)
+ "Transcode a SECTION element from Org to ASCII.
+CONTENTS is the contents of the section. INFO is a plist holding
+contextual information."
+ (let ((links
+ (and (plist-get info :ascii-links-to-notes)
+ ;; Take care of links in first section of the document.
+ (not (org-element-lineage section '(headline)))
+ (org-ascii--describe-links
+ (org-ascii--unique-links section info)
+ (org-ascii--current-text-width section info)
+ info))))
+ (org-ascii--indent-string
+ (if (not (org-string-nw-p links)) contents
+ (concat (org-element-normalize-string contents) "\n\n" links))
+ ;; Do not apply inner margin if parent headline is low level.
+ (let ((headline (org-export-get-parent-headline section)))
+ (if (or (not headline) (org-export-low-level-p headline info)) 0
+ (plist-get info :ascii-inner-margin))))))
+
+
+;;;; Special Block
+
+(defun org-ascii-special-block (_special-block contents _info)
+ "Transcode a SPECIAL-BLOCK element from Org to ASCII.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ ;; "JUSTIFYLEFT" and "JUSTIFYRIGHT" have already been taken care of
+ ;; at a lower level. There is no other special block type to
+ ;; handle.
+ contents)
+
+
+;;;; Src Block
+
+(defun org-ascii-src-block (src-block _contents info)
+ "Transcode a SRC-BLOCK element from Org to ASCII.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (let ((caption (org-ascii--build-caption src-block info))
+ (caption-above-p (plist-get info :ascii-caption-above))
+ (code (org-export-format-code-default src-block info)))
+ (if (equal code "") ""
+ (org-ascii--justify-element
+ (concat
+ (and caption caption-above-p (concat caption "\n"))
+ (org-ascii--box-string code info)
+ (and caption (not caption-above-p) (concat "\n" caption)))
+ src-block info))))
+
+
+;;;; Statistics Cookie
+
+(defun org-ascii-statistics-cookie (statistics-cookie _contents _info)
+ "Transcode a STATISTICS-COOKIE object from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (org-element-property :value statistics-cookie))
+
+
+;;;; Subscript
+
+(defun org-ascii-subscript (subscript contents _info)
+ "Transcode a SUBSCRIPT object from Org to ASCII.
+CONTENTS is the contents of the object. INFO is a plist holding
+contextual information."
+ (if (org-element-property :use-brackets-p subscript)
+ (format "_{%s}" contents)
+ (format "_%s" contents)))
+
+
+;;;; Superscript
+
+(defun org-ascii-superscript (superscript contents _info)
+ "Transcode a SUPERSCRIPT object from Org to ASCII.
+CONTENTS is the contents of the object. INFO is a plist holding
+contextual information."
+ (if (org-element-property :use-brackets-p superscript)
+ (format "^{%s}" contents)
+ (format "^%s" contents)))
+
+
+;;;; Strike-through
+
+(defun org-ascii-strike-through (_strike-through contents _info)
+ "Transcode STRIKE-THROUGH from Org to ASCII.
+CONTENTS is text with strike-through markup. INFO is a plist
+holding contextual information."
+ (format "+%s+" contents))
+
+
+;;;; Table
+
+(defun org-ascii-table (table contents info)
+ "Transcode a TABLE element from Org to ASCII.
+CONTENTS is the contents of the table. INFO is a plist holding
+contextual information."
+ (let ((caption (org-ascii--build-caption table info))
+ (caption-above-p (plist-get info :ascii-caption-above)))
+ (org-ascii--justify-element
+ (concat
+ ;; Possibly add a caption string above.
+ (and caption caption-above-p (concat caption "\n"))
+ ;; Insert table. Note: "table.el" tables are left unmodified.
+ (cond ((eq (org-element-property :type table) 'org) contents)
+ ((and (plist-get info :ascii-table-use-ascii-art)
+ (eq (plist-get info :ascii-charset) 'utf-8)
+ (require 'ascii-art-to-unicode nil t))
+ (with-temp-buffer
+ (insert (org-remove-indentation
+ (org-element-property :value table)))
+ (goto-char (point-min))
+ (aa2u)
+ (goto-char (point-max))
+ (skip-chars-backward " \r\t\n")
+ (buffer-substring (point-min) (point))))
+ (t (org-remove-indentation (org-element-property :value table))))
+ ;; Possible add a caption string below.
+ (and (not caption-above-p) caption))
+ table info)))
+
+
+;;;; Table Cell
+
+(defun org-ascii--table-cell-width (table-cell info)
+ "Return width of TABLE-CELL.
+
+INFO is a plist used as a communication channel.
+
+Width of a cell is determined either by a width cookie in the
+same column as the cell, or by the maximum cell's length in that
+column.
+
+When `org-ascii-table-widen-columns' is non-nil, width cookies
+are ignored."
+ (let* ((row (org-export-get-parent table-cell))
+ (table (org-export-get-parent row))
+ (col (let ((cells (org-element-contents row)))
+ (- (length cells) (length (memq table-cell cells)))))
+ (cache
+ (or (plist-get info :ascii-table-cell-width-cache)
+ (plist-get (setq info
+ (plist-put info :ascii-table-cell-width-cache
+ (make-hash-table :test 'equal)))
+ :ascii-table-cell-width-cache)))
+ (key (cons table col))
+ (widenp (plist-get info :ascii-table-widen-columns)))
+ (or (gethash key cache)
+ (puthash
+ key
+ (let ((cookie-width (org-export-table-cell-width table-cell info)))
+ (or (and (not widenp) cookie-width)
+ (let ((contents-width
+ (let ((max-width 0))
+ (org-element-map table 'table-row
+ (lambda (row)
+ (setq max-width
+ (max (string-width
+ (org-export-data
+ (org-element-contents
+ (elt (org-element-contents row) col))
+ info))
+ max-width)))
+ info)
+ max-width)))
+ (cond ((not cookie-width) contents-width)
+ (widenp (max cookie-width contents-width))
+ (t cookie-width)))))
+ cache))))
+
+(defun org-ascii-table-cell (table-cell contents info)
+ "Transcode a TABLE-CELL object from Org to ASCII.
+CONTENTS is the cell contents. INFO is a plist used as
+a communication channel."
+ ;; Determine column width. When `org-ascii-table-widen-columns'
+ ;; is nil and some width cookie has set it, use that value.
+ ;; Otherwise, compute the maximum width among transcoded data of
+ ;; each cell in the column.
+ (let ((width (org-ascii--table-cell-width table-cell info)))
+ ;; When contents are too large, truncate them.
+ (unless (or (plist-get info :ascii-table-widen-columns)
+ (<= (string-width (or contents "")) width))
+ (setq contents (concat (substring contents 0 (- width 2)) "=>")))
+ ;; Align contents correctly within the cell.
+ (let* ((indent-tabs-mode nil)
+ (data
+ (when contents
+ (org-ascii--justify-lines
+ contents width
+ (org-export-table-cell-alignment table-cell info)))))
+ (setq contents
+ (concat data
+ (make-string (- width (string-width (or data ""))) ?\s))))
+ ;; Return cell.
+ (concat (format " %s " contents)
+ (when (memq 'right (org-export-table-cell-borders table-cell info))
+ (if (eq (plist-get info :ascii-charset) 'utf-8) "│" "|")))))
+
+
+;;;; Table Row
+
+(defun org-ascii-table-row (table-row contents info)
+ "Transcode a TABLE-ROW element from Org to ASCII.
+CONTENTS is the row contents. INFO is a plist used as
+a communication channel."
+ (when (eq (org-element-property :type table-row) 'standard)
+ (let ((build-hline
+ (lambda (lcorner horiz vert rcorner)
+ (concat
+ (apply
+ 'concat
+ (org-element-map table-row 'table-cell
+ (lambda (cell)
+ (let ((width (org-ascii--table-cell-width cell info))
+ (borders (org-export-table-cell-borders cell info)))
+ (concat
+ ;; In order to know if CELL starts the row, do
+ ;; not compare it with the first cell in the
+ ;; row as there might be a special column.
+ ;; Instead, compare it with first exportable
+ ;; cell, obtained with `org-element-map'.
+ (when (and (memq 'left borders)
+ (eq (org-element-map table-row 'table-cell
+ 'identity info t)
+ cell))
+ lcorner)
+ (make-string (+ 2 width) (string-to-char horiz))
+ (cond
+ ((not (memq 'right borders)) nil)
+ ((eq (car (last (org-element-contents table-row))) cell)
+ rcorner)
+ (t vert)))))
+ info)) "\n")))
+ (utf8p (eq (plist-get info :ascii-charset) 'utf-8))
+ (borders (org-export-table-cell-borders
+ (org-element-map table-row 'table-cell 'identity info t)
+ info)))
+ (concat (cond
+ ((and (memq 'top borders) (or utf8p (memq 'above borders)))
+ (if utf8p (funcall build-hline "┍" "━" "┯" "┑")
+ (funcall build-hline "+" "-" "+" "+")))
+ ((memq 'above borders)
+ (if utf8p (funcall build-hline "├" "─" "┼" "┤")
+ (funcall build-hline "+" "-" "+" "+"))))
+ (when (memq 'left borders) (if utf8p "│" "|"))
+ contents "\n"
+ (when (and (memq 'bottom borders) (or utf8p (memq 'below borders)))
+ (if utf8p (funcall build-hline "┕" "━" "┷" "┙")
+ (funcall build-hline "+" "-" "+" "+")))))))
+
+
+;;;; Timestamp
+
+(defun org-ascii-timestamp (timestamp _contents info)
+ "Transcode a TIMESTAMP object from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (org-ascii-plain-text (org-timestamp-translate timestamp) info))
+
+
+;;;; Underline
+
+(defun org-ascii-underline (_underline contents _info)
+ "Transcode UNDERLINE from Org to ASCII.
+CONTENTS is the text with underline markup. INFO is a plist
+holding contextual information."
+ (format "_%s_" contents))
+
+
+;;;; Verbatim
+
+(defun org-ascii-verbatim (verbatim _contents info)
+ "Return a VERBATIM object from Org to ASCII.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (format (plist-get info :ascii-verbatim-format)
+ (org-element-property :value verbatim)))
+
+
+;;;; Verse Block
+
+(defun org-ascii-verse-block (verse-block contents info)
+ "Transcode a VERSE-BLOCK element from Org to ASCII.
+CONTENTS is verse block contents. INFO is a plist holding
+contextual information."
+ (org-ascii--indent-string
+ (org-ascii--justify-element contents verse-block info)
+ (plist-get info :ascii-quote-margin)))
+
+
+
+;;; Filters
+
+(defun org-ascii-filter-headline-blank-lines (headline _backend info)
+ "Filter controlling number of blank lines after a headline.
+
+HEADLINE is a string representing a transcoded headline. BACKEND
+is symbol specifying back-end used for export. INFO is plist
+containing the communication channel.
+
+This function only applies to `ascii' back-end. See
+`org-ascii-headline-spacing' for information."
+ (let ((headline-spacing (plist-get info :ascii-headline-spacing)))
+ (if (not headline-spacing) headline
+ (let ((blanks (make-string (1+ (cdr headline-spacing)) ?\n)))
+ (replace-regexp-in-string "\n\\(?:\n[ \t]*\\)*\\'" blanks headline)))))
+
+(defun org-ascii-filter-paragraph-spacing (tree _backend info)
+ "Filter controlling number of blank lines between paragraphs.
+
+TREE is the parse tree. BACKEND is the symbol specifying
+back-end used for export. INFO is a plist used as
+a communication channel.
+
+See `org-ascii-paragraph-spacing' for information."
+ (let ((paragraph-spacing (plist-get info :ascii-paragraph-spacing)))
+ (when (wholenump paragraph-spacing)
+ (org-element-map tree 'paragraph
+ (lambda (p)
+ (when (eq (org-element-type (org-export-get-next-element p info))
+ 'paragraph)
+ (org-element-put-property p :post-blank paragraph-spacing))))))
+ tree)
+
+(defun org-ascii-filter-comment-spacing (tree _backend info)
+ "Filter removing blank lines between comments.
+TREE is the parse tree. BACKEND is the symbol specifying
+back-end used for export. INFO is a plist used as
+a communication channel."
+ (org-element-map tree '(comment comment-block)
+ (lambda (c)
+ (when (memq (org-element-type (org-export-get-next-element c info))
+ '(comment comment-block))
+ (org-element-put-property c :post-blank 0))))
+ tree)
+
+
+
+;;; 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)
+ "Export current buffer to a text buffer.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, strip title and
+table of contents from output.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Export is done in a buffer named \"*Org ASCII Export*\", which
+will be displayed when `org-export-show-temporary-export-buffer'
+is non-nil."
+ (interactive)
+ (org-export-to-buffer 'ascii "*Org ASCII Export*"
+ async subtreep visible-only body-only ext-plist (lambda () (text-mode))))
+
+;;;###autoload
+(defun org-ascii-export-to-ascii
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer to a text file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, strip title and
+table of contents from output.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return output file's name."
+ (interactive)
+ (let ((file (org-export-output-file-name ".txt" subtreep)))
+ (org-export-to-file 'ascii file
+ async subtreep visible-only body-only ext-plist)))
+
+;;;###autoload
+(defun org-ascii-publish-to-ascii (plist filename pub-dir)
+ "Publish an Org file to ASCII.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name."
+ (org-publish-org-to
+ 'ascii filename ".txt" `(:ascii-charset ascii ,@plist) pub-dir))
+
+;;;###autoload
+(defun org-ascii-publish-to-latin1 (plist filename pub-dir)
+ "Publish an Org file to Latin-1.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name."
+ (org-publish-org-to
+ 'ascii filename ".txt" `(:ascii-charset latin1 ,@plist) pub-dir))
+
+;;;###autoload
+(defun org-ascii-publish-to-utf8 (plist filename pub-dir)
+ "Publish an org file to UTF-8.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name."
+ (org-publish-org-to
+ 'ascii filename ".txt" `(:ascii-charset utf-8 ,@plist) pub-dir))
+
+
+(provide 'ox-ascii)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; coding: utf-8
+;; End:
+
+;;; ox-ascii.el ends here
diff --git a/elpa/org-9.5.2/ox-ascii.elc b/elpa/org-9.5.2/ox-ascii.elc
new file mode 100644
index 0000000..2e3d571
--- /dev/null
+++ b/elpa/org-9.5.2/ox-ascii.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ox-beamer.el b/elpa/org-9.5.2/ox-beamer.el
new file mode 100644
index 0000000..77de0aa
--- /dev/null
+++ b/elpa/org-9.5.2/ox-beamer.el
@@ -0,0 +1,1158 @@
+;;; ox-beamer.el --- Beamer Back-End for Org Export Engine -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik AT gmail DOT com>
+;; Nicolas Goaziou <n.goaziou AT gmail DOT com>
+;; Maintainer: Nicolas Goaziou <n.goaziou at gmail dot com>
+;; Keywords: org, wp, tex
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; This library implements both a Beamer back-end, derived from the
+;; LaTeX one and a minor mode easing structure edition of the
+;; document. See Org manual for more information.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ox-latex)
+
+;; Install a default set-up for Beamer export.
+(unless (assoc "beamer" org-latex-classes)
+ (add-to-list 'org-latex-classes
+ '("beamer"
+ "\\documentclass[presentation]{beamer}"
+ ("\\section{%s}" . "\\section*{%s}")
+ ("\\subsection{%s}" . "\\subsection*{%s}")
+ ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
+
+
+
+;;; User-Configurable Variables
+
+(defgroup org-export-beamer nil
+ "Options specific for using the beamer class in LaTeX export."
+ :tag "Org Beamer"
+ :group 'org-export
+ :version "24.2")
+
+(defcustom org-beamer-frame-level 1
+ "The level at which headlines become frames.
+
+Headlines at a lower level will be translated into a sectioning
+structure. At a higher level, they will be translated into
+blocks.
+
+If a headline with a \"BEAMER_env\" property set to \"frame\" is
+found within a tree, its level locally overrides this number.
+
+This variable has no effect on headlines with the \"BEAMER_env\"
+property set to either \"ignoreheading\", \"appendix\", or
+\"note\", which will respectively, be invisible, become an
+appendix or a note.
+
+This integer is relative to the minimal level of a headline
+within the parse tree, defined as 1."
+ :group 'org-export-beamer
+ :type 'integer)
+
+(defcustom org-beamer-frame-default-options ""
+ "Default options string to use for frames.
+For example, it could be set to \"allowframebreaks\"."
+ :group 'org-export-beamer
+ :type '(string :tag "[options]"))
+
+(defcustom org-beamer-column-view-format
+ "%45ITEM %10BEAMER_env(Env) %10BEAMER_act(Act) %4BEAMER_col(Col) %8BEAMER_opt(Opt)"
+ "Column view format that should be used to fill the template."
+ :group 'org-export-beamer
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "Do not insert Beamer column view format" nil)
+ (string :tag "Beamer column view format")))
+
+(defcustom org-beamer-theme "default"
+ "Default theme used in Beamer presentations."
+ :group 'org-export-beamer
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "Do not insert a Beamer theme" nil)
+ (string :tag "Beamer theme")))
+
+(defcustom org-beamer-environments-extra nil
+ "Environments triggered by tags in Beamer export.
+Each entry has 4 elements:
+
+name Name of the environment
+key Selection key for `org-beamer-select-environment'
+open The opening template for the environment, with the following escapes
+ %a the action/overlay specification
+ %A the default action/overlay specification
+ %R the raw BEAMER_act value
+ %o the options argument, with square brackets
+ %O the raw BEAMER_opt value
+ %h the headline text
+ %r the raw headline text (i.e. without any processing)
+ %H if there is headline text, that raw text in {} braces
+ %U if there is headline text, that raw text in [] brackets
+close The closing string of the environment."
+ :group 'org-export-beamer
+ :version "24.4"
+ :package-version '(Org . "8.1")
+ :type '(repeat
+ (list
+ (string :tag "Environment")
+ (string :tag "Selection key")
+ (string :tag "Begin")
+ (string :tag "End"))))
+
+(defcustom org-beamer-outline-frame-title "Outline"
+ "Default title of a frame containing an outline."
+ :group 'org-export-beamer
+ :type '(string :tag "Outline frame title"))
+
+(defcustom org-beamer-outline-frame-options ""
+ "Outline frame options appended after \\begin{frame}.
+You might want to put e.g. \"allowframebreaks=0.9\" here."
+ :group 'org-export-beamer
+ :type '(string :tag "Outline frame options"))
+
+
+(defcustom org-beamer-subtitle-format "\\subtitle{%s}"
+ "Format string used for transcoded subtitle.
+The format string should have at most one \"%s\"-expression,
+which is replaced with the subtitle."
+ :group 'org-export-beamer
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(string :tag "Format string"))
+
+
+;;; Internal Variables
+
+(defconst org-beamer-column-widths
+ "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.0 :ETC"
+ "The column widths that should be installed as allowed property values.")
+
+(defconst org-beamer-environments-special
+ '(("againframe" "A")
+ ("appendix" "x")
+ ("column" "c")
+ ("columns" "C")
+ ("frame" "f")
+ ("fullframe" "F")
+ ("ignoreheading" "i")
+ ("note" "n")
+ ("noteNH" "N"))
+ "Alist of environments treated in a special way by the back-end.
+Keys are environment names, as strings, values are bindings used
+in `org-beamer-select-environment'. Environments listed here,
+along with their binding, are hard coded and cannot be modified
+through `org-beamer-environments-extra' variable.")
+
+(defconst org-beamer-environments-default
+ '(("block" "b" "\\begin{block}%a{%h}" "\\end{block}")
+ ("alertblock" "a" "\\begin{alertblock}%a{%h}" "\\end{alertblock}")
+ ("verse" "v" "\\begin{verse}%a %% %h" "\\end{verse}")
+ ("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[%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[%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
+`org-beamer-environments-extra'.")
+
+(defconst org-beamer-verbatim-elements
+ '(code example-block fixed-width inline-src-block src-block verbatim)
+ "List of element or object types producing verbatim text.
+This is used internally to determine when a frame should have the
+\"fragile\" option.")
+
+
+
+;;; Internal functions
+
+(defun org-beamer--normalize-argument (argument type)
+ "Return ARGUMENT string with proper boundaries.
+
+TYPE is a symbol among the following:
+`action' Return ARGUMENT within angular brackets.
+`defaction' Return ARGUMENT within both square and angular brackets.
+`option' Return ARGUMENT within square brackets."
+ (if (not (string-match "\\S-" argument)) ""
+ (cl-case type
+ (action (format "<%s>" (org-unbracket-string "<" ">" argument)))
+ (defaction
+ (format "[<%s>]"
+ (org-unbracket-string "<" ">" (org-unbracket-string "[" "]" argument))))
+ (option (format "[%s]" (org-unbracket-string "[" "]" argument)))
+ (otherwise (error "Invalid `type' argument to `org-beamer--normalize-argument': %s"
+ type)))))
+
+(defun org-beamer--element-has-overlay-p (element)
+ "Non-nil when ELEMENT has an overlay specified.
+An element has an overlay specification when it starts with an
+`beamer' export-snippet whose value is between angular brackets.
+Return overlay specification, as a string, or nil."
+ (let ((first-object (car (org-element-contents element))))
+ (when (eq (org-element-type first-object) 'export-snippet)
+ (let ((value (org-element-property :value first-object)))
+ (and (string-prefix-p "<" value) (string-suffix-p ">" value)
+ value)))))
+
+
+
+;;; Define Back-End
+
+(org-export-define-derived-backend 'beamer 'latex
+ :menu-entry
+ '(?l 1
+ ((?B "As LaTeX buffer (Beamer)" org-beamer-export-as-latex)
+ (?b "As LaTeX file (Beamer)" org-beamer-export-to-latex)
+ (?P "As PDF file (Beamer)" org-beamer-export-to-pdf)
+ (?O "As PDF file and open (Beamer)"
+ (lambda (a s v b)
+ (if a (org-beamer-export-to-pdf t s v b)
+ (org-open-file (org-beamer-export-to-pdf nil s v b)))))))
+ :options-alist
+ '((:headline-levels nil "H" org-beamer-frame-level)
+ (:latex-class "LATEX_CLASS" nil "beamer" t)
+ (:beamer-subtitle-format nil nil org-beamer-subtitle-format)
+ (:beamer-column-view-format "COLUMNS" nil org-beamer-column-view-format)
+ (:beamer-theme "BEAMER_THEME" nil org-beamer-theme)
+ (:beamer-color-theme "BEAMER_COLOR_THEME" nil nil t)
+ (:beamer-font-theme "BEAMER_FONT_THEME" nil nil t)
+ (:beamer-inner-theme "BEAMER_INNER_THEME" nil nil t)
+ (:beamer-outer-theme "BEAMER_OUTER_THEME" nil nil t)
+ (:beamer-header "BEAMER_HEADER" nil nil newline)
+ (:beamer-environments-extra nil nil org-beamer-environments-extra)
+ (:beamer-frame-default-options nil nil org-beamer-frame-default-options)
+ (:beamer-outline-frame-options nil nil org-beamer-outline-frame-options)
+ (:beamer-outline-frame-title nil nil org-beamer-outline-frame-title))
+ :translate-alist '((bold . org-beamer-bold)
+ (export-block . org-beamer-export-block)
+ (export-snippet . org-beamer-export-snippet)
+ (headline . org-beamer-headline)
+ (item . org-beamer-item)
+ (keyword . org-beamer-keyword)
+ (link . org-beamer-link)
+ (plain-list . org-beamer-plain-list)
+ (radio-target . org-beamer-radio-target)
+ (template . org-beamer-template)))
+
+
+
+;;; Transcode Functions
+
+;;;; Bold
+
+(defun org-beamer-bold (bold contents _info)
+ "Transcode BLOCK object into Beamer code.
+CONTENTS is the text being bold. INFO is a plist used as
+a communication channel."
+ (format "\\alert%s{%s}"
+ (or (org-beamer--element-has-overlay-p bold) "")
+ contents))
+
+
+;;;; Export Block
+
+(defun org-beamer-export-block (export-block _contents _info)
+ "Transcode an EXPORT-BLOCK element into Beamer code.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (when (member (org-element-property :type export-block) '("BEAMER" "LATEX"))
+ (org-remove-indentation (org-element-property :value export-block))))
+
+
+;;;; Export Snippet
+
+(defun org-beamer-export-snippet (export-snippet _contents info)
+ "Transcode an EXPORT-SNIPPET object into Beamer code.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (let ((backend (org-export-snippet-backend export-snippet))
+ (value (org-element-property :value export-snippet)))
+ ;; Only "latex" and "beamer" snippets are retained.
+ (cond ((eq backend 'latex) value)
+ ;; Ignore "beamer" snippets specifying overlays.
+ ((and (eq backend 'beamer)
+ (or (org-export-get-previous-element export-snippet info)
+ (not (string-match "\\`<.*>\\'" value))))
+ value))))
+
+
+;;;; Headline
+;;
+;; The main function to translate a headline is
+;; `org-beamer-headline'.
+;;
+;; Depending on the level at which a headline is considered as
+;; a frame (given by `org-beamer--frame-level'), the headline is
+;; either a section (`org-beamer--format-section'), a frame
+;; (`org-beamer--format-frame') or a block
+;; (`org-beamer--format-block').
+;;
+;; `org-beamer-headline' also takes care of special environments
+;; like "ignoreheading", "note", "noteNH", "appendix" and
+;; "againframe".
+
+(defun org-beamer--get-label (headline info)
+ "Return label for HEADLINE, as a string.
+
+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
+a unique internal label. This function assumes HEADLINE will be
+treated as a frame."
+ (cond
+ ((let ((opt (org-element-property :BEAMER_OPT headline)))
+ (and (stringp opt)
+ (string-match "\\(?:^\\|,\\)label=\\(.*?\\)\\(?:$\\|,\\)" opt)
+ (let ((label (match-string 1 opt)))
+ (if (string-match-p "\\`{.*}\\'" label)
+ (substring label 1 -1)
+ label)))))
+ ((and (plist-get info :latex-prefer-user-labels)
+ (org-element-property :CUSTOM_ID headline)))
+ (t (format "sec:%s" (org-export-get-reference headline info)))))
+
+(defun org-beamer--frame-level (headline info)
+ "Return frame level in subtree containing HEADLINE.
+INFO is a plist used as a communication channel."
+ (or
+ ;; 1. Look for "frame" environment in parents, starting from the
+ ;; farthest.
+ (catch 'exit
+ (dolist (parent (nreverse (org-element-lineage headline)))
+ (let ((env (org-element-property :BEAMER_ENV parent)))
+ (when (and env (member-ignore-case env '("frame" "fullframe")))
+ (throw 'exit (org-export-get-relative-level parent info))))))
+ ;; 2. Look for "frame" environment in HEADLINE.
+ (let ((env (org-element-property :BEAMER_ENV headline)))
+ (and env (member-ignore-case env '("frame" "fullframe"))
+ (org-export-get-relative-level headline info)))
+ ;; 3. Look for "frame" environment in sub-tree.
+ (org-element-map headline 'headline
+ (lambda (hl)
+ (let ((env (org-element-property :BEAMER_ENV hl)))
+ (when (and env (member-ignore-case env '("frame" "fullframe")))
+ (org-export-get-relative-level hl info))))
+ info 'first-match)
+ ;; 4. No "frame" environment in tree: use default value.
+ (plist-get info :headline-levels)))
+
+(defun org-beamer--format-section (headline contents info)
+ "Format HEADLINE as a sectioning part.
+CONTENTS holds the contents of the headline. INFO is a plist
+used as a communication channel."
+ (let ((latex-headline
+ (org-export-with-backend
+ ;; We create a temporary export back-end which behaves the
+ ;; same as current one, but adds "\protect" in front of the
+ ;; output of some objects.
+ (org-export-create-backend
+ :parent 'latex
+ :transcoders
+ (let ((protected-output
+ (lambda (object contents info)
+ (let ((code (org-export-with-backend
+ 'beamer object contents info)))
+ (if (org-string-nw-p code) (concat "\\protect" code)
+ code)))))
+ (mapcar (lambda (type) (cons type protected-output))
+ '(bold footnote-reference italic strike-through timestamp
+ underline))))
+ headline
+ contents
+ info))
+ (mode-specs (org-element-property :BEAMER_ACT headline)))
+ (if (and mode-specs
+ (string-match "\\`\\\\\\(.*?\\)\\(?:\\*\\|\\[.*\\]\\)?{"
+ latex-headline))
+ ;; Insert overlay specifications.
+ (replace-match (concat (match-string 1 latex-headline)
+ (format "<%s>" mode-specs))
+ nil nil latex-headline 1)
+ latex-headline)))
+
+(defun org-beamer--format-frame (headline contents info)
+ "Format HEADLINE as a frame.
+CONTENTS holds the contents of the headline. INFO is a plist
+used as a communication channel."
+ (let ((fragilep
+ ;; FRAGILEP is non-nil when HEADLINE contains an element
+ ;; among `org-beamer-verbatim-elements'.
+ (org-element-map headline org-beamer-verbatim-elements 'identity
+ info 'first-match)))
+ (concat "\\begin{frame}"
+ ;; Overlay specification, if any. When surrounded by
+ ;; square brackets, consider it as a default
+ ;; specification.
+ (let ((action (org-element-property :BEAMER_ACT headline)))
+ (cond
+ ((not action) "")
+ ((string-match "\\`\\[.*\\]\\'" action )
+ (org-beamer--normalize-argument action 'defaction))
+ (t (org-beamer--normalize-argument action 'action))))
+ ;; Options, if any.
+ (let* ((beamer-opt (org-element-property :BEAMER_OPT headline))
+ (options
+ ;; Collect nonempty options from default value and
+ ;; headline's properties.
+ (cl-remove-if-not #'org-string-nw-p
+ (append
+ (org-split-string
+ (plist-get info :beamer-frame-default-options) ",")
+ (and beamer-opt
+ (org-split-string
+ ;; Remove square brackets if user provided
+ ;; them.
+ (and (string-match "^\\[?\\(.*\\)\\]?$" beamer-opt)
+ (match-string 1 beamer-opt))
+ ",")))))
+ (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 (append label fragile options) ",")
+ 'option))
+ ;; Title.
+ (let ((env (org-element-property :BEAMER_ENV headline)))
+ (format "{%s}"
+ (if (and env (equal (downcase env) "fullframe")) ""
+ (org-export-data
+ (org-element-property :title headline) info))))
+ "\n"
+ ;; The following workaround is required in fragile frames
+ ;; as Beamer will append "\par" to the beginning of the
+ ;; contents. So we need to make sure the command is
+ ;; separated from the contents by at least one space. If
+ ;; it isn't, it will create "\parfirst-word" command and
+ ;; remove the first word from the contents in the PDF
+ ;; output.
+ (if (not fragilep) contents
+ (replace-regexp-in-string "\\`\n*" "\\& " (or contents "")))
+ "\\end{frame}")))
+
+(defun org-beamer--format-block (headline contents info)
+ "Format HEADLINE as a block.
+CONTENTS holds the contents of the headline. INFO is a plist
+used as a communication channel."
+ (let* ((column-width (org-element-property :BEAMER_COL headline))
+ ;; ENVIRONMENT defaults to "block" if none is specified and
+ ;; there is no column specification. If there is a column
+ ;; specified but still no explicit environment, ENVIRONMENT
+ ;; is "column".
+ (environment (let ((env (org-element-property :BEAMER_ENV headline)))
+ (cond
+ ;; "block" is the fallback environment.
+ ((and (not env) (not column-width)) "block")
+ ;; "column" only.
+ ((not env) "column")
+ ;; Use specified environment.
+ (t env))))
+ (raw-title (org-element-property :raw-value headline))
+ (env-format
+ (cond ((member environment '("column" "columns")) nil)
+ ((assoc environment
+ (append (plist-get info :beamer-environments-extra)
+ org-beamer-environments-default)))
+ (t (user-error "Wrong block type at a headline named \"%s\""
+ raw-title))))
+ (title (org-export-data (org-element-property :title headline) info))
+ (raw-options (org-element-property :BEAMER_OPT headline))
+ (options (if raw-options
+ (org-beamer--normalize-argument raw-options 'option)
+ ""))
+ ;; Start a "columns" environment when explicitly requested or
+ ;; when there is no previous headline or the previous
+ ;; headline do not have a BEAMER_column property.
+ (parent-env (org-element-property
+ :BEAMER_ENV (org-export-get-parent-headline headline)))
+ (start-columns-p
+ (or (equal environment "columns")
+ (and column-width
+ (not (and parent-env
+ (equal (downcase parent-env) "columns")))
+ (or (org-export-first-sibling-p headline info)
+ (not (org-element-property
+ :BEAMER_COL
+ (org-export-get-previous-element
+ headline info)))))))
+ ;; End the "columns" environment when explicitly requested or
+ ;; when there is no next headline or the next headline do not
+ ;; have a BEAMER_column property.
+ (end-columns-p
+ (or (equal environment "columns")
+ (and column-width
+ (not (and parent-env
+ (equal (downcase parent-env) "columns")))
+ (or (org-export-last-sibling-p headline info)
+ (not (org-element-property
+ :BEAMER_COL
+ (org-export-get-next-element headline info))))))))
+ (concat
+ (when start-columns-p
+ ;; Column can accept options only when the environment is
+ ;; explicitly defined.
+ (if (not (equal environment "columns")) "\\begin{columns}\n"
+ (format "\\begin{columns}%s\n" options)))
+ (when column-width
+ (format "\\begin{column}%s{%s}\n"
+ ;; One can specify placement for column only when
+ ;; HEADLINE stands for a column on its own.
+ (if (equal environment "column") options "")
+ (format "%s\\columnwidth" column-width)))
+ ;; Block's opening string.
+ (when (nth 2 env-format)
+ (concat
+ (org-fill-template
+ (nth 2 env-format)
+ (nconc
+ ;; If BEAMER_act property has its value enclosed in square
+ ;; brackets, it is a default overlay specification and
+ ;; overlay specification is empty. Otherwise, it is an
+ ;; overlay specification and the default one is nil.
+ (let ((action (org-element-property :BEAMER_ACT headline)))
+ (cond
+ ((not action) (list (cons "a" "") (cons "A" "") (cons "R" "")))
+ ((and (string-prefix-p "[" action)
+ (string-suffix-p "]" action))
+ (list
+ (cons "A" (org-beamer--normalize-argument action 'defaction))
+ (cons "a" "")
+ (cons "R" action)))
+ (t
+ (list (cons "a" (org-beamer--normalize-argument action 'action))
+ (cons "A" "")
+ (cons "R" action)))))
+ (list (cons "o" options)
+ (cons "O" (or raw-options ""))
+ (cons "h" title)
+ (cons "r" raw-title)
+ (cons "H" (if (equal raw-title "") ""
+ (format "{%s}" raw-title)))
+ (cons "U" (if (equal raw-title "") ""
+ (format "[%s]" raw-title))))))
+ "\n"))
+ contents
+ ;; Block's closing string, if any.
+ (and (nth 3 env-format) (concat (nth 3 env-format) "\n"))
+ (when column-width "\\end{column}\n")
+ (when end-columns-p "\\end{columns}"))))
+
+(defun org-beamer-headline (headline contents info)
+ "Transcode HEADLINE element into Beamer code.
+CONTENTS is the contents of the headline. INFO is a plist used
+as a communication channel."
+ (unless (org-element-property :footnote-section-p headline)
+ (let ((level (org-export-get-relative-level headline info))
+ (frame-level (org-beamer--frame-level headline info))
+ (environment (let ((env (org-element-property :BEAMER_ENV headline)))
+ (or (org-string-nw-p env) "block"))))
+ (cond
+ ;; Case 1: Resume frame specified by "BEAMER_ref" property.
+ ((equal environment "againframe")
+ (let ((ref (org-element-property :BEAMER_REF headline)))
+ ;; Reference to frame being resumed is mandatory. Ignore
+ ;; the whole headline if it isn't provided.
+ (when (org-string-nw-p ref)
+ (concat "\\againframe"
+ ;; Overlay specification.
+ (let ((overlay (org-element-property :BEAMER_ACT headline)))
+ (when overlay
+ (org-beamer--normalize-argument
+ overlay
+ (if (string-match "\\`\\[.*\\]\\'" overlay) 'defaction
+ 'action))))
+ ;; Options.
+ (let ((options (org-element-property :BEAMER_OPT headline)))
+ (when options
+ (org-beamer--normalize-argument options 'option)))
+ ;; Resolve reference provided by "BEAMER_ref"
+ ;; property. This is done by building a minimal
+ ;; fake link and calling the appropriate resolve
+ ;; function, depending on the reference syntax.
+ (let ((target
+ (if (string-match "\\`\\(id:\\|#\\)" ref)
+ (org-export-resolve-id-link
+ `(link (:path ,(substring ref (match-end 0))))
+ info)
+ (org-export-resolve-fuzzy-link
+ `(link (:path
+ ;; Look for headlines only.
+ ,(if (eq (string-to-char ref) ?*) ref
+ (concat "*" ref))))
+ info))))
+ ;; Now use user-defined label provided in TARGET
+ ;; headline, or fallback to standard one.
+ (format "{%s}" (org-beamer--get-label target info)))))))
+ ;; Case 2: Creation of an appendix is requested.
+ ((equal environment "appendix")
+ (concat "\\appendix"
+ (org-element-property :BEAMER_ACT headline)
+ "\n"
+ (make-string (org-element-property :pre-blank headline) ?\n)
+ contents))
+ ;; Case 3: Ignore heading.
+ ((equal environment "ignoreheading")
+ (concat (make-string (org-element-property :pre-blank headline) ?\n)
+ contents))
+ ;; Case 4: HEADLINE is a note.
+ ((member environment '("note" "noteNH"))
+ (concat "\\note"
+ ;; Overlay specification.
+ (let ((overlay (org-element-property :BEAMER_ACT headline)))
+ (when overlay
+ (org-beamer--normalize-argument
+ overlay
+ (if (string-match "\\`\\[.*\\]\\'" overlay)
+ 'defaction 'action))))
+ (format "{%s}"
+ (concat (and (equal environment "note")
+ (concat
+ (org-export-data
+ (org-element-property :title headline)
+ info)
+ "\n"))
+ (org-trim contents)))))
+ ;; Case 5: HEADLINE is a frame.
+ ((= level frame-level)
+ (org-beamer--format-frame headline contents info))
+ ;; Case 6: Regular section, extracted from
+ ;; `org-latex-classes'.
+ ((< level frame-level)
+ (org-beamer--format-section headline contents info))
+ ;; Case 7: Otherwise, HEADLINE is a block.
+ (t (org-beamer--format-block headline contents info))))))
+
+
+;;;; Item
+
+(defun org-beamer-item (item contents info)
+ "Transcode an ITEM element into Beamer code.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (org-export-with-backend
+ ;; Delegate item export to `latex'. However, we use `beamer'
+ ;; transcoders for objects in the description tag.
+ (org-export-create-backend
+ :parent 'beamer
+ :transcoders
+ (list
+ (cons
+ 'item
+ (lambda (item _c _i)
+ (let ((action
+ (let ((first (car (org-element-contents item))))
+ (and (eq (org-element-type first) 'paragraph)
+ (org-beamer--element-has-overlay-p first))))
+ (output (org-latex-item item contents info)))
+ (if (not (and action (string-match "\\\\item" output))) output
+ ;; If the item starts with a paragraph and that paragraph
+ ;; starts with an export snippet specifying an overlay,
+ ;; append it to the \item command.
+ (replace-match (concat "\\\\item" action) nil nil output)))))))
+ item contents info))
+
+
+;;;; Keyword
+
+(defun org-beamer-keyword (keyword contents info)
+ "Transcode a KEYWORD element into Beamer code.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (let ((key (org-element-property :key keyword))
+ (value (org-element-property :value keyword)))
+ ;; Handle specifically BEAMER and TOC (headlines only) keywords.
+ ;; Otherwise, fallback to `latex' back-end.
+ (cond
+ ((equal key "BEAMER") value)
+ ((and (equal key "TOC") (string-match "\\<headlines\\>" value))
+ (let ((depth (or (and (string-match "[0-9]+" value)
+ (string-to-number (match-string 0 value)))
+ (plist-get info :with-toc)))
+ (options (and (string-match "\\[.*?\\]" value)
+ (match-string 0 value))))
+ (concat
+ (when (wholenump depth) (format "\\setcounter{tocdepth}{%s}\n" depth))
+ "\\tableofcontents" options)))
+ (t (org-export-with-backend 'latex keyword contents info)))))
+
+
+;;;; Link
+
+(defun org-beamer-link (link contents info)
+ "Transcode a LINK object into Beamer code.
+CONTENTS is the description part of the link. INFO is a plist
+used as a communication channel."
+ (or (org-export-custom-protocol-maybe link contents 'beamer info)
+ ;; Fall-back to LaTeX export. However, prefer "\hyperlink" over
+ ;; "\hyperref" since the former handles overlay specifications.
+ (let ((latex-link (org-export-with-backend 'latex link contents info)))
+ (if (string-match "\\`\\\\hyperref\\[\\(.*?\\)\\]" latex-link)
+ (replace-match
+ (format "\\\\hyperlink%s{\\1}"
+ (or (org-beamer--element-has-overlay-p link) ""))
+ nil nil latex-link)
+ latex-link))))
+
+
+;;;; Plain List
+;;
+;; Plain lists support `:environment', `:overlay' and `:options'
+;; attributes.
+
+(defun org-beamer-plain-list (plain-list contents info)
+ "Transcode a PLAIN-LIST element into Beamer code.
+CONTENTS is the contents of the list. INFO is a plist holding
+contextual information."
+ (let* ((type (org-element-property :type plain-list))
+ (attributes (org-combine-plists
+ (org-export-read-attribute :attr_latex plain-list)
+ (org-export-read-attribute :attr_beamer plain-list)))
+ (latex-type (let ((env (plist-get attributes :environment)))
+ (cond (env)
+ ((eq type 'ordered) "enumerate")
+ ((eq type 'descriptive) "description")
+ (t "itemize")))))
+ (org-latex--wrap-label
+ plain-list
+ (format "\\begin{%s}%s%s\n%s\\end{%s}"
+ latex-type
+ ;; Default overlay specification, if any.
+ (org-beamer--normalize-argument
+ (or (plist-get attributes :overlay) "")
+ 'defaction)
+ ;; Second optional argument depends on the list type.
+ (org-beamer--normalize-argument
+ (or (plist-get attributes :options) "")
+ 'option)
+ ;; Eventually insert contents and close environment.
+ contents
+ latex-type)
+ info)))
+
+
+;;;; Radio Target
+
+(defun org-beamer-radio-target (radio-target text info)
+ "Transcode a RADIO-TARGET object into Beamer code.
+TEXT is the text of the target. INFO is a plist holding
+contextual information."
+ (format "\\hypertarget%s{%s}{%s}"
+ (or (org-beamer--element-has-overlay-p radio-target) "")
+ (org-export-get-reference radio-target info)
+ text))
+
+
+;;;; Template
+;;
+;; Template used is similar to the one used in `latex' back-end,
+;; excepted for the table of contents and Beamer themes.
+
+(defun org-beamer-template (contents info)
+ "Return complete document string after Beamer conversion.
+CONTENTS is the transcoded contents string. INFO is a plist
+holding export options."
+ (let ((title (org-export-data (plist-get info :title) info))
+ (subtitle (org-export-data (plist-get info :subtitle) info)))
+ (concat
+ ;; Time-stamp.
+ (and (plist-get info :time-stamp-file)
+ (format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
+ ;; LaTeX compiler
+ (org-latex--insert-compiler info)
+ ;; Document class and packages.
+ (org-latex-make-preamble info)
+ ;; Insert themes.
+ (let ((format-theme
+ (lambda (prop command)
+ (let ((theme (plist-get info prop)))
+ (when theme
+ (concat command
+ (if (not (string-match "\\[.*\\]" theme))
+ (format "{%s}\n" theme)
+ (format "%s{%s}\n"
+ (match-string 0 theme)
+ (org-trim
+ (replace-match "" nil nil theme))))))))))
+ (mapconcat (lambda (args) (apply format-theme args))
+ '((:beamer-theme "\\usetheme")
+ (:beamer-color-theme "\\usecolortheme")
+ (:beamer-font-theme "\\usefonttheme")
+ (:beamer-inner-theme "\\useinnertheme")
+ (:beamer-outer-theme "\\useoutertheme"))
+ ""))
+ ;; Possibly limit depth for headline numbering.
+ (let ((sec-num (plist-get info :section-numbers)))
+ (when (integerp sec-num)
+ (format "\\setcounter{secnumdepth}{%d}\n" sec-num)))
+ ;; Author.
+ (let ((author (and (plist-get info :with-author)
+ (let ((auth (plist-get info :author)))
+ (and auth (org-export-data auth info)))))
+ (email (and (plist-get info :with-email)
+ (org-export-data (plist-get info :email) info))))
+ (cond ((and author email (not (string= "" email)))
+ (format "\\author{%s\\thanks{%s}}\n" author email))
+ ((or author email) (format "\\author{%s}\n" (or author email)))))
+ ;; Date.
+ (let ((date (and (plist-get info :with-date) (org-export-get-date info))))
+ (format "\\date{%s}\n" (org-export-data date info)))
+ ;; Title
+ (format "\\title{%s}\n" title)
+ (when (org-string-nw-p subtitle)
+ (concat (format (plist-get info :beamer-subtitle-format) subtitle) "\n"))
+ ;; Beamer-header
+ (let ((beamer-header (plist-get info :beamer-header)))
+ (when beamer-header
+ (format "%s\n" (plist-get info :beamer-header))))
+ ;; 9. Hyperref options.
+ (let ((template (plist-get info :latex-hyperref-template)))
+ (and (stringp template)
+ (format-spec template (org-latex--format-spec info))))
+ ;; Document start.
+ "\\begin{document}\n\n"
+ ;; Title command.
+ (org-element-normalize-string
+ (cond ((not (plist-get info :with-title)) nil)
+ ((string= "" title) nil)
+ ((not (stringp org-latex-title-command)) nil)
+ ((string-match "\\(?:[^%]\\|^\\)%s"
+ org-latex-title-command)
+ (format org-latex-title-command title))
+ (t org-latex-title-command)))
+ ;; Table of contents.
+ (let ((depth (plist-get info :with-toc)))
+ (when depth
+ (concat
+ (format "\\begin{frame}%s{%s}\n"
+ (org-beamer--normalize-argument
+ (plist-get info :beamer-outline-frame-options) 'option)
+ (plist-get info :beamer-outline-frame-title))
+ (when (wholenump depth)
+ (format "\\setcounter{tocdepth}{%d}\n" depth))
+ "\\tableofcontents\n"
+ "\\end{frame}\n\n")))
+ ;; Document's body.
+ contents
+ ;; Creator.
+ (if (plist-get info :with-creator)
+ (concat (plist-get info :creator) "\n")
+ "")
+ ;; Document end.
+ "\\end{document}")))
+
+
+
+;;; Minor Mode
+
+
+(defvar org-beamer-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "\C-c\C-b" 'org-beamer-select-environment)
+ map)
+ "The keymap for `org-beamer-mode'.")
+
+;;;###autoload
+(define-minor-mode org-beamer-mode
+ "Support for editing Beamer oriented Org mode files."
+ :lighter " Bm")
+
+(when (fboundp 'font-lock-add-keywords)
+ (font-lock-add-keywords
+ 'org-mode
+ '((":\\(B_[a-z]+\\|BMCOL\\):" 1 'org-beamer-tag prepend))
+ 'prepend))
+
+(defface org-beamer-tag '((t (:box (:line-width 1 :color grey40))))
+ "The special face for beamer tags."
+ :group 'org-export-beamer)
+
+(defun org-beamer-property-changed (property value)
+ "Track the BEAMER_env property with tags.
+PROPERTY is the name of the modified property. VALUE is its new
+value."
+ (cond
+ ((equal property "BEAMER_env")
+ (save-excursion
+ (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 nil t)))
+ (env-tag (and (org-string-nw-p value) (concat "B_" value))))
+ (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)))))
+
+(add-hook 'org-property-changed-functions 'org-beamer-property-changed)
+
+(defun org-beamer-allowed-property-values (property)
+ "Supply allowed values for PROPERTY."
+ (cond
+ ((and (equal property "BEAMER_env")
+ (not (org-entry-get nil (concat property "_ALL") 'inherit)))
+ ;; If no allowed values for BEAMER_env have been defined,
+ ;; supply all defined environments
+ (mapcar 'car (append org-beamer-environments-special
+ org-beamer-environments-extra
+ org-beamer-environments-default)))
+ ((and (equal property "BEAMER_col")
+ (not (org-entry-get nil (concat property "_ALL") 'inherit)))
+ ;; If no allowed values for BEAMER_col have been defined, supply
+ ;; some.
+ (split-string org-beamer-column-widths " "))))
+
+(add-hook 'org-property-allowed-value-functions
+ 'org-beamer-allowed-property-values)
+
+
+
+;;; Commands
+
+;;;###autoload
+(defun org-beamer-export-as-latex
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer as a Beamer buffer.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Export is done in a buffer named \"*Org BEAMER Export*\", which
+will be displayed when `org-export-show-temporary-export-buffer'
+is non-nil."
+ (interactive)
+ (org-export-to-buffer 'beamer "*Org BEAMER Export*"
+ async subtreep visible-only body-only ext-plist (lambda () (LaTeX-mode))))
+
+;;;###autoload
+(defun org-beamer-export-to-latex
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer as a Beamer presentation (tex).
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return output file's name."
+ (interactive)
+ (let ((file (org-export-output-file-name ".tex" subtreep)))
+ (org-export-to-file 'beamer file
+ async subtreep visible-only body-only ext-plist)))
+
+;;;###autoload
+(defun org-beamer-export-to-pdf
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer as a Beamer presentation (PDF).
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return PDF file's name."
+ (interactive)
+ (let ((file (org-export-output-file-name ".tex" subtreep)))
+ (org-export-to-file 'beamer file
+ async subtreep visible-only body-only ext-plist
+ #'org-latex-compile)))
+
+;;;###autoload
+(defun org-beamer-select-environment ()
+ "Select the environment to be used by beamer for this entry.
+While this uses (for convenience) a tag selection interface, the
+result of this command will be that the BEAMER_env *property* of
+the entry is set.
+
+In addition to this, the command will also set a tag as a visual
+aid, but the tag does not have any semantic meaning."
+ (interactive)
+ ;; Make sure `org-beamer-environments-special' has a higher
+ ;; priority than `org-beamer-environments-extra'.
+ (let* ((envs (append org-beamer-environments-special
+ org-beamer-environments-extra
+ org-beamer-environments-default))
+ (org-current-tag-alist
+ (append '((:startgroup))
+ (mapcar (lambda (e) (cons (concat "B_" (car e))
+ (string-to-char (nth 1 e))))
+ envs)
+ '((:endgroup))
+ '(("BMCOL" . ?|))))
+ (org-tag-persistent-alist nil)
+ (org-use-fast-tag-selection t)
+ (org-fast-tag-selection-single-key t))
+ (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 (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
+ ;; to resumed frame and overlay specifications.
+ ((eq org-last-tag-selection-key ?A)
+ (if (equal (org-entry-get nil "BEAMER_env") "againframe")
+ (progn (org-entry-delete nil "BEAMER_env")
+ (org-entry-delete nil "BEAMER_ref")
+ (org-entry-delete nil "BEAMER_act"))
+ (org-entry-put nil "BEAMER_env" "againframe")
+ (org-set-property
+ "BEAMER_ref"
+ (read-string "Frame reference (*Title, #custom-id, id:...): "))
+ (org-set-property "BEAMER_act"
+ (read-string "Overlay specification: "))))
+ ((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
+(defun org-beamer-publish-to-latex (plist filename pub-dir)
+ "Publish an Org file to a Beamer presentation (LaTeX).
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name."
+ (org-publish-org-to 'beamer filename ".tex" plist pub-dir))
+
+;;;###autoload
+(defun org-beamer-publish-to-pdf (plist filename pub-dir)
+ "Publish an Org file to a Beamer presentation (PDF, via LaTeX).
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name."
+ ;; Unlike to `org-beamer-publish-to-latex', PDF file is generated in
+ ;; working directory and then moved to publishing directory.
+ (org-publish-attachment
+ plist
+ ;; Default directory could be anywhere when this function is
+ ;; called. We ensure it is set to source file directory during
+ ;; compilation so as to not break links to external documents.
+ (let ((default-directory (file-name-directory filename)))
+ (org-latex-compile
+ (org-publish-org-to
+ 'beamer filename ".tex" plist (file-name-directory filename))))
+ pub-dir))
+
+
+(provide 'ox-beamer)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ox-beamer.el ends here
diff --git a/elpa/org-9.5.2/ox-beamer.elc b/elpa/org-9.5.2/ox-beamer.elc
new file mode 100644
index 0000000..2430f9c
--- /dev/null
+++ b/elpa/org-9.5.2/ox-beamer.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ox-html.el b/elpa/org-9.5.2/ox-html.el
new file mode 100644
index 0000000..a150b1f
--- /dev/null
+++ b/elpa/org-9.5.2/ox-html.el
@@ -0,0 +1,3895 @@
+;;; ox-html.el --- HTML Back-End for Org Export Engine -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; Jambunathan K <kjambunathan at gmail dot com>
+;; Maintainer: TEC <tecosaur@gmail.com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library implements a HTML back-end for Org generic exporter.
+;; See Org manual for more information.
+
+;;; Code:
+
+;;; Dependencies
+
+(require 'cl-lib)
+(require 'format-spec)
+(require 'ox)
+(require 'ox-publish)
+(require 'table)
+
+
+;;; Function Declarations
+
+(declare-function org-id-find-id-file "org-id" (id))
+(declare-function htmlize-region "ext:htmlize" (beg end))
+(declare-function mm-url-decode-entities "mm-url" ())
+
+(defvar htmlize-css-name-prefix)
+(defvar htmlize-output-type)
+(defvar htmlize-output-type)
+(defvar htmlize-css-name-prefix)
+
+;;; Define Back-End
+
+(org-export-define-backend 'html
+ '((bold . org-html-bold)
+ (center-block . org-html-center-block)
+ (clock . org-html-clock)
+ (code . org-html-code)
+ (drawer . org-html-drawer)
+ (dynamic-block . org-html-dynamic-block)
+ (entity . org-html-entity)
+ (example-block . org-html-example-block)
+ (export-block . org-html-export-block)
+ (export-snippet . org-html-export-snippet)
+ (fixed-width . org-html-fixed-width)
+ (footnote-reference . org-html-footnote-reference)
+ (headline . org-html-headline)
+ (horizontal-rule . org-html-horizontal-rule)
+ (inline-src-block . org-html-inline-src-block)
+ (inlinetask . org-html-inlinetask)
+ (inner-template . org-html-inner-template)
+ (italic . org-html-italic)
+ (item . org-html-item)
+ (keyword . org-html-keyword)
+ (latex-environment . org-html-latex-environment)
+ (latex-fragment . org-html-latex-fragment)
+ (line-break . org-html-line-break)
+ (link . org-html-link)
+ (node-property . org-html-node-property)
+ (paragraph . org-html-paragraph)
+ (plain-list . org-html-plain-list)
+ (plain-text . org-html-plain-text)
+ (planning . org-html-planning)
+ (property-drawer . org-html-property-drawer)
+ (quote-block . org-html-quote-block)
+ (radio-target . org-html-radio-target)
+ (section . org-html-section)
+ (special-block . org-html-special-block)
+ (src-block . org-html-src-block)
+ (statistics-cookie . org-html-statistics-cookie)
+ (strike-through . org-html-strike-through)
+ (subscript . org-html-subscript)
+ (superscript . org-html-superscript)
+ (table . org-html-table)
+ (table-cell . org-html-table-cell)
+ (table-row . org-html-table-row)
+ (target . org-html-target)
+ (template . org-html-template)
+ (timestamp . org-html-timestamp)
+ (underline . org-html-underline)
+ (verbatim . org-html-verbatim)
+ (verse-block . org-html-verse-block))
+ :filters-alist '((:filter-options . org-html-infojs-install-script)
+ (:filter-parse-tree . org-html-image-link-filter)
+ (:filter-final-output . org-html-final-function))
+ :menu-entry
+ '(?h "Export to HTML"
+ ((?H "As HTML buffer" org-html-export-as-html)
+ (?h "As HTML file" org-html-export-to-html)
+ (?o "As HTML file and open"
+ (lambda (a s v b)
+ (if a (org-html-export-to-html t s v b)
+ (org-open-file (org-html-export-to-html nil s v b)))))))
+ :options-alist
+ '((:html-doctype "HTML_DOCTYPE" nil org-html-doctype)
+ (:html-container "HTML_CONTAINER" nil org-html-container-element)
+ (:html-content-class "HTML_CONTENT_CLASS" nil org-html-content-class)
+ (:description "DESCRIPTION" nil nil newline)
+ (:keywords "KEYWORDS" nil nil space)
+ (:html-html5-fancy nil "html5-fancy" org-html-html5-fancy)
+ (:html-link-use-abs-url nil "html-link-use-abs-url" org-html-link-use-abs-url)
+ (:html-link-home "HTML_LINK_HOME" nil org-html-link-home)
+ (:html-link-up "HTML_LINK_UP" nil org-html-link-up)
+ (:html-mathjax "HTML_MATHJAX" nil "" space)
+ (:html-equation-reference-format "HTML_EQUATION_REFERENCE_FORMAT" nil org-html-equation-reference-format t)
+ (:html-postamble nil "html-postamble" org-html-postamble)
+ (:html-preamble nil "html-preamble" org-html-preamble)
+ (:html-head "HTML_HEAD" nil org-html-head newline)
+ (:html-head-extra "HTML_HEAD_EXTRA" nil org-html-head-extra newline)
+ (:subtitle "SUBTITLE" nil nil parse)
+ (:html-head-include-default-style
+ nil "html-style" org-html-head-include-default-style)
+ (:html-head-include-scripts nil "html-scripts" org-html-head-include-scripts)
+ (:html-allow-name-attribute-in-anchors
+ nil nil org-html-allow-name-attribute-in-anchors)
+ (:html-divs nil nil org-html-divs)
+ (:html-checkbox-type nil nil org-html-checkbox-type)
+ (:html-extension nil nil org-html-extension)
+ (:html-footnote-format nil nil org-html-footnote-format)
+ (:html-footnote-separator nil nil org-html-footnote-separator)
+ (:html-footnotes-section nil nil org-html-footnotes-section)
+ (:html-format-drawer-function nil nil org-html-format-drawer-function)
+ (:html-format-headline-function nil nil org-html-format-headline-function)
+ (:html-format-inlinetask-function
+ nil nil org-html-format-inlinetask-function)
+ (:html-home/up-format nil nil org-html-home/up-format)
+ (:html-indent nil nil org-html-indent)
+ (:html-infojs-options nil nil org-html-infojs-options)
+ (:html-infojs-template nil nil org-html-infojs-template)
+ (:html-inline-image-rules nil nil org-html-inline-image-rules)
+ (:html-link-org-files-as-html nil nil org-html-link-org-files-as-html)
+ (:html-mathjax-options nil nil org-html-mathjax-options)
+ (:html-mathjax-template nil nil org-html-mathjax-template)
+ (:html-metadata-timestamp-format nil nil org-html-metadata-timestamp-format)
+ (:html-postamble-format nil nil org-html-postamble-format)
+ (:html-preamble-format nil nil org-html-preamble-format)
+ (:html-prefer-user-labels nil nil org-html-prefer-user-labels)
+ (:html-self-link-headlines nil nil org-html-self-link-headlines)
+ (:html-table-align-individual-fields
+ nil nil org-html-table-align-individual-fields)
+ (:html-table-caption-above nil nil org-html-table-caption-above)
+ (:html-table-data-tags nil nil org-html-table-data-tags)
+ (:html-table-header-tags nil nil org-html-table-header-tags)
+ (:html-table-use-header-tags-for-first-column
+ nil nil org-html-table-use-header-tags-for-first-column)
+ (:html-tag-class-prefix nil nil org-html-tag-class-prefix)
+ (:html-text-markup-alist nil nil org-html-text-markup-alist)
+ (:html-todo-kwd-class-prefix nil nil org-html-todo-kwd-class-prefix)
+ (:html-toplevel-hlevel nil nil org-html-toplevel-hlevel)
+ (:html-use-infojs nil nil org-html-use-infojs)
+ (:html-validation-link nil nil org-html-validation-link)
+ (:html-viewport nil nil org-html-viewport)
+ (:html-inline-images nil nil org-html-inline-images)
+ (:html-table-attributes nil nil org-html-table-default-attributes)
+ (:html-table-row-open-tag nil nil org-html-table-row-open-tag)
+ (:html-table-row-close-tag nil nil org-html-table-row-close-tag)
+ (:html-xml-declaration nil nil org-html-xml-declaration)
+ (:html-wrap-src-lines nil nil org-html-wrap-src-lines)
+ (:html-klipsify-src nil nil org-html-klipsify-src)
+ (:html-klipse-css nil nil org-html-klipse-css)
+ (:html-klipse-js nil nil org-html-klipse-js)
+ (:html-klipse-selection-script nil nil org-html-klipse-selection-script)
+ (:infojs-opt "INFOJS_OPT" nil nil)
+ ;; Redefine regular options.
+ (:creator "CREATOR" nil org-html-creator-string)
+ (:with-latex nil "tex" org-html-with-latex)
+ ;; Retrieve LaTeX header for fragments.
+ (:latex-header "LATEX_HEADER" nil nil newline)))
+
+
+;;; Internal Variables
+
+(defvar org-html-format-table-no-css)
+(defvar htmlize-buffer-places) ; from htmlize.el
+
+(defvar org-html--pre/postamble-class "status"
+ "CSS class used for pre/postamble.")
+
+(defconst org-html-doctype-alist
+ '(("html4-strict" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\"
+\"http://www.w3.org/TR/html4/strict.dtd\">")
+ ("html4-transitional" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
+\"http://www.w3.org/TR/html4/loose.dtd\">")
+ ("html4-frameset" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\"
+\"http://www.w3.org/TR/html4/frameset.dtd\">")
+
+ ("xhtml-strict" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
+\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">")
+ ("xhtml-transitional" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"
+\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">")
+ ("xhtml-frameset" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\"
+\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">")
+ ("xhtml-11" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"
+\"http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd\">")
+
+ ("html5" . "<!DOCTYPE html>")
+ ("xhtml5" . "<!DOCTYPE html>"))
+ "An alist mapping (x)html flavors to specific doctypes.")
+
+(defconst org-html-html5-elements
+ '("article" "aside" "audio" "canvas" "details" "figcaption"
+ "figure" "footer" "header" "menu" "meter" "nav" "output"
+ "progress" "section" "summary" "video")
+ "New elements in html5.
+
+For blocks that should contain headlines, use the HTML_CONTAINER
+property on the headline itself.")
+
+(defconst org-html-special-string-regexps
+ '(("\\\\-" . "&#x00ad;") ; shy
+ ("---\\([^-]\\)" . "&#x2014;\\1") ; mdash
+ ("--\\([^-]\\)" . "&#x2013;\\1") ; ndash
+ ("\\.\\.\\." . "&#x2026;")) ; hellip
+ "Regular expressions for special string conversion.")
+
+(defcustom org-html-scripts
+ "<script>
+// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&amp;dn=gpl-3.0.txt GPL-v3-or-Later
+ function CodeHighlightOn(elem, id)
+ {
+ var target = document.getElementById(id);
+ if(null != target) {
+ elem.classList.add(\"code-highlighted\");
+ target.classList.add(\"code-highlighted\");
+ }
+ }
+ function CodeHighlightOff(elem, id)
+ {
+ var target = document.getElementById(id);
+ if(null != target) {
+ elem.classList.remove(\"code-highlighted\");
+ target.classList.remove(\"code-highlighted\");
+ }
+ }
+// @license-end
+</script>"
+ "Basic JavaScript to allow highlighting references in code blocks."
+ :group 'org-export-html
+ :package-version '(Org . "9.5")
+ :type 'string)
+
+(defcustom org-html-style-default
+ "<style>
+ #content { max-width: 60em; margin: auto; }
+ .title { text-align: center;
+ margin-bottom: .2em; }
+ .subtitle { text-align: center;
+ font-size: medium;
+ font-weight: bold;
+ margin-top:0; }
+ .todo { font-family: monospace; color: red; }
+ .done { font-family: monospace; color: green; }
+ .priority { font-family: monospace; color: orange; }
+ .tag { background-color: #eee; font-family: monospace;
+ padding: 2px; font-size: 80%; font-weight: normal; }
+ .timestamp { color: #bebebe; }
+ .timestamp-kwd { color: #5f9ea0; }
+ .org-right { margin-left: auto; margin-right: 0px; text-align: right; }
+ .org-left { margin-left: 0px; margin-right: auto; text-align: left; }
+ .org-center { margin-left: auto; margin-right: auto; text-align: center; }
+ .underline { text-decoration: underline; }
+ #postamble p, #preamble p { font-size: 90%; margin: .2em; }
+ p.verse { margin-left: 3%; }
+ pre {
+ border: 1px solid #e6e6e6;
+ border-radius: 3px;
+ background-color: #f2f2f2;
+ padding: 8pt;
+ font-family: monospace;
+ overflow: auto;
+ margin: 1.2em;
+ }
+ pre.src {
+ position: relative;
+ overflow: auto;
+ }
+ pre.src:before {
+ display: none;
+ position: absolute;
+ top: -8px;
+ right: 12px;
+ padding: 3px;
+ color: #555;
+ background-color: #f2f2f299;
+ }
+ pre.src:hover:before { display: inline; margin-top: 14px;}
+ /* Languages per Org manual */
+ pre.src-asymptote:before { content: 'Asymptote'; }
+ pre.src-awk:before { content: 'Awk'; }
+ pre.src-authinfo::before { content: 'Authinfo'; }
+ pre.src-C:before { content: 'C'; }
+ /* pre.src-C++ doesn't work in CSS */
+ pre.src-clojure:before { content: 'Clojure'; }
+ pre.src-css:before { content: 'CSS'; }
+ pre.src-D:before { content: 'D'; }
+ pre.src-ditaa:before { content: 'ditaa'; }
+ pre.src-dot:before { content: 'Graphviz'; }
+ pre.src-calc:before { content: 'Emacs Calc'; }
+ pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
+ pre.src-fortran:before { content: 'Fortran'; }
+ pre.src-gnuplot:before { content: 'gnuplot'; }
+ pre.src-haskell:before { content: 'Haskell'; }
+ pre.src-hledger:before { content: 'hledger'; }
+ pre.src-java:before { content: 'Java'; }
+ pre.src-js:before { content: 'Javascript'; }
+ pre.src-latex:before { content: 'LaTeX'; }
+ pre.src-ledger:before { content: 'Ledger'; }
+ pre.src-lisp:before { content: 'Lisp'; }
+ pre.src-lilypond:before { content: 'Lilypond'; }
+ pre.src-lua:before { content: 'Lua'; }
+ pre.src-matlab:before { content: 'MATLAB'; }
+ pre.src-mscgen:before { content: 'Mscgen'; }
+ pre.src-ocaml:before { content: 'Objective Caml'; }
+ pre.src-octave:before { content: 'Octave'; }
+ pre.src-org:before { content: 'Org mode'; }
+ pre.src-oz:before { content: 'OZ'; }
+ pre.src-plantuml:before { content: 'Plantuml'; }
+ pre.src-processing:before { content: 'Processing.js'; }
+ pre.src-python:before { content: 'Python'; }
+ pre.src-R:before { content: 'R'; }
+ pre.src-ruby:before { content: 'Ruby'; }
+ pre.src-sass:before { content: 'Sass'; }
+ pre.src-scheme:before { content: 'Scheme'; }
+ pre.src-screen:before { content: 'Gnu Screen'; }
+ pre.src-sed:before { content: 'Sed'; }
+ pre.src-sh:before { content: 'shell'; }
+ pre.src-sql:before { content: 'SQL'; }
+ pre.src-sqlite:before { content: 'SQLite'; }
+ /* additional languages in org.el's org-babel-load-languages alist */
+ pre.src-forth:before { content: 'Forth'; }
+ pre.src-io:before { content: 'IO'; }
+ pre.src-J:before { content: 'J'; }
+ pre.src-makefile:before { content: 'Makefile'; }
+ pre.src-maxima:before { content: 'Maxima'; }
+ pre.src-perl:before { content: 'Perl'; }
+ pre.src-picolisp:before { content: 'Pico Lisp'; }
+ pre.src-scala:before { content: 'Scala'; }
+ pre.src-shell:before { content: 'Shell Script'; }
+ pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
+ /* additional language identifiers per \"defun org-babel-execute\"
+ in ob-*.el */
+ pre.src-cpp:before { content: 'C++'; }
+ pre.src-abc:before { content: 'ABC'; }
+ pre.src-coq:before { content: 'Coq'; }
+ pre.src-groovy:before { content: 'Groovy'; }
+ /* additional language identifiers from org-babel-shell-names in
+ ob-shell.el: ob-shell is the only babel language using a lambda to put
+ the execution function name together. */
+ pre.src-bash:before { content: 'bash'; }
+ pre.src-csh:before { content: 'csh'; }
+ pre.src-ash:before { content: 'ash'; }
+ pre.src-dash:before { content: 'dash'; }
+ pre.src-ksh:before { content: 'ksh'; }
+ pre.src-mksh:before { content: 'mksh'; }
+ pre.src-posh:before { content: 'posh'; }
+ /* Additional Emacs modes also supported by the LaTeX listings package */
+ pre.src-ada:before { content: 'Ada'; }
+ pre.src-asm:before { content: 'Assembler'; }
+ pre.src-caml:before { content: 'Caml'; }
+ pre.src-delphi:before { content: 'Delphi'; }
+ pre.src-html:before { content: 'HTML'; }
+ pre.src-idl:before { content: 'IDL'; }
+ pre.src-mercury:before { content: 'Mercury'; }
+ pre.src-metapost:before { content: 'MetaPost'; }
+ pre.src-modula-2:before { content: 'Modula-2'; }
+ pre.src-pascal:before { content: 'Pascal'; }
+ pre.src-ps:before { content: 'PostScript'; }
+ pre.src-prolog:before { content: 'Prolog'; }
+ pre.src-simula:before { content: 'Simula'; }
+ pre.src-tcl:before { content: 'tcl'; }
+ pre.src-tex:before { content: 'TeX'; }
+ pre.src-plain-tex:before { content: 'Plain TeX'; }
+ pre.src-verilog:before { content: 'Verilog'; }
+ pre.src-vhdl:before { content: 'VHDL'; }
+ pre.src-xml:before { content: 'XML'; }
+ pre.src-nxml:before { content: 'XML'; }
+ /* add a generic configuration mode; LaTeX export needs an additional
+ (add-to-list 'org-latex-listings-langs '(conf \" \")) in .emacs */
+ pre.src-conf:before { content: 'Configuration File'; }
+
+ table { border-collapse:collapse; }
+ caption.t-above { caption-side: top; }
+ caption.t-bottom { caption-side: bottom; }
+ td, th { vertical-align:top; }
+ th.org-right { text-align: center; }
+ th.org-left { text-align: center; }
+ th.org-center { text-align: center; }
+ td.org-right { text-align: right; }
+ td.org-left { text-align: left; }
+ td.org-center { text-align: center; }
+ dt { font-weight: bold; }
+ .footpara { display: inline; }
+ .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;
+ margin: 10px;
+ background: #ffffcc;
+ }
+ #org-div-home-and-up
+ { text-align: right; font-size: 70%; white-space: nowrap; }
+ textarea { overflow-x: auto; }
+ .linenr { font-size: smaller }
+ .code-highlighted { background-color: #ffff00; }
+ .org-info-js_info-navigation { border-style: none; }
+ #org-info-js_console-label
+ { font-size: 10px; font-weight: bold; white-space: nowrap; }
+ .org-info-js_search-highlight
+ { background-color: #ffff00; color: #000000; font-weight: bold; }
+ .org-svg { width: 90%; }
+</style>"
+ "The default style specification for exported HTML files.
+You can use `org-html-head' and `org-html-head-extra' to add to
+this style. If you don't want to include this default style,
+customize `org-html-head-include-default-style'."
+ :group 'org-export-html
+ :package-version '(Org . "9.5")
+ :type 'string)
+
+
+;;; User Configuration Variables
+
+(defgroup org-export-html nil
+ "Options for exporting Org mode files to HTML."
+ :tag "Org Export HTML"
+ :group 'org-export)
+
+;;;; Handle infojs
+
+(defvar org-html-infojs-opts-table
+ '((path PATH "https://orgmode.org/org-info.js")
+ (view VIEW "info")
+ (toc TOC :with-toc)
+ (ftoc FIXED_TOC "0")
+ (tdepth TOC_DEPTH "max")
+ (sdepth SECTION_DEPTH "max")
+ (mouse MOUSE_HINT "underline")
+ (buttons VIEW_BUTTONS "0")
+ (ltoc LOCAL_TOC "1")
+ (up LINK_UP :html-link-up)
+ (home LINK_HOME :html-link-home))
+ "JavaScript options, long form for script, default values.")
+
+(defcustom org-html-use-infojs 'when-configured
+ "Non-nil when Sebastian Rose's Java Script org-info.js should be active.
+This option can be nil or t to never or always use the script.
+It can also be the symbol `when-configured', meaning that the
+script will be linked into the export file if and only if there
+is a \"#+INFOJS_OPT:\" line in the buffer. See also the variable
+`org-html-infojs-options'."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "Never" nil)
+ (const :tag "When configured in buffer" when-configured)
+ (const :tag "Always" t)))
+
+(defcustom org-html-infojs-options
+ (mapcar (lambda (x) (cons (car x) (nth 2 x))) org-html-infojs-opts-table)
+ "Options settings for the INFOJS JavaScript.
+Each of the options must have an entry in `org-html-infojs-opts-table'.
+The value can either be a string that will be passed to the script, or
+a property. This property is then assumed to be a property that is defined
+by the Export/Publishing setup of Org.
+The `sdepth' and `tdepth' parameters can also be set to \"max\", which
+means to use the maximum value consistent with other options."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type
+ `(set :greedy t :inline t
+ ,@(mapcar
+ (lambda (x)
+ (list 'cons (list 'const (car x))
+ '(choice
+ (symbol :tag "Publishing/Export property")
+ (string :tag "Value"))))
+ org-html-infojs-opts-table)))
+
+(defcustom org-html-infojs-template
+ "<script src=\"%SCRIPT_PATH\">
+// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&amp;dn=gpl-3.0.txt GPL-v3-or-Later
+// @license-end
+</script>
+
+<script>
+// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&amp;dn=gpl-3.0.txt GPL-v3-or-Later
+%MANAGER_OPTIONS
+org_html_manager.setup(); // activate after the parameters are set
+// @license-end
+</script>"
+ "The template for the export style additions when org-info.js is used.
+Option settings will replace the %MANAGER-OPTIONS cookie."
+ :group 'org-export-html
+ :package-version '(Org . "9.4")
+ :type 'string)
+
+(defun org-html-infojs-install-script (exp-plist _backend)
+ "Install script in export options when appropriate.
+EXP-PLIST is a plist containing export options. BACKEND is the
+export back-end currently used."
+ (unless (or (memq 'body-only (plist-get exp-plist :export-options))
+ (not (plist-get exp-plist :html-use-infojs))
+ (and (eq (plist-get exp-plist :html-use-infojs) 'when-configured)
+ (let ((opt (plist-get exp-plist :infojs-opt)))
+ (or (not opt)
+ (string= "" opt)
+ (string-match "\\<view:nil\\>" opt)))))
+ (let* ((template (plist-get exp-plist :html-infojs-template))
+ (ptoc (plist-get exp-plist :with-toc))
+ (hlevels (plist-get exp-plist :headline-levels))
+ (sdepth hlevels)
+ (tdepth (if (integerp ptoc) (min ptoc hlevels) hlevels))
+ (options (plist-get exp-plist :infojs-opt))
+ (infojs-opt (plist-get exp-plist :html-infojs-options))
+ (table org-html-infojs-opts-table)
+ style)
+ (dolist (entry table)
+ (let* ((opt (car entry))
+ (var (nth 1 entry))
+ ;; Compute default values for script option OPT from
+ ;; `org-html-infojs-options' variable.
+ (default
+ (let ((default (cdr (assq opt infojs-opt))))
+ (if (and (symbolp default) (not (memq default '(t nil))))
+ (plist-get exp-plist default)
+ default)))
+ ;; Value set through INFOJS_OPT keyword has precedence
+ ;; over the default one.
+ (val (if (and options
+ (string-match (format "\\<%s:\\(\\S-+\\)" opt)
+ options))
+ (match-string 1 options)
+ default)))
+ (pcase opt
+ (`path (setq template
+ (replace-regexp-in-string
+ "%SCRIPT_PATH" val template t t)))
+ (`sdepth (when (integerp (read val))
+ (setq sdepth (min (read val) sdepth))))
+ (`tdepth (when (integerp (read val))
+ (setq tdepth (min (read val) tdepth))))
+ (_ (setq val
+ (cond
+ ((or (eq val t) (equal val "t")) "1")
+ ((or (eq val nil) (equal val "nil")) "0")
+ ((stringp val) val)
+ (t (format "%s" val))))
+ (push (cons var val) style)))))
+ ;; Now we set the depth of the *generated* TOC to SDEPTH,
+ ;; because the toc will actually determine the splitting. How
+ ;; much of the toc will actually be displayed is governed by the
+ ;; TDEPTH option.
+ (setq exp-plist (plist-put exp-plist :with-toc sdepth))
+ ;; The table of contents should not show more sections than we
+ ;; generate.
+ (setq tdepth (min tdepth sdepth))
+ (push (cons "TOC_DEPTH" tdepth) style)
+ ;; Build style string.
+ (setq style (mapconcat
+ (lambda (x)
+ (format "org_html_manager.set(\"%s\", \"%s\");"
+ (car x) (cdr x)))
+ style "\n"))
+ (when (and style (> (length style) 0))
+ (and (string-match "%MANAGER_OPTIONS" template)
+ (setq style (replace-match style t t template))
+ (setq exp-plist
+ (plist-put
+ exp-plist :html-head-extra
+ (concat (or (plist-get exp-plist :html-head-extra) "")
+ "\n"
+ style)))))
+ ;; This script absolutely needs the table of contents, so we
+ ;; change that setting.
+ (unless (plist-get exp-plist :with-toc)
+ (setq exp-plist (plist-put exp-plist :with-toc t)))
+ ;; Return the modified property list.
+ exp-plist)))
+
+;;;; Bold, etc.
+
+(defcustom org-html-text-markup-alist
+ '((bold . "<b>%s</b>")
+ (code . "<code>%s</code>")
+ (italic . "<i>%s</i>")
+ (strike-through . "<del>%s</del>")
+ (underline . "<span class=\"underline\">%s</span>")
+ (verbatim . "<code>%s</code>"))
+ "Alist of HTML expressions to convert text markup.
+
+The key must be a symbol among `bold', `code', `italic',
+`strike-through', `underline' and `verbatim'. The value is
+a formatting string to wrap fontified text with.
+
+If no association can be found for a given markup, text will be
+returned as-is."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(alist :key-type (symbol :tag "Markup type")
+ :value-type (string :tag "Format string"))
+ :options '(bold code italic strike-through underline verbatim))
+
+(defcustom org-html-indent nil
+ "Non-nil means to indent the generated HTML.
+Warning: non-nil may break indentation of source code blocks."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+;;;; Drawers
+
+(defcustom org-html-format-drawer-function (lambda (_name contents) contents)
+ "Function called to format a drawer in HTML code.
+
+The function must accept two parameters:
+ NAME the drawer name, like \"LOGBOOK\"
+ CONTENTS the contents of the drawer.
+
+The function should return the string to be exported.
+
+The default value simply returns the value of CONTENTS."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'function)
+
+;;;; Footnotes
+
+(defcustom org-html-footnotes-section "<div id=\"footnotes\">
+<h2 class=\"footnotes\">%s: </h2>
+<div id=\"text-footnotes\">
+%s
+</div>
+</div>"
+ "Format for the footnotes section.
+Should contain a two instances of %s. The first will be replaced with the
+language-specific word for \"Footnotes\", the second one will be replaced
+by the footnotes themselves."
+ :group 'org-export-html
+ :type 'string)
+
+(defcustom org-html-footnote-format "<sup>%s</sup>"
+ "The format for the footnote reference.
+%s will be replaced by the footnote reference itself."
+ :group 'org-export-html
+ :type 'string)
+
+(defcustom org-html-footnote-separator "<sup>, </sup>"
+ "Text used to separate footnotes."
+ :group 'org-export-html
+ :type 'string)
+
+;;;; Headline
+
+(defcustom org-html-toplevel-hlevel 2
+ "The <H> level for level 1 headings in HTML export.
+This is also important for the classes that will be wrapped around headlines
+and outline structure. If this variable is 1, the top-level headlines will
+be <h1>, and the corresponding classes will be outline-1, section-number-1,
+and outline-text-1. If this is 2, all of these will get a 2 instead.
+The default for this variable is 2, because we use <h1> for formatting the
+document title."
+ :group 'org-export-html
+ :type 'integer)
+
+(defcustom org-html-format-headline-function
+ 'org-html-format-headline-default-function
+ "Function to format headline text.
+
+This function will be called with six arguments:
+TODO the todo keyword (string or nil).
+TODO-TYPE the type of todo (symbol: `todo', `done', nil)
+PRIORITY the priority of the headline (integer or nil)
+TEXT the main headline text (string).
+TAGS the tags (string or nil).
+INFO the export options (plist).
+
+The function result will be used in the section format string."
+ :group 'org-export-html
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'function)
+
+;;;; HTML-specific
+
+(defcustom org-html-allow-name-attribute-in-anchors nil
+ "When nil, do not set \"name\" attribute in anchors.
+By default, when appropriate, anchors are formatted with \"id\"
+but without \"name\" attribute."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defcustom org-html-self-link-headlines nil
+ "When non-nil, the headlines contain a hyperlink to themselves."
+ :group 'org-export-html
+ :package-version '(Org . "9.3")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-html-prefer-user-labels nil
+ "When non-nil use user-defined names and ID over internal ones.
+
+By default, Org generates its own internal ID values during HTML
+export. This process ensures that these values are unique and
+valid, but the keys are not available in advance of the export
+process, and not so readable.
+
+When this variable is non-nil, Org will use NAME keyword, or the
+real name of the target to create the ID attribute.
+
+Independently of this variable, however, CUSTOM_ID are always
+used as a reference."
+ :group 'org-export-html
+ :package-version '(Org . "9.4")
+ :type 'boolean
+ :safe #'booleanp)
+
+;;;; Inlinetasks
+
+(defcustom org-html-format-inlinetask-function
+ 'org-html-format-inlinetask-default-function
+ "Function called to format an inlinetask in HTML code.
+
+The function must accept seven parameters:
+ TODO the todo keyword, as a string
+ TODO-TYPE the todo type, a symbol among `todo', `done' and nil.
+ PRIORITY the inlinetask priority, as a string
+ NAME the inlinetask name, as a string.
+ TAGS the inlinetask tags, as a list of strings.
+ CONTENTS the contents of the inlinetask, as a string.
+ INFO the export options, as a plist
+
+The function should return the string to be exported."
+ :group 'org-export-html
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'function)
+
+;;;; LaTeX
+
+(defcustom org-html-equation-reference-format "\\eqref{%s}"
+ "The MathJax command to use when referencing equations.
+
+This is a format control string that expects a single string argument
+specifying the label that is being referenced. The argument is
+generated automatically on export.
+
+The default is to wrap equations in parentheses (using \"\\eqref{%s}\)\".
+
+Most common values are:
+
+ \\eqref{%s} Wrap the equation in parentheses
+ \\ref{%s} Do not wrap the equation in parentheses"
+ :group 'org-export-html
+ :package-version '(Org . "9.4")
+ :type 'string
+ :safe #'stringp)
+
+(defcustom org-html-with-latex org-export-with-latex
+ "Non-nil means process LaTeX math snippets.
+
+When set, the exporter will process LaTeX environments and
+fragments.
+
+This option can also be set with the +OPTIONS line,
+e.g. \"tex:mathjax\". Allowed values are:
+
+ nil Ignore math snippets.
+ `verbatim' Keep everything in verbatim
+ `mathjax', t Do MathJax preprocessing and arrange for MathJax.js to
+ be loaded.
+ `html' Use `org-latex-to-html-convert-command' to convert
+ LaTeX fragments to HTML.
+ SYMBOL Any symbol defined in `org-preview-latex-process-alist',
+ e.g., `dvipng'."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "Do not process math in any way" nil)
+ (const :tag "Leave math verbatim" verbatim)
+ (const :tag "Use MathJax to display math" mathjax)
+ (symbol :tag "Convert to image to display math" :value dvipng)))
+
+;;;; Links :: Generic
+
+(defcustom org-html-link-org-files-as-html t
+ "Non-nil means make file links to \"file.org\" point to \"file.html\".
+
+When Org mode is exporting an Org file to HTML, links to non-HTML files
+are directly put into a \"href\" tag in HTML. However, links to other Org files
+(recognized by the extension \".org\") should become links to the corresponding
+HTML file, assuming that the linked Org file will also be converted to HTML.
+
+When nil, the links still point to the plain \".org\" file."
+ :group 'org-export-html
+ :type 'boolean)
+
+;;;; Links :: Inline images
+
+(defcustom org-html-inline-images t
+ "Non-nil means inline images into exported HTML pages.
+This is done using an <img> tag. When nil, an anchor with href is used to
+link to the image."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.1")
+ :type 'boolean)
+
+(defcustom org-html-inline-image-rules
+ `(("file" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".webp")))
+ ("http" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".webp")))
+ ("https" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".webp"))))
+ "Rules characterizing image files that can be inlined into HTML.
+A rule consists in an association whose key is the type of link
+to consider, and value is a regexp that will be matched against
+link's path."
+ :group 'org-export-html
+ :package-version '(Org . "9.5")
+ :type '(alist :key-type (string :tag "Type")
+ :value-type (regexp :tag "Path")))
+
+;;;; Plain Text
+
+(defvar org-html-protect-char-alist
+ '(("&" . "&amp;")
+ ("<" . "&lt;")
+ (">" . "&gt;"))
+ "Alist of characters to be converted by `org-html-encode-plain-text'.")
+
+;;;; Src Block
+
+(defcustom org-html-htmlize-output-type 'inline-css
+ "Output type to be used by htmlize when formatting code snippets.
+Choices are `css' to export the CSS selectors only,`inline-css'
+to export the CSS attribute values inline in the HTML or nil to
+export plain text. We use as default `inline-css', in order to
+make the resulting HTML self-containing.
+
+However, this will fail when using Emacs in batch mode for export, because
+then no rich font definitions are in place. It will also not be good if
+people with different Emacs setup contribute HTML files to a website,
+because the fonts will represent the individual setups. In these cases,
+it is much better to let Org/Htmlize assign classes only, and to use
+a style file to define the look of these classes.
+To get a start for your css file, start Emacs session and make sure that
+all the faces you are interested in are defined, for example by loading files
+in all modes you want. Then, use the command
+`\\[org-html-htmlize-generate-css]' to extract class definitions."
+ :group 'org-export-html
+ :type '(choice (const css) (const inline-css) (const nil)))
+
+(defcustom org-html-htmlize-font-prefix "org-"
+ "The prefix for CSS class names for htmlize font specifications."
+ :group 'org-export-html
+ :type 'string)
+
+(defcustom org-html-wrap-src-lines nil
+ "If non-nil, wrap individual lines of source blocks in \"code\" elements.
+In this case, add line number in attribute \"data-ox-html-linenr\" when line
+numbers are enabled."
+ :group 'org-export-html
+ :package-version '(Org . "9.3")
+ :type 'boolean
+ :safe #'booleanp)
+
+;;;; Table
+
+(defcustom org-html-table-default-attributes
+ '(:border "2" :cellspacing "0" :cellpadding "6" :rules "groups" :frame "hsides")
+ "Default attributes and values which will be used in table tags.
+This is a plist where attributes are symbols, starting with
+colons, and values are strings.
+
+When exporting to HTML5, these values will be disregarded."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(plist :key-type (symbol :tag "Property")
+ :value-type (string :tag "Value")))
+
+(defcustom org-html-table-header-tags '("<th scope=\"%s\"%s>" . "</th>")
+ "The opening and ending tags for table header fields.
+This is customizable so that alignment options can be specified.
+The first %s will be filled with the scope of the field, either row or col.
+The second %s will be replaced by a style entry to align the field.
+See also the variable `org-html-table-use-header-tags-for-first-column'.
+See also the variable `org-html-table-align-individual-fields'."
+ :group 'org-export-html
+ :type '(cons (string :tag "Opening tag") (string :tag "Closing tag")))
+
+(defcustom org-html-table-data-tags '("<td%s>" . "</td>")
+ "The opening and ending tags for table data fields.
+This is customizable so that alignment options can be specified.
+The first %s will be filled with the scope of the field, either row or col.
+The second %s will be replaced by a style entry to align the field.
+See also the variable `org-html-table-align-individual-fields'."
+ :group 'org-export-html
+ :type '(cons (string :tag "Opening tag") (string :tag "Closing tag")))
+
+(defcustom org-html-table-row-open-tag "<tr>"
+ "The opening tag for table rows.
+This is customizable so that alignment options can be specified.
+Instead of strings, these can be a Lisp function that will be
+evaluated for each row in order to construct the table row tags.
+
+The function will be called with these arguments:
+
+ `number': row number (0 is the first row)
+ `group-number': group number of current row
+ `start-group?': non-nil means the row starts a group
+ `end-group?': non-nil means the row ends a group
+ `top?': non-nil means this is the top row
+ `bottom?': non-nil means this is the bottom row
+
+For example:
+
+ (setq org-html-table-row-open-tag
+ (lambda (number group-number start-group? end-group-p top? bottom?)
+ (cond (top? \"<tr class=\\\"tr-top\\\">\")
+ (bottom? \"<tr class=\\\"tr-bottom\\\">\")
+ (t (if (= (mod number 2) 1)
+ \"<tr class=\\\"tr-odd\\\">\"
+ \"<tr class=\\\"tr-even\\\">\")))))
+
+will use the \"tr-top\" and \"tr-bottom\" classes for the top row
+and the bottom row, and otherwise alternate between \"tr-odd\" and
+\"tr-even\" for odd and even rows."
+ :group 'org-export-html
+ :type '(choice :tag "Opening tag"
+ (string :tag "Specify")
+ (function)))
+
+(defcustom org-html-table-row-close-tag "</tr>"
+ "The closing tag for table rows.
+This is customizable so that alignment options can be specified.
+Instead of strings, this can be a Lisp function that will be
+evaluated for each row in order to construct the table row tags.
+
+See documentation of `org-html-table-row-open-tag'."
+ :group 'org-export-html
+ :type '(choice :tag "Closing tag"
+ (string :tag "Specify")
+ (function)))
+
+(defcustom org-html-table-align-individual-fields t
+ "Non-nil means attach style attributes for alignment to each table field.
+When nil, alignment will only be specified in the column tags, but this
+is ignored by some browsers (like Firefox, Safari). Opera does it right
+though."
+ :group 'org-export-html
+ :type 'boolean)
+
+(defcustom org-html-table-use-header-tags-for-first-column nil
+ "Non-nil means format column one in tables with header tags.
+When nil, also column one will use data tags."
+ :group 'org-export-html
+ :type 'boolean)
+
+(defcustom org-html-table-caption-above t
+ "When non-nil, place caption string at the beginning of the table.
+Otherwise, place it near the end."
+ :group 'org-export-html
+ :type 'boolean)
+
+;;;; Tags
+
+(defcustom org-html-tag-class-prefix ""
+ "Prefix to class names for TODO keywords.
+Each tag gets a class given by the tag itself, with this prefix.
+The default prefix is empty because it is nice to just use the keyword
+as a class name. But if you get into conflicts with other, existing
+CSS classes, then this prefix can be very useful."
+ :group 'org-export-html
+ :type 'string)
+
+;;;; Template :: Generic
+
+(defcustom org-html-extension "html"
+ "The extension for exported HTML files."
+ :group 'org-export-html
+ :type 'string)
+
+(defcustom org-html-xml-declaration
+ '(("html" . "<?xml version=\"1.0\" encoding=\"%s\"?>")
+ ("php" . "<?php echo \"<?xml version=\\\"1.0\\\" encoding=\\\"%s\\\" ?>\"; ?>"))
+ "The extension for exported HTML files.
+%s will be replaced with the charset of the exported file.
+This may be a string, or an alist with export extensions
+and corresponding declarations.
+
+This declaration only applies when exporting to XHTML."
+ :group 'org-export-html
+ :type '(choice
+ (string :tag "Single declaration")
+ (repeat :tag "Dependent on extension"
+ (cons (string :tag "Extension")
+ (string :tag "Declaration")))))
+
+(defcustom org-html-coding-system 'utf-8
+ "Coding system for HTML export.
+Use utf-8 as the default value."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'coding-system)
+
+(defcustom org-html-doctype "xhtml-strict"
+ "Document type definition to use for exported HTML files.
+Can be set with the in-buffer HTML_DOCTYPE property or for
+publishing, with :html-doctype."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type (append
+ '(choice)
+ (mapcar (lambda (x) `(const ,(car x))) org-html-doctype-alist)
+ '((string :tag "Custom doctype" ))))
+
+(defcustom org-html-html5-fancy nil
+ "Non-nil means using new HTML5 elements.
+This variable is ignored for anything other than HTML5 export."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defcustom org-html-container-element "div"
+ "HTML element to use for wrapping top level sections.
+Can be set with the in-buffer HTML_CONTAINER property or for
+publishing, with :html-container.
+
+Note that changing the default will prevent you from using
+org-info.js for your website."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string)
+
+(defcustom org-html-content-class "content"
+ "CSS class name to use for the top level content wrapper.
+Can be set with the in-buffer HTML_CONTENT_CLASS property or for
+publishing, with :html-content-class."
+ :group 'org-export-html
+ :version "27.2"
+ :package-version '(Org . "9.5")
+ :type 'string)
+
+
+(defcustom org-html-divs
+ '((preamble "div" "preamble")
+ (content "div" "content")
+ (postamble "div" "postamble"))
+ "Alist of the three section elements for HTML export.
+The car of each entry is one of `preamble', `content' or `postamble'.
+The cdrs of each entry are the ELEMENT_TYPE and ID for each
+section of the exported document.
+
+Note that changing the default will prevent you from using
+org-info.js for your website."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(list :greedy t
+ (list :tag "Preamble"
+ (const :format "" preamble)
+ (string :tag "element") (string :tag " id"))
+ (list :tag "Content"
+ (const :format "" content)
+ (string :tag "element") (string :tag " id"))
+ (list :tag "Postamble" (const :format "" postamble)
+ (string :tag " id") (string :tag "element"))))
+
+(defconst org-html-checkbox-types
+ '((unicode .
+ ((on . "&#x2611;") (off . "&#x2610;") (trans . "&#x2610;")))
+ (ascii .
+ ((on . "<code>[X]</code>")
+ (off . "<code>[&#xa0;]</code>")
+ (trans . "<code>[-]</code>")))
+ (html .
+ ((on . "<input type='checkbox' checked='checked' />")
+ (off . "<input type='checkbox' />")
+ (trans . "<input type='checkbox' />"))))
+ "Alist of checkbox types.
+The cdr of each entry is an alist list three checkbox types for
+HTML export: `on', `off' and `trans'.
+
+The choices are:
+ `unicode' Unicode characters (HTML entities)
+ `ascii' ASCII characters
+ `html' HTML checkboxes
+
+Note that only the ascii characters implement tri-state
+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 the values used for each
+option."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "ASCII characters" ascii)
+ (const :tag "Unicode characters" unicode)
+ (const :tag "HTML checkboxes" html)))
+
+(defcustom org-html-metadata-timestamp-format "%Y-%m-%d %a %H:%M"
+ "Format used for timestamps in preamble, postamble and metadata.
+See `format-time-string' for more information on its components."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string)
+
+;;;; Template :: Mathjax
+
+(defcustom org-html-mathjax-options
+ '((path "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML" )
+ (scale "100")
+ (align "center")
+ (font "TeX")
+ (linebreaks "false")
+ (autonumber "AMS")
+ (indent "0em")
+ (multlinewidth "85%")
+ (tagindent ".8em")
+ (tagside "right"))
+ "Options for MathJax setup.
+
+Alist of the following elements. All values are strings.
+
+path The path to MathJax.
+scale Scaling with HTML-CSS, MathML and SVG output engines.
+align How to align display math: left, center, or right.
+font The font to use with HTML-CSS and SVG output. As of MathJax 2.5
+ the following values are understood: \"TeX\", \"STIX-Web\",
+ \"Asana-Math\", \"Neo-Euler\", \"Gyre-Pagella\",
+ \"Gyre-Termes\", and \"Latin-Modern\".
+linebreaks Let MathJax perform automatic linebreaks. Valid values
+ are \"true\" and \"false\".
+indent If align is not center, how far from the left/right side?
+ Valid values are \"left\" and \"right\"
+multlinewidth The width of the multline environment.
+autonumber How to number equations. Valid values are \"None\",
+ \"all\" and \"AMS Math\".
+tagindent The amount tags are indented.
+tagside Which side to show tags/labels on. Valid values are
+ \"left\" and \"right\"
+
+You can also customize this for each buffer, using something like
+
+#+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler
+
+For further information about MathJax options, see the MathJax documentation:
+
+ https://docs.mathjax.org/"
+ :group 'org-export-html
+ :package-version '(Org . "8.3")
+ :type '(list :greedy t
+ (list :tag "path (the path from where to load MathJax.js)"
+ (const :format " " path) (string))
+ (list :tag "scale (scaling for the displayed math)"
+ (const :format " " scale) (string))
+ (list :tag "align (alignment of displayed equations)"
+ (const :format " " align) (string))
+ (list :tag "font (used to display math)"
+ (const :format " " font)
+ (choice (const "TeX")
+ (const "STIX-Web")
+ (const "Asana-Math")
+ (const "Neo-Euler")
+ (const "Gyre-Pagella")
+ (const "Gyre-Termes")
+ (const "Latin-Modern")))
+ (list :tag "linebreaks (automatic line-breaking)"
+ (const :format " " linebreaks)
+ (choice (const "true")
+ (const "false")))
+ (list :tag "autonumber (when should equations be numbered)"
+ (const :format " " autonumber)
+ (choice (const "AMS")
+ (const "None")
+ (const "All")))
+ (list :tag "indent (indentation with left or right alignment)"
+ (const :format " " indent) (string))
+ (list :tag "multlinewidth (width to use for the multline environment)"
+ (const :format " " multlinewidth) (string))
+ (list :tag "tagindent (the indentation of tags from left or right)"
+ (const :format " " tagindent) (string))
+ (list :tag "tagside (location of tags)"
+ (const :format " " tagside)
+ (choice (const "left")
+ (const "right")))))
+
+(defcustom org-html-mathjax-template
+ "<script type=\"text/x-mathjax-config\">
+ MathJax.Hub.Config({
+ displayAlign: \"%ALIGN\",
+ displayIndent: \"%INDENT\",
+
+ \"HTML-CSS\": { scale: %SCALE,
+ linebreaks: { automatic: \"%LINEBREAKS\" },
+ webFont: \"%FONT\"
+ },
+ SVG: {scale: %SCALE,
+ linebreaks: { automatic: \"%LINEBREAKS\" },
+ font: \"%FONT\"},
+ NativeMML: {scale: %SCALE},
+ TeX: { equationNumbers: {autoNumber: \"%AUTONUMBER\"},
+ MultLineWidth: \"%MULTLINEWIDTH\",
+ TagSide: \"%TAGSIDE\",
+ TagIndent: \"%TAGINDENT\"
+ }
+});
+</script>
+<script src=\"%PATH\"></script>"
+ "The MathJax template. See also `org-html-mathjax-options'."
+ :group 'org-export-html
+ :type 'string)
+
+;;;; Template :: Postamble
+
+(defcustom org-html-postamble 'auto
+ "Non-nil means insert a postamble in HTML export.
+
+When set to `auto', check against the
+`org-export-with-author/email/creator/date' variables to set the
+content of the postamble. When set to a string, use this string
+as the postamble. When t, insert a string as defined by the
+formatting string in `org-html-postamble-format'.
+
+When set to a function, apply this function and insert the
+returned string. The function takes the property list of export
+options as its only argument.
+
+Setting :html-postamble in publishing projects will take
+precedence over this variable."
+ :group 'org-export-html
+ :type '(choice (const :tag "No postamble" nil)
+ (const :tag "Auto postamble" auto)
+ (const :tag "Default formatting string" t)
+ (string :tag "Custom formatting string")
+ (function :tag "Function (must return a string)")))
+
+(defcustom org-html-postamble-format
+ '(("en" "<p class=\"author\">Author: %a (%e)</p>
+<p class=\"date\">Date: %d</p>
+<p class=\"creator\">%c</p>
+<p class=\"validation\">%v</p>"))
+ "Alist of languages and format strings for the HTML postamble.
+
+The first element of each list is the language code, as used for
+the LANGUAGE keyword. See `org-export-default-language'.
+
+The second element of each list is a format string to format the
+postamble itself. This format string can contain these elements:
+
+ %t stands for the title.
+ %s stands for the subtitle.
+ %a stands for the author's name.
+ %e stands for the author's email.
+ %d stands for the date.
+ %c will be replaced by `org-html-creator-string'.
+ %v will be replaced by `org-html-validation-link'.
+ %T will be replaced by the export time.
+ %C will be replaced by the last modification time.
+
+If you need to use a \"%\" character, you need to escape it
+like that: \"%%\"."
+ :group 'org-export-html
+ :type '(repeat
+ (list (string :tag "Language")
+ (string :tag "Format string"))))
+
+(defcustom org-html-validation-link
+ "<a href=\"https://validator.w3.org/check?uri=referer\">Validate</a>"
+ "Link to HTML validation service."
+ :group 'org-export-html
+ :package-version '(Org . "9.4")
+ :type 'string)
+
+(defcustom org-html-creator-string
+ (format "<a href=\"https://www.gnu.org/software/emacs/\">Emacs</a> %s (<a href=\"https://orgmode.org\">Org</a> mode %s)"
+ emacs-version
+ (if (fboundp 'org-version) (org-version) "unknown version"))
+ "Information about the creator of the HTML document.
+This option can also be set on with the CREATOR keyword."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(string :tag "Creator string"))
+
+;;;; Template :: Preamble
+
+(defcustom org-html-preamble t
+ "Non-nil means insert a preamble in HTML export.
+
+When t, insert a string as defined by the formatting string in
+`org-html-preamble-format'. When set to a string, use this
+formatting string instead (see `org-html-postamble-format' for an
+example of such a formatting string).
+
+When set to a function, apply this function and insert the
+returned string. The function takes the property list of export
+options as its only argument.
+
+Setting :html-preamble in publishing projects will take
+precedence over this variable."
+ :group 'org-export-html
+ :type '(choice (const :tag "No preamble" nil)
+ (const :tag "Default preamble" t)
+ (string :tag "Custom formatting string")
+ (function :tag "Function (must return a string)")))
+
+(defcustom org-html-preamble-format '(("en" ""))
+ "Alist of languages and format strings for the HTML preamble.
+
+The first element of each list is the language code, as used for
+the LANGUAGE keyword. See `org-export-default-language'.
+
+The second element of each list is a format string to format the
+preamble itself. This format string can contain these elements:
+
+ %t stands for the title.
+ %s stands for the subtitle.
+ %a stands for the author's name.
+ %e stands for the author's email.
+ %d stands for the date.
+ %c will be replaced by `org-html-creator-string'.
+ %v will be replaced by `org-html-validation-link'.
+ %T will be replaced by the export time.
+ %C will be replaced by the last modification time.
+
+If you need to use a \"%\" character, you need to escape it
+like that: \"%%\".
+
+See the default value of `org-html-postamble-format' for an
+example."
+ :group 'org-export-html
+ :type '(repeat
+ (list (string :tag "Language")
+ (string :tag "Format string"))))
+
+(defcustom org-html-link-up ""
+ "Where should the \"UP\" link of exported HTML pages lead?"
+ :group 'org-export-html
+ :type '(string :tag "File or URL"))
+
+(defcustom org-html-link-home ""
+ "Where should the \"HOME\" link of exported HTML pages lead?"
+ :group 'org-export-html
+ :type '(string :tag "File or URL"))
+
+(defcustom org-html-link-use-abs-url nil
+ "Should we prepend relative links with HTML_LINK_HOME?"
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.1")
+ :type 'boolean)
+
+(defcustom org-html-home/up-format
+ "<div id=\"org-div-home-and-up\">
+ <a accesskey=\"h\" href=\"%s\"> UP </a>
+ |
+ <a accesskey=\"H\" href=\"%s\"> HOME </a>
+</div>"
+ "Snippet used to insert the HOME and UP links.
+This is a format string, the first %s will receive the UP link,
+the second the HOME link. If both `org-html-link-up' and
+`org-html-link-home' are empty, the entire snippet will be
+ignored."
+ :group 'org-export-html
+ :type 'string)
+
+;;;; Template :: Scripts
+
+(defcustom org-html-head-include-scripts nil
+ "Non-nil means include the JavaScript snippets in exported HTML files.
+The actual script is defined in `org-html-scripts'."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+;;;; Template :: Styles
+
+(defcustom org-html-meta-tags #'org-html-meta-tags-default
+ "Form that is used to produce meta tags in the HTML head.
+
+Can be a list where each item is a list of arguments to be passed
+to `org-html--build-meta-entry'. Any nil items are ignored.
+
+Also accept a function which gives such a list when called with a
+single argument (INFO, a communication plist)."
+ :group 'org-export-html
+ :package-version '(Org . "9.5")
+ :type '(choice
+ (repeat
+ (list (string :tag "Meta label")
+ (string :tag "label value")
+ (string :tag "Content value")))
+ function))
+
+(defcustom org-html-head-include-default-style t
+ "Non-nil means include the default style in exported HTML files.
+The actual style is defined in `org-html-style-default' and
+should not be modified. Use `org-html-head' to use your own
+style information."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+;;;###autoload
+(put 'org-html-head-include-default-style 'safe-local-variable 'booleanp)
+
+(defcustom org-html-head ""
+ "Org-wide head definitions for exported HTML files.
+
+This variable can contain the full HTML structure to provide a
+style, including the surrounding HTML tags. You can consider
+including definitions for the following classes: title, todo,
+done, timestamp, timestamp-kwd, tag, target.
+
+For example, a valid value would be:
+
+ <style>
+ p { font-weight: normal; color: gray; }
+ h1 { color: black; }
+ .title { text-align: center; }
+ .todo, .timestamp-kwd { color: red; }
+ .done { color: green; }
+ </style>
+
+If you want to refer to an external style, use something like
+
+ <link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css\" />
+
+As the value of this option simply gets inserted into the HTML
+<head> header, you can use it to add any arbitrary text to the
+header.
+
+You can set this on a per-file basis using #+HTML_HEAD:,
+or for publication projects using the :html-head property."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string)
+;;;###autoload
+(put 'org-html-head 'safe-local-variable 'stringp)
+
+(defcustom org-html-head-extra ""
+ "More head information to add in the HTML output.
+
+You can set this on a per-file basis using #+HTML_HEAD_EXTRA:,
+or for publication projects using the :html-head-extra property."
+ :group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string)
+;;;###autoload
+(put 'org-html-head-extra 'safe-local-variable 'stringp)
+
+;;;; Template :: Viewport
+
+(defcustom org-html-viewport '((width "device-width")
+ (initial-scale "1")
+ (minimum-scale "")
+ (maximum-scale "")
+ (user-scalable ""))
+ "Viewport options for mobile-optimized sites.
+
+The following values are recognized
+
+width Size of the viewport.
+initial-scale Zoom level when the page is first loaded.
+minimum-scale Minimum allowed zoom level.
+maximum-scale Maximum allowed zoom level.
+user-scalable Whether zoom can be changed.
+
+The viewport meta tag is inserted if this variable is non-nil.
+
+See the following site for a reference:
+https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag"
+ :group 'org-export-html
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(choice (const :tag "Disable" nil)
+ (list :tag "Enable"
+ (list :tag "Width of viewport"
+ (const :format " " width)
+ (choice (const :tag "unset" "")
+ (string)))
+ (list :tag "Initial scale"
+ (const :format " " initial-scale)
+ (choice (const :tag "unset" "")
+ (string)))
+ (list :tag "Minimum scale/zoom"
+ (const :format " " minimum-scale)
+ (choice (const :tag "unset" "")
+ (string)))
+ (list :tag "Maximum scale/zoom"
+ (const :format " " maximum-scale)
+ (choice (const :tag "unset" "")
+ (string)))
+ (list :tag "User scalable/zoomable"
+ (const :format " " user-scalable)
+ (choice (const :tag "unset" "")
+ (const "true")
+ (const "false"))))))
+
+;; Handle source code blocks with Klipse
+
+(defcustom org-html-klipsify-src nil
+ "When non-nil, source code blocks are editable in exported presentation."
+ :group 'org-export-html
+ :package-version '(Org . "9.1")
+ :type 'boolean)
+
+(defcustom org-html-klipse-css
+ "https://storage.googleapis.com/app.klipse.tech/css/codemirror.css"
+ "Location of the codemirror CSS file for use with klipse."
+ :group 'org-export-html
+ :package-version '(Org . "9.1")
+ :type 'string)
+
+(defcustom org-html-klipse-js
+ "https://storage.googleapis.com/app.klipse.tech/plugin_prod/js/klipse_plugin.min.js"
+ "Location of the klipse javascript file."
+ :group 'org-export-html
+ :type 'string)
+
+(defcustom org-html-klipse-selection-script
+ "window.klipse_settings = {selector_eval_html: '.src-html',
+ selector_eval_js: '.src-js',
+ selector_eval_python_client: '.src-python',
+ selector_eval_scheme: '.src-scheme',
+ selector: '.src-clojure',
+ selector_eval_ruby: '.src-ruby'};"
+ "Javascript snippet to activate klipse."
+ :group 'org-export-html
+ :package-version '(Org . "9.1")
+ :type 'string)
+
+
+;;;; Todos
+
+(defcustom org-html-todo-kwd-class-prefix ""
+ "Prefix to class names for TODO keywords.
+Each TODO keyword gets a class given by the keyword itself, with this prefix.
+The default prefix is empty because it is nice to just use the keyword
+as a class name. But if you get into conflicts with other, existing
+CSS classes, then this prefix can be very useful."
+ :group 'org-export-html
+ :type 'string)
+
+
+;;; Internal Functions
+
+(defun org-html-xhtml-p (info)
+ (let ((dt (downcase (plist-get info :html-doctype))))
+ (string-match-p "xhtml" dt)))
+
+(defun org-html-html5-p (info)
+ (let ((dt (downcase (plist-get info :html-doctype))))
+ (member dt '("html5" "xhtml5" "<!doctype html>"))))
+
+(defun org-html--html5-fancy-p (info)
+ "Non-nil when exporting to HTML5 with fancy elements.
+INFO is the current state of the export process, as a plist."
+ (and (plist-get info :html-html5-fancy)
+ (org-html-html5-p info)))
+
+(defun org-html-close-tag (tag attr info)
+ "Return close-tag for string TAG.
+ATTR specifies additional attributes. INFO is a property list
+containing current export state."
+ (concat "<" tag
+ (org-string-nw-p (concat " " attr))
+ (if (org-html-xhtml-p info) " />" ">")))
+
+(defun org-html-doctype (info)
+ "Return correct HTML doctype tag.
+INFO is a plist used as a communication channel. Doctype tag is
+extracted from `org-html-doctype-alist', or the literal value
+of :html-doctype from INFO if :html-doctype is not found in the
+alist."
+ (let ((dt (plist-get info :html-doctype)))
+ (or (cdr (assoc dt org-html-doctype-alist)) dt)))
+
+(defun org-html--make-attribute-string (attributes)
+ "Return a list of attributes, as a string.
+ATTRIBUTES is a plist where values are either strings or nil. An
+attribute with a nil value will be omitted from the result."
+ (let (output)
+ (dolist (item attributes (mapconcat 'identity (nreverse output) " "))
+ (cond ((null item) (pop output))
+ ((symbolp item) (push (substring (symbol-name item) 1) output))
+ (t (let ((key (car output))
+ (value (replace-regexp-in-string
+ "\"" "&quot;" (org-html-encode-plain-text item))))
+ (setcar output (format "%s=\"%s\"" key value))))))))
+
+(defun org-html--reference (datum info &optional named-only)
+ "Return an appropriate reference for DATUM.
+
+DATUM is an element or a `target' type object. INFO is the
+current export state, as a plist.
+
+When NAMED-ONLY is non-nil and DATUM has no NAME keyword, return
+nil. This doesn't apply to headlines, inline tasks, radio
+targets and targets."
+ (let* ((type (org-element-type datum))
+ (user-label
+ (org-element-property
+ (pcase type
+ ((or `headline `inlinetask) :CUSTOM_ID)
+ ((or `radio-target `target) :value)
+ (_ :name))
+ datum)))
+ (cond
+ ((and user-label
+ (or (plist-get info :html-prefer-user-labels)
+ ;; Used CUSTOM_ID property unconditionally.
+ (memq type '(headline inlinetask))))
+ user-label)
+ ((and named-only
+ (not (memq type '(headline inlinetask radio-target target)))
+ (not user-label))
+ nil)
+ (t
+ (org-export-get-reference datum info)))))
+
+(defun org-html--wrap-image (contents info &optional caption label)
+ "Wrap CONTENTS string within an appropriate environment for images.
+INFO is a plist used as a communication channel. When optional
+arguments CAPTION and LABEL are given, use them for caption and
+\"id\" attribute."
+ (let ((html5-fancy (org-html--html5-fancy-p info)))
+ (format (if html5-fancy "\n<figure%s>\n%s%s\n</figure>"
+ "\n<div%s class=\"figure\">\n%s%s\n</div>")
+ ;; ID.
+ (if (org-string-nw-p label) (format " id=\"%s\"" label) "")
+ ;; Contents.
+ (if html5-fancy contents (format "<p>%s</p>" contents))
+ ;; Caption.
+ (if (not (org-string-nw-p caption)) ""
+ (format (if html5-fancy "\n<figcaption>%s</figcaption>"
+ "\n<p>%s</p>")
+ caption)))))
+
+(defun org-html--format-image (source attributes info)
+ "Return \"img\" tag with given SOURCE and ATTRIBUTES.
+SOURCE is a string specifying the location of the image.
+ATTRIBUTES is a plist, as returned by
+`org-export-read-attribute'. INFO is a plist used as
+a communication channel."
+ (org-html-close-tag
+ "img"
+ (org-html--make-attribute-string
+ (org-combine-plists
+ (list :src source
+ :alt (if (string-match-p
+ (concat "^" org-preview-latex-image-directory) source)
+ (org-html-encode-plain-text
+ (org-find-text-property-in-string 'org-latex-src source))
+ (file-name-nondirectory source)))
+ (if (string= "svg" (file-name-extension source))
+ (org-combine-plists '(:class "org-svg") attributes '(:fallback nil))
+ attributes)))
+ info))
+
+(defun org-html--textarea-block (element)
+ "Transcode ELEMENT into a textarea 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 "<p>\n<textarea cols=\"%s\" rows=\"%s\">\n%s</textarea>\n</p>"
+ (or (plist-get attr :width) 80)
+ (or (plist-get attr :height) (org-count-lines code))
+ code)))
+
+(defun org-html--has-caption-p (element &optional _info)
+ "Non-nil when ELEMENT has a caption affiliated keyword.
+INFO is a plist used as a communication channel. This function
+is meant to be used as a predicate for `org-export-get-ordinal' or
+a value to `org-html-standalone-image-predicate'."
+ (org-element-property :caption element))
+
+;;;; Table
+
+(defun org-html-htmlize-region-for-paste (beg end)
+ "Convert the region between BEG and END to HTML, using htmlize.el.
+This is much like `htmlize-region-for-paste', only that it uses
+the settings define in the org-... variables."
+ (let* ((htmlize-output-type org-html-htmlize-output-type)
+ (htmlize-css-name-prefix org-html-htmlize-font-prefix)
+ (htmlbuf (htmlize-region beg end)))
+ (unwind-protect
+ (with-current-buffer htmlbuf
+ (buffer-substring (plist-get htmlize-buffer-places 'content-start)
+ (plist-get htmlize-buffer-places 'content-end)))
+ (kill-buffer htmlbuf))))
+
+;;;###autoload
+(defun org-html-htmlize-generate-css ()
+ "Create the CSS for all font definitions in the current Emacs session.
+Use this to create face definitions in your CSS style file that can then
+be used by code snippets transformed by htmlize.
+This command just produces a buffer that contains class definitions for all
+faces used in the current Emacs session. You can copy and paste the ones you
+need into your CSS file.
+
+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)
+ (unless (require 'htmlize nil t)
+ (error "htmlize library missing. Aborting"))
+ (and (get-buffer "*html*") (kill-buffer "*html*"))
+ (with-temp-buffer
+ (let ((fl (face-list))
+ (htmlize-css-name-prefix "org-")
+ (htmlize-output-type 'css)
+ f i)
+ (while (setq f (pop fl)
+ i (and f (face-attribute f :inherit)))
+ (when (and (symbolp f) (or (not i) (not (listp i))))
+ (insert (org-add-props (copy-sequence "1") nil 'face f))))
+ (htmlize-region (point-min) (point-max))))
+ (pop-to-buffer-same-window "*html*")
+ (goto-char (point-min))
+ (when (re-search-forward "<style" nil t)
+ (delete-region (point-min) (match-beginning 0)))
+ (when (re-search-forward "</style>" nil t)
+ (delete-region (1+ (match-end 0)) (point-max)))
+ (beginning-of-line 1)
+ (when (looking-at " +") (replace-match ""))
+ (goto-char (point-min)))
+
+(defun org-html--make-string (n string)
+ "Build a string by concatenating N times STRING."
+ (let (out) (dotimes (_ n out) (setq out (concat string out)))))
+
+(defun org-html-fix-class-name (kwd) ; audit callers of this function
+ "Turn todo keyword KWD into a valid class name.
+Replaces invalid characters with \"_\"."
+ (replace-regexp-in-string "[^a-zA-Z0-9_]" "_" kwd nil t))
+
+(defun org-html-footnote-section (info)
+ "Format the footnote section.
+INFO is a plist used as a communication channel."
+ (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 (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\" role=\"doc-backlink\"" n)
+ info))
+ (contents (org-trim (org-export-data def info))))
+ (format "<div class=\"footdef\">%s %s</div>\n"
+ (format (plist-get info :html-footnote-format) anchor)
+ (format "<div class=\"footpara\" role=\"doc-footnote\">%s</div>"
+ (if (not inline?) contents
+ (format "<p class=\"footpara\">%s</p>"
+ contents))))))))
+ definitions
+ "\n"))))))
+
+
+;;; Template
+
+(defun org-html-meta-tags-default (info)
+ "A default value for `org-html-meta-tags'.
+
+Generate a list items, each of which is a list of arguments that can
+be passed to `org-html--build-meta-entry', to generate meta tags to be
+included in the HTML head.
+
+Use document's plist INFO to derive relevant information for the tags."
+ (let ((author (and (plist-get info :with-author)
+ (let ((auth (plist-get info :author)))
+ ;; Return raw Org syntax.
+ (and auth (org-element-interpret-data auth))))))
+ (list
+ (when (org-string-nw-p author)
+ (list "name" "author" author))
+ (when (org-string-nw-p (plist-get info :description))
+ (list "name" "description"
+ (plist-get info :description)))
+ (when (org-string-nw-p (plist-get info :keywords))
+ (list "name" "keywords" (plist-get info :keywords)))
+ '("name" "generator" "Org Mode"))))
+
+(defun org-html--build-meta-entry
+ (label identity &optional content-format &rest content-formatters)
+ "Build a meta tag using the provided information.
+
+Construct <meta> tag of form <meta LABEL=\"IDENTITY\" />, or when CONTENT-FORMAT
+is present: <meta LABEL=\"IDENTITY\" content=\"{content}\" />
+
+Here {content} is determined by applying any CONTENT-FORMATTERS to the
+CONTENT-FORMAT and encoding the result as plain text."
+ (concat "<meta "
+ (format "%s=\"%s" label identity)
+ (when content-format
+ (concat "\" content=\""
+ (replace-regexp-in-string
+ "\"" "&quot;"
+ (org-html-encode-plain-text
+ (if content-formatters
+ (apply #'format content-format content-formatters)
+ content-format)))))
+ "\" />\n"))
+
+(defun org-html--build-meta-info (info)
+ "Return meta tags for exported document.
+INFO is a plist used as a communication channel."
+ (let* ((title (org-html-plain-text
+ (org-element-interpret-data (plist-get info :title)) info))
+ ;; Set title to an invisible character instead of leaving it
+ ;; empty, which is invalid.
+ (title (if (org-string-nw-p title) title "&lrm;"))
+ (charset (or (and org-html-coding-system
+ (fboundp 'coding-system-get)
+ (symbol-name
+ (coding-system-get org-html-coding-system
+ 'mime-charset)))
+ "iso-8859-1")))
+ (concat
+ (when (plist-get info :time-stamp-file)
+ (format-time-string
+ (concat "<!-- "
+ (plist-get info :html-metadata-timestamp-format)
+ " -->\n")))
+
+ (if (org-html-html5-p info)
+ (org-html--build-meta-entry "charset" charset)
+ (org-html--build-meta-entry "http-equiv" "Content-Type"
+ (concat "text/html;charset=" charset)))
+
+ (let ((viewport-options
+ (cl-remove-if-not (lambda (cell) (org-string-nw-p (cadr cell)))
+ (plist-get info :html-viewport))))
+ (if viewport-options
+ (org-html--build-meta-entry "name" "viewport"
+ (mapconcat
+ (lambda (elm)
+ (format "%s=%s" (car elm) (cadr elm)))
+ viewport-options ", "))))
+
+ (format "<title>%s</title>\n" title)
+
+ (mapconcat
+ (lambda (args) (apply #'org-html--build-meta-entry args))
+ (delq nil (if (functionp org-html-meta-tags)
+ (funcall org-html-meta-tags info)
+ org-html-meta-tags))
+ ""))))
+
+(defun org-html--build-head (info)
+ "Return information for the <head>..</head> of the HTML output.
+INFO is a plist used as a communication channel."
+ (org-element-normalize-string
+ (concat
+ (when (plist-get info :html-head-include-default-style)
+ (org-element-normalize-string org-html-style-default))
+ (org-element-normalize-string (plist-get info :html-head))
+ (org-element-normalize-string (plist-get info :html-head-extra))
+ (when (and (plist-get info :html-htmlized-css-url)
+ (eq org-html-htmlize-output-type 'css))
+ (org-html-close-tag "link"
+ (format "rel=\"stylesheet\" href=\"%s\" type=\"text/css\""
+ (plist-get info :html-htmlized-css-url))
+ info))
+ (when (plist-get info :html-head-include-scripts) org-html-scripts))))
+
+(defun org-html--build-mathjax-config (info)
+ "Insert the user setup into the mathjax template.
+INFO is a plist used as a communication channel."
+ (when (and (memq (plist-get info :with-latex) '(mathjax t))
+ (org-element-map (plist-get info :parse-tree)
+ '(latex-fragment latex-environment) #'identity info t nil t))
+ (let ((template (plist-get info :html-mathjax-template))
+ (options (plist-get info :html-mathjax-options))
+ (in-buffer (or (plist-get info :html-mathjax) "")))
+ (dolist (e options (org-element-normalize-string template))
+ (let ((name (car e))
+ (val (nth 1 e)))
+ (when (string-match (concat "\\<" (symbol-name name) ":") in-buffer)
+ (setq val
+ (car (read-from-string (substring in-buffer (match-end 0))))))
+ (unless (stringp val) (setq val (format "%s" val)))
+ (while (string-match (concat "%" (upcase (symbol-name name)))
+ template)
+ (setq template (replace-match val t t template))))))))
+
+(defun org-html-format-spec (info)
+ "Return format specification for preamble and postamble.
+INFO is a plist used as a communication channel."
+ (let ((timestamp-format (plist-get info :html-metadata-timestamp-format)))
+ `((?t . ,(org-export-data (plist-get info :title) info))
+ (?s . ,(org-export-data (plist-get info :subtitle) info))
+ (?d . ,(org-export-data (org-export-get-date info timestamp-format)
+ info))
+ (?T . ,(format-time-string timestamp-format))
+ (?a . ,(org-export-data (plist-get info :author) info))
+ (?e . ,(mapconcat
+ (lambda (e) (format "<a href=\"mailto:%s\">%s</a>" e e))
+ (split-string (plist-get info :email) ",+ *")
+ ", "))
+ (?c . ,(plist-get info :creator))
+ (?C . ,(let ((file (plist-get info :input-file)))
+ (format-time-string timestamp-format
+ (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)
+ "Return document preamble or postamble as a string, or nil.
+TYPE is either `preamble' or `postamble', INFO is a plist used as a
+communication channel."
+ (let ((section (plist-get info (intern (format ":html-%s" type))))
+ (spec (org-html-format-spec info)))
+ (when section
+ (let ((section-contents
+ (if (functionp section) (funcall section info)
+ (cond
+ ((stringp section) (format-spec section spec))
+ ((eq section 'auto)
+ (let ((date (cdr (assq ?d spec)))
+ (author (cdr (assq ?a spec)))
+ (email (cdr (assq ?e spec)))
+ (creator (cdr (assq ?c spec)))
+ (validation-link (cdr (assq ?v spec))))
+ (concat
+ (and (plist-get info :with-date)
+ (org-string-nw-p date)
+ (format "<p class=\"date\">%s: %s</p>\n"
+ (org-html--translate "Date" info)
+ date))
+ (and (plist-get info :with-author)
+ (org-string-nw-p author)
+ (format "<p class=\"author\">%s: %s</p>\n"
+ (org-html--translate "Author" info)
+ author))
+ (and (plist-get info :with-email)
+ (org-string-nw-p email)
+ (format "<p class=\"email\">%s: %s</p>\n"
+ (org-html--translate "Email" info)
+ email))
+ (and (plist-get info :time-stamp-file)
+ (format
+ "<p class=\"date\">%s: %s</p>\n"
+ (org-html--translate "Created" info)
+ (format-time-string
+ (plist-get info :html-metadata-timestamp-format))))
+ (and (plist-get info :with-creator)
+ (org-string-nw-p creator)
+ (format "<p class=\"creator\">%s</p>\n" creator))
+ (and (org-string-nw-p validation-link)
+ (format "<p class=\"validation\">%s</p>\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
+ (format "<%s id=\"%s\" class=\"%s\">\n"
+ (nth 1 div)
+ (nth 2 div)
+ org-html--pre/postamble-class)
+ (org-element-normalize-string section-contents)
+ (format "</%s>\n" (nth 1 div)))))))))
+
+(defun org-html-inner-template (contents info)
+ "Return body of document string after HTML conversion.
+CONTENTS is the transcoded contents string. INFO is a plist
+holding export options."
+ (concat
+ ;; Table of contents.
+ (let ((depth (plist-get info :with-toc)))
+ (when depth (org-html-toc depth info)))
+ ;; Document contents.
+ contents
+ ;; Footnotes section.
+ (org-html-footnote-section info)))
+
+(defun org-html-template (contents info)
+ "Return complete document string after HTML conversion.
+CONTENTS is the transcoded contents string. INFO is a plist
+holding export options."
+ (concat
+ (when (and (not (org-html-html5-p info)) (org-html-xhtml-p info))
+ (let* ((xml-declaration (plist-get info :html-xml-declaration))
+ (decl (or (and (stringp xml-declaration) xml-declaration)
+ (cdr (assoc (plist-get info :html-extension)
+ xml-declaration))
+ (cdr (assoc "html" xml-declaration))
+ "")))
+ (when (not (or (not decl) (string= "" decl)))
+ (format "%s\n"
+ (format decl
+ (or (and org-html-coding-system
+ (fboundp 'coding-system-get)
+ (coding-system-get org-html-coding-system 'mime-charset))
+ "iso-8859-1"))))))
+ (org-html-doctype info)
+ "\n"
+ (concat "<html"
+ (cond ((org-html-xhtml-p info)
+ (format
+ " xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"%s\" xml:lang=\"%s\""
+ (plist-get info :language) (plist-get info :language)))
+ ((org-html-html5-p info)
+ (format " lang=\"%s\"" (plist-get info :language))))
+ ">\n")
+ "<head>\n"
+ (org-html--build-meta-info info)
+ (org-html--build-head info)
+ (org-html--build-mathjax-config info)
+ "</head>\n"
+ "<body>\n"
+ (let ((link-up (org-trim (plist-get info :html-link-up)))
+ (link-home (org-trim (plist-get info :html-link-home))))
+ (unless (and (string= link-up "") (string= link-home ""))
+ (format (plist-get info :html-home/up-format)
+ (or link-up link-home)
+ (or link-home link-up))))
+ ;; Preamble.
+ (org-html--build-pre/postamble 'preamble info)
+ ;; Document contents.
+ (let ((div (assq 'content (plist-get info :html-divs))))
+ (format "<%s id=\"%s\" class=\"%s\">\n"
+ (nth 1 div)
+ (nth 2 div)
+ (plist-get info :html-content-class)))
+ ;; Document title.
+ (when (plist-get info :with-title)
+ (let ((title (and (plist-get info :with-title)
+ (plist-get info :title)))
+ (subtitle (plist-get info :subtitle))
+ (html5-fancy (org-html--html5-fancy-p info)))
+ (when title
+ (format
+ (if html5-fancy
+ "<header>\n<h1 class=\"title\">%s</h1>\n%s</header>"
+ "<h1 class=\"title\">%s%s</h1>\n")
+ (org-export-data title info)
+ (if subtitle
+ (format
+ (if html5-fancy
+ "<p class=\"subtitle\" role=\"doc-subtitle\">%s</p>\n"
+ (concat "\n" (org-html-close-tag "br" nil info) "\n"
+ "<span class=\"subtitle\">%s</span>\n"))
+ (org-export-data subtitle info))
+ "")))))
+ contents
+ (format "</%s>\n" (nth 1 (assq 'content (plist-get info :html-divs))))
+ ;; Postamble.
+ (org-html--build-pre/postamble 'postamble info)
+ ;; Possibly use the Klipse library live code blocks.
+ (when (plist-get info :html-klipsify-src)
+ (concat "<script>" (plist-get info :html-klipse-selection-script)
+ "</script><script src=\""
+ org-html-klipse-js
+ "\"></script><link rel=\"stylesheet\" type=\"text/css\" href=\""
+ org-html-klipse-css "\"/>"))
+ ;; Closing document.
+ "</body>\n</html>"))
+
+(defun org-html--translate (s info)
+ "Translate string S according to specified language.
+INFO is a plist used as a communication channel."
+ (org-export-translate s :html info))
+
+;;;; Anchor
+
+(defun org-html--anchor (id desc attributes info)
+ "Format a HTML anchor."
+ (let* ((name (and (plist-get info :html-allow-name-attribute-in-anchors) id))
+ (attributes (concat (and id (format " id=\"%s\"" id))
+ (and name (format " name=\"%s\"" name))
+ attributes)))
+ (format "<a%s>%s</a>" attributes (or desc ""))))
+
+;;;; Todo
+
+(defun org-html--todo (todo info)
+ "Format TODO keywords into HTML."
+ (when todo
+ (format "<span class=\"%s %s%s\">%s</span>"
+ (if (member todo org-done-keywords) "done" "todo")
+ (or (plist-get info :html-todo-kwd-class-prefix) "")
+ (org-html-fix-class-name todo)
+ todo)))
+
+;;;; Priority
+
+(defun org-html--priority (priority _info)
+ "Format a priority into HTML.
+PRIORITY is the character code of the priority or nil. INFO is
+a plist containing export options."
+ (and priority (format "<span class=\"priority\">[%c]</span>" priority)))
+
+;;;; Tags
+
+(defun org-html--tags (tags info)
+ "Format TAGS into HTML.
+INFO is a plist containing export options."
+ (when tags
+ (format "<span class=\"tag\">%s</span>"
+ (mapconcat
+ (lambda (tag)
+ (format "<span class=\"%s\">%s</span>"
+ (concat (plist-get info :html-tag-class-prefix)
+ (org-html-fix-class-name tag))
+ tag))
+ tags "&#xa0;"))))
+
+;;;; Src Code
+
+(defun org-html-fontify-code (code lang)
+ "Color CODE with htmlize library.
+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
+ ;; 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 source block (htmlize.el >= 1.34 required)")
+ (org-html-encode-plain-text code))
+ (t
+ ;; Map language
+ (setq lang (or (assoc-default lang org-src-lang-modes) lang))
+ (let* ((lang-mode (and lang (intern (format "%s-mode" lang)))))
+ (cond
+ ;; Case 1: Language is not associated with any Emacs mode
+ ((not (functionp lang-mode))
+ (org-html-encode-plain-text code))
+ ;; Case 2: Default. Fontify code.
+ (t
+ ;; htmlize
+ (setq code
+ (let ((output-type org-html-htmlize-output-type)
+ (font-prefix org-html-htmlize-font-prefix)
+ (inhibit-read-only t))
+ (with-temp-buffer
+ ;; Switch to language-specific mode.
+ (funcall lang-mode)
+ (insert code)
+ ;; Fontify buffer.
+ (org-font-lock-ensure)
+ ;; Remove formatting on newline characters.
+ (save-excursion
+ (let ((beg (point-min))
+ (end (point-max)))
+ (goto-char beg)
+ (while (progn (end-of-line) (< (point) end))
+ (put-text-property (point) (1+ (point)) 'face nil)
+ (forward-char 1))))
+ (org-src-mode)
+ (set-buffer-modified-p nil)
+ ;; Htmlize region.
+ (let ((org-html-htmlize-output-type output-type)
+ (org-html-htmlize-font-prefix font-prefix))
+ (org-html-htmlize-region-for-paste
+ (point-min) (point-max))))))
+ ;; Strip any enclosing <pre></pre> tags.
+ (let* ((beg (and (string-match "\\`<pre[^>]*>\n?" code) (match-end 0)))
+ (end (and beg (string-match "</pre>\\'" code))))
+ (if (and beg end) (substring code beg end) code)))))))))
+
+(defun org-html-do-format-code
+ (code &optional lang refs retain-labels num-start wrap-lines)
+ "Format CODE string as source code.
+Optional arguments LANG, REFS, RETAIN-LABELS, NUM-START, WRAP-LINES
+are, respectively, the language of the source code, as a string, an
+alist between line numbers and references (as returned by
+`org-export-unravel-code'), a boolean specifying if labels should
+appear in the source code, the number associated to the first
+line of code, and a boolean specifying if lines of code should be
+wrapped in code elements."
+ (let* ((code-lines (split-string code "\n"))
+ (code-length (length code-lines))
+ (num-fmt
+ (and num-start
+ (format "%%%ds: "
+ (length (number-to-string (+ code-length num-start))))))
+ (code (org-html-fontify-code code lang)))
+ (org-export-format-code
+ code
+ (lambda (loc line-num ref)
+ (setq loc
+ (concat
+ ;; Add line number, if needed.
+ (when num-start
+ (format "<span class=\"linenr\">%s</span>"
+ (format num-fmt line-num)))
+ ;; Transcoded src line.
+ (if wrap-lines
+ (format "<code%s>%s</code>"
+ (if num-start
+ (format " data-ox-html-linenr=\"%s\"" line-num)
+ "")
+ loc)
+ loc)
+ ;; Add label, if needed.
+ (when (and ref retain-labels) (format " (%s)" ref))))
+ ;; Mark transcoded line as an anchor, if needed.
+ (if (not ref) loc
+ (format "<span id=\"coderef-%s\" class=\"coderef-off\">%s</span>"
+ ref loc)))
+ num-start refs)))
+
+(defun org-html-format-code (element info)
+ "Format contents of ELEMENT as source code.
+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 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))
+ ;; Should lines be wrapped in code elements?
+ (wrap-lines (plist-get info :html-wrap-src-lines)))
+ (org-html-do-format-code code lang refs retain-labels num-start wrap-lines)))
+
+
+;;; Tables of Contents
+
+(defun org-html-toc (depth info &optional scope)
+ "Build a table of contents.
+DEPTH is an integer specifying the depth of the table. INFO is
+a plist used as a communication channel. Optional argument SCOPE
+is an element defining the scope of the table. Return the table
+of contents as a string, or nil if it is empty."
+ (let ((toc-entries
+ (mapcar (lambda (headline)
+ (cons (org-html--format-toc-headline headline info)
+ (org-export-get-relative-level headline info)))
+ (org-export-collect-headlines info depth scope))))
+ (when toc-entries
+ (let ((toc (concat "<div id=\"text-table-of-contents\" role=\"doc-toc\">"
+ (org-html--toc-text toc-entries)
+ "</div>\n")))
+ (if scope toc
+ (let ((outer-tag (if (org-html--html5-fancy-p info)
+ "nav"
+ "div")))
+ (concat (format "<%s id=\"table-of-contents\" role=\"doc-toc\">\n" outer-tag)
+ (let ((top-level (plist-get info :html-toplevel-hlevel)))
+ (format "<h%d>%s</h%d>\n"
+ top-level
+ (org-html--translate "Table of Contents" info)
+ top-level))
+ toc
+ (format "</%s>\n" outer-tag))))))))
+
+(defun org-html--toc-text (toc-entries)
+ "Return innards of a table of contents, as a string.
+TOC-ENTRIES is an alist where key is an entry title, as a string,
+and value is its relative level, as an integer."
+ (let* ((prev-level (1- (cdar toc-entries)))
+ (start-level prev-level))
+ (concat
+ (mapconcat
+ (lambda (entry)
+ (let ((headline (car entry))
+ (level (cdr entry)))
+ (concat
+ (let* ((cnt (- level prev-level))
+ (times (if (> cnt 0) (1- cnt) (- cnt))))
+ (setq prev-level level)
+ (concat
+ (org-html--make-string
+ times (cond ((> cnt 0) "\n<ul>\n<li>")
+ ((< cnt 0) "</li>\n</ul>\n")))
+ (if (> cnt 0) "\n<ul>\n<li>" "</li>\n<li>")))
+ headline)))
+ toc-entries "")
+ (org-html--make-string (- prev-level start-level) "</li>\n</ul>\n"))))
+
+(defun org-html--format-toc-headline (headline info)
+ "Return an appropriate table of contents entry for HEADLINE.
+INFO is a plist used as a communication channel."
+ (let* ((headline-number (org-export-get-headline-number headline info))
+ (todo (and (plist-get info :with-todo-keywords)
+ (let ((todo (org-element-property :todo-keyword headline)))
+ (and todo (org-export-data todo info)))))
+ (todo-type (and todo (org-element-property :todo-type headline)))
+ (priority (and (plist-get info :with-priority)
+ (org-element-property :priority headline)))
+ (text (org-export-data-with-backend
+ (org-export-get-alt-title headline info)
+ (org-export-toc-entry-backend 'html)
+ info))
+ (tags (and (eq (plist-get info :with-tags) t)
+ (org-export-get-tags headline info))))
+ (format "<a href=\"#%s\">%s</a>"
+ ;; Label.
+ (org-html--reference headline info)
+ ;; Body.
+ (concat
+ (and (not (org-export-low-level-p headline info))
+ (org-export-numbered-headline-p headline info)
+ (concat (mapconcat #'number-to-string headline-number ".")
+ ". "))
+ (apply (plist-get info :html-format-headline-function)
+ todo todo-type priority text tags :section-number nil)))))
+
+(defun org-html-list-of-listings (info)
+ "Build a list of listings.
+INFO is a plist used as a communication channel. Return the list
+of listings as a string, or nil if it is empty."
+ (let ((lol-entries (org-export-collect-listings info)))
+ (when lol-entries
+ (concat "<div id=\"list-of-listings\">\n"
+ (let ((top-level (plist-get info :html-toplevel-hlevel)))
+ (format "<h%d>%s</h%d>\n"
+ top-level
+ (org-html--translate "List of Listings" info)
+ top-level))
+ "<div id=\"text-list-of-listings\">\n<ul>\n"
+ (let ((count 0)
+ (initial-fmt (format "<span class=\"listing-number\">%s</span>"
+ (org-html--translate "Listing %d:" info))))
+ (mapconcat
+ (lambda (entry)
+ (let ((label (org-html--reference entry info t))
+ (title (org-trim
+ (org-export-data
+ (or (org-export-get-caption entry t)
+ (org-export-get-caption entry))
+ info))))
+ (concat
+ "<li>"
+ (if (not label)
+ (concat (format initial-fmt (cl-incf count))
+ " "
+ title)
+ (format "<a href=\"#%s\">%s %s</a>"
+ label
+ (format initial-fmt (cl-incf count))
+ title))
+ "</li>")))
+ lol-entries "\n"))
+ "\n</ul>\n</div>\n</div>"))))
+
+(defun org-html-list-of-tables (info)
+ "Build a list of tables.
+INFO is a plist used as a communication channel. Return the list
+of tables as a string, or nil if it is empty."
+ (let ((lol-entries (org-export-collect-tables info)))
+ (when lol-entries
+ (concat "<div id=\"list-of-tables\">\n"
+ (let ((top-level (plist-get info :html-toplevel-hlevel)))
+ (format "<h%d>%s</h%d>\n"
+ top-level
+ (org-html--translate "List of Tables" info)
+ top-level))
+ "<div id=\"text-list-of-tables\">\n<ul>\n"
+ (let ((count 0)
+ (initial-fmt (format "<span class=\"table-number\">%s</span>"
+ (org-html--translate "Table %d:" info))))
+ (mapconcat
+ (lambda (entry)
+ (let ((label (org-html--reference entry info t))
+ (title (org-trim
+ (org-export-data
+ (or (org-export-get-caption entry t)
+ (org-export-get-caption entry))
+ info))))
+ (concat
+ "<li>"
+ (if (not label)
+ (concat (format initial-fmt (cl-incf count))
+ " "
+ title)
+ (format "<a href=\"#%s\">%s %s</a>"
+ label
+ (format initial-fmt (cl-incf count))
+ title))
+ "</li>")))
+ lol-entries "\n"))
+ "\n</ul>\n</div>\n</div>"))))
+
+
+;;; Transcode Functions
+
+;;;; Bold
+
+(defun org-html-bold (_bold contents info)
+ "Transcode BOLD from Org to HTML.
+CONTENTS is the text with bold markup. INFO is a plist holding
+contextual information."
+ (format (or (cdr (assq 'bold (plist-get info :html-text-markup-alist))) "%s")
+ contents))
+
+;;;; Center Block
+
+(defun org-html-center-block (_center-block contents _info)
+ "Transcode a CENTER-BLOCK element from Org to HTML.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (format "<div class=\"org-center\">\n%s</div>" contents))
+
+;;;; Clock
+
+(defun org-html-clock (clock _contents _info)
+ "Transcode a CLOCK element from Org to HTML.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (format "<p>
+<span class=\"timestamp-wrapper\">
+<span class=\"timestamp-kwd\">%s</span> <span class=\"timestamp\">%s</span>%s
+</span>
+</p>"
+ org-clock-string
+ (org-timestamp-translate (org-element-property :value clock))
+ (let ((time (org-element-property :duration clock)))
+ (and time (format " <span class=\"timestamp\">(%s)</span>" time)))))
+
+;;;; Code
+
+(defun org-html-code (code _contents info)
+ "Transcode CODE from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (format (or (cdr (assq 'code (plist-get info :html-text-markup-alist))) "%s")
+ (org-html-encode-plain-text (org-element-property :value code))))
+
+;;;; Drawer
+
+(defun org-html-drawer (drawer contents info)
+ "Transcode a DRAWER element from Org to HTML.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (funcall (plist-get info :html-format-drawer-function)
+ (org-element-property :drawer-name drawer)
+ contents))
+
+;;;; Dynamic Block
+
+(defun org-html-dynamic-block (_dynamic-block contents _info)
+ "Transcode a DYNAMIC-BLOCK element from Org to HTML.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information. See `org-export-data'."
+ contents)
+
+;;;; Entity
+
+(defun org-html-entity (entity _contents _info)
+ "Transcode an ENTITY object from Org to HTML.
+CONTENTS are the definition itself. INFO is a plist holding
+contextual information."
+ (org-element-property :html entity))
+
+;;;; Example Block
+
+(defun org-html-example-block (example-block _contents info)
+ "Transcode a EXAMPLE-BLOCK element from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (let ((attributes (org-export-read-attribute :attr_html example-block)))
+ (if (plist-get attributes :textarea)
+ (org-html--textarea-block example-block)
+ (format "<pre class=\"example\"%s>\n%s</pre>"
+ (let* ((reference (org-html--reference example-block info))
+ (a (org-html--make-attribute-string
+ (if (or (not reference) (plist-member attributes :id))
+ attributes
+ (plist-put attributes :id reference)))))
+ (if (org-string-nw-p a) (concat " " a) ""))
+ (org-html-format-code example-block info)))))
+
+;;;; Export Snippet
+
+(defun org-html-export-snippet (export-snippet _contents _info)
+ "Transcode a EXPORT-SNIPPET object from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (when (eq (org-export-snippet-backend export-snippet) 'html)
+ (org-element-property :value export-snippet)))
+
+;;;; Export Block
+
+(defun org-html-export-block (export-block _contents _info)
+ "Transcode a EXPORT-BLOCK element from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (when (string= (org-element-property :type export-block) "HTML")
+ (org-remove-indentation (org-element-property :value export-block))))
+
+;;;; Fixed Width
+
+(defun org-html-fixed-width (fixed-width _contents _info)
+ "Transcode a FIXED-WIDTH element from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (format "<pre class=\"example\">\n%s</pre>"
+ (org-html-do-format-code
+ (org-remove-indentation
+ (org-element-property :value fixed-width)))))
+
+;;;; Footnote Reference
+
+(defun org-html-footnote-reference (footnote-reference _contents info)
+ "Transcode a FOOTNOTE-REFERENCE element from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (concat
+ ;; Insert separator between two footnotes in a row.
+ (let ((prev (org-export-get-previous-element footnote-reference info)))
+ (when (eq (org-element-type prev) 'footnote-reference)
+ (plist-get info :html-footnote-separator)))
+ (let* ((n (org-export-get-footnote-number footnote-reference info))
+ (id (format "fnr.%d%s"
+ n
+ (if (org-export-footnote-first-reference-p
+ footnote-reference info)
+ ""
+ ".100"))))
+ (format
+ (plist-get info :html-footnote-format)
+ (org-html--anchor
+ id n (format " class=\"footref\" href=\"#fn.%d\" role=\"doc-backlink\"" n) info)))))
+
+;;;; Headline
+
+(defun org-html-headline (headline contents info)
+ "Transcode a HEADLINE element from Org to HTML.
+CONTENTS holds the contents of the headline. INFO is a plist
+holding contextual information."
+ (unless (org-element-property :footnote-section-p headline)
+ (let* ((numberedp (org-export-numbered-headline-p headline info))
+ (numbers (org-export-get-headline-number headline info))
+ (level (+ (org-export-get-relative-level headline info)
+ (1- (plist-get info :html-toplevel-hlevel))))
+ (todo (and (plist-get info :with-todo-keywords)
+ (let ((todo (org-element-property :todo-keyword headline)))
+ (and todo (org-export-data todo info)))))
+ (todo-type (and todo (org-element-property :todo-type headline)))
+ (priority (and (plist-get info :with-priority)
+ (org-element-property :priority headline)))
+ (text (org-export-data (org-element-property :title headline) info))
+ (tags (and (plist-get info :with-tags)
+ (org-export-get-tags headline info)))
+ (full-text (funcall (plist-get info :html-format-headline-function)
+ todo todo-type priority text tags info))
+ (contents (or contents ""))
+ (id (org-html--reference headline info))
+ (formatted-text
+ (if (plist-get info :html-self-link-headlines)
+ (format "<a href=\"#%s\">%s</a>" id full-text)
+ full-text)))
+ (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")))
+ (concat
+ (and (org-export-first-sibling-p headline info)
+ (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 id nil nil info) formatted-text)) "\n"
+ (and (org-export-last-sibling-p headline info)
+ (format "</%s>\n" html-type))))
+ ;; Standard headline. Export it as a section.
+ (let ((extra-class
+ (org-element-property :HTML_CONTAINER_CLASS headline))
+ (headline-class
+ (org-element-property :HTML_HEADLINE_CLASS headline))
+ (first-content (car (org-element-contents headline))))
+ (format "<%s id=\"%s\" class=\"%s\">%s%s</%s>\n"
+ (org-html--container headline info)
+ (format "outline-container-%s" id)
+ (concat (format "outline-%d" level)
+ (and extra-class " ")
+ extra-class)
+ (format "\n<h%d id=\"%s\"%s>%s</h%d>\n"
+ level
+ id
+ (if (not headline-class) ""
+ (format " class=\"%s\"" headline-class))
+ (concat
+ (and numberedp
+ (format
+ "<span class=\"section-number-%d\">%s</span> "
+ level
+ (concat (mapconcat #'number-to-string numbers ".") ".")))
+ formatted-text)
+ level)
+ ;; When there is no section, pretend there is an
+ ;; empty one to get the correct <div
+ ;; class="outline-...> which is needed by
+ ;; `org-info.js'.
+ (if (eq (org-element-type first-content) 'section) contents
+ (concat (org-html-section first-content "" info) contents))
+ (org-html--container headline info)))))))
+
+(defun org-html-format-headline-default-function
+ (todo _todo-type priority text tags info)
+ "Default format function for a headline.
+See `org-html-format-headline-function' for details."
+ (let ((todo (org-html--todo todo info))
+ (priority (org-html--priority priority info))
+ (tags (org-html--tags tags info)))
+ (concat todo (and todo " ")
+ priority (and priority " ")
+ text
+ (and tags "&#xa0;&#xa0;&#xa0;") tags)))
+
+(defun org-html--container (headline info)
+ (or (org-element-property :HTML_CONTAINER headline)
+ (if (= 1 (org-export-get-relative-level headline info))
+ (plist-get info :html-container)
+ "div")))
+
+;;;; Horizontal Rule
+
+(defun org-html-horizontal-rule (_horizontal-rule _contents info)
+ "Transcode an HORIZONTAL-RULE object from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (org-html-close-tag "hr" nil info))
+
+;;;; Inline Src Block
+
+(defun org-html-inline-src-block (inline-src-block _contents info)
+ "Transcode an INLINE-SRC-BLOCK element from Org to HTML.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (let* ((lang (org-element-property :language inline-src-block))
+ (code (org-html-fontify-code
+ (org-element-property :value inline-src-block)
+ lang))
+ (label
+ (let ((lbl (org-html--reference inline-src-block info t)))
+ (if (not lbl) "" (format " id=\"%s\"" lbl)))))
+ (format "<code class=\"src src-%s\"%s>%s</code>" lang label code)))
+
+;;;; Inlinetask
+
+(defun org-html-inlinetask (inlinetask contents info)
+ "Transcode an INLINETASK element from Org to HTML.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (let* ((todo (and (plist-get info :with-todo-keywords)
+ (let ((todo (org-element-property :todo-keyword inlinetask)))
+ (and todo (org-export-data todo info)))))
+ (todo-type (and todo (org-element-property :todo-type inlinetask)))
+ (priority (and (plist-get info :with-priority)
+ (org-element-property :priority inlinetask)))
+ (text (org-export-data (org-element-property :title inlinetask) info))
+ (tags (and (plist-get info :with-tags)
+ (org-export-get-tags inlinetask info))))
+ (funcall (plist-get info :html-format-inlinetask-function)
+ todo todo-type priority text tags contents info)))
+
+(defun org-html-format-inlinetask-default-function
+ (todo todo-type priority text tags contents info)
+ "Default format function for inlinetasks.
+See `org-html-format-inlinetask-function' for details."
+ (format "<div class=\"inlinetask\">\n<b>%s</b>%s\n%s</div>"
+ (org-html-format-headline-default-function
+ todo todo-type priority text tags info)
+ (org-html-close-tag "br" nil info)
+ contents))
+
+;;;; Italic
+
+(defun org-html-italic (_italic contents info)
+ "Transcode ITALIC from Org to HTML.
+CONTENTS is the text with italic markup. INFO is a plist holding
+contextual information."
+ (format
+ (or (cdr (assq 'italic (plist-get info :html-text-markup-alist))) "%s")
+ contents))
+
+;;;; Item
+
+(defun org-html-checkbox (checkbox info)
+ "Format CHECKBOX into HTML.
+INFO is a plist holding contextual information. See
+`org-html-checkbox-type' for customization options."
+ (cdr (assq checkbox
+ (cdr (assq (plist-get info :html-checkbox-type)
+ org-html-checkbox-types)))))
+
+(defun org-html-format-list-item (contents type checkbox info
+ &optional term-counter-id
+ headline)
+ "Format a list item into HTML."
+ (let ((class (if checkbox
+ (format " class=\"%s\""
+ (symbol-name checkbox)) ""))
+ (checkbox (concat (org-html-checkbox checkbox info)
+ (and checkbox " ")))
+ (br (org-html-close-tag "br" nil info))
+ (extra-newline (if (and (org-string-nw-p contents) headline) "\n" "")))
+ (concat
+ (pcase type
+ (`ordered
+ (let* ((counter term-counter-id)
+ (extra (if counter (format " value=\"%s\"" counter) "")))
+ (concat
+ (format "<li%s%s>" class extra)
+ (when headline (concat headline br)))))
+ (`unordered
+ (let* ((id term-counter-id)
+ (extra (if id (format " id=\"%s\"" id) "")))
+ (concat
+ (format "<li%s%s>" class extra)
+ (when headline (concat headline br)))))
+ (`descriptive
+ (let* ((term term-counter-id))
+ (setq term (or term "(no term)"))
+ ;; Check-boxes in descriptive lists are associated to tag.
+ (concat (format "<dt%s>%s</dt>"
+ class (concat checkbox term))
+ "<dd>"))))
+ (unless (eq type 'descriptive) checkbox)
+ extra-newline
+ (and (org-string-nw-p contents) (org-trim contents))
+ extra-newline
+ (pcase type
+ (`ordered "</li>")
+ (`unordered "</li>")
+ (`descriptive "</dd>")))))
+
+(defun org-html-item (item contents info)
+ "Transcode an ITEM element from Org to HTML.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (let* ((plain-list (org-export-get-parent item))
+ (type (org-element-property :type plain-list))
+ (counter (org-element-property :counter item))
+ (checkbox (org-element-property :checkbox item))
+ (tag (let ((tag (org-element-property :tag item)))
+ (and tag (org-export-data tag info)))))
+ (org-html-format-list-item
+ contents type checkbox info (or tag counter))))
+
+;;;; Keyword
+
+(defun org-html-keyword (keyword _contents info)
+ "Transcode a KEYWORD element from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (let ((key (org-element-property :key keyword))
+ (value (org-element-property :value keyword)))
+ (cond
+ ((string= key "HTML") value)
+ ((string= key "TOC")
+ (let ((case-fold-search t))
+ (cond
+ ((string-match "\\<headlines\\>" value)
+ (let ((depth (and (string-match "\\<[0-9]+\\>" value)
+ (string-to-number (match-string 0 value))))
+ (scope
+ (cond
+ ((string-match ":target +\\(\".+?\"\\|\\S-+\\)" value) ;link
+ (org-export-resolve-link
+ (org-strip-quotes (match-string 1 value)) info))
+ ((string-match-p "\\<local\\>" value) keyword)))) ;local
+ (org-html-toc depth info scope)))
+ ((string= "listings" value) (org-html-list-of-listings info))
+ ((string= "tables" value) (org-html-list-of-tables info))))))))
+
+;;;; Latex Environment
+
+(defun org-html-format-latex (latex-frag processing-type info)
+ "Format a LaTeX fragment LATEX-FRAG into HTML.
+PROCESSING-TYPE designates the tool used for conversion. It can
+be `mathjax', `verbatim', `html', nil, t or symbols in
+`org-preview-latex-process-alist', e.g., `dvipng', `dvisvgm' or
+`imagemagick'. See `org-html-with-latex' for more information.
+INFO is a plist containing export properties."
+ (let ((cache-relpath "") (cache-dir ""))
+ (unless (or (eq processing-type 'mathjax)
+ (eq processing-type 'html))
+ (let ((bfn (or (buffer-file-name)
+ (make-temp-name
+ (expand-file-name "latex" temporary-file-directory))))
+ (latex-header
+ (let ((header (plist-get info :latex-header)))
+ (and header
+ (concat (mapconcat
+ (lambda (line) (concat "#+LATEX_HEADER: " line))
+ (org-split-string header "\n")
+ "\n")
+ "\n")))))
+ (setq cache-relpath
+ (concat (file-name-as-directory org-preview-latex-image-directory)
+ (file-name-sans-extension
+ (file-name-nondirectory bfn)))
+ cache-dir (file-name-directory bfn))
+ ;; Re-create LaTeX environment from original buffer in
+ ;; temporary buffer so that dvipng/imagemagick can properly
+ ;; turn the fragment into an image.
+ (setq latex-frag (concat latex-header latex-frag))))
+ (with-temp-buffer
+ (insert latex-frag)
+ (org-format-latex cache-relpath nil nil cache-dir nil
+ "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<div%s class=\"equation-container\">\n%s%s\n</div>"
+ ;; ID.
+ (if (org-string-nw-p label) (format " id=\"%s\"" label) "")
+ ;; Contents.
+ (format "<span class=\"equation\">\n%s\n</span>" contents)
+ ;; Caption.
+ (if (not (org-string-nw-p caption)) ""
+ (format "\n<span class=\"equation-label\">\n%s\n</span>"
+ 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--latex-environment-numbered-p (element)
+ "Non-nil when ELEMENT contains a numbered LaTeX math environment.
+Starred and \"displaymath\" environments are not numbered."
+ (not (string-match-p "\\`[ \t]*\\\\begin{\\(.*\\*\\|displaymath\\)}"
+ (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))
+ (label (org-html--reference latex-environment info t))
+ (caption (and (org-html--latex-environment-numbered-p latex-environment)
+ (number-to-string
+ (org-export-get-ordinal
+ latex-environment info nil
+ (lambda (l _)
+ (and (org-html--math-environment-p l)
+ (org-html--latex-environment-numbered-p l))))))))
+ (cond
+ ((memq processing-type '(t mathjax))
+ (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
+ (org-html--unlabel-latex-environment latex-frag)
+ processing-type info)))
+ (when (and formula-link (string-match "file:\\([^]]*\\)" formula-link))
+ (let ((source (org-export-file-uri (match-string 1 formula-link))))
+ (org-html--wrap-latex-environment
+ (org-html--format-image source attributes info)
+ info caption label)))))
+ (t (org-html--wrap-latex-environment latex-frag info caption label)))))
+
+;;;; Latex Fragment
+
+(defun org-html-latex-fragment (latex-fragment _contents info)
+ "Transcode a LATEX-FRAGMENT object from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (let ((latex-frag (org-element-property :value latex-fragment))
+ (processing-type (plist-get info :with-latex)))
+ (cond
+ ((memq processing-type '(t mathjax))
+ (org-html-format-latex latex-frag 'mathjax info))
+ ((memq processing-type '(t html))
+ (org-html-format-latex latex-frag 'html 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))
+ (let ((source (org-export-file-uri (match-string 1 formula-link))))
+ (org-html--format-image source nil info)))))
+ (t latex-frag))))
+
+;;;; Line Break
+
+(defun org-html-line-break (_line-break _contents info)
+ "Transcode a LINE-BREAK object from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (concat (org-html-close-tag "br" nil info) "\n"))
+
+;;;; Link
+
+(defun org-html-image-link-filter (data _backend info)
+ (org-export-insert-image-links data info org-html-inline-image-rules))
+
+(defun org-html-inline-image-p (link info)
+ "Non-nil when LINK is meant to appear as an image.
+INFO is a plist used as a communication channel. LINK is an
+inline image when it has no description and targets an image
+file (see `org-html-inline-image-rules' for more information), or
+if its description is a single link targeting an image file."
+ (if (not (org-element-contents link))
+ (org-export-inline-image-p
+ link (plist-get info :html-inline-image-rules))
+ (not
+ (let ((link-count 0))
+ (org-element-map (org-element-contents link)
+ (cons 'plain-text org-element-all-objects)
+ (lambda (obj)
+ (pcase (org-element-type obj)
+ (`plain-text (org-string-nw-p obj))
+ (`link (if (= link-count 1) t
+ (cl-incf link-count)
+ (not (org-export-inline-image-p
+ obj (plist-get info :html-inline-image-rules)))))
+ (_ t)))
+ info t)))))
+
+(defvar org-html-standalone-image-predicate)
+(defun org-html-standalone-image-p (element info)
+ "Non-nil if ELEMENT is a standalone image.
+
+INFO is a plist holding contextual information.
+
+An element or object is a standalone image when
+
+ - its type is `paragraph' and its sole content, save for white
+ spaces, is a link that qualifies as an inline image;
+
+ - its type is `link' and its containing paragraph has no other
+ content save white spaces.
+
+Bind `org-html-standalone-image-predicate' to constrain paragraph
+further. For example, to check for only captioned standalone
+images, set it to:
+
+ (lambda (paragraph) (org-element-property :caption paragraph))"
+ (let ((paragraph (pcase (org-element-type element)
+ (`paragraph element)
+ (`link (org-export-get-parent element)))))
+ (and (eq (org-element-type paragraph) 'paragraph)
+ (or (not (and (boundp 'org-html-standalone-image-predicate)
+ (fboundp org-html-standalone-image-predicate)))
+ (funcall org-html-standalone-image-predicate paragraph))
+ (catch 'exit
+ (let ((link-count 0))
+ (org-element-map (org-element-contents paragraph)
+ (cons 'plain-text org-element-all-objects)
+ (lambda (obj)
+ (when (pcase (org-element-type obj)
+ (`plain-text (org-string-nw-p obj))
+ (`link (or (> (cl-incf link-count) 1)
+ (not (org-html-inline-image-p obj info))))
+ (_ t))
+ (throw 'exit nil)))
+ info nil 'link)
+ (= link-count 1))))))
+
+(defun org-html-link (link desc info)
+ "Transcode a LINK object from Org to HTML.
+DESC is the description part of the link, or the empty string.
+INFO is a plist holding contextual information. See
+`org-export-data'."
+ (let* ((html-ext (plist-get info :html-extension))
+ (dot (when (> (length html-ext) 0) "."))
+ (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'.
+ (cond
+ ((and (plist-get info :html-link-org-files-as-html)
+ (string= ".org"
+ (downcase (file-name-extension raw-path "."))))
+ (concat (file-name-sans-extension raw-path) dot html-ext))
+ (t raw-path))))
+ (type (org-element-property :type link))
+ (raw-path (org-element-property :path link))
+ ;; Ensure DESC really exists, or set it to nil.
+ (desc (org-string-nw-p desc))
+ (path
+ (cond
+ ((member type '("http" "https" "ftp" "mailto" "news"))
+ (url-encode-url (concat type ":" raw-path)))
+ ((string= "file" type)
+ ;; 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
+ (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)))
+ (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)))
+ (attributes-plist
+ (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) ""))))
+ (cond
+ ;; Link type is handled by a special function.
+ ((org-export-custom-protocol-maybe link desc 'html info))
+ ;; Image file.
+ ((and (plist-get info :html-inline-images)
+ (org-export-inline-image-p
+ link (plist-get info :html-inline-image-rules)))
+ (org-html--format-image path attributes-plist info))
+ ;; Radio target: Transcode target's contents and use them as
+ ;; link's description.
+ ((string= type "radio")
+ (let ((destination (org-export-resolve-radio-link link info)))
+ (if (not destination) desc
+ (format "<a href=\"#%s\"%s>%s</a>"
+ (org-export-get-reference destination info)
+ attributes
+ desc))))
+ ;; Links pointing to a headline: Find destination and build
+ ;; appropriate referencing command.
+ ((member type '("custom-id" "fuzzy" "id"))
+ (let ((destination (if (string= type "fuzzy")
+ (org-export-resolve-fuzzy-link link info)
+ (org-export-resolve-id-link link info))))
+ (pcase (org-element-type destination)
+ ;; ID link points to an external file.
+ (`plain-text
+ (let ((fragment (concat "ID-" path))
+ ;; Treat links to ".org" files as ".html", if needed.
+ (path (funcall link-org-files-as-html-maybe
+ destination info)))
+ (format "<a href=\"%s#%s\"%s>%s</a>"
+ path fragment attributes (or desc destination))))
+ ;; Fuzzy link points nowhere.
+ (`nil
+ (format "<i>%s</i>"
+ (or desc
+ (org-export-data
+ (org-element-property :raw-link link) info))))
+ ;; Link points to a headline.
+ (`headline
+ (let ((href (org-html--reference destination info))
+ ;; What description to use?
+ (desc
+ ;; Case 1: Headline is numbered and LINK has no
+ ;; description. Display section number.
+ (if (and (org-export-numbered-headline-p destination info)
+ (not desc))
+ (mapconcat #'number-to-string
+ (org-export-get-headline-number
+ destination info) ".")
+ ;; Case 2: Either the headline is un-numbered or
+ ;; LINK has a custom description. Display LINK's
+ ;; description or headline's title.
+ (or desc
+ (org-export-data
+ (org-element-property :title destination) info)))))
+ (format "<a href=\"#%s\"%s>%s</a>" href attributes desc)))
+ ;; Fuzzy link points to a target or an element.
+ (_
+ (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 "ref" or "eqref" macro, depending on user
+ ;; preference to refer to those in the document.
+ (format (plist-get info :html-equation-reference-format)
+ (org-html--reference destination info))
+ (let* ((ref (org-html--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 "<a href=\"#%s\"%s>%s</a>" ref attributes desc)))))))
+ ;; Coderef: replace link with the reference name or the
+ ;; equivalent line number.
+ ((string= type "coderef")
+ (let ((fragment (concat "coderef-" (org-html-encode-plain-text path))))
+ (format "<a href=\"#%s\" %s%s>%s</a>"
+ fragment
+ (format "class=\"coderef\" onmouseover=\"CodeHighlightOn(this, \
+'%s');\" onmouseout=\"CodeHighlightOff(this, '%s');\""
+ fragment fragment)
+ attributes
+ (format (org-export-get-coderef-format path desc)
+ (org-export-resolve-coderef path info)))))
+ ;; External link with a description part.
+ ((and path desc)
+ (format "<a href=\"%s\"%s>%s</a>"
+ (org-html-encode-plain-text path)
+ attributes
+ desc))
+ ;; External link without a description part.
+ (path
+ (let ((path (org-html-encode-plain-text path)))
+ (format "<a href=\"%s\"%s>%s</a>" path attributes path)))
+ ;; No path, only description. Try to do something useful.
+ (t
+ (format "<i>%s</i>" desc)))))
+
+;;;; Node Property
+
+(defun org-html-node-property (node-property _contents _info)
+ "Transcode a NODE-PROPERTY element from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (format "%s:%s"
+ (org-element-property :key node-property)
+ (let ((value (org-element-property :value node-property)))
+ (if value (concat " " value) ""))))
+
+;;;; Paragraph
+
+(defun org-html-paragraph (paragraph contents info)
+ "Transcode a PARAGRAPH element from Org to HTML.
+CONTENTS is the contents of the paragraph, as a string. INFO is
+the plist used as a communication channel."
+ (let* ((parent (org-export-get-parent paragraph))
+ (parent-type (org-element-type parent))
+ (style '((footnote-definition " class=\"footpara\"")
+ (org-data " class=\"footpara\"")))
+ (attributes (org-html--make-attribute-string
+ (org-export-read-attribute :attr_html paragraph)))
+ (extra (or (cadr (assq parent-type style)) "")))
+ (cond
+ ((and (eq parent-type 'item)
+ (not (org-export-get-previous-element paragraph info))
+ (let ((followers (org-export-get-next-element paragraph info 2)))
+ (and (not (cdr followers))
+ (memq (org-element-type (car followers)) '(nil plain-list)))))
+ ;; First paragraph in an item has no tag if it is alone or
+ ;; followed, at most, by a sub-list.
+ contents)
+ ((org-html-standalone-image-p paragraph info)
+ ;; Standalone image.
+ (let ((caption
+ (let ((raw (org-export-data
+ (org-export-get-caption paragraph) info))
+ (org-html-standalone-image-predicate
+ #'org-html--has-caption-p))
+ (if (not (org-string-nw-p raw)) raw
+ (concat "<span class=\"figure-number\">"
+ (format (org-html--translate "Figure %d:" info)
+ (org-export-get-ordinal
+ (org-element-map paragraph 'link
+ #'identity info t)
+ info nil #'org-html-standalone-image-p))
+ " </span>"
+ raw))))
+ (label (org-html--reference paragraph info)))
+ (org-html--wrap-image contents info caption label)))
+ ;; Regular paragraph.
+ (t (format "<p%s%s>\n%s</p>"
+ (if (org-string-nw-p attributes)
+ (concat " " attributes) "")
+ extra contents)))))
+
+;;;; Plain List
+
+(defun org-html-plain-list (plain-list contents _info)
+ "Transcode a PLAIN-LIST element from Org to HTML.
+CONTENTS is the contents of the list. INFO is a plist holding
+contextual information."
+ (let* ((type (pcase (org-element-property :type plain-list)
+ (`ordered "ol")
+ (`unordered "ul")
+ (`descriptive "dl")
+ (other (error "Unknown HTML list type: %s" other))))
+ (class (format "org-%s" type))
+ (attributes (org-export-read-attribute :attr_html plain-list)))
+ (format "<%s %s>\n%s</%s>"
+ type
+ (org-html--make-attribute-string
+ (plist-put attributes :class
+ (org-trim
+ (mapconcat #'identity
+ (list class (plist-get attributes :class))
+ " "))))
+ contents
+ type)))
+
+;;;; Plain Text
+
+(defun org-html-convert-special-strings (string)
+ "Convert special characters in STRING to HTML."
+ (dolist (a org-html-special-string-regexps string)
+ (let ((re (car a))
+ (rpl (cdr a)))
+ (setq string (replace-regexp-in-string re rpl string t)))))
+
+(defun org-html-encode-plain-text (text)
+ "Convert plain text characters from TEXT to HTML equivalent.
+Possible conversions are set in `org-html-protect-char-alist'."
+ (dolist (pair org-html-protect-char-alist text)
+ (setq text (replace-regexp-in-string (car pair) (cdr pair) text t t))))
+
+(defun org-html-plain-text (text info)
+ "Transcode a TEXT string from Org to HTML.
+TEXT is the string to transcode. INFO is a plist holding
+contextual information."
+ (let ((output text))
+ ;; Protect following characters: <, >, &.
+ (setq output (org-html-encode-plain-text output))
+ ;; Handle smart quotes. Be sure to provide original string since
+ ;; OUTPUT may have been modified.
+ (when (plist-get info :with-smart-quotes)
+ (setq output (org-export-activate-smart-quotes output :html info text)))
+ ;; Handle special strings.
+ (when (plist-get info :with-special-strings)
+ (setq output (org-html-convert-special-strings output)))
+ ;; Handle break preservation if required.
+ (when (plist-get info :preserve-breaks)
+ (setq output
+ (replace-regexp-in-string
+ "\\(\\\\\\\\\\)?[ \t]*\n"
+ (concat (org-html-close-tag "br" nil info) "\n") output)))
+ ;; Return value.
+ output))
+
+
+;; Planning
+
+(defun org-html-planning (planning _contents info)
+ "Transcode a PLANNING element from Org to HTML.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (format
+ "<p><span class=\"timestamp-wrapper\">%s</span></p>"
+ (org-trim
+ (mapconcat
+ (lambda (pair)
+ (let ((timestamp (cdr pair)))
+ (when timestamp
+ (let ((string (car pair)))
+ (format "<span class=\"timestamp-kwd\">%s</span> \
+<span class=\"timestamp\">%s</span> "
+ string
+ (org-html-plain-text (org-timestamp-translate timestamp)
+ info))))))
+ `((,org-closed-string . ,(org-element-property :closed planning))
+ (,org-deadline-string . ,(org-element-property :deadline planning))
+ (,org-scheduled-string . ,(org-element-property :scheduled planning)))
+ ""))))
+
+;;;; Property Drawer
+
+(defun org-html-property-drawer (_property-drawer contents _info)
+ "Transcode a PROPERTY-DRAWER element from Org to HTML.
+CONTENTS holds the contents of the drawer. INFO is a plist
+holding contextual information."
+ (and (org-string-nw-p contents)
+ (format "<pre class=\"example\">\n%s</pre>" contents)))
+
+;;;; Quote Block
+
+(defun org-html-quote-block (quote-block contents info)
+ "Transcode a QUOTE-BLOCK element from Org to HTML.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (format "<blockquote%s>\n%s</blockquote>"
+ (let* ((reference (org-html--reference quote-block info t))
+ (attributes (org-export-read-attribute :attr_html quote-block))
+ (a (org-html--make-attribute-string
+ (if (or (not reference) (plist-member attributes :id))
+ attributes
+ (plist-put attributes :id reference)))))
+ (if (org-string-nw-p a) (concat " " a) ""))
+ contents))
+
+;;;; Section
+
+(defun org-html-section (section contents info)
+ "Transcode a SECTION element from Org to HTML.
+CONTENTS holds the contents of the section. INFO is a plist
+holding contextual information."
+ (let ((parent (org-export-get-parent-headline section)))
+ ;; Before first headline: no container, just return CONTENTS.
+ (if (not parent) contents
+ ;; Get div's class and id references.
+ (let* ((class-num (+ (org-export-get-relative-level parent info)
+ (1- (plist-get info :html-toplevel-hlevel))))
+ (section-number
+ (and (org-export-numbered-headline-p parent info)
+ (mapconcat
+ #'number-to-string
+ (org-export-get-headline-number parent info) "-"))))
+ ;; Build return value.
+ (format "<div class=\"outline-text-%d\" id=\"text-%s\">\n%s</div>\n"
+ class-num
+ (or (org-element-property :CUSTOM_ID parent)
+ section-number
+ (org-export-get-reference parent info))
+ (or contents ""))))))
+
+;;;; Radio Target
+
+(defun org-html-radio-target (radio-target text info)
+ "Transcode a RADIO-TARGET object from Org to HTML.
+TEXT is the text of the target. INFO is a plist holding
+contextual information."
+ (let ((ref (org-html--reference radio-target info)))
+ (org-html--anchor ref text nil info)))
+
+;;;; Special Block
+
+(defun org-html-special-block (special-block contents info)
+ "Transcode a SPECIAL-BLOCK element from Org to HTML.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (let* ((block-type (org-element-property :type special-block))
+ (html5-fancy (and (org-html--html5-fancy-p info)
+ (member block-type org-html-html5-elements)))
+ (attributes (org-export-read-attribute :attr_html special-block)))
+ (unless html5-fancy
+ (let ((class (plist-get attributes :class)))
+ (setq attributes (plist-put attributes :class
+ (if class (concat class " " block-type)
+ block-type)))))
+ (let* ((contents (or contents ""))
+ (reference (org-html--reference special-block info))
+ (a (org-html--make-attribute-string
+ (if (or (not reference) (plist-member attributes :id))
+ attributes
+ (plist-put attributes :id reference))))
+ (str (if (org-string-nw-p a) (concat " " a) "")))
+ (if html5-fancy
+ (format "<%s%s>\n%s</%s>" block-type str contents block-type)
+ (format "<div%s>\n%s\n</div>" str contents)))))
+
+;;;; Src Block
+
+(defun org-html-src-block (src-block _contents info)
+ "Transcode a SRC-BLOCK element from Org to HTML.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (if (org-export-read-attribute :attr_html src-block :textarea)
+ (org-html--textarea-block src-block)
+ (let* ((lang (org-element-property :language src-block))
+ (code (org-html-format-code src-block info))
+ (label (let ((lbl (org-html--reference src-block info t)))
+ (if lbl (format " id=\"%s\"" lbl) "")))
+ (klipsify (and (plist-get info :html-klipsify-src)
+ (member lang '("javascript" "js"
+ "ruby" "scheme" "clojure" "php" "html")))))
+ (if (not lang) (format "<pre class=\"example\"%s>\n%s</pre>" label code)
+ (format "<div class=\"org-src-container\">\n%s%s\n</div>"
+ ;; Build caption.
+ (let ((caption (org-export-get-caption src-block)))
+ (if (not caption) ""
+ (let ((listing-number
+ (format
+ "<span class=\"listing-number\">%s </span>"
+ (format
+ (org-html--translate "Listing %d:" info)
+ (org-export-get-ordinal
+ src-block info nil #'org-html--has-caption-p)))))
+ (format "<label class=\"org-src-name\">%s%s</label>"
+ listing-number
+ (org-trim (org-export-data caption info))))))
+ ;; Contents.
+ (if klipsify
+ (format "<pre><code class=\"src src-%s\"%s%s>%s</code></pre>"
+ lang
+ label
+ (if (string= lang "html")
+ " data-editor-type=\"html\""
+ "")
+ code)
+ (format "<pre class=\"src src-%s\"%s>%s</pre>"
+ lang label code)))))))
+
+;;;; Statistics Cookie
+
+(defun org-html-statistics-cookie (statistics-cookie _contents _info)
+ "Transcode a STATISTICS-COOKIE object from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (let ((cookie-value (org-element-property :value statistics-cookie)))
+ (format "<code>%s</code>" cookie-value)))
+
+;;;; Strike-Through
+
+(defun org-html-strike-through (_strike-through contents info)
+ "Transcode STRIKE-THROUGH from Org to HTML.
+CONTENTS is the text with strike-through markup. INFO is a plist
+holding contextual information."
+ (format
+ (or (cdr (assq 'strike-through (plist-get info :html-text-markup-alist)))
+ "%s")
+ contents))
+
+;;;; Subscript
+
+(defun org-html-subscript (_subscript contents _info)
+ "Transcode a SUBSCRIPT object from Org to HTML.
+CONTENTS is the contents of the object. INFO is a plist holding
+contextual information."
+ (format "<sub>%s</sub>" contents))
+
+;;;; Superscript
+
+(defun org-html-superscript (_superscript contents _info)
+ "Transcode a SUPERSCRIPT object from Org to HTML.
+CONTENTS is the contents of the object. INFO is a plist holding
+contextual information."
+ (format "<sup>%s</sup>" contents))
+
+;;;; Table Cell
+
+(defun org-html-table-cell (table-cell contents info)
+ "Transcode a TABLE-CELL element from Org to HTML.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (let* ((table-row (org-export-get-parent table-cell))
+ (table (org-export-get-parent-table table-cell))
+ (cell-attrs
+ (if (not (plist-get info :html-table-align-individual-fields)) ""
+ (format (if (and (boundp 'org-html-format-table-no-css)
+ org-html-format-table-no-css)
+ " align=\"%s\"" " class=\"org-%s\"")
+ (org-export-table-cell-alignment table-cell info)))))
+ (when (or (not contents) (string= "" (org-trim contents)))
+ (setq contents "&#xa0;"))
+ (cond
+ ((and (org-export-table-has-header-p table info)
+ (= 1 (org-export-table-row-group table-row info)))
+ (let ((header-tags (plist-get info :html-table-header-tags)))
+ (concat "\n" (format (car header-tags) "col" cell-attrs)
+ contents
+ (cdr header-tags))))
+ ((and (plist-get info :html-table-use-header-tags-for-first-column)
+ (zerop (cdr (org-export-table-cell-address table-cell info))))
+ (let ((header-tags (plist-get info :html-table-header-tags)))
+ (concat "\n" (format (car header-tags) "row" cell-attrs)
+ contents
+ (cdr header-tags))))
+ (t (let ((data-tags (plist-get info :html-table-data-tags)))
+ (concat "\n" (format (car data-tags) cell-attrs)
+ contents
+ (cdr data-tags)))))))
+
+;;;; Table Row
+
+(defun org-html-table-row (table-row contents info)
+ "Transcode a TABLE-ROW element from Org to HTML.
+CONTENTS is the contents of the row. INFO is a plist used as a
+communication channel."
+ ;; Rules are ignored since table separators are deduced from
+ ;; borders of the current row.
+ (when (eq (org-element-property :type table-row) 'standard)
+ (let* ((group (org-export-table-row-group table-row info))
+ (number (org-export-table-row-number table-row info))
+ (start-group-p
+ (org-export-table-row-starts-rowgroup-p table-row info))
+ (end-group-p
+ (org-export-table-row-ends-rowgroup-p table-row info))
+ (topp (and (equal start-group-p '(top))
+ (equal end-group-p '(below top))))
+ (bottomp (and (equal start-group-p '(above))
+ (equal end-group-p '(bottom above))))
+ (row-open-tag
+ (pcase (plist-get info :html-table-row-open-tag)
+ ((and accessor (pred functionp))
+ (funcall accessor
+ number group start-group-p end-group-p topp bottomp))
+ (accessor accessor)))
+ (row-close-tag
+ (pcase (plist-get info :html-table-row-close-tag)
+ ((and accessor (pred functionp))
+ (funcall accessor
+ number group start-group-p end-group-p topp bottomp))
+ (accessor accessor)))
+ (group-tags
+ (cond
+ ;; Row belongs to second or subsequent groups.
+ ((not (= 1 group)) '("<tbody>" . "\n</tbody>"))
+ ;; Row is from first group. Table has >=1 groups.
+ ((org-export-table-has-header-p
+ (org-export-get-parent-table table-row) info)
+ '("<thead>" . "\n</thead>"))
+ ;; Row is from first and only group.
+ (t '("<tbody>" . "\n</tbody>")))))
+ (concat (and start-group-p (car group-tags))
+ (concat "\n"
+ row-open-tag
+ contents
+ "\n"
+ row-close-tag)
+ (and end-group-p (cdr group-tags))))))
+
+;;;; Table
+
+(defun org-html-table-first-row-data-cells (table info)
+ "Transcode the first row of TABLE.
+INFO is a plist used as a communication channel."
+ (let ((table-row
+ (org-element-map table 'table-row
+ (lambda (row)
+ (unless (eq (org-element-property :type row) 'rule) row))
+ info 'first-match))
+ (special-column-p (org-export-table-has-special-column-p table)))
+ (if (not special-column-p) (org-element-contents table-row)
+ (cdr (org-element-contents table-row)))))
+
+(defun org-html-table--table.el-table (table _info)
+ "Format table.el tables into HTML.
+INFO is a plist used as a communication channel."
+ (when (eq (org-element-property :type table) 'table.el)
+ (require 'table)
+ (let ((outbuf (with-current-buffer
+ (get-buffer-create "*org-export-table*")
+ (erase-buffer) (current-buffer))))
+ (with-temp-buffer
+ (insert (org-element-property :value table))
+ (goto-char 1)
+ (re-search-forward "^[ \t]*|[^|]" nil t)
+ (table-generate-source 'html outbuf))
+ (with-current-buffer outbuf
+ (prog1 (org-trim (buffer-string))
+ (kill-buffer) )))))
+
+(defun org-html-table (table contents info)
+ "Transcode a TABLE element from Org to HTML.
+CONTENTS is the contents of the table. INFO is a plist holding
+contextual information."
+ (if (eq (org-element-property :type table) 'table.el)
+ ;; "table.el" table. Convert it using appropriate tools.
+ (org-html-table--table.el-table table info)
+ ;; Standard table.
+ (let* ((caption (org-export-get-caption table))
+ (number (org-export-get-ordinal
+ table info nil #'org-html--has-caption-p))
+ (attributes
+ (org-html--make-attribute-string
+ (org-combine-plists
+ (list :id (org-html--reference table info t))
+ (and (not (org-html-html5-p info))
+ (plist-get info :html-table-attributes))
+ (org-export-read-attribute :attr_html table))))
+ (alignspec
+ (if (bound-and-true-p org-html-format-table-no-css)
+ "align=\"%s\""
+ "class=\"org-%s\""))
+ (table-column-specs
+ (lambda (table info)
+ (mapconcat
+ (lambda (table-cell)
+ (let ((alignment (org-export-table-cell-alignment
+ table-cell info)))
+ (concat
+ ;; Begin a colgroup?
+ (when (org-export-table-cell-starts-colgroup-p
+ table-cell info)
+ "\n<colgroup>")
+ ;; Add a column. Also specify its alignment.
+ (format "\n%s"
+ (org-html-close-tag
+ "col" (concat " " (format alignspec alignment)) info))
+ ;; End a colgroup?
+ (when (org-export-table-cell-ends-colgroup-p
+ table-cell info)
+ "\n</colgroup>"))))
+ (org-html-table-first-row-data-cells table info) "\n"))))
+ (format "<table%s>\n%s\n%s\n%s</table>"
+ (if (equal attributes "") "" (concat " " attributes))
+ (if (not caption) ""
+ (format (if (plist-get info :html-table-caption-above)
+ "<caption class=\"t-above\">%s</caption>"
+ "<caption class=\"t-bottom\">%s</caption>")
+ (concat
+ "<span class=\"table-number\">"
+ (format (org-html--translate "Table %d:" info) number)
+ "</span> " (org-export-data caption info))))
+ (funcall table-column-specs table info)
+ contents))))
+
+;;;; Target
+
+(defun org-html-target (target _contents info)
+ "Transcode a TARGET object from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (let ((ref (org-html--reference target info)))
+ (org-html--anchor ref nil nil info)))
+
+;;;; Timestamp
+
+(defun org-html-timestamp (timestamp _contents info)
+ "Transcode a TIMESTAMP object from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (let ((value (org-html-plain-text (org-timestamp-translate timestamp) info)))
+ (format "<span class=\"timestamp-wrapper\"><span class=\"timestamp\">%s</span></span>"
+ (replace-regexp-in-string "--" "&#x2013;" value))))
+
+;;;; Underline
+
+(defun org-html-underline (_underline contents info)
+ "Transcode UNDERLINE from Org to HTML.
+CONTENTS is the text with underline markup. INFO is a plist
+holding contextual information."
+ (format (or (cdr (assq 'underline (plist-get info :html-text-markup-alist)))
+ "%s")
+ contents))
+
+;;;; Verbatim
+
+(defun org-html-verbatim (verbatim _contents info)
+ "Transcode VERBATIM from Org to HTML.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (format (or (cdr (assq 'verbatim (plist-get info :html-text-markup-alist))) "%s")
+ (org-html-encode-plain-text (org-element-property :value verbatim))))
+
+;;;; Verse Block
+
+(defun org-html-verse-block (_verse-block contents info)
+ "Transcode a VERSE-BLOCK element from Org to HTML.
+CONTENTS is verse block contents. INFO is a plist holding
+contextual information."
+ (format "<p class=\"verse\">\n%s</p>"
+ ;; Replace leading white spaces with non-breaking spaces.
+ (replace-regexp-in-string
+ "^[ \t]+" (lambda (m) (org-html--make-string (length m) "&#xa0;"))
+ ;; Replace each newline character with line break. Also
+ ;; remove any trailing "br" close-tag so as to avoid
+ ;; duplicates.
+ (let* ((br (org-html-close-tag "br" nil info))
+ (re (format "\\(?:%s\\)?[ \t]*\n" (regexp-quote br))))
+ (replace-regexp-in-string re (concat br "\n") contents)))))
+
+
+;;; Filter Functions
+
+(defun org-html-final-function (contents _backend info)
+ "Filter to indent the HTML and convert HTML entities."
+ (with-temp-buffer
+ (insert contents)
+ (set-auto-mode t)
+ (when (plist-get info :html-indent)
+ (indent-region (point-min) (point-max)))
+ (buffer-substring-no-properties (point-min) (point-max))))
+
+
+;;; End-user functions
+
+;;;###autoload
+(defun org-html-export-as-html
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer to an HTML buffer.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"<body>\" and \"</body>\" tags.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Export is done in a buffer named \"*Org HTML Export*\", which
+will be displayed when `org-export-show-temporary-export-buffer'
+is non-nil."
+ (interactive)
+ (org-export-to-buffer 'html "*Org HTML Export*"
+ async subtreep visible-only body-only ext-plist
+ (lambda () (set-auto-mode t))))
+
+;;;###autoload
+(defun org-html-convert-region-to-html ()
+ "Assume the current region has Org syntax, and convert it to HTML.
+This can be used in any buffer. For example, you can write an
+itemized list in Org syntax in an HTML buffer and use this command
+to convert it."
+ (interactive)
+ (org-export-replace-region-by 'html))
+
+;;;###autoload
+(defun org-html-export-to-html
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer to a HTML file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"<body>\" and \"</body>\" tags.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return output file's name."
+ (interactive)
+ (let* ((extension (concat
+ (when (> (length org-html-extension) 0) ".")
+ (or (plist-get ext-plist :html-extension)
+ org-html-extension
+ "html")))
+ (file (org-export-output-file-name extension subtreep))
+ (org-export-coding-system org-html-coding-system))
+ (org-export-to-file 'html file
+ async subtreep visible-only body-only ext-plist)))
+
+;;;###autoload
+(defun org-html-publish-to-html (plist filename pub-dir)
+ "Publish an org file to HTML.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name."
+ (org-publish-org-to 'html filename
+ (concat (when (> (length org-html-extension) 0) ".")
+ (or (plist-get plist :html-extension)
+ org-html-extension
+ "html"))
+ plist pub-dir))
+
+
+(provide 'ox-html)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ox-html.el ends here
diff --git a/elpa/org-9.5.2/ox-html.elc b/elpa/org-9.5.2/ox-html.elc
new file mode 100644
index 0000000..a081038
--- /dev/null
+++ b/elpa/org-9.5.2/ox-html.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ox-icalendar.el b/elpa/org-9.5.2/ox-icalendar.el
new file mode 100644
index 0000000..16c3dc9
--- /dev/null
+++ b/elpa/org-9.5.2/ox-icalendar.el
@@ -0,0 +1,1031 @@
+;;; ox-icalendar.el --- iCalendar Back-End for Org Export Engine -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
+;; Nicolas Goaziou <n dot goaziou at gmail dot com>
+;; Maintainer: Nicolas Goaziou <n.goaziou at gmail dot com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; This library implements an iCalendar back-end for Org generic
+;; exporter. See Org manual for more information.
+;;
+;; It is expected to conform to RFC 5545.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'org-agenda)
+(require 'ox-ascii)
+(declare-function org-bbdb-anniv-export-ical "ol-bbdb" nil)
+
+
+
+;;; User-Configurable Variables
+
+(defgroup org-export-icalendar nil
+ "Options specific for iCalendar export back-end."
+ :tag "Org Export iCalendar"
+ :group 'org-export)
+
+(defcustom org-icalendar-combined-agenda-file "~/org.ics"
+ "The file name for the iCalendar file covering all agenda files.
+This file is created with the command `\\[org-icalendar-combine-agenda-files]'.
+The file name should be absolute. It will be overwritten without warning."
+ :group 'org-export-icalendar
+ :type 'file)
+
+(defcustom org-icalendar-alarm-time 0
+ "Number of minutes for triggering an alarm for exported timed events.
+
+A zero value (the default) turns off the definition of an alarm trigger
+for timed events. If non-zero, alarms are created.
+
+- a single alarm per entry is defined
+- The alarm will go off N minutes before the event
+- only a DISPLAY action is defined."
+ :group 'org-export-icalendar
+ :version "24.1"
+ :type 'integer)
+
+(defcustom org-icalendar-combined-name "OrgMode"
+ "Calendar name for the combined iCalendar representing all agenda files."
+ :group 'org-export-icalendar
+ :type 'string)
+
+(defcustom org-icalendar-combined-description ""
+ "Calendar description for the combined iCalendar (all agenda files)."
+ :group 'org-export-icalendar
+ :type 'string)
+
+(defcustom org-icalendar-exclude-tags nil
+ "Tags that exclude a tree from export.
+This variable allows specifying different exclude tags from other
+back-ends. It can also be set with the ICALENDAR_EXCLUDE_TAGS
+keyword."
+ :group 'org-export-icalendar
+ :type '(repeat (string :tag "Tag")))
+
+(defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due)
+ "Contexts where iCalendar export should use a deadline time stamp.
+
+This is a list with possibly several symbols in it. Valid symbols are:
+
+`event-if-todo'
+
+ Deadlines in TODO entries become calendar events.
+
+`event-if-todo-not-done'
+
+ Deadlines in TODO entries with not-DONE state become events.
+
+`event-if-not-todo'
+
+ Deadlines in non-TODO entries become calendar events.
+
+`todo-due'
+
+ Use deadlines in TODO entries as due-dates."
+ :group 'org-export-icalendar
+ :type
+ '(set :greedy t
+ (const :tag "DEADLINE in non-TODO entries become events"
+ event-if-not-todo)
+ (const :tag "DEADLINE in TODO entries become events"
+ event-if-todo)
+ (const :tag "DEADLINE in TODO entries with not-DONE state become events"
+ event-if-todo-not-done)
+ (const :tag "DEADLINE in TODO entries become due-dates"
+ todo-due)))
+
+(defcustom org-icalendar-use-scheduled '(todo-start)
+ "Contexts where iCalendar export should use a scheduling time stamp.
+
+This is a list with possibly several symbols in it. Valid symbols are:
+
+`event-if-todo'
+
+ Scheduling time stamps in TODO entries become an event.
+
+`event-if-todo-not-done'
+
+ Scheduling time stamps in TODO entries with not-DONE state
+ become events.
+
+`event-if-not-todo'
+
+ Scheduling time stamps in non-TODO entries become an event.
+
+`todo-start'
+
+ Scheduling time stamps in TODO entries become start date. Some
+ calendar applications show TODO entries only after that date."
+ :group 'org-export-icalendar
+ :type
+ '(set :greedy t
+ (const :tag "SCHEDULED timestamps in non-TODO entries become events"
+ event-if-not-todo)
+ (const :tag "SCHEDULED timestamps in TODO entries become events"
+ event-if-todo)
+ (const :tag "SCHEDULED in TODO entries with not-DONE state become events"
+ event-if-todo-not-done)
+ (const :tag "SCHEDULED in TODO entries become start date"
+ todo-start)))
+
+(defcustom org-icalendar-categories '(local-tags category)
+ "Items that should be entered into the \"categories\" field.
+
+This is a list of symbols, the following are valid:
+`category' The Org mode category of the current file or tree
+`todo-state' The todo state, if any
+`local-tags' The tags, defined in the current line
+`all-tags' All tags, including inherited ones."
+ :group 'org-export-icalendar
+ :type '(repeat
+ (choice
+ (const :tag "The file or tree category" category)
+ (const :tag "The TODO state" todo-state)
+ (const :tag "Tags defined in current line" local-tags)
+ (const :tag "All tags, including inherited ones" all-tags))))
+
+(defcustom org-icalendar-with-timestamps 'active
+ "Non-nil means make an event from plain time stamps.
+
+It can be set to `active', `inactive', t or nil, in order to make
+an event from, respectively, only active timestamps, only
+inactive ones, all of them or none.
+
+This variable has precedence over `org-export-with-timestamps'.
+It can also be set with the #+OPTIONS line, e.g. \"<:t\"."
+ :group 'org-export-icalendar
+ :type '(choice
+ (const :tag "All timestamps" t)
+ (const :tag "Only active timestamps" active)
+ (const :tag "Only inactive timestamps" inactive)
+ (const :tag "No timestamp" nil)))
+
+(defcustom org-icalendar-include-todo nil
+ "Non-nil means create VTODO components from TODO items.
+
+Valid values are:
+nil don't include any task.
+t include tasks that are not in DONE state.
+`unblocked' include all TODO items that are not blocked.
+`all' include both done and not done items."
+ :group 'org-export-icalendar
+ :type '(choice
+ (const :tag "None" nil)
+ (const :tag "Unfinished" t)
+ (const :tag "Unblocked" unblocked)
+ (const :tag "All" all)
+ (repeat :tag "Specific TODO keywords"
+ (string :tag "Keyword"))))
+
+(defcustom org-icalendar-include-bbdb-anniversaries nil
+ "Non-nil means a combined iCalendar file should include anniversaries.
+The anniversaries are defined in the BBDB database."
+ :group 'org-export-icalendar
+ :type 'boolean)
+
+(defcustom org-icalendar-include-sexps t
+ "Non-nil means export to iCalendar files should also cover sexp entries.
+These are entries like in the diary, but directly in an Org file."
+ :group 'org-export-icalendar
+ :type 'boolean)
+
+(defcustom org-icalendar-include-body t
+ "Amount of text below headline to be included in iCalendar export.
+This is a number of characters that should maximally be included.
+Properties, scheduling and clocking lines will always be removed.
+The text will be inserted into the DESCRIPTION field."
+ :group 'org-export-icalendar
+ :type '(choice
+ (const :tag "Nothing" nil)
+ (const :tag "Everything" t)
+ (integer :tag "Max characters")))
+
+(defcustom org-icalendar-store-UID nil
+ "Non-nil means store any created UIDs in properties.
+
+The iCalendar standard requires that all entries have a unique identifier.
+Org will create these identifiers as needed. When this variable is non-nil,
+the created UIDs will be stored in the ID property of the entry. Then the
+next time this entry is exported, it will be exported with the same UID,
+superseding the previous form of it. This is essential for
+synchronization services.
+
+This variable is not turned on by default because we want to avoid creating
+a property drawer in every entry if people are only playing with this feature,
+or if they are only using it locally."
+ :group 'org-export-icalendar
+ :type 'boolean)
+
+(defcustom org-icalendar-timezone (getenv "TZ")
+ "The time zone string for iCalendar export.
+When nil or the empty string, use output
+from (current-time-zone)."
+ :group 'org-export-icalendar
+ :type '(choice
+ (const :tag "Unspecified" nil)
+ (string :tag "Time zone")))
+
+(defcustom org-icalendar-date-time-format ":%Y%m%dT%H%M%S"
+ "Format-string for exporting icalendar DATE-TIME.
+
+See `format-time-string' for a full documentation. The only
+difference is that `org-icalendar-timezone' is used for %Z.
+
+Interesting value are:
+ - \":%Y%m%dT%H%M%S\" for local time
+ - \";TZID=%Z:%Y%m%dT%H%M%S\" for local time with explicit timezone
+ - \":%Y%m%dT%H%M%SZ\" for time expressed in Universal Time"
+ :group 'org-export-icalendar
+ :version "24.1"
+ :type '(choice
+ (const :tag "Local time" ":%Y%m%dT%H%M%S")
+ (const :tag "Explicit local time" ";TZID=%Z:%Y%m%dT%H%M%S")
+ (const :tag "Universal time" ":%Y%m%dT%H%M%SZ")
+ (string :tag "Explicit format")))
+
+(defvar org-icalendar-after-save-hook nil
+ "Hook run after an iCalendar file has been saved.
+This hook is run with the name of the file as argument. A good
+way to use this is to tell a desktop calendar application to
+re-read the iCalendar file.")
+
+
+
+;;; Define Back-End
+
+(org-export-define-derived-backend 'icalendar 'ascii
+ :translate-alist '((clock . ignore)
+ (footnote-definition . ignore)
+ (footnote-reference . ignore)
+ (headline . org-icalendar-entry)
+ (inner-template . org-icalendar-inner-template)
+ (inlinetask . ignore)
+ (planning . ignore)
+ (section . ignore)
+ (template . org-icalendar-template))
+ :options-alist
+ '((:exclude-tags
+ "ICALENDAR_EXCLUDE_TAGS" nil org-icalendar-exclude-tags split)
+ (:with-timestamps nil "<" org-icalendar-with-timestamps)
+ ;; Other variables.
+ (:icalendar-alarm-time nil nil org-icalendar-alarm-time)
+ (:icalendar-categories nil nil org-icalendar-categories)
+ (:icalendar-date-time-format nil nil org-icalendar-date-time-format)
+ (:icalendar-include-bbdb-anniversaries nil nil org-icalendar-include-bbdb-anniversaries)
+ (:icalendar-include-body nil nil org-icalendar-include-body)
+ (:icalendar-include-sexps nil nil org-icalendar-include-sexps)
+ (:icalendar-include-todo nil nil org-icalendar-include-todo)
+ (:icalendar-store-UID nil nil org-icalendar-store-UID)
+ (:icalendar-timezone nil nil org-icalendar-timezone)
+ (:icalendar-use-deadline nil nil org-icalendar-use-deadline)
+ (:icalendar-use-scheduled nil nil org-icalendar-use-scheduled))
+ :filters-alist
+ '((:filter-headline . org-icalendar-clear-blank-lines))
+ :menu-entry
+ '(?c "Export to iCalendar"
+ ((?f "Current file" org-icalendar-export-to-ics)
+ (?a "All agenda files"
+ (lambda (a s v b) (org-icalendar-export-agenda-files a)))
+ (?c "Combine all agenda files"
+ (lambda (a s v b) (org-icalendar-combine-agenda-files a))))))
+
+
+
+;;; Internal Functions
+
+(defun org-icalendar-create-uid (file &optional bell)
+ "Set ID property on headlines missing it in FILE.
+When optional argument BELL is non-nil, inform the user with
+a message if the file was modified."
+ (let (modified-flag)
+ (org-map-entries
+ (lambda ()
+ (let ((entry (org-element-at-point)))
+ (unless (org-element-property :ID entry)
+ (org-id-get-create)
+ (setq modified-flag t)
+ (forward-line))))
+ nil nil 'comment)
+ (when (and bell modified-flag)
+ (message "ID properties created in file \"%s\"" file)
+ (sit-for 2))))
+
+(defun org-icalendar-blocked-headline-p (headline info)
+ "Non-nil when HEADLINE is considered to be blocked.
+
+INFO is a plist used as a communication channel.
+
+A headline is blocked when either
+
+ - it has children which are not all in a completed state;
+
+ - it has a parent with the property :ORDERED:, and there are
+ siblings prior to it with incomplete status;
+
+ - its parent is blocked because it has siblings that should be
+ done first or is a child of a blocked grandparent entry."
+ (or
+ ;; Check if any child is not done.
+ (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.
+ (catch 'blockedp
+ (let ((current headline))
+ (dolist (parent (org-element-lineage headline))
+ (cond
+ ((not (org-element-property :todo-keyword parent))
+ (throw 'blockedp nil))
+ ((org-not-nil (org-element-property :ORDERED parent))
+ (let ((sibling current))
+ (while (setq sibling (org-export-get-previous-element
+ sibling info))
+ (when (eq (org-element-property :todo-type sibling) 'todo)
+ (throw 'blockedp t)))))
+ (t (setq current parent))))))))
+
+(defun org-icalendar-use-UTC-date-time-p ()
+ "Non-nil when `org-icalendar-date-time-format' requires UTC time."
+ (char-equal (elt org-icalendar-date-time-format
+ (1- (length org-icalendar-date-time-format)))
+ ?Z))
+
+(defun org-icalendar-convert-timestamp (timestamp keyword &optional end tz)
+ "Convert TIMESTAMP to iCalendar format.
+
+TIMESTAMP is a timestamp object. KEYWORD is added in front of
+it, in order to make a complete line (e.g. \"DTSTART\").
+
+When optional argument END is non-nil, use end of time range.
+Also increase the hour by two (if time string contains a time),
+or the day by one (if it does not contain a time) when no
+explicit ending time is specified.
+
+When optional argument TZ is non-nil, timezone data time will be
+added to the timestamp. It can be the string \"UTC\", to use UTC
+time, or a string in the IANA TZ database
+format (e.g. \"Europe/London\"). In either case, the value of
+`org-icalendar-date-time-format' will be ignored."
+ (let* ((year-start (org-element-property :year-start timestamp))
+ (year-end (org-element-property :year-end timestamp))
+ (month-start (org-element-property :month-start timestamp))
+ (month-end (org-element-property :month-end timestamp))
+ (day-start (org-element-property :day-start timestamp))
+ (day-end (org-element-property :day-end timestamp))
+ (hour-start (org-element-property :hour-start timestamp))
+ (hour-end (org-element-property :hour-end timestamp))
+ (minute-start (org-element-property :minute-start timestamp))
+ (minute-end (org-element-property :minute-end timestamp))
+ (with-time-p minute-start)
+ (equal-bounds-p
+ (equal (list year-start month-start day-start hour-start minute-start)
+ (list year-end month-end day-end hour-end minute-end)))
+ (mi (cond ((not with-time-p) 0)
+ ((not end) minute-start)
+ ((and org-agenda-default-appointment-duration equal-bounds-p)
+ (+ minute-end org-agenda-default-appointment-duration))
+ (t minute-end)))
+ (h (cond ((not with-time-p) 0)
+ ((not end) hour-start)
+ ((or (not equal-bounds-p)
+ org-agenda-default-appointment-duration)
+ hour-end)
+ (t (+ hour-end 2))))
+ (d (cond ((not end) day-start)
+ ((not with-time-p) (1+ day-end))
+ (t day-end)))
+ (m (if end month-end month-start))
+ (y (if end year-end year-start)))
+ (concat
+ keyword
+ (format-time-string
+ (cond ((string-equal tz "UTC") ":%Y%m%dT%H%M%SZ")
+ ((not with-time-p) ";VALUE=DATE:%Y%m%d")
+ ((stringp tz) (concat ";TZID=" tz ":%Y%m%dT%H%M%S"))
+ (t (replace-regexp-in-string "%Z"
+ org-icalendar-timezone
+ org-icalendar-date-time-format
+ t)))
+ ;; Convert timestamp into internal time in order to use
+ ;; `format-time-string' and fix any mistake (i.e. MI >= 60).
+ (encode-time 0 mi h d m y)
+ (and (or (string-equal tz "UTC")
+ (and (null tz)
+ with-time-p
+ (org-icalendar-use-UTC-date-time-p)))
+ t)))))
+
+(defun org-icalendar-dtstamp ()
+ "Return DTSTAMP property, as a string."
+ (format-time-string "DTSTAMP:%Y%m%dT%H%M%SZ" nil t))
+
+(defun org-icalendar-get-categories (entry info)
+ "Return categories according to `org-icalendar-categories'.
+ENTRY is a headline or an inlinetask element. INFO is a plist
+used as a communication channel."
+ (mapconcat
+ #'identity
+ (org-uniquify
+ (let (categories)
+ (dolist (type org-icalendar-categories (nreverse categories))
+ (cl-case type
+ (category
+ (push (org-export-get-category entry info) categories))
+ (todo-state
+ (let ((todo (org-element-property :todo-keyword entry)))
+ (and todo (push todo categories))))
+ (local-tags
+ (setq categories
+ (append (nreverse (org-export-get-tags entry info))
+ categories)))
+ (all-tags
+ (setq categories
+ (append (nreverse (org-export-get-tags entry info nil t))
+ categories)))))))
+ ","))
+
+(defun org-icalendar-transcode-diary-sexp (sexp uid summary)
+ "Transcode a diary sexp into iCalendar format.
+SEXP is the diary sexp being transcoded, as a string. UID is the
+unique identifier for the entry. SUMMARY defines a short summary
+or subject for the event."
+ (when (require 'icalendar nil t)
+ (org-element-normalize-string
+ (with-temp-buffer
+ (let ((sexp (if (not (string-match "\\`<%%" sexp)) sexp
+ (concat (substring sexp 1 -1) " " summary))))
+ (put-text-property 0 1 'uid uid sexp)
+ (insert sexp "\n"))
+ (org-diary-to-ical-string (current-buffer))))))
+
+(defun org-icalendar-cleanup-string (s)
+ "Cleanup string S according to RFC 5545."
+ (when s
+ ;; Protect "\", "," and ";" characters. and replace newline
+ ;; characters with literal \n.
+ (replace-regexp-in-string
+ "[ \t]*\n" "\\n"
+ (replace-regexp-in-string "[\\,;]" "\\\\\\&" s)
+ nil t)))
+
+(defun org-icalendar-fold-string (s)
+ "Fold string S according to RFC 5545."
+ (org-element-normalize-string
+ (mapconcat
+ (lambda (line)
+ ;; Limit each line to a maximum of 75 characters. If it is
+ ;; longer, fold it by using "\r\n " as a continuation marker.
+ (let ((len (length line)))
+ (if (<= len 75) line
+ (let ((folded-line (substring line 0 75))
+ (chunk-start 75)
+ chunk-end)
+ ;; Since continuation marker takes up one character on the
+ ;; line, real contents must be split at 74 chars.
+ (while (< (setq chunk-end (+ chunk-start 74)) len)
+ (setq folded-line
+ (concat folded-line "\r\n "
+ (substring line chunk-start chunk-end))
+ chunk-start chunk-end))
+ (concat folded-line "\r\n " (substring line chunk-start))))))
+ (org-split-string s "\n") "\r\n")))
+
+
+
+;;; Filters
+
+(defun org-icalendar-clear-blank-lines (headline _back-end _info)
+ "Remove blank lines in HEADLINE export.
+HEADLINE is a string representing a transcoded headline.
+BACK-END and INFO are ignored."
+ (replace-regexp-in-string "^\\(?:[ \t]*\n\\)+" "" headline))
+
+
+
+;;; Transcode Functions
+
+;;;; Headline and Inlinetasks
+
+;; The main function is `org-icalendar-entry', which extracts
+;; information from a headline or an inlinetask (summary,
+;; description...) and then delegates code generation to
+;; `org-icalendar--vtodo' and `org-icalendar--vevent', depending
+;; on the component needed.
+
+;; Obviously, `org-icalendar--valarm' handles alarms, which can
+;; happen within a VTODO component.
+
+(defun org-icalendar-entry (entry contents info)
+ "Transcode ENTRY element into iCalendar format.
+
+ENTRY is either a headline or an inlinetask. CONTENTS is
+ignored. INFO is a plist used as a communication channel.
+
+This function is called on every headline, the section below
+it (minus inlinetasks) being its contents. It tries to create
+VEVENT and VTODO components out of scheduled date, deadline date,
+plain timestamps, diary sexps. It also calls itself on every
+inlinetask within the section."
+ (unless (org-element-property :footnote-section-p entry)
+ (let* ((type (org-element-type entry))
+ ;; Determine contents really associated to the entry. For
+ ;; a headline, limit them to section, if any. For an
+ ;; inlinetask, this is every element within the task.
+ (inside
+ (if (eq type 'inlinetask)
+ (cons 'org-data (cons nil (org-element-contents entry)))
+ (let ((first (car (org-element-contents entry))))
+ (and (eq (org-element-type first) 'section)
+ (cons 'org-data
+ (cons nil (org-element-contents first))))))))
+ (concat
+ (let ((todo-type (org-element-property :todo-type entry))
+ (uid (or (org-element-property :ID entry) (org-id-new)))
+ (summary (org-icalendar-cleanup-string
+ (or (org-element-property :SUMMARY entry)
+ (org-export-data
+ (org-element-property :title entry) info))))
+ (loc (org-icalendar-cleanup-string
+ (org-export-get-node-property
+ :LOCATION entry
+ (org-property-inherit-p "LOCATION"))))
+ (class (org-icalendar-cleanup-string
+ (org-export-get-node-property
+ :CLASS entry
+ (org-property-inherit-p "CLASS"))))
+ ;; Build description of the entry from associated section
+ ;; (headline) or contents (inlinetask).
+ (desc
+ (org-icalendar-cleanup-string
+ (or (org-element-property :DESCRIPTION entry)
+ (let ((contents (org-export-data inside info)))
+ (cond
+ ((not (org-string-nw-p contents)) nil)
+ ((wholenump org-icalendar-include-body)
+ (let ((contents (org-trim contents)))
+ (substring
+ contents 0 (min (length contents)
+ org-icalendar-include-body))))
+ (org-icalendar-include-body (org-trim contents)))))))
+ (cat (org-icalendar-get-categories entry info))
+ (tz (org-export-get-node-property
+ :TIMEZONE entry
+ (org-property-inherit-p "TIMEZONE"))))
+ (concat
+ ;; Events: Delegate to `org-icalendar--vevent' to generate
+ ;; "VEVENT" component from scheduled, deadline, or any
+ ;; timestamp in the entry.
+ (let ((deadline (org-element-property :deadline entry))
+ (use-deadline (plist-get info :icalendar-use-deadline)))
+ (and deadline
+ (pcase todo-type
+ (`todo (or (memq 'event-if-todo-not-done use-deadline)
+ (memq 'event-if-todo use-deadline)))
+ (`done (memq 'event-if-todo use-deadline))
+ (_ (memq 'event-if-not-todo use-deadline)))
+ (org-icalendar--vevent
+ entry deadline (concat "DL-" uid)
+ (concat "DL: " summary) loc desc cat tz class)))
+ (let ((scheduled (org-element-property :scheduled entry))
+ (use-scheduled (plist-get info :icalendar-use-scheduled)))
+ (and scheduled
+ (pcase todo-type
+ (`todo (or (memq 'event-if-todo-not-done use-scheduled)
+ (memq 'event-if-todo use-scheduled)))
+ (`done (memq 'event-if-todo use-scheduled))
+ (_ (memq 'event-if-not-todo use-scheduled)))
+ (org-icalendar--vevent
+ entry scheduled (concat "SC-" uid)
+ (concat "S: " summary) loc desc cat tz class)))
+ ;; When collecting plain timestamps from a headline and its
+ ;; title, skip inlinetasks since collection will happen once
+ ;; ENTRY is one of them.
+ (let ((counter 0))
+ (mapconcat
+ #'identity
+ (org-element-map (cons (org-element-property :title entry)
+ (org-element-contents inside))
+ 'timestamp
+ (lambda (ts)
+ (when (let ((type (org-element-property :type ts)))
+ (cl-case (plist-get info :with-timestamps)
+ (active (memq type '(active active-range)))
+ (inactive (memq type '(inactive inactive-range)))
+ ((t) t)))
+ (let ((uid (format "TS%d-%s" (cl-incf counter) uid)))
+ (org-icalendar--vevent
+ entry ts uid summary loc desc cat tz class))))
+ info nil (and (eq type 'headline) 'inlinetask))
+ ""))
+ ;; Task: First check if it is appropriate to export it. If
+ ;; so, call `org-icalendar--vtodo' to transcode it into
+ ;; a "VTODO" component.
+ (when (and todo-type
+ (cl-case (plist-get info :icalendar-include-todo)
+ (all t)
+ (unblocked
+ (and (eq type 'headline)
+ (not (org-icalendar-blocked-headline-p
+ entry info))))
+ ((t) (eq todo-type 'todo))))
+ (org-icalendar--vtodo entry uid summary loc desc cat tz class))
+ ;; Diary-sexp: Collect every diary-sexp element within ENTRY
+ ;; and its title, and transcode them. If ENTRY is
+ ;; a headline, skip inlinetasks: they will be handled
+ ;; separately.
+ (when org-icalendar-include-sexps
+ (let ((counter 0))
+ (mapconcat #'identity
+ (org-element-map
+ (cons (org-element-property :title entry)
+ (org-element-contents inside))
+ 'diary-sexp
+ (lambda (sexp)
+ (org-icalendar-transcode-diary-sexp
+ (org-element-property :value sexp)
+ (format "DS%d-%s" (cl-incf counter) uid)
+ summary))
+ info nil (and (eq type 'headline) 'inlinetask))
+ "")))))
+ ;; If ENTRY is a headline, call current function on every
+ ;; inlinetask within it. In agenda export, this is independent
+ ;; from the mark (or lack thereof) on the entry.
+ (when (eq type 'headline)
+ (mapconcat #'identity
+ (org-element-map inside 'inlinetask
+ (lambda (task) (org-icalendar-entry task nil info))
+ info) ""))
+ ;; Don't forget components from inner entries.
+ contents))))
+
+(defun org-icalendar--vevent
+ (entry timestamp uid summary location description categories timezone class)
+ "Create a VEVENT component.
+
+ENTRY is either a headline or an inlinetask element. TIMESTAMP
+is a timestamp object defining the date-time of the event. UID
+is the unique identifier for the event. SUMMARY defines a short
+summary or subject for the event. LOCATION defines the intended
+venue for the event. DESCRIPTION provides the complete
+description of the event. CATEGORIES defines the categories the
+event belongs to. TIMEZONE specifies a time zone for this event
+only. CLASS contains the visibility attribute. Three of them
+(\"PUBLIC\", \"CONFIDENTIAL\", and \"PRIVATE\") are predefined, others
+should be treated as \"PRIVATE\" if they are unknown to the iCalendar server.
+
+Return VEVENT component as a string."
+ (org-icalendar-fold-string
+ (if (eq (org-element-property :type timestamp) 'diary)
+ (org-icalendar-transcode-diary-sexp
+ (org-element-property :raw-value timestamp) uid summary)
+ (concat "BEGIN:VEVENT\n"
+ (org-icalendar-dtstamp) "\n"
+ "UID:" uid "\n"
+ (org-icalendar-convert-timestamp timestamp "DTSTART" nil timezone) "\n"
+ (org-icalendar-convert-timestamp timestamp "DTEND" t timezone) "\n"
+ ;; RRULE.
+ (when (org-element-property :repeater-type timestamp)
+ (format "RRULE:FREQ=%s;INTERVAL=%d\n"
+ (cl-case (org-element-property :repeater-unit timestamp)
+ (hour "HOURLY") (day "DAILY") (week "WEEKLY")
+ (month "MONTHLY") (year "YEARLY"))
+ (org-element-property :repeater-value timestamp)))
+ "SUMMARY:" summary "\n"
+ (and (org-string-nw-p location) (format "LOCATION:%s\n" location))
+ (and (org-string-nw-p class) (format "CLASS:%s\n" class))
+ (and (org-string-nw-p description)
+ (format "DESCRIPTION:%s\n" description))
+ "CATEGORIES:" categories "\n"
+ ;; VALARM.
+ (org-icalendar--valarm entry timestamp summary)
+ "END:VEVENT"))))
+
+(defun org-icalendar--vtodo
+ (entry uid summary location description categories timezone class)
+ "Create a VTODO component.
+
+ENTRY is either a headline or an inlinetask element. UID is the
+unique identifier for the task. SUMMARY defines a short summary
+or subject for the task. LOCATION defines the intended venue for
+the task. DESCRIPTION provides the complete description of the
+task. CATEGORIES defines the categories the task belongs to.
+TIMEZONE specifies a time zone for this TODO only.
+
+Return VTODO component as a string."
+ (let ((start (or (and (memq 'todo-start org-icalendar-use-scheduled)
+ (org-element-property :scheduled entry))
+ ;; If we can't use a scheduled time for some
+ ;; reason, start task now.
+ (let ((now (decode-time)))
+ (list 'timestamp
+ (list :type 'active
+ :minute-start (nth 1 now)
+ :hour-start (nth 2 now)
+ :day-start (nth 3 now)
+ :month-start (nth 4 now)
+ :year-start (nth 5 now)))))))
+ (org-icalendar-fold-string
+ (concat "BEGIN:VTODO\n"
+ "UID:TODO-" uid "\n"
+ (org-icalendar-dtstamp) "\n"
+ (org-icalendar-convert-timestamp start "DTSTART" nil timezone) "\n"
+ (and (memq 'todo-due org-icalendar-use-deadline)
+ (org-element-property :deadline entry)
+ (concat (org-icalendar-convert-timestamp
+ (org-element-property :deadline entry) "DUE" nil timezone)
+ "\n"))
+ "SUMMARY:" summary "\n"
+ (and (org-string-nw-p location) (format "LOCATION:%s\n" location))
+ (and (org-string-nw-p class) (format "CLASS:%s\n" class))
+ (and (org-string-nw-p description)
+ (format "DESCRIPTION:%s\n" description))
+ "CATEGORIES:" categories "\n"
+ "SEQUENCE:1\n"
+ (format "PRIORITY:%d\n"
+ (let ((pri (or (org-element-property :priority entry)
+ org-priority-default)))
+ (floor (- 9 (* 8. (/ (float (- org-priority-lowest pri))
+ (- org-priority-lowest
+ org-priority-highest)))))))
+ (format "STATUS:%s\n"
+ (if (eq (org-element-property :todo-type entry) 'todo)
+ "NEEDS-ACTION"
+ "COMPLETED"))
+ "END:VTODO"))))
+
+(defun org-icalendar--valarm (entry timestamp summary)
+ "Create a VALARM component.
+
+ENTRY is the calendar entry triggering the alarm. TIMESTAMP is
+the start date-time of the entry. SUMMARY defines a short
+summary or subject for the task.
+
+Return VALARM component as a string, or nil if it isn't allowed."
+ ;; Create a VALARM entry if the entry is timed. This is not very
+ ;; general in that:
+ ;; (a) only one alarm per entry is defined,
+ ;; (b) only minutes are allowed for the trigger period ahead of the
+ ;; start time,
+ ;; (c) only a DISPLAY action is defined. [ESF]
+ (let ((alarm-time
+ (let ((warntime
+ (org-element-property :APPT_WARNTIME entry)))
+ (if warntime (string-to-number warntime) 0))))
+ (and (or (> alarm-time 0) (> org-icalendar-alarm-time 0))
+ (org-element-property :hour-start timestamp)
+ (format "BEGIN:VALARM
+ACTION:DISPLAY
+DESCRIPTION:%s
+TRIGGER:-P0DT0H%dM0S
+END:VALARM\n"
+ summary
+ (if (zerop alarm-time) org-icalendar-alarm-time alarm-time)))))
+
+
+;;;; Template
+
+(defun org-icalendar-inner-template (contents _)
+ "Return document body string after iCalendar conversion.
+CONTENTS is the transcoded contents string."
+ contents)
+
+(defun org-icalendar-template (contents info)
+ "Return complete document string after iCalendar conversion.
+CONTENTS is the transcoded contents string. INFO is a plist used
+as a communication channel."
+ (org-icalendar--vcalendar
+ ;; Name.
+ (if (not (plist-get info :input-file)) (buffer-name (buffer-base-buffer))
+ (file-name-nondirectory
+ (file-name-sans-extension (plist-get info :input-file))))
+ ;; Owner.
+ (if (not (plist-get info :with-author)) ""
+ (org-export-data (plist-get info :author) info))
+ ;; Timezone.
+ (if (org-string-nw-p org-icalendar-timezone) org-icalendar-timezone
+ (cadr (current-time-zone)))
+ ;; Description.
+ (org-export-data (plist-get info :title) info)
+ contents))
+
+(defun org-icalendar--vcalendar (name owner tz description contents)
+ "Create a VCALENDAR component.
+NAME, OWNER, TZ, DESCRIPTION and CONTENTS are all strings giving,
+respectively, the name of the calendar, its owner, the timezone
+used, a short description and the other components included."
+ (concat (format "BEGIN:VCALENDAR
+VERSION:2.0
+X-WR-CALNAME:%s
+PRODID:-//%s//Emacs with Org mode//EN
+X-WR-TIMEZONE:%s
+X-WR-CALDESC:%s
+CALSCALE:GREGORIAN\n"
+ (org-icalendar-cleanup-string name)
+ (org-icalendar-cleanup-string owner)
+ (org-icalendar-cleanup-string tz)
+ (org-icalendar-cleanup-string description))
+ contents
+ "END:VCALENDAR\n"))
+
+
+
+;;; Interactive Functions
+
+;;;###autoload
+(defun org-icalendar-export-to-ics
+ (&optional async subtreep visible-only body-only)
+ "Export current buffer to an iCalendar file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"BEGIN:VCALENDAR\" and \"END:VCALENDAR\".
+
+Return ICS file name."
+ (interactive)
+ (let ((file (buffer-file-name (buffer-base-buffer))))
+ (when (and file org-icalendar-store-UID)
+ (org-icalendar-create-uid file 'warn-user)))
+ ;; Export part. Since this back-end is backed up by `ascii', ensure
+ ;; links will not be collected at the end of sections.
+ (let ((outfile (org-export-output-file-name ".ics" subtreep)))
+ (org-export-to-file 'icalendar outfile
+ async subtreep visible-only body-only
+ '(:ascii-charset utf-8 :ascii-links-to-notes nil)
+ '(lambda (file)
+ (run-hook-with-args 'org-icalendar-after-save-hook file) nil))))
+
+;;;###autoload
+(defun org-icalendar-export-agenda-files (&optional async)
+ "Export all agenda files to iCalendar files.
+When optional argument ASYNC is non-nil, export happens in an
+external process."
+ (interactive)
+ (if async
+ ;; Asynchronous export is not interactive, so we will not call
+ ;; `org-check-agenda-file'. Instead we remove any non-existent
+ ;; agenda file from the list.
+ (let ((files (cl-remove-if-not #'file-exists-p (org-agenda-files t))))
+ (org-export-async-start
+ (lambda (results)
+ (dolist (f results) (org-export-add-to-stack f 'icalendar)))
+ `(let (output-files)
+ (dolist (file ',files outputfiles)
+ (with-current-buffer (org-get-agenda-file-buffer file)
+ (push (expand-file-name (org-icalendar-export-to-ics))
+ output-files))))))
+ (let ((files (org-agenda-files t)))
+ (org-agenda-prepare-buffers files)
+ (unwind-protect
+ (dolist (file files)
+ (catch 'nextfile
+ (org-check-agenda-file file)
+ (with-current-buffer (org-get-agenda-file-buffer file)
+ (org-icalendar-export-to-ics))))
+ (org-release-buffers org-agenda-new-buffers)))))
+
+;;;###autoload
+(defun org-icalendar-combine-agenda-files (&optional async)
+ "Combine all agenda files into a single iCalendar file.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+The file is stored under the name chosen in
+`org-icalendar-combined-agenda-file'."
+ (interactive)
+ (if async
+ (let ((files (cl-remove-if-not #'file-exists-p (org-agenda-files t))))
+ (org-export-async-start
+ (lambda (_)
+ (org-export-add-to-stack
+ (expand-file-name org-icalendar-combined-agenda-file)
+ 'icalendar))
+ `(apply #'org-icalendar--combine-files ',files)))
+ (apply #'org-icalendar--combine-files (org-agenda-files t))))
+
+(defun org-icalendar-export-current-agenda (file)
+ "Export current agenda view to an iCalendar FILE.
+This function assumes major mode for current buffer is
+`org-agenda-mode'."
+ (let* ((org-export-use-babel) ;don't evaluate Babel blocks
+ (contents
+ (org-export-string-as
+ (with-output-to-string
+ (save-excursion
+ (let ((p (point-min))
+ (seen nil)) ;prevent duplicates
+ (while (setq p (next-single-property-change p 'org-hd-marker))
+ (let ((m (get-text-property p 'org-hd-marker)))
+ (when (and m (not (member m seen)))
+ (push m seen)
+ (with-current-buffer (marker-buffer m)
+ (org-with-wide-buffer
+ (goto-char (marker-position m))
+ (princ
+ (org-element-normalize-string
+ (buffer-substring (point)
+ (org-entry-end-position))))))))
+ (forward-line)))))
+ 'icalendar t
+ '(:ascii-charset utf-8 :ascii-links-to-notes nil
+ :icalendar-include-todo all))))
+ (with-temp-file file
+ (insert
+ (org-icalendar--vcalendar
+ org-icalendar-combined-name
+ user-full-name
+ (or (org-string-nw-p org-icalendar-timezone) (cadr (current-time-zone)))
+ org-icalendar-combined-description
+ contents)))
+ (run-hook-with-args 'org-icalendar-after-save-hook file)))
+
+(defun org-icalendar--combine-files (&rest files)
+ "Combine entries from multiple files into an iCalendar file.
+FILES is a list of files to build the calendar from."
+ ;; At the end of the process, all buffers related to FILES are going
+ ;; to be killed. Make sure to only kill the ones opened in the
+ ;; process.
+ (let ((org-agenda-new-buffers nil))
+ (unwind-protect
+ (progn
+ (with-temp-file org-icalendar-combined-agenda-file
+ (insert
+ (org-icalendar--vcalendar
+ ;; Name.
+ org-icalendar-combined-name
+ ;; Owner.
+ user-full-name
+ ;; Timezone.
+ (or (org-string-nw-p org-icalendar-timezone)
+ (cadr (current-time-zone)))
+ ;; Description.
+ org-icalendar-combined-description
+ ;; Contents.
+ (concat
+ ;; Agenda contents.
+ (mapconcat
+ (lambda (file)
+ (catch 'nextfile
+ (org-check-agenda-file file)
+ (with-current-buffer (org-get-agenda-file-buffer file)
+ ;; Create ID if necessary.
+ (when org-icalendar-store-UID
+ (org-icalendar-create-uid file t))
+ (org-export-as
+ 'icalendar nil nil t
+ '(:ascii-charset utf-8 :ascii-links-to-notes nil)))))
+ files "")
+ ;; BBDB anniversaries.
+ (when (and org-icalendar-include-bbdb-anniversaries
+ (require 'ol-bbdb nil t))
+ (with-output-to-string (org-bbdb-anniv-export-ical)))))))
+ (run-hook-with-args 'org-icalendar-after-save-hook
+ org-icalendar-combined-agenda-file))
+ (org-release-buffers org-agenda-new-buffers))))
+
+
+(provide 'ox-icalendar)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ox-icalendar.el ends here
diff --git a/elpa/org-9.5.2/ox-icalendar.elc b/elpa/org-9.5.2/ox-icalendar.elc
new file mode 100644
index 0000000..6166ac3
--- /dev/null
+++ b/elpa/org-9.5.2/ox-icalendar.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ox-koma-letter.el b/elpa/org-9.5.2/ox-koma-letter.el
new file mode 100644
index 0000000..978e4e4
--- /dev/null
+++ b/elpa/org-9.5.2/ox-koma-letter.el
@@ -0,0 +1,989 @@
+;;; ox-koma-letter.el --- KOMA Scrlttr2 Back-End for Org Export Engine -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <n.goaziou AT gmail DOT com>
+;; Alan Schmitt <alan.schmitt AT polytechnique DOT org>
+;; Viktor Rosenfeld <listuser36 AT gmail DOT com>
+;; Rasmus Pank Roulund <emacs AT pank DOT eu>
+;; Maintainer: Marco Wahl <marcowahlsoft@gmail.com>
+;; Keywords: org, wp, tex
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; This library implements a KOMA Scrlttr2 back-end, derived from the
+;; LaTeX one.
+;;
+;; Depending on the desired output format, three commands are provided
+;; for export: `org-koma-letter-export-as-latex' (temporary buffer),
+;; `org-koma-letter-export-to-latex' ("tex" file) and
+;; `org-koma-letter-export-to-pdf' ("pdf" file).
+;;
+;; On top of buffer keywords supported by `latex' back-end (see
+;; `org-latex-options-alist'), this back-end introduces the following
+;; keywords:
+;; - CLOSING: see `org-koma-letter-closing',
+;; - FROM_ADDRESS: see `org-koma-letter-from-address',
+;; - LCO: see `org-koma-letter-class-option-file',
+;; - OPENING: see `org-koma-letter-opening',
+;; - PHONE_NUMBER: see `org-koma-letter-phone-number',
+;; - URL: see `org-koma-letter-url',
+;; - FROM_LOGO: see `org-koma-letter-from-logo',
+;; - SIGNATURE: see `org-koma-letter-signature',
+;; - PLACE: see `org-koma-letter-place',
+;; - LOCATION: see `org-koma-letter-location',
+;; - TO_ADDRESS: If unspecified this is set to "\mbox{}".
+;;
+;; TO_ADDRESS, FROM_ADDRESS, LOCATION, CLOSING, and SIGNATURE can also
+;; be specified using "special headings" with the special tags
+;; specified in `org-koma-letter-special-tags-in-letter'. LaTeX line
+;; breaks are not necessary for TO_ADDRESS, FROM_ADDRESS and LOCATION.
+;; If both a headline and a keyword specify a to or from address the
+;; value is determined in accordance with
+;; `org-koma-letter-prefer-special-headings'.
+;;
+;; A number of OPTIONS settings can be set to change which contents is
+;; exported.
+;; - backaddress (see `org-koma-letter-use-backaddress')
+;; - foldmarks (see `org-koma-letter-use-foldmarks')
+;; - phone (see `org-koma-letter-use-phone')
+;; - url (see `org-koma-letter-use-url')
+;; - from-logo (see `org-koma-letter-use-from-logo')
+;; - email (see `org-koma-letter-use-email')
+;; - place (see `org-koma-letter-use-place')
+;; - location (see `org-koma-letter-use-location')
+;; - subject, a list of format options
+;; (see `org-koma-letter-subject-format')
+;; - after-closing-order, a list of the ordering of headings with
+;; special tags after closing (see
+;; `org-koma-letter-special-tags-after-closing')
+;; - after-letter-order, as above, but after the end of the letter
+;; (see `org-koma-letter-special-tags-after-letter').
+;;
+;; The following variables works differently from the main LaTeX class
+;; - AUTHOR: Default to user-full-name but may be disabled.
+;; (See also `org-koma-letter-author'.)
+;; - EMAIL: Same as AUTHOR. (See also `org-koma-letter-email'.)
+;;
+;; FROM_LOGO uses LaTeX markup. FROM_LOGO provides the
+;; "includegraphics" command to tell LaTeX where to find the logo.
+;; This command needs to know the logo's directory and file name. The
+;; directory can either be relative or absolute, just as you would
+;; expect. LaTeX can use three file types for the logo: PDF, JPEG, or
+;; PNG. The logo can either include or exclude its extension, which
+;; might surprise you. When you exclude its extension, LaTeX will
+;; search the directory for the "best" quality graphics format. For
+;; example if it finds both logo.pdf and logo.png then it will
+;; identify the PDF as "better", and include "logo.pdf". This can be
+;; useful, for example, when you are mocking up a logo in the PNG
+;; raster format and then switch over to the higher quality PDF vector
+;; format. When you include the file extension then LaTeX will
+;; include it without searching for higher quality file types.
+;; Whatever file type you choose, it will probably require a few
+;; design iterations to get the best looking logo size for your
+;; letter. Finally, the directory and file name are specified
+;; *without* quotes. Here are some examples with commentary, in the
+;; location of your letter, with a logo named "logo", to get you
+;; started:
+;;
+;; Logo in the same directory: \includegraphics{logo}
+;; or a sub-directory: \includegraphics{logos/production/logo}
+;;
+;; Logos specified using absolute paths on Linux or Windows:
+;;
+;; \includegraphics{~/correspondence/logo}
+;; \includegraphics{~/correspondence/logos/production/logo}
+;; \includegraphics{c:/you/correspondence/logo}
+;; \includegraphics{c:/you/correspondence/logos/production/logo}
+;;
+;; Logos in the same directory where the "better" quality PDF will
+;; be chosen over the JPG:
+;;
+;; \includegraphics{logo.pdf}
+;; \includegraphics{logo.png}
+;;
+;; Headlines are in general ignored. However, headlines with special
+;; tags can be used for specified contents like postscript (ps),
+;; carbon copy (cc), enclosures (encl) and code to be inserted after
+;; \end{letter} (after_letter). Specials tags are defined in
+;; `org-koma-letter-special-tags-after-closing' and
+;; `org-koma-letter-special-tags-after-letter'. Currently members of
+;; `org-koma-letter-special-tags-after-closing' used as macros and the
+;; content of the headline is the argument.
+;;
+;; Headlines with to and from may also be used rather than the keyword
+;; approach described above. If both a keyword and a headline with
+;; information is present precedence is determined by
+;; `org-koma-letter-prefer-special-headings'.
+;;
+;; You need an appropriate association in `org-latex-classes' in order
+;; to use the KOMA Scrlttr2 class. By default, a sparse scrlttr2
+;; class is provided: "default-koma-letter". You can also add you own
+;; letter class. For instance:
+;;
+;; (add-to-list 'org-latex-classes
+;; '("my-letter"
+;; "\\documentclass\[%
+;; DIV=14,
+;; fontsize=12pt,
+;; parskip=half,
+;; subject=titled,
+;; backaddress=false,
+;; fromalign=left,
+;; fromemail=true,
+;; fromphone=true\]\{scrlttr2\}
+;; \[DEFAULT-PACKAGES]
+;; \[PACKAGES]
+;; \[EXTRA]"))
+;;
+;; Then, in your Org document, be sure to require the proper class
+;; with:
+;;
+;; #+LATEX_CLASS: my-letter
+;;
+;; Or by setting `org-koma-letter-default-class'.
+;;
+;; You may have to load (LaTeX) Babel as well, e.g., by adding
+;; it to `org-latex-packages-alist',
+;;
+;; (add-to-list 'org-latex-packages-alist '("AUTO" "babel" nil))
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ox-latex)
+
+;; Install a default letter class.
+(unless (assoc "default-koma-letter" org-latex-classes)
+ (add-to-list 'org-latex-classes
+ '("default-koma-letter" "\\documentclass[11pt]{scrlttr2}")))
+
+
+;;; User-Configurable Variables
+
+(defgroup org-export-koma-letter nil
+ "Options for exporting to KOMA scrlttr2 class in LaTeX export."
+ :tag "Org Koma-Letter"
+ :group 'org-export)
+
+(defcustom org-koma-letter-class-option-file "NF"
+ "Letter Class Option File.
+This option can also be set with the LCO keyword."
+ :type 'string)
+
+(defcustom org-koma-letter-author 'user-full-name
+ "Sender's name.
+
+This variable defaults to calling the function `user-full-name'
+which just returns the current function `user-full-name'.
+Alternatively a string, nil or a function may be given.
+Functions must return a string.
+
+This option can also be set with the AUTHOR keyword."
+ :type '(radio (function-item user-full-name)
+ (string)
+ (function)
+ (const :tag "Do not export author" nil)))
+
+(defcustom org-koma-letter-email 'org-koma-letter-email
+ "Sender's email address.
+
+This variable defaults to the value `org-koma-letter-email' which
+returns `user-mail-address'. Alternatively a string, nil or
+a function may be given. Functions must return a string.
+
+This option can also be set with the EMAIL keyword."
+ :type '(radio (function-item org-koma-letter-email)
+ (string)
+ (function)
+ (const :tag "Do not export email" nil)))
+
+(defcustom org-koma-letter-from-address ""
+ "Sender's address, as a string.
+This option can also be set with one or more FROM_ADDRESS
+keywords."
+ :type 'string)
+
+(defcustom org-koma-letter-phone-number ""
+ "Sender's phone number, as a string.
+This option can also be set with the PHONE_NUMBER keyword."
+ :type 'string)
+
+(defcustom org-koma-letter-url ""
+ "Sender's URL, e. g., the URL of her homepage.
+This option can also be set with the URL keyword."
+ :type 'string
+ :safe #'stringp)
+
+(defcustom org-koma-letter-from-logo ""
+ "Commands for inserting the sender's logo, e. g., \\includegraphics{logo}.
+This option can also be set with the FROM_LOGO keyword."
+ :type 'string
+ :safe #'stringp)
+
+(defcustom org-koma-letter-place ""
+ "Place from which the letter is sent, as a string.
+This option can also be set with the PLACE keyword."
+ :type 'string)
+
+(defcustom org-koma-letter-location ""
+ "Sender's extension field, as a string.
+
+This option can also be set with the LOCATION keyword.
+Moreover, when:
+ (1) Either `org-koma-letter-prefer-special-headings' is non-nil
+ or there is no LOCATION keyword or the LOCATION keyword is
+ empty;
+ (2) the letter contains a headline with the special
+ tag \"location\";
+then the location will be set as the content of the location
+special heading.
+
+The location field is typically printed right of the address
+field (See Figure 4.9. in the English manual of 2015-10-03)."
+ :type 'string)
+
+(defcustom org-koma-letter-opening ""
+ "Letter's opening, as a string.
+
+This option can also be set with the OPENING keyword. Moreover,
+when:
+ (1) Either `org-koma-letter-prefer-special-headings' is non-nil
+ or the CLOSING keyword is empty
+ (2) `org-koma-letter-headline-is-opening-maybe' is non-nil;
+ (3) the letter contains a headline without a special
+ tag (e.g. \"to\" or \"ps\");
+then the opening will be implicitly set as the untagged headline title."
+ :type 'string)
+
+(defcustom org-koma-letter-closing ""
+ "Letter's closing, as a string.
+This option can also be set with the CLOSING keyword. Moreover,
+when:
+ (1) Either `org-koma-letter-prefer-special-headings' is non-nil
+ or the CLOSING keyword is empty;
+ (2) `org-koma-letter-headline-is-opening-maybe' is non-nil;
+ (3) the letter contains a headline with the special
+ tag \"closing\";
+then the opening will be set as the title of the closing special
+heading title."
+ :type 'string)
+
+(defcustom org-koma-letter-signature ""
+ "Signature, as a string.
+This option can also be set with the SIGNATURE keyword.
+Moreover, when:
+ (1) Either `org-koma-letter-prefer-special-headings' is non-nil
+ or there is no CLOSING keyword or the CLOSING keyword is empty;
+ (2) `org-koma-letter-headline-is-opening-maybe' is non-nil;
+ (3) the letter contains a headline with the special
+ tag \"closing\";
+then the signature will be set as the content of the
+closing special heading.
+
+Note if the content is empty the signature will not be set."
+ :type 'string)
+
+(defcustom org-koma-letter-prefer-special-headings nil
+ "Non-nil means prefer headlines over keywords for TO and FROM.
+This option can also be set with the OPTIONS keyword, e.g.:
+\"special-headings:t\"."
+ :type 'boolean)
+
+(defcustom org-koma-letter-subject-format t
+ "Non-nil means include the subject.
+
+Support formatting options.
+
+When t, insert a subject using default options. When nil, do not
+insert a subject at all. It can also be a list of symbols among
+the following ones:
+
+ `afteropening' Subject after opening
+ `beforeopening' Subject before opening
+ `centered' Subject centered
+ `left' Subject left-justified
+ `right' Subject right-justified
+ `titled' Add title/description to subject
+ `underlined' Set subject underlined
+ `untitled' Do not add title/description to subject
+
+Please refer to the KOMA-script manual (Table 4.16. in the
+English manual of 2012-07-22).
+
+This option can also be set with the OPTIONS keyword, e.g.:
+\"subject:(underlined centered)\"."
+ :type
+ '(choice
+ (const :tag "No export" nil)
+ (const :tag "Default options" t)
+ (set :tag "Configure options"
+ (const :tag "Subject after opening" afteropening)
+ (const :tag "Subject before opening" beforeopening)
+ (const :tag "Subject centered" centered)
+ (const :tag "Subject left-justified" left)
+ (const :tag "Subject right-justified" right)
+ (const :tag "Add title or description to subject" underlined)
+ (const :tag "Set subject underlined" titled)
+ (const :tag "Do not add title or description to subject" untitled))))
+
+(defcustom org-koma-letter-use-backaddress nil
+ "Non-nil prints return address in line above to address.
+This option can also be set with the OPTIONS keyword, e.g.:
+\"backaddress:t\"."
+ :type 'boolean)
+
+(defcustom org-koma-letter-use-foldmarks t
+ "Configure appearance of folding marks.
+
+When t, activate default folding marks. When nil, do not insert
+folding marks at all. It can also be a list of symbols among the
+following ones:
+
+ `B' Activate upper horizontal mark on left paper edge
+ `b' Deactivate upper horizontal mark on left paper edge
+
+ `H' Activate all horizontal marks on left paper edge
+ `h' Deactivate all horizontal marks on left paper edge
+
+ `L' Activate left vertical mark on upper paper edge
+ `l' Deactivate left vertical mark on upper paper edge
+
+ `M' Activate middle horizontal mark on left paper edge
+ `m' Deactivate middle horizontal mark on left paper edge
+
+ `P' Activate punch or center mark on left paper edge
+ `p' Deactivate punch or center mark on left paper edge
+
+ `T' Activate lower horizontal mark on left paper edge
+ `t' Deactivate lower horizontal mark on left paper edge
+
+ `V' Activate all vertical marks on upper paper edge
+ `v' Deactivate all vertical marks on upper paper edge
+
+This option can also be set with the OPTIONS keyword, e.g.:
+\"foldmarks:(b l m t)\"."
+ :type '(choice
+ (const :tag "Activate default folding marks" t)
+ (const :tag "Deactivate folding marks" nil)
+ (set
+ :tag "Configure folding marks"
+ (const :tag "Activate upper horizontal mark on left paper edge" B)
+ (const :tag "Deactivate upper horizontal mark on left paper edge" b)
+ (const :tag "Activate all horizontal marks on left paper edge" H)
+ (const :tag "Deactivate all horizontal marks on left paper edge" h)
+ (const :tag "Activate left vertical mark on upper paper edge" L)
+ (const :tag "Deactivate left vertical mark on upper paper edge" l)
+ (const :tag "Activate middle horizontal mark on left paper edge" M)
+ (const :tag "Deactivate middle horizontal mark on left paper edge" m)
+ (const :tag "Activate punch or center mark on left paper edge" P)
+ (const :tag "Deactivate punch or center mark on left paper edge" p)
+ (const :tag "Activate lower horizontal mark on left paper edge" T)
+ (const :tag "Deactivate lower horizontal mark on left paper edge" t)
+ (const :tag "Activate all vertical marks on upper paper edge" V)
+ (const :tag "Deactivate all vertical marks on upper paper edge" v))))
+
+(defcustom org-koma-letter-use-phone nil
+ "Non-nil prints sender's phone number.
+This option can also be set with the OPTIONS keyword, e.g.:
+\"phone:t\"."
+ :type 'boolean)
+
+(defcustom org-koma-letter-use-url nil
+ "Non-nil prints sender's URL.
+This option can also be set with the OPTIONS keyword, e.g.:
+\"url:t\"."
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-koma-letter-use-from-logo nil
+ "Non-nil prints sender's FROM_LOGO.
+This option can also be set with the OPTIONS keyword, e.g.:
+\"from-logo:t\"."
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-koma-letter-use-email nil
+ "Non-nil prints sender's email address.
+This option can also be set with the OPTIONS keyword, e.g.:
+\"email:t\"."
+ :type 'boolean)
+
+(defcustom org-koma-letter-use-place t
+ "Non-nil prints the letter's place next to the date.
+This option can also be set with the OPTIONS keyword, e.g.:
+\"place:nil\"."
+ :type 'boolean)
+
+(defcustom org-koma-letter-default-class "default-koma-letter"
+ "Default class for `org-koma-letter'.
+The value must be a member of `org-latex-classes'."
+ :type 'string)
+
+(defcustom org-koma-letter-headline-is-opening-maybe t
+ "Non-nil means a headline may be used as an opening and closing.
+See also `org-koma-letter-opening' and
+`org-koma-letter-closing'."
+ :type 'boolean)
+
+(defcustom org-koma-letter-prefer-subject nil
+ "Non-nil means title should be interpreted as subject if subject is missing.
+This option can also be set with the OPTIONS keyword,
+e.g. \"title-subject:t\"."
+ :type 'boolean)
+
+(defconst org-koma-letter-special-tags-in-letter '(to from closing location)
+ "Header tags related to the letter itself.")
+
+(defconst org-koma-letter-special-tags-after-closing '(after_closing ps encl cc)
+ "Header tags to be inserted in the letter after closing.")
+
+(defconst org-koma-letter-special-tags-as-macro '(ps encl cc)
+ "Header tags to be inserted as macros.")
+
+(defconst org-koma-letter-special-tags-after-letter '(after_letter)
+ "Header tags to be inserted after the letter.")
+
+(defvar org-koma-letter-special-contents nil
+ "Holds special content temporarily.")
+
+
+;;; Define Back-End
+
+(org-export-define-derived-backend 'koma-letter 'latex
+ :options-alist
+ '((:latex-class "LATEX_CLASS" nil org-koma-letter-default-class t)
+ (:lco "LCO" nil org-koma-letter-class-option-file)
+ (:author "AUTHOR" nil (org-koma-letter--get-value org-koma-letter-author) parse)
+ (:author-changed-in-buffer-p "AUTHOR" nil nil t)
+ (:from-address "FROM_ADDRESS" nil org-koma-letter-from-address newline)
+ (:phone-number "PHONE_NUMBER" nil org-koma-letter-phone-number)
+ (:url "URL" nil org-koma-letter-url)
+ (:from-logo "FROM_LOGO" nil org-koma-letter-from-logo)
+ (:email "EMAIL" nil (org-koma-letter--get-value org-koma-letter-email) t)
+ (:to-address "TO_ADDRESS" nil nil newline)
+ (:place "PLACE" nil org-koma-letter-place)
+ (:location "LOCATION" nil org-koma-letter-location)
+ (:subject "SUBJECT" nil nil parse)
+ (:opening "OPENING" nil org-koma-letter-opening parse)
+ (:closing "CLOSING" nil org-koma-letter-closing parse)
+ (:signature "SIGNATURE" nil org-koma-letter-signature newline)
+ (:special-headings nil "special-headings" org-koma-letter-prefer-special-headings)
+ (:special-tags-as-macro nil nil org-koma-letter-special-tags-as-macro)
+ (:special-tags-in-letter nil nil org-koma-letter-special-tags-in-letter)
+ (:special-tags-after-closing nil "after-closing-order"
+ org-koma-letter-special-tags-after-closing)
+ (:special-tags-after-letter nil "after-letter-order"
+ org-koma-letter-special-tags-after-letter)
+ (:with-backaddress nil "backaddress" org-koma-letter-use-backaddress)
+ (:with-email nil "email" org-koma-letter-use-email)
+ (:with-foldmarks nil "foldmarks" org-koma-letter-use-foldmarks)
+ (:with-phone nil "phone" org-koma-letter-use-phone)
+ (:with-url nil "url" org-koma-letter-use-url)
+ (:with-from-logo nil "from-logo" org-koma-letter-use-from-logo)
+ (:with-place nil "place" org-koma-letter-use-place)
+ (:with-subject nil "subject" org-koma-letter-subject-format)
+ (:with-title-as-subject nil "title-subject" org-koma-letter-prefer-subject)
+ (:with-headline-opening nil nil org-koma-letter-headline-is-opening-maybe)
+ ;; Special properties non-nil when a setting happened in buffer.
+ ;; They are used to prioritize in-buffer settings over "lco"
+ ;; files. See `org-koma-letter-template'.
+ (:inbuffer-author "AUTHOR" nil 'koma-letter:empty)
+ (:inbuffer-from "FROM" nil 'koma-letter:empty)
+ (:inbuffer-email "EMAIL" nil 'koma-letter:empty)
+ (:inbuffer-phone-number "PHONE_NUMBER" nil 'koma-letter:empty)
+ (:inbuffer-url "URL" nil 'koma-letter:empty)
+ (:inbuffer-from-logo "FROM_LOGO" nil 'koma-letter:empty)
+ (:inbuffer-place "PLACE" nil 'koma-letter:empty)
+ (:inbuffer-location "LOCATION" nil 'koma-letter:empty)
+ (:inbuffer-signature "SIGNATURE" nil 'koma-letter:empty)
+ (:inbuffer-with-backaddress nil "backaddress" 'koma-letter:empty)
+ (:inbuffer-with-email nil "email" 'koma-letter:empty)
+ (:inbuffer-with-foldmarks nil "foldmarks" 'koma-letter:empty)
+ (:inbuffer-with-phone nil "phone" 'koma-letter:empty)
+ (:inbuffer-with-url nil "url" 'koma-letter:empty)
+ (:inbuffer-with-from-logo nil "from-logo" 'koma-letter:empty)
+ (:inbuffer-with-place nil "place" 'koma-letter:empty))
+ :translate-alist '((export-block . org-koma-letter-export-block)
+ (export-snippet . org-koma-letter-export-snippet)
+ (headline . org-koma-letter-headline)
+ (keyword . org-koma-letter-keyword)
+ (template . org-koma-letter-template))
+ :menu-entry
+ '(?k "Export with KOMA Scrlttr2"
+ ((?L "As LaTeX buffer" org-koma-letter-export-as-latex)
+ (?l "As LaTeX file" org-koma-letter-export-to-latex)
+ (?p "As PDF file" org-koma-letter-export-to-pdf)
+ (?o "As PDF file and open"
+ (lambda (a s v b)
+ (if a (org-koma-letter-export-to-pdf t s v b)
+ (org-open-file (org-koma-letter-export-to-pdf nil s v b))))))))
+
+
+
+;;; Helper functions
+
+(defun org-koma-letter-email ()
+ "Return the current `user-mail-address'."
+ user-mail-address)
+
+;; The following is taken from/inspired by ox-grof.el
+;; Thanks, Luis!
+
+(defun org-koma-letter--get-tagged-contents (key)
+ "Get contents from a headline tagged with KEY.
+The contents is stored in `org-koma-letter-special-contents'."
+ (let ((value (cdr (assoc-string (org-koma-letter--get-value key)
+ org-koma-letter-special-contents))))
+ (when value (org-string-nw-p (org-trim value)))))
+
+(defun org-koma-letter--get-value (value)
+ "Turn value into a string whenever possible.
+Determines if VALUE is nil, a string, a function or a symbol and
+return a string or nil."
+ (when value
+ (cond ((stringp value) value)
+ ((functionp value) (funcall value))
+ ((symbolp value) (symbol-name value))
+ (t value))))
+
+(defun org-koma-letter--special-contents-inline (keywords info)
+ "Process KEYWORDS members of `org-koma-letter-special-contents'.
+
+KEYWORDS is a list of symbols. Return them as a string to be
+formatted.
+
+The function is used for inserting content of special headings
+such as the one tagged with PS."
+ (mapconcat
+ (lambda (keyword)
+ (let* ((name (org-koma-letter--get-value keyword))
+ (value (org-koma-letter--get-tagged-contents name))
+ (macrop (memq keyword (plist-get info :special-tags-as-macro))))
+ (cond ((not value) nil)
+ (macrop (format "\\%s{%s}\n" name value))
+ (t value))))
+ keywords
+ "\n"))
+
+
+(defun org-koma-letter--add-latex-newlines (string)
+ "Replace regular newlines with LaTeX newlines (i.e. `\\\\')."
+ (let ((str (org-trim string)))
+ (when (org-string-nw-p str)
+ (replace-regexp-in-string "\n" "\\\\\\\\\n" str))))
+
+
+
+;;; Transcode Functions
+
+;;;; Export Block
+
+(defun org-koma-letter-export-block (export-block _contents _info)
+ "Transcode an EXPORT-BLOCK element into KOMA Scrlttr2 code.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (when (member (org-element-property :type export-block)
+ '("KOMA-LETTER" "LATEX"))
+ (org-remove-indentation (org-element-property :value export-block))))
+
+;;;; Export Snippet
+
+(defun org-koma-letter-export-snippet (export-snippet _contents _info)
+ "Transcode an EXPORT-SNIPPET object into KOMA Scrlttr2 code.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (when (memq (org-export-snippet-backend export-snippet) '(latex koma-letter))
+ (org-element-property :value export-snippet)))
+
+;;;; Keyword
+
+(defun org-koma-letter-keyword (keyword contents info)
+ "Transcode a KEYWORD element into KOMA Scrlttr2 code.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (let ((key (org-element-property :key keyword))
+ (value (org-element-property :value keyword)))
+ ;; Handle specifically KOMA-LETTER keywords. Otherwise, fallback
+ ;; to `latex' back-end.
+ (if (equal key "KOMA-LETTER") value
+ (org-export-with-backend 'latex keyword contents info))))
+
+;; Headline
+
+(defun org-koma-letter-headline (headline contents info)
+ "Transcode a HEADLINE element from Org to LaTeX.
+CONTENTS holds the contents of the headline. INFO is a plist
+holding contextual information.
+
+Note that if a headline is tagged with a tag from
+`org-koma-letter-special-tags' it will not be exported, but
+stored in `org-koma-letter-special-contents' and included at the
+appropriate place."
+ (let ((special-tag (org-koma-letter--special-tag headline info)))
+ (if (not special-tag)
+ contents
+ (push (cons special-tag contents) org-koma-letter-special-contents)
+ "")))
+
+(defun org-koma-letter--special-tag (headline info)
+ "Non-nil if HEADLINE is a special headline.
+INFO is a plist holding contextual information. Return first
+special tag headline."
+ (let ((special-tags (append
+ (plist-get info :special-tags-in-letter)
+ (plist-get info :special-tags-after-closing)
+ (plist-get info :special-tags-after-letter))))
+ (cl-some (lambda (tag) (and (assoc-string tag special-tags) tag))
+ (org-export-get-tags headline info))))
+
+(defun org-koma-letter--keyword-or-headline (plist-key pred info)
+ "Return the correct version of opening or closing.
+PLIST-KEY should be a key in info, typically :opening
+or :closing. PRED is a predicate run on headline to determine
+which title to use which takes two arguments, a headline element
+and an info plist. INFO is a plist holding contextual
+information. Return the preferred candidate for the exported of
+PLIST-KEY."
+ (let* ((keyword-candidate (plist-get info plist-key))
+ (headline-candidate (when (and (plist-get info :with-headline-opening)
+ (or (plist-get info :special-headings)
+ (not keyword-candidate)))
+ (org-element-map (plist-get info :parse-tree)
+ 'headline
+ (lambda (h)
+ (and (funcall pred h info)
+ (org-element-property :title h)))
+ info t))))
+ (org-export-data (or headline-candidate keyword-candidate "") info)))
+
+;;;; Template
+
+(defun org-koma-letter-template (contents info)
+ "Return complete document string after KOMA Scrlttr2 conversion.
+CONTENTS is the transcoded contents string. INFO is a plist
+holding export options."
+ (concat
+ ;; Time-stamp.
+ (and (plist-get info :time-stamp-file)
+ (format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
+ ;; LaTeX compiler
+ (org-latex--insert-compiler info)
+ ;; Document class and packages.
+ (org-latex-make-preamble info)
+ ;; Settings. They can come from three locations, in increasing
+ ;; order of precedence: global variables, LCO files and in-buffer
+ ;; settings. Thus, we first insert settings coming from global
+ ;; variables, then we insert LCO files, and, eventually, we insert
+ ;; settings coming from buffer keywords.
+ (org-koma-letter--build-settings 'global info)
+ (mapconcat (lambda (file) (format "\\LoadLetterOption{%s}\n" file))
+ (split-string (or (plist-get info :lco) ""))
+ "")
+ (org-koma-letter--build-settings 'buffer info)
+ ;; Date.
+ (format "\\date{%s}\n" (org-export-data (org-export-get-date info) info))
+ ;; Hyperref, document start, and subject and title.
+ (let* ((with-subject (plist-get info :with-subject))
+ (with-title (plist-get info :with-title))
+ (title-as-subject (and with-subject
+ (plist-get info :with-title-as-subject)))
+ (subject* (org-string-nw-p
+ (org-export-data (plist-get info :subject) info)))
+ (title* (and with-title
+ (org-string-nw-p
+ (org-export-data (plist-get info :title) info))))
+ (subject (cond ((not with-subject) nil)
+ (title-as-subject (or subject* title*))
+ (t subject*)))
+ (title (cond ((not with-title) nil)
+ (title-as-subject (and subject* title*))
+ (t title*)))
+ (hyperref-template (plist-get info :latex-hyperref-template))
+ (spec (append (list (cons ?t (or title subject "")))
+ (org-latex--format-spec info))))
+ (concat
+ (when (and with-subject (not (eq with-subject t)))
+ (format "\\KOMAoption{subject}{%s}\n"
+ (if (symbolp with-subject) with-subject
+ (mapconcat #'symbol-name with-subject ","))))
+ ;; Hyperref.
+ (and (stringp hyperref-template)
+ (format-spec hyperref-template spec))
+ ;; Document start.
+ "\\begin{document}\n\n"
+ ;; Subject and title.
+ (when subject (format "\\setkomavar{subject}{%s}\n" subject))
+ (when title (format "\\setkomavar{title}{%s}\n" title))
+ (when (or (org-string-nw-p title) (org-string-nw-p subject)) "\n")))
+ ;; Letter start.
+ (let ((keyword-val (plist-get info :to-address))
+ (heading-val (org-koma-letter--get-tagged-contents 'to)))
+ (format "\\begin{letter}{%%\n%s}\n\n"
+ (org-koma-letter--add-latex-newlines
+ (or (if (plist-get info :special-headings)
+ (or heading-val keyword-val)
+ (or keyword-val heading-val))
+ "\\mbox{}"))))
+ ;; Opening.
+ (format "\\opening{%s}\n\n"
+ (org-koma-letter--keyword-or-headline
+ :opening
+ (lambda (h i)
+ (not (org-koma-letter--special-tag h i)))
+ info))
+ ;; Letter body.
+ contents
+ ;; Closing.
+ (format "\\closing{%s}\n"
+ (org-koma-letter--keyword-or-headline
+ :closing
+ (lambda (h i)
+ (let ((special-tag (org-koma-letter--special-tag h i)))
+ (and special-tag
+ (string= "closing" special-tag))))
+ info))
+ (org-koma-letter--special-contents-inline
+ (plist-get info :special-tags-after-closing) info)
+ ;; Letter end.
+ "\n\\end{letter}\n"
+ (org-koma-letter--special-contents-inline
+ (plist-get info :special-tags-after-letter) info)
+ ;; Document end.
+ "\n\\end{document}"))
+
+(defun org-koma-letter--build-settings (scope info)
+ "Build settings string according to type.
+SCOPE is either `global' or `buffer'. INFO is a plist used as
+a communication channel."
+ (let* ((check-scope
+ ;; Non-nil value when SETTING was defined in SCOPE.
+ (lambda (setting)
+ (let ((property (intern (format ":inbuffer-%s" setting))))
+ (if (eq scope 'global)
+ (eq (plist-get info property) 'koma-letter:empty)
+ (not (eq (plist-get info property) 'koma-letter:empty))))))
+ (heading-or-key-value
+ (lambda (heading key &optional scoped)
+ (let* ((heading-val
+ (org-koma-letter--get-tagged-contents heading))
+ (key-val (org-string-nw-p (plist-get info key)))
+ (scopedp (funcall check-scope (or scoped heading))))
+ (and (or (and key-val scopedp) heading-val)
+ (not (and (eq scope 'global) heading-val))
+ (if scopedp key-val heading-val))))))
+ (concat
+ ;; Name.
+ (let ((author (plist-get info :author)))
+ (and author
+ (funcall check-scope 'author)
+ (format "\\setkomavar{fromname}{%s}\n"
+ (org-export-data author info))))
+ ;; From.
+ (let ((from (funcall heading-or-key-value 'from :from-address)))
+ (and from
+ (format "\\setkomavar{fromaddress}{%s}\n"
+ (org-koma-letter--add-latex-newlines from))))
+ ;; Email.
+ (let ((email (plist-get info :email)))
+ (and email
+ (funcall check-scope 'email)
+ (format "\\setkomavar{fromemail}{%s}\n" email)))
+ (and (funcall check-scope 'with-email)
+ (format "\\KOMAoption{fromemail}{%s}\n"
+ (if (plist-get info :with-email) "true" "false")))
+ ;; Phone number.
+ (let ((phone-number (plist-get info :phone-number)))
+ (and (org-string-nw-p phone-number)
+ (funcall check-scope 'phone-number)
+ (format "\\setkomavar{fromphone}{%s}\n" phone-number)))
+ (and (funcall check-scope 'with-phone)
+ (format "\\KOMAoption{fromphone}{%s}\n"
+ (if (plist-get info :with-phone) "true" "false")))
+ ;; URL
+ (let ((url (plist-get info :url)))
+ (and (org-string-nw-p url)
+ (funcall check-scope 'url)
+ (format "\\setkomavar{fromurl}{%s}\n" url)))
+ (and (funcall check-scope 'with-url)
+ (format "\\KOMAoption{fromurl}{%s}\n"
+ (if (plist-get info :with-url) "true" "false")))
+ ;; From Logo
+ (let ((from-logo (plist-get info :from-logo)))
+ (and (org-string-nw-p from-logo)
+ (funcall check-scope 'from-logo)
+ (format "\\setkomavar{fromlogo}{%s}\n" from-logo)))
+ (and (funcall check-scope 'with-from-logo)
+ (format "\\KOMAoption{fromlogo}{%s}\n"
+ (if (plist-get info :with-from-logo) "true" "false")))
+ ;; Signature.
+ (let* ((heading-val
+ (and (plist-get info :with-headline-opening)
+ (pcase (org-koma-letter--get-tagged-contents 'closing)
+ ((and (pred org-string-nw-p) closing) (org-trim closing))
+ (_ nil))))
+ (signature (org-string-nw-p (plist-get info :signature)))
+ (signature-scope (funcall check-scope 'signature)))
+ (and (or (and signature signature-scope)
+ heading-val)
+ (not (and (eq scope 'global) heading-val))
+ (format "\\setkomavar{signature}{%s}\n"
+ (if signature-scope signature heading-val))))
+ ;; Back address.
+ (and (funcall check-scope 'with-backaddress)
+ (format "\\KOMAoption{backaddress}{%s}\n"
+ (if (plist-get info :with-backaddress) "true" "false")))
+ ;; Place.
+ (let ((with-place-set (funcall check-scope 'with-place))
+ (place-set (funcall check-scope 'place)))
+ (and (or (and with-place-set place-set)
+ (and (eq scope 'buffer) (or with-place-set place-set)))
+ (format "\\setkomavar{place}{%s}\n"
+ (if (plist-get info :with-place) (plist-get info :place)
+ ""))))
+ ;; Location.
+ (let ((location (funcall heading-or-key-value 'location :location)))
+ (and location
+ (format "\\setkomavar{location}{%s}\n" location)))
+ ;; Folding marks.
+ (and (funcall check-scope 'with-foldmarks)
+ (let ((foldmarks (plist-get info :with-foldmarks)))
+ (cond ((consp foldmarks)
+ (format "\\KOMAoptions{foldmarks=true,foldmarks=%s}\n"
+ (mapconcat #'symbol-name foldmarks "")))
+ (foldmarks "\\KOMAoptions{foldmarks=true}\n")
+ (t "\\KOMAoptions{foldmarks=false}\n")))))))
+
+
+
+;;; Commands
+
+;;;###autoload
+(defun org-koma-letter-export-as-latex
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer as a KOMA Scrlttr2 letter.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{letter}\" and \"\\end{letter}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Export is done in a buffer named \"*Org KOMA-LETTER Export*\". It
+will be displayed if `org-export-show-temporary-export-buffer' is
+non-nil."
+ (interactive)
+ (let (org-koma-letter-special-contents)
+ (org-export-to-buffer 'koma-letter "*Org KOMA-LETTER Export*"
+ async subtreep visible-only body-only ext-plist
+ (lambda () (LaTeX-mode)))))
+
+;;;###autoload
+(defun org-koma-letter-export-to-latex
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer as a KOMA Scrlttr2 letter (tex).
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{letter}\" and \"\\end{letter}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+When optional argument PUB-DIR is set, use it as the publishing
+directory.
+
+Return output file's name."
+ (interactive)
+ (let ((outfile (org-export-output-file-name ".tex" subtreep))
+ (org-koma-letter-special-contents))
+ (org-export-to-file 'koma-letter outfile
+ async subtreep visible-only body-only ext-plist)))
+
+;;;###autoload
+(defun org-koma-letter-export-to-pdf
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer as a KOMA Scrlttr2 letter (pdf).
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{letter}\" and \"\\end{letter}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return PDF file's name."
+ (interactive)
+ (let ((file (org-export-output-file-name ".tex" subtreep))
+ (org-koma-letter-special-contents))
+ (org-export-to-file 'koma-letter file
+ async subtreep visible-only body-only ext-plist
+ #'org-latex-compile)))
+
+
+(provide 'ox-koma-letter)
+;;; ox-koma-letter.el ends here
diff --git a/elpa/org-9.5.2/ox-koma-letter.elc b/elpa/org-9.5.2/ox-koma-letter.elc
new file mode 100644
index 0000000..4eda30c
--- /dev/null
+++ b/elpa/org-9.5.2/ox-koma-letter.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ox-latex.el b/elpa/org-9.5.2/ox-latex.el
new file mode 100644
index 0000000..c45dc98
--- /dev/null
+++ b/elpa/org-9.5.2/ox-latex.el
@@ -0,0 +1,3828 @@
+;;; ox-latex.el --- LaTeX Back-End for Org Export Engine -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <n.goaziou at gmail dot com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; See Org manual for details.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ox)
+(require 'ox-publish)
+
+;;; Function Declarations
+
+(defvar org-latex-default-packages-alist)
+(defvar org-latex-packages-alist)
+(defvar orgtbl-exp-regexp)
+
+
+
+;;; Define Back-End
+
+(org-export-define-backend 'latex
+ '((bold . org-latex-bold)
+ (center-block . org-latex-center-block)
+ (clock . org-latex-clock)
+ (code . org-latex-code)
+ (drawer . org-latex-drawer)
+ (dynamic-block . org-latex-dynamic-block)
+ (entity . org-latex-entity)
+ (example-block . org-latex-example-block)
+ (export-block . org-latex-export-block)
+ (export-snippet . org-latex-export-snippet)
+ (fixed-width . org-latex-fixed-width)
+ (footnote-definition . org-latex-footnote-definition)
+ (footnote-reference . org-latex-footnote-reference)
+ (headline . org-latex-headline)
+ (horizontal-rule . org-latex-horizontal-rule)
+ (inline-src-block . org-latex-inline-src-block)
+ (inlinetask . org-latex-inlinetask)
+ (italic . org-latex-italic)
+ (item . org-latex-item)
+ (keyword . org-latex-keyword)
+ (latex-environment . org-latex-latex-environment)
+ (latex-fragment . org-latex-latex-fragment)
+ (line-break . org-latex-line-break)
+ (link . org-latex-link)
+ (node-property . org-latex-node-property)
+ (paragraph . org-latex-paragraph)
+ (plain-list . org-latex-plain-list)
+ (plain-text . org-latex-plain-text)
+ (planning . org-latex-planning)
+ (property-drawer . org-latex-property-drawer)
+ (quote-block . org-latex-quote-block)
+ (radio-target . org-latex-radio-target)
+ (section . org-latex-section)
+ (special-block . org-latex-special-block)
+ (src-block . org-latex-src-block)
+ (statistics-cookie . org-latex-statistics-cookie)
+ (strike-through . org-latex-strike-through)
+ (subscript . org-latex-subscript)
+ (superscript . org-latex-superscript)
+ (table . org-latex-table)
+ (table-cell . org-latex-table-cell)
+ (table-row . org-latex-table-row)
+ (target . org-latex-target)
+ (template . org-latex-template)
+ (timestamp . org-latex-timestamp)
+ (underline . org-latex-underline)
+ (verbatim . org-latex-verbatim)
+ (verse-block . org-latex-verse-block)
+ ;; Pseudo objects and elements.
+ (latex-math-block . org-latex-math-block)
+ (latex-matrices . org-latex-matrices))
+ :menu-entry
+ '(?l "Export to LaTeX"
+ ((?L "As LaTeX buffer" org-latex-export-as-latex)
+ (?l "As LaTeX file" org-latex-export-to-latex)
+ (?p "As PDF file" org-latex-export-to-pdf)
+ (?o "As PDF file and open"
+ (lambda (a s v b)
+ (if a (org-latex-export-to-pdf t s v b)
+ (org-open-file (org-latex-export-to-pdf nil s v b)))))))
+ :filters-alist '((:filter-options . org-latex-math-block-options-filter)
+ (:filter-paragraph . org-latex-clean-invalid-line-breaks)
+ (:filter-parse-tree org-latex-math-block-tree-filter
+ org-latex-matrices-tree-filter
+ org-latex-image-link-filter)
+ (:filter-verse-block . org-latex-clean-invalid-line-breaks))
+ :options-alist
+ '((:latex-class "LATEX_CLASS" nil org-latex-default-class t)
+ (:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t)
+ (:latex-header "LATEX_HEADER" nil nil newline)
+ (:latex-header-extra "LATEX_HEADER_EXTRA" nil nil newline)
+ (:description "DESCRIPTION" nil nil parse)
+ (:keywords "KEYWORDS" nil nil parse)
+ (:subtitle "SUBTITLE" nil nil parse)
+ ;; Other variables.
+ (:latex-active-timestamp-format nil nil org-latex-active-timestamp-format)
+ (:latex-caption-above nil nil org-latex-caption-above)
+ (:latex-classes nil nil org-latex-classes)
+ (:latex-default-figure-position nil nil org-latex-default-figure-position)
+ (:latex-default-table-environment nil nil org-latex-default-table-environment)
+ (:latex-default-quote-environment nil nil org-latex-default-quote-environment)
+ (:latex-default-table-mode nil nil org-latex-default-table-mode)
+ (:latex-diary-timestamp-format nil nil org-latex-diary-timestamp-format)
+ (:latex-footnote-defined-format nil nil org-latex-footnote-defined-format)
+ (:latex-footnote-separator nil nil org-latex-footnote-separator)
+ (:latex-format-drawer-function nil nil org-latex-format-drawer-function)
+ (:latex-format-headline-function nil nil org-latex-format-headline-function)
+ (:latex-format-inlinetask-function nil nil org-latex-format-inlinetask-function)
+ (:latex-hyperref-template nil nil org-latex-hyperref-template t)
+ (:latex-image-default-scale nil nil org-latex-image-default-scale)
+ (:latex-image-default-height nil nil org-latex-image-default-height)
+ (:latex-image-default-option nil nil org-latex-image-default-option)
+ (:latex-image-default-width nil nil org-latex-image-default-width)
+ (:latex-images-centered nil nil org-latex-images-centered)
+ (:latex-inactive-timestamp-format nil nil org-latex-inactive-timestamp-format)
+ (:latex-inline-image-rules nil nil org-latex-inline-image-rules)
+ (:latex-link-with-unknown-path-format nil nil org-latex-link-with-unknown-path-format)
+ (:latex-listings nil nil org-latex-listings)
+ (:latex-listings-langs nil nil org-latex-listings-langs)
+ (:latex-listings-options nil nil org-latex-listings-options)
+ (:latex-minted-langs nil nil org-latex-minted-langs)
+ (:latex-minted-options nil nil org-latex-minted-options)
+ (:latex-prefer-user-labels nil nil org-latex-prefer-user-labels)
+ (:latex-subtitle-format nil nil org-latex-subtitle-format)
+ (:latex-subtitle-separate nil nil org-latex-subtitle-separate)
+ (:latex-table-scientific-notation nil nil org-latex-table-scientific-notation)
+ (:latex-tables-booktabs nil nil org-latex-tables-booktabs)
+ (:latex-tables-centered nil nil org-latex-tables-centered)
+ (:latex-text-markup-alist nil nil org-latex-text-markup-alist)
+ (:latex-title-command nil nil org-latex-title-command)
+ (:latex-toc-command nil nil org-latex-toc-command)
+ (:latex-compiler "LATEX_COMPILER" nil org-latex-compiler)
+ ;; Redefine regular options.
+ (:date "DATE" nil "\\today" parse)))
+
+
+
+;;; Internal Variables
+
+(defconst org-latex-babel-language-alist
+ '(("af" . "afrikaans")
+ ("bg" . "bulgarian")
+ ("ca" . "catalan")
+ ("cs" . "czech")
+ ("cy" . "welsh")
+ ("da" . "danish")
+ ("de" . "germanb")
+ ("de-at" . "naustrian")
+ ("de-de" . "ngerman")
+ ("el" . "greek")
+ ("en" . "english")
+ ("en-au" . "australian")
+ ("en-ca" . "canadian")
+ ("en-gb" . "british")
+ ("en-ie" . "irish")
+ ("en-nz" . "newzealand")
+ ("en-us" . "american")
+ ("es" . "spanish")
+ ("et" . "estonian")
+ ("eu" . "basque")
+ ("fi" . "finnish")
+ ("fr" . "french")
+ ("fr-ca" . "canadien")
+ ("gl" . "galician")
+ ("hr" . "croatian")
+ ("hu" . "hungarian")
+ ("id" . "indonesian")
+ ("is" . "icelandic")
+ ("it" . "italian")
+ ("la" . "latin")
+ ("ms" . "malay")
+ ("nl" . "dutch")
+ ("nb" . "norsk")
+ ("nn" . "nynorsk")
+ ("no" . "norsk")
+ ("pl" . "polish")
+ ("pt" . "portuguese")
+ ("pt-br" . "brazilian")
+ ("ro" . "romanian")
+ ("ru" . "russian")
+ ("sa" . "sanskrit")
+ ("sb" . "uppersorbian")
+ ("sk" . "slovak")
+ ("sl" . "slovene")
+ ("sq" . "albanian")
+ ("sr" . "serbian")
+ ("sv" . "swedish")
+ ("ta" . "tamil")
+ ("tr" . "turkish")
+ ("uk" . "ukrainian"))
+ "Alist between language code and corresponding Babel option.")
+
+(defconst org-latex-polyglossia-language-alist
+ '(("am" "amharic")
+ ("ar" "arabic")
+ ("ast" "asturian")
+ ("bg" "bulgarian")
+ ("bn" "bengali")
+ ("bo" "tibetan")
+ ("br" "breton")
+ ("ca" "catalan")
+ ("cop" "coptic")
+ ("cs" "czech")
+ ("cy" "welsh")
+ ("da" "danish")
+ ("de" "german" "german")
+ ("de-at" "german" "austrian")
+ ("de-de" "german" "german")
+ ("dsb" "lsorbian")
+ ("dv" "divehi")
+ ("el" "greek")
+ ("en" "english" "usmax")
+ ("en-au" "english" "australian")
+ ("en-gb" "english" "uk")
+ ("en-nz" "english" "newzealand")
+ ("en-us" "english" "usmax")
+ ("eo" "esperanto")
+ ("es" "spanish")
+ ("et" "estonian")
+ ("eu" "basque")
+ ("fa" "farsi")
+ ("fi" "finnish")
+ ("fr" "french")
+ ("fu" "friulan")
+ ("ga" "irish")
+ ("gd" "scottish")
+ ("gl" "galician")
+ ("he" "hebrew")
+ ("hi" "hindi")
+ ("hr" "croatian")
+ ("hsb" "usorbian")
+ ("hu" "magyar")
+ ("hy" "armenian")
+ ("ia" "interlingua")
+ ("id" "bahasai")
+ ("is" "icelandic")
+ ("it" "italian")
+ ("kn" "kannada")
+ ("la" "latin" "modern")
+ ("la-classic" "latin" "classic")
+ ("la-medieval" "latin" "medieval")
+ ("la-modern" "latin" "modern")
+ ("lo" "lao")
+ ("lt" "lithuanian")
+ ("lv" "latvian")
+ ("ml" "malayalam")
+ ("mr" "maranthi")
+ ("nb" "norsk")
+ ("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")
+ ("se" "samin")
+ ("sk" "slovak")
+ ("sl" "slovenian")
+ ("sq" "albanian")
+ ("sr" "serbian")
+ ("sv" "swedish")
+ ("syr" "syriac")
+ ("ta" "tamil")
+ ("te" "telugu")
+ ("th" "thai")
+ ("tk" "turkmen")
+ ("tr" "turkish")
+ ("uk" "ukrainian")
+ ("ur" "urdu")
+ ("vi" "vietnamese"))
+ "Alist between language code and corresponding Polyglossia option.")
+
+(defconst org-latex-table-matrix-macros '(("bordermatrix" . "\\cr")
+ ("qbordermatrix" . "\\cr")
+ ("kbordermatrix" . "\\\\"))
+ "Alist between matrix macros and their row ending.")
+
+(defconst org-latex-math-environments-re
+ (format
+ "\\`[ \t]*\\\\begin{%s\\*?}"
+ (regexp-opt
+ '("equation" "eqnarray" "math" "displaymath"
+ "align" "gather" "multline" "flalign" "alignat"
+ "xalignat" "xxalignat"
+ "subequations"
+ ;; breqn
+ "dmath" "dseries" "dgroup" "darray"
+ ;; empheq
+ "empheq")))
+ "Regexp of LaTeX math environments.")
+
+
+;;; User Configurable Variables
+
+(defgroup org-export-latex nil
+ "Options for exporting Org mode files to LaTeX."
+ :tag "Org Export LaTeX"
+ :group 'org-export)
+
+;;;; Generic
+
+(defcustom org-latex-caption-above '(table)
+ "When non-nil, place caption string at the beginning of elements.
+Otherwise, place it near the end. When value is a list of
+symbols, put caption above selected elements only. Allowed
+symbols are: `image', `table', `src-block' and `special-block'."
+ :group 'org-export-latex
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(choice
+ (const :tag "For all elements" t)
+ (const :tag "For no element" nil)
+ (set :tag "For the following elements only" :greedy t
+ (const :tag "Images" image)
+ (const :tag "Tables" table)
+ (const :tag "Source code" src-block)
+ (const :tag "Special blocks" special-block))))
+
+(defcustom org-latex-prefer-user-labels nil
+ "Use user-provided labels instead of internal ones when non-nil.
+
+When this variable is non-nil, Org will use the value of
+CUSTOM_ID property, NAME keyword or Org target as the key for the
+\\label commands generated.
+
+By default, Org generates its own internal labels during LaTeX
+export. This process ensures that the \\label keys are unique
+and valid, but it means the keys are not available in advance of
+the export process.
+
+Setting this variable gives you control over how Org generates
+labels during LaTeX export, so that you may know their keys in
+advance. One reason to do this is that it allows you to refer to
+various elements using a single label both in Org's link syntax
+and in embedded LaTeX code.
+
+For example, when this variable is non-nil, a headline like this:
+
+ ** Some section
+ :PROPERTIES:
+ :CUSTOM_ID: sec:foo
+ :END:
+ This is section [[#sec:foo]].
+ #+BEGIN_EXPORT latex
+ And this is still section \\ref{sec:foo}.
+ #+END_EXPORT
+
+will be exported to LaTeX as:
+
+ \\subsection{Some section}
+ \\label{sec:foo}
+ This is section \\ref{sec:foo}.
+ And this is still section \\ref{sec:foo}.
+
+A non-default value of `org-latex-reference-command' will change the
+command (\\ref by default) used to create label references.
+
+Note, however, that setting this variable introduces a limitation
+on the possible values for CUSTOM_ID and NAME. When this
+variable is non-nil, Org passes their value to \\label unchanged.
+You are responsible for ensuring that the value is a valid LaTeX
+\\label key, and that no other \\label commands with the same key
+appear elsewhere in your document. (Keys may contain letters,
+numbers, and the following punctuation: `_' `.' `-' `:'.) There
+are no such limitations on CUSTOM_ID and NAME when this variable
+is nil.
+
+For headlines that do not define the CUSTOM_ID property or
+elements without a NAME, Org will continue to use its default
+labeling scheme to generate labels and resolve links into proper
+references."
+ :group 'org-export-latex
+ :type 'boolean
+ :version "26.1"
+ :package-version '(Org . "8.3"))
+
+(defcustom org-latex-reference-command "\\ref{%s}"
+ "Format string that takes a reference to produce a LaTeX reference command.
+
+The reference is a label such as sec:intro. A format string of \"\\ref{%s}\"
+produces numbered references and will always work. It may be desirable to make
+use of a package such as hyperref or cleveref and then change the format string
+to \"\\autoref{%s}\" or \"\\cref{%s}\" for example."
+ :group 'org-export-latex
+ :type 'string
+ :package-version '(Org . "9.5")
+ :safe #'stringp)
+
+;;;; Preamble
+
+(defcustom org-latex-default-class "article"
+ "The default LaTeX class."
+ :group 'org-export-latex
+ :type '(string :tag "LaTeX class"))
+
+(defcustom org-latex-classes
+ '(("article"
+ "\\documentclass[11pt]{article}"
+ ("\\section{%s}" . "\\section*{%s}")
+ ("\\subsection{%s}" . "\\subsection*{%s}")
+ ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
+ ("\\paragraph{%s}" . "\\paragraph*{%s}")
+ ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
+ ("report"
+ "\\documentclass[11pt]{report}"
+ ("\\part{%s}" . "\\part*{%s}")
+ ("\\chapter{%s}" . "\\chapter*{%s}")
+ ("\\section{%s}" . "\\section*{%s}")
+ ("\\subsection{%s}" . "\\subsection*{%s}")
+ ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
+ ("book"
+ "\\documentclass[11pt]{book}"
+ ("\\part{%s}" . "\\part*{%s}")
+ ("\\chapter{%s}" . "\\chapter*{%s}")
+ ("\\section{%s}" . "\\section*{%s}")
+ ("\\subsection{%s}" . "\\subsection*{%s}")
+ ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
+ "Alist of LaTeX classes and associated header and structure.
+If #+LATEX_CLASS is set in the buffer, use its value and the
+associated information. Here is the structure of each cell:
+
+ (class-name
+ header-string
+ (numbered-section . unnumbered-section)
+ ...)
+
+The header string
+-----------------
+
+The HEADER-STRING is the header that will be inserted into the
+LaTeX file. It should contain the \\documentclass macro, and
+anything else that is needed for this setup. To this header, the
+following commands will be added:
+
+- Calls to \\usepackage for all packages mentioned in the
+ variables `org-latex-default-packages-alist' and
+ `org-latex-packages-alist'. Thus, your header definitions
+ should avoid to also request these packages.
+
+- Lines specified via \"#+LATEX_HEADER:\" and
+ \"#+LATEX_HEADER_EXTRA:\" keywords.
+
+If you need more control about the sequence in which the header
+is built up, or if you want to exclude one of these building
+blocks for a particular class, you can use the following
+macro-like placeholders.
+
+ [DEFAULT-PACKAGES] \\usepackage statements for default packages
+ [NO-DEFAULT-PACKAGES] do not include any of the default packages
+ [PACKAGES] \\usepackage statements for packages
+ [NO-PACKAGES] do not include the packages
+ [EXTRA] the stuff from #+LATEX_HEADER(_EXTRA)
+ [NO-EXTRA] do not include #+LATEX_HEADER(_EXTRA) stuff
+
+So a header like
+
+ \\documentclass{article}
+ [NO-DEFAULT-PACKAGES]
+ [EXTRA]
+ \\providecommand{\\alert}[1]{\\textbf{#1}}
+ [PACKAGES]
+
+will omit the default packages, and will include the
+#+LATEX_HEADER and #+LATEX_HEADER_EXTRA lines, then have a call
+to \\providecommand, and then place \\usepackage commands based
+on the content of `org-latex-packages-alist'.
+
+If your header, `org-latex-default-packages-alist' or
+`org-latex-packages-alist' inserts \"\\usepackage[AUTO]{inputenc}\",
+AUTO will automatically be replaced with a coding system derived
+from `buffer-file-coding-system'. See also the variable
+`org-latex-inputenc-alist' for a way to influence this mechanism.
+
+Likewise, if your header contains \"\\usepackage[AUTO]{babel}\"
+or \"\\usepackage[AUTO]{polyglossia}\", AUTO will be replaced
+with the language related to the language code specified by
+`org-export-default-language'. Note that constructions such as
+\"\\usepackage[french,AUTO,english]{babel}\" are permitted. For
+Polyglossia the language will be set via the macros
+\"\\setmainlanguage\" and \"\\setotherlanguage\". See also
+`org-latex-guess-babel-language' and
+`org-latex-guess-polyglossia-language'.
+
+The sectioning structure
+------------------------
+
+The sectioning structure of the class is given by the elements
+following the header string. For each sectioning level, a number
+of strings is specified. A %s formatter is mandatory in each
+section string and will be replaced by the title of the section.
+
+Instead of a cons cell (numbered . unnumbered), you can also
+provide a list of 2 or 4 elements,
+
+ (numbered-open numbered-close)
+
+or
+
+ (numbered-open numbered-close unnumbered-open unnumbered-close)
+
+providing opening and closing strings for a LaTeX environment
+that should represent the document section. The opening clause
+should have a %s to represent the section title.
+
+Instead of a list of sectioning commands, you can also specify
+a function name. That function will be called with two
+parameters, the (reduced) level of the headline, and a predicate
+non-nil when the headline should be numbered. It must return
+a format string in which the section title will be added."
+ :group 'org-export-latex
+ :type '(repeat
+ (list (string :tag "LaTeX class")
+ (string :tag "LaTeX header")
+ (repeat :tag "Levels" :inline t
+ (choice
+ (cons :tag "Heading"
+ (string :tag " numbered")
+ (string :tag "unnumbered"))
+ (list :tag "Environment"
+ (string :tag "Opening (numbered)")
+ (string :tag "Closing (numbered)")
+ (string :tag "Opening (unnumbered)")
+ (string :tag "Closing (unnumbered)"))
+ (function :tag "Hook computing sectioning"))))))
+
+(defcustom org-latex-inputenc-alist nil
+ "Alist of inputenc coding system names, and what should really be used.
+For example, adding an entry
+
+ (\"utf8\" . \"utf8x\")
+
+will cause \\usepackage[utf8x]{inputenc} to be used for buffers that
+are written as utf8 files."
+ :group 'org-export-latex
+ :type '(repeat
+ (cons
+ (string :tag "Derived from buffer")
+ (string :tag "Use this instead"))))
+
+(defcustom org-latex-title-command "\\maketitle"
+ "The command used to insert the title just after \\begin{document}.
+
+This format string may contain these elements:
+
+ %a for AUTHOR keyword
+ %t for TITLE keyword
+ %s for SUBTITLE keyword
+ %k for KEYWORDS line
+ %d for DESCRIPTION line
+ %c for CREATOR line
+ %l for Language keyword
+ %L for capitalized language keyword
+ %D for DATE keyword
+
+If you need to use a \"%\" character, you need to escape it
+like that: \"%%\".
+
+Setting :latex-title-command in publishing projects will take
+precedence over this variable."
+ :group 'org-export-latex
+ :type '(string :tag "Format string"))
+
+(defcustom org-latex-subtitle-format "\\\\\\medskip\n\\large %s"
+ "Format string used for transcoded subtitle.
+The format string should have at most one \"%s\"-expression,
+which is replaced with the subtitle."
+ :group 'org-export-latex
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(string :tag "Format string"))
+
+(defcustom org-latex-subtitle-separate nil
+ "Non-nil means the subtitle is not typeset as part of title."
+ :group 'org-export-latex
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'boolean)
+
+(defcustom org-latex-toc-command "\\tableofcontents\n\n"
+ "LaTeX command to set the table of contents, list of figures, etc.
+This command only applies to the table of contents generated with
+the toc:nil option, not to those generated with #+TOC keyword."
+ :group 'org-export-latex
+ :type 'string)
+
+(defcustom org-latex-hyperref-template
+ "\\hypersetup{\n pdfauthor={%a},\n pdftitle={%t},\n pdfkeywords={%k},
+ pdfsubject={%d},\n pdfcreator={%c}, \n pdflang={%L}}\n"
+ "Template for hyperref package options.
+
+This format string may contain these elements:
+
+ %a for AUTHOR keyword
+ %t for TITLE keyword
+ %s for SUBTITLE keyword
+ %k for KEYWORDS line
+ %d for DESCRIPTION line
+ %c for CREATOR line
+ %l for Language keyword
+ %L for capitalized language keyword
+ %D for DATE keyword
+
+If you need to use a \"%\" character, you need to escape it
+like that: \"%%\".
+
+As a special case, a nil value prevents template from being
+inserted.
+
+Setting :latex-hyperref-template in publishing projects will take
+precedence over this variable."
+ :group 'org-export-latex
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(choice (const :tag "No template" nil)
+ (string :tag "Format string")))
+
+;;;; Headline
+
+(defcustom org-latex-format-headline-function
+ 'org-latex-format-headline-default-function
+ "Function for formatting the headline's text.
+
+This function will be called with six arguments:
+TODO the todo keyword (string or nil)
+TODO-TYPE the type of todo (symbol: `todo', `done', nil)
+PRIORITY the priority of the headline (integer or nil)
+TEXT the main headline text (string)
+TAGS the tags (list of strings or nil)
+INFO the export options (plist)
+
+The function result will be used in the section format string."
+ :group 'org-export-latex
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'function)
+
+
+;;;; Footnotes
+
+(defcustom org-latex-footnote-separator "\\textsuperscript{,}\\,"
+ "Text used to separate footnotes."
+ :group 'org-export-latex
+ :type 'string)
+
+(defcustom org-latex-footnote-defined-format "\\textsuperscript{\\ref{%s}}"
+ "Format string used to format reference to footnote already defined.
+%s will be replaced by the label of the referred footnote."
+ :group 'org-export-latex
+ :type '(choice
+ (const :tag "Use plain superscript (default)" "\\textsuperscript{\\ref{%s}}")
+ (const :tag "Use Memoir/KOMA-Script footref" "\\footref{%s}")
+ (string :tag "Other format string"))
+ :version "26.1"
+ :package-version '(Org . "9.0"))
+
+;;;; Timestamps
+
+(defcustom org-latex-active-timestamp-format "\\textit{%s}"
+ "A printf format string to be applied to active timestamps."
+ :group 'org-export-latex
+ :type 'string)
+
+(defcustom org-latex-inactive-timestamp-format "\\textit{%s}"
+ "A printf format string to be applied to inactive timestamps."
+ :group 'org-export-latex
+ :type 'string)
+
+(defcustom org-latex-diary-timestamp-format "\\textit{%s}"
+ "A printf format string to be applied to diary timestamps."
+ :group 'org-export-latex
+ :type 'string)
+
+
+;;;; Links
+
+(defcustom org-latex-images-centered t
+ "When non-nil, images are centered."
+ :group 'org-export-latex
+ :version "26.1"
+ :package-version '(Org . "9.0")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-latex-image-default-option ""
+ "Default option for images."
+ :group 'org-export-latex
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string)
+
+(defcustom org-latex-image-default-width ".9\\linewidth"
+ "Default width for images.
+This value will not be used if a height is provided."
+ :group 'org-export-latex
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string)
+
+(defcustom org-latex-image-default-scale ""
+ "Default scale for images.
+This value will not be used if a width or a scale is provided,
+or if the image is wrapped within a \"wrapfigure\" environment.
+Scale overrides width and height."
+ :group 'org-export-latex
+ :package-version '(Org . "9.3")
+ :type 'string
+ :safe #'stringp)
+
+(defcustom org-latex-image-default-height ""
+ "Default height for images.
+This value will not be used if a width is provided, or if the
+image is wrapped within a \"figure\" or \"wrapfigure\"
+environment."
+ :group 'org-export-latex
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string)
+
+(defcustom org-latex-default-figure-position "htbp"
+ "Default position for LaTeX figures."
+ :group 'org-export-latex
+ :type 'string
+ :version "26.1"
+ :package-version '(Org . "9.0")
+ :safe #'stringp)
+
+(defcustom org-latex-inline-image-rules
+ `(("file" . ,(rx "."
+ (or "pdf" "jpeg" "jpg" "png" "ps" "eps" "tikz" "pgf" "svg")
+ eos)))
+ "Rules characterizing image files that can be inlined into LaTeX.
+
+A rule consists in an association whose key is the type of link
+to consider, and value is a regexp that will be matched against
+link's path.
+
+Note that, by default, the image extension *actually* allowed
+depend on the way the LaTeX file is processed. When used with
+pdflatex, pdf, jpg and png images are OK. When processing
+through dvi to Postscript, only ps and eps are allowed. The
+default we use here encompasses both."
+ :group 'org-export-latex
+ :package-version '(Org . "9.4")
+ :type '(alist :key-type (string :tag "Type")
+ :value-type (regexp :tag "Path")))
+
+(defcustom org-latex-link-with-unknown-path-format "\\texttt{%s}"
+ "Format string for links with unknown path type."
+ :group 'org-export-latex
+ :type 'string)
+
+
+;;;; Tables
+
+(defcustom org-latex-default-table-environment "tabular"
+ "Default environment used to build tables."
+ :group 'org-export-latex
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'string)
+
+(defcustom org-latex-default-quote-environment "quote"
+ "Default environment used to `quote' blocks."
+ :group 'org-export-latex
+ :package-version '(Org . "9.5")
+ :type 'string
+ :safe #'stringp)
+
+(defcustom org-latex-default-table-mode 'table
+ "Default mode for tables.
+
+Value can be a symbol among:
+
+ `table' Regular LaTeX table.
+
+ `math' In this mode, every cell is considered as being in math
+ mode and the complete table will be wrapped within a math
+ environment. It is particularly useful to write matrices.
+
+ `inline-math' This mode is almost the same as `math', but the
+ math environment will be inlined.
+
+ `verbatim' The table is exported as it appears in the Org
+ buffer, within a verbatim environment.
+
+This value can be overridden locally with, i.e. \":mode math\" in
+LaTeX attributes.
+
+When modifying this variable, it may be useful to change
+`org-latex-default-table-environment' accordingly."
+ :group 'org-export-latex
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice (const :tag "Table" table)
+ (const :tag "Matrix" math)
+ (const :tag "Inline matrix" inline-math)
+ (const :tag "Verbatim" verbatim))
+ :safe (lambda (s) (memq s '(table math inline-math verbatim))))
+
+(defcustom org-latex-tables-centered t
+ "When non-nil, tables are exported in a center environment."
+ :group 'org-export-latex
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-latex-tables-booktabs nil
+ "When non-nil, display tables in a formal \"booktabs\" style.
+This option assumes that the \"booktabs\" package is properly
+loaded in the header of the document. This value can be ignored
+locally with \":booktabs t\" and \":booktabs nil\" LaTeX
+attributes."
+ :group 'org-export-latex
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean
+ :safe #'booleanp)
+
+(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}\").
+
+When nil, no transformation is made."
+ :group 'org-export-latex
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (string :tag "Format string")
+ (const :tag "No formatting" nil)))
+
+;;;; Text markup
+
+(defcustom org-latex-text-markup-alist '((bold . "\\textbf{%s}")
+ (code . protectedtexttt)
+ (italic . "\\emph{%s}")
+ (strike-through . "\\sout{%s}")
+ (underline . "\\uline{%s}")
+ (verbatim . protectedtexttt))
+ "Alist of LaTeX expressions to convert text markup.
+
+The key must be a symbol among `bold', `code', `italic',
+`strike-through', `underline' and `verbatim'. The value is
+a formatting string to wrap fontified text with.
+
+Value can also be set to the following symbols: `verb' and
+`protectedtexttt'. For the former, Org will use \"\\verb\" to
+create a format string and select a delimiter character that
+isn't in the string. For the latter, Org will use \"\\texttt\"
+to typeset and try to protect special characters.
+
+If no association can be found for a given markup, text will be
+returned as-is."
+ :group 'org-export-latex
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'alist
+ :options '(bold code italic strike-through underline verbatim))
+
+
+;;;; Drawers
+
+(defcustom org-latex-format-drawer-function (lambda (_ contents) contents)
+ "Function called to format a drawer in LaTeX code.
+
+The function must accept two parameters:
+ NAME the drawer name, like \"LOGBOOK\"
+ CONTENTS the contents of the drawer.
+
+The function should return the string to be exported.
+
+The default function simply returns the value of CONTENTS."
+ :group 'org-export-latex
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'function)
+
+
+;;;; Inlinetasks
+
+(defcustom org-latex-format-inlinetask-function
+ 'org-latex-format-inlinetask-default-function
+ "Function called to format an inlinetask in LaTeX code.
+
+The function must accept seven parameters:
+ TODO the todo keyword (string or nil)
+ TODO-TYPE the todo type (symbol: `todo', `done', nil)
+ PRIORITY the inlinetask priority (integer or nil)
+ NAME the inlinetask name (string)
+ TAGS the inlinetask tags (list of strings or nil)
+ CONTENTS the contents of the inlinetask (string or nil)
+ INFO the export options (plist)
+
+The function should return the string to be exported."
+ :group 'org-export-latex
+ :type 'function
+ :version "26.1"
+ :package-version '(Org . "8.3"))
+
+
+;; Src blocks
+
+(defcustom org-latex-listings nil
+ "Non-nil means export source code using the listings package.
+
+This package will fontify source code, possibly even with color.
+If you want to use this, you also need to make LaTeX use the
+listings package, and if you want to have color, the color
+package. Just add these to `org-latex-packages-alist', for
+example using customize, or with something like:
+
+ (require \\='ox-latex)
+ (add-to-list \\='org-latex-packages-alist \\='(\"\" \"listings\"))
+ (add-to-list \\='org-latex-packages-alist \\='(\"\" \"color\"))
+
+Alternatively,
+
+ (setq org-latex-listings \\='minted)
+
+causes source code to be exported using the minted package as
+opposed to listings. If you want to use minted, you need to add
+the minted package to `org-latex-packages-alist', for example
+using customize, or with
+
+ (require \\='ox-latex)
+ (add-to-list \\='org-latex-packages-alist \\='(\"newfloat\" \"minted\"))
+
+In addition, it is necessary to install pygments
+\(URL `https://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
+URL `https://orgmode.org/worg/org-tutorials/org-latex-preview.html'."
+ :group 'org-export-latex
+ :type '(choice
+ (const :tag "Use listings" t)
+ (const :tag "Use minted" minted)
+ (const :tag "Export verbatim" nil))
+ :safe (lambda (s) (memq s '(t nil minted))))
+
+(defcustom org-latex-listings-langs
+ '((emacs-lisp "Lisp") (lisp "Lisp") (clojure "Lisp")
+ (c "C") (cc "C++")
+ (fortran "fortran")
+ (perl "Perl") (cperl "Perl") (python "Python") (ruby "Ruby")
+ (html "HTML") (xml "XML")
+ (tex "TeX") (latex "[LaTeX]TeX")
+ (shell-script "bash")
+ (gnuplot "Gnuplot")
+ (ocaml "[Objective]Caml") (caml "Caml")
+ (sql "SQL") (sqlite "sql")
+ (makefile "make")
+ (R "r"))
+ "Alist mapping languages to their listing language counterpart.
+The key is a symbol, the major mode symbol without the \"-mode\".
+The value is the string that should be inserted as the language
+parameter for the listings package. If the mode name and the
+listings name are the same, the language does not need an entry
+in this list - but it does not hurt if it is present."
+ :group 'org-export-latex
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(repeat
+ (list
+ (symbol :tag "Major mode ")
+ (string :tag "Listings language"))))
+
+(defcustom org-latex-listings-options nil
+ "Association list of options for the latex listings package.
+
+These options are supplied as a comma-separated list to the
+\\lstset command. Each element of the association list should be
+a list containing two strings: the name of the option, and the
+value. For example,
+
+ (setq org-latex-listings-options
+ \\='((\"basicstyle\" \"\\\\small\")
+ (\"keywordstyle\" \"\\\\color{black}\\\\bfseries\\\\underbar\")))
+
+will typeset the code in a small size font with underlined, bold
+black keywords.
+
+Note that the same options will be applied to blocks of all
+languages. If you need block-specific options, you may use the
+following syntax:
+
+ #+ATTR_LATEX: :options key1=value1,key2=value2
+ #+BEGIN_SRC <LANG>
+ ...
+ #+END_SRC"
+ :group 'org-export-latex
+ :type '(repeat
+ (list
+ (string :tag "Listings option name ")
+ (string :tag "Listings option value"))))
+
+(defcustom org-latex-minted-langs
+ '((emacs-lisp "common-lisp")
+ (cc "c++")
+ (cperl "perl")
+ (shell-script "bash")
+ (caml "ocaml"))
+ "Alist mapping languages to their minted language counterpart.
+The key is a symbol, the major mode symbol without the \"-mode\".
+The value is the string that should be inserted as the language
+parameter for the minted package. If the mode name and the
+listings name are the same, the language does not need an entry
+in this list - but it does not hurt if it is present.
+
+Note that minted uses all lower case for language identifiers,
+and that the full list of language identifiers can be obtained
+with:
+
+ pygmentize -L lexers"
+ :group 'org-export-latex
+ :type '(repeat
+ (list
+ (symbol :tag "Major mode ")
+ (string :tag "Minted language"))))
+
+(defcustom org-latex-minted-options nil
+ "Association list of options for the latex minted package.
+
+These options are supplied within square brackets in
+\\begin{minted} environments. Each element of the alist should
+be a list containing two strings: the name of the option, and the
+value. For example,
+
+ (setq org-latex-minted-options
+ \\='((\"bgcolor\" \"bg\") (\"frame\" \"lines\")))
+
+will result in source blocks being exported with
+
+\\begin{minted}[bgcolor=bg,frame=lines]{<LANG>}
+
+as the start of the minted environment. Note that the same
+options will be applied to blocks of all languages. If you need
+block-specific options, you may use the following syntax:
+
+ #+ATTR_LATEX: :options key1=value1,key2=value2
+ #+BEGIN_SRC <LANG>
+ ...
+ #+END_SRC"
+ :group 'org-export-latex
+ :type '(repeat
+ (list
+ (string :tag "Minted option name ")
+ (string :tag "Minted option value"))))
+
+(defcustom org-latex-custom-lang-environments nil
+ "Alist mapping languages to language-specific LaTeX environments.
+
+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
+ %f for the float attribute
+ %l for an appropriate label
+ %o for the LaTeX attributes
+
+For example,
+
+ (setq org-latex-custom-lang-environments
+ \\='((python \"pythoncode\")
+ (ocaml \"\\\\begin{listing}
+\\\\begin{minted}[%o]{ocaml}
+%s\\\\end{minted}
+\\\\caption{%c}
+\\\\label{%l}\")))
+
+would have the effect that if Org encounters a Python source block
+during LaTeX export it will produce
+
+ \\begin{pythoncode}
+ <source block body>
+ \\end{pythoncode}
+
+and if Org encounters an Ocaml source block during LaTeX export it
+will produce
+
+ \\begin{listing}
+ \\begin{minted}[<attr_latex options>]{ocaml}
+ <source block body>
+ \\end{minted}
+ \\caption{<caption>}
+ \\label{<label>}
+ \\end{listing}"
+ :group 'org-export-latex
+ :type '(repeat
+ (list
+ (symbol :tag "Language name ")
+ (string :tag "Environment name or format string")))
+ :version "26.1"
+ :package-version '(Org . "9.0"))
+
+
+;;;; Compilation
+
+(defcustom org-latex-compiler-file-string "%% Intended LaTeX compiler: %s\n"
+ "LaTeX compiler format-string.
+See also `org-latex-compiler'."
+ :group 'org-export-latex
+ :type '(choice
+ (const :tag "Comment" "%% Intended LaTeX compiler: %s\n")
+ (const :tag "latex-mode file variable" "%% -*- latex-run-command: %s -*-\n")
+ (const :tag "AUCTeX file variable" "%% -*- LaTeX-command: %s -*-\n")
+ (string :tag "custom format" "%% %s"))
+ :version "26.1"
+ :package-version '(Org . "9.0"))
+
+(defcustom org-latex-compiler "pdflatex"
+ "LaTeX compiler to use.
+
+Must be an element in `org-latex-compilers' or the empty quote.
+Can also be set in buffers via #+LATEX_COMPILER. See also
+`org-latex-compiler-file-string'."
+ :group 'org-export-latex
+ :type '(choice
+ (const :tag "pdfLaTeX" "pdflatex")
+ (const :tag "XeLaTeX" "xelatex")
+ (const :tag "LuaLaTeX" "lualatex")
+ (const :tag "Unset" ""))
+ :version "26.1"
+ :package-version '(Org . "9.0"))
+
+(defconst org-latex-compilers '("pdflatex" "xelatex" "lualatex")
+ "Known LaTeX compilers.
+See also `org-latex-compiler'.")
+
+(defcustom org-latex-bib-compiler "bibtex"
+ "Command to process a LaTeX file's bibliography.
+
+The shorthand %bib in `org-latex-pdf-process' is replaced with
+this value.
+
+A better approach is to use a compiler suit such as `latexmk'."
+ :group 'org-export-latex
+ :type '(choice (const :tag "BibTeX" "bibtex")
+ (const :tag "Biber" "biber")
+ (string :tag "Other process"))
+ :version "26.1"
+ :package-version '(Org . "9.0"))
+
+(defcustom org-latex-pdf-process
+ (if (executable-find "latexmk")
+ '("latexmk -f -pdf -%latex -interaction=nonstopmode -output-directory=%o %f")
+ '("%latex -interaction nonstopmode -output-directory %o %f"
+ "%latex -interaction nonstopmode -output-directory %o %f"
+ "%latex -interaction nonstopmode -output-directory %o %f"))
+ "Commands to process a LaTeX file to a PDF file.
+
+This is a list of strings, each of them will be given to the
+shell as a command. %f in the command will be replaced by the
+relative file name, %F by the absolute file name, %b by the file
+base name (i.e. without directory and extension parts), %o by the
+base directory of the file, %O by the absolute file name of the
+output file, %latex is the LaTeX compiler (see
+`org-latex-compiler'), and %bib is the BibTeX-like compiler (see
+`org-latex-bib-compiler').
+
+The reason why this is a list is that it usually takes several
+runs of `pdflatex', maybe mixed with a call to `bibtex'. Org
+does not have a clever mechanism to detect which of these
+commands have to be run to get to a stable result, and it also
+does not do any error checking.
+
+Consider a smart LaTeX compiler such as `texi2dvi' or `latexmk',
+which calls the \"correct\" combinations of auxiliary programs.
+
+Alternatively, this may be a Lisp function that does the
+processing, so you could use this to apply the machinery of
+AUCTeX or the Emacs LaTeX mode. This function should accept the
+file name as its single argument."
+ :group 'org-export-pdf
+ :type '(choice
+ (repeat :tag "Shell command sequence"
+ (string :tag "Shell command"))
+ (const :tag "2 runs of latex"
+ ("%latex -interaction nonstopmode -output-directory %o %f"
+ "%latex -interaction nonstopmode -output-directory %o %f"))
+ (const :tag "3 runs of latex"
+ ("%latex -interaction nonstopmode -output-directory %o %f"
+ "%latex -interaction nonstopmode -output-directory %o %f"
+ "%latex -interaction nonstopmode -output-directory %o %f"))
+ (const :tag "latex,bibtex,latex,latex"
+ ("%latex -interaction nonstopmode -output-directory %o %f"
+ "%bib %b"
+ "%latex -interaction nonstopmode -output-directory %o %f"
+ "%latex -interaction nonstopmode -output-directory %o %f"))
+ (const :tag "texi2dvi"
+ ("cd %o; LATEX=\"%latex\" texi2dvi -p -b -V %b.tex"))
+ (const :tag "latexmk"
+ ("latexmk -f -pdf -%latex -interaction=nonstopmode -output-directory=%o %f"))
+ (function)))
+
+(defcustom org-latex-logfiles-extensions
+ '("aux" "bcf" "blg" "fdb_latexmk" "fls" "figlist" "idx" "log" "nav" "out"
+ "ptc" "run.xml" "snm" "toc" "vrb" "xdv")
+ "The list of file extensions to consider as LaTeX logfiles.
+The logfiles will be removed if `org-latex-remove-logfiles' is
+non-nil."
+ :group 'org-export-latex
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(repeat (string :tag "Extension")))
+
+(defcustom org-latex-remove-logfiles t
+ "Non-nil means remove the logfiles produced by PDF production.
+By default, logfiles are files with these extensions: .aux, .idx,
+.log, .out, .toc, .nav, .snm and .vrb. To define the set of
+logfiles to remove, set `org-latex-logfiles-extensions'."
+ :group 'org-export-latex
+ :type 'boolean)
+
+(defcustom org-latex-known-warnings
+ '(("Reference.*?undefined" . "[undefined reference]")
+ ("Runaway argument" . "[runaway argument]")
+ ("Underfull \\hbox" . "[underfull hbox]")
+ ("Overfull \\hbox" . "[overfull hbox]")
+ ("Citation.*?undefined" . "[undefined citation]")
+ ("Undefined control sequence" . "[undefined control sequence]"))
+ "Alist of regular expressions and associated messages for the user.
+The regular expressions are used to find possible warnings in the
+log of a LaTeX-run. These warnings will be reported after
+calling `org-latex-compile'."
+ :group 'org-export-latex
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(repeat
+ (cons
+ (regexp :tag "Regexp")
+ (string :tag "Message"))))
+
+
+
+;;; Internal Functions
+
+(defun org-latex--caption-above-p (element info)
+ "Non-nil when caption is expected to be located above ELEMENT.
+INFO is a plist holding contextual information."
+ (let ((above (plist-get info :latex-caption-above)))
+ (if (symbolp above) above
+ (let ((type (org-element-type element)))
+ (memq (if (eq type 'link) 'image type) above)))))
+
+(defun org-latex--label (datum info &optional force full)
+ "Return an appropriate label for DATUM.
+DATUM is an element or a `target' type object. INFO is the
+current export state, as a plist.
+
+Return nil if element DATUM has no NAME or VALUE affiliated
+keyword or no CUSTOM_ID property, unless FORCE is non-nil. In
+this case always return a unique label.
+
+Eventually, if FULL is non-nil, wrap label within \"\\label{}\"."
+ (let* ((type (org-element-type datum))
+ (user-label
+ (org-element-property
+ (cl-case type
+ ((headline inlinetask) :CUSTOM_ID)
+ (target :value)
+ (otherwise :name))
+ datum))
+ (label
+ (and (or user-label force)
+ (if (and user-label (plist-get info :latex-prefer-user-labels))
+ user-label
+ (concat (pcase type
+ (`headline "sec:")
+ (`table "tab:")
+ (`latex-environment
+ (and (string-match-p
+ org-latex-math-environments-re
+ (org-element-property :value datum))
+ "eq:"))
+ (`latex-matrices "eq:")
+ (`paragraph
+ (and (org-element-property :caption datum)
+ "fig:"))
+ (_ nil))
+ (org-export-get-reference datum info))))))
+ (cond ((not full) label)
+ (label (format "\\label{%s}%s"
+ label
+ (if (eq type 'target) "" "\n")))
+ (t ""))))
+
+(defun org-latex--caption/label-string (element info)
+ "Return caption and label LaTeX string for ELEMENT.
+
+INFO is a plist holding contextual information. If there's no
+caption nor label, return the empty string.
+
+For non-floats, see `org-latex--wrap-label'."
+ (let* ((label (org-latex--label element info nil t))
+ (main (org-export-get-caption element))
+ (attr (org-export-read-attribute :attr_latex element))
+ (type (org-element-type element))
+ (nonfloat (or (and (plist-member attr :float)
+ (not (plist-get attr :float))
+ main)
+ (and (eq type 'src-block)
+ (not (plist-get attr :float))
+ (null (plist-get info :latex-listings)))))
+ (short (org-export-get-caption element t))
+ (caption-from-attr-latex (plist-get attr :caption)))
+ (cond
+ ((org-string-nw-p caption-from-attr-latex)
+ (concat caption-from-attr-latex "\n"))
+ ((and (not main) (equal label "")) "")
+ ((not main) label)
+ ;; Option caption format with short name.
+ (t
+ (format (if nonfloat "\\captionof{%s}%s{%s%s}\n"
+ "\\caption%s%s{%s%s}\n")
+ (let ((type* (if (eq type 'latex-environment)
+ (org-latex--environment-type element)
+ type)))
+ (if nonfloat
+ (cl-case type*
+ (paragraph "figure")
+ (image "figure")
+ (special-block "figure")
+ (src-block (if (plist-get info :latex-listings)
+ "listing"
+ "figure"))
+ (t (symbol-name type*)))
+ ""))
+ (if short (format "[%s]" (org-export-data short info)) "")
+ (org-trim label)
+ (org-export-data main info))))))
+
+(defun org-latex-guess-inputenc (header)
+ "Set the coding system in inputenc to what the buffer is.
+
+HEADER is the LaTeX header string. This function only applies
+when specified inputenc option is \"AUTO\".
+
+Return the new header, as a string."
+ (let* ((cs (or (ignore-errors
+ (latexenc-coding-system-to-inputenc
+ (or org-export-coding-system buffer-file-coding-system)))
+ "utf8")))
+ (if (not cs) header
+ ;; First translate if that is requested.
+ (setq cs (or (cdr (assoc cs org-latex-inputenc-alist)) cs))
+ ;; Then find the \usepackage statement and replace the option.
+ (replace-regexp-in-string "\\\\usepackage\\[\\(AUTO\\)\\]{inputenc}"
+ cs header t nil 1))))
+
+(defun org-latex-guess-babel-language (header info)
+ "Set Babel's language according to LANGUAGE keyword.
+
+HEADER is the LaTeX header string. INFO is the plist used as
+a communication channel.
+
+Insertion of guessed language only happens when Babel package has
+explicitly been loaded. Then it is added to the rest of
+package's options.
+
+The argument to Babel may be \"AUTO\" which is then replaced with
+the language of the document or `org-export-default-language'
+unless language in question is already loaded.
+
+Return the new header."
+ (let ((language-code (plist-get info :language)))
+ ;; If no language is set or Babel package is not loaded, return
+ ;; HEADER as-is.
+ (if (or (not (stringp language-code))
+ (not (string-match "\\\\usepackage\\[\\(.*\\)\\]{babel}" header)))
+ header
+ (let ((options (save-match-data
+ (org-split-string (match-string 1 header) ",[ \t]*")))
+ (language (cdr (assoc-string language-code
+ org-latex-babel-language-alist t))))
+ ;; If LANGUAGE is already loaded, return header without AUTO.
+ ;; Otherwise, replace AUTO with language or append language if
+ ;; AUTO is not present.
+ (replace-match
+ (mapconcat (lambda (option) (if (equal "AUTO" option) language option))
+ (cond ((member language options) (delete "AUTO" options))
+ ((member "AUTO" options) options)
+ (t (append options (list language))))
+ ", ")
+ t nil header 1)))))
+
+(defun org-latex-guess-polyglossia-language (header info)
+ "Set the Polyglossia language according to the LANGUAGE keyword.
+
+HEADER is the LaTeX header string. INFO is the plist used as
+a communication channel.
+
+Insertion of guessed language only happens when the Polyglossia
+package has been explicitly loaded.
+
+The argument to Polyglossia may be \"AUTO\" which is then
+replaced with the language of the document or
+`org-export-default-language'. Note, the language is really set
+using \setdefaultlanguage and not as an option to the package.
+
+Return the new header."
+ (let ((language (plist-get info :language)))
+ ;; If no language is set or Polyglossia is not loaded, return
+ ;; HEADER as-is.
+ (if (or (not (stringp language))
+ (not (string-match
+ "\\\\usepackage\\(?:\\[\\([^]]+?\\)\\]\\){polyglossia}\n"
+ header)))
+ header
+ (let* ((options (org-string-nw-p (match-string 1 header)))
+ (languages (and options
+ ;; Reverse as the last loaded language is
+ ;; the main language.
+ (nreverse
+ (delete-dups
+ (save-match-data
+ (org-split-string
+ (replace-regexp-in-string
+ "AUTO" language options t)
+ ",[ \t]*"))))))
+ (main-language-set
+ (string-match-p "\\\\setmainlanguage{.*?}" header)))
+ (replace-match
+ (concat "\\usepackage{polyglossia}\n"
+ (mapconcat
+ (lambda (l)
+ (let ((l (or (assoc l org-latex-polyglossia-language-alist)
+ l)))
+ (format (if main-language-set "\\setotherlanguage%s{%s}\n"
+ (setq main-language-set t)
+ "\\setmainlanguage%s{%s}\n")
+ (if (and (consp l) (= (length l) 3))
+ (format "[variant=%s]" (nth 2 l))
+ "")
+ (nth 1 l))))
+ languages
+ ""))
+ t t header 0)))))
+
+(defun org-latex--remove-packages (pkg-alist info)
+ "Remove packages based on the current LaTeX compiler.
+
+PKG-ALIST is a list of packages, as in `org-latex-packages-alist'
+and `org-latex-default-packages-alist'. If the fourth argument
+of a package is neither nil nor a member of the LaTeX compiler
+associated to the document, the package is removed.
+
+Return new list of packages."
+ (let ((compiler (or (plist-get info :latex-compiler) "")))
+ (if (not (member-ignore-case compiler org-latex-compilers)) pkg-alist
+ (cl-remove-if-not
+ (lambda (package)
+ (pcase package
+ (`(,_ ,_ ,_ nil) t)
+ (`(,_ ,_ ,_ ,compilers) (member-ignore-case compiler compilers))
+ (_ t)))
+ pkg-alist))))
+
+(defun org-latex--find-verb-separator (s)
+ "Return a character not used in string S.
+This is used to choose a separator for constructs like \\verb."
+ (let ((ll "~,./?;':\"|!@#%^&-_=+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ<>()[]{}"))
+ (cl-loop for c across ll
+ when (not (string-match (regexp-quote (char-to-string c)) s))
+ return (char-to-string c))))
+
+(defun org-latex--make-option-string (options)
+ "Return a comma separated string of keywords and values.
+OPTIONS is an alist where the key is the options keyword as
+a string, and the value a list containing the keyword value, or
+nil."
+ (mapconcat (lambda (pair)
+ (pcase-let ((`(,keyword ,value) pair))
+ (concat keyword
+ (and (> (length value) 0)
+ (concat "="
+ (if (string-match-p (rx (any "[]")) value)
+ (format "{%s}" value)
+ value))))))
+ options
+ ","))
+
+(defun org-latex--wrap-label (element output info)
+ "Wrap label associated to ELEMENT around OUTPUT, if appropriate.
+INFO is the current export state, as a plist. This function
+should not be used for floats. See
+`org-latex--caption/label-string'."
+ (if (not (and (org-string-nw-p output) (org-element-property :name element)))
+ output
+ (concat (format "\\phantomsection\n\\label{%s}\n"
+ (org-latex--label element info))
+ output)))
+
+(defun org-latex--protect-text (text)
+ "Protect special characters in string TEXT and return it."
+ (replace-regexp-in-string "[\\{}$%&_#~^]" "\\\\\\&" text))
+
+(defun org-latex--text-markup (text markup info)
+ "Format TEXT depending on MARKUP text markup.
+INFO is a plist used as a communication channel. See
+`org-latex-text-markup-alist' for details."
+ (let ((fmt (cdr (assq markup (plist-get info :latex-text-markup-alist)))))
+ (cl-case fmt
+ ;; No format string: Return raw text.
+ ((nil) text)
+ ;; Handle the `verb' special case: Find an appropriate separator
+ ;; and use "\\verb" command.
+ (verb
+ (let ((separator (org-latex--find-verb-separator text)))
+ (concat "\\verb"
+ separator
+ (replace-regexp-in-string "\n" " " text)
+ separator)))
+ (protectedtexttt (org-latex--protect-texttt text))
+ ;; Else use format string.
+ (t (format fmt text)))))
+
+(defun org-latex--protect-texttt (text)
+ "Protect special chars, then wrap TEXT in \"\\texttt{}\"."
+ (format "\\texttt{%s}"
+ (replace-regexp-in-string
+ "--\\|[\\{}$%&_#~^]"
+ (lambda (m)
+ (cond ((equal m "--") "-{}-")
+ ((equal m "\\") "\\textbackslash{}")
+ ((equal m "~") "\\textasciitilde{}")
+ ((equal m "^") "\\textasciicircum{}")
+ (t (org-latex--protect-text m))))
+ text nil t)))
+
+(defun org-latex--delayed-footnotes-definitions (element info)
+ "Return footnotes definitions in ELEMENT as a string.
+
+INFO is a plist used as a communication channel.
+
+Footnotes definitions are returned within \"\\footnotetext{}\"
+commands.
+
+This function is used within constructs that don't support
+\"\\footnote{}\" command (e.g., an item tag). In that case,
+\"\\footnotemark\" is used within the construct and the function
+just outside of it."
+ (mapconcat
+ (lambda (ref)
+ (let ((def (org-export-get-footnote-definition ref info)))
+ (format "\\footnotetext[%d]{%s%s}"
+ (org-export-get-footnote-number ref info)
+ (org-trim (org-latex--label def info t t))
+ (org-trim (org-export-data def info)))))
+ ;; Find every footnote reference in ELEMENT.
+ (letrec ((all-refs nil)
+ (search-refs
+ (lambda (data)
+ ;; Return a list of all footnote references never seen
+ ;; before in DATA.
+ (org-element-map data 'footnote-reference
+ (lambda (ref)
+ (when (org-export-footnote-first-reference-p ref info)
+ (push ref all-refs)
+ (when (eq (org-element-property :type ref) 'standard)
+ (funcall search-refs
+ (org-export-get-footnote-definition ref info)))))
+ info)
+ (reverse all-refs))))
+ (funcall search-refs element))
+ ""))
+
+(defun org-latex--translate (s info)
+ "Translate string S according to specified language.
+INFO is a plist used as a communication channel."
+ (org-export-translate s :latex info))
+
+(defun org-latex--format-spec (info)
+ "Create a format-spec for document meta-data.
+INFO is a plist used as a communication channel."
+ (let ((language (let ((lang (plist-get info :language)))
+ (or (cdr (assoc-string lang org-latex-babel-language-alist t))
+ (nth 1 (assoc-string lang org-latex-polyglossia-language-alist t))
+ lang))))
+ `((?a . ,(org-export-data (plist-get info :author) info))
+ (?t . ,(org-export-data (plist-get info :title) info))
+ (?s . ,(org-export-data (plist-get info :subtitle) info))
+ (?k . ,(org-export-data (org-latex--wrap-latex-math-block
+ (plist-get info :keywords) info)
+ info))
+ (?d . ,(org-export-data (org-latex--wrap-latex-math-block
+ (plist-get info :description) info)
+ info))
+ (?c . ,(plist-get info :creator))
+ (?l . ,language)
+ (?L . ,(capitalize language))
+ (?D . ,(org-export-get-date info)))))
+
+(defun org-latex--insert-compiler (info)
+ "Insert LaTeX_compiler info into the document.
+INFO is a plist used as a communication channel."
+ (let ((compiler (plist-get info :latex-compiler)))
+ (and (org-string-nw-p org-latex-compiler-file-string)
+ (member (or compiler "") org-latex-compilers)
+ (format org-latex-compiler-file-string compiler))))
+
+
+;;; Filters
+
+(defun org-latex-matrices-tree-filter (tree _backend info)
+ (org-latex--wrap-latex-matrices tree info))
+
+(defun org-latex-math-block-tree-filter (tree _backend info)
+ (org-latex--wrap-latex-math-block tree info))
+
+(defun org-latex-math-block-options-filter (info _backend)
+ (dolist (prop '(:author :date :title) info)
+ (plist-put info prop
+ (org-latex--wrap-latex-math-block (plist-get info prop) info))))
+
+(defun org-latex-clean-invalid-line-breaks (data _backend _info)
+ (replace-regexp-in-string
+ "\\(\\\\end{[A-Za-z0-9*]+}\\|^\\)[ \t]*\\\\\\\\[ \t]*$" "\\1"
+ data))
+
+
+;;; Template
+
+;;;###autoload
+(defun org-latex-make-preamble (info &optional template snippet?)
+ "Return a formatted LaTeX preamble.
+INFO is a plist used as a communication channel. Optional
+argument TEMPLATE, when non-nil, is the header template string,
+as expected by `org-splice-latex-header'. When SNIPPET? is
+non-nil, only includes packages relevant to image generation, as
+specified in `org-latex-default-packages-alist' or
+`org-latex-packages-alist'."
+ (let* ((class (plist-get info :latex-class))
+ (class-template
+ (or template
+ (let* ((class-options (plist-get info :latex-class-options))
+ (header (nth 1 (assoc class (plist-get info :latex-classes)))))
+ (and (stringp header)
+ (if (not class-options) header
+ (replace-regexp-in-string
+ "^[ \t]*\\\\documentclass\\(\\(\\[[^]]*\\]\\)?\\)"
+ class-options header t nil 1))))
+ (user-error "Unknown LaTeX class `%s'" class))))
+ (org-latex-guess-polyglossia-language
+ (org-latex-guess-babel-language
+ (org-latex-guess-inputenc
+ (org-element-normalize-string
+ (org-splice-latex-header
+ class-template
+ (org-latex--remove-packages org-latex-default-packages-alist info)
+ (org-latex--remove-packages org-latex-packages-alist info)
+ snippet?
+ (mapconcat #'org-element-normalize-string
+ (list (plist-get info :latex-header)
+ (and (not snippet?)
+ (plist-get info :latex-header-extra)))
+ ""))))
+ info)
+ info)))
+
+(defun org-latex-template (contents info)
+ "Return complete document string after LaTeX conversion.
+CONTENTS is the transcoded contents string. INFO is a plist
+holding export options."
+ (let ((title (org-export-data (plist-get info :title) info))
+ (spec (org-latex--format-spec info)))
+ (concat
+ ;; Time-stamp.
+ (and (plist-get info :time-stamp-file)
+ (format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
+ ;; LaTeX compiler.
+ (org-latex--insert-compiler info)
+ ;; Document class and packages.
+ (org-latex-make-preamble info)
+ ;; Possibly limit depth for headline numbering.
+ (let ((sec-num (plist-get info :section-numbers)))
+ (when (integerp sec-num)
+ (format "\\setcounter{secnumdepth}{%d}\n" sec-num)))
+ ;; Author.
+ (let ((author (and (plist-get info :with-author)
+ (let ((auth (plist-get info :author)))
+ (and auth (org-export-data auth info)))))
+ (email (and (plist-get info :with-email)
+ (org-export-data (plist-get info :email) info))))
+ (cond ((and author email (not (string= "" email)))
+ (format "\\author{%s\\thanks{%s}}\n" author email))
+ ((or author email) (format "\\author{%s}\n" (or author email)))))
+ ;; Date.
+ (let ((date (and (plist-get info :with-date) (org-export-get-date info))))
+ (format "\\date{%s}\n" (org-export-data date info)))
+ ;; Title and subtitle.
+ (let* ((subtitle (plist-get info :subtitle))
+ (formatted-subtitle
+ (when subtitle
+ (format (plist-get info :latex-subtitle-format)
+ (org-export-data subtitle info))))
+ (separate (plist-get info :latex-subtitle-separate)))
+ (concat
+ (format "\\title{%s%s}\n" title
+ (if separate "" (or formatted-subtitle "")))
+ (when (and separate subtitle)
+ (concat formatted-subtitle "\n"))))
+ ;; Hyperref options.
+ (let ((template (plist-get info :latex-hyperref-template)))
+ (and (stringp template)
+ (format-spec template spec)))
+ ;; Document start.
+ "\\begin{document}\n\n"
+ ;; Title command.
+ (let* ((title-command (plist-get info :latex-title-command))
+ (command (and (stringp title-command)
+ (format-spec title-command spec))))
+ (org-element-normalize-string
+ (cond ((not (plist-get info :with-title)) nil)
+ ((string= "" title) nil)
+ ((not (stringp command)) nil)
+ ((string-match "\\(?:[^%]\\|^\\)%s" command)
+ (format command title))
+ (t command))))
+ ;; Table of contents.
+ (let ((depth (plist-get info :with-toc)))
+ (when depth
+ (concat (when (integerp depth)
+ (format "\\setcounter{tocdepth}{%d}\n" depth))
+ (plist-get info :latex-toc-command))))
+ ;; Document's body.
+ contents
+ ;; Creator.
+ (and (plist-get info :with-creator)
+ (concat (plist-get info :creator) "\n"))
+ ;; Document end.
+ "\\end{document}")))
+
+
+
+;;; Transcode Functions
+
+;;;; Bold
+
+(defun org-latex-bold (_bold contents info)
+ "Transcode BOLD from Org to LaTeX.
+CONTENTS is the text with bold markup. INFO is a plist holding
+contextual information."
+ (org-latex--text-markup contents 'bold info))
+
+
+;;;; Center Block
+
+(defun org-latex-center-block (center-block contents info)
+ "Transcode a CENTER-BLOCK element from Org to LaTeX.
+CONTENTS holds the contents of the center block. INFO is a plist
+holding contextual information."
+ (org-latex--wrap-label
+ center-block (format "\\begin{center}\n%s\\end{center}" contents) info))
+
+
+;;;; Clock
+
+(defun org-latex-clock (clock _contents info)
+ "Transcode a CLOCK element from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (concat
+ "\\noindent"
+ (format "\\textbf{%s} " org-clock-string)
+ (format (plist-get info :latex-inactive-timestamp-format)
+ (concat (org-timestamp-translate (org-element-property :value clock))
+ (let ((time (org-element-property :duration clock)))
+ (and time (format " (%s)" time)))))
+ "\\\\"))
+
+
+;;;; Code
+
+(defun org-latex-code (code _contents info)
+ "Transcode a CODE object from Org to LaTeX.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (org-latex--text-markup (org-element-property :value code) 'code info))
+
+
+;;;; Drawer
+
+(defun org-latex-drawer (drawer contents info)
+ "Transcode a DRAWER element from Org to LaTeX.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (let* ((name (org-element-property :drawer-name drawer))
+ (output (funcall (plist-get info :latex-format-drawer-function)
+ name contents)))
+ (org-latex--wrap-label drawer output info)))
+
+
+;;;; Dynamic Block
+
+(defun org-latex-dynamic-block (dynamic-block contents info)
+ "Transcode a DYNAMIC-BLOCK element from Org to LaTeX.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information. See `org-export-data'."
+ (org-latex--wrap-label dynamic-block contents info))
+
+
+;;;; Entity
+
+(defun org-latex-entity (entity _contents _info)
+ "Transcode an ENTITY object from Org to LaTeX.
+CONTENTS are the definition itself. INFO is a plist holding
+contextual information."
+ (org-element-property :latex entity))
+
+
+;;;; Example Block
+
+(defun org-latex-example-block (example-block _contents info)
+ "Transcode an EXAMPLE-BLOCK element from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (when (org-string-nw-p (org-element-property :value example-block))
+ (let ((environment (or (org-export-read-attribute
+ :attr_latex example-block :environment)
+ "verbatim")))
+ (org-latex--wrap-label
+ example-block
+ (format "\\begin{%s}\n%s\\end{%s}"
+ environment
+ (org-export-format-code-default example-block info)
+ environment)
+ info))))
+
+
+;;;; Export Block
+
+(defun org-latex-export-block (export-block _contents _info)
+ "Transcode a EXPORT-BLOCK element from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (when (member (org-element-property :type export-block) '("LATEX" "TEX"))
+ (org-remove-indentation (org-element-property :value export-block))))
+
+
+;;;; Export Snippet
+
+(defun org-latex-export-snippet (export-snippet _contents _info)
+ "Transcode a EXPORT-SNIPPET object from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (when (eq (org-export-snippet-backend export-snippet) 'latex)
+ (org-element-property :value export-snippet)))
+
+
+;;;; Fixed Width
+
+(defun org-latex-fixed-width (fixed-width _contents info)
+ "Transcode a FIXED-WIDTH element from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (org-latex--wrap-label
+ fixed-width
+ (format "\\begin{verbatim}\n%s\n\\end{verbatim}"
+ (org-remove-indentation
+ (org-element-property :value fixed-width)))
+ info))
+
+
+;;;; Footnote Reference
+
+(defun org-latex-footnote-reference (footnote-reference _contents info)
+ "Transcode a FOOTNOTE-REFERENCE element from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (let ((label (org-element-property :label footnote-reference)))
+ (concat
+ ;; Insert separator between two footnotes in a row.
+ (let ((prev (org-export-get-previous-element footnote-reference info)))
+ (when (eq (org-element-type prev) 'footnote-reference)
+ (plist-get info :latex-footnote-separator)))
+ (cond
+ ;; Use `:latex-footnote-defined-format' if the footnote has
+ ;; already been defined.
+ ((not (org-export-footnote-first-reference-p footnote-reference info))
+ (format (plist-get info :latex-footnote-defined-format)
+ (org-latex--label
+ (org-export-get-footnote-definition footnote-reference info)
+ info t)))
+ ;; Use \footnotemark if reference is within another footnote
+ ;; reference, footnote definition, table cell, verse block, or
+ ;; item's tag.
+ ((or (org-element-lineage footnote-reference
+ '(footnote-reference footnote-definition
+ table-cell verse-block))
+ (eq 'item (org-element-type
+ (org-export-get-parent-element footnote-reference))))
+ "\\footnotemark")
+ ;; Otherwise, define it with \footnote command.
+ (t
+ (let ((def (org-export-get-footnote-definition footnote-reference info)))
+ (concat
+ (format "\\footnote{%s%s}" (org-trim (org-export-data def info))
+ ;; Only insert a \label if there exist another
+ ;; reference to def.
+ (cond ((not label) "")
+ ((org-element-map (plist-get info :parse-tree)
+ 'footnote-reference
+ (lambda (f)
+ (and (not (eq f footnote-reference))
+ (equal (org-element-property :label f) label)
+ (org-trim (org-latex--label def info t t))))
+ info t))
+ (t "")))
+ ;; Retrieve all footnote references within the footnote and
+ ;; add their definition after it, since LaTeX doesn't support
+ ;; them inside.
+ (org-latex--delayed-footnotes-definitions def info))))))))
+
+
+;;;; Headline
+
+(defun org-latex-headline (headline contents info)
+ "Transcode a HEADLINE element from Org to LaTeX.
+CONTENTS holds the contents of the headline. INFO is a plist
+holding contextual information."
+ (unless (org-element-property :footnote-section-p headline)
+ (let* ((class (plist-get info :latex-class))
+ (level (org-export-get-relative-level headline info))
+ (numberedp (org-export-numbered-headline-p headline info))
+ (class-sectioning (assoc class (plist-get info :latex-classes)))
+ ;; Section formatting will set two placeholders: one for
+ ;; the title and the other for the contents.
+ (section-fmt
+ (let ((sec (if (functionp (nth 2 class-sectioning))
+ (funcall (nth 2 class-sectioning) level numberedp)
+ (nth (1+ level) class-sectioning))))
+ (cond
+ ;; No section available for that LEVEL.
+ ((not sec) nil)
+ ;; Section format directly returned by a function. Add
+ ;; placeholder for contents.
+ ((stringp sec) (concat sec "\n%s"))
+ ;; (numbered-section . unnumbered-section)
+ ((not (consp (cdr sec)))
+ (concat (funcall (if numberedp #'car #'cdr) sec) "\n%s"))
+ ;; (numbered-open numbered-close)
+ ((= (length sec) 2)
+ (when numberedp (concat (car sec) "\n%s" (nth 1 sec))))
+ ;; (num-in num-out no-num-in no-num-out)
+ ((= (length sec) 4)
+ (if numberedp (concat (car sec) "\n%s" (nth 1 sec))
+ (concat (nth 2 sec) "\n%s" (nth 3 sec)))))))
+ ;; Create a temporary export back-end that hard-codes
+ ;; "\underline" within "\section" and alike.
+ (section-back-end
+ (org-export-create-backend
+ :parent 'latex
+ :transcoders
+ '((underline . (lambda (o c i) (format "\\underline{%s}" c)))
+ ;; LaTeX isn't happy when you try to use \verb inside the argument of other
+ ;; commands (like \section, etc.), and this causes compilation to fail.
+ ;; So, within headings it's a good idea to replace any instances of \verb
+ ;; with \texttt.
+ (code . (lambda (o _ _) (org-latex--protect-texttt (org-element-property :value o))))
+ (verbatim . (lambda (o _ _) (org-latex--protect-texttt (org-element-property :value o)))))))
+ (text
+ (org-export-data-with-backend
+ (org-element-property :title headline) section-back-end info))
+ (todo
+ (and (plist-get info :with-todo-keywords)
+ (let ((todo (org-element-property :todo-keyword headline)))
+ (and todo (org-export-data todo info)))))
+ (todo-type (and todo (org-element-property :todo-type headline)))
+ (tags (and (plist-get info :with-tags)
+ (org-export-get-tags headline info)))
+ (priority (and (plist-get info :with-priority)
+ (org-element-property :priority headline)))
+ ;; Create the headline text along with a no-tag version.
+ ;; The latter is required to remove tags from toc.
+ (full-text (funcall (plist-get info :latex-format-headline-function)
+ todo todo-type priority text tags info))
+ ;; Associate \label to the headline for internal links.
+ (headline-label (org-latex--label headline info t t))
+ (pre-blanks
+ (make-string (org-element-property :pre-blank headline) ?\n)))
+ (if (or (not section-fmt) (org-export-low-level-p headline info))
+ ;; This is a deep sub-tree: export it as a list item. Also
+ ;; export as items headlines for which no section format has
+ ;; been found.
+ (let ((low-level-body
+ (concat
+ ;; If headline is the first sibling, start a list.
+ (when (org-export-first-sibling-p headline info)
+ (format "\\begin{%s}\n" (if numberedp 'enumerate 'itemize)))
+ ;; Itemize headline
+ "\\item"
+ (and full-text
+ (string-match-p "\\`[ \t]*\\[" full-text)
+ "\\relax")
+ " " full-text "\n"
+ headline-label
+ pre-blanks
+ contents)))
+ ;; If headline is not the last sibling simply return
+ ;; LOW-LEVEL-BODY. Otherwise, also close the list, before
+ ;; any blank line.
+ (if (not (org-export-last-sibling-p headline info)) low-level-body
+ (replace-regexp-in-string
+ "[ \t\n]*\\'"
+ (format "\n\\\\end{%s}" (if numberedp 'enumerate 'itemize))
+ low-level-body)))
+ ;; This is a standard headline. Export it as a section. Add
+ ;; an alternative heading when possible, and when this is not
+ ;; identical to the usual heading.
+ (let ((opt-title
+ (funcall (plist-get info :latex-format-headline-function)
+ todo todo-type priority
+ (org-export-data-with-backend
+ (org-export-get-alt-title headline info)
+ section-back-end info)
+ (and (eq (plist-get info :with-tags) t) tags)
+ info))
+ ;; Maybe end local TOC (see `org-latex-keyword').
+ (contents
+ (concat
+ contents
+ (let ((case-fold-search t)
+ (section
+ (let ((first (car (org-element-contents headline))))
+ (and (eq (org-element-type first) 'section) first))))
+ (org-element-map section 'keyword
+ (lambda (k)
+ (and (equal (org-element-property :key k) "TOC")
+ (let ((v (org-element-property :value k)))
+ (and (string-match-p "\\<headlines\\>" v)
+ (string-match-p "\\<local\\>" v)
+ (format "\\stopcontents[level-%d]" level)))))
+ info t)))))
+ (if (and opt-title
+ (not (equal opt-title full-text))
+ (string-match "\\`\\\\\\(.+?\\){" section-fmt))
+ (format (replace-match "\\1[%s]" nil nil section-fmt 1)
+ ;; Replace square brackets with parenthesis
+ ;; since square brackets are not supported in
+ ;; optional arguments.
+ (replace-regexp-in-string
+ "\\[" "(" (replace-regexp-in-string "\\]" ")" opt-title))
+ full-text
+ (concat headline-label pre-blanks contents))
+ ;; Impossible to add an alternative heading. Fallback to
+ ;; regular sectioning format string.
+ (format section-fmt full-text
+ (concat headline-label pre-blanks contents))))))))
+
+(defun org-latex-format-headline-default-function
+ (todo _todo-type priority text tags _info)
+ "Default format function for a headline.
+See `org-latex-format-headline-function' for details."
+ (concat
+ (and todo (format "{\\bfseries\\sffamily %s} " todo))
+ (and priority (format "\\framebox{\\#%c} " priority))
+ text
+ (and tags
+ (format "\\hfill{}\\textsc{%s}"
+ (mapconcat #'org-latex--protect-text tags ":")))))
+
+
+;;;; Horizontal Rule
+
+(defun org-latex-horizontal-rule (horizontal-rule _contents info)
+ "Transcode an HORIZONTAL-RULE object from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (let ((attr (org-export-read-attribute :attr_latex horizontal-rule))
+ (prev (org-export-get-previous-element horizontal-rule info)))
+ (concat
+ ;; Make sure the rule doesn't start at the end of the current
+ ;; line by separating it with a blank line from previous element.
+ (when (and prev
+ (let ((prev-blank (org-element-property :post-blank prev)))
+ (or (not prev-blank) (zerop prev-blank))))
+ "\n")
+ (org-latex--wrap-label
+ horizontal-rule
+ (format "\\noindent\\rule{%s}{%s}"
+ (or (plist-get attr :width) "\\textwidth")
+ (or (plist-get attr :thickness) "0.5pt"))
+ info))))
+
+
+;;;; Inline Src Block
+
+(defun org-latex-inline-src-block (inline-src-block _contents info)
+ "Transcode an INLINE-SRC-BLOCK element from Org to LaTeX.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (let* ((code (org-element-property :value inline-src-block))
+ (separator (org-latex--find-verb-separator code)))
+ (cl-case (plist-get info :latex-listings)
+ ;; Do not use a special package: transcode it verbatim, as code.
+ ((nil) (org-latex--text-markup code 'code info))
+ ;; Use minted package.
+ (minted
+ (let* ((org-lang (org-element-property :language inline-src-block))
+ (mint-lang (or (cadr (assq (intern org-lang)
+ (plist-get info :latex-minted-langs)))
+ (downcase org-lang)))
+ (options (org-latex--make-option-string
+ (plist-get info :latex-minted-options))))
+ (format "\\mintinline%s{%s}{%s}"
+ (if (string= options "") "" (format "[%s]" options))
+ mint-lang
+ code)))
+ ;; Use listings package.
+ (otherwise
+ ;; Maybe translate language's name.
+ (let* ((org-lang (org-element-property :language inline-src-block))
+ (lst-lang (or (cadr (assq (intern org-lang)
+ (plist-get info :latex-listings-langs)))
+ org-lang))
+ (options (org-latex--make-option-string
+ (append (plist-get info :latex-listings-options)
+ `(("language" ,lst-lang))))))
+ (concat (format "\\lstinline[%s]" options)
+ separator code separator))))))
+
+
+;;;; Inlinetask
+
+(defun org-latex-inlinetask (inlinetask contents info)
+ "Transcode an INLINETASK element from Org to LaTeX.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (let ((title (org-export-data (org-element-property :title inlinetask) info))
+ (todo (and (plist-get info :with-todo-keywords)
+ (let ((todo (org-element-property :todo-keyword inlinetask)))
+ (and todo (org-export-data todo info)))))
+ (todo-type (org-element-property :todo-type inlinetask))
+ (tags (and (plist-get info :with-tags)
+ (org-export-get-tags inlinetask info)))
+ (priority (and (plist-get info :with-priority)
+ (org-element-property :priority inlinetask)))
+ (contents (concat (org-latex--label inlinetask info) contents)))
+ (funcall (plist-get info :latex-format-inlinetask-function)
+ todo todo-type priority title tags contents info)))
+
+(defun org-latex-format-inlinetask-default-function
+ (todo _todo-type priority title tags contents _info)
+ "Default format function for inlinetasks.
+See `org-latex-format-inlinetask-function' for details."
+ (let ((full-title
+ (concat (when todo (format "\\textbf{\\textsf{\\textsc{%s}}} " todo))
+ (when priority (format "\\framebox{\\#%c} " priority))
+ title
+ (when tags
+ (format "\\hfill{}\\textsc{%s}"
+ (org-make-tag-string
+ (mapcar #'org-latex--protect-text tags)))))))
+ (concat "\\begin{center}\n"
+ "\\fbox{\n"
+ "\\begin{minipage}[c]{.6\\textwidth}\n"
+ full-title "\n\n"
+ (and (org-string-nw-p contents)
+ (concat "\\rule[.8em]{\\textwidth}{2pt}\n\n" contents))
+ "\\end{minipage}\n"
+ "}\n"
+ "\\end{center}")))
+
+
+;;;; Italic
+
+(defun org-latex-italic (_italic contents info)
+ "Transcode ITALIC from Org to LaTeX.
+CONTENTS is the text with italic markup. INFO is a plist holding
+contextual information."
+ (org-latex--text-markup contents 'italic info))
+
+
+;;;; Item
+
+(defun org-latex-item (item contents info)
+ "Transcode an ITEM element from Org to LaTeX.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (let* ((orderedp (eq (org-element-property
+ :type (org-export-get-parent item))
+ 'ordered))
+ (level
+ ;; Determine level of current item to determine the
+ ;; correct LaTeX counter to use (enumi, enumii...).
+ (let ((parent item) (level 0))
+ (while (memq (org-element-type
+ (setq parent (org-export-get-parent parent)))
+ '(plain-list item))
+ (when (and (eq (org-element-type parent) 'plain-list)
+ (eq (org-element-property :type parent)
+ 'ordered))
+ (cl-incf level)))
+ level))
+ (count (org-element-property :counter item))
+ (counter (and count
+ (< level 5)
+ (format "\\setcounter{enum%s}{%s}\n"
+ (nth (1- level) '("i" "ii" "iii" "iv"))
+ (1- count))))
+ (checkbox (cl-case (org-element-property :checkbox item)
+ (on "$\\boxtimes$")
+ (off "$\\square$")
+ (trans "$\\boxminus$")))
+ (tag (let ((tag (org-element-property :tag item)))
+ (and tag (org-export-data tag info))))
+ ;; If there are footnotes references in tag, be sure to add
+ ;; their definition at the end of the item. This workaround
+ ;; is necessary since "\footnote{}" command is not supported
+ ;; in tags.
+ (tag-footnotes
+ (or (and tag (org-latex--delayed-footnotes-definitions
+ (org-element-property :tag item) info))
+ "")))
+ (concat counter
+ "\\item"
+ (cond
+ ((and checkbox tag)
+ (format (if orderedp "{%s %s} %s" "[{%s %s}] %s")
+ checkbox tag tag-footnotes))
+ ((or checkbox tag)
+ (format (if orderedp "{%s} %s" "[{%s}] %s")
+ (or checkbox tag) tag-footnotes))
+ ;; Without a tag or a check-box, if CONTENTS starts with
+ ;; an opening square bracket, add "\relax" to "\item",
+ ;; unless the brackets comes from an initial export
+ ;; snippet (i.e. it is inserted willingly by the user).
+ ((and contents
+ (string-match-p "\\`[ \t]*\\[" contents)
+ (not (let ((e (car (org-element-contents item))))
+ (and (eq (org-element-type e) 'paragraph)
+ (let ((o (car (org-element-contents e))))
+ (and (eq (org-element-type o) 'export-snippet)
+ (eq (org-export-snippet-backend o)
+ 'latex)))))))
+ "\\relax ")
+ (t " "))
+ (and contents (org-trim contents)))))
+
+
+;;;; Keyword
+
+(defun org-latex-keyword (keyword _contents info)
+ "Transcode a KEYWORD element from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (let ((key (org-element-property :key keyword))
+ (value (org-element-property :value keyword)))
+ (cond
+ ((string= key "LATEX") value)
+ ((string= key "INDEX") (format "\\index{%s}" value))
+ ((string= key "TOC")
+ (let ((case-fold-search t))
+ (cond
+ ((string-match-p "\\<headlines\\>" value)
+ (let* ((localp (string-match-p "\\<local\\>" value))
+ (parent (org-element-lineage keyword '(headline)))
+ (level (if (not (and localp parent)) 0
+ (org-export-get-relative-level parent info)))
+ (depth
+ (and (string-match "\\<[0-9]+\\>" value)
+ (format
+ "\\setcounter{tocdepth}{%d}"
+ (+ (string-to-number (match-string 0 value)) level)))))
+ (if (and localp parent)
+ ;; Start local TOC, assuming package "titletoc" is
+ ;; required.
+ (format "\\startcontents[level-%d]
+\\printcontents[level-%d]{}{0}{%s}"
+ level level (or depth ""))
+ (concat depth (and depth "\n") "\\tableofcontents"))))
+ ((string-match-p "\\<tables\\>" value) "\\listoftables")
+ ((string-match-p "\\<listings\\>" value)
+ (cl-case (plist-get info :latex-listings)
+ ((nil) "\\listoffigures")
+ (minted "\\listoflistings")
+ (otherwise "\\lstlistoflistings")))))))))
+
+
+;;;; Latex Environment
+
+(defun org-latex--environment-type (latex-environment)
+ "Return the TYPE of LATEX-ENVIRONMENT.
+
+The TYPE is determined from the actual latex environment, and
+could be a member of `org-latex-caption-above' or `math'."
+ (let* ((latex-begin-re "\\\\begin{\\([A-Za-z0-9*]+\\)}")
+ (value (org-remove-indentation
+ (org-element-property :value latex-environment)))
+ (env (or (and (string-match latex-begin-re value)
+ (match-string 1 value))
+ "")))
+ (cond
+ ((string-match-p org-latex-math-environments-re value) 'math)
+ ((string-match-p
+ (eval-when-compile
+ (regexp-opt '("table" "longtable" "tabular" "tabu" "longtabu")))
+ env)
+ 'table)
+ ((string-match-p "figure" env) 'image)
+ ((string-match-p
+ (eval-when-compile
+ (regexp-opt '("lstlisting" "listing" "verbatim" "minted")))
+ env)
+ 'src-block)
+ (t 'special-block))))
+
+(defun org-latex-latex-environment (latex-environment _contents info)
+ "Transcode a LATEX-ENVIRONMENT element from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (when (plist-get info :with-latex)
+ (let* ((value (org-remove-indentation
+ (org-element-property :value latex-environment)))
+ (type (org-latex--environment-type latex-environment))
+ (caption (if (eq type 'math)
+ (org-latex--label latex-environment info nil t)
+ (org-latex--caption/label-string latex-environment info)))
+ (caption-above-p
+ (memq type (append (plist-get info :latex-caption-above) '(math)))))
+ (if (not (or (org-element-property :name latex-environment)
+ (org-element-property :caption latex-environment)))
+ value
+ ;; Environment is labeled: label must be within the environment
+ ;; (otherwise, a reference pointing to that element will count
+ ;; the section instead). Also insert caption if `latex-environment'
+ ;; is not a math environment.
+ (with-temp-buffer
+ (insert value)
+ (if caption-above-p
+ (progn
+ (goto-char (point-min))
+ (forward-line))
+ (goto-char (point-max))
+ (forward-line -1))
+ (insert caption)
+ (buffer-string))))))
+
+;;;; Latex Fragment
+
+(defun org-latex-latex-fragment (latex-fragment _contents _info)
+ "Transcode a LATEX-FRAGMENT object from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (let ((value (org-element-property :value latex-fragment)))
+ ;; Trim math markers since the fragment is enclosed within
+ ;; a latex-math-block object anyway.
+ (cond ((string-match-p "\\`\\$[^$]" value) (substring value 1 -1))
+ ((string-prefix-p "\\(" value) (substring value 2 -2))
+ (t value))))
+
+
+;;;; Line Break
+
+(defun org-latex-line-break (_line-break _contents _info)
+ "Transcode a LINE-BREAK object from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ "\\\\\n")
+
+
+;;;; Link
+
+(defun org-latex-image-link-filter (data _backend info)
+ (org-export-insert-image-links data info org-latex-inline-image-rules))
+
+(defun org-latex--inline-image (link info)
+ "Return LaTeX code for an inline image.
+LINK is the link pointing to the inline image. INFO is a plist
+used as a communication channel."
+ (let* ((parent (org-export-get-parent-element link))
+ (path (let ((raw-path (org-element-property :path link)))
+ (if (not (file-name-absolute-p raw-path)) raw-path
+ (expand-file-name raw-path))))
+ (filetype (file-name-extension path))
+ (caption (org-latex--caption/label-string parent info))
+ (caption-above-p (org-latex--caption-above-p link info))
+ ;; Retrieve latex attributes from the element around.
+ (attr (org-export-read-attribute :attr_latex parent))
+ (float (let ((float (plist-get attr :float)))
+ (cond ((string= float "wrap") 'wrap)
+ ((string= float "sideways") 'sideways)
+ ((string= float "multicolumn") 'multicolumn)
+ ((and (plist-member attr :float) (not float)) 'nonfloat)
+ (float float)
+ ((or (org-element-property :caption parent)
+ (org-string-nw-p (plist-get attr :caption)))
+ 'figure)
+ (t 'nonfloat))))
+ (placement
+ (let ((place (plist-get attr :placement)))
+ (cond
+ (place (format "%s" place))
+ ((eq float 'wrap) "{l}{0.5\\textwidth}")
+ ((eq float 'figure)
+ (format "[%s]" (plist-get info :latex-default-figure-position)))
+ (t ""))))
+ (center
+ (cond
+ ;; If link is an image link, do not center.
+ ((eq 'link (org-element-type (org-export-get-parent link))) nil)
+ ((plist-member attr :center) (plist-get attr :center))
+ (t (plist-get info :latex-images-centered))))
+ (comment-include (if (plist-get attr :comment-include) "%" ""))
+ ;; It is possible to specify scale or width and height in
+ ;; the ATTR_LATEX line, and also via default variables.
+ (scale (cond ((eq float 'wrap) "")
+ ((plist-get attr :scale))
+ (t (plist-get info :latex-image-default-scale))))
+ (width (cond ((org-string-nw-p scale) "")
+ ((plist-get attr :width))
+ ((plist-get attr :height) "")
+ ((eq float 'wrap) "0.48\\textwidth")
+ (t (plist-get info :latex-image-default-width))))
+ (height (cond ((org-string-nw-p scale) "")
+ ((plist-get attr :height))
+ ((or (plist-get attr :width)
+ (memq float '(figure wrap))) "")
+ (t (plist-get info :latex-image-default-height))))
+ (options (let ((opt (or (plist-get attr :options)
+ (plist-get info :latex-image-default-option))))
+ (if (not (string-match "\\`\\[\\(.*\\)\\]\\'" opt)) opt
+ (match-string 1 opt))))
+ image-code)
+ (if (member filetype '("tikz" "pgf"))
+ ;; For tikz images:
+ ;; - use \input to read in image file.
+ ;; - if options are present, wrap in a tikzpicture environment.
+ ;; - if width or height are present, use \resizebox to change
+ ;; the image size.
+ (progn
+ (setq image-code (format "\\input{%s}" path))
+ (when (org-string-nw-p options)
+ (setq image-code
+ (format "\\begin{tikzpicture}[%s]\n%s\n\\end{tikzpicture}"
+ options
+ image-code)))
+ (setq image-code
+ (cond ((org-string-nw-p scale)
+ (format "\\scalebox{%s}{%s}" scale image-code))
+ ((or (org-string-nw-p width) (org-string-nw-p height))
+ (format "\\resizebox{%s}{%s}{%s}"
+ (if (org-string-nw-p width) width "!")
+ (if (org-string-nw-p height) height "!")
+ image-code))
+ (t image-code))))
+ ;; For other images:
+ ;; - add scale, or width and height to options.
+ ;; - include the image with \includegraphics.
+ (if (org-string-nw-p scale)
+ (setq options (concat options ",scale=" scale))
+ (when (org-string-nw-p width) (setq options (concat options ",width=" width)))
+ (when (org-string-nw-p height) (setq options (concat options ",height=" height))))
+ (let ((search-option (org-element-property :search-option link)))
+ (when (and search-option
+ (equal filetype "pdf")
+ (string-match-p "\\`[0-9]+\\'" search-option)
+ (not (string-match-p "page=" options)))
+ (setq options (concat options ",page=" search-option))))
+ (setq image-code
+ (format "\\includegraphics%s{%s}"
+ (cond ((not (org-string-nw-p options)) "")
+ ((string-prefix-p "," options)
+ (format "[%s]" (substring options 1)))
+ (t (format "[%s]" options)))
+ path))
+ (when (equal filetype "svg")
+ (setq image-code (replace-regexp-in-string "^\\\\includegraphics"
+ "\\includesvg"
+ image-code
+ nil t))
+ (setq image-code (replace-regexp-in-string "\\.svg}"
+ "}"
+ image-code
+ nil t))))
+ ;; Return proper string, depending on FLOAT.
+ (pcase float
+ ((and (pred stringp) env-string)
+ (format "\\begin{%s}%s
+%s%s
+%s%s
+%s\\end{%s}"
+ env-string
+ placement
+ (if caption-above-p caption "")
+ (if center "\\centering" "")
+ comment-include image-code
+ (if caption-above-p "" caption)
+ env-string))
+ (`wrap (format "\\begin{wrapfigure}%s
+%s%s
+%s%s
+%s\\end{wrapfigure}"
+ placement
+ (if caption-above-p caption "")
+ (if center "\\centering" "")
+ comment-include image-code
+ (if caption-above-p "" caption)))
+ (`sideways (format "\\begin{sidewaysfigure}
+%s%s
+%s%s
+%s\\end{sidewaysfigure}"
+ (if caption-above-p caption "")
+ (if center "\\centering" "")
+ comment-include image-code
+ (if caption-above-p "" caption)))
+ (`multicolumn (format "\\begin{figure*}%s
+%s%s
+%s%s
+%s\\end{figure*}"
+ placement
+ (if caption-above-p caption "")
+ (if center "\\centering" "")
+ comment-include image-code
+ (if caption-above-p "" caption)))
+ (`figure (format "\\begin{figure}%s
+%s%s
+%s%s
+%s\\end{figure}"
+ placement
+ (if caption-above-p caption "")
+ (if center "\\centering" "")
+ comment-include image-code
+ (if caption-above-p "" caption)))
+ ((guard center)
+ (format "\\begin{center}
+%s%s
+%s\\end{center}"
+ (if caption-above-p caption "")
+ image-code
+ (if caption-above-p "" caption)))
+ (_
+ (concat (if caption-above-p caption "")
+ image-code
+ (if caption-above-p caption ""))))))
+
+(defun org-latex-link (link desc info)
+ "Transcode a LINK object from Org to LaTeX.
+
+DESC is the description part of the link, or the empty string.
+INFO is a plist holding contextual information. See
+`org-export-data'."
+ (let* ((type (org-element-property :type link))
+ (raw-path (org-element-property :path link))
+ ;; Ensure DESC really exists, or set it to nil.
+ (desc (and (not (string= desc "")) desc))
+ (imagep (org-export-inline-image-p
+ link (plist-get info :latex-inline-image-rules)))
+ (path (org-latex--protect-text
+ (pcase type
+ ((or "http" "https" "ftp" "mailto" "doi")
+ (concat type ":" raw-path))
+ ("file"
+ (org-export-file-uri raw-path))
+ (_
+ raw-path)))))
+ (cond
+ ;; Link type is handled by a special function.
+ ((org-export-custom-protocol-maybe link desc 'latex info))
+ ;; Image file.
+ (imagep (org-latex--inline-image link info))
+ ;; Radio link: Transcode target's contents and use them as link's
+ ;; description.
+ ((string= type "radio")
+ (let ((destination (org-export-resolve-radio-link link info)))
+ (if (not destination) desc
+ (format "\\hyperref[%s]{%s}"
+ (org-export-get-reference destination info)
+ desc))))
+ ;; Links pointing to a headline: Find destination and build
+ ;; appropriate referencing command.
+ ((member type '("custom-id" "fuzzy" "id"))
+ (let ((destination
+ (if (string= type "fuzzy")
+ (org-export-resolve-fuzzy-link link info 'latex-matrices)
+ (org-export-resolve-id-link link info))))
+ (cl-case (org-element-type destination)
+ ;; Id link points to an external file.
+ (plain-text
+ (if desc (format "\\href{%s}{%s}" destination desc)
+ (format "\\url{%s}" destination)))
+ ;; Fuzzy link points nowhere.
+ ((nil)
+ (format (plist-get info :latex-link-with-unknown-path-format)
+ (or desc
+ (org-export-data
+ (org-element-property :raw-link link) info))))
+ ;; LINK points to a headline. If headlines are numbered
+ ;; and the link has no description, display headline's
+ ;; number. Otherwise, display description or headline's
+ ;; title.
+ (headline
+ (let ((label (org-latex--label destination info t)))
+ (if (and (not desc)
+ (org-export-numbered-headline-p destination info))
+ (format org-latex-reference-command label)
+ (format "\\hyperref[%s]{%s}" label
+ (or desc
+ (org-export-data
+ (org-element-property :title destination) info))))))
+ ;; Fuzzy link points to a target. Do as above.
+ (otherwise
+ (let ((ref (org-latex--label destination info t)))
+ (if (not desc) (format org-latex-reference-command ref)
+ (format "\\hyperref[%s]{%s}" ref desc)))))))
+ ;; Coderef: replace link with the reference name or the
+ ;; equivalent line number.
+ ((string= type "coderef")
+ (format (org-export-get-coderef-format path desc)
+ ;; Resolve with RAW-PATH since PATH could be tainted
+ ;; with `org-latex--protect-text' call above.
+ (org-export-resolve-coderef raw-path info)))
+ ;; External link with a description part.
+ ((and path desc) (format "\\href{%s}{%s}" path desc))
+ ;; External link without a description part.
+ (path (format "\\url{%s}" path))
+ ;; No path, only description. Try to do something useful.
+ (t (format (plist-get info :latex-link-with-unknown-path-format) desc)))))
+
+
+;;;; Node Property
+
+(defun org-latex-node-property (node-property _contents _info)
+ "Transcode a NODE-PROPERTY element from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (format "%s:%s"
+ (org-element-property :key node-property)
+ (let ((value (org-element-property :value node-property)))
+ (if value (concat " " value) ""))))
+
+
+;;;; Paragraph
+
+(defun org-latex-paragraph (_paragraph contents _info)
+ "Transcode a PARAGRAPH element from Org to LaTeX.
+CONTENTS is the contents of the paragraph, as a string. INFO is
+the plist used as a communication channel."
+ contents)
+
+
+;;;; Plain List
+
+(defun org-latex-plain-list (plain-list contents info)
+ "Transcode a PLAIN-LIST element from Org to LaTeX.
+CONTENTS is the contents of the list. INFO is a plist holding
+contextual information."
+ (let* ((type (org-element-property :type plain-list))
+ (attr (org-export-read-attribute :attr_latex plain-list))
+ (latex-type (let ((env (plist-get attr :environment)))
+ (cond (env (format "%s" env))
+ ((eq type 'ordered) "enumerate")
+ ((eq type 'descriptive) "description")
+ (t "itemize")))))
+ (org-latex--wrap-label
+ plain-list
+ (format "\\begin{%s}%s\n%s\\end{%s}"
+ latex-type
+ (or (plist-get attr :options) "")
+ contents
+ latex-type)
+ info)))
+
+
+;;;; Plain Text
+
+(defun org-latex-plain-text (text info)
+ "Transcode a TEXT string from Org to LaTeX.
+TEXT is the string to transcode. INFO is a plist holding
+contextual information."
+ (let* ((specialp (plist-get info :with-special-strings))
+ (output
+ ;; Turn LaTeX into \LaTeX{} and TeX into \TeX{}.
+ (let ((case-fold-search nil))
+ (replace-regexp-in-string
+ "\\<\\(?:La\\)?TeX\\>" "\\\\\\&{}"
+ ;; Protect ^, ~, %, #, &, $, _, { and }. Also protect \.
+ ;; However, if special strings are used, be careful not
+ ;; to protect "\" in "\-" constructs.
+ (replace-regexp-in-string
+ (concat "[%$#&{}_~^]\\|\\\\" (and specialp "\\([^-]\\|$\\)"))
+ (lambda (m)
+ (cl-case (string-to-char m)
+ (?\\ "$\\\\backslash$\\1")
+ (?~ "\\\\textasciitilde{}")
+ (?^ "\\\\^{}")
+ (t "\\\\\\&")))
+ text)))))
+ ;; Activate smart quotes. Be sure to provide original TEXT string
+ ;; since OUTPUT may have been modified.
+ (when (plist-get info :with-smart-quotes)
+ (setq output (org-export-activate-smart-quotes output :latex info text)))
+ ;; Convert special strings.
+ (when specialp
+ (setq output (replace-regexp-in-string "\\.\\.\\." "\\\\ldots{}" output)))
+ ;; Handle break preservation if required.
+ (when (plist-get info :preserve-breaks)
+ (setq output (replace-regexp-in-string
+ "\\(?:[ \t]*\\\\\\\\\\)?[ \t]*\n" "\\\\\n" output nil t)))
+ ;; Return value.
+ output))
+
+
+;;;; Planning
+
+(defun org-latex-planning (planning _contents info)
+ "Transcode a PLANNING element from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (concat
+ "\\noindent"
+ (mapconcat
+ 'identity
+ (delq nil
+ (list
+ (let ((closed (org-element-property :closed planning)))
+ (when closed
+ (concat
+ (format "\\textbf{%s} " org-closed-string)
+ (format (plist-get info :latex-inactive-timestamp-format)
+ (org-timestamp-translate closed)))))
+ (let ((deadline (org-element-property :deadline planning)))
+ (when deadline
+ (concat
+ (format "\\textbf{%s} " org-deadline-string)
+ (format (plist-get info :latex-active-timestamp-format)
+ (org-timestamp-translate deadline)))))
+ (let ((scheduled (org-element-property :scheduled planning)))
+ (when scheduled
+ (concat
+ (format "\\textbf{%s} " org-scheduled-string)
+ (format (plist-get info :latex-active-timestamp-format)
+ (org-timestamp-translate scheduled)))))))
+ " ")
+ "\\\\"))
+
+
+;;;; Property Drawer
+
+(defun org-latex-property-drawer (_property-drawer contents _info)
+ "Transcode a PROPERTY-DRAWER element from Org to LaTeX.
+CONTENTS holds the contents of the drawer. INFO is a plist
+holding contextual information."
+ (and (org-string-nw-p contents)
+ (format "\\begin{verbatim}\n%s\\end{verbatim}" contents)))
+
+
+;;;; Pseudo Element: LaTeX Matrices
+
+;; `latex-matrices' elements have the following properties:
+;; `:caption', `:post-blank' and `:markup' (`inline', `equation' or
+;; `math').
+
+(defun org-latex--wrap-latex-matrices (data info)
+ "Merge contiguous tables with the same mode within a pseudo-element.
+DATA is a parse tree or a secondary string. INFO is a plist
+containing export options. Modify DATA by side-effect and return
+it."
+ (org-element-map data 'table
+ (lambda (table)
+ (when (eq (org-element-property :type table) 'org)
+ (let ((mode (or (org-export-read-attribute :attr_latex table :mode)
+ (plist-get info :latex-default-table-mode))))
+ (when (and (member mode '("inline-math" "math"))
+ ;; Do not wrap twice the same table.
+ (not (eq (org-element-type
+ (org-element-property :parent table))
+ 'latex-matrices)))
+ (let* ((caption (and (not (string= mode "inline-math"))
+ (org-element-property :caption table)))
+ (name (and (not (string= mode "inline-math"))
+ (org-element-property :name table)))
+ (matrices
+ (list 'latex-matrices
+ ;; Inherit name from the first table.
+ (list :name name
+ ;; FIXME: what syntax for captions?
+ ;;
+ ;; :caption caption
+ :markup
+ (cond ((string= mode "inline-math") 'inline)
+ ((or caption name) 'equation)
+ (t 'math)))))
+ (previous table)
+ (next (org-export-get-next-element table info)))
+ (org-element-insert-before matrices table)
+ ;; Swallow all contiguous tables sharing the same mode.
+ (while (and
+ (zerop (or (org-element-property :post-blank previous) 0))
+ (setq next (org-export-get-next-element previous info))
+ (eq (org-element-type next) 'table)
+ (eq (org-element-property :type next) 'org)
+ (string= (or (org-export-read-attribute
+ :attr_latex next :mode)
+ (plist-get info :latex-default-table-mode))
+ mode))
+ (org-element-put-property table :name nil)
+ (org-element-put-property table :caption nil)
+ (org-element-extract-element previous)
+ (org-element-adopt-elements matrices previous)
+ (setq previous next))
+ ;; Inherit `:post-blank' from the value of the last
+ ;; swallowed table. Set the latter's `:post-blank'
+ ;; value to 0 so as to not duplicate empty lines.
+ (org-element-put-property
+ matrices :post-blank (org-element-property :post-blank previous))
+ (org-element-put-property previous :post-blank 0)
+ (org-element-put-property table :name nil)
+ (org-element-put-property table :caption nil)
+ (org-element-extract-element previous)
+ (org-element-adopt-elements matrices previous))))))
+ info)
+ data)
+
+(defun org-latex-matrices (matrices contents info)
+ "Transcode a MATRICES element from Org to LaTeX.
+CONTENTS is a string. INFO is a plist used as a communication
+channel."
+ (pcase (org-element-property :markup matrices)
+ (`inline (format "\\(%s\\)" contents))
+ (`equation
+ (let ((caption (org-latex--caption/label-string matrices info))
+ (caption-above? (org-latex--caption-above-p matrices info)))
+ (concat "\\begin{equation}\n"
+ (and caption-above? caption)
+ contents
+ (and (not caption-above?) caption)
+ "\\end{equation}")))
+ (_
+ (format "\\[\n%s\\]" contents))))
+
+
+;;;; Pseudo Object: LaTeX Math Block
+
+;; `latex-math-block' objects have the following property:
+;; `:post-blank'.
+
+(defun org-latex--wrap-latex-math-block (data info)
+ "Merge contiguous math objects in a pseudo-object container.
+DATA is a parse tree or a secondary string. INFO is a plist
+containing export options. Modify DATA by side-effect and return it."
+ (let ((valid-object-p
+ ;; Non-nil when OBJECT can be added to a latex math block.
+ (lambda (object)
+ (pcase (org-element-type object)
+ (`entity (org-element-property :latex-math-p object))
+ (`latex-fragment
+ (let ((value (org-element-property :value object)))
+ (or (string-prefix-p "\\(" value)
+ (string-match-p "\\`\\$[^$]" value))))))))
+ (org-element-map data '(entity latex-fragment)
+ (lambda (object)
+ ;; Skip objects already wrapped.
+ (when (and (not (eq (org-element-type
+ (org-element-property :parent object))
+ 'latex-math-block))
+ (funcall valid-object-p object))
+ (let ((math-block (list 'latex-math-block nil))
+ (next-elements (org-export-get-next-element object info t))
+ (last object))
+ ;; Wrap MATH-BLOCK around OBJECT in DATA.
+ (org-element-insert-before math-block object)
+ (org-element-extract-element object)
+ (org-element-adopt-elements math-block object)
+ (when (zerop (or (org-element-property :post-blank object) 0))
+ ;; MATH-BLOCK swallows consecutive math objects.
+ (catch 'exit
+ (dolist (next next-elements)
+ (unless (funcall valid-object-p next) (throw 'exit nil))
+ (org-element-extract-element next)
+ (org-element-adopt-elements math-block next)
+ ;; Eschew the case: \beta$x$ -> \(\betax\).
+ (org-element-put-property last :post-blank 1)
+ (setq last next)
+ (when (> (or (org-element-property :post-blank next) 0) 0)
+ (throw 'exit nil)))))
+ (org-element-put-property
+ math-block :post-blank (org-element-property :post-blank last)))))
+ info nil '(latex-math-block) t)
+ ;; Return updated DATA.
+ data))
+
+(defun org-latex-math-block (_math-block contents _info)
+ "Transcode a MATH-BLOCK object from Org to LaTeX.
+CONTENTS is a string. INFO is a plist used as a communication
+channel."
+ (when (org-string-nw-p contents)
+ (format "\\(%s\\)" (org-trim contents))))
+
+;;;; Quote Block
+
+(defun org-latex-quote-block (quote-block contents info)
+ "Transcode a QUOTE-BLOCK element from Org to LaTeX.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (let ((environment
+ (or (org-export-read-attribute :attr_latex quote-block :environment)
+ (plist-get info :latex-default-quote-environment)))
+ (options
+ (or (org-export-read-attribute :attr_latex quote-block :options)
+ "")))
+ (org-latex--wrap-label
+ quote-block (format "\\begin{%s}%s\n%s\\end{%s}"
+ environment
+ options
+ contents
+ environment)
+ info)))
+
+;;;; Radio Target
+
+(defun org-latex-radio-target (radio-target text info)
+ "Transcode a RADIO-TARGET object from Org to LaTeX.
+TEXT is the text of the target. INFO is a plist holding
+contextual information."
+ (format "\\label{%s}%s" (org-export-get-reference radio-target info) text))
+
+
+;;;; Section
+
+(defun org-latex-section (_section contents _info)
+ "Transcode a SECTION element from Org to LaTeX.
+CONTENTS holds the contents of the section. INFO is a plist
+holding contextual information."
+ contents)
+
+
+;;;; Special Block
+
+(defun org-latex-special-block (special-block contents info)
+ "Transcode a SPECIAL-BLOCK element from Org to LaTeX.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (let ((type (org-element-property :type special-block))
+ (opt (org-export-read-attribute :attr_latex special-block :options))
+ (caption (org-latex--caption/label-string special-block info))
+ (caption-above-p (org-latex--caption-above-p special-block info)))
+ (concat (format "\\begin{%s}%s\n" type (or opt ""))
+ (and caption-above-p caption)
+ contents
+ (and (not caption-above-p) caption)
+ (format "\\end{%s}" type))))
+
+
+;;;; Src Block
+
+(defun org-latex-src-block (src-block _contents info)
+ "Transcode a SRC-BLOCK element from Org to LaTeX.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (when (org-string-nw-p (org-element-property :value src-block))
+ (let* ((lang (org-element-property :language src-block))
+ (caption (org-element-property :caption src-block))
+ (caption-above-p (org-latex--caption-above-p src-block info))
+ (label (org-element-property :name src-block))
+ (custom-env (and lang
+ (cadr (assq (intern lang)
+ org-latex-custom-lang-environments))))
+ (num-start (org-export-get-loc src-block info))
+ (retain-labels (org-element-property :retain-labels src-block))
+ (attributes (org-export-read-attribute :attr_latex src-block))
+ (float (plist-get attributes :float))
+ (listings (plist-get info :latex-listings)))
+ (cond
+ ;; Case 1. No source fontification.
+ ((or (not lang) (not listings))
+ (let ((caption-str (org-latex--caption/label-string src-block info))
+ (verbatim (format "\\begin{verbatim}\n%s\\end{verbatim}"
+ (org-export-format-code-default src-block info))))
+ (cond ((string= "multicolumn" float)
+ (format "\\begin{figure*}[%s]\n%s%s\n%s\\end{figure*}"
+ (plist-get info :latex-default-figure-position)
+ (if caption-above-p caption-str "")
+ verbatim
+ (if caption-above-p "" caption-str)))
+ (caption (concat
+ (if caption-above-p caption-str "")
+ verbatim
+ (if caption-above-p "" (concat "\n" caption-str))))
+ (t verbatim))))
+ ;; Case 2. Custom environment.
+ (custom-env
+ (let ((caption-str (org-latex--caption/label-string src-block info))
+ (formatted-src (org-export-format-code-default src-block info)))
+ (if (string-match-p "\\`[a-zA-Z0-9]+\\'" custom-env)
+ (format "\\begin{%s}\n%s\\end{%s}\n"
+ custom-env
+ (concat (and caption-above-p caption-str)
+ formatted-src
+ (and (not caption-above-p) caption-str))
+ custom-env)
+ (format-spec custom-env
+ `((?s . ,formatted-src)
+ (?c . ,caption)
+ (?f . ,float)
+ (?l . ,(org-latex--label src-block info))
+ (?o . ,(or (plist-get attributes :options) "")))))))
+ ;; Case 3. Use minted package.
+ ((eq listings 'minted)
+ (let* ((caption-str (org-latex--caption/label-string src-block info))
+ (placement (or (org-unbracket-string "[" "]" (plist-get attributes :placement))
+ (plist-get info :latex-default-figure-position)))
+ (float-env
+ (cond
+ ((string= "multicolumn" float)
+ (format "\\begin{listing*}[%s]\n%s%%s\n%s\\end{listing*}"
+ placement
+ (if caption-above-p caption-str "")
+ (if caption-above-p "" caption-str)))
+ (caption
+ (format "\\begin{listing}[%s]\n%s%%s\n%s\\end{listing}"
+ placement
+ (if caption-above-p caption-str "")
+ (if caption-above-p "" caption-str)))
+ ((string= "t" float)
+ (concat (format "\\begin{listing}[%s]\n"
+ placement)
+ "%s\n\\end{listing}"))
+ (t "%s")))
+ (options (plist-get info :latex-minted-options))
+ (body
+ (format
+ "\\begin{minted}[%s]{%s}\n%s\\end{minted}"
+ ;; Options.
+ (concat
+ (org-latex--make-option-string
+ (if (or (not num-start) (assoc "linenos" options))
+ options
+ (append
+ `(("linenos")
+ ("firstnumber" ,(number-to-string (1+ num-start))))
+ options)))
+ (let ((local-options (plist-get attributes :options)))
+ (and local-options (concat "," local-options))))
+ ;; Language.
+ (or (cadr (assq (intern lang)
+ (plist-get info :latex-minted-langs)))
+ (downcase lang))
+ ;; Source code.
+ (let* ((code-info (org-export-unravel-code src-block))
+ (max-width
+ (apply 'max
+ (mapcar 'length
+ (org-split-string (car code-info)
+ "\n")))))
+ (org-export-format-code
+ (car code-info)
+ (lambda (loc _num ref)
+ (concat
+ loc
+ (when ref
+ ;; Ensure references are flushed to the right,
+ ;; separated with 6 spaces from the widest line
+ ;; of code.
+ (concat (make-string (+ (- max-width (length loc)) 6)
+ ?\s)
+ (format "(%s)" ref)))))
+ nil (and retain-labels (cdr code-info)))))))
+ ;; Return value.
+ (format float-env body)))
+ ;; Case 4. Use listings package.
+ (t
+ (let ((lst-lang
+ (or (cadr (assq (intern lang)
+ (plist-get info :latex-listings-langs)))
+ lang))
+ (caption-str
+ (when caption
+ (let ((main (org-export-get-caption src-block))
+ (secondary (org-export-get-caption src-block t)))
+ (if (not secondary)
+ (format "{%s}" (org-export-data main info))
+ (format "{[%s]%s}"
+ (org-export-data secondary info)
+ (org-export-data main info))))))
+ (lst-opt (plist-get info :latex-listings-options)))
+ (concat
+ ;; Options.
+ (format
+ "\\lstset{%s}\n"
+ (concat
+ (org-latex--make-option-string
+ (append
+ lst-opt
+ (cond
+ ((and (not float) (plist-member attributes :float)) nil)
+ ((string= "multicolumn" float) '(("float" "*")))
+ ((and float (not (assoc "float" lst-opt)))
+ `(("float" ,(plist-get info :latex-default-figure-position)))))
+ `(("language" ,lst-lang))
+ (if label
+ `(("label" ,(org-latex--label src-block info)))
+ '(("label" " ")))
+ (if caption-str `(("caption" ,caption-str)) '(("caption" " ")))
+ `(("captionpos" ,(if caption-above-p "t" "b")))
+ (cond ((assoc "numbers" lst-opt) nil)
+ ((not num-start) '(("numbers" "none")))
+ (t `(("firstnumber" ,(number-to-string (1+ num-start)))
+ ("numbers" "left"))))))
+ (let ((local-options (plist-get attributes :options)))
+ (and local-options (concat "," local-options)))))
+ ;; Source code.
+ (format
+ "\\begin{lstlisting}\n%s\\end{lstlisting}"
+ (let* ((code-info (org-export-unravel-code src-block))
+ (max-width
+ (apply 'max
+ (mapcar 'length
+ (org-split-string (car code-info) "\n")))))
+ (org-export-format-code
+ (car code-info)
+ (lambda (loc _num ref)
+ (concat
+ loc
+ (when ref
+ ;; Ensure references are flushed to the right,
+ ;; separated with 6 spaces from the widest line of
+ ;; code
+ (concat (make-string (+ (- max-width (length loc)) 6) ?\s)
+ (format "(%s)" ref)))))
+ nil (and retain-labels (cdr code-info))))))))))))
+
+
+;;;; Statistics Cookie
+
+(defun org-latex-statistics-cookie (statistics-cookie _contents _info)
+ "Transcode a STATISTICS-COOKIE object from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (replace-regexp-in-string
+ "%" "\\%" (org-element-property :value statistics-cookie) nil t))
+
+
+;;;; Strike-Through
+
+(defun org-latex-strike-through (_strike-through contents info)
+ "Transcode STRIKE-THROUGH from Org to LaTeX.
+CONTENTS is the text with strike-through markup. INFO is a plist
+holding contextual information."
+ (org-latex--text-markup contents 'strike-through info))
+
+
+;;;; Subscript
+
+(defun org-latex-subscript (_subscript contents _info)
+ "Transcode a SUBSCRIPT object from Org to LaTeX.
+CONTENTS is the contents of the object."
+ (format "\\textsubscript{%s}" contents))
+
+
+;;;; Superscript
+
+(defun org-latex-superscript (_superscript contents _info)
+ "Transcode a SUPERSCRIPT object from Org to LaTeX.
+CONTENTS is the contents of the object."
+ (format "\\textsuperscript{%s}" contents))
+
+
+;;;; Table
+;;
+;; `org-latex-table' is the entry point for table transcoding. It
+;; takes care of tables with a "verbatim" mode. Otherwise, it
+;; delegates the job to either `org-latex--table.el-table',
+;; `org-latex--org-table' or `org-latex--math-table' functions,
+;; depending of the type of the table and the mode requested.
+;;
+;; `org-latex--align-string' is a subroutine used to build alignment
+;; string for Org tables.
+
+(defun org-latex-table (table contents info)
+ "Transcode a TABLE element from Org to LaTeX.
+CONTENTS is the contents of the table. INFO is a plist holding
+contextual information."
+ (if (eq (org-element-property :type table) 'table.el)
+ ;; "table.el" table. Convert it using appropriate tools.
+ (org-latex--table.el-table table info)
+ (let ((type (or (org-export-read-attribute :attr_latex table :mode)
+ (plist-get info :latex-default-table-mode))))
+ (cond
+ ;; Case 1: Verbatim table.
+ ((string= type "verbatim")
+ (format "\\begin{verbatim}\n%s\n\\end{verbatim}"
+ ;; Re-create table, without affiliated keywords.
+ (org-trim (org-element-interpret-data
+ `(table nil ,@(org-element-contents table))))))
+ ;; Case 2: Matrix.
+ ((or (string= type "math") (string= type "inline-math"))
+ (org-latex--math-table table info))
+ ;; Case 3: Standard table.
+ (t (concat (org-latex--org-table table contents info)
+ ;; When there are footnote references within the
+ ;; table, insert their definition just after it.
+ (org-latex--delayed-footnotes-definitions table info)))))))
+
+(defun org-latex--align-string (table info &optional math?)
+ "Return an appropriate LaTeX alignment string.
+TABLE is the considered table. INFO is a plist used as
+a communication channel. When optional argument MATH? is
+non-nil, TABLE is meant to be a matrix, where all cells are
+centered."
+ (or (org-export-read-attribute :attr_latex table :align)
+ (let (align)
+ ;; Extract column groups and alignment from first (non-rule)
+ ;; row.
+ (org-element-map
+ (org-element-map table 'table-row
+ (lambda (row)
+ (and (eq (org-element-property :type row) 'standard) row))
+ info 'first-match)
+ 'table-cell
+ (lambda (cell)
+ (let ((borders (org-export-table-cell-borders cell info)))
+ ;; Check left border for the first cell only.
+ (when (and (memq 'left borders) (not align))
+ (push "|" align))
+ (push (if math? "c" ;center cells in matrices
+ (cl-case (org-export-table-cell-alignment cell info)
+ (left "l")
+ (right "r")
+ (center "c")))
+ align)
+ (when (memq 'right borders) (push "|" align))))
+ info)
+ (apply 'concat (nreverse align)))))
+
+(defun org-latex--decorate-table (table attributes caption above? info)
+ "Decorate TABLE string with caption and float environment.
+
+ATTRIBUTES is the plist containing LaTeX attributes. CAPTION is
+its caption, as a string or nil. It is located above the table
+if ABOVE? is non-nil. INFO is the plist containing current
+export parameters.
+
+Return new environment, as a string."
+ (let* ((float-environment
+ (let ((float (plist-get attributes :float)))
+ (cond ((and (not float) (plist-member attributes :float)) nil)
+ ((member float '("sidewaystable" "sideways")) "sidewaystable")
+ ((equal float "multicolumn") "table*")
+ (float float)
+ ((org-string-nw-p caption) "table")
+ (t nil))))
+ (placement
+ (or (plist-get attributes :placement)
+ (format "[%s]" (plist-get info :latex-default-figure-position))))
+ (center? (if (plist-member attributes :center)
+ (plist-get attributes :center)
+ (plist-get info :latex-tables-centered)))
+ (fontsize (let ((font (plist-get attributes :font)))
+ (and font (concat font "\n")))))
+ (concat (cond
+ (float-environment
+ (concat (format "\\begin{%s}%s\n" float-environment placement)
+ (if above? caption "")
+ (when center? "\\centering\n")
+ fontsize))
+ (caption
+ (concat (and center? "\\begin{center}\n" )
+ (if above? caption "")
+ (cond ((and fontsize center?) fontsize)
+ (fontsize (concat "{" fontsize))
+ (t nil))))
+ (center? (concat "\\begin{center}\n" fontsize))
+ (fontsize (concat "{" fontsize)))
+ table
+ (cond
+ (float-environment
+ (concat (if above? "" (concat "\n" caption))
+ (format "\n\\end{%s}" float-environment)))
+ (caption
+ (concat (if above? "" (concat "\n" caption))
+ (and center? "\n\\end{center}")
+ (and fontsize (not center?) "}")))
+ (center? "\n\\end{center}")
+ (fontsize "}")))))
+
+(defun org-latex--org-table (table contents info)
+ "Return appropriate LaTeX code for an Org table.
+
+TABLE is the table type element to transcode. CONTENTS is its
+contents, as a string. INFO is a plist used as a communication
+channel.
+
+This function assumes TABLE has `org' as its `:type' property and
+`table' as its `:mode' attribute."
+ (let* ((attr (org-export-read-attribute :attr_latex table))
+ (alignment (org-latex--align-string table info))
+ (table-env (or (plist-get attr :environment)
+ (plist-get info :latex-default-table-environment)))
+ (width
+ (let ((w (plist-get attr :width)))
+ (cond ((not w) "")
+ ((member table-env '("tabular" "longtable")) "")
+ ((member table-env '("tabu" "longtabu"))
+ (format (if (plist-get attr :spread) " spread %s "
+ " to %s ")
+ w))
+ (t (format "{%s}" w)))))
+ (caption (org-latex--caption/label-string table info))
+ (above? (org-latex--caption-above-p table info)))
+ (cond
+ ((member table-env '("longtable" "longtabu"))
+ (let ((fontsize (let ((font (plist-get attr :font)))
+ (and font (concat font "\n")))))
+ (concat (and fontsize (concat "{" fontsize))
+ (format "\\begin{%s}%s{%s}\n" table-env width alignment)
+ (and above?
+ (org-string-nw-p caption)
+ (concat caption "\\\\\n"))
+ contents
+ (and (not above?)
+ (org-string-nw-p caption)
+ (concat caption "\\\\\n"))
+ (format "\\end{%s}" table-env)
+ (and fontsize "}"))))
+ (t
+ (let ((output (format "\\begin{%s}%s{%s}\n%s\\end{%s}"
+ table-env
+ width
+ alignment
+ contents
+ table-env)))
+ (org-latex--decorate-table output attr caption above? info))))))
+
+(defun org-latex--table.el-table (table info)
+ "Return appropriate LaTeX code for a table.el table.
+
+TABLE is the table type element to transcode. INFO is a plist
+used as a communication channel.
+
+This function assumes TABLE has `table.el' as its `:type'
+property."
+ (require 'table)
+ ;; Ensure "*org-export-table*" buffer is empty.
+ (with-current-buffer (get-buffer-create "*org-export-table*")
+ (erase-buffer))
+ (let ((output
+ (replace-regexp-in-string
+ "^%.*\n" "" ;remove comments
+ (with-temp-buffer
+ (save-excursion (insert (org-element-property :value table)))
+ (re-search-forward "^[ \t]*|[^|]" nil t)
+ (table-generate-source 'latex "*org-export-table*")
+ (with-current-buffer "*org-export-table*"
+ (org-trim (buffer-string))))
+ t t)))
+ (kill-buffer (get-buffer "*org-export-table*"))
+ (let ((attr (org-export-read-attribute :attr_latex table))
+ (caption (org-latex--caption/label-string table info))
+ (above? (org-latex--caption-above-p table info)))
+ (when (plist-get attr :rmlines)
+ ;; When the "rmlines" attribute is provided, remove all hlines
+ ;; but the one separating heading from the table body.
+ (let ((n 0) (pos 0))
+ (while (and (< (length output) pos)
+ (setq pos (string-match "^\\\\hline\n?" output pos)))
+ (cl-incf n)
+ (unless (= n 2) (setq output (replace-match "" nil nil output))))))
+ (org-latex--decorate-table output attr caption above? info))))
+
+(defun org-latex--math-table (table info)
+ "Return appropriate LaTeX code for a matrix.
+
+TABLE is the table type element to transcode. INFO is a plist
+used as a communication channel.
+
+This function assumes TABLE has `org' as its `:type' property and
+`inline-math' or `math' as its `:mode' attribute."
+ (let* ((attr (org-export-read-attribute :attr_latex table))
+ (env (or (plist-get attr :environment)
+ (plist-get info :latex-default-table-environment)))
+ (contents
+ (mapconcat
+ (lambda (row)
+ (if (eq (org-element-property :type row) 'rule) "\\hline"
+ ;; Return each cell unmodified.
+ (concat
+ (mapconcat
+ (lambda (cell)
+ (substring (org-element-interpret-data cell) 0 -1))
+ (org-element-map row 'table-cell #'identity info) "&")
+ (or (cdr (assoc env org-latex-table-matrix-macros)) "\\\\")
+ "\n")))
+ (org-element-map table 'table-row #'identity info) "")))
+ (concat
+ ;; Prefix.
+ (plist-get attr :math-prefix)
+ ;; Environment. Also treat special cases.
+ (cond ((member env '("array" "tabular"))
+ (format "\\begin{%s}{%s}\n%s\\end{%s}"
+ env (org-latex--align-string table info t) contents env))
+ ((assoc env org-latex-table-matrix-macros)
+ (format "\\%s%s{\n%s}"
+ env
+ (or (plist-get attr :math-arguments) "")
+ contents))
+ (t (format "\\begin{%s}\n%s\\end{%s}" env contents env)))
+ ;; Suffix.
+ (plist-get attr :math-suffix))))
+
+
+;;;; Table Cell
+
+(defun org-latex-table-cell (table-cell contents info)
+ "Transcode a TABLE-CELL element from Org to LaTeX.
+CONTENTS is the cell contents. INFO is a plist used as
+a communication channel."
+ (concat
+ (let ((scientific-format (plist-get info :latex-table-scientific-notation)))
+ (if (and contents
+ scientific-format
+ (string-match orgtbl-exp-regexp contents))
+ ;; Use appropriate format string for scientific
+ ;; notation.
+ (format scientific-format
+ (match-string 1 contents)
+ (match-string 2 contents))
+ contents))
+ (when (org-export-get-next-element table-cell info) " & ")))
+
+
+;;;; Table Row
+
+(defun org-latex-table-row (table-row contents info)
+ "Transcode a TABLE-ROW element from Org to LaTeX.
+CONTENTS is the contents of the row. INFO is a plist used as
+a communication channel."
+ (let* ((attr (org-export-read-attribute :attr_latex
+ (org-export-get-parent table-row)))
+ (booktabsp (if (plist-member attr :booktabs) (plist-get attr :booktabs)
+ (plist-get info :latex-tables-booktabs)))
+ (longtablep
+ (member (or (plist-get attr :environment)
+ (plist-get info :latex-default-table-environment))
+ '("longtable" "longtabu"))))
+ (if (eq (org-element-property :type table-row) 'rule)
+ (cond
+ ((not booktabsp) "\\hline")
+ ((not (org-export-get-previous-element table-row info)) "\\toprule")
+ ((not (org-export-get-next-element table-row info)) "\\bottomrule")
+ ((and longtablep
+ (org-export-table-row-ends-header-p
+ (org-export-get-previous-element table-row info) info))
+ "")
+ (t "\\midrule"))
+ (concat
+ ;; When BOOKTABS are activated enforce top-rule even when no
+ ;; hline was specifically marked.
+ (and booktabsp (not (org-export-get-previous-element table-row info))
+ "\\toprule\n")
+ contents "\\\\\n"
+ (cond
+ ;; Special case for long tables. Define header and footers.
+ ((and longtablep (org-export-table-row-ends-header-p table-row info))
+ (let ((columns (cdr (org-export-table-dimensions
+ (org-export-get-parent-table table-row) info))))
+ (format "%s
+\\endfirsthead
+\\multicolumn{%d}{l}{%s} \\\\
+%s
+%s \\\\\n
+%s
+\\endhead
+%s\\multicolumn{%d}{r}{%s} \\\\
+\\endfoot
+\\endlastfoot"
+ (if booktabsp "\\midrule" "\\hline")
+ columns
+ (org-latex--translate "Continued from previous page" info)
+ (cond
+ ((not (org-export-table-row-starts-header-p table-row info))
+ "")
+ (booktabsp "\\toprule\n")
+ (t "\\hline\n"))
+ contents
+ (if booktabsp "\\midrule" "\\hline")
+ (if booktabsp "\\midrule" "\\hline")
+ columns
+ (org-latex--translate "Continued on next page" info))))
+ ;; When BOOKTABS are activated enforce bottom rule even when
+ ;; no hline was specifically marked.
+ ((and booktabsp (not (org-export-get-next-element table-row info)))
+ "\\bottomrule"))))))
+
+
+;;;; Target
+
+(defun org-latex-target (target _contents info)
+ "Transcode a TARGET object from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (format "\\label{%s}" (org-latex--label target info)))
+
+
+;;;; Timestamp
+
+(defun org-latex-timestamp (timestamp _contents info)
+ "Transcode a TIMESTAMP object from Org to LaTeX.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (let ((value (org-latex-plain-text (org-timestamp-translate timestamp) info)))
+ (format
+ (plist-get info
+ (cl-case (org-element-property :type timestamp)
+ ((active active-range) :latex-active-timestamp-format)
+ ((inactive inactive-range) :latex-inactive-timestamp-format)
+ (otherwise :latex-diary-timestamp-format)))
+ value)))
+
+
+;;;; Underline
+
+(defun org-latex-underline (_underline contents info)
+ "Transcode UNDERLINE from Org to LaTeX.
+CONTENTS is the text with underline markup. INFO is a plist
+holding contextual information."
+ (org-latex--text-markup contents 'underline info))
+
+
+;;;; Verbatim
+
+(defun org-latex-verbatim (verbatim _contents info)
+ "Transcode a VERBATIM object from Org to LaTeX.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (org-latex--text-markup
+ (org-element-property :value verbatim) 'verbatim info))
+
+
+;;;; Verse Block
+
+(defun org-latex-verse-block (verse-block contents info)
+ "Transcode a VERSE-BLOCK element from Org to LaTeX.
+CONTENTS is verse block contents. INFO is a plist holding
+contextual information."
+ (let* ((lin (org-export-read-attribute :attr_latex verse-block :lines))
+ (latcode (org-export-read-attribute :attr_latex verse-block :latexcode))
+ (cent (org-export-read-attribute :attr_latex verse-block :center))
+ (attr (concat
+ (if cent "[\\versewidth]" "")
+ (if lin (format "\n\\poemlines{%s}" lin) "")
+ (if latcode (format "\n%s" latcode) "")))
+ (versewidth (org-export-read-attribute :attr_latex verse-block :versewidth))
+ (vwidth (if versewidth (format "\\settowidth{\\versewidth}{%s}\n" versewidth) ""))
+ (linreset (if lin "\n\\poemlines{0}" "")))
+ (concat
+ (org-latex--wrap-label
+ verse-block
+ ;; In a verse environment, add a line break to each newline
+ ;; character and change each white space at beginning of a line
+ ;; into a space of 1 em. Also change each blank line with
+ ;; a vertical space of 1 em.
+ (format "%s\\begin{verse}%s\n%s\\end{verse}%s"
+ vwidth
+ attr
+ (replace-regexp-in-string
+ "^[ \t]+" (lambda (m) (format "\\hspace*{%dem}" (length m)))
+ (replace-regexp-in-string
+ "^[ \t]*\\\\\\\\$" "\\vspace*{1em}"
+ (replace-regexp-in-string
+ "\\([ \t]*\\\\\\\\\\)?[ \t]*\n" "\\\\\n"
+ contents nil t) nil t) nil t) linreset)
+ info)
+ ;; Insert footnote definitions, if any, after the environment, so
+ ;; the special formatting above is not applied to them.
+ (org-latex--delayed-footnotes-definitions verse-block info))))
+
+
+;;; End-user functions
+
+;;;###autoload
+(defun org-latex-export-as-latex
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer as a LaTeX buffer.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Export is done in a buffer named \"*Org LATEX Export*\", which
+will be displayed when `org-export-show-temporary-export-buffer'
+is non-nil."
+ (interactive)
+ (org-export-to-buffer 'latex "*Org LATEX Export*"
+ async subtreep visible-only body-only ext-plist (lambda () (LaTeX-mode))))
+
+;;;###autoload
+(defun org-latex-convert-region-to-latex ()
+ "Assume the current region has Org syntax, and convert it to LaTeX.
+This can be used in any buffer. For example, you can write an
+itemized list in Org syntax in an LaTeX buffer and use this
+command to convert it."
+ (interactive)
+ (org-export-replace-region-by 'latex))
+
+;;;###autoload
+(defun org-latex-export-to-latex
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer to a LaTeX file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings."
+ (interactive)
+ (let ((outfile (org-export-output-file-name ".tex" subtreep)))
+ (org-export-to-file 'latex outfile
+ async subtreep visible-only body-only ext-plist)))
+
+;;;###autoload
+(defun org-latex-export-to-pdf
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer to LaTeX then process through to PDF.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return PDF file's name."
+ (interactive)
+ (let ((outfile (org-export-output-file-name ".tex" subtreep)))
+ (org-export-to-file 'latex outfile
+ async subtreep visible-only body-only ext-plist
+ #'org-latex-compile)))
+
+(defun org-latex-compile (texfile &optional snippet)
+ "Compile a TeX file.
+
+TEXFILE is the name of the file being compiled. Processing is
+done through the command specified in `org-latex-pdf-process',
+which see. Output is redirected to \"*Org PDF LaTeX Output*\"
+buffer.
+
+When optional argument SNIPPET is non-nil, TEXFILE is a temporary
+file used to preview a LaTeX snippet. In this case, do not
+create a log buffer and do not remove log files.
+
+Return PDF file name or raise an error if it couldn't be
+produced."
+ (unless snippet (message "Processing LaTeX file %s..." texfile))
+ (let* ((compiler
+ (or (with-temp-buffer
+ (save-excursion (insert-file-contents texfile))
+ (and (search-forward-regexp (regexp-opt org-latex-compilers)
+ (line-end-position 2)
+ t)
+ (progn (beginning-of-line) (looking-at-p "%"))
+ (match-string 0)))
+ "pdflatex"))
+ (process (if (functionp org-latex-pdf-process) org-latex-pdf-process
+ ;; Replace "%latex" with "%L" and "%bib" and
+ ;; "%bibtex" with "%B" to adhere to `format-spec'
+ ;; specifications.
+ (mapcar (lambda (command)
+ (replace-regexp-in-string
+ "%\\(?:\\(?:bib\\|la\\)tex\\|bib\\)\\>"
+ (lambda (m) (upcase (substring m 0 2)))
+ command))
+ org-latex-pdf-process)))
+ (spec `((?B . ,(shell-quote-argument org-latex-bib-compiler))
+ (?L . ,(shell-quote-argument compiler))))
+ (log-buf-name "*Org PDF LaTeX Output*")
+ (log-buf (and (not snippet) (get-buffer-create log-buf-name)))
+ (outfile (org-compile-file texfile process "pdf"
+ (format "See %S for details" log-buf-name)
+ log-buf spec)))
+ (unless snippet
+ (when org-latex-remove-logfiles
+ (mapc #'delete-file
+ (directory-files
+ (file-name-directory outfile)
+ t
+ (concat (regexp-quote (file-name-base outfile))
+ "\\(?:\\.[0-9]+\\)?\\."
+ (regexp-opt org-latex-logfiles-extensions))
+ t)))
+ (let ((warnings (org-latex--collect-warnings log-buf)))
+ (message (concat "PDF file produced"
+ (cond
+ ((eq warnings 'error) " with errors.")
+ (warnings (concat " with warnings: " warnings))
+ (t "."))))))
+ ;; Return output file name.
+ outfile))
+
+(defun org-latex--collect-warnings (buffer)
+ "Collect some warnings from \"pdflatex\" command output.
+BUFFER is the buffer containing output. Return collected
+warnings types as a string, `error' if a LaTeX error was
+encountered or nil if there was none."
+ (with-current-buffer buffer
+ (save-excursion
+ (goto-char (point-max))
+ (when (re-search-backward "^[ \t]*This is .*?TeX.*?Version" nil t)
+ (if (re-search-forward "^!" nil t) 'error
+ (let ((case-fold-search t)
+ (warnings ""))
+ (dolist (warning org-latex-known-warnings)
+ (when (save-excursion (re-search-forward (car warning) nil t))
+ (setq warnings (concat warnings " " (cdr warning)))))
+ (org-string-nw-p (org-trim warnings))))))))
+
+;;;###autoload
+(defun org-latex-publish-to-latex (plist filename pub-dir)
+ "Publish an Org file to LaTeX.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name."
+ (org-publish-org-to 'latex filename ".tex" plist pub-dir))
+
+;;;###autoload
+(defun org-latex-publish-to-pdf (plist filename pub-dir)
+ "Publish an Org file to PDF (via LaTeX).
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name."
+ ;; Unlike to `org-latex-publish-to-latex', PDF file is generated
+ ;; in working directory and then moved to publishing directory.
+ (org-publish-attachment
+ plist
+ ;; Default directory could be anywhere when this function is
+ ;; called. We ensure it is set to source file directory during
+ ;; compilation so as to not break links to external documents.
+ (let ((default-directory (file-name-directory filename)))
+ (org-latex-compile
+ (org-publish-org-to
+ 'latex filename ".tex" plist (file-name-directory filename))))
+ pub-dir))
+
+
+(provide 'ox-latex)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ox-latex.el ends here
diff --git a/elpa/org-9.5.2/ox-latex.elc b/elpa/org-9.5.2/ox-latex.elc
new file mode 100644
index 0000000..32a1383
--- /dev/null
+++ b/elpa/org-9.5.2/ox-latex.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ox-man.el b/elpa/org-9.5.2/ox-man.el
new file mode 100644
index 0000000..9a1f00f
--- /dev/null
+++ b/elpa/org-9.5.2/ox-man.el
@@ -0,0 +1,1141 @@
+;;; ox-man.el --- Man Back-End for Org Export Engine -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <n.goaziou at gmail dot com>
+;; Luis R Anaya <papoanaya aroba hot mail punto com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; This library implements a Man back-end for Org generic exporter.
+;;
+;; To test it, run
+;;
+;; M-: (org-export-to-buffer 'man "*Test Man*") RET
+;;
+;; in an Org buffer then switch to the buffer to see the Man export.
+;; See ox.el for more details on how this exporter works.
+;;
+;; It introduces one new buffer keywords:
+;; "MAN_CLASS_OPTIONS".
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ox)
+
+;;; Function Declarations
+
+(defvar org-export-man-default-packages-alist)
+(defvar org-export-man-packages-alist)
+(defvar orgtbl-exp-regexp)
+
+
+
+;;; Define Back-End
+
+(org-export-define-backend 'man
+ '((babel-call . org-man-babel-call)
+ (bold . org-man-bold)
+ (center-block . org-man-center-block)
+ (code . org-man-code)
+ (drawer . org-man-drawer)
+ (dynamic-block . org-man-dynamic-block)
+ (entity . org-man-entity)
+ (example-block . org-man-example-block)
+ (export-block . org-man-export-block)
+ (export-snippet . org-man-export-snippet)
+ (fixed-width . org-man-fixed-width)
+ (footnote-definition . org-man-footnote-definition)
+ (footnote-reference . org-man-footnote-reference)
+ (headline . org-man-headline)
+ (horizontal-rule . org-man-horizontal-rule)
+ (inline-babel-call . org-man-inline-babel-call)
+ (inline-src-block . org-man-inline-src-block)
+ (inlinetask . org-man-inlinetask)
+ (italic . org-man-italic)
+ (item . org-man-item)
+ (keyword . org-man-keyword)
+ (line-break . org-man-line-break)
+ (link . org-man-link)
+ (node-property . org-man-node-property)
+ (paragraph . org-man-paragraph)
+ (plain-list . org-man-plain-list)
+ (plain-text . org-man-plain-text)
+ (planning . org-man-planning)
+ (property-drawer . org-man-property-drawer)
+ (quote-block . org-man-quote-block)
+ (radio-target . org-man-radio-target)
+ (section . org-man-section)
+ (special-block . org-man-special-block)
+ (src-block . org-man-src-block)
+ (statistics-cookie . org-man-statistics-cookie)
+ (strike-through . org-man-strike-through)
+ (subscript . org-man-subscript)
+ (superscript . org-man-superscript)
+ (table . org-man-table)
+ (table-cell . org-man-table-cell)
+ (table-row . org-man-table-row)
+ (target . org-man-target)
+ (template . org-man-template)
+ (timestamp . org-man-timestamp)
+ (underline . org-man-underline)
+ (verbatim . org-man-verbatim)
+ (verse-block . org-man-verse-block))
+ :menu-entry
+ '(?M "Export to MAN"
+ ((?m "As MAN file" org-man-export-to-man)
+ (?p "As PDF file" org-man-export-to-pdf)
+ (?o "As PDF file and open"
+ (lambda (a s v b)
+ (if a (org-man-export-to-pdf t s v b)
+ (org-open-file (org-man-export-to-pdf nil s v b)))))))
+ :options-alist
+ '((:man-class "MAN_CLASS" nil nil t)
+ (:man-class-options "MAN_CLASS_OPTIONS" nil nil t)
+ (:man-header-extra "MAN_HEADER" nil nil newline)
+ ;; Other variables.
+ (:man-tables-centered nil nil org-man-tables-centered)
+ (:man-tables-verbatim nil nil org-man-tables-verbatim)
+ (:man-table-scientific-notation nil nil org-man-table-scientific-notation)
+ (:man-source-highlight nil nil org-man-source-highlight)
+ (:man-source-highlight-langs nil nil org-man-source-highlight-langs)))
+
+
+
+;;; User Configurable Variables
+
+(defgroup org-export-man nil
+ "Options for exporting Org mode files to Man."
+ :tag "Org Export Man"
+ :group 'org-export)
+
+;;; Tables
+
+(defcustom org-man-tables-centered t
+ "When non-nil, tables are exported in a center environment."
+ :group 'org-export-man
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defcustom org-man-tables-verbatim nil
+ "When non-nil, tables are exported verbatim."
+ :group 'org-export-man
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+
+(defcustom org-man-table-scientific-notation "%sE%s"
+ "Format string to display numbers in scientific notation.
+The format should have \"%s\" twice, for mantissa and exponent
+\(i.e. \"%s\\\\times10^{%s}\").
+
+When nil, no transformation is made."
+ :group 'org-export-man
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (string :tag "Format string")
+ (const :tag "No formatting")))
+
+
+;;; Inlinetasks
+;; Src blocks
+
+(defcustom org-man-source-highlight nil
+ "Use GNU source highlight to embellish source blocks."
+ :group 'org-export-man
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+
+(defcustom org-man-source-highlight-langs
+ '((emacs-lisp "lisp") (lisp "lisp") (clojure "lisp")
+ (scheme "scheme")
+ (c "c") (cc "cpp") (csharp "csharp") (d "d")
+ (fortran "fortran") (cobol "cobol") (pascal "pascal")
+ (ada "ada") (asm "asm")
+ (perl "perl") (cperl "perl")
+ (python "python") (ruby "ruby") (tcl "tcl") (lua "lua")
+ (java "java") (javascript "javascript")
+ (tex "latex")
+ (shell-script "sh") (awk "awk") (diff "diff") (m4 "m4")
+ (ocaml "caml") (caml "caml")
+ (sql "sql") (sqlite "sql")
+ (html "html") (css "css") (xml "xml")
+ (bat "bat") (bison "bison") (clipper "clipper")
+ (ldap "ldap") (opa "opa")
+ (php "php") (postscript "postscript") (prolog "prolog")
+ (properties "properties") (makefile "makefile")
+ (tml "tml") (vbscript "vbscript") (xorg "xorg"))
+ "Alist mapping languages to their listing language counterpart.
+The key is a symbol, the major mode symbol without the \"-mode\".
+The value is the string that should be inserted as the language
+parameter for the listings package. If the mode name and the
+listings name are the same, the language does not need an entry
+in this list - but it does not hurt if it is present."
+ :group 'org-export-man
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(repeat
+ (list
+ (symbol :tag "Major mode ")
+ (string :tag "Listings language"))))
+
+
+;;; Compilation
+
+(defcustom org-man-pdf-process
+ '("tbl %f | eqn | groff -man | ps2pdf - > %b.pdf"
+ "tbl %f | eqn | groff -man | ps2pdf - > %b.pdf"
+ "tbl %f | eqn | groff -man | ps2pdf - > %b.pdf")
+
+ "Commands to process a Man file to a PDF file.
+
+This is a list of strings, each of them will be given to the
+shell as a command. %f in the command will be replaced by the
+relative file name, %F by the absolute file name, %b by the file
+base name (i.e. without directory and extension parts), %o by the
+base directory of the file and %O by the absolute file name of
+the output file.
+
+By default, Org uses 3 runs of to do the processing.
+
+Alternatively, this may be a Lisp function that does the
+processing. This function should accept the file name as
+its single argument."
+ :group 'org-export-pdf
+ :group 'org-export-man
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (repeat :tag "Shell command sequence"
+ (string :tag "Shell command"))
+ (const :tag "2 runs of pdfgroff"
+ ("tbl %f | eqn | groff -mm | ps2pdf - > %b.pdf"
+ "tbl %f | eqn | groff -mm | ps2pdf - > %b.pdf" ))
+ (const :tag "3 runs of pdfgroff"
+ ("tbl %f | eqn | groff -mm | ps2pdf - > %b.pdf"
+ "tbl %f | eqn | groff -mm | ps2pdf - > %b.pdf"
+ "tbl %f | eqn | groff -mm | ps2pdf - > %b.pdf"))
+ (function)))
+
+(defcustom org-man-logfiles-extensions
+ '("log" "out" "toc")
+ "The list of file extensions to consider as Man logfiles."
+ :group 'org-export-man
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(repeat (string :tag "Extension")))
+
+(defcustom org-man-remove-logfiles t
+ "Non-nil means remove the logfiles produced by PDF production.
+These are the .aux, .log, .out, and .toc files."
+ :group 'org-export-man
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+
+
+;;; Internal Functions
+
+(defun org-man--caption/label-string (element info)
+ "Return caption and label Man string for ELEMENT.
+
+INFO is a plist holding contextual information. If there's no
+caption nor label, return the empty string.
+
+For non-floats, see `org-man--wrap-label'."
+ (let ((label (org-element-property :label element))
+ (main (org-export-get-caption element))
+ (short (org-export-get-caption element t)))
+ (cond ((and (not main) (not label)) "")
+ ((not main) (format "\\fI%s\\fP" label))
+ ;; Option caption format with short name.
+ (short (format "\\fR%s\\fP - \\fI\\P - %s\n"
+ (org-export-data short info)
+ (org-export-data main info)))
+ ;; Standard caption format.
+ (t (format "\\fR%s\\fP" (org-export-data main info))))))
+
+(defun org-man--wrap-label (element output)
+ "Wrap label associated to ELEMENT around OUTPUT, if appropriate.
+This function shouldn't be used for floats. See
+`org-man--caption/label-string'."
+ (let ((label (org-element-property :name element)))
+ (if (or (not output) (not label) (string= output "") (string= label ""))
+ output
+ (concat (format "%s\n.br\n" label) output))))
+
+(defun org-man--protect-text (text)
+ "Protect minus and backslash characters in string TEXT."
+ (replace-regexp-in-string "-" "\\-" text nil t))
+
+
+
+;;; Template
+
+(defun org-man-template (contents info)
+ "Return complete document string after Man conversion.
+CONTENTS is the transcoded contents string. INFO is a plist
+holding export options."
+ (let* ((title (when (plist-get info :with-title)
+ (org-export-data (plist-get info :title) info)))
+ (attr (read (format "(%s)"
+ (mapconcat
+ #'identity
+ (list (plist-get info :man-class-options))
+ " "))))
+ (section-item (plist-get attr :section-id)))
+
+ (concat
+
+ (cond
+ ((and title (stringp section-item))
+ (format ".TH \"%s\" \"%s\" \n" title section-item))
+ ((and (string= "" title) (stringp section-item))
+ (format ".TH \"%s\" \"%s\" \n" " " section-item))
+ (title
+ (format ".TH \"%s\" \"1\" \n" title))
+ (t
+ ".TH \" \" \"1\" "))
+ contents)))
+
+
+
+
+;;; Transcode Functions
+
+;;; Babel Call
+;;
+;; Babel Calls are ignored.
+
+
+;;; Bold
+
+(defun org-man-bold (_bold contents _info)
+ "Transcode BOLD from Org to Man.
+CONTENTS is the text with bold markup. INFO is a plist holding
+contextual information."
+ (format "\\fB%s\\fP" contents))
+
+
+;;; Center Block
+
+(defun org-man-center-block (center-block contents _info)
+ "Transcode a CENTER-BLOCK element from Org to Man.
+CONTENTS holds the contents of the center block. INFO is a plist
+holding contextual information."
+ (org-man--wrap-label
+ center-block
+ (format ".ce %d\n.nf\n%s\n.fi"
+ (- (length (split-string contents "\n")) 1 )
+ contents)))
+
+
+;;; Code
+
+(defun org-man-code (code _contents _info)
+ "Transcode a CODE object from Org to Man."
+ (format "\\fC%s\\fP"
+ (org-man--protect-text (org-element-property :value code))))
+
+
+;;; Drawer
+
+(defun org-man-drawer (_drawer contents _info)
+ "Transcode a DRAWER element from Org to Man.
+DRAWER holds the drawer information
+CONTENTS holds the contents of the block.
+INFO is a plist holding contextual information."
+ contents)
+
+
+;;; Dynamic Block
+
+(defun org-man-dynamic-block (dynamic-block contents _info)
+ "Transcode a DYNAMIC-BLOCK element from Org to Man.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information. See `org-export-data'."
+ (org-man--wrap-label dynamic-block contents))
+
+
+;;; Entity
+
+(defun org-man-entity (entity _contents _info)
+ "Transcode an ENTITY object from Org to Man.
+CONTENTS are the definition itself. INFO is a plist holding
+contextual information."
+ (org-element-property :utf-8 entity))
+
+
+;;; Example Block
+
+(defun org-man-example-block (example-block _contents info)
+ "Transcode an EXAMPLE-BLOCK element from Org to Man.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (org-man--wrap-label
+ example-block
+ (format ".RS\n.nf\n%s\n.fi\n.RE"
+ (org-export-format-code-default example-block info))))
+
+
+;;; Export Block
+
+(defun org-man-export-block (export-block _contents _info)
+ "Transcode a EXPORT-BLOCK element from Org to Man.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (when (string= (org-element-property :type export-block) "MAN")
+ (org-remove-indentation (org-element-property :value export-block))))
+
+
+;;; Export Snippet
+
+(defun org-man-export-snippet (export-snippet _contents _info)
+ "Transcode a EXPORT-SNIPPET object from Org to Man.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (when (eq (org-export-snippet-backend export-snippet) 'man)
+ (org-element-property :value export-snippet)))
+
+
+;;; Fixed Width
+
+(defun org-man-fixed-width (fixed-width _contents _info)
+ "Transcode a FIXED-WIDTH element from Org to Man.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (org-man--wrap-label
+ fixed-width
+ (format "\\fC\n%s\n\\fP"
+ (org-remove-indentation
+ (org-element-property :value fixed-width)))))
+
+
+;;; Footnote Definition
+;;
+;; Footnote Definitions are ignored.
+
+;;; Footnote References
+;;
+;; Footnote References are Ignored
+
+
+;;; Headline
+
+(defun org-man-headline (headline contents info)
+ "Transcode a HEADLINE element from Org to Man.
+CONTENTS holds the contents of the headline. INFO is a plist
+holding contextual information."
+ (let* ((level (org-export-get-relative-level headline info))
+ ;; Section formatting will set two placeholders: one for the
+ ;; title and the other for the contents.
+ (section-fmt
+ (pcase level
+ (1 ".SH \"%s\"\n%s")
+ (2 ".SS \"%s\"\n%s")
+ (3 ".SS \"%s\"\n%s")
+ (_ nil)))
+ (text (org-export-data (org-element-property :title headline) info)))
+
+ (cond
+ ;; Case 1: This is a footnote section: ignore it.
+ ((org-element-property :footnote-section-p headline) nil)
+
+ ;; Case 2. This is a deep sub-tree: export it as a list item.
+ ;; Also export as items headlines for which no section
+ ;; format has been found.
+ ((or (not section-fmt) (org-export-low-level-p headline info))
+ ;; Build the real contents of the sub-tree.
+ (let ((low-level-body
+ (concat
+ ;; If the headline is the first sibling, start a list.
+ (when (org-export-first-sibling-p headline info)
+ (format "%s\n" ".RS"))
+ ;; Itemize headline
+ ".TP\n.ft I\n" text "\n.ft\n"
+ contents ".RE")))
+ ;; If headline is not the last sibling simply return
+ ;; LOW-LEVEL-BODY. Otherwise, also close the list, before any
+ ;; blank line.
+ (if (not (org-export-last-sibling-p headline info)) low-level-body
+ (replace-regexp-in-string
+ "[ \t\n]*\\'" ""
+ low-level-body))))
+
+ ;; Case 3. Standard headline. Export it as a section.
+ (t (format section-fmt text contents )))))
+
+;;; Horizontal Rule
+;; Not supported
+
+;;; Inline Babel Call
+;;
+;; Inline Babel Calls are ignored.
+
+;;; Inline Src Block
+
+(defun org-man-inline-src-block (inline-src-block _contents info)
+ "Transcode an INLINE-SRC-BLOCK element from Org to Man.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (let* ((code (org-element-property :value inline-src-block)))
+ (cond
+ ((plist-get info :man-source-highlight)
+ (let* ((tmpdir temporary-file-directory)
+ (in-file (make-temp-name
+ (expand-file-name "srchilite" tmpdir)))
+ (out-file (make-temp-name
+ (expand-file-name "reshilite" tmpdir)))
+ (org-lang (org-element-property :language inline-src-block))
+ (lst-lang
+ (cadr (assq (intern org-lang)
+ (plist-get info :man-source-highlight-langs))))
+
+ (cmd (concat (expand-file-name "source-highlight")
+ " -s " lst-lang
+ " -f groff_man"
+ " -i " in-file
+ " -o " out-file )))
+
+ (if lst-lang
+ (let ((code-block "" ))
+ (with-temp-file in-file (insert code))
+ (shell-command cmd)
+ (setq code-block (org-file-contents out-file))
+ (delete-file in-file)
+ (delete-file out-file)
+ code-block)
+ (format ".RS\n.nf\n\\fC\\m[black]%s\\m[]\\fP\n.fi\n.RE\n"
+ code))))
+
+ ;; Do not use a special package: transcode it verbatim.
+ (t
+ (concat ".RS\n.nf\n" "\\fC" "\n" code "\n"
+ "\\fP\n.fi\n.RE\n")))))
+
+
+;;; Inlinetask
+;;; Italic
+
+(defun org-man-italic (_italic contents _info)
+ "Transcode ITALIC from Org to Man.
+CONTENTS is the text with italic markup. INFO is a plist holding
+contextual information."
+ (format "\\fI%s\\fP" contents))
+
+
+;;; Item
+
+
+(defun org-man-item (item contents info)
+ "Transcode an ITEM element from Org to Man.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (let* ((bullet (org-element-property :bullet item))
+ (type (org-element-property :type (org-element-property :parent item)))
+ (checkbox (pcase (org-element-property :checkbox item)
+ (`on "\\o'\\(sq\\(mu'")
+ (`off "\\(sq ")
+ (`trans "\\o'\\(sq\\(mi'")))
+
+ (tag (let ((tag (org-element-property :tag item)))
+ ;; Check-boxes must belong to the tag.
+ (and tag (format "\\fB%s\\fP"
+ (concat checkbox
+ (org-export-data tag info)))))))
+
+ (if (and (null tag) (null checkbox))
+ (let* ((bullet (org-trim bullet))
+ (marker (cond ((string= "-" bullet) "\\(em")
+ ((string= "*" bullet) "\\(bu")
+ ((eq type 'ordered)
+ (format "%s " (org-trim bullet)))
+ (t "\\(dg"))))
+ (concat ".IP " marker " 4\n"
+ (org-trim (or contents " " ))))
+ (concat ".TP\n" (or tag (concat " " checkbox)) "\n"
+ (org-trim (or contents " " ))))))
+
+;;; Keyword
+
+
+(defun org-man-keyword (keyword _contents _info)
+ "Transcode a KEYWORD element from Org to Man.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (let ((key (org-element-property :key keyword))
+ (value (org-element-property :value keyword)))
+ (cond
+ ((string= key "MAN") value)
+ ((string= key "INDEX") nil)
+ ((string= key "TOC" ) nil))))
+
+
+;;; Line Break
+
+(defun org-man-line-break (_line-break _contents _info)
+ "Transcode a LINE-BREAK object from Org to Man.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ "\n.br\n")
+
+
+;;; Link
+
+
+(defun org-man-link (link desc info)
+ "Transcode a LINK object from Org to Man.
+
+DESC is the description part of the link, or the empty string.
+INFO is a plist holding contextual information. See
+`org-export-data'."
+ (let* ((type (org-element-property :type link))
+ (raw-path (org-element-property :path link))
+ ;; Ensure DESC really exists, or set it to nil.
+ (desc (and (not (string= desc "")) desc))
+ (path (pcase type
+ ((or "http" "https" "ftp" "mailto")
+ (concat type ":" raw-path))
+ ("file" (org-export-file-uri raw-path))
+ (_ raw-path))))
+ (cond
+ ;; Link type is handled by a special function.
+ ((org-export-custom-protocol-maybe link desc 'man info))
+ ;; External link with a description part.
+ ((and path desc) (format "%s \\fBat\\fP \\fI%s\\fP" path desc))
+ ;; External link without a description part.
+ (path (format "\\fI%s\\fP" path))
+ ;; No path, only description. Try to do something useful.
+ (t (format "\\fI%s\\fP" desc)))))
+
+;;;; Node Property
+
+(defun org-man-node-property (node-property _contents _info)
+ "Transcode a NODE-PROPERTY element from Org to Man.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (format "%s:%s"
+ (org-element-property :key node-property)
+ (let ((value (org-element-property :value node-property)))
+ (if value (concat " " value) ""))))
+
+;;; Paragraph
+
+(defun org-man-paragraph (paragraph contents _info)
+ "Transcode a PARAGRAPH element from Org to Man.
+CONTENTS is the contents of the paragraph, as a string. INFO is
+the plist used as a communication channel."
+ (let ((parent (plist-get (nth 1 paragraph) :parent)))
+ (when parent
+ (let ((parent-type (car parent))
+ (fixed-paragraph ""))
+ (cond ((and (eq parent-type 'item)
+ (plist-get (nth 1 parent) :bullet ))
+ (setq fixed-paragraph (concat "" contents)))
+ ((eq parent-type 'section)
+ (setq fixed-paragraph (concat ".PP\n" contents)))
+ ((eq parent-type 'footnote-definition)
+ (setq fixed-paragraph contents))
+ (t (setq fixed-paragraph (concat "" contents))))
+ fixed-paragraph ))))
+
+
+;;; Plain List
+
+(defun org-man-plain-list (_plain-list contents _info)
+ "Transcode a PLAIN-LIST element from Org to Man.
+CONTENTS is the contents of the list. INFO is a plist holding
+contextual information."
+ contents)
+
+;;; Plain Text
+
+(defun org-man-plain-text (text info)
+ "Transcode a TEXT string from Org to Man.
+TEXT is the string to transcode. INFO is a plist holding
+contextual information."
+ (let ((output text))
+ ;; Protect various chars.
+ (setq output (replace-regexp-in-string
+ "\\(?:[^\\]\\|^\\)\\(\\\\\\)\\(?:[^%$#&{}~^_\\]\\|$\\)"
+ "$\\" output nil t 1))
+ ;; Activate smart quotes. Be sure to provide original TEXT string
+ ;; since OUTPUT may have been modified.
+ (when (plist-get info :with-smart-quotes)
+ (setq output (org-export-activate-smart-quotes output :utf-8 info text)))
+ ;; Handle break preservation if required.
+ (when (plist-get info :preserve-breaks)
+ (setq output (replace-regexp-in-string "\\(\\\\\\\\\\)?[ \t]*\n" ".br\n"
+ output)))
+ ;; Return value.
+ output))
+
+
+
+;;; Planning
+
+
+;;; Property Drawer
+
+(defun org-man-property-drawer (_property-drawer contents _info)
+ "Transcode a PROPERTY-DRAWER element from Org to Man.
+CONTENTS holds the contents of the drawer. INFO is a plist
+holding contextual information."
+ (and (org-string-nw-p contents)
+ (format ".RS\n.nf\n%s\n.fi\n.RE" contents)))
+
+;;; Quote Block
+
+(defun org-man-quote-block (quote-block contents _info)
+ "Transcode a QUOTE-BLOCK element from Org to Man.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (org-man--wrap-label
+ quote-block
+ (format ".RS\n%s\n.RE" contents)))
+
+
+;;; Radio Target
+
+(defun org-man-radio-target (_radio-target text _info)
+ "Transcode a RADIO-TARGET object from Org to Man.
+TEXT is the text of the target. INFO is a plist holding
+contextual information."
+ text)
+
+
+;;; Section
+
+(defun org-man-section (_section contents _info)
+ "Transcode a SECTION element from Org to Man.
+CONTENTS holds the contents of the section. INFO is a plist
+holding contextual information."
+ contents)
+
+
+;;; Special Block
+
+(defun org-man-special-block (special-block contents _info)
+ "Transcode a SPECIAL-BLOCK element from Org to Man.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (org-man--wrap-label special-block (format "%s\n" contents)))
+
+
+;;; Src Block
+
+(defun org-man-src-block (src-block _contents info)
+ "Transcode a SRC-BLOCK element from Org to Man.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (if (not (plist-get info :man-source-highlight))
+ (format ".RS\n.nf\n\\fC%s\\fP\n.fi\n.RE\n\n"
+ (org-export-format-code-default src-block info))
+ (let* ((tmpdir temporary-file-directory)
+ (in-file (make-temp-name (expand-file-name "srchilite" tmpdir)))
+ (out-file (make-temp-name (expand-file-name "reshilite" tmpdir)))
+ (code (org-element-property :value src-block))
+ (org-lang (org-element-property :language src-block))
+ (lst-lang
+ (cadr (assq (intern org-lang)
+ (plist-get info :man-source-highlight-langs))))
+ (cmd (concat "source-highlight"
+ " -s " lst-lang
+ " -f groff_man "
+ " -i " in-file
+ " -o " out-file)))
+ (if lst-lang
+ (let ((code-block ""))
+ (with-temp-file in-file (insert code))
+ (shell-command cmd)
+ (setq code-block (org-file-contents out-file))
+ (delete-file in-file)
+ (delete-file out-file)
+ code-block)
+ (format ".RS\n.nf\n\\fC\\m[black]%s\\m[]\\fP\n.fi\n.RE" code)))))
+
+
+;;; Statistics Cookie
+
+(defun org-man-statistics-cookie (statistics-cookie _contents _info)
+ "Transcode a STATISTICS-COOKIE object from Org to Man.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (org-element-property :value statistics-cookie))
+
+
+;;; Strike-Through
+
+(defun org-man-strike-through (_strike-through contents _info)
+ "Transcode STRIKE-THROUGH from Org to Man.
+CONTENTS is the text with strike-through markup. INFO is a plist
+holding contextual information."
+ (format "\\fI%s\\fP" contents))
+
+;;; Subscript
+
+(defun org-man-subscript (_subscript contents _info)
+ "Transcode a SUBSCRIPT object from Org to Man.
+CONTENTS is the contents of the object. INFO is a plist holding
+contextual information."
+ (format "\\d\\s-2%s\\s+2\\u" contents))
+
+;;; Superscript "^_%s$
+
+(defun org-man-superscript (_superscript contents _info)
+ "Transcode a SUPERSCRIPT object from Org to Man.
+CONTENTS is the contents of the object. INFO is a plist holding
+contextual information."
+ (format "\\u\\s-2%s\\s+2\\d" contents))
+
+
+;;; Table
+;;
+;; `org-man-table' is the entry point for table transcoding. It
+;; takes care of tables with a "verbatim" attribute. Otherwise, it
+;; delegates the job to either `org-man-table--table.el-table' or
+;; `org-man-table--org-table' functions, depending of the type of
+;; the table.
+;;
+;; `org-man-table--align-string' is a subroutine used to build
+;; alignment string for Org tables.
+
+(defun org-man-table (table contents info)
+ "Transcode a TABLE element from Org to Man.
+CONTENTS is the contents of the table. INFO is a plist holding
+contextual information."
+ (cond
+ ;; Case 1: verbatim table.
+ ((or (plist-get info :man-tables-verbatim)
+ (let ((attr (read (format "(%s)"
+ (mapconcat
+ #'identity
+ (org-element-property :attr_man table)
+ " ")))))
+
+ (and attr (plist-get attr :verbatim))))
+
+ (format ".nf\n\\fC%s\\fP\n.fi"
+ ;; Re-create table, without affiliated keywords.
+ (org-trim
+ (org-element-interpret-data
+ `(table nil ,@(org-element-contents table))))))
+ ;; Case 2: Standard table.
+ (t (org-man-table--org-table table contents info))))
+
+(defun org-man-table--align-string (divider table info)
+ "Return an appropriate Man alignment string.
+TABLE is the considered table. INFO is a plist used as
+a communication channel."
+ (let (alignment)
+ ;; Extract column groups and alignment from first (non-rule) row.
+ (org-element-map
+ (org-element-map table 'table-row
+ (lambda (row)
+ (and (eq (org-element-property :type row) 'standard) row))
+ info 'first-match)
+ 'table-cell
+ (lambda (cell)
+ (let* ((borders (org-export-table-cell-borders cell info))
+ (raw-width (org-export-table-cell-width cell info))
+ (width-cm (when raw-width (/ raw-width 5)))
+ (width (if raw-width (format "w(%dc)"
+ (if (< width-cm 1) 1 width-cm)) "")))
+ ;; Check left border for the first cell only.
+ (when (and (memq 'left borders) (not alignment))
+ (push "|" alignment))
+ (push
+ (concat (pcase (org-export-table-cell-alignment cell info)
+ (`left "l") (`right "r") (`center "c"))
+ width
+ divider)
+ alignment)
+ (when (memq 'right borders) (push "|" alignment))))
+ info)
+ (apply #'concat (reverse alignment))))
+
+(defun org-man-table--org-table (table contents info)
+ "Return appropriate Man code for an Org table.
+
+TABLE is the table type element to transcode. CONTENTS is its
+contents, as a string. INFO is a plist used as a communication
+channel.
+
+This function assumes TABLE has `org' as its `:type' attribute."
+ (let* ((attr (org-export-read-attribute :attr_man table))
+ (caption (and (not (plist-get attr :disable-caption))
+ (org-man--caption/label-string table info)))
+ (divider (if (plist-get attr :divider) "|" " "))
+
+ ;; Determine alignment string.
+ (alignment (org-man-table--align-string divider table info))
+ ;; Extract others display options.
+
+ (lines (org-split-string contents "\n"))
+
+ (attr-list
+ (delq nil
+ (list
+ (and (plist-get attr :expand) "expand")
+ (let ((placement (plist-get attr :placement)))
+ (cond ((string= placement 'center) "center")
+ ((string= placement 'left) nil)
+ ((plist-get info :man-tables-centered) "center")
+ (t "")))
+ (or (plist-get attr :boxtype) "box"))))
+
+ (title-line (plist-get attr :title-line))
+ (long-cells (plist-get attr :long-cells))
+
+ (table-format (concat
+ (format "%s" (or (car attr-list) "" ))
+ (or
+ (let ((output-list '()))
+ (when (cdr attr-list)
+ (dolist (attr-item (cdr attr-list))
+ (setq output-list (concat output-list (format ",%s" attr-item)))))
+ output-list)
+ "")))
+
+ (first-line (when lines (org-split-string (car lines) "\t"))))
+ ;; Prepare the final format string for the table.
+
+
+ (cond
+ ;; Others.
+ (lines (concat ".TS\n " table-format ";\n"
+
+ (format "%s.\n"
+ (let ((final-line ""))
+ (when title-line
+ (dotimes (_ (length first-line))
+ (setq final-line (concat final-line "cb" divider))))
+
+ (setq final-line (concat final-line "\n"))
+
+ (if alignment
+ (setq final-line (concat final-line alignment))
+ (dotimes (_ (length first-line))
+ (setq final-line (concat final-line "c" divider))))
+ final-line ))
+
+ (format "%s.TE\n"
+ (let ((final-line "")
+ (long-line "")
+ (lines (org-split-string contents "\n")))
+
+ (dolist (line-item lines)
+ (setq long-line "")
+
+ (if long-cells
+ (progn
+ (if (string= line-item "_")
+ (setq long-line (format "%s\n" line-item))
+ ;; else string =
+ (let ((cell-item-list (org-split-string line-item "\t")))
+ (dolist (cell-item cell-item-list)
+
+ (cond ((eq cell-item (car (last cell-item-list)))
+ (setq long-line (concat long-line
+ (format "T{\n%s\nT}\t\n" cell-item ))))
+ (t
+ (setq long-line (concat long-line
+ (format "T{\n%s\nT}\t" cell-item ))))))
+ long-line))
+ ;; else long cells
+ (setq final-line (concat final-line long-line )))
+
+ (setq final-line (concat final-line line-item "\n"))))
+ final-line))
+
+ (and caption (format ".TB \"%s\"" caption)))))))
+
+;;; Table Cell
+
+(defun org-man-table-cell (table-cell contents info)
+ "Transcode a TABLE-CELL element from Org to Man
+CONTENTS is the cell contents. INFO is a plist used as
+a communication channel."
+ (concat
+ (let ((scientific-format (plist-get info :man-table-scientific-notation)))
+ (if (and contents
+ scientific-format
+ (string-match orgtbl-exp-regexp contents))
+ ;; Use appropriate format string for scientific notation.
+ (format scientific-format
+ (match-string 1 contents)
+ (match-string 2 contents))
+ contents))
+ (when (org-export-get-next-element table-cell info) "\t")))
+
+
+;;; Table Row
+
+(defun org-man-table-row (table-row contents info)
+ "Transcode a TABLE-ROW element from Org to Man.
+CONTENTS is the contents of the row. INFO is a plist used as
+a communication channel."
+ ;; Rules are ignored since table separators are deduced from borders
+ ;; of the current row.
+ (when (eq (org-element-property :type table-row) 'standard)
+ (let ((borders
+ ;; TABLE-ROW's borders are extracted from its first cell.
+ (org-export-table-cell-borders
+ (car (org-element-contents table-row)) info)))
+ (concat
+ (cond ((and (memq 'top borders) (memq 'above borders)) "_\n"))
+ contents
+ (cond ((and (memq 'bottom borders) (memq 'below borders)) "\n_")
+ ((memq 'below borders) "\n_"))))))
+
+
+;;; Target
+
+(defun org-man-target (target _contents info)
+ "Transcode a TARGET object from Org to Man.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (format "\\fI%s\\fP" (org-export-get-reference target info)))
+
+
+;;; Timestamp
+
+(defun org-man-timestamp (_timestamp _contents _info)
+ "Transcode a TIMESTAMP object from Org to Man.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ "")
+
+
+;;; Underline
+
+(defun org-man-underline (_underline contents _info)
+ "Transcode UNDERLINE from Org to Man.
+CONTENTS is the text with underline markup. INFO is a plist
+holding contextual information."
+ (format "\\fI%s\\fP" contents))
+
+
+;;; Verbatim
+
+(defun org-man-verbatim (verbatim _contents _info)
+ "Transcode a VERBATIM object from Org to Man."
+ (format "\\fI%s\\fP"
+ (org-man--protect-text (org-element-property :value verbatim))))
+
+
+;;; Verse Block
+
+(defun org-man-verse-block (_verse-block contents _info)
+ "Transcode a VERSE-BLOCK element from Org to Man.
+CONTENTS is verse block contents. INFO is a plist holding
+contextual information."
+ (format ".RS\n.ft I\n%s\n.ft\n.RE" contents))
+
+
+
+;;; Interactive functions
+
+(defun org-man-export-to-man
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer to a Man file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only the body
+without any markers.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return output file's name."
+ (interactive)
+ (let ((outfile (org-export-output-file-name ".man" subtreep)))
+ (org-export-to-file 'man outfile
+ async subtreep visible-only body-only ext-plist)))
+
+(defun org-man-export-to-pdf
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer to Groff then process through to PDF.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write between
+markers.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return PDF file's name."
+ (interactive)
+ (let ((outfile (org-export-output-file-name ".man" subtreep)))
+ (org-export-to-file 'man outfile
+ async subtreep visible-only body-only ext-plist
+ #'org-latex-compile)))
+
+(defun org-man-compile (file)
+ "Compile a Groff file.
+
+FILE is the name of the file being compiled. Processing is done
+through the command specified in `org-man-pdf-process'.
+
+Return PDF file name or an error if it couldn't be produced."
+ (message "Processing Groff file %s..." file)
+ (let ((output (org-compile-file file org-man-pdf-process "pdf")))
+ (when org-man-remove-logfiles
+ (let ((base (file-name-sans-extension output)))
+ (dolist (ext org-man-logfiles-extensions)
+ (let ((file (concat base "." ext)))
+ (when (file-exists-p file) (delete-file file))))))
+ (message "Process completed.")
+ output))
+
+(provide 'ox-man)
+
+;;; ox-man.el ends here
diff --git a/elpa/org-9.5.2/ox-man.elc b/elpa/org-9.5.2/ox-man.elc
new file mode 100644
index 0000000..5add66e
--- /dev/null
+++ b/elpa/org-9.5.2/ox-man.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ox-md.el b/elpa/org-9.5.2/ox-md.el
new file mode 100644
index 0000000..348b6d0
--- /dev/null
+++ b/elpa/org-9.5.2/ox-md.el
@@ -0,0 +1,787 @@
+;;; ox-md.el --- Markdown Back-End for Org Export Engine -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <n.goaziou@gmail.com>
+;; Maintainer: Nicolas Goaziou <n.goaziou at gmail dot com>
+;; Keywords: org, wp, markdown
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library implements a Markdown back-end (vanilla flavor) for
+;; Org exporter, based on `html' back-end. See Org manual for more
+;; information.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ox-html)
+(require 'ox-publish)
+
+
+;;; User-Configurable Variables
+
+(defgroup org-export-md nil
+ "Options specific to Markdown export back-end."
+ :tag "Org Markdown"
+ :group 'org-export
+ :version "24.4"
+ :package-version '(Org . "8.0"))
+
+(defcustom org-md-headline-style 'atx
+ "Style used to format headlines.
+This variable can be set to either `atx' or `setext'."
+ :group 'org-export-md
+ :type '(choice
+ (const :tag "Use \"atx\" style" atx)
+ (const :tag "Use \"Setext\" style" setext)))
+
+
+;;;; Footnotes
+
+(defcustom org-md-footnotes-section "%s%s"
+ "Format string for the footnotes section.
+The first %s placeholder will be replaced with the localized Footnotes section
+heading, the second with the contents of the Footnotes section."
+ :group 'org-export-md
+ :type 'string
+ :version "26.1"
+ :package-version '(Org . "9.0"))
+
+(defcustom org-md-footnote-format "<sup>%s</sup>"
+ "Format string for the footnote reference.
+The %s will be replaced by the footnote reference itself."
+ :group 'org-export-md
+ :type 'string
+ :version "26.1"
+ :package-version '(Org . "9.0"))
+
+
+;;; Define Back-End
+
+(org-export-define-derived-backend 'md 'html
+ :filters-alist '((:filter-parse-tree . org-md-separate-elements))
+ :menu-entry
+ '(?m "Export to Markdown"
+ ((?M "To temporary buffer"
+ (lambda (a s v b) (org-md-export-as-markdown a s v)))
+ (?m "To file" (lambda (a s v b) (org-md-export-to-markdown a s v)))
+ (?o "To file and open"
+ (lambda (a s v b)
+ (if a (org-md-export-to-markdown t s v)
+ (org-open-file (org-md-export-to-markdown nil s v)))))))
+ :translate-alist '((bold . org-md-bold)
+ (center-block . org-md--convert-to-html)
+ (code . org-md-verbatim)
+ (drawer . org-md--identity)
+ (dynamic-block . org-md--identity)
+ (example-block . org-md-example-block)
+ (export-block . org-md-export-block)
+ (fixed-width . org-md-example-block)
+ (headline . org-md-headline)
+ (horizontal-rule . org-md-horizontal-rule)
+ (inline-src-block . org-md-verbatim)
+ (inlinetask . org-md--convert-to-html)
+ (inner-template . org-md-inner-template)
+ (italic . org-md-italic)
+ (item . org-md-item)
+ (keyword . org-md-keyword)
+ (latex-environment . org-md-latex-environment)
+ (latex-fragment . org-md-latex-fragment)
+ (line-break . org-md-line-break)
+ (link . org-md-link)
+ (node-property . org-md-node-property)
+ (paragraph . org-md-paragraph)
+ (plain-list . org-md-plain-list)
+ (plain-text . org-md-plain-text)
+ (property-drawer . org-md-property-drawer)
+ (quote-block . org-md-quote-block)
+ (section . org-md-section)
+ (special-block . org-md--convert-to-html)
+ (src-block . org-md-example-block)
+ (table . org-md--convert-to-html)
+ (template . org-md-template)
+ (verbatim . org-md-verbatim))
+ :options-alist
+ '((:md-footnote-format nil nil org-md-footnote-format)
+ (:md-footnotes-section nil nil org-md-footnotes-section)
+ (:md-headline-style nil nil org-md-headline-style)))
+
+
+;;; Filters
+
+(defun org-md-separate-elements (tree _backend info)
+ "Fix blank lines between elements.
+
+TREE is the parse tree being exported. BACKEND is the export
+back-end used. INFO is a plist used as a communication channel.
+
+Enforce a blank line between elements. There are two exceptions
+to this rule:
+
+ 1. Preserve blank lines between sibling items in a plain list,
+
+ 2. In an item, remove any blank line before the very first
+ paragraph and the next sub-list when the latter ends the
+ current item.
+
+Assume BACKEND is `md'."
+ (org-element-map tree (remq 'item org-element-all-elements)
+ (lambda (e)
+ (org-element-put-property
+ e :post-blank
+ (if (and (eq (org-element-type e) 'paragraph)
+ (eq (org-element-type (org-element-property :parent e)) 'item)
+ (org-export-first-sibling-p e info)
+ (let ((next (org-export-get-next-element e info)))
+ (and (eq (org-element-type next) 'plain-list)
+ (not (org-export-get-next-element next info)))))
+ 0
+ 1))))
+ ;; Return updated tree.
+ tree)
+
+
+;;; Internal functions
+
+(defun org-md--headline-referred-p (headline info)
+ "Non-nil when HEADLINE is being referred to.
+INFO is a plist used as a communication channel. Links and table
+of contents can refer to headlines."
+ (unless (org-element-property :footnote-section-p headline)
+ (or
+ ;; Global table of contents includes HEADLINE.
+ (and (plist-get info :with-toc)
+ (memq headline
+ (org-export-collect-headlines info (plist-get info :with-toc))))
+ ;; A local table of contents includes HEADLINE.
+ (cl-some
+ (lambda (h)
+ (let ((section (car (org-element-contents h))))
+ (and
+ (eq 'section (org-element-type section))
+ (org-element-map section 'keyword
+ (lambda (keyword)
+ (when (equal "TOC" (org-element-property :key keyword))
+ (let ((case-fold-search t)
+ (value (org-element-property :value keyword)))
+ (and (string-match-p "\\<headlines\\>" value)
+ (let ((n (and
+ (string-match "\\<[0-9]+\\>" value)
+ (string-to-number (match-string 0 value))))
+ (local? (string-match-p "\\<local\\>" value)))
+ (memq headline
+ (org-export-collect-headlines
+ info n (and local? keyword))))))))
+ info t))))
+ (org-element-lineage headline))
+ ;; A link refers internally to HEADLINE.
+ (org-element-map (plist-get info :parse-tree) 'link
+ (lambda (link)
+ (eq headline
+ (pcase (org-element-property :type link)
+ ((or "custom-id" "id") (org-export-resolve-id-link link info))
+ ("fuzzy" (org-export-resolve-fuzzy-link link info))
+ (_ nil))))
+ info t))))
+
+(defun org-md--headline-title (style level title &optional anchor tags)
+ "Generate a headline title in the preferred Markdown headline style.
+STYLE is the preferred style (`atx' or `setext'). LEVEL is the
+header level. TITLE is the headline title. ANCHOR is the HTML
+anchor tag for the section as a string. TAGS are the tags set on
+the section."
+ (let ((anchor-lines (and anchor (concat anchor "\n\n"))))
+ ;; Use "Setext" style
+ (if (and (eq style 'setext) (< level 3))
+ (let* ((underline-char (if (= level 1) ?= ?-))
+ (underline (concat (make-string (length title) underline-char)
+ "\n")))
+ (concat "\n" anchor-lines title tags "\n" underline "\n"))
+ ;; Use "Atx" style
+ (let ((level-mark (make-string level ?#)))
+ (concat "\n" anchor-lines level-mark " " title tags "\n\n")))))
+
+(defun org-md--build-toc (info &optional n _keyword scope)
+ "Return a table of contents.
+
+INFO is a plist used as a communication channel.
+
+Optional argument N, when non-nil, is an integer specifying the
+depth of the table.
+
+When optional argument SCOPE is non-nil, build a table of
+contents according to the specified element."
+ (concat
+ (unless scope
+ (let ((style (plist-get info :md-headline-style))
+ (title (org-html--translate "Table of Contents" info)))
+ (org-md--headline-title style 1 title nil)))
+ (mapconcat
+ (lambda (headline)
+ (let* ((indentation
+ (make-string
+ (* 4 (1- (org-export-get-relative-level headline info)))
+ ?\s))
+ (bullet
+ (if (not (org-export-numbered-headline-p headline info)) "- "
+ (let ((prefix
+ (format "%d." (org-last (org-export-get-headline-number
+ headline info)))))
+ (concat prefix (make-string (max 1 (- 4 (length prefix)))
+ ?\s)))))
+ (title
+ (format "[%s](#%s)"
+ (org-export-data-with-backend
+ (org-export-get-alt-title headline info)
+ (org-export-toc-entry-backend 'md)
+ info)
+ (or (org-element-property :CUSTOM_ID headline)
+ (org-export-get-reference headline info))))
+ (tags (and (plist-get info :with-tags)
+ (not (eq 'not-in-toc (plist-get info :with-tags)))
+ (org-make-tag-string
+ (org-export-get-tags headline info)))))
+ (concat indentation bullet title tags)))
+ (org-export-collect-headlines info n scope) "\n")
+ "\n"))
+
+(defun org-md--footnote-formatted (footnote info)
+ "Formats a single footnote entry FOOTNOTE.
+FOOTNOTE is a cons cell of the form (number . definition).
+INFO is a plist with contextual information."
+ (let* ((fn-num (car footnote))
+ (fn-text (cdr footnote))
+ (fn-format (plist-get info :md-footnote-format))
+ (fn-anchor (format "fn.%d" fn-num))
+ (fn-href (format " href=\"#fnr.%d\"" fn-num))
+ (fn-link-to-ref (org-html--anchor fn-anchor fn-num fn-href info)))
+ (concat (format fn-format fn-link-to-ref) " " fn-text "\n")))
+
+(defun org-md--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 (org-trim (org-export-data raw info)))))
+ (headline-style (plist-get info :md-headline-style))
+ (section-title (org-html--translate "Footnotes" info)))
+ (when fn-alist
+ (format (plist-get info :md-footnotes-section)
+ (org-md--headline-title headline-style 1 section-title)
+ (mapconcat (lambda (fn) (org-md--footnote-formatted fn info))
+ fn-alist
+ "\n")))))
+
+(defun org-md--convert-to-html (datum _contents info)
+ "Convert DATUM into raw HTML, including contents."
+ (org-export-data-with-backend datum 'html info))
+
+(defun org-md--identity (_datum contents _info)
+ "Return CONTENTS only."
+ contents)
+
+
+;;; Transcode Functions
+
+;;;; Bold
+
+(defun org-md-bold (_bold contents _info)
+ "Transcode BOLD object into Markdown format.
+CONTENTS is the text within bold markup. INFO is a plist used as
+a communication channel."
+ (format "**%s**" contents))
+
+
+;;;; Code and Verbatim
+
+(defun org-md-verbatim (verbatim _contents _info)
+ "Transcode VERBATIM object into Markdown format.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (let ((value (org-element-property :value verbatim)))
+ (format (cond ((not (string-match "`" value)) "`%s`")
+ ((or (string-prefix-p "`" value)
+ (string-suffix-p "`" value))
+ "`` %s ``")
+ (t "``%s``"))
+ value)))
+
+
+;;;; Example Block, Src Block and Export Block
+
+(defun org-md-example-block (example-block _contents info)
+ "Transcode EXAMPLE-BLOCK element into Markdown format.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (replace-regexp-in-string
+ "^" " "
+ (org-remove-indentation
+ (org-export-format-code-default example-block info))))
+
+(defun org-md-export-block (export-block contents info)
+ "Transcode a EXPORT-BLOCK element from Org to Markdown.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (if (member (org-element-property :type export-block) '("MARKDOWN" "MD"))
+ (org-remove-indentation (org-element-property :value export-block))
+ ;; Also include HTML export blocks.
+ (org-export-with-backend 'html export-block contents info)))
+
+
+;;;; Headline
+
+(defun org-md-headline (headline contents info)
+ "Transcode HEADLINE element into Markdown format.
+CONTENTS is the headline contents. INFO is a plist used as
+a communication channel."
+ (unless (org-element-property :footnote-section-p headline)
+ (let* ((level (org-export-get-relative-level headline info))
+ (title (org-export-data (org-element-property :title headline) info))
+ (todo (and (plist-get info :with-todo-keywords)
+ (let ((todo (org-element-property :todo-keyword
+ headline)))
+ (and todo (concat (org-export-data todo info) " ")))))
+ (tags (and (plist-get info :with-tags)
+ (let ((tag-list (org-export-get-tags headline info)))
+ (and tag-list
+ (concat " " (org-make-tag-string tag-list))))))
+ (priority
+ (and (plist-get info :with-priority)
+ (let ((char (org-element-property :priority headline)))
+ (and char (format "[#%c] " char)))))
+ ;; Headline text without tags.
+ (heading (concat todo priority title))
+ (style (plist-get info :md-headline-style)))
+ (cond
+ ;; Cannot create a headline. Fall-back to a list.
+ ((or (org-export-low-level-p headline info)
+ (not (memq style '(atx setext)))
+ (and (eq style 'atx) (> level 6))
+ (and (eq style 'setext) (> level 2)))
+ (let ((bullet
+ (if (not (org-export-numbered-headline-p headline info)) "-"
+ (concat (number-to-string
+ (car (last (org-export-get-headline-number
+ headline info))))
+ "."))))
+ (concat bullet (make-string (- 4 (length bullet)) ?\s) heading tags "\n\n"
+ (and contents (replace-regexp-in-string "^" " " contents)))))
+ (t
+ (let ((anchor
+ (and (org-md--headline-referred-p headline info)
+ (format "<a id=\"%s\"></a>"
+ (or (org-element-property :CUSTOM_ID headline)
+ (org-export-get-reference headline info))))))
+ (concat (org-md--headline-title style level heading anchor tags)
+ contents)))))))
+
+;;;; Horizontal Rule
+
+(defun org-md-horizontal-rule (_horizontal-rule _contents _info)
+ "Transcode HORIZONTAL-RULE element into Markdown format.
+CONTENTS is the horizontal rule contents. INFO is a plist used
+as a communication channel."
+ "---")
+
+
+;;;; Italic
+
+(defun org-md-italic (_italic contents _info)
+ "Transcode ITALIC object into Markdown format.
+CONTENTS is the text within italic markup. INFO is a plist used
+as a communication channel."
+ (format "*%s*" contents))
+
+
+;;;; Item
+
+(defun org-md-item (item contents info)
+ "Transcode ITEM element into Markdown format.
+CONTENTS is the item contents. INFO is a plist used as
+a communication channel."
+ (let* ((type (org-element-property :type (org-export-get-parent item)))
+ (struct (org-element-property :structure item))
+ (bullet (if (not (eq type 'ordered)) "-"
+ (concat (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)))))
+ "."))))
+ (concat bullet
+ (make-string (- 4 (length bullet)) ? )
+ (pcase (org-element-property :checkbox item)
+ (`on "[X] ")
+ (`trans "[-] ")
+ (`off "[ ] "))
+ (let ((tag (org-element-property :tag item)))
+ (and tag (format "**%s:** "(org-export-data tag info))))
+ (and contents
+ (org-trim (replace-regexp-in-string "^" " " contents))))))
+
+
+
+;;;; Keyword
+
+(defun org-md-keyword (keyword contents info)
+ "Transcode a KEYWORD element into Markdown format.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (pcase (org-element-property :key keyword)
+ ((or "MARKDOWN" "MD") (org-element-property :value keyword))
+ ("TOC"
+ (let ((case-fold-search t)
+ (value (org-element-property :value keyword)))
+ (cond
+ ((string-match-p "\\<headlines\\>" value)
+ (let ((depth (and (string-match "\\<[0-9]+\\>" value)
+ (string-to-number (match-string 0 value))))
+ (scope
+ (cond
+ ((string-match ":target +\\(\".+?\"\\|\\S-+\\)" value) ;link
+ (org-export-resolve-link
+ (org-strip-quotes (match-string 1 value)) info))
+ ((string-match-p "\\<local\\>" value) keyword)))) ;local
+ (org-remove-indentation
+ (org-md--build-toc info depth keyword scope)))))))
+ (_ (org-export-with-backend 'html keyword contents info))))
+
+
+;;;; Latex Environment
+
+(defun org-md-latex-environment (latex-environment _contents info)
+ "Transcode a LATEX-ENVIRONMENT object from Org to Markdown.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (when (plist-get info :with-latex)
+ (let ((latex-frag (org-remove-indentation
+ (org-element-property :value latex-environment)))
+ (label (org-html--reference latex-environment info t)))
+ (if (org-string-nw-p label)
+ (replace-regexp-in-string "\\`.*"
+ (format "\\&\n\\\\label{%s}" label)
+ latex-frag)
+ latex-frag))))
+
+;;;; Latex Fragment
+
+(defun org-md-latex-fragment (latex-fragment _contents info)
+ "Transcode a LATEX-FRAGMENT object from Org to Markdown.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (when (plist-get info :with-latex)
+ (let ((frag (org-element-property :value latex-fragment)))
+ (cond
+ ((string-match-p "^\\\\(" frag)
+ (concat "$" (substring frag 2 -2) "$"))
+ ((string-match-p "^\\\\\\[" frag)
+ (concat "$$" (substring frag 2 -2) "$$"))
+ (t frag))))) ; either already $-deliminated or a macro
+
+;;;; Line Break
+
+(defun org-md-line-break (_line-break _contents _info)
+ "Transcode LINE-BREAK object into Markdown format.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ " \n")
+
+
+;;;; Link
+
+(defun org-md-link (link desc info)
+ "Transcode LINK object into Markdown format.
+DESC is the description part of the link, or the empty string.
+INFO is a plist holding contextual information. See
+`org-export-data'."
+ (let* ((link-org-files-as-md
+ (lambda (raw-path)
+ ;; Treat links to `file.org' as links to `file.md'.
+ (if (string= ".org" (downcase (file-name-extension raw-path ".")))
+ (concat (file-name-sans-extension raw-path) ".md")
+ raw-path)))
+ (type (org-element-property :type link))
+ (raw-path (org-element-property :path link))
+ (path (cond
+ ((member type '("http" "https" "ftp" "mailto"))
+ (concat type ":" raw-path))
+ ((string-equal type "file")
+ (org-export-file-uri (funcall link-org-files-as-md raw-path)))
+ (t raw-path))))
+ (cond
+ ;; Link type is handled by a special function.
+ ((org-export-custom-protocol-maybe link desc 'md info))
+ ((member type '("custom-id" "id" "fuzzy"))
+ (let ((destination (if (string= type "fuzzy")
+ (org-export-resolve-fuzzy-link link info)
+ (org-export-resolve-id-link link info))))
+ (pcase (org-element-type destination)
+ (`plain-text ; External file.
+ (let ((path (funcall link-org-files-as-md destination)))
+ (if (not desc) (format "<%s>" path)
+ (format "[%s](%s)" desc path))))
+ (`headline
+ (format
+ "[%s](#%s)"
+ ;; Description.
+ (cond ((org-string-nw-p desc))
+ ((org-export-numbered-headline-p destination info)
+ (mapconcat #'number-to-string
+ (org-export-get-headline-number destination info)
+ "."))
+ (t (org-export-data (org-element-property :title destination)
+ info)))
+ ;; Reference.
+ (or (org-element-property :CUSTOM_ID destination)
+ (org-export-get-reference destination info))))
+ (_
+ (let ((description
+ (or (org-string-nw-p desc)
+ (let ((number (org-export-get-ordinal destination info)))
+ (cond
+ ((not number) nil)
+ ((atom number) (number-to-string number))
+ (t (mapconcat #'number-to-string number ".")))))))
+ (when description
+ (format "[%s](#%s)"
+ description
+ (org-export-get-reference destination info))))))))
+ ((org-export-inline-image-p link org-html-inline-image-rules)
+ (let ((path (cond ((not (string-equal type "file"))
+ (concat type ":" raw-path))
+ ((not (file-name-absolute-p raw-path)) raw-path)
+ (t (expand-file-name raw-path))))
+ (caption (org-export-data
+ (org-export-get-caption
+ (org-export-get-parent-element link))
+ info)))
+ (format "![img](%s)"
+ (if (not (org-string-nw-p caption)) path
+ (format "%s \"%s\"" path caption)))))
+ ((string= type "coderef")
+ (format (org-export-get-coderef-format path desc)
+ (org-export-resolve-coderef path info)))
+ ((string= type "radio")
+ (let ((destination (org-export-resolve-radio-link link info)))
+ (if (not destination) desc
+ (format "<a href=\"#%s\">%s</a>"
+ (org-export-get-reference destination info)
+ desc))))
+ (t (if (not desc) (format "<%s>" path)
+ (format "[%s](%s)" desc path))))))
+
+
+;;;; Node Property
+
+(defun org-md-node-property (node-property _contents _info)
+ "Transcode a NODE-PROPERTY element into Markdown syntax.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (format "%s:%s"
+ (org-element-property :key node-property)
+ (let ((value (org-element-property :value node-property)))
+ (if value (concat " " value) ""))))
+
+
+;;;; Paragraph
+
+(defun org-md-paragraph (paragraph contents _info)
+ "Transcode PARAGRAPH element into Markdown format.
+CONTENTS is the paragraph contents. INFO is a plist used as
+a communication channel."
+ (let ((first-object (car (org-element-contents paragraph))))
+ ;; If paragraph starts with a #, protect it.
+ (if (and (stringp first-object) (string-prefix-p "#" first-object))
+ (concat "\\" contents)
+ contents)))
+
+
+;;;; Plain List
+
+(defun org-md-plain-list (_plain-list contents _info)
+ "Transcode PLAIN-LIST element into Markdown format.
+CONTENTS is the plain-list contents. INFO is a plist used as
+a communication channel."
+ contents)
+
+
+;;;; Plain Text
+
+(defun org-md-plain-text (text info)
+ "Transcode a TEXT string into Markdown format.
+TEXT is the string to transcode. INFO is a plist holding
+contextual information."
+ (when (plist-get info :with-smart-quotes)
+ (setq text (org-export-activate-smart-quotes text :html info)))
+ ;; The below series of replacements in `text' is order sensitive.
+ ;; Protect `, *, _, and \
+ (setq text (replace-regexp-in-string "[`*_\\]" "\\\\\\&" text))
+ ;; Protect ambiguous #. This will protect # at the beginning of
+ ;; a line, but not at the beginning of a paragraph. See
+ ;; `org-md-paragraph'.
+ (setq text (replace-regexp-in-string "\n#" "\n\\\\#" text))
+ ;; Protect ambiguous !
+ (setq text (replace-regexp-in-string "\\(!\\)\\[" "\\\\!" text nil nil 1))
+ ;; Handle special strings, if required.
+ (when (plist-get info :with-special-strings)
+ (setq text (org-html-convert-special-strings text)))
+ ;; Handle break preservation, if required.
+ (when (plist-get info :preserve-breaks)
+ (setq text (replace-regexp-in-string "[ \t]*\n" " \n" text)))
+ ;; Return value.
+ text)
+
+
+;;;; Property Drawer
+
+(defun org-md-property-drawer (_property-drawer contents _info)
+ "Transcode a PROPERTY-DRAWER element into Markdown format.
+CONTENTS holds the contents of the drawer. INFO is a plist
+holding contextual information."
+ (and (org-string-nw-p contents)
+ (replace-regexp-in-string "^" " " contents)))
+
+
+;;;; Quote Block
+
+(defun org-md-quote-block (_quote-block contents _info)
+ "Transcode QUOTE-BLOCK element into Markdown format.
+CONTENTS is the quote-block contents. INFO is a plist used as
+a communication channel."
+ (replace-regexp-in-string
+ "^" "> "
+ (replace-regexp-in-string "\n\\'" "" contents)))
+
+
+;;;; Section
+
+(defun org-md-section (_section contents _info)
+ "Transcode SECTION element into Markdown format.
+CONTENTS is the section contents. INFO is a plist used as
+a communication channel."
+ contents)
+
+
+;;;; Template
+
+(defun org-md-inner-template (contents info)
+ "Return body of document after converting it to Markdown syntax.
+CONTENTS is the transcoded contents string. INFO is a plist
+holding export options."
+ ;; Make sure CONTENTS is separated from table of contents and
+ ;; footnotes with at least a blank line.
+ (concat
+ ;; Table of contents.
+ (let ((depth (plist-get info :with-toc)))
+ (when depth
+ (concat (org-md--build-toc info (and (wholenump depth) depth)) "\n")))
+ ;; Document contents.
+ contents
+ "\n"
+ ;; Footnotes section.
+ (org-md--footnote-section info)))
+
+(defun org-md-template (contents _info)
+ "Return complete document string after Markdown conversion.
+CONTENTS is the transcoded contents string. INFO is a plist used
+as a communication channel."
+ contents)
+
+
+
+;;; Interactive function
+
+;;;###autoload
+(defun org-md-export-as-markdown (&optional async subtreep visible-only)
+ "Export current buffer to a Markdown buffer.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+Export is done in a buffer named \"*Org MD Export*\", which will
+be displayed when `org-export-show-temporary-export-buffer' is
+non-nil."
+ (interactive)
+ (org-export-to-buffer 'md "*Org MD Export*"
+ async subtreep visible-only nil nil (lambda () (text-mode))))
+
+;;;###autoload
+(defun org-md-convert-region-to-md ()
+ "Assume the current region has Org syntax, and convert it to Markdown.
+This can be used in any buffer. For example, you can write an
+itemized list in Org syntax in a Markdown buffer and use
+this command to convert it."
+ (interactive)
+ (org-export-replace-region-by 'md))
+
+
+;;;###autoload
+(defun org-md-export-to-markdown (&optional async subtreep visible-only)
+ "Export current buffer to a Markdown file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+Return output file's name."
+ (interactive)
+ (let ((outfile (org-export-output-file-name ".md" subtreep)))
+ (org-export-to-file 'md outfile async subtreep visible-only)))
+
+;;;###autoload
+(defun org-md-publish-to-md (plist filename pub-dir)
+ "Publish an org file to Markdown.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name."
+ (org-publish-org-to 'md filename ".md" plist pub-dir))
+
+(provide 'ox-md)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ox-md.el ends here
diff --git a/elpa/org-9.5.2/ox-md.elc b/elpa/org-9.5.2/ox-md.elc
new file mode 100644
index 0000000..61a64b1
--- /dev/null
+++ b/elpa/org-9.5.2/ox-md.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ox-odt.el b/elpa/org-9.5.2/ox-odt.el
new file mode 100644
index 0000000..f186ebb
--- /dev/null
+++ b/elpa/org-9.5.2/ox-odt.el
@@ -0,0 +1,4338 @@
+;;; ox-odt.el --- OpenDocument Text Exporter for Org Mode -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Author: Jambunathan K <kjambunathan at gmail dot com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'format-spec)
+(require 'org-compat)
+(require 'org-macs)
+(require 'ox)
+(require 'table nil 'noerror)
+
+;;; Define Back-End
+
+(org-export-define-backend 'odt
+ '((bold . org-odt-bold)
+ (center-block . org-odt-center-block)
+ (clock . org-odt-clock)
+ (code . org-odt-code)
+ (drawer . org-odt-drawer)
+ (dynamic-block . org-odt-dynamic-block)
+ (entity . org-odt-entity)
+ (example-block . org-odt-example-block)
+ (export-block . org-odt-export-block)
+ (export-snippet . org-odt-export-snippet)
+ (fixed-width . org-odt-fixed-width)
+ (footnote-definition . org-odt-footnote-definition)
+ (footnote-reference . org-odt-footnote-reference)
+ (headline . org-odt-headline)
+ (horizontal-rule . org-odt-horizontal-rule)
+ (inline-src-block . org-odt-inline-src-block)
+ (inlinetask . org-odt-inlinetask)
+ (italic . org-odt-italic)
+ (item . org-odt-item)
+ (keyword . org-odt-keyword)
+ (latex-environment . org-odt-latex-environment)
+ (latex-fragment . org-odt-latex-fragment)
+ (line-break . org-odt-line-break)
+ (link . org-odt-link)
+ (node-property . org-odt-node-property)
+ (paragraph . org-odt-paragraph)
+ (plain-list . org-odt-plain-list)
+ (plain-text . org-odt-plain-text)
+ (planning . org-odt-planning)
+ (property-drawer . org-odt-property-drawer)
+ (quote-block . org-odt-quote-block)
+ (radio-target . org-odt-radio-target)
+ (section . org-odt-section)
+ (special-block . org-odt-special-block)
+ (src-block . org-odt-src-block)
+ (statistics-cookie . org-odt-statistics-cookie)
+ (strike-through . org-odt-strike-through)
+ (subscript . org-odt-subscript)
+ (superscript . org-odt-superscript)
+ (table . org-odt-table)
+ (table-cell . org-odt-table-cell)
+ (table-row . org-odt-table-row)
+ (target . org-odt-target)
+ (template . org-odt-template)
+ (timestamp . org-odt-timestamp)
+ (underline . org-odt-underline)
+ (verbatim . org-odt-verbatim)
+ (verse-block . org-odt-verse-block))
+ :filters-alist '((:filter-parse-tree
+ . (org-odt--translate-latex-fragments
+ org-odt--translate-description-lists
+ org-odt--translate-list-tables
+ org-odt--translate-image-links)))
+ :menu-entry
+ '(?o "Export to ODT"
+ ((?o "As ODT file" org-odt-export-to-odt)
+ (?O "As ODT file and open"
+ (lambda (a s v b)
+ (if a (org-odt-export-to-odt t s v)
+ (org-open-file (org-odt-export-to-odt nil s v) 'system))))))
+ :options-alist
+ '((:odt-styles-file "ODT_STYLES_FILE" nil org-odt-styles-file t)
+ (:description "DESCRIPTION" nil nil newline)
+ (:keywords "KEYWORDS" nil nil space)
+ (:subtitle "SUBTITLE" nil nil parse)
+ ;; Other variables.
+ (:odt-content-template-file nil nil org-odt-content-template-file)
+ (:odt-display-outline-level nil nil org-odt-display-outline-level)
+ (:odt-fontify-srcblocks nil nil org-odt-fontify-srcblocks)
+ (:odt-format-drawer-function nil nil org-odt-format-drawer-function)
+ (:odt-format-headline-function nil nil org-odt-format-headline-function)
+ (:odt-format-inlinetask-function nil nil org-odt-format-inlinetask-function)
+ (:odt-inline-formula-rules nil nil org-odt-inline-formula-rules)
+ (:odt-inline-image-rules nil nil org-odt-inline-image-rules)
+ (:odt-pixels-per-inch nil nil org-odt-pixels-per-inch)
+ (:odt-table-styles nil nil org-odt-table-styles)
+ (:odt-use-date-fields nil nil org-odt-use-date-fields)
+ ;; Redefine regular option.
+ (:with-latex nil "tex" org-odt-with-latex)
+ ;; Retrieve LaTeX header for fragments.
+ (:latex-header "LATEX_HEADER" nil nil newline)))
+
+
+;;; Dependencies
+
+;;; Hooks
+
+;;; Function and Dynamically Scoped Variables Declarations
+
+(declare-function hfy-face-to-style "htmlfontify" (fn))
+(declare-function hfy-face-or-def-to-name "htmlfontify" (fn))
+(declare-function archive-zip-extract "arc-mode" (archive name))
+(declare-function org-create-math-formula "org" (latex-frag &optional mathml-file))
+(declare-function browse-url-file-url "browse-url" (file))
+
+(defvar nxml-auto-insert-xml-declaration-flag) ; nxml-mode.el
+(defvar archive-zip-extract) ; arc-mode.el
+(defvar hfy-end-span-handler) ; htmlfontify.el
+(defvar hfy-begin-span-handler) ; htmlfontify.el
+(defvar hfy-face-to-css) ; htmlfontify.el
+(defvar hfy-html-quote-map) ; htmlfontify.el
+(defvar hfy-html-quote-regex) ; htmlfontify.el
+
+
+;;; Internal Variables
+
+(defconst org-odt-lib-dir
+ (file-name-directory (or load-file-name (buffer-file-name)))
+ "Location of ODT exporter.
+Use this to infer values of `org-odt-styles-dir' and
+`org-odt-schema-dir'.")
+
+(defvar org-odt-data-dir (expand-file-name "../../etc/" org-odt-lib-dir)
+ "Data directory for ODT exporter.
+Use this to infer values of `org-odt-styles-dir' and
+`org-odt-schema-dir'.")
+
+(defconst org-odt-special-string-regexps
+ '(("\\\\-" . "&#x00ad;\\1") ; shy
+ ("---\\([^-]\\)" . "&#x2014;\\1") ; mdash
+ ("--\\([^-]\\)" . "&#x2013;\\1") ; ndash
+ ("\\.\\.\\." . "&#x2026;")) ; hellip
+ "Regular expressions for special string conversion.")
+
+(defconst org-odt-schema-dir-list
+ (list (expand-file-name "./schema/" org-odt-data-dir))
+ "List of directories to search for OpenDocument schema files.
+Use this list to set the default value of `org-odt-schema-dir'.
+The entries in this list are populated heuristically based on the
+values of `org-odt-lib-dir' and `org-odt-data-dir'.")
+
+(defconst org-odt-styles-dir-list
+ (list
+ (and org-odt-data-dir
+ (expand-file-name "./styles/" org-odt-data-dir)) ; bail out
+ (expand-file-name "./styles/" org-odt-data-dir)
+ (expand-file-name "../etc/styles/" org-odt-lib-dir) ; git
+ (expand-file-name "./etc/styles/" org-odt-lib-dir) ; elpa
+ (expand-file-name "./org/" data-directory) ; system
+ )
+ "List of directories to search for OpenDocument styles files.
+See `org-odt-styles-dir'. The entries in this list are populated
+heuristically based on the values of `org-odt-lib-dir' and
+`org-odt-data-dir'.")
+
+(defconst org-odt-styles-dir
+ (let ((styles-dir
+ (cl-find-if
+ (lambda (dir)
+ (and dir
+ (file-readable-p
+ (expand-file-name "OrgOdtContentTemplate.xml" dir))
+ (file-readable-p (expand-file-name "OrgOdtStyles.xml" dir))))
+ org-odt-styles-dir-list)))
+ (unless styles-dir
+ (error "Error (ox-odt): Cannot find factory styles files, aborting"))
+ styles-dir)
+ "Directory that holds auxiliary XML files used by the ODT exporter.
+
+This directory contains the following XML files -
+ \"OrgOdtStyles.xml\" and \"OrgOdtContentTemplate.xml\". These
+ XML files are used as the default values of
+ `org-odt-styles-file' and `org-odt-content-template-file'.
+
+The default value of this variable varies depending on the
+version of Org in use and is initialized from
+`org-odt-styles-dir-list'. Note that the user could be using Org
+from one of: Org own private git repository, GNU ELPA tar or
+standard Emacs.")
+
+(defconst org-odt-bookmark-prefix "OrgXref.")
+
+(defconst org-odt-manifest-file-entry-tag
+ "\n<manifest:file-entry manifest:media-type=\"%s\" manifest:full-path=\"%s\"%s/>")
+
+(defconst org-odt-file-extensions
+ '(("odt" . "OpenDocument Text")
+ ("ott" . "OpenDocument Text Template")
+ ("odm" . "OpenDocument Master Document")
+ ("ods" . "OpenDocument Spreadsheet")
+ ("ots" . "OpenDocument Spreadsheet Template")
+ ("odg" . "OpenDocument Drawing (Graphics)")
+ ("otg" . "OpenDocument Drawing Template")
+ ("odp" . "OpenDocument Presentation")
+ ("otp" . "OpenDocument Presentation Template")
+ ("odi" . "OpenDocument Image")
+ ("odf" . "OpenDocument Formula")
+ ("odc" . "OpenDocument Chart")))
+
+(defconst org-odt-table-style-format
+ "
+<style:style style:name=\"%s\" style:family=\"table\">
+ <style:table-properties style:rel-width=\"%s%%\" fo:margin-top=\"0cm\" fo:margin-bottom=\"0.20cm\" table:align=\"center\"/>
+</style:style>
+"
+ "Template for auto-generated Table styles.")
+
+(defvar org-odt-automatic-styles '()
+ "Registry of automatic styles for various OBJECT-TYPEs.
+The variable has the following form:
+ ((OBJECT-TYPE-A
+ ((OBJECT-NAME-A.1 OBJECT-PROPS-A.1)
+ (OBJECT-NAME-A.2 OBJECT-PROPS-A.2) ...))
+ (OBJECT-TYPE-B
+ ((OBJECT-NAME-B.1 OBJECT-PROPS-B.1)
+ (OBJECT-NAME-B.2 OBJECT-PROPS-B.2) ...))
+ ...).
+
+OBJECT-TYPEs could be \"Section\", \"Table\", \"Figure\" etc.
+OBJECT-PROPS is (typically) a plist created by passing
+\"#+ATTR_ODT: \" option to `org-odt-parse-block-attributes'.
+
+Use `org-odt-add-automatic-style' to add update this variable.'")
+
+(defvar org-odt-object-counters nil
+ "Running counters for various OBJECT-TYPEs.
+Use this to generate automatic names and style-names. See
+`org-odt-add-automatic-style'.")
+
+(defvar org-odt-src-block-paragraph-format
+ "<style:style style:name=\"OrgSrcBlock\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">
+ <style:paragraph-properties fo:background-color=\"%s\" fo:padding=\"0.049cm\" fo:border=\"0.51pt solid #000000\" style:shadow=\"none\">
+ <style:background-image/>
+ </style:paragraph-properties>
+ <style:text-properties fo:color=\"%s\"/>
+ </style:style>"
+ "Custom paragraph style for colorized source and example blocks.
+This style is much the same as that of \"OrgFixedWidthBlock\"
+except that the foreground and background colors are set
+according to the default face identified by the `htmlfontify'.")
+
+(defvar hfy-optimizations)
+(defvar org-odt-embedded-formulas-count 0)
+(defvar org-odt-embedded-images-count 0)
+(defvar org-odt-image-size-probe-method
+ (append (and (executable-find "identify") '(imagemagick)) ; See Bug#10675
+ '(emacs fixed))
+ "Ordered list of methods for determining image sizes.")
+
+(defvar org-odt-default-image-sizes-alist
+ '(("as-char" . (5 . 0.4))
+ ("paragraph" . (5 . 5)))
+ "Hardcoded image dimensions one for each of the anchor methods.")
+
+;; A4 page size is 21.0 by 29.7 cms
+;; The default page settings has 2cm margin on each of the sides. So
+;; the effective text area is 17.0 by 25.7 cm
+(defvar org-odt-max-image-size '(17.0 . 20.0)
+ "Limiting dimensions for an embedded image.")
+
+(defconst org-odt-label-styles
+ '(("math-formula" "%c" "text" "(%n)")
+ ("math-label" "(%n)" "text" "(%n)")
+ ("category-and-value" "%e %n: %c" "category-and-value" "%e %n")
+ ("value" "%e %n: %c" "value" "%n"))
+ "Specify how labels are applied and referenced.
+
+This is an alist where each element is of the form:
+
+ (STYLE-NAME ATTACH-FMT REF-MODE REF-FMT)
+
+ATTACH-FMT controls how labels and captions are attached to an
+entity. It may contain following specifiers - %e and %c. %e is
+replaced with the CATEGORY-NAME. %n is replaced with
+\"<text:sequence ...> SEQNO </text:sequence>\". %c is replaced
+with CAPTION.
+
+REF-MODE and REF-FMT controls how label references are generated.
+The following XML is generated for a label reference -
+\"<text:sequence-ref text:reference-format=\"REF-MODE\" ...>
+REF-FMT </text:sequence-ref>\". REF-FMT may contain following
+specifiers - %e and %n. %e is replaced with the CATEGORY-NAME.
+%n is replaced with SEQNO.
+
+See also `org-odt-format-label'.")
+
+(defvar org-odt-category-map-alist
+ '(("__Table__" "Table" "value" "Table" org-odt--enumerable-p)
+ ("__Figure__" "Illustration" "value" "Figure" org-odt--enumerable-image-p)
+ ("__MathFormula__" "Text" "math-formula" "Equation" org-odt--enumerable-formula-p)
+ ("__DvipngImage__" "Equation" "value" "Equation" org-odt--enumerable-latex-image-p)
+ ("__Listing__" "Listing" "value" "Listing" org-odt--enumerable-p))
+ "Map a CATEGORY-HANDLE to OD-VARIABLE and LABEL-STYLE.
+
+This is a list where each entry is of the form:
+
+ (CATEGORY-HANDLE OD-VARIABLE LABEL-STYLE CATEGORY-NAME ENUMERATOR-PREDICATE)
+
+CATEGORY_HANDLE identifies the captionable entity in question.
+
+OD-VARIABLE is the OpenDocument sequence counter associated with
+the entity. These counters are declared within
+\"<text:sequence-decls>...</text:sequence-decls>\" block of
+`org-odt-content-template-file'.
+
+LABEL-STYLE is a key into `org-odt-label-styles' and specifies
+how a given entity should be captioned and referenced.
+
+CATEGORY-NAME is used for qualifying captions on export.
+
+ENUMERATOR-PREDICATE is used for assigning a sequence number to
+the entity. See `org-odt--enumerate'.")
+
+(defvar org-odt-manifest-file-entries nil)
+(defvar hfy-user-sheet-assoc)
+
+(defvar org-odt-zip-dir nil
+ "Temporary work directory for OpenDocument exporter.")
+
+
+
+;;; User Configuration Variables
+
+(defgroup org-export-odt nil
+ "Options for exporting Org mode files to ODT."
+ :tag "Org Export ODT"
+ :group 'org-export)
+
+
+;;;; Debugging
+
+(defcustom org-odt-prettify-xml nil
+ "Specify whether or not the xml output should be prettified.
+When this option is turned on, `indent-region' is run on all
+component xml buffers before they are saved. Turn this off for
+regular use. Turn this on if you need to examine the xml
+visually."
+ :group 'org-export-odt
+ :version "24.1"
+ :type 'boolean)
+
+
+;;;; Document schema
+
+(require 'rng-loc)
+(defcustom org-odt-schema-dir
+ (cl-find-if
+ (lambda (dir)
+ (and dir
+ (file-expand-wildcards
+ (expand-file-name "od-manifest-schema*.rnc" dir))
+ (file-expand-wildcards (expand-file-name "od-schema*.rnc" dir))
+ (file-readable-p (expand-file-name "schemas.xml" dir))))
+ org-odt-schema-dir-list)
+ "Directory that contains OpenDocument schema files.
+
+This directory contains:
+1. rnc files for OpenDocument schema
+2. a \"schemas.xml\" file that specifies locating rules needed
+ for auto validation of OpenDocument XML files.
+
+Use the customize interface to set this variable. This ensures
+that `rng-schema-locating-files' is updated and auto-validation
+of OpenDocument XML takes place based on the value
+`rng-nxml-auto-validate-flag'.
+
+The default value of this variable varies depending on the
+version of org in use and is initialized from
+`org-odt-schema-dir-list'. The OASIS schema files are available
+only in the org's private git repository. It is *not* bundled
+with GNU ELPA tar or standard Emacs distribution."
+ :type '(choice
+ (const :tag "Not set" nil)
+ (directory :tag "Schema directory"))
+ :group 'org-export-odt
+ :version "24.1"
+ :set
+ (lambda (var value)
+ "Set `org-odt-schema-dir'.
+Also add it to `rng-schema-locating-files'."
+ (let ((schema-dir value))
+ (set var
+ (if (and
+ (file-expand-wildcards
+ (expand-file-name "od-manifest-schema*.rnc" schema-dir))
+ (file-expand-wildcards
+ (expand-file-name "od-schema*.rnc" schema-dir))
+ (file-readable-p
+ (expand-file-name "schemas.xml" schema-dir)))
+ schema-dir
+ (when value
+ (message "Error (ox-odt): %s has no OpenDocument schema files"
+ value))
+ nil)))
+ (when org-odt-schema-dir
+ (eval-after-load 'rng-loc
+ '(add-to-list 'rng-schema-locating-files
+ (expand-file-name "schemas.xml"
+ org-odt-schema-dir))))))
+
+
+;;;; Document styles
+
+(defcustom org-odt-content-template-file nil
+ "Template file for \"content.xml\".
+The exporter embeds the exported content just before
+\"</office:text>\" element.
+
+If unspecified, the file named \"OrgOdtContentTemplate.xml\"
+under `org-odt-styles-dir' is used."
+ :type '(choice (const nil)
+ (file))
+ :group 'org-export-odt
+ :version "24.3")
+
+(defcustom org-odt-styles-file nil
+ "Default styles file for use with ODT export.
+Valid values are one of:
+1. nil
+2. path to a styles.xml file
+3. path to a *.odt or a *.ott file
+4. list of the form (ODT-OR-OTT-FILE (FILE-MEMBER-1 FILE-MEMBER-2
+...))
+
+In case of option 1, an in-built styles.xml is used. See
+`org-odt-styles-dir' for more information.
+
+In case of option 3, the specified file is unzipped and the
+styles.xml embedded therein is used.
+
+In case of option 4, the specified ODT-OR-OTT-FILE is unzipped
+and FILE-MEMBER-1, FILE-MEMBER-2 etc are copied in to the
+generated odt file. Use relative path for specifying the
+FILE-MEMBERS. styles.xml must be specified as one of the
+FILE-MEMBERS.
+
+Use options 1, 2 or 3 only if styles.xml alone suffices for
+achieving the desired formatting. Use option 4, if the styles.xml
+references additional files like header and footer images for
+achieving the desired formatting.
+
+Use \"#+ODT_STYLES_FILE: ...\" directive to set this variable on
+a per-file basis. For example,
+
+#+ODT_STYLES_FILE: \"/path/to/styles.xml\" or
+#+ODT_STYLES_FILE: (\"/path/to/file.ott\" (\"styles.xml\" \"image/hdr.png\"))."
+ :group 'org-export-odt
+ :version "24.1"
+ :type
+ '(choice
+ (const :tag "Factory settings" nil)
+ (file :must-match t :tag "styles.xml")
+ (file :must-match t :tag "ODT or OTT file")
+ (list :tag "ODT or OTT file + Members"
+ (file :must-match t :tag "ODF Text or Text Template file")
+ (cons :tag "Members"
+ (file :tag " Member" "styles.xml")
+ (repeat (file :tag "Member"))))))
+
+(defcustom org-odt-display-outline-level 2
+ "Outline levels considered for enumerating captioned entities."
+ :group 'org-export-odt
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'integer)
+
+;;;; Document conversion
+
+(defcustom org-odt-convert-processes
+ '(("LibreOffice"
+ "soffice --headless --convert-to %f%x --outdir %d %i")
+ ("unoconv"
+ "unoconv -f %f -o %d %i"))
+ "Specify a list of document converters and their usage.
+The converters in this list are offered as choices while
+customizing `org-odt-convert-process'.
+
+This variable is a list where each element is of the
+form (CONVERTER-NAME CONVERTER-CMD). CONVERTER-NAME is the name
+of the converter. CONVERTER-CMD is the shell command for the
+converter and can contain format specifiers. These format
+specifiers are interpreted as below:
+
+%i input file name in full
+%I input file name as a URL
+%f format of the output file
+%o output file name in full
+%O output file name as a URL
+%d output dir in full
+%D output dir as a URL.
+%x extra options as set in `org-odt-convert-capabilities'."
+ :group 'org-export-odt
+ :version "24.1"
+ :type
+ '(choice
+ (const :tag "None" nil)
+ (alist :tag "Converters"
+ :key-type (string :tag "Converter Name")
+ :value-type (group (string :tag "Command line")))))
+
+(defcustom org-odt-convert-process "LibreOffice"
+ "Use this converter to convert from \"odt\" format to other formats.
+During customization, the list of converter names are populated
+from `org-odt-convert-processes'."
+ :group 'org-export-odt
+ :version "24.1"
+ :type '(choice :convert-widget
+ (lambda (w)
+ (apply 'widget-convert (widget-type w)
+ (eval (car (widget-get w :args)))))
+ `((const :tag "None" nil)
+ ,@(mapcar (lambda (c)
+ `(const :tag ,(car c) ,(car c)))
+ org-odt-convert-processes))))
+
+(defcustom org-odt-convert-capabilities
+ '(("Text"
+ ("odt" "ott" "doc" "rtf" "docx")
+ (("pdf" "pdf") ("odt" "odt") ("rtf" "rtf") ("ott" "ott")
+ ("doc" "doc" ":\"MS Word 97\"") ("docx" "docx") ("html" "html")))
+ ("Web"
+ ("html")
+ (("pdf" "pdf") ("odt" "odt") ("html" "html")))
+ ("Spreadsheet"
+ ("ods" "ots" "xls" "csv" "xlsx")
+ (("pdf" "pdf") ("ots" "ots") ("html" "html") ("csv" "csv") ("ods" "ods")
+ ("xls" "xls") ("xlsx" "xlsx")))
+ ("Presentation"
+ ("odp" "otp" "ppt" "pptx")
+ (("pdf" "pdf") ("swf" "swf") ("odp" "odp") ("otp" "otp") ("ppt" "ppt")
+ ("pptx" "pptx") ("odg" "odg"))))
+ "Specify input and output formats of `org-odt-convert-process'.
+More correctly, specify the set of input and output formats that
+the user is actually interested in.
+
+This variable is an alist where each element is of the
+form (DOCUMENT-CLASS INPUT-FMT-LIST OUTPUT-FMT-ALIST).
+INPUT-FMT-LIST is a list of INPUT-FMTs. OUTPUT-FMT-ALIST is an
+alist where each element is of the form (OUTPUT-FMT
+OUTPUT-FILE-EXTENSION EXTRA-OPTIONS).
+
+The variable is interpreted as follows:
+`org-odt-convert-process' can take any document that is in
+INPUT-FMT-LIST and produce any document that is in the
+OUTPUT-FMT-LIST. A document converted to OUTPUT-FMT will have
+OUTPUT-FILE-EXTENSION as the file name extension. OUTPUT-FMT
+serves dual purposes:
+- It is used for populating completion candidates during
+ `org-odt-convert' commands.
+- It is used as the value of \"%f\" specifier in
+ `org-odt-convert-process'.
+
+EXTRA-OPTIONS is used as the value of \"%x\" specifier in
+`org-odt-convert-process'.
+
+DOCUMENT-CLASS is used to group a set of file formats in
+INPUT-FMT-LIST in to a single class.
+
+Note that this variable inherently captures how LibreOffice based
+converters work. LibreOffice maps documents of various formats
+to classes like Text, Web, Spreadsheet, Presentation etc and
+allow document of a given class (irrespective of its source
+format) to be converted to any of the export formats associated
+with that class.
+
+See default setting of this variable for a typical configuration."
+ :group 'org-export-odt
+ :version "24.1"
+ :type
+ '(choice
+ (const :tag "None" nil)
+ (alist :tag "Capabilities"
+ :key-type (string :tag "Document Class")
+ :value-type
+ (group (repeat :tag "Input formats" (string :tag "Input format"))
+ (alist :tag "Output formats"
+ :key-type (string :tag "Output format")
+ :value-type
+ (group (string :tag "Output file extension")
+ (choice
+ (const :tag "None" nil)
+ (string :tag "Extra options"))))))))
+
+(defcustom org-odt-preferred-output-format nil
+ "Automatically post-process to this format after exporting to \"odt\".
+Command `org-odt-export-to-odt' exports first to \"odt\" format
+and then uses `org-odt-convert-process' to convert the
+resulting document to this format. During customization of this
+variable, the list of valid values are populated based on
+`org-odt-convert-capabilities'.
+
+You can set this option on per-file basis using file local
+values. See Info node `(emacs) File Variables'."
+ :group 'org-export-odt
+ :version "24.1"
+ :type '(choice :convert-widget
+ (lambda (w)
+ (apply 'widget-convert (widget-type w)
+ (eval (car (widget-get w :args)))))
+ `((const :tag "None" nil)
+ ,@(mapcar (lambda (c)
+ `(const :tag ,c ,c))
+ (org-odt-reachable-formats "odt")))))
+;;;###autoload
+(put 'org-odt-preferred-output-format 'safe-local-variable 'stringp)
+
+
+;;;; Drawers
+
+(defcustom org-odt-format-drawer-function (lambda (_name contents) contents)
+ "Function called to format a drawer in ODT code.
+
+The function must accept two parameters:
+ NAME the drawer name, like \"LOGBOOK\"
+ CONTENTS the contents of the drawer.
+
+The function should return the string to be exported.
+
+The default value simply returns the value of CONTENTS."
+ :group 'org-export-odt
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'function)
+
+
+;;;; Headline
+
+(defcustom org-odt-format-headline-function
+ 'org-odt-format-headline-default-function
+ "Function to format headline text.
+
+This function will be called with 5 arguments:
+TODO the todo keyword (string or nil).
+TODO-TYPE the type of todo (symbol: `todo', `done', nil)
+PRIORITY the priority of the headline (integer or nil)
+TEXT the main headline text (string).
+TAGS the tags string, separated with colons (string or nil).
+
+The function result will be used as headline text."
+ :group 'org-export-odt
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'function)
+
+
+;;;; Inlinetasks
+
+(defcustom org-odt-format-inlinetask-function
+ 'org-odt-format-inlinetask-default-function
+ "Function called to format an inlinetask in ODT code.
+
+The function must accept six parameters:
+ TODO the todo keyword, as a string
+ TODO-TYPE the todo type, a symbol among `todo', `done' and nil.
+ PRIORITY the inlinetask priority, as a string
+ NAME the inlinetask name, as a string.
+ TAGS the inlinetask tags, as a string.
+ CONTENTS the contents of the inlinetask, as a string.
+
+The function should return the string to be exported."
+ :group 'org-export-odt
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'function)
+
+
+;;;; LaTeX
+
+(defcustom org-odt-with-latex org-export-with-latex
+ "Non-nil means process LaTeX math snippets.
+
+When set, the exporter will process LaTeX environments and
+fragments.
+
+This option can also be set with the +OPTIONS line,
+e.g. \"tex:mathjax\". Allowed values are:
+
+nil Ignore math snippets.
+`verbatim' Keep everything in verbatim
+`dvipng' Process the LaTeX fragments to images. This will also
+ include processing of non-math environments.
+`imagemagick' Convert the LaTeX fragments to pdf files and use
+ imagemagick to convert pdf files to png files.
+`mathjax' Do MathJax preprocessing and arrange for MathJax.js to
+ be loaded.
+
+Any other symbol is a synonym for `mathjax'."
+ :group 'org-export-odt
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "Do not process math in any way" nil)
+ (const :tag "Leave math verbatim" verbatim)
+ (const :tag "Use dvipng to make images" dvipng)
+ (const :tag "Use imagemagick to make images" imagemagick)
+ (other :tag "Use MathJax to display math" mathjax)))
+
+
+;;;; Links
+
+(defcustom org-odt-inline-formula-rules
+ '(("file" . "\\.\\(mathml\\|mml\\|odf\\)\\'"))
+ "Rules characterizing formula files that can be inlined into ODT.
+
+A rule consists in an association whose key is the type of link
+to consider, and value is a regexp that will be matched against
+link's path."
+ :group 'org-export-odt
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(alist :key-type (string :tag "Type")
+ :value-type (regexp :tag "Path")))
+
+(defcustom org-odt-inline-image-rules
+ `(("file" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg"))))
+ "Rules characterizing image files that can be inlined into ODT.
+
+A rule consists in an association whose key is the type of link
+to consider, and value is a regexp that will be matched against
+link's path."
+ :group 'org-export-odt
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(alist :key-type (string :tag "Type")
+ :value-type (regexp :tag "Path")))
+
+(defcustom org-odt-pixels-per-inch 96.0
+ "Scaling factor for converting images pixels to inches.
+Use this for sizing of embedded images. See Info node `(org)
+Images in ODT export' for more information."
+ :type 'float
+ :group 'org-export-odt
+ :version "24.4"
+ :package-version '(Org . "8.1"))
+
+
+;;;; Src Block
+
+(defcustom org-odt-create-custom-styles-for-srcblocks t
+ "Whether custom styles for colorized source blocks be automatically created.
+When this option is turned on, the exporter creates custom styles
+for source blocks based on the advice of `htmlfontify'. Creation
+of custom styles happen as part of `org-odt-hfy-face-to-css'.
+
+When this option is turned off exporter does not create such
+styles.
+
+Use the latter option if you do not want the custom styles to be
+based on your current display settings. It is necessary that the
+styles.xml already contains needed styles for colorizing to work.
+
+This variable is effective only if `org-odt-fontify-srcblocks' is
+turned on."
+ :group 'org-export-odt
+ :version "24.1"
+ :type 'boolean)
+
+(defcustom org-odt-fontify-srcblocks t
+ "Specify whether or not source blocks need to be fontified.
+Turn this option on if you want to colorize the source code
+blocks in the exported file. For colorization to work, you need
+to make available an enhanced version of `htmlfontify' library."
+ :type 'boolean
+ :group 'org-export-odt
+ :version "24.1")
+
+
+;;;; Table
+
+(defcustom org-odt-table-styles
+ '(("OrgEquation" "OrgEquation"
+ ((use-first-column-styles . t)
+ (use-last-column-styles . t)))
+ ("TableWithHeaderRowAndColumn" "Custom"
+ ((use-first-row-styles . t)
+ (use-first-column-styles . t)))
+ ("TableWithFirstRowandLastRow" "Custom"
+ ((use-first-row-styles . t)
+ (use-last-row-styles . t)))
+ ("GriddedTable" "Custom" nil))
+ "Specify how Table Styles should be derived from a Table Template.
+This is a list where each element is of the
+form (TABLE-STYLE-NAME TABLE-TEMPLATE-NAME TABLE-CELL-OPTIONS).
+
+TABLE-STYLE-NAME is the style associated with the table through
+\"#+ATTR_ODT: :style TABLE-STYLE-NAME\" line.
+
+TABLE-TEMPLATE-NAME is a set of - up to 9 - automatic
+TABLE-CELL-STYLE-NAMEs and PARAGRAPH-STYLE-NAMEs (as defined
+below) that is included in `org-odt-content-template-file'.
+
+TABLE-CELL-STYLE-NAME := TABLE-TEMPLATE-NAME + TABLE-CELL-TYPE +
+ \"TableCell\"
+PARAGRAPH-STYLE-NAME := TABLE-TEMPLATE-NAME + TABLE-CELL-TYPE +
+ \"TableParagraph\"
+TABLE-CELL-TYPE := \"FirstRow\" | \"LastColumn\" |
+ \"FirstRow\" | \"LastRow\" |
+ \"EvenRow\" | \"OddRow\" |
+ \"EvenColumn\" | \"OddColumn\" | \"\"
+where \"+\" above denotes string concatenation.
+
+TABLE-CELL-OPTIONS is an alist where each element is of the
+form (TABLE-CELL-STYLE-SELECTOR . ON-OR-OFF).
+TABLE-CELL-STYLE-SELECTOR := `use-first-row-styles' |
+ `use-last-row-styles' |
+ `use-first-column-styles' |
+ `use-last-column-styles' |
+ `use-banding-rows-styles' |
+ `use-banding-columns-styles' |
+ `use-first-row-styles'
+ON-OR-OFF := t | nil
+
+For example, with the following configuration
+
+\(setq org-odt-table-styles
+ \\='((\"TableWithHeaderRowsAndColumns\" \"Custom\"
+ ((use-first-row-styles . t)
+ (use-first-column-styles . t)))
+ (\"TableWithHeaderColumns\" \"Custom\"
+ ((use-first-column-styles . t)))))
+
+1. A table associated with \"TableWithHeaderRowsAndColumns\"
+ style will use the following table-cell styles -
+ \"CustomFirstRowTableCell\", \"CustomFirstColumnTableCell\",
+ \"CustomTableCell\" and the following paragraph styles
+ \"CustomFirstRowTableParagraph\",
+ \"CustomFirstColumnTableParagraph\", \"CustomTableParagraph\"
+ as appropriate.
+
+2. A table associated with \"TableWithHeaderColumns\" style will
+ use the following table-cell styles -
+ \"CustomFirstColumnTableCell\", \"CustomTableCell\" and the
+ following paragraph styles
+ \"CustomFirstColumnTableParagraph\", \"CustomTableParagraph\"
+ as appropriate..
+
+Note that TABLE-TEMPLATE-NAME corresponds to the
+\"<table:table-template>\" elements contained within
+\"<office:styles>\". The entries (TABLE-STYLE-NAME
+TABLE-TEMPLATE-NAME TABLE-CELL-OPTIONS) correspond to
+\"table:template-name\" and \"table:use-first-row-styles\" etc
+attributes of \"<table:table>\" element. Refer ODF-1.2
+specification for more information. Also consult the
+implementation filed under `org-odt-get-table-cell-styles'.
+
+The TABLE-STYLE-NAME \"OrgEquation\" is used internally for
+formatting of numbered display equations. Do not delete this
+style from the list."
+ :group 'org-export-odt
+ :version "24.1"
+ :type '(choice
+ (const :tag "None" nil)
+ (repeat :tag "Table Styles"
+ (list :tag "Table Style Specification"
+ (string :tag "Table Style Name")
+ (string :tag "Table Template Name")
+ (alist :options (use-first-row-styles
+ use-last-row-styles
+ use-first-column-styles
+ use-last-column-styles
+ use-banding-rows-styles
+ use-banding-columns-styles)
+ :key-type symbol
+ :value-type (const :tag "True" t))))))
+
+;;;; Timestamps
+
+(defcustom org-odt-use-date-fields nil
+ "Non-nil, if timestamps should be exported as date fields.
+
+When nil, export timestamps as plain text.
+
+When non-nil, map `org-time-stamp-custom-formats' to a pair of
+OpenDocument date-styles with names \"OrgDate1\" and \"OrgDate2\"
+respectively. A timestamp with no time component is formatted
+with style \"OrgDate1\" while one with explicit hour and minutes
+is formatted with style \"OrgDate2\".
+
+This feature is experimental. Most (but not all) of the common
+%-specifiers in `format-time-string' are supported.
+Specifically, locale-dependent specifiers like \"%c\", \"%x\" are
+formatted as canonical Org timestamps. For finer control, avoid
+these %-specifiers.
+
+Textual specifiers like \"%b\", \"%h\", \"%B\", \"%a\", \"%A\"
+etc., are displayed by the application in the default language
+and country specified in `org-odt-styles-file'. Note that the
+default styles file uses language \"en\" and country \"GB\". You
+can localize the week day and month strings in the exported
+document by setting the default language and country either using
+the application UI or through a custom styles file.
+
+See `org-odt--build-date-styles' for implementation details."
+ :group 'org-export-odt
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+
+
+;;; Internal functions
+
+;;;; Date
+
+(defun org-odt--format-timestamp (timestamp &optional end iso-date-p)
+ (let* ((format-timestamp
+ (lambda (timestamp format &optional end utc)
+ (if timestamp
+ (org-timestamp-format timestamp format end utc)
+ (format-time-string format nil utc))))
+ (has-time-p (or (not timestamp)
+ (org-timestamp-has-time-p timestamp)))
+ (iso-date (let ((format (if has-time-p "%Y-%m-%dT%H:%M:%S"
+ "%Y-%m-%d")))
+ (funcall format-timestamp timestamp format end))))
+ (if iso-date-p iso-date
+ (let* ((style (if has-time-p "OrgDate2" "OrgDate1"))
+ ;; LibreOffice does not care about end goes as content
+ ;; within the "<text:date>...</text:date>" field. The
+ ;; displayed date is automagically corrected to match the
+ ;; format requested by "style:data-style-name" attribute. So
+ ;; don't bother about formatting the date contents to be
+ ;; compatible with "OrgDate1" and "OrgDateTime" styles. A
+ ;; simple Org-style date should suffice.
+ (date (let* ((formats
+ (if org-display-custom-times
+ (cons (substring
+ (car org-time-stamp-custom-formats) 1 -1)
+ (substring
+ (cdr org-time-stamp-custom-formats) 1 -1))
+ '("%Y-%m-%d %a" . "%Y-%m-%d %a %H:%M")))
+ (format (if has-time-p (cdr formats) (car formats))))
+ (funcall format-timestamp timestamp format end)))
+ (repeater (let ((repeater-type (org-element-property
+ :repeater-type timestamp))
+ (repeater-value (org-element-property
+ :repeater-value timestamp))
+ (repeater-unit (org-element-property
+ :repeater-unit timestamp)))
+ (concat
+ (cl-case repeater-type
+ (catchup "++") (restart ".+") (cumulate "+"))
+ (when repeater-value
+ (number-to-string repeater-value))
+ (cl-case repeater-unit
+ (hour "h") (day "d") (week "w") (month "m")
+ (year "y"))))))
+ (concat
+ (format "<text:date text:date-value=\"%s\" style:data-style-name=\"%s\" text:fixed=\"true\">%s</text:date>"
+ iso-date style date)
+ (and (not (string= repeater "")) " ")
+ repeater)))))
+
+;;;; Frame
+
+(defun org-odt--frame (text width height style &optional extra
+ anchor-type &rest title-and-desc)
+ (let ((frame-attrs
+ (concat
+ (if width (format " svg:width=\"%0.2fcm\"" width) "")
+ (if height (format " svg:height=\"%0.2fcm\"" height) "")
+ extra
+ (format " text:anchor-type=\"%s\"" (or anchor-type "paragraph"))
+ (format " draw:name=\"%s\""
+ (car (org-odt-add-automatic-style "Frame"))))))
+ (format
+ "\n<draw:frame draw:style-name=\"%s\"%s>\n%s\n</draw:frame>"
+ style frame-attrs
+ (concat text
+ (let ((title (car title-and-desc))
+ (desc (cadr title-and-desc)))
+ (concat (when title
+ (format "<svg:title>%s</svg:title>"
+ (org-odt--encode-plain-text title t)))
+ (when desc
+ (format "<svg:desc>%s</svg:desc>"
+ (org-odt--encode-plain-text desc t)))))))))
+
+
+;;;; Library wrappers
+
+(defun org-odt--zip-extract (archive members target)
+ (when (atom members) (setq members (list members)))
+ (require 'arc-mode)
+ (dolist (member members)
+ (let* ((--quote-file-name
+ ;; This is shamelessly stolen from `archive-zip-extract'.
+ (lambda (name)
+ (if (or (not (memq system-type '(windows-nt ms-dos)))
+ (and (boundp 'w32-quote-process-args)
+ (null w32-quote-process-args)))
+ (shell-quote-argument name)
+ name)))
+ (target (funcall --quote-file-name target))
+ (archive (expand-file-name archive))
+ (archive-zip-extract
+ (list "unzip" "-qq" "-o" "-d" target))
+ exit-code command-output)
+ (setq command-output
+ (with-temp-buffer
+ (setq exit-code (archive-zip-extract archive member))
+ (buffer-string)))
+ (unless (zerop exit-code)
+ (message command-output)
+ (error "Extraction failed")))))
+
+;;;; Target
+
+(defun org-odt--target (text id)
+ (if (not id) text
+ (concat
+ (format "\n<text:bookmark-start text:name=\"OrgXref.%s\"/>" id)
+ (format "\n<text:bookmark text:name=\"%s\"/>" id) text
+ (format "\n<text:bookmark-end text:name=\"OrgXref.%s\"/>" id))))
+
+;;;; Textbox
+
+(defun org-odt--textbox (text width height style &optional
+ extra anchor-type)
+ (org-odt--frame
+ (format "\n<draw:text-box %s>%s\n</draw:text-box>"
+ (concat (format " fo:min-height=\"%0.2fcm\"" (or height .2))
+ (and (not width)
+ (format " fo:min-width=\"%0.2fcm\"" (or width .2))))
+ text)
+ width nil style extra anchor-type))
+
+
+
+;;;; Table of Contents
+
+(defun org-odt--format-toc (title entries depth)
+ "Return a table of contents.
+TITLE is the title of the table, as a string, or nil. ENTRIES is
+the contents of the table, as a string. DEPTH is an integer
+specifying the depth of the table."
+ (concat
+ "
+<text:table-of-content text:style-name=\"OrgIndexSection\" text:protected=\"true\" text:name=\"Table of Contents\">\n"
+ (format " <text:table-of-content-source text:outline-level=\"%d\">" depth)
+ (and title
+ (format "
+ <text:index-title-template text:style-name=\"Contents_20_Heading\">%s</text:index-title-template>
+"
+ title))
+
+ (let ((levels (number-sequence 1 10)))
+ (mapconcat
+ (lambda (level)
+ (format
+ "
+ <text:table-of-content-entry-template text:outline-level=\"%d\" text:style-name=\"Contents_20_%d\">
+ <text:index-entry-link-start text:style-name=\"Internet_20_link\"/>
+ <text:index-entry-chapter/>
+ <text:index-entry-text/>
+ <text:index-entry-link-end/>
+ </text:table-of-content-entry-template>\n"
+ level level)) levels ""))
+ "
+ </text:table-of-content-source>
+ <text:index-body>"
+ (and title
+ (format "
+ <text:index-title text:style-name=\"Sect1\" text:name=\"Table of Contents1_Head\">
+ <text:p text:style-name=\"Contents_20_Heading\">%s</text:p>
+ </text:index-title>\n"
+ title))
+ entries
+ "
+ </text:index-body>
+</text:table-of-content>"))
+
+(cl-defun org-odt-format-toc-headline
+ (todo _todo-type priority text tags
+ &key _level section-number headline-label &allow-other-keys)
+ (format "<text:a xlink:type=\"simple\" xlink:href=\"#%s\">%s</text:a>"
+ headline-label
+ (concat
+ ;; Section number.
+ (and section-number (concat section-number ". "))
+ ;; Todo.
+ (when todo
+ (let ((style (if (member todo org-done-keywords)
+ "OrgDone" "OrgTodo")))
+ (format "<text:span text:style-name=\"%s\">%s</text:span> "
+ style todo)))
+ (when priority
+ (let* ((style (format "OrgPriority-%s" priority))
+ (priority (format "[#%c]" priority)))
+ (format "<text:span text:style-name=\"%s\">%s</text:span> "
+ style priority)))
+ ;; Title.
+ text
+ ;; Tags.
+ (when tags
+ (concat
+ (format " <text:span text:style-name=\"%s\">[%s]</text:span>"
+ "OrgTags"
+ (mapconcat
+ (lambda (tag)
+ (format
+ "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgTag" tag)) tags " : ")))))))
+
+(defun org-odt-toc (depth info &optional scope)
+ "Build a table of contents.
+DEPTH is an integer specifying the depth of the table. INFO is
+a plist containing current export properties. Optional argument
+SCOPE, when non-nil, defines the scope of the table. Return the
+table of contents as a string, or nil."
+ (cl-assert (wholenump depth))
+ ;; When a headline is marked as a radio target, as in the example below:
+ ;;
+ ;; ** <<<Some Heading>>>
+ ;; Some text.
+ ;;
+ ;; suppress generation of radio targets. i.e., Radio targets are to
+ ;; be marked as targets within /document body/ and *not* within
+ ;; /TOC/, as otherwise there will be duplicated anchors one in TOC
+ ;; and one in the document body.
+ ;;
+ ;; Likewise, links, footnote references and regular targets are also
+ ;; suppressed.
+ (let* ((headlines (org-export-collect-headlines info depth scope))
+ (backend (org-export-toc-entry-backend
+ (org-export-backend-name (plist-get info :back-end)))))
+ (when headlines
+ (org-odt--format-toc
+ (and (not scope) (org-export-translate "Table of Contents" :utf-8 info))
+ (mapconcat
+ (lambda (headline)
+ (let* ((entry (org-odt-format-headline--wrap
+ headline backend info 'org-odt-format-toc-headline))
+ (level (org-export-get-relative-level headline info))
+ (style (format "Contents_20_%d" level)))
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ style entry)))
+ headlines "\n")
+ depth))))
+
+
+;;;; Document styles
+
+(defun org-odt-add-automatic-style (object-type &optional object-props)
+ "Create an automatic style of type OBJECT-TYPE with param OBJECT-PROPS.
+OBJECT-PROPS is (typically) a plist created by passing
+\"#+ATTR_ODT: \" option of the object in question to
+`org-odt-parse-block-attributes'.
+
+Use `org-odt-object-counters' to generate an automatic
+OBJECT-NAME and STYLE-NAME. If OBJECT-PROPS is non-nil, add a
+new entry in `org-odt-automatic-styles'. Return (OBJECT-NAME
+. STYLE-NAME)."
+ (cl-assert (stringp object-type))
+ (let* ((object (intern object-type))
+ (seqvar object)
+ (seqno (1+ (or (plist-get org-odt-object-counters seqvar) 0)))
+ (object-name (format "%s%d" object-type seqno)) style-name)
+ (setq org-odt-object-counters
+ (plist-put org-odt-object-counters seqvar seqno))
+ (when object-props
+ (setq style-name (format "Org%s" object-name))
+ (setq org-odt-automatic-styles
+ (plist-put org-odt-automatic-styles object
+ (append (list (list style-name object-props))
+ (plist-get org-odt-automatic-styles object)))))
+ (cons object-name style-name)))
+
+;;;; Checkbox
+
+(defun org-odt--checkbox (item)
+ "Return check-box string associated to ITEM."
+ (let ((checkbox (org-element-property :checkbox item)))
+ (if (not checkbox) ""
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgCode" (cl-case checkbox
+ (on "[&#x2713;] ") ; CHECK MARK
+ (off "[ ] ")
+ (trans "[-] "))))))
+
+;;; Template
+
+(defun org-odt--build-date-styles (fmt style)
+ ;; In LibreOffice 3.4.6, there doesn't seem to be a convenient way
+ ;; to modify the date fields. A date could be modified by
+ ;; offsetting in days. That's about it. Also, date and time may
+ ;; have to be emitted as two fields - a date field and a time field
+ ;; - separately.
+
+ ;; One can add Form Controls to date and time fields so that they
+ ;; can be easily modified. But then, the exported document will
+ ;; become tightly coupled with LibreOffice and may not function
+ ;; properly with other OpenDocument applications.
+
+ ;; I have a strange feeling that Date styles are a bit flaky at the
+ ;; moment.
+
+ ;; The feature is experimental.
+ (when (and fmt style)
+ (let* ((fmt-alist
+ '(("%A" . "<number:day-of-week number:style=\"long\"/>")
+ ("%B" . "<number:month number:textual=\"true\" number:style=\"long\"/>")
+ ("%H" . "<number:hours number:style=\"long\"/>")
+ ("%M" . "<number:minutes number:style=\"long\"/>")
+ ("%S" . "<number:seconds number:style=\"long\"/>")
+ ("%V" . "<number:week-of-year/>")
+ ("%Y" . "<number:year number:style=\"long\"/>")
+ ("%a" . "<number:day-of-week number:style=\"short\"/>")
+ ("%b" . "<number:month number:textual=\"true\" number:style=\"short\"/>")
+ ("%d" . "<number:day number:style=\"long\"/>")
+ ("%e" . "<number:day number:style=\"short\"/>")
+ ("%h" . "<number:month number:textual=\"true\" number:style=\"short\"/>")
+ ("%k" . "<number:hours number:style=\"short\"/>")
+ ("%m" . "<number:month number:style=\"long\"/>")
+ ("%p" . "<number:am-pm/>")
+ ("%y" . "<number:year number:style=\"short\"/>")))
+ (case-fold-search nil)
+ (re (mapconcat 'identity (mapcar 'car fmt-alist) "\\|"))
+ match rpl (start 0) (filler-beg 0) filler-end filler output)
+ (dolist (pair
+ '(("\\(?:%[[:digit:]]*N\\)" . "") ; strip ns, us and ns
+ ("%C" . "Y") ; replace century with year
+ ("%D" . "%m/%d/%y")
+ ("%G" . "Y") ; year corresponding to iso week
+ ("%I" . "%H") ; hour on a 12-hour clock
+ ("%R" . "%H:%M")
+ ("%T" . "%H:%M:%S")
+ ("%U\\|%W" . "%V") ; week no. starting on Sun./Mon.
+ ("%Z" . "") ; time zone name
+ ("%c" . "%Y-%M-%d %a %H:%M" ) ; locale's date and time format
+ ("%g" . "%y")
+ ("%X" . "%x" ) ; locale's pref. time format
+ ("%j" . "") ; day of the year
+ ("%l" . "%k") ; like %I blank-padded
+ ("%s" . "") ; no. of secs since 1970-01-01 00:00:00 +0000
+ ("%n" . "<text:line-break/>")
+ ("%r" . "%I:%M:%S %p")
+ ("%t" . "<text:tab/>")
+ ("%u\\|%w" . "") ; numeric day of week - Mon (1-7), Sun(0-6)
+ ("%x" . "%Y-%M-%d %a") ; locale's pref. time format
+ ("%z" . "") ; time zone in numeric form
+ ))
+ (setq fmt (replace-regexp-in-string (car pair) (cdr pair) fmt t t)))
+ (while (string-match re fmt start)
+ (setq match (match-string 0 fmt))
+ (setq rpl (assoc-default match fmt-alist))
+ (setq start (match-end 0))
+ (setq filler-end (match-beginning 0))
+ (setq filler (substring fmt (prog1 filler-beg
+ (setq filler-beg (match-end 0)))
+ filler-end))
+ (setq filler (and (not (string= filler ""))
+ (format "<number:text>%s</number:text>"
+ (org-odt--encode-plain-text filler))))
+ (setq output (concat output "\n" filler "\n" rpl)))
+ (setq filler (substring fmt filler-beg))
+ (unless (string= filler "")
+ (setq output (concat output
+ (format "\n<number:text>%s</number:text>"
+ (org-odt--encode-plain-text filler)))))
+ (format "\n<number:date-style style:name=\"%s\" %s>%s\n</number:date-style>"
+ style
+ (concat " number:automatic-order=\"true\""
+ " number:format-source=\"fixed\"")
+ output ))))
+
+(defun org-odt-template (contents info)
+ "Return complete document string after ODT conversion.
+CONTENTS is the transcoded contents string. RAW-DATA is the
+original parsed data. INFO is a plist holding export options."
+ ;; Write meta file.
+ (let ((title (org-export-data (plist-get info :title) info))
+ (subtitle (org-export-data (plist-get info :subtitle) info))
+ (author (let ((author (plist-get info :author)))
+ (if (not author) "" (org-export-data author info))))
+ (keywords (or (plist-get info :keywords) ""))
+ (description (or (plist-get info :description) "")))
+ (write-region
+ (concat
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+ <office:document-meta
+ xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\"
+ xmlns:xlink=\"http://www.w3.org/1999/xlink\"
+ xmlns:dc=\"http://purl.org/dc/elements/1.1/\"
+ xmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\"
+ xmlns:ooo=\"http://openoffice.org/2004/office\"
+ office:version=\"1.2\">
+ <office:meta>\n"
+ (format "<dc:creator>%s</dc:creator>\n" author)
+ (format "<meta:initial-creator>%s</meta:initial-creator>\n" author)
+ ;; Date, if required.
+ (when (plist-get info :with-date)
+ ;; Check if DATE is specified as an Org-timestamp. If yes,
+ ;; include it as meta information. Otherwise, just use
+ ;; today's date.
+ (let* ((date (let ((date (plist-get info :date)))
+ (and (not (cdr date))
+ (eq (org-element-type (car date)) 'timestamp)
+ (car date)))))
+ (let ((iso-date (org-odt--format-timestamp date nil 'iso-date)))
+ (concat
+ (format "<dc:date>%s</dc:date>\n" iso-date)
+ (format "<meta:creation-date>%s</meta:creation-date>\n"
+ iso-date)))))
+ (format "<meta:generator>%s</meta:generator>\n"
+ (plist-get info :creator))
+ (format "<meta:keyword>%s</meta:keyword>\n" keywords)
+ (format "<dc:subject>%s</dc:subject>\n" description)
+ (format "<dc:title>%s</dc:title>\n" title)
+ (when (org-string-nw-p subtitle)
+ (format
+ "<meta:user-defined meta:name=\"subtitle\">%s</meta:user-defined>\n"
+ subtitle))
+ "\n"
+ " </office:meta>\n" "</office:document-meta>")
+ nil (concat org-odt-zip-dir "meta.xml"))
+ ;; Add meta.xml in to manifest.
+ (org-odt-create-manifest-file-entry "text/xml" "meta.xml"))
+
+ ;; Update styles file.
+ ;; Copy styles.xml. Also dump htmlfontify styles, if there is any.
+ ;; Write styles file.
+ (let* ((styles-file
+ (pcase (plist-get info :odt-styles-file)
+ (`nil (expand-file-name "OrgOdtStyles.xml" org-odt-styles-dir))
+ ((and s (pred (string-match-p "\\`(.*)\\'")))
+ (condition-case nil
+ (read s)
+ (error (user-error "Invalid styles file specification: %S" s))))
+ (filename (org-strip-quotes filename)))))
+ (cond
+ ;; Non-availability of styles.xml is not a critical error. For
+ ;; now, throw an error.
+ ((null styles-file) (error "Missing styles file"))
+ ((listp styles-file)
+ (let ((archive (nth 0 styles-file))
+ (members (nth 1 styles-file)))
+ (org-odt--zip-extract archive members org-odt-zip-dir)
+ (dolist (member members)
+ (when (org-file-image-p member)
+ (let* ((image-type (file-name-extension member))
+ (media-type (format "image/%s" image-type)))
+ (org-odt-create-manifest-file-entry media-type member))))))
+ ((file-exists-p styles-file)
+ (let ((styles-file-type (file-name-extension styles-file)))
+ (cond
+ ((string= styles-file-type "xml")
+ (copy-file styles-file (concat org-odt-zip-dir "styles.xml") t))
+ ((member styles-file-type '("odt" "ott"))
+ (org-odt--zip-extract styles-file "styles.xml" org-odt-zip-dir)))))
+ (t
+ (error "Invalid specification of styles.xml file: %S"
+ (plist-get info :odt-styles-file))))
+
+ ;; create a manifest entry for styles.xml
+ (org-odt-create-manifest-file-entry "text/xml" "styles.xml")
+ ;; Ensure we have write permissions to this file.
+ (set-file-modes (concat org-odt-zip-dir "styles.xml") #o600)
+
+ ;; FIXME: Who is opening an empty styles.xml before this point?
+ (with-current-buffer
+ (find-file-noselect (concat org-odt-zip-dir "styles.xml") t)
+ (revert-buffer t t)
+
+ ;; Write custom styles for source blocks
+ ;; Save STYLES used for colorizing of source blocks.
+ ;; Update styles.xml with styles that were collected as part of
+ ;; `org-odt-hfy-face-to-css' callbacks.
+ (let ((styles (mapconcat (lambda (style) (format " %s\n" (cddr style)))
+ hfy-user-sheet-assoc "")))
+ (when styles
+ (goto-char (point-min))
+ (when (re-search-forward "</office:styles>" nil t)
+ (goto-char (match-beginning 0))
+ (insert "\n<!-- Org Htmlfontify Styles -->\n" styles "\n"))))
+
+ ;; Update styles.xml - take care of outline numbering
+
+ ;; Don't make automatic backup of styles.xml file. This setting
+ ;; prevents the backed-up styles.xml file from being zipped in to
+ ;; odt file. This is more of a hackish fix. Better alternative
+ ;; would be to fix the zip command so that the output odt file
+ ;; includes only the needed files and excludes any auto-generated
+ ;; extra files like backups and auto-saves etc etc. Note that
+ ;; currently the zip command zips up the entire temp directory so
+ ;; that any auto-generated files created under the hood ends up in
+ ;; the resulting odt file.
+ (setq-local backup-inhibited t)
+
+ ;; Outline numbering is retained only up to LEVEL.
+ ;; To disable outline numbering pass a LEVEL of 0.
+
+ (goto-char (point-min))
+ (let ((regex
+ "<text:outline-level-style\\([^>]*\\)text:level=\"\\([^\"]*\\)\"\\([^>]*\\)>")
+ (replacement
+ "<text:outline-level-style\\1text:level=\"\\2\" style:num-format=\"\">"))
+ (while (re-search-forward regex nil t)
+ (unless (let ((sec-num (plist-get info :section-numbers))
+ (level (string-to-number (match-string 2))))
+ (if (wholenump sec-num) (<= level sec-num) sec-num))
+ (replace-match replacement t nil))))
+ (save-buffer 0)))
+ ;; Update content.xml.
+
+ (let* ( ;; `org-display-custom-times' should be accessed right
+ ;; within the context of the Org buffer. So obtain its
+ ;; value before moving on to temp-buffer context down below.
+ (custom-time-fmts
+ (if org-display-custom-times
+ (cons (substring (car org-time-stamp-custom-formats) 1 -1)
+ (substring (cdr org-time-stamp-custom-formats) 1 -1))
+ '("%Y-%M-%d %a" . "%Y-%M-%d %a %H:%M"))))
+ (with-temp-buffer
+ (insert-file-contents
+ (or (plist-get info :odt-content-template-file)
+ (expand-file-name "OrgOdtContentTemplate.xml"
+ org-odt-styles-dir)))
+ ;; Write automatic styles.
+ ;; - Position the cursor.
+ (goto-char (point-min))
+ (re-search-forward " </office:automatic-styles>" nil t)
+ (goto-char (match-beginning 0))
+ ;; - Dump automatic table styles.
+ (cl-loop for (style-name props) in
+ (plist-get org-odt-automatic-styles 'Table) do
+ (when (setq props (or (plist-get props :rel-width) "96"))
+ (insert (format org-odt-table-style-format style-name props))))
+ ;; - Dump date-styles.
+ (when (plist-get info :odt-use-date-fields)
+ (insert (org-odt--build-date-styles (car custom-time-fmts)
+ "OrgDate1")
+ (org-odt--build-date-styles (cdr custom-time-fmts)
+ "OrgDate2")))
+ ;; Update display level.
+ ;; - Remove existing sequence decls. Also position the cursor.
+ (goto-char (point-min))
+ (when (re-search-forward "<text:sequence-decls" nil t)
+ (delete-region (match-beginning 0)
+ (re-search-forward "</text:sequence-decls>" nil nil)))
+ ;; Update sequence decls according to user preference.
+ (insert
+ (format
+ "\n<text:sequence-decls>\n%s\n</text:sequence-decls>"
+ (mapconcat
+ (lambda (x)
+ (format
+ "<text:sequence-decl text:display-outline-level=\"%d\" text:name=\"%s\"/>"
+ (plist-get info :odt-display-outline-level)
+ (nth 1 x)))
+ org-odt-category-map-alist "\n")))
+ ;; Position the cursor to document body.
+ (goto-char (point-min))
+ (re-search-forward "</office:text>" nil nil)
+ (goto-char (match-beginning 0))
+
+ ;; Preamble - Title, Author, Date etc.
+ (insert
+ (let* ((title (and (plist-get info :with-title)
+ (org-export-data (plist-get info :title) info)))
+ (subtitle (when title
+ (org-export-data (plist-get info :subtitle) info)))
+ (author (and (plist-get info :with-author)
+ (let ((auth (plist-get info :author)))
+ (and auth (org-export-data auth info)))))
+ (email (plist-get info :email))
+ ;; Switch on or off above vars based on user settings
+ (author (and (plist-get info :with-author) (or author email)))
+ (email (and (plist-get info :with-email) email)))
+ (concat
+ ;; Title.
+ (when (org-string-nw-p title)
+ (concat
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>\n"
+ "OrgTitle" (format "\n<text:title>%s</text:title>" title))
+ ;; Separator.
+ "\n<text:p text:style-name=\"OrgTitle\"/>\n"
+ ;; Subtitle.
+ (when (org-string-nw-p subtitle)
+ (concat
+ (format "<text:p text:style-name=\"OrgSubtitle\">\n%s\n</text:p>\n"
+ (concat
+ "<text:user-defined style:data-style-name=\"N0\" text:name=\"subtitle\">\n"
+ subtitle
+ "</text:user-defined>\n"))
+ ;; Separator.
+ "<text:p text:style-name=\"OrgSubtitle\"/>\n"))))
+ (cond
+ ((and author (not email))
+ ;; Author only.
+ (concat
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ "OrgSubtitle"
+ (format "<text:initial-creator>%s</text:initial-creator>" author))
+ ;; Separator.
+ "\n<text:p text:style-name=\"OrgSubtitle\"/>"))
+ ((and author email)
+ ;; Author and E-mail.
+ (concat
+ (format
+ "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ "OrgSubtitle"
+ (format
+ "<text:a xlink:type=\"simple\" xlink:href=\"%s\">%s</text:a>"
+ (concat "mailto:" email)
+ (format "<text:initial-creator>%s</text:initial-creator>" author)))
+ ;; Separator.
+ "\n<text:p text:style-name=\"OrgSubtitle\"/>")))
+ ;; Date, if required.
+ (when (plist-get info :with-date)
+ (let* ((date (plist-get info :date))
+ ;; Check if DATE is specified as a timestamp.
+ (timestamp (and (not (cdr date))
+ (eq (org-element-type (car date)) 'timestamp)
+ (car date))))
+ (when date
+ (concat
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ "OrgSubtitle"
+ (if (and (plist-get info :odt-use-date-fields) timestamp)
+ (org-odt--format-timestamp (car date))
+ (org-export-data date info)))
+ ;; Separator
+ "<text:p text:style-name=\"OrgSubtitle\"/>")))))))
+ ;; Table of Contents
+ (let* ((with-toc (plist-get info :with-toc))
+ (depth (and with-toc (if (wholenump with-toc)
+ with-toc
+ (plist-get info :headline-levels)))))
+ (when depth (insert (or (org-odt-toc depth info) ""))))
+ ;; Contents.
+ (insert contents)
+ ;; Return contents.
+ (buffer-substring-no-properties (point-min) (point-max)))))
+
+
+
+;;; Transcode Functions
+
+;;;; Bold
+
+(defun org-odt-bold (_bold contents _info)
+ "Transcode BOLD from Org to ODT.
+CONTENTS is the text with bold markup. INFO is a plist holding
+contextual information."
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "Bold" contents))
+
+
+;;;; Center Block
+
+(defun org-odt-center-block (_center-block contents _info)
+ "Transcode a CENTER-BLOCK element from Org to ODT.
+CONTENTS holds the contents of the center block. INFO is a plist
+holding contextual information."
+ contents)
+
+
+;;;; Clock
+
+(defun org-odt-clock (clock contents info)
+ "Transcode a CLOCK element from Org to ODT.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (let ((timestamp (org-element-property :value clock))
+ (duration (org-element-property :duration clock)))
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ (if (eq (org-element-type (org-export-get-next-element clock info))
+ 'clock) "OrgClock" "OrgClockLastLine")
+ (concat
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgClockKeyword" org-clock-string)
+ (org-odt-timestamp timestamp contents info)
+ (and duration (format " (%s)" duration))))))
+
+
+;;;; Code
+
+(defun org-odt-code (code _contents _info)
+ "Transcode a CODE object from Org to ODT.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgCode" (org-odt--encode-plain-text
+ (org-element-property :value code))))
+
+
+;;;; Drawer
+
+(defun org-odt-drawer (drawer contents info)
+ "Transcode a DRAWER element from Org to ODT.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (let* ((name (org-element-property :drawer-name drawer))
+ (output (funcall (plist-get info :odt-format-drawer-function)
+ name contents)))
+ output))
+
+
+;;;; Dynamic Block
+
+(defun org-odt-dynamic-block (_dynamic-block contents _info)
+ "Transcode a DYNAMIC-BLOCK element from Org to ODT.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information. See `org-export-data'."
+ contents)
+
+
+;;;; Entity
+
+(defun org-odt-entity (entity _contents _info)
+ "Transcode an ENTITY object from Org to ODT.
+CONTENTS are the definition itself. INFO is a plist holding
+contextual information."
+ (org-element-property :utf-8 entity))
+
+
+;;;; Example Block
+
+(defun org-odt-example-block (example-block _contents info)
+ "Transcode a EXAMPLE-BLOCK element from Org to ODT.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (org-odt-format-code example-block info))
+
+
+;;;; Export Snippet
+
+(defun org-odt-export-snippet (export-snippet _contents _info)
+ "Transcode a EXPORT-SNIPPET object from Org to ODT.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (when (eq (org-export-snippet-backend export-snippet) 'odt)
+ (org-element-property :value export-snippet)))
+
+
+;;;; Export Block
+
+(defun org-odt-export-block (export-block _contents _info)
+ "Transcode a EXPORT-BLOCK element from Org to ODT.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (when (string= (org-element-property :type export-block) "ODT")
+ (org-remove-indentation (org-element-property :value export-block))))
+
+
+;;;; Fixed Width
+
+(defun org-odt-fixed-width (fixed-width _contents info)
+ "Transcode a FIXED-WIDTH element from Org to ODT.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (org-odt-do-format-code (org-element-property :value fixed-width) info))
+
+
+;;;; Footnote Definition
+
+;; Footnote Definitions are ignored.
+
+
+;;;; Footnote Reference
+
+(defun org-odt-footnote-reference (footnote-reference _contents info)
+ "Transcode a FOOTNOTE-REFERENCE element from Org to ODT.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (let ((--format-footnote-definition
+ (lambda (n def)
+ (setq n (format "%d" n))
+ (let ((id (concat "fn" n))
+ (note-class "footnote"))
+ (format
+ "<text:note text:id=\"%s\" text:note-class=\"%s\">%s</text:note>"
+ id note-class
+ (concat
+ (format "<text:note-citation>%s</text:note-citation>" n)
+ (format "<text:note-body>%s</text:note-body>" def))))))
+ (--format-footnote-reference
+ (lambda (n)
+ (setq n (format "%d" n))
+ (let ((note-class "footnote")
+ (ref-format "text")
+ (ref-name (concat "fn" n)))
+ (format
+ "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgSuperscript"
+ (format "<text:note-ref text:note-class=\"%s\" text:reference-format=\"%s\" text:ref-name=\"%s\">%s</text:note-ref>"
+ note-class ref-format ref-name n))))))
+ (concat
+ ;; Insert separator between two footnotes in a row.
+ (let ((prev (org-export-get-previous-element footnote-reference info)))
+ (and (eq (org-element-type prev) 'footnote-reference)
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgSuperscript" ",")))
+ ;; Transcode footnote reference.
+ (let ((n (org-export-get-footnote-number footnote-reference info nil t)))
+ (cond
+ ((not
+ (org-export-footnote-first-reference-p footnote-reference info nil t))
+ (funcall --format-footnote-reference n))
+ (t
+ (let* ((raw (org-export-get-footnote-definition
+ footnote-reference info))
+ (def
+ (let ((def (org-trim
+ (org-export-data-with-backend
+ raw
+ (org-export-create-backend
+ :parent 'odt
+ :transcoders
+ '((paragraph . (lambda (p c i)
+ (org-odt--format-paragraph
+ p c i
+ "Footnote"
+ "OrgFootnoteCenter"
+ "OrgFootnoteQuotations")))))
+ info))))
+ ;; Inline definitions are secondary strings. We
+ ;; need to wrap them within a paragraph.
+ (if (eq (org-element-class (car (org-element-contents raw)))
+ 'element)
+ def
+ (format
+ "\n<text:p text:style-name=\"Footnote\">%s</text:p>"
+ def)))))
+ (funcall --format-footnote-definition n def))))))))
+
+
+;;;; Headline
+
+(defun org-odt-format-headline--wrap (headline backend info
+ &optional format-function
+ &rest extra-keys)
+ "Transcode a HEADLINE element using BACKEND.
+INFO is a plist holding contextual information."
+ (setq backend (or backend (plist-get info :back-end)))
+ (let* ((level (+ (org-export-get-relative-level headline info)))
+ (headline-number (org-export-get-headline-number headline info))
+ (section-number (and (org-export-numbered-headline-p headline info)
+ (mapconcat 'number-to-string
+ headline-number ".")))
+ (todo (and (plist-get info :with-todo-keywords)
+ (let ((todo (org-element-property :todo-keyword headline)))
+ (and todo
+ (org-export-data-with-backend todo backend info)))))
+ (todo-type (and todo (org-element-property :todo-type headline)))
+ (priority (and (plist-get info :with-priority)
+ (org-element-property :priority headline)))
+ (text (org-export-data-with-backend
+ (org-element-property :title headline) backend info))
+ (tags (and (plist-get info :with-tags)
+ (org-export-get-tags headline info)))
+ (headline-label (org-export-get-reference headline info))
+ (format-function
+ (if (functionp format-function) format-function
+ (cl-function
+ (lambda (todo todo-type priority text tags
+ &key _level _section-number _headline-label
+ &allow-other-keys)
+ (funcall (plist-get info :odt-format-headline-function)
+ todo todo-type priority text tags))))))
+ (apply format-function
+ todo todo-type priority text tags
+ :headline-label headline-label
+ :level level
+ :section-number section-number extra-keys)))
+
+(defun org-odt-headline (headline contents info)
+ "Transcode a HEADLINE element from Org to ODT.
+CONTENTS holds the contents of the headline. INFO is a plist
+holding contextual information."
+ ;; Case 1: This is a footnote section: ignore it.
+ (unless (org-element-property :footnote-section-p headline)
+ (let* ((full-text (org-odt-format-headline--wrap headline nil info))
+ ;; Get level relative to current parsed data.
+ (level (org-export-get-relative-level headline info))
+ (numbered (org-export-numbered-headline-p headline info))
+ ;; Get canonical label for the headline.
+ (id (org-export-get-reference headline info))
+ ;; Extra targets.
+ (extra-targets
+ (let ((id (org-element-property :ID headline)))
+ (if id (org-odt--target "" (concat "ID-" id)) "")))
+ ;; Title.
+ (anchored-title (org-odt--target full-text id)))
+ (cond
+ ;; Case 2. This is a deep sub-tree: export it as a list item.
+ ;; Also export as items headlines for which no section
+ ;; format has been found.
+ ((org-export-low-level-p headline info)
+ ;; Build the real contents of the sub-tree.
+ (concat
+ (and (org-export-first-sibling-p headline info)
+ (format "\n<text:list text:style-name=\"%s\" %s>"
+ ;; Choose style based on list type.
+ (if numbered "OrgNumberedList" "OrgBulletedList")
+ ;; If top-level list, re-start numbering. Otherwise,
+ ;; continue numbering.
+ (format "text:continue-numbering=\"%s\""
+ (let* ((parent (org-export-get-parent-headline
+ headline)))
+ (if (and parent
+ (org-export-low-level-p parent info))
+ "true" "false")))))
+ (let ((headline-has-table-p
+ (let ((section (assq 'section (org-element-contents headline))))
+ (assq 'table (and section (org-element-contents section))))))
+ (format "\n<text:list-item>\n%s\n%s"
+ (concat
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ "Text_20_body"
+ (concat extra-targets anchored-title))
+ contents)
+ (if headline-has-table-p
+ "</text:list-header>"
+ "</text:list-item>")))
+ (and (org-export-last-sibling-p headline info)
+ "</text:list>")))
+ ;; Case 3. Standard headline. Export it as a section.
+ (t
+ (concat
+ (format
+ "\n<text:h text:style-name=\"%s\" text:outline-level=\"%s\" text:is-list-header=\"%s\">%s</text:h>"
+ (format "Heading_20_%s%s"
+ level (if numbered "" "_unnumbered"))
+ level
+ (if numbered "false" "true")
+ (concat extra-targets anchored-title))
+ contents))))))
+
+(defun org-odt-format-headline-default-function
+ (todo todo-type priority text tags)
+ "Default format function for a headline.
+See `org-odt-format-headline-function' for details."
+ (concat
+ ;; Todo.
+ (when todo
+ (let ((style (if (eq todo-type 'done) "OrgDone" "OrgTodo")))
+ (format "<text:span text:style-name=\"%s\">%s</text:span> " style todo)))
+ (when priority
+ (let* ((style (format "OrgPriority-%c" priority))
+ (priority (format "[#%c]" priority)))
+ (format "<text:span text:style-name=\"%s\">%s</text:span> "
+ style priority)))
+ ;; Title.
+ text
+ ;; Tags.
+ (when tags
+ (concat
+ "<text:tab/>"
+ (format "<text:span text:style-name=\"%s\">[%s]</text:span>"
+ "OrgTags" (mapconcat
+ (lambda (tag)
+ (format
+ "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgTag" tag)) tags " : "))))))
+
+
+;;;; Horizontal Rule
+
+(defun org-odt-horizontal-rule (_horizontal-rule _contents _info)
+ "Transcode an HORIZONTAL-RULE object from Org to ODT.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ "Horizontal_20_Line" ""))
+
+
+;;;; Inline Babel Call
+
+;; Inline Babel Calls are ignored.
+
+
+;;;; Inline Src Block
+
+(defun org-odt--find-verb-separator (s)
+ "Return a character not used in string S.
+This is used to choose a separator for constructs like \\verb."
+ (let ((ll "~,./?;':\"|!@#%^&-_=+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ<>()[]{}"))
+ (cl-loop for c across ll
+ when (not (string-match (regexp-quote (char-to-string c)) s))
+ return (char-to-string c))))
+
+(defun org-odt-inline-src-block (_inline-src-block _contents _info)
+ "Transcode an INLINE-SRC-BLOCK element from Org to ODT.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (error "FIXME"))
+
+
+;;;; Inlinetask
+
+(defun org-odt-inlinetask (inlinetask contents info)
+ "Transcode an INLINETASK element from Org to ODT.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (let* ((todo
+ (and (plist-get info :with-todo-keywords)
+ (let ((todo (org-element-property :todo-keyword inlinetask)))
+ (and todo (org-export-data todo info)))))
+ (todo-type (and todo (org-element-property :todo-type inlinetask)))
+ (priority (and (plist-get info :with-priority)
+ (org-element-property :priority inlinetask)))
+ (text (org-export-data (org-element-property :title inlinetask) info))
+ (tags (and (plist-get info :with-tags)
+ (org-export-get-tags inlinetask info))))
+ (funcall (plist-get info :odt-format-inlinetask-function)
+ todo todo-type priority text tags contents)))
+
+(defun org-odt-format-inlinetask-default-function
+ (todo todo-type priority name tags contents)
+ "Default format function for inlinetasks.
+See `org-odt-format-inlinetask-function' for details."
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ "Text_20_body"
+ (org-odt--textbox
+ (concat
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ "OrgInlineTaskHeading"
+ (org-odt-format-headline-default-function
+ todo todo-type priority name tags))
+ contents)
+ nil nil "OrgInlineTaskFrame" " style:rel-width=\"100%\"")))
+
+;;;; Italic
+
+(defun org-odt-italic (_italic contents _info)
+ "Transcode ITALIC from Org to ODT.
+CONTENTS is the text with italic markup. INFO is a plist holding
+contextual information."
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "Emphasis" contents))
+
+
+;;;; Item
+
+(defun org-odt-item (item contents info)
+ "Transcode an ITEM element from Org to ODT.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (let* ((plain-list (org-export-get-parent item))
+ (count (org-element-property :counter item))
+ (type (org-element-property :type plain-list)))
+ (unless (memq type '(ordered unordered descriptive-1 descriptive-2))
+ (error "Unknown list type: %S" type))
+ (format "\n<text:list-item%s>\n%s\n%s"
+ (if count (format " text:start-value=\"%s\"" count) "")
+ contents
+ (if (org-element-map item 'table #'identity info 'first-match)
+ "</text:list-header>"
+ "</text:list-item>"))))
+
+;;;; Keyword
+
+(defun org-odt-keyword (keyword _contents info)
+ "Transcode a KEYWORD element from Org to ODT.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (let ((key (org-element-property :key keyword))
+ (value (org-element-property :value keyword)))
+ (cond
+ ((string= key "ODT") value)
+ ((string= key "INDEX")
+ ;; FIXME
+ (ignore))
+ ((string= key "TOC")
+ (let ((case-fold-search t))
+ (cond
+ ((string-match-p "\\<headlines\\>" value)
+ (let ((depth (or (and (string-match "\\<[0-9]+\\>" value)
+ (string-to-number (match-string 0 value)))
+ (plist-get info :headline-levels)))
+ (scope
+ (cond
+ ((string-match ":target +\\(\".+?\"\\|\\S-+\\)" value) ;link
+ (org-export-resolve-link
+ (org-strip-quotes (match-string 1 value)) info))
+ ((string-match-p "\\<local\\>" value) keyword)))) ;local
+ (org-odt-toc depth info scope)))
+ ((string-match-p "tables\\|figures\\|listings" value)
+ ;; FIXME
+ (ignore))))))))
+
+
+;;;; Latex Environment
+
+
+;; (eval-after-load 'ox-odt '(ad-deactivate 'org-format-latex-as-mathml))
+;; (defadvice org-format-latex-as-mathml ; FIXME
+;; (after org-odt-protect-latex-fragment activate)
+;; "Encode LaTeX fragment as XML.
+;; Do this when translation to MathML fails."
+;; (unless (> (length ad-return-value) 0)
+;; (setq ad-return-value (org-odt--encode-plain-text (ad-get-arg 0)))))
+
+(defun org-odt-latex-environment (latex-environment _contents info)
+ "Transcode a LATEX-ENVIRONMENT element from Org to ODT.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (let* ((latex-frag (org-remove-indentation
+ (org-element-property :value latex-environment))))
+ (org-odt-do-format-code latex-frag info)))
+
+
+;;;; Latex Fragment
+
+;; (when latex-frag ; FIXME
+;; (setq href (propertize href :title "LaTeX Fragment"
+;; :description latex-frag)))
+;; handle verbatim
+;; provide descriptions
+
+(defun org-odt-latex-fragment (latex-fragment _contents _info)
+ "Transcode a LATEX-FRAGMENT object from Org to ODT.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (let ((latex-frag (org-element-property :value latex-fragment)))
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgCode" (org-odt--encode-plain-text latex-frag t))))
+
+
+;;;; Line Break
+
+(defun org-odt-line-break (_line-break _contents _info)
+ "Transcode a LINE-BREAK object from Org to ODT.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ "<text:line-break/>")
+
+
+;;;; Link
+
+;;;; Links :: Label references
+
+(defun org-odt--enumerate (element info &optional predicate n)
+ (when predicate (cl-assert (funcall predicate element info)))
+ (let* ((--numbered-parent-headline-at-<=-n
+ (lambda (element n info)
+ (cl-loop for x in (org-element-lineage element)
+ thereis (and (eq (org-element-type x) 'headline)
+ (<= (org-export-get-relative-level x info) n)
+ (org-export-numbered-headline-p x info)
+ x))))
+ (--enumerate
+ (lambda (element scope info &optional predicate)
+ (let ((counter 0))
+ (org-element-map (or scope (plist-get info :parse-tree))
+ (org-element-type element)
+ (lambda (el)
+ (and (or (not predicate) (funcall predicate el info))
+ (cl-incf counter)
+ (eq element el)
+ counter))
+ info 'first-match))))
+ (scope (funcall --numbered-parent-headline-at-<=-n
+ element
+ (or n (plist-get info :odt-display-outline-level))
+ info))
+ (ordinal (funcall --enumerate element scope info predicate))
+ (tag
+ (concat
+ ;; Section number.
+ (and scope
+ (mapconcat 'number-to-string
+ (org-export-get-headline-number scope info) "."))
+ ;; Separator.
+ (and scope ".")
+ ;; Ordinal.
+ (number-to-string ordinal))))
+ tag))
+
+(defun org-odt-format-label (element info op)
+ "Return a label for ELEMENT.
+
+ELEMENT is a `link', `table', `src-block' or `paragraph' type
+element. INFO is a plist used as a communication channel. OP is
+either `definition' or `reference', depending on the purpose of
+the generated string.
+
+Return value is a string if OP is set to `reference' or a cons
+cell like CAPTION . SHORT-CAPTION) where CAPTION and
+SHORT-CAPTION are strings."
+ (cl-assert (memq (org-element-type element) '(link table src-block paragraph)))
+ (let* ((element-or-parent
+ (cl-case (org-element-type element)
+ (link (org-export-get-parent-element element))
+ (t element)))
+ ;; Get label and caption.
+ (label (and (or (org-element-property :name element)
+ (org-element-property :name element-or-parent))
+ (org-export-get-reference element-or-parent info)))
+ (caption (let ((c (org-export-get-caption element-or-parent)))
+ (and c (org-export-data c info))))
+ ;; FIXME: We don't use short-caption for now
+ ;; (short-caption nil)
+ )
+ (when (or label caption)
+ (let* ((default-category
+ (cl-case (org-element-type element)
+ (table "__Table__")
+ (src-block "__Listing__")
+ ((link paragraph)
+ (cond
+ ((org-odt--enumerable-latex-image-p element info)
+ "__DvipngImage__")
+ ((org-odt--enumerable-image-p element info)
+ "__Figure__")
+ ((org-odt--enumerable-formula-p element info)
+ "__MathFormula__")
+ (t (error "Don't know how to format label for link: %S"
+ element))))
+ (t (error "Don't know how to format label for element type: %s"
+ (org-element-type element)))))
+ seqno)
+ (cl-assert default-category)
+ (pcase-let
+ ((`(,counter ,label-style ,category ,predicate)
+ (assoc-default default-category org-odt-category-map-alist)))
+ ;; Compute sequence number of the element.
+ (setq seqno (org-odt--enumerate element info predicate))
+ ;; Localize category string.
+ (setq category (org-export-translate category :utf-8 info))
+ (cl-case op
+ ;; Case 1: Handle Label definition.
+ (definition
+ (cons
+ (concat
+ ;; Sneak in a bookmark. The bookmark is used when the
+ ;; labeled element is referenced with a link that
+ ;; provides its own description.
+ (format "\n<text:bookmark text:name=\"%s\"/>" label)
+ ;; Label definition: Typically formatted as below:
+ ;; CATEGORY SEQ-NO: LONG CAPTION
+ ;; with translation for correct punctuation.
+ (format-spec
+ (org-export-translate
+ (cadr (assoc-string label-style org-odt-label-styles t))
+ :utf-8 info)
+ `((?e . ,category)
+ (?n . ,(format
+ "<text:sequence text:ref-name=\"%s\" text:name=\"%s\" text:formula=\"ooow:%s+1\" style:num-format=\"1\">%s</text:sequence>"
+ label counter counter seqno))
+ (?c . ,(or caption "")))))
+ nil)) ;; short-caption
+ ;; Case 2: Handle Label reference.
+ (reference
+ (let* ((fmt (cddr (assoc-string label-style org-odt-label-styles t)))
+ (fmt1 (car fmt))
+ (fmt2 (cadr fmt)))
+ (format "<text:sequence-ref text:reference-format=\"%s\" text:ref-name=\"%s\">%s</text:sequence-ref>"
+ fmt1
+ label
+ (format-spec fmt2 `((?e . ,category) (?n . ,seqno))))))
+ (t (error "Unknown %S on label" op))))))))
+
+
+;;;; Links :: Inline Images
+
+(defun org-odt--copy-image-file (path)
+ "Return the internal name of the file."
+ (let* ((image-type (file-name-extension path))
+ (media-type (format "image/%s" image-type))
+ (target-dir "Images/")
+ (target-file
+ (format "%s%04d.%s" target-dir
+ (cl-incf org-odt-embedded-images-count) image-type)))
+ (message "Embedding %s as %s..."
+ (substring-no-properties path) target-file)
+
+ (when (= 1 org-odt-embedded-images-count)
+ (make-directory (concat org-odt-zip-dir target-dir))
+ (org-odt-create-manifest-file-entry "" target-dir))
+
+ (copy-file path (concat org-odt-zip-dir target-file) 'overwrite)
+ (org-odt-create-manifest-file-entry media-type target-file)
+ target-file))
+
+;; For --without-x builds.
+(declare-function clear-image-cache "image.c" (&optional filter))
+(declare-function image-size "image.c" (spec &optional pixels frame))
+
+(defun org-odt--image-size
+ (file info &optional user-width user-height scale dpi embed-as)
+ (let* ((--pixels-to-cms
+ (lambda (pixels dpi)
+ (let ((cms-per-inch 2.54)
+ (inches (/ pixels dpi)))
+ (* cms-per-inch inches))))
+ (--size-in-cms
+ (lambda (size-in-pixels dpi)
+ (and size-in-pixels
+ (cons (funcall --pixels-to-cms (car size-in-pixels) dpi)
+ (funcall --pixels-to-cms (cdr size-in-pixels) dpi)))))
+ (dpi (or dpi (plist-get info :odt-pixels-per-inch)))
+ (anchor-type (or embed-as "paragraph"))
+ (user-width (and (not scale) user-width))
+ (user-height (and (not scale) user-height))
+ (size
+ (and
+ (not (and user-height user-width))
+ (or
+ ;; Use Imagemagick.
+ (and (executable-find "identify")
+ (let ((size-in-pixels
+ (let ((dim (shell-command-to-string
+ (format "identify -format \"%%w:%%h\" \"%s\""
+ file))))
+ (when (string-match "\\([0-9]+\\):\\([0-9]+\\)" dim)
+ (cons (string-to-number (match-string 1 dim))
+ (string-to-number (match-string 2 dim)))))))
+ (funcall --size-in-cms size-in-pixels dpi)))
+ ;; Use Emacs.
+ (let ((size-in-pixels
+ (ignore-errors ; Emacs could be in batch mode
+ (clear-image-cache)
+ (image-size (create-image file) 'pixels))))
+ (funcall --size-in-cms size-in-pixels dpi))
+ ;; Use hard-coded values.
+ (cdr (assoc-string anchor-type
+ org-odt-default-image-sizes-alist))
+ ;; Error out.
+ (error "Cannot determine image size, aborting"))))
+ (width (car size)) (height (cdr size)))
+ (cond
+ (scale
+ (setq width (* width scale) height (* height scale)))
+ ((and user-height user-width)
+ (setq width user-width height user-height))
+ (user-height
+ (setq width (* user-height (/ width height)) height user-height))
+ (user-width
+ (setq height (* user-width (/ height width)) width user-width))
+ (t (ignore)))
+ ;; ensure that an embedded image fits comfortably within a page
+ (let ((max-width (car org-odt-max-image-size))
+ (max-height (cdr org-odt-max-image-size)))
+ (when (or (> width max-width) (> height max-height))
+ (let* ((scale1 (/ max-width width))
+ (scale2 (/ max-height height))
+ (scale (min scale1 scale2)))
+ (setq width (* scale width) height (* scale height)))))
+ (cons width height)))
+
+(defun org-odt-link--inline-image (element info)
+ "Return ODT code for an inline image.
+LINK is the link pointing to the inline image. INFO is a plist
+used as a communication channel."
+ (cl-assert (eq (org-element-type element) 'link))
+ (let* ((src (let* ((type (org-element-property :type element))
+ (raw-path (org-element-property :path element)))
+ (cond ((member type '("http" "https"))
+ (concat type ":" raw-path))
+ ((file-name-absolute-p raw-path)
+ (expand-file-name raw-path))
+ (t raw-path))))
+ (src-expanded (if (file-name-absolute-p src) src
+ (expand-file-name src (file-name-directory
+ (plist-get info :input-file)))))
+ (href (format
+ "\n<draw:image xlink:href=\"%s\" xlink:type=\"simple\" xlink:show=\"embed\" xlink:actuate=\"onLoad\"/>"
+ (org-odt--copy-image-file src-expanded)))
+ ;; Extract attributes from #+ATTR_ODT line.
+ (attr-from (cl-case (org-element-type element)
+ (link (org-export-get-parent-element element))
+ (t element)))
+ ;; Convert attributes to a plist.
+ (attr-plist (org-export-read-attribute :attr_odt attr-from))
+ ;; Handle `:anchor', `:style' and `:attributes' properties.
+ (user-frame-anchor
+ (car (assoc-string (plist-get attr-plist :anchor)
+ '(("as-char") ("paragraph") ("page")) t)))
+ (user-frame-style
+ (and user-frame-anchor (plist-get attr-plist :style)))
+ (user-frame-attrs
+ (and user-frame-anchor (plist-get attr-plist :attributes)))
+ (user-frame-params
+ (list user-frame-style user-frame-attrs user-frame-anchor))
+ ;; (embed-as (or embed-as user-frame-anchor "paragraph"))
+ ;;
+ ;; Handle `:width', `:height' and `:scale' properties. Read
+ ;; them as numbers since we need them for computations.
+ (size (org-odt--image-size
+ src-expanded info
+ (let ((width (plist-get attr-plist :width)))
+ (and width (read width)))
+ (let ((length (plist-get attr-plist :length)))
+ (and length (read length)))
+ (let ((scale (plist-get attr-plist :scale)))
+ (and scale (read scale)))
+ nil ; embed-as
+ "paragraph" ; FIXME
+ ))
+ (width (car size)) (height (cdr size))
+ (standalone-link-p (org-odt--standalone-link-p element info))
+ (embed-as (if standalone-link-p "paragraph" "as-char"))
+ (captions (org-odt-format-label element info 'definition))
+ (caption (car captions))
+ (entity (concat (and caption "Captioned") embed-as "Image"))
+ ;; Check if this link was created by LaTeX-to-PNG converter.
+ (replaces (org-element-property
+ :replaces (if (not standalone-link-p) element
+ (org-export-get-parent-element element))))
+ ;; If yes, note down the type of the element - LaTeX Fragment
+ ;; or LaTeX environment. It will go in to frame title.
+ (title (and replaces (capitalize
+ (symbol-name (org-element-type replaces)))))
+
+ ;; If yes, note down its contents. It will go in to frame
+ ;; description. This quite useful for debugging.
+ (desc (and replaces (org-element-property :value replaces))))
+ (org-odt--render-image/formula entity href width height
+ captions user-frame-params title desc)))
+
+
+;;;; Links :: Math formula
+
+(defun org-odt-link--inline-formula (element info)
+ (let* ((src (let ((raw-path (org-element-property :path element)))
+ (cond
+ ((file-name-absolute-p raw-path)
+ (expand-file-name raw-path))
+ (t raw-path))))
+ (src-expanded (if (file-name-absolute-p src) src
+ (expand-file-name src (file-name-directory
+ (plist-get info :input-file)))))
+ (href
+ (format
+ "\n<draw:object %s xlink:href=\"%s\" xlink:type=\"simple\"/>"
+ " xlink:show=\"embed\" xlink:actuate=\"onLoad\""
+ (file-name-directory (org-odt--copy-formula-file src-expanded))))
+ (standalone-link-p (org-odt--standalone-link-p element info))
+ (embed-as (if standalone-link-p 'paragraph 'character))
+ (captions (org-odt-format-label element info 'definition))
+ ;; Check if this link was created by LaTeX-to-MathML
+ ;; converter.
+ (replaces (org-element-property
+ :replaces (if (not standalone-link-p) element
+ (org-export-get-parent-element element))))
+ ;; If yes, note down the type of the element - LaTeX Fragment
+ ;; or LaTeX environment. It will go in to frame title.
+ (title (and replaces (capitalize
+ (symbol-name (org-element-type replaces)))))
+
+ ;; If yes, note down its contents. It will go in to frame
+ ;; description. This quite useful for debugging.
+ (desc (and replaces (org-element-property :value replaces)))
+ ) ;; width height
+ (cond
+ ((eq embed-as 'character)
+ (org-odt--render-image/formula "InlineFormula" href nil nil ;; width height
+ nil nil title desc))
+ (t
+ (let* ((equation (org-odt--render-image/formula
+ "CaptionedDisplayFormula" href nil nil ;; width height
+ captions nil title desc))
+ (label
+ (let* ((org-odt-category-map-alist
+ '(("__MathFormula__" "Text" "math-label" "Equation"
+ org-odt--enumerable-formula-p))))
+ (car (org-odt-format-label element info 'definition)))))
+ (concat equation "<text:tab/>" label))))))
+
+(defun org-odt--copy-formula-file (src-file)
+ "Return the internal name of the file."
+ (let* ((target-dir (format "Formula-%04d/"
+ (cl-incf org-odt-embedded-formulas-count)))
+ (target-file (concat target-dir "content.xml")))
+ ;; Create a directory for holding formula file. Also enter it in
+ ;; to manifest.
+ (make-directory (concat org-odt-zip-dir target-dir))
+ (org-odt-create-manifest-file-entry
+ "application/vnd.oasis.opendocument.formula" target-dir "1.2")
+ ;; Copy over the formula file from user directory to zip
+ ;; directory.
+ (message "Embedding %s as %s..." src-file target-file)
+ (let ((ext (file-name-extension src-file)))
+ (cond
+ ;; Case 1: Mathml.
+ ((member ext '("mathml" "mml"))
+ (copy-file src-file (concat org-odt-zip-dir target-file) 'overwrite))
+ ;; Case 2: OpenDocument formula.
+ ((string= ext "odf")
+ (org-odt--zip-extract src-file "content.xml"
+ (concat org-odt-zip-dir target-dir)))
+ (t (error "%s is not a formula file" src-file))))
+ ;; Enter the formula file in to manifest.
+ (org-odt-create-manifest-file-entry "text/xml" target-file)
+ target-file))
+
+;;;; Targets
+
+(defun org-odt--render-image/formula (cfg-key href width height &optional
+ captions user-frame-params
+ &rest title-and-desc)
+ (let* ((frame-cfg-alist
+ ;; Each element of this alist is of the form (CFG-HANDLE
+ ;; INNER-FRAME-PARAMS OUTER-FRAME-PARAMS).
+
+ ;; CFG-HANDLE is the key to the alist.
+
+ ;; INNER-FRAME-PARAMS and OUTER-FRAME-PARAMS specify the
+ ;; frame params for INNER-FRAME and OUTER-FRAME
+ ;; respectively. See below.
+
+ ;; Configurations that are meant to be applied to
+ ;; non-captioned image/formula specifies no
+ ;; OUTER-FRAME-PARAMS.
+
+ ;; TERMINOLOGY
+ ;; ===========
+ ;; INNER-FRAME :: Frame that directly surrounds an
+ ;; image/formula.
+
+ ;; OUTER-FRAME :: Frame that encloses the INNER-FRAME. This
+ ;; frame also contains the caption, if any.
+
+ ;; FRAME-PARAMS :: List of the form (FRAME-STYLE-NAME
+ ;; FRAME-ATTRIBUTES FRAME-ANCHOR). Note
+ ;; that these are the last three arguments
+ ;; to `org-odt--frame'.
+
+ ;; Note that an un-captioned image/formula requires just an
+ ;; INNER-FRAME, while a captioned image/formula requires
+ ;; both an INNER and an OUTER-FRAME.
+ '(("As-CharImage" ("OrgInlineImage" nil "as-char"))
+ ("ParagraphImage" ("OrgDisplayImage" nil "paragraph"))
+ ("PageImage" ("OrgPageImage" nil "page"))
+ ("CaptionedAs-CharImage"
+ ("OrgCaptionedImage"
+ " style:rel-width=\"100%\" style:rel-height=\"scale\"" "paragraph")
+ ("OrgInlineImage" nil "as-char"))
+ ("CaptionedParagraphImage"
+ ("OrgCaptionedImage"
+ " style:rel-width=\"100%\" style:rel-height=\"scale\"" "paragraph")
+ ("OrgImageCaptionFrame" nil "paragraph"))
+ ("CaptionedPageImage"
+ ("OrgCaptionedImage"
+ " style:rel-width=\"100%\" style:rel-height=\"scale\"" "paragraph")
+ ("OrgPageImageCaptionFrame" nil "page"))
+ ("InlineFormula" ("OrgInlineFormula" nil "as-char"))
+ ("DisplayFormula" ("OrgDisplayFormula" nil "as-char"))
+ ("CaptionedDisplayFormula"
+ ("OrgCaptionedFormula" nil "paragraph")
+ ("OrgFormulaCaptionFrame" nil "paragraph"))))
+ (caption (car captions)) (short-caption (cdr captions))
+ ;; Retrieve inner and outer frame params, from configuration.
+ (frame-cfg (assoc-string cfg-key frame-cfg-alist t))
+ (inner (nth 1 frame-cfg))
+ (outer (nth 2 frame-cfg))
+ ;; User-specified frame params (from #+ATTR_ODT spec)
+ (user user-frame-params)
+ (--merge-frame-params (lambda (default user)
+ "Merge default and user frame params."
+ (if (not user) default
+ (cl-assert (= (length default) 3))
+ (cl-assert (= (length user) 3))
+ (cl-loop for u in user
+ for d in default
+ collect (or u d))))))
+ (cond
+ ;; Case 1: Image/Formula has no caption.
+ ;; There is only one frame, one that surrounds the image
+ ;; or formula.
+ ((not caption)
+ ;; Merge user frame params with that from configuration.
+ (setq inner (funcall --merge-frame-params inner user))
+ (apply 'org-odt--frame href width height
+ (append inner title-and-desc)))
+ ;; Case 2: Image/Formula is captioned or labeled.
+ ;; There are two frames: The inner one surrounds the
+ ;; image or formula. The outer one contains the
+ ;; caption/sequence number.
+ (t
+ ;; Merge user frame params with outer frame params.
+ (setq outer (funcall --merge-frame-params outer user))
+ ;; Short caption, if specified, goes as part of inner frame.
+ (setq inner (let ((frame-params (copy-sequence inner)))
+ (setcar (cdr frame-params)
+ (concat
+ (cadr frame-params)
+ (when short-caption
+ (format " draw:name=\"%s\" " short-caption))))
+ frame-params))
+ (apply 'org-odt--textbox
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ "Illustration"
+ (concat
+ (apply 'org-odt--frame href width height
+ (append inner title-and-desc))
+ caption))
+ width height outer)))))
+
+(defun org-odt--enumerable-p (element _info)
+ ;; Element should have a caption or label.
+ (or (org-element-property :caption element)
+ (org-element-property :name element)))
+
+(defun org-odt--enumerable-image-p (element info)
+ (org-odt--standalone-link-p
+ element info
+ ;; Paragraph should have a caption or label. It SHOULD NOT be a
+ ;; replacement element. (i.e., It SHOULD NOT be a result of LaTeX
+ ;; processing.)
+ (lambda (p)
+ (and (not (org-element-property :replaces p))
+ (or (org-element-property :caption p)
+ (org-element-property :name p))))
+ ;; Link should point to an image file.
+ (lambda (l)
+ (cl-assert (eq (org-element-type l) 'link))
+ (org-export-inline-image-p l (plist-get info :odt-inline-image-rules)))))
+
+(defun org-odt--enumerable-latex-image-p (element info)
+ (org-odt--standalone-link-p
+ element info
+ ;; Paragraph should have a caption or label. It SHOULD also be a
+ ;; replacement element. (i.e., It SHOULD be a result of LaTeX
+ ;; processing.)
+ (lambda (p)
+ (and (org-element-property :replaces p)
+ (or (org-element-property :caption p)
+ (org-element-property :name p))))
+ ;; Link should point to an image file.
+ (lambda (l)
+ (cl-assert (eq (org-element-type l) 'link))
+ (org-export-inline-image-p l (plist-get info :odt-inline-image-rules)))))
+
+(defun org-odt--enumerable-formula-p (element info)
+ (org-odt--standalone-link-p
+ element info
+ ;; Paragraph should have a caption or label.
+ (lambda (p)
+ (or (org-element-property :caption p)
+ (org-element-property :name p)))
+ ;; Link should point to a MathML or ODF file.
+ (lambda (l)
+ (cl-assert (eq (org-element-type l) 'link))
+ (org-export-inline-image-p l (plist-get info :odt-inline-formula-rules)))))
+
+(defun org-odt--standalone-link-p (element _info &optional
+ paragraph-predicate
+ link-predicate)
+ "Test if ELEMENT is a standalone link for the purpose ODT export.
+INFO is a plist holding contextual information.
+
+Return non-nil, if ELEMENT is of type paragraph satisfying
+PARAGRAPH-PREDICATE and its sole content, save for whitespaces,
+is a link that satisfies LINK-PREDICATE.
+
+Return non-nil, if ELEMENT is of type link satisfying
+LINK-PREDICATE and its containing paragraph satisfies
+PARAGRAPH-PREDICATE in addition to having no other content save for
+leading and trailing whitespaces.
+
+Return nil, otherwise."
+ (let ((p (cl-case (org-element-type element)
+ (paragraph element)
+ (link (and (or (not link-predicate)
+ (funcall link-predicate element))
+ (org-export-get-parent element)))
+ (t nil))))
+ (when (and p (eq (org-element-type p) 'paragraph))
+ (when (or (not paragraph-predicate)
+ (funcall paragraph-predicate p))
+ (let ((contents (org-element-contents p)))
+ (cl-loop for x in contents
+ with inline-image-count = 0
+ always (cl-case (org-element-type x)
+ (plain-text
+ (not (org-string-nw-p x)))
+ (link
+ (and (or (not link-predicate)
+ (funcall link-predicate x))
+ (= (cl-incf inline-image-count) 1)))
+ (t nil))))))))
+
+(defun org-odt-link--infer-description (destination info)
+ ;; DESTINATION is a headline or an element (like paragraph,
+ ;; verse-block etc) to which a "#+NAME: label" can be attached.
+
+ ;; Note that labels that are attached to captioned entities - inline
+ ;; images, math formulae and tables - get resolved as part of
+ ;; `org-odt-format-label' and `org-odt--enumerate'.
+
+ ;; Create a cross-reference to DESTINATION but make best-efforts to
+ ;; create a *meaningful* description. Check item numbers, section
+ ;; number and section title in that order.
+
+ ;; NOTE: Counterpart of `org-export-get-ordinal'.
+ ;; FIXME: Handle footnote-definition footnote-reference?
+ (let* ((genealogy (org-element-lineage destination))
+ (data (reverse genealogy))
+ (label (let ((type (org-element-type destination)))
+ (if (memq type '(headline target))
+ (org-export-get-reference destination info)
+ (error "FIXME: Unable to resolve %S" destination)))))
+ (or
+ (let* ( ;; Locate top-level list.
+ (top-level-list
+ (cl-loop for x on data
+ when (eq (org-element-type (car x)) 'plain-list)
+ return x))
+ ;; Get list item nos.
+ (item-numbers
+ (cl-loop for (plain-list item . rest) on top-level-list by #'cddr
+ until (not (eq (org-element-type plain-list) 'plain-list))
+ collect (when (eq (org-element-property :type
+ plain-list)
+ 'ordered)
+ (1+ (length (org-export-get-previous-element
+ item info t))))))
+ ;; Locate top-most listified headline.
+ (listified-headlines
+ (cl-loop for x on data
+ when (and (eq (org-element-type (car x)) 'headline)
+ (org-export-low-level-p (car x) info))
+ return x))
+ ;; Get listified headline numbers.
+ (listified-headline-nos
+ (cl-loop for el in listified-headlines
+ when (eq (org-element-type el) 'headline)
+ collect (when (org-export-numbered-headline-p el info)
+ (1+ (length (org-export-get-previous-element
+ el info t)))))))
+ ;; Combine item numbers from both the listified headlines and
+ ;; regular list items.
+
+ ;; Case 1: Check if all the parents of list item are numbered.
+ ;; If yes, link to the item proper.
+ (let ((item-numbers (append listified-headline-nos item-numbers)))
+ (when (and item-numbers (not (memq nil item-numbers)))
+ (format "<text:bookmark-ref text:reference-format=\"number-all-superior\" text:ref-name=\"%s\">%s</text:bookmark-ref>"
+ label
+ (mapconcat (lambda (n) (if (not n) " "
+ (concat (number-to-string n) ".")))
+ item-numbers "")))))
+ ;; Case 2: Locate a regular and numbered headline in the
+ ;; hierarchy. Display its section number.
+ (let ((headline
+ (and
+ ;; Test if destination is a numbered headline.
+ (org-export-numbered-headline-p destination info)
+ (cl-loop for el in (cons destination genealogy)
+ when (and (eq (org-element-type el) 'headline)
+ (not (org-export-low-level-p el info))
+ (org-export-numbered-headline-p el info))
+ return el))))
+ ;; We found one.
+ (when headline
+ (format "<text:bookmark-ref text:reference-format=\"chapter\" text:ref-name=\"OrgXref.%s\">%s</text:bookmark-ref>"
+ label
+ (mapconcat 'number-to-string (org-export-get-headline-number
+ headline info) "."))))
+ ;; Case 4: Locate a regular headline in the hierarchy. Display
+ ;; its title.
+ (let ((headline (cl-loop for el in (cons destination genealogy)
+ when (and (eq (org-element-type el) 'headline)
+ (not (org-export-low-level-p el info)))
+ return el)))
+ ;; We found one.
+ (when headline
+ (format "<text:bookmark-ref text:reference-format=\"text\" text:ref-name=\"OrgXref.%s\">%s</text:bookmark-ref>"
+ label
+ (let ((title (org-element-property :title headline)))
+ (org-export-data title info)))))
+ (error "FIXME?"))))
+
+(defun org-odt-link (link desc info)
+ "Transcode a LINK object from Org to ODT.
+
+DESC is the description part of the link, or the empty string.
+INFO is a plist holding contextual information. See
+`org-export-data'."
+ (let* ((type (org-element-property :type link))
+ (raw-path (org-element-property :path link))
+ ;; Ensure DESC really exists, or set it to nil.
+ (desc (and (not (string= desc "")) desc))
+ (imagep (org-export-inline-image-p
+ link (plist-get info :odt-inline-image-rules)))
+ (path (cond
+ ((member type '("http" "https" "ftp" "mailto"))
+ (concat type ":" raw-path))
+ ((string= type "file")
+ (org-export-file-uri raw-path))
+ (t raw-path)))
+ ;; Convert & to &amp; for correct XML representation
+ (path (replace-regexp-in-string "&" "&amp;" path)))
+ (cond
+ ;; Link type is handled by a special function.
+ ((org-export-custom-protocol-maybe link desc 'odt info))
+ ;; Image file.
+ ((and (not desc) imagep) (org-odt-link--inline-image link info))
+ ;; Formula file.
+ ((and (not desc)
+ (org-export-inline-image-p
+ link (plist-get info :odt-inline-formula-rules)))
+ (org-odt-link--inline-formula link info))
+ ;; Radio target: Transcode target's contents and use them as
+ ;; link's description.
+ ((string= type "radio")
+ (let ((destination (org-export-resolve-radio-link link info)))
+ (if (not destination) desc
+ (format
+ "<text:bookmark-ref text:reference-format=\"text\" text:ref-name=\"OrgXref.%s\">%s</text:bookmark-ref>"
+ (org-export-get-reference destination info)
+ desc))))
+ ;; Links pointing to a headline: Find destination and build
+ ;; appropriate referencing command.
+ ((member type '("custom-id" "fuzzy" "id"))
+ (let ((destination (if (string= type "fuzzy")
+ (org-export-resolve-fuzzy-link link info)
+ (org-export-resolve-id-link link info))))
+ (cl-case (org-element-type destination)
+ ;; Fuzzy link points to a headline. If there's
+ ;; a description, create a hyperlink. Otherwise, try to
+ ;; provide a meaningful description.
+ (headline
+ (if (not desc) (org-odt-link--infer-description destination info)
+ (let ((label
+ (or (and (string= type "custom-id")
+ (org-element-property :CUSTOM_ID destination))
+ (org-export-get-reference destination info))))
+ (format
+ "<text:a xlink:type=\"simple\" xlink:href=\"#%s\">%s</text:a>"
+ label desc))))
+ ;; Fuzzy link points to a target. If there's a description,
+ ;; create a hyperlink. Otherwise, try to provide
+ ;; a meaningful description.
+ (target
+ (format "<text:a xlink:type=\"simple\" xlink:href=\"#%s\">%s</text:a>"
+ (org-export-get-reference destination info)
+ (or desc (org-export-get-ordinal destination info))))
+ ;; Fuzzy link points to some element (e.g., an inline image,
+ ;; a math formula or a table).
+ (otherwise
+ (let ((label-reference
+ (ignore-errors
+ (org-odt-format-label destination info 'reference))))
+ (cond
+ ((not label-reference)
+ (org-odt-link--infer-description destination info))
+ ;; LINK has no description. Create
+ ;; a cross-reference showing entity's sequence
+ ;; number.
+ ((not desc) label-reference)
+ ;; LINK has description. Insert a hyperlink with
+ ;; user-provided description.
+ (t
+ (format
+ "<text:a xlink:type=\"simple\" xlink:href=\"#%s\">%s</text:a>"
+ (org-export-get-reference destination info)
+ desc))))))))
+ ;; Coderef: replace link with the reference name or the
+ ;; equivalent line number.
+ ((string= type "coderef")
+ (let* ((line-no (format "%d" (org-export-resolve-coderef path info)))
+ (href (concat "coderef-" path)))
+ (format
+ (org-export-get-coderef-format path desc)
+ (format
+ "<text:bookmark-ref text:reference-format=\"number\" text:ref-name=\"OrgXref.%s\">%s</text:bookmark-ref>"
+ href line-no))))
+ ;; External link with a description part.
+ ((and path desc)
+ (let ((link-contents (org-element-contents link)))
+ ;; Check if description is a link to an inline image.
+ (if (and (not (cdr link-contents))
+ (let ((desc-element (car link-contents)))
+ (and (eq (org-element-type desc-element) 'link)
+ (org-export-inline-image-p
+ desc-element
+ (plist-get info :odt-inline-image-rules)))))
+ ;; Format link as a clickable image.
+ (format "\n<draw:a xlink:type=\"simple\" xlink:href=\"%s\">\n%s\n</draw:a>"
+ path desc)
+ ;; Otherwise, format it as a regular link.
+ (format "<text:a xlink:type=\"simple\" xlink:href=\"%s\">%s</text:a>"
+ path desc))))
+ ;; External link without a description part.
+ (path
+ (format "<text:a xlink:type=\"simple\" xlink:href=\"%s\">%s</text:a>"
+ path path))
+ ;; No path, only description. Try to do something useful.
+ (t (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "Emphasis" desc)))))
+
+
+;;;; Node Property
+
+(defun org-odt-node-property (node-property _contents _info)
+ "Transcode a NODE-PROPERTY element from Org to ODT.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (org-odt--encode-plain-text
+ (format "%s:%s"
+ (org-element-property :key node-property)
+ (let ((value (org-element-property :value node-property)))
+ (if value (concat " " value) "")))))
+
+;;;; Paragraph
+
+(defun org-odt--paragraph-style (paragraph)
+ "Return style of PARAGRAPH.
+Style is a symbol among `quoted', `centered' and nil."
+ (let ((up paragraph))
+ (while (and (setq up (org-element-property :parent up))
+ (not (memq (org-element-type up)
+ '(center-block quote-block section)))))
+ (cl-case (org-element-type up)
+ (center-block 'centered)
+ (quote-block 'quoted))))
+
+(defun org-odt--format-paragraph (paragraph contents info default center quote)
+ "Format paragraph according to given styles.
+PARAGRAPH is a paragraph type element. CONTENTS is the
+transcoded contents of that paragraph, as a string. INFO is
+a plist used as a communication channel. DEFAULT, CENTER and
+QUOTE are, respectively, style to use when paragraph belongs to
+no special environment, a center block, or a quote block."
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ (cl-case (org-odt--paragraph-style paragraph)
+ (quoted quote)
+ (centered center)
+ (otherwise default))
+ ;; If PARAGRAPH is a leading paragraph in an item that has
+ ;; a checkbox, splice checkbox and paragraph contents
+ ;; together.
+ (concat (let ((parent (org-element-property :parent paragraph)))
+ (and (eq (org-element-type parent) 'item)
+ (not (org-export-get-previous-element paragraph info))
+ (org-odt--checkbox parent)))
+ contents)))
+
+(defun org-odt-paragraph (paragraph contents info)
+ "Transcode a PARAGRAPH element from Org to ODT.
+CONTENTS is the contents of the paragraph, as a string. INFO is
+the plist used as a communication channel."
+ (org-odt--format-paragraph
+ paragraph contents info
+ (or (org-element-property :style paragraph) "Text_20_body")
+ "OrgCenter"
+ "Quotations"))
+
+
+;;;; Plain List
+
+(defun org-odt-plain-list (plain-list contents _info)
+ "Transcode a PLAIN-LIST element from Org to ODT.
+CONTENTS is the contents of the list. INFO is a plist holding
+contextual information."
+ (format "\n<text:list text:style-name=\"%s\" %s>\n%s</text:list>"
+ ;; Choose style based on list type.
+ (cl-case (org-element-property :type plain-list)
+ (ordered "OrgNumberedList")
+ (unordered "OrgBulletedList")
+ (descriptive-1 "OrgDescriptionList")
+ (descriptive-2 "OrgDescriptionList"))
+ ;; If top-level list, re-start numbering. Otherwise,
+ ;; continue numbering.
+ (format "text:continue-numbering=\"%s\""
+ (let* ((parent (org-export-get-parent plain-list)))
+ (if (and parent (eq (org-element-type parent) 'item))
+ "true" "false")))
+ contents))
+
+;;;; Plain Text
+
+(defun org-odt--encode-tabs-and-spaces (line)
+ (replace-regexp-in-string
+ "\\(\t\\| \\{2,\\}\\)"
+ (lambda (s)
+ (if (string= s "\t") "<text:tab/>"
+ (format " <text:s text:c=\"%d\"/>" (1- (length s)))))
+ line))
+
+(defun org-odt--encode-plain-text (text &optional no-whitespace-filling)
+ (dolist (pair '(("&" . "&amp;") ("<" . "&lt;") (">" . "&gt;")))
+ (setq text (replace-regexp-in-string (car pair) (cdr pair) text t t)))
+ (if no-whitespace-filling text
+ (org-odt--encode-tabs-and-spaces text)))
+
+(defun org-odt-plain-text (text info)
+ "Transcode a TEXT string from Org to ODT.
+TEXT is the string to transcode. INFO is a plist holding
+contextual information."
+ (let ((output text))
+ ;; Protect &, < and >.
+ (setq output (org-odt--encode-plain-text output t))
+ ;; Handle smart quotes. Be sure to provide original string since
+ ;; OUTPUT may have been modified.
+ (when (plist-get info :with-smart-quotes)
+ (setq output (org-export-activate-smart-quotes output :utf-8 info text)))
+ ;; Convert special strings.
+ (when (plist-get info :with-special-strings)
+ (dolist (pair org-odt-special-string-regexps)
+ (setq output
+ (replace-regexp-in-string (car pair) (cdr pair) output t nil))))
+ ;; Handle break preservation if required.
+ (when (plist-get info :preserve-breaks)
+ (setq output (replace-regexp-in-string
+ "\\(\\\\\\\\\\)?[ \t]*\n" "<text:line-break/>" output t)))
+ ;; Return value.
+ output))
+
+
+;;;; Planning
+
+(defun org-odt-planning (planning contents info)
+ "Transcode a PLANNING element from Org to ODT.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ "OrgPlanning"
+ (concat
+ (let ((closed (org-element-property :closed planning)))
+ (when closed
+ (concat
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgClosedKeyword" org-closed-string)
+ (org-odt-timestamp closed contents info))))
+ (let ((deadline (org-element-property :deadline planning)))
+ (when deadline
+ (concat
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgDeadlineKeyword" org-deadline-string)
+ (org-odt-timestamp deadline contents info))))
+ (let ((scheduled (org-element-property :scheduled planning)))
+ (when scheduled
+ (concat
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgScheduledKeyword" org-scheduled-string)
+ (org-odt-timestamp scheduled contents info)))))))
+
+
+;;;; Property Drawer
+
+(defun org-odt-property-drawer (_property-drawer contents _info)
+ "Transcode a PROPERTY-DRAWER element from Org to ODT.
+CONTENTS holds the contents of the drawer. INFO is a plist
+holding contextual information."
+ (and (org-string-nw-p contents)
+ (format "<text:p text:style-name=\"OrgFixedWidthBlock\">%s</text:p>"
+ contents)))
+
+
+;;;; Quote Block
+
+(defun org-odt-quote-block (_quote-block contents _info)
+ "Transcode a QUOTE-BLOCK element from Org to ODT.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ contents)
+
+
+;;;; Section
+
+(defun org-odt-format-section (text style &optional name)
+ (let ((default-name (car (org-odt-add-automatic-style "Section"))))
+ (format "\n<text:section text:style-name=\"%s\" %s>\n%s\n</text:section>"
+ style
+ (format "text:name=\"%s\"" (or name default-name))
+ text)))
+
+
+(defun org-odt-section (_section contents _info) ; FIXME
+ "Transcode a SECTION element from Org to ODT.
+CONTENTS holds the contents of the section. INFO is a plist
+holding contextual information."
+ contents)
+
+;;;; Radio Target
+
+(defun org-odt-radio-target (radio-target text info)
+ "Transcode a RADIO-TARGET object from Org to ODT.
+TEXT is the text of the target. INFO is a plist holding
+contextual information."
+ (org-odt--target text (org-export-get-reference radio-target info)))
+
+
+;;;; Special Block
+
+(defun org-odt-special-block (special-block contents info)
+ "Transcode a SPECIAL-BLOCK element from Org to ODT.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (let ((type (org-element-property :type special-block))
+ (attributes (org-export-read-attribute :attr_odt special-block)))
+ (cond
+ ;; Annotation.
+ ((string= type "annotation")
+ (let* ((author (or (plist-get attributes :author)
+ (let ((author (plist-get info :author)))
+ (and author (org-export-data author info)))))
+ (date (or (plist-get attributes :date)
+ ;; FIXME: Is `car' right thing to do below?
+ (car (plist-get info :date)))))
+ (format "\n<text:p>%s</text:p>"
+ (format "<office:annotation>\n%s\n</office:annotation>"
+ (concat
+ (and author
+ (format "<dc:creator>%s</dc:creator>" author))
+ (and date
+ (format "<dc:date>%s</dc:date>"
+ (org-odt--format-timestamp date nil 'iso-date)))
+ contents)))))
+ ;; Textbox.
+ ((string= type "textbox")
+ (let ((width (plist-get attributes :width))
+ (height (plist-get attributes :height))
+ (style (plist-get attributes :style))
+ (extra (plist-get attributes :extra))
+ (anchor (plist-get attributes :anchor)))
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ "Text_20_body" (org-odt--textbox contents width height
+ style extra anchor))))
+ (t contents))))
+
+
+;;;; Src Block
+
+(defun org-odt-hfy-face-to-css (fn)
+ "Create custom style for face FN.
+When FN is the default face, use its foreground and background
+properties to create \"OrgSrcBlock\" paragraph style. Otherwise
+use its color attribute to create a character style whose name
+is obtained from FN. Currently all attributes of FN other than
+color are ignored.
+
+The style name for a face FN is derived using the following
+operations on the face name in that order - de-dash, CamelCase
+and prefix with \"OrgSrc\". For example,
+`font-lock-function-name-face' is associated with
+\"OrgSrcFontLockFunctionNameFace\"."
+ (let* ((css-list (hfy-face-to-style fn))
+ (style-name (concat "OrgSrc"
+ (mapconcat
+ 'capitalize (split-string
+ (hfy-face-or-def-to-name fn) "-")
+ "")))
+ (color-val (cdr (assoc "color" css-list)))
+ (background-color-val (cdr (assoc "background" css-list)))
+ (style (and org-odt-create-custom-styles-for-srcblocks
+ (cond
+ ((eq fn 'default)
+ (format org-odt-src-block-paragraph-format
+ background-color-val color-val))
+ (t
+ (format
+ "
+<style:style style:name=\"%s\" style:family=\"text\">
+ <style:text-properties fo:color=\"%s\"/>
+ </style:style>" style-name color-val))))))
+ (cons style-name style)))
+
+(defun org-odt-htmlfontify-string (line)
+ (let* ((hfy-html-quote-regex "\\([<\"&> \t]\\)")
+ (hfy-html-quote-map '(("\"" "&quot;")
+ ("<" "&lt;")
+ ("&" "&amp;")
+ (">" "&gt;")
+ (" " "<text:s/>")
+ ("\t" "<text:tab/>")))
+ (hfy-face-to-css 'org-odt-hfy-face-to-css)
+ (hfy-optimizations-1 (copy-sequence hfy-optimizations))
+ (hfy-optimizations (cl-pushnew 'body-text-only hfy-optimizations-1))
+ (hfy-begin-span-handler
+ (lambda (style _text-block _text-id _text-begins-block-p)
+ (insert (format "<text:span text:style-name=\"%s\">" style))))
+ (hfy-end-span-handler (lambda () (insert "</text:span>"))))
+ (with-no-warnings (htmlfontify-string line))))
+
+(defun org-odt-do-format-code
+ (code info &optional lang refs retain-labels num-start)
+ (let* ((lang (or (assoc-default lang org-src-lang-modes) lang))
+ (lang-mode (and lang (intern (format "%s-mode" lang))))
+ (code-lines (org-split-string code "\n"))
+ (code-length (length code-lines))
+ (use-htmlfontify-p (and (functionp lang-mode)
+ (plist-get info :odt-fontify-srcblocks)
+ (require 'htmlfontify nil t)
+ (fboundp 'htmlfontify-string)))
+ (code (if (not use-htmlfontify-p) code
+ (with-temp-buffer
+ (insert code)
+ (funcall lang-mode)
+ (org-font-lock-ensure)
+ (buffer-string))))
+ (fontifier (if use-htmlfontify-p 'org-odt-htmlfontify-string
+ 'org-odt--encode-plain-text))
+ (par-style (if use-htmlfontify-p "OrgSrcBlock"
+ "OrgFixedWidthBlock"))
+ (i 0))
+ (cl-assert (= code-length (length (org-split-string code "\n"))))
+ (setq code
+ (org-export-format-code
+ code
+ (lambda (loc line-num ref)
+ (setq par-style
+ (concat par-style (and (= (cl-incf i) code-length)
+ "LastLine")))
+
+ (setq loc (concat loc (and ref retain-labels (format " (%s)" ref))))
+ (setq loc (funcall fontifier loc))
+ (when ref
+ (setq loc (org-odt--target loc (concat "coderef-" ref))))
+ (cl-assert par-style)
+ (setq loc (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ par-style loc))
+ (if (not line-num) loc
+ (format "\n<text:list-item>%s\n</text:list-item>" loc)))
+ num-start refs))
+ (cond
+ ((not num-start) code)
+ ((= num-start 0)
+ (format
+ "\n<text:list text:style-name=\"OrgSrcBlockNumberedLine\"%s>%s</text:list>"
+ " text:continue-numbering=\"false\"" code))
+ (t
+ (format
+ "\n<text:list text:style-name=\"OrgSrcBlockNumberedLine\"%s>%s</text:list>"
+ " text:continue-numbering=\"true\"" code)))))
+
+(defun org-odt-format-code (element info)
+ (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 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)))
+ (org-odt-do-format-code code info lang refs retain-labels num-start)))
+
+(defun org-odt-src-block (src-block _contents info)
+ "Transcode a SRC-BLOCK element from Org to ODT.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (let* ((attributes (org-export-read-attribute :attr_odt src-block))
+ (caption (car (org-odt-format-label src-block info 'definition))))
+ (concat
+ (and caption
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ "Listing" caption))
+ (let ((--src-block (org-odt-format-code src-block info)))
+ (if (not (plist-get attributes :textbox)) --src-block
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ "Text_20_body"
+ (org-odt--textbox --src-block nil nil nil)))))))
+
+
+;;;; Statistics Cookie
+
+(defun org-odt-statistics-cookie (statistics-cookie _contents _info)
+ "Transcode a STATISTICS-COOKIE object from Org to ODT.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (let ((cookie-value (org-element-property :value statistics-cookie)))
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgCode" cookie-value)))
+
+
+;;;; Strike-Through
+
+(defun org-odt-strike-through (_strike-through contents _info)
+ "Transcode STRIKE-THROUGH from Org to ODT.
+CONTENTS is the text with strike-through markup. INFO is a plist
+holding contextual information."
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "Strikethrough" contents))
+
+
+;;;; Subscript
+
+(defun org-odt-subscript (_subscript contents _info)
+ "Transcode a SUBSCRIPT object from Org to ODT.
+CONTENTS is the contents of the object. INFO is a plist holding
+contextual information."
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgSubscript" contents))
+
+
+;;;; Superscript
+
+(defun org-odt-superscript (_superscript contents _info)
+ "Transcode a SUPERSCRIPT object from Org to ODT.
+CONTENTS is the contents of the object. INFO is a plist holding
+contextual information."
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgSuperscript" contents))
+
+
+;;;; Table Cell
+
+(defun org-odt-table-style-spec (element info)
+ (let* ((table (org-export-get-parent-table element))
+ (table-attributes (org-export-read-attribute :attr_odt table))
+ (table-style (plist-get table-attributes :style)))
+ (assoc table-style (plist-get info :odt-table-styles))))
+
+(defun org-odt-get-table-cell-styles (table-cell info)
+ "Retrieve styles applicable to a table cell.
+R and C are (zero-based) row and column numbers of the table
+cell. STYLE-SPEC is an entry in `org-odt-table-styles'
+applicable to the current table. It is nil if the table is not
+associated with any style attributes.
+
+Return a cons of (TABLE-CELL-STYLE-NAME . PARAGRAPH-STYLE-NAME).
+
+When STYLE-SPEC is nil, style the table cell the conventional way
+- choose cell borders based on row and column groupings and
+choose paragraph alignment based on `org-col-cookies' text
+property. See also
+`org-odt-get-paragraph-style-cookie-for-table-cell'.
+
+When STYLE-SPEC is non-nil, ignore the above cookie and return
+styles congruent with the ODF-1.2 specification."
+ (let* ((table-cell-address (org-export-table-cell-address table-cell info))
+ (r (car table-cell-address)) (c (cdr table-cell-address))
+ (style-spec (org-odt-table-style-spec table-cell info))
+ (table-dimensions (org-export-table-dimensions
+ (org-export-get-parent-table table-cell)
+ info)))
+ (when style-spec
+ ;; LibreOffice - particularly the Writer - honors neither table
+ ;; templates nor custom table-cell styles. Inorder to retain
+ ;; interoperability with LibreOffice, only automatic styles are
+ ;; used for styling of table-cells. The current implementation is
+ ;; congruent with ODF-1.2 specification and hence is
+ ;; future-compatible.
+
+ ;; Additional Note: LibreOffice's AutoFormat facility for tables -
+ ;; which recognizes as many as 16 different cell types - is much
+ ;; richer. Unfortunately it is NOT amenable to easy configuration
+ ;; by hand.
+ (let* ((template-name (nth 1 style-spec))
+ (cell-style-selectors (nth 2 style-spec))
+ (cell-type
+ (cond
+ ((and (cdr (assq 'use-first-column-styles cell-style-selectors))
+ (= c 0)) "FirstColumn")
+ ((and (cdr (assq 'use-last-column-styles cell-style-selectors))
+ (= (1+ c) (cdr table-dimensions)))
+ "LastColumn")
+ ((and (cdr (assq 'use-first-row-styles cell-style-selectors))
+ (= r 0)) "FirstRow")
+ ((and (cdr (assq 'use-last-row-styles cell-style-selectors))
+ (= (1+ r) (car table-dimensions)))
+ "LastRow")
+ ((and (cdr (assq 'use-banding-rows-styles cell-style-selectors))
+ (= (% r 2) 1)) "EvenRow")
+ ((and (cdr (assq 'use-banding-rows-styles cell-style-selectors))
+ (= (% r 2) 0)) "OddRow")
+ ((and (cdr (assq 'use-banding-columns-styles cell-style-selectors))
+ (= (% c 2) 1)) "EvenColumn")
+ ((and (cdr (assq 'use-banding-columns-styles cell-style-selectors))
+ (= (% c 2) 0)) "OddColumn")
+ (t ""))))
+ (concat template-name cell-type)))))
+
+(defun org-odt-table-cell (table-cell contents info)
+ "Transcode a TABLE-CELL element from Org to ODT.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (let* ((table-cell-address (org-export-table-cell-address table-cell info))
+ (r (car table-cell-address))
+ (c (cdr table-cell-address))
+ (horiz-span (or (org-export-table-cell-width table-cell info) 0))
+ (table-row (org-export-get-parent table-cell))
+ (custom-style-prefix (org-odt-get-table-cell-styles
+ table-cell info))
+ (paragraph-style
+ (or
+ (and custom-style-prefix
+ (format "%sTableParagraph" custom-style-prefix))
+ (concat
+ (cond
+ ((and (= 1 (org-export-table-row-group table-row info))
+ (org-export-table-has-header-p
+ (org-export-get-parent-table table-row) info))
+ "OrgTableHeading")
+ ((let* ((table (org-export-get-parent-table table-cell))
+ (table-attrs (org-export-read-attribute :attr_odt table))
+ (table-header-columns
+ (let ((cols (plist-get table-attrs :header-columns)))
+ (and cols (read cols)))))
+ (<= c (cond ((wholenump table-header-columns)
+ (- table-header-columns 1))
+ (table-header-columns 0)
+ (t -1))))
+ "OrgTableHeading")
+ (t "OrgTableContents"))
+ (capitalize (symbol-name (org-export-table-cell-alignment
+ table-cell info))))))
+ (cell-style-name
+ (or
+ (and custom-style-prefix (format "%sTableCell"
+ custom-style-prefix))
+ (concat
+ "OrgTblCell"
+ (when (or (org-export-table-row-starts-rowgroup-p table-row info)
+ (zerop r)) "T")
+ (when (org-export-table-row-ends-rowgroup-p table-row info) "B")
+ (when (and (org-export-table-cell-starts-colgroup-p table-cell info)
+ (not (zerop c)) ) "L"))))
+ (cell-attributes
+ (concat
+ (format " table:style-name=\"%s\"" cell-style-name)
+ (and (> horiz-span 0)
+ (format " table:number-columns-spanned=\"%d\""
+ (1+ horiz-span))))))
+ (unless contents (setq contents ""))
+ (concat
+ (cl-assert paragraph-style)
+ (format "\n<table:table-cell%s>\n%s\n</table:table-cell>"
+ cell-attributes
+ (let ((table-cell-contents (org-element-contents table-cell)))
+ (if (eq (org-element-class (car table-cell-contents)) 'element)
+ contents
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ paragraph-style contents))))
+ (let (s)
+ (dotimes (_ horiz-span s)
+ (setq s (concat s "\n<table:covered-table-cell/>"))))
+ "\n")))
+
+
+;;;; Table Row
+
+(defun org-odt-table-row (table-row contents info)
+ "Transcode a TABLE-ROW element from Org to ODT.
+CONTENTS is the contents of the row. INFO is a plist used as a
+communication channel."
+ ;; Rules are ignored since table separators are deduced from
+ ;; borders of the current row.
+ (when (eq (org-element-property :type table-row) 'standard)
+ (let* ((rowgroup-tags
+ (if (and (= 1 (org-export-table-row-group table-row info))
+ (org-export-table-has-header-p
+ (org-export-get-parent-table table-row) info))
+ ;; If the row belongs to the first rowgroup and the
+ ;; table has more than one row groups, then this row
+ ;; belongs to the header row group.
+ '("\n<table:table-header-rows>" . "\n</table:table-header-rows>")
+ ;; Otherwise, it belongs to non-header row group.
+ '("\n<table:table-rows>" . "\n</table:table-rows>"))))
+ (concat
+ ;; Does this row begin a rowgroup?
+ (when (org-export-table-row-starts-rowgroup-p table-row info)
+ (car rowgroup-tags))
+ ;; Actual table row
+ (format "\n<table:table-row>\n%s\n</table:table-row>" contents)
+ ;; Does this row end a rowgroup?
+ (when (org-export-table-row-ends-rowgroup-p table-row info)
+ (cdr rowgroup-tags))))))
+
+
+;;;; Table
+
+(defun org-odt-table-first-row-data-cells (table info)
+ (let ((table-row
+ (org-element-map table 'table-row
+ (lambda (row)
+ (unless (eq (org-element-property :type row) 'rule) row))
+ info 'first-match))
+ (special-column-p (org-export-table-has-special-column-p table)))
+ (if (not special-column-p) (org-element-contents table-row)
+ (cdr (org-element-contents table-row)))))
+
+(defun org-odt--table (table contents info)
+ "Transcode a TABLE element from Org to ODT.
+CONTENTS is the contents of the table. INFO is a plist holding
+contextual information."
+ (cl-case (org-element-property :type table)
+ ;; Case 1: table.el doesn't support export to OD format. Strip
+ ;; such tables from export.
+ (table.el
+ (prog1 nil
+ (message
+ (concat
+ "(ox-odt): Found table.el-type table in the source Org file."
+ " table.el doesn't support export to ODT format."
+ " Stripping the table from export."))))
+ ;; Case 2: Native Org tables.
+ (otherwise
+ (let* ((captions (org-odt-format-label table info 'definition))
+ (caption (car captions)) (short-caption (cdr captions))
+ (attributes (org-export-read-attribute :attr_odt table))
+ (custom-table-style (nth 1 (org-odt-table-style-spec table info)))
+ (table-column-specs
+ (lambda (table info)
+ (let* ((table-style (or custom-table-style "OrgTable"))
+ (column-style (format "%sColumn" table-style)))
+ (mapconcat
+ (lambda (table-cell)
+ (let ((width (1+ (or (org-export-table-cell-width
+ table-cell info) 0)))
+ (s (format
+ "\n<table:table-column table:style-name=\"%s\"/>"
+ column-style))
+ out)
+ (dotimes (_ width out) (setq out (concat s out)))))
+ (org-odt-table-first-row-data-cells table info) "\n")))))
+ (concat
+ ;; caption.
+ (when caption
+ (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
+ "Table" caption))
+ ;; begin table.
+ (let* ((automatic-name
+ (org-odt-add-automatic-style "Table" attributes)))
+ (format
+ "\n<table:table table:style-name=\"%s\"%s>"
+ (or custom-table-style (cdr automatic-name) "OrgTable")
+ (concat (when short-caption
+ (format " table:name=\"%s\"" short-caption)))))
+ ;; column specification.
+ (funcall table-column-specs table info)
+ ;; actual contents.
+ "\n" contents
+ ;; end table.
+ "</table:table>")))))
+
+(defun org-odt-table (table contents info)
+ "Transcode a TABLE element from Org to ODT.
+CONTENTS is the contents of the table. INFO is a plist holding
+contextual information.
+
+Use `org-odt--table' to typeset the table. Handle details
+pertaining to indentation here."
+ (let* ((--element-preceded-by-table-p
+ (lambda (element info)
+ (cl-loop for el in (org-export-get-previous-element element info t)
+ thereis (eq (org-element-type el) 'table))))
+ (--walk-list-genealogy-and-collect-tags
+ (lambda (table info)
+ (let* ((genealogy (org-element-lineage table))
+ (list-genealogy
+ (when (eq (org-element-type (car genealogy)) 'item)
+ (cl-loop for el in genealogy
+ when (memq (org-element-type el)
+ '(item plain-list))
+ collect el)))
+ (llh-genealogy
+ (apply #'nconc
+ (cl-loop
+ for el in genealogy
+ when (and (eq (org-element-type el) 'headline)
+ (org-export-low-level-p el info))
+ collect
+ (list el
+ (assq 'headline
+ (org-element-contents
+ (org-export-get-parent el)))))))
+ parent-list)
+ (nconc
+ ;; Handle list genealogy.
+ (cl-loop
+ for el in list-genealogy collect
+ (cl-case (org-element-type el)
+ (plain-list
+ (setq parent-list el)
+ (cons "</text:list>"
+ (format "\n<text:list text:style-name=\"%s\" %s>"
+ (cl-case (org-element-property :type el)
+ (ordered "OrgNumberedList")
+ (unordered "OrgBulletedList")
+ (descriptive-1 "OrgDescriptionList")
+ (descriptive-2 "OrgDescriptionList"))
+ "text:continue-numbering=\"true\"")))
+ (item
+ (cond
+ ((not parent-list)
+ (if (funcall --element-preceded-by-table-p table info)
+ '("</text:list-header>" . "<text:list-header>")
+ '("</text:list-item>" . "<text:list-header>")))
+ ((funcall --element-preceded-by-table-p
+ parent-list info)
+ '("</text:list-header>" . "<text:list-header>"))
+ (t '("</text:list-item>" . "<text:list-item>"))))))
+ ;; Handle low-level headlines.
+ (cl-loop for el in llh-genealogy
+ with step = 'item collect
+ (cl-case step
+ (plain-list
+ (setq step 'item) ; Flip-flop
+ (setq parent-list el)
+ (cons "</text:list>"
+ (format "\n<text:list text:style-name=\"%s\" %s>"
+ (if (org-export-numbered-headline-p
+ el info)
+ "OrgNumberedList"
+ "OrgBulletedList")
+ "text:continue-numbering=\"true\"")))
+ (item
+ (setq step 'plain-list) ; Flip-flop
+ (cond
+ ((not parent-list)
+ (if (funcall --element-preceded-by-table-p table info)
+ '("</text:list-header>" . "<text:list-header>")
+ '("</text:list-item>" . "<text:list-header>")))
+ ((let ((section? (org-export-get-previous-element
+ parent-list info)))
+ (and section?
+ (eq (org-element-type section?) 'section)
+ (assq 'table (org-element-contents section?))))
+ '("</text:list-header>" . "<text:list-header>"))
+ (t
+ '("</text:list-item>" . "<text:list-item>"))))))))))
+ (close-open-tags (funcall --walk-list-genealogy-and-collect-tags
+ table info)))
+ ;; OpenDocument schema does not permit table to occur within a
+ ;; list item.
+
+ ;; One solution - the easiest and lightweight, in terms of
+ ;; implementation - is to put the table in an indented text box
+ ;; and make the text box part of the list-item. Unfortunately if
+ ;; the table is big and spans multiple pages, the text box could
+ ;; overflow. In this case, the following attribute will come
+ ;; handy.
+
+ ;; ,---- From OpenDocument-v1.1.pdf
+ ;; | 15.27.28 Overflow behavior
+ ;; |
+ ;; | For text boxes contained within text document, the
+ ;; | style:overflow-behavior property specifies the behavior of text
+ ;; | boxes where the containing text does not fit into the text
+ ;; | box.
+ ;; |
+ ;; | If the attribute's value is clip, the text that does not fit
+ ;; | into the text box is not displayed.
+ ;; |
+ ;; | If the attribute value is auto-create-new-frame, a new frame
+ ;; | will be created on the next page, with the same position and
+ ;; | dimensions of the original frame.
+ ;; |
+ ;; | If the style:overflow-behavior property's value is
+ ;; | auto-create-new-frame and the text box has a minimum width or
+ ;; | height specified, then the text box will grow until the page
+ ;; | bounds are reached before a new frame is created.
+ ;; `----
+
+ ;; Unfortunately, LibreOffice-3.4.6 doesn't honor
+ ;; auto-create-new-frame property and always resorts to clipping
+ ;; the text box. This results in table being truncated.
+
+ ;; So we solve the problem the hard (and fun) way using list
+ ;; continuations.
+
+ ;; The problem only becomes more interesting if you take in to
+ ;; account the following facts:
+ ;;
+ ;; - Description lists are simulated as plain lists.
+ ;; - Low-level headlines can be listified.
+ ;; - In Org mode, a table can occur not only as a regular list
+ ;; item, but also within description lists and low-level
+ ;; headlines.
+
+ ;; See `org-odt-translate-description-lists' and
+ ;; `org-odt-translate-low-level-headlines' for how this is
+ ;; tackled.
+
+ (concat "\n"
+ ;; Discontinue the list.
+ (mapconcat 'car close-open-tags "\n")
+ ;; Put the table in an indented section.
+ (let* ((table (org-odt--table table contents info))
+ (level (/ (length (mapcar 'car close-open-tags)) 2))
+ (style (format "OrgIndentedSection-Level-%d" level)))
+ (when table (org-odt-format-section table style)))
+ ;; Continue the list.
+ (mapconcat 'cdr (nreverse close-open-tags) "\n"))))
+
+
+;;;; Target
+
+(defun org-odt-target (target _contents info)
+ "Transcode a TARGET object from Org to ODT.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (org-odt--target "" (org-export-get-reference target info)))
+
+
+;;;; Timestamp
+
+(defun org-odt-timestamp (timestamp _contents info)
+ "Transcode a TIMESTAMP object from Org to ODT.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (let ((type (org-element-property :type timestamp)))
+ (if (not (plist-get info :odt-use-date-fields))
+ (let ((value (org-odt-plain-text
+ (org-timestamp-translate timestamp) info)))
+ (cl-case (org-element-property :type timestamp)
+ ((active active-range)
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgActiveTimestamp" value))
+ ((inactive inactive-range)
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgInactiveTimestamp" value))
+ (otherwise value)))
+ (cl-case type
+ (active
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgActiveTimestamp"
+ (format "&lt;%s&gt;" (org-odt--format-timestamp timestamp))))
+ (inactive
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgInactiveTimestamp"
+ (format "[%s]" (org-odt--format-timestamp timestamp))))
+ (active-range
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgActiveTimestamp"
+ (format "&lt;%s&gt;&#x2013;&lt;%s&gt;"
+ (org-odt--format-timestamp timestamp)
+ (org-odt--format-timestamp timestamp 'end))))
+ (inactive-range
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgInactiveTimestamp"
+ (format "[%s]&#x2013;[%s]"
+ (org-odt--format-timestamp timestamp)
+ (org-odt--format-timestamp timestamp 'end))))
+ (otherwise
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgDiaryTimestamp"
+ (org-odt-plain-text (org-timestamp-translate timestamp)
+ info)))))))
+
+
+;;;; Underline
+
+(defun org-odt-underline (_underline contents _info)
+ "Transcode UNDERLINE from Org to ODT.
+CONTENTS is the text with underline markup. INFO is a plist
+holding contextual information."
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "Underline" contents))
+
+
+;;;; Verbatim
+
+(defun org-odt-verbatim (verbatim _contents _info)
+ "Transcode a VERBATIM object from Org to ODT.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (format "<text:span text:style-name=\"%s\">%s</text:span>"
+ "OrgCode" (org-odt--encode-plain-text
+ (org-element-property :value verbatim))))
+
+
+;;;; Verse Block
+
+(defun org-odt-verse-block (_verse-block contents _info)
+ "Transcode a VERSE-BLOCK element from Org to ODT.
+CONTENTS is verse block contents. INFO is a plist holding
+contextual information."
+ (format "\n<text:p text:style-name=\"OrgVerse\">%s</text:p>"
+ (replace-regexp-in-string
+ ;; Replace leading tabs and spaces.
+ "^[ \t]+" #'org-odt--encode-tabs-and-spaces
+ ;; Add line breaks to each line of verse.
+ (replace-regexp-in-string
+ "\\(<text:line-break/>\\)?[ \t]*$" "<text:line-break/>" contents))))
+
+
+
+;;; Filters
+
+;;; Images
+
+(defun org-odt--translate-image-links (data _backend info)
+ (org-export-insert-image-links data info org-odt-inline-image-rules))
+
+;;;; LaTeX fragments
+
+(defun org-odt--translate-latex-fragments (tree _backend info)
+ (let ((processing-type (plist-get info :with-latex))
+ (count 0))
+ ;; Normalize processing-type to one of dvipng, mathml or verbatim.
+ ;; If the desired converter is not available, force verbatim
+ ;; processing.
+ (cl-case processing-type
+ ((t mathml)
+ (if (and (fboundp 'org-format-latex-mathml-available-p)
+ (org-format-latex-mathml-available-p))
+ (setq processing-type 'mathml)
+ (message "LaTeX to MathML converter not available.")
+ (setq processing-type 'verbatim)))
+ ((dvipng imagemagick)
+ (unless (and (org-check-external-command "latex" "" t)
+ (org-check-external-command
+ (if (eq processing-type 'dvipng) "dvipng" "convert") "" t))
+ (message "LaTeX to PNG converter not available.")
+ (setq processing-type 'verbatim)))
+ (otherwise
+ (message "Unknown LaTeX option. Forcing verbatim.")
+ (setq processing-type 'verbatim)))
+
+ ;; Store normalized value for later use.
+ (when (plist-get info :with-latex)
+ (plist-put info :with-latex processing-type))
+ (message "Formatting LaTeX using %s" processing-type)
+
+ ;; Convert `latex-fragment's and `latex-environment's.
+ (when (memq processing-type '(mathml dvipng imagemagick))
+ (org-element-map tree '(latex-fragment latex-environment)
+ (lambda (latex-*)
+ (cl-incf count)
+ (let* ((latex-frag (org-element-property :value latex-*))
+ (input-file (plist-get info :input-file))
+ (cache-dir (file-name-directory input-file))
+ (cache-subdir (concat
+ (cl-case processing-type
+ ((dvipng imagemagick)
+ org-preview-latex-image-directory)
+ (mathml "ltxmathml/"))
+ (file-name-sans-extension
+ (file-name-nondirectory input-file))))
+ (display-msg
+ (cl-case processing-type
+ ((dvipng imagemagick)
+ (format "Creating LaTeX Image %d..." count))
+ (mathml (format "Creating MathML snippet %d..." count))))
+ ;; Get an Org-style link to PNG image or the MathML
+ ;; file.
+ (link
+ (with-temp-buffer
+ (insert latex-frag)
+ ;; When converting to a PNG image, make sure to
+ ;; copy all LaTeX header specifications from the
+ ;; Org source.
+ (unless (eq processing-type 'mathml)
+ (let ((h (plist-get info :latex-header)))
+ (when h
+ (insert "\n"
+ (replace-regexp-in-string
+ "^" "#+LATEX_HEADER: " h)))))
+ (org-format-latex cache-subdir nil nil cache-dir
+ nil display-msg nil
+ processing-type)
+ (goto-char (point-min))
+ (skip-chars-forward " \t\n")
+ (org-element-link-parser))))
+ (if (not (eq 'link (org-element-type link)))
+ (message "LaTeX Conversion failed.")
+ ;; Conversion succeeded. Parse above Org-style link to
+ ;; a `link' object.
+ (let ((replacement
+ (cl-case (org-element-type latex-*)
+ ;;LaTeX environment. Mimic a "standalone image
+ ;; or formula" by enclosing the `link' in
+ ;; a `paragraph'. Copy over original
+ ;; attributes, captions to the enclosing
+ ;; paragraph.
+ (latex-environment
+ (org-element-adopt-elements
+ (list 'paragraph
+ (list :style "OrgFormula"
+ :name
+ (org-element-property :name latex-*)
+ :caption
+ (org-element-property :caption latex-*)))
+ link))
+ ;; LaTeX fragment. No special action.
+ (latex-fragment link))))
+ ;; Note down the object that link replaces.
+ (org-element-put-property replacement :replaces
+ (list (org-element-type latex-*)
+ (list :value latex-frag)))
+ ;; Restore blank after initial element or object.
+ (org-element-put-property
+ replacement :post-blank
+ (org-element-property :post-blank latex-*))
+ ;; Replace now.
+ (org-element-set-element latex-* replacement)))))
+ info nil nil t)))
+ tree)
+
+
+;;;; Description lists
+
+;; This translator is necessary to handle indented tables in a uniform
+;; manner. See comment in `org-odt--table'.
+
+(defun org-odt--translate-description-lists (tree _backend info)
+ ;; OpenDocument has no notion of a description list. So simulate it
+ ;; using plain lists. Description lists in the exported document
+ ;; are typeset in the same manner as they are in a typical HTML
+ ;; document.
+ ;;
+ ;; Specifically, a description list like this:
+ ;;
+ ;; ,----
+ ;; | - term-1 :: definition-1
+ ;; | - term-2 :: definition-2
+ ;; `----
+ ;;
+ ;; gets translated in to the following form:
+ ;;
+ ;; ,----
+ ;; | - term-1
+ ;; | - definition-1
+ ;; | - term-2
+ ;; | - definition-2
+ ;; `----
+ ;;
+ ;; Further effect is achieved by fixing the OD styles as below:
+ ;;
+ ;; 1. Set the :type property of the simulated lists to
+ ;; `descriptive-1' and `descriptive-2'. Map these to list-styles
+ ;; that has *no* bullets whatsoever.
+ ;;
+ ;; 2. The paragraph containing the definition term is styled to be
+ ;; in bold.
+ ;;
+ (org-element-map tree 'plain-list
+ (lambda (el)
+ (when (eq (org-element-property :type el) 'descriptive)
+ (org-element-set-element
+ el
+ (apply 'org-element-adopt-elements
+ (list 'plain-list (list :type 'descriptive-1))
+ (mapcar
+ (lambda (item)
+ (org-element-adopt-elements
+ (list 'item (list :checkbox (org-element-property
+ :checkbox item)))
+ (list 'paragraph (list :style "Text_20_body_20_bold")
+ (or (org-element-property :tag item) "(no term)"))
+ (org-element-adopt-elements
+ (list 'plain-list (list :type 'descriptive-2))
+ (apply 'org-element-adopt-elements
+ (list 'item nil)
+ (org-element-contents item)))))
+ (org-element-contents el)))))
+ nil)
+ info)
+ tree)
+
+;;;; List tables
+
+;; Lists that are marked with attribute `:list-table' are called as
+;; list tables. They will be rendered as a table within the exported
+;; document.
+
+;; Consider an example. The following list table
+;;
+;; #+attr_odt :list-table t
+;; - Row 1
+;; - 1.1
+;; - 1.2
+;; - 1.3
+;; - Row 2
+;; - 2.1
+;; - 2.2
+;; - 2.3
+;;
+;; will be exported as though it were an Org table like the one show
+;; below.
+;;
+;; | Row 1 | 1.1 | 1.2 | 1.3 |
+;; | Row 2 | 2.1 | 2.2 | 2.3 |
+;;
+;; Note that org-tables are NOT multi-line and each line is mapped to
+;; a unique row in the exported document. So if an exported table
+;; needs to contain a single paragraph (with copious text) it needs to
+;; be typed up in a single line. Editing such long lines using the
+;; table editor will be a cumbersome task. Furthermore inclusion of
+;; multi-paragraph text in a table cell is well-nigh impossible.
+;;
+;; A LIST-TABLE circumvents above problems.
+;;
+;; Note that in the example above the list items could be paragraphs
+;; themselves and the list can be arbitrarily deep.
+;;
+;; Inspired by following thread:
+;; https://lists.gnu.org/r/emacs-orgmode/2011-03/msg01101.html
+
+;; Translate lists to tables
+
+(defun org-odt--translate-list-tables (tree _backend info)
+ (org-element-map tree 'plain-list
+ (lambda (l1-list)
+ (when (org-export-read-attribute :attr_odt l1-list :list-table)
+ ;; Replace list with table.
+ (org-element-set-element
+ l1-list
+ ;; Build replacement table.
+ (apply 'org-element-adopt-elements
+ (list 'table '(:type org :attr_odt (":style \"GriddedTable\"")))
+ (org-element-map l1-list 'item
+ (lambda (l1-item)
+ (let* ((l1-item-contents (org-element-contents l1-item))
+ l1-item-leading-text l2-list)
+ ;; Remove Level-2 list from the Level-item. It
+ ;; will be subsequently attached as table-cells.
+ (let ((cur l1-item-contents) prev)
+ (while (and cur (not (eq (org-element-type (car cur))
+ 'plain-list)))
+ (setq prev cur)
+ (setq cur (cdr cur)))
+ (when prev
+ (setcdr prev nil)
+ (setq l2-list (car cur)))
+ (setq l1-item-leading-text l1-item-contents))
+ ;; Level-1 items start a table row.
+ (apply 'org-element-adopt-elements
+ (list 'table-row (list :type 'standard))
+ ;; Leading text of level-1 item define
+ ;; the first table-cell.
+ (apply 'org-element-adopt-elements
+ (list 'table-cell nil)
+ l1-item-leading-text)
+ ;; Level-2 items define subsequent
+ ;; table-cells of the row.
+ (org-element-map l2-list 'item
+ (lambda (l2-item)
+ (apply 'org-element-adopt-elements
+ (list 'table-cell nil)
+ (org-element-contents l2-item)))
+ info nil 'item))))
+ info nil 'item))))
+ nil)
+ info)
+ tree)
+
+
+;;; Interactive functions
+
+(defun org-odt-create-manifest-file-entry (&rest args)
+ (push args org-odt-manifest-file-entries))
+
+(defun org-odt-write-manifest-file ()
+ (make-directory (concat org-odt-zip-dir "META-INF"))
+ (let ((manifest-file (concat org-odt-zip-dir "META-INF/manifest.xml")))
+ (with-current-buffer
+ (let ((nxml-auto-insert-xml-declaration-flag nil))
+ (find-file-noselect manifest-file t))
+ (insert
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+ <manifest:manifest xmlns:manifest=\"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0\" manifest:version=\"1.2\">\n")
+ (dolist (file-entry org-odt-manifest-file-entries)
+ (let* ((version (nth 2 file-entry))
+ (extra (if (not version) ""
+ (format " manifest:version=\"%s\"" version))))
+ (insert
+ (format org-odt-manifest-file-entry-tag
+ (nth 0 file-entry) (nth 1 file-entry) extra))))
+ (insert "\n</manifest:manifest>"))))
+
+(defmacro org-odt--export-wrap (out-file &rest body)
+ `(let* ((--out-file ,out-file)
+ (out-file-type (file-name-extension --out-file))
+ (org-odt-xml-files '("META-INF/manifest.xml" "content.xml"
+ "meta.xml" "styles.xml"))
+ ;; Initialize temporary workarea. All files that end up in
+ ;; the exported document get parked/created here.
+ (org-odt-zip-dir (file-name-as-directory
+ (make-temp-file (format "%s-" out-file-type) t)))
+ (org-odt-manifest-file-entries nil)
+ (--cleanup-xml-buffers
+ (lambda ()
+ ;; Kill all XML buffers.
+ (dolist (file org-odt-xml-files)
+ (let ((buf (find-buffer-visiting
+ (concat org-odt-zip-dir file))))
+ (when buf
+ (with-current-buffer buf
+ (set-buffer-modified-p nil)
+ (kill-buffer buf)))))
+ ;; Delete temporary directory and also other embedded
+ ;; files that get copied there.
+ (delete-directory org-odt-zip-dir t))))
+ (condition-case err
+ (progn
+ (unless (executable-find "zip")
+ ;; Not at all OSes ship with zip by default
+ (error "Executable \"zip\" needed for creating OpenDocument files"))
+ ;; Do export. This creates a bunch of xml files ready to be
+ ;; saved and zipped.
+ (progn ,@body)
+ ;; Create a manifest entry for content.xml.
+ (org-odt-create-manifest-file-entry "text/xml" "content.xml")
+ ;; Write mimetype file
+ (let* ((mimetypes
+ '(("odt" . "application/vnd.oasis.opendocument.text")
+ ("odf" . "application/vnd.oasis.opendocument.formula")))
+ (mimetype (cdr (assoc-string out-file-type mimetypes t))))
+ (unless mimetype
+ (error "Unknown OpenDocument backend %S" out-file-type))
+ (write-region mimetype nil (concat org-odt-zip-dir "mimetype"))
+ (org-odt-create-manifest-file-entry mimetype "/" "1.2"))
+ ;; Write out the manifest entries before zipping
+ (org-odt-write-manifest-file)
+ ;; Save all XML files.
+ (dolist (file org-odt-xml-files)
+ (let ((buf (find-buffer-visiting
+ (concat org-odt-zip-dir file))))
+ (when buf
+ (with-current-buffer buf
+ ;; Prettify output if needed.
+ (when org-odt-prettify-xml
+ (indent-region (point-min) (point-max)))
+ (save-buffer 0)))))
+ ;; Run zip.
+ (let* ((target --out-file)
+ (target-name (file-name-nondirectory target))
+ (cmds `(("zip" "-mX0" ,target-name "mimetype")
+ ("zip" "-rmTq" ,target-name "."))))
+ ;; If a file with same name as the desired output file
+ ;; exists, remove it.
+ (when (file-exists-p target)
+ (delete-file target))
+ ;; Zip up the xml files.
+ (let ((coding-system-for-write 'no-conversion) exitcode err-string)
+ (message "Creating ODT file...")
+ ;; Switch temporarily to content.xml. This way Zip
+ ;; process will inherit `org-odt-zip-dir' as the current
+ ;; directory.
+ (with-current-buffer
+ (find-file-noselect (concat org-odt-zip-dir "content.xml") t)
+ (dolist (cmd cmds)
+ (message "Running %s" (mapconcat 'identity cmd " "))
+ (setq err-string
+ (with-output-to-string
+ (setq exitcode
+ (apply 'call-process (car cmd)
+ nil standard-output nil (cdr cmd)))))
+ (or (zerop exitcode)
+ (error (concat "Unable to create OpenDocument file."
+ " Zip failed with error (%s)")
+ err-string)))))
+ ;; Move the zip file from temporary work directory to
+ ;; user-mandated location.
+ (rename-file (concat org-odt-zip-dir target-name) target)
+ (message "Created %s" (expand-file-name target))
+ ;; Cleanup work directory and work files.
+ (funcall --cleanup-xml-buffers)
+ ;; Open the OpenDocument file in archive-mode for
+ ;; examination.
+ (find-file-noselect target t)
+ ;; Return exported file.
+ (cond
+ ;; Case 1: Conversion desired on exported file. Run the
+ ;; converter on the OpenDocument file. Return the
+ ;; converted file.
+ (org-odt-preferred-output-format
+ (or (org-odt-convert target org-odt-preferred-output-format)
+ target))
+ ;; Case 2: No further conversion. Return exported
+ ;; OpenDocument file.
+ (t target))))
+ (error
+ ;; Cleanup work directory and work files.
+ (funcall --cleanup-xml-buffers)
+ (message "OpenDocument export failed: %s"
+ (error-message-string err))))))
+
+
+;;;; Export to OpenDocument formula
+
+;;;###autoload
+(defun org-odt-export-as-odf (latex-frag &optional odf-file)
+ "Export LATEX-FRAG as OpenDocument formula file ODF-FILE.
+Use `org-create-math-formula' to convert LATEX-FRAG first to
+MathML. When invoked as an interactive command, use
+`org-latex-regexps' to infer LATEX-FRAG from currently active
+region. If no LaTeX fragments are found, prompt for it. Push
+MathML source to kill ring depending on the value of
+`org-export-copy-to-kill-ring'."
+ (interactive
+ `(,(let (frag)
+ (setq frag (and (setq frag (and (region-active-p)
+ (buffer-substring (region-beginning)
+ (region-end))))
+ (cl-loop for e in org-latex-regexps
+ thereis (when (string-match (nth 1 e) frag)
+ (match-string (nth 2 e) frag)))))
+ (read-string "LaTeX Fragment: " frag nil frag))
+ ,(let ((odf-filename (expand-file-name
+ (concat
+ (file-name-sans-extension
+ (or (file-name-nondirectory buffer-file-name)))
+ "." "odf")
+ (file-name-directory buffer-file-name))))
+ (read-file-name "ODF filename: " nil odf-filename nil
+ (file-name-nondirectory odf-filename)))))
+ (let ((filename (or odf-file
+ (expand-file-name
+ (concat
+ (file-name-sans-extension
+ (or (file-name-nondirectory buffer-file-name)))
+ "." "odf")
+ (file-name-directory buffer-file-name)))))
+ (org-odt--export-wrap
+ filename
+ (let* ((buffer (progn
+ (require 'nxml-mode)
+ (let ((nxml-auto-insert-xml-declaration-flag nil))
+ (find-file-noselect (concat org-odt-zip-dir
+ "content.xml") t))))
+ (coding-system-for-write 'utf-8)
+ (save-buffer-coding-system 'utf-8))
+ (set-buffer buffer)
+ (set-buffer-file-coding-system coding-system-for-write)
+ (let ((mathml (org-create-math-formula latex-frag)))
+ (unless mathml (error "No Math formula created"))
+ (insert mathml)
+ ;; Add MathML to kill ring, if needed.
+ (when (org-export--copy-to-kill-ring-p)
+ (org-kill-new (buffer-string))))))))
+
+;;;###autoload
+(defun org-odt-export-as-odf-and-open ()
+ "Export LaTeX fragment as OpenDocument formula and immediately open it.
+Use `org-odt-export-as-odf' to read LaTeX fragment and OpenDocument
+formula file."
+ (interactive)
+ (org-open-file (call-interactively 'org-odt-export-as-odf) 'system))
+
+
+;;;; Export to OpenDocument Text
+
+;;;###autoload
+(defun org-odt-export-to-odt (&optional async subtreep visible-only ext-plist)
+ "Export current buffer to a ODT file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return output file's name."
+ (interactive)
+ (let ((outfile (org-export-output-file-name ".odt" subtreep)))
+ (if async
+ (org-export-async-start (lambda (f) (org-export-add-to-stack f 'odt))
+ `(expand-file-name
+ (org-odt--export-wrap
+ ,outfile
+ (let* ((org-odt-embedded-images-count 0)
+ (org-odt-embedded-formulas-count 0)
+ (org-odt-automatic-styles nil)
+ (org-odt-object-counters nil)
+ ;; Let `htmlfontify' know that we are interested in
+ ;; collecting styles.
+ (hfy-user-sheet-assoc nil))
+ ;; Initialize content.xml and kick-off the export
+ ;; process.
+ (let ((out-buf
+ (progn
+ (require 'nxml-mode)
+ (let ((nxml-auto-insert-xml-declaration-flag nil))
+ (find-file-noselect
+ (concat org-odt-zip-dir "content.xml") t))))
+ (output (org-export-as
+ 'odt ,subtreep ,visible-only nil ,ext-plist)))
+ (with-current-buffer out-buf
+ (erase-buffer)
+ (insert output)))))))
+ (org-odt--export-wrap
+ outfile
+ (let* ((org-odt-embedded-images-count 0)
+ (org-odt-embedded-formulas-count 0)
+ (org-odt-automatic-styles nil)
+ (org-odt-object-counters nil)
+ ;; Let `htmlfontify' know that we are interested in collecting
+ ;; styles.
+ (hfy-user-sheet-assoc nil))
+ ;; Initialize content.xml and kick-off the export process.
+ (let ((output (org-export-as 'odt subtreep visible-only nil ext-plist))
+ (out-buf (progn
+ (require 'nxml-mode)
+ (let ((nxml-auto-insert-xml-declaration-flag nil))
+ (find-file-noselect
+ (concat org-odt-zip-dir "content.xml") t)))))
+ (with-current-buffer out-buf (erase-buffer) (insert output))))))))
+
+
+;;;; Convert between OpenDocument and other formats
+
+(defun org-odt-reachable-p (in-fmt out-fmt)
+ "Return non-nil if IN-FMT can be converted to OUT-FMT."
+ (catch 'done
+ (let ((reachable-formats (org-odt-do-reachable-formats in-fmt)))
+ (dolist (e reachable-formats)
+ (let ((out-fmt-spec (assoc out-fmt (cdr e))))
+ (when out-fmt-spec
+ (throw 'done (cons (car e) out-fmt-spec))))))))
+
+(defun org-odt-do-convert (in-file out-fmt &optional open)
+ "Workhorse routine for `org-odt-convert'."
+ (require 'browse-url)
+ (let* ((in-file (let ((f (expand-file-name (or in-file buffer-file-name))))
+ (if (file-readable-p f) f
+ (error "Cannot read %s" in-file))))
+ (in-fmt (file-name-extension in-file))
+ (out-fmt (or out-fmt (error "Output format unspecified")))
+ (how (or (org-odt-reachable-p in-fmt out-fmt)
+ (error "Cannot convert from %s format to %s format?"
+ in-fmt out-fmt)))
+ (convert-process (car how))
+ (out-file (concat (file-name-sans-extension in-file) "."
+ (nth 1 (or (cdr how) out-fmt))))
+ (extra-options (or (nth 2 (cdr how)) ""))
+ (out-dir (file-name-directory in-file))
+ (cmd (format-spec convert-process
+ `((?i . ,(shell-quote-argument in-file))
+ (?I . ,(browse-url-file-url in-file))
+ (?f . ,out-fmt)
+ (?o . ,(shell-quote-argument out-file))
+ (?O . ,(browse-url-file-url out-file))
+ (?d . , (shell-quote-argument out-dir))
+ (?D . ,(browse-url-file-url out-dir))
+ (?x . ,extra-options)))))
+ (when (file-exists-p out-file)
+ (delete-file out-file))
+
+ (message "Executing %s" cmd)
+ (let ((cmd-output (shell-command-to-string cmd)))
+ (message "%s" cmd-output))
+
+ (cond
+ ((file-exists-p out-file)
+ (message "Exported to %s" out-file)
+ (when open
+ (message "Opening %s..." out-file)
+ (org-open-file out-file 'system))
+ out-file)
+ (t
+ (message "Export to %s failed" out-file)
+ nil))))
+
+(defun org-odt-do-reachable-formats (in-fmt)
+ "Return verbose info about formats to which IN-FMT can be converted.
+Return a list where each element is of the
+form (CONVERTER-PROCESS . OUTPUT-FMT-ALIST). See
+`org-odt-convert-processes' for CONVERTER-PROCESS and see
+`org-odt-convert-capabilities' for OUTPUT-FMT-ALIST."
+ (let* ((converter
+ (and org-odt-convert-process
+ (cadr (assoc-string org-odt-convert-process
+ org-odt-convert-processes t))))
+ (capabilities
+ (and org-odt-convert-process
+ (cadr (assoc-string org-odt-convert-process
+ org-odt-convert-processes t))
+ org-odt-convert-capabilities))
+ reachable-formats)
+ (when converter
+ (dolist (c capabilities)
+ (when (member in-fmt (nth 1 c))
+ (push (cons converter (nth 2 c)) reachable-formats))))
+ reachable-formats))
+
+(defun org-odt-reachable-formats (in-fmt)
+ "Return list of formats to which IN-FMT can be converted.
+The list of the form (OUTPUT-FMT-1 OUTPUT-FMT-2 ...)."
+ (copy-sequence
+ (apply #'append (mapcar
+ (lambda (e) (mapcar #'car (cdr e)))
+ (org-odt-do-reachable-formats in-fmt)))))
+
+(defun org-odt-convert-read-params ()
+ "Return IN-FILE and OUT-FMT params for `org-odt-do-convert'.
+This is a helper routine for interactive use."
+ (let* ((input (if (featurep 'ido) 'ido-completing-read 'completing-read))
+ (in-file (read-file-name "File to be converted: "
+ nil buffer-file-name t))
+ (in-fmt (file-name-extension in-file))
+ (out-fmt-choices (org-odt-reachable-formats in-fmt))
+ (out-fmt
+ (or (and out-fmt-choices
+ (funcall input "Output format: "
+ out-fmt-choices nil nil nil))
+ (error
+ "No known converter or no known output formats for %s files"
+ in-fmt))))
+ (list in-file out-fmt)))
+
+;;;###autoload
+(defun org-odt-convert (&optional in-file out-fmt open)
+ "Convert IN-FILE to format OUT-FMT using a command line converter.
+IN-FILE is the file to be converted. If unspecified, it defaults
+to variable `buffer-file-name'. OUT-FMT is the desired output
+format. Use `org-odt-convert-process' as the converter. If OPEN
+is non-nil then the newly converted file is opened using
+`org-open-file'."
+ (interactive
+ (append (org-odt-convert-read-params) current-prefix-arg))
+ (org-odt-do-convert in-file out-fmt open))
+
+;;; Library Initializations
+
+(dolist (desc org-odt-file-extensions)
+ ;; Let Emacs open all OpenDocument files in archive mode.
+ (add-to-list 'auto-mode-alist
+ (cons (concat "\\." (car desc) "\\'") 'archive-mode)))
+
+(provide 'ox-odt)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ox-odt.el ends here
diff --git a/elpa/org-9.5.2/ox-odt.elc b/elpa/org-9.5.2/ox-odt.elc
new file mode 100644
index 0000000..816da3e
--- /dev/null
+++ b/elpa/org-9.5.2/ox-odt.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ox-org.el b/elpa/org-9.5.2/ox-org.el
new file mode 100644
index 0000000..fcf8768
--- /dev/null
+++ b/elpa/org-9.5.2/ox-org.el
@@ -0,0 +1,357 @@
+;;; ox-org.el --- Org Back-End for Org Export Engine -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <n.goaziou@gmail.com>
+;; Maintainer: Nicolas Goaziou <n.goaziou at gmail dot com>
+;; Keywords: org, 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ox)
+(declare-function htmlize-buffer "ext:htmlize" (&optional buffer))
+(defvar htmlize-output-type)
+
+(defgroup org-export-org nil
+ "Options for exporting Org mode files to Org."
+ :tag "Org Export Org"
+ :group 'org-export
+ :version "24.4"
+ :package-version '(Org . "8.0"))
+
+(defcustom org-org-htmlized-css-url nil
+ "URL pointing to the CSS defining colors for htmlized Emacs buffers.
+Normally when creating an htmlized version of an Org buffer,
+htmlize will create the CSS to define the font colors. However,
+this does not work when converting in batch mode, and it also can
+look bad if different people with different fontification setup
+work on the same website. When this variable is non-nil,
+creating an htmlized version of an Org buffer using
+`org-org-export-as-org' will include a link to this URL if the
+setting of `org-html-htmlize-output-type' is `css'."
+ :group 'org-export-org
+ :type '(choice
+ (const :tag "Don't include external stylesheet link" nil)
+ (string :tag "URL or local href")))
+
+(org-export-define-backend 'org
+ '((babel-call . org-org-identity)
+ (bold . org-org-identity)
+ (center-block . org-org-identity)
+ (clock . org-org-identity)
+ (code . org-org-identity)
+ (diary-sexp . org-org-identity)
+ (drawer . org-org-identity)
+ (dynamic-block . org-org-identity)
+ (entity . org-org-identity)
+ (example-block . org-org-identity)
+ (export-block . org-org-export-block)
+ (fixed-width . org-org-identity)
+ (footnote-definition . ignore)
+ (footnote-reference . org-org-identity)
+ (headline . org-org-headline)
+ (horizontal-rule . org-org-identity)
+ (inline-babel-call . org-org-identity)
+ (inline-src-block . org-org-identity)
+ (inlinetask . org-org-identity)
+ (italic . org-org-identity)
+ (item . org-org-identity)
+ (keyword . org-org-keyword)
+ (latex-environment . org-org-identity)
+ (latex-fragment . org-org-identity)
+ (line-break . org-org-identity)
+ (link . org-org-link)
+ (node-property . org-org-identity)
+ (template . org-org-template)
+ (paragraph . org-org-identity)
+ (plain-list . org-org-identity)
+ (planning . org-org-identity)
+ (property-drawer . org-org-identity)
+ (quote-block . org-org-identity)
+ (radio-target . org-org-identity)
+ (section . org-org-section)
+ (special-block . org-org-identity)
+ (src-block . org-org-identity)
+ (statistics-cookie . org-org-identity)
+ (strike-through . org-org-identity)
+ (subscript . org-org-identity)
+ (superscript . org-org-identity)
+ (table . org-org-identity)
+ (table-cell . org-org-identity)
+ (table-row . org-org-identity)
+ (target . org-org-identity)
+ (timestamp . org-org-timestamp)
+ (underline . org-org-identity)
+ (verbatim . org-org-identity)
+ (verse-block . org-org-identity))
+ :menu-entry
+ '(?O "Export to Org"
+ ((?O "As Org buffer" org-org-export-as-org)
+ (?o "As Org file" org-org-export-to-org)
+ (?v "As Org file and open"
+ (lambda (a s v b)
+ (if a (org-org-export-to-org t s v b)
+ (org-open-file (org-org-export-to-org nil s v b)))))))
+ :filters-alist '((:filter-parse-tree . org-org--add-missing-sections)))
+
+(defun org-org--add-missing-sections (tree _backend _info)
+ "Ensure each headline has an associated section.
+
+TREE is the parse tree being exported.
+
+Footnotes relative to the headline are inserted in the section,
+using `org-org-section'. However, this function is not called if
+the headline doesn't contain any section in the first place, so
+we make sure it is always called."
+ (org-element-map tree 'headline
+ (lambda (h)
+ (let ((first-child (car (org-element-contents h)))
+ (new-section (org-element-create 'section)))
+ (pcase (org-element-type first-child)
+ (`section nil)
+ (`nil (org-element-adopt-elements h new-section))
+ (_ (org-element-insert-before new-section first-child))))))
+ tree)
+
+(defun org-org-export-block (export-block _contents _info)
+ "Transcode a EXPORT-BLOCK element from Org to LaTeX.
+CONTENTS and INFO are ignored."
+ (and (equal (org-element-property :type export-block) "ORG")
+ (org-element-property :value export-block)))
+
+(defun org-org-identity (blob contents _info)
+ "Transcode BLOB element or object back into Org syntax.
+CONTENTS is its contents, as a string or nil. INFO is ignored."
+ (let ((case-fold-search t))
+ (replace-regexp-in-string
+ "^[ \t]*#\\+attr_[-_a-z0-9]+:\\(?: .*\\)?\n" ""
+ (org-export-expand blob contents t))))
+
+(defun org-org-headline (headline contents info)
+ "Transcode HEADLINE element back into Org syntax.
+CONTENTS is its contents, as a string or nil. INFO is ignored."
+ (unless (org-element-property :footnote-section-p headline)
+ (unless (plist-get info :with-todo-keywords)
+ (org-element-put-property headline :todo-keyword nil))
+ (unless (plist-get info :with-tags)
+ (org-element-put-property headline :tags nil))
+ (unless (plist-get info :with-priority)
+ (org-element-put-property headline :priority nil))
+ (org-element-put-property headline :level
+ (org-export-get-relative-level headline info))
+ (org-element-headline-interpreter headline contents)))
+
+(defun org-org-keyword (keyword _contents _info)
+ "Transcode KEYWORD element back into Org syntax.
+CONTENTS is nil. INFO is ignored."
+ (let ((key (org-element-property :key keyword)))
+ (unless (member key
+ '("AUTHOR" "CREATOR" "DATE" "EMAIL" "OPTIONS" "TITLE"))
+ (org-element-keyword-interpreter keyword nil))))
+
+(defun org-org-link (link contents info)
+ "Transcode LINK object back into Org syntax.
+CONTENTS is the description of the link, as a string, or nil.
+INFO is a plist containing current export state."
+ (or (org-export-custom-protocol-maybe link contents 'org info)
+ (org-element-link-interpreter link contents)))
+
+(defun org-org-template (contents info)
+ "Return Org document template with document keywords.
+CONTENTS is the transcoded contents string. INFO is a plist used
+as a communication channel."
+ (concat
+ (and (plist-get info :time-stamp-file)
+ (format-time-string "# Created %Y-%m-%d %a %H:%M\n"))
+ (org-element-normalize-string
+ (mapconcat #'identity
+ (org-element-map (plist-get info :parse-tree) 'keyword
+ (lambda (k)
+ (and (string-equal (org-element-property :key k) "OPTIONS")
+ (concat "#+options: "
+ (org-element-property :value k)))))
+ "\n"))
+ (and (plist-get info :with-title)
+ (format "#+title: %s\n" (org-export-data (plist-get info :title) info)))
+ (and (plist-get info :with-date)
+ (let ((date (org-export-data (org-export-get-date info) info)))
+ (and (org-string-nw-p date)
+ (format "#+date: %s\n" date))))
+ (and (plist-get info :with-author)
+ (let ((author (org-export-data (plist-get info :author) info)))
+ (and (org-string-nw-p author)
+ (format "#+author: %s\n" author))))
+ (and (plist-get info :with-email)
+ (let ((email (org-export-data (plist-get info :email) info)))
+ (and (org-string-nw-p email)
+ (format "#+email: %s\n" email))))
+ (and (plist-get info :with-creator)
+ (org-string-nw-p (plist-get info :creator))
+ (format "#+creator: %s\n" (plist-get info :creator)))
+ contents))
+
+(defun org-org-timestamp (timestamp _contents _info)
+ "Transcode a TIMESTAMP object to custom format or back into Org syntax."
+ (org-timestamp-translate timestamp))
+
+(defun org-org-section (section contents info)
+ "Transcode SECTION element back into Org syntax.
+CONTENTS is the contents of the section. INFO is a plist used as
+a communication channel."
+ (concat
+ (org-element-normalize-string contents)
+ ;; Insert footnote definitions appearing for the first time in this
+ ;; section, or in the relative headline title. Indeed, some of
+ ;; them may not be available to narrowing so we make sure all of
+ ;; them are included in the result.
+ (let ((footnotes
+ (org-element-map
+ (list (org-export-get-parent-headline section) section)
+ 'footnote-reference
+ (lambda (fn)
+ (and (eq (org-element-property :type fn) 'standard)
+ (org-export-footnote-first-reference-p fn info)
+ (org-element-normalize-string
+ (format "[fn:%s] %s"
+ (org-element-property :label fn)
+ (org-export-data
+ (org-export-get-footnote-definition fn info)
+ info)))))
+ info nil 'headline t)))
+ (and footnotes (concat "\n" (mapconcat #'identity footnotes "\n"))))))
+
+;;;###autoload
+(defun org-org-export-as-org
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer to an Org buffer.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should be accessible
+through the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, strip document
+keywords from output.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Export is done in a buffer named \"*Org ORG Export*\", which will
+be displayed when `org-export-show-temporary-export-buffer' is
+non-nil."
+ (interactive)
+ (org-export-to-buffer 'org "*Org ORG Export*"
+ async subtreep visible-only body-only ext-plist (lambda () (org-mode))))
+
+;;;###autoload
+(defun org-org-export-to-org
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer to an Org file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, strip document
+keywords from output.
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return output file name."
+ (interactive)
+ (let ((outfile (org-export-output-file-name ".org" subtreep)))
+ (org-export-to-file 'org outfile
+ async subtreep visible-only body-only ext-plist)))
+
+;;;###autoload
+(defun org-org-publish-to-org (plist filename pub-dir)
+ "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
+publishing directory.
+
+Return output file name."
+ (org-publish-org-to 'org filename ".org" plist pub-dir)
+ (when (plist-get plist :htmlized-source)
+ (or (require 'htmlize nil t)
+ (error "Please install htmlize from https://github.com/hniksic/emacs-htmlize"))
+ (require 'ox-html)
+ (let* ((org-inhibit-startup t)
+ (htmlize-output-type 'css)
+ (html-ext (concat "." (or (plist-get plist :html-extension)
+ org-html-extension "html")))
+ (visitingp (find-buffer-visiting filename))
+ (work-buffer (or visitingp (find-file-noselect filename)))
+ newbuf)
+ (with-current-buffer work-buffer
+ (org-font-lock-ensure)
+ (org-show-all)
+ (setq newbuf (htmlize-buffer)))
+ (with-current-buffer newbuf
+ (when org-org-htmlized-css-url
+ (goto-char (point-min))
+ (and (re-search-forward
+ "<style type=\"text/css\">[^\000]*?\n[ \t]*</style>.*" nil t)
+ (replace-match
+ (format
+ "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\">"
+ org-org-htmlized-css-url)
+ t t)))
+ (write-file (concat pub-dir (file-name-nondirectory filename) html-ext)))
+ (kill-buffer newbuf)
+ (unless visitingp (kill-buffer work-buffer)))
+ ;; FIXME: Why? Which buffer is this supposed to apply to?
+ (set-buffer-modified-p nil)))
+
+
+(provide 'ox-org)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ox-org.el ends here
diff --git a/elpa/org-9.5.2/ox-org.elc b/elpa/org-9.5.2/ox-org.elc
new file mode 100644
index 0000000..71be45e
--- /dev/null
+++ b/elpa/org-9.5.2/ox-org.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ox-publish.el b/elpa/org-9.5.2/ox-publish.el
new file mode 100644
index 0000000..bc9b17a
--- /dev/null
+++ b/elpa/org-9.5.2/ox-publish.el
@@ -0,0 +1,1380 @@
+;;; ox-publish.el --- Publish Related Org Mode Files as a Website -*- lexical-binding: t; -*-
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
+
+;; Author: David O'Toole <dto@gnu.org>
+;; Maintainer: Nicolas Goaziou <n.goaziou at gmail dot com>
+;; Keywords: hypermedia, outlines, 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This program allow configurable publishing of related sets of
+;; Org mode files as a complete website.
+;;
+;; ox-publish.el can do the following:
+;;
+;; + Publish all one's Org files to a given export back-end
+;; + Upload HTML, images, attachments and other files to a web server
+;; + Exclude selected private pages from publishing
+;; + Publish a clickable sitemap of pages
+;; + Manage local timestamps for publishing only changed files
+;; + Accept plugin functions to extend range of publishable content
+;;
+;; Documentation for publishing is in the manual.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'format-spec)
+(require 'ox)
+
+
+
+;;; Variables
+
+;; Here, so you find the variable right before it's used the first time:
+(defvar org-publish-cache nil
+ "This will cache timestamps and titles for files in publishing projects.
+Blocks could hash sha1 values here.")
+
+(defvar org-publish-after-publishing-hook nil
+ "Hook run each time a file is published.
+Every function in this hook will be called with two arguments:
+the name of the original file and the name of the file
+produced.")
+
+(defgroup org-export-publish nil
+ "Options for publishing a set of files."
+ :tag "Org Publishing"
+ :group 'org-export)
+
+(defcustom org-publish-project-alist nil
+ "Association list to control publishing behavior.
+\\<org-mode-map>
+Each element of the alist is a publishing project. The car of
+each element is a string, uniquely identifying the project. The
+cdr of each element is in one of the following forms:
+
+1. A well-formed property list with an even number of elements,
+ alternating keys and values, specifying parameters for the
+ publishing process.
+
+ (:property value :property value ... )
+
+2. A meta-project definition, specifying of a list of
+ sub-projects:
+
+ (:components (\"project-1\" \"project-2\" ...))
+
+When the CDR of an element of org-publish-project-alist is in
+this second form, the elements of the list after `:components'
+are taken to be components of the project, which group together
+files requiring different publishing options. When you publish
+such a project with `\\[org-publish]', the components all publish.
+
+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. However, options set within
+a file override everything.
+
+Most properties are optional, but some should always be set:
+
+ `:base-directory'
+
+ Directory containing publishing source files.
+
+ `:base-extension'
+
+ Extension (without the dot!) of source files. This can be
+ a regular expression. If not given, \"org\" will be used as
+ default extension. If it is `any', include all the files,
+ even without extension.
+
+ `:publishing-directory'
+
+ Directory (possibly remote) where output files will be
+ published.
+
+If `:recursive' is non-nil files in sub-directories of
+`:base-directory' are considered.
+
+The `:exclude' property may be used to prevent certain files from
+being published. Its value may be a string or regexp matching
+file names you don't want to be published.
+
+The `:include' property may be used to include extra files. Its
+value may be a list of filenames to include. The filenames are
+considered relative to the base directory.
+
+When both `:include' and `:exclude' properties are given values,
+the exclusion step happens first.
+
+One special property controls which back-end function to use for
+publishing files in the project. This can be used to extend the
+set of file types publishable by `org-publish', as well as the
+set of output formats.
+
+ `:publishing-function'
+
+ Function to publish file. Each back-end may define its
+ own (i.e. `org-latex-publish-to-pdf',
+ `org-html-publish-to-html'). May be a list of functions, in
+ which case each function in the list is invoked in turn.
+
+Another property allows you to insert code that prepares
+a project for publishing. For example, you could call GNU Make
+on a certain makefile, to ensure published files are built up to
+date.
+
+ `:preparation-function'
+
+ Function to be called before publishing this project. This
+ may also be a list of functions. Preparation functions are
+ called with the project properties list as their sole
+ argument.
+
+ `:completion-function'
+
+ Function to be called after publishing this project. This
+ may also be a list of functions. Completion functions are
+ called with the project properties list as their sole
+ argument.
+
+Some properties control details of the Org publishing process,
+and are equivalent to the corresponding user variables listed in
+the right column. Back-end specific properties may also be
+included. See the back-end documentation for more information.
+
+ :author `user-full-name'
+ :creator `org-export-creator-string'
+ :email `user-mail-address'
+ :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'
+ :time-stamp-file `org-export-time-stamp-file'
+ :with-archived-trees `org-export-with-archived-trees'
+ :with-author `org-export-with-author'
+ :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-entities `org-export-with-entities'
+ :with-fixed-width `org-export-with-fixed-width'
+ :with-footnotes `org-export-with-footnotes'
+ :with-inlinetasks `org-export-with-inlinetasks'
+ :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-smart-quotes `org-export-with-smart-quotes'
+ :with-special-strings `org-export-with-special-strings'
+ :with-statistics-cookies' `org-export-with-statistics-cookies'
+ :with-sub-superscript `org-export-with-sub-superscripts'
+ :with-toc `org-export-with-toc'
+ :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-todo-keywords `org-export-with-todo-keywords'
+
+The following properties may be used to control publishing of
+a site-map of files or summary page for a given project.
+
+ `:auto-sitemap'
+
+ Whether to publish a site-map during
+ `org-publish-current-project' or `org-publish-all'.
+
+ `:sitemap-filename'
+
+ Filename for output of site-map. Defaults to \"sitemap.org\".
+
+ `:sitemap-title'
+
+ Title of site-map page. Defaults to name of file.
+
+ `:sitemap-style'
+
+ Can be `list' (site-map is just an itemized list of the
+ titles of the files involved) or `tree' (the directory
+ structure of the source files is reflected in the site-map).
+ Defaults to `tree'.
+
+ `:sitemap-format-entry'
+
+ Plugin function used to format entries in the site-map. It
+ is called with three arguments: the file or directory name
+ relative to base directory, the site map style and the
+ current project. It has to return a string.
+
+ Defaults to `org-publish-sitemap-default-entry', which 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'
+
+ Plugin function to use for generation of site-map. It is
+ called with two arguments: the title of the site-map, as
+ a string, and a representation of the files involved in the
+ project, as returned by `org-list-to-lisp'. The latter can
+ further be transformed using `org-list-to-generic',
+ `org-list-to-subtree' and alike. It has to return a string.
+
+ Defaults to `org-publish-sitemap-default', which generates
+ a plain list of links to all files in the project.
+
+If you create a site-map file, adjust the sorting like this:
+
+ `:sitemap-sort-folders'
+
+ Where folders should appear in the site-map. Set this to
+ `first' or `last' to display folders first or last,
+ respectively. When set to `ignore' (default), 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'
+
+ The site map is normally sorted alphabetically. You can
+ change this behavior setting this to `anti-chronologically',
+ `chronologically', or nil.
+
+ `:sitemap-ignore-case'
+
+ Should sorting be case-sensitive? Default nil.
+
+The following property control the creation of a concept index.
+
+ `:makeindex'
+
+ Create a concept index. The file containing the index has to
+ be called \"theindex.org\". If it doesn't exist in the
+ project, it will be generated. Contents of the index are
+ stored in the file \"theindex.inc\", which can be included in
+ \"theindex.org\".
+
+Other properties affecting publication.
+
+ `:body-only'
+
+ Set this to t to publish only the body of the documents."
+ :group 'org-export-publish
+ :type 'alist)
+
+(defcustom org-publish-use-timestamps-flag t
+ "Non-nil means use timestamp checking to publish only changed files.
+When nil, do no timestamp checking and always publish all files."
+ :group 'org-export-publish
+ :type 'boolean)
+
+(defcustom org-publish-timestamp-directory
+ (convert-standard-filename "~/.org-timestamps/")
+ "Name of directory in which to store publishing timestamps."
+ :group 'org-export-publish
+ :type 'directory)
+
+(defcustom org-publish-list-skipped-files t
+ "Non-nil means show message about files *not* published."
+ :group 'org-export-publish
+ :type 'boolean)
+
+(defcustom org-publish-sitemap-sort-files 'alphabetically
+ "Method to sort files in site-maps.
+Possible values are `alphabetically', `chronologically',
+`anti-chronologically' and nil.
+
+If `alphabetically', files will be sorted alphabetically. If
+`chronologically', files will be sorted with older modification
+time first. If `anti-chronologically', files will be sorted with
+newer modification time first. nil won't sort files.
+
+You can overwrite this default per project in your
+`org-publish-project-alist', using `:sitemap-sort-files'."
+ :group 'org-export-publish
+ :type 'symbol)
+
+(defcustom org-publish-sitemap-sort-folders 'ignore
+ "A symbol, denoting if folders are sorted first in site-maps.
+
+Possible values are `first', `last', `ignore' and nil.
+If `first', folders will be sorted before files.
+If `last', folders are sorted to the end after the files.
+If `ignore', folders do not appear in the site-map.
+Any other value will mix files and folders.
+
+You can overwrite this default per project in your
+`org-publish-project-alist', using `:sitemap-sort-folders'.
+
+This variable is ignored when site-map style is `tree'."
+ :group 'org-export-publish
+ :type '(choice
+ (const :tag "Folders before files" first)
+ (const :tag "Folders after files" last)
+ (const :tag "No folder in site-map" ignore)
+ (const :tag "Mix folders and files" nil))
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :safe #'symbolp)
+
+(defcustom org-publish-sitemap-sort-ignore-case nil
+ "Non-nil when site-map sorting should ignore case.
+
+You can overwrite this default per project in your
+`org-publish-project-alist', using `:sitemap-ignore-case'."
+ :group 'org-export-publish
+ :type 'boolean)
+
+
+
+;;; Timestamp-related functions
+
+(defun org-publish-timestamp-filename (filename &optional pub-dir pub-func)
+ "Return path to timestamp file for filename FILENAME."
+ (setq filename (concat filename "::" (or pub-dir "") "::"
+ (format "%s" (or pub-func ""))))
+ (concat "X" (if (fboundp 'sha1) (sha1 filename) (md5 filename))))
+
+(defun org-publish-needed-p
+ (filename &optional pub-dir pub-func _true-pub-dir base-dir)
+ "Non-nil if FILENAME should be published in PUB-DIR using PUB-FUNC.
+TRUE-PUB-DIR is where the file will truly end up. Currently we
+are not using this - maybe it can eventually be used to check if
+the file is present at the target location, and how old it is.
+Right now we cannot do this, because we do not know under what
+file name the file will be stored - the publishing function can
+still decide about that independently."
+ (let ((rtn (if (not org-publish-use-timestamps-flag) t
+ (org-publish-cache-file-needs-publishing
+ filename pub-dir pub-func base-dir))))
+ (if rtn (message "Publishing file %s using `%s'" filename pub-func)
+ (when org-publish-list-skipped-files
+ (message "Skipping unmodified file %s" filename)))
+ rtn))
+
+(defun org-publish-update-timestamp
+ (filename &optional pub-dir pub-func _base-dir)
+ "Update publishing timestamp for file FILENAME.
+If there is no timestamp, create one."
+ (let ((key (org-publish-timestamp-filename filename pub-dir pub-func))
+ (stamp (org-publish-cache-ctime-of-src filename)))
+ (org-publish-cache-set key stamp)))
+
+(defun org-publish-remove-all-timestamps ()
+ "Remove all files in the timestamp directory."
+ (let ((dir org-publish-timestamp-directory))
+ (when (and (file-exists-p dir) (file-directory-p dir))
+ (mapc #'delete-file (directory-files dir 'full "[^.]\\'"))
+ (org-publish-reset-cache))))
+
+
+
+;;; Getting project information out of `org-publish-project-alist'
+
+(defun org-publish-property (property project &optional default)
+ "Return value PROPERTY, as a symbol, in PROJECT.
+DEFAULT is returned when PROPERTY is not actually set in PROJECT
+definition."
+ (let ((properties (cdr project)))
+ (if (plist-member properties property)
+ (plist-get properties property)
+ default)))
+
+(defun org-publish--expand-file-name (file project)
+ "Return full file name for FILE in PROJECT.
+When FILE is a relative file name, it is expanded according to
+project base directory."
+ (if (file-name-absolute-p file) file
+ (expand-file-name file (org-publish-property :base-directory project))))
+
+(defun org-publish-expand-projects (projects-alist)
+ "Expand projects in PROJECTS-ALIST.
+This splices all the components into the list."
+ (let ((rest projects-alist) rtn p components)
+ (while (setq p (pop rest))
+ (if (setq components (plist-get (cdr p) :components))
+ (setq rest (append
+ (mapcar
+ (lambda (x)
+ (or (assoc x org-publish-project-alist)
+ (user-error "Unknown component %S in project %S"
+ x (car p))))
+ components)
+ rest))
+ (push p rtn)))
+ (nreverse (delete-dups (delq nil rtn)))))
+
+(defun org-publish-get-base-files (project)
+ "Return a list of all files in PROJECT."
+ (let* ((base-dir (file-name-as-directory
+ (org-publish-property :base-directory project)))
+ (extension (or (org-publish-property :base-extension project) "org"))
+ (match (if (eq extension 'any) ""
+ (format "^[^\\.].*\\.\\(%s\\)$" extension)))
+ (base-files
+ (cond ((not (file-exists-p base-dir)) nil)
+ ((not (org-publish-property :recursive project))
+ (cl-remove-if #'file-directory-p
+ (directory-files base-dir t match t)))
+ (t
+ ;; Find all files recursively. Unlike to
+ ;; `directory-files-recursively', we follow symlinks
+ ;; to other directories.
+ (letrec ((files nil)
+ (walk-tree
+ (lambda (dir depth)
+ (when (> depth 100)
+ (error "Apparent cycle of symbolic links for %S"
+ base-dir))
+ (dolist (f (file-name-all-completions "" dir))
+ (pcase f
+ ((or "./" "../") nil)
+ ((pred directory-name-p)
+ (funcall walk-tree
+ (expand-file-name f dir)
+ (1+ depth)))
+ ((pred (string-match match))
+ (push (expand-file-name f dir) files))
+ (_ nil)))
+ files)))
+ (funcall walk-tree base-dir 0))))))
+ (org-uniquify
+ (append
+ ;; Files from BASE-DIR. Apply exclusion filter before adding
+ ;; included files.
+ (let ((exclude-regexp (org-publish-property :exclude project)))
+ (if exclude-regexp
+ (cl-remove-if
+ (lambda (f)
+ ;; Match against relative names, yet BASE-DIR file
+ ;; names are absolute.
+ (string-match exclude-regexp
+ (file-relative-name f base-dir)))
+ base-files)
+ base-files))
+ ;; Sitemap file.
+ (and (org-publish-property :auto-sitemap project)
+ (list (expand-file-name
+ (or (org-publish-property :sitemap-filename project)
+ "sitemap.org")
+ base-dir)))
+ ;; Included files.
+ (mapcar (lambda (f) (expand-file-name f base-dir))
+ (org-publish-property :include project))))))
+
+(defun org-publish-get-project-from-filename (filename &optional up)
+ "Return a project that FILENAME belongs to.
+When UP is non-nil, return a meta-project (i.e., with a :components part)
+publishing FILENAME."
+ (let* ((filename (expand-file-name filename))
+ (project
+ (cl-some
+ (lambda (p)
+ ;; Ignore meta-projects.
+ (unless (org-publish-property :components p)
+ (let ((base (expand-file-name
+ (org-publish-property :base-directory p))))
+ (cond
+ ;; Check if FILENAME is explicitly included in one
+ ;; project.
+ ((cl-some (lambda (f) (file-equal-p f filename))
+ (mapcar (lambda (f) (expand-file-name f base))
+ (org-publish-property :include p)))
+ p)
+ ;; Exclude file names matching :exclude property.
+ ((let ((exclude-re (org-publish-property :exclude p)))
+ (and exclude-re
+ (string-match-p exclude-re
+ (file-relative-name filename base))))
+ nil)
+ ;; Check :extension. Handle special `any'
+ ;; extension.
+ ((let ((extension (org-publish-property :base-extension p)))
+ (not (or (eq extension 'any)
+ (string= (or extension "org")
+ (file-name-extension filename)))))
+ nil)
+ ;; Check if FILENAME belong to project's base
+ ;; directory, or some of its sub-directories
+ ;; if :recursive in non-nil.
+ ((member filename (org-publish-get-base-files p)) p)
+ (t nil)))))
+ org-publish-project-alist)))
+ (cond
+ ((not project) nil)
+ ((not up) project)
+ ;; When optional argument UP is non-nil, return the top-most
+ ;; meta-project effectively publishing FILENAME.
+ (t
+ (letrec ((find-parent-project
+ (lambda (project)
+ (or (cl-some
+ (lambda (p)
+ (and (member (car project)
+ (org-publish-property :components p))
+ (funcall find-parent-project p)))
+ org-publish-project-alist)
+ project))))
+ (funcall find-parent-project project))))))
+
+
+
+;;; Tools for publishing functions in back-ends
+
+(defun org-publish-org-to (backend filename extension plist &optional pub-dir)
+ "Publish an Org file to a specified back-end.
+
+BACKEND is a symbol representing the back-end used for
+transcoding. FILENAME is the filename of the Org file to be
+published. EXTENSION is the extension used for the output
+string, with the leading dot. PLIST is the property list for the
+given project.
+
+Optional argument PUB-DIR, when non-nil is the publishing
+directory.
+
+Return output file name."
+ (unless (or (not pub-dir) (file-exists-p pub-dir)) (make-directory pub-dir t))
+ ;; Check if a buffer visiting FILENAME is already open.
+ (let* ((org-inhibit-startup t)
+ (visiting (find-buffer-visiting filename))
+ (work-buffer (or visiting (find-file-noselect filename))))
+ (unwind-protect
+ (with-current-buffer work-buffer
+ (let ((output (org-export-output-file-name extension nil pub-dir)))
+ (org-export-to-file backend output
+ nil nil nil (plist-get plist :body-only)
+ ;; Add `org-publish--store-crossrefs' and
+ ;; `org-publish-collect-index' to final output filters.
+ ;; The latter isn't dependent on `:makeindex', since we
+ ;; want to keep it up-to-date in cache anyway.
+ (org-combine-plists
+ plist
+ `(:crossrefs
+ ,(org-publish-cache-get-file-property
+ ;; Normalize file names in cache.
+ (file-truename filename) :crossrefs nil t)
+ :filter-final-output
+ (org-publish--store-crossrefs
+ org-publish-collect-index
+ ,@(plist-get plist :filter-final-output)))))))
+ ;; Remove opened buffer in the process.
+ (unless visiting (kill-buffer work-buffer)))))
+
+(defun org-publish-attachment (_plist filename pub-dir)
+ "Publish a file with no transformation of any kind.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name."
+ (unless (file-directory-p pub-dir)
+ (make-directory pub-dir t))
+ (let ((output (expand-file-name (file-name-nondirectory filename) pub-dir)))
+ (unless (file-equal-p (expand-file-name (file-name-directory filename))
+ (file-name-as-directory (expand-file-name pub-dir)))
+ (copy-file filename output t))
+ ;; Return file name.
+ output))
+
+
+
+;;; Publishing files, sets of files
+
+(defun org-publish-file (filename &optional project no-cache)
+ "Publish file FILENAME from PROJECT.
+If NO-CACHE is not nil, do not initialize `org-publish-cache'.
+This is needed, since this function is used to publish single
+files, when entire projects are published (see
+`org-publish-projects')."
+ (let* ((project
+ (or project
+ (org-publish-get-project-from-filename filename)
+ (user-error "File %S is not part of any known project"
+ (abbreviate-file-name filename))))
+ (project-plist (cdr project))
+ (publishing-function
+ (pcase (org-publish-property :publishing-function project
+ 'org-html-publish-to-html)
+ (`nil (user-error "No publishing function chosen"))
+ ((and f (pred listp)) f)
+ (f (list f))))
+ (base-dir
+ (file-name-as-directory
+ (or (org-publish-property :base-directory project)
+ (user-error "Project %S does not have :base-directory defined"
+ (car project)))))
+ (pub-base-dir
+ (file-name-as-directory
+ (or (org-publish-property :publishing-directory project)
+ (user-error
+ "Project %S does not have :publishing-directory defined"
+ (car project)))))
+ (pub-dir
+ (file-name-directory
+ (expand-file-name (file-relative-name filename base-dir)
+ pub-base-dir))))
+
+ (unless no-cache (org-publish-initialize-cache (car project)))
+
+ ;; Allow chain of publishing functions.
+ (dolist (f publishing-function)
+ (when (org-publish-needed-p filename pub-base-dir f pub-dir base-dir)
+ (let ((output (funcall f project-plist filename pub-dir)))
+ (org-publish-update-timestamp filename pub-base-dir f base-dir)
+ (run-hook-with-args 'org-publish-after-publishing-hook
+ filename
+ output))))
+ ;; Make sure to write cache to file after successfully publishing
+ ;; a file, so as to minimize impact of a publishing failure.
+ (org-publish-write-cache-file)))
+
+(defun org-publish-projects (projects)
+ "Publish all files belonging to the PROJECTS alist.
+If `:auto-sitemap' is set, publish the sitemap too. If
+`:makeindex' is set, also produce a file \"theindex.org\"."
+ (dolist (project (org-publish-expand-projects projects))
+ (let ((plist (cdr project)))
+ (let ((fun (org-publish-property :preparation-function project)))
+ (cond
+ ((functionp fun) (funcall fun plist))
+ ((consp fun) (dolist (f fun) (funcall f plist)))))
+ ;; Each project uses its own cache file.
+ (org-publish-initialize-cache (car project))
+ (when (org-publish-property :auto-sitemap project)
+ (let ((sitemap-filename
+ (or (org-publish-property :sitemap-filename project)
+ "sitemap.org")))
+ (org-publish-sitemap project sitemap-filename)))
+ ;; Publish all files from PROJECT except "theindex.org". Its
+ ;; publishing will be deferred until "theindex.inc" is
+ ;; populated.
+ (let ((theindex
+ (expand-file-name "theindex.org"
+ (org-publish-property :base-directory project))))
+ (dolist (file (org-publish-get-base-files project))
+ (unless (file-equal-p file theindex)
+ (org-publish-file file project t)))
+ ;; Populate "theindex.inc", if needed, and publish
+ ;; "theindex.org".
+ (when (org-publish-property :makeindex project)
+ (org-publish-index-generate-theindex
+ project (org-publish-property :base-directory project))
+ (org-publish-file theindex project t)))
+ (let ((fun (org-publish-property :completion-function project)))
+ (cond
+ ((functionp fun) (funcall fun plist))
+ ((consp fun) (dolist (f fun) (funcall f plist))))))
+ (org-publish-write-cache-file)))
+
+
+;;; Site map generation
+
+(defun org-publish--sitemap-files-to-lisp (files project style format-entry)
+ "Represent FILES as a parsed plain list.
+FILES is the list of files in the site map. PROJECT is the
+current project. STYLE determines is either `list' or `tree'.
+FORMAT-ENTRY is a function called on each file which should
+return a string. Return value is a list as returned by
+`org-list-to-lisp'."
+ (let ((root (expand-file-name
+ (file-name-as-directory
+ (org-publish-property :base-directory project)))))
+ (pcase style
+ (`list
+ (cons 'unordered
+ (mapcar
+ (lambda (f)
+ (list (funcall format-entry
+ (file-relative-name f root)
+ style
+ project)))
+ files)))
+ (`tree
+ (letrec ((files-only (cl-remove-if #'directory-name-p files))
+ (directories (cl-remove-if-not #'directory-name-p files))
+ (subtree-to-list
+ (lambda (dir)
+ (cons 'unordered
+ (nconc
+ ;; Files in DIR.
+ (mapcar
+ (lambda (f)
+ (list (funcall format-entry
+ (file-relative-name f root)
+ style
+ project)))
+ (cl-remove-if-not
+ (lambda (f) (string= dir (file-name-directory f)))
+ files-only))
+ ;; Direct sub-directories.
+ (mapcar
+ (lambda (sub)
+ (list (funcall format-entry
+ (file-relative-name sub root)
+ style
+ project)
+ (funcall subtree-to-list sub)))
+ (cl-remove-if-not
+ (lambda (f)
+ (string=
+ dir
+ ;; Parent directory.
+ (file-name-directory (directory-file-name f))))
+ directories)))))))
+ (funcall subtree-to-list root)))
+ (_ (user-error "Unknown site-map style: `%s'" style)))))
+
+(defun org-publish-sitemap (project &optional sitemap-filename)
+ "Create a sitemap of pages in set defined by PROJECT.
+Optionally set the filename of the sitemap with SITEMAP-FILENAME.
+Default for SITEMAP-FILENAME is `sitemap.org'."
+ (let* ((root (expand-file-name
+ (file-name-as-directory
+ (org-publish-property :base-directory project))))
+ (sitemap-filename (expand-file-name (or sitemap-filename "sitemap.org")
+ root))
+ (title (or (org-publish-property :sitemap-title project)
+ (concat "Sitemap for project " (car project))))
+ (style (or (org-publish-property :sitemap-style project)
+ 'tree))
+ (sitemap-builder (or (org-publish-property :sitemap-function project)
+ #'org-publish-sitemap-default))
+ (format-entry (or (org-publish-property :sitemap-format-entry project)
+ #'org-publish-sitemap-default-entry))
+ (sort-folders
+ (org-publish-property :sitemap-sort-folders project
+ org-publish-sitemap-sort-folders))
+ (sort-files
+ (org-publish-property :sitemap-sort-files project
+ org-publish-sitemap-sort-files))
+ (ignore-case
+ (org-publish-property :sitemap-ignore-case project
+ org-publish-sitemap-sort-ignore-case))
+ (org-file-p (lambda (f) (equal "org" (file-name-extension f))))
+ (sort-predicate
+ (lambda (a b)
+ (let ((retval t))
+ ;; First we sort files:
+ (pcase sort-files
+ (`alphabetically
+ (let ((A (if (funcall org-file-p a)
+ (concat (file-name-directory a)
+ (org-publish-find-title a project))
+ a))
+ (B (if (funcall org-file-p b)
+ (concat (file-name-directory b)
+ (org-publish-find-title b project))
+ b)))
+ (setq retval
+ (if ignore-case
+ (not (string-lessp (upcase B) (upcase A)))
+ (not (string-lessp B A))))))
+ ((or `anti-chronologically `chronologically)
+ (let* ((adate (org-publish-find-date a project))
+ (bdate (org-publish-find-date b project)))
+ (setq retval
+ (not (if (eq sort-files 'chronologically)
+ (time-less-p bdate adate)
+ (time-less-p adate bdate))))))
+ (`nil nil)
+ (_ (user-error "Invalid sort value %s" sort-files)))
+ ;; Directory-wise wins:
+ (when (memq sort-folders '(first last))
+ ;; a is directory, b not:
+ (cond
+ ((and (file-directory-p a) (not (file-directory-p b)))
+ (setq retval (eq sort-folders 'first)))
+ ;; a is not a directory, but b is:
+ ((and (not (file-directory-p a)) (file-directory-p b))
+ (setq retval (eq sort-folders 'last)))))
+ retval))))
+ (message "Generating sitemap for %s" title)
+ (with-temp-file sitemap-filename
+ (insert
+ (let ((files (remove sitemap-filename
+ (org-publish-get-base-files project))))
+ ;; Add directories, if applicable.
+ (unless (and (eq style 'list) (eq sort-folders 'ignore))
+ (setq files
+ (nconc (remove root (org-uniquify
+ (mapcar #'file-name-directory files)))
+ files)))
+ ;; Eventually sort all entries.
+ (when (or sort-files (not (memq sort-folders 'ignore)))
+ (setq files (sort files sort-predicate)))
+ (funcall sitemap-builder
+ title
+ (org-publish--sitemap-files-to-lisp
+ files project style format-entry)))))))
+
+(defun org-publish-find-property (file property project &optional backend)
+ "Find the PROPERTY of FILE in project.
+
+PROPERTY is a keyword referring to an export option, as defined
+in `org-export-options-alist' or in export back-ends. In the
+latter case, optional argument BACKEND has to be set to the
+back-end where the option is defined, e.g.,
+
+ (org-publish-find-property file :subtitle 'latex)
+
+Return value may be a string or a list, depending on the type of
+PROPERTY, i.e. \"behavior\" parameter from `org-export-options-alist'."
+ (let ((file (org-publish--expand-file-name file project)))
+ (when (and (file-readable-p file) (not (directory-name-p file)))
+ (let* ((org-inhibit-startup t)
+ (visiting (find-buffer-visiting file))
+ (buffer (or visiting (find-file-noselect file))))
+ (unwind-protect
+ (plist-get (with-current-buffer buffer
+ (if (not visiting) (org-export-get-environment backend)
+ ;; Protect local variables in open buffers.
+ (org-export-with-buffer-copy
+ (org-export-get-environment backend))))
+ property)
+ (unless visiting (kill-buffer buffer)))))))
+
+(defun org-publish-find-title (file project)
+ "Find the title of FILE in PROJECT."
+ (let ((file (org-publish--expand-file-name file project)))
+ (or (org-publish-cache-get-file-property file :title nil t)
+ (let* ((parsed-title (org-publish-find-property file :title project))
+ (title
+ (if parsed-title
+ ;; Remove property so that the return value is
+ ;; cache-able (i.e., it can be `read' back).
+ (org-no-properties
+ (org-element-interpret-data parsed-title))
+ (file-name-nondirectory (file-name-sans-extension file)))))
+ (org-publish-cache-set-file-property file :title title)))))
+
+(defun org-publish-find-date (file project)
+ "Find the date of FILE in PROJECT.
+This function assumes FILE is either a directory or an Org file.
+If FILE is an Org file and provides a DATE keyword use it. In
+any other case use the file system's modification time. Return
+time in `current-time' format."
+ (let ((file (org-publish--expand-file-name file project)))
+ (or (org-publish-cache-get-file-property file :date nil t)
+ (org-publish-cache-set-file-property
+ file :date
+ (if (file-directory-p file)
+ (file-attribute-modification-time (file-attributes file))
+ (let ((date (org-publish-find-property file :date project)))
+ ;; DATE is a secondary string. If it contains
+ ;; a time-stamp, convert it to internal format.
+ ;; Otherwise, use FILE modification time.
+ (cond ((let ((ts (and (consp date) (assq 'timestamp date))))
+ (and ts
+ (let ((value (org-element-interpret-data ts)))
+ (and (org-string-nw-p value)
+ (org-time-string-to-time value))))))
+ ((file-exists-p file)
+ (file-attribute-modification-time (file-attributes file)))
+ (t (error "No such file: \"%s\"" file)))))))))
+
+(defun org-publish-sitemap-default-entry (entry style project)
+ "Default format for site map ENTRY, as a string.
+ENTRY is a file name. STYLE is the style of the sitemap.
+PROJECT is the current project."
+ (cond ((not (directory-name-p entry))
+ (format "[[file:%s][%s]]"
+ entry
+ (org-publish-find-title entry project)))
+ ((eq style 'tree)
+ ;; Return only last subdir.
+ (file-name-nondirectory (directory-file-name entry)))
+ (t entry)))
+
+(defun org-publish-sitemap-default (title list)
+ "Default site map, as a string.
+TITLE is the title of the site map. LIST is an internal
+representation for the files to include, as returned by
+`org-list-to-lisp'. PROJECT is the current project."
+ (concat "#+TITLE: " title "\n\n"
+ (org-list-to-org list)))
+
+
+;;; Interactive publishing functions
+
+;;;###autoload
+(defalias 'org-publish-project 'org-publish)
+
+;;;###autoload
+(defun org-publish (project &optional force async)
+ "Publish PROJECT.
+
+PROJECT is either a project name, as a string, or a project
+alist (see `org-publish-project-alist' variable).
+
+When optional argument FORCE is non-nil, force publishing all
+files in PROJECT. With a non-nil optional argument ASYNC,
+publishing will be done asynchronously, in another process."
+ (interactive
+ (list (assoc (completing-read "Publish project: "
+ org-publish-project-alist nil t)
+ org-publish-project-alist)
+ current-prefix-arg))
+ (let ((project (if (not (stringp project)) project
+ ;; If this function is called in batch mode,
+ ;; PROJECT is still a string here.
+ (assoc project org-publish-project-alist))))
+ (cond
+ ((not project))
+ (async
+ (org-export-async-start (lambda (_) nil)
+ `(let ((org-publish-use-timestamps-flag
+ ,(and (not force) org-publish-use-timestamps-flag)))
+ ;; Expand components right now as external process may not
+ ;; be aware of complete `org-publish-project-alist'.
+ (org-publish-projects
+ ',(org-publish-expand-projects (list project))))))
+ (t (save-window-excursion
+ (let ((org-publish-use-timestamps-flag
+ (and (not force) org-publish-use-timestamps-flag)))
+ (org-publish-projects (list project))))))))
+
+;;;###autoload
+(defun org-publish-all (&optional force async)
+ "Publish all projects.
+With prefix argument FORCE, remove all files in the timestamp
+directory and force publishing all projects. With a non-nil
+optional argument ASYNC, publishing will be done asynchronously,
+in another process."
+ (interactive "P")
+ (if async
+ (org-export-async-start (lambda (_) nil)
+ `(progn
+ (when ',force (org-publish-remove-all-timestamps))
+ (let ((org-publish-use-timestamps-flag
+ (if ',force nil ,org-publish-use-timestamps-flag)))
+ (org-publish-projects ',org-publish-project-alist))))
+ (when force (org-publish-remove-all-timestamps))
+ (save-window-excursion
+ (let ((org-publish-use-timestamps-flag
+ (if force nil org-publish-use-timestamps-flag)))
+ (org-publish-projects org-publish-project-alist)))))
+
+
+;;;###autoload
+(defun org-publish-current-file (&optional force async)
+ "Publish the current file.
+With prefix argument FORCE, force publish the file. When
+optional argument ASYNC is non-nil, publishing will be done
+asynchronously, in another process."
+ (interactive "P")
+ (let ((file (buffer-file-name (buffer-base-buffer))))
+ (if async
+ (org-export-async-start (lambda (_) nil)
+ `(let ((org-publish-use-timestamps-flag
+ (if ',force nil ,org-publish-use-timestamps-flag)))
+ (org-publish-file ,file)))
+ (save-window-excursion
+ (let ((org-publish-use-timestamps-flag
+ (if force nil org-publish-use-timestamps-flag)))
+ (org-publish-file file))))))
+
+;;;###autoload
+(defun org-publish-current-project (&optional force async)
+ "Publish the project associated with the current file.
+With a prefix argument, force publishing of all files in
+the project."
+ (interactive "P")
+ (save-window-excursion
+ (let ((project (org-publish-get-project-from-filename
+ (buffer-file-name (buffer-base-buffer)) 'up)))
+ (if project (org-publish project force async)
+ (error "File %s is not part of any known project"
+ (buffer-file-name (buffer-base-buffer)))))))
+
+
+
+;;; Index generation
+
+(defun org-publish-collect-index (output _backend info)
+ "Update index for a file in cache.
+
+OUTPUT is the output from transcoding current file. BACKEND is
+the back-end that was used for transcoding. INFO is a plist
+containing publishing and export options.
+
+The index relative to current file is stored as an alist. An
+association has the following shape: (TERM FILE-NAME PARENT),
+where TERM is the indexed term, as a string, FILE-NAME is the
+original full path of the file where the term in encountered, and
+PARENT is a reference to the headline, if any, containing the
+original index keyword. When non-nil, this reference is a cons
+cell. Its CAR is a symbol among `id', `custom-id' and `name' and
+its CDR is a string."
+ (let ((file (file-truename (plist-get info :input-file))))
+ (org-publish-cache-set-file-property
+ file :index
+ (delete-dups
+ (org-element-map (plist-get info :parse-tree) 'keyword
+ (lambda (k)
+ (when (equal (org-element-property :key k) "INDEX")
+ (let ((parent (org-export-get-parent-headline k)))
+ (list (org-element-property :value k)
+ file
+ (cond
+ ((not parent) nil)
+ ((let ((id (org-element-property :ID parent)))
+ (and id (cons 'id id))))
+ ((let ((id (org-element-property :CUSTOM_ID parent)))
+ (and id (cons 'custom-id id))))
+ (t (cons 'name
+ ;; Remove statistics cookie.
+ (replace-regexp-in-string
+ "\\[[0-9]+%\\]\\|\\[[0-9]+/[0-9]+\\]" ""
+ (org-element-property :raw-value parent)))))))))
+ info))))
+ ;; Return output unchanged.
+ output)
+
+(defun org-publish-index-generate-theindex (project directory)
+ "Retrieve full index from cache and build \"theindex.org\".
+PROJECT is the project the index relates to. DIRECTORY is the
+publishing directory."
+ (let ((all-files (org-publish-get-base-files project))
+ full-index)
+ ;; Compile full index and sort it alphabetically.
+ (dolist (file all-files
+ (setq full-index
+ (sort (nreverse full-index)
+ (lambda (a b) (string< (downcase (car a))
+ (downcase (car b)))))))
+ (let ((index (org-publish-cache-get-file-property file :index)))
+ (dolist (term index)
+ (unless (member term full-index) (push term full-index)))))
+ ;; Write "theindex.inc" in DIRECTORY.
+ (with-temp-file (expand-file-name "theindex.inc" directory)
+ (let ((current-letter nil) (last-entry nil))
+ (dolist (idx full-index)
+ (let* ((entry (org-split-string (car idx) "!"))
+ (letter (upcase (substring (car entry) 0 1)))
+ ;; Transform file into a path relative to publishing
+ ;; directory.
+ (file (file-relative-name
+ (nth 1 idx)
+ (plist-get (cdr project) :base-directory))))
+ ;; Check if another letter has to be inserted.
+ (unless (string= letter current-letter)
+ (insert (format "* %s\n" letter)))
+ ;; Compute the first difference between last entry and
+ ;; current one: it tells the level at which new items
+ ;; should be added.
+ (let* ((rank
+ (if (equal entry last-entry) (1- (length entry))
+ (cl-loop for n from 0 to (length entry)
+ unless (equal (nth n entry) (nth n last-entry))
+ return n)))
+ (len (length (nthcdr rank entry))))
+ ;; For each term after the first difference, create
+ ;; a new sub-list with the term as body. Moreover,
+ ;; linkify the last term.
+ (dotimes (n len)
+ (insert
+ (concat
+ (make-string (* (+ rank n) 2) ?\s) " - "
+ (if (not (= (1- len) n)) (nth (+ rank n) entry)
+ ;; Last term: Link it to TARGET, if possible.
+ (let ((target (nth 2 idx)))
+ (format
+ "[[%s][%s]]"
+ ;; Destination.
+ (pcase (car target)
+ (`nil (format "file:%s" file))
+ (`id (format "id:%s" (cdr target)))
+ (`custom-id (format "file:%s::#%s" file (cdr target)))
+ (_ (format "file:%s::*%s" file (cdr target))))
+ ;; Description.
+ (car (last entry)))))
+ "\n"))))
+ (setq current-letter letter last-entry entry))))
+ ;; Create "theindex.org", if it doesn't exist yet, and provide
+ ;; a default index file.
+ (let ((index.org (expand-file-name "theindex.org" directory)))
+ (unless (file-exists-p index.org)
+ (with-temp-file index.org
+ (insert "#+TITLE: Index\n\n#+INCLUDE: \"theindex.inc\"\n\n")))))))
+
+
+
+;;; External Fuzzy Links Resolution
+;;
+;; This part implements tools to resolve [[file.org::*Some headline]]
+;; links, where "file.org" belongs to the current project.
+
+(defun org-publish--store-crossrefs (output _backend info)
+ "Store cross-references for current published file.
+
+OUTPUT is the produced output, as a string. BACKEND is the export
+back-end used, as a symbol. INFO is the final export state, as
+a plist.
+
+This function is meant to be used as a final output filter. See
+`org-publish-org-to'."
+ (org-publish-cache-set-file-property
+ (file-truename (plist-get info :input-file))
+ :crossrefs
+ ;; Update `:crossrefs' so as to remove unused references and search
+ ;; cells. Actually used references are extracted from
+ ;; `:internal-references', with references as strings removed. See
+ ;; `org-export-get-reference' for details.
+ (cl-remove-if (lambda (pair) (stringp (car pair)))
+ (plist-get info :internal-references)))
+ ;; Return output unchanged.
+ output)
+
+(defun org-publish-resolve-external-link (search file &optional prefer-custom)
+ "Return reference for element matching string SEARCH in FILE.
+
+Return value is an internal reference, as a string.
+
+This function allows resolving external links with a search
+option, e.g.,
+
+ [[file:file.org::*heading][description]]
+ [[file:file.org::#custom-id][description]]
+ [[file:file.org::fuzzy][description]]
+
+When PREFER-CUSTOM is non-nil, and SEARCH targets a headline in
+FILE, return its custom ID, if any.
+
+It only makes sense to use this if export back-end builds
+references with `org-export-get-reference'."
+ (cond
+ ((and prefer-custom
+ (if (string-prefix-p "#" search)
+ (substring search 1)
+ (with-current-buffer (find-file-noselect file)
+ (org-with-point-at 1
+ (let ((org-link-search-must-match-exact-headline t))
+ (condition-case err
+ (org-link-search search nil t)
+ (error
+ (signal 'org-link-broken (cdr err)))))
+ (and (org-at-heading-p)
+ (org-string-nw-p (org-entry-get (point) "CUSTOM_ID"))))))))
+ ((not org-publish-cache)
+ (progn
+ (message "Reference %S in file %S cannot be resolved without publishing"
+ search
+ file)
+ "MissingReference"))
+ (t
+ (let* ((filename (file-truename file))
+ (crossrefs
+ (org-publish-cache-get-file-property filename :crossrefs nil t))
+ (cells (org-export-string-to-search-cell search)))
+ (or
+ ;; Look for reference associated to search cells triggered by
+ ;; LINK. It can match when targeted file has been published
+ ;; already.
+ (let ((known (cdr (cl-some (lambda (c) (assoc c crossrefs)) cells))))
+ (and known (org-export-format-reference known)))
+ ;; Search cell is unknown so far. Generate a new internal
+ ;; reference that will be used when the targeted file will be
+ ;; published.
+ (let ((new (org-export-new-reference crossrefs)))
+ (dolist (cell cells) (push (cons cell new) crossrefs))
+ (org-publish-cache-set-file-property filename :crossrefs crossrefs)
+ (org-export-format-reference new)))))))
+
+(defun org-publish-file-relative-name (filename info)
+ "Convert FILENAME to be relative to current project's base directory.
+INFO is the plist containing the current export state. The
+function does not change relative file names."
+ (let ((base (plist-get info :base-directory)))
+ (if (and base
+ (file-name-absolute-p filename)
+ (file-in-directory-p filename base))
+ (file-relative-name filename base)
+ filename)))
+
+
+
+;;; Caching functions
+
+(defun org-publish-write-cache-file (&optional free-cache)
+ "Write `org-publish-cache' to file.
+If FREE-CACHE, empty the cache."
+ (unless org-publish-cache
+ (error "`org-publish-write-cache-file' called, but no cache present"))
+
+ (let ((cache-file (org-publish-cache-get ":cache-file:")))
+ (unless cache-file
+ (error "Cannot find cache-file name in `org-publish-write-cache-file'"))
+ (with-temp-file cache-file
+ (let (print-level print-length)
+ (insert "(setq org-publish-cache \
+\(make-hash-table :test 'equal :weakness nil :size 100))\n")
+ (maphash (lambda (k v)
+ (insert
+ (format "(puthash %S %s%S org-publish-cache)\n"
+ k (if (or (listp v) (symbolp v)) "'" "") v)))
+ org-publish-cache)))
+ (when free-cache (org-publish-reset-cache))))
+
+(defun org-publish-initialize-cache (project-name)
+ "Initialize the projects cache if not initialized yet and return it."
+
+ (unless project-name
+ (error "Cannot initialize `org-publish-cache' without projects name in \
+`org-publish-initialize-cache'"))
+
+ (unless (file-exists-p org-publish-timestamp-directory)
+ (make-directory org-publish-timestamp-directory t))
+ (unless (file-directory-p org-publish-timestamp-directory)
+ (error "Org publish timestamp: %s is not a directory"
+ org-publish-timestamp-directory))
+
+ (unless (and org-publish-cache
+ (string= (org-publish-cache-get ":project:") project-name))
+ (let* ((cache-file
+ (concat
+ (expand-file-name org-publish-timestamp-directory)
+ project-name ".cache"))
+ (cexists (file-exists-p cache-file)))
+
+ (when org-publish-cache (org-publish-reset-cache))
+
+ (if cexists (load-file cache-file)
+ (setq org-publish-cache
+ (make-hash-table :test 'equal :weakness nil :size 100))
+ (org-publish-cache-set ":project:" project-name)
+ (org-publish-cache-set ":cache-file:" cache-file))
+ (unless cexists (org-publish-write-cache-file nil))))
+ org-publish-cache)
+
+(defun org-publish-reset-cache ()
+ "Empty `org-publish-cache' and reset it nil."
+ (message "%s" "Resetting org-publish-cache")
+ (when (hash-table-p org-publish-cache)
+ (clrhash org-publish-cache))
+ (setq org-publish-cache nil))
+
+(defun org-publish-cache-file-needs-publishing
+ (filename &optional pub-dir pub-func _base-dir)
+ "Check the timestamp of the last publishing of FILENAME.
+Return non-nil if the file needs publishing. Also check if
+any included files have been more recently published, so that
+the file including them will be republished as well."
+ (unless org-publish-cache
+ (error
+ "`org-publish-cache-file-needs-publishing' called, but no cache present"))
+ (let* ((key (org-publish-timestamp-filename filename pub-dir pub-func))
+ (pstamp (org-publish-cache-get key))
+ (org-inhibit-startup t)
+ included-files-ctime)
+ (when (equal (file-name-extension filename) "org")
+ (let ((case-fold-search t))
+ (with-temp-buffer
+ (delay-mode-hooks
+ (org-mode)
+ (insert-file-contents filename)
+ (goto-char (point-min))
+ (while (re-search-forward "^[ \t]*#\\+INCLUDE:" nil t)
+ (let ((element (org-element-at-point)))
+ (when (eq 'keyword (org-element-type element))
+ (let* ((value (org-element-property :value element))
+ (include-filename
+ (and (string-match "\\`\\(\".+?\"\\|\\S-+\\)" value)
+ (let ((m (org-strip-quotes
+ (match-string 1 value))))
+ ;; Ignore search suffix.
+ (if (string-match "::.*?\\'" m)
+ (substring m 0 (match-beginning 0))
+ m)))))
+ (when include-filename
+ (push (org-publish-cache-ctime-of-src
+ (expand-file-name include-filename (file-name-directory filename)))
+ included-files-ctime))))))))))
+ (or (null pstamp)
+ (let ((ctime (org-publish-cache-ctime-of-src filename)))
+ (or (time-less-p pstamp ctime)
+ (cl-some (lambda (ct) (time-less-p ctime ct))
+ included-files-ctime))))))
+
+(defun org-publish-cache-set-file-property
+ (filename property value &optional project-name)
+ "Set the VALUE for a PROPERTY of file FILENAME in publishing cache to VALUE.
+Use cache file of PROJECT-NAME. If the entry does not exist, it
+will be created. Return VALUE."
+ ;; Evtl. load the requested cache file:
+ (when project-name (org-publish-initialize-cache project-name))
+ (let ((pl (org-publish-cache-get filename)))
+ (if pl (progn (plist-put pl property value) value)
+ (org-publish-cache-get-file-property
+ filename property value nil project-name))))
+
+(defun org-publish-cache-get-file-property
+ (filename property &optional default no-create project-name)
+ "Return the value for a PROPERTY of file FILENAME in publishing cache.
+Use cache file of PROJECT-NAME. Return the value of that PROPERTY,
+or DEFAULT, if the value does not yet exist. Create the entry,
+if necessary, unless NO-CREATE is non-nil."
+ (when project-name (org-publish-initialize-cache project-name))
+ (let ((properties (org-publish-cache-get filename)))
+ (cond ((null properties)
+ (unless no-create
+ (org-publish-cache-set filename (list property default)))
+ default)
+ ((plist-member properties property) (plist-get properties property))
+ (t default))))
+
+(defun org-publish-cache-get (key)
+ "Return the value stored in `org-publish-cache' for key KEY.
+Return nil, if no value or nil is found. Raise an error if the
+cache does not exist."
+ (unless org-publish-cache
+ (error "`org-publish-cache-get' called, but no cache present"))
+ (gethash key org-publish-cache))
+
+(defun org-publish-cache-set (key value)
+ "Store KEY VALUE pair in `org-publish-cache'.
+Returns value on success, else nil. Raise an error if the cache
+does not exist."
+ (unless org-publish-cache
+ (error "`org-publish-cache-set' called, but no cache present"))
+ (puthash key value org-publish-cache))
+
+(defun org-publish-cache-ctime-of-src (file)
+ "Get the ctime of FILE as an integer."
+ (let ((attr (file-attributes
+ (expand-file-name (or (file-symlink-p file) file)
+ (file-name-directory file)))))
+ (if attr (file-attribute-modification-time attr)
+ (error "No such file: %S" file))))
+
+
+(provide 'ox-publish)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ox-publish.el ends here
diff --git a/elpa/org-9.5.2/ox-publish.elc b/elpa/org-9.5.2/ox-publish.elc
new file mode 100644
index 0000000..29ac5da
--- /dev/null
+++ b/elpa/org-9.5.2/ox-publish.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ox-texinfo.el b/elpa/org-9.5.2/ox-texinfo.el
new file mode 100644
index 0000000..46077ec
--- /dev/null
+++ b/elpa/org-9.5.2/ox-texinfo.el
@@ -0,0 +1,1757 @@
+;;; ox-texinfo.el --- Texinfo Back-End for Org Export Engine -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
+;; Author: Jonathan Leech-Pepin <jonathan.leechpepin at gmail dot com>
+;; Maintainer: Nicolas Goaziou <n.goaziou at gmail dot com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; See Org manual for details.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ox)
+
+(defvar orgtbl-exp-regexp)
+
+
+
+;;; Define Back-End
+
+(org-export-define-backend 'texinfo
+ '((bold . org-texinfo-bold)
+ (center-block . org-texinfo-center-block)
+ (clock . org-texinfo-clock)
+ (code . org-texinfo-code)
+ (drawer . org-texinfo-drawer)
+ (dynamic-block . org-texinfo-dynamic-block)
+ (entity . org-texinfo-entity)
+ (example-block . org-texinfo-example-block)
+ (export-block . org-texinfo-export-block)
+ (export-snippet . org-texinfo-export-snippet)
+ (fixed-width . org-texinfo-fixed-width)
+ (footnote-definition . org-texinfo-footnote-definition)
+ (footnote-reference . org-texinfo-footnote-reference)
+ (headline . org-texinfo-headline)
+ (inline-src-block . org-texinfo-inline-src-block)
+ (inlinetask . org-texinfo-inlinetask)
+ (italic . org-texinfo-italic)
+ (item . org-texinfo-item)
+ (keyword . org-texinfo-keyword)
+ (line-break . org-texinfo-line-break)
+ (link . org-texinfo-link)
+ (node-property . org-texinfo-node-property)
+ (paragraph . org-texinfo-paragraph)
+ (plain-list . org-texinfo-plain-list)
+ (plain-text . org-texinfo-plain-text)
+ (planning . org-texinfo-planning)
+ (property-drawer . org-texinfo-property-drawer)
+ (quote-block . org-texinfo-quote-block)
+ (radio-target . org-texinfo-radio-target)
+ (section . org-texinfo-section)
+ (special-block . org-texinfo-special-block)
+ (src-block . org-texinfo-src-block)
+ (statistics-cookie . org-texinfo-statistics-cookie)
+ (strike-through . org-texinfo-strike-through)
+ (subscript . org-texinfo-subscript)
+ (superscript . org-texinfo-superscript)
+ (table . org-texinfo-table)
+ (table-cell . org-texinfo-table-cell)
+ (table-row . org-texinfo-table-row)
+ (target . org-texinfo-target)
+ (template . org-texinfo-template)
+ (timestamp . org-texinfo-timestamp)
+ (underline . org-texinfo-underline)
+ (verbatim . org-texinfo-verbatim)
+ (verse-block . org-texinfo-verse-block))
+ :filters-alist
+ '((:filter-headline . org-texinfo--filter-section-blank-lines)
+ (:filter-parse-tree . org-texinfo--normalize-headlines)
+ (:filter-section . org-texinfo--filter-section-blank-lines)
+ (:filter-final-output . org-texinfo--untabify))
+ :menu-entry
+ '(?i "Export to Texinfo"
+ ((?t "As TEXI file" org-texinfo-export-to-texinfo)
+ (?i "As INFO file" org-texinfo-export-to-info)
+ (?o "As INFO file and open"
+ (lambda (a s v b)
+ (if a (org-texinfo-export-to-info t s v b)
+ (org-open-file (org-texinfo-export-to-info nil s v b)))))))
+ :options-alist
+ '((:texinfo-filename "TEXINFO_FILENAME" nil nil t)
+ (:texinfo-class "TEXINFO_CLASS" nil org-texinfo-default-class t)
+ (:texinfo-header "TEXINFO_HEADER" nil nil newline)
+ (:texinfo-post-header "TEXINFO_POST_HEADER" nil nil newline)
+ (:subtitle "SUBTITLE" nil nil parse)
+ (:subauthor "SUBAUTHOR" nil nil newline)
+ (:texinfo-dircat "TEXINFO_DIR_CATEGORY" nil nil t)
+ (:texinfo-dirtitle "TEXINFO_DIR_TITLE" nil nil t)
+ (:texinfo-dirdesc "TEXINFO_DIR_DESC" nil nil t)
+ (:texinfo-printed-title "TEXINFO_PRINTED_TITLE" nil nil t)
+ ;; Other variables.
+ (:texinfo-classes nil nil org-texinfo-classes)
+ (:texinfo-format-headline-function nil nil org-texinfo-format-headline-function)
+ (:texinfo-node-description-column nil nil org-texinfo-node-description-column)
+ (:texinfo-active-timestamp-format nil nil org-texinfo-active-timestamp-format)
+ (:texinfo-inactive-timestamp-format nil nil org-texinfo-inactive-timestamp-format)
+ (:texinfo-diary-timestamp-format nil nil org-texinfo-diary-timestamp-format)
+ (:texinfo-link-with-unknown-path-format nil nil org-texinfo-link-with-unknown-path-format)
+ (:texinfo-tables-verbatim nil nil org-texinfo-tables-verbatim)
+ (:texinfo-table-scientific-notation nil nil org-texinfo-table-scientific-notation)
+ (:texinfo-table-default-markup nil nil org-texinfo-table-default-markup)
+ (:texinfo-text-markup-alist nil nil org-texinfo-text-markup-alist)
+ (:texinfo-format-drawer-function nil nil org-texinfo-format-drawer-function)
+ (:texinfo-format-inlinetask-function nil nil org-texinfo-format-inlinetask-function)))
+
+
+
+;;; User Configurable Variables
+
+(defgroup org-export-texinfo nil
+ "Options for exporting Org mode files to Texinfo."
+ :tag "Org Export Texinfo"
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :group 'org-export)
+
+;;;; Preamble
+
+(defcustom org-texinfo-coding-system nil
+ "Default document encoding for Texinfo output.
+
+If nil it will default to `buffer-file-coding-system'."
+ :group 'org-export-texinfo
+ :type 'coding-system)
+
+(defcustom org-texinfo-default-class "info"
+ "The default Texinfo class."
+ :group 'org-export-texinfo
+ :type '(string :tag "Texinfo class"))
+
+(defcustom org-texinfo-classes
+ '(("info"
+ "@documentencoding AUTO\n@documentlanguage AUTO"
+ ("@chapter %s" "@unnumbered %s" "@chapheading %s" "@appendix %s")
+ ("@section %s" "@unnumberedsec %s" "@heading %s" "@appendixsec %s")
+ ("@subsection %s" "@unnumberedsubsec %s" "@subheading %s"
+ "@appendixsubsec %s")
+ ("@subsubsection %s" "@unnumberedsubsubsec %s" "@subsubheading %s"
+ "@appendixsubsubsec %s")))
+ "Alist of Texinfo classes and associated header and structure.
+If #+TEXINFO_CLASS is set in the buffer, use its value and the
+associated information. Here is the structure of a class
+definition:
+
+ (class-name
+ header-string
+ (numbered-1 unnumbered-1 unnumbered-no-toc-1 appendix-1)
+ (numbered-2 unnumbered-2 unnumbered-no-toc-2 appendix-2)
+ ...)
+
+
+The header string
+-----------------
+
+The header string is inserted in the header of the generated
+document, right after \"@setfilename\" and \"@settitle\"
+commands.
+
+If it contains the special string
+
+ \"@documentencoding AUTO\"
+
+\"AUTO\" will be replaced with an appropriate coding system. See
+`org-texinfo-coding-system' for more information. Likewise, if
+the string contains the special string
+
+ \"@documentlanguage AUTO\"
+
+\"AUTO\" will be replaced with the language defined in the
+buffer, through #+LANGUAGE keyword, or globally, with
+`org-export-default-language', which see.
+
+
+The sectioning structure
+------------------------
+
+The sectioning structure of the class is given by the elements
+following the header string. For each sectioning level, a number
+of strings is specified. A %s formatter is mandatory in each
+section string and will be replaced by the title of the section."
+ :group 'org-export-texinfo
+ :version "27.1"
+ :package-version '(Org . "9.2")
+ :type '(repeat
+ (list (string :tag "Texinfo class")
+ (string :tag "Texinfo header")
+ (repeat :tag "Levels" :inline t
+ (choice
+ (list :tag "Heading"
+ (string :tag " numbered")
+ (string :tag " unnumbered")
+ (string :tag "unnumbered-no-toc")
+ (string :tag " appendix")))))))
+
+;;;; Headline
+
+(defcustom org-texinfo-format-headline-function
+ 'org-texinfo-format-headline-default-function
+ "Function to format headline text.
+
+This function will be called with 5 arguments:
+TODO the todo keyword (string or nil).
+TODO-TYPE the type of todo (symbol: `todo', `done', nil)
+PRIORITY the priority of the headline (integer or nil)
+TEXT the main headline text (string).
+TAGS the tags as a list of strings (list of strings or nil).
+
+The function result will be used in the section format string."
+ :group 'org-export-texinfo
+ :type 'function
+ :version "26.1"
+ :package-version '(Org . "8.3"))
+
+;;;; Node listing (menu)
+
+(defcustom org-texinfo-node-description-column 32
+ "Column at which to start the description in the node listings.
+If a node title is greater than this length, the description will
+be placed after the end of the title."
+ :group 'org-export-texinfo
+ :type 'integer)
+
+;;;; Timestamps
+
+(defcustom org-texinfo-active-timestamp-format "@emph{%s}"
+ "A printf format string to be applied to active timestamps."
+ :group 'org-export-texinfo
+ :type 'string)
+
+(defcustom org-texinfo-inactive-timestamp-format "@emph{%s}"
+ "A printf format string to be applied to inactive timestamps."
+ :group 'org-export-texinfo
+ :type 'string)
+
+(defcustom org-texinfo-diary-timestamp-format "@emph{%s}"
+ "A printf format string to be applied to diary timestamps."
+ :group 'org-export-texinfo
+ :type 'string)
+
+;;;; Links
+
+(defcustom org-texinfo-link-with-unknown-path-format "@indicateurl{%s}"
+ "Format string for links with unknown path type."
+ :group 'org-export-texinfo
+ :type 'string)
+
+;;;; Tables
+
+(defcustom org-texinfo-tables-verbatim nil
+ "When non-nil, tables are exported verbatim."
+ :group 'org-export-texinfo
+ :type 'boolean)
+
+(defcustom org-texinfo-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}\").
+
+When nil, no transformation is made."
+ :group 'org-export-texinfo
+ :type '(choice
+ (string :tag "Format string")
+ (const :tag "No formatting" nil)))
+
+(defcustom org-texinfo-table-default-markup "@asis"
+ "Default markup for first column in two-column tables.
+
+This should an indicating command, e.g., \"@code\", \"@kbd\" or
+\"@samp\".
+
+It can be overridden locally using the \":indic\" attribute."
+ :group 'org-export-texinfo
+ :type 'string
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :safe #'stringp)
+
+;;;; Text markup
+
+(defcustom org-texinfo-text-markup-alist '((bold . "@strong{%s}")
+ (code . code)
+ (italic . "@emph{%s}")
+ (verbatim . samp))
+ "Alist of Texinfo expressions to convert text markup.
+
+The key must be a symbol among `bold', `code', `italic',
+`strike-through', `underscore' and `verbatim'. The value is
+a formatting string to wrap fontified text with.
+
+Value can also be set to the following symbols: `verb', `samp'
+and `code'. With the first one, Org uses \"@verb\" to create
+a format string and selects a delimiter character that isn't in
+the string. For the other two, Org uses \"@samp\" or \"@code\"
+to typeset and protects special characters.
+
+When no association is found for a given markup, text is returned
+as-is."
+ :group 'org-export-texinfo
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :type 'alist
+ :options '(bold code italic strike-through underscore verbatim))
+
+;;;; Drawers
+
+(defcustom org-texinfo-format-drawer-function (lambda (_name contents) contents)
+ "Function called to format a drawer in Texinfo code.
+
+The function must accept two parameters:
+ NAME the drawer name, like \"LOGBOOK\"
+ CONTENTS the contents of the drawer.
+
+The function should return the string to be exported.
+
+The default function simply returns the value of CONTENTS."
+ :group 'org-export-texinfo
+ :version "24.4"
+ :package-version '(Org . "8.2")
+ :type 'function)
+
+;;;; Inlinetasks
+
+(defcustom org-texinfo-format-inlinetask-function
+ 'org-texinfo-format-inlinetask-default-function
+ "Function called to format an inlinetask in Texinfo code.
+
+The function must accept six parameters:
+ TODO the todo keyword, as a string
+ TODO-TYPE the todo type, a symbol among `todo', `done' and nil.
+ PRIORITY the inlinetask priority, as a string
+ NAME the inlinetask name, as a string.
+ TAGS the inlinetask tags, as a list of strings.
+ CONTENTS the contents of the inlinetask, as a string.
+
+The function should return the string to be exported."
+ :group 'org-export-texinfo
+ :type 'function)
+
+;;;; Compilation
+
+(defcustom org-texinfo-info-process '("makeinfo --no-split %f")
+ "Commands to process a Texinfo file to an INFO file.
+
+This is a list of strings, each of them will be given to the
+shell as a command. %f in the command will be replaced by the
+relative file name, %F by the absolute file name, %b by the file
+base name (i.e. without directory and extension parts), %o by the
+base directory of the file and %O by the absolute file name of
+the output file."
+ :group 'org-export-texinfo
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :type '(repeat :tag "Shell command sequence"
+ (string :tag "Shell command")))
+
+(defcustom org-texinfo-logfiles-extensions
+ '("aux" "toc" "cp" "fn" "ky" "pg" "tp" "vr")
+ "The list of file extensions to consider as Texinfo logfiles.
+The logfiles will be remove if `org-texinfo-remove-logfiles' is
+non-nil."
+ :group 'org-export-texinfo
+ :type '(repeat (string :tag "Extension")))
+
+(defcustom org-texinfo-remove-logfiles t
+ "Non-nil means remove the logfiles produced by compiling a Texinfo file.
+By default, logfiles are files with these extensions: .aux, .toc,
+.cp, .fn, .ky, .pg and .tp. To define the set of logfiles to remove,
+set `org-texinfo-logfiles-extensions'."
+ :group 'org-export-latex
+ :type 'boolean)
+
+;;; Constants
+
+(defconst org-texinfo-max-toc-depth 4
+ "Maximum depth for creation of detailed menu listings.
+Beyond this depth, Texinfo will not recognize the nodes and will
+cause errors. Left as a constant in case this value ever
+changes.")
+
+(defconst org-texinfo-supported-coding-systems
+ '("US-ASCII" "UTF-8" "ISO-8859-15" "ISO-8859-1" "ISO-8859-2" "koi8-r" "koi8-u")
+ "List of coding systems supported by Texinfo, as strings.
+Specified coding system will be matched against these strings.
+If two strings share the same prefix (e.g. \"ISO-8859-1\" and
+\"ISO-8859-15\"), the most specific one has to be listed first.")
+
+(defconst org-texinfo-inline-image-rules
+ (list (cons "file"
+ (regexp-opt '("eps" "pdf" "png" "jpg" "jpeg" "gif" "svg"))))
+ "Rules characterizing image files that can be inlined.")
+
+
+;;; Internal Functions
+
+(defun org-texinfo--untabify (s _backend _info)
+ "Remove TAB characters in string S."
+ (replace-regexp-in-string "\t" (make-string tab-width ?\s) s))
+
+(defun org-texinfo--filter-section-blank-lines (headline _backend _info)
+ "Filter controlling number of blank lines after a section."
+ (replace-regexp-in-string "\n\\(?:\n[ \t]*\\)*\\'" "\n\n" headline))
+
+(defun org-texinfo--normalize-headlines (tree _backend info)
+ "Normalize headlines in TREE.
+
+BACK-END is the symbol specifying back-end used for export.
+INFO is a plist used as a communication channel.
+
+Make sure every headline in TREE contains a section, since those
+are required to install a menu. Also put exactly one blank line
+at the end of each section.
+
+Return new tree."
+ (org-element-map tree 'headline
+ (lambda (hl)
+ (org-element-put-property hl :post-blank 1)
+ (let ((contents (org-element-contents hl)))
+ (when contents
+ (let ((first (org-element-map contents '(headline section)
+ #'identity info t)))
+ (unless (eq (org-element-type first) 'section)
+ (apply #'org-element-set-contents
+ hl
+ (cons `(section (:parent ,hl)) contents)))))))
+ info)
+ tree)
+
+(defun org-texinfo--find-verb-separator (s)
+ "Return a character not used in string S.
+This is used to choose a separator for constructs like \\verb."
+ (let ((ll "~,./?;':\"|!@#%^&-_=+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ<>()[]{}"))
+ (cl-loop for c across ll
+ when (not (string-match (regexp-quote (char-to-string c)) s))
+ return (char-to-string c))))
+
+(defun org-texinfo--text-markup (text markup _info)
+ "Format TEXT depending on MARKUP text markup.
+INFO is a plist used as a communication channel. See
+`org-texinfo-text-markup-alist' for details."
+ (pcase (cdr (assq markup org-texinfo-text-markup-alist))
+ (`nil text) ;no markup: return raw text
+ (`code (format "@code{%s}" (org-texinfo--sanitize-content text)))
+ (`samp (format "@samp{%s}" (org-texinfo--sanitize-content text)))
+ (`verb
+ (let ((separator (org-texinfo--find-verb-separator text)))
+ (format "@verb{%s%s%s}" separator text separator)))
+ ;; Else use format string.
+ (fmt (format fmt text))))
+
+(defun org-texinfo--get-node (datum info)
+ "Return node or anchor associated to DATUM.
+DATUM is a headline, a radio-target or a target. INFO is a plist
+used as a communication channel. The function guarantees the
+node or anchor name is unique."
+ (let ((cache (plist-get info :texinfo-node-cache)))
+ (or (cdr (assq datum cache))
+ (let* ((salt 0)
+ (basename
+ (org-texinfo--sanitize-node
+ (pcase (org-element-type datum)
+ (`headline
+ (org-texinfo--sanitize-title
+ (org-export-get-alt-title datum info) info))
+ (`radio-target
+ (org-export-data (org-element-contents datum) info))
+ (`target
+ (org-element-property :value datum))
+ (_
+ (or (org-element-property :name datum)
+ (org-export-get-reference datum info))))))
+ (name basename))
+ ;; Org exports deeper elements before their parents. If two
+ ;; node names collide -- e.g., they have the same title --
+ ;; within the same hierarchy, the second one would get the
+ ;; smaller node name. This is counter-intuitive.
+ ;; Consequently, we ensure that every parent headline gets
+ ;; its node beforehand. As a recursive operation, this
+ ;; achieves the desired effect.
+ (let ((parent (org-element-lineage datum '(headline))))
+ (when (and parent (not (assq parent cache)))
+ (org-texinfo--get-node parent info)
+ (setq cache (plist-get info :texinfo-node-cache))))
+ ;; Ensure NAME is unique and not reserved node name "Top",
+ ;; no matter what case is used.
+ (while (or (string-equal "Top" (capitalize name))
+ (rassoc name cache))
+ (setq name (concat basename (format " (%d)" (cl-incf salt)))))
+ (plist-put info :texinfo-node-cache (cons (cons datum name) cache))
+ name))))
+
+(defun org-texinfo--sanitize-node (title)
+ "Bend string TITLE to node line requirements.
+Trim string and collapse multiple whitespace characters as they
+are not significant. Replace leading left parenthesis, when
+followed by a right parenthesis, with a square bracket. Remove
+periods, commas and colons."
+ (org-trim
+ (replace-regexp-in-string
+ "[ \t]+" " "
+ (replace-regexp-in-string
+ "[:,.]" ""
+ (replace-regexp-in-string "\\`(\\(.*?)\\)" "[\\1" title)))))
+
+(defun org-texinfo--sanitize-title (title info)
+ "Make TITLE suitable as a section name.
+TITLE is a string or a secondary string. INFO is the current
+export state, as a plist."
+ (org-export-data-with-backend
+ title (org-export-toc-entry-backend 'texinfo) info))
+
+(defun org-texinfo--sanitize-content (text)
+ "Escape special characters in string TEXT.
+Special characters are: @ { }"
+ (replace-regexp-in-string "[@{}]" "@\\&" text))
+
+(defun org-texinfo--wrap-float (value info &optional type label caption short)
+ "Wrap string VALUE within a @float command.
+INFO is the current export state, as a plist. TYPE is float
+type, as a string. LABEL is the cross reference label for the
+float, as a string. CAPTION and SHORT are, respectively, the
+caption and shortcaption used for the float, as secondary
+strings (e.g., returned by `org-export-get-caption')."
+ (let* ((backend
+ (org-export-toc-entry-backend 'texinfo
+ (cons 'footnote-reference
+ (lambda (f c i) (org-export-with-backend 'texinfo f c i)))))
+ (short-backend
+ (org-export-toc-entry-backend 'texinfo
+ '(inline-src-block . ignore)
+ '(verbatim . ignore)))
+ (short-str
+ (if (and short caption)
+ (format "@shortcaption{%s}\n"
+ (org-export-data-with-backend short short-backend info))
+ ""))
+ (caption-str
+ (if (or short caption)
+ (format "@caption{%s}\n"
+ (org-export-data-with-backend
+ (or caption short)
+ (if (equal short-str "") short-backend backend)
+ info))
+ "")))
+ (format "@float %s%s\n%s\n%s%s@end float"
+ type (if label (concat "," label) "") value caption-str short-str)))
+
+(defun org-texinfo--sectioning-structure (info)
+ "Return sectioning structure used in the document.
+INFO is a plist holding export options."
+ (let ((class (plist-get info :texinfo-class)))
+ (pcase (assoc class (plist-get info :texinfo-classes))
+ (`(,_ ,_ . ,sections) sections)
+ (_ (user-error "Unknown Texinfo class: %S" class)))))
+
+;;; Template
+
+(defun org-texinfo-template (contents info)
+ "Return complete document string after Texinfo conversion.
+CONTENTS is the transcoded contents string. INFO is a plist
+holding export options."
+ (let ((title (org-export-data (plist-get info :title) info))
+ ;; Copying data is the contents of the first headline in
+ ;; parse tree with a non-nil copying property.
+ (copying (org-element-map (plist-get info :parse-tree) 'headline
+ (lambda (hl)
+ (and (org-not-nil (org-element-property :COPYING hl))
+ (org-element-contents hl)))
+ info t)))
+ (concat
+ "\\input texinfo @c -*- texinfo -*-\n"
+ "@c %**start of header\n"
+ (let ((file (or (org-strip-quotes (plist-get info :texinfo-filename))
+ (let ((f (plist-get info :output-file)))
+ (and f (concat (file-name-sans-extension f) ".info"))))))
+ (and file (format "@setfilename %s\n" file)))
+ (format "@settitle %s\n" title)
+ ;; Insert class-defined header.
+ (org-element-normalize-string
+ (let ((header (nth 1 (assoc (plist-get info :texinfo-class)
+ org-texinfo-classes)))
+ (coding
+ (catch 'coding-system
+ (let ((case-fold-search t)
+ (name (symbol-name (or org-texinfo-coding-system
+ buffer-file-coding-system))))
+ (dolist (system org-texinfo-supported-coding-systems "UTF-8")
+ (when (string-match-p (regexp-quote system) name)
+ (throw 'coding-system system))))))
+ (language (plist-get info :language))
+ (case-fold-search nil))
+ ;; Auto coding system.
+ (replace-regexp-in-string
+ "^@documentencoding \\(AUTO\\)$"
+ coding
+ (replace-regexp-in-string
+ "^@documentlanguage \\(AUTO\\)$" language header t nil 1)
+ t nil 1)))
+ ;; Additional header options set by #+TEXINFO_HEADER.
+ (let ((texinfo-header (plist-get info :texinfo-header)))
+ (and texinfo-header (org-element-normalize-string texinfo-header)))
+ "@c %**end of header\n\n"
+ ;; Additional options set by #+TEXINFO_POST_HEADER.
+ (let ((texinfo-post-header (plist-get info :texinfo-post-header)))
+ (and texinfo-post-header
+ (org-element-normalize-string texinfo-post-header)))
+ ;; Copying.
+ (and copying
+ (format "@copying\n%s@end copying\n\n"
+ (org-element-normalize-string
+ (org-export-data copying info))))
+ ;; Info directory information. Only supply if both title and
+ ;; category are provided.
+ (let ((dircat (plist-get info :texinfo-dircat))
+ (dirtitle
+ (let ((title (plist-get info :texinfo-dirtitle)))
+ (and title
+ (string-match "^\\(?:\\* \\)?\\(.*?\\)\\(\\.\\)?$" title)
+ (format "* %s." (match-string 1 title))))))
+ (when (and dircat dirtitle)
+ (concat "@dircategory " dircat "\n"
+ "@direntry\n"
+ (let ((dirdesc
+ (let ((desc (plist-get info :texinfo-dirdesc)))
+ (cond ((not desc) nil)
+ ((string-suffix-p "." desc) desc)
+ (t (concat desc "."))))))
+ (if dirdesc (format "%-23s %s" dirtitle dirdesc) dirtitle))
+ "\n"
+ "@end direntry\n\n")))
+ ;; Title
+ "@finalout\n"
+ "@titlepage\n"
+ (when (plist-get info :with-title)
+ (concat
+ (format "@title %s\n"
+ (or (plist-get info :texinfo-printed-title) title ""))
+ (let ((subtitle (plist-get info :subtitle)))
+ (when subtitle
+ (format "@subtitle %s\n"
+ (org-export-data subtitle info))))))
+ (when (plist-get info :with-author)
+ (concat
+ ;; Primary author.
+ (let ((author (org-string-nw-p
+ (org-export-data (plist-get info :author) info)))
+ (email (and (plist-get info :with-email)
+ (org-string-nw-p
+ (org-export-data (plist-get info :email) info)))))
+ (cond ((and author email)
+ (format "@author %s (@email{%s})\n" author email))
+ (author (format "@author %s\n" author))
+ (email (format "@author @email{%s}\n" email))))
+ ;; Other authors.
+ (let ((subauthor (plist-get info :subauthor)))
+ (and subauthor
+ (org-element-normalize-string
+ (replace-regexp-in-string "^" "@author " subauthor))))))
+ (and copying "@page\n@vskip 0pt plus 1filll\n@insertcopying\n")
+ "@end titlepage\n\n"
+ ;; Table of contents.
+ (and (plist-get info :with-toc) "@contents\n\n")
+ ;; Configure Top Node when not for TeX. Also include contents
+ ;; from the first section of the document.
+ "@ifnottex\n"
+ "@node Top\n"
+ (format "@top %s\n" title)
+ (let* ((first-section
+ (org-element-map (plist-get info :parse-tree) 'section
+ #'identity info t '(headline)))
+ (top-contents
+ (org-export-data (org-element-contents first-section) info)))
+ (and (org-string-nw-p top-contents) (concat "\n" top-contents)))
+ "@end ifnottex\n\n"
+ ;; Menu.
+ (org-texinfo-make-menu (plist-get info :parse-tree) info 'master)
+ "\n"
+ ;; Document's body.
+ contents "\n"
+ ;; Creator.
+ (and (plist-get info :with-creator)
+ (concat (plist-get info :creator) "\n"))
+ ;; Document end.
+ "@bye")))
+
+
+
+;;; Transcode Functions
+
+;;;; Bold
+
+(defun org-texinfo-bold (_bold contents info)
+ "Transcode BOLD from Org to Texinfo.
+CONTENTS is the text with bold markup. INFO is a plist holding
+contextual information."
+ (org-texinfo--text-markup contents 'bold info))
+
+;;;; Center Block
+
+(defun org-texinfo-center-block (_center-block contents _info)
+ "Transcode a CENTER-BLOCK element from Org to Texinfo.
+CONTENTS holds the contents of the block. INFO is a plist used
+as a communication channel."
+ (replace-regexp-in-string "\\(^\\).*?\\S-" "@center " contents nil nil 1))
+
+;;;; Clock
+
+(defun org-texinfo-clock (clock _contents info)
+ "Transcode a CLOCK element from Org to Texinfo.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (concat
+ "@noindent"
+ (format "@strong{%s} " org-clock-string)
+ (format (plist-get info :texinfo-inactive-timestamp-format)
+ (concat (org-timestamp-translate (org-element-property :value clock))
+ (let ((time (org-element-property :duration clock)))
+ (and time (format " (%s)" time)))))
+ "@*"))
+
+;;;; Code
+
+(defun org-texinfo-code (code _contents info)
+ "Transcode a CODE object from Org to Texinfo.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (org-texinfo--text-markup (org-element-property :value code) 'code info))
+
+;;;; Drawer
+
+(defun org-texinfo-drawer (drawer contents info)
+ "Transcode a DRAWER element from Org to Texinfo.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (let* ((name (org-element-property :drawer-name drawer))
+ (output (funcall (plist-get info :texinfo-format-drawer-function)
+ name contents)))
+ output))
+
+;;;; Dynamic Block
+
+(defun org-texinfo-dynamic-block (_dynamic-block contents _info)
+ "Transcode a DYNAMIC-BLOCK element from Org to Texinfo.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ contents)
+
+;;;; Entity
+
+(defun org-texinfo-entity (entity _contents _info)
+ "Transcode an ENTITY object from Org to Texinfo."
+ ;; Since there is not specific Texinfo entry in entities, use
+ ;; Texinfo-specific commands whenever possible, and fallback to
+ ;; UTF-8 otherwise.
+ (pcase (org-element-property :name entity)
+ ("AElig" "@AE{}")
+ ("aelig" "@ae{}")
+ ((or "bull" "bullet") "@bullet{}")
+ ("copy" "@copyright{}")
+ ("deg" "@textdegree{}")
+ ((or "dots" "hellip") "@dots{}")
+ ("equiv" "@equiv{}")
+ ((or "euro" "EUR") "@euro{}")
+ ((or "ge" "geq") "@geq{}")
+ ("laquo" "@guillemetleft{}")
+ ("iexcl" "@exclamdown{}")
+ ("imath" "@dotless{i}")
+ ("iquest" "@questiondown{}")
+ ("jmath" "@dotless{j}")
+ ((or "le" "leq") "@leq{}")
+ ("lsaquo" "@guilsinglleft{}")
+ ("mdash" "---")
+ ("minus" "@minus{}")
+ ("nbsp" "@tie{}")
+ ("ndash" "--")
+ ("OElig" "@OE{}")
+ ("oelig" "@oe{}")
+ ("ordf" "@ordf{}")
+ ("ordm" "@ordm{}")
+ ("pound" "@pound{}")
+ ("raquo" "@guillemetright{}")
+ ((or "rArr" "Rightarrow") "@result{}")
+ ("reg" "@registeredsymbol{}")
+ ((or "rightarrow" "to" "rarr") "@arrow{}")
+ ("rsaquo" "@guilsinglright{}")
+ ("thorn" "@th{}")
+ ("THORN" "@TH{}")
+ ((and (pred (string-prefix-p "_")) name) ;spacing entities
+ (format "@w{%s}" (substring name 1)))
+ (_ (org-element-property :utf-8 entity))))
+
+;;;; Example Block
+
+(defun org-texinfo-example-block (example-block _contents info)
+ "Transcode an EXAMPLE-BLOCK element from Org to Texinfo.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (format "@example\n%s@end example"
+ (org-texinfo--sanitize-content
+ (org-export-format-code-default example-block info))))
+
+;;; Export Block
+
+(defun org-texinfo-export-block (export-block _contents _info)
+ "Transcode a EXPORT-BLOCK element from Org to Texinfo.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (when (string= (org-element-property :type export-block) "TEXINFO")
+ (org-remove-indentation (org-element-property :value export-block))))
+
+;;; Export Snippet
+
+(defun org-texinfo-export-snippet (export-snippet _contents _info)
+ "Transcode a EXPORT-SNIPPET object from Org to Texinfo.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (when (eq (org-export-snippet-backend export-snippet) 'texinfo)
+ (org-element-property :value export-snippet)))
+
+;;;; Fixed Width
+
+(defun org-texinfo-fixed-width (fixed-width _contents _info)
+ "Transcode a FIXED-WIDTH element from Org to Texinfo.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (format "@example\n%s\n@end example"
+ (org-remove-indentation
+ (org-texinfo--sanitize-content
+ (org-element-property :value fixed-width)))))
+
+;;;; Footnote Reference
+
+(defun org-texinfo-footnote-reference (footnote _contents info)
+ "Create a footnote reference for FOOTNOTE.
+
+FOOTNOTE is the footnote to define. CONTENTS is nil. INFO is a
+plist holding contextual information."
+ (let* ((contents (org-export-get-footnote-definition footnote info))
+ (data (org-export-data contents info)))
+ (format "@footnote{%s}"
+ ;; It is invalid to close a footnote on a line starting
+ ;; with "@end". As a safety net, we leave a newline
+ ;; character before the closing brace. However, when the
+ ;; footnote ends with a paragraph, it is visually pleasing
+ ;; to move the brace right after its end.
+ (if (eq 'paragraph (org-element-type (org-last contents)))
+ (org-trim data)
+ data))))
+
+;;;; Headline
+
+(defun org-texinfo-headline (headline contents info)
+ "Transcode a HEADLINE element from Org to Texinfo.
+CONTENTS holds the contents of the headline. INFO is a plist
+holding contextual information."
+ (cond
+ ((org-element-property :footnote-section-p headline) nil)
+ ((org-not-nil (org-export-get-node-property :COPYING headline t)) nil)
+ (t
+ (let* ((index (let ((i (org-export-get-node-property :INDEX headline t)))
+ (and (member i '("cp" "fn" "ky" "pg" "tp" "vr")) i)))
+ (numbered? (org-export-numbered-headline-p headline info))
+ (notoc? (org-export-excluded-from-toc-p headline info))
+ (command
+ (and
+ (not (org-export-low-level-p headline info))
+ (let ((sections (org-texinfo--sectioning-structure info)))
+ (pcase (nth (1- (org-export-get-relative-level headline info))
+ sections)
+ (`(,numbered ,unnumbered ,unnumbered-no-toc ,appendix)
+ (cond
+ ((org-not-nil
+ (org-export-get-node-property :APPENDIX headline t))
+ appendix)
+ (numbered? numbered)
+ (index unnumbered)
+ (notoc? unnumbered-no-toc)
+ (t unnumbered)))
+ (`nil nil)
+ (_ (user-error "Invalid Texinfo class specification: %S"
+ (plist-get info :texinfo-class)))))))
+ (todo
+ (and (plist-get info :with-todo-keywords)
+ (let ((todo (org-element-property :todo-keyword headline)))
+ (and todo (org-export-data todo info)))))
+ (todo-type (and todo (org-element-property :todo-type headline)))
+ (tags (and (plist-get info :with-tags)
+ (org-export-get-tags headline info)))
+ (priority (and (plist-get info :with-priority)
+ (org-element-property :priority headline)))
+ (text (org-texinfo--sanitize-title
+ (org-element-property :title headline) info))
+ (full-text
+ (funcall (plist-get info :texinfo-format-headline-function)
+ todo todo-type priority text tags))
+ (contents
+ (concat "\n"
+ (if (org-string-nw-p contents) (concat "\n" contents) "")
+ (and index (format "\n@printindex %s\n" index))))
+ (node (org-texinfo--get-node headline info)))
+ (if (not command)
+ (concat (and (org-export-first-sibling-p headline info)
+ (format "@%s\n" (if numbered? 'enumerate 'itemize)))
+ (format "@item\n@anchor{%s}%s\n" node full-text)
+ contents
+ (if (org-export-last-sibling-p headline info)
+ (format "@end %s" (if numbered? 'enumerate 'itemize))
+ "\n"))
+ (concat
+ ;; Even if HEADLINE is using @subheading and al., leave an
+ ;; anchor so cross-references in the Org document still work.
+ (format (if notoc? "@anchor{%s}\n" "@node %s\n") node)
+ (format command full-text)
+ contents))))))
+
+(defun org-texinfo-format-headline-default-function
+ (todo _todo-type priority text tags)
+ "Default format function for a headline.
+See `org-texinfo-format-headline-function' for details."
+ (concat (and todo (format "@strong{%s} " todo))
+ (and priority (format "@emph{#%s} " priority))
+ text
+ (and tags (concat " " (org-make-tag-string tags)))))
+
+;;;; Inline Src Block
+
+(defun org-texinfo-inline-src-block (inline-src-block _contents _info)
+ "Transcode an INLINE-SRC-BLOCK element from Org to Texinfo.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (format "@code{%s}"
+ (org-texinfo--sanitize-content
+ (org-element-property :value inline-src-block))))
+
+;;;; Inlinetask
+
+(defun org-texinfo-inlinetask (inlinetask contents info)
+ "Transcode an INLINETASK element from Org to Texinfo.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (let ((title (org-export-data (org-element-property :title inlinetask) info))
+ (todo (and (plist-get info :with-todo-keywords)
+ (let ((todo (org-element-property :todo-keyword inlinetask)))
+ (and todo (org-export-data todo info)))))
+ (todo-type (org-element-property :todo-type inlinetask))
+ (tags (and (plist-get info :with-tags)
+ (org-export-get-tags inlinetask info)))
+ (priority (and (plist-get info :with-priority)
+ (org-element-property :priority inlinetask))))
+ (funcall (plist-get info :texinfo-format-inlinetask-function)
+ todo todo-type priority title tags contents)))
+
+(defun org-texinfo-format-inlinetask-default-function
+ (todo _todo-type priority title tags contents)
+ "Default format function for inlinetasks.
+See `org-texinfo-format-inlinetask-function' for details."
+ (let ((full-title
+ (concat (when todo (format "@strong{%s} " todo))
+ (when priority (format "#%c " priority))
+ title
+ (when tags (org-make-tag-string tags)))))
+ (format "@center %s\n\n%s\n" full-title contents)))
+
+;;;; Italic
+
+(defun org-texinfo-italic (_italic contents info)
+ "Transcode ITALIC from Org to Texinfo.
+CONTENTS is the text with italic markup. INFO is a plist holding
+contextual information."
+ (org-texinfo--text-markup contents 'italic info))
+
+;;;; Item
+
+(defun org-texinfo-item (item contents info)
+ "Transcode an ITEM element from Org to Texinfo.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (let* ((tag (org-element-property :tag item))
+ (split (org-string-nw-p
+ (org-export-read-attribute :attr_texinfo
+ (org-element-property :parent item)
+ :sep)))
+ (items (and tag
+ (let ((tag (org-export-data tag info)))
+ (if split
+ (split-string tag (regexp-quote split) t "[ \t\n]+")
+ (list tag))))))
+ (format "%s\n%s"
+ (pcase items
+ (`nil "@item")
+ (`(,item) (concat "@item " item))
+ (`(,item . ,items)
+ (concat "@item " item "\n"
+ (mapconcat (lambda (i) (concat "@itemx " i))
+ items
+ "\n"))))
+ (or contents ""))))
+
+;;;; Keyword
+
+(defun org-texinfo-keyword (keyword _contents info)
+ "Transcode a KEYWORD element from Org to Texinfo.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (let ((value (org-element-property :value keyword)))
+ (pcase (org-element-property :key keyword)
+ ("TEXINFO" value)
+ ("CINDEX" (format "@cindex %s" value))
+ ("FINDEX" (format "@findex %s" value))
+ ("KINDEX" (format "@kindex %s" value))
+ ("PINDEX" (format "@pindex %s" value))
+ ("TINDEX" (format "@tindex %s" value))
+ ("VINDEX" (format "@vindex %s" value))
+ ("TOC"
+ (cond ((string-match-p "\\<tables\\>" value)
+ (concat "@listoffloats "
+ (org-export-translate "Table" :utf-8 info)))
+ ((string-match-p "\\<listings\\>" value)
+ (concat "@listoffloats "
+ (org-export-translate "Listing" :utf-8 info))))))))
+
+;;;; Line Break
+
+(defun org-texinfo-line-break (_line-break _contents _info)
+ "Transcode a LINE-BREAK object from Org to Texinfo.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ "@*\n")
+
+;;;; Link
+
+(defun org-texinfo--@ref (datum description info)
+ "Return @ref command for element or object DATUM.
+DESCRIPTION is the printed name of the section, as a string, or
+nil."
+ (let ((node-name (org-texinfo--get-node datum info))
+ ;; Sanitize DESCRIPTION for cross-reference use. In
+ ;; particular, remove colons as they seem to cause pain (even
+ ;; within @asis{...}) to the Texinfo reader.
+ (title (and description
+ (replace-regexp-in-string
+ "[ \t]*:+" ""
+ (replace-regexp-in-string "," "@comma{}" description)))))
+ (if (or (not title) (equal title node-name))
+ (format "@ref{%s}" node-name)
+ (format "@ref{%s, , %s}" node-name title))))
+
+(defun org-texinfo-link (link desc info)
+ "Transcode a LINK object from Org to Texinfo.
+DESC is the description part of the link, or the empty string.
+INFO is a plist holding contextual information. See
+`org-export-data'."
+ (let* ((type (org-element-property :type link))
+ (raw-path (org-element-property :path link))
+ ;; Ensure DESC really exists, or set it to nil.
+ (desc (and (not (string= desc "")) desc))
+ (path (org-texinfo--sanitize-content
+ (cond
+ ((member type '("http" "https" "ftp"))
+ (concat type ":" raw-path))
+ ((string-equal type "file")
+ (org-export-file-uri raw-path))
+ (t raw-path)))))
+ (cond
+ ((org-export-custom-protocol-maybe link desc 'texinfo info))
+ ((org-export-inline-image-p link org-texinfo-inline-image-rules)
+ (org-texinfo--inline-image link info))
+ ((equal type "radio")
+ (let ((destination (org-export-resolve-radio-link link info)))
+ (if (not destination) desc
+ (org-texinfo--@ref destination desc info))))
+ ((member type '("custom-id" "id" "fuzzy"))
+ (let ((destination
+ (if (equal type "fuzzy")
+ (org-export-resolve-fuzzy-link link info)
+ (org-export-resolve-id-link link info))))
+ (pcase (org-element-type destination)
+ (`nil
+ (format org-texinfo-link-with-unknown-path-format path))
+ ;; Id link points to an external file.
+ (`plain-text
+ (if desc (format "@uref{file://%s,%s}" destination desc)
+ (format "@uref{file://%s}" destination)))
+ ((or `headline
+ ;; Targets within headlines cannot be turned into
+ ;; @anchor{}, so we refer to the headline parent
+ ;; directly.
+ (and `target
+ (guard (eq 'headline
+ (org-element-type
+ (org-element-property :parent destination))))))
+ (let ((headline (org-element-lineage destination '(headline) t)))
+ (org-texinfo--@ref headline desc info)))
+ (_ (org-texinfo--@ref destination desc info)))))
+ ((string= type "mailto")
+ (format "@email{%s}"
+ (concat path (and desc (concat ", " desc)))))
+ ;; External link with a description part.
+ ((and path desc) (format "@uref{%s, %s}" path desc))
+ ;; External link without a description part.
+ (path (format "@uref{%s}" path))
+ ;; No path, only description. Try to do something useful.
+ (t
+ (format (plist-get info :texinfo-link-with-unknown-path-format) desc)))))
+
+(defun org-texinfo--inline-image (link info)
+ "Return Texinfo code for an inline image.
+LINK is the link pointing to the inline image. INFO is the
+current state of the export, as a plist."
+ (let* ((parent (org-export-get-parent-element link))
+ (label (and (org-element-property :name parent)
+ (org-texinfo--get-node parent info)))
+ (caption (org-export-get-caption parent))
+ (shortcaption (org-export-get-caption parent t))
+ (path (org-element-property :path link))
+ (filename
+ (file-name-sans-extension
+ (if (file-name-absolute-p path)
+ (expand-file-name path)
+ (file-relative-name path))))
+ (extension (file-name-extension path))
+ (attributes (org-export-read-attribute :attr_texinfo parent))
+ (height (or (plist-get attributes :height) ""))
+ (width (or (plist-get attributes :width) ""))
+ (alt (or (plist-get attributes :alt) ""))
+ (image (format "@image{%s,%s,%s,%s,%s}"
+ filename width height alt extension)))
+ (cond ((or caption shortcaption)
+ (org-texinfo--wrap-float image
+ info
+ (org-export-translate "Figure" :utf-8 info)
+ label
+ caption
+ shortcaption))
+ (label (concat "@anchor{" label "}\n" image))
+ (t image))))
+
+
+;;;; Menu
+
+(defun org-texinfo-make-menu (scope info &optional master)
+ "Create the menu for inclusion in the Texinfo document.
+
+SCOPE is a headline or a full parse tree. INFO is the
+communication channel, as a plist.
+
+When optional argument MASTER is non-nil, generate a master menu,
+including detailed node listing."
+ (let ((menu (org-texinfo--build-menu scope info)))
+ (when (org-string-nw-p menu)
+ (org-element-normalize-string
+ (format
+ "@menu\n%s@end menu"
+ (concat menu
+ (when master
+ (let ((detailmenu
+ (org-texinfo--build-menu
+ scope info
+ (let ((toc-depth (plist-get info :with-toc)))
+ (if (wholenump toc-depth) toc-depth
+ org-texinfo-max-toc-depth)))))
+ (when (org-string-nw-p detailmenu)
+ (concat "\n@detailmenu\n"
+ "--- The Detailed Node Listing ---\n\n"
+ detailmenu
+ "@end detailmenu\n"))))))))))
+
+(defun org-texinfo--build-menu (scope info &optional level)
+ "Build menu for entries within SCOPE.
+SCOPE is a headline or a full parse tree. INFO is a plist
+containing contextual information. When optional argument LEVEL
+is an integer, build the menu recursively, down to this depth."
+ (cond
+ ((not level)
+ (org-texinfo--format-entries (org-texinfo--menu-entries scope info) info))
+ ((zerop level) "\n")
+ (t
+ (mapconcat
+ (lambda (h)
+ (let ((entries (org-texinfo--menu-entries h info)))
+ (when entries
+ (concat
+ (format "%s\n\n%s\n"
+ (org-export-data (org-export-get-alt-title h info) info)
+ (org-texinfo--format-entries entries info))
+ (org-texinfo--build-menu h info (1- level))))))
+ (org-texinfo--menu-entries scope info)
+ ""))))
+
+(defun org-texinfo--format-entries (entries info)
+ "Format all direct menu entries in SCOPE, as a string.
+SCOPE is either a headline or a full Org document. INFO is
+a plist containing contextual information."
+ (org-element-normalize-string
+ (mapconcat
+ (lambda (h)
+ (let* ((title
+ ;; Colons are used as a separator between title and node
+ ;; name. Remove them.
+ (replace-regexp-in-string
+ "[ \t]*:+" ""
+ (org-texinfo--sanitize-title
+ (org-export-get-alt-title h info) info)))
+ (node (org-texinfo--get-node h info))
+ (entry (concat "* " title ":"
+ (if (string= title node) ":"
+ (concat " " node ". "))))
+ (desc (org-element-property :DESCRIPTION h)))
+ (if (not desc) entry
+ (format (format "%%-%ds %%s" org-texinfo-node-description-column)
+ entry desc))))
+ entries "\n")))
+
+(defun org-texinfo--menu-entries (scope info)
+ "List direct children in SCOPE needing a menu entry.
+SCOPE is a headline or a full parse tree. INFO is a plist
+holding contextual information."
+ (let* ((cache (or (plist-get info :texinfo-entries-cache)
+ (plist-get (plist-put info :texinfo-entries-cache
+ (make-hash-table :test #'eq))
+ :texinfo-entries-cache)))
+ (cached-entries (gethash scope cache 'no-cache)))
+ (if (not (eq cached-entries 'no-cache)) cached-entries
+ (let* ((sections (org-texinfo--sectioning-structure info))
+ (max-depth (length sections)))
+ (puthash scope
+ (cl-remove-if
+ (lambda (h)
+ (or (org-not-nil (org-export-get-node-property :COPYING h t))
+ (< max-depth (org-export-get-relative-level h info))))
+ (org-export-collect-headlines info 1 scope))
+ cache)))))
+
+;;;; Node Property
+
+(defun org-texinfo-node-property (node-property _contents _info)
+ "Transcode a NODE-PROPERTY element from Org to Texinfo.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (format "%s:%s"
+ (org-element-property :key node-property)
+ (let ((value (org-element-property :value node-property)))
+ (if value (concat " " value) ""))))
+
+;;;; Paragraph
+
+(defun org-texinfo-paragraph (_paragraph contents _info)
+ "Transcode a PARAGRAPH element from Org to Texinfo.
+CONTENTS is the contents of the paragraph, as a string. INFO is
+the plist used as a communication channel."
+ contents)
+
+;;;; Plain List
+
+(defun org-texinfo-plain-list (plain-list contents info)
+ "Transcode a PLAIN-LIST element from Org to Texinfo.
+CONTENTS is the contents of the list. INFO is a plist holding
+contextual information."
+ (let* ((attr (org-export-read-attribute :attr_texinfo plain-list))
+ (indic (let ((i (or (plist-get attr :indic)
+ (plist-get info :texinfo-table-default-markup))))
+ ;; Allow indicating commands with missing @ sign.
+ (if (string-prefix-p "@" i) i (concat "@" i))))
+ (table-type (plist-get attr :table-type))
+ (type (org-element-property :type plain-list))
+ (enum
+ (cond ((not (eq type 'ordered)) nil)
+ ((plist-member attr :enum) (plist-get attr :enum))
+ (t
+ ;; Texinfo only supports initial counters, i.e., it
+ ;; cannot change the numbering mid-list.
+ (let ((first-item (car (org-element-contents plain-list))))
+ (org-element-property :counter first-item)))))
+ (list-type (cond
+ ((eq type 'ordered) "enumerate")
+ ((eq type 'unordered) "itemize")
+ ((member table-type '("ftable" "vtable")) table-type)
+ (t "table"))))
+ (format "@%s\n%s@end %s"
+ (cond ((eq type 'descriptive) (concat list-type " " indic))
+ (enum (format "%s %s" list-type enum))
+ (t list-type))
+ contents
+ list-type)))
+
+;;;; Plain Text
+
+(defun org-texinfo-plain-text (text info)
+ "Transcode a TEXT string from Org to Texinfo.
+TEXT is the string to transcode. INFO is a plist holding
+contextual information."
+ ;; First protect @, { and }.
+ (let ((output (org-texinfo--sanitize-content text)))
+ ;; Activate smart quotes. Be sure to provide original TEXT string
+ ;; since OUTPUT may have been modified.
+ (when (plist-get info :with-smart-quotes)
+ (setq output
+ (org-export-activate-smart-quotes output :texinfo info text)))
+ ;; LaTeX into @LaTeX{} and TeX into @TeX{}
+ (let ((case-fold-search nil))
+ (setq output (replace-regexp-in-string "\\(?:La\\)?TeX" "@\\&{}" output)))
+ ;; Convert special strings.
+ (when (plist-get info :with-special-strings)
+ (setq output
+ (replace-regexp-in-string
+ "\\.\\.\\." "@dots{}"
+ (replace-regexp-in-string "\\\\-" "@-" output))))
+ ;; Handle break preservation if required.
+ (when (plist-get info :preserve-breaks)
+ (setq output (replace-regexp-in-string
+ "\\(\\\\\\\\\\)?[ \t]*\n" " @*\n" output)))
+ ;; Reverse sentence ending. A sentence can end with a capital
+ ;; letter. Use non-breaking space if it shouldn't.
+ (let ((case-fold-search nil))
+ (replace-regexp-in-string
+ "[A-Z]\\([.?!]\\)\\(?:[])]\\|'\\{1,2\\}\\)?\\(?: \\|$\\)"
+ "@\\1"
+ output nil nil 1))))
+
+;;;; Planning
+
+(defun org-texinfo-planning (planning _contents info)
+ "Transcode a PLANNING element from Org to Texinfo.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (concat
+ "@noindent"
+ (mapconcat
+ 'identity
+ (delq nil
+ (list
+ (let ((closed (org-element-property :closed planning)))
+ (when closed
+ (concat
+ (format "@strong{%s} " org-closed-string)
+ (format (plist-get info :texinfo-inactive-timestamp-format)
+ (org-timestamp-translate closed)))))
+ (let ((deadline (org-element-property :deadline planning)))
+ (when deadline
+ (concat
+ (format "@strong{%s} " org-deadline-string)
+ (format (plist-get info :texinfo-active-timestamp-format)
+ (org-timestamp-translate deadline)))))
+ (let ((scheduled (org-element-property :scheduled planning)))
+ (when scheduled
+ (concat
+ (format "@strong{%s} " org-scheduled-string)
+ (format (plist-get info :texinfo-active-timestamp-format)
+ (org-timestamp-translate scheduled)))))))
+ " ")
+ "@*"))
+
+;;;; Property Drawer
+
+(defun org-texinfo-property-drawer (_property-drawer contents _info)
+ "Transcode a PROPERTY-DRAWER element from Org to Texinfo.
+CONTENTS holds the contents of the drawer. INFO is a plist
+holding contextual information."
+ (and (org-string-nw-p contents)
+ (format "@verbatim\n%s@end verbatim" contents)))
+
+;;;; Quote Block
+
+(defun org-texinfo-quote-block (quote-block contents _info)
+ "Transcode a QUOTE-BLOCK element from Org to Texinfo.
+CONTENTS holds the contents of the block. INFO is a plist
+holding contextual information."
+ (let ((tag (org-export-read-attribute :attr_texinfo quote-block :tag))
+ (author (org-export-read-attribute :attr_texinfo quote-block :author)))
+ (format "@quotation%s\n%s%s\n@end quotation"
+ (if tag (concat " " tag) "")
+ contents
+ (if author (concat "\n@author " author) ""))))
+
+;;;; Radio Target
+
+(defun org-texinfo-radio-target (radio-target text info)
+ "Transcode a RADIO-TARGET object from Org to Texinfo.
+TEXT is the text of the target. INFO is a plist holding
+contextual information."
+ (format "@anchor{%s}%s"
+ (org-texinfo--get-node radio-target info)
+ text))
+
+;;;; Section
+
+(defun org-texinfo-section (section contents info)
+ "Transcode a SECTION element from Org to Texinfo.
+CONTENTS holds the contents of the section. INFO is a plist
+holding contextual information."
+ (let ((parent (org-export-get-parent-headline section)))
+ (when parent ;first section is handled in `org-texinfo-template'
+ (org-trim
+ (concat contents
+ "\n"
+ (and (not (org-export-excluded-from-toc-p parent info))
+ (org-texinfo-make-menu parent info)))))))
+
+;;;; Special Block
+
+(defun org-texinfo-special-block (special-block contents _info)
+ "Transcode a SPECIAL-BLOCK element from Org to Texinfo.
+CONTENTS holds the contents of the block. INFO is a plist used
+as a communication channel."
+ (let ((opt (org-export-read-attribute :attr_texinfo special-block :options))
+ (type (org-element-property :type special-block)))
+ (format "@%s%s\n%s@end %s"
+ type
+ (if opt (concat " " opt) "")
+ (or contents "")
+ type)))
+
+;;;; Src Block
+
+(defun org-texinfo-src-block (src-block _contents info)
+ "Transcode a SRC-BLOCK element from Org to Texinfo.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (let* ((lisp (string-match-p "lisp"
+ (org-element-property :language src-block)))
+ (code (org-texinfo--sanitize-content
+ (org-export-format-code-default src-block info)))
+ (value (format
+ (if lisp "@lisp\n%s@end lisp" "@example\n%s@end example")
+ code))
+ (caption (org-export-get-caption src-block))
+ (shortcaption (org-export-get-caption src-block t)))
+ (if (not (or caption shortcaption)) value
+ (org-texinfo--wrap-float value
+ info
+ (org-export-translate "Listing" :utf-8 info)
+ (org-texinfo--get-node src-block info)
+ caption
+ shortcaption))))
+
+;;;; Statistics Cookie
+
+(defun org-texinfo-statistics-cookie (statistics-cookie _contents _info)
+ "Transcode a STATISTICS-COOKIE object from Org to Texinfo.
+CONTENTS is nil. INFO is a plist holding contextual information."
+ (org-element-property :value statistics-cookie))
+
+
+;;;; Strike-through
+
+(defun org-texinfo-strike-through (_strike-through contents info)
+ "Transcode STRIKE-THROUGH from Org to Texinfo.
+CONTENTS is the text with strike-through markup. INFO is a plist
+holding contextual information."
+ (org-texinfo--text-markup contents 'strike-through info))
+
+;;;; Subscript
+
+(defun org-texinfo-subscript (_subscript contents _info)
+ "Transcode a SUBSCRIPT object from Org to Texinfo.
+CONTENTS is the contents of the object. INFO is a plist holding
+contextual information."
+ (format "@math{_%s}" contents))
+
+;;;; Superscript
+
+(defun org-texinfo-superscript (_superscript contents _info)
+ "Transcode a SUPERSCRIPT object from Org to Texinfo.
+CONTENTS is the contents of the object. INFO is a plist holding
+contextual information."
+ (format "@math{^%s}" contents))
+
+;;;; Table
+
+(defun org-texinfo-table (table contents info)
+ "Transcode a TABLE element from Org to Texinfo.
+CONTENTS is the contents of the table. INFO is a plist holding
+contextual information."
+ (if (eq (org-element-property :type table) 'table.el)
+ (format "@verbatim\n%s@end verbatim"
+ (org-element-normalize-string
+ (org-element-property :value table)))
+ (let* ((col-width (org-export-read-attribute :attr_texinfo table :columns))
+ (columns
+ (if col-width (format "@columnfractions %s" col-width)
+ (org-texinfo-table-column-widths table info)))
+ (caption (org-export-get-caption table))
+ (shortcaption (org-export-get-caption table t))
+ (table-str (format "@multitable %s\n%s@end multitable"
+ columns
+ contents)))
+ (if (not (or caption shortcaption)) table-str
+ (org-texinfo--wrap-float table-str
+ info
+ (org-export-translate "Table" :utf-8 info)
+ (org-texinfo--get-node table info)
+ caption
+ shortcaption)))))
+
+(defun org-texinfo-table-column-widths (table info)
+ "Determine the largest table cell in each column to process alignment.
+TABLE is the table element to transcode. INFO is a plist used as
+a communication channel."
+ (let ((widths (make-vector (cdr (org-export-table-dimensions table info)) 0)))
+ (org-element-map table 'table-row
+ (lambda (row)
+ (let ((idx 0))
+ (org-element-map row 'table-cell
+ (lambda (cell)
+ ;; Length of the cell in the original buffer is only an
+ ;; approximation of the length of the cell in the
+ ;; output. It can sometimes fail (e.g. it considers
+ ;; "/a/" being larger than "ab").
+ (let ((w (- (org-element-property :contents-end cell)
+ (org-element-property :contents-begin cell))))
+ (aset widths idx (max w (aref widths idx))))
+ (cl-incf idx))
+ info)))
+ info)
+ (format "{%s}" (mapconcat (lambda (w) (make-string w ?a)) widths "} {"))))
+
+;;;; Table Cell
+
+(defun org-texinfo-table-cell (table-cell contents info)
+ "Transcode a TABLE-CELL element from Org to Texinfo.
+CONTENTS is the cell contents. INFO is a plist used as
+a communication channel."
+ (concat
+ (let ((scientific-notation
+ (plist-get info :texinfo-table-scientific-notation)))
+ (if (and contents
+ scientific-notation
+ (string-match orgtbl-exp-regexp contents))
+ ;; Use appropriate format string for scientific notation.
+ (format scientific-notation
+ (match-string 1 contents)
+ (match-string 2 contents))
+ contents))
+ (when (org-export-get-next-element table-cell info) "\n@tab ")))
+
+;;;; Table Row
+
+(defun org-texinfo-table-row (table-row contents info)
+ "Transcode a TABLE-ROW element from Org to Texinfo.
+CONTENTS is the contents of the row. INFO is a plist used as
+a communication channel."
+ ;; Rules are ignored since table separators are deduced from
+ ;; borders of the current row.
+ (when (eq (org-element-property :type table-row) 'standard)
+ (let ((rowgroup-tag
+ (if (and (= 1 (org-export-table-row-group table-row info))
+ (org-export-table-has-header-p
+ (org-export-get-parent-table table-row) info))
+ "@headitem "
+ "@item ")))
+ (concat rowgroup-tag contents "\n"))))
+
+;;;; Target
+
+(defun org-texinfo-target (target _contents info)
+ "Transcode a TARGET object from Org to Texinfo.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (format "@anchor{%s}" (org-texinfo--get-node target info)))
+
+;;;; Timestamp
+
+(defun org-texinfo-timestamp (timestamp _contents info)
+ "Transcode a TIMESTAMP object from Org to Texinfo.
+CONTENTS is nil. INFO is a plist holding contextual
+information."
+ (let ((value (org-texinfo-plain-text
+ (org-timestamp-translate timestamp) info)))
+ (pcase (org-element-property :type timestamp)
+ ((or `active `active-range)
+ (format (plist-get info :texinfo-active-timestamp-format) value))
+ ((or `inactive `inactive-range)
+ (format (plist-get info :texinfo-inactive-timestamp-format) value))
+ (_ (format (plist-get info :texinfo-diary-timestamp-format) value)))))
+
+;;;; Underline
+
+(defun org-texinfo-underline (_underline contents info)
+ "Transcode UNDERLINE from Org to Texinfo.
+CONTENTS is the text with underline markup. INFO is a plist
+holding contextual information."
+ (org-texinfo--text-markup contents 'underline info))
+
+;;;; Verbatim
+
+(defun org-texinfo-verbatim (verbatim _contents info)
+ "Transcode a VERBATIM object from Org to Texinfo.
+CONTENTS is nil. INFO is a plist used as a communication
+channel."
+ (org-texinfo--text-markup
+ (org-element-property :value verbatim) 'verbatim info))
+
+;;;; Verse Block
+
+(defun org-texinfo-verse-block (_verse-block contents _info)
+ "Transcode a VERSE-BLOCK element from Org to Texinfo.
+CONTENTS is verse block contents. INFO is a plist holding
+contextual information."
+ (format "@display\n%s@end display" contents))
+
+
+;;; Interactive functions
+
+;;;###autoload
+(defun org-texinfo-export-to-texinfo
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer to a Texinfo file.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+Return output file's name."
+ (interactive)
+ (let ((outfile (org-export-output-file-name ".texi" subtreep))
+ (org-export-coding-system org-texinfo-coding-system))
+ (org-export-to-file 'texinfo outfile
+ async subtreep visible-only body-only ext-plist)))
+
+(defun org-texinfo-export-to-texinfo-batch ()
+ "Export Org file INFILE to Texinfo file OUTFILE, in batch mode.
+Overwrites existing output file.
+Usage: emacs -batch -f org-texinfo-export-to-texinfo-batch INFILE OUTFILE"
+ (or noninteractive (user-error "Batch mode use only"))
+ (let ((infile (pop command-line-args-left))
+ (outfile (pop command-line-args-left))
+ (org-export-coding-system org-texinfo-coding-system)
+ (make-backup-files nil))
+ (unless (file-readable-p infile)
+ (message "File `%s' not readable" infile)
+ (kill-emacs 1))
+ (with-temp-buffer
+ (insert-file-contents infile)
+ (org-export-to-file 'texinfo outfile))))
+
+;;;###autoload
+(defun org-texinfo-export-to-info
+ (&optional async subtreep visible-only body-only ext-plist)
+ "Export current buffer to Texinfo then process through to INFO.
+
+If narrowing is active in the current buffer, only export its
+narrowed part.
+
+If a region is active, export that region.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting file should be accessible through
+the `org-export-stack' interface.
+
+When optional argument SUBTREEP is non-nil, export the sub-tree
+at point, extracting information from the headline properties
+first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only write code
+between \"\\begin{document}\" and \"\\end{document}\".
+
+EXT-PLIST, when provided, is a property list with external
+parameters overriding Org default settings, but still inferior to
+file-local settings.
+
+When optional argument PUB-DIR is set, use it as the publishing
+directory.
+
+Return INFO file's name."
+ (interactive)
+ (let ((outfile (org-export-output-file-name ".texi" subtreep))
+ (org-export-coding-system org-texinfo-coding-system))
+ (org-export-to-file 'texinfo outfile
+ async subtreep visible-only body-only ext-plist
+ #'org-texinfo-compile)))
+
+;;;###autoload
+(defun org-texinfo-publish-to-texinfo (plist filename pub-dir)
+ "Publish an org file to Texinfo.
+
+FILENAME is the filename of the Org file to be published. PLIST
+is the property list for the given project. PUB-DIR is the
+publishing directory.
+
+Return output file name."
+ (org-publish-org-to 'texinfo filename ".texi" plist pub-dir))
+
+;;;###autoload
+(defun org-texinfo-convert-region-to-texinfo ()
+ "Assume the current region has Org syntax, and convert it to Texinfo.
+This can be used in any buffer. For example, you can write an
+itemized list in Org syntax in an Texinfo buffer and use this
+command to convert it."
+ (interactive)
+ (org-export-replace-region-by 'texinfo))
+
+(defun org-texinfo-compile (file)
+ "Compile a texinfo file.
+
+FILE is the name of the file being compiled. Processing is done
+through the command specified in `org-texinfo-info-process',
+which see. Output is redirected to \"*Org INFO Texinfo Output*\"
+buffer.
+
+Return INFO file name or an error if it couldn't be produced."
+ (message "Processing Texinfo file %s..." file)
+ (let* ((log-name "*Org INFO Texinfo Output*")
+ (log (get-buffer-create log-name))
+ (output
+ (org-compile-file file org-texinfo-info-process "info"
+ (format "See %S for details" log-name)
+ log)))
+ (when org-texinfo-remove-logfiles
+ (let ((base (file-name-sans-extension output)))
+ (dolist (ext org-texinfo-logfiles-extensions)
+ (let ((file (concat base "." ext)))
+ (when (file-exists-p file) (delete-file file))))))
+ (message "Process completed.")
+ output))
+
+
+(provide 'ox-texinfo)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ox-texinfo.el ends here
diff --git a/elpa/org-9.5.2/ox-texinfo.elc b/elpa/org-9.5.2/ox-texinfo.elc
new file mode 100644
index 0000000..132bca3
--- /dev/null
+++ b/elpa/org-9.5.2/ox-texinfo.elc
Binary files differ
diff --git a/elpa/org-9.5.2/ox.el b/elpa/org-9.5.2/ox.el
new file mode 100644
index 0000000..80202b0
--- /dev/null
+++ b/elpa/org-9.5.2/ox.el
@@ -0,0 +1,7029 @@
+;;; ox.el --- Export Framework for Org Mode -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
+
+;; Author: Nicolas Goaziou <n.goaziou at gmail dot com>
+;; Maintainer: Nicolas Goaziou <n.goaziou at gmail dot com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; This library implements a generic export engine for Org, built on
+;; its syntactical parser: Org Elements.
+;;
+;; Besides that parser, the generic exporter is made of three distinct
+;; parts:
+;;
+;; - The communication channel consists of a property list, which is
+;; created and updated during the process. Its use is to offer
+;; every piece of information, would it be about initial environment
+;; or contextual data, all in a single place.
+;;
+;; - The transcoder walks the parse tree, ignores or treat as plain
+;; text elements and objects according to export options, and
+;; eventually calls back-end specific functions to do the real
+;; transcoding, concatenating their return value along the way.
+;;
+;; - The filter system is activated at the very beginning and the very
+;; end of the export process, and each time an element or an object
+;; has been converted. It is the entry point to fine-tune standard
+;; output from back-end transcoders. See "The Filter System"
+;; section for more information.
+;;
+;; The core functions is `org-export-as'. It returns the transcoded
+;; buffer as a string. Its derivatives are `org-export-to-buffer' and
+;; `org-export-to-file'.
+;;
+;; An export back-end is defined with `org-export-define-backend'.
+;; This function can also support specific buffer keywords, OPTION
+;; keyword's items and filters. Refer to function's documentation for
+;; more information.
+;;
+;; If the new back-end shares most properties with another one,
+;; `org-export-define-derived-backend' can be used to simplify the
+;; process.
+;;
+;; Any back-end can define its own variables. Among them, those
+;; customizable should belong to the `org-export-BACKEND' group.
+;;
+;; Tools for common tasks across back-ends are implemented in the
+;; following part of the file.
+;;
+;; Eventually, a dispatcher (`org-export-dispatch') is provided in the
+;; last one.
+;;
+;; See <https://orgmode.org/worg/dev/org-export-reference.html> for
+;; more information.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ob-exp)
+(require 'oc)
+(require 'oc-basic) ;default value for `org-cite-export-processors'
+(require 'ol)
+(require 'org-element)
+(require 'org-macro)
+(require 'tabulated-list)
+
+(declare-function org-src-coderef-format "org-src" (&optional element))
+(declare-function org-src-coderef-regexp "org-src" (fmt &optional label))
+(declare-function org-publish "ox-publish" (project &optional force async))
+(declare-function org-publish-all "ox-publish" (&optional force async))
+(declare-function org-publish-current-file "ox-publish" (&optional force async))
+(declare-function org-publish-current-project "ox-publish" (&optional force async))
+
+(defvar org-publish-project-alist)
+(defvar org-table-number-fraction)
+(defvar org-table-number-regexp)
+
+
+;;; Internal Variables
+;;
+;; Among internal variables, the most important is
+;; `org-export-options-alist'. This variable define the global export
+;; options, shared between every exporter, and how they are acquired.
+
+(defconst org-export-max-depth 19
+ "Maximum nesting depth for headlines, counting from 0.")
+
+(defconst org-export-options-alist
+ '((:title "TITLE" nil nil parse)
+ (:date "DATE" nil nil parse)
+ (:author "AUTHOR" nil user-full-name parse)
+ (:email "EMAIL" nil user-mail-address t)
+ (:language "LANGUAGE" nil org-export-default-language t)
+ (:select-tags "SELECT_TAGS" nil org-export-select-tags split)
+ (:exclude-tags "EXCLUDE_TAGS" nil org-export-exclude-tags split)
+ (:creator "CREATOR" nil org-export-creator-string)
+ (:headline-levels nil "H" org-export-headline-levels)
+ (:preserve-breaks nil "\\n" org-export-preserve-breaks)
+ (:section-numbers nil "num" org-export-with-section-numbers)
+ (:time-stamp-file nil "timestamp" org-export-time-stamp-file)
+ (:with-archived-trees nil "arch" org-export-with-archived-trees)
+ (:with-author nil "author" org-export-with-author)
+ (:with-broken-links nil "broken-links" org-export-with-broken-links)
+ (:with-clocks nil "c" org-export-with-clocks)
+ (:with-creator nil "creator" org-export-with-creator)
+ (:with-date nil "date" org-export-with-date)
+ (:with-drawers nil "d" org-export-with-drawers)
+ (:with-email nil "email" org-export-with-email)
+ (:with-emphasize nil "*" org-export-with-emphasize)
+ (:with-entities nil "e" org-export-with-entities)
+ (:with-fixed-width nil ":" org-export-with-fixed-width)
+ (:with-footnotes nil "f" org-export-with-footnotes)
+ (:with-inlinetasks nil "inline" org-export-with-inlinetasks)
+ (:with-latex nil "tex" org-export-with-latex)
+ (:with-planning nil "p" org-export-with-planning)
+ (:with-priority nil "pri" org-export-with-priority)
+ (:with-properties nil "prop" org-export-with-properties)
+ (:with-smart-quotes nil "'" org-export-with-smart-quotes)
+ (:with-special-strings nil "-" org-export-with-special-strings)
+ (:with-statistics-cookies nil "stat" org-export-with-statistics-cookies)
+ (:with-sub-superscript nil "^" org-export-with-sub-superscripts)
+ (:with-toc nil "toc" org-export-with-toc)
+ (:with-tables nil "|" org-export-with-tables)
+ (:with-tags nil "tags" org-export-with-tags)
+ (:with-tasks nil "tasks" org-export-with-tasks)
+ (:with-timestamps nil "<" org-export-with-timestamps)
+ (:with-title nil "title" org-export-with-title)
+ (:with-todo-keywords nil "todo" org-export-with-todo-keywords)
+ ;; Citations processing.
+ (:cite-export "CITE_EXPORT" nil org-cite-export-processors))
+ "Alist between export properties and ways to set them.
+
+The key of the alist is the property name, and the value is a list
+like (KEYWORD OPTION DEFAULT BEHAVIOR) where:
+
+KEYWORD is a string representing a buffer keyword, or nil. Each
+ property defined this way can also be set, during subtree
+ export, through a headline property named after the keyword
+ with the \"EXPORT_\" prefix (i.e. DATE keyword and EXPORT_DATE
+ property).
+OPTION is a string that could be found in an #+OPTIONS: line.
+DEFAULT is the default value for the property.
+BEHAVIOR determines how Org should handle multiple keywords for
+ the same property. It is a symbol among:
+ nil Keep old value and discard the new one.
+ t Replace old value with the new one.
+ `space' Concatenate the values, separating them with a space.
+ `newline' Concatenate the values, separating them with
+ a newline.
+ `split' Split values at white spaces, and cons them to the
+ previous list.
+ `parse' Parse value as a list of strings and Org objects,
+ which can then be transcoded with, e.g.,
+ `org-export-data'. It implies `space' behavior.
+
+Values set through KEYWORD and OPTION have precedence over
+DEFAULT.
+
+All these properties should be back-end agnostic. Back-end
+specific properties are set through `org-export-define-backend'.
+Properties redefined there have precedence over these.")
+
+(defconst org-export-filters-alist
+ '((:filter-body . org-export-filter-body-functions)
+ (:filter-bold . org-export-filter-bold-functions)
+ (:filter-babel-call . org-export-filter-babel-call-functions)
+ (:filter-center-block . org-export-filter-center-block-functions)
+ (:filter-clock . org-export-filter-clock-functions)
+ (:filter-code . org-export-filter-code-functions)
+ (:filter-diary-sexp . org-export-filter-diary-sexp-functions)
+ (:filter-drawer . org-export-filter-drawer-functions)
+ (:filter-dynamic-block . org-export-filter-dynamic-block-functions)
+ (:filter-entity . org-export-filter-entity-functions)
+ (:filter-example-block . org-export-filter-example-block-functions)
+ (:filter-export-block . org-export-filter-export-block-functions)
+ (:filter-export-snippet . org-export-filter-export-snippet-functions)
+ (:filter-final-output . org-export-filter-final-output-functions)
+ (:filter-fixed-width . org-export-filter-fixed-width-functions)
+ (:filter-footnote-definition . org-export-filter-footnote-definition-functions)
+ (:filter-footnote-reference . org-export-filter-footnote-reference-functions)
+ (:filter-headline . org-export-filter-headline-functions)
+ (:filter-horizontal-rule . org-export-filter-horizontal-rule-functions)
+ (:filter-inline-babel-call . org-export-filter-inline-babel-call-functions)
+ (:filter-inline-src-block . org-export-filter-inline-src-block-functions)
+ (:filter-inlinetask . org-export-filter-inlinetask-functions)
+ (:filter-italic . org-export-filter-italic-functions)
+ (:filter-item . org-export-filter-item-functions)
+ (:filter-keyword . org-export-filter-keyword-functions)
+ (:filter-latex-environment . org-export-filter-latex-environment-functions)
+ (:filter-latex-fragment . org-export-filter-latex-fragment-functions)
+ (:filter-line-break . org-export-filter-line-break-functions)
+ (:filter-link . org-export-filter-link-functions)
+ (:filter-node-property . org-export-filter-node-property-functions)
+ (:filter-options . org-export-filter-options-functions)
+ (:filter-paragraph . org-export-filter-paragraph-functions)
+ (:filter-parse-tree . org-export-filter-parse-tree-functions)
+ (:filter-plain-list . org-export-filter-plain-list-functions)
+ (:filter-plain-text . org-export-filter-plain-text-functions)
+ (:filter-planning . org-export-filter-planning-functions)
+ (:filter-property-drawer . org-export-filter-property-drawer-functions)
+ (:filter-quote-block . org-export-filter-quote-block-functions)
+ (:filter-radio-target . org-export-filter-radio-target-functions)
+ (:filter-section . org-export-filter-section-functions)
+ (:filter-special-block . org-export-filter-special-block-functions)
+ (:filter-src-block . org-export-filter-src-block-functions)
+ (:filter-statistics-cookie . org-export-filter-statistics-cookie-functions)
+ (:filter-strike-through . org-export-filter-strike-through-functions)
+ (:filter-subscript . org-export-filter-subscript-functions)
+ (:filter-superscript . org-export-filter-superscript-functions)
+ (:filter-table . org-export-filter-table-functions)
+ (:filter-table-cell . org-export-filter-table-cell-functions)
+ (:filter-table-row . org-export-filter-table-row-functions)
+ (:filter-target . org-export-filter-target-functions)
+ (:filter-timestamp . org-export-filter-timestamp-functions)
+ (:filter-underline . org-export-filter-underline-functions)
+ (:filter-verbatim . org-export-filter-verbatim-functions)
+ (:filter-verse-block . org-export-filter-verse-block-functions))
+ "Alist between filters properties and initial values.
+
+The key of each association is a property name accessible through
+the communication channel. Its value is a configurable global
+variable defining initial filters.
+
+This list is meant to install user specified filters. Back-end
+developers may install their own filters using
+`org-export-define-backend'. Filters defined there will always
+be prepended to the current list, so they always get applied
+first.")
+
+(defconst org-export-default-inline-image-rule
+ `(("file" .
+ ,(format "\\.%s\\'"
+ (regexp-opt
+ '("png" "jpeg" "jpg" "gif" "tiff" "tif" "xbm"
+ "xpm" "pbm" "pgm" "ppm") t))))
+ "Default rule for link matching an inline image.
+This rule applies to links with no description. By default, it
+will be considered as an inline image if it targets a local file
+whose extension is either \"png\", \"jpeg\", \"jpg\", \"gif\",
+\"tiff\", \"tif\", \"xbm\", \"xpm\", \"pbm\", \"pgm\" or \"ppm\".
+See `org-export-inline-image-p' for more information about
+rules.")
+
+(defconst org-export-ignored-local-variables
+ '(org-font-lock-keywords
+ org-element--cache org-element--cache-objects org-element--cache-sync-keys
+ org-element--cache-sync-requests org-element--cache-sync-timer)
+ "List of variables not copied through upon buffer duplication.
+Export process takes place on a copy of the original buffer.
+When this copy is created, all Org related local variables not in
+this list are copied to the new buffer. Variables with an
+unreadable value are also ignored.")
+
+(defvar org-export-async-debug nil
+ "Non-nil means asynchronous export process should leave data behind.
+
+This data is found in the appropriate \"*Org Export Process*\"
+buffer, and in files prefixed with \"org-export-process\" and
+located in `temporary-file-directory'.
+
+When non-nil, it will also set `debug-on-error' to a non-nil
+value in the external process.")
+
+(defvar org-export-stack-contents nil
+ "Record asynchronously generated export results and processes.
+This is an alist: its CAR is the source of the
+result (destination file or buffer for a finished process,
+original buffer for a running one) and its CDR is a list
+containing the back-end used, as a symbol, and either a process
+or the time at which it finished. It is used to build the menu
+from `org-export-stack'.")
+
+(defvar org-export-registered-backends nil
+ "List of backends currently available in the exporter.
+This variable is set with `org-export-define-backend' and
+`org-export-define-derived-backend' functions.")
+
+(defvar org-export-dispatch-last-action nil
+ "Last command called from the dispatcher.
+The value should be a list. Its CAR is the action, as a symbol,
+and its CDR is a list of export options.")
+
+(defvar org-export-dispatch-last-position (make-marker)
+ "The position where the last export command was created using the dispatcher.
+This marker will be used with `\\[universal-argument] C-c C-e' to make sure export repetition
+uses the same subtree if the previous command was restricted to a subtree.")
+
+;; For compatibility with Org < 8
+(defvar org-export-current-backend nil
+ "Name, if any, of the back-end used during an export process.
+
+Its value is a symbol such as `html', `latex', `ascii', or nil if
+the back-end is anonymous (see `org-export-create-backend') or if
+there is no export process in progress.
+
+It can be used to teach Babel blocks how to act differently
+according to the back-end used.")
+
+
+
+;;; User-configurable Variables
+;;
+;; Configuration for the masses.
+;;
+;; They should never be accessed directly, as their value is to be
+;; stored in a property list (cf. `org-export-options-alist').
+;; Back-ends will read their value from there instead.
+
+(defgroup org-export nil
+ "Options for exporting Org mode files."
+ :tag "Org Export"
+ :group 'org)
+
+(defgroup org-export-general nil
+ "General options for export engine."
+ :tag "Org Export General"
+ :group 'org-export)
+
+(defcustom org-export-with-archived-trees 'headline
+ "Whether sub-trees with the ARCHIVE tag should be exported.
+
+This can have three different values:
+nil Do not export, pretend this tree is not present.
+t Do export the entire tree.
+`headline' Only export the headline, but skip the tree below it.
+
+This option can also be set with the OPTIONS keyword,
+e.g. \"arch:nil\"."
+ :group 'org-export-general
+ :type '(choice
+ (const :tag "Not at all" nil)
+ (const :tag "Headline only" headline)
+ (const :tag "Entirely" t))
+ :safe (lambda (x) (memq x '(t nil headline))))
+
+(defcustom org-export-with-author t
+ "Non-nil means insert author name into the exported file.
+This option can also be set with the OPTIONS keyword,
+e.g. \"author:nil\"."
+ :group 'org-export-general
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-clocks nil
+ "Non-nil means export CLOCK keywords.
+This option can also be set with the OPTIONS keyword,
+e.g. \"c:t\"."
+ :group 'org-export-general
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-creator nil
+ "Non-nil means the postamble should contain a creator sentence.
+
+The sentence can be set in `org-export-creator-string', which
+see.
+
+This option can also be set with the OPTIONS keyword, e.g.,
+\"creator:t\"."
+ :group 'org-export-general
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-date t
+ "Non-nil means insert date in the exported document.
+This option can also be set with the OPTIONS keyword,
+e.g. \"date:nil\"."
+ :group 'org-export-general
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-date-timestamp-format nil
+ "Time-stamp format string to use for DATE keyword.
+
+The format string, when specified, only applies if date consists
+in a single time-stamp. Otherwise its value will be ignored.
+
+See `format-time-string' for details on how to build this
+string."
+ :group 'org-export-general
+ :type '(choice
+ (string :tag "Time-stamp format string")
+ (const :tag "No format string" nil))
+ :safe (lambda (x) (or (null x) (stringp x))))
+
+(defcustom org-export-creator-string
+ (format "Emacs %s (Org mode %s)"
+ emacs-version
+ (if (fboundp 'org-version) (org-version) "unknown version"))
+ "Information about the creator of the document.
+This option can also be set on with the CREATOR keyword."
+ :group 'org-export-general
+ :type '(string :tag "Creator string")
+ :safe #'stringp)
+
+(defcustom org-export-with-drawers '(not "LOGBOOK")
+ "Non-nil means export contents of standard drawers.
+
+When t, all drawers are exported. This may also be a list of
+drawer names to export, as strings. If that list starts with
+`not', only drawers with such names will be ignored.
+
+This variable doesn't apply to properties drawers. See
+`org-export-with-properties' instead.
+
+This option can also be set with the OPTIONS keyword,
+e.g. \"d:nil\"."
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "All drawers" t)
+ (const :tag "None" nil)
+ (repeat :tag "Selected drawers"
+ (string :tag "Drawer name"))
+ (list :tag "Ignored drawers"
+ (const :format "" not)
+ (repeat :tag "Specify names of drawers to ignore during export"
+ :inline t
+ (string :tag "Drawer name"))))
+ :safe (lambda (x) (or (booleanp x) (consp x))))
+
+(defcustom org-export-with-email nil
+ "Non-nil means insert author email into the exported file.
+This option can also be set with the OPTIONS keyword,
+e.g. \"email:t\"."
+ :group 'org-export-general
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-emphasize t
+ "Non-nil means interpret *word*, /word/, _word_ and +word+.
+
+If the export target supports emphasizing text, the word will be
+typeset in bold, italic, with an underline or strike-through,
+respectively.
+
+This option can also be set with the OPTIONS keyword,
+e.g. \"*:nil\"."
+ :group 'org-export-general
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-exclude-tags '("noexport")
+ "Tags that exclude a tree from export.
+
+All trees carrying any of these tags will be excluded from
+export. This is without condition, so even subtrees inside that
+carry one of the `org-export-select-tags' will be removed.
+
+This option can also be set with the EXCLUDE_TAGS keyword."
+ :group 'org-export-general
+ :type '(repeat (string :tag "Tag"))
+ :safe (lambda (x) (and (listp x) (cl-every #'stringp x))))
+
+(defcustom org-export-with-fixed-width t
+ "Non-nil means export lines starting with \":\".
+This option can also be set with the OPTIONS keyword,
+e.g. \"::nil\"."
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-footnotes t
+ "Non-nil means Org footnotes should be exported.
+This option can also be set with the OPTIONS keyword,
+e.g. \"f:nil\"."
+ :group 'org-export-general
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-latex t
+ "Non-nil means process LaTeX environments and fragments.
+
+This option can also be set with the OPTIONS line,
+e.g. \"tex:verbatim\". Allowed values are:
+
+nil Ignore math snippets.
+`verbatim' Keep everything in verbatim.
+t Allow export of math snippets."
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "Do not process math in any way" nil)
+ (const :tag "Interpret math snippets" t)
+ (const :tag "Leave math verbatim" verbatim))
+ :safe (lambda (x) (memq x '(t nil verbatim))))
+
+(defcustom org-export-headline-levels 3
+ "The last level which is still exported as a headline.
+
+Inferior levels will usually produce itemize or enumerate lists
+when exported, but back-end behavior may differ.
+
+This option can also be set with the OPTIONS keyword,
+e.g. \"H:2\"."
+ :group 'org-export-general
+ :type 'integer
+ :safe #'integerp)
+
+(defcustom org-export-default-language "en"
+ "The default language for export and clocktable translations, as a string.
+This may have an association in
+`org-clock-clocktable-language-setup',
+`org-export-smart-quotes-alist' and `org-export-dictionary'.
+This option can also be set with the LANGUAGE keyword."
+ :group 'org-export-general
+ :type '(string :tag "Language")
+ :safe #'stringp)
+
+(defcustom org-export-preserve-breaks nil
+ "Non-nil means preserve all line breaks when exporting.
+This option can also be set with the OPTIONS keyword,
+e.g. \"\\n:t\"."
+ :group 'org-export-general
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-entities t
+ "Non-nil means interpret entities when exporting.
+
+For example, HTML export converts \\alpha to &alpha; and \\AA to
+&Aring;.
+
+For a list of supported names, see the constant `org-entities'
+and the user option `org-entities-user'.
+
+This option can also be set with the OPTIONS keyword,
+e.g. \"e:nil\"."
+ :group 'org-export-general
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-inlinetasks t
+ "Non-nil means inlinetasks should be exported.
+This option can also be set with the OPTIONS keyword,
+e.g. \"inline:nil\"."
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-planning nil
+ "Non-nil means include planning info in export.
+
+Planning info is the line containing either SCHEDULED:,
+DEADLINE:, CLOSED: time-stamps, or a combination of them.
+
+This option can also be set with the OPTIONS keyword,
+e.g. \"p:t\"."
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-priority nil
+ "Non-nil means include priority cookies in export.
+This option can also be set with the OPTIONS keyword,
+e.g. \"pri:t\"."
+ :group 'org-export-general
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-properties nil
+ "Non-nil means export contents of properties drawers.
+
+When t, all properties are exported. This may also be a list of
+properties to export, as strings.
+
+This option can also be set with the OPTIONS keyword,
+e.g. \"prop:t\"."
+ :group 'org-export-general
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(choice
+ (const :tag "All properties" t)
+ (const :tag "None" nil)
+ (repeat :tag "Selected properties"
+ (string :tag "Property name")))
+ :safe (lambda (x) (or (booleanp x)
+ (and (listp x) (cl-every #'stringp x)))))
+
+(defcustom org-export-with-section-numbers t
+ "Non-nil means add section numbers to headlines when exporting.
+
+When set to an integer n, numbering will only happen for
+headlines whose relative level is higher or equal to n.
+
+This option can also be set with the OPTIONS keyword,
+e.g. \"num:t\"."
+ :group 'org-export-general
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-select-tags '("export")
+ "Tags that select a tree for export.
+
+If any such tag is found in a buffer, all trees that do not carry
+one of these tags will be ignored during export. Inside trees
+that are selected like this, you can still deselect a subtree by
+tagging it with one of the `org-export-exclude-tags'.
+
+This option can also be set with the SELECT_TAGS keyword."
+ :group 'org-export-general
+ :type '(repeat (string :tag "Tag"))
+ :safe (lambda (x) (and (listp x) (cl-every #'stringp x))))
+
+(defcustom org-export-with-smart-quotes nil
+ "Non-nil means activate smart quotes during export.
+This option can also be set with the OPTIONS keyword,
+e.g., \"':t\".
+
+When setting this to non-nil, you need to take care of
+using the correct Babel package when exporting to LaTeX.
+E.g., you can load Babel for french like this:
+
+#+LATEX_HEADER: \\usepackage[french]{babel}"
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-special-strings t
+ "Non-nil means interpret \"\\-\", \"--\" and \"---\" for export.
+
+When this option is turned on, these strings will be exported as:
+
+ Org HTML LaTeX UTF-8
+ -----+----------+--------+-------
+ \\- &shy; \\-
+ -- &ndash; -- –
+ --- &mdash; --- —
+ ... &hellip; \\ldots …
+
+This option can also be set with the OPTIONS keyword,
+e.g. \"-:nil\"."
+ :group 'org-export-general
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-statistics-cookies t
+ "Non-nil means include statistics cookies in export.
+This option can also be set with the OPTIONS keyword,
+e.g. \"stat:nil\""
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-sub-superscripts t
+ "Non-nil means interpret \"_\" and \"^\" for export.
+
+If you want to control how Org displays those characters, see
+`org-use-sub-superscripts'. `org-export-with-sub-superscripts'
+used to be an alias for `org-use-sub-superscripts' in Org <8.0,
+it is not anymore.
+
+When this option is turned on, you can use TeX-like syntax for
+sub- and superscripts and see them exported correctly.
+
+You can also set the option with #+OPTIONS: ^:t
+
+Several characters after \"_\" or \"^\" will be considered as a
+single item - so grouping with {} is normally not needed. For
+example, the following things will be parsed as single sub- or
+superscripts:
+
+ 10^24 or 10^tau several digits will be considered 1 item.
+ 10^-12 or 10^-tau a leading sign with digits or a word
+ x^2-y^3 will be read as x^2 - y^3, because items are
+ terminated by almost any nonword/nondigit char.
+ x_{i^2} or x^(2-i) braces or parenthesis do grouping.
+
+Still, ambiguity is possible. So when in doubt, use {} to enclose
+the sub/superscript. If you set this variable to the symbol `{}',
+the braces are *required* in order to trigger interpretations as
+sub/superscript. This can be helpful in documents that need \"_\"
+frequently in plain text."
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "Interpret them" t)
+ (const :tag "Curly brackets only" {})
+ (const :tag "Do not interpret them" nil))
+ :safe (lambda (x) (memq x '(t nil {}))))
+
+(defcustom org-export-with-toc t
+ "Non-nil means create a table of contents in exported files.
+
+The table of contents contains headlines with levels up to
+`org-export-headline-levels'.
+
+When this variable is set to an integer N, include levels up to
+N in the table of contents. Although it may then be different
+from `org-export-headline-levels', it is cannot be larger than
+the number of headline levels.
+
+When nil, no table of contents is created.
+
+This option can also be set with the OPTIONS keyword,
+e.g. \"toc:nil\" or \"toc:3\"."
+ :group 'org-export-general
+ :type '(choice
+ (const :tag "No Table of Contents" nil)
+ (const :tag "Full Table of Contents" t)
+ (integer :tag "TOC to level"))
+ :safe (lambda (x)
+ (or (booleanp x)
+ (integerp x))))
+
+(defcustom org-export-with-tables t
+ "Non-nil means export tables.
+This option can also be set with the OPTIONS keyword,
+e.g. \"|:nil\"."
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-tags t
+ "If nil, do not export tags, just remove them from headlines.
+
+If this is the symbol `not-in-toc', tags will be removed from
+table of contents entries, but still be shown in the headlines of
+the document.
+
+This option can also be set with the OPTIONS keyword,
+e.g. \"tags:nil\"."
+ :group 'org-export-general
+ :type '(choice
+ (const :tag "Off" nil)
+ (const :tag "Not in TOC" not-in-toc)
+ (const :tag "On" t))
+ :safe (lambda (x) (memq x '(t nil not-in-toc))))
+
+(defcustom org-export-with-tasks t
+ "Non-nil means include TODO items for export.
+
+This may have the following values:
+t include tasks independent of state.
+`todo' include only tasks that are not yet done.
+`done' include only tasks that are already done.
+nil ignore all tasks.
+list of keywords include tasks with these keywords.
+
+This option can also be set with the OPTIONS keyword,
+e.g. \"tasks:nil\"."
+ :group 'org-export-general
+ :type '(choice
+ (const :tag "All tasks" t)
+ (const :tag "No tasks" nil)
+ (const :tag "Not-done tasks" todo)
+ (const :tag "Only done tasks" done)
+ (repeat :tag "Specific TODO keywords"
+ (string :tag "Keyword")))
+ :safe (lambda (x) (or (memq x '(nil t todo done))
+ (and (listp x)
+ (cl-every #'stringp x)))))
+
+(defcustom org-export-with-title t
+ "Non-nil means print title into the exported file.
+This option can also be set with the OPTIONS keyword,
+e.g. \"title:nil\"."
+ :group 'org-export-general
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-time-stamp-file t
+ "Non-nil means insert a time stamp into the exported file.
+The time stamp shows when the file was created. This option can
+also be set with the OPTIONS keyword, e.g. \"timestamp:nil\"."
+ :group 'org-export-general
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-with-timestamps t
+ "Non-nil means allow timestamps in export.
+
+It can be set to any of the following values:
+ t export all timestamps.
+ `active' export active timestamps only.
+ `inactive' export inactive timestamps only.
+ nil do not export timestamps
+
+This only applies to timestamps isolated in a paragraph
+containing only timestamps. Other timestamps are always
+exported.
+
+This option can also be set with the OPTIONS keyword, e.g.
+\"<:nil\"."
+ :group 'org-export-general
+ :type '(choice
+ (const :tag "All timestamps" t)
+ (const :tag "Only active timestamps" active)
+ (const :tag "Only inactive timestamps" inactive)
+ (const :tag "No timestamp" nil))
+ :safe (lambda (x) (memq x '(t nil active inactive))))
+
+(defcustom org-export-with-todo-keywords t
+ "Non-nil means include TODO keywords in export.
+When nil, remove all these keywords from the export. This option
+can also be set with the OPTIONS keyword, e.g. \"todo:nil\"."
+ :group 'org-export-general
+ :type 'boolean)
+
+(defcustom org-export-allow-bind-keywords nil
+ "Non-nil means BIND keywords can define local variable values.
+This is a potential security risk, which is why the default value
+is nil. You can also allow them through local buffer variables."
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defcustom org-export-with-broken-links nil
+ "Non-nil means do not raise an error on broken links.
+
+When this variable is non-nil, broken links are ignored, without
+stopping the export process. If it is set to `mark', broken
+links are marked as such in the output, with a string like
+
+ [BROKEN LINK: path]
+
+where PATH is the un-resolvable reference.
+
+This option can also be set with the OPTIONS keyword, e.g.,
+\"broken-links:mark\"."
+ :group 'org-export-general
+ :version "26.1"
+ :package-version '(Org . "9.0")
+ :type '(choice
+ (const :tag "Ignore broken links" t)
+ (const :tag "Mark broken links in output" mark)
+ (const :tag "Raise an error" nil)))
+
+(defcustom org-export-snippet-translation-alist nil
+ "Alist between export snippets back-ends and exporter back-ends.
+
+This variable allows providing shortcuts for export snippets.
+
+For example, with a value of \\='((\"h\" . \"html\")), the
+HTML back-end will recognize the contents of \"@@h:<b>@@\" as
+HTML code while every other back-end will ignore it."
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(repeat
+ (cons (string :tag "Shortcut")
+ (string :tag "Back-end")))
+ :safe (lambda (x)
+ (and (listp x)
+ (cl-every #'consp x)
+ (cl-every #'stringp (mapcar #'car x))
+ (cl-every #'stringp (mapcar #'cdr x)))))
+
+(defcustom org-export-global-macros nil
+ "Alist between macro names and expansion templates.
+
+This variable defines macro expansion templates available
+globally. Associations follow the pattern
+
+ (NAME . TEMPLATE)
+
+where NAME is a string beginning with a letter and consisting of
+alphanumeric characters only.
+
+TEMPLATE is the string to which the macro is going to be
+expanded. Inside, \"$1\", \"$2\"... are place-holders for
+macro's arguments. Moreover, if the template starts with
+\"(eval\", it will be parsed as an Elisp expression and evaluated
+accordingly."
+ :group 'org-export-general
+ :version "26.1"
+ :package-version '(Org . "9.1")
+ :type '(repeat
+ (cons (string :tag "Name")
+ (string :tag "Template"))))
+
+(defcustom org-export-coding-system nil
+ "Coding system for the exported file."
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'coding-system)
+
+(defcustom org-export-copy-to-kill-ring nil
+ "Non-nil means pushing export output to the kill ring.
+This variable is ignored during asynchronous export."
+ :group 'org-export-general
+ :version "26.1"
+ :package-version '(Org . "8.3")
+ :type '(choice
+ (const :tag "Always" t)
+ (const :tag "When export is done interactively" if-interactive)
+ (const :tag "Never" nil)))
+
+(defcustom org-export-initial-scope 'buffer
+ "The initial scope when exporting with `org-export-dispatch'.
+This variable can be either set to `buffer' or `subtree'."
+ :group 'org-export-general
+ :type '(choice
+ (const :tag "Export current buffer" buffer)
+ (const :tag "Export current subtree" subtree)))
+
+(defcustom org-export-show-temporary-export-buffer t
+ "Non-nil means show buffer after exporting to temp buffer.
+When Org exports to a file, the buffer visiting that file is never
+shown, but remains buried. However, when exporting to
+a temporary buffer, that buffer is popped up in a second window.
+When this variable is nil, the buffer remains buried also in
+these cases."
+ :group 'org-export-general
+ :type 'boolean)
+
+(defcustom org-export-in-background nil
+ "Non-nil means export and publishing commands will run in background.
+Results from an asynchronous export are never displayed
+automatically. But you can retrieve them with `\\[org-export-stack]'."
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+(defcustom org-export-async-init-file nil
+ "File used to initialize external export process.
+
+Value must be either nil or an absolute file name. When nil, the
+external process is launched like a regular Emacs session,
+loading user's initialization file and any site specific
+configuration. If a file is provided, it, and only it, is loaded
+at start-up.
+
+Therefore, using a specific configuration makes the process to
+load faster and the export more portable."
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type '(choice
+ (const :tag "Regular startup" nil)
+ (file :tag "Specific start-up file" :must-match t)))
+
+(defcustom org-export-dispatch-use-expert-ui nil
+ "Non-nil means using a non-intrusive `org-export-dispatch'.
+In that case, no help buffer is displayed. Though, an indicator
+for current export scope is added to the prompt (\"b\" when
+output is restricted to body only, \"s\" when it is restricted to
+the current subtree, \"v\" when only visible elements are
+considered for export, \"f\" when publishing functions should be
+passed the FORCE argument and \"a\" when the export should be
+asynchronous). Also, [?] allows switching back to standard
+mode."
+ :group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
+ :type 'boolean)
+
+
+
+;;; Defining Back-ends
+;;
+;; An export back-end is a structure with `org-export-backend' type
+;; and `name', `parent', `transcoders', `options', `filters', `blocks'
+;; and `menu' slots.
+;;
+;; At the lowest level, a back-end is created with
+;; `org-export-create-backend' function.
+;;
+;; A named back-end can be registered with
+;; `org-export-register-backend' function. A registered back-end can
+;; later be referred to by its name, with `org-export-get-backend'
+;; function. Also, such a back-end can become the parent of a derived
+;; back-end from which slot values will be inherited by default.
+;; `org-export-derived-backend-p' can check if a given back-end is
+;; derived from a list of back-end names.
+;;
+;; `org-export-get-all-transcoders', `org-export-get-all-options' and
+;; `org-export-get-all-filters' return the full alist of transcoders,
+;; options and filters, including those inherited from ancestors.
+;;
+;; At a higher level, `org-export-define-backend' is the standard way
+;; to define an export back-end. If the new back-end is similar to
+;; a registered back-end, `org-export-define-derived-backend' may be
+;; used instead.
+;;
+;; Eventually `org-export-barf-if-invalid-backend' returns an error
+;; when a given back-end hasn't been registered yet.
+
+(cl-defstruct (org-export-backend (:constructor org-export-create-backend)
+ (:copier nil))
+ name parent transcoders options filters blocks menu)
+
+;;;###autoload
+(defun org-export-get-backend (name)
+ "Return export back-end named after NAME.
+NAME is a symbol. Return nil if no such back-end is found."
+ (cl-find-if (lambda (b) (and (eq name (org-export-backend-name b))))
+ org-export-registered-backends))
+
+(defun org-export-register-backend (backend)
+ "Register BACKEND as a known export back-end.
+BACKEND is a structure with `org-export-backend' type."
+ ;; Refuse to register an unnamed back-end.
+ (unless (org-export-backend-name backend)
+ (error "Cannot register a unnamed export back-end"))
+ ;; Refuse to register a back-end with an unknown parent.
+ (let ((parent (org-export-backend-parent backend)))
+ (when (and parent (not (org-export-get-backend parent)))
+ (error "Cannot use unknown \"%s\" back-end as a parent" parent)))
+ ;; If a back-end with the same name as BACKEND is already
+ ;; registered, replace it with BACKEND. Otherwise, simply add
+ ;; BACKEND to the list of registered back-ends.
+ (let ((old (org-export-get-backend (org-export-backend-name backend))))
+ (if old (setcar (memq old org-export-registered-backends) backend)
+ (push backend org-export-registered-backends))))
+
+(defun org-export-barf-if-invalid-backend (backend)
+ "Signal an error if BACKEND isn't defined."
+ (unless (org-export-backend-p backend)
+ (error "Unknown \"%s\" back-end: Aborting export" backend)))
+
+;;;###autoload
+(defun org-export-derived-backend-p (backend &rest backends)
+ "Non-nil if BACKEND is derived from one of BACKENDS.
+BACKEND is an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end. BACKENDS is constituted of symbols."
+ (when (symbolp backend) (setq backend (org-export-get-backend backend)))
+ (when backend
+ (catch 'exit
+ (while (org-export-backend-parent backend)
+ (when (memq (org-export-backend-name backend) backends)
+ (throw 'exit t))
+ (setq backend
+ (org-export-get-backend (org-export-backend-parent backend))))
+ (memq (org-export-backend-name backend) backends))))
+
+(defun org-export-get-all-transcoders (backend)
+ "Return full translation table for BACKEND.
+
+BACKEND is an export back-end, as return by, e.g,,
+`org-export-create-backend'. Return value is an alist where
+keys are element or object types, as symbols, and values are
+transcoders.
+
+Unlike to `org-export-backend-transcoders', this function
+also returns transcoders inherited from parent back-ends,
+if any."
+ (when (symbolp backend) (setq backend (org-export-get-backend backend)))
+ (when backend
+ (let ((transcoders (org-export-backend-transcoders backend))
+ parent)
+ (while (setq parent (org-export-backend-parent backend))
+ (setq backend (org-export-get-backend parent))
+ (setq transcoders
+ (append transcoders (org-export-backend-transcoders backend))))
+ transcoders)))
+
+(defun org-export-get-all-options (backend)
+ "Return export options for BACKEND.
+
+BACKEND is an export back-end, as return by, e.g,,
+`org-export-create-backend'. See `org-export-options-alist'
+for the shape of the return value.
+
+Unlike to `org-export-backend-options', this function also
+returns options inherited from parent back-ends, if any.
+
+Return nil if BACKEND is unknown."
+ (when (symbolp backend) (setq backend (org-export-get-backend backend)))
+ (when backend
+ (let ((options (org-export-backend-options backend))
+ parent)
+ (while (setq parent (org-export-backend-parent backend))
+ (setq backend (org-export-get-backend parent))
+ (setq options (append options (org-export-backend-options backend))))
+ options)))
+
+(defun org-export-get-all-filters (backend)
+ "Return complete list of filters for BACKEND.
+
+BACKEND is an export back-end, as return by, e.g,,
+`org-export-create-backend'. Return value is an alist where
+keys are symbols and values lists of functions.
+
+Unlike to `org-export-backend-filters', this function also
+returns filters inherited from parent back-ends, if any."
+ (when (symbolp backend) (setq backend (org-export-get-backend backend)))
+ (when backend
+ (let ((filters (org-export-backend-filters backend))
+ parent)
+ (while (setq parent (org-export-backend-parent backend))
+ (setq backend (org-export-get-backend parent))
+ (setq filters (append filters (org-export-backend-filters backend))))
+ filters)))
+
+(defun org-export-define-backend (backend transcoders &rest body)
+ "Define a new back-end BACKEND.
+
+TRANSCODERS is an alist between object or element types and
+functions handling them.
+
+These functions should return a string without any trailing
+space, or nil. They must accept three arguments: the object or
+element itself, its contents or nil when it isn't recursive and
+the property list used as a communication channel.
+
+Contents, when not nil, are stripped from any global indentation
+\(although the relative one is preserved). They also always end
+with a single newline character.
+
+If, for a given type, no function is found, that element or
+object type will simply be ignored, along with any blank line or
+white space at its end. The same will happen if the function
+returns the nil value. If that function returns the empty
+string, the type will be ignored, but the blank lines or white
+spaces will be kept.
+
+In addition to element and object types, one function can be
+associated to the `template' (or `inner-template') symbol and
+another one to the `plain-text' symbol.
+
+The former returns the final transcoded string, and can be used
+to add a preamble and a postamble to document's body. It must
+accept two arguments: the transcoded string and the property list
+containing export options. A function associated to `template'
+will not be applied if export has option \"body-only\".
+A function associated to `inner-template' is always applied.
+
+The latter, when defined, is to be called on every text not
+recognized as an element or an object. It must accept two
+arguments: the text string and the information channel. It is an
+appropriate place to protect special chars relative to the
+back-end.
+
+BODY can start with pre-defined keyword arguments. The following
+keywords are understood:
+
+ :filters-alist
+
+ Alist between filters and function, or list of functions,
+ specific to the back-end. See `org-export-filters-alist' for
+ a list of all allowed filters. Filters defined here
+ shouldn't make a back-end test, as it may prevent back-ends
+ derived from this one to behave properly.
+
+ :menu-entry
+
+ Menu entry for the export dispatcher. It should be a list
+ like:
+
+ \\='(KEY DESCRIPTION-OR-ORDINAL ACTION-OR-MENU)
+
+ where :
+
+ KEY is a free character selecting the back-end.
+
+ DESCRIPTION-OR-ORDINAL is either a string or a number.
+
+ If it is a string, is will be used to name the back-end in
+ its menu entry. If it is a number, the following menu will
+ be displayed as a sub-menu of the back-end with the same
+ KEY. Also, the number will be used to determine in which
+ order such sub-menus will appear (lowest first).
+
+ ACTION-OR-MENU is either a function or an alist.
+
+ If it is an action, it will be called with four
+ arguments (booleans): ASYNC, SUBTREEP, VISIBLE-ONLY and
+ BODY-ONLY. See `org-export-as' for further explanations on
+ some of them.
+
+ If it is an alist, associations should follow the
+ pattern:
+
+ \\='(KEY DESCRIPTION ACTION)
+
+ where KEY, DESCRIPTION and ACTION are described above.
+
+ Valid values include:
+
+ \\='(?m \"My Special Back-end\" my-special-export-function)
+
+ or
+
+ \\='(?l \"Export to LaTeX\"
+ ((?p \"As PDF file\" org-latex-export-to-pdf)
+ (?o \"As PDF file and open\"
+ (lambda (a s v b)
+ (if a (org-latex-export-to-pdf t s v b)
+ (org-open-file
+ (org-latex-export-to-pdf nil s v b)))))))
+
+ or the following, which will be added to the previous
+ sub-menu,
+
+ \\='(?l 1
+ ((?B \"As TEX buffer (Beamer)\" org-beamer-export-as-latex)
+ (?P \"As PDF file (Beamer)\" org-beamer-export-to-pdf)))
+
+ :options-alist
+
+ Alist between back-end specific properties introduced in
+ communication channel and how their value are acquired. See
+ `org-export-options-alist' for more information about
+ structure of the values."
+ (declare (indent 1))
+ (let (filters menu-entry options)
+ (while (keywordp (car body))
+ (let ((keyword (pop body)))
+ (pcase keyword
+ (:filters-alist (setq filters (pop body)))
+ (:menu-entry (setq menu-entry (pop body)))
+ (:options-alist (setq options (pop body)))
+ (_ (error "Unknown keyword: %s" keyword)))))
+ (org-export-register-backend
+ (org-export-create-backend :name backend
+ :transcoders transcoders
+ :options options
+ :filters filters
+ :menu menu-entry))))
+
+(defun org-export-define-derived-backend (child parent &rest body)
+ "Create a new back-end as a variant of an existing one.
+
+CHILD is the name of the derived back-end. PARENT is the name of
+the parent back-end.
+
+BODY can start with pre-defined keyword arguments. The following
+keywords are understood:
+
+ :filters-alist
+
+ Alist of filters that will overwrite or complete filters
+ defined in PARENT back-end. See `org-export-filters-alist'
+ for a list of allowed filters.
+
+ :menu-entry
+
+ Menu entry for the export dispatcher. See
+ `org-export-define-backend' for more information about the
+ expected value.
+
+ :options-alist
+
+ Alist of back-end specific properties that will overwrite or
+ complete those defined in PARENT back-end. Refer to
+ `org-export-options-alist' for more information about
+ structure of the values.
+
+ :translate-alist
+
+ Alist of element and object types and transcoders that will
+ overwrite or complete transcode table from PARENT back-end.
+ Refer to `org-export-define-backend' for detailed information
+ about transcoders.
+
+As an example, here is how one could define \"my-latex\" back-end
+as a variant of `latex' back-end with a custom template function:
+
+ (org-export-define-derived-backend \\='my-latex \\='latex
+ :translate-alist \\='((template . my-latex-template-fun)))
+
+The back-end could then be called with, for example:
+
+ (org-export-to-buffer \\='my-latex \"*Test my-latex*\")"
+ (declare (indent 2))
+ (let (filters menu-entry options transcoders)
+ (while (keywordp (car body))
+ (let ((keyword (pop body)))
+ (pcase keyword
+ (:filters-alist (setq filters (pop body)))
+ (:menu-entry (setq menu-entry (pop body)))
+ (:options-alist (setq options (pop body)))
+ (:translate-alist (setq transcoders (pop body)))
+ (_ (error "Unknown keyword: %s" keyword)))))
+ (org-export-register-backend
+ (org-export-create-backend :name child
+ :parent parent
+ :transcoders transcoders
+ :options options
+ :filters filters
+ :menu menu-entry))))
+
+
+
+;;; The Communication Channel
+;;
+;; During export process, every function has access to a number of
+;; properties. They are of two types:
+;;
+;; 1. Environment options are collected once at the very beginning of
+;; the process, out of the original buffer and configuration.
+;; Collecting them is handled by `org-export-get-environment'
+;; function.
+;;
+;; Most environment options are defined through the
+;; `org-export-options-alist' variable.
+;;
+;; 2. Tree properties are extracted directly from the parsed tree,
+;; just before export, by `org-export--collect-tree-properties'.
+
+;;;; Environment Options
+;;
+;; Environment options encompass all parameters defined outside the
+;; scope of the parsed data. They come from five sources, in
+;; increasing precedence order:
+;;
+;; - Global variables,
+;; - Buffer's attributes,
+;; - Options keyword symbols,
+;; - Buffer keywords,
+;; - Subtree properties.
+;;
+;; The central internal function with regards to environment options
+;; is `org-export-get-environment'. It updates global variables with
+;; "#+BIND:" keywords, then retrieve and prioritize properties from
+;; the different sources.
+;;
+;; The internal functions doing the retrieval are:
+;; `org-export--get-global-options',
+;; `org-export--get-buffer-attributes',
+;; `org-export--parse-option-keyword',
+;; `org-export--get-subtree-options' and
+;; `org-export--get-inbuffer-options'
+;;
+;; Also, `org-export--list-bound-variables' collects bound variables
+;; along with their value in order to set them as buffer local
+;; variables later in the process.
+
+;;;###autoload
+(defun org-export-get-environment (&optional backend subtreep ext-plist)
+ "Collect export options from the current buffer.
+
+Optional argument BACKEND is an export back-end, as returned by
+`org-export-create-backend'.
+
+When optional argument SUBTREEP is non-nil, assume the export is
+done against the current sub-tree.
+
+Third optional argument EXT-PLIST is a property list with
+external parameters overriding Org default settings, but still
+inferior to file-local settings."
+ ;; First install #+BIND variables since these must be set before
+ ;; global options are read.
+ (dolist (pair (org-export--list-bound-variables))
+ (set (make-local-variable (car pair)) (nth 1 pair)))
+ ;; Get and prioritize export options...
+ (org-combine-plists
+ ;; ... from global variables...
+ (org-export--get-global-options backend)
+ ;; ... from an external property list...
+ ext-plist
+ ;; ... from in-buffer settings...
+ (org-export--get-inbuffer-options backend)
+ ;; ... and from subtree, when appropriate.
+ (and subtreep (org-export--get-subtree-options backend))))
+
+(defun org-export--parse-option-keyword (options &optional backend)
+ "Parse an OPTIONS line and return values as a plist.
+Optional argument BACKEND is an export back-end, as returned by,
+e.g., `org-export-create-backend'. It specifies which back-end
+specific items to read, if any."
+ (let ((line
+ (let ((s 0) alist)
+ (while (string-match "\\(.+?\\):\\((.*?)\\|\\S-+\\)?[ \t]*" options s)
+ (setq s (match-end 0))
+ (let ((value (match-string 2 options)))
+ (when value
+ (push (cons (match-string 1 options)
+ (read value))
+ alist))))
+ alist))
+ ;; Priority is given to back-end specific options.
+ (all (append (org-export-get-all-options backend)
+ org-export-options-alist))
+ (plist))
+ (when line
+ (dolist (entry all plist)
+ (let ((item (nth 2 entry)))
+ (when item
+ (let ((v (assoc-string item line t)))
+ (when v (setq plist (plist-put plist (car entry) (cdr v)))))))))))
+
+(defun org-export--get-subtree-options (&optional backend)
+ "Get export options in subtree at point.
+Optional argument BACKEND is an export back-end, as returned by,
+e.g., `org-export-create-backend'. It specifies back-end used
+for export. Return options as a plist."
+ ;; For each buffer keyword, create a headline property setting the
+ ;; same property in communication channel. The name for the
+ ;; property is the keyword with "EXPORT_" appended to it.
+ (org-with-wide-buffer
+ ;; Make sure point is at a heading.
+ (if (org-at-heading-p) (org-up-heading-safe) (org-back-to-heading t))
+ (let ((plist
+ ;; EXPORT_OPTIONS are parsed in a non-standard way. Take
+ ;; care of them right from the start.
+ (let ((o (org-entry-get (point) "EXPORT_OPTIONS" 'selective)))
+ (and o (org-export--parse-option-keyword o backend))))
+ ;; Take care of EXPORT_TITLE. If it isn't defined, use
+ ;; headline's title (with no todo keyword, priority cookie or
+ ;; tag) as its fallback value.
+ (cache (list
+ (cons "TITLE"
+ (or (org-entry-get (point) "EXPORT_TITLE" 'selective)
+ (let ((case-fold-search nil))
+ (looking-at org-complex-heading-regexp)
+ (match-string-no-properties 4))))))
+ ;; Look for both general keywords and back-end specific
+ ;; options, with priority given to the latter.
+ (options (append (org-export-get-all-options backend)
+ org-export-options-alist)))
+ ;; Handle other keywords. Then return PLIST.
+ (dolist (option options plist)
+ (let ((property (car option))
+ (keyword (nth 1 option)))
+ (when keyword
+ (let ((value
+ (or (cdr (assoc keyword cache))
+ (let ((v (org-entry-get (point)
+ (concat "EXPORT_" keyword)
+ 'selective)))
+ (push (cons keyword v) cache) v))))
+ (when value
+ (setq plist
+ (plist-put plist
+ property
+ (cl-case (nth 4 option)
+ (parse
+ (org-element-parse-secondary-string
+ value (org-element-restriction 'keyword)))
+ (split (split-string value))
+ (t value))))))))))))
+
+(defun org-export--get-inbuffer-options (&optional backend)
+ "Return current buffer export options, as a plist.
+
+Optional argument BACKEND, when non-nil, is an export back-end,
+as returned by, e.g., `org-export-create-backend'. It specifies
+which back-end specific options should also be read in the
+process.
+
+Assume buffer is in Org mode. Narrowing, if any, is ignored."
+ (let* ((case-fold-search t)
+ (options (append
+ ;; Priority is given to back-end specific options.
+ (org-export-get-all-options backend)
+ org-export-options-alist))
+ plist to-parse)
+ (let ((find-properties
+ (lambda (keyword)
+ ;; Return all properties associated to KEYWORD.
+ (let (properties)
+ (dolist (option options properties)
+ (when (equal (nth 1 option) keyword)
+ (cl-pushnew (car option) properties)))))))
+ ;; Read options in the current buffer and return value.
+ (dolist (entry (org-collect-keywords
+ (nconc (delq nil (mapcar #'cadr options))
+ '("FILETAGS" "OPTIONS"))))
+ (pcase entry
+ (`("OPTIONS" . ,values)
+ (setq plist
+ (apply #'org-combine-plists
+ plist
+ (mapcar (lambda (v)
+ (org-export--parse-option-keyword v backend))
+ values))))
+ (`("FILETAGS" . ,values)
+ (setq plist
+ (plist-put plist
+ :filetags
+ (org-uniquify
+ (cl-mapcan (lambda (v) (org-split-string v ":"))
+ values)))))
+ (`(,keyword . ,values)
+ (dolist (property (funcall find-properties keyword))
+ (setq plist
+ (plist-put
+ plist property
+ ;; Handle value depending on specified BEHAVIOR.
+ (cl-case (nth 4 (assq property options))
+ (parse
+ (unless (memq property to-parse)
+ (push property to-parse))
+ ;; Even if `parse' implies `space' behavior, we
+ ;; separate line with "\n" so as to preserve
+ ;; line-breaks.
+ (mapconcat #'identity values "\n"))
+ (space
+ (mapconcat #'identity values " "))
+ (newline
+ (mapconcat #'identity values "\n"))
+ (split
+ (cl-mapcan (lambda (v) (split-string v)) values))
+ ((t)
+ (org-last values))
+ (otherwise
+ (car values)))))))))
+ ;; Parse properties in TO-PARSE. Remove newline characters not
+ ;; involved in line breaks to simulate `space' behavior.
+ ;; Finally return options.
+ (dolist (p to-parse plist)
+ (let ((value (org-element-parse-secondary-string
+ (plist-get plist p)
+ (org-element-restriction 'keyword))))
+ (org-element-map value 'plain-text
+ (lambda (s)
+ (org-element-set-element
+ s (replace-regexp-in-string "\n" " " s))))
+ (setq plist (plist-put plist p value)))))))
+
+(defun org-export--get-export-attributes
+ (&optional backend subtreep visible-only body-only)
+ "Return properties related to export process, as a plist.
+Optional arguments BACKEND, SUBTREEP, VISIBLE-ONLY and BODY-ONLY
+are like the arguments with the same names of function
+`org-export-as'."
+ (list :export-options (delq nil
+ (list (and subtreep 'subtree)
+ (and visible-only 'visible-only)
+ (and body-only 'body-only)))
+ :back-end backend
+ :translate-alist (org-export-get-all-transcoders backend)
+ :exported-data (make-hash-table :test #'eq :size 4001)))
+
+(defun org-export--get-buffer-attributes ()
+ "Return properties related to buffer attributes, as a plist."
+ (list :input-buffer (buffer-name (buffer-base-buffer))
+ :input-file (buffer-file-name (buffer-base-buffer))))
+
+(defun org-export--get-global-options (&optional backend)
+ "Return global export options as a plist.
+Optional argument BACKEND, if non-nil, is an export back-end, as
+returned by, e.g., `org-export-create-backend'. It specifies
+which back-end specific export options should also be read in the
+process."
+ (let (plist
+ ;; Priority is given to back-end specific options.
+ (all (append (org-export-get-all-options backend)
+ org-export-options-alist)))
+ (dolist (cell all plist)
+ (let ((prop (car cell)))
+ (unless (plist-member plist prop)
+ (setq plist
+ (plist-put
+ plist
+ prop
+ ;; Evaluate default value provided.
+ (let ((value (eval (nth 3 cell) t)))
+ (if (eq (nth 4 cell) 'parse)
+ (org-element-parse-secondary-string
+ value (org-element-restriction 'keyword))
+ value)))))))))
+
+(defun org-export--list-bound-variables ()
+ "Return variables bound from BIND keywords in current buffer.
+Also look for BIND keywords in setup files. The return value is
+an alist where associations are (VARIABLE-NAME VALUE)."
+ (when org-export-allow-bind-keywords
+ (pcase (org-collect-keywords '("BIND"))
+ (`(("BIND" . ,values))
+ (mapcar (lambda (v) (read (format "(%s)" v)))
+ values)))))
+
+;; defsubst org-export-get-parent must be defined before first use,
+;; was originally defined in the topology section
+
+(defsubst org-export-get-parent (blob)
+ "Return BLOB parent or nil.
+BLOB is the element or object considered."
+ (org-element-property :parent blob))
+
+;;;; Tree Properties
+;;
+;; Tree properties are information extracted from parse tree. They
+;; are initialized at the beginning of the transcoding process by
+;; `org-export--collect-tree-properties'.
+;;
+;; Dedicated functions focus on computing the value of specific tree
+;; properties during initialization. Thus,
+;; `org-export--populate-ignore-list' lists elements and objects that
+;; should be skipped during export, `org-export--get-min-level' gets
+;; the minimal exportable level, used as a basis to compute relative
+;; level for headlines. Eventually
+;; `org-export--collect-headline-numbering' builds an alist between
+;; headlines and their numbering.
+
+(defun org-export--collect-tree-properties (data info)
+ "Extract tree properties from parse tree.
+
+DATA is the parse tree from which information is retrieved. INFO
+is a list holding export options.
+
+Following tree properties are set or updated:
+
+`:headline-offset' Offset between true level of headlines and
+ local level. An offset of -1 means a headline
+ of level 2 should be considered as a level
+ 1 headline in the context.
+
+`:headline-numbering' Alist of all headlines as key and the
+ associated numbering as value.
+
+`:id-alist' Alist of all ID references as key and associated file
+ as value.
+
+Return updated plist."
+ ;; Install the parse tree in the communication channel.
+ (setq info (plist-put info :parse-tree data))
+ ;; Compute `:headline-offset' in order to be able to use
+ ;; `org-export-get-relative-level'.
+ (setq info
+ (plist-put info
+ :headline-offset
+ (- 1 (org-export--get-min-level data info))))
+ ;; From now on, properties order doesn't matter: get the rest of the
+ ;; tree properties.
+ (org-combine-plists
+ info
+ (list :headline-numbering (org-export--collect-headline-numbering data info)
+ :id-alist
+ (org-element-map data 'link
+ (lambda (l)
+ (and (string= (org-element-property :type l) "id")
+ (let* ((id (org-element-property :path l))
+ (file (car (org-id-find id))))
+ (and file (cons id (file-relative-name file))))))))))
+
+(defun org-export--get-min-level (data options)
+ "Return minimum exportable headline's level in DATA.
+DATA is parsed tree as returned by `org-element-parse-buffer'.
+OPTIONS is a plist holding export options."
+ (catch 'exit
+ (let ((min-level 10000))
+ (dolist (datum (org-element-contents data))
+ (when (and (eq (org-element-type datum) 'headline)
+ (not (org-element-property :footnote-section-p datum))
+ (not (memq datum (plist-get options :ignore-list))))
+ (setq min-level (min (org-element-property :level datum) min-level))
+ (when (= min-level 1) (throw 'exit 1))))
+ ;; If no headline was found, for the sake of consistency, set
+ ;; minimum level to 1 nonetheless.
+ (if (= min-level 10000) 1 min-level))))
+
+(defun org-export--collect-headline-numbering (data options)
+ "Return numbering of all exportable, numbered headlines in a parse tree.
+
+DATA is the parse tree. OPTIONS is the plist holding export
+options.
+
+Return an alist whose key is a headline and value is its
+associated numbering \(in the shape of a list of numbers) or nil
+for a footnotes section."
+ (let ((numbering (make-vector org-export-max-depth 0)))
+ (org-element-map data 'headline
+ (lambda (headline)
+ (when (and (org-export-numbered-headline-p headline options)
+ (not (org-element-property :footnote-section-p headline)))
+ (let ((relative-level
+ (1- (org-export-get-relative-level headline options))))
+ (cons
+ headline
+ (cl-loop
+ for n across numbering
+ for idx from 0 to org-export-max-depth
+ when (< idx relative-level) collect n
+ when (= idx relative-level) collect (aset numbering idx (1+ n))
+ when (> idx relative-level) do (aset numbering idx 0))))))
+ options)))
+
+(defun org-export--selected-trees (data info)
+ "List headlines and inlinetasks with a select tag in their tree.
+DATA is parsed data as returned by `org-element-parse-buffer'.
+INFO is a plist holding export options."
+ (let ((select (cl-mapcan (lambda (tag) (org-tags-expand tag t))
+ (plist-get info :select-tags))))
+ (if (cl-some (lambda (tag) (member tag select)) (plist-get info :filetags))
+ ;; If FILETAGS contains a select tag, every headline or
+ ;; inlinetask is returned.
+ (org-element-map data '(headline inlinetask) #'identity)
+ (letrec ((selected-trees nil)
+ (walk-data
+ (lambda (data genealogy)
+ (let ((type (org-element-type data)))
+ (cond
+ ((memq type '(headline inlinetask))
+ (let ((tags (org-element-property :tags data)))
+ (if (cl-some (lambda (tag) (member tag select)) tags)
+ ;; When a select tag is found, mark full
+ ;; genealogy and every headline within the
+ ;; tree as acceptable.
+ (setq selected-trees
+ (append
+ genealogy
+ (org-element-map data '(headline inlinetask)
+ #'identity)
+ selected-trees))
+ ;; If at a headline, continue searching in
+ ;; tree, recursively.
+ (when (eq type 'headline)
+ (dolist (el (org-element-contents data))
+ (funcall walk-data el (cons data genealogy)))))))
+ ((or (eq type 'org-data)
+ (memq type org-element-greater-elements))
+ (dolist (el (org-element-contents data))
+ (funcall walk-data el genealogy))))))))
+ (funcall walk-data data nil)
+ selected-trees))))
+
+(defun org-export--skip-p (datum options selected excluded)
+ "Non-nil when element or object DATUM should be skipped during export.
+OPTIONS is the plist holding export options. SELECTED, when
+non-nil, is a list of headlines or inlinetasks belonging to
+a tree with a select tag. EXCLUDED is a list of tags, as
+strings. Any headline or inlinetask marked with one of those is
+not exported."
+ (cl-case (org-element-type datum)
+ ((comment comment-block)
+ ;; Skip all comments and comment blocks. Make to keep maximum
+ ;; number of blank lines around the comment so as to preserve
+ ;; local structure of the document upon interpreting it back into
+ ;; Org syntax.
+ (let* ((previous (org-export-get-previous-element datum options))
+ (before (or (org-element-property :post-blank previous) 0))
+ (after (or (org-element-property :post-blank datum) 0)))
+ (when previous
+ (org-element-put-property previous :post-blank (max before after 1))))
+ t)
+ (clock (not (plist-get options :with-clocks)))
+ (drawer
+ (let ((with-drawers-p (plist-get options :with-drawers)))
+ (or (not with-drawers-p)
+ (and (consp with-drawers-p)
+ ;; If `:with-drawers' value starts with `not', ignore
+ ;; every drawer whose name belong to that list.
+ ;; Otherwise, ignore drawers whose name isn't in that
+ ;; list.
+ (let ((name (org-element-property :drawer-name datum)))
+ (if (eq (car with-drawers-p) 'not)
+ (member-ignore-case name (cdr with-drawers-p))
+ (not (member-ignore-case name with-drawers-p))))))))
+ (fixed-width (not (plist-get options :with-fixed-width)))
+ ((footnote-definition footnote-reference)
+ (not (plist-get options :with-footnotes)))
+ ((headline inlinetask)
+ (let ((with-tasks (plist-get options :with-tasks))
+ (todo (org-element-property :todo-keyword datum))
+ (todo-type (org-element-property :todo-type datum))
+ (archived (plist-get options :with-archived-trees))
+ (tags (org-export-get-tags datum options nil t)))
+ (or
+ (and (eq (org-element-type datum) 'inlinetask)
+ (not (plist-get options :with-inlinetasks)))
+ ;; Ignore subtrees with an exclude tag.
+ (cl-some (lambda (tag) (member tag excluded)) tags)
+ ;; When a select tag is present in the buffer, ignore any tree
+ ;; without it.
+ (and selected (not (memq datum selected)))
+ ;; Ignore commented sub-trees.
+ (org-element-property :commentedp datum)
+ ;; Ignore archived subtrees if `:with-archived-trees' is nil.
+ (and (not archived) (org-element-property :archivedp datum))
+ ;; Ignore tasks, if specified by `:with-tasks' property.
+ (and todo
+ (or (not with-tasks)
+ (and (memq with-tasks '(todo done))
+ (not (eq todo-type with-tasks)))
+ (and (consp with-tasks) (not (member todo with-tasks))))))))
+ ((latex-environment latex-fragment) (not (plist-get options :with-latex)))
+ (node-property
+ (let ((properties-set (plist-get options :with-properties)))
+ (cond ((null properties-set) t)
+ ((consp properties-set)
+ (not (member-ignore-case (org-element-property :key datum)
+ properties-set))))))
+ (planning (not (plist-get options :with-planning)))
+ (property-drawer (not (plist-get options :with-properties)))
+ (statistics-cookie (not (plist-get options :with-statistics-cookies)))
+ (table (not (plist-get options :with-tables)))
+ (table-cell
+ (and (org-export-table-has-special-column-p
+ (org-export-get-parent-table datum))
+ (org-export-first-sibling-p datum options)))
+ (table-row (org-export-table-row-is-special-p datum options))
+ (timestamp
+ ;; `:with-timestamps' only applies to isolated timestamps
+ ;; objects, i.e. timestamp objects in a paragraph containing only
+ ;; timestamps and whitespaces.
+ (when (let ((parent (org-export-get-parent-element datum)))
+ (and (memq (org-element-type parent) '(paragraph verse-block))
+ (not (org-element-map parent
+ (cons 'plain-text
+ (remq 'timestamp org-element-all-objects))
+ (lambda (obj)
+ (or (not (stringp obj)) (org-string-nw-p obj)))
+ options t))))
+ (cl-case (plist-get options :with-timestamps)
+ ((nil) t)
+ (active
+ (not (memq (org-element-property :type datum) '(active active-range))))
+ (inactive
+ (not (memq (org-element-property :type datum)
+ '(inactive inactive-range)))))))))
+
+
+;;; The Transcoder
+;;
+;; `org-export-data' reads a parse tree (obtained with, i.e.
+;; `org-element-parse-buffer') and transcodes it into a specified
+;; back-end output. It takes care of filtering out elements or
+;; objects according to export options and organizing the output blank
+;; lines and white space are preserved. The function memoizes its
+;; results, so it is cheap to call it within transcoders.
+;;
+;; It is possible to modify locally the back-end used by
+;; `org-export-data' or even use a temporary back-end by using
+;; `org-export-data-with-backend'.
+;;
+;; `org-export-transcoder' is an accessor returning appropriate
+;; translator function for a given element or object.
+
+(defun org-export-transcoder (blob info)
+ "Return appropriate transcoder for BLOB.
+INFO is a plist containing export directives."
+ (let ((type (org-element-type blob)))
+ ;; Return contents only for complete parse trees.
+ (if (eq type 'org-data) (lambda (_datum contents _info) contents)
+ (let ((transcoder (cdr (assq type (plist-get info :translate-alist)))))
+ (and (functionp transcoder) transcoder)))))
+
+;;;###autoload
+(defun org-export-data (data info)
+ "Convert DATA into current back-end format.
+
+DATA is a parse tree, an element or an object or a secondary
+string. INFO is a plist holding export options.
+
+Return a string."
+ (or (gethash data (plist-get info :exported-data))
+ ;; Handle broken links according to
+ ;; `org-export-with-broken-links'.
+ (cl-macrolet
+ ((broken-link-handler
+ (&rest body)
+ `(condition-case err
+ (progn ,@body)
+ (org-link-broken
+ (pcase (plist-get info :with-broken-links)
+ (`nil (user-error "Unable to resolve link: %S" (nth 1 err)))
+ (`mark (org-export-data
+ (format "[BROKEN LINK: %s]" (nth 1 err)) info))
+ (_ nil))))))
+ (let* ((type (org-element-type data))
+ (parent (org-export-get-parent data))
+ (results
+ (cond
+ ;; Ignored element/object.
+ ((memq data (plist-get info :ignore-list)) nil)
+ ;; Raw code.
+ ((eq type 'raw) (car (org-element-contents data)))
+ ;; Plain text.
+ ((eq type 'plain-text)
+ (org-export-filter-apply-functions
+ (plist-get info :filter-plain-text)
+ (let ((transcoder (org-export-transcoder data info)))
+ (if transcoder (funcall transcoder data info) data))
+ info))
+ ;; Secondary string.
+ ((not type)
+ (mapconcat (lambda (obj) (org-export-data obj info)) data ""))
+ ;; Element/Object without contents or, as a special
+ ;; case, headline with archive tag and archived trees
+ ;; restricted to title only.
+ ((or (not (org-element-contents data))
+ (and (eq type 'headline)
+ (eq (plist-get info :with-archived-trees) 'headline)
+ (org-element-property :archivedp data)))
+ (let ((transcoder (org-export-transcoder data info)))
+ (or (and (functionp transcoder)
+ (broken-link-handler
+ (funcall transcoder data nil info)))
+ ;; Export snippets never return a nil value so
+ ;; that white spaces following them are never
+ ;; ignored.
+ (and (eq type 'export-snippet) ""))))
+ ;; Element/Object with contents.
+ (t
+ (let ((transcoder (org-export-transcoder data info)))
+ (when transcoder
+ (let* ((greaterp (memq type org-element-greater-elements))
+ (objectp
+ (and (not greaterp)
+ (memq type org-element-recursive-objects)))
+ (contents
+ (mapconcat
+ (lambda (element) (org-export-data element info))
+ (org-element-contents
+ (if (or greaterp objectp) data
+ ;; Elements directly containing
+ ;; objects must have their indentation
+ ;; normalized first.
+ (org-element-normalize-contents
+ data
+ ;; When normalizing first paragraph
+ ;; of an item or
+ ;; a footnote-definition, ignore
+ ;; first line's indentation.
+ (and
+ (eq type 'paragraph)
+ (memq (org-element-type parent)
+ '(footnote-definition item))
+ (eq (car (org-element-contents parent))
+ data)
+ (eq (org-element-property :pre-blank parent)
+ 0)))))
+ "")))
+ (broken-link-handler
+ (funcall transcoder data
+ (if (not greaterp) contents
+ (org-element-normalize-string contents))
+ info)))))))))
+ ;; Final result will be memoized before being returned.
+ (puthash
+ data
+ (cond
+ ((not results) "")
+ ((memq type '(nil org-data plain-text raw)) results)
+ ;; Append the same white space between elements or objects
+ ;; as in the original buffer, and call appropriate filters.
+ (t
+ (org-export-filter-apply-functions
+ (plist-get info (intern (format ":filter-%s" type)))
+ (let ((blank (or (org-element-property :post-blank data) 0)))
+ (if (eq (org-element-class data parent) 'object)
+ (concat results (make-string blank ?\s))
+ (concat (org-element-normalize-string results)
+ (make-string blank ?\n))))
+ info)))
+ (plist-get info :exported-data))))))
+
+(defun org-export-data-with-backend (data backend info)
+ "Convert DATA into BACKEND format.
+
+DATA is an element, an object, a secondary string or a string.
+BACKEND is a symbol. INFO is a plist used as a communication
+channel.
+
+Unlike to `org-export-with-backend', this function will
+recursively convert DATA using BACKEND translation table."
+ (when (symbolp backend) (setq backend (org-export-get-backend backend)))
+ ;; Set-up a new communication channel with translations defined in
+ ;; BACKEND as the translate table and a new hash table for
+ ;; memoization.
+ (let ((new-info
+ (org-combine-plists
+ info
+ (list :back-end backend
+ :translate-alist (org-export-get-all-transcoders backend)
+ ;; Size of the hash table is reduced since this
+ ;; function will probably be used on small trees.
+ :exported-data (make-hash-table :test 'eq :size 401)))))
+ (prog1 (org-export-data data new-info)
+ ;; Preserve `:internal-references', as those do not depend on
+ ;; the back-end used; we need to make sure that any new
+ ;; reference when the temporary back-end was active gets through
+ ;; the default one.
+ (plist-put info :internal-references
+ (plist-get new-info :internal-references)))))
+
+(defun org-export-expand (blob contents &optional with-affiliated)
+ "Expand a parsed element or object to its original state.
+
+BLOB is either an element or an object. CONTENTS is its
+contents, as a string or nil.
+
+When optional argument WITH-AFFILIATED is non-nil, add affiliated
+keywords before output."
+ (let ((type (org-element-type blob)))
+ (concat (and with-affiliated
+ (eq (org-element-class blob) 'element)
+ (org-element--interpret-affiliated-keywords blob))
+ (funcall (intern (format "org-element-%s-interpreter" type))
+ blob contents))))
+
+
+
+;;; The Filter System
+;;
+;; Filters allow end-users to tweak easily the transcoded output.
+;; They are the functional counterpart of hooks, as every filter in
+;; a set is applied to the return value of the previous one.
+;;
+;; Every set is back-end agnostic. Although, a filter is always
+;; called, in addition to the string it applies to, with the back-end
+;; used as argument, so it's easy for the end-user to add back-end
+;; specific filters in the set. The communication channel, as
+;; a plist, is required as the third argument.
+;;
+;; From the developer side, filters sets can be installed in the
+;; process with the help of `org-export-define-backend', which
+;; internally stores filters as an alist. Each association has a key
+;; among the following symbols and a function or a list of functions
+;; as value.
+;;
+;; - `:filter-options' applies to the property list containing export
+;; options. Unlike to other filters, functions in this list accept
+;; two arguments instead of three: the property list containing
+;; export options and the back-end. Users can set its value through
+;; `org-export-filter-options-functions' variable.
+;;
+;; - `:filter-parse-tree' applies directly to the complete parsed
+;; tree. Users can set it through
+;; `org-export-filter-parse-tree-functions' variable.
+;;
+;; - `:filter-body' applies to the body of the output, before template
+;; translator chimes in. Users can set it through
+;; `org-export-filter-body-functions' variable.
+;;
+;; - `:filter-final-output' applies to the final transcoded string.
+;; Users can set it with `org-export-filter-final-output-functions'
+;; variable.
+;;
+;; - `:filter-plain-text' applies to any string not recognized as Org
+;; syntax. `org-export-filter-plain-text-functions' allows users to
+;; configure it.
+;;
+;; - `:filter-TYPE' applies on the string returned after an element or
+;; object of type TYPE has been transcoded. A user can modify
+;; `org-export-filter-TYPE-functions' to install these filters.
+;;
+;; All filters sets are applied with
+;; `org-export-filter-apply-functions' function. Filters in a set are
+;; applied in a LIFO fashion. It allows developers to be sure that
+;; their filters will be applied first.
+;;
+;; Filters properties are installed in communication channel with
+;; `org-export-install-filters' function.
+;;
+;; Eventually, two hooks (`org-export-before-processing-hook' and
+;; `org-export-before-parsing-hook') are run at the beginning of the
+;; export process and just before parsing to allow for heavy structure
+;; modifications.
+
+
+;;;; Hooks
+
+(defvar org-export-before-processing-hook nil
+ "Hook run at the beginning of the export process.
+
+This is run before include keywords and macros are expanded and
+Babel code blocks executed, on a copy of the original buffer
+being exported. Visibility and narrowing are preserved. Point
+is at the beginning of the buffer.
+
+Every function in this hook will be called with one argument: the
+back-end currently used, as a symbol.")
+
+(defvar org-export-before-parsing-hook nil
+ "Hook run before parsing an export buffer.
+
+This is run after include keywords and macros have been expanded
+and Babel code blocks executed, on a copy of the original buffer
+being exported. Visibility and narrowing are preserved. Point
+is at the beginning of the buffer.
+
+Every function in this hook will be called with one argument: the
+back-end currently used, as a symbol.")
+
+
+;;;; Special Filters
+
+(defvar org-export-filter-options-functions nil
+ "List of functions applied to the export options.
+Each filter is called with two arguments: the export options, as
+a plist, and the back-end, as a symbol. It must return
+a property list containing export options.")
+
+(defvar org-export-filter-parse-tree-functions nil
+ "List of functions applied to the parsed tree.
+Each filter is called with three arguments: the parse tree, as
+returned by `org-element-parse-buffer', the back-end, as
+a symbol, and the communication channel, as a plist. It must
+return the modified parse tree to transcode.")
+
+(defvar org-export-filter-plain-text-functions nil
+ "List of functions applied to plain text.
+Each filter is called with three arguments: a string which
+contains no Org syntax, the back-end, as a symbol, and the
+communication channel, as a plist. It must return a string or
+nil.")
+
+(defvar org-export-filter-body-functions nil
+ "List of functions applied to transcoded body.
+Each filter is called with three arguments: a string which
+contains no Org syntax, the back-end, as a symbol, and the
+communication channel, as a plist. It must return a string or
+nil.")
+
+(defvar org-export-filter-final-output-functions nil
+ "List of functions applied to the transcoded string.
+Each filter is called with three arguments: the full transcoded
+string, the back-end, as a symbol, and the communication channel,
+as a plist. It must return a string that will be used as the
+final export output.")
+
+
+;;;; Elements Filters
+
+(defvar org-export-filter-babel-call-functions nil
+ "List of functions applied to a transcoded babel-call.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-center-block-functions nil
+ "List of functions applied to a transcoded center block.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-clock-functions nil
+ "List of functions applied to a transcoded clock.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-diary-sexp-functions nil
+ "List of functions applied to a transcoded diary-sexp.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-drawer-functions nil
+ "List of functions applied to a transcoded drawer.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-dynamic-block-functions nil
+ "List of functions applied to a transcoded dynamic-block.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-example-block-functions nil
+ "List of functions applied to a transcoded example-block.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-export-block-functions nil
+ "List of functions applied to a transcoded export-block.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-fixed-width-functions nil
+ "List of functions applied to a transcoded fixed-width.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-footnote-definition-functions nil
+ "List of functions applied to a transcoded footnote-definition.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-headline-functions nil
+ "List of functions applied to a transcoded headline.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-horizontal-rule-functions nil
+ "List of functions applied to a transcoded horizontal-rule.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-inlinetask-functions nil
+ "List of functions applied to a transcoded inlinetask.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-item-functions nil
+ "List of functions applied to a transcoded item.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-keyword-functions nil
+ "List of functions applied to a transcoded keyword.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-latex-environment-functions nil
+ "List of functions applied to a transcoded latex-environment.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-node-property-functions nil
+ "List of functions applied to a transcoded node-property.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-paragraph-functions nil
+ "List of functions applied to a transcoded paragraph.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-plain-list-functions nil
+ "List of functions applied to a transcoded plain-list.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-planning-functions nil
+ "List of functions applied to a transcoded planning.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-property-drawer-functions nil
+ "List of functions applied to a transcoded property-drawer.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-quote-block-functions nil
+ "List of functions applied to a transcoded quote block.
+Each filter is called with three arguments: the transcoded quote
+data, as a string, the back-end, as a symbol, and the
+communication channel, as a plist. It must return a string or
+nil.")
+
+(defvar org-export-filter-section-functions nil
+ "List of functions applied to a transcoded section.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-special-block-functions nil
+ "List of functions applied to a transcoded special block.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-src-block-functions nil
+ "List of functions applied to a transcoded src-block.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-table-functions nil
+ "List of functions applied to a transcoded table.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-table-cell-functions nil
+ "List of functions applied to a transcoded table-cell.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-table-row-functions nil
+ "List of functions applied to a transcoded table-row.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-verse-block-functions nil
+ "List of functions applied to a transcoded verse block.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+
+;;;; Objects Filters
+
+(defvar org-export-filter-bold-functions nil
+ "List of functions applied to transcoded bold text.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-code-functions nil
+ "List of functions applied to transcoded code text.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-entity-functions nil
+ "List of functions applied to a transcoded entity.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-export-snippet-functions nil
+ "List of functions applied to a transcoded export-snippet.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-footnote-reference-functions nil
+ "List of functions applied to a transcoded footnote-reference.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-inline-babel-call-functions nil
+ "List of functions applied to a transcoded inline-babel-call.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-inline-src-block-functions nil
+ "List of functions applied to a transcoded inline-src-block.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-italic-functions nil
+ "List of functions applied to transcoded italic text.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-latex-fragment-functions nil
+ "List of functions applied to a transcoded latex-fragment.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-line-break-functions nil
+ "List of functions applied to a transcoded line-break.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-link-functions nil
+ "List of functions applied to a transcoded link.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-radio-target-functions nil
+ "List of functions applied to a transcoded radio-target.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-statistics-cookie-functions nil
+ "List of functions applied to a transcoded statistics-cookie.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-strike-through-functions nil
+ "List of functions applied to transcoded strike-through text.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-subscript-functions nil
+ "List of functions applied to a transcoded subscript.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-superscript-functions nil
+ "List of functions applied to a transcoded superscript.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-target-functions nil
+ "List of functions applied to a transcoded target.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-timestamp-functions nil
+ "List of functions applied to a transcoded timestamp.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-underline-functions nil
+ "List of functions applied to transcoded underline text.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+(defvar org-export-filter-verbatim-functions nil
+ "List of functions applied to transcoded verbatim text.
+Each filter is called with three arguments: the transcoded data,
+as a string, the back-end, as a symbol, and the communication
+channel, as a plist. It must return a string or nil.")
+
+
+;;;; Filters Tools
+;;
+;; Internal function `org-export-install-filters' installs filters
+;; hard-coded in back-ends (developer filters) and filters from global
+;; variables (user filters) in the communication channel.
+;;
+;; Internal function `org-export-filter-apply-functions' takes care
+;; about applying each filter in order to a given data. It ignores
+;; filters returning a nil value but stops whenever a filter returns
+;; an empty string.
+
+(defun org-export-filter-apply-functions (filters value info)
+ "Call every function in FILTERS.
+
+Functions are called with three arguments: a value, the export
+back-end name and the communication channel. First function in
+FILTERS is called with VALUE as its first argument. Second
+function in FILTERS is called with the previous result as its
+value, etc.
+
+Functions returning nil are skipped. Any function returning the
+empty string ends the process, which returns the empty string.
+
+Call is done in a LIFO fashion, to be sure that developer
+specified filters, if any, are called first."
+ (catch :exit
+ (let* ((backend (plist-get info :back-end))
+ (backend-name (and backend (org-export-backend-name backend))))
+ (dolist (filter filters value)
+ (let ((result (funcall filter value backend-name info)))
+ (cond ((not result))
+ ((equal result "") (throw :exit ""))
+ (t (setq value result))))))))
+
+(defun org-export-install-filters (info)
+ "Install filters properties in communication channel.
+INFO is a plist containing the current communication channel.
+Return the updated communication channel."
+ (let (plist)
+ ;; Install user-defined filters with `org-export-filters-alist'
+ ;; and filters already in INFO (through ext-plist mechanism).
+ (dolist (p org-export-filters-alist)
+ (let* ((prop (car p))
+ (info-value (plist-get info prop))
+ (default-value (symbol-value (cdr p))))
+ (setq plist
+ (plist-put plist prop
+ ;; Filters in INFO will be called
+ ;; before those user provided.
+ (append (if (listp info-value) info-value
+ (list info-value))
+ default-value)))))
+ ;; Prepend back-end specific filters to that list.
+ (dolist (p (org-export-get-all-filters (plist-get info :back-end)))
+ ;; Single values get consed, lists are appended.
+ (let ((key (car p)) (value (cdr p)))
+ (when value
+ (setq plist
+ (plist-put
+ plist key
+ (if (atom value) (cons value (plist-get plist key))
+ (append value (plist-get plist key))))))))
+ ;; Return new communication channel.
+ (org-combine-plists info plist)))
+
+
+
+;;; Core functions
+;;
+;; This is the room for the main function, `org-export-as', along with
+;; its derivative, `org-export-string-as'.
+;; `org-export--copy-to-kill-ring-p' determines if output of these
+;; function should be added to kill ring.
+;;
+;; Note that `org-export-as' doesn't really parse the current buffer,
+;; but a copy of it (with the same buffer-local variables and
+;; visibility), where macros and include keywords are expanded and
+;; Babel blocks are executed, if appropriate.
+;; `org-export-with-buffer-copy' macro prepares that copy.
+;;
+;; File inclusion is taken care of by
+;; `org-export-expand-include-keyword' and
+;; `org-export--prepare-file-contents'. Structure wise, including
+;; a whole Org file in a buffer often makes little sense. For
+;; example, if the file contains a headline and the include keyword
+;; was within an item, the item should contain the headline. That's
+;; why file inclusion should be done before any structure can be
+;; associated to the file, that is before parsing.
+;;
+;; `org-export-insert-default-template' is a command to insert
+;; a default template (or a back-end specific template) at point or in
+;; current subtree.
+
+(defun org-export-copy-buffer ()
+ "Return a copy of the current buffer.
+The copy preserves Org buffer-local variables, visibility and
+narrowing."
+ (let ((copy-buffer-fun (org-export--generate-copy-script (current-buffer)))
+ (new-buf (generate-new-buffer (buffer-name))))
+ (with-current-buffer new-buf
+ (funcall copy-buffer-fun)
+ (set-buffer-modified-p nil))
+ new-buf))
+
+(defmacro org-export-with-buffer-copy (&rest body)
+ "Apply BODY in a copy of the current buffer.
+The copy preserves local variables, visibility and contents of
+the original buffer. Point is at the beginning of the buffer
+when BODY is applied."
+ (declare (debug t))
+ (org-with-gensyms (buf-copy)
+ `(let ((,buf-copy (org-export-copy-buffer)))
+ (unwind-protect
+ (with-current-buffer ,buf-copy
+ (goto-char (point-min))
+ (progn ,@body))
+ (and (buffer-live-p ,buf-copy)
+ ;; Kill copy without confirmation.
+ (progn (with-current-buffer ,buf-copy
+ (restore-buffer-modified-p nil))
+ (kill-buffer ,buf-copy)))))))
+
+(defun org-export--generate-copy-script (buffer)
+ "Generate a function duplicating BUFFER.
+
+The copy will preserve local variables, visibility, contents and
+narrowing of the original buffer. If a region was active in
+BUFFER, contents will be narrowed to that region instead.
+
+The resulting function can be evaluated at a later time, from
+another buffer, effectively cloning the original buffer there.
+
+The function assumes BUFFER's major mode is `org-mode'."
+ (with-current-buffer buffer
+ (let ((str (org-with-wide-buffer (buffer-string)))
+ (narrowing
+ (if (org-region-active-p)
+ (list (region-beginning) (region-end))
+ (list (point-min) (point-max))))
+ (pos (point))
+ (varvals
+ (let ((bound-variables (org-export--list-bound-variables))
+ (varvals nil))
+ (dolist (entry (buffer-local-variables (buffer-base-buffer)))
+ (when (consp entry)
+ (let ((var (car entry))
+ (val (cdr entry)))
+ (and (not (memq var org-export-ignored-local-variables))
+ (or (memq var
+ '(default-directory
+ buffer-file-name
+ buffer-file-coding-system))
+ (assq var bound-variables)
+ (string-match "^\\(org-\\|orgtbl-\\)"
+ (symbol-name var)))
+ ;; Skip unreadable values, as they cannot be
+ ;; sent to external process.
+ (or (not val) (ignore-errors (read (format "%S" val))))
+ (push (cons var val) varvals)))))
+ varvals))
+ (ols
+ (let (ov-set)
+ (dolist (ov (overlays-in (point-min) (point-max)))
+ (let ((invis-prop (overlay-get ov 'invisible)))
+ (when invis-prop
+ (push (list (overlay-start ov) (overlay-end ov)
+ invis-prop)
+ ov-set))))
+ ov-set)))
+ (lambda ()
+ (let ((inhibit-modification-hooks t))
+ ;; Set major mode. Ignore `org-mode-hook' as it has been run
+ ;; already in BUFFER.
+ (let ((org-mode-hook nil) (org-inhibit-startup t)) (org-mode))
+ ;; Copy specific buffer local variables and variables set
+ ;; through BIND keywords.
+ (pcase-dolist (`(,var . ,val) varvals)
+ (set (make-local-variable var) val))
+ ;; Whole buffer contents.
+ (insert str)
+ ;; Narrowing.
+ (apply #'narrow-to-region narrowing)
+ ;; Current position of point.
+ (goto-char pos)
+ ;; Overlays with invisible property.
+ (pcase-dolist (`(,start ,end ,invis) ols)
+ (overlay-put (make-overlay start end) 'invisible invis)))))))
+
+(defun org-export--delete-comment-trees ()
+ "Delete commented trees and commented inlinetasks in the buffer.
+Narrowing, if any, is ignored."
+ (org-with-wide-buffer
+ (goto-char (point-min))
+ (let* ((case-fold-search t)
+ (regexp (concat org-outline-regexp-bol ".*" org-comment-string)))
+ (while (re-search-forward regexp nil t)
+ (let ((element (org-element-at-point)))
+ (when (org-element-property :commentedp element)
+ (delete-region (org-element-property :begin element)
+ (org-element-property :end element))))))))
+
+(defun org-export--prune-tree (data info)
+ "Prune non exportable elements from DATA.
+DATA is the parse tree to traverse. INFO is the plist holding
+export info. Also set `:ignore-list' in INFO to a list of
+objects which should be ignored during export, but not removed
+from tree."
+ (letrec ((ignore nil)
+ ;; First find trees containing a select tag, if any.
+ (selected (org-export--selected-trees data info))
+ ;; List tags that prevent export of headlines.
+ (excluded (cl-mapcan (lambda (tag) (org-tags-expand tag t))
+ (plist-get info :exclude-tags)))
+ (walk-data
+ (lambda (data)
+ ;; Prune non-exportable elements and objects from tree.
+ ;; As a special case, special rows and cells from tables
+ ;; are stored in IGNORE, as they still need to be
+ ;; accessed during export.
+ (when data
+ (let ((type (org-element-type data)))
+ (if (org-export--skip-p data info selected excluded)
+ (if (memq type '(table-cell table-row)) (push data ignore)
+ (org-element-extract-element data))
+ (if (and (eq type 'headline)
+ (eq (plist-get info :with-archived-trees)
+ 'headline)
+ (org-element-property :archivedp data))
+ ;; If headline is archived but tree below has
+ ;; to be skipped, remove contents.
+ (org-element-set-contents data)
+ ;; Move into recursive objects/elements.
+ (mapc walk-data (org-element-contents data)))
+ ;; Move into secondary string, if any.
+ (dolist (p (cdr (assq type
+ org-element-secondary-value-alist)))
+ (mapc walk-data (org-element-property p data))))))))
+ (definitions
+ ;; Collect definitions before possibly pruning them so as
+ ;; to avoid parsing them again if they are required.
+ (org-element-map data '(footnote-definition footnote-reference)
+ (lambda (f)
+ (cond
+ ((eq 'footnote-definition (org-element-type f)) f)
+ ((and (eq 'inline (org-element-property :type f))
+ (org-element-property :label f))
+ f)
+ (t nil))))))
+ ;; If a select tag is active, also ignore the section before the
+ ;; first headline, if any.
+ (when selected
+ (let ((first-element (car (org-element-contents data))))
+ (when (eq (org-element-type first-element) 'section)
+ (org-element-extract-element first-element))))
+ ;; Prune tree and communication channel.
+ (funcall walk-data data)
+ (dolist (entry (append
+ ;; Priority is given to back-end specific options.
+ (org-export-get-all-options (plist-get info :back-end))
+ org-export-options-alist))
+ (when (eq (nth 4 entry) 'parse)
+ (funcall walk-data (plist-get info (car entry)))))
+ (let ((missing (org-export--missing-definitions data definitions)))
+ (funcall walk-data missing)
+ (org-export--install-footnote-definitions missing data))
+ ;; Eventually set `:ignore-list'.
+ (plist-put info :ignore-list ignore)))
+
+(defun org-export--missing-definitions (tree definitions)
+ "List footnote definitions missing from TREE.
+Missing definitions are searched within DEFINITIONS, which is
+a list of footnote definitions or in the widened buffer."
+ (let* ((list-labels
+ (lambda (data)
+ ;; List all footnote labels encountered in DATA. Inline
+ ;; footnote references are ignored.
+ (org-element-map data 'footnote-reference
+ (lambda (reference)
+ (and (eq (org-element-property :type reference) 'standard)
+ (org-element-property :label reference))))))
+ defined undefined missing-definitions)
+ ;; Partition DIRECT-REFERENCES between DEFINED and UNDEFINED
+ ;; references.
+ (let ((known-definitions
+ (org-element-map tree '(footnote-reference footnote-definition)
+ (lambda (f)
+ (and (or (eq (org-element-type f) 'footnote-definition)
+ (eq (org-element-property :type f) 'inline))
+ (org-element-property :label f)))))
+ ) ;; seen
+ (dolist (l (funcall list-labels tree))
+ (cond ;; ((member l seen))
+ ((member l known-definitions) (push l defined))
+ (t (push l undefined)))))
+ ;; Complete MISSING-DEFINITIONS by finding the definition of every
+ ;; undefined label, first by looking into DEFINITIONS, then by
+ ;; searching the widened buffer. This is a recursive process
+ ;; since definitions found can themselves contain an undefined
+ ;; reference.
+ (while undefined
+ (let* ((label (pop undefined))
+ (definition
+ (cond
+ ((cl-some
+ (lambda (d) (and (equal (org-element-property :label d) label)
+ d))
+ definitions))
+ ((pcase (org-footnote-get-definition label)
+ (`(,_ ,beg . ,_)
+ (org-with-wide-buffer
+ (goto-char beg)
+ (let ((datum (org-element-context)))
+ (if (eq (org-element-type datum) 'footnote-reference)
+ datum
+ ;; Parse definition with contents.
+ (save-restriction
+ (narrow-to-region
+ (org-element-property :begin datum)
+ (org-element-property :end datum))
+ (org-element-map (org-element-parse-buffer)
+ 'footnote-definition #'identity nil t))))))
+ (_ nil)))
+ (t (user-error "Definition not found for footnote %s" label)))))
+ (push label defined)
+ (push definition missing-definitions)
+ ;; Look for footnote references within DEFINITION, since
+ ;; we may need to also find their definition.
+ (dolist (l (funcall list-labels definition))
+ (unless (or (member l defined) ;Known label
+ (member l undefined)) ;Processed later
+ (push l undefined)))))
+ ;; MISSING-DEFINITIONS may contain footnote references with inline
+ ;; definitions. Make sure those are changed into real footnote
+ ;; definitions.
+ (mapcar (lambda (d)
+ (if (eq (org-element-type d) 'footnote-definition) d
+ (let ((label (org-element-property :label d)))
+ (apply #'org-element-create
+ 'footnote-definition `(:label ,label :post-blank 1)
+ (org-element-contents d)))))
+ missing-definitions)))
+
+(defun org-export--install-footnote-definitions (definitions tree)
+ "Install footnote definitions in tree.
+
+DEFINITIONS is the list of footnote definitions to install. TREE
+is the parse tree.
+
+If there is a footnote section in TREE, definitions found are
+appended to it. If `org-footnote-section' is non-nil, a new
+footnote section containing all definitions is inserted in TREE.
+Otherwise, definitions are appended at the end of the section
+containing their first reference."
+ (cond
+ ((null definitions))
+ ;; If there is a footnote section, insert definitions there.
+ ((let ((footnote-section
+ (org-element-map tree 'headline
+ (lambda (h) (and (org-element-property :footnote-section-p h) h))
+ nil t)))
+ (and footnote-section
+ (apply #'org-element-adopt-elements
+ footnote-section
+ (nreverse definitions)))))
+ ;; If there should be a footnote section, create one containing all
+ ;; the definitions at the end of the tree.
+ (org-footnote-section
+ (org-element-adopt-elements
+ tree
+ (org-element-create 'headline
+ (list :footnote-section-p t
+ :level 1
+ :title org-footnote-section
+ :raw-value org-footnote-section)
+ (apply #'org-element-create
+ 'section
+ nil
+ (nreverse definitions)))))
+ ;; Otherwise add each definition at the end of the section where it
+ ;; is first referenced.
+ (t
+ (letrec ((seen nil)
+ (insert-definitions
+ (lambda (data)
+ ;; Insert footnote definitions in the same section as
+ ;; their first reference in DATA.
+ (org-element-map data 'footnote-reference
+ (lambda (reference)
+ (when (eq (org-element-property :type reference) 'standard)
+ (let ((label (org-element-property :label reference)))
+ (unless (member label seen)
+ (push label seen)
+ (let ((definition
+ (cl-some
+ (lambda (d)
+ (and (equal (org-element-property :label d)
+ label)
+ d))
+ definitions)))
+ (org-element-adopt-elements
+ (org-element-lineage reference '(section))
+ definition)
+ ;; Also insert definitions for nested
+ ;; references, if any.
+ (funcall insert-definitions definition))))))))))
+ (funcall insert-definitions tree)))))
+
+(defun org-export--remove-uninterpreted-data (data info)
+ "Change uninterpreted elements back into Org syntax.
+DATA is a parse tree or a secondary string. INFO is a plist
+containing export options. It is modified by side effect and
+returned by the function."
+ (org-element-map data
+ '(entity bold italic latex-environment latex-fragment strike-through
+ subscript superscript underline)
+ (lambda (datum)
+ (let* ((type (org-element-type datum))
+ (post-blank
+ (pcase (org-element-property :post-blank datum)
+ (`nil nil)
+ (n (make-string n (if (eq type 'latex-environment) ?\n ?\s)))))
+ (new
+ (cl-case type
+ ;; ... entities...
+ (entity
+ (and (not (plist-get info :with-entities))
+ (list (concat (org-export-expand datum nil)
+ post-blank))))
+ ;; ... emphasis...
+ ((bold italic strike-through underline)
+ (and (not (plist-get info :with-emphasize))
+ (let ((marker (cl-case type
+ (bold "*")
+ (italic "/")
+ (strike-through "+")
+ (underline "_"))))
+ (append
+ (list marker)
+ (org-element-contents datum)
+ (list (concat marker post-blank))))))
+ ;; ... LaTeX environments and fragments...
+ ((latex-environment latex-fragment)
+ (and (eq (plist-get info :with-latex) 'verbatim)
+ (list (concat (org-export-expand datum nil)
+ post-blank))))
+ ;; ... sub/superscripts...
+ ((subscript superscript)
+ (let ((sub/super-p (plist-get info :with-sub-superscript))
+ (bracketp (org-element-property :use-brackets-p datum)))
+ (and (or (not sub/super-p)
+ (and (eq sub/super-p '{}) (not bracketp)))
+ (append
+ (list (concat (if (eq type 'subscript) "_" "^")
+ (and bracketp "{")))
+ (org-element-contents datum)
+ (list (concat (and bracketp "}")
+ post-blank)))))))))
+ (when new
+ ;; Splice NEW at DATUM location in parse tree.
+ (dolist (e new (org-element-extract-element datum))
+ (unless (equal e "") (org-element-insert-before e datum))))))
+ info nil nil t)
+ ;; Return modified parse tree.
+ data)
+
+;;;###autoload
+(defun org-export-as
+ (backend &optional subtreep visible-only body-only ext-plist)
+ "Transcode current Org buffer into BACKEND code.
+
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end.
+
+If narrowing is active in the current buffer, only transcode its
+narrowed part.
+
+If a region is active, transcode that region.
+
+When optional argument SUBTREEP is non-nil, transcode the
+sub-tree at point, extracting information from the headline
+properties first.
+
+When optional argument VISIBLE-ONLY is non-nil, don't export
+contents of hidden elements.
+
+When optional argument BODY-ONLY is non-nil, only return body
+code, without surrounding template.
+
+Optional argument EXT-PLIST, when provided, is a property list
+with external parameters overriding Org default settings, but
+still inferior to file-local settings.
+
+Return code as a string."
+ (when (symbolp backend) (setq backend (org-export-get-backend backend)))
+ (org-export-barf-if-invalid-backend backend)
+ (save-excursion
+ (save-restriction
+ ;; Narrow buffer to an appropriate region or subtree for
+ ;; parsing. If parsing subtree, be sure to remove main
+ ;; headline, planning data and property drawer.
+ (cond ((org-region-active-p)
+ (narrow-to-region (region-beginning) (region-end)))
+ (subtreep
+ (org-narrow-to-subtree)
+ (goto-char (point-min))
+ (org-end-of-meta-data)
+ (narrow-to-region (point) (point-max))))
+ ;; Initialize communication channel with original buffer
+ ;; attributes, unavailable in its copy.
+ (let* ((org-export-current-backend (org-export-backend-name backend))
+ (info (org-combine-plists
+ (org-export--get-export-attributes
+ backend subtreep visible-only body-only)
+ (org-export--get-buffer-attributes)))
+ (parsed-keywords
+ (delq nil
+ (mapcar (lambda (o) (and (eq (nth 4 o) 'parse) (nth 1 o)))
+ (append (org-export-get-all-options backend)
+ org-export-options-alist))))
+ tree)
+ ;; Update communication channel and get parse tree. Buffer
+ ;; isn't parsed directly. Instead, all buffer modifications
+ ;; and consequent parsing are undertaken in a temporary copy.
+ (org-export-with-buffer-copy
+ ;; Run first hook with current back-end's name as argument.
+ (run-hook-with-args 'org-export-before-processing-hook
+ (org-export-backend-name backend))
+ (org-export-expand-include-keyword)
+ (org-export--delete-comment-trees)
+ (org-macro-initialize-templates org-export-global-macros)
+ (org-macro-replace-all org-macro-templates parsed-keywords)
+ ;; Refresh buffer properties and radio targets after previous
+ ;; potentially invasive changes.
+ (org-set-regexps-and-options)
+ (org-update-radio-target-regexp)
+ ;; Possibly execute Babel code. Re-run a macro expansion
+ ;; specifically for {{{results}}} since inline source blocks
+ ;; may have generated some more. Refresh buffer properties
+ ;; and radio targets another time.
+ (when org-export-use-babel
+ (org-babel-exp-process-buffer)
+ (org-macro-replace-all '(("results" . "$1")) parsed-keywords)
+ (org-set-regexps-and-options)
+ (org-update-radio-target-regexp))
+ ;; Run last hook with current back-end's name as argument.
+ ;; Update buffer properties and radio targets one last time
+ ;; before parsing.
+ (goto-char (point-min))
+ (save-excursion
+ (run-hook-with-args 'org-export-before-parsing-hook
+ (org-export-backend-name backend)))
+ (org-set-regexps-and-options)
+ (org-update-radio-target-regexp)
+ ;; Update communication channel with environment.
+ (setq info
+ (org-combine-plists
+ info (org-export-get-environment backend subtreep ext-plist)))
+ ;; Pre-process citations environment, i.e. install
+ ;; bibliography list, and citation processor in INFO.
+ (org-cite-store-bibliography info)
+ (org-cite-store-export-processor info)
+ ;; De-activate uninterpreted data from parsed keywords.
+ (dolist (entry (append (org-export-get-all-options backend)
+ org-export-options-alist))
+ (pcase entry
+ (`(,p ,_ ,_ ,_ parse)
+ (let ((value (plist-get info p)))
+ (plist-put info
+ p
+ (org-export--remove-uninterpreted-data value info))))
+ (_ nil)))
+ ;; Install user's and developer's filters.
+ (setq info (org-export-install-filters info))
+ ;; Call options filters and update export options. We do not
+ ;; use `org-export-filter-apply-functions' here since the
+ ;; arity of such filters is different.
+ (let ((backend-name (org-export-backend-name backend)))
+ (dolist (filter (plist-get info :filter-options))
+ (let ((result (funcall filter info backend-name)))
+ (when result (setq info result)))))
+ ;; Parse buffer.
+ (setq tree (org-element-parse-buffer nil visible-only))
+ ;; Prune tree from non-exported elements and transform
+ ;; uninterpreted elements or objects in both parse tree and
+ ;; communication channel.
+ (org-export--prune-tree tree info)
+ (org-export--remove-uninterpreted-data tree info)
+ ;; Call parse tree filters.
+ (setq tree
+ (org-export-filter-apply-functions
+ (plist-get info :filter-parse-tree) tree info))
+ ;; Now tree is complete, compute its properties and add them
+ ;; to communication channel.
+ (setq info (org-export--collect-tree-properties tree info))
+ ;; Process citations and bibliography. Replace each citation
+ ;; and "print_bibliography" keyword in the parse tree with
+ ;; the output of the selected citation export processor.
+ (org-cite-process-citations info)
+ (org-cite-process-bibliography info)
+ ;; Eventually transcode TREE. Wrap the resulting string into
+ ;; a template.
+ (let* ((body (org-element-normalize-string
+ (or (org-export-data tree info) "")))
+ (inner-template (cdr (assq 'inner-template
+ (plist-get info :translate-alist))))
+ (full-body (org-export-filter-apply-functions
+ (plist-get info :filter-body)
+ (if (not (functionp inner-template)) body
+ (funcall inner-template body info))
+ info))
+ (template (cdr (assq 'template
+ (plist-get info :translate-alist))))
+ (output
+ (if (or (not (functionp template)) body-only) full-body
+ (funcall template full-body info))))
+ ;; Call citation export finalizer.
+ (setq output (org-cite-finalize-export output info))
+ ;; Remove all text properties since they cannot be
+ ;; retrieved from an external process. Finally call
+ ;; final-output filter and return result.
+ (org-no-properties
+ (org-export-filter-apply-functions
+ (plist-get info :filter-final-output)
+ output info))))))))
+
+;;;###autoload
+(defun org-export-string-as (string backend &optional body-only ext-plist)
+ "Transcode STRING into BACKEND code.
+
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end.
+
+When optional argument BODY-ONLY is non-nil, only return body
+code, without preamble nor postamble.
+
+Optional argument EXT-PLIST, when provided, is a property list
+with external parameters overriding Org default settings, but
+still inferior to file-local settings.
+
+Return code as a string."
+ (with-temp-buffer
+ (insert string)
+ (let ((org-inhibit-startup t)) (org-mode))
+ (org-export-as backend nil nil body-only ext-plist)))
+
+;;;###autoload
+(defun org-export-replace-region-by (backend)
+ "Replace the active region by its export to BACKEND.
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end."
+ (unless (org-region-active-p) (user-error "No active region to replace"))
+ (insert
+ (org-export-string-as
+ (delete-and-extract-region (region-beginning) (region-end)) backend t)))
+
+;;;###autoload
+(defun org-export-insert-default-template (&optional backend subtreep)
+ "Insert all export keywords with default values at beginning of line.
+
+BACKEND is a symbol referring to the name of a registered export
+back-end, for which specific export options should be added to
+the template, or `default' for default template. When it is nil,
+the user will be prompted for a category.
+
+If SUBTREEP is non-nil, export configuration will be set up
+locally for the subtree through node properties."
+ (interactive)
+ (unless (derived-mode-p 'org-mode) (user-error "Not in an Org mode buffer"))
+ (when (and subtreep (org-before-first-heading-p))
+ (user-error "No subtree to set export options for"))
+ (let ((node (and subtreep (save-excursion (org-back-to-heading t) (point))))
+ (backend
+ (or backend
+ (intern
+ (org-completing-read
+ "Options category: "
+ (cons "default"
+ (mapcar (lambda (b)
+ (symbol-name (org-export-backend-name b)))
+ org-export-registered-backends))
+ nil t))))
+ options keywords)
+ ;; Populate OPTIONS and KEYWORDS.
+ (dolist (entry (cond ((eq backend 'default) org-export-options-alist)
+ ((org-export-backend-p backend)
+ (org-export-backend-options backend))
+ (t (org-export-backend-options
+ (org-export-get-backend backend)))))
+ (let ((keyword (nth 1 entry))
+ (option (nth 2 entry)))
+ (cond
+ (keyword (unless (assoc keyword keywords)
+ (let ((value
+ (if (eq (nth 4 entry) 'split)
+ (mapconcat #'identity (eval (nth 3 entry) t) " ")
+ (eval (nth 3 entry) t))))
+ (push (cons keyword value) keywords))))
+ (option (unless (assoc option options)
+ (push (cons option (eval (nth 3 entry) t)) options))))))
+ ;; Move to an appropriate location in order to insert options.
+ (unless subtreep (beginning-of-line))
+ ;; First (multiple) OPTIONS lines. Never go past fill-column.
+ (when options
+ (let ((items
+ (mapcar
+ (lambda (opt) (format "%s:%S" (car opt) (cdr opt)))
+ (sort options (lambda (k1 k2) (string< (car k1) (car k2)))))))
+ (if subtreep
+ (org-entry-put
+ node "EXPORT_OPTIONS" (mapconcat #'identity items " "))
+ (while items
+ (insert "#+options:")
+ (let ((width 10))
+ (while (and items
+ (< (+ width (length (car items)) 1) fill-column))
+ (let ((item (pop items)))
+ (insert " " item)
+ (cl-incf width (1+ (length item))))))
+ (insert "\n")))))
+ ;; Then the rest of keywords, in the order specified in either
+ ;; `org-export-options-alist' or respective export back-ends.
+ (dolist (key (nreverse keywords))
+ (let ((val (cond ((equal (car key) "DATE")
+ (or (cdr key)
+ (with-temp-buffer
+ (org-insert-time-stamp nil))))
+ ((equal (car key) "TITLE")
+ (or (let ((visited-file
+ (buffer-file-name (buffer-base-buffer))))
+ (and visited-file
+ (file-name-sans-extension
+ (file-name-nondirectory visited-file))))
+ (buffer-name (buffer-base-buffer))))
+ (t (cdr key)))))
+ (if subtreep (org-entry-put node (concat "EXPORT_" (car key)) val)
+ (insert
+ (format "#+%s:%s\n"
+ (downcase (car key))
+ (if (org-string-nw-p val) (format " %s" val) ""))))))))
+
+(defun org-export-expand-include-keyword (&optional included dir footnotes)
+ "Expand every include keyword in buffer.
+Optional argument INCLUDED is a list of included file names along
+with their line restriction, when appropriate. It is used to
+avoid infinite recursion. Optional argument DIR is the current
+working directory. It is used to properly resolve relative
+paths. Optional argument FOOTNOTES is a hash-table used for
+storing and resolving footnotes. It is created automatically."
+ (let ((includer-file (buffer-file-name (buffer-base-buffer)))
+ (case-fold-search t)
+ (file-prefix (make-hash-table :test #'equal))
+ (current-prefix 0)
+ (footnotes (or footnotes (make-hash-table :test #'equal)))
+ (include-re "^[ \t]*#\\+INCLUDE:"))
+ ;; If :minlevel is not set the text-property
+ ;; `:org-include-induced-level' will be used to determine the
+ ;; relative level when expanding INCLUDE.
+ ;; Only affects included Org documents.
+ (goto-char (point-min))
+ (while (re-search-forward include-re nil t)
+ (put-text-property (line-beginning-position) (line-end-position)
+ :org-include-induced-level
+ (1+ (org-reduced-level (or (org-current-level) 0)))))
+ ;; Expand INCLUDE keywords.
+ (goto-char (point-min))
+ (while (re-search-forward include-re nil t)
+ (unless (org-in-commented-heading-p)
+ (let ((element (save-match-data (org-element-at-point))))
+ (when (eq (org-element-type element) 'keyword)
+ (beginning-of-line)
+ ;; Extract arguments from keyword's value.
+ (let* ((value (org-element-property :value element))
+ (ind (current-indentation))
+ location
+ (coding-system-for-read
+ (or (and (string-match ":coding +\\(\\S-+\\)>" value)
+ (prog1 (intern (match-string 1 value))
+ (setq value (replace-match "" nil nil value))))
+ coding-system-for-read))
+ (file
+ (and (string-match "^\\(\".+?\"\\|\\S-+\\)\\(?:\\s-+\\|$\\)"
+ value)
+ (prog1
+ (save-match-data
+ (let ((matched (match-string 1 value)))
+ (when (string-match "\\(::\\(.*?\\)\\)\"?\\'"
+ matched)
+ (setq location (match-string 2 matched))
+ (setq matched
+ (replace-match "" nil nil matched 1)))
+ (expand-file-name (org-strip-quotes matched)
+ dir)))
+ (setq value (replace-match "" nil nil value)))))
+ (only-contents
+ (and (string-match ":only-contents *\\([^: \r\t\n]\\S-*\\)?"
+ value)
+ (prog1 (org-not-nil (match-string 1 value))
+ (setq value (replace-match "" nil nil value)))))
+ (lines
+ (and (string-match
+ ":lines +\"\\([0-9]*-[0-9]*\\)\""
+ value)
+ (prog1 (match-string 1 value)
+ (setq value (replace-match "" nil nil value)))))
+ (env (cond
+ ((string-match "\\<example\\>" value) 'literal)
+ ((string-match "\\<export\\(?: +\\(.*\\)\\)?" value)
+ 'literal)
+ ((string-match "\\<src\\(?: +\\(.*\\)\\)?" value)
+ 'literal)))
+ ;; Minimal level of included file defaults to the
+ ;; child level of the current headline, if any, or
+ ;; one. It only applies is the file is meant to be
+ ;; included as an Org one.
+ (minlevel
+ (and (not env)
+ (if (string-match ":minlevel +\\([0-9]+\\)" value)
+ (prog1 (string-to-number (match-string 1 value))
+ (setq value (replace-match "" nil nil value)))
+ (get-text-property (point)
+ :org-include-induced-level))))
+ (args (and (eq env 'literal) (match-string 1 value)))
+ (block (and (string-match "\\<\\(\\S-+\\)\\>" value)
+ (match-string 1 value))))
+ ;; Remove keyword.
+ (delete-region (point) (line-beginning-position 2))
+ (cond
+ ((not file) nil)
+ ((not (file-readable-p file))
+ (error "Cannot include file %s" file))
+ ;; Check if files has already been parsed. Look after
+ ;; inclusion lines too, as different parts of the same
+ ;; file can be included too.
+ ((member (list file lines) included)
+ (error "Recursive file inclusion: %s" file))
+ (t
+ (cond
+ ((eq env 'literal)
+ (insert
+ (let ((ind-str (make-string ind ?\s))
+ (arg-str (if (stringp args) (format " %s" args) ""))
+ (contents
+ (org-escape-code-in-string
+ (org-export--prepare-file-contents file lines))))
+ (format "%s#+BEGIN_%s%s\n%s%s#+END_%s\n"
+ ind-str block arg-str contents ind-str block))))
+ ((stringp block)
+ (insert
+ (let ((ind-str (make-string ind ?\s))
+ (contents
+ (org-export--prepare-file-contents file lines)))
+ (format "%s#+BEGIN_%s\n%s%s#+END_%s\n"
+ ind-str block contents ind-str block))))
+ (t
+ (insert
+ (with-temp-buffer
+ (let ((org-inhibit-startup t)
+ (lines
+ (if location
+ (org-export--inclusion-absolute-lines
+ file location only-contents lines)
+ lines)))
+ (org-mode)
+ (insert
+ (org-export--prepare-file-contents
+ file lines ind minlevel
+ (or (gethash file file-prefix)
+ (puthash file
+ (cl-incf current-prefix)
+ file-prefix))
+ footnotes
+ includer-file)))
+ (org-export-expand-include-keyword
+ (cons (list file lines) included)
+ (file-name-directory file)
+ footnotes)
+ (buffer-string)))))
+ ;; Expand footnotes after all files have been
+ ;; included. Footnotes are stored at end of buffer.
+ (unless included
+ (org-with-wide-buffer
+ (goto-char (point-max))
+ (maphash (lambda (k v)
+ (insert (format "\n[fn:%s] %s\n" k v)))
+ footnotes))))))))))))
+
+(defun org-export--inclusion-absolute-lines (file location only-contents lines)
+ "Resolve absolute lines for an included file with file-link.
+
+FILE is string file-name of the file to include. LOCATION is a
+string name within FILE to be included (located via
+`org-link-search'). If ONLY-CONTENTS is non-nil only the
+contents of the named element will be included, as determined
+Org-Element. If LINES is non-nil only those lines are included.
+
+Return a string of lines to be included in the format expected by
+`org-export--prepare-file-contents'."
+ (with-temp-buffer
+ (insert-file-contents file)
+ (unless (eq major-mode 'org-mode)
+ (let ((org-inhibit-startup t)) (org-mode)))
+ (condition-case err
+ ;; Enforce consistent search.
+ (let ((org-link-search-must-match-exact-headline nil))
+ (org-link-search location))
+ (error
+ (error "%s for %s::%s" (error-message-string err) file location)))
+ (let* ((element (org-element-at-point))
+ (contents-begin
+ (and only-contents (org-element-property :contents-begin element))))
+ (narrow-to-region
+ (or contents-begin (org-element-property :begin element))
+ (org-element-property (if contents-begin :contents-end :end) element))
+ (when (and only-contents
+ (memq (org-element-type element) '(headline inlinetask)))
+ ;; Skip planning line and property-drawer.
+ (goto-char (point-min))
+ (when (looking-at-p org-planning-line-re) (forward-line))
+ (when (looking-at org-property-drawer-re) (goto-char (match-end 0)))
+ (unless (bolp) (forward-line))
+ (narrow-to-region (point) (point-max))))
+ (when lines
+ (org-skip-whitespace)
+ (beginning-of-line)
+ (let* ((lines (split-string lines "-"))
+ (lbeg (string-to-number (car lines)))
+ (lend (string-to-number (cadr lines)))
+ (beg (if (zerop lbeg) (point-min)
+ (goto-char (point-min))
+ (forward-line (1- lbeg))
+ (point)))
+ (end (if (zerop lend) (point-max)
+ (goto-char beg)
+ (forward-line (1- lend))
+ (point))))
+ (narrow-to-region beg end)))
+ (let ((end (point-max)))
+ (goto-char (point-min))
+ (widen)
+ (let ((start-line (line-number-at-pos)))
+ (format "%d-%d"
+ start-line
+ (save-excursion
+ (+ start-line
+ (let ((counter 0))
+ (while (< (point) end) (cl-incf counter) (forward-line))
+ counter))))))))
+
+(defun org-export--update-included-link (file-dir includer-dir)
+ "Update relative file name of link at point, if possible.
+
+FILE-DIR is the directory of the file being included.
+INCLUDER-DIR is the directory of the file where the inclusion is
+going to happen.
+
+Move point after the link."
+ (let* ((link (org-element-link-parser))
+ (path (org-element-property :path link)))
+ (if (or (not (string= "file" (org-element-property :type link)))
+ (file-remote-p path)
+ (file-name-absolute-p path))
+ (goto-char (org-element-property :end link))
+ (let ((new-path (file-relative-name (expand-file-name path file-dir)
+ includer-dir))
+ (new-link (org-element-copy link)))
+ (org-element-put-property new-link :path new-path)
+ (when (org-element-property :contents-begin link)
+ (org-element-adopt-elements new-link
+ (buffer-substring
+ (org-element-property :contents-begin link)
+ (org-element-property :contents-end link))))
+ (delete-region (org-element-property :begin link)
+ (org-element-property :end link))
+ (insert (org-element-interpret-data new-link))))))
+
+(defun org-export--prepare-file-contents
+ (file &optional lines ind minlevel id footnotes includer)
+ "Prepare contents of FILE for inclusion and return it as a string.
+
+When optional argument LINES is a string specifying a range of
+lines, include only those lines.
+
+Optional argument IND, when non-nil, is an integer specifying the
+global indentation of returned contents. Since its purpose is to
+allow an included file to stay in the same environment it was
+created (e.g., a list item), it doesn't apply past the first
+headline encountered.
+
+Optional argument MINLEVEL, when non-nil, is an integer
+specifying the level that any top-level headline in the included
+file should have.
+
+Optional argument ID is an integer that will be inserted before
+each footnote definition and reference if FILE is an Org file.
+This is useful to avoid conflicts when more than one Org file
+with footnotes is included in a document.
+
+Optional argument FOOTNOTES is a hash-table to store footnotes in
+the included document.
+
+Optional argument INCLUDER is the file name where the inclusion
+is to happen."
+ (with-temp-buffer
+ (insert-file-contents file)
+ (when lines
+ (let* ((lines (split-string lines "-"))
+ (lbeg (string-to-number (car lines)))
+ (lend (string-to-number (cadr lines)))
+ (beg (if (zerop lbeg) (point-min)
+ (goto-char (point-min))
+ (forward-line (1- lbeg))
+ (point)))
+ (end (if (zerop lend) (point-max)
+ (goto-char (point-min))
+ (forward-line (1- lend))
+ (point))))
+ (narrow-to-region beg end)))
+ ;; Adapt all file links within the included document that contain
+ ;; relative paths in order to make these paths relative to the
+ ;; base document, or absolute.
+ (when includer
+ (let ((file-dir (file-name-directory file))
+ (includer-dir (file-name-directory includer)))
+ (unless (file-equal-p file-dir includer-dir)
+ (goto-char (point-min))
+ (unless (eq major-mode 'org-mode)
+ (let ((org-inhibit-startup t)) (org-mode))) ;set regexps
+ (let ((regexp (concat org-link-plain-re "\\|" org-link-angle-re)))
+ (while (re-search-forward org-link-any-re nil t)
+ (let ((link (save-excursion
+ (forward-char -1)
+ (save-match-data (org-element-context)))))
+ (when (eq 'link (org-element-type link))
+ ;; Look for file links within link's description.
+ ;; Org doesn't support such construct, but
+ ;; `org-export-insert-image-links' may activate
+ ;; them.
+ (let ((contents-begin
+ (org-element-property :contents-begin link))
+ (begin (org-element-property :begin link)))
+ (when contents-begin
+ (save-excursion
+ (goto-char (org-element-property :contents-end link))
+ (while (re-search-backward regexp contents-begin t)
+ (save-match-data
+ (org-export--update-included-link
+ file-dir includer-dir))
+ (goto-char (match-beginning 0)))))
+ ;; Update current link, if necessary.
+ (when (string= "file" (org-element-property :type link))
+ (goto-char begin)
+ (org-export--update-included-link
+ file-dir includer-dir))))))))))
+ ;; Remove blank lines at beginning and end of contents. The logic
+ ;; behind that removal is that blank lines around include keyword
+ ;; override blank lines in included file.
+ (goto-char (point-min))
+ (org-skip-whitespace)
+ (beginning-of-line)
+ (delete-region (point-min) (point))
+ (goto-char (point-max))
+ (skip-chars-backward " \r\t\n")
+ (forward-line)
+ (delete-region (point) (point-max))
+ ;; If IND is set, preserve indentation of include keyword until
+ ;; the first headline encountered.
+ (when (and ind (> ind 0))
+ (unless (eq major-mode 'org-mode)
+ (let ((org-inhibit-startup t)) (org-mode)))
+ (goto-char (point-min))
+ (let ((ind-str (make-string ind ?\s)))
+ (while (not (or (eobp) (looking-at org-outline-regexp-bol)))
+ ;; Do not move footnote definitions out of column 0.
+ (unless (and (looking-at org-footnote-definition-re)
+ (eq (org-element-type (org-element-at-point))
+ 'footnote-definition))
+ (insert ind-str))
+ (forward-line))))
+ ;; When MINLEVEL is specified, compute minimal level for headlines
+ ;; in the file (CUR-MIN), and remove stars to each headline so
+ ;; that headlines with minimal level have a level of MINLEVEL.
+ (when minlevel
+ (unless (eq major-mode 'org-mode)
+ (let ((org-inhibit-startup t)) (org-mode)))
+ (org-with-limited-levels
+ (let ((levels (org-map-entries
+ (lambda () (org-reduced-level (org-current-level))))))
+ (when levels
+ (let ((offset (- minlevel (apply #'min levels))))
+ (unless (zerop offset)
+ (when org-odd-levels-only (setq offset (* offset 2)))
+ ;; Only change stars, don't bother moving whole
+ ;; sections.
+ (org-map-entries
+ (lambda ()
+ (if (< offset 0) (delete-char (abs offset))
+ (insert (make-string offset ?*)))))))))))
+ ;; Append ID to all footnote references and definitions, so they
+ ;; become file specific and cannot collide with footnotes in other
+ ;; included files. Further, collect relevant footnote definitions
+ ;; outside of LINES, in order to reintroduce them later.
+ (when id
+ (let ((marker-min (point-min-marker))
+ (marker-max (point-max-marker))
+ (get-new-label
+ (lambda (label)
+ ;; Generate new label from LABEL by prefixing it with
+ ;; "-ID-".
+ (format "-%d-%s" id label)))
+ (set-new-label
+ (lambda (f old new)
+ ;; Replace OLD label with NEW in footnote F.
+ (save-excursion
+ (goto-char (+ (org-element-property :begin f) 4))
+ (looking-at (regexp-quote old))
+ (replace-match new))))
+ (seen-alist))
+ (goto-char (point-min))
+ (while (re-search-forward org-footnote-re nil t)
+ (let ((footnote (save-excursion
+ (backward-char)
+ (org-element-context))))
+ (when (memq (org-element-type footnote)
+ '(footnote-definition footnote-reference))
+ (let* ((label (org-element-property :label footnote)))
+ ;; Update the footnote-reference at point and collect
+ ;; the new label, which is only used for footnotes
+ ;; outsides LINES.
+ (when label
+ (let ((seen (cdr (assoc label seen-alist))))
+ (if seen (funcall set-new-label footnote label seen)
+ (let ((new (funcall get-new-label label)))
+ (push (cons label new) seen-alist)
+ (org-with-wide-buffer
+ (let* ((def (org-footnote-get-definition label))
+ (beg (nth 1 def)))
+ (when (and def
+ (or (< beg marker-min)
+ (>= beg marker-max)))
+ ;; Store since footnote-definition is
+ ;; outside of LINES.
+ (puthash new
+ (org-element-normalize-string (nth 3 def))
+ footnotes))))
+ (funcall set-new-label footnote label new)))))))))
+ (set-marker marker-min nil)
+ (set-marker marker-max nil)))
+ (org-element-normalize-string (buffer-string))))
+
+(defun org-export--copy-to-kill-ring-p ()
+ "Return a non-nil value when output should be added to the kill ring.
+See also `org-export-copy-to-kill-ring'."
+ (if (eq org-export-copy-to-kill-ring 'if-interactive)
+ (not (or executing-kbd-macro noninteractive))
+ (eq org-export-copy-to-kill-ring t)))
+
+
+
+;;; Tools For Back-Ends
+;;
+;; A whole set of tools is available to help build new exporters. Any
+;; function general enough to have its use across many back-ends
+;; should be added here.
+
+;;;; For Affiliated Keywords
+;;
+;; `org-export-read-attribute' reads a property from a given element
+;; as a plist. It can be used to normalize affiliated keywords'
+;; syntax.
+;;
+;; Since captions can span over multiple lines and accept dual values,
+;; their internal representation is a bit tricky. Therefore,
+;; `org-export-get-caption' transparently returns a given element's
+;; caption as a secondary string.
+
+(defun org-export-read-attribute (attribute element &optional property)
+ "Turn ATTRIBUTE property from ELEMENT into a plist.
+
+When optional argument PROPERTY is non-nil, return the value of
+that property within attributes.
+
+This function assumes attributes are defined as \":keyword
+value\" pairs. It is appropriate for `:attr_html' like
+properties.
+
+All values will become strings except the empty string and
+\"nil\", which will become nil. Also, values containing only
+double quotes will be read as-is, which means that \"\" value
+will become the empty string."
+ (let* ((prepare-value
+ (lambda (str)
+ (save-match-data
+ (cond ((member str '(nil "" "nil")) nil)
+ ((string-match "^\"\\(\"+\\)?\"$" str)
+ (or (match-string 1 str) ""))
+ (t str)))))
+ (attributes
+ (let ((value (org-element-property attribute element)))
+ (when value
+ (let ((s (mapconcat #'identity value " ")) result)
+ (while (string-match
+ "\\(?:^\\|[ \t]+\\)\\(:[-a-zA-Z0-9_]+\\)\\([ \t]+\\|$\\)"
+ s)
+ (let ((value (substring s 0 (match-beginning 0))))
+ (push (funcall prepare-value value) result))
+ (push (intern (match-string 1 s)) result)
+ (setq s (substring s (match-end 0))))
+ ;; Ignore any string before first property with `cdr'.
+ (cdr (nreverse (cons (funcall prepare-value s) result))))))))
+ (if property (plist-get attributes property) attributes)))
+
+(defun org-export-get-caption (element &optional short)
+ "Return caption from ELEMENT as a secondary string.
+
+When optional argument SHORT is non-nil, return short caption, as
+a secondary string, instead.
+
+Caption lines are separated by a white space."
+ (let ((full-caption (org-element-property :caption element))
+ (get (if short #'cdr #'car))
+ caption)
+ (dolist (line full-caption)
+ (pcase (funcall get line)
+ (`nil nil)
+ (c
+ (setq caption
+ (nconc (list " ")
+ (copy-sequence c) caption)))))
+ (cdr caption)))
+
+
+;;;; For Derived Back-ends
+;;
+;; `org-export-with-backend' is a function allowing to locally use
+;; another back-end to transcode some object or element. In a derived
+;; back-end, it may be used as a fall-back function once all specific
+;; cases have been treated.
+
+(defun org-export-with-backend (backend data &optional contents info)
+ "Call a transcoder from BACKEND on DATA.
+BACKEND is an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end. DATA is an Org element, object, secondary
+string or string. CONTENTS, when non-nil, is the transcoded
+contents of DATA element, as a string. INFO, when non-nil, is
+the communication channel used for export, as a plist."
+ (when (symbolp backend) (setq backend (org-export-get-backend backend)))
+ (org-export-barf-if-invalid-backend backend)
+ (let ((type (org-element-type data)))
+ (when (memq type '(nil org-data raw))
+ (error "No foreign transcoder available"))
+ (let* ((all-transcoders (org-export-get-all-transcoders backend))
+ (transcoder (cdr (assq type all-transcoders))))
+ (unless (functionp transcoder) (error "No foreign transcoder available"))
+ (let ((new-info
+ (org-combine-plists
+ info (list
+ :back-end backend
+ :translate-alist all-transcoders
+ :exported-data (make-hash-table :test #'eq :size 401)))))
+ ;; `:internal-references' are shared across back-ends.
+ (prog1 (if (eq type 'plain-text)
+ (funcall transcoder data new-info)
+ (funcall transcoder data contents new-info))
+ (plist-put info :internal-references
+ (plist-get new-info :internal-references)))))))
+
+
+;;;; For Export Snippets
+;;
+;; Every export snippet is transmitted to the back-end. Though, the
+;; latter will only retain one type of export-snippet, ignoring
+;; others, based on the former's target back-end. The function
+;; `org-export-snippet-backend' returns that back-end for a given
+;; export-snippet.
+
+(defun org-export-snippet-backend (export-snippet)
+ "Return EXPORT-SNIPPET targeted back-end as a symbol.
+Translation, with `org-export-snippet-translation-alist', is
+applied."
+ (let ((back-end (org-element-property :back-end export-snippet)))
+ (intern
+ (or (cdr (assoc back-end org-export-snippet-translation-alist))
+ back-end))))
+
+
+;;;; For Footnotes
+;;
+;; `org-export-collect-footnote-definitions' is a tool to list
+;; actually used footnotes definitions in the whole parse tree, or in
+;; a headline, in order to add footnote listings throughout the
+;; transcoded data.
+;;
+;; `org-export-footnote-first-reference-p' is a predicate used by some
+;; back-ends, when they need to attach the footnote definition only to
+;; the first occurrence of the corresponding label.
+;;
+;; `org-export-get-footnote-definition' and
+;; `org-export-get-footnote-number' provide easier access to
+;; additional information relative to a footnote reference.
+
+(defun org-export-get-footnote-definition (footnote-reference info)
+ "Return definition of FOOTNOTE-REFERENCE as parsed data.
+INFO is the plist used as a communication channel. If no such
+definition can be found, raise an error."
+ (let ((label (org-element-property :label footnote-reference)))
+ (if (not label) (org-element-contents footnote-reference)
+ (let ((cache (or (plist-get info :footnote-definition-cache)
+ (let ((hash (make-hash-table :test #'equal)))
+ (plist-put info :footnote-definition-cache hash)
+ hash))))
+ (or
+ (gethash label cache)
+ (puthash label
+ (org-element-map (plist-get info :parse-tree)
+ '(footnote-definition footnote-reference)
+ (lambda (f)
+ (cond
+ ;; Skip any footnote with a different label.
+ ;; Also skip any standard footnote reference
+ ;; with the same label since those cannot
+ ;; contain a definition.
+ ((not (equal (org-element-property :label f) label)) nil)
+ ((eq (org-element-property :type f) 'standard) nil)
+ ((org-element-contents f))
+ ;; Even if the contents are empty, we can not
+ ;; return nil since that would eventually raise
+ ;; the error. Instead, return the equivalent
+ ;; empty string.
+ (t "")))
+ info t)
+ cache)
+ (error "Definition not found for footnote %s" label))))))
+
+(defun org-export--footnote-reference-map
+ (function data info &optional body-first)
+ "Apply FUNCTION on every footnote reference in DATA.
+INFO is a plist containing export state. By default, as soon as
+a new footnote reference is encountered, FUNCTION is called onto
+its definition. However, if BODY-FIRST is non-nil, this step is
+delayed until the end of the process."
+ (letrec ((definitions nil)
+ (seen-refs nil)
+ (search-ref
+ (lambda (data delayp)
+ ;; Search footnote references through DATA, filling
+ ;; SEEN-REFS along the way. When DELAYP is non-nil,
+ ;; store footnote definitions so they can be entered
+ ;; later.
+ (org-element-map data 'footnote-reference
+ (lambda (f)
+ (funcall function f)
+ (let ((--label (org-element-property :label f)))
+ (unless (and --label (member --label seen-refs))
+ (when --label (push --label seen-refs))
+ ;; Search for subsequent references in footnote
+ ;; definition so numbering follows reading
+ ;; logic, unless DELAYP in non-nil.
+ (cond
+ (delayp
+ (push (org-export-get-footnote-definition f info)
+ definitions))
+ ;; Do not force entering inline definitions,
+ ;; since `org-element-map' already traverses
+ ;; them at the right time.
+ ((eq (org-element-property :type f) 'inline))
+ (t (funcall search-ref
+ (org-export-get-footnote-definition f info)
+ nil))))))
+ info nil
+ ;; Don't enter footnote definitions since it will
+ ;; happen when their first reference is found.
+ ;; Moreover, if DELAYP is non-nil, make sure we
+ ;; postpone entering definitions of inline references.
+ (if delayp '(footnote-definition footnote-reference)
+ 'footnote-definition)))))
+ (funcall search-ref data body-first)
+ (funcall search-ref (nreverse definitions) nil)))
+
+(defun org-export-collect-footnote-definitions (info &optional data body-first)
+ "Return an alist between footnote numbers, labels and definitions.
+
+INFO is the current export state, as a plist.
+
+Definitions are collected throughout the whole parse tree, or
+DATA when non-nil.
+
+Sorting is done by order of references. As soon as a new
+reference is encountered, other references are searched within
+its definition. However, if BODY-FIRST is non-nil, this step is
+delayed after the whole tree is checked. This alters results
+when references are found in footnote definitions.
+
+Definitions either appear as Org data or as a secondary string
+for inlined footnotes. Unreferenced definitions are ignored."
+ (let ((n 0) labels alist)
+ (org-export--footnote-reference-map
+ (lambda (f)
+ ;; Collect footnote number, label and definition.
+ (let ((l (org-element-property :label f)))
+ (unless (and l (member l labels))
+ (cl-incf n)
+ (push (list n l (org-export-get-footnote-definition f info)) alist))
+ (when l (push l labels))))
+ (or data (plist-get info :parse-tree)) info body-first)
+ (nreverse alist)))
+
+(defun org-export-footnote-first-reference-p
+ (footnote-reference info &optional data body-first)
+ "Non-nil when a footnote reference is the first one for its label.
+
+FOOTNOTE-REFERENCE is the footnote reference being considered.
+INFO is a plist containing current export state.
+
+Search is done throughout the whole parse tree, or DATA when
+non-nil.
+
+By default, as soon as a new footnote reference is encountered,
+other references are searched within its definition. However, if
+BODY-FIRST is non-nil, this step is delayed after the whole tree
+is checked. This alters results when references are found in
+footnote definitions."
+ (let ((label (org-element-property :label footnote-reference)))
+ ;; Anonymous footnotes are always a first reference.
+ (or (not label)
+ (catch 'exit
+ (org-export--footnote-reference-map
+ (lambda (f)
+ (let ((l (org-element-property :label f)))
+ (when (and l label (string= label l))
+ (throw 'exit (eq footnote-reference f)))))
+ (or data (plist-get info :parse-tree)) info body-first)))))
+
+(defun org-export-get-footnote-number (footnote info &optional data body-first)
+ "Return number associated to a footnote.
+
+FOOTNOTE is either a footnote reference or a footnote definition.
+INFO is the plist containing export state.
+
+Number is unique throughout the whole parse tree, or DATA, when
+non-nil.
+
+By default, as soon as a new footnote reference is encountered,
+counting process moves into its definition. However, if
+BODY-FIRST is non-nil, this step is delayed until the end of the
+process, leading to a different order when footnotes are nested."
+ (let ((count 0)
+ (seen)
+ (label (org-element-property :label footnote)))
+ (catch 'exit
+ (org-export--footnote-reference-map
+ (lambda (f)
+ (let ((l (org-element-property :label f)))
+ (cond
+ ;; Anonymous footnote match: return number.
+ ((and (not l) (not label) (eq footnote f)) (throw 'exit (1+ count)))
+ ;; Labels match: return number.
+ ((and label l (string= label l)) (throw 'exit (1+ count)))
+ ;; Otherwise store label and increase counter if label
+ ;; wasn't encountered yet.
+ ((not l) (cl-incf count))
+ ((not (member l seen)) (push l seen) (cl-incf count)))))
+ (or data (plist-get info :parse-tree)) info body-first))))
+
+
+;;;; For Headlines
+;;
+;; `org-export-get-relative-level' is a shortcut to get headline
+;; level, relatively to the lower headline level in the parsed tree.
+;;
+;; `org-export-get-headline-number' returns the section number of an
+;; headline, while `org-export-number-to-roman' allows it to be
+;; converted to roman numbers. With an optional argument,
+;; `org-export-get-headline-number' returns a number to unnumbered
+;; headlines (used for internal id).
+;;
+;; `org-export-low-level-p', `org-export-first-sibling-p' and
+;; `org-export-last-sibling-p' are three useful predicates when it
+;; comes to fulfill the `:headline-levels' property.
+;;
+;; `org-export-get-tags', `org-export-get-category' and
+;; `org-export-get-node-property' extract useful information from an
+;; headline or a parent headline. They all handle inheritance.
+;;
+;; `org-export-get-alt-title' tries to retrieve an alternative title,
+;; as a secondary string, suitable for table of contents. It falls
+;; back onto default title.
+
+(defun org-export-get-relative-level (headline info)
+ "Return HEADLINE relative level within current parsed tree.
+INFO is a plist holding contextual information."
+ (+ (org-element-property :level headline)
+ (or (plist-get info :headline-offset) 0)))
+
+(defun org-export-low-level-p (headline info)
+ "Non-nil when HEADLINE is considered as low level.
+
+INFO is a plist used as a communication channel.
+
+A low level headlines has a relative level greater than
+`:headline-levels' property value.
+
+Return value is the difference between HEADLINE relative level
+and the last level being considered as high enough, or nil."
+ (let ((limit (plist-get info :headline-levels)))
+ (when (wholenump limit)
+ (let ((level (org-export-get-relative-level headline info)))
+ (and (> level limit) (- level limit))))))
+
+(defun org-export-get-headline-number (headline info)
+ "Return numbered HEADLINE numbering as a list of numbers.
+INFO is a plist holding contextual information."
+ (and (org-export-numbered-headline-p headline info)
+ (cdr (assq headline (plist-get info :headline-numbering)))))
+
+(defun org-export-numbered-headline-p (headline info)
+ "Return a non-nil value if HEADLINE element should be numbered.
+INFO is a plist used as a communication channel."
+ (unless (org-not-nil (org-export-get-node-property :UNNUMBERED headline t))
+ (let ((sec-num (plist-get info :section-numbers))
+ (level (org-export-get-relative-level headline info)))
+ (if (wholenump sec-num) (<= level sec-num) sec-num))))
+
+(defun org-export-number-to-roman (n)
+ "Convert integer N into a roman numeral."
+ (let ((roman '((1000 . "M") (900 . "CM") (500 . "D") (400 . "CD")
+ ( 100 . "C") ( 90 . "XC") ( 50 . "L") ( 40 . "XL")
+ ( 10 . "X") ( 9 . "IX") ( 5 . "V") ( 4 . "IV")
+ ( 1 . "I")))
+ (res ""))
+ (if (<= n 0)
+ (number-to-string n)
+ (while roman
+ (if (>= n (caar roman))
+ (setq n (- n (caar roman))
+ res (concat res (cdar roman)))
+ (pop roman)))
+ res)))
+
+(defun org-export-get-tags (element info &optional tags inherited)
+ "Return list of tags associated to ELEMENT.
+
+ELEMENT has either an `headline' or an `inlinetask' type. INFO
+is a plist used as a communication channel.
+
+When non-nil, optional argument TAGS should be a list of strings.
+Any tag belonging to this list will also be removed.
+
+When optional argument INHERITED is non-nil, tags can also be
+inherited from parent headlines and FILETAGS keywords."
+ (cl-remove-if
+ (lambda (tag) (member tag tags))
+ (if (not inherited) (org-element-property :tags element)
+ ;; Build complete list of inherited tags.
+ (let ((current-tag-list (org-element-property :tags element)))
+ (dolist (parent (org-element-lineage element))
+ (dolist (tag (org-element-property :tags parent))
+ (when (and (memq (org-element-type parent) '(headline inlinetask))
+ (not (member tag current-tag-list)))
+ (push tag current-tag-list))))
+ ;; Add FILETAGS keywords and return results.
+ (org-uniquify (append (plist-get info :filetags) current-tag-list))))))
+
+(defun org-export-get-node-property (property datum &optional inherited)
+ "Return node PROPERTY value for DATUM.
+
+PROPERTY is an upcase symbol (e.g., `:COOKIE_DATA'). DATUM is an
+element or object.
+
+If optional argument INHERITED is non-nil, the value can be
+inherited from a parent headline.
+
+Return value is a string or nil."
+ (let ((headline (if (eq (org-element-type datum) 'headline) datum
+ (org-export-get-parent-headline datum))))
+ (if (not inherited) (org-element-property property datum)
+ (let ((parent headline))
+ (catch 'found
+ (while parent
+ (when (plist-member (nth 1 parent) property)
+ (throw 'found (org-element-property property parent)))
+ (setq parent (org-element-property :parent parent))))))))
+
+(defun org-export-get-category (blob info)
+ "Return category for element or object BLOB.
+
+INFO is a plist used as a communication channel.
+
+CATEGORY is automatically inherited from a parent headline, from
+#+CATEGORY: keyword or created out of original file name. If all
+fail, the fall-back value is \"???\"."
+ (or (org-export-get-node-property :CATEGORY blob t)
+ (org-element-map (plist-get info :parse-tree) 'keyword
+ (lambda (kwd)
+ (when (equal (org-element-property :key kwd) "CATEGORY")
+ (org-element-property :value kwd)))
+ info 'first-match)
+ (let ((file (plist-get info :input-file)))
+ (and file (file-name-sans-extension (file-name-nondirectory file))))
+ "???"))
+
+(defun org-export-get-alt-title (headline _)
+ "Return alternative title for HEADLINE, as a secondary string.
+If no optional title is defined, fall-back to the regular title."
+ (let ((alt (org-element-property :ALT_TITLE headline)))
+ (if alt (org-element-parse-secondary-string
+ alt (org-element-restriction 'headline) headline)
+ (org-element-property :title headline))))
+
+(defun org-export-first-sibling-p (blob info)
+ "Non-nil when BLOB is the first sibling in its parent.
+BLOB is an element or an object. If BLOB is a headline, non-nil
+means it is the first sibling in the sub-tree. INFO is a plist
+used as a communication channel."
+ (memq (org-element-type (org-export-get-previous-element blob info))
+ '(nil section)))
+
+(defun org-export-last-sibling-p (datum info)
+ "Non-nil when DATUM is the last sibling in its parent.
+DATUM is an element or an object. INFO is a plist used as
+a communication channel."
+ (let ((next (org-export-get-next-element datum info)))
+ (or (not next)
+ (and (eq 'headline (org-element-type datum))
+ (> (org-element-property :level datum)
+ (org-element-property :level next))))))
+
+
+;;;; For Keywords
+;;
+;; `org-export-get-date' returns a date appropriate for the document
+;; to about to be exported. In particular, it takes care of
+;; `org-export-date-timestamp-format'.
+
+(defun org-export-get-date (info &optional fmt)
+ "Return date value for the current document.
+
+INFO is a plist used as a communication channel. FMT, when
+non-nil, is a time format string that will be applied on the date
+if it consists in a single timestamp object. It defaults to
+`org-export-date-timestamp-format' when nil.
+
+A proper date can be a secondary string, a string or nil. It is
+meant to be translated with `org-export-data' or alike."
+ (let ((date (plist-get info :date))
+ (fmt (or fmt org-export-date-timestamp-format)))
+ (cond ((not date) nil)
+ ((and fmt
+ (not (cdr date))
+ (eq (org-element-type (car date)) 'timestamp))
+ (org-timestamp-format (car date) fmt))
+ (t date))))
+
+
+;;;; For Links
+;;
+;; `org-export-custom-protocol-maybe' handles custom protocol defined
+;; in `org-link-parameters'.
+;;
+;; `org-export-get-coderef-format' returns an appropriate format
+;; string for coderefs.
+;;
+;; `org-export-inline-image-p' returns a non-nil value when the link
+;; provided should be considered as an inline image.
+;;
+;; `org-export-resolve-fuzzy-link' searches destination of fuzzy links
+;; (i.e. links with "fuzzy" as type) within the parsed tree, and
+;; returns an appropriate unique identifier.
+;;
+;; `org-export-resolve-id-link' returns the first headline with
+;; specified id or custom-id in parse tree, the path to the external
+;; file with the id.
+;;
+;; `org-export-resolve-link' searches for the destination of a link
+;; within the parsed tree and returns the element.
+;;
+;; `org-export-resolve-coderef' associates a reference to a line
+;; number in the element it belongs, or returns the reference itself
+;; when the element isn't numbered.
+;;
+;; `org-export-file-uri' expands a filename as stored in :path value
+;; of a "file" link into a file URI.
+;;
+;; Broken links raise a `org-link-broken' error, which is caught by
+;; `org-export-data' for further processing, depending on
+;; `org-export-with-broken-links' value.
+
+(org-define-error 'org-link-broken "Unable to resolve link; aborting")
+
+(defun org-export-custom-protocol-maybe (link desc backend &optional info)
+ "Try exporting LINK object with a dedicated function.
+
+DESC is its description, as a string, or nil. BACKEND is the
+back-end used for export, as a symbol.
+
+Return output as a string, or nil if no protocol handles LINK.
+
+A custom protocol has precedence over regular back-end export.
+The function ignores links with an implicit type (e.g.,
+\"custom-id\")."
+ (let ((type (org-element-property :type link)))
+ (unless (or (member type '("coderef" "custom-id" "fuzzy" "radio" nil))
+ (not backend))
+ (let ((protocol (org-link-get-parameter type :export))
+ (path (org-element-property :path link)))
+ (and (functionp protocol)
+ (condition-case nil
+ (funcall protocol path desc backend info)
+ ;; XXX: The function used (< Org 9.4) to accept only
+ ;; three mandatory arguments. Type-specific `:export'
+ ;; functions in the wild may not handle current
+ ;; signature. Provide backward compatibility support
+ ;; for them.
+ (wrong-number-of-arguments
+ (funcall protocol path desc backend))))))))
+
+(defun org-export-get-coderef-format (path desc)
+ "Return format string for code reference link.
+PATH is the link path. DESC is its description."
+ (save-match-data
+ (cond ((not desc) "%s")
+ ((string-match (regexp-quote (concat "(" path ")")) desc)
+ (replace-match "%s" t t desc))
+ (t desc))))
+
+(defun org-export-inline-image-p (link &optional rules)
+ "Non-nil if LINK object points to an inline image.
+
+Optional argument is a set of RULES defining inline images. It
+is an alist where associations have the following shape:
+
+ (TYPE . REGEXP)
+
+Applying a rule means apply REGEXP against LINK's path when its
+type is TYPE. The function will return a non-nil value if any of
+the provided rules is non-nil. The default rule is
+`org-export-default-inline-image-rule'.
+
+This only applies to links without a description."
+ (and (not (org-element-contents link))
+ (let ((case-fold-search t))
+ (cl-some (lambda (rule)
+ (and (string= (org-element-property :type link) (car rule))
+ (string-match-p (cdr rule)
+ (org-element-property :path link))))
+ (or rules org-export-default-inline-image-rule)))))
+
+(defun org-export-insert-image-links (data info &optional rules)
+ "Insert image links in DATA.
+
+Org syntax does not support nested links. Nevertheless, some
+export back-ends support images as descriptions of links. Since
+images are really links to image files, we need to make an
+exception about links nesting.
+
+This function recognizes links whose contents are really images
+and turn them into proper nested links. It is meant to be used
+as a parse tree filter in back-ends supporting such constructs.
+
+DATA is a parse tree. INFO is the current state of the export
+process, as a plist.
+
+A description is a valid images if it matches any rule in RULES,
+if non-nil, or `org-export-default-inline-image-rule' otherwise.
+See `org-export-inline-image-p' for more information about the
+structure of RULES.
+
+Return modified DATA."
+ (let ((link-re (format "\\`\\(?:%s\\|%s\\)\\'"
+ org-link-plain-re
+ org-link-angle-re))
+ (case-fold-search t))
+ (org-element-map data 'link
+ (lambda (l)
+ (let ((contents (org-element-interpret-data (org-element-contents l))))
+ (when (and (org-string-nw-p contents)
+ (string-match link-re contents))
+ (let ((type (match-string 1 contents))
+ (path (match-string 2 contents)))
+ (when (cl-some (lambda (rule)
+ (and (string= type (car rule))
+ (string-match-p (cdr rule) path)))
+ (or rules org-export-default-inline-image-rule))
+ ;; Replace contents with image link.
+ (org-element-adopt-elements
+ (org-element-set-contents l nil)
+ (with-temp-buffer
+ (save-excursion (insert contents))
+ (org-element-link-parser))))))))
+ info nil nil t))
+ data)
+
+(defun org-export-resolve-coderef (ref info)
+ "Resolve a code reference REF.
+
+INFO is a plist used as a communication channel.
+
+Return associated line number in source code, or REF itself,
+depending on src-block or example element's switches. Throw an
+error if no block contains REF."
+ (or (org-element-map (plist-get info :parse-tree) '(example-block src-block)
+ (lambda (el)
+ (with-temp-buffer
+ (insert (org-trim (org-element-property :value el)))
+ (let* ((label-fmt (or (org-element-property :label-fmt el)
+ org-coderef-label-format))
+ (ref-re (org-src-coderef-regexp label-fmt ref)))
+ ;; Element containing REF is found. Resolve it to
+ ;; either a label or a line number, as needed.
+ (when (re-search-backward ref-re nil t)
+ (if (org-element-property :use-labels el) ref
+ (+ (or (org-export-get-loc el info) 0)
+ (line-number-at-pos)))))))
+ info 'first-match)
+ (signal 'org-link-broken (list ref))))
+
+(defun org-export-search-cells (datum)
+ "List search cells for element or object DATUM.
+
+A search cell follows the pattern (TYPE . SEARCH) where
+
+ TYPE is a symbol among `headline', `custom-id', `target' and
+ `other'.
+
+ SEARCH is the string a link is expected to match. More
+ accurately, it is
+
+ - headline's title, as a list of strings, if TYPE is
+ `headline'.
+
+ - CUSTOM_ID value, as a string, if TYPE is `custom-id'.
+
+ - target's or radio-target's name as a list of strings if
+ TYPE is `target'.
+
+ - NAME affiliated keyword if TYPE is `other'.
+
+A search cell is the internal representation of a fuzzy link. It
+ignores white spaces and statistics cookies, if applicable."
+ (pcase (org-element-type datum)
+ (`headline
+ (let ((title (split-string
+ (replace-regexp-in-string
+ "\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]" " "
+ (org-element-property :raw-value datum)))))
+ (delq nil
+ (list
+ (cons 'headline title)
+ (cons 'other title)
+ (let ((custom-id (org-element-property :custom-id datum)))
+ (and custom-id (cons 'custom-id custom-id)))))))
+ (`target
+ (list (cons 'target (split-string (org-element-property :value datum)))))
+ ((and (let name (org-element-property :name datum))
+ (guard name))
+ (list (cons 'other (split-string name))))
+ (_ nil)))
+
+(defun org-export-string-to-search-cell (s)
+ "Return search cells associated to string S.
+S is either the path of a fuzzy link or a search option, i.e., it
+tries to match either a headline (through custom ID or title),
+a target or a named element."
+ (pcase (string-to-char s)
+ (?* (list (cons 'headline (split-string (substring s 1)))))
+ (?# (list (cons 'custom-id (substring s 1))))
+ ((let search (split-string s))
+ (list (cons 'target search) (cons 'other search)))))
+
+(defun org-export-match-search-cell-p (datum cells)
+ "Non-nil when DATUM matches search cells CELLS.
+DATUM is an element or object. CELLS is a list of search cells,
+as returned by `org-export-search-cells'."
+ (let ((targets (org-export-search-cells datum)))
+ (and targets (cl-some (lambda (cell) (member cell targets)) cells))))
+
+(defun org-export-resolve-fuzzy-link (link info &rest pseudo-types)
+ "Return LINK destination.
+
+INFO is a plist holding contextual information.
+
+Return value can be an object or an element:
+
+- If LINK path matches a target object (i.e. <<path>>) return it.
+
+- If LINK path exactly matches the name affiliated keyword
+ (i.e. #+NAME: path) of an element, return that element.
+
+- If LINK path exactly matches any headline name, return that
+ element.
+
+- Otherwise, throw an error.
+
+PSEUDO-TYPES are pseudo-elements types, i.e., elements defined
+specifically in an export back-end, that could have a name
+affiliated keyword.
+
+Assume LINK type is \"fuzzy\". White spaces are not
+significant."
+ (let* ((search-cells (org-export-string-to-search-cell
+ (org-element-property :path link)))
+ (link-cache (or (plist-get info :resolve-fuzzy-link-cache)
+ (let ((table (make-hash-table :test #'eq)))
+ (plist-put info :resolve-fuzzy-link-cache table)
+ table)))
+ (cached (gethash search-cells link-cache 'not-found)))
+ (if (not (eq cached 'not-found)) cached
+ (let ((matches
+ (org-element-map (plist-get info :parse-tree)
+ (append pseudo-types '(target) org-element-all-elements)
+ (lambda (datum)
+ (and (org-export-match-search-cell-p datum search-cells)
+ datum)))))
+ (unless matches
+ (signal 'org-link-broken (list (org-element-property :path link))))
+ (puthash
+ search-cells
+ ;; There can be multiple matches for un-typed searches, i.e.,
+ ;; for searches not starting with # or *. In this case,
+ ;; prioritize targets and names over headline titles.
+ ;; Matching both a name and a target is not valid, and
+ ;; therefore undefined.
+ (or (cl-some (lambda (datum)
+ (and (not (eq (org-element-type datum) 'headline))
+ datum))
+ matches)
+ (car matches))
+ link-cache)))))
+
+(defun org-export-resolve-id-link (link info)
+ "Return headline referenced as LINK destination.
+
+INFO is a plist used as a communication channel.
+
+Return value can be the headline element matched in current parse
+tree or a file name. Assume LINK type is either \"id\" or
+\"custom-id\". Throw an error if no match is found."
+ (let ((id (org-element-property :path link)))
+ ;; First check if id is within the current parse tree.
+ (or (org-element-map (plist-get info :parse-tree) 'headline
+ (lambda (headline)
+ (when (or (equal (org-element-property :ID headline) id)
+ (equal (org-element-property :CUSTOM_ID headline) id))
+ headline))
+ info 'first-match)
+ ;; Otherwise, look for external files.
+ (cdr (assoc id (plist-get info :id-alist)))
+ (signal 'org-link-broken (list id)))))
+
+(defun org-export-resolve-radio-link (link info)
+ "Return radio-target object referenced as LINK destination.
+
+INFO is a plist used as a communication channel.
+
+Return value can be a radio-target object or nil. Assume LINK
+has type \"radio\"."
+ (let ((path (replace-regexp-in-string
+ "[ \r\t\n]+" " " (org-element-property :path link))))
+ (org-element-map (plist-get info :parse-tree) 'radio-target
+ (lambda (radio)
+ (and (eq (compare-strings
+ (replace-regexp-in-string
+ "[ \r\t\n]+" " " (org-element-property :value radio))
+ nil nil path nil nil t)
+ t)
+ radio))
+ info 'first-match)))
+
+(defun org-export-resolve-link (link info)
+ "Return LINK destination.
+
+LINK is a string or a link object.
+
+INFO is a plist holding contextual information.
+
+Return value can be an object or an element:
+
+- If LINK path matches an ID or a custom ID, return the headline.
+
+- If LINK path matches a fuzzy link, return its destination.
+
+- Otherwise, throw an error."
+ ;; Convert string links to link objects.
+ (when (stringp link)
+ (setq link (with-temp-buffer
+ (save-excursion
+ (insert (org-link-make-string link)))
+ (org-element-link-parser))))
+ (pcase (org-element-property :type link)
+ ((or "custom-id" "id") (org-export-resolve-id-link link info))
+ ("fuzzy" (org-export-resolve-fuzzy-link link info))
+ (_ (signal 'org-link-broken (list (org-element-property :path link))))))
+
+(defun org-export-file-uri (filename)
+ "Return file URI associated to FILENAME."
+ (cond ((string-prefix-p "//" filename) (concat "file:" filename))
+ ((not (file-name-absolute-p filename)) filename)
+ ((file-remote-p filename) (concat "file:/" filename))
+ (t
+ (let ((fullname (expand-file-name filename)))
+ (concat (if (string-prefix-p "/" fullname) "file://" "file:///")
+ fullname)))))
+
+;;;; For References
+;;
+;; `org-export-get-reference' associate a unique reference for any
+;; object or element. It uses `org-export-new-reference' and
+;; `org-export-format-reference' to, respectively, generate new
+;; internal references and turn them into a string suitable for
+;; output.
+;;
+;; `org-export-get-ordinal' associates a sequence number to any object
+;; or element.
+
+(defun org-export-new-reference (references)
+ "Return a unique reference, among REFERENCES.
+REFERENCES is an alist whose values are in-use references, as
+numbers. Returns a number, which is the internal representation
+of a reference. See also `org-export-format-reference'."
+ ;; Generate random 7 digits hexadecimal numbers. Collisions
+ ;; increase exponentially with the numbers of references. However,
+ ;; the odds for encountering at least one collision with 1000 active
+ ;; references in the same document are roughly 0.2%, so this
+ ;; shouldn't be the bottleneck.
+ (let ((new (random #x10000000)))
+ (while (rassq new references) (setq new (random #x10000000)))
+ new))
+
+(defun org-export-format-reference (reference)
+ "Format REFERENCE into a string.
+REFERENCE is a number representing a reference, as returned by
+`org-export-new-reference', which see."
+ (format "org%07x" reference))
+
+(defun org-export-get-reference (datum info)
+ "Return a unique reference for DATUM, as a string.
+
+DATUM is either an element or an object. INFO is the current
+export state, as a plist.
+
+References for the current document are stored in
+`:internal-references' property. Its value is an alist with
+associations of the following types:
+
+ (REFERENCE . DATUM) and (SEARCH-CELL . ID)
+
+REFERENCE is the reference string to be used for object or
+element DATUM. SEARCH-CELL is a search cell, as returned by
+`org-export-search-cells'. ID is a number or a string uniquely
+identifying DATUM within the document.
+
+This function also checks `:crossrefs' property for search cells
+matching DATUM before creating a new reference."
+ (let ((cache (plist-get info :internal-references)))
+ (or (car (rassq datum cache))
+ (let* ((crossrefs (plist-get info :crossrefs))
+ (cells (org-export-search-cells datum))
+ ;; Preserve any pre-existing association between
+ ;; a search cell and a reference, i.e., when some
+ ;; previously published document referenced a location
+ ;; within current file (see
+ ;; `org-publish-resolve-external-link').
+ ;;
+ ;; However, there is no guarantee that search cells are
+ ;; unique, e.g., there might be duplicate custom ID or
+ ;; two headings with the same title in the file.
+ ;;
+ ;; As a consequence, before re-using any reference to
+ ;; an element or object, we check that it doesn't refer
+ ;; to a previous element or object.
+ (new (or (cl-some
+ (lambda (cell)
+ (let ((stored (cdr (assoc cell crossrefs))))
+ (when stored
+ (let ((old (org-export-format-reference stored)))
+ (and (not (assoc old cache)) stored)))))
+ cells)
+ (org-export-new-reference cache)))
+ (reference-string (org-export-format-reference new)))
+ ;; Cache contains both data already associated to
+ ;; a reference and in-use internal references, so as to make
+ ;; unique references.
+ (dolist (cell cells) (push (cons cell new) cache))
+ ;; Retain a direct association between reference string and
+ ;; DATUM since (1) not every object or element can be given
+ ;; a search cell (2) it permits quick lookup.
+ (push (cons reference-string datum) cache)
+ (plist-put info :internal-references cache)
+ reference-string))))
+
+(defun org-export-get-ordinal (element info &optional types predicate)
+ "Return ordinal number of an element or object.
+
+ELEMENT is the element or object considered. INFO is the plist
+used as a communication channel.
+
+Optional argument TYPES, when non-nil, is a list of element or
+object types, as symbols, that should also be counted in.
+Otherwise, only provided element's type is considered.
+
+Optional argument PREDICATE is a function returning a non-nil
+value if the current element or object should be counted in. It
+accepts two arguments: the element or object being considered and
+the plist used as a communication channel. This allows counting
+only a certain type of object (i.e. inline images).
+
+Return value is a list of numbers if ELEMENT is a headline or an
+item. It is nil for keywords. It represents the footnote number
+for footnote definitions and footnote references. If ELEMENT is
+a target, return the same value as if ELEMENT was the closest
+table, item or headline containing the target. In any other
+case, return the sequence number of ELEMENT among elements or
+objects of the same type."
+ ;; Ordinal of a target object refer to the ordinal of the closest
+ ;; table, item, or headline containing the object.
+ (when (eq (org-element-type element) 'target)
+ (setq element
+ (org-element-lineage
+ element
+ '(footnote-definition footnote-reference headline item table))))
+ (cl-case (org-element-type element)
+ ;; Special case 1: A headline returns its number as a list.
+ (headline (org-export-get-headline-number element info))
+ ;; Special case 2: An item returns its number as a list.
+ (item (let ((struct (org-element-property :structure element)))
+ (org-list-get-item-number
+ (org-element-property :begin element)
+ struct
+ (org-list-prevs-alist struct)
+ (org-list-parents-alist struct))))
+ ((footnote-definition footnote-reference)
+ (org-export-get-footnote-number element info))
+ (otherwise
+ (let ((counter 0))
+ ;; Increment counter until ELEMENT is found again.
+ (org-element-map (plist-get info :parse-tree)
+ (or types (org-element-type element))
+ (lambda (el)
+ (cond
+ ((eq element el) (1+ counter))
+ ((not predicate) (cl-incf counter) nil)
+ ((funcall predicate el info) (cl-incf counter) nil)))
+ info 'first-match)))))
+
+;;;; For Raw objects
+;;
+;; `org-export-raw-string' builds a pseudo-object out of a string
+;; that any export back-end returns as-is.
+
+;;;###autoload
+(defun org-export-raw-string (s)
+ "Return a raw object containing string S.
+A raw string is exported as-is, with no additional processing
+from the export back-end."
+ (unless (stringp s) (error "Wrong raw contents type: %S" s))
+ (org-element-create 'raw nil s))
+
+;;;; For Src-Blocks
+;;
+;; `org-export-get-loc' counts number of code lines accumulated in
+;; src-block or example-block elements with a "+n" switch until
+;; a given element, excluded. Note: "-n" switches reset that count.
+;;
+;; `org-export-unravel-code' extracts source code (along with a code
+;; references alist) from an `element-block' or `src-block' type
+;; element.
+;;
+;; `org-export-format-code' applies a formatting function to each line
+;; of code, providing relative line number and code reference when
+;; appropriate. Since it doesn't access the original element from
+;; which the source code is coming, it expects from the code calling
+;; it to know if lines should be numbered and if code references
+;; should appear.
+;;
+;; Eventually, `org-export-format-code-default' is a higher-level
+;; function (it makes use of the two previous functions) which handles
+;; line numbering and code references inclusion, and returns source
+;; code in a format suitable for plain text or verbatim output.
+
+(defun org-export-get-loc (element info)
+ "Return count of lines of code before ELEMENT.
+
+ELEMENT is an example-block or src-block element. INFO is the
+plist used as a communication channel.
+
+Count includes every line of code in example-block or src-block
+with a \"+n\" or \"-n\" switch before block. Return nil if
+ELEMENT doesn't allow line numbering."
+ (pcase (org-element-property :number-lines element)
+ (`(new . ,n) n)
+ (`(continued . ,n)
+ (let ((loc 0))
+ (org-element-map (plist-get info :parse-tree) '(src-block example-block)
+ (lambda (el)
+ ;; ELEMENT is reached: Quit loop and return locs.
+ (if (eq el element) (+ loc n)
+ ;; Only count lines from src-block and example-block
+ ;; elements with a "+n" or "-n" switch.
+ (let ((linum (org-element-property :number-lines el)))
+ (when linum
+ (let ((lines (org-count-lines
+ (org-element-property :value el))))
+ ;; Accumulate locs or reset them.
+ (pcase linum
+ (`(new . ,n) (setq loc (+ n lines)))
+ (`(continued . ,n) (cl-incf loc (+ n lines)))))))
+ nil)) ;Return nil to stay in the loop.
+ info 'first-match)))))
+
+(defun org-export-unravel-code (element)
+ "Clean source code and extract references out of it.
+
+ELEMENT has either a `src-block' an `example-block' type.
+
+Return a cons cell whose CAR is the source code, cleaned from any
+reference, protective commas and spurious indentation, and CDR is
+an alist between relative line number (integer) and name of code
+reference on that line (string)."
+ (let* ((line 0) refs
+ (value (org-element-property :value element))
+ ;; Remove global indentation from code, if necessary. Also
+ ;; remove final newline character, since it doesn't belongs
+ ;; to the code proper.
+ (code (replace-regexp-in-string
+ "\n\\'" ""
+ (if (or org-src-preserve-indentation
+ (org-element-property :preserve-indent element))
+ value
+ (org-remove-indentation value))))
+ ;; Build a regexp matching a loc with a reference.
+ (ref-re (org-src-coderef-regexp (org-src-coderef-format element))))
+ ;; Return value.
+ (cons
+ ;; Code with references removed.
+ (mapconcat
+ (lambda (loc)
+ (cl-incf line)
+ (if (not (string-match ref-re loc)) loc
+ ;; Ref line: remove ref, and add its position in REFS.
+ (push (cons line (match-string 3 loc)) refs)
+ (replace-match "" nil nil loc 1)))
+ (split-string code "\n") "\n")
+ ;; Reference alist.
+ refs)))
+
+(defun org-export-format-code (code fun &optional num-lines ref-alist)
+ "Format CODE by applying FUN line-wise and return it.
+
+CODE is a string representing the code to format. FUN is
+a function. It must accept three arguments: a line of
+code (string), the current line number (integer) or nil and the
+reference associated to the current line (string) or nil.
+
+Optional argument NUM-LINES can be an integer representing the
+number of code lines accumulated until the current code. Line
+numbers passed to FUN will take it into account. If it is nil,
+FUN's second argument will always be nil. This number can be
+obtained with `org-export-get-loc' function.
+
+Optional argument REF-ALIST can be an alist between relative line
+number (i.e. ignoring NUM-LINES) and the name of the code
+reference on it. If it is nil, FUN's third argument will always
+be nil. It can be obtained through the use of
+`org-export-unravel-code' function."
+ (let ((--locs (split-string code "\n"))
+ (--line 0))
+ (concat
+ (mapconcat
+ (lambda (--loc)
+ (cl-incf --line)
+ (let ((--ref (cdr (assq --line ref-alist))))
+ (funcall fun --loc (and num-lines (+ num-lines --line)) --ref)))
+ --locs "\n")
+ "\n")))
+
+(defun org-export-format-code-default (element info)
+ "Return source code from ELEMENT, formatted in a standard way.
+
+ELEMENT is either a `src-block' or `example-block' element. INFO
+is a plist used as a communication channel.
+
+This function takes care of line numbering and code references
+inclusion. Line numbers, when applicable, appear at the
+beginning of the line, separated from the code by two white
+spaces. Code references, on the other hand, appear flushed to
+the right, separated by six white spaces from the widest line of
+code."
+ ;; Extract code and references.
+ (let* ((code-info (org-export-unravel-code element))
+ (code (car code-info))
+ (code-lines (split-string code "\n")))
+ (if (null code-lines) ""
+ (let* ((refs (and (org-element-property :retain-labels element)
+ (cdr code-info)))
+ ;; Handle line numbering.
+ (num-start (org-export-get-loc element info))
+ (num-fmt
+ (and num-start
+ (format "%%%ds "
+ (length (number-to-string
+ (+ (length code-lines) num-start))))))
+ ;; Prepare references display, if required. Any reference
+ ;; should start six columns after the widest line of code,
+ ;; wrapped with parenthesis.
+ (max-width
+ (+ (apply #'max (mapcar #'length code-lines))
+ (if (not num-start) 0 (length (format num-fmt num-start))))))
+ (org-export-format-code
+ code
+ (lambda (loc line-num ref)
+ (let ((number-str (and num-fmt (format num-fmt line-num))))
+ (concat
+ number-str
+ loc
+ (and ref
+ (concat (make-string (- (+ 6 max-width)
+ (+ (length loc) (length number-str)))
+ ?\s)
+ (format "(%s)" ref))))))
+ num-start refs)))))
+
+
+;;;; For Tables
+;;
+;; `org-export-table-has-special-column-p' and
+;; `org-export-table-row-is-special-p' are predicates used to look for
+;; meta-information about the table structure.
+;;
+;; `org-export-table-cell-width', `org-export-table-cell-alignment'
+;; and `org-export-table-cell-borders' extract information from
+;; a table-cell element.
+;;
+;; `org-export-table-dimensions' gives the number on rows and columns
+;; in the table, ignoring horizontal rules and special columns.
+;; `org-export-table-cell-address', given a table-cell object, returns
+;; the absolute address of a cell. On the other hand,
+;; `org-export-get-table-cell-at' does the contrary.
+;;
+;; `org-export-table-cell-starts-colgroup-p',
+;; `org-export-table-cell-ends-colgroup-p',
+;; `org-export-table-row-starts-rowgroup-p',
+;; `org-export-table-row-ends-rowgroup-p',
+;; `org-export-table-row-starts-header-p',
+;; `org-export-table-row-ends-header-p' and
+;; `org-export-table-row-in-header-p' indicate position of current row
+;; or cell within the table.
+
+(defun org-export-table-has-special-column-p (table)
+ "Non-nil when TABLE has a special column.
+All special columns will be ignored during export."
+ ;; The table has a special column when every first cell of every row
+ ;; has an empty value or contains a symbol among "/", "#", "!", "$",
+ ;; "*" "_" and "^". Though, do not consider a first column
+ ;; containing only empty cells as special.
+ (let ((special-column? 'empty))
+ (catch 'exit
+ (dolist (row (org-element-contents table))
+ (when (eq (org-element-property :type row) 'standard)
+ (let ((value (org-element-contents
+ (car (org-element-contents row)))))
+ (cond ((member value
+ '(("/") ("#") ("!") ("$") ("*") ("_") ("^")))
+ (setq special-column? 'special))
+ ((null value))
+ (t (throw 'exit nil))))))
+ (eq special-column? 'special))))
+
+(defun org-export-table-has-header-p (table info)
+ "Non-nil when TABLE has a header.
+
+INFO is a plist used as a communication channel.
+
+A table has a header when it contains at least two row groups."
+ (let* ((cache (or (plist-get info :table-header-cache)
+ (let ((table (make-hash-table :test #'eq)))
+ (plist-put info :table-header-cache table)
+ table)))
+ (cached (gethash table cache 'no-cache)))
+ (if (not (eq cached 'no-cache)) cached
+ (let ((rowgroup 1) row-flag)
+ (puthash table
+ (org-element-map table 'table-row
+ (lambda (row)
+ (cond
+ ((> rowgroup 1) t)
+ ((and row-flag
+ (eq (org-element-property :type row) 'rule))
+ (cl-incf rowgroup)
+ (setq row-flag nil))
+ ((and (not row-flag)
+ (eq (org-element-property :type row) 'standard))
+ (setq row-flag t)
+ nil)))
+ info 'first-match)
+ cache)))))
+
+(defun org-export-table-row-is-special-p (table-row _)
+ "Non-nil if TABLE-ROW is considered special.
+All special rows will be ignored during export."
+ (when (eq (org-element-property :type table-row) 'standard)
+ (let ((first-cell (org-element-contents
+ (car (org-element-contents table-row)))))
+ ;; A row is special either when...
+ (or
+ ;; ... it starts with a field only containing "/",
+ (equal first-cell '("/"))
+ ;; ... the table contains a special column and the row start
+ ;; with a marking character among, "^", "_", "$" or "!",
+ (and (org-export-table-has-special-column-p
+ (org-export-get-parent table-row))
+ (member first-cell '(("^") ("_") ("$") ("!"))))
+ ;; ... it contains only alignment cookies and empty cells.
+ (let ((special-row-p 'empty))
+ (catch 'exit
+ (dolist (cell (org-element-contents table-row))
+ (let ((value (org-element-contents cell)))
+ ;; Since VALUE is a secondary string, the following
+ ;; checks avoid expanding it with `org-export-data'.
+ (cond ((not value))
+ ((and (not (cdr value))
+ (stringp (car value))
+ (string-match "\\`<[lrc]?\\([0-9]+\\)?>\\'"
+ (car value)))
+ (setq special-row-p 'cookie))
+ (t (throw 'exit nil)))))
+ (eq special-row-p 'cookie)))))))
+
+(defun org-export-table-row-group (table-row info)
+ "Return TABLE-ROW's group number, as an integer.
+
+INFO is a plist used as the communication channel.
+
+Return value is the group number, as an integer, or nil for
+special rows and rows separators. First group is also table's
+header."
+ (when (eq (org-element-property :type table-row) 'standard)
+ (let* ((cache (or (plist-get info :table-row-group-cache)
+ (let ((table (make-hash-table :test #'eq)))
+ (plist-put info :table-row-group-cache table)
+ table)))
+ (cached (gethash table-row cache 'no-cache)))
+ (if (not (eq cached 'no-cache)) cached
+ ;; First time a row is queried, populate cache with all the
+ ;; rows from the table.
+ (let ((group 0) row-flag)
+ (org-element-map (org-export-get-parent table-row) 'table-row
+ (lambda (row)
+ (if (eq (org-element-property :type row) 'rule)
+ (setq row-flag nil)
+ (unless row-flag (cl-incf group) (setq row-flag t))
+ (puthash row group cache)))
+ info))
+ (gethash table-row cache)))))
+
+(defun org-export-table-cell-width (table-cell info)
+ "Return TABLE-CELL contents width.
+
+INFO is a plist used as the communication channel.
+
+Return value is the width given by the last width cookie in the
+same column as TABLE-CELL, or nil."
+ (let* ((row (org-export-get-parent table-cell))
+ (table (org-export-get-parent row))
+ (cells (org-element-contents row))
+ (columns (length cells))
+ (column (- columns (length (memq table-cell cells))))
+ (cache (or (plist-get info :table-cell-width-cache)
+ (let ((table (make-hash-table :test #'eq)))
+ (plist-put info :table-cell-width-cache table)
+ table)))
+ (width-vector (or (gethash table cache)
+ (puthash table (make-vector columns 'empty) cache))))
+ ;; Table rows may not have the same number of cells. Extend
+ ;; WIDTH-VECTOR appropriately if we encounter a row larger than
+ ;; expected.
+ (when (>= column (length width-vector))
+ (setq width-vector
+ (vconcat width-vector
+ (make-list (- (1+ column) (length width-vector))
+ 'empty)))
+ (puthash table width-vector cache))
+ (pcase (aref width-vector column)
+ (`empty
+ (catch 'found
+ (dolist (row (org-element-contents table))
+ (when (org-export-table-row-is-special-p row info)
+ ;; In a special row, try to find a width cookie at
+ ;; COLUMN. The following checks avoid expanding
+ ;; unnecessarily the cell with `org-export-data'.
+ (pcase (org-element-contents
+ (elt (org-element-contents row) column))
+ (`(,(and (pred stringp) cookie))
+ (when (string-match "\\`<[lrc]?\\([0-9]+\\)>\\'" cookie)
+ (let ((w (string-to-number (match-string 1 cookie))))
+ (throw 'found (aset width-vector column w))))))))
+ (aset width-vector column nil)))
+ (value value))))
+
+(defun org-export-table-cell-alignment (table-cell info)
+ "Return TABLE-CELL contents alignment.
+
+INFO is a plist used as the communication channel.
+
+Return alignment as specified by the last alignment cookie in the
+same column as TABLE-CELL. If no such cookie is found, a default
+alignment value will be deduced from fraction of numbers in the
+column (see `org-table-number-fraction' for more information).
+Possible values are `left', `right' and `center'."
+ ;; Load `org-table-number-fraction' and `org-table-number-regexp'.
+ (require 'org-table)
+ (let* ((row (org-export-get-parent table-cell))
+ (table (org-export-get-parent row))
+ (cells (org-element-contents row))
+ (columns (length cells))
+ (column (- columns (length (memq table-cell cells))))
+ (cache (or (plist-get info :table-cell-alignment-cache)
+ (let ((table (make-hash-table :test #'eq)))
+ (plist-put info :table-cell-alignment-cache table)
+ table)))
+ (align-vector (or (gethash table cache)
+ (puthash table (make-vector columns nil) cache))))
+ ;; Table rows may not have the same number of cells. Extend
+ ;; ALIGN-VECTOR appropriately if we encounter a row larger than
+ ;; expected.
+ (when (>= column (length align-vector))
+ (setq align-vector
+ (vconcat align-vector
+ (make-list (- (1+ column) (length align-vector))
+ nil)))
+ (puthash table align-vector cache))
+ (or (aref align-vector column)
+ (let ((number-cells 0)
+ (total-cells 0)
+ cookie-align
+ previous-cell-number-p)
+ (dolist (row (org-element-contents (org-export-get-parent row)))
+ (cond
+ ;; In a special row, try to find an alignment cookie at
+ ;; COLUMN.
+ ((org-export-table-row-is-special-p row info)
+ (let ((value (org-element-contents
+ (elt (org-element-contents row) column))))
+ ;; Since VALUE is a secondary string, the following
+ ;; checks avoid useless expansion through
+ ;; `org-export-data'.
+ (when (and value
+ (not (cdr value))
+ (stringp (car value))
+ (string-match "\\`<\\([lrc]\\)?\\([0-9]+\\)?>\\'"
+ (car value))
+ (match-string 1 (car value)))
+ (setq cookie-align (match-string 1 (car value))))))
+ ;; Ignore table rules.
+ ((eq (org-element-property :type row) 'rule))
+ ;; In a standard row, check if cell's contents are
+ ;; expressing some kind of number. Increase NUMBER-CELLS
+ ;; accordingly. Though, don't bother if an alignment
+ ;; cookie has already defined cell's alignment.
+ ((not cookie-align)
+ (let ((value (org-export-data
+ (org-element-contents
+ (elt (org-element-contents row) column))
+ info)))
+ (cl-incf total-cells)
+ ;; Treat an empty cell as a number if it follows
+ ;; a number.
+ (if (not (or (string-match org-table-number-regexp value)
+ (and (string= value "") previous-cell-number-p)))
+ (setq previous-cell-number-p nil)
+ (setq previous-cell-number-p t)
+ (cl-incf number-cells))))))
+ ;; Return value. Alignment specified by cookies has
+ ;; precedence over alignment deduced from cell's contents.
+ (aset align-vector
+ column
+ (cond ((equal cookie-align "l") 'left)
+ ((equal cookie-align "r") 'right)
+ ((equal cookie-align "c") 'center)
+ ((>= (/ (float number-cells) total-cells)
+ org-table-number-fraction)
+ 'right)
+ (t 'left)))))))
+
+(defun org-export-table-cell-borders (table-cell info)
+ "Return TABLE-CELL borders.
+
+INFO is a plist used as a communication channel.
+
+Return value is a list of symbols, or nil. Possible values are:
+`top', `bottom', `above', `below', `left' and `right'. Note:
+`top' (resp. `bottom') only happen for a cell in the first
+row (resp. last row) of the table, ignoring table rules, if any.
+
+Returned borders ignore special rows."
+ (let* ((row (org-export-get-parent table-cell))
+ (table (org-export-get-parent-table table-cell))
+ borders)
+ ;; Top/above border? TABLE-CELL has a border above when a rule
+ ;; used to demarcate row groups can be found above. Hence,
+ ;; finding a rule isn't sufficient to push `above' in BORDERS:
+ ;; another regular row has to be found above that rule.
+ (let (rule-flag)
+ (catch 'exit
+ ;; Look at every row before the current one.
+ (dolist (row (cdr (memq row (reverse (org-element-contents table)))))
+ (cond ((eq (org-element-property :type row) 'rule)
+ (setq rule-flag t))
+ ((not (org-export-table-row-is-special-p row info))
+ (if rule-flag (throw 'exit (push 'above borders))
+ (throw 'exit nil)))))
+ ;; No rule above, or rule found starts the table (ignoring any
+ ;; special row): TABLE-CELL is at the top of the table.
+ (when rule-flag (push 'above borders))
+ (push 'top borders)))
+ ;; Bottom/below border? TABLE-CELL has a border below when next
+ ;; non-regular row below is a rule.
+ (let (rule-flag)
+ (catch 'exit
+ ;; Look at every row after the current one.
+ (dolist (row (cdr (memq row (org-element-contents table))))
+ (cond ((eq (org-element-property :type row) 'rule)
+ (setq rule-flag t))
+ ((not (org-export-table-row-is-special-p row info))
+ (if rule-flag (throw 'exit (push 'below borders))
+ (throw 'exit nil)))))
+ ;; No rule below, or rule found ends the table (modulo some
+ ;; special row): TABLE-CELL is at the bottom of the table.
+ (when rule-flag (push 'below borders))
+ (push 'bottom borders)))
+ ;; Right/left borders? They can only be specified by column
+ ;; groups. Column groups are defined in a row starting with "/".
+ ;; Also a column groups row only contains "<", "<>", ">" or blank
+ ;; cells.
+ (catch 'exit
+ (let ((column (let ((cells (org-element-contents row)))
+ (- (length cells) (length (memq table-cell cells))))))
+ ;; Table rows are read in reverse order so last column groups
+ ;; row has precedence over any previous one.
+ (dolist (row (reverse (org-element-contents table)))
+ (unless (eq (org-element-property :type row) 'rule)
+ (when (equal (org-element-contents
+ (car (org-element-contents row)))
+ '("/"))
+ (let ((column-groups
+ (mapcar
+ (lambda (cell)
+ (let ((value (org-element-contents cell)))
+ (when (member value '(("<") ("<>") (">") nil))
+ (car value))))
+ (org-element-contents row))))
+ ;; There's a left border when previous cell, if
+ ;; any, ends a group, or current one starts one.
+ (when (or (and (not (zerop column))
+ (member (elt column-groups (1- column))
+ '(">" "<>")))
+ (member (elt column-groups column) '("<" "<>")))
+ (push 'left borders))
+ ;; There's a right border when next cell, if any,
+ ;; starts a group, or current one ends one.
+ (when (or (and (/= (1+ column) (length column-groups))
+ (member (elt column-groups (1+ column))
+ '("<" "<>")))
+ (member (elt column-groups column) '(">" "<>")))
+ (push 'right borders))
+ (throw 'exit nil)))))))
+ ;; Return value.
+ borders))
+
+(defun org-export-table-cell-starts-colgroup-p (table-cell info)
+ "Non-nil when TABLE-CELL is at the beginning of a column group.
+INFO is a plist used as a communication channel."
+ ;; A cell starts a column group either when it is at the beginning
+ ;; of a row (or after the special column, if any) or when it has
+ ;; a left border.
+ (or (eq (org-element-map (org-export-get-parent table-cell) 'table-cell
+ 'identity info 'first-match)
+ table-cell)
+ (memq 'left (org-export-table-cell-borders table-cell info))))
+
+(defun org-export-table-cell-ends-colgroup-p (table-cell info)
+ "Non-nil when TABLE-CELL is at the end of a column group.
+INFO is a plist used as a communication channel."
+ ;; A cell ends a column group either when it is at the end of a row
+ ;; or when it has a right border.
+ (or (eq (car (last (org-element-contents
+ (org-export-get-parent table-cell))))
+ table-cell)
+ (memq 'right (org-export-table-cell-borders table-cell info))))
+
+(defun org-export-table-row-starts-rowgroup-p (table-row info)
+ "Non-nil when TABLE-ROW is at the beginning of a row group.
+INFO is a plist used as a communication channel."
+ (unless (or (eq (org-element-property :type table-row) 'rule)
+ (org-export-table-row-is-special-p table-row info))
+ (let ((borders (org-export-table-cell-borders
+ (car (org-element-contents table-row)) info)))
+ (or (memq 'top borders) (memq 'above borders)))))
+
+(defun org-export-table-row-ends-rowgroup-p (table-row info)
+ "Non-nil when TABLE-ROW is at the end of a row group.
+INFO is a plist used as a communication channel."
+ (unless (or (eq (org-element-property :type table-row) 'rule)
+ (org-export-table-row-is-special-p table-row info))
+ (let ((borders (org-export-table-cell-borders
+ (car (org-element-contents table-row)) info)))
+ (or (memq 'bottom borders) (memq 'below borders)))))
+
+(defun org-export-table-row-in-header-p (table-row info)
+ "Non-nil when TABLE-ROW is located within table's header.
+INFO is a plist used as a communication channel. Always return
+nil for special rows and rows separators."
+ (and (org-export-table-has-header-p
+ (org-export-get-parent-table table-row) info)
+ (eql (org-export-table-row-group table-row info) 1)))
+
+(defun org-export-table-row-starts-header-p (table-row info)
+ "Non-nil when TABLE-ROW is the first table header's row.
+INFO is a plist used as a communication channel."
+ (and (org-export-table-row-in-header-p table-row info)
+ (org-export-table-row-starts-rowgroup-p table-row info)))
+
+(defun org-export-table-row-ends-header-p (table-row info)
+ "Non-nil when TABLE-ROW is the last table header's row.
+INFO is a plist used as a communication channel."
+ (and (org-export-table-row-in-header-p table-row info)
+ (org-export-table-row-ends-rowgroup-p table-row info)))
+
+(defun org-export-table-row-number (table-row info)
+ "Return TABLE-ROW number.
+INFO is a plist used as a communication channel. Return value is
+zero-indexed and ignores separators. The function returns nil
+for special rows and separators."
+ (when (eq (org-element-property :type table-row) 'standard)
+ (let* ((cache (or (plist-get info :table-row-number-cache)
+ (let ((table (make-hash-table :test #'eq)))
+ (plist-put info :table-row-number-cache table)
+ table)))
+ (cached (gethash table-row cache 'no-cache)))
+ (if (not (eq cached 'no-cache)) cached
+ ;; First time a row is queried, populate cache with all the
+ ;; rows from the table.
+ (let ((number -1))
+ (org-element-map (org-export-get-parent-table table-row) 'table-row
+ (lambda (row)
+ (when (eq (org-element-property :type row) 'standard)
+ (puthash row (cl-incf number) cache)))
+ info))
+ (gethash table-row cache)))))
+
+(defun org-export-table-dimensions (table info)
+ "Return TABLE dimensions.
+
+INFO is a plist used as a communication channel.
+
+Return value is a CONS like (ROWS . COLUMNS) where
+ROWS (resp. COLUMNS) is the number of exportable
+rows (resp. columns)."
+ (let (first-row (columns 0) (rows 0))
+ ;; Set number of rows, and extract first one.
+ (org-element-map table 'table-row
+ (lambda (row)
+ (when (eq (org-element-property :type row) 'standard)
+ (cl-incf rows)
+ (unless first-row (setq first-row row))))
+ info)
+ ;; Set number of columns.
+ (org-element-map first-row 'table-cell (lambda (_) (cl-incf columns)) info)
+ ;; Return value.
+ (cons rows columns)))
+
+(defun org-export-table-cell-address (table-cell info)
+ "Return address of a regular TABLE-CELL object.
+
+TABLE-CELL is the cell considered. INFO is a plist used as
+a communication channel.
+
+Address is a CONS cell (ROW . COLUMN), where ROW and COLUMN are
+zero-based index. Only exportable cells are considered. The
+function returns nil for other cells."
+ (let* ((table-row (org-export-get-parent table-cell))
+ (row-number (org-export-table-row-number table-row info)))
+ (when row-number
+ (cons row-number
+ (let ((col-count 0))
+ (org-element-map table-row 'table-cell
+ (lambda (cell)
+ (if (eq cell table-cell) col-count (cl-incf col-count) nil))
+ info 'first-match))))))
+
+(defun org-export-get-table-cell-at (address table info)
+ "Return regular table-cell object at ADDRESS in TABLE.
+
+Address is a CONS cell (ROW . COLUMN), where ROW and COLUMN are
+zero-based index. TABLE is a table type element. INFO is
+a plist used as a communication channel.
+
+If no table-cell, among exportable cells, is found at ADDRESS,
+return nil."
+ (let ((column-pos (cdr address)) (column-count 0))
+ (org-element-map
+ ;; Row at (car address) or nil.
+ (let ((row-pos (car address)) (row-count 0))
+ (org-element-map table 'table-row
+ (lambda (row)
+ (cond ((eq (org-element-property :type row) 'rule) nil)
+ ((= row-count row-pos) row)
+ (t (cl-incf row-count) nil)))
+ info 'first-match))
+ 'table-cell
+ (lambda (cell)
+ (if (= column-count column-pos) cell
+ (cl-incf column-count) nil))
+ info 'first-match)))
+
+
+;;;; For Tables of Contents
+;;
+;; `org-export-collect-headlines' builds a list of all exportable
+;; headline elements, maybe limited to a certain depth. One can then
+;; easily parse it and transcode it.
+;;
+;; Building lists of tables, figures or listings is quite similar.
+;; Once the generic function `org-export-collect-elements' is defined,
+;; `org-export-collect-tables', `org-export-collect-figures' and
+;; `org-export-collect-listings' can be derived from it.
+;;
+;; `org-export-toc-entry-backend' builds a special anonymous back-end
+;; useful to export table of contents' entries.
+
+(defun org-export-collect-headlines (info &optional n scope)
+ "Collect headlines in order to build a table of contents.
+
+INFO is a plist used as a communication channel.
+
+When optional argument N is an integer, it specifies the depth of
+the table of contents. Otherwise, it is set to the value of the
+last headline level. See `org-export-headline-levels' for more
+information.
+
+Optional argument SCOPE, when non-nil, is an element. If it is
+a headline, only children of SCOPE are collected. Otherwise,
+collect children of the headline containing provided element. If
+there is no such headline, collect all headlines. In any case,
+argument N becomes relative to the level of that headline.
+
+Return a list of all exportable headlines as parsed elements.
+Footnote sections are ignored."
+ (let* ((scope (cond ((not scope) (plist-get info :parse-tree))
+ ((eq (org-element-type scope) 'headline) scope)
+ ((org-export-get-parent-headline scope))
+ (t (plist-get info :parse-tree))))
+ (limit (plist-get info :headline-levels))
+ (n (if (not (wholenump n)) limit
+ (min (if (eq (org-element-type scope) 'org-data) n
+ (+ (org-export-get-relative-level scope info) n))
+ limit))))
+ (org-element-map (org-element-contents scope) 'headline
+ (lambda (h)
+ (and (not (org-element-property :footnote-section-p h))
+ (not (equal "notoc"
+ (org-export-get-node-property :UNNUMBERED h t)))
+ (>= n (org-export-get-relative-level h info))
+ h))
+ info)))
+
+(defun org-export-collect-elements (type info &optional predicate)
+ "Collect referenceable elements of a determined type.
+
+TYPE can be a symbol or a list of symbols specifying element
+types to search. Only elements with a caption are collected.
+
+INFO is a plist used as a communication channel.
+
+When non-nil, optional argument PREDICATE is a function accepting
+one argument, an element of type TYPE. It returns a non-nil
+value when that element should be collected.
+
+Return a list of all elements found, in order of appearance."
+ (org-element-map (plist-get info :parse-tree) type
+ (lambda (element)
+ (and (org-element-property :caption element)
+ (or (not predicate) (funcall predicate element))
+ element))
+ info))
+
+(defun org-export-collect-tables (info)
+ "Build a list of tables.
+INFO is a plist used as a communication channel.
+
+Return a list of table elements with a caption."
+ (org-export-collect-elements 'table info))
+
+(defun org-export-collect-figures (info predicate)
+ "Build a list of figures.
+
+INFO is a plist used as a communication channel. PREDICATE is
+a function which accepts one argument: a paragraph element and
+whose return value is non-nil when that element should be
+collected.
+
+A figure is a paragraph type element, with a caption, verifying
+PREDICATE. The latter has to be provided since a \"figure\" is
+a vague concept that may depend on back-end.
+
+Return a list of elements recognized as figures."
+ (org-export-collect-elements 'paragraph info predicate))
+
+(defun org-export-collect-listings (info)
+ "Build a list of source blocks.
+
+INFO is a plist used as a communication channel.
+
+Return a list of `src-block' elements with a caption."
+ (org-export-collect-elements 'src-block info))
+
+(defun org-export-excluded-from-toc-p (headline info)
+ "Non-nil if HEADLINE should be excluded from tables of contents.
+
+INFO is a plist used as a communication channel.
+
+Note that such headlines are already excluded from
+`org-export-collect-headlines'. Therefore, this function is not
+necessary if you only need to list headlines in the table of
+contents. However, it is useful if some additional processing is
+required on headlines excluded from table of contents."
+ (or (org-element-property :footnote-section-p headline)
+ (org-export-low-level-p headline info)
+ (equal "notoc" (org-export-get-node-property :UNNUMBERED headline t))))
+
+(defun org-export-toc-entry-backend (parent &rest transcoders)
+ "Return an export back-end appropriate for table of contents entries.
+
+PARENT is an export back-end the returned back-end should inherit
+from.
+
+By default, the back-end removes footnote references and targets.
+It also changes links and radio targets into regular text.
+TRANSCODERS optional argument, when non-nil, specifies additional
+transcoders. A transcoder follows the pattern (TYPE . FUNCTION)
+where type is an element or object type and FUNCTION the function
+transcoding it."
+ (declare (indent 1))
+ (org-export-create-backend
+ :parent parent
+ :transcoders
+ (append transcoders
+ `((footnote-reference . ,#'ignore)
+ (link . ,(lambda (l c i)
+ (or c
+ (org-export-data
+ (org-element-property :raw-link l)
+ i))))
+ (radio-target . ,(lambda (_r c _) c))
+ (target . ,#'ignore)))))
+
+
+;;;; Smart Quotes
+;;
+;; The main function for the smart quotes sub-system is
+;; `org-export-activate-smart-quotes', which replaces every quote in
+;; a given string from the parse tree with its "smart" counterpart.
+;;
+;; Dictionary for smart quotes is stored in
+;; `org-export-smart-quotes-alist'.
+
+(defconst org-export-smart-quotes-alist
+ '(("ar"
+ (primary-opening
+ :utf-8 "«" :html "&laquo;" :latex "\\guillemotleft{}"
+ :texinfo "@guillemetleft{}")
+ (primary-closing
+ :utf-8 "»" :html "&raquo;" :latex "\\guillemotright{}"
+ :texinfo "@guillemetright{}")
+ (secondary-opening :utf-8 "‹" :html "&lsaquo;" :latex "\\guilsinglleft{}"
+ :texinfo "@guilsinglleft{}")
+ (secondary-closing :utf-8 "›" :html "&rsaquo;" :latex "\\guilsinglright{}"
+ :texinfo "@guilsinglright{}")
+ (apostrophe :utf-8 "’" :html "&rsquo;"))
+ ("da"
+ ;; one may use: »...«, "...", ›...‹, or '...'.
+ ;; https://sproget.dk/raad-og-regler/retskrivningsregler/retskrivningsregler/a7-40-60/a7-58-anforselstegn/
+ ;; LaTeX quotes require Babel!
+ (primary-opening
+ :utf-8 "»" :html "&raquo;" :latex ">>" :texinfo "@guillemetright{}")
+ (primary-closing
+ :utf-8 "«" :html "&laquo;" :latex "<<" :texinfo "@guillemetleft{}")
+ (secondary-opening
+ :utf-8 "›" :html "&rsaquo;" :latex "\\frq{}" :texinfo "@guilsinglright{}")
+ (secondary-closing
+ :utf-8 "‹" :html "&lsaquo;" :latex "\\flq{}" :texinfo "@guilsingleft{}")
+ (apostrophe :utf-8 "’" :html "&rsquo;"))
+ ("de"
+ (primary-opening
+ :utf-8 "„" :html "&bdquo;" :latex "\"`" :texinfo "@quotedblbase{}")
+ (primary-closing
+ :utf-8 "“" :html "&ldquo;" :latex "\"'" :texinfo "@quotedblleft{}")
+ (secondary-opening
+ :utf-8 "‚" :html "&sbquo;" :latex "\\glq{}" :texinfo "@quotesinglbase{}")
+ (secondary-closing
+ :utf-8 "‘" :html "&lsquo;" :latex "\\grq{}" :texinfo "@quoteleft{}")
+ (apostrophe :utf-8 "’" :html "&rsquo;"))
+ ("el"
+ (primary-opening
+ :utf-8 "«" :html "&laquo;" :latex "\\guillemotleft{}"
+ :texinfo "@guillemetleft{}")
+ (primary-closing
+ :utf-8 "»" :html "&raquo;" :latex "\\guillemotright{}"
+ :texinfo "@guillemetright{}")
+ (secondary-opening :utf-8 "“" :html "&ldquo;" :latex "``" :texinfo "``")
+ (secondary-closing :utf-8 "”" :html "&rdquo;" :latex "''" :texinfo "''")
+ (apostrophe :utf-8 "’" :html "&rsquo;"))
+ ("en"
+ (primary-opening :utf-8 "“" :html "&ldquo;" :latex "``" :texinfo "``")
+ (primary-closing :utf-8 "”" :html "&rdquo;" :latex "''" :texinfo "''")
+ (secondary-opening :utf-8 "‘" :html "&lsquo;" :latex "`" :texinfo "`")
+ (secondary-closing :utf-8 "’" :html "&rsquo;" :latex "'" :texinfo "'")
+ (apostrophe :utf-8 "’" :html "&rsquo;"))
+ ("es"
+ (primary-opening
+ :utf-8 "«" :html "&laquo;" :latex "\\guillemotleft{}"
+ :texinfo "@guillemetleft{}")
+ (primary-closing
+ :utf-8 "»" :html "&raquo;" :latex "\\guillemotright{}"
+ :texinfo "@guillemetright{}")
+ (secondary-opening :utf-8 "“" :html "&ldquo;" :latex "``" :texinfo "``")
+ (secondary-closing :utf-8 "”" :html "&rdquo;" :latex "''" :texinfo "''")
+ (apostrophe :utf-8 "’" :html "&rsquo;"))
+ ("fr"
+ (primary-opening
+ :utf-8 "« " :html "&laquo;&nbsp;" :latex "\\og "
+ :texinfo "@guillemetleft{}@tie{}")
+ (primary-closing
+ :utf-8 " »" :html "&nbsp;&raquo;" :latex "\\fg{}"
+ :texinfo "@tie{}@guillemetright{}")
+ (secondary-opening
+ :utf-8 "« " :html "&laquo;&nbsp;" :latex "\\og "
+ :texinfo "@guillemetleft{}@tie{}")
+ (secondary-closing :utf-8 " »" :html "&nbsp;&raquo;" :latex "\\fg{}"
+ :texinfo "@tie{}@guillemetright{}")
+ (apostrophe :utf-8 "’" :html "&rsquo;"))
+ ("is"
+ (primary-opening
+ :utf-8 "„" :html "&bdquo;" :latex "\"`" :texinfo "@quotedblbase{}")
+ (primary-closing
+ :utf-8 "“" :html "&ldquo;" :latex "\"'" :texinfo "@quotedblleft{}")
+ (secondary-opening
+ :utf-8 "‚" :html "&sbquo;" :latex "\\glq{}" :texinfo "@quotesinglbase{}")
+ (secondary-closing
+ :utf-8 "‘" :html "&lsquo;" :latex "\\grq{}" :texinfo "@quoteleft{}")
+ (apostrophe :utf-8 "’" :html "&rsquo;"))
+ ("it"
+ (primary-opening :utf-8 "“" :html "&ldquo;" :latex "``" :texinfo "``")
+ (primary-closing :utf-8 "”" :html "&rdquo;" :latex "''" :texinfo "''")
+ (secondary-opening :utf-8 "‘" :html "&lsquo;" :latex "`" :texinfo "`")
+ (secondary-closing :utf-8 "’" :html "&rsquo;" :latex "'" :texinfo "'")
+ (apostrophe :utf-8 "’" :html "&rsquo;"))
+ ("no"
+ ;; https://nn.wikipedia.org/wiki/Sitatteikn
+ (primary-opening
+ :utf-8 "«" :html "&laquo;" :latex "\\guillemotleft{}"
+ :texinfo "@guillemetleft{}")
+ (primary-closing
+ :utf-8 "»" :html "&raquo;" :latex "\\guillemotright{}"
+ :texinfo "@guillemetright{}")
+ (secondary-opening :utf-8 "‘" :html "&lsquo;" :latex "`" :texinfo "`")
+ (secondary-closing :utf-8 "’" :html "&rsquo;" :latex "'" :texinfo "'")
+ (apostrophe :utf-8 "’" :html "&rsquo;"))
+ ("nb"
+ ;; https://nn.wikipedia.org/wiki/Sitatteikn
+ (primary-opening
+ :utf-8 "«" :html "&laquo;" :latex "\\guillemotleft{}"
+ :texinfo "@guillemetleft{}")
+ (primary-closing
+ :utf-8 "»" :html "&raquo;" :latex "\\guillemotright{}"
+ :texinfo "@guillemetright{}")
+ (secondary-opening :utf-8 "‘" :html "&lsquo;" :latex "`" :texinfo "`")
+ (secondary-closing :utf-8 "’" :html "&rsquo;" :latex "'" :texinfo "'")
+ (apostrophe :utf-8 "’" :html "&rsquo;"))
+ ("nn"
+ ;; https://nn.wikipedia.org/wiki/Sitatteikn
+ (primary-opening
+ :utf-8 "«" :html "&laquo;" :latex "\\guillemotleft{}"
+ :texinfo "@guillemetleft{}")
+ (primary-closing
+ :utf-8 "»" :html "&raquo;" :latex "\\guillemotright{}"
+ :texinfo "@guillemetright{}")
+ (secondary-opening :utf-8 "‘" :html "&lsquo;" :latex "`" :texinfo "`")
+ (secondary-closing :utf-8 "’" :html "&rsquo;" :latex "'" :texinfo "'")
+ (apostrophe :utf-8 "’" :html "&rsquo;"))
+ ("ro"
+ (primary-opening
+ :utf-8 "„" :html "&bdquo;" :latex "\"`" :texinfo "@quotedblbase{}")
+ (primary-closing :utf-8 "”" :html "&rdquo;" :latex "''" :texinfo "''")
+ (secondary-opening
+ :utf-8 "«" :html "&laquo;" :latex "\\guillemotleft{}"
+ :texinfo "@guillemetleft{}")
+ (secondary-closing
+ :utf-8 "»" :html "&raquo;" :latex "\\guillemotright{}"
+ :texinfo "@guillemetright{}")
+ (apostrophe :utf-8 "’" :html "&rsquo;"))
+ ("ru"
+ ;; https://ru.wikipedia.org/wiki/%D0%9A%D0%B0%D0%B2%D1%8B%D1%87%D0%BA%D0%B8#.D0.9A.D0.B0.D0.B2.D1.8B.D1.87.D0.BA.D0.B8.2C_.D0.B8.D1.81.D0.BF.D0.BE.D0.BB.D1.8C.D0.B7.D1.83.D0.B5.D0.BC.D1.8B.D0.B5_.D0.B2_.D1.80.D1.83.D1.81.D1.81.D0.BA.D0.BE.D0.BC_.D1.8F.D0.B7.D1.8B.D0.BA.D0.B5
+ ;; https://www.artlebedev.ru/kovodstvo/sections/104/
+ (primary-opening :utf-8 "«" :html "&laquo;" :latex "{}<<"
+ :texinfo "@guillemetleft{}")
+ (primary-closing :utf-8 "»" :html "&raquo;" :latex ">>{}"
+ :texinfo "@guillemetright{}")
+ (secondary-opening
+ :utf-8 "„" :html "&bdquo;" :latex "\\glqq{}" :texinfo "@quotedblbase{}")
+ (secondary-closing
+ :utf-8 "“" :html "&ldquo;" :latex "\\grqq{}" :texinfo "@quotedblleft{}")
+ (apostrophe :utf-8 "’" :html: "&#39;"))
+ ("sl"
+ ;; Based on https://sl.wikipedia.org/wiki/Narekovaj
+ (primary-opening :utf-8 "«" :html "&laquo;" :latex "{}<<"
+ :texinfo "@guillemetleft{}")
+ (primary-closing :utf-8 "»" :html "&raquo;" :latex ">>{}"
+ :texinfo "@guillemetright{}")
+ (secondary-opening
+ :utf-8 "„" :html "&bdquo;" :latex "\\glqq{}" :texinfo "@quotedblbase{}")
+ (secondary-closing
+ :utf-8 "“" :html "&ldquo;" :latex "\\grqq{}" :texinfo "@quotedblleft{}")
+ (apostrophe :utf-8 "’" :html "&rsquo;"))
+ ("sv"
+ ;; Based on https://sv.wikipedia.org/wiki/Citattecken
+ (primary-opening :utf-8 "”" :html "&rdquo;" :latex "’’" :texinfo "’’")
+ (primary-closing :utf-8 "”" :html "&rdquo;" :latex "’’" :texinfo "’’")
+ (secondary-opening :utf-8 "’" :html "&rsquo;" :latex "’" :texinfo "`")
+ (secondary-closing :utf-8 "’" :html "&rsquo;" :latex "’" :texinfo "'")
+ (apostrophe :utf-8 "’" :html "&rsquo;")))
+ "Smart quotes translations.
+
+Alist whose CAR is a language string and CDR is an alist with
+quote type as key and a plist associating various encodings to
+their translation as value.
+
+A quote type can be any symbol among `primary-opening',
+`primary-closing', `secondary-opening', `secondary-closing' and
+`apostrophe'.
+
+Valid encodings include `:utf-8', `:html', `:latex' and
+`:texinfo'.
+
+If no translation is found, the quote character is left as-is.")
+
+(defun org-export--smart-quote-status (s info)
+ "Return smart quote status at the beginning of string S.
+INFO is the current export state, as a plist."
+ (let* ((parent (org-element-property :parent s))
+ (cache (or (plist-get info :smart-quote-cache)
+ (let ((table (make-hash-table :test #'eq)))
+ (plist-put info :smart-quote-cache table)
+ table)))
+ (value (gethash parent cache 'missing-data)))
+ (if (not (eq value 'missing-data)) (cdr (assq s value))
+ (let (level1-open full-status)
+ (org-element-map
+ (let ((secondary (org-element-secondary-p s)))
+ (if secondary (org-element-property secondary parent)
+ (org-element-contents parent)))
+ 'plain-text
+ (lambda (text)
+ (let ((start 0) current-status)
+ (while (setq start (string-match "['\"]" text start))
+ (push
+ (cond
+ ((equal (match-string 0 text) "\"")
+ (setf level1-open (not level1-open))
+ (if level1-open 'primary-opening 'primary-closing))
+ ;; Not already in a level 1 quote: this is an
+ ;; apostrophe.
+ ((not level1-open) 'apostrophe)
+ ;; Extract previous char and next char. As
+ ;; a special case, they can also be set to `blank',
+ ;; `no-blank' or nil. Then determine if current
+ ;; match is allowed as an opening quote or a closing
+ ;; quote.
+ (t
+ (let* ((previous
+ (if (> start 0) (substring text (1- start) start)
+ (let ((p (org-export-get-previous-element
+ text info)))
+ (cond ((not p) nil)
+ ((stringp p) (substring p -1))
+ ((memq (org-element-property :post-blank p)
+ '(0 nil))
+ 'no-blank)
+ (t 'blank)))))
+ (next
+ (if (< (1+ start) (length text))
+ (substring text (1+ start) (+ start 2))
+ (let ((n (org-export-get-next-element text info)))
+ (cond ((not n) nil)
+ ((stringp n) (substring n 0 1))
+ (t 'no-blank)))))
+ (allow-open
+ (and (if (stringp previous)
+ (string-match "\\s\"\\|\\s-\\|\\s("
+ previous)
+ (memq previous '(blank nil)))
+ (if (stringp next)
+ (string-match "\\w\\|\\s.\\|\\s_" next)
+ (eq next 'no-blank))))
+ (allow-close
+ (and (if (stringp previous)
+ (string-match "\\w\\|\\s.\\|\\s_" previous)
+ (eq previous 'no-blank))
+ (if (stringp next)
+ (string-match "\\s-\\|\\s)\\|\\s.\\|\\s\""
+ next)
+ (memq next '(blank nil))))))
+ (cond
+ ((and allow-open allow-close) (error "Should not happen"))
+ (allow-open 'secondary-opening)
+ (allow-close 'secondary-closing)
+ (t 'apostrophe)))))
+ current-status)
+ (cl-incf start))
+ (when current-status
+ (push (cons text (nreverse current-status)) full-status))))
+ info nil org-element-recursive-objects)
+ (puthash parent full-status cache)
+ (cdr (assq s full-status))))))
+
+(defun org-export-activate-smart-quotes (s encoding info &optional original)
+ "Replace regular quotes with \"smart\" quotes in string S.
+
+ENCODING is a symbol among `:html', `:latex', `:texinfo' and
+`:utf-8'. INFO is a plist used as a communication channel.
+
+The function has to retrieve information about string
+surroundings in parse tree. It can only happen with an
+unmodified string. Thus, if S has already been through another
+process, a non-nil ORIGINAL optional argument will provide that
+original string.
+
+Return the new string."
+ (let ((quote-status
+ (copy-sequence (org-export--smart-quote-status (or original s) info))))
+ (replace-regexp-in-string
+ "['\"]"
+ (lambda (match)
+ (or (plist-get
+ (cdr (assq (pop quote-status)
+ (cdr (assoc (plist-get info :language)
+ org-export-smart-quotes-alist))))
+ encoding)
+ match))
+ s nil t)))
+
+;;;; Topology
+;;
+;; Here are various functions to retrieve information about the
+;; neighborhood of a given element or object. Neighbors of interest
+;; are direct parent (`org-export-get-parent'), parent headline
+;; (`org-export-get-parent-headline'), first element containing an
+;; object, (`org-export-get-parent-element'), parent table
+;; (`org-export-get-parent-table'), previous element or object
+;; (`org-export-get-previous-element') and next element or object
+;; (`org-export-get-next-element').
+
+;; defsubst org-export-get-parent must be defined before first use
+
+(defun org-export-get-parent-headline (blob)
+ "Return BLOB parent headline or nil.
+BLOB is the element or object being considered."
+ (org-element-lineage blob '(headline)))
+
+(defun org-export-get-parent-element (object)
+ "Return first element containing OBJECT or nil.
+OBJECT is the object to consider."
+ (org-element-lineage object org-element-all-elements))
+
+(defun org-export-get-parent-table (object)
+ "Return OBJECT parent table or nil.
+OBJECT is either a `table-cell' or `table-element' type object."
+ (org-element-lineage object '(table)))
+
+(defun org-export-get-previous-element (blob info &optional n)
+ "Return previous element or object.
+
+BLOB is an element or object. INFO is a plist used as
+a communication channel. Return previous exportable element or
+object, a string, or nil.
+
+When optional argument N is a positive integer, return a list
+containing up to N siblings before BLOB, from farthest to
+closest. With any other non-nil value, return a list containing
+all of them."
+ (let* ((secondary (org-element-secondary-p blob))
+ (parent (org-export-get-parent blob))
+ (siblings
+ (if secondary (org-element-property secondary parent)
+ (org-element-contents parent)))
+ prev)
+ (catch 'exit
+ (dolist (obj (cdr (memq blob (reverse siblings))) prev)
+ (cond ((memq obj (plist-get info :ignore-list)))
+ ((null n) (throw 'exit obj))
+ ((not (wholenump n)) (push obj prev))
+ ((zerop n) (throw 'exit prev))
+ (t (cl-decf n) (push obj prev)))))))
+
+(defun org-export-get-next-element (blob info &optional n)
+ "Return next element or object.
+
+BLOB is an element or object. INFO is a plist used as
+a communication channel. Return next exportable element or
+object, a string, or nil.
+
+When optional argument N is a positive integer, return a list
+containing up to N siblings after BLOB, from closest to farthest.
+With any other non-nil value, return a list containing all of
+them."
+ (let* ((secondary (org-element-secondary-p blob))
+ (parent (org-export-get-parent blob))
+ (siblings
+ (cdr (memq blob
+ (if secondary (org-element-property secondary parent)
+ (org-element-contents parent)))))
+ next)
+ (catch 'exit
+ (dolist (obj siblings (nreverse next))
+ (cond ((memq obj (plist-get info :ignore-list)))
+ ((null n) (throw 'exit obj))
+ ((not (wholenump n)) (push obj next))
+ ((zerop n) (throw 'exit (nreverse next)))
+ (t (cl-decf n) (push obj next)))))))
+
+
+;;;; Translation
+;;
+;; `org-export-translate' translates a string according to the language
+;; specified by the LANGUAGE keyword. `org-export-dictionary' contains
+;; the dictionary used for the translation.
+
+(defconst org-export-dictionary
+ '(("%e %n: %c"
+ ("fr" :default "%e %n : %c" :html "%e&nbsp;%n&nbsp;: %c"))
+ ("Author"
+ ("ar" :default "تأليف")
+ ("ca" :default "Autor")
+ ("cs" :default "Autor")
+ ("da" :default "Forfatter")
+ ("de" :default "Autor")
+ ("eo" :html "A&#365;toro")
+ ("es" :default "Autor")
+ ("et" :default "Autor")
+ ("fi" :html "Tekij&auml;")
+ ("fr" :default "Auteur")
+ ("hu" :default "Szerz&otilde;")
+ ("is" :html "H&ouml;fundur")
+ ("it" :default "Autore")
+ ("ja" :default "著者" :html "&#33879;&#32773;")
+ ("nl" :default "Auteur")
+ ("no" :default "Forfatter")
+ ("nb" :default "Forfatter")
+ ("nn" :default "Forfattar")
+ ("pl" :default "Autor")
+ ("pt_BR" :default "Autor")
+ ("ro" :default "Autor")
+ ("ru" :html "&#1040;&#1074;&#1090;&#1086;&#1088;" :utf-8 "Автор")
+ ("sl" :default "Avtor")
+ ("sv" :html "F&ouml;rfattare")
+ ("tr" :default "Yazar")
+ ("uk" :html "&#1040;&#1074;&#1090;&#1086;&#1088;" :utf-8 "Автор")
+ ("zh-CN" :html "&#20316;&#32773;" :utf-8 "作者")
+ ("zh-TW" :html "&#20316;&#32773;" :utf-8 "作者"))
+ ("Continued from previous page"
+ ("ar" :default "تتمة الصفحة السابقة")
+ ("cs" :default "Pokračování z předchozí strany")
+ ("de" :default "Fortsetzung von vorheriger Seite")
+ ("es" :html "Contin&uacute;a de la p&aacute;gina anterior" :ascii "Continua de la pagina anterior" :default "Continúa de la página anterior")
+ ("fr" :default "Suite de la page précédente")
+ ("it" :default "Continua da pagina precedente")
+ ("ja" :default "前ページからの続き")
+ ("nl" :default "Vervolg van vorige pagina")
+ ("pl" :default "Ciąg dalszy poprzedniej strony")
+ ("pt" :default "Continuação da página anterior")
+ ("pt_BR" :html "Continua&ccedil;&atilde;o da p&aacute;gina anterior" :ascii "Continuacao da pagina anterior" :default "Continuação da página anterior")
+ ("ro" :default "Continuare de pe pagina precedentă")
+ ("ru" :html "(&#1055;&#1088;&#1086;&#1076;&#1086;&#1083;&#1078;&#1077;&#1085;&#1080;&#1077;)"
+ :utf-8 "(Продолжение)")
+ ("sl" :default "Nadaljevanje s prejšnje strani")
+ ("tr" :default "Önceki sayfadan devam ediyor"))
+ ("Continued on next page"
+ ("ar" :default "التتمة في الصفحة التالية")
+ ("cs" :default "Pokračuje na další stránce")
+ ("de" :default "Fortsetzung nächste Seite")
+ ("es" :html "Contin&uacute;a en la siguiente p&aacute;gina" :ascii "Continua en la siguiente pagina" :default "Continúa en la siguiente página")
+ ("fr" :default "Suite page suivante")
+ ("it" :default "Continua alla pagina successiva")
+ ("ja" :default "次ページに続く")
+ ("nl" :default "Vervolg op volgende pagina")
+ ("pl" :default "Kontynuacja na następnej stronie")
+ ("pt" :default "Continua na página seguinte")
+ ("pt_BR" :html "Continua na pr&oacute;xima p&aacute;gina" :ascii "Continua na proxima pagina" :default "Continua na próxima página")
+ ("ro" :default "Continuare pe pagina următoare")
+ ("ru" :html "(&#1055;&#1088;&#1086;&#1076;&#1086;&#1083;&#1078;&#1077;&#1085;&#1080;&#1077; &#1089;&#1083;&#1077;&#1076;&#1091;&#1077;&#1090;)"
+ :utf-8 "(Продолжение следует)")
+ ("sl" :default "Nadaljevanje na naslednji strani")
+ ("tr" :default "Devamı sonraki sayfada"))
+ ("Created"
+ ("cs" :default "Vytvořeno")
+ ("nl" :default "Gemaakt op") ;; must be followed by a date or date+time
+ ("pt_BR" :default "Criado em")
+ ("ro" :default "Creat")
+ ("sl" :default "Ustvarjeno")
+ ("tr" :default "Oluşturuldu"))
+ ("Date"
+ ("ar" :default "بتاريخ")
+ ("ca" :default "Data")
+ ("cs" :default "Datum")
+ ("da" :default "Dato")
+ ("de" :default "Datum")
+ ("eo" :default "Dato")
+ ("es" :default "Fecha")
+ ("et" :html "Kuup&#228;ev" :utf-8 "Kuupäev")
+ ("fi" :html "P&auml;iv&auml;m&auml;&auml;r&auml;")
+ ("hu" :html "D&aacute;tum")
+ ("is" :default "Dagsetning")
+ ("it" :default "Data")
+ ("ja" :default "日付" :html "&#26085;&#20184;")
+ ("nl" :default "Datum")
+ ("no" :default "Dato")
+ ("nb" :default "Dato")
+ ("nn" :default "Dato")
+ ("pl" :default "Data")
+ ("ro" :default "Data")
+ ("pt_BR" :default "Data")
+ ("ru" :html "&#1044;&#1072;&#1090;&#1072;" :utf-8 "Дата")
+ ("sl" :default "Datum")
+ ("sv" :default "Datum")
+ ("tr" :default "Tarih")
+ ("uk" :html "&#1044;&#1072;&#1090;&#1072;" :utf-8 "Дата")
+ ("zh-CN" :html "&#26085;&#26399;" :utf-8 "日期")
+ ("zh-TW" :html "&#26085;&#26399;" :utf-8 "日期"))
+ ("Equation"
+ ("ar" :default "معادلة")
+ ("cs" :default "Rovnice")
+ ("da" :default "Ligning")
+ ("de" :default "Gleichung")
+ ("es" :ascii "Ecuacion" :html "Ecuaci&oacute;n" :default "Ecuación")
+ ("et" :html "V&#245;rrand" :utf-8 "Võrrand")
+ ("fr" :ascii "Equation" :default "Équation")
+ ("is" :default "Jafna")
+ ("ja" :default "方程式")
+ ("nl" :default "Vergelijking")
+ ("no" :default "Ligning")
+ ("nb" :default "Ligning")
+ ("nn" :default "Likning")
+ ("pt_BR" :html "Equa&ccedil;&atilde;o" :default "Equação" :ascii "Equacao")
+ ("ro" :default "Ecuația")
+ ("ru" :html "&#1059;&#1088;&#1072;&#1074;&#1085;&#1077;&#1085;&#1080;&#1077;"
+ :utf-8 "Уравнение")
+ ("sl" :default "Enačba")
+ ("sv" :default "Ekvation")
+ ("tr" :default "Eşitlik")
+ ("zh-CN" :html "&#26041;&#31243;" :utf-8 "方程"))
+ ("Figure"
+ ("ar" :default "شكل")
+ ("cs" :default "Obrázek")
+ ("da" :default "Figur")
+ ("de" :default "Abbildung")
+ ("es" :default "Figura")
+ ("et" :default "Joonis")
+ ("is" :default "Mynd")
+ ("it" :default "Figura")
+ ("ja" :default "図" :html "&#22259;")
+ ("nl" :default "Figuur")
+ ("no" :default "Illustrasjon")
+ ("nb" :default "Illustrasjon")
+ ("nn" :default "Illustrasjon")
+ ("pt_BR" :default "Figura")
+ ("ro" :default "Imaginea")
+ ("ru" :html "&#1056;&#1080;&#1089;&#1091;&#1085;&#1086;&#1082;" :utf-8 "Рисунок")
+ ("sv" :default "Illustration")
+ ("tr" :default "Şekil")
+ ("zh-CN" :html "&#22270;" :utf-8 "图"))
+ ("Figure %d:"
+ ("ar" :default "شكل %d:")
+ ("cs" :default "Obrázek %d:")
+ ("da" :default "Figur %d")
+ ("de" :default "Abbildung %d:")
+ ("es" :default "Figura %d:")
+ ("et" :default "Joonis %d:")
+ ("fr" :default "Figure %d :" :html "Figure&nbsp;%d&nbsp;:")
+ ("is" :default "Mynd %d")
+ ("it" :default "Figura %d:")
+ ("ja" :default "図%d: " :html "&#22259;%d: ")
+ ("nl" :default "Figuur %d:" :html "Figuur&nbsp;%d:")
+ ("no" :default "Illustrasjon %d")
+ ("nb" :default "Illustrasjon %d")
+ ("nn" :default "Illustrasjon %d")
+ ("pt_BR" :default "Figura %d:")
+ ("ro" :default "Imaginea %d:")
+ ("ru" :html "&#1056;&#1080;&#1089;. %d.:" :utf-8 "Рис. %d.:")
+ ("sl" :default "Slika %d")
+ ("sv" :default "Illustration %d")
+ ("tr" :default "Şekil %d:")
+ ("zh-CN" :html "&#22270;%d&nbsp;" :utf-8 "图%d "))
+ ("Footnotes"
+ ("ar" :default "الهوامش")
+ ("ca" :html "Peus de p&agrave;gina")
+ ("cs" :default "Poznámky pod čarou")
+ ("da" :default "Fodnoter")
+ ("de" :html "Fu&szlig;noten" :default "Fußnoten")
+ ("eo" :default "Piednotoj")
+ ("es" :ascii "Notas al pie de pagina" :html "Notas al pie de p&aacute;gina" :default "Notas al pie de página")
+ ("et" :html "Allm&#228;rkused" :utf-8 "Allmärkused")
+ ("fi" :default "Alaviitteet")
+ ("fr" :default "Notes de bas de page")
+ ("hu" :html "L&aacute;bjegyzet")
+ ("is" :html "Aftanm&aacute;lsgreinar")
+ ("it" :html "Note a pi&egrave; di pagina")
+ ("ja" :default "脚注" :html "&#33050;&#27880;")
+ ("nl" :default "Voetnoten")
+ ("no" :default "Fotnoter")
+ ("nb" :default "Fotnoter")
+ ("nn" :default "Fotnotar")
+ ("pl" :default "Przypis")
+ ("pt_BR" :html "Notas de Rodap&eacute;" :default "Notas de Rodapé" :ascii "Notas de Rodape")
+ ("ro" :default "Note de subsol")
+ ("ru" :html "&#1057;&#1085;&#1086;&#1089;&#1082;&#1080;" :utf-8 "Сноски")
+ ("sl" :default "Opombe")
+ ("sv" :default "Fotnoter")
+ ("tr" :default "Dipnotlar")
+ ("uk" :html "&#1055;&#1088;&#1080;&#1084;&#1110;&#1090;&#1082;&#1080;"
+ :utf-8 "Примітки")
+ ("zh-CN" :html "&#33050;&#27880;" :utf-8 "脚注")
+ ("zh-TW" :html "&#33139;&#35387;" :utf-8 "腳註"))
+ ("List of Listings"
+ ("ar" :default "قائمة بالبرامج")
+ ("cs" :default "Seznam programů")
+ ("da" :default "Programmer")
+ ("de" :default "Programmauflistungsverzeichnis")
+ ("es" :ascii "Indice de Listados de programas" :html "&Iacute;ndice de Listados de programas" :default "Índice de Listados de programas")
+ ("et" :default "Loendite nimekiri")
+ ("fr" :default "Liste des programmes")
+ ("ja" :default "ソースコード目次")
+ ("nl" :default "Lijst van programma's")
+ ("no" :default "Dataprogrammer")
+ ("nb" :default "Dataprogrammer")
+ ("pt_BR" :html "&Iacute;ndice de Listagens" :default "Índice de Listagens" :ascii "Indice de Listagens")
+ ("ru" :html "&#1057;&#1087;&#1080;&#1089;&#1086;&#1082; &#1088;&#1072;&#1089;&#1087;&#1077;&#1095;&#1072;&#1090;&#1086;&#1082;"
+ :utf-8 "Список распечаток")
+ ("sl" :default "Seznam programskih izpisov")
+ ("tr" :default "Program Listesi")
+ ("zh-CN" :html "&#20195;&#30721;&#30446;&#24405;" :utf-8 "代码目录"))
+ ("List of Tables"
+ ("ar" :default "قائمة بالجداول")
+ ("cs" :default "Seznam tabulek")
+ ("da" :default "Tabeller")
+ ("de" :default "Tabellenverzeichnis")
+ ("es" :ascii "Indice de tablas" :html "&Iacute;ndice de tablas" :default "Índice de tablas")
+ ("et" :default "Tabelite nimekiri")
+ ("fr" :default "Liste des tableaux")
+ ("is" :default "Töfluskrá" :html "T&ouml;fluskr&aacute;")
+ ("it" :default "Indice delle tabelle")
+ ("ja" :default "表目次")
+ ("nl" :default "Lijst van tabellen")
+ ("no" :default "Tabeller")
+ ("nb" :default "Tabeller")
+ ("nn" :default "Tabeller")
+ ("pt_BR" :html "&Iacute;ndice de Tabelas" :default "Índice de Tabelas" :ascii "Indice de Tabelas")
+ ("ro" :default "Tabele")
+ ("ru" :html "&#1057;&#1087;&#1080;&#1089;&#1086;&#1082; &#1090;&#1072;&#1073;&#1083;&#1080;&#1094;"
+ :utf-8 "Список таблиц")
+ ("sl" :default "Seznam tabel")
+ ("sv" :default "Tabeller")
+ ("tr" :default "Tablo Listesi")
+ ("zh-CN" :html "&#34920;&#26684;&#30446;&#24405;" :utf-8 "表格目录"))
+ ("Listing"
+ ("ar" :default "برنامج")
+ ("cs" :default "Program")
+ ("da" :default "Program")
+ ("de" :default "Programmlisting")
+ ("es" :default "Listado de programa")
+ ("et" :default "Loend")
+ ("fr" :default "Programme" :html "Programme")
+ ("it" :default "Listato")
+ ("ja" :default "ソースコード")
+ ("nl" :default "Programma")
+ ("no" :default "Dataprogram")
+ ("nb" :default "Dataprogram")
+ ("pt_BR" :default "Listagem")
+ ("ro" :default "Lista")
+ ("ru" :html "&#1056;&#1072;&#1089;&#1087;&#1077;&#1095;&#1072;&#1090;&#1082;&#1072;"
+ :utf-8 "Распечатка")
+ ("sl" :default "Izpis programa")
+ ("tr" :default "Program")
+ ("zh-CN" :html "&#20195;&#30721;" :utf-8 "代码"))
+ ("Listing %d:"
+ ("ar" :default "برنامج %d:")
+ ("cs" :default "Program %d:")
+ ("da" :default "Program %d")
+ ("de" :default "Programmlisting %d")
+ ("es" :default "Listado de programa %d")
+ ("et" :default "Loend %d")
+ ("fr" :default "Programme %d :" :html "Programme&nbsp;%d&nbsp;:")
+ ("it" :default "Listato %d :")
+ ("ja" :default "ソースコード%d:")
+ ("nl" :default "Programma %d:" :html "Programma&nbsp;%d:")
+ ("no" :default "Dataprogram %d")
+ ("nb" :default "Dataprogram %d")
+ ("ro" :default "Lista %d")
+ ("pt_BR" :default "Listagem %d:")
+ ("ru" :html "&#1056;&#1072;&#1089;&#1087;&#1077;&#1095;&#1072;&#1090;&#1082;&#1072; %d.:"
+ :utf-8 "Распечатка %d.:")
+ ("sl" :default "Izpis programa %d")
+ ("tr" :default "Program %d:")
+ ("zh-CN" :html "&#20195;&#30721;%d&nbsp;" :utf-8 "代码%d "))
+ ("References"
+ ("ar" :default "المراجع")
+ ("cs" :default "Reference")
+ ("de" :default "Quellen")
+ ("es" :default "Referencias")
+ ("fr" :ascii "References" :default "Références")
+ ("it" :default "Riferimenti")
+ ("nl" :default "Bronverwijzingen")
+ ("pt_BR" :html "Refer&ecirc;ncias" :default "Referências" :ascii "Referencias")
+ ("ro" :default "Bibliografie")
+ ("sl" :default "Reference")
+ ("tr" :default "Referanslar"))
+ ("See figure %s"
+ ("cs" :default "Viz obrázek %s")
+ ("fr" :default "cf. figure %s"
+ :html "cf.&nbsp;figure&nbsp;%s" :latex "cf.~figure~%s")
+ ("it" :default "Vedi figura %s")
+ ("nl" :default "Zie figuur %s"
+ :html "Zie figuur&nbsp;%s" :latex "Zie figuur~%s")
+ ("pt_BR" :default "Veja a figura %s")
+ ("ro" :default "Vezi figura %s")
+ ("sl" :default "Glej sliko %s")
+ ("tr" :default "bkz. şekil %s"))
+ ("See listing %s"
+ ("cs" :default "Viz program %s")
+ ("fr" :default "cf. programme %s"
+ :html "cf.&nbsp;programme&nbsp;%s" :latex "cf.~programme~%s")
+ ("nl" :default "Zie programma %s"
+ :html "Zie programma&nbsp;%s" :latex "Zie programma~%s")
+ ("pt_BR" :default "Veja a listagem %s")
+ ("ro" :default "Vezi tabelul %s")
+ ("sl" :default "Glej izpis programa %s")
+ ("tr" :default "bkz. program %s"))
+ ("See section %s"
+ ("ar" :default "انظر قسم %s")
+ ("cs" :default "Viz sekce %s")
+ ("da" :default "jævnfør afsnit %s")
+ ("de" :default "siehe Abschnitt %s")
+ ("es" :ascii "Vea seccion %s" :html "Vea secci&oacute;n %s" :default "Vea sección %s")
+ ("et" :html "Vaata peat&#252;kki %s" :utf-8 "Vaata peatükki %s")
+ ("fr" :default "cf. section %s")
+ ("it" :default "Vedi sezione %s")
+ ("ja" :default "セクション %s を参照")
+ ("nl" :default "Zie sectie %s"
+ :html "Zie sectie&nbsp;%s" :latex "Zie sectie~%s")
+ ("pt_BR" :html "Veja a se&ccedil;&atilde;o %s" :default "Veja a seção %s"
+ :ascii "Veja a secao %s")
+ ("ro" :default "Vezi secțiunea %s")
+ ("ru" :html "&#1057;&#1084;. &#1088;&#1072;&#1079;&#1076;&#1077;&#1083; %s"
+ :utf-8 "См. раздел %s")
+ ("sl" :default "Glej poglavje %d")
+ ("tr" :default "bkz. bölüm %s")
+ ("zh-CN" :html "&#21442;&#35265;&#31532;%s&#33410;" :utf-8 "参见第%s节"))
+ ("See table %s"
+ ("cs" :default "Viz tabulka %s")
+ ("fr" :default "cf. tableau %s"
+ :html "cf.&nbsp;tableau&nbsp;%s" :latex "cf.~tableau~%s")
+ ("it" :default "Vedi tabella %s")
+ ("nl" :default "Zie tabel %s"
+ :html "Zie tabel&nbsp;%s" :latex "Zie tabel~%s")
+ ("pt_BR" :default "Veja a tabela %s")
+ ("ro" :default "Vezi tabelul %s")
+ ("sl" :default "Glej tabelo %s")
+ ("tr" :default "bkz. tablo %s"))
+ ("Table"
+ ("ar" :default "جدول")
+ ("cs" :default "Tabulka")
+ ("de" :default "Tabelle")
+ ("es" :default "Tabla")
+ ("et" :default "Tabel")
+ ("fr" :default "Tableau")
+ ("is" :default "Tafla")
+ ("it" :default "Tabella")
+ ("ja" :default "表" :html "&#34920;")
+ ("nl" :default "Tabel")
+ ("pt_BR" :default "Tabela")
+ ("ro" :default "Tabel")
+ ("ru" :html "&#1058;&#1072;&#1073;&#1083;&#1080;&#1094;&#1072;"
+ :utf-8 "Таблица")
+ ("tr" :default "Tablo")
+ ("zh-CN" :html "&#34920;" :utf-8 "表"))
+ ("Table %d:"
+ ("ar" :default "جدول %d:")
+ ("cs" :default "Tabulka %d:")
+ ("da" :default "Tabel %d")
+ ("de" :default "Tabelle %d")
+ ("es" :default "Tabla %d")
+ ("et" :default "Tabel %d")
+ ("fr" :default "Tableau %d :")
+ ("is" :default "Tafla %d")
+ ("it" :default "Tabella %d:")
+ ("ja" :default "表%d:" :html "&#34920;%d:")
+ ("nl" :default "Tabel %d:" :html "Tabel&nbsp;%d:")
+ ("no" :default "Tabell %d")
+ ("nb" :default "Tabell %d")
+ ("nn" :default "Tabell %d")
+ ("pt_BR" :default "Tabela %d:")
+ ("ro" :default "Tabel %d")
+ ("ru" :html "&#1058;&#1072;&#1073;&#1083;&#1080;&#1094;&#1072; %d.:"
+ :utf-8 "Таблица %d.:")
+ ("sl" :default "Tabela %d")
+ ("sv" :default "Tabell %d")
+ ("tr" :default "Tablo %d")
+ ("zh-CN" :html "&#34920;%d&nbsp;" :utf-8 "表%d "))
+ ("Table of Contents"
+ ("ar" :default "قائمة المحتويات")
+ ("ca" :html "&Iacute;ndex")
+ ("cs" :default "Obsah")
+ ("da" :default "Indhold")
+ ("de" :default "Inhaltsverzeichnis")
+ ("eo" :default "Enhavo")
+ ("es" :ascii "Indice" :html "&Iacute;ndice" :default "Índice")
+ ("et" :default "Sisukord")
+ ("fi" :html "Sis&auml;llysluettelo")
+ ("fr" :ascii "Sommaire" :default "Table des matières")
+ ("hu" :html "Tartalomjegyz&eacute;k")
+ ("is" :default "Efnisyfirlit")
+ ("it" :default "Indice")
+ ("ja" :default "目次" :html "&#30446;&#27425;")
+ ("nl" :default "Inhoudsopgave")
+ ("no" :default "Innhold")
+ ("nb" :default "Innhold")
+ ("nn" :default "Innhald")
+ ("pl" :html "Spis tre&#x015b;ci")
+ ("pt_BR" :html "&Iacute;ndice" :utf8 "Índice" :ascii "Indice")
+ ("ro" :default "Cuprins")
+ ("ru" :html "&#1057;&#1086;&#1076;&#1077;&#1088;&#1078;&#1072;&#1085;&#1080;&#1077;"
+ :utf-8 "Содержание")
+ ("sl" :default "Kazalo")
+ ("sv" :html "Inneh&aring;ll")
+ ("tr" :default "İçindekiler")
+ ("uk" :html "&#1047;&#1084;&#1110;&#1089;&#1090;" :utf-8 "Зміст")
+ ("zh-CN" :html "&#30446;&#24405;" :utf-8 "目录")
+ ("zh-TW" :html "&#30446;&#37636;" :utf-8 "目錄"))
+ ("Unknown reference"
+ ("ar" :default "مرجع غير معرّف")
+ ("da" :default "ukendt reference")
+ ("de" :default "Unbekannter Verweis")
+ ("es" :default "Referencia desconocida")
+ ("et" :default "Tundmatu viide")
+ ("fr" :ascii "Destination inconnue" :default "Référence inconnue")
+ ("it" :default "Riferimento sconosciuto")
+ ("ja" :default "不明な参照先")
+ ("nl" :default "Onbekende verwijzing")
+ ("pt_BR" :html "Refer&ecirc;ncia desconhecida" :default "Referência desconhecida" :ascii "Referencia desconhecida")
+ ("ro" :default "Referință necunoscută")
+ ("ru" :html "&#1053;&#1077;&#1080;&#1079;&#1074;&#1077;&#1089;&#1090;&#1085;&#1072;&#1103; &#1089;&#1089;&#1099;&#1083;&#1082;&#1072;"
+ :utf-8 "Неизвестная ссылка")
+ ("sl" :default "Neznana referenca")
+ ("tr" :default "Bilinmeyen referans")
+ ("zh-CN" :html "&#26410;&#30693;&#24341;&#29992;" :utf-8 "未知引用")))
+ "Dictionary for export engine.
+
+Alist whose car is the string to translate and cdr is an alist
+whose car is the language string and cdr is a plist whose
+properties are possible charsets and values translated terms.
+
+It is used as a database for `org-export-translate'. Since this
+function returns the string as-is if no translation was found,
+the variable only needs to record values different from the
+entry.")
+
+(defun org-export-translate (s encoding info)
+ "Translate string S according to language specification.
+
+ENCODING is a symbol among `:ascii', `:html', `:latex', `:latin1'
+and `:utf-8'. INFO is a plist used as a communication channel.
+
+Translation depends on `:language' property. Return the
+translated string. If no translation is found, try to fall back
+to `:default' encoding. If it fails, return S."
+ (let* ((lang (plist-get info :language))
+ (translations (cdr (assoc lang
+ (cdr (assoc s org-export-dictionary))))))
+ (or (plist-get translations encoding)
+ (plist-get translations :default)
+ s)))
+
+
+
+;;; Asynchronous Export
+;;
+;; `org-export-async-start' is the entry point for asynchronous
+;; export. It recreates current buffer (including visibility,
+;; narrowing and visited file) in an external Emacs process, and
+;; evaluates a command there. It then applies a function on the
+;; returned results in the current process.
+;;
+;; At a higher level, `org-export-to-buffer' and `org-export-to-file'
+;; allow exporting to a buffer or a file, asynchronously or not.
+;;
+;; `org-export-output-file-name' is an auxiliary function meant to be
+;; used with `org-export-to-file'. With a given extension, it tries
+;; to provide a canonical file name to write export output to.
+;;
+;; Asynchronously generated results are never displayed directly.
+;; Instead, they are stored in `org-export-stack-contents'. They can
+;; then be retrieved by calling `org-export-stack'.
+;;
+;; Export Stack is viewed through a dedicated major mode
+;;`org-export-stack-mode' and tools: `org-export-stack-refresh',
+;;`org-export-stack-delete', `org-export-stack-view' and
+;;`org-export-stack-clear'.
+;;
+;; For back-ends, `org-export-add-to-stack' add a new source to stack.
+;; It should be used whenever `org-export-async-start' is called.
+
+(defun org-export-async-start (fun body)
+ "Call function FUN on the results returned by BODY evaluation.
+
+FUN is an anonymous function of one argument. BODY should be a valid
+ELisp source expression. BODY evaluation happens in an asynchronous process,
+from a buffer which is an exact copy of the current one.
+
+Use `org-export-add-to-stack' in FUN in order to register results
+in the stack.
+
+This is a low level function. See also `org-export-to-buffer'
+and `org-export-to-file' for more specialized functions."
+ (declare (indent 1))
+ ;; Write the full sexp evaluating BODY in a copy of the current
+ ;; buffer to a temporary file, as it may be too long for program
+ ;; args in `start-process'.
+ (with-temp-message "Initializing asynchronous export process"
+ (let ((copy-fun (org-export--generate-copy-script (current-buffer)))
+ (temp-file (make-temp-file "org-export-process")))
+ (let ((coding-system-for-write 'utf-8-emacs-unix))
+ (write-region
+ ;; Null characters (from variable values) are inserted
+ ;; within the file. As a consequence, coding system for
+ ;; buffer contents could fail to be recognized properly.
+ (format ";; -*- coding: utf-8-emacs-unix; lexical-binding:t -*-\n%S"
+ `(with-temp-buffer
+ ,(when org-export-async-debug '(setq debug-on-error t))
+ ;; Ignore `kill-emacs-hook' and code evaluation
+ ;; queries from Babel as we need a truly
+ ;; non-interactive process.
+ (setq kill-emacs-hook nil
+ org-babel-confirm-evaluate-answer-no t)
+ ;; Initialize export framework.
+ (require 'ox)
+ ;; Re-create current buffer there.
+ (funcall ',copy-fun)
+ (restore-buffer-modified-p nil)
+ ;; Sexp to evaluate in the buffer.
+ (print ,body)))
+ nil temp-file nil 'silent))
+ ;; Start external process.
+ (let* ((process-connection-type nil)
+ (proc-buffer (generate-new-buffer-name "*Org Export Process*"))
+ (process
+ (apply
+ #'start-process
+ (append
+ (list "org-export-process"
+ proc-buffer
+ (expand-file-name invocation-name invocation-directory)
+ "--batch")
+ (if org-export-async-init-file
+ (list "-Q" "-l" org-export-async-init-file)
+ (list "-l" user-init-file))
+ (list "-l" temp-file)))))
+ ;; Register running process in stack.
+ (org-export-add-to-stack (get-buffer proc-buffer) nil process)
+ ;; Set-up sentinel in order to catch results.
+ (let ((handler fun))
+ (set-process-sentinel
+ process
+ (lambda (p _status)
+ (let ((proc-buffer (process-buffer p)))
+ (when (eq (process-status p) 'exit)
+ (unwind-protect
+ (if (zerop (process-exit-status p))
+ (unwind-protect
+ (let ((results
+ (with-current-buffer proc-buffer
+ (goto-char (point-max))
+ (backward-sexp)
+ (read (current-buffer)))))
+ (funcall handler results))
+ (unless org-export-async-debug
+ (and (get-buffer proc-buffer)
+ (kill-buffer proc-buffer))))
+ (org-export-add-to-stack proc-buffer nil p)
+ (ding)
+ (message "Process `%s' exited abnormally" p))
+ (unless org-export-async-debug
+ (delete-file temp-file))))))))))))
+
+;;;###autoload
+(defun org-export-to-buffer
+ (backend buffer
+ &optional async subtreep visible-only body-only ext-plist
+ post-process)
+ "Call `org-export-as' with output to a specified buffer.
+
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end.
+
+BUFFER is the name of the output buffer. If it already exists,
+it will be erased first, otherwise, it will be created.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer should then be accessible
+through the `org-export-stack' interface. When ASYNC is nil, the
+buffer is displayed if `org-export-show-temporary-export-buffer'
+is non-nil.
+
+Optional arguments SUBTREEP, VISIBLE-ONLY, BODY-ONLY and
+EXT-PLIST are similar to those used in `org-export-as', which
+see.
+
+Optional argument POST-PROCESS is a function which should accept
+no argument. It is always called within the current process,
+from BUFFER, with point at its beginning. Export back-ends can
+use it to set a major mode there, e.g,
+
+ (defun org-latex-export-as-latex
+ (&optional async subtreep visible-only body-only ext-plist)
+ (interactive)
+ (org-export-to-buffer \\='latex \"*Org LATEX Export*\"
+ async subtreep visible-only body-only ext-plist
+ #'LaTeX-mode))
+
+When expressed as an anonymous function, using `lambda',
+POST-PROCESS needs to be quoted.
+
+This function returns BUFFER."
+ (declare (indent 2))
+ (if async
+ (org-export-async-start
+ (let ((cs buffer-file-coding-system))
+ (lambda (output)
+ (with-current-buffer (get-buffer-create buffer)
+ (erase-buffer)
+ (setq buffer-file-coding-system cs)
+ (insert output)
+ (goto-char (point-min))
+ (org-export-add-to-stack (current-buffer) backend)
+ (ignore-errors (funcall post-process)))))
+ `(org-export-as
+ ',backend ,subtreep ,visible-only ,body-only ',ext-plist))
+ (let ((output
+ (org-export-as backend subtreep visible-only body-only ext-plist))
+ (buffer (get-buffer-create buffer))
+ (encoding buffer-file-coding-system))
+ (when (and (org-string-nw-p output) (org-export--copy-to-kill-ring-p))
+ (org-kill-new output))
+ (with-current-buffer buffer
+ (erase-buffer)
+ (setq buffer-file-coding-system encoding)
+ (insert output)
+ (goto-char (point-min))
+ (and (functionp post-process) (funcall post-process)))
+ (when org-export-show-temporary-export-buffer
+ (switch-to-buffer-other-window buffer))
+ buffer)))
+
+;;;###autoload
+(defun org-export-to-file
+ (backend file &optional async subtreep visible-only body-only ext-plist
+ post-process)
+ "Call `org-export-as' with output to a specified file.
+
+BACKEND is either an export back-end, as returned by, e.g.,
+`org-export-create-backend', or a symbol referring to
+a registered back-end. FILE is the name of the output file, as
+a string.
+
+A non-nil optional argument ASYNC means the process should happen
+asynchronously. The resulting buffer will then be accessible
+through the `org-export-stack' interface.
+
+Optional arguments SUBTREEP, VISIBLE-ONLY, BODY-ONLY and
+EXT-PLIST are similar to those used in `org-export-as', which
+see.
+
+Optional argument POST-PROCESS is called with FILE as its
+argument and happens asynchronously when ASYNC is non-nil. It
+has to return a file name, or nil. Export back-ends can use this
+to send the output file through additional processing, e.g,
+
+ (defun org-latex-export-to-latex
+ (&optional async subtreep visible-only body-only ext-plist)
+ (interactive)
+ (let ((outfile (org-export-output-file-name \".tex\" subtreep)))
+ (org-export-to-file \\='latex outfile
+ async subtreep visible-only body-only ext-plist
+ #'org-latex-compile)))
+
+When expressed as an anonymous function, using `lambda',
+POST-PROCESS needs to be quoted.
+
+The function returns either a file name returned by POST-PROCESS,
+or FILE."
+ (declare (indent 2))
+ (if (not (file-writable-p file)) (error "Output file not writable")
+ (let ((ext-plist (org-combine-plists `(:output-file ,file) ext-plist))
+ (encoding (or org-export-coding-system buffer-file-coding-system))
+ auto-mode-alist)
+ (if async
+ (org-export-async-start
+ (lambda (file)
+ (org-export-add-to-stack (expand-file-name file) backend))
+ `(let ((output
+ (org-export-as
+ ',backend ,subtreep ,visible-only ,body-only
+ ',ext-plist)))
+ (with-temp-buffer
+ (insert output)
+ (let ((coding-system-for-write ',encoding))
+ (write-file ,file)))
+ (or (ignore-errors (funcall ',post-process ,file)) ,file)))
+ (let ((output (org-export-as
+ backend subtreep visible-only body-only ext-plist)))
+ (with-temp-buffer
+ (insert output)
+ (let ((coding-system-for-write encoding))
+ (write-file file)))
+ (when (and (org-export--copy-to-kill-ring-p) (org-string-nw-p output))
+ (org-kill-new output))
+ ;; Get proper return value.
+ (or (and (functionp post-process) (funcall post-process file))
+ file))))))
+
+(defun org-export-output-file-name (extension &optional subtreep pub-dir)
+ "Return output file's name according to buffer specifications.
+
+EXTENSION is a string representing the output file extension,
+with the leading dot.
+
+With a non-nil optional argument SUBTREEP, try to determine
+output file's name by looking for \"EXPORT_FILE_NAME\" property
+of subtree at point.
+
+When optional argument PUB-DIR is set, use it as the publishing
+directory.
+
+Return file name as a string."
+ (let* ((visited-file (buffer-file-name (buffer-base-buffer)))
+ (base-name
+ (concat
+ (file-name-sans-extension
+ (or
+ ;; Check EXPORT_FILE_NAME subtree property.
+ (and subtreep (org-entry-get nil "EXPORT_FILE_NAME" 'selective))
+ ;; Check #+EXPORT_FILE_NAME keyword.
+ (org-with-point-at (point-min)
+ (catch :found
+ (let ((case-fold-search t))
+ (while (re-search-forward
+ "^[ \t]*#\\+EXPORT_FILE_NAME:[ \t]+\\S-" nil t)
+ (let ((element (org-element-at-point)))
+ (when (eq 'keyword (org-element-type element))
+ (throw :found
+ (org-element-property :value element))))))))
+ ;; Extract from buffer's associated file, if any.
+ (and visited-file
+ (file-name-nondirectory
+ ;; For a .gpg visited file, remove the .gpg extension:
+ (replace-regexp-in-string "\\.gpg\\'" "" visited-file)))
+ ;; Can't determine file name on our own: ask user.
+ (read-file-name
+ "Output file: " pub-dir nil nil nil
+ (lambda (n) (string= extension (file-name-extension n t))))))
+ extension))
+ (output-file
+ ;; Build file name. Enforce EXTENSION over whatever user
+ ;; may have come up with. PUB-DIR, if defined, always has
+ ;; precedence over any provided path.
+ (cond
+ (pub-dir (concat (file-name-as-directory pub-dir)
+ (file-name-nondirectory base-name)))
+ ((file-name-absolute-p base-name) base-name)
+ (t base-name))))
+ ;; If writing to OUTPUT-FILE would overwrite original file, append
+ ;; EXTENSION another time to final name.
+ (if (and visited-file (file-equal-p visited-file output-file))
+ (concat output-file extension)
+ output-file)))
+
+(defun org-export-add-to-stack (source backend &optional process)
+ "Add a new result to export stack if not present already.
+
+SOURCE is a buffer or a file name containing export results.
+BACKEND is a symbol representing export back-end used to generate
+it.
+
+Entries already pointing to SOURCE and unavailable entries are
+removed beforehand. Return the new stack."
+ (setq org-export-stack-contents
+ (cons (list source backend (or process (current-time)))
+ (org-export-stack-remove source))))
+
+(defun org-export-stack ()
+ "Menu for asynchronous export results and running processes."
+ (interactive)
+ (let ((buffer (get-buffer-create "*Org Export Stack*")))
+ (with-current-buffer buffer
+ (org-export-stack-mode)
+ (tabulated-list-print t))
+ (pop-to-buffer buffer))
+ (message "Type \"q\" to quit, \"?\" for help"))
+
+(defun org-export-stack-clear ()
+ "Remove all entries from export stack."
+ (interactive)
+ (setq org-export-stack-contents nil))
+
+(defun org-export-stack-refresh ()
+ "Refresh the export stack."
+ (interactive)
+ (tabulated-list-print t))
+
+(defun org-export-stack-remove (&optional source)
+ "Remove export results at point from stack.
+If optional argument SOURCE is non-nil, remove it instead."
+ (interactive)
+ (let ((source (or source (org-export--stack-source-at-point))))
+ (setq org-export-stack-contents
+ (cl-remove-if (lambda (el) (equal (car el) source))
+ org-export-stack-contents))))
+
+(defun org-export-stack-view (&optional in-emacs)
+ "View export results at point in stack.
+With an optional prefix argument IN-EMACS, force viewing files
+within Emacs."
+ (interactive "P")
+ (let ((source (org-export--stack-source-at-point)))
+ (cond ((processp source)
+ (org-switch-to-buffer-other-window (process-buffer source)))
+ ((bufferp source) (org-switch-to-buffer-other-window source))
+ (t (org-open-file source in-emacs)))))
+
+(defvar org-export-stack-mode-map
+ (let ((km (make-sparse-keymap)))
+ (set-keymap-parent km tabulated-list-mode-map)
+ (define-key km " " #'next-line)
+ (define-key km "\C-n" #'next-line)
+ (define-key km [down] #'next-line)
+ (define-key km "\C-p" #'previous-line)
+ (define-key km "\C-?" #'previous-line)
+ (define-key km [up] #'previous-line)
+ (define-key km "C" #'org-export-stack-clear)
+ (define-key km "v" #'org-export-stack-view)
+ (define-key km (kbd "RET") #'org-export-stack-view)
+ (define-key km "d" #'org-export-stack-remove)
+ km)
+ "Keymap for Org Export Stack.")
+
+(define-derived-mode org-export-stack-mode tabulated-list-mode "Org-Stack"
+ "Mode for displaying asynchronous export stack.
+
+Type `\\[org-export-stack]' to visualize the asynchronous export
+stack.
+
+In an Org Export Stack buffer, use \
+\\<org-export-stack-mode-map>`\\[org-export-stack-view]' to view export output
+on current line, `\\[org-export-stack-remove]' to remove it from the stack and \
+`\\[org-export-stack-clear]' to clear
+stack completely.
+
+Removing entries in a stack buffer does not affect files
+or buffers, only display.
+
+\\{org-export-stack-mode-map}"
+ (setq tabulated-list-format
+ (vector (list "#" 4 #'org-export--stack-num-predicate)
+ (list "Back-End" 12 t)
+ (list "Age" 6 nil)
+ (list "Source" 0 nil)))
+ (setq tabulated-list-sort-key (cons "#" nil))
+ (setq tabulated-list-entries #'org-export--stack-generate)
+ (add-hook 'tabulated-list-revert-hook #'org-export--stack-generate nil t)
+ (add-hook 'post-command-hook #'org-export-stack-refresh nil t)
+ (tabulated-list-init-header))
+
+(defun org-export--stack-generate ()
+ "Generate the asynchronous export stack for display.
+Unavailable sources are removed from the list. Return a list
+appropriate for `tabulated-list-print'."
+ ;; Clear stack from exited processes, dead buffers or non-existent
+ ;; files.
+ (setq org-export-stack-contents
+ (cl-remove-if-not
+ (lambda (el)
+ (if (processp (nth 2 el))
+ (buffer-live-p (process-buffer (nth 2 el)))
+ (let ((source (car el)))
+ (if (bufferp source) (buffer-live-p source)
+ (file-exists-p source)))))
+ org-export-stack-contents))
+ ;; Update `tabulated-list-entries'.
+ (let ((counter 0))
+ (mapcar
+ (lambda (entry)
+ (let ((source (car entry)))
+ (list source
+ (vector
+ ;; Counter.
+ (number-to-string (cl-incf counter))
+ ;; Back-End.
+ (if (nth 1 entry) (symbol-name (nth 1 entry)) "")
+ ;; Age.
+ (let ((info (nth 2 entry)))
+ (if (processp info) (symbol-name (process-status info))
+ (format-seconds "%h:%.2m" (float-time (time-since info)))))
+ ;; Source.
+ (if (stringp source) source (buffer-name source))))))
+ org-export-stack-contents)))
+
+(defun org-export--stack-num-predicate (a b)
+ (< (string-to-number (aref (nth 1 a) 0))
+ (string-to-number (aref (nth 1 b) 0))))
+
+(defun org-export--stack-source-at-point ()
+ "Return source from export results at point in stack."
+ (let ((source (car (nth (1- (org-current-line)) org-export-stack-contents))))
+ (if (not source) (error "Source unavailable, please refresh buffer")
+ (let ((source-name (if (stringp source) source (buffer-name source))))
+ (if (save-excursion
+ (beginning-of-line)
+ (looking-at-p (concat ".* +" (regexp-quote source-name) "$")))
+ source
+ ;; SOURCE is not consistent with current line. The stack
+ ;; view is outdated.
+ (error (substitute-command-keys
+ "Source unavailable; type `\\[org-export-stack-refresh]' \
+to refresh buffer")))))))
+
+
+
+;;; The Dispatcher
+;;
+;; `org-export-dispatch' is the standard interactive way to start an
+;; export process. It uses `org-export--dispatch-ui' as a subroutine
+;; for its interface, which, in turn, delegates response to key
+;; pressed to `org-export--dispatch-action'.
+
+;;;###autoload
+(defun org-export-dispatch (&optional arg)
+ "Export dispatcher for Org mode.
+
+It provides an access to common export related tasks in a buffer.
+Its interface comes in two flavors: standard and expert.
+
+While both share the same set of bindings, only the former
+displays the valid keys associations in a dedicated buffer.
+Scrolling (resp. line-wise motion) in this buffer is done with
+SPC and DEL (resp. C-n and C-p) keys.
+
+Set variable `org-export-dispatch-use-expert-ui' to switch to one
+flavor or the other.
+
+When ARG is `\\[universal-argument]', repeat the last export action, with the\
+ same
+set of options used back then, on the current buffer.
+
+When ARG is `\\[universal-argument] \\[universal-argument]', display the \
+asynchronous export stack."
+ (interactive "P")
+ (let* ((input
+ (cond ((equal arg '(16)) '(stack))
+ ((and arg org-export-dispatch-last-action))
+ (t (save-window-excursion
+ (unwind-protect
+ (progn
+ ;; Remember where we are
+ (move-marker org-export-dispatch-last-position
+ (point)
+ (org-base-buffer (current-buffer)))
+ ;; Get and store an export command
+ (setq org-export-dispatch-last-action
+ (org-export--dispatch-ui
+ (list org-export-initial-scope
+ (and org-export-in-background 'async))
+ nil
+ org-export-dispatch-use-expert-ui)))
+ (and (get-buffer "*Org Export Dispatcher*")
+ (kill-buffer "*Org Export Dispatcher*")))))))
+ (action (car input))
+ (optns (cdr input)))
+ (unless (memq 'subtree optns)
+ (move-marker org-export-dispatch-last-position nil))
+ (cl-case action
+ ;; First handle special hard-coded actions.
+ (template (org-export-insert-default-template nil optns))
+ (stack (org-export-stack))
+ (publish-current-file
+ (org-publish-current-file (memq 'force optns) (memq 'async optns)))
+ (publish-current-project
+ (org-publish-current-project (memq 'force optns) (memq 'async optns)))
+ (publish-choose-project
+ (org-publish (assoc (completing-read
+ "Publish project: "
+ org-publish-project-alist nil t)
+ org-publish-project-alist)
+ (memq 'force optns)
+ (memq 'async optns)))
+ (publish-all (org-publish-all (memq 'force optns) (memq 'async optns)))
+ (otherwise
+ (save-excursion
+ (when arg
+ ;; Repeating command, maybe move cursor to restore subtree
+ ;; context.
+ (if (eq (marker-buffer org-export-dispatch-last-position)
+ (org-base-buffer (current-buffer)))
+ (goto-char org-export-dispatch-last-position)
+ ;; We are in a different buffer, forget position.
+ (move-marker org-export-dispatch-last-position nil)))
+ (funcall action
+ ;; Return a symbol instead of a list to ease
+ ;; asynchronous export macro use.
+ (and (memq 'async optns) t)
+ (and (memq 'subtree optns) t)
+ (and (memq 'visible optns) t)
+ (and (memq 'body optns) t)))))))
+
+(defun org-export--dispatch-ui (options first-key expertp)
+ "Handle interface for `org-export-dispatch'.
+
+OPTIONS is a list containing current interactive options set for
+export. It can contain any of the following symbols:
+`body' toggles a body-only export
+`subtree' restricts export to current subtree
+`visible' restricts export to visible part of buffer.
+`force' force publishing files.
+`async' use asynchronous export process
+
+FIRST-KEY is the key pressed to select the first level menu. It
+is nil when this menu hasn't been selected yet.
+
+EXPERTP, when non-nil, triggers expert UI. In that case, no help
+buffer is provided, but indications about currently active
+options are given in the prompt. Moreover, [?] allows switching
+back to standard interface."
+ (let* ((fontify-key
+ (lambda (key &optional access-key)
+ ;; Fontify KEY string. Optional argument ACCESS-KEY, when
+ ;; non-nil is the required first-level key to activate
+ ;; KEY. When its value is t, activate KEY independently
+ ;; on the first key, if any. A nil value means KEY will
+ ;; only be activated at first level.
+ (if (or (eq access-key t) (eq access-key first-key))
+ (propertize key 'face 'org-dispatcher-highlight)
+ key)))
+ (fontify-value
+ (lambda (value)
+ ;; Fontify VALUE string.
+ (propertize value 'face 'font-lock-variable-name-face)))
+ ;; Prepare menu entries by extracting them from registered
+ ;; back-ends and sorting them by access key and by ordinal,
+ ;; if any.
+ (entries
+ (sort (sort (delq nil
+ (mapcar #'org-export-backend-menu
+ org-export-registered-backends))
+ (lambda (a b)
+ (let ((key-a (nth 1 a))
+ (key-b (nth 1 b)))
+ (cond ((and (numberp key-a) (numberp key-b))
+ (< key-a key-b))
+ ((numberp key-b) t)))))
+ #'car-less-than-car))
+ ;; Compute a list of allowed keys based on the first key
+ ;; pressed, if any. Some keys
+ ;; (?^B, ?^V, ?^S, ?^F, ?^A, ?&, ?# and ?q) are always
+ ;; available.
+ (allowed-keys
+ (nconc (list 2 22 19 6 1)
+ (if (not first-key) (org-uniquify (mapcar #'car entries))
+ (let (sub-menu)
+ (dolist (entry entries (sort (mapcar #'car sub-menu) #'<))
+ (when (eq (car entry) first-key)
+ (setq sub-menu (append (nth 2 entry) sub-menu))))))
+ (cond ((eq first-key ?P) (list ?f ?p ?x ?a))
+ ((not first-key) (list ?P)))
+ (list ?& ?#)
+ (when expertp (list ??))
+ (list ?q)))
+ ;; Build the help menu for standard UI.
+ (help
+ (unless expertp
+ (concat
+ ;; Options are hard-coded.
+ (format "[%s] Body only: %s [%s] Visible only: %s
+\[%s] Export scope: %s [%s] Force publishing: %s
+\[%s] Async export: %s\n\n"
+ (funcall fontify-key "C-b" t)
+ (funcall fontify-value
+ (if (memq 'body options) "On " "Off"))
+ (funcall fontify-key "C-v" t)
+ (funcall fontify-value
+ (if (memq 'visible options) "On " "Off"))
+ (funcall fontify-key "C-s" t)
+ (funcall fontify-value
+ (if (memq 'subtree options) "Subtree" "Buffer "))
+ (funcall fontify-key "C-f" t)
+ (funcall fontify-value
+ (if (memq 'force options) "On " "Off"))
+ (funcall fontify-key "C-a" t)
+ (funcall fontify-value
+ (if (memq 'async options) "On " "Off")))
+ ;; Display registered back-end entries. When a key
+ ;; appears for the second time, do not create another
+ ;; entry, but append its sub-menu to existing menu.
+ (let (last-key)
+ (mapconcat
+ (lambda (entry)
+ (let ((top-key (car entry)))
+ (concat
+ (unless (eq top-key last-key)
+ (setq last-key top-key)
+ (format "\n[%s] %s\n"
+ (funcall fontify-key (char-to-string top-key))
+ (nth 1 entry)))
+ (let ((sub-menu (nth 2 entry)))
+ (unless (functionp sub-menu)
+ ;; Split sub-menu into two columns.
+ (let ((index -1))
+ (concat
+ (mapconcat
+ (lambda (sub-entry)
+ (cl-incf index)
+ (format
+ (if (zerop (mod index 2)) " [%s] %-26s"
+ "[%s] %s\n")
+ (funcall fontify-key
+ (char-to-string (car sub-entry))
+ top-key)
+ (nth 1 sub-entry)))
+ sub-menu "")
+ (when (zerop (mod index 2)) "\n"))))))))
+ entries ""))
+ ;; Publishing menu is hard-coded.
+ (format "\n[%s] Publish
+ [%s] Current file [%s] Current project
+ [%s] Choose project [%s] All projects\n\n\n"
+ (funcall fontify-key "P")
+ (funcall fontify-key "f" ?P)
+ (funcall fontify-key "p" ?P)
+ (funcall fontify-key "x" ?P)
+ (funcall fontify-key "a" ?P))
+ (format "[%s] Export stack [%s] Insert template\n"
+ (funcall fontify-key "&" t)
+ (funcall fontify-key "#" t))
+ (format "[%s] %s"
+ (funcall fontify-key "q" t)
+ (if first-key "Main menu" "Exit")))))
+ ;; Build prompts for both standard and expert UI.
+ (standard-prompt (unless expertp "Export command: "))
+ (expert-prompt
+ (when expertp
+ (format
+ "Export command (C-%s%s%s%s%s) [%s]: "
+ (if (memq 'body options) (funcall fontify-key "b" t) "b")
+ (if (memq 'visible options) (funcall fontify-key "v" t) "v")
+ (if (memq 'subtree options) (funcall fontify-key "s" t) "s")
+ (if (memq 'force options) (funcall fontify-key "f" t) "f")
+ (if (memq 'async options) (funcall fontify-key "a" t) "a")
+ (mapconcat (lambda (k)
+ ;; Strip control characters.
+ (unless (< k 27) (char-to-string k)))
+ allowed-keys "")))))
+ ;; With expert UI, just read key with a fancy prompt. In standard
+ ;; UI, display an intrusive help buffer.
+ (if expertp
+ (org-export--dispatch-action
+ expert-prompt allowed-keys entries options first-key expertp)
+ ;; At first call, create frame layout in order to display menu.
+ (unless (get-buffer "*Org Export Dispatcher*")
+ (delete-other-windows)
+ (org-switch-to-buffer-other-window
+ (get-buffer-create "*Org Export Dispatcher*"))
+ (setq cursor-type nil
+ header-line-format "Use SPC, DEL, C-n or C-p to navigate.")
+ ;; Make sure that invisible cursor will not highlight square
+ ;; brackets.
+ (set-syntax-table (copy-syntax-table))
+ (modify-syntax-entry ?\[ "w"))
+ ;; At this point, the buffer containing the menu exists and is
+ ;; visible in the current window. So, refresh it.
+ (with-current-buffer "*Org Export Dispatcher*"
+ ;; Refresh help. Maintain display continuity by re-visiting
+ ;; previous window position.
+ (let ((pt (point))
+ (wstart (window-start)))
+ (erase-buffer)
+ (insert help)
+ (goto-char pt)
+ (set-window-start nil wstart)))
+ (org-fit-window-to-buffer)
+ (org-export--dispatch-action
+ standard-prompt allowed-keys entries options first-key expertp))))
+
+(defun org-export--dispatch-action
+ (prompt allowed-keys entries options first-key expertp)
+ "Read a character from command input and act accordingly.
+
+PROMPT is the displayed prompt, as a string. ALLOWED-KEYS is
+a list of characters available at a given step in the process.
+ENTRIES is a list of menu entries. OPTIONS, FIRST-KEY and
+EXPERTP are the same as defined in `org-export--dispatch-ui',
+which see.
+
+Toggle export options when required. Otherwise, return value is
+a list with action as CAR and a list of interactive export
+options as CDR."
+ (let (key)
+ ;; Scrolling: when in non-expert mode, act on motion keys (C-n,
+ ;; C-p, SPC, DEL).
+ (while (and (setq key (read-char-exclusive prompt))
+ (not expertp)
+ ;; FIXME: Don't use C-v (22) here, as it is used as a
+ ;; modifier key in the export dispatch.
+ (memq key '(14 16 ?\s ?\d 134217846)))
+ (org-scroll key t))
+ (cond
+ ;; Ignore undefined associations.
+ ((not (memq key allowed-keys))
+ (ding)
+ (unless expertp (message "Invalid key") (sit-for 1))
+ (org-export--dispatch-ui options first-key expertp))
+ ;; q key at first level aborts export. At second level, cancel
+ ;; first key instead.
+ ((eq key ?q) (if (not first-key) (user-error "Export aborted")
+ (org-export--dispatch-ui options nil expertp)))
+ ;; Help key: Switch back to standard interface if expert UI was
+ ;; active.
+ ((eq key ??) (org-export--dispatch-ui options first-key nil))
+ ;; Send request for template insertion along with export scope.
+ ((eq key ?#) (cons 'template (memq 'subtree options)))
+ ;; Switch to asynchronous export stack.
+ ((eq key ?&) '(stack))
+ ;; Toggle options: C-b (2) C-v (22) C-s (19) C-f (6) C-a (1).
+ ((memq key '(2 22 19 6 1))
+ (org-export--dispatch-ui
+ (let ((option (cl-case key (2 'body) (22 'visible) (19 'subtree)
+ (6 'force) (1 'async))))
+ (if (memq option options) (remq option options)
+ (cons option options)))
+ first-key expertp))
+ ;; Action selected: Send key and options back to
+ ;; `org-export-dispatch'.
+ ((or first-key (functionp (nth 2 (assq key entries))))
+ (cons (cond
+ ((not first-key) (nth 2 (assq key entries)))
+ ;; Publishing actions are hard-coded. Send a special
+ ;; signal to `org-export-dispatch'.
+ ((eq first-key ?P)
+ (cl-case key
+ (?f 'publish-current-file)
+ (?p 'publish-current-project)
+ (?x 'publish-choose-project)
+ (?a 'publish-all)))
+ ;; Return first action associated to FIRST-KEY + KEY
+ ;; path. Indeed, derived backends can share the same
+ ;; FIRST-KEY.
+ (t (catch 'found
+ (dolist (entry (member (assq first-key entries) entries))
+ (let ((match (assq key (nth 2 entry))))
+ (when match (throw 'found (nth 2 match))))))))
+ options))
+ ;; Otherwise, enter sub-menu.
+ (t (org-export--dispatch-ui options key expertp)))))
+
+
+
+(provide 'ox)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; ox.el ends here
diff --git a/elpa/org-9.5.2/ox.elc b/elpa/org-9.5.2/ox.elc
new file mode 100644
index 0000000..46d91c3
--- /dev/null
+++ b/elpa/org-9.5.2/ox.elc
Binary files differ
diff --git a/elpa/org-9.5.2/request-assign-future.txt b/elpa/org-9.5.2/request-assign-future.txt
new file mode 100644
index 0000000..f0133bd
--- /dev/null
+++ b/elpa/org-9.5.2/request-assign-future.txt
@@ -0,0 +1,44 @@
+Please email the following information to assign@gnu.org, and we
+will send you the assignment form for your past and future changes.
+
+Please use your full legal name (in ASCII characters) as the subject
+line of the message.
+----------------------------------------------------------------------
+REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES
+
+[What is the name of the program or package you're contributing to?]
+
+ Emacs
+
+[Did you copy any files or text written by someone else in these changes?
+Even if that material is free software, we need to know about it.]
+
+
+[Do you have an employer who might have a basis to claim to own
+your changes? Do you attend a school which might make such a claim?]
+
+
+[For the copyright registration, what country are you a citizen of?]
+
+
+[What year were you born?]
+
+
+[Please write your email address here.]
+
+
+[Please write your postal address here.]
+
+
+
+
+
+[Which files have you changed so far, and which new files have you written
+so far?]
+
+
+
+
+
+
+
diff --git a/elpa/pkg-info-20150517.1143/pkg-info-autoloads.el b/elpa/pkg-info-20150517.1143/pkg-info-autoloads.el
new file mode 100644
index 0000000..44ce6b5
--- /dev/null
+++ b/elpa/pkg-info-20150517.1143/pkg-info-autoloads.el
@@ -0,0 +1,127 @@
+;;; pkg-info-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "pkg-info" "pkg-info.el" (0 0 0 0))
+;;; Generated autoloads from pkg-info.el
+
+(autoload 'pkg-info-library-original-version "pkg-info" "\
+Get the original version in the header of LIBRARY.
+
+The original version is stored in the X-Original-Version header.
+This header is added by the MELPA package archive to preserve
+upstream version numbers.
+
+LIBRARY is either a symbol denoting a named feature, or a library
+name as string.
+
+If SHOW is non-nil, show the version in the minibuffer.
+
+Return the version from the header of LIBRARY as list. Signal an
+error if the LIBRARY was not found or had no X-Original-Version
+header.
+
+See Info node `(elisp)Library Headers' for more information
+about library headers.
+
+\(fn LIBRARY &optional SHOW)" t nil)
+
+(autoload 'pkg-info-library-version "pkg-info" "\
+Get the version in the header of LIBRARY.
+
+LIBRARY is either a symbol denoting a named feature, or a library
+name as string.
+
+If SHOW is non-nil, show the version in the minibuffer.
+
+Return the version from the header of LIBRARY as list. Signal an
+error if the LIBRARY was not found or had no proper header.
+
+See Info node `(elisp)Library Headers' for more information
+about library headers.
+
+\(fn LIBRARY &optional SHOW)" t nil)
+
+(autoload 'pkg-info-defining-library-original-version "pkg-info" "\
+Get the original version of the library defining FUNCTION.
+
+The original version is stored in the X-Original-Version header.
+This header is added by the MELPA package archive to preserve
+upstream version numbers.
+
+If SHOW is non-nil, show the version in mini-buffer.
+
+This function is mainly intended to find the version of a major
+or minor mode, i.e.
+
+ (pkg-info-defining-library-version 'flycheck-mode)
+
+Return the version of the library defining FUNCTION. Signal an
+error if FUNCTION is not a valid function, if its defining
+library was not found, or if the library had no proper version
+header.
+
+\(fn FUNCTION &optional SHOW)" t nil)
+
+(autoload 'pkg-info-defining-library-version "pkg-info" "\
+Get the version of the library defining FUNCTION.
+
+If SHOW is non-nil, show the version in mini-buffer.
+
+This function is mainly intended to find the version of a major
+or minor mode, i.e.
+
+ (pkg-info-defining-library-version 'flycheck-mode)
+
+Return the version of the library defining FUNCTION. Signal an
+error if FUNCTION is not a valid function, if its defining
+library was not found, or if the library had no proper version
+header.
+
+\(fn FUNCTION &optional SHOW)" t nil)
+
+(autoload 'pkg-info-package-version "pkg-info" "\
+Get the version of an installed PACKAGE.
+
+If SHOW is non-nil, show the version in the minibuffer.
+
+Return the version as list, or nil if PACKAGE is not installed.
+
+\(fn PACKAGE &optional SHOW)" t nil)
+
+(autoload 'pkg-info-version-info "pkg-info" "\
+Obtain complete version info for LIBRARY and PACKAGE.
+
+LIBRARY is a symbol denoting a named feature, or a library name
+as string. PACKAGE is a symbol denoting an ELPA package. If
+omitted or nil, default to LIBRARY.
+
+If SHOW is non-nil, show the version in the minibuffer.
+
+When called interactively, prompt for LIBRARY. When called
+interactively with prefix argument, prompt for PACKAGE as well.
+
+Return a string with complete version information for LIBRARY.
+This version information contains the version from the headers of
+LIBRARY, and the version of the installed PACKAGE, the LIBRARY is
+part of. If PACKAGE is not installed, or if the PACKAGE version
+is the same as the LIBRARY version, do not include a package
+version.
+
+\(fn LIBRARY &optional PACKAGE SHOW)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "pkg-info" '("pkg-info-")))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; pkg-info-autoloads.el ends here
diff --git a/elpa/pkg-info-20150517.1143/pkg-info-pkg.el b/elpa/pkg-info-20150517.1143/pkg-info-pkg.el
new file mode 100644
index 0000000..e8c9cc0
--- /dev/null
+++ b/elpa/pkg-info-20150517.1143/pkg-info-pkg.el
@@ -0,0 +1,2 @@
+;;; Generated package description from pkg-info.el -*- no-byte-compile: t -*-
+(define-package "pkg-info" "20150517.1143" "Information about packages" '((epl "0.8")) :commit "76ba7415480687d05a4353b27fea2ae02b8d9d61" :authors '(("Sebastian Wiesner" . "swiesner@lunaryorn.com")) :maintainer '("Sebastian Wiesner" . "swiesner@lunaryorn.com") :keywords '("convenience") :url "https://github.com/lunaryorn/pkg-info.el")
diff --git a/elpa/pkg-info-20150517.1143/pkg-info.el b/elpa/pkg-info-20150517.1143/pkg-info.el
new file mode 100644
index 0000000..1017a37
--- /dev/null
+++ b/elpa/pkg-info-20150517.1143/pkg-info.el
@@ -0,0 +1,332 @@
+;;; pkg-info.el --- Information about packages -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2013-2015 Sebastian Wiesner <swiesner@lunaryorn.com>
+
+;; Author: Sebastian Wiesner <swiesner@lunaryorn.com>
+;; URL: https://github.com/lunaryorn/pkg-info.el
+;; Package-Version: 20150517.1143
+;; Package-Commit: 76ba7415480687d05a4353b27fea2ae02b8d9d61
+;; Keywords: convenience
+;; Version: 0.7-cvs
+;; Package-Requires: ((epl "0.8"))
+
+;; This file is not part of GNU Emacs.
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library extracts information from installed packages.
+
+;;;; Functions:
+
+;; `pkg-info-library-version' extracts the version from the header of a library.
+;;
+;; `pkg-info-defining-library-version' extracts the version from the header of a
+;; library defining a function.
+;;
+;; `pkg-info-package-version' gets the version of an installed package.
+;;
+;; `pkg-info-format-version' formats a version list as human readable string.
+;;
+;; `pkg-info-version-info' returns complete version information for a specific
+;; package.
+;;
+;; `pkg-info-get-melpa-recipe' gets the MELPA recipe for a package.
+;;
+;; `pkg-info-get-melpa-fetcher' gets the fetcher used to build a package on
+;; MELPA.
+;;
+;; `pkg-info-wiki-package-p' determines whether a package was build from
+;; EmacsWiki on MELPA.
+
+;;; Code:
+
+(require 'epl)
+
+(require 'lisp-mnt)
+(require 'find-func)
+(require 'json) ; `json-read'
+(require 'url-http) ; `url-http-parse-response'
+
+(defvar url-http-end-of-headers)
+
+
+;;; Version information
+(defun pkg-info-format-version (version)
+ "Format VERSION as human-readable string.
+
+Return a human-readable string representing VERSION."
+ ;; XXX: Find a better, more flexible way of formatting?
+ (package-version-join version))
+
+(defsubst pkg-info--show-version-and-return (version show)
+ "Show and return VERSION.
+
+When SHOW is non-nil, show VERSION in minibuffer.
+
+Return VERSION."
+ (when show
+ (message (if (listp version) (pkg-info-format-version version) version)))
+ version)
+
+(defun pkg-info--read-library ()
+ "Read a library from minibuffer."
+ (completing-read "Load library: "
+ (apply-partially 'locate-file-completion-table
+ load-path
+ (get-load-suffixes))))
+
+(defun pkg-info--read-function ()
+ "Read a function name from minibuffer."
+ (let ((input (completing-read "Function: " obarray #'boundp :require-match)))
+ (if (string= input "") nil (intern input))))
+
+(defun pkg-info--read-package ()
+ "Read a package name from minibuffer."
+ (let* ((installed (epl-installed-packages))
+ (names (sort (mapcar (lambda (pkg)
+ (symbol-name (epl-package-name pkg)))
+ installed)
+ #'string<))
+ (default (car names)))
+ (completing-read "Installed package: " names nil 'require-match
+ nil nil default)))
+
+(defun pkg-info-library-source (library)
+ "Get the source file of LIBRARY.
+
+LIBRARY is either a symbol denoting a named feature, or a library
+name as string.
+
+Return the source file of LIBRARY as string."
+ (find-library-name (if (symbolp library) (symbol-name library) library)))
+
+(defun pkg-info-defining-library (function)
+ "Get the source file of the library defining FUNCTION.
+
+FUNCTION is a function symbol.
+
+Return the file name of the library as string. Signal an error
+if the library does not exist, or if the definition of FUNCTION
+was not found."
+ (unless (functionp function)
+ (signal 'wrong-type-argument (list 'functionp function)))
+ (let ((library (symbol-file function 'defun)))
+ (unless library
+ (error "Can't find definition of %s" function))
+ library))
+
+(defun pkg-info-x-original-version (file)
+ "Read the X-Original-Version header from FILE.
+
+Return the value as version list, or return nil if FILE lacks
+this header. Signal an error, if the value of the header is not
+a valid version."
+ (let ((version-str (with-temp-buffer
+ (insert-file-contents file)
+ (lm-header "X-Original-Version"))))
+ (when version-str
+ (version-to-list version-str))))
+
+;;;###autoload
+(defun pkg-info-library-original-version (library &optional show)
+ "Get the original version in the header of LIBRARY.
+
+The original version is stored in the X-Original-Version header.
+This header is added by the MELPA package archive to preserve
+upstream version numbers.
+
+LIBRARY is either a symbol denoting a named feature, or a library
+name as string.
+
+If SHOW is non-nil, show the version in the minibuffer.
+
+Return the version from the header of LIBRARY as list. Signal an
+error if the LIBRARY was not found or had no X-Original-Version
+header.
+
+See Info node `(elisp)Library Headers' for more information
+about library headers."
+ (interactive (list (pkg-info--read-library) t))
+ (let ((version (pkg-info-x-original-version
+ (pkg-info-library-source library))))
+ (if version
+ (pkg-info--show-version-and-return version show)
+ (error "Library %s has no original version" library))))
+
+;;;###autoload
+(defun pkg-info-library-version (library &optional show)
+ "Get the version in the header of LIBRARY.
+
+LIBRARY is either a symbol denoting a named feature, or a library
+name as string.
+
+If SHOW is non-nil, show the version in the minibuffer.
+
+Return the version from the header of LIBRARY as list. Signal an
+error if the LIBRARY was not found or had no proper header.
+
+See Info node `(elisp)Library Headers' for more information
+about library headers."
+ (interactive (list (pkg-info--read-library) t))
+ (let* ((source (pkg-info-library-source library))
+ (version (epl-package-version (epl-package-from-file source))))
+ (pkg-info--show-version-and-return version show)))
+
+;;;###autoload
+(defun pkg-info-defining-library-original-version (function &optional show)
+ "Get the original version of the library defining FUNCTION.
+
+The original version is stored in the X-Original-Version header.
+This header is added by the MELPA package archive to preserve
+upstream version numbers.
+
+If SHOW is non-nil, show the version in mini-buffer.
+
+This function is mainly intended to find the version of a major
+or minor mode, i.e.
+
+ (pkg-info-defining-library-version 'flycheck-mode)
+
+Return the version of the library defining FUNCTION. Signal an
+error if FUNCTION is not a valid function, if its defining
+library was not found, or if the library had no proper version
+header."
+ (interactive (list (pkg-info--read-function) t))
+ (pkg-info-library-original-version (pkg-info-defining-library function) show))
+
+;;;###autoload
+(defun pkg-info-defining-library-version (function &optional show)
+ "Get the version of the library defining FUNCTION.
+
+If SHOW is non-nil, show the version in mini-buffer.
+
+This function is mainly intended to find the version of a major
+or minor mode, i.e.
+
+ (pkg-info-defining-library-version 'flycheck-mode)
+
+Return the version of the library defining FUNCTION. Signal an
+error if FUNCTION is not a valid function, if its defining
+library was not found, or if the library had no proper version
+header."
+ (interactive (list (pkg-info--read-function) t))
+ (pkg-info-library-version (pkg-info-defining-library function) show))
+
+;;;###autoload
+(defun pkg-info-package-version (package &optional show)
+ "Get the version of an installed PACKAGE.
+
+If SHOW is non-nil, show the version in the minibuffer.
+
+Return the version as list, or nil if PACKAGE is not installed."
+ (interactive (list (pkg-info--read-package) t))
+ (let* ((name (if (stringp package) (intern package) package))
+ (package (car (epl-find-installed-packages name))))
+ (unless package
+ (error "Can't find installed package %s" name))
+ (pkg-info--show-version-and-return (epl-package-version package) show)))
+
+;;;###autoload
+(defun pkg-info-version-info (library &optional package show)
+ "Obtain complete version info for LIBRARY and PACKAGE.
+
+LIBRARY is a symbol denoting a named feature, or a library name
+as string. PACKAGE is a symbol denoting an ELPA package. If
+omitted or nil, default to LIBRARY.
+
+If SHOW is non-nil, show the version in the minibuffer.
+
+When called interactively, prompt for LIBRARY. When called
+interactively with prefix argument, prompt for PACKAGE as well.
+
+Return a string with complete version information for LIBRARY.
+This version information contains the version from the headers of
+LIBRARY, and the version of the installed PACKAGE, the LIBRARY is
+part of. If PACKAGE is not installed, or if the PACKAGE version
+is the same as the LIBRARY version, do not include a package
+version."
+ (interactive (list (pkg-info--read-library)
+ (when current-prefix-arg
+ (pkg-info--read-package))
+ t))
+ (let* ((package (or package (if (stringp library) (intern library) library)))
+ (orig-version (condition-case nil
+ (pkg-info-library-original-version library)
+ (error nil)))
+ ;; If we have X-Original-Version, we assume that MELPA replaced the
+ ;; library version with its generated version, so we use the
+ ;; X-Original-Version header instead, and ignore the library version
+ ;; header
+ (lib-version (or orig-version (pkg-info-library-version library)))
+ (pkg-version (condition-case nil
+ (pkg-info-package-version package)
+ (error nil)))
+ (version (if (and pkg-version
+ (not (version-list-= lib-version pkg-version)))
+ (format "%s (package: %s)"
+ (pkg-info-format-version lib-version)
+ (pkg-info-format-version pkg-version))
+ (pkg-info-format-version lib-version))))
+ (pkg-info--show-version-and-return version show)))
+
+(defconst pkg-info-melpa-recipe-url "http://melpa.org/recipes.json"
+ "The URL from which to fetch MELPA recipes.")
+
+(defvar pkg-info-melpa-recipes nil
+ "An alist of MELPA recipes.")
+
+(defun pkg-info-retrieve-melpa-recipes ()
+ "Retrieve MELPA recipes from MELPA archive."
+ (let ((buffer (url-retrieve-synchronously pkg-info-melpa-recipe-url)))
+ (with-current-buffer buffer
+ (unwind-protect
+ (let ((response-code (url-http-parse-response)))
+ (unless (equal response-code 200)
+ (error "Failed to retrieve MELPA recipes from %s (code %s)"
+ pkg-info-melpa-recipe-url response-code))
+ (goto-char url-http-end-of-headers)
+ (json-read))
+ (when (and buffer (buffer-live-p buffer))
+ (kill-buffer buffer))))))
+
+(defun pkg-info-get-melpa-recipes ()
+ "Get MELPA recipes."
+ (setq pkg-info-melpa-recipes
+ (or pkg-info-melpa-recipes
+ (pkg-info-retrieve-melpa-recipes))))
+
+(defun pkg-info-get-melpa-recipe (package)
+ "Get the MELPA recipe for PACKAGE.
+
+Return nil if PACKAGE is not on MELPA."
+ (cdr (assq package (pkg-info-get-melpa-recipes))))
+
+(defun pkg-info-get-melpa-fetcher (package)
+ "Get the MELPA fetcher for PACKAGE."
+ (cdr (assq 'fetcher (pkg-info-get-melpa-recipe package))))
+
+(defun pkg-info-wiki-package-p (package)
+ "Determine whether PACKAGE is build from the EmacsWiki."
+ (equal (pkg-info-get-melpa-fetcher package) "wiki"))
+
+(provide 'pkg-info)
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; coding: utf-8
+;; End:
+
+;;; pkg-info.el ends here
diff --git a/elpa/pkg-info-20150517.1143/pkg-info.elc b/elpa/pkg-info-20150517.1143/pkg-info.elc
new file mode 100644
index 0000000..5849937
--- /dev/null
+++ b/elpa/pkg-info-20150517.1143/pkg-info.elc
Binary files differ
diff --git a/elpa/projectile-20220313.1334/projectile-autoloads.el b/elpa/projectile-20220313.1334/projectile-autoloads.el
new file mode 100644
index 0000000..5012a7c
--- /dev/null
+++ b/elpa/projectile-20220313.1334/projectile-autoloads.el
@@ -0,0 +1,612 @@
+;;; projectile-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "projectile" "projectile.el" (0 0 0 0))
+;;; Generated autoloads from projectile.el
+
+(autoload 'projectile-version "projectile" "\
+Get the Projectile version as string.
+
+If called interactively or if SHOW-VERSION is non-nil, show the
+version in the echo area and the messages buffer.
+
+The returned string includes both, the version from package.el
+and the library version, if both a present and different.
+
+If the version number could not be determined, signal an error,
+if called interactively, or if SHOW-VERSION is non-nil, otherwise
+just return nil.
+
+\(fn &optional SHOW-VERSION)" t nil)
+
+(autoload 'projectile-invalidate-cache "projectile" "\
+Remove the current project's files from `projectile-projects-cache'.
+
+With a prefix argument PROMPT prompts for the name of the project whose cache
+to invalidate.
+
+\(fn PROMPT)" t nil)
+
+(autoload 'projectile-purge-file-from-cache "projectile" "\
+Purge FILE from the cache of the current project.
+
+\(fn FILE)" t nil)
+
+(autoload 'projectile-purge-dir-from-cache "projectile" "\
+Purge DIR from the cache of the current project.
+
+\(fn DIR)" t nil)
+
+(autoload 'projectile-cache-current-file "projectile" "\
+Add the currently visited file to the cache." t nil)
+
+(autoload 'projectile-discover-projects-in-directory "projectile" "\
+Discover any projects in DIRECTORY and add them to the projectile cache.
+
+If DEPTH is non-nil recursively descend exactly DEPTH levels below DIRECTORY and
+discover projects there.
+
+\(fn DIRECTORY &optional DEPTH)" t nil)
+
+(autoload 'projectile-discover-projects-in-search-path "projectile" "\
+Discover projects in `projectile-project-search-path'.
+Invoked automatically when `projectile-mode' is enabled." t nil)
+
+(autoload 'projectile-switch-to-buffer "projectile" "\
+Switch to a project buffer." t nil)
+
+(autoload 'projectile-switch-to-buffer-other-window "projectile" "\
+Switch to a project buffer and show it in another window." t nil)
+
+(autoload 'projectile-switch-to-buffer-other-frame "projectile" "\
+Switch to a project buffer and show it in another frame." t nil)
+
+(autoload 'projectile-display-buffer "projectile" "\
+Display a project buffer in another window without selecting it." t nil)
+
+(autoload 'projectile-project-buffers-other-buffer "projectile" "\
+Switch to the most recently selected buffer project buffer.
+Only buffers not visible in windows are returned." t nil)
+
+(autoload 'projectile-multi-occur "projectile" "\
+Do a `multi-occur' in the project's buffers.
+With a prefix argument, show NLINES of context.
+
+\(fn &optional NLINES)" t nil)
+
+(autoload 'projectile-find-other-file "projectile" "\
+Switch between files with the same name but different extensions.
+With FLEX-MATCHING, match any file that contains the base name of current file.
+Other file extensions can be customized with the variable
+`projectile-other-file-alist'.
+
+\(fn &optional FLEX-MATCHING)" t nil)
+
+(autoload 'projectile-find-other-file-other-window "projectile" "\
+Switch between files with different extensions in other window.
+Switch between files with the same name but different extensions in other
+window. With FLEX-MATCHING, match any file that contains the base name of
+current file. Other file extensions can be customized with the variable
+`projectile-other-file-alist'.
+
+\(fn &optional FLEX-MATCHING)" t nil)
+
+(autoload 'projectile-find-other-file-other-frame "projectile" "\
+Switch between files with different extensions in other frame.
+Switch between files with the same name but different extensions in other frame.
+With FLEX-MATCHING, match any file that contains the base name of current
+file. Other file extensions can be customized with the variable
+`projectile-other-file-alist'.
+
+\(fn &optional FLEX-MATCHING)" t nil)
+
+(autoload 'projectile-find-file-dwim "projectile" "\
+Jump to a project's files using completion based on context.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first.
+
+If point is on a filename, Projectile first tries to search for that
+file in project:
+
+- If it finds just a file, it switches to that file instantly. This works
+even if the filename is incomplete, but there's only a single file in the
+current project that matches the filename at point. For example, if
+there's only a single file named \"projectile/projectile.el\" but the
+current filename is \"projectile/proj\" (incomplete),
+`projectile-find-file-dwim' still switches to \"projectile/projectile.el\"
+immediately because this is the only filename that matches.
+
+- If it finds a list of files, the list is displayed for selecting. A list
+of files is displayed when a filename appears more than one in the project
+or the filename at point is a prefix of more than two files in a project.
+For example, if `projectile-find-file-dwim' is executed on a filepath like
+\"projectile/\", it lists the content of that directory. If it is executed
+on a partial filename like \"projectile/a\", a list of files with character
+'a' in that directory is presented.
+
+- If it finds nothing, display a list of all files in project for selecting.
+
+\(fn &optional INVALIDATE-CACHE)" t nil)
+
+(autoload 'projectile-find-file-dwim-other-window "projectile" "\
+Jump to a project's files using completion based on context in other window.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first.
+
+If point is on a filename, Projectile first tries to search for that
+file in project:
+
+- If it finds just a file, it switches to that file instantly. This works
+even if the filename is incomplete, but there's only a single file in the
+current project that matches the filename at point. For example, if
+there's only a single file named \"projectile/projectile.el\" but the
+current filename is \"projectile/proj\" (incomplete),
+`projectile-find-file-dwim-other-window' still switches to
+\"projectile/projectile.el\" immediately because this is the only filename
+that matches.
+
+- If it finds a list of files, the list is displayed for selecting. A list
+of files is displayed when a filename appears more than one in the project
+or the filename at point is a prefix of more than two files in a project.
+For example, if `projectile-find-file-dwim-other-window' is executed on a
+filepath like \"projectile/\", it lists the content of that directory. If
+it is executed on a partial filename like \"projectile/a\", a list of files
+with character 'a' in that directory is presented.
+
+- If it finds nothing, display a list of all files in project for selecting.
+
+\(fn &optional INVALIDATE-CACHE)" t nil)
+
+(autoload 'projectile-find-file-dwim-other-frame "projectile" "\
+Jump to a project's files using completion based on context in other frame.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first.
+
+If point is on a filename, Projectile first tries to search for that
+file in project:
+
+- If it finds just a file, it switches to that file instantly. This works
+even if the filename is incomplete, but there's only a single file in the
+current project that matches the filename at point. For example, if
+there's only a single file named \"projectile/projectile.el\" but the
+current filename is \"projectile/proj\" (incomplete),
+`projectile-find-file-dwim-other-frame' still switches to
+\"projectile/projectile.el\" immediately because this is the only filename
+that matches.
+
+- If it finds a list of files, the list is displayed for selecting. A list
+of files is displayed when a filename appears more than one in the project
+or the filename at point is a prefix of more than two files in a project.
+For example, if `projectile-find-file-dwim-other-frame' is executed on a
+filepath like \"projectile/\", it lists the content of that directory. If
+it is executed on a partial filename like \"projectile/a\", a list of files
+with character 'a' in that directory is presented.
+
+- If it finds nothing, display a list of all files in project for selecting.
+
+\(fn &optional INVALIDATE-CACHE)" t nil)
+
+(autoload 'projectile-find-file "projectile" "\
+Jump to a project's file using completion.
+With a prefix arg INVALIDATE-CACHE invalidates the cache first.
+
+\(fn &optional INVALIDATE-CACHE)" t nil)
+
+(autoload 'projectile-find-file-other-window "projectile" "\
+Jump to a project's file using completion and show it in another window.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first.
+
+\(fn &optional INVALIDATE-CACHE)" t nil)
+
+(autoload 'projectile-find-file-other-frame "projectile" "\
+Jump to a project's file using completion and show it in another frame.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first.
+
+\(fn &optional INVALIDATE-CACHE)" t nil)
+
+(autoload 'projectile-toggle-project-read-only "projectile" "\
+Toggle project read only." t nil)
+
+(autoload 'projectile-find-dir "projectile" "\
+Jump to a project's directory using completion.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first.
+
+\(fn &optional INVALIDATE-CACHE)" t nil)
+
+(autoload 'projectile-find-dir-other-window "projectile" "\
+Jump to a project's directory in other window using completion.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first.
+
+\(fn &optional INVALIDATE-CACHE)" t nil)
+
+(autoload 'projectile-find-dir-other-frame "projectile" "\
+Jump to a project's directory in other frame using completion.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first.
+
+\(fn &optional INVALIDATE-CACHE)" t nil)
+
+(autoload 'projectile-find-test-file "projectile" "\
+Jump to a project's test file using completion.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first.
+
+\(fn &optional INVALIDATE-CACHE)" t nil)
+
+(autoload 'projectile-find-related-file-other-window "projectile" "\
+Open related file in other window." t nil)
+
+(autoload 'projectile-find-related-file-other-frame "projectile" "\
+Open related file in other frame." t nil)
+
+(autoload 'projectile-find-related-file "projectile" "\
+Open related file." t nil)
+
+(autoload 'projectile-related-files-fn-groups "projectile" "\
+Generate a related-files-fn which relates as KIND for files in each of GROUPS.
+
+\(fn KIND GROUPS)" nil nil)
+
+(autoload 'projectile-related-files-fn-extensions "projectile" "\
+Generate a related-files-fn which relates as KIND for files having EXTENSIONS.
+
+\(fn KIND EXTENSIONS)" nil nil)
+
+(autoload 'projectile-related-files-fn-test-with-prefix "projectile" "\
+Generate a related-files-fn which relates tests and impl.
+Use files with EXTENSION based on TEST-PREFIX.
+
+\(fn EXTENSION TEST-PREFIX)" nil nil)
+
+(autoload 'projectile-related-files-fn-test-with-suffix "projectile" "\
+Generate a related-files-fn which relates tests and impl.
+Use files with EXTENSION based on TEST-SUFFIX.
+
+\(fn EXTENSION TEST-SUFFIX)" nil nil)
+
+(autoload 'projectile-project-info "projectile" "\
+Display info for current project." t nil)
+
+(autoload 'projectile-find-implementation-or-test-other-window "projectile" "\
+Open matching implementation or test file in other window." t nil)
+
+(autoload 'projectile-find-implementation-or-test-other-frame "projectile" "\
+Open matching implementation or test file in other frame." t nil)
+
+(autoload 'projectile-toggle-between-implementation-and-test "projectile" "\
+Toggle between an implementation file and its test file." t nil)
+
+(autoload 'projectile-grep "projectile" "\
+Perform rgrep in the project.
+
+With a prefix ARG asks for files (globbing-aware) which to grep in.
+With prefix ARG of `-' (such as `M--'), default the files (without prompt),
+to `projectile-grep-default-files'.
+
+With REGEXP given, don't query the user for a regexp.
+
+\(fn &optional REGEXP ARG)" t nil)
+
+(autoload 'projectile-ag "projectile" "\
+Run an ag search with SEARCH-TERM in the project.
+
+With an optional prefix argument ARG SEARCH-TERM is interpreted as a
+regular expression.
+
+\(fn SEARCH-TERM &optional ARG)" t nil)
+
+(autoload 'projectile-ripgrep "projectile" "\
+Run a ripgrep (rg) search with `SEARCH-TERM' at current project root.
+
+With an optional prefix argument ARG SEARCH-TERM is interpreted as a
+regular expression.
+
+This command depends on of the Emacs packages ripgrep or rg being
+installed to work.
+
+\(fn SEARCH-TERM &optional ARG)" t nil)
+
+(autoload 'projectile-regenerate-tags "projectile" "\
+Regenerate the project's [e|g]tags." t nil)
+
+(autoload 'projectile-find-tag "projectile" "\
+Find tag in project." t nil)
+
+(autoload 'projectile-run-command-in-root "projectile" "\
+Invoke `execute-extended-command' in the project's root." t nil)
+
+(autoload 'projectile-run-shell-command-in-root "projectile" "\
+Invoke `shell-command' in the project's root.
+
+\(fn COMMAND &optional OUTPUT-BUFFER ERROR-BUFFER)" t nil)
+
+(autoload 'projectile-run-async-shell-command-in-root "projectile" "\
+Invoke `async-shell-command' in the project's root.
+
+\(fn COMMAND &optional OUTPUT-BUFFER ERROR-BUFFER)" t nil)
+
+(autoload 'projectile-run-gdb "projectile" "\
+Invoke `gdb' in the project's root." t nil)
+
+(autoload 'projectile-run-shell "projectile" "\
+Invoke `shell' in the project's root.
+
+Switch to the project specific shell buffer if it already exists.
+
+Use a prefix argument ARG to indicate creation of a new process instead.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'projectile-run-eshell "projectile" "\
+Invoke `eshell' in the project's root.
+
+Switch to the project specific eshell buffer if it already exists.
+
+Use a prefix argument ARG to indicate creation of a new process instead.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'projectile-run-ielm "projectile" "\
+Invoke `ielm' in the project's root.
+
+Switch to the project specific ielm buffer if it already exists.
+
+Use a prefix argument ARG to indicate creation of a new process instead.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'projectile-run-term "projectile" "\
+Invoke `term' in the project's root.
+
+Switch to the project specific term buffer if it already exists.
+
+Use a prefix argument ARG to indicate creation of a new process instead.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'projectile-run-vterm "projectile" "\
+Invoke `vterm' in the project's root.
+
+Switch to the project specific term buffer if it already exists.
+
+Use a prefix argument ARG to indicate creation of a new process instead.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'projectile-replace "projectile" "\
+Replace literal string in project using non-regexp `tags-query-replace'.
+
+With a prefix argument ARG prompts you for a directory on which
+to run the replacement.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'projectile-replace-regexp "projectile" "\
+Replace a regexp in the project using `tags-query-replace'.
+
+With a prefix argument ARG prompts you for a directory on which
+to run the replacement.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'projectile-kill-buffers "projectile" "\
+Kill project buffers.
+
+The buffer are killed according to the value of
+`projectile-kill-buffers-filter'." t nil)
+
+(autoload 'projectile-save-project-buffers "projectile" "\
+Save all project buffers." t nil)
+
+(autoload 'projectile-dired "projectile" "\
+Open `dired' at the root of the project." t nil)
+
+(autoload 'projectile-dired-other-window "projectile" "\
+Open `dired' at the root of the project in another window." t nil)
+
+(autoload 'projectile-dired-other-frame "projectile" "\
+Open `dired' at the root of the project in another frame." t nil)
+
+(autoload 'projectile-vc "projectile" "\
+Open `vc-dir' at the root of the project.
+
+For git projects `magit-status-internal' is used if available.
+For hg projects `monky-status' is used if available.
+
+If PROJECT-ROOT is given, it is opened instead of the project
+root directory of the current buffer file. If interactively
+called with a prefix argument, the user is prompted for a project
+directory to open.
+
+\(fn &optional PROJECT-ROOT)" t nil)
+
+(autoload 'projectile-recentf "projectile" "\
+Show a list of recently visited files in a project." t nil)
+
+(autoload 'projectile-configure-project "projectile" "\
+Run project configure command.
+
+Normally you'll be prompted for a compilation command, unless
+variable `compilation-read-command'. You can force the prompt
+with a prefix ARG.
+
+\(fn ARG)" t nil)
+
+(autoload 'projectile-compile-project "projectile" "\
+Run project compilation command.
+
+Normally you'll be prompted for a compilation command, unless
+variable `compilation-read-command'. You can force the prompt
+with a prefix ARG.
+
+\(fn ARG)" t nil)
+
+(autoload 'projectile-test-project "projectile" "\
+Run project test command.
+
+Normally you'll be prompted for a compilation command, unless
+variable `compilation-read-command'. You can force the prompt
+with a prefix ARG.
+
+\(fn ARG)" t nil)
+
+(autoload 'projectile-install-project "projectile" "\
+Run project install command.
+
+Normally you'll be prompted for a compilation command, unless
+variable `compilation-read-command'. You can force the prompt
+with a prefix ARG.
+
+\(fn ARG)" t nil)
+
+(autoload 'projectile-package-project "projectile" "\
+Run project package command.
+
+Normally you'll be prompted for a compilation command, unless
+variable `compilation-read-command'. You can force the prompt
+with a prefix ARG.
+
+\(fn ARG)" t nil)
+
+(autoload 'projectile-run-project "projectile" "\
+Run project run command.
+
+Normally you'll be prompted for a compilation command, unless
+variable `compilation-read-command'. You can force the prompt
+with a prefix ARG.
+
+\(fn ARG)" t nil)
+
+(autoload 'projectile-repeat-last-command "projectile" "\
+Run last projectile external command.
+
+External commands are: `projectile-configure-project',
+`projectile-compile-project', `projectile-test-project',
+`projectile-install-project', `projectile-package-project',
+and `projectile-run-project'.
+
+If the prefix argument SHOW_PROMPT is non nil, the command can be edited.
+
+\(fn SHOW-PROMPT)" t nil)
+
+(autoload 'projectile-switch-project "projectile" "\
+Switch to a project we have visited before.
+Invokes the command referenced by `projectile-switch-project-action' on switch.
+With a prefix ARG invokes `projectile-commander' instead of
+`projectile-switch-project-action.'
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'projectile-switch-open-project "projectile" "\
+Switch to a project we have currently opened.
+Invokes the command referenced by `projectile-switch-project-action' on switch.
+With a prefix ARG invokes `projectile-commander' instead of
+`projectile-switch-project-action.'
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'projectile-find-file-in-directory "projectile" "\
+Jump to a file in a (maybe regular) DIRECTORY.
+
+This command will first prompt for the directory the file is in.
+
+\(fn &optional DIRECTORY)" t nil)
+
+(autoload 'projectile-find-file-in-known-projects "projectile" "\
+Jump to a file in any of the known projects." t nil)
+
+(autoload 'projectile-cleanup-known-projects "projectile" "\
+Remove known projects that don't exist anymore." t nil)
+
+(autoload 'projectile-clear-known-projects "projectile" "\
+Clear both `projectile-known-projects' and `projectile-known-projects-file'." t nil)
+
+(autoload 'projectile-reset-known-projects "projectile" "\
+Clear known projects and rediscover." t nil)
+
+(autoload 'projectile-remove-known-project "projectile" "\
+Remove PROJECT from the list of known projects.
+
+\(fn &optional PROJECT)" t nil)
+
+(autoload 'projectile-remove-current-project-from-known-projects "projectile" "\
+Remove the current project from the list of known projects." t nil)
+
+(autoload 'projectile-add-known-project "projectile" "\
+Add PROJECT-ROOT to the list of known projects.
+
+\(fn PROJECT-ROOT)" t nil)
+
+(autoload 'projectile-ibuffer "projectile" "\
+Open an IBuffer window showing all buffers in the current project.
+
+Let user choose another project when PROMPT-FOR-PROJECT is supplied.
+
+\(fn PROMPT-FOR-PROJECT)" t nil)
+
+(autoload 'projectile-commander "projectile" "\
+Execute a Projectile command with a single letter.
+The user is prompted for a single character indicating the action to invoke.
+The `?' character describes then
+available actions.
+
+See `def-projectile-commander-method' for defining new methods." t nil)
+
+(autoload 'projectile-browse-dirty-projects "projectile" "\
+Browse dirty version controlled projects.
+
+With a prefix argument, or if CACHED is non-nil, try to use the cached
+dirty project list.
+
+\(fn &optional CACHED)" t nil)
+
+(autoload 'projectile-edit-dir-locals "projectile" "\
+Edit or create a .dir-locals.el file of the project." t nil)
+
+(defvar projectile-mode nil "\
+Non-nil if Projectile mode is enabled.
+See the `projectile-mode' command
+for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `projectile-mode'.")
+
+(custom-autoload 'projectile-mode "projectile" nil)
+
+(autoload 'projectile-mode "projectile" "\
+Minor mode to assist project management and navigation.
+
+When called interactively, toggle `projectile-mode'. With prefix
+ARG, enable `projectile-mode' if ARG is positive, otherwise disable
+it.
+
+When called from Lisp, enable `projectile-mode' if ARG is omitted,
+nil or positive. If ARG is `toggle', toggle `projectile-mode'.
+Otherwise behave as if called interactively.
+
+\\{projectile-mode-map}
+
+\(fn &optional ARG)" t nil)
+
+(define-obsolete-function-alias 'projectile-global-mode 'projectile-mode "1.0")
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "projectile" '("??" "compilation-find-file-projectile-find-compilation-buffer" "def-projectile-commander-method" "delete-file-projectile-remove-from-cache" "projectile-")))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; projectile-autoloads.el ends here
diff --git a/elpa/projectile-20220313.1334/projectile-pkg.el b/elpa/projectile-20220313.1334/projectile-pkg.el
new file mode 100644
index 0000000..bf96a44
--- /dev/null
+++ b/elpa/projectile-20220313.1334/projectile-pkg.el
@@ -0,0 +1,2 @@
+;;; Generated package description from projectile.el -*- no-byte-compile: t -*-
+(define-package "projectile" "20220313.1334" "Manage and navigate projects in Emacs easily" '((emacs "25.1")) :commit "20df208385ce7b80207602c9931e31094eca85fb" :authors '(("Bozhidar Batsov" . "bozhidar@batsov.dev")) :maintainer '("Bozhidar Batsov" . "bozhidar@batsov.dev") :keywords '("project" "convenience") :url "https://github.com/bbatsov/projectile")
diff --git a/elpa/projectile-20220313.1334/projectile.el b/elpa/projectile-20220313.1334/projectile.el
new file mode 100644
index 0000000..0c7c7c1
--- /dev/null
+++ b/elpa/projectile-20220313.1334/projectile.el
@@ -0,0 +1,5746 @@
+;;; projectile.el --- Manage and navigate projects in Emacs easily -*- lexical-binding: t -*-
+
+;; Copyright © 2011-2021 Bozhidar Batsov <bozhidar@batsov.dev>
+
+;; Author: Bozhidar Batsov <bozhidar@batsov.dev>
+;; URL: https://github.com/bbatsov/projectile
+;; Package-Version: 20220313.1334
+;; Package-Commit: 20df208385ce7b80207602c9931e31094eca85fb
+;; Keywords: project, convenience
+;; Version: 2.6.0-snapshot
+;; Package-Requires: ((emacs "25.1"))
+
+;; This file is NOT part of GNU Emacs.
+
+;; This program 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, or (at your option)
+;; any later version.
+;;
+;; This program 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; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+;;
+;; This library provides easy project management and navigation. The
+;; concept of a project is pretty basic - just a folder containing
+;; special file. Currently git, mercurial and bazaar repos are
+;; considered projects by default. If you want to mark a folder
+;; manually as a project just create an empty .projectile file in
+;; it. See the README for more details.
+;;
+;;; Code:
+
+(require 'cl-lib)
+(require 'thingatpt)
+(require 'ibuffer)
+(require 'ibuf-ext)
+(require 'compile)
+(require 'grep)
+(require 'lisp-mnt)
+(eval-when-compile
+ (require 'find-dired)
+ (require 'subr-x))
+
+;;; Declarations
+;;
+;; A bunch of variable and function declarations
+;; needed to appease the byte-compiler.
+(defvar ido-mode)
+(defvar ivy-mode)
+(defvar helm-mode)
+(defvar ag-ignore-list)
+(defvar ggtags-completion-table)
+(defvar tags-completion-table)
+(defvar tags-loop-scan)
+(defvar tags-loop-operate)
+(defvar eshell-buffer-name)
+(defvar explicit-shell-file-name)
+(defvar grep-files-aliases)
+(defvar grep-find-ignored-directories)
+(defvar grep-find-ignored-files)
+
+(declare-function tags-completion-table "etags")
+(declare-function make-term "term")
+(declare-function term-mode "term")
+(declare-function term-char-mode "term")
+(declare-function term-ansi-make-term "term")
+(declare-function eshell-search-path "esh-ext")
+(declare-function vc-dir "vc-dir")
+(declare-function vc-dir-busy "vc-dir")
+(declare-function string-trim "subr-x")
+(declare-function fileloop-continue "fileloop")
+(declare-function fileloop-initialize-replace "fileloop")
+(declare-function tramp-archive-file-name-p "tramp-archive")
+
+(declare-function ggtags-ensure-project "ext:ggtags")
+(declare-function ggtags-update-tags "ext:ggtags")
+(declare-function ripgrep-regexp "ext:ripgrep")
+(declare-function rg-run "ext:rg")
+(declare-function vterm "ext:vterm")
+(declare-function vterm-send-return "ext:vterm")
+(declare-function vterm-send-string "ext:vterm")
+
+;;; Customization
+(defgroup projectile nil
+ "Manage and navigate projects easily."
+ :group 'tools
+ :group 'convenience
+ :link '(url-link :tag "GitHub" "https://github.com/bbatsov/projectile")
+ :link '(url-link :tag "Online Manual" "https://docs.projectile.mx/")
+ :link '(emacs-commentary-link :tag "Commentary" "projectile"))
+
+(defcustom projectile-indexing-method (if (eq system-type 'windows-nt) 'native 'alien)
+ "Specifies the indexing method used by Projectile.
+
+There are three indexing methods - native, hybrid and alien.
+
+The native method is implemented in Emacs Lisp (therefore it is
+native to Emacs). Its advantage is that it is portable and will
+work everywhere that Emacs does. Its disadvantage is that it is a
+bit slow (especially for large projects). Generally it's a good
+idea to pair the native indexing method with caching.
+
+The hybrid indexing method uses external tools (e.g. git, find,
+etc) to speed up the indexing process. Still, the files will be
+post-processed by Projectile for sorting/filtering purposes.
+In this sense that approach is a hybrid between native indexing
+and alien indexing.
+
+The alien indexing method optimizes to the limit the speed
+of the hybrid indexing method. This means that Projectile will
+not do any processing of the files returned by the external
+commands and you're going to get the maximum performance
+possible. This behaviour makes a lot of sense for most people,
+as they'd typically be putting ignores in their VCS config and
+won't care about any additional ignores/unignores/sorting that
+Projectile might also provide.
+
+The disadvantage of the hybrid and alien methods is that they are not well
+supported on Windows systems. That's why by default alien indexing is the
+default on all operating systems, except Windows."
+ :group 'projectile
+ :type '(radio
+ (const :tag "Native" native)
+ (const :tag "Hybrid" hybrid)
+ (const :tag "Alien" alien)))
+
+(defcustom projectile-enable-caching (eq projectile-indexing-method 'native)
+ "When t enables project files caching.
+
+Project caching is automatically enabled by default if you're
+using the native indexing method."
+ :group 'projectile
+ :type 'boolean)
+
+(defcustom projectile-kill-buffers-filter 'kill-all
+ "Determine which buffers are killed by `projectile-kill-buffers'.
+
+When the kill-all option is selected, kills each buffer.
+
+When the kill-only-files option is selected, kill only the buffer
+associated to a file.
+
+Otherwise, it should be a predicate that takes one argument: the buffer to
+be killed."
+ :group 'projectile
+ :type '(radio
+ (const :tag "All project buffers" kill-all)
+ (const :tag "Project file buffers" kill-only-files)
+ (function :tag "Predicate")))
+
+(defcustom projectile-file-exists-local-cache-expire nil
+ "Number of seconds before the local file existence cache expires.
+Local refers to a file on a local file system.
+
+A value of nil disables this cache.
+See `projectile-file-exists-p' for details."
+ :group 'projectile
+ :type '(choice (const :tag "Disabled" nil)
+ (integer :tag "Seconds")))
+
+(defcustom projectile-file-exists-remote-cache-expire (* 5 60)
+ "Number of seconds before the remote file existence cache expires.
+Remote refers to a file on a remote file system such as tramp.
+
+A value of nil disables this cache.
+See `projectile-file-exists-p' for details."
+ :group 'projectile
+ :type '(choice (const :tag "Disabled" nil)
+ (integer :tag "Seconds")))
+
+(defcustom projectile-files-cache-expire nil
+ "Number of seconds before project files list cache expires.
+
+A value of nil means the cache never expires."
+ :group 'projectile
+ :type '(choice (const :tag "Disabled" nil)
+ (integer :tag "Seconds")))
+
+(defcustom projectile-auto-discover t
+ "Whether to discover projects when `projectile-mode' is activated."
+ :group 'projectile
+ :type 'boolean
+ :package-version '(projectile . "2.3.0"))
+
+(defcustom projectile-auto-update-cache t
+ "Whether cache is automatically updated when files are opened or deleted."
+ :group 'projectile
+ :type 'boolean)
+
+(defcustom projectile-require-project-root 'prompt
+ "Require the presence of a project root to operate when true.
+When set to 'prompt Projectile will ask you to select a project
+directory if you're not in a project.
+
+When nil Projectile will consider the current directory the project root."
+ :group 'projectile
+ :type '(choice (const :tag "No" nil)
+ (const :tag "Yes" t)
+ (const :tag "Prompt for project" prompt)))
+
+(defcustom projectile-completion-system 'auto
+ "The completion system to be used by Projectile."
+ :group 'projectile
+ :type '(radio
+ (const :tag "Auto-detect" auto)
+ (const :tag "Ido" ido)
+ (const :tag "Helm" helm)
+ (const :tag "Ivy" ivy)
+ (const :tag "Default" default)
+ (function :tag "Custom function")))
+
+(defcustom projectile-keymap-prefix nil
+ "Projectile keymap prefix."
+ :group 'projectile
+ :type 'string)
+
+(make-obsolete-variable 'projectile-keymap-prefix "Use (define-key projectile-mode-map (kbd ...) 'projectile-command-map) instead." "2.0.0")
+
+(defcustom projectile-cache-file
+ (expand-file-name "projectile.cache" user-emacs-directory)
+ "The name of Projectile's cache file."
+ :group 'projectile
+ :type 'string)
+
+(defcustom projectile-tags-file-name "TAGS"
+ "The tags filename Projectile's going to use."
+ :group 'projectile
+ :type 'string)
+
+(defcustom projectile-tags-command "ctags -Re -f \"%s\" %s \"%s\""
+ "The command Projectile's going to use to generate a TAGS file."
+ :group 'projectile
+ :type 'string)
+
+(defcustom projectile-tags-backend 'auto
+ "The tag backend that Projectile should use.
+
+If set to 'auto', `projectile-find-tag' will automatically choose
+which backend to use. Preference order is ggtags -> xref
+-> etags-select -> `find-tag'. Variable can also be set to specify which
+backend to use. If selected backend is unavailable, fall back to
+`find-tag'.
+
+If this variable is set to 'auto' and ggtags is available, or if
+set to 'ggtags', then ggtags will be used for
+`projectile-regenerate-tags'. For all other settings
+`projectile-tags-command' will be used."
+ :group 'projectile
+ :type '(radio
+ (const :tag "auto" auto)
+ (const :tag "xref" xref)
+ (const :tag "ggtags" ggtags)
+ (const :tag "etags" etags-select)
+ (const :tag "standard" find-tag))
+ :package-version '(projectile . "0.14.0"))
+
+(defcustom projectile-sort-order 'default
+ "The sort order used for a project's files.
+
+Note that files aren't sorted if `projectile-indexing-method'
+is set to 'alien'."
+ :group 'projectile
+ :type '(radio
+ (const :tag "Default (no sorting)" default)
+ (const :tag "Recently opened files" recentf)
+ (const :tag "Recently active buffers, then recently opened files" recently-active)
+ (const :tag "Access time (atime)" access-time)
+ (const :tag "Modification time (mtime)" modification-time)))
+
+(defcustom projectile-verbose t
+ "Echo messages that are not errors."
+ :group 'projectile
+ :type 'boolean)
+
+(defcustom projectile-buffers-filter-function nil
+ "A function used to filter the buffers in `projectile-project-buffers'.
+
+The function should accept and return a list of Emacs buffers.
+Two example filter functions are shipped by default -
+`projectile-buffers-with-file' and
+`projectile-buffers-with-file-or-process'."
+ :group 'projectile
+ :type 'function)
+
+(defcustom projectile-project-name nil
+ "If this value is non-nil, it will be used as project name.
+
+It has precedence over function `projectile-project-name-function'."
+ :group 'projectile
+ :type 'string
+ :package-version '(projectile . "0.14.0"))
+
+(defcustom projectile-project-name-function 'projectile-default-project-name
+ "A function that receives the project-root and returns the project name.
+
+If variable `projectile-project-name' is non-nil, this function will not be
+used."
+ :group 'projectile
+ :type 'function
+ :package-version '(projectile . "0.14.0"))
+
+(defcustom projectile-project-root-files
+ '(
+ "GTAGS" ; GNU Global tags
+ "TAGS" ; etags/ctags are usually in the root of project
+ "configure.ac" ; autoconf new style
+ "configure.in" ; autoconf old style
+ "cscope.out" ; cscope
+ )
+ "A list of files considered to mark the root of a project.
+The topmost match has precedence.
+See `projectile-register-project-type'."
+ :group 'projectile
+ :type '(repeat string))
+
+(defcustom projectile-project-root-files-bottom-up
+ '(".projectile" ; projectile project marker
+ ".git" ; Git VCS root dir
+ ".hg" ; Mercurial VCS root dir
+ ".fslckout" ; Fossil VCS root dir
+ "_FOSSIL_" ; Fossil VCS root DB on Windows
+ ".bzr" ; Bazaar VCS root dir
+ "_darcs" ; Darcs VCS root dir
+ ".pijul" ; Pijul VCS root dir
+ )
+ "A list of files considered to mark the root of a project.
+The bottommost (parentmost) match has precedence."
+ :group 'projectile
+ :type '(repeat string))
+
+(defcustom projectile-project-root-files-top-down-recurring
+ '(".svn" ; Svn VCS root dir
+ "CVS" ; Csv VCS root dir
+ "Makefile")
+ "A list of files considered to mark the root of a project.
+The search starts at the top and descends down till a directory
+that contains a match file but its parent does not. Thus, it's a
+bottommost match in the topmost sequence of directories
+containing a root file."
+ :group 'projectile
+ :type '(repeat string))
+
+(define-obsolete-variable-alias 'projectile-project-root-files-functions 'projectile-project-root-functions "2.4")
+
+(defcustom projectile-project-root-functions
+ '(projectile-root-local
+ projectile-root-bottom-up
+ projectile-root-top-down
+ projectile-root-top-down-recurring)
+ "A list of functions for finding project root folders.
+The functions will be ran until one of them returns a project folder.
+Reordering the default functions will alter the project discovery
+algorithm."
+ :group 'projectile
+ :type '(repeat function))
+
+(defcustom projectile-dirconfig-comment-prefix
+ nil
+ "Projectile config file (.projectile) comment start marker.
+If specified, starting a line in a project's .projectile file with this
+character marks that line as a comment instead of a pattern.
+Similar to '#' in .gitignore files."
+ :group 'projectile
+ :type 'character
+ :package-version '(projectile . "2.2.0"))
+
+(defcustom projectile-globally-ignored-files
+ (list projectile-tags-file-name)
+ "A list of files globally ignored by projectile.
+Note that files aren't filtered if `projectile-indexing-method'
+is set to 'alien'."
+ :group 'projectile
+ :type '(repeat string))
+
+(defcustom projectile-globally-unignored-files nil
+ "A list of files globally unignored by projectile.
+Regular expressions can be used.
+Note that files aren't filtered if `projectile-indexing-method'
+is set to 'alien'."
+ :group 'projectile
+ :type '(repeat string)
+ :package-version '(projectile . "0.14.0"))
+
+(defcustom projectile-globally-ignored-file-suffixes
+ nil
+ "A list of file suffixes globally ignored by projectile.
+Note that files aren't filtered if `projectile-indexing-method'
+is set to 'alien'."
+ :group 'projectile
+ :type '(repeat string))
+
+(defcustom projectile-globally-ignored-directories
+ '(".idea"
+ ".vscode"
+ ".ensime_cache"
+ ".eunit"
+ ".git"
+ ".hg"
+ ".fslckout"
+ "_FOSSIL_"
+ ".bzr"
+ "_darcs"
+ ".pijul"
+ ".tox"
+ ".svn"
+ ".stack-work"
+ ".ccls-cache"
+ ".cache"
+ ".clangd")
+ "A list of directories globally ignored by projectile.
+Regular expressions can be used.
+
+Strings that don't start with * are only ignored at the top level
+of the project. Strings that start with * are ignored everywhere
+in the project, as if there was no *. So note that * when used as
+a prefix is not a wildcard; it is an indicator that the directory
+should be ignored at all levels, not just root.
+
+Examples: \"tmp\" ignores only ./tmp at the top level of the
+project, but not ./src/tmp. \"*tmp\" will ignore both ./tmp and
+./src/tmp, but not ./not-a-tmp or ./src/not-a-tmp.
+
+Note that files aren't filtered if `projectile-indexing-method'
+is set to 'alien'."
+ :safe (lambda (x) (not (remq t (mapcar #'stringp x))))
+ :group 'projectile
+ :type '(repeat string))
+
+(defcustom projectile-globally-unignored-directories nil
+ "A list of directories globally unignored by projectile.
+Note that files aren't filtered if `projectile-indexing-method'
+is set to 'alien'."
+ :group 'projectile
+ :type '(repeat string)
+ :package-version '(projectile . "0.14.0"))
+
+(defcustom projectile-globally-ignored-modes
+ '("erc-mode"
+ "help-mode"
+ "completion-list-mode"
+ "Buffer-menu-mode"
+ "gnus-.*-mode"
+ "occur-mode")
+ "A list of regular expressions for major modes ignored by projectile.
+
+If a buffer is using a given major mode, projectile will ignore
+it for functions working with buffers."
+ :group 'projectile
+ :type '(repeat string))
+
+(defcustom projectile-globally-ignored-buffers nil
+ "A list of buffer-names ignored by projectile.
+
+You can use either exact buffer names or regular expressions.
+If a buffer is in the list projectile will ignore it for
+functions working with buffers."
+ :group 'projectile
+ :type '(repeat string)
+ :package-version '(projectile . "0.12.0"))
+
+(defcustom projectile-find-file-hook nil
+ "Hooks run when a file is opened with `projectile-find-file'."
+ :group 'projectile
+ :type 'hook)
+
+(defcustom projectile-find-dir-hook nil
+ "Hooks run when a directory is opened with `projectile-find-dir'."
+ :group 'projectile
+ :type 'hook)
+
+(defcustom projectile-switch-project-action 'projectile-find-file
+ "Action invoked after switching projects with `projectile-switch-project'.
+
+Any function that does not take arguments will do."
+ :group 'projectile
+ :type 'function)
+
+(defcustom projectile-find-dir-includes-top-level nil
+ "If true, add top-level dir to options offered by `projectile-find-dir'."
+ :group 'projectile
+ :type 'boolean)
+
+(defcustom projectile-use-git-grep nil
+ "If true, use `vc-git-grep' in git projects."
+ :group 'projectile
+ :type 'boolean)
+
+(defcustom projectile-grep-finished-hook nil
+ "Hooks run when `projectile-grep' finishes."
+ :group 'projectile
+ :type 'hook
+ :package-version '(projectile . "0.14.0"))
+
+(defcustom projectile-test-prefix-function 'projectile-test-prefix
+ "Function to find test files prefix based on PROJECT-TYPE."
+ :group 'projectile
+ :type 'function)
+
+(defcustom projectile-test-suffix-function 'projectile-test-suffix
+ "Function to find test files suffix based on PROJECT-TYPE."
+ :group 'projectile
+ :type 'function)
+
+(defcustom projectile-related-files-fn-function 'projectile-related-files-fn
+ "Function to find related files based on PROJECT-TYPE."
+ :group 'projectile
+ :type 'function)
+
+(defcustom projectile-dynamic-mode-line t
+ "If true, update the mode-line dynamically.
+Only file buffers are affected by this, as the update happens via
+`find-file-hook'.
+
+See also `projectile-mode-line-function' and `projectile-update-mode-line'."
+ :group 'projectile
+ :type 'boolean
+ :package-version '(projectile . "2.0.0"))
+
+(defcustom projectile-mode-line-function 'projectile-default-mode-line
+ "The function to use to generate project-specific mode-line.
+The default function adds the project name and type to the mode-line.
+See also `projectile-update-mode-line'."
+ :group 'projectile
+ :type 'function
+ :package-version '(projectile . "2.0.0"))
+
+
+;;; Idle Timer
+(defvar projectile-idle-timer nil
+ "The timer object created when `projectile-enable-idle-timer' is non-nil.")
+
+(defcustom projectile-idle-timer-seconds 30
+ "The idle period to use when `projectile-enable-idle-timer' is non-nil."
+ :group 'projectile
+ :type 'number)
+
+(defcustom projectile-idle-timer-hook '(projectile-regenerate-tags)
+ "The hook run when `projectile-enable-idle-timer' is non-nil."
+ :group 'projectile
+ :type '(repeat symbol))
+
+(defcustom projectile-enable-idle-timer nil
+ "Enables idle timer hook `projectile-idle-timer-functions'.
+
+When `projectile-enable-idle-timer' is non-nil, the hook
+`projectile-idle-timer-hook' is run each time Emacs has been idle
+for `projectile-idle-timer-seconds' seconds and we're in a
+project."
+ :group 'projectile
+ :set (lambda (symbol value)
+ (set symbol value)
+ (when projectile-idle-timer
+ (cancel-timer projectile-idle-timer))
+ (setq projectile-idle-timer nil)
+ (when projectile-enable-idle-timer
+ (setq projectile-idle-timer (run-with-idle-timer
+ projectile-idle-timer-seconds t
+ (lambda ()
+ (when (projectile-project-p)
+ (run-hooks 'projectile-idle-timer-hook)))))))
+ :type 'boolean)
+
+(defvar projectile-projects-cache nil
+ "A hashmap used to cache project file names to speed up related operations.")
+
+(defvar projectile-projects-cache-time nil
+ "A hashmap used to record when we populated `projectile-projects-cache'.")
+
+(defvar projectile-project-root-cache (make-hash-table :test 'equal)
+ "Cached value of function `projectile-project-root`.")
+
+(defvar projectile-project-type-cache (make-hash-table :test 'equal)
+ "A hashmap used to cache project type to speed up related operations.")
+
+(defvar projectile-known-projects nil
+ "List of locations where we have previously seen projects.
+The list of projects is ordered by the time they have been accessed.
+
+See also `projectile-remove-known-project',
+`projectile-cleanup-known-projects' and `projectile-clear-known-projects'.")
+
+(defvar projectile-known-projects-on-file nil
+ "List of known projects reference point.
+
+Contains a copy of `projectile-known-projects' when it was last
+synchronized with `projectile-known-projects-file'.")
+
+(defcustom projectile-known-projects-file
+ (expand-file-name "projectile-bookmarks.eld"
+ user-emacs-directory)
+ "Name and location of the Projectile's known projects file."
+ :group 'projectile
+ :type 'string)
+
+(defcustom projectile-ignored-projects nil
+ "A list of projects not to be added to `projectile-known-projects'."
+ :group 'projectile
+ :type '(repeat :tag "Project list" directory)
+ :package-version '(projectile . "0.11.0"))
+
+(defcustom projectile-ignored-project-function nil
+ "Function to decide if a project is added to `projectile-known-projects'.
+
+Can be either nil, or a function that takes the truename of the
+project root as argument and returns non-nil if the project is to
+be ignored or nil otherwise.
+
+This function is only called if the project is not listed in
+the variable `projectile-ignored-projects'.
+
+A suitable candidate would be `file-remote-p' to ignore remote
+projects."
+ :group 'projectile
+ :type '(choice
+ (const :tag "Nothing" nil)
+ (const :tag "Remote files" file-remote-p)
+ function)
+ :package-version '(projectile . "0.13.0"))
+
+(defcustom projectile-track-known-projects-automatically t
+ "Controls whether Projectile will automatically register known projects.
+
+When set to nil you'll have always add projects explicitly with
+`projectile-add-known-project'."
+ :group 'projectile
+ :type 'boolean
+ :package-version '(projectile . "1.0.0"))
+
+(defcustom projectile-project-search-path nil
+ "List of folders where projectile is automatically going to look for projects.
+You can think of something like $PATH, but for projects instead of executables.
+Examples of such paths might be ~/projects, ~/work, (~/github . 1) etc.
+
+For elements of form (DIRECTORY . DEPTH), DIRECTORY has to be a
+directory and DEPTH an integer that specifies the depth at which to
+look for projects. A DEPTH of 0 means check DIRECTORY. A depth of 1
+means check all the subdirectories of DIRECTORY. Etc."
+ :group 'projectile
+ :type '(repeat (choice directory (cons directory (integer :tag "Depth"))))
+ :package-version '(projectile . "1.0.0"))
+
+(defcustom projectile-git-command "git ls-files -zco --exclude-standard"
+ "Command used by projectile to get the files in a git project."
+ :group 'projectile
+ :type 'string)
+
+(defcustom projectile-git-submodule-command "git submodule --quiet foreach 'echo $displaypath' | tr '\\n' '\\0'"
+ "Command used by projectile to list submodules of a given git repository.
+Set to nil to disable listing submodules contents."
+ :group 'projectile
+ :type 'string)
+
+(defcustom projectile-git-ignored-command "git ls-files -zcoi --exclude-standard"
+ "Command used by projectile to get the ignored files in a git project."
+ :group 'projectile
+ :type 'string
+ :package-version '(projectile . "0.14.0"))
+
+(defcustom projectile-hg-command "hg locate -f -0 -I ."
+ "Command used by projectile to get the files in a hg project."
+ :group 'projectile
+ :type 'string)
+
+(defcustom projectile-fossil-command (concat "fossil ls | "
+ (when (string-equal system-type
+ "windows-nt")
+ "dos2unix | ")
+ "tr '\\n' '\\0'")
+ "Command used by projectile to get the files in a fossil project."
+ :group 'projectile
+ :type 'string)
+
+(defcustom projectile-bzr-command "bzr ls -R --versioned -0"
+ "Command used by projectile to get the files in a bazaar project."
+ :group 'projectile
+ :type 'string)
+
+(defcustom projectile-darcs-command "darcs show files -0 . "
+ "Command used by projectile to get the files in a darcs project."
+ :group 'projectile
+ :type 'string)
+
+(defcustom projectile-pijul-command "pijul list | tr '\\n' '\\0'"
+ "Command used by projectile to get the files in a pijul project."
+ :group 'projectile
+ :type 'string)
+
+(defcustom projectile-svn-command "svn list -R . | grep -v '$/' | tr '\\n' '\\0'"
+ "Command used by projectile to get the files in a svn project."
+ :group 'projectile
+ :type 'string)
+
+(defcustom projectile-generic-command
+ (cond
+ ;; we prefer fd over find
+ ((executable-find "fd")
+ "fd . -0 --type f --color=never")
+ ;; fd's executable is named fdfind is some Linux distros (e.g. Ubuntu)
+ ((executable-find "fdfind")
+ "fdfind . -0 --type f --color=never")
+ ;; with find we have to be careful to strip the ./ from the paths
+ ;; see https://stackoverflow.com/questions/2596462/how-to-strip-leading-in-unix-find
+ (t "find . -type f | cut -c3- | tr '\\n' '\\0'"))
+ "Command used by projectile to get the files in a generic project."
+ :group 'projectile
+ :type 'string)
+
+(defcustom projectile-vcs-dirty-state '("edited" "unregistered" "needs-update" "needs-merge" "unlocked-changes" "conflict")
+ "List of states checked by `projectile-browse-dirty-projects'.
+Possible checked states are:
+\"edited\", \"unregistered\", \"needs-update\", \"needs-merge\",
+\"unlocked-changes\" and \"conflict\",
+as defined in `vc.el'."
+ :group 'projectile
+ :type '(repeat (string))
+ :package-version '(projectile . "1.0.0"))
+
+(defcustom projectile-other-file-alist
+ '( ;; handle C/C++ extensions
+ ("cpp" . ("h" "hpp" "ipp"))
+ ("ipp" . ("h" "hpp" "cpp"))
+ ("hpp" . ("h" "ipp" "cpp" "cc"))
+ ("cxx" . ("h" "hxx" "ixx"))
+ ("ixx" . ("h" "hxx" "cxx"))
+ ("hxx" . ("h" "ixx" "cxx"))
+ ("c" . ("h"))
+ ("m" . ("h"))
+ ("mm" . ("h"))
+ ("h" . ("c" "cc" "cpp" "ipp" "hpp" "cxx" "ixx" "hxx" "m" "mm"))
+ ("cc" . ("h" "hh" "hpp"))
+ ("hh" . ("cc"))
+
+ ;; OCaml extensions
+ ("ml" . ("mli"))
+ ("mli" . ("ml" "mll" "mly"))
+ ("mll" . ("mli"))
+ ("mly" . ("mli"))
+ ("eliomi" . ("eliom"))
+ ("eliom" . ("eliomi"))
+
+ ;; vertex shader and fragment shader extensions in glsl
+ ("vert" . ("frag"))
+ ("frag" . ("vert"))
+
+ ;; handle files with no extension
+ (nil . ("lock" "gpg"))
+ ("lock" . (""))
+ ("gpg" . (""))
+ )
+ "Alist of extensions for switching to file with the same name,
+ using other extensions based on the extension of current
+ file."
+ :type 'alist)
+
+(defcustom projectile-create-missing-test-files nil
+ "During toggling, if non-nil enables creating test files if not found.
+
+When not-nil, every call to projectile-find-implementation-or-test-*
+creates test files if not found on the file system. Defaults to nil.
+It assumes the test/ folder is at the same level as src/."
+ :group 'projectile
+ :type 'boolean)
+
+(defcustom projectile-per-project-compilation-buffer nil
+ "When non-nil, the compilation command makes the per-project compilation buffer."
+ :group 'projectile
+ :type 'boolean
+ :package-version '(projectile . "2.6.0"))
+
+(defcustom projectile-after-switch-project-hook nil
+ "Hooks run right after project is switched."
+ :group 'projectile
+ :type 'hook)
+
+(defcustom projectile-before-switch-project-hook nil
+ "Hooks run when right before project is switched."
+ :group 'projectile
+ :type 'hook)
+
+(defcustom projectile-current-project-on-switch 'remove
+ "Determines whether to display current project when switching projects.
+
+When set to 'remove current project is not included, 'move-to-end
+will display current project and the end of the list of known
+projects, 'keep will leave the current project at the default
+position."
+ :group 'projectile
+ :type '(radio
+ (const :tag "Remove" remove)
+ (const :tag "Move to end" move-to-end)
+ (const :tag "Keep" keep)))
+
+(defcustom projectile-max-file-buffer-count nil
+ "Maximum number of file buffers per project that are kept open.
+
+If the value is nil, there is no limit to the opend buffers count."
+ :group 'projectile
+ :type 'integer
+ :package-version '(projectile . "2.2.0"))
+
+
+;;; Version information
+
+(defconst projectile-version
+ (eval-when-compile
+ (lm-version (or load-file-name buffer-file-name)))
+ "The current version of Projectile.")
+
+;;;###autoload
+(defun projectile-version (&optional show-version)
+ "Get the Projectile version as string.
+
+If called interactively or if SHOW-VERSION is non-nil, show the
+version in the echo area and the messages buffer.
+
+The returned string includes both, the version from package.el
+and the library version, if both a present and different.
+
+If the version number could not be determined, signal an error,
+if called interactively, or if SHOW-VERSION is non-nil, otherwise
+just return nil."
+ (interactive (list t))
+ (if show-version
+ (message "Projectile %s" projectile-version)
+ projectile-version))
+
+;;; Misc utility functions
+(defun projectile-difference (list1 list2)
+ (cl-remove-if
+ (lambda (x) (member x list2))
+ list1))
+
+(defun projectile-unixy-system-p ()
+ "Check to see if unixy text utilities are installed."
+ (cl-every
+ (lambda (x) (executable-find x))
+ '("grep" "cut" "uniq")))
+
+(defun projectile-symbol-or-selection-at-point ()
+ "Get the symbol or selected text at point."
+ (if (use-region-p)
+ (buffer-substring-no-properties (region-beginning) (region-end))
+ (projectile-symbol-at-point)))
+
+(defun projectile-symbol-at-point ()
+ "Get the symbol at point and strip its properties."
+ (substring-no-properties (or (thing-at-point 'symbol) "")))
+
+(defun projectile-generate-process-name (process make-new &optional project)
+ "Infer the buffer name for PROCESS or generate a new one if MAKE-NEW is true.
+The function operates on the current project by default, but you can also
+specify a project explicitly via the optional PROJECT param."
+ (let* ((project (or project (projectile-acquire-root)))
+ (base-name (format "*%s %s*" process (projectile-project-name project))))
+ (if make-new
+ (generate-new-buffer-name base-name)
+ base-name)))
+
+
+;;; Serialization
+(defun projectile-serialize (data filename)
+ "Serialize DATA to FILENAME.
+
+The saved data can be restored with `projectile-unserialize'."
+ (if (file-writable-p filename)
+ (with-temp-file filename
+ (insert (let (print-length) (prin1-to-string data))))
+ (message "Projectile cache '%s' not writeable" filename)))
+
+(defun projectile-unserialize (filename)
+ "Read data serialized by `projectile-serialize' from FILENAME."
+ (with-demoted-errors
+ "Error during file deserialization: %S"
+ (when (file-exists-p filename)
+ (with-temp-buffer
+ (insert-file-contents filename)
+ ;; this will blow up if the contents of the file aren't
+ ;; lisp data structures
+ (read (buffer-string))))))
+
+
+;;; Caching
+(defvar projectile-file-exists-cache
+ (make-hash-table :test 'equal)
+ "Cached `projectile-file-exists-p' results.")
+
+(defvar projectile-file-exists-cache-timer nil
+ "Timer for scheduling`projectile-file-exists-cache-cleanup'.")
+
+(defun projectile-file-exists-cache-cleanup ()
+ "Removed timed out cache entries and reschedules or remove the
+timer if no more items are in the cache."
+ (let ((now (current-time)))
+ (maphash (lambda (key value)
+ (if (time-less-p (cdr value) now)
+ (remhash key projectile-file-exists-cache)))
+ projectile-file-exists-cache)
+ (setq projectile-file-exists-cache-timer
+ (if (> (hash-table-count projectile-file-exists-cache) 0)
+ (run-with-timer 10 nil 'projectile-file-exists-cache-cleanup)))))
+
+(defun projectile-file-exists-p (filename)
+ "Return t if file FILENAME exist.
+A wrapper around `file-exists-p' with additional caching support."
+ (let* ((file-remote (file-remote-p filename))
+ (expire-seconds
+ (if file-remote
+ (and projectile-file-exists-remote-cache-expire
+ (> projectile-file-exists-remote-cache-expire 0)
+ projectile-file-exists-remote-cache-expire)
+ (and projectile-file-exists-local-cache-expire
+ (> projectile-file-exists-local-cache-expire 0)
+ projectile-file-exists-local-cache-expire)))
+ (remote-file-name-inhibit-cache (if expire-seconds
+ expire-seconds
+ remote-file-name-inhibit-cache)))
+ (if (not expire-seconds)
+ (file-exists-p filename)
+ (let* ((current-time (current-time))
+ (cached (gethash filename projectile-file-exists-cache))
+ (cached-value (if cached (car cached)))
+ (cached-expire (if cached (cdr cached)))
+ (cached-expired (if cached (time-less-p cached-expire current-time) t))
+ (value (or (and (not cached-expired) cached-value)
+ (if (file-exists-p filename) 'found 'notfound))))
+ (when (or (not cached) cached-expired)
+ (puthash filename
+ (cons value (time-add current-time (seconds-to-time expire-seconds)))
+ projectile-file-exists-cache))
+ (unless projectile-file-exists-cache-timer
+ (setq projectile-file-exists-cache-timer
+ (run-with-timer 10 nil 'projectile-file-exists-cache-cleanup)))
+ (equal value 'found)))))
+
+;;;###autoload
+(defun projectile-invalidate-cache (prompt)
+ "Remove the current project's files from `projectile-projects-cache'.
+
+With a prefix argument PROMPT prompts for the name of the project whose cache
+to invalidate."
+ (interactive "P")
+ (let ((project-root
+ (if prompt
+ (completing-read "Remove cache for: "
+ (hash-table-keys projectile-projects-cache))
+ (projectile-acquire-root))))
+ (setq projectile-project-root-cache (make-hash-table :test 'equal))
+ (remhash project-root projectile-project-type-cache)
+ (remhash project-root projectile-projects-cache)
+ (remhash project-root projectile-projects-cache-time)
+ (projectile-serialize-cache)
+ (when projectile-verbose
+ (message "Invalidated Projectile cache for %s."
+ (propertize project-root 'face 'font-lock-keyword-face))))
+ (when (fboundp 'recentf-cleanup)
+ (recentf-cleanup)))
+
+(defun projectile-time-seconds ()
+ "Return the number of seconds since the unix epoch."
+ (if (fboundp 'time-convert)
+ (time-convert nil 'integer)
+ (cl-destructuring-bind (high low _usec _psec) (current-time)
+ (+ (lsh high 16) low))))
+
+(defun projectile-cache-project (project files)
+ "Cache PROJECTs FILES.
+The cache is created both in memory and on the hard drive."
+ (when projectile-enable-caching
+ (puthash project files projectile-projects-cache)
+ (puthash project (projectile-time-seconds) projectile-projects-cache-time)
+ (projectile-serialize-cache)))
+
+;;;###autoload
+(defun projectile-purge-file-from-cache (file)
+ "Purge FILE from the cache of the current project."
+ (interactive
+ (list (projectile-completing-read
+ "Remove file from cache: "
+ (projectile-current-project-files))))
+ (let* ((project-root (projectile-project-root))
+ (project-cache (gethash project-root projectile-projects-cache)))
+ (if (projectile-file-cached-p file project-root)
+ (progn
+ (puthash project-root (remove file project-cache) projectile-projects-cache)
+ (projectile-serialize-cache)
+ (when projectile-verbose
+ (message "%s removed from cache" file)))
+ (error "%s is not in the cache" file))))
+
+;;;###autoload
+(defun projectile-purge-dir-from-cache (dir)
+ "Purge DIR from the cache of the current project."
+ (interactive
+ (list (projectile-completing-read
+ "Remove directory from cache: "
+ (projectile-current-project-dirs))))
+ (let* ((project-root (projectile-project-root))
+ (project-cache (gethash project-root projectile-projects-cache)))
+ (puthash project-root
+ (cl-remove-if (lambda (str) (string-prefix-p dir str)) project-cache)
+ projectile-projects-cache)))
+
+(defun projectile-file-cached-p (file project)
+ "Check if FILE is already in PROJECT cache."
+ (member file (gethash project projectile-projects-cache)))
+
+;;;###autoload
+(defun projectile-cache-current-file ()
+ "Add the currently visited file to the cache."
+ (interactive)
+ (let ((current-project (projectile-project-root)))
+ (when (and (buffer-file-name) (gethash (projectile-project-root) projectile-projects-cache))
+ (let* ((abs-current-file (file-truename (buffer-file-name)))
+ (current-file (file-relative-name abs-current-file current-project)))
+ (unless (or (projectile-file-cached-p current-file current-project)
+ (projectile-ignored-directory-p (file-name-directory abs-current-file))
+ (projectile-ignored-file-p abs-current-file))
+ (puthash current-project
+ (cons current-file (gethash current-project projectile-projects-cache))
+ projectile-projects-cache)
+ (projectile-serialize-cache)
+ (message "File %s added to project %s cache."
+ (propertize current-file 'face 'font-lock-keyword-face)
+ (propertize current-project 'face 'font-lock-keyword-face)))))))
+
+;; cache opened files automatically to reduce the need for cache invalidation
+(defun projectile-cache-files-find-file-hook ()
+ "Function for caching files with `find-file-hook'."
+ (let ((project-root (projectile-project-p)))
+ (when (and projectile-enable-caching
+ project-root
+ (not (projectile-ignored-project-p project-root)))
+ (projectile-cache-current-file))))
+
+(defun projectile-track-known-projects-find-file-hook ()
+ "Function for caching projects with `find-file-hook'."
+ (when (and projectile-track-known-projects-automatically (projectile-project-p))
+ (projectile-add-known-project (projectile-project-root))))
+
+(defun projectile-maybe-invalidate-cache (force)
+ "Invalidate if FORCE or project's dirconfig newer than cache."
+ (when (or force (file-newer-than-file-p (projectile-dirconfig-file)
+ projectile-cache-file))
+ (projectile-invalidate-cache nil)))
+
+;;;###autoload
+(defun projectile-discover-projects-in-directory (directory &optional depth)
+ "Discover any projects in DIRECTORY and add them to the projectile cache.
+
+If DEPTH is non-nil recursively descend exactly DEPTH levels below DIRECTORY and
+discover projects there."
+ (interactive
+ (list (read-directory-name "Starting directory: ")))
+
+ (if (file-directory-p directory)
+ (if (and (numberp depth) (> depth 0))
+ ;; Ignore errors when listing files in the directory, because
+ ;; sometimes that directory is an unreadable one at the root of a
+ ;; volume. This is the case, for example, on macOS with the
+ ;; .Spotlight-V100 directory.
+ (dolist (dir (ignore-errors (directory-files directory t)))
+ (when (and (file-directory-p dir)
+ (not (member (file-name-nondirectory dir) '(".." "."))))
+ (projectile-discover-projects-in-directory dir (1- depth))))
+ (when (projectile-project-p directory)
+ (let ((dir (abbreviate-file-name (projectile-project-root directory))))
+ (unless (member dir projectile-known-projects)
+ (projectile-add-known-project dir)))))
+ (message "Project search path directory %s doesn't exist" directory)))
+
+;;;###autoload
+(defun projectile-discover-projects-in-search-path ()
+ "Discover projects in `projectile-project-search-path'.
+Invoked automatically when `projectile-mode' is enabled."
+ (interactive)
+ (dolist (path projectile-project-search-path)
+ (if (consp path)
+ (projectile-discover-projects-in-directory (car path) (cdr path))
+ (projectile-discover-projects-in-directory path 1))))
+
+
+(defun delete-file-projectile-remove-from-cache (filename &optional _trash)
+ (if (and projectile-enable-caching projectile-auto-update-cache (projectile-project-p))
+ (let* ((project-root (projectile-project-root))
+ (true-filename (file-truename filename))
+ (relative-filename (file-relative-name true-filename project-root)))
+ (if (projectile-file-cached-p relative-filename project-root)
+ (projectile-purge-file-from-cache relative-filename)))))
+
+
+;;; Project root related utilities
+(defun projectile-parent (path)
+ "Return the parent directory of PATH.
+PATH may be a file or directory and directory paths may end with a slash."
+ (directory-file-name (file-name-directory (directory-file-name (expand-file-name path)))))
+
+(defun projectile-locate-dominating-file (file name)
+ "Look up the directory hierarchy from FILE for a directory containing NAME.
+Stop at the first parent directory containing a file NAME,
+and return the directory. Return nil if not found.
+Instead of a string, NAME can also be a predicate taking one argument
+\(a directory) and returning a non-nil value if that directory is the one for
+which we're looking."
+ ;; copied from files.el (stripped comments) emacs-24 bzr branch 2014-03-28 10:20
+ (setq file (abbreviate-file-name file))
+ (let ((root nil)
+ try)
+ (while (not (or root
+ (null file)
+ (string-match locate-dominating-stop-dir-regexp file)))
+ (setq try (if (stringp name)
+ (projectile-file-exists-p (expand-file-name name file))
+ (funcall name file)))
+ (cond (try (setq root file))
+ ((equal file (setq file (file-name-directory
+ (directory-file-name file))))
+ (setq file nil))))
+ (and root (expand-file-name (file-name-as-directory root)))))
+
+(defvar-local projectile-project-root nil
+ "Defines a custom Projectile project root.
+This is intended to be used as a file local variable.")
+
+(defun projectile-root-local (_dir)
+ "A simple wrapper around the variable `projectile-project-root'."
+ projectile-project-root)
+
+(defun projectile-root-top-down (dir &optional list)
+ "Identify a project root in DIR by top-down search for files in LIST.
+If LIST is nil, use `projectile-project-root-files' instead.
+Return the first (topmost) matched directory or nil if not found."
+ (projectile-locate-dominating-file
+ dir
+ (lambda (dir)
+ (cl-find-if (lambda (f) (projectile-file-exists-p (expand-file-name f dir)))
+ (or list projectile-project-root-files)))))
+
+(defun projectile-root-bottom-up (dir &optional list)
+ "Identify a project root in DIR by bottom-up search for files in LIST.
+If LIST is nil, use `projectile-project-root-files-bottom-up' instead.
+Return the first (bottommost) matched directory or nil if not found."
+ (cl-some (lambda (name) (projectile-locate-dominating-file dir name))
+ (or list projectile-project-root-files-bottom-up)))
+
+(defun projectile-root-top-down-recurring (dir &optional list)
+ "Identify a project root in DIR by recurring top-down search for files in LIST.
+If LIST is nil, use `projectile-project-root-files-top-down-recurring'
+instead. Return the last (bottommost) matched directory in the
+topmost sequence of matched directories. Nil otherwise."
+ (cl-some
+ (lambda (f)
+ (projectile-locate-dominating-file
+ dir
+ (lambda (dir)
+ (and (projectile-file-exists-p (expand-file-name f dir))
+ (or (string-match locate-dominating-stop-dir-regexp (projectile-parent dir))
+ (not (projectile-file-exists-p (expand-file-name f (projectile-parent dir)))))))))
+ (or list projectile-project-root-files-top-down-recurring)))
+
+(defun projectile-project-root (&optional dir)
+ "Retrieves the root directory of a project if available.
+If DIR is not supplied its set to the current directory by default."
+ ;; the cached value will be 'none in the case of no project root (this is to
+ ;; ensure it is not reevaluated each time when not inside a project) so use
+ ;; cl-subst to replace this 'none value with nil so a nil value is used
+ ;; instead
+ (let ((dir (or dir default-directory)))
+ ;; Back out of any archives, the project will live on the outside and
+ ;; searching them is slow.
+ (when (and (fboundp 'tramp-archive-file-name-archive)
+ (tramp-archive-file-name-p dir))
+ (setq dir (file-name-directory (tramp-archive-file-name-archive dir))))
+ (cl-subst nil 'none
+ ;; The `is-local' and `is-connected' variables are
+ ;; used to fix the behavior where Emacs hangs
+ ;; because of Projectile when you open a file over
+ ;; TRAMP. It basically prevents Projectile from
+ ;; trying to find information about files for which
+ ;; it's not possible to get that information right
+ ;; now.
+ (or (let ((is-local (not (file-remote-p dir))) ;; `true' if the file is local
+ (is-connected (file-remote-p dir nil t))) ;; `true' if the file is remote AND we are connected to the remote
+ (when (or is-local is-connected)
+ ;; Here is where all the magic happens.
+ ;; We run the functions in `projectile-project-root-functions' until we find a project dir.
+ (cl-some
+ (lambda (func)
+ (let* ((cache-key (format "%s-%s" func dir))
+ (cache-value (gethash cache-key projectile-project-root-cache)))
+ (if (and cache-value (file-exists-p cache-value))
+ cache-value
+ (let ((value (funcall func (file-truename dir))))
+ (puthash cache-key value projectile-project-root-cache)
+ value))))
+ projectile-project-root-functions)))
+ ;; set cached to none so is non-nil so we don't try
+ ;; and look it up again
+ 'none))))
+
+(defun projectile-ensure-project (dir)
+ "Ensure that DIR is non-nil.
+Useful for commands that expect the presence of a project.
+Controlled by `projectile-require-project-root'.
+
+See also `projectile-acquire-root'."
+ (if dir
+ dir
+ (cond
+ ((eq projectile-require-project-root 'prompt) (projectile-completing-read
+ "Switch to project: " projectile-known-projects))
+ (projectile-require-project-root (error "Projectile cannot find a project definition in %s" default-directory))
+ (t default-directory))))
+
+(defun projectile-acquire-root (&optional dir)
+ "Find the current project root, and prompts the user for it if that fails.
+Provides the common idiom (projectile-ensure-project (projectile-project-root)).
+Starts the search for the project with DIR."
+ (projectile-ensure-project (projectile-project-root dir)))
+
+(defun projectile-project-p (&optional dir)
+ "Check if DIR is a project.
+Defaults to the current directory if not provided
+explicitly."
+ (projectile-project-root (or dir default-directory)))
+
+(defun projectile-default-project-name (project-root)
+ "Default function used to create the project name.
+The project name is based on the value of PROJECT-ROOT."
+ (file-name-nondirectory (directory-file-name project-root)))
+
+(defun projectile-project-name (&optional project)
+ "Return project name.
+If PROJECT is not specified acts on the current project."
+ (or projectile-project-name
+ (let ((project-root (or project (projectile-project-root))))
+ (if project-root
+ (funcall projectile-project-name-function project-root)
+ "-"))))
+
+
+;;; Project indexing
+(defun projectile-get-project-directories (project-dir)
+ "Get the list of PROJECT-DIR directories that are of interest to the user."
+ (mapcar (lambda (subdir) (concat project-dir subdir))
+ (or (nth 0 (projectile-parse-dirconfig-file)) '(""))))
+
+(defun projectile--directory-p (directory)
+ "Checks if DIRECTORY is a string designating a valid directory."
+ (and (stringp directory) (file-directory-p directory)))
+
+(defun projectile-dir-files (directory)
+ "List the files in DIRECTORY and in its sub-directories.
+Files are returned as relative paths to DIRECTORY."
+ (unless (projectile--directory-p directory)
+ (error "Directory %S does not exist" directory))
+ ;; check for a cache hit first if caching is enabled
+ (let ((files-list (and projectile-enable-caching
+ (gethash directory projectile-projects-cache))))
+ ;; cache disabled or cache miss
+ (or files-list
+ (let ((vcs (projectile-project-vcs directory)))
+ (pcase projectile-indexing-method
+ ('native (projectile-dir-files-native directory))
+ ;; use external tools to get the project files
+ ('hybrid (projectile-adjust-files directory vcs (projectile-dir-files-alien directory)))
+ ('alien (projectile-dir-files-alien directory))
+ (_ (user-error "Unsupported indexing method `%S'" projectile-indexing-method)))))))
+
+;;; Native Project Indexing
+;;
+;; This corresponds to `projectile-indexing-method' being set to native.
+(defun projectile-dir-files-native (directory)
+ "Get the files for ROOT under DIRECTORY using just Emacs Lisp."
+ (let ((progress-reporter
+ (make-progress-reporter
+ (format "Projectile is indexing %s"
+ (propertize directory 'face 'font-lock-keyword-face)))))
+ ;; we need the files with paths relative to the project root
+ (mapcar (lambda (file) (file-relative-name file directory))
+ (projectile-index-directory directory (projectile-filtering-patterns)
+ progress-reporter))))
+
+(defun projectile-index-directory (directory patterns progress-reporter &optional ignored-files ignored-directories globally-ignored-directories)
+ "Index DIRECTORY taking into account PATTERNS.
+
+The function calls itself recursively until all sub-directories
+have been indexed. The PROGRESS-REPORTER is updated while the
+function is executing. The list of IGNORED-FILES and
+IGNORED-DIRECTORIES may optionally be provided."
+ ;; we compute the ignored files and directories only once and then we reuse the
+ ;; pre-computed values in the subsequent recursive invocations of the function
+ (let ((ignored-files (or ignored-files (projectile-ignored-files)))
+ (ignored-directories (or ignored-directories (projectile-ignored-directories)))
+ (globally-ignored-directories (or globally-ignored-directories (projectile-globally-ignored-directory-names))))
+ (apply #'append
+ (mapcar
+ (lambda (f)
+ (let ((local-f (file-name-nondirectory (directory-file-name f))))
+ (unless (or (and patterns (projectile-ignored-rel-p f directory patterns))
+ (member local-f '("." "..")))
+ (progress-reporter-update progress-reporter)
+ (if (file-directory-p f)
+ (unless (projectile-ignored-directory-p
+ (file-name-as-directory f)
+ ignored-directories
+ local-f
+ globally-ignored-directories)
+ (projectile-index-directory f patterns progress-reporter ignored-files ignored-directories globally-ignored-directories))
+ (unless (projectile-ignored-file-p f ignored-files)
+ (list f))))))
+ (directory-files directory t)))))
+
+;;; Alien Project Indexing
+;;
+;; This corresponds to `projectile-indexing-method' being set to hybrid or alien.
+;; The only difference between the two methods is that alien doesn't do
+;; any post-processing of the files obtained via the external command.
+(defun projectile-dir-files-alien (directory)
+ "Get the files for DIRECTORY using external tools."
+ (let ((vcs (projectile-project-vcs directory)))
+ (cond
+ ((eq vcs 'git)
+ (nconc (projectile-files-via-ext-command directory (projectile-get-ext-command vcs))
+ (projectile-get-sub-projects-files directory vcs)))
+ (t (projectile-files-via-ext-command directory (projectile-get-ext-command vcs))))))
+
+(define-obsolete-function-alias 'projectile-dir-files-external 'projectile-dir-files-alien "2.0.0")
+(define-obsolete-function-alias 'projectile-get-repo-files 'projectile-dir-files-alien "2.0.0")
+
+(defun projectile-get-ext-command (vcs)
+ "Determine which external command to invoke based on the project's VCS.
+Fallback to a generic command when not in a VCS-controlled project."
+ (pcase vcs
+ ('git projectile-git-command)
+ ('hg projectile-hg-command)
+ ('fossil projectile-fossil-command)
+ ('bzr projectile-bzr-command)
+ ('darcs projectile-darcs-command)
+ ('pijul projectile-pijul-command)
+ ('svn projectile-svn-command)
+ (_ projectile-generic-command)))
+
+(defun projectile-get-sub-projects-command (vcs)
+ "Get the sub-projects command for VCS.
+Currently that's supported just for Git (sub-projects being Git
+sub-modules there)."
+ (pcase vcs
+ ('git projectile-git-submodule-command)
+ (_ "")))
+
+(defun projectile-get-ext-ignored-command (vcs)
+ "Determine which external command to invoke based on the project's VCS."
+ (pcase vcs
+ ('git projectile-git-ignored-command)
+ ;; TODO: Add support for other VCS
+ (_ nil)))
+
+(defun projectile-flatten (lst)
+ "Take a nested list LST and return its contents as a single, flat list."
+ (if (and (listp lst) (listp (cdr lst)))
+ (cl-mapcan 'projectile-flatten lst)
+ (list lst)))
+
+(defun projectile-get-all-sub-projects (project)
+ "Get all sub-projects for a given project.
+
+PROJECT is base directory to start search recursively."
+ (let ((submodules (projectile-get-immediate-sub-projects project)))
+ (cond
+ ((null submodules)
+ nil)
+ (t
+ (nconc submodules (projectile-flatten
+ ;; recursively get sub-projects of each sub-project
+ (mapcar (lambda (s)
+ (projectile-get-all-sub-projects s)) submodules)))))))
+
+(defun projectile-get-immediate-sub-projects (path)
+ "Get immediate sub-projects for a given project without recursing.
+
+PATH is the vcs root or project root from which to start
+searching, and should end with an appropriate path delimiter, such as
+'/' or a '\\'.
+
+If the vcs get-sub-projects query returns results outside of path,
+they are excluded from the results of this function."
+ (let* ((vcs (projectile-project-vcs path))
+ ;; search for sub-projects under current project `project'
+ (submodules (mapcar
+ (lambda (s)
+ (file-name-as-directory (expand-file-name s path)))
+ (projectile-files-via-ext-command path (projectile-get-sub-projects-command vcs))))
+ (project-child-folder-regex
+ (concat "\\`"
+ (regexp-quote path))))
+
+ ;; If project root is inside of an VCS folder, but not actually an
+ ;; VCS root itself, submodules external to the project will be
+ ;; included in the VCS get sub-projects result. Let's remove them.
+ (cl-remove-if-not
+ (lambda (submodule)
+ (string-match-p project-child-folder-regex
+ submodule))
+ submodules)))
+
+(defun projectile-get-sub-projects-files (project-root _vcs)
+ "Get files from sub-projects for PROJECT-ROOT recursively."
+ (projectile-flatten
+ (mapcar (lambda (sub-project)
+ (let ((project-relative-path
+ (file-name-as-directory (file-relative-name
+ sub-project project-root))))
+ (mapcar (lambda (file)
+ (concat project-relative-path file))
+ ;; TODO: Seems we forgot git hardcoded here
+ (projectile-files-via-ext-command sub-project projectile-git-command))))
+ (projectile-get-all-sub-projects project-root))))
+
+(defun projectile-get-repo-ignored-files (project vcs)
+ "Get a list of the files ignored in the PROJECT using VCS."
+ (let ((cmd (projectile-get-ext-ignored-command vcs)))
+ (when cmd
+ (projectile-files-via-ext-command project cmd))))
+
+(defun projectile-get-repo-ignored-directory (project dir vcs)
+ "Get a list of the files ignored in the PROJECT in the directory DIR.
+VCS is the VCS of the project."
+ (let ((cmd (projectile-get-ext-ignored-command vcs)))
+ (when cmd
+ (projectile-files-via-ext-command project (concat cmd " " dir)))))
+
+(defun projectile-files-via-ext-command (root command)
+ "Get a list of relative file names in the project ROOT by executing COMMAND.
+
+If `command' is nil or an empty string, return nil.
+This allows commands to be disabled.
+
+Only text sent to standard output is taken into account."
+ (when (stringp command)
+ (let ((default-directory root))
+ (with-temp-buffer
+ (shell-command command t "*projectile-files-errors*")
+ (let ((shell-output (buffer-substring (point-min) (point-max))))
+ (split-string (string-trim shell-output) "\0" t))))))
+
+(defun projectile-adjust-files (project vcs files)
+ "First remove ignored files from FILES, then add back unignored files."
+ (projectile-add-unignored project vcs (projectile-remove-ignored files)))
+
+(defun projectile-remove-ignored (files)
+ "Remove ignored files and folders from FILES.
+
+If ignored directory prefixed with '*', then ignore all
+directories/subdirectories with matching filename,
+otherwise operates relative to project root."
+ (let ((ignored-files (projectile-ignored-files-rel))
+ (ignored-dirs (projectile-ignored-directories-rel)))
+ (cl-remove-if
+ (lambda (file)
+ (or (cl-some
+ (lambda (f)
+ (string= f (file-name-nondirectory file)))
+ ignored-files)
+ (cl-some
+ (lambda (dir)
+ ;; if the directory is prefixed with '*' then ignore all directories matching that name
+ (if (string-prefix-p "*" dir)
+ ;; remove '*' and trailing slash from ignored directory name
+ (let ((d (substring dir 1 (if (equal (substring dir -1) "/") -1 nil))))
+ (cl-some
+ (lambda (p)
+ (string= d p))
+ ;; split path by '/', remove empty strings, and check if any subdirs match name 'd'
+ (delete "" (split-string (or (file-name-directory file) "") "/"))))
+ (string-prefix-p dir file)))
+ ignored-dirs)
+ (cl-some
+ (lambda (suf)
+ (string-suffix-p suf file t))
+ projectile-globally-ignored-file-suffixes)))
+ files)))
+
+(defun projectile-keep-ignored-files (project vcs files)
+ "Filter FILES to retain only those that are ignored."
+ (when files
+ (cl-remove-if-not
+ (lambda (file)
+ (cl-some (lambda (f) (string-prefix-p f file)) files))
+ (projectile-get-repo-ignored-files project vcs))))
+
+(defun projectile-keep-ignored-directories (project vcs directories)
+ "Get ignored files within each of DIRECTORIES."
+ (when directories
+ (let (result)
+ (dolist (dir directories result)
+ (setq result (append result
+ (projectile-get-repo-ignored-directory project dir vcs))))
+ result)))
+
+(defun projectile-add-unignored (project vcs files)
+ "This adds unignored files to FILES.
+
+Useful because the VCS may not return ignored files at all. In
+this case unignored files will be absent from FILES."
+ (let ((unignored-files (projectile-keep-ignored-files
+ project
+ vcs
+ (projectile-unignored-files-rel)))
+ (unignored-paths (projectile-remove-ignored
+ (projectile-keep-ignored-directories
+ project
+ vcs
+ (projectile-unignored-directories-rel)))))
+ (append files unignored-files unignored-paths)))
+
+(defun projectile-buffers-with-file (buffers)
+ "Return only those BUFFERS backed by files."
+ (cl-remove-if-not (lambda (b) (buffer-file-name b)) buffers))
+
+(defun projectile-buffers-with-file-or-process (buffers)
+ "Return only those BUFFERS backed by files or processes."
+ (cl-remove-if-not (lambda (b) (or (buffer-file-name b)
+ (get-buffer-process b))) buffers))
+
+(defun projectile-project-buffers (&optional project)
+ "Get a list of a project's buffers.
+If PROJECT is not specified the command acts on the current project."
+ (let* ((project-root (or project (projectile-acquire-root)))
+ (all-buffers (cl-remove-if-not
+ (lambda (buffer)
+ (projectile-project-buffer-p buffer project-root))
+ (buffer-list))))
+ (if projectile-buffers-filter-function
+ (funcall projectile-buffers-filter-function all-buffers)
+ all-buffers)))
+
+(defun projectile-process-current-project-buffers (action)
+ "Process the current project's buffers using ACTION."
+ (let ((project-buffers (projectile-project-buffers)))
+ (dolist (buffer project-buffers)
+ (funcall action buffer))))
+
+(defun projectile-process-current-project-buffers-current (action)
+ "Invoke ACTION on every project buffer with that buffer current.
+ACTION is called without arguments."
+ (let ((project-buffers (projectile-project-buffers)))
+ (dolist (buffer project-buffers)
+ (with-current-buffer buffer
+ (funcall action)))))
+
+(defun projectile-project-buffer-files (&optional project)
+ "Get a list of a project's buffer files.
+If PROJECT is not specified the command acts on the current project."
+ (let ((project-root (or project (projectile-project-root))))
+ (mapcar
+ (lambda (buffer)
+ (file-relative-name
+ (buffer-file-name buffer)
+ project-root))
+ (projectile-buffers-with-file
+ (projectile-project-buffers project)))))
+
+(defun projectile-project-buffer-p (buffer project-root)
+ "Check if BUFFER is under PROJECT-ROOT."
+ (with-current-buffer buffer
+ (let ((directory (if buffer-file-name
+ (file-name-directory buffer-file-name)
+ default-directory)))
+ (and (not (string-prefix-p " " (buffer-name buffer)))
+ (not (projectile-ignored-buffer-p buffer))
+ directory
+ (string-equal (file-remote-p directory)
+ (file-remote-p project-root))
+ (not (string-match-p "^http\\(s\\)?://" directory))
+ (string-prefix-p project-root (file-truename directory) (eq system-type 'windows-nt))))))
+
+(defun projectile-ignored-buffer-p (buffer)
+ "Check if BUFFER should be ignored.
+
+Regular expressions can be use."
+ (or
+ (with-current-buffer buffer
+ (cl-some
+ (lambda (name)
+ (string-match-p name (buffer-name)))
+ projectile-globally-ignored-buffers))
+ (with-current-buffer buffer
+ (cl-some
+ (lambda (mode)
+ (string-match-p (concat "^" mode "$")
+ (symbol-name major-mode)))
+ projectile-globally-ignored-modes))))
+
+(defun projectile-recently-active-files ()
+ "Get list of recently active files.
+
+Files are ordered by recently active buffers, and then recently
+opened through use of recentf."
+ (let ((project-buffer-files (projectile-project-buffer-files)))
+ (append project-buffer-files
+ (projectile-difference
+ (projectile-recentf-files)
+ project-buffer-files))))
+
+(defun projectile-project-buffer-names ()
+ "Get a list of project buffer names."
+ (mapcar #'buffer-name (projectile-project-buffers)))
+
+(defun projectile-prepend-project-name (string)
+ "Prepend the current project's name to STRING."
+ (format "[%s] %s" (projectile-project-name) string))
+
+(defun projectile-read-buffer-to-switch (prompt)
+ "Read the name of a buffer to switch to, prompting with PROMPT.
+
+This function excludes the current buffer from the offered
+choices."
+ (projectile-completing-read
+ prompt
+ (delete (buffer-name (current-buffer))
+ (projectile-project-buffer-names))))
+
+;;;###autoload
+(defun projectile-switch-to-buffer ()
+ "Switch to a project buffer."
+ (interactive)
+ (switch-to-buffer
+ (projectile-read-buffer-to-switch "Switch to buffer: ")))
+
+;;;###autoload
+(defun projectile-switch-to-buffer-other-window ()
+ "Switch to a project buffer and show it in another window."
+ (interactive)
+ (switch-to-buffer-other-window
+ (projectile-read-buffer-to-switch "Switch to buffer: ")))
+
+;;;###autoload
+(defun projectile-switch-to-buffer-other-frame ()
+ "Switch to a project buffer and show it in another frame."
+ (interactive)
+ (switch-to-buffer-other-frame
+ (projectile-read-buffer-to-switch "Switch to buffer: ")))
+
+;;;###autoload
+(defun projectile-display-buffer ()
+ "Display a project buffer in another window without selecting it."
+ (interactive)
+ (display-buffer
+ (projectile-completing-read
+ "Display buffer: "
+ (projectile-project-buffer-names))))
+
+;;;###autoload
+(defun projectile-project-buffers-other-buffer ()
+ "Switch to the most recently selected buffer project buffer.
+Only buffers not visible in windows are returned."
+ (interactive)
+ (switch-to-buffer (car (projectile-project-buffers-non-visible))) nil t)
+
+(defun projectile-project-buffers-non-visible ()
+ "Get a list of non visible project buffers."
+ (cl-remove-if-not
+ (lambda (buffer)
+ (not (get-buffer-window buffer 'visible)))
+ (projectile-project-buffers)))
+
+;;;###autoload
+(defun projectile-multi-occur (&optional nlines)
+ "Do a `multi-occur' in the project's buffers.
+With a prefix argument, show NLINES of context."
+ (interactive "P")
+ (let ((project (projectile-acquire-root)))
+ (multi-occur (projectile-project-buffers project)
+ (car (occur-read-primary-args))
+ nlines)))
+
+(defun projectile-normalise-paths (patterns)
+ "Remove leading `/' from the elements of PATTERNS."
+ (delq nil (mapcar (lambda (pat) (and (string-prefix-p "/" pat)
+ ;; remove the leading /
+ (substring pat 1)))
+ patterns)))
+
+(defun projectile-expand-paths (paths)
+ "Expand the elements of PATHS.
+
+Elements containing wildcards are expanded and spliced into the
+resulting paths. The returned PATHS are absolute, based on the
+projectile project root."
+ (let ((default-directory (projectile-project-root)))
+ (projectile-flatten (mapcar
+ (lambda (pattern)
+ (or (file-expand-wildcards pattern t)
+ (projectile-expand-root pattern)))
+ paths))))
+
+(defun projectile-normalise-patterns (patterns)
+ "Remove paths from PATTERNS."
+ (cl-remove-if (lambda (pat) (string-prefix-p "/" pat)) patterns))
+
+(defun projectile-make-relative-to-root (files)
+ "Make FILES relative to the project root."
+ (let ((project-root (projectile-project-root)))
+ (mapcar (lambda (f) (file-relative-name f project-root)) files)))
+
+(defun projectile-ignored-directory-p
+ (directory &optional ignored-directories local-directory globally-ignored-directories)
+ "Check if DIRECTORY should be ignored.
+
+Regular expressions can be used. Pre-computed lists of
+IGNORED-DIRECTORIES and GLOBALLY-IGNORED-DIRECTORIES
+and the LOCAL-DIRECTORY name may optionally be provided."
+ (let ((ignored-directories (or ignored-directories (projectile-ignored-directories)))
+ (globally-ignored-directories (or globally-ignored-directories (projectile-globally-ignored-directory-names)))
+ (local-directory (or local-directory (file-name-nondirectory (directory-file-name directory)))))
+ (or (cl-some
+ (lambda (name)
+ (string-match-p name directory))
+ ignored-directories)
+ (cl-some
+ (lambda (name)
+ (string-match-p name local-directory))
+ globally-ignored-directories))))
+
+(defun projectile-ignored-file-p (file &optional ignored-files)
+ "Check if FILE should be ignored.
+
+Regular expressions can be used. A pre-computed list of
+IGNORED-FILES may optionally be provided."
+ (cl-some
+ (lambda (name)
+ (string-match-p name file))
+ (or ignored-files (projectile-ignored-files))))
+
+(defun projectile-check-pattern-p (file pattern)
+ "Check if FILE meets PATTERN."
+ (or (string-suffix-p (directory-file-name pattern)
+ (directory-file-name file))
+ (member file (file-expand-wildcards pattern t))))
+
+(defun projectile-ignored-rel-p (file directory patterns)
+ "Check if FILE should be ignored relative to DIRECTORY.
+PATTERNS should have the form: (ignored . unignored)"
+ (let ((default-directory directory))
+ (and (cl-some
+ (lambda (pat) (projectile-check-pattern-p file pat))
+ (car patterns))
+ (cl-notany
+ (lambda (pat) (projectile-check-pattern-p file pat))
+ (cdr patterns)))))
+
+(defun projectile-ignored-files ()
+ "Return list of ignored files."
+ (projectile-difference
+ (mapcar
+ #'projectile-expand-root
+ (append
+ projectile-globally-ignored-files
+ (projectile-project-ignored-files)))
+ (projectile-unignored-files)))
+
+(defun projectile-globally-ignored-directory-names ()
+ "Return list of ignored directory names."
+ (projectile-difference
+ projectile-globally-ignored-directories
+ projectile-globally-unignored-directories))
+
+(defun projectile-ignored-directories ()
+ "Return list of ignored directories."
+ (projectile-difference
+ (mapcar
+ #'file-name-as-directory
+ (mapcar
+ #'projectile-expand-root
+ (append
+ projectile-globally-ignored-directories
+ (projectile-project-ignored-directories))))
+ (projectile-unignored-directories)))
+
+(defun projectile-ignored-directories-rel ()
+ "Return list of ignored directories, relative to the root."
+ (projectile-make-relative-to-root (projectile-ignored-directories)))
+
+(defun projectile-ignored-files-rel ()
+ "Return list of ignored files, relative to the root."
+ (projectile-make-relative-to-root (projectile-ignored-files)))
+
+(defun projectile-project-ignored-files ()
+ "Return list of project ignored files.
+Unignored files are not included."
+ (cl-remove-if 'file-directory-p (projectile-project-ignored)))
+
+(defun projectile-project-ignored-directories ()
+ "Return list of project ignored directories.
+Unignored directories are not included."
+ (cl-remove-if-not 'file-directory-p (projectile-project-ignored)))
+
+(defun projectile-paths-to-ignore ()
+ "Return a list of ignored project paths."
+ (projectile-normalise-paths (nth 1 (projectile-parse-dirconfig-file))))
+
+(defun projectile-patterns-to-ignore ()
+ "Return a list of relative file patterns."
+ (projectile-normalise-patterns (nth 1 (projectile-parse-dirconfig-file))))
+
+(defun projectile-project-ignored ()
+ "Return list of project ignored files/directories.
+Unignored files/directories are not included."
+ (let ((paths (projectile-paths-to-ignore)))
+ (projectile-expand-paths paths)))
+
+(defun projectile-unignored-files ()
+ "Return list of unignored files."
+ (mapcar
+ #'projectile-expand-root
+ (append
+ projectile-globally-unignored-files
+ (projectile-project-unignored-files))))
+
+(defun projectile-unignored-directories ()
+ "Return list of unignored directories."
+ (mapcar
+ #'file-name-as-directory
+ (mapcar
+ #'projectile-expand-root
+ (append
+ projectile-globally-unignored-directories
+ (projectile-project-unignored-directories)))))
+
+(defun projectile-unignored-directories-rel ()
+ "Return list of unignored directories, relative to the root."
+ (projectile-make-relative-to-root (projectile-unignored-directories)))
+
+(defun projectile-unignored-files-rel ()
+ "Return list of unignored files, relative to the root."
+ (projectile-make-relative-to-root (projectile-unignored-files)))
+
+(defun projectile-project-unignored-files ()
+ "Return list of project unignored files."
+ (cl-remove-if 'file-directory-p (projectile-project-unignored)))
+
+(defun projectile-project-unignored-directories ()
+ "Return list of project unignored directories."
+ (cl-remove-if-not 'file-directory-p (projectile-project-unignored)))
+
+(defun projectile-paths-to-ensure ()
+ "Return a list of unignored project paths."
+ (projectile-normalise-paths (nth 2 (projectile-parse-dirconfig-file))))
+
+(defun projectile-files-to-ensure ()
+ (projectile-flatten (mapcar (lambda (pat) (file-expand-wildcards pat t))
+ (projectile-patterns-to-ensure))))
+
+(defun projectile-patterns-to-ensure ()
+ "Return a list of relative file patterns."
+ (projectile-normalise-patterns (nth 2 (projectile-parse-dirconfig-file))))
+
+(defun projectile-filtering-patterns ()
+ (cons (projectile-patterns-to-ignore)
+ (projectile-patterns-to-ensure)))
+
+(defun projectile-project-unignored ()
+ "Return list of project ignored files/directories."
+ (delete-dups (append (projectile-expand-paths (projectile-paths-to-ensure))
+ (projectile-expand-paths (projectile-files-to-ensure)))))
+
+
+(defun projectile-dirconfig-file ()
+ "Return the absolute path to the project's dirconfig file."
+ (expand-file-name ".projectile" (projectile-project-root)))
+
+(defun projectile-parse-dirconfig-file ()
+ "Parse project ignore file and return directories to ignore and keep.
+
+The return value will be a list of three elements, the car being
+the list of directories to keep, the cadr being the list of files
+or directories to ignore, and the caddr being the list of files
+or directories to ensure.
+
+Strings starting with + will be added to the list of directories
+to keep, and strings starting with - will be added to the list of
+directories to ignore. For backward compatibility, without a
+prefix the string will be assumed to be an ignore string."
+ (let (keep ignore ensure (dirconfig (projectile-dirconfig-file)))
+ (when (projectile-file-exists-p dirconfig)
+ (with-temp-buffer
+ (insert-file-contents dirconfig)
+ (while (not (eobp))
+ (pcase (char-after)
+ ;; ignore comment lines if prefix char has been set
+ ((pred (lambda (leading-char)
+ (and projectile-dirconfig-comment-prefix
+ (eql leading-char
+ projectile-dirconfig-comment-prefix))))
+ nil)
+ (?+ (push (buffer-substring (1+ (point)) (line-end-position)) keep))
+ (?- (push (buffer-substring (1+ (point)) (line-end-position)) ignore))
+ (?! (push (buffer-substring (1+ (point)) (line-end-position)) ensure))
+ (_ (push (buffer-substring (point) (line-end-position)) ignore)))
+ (forward-line)))
+ (list (mapcar (lambda (f) (file-name-as-directory (string-trim f)))
+ (delete "" (reverse keep)))
+ (mapcar #'string-trim
+ (delete "" (reverse ignore)))
+ (mapcar #'string-trim
+ (delete "" (reverse ensure)))))))
+
+(defun projectile-expand-root (name)
+ "Expand NAME to project root.
+
+Never use on many files since it's going to recalculate the
+project-root for every file."
+ (expand-file-name name (projectile-project-root)))
+
+(cl-defun projectile-completing-read (prompt choices &key initial-input action)
+ "Present a project tailored PROMPT with CHOICES."
+ (let ((prompt (projectile-prepend-project-name prompt))
+ res)
+ (setq res
+ (pcase (if (eq projectile-completion-system 'auto)
+ (cond
+ ((bound-and-true-p ido-mode) 'ido)
+ ((bound-and-true-p helm-mode) 'helm)
+ ((bound-and-true-p ivy-mode) 'ivy)
+ (t 'default))
+ projectile-completion-system)
+ ('default (completing-read prompt choices nil nil initial-input))
+ ('ido (ido-completing-read prompt choices nil nil initial-input))
+ ('helm
+ (if (and (fboundp 'helm)
+ (fboundp 'helm-make-source))
+ (helm :sources
+ (helm-make-source "Projectile" 'helm-source-sync
+ :candidates choices
+ :action (if action
+ (prog1 action
+ (setq action nil))
+ #'identity))
+ :prompt prompt
+ :input initial-input
+ :buffer "*helm-projectile*")
+ (user-error "Please install helm")))
+ ('ivy
+ (if (fboundp 'ivy-read)
+ (ivy-read prompt choices
+ :initial-input initial-input
+ :action (prog1 action
+ (setq action nil))
+ :caller 'projectile-completing-read)
+ (user-error "Please install ivy")))
+ (_ (funcall projectile-completion-system prompt choices))))
+ (if action
+ (funcall action res)
+ res)))
+
+(defun projectile-project-files (project-root)
+ "Return a list of files for the PROJECT-ROOT."
+ (let (files)
+ ;; If the cache is too stale, don't use it.
+ (when projectile-files-cache-expire
+ (let ((cache-time
+ (gethash project-root projectile-projects-cache-time)))
+ (when (or (null cache-time)
+ (< (+ cache-time projectile-files-cache-expire)
+ (projectile-time-seconds)))
+ (remhash project-root projectile-projects-cache)
+ (remhash project-root projectile-projects-cache-time))))
+
+ ;; Use the cache, if requested and available.
+ (when projectile-enable-caching
+ (setq files (gethash project-root projectile-projects-cache)))
+
+ ;; Calculate the list of files.
+ (when (null files)
+ (when projectile-enable-caching
+ (message "Projectile is initializing cache for %s ..." project-root))
+ (setq files
+ (if (eq projectile-indexing-method 'alien)
+ ;; In alien mode we can just skip reading
+ ;; .projectile and find all files in the root dir.
+ (projectile-dir-files-alien project-root)
+ ;; If a project is defined as a list of subfolders
+ ;; then we'll have the files returned for each subfolder,
+ ;; so they are relative to the project root.
+ ;;
+ ;; TODO: That's pretty slow and we need to improve it.
+ ;; One options would be to pass explicitly the subdirs
+ ;; to commands like `git ls-files` which would return
+ ;; files paths relative to the project root.
+ (cl-mapcan
+ (lambda (dir)
+ (mapcar (lambda (f)
+ (file-relative-name (concat dir f)
+ project-root))
+ (projectile-dir-files dir)))
+ (projectile-get-project-directories project-root))))
+
+ ;; Save the cached list.
+ (when projectile-enable-caching
+ (projectile-cache-project project-root files)))
+
+ ;;; Sorting
+ ;;
+ ;; Files can't be cached in sorted order as some sorting schemes
+ ;; require dynamic data. Sorting is ignored completely when in
+ ;; alien mode.
+ (if (eq projectile-indexing-method 'alien)
+ files
+ (projectile-sort-files files))))
+
+(defun projectile-current-project-files ()
+ "Return a list of the files in the current project."
+ (projectile-project-files (projectile-acquire-root)))
+
+(defun projectile-process-current-project-files (action)
+ "Process the current project's files using ACTION."
+ (let ((project-files (projectile-current-project-files))
+ (default-directory (projectile-project-root)))
+ (dolist (filename project-files)
+ (funcall action filename))))
+
+(defun projectile-project-dirs (project)
+ "Return a list of dirs for PROJECT."
+ (delete-dups
+ (delq nil
+ (mapcar #'file-name-directory
+ (projectile-project-files project)))))
+
+(defun projectile-current-project-dirs ()
+ "Return a list of dirs for the current project."
+ (projectile-project-dirs (projectile-acquire-root)))
+
+(defun projectile-get-other-files (file-name &optional flex-matching)
+ "Return a list of other files for FILE-NAME.
+The list depends on `:related-files-fn' project option and
+`projectile-other-file-alist'. For the latter, FLEX-MATCHING can be used
+to match any basename."
+ (if-let ((plist (projectile--related-files-plist-by-kind file-name :other)))
+ (projectile--related-files-from-plist plist)
+ (projectile--other-extension-files file-name
+ (projectile-current-project-files)
+ flex-matching)))
+
+(defun projectile--find-other-file (&optional flex-matching ff-variant)
+ "Switch between files with the same name but different extensions.
+With FLEX-MATCHING, match any file that contains the base name of current file.
+Other file extensions can be customized with the variable
+`projectile-other-file-alist'. With FF-VARIANT set to a defun, use that
+instead of `find-file'. A typical example of such a defun would be
+`find-file-other-window' or `find-file-other-frame'"
+ (let ((ff (or ff-variant #'find-file))
+ (other-files (projectile-get-other-files (buffer-file-name) flex-matching)))
+ (if other-files
+ (let ((file-name (projectile--choose-from-candidates other-files)))
+ (funcall ff (expand-file-name file-name
+ (projectile-project-root))))
+ (error "No other file found"))))
+
+
+;;; Interactive commands
+;;;###autoload
+(defun projectile-find-other-file (&optional flex-matching)
+ "Switch between files with the same name but different extensions.
+With FLEX-MATCHING, match any file that contains the base name of current file.
+Other file extensions can be customized with the variable
+`projectile-other-file-alist'."
+ (interactive "P")
+ (projectile--find-other-file flex-matching))
+
+;;;###autoload
+(defun projectile-find-other-file-other-window (&optional flex-matching)
+ "Switch between files with different extensions in other window.
+Switch between files with the same name but different extensions in other
+window. With FLEX-MATCHING, match any file that contains the base name of
+current file. Other file extensions can be customized with the variable
+`projectile-other-file-alist'."
+ (interactive "P")
+ (projectile--find-other-file flex-matching
+ #'find-file-other-window))
+
+;;;###autoload
+(defun projectile-find-other-file-other-frame (&optional flex-matching)
+ "Switch between files with different extensions in other frame.
+Switch between files with the same name but different extensions in other frame.
+With FLEX-MATCHING, match any file that contains the base name of current
+file. Other file extensions can be customized with the variable
+`projectile-other-file-alist'."
+ (interactive "P")
+ (projectile--find-other-file flex-matching
+ #'find-file-other-frame))
+
+(defun projectile--file-name-sans-extensions (file-name)
+ "Return FILE-NAME sans any extensions.
+The extensions, in a filename, are what follows the first '.', with the
+exception of a leading '.'"
+ (setq file-name (file-name-nondirectory file-name))
+ (substring file-name 0 (string-match "\\..*" file-name 1)))
+
+(defun projectile--file-name-extensions (file-name)
+ "Return FILE-NAME's extensions.
+The extensions, in a filename, are what follows the first '.', with the
+exception of a leading '.'"
+ ;;would it make sense to return nil instead of an empty string if no extensions are found?
+ (setq file-name (file-name-nondirectory file-name))
+ (let (extensions-start)
+ (substring file-name
+ (if (setq extensions-start (string-match "\\..*" file-name 1))
+ (1+ extensions-start)
+ (length file-name)))))
+
+(defun projectile-associated-file-name-extensions (file-name)
+ "Return projectile-other-file-extensions associated to FILE-NAME's extensions.
+If no associated other-file-extensions for the complete (nested) extension
+are found, remove subextensions from FILENAME's extensions until a match is
+found."
+ (let ((current-extensions (projectile--file-name-extensions (file-name-nondirectory file-name)))
+ associated-extensions)
+ (catch 'break
+ (while (not (string= "" current-extensions))
+ (if (setq associated-extensions (cdr (assoc current-extensions projectile-other-file-alist)))
+ (throw 'break associated-extensions))
+ (setq current-extensions (projectile--file-name-extensions current-extensions))))))
+
+(defun projectile--other-extension-files (current-file project-file-list &optional flex-matching)
+ "Narrow to files with the same names but different extensions.
+Returns a list of possible files for users to choose.
+
+With FLEX-MATCHING, match any file that contains the base name of current file"
+ (let* ((file-ext-list (projectile-associated-file-name-extensions current-file))
+ (fulldirname (if (file-name-directory current-file)
+ (file-name-directory current-file) "./"))
+ (dirname (file-name-nondirectory (directory-file-name fulldirname)))
+ (filename (regexp-quote (projectile--file-name-sans-extensions current-file)))
+ (file-list (mapcar (lambda (ext)
+ (if flex-matching
+ (concat ".*" filename ".*" "\." ext "\\'")
+ (concat "^" filename
+ (unless (equal ext "")
+ (concat "\." ext))
+ "\\'")))
+ file-ext-list))
+ (candidates (cl-remove-if-not
+ (lambda (project-file)
+ (string-match filename project-file))
+ project-file-list))
+ (candidates
+ (projectile-flatten (mapcar
+ (lambda (file)
+ (cl-remove-if-not
+ (lambda (project-file)
+ (string-match file
+ (concat (file-name-base project-file)
+ (unless (equal (file-name-extension project-file) nil)
+ (concat "\." (file-name-extension project-file))))))
+ candidates))
+ file-list)))
+ (candidates
+ (cl-remove-if-not (lambda (file) (not (backup-file-name-p file))) candidates))
+ (candidates
+ (cl-sort (copy-sequence candidates)
+ (lambda (file _)
+ (let ((candidate-dirname (file-name-nondirectory (directory-file-name (file-name-directory file)))))
+ (unless (equal fulldirname (file-name-directory file))
+ (equal dirname candidate-dirname)))))))
+ candidates))
+
+(defun projectile-select-files (project-files &optional invalidate-cache)
+ "Select a list of files based on filename at point.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first."
+ (projectile-maybe-invalidate-cache invalidate-cache)
+ (let* ((file (if (region-active-p)
+ (buffer-substring (region-beginning) (region-end))
+ (or (thing-at-point 'filename) "")))
+ (file (if (string-match "\\.?\\./" file)
+ (file-relative-name (file-truename file) (projectile-project-root))
+ file))
+ (files (if file
+ (cl-remove-if-not
+ (lambda (project-file)
+ (string-match file project-file))
+ project-files)
+ nil)))
+ files))
+
+(defun projectile--find-file-dwim (invalidate-cache &optional ff-variant)
+ "Jump to a project's files using completion based on context.
+
+With a INVALIDATE-CACHE invalidates the cache first.
+
+With FF-VARIANT set to a defun, use that instead of `find-file'.
+A typical example of such a defun would be `find-file-other-window' or
+`find-file-other-frame'
+
+Subroutine for `projectile-find-file-dwim' and
+`projectile-find-file-dwim-other-window'"
+ (let* ((project-root (projectile-acquire-root))
+ (project-files (projectile-project-files project-root))
+ (files (projectile-select-files project-files invalidate-cache))
+ (file (cond ((= (length files) 1)
+ (car files))
+ ((> (length files) 1)
+ (projectile-completing-read "Switch to: " files))
+ (t
+ (projectile-completing-read "Switch to: " project-files))))
+ (ff (or ff-variant #'find-file)))
+ (funcall ff (expand-file-name file project-root))
+ (run-hooks 'projectile-find-file-hook)))
+
+;;;###autoload
+(defun projectile-find-file-dwim (&optional invalidate-cache)
+ "Jump to a project's files using completion based on context.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first.
+
+If point is on a filename, Projectile first tries to search for that
+file in project:
+
+- If it finds just a file, it switches to that file instantly. This works
+even if the filename is incomplete, but there's only a single file in the
+current project that matches the filename at point. For example, if
+there's only a single file named \"projectile/projectile.el\" but the
+current filename is \"projectile/proj\" (incomplete),
+`projectile-find-file-dwim' still switches to \"projectile/projectile.el\"
+immediately because this is the only filename that matches.
+
+- If it finds a list of files, the list is displayed for selecting. A list
+of files is displayed when a filename appears more than one in the project
+or the filename at point is a prefix of more than two files in a project.
+For example, if `projectile-find-file-dwim' is executed on a filepath like
+\"projectile/\", it lists the content of that directory. If it is executed
+on a partial filename like \"projectile/a\", a list of files with character
+'a' in that directory is presented.
+
+- If it finds nothing, display a list of all files in project for selecting."
+ (interactive "P")
+ (projectile--find-file-dwim invalidate-cache))
+
+;;;###autoload
+(defun projectile-find-file-dwim-other-window (&optional invalidate-cache)
+ "Jump to a project's files using completion based on context in other window.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first.
+
+If point is on a filename, Projectile first tries to search for that
+file in project:
+
+- If it finds just a file, it switches to that file instantly. This works
+even if the filename is incomplete, but there's only a single file in the
+current project that matches the filename at point. For example, if
+there's only a single file named \"projectile/projectile.el\" but the
+current filename is \"projectile/proj\" (incomplete),
+`projectile-find-file-dwim-other-window' still switches to
+\"projectile/projectile.el\" immediately because this is the only filename
+that matches.
+
+- If it finds a list of files, the list is displayed for selecting. A list
+of files is displayed when a filename appears more than one in the project
+or the filename at point is a prefix of more than two files in a project.
+For example, if `projectile-find-file-dwim-other-window' is executed on a
+filepath like \"projectile/\", it lists the content of that directory. If
+it is executed on a partial filename like \"projectile/a\", a list of files
+with character 'a' in that directory is presented.
+
+- If it finds nothing, display a list of all files in project for selecting."
+ (interactive "P")
+ (projectile--find-file-dwim invalidate-cache #'find-file-other-window))
+
+;;;###autoload
+(defun projectile-find-file-dwim-other-frame (&optional invalidate-cache)
+ "Jump to a project's files using completion based on context in other frame.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first.
+
+If point is on a filename, Projectile first tries to search for that
+file in project:
+
+- If it finds just a file, it switches to that file instantly. This works
+even if the filename is incomplete, but there's only a single file in the
+current project that matches the filename at point. For example, if
+there's only a single file named \"projectile/projectile.el\" but the
+current filename is \"projectile/proj\" (incomplete),
+`projectile-find-file-dwim-other-frame' still switches to
+\"projectile/projectile.el\" immediately because this is the only filename
+that matches.
+
+- If it finds a list of files, the list is displayed for selecting. A list
+of files is displayed when a filename appears more than one in the project
+or the filename at point is a prefix of more than two files in a project.
+For example, if `projectile-find-file-dwim-other-frame' is executed on a
+filepath like \"projectile/\", it lists the content of that directory. If
+it is executed on a partial filename like \"projectile/a\", a list of files
+with character 'a' in that directory is presented.
+
+- If it finds nothing, display a list of all files in project for selecting."
+ (interactive "P")
+ (projectile--find-file-dwim invalidate-cache #'find-file-other-frame))
+
+(defun projectile--find-file (invalidate-cache &optional ff-variant)
+ "Jump to a project's file using completion.
+With INVALIDATE-CACHE invalidates the cache first. With FF-VARIANT set to a
+defun, use that instead of `find-file'. A typical example of such a defun
+would be `find-file-other-window' or `find-file-other-frame'"
+ (interactive "P")
+ (projectile-maybe-invalidate-cache invalidate-cache)
+ (let* ((project-root (projectile-acquire-root))
+ (file (projectile-completing-read "Find file: "
+ (projectile-project-files project-root)))
+ (ff (or ff-variant #'find-file)))
+ (when file
+ (funcall ff (expand-file-name file project-root))
+ (run-hooks 'projectile-find-file-hook))))
+
+;;;###autoload
+(defun projectile-find-file (&optional invalidate-cache)
+ "Jump to a project's file using completion.
+With a prefix arg INVALIDATE-CACHE invalidates the cache first."
+ (interactive "P")
+ (projectile--find-file invalidate-cache))
+
+;;;###autoload
+(defun projectile-find-file-other-window (&optional invalidate-cache)
+ "Jump to a project's file using completion and show it in another window.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first."
+ (interactive "P")
+ (projectile--find-file invalidate-cache #'find-file-other-window))
+
+;;;###autoload
+(defun projectile-find-file-other-frame (&optional invalidate-cache)
+ "Jump to a project's file using completion and show it in another frame.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first."
+ (interactive "P")
+ (projectile--find-file invalidate-cache #'find-file-other-frame))
+
+;;;###autoload
+(defun projectile-toggle-project-read-only ()
+ "Toggle project read only."
+ (interactive)
+ (let ((inhibit-read-only t)
+ (val (not buffer-read-only))
+ (default-directory (projectile-acquire-root)))
+ (add-dir-local-variable nil 'buffer-read-only val)
+ (save-buffer)
+ (kill-buffer)
+ (when buffer-file-name
+ (read-only-mode (if val +1 -1))
+ (message "[%s] read-only-mode is %s" (projectile-project-name) (if val "on" "off")))))
+
+
+;;;; Sorting project files
+(defun projectile-sort-files (files)
+ "Sort FILES according to `projectile-sort-order'."
+ (cl-case projectile-sort-order
+ (default files)
+ (recentf (projectile-sort-by-recentf-first files))
+ (recently-active (projectile-sort-by-recently-active-first files))
+ (modification-time (projectile-sort-by-modification-time files))
+ (access-time (projectile-sort-by-access-time files))))
+
+(defun projectile-sort-by-recentf-first (files)
+ "Sort FILES by a recent first scheme."
+ (let ((project-recentf-files (projectile-recentf-files)))
+ (append project-recentf-files
+ (projectile-difference files project-recentf-files))))
+
+(defun projectile-sort-by-recently-active-first (files)
+ "Sort FILES by most recently active buffers or opened files."
+ (let ((project-recently-active-files (projectile-recently-active-files)))
+ (append project-recently-active-files
+ (projectile-difference files project-recently-active-files))))
+
+(defun projectile-sort-by-modification-time (files)
+ "Sort FILES by modification time."
+ (let ((default-directory (projectile-project-root)))
+ (cl-sort
+ (copy-sequence files)
+ (lambda (file1 file2)
+ (let ((file1-mtime (nth 5 (file-attributes file1)))
+ (file2-mtime (nth 5 (file-attributes file2))))
+ (not (time-less-p file1-mtime file2-mtime)))))))
+
+(defun projectile-sort-by-access-time (files)
+ "Sort FILES by access time."
+ (let ((default-directory (projectile-project-root)))
+ (cl-sort
+ (copy-sequence files)
+ (lambda (file1 file2)
+ (let ((file1-atime (nth 4 (file-attributes file1)))
+ (file2-atime (nth 4 (file-attributes file2))))
+ (not (time-less-p file1-atime file2-atime)))))))
+
+
+;;;; Find directory in project functionality
+(defun projectile--find-dir (invalidate-cache &optional dired-variant)
+ "Jump to a project's directory using completion.
+
+With INVALIDATE-CACHE invalidates the cache first. With DIRED-VARIANT set to a
+defun, use that instead of `dired'. A typical example of such a defun would be
+`dired-other-window' or `dired-other-frame'"
+ (projectile-maybe-invalidate-cache invalidate-cache)
+ (let* ((project (projectile-acquire-root))
+ (dir (projectile-complete-dir project))
+ (dired-v (or dired-variant #'dired)))
+ (funcall dired-v (expand-file-name dir project))
+ (run-hooks 'projectile-find-dir-hook)))
+
+;;;###autoload
+(defun projectile-find-dir (&optional invalidate-cache)
+ "Jump to a project's directory using completion.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first."
+ (interactive "P")
+ (projectile--find-dir invalidate-cache))
+
+;;;###autoload
+(defun projectile-find-dir-other-window (&optional invalidate-cache)
+ "Jump to a project's directory in other window using completion.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first."
+ (interactive "P")
+ (projectile--find-dir invalidate-cache #'dired-other-window))
+
+;;;###autoload
+(defun projectile-find-dir-other-frame (&optional invalidate-cache)
+ "Jump to a project's directory in other frame using completion.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first."
+ (interactive "P")
+ (projectile--find-dir invalidate-cache #'dired-other-frame))
+
+(defun projectile-complete-dir (project)
+ (let ((project-dirs (projectile-project-dirs project)))
+ (projectile-completing-read
+ "Find dir: "
+ (if projectile-find-dir-includes-top-level
+ (append '("./") project-dirs)
+ project-dirs))))
+
+;;;###autoload
+(defun projectile-find-test-file (&optional invalidate-cache)
+ "Jump to a project's test file using completion.
+
+With a prefix arg INVALIDATE-CACHE invalidates the cache first."
+ (interactive "P")
+ (projectile-maybe-invalidate-cache invalidate-cache)
+ (let ((file (projectile-completing-read "Find test file: "
+ (projectile-current-project-test-files))))
+ (find-file (expand-file-name file (projectile-project-root)))))
+
+(defun projectile-test-files (files)
+ "Return only the test FILES."
+ (cl-remove-if-not 'projectile-test-file-p files))
+
+(defun projectile--merge-related-files-fns (related-files-fns)
+ "Merge multiple RELATED-FILES-FNS into one function."
+ (lambda (path)
+ (let (merged-plist)
+ (dolist (fn related-files-fns merged-plist)
+ (let ((plist (funcall fn path)))
+ (cl-loop for (key value) on plist by #'cddr
+ do (let ((values (if (consp value) value (list value))))
+ (if (plist-member merged-plist key)
+ (nconc (plist-get merged-plist key) values)
+ (setq merged-plist (plist-put merged-plist key values))))))))))
+
+(defun projectile--related-files-plist (project-root file)
+ "Return a plist containing all related files information for FILE.
+PROJECT-ROOT is the project root."
+ (if-let ((rel-path (if (file-name-absolute-p file)
+ (file-relative-name file project-root)
+ file))
+ (custom-function (funcall projectile-related-files-fn-function (projectile-project-type))))
+ (funcall (cond ((functionp custom-function)
+ custom-function)
+ ((consp custom-function)
+ (projectile--merge-related-files-fns custom-function))
+ (t
+ (error "Unsupported value type of :related-files-fn")))
+ rel-path)))
+
+(defun projectile--related-files-plist-by-kind (file kind)
+ "Return a plist containing :paths and/or :predicate of KIND for FILE."
+ (if-let ((project-root (projectile-project-root))
+ (plist (projectile--related-files-plist project-root file))
+ (has-kind? (plist-member plist kind)))
+ (let* ((kind-value (plist-get plist kind))
+ (values (if (cl-typep kind-value '(or string function))
+ (list kind-value)
+ kind-value))
+ (paths (delete-dups (cl-remove-if-not 'stringp values)))
+ (predicates (delete-dups (cl-remove-if-not 'functionp values))))
+ (append
+ ;; Make sure that :paths exists even with nil if there is no predicates
+ (when (or paths (null predicates))
+ (list :paths (cl-remove-if-not
+ (lambda (f)
+ (projectile-file-exists-p (expand-file-name f project-root)))
+ paths)))
+ (when predicates
+ (list :predicate (if (= 1 (length predicates))
+ (car predicates)
+ (lambda (other-file)
+ (cl-some (lambda (predicate)
+ (funcall predicate other-file))
+ predicates)))))))))
+
+(defun projectile--related-files-from-plist (plist)
+ "Return a list of files matching to PLIST from current project files."
+ (let* ((predicate (plist-get plist :predicate))
+ (paths (plist-get plist :paths)))
+ (delete-dups (append
+ paths
+ (when predicate
+ (cl-remove-if-not predicate (projectile-current-project-files)))))))
+
+(defun projectile--related-files-kinds(file)
+ "Return a list o keywords meaning available related kinds for FILE."
+ (if-let ((project-root (projectile-project-root))
+ (plist (projectile--related-files-plist project-root file)))
+ (cl-loop for key in plist by #'cddr
+ collect key)))
+
+(defun projectile--related-files (file kind)
+ "Return a list of related files of KIND for FILE."
+ (projectile--related-files-from-plist (projectile--related-files-plist-by-kind file kind)))
+
+(defun projectile--find-related-file (file &optional kind)
+ "Choose a file from files related to FILE as KIND.
+If KIND is not provided, a list of possible kinds can be chosen."
+ (unless kind
+ (if-let ((available-kinds (projectile--related-files-kinds file)))
+ (setq kind (if (= (length available-kinds) 1)
+ (car available-kinds)
+ (intern (projectile-completing-read "Kind :" available-kinds))))
+ (error "No related files found")))
+
+ (if-let ((candidates (projectile--related-files file kind)))
+ (projectile-expand-root (projectile--choose-from-candidates candidates))
+ (error
+ "No matching related file as `%s' found for project type `%s'"
+ kind (projectile-project-type))))
+
+;;;###autoload
+(defun projectile-find-related-file-other-window ()
+ "Open related file in other window."
+ (interactive)
+ (find-file-other-window
+ (projectile--find-related-file (buffer-file-name))))
+
+;;;###autoload
+(defun projectile-find-related-file-other-frame ()
+ "Open related file in other frame."
+ (interactive)
+ (find-file-other-frame
+ (projectile--find-related-file (buffer-file-name))))
+
+;;;###autoload
+(defun projectile-find-related-file()
+ "Open related file."
+ (interactive)
+ (find-file
+ (projectile--find-related-file (buffer-file-name))))
+
+;;;###autoload
+(defun projectile-related-files-fn-groups(kind groups)
+ "Generate a related-files-fn which relates as KIND for files in each of GROUPS."
+ (lambda (path)
+ (if-let ((group-found (cl-find-if (lambda (group)
+ (member path group))
+ groups)))
+ (list kind (cl-remove path group-found :test 'equal)))))
+
+;;;###autoload
+(defun projectile-related-files-fn-extensions(kind extensions)
+ "Generate a related-files-fn which relates as KIND for files having EXTENSIONS."
+ (lambda (path)
+ (let* ((ext (file-name-extension path))
+ (basename (file-name-base path))
+ (basename-regexp (regexp-quote basename)))
+ (when (member ext extensions)
+ (list kind (lambda (other-path)
+ (and (string-match-p basename-regexp other-path)
+ (equal basename (file-name-base other-path))
+ (let ((other-ext (file-name-extension other-path)))
+ (and (member other-ext extensions)
+ (not (equal other-ext ext)))))))))))
+
+;;;###autoload
+(defun projectile-related-files-fn-test-with-prefix(extension test-prefix)
+ "Generate a related-files-fn which relates tests and impl.
+Use files with EXTENSION based on TEST-PREFIX."
+ (lambda (path)
+ (when (equal (file-name-extension path) extension)
+ (let* ((file-name (file-name-nondirectory path))
+ (find-impl? (string-prefix-p test-prefix file-name))
+ (file-name-to-find (if find-impl?
+ (substring file-name (length test-prefix))
+ (concat test-prefix file-name))))
+ (list (if find-impl? :impl :test)
+ (lambda (other-path)
+ (and (string-suffix-p file-name-to-find other-path)
+ (equal (file-name-nondirectory other-path) file-name-to-find))))))))
+
+;;;###autoload
+(defun projectile-related-files-fn-test-with-suffix(extension test-suffix)
+ "Generate a related-files-fn which relates tests and impl.
+Use files with EXTENSION based on TEST-SUFFIX."
+ (lambda (path)
+ (when (equal (file-name-extension path) extension)
+ (let* ((file-name (file-name-nondirectory path))
+ (dot-ext (concat "." extension))
+ (suffix-ext (concat test-suffix dot-ext))
+ (find-impl? (string-suffix-p suffix-ext file-name))
+ (file-name-to-find (if find-impl?
+ (concat (substring file-name 0 (- (length suffix-ext)))
+ dot-ext)
+ (concat (substring file-name 0 (- (length dot-ext)))
+ suffix-ext))))
+ (list (if find-impl? :impl :test)
+ (lambda (other-path)
+ (and (string-suffix-p file-name-to-find other-path)
+ (equal (file-name-nondirectory other-path) file-name-to-find))))))))
+
+(defun projectile-test-file-p (file)
+ "Check if FILE is a test file."
+ (let ((kinds (projectile--related-files-kinds file)))
+ (cond ((member :impl kinds) t)
+ ((member :test kinds) nil)
+ (t (or (cl-some (lambda (pat) (string-prefix-p pat (file-name-nondirectory file)))
+ (delq nil (list (funcall projectile-test-prefix-function (projectile-project-type)))))
+ (cl-some (lambda (pat) (string-suffix-p pat (file-name-sans-extension (file-name-nondirectory file))))
+ (delq nil (list (funcall projectile-test-suffix-function (projectile-project-type))))))))))
+
+(defun projectile-current-project-test-files ()
+ "Return a list of test files for the current project."
+ (projectile-test-files (projectile-current-project-files)))
+
+(defvar projectile-project-types nil
+ "An alist holding all project types that are known to Projectile.
+The project types are symbols and they are linked to plists holding
+the properties of the various project types.")
+
+(defun projectile--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))
+
+(cl-defun projectile--build-project-plist
+ (marker-files &key project-file compilation-dir configure compile install package test run test-suffix test-prefix src-dir test-dir related-files-fn)
+ "Return a project type plist with the provided arguments.
+
+A project type is defined by PROJECT-TYPE, a set of MARKER-FILES,
+and optional keyword arguments:
+PROJECT-FILE the main project file in the root project directory.
+COMPILATION-DIR the directory to run the tests- and compilations in,
+CONFIGURE which specifies a command that configures the project
+ `%s' in the command will be substituted with (projectile-project-root)
+ before the command is run,
+COMPILE which specifies a command that builds the project,
+INSTALL which specifies a command to install the project.
+PACKAGE which specifies a command to package the project.
+TEST which specified a command that tests the project,
+RUN which specifies a command that runs the project,
+TEST-SUFFIX which specifies test file suffix, and
+TEST-PREFIX which specifies test file prefix.
+SRC-DIR which specifies the path to the source relative to the project root.
+TEST-DIR which specifies the path to the tests relative to the project root.
+RELATED-FILES-FN which specifies a custom function to find the related
+files such as test/impl/other files as below:
+ CUSTOM-FUNCTION accepts FILE as relative path from the project root and
+ returns a plist containing :test, :impl or :other as key and the
+ relative path/paths or predicate as value. PREDICATE accepts a
+ relative path as the input."
+ (let ((project-plist (list 'marker-files marker-files
+ 'project-file project-file
+ 'compilation-dir compilation-dir
+ 'configure-command configure
+ 'compile-command compile
+ 'test-command test
+ 'install-command install
+ 'package-command package
+ 'run-command run)))
+ (when (and project-file (not (member project-file projectile-project-root-files)))
+ (add-to-list 'projectile-project-root-files project-file))
+ (when test-suffix
+ (plist-put project-plist 'test-suffix test-suffix))
+ (when test-prefix
+ (plist-put project-plist 'test-prefix test-prefix))
+ (when src-dir
+ (plist-put project-plist 'src-dir src-dir))
+ (when test-dir
+ (plist-put project-plist 'test-dir test-dir))
+ (when related-files-fn
+ (plist-put project-plist 'related-files-fn related-files-fn))
+ project-plist))
+
+(cl-defun projectile-register-project-type
+ (project-type marker-files &key project-file compilation-dir configure compile install package test run test-suffix test-prefix src-dir test-dir related-files-fn)
+ "Register a project type with projectile.
+
+A project type is defined by PROJECT-TYPE, a set of MARKER-FILES,
+and optional keyword arguments:
+PROJECT-FILE the main project file in the root project directory.
+COMPILATION-DIR the directory to run the tests- and compilations in,
+CONFIGURE which specifies a command that configures the project
+ `%s' in the command will be substituted with (projectile-project-root)
+ before the command is run,
+COMPILE which specifies a command that builds the project,
+INSTALL which specifies a command to install the project.
+PACKAGE which specifies a command to package the project.
+TEST which specified a command that tests the project,
+RUN which specifies a command that runs the project,
+TEST-SUFFIX which specifies test file suffix, and
+TEST-PREFIX which specifies test file prefix.
+SRC-DIR which specifies the path to the source relative to the project root.
+TEST-DIR which specifies the path to the tests relative to the project root.
+RELATED-FILES-FN which specifies a custom function to find the related
+files such as test/impl/other files as below:
+ CUSTOM-FUNCTION accepts FILE as relative path from the project root and
+ returns a plist containing :test, :impl or :other as key and the
+ relative path/paths or predicate as value. PREDICATE accepts a
+ relative path as the input."
+ (setq projectile-project-types
+ (cons `(,project-type .
+ ,(projectile--build-project-plist
+ marker-files
+ :project-file project-file
+ :compilation-dir compilation-dir
+ :configure configure
+ :compile compile
+ :install install
+ :package package
+ :test test
+ :run run
+ :test-suffix test-suffix
+ :test-prefix test-prefix
+ :src-dir src-dir
+ :test-dir test-dir
+ :related-files-fn related-files-fn))
+ projectile-project-types)))
+
+(cl-defun projectile-update-project-type
+ (project-type
+ &key precedence
+ (marker-files nil marker-files-specified)
+ (project-file nil project-file-specified)
+ (compilation-dir nil compilation-dir-specified)
+ (configure nil configure-specified)
+ (compile nil compile-specified)
+ (install nil install-specified)
+ (package nil package-specified)
+ (test nil test-specified)
+ (run nil run-specified)
+ (test-suffix nil test-suffix-specified)
+ (test-prefix nil test-prefix-specified)
+ (src-dir nil src-dir-specified)
+ (test-dir nil test-dir-specified)
+ (related-files-fn nil related-files-fn-specified))
+ "Update an existing projectile project type.
+
+Passed items will override existing values for the project type given
+by PROJECT-TYPE. nil can be used to remove a project type attribute. Raise
+an error if PROJECT-TYPE is not already registered with projectile. This
+function may also take the keyword argument PRECEDENCE which when set to ‘high’
+will make projectile prioritise this project type over other clashing project
+types, and a value of ‘low’ will make projectile prefer (all) other project
+types by default. Otherwise, the arguments to this function are as for
+`projectile-register-project-type':
+
+A project type is defined by PROJECT-TYPE, a set of MARKER-FILES,
+and optional keyword arguments:
+MARKER-FILES a set of indicator files for PROJECT-TYPE.
+PROJECT-FILE the main project file in the root project directory.
+COMPILATION-DIR the directory to run the tests- and compilations in,
+CONFIGURE which specifies a command that configures the project
+ `%s' in the command will be substituted with (projectile-project-root)
+ before the command is run,
+COMPILE which specifies a command that builds the project,
+INSTALL which specifies a command to install the project.
+PACKAGE which specifies a command to package the project.
+TEST which specified a command that tests the project,
+RUN which specifies a command that runs the project,
+TEST-SUFFIX which specifies test file suffix, and
+TEST-PREFIX which specifies test file prefix.
+SRC-DIR which specifies the path to the source relative to the project root.
+TEST-DIR which specifies the path to the tests relative to the project root.
+RELATED-FILES-FN which specifies a custom function to find the related
+files such as test/impl/other files as below:
+ CUSTOM-FUNCTION accepts FILE as relative path from the project root and
+ returns a plist containing :test, :impl or :other as key and the
+ relative path/paths or predicate as value. PREDICATE accepts a
+ relative path as the input."
+ (let* ((existing-project-plist
+ (or (cl-find-if
+ (lambda (p) (eq project-type (car p))) projectile-project-types)
+ (error "No existing project found for: %s" project-type)))
+ (new-plist
+ (append
+ (when marker-files-specified `(marker-files ,marker-files))
+ (when project-file-specified `(project-file ,project-file))
+ (when compilation-dir-specified `(compilation-dir ,compilation-dir))
+ (when configure-specified `(configure-command ,configure))
+ (when compile-specified `(compile-command ,compile))
+ (when test-specified `(test-command ,test))
+ (when install-specified `(install-command ,install))
+ (when package-specified `(package-command ,package))
+ (when run-specified `(run-command ,run))
+ (when test-suffix-specified `(test-suffix ,test-suffix))
+ (when test-prefix-specified `(test-prefix ,test-prefix))
+ (when src-dir-specified `(src-dir ,src-dir))
+ (when test-dir-specified `(test-dir ,test-dir))
+ (when related-files-fn-specified
+ `(related-files-fn ,related-files-fn))))
+ (merged-plist
+ (projectile--combine-plists
+ (cdr existing-project-plist) new-plist))
+ (project-type-elt (cons project-type merged-plist)))
+ (cl-flet* ((project-filter (p) (eq project-type (car p)))
+ (project-map (p) (if (project-filter p) project-type-elt p)))
+ (setq projectile-project-types
+ (if precedence
+ (let ((filtered-types
+ (cl-remove-if #'project-filter projectile-project-types)))
+ (setq projectile-project-type-cache (make-hash-table))
+ (cond ((eq precedence 'high)
+ (cons project-type-elt filtered-types))
+ ((eq precedence 'low)
+ (append filtered-types (list project-type-elt)))
+ (t (error "Precendence must be one of '(high low)"))))
+ (mapcar #'project-map projectile-project-types))))))
+
+(defun projectile-cabal-project-p ()
+ "Check if a project contains *.cabal files but no stack.yaml file."
+ (and (projectile-verify-file-wildcard "?*.cabal")
+ (not (projectile-verify-file "stack.yaml"))))
+
+(defun projectile-dotnet-project-p ()
+ "Check if a project contains a .NET project marker."
+ (or (projectile-verify-file-wildcard "?*.csproj")
+ (projectile-verify-file-wildcard "?*.fsproj")))
+
+(defun projectile-go-project-p ()
+ "Check if a project contains Go source files."
+ (or (projectile-verify-file "go.mod")
+ (projectile-verify-file-wildcard "*.go")))
+
+(defcustom projectile-go-project-test-function #'projectile-go-project-p
+ "Function to determine if project's type is go."
+ :group 'projectile
+ :type 'function
+ :package-version '(projectile . "1.0.0"))
+
+;;;; Constant signifying opting out of CMake preset commands.
+(defconst projectile--cmake-no-preset "*no preset*")
+
+(defun projectile--cmake-version ()
+ "Compute CMake version."
+ (let* ((string (shell-command-to-string "cmake --version"))
+ (match (string-match "^cmake version \\(.*\\)$" string)))
+ (when match
+ (version-to-list (match-string 1 string)))))
+
+(defun projectile--cmake-check-version (version)
+ "Check if CMake version is at least VERSION."
+ (and
+ (version-list-<= version (projectile--cmake-version))))
+
+(defconst projectile--cmake-command-presets-minimum-version-alist
+ '((:configure-command . (3 19))
+ (:compile-command . (3 20))
+ (:test-command . (3 20))))
+
+(defun projectile--cmake-command-presets-supported (command-type)
+ "Check if CMake supports presets for COMMAND-TYPE."
+ (let ((minimum-version
+ (cdr (assoc command-type projectile--cmake-command-presets-minimum-version-alist))))
+ (projectile--cmake-check-version minimum-version)))
+
+(defun projectile--cmake-read-preset (filename)
+ "Read CMake preset from FILENAME."
+ (when (file-exists-p filename)
+ (with-temp-buffer
+ (insert-file-contents filename)
+ (when (functionp 'json-parse-buffer)
+ (json-parse-buffer :array-type 'list)))))
+
+(defconst projectile--cmake-command-preset-array-id-alist
+ '((:configure-command . "configurePresets")
+ (:compile-command . "buildPresets")
+ (:test-command . "testPresets")))
+
+(defun projectile--cmake-command-preset-array-id (command-type)
+ "Map from COMMAND-TYPE to id of command preset array in CMake preset."
+ (cdr (assoc command-type projectile--cmake-command-preset-array-id-alist)))
+
+(defun projectile--cmake-command-presets (filename command-type)
+ "Get CMake COMMAND-TYPE presets from FILENAME."
+ (when-let ((preset (projectile--cmake-read-preset (projectile-expand-root filename))))
+ (cl-remove-if
+ (lambda (preset) (equal (gethash "hidden" preset) t))
+ (gethash (projectile--cmake-command-preset-array-id command-type) preset))))
+
+(defun projectile--cmake-all-command-presets (command-type)
+ "Get CMake user and system COMMAND-TYPE presets."
+ (projectile-flatten
+ (mapcar (lambda (filename) (projectile--cmake-command-presets filename command-type))
+ '("CMakeUserPresets.json" "CMakePresets.json"))))
+
+(defun projectile--cmake-command-preset-names (command-type)
+ "Get names of CMake user and system COMMAND-TYPE presets."
+ (mapcar (lambda (preset)
+ (gethash "name" preset))
+ (projectile--cmake-all-command-presets command-type)))
+
+(defcustom projectile-enable-cmake-presets nil
+ "Enables configuration with CMake presets.
+
+When `projectile-enable-cmake-presets' is non-nil, CMake projects can
+be configured, built and tested using presets."
+ :group 'projectile
+ :type 'boolean
+ :package-version '(projectile . "2.4.0"))
+
+(defun projectile--cmake-use-command-presets (command-type)
+ "Test whether or not to use command presets for COMMAND-TYPE.
+
+Presets are used if `projectile-enable-cmake-presets' is non-nil, and CMake
+supports presets for COMMAND-TYPE, and `json-parse-buffer' is available."
+ (and projectile-enable-cmake-presets
+ (projectile--cmake-command-presets-supported command-type)
+ (functionp 'json-parse-buffer)))
+
+(defun projectile--cmake-select-command (command-type)
+ "Select a CMake command preset or a manual CMake command.
+
+The selection is done like this:
+
+- If `projectile--cmake-use-commands-presets' for COMMAND-TYPE returns true, and
+there is at least one preset available for COMMAND-TYPE, the user is prompted to
+select a name of a command preset, or opt a manual command by selecting
+`projectile--cmake-no-preset'.
+
+- Else `projectile--cmake-no-preset' is used."
+ (if-let ((use-presets (projectile--cmake-use-command-presets command-type))
+ (preset-names (projectile--cmake-command-preset-names command-type)))
+ (projectile-completing-read
+ "Use preset: "
+ (append preset-names `(,projectile--cmake-no-preset)))
+ projectile--cmake-no-preset))
+
+(defconst projectile--cmake-manual-command-alist
+ '((:configure-command . "cmake -S . -B build")
+ (:compile-command . "cmake --build build")
+ (:test-command . "cmake --build build --target test")
+ (:install-command . "cmake --build build --target install")))
+
+(defun projectile--cmake-manual-command (command-type)
+ "Create maunual CMake COMMAND-TYPE command."
+ (cdr (assoc command-type projectile--cmake-manual-command-alist)))
+
+(defconst projectile--cmake-preset-command-alist
+ '((:configure-command . "cmake . --preset %s")
+ (:compile-command . "cmake --build --preset %s")
+ (:test-command . "ctest --preset %s")
+ (:install-command . "cmake --build --preset %s --target install")))
+
+(defun projectile--cmake-preset-command (command-type preset)
+ "Create CMake COMMAND-TYPE command using PRESET."
+ (format (cdr (assoc command-type projectile--cmake-preset-command-alist)) preset))
+
+(defun projectile--cmake-command (command-type)
+ "Create a CMake COMMAND-TYPE command.
+
+The command is created like this:
+
+- If `projectile--cmake-select-command' returns `projectile--cmake-no-preset'
+a manual COMMAND-TYPE command is created with
+`projectile--cmake-manual-command'.
+
+- Else a preset COMMAND-TYPE command using the selected preset is created with
+`projectile--cmake-preset-command'."
+ (let ((maybe-preset (projectile--cmake-select-command command-type)))
+ (if (equal maybe-preset projectile--cmake-no-preset)
+ (projectile--cmake-manual-command command-type)
+ (projectile--cmake-preset-command command-type maybe-preset))))
+
+(defun projectile--cmake-configure-command ()
+ "CMake configure command."
+ (projectile--cmake-command :configure-command))
+
+(defun projectile--cmake-compile-command ()
+ "CMake compile command."
+ (projectile--cmake-command :compile-command))
+
+(defun projectile--cmake-test-command ()
+ "CMake test command."
+ (projectile--cmake-command :test-command))
+
+(defun projectile--cmake-install-command ()
+ "CMake install command."
+ (projectile--cmake-command :install-command))
+
+;;; Project type registration
+;;
+;; Project type detection happens in a reverse order with respect to
+;; project type registration (invocations of `projectile-register-project-type').
+;;
+;; As function-based project type detection is pretty slow, so it
+;; should be tried at the end if everything else failed (meaning here
+;; it should be listed first).
+;;
+;; Ideally common project types should be checked earlier than exotic ones.
+
+;; Function-based detection project type
+(projectile-register-project-type 'haskell-cabal #'projectile-cabal-project-p
+ :compile "cabal build"
+ :test "cabal test"
+ :run "cabal run"
+ :test-suffix "Spec")
+(projectile-register-project-type 'dotnet #'projectile-dotnet-project-p
+ :compile "dotnet build"
+ :run "dotnet run"
+ :test "dotnet test")
+(projectile-register-project-type 'go projectile-go-project-test-function
+ :compile "go build"
+ :test "go test ./..."
+ :test-suffix "_test")
+;; File-based detection project types
+
+;; Universal
+(projectile-register-project-type 'scons '("SConstruct")
+ :project-file "SConstruct"
+ :compile "scons"
+ :test "scons test"
+ :test-suffix "test")
+(projectile-register-project-type 'meson '("meson.build")
+ :project-file "meson.build"
+ :compilation-dir "build"
+ :configure "meson %s"
+ :compile "ninja"
+ :test "ninja test")
+(projectile-register-project-type 'nix '("default.nix")
+ :project-file "default.nix"
+ :compile "nix-build"
+ :test "nix-build")
+(projectile-register-project-type 'nix-flake '("flake.nix")
+ :project-file "flake.nix"
+ :compile "nix build"
+ :test "nix flake check"
+ :run "nix run")
+(projectile-register-project-type 'bazel '("WORKSPACE")
+ :project-file "WORKSPACE"
+ :compile "bazel build"
+ :test "bazel test"
+ :run "bazel run")
+(projectile-register-project-type 'debian '("debian/control")
+ :project-file "debian/control"
+ :compile "debuild -uc -us")
+
+;; Make & CMake
+(projectile-register-project-type 'make '("Makefile")
+ :project-file "Makefile"
+ :compile "make"
+ :test "make test"
+ :install "make install")
+(projectile-register-project-type 'gnumake '("GNUMakefile")
+ :project-file "GNUMakefile"
+ :compile "make"
+ :test "make test"
+ :install "make install")
+(projectile-register-project-type 'cmake '("CMakeLists.txt")
+ :project-file "CMakeLists.txt"
+ :configure #'projectile--cmake-configure-command
+ :compile #'projectile--cmake-compile-command
+ :test #'projectile--cmake-test-command
+ :install #'projectile--cmake-install-command
+ :package "cmake --build build --target package")
+;; PHP
+(projectile-register-project-type 'php-symfony '("composer.json" "app" "src" "vendor")
+ :project-file "composer.json"
+ :compile "app/console server:run"
+ :test "phpunit -c app "
+ :test-suffix "Test")
+;; Erlang & Elixir
+(projectile-register-project-type 'rebar '("rebar.config")
+ :project-file "rebar.config"
+ :compile "rebar3 compile"
+ :test "rebar3 do eunit,ct"
+ :test-suffix "_SUITE")
+(projectile-register-project-type 'elixir '("mix.exs")
+ :project-file "mix.exs"
+ :compile "mix compile"
+ :src-dir "lib/"
+ :test "mix test"
+ :test-suffix "_test")
+;; JavaScript
+(projectile-register-project-type 'grunt '("Gruntfile.js")
+ :project-file "Gruntfile.js"
+ :compile "grunt"
+ :test "grunt test")
+(projectile-register-project-type 'gulp '("gulpfile.js")
+ :project-file "gulpfile.js"
+ :compile "gulp"
+ :test "gulp test")
+(projectile-register-project-type 'npm '("package.json")
+ :project-file "package.json"
+ :compile "npm install"
+ :test "npm test"
+ :test-suffix ".test")
+;; Angular
+(projectile-register-project-type 'angular '("angular.json" ".angular-cli.json")
+ :project-file "angular.json"
+ :compile "ng build"
+ :run "ng serve"
+ :test "ng test"
+ :test-suffix ".spec")
+;; Python
+(projectile-register-project-type 'django '("manage.py")
+ :project-file "manage.py"
+ :compile "python manage.py runserver"
+ :test "python manage.py test"
+ :test-prefix "test_"
+ :test-suffix"_test")
+(projectile-register-project-type 'python-pip '("requirements.txt")
+ :project-file "requirements.txt"
+ :compile "python setup.py build"
+ :test "python -m unittest discover"
+ :test-prefix "test_"
+ :test-suffix"_test")
+(projectile-register-project-type 'python-pkg '("setup.py")
+ :project-file "setup.py"
+ :compile "python setup.py build"
+ :test "python -m unittest discover"
+ :test-prefix "test_"
+ :test-suffix"_test")
+(projectile-register-project-type 'python-tox '("tox.ini")
+ :project-file "tox.ini"
+ :compile "tox -r --notest"
+ :test "tox"
+ :test-prefix "test_"
+ :test-suffix"_test")
+(projectile-register-project-type 'python-pipenv '("Pipfile")
+ :project-file "Pipfile"
+ :compile "pipenv run build"
+ :test "pipenv run test"
+ :test-prefix "test_"
+ :test-suffix "_test")
+(projectile-register-project-type 'python-poetry '("poetry.lock")
+ :project-file "poetry.lock"
+ :compile "poetry build"
+ :test "poetry run python -m unittest discover"
+ :test-prefix "test_"
+ :test-suffix "_test")
+;; Java & friends
+(projectile-register-project-type 'maven '("pom.xml")
+ :project-file "pom.xml"
+ :compile "mvn -B clean install"
+ :test "mvn -B test"
+ :test-suffix "Test"
+ :src-dir "src/main/"
+ :test-dir "src/test/")
+(projectile-register-project-type 'gradle '("build.gradle")
+ :project-file "build.gradle"
+ :compile "gradle build"
+ :test "gradle test"
+ :test-suffix "Spec")
+(projectile-register-project-type 'gradlew '("gradlew")
+ :project-file "gradlew"
+ :compile "./gradlew build"
+ :test "./gradlew test"
+ :test-suffix "Spec")
+(projectile-register-project-type 'grails '("application.properties" "grails-app")
+ :project-file "application.properties"
+ :compile "grails package"
+ :test "grails test-app"
+ :test-suffix "Spec")
+;; Scala
+(projectile-register-project-type 'sbt '("build.sbt")
+ :project-file "build.sbt"
+ :src-dir "main"
+ :test-dir "test"
+ :compile "sbt compile"
+ :test "sbt test"
+ :test-suffix "Spec")
+
+(projectile-register-project-type 'mill '("build.sc")
+ :project-file "build.sc"
+ :compile "mill all __.compile"
+ :test "mill all __.test"
+ :test-suffix "Test")
+
+;; Clojure
+(projectile-register-project-type 'lein-test '("project.clj")
+ :project-file "project.clj"
+ :compile "lein compile"
+ :test "lein test"
+ :test-suffix "_test")
+(projectile-register-project-type 'lein-midje '("project.clj" ".midje.clj")
+ :project-file "project.clj"
+ :compile "lein compile"
+ :test "lein midje"
+ :test-prefix "t_")
+(projectile-register-project-type 'boot-clj '("build.boot")
+ :project-file "build.boot"
+ :compile "boot aot"
+ :test "boot test"
+ :test-suffix "_test")
+(projectile-register-project-type 'clojure-cli '("deps.edn")
+ :project-file "deps.edn"
+ :test-suffix "_test")
+(projectile-register-project-type 'bloop '(".bloop")
+ :project-file ".bloop"
+ :compile "bloop compile root"
+ :test "bloop test --propagate --reporter scalac root"
+ :src-dir "src/main/"
+ :test-dir "src/test/"
+ :test-suffix "Spec")
+;; Ruby
+(projectile-register-project-type 'ruby-rspec '("Gemfile" "lib" "spec")
+ :project-file "Gemfile"
+ :compile "bundle exec rake"
+ :src-dir "lib/"
+ :test "bundle exec rspec"
+ :test-dir "spec/"
+ :test-suffix "_spec")
+(projectile-register-project-type 'ruby-test '("Gemfile" "lib" "test")
+ :project-file "Gemfile"
+ :compile"bundle exec rake"
+ :src-dir "lib/"
+ :test "bundle exec rake test"
+ :test-suffix "_test")
+;; Rails needs to be registered after npm, otherwise `package.json` makes it `npm`.
+;; https://github.com/bbatsov/projectile/pull/1191
+(projectile-register-project-type 'rails-test '("Gemfile" "app" "lib" "db" "config" "test")
+ :project-file "Gemfile"
+ :compile "bundle exec rails server"
+ :src-dir "lib/"
+ :test "bundle exec rake test"
+ :test-suffix "_test")
+(projectile-register-project-type 'rails-rspec '("Gemfile" "app" "lib" "db" "config" "spec")
+ :project-file "Gemfile"
+ :compile "bundle exec rails server"
+ :src-dir "lib/"
+ :test "bundle exec rspec"
+ :test-dir "spec/"
+ :test-suffix "_spec")
+;; Crystal
+(projectile-register-project-type 'crystal-spec '("shard.yml")
+ :project-file "shard.yml"
+ :src-dir "src/"
+ :test "crystal spec"
+ :test-dir "spec/"
+ :test-suffix "_spec")
+
+;; Emacs
+(projectile-register-project-type 'emacs-cask '("Cask")
+ :project-file "Cask"
+ :compile "cask install"
+ :test-prefix "test-"
+ :test-suffix "-test")
+(projectile-register-project-type 'emacs-eldev (lambda () (or (projectile-verify-file "Eldev")
+ (projectile-verify-file "Eldev-local")))
+ :project-file "Eldev"
+ :compile "eldev compile"
+ :test "eldev test"
+ :run "eldev emacs"
+ :package "eldev package")
+
+;; R
+(projectile-register-project-type 'r '("DESCRIPTION")
+ :project-file "DESCRIPTION"
+ :compile "R CMD INSTALL --with-keep.source ."
+ :test (concat "R CMD check -o " temporary-file-directory " ."))
+
+;; Haskell
+(projectile-register-project-type 'haskell-stack '("stack.yaml")
+ :project-file "stack.yaml"
+ :compile "stack build"
+ :test "stack build --test"
+ :test-suffix "Spec")
+
+;; Rust
+(projectile-register-project-type 'rust-cargo '("Cargo.toml")
+ :project-file "Cargo.toml"
+ :compile "cargo build"
+ :test "cargo test"
+ :run "cargo run")
+
+;; Racket
+(projectile-register-project-type 'racket '("info.rkt")
+ :project-file "info.rkt"
+ :test "raco test ."
+ :install "raco pkg install"
+ :package "raco pkg create --source $(pwd)")
+
+;; Dart
+(projectile-register-project-type 'dart '("pubspec.yaml")
+ :project-file "pubspec.yaml"
+ :compile "pub get"
+ :test "pub run test"
+ :run "dart"
+ :test-suffix "_test.dart")
+
+;; OCaml
+(projectile-register-project-type 'ocaml-dune '("dune-project")
+ :project-file "dune-project"
+ :compile "dune build"
+ :test "dune runtest")
+
+(defvar-local projectile-project-type nil
+ "Buffer local var for overriding the auto-detected project type.
+Normally you'd set this from .dir-locals.el.")
+(put 'projectile-project-type 'safe-local-variable #'symbolp)
+
+(defun projectile-detect-project-type ()
+ "Detect the type of the current project.
+Fallsback to a generic project type when the type can't be determined."
+ (let ((project-type
+ (or (car (cl-find-if
+ (lambda (project-type-record)
+ (let ((project-type (car project-type-record))
+ (marker (plist-get (cdr project-type-record) 'marker-files)))
+ (if (functionp marker)
+ (and (funcall marker) project-type)
+ (and (projectile-verify-files marker) project-type))))
+ projectile-project-types))
+ 'generic)))
+ (puthash (projectile-project-root) project-type projectile-project-type-cache)
+ project-type))
+
+(defun projectile-project-type (&optional dir)
+ "Determine a project's type based on its structure.
+When DIR is specified it checks it, otherwise it acts
+on the current project.
+
+The project type is cached for improved performance."
+ (if projectile-project-type
+ projectile-project-type
+ (let* ((dir (or dir default-directory))
+ (project-root (projectile-project-root dir)))
+ (if project-root
+ (or (gethash project-root projectile-project-type-cache)
+ (projectile-detect-project-type))
+ ;; if we're not in a project we just return nil
+ nil))))
+
+;;;###autoload
+(defun projectile-project-info ()
+ "Display info for current project."
+ (interactive)
+ (message "Project dir: %s ## Project VCS: %s ## Project type: %s"
+ (projectile-acquire-root)
+ (projectile-project-vcs)
+ (projectile-project-type)))
+
+(defun projectile-verify-files (files)
+ "Check whether all FILES exist in the current project."
+ (cl-every #'projectile-verify-file files))
+
+(defun projectile-verify-file (file)
+ "Check whether FILE exists in the current project."
+ (file-exists-p (projectile-expand-root file)))
+
+(defun projectile-verify-file-wildcard (file)
+ "Check whether FILE exists in the current project.
+Expands wildcards using `file-expand-wildcards' before checking."
+ (file-expand-wildcards (projectile-expand-root file)))
+
+(defun projectile-project-vcs (&optional project-root)
+ "Determine the VCS used by the project if any.
+PROJECT-ROOT is the targeted directory. If nil, use
+the variable `projectile-project-root'."
+ (or project-root (setq project-root (projectile-acquire-root)))
+ (cond
+ ;; first we check for a VCS marker in the project root itself
+ ((projectile-file-exists-p (expand-file-name ".git" project-root)) 'git)
+ ((projectile-file-exists-p (expand-file-name ".hg" project-root)) 'hg)
+ ((projectile-file-exists-p (expand-file-name ".fslckout" project-root)) 'fossil)
+ ((projectile-file-exists-p (expand-file-name "_FOSSIL_" project-root)) 'fossil)
+ ((projectile-file-exists-p (expand-file-name ".bzr" project-root)) 'bzr)
+ ((projectile-file-exists-p (expand-file-name "_darcs" project-root)) 'darcs)
+ ((projectile-file-exists-p (expand-file-name ".pijul" project-root)) 'pijul)
+ ((projectile-file-exists-p (expand-file-name ".svn" project-root)) 'svn)
+ ;; then we check if there's a VCS marker up the directory tree
+ ;; that covers the case when a project is part of a multi-project repository
+ ;; in those cases you can still the VCS to get a list of files for
+ ;; the project in question
+ ((projectile-locate-dominating-file project-root ".git") 'git)
+ ((projectile-locate-dominating-file project-root ".hg") 'hg)
+ ((projectile-locate-dominating-file project-root ".fslckout") 'fossil)
+ ((projectile-locate-dominating-file project-root "_FOSSIL_") 'fossil)
+ ((projectile-locate-dominating-file project-root ".bzr") 'bzr)
+ ((projectile-locate-dominating-file project-root "_darcs") 'darcs)
+ ((projectile-locate-dominating-file project-root ".pijul") 'pijul)
+ ((projectile-locate-dominating-file project-root ".svn") 'svn)
+ (t 'none)))
+
+(defun projectile--test-name-for-impl-name (impl-file-path)
+ "Determine the name of the test file for IMPL-FILE-PATH.
+
+IMPL-FILE-PATH may be a absolute path, relative path or a file name."
+ (let* ((project-type (projectile-project-type))
+ (impl-file-name (file-name-sans-extension (file-name-nondirectory impl-file-path)))
+ (impl-file-ext (file-name-extension impl-file-path))
+ (test-prefix (funcall projectile-test-prefix-function project-type))
+ (test-suffix (funcall projectile-test-suffix-function project-type)))
+ (cond
+ (test-prefix (concat test-prefix impl-file-name "." impl-file-ext))
+ (test-suffix (concat impl-file-name test-suffix "." impl-file-ext))
+ (t (error "Project type `%s' not supported!" project-type)))))
+
+(defun projectile--impl-name-for-test-name (test-file-path)
+ "Determine the name of the implementation file for TEST-FILE-PATH.
+
+TEST-FILE-PATH may be a absolute path, relative path or a file name."
+ (let* ((project-type (projectile-project-type))
+ (test-file-name (file-name-sans-extension (file-name-nondirectory test-file-path)))
+ (test-file-ext (file-name-extension test-file-path))
+ (test-prefix (funcall projectile-test-prefix-function project-type))
+ (test-suffix (funcall projectile-test-suffix-function project-type)))
+ (cond
+ (test-prefix
+ (concat (string-remove-prefix test-prefix test-file-name) "." test-file-ext))
+ (test-suffix
+ (concat (string-remove-suffix test-suffix test-file-name) "." test-file-ext))
+ (t (error "Project type `%s' not supported!" project-type)))))
+
+(defun projectile--test-to-impl-dir (test-dir-path)
+ "Return the directory path of an impl file with test file in TEST-DIR-PATH.
+
+Occurrences of the current project type's test-dir property (which should be a
+string) are replaced with the current project type's src-dir property
+ (which should be a string) to obtain the new directory.
+
+Nil is returned if either the src-dir or test-dir properties are not strings."
+ (let ((test-dir (projectile-project-type-attribute
+ (projectile-project-type) 'test-dir))
+ (impl-dir (projectile-project-type-attribute
+ (projectile-project-type) 'src-dir)))
+ (when (and (stringp test-dir) (stringp impl-dir))
+ (projectile-complementary-dir test-dir-path test-dir impl-dir))))
+
+(defun projectile--impl-to-test-dir (impl-dir-path)
+ "Return the directory path of a test whose impl file resides in IMPL-DIR-PATH.
+
+Occurrences of the current project type's src-dir property (which should be a
+string) are replaced with the current project type's test-dir property
+ (which should be a string) to obtain the new directory.
+
+Nil is returned if either the src-dir or test-dir properties are not strings."
+ (let ((test-dir (projectile-project-type-attribute
+ (projectile-project-type) 'test-dir))
+ (impl-dir (projectile-project-type-attribute
+ (projectile-project-type) 'src-dir)))
+ (when (and (stringp test-dir) (stringp impl-dir))
+ (projectile-complementary-dir impl-dir-path impl-dir test-dir))))
+
+(defun projectile-complementary-dir (dir-path string replacement)
+ "Return the \"complementary\" directory of DIR-PATH.
+Replace STRING in DIR-PATH with REPLACEMENT."
+ (let* ((project-root (projectile-project-root))
+ (relative-dir (file-name-directory (file-relative-name dir-path project-root))))
+ (projectile-expand-root
+ (replace-regexp-in-string string replacement relative-dir))))
+
+(defun projectile--create-directories-for (path)
+ "Create directories necessary for PATH."
+ (unless (file-exists-p path)
+ (make-directory (if (file-directory-p path)
+ path
+ (file-name-directory path))
+ :create-parents)))
+
+(defun projectile-find-implementation-or-test (file-name)
+ "Given a FILE-NAME return the matching implementation or test filename.
+
+If `projectile-create-missing-test-files' is non-nil, create the missing
+test file."
+ (unless file-name (error "The current buffer is not visiting a file"))
+ (unless (projectile-project-type) (projectile-ensure-project nil))
+ (if (projectile-test-file-p file-name)
+ ;; find the matching impl file
+ (let ((impl-file (projectile-find-matching-file file-name)))
+ (if impl-file
+ (projectile-expand-root impl-file)
+ (error
+ "No matching source file found for project type `%s'"
+ (projectile-project-type))))
+ ;; find the matching test file
+ (let* ((error-msg (format
+ "No matching test file found for project type `%s'"
+ (projectile-project-type)))
+ (test-file (or (projectile-find-matching-test file-name)
+ (error error-msg)))
+ (expanded-test-file (projectile-expand-root test-file)))
+ (cond ((file-exists-p expanded-test-file) expanded-test-file)
+ (projectile-create-missing-test-files
+ (projectile--create-directories-for expanded-test-file)
+ expanded-test-file)
+ (t (progn (error error-msg)))))))
+
+;;;###autoload
+(defun projectile-find-implementation-or-test-other-window ()
+ "Open matching implementation or test file in other window."
+ (interactive)
+ (find-file-other-window
+ (projectile-find-implementation-or-test (buffer-file-name))))
+
+;;;###autoload
+(defun projectile-find-implementation-or-test-other-frame ()
+ "Open matching implementation or test file in other frame."
+ (interactive)
+ (find-file-other-frame
+ (projectile-find-implementation-or-test (buffer-file-name))))
+
+;;;###autoload
+(defun projectile-toggle-between-implementation-and-test ()
+ "Toggle between an implementation file and its test file."
+ (interactive)
+ (find-file
+ (projectile-find-implementation-or-test (buffer-file-name))))
+
+
+(defun projectile-project-type-attribute (project-type key &optional default-value)
+ "Return the value of some PROJECT-TYPE attribute identified by KEY.
+Fallback to DEFAULT-VALUE for missing attributes."
+ (let ((project (alist-get project-type projectile-project-types)))
+ (if (and project (plist-member project key))
+ (plist-get project key)
+ default-value)))
+
+(defun projectile-test-prefix (project-type)
+ "Find default test files prefix based on PROJECT-TYPE."
+ (projectile-project-type-attribute project-type 'test-prefix))
+
+(defun projectile-test-suffix (project-type)
+ "Find default test files suffix based on PROJECT-TYPE."
+ (projectile-project-type-attribute project-type 'test-suffix))
+
+(defun projectile-related-files-fn (project-type)
+ "Find relative file based on PROJECT-TYPE."
+ (projectile-project-type-attribute project-type 'related-files-fn))
+
+(defun projectile-src-directory (project-type)
+ "Find default src directory based on PROJECT-TYPE."
+ (projectile-project-type-attribute project-type 'src-dir "src/"))
+
+(defun projectile-test-directory (project-type)
+ "Find default test directory based on PROJECT-TYPE."
+ (projectile-project-type-attribute project-type 'test-dir "test/"))
+
+(defun projectile-dirname-matching-count (a b)
+ "Count matching dirnames ascending file paths in A and B."
+ (setq a (reverse (split-string (or (file-name-directory a) "") "/" t))
+ b (reverse (split-string (or (file-name-directory b) "") "/" t)))
+ (let ((common 0))
+ (while (and a b (string-equal (pop a) (pop b)))
+ (setq common (1+ common)))
+ common))
+
+(defun projectile-group-file-candidates (file candidates)
+ "Group file candidates by dirname matching count."
+ (cl-sort (copy-sequence
+ (let (value result)
+ (while (setq value (pop candidates))
+ (let* ((key (projectile-dirname-matching-count file value))
+ (kv (assoc key result)))
+ (if kv
+ (setcdr kv (cons value (cdr kv)))
+ (push (list key value) result))))
+ (mapcar (lambda (x)
+ (cons (car x) (nreverse (cdr x))))
+ (nreverse result))))
+ (lambda (a b) (> (car a) (car b)))))
+
+(defun projectile--best-or-all-candidates-based-on-parents-dirs (file candidates)
+ "Return a list of the best one one for FILE from CANDIDATES or all CANDIDATES."
+ (let ((grouped-candidates (projectile-group-file-candidates file candidates)))
+ (if (= (length (car grouped-candidates)) 2)
+ (list (car (last (car grouped-candidates))))
+ (apply #'append (mapcar #'cdr grouped-candidates)))))
+
+(defun projectile--impl-to-test-predicate (impl-file)
+ "Return a predicate, which returns t for any test files for IMPL-FILE."
+ (let* ((basename (file-name-sans-extension (file-name-nondirectory impl-file)))
+ (test-prefix (funcall projectile-test-prefix-function (projectile-project-type)))
+ (test-suffix (funcall projectile-test-suffix-function (projectile-project-type)))
+ (prefix-name (when test-prefix (concat test-prefix basename)))
+ (suffix-name (when test-suffix (concat basename test-suffix))))
+ (lambda (current-file)
+ (let ((name (file-name-sans-extension (file-name-nondirectory current-file))))
+ (or (string-equal prefix-name name)
+ (string-equal suffix-name name))))))
+
+(defun projectile--complementary-file (file-path dir-fn filename-fn)
+ "Apply DIR-FN and FILENAME-FN to the directory and name of FILE-PATH.
+
+More specifically, return DIR-FN applied to the directory of FILE-PATH
+concatenated with FILENAME-FN applied to the file name of FILE-PATH.
+
+If either function returns nil, return nil."
+ (let ((filename (file-name-nondirectory file-path)))
+ (when-let ((complementary-filename (funcall filename-fn filename))
+ (dir (funcall dir-fn (file-name-directory file-path))))
+ (concat (file-name-as-directory dir) complementary-filename))))
+
+(defun projectile--impl-file-from-src-dir-str (file-name)
+ "Get the relative path of the implementation file FILE-NAME.
+Return a path relative to the project root for the impl file of FILE-NAME
+using the src-dir and test-dir properties of the current project type which
+should be strings, nil returned if this is not the case."
+ (when-let ((complementary-file (projectile--complementary-file
+ file-name
+ #'projectile--test-to-impl-dir
+ #'projectile--impl-name-for-test-name)))
+ (file-relative-name complementary-file (projectile-project-root))))
+
+(defun projectile--test-file-from-test-dir-str (file-name)
+ "Get the relative path of the test file FILE-NAME.
+Return a path relative to the project root for the test file of FILE-NAME
+using the src-dir and test-dir properties of the current project type which
+should be strings, nil returned if this is not the case."
+ (when-let (complementary-file (projectile--complementary-file
+ file-name
+ #'projectile--impl-to-test-dir
+ #'projectile--test-name-for-impl-name))
+ (file-relative-name complementary-file (projectile-project-root))))
+
+(defun projectile--impl-file-from-src-dir-fn (test-file)
+ "Get the relative path to the implementation file corresponding to TEST-FILE.
+Return the implementation file path for the absolute path TEST-FILE
+relative to the project root in the case the current project type's src-dir
+has been set to a custom function, return nil if this is not the case or
+the path points to a file that does not exist."
+ (when-let ((src-dir (projectile-src-directory (projectile-project-type))))
+ (when (functionp src-dir)
+ (let ((impl-file (projectile--complementary-file
+ test-file
+ src-dir
+ #'projectile--impl-name-for-test-name)))
+ (when (file-exists-p impl-file)
+ (file-relative-name impl-file (projectile-project-root)))))))
+
+(defun projectile--test-file-from-test-dir-fn (impl-file)
+ "Get the relative path to the test file corresponding to IMPL-FILE.
+Return the test file path for the absolute path IMPL-FILE relative to the
+project root, in the case the current project type's test-dir has been set
+to a custom function, else return nil."
+ (when-let ((test-dir (projectile-test-directory (projectile-project-type))))
+ (when (functionp test-dir)
+ (file-relative-name
+ (projectile--complementary-file
+ impl-file
+ test-dir
+ #'projectile--test-name-for-impl-name)
+ (projectile-project-root)))))
+
+(defun projectile--find-matching-test (impl-file)
+ "Return a list of test files for IMPL-FILE.
+
+The precendence for determining test files to return is:
+
+1. Use the project type's test-dir property if it's set to a function
+2. Use the project type's related-files-fn property if set
+3. Use the project type's test-dir property if it's set to a string
+4. Default to a fallback which matches all project files against
+ `projectile--impl-to-test-predicate'"
+ (if-let ((test-file-from-test-dir-fn
+ (projectile--test-file-from-test-dir-fn impl-file)))
+ (list test-file-from-test-dir-fn)
+ (if-let ((plist (projectile--related-files-plist-by-kind impl-file :test)))
+ (projectile--related-files-from-plist plist)
+ (if-let ((test-file (projectile--test-file-from-test-dir-str impl-file)))
+ (list test-file)
+ (when-let ((predicate (projectile--impl-to-test-predicate impl-file)))
+ (projectile--best-or-all-candidates-based-on-parents-dirs
+ impl-file (cl-remove-if-not predicate (projectile-current-project-files))))))))
+
+(defun projectile--test-to-impl-predicate (test-file)
+ "Return a predicate, which returns t for any impl files for TEST-FILE."
+ (let* ((basename (file-name-sans-extension (file-name-nondirectory test-file)))
+ (test-prefix (funcall projectile-test-prefix-function (projectile-project-type)))
+ (test-suffix (funcall projectile-test-suffix-function (projectile-project-type))))
+ (lambda (current-file)
+ (let ((name (file-name-nondirectory (file-name-sans-extension current-file))))
+ (or (when test-prefix (string-equal (concat test-prefix name) basename))
+ (when test-suffix (string-equal (concat name test-suffix) basename)))))))
+
+(defun projectile--find-matching-file (test-file)
+ "Return a list of impl files tested by TEST-FILE.
+
+The precendence for determining implementation files to return is:
+
+1. Use the project type's src-dir property if it's set to a function
+2. Use the project type's related-files-fn property if set
+3. Use the project type's src-dir property if it's set to a string
+4. Default to a fallback which matches all project files against
+ `projectile--test-to-impl-predicate'"
+ (if-let ((impl-file-from-src-dir-fn
+ (projectile--impl-file-from-src-dir-fn test-file)))
+ (list impl-file-from-src-dir-fn)
+ (if-let ((plist (projectile--related-files-plist-by-kind test-file :impl)))
+ (projectile--related-files-from-plist plist)
+ (if-let ((impl-file (projectile--impl-file-from-src-dir-str test-file)))
+ (list impl-file)
+ (when-let ((predicate (projectile--test-to-impl-predicate test-file)))
+ (projectile--best-or-all-candidates-based-on-parents-dirs
+ test-file (cl-remove-if-not predicate (projectile-current-project-files))))))))
+
+(defun projectile--choose-from-candidates (candidates)
+ "Choose one item from CANDIDATES."
+ (if (= (length candidates) 1)
+ (car candidates)
+ (projectile-completing-read "Switch to: " candidates)))
+
+(defun projectile-find-matching-test (impl-file)
+ "Compute the name of the test matching IMPL-FILE."
+ (if-let ((candidates (projectile--find-matching-test impl-file)))
+ (projectile--choose-from-candidates candidates)))
+
+(defun projectile-find-matching-file (test-file)
+ "Compute the name of a file matching TEST-FILE."
+ (if-let ((candidates (projectile--find-matching-file test-file)))
+ (projectile--choose-from-candidates candidates)))
+
+(defun projectile-grep-default-files ()
+ "Try to find a default pattern for `projectile-grep'.
+This is a subset of `grep-read-files', where either a matching entry from
+`grep-files-aliases' or file name extension pattern is returned."
+ (when buffer-file-name
+ (let* ((fn (file-name-nondirectory buffer-file-name))
+ (default-alias
+ (let ((aliases (remove (assoc "all" grep-files-aliases)
+ grep-files-aliases))
+ alias)
+ (while aliases
+ (setq alias (car aliases)
+ aliases (cdr aliases))
+ (if (string-match (mapconcat
+ #'wildcard-to-regexp
+ (split-string (cdr alias) nil t)
+ "\\|")
+ fn)
+ (setq aliases nil)
+ (setq alias nil)))
+ (cdr alias)))
+ (default-extension
+ (let ((ext (file-name-extension fn)))
+ (and ext (concat "*." ext)))))
+ (or default-alias default-extension))))
+
+(defun projectile--globally-ignored-file-suffixes-glob ()
+ "Return ignored file suffixes as a list of glob patterns."
+ (mapcar (lambda (pat) (concat "*" pat)) projectile-globally-ignored-file-suffixes))
+
+(defun projectile--read-search-string-with-default (prefix-label)
+ (let* ((prefix-label (projectile-prepend-project-name prefix-label))
+ (default-value (projectile-symbol-or-selection-at-point))
+ (default-label (if (or (not default-value)
+ (string= default-value ""))
+ ""
+ (format " (default %s)" default-value))))
+ (read-string (format "%s%s: " prefix-label default-label) nil nil default-value)))
+
+(defvar projectile-grep-find-ignored-paths)
+(defvar projectile-grep-find-unignored-paths)
+(defvar projectile-grep-find-ignored-patterns)
+(defvar projectile-grep-find-unignored-patterns)
+
+(defun projectile-rgrep-default-command (regexp files dir)
+ "Compute the command for \\[rgrep] to use by default.
+
+Extension of the Emacs 25.1 implementation of `rgrep-default-command', with
+which it shares its arglist."
+ (require 'find-dired) ; for `find-name-arg'
+ (grep-expand-template
+ grep-find-template
+ regexp
+ (concat (shell-quote-argument "(")
+ " " find-name-arg " "
+ (mapconcat
+ #'shell-quote-argument
+ (split-string files)
+ (concat " -o " find-name-arg " "))
+ " "
+ (shell-quote-argument ")"))
+ dir
+ (concat
+ (and grep-find-ignored-directories
+ (concat "-type d "
+ (shell-quote-argument "(")
+ ;; we should use shell-quote-argument here
+ " -path "
+ (mapconcat
+ #'identity
+ (delq nil (mapcar
+ #'(lambda (ignore)
+ (cond ((stringp ignore)
+ (shell-quote-argument
+ (concat "*/" ignore)))
+ ((consp ignore)
+ (and (funcall (car ignore) dir)
+ (shell-quote-argument
+ (concat "*/"
+ (cdr ignore)))))))
+ grep-find-ignored-directories))
+ " -o -path ")
+ " "
+ (shell-quote-argument ")")
+ " -prune -o "))
+ (and grep-find-ignored-files
+ (concat (shell-quote-argument "!") " -type d "
+ (shell-quote-argument "(")
+ ;; we should use shell-quote-argument here
+ " -name "
+ (mapconcat
+ #'(lambda (ignore)
+ (cond ((stringp ignore)
+ (shell-quote-argument ignore))
+ ((consp ignore)
+ (and (funcall (car ignore) dir)
+ (shell-quote-argument
+ (cdr ignore))))))
+ grep-find-ignored-files
+ " -o -name ")
+ " "
+ (shell-quote-argument ")")
+ " -prune -o "))
+ (and projectile-grep-find-ignored-paths
+ (concat (shell-quote-argument "(")
+ " -path "
+ (mapconcat
+ (lambda (ignore) (shell-quote-argument
+ (concat "./" ignore)))
+ projectile-grep-find-ignored-paths
+ " -o -path ")
+ " "
+ (shell-quote-argument ")")
+ " -prune -o "))
+ (and projectile-grep-find-ignored-patterns
+ (concat (shell-quote-argument "(")
+ (and (or projectile-grep-find-unignored-paths
+ projectile-grep-find-unignored-patterns)
+ (concat " "
+ (shell-quote-argument "(")))
+ " -path "
+ (mapconcat
+ (lambda (ignore)
+ (shell-quote-argument
+ (if (string-prefix-p "*" ignore) ignore
+ (concat "*/" ignore))))
+ projectile-grep-find-ignored-patterns
+ " -o -path ")
+ (and (or projectile-grep-find-unignored-paths
+ projectile-grep-find-unignored-patterns)
+ (concat " "
+ (shell-quote-argument ")")
+ " -a "
+ (shell-quote-argument "!")
+ " "
+ (shell-quote-argument "(")
+ (and projectile-grep-find-unignored-paths
+ (concat " -path "
+ (mapconcat
+ (lambda (ignore) (shell-quote-argument
+ (concat "./" ignore)))
+ projectile-grep-find-unignored-paths
+ " -o -path ")))
+ (and projectile-grep-find-unignored-paths
+ projectile-grep-find-unignored-patterns
+ " -o")
+ (and projectile-grep-find-unignored-patterns
+ (concat " -path "
+ (mapconcat
+ (lambda (ignore)
+ (shell-quote-argument
+ (if (string-prefix-p "*" ignore) ignore
+ (concat "*/" ignore))))
+ projectile-grep-find-unignored-patterns
+ " -o -path ")))
+ " "
+ (shell-quote-argument ")")))
+ " "
+ (shell-quote-argument ")")
+ " -prune -o ")))))
+
+;;;###autoload
+(defun projectile-grep (&optional regexp arg)
+ "Perform rgrep in the project.
+
+With a prefix ARG asks for files (globbing-aware) which to grep in.
+With prefix ARG of `-' (such as `M--'), default the files (without prompt),
+to `projectile-grep-default-files'.
+
+With REGEXP given, don't query the user for a regexp."
+ (interactive "i\nP")
+ (require 'grep) ;; for `rgrep'
+ (let* ((roots (projectile-get-project-directories (projectile-acquire-root)))
+ (search-regexp (or regexp
+ (projectile--read-search-string-with-default "Grep for")))
+ (files (and arg (or (and (equal current-prefix-arg '-)
+ (projectile-grep-default-files))
+ (read-string (projectile-prepend-project-name "Grep in: ")
+ (projectile-grep-default-files))))))
+ (dolist (root-dir roots)
+ (require 'vc-git) ;; for `vc-git-grep'
+ ;; in git projects users have the option to use `vc-git-grep' instead of `rgrep'
+ (if (and (eq (projectile-project-vcs) 'git)
+ projectile-use-git-grep
+ (fboundp 'vc-git-grep))
+ (vc-git-grep search-regexp (or files "") root-dir)
+ ;; paths for find-grep should relative and without trailing /
+ (let ((grep-find-ignored-files
+ (cl-union (projectile--globally-ignored-file-suffixes-glob)
+ grep-find-ignored-files))
+ (projectile-grep-find-ignored-paths
+ (append (mapcar (lambda (f) (directory-file-name (file-relative-name f root-dir)))
+ (projectile-ignored-directories))
+ (mapcar (lambda (file)
+ (file-relative-name file root-dir))
+ (projectile-ignored-files))))
+ (projectile-grep-find-unignored-paths
+ (append (mapcar (lambda (f) (directory-file-name (file-relative-name f root-dir)))
+ (projectile-unignored-directories))
+ (mapcar (lambda (file)
+ (file-relative-name file root-dir))
+ (projectile-unignored-files))))
+ (projectile-grep-find-ignored-patterns (projectile-patterns-to-ignore))
+ (projectile-grep-find-unignored-patterns (projectile-patterns-to-ensure)))
+ (grep-compute-defaults)
+ (cl-letf (((symbol-function 'rgrep-default-command) #'projectile-rgrep-default-command))
+ (rgrep search-regexp (or files "* .*") root-dir)
+ (when (get-buffer "*grep*")
+ ;; When grep is using a global *grep* buffer rename it to be
+ ;; scoped to the current root to allow multiple concurrent grep
+ ;; operations, one per root
+ (with-current-buffer "*grep*"
+ (rename-buffer (concat "*grep <" root-dir ">*"))))))))
+ (run-hooks 'projectile-grep-finished-hook)))
+
+;;;###autoload
+(defun projectile-ag (search-term &optional arg)
+ "Run an ag search with SEARCH-TERM in the project.
+
+With an optional prefix argument ARG SEARCH-TERM is interpreted as a
+regular expression."
+ (interactive
+ (list (projectile--read-search-string-with-default
+ (format "Ag %ssearch for" (if current-prefix-arg "regexp " "")))
+ current-prefix-arg))
+ (if (require 'ag nil 'noerror)
+ (let ((ag-command (if arg 'ag-regexp 'ag))
+ (ag-ignore-list (delq nil
+ (delete-dups
+ (append
+ ag-ignore-list
+ (projectile-ignored-files-rel)
+ (projectile-ignored-directories-rel)
+ (projectile--globally-ignored-file-suffixes-glob)
+ ;; ag supports git ignore files directly
+ (unless (eq (projectile-project-vcs) 'git)
+ (append grep-find-ignored-files
+ grep-find-ignored-directories
+ '()))))))
+ ;; reset the prefix arg, otherwise it will affect the ag-command
+ (current-prefix-arg nil))
+ (funcall ag-command search-term (projectile-acquire-root)))
+ (error "Package 'ag' is not available")))
+
+;;;###autoload
+(defun projectile-ripgrep (search-term &optional arg)
+ "Run a ripgrep (rg) search with `SEARCH-TERM' at current project root.
+
+With an optional prefix argument ARG SEARCH-TERM is interpreted as a
+regular expression.
+
+This command depends on of the Emacs packages ripgrep or rg being
+installed to work."
+ (interactive
+ (list (projectile--read-search-string-with-default
+ (format "Ripgrep %ssearch for" (if current-prefix-arg "regexp " "")))
+ current-prefix-arg))
+ (let ((args (mapcar (lambda (val) (concat "--glob !" val))
+ (append projectile-globally-ignored-files
+ projectile-globally-ignored-directories))))
+ ;; we rely on the external packages ripgrep and rg for the actual search
+ ;;
+ ;; first we check if we can load ripgrep
+ (cond ((require 'ripgrep nil 'noerror)
+ (ripgrep-regexp search-term
+ (projectile-acquire-root)
+ (if arg
+ args
+ (cons "--fixed-strings" args))))
+ ;; and then we try rg
+ ((require 'rg nil 'noerror)
+ (rg-run search-term
+ "*" ;; all files
+ (projectile-acquire-root)
+ (not arg) ;; literal search?
+ nil ;; no need to confirm
+ args))
+ (t (error "Packages `ripgrep' and `rg' are not available")))))
+
+(defun projectile-tags-exclude-patterns ()
+ "Return a string with exclude patterns for ctags."
+ (mapconcat (lambda (pattern) (format "--exclude=\"%s\""
+ (directory-file-name pattern)))
+ (append
+ (projectile-ignored-directories-rel)
+ (projectile-patterns-to-ignore)) " "))
+
+;;;###autoload
+(defun projectile-regenerate-tags ()
+ "Regenerate the project's [e|g]tags."
+ (interactive)
+ (if (and (boundp 'ggtags-mode)
+ (memq projectile-tags-backend '(auto ggtags)))
+ (progn
+ (let* ((ggtags-project-root (projectile-acquire-root))
+ (default-directory ggtags-project-root))
+ (ggtags-ensure-project)
+ (ggtags-update-tags t)))
+ (let* ((project-root (projectile-acquire-root))
+ (tags-exclude (projectile-tags-exclude-patterns))
+ (default-directory project-root)
+ (tags-file (expand-file-name projectile-tags-file-name))
+ (command (format projectile-tags-command
+ (or (file-remote-p tags-file 'localname) tags-file)
+ tags-exclude
+ "."))
+ shell-output exit-code)
+ (with-temp-buffer
+ (setq exit-code
+ (process-file-shell-command command nil (current-buffer))
+ shell-output (string-trim
+ (buffer-substring (point-min) (point-max)))))
+ (unless (zerop exit-code)
+ (error shell-output))
+ (visit-tags-table tags-file)
+ (message "Regenerated %s" tags-file))))
+
+(defun projectile-visit-project-tags-table ()
+ "Visit the current project's tags table."
+ (when (projectile-project-p)
+ (let ((tags-file (projectile-expand-root projectile-tags-file-name)))
+ (when (file-exists-p tags-file)
+ (with-demoted-errors "Error loading tags-file: %s"
+ (visit-tags-table tags-file t))))))
+
+(defun projectile-determine-find-tag-fn ()
+ "Determine which function to use for a call to `projectile-find-tag'."
+ (or
+ (cond
+ ((eq projectile-tags-backend 'auto)
+ (cond
+ ((fboundp 'ggtags-find-tag-dwim)
+ 'ggtags-find-tag-dwim)
+ ((fboundp 'xref-find-definitions)
+ 'xref-find-definitions)
+ ((fboundp 'etags-select-find-tag)
+ 'etags-select-find-tag)))
+ ((eq projectile-tags-backend 'xref)
+ (when (fboundp 'xref-find-definitions)
+ 'xref-find-definitions))
+ ((eq projectile-tags-backend 'ggtags)
+ (when (fboundp 'ggtags-find-tag-dwim)
+ 'ggtags-find-tag-dwim))
+ ((eq projectile-tags-backend 'etags-select)
+ (when (fboundp 'etags-select-find-tag)
+ 'etags-select-find-tag)))
+ 'find-tag))
+
+;;;###autoload
+(defun projectile-find-tag ()
+ "Find tag in project."
+ (interactive)
+ (projectile-visit-project-tags-table)
+ ;; Auto-discover the user's preference for tags
+ (let ((find-tag-fn (projectile-determine-find-tag-fn)))
+ (call-interactively find-tag-fn)))
+
+(defmacro projectile-with-default-dir (dir &rest body)
+ "Invoke in DIR the BODY."
+ (declare (debug t) (indent 1))
+ `(let ((default-directory ,dir))
+ ,@body))
+
+;;;###autoload
+(defun projectile-run-command-in-root ()
+ "Invoke `execute-extended-command' in the project's root."
+ (interactive)
+ (projectile-with-default-dir (projectile-acquire-root)
+ (call-interactively #'execute-extended-command)))
+
+;;;###autoload
+(defun projectile-run-shell-command-in-root (command &optional output-buffer error-buffer)
+ "Invoke `shell-command' in the project's root."
+ (interactive (list (read-shell-command "Shell command: ")))
+ (projectile-with-default-dir (projectile-acquire-root)
+ (shell-command command output-buffer error-buffer)))
+
+;;;###autoload
+(defun projectile-run-async-shell-command-in-root (command &optional output-buffer error-buffer)
+ "Invoke `async-shell-command' in the project's root."
+ (interactive (list (read-shell-command "Async shell command: ")))
+ (projectile-with-default-dir (projectile-acquire-root)
+ (async-shell-command command output-buffer error-buffer)))
+
+;;;###autoload
+(defun projectile-run-gdb ()
+ "Invoke `gdb' in the project's root."
+ (interactive)
+ (projectile-with-default-dir (projectile-acquire-root)
+ (call-interactively 'gdb)))
+
+;;;###autoload
+(defun projectile-run-shell (&optional arg)
+ "Invoke `shell' in the project's root.
+
+Switch to the project specific shell buffer if it already exists.
+
+Use a prefix argument ARG to indicate creation of a new process instead."
+ (interactive "P")
+ (let ((project (projectile-acquire-root)))
+ (projectile-with-default-dir project
+ (shell (projectile-generate-process-name "shell" arg project)))))
+
+;;;###autoload
+(defun projectile-run-eshell (&optional arg)
+ "Invoke `eshell' in the project's root.
+
+Switch to the project specific eshell buffer if it already exists.
+
+Use a prefix argument ARG to indicate creation of a new process instead."
+ (interactive "P")
+ (let ((project (projectile-acquire-root)))
+ (projectile-with-default-dir project
+ (let ((eshell-buffer-name (projectile-generate-process-name "eshell" arg project)))
+ (eshell)))))
+
+;;;###autoload
+(defun projectile-run-ielm (&optional arg)
+ "Invoke `ielm' in the project's root.
+
+Switch to the project specific ielm buffer if it already exists.
+
+Use a prefix argument ARG to indicate creation of a new process instead."
+ (interactive "P")
+ (let* ((project (projectile-acquire-root))
+ (ielm-buffer-name (projectile-generate-process-name "ielm" arg project)))
+ (if (get-buffer ielm-buffer-name)
+ (switch-to-buffer ielm-buffer-name)
+ (projectile-with-default-dir project
+ (ielm))
+ ;; ielm's buffer name is hardcoded, so we have to rename it after creation
+ (rename-buffer ielm-buffer-name))))
+
+;;;###autoload
+(defun projectile-run-term (&optional arg)
+ "Invoke `term' in the project's root.
+
+Switch to the project specific term buffer if it already exists.
+
+Use a prefix argument ARG to indicate creation of a new process instead."
+ (interactive "P")
+ (let* ((project (projectile-acquire-root))
+ (buffer-name (projectile-generate-process-name "term" arg project))
+ (default-program (or explicit-shell-file-name
+ (getenv "ESHELL")
+ (getenv "SHELL")
+ "/bin/sh")))
+ (unless (get-buffer buffer-name)
+ (require 'term)
+ (let ((program (read-from-minibuffer "Run program: " default-program)))
+ (projectile-with-default-dir project
+ (set-buffer (term-ansi-make-term buffer-name program))
+ (term-mode)
+ (term-char-mode))))
+ (switch-to-buffer buffer-name)))
+
+;;;###autoload
+(defun projectile-run-vterm (&optional arg)
+ "Invoke `vterm' in the project's root.
+
+Switch to the project specific term buffer if it already exists.
+
+Use a prefix argument ARG to indicate creation of a new process instead."
+ (interactive "P")
+ (let* ((project (projectile-acquire-root))
+ (buffer (projectile-generate-process-name "vterm" arg project)))
+ (unless (buffer-live-p (get-buffer buffer))
+ (unless (require 'vterm nil 'noerror)
+ (error "Package 'vterm' is not available"))
+ (projectile-with-default-dir project
+ (vterm buffer)))
+ (switch-to-buffer buffer)))
+
+(defun projectile-files-in-project-directory (directory)
+ "Return a list of files in DIRECTORY."
+ (let* ((project (projectile-acquire-root))
+ (dir (file-relative-name (expand-file-name directory)
+ project)))
+ (cl-remove-if-not
+ (lambda (f) (string-prefix-p dir f))
+ (projectile-project-files project))))
+
+(defun projectile-files-from-cmd (cmd directory)
+ "Use a grep-like CMD to search for files within DIRECTORY.
+
+CMD should include the necessary search params and should output
+equivalently to grep -HlI (only unique matching filenames).
+Returns a list of expanded filenames."
+ (let ((default-directory directory))
+ (mapcar (lambda (str)
+ (concat directory
+ (if (string-prefix-p "./" str)
+ (substring str 2)
+ str)))
+ (split-string
+ (string-trim (shell-command-to-string cmd))
+ "\n+"
+ t))))
+
+(defvar projectile-files-with-string-commands
+ '((rg . "rg -lF --no-heading --color never -- ")
+ (ag . "ag --literal --nocolor --noheading -l -- ")
+ (ack . "ack --literal --nocolor -l -- ")
+ (git . "git grep -HlI ")
+ ;; -r: recursive
+ ;; -H: show filename for each match
+ ;; -l: show only file names with matches
+ ;; -I: no binary files
+ (grep . "grep -rHlI %s .")))
+
+(defun projectile-files-with-string (string directory)
+ "Return a list of all files containing STRING in DIRECTORY.
+
+Tries to use rg, ag, ack, git-grep, and grep in that order. If those
+are impossible (for instance on Windows), returns a list of all
+files in the project."
+ (if (projectile-unixy-system-p)
+ (let* ((search-term (shell-quote-argument string))
+ (cmd (cond ((executable-find "rg")
+ (concat (cdr (assoc 'rg projectile-files-with-string-commands))
+ search-term))
+ ((executable-find "ag")
+ (concat (cdr (assoc 'ag projectile-files-with-string-commands))
+ search-term))
+ ((executable-find "ack")
+ (concat (cdr (assoc 'ack projectile-files-with-string-commands))
+ search-term))
+ ((and (executable-find "git")
+ (eq (projectile-project-vcs) 'git))
+ (concat (cdr (assoc 'git projectile-files-with-string-commands)) search-term))
+ (t
+ (format (cdr (assoc 'grep projectile-files-with-string-commands)) search-term)))))
+ (projectile-files-from-cmd cmd directory))
+ ;; we have to reject directories as a workaround to work with git submodules
+ (cl-remove-if
+ #'file-directory-p
+ (mapcar #'(lambda (file) (expand-file-name file directory))
+ (projectile-dir-files directory)))))
+
+;;;###autoload
+(defun projectile-replace (&optional arg)
+ "Replace literal string in project using non-regexp `tags-query-replace'.
+
+With a prefix argument ARG prompts you for a directory on which
+to run the replacement."
+ (interactive "P")
+ (let* ((directory (if arg
+ (file-name-as-directory
+ (read-directory-name "Replace in directory: "))
+ (projectile-acquire-root)))
+ (old-text (read-string
+ (projectile-prepend-project-name "Replace: ")
+ (projectile-symbol-or-selection-at-point)))
+ (new-text (read-string
+ (projectile-prepend-project-name
+ (format "Replace %s with: " old-text))))
+ (files (projectile-files-with-string old-text directory)))
+ (if (fboundp #'fileloop-continue)
+ ;; Emacs 27+
+ (progn (fileloop-initialize-replace old-text new-text files 'default)
+ (fileloop-continue))
+ ;; Emacs 25 and 26
+ ;;
+ ;; Adapted from `tags-query-replace' for literal strings (not regexp)
+ (with-no-warnings
+ (setq tags-loop-scan
+ `(let ,(unless (equal old-text (downcase old-text))
+ '((case-fold-search nil)))
+ (if (search-forward ',old-text nil t)
+ ;; When we find a match, move back to
+ ;; the beginning of it so
+ ;; perform-replace will see it.
+ (goto-char (match-beginning 0)))))
+ (setq tags-loop-operate
+ `(perform-replace ',old-text ',new-text t nil nil
+ nil multi-query-replace-map))
+ (tags-loop-continue (or (cons 'list files) t))))))
+
+;;;###autoload
+(defun projectile-replace-regexp (&optional arg)
+ "Replace a regexp in the project using `tags-query-replace'.
+
+With a prefix argument ARG prompts you for a directory on which
+to run the replacement."
+ (interactive "P")
+ (let* ((directory (if arg
+ (file-name-as-directory
+ (read-directory-name "Replace regexp in directory: "))
+ (projectile-acquire-root)))
+ (old-text (read-string
+ (projectile-prepend-project-name "Replace regexp: ")
+ (projectile-symbol-or-selection-at-point)))
+ (new-text (read-string
+ (projectile-prepend-project-name
+ (format "Replace regexp %s with: " old-text))))
+ (files
+ ;; We have to reject directories as a workaround to work with git submodules.
+ ;;
+ ;; We can't narrow the list of files with
+ ;; `projectile-files-with-string' because those regexp tools
+ ;; don't support Emacs regular expressions.
+ (cl-remove-if
+ #'file-directory-p
+ (mapcar #'(lambda (file) (expand-file-name file directory))
+ (projectile-dir-files directory)))))
+ ;; FIXME: Probably would fail on Emacs 27+, fourth argument is gone.
+ (with-no-warnings (tags-query-replace old-text new-text nil (cons 'list files)))))
+
+;;;###autoload
+(defun projectile-kill-buffers ()
+ "Kill project buffers.
+
+The buffer are killed according to the value of
+`projectile-kill-buffers-filter'."
+ (interactive)
+ (let* ((project (projectile-acquire-root))
+ (project-name (projectile-project-name project))
+ (buffers (projectile-project-buffers project)))
+ (when (yes-or-no-p
+ (format "Are you sure you want to kill %s buffers for '%s'? "
+ (length buffers) project-name))
+ (dolist (buffer buffers)
+ (when (and
+ ;; we take care not to kill indirect buffers directly
+ ;; as we might encounter them after their base buffers are killed
+ (not (buffer-base-buffer buffer))
+ (if (functionp projectile-kill-buffers-filter)
+ (funcall projectile-kill-buffers-filter buffer)
+ (pcase projectile-kill-buffers-filter
+ ('kill-all t)
+ ('kill-only-files (buffer-file-name buffer))
+ (_ (user-error "Invalid projectile-kill-buffers-filter value: %S" projectile-kill-buffers-filter)))))
+ (kill-buffer buffer))))))
+
+;;;###autoload
+(defun projectile-save-project-buffers ()
+ "Save all project buffers."
+ (interactive)
+ (let* ((project (projectile-acquire-root))
+ (project-name (projectile-project-name project))
+ (modified-buffers (cl-remove-if-not (lambda (buf)
+ (and (buffer-file-name buf)
+ (buffer-modified-p buf)))
+ (projectile-project-buffers project))))
+ (if (null modified-buffers)
+ (message "[%s] No buffers need saving" project-name)
+ (dolist (buf modified-buffers)
+ (with-current-buffer buf
+ (save-buffer)))
+ (message "[%s] Saved %d buffers" project-name (length modified-buffers)))))
+
+;;;###autoload
+(defun projectile-dired ()
+ "Open `dired' at the root of the project."
+ (interactive)
+ (dired (projectile-acquire-root)))
+
+;;;###autoload
+(defun projectile-dired-other-window ()
+ "Open `dired' at the root of the project in another window."
+ (interactive)
+ (dired-other-window (projectile-acquire-root)))
+
+;;;###autoload
+(defun projectile-dired-other-frame ()
+ "Open `dired' at the root of the project in another frame."
+ (interactive)
+ (dired-other-frame (projectile-acquire-root)))
+
+;;;###autoload
+(defun projectile-vc (&optional project-root)
+ "Open `vc-dir' at the root of the project.
+
+For git projects `magit-status-internal' is used if available.
+For hg projects `monky-status' is used if available.
+
+If PROJECT-ROOT is given, it is opened instead of the project
+root directory of the current buffer file. If interactively
+called with a prefix argument, the user is prompted for a project
+directory to open."
+ (interactive (and current-prefix-arg
+ (list
+ (projectile-completing-read
+ "Open project VC in: "
+ projectile-known-projects))))
+ (unless project-root
+ (setq project-root (projectile-acquire-root)))
+ (let ((vcs (projectile-project-vcs project-root)))
+ (cl-case vcs
+ (git
+ (cond ((fboundp 'magit-status-internal)
+ (magit-status-internal project-root))
+ ((fboundp 'magit-status)
+ (with-no-warnings (magit-status project-root)))
+ (t
+ (vc-dir project-root))))
+ (hg
+ (if (fboundp 'monky-status)
+ (monky-status project-root)
+ (vc-dir project-root)))
+ (t (vc-dir project-root)))))
+
+;;;###autoload
+(defun projectile-recentf ()
+ "Show a list of recently visited files in a project."
+ (interactive)
+ (if (boundp 'recentf-list)
+ (find-file (projectile-expand-root
+ (projectile-completing-read
+ "Recently visited files: "
+ (projectile-recentf-files))))
+ (message "recentf is not enabled")))
+
+(defun projectile-recentf-files ()
+ "Return a list of recently visited files in a project."
+ (and (boundp 'recentf-list)
+ (let ((project-root (projectile-acquire-root)))
+ (mapcar
+ (lambda (f) (file-relative-name f project-root))
+ (cl-remove-if-not
+ (lambda (f) (string-prefix-p project-root (expand-file-name f)))
+ recentf-list)))))
+
+(defun projectile-serialize-cache ()
+ "Serializes the memory cache to the hard drive."
+ (projectile-serialize projectile-projects-cache projectile-cache-file))
+
+(defvar projectile-configure-cmd-map
+ (make-hash-table :test 'equal)
+ "A mapping between projects and the last configure command used on them.")
+
+(defvar projectile-compilation-cmd-map
+ (make-hash-table :test 'equal)
+ "A mapping between projects and the last compilation command used on them.")
+
+(defvar projectile-install-cmd-map
+ (make-hash-table :test 'equal)
+ "A mapping between projects and the last install command used on them.")
+
+(defvar projectile-package-cmd-map
+ (make-hash-table :test 'equal)
+ "A mapping between projects and the last package command used on them.")
+
+(defvar projectile-test-cmd-map
+ (make-hash-table :test 'equal)
+ "A mapping between projects and the last test command used on them.")
+
+(defvar projectile-run-cmd-map
+ (make-hash-table :test 'equal)
+ "A mapping between projects and the last run command used on them.")
+
+(defvar projectile-project-configure-cmd nil
+ "The command to use with `projectile-configure-project'.
+It takes precedence over the default command for the project type when set.
+Should be set via .dir-locals.el.")
+
+(defvar projectile-project-compilation-cmd nil
+ "The command to use with `projectile-compile-project'.
+It takes precedence over the default command for the project type when set.
+Should be set via .dir-locals.el.")
+
+(defvar projectile-project-compilation-dir nil
+ "The directory to use with `projectile-compile-project'.
+The directory path is relative to the project root.
+Should be set via .dir-locals.el.")
+
+(defvar projectile-project-test-cmd nil
+ "The command to use with `projectile-test-project'.
+It takes precedence over the default command for the project type when set.
+Should be set via .dir-locals.el.")
+
+(defvar projectile-project-install-cmd nil
+ "The command to use with `projectile-install-project'.
+It takes precedence over the default command for the project type when set.
+Should be set via .dir-locals.el.")
+
+(defvar projectile-project-package-cmd nil
+ "The command to use with `projectile-package-project'.
+It takes precedence over the default command for the project type when set.
+Should be set via .dir-locals.el.")
+
+(defvar projectile-project-run-cmd nil
+ "The command to use with `projectile-run-project'.
+It takes precedence over the default command for the project type when set.
+Should be set via .dir-locals.el.")
+
+(defun projectile-default-generic-command (project-type command-type)
+ "Generic retrieval of COMMAND-TYPEs default cmd-value for PROJECT-TYPE.
+
+If found, checks if value is symbol or string. In case of symbol
+resolves to function `funcall's. Return value of function MUST
+be string to be executed as command."
+ (let ((command (plist-get (alist-get project-type projectile-project-types) command-type)))
+ (cond
+ ((not command) nil)
+ ((stringp command) command)
+ ((functionp command)
+ (if (fboundp command)
+ (funcall (symbol-function command))))
+ (t
+ (error "The value for: %s in project-type: %s was neither a function nor a string" command-type project-type)))))
+
+(defun projectile-default-configure-command (project-type)
+ "Retrieve default configure command for PROJECT-TYPE."
+ (projectile-default-generic-command project-type 'configure-command))
+
+(defun projectile-default-compilation-command (project-type)
+ "Retrieve default compilation command for PROJECT-TYPE."
+ (projectile-default-generic-command project-type 'compile-command))
+
+(defun projectile-default-compilation-dir (project-type)
+ "Retrieve default compilation directory for PROJECT-TYPE."
+ (projectile-default-generic-command project-type 'compilation-dir))
+
+(defun projectile-default-test-command (project-type)
+ "Retrieve default test command for PROJECT-TYPE."
+ (projectile-default-generic-command project-type 'test-command))
+
+(defun projectile-default-install-command (project-type)
+ "Retrieve default install command for PROJECT-TYPE."
+ (projectile-default-generic-command project-type 'install-command))
+
+(defun projectile-default-package-command (project-type)
+ "Retrieve default package command for PROJECT-TYPE."
+ (projectile-default-generic-command project-type 'package-command))
+
+(defun projectile-default-run-command (project-type)
+ "Retrieve default run command for PROJECT-TYPE."
+ (projectile-default-generic-command project-type 'run-command))
+
+(defun projectile-configure-command (compile-dir)
+ "Retrieve the configure command for COMPILE-DIR.
+
+The command is determined like this:
+
+- first we check `projectile-configure-cmd-map' for the last
+configure command that was invoked on the project
+
+- then we check for `projectile-project-configure-cmd' supplied
+via .dir-locals.el
+
+- finally we check for the default configure command for a
+project of that type"
+ (or (gethash compile-dir projectile-configure-cmd-map)
+ projectile-project-configure-cmd
+ (let ((cmd-format-string (projectile-default-configure-command (projectile-project-type))))
+ (when cmd-format-string
+ (format cmd-format-string (projectile-project-root) compile-dir)))))
+
+(defun projectile-compilation-buffer-name (compilation-mode)
+ "Meant to be used for `compilation-buffer-name-function`.
+Argument COMPILATION-MODE is the name of the major mode used for the
+compilation buffer."
+ (concat "*" (downcase compilation-mode) "*"
+ (if (projectile-project-p) (concat "<" (projectile-project-name) ">") "")))
+
+(defun projectile-current-project-buffer-p ()
+ "Meant to be used for `compilation-save-buffers-predicate`.
+This indicates whether the current buffer is in the same project as the current
+window (including returning true if neither is in a project)."
+ (let ((root (with-current-buffer (window-buffer) (projectile-project-root))))
+ (or (not root)
+ (projectile-project-buffer-p (current-buffer) root))))
+
+(defun projectile-compilation-command (compile-dir)
+ "Retrieve the compilation command for COMPILE-DIR.
+
+The command is determined like this:
+
+- first we check `projectile-compilation-cmd-map' for the last
+compile command that was invoked on the project
+
+- then we check for `projectile-project-compilation-cmd' supplied
+via .dir-locals.el
+
+- finally we check for the default compilation command for a
+project of that type"
+ (or (gethash compile-dir projectile-compilation-cmd-map)
+ projectile-project-compilation-cmd
+ (projectile-default-compilation-command (projectile-project-type))))
+
+(defun projectile-test-command (compile-dir)
+ "Retrieve the test command for COMPILE-DIR.
+
+The command is determined like this:
+
+- first we check `projectile-test-cmd-map' for the last
+test command that was invoked on the project
+
+- then we check for `projectile-project-test-cmd' supplied
+via .dir-locals.el
+
+- finally we check for the default test command for a
+project of that type"
+ (or (gethash compile-dir projectile-test-cmd-map)
+ projectile-project-test-cmd
+ (projectile-default-test-command (projectile-project-type))))
+
+(defun projectile-install-command (compile-dir)
+ "Retrieve the install command for COMPILE-DIR.
+
+The command is determined like this:
+
+- first we check `projectile-install-cmd-map' for the last
+install command that was invoked on the project
+
+- then we check for `projectile-project-install-cmd' supplied
+via .dir-locals.el
+
+- finally we check for the default install command for a
+project of that type"
+ (or (gethash compile-dir projectile-install-cmd-map)
+ projectile-project-install-cmd
+ (projectile-default-install-command (projectile-project-type))))
+
+(defun projectile-package-command (compile-dir)
+ "Retrieve the package command for COMPILE-DIR.
+
+The command is determined like this:
+
+- first we check `projectile-packgage-cmd-map' for the last
+install command that was invoked on the project
+
+- then we check for `projectile-project-package-cmd' supplied
+via .dir-locals.el
+
+- finally we check for the default package command for a
+project of that type"
+ (or (gethash compile-dir projectile-package-cmd-map)
+ projectile-project-package-cmd
+ (projectile-default-package-command (projectile-project-type))))
+
+(defun projectile-run-command (compile-dir)
+ "Retrieve the run command for COMPILE-DIR.
+
+The command is determined like this:
+
+- first we check `projectile-run-cmd-map' for the last
+run command that was invoked on the project
+
+- then we check for `projectile-project-run-cmd' supplied
+via .dir-locals.el
+
+- finally we check for the default run command for a
+project of that type"
+ (or (gethash compile-dir projectile-run-cmd-map)
+ projectile-project-run-cmd
+ (projectile-default-run-command (projectile-project-type))))
+
+(defun projectile-read-command (prompt command)
+ "Adapted from the function `compilation-read-command'."
+ (let ((compile-history
+ ;; fetch the command history for the current project
+ (ring-elements (projectile--get-command-history (projectile-acquire-root)))))
+ (read-shell-command prompt command
+ (if (equal (car compile-history) command)
+ '(compile-history . 1)
+ 'compile-history))))
+
+(defun projectile-compilation-dir ()
+ "Retrieve the compilation directory for this project."
+ (let* ((type (projectile-project-type))
+ (directory (or projectile-project-compilation-dir
+ (projectile-default-compilation-dir type))))
+ (if directory
+ (file-truename
+ (concat (file-name-as-directory (projectile-project-root))
+ (file-name-as-directory directory)))
+ (projectile-project-root))))
+
+(defun projectile-maybe-read-command (arg default-cmd prompt)
+ "Prompt user for command unless DEFAULT-CMD is an Elisp function."
+ (if (and (or (stringp default-cmd) (null default-cmd))
+ (or compilation-read-command arg))
+ (projectile-read-command prompt default-cmd)
+ default-cmd))
+
+(defun projectile-run-compilation (cmd &optional use-comint-mode)
+ "Run external or Elisp compilation command CMD."
+ (if (functionp cmd)
+ (funcall cmd)
+ (compile cmd use-comint-mode)))
+
+(defvar projectile-project-command-history (make-hash-table :test 'equal)
+ "The history of last executed project commands, per project.
+
+Projects are indexed by their project-root value.")
+
+(defun projectile--get-command-history (project-root)
+ (or (gethash project-root projectile-project-command-history)
+ (puthash project-root
+ (make-ring 16)
+ projectile-project-command-history)))
+
+(cl-defun projectile--run-project-cmd
+ (command command-map &key show-prompt prompt-prefix save-buffers use-comint-mode)
+ "Run a project COMMAND, typically a test- or compile command.
+
+Cache the COMMAND for later use inside the hash-table COMMAND-MAP.
+
+Normally you'll be prompted for a compilation command, unless
+variable `compilation-read-command'. You can force the prompt
+by setting SHOW-PROMPT. The prompt will be prefixed with PROMPT-PREFIX.
+
+If SAVE-BUFFERS is non-nil save all projectile buffers before
+running the command.
+
+The command actually run is returned."
+ (let* ((project-root (projectile-project-root))
+ (default-directory (projectile-compilation-dir))
+ (command (projectile-maybe-read-command show-prompt
+ command
+ prompt-prefix))
+ compilation-buffer-name-function
+ compilation-save-buffers-predicate)
+ (when command-map
+ (puthash default-directory command command-map)
+ (ring-insert (projectile--get-command-history project-root) command))
+ (when save-buffers
+ (save-some-buffers (not compilation-ask-about-save)
+ (lambda ()
+ (projectile-project-buffer-p (current-buffer)
+ project-root))))
+ (when projectile-per-project-compilation-buffer
+ (setq compilation-buffer-name-function #'projectile-compilation-buffer-name)
+ (setq compilation-save-buffers-predicate #'projectile-current-project-buffer-p))
+ (unless (file-directory-p default-directory)
+ (mkdir default-directory))
+ (projectile-run-compilation command use-comint-mode)
+ command))
+
+(defcustom projectile-configure-use-comint-mode nil
+ "Make the output buffer of `projectile-configure-project' interactive."
+ :group 'projectile
+ :type 'boolean
+ :package-version '(projectile . "2.5.0"))
+
+(defcustom projectile-compile-use-comint-mode nil
+ "Make the output buffer of `projectile-compile-project' interactive."
+ :group 'projectile
+ :type 'boolean
+ :package-version '(projectile . "2.5.0"))
+
+(defcustom projectile-test-use-comint-mode nil
+ "Make the output buffer of `projectile-test-project' interactive."
+ :group 'projectile
+ :type 'boolean
+ :package-version '(projectile . "2.5.0"))
+
+(defcustom projectile-install-use-comint-mode nil
+ "Make the output buffer of `projectile-install-project' interactive."
+ :group 'projectile
+ :type 'boolean
+ :package-version '(projectile . "2.5.0"))
+
+(defcustom projectile-package-use-comint-mode nil
+ "Make the output buffer of `projectile-package-project' interactive."
+ :group 'projectile
+ :type 'boolean
+ :package-version '(projectile . "2.5.0"))
+
+(defcustom projectile-run-use-comint-mode nil
+ "Make the output buffer of `projectile-run-project' interactive."
+ :group 'projectile
+ :type 'boolean
+ :package-version '(projectile . "2.5.0"))
+
+;;;###autoload
+(defun projectile-configure-project (arg)
+ "Run project configure command.
+
+Normally you'll be prompted for a compilation command, unless
+variable `compilation-read-command'. You can force the prompt
+with a prefix ARG."
+ (interactive "P")
+ (let ((command (projectile-configure-command (projectile-compilation-dir))))
+ (projectile--run-project-cmd command projectile-configure-cmd-map
+ :show-prompt arg
+ :prompt-prefix "Configure command: "
+ :save-buffers t
+ :use-comint-mode projectile-configure-use-comint-mode)))
+
+;;;###autoload
+(defun projectile-compile-project (arg)
+ "Run project compilation command.
+
+Normally you'll be prompted for a compilation command, unless
+variable `compilation-read-command'. You can force the prompt
+with a prefix ARG."
+ (interactive "P")
+ (let ((command (projectile-compilation-command (projectile-compilation-dir))))
+ (projectile--run-project-cmd command projectile-compilation-cmd-map
+ :show-prompt arg
+ :prompt-prefix "Compile command: "
+ :save-buffers t
+ :use-comint-mode projectile-compile-use-comint-mode)))
+
+;;;###autoload
+(defun projectile-test-project (arg)
+ "Run project test command.
+
+Normally you'll be prompted for a compilation command, unless
+variable `compilation-read-command'. You can force the prompt
+with a prefix ARG."
+ (interactive "P")
+ (let ((command (projectile-test-command (projectile-compilation-dir))))
+ (projectile--run-project-cmd command projectile-test-cmd-map
+ :show-prompt arg
+ :prompt-prefix "Test command: "
+ :save-buffers t
+ :use-comint-mode projectile-test-use-comint-mode)))
+
+;;;###autoload
+(defun projectile-install-project (arg)
+ "Run project install command.
+
+Normally you'll be prompted for a compilation command, unless
+variable `compilation-read-command'. You can force the prompt
+with a prefix ARG."
+ (interactive "P")
+ (let ((command (projectile-install-command (projectile-compilation-dir))))
+ (projectile--run-project-cmd command projectile-install-cmd-map
+ :show-prompt arg
+ :prompt-prefix "Install command: "
+ :save-buffers t
+ :use-comint-mode projectile-install-use-comint-mode)))
+
+;;;###autoload
+(defun projectile-package-project (arg)
+ "Run project package command.
+
+Normally you'll be prompted for a compilation command, unless
+variable `compilation-read-command'. You can force the prompt
+with a prefix ARG."
+ (interactive "P")
+ (let ((command (projectile-package-command (projectile-compilation-dir))))
+ (projectile--run-project-cmd command projectile-package-cmd-map
+ :show-prompt arg
+ :prompt-prefix "Package command: "
+ :save-buffers t
+ :use-comint-mode projectile-package-use-comint-mode)))
+
+;;;###autoload
+(defun projectile-run-project (arg)
+ "Run project run command.
+
+Normally you'll be prompted for a compilation command, unless
+variable `compilation-read-command'. You can force the prompt
+with a prefix ARG."
+ (interactive "P")
+ (let ((command (projectile-run-command (projectile-compilation-dir))))
+ (projectile--run-project-cmd command projectile-run-cmd-map
+ :show-prompt arg
+ :prompt-prefix "Run command: "
+ :use-comint-mode projectile-run-use-comint-mode)))
+
+;;;###autoload
+(defun projectile-repeat-last-command (show-prompt)
+ "Run last projectile external command.
+
+External commands are: `projectile-configure-project',
+`projectile-compile-project', `projectile-test-project',
+`projectile-install-project', `projectile-package-project',
+and `projectile-run-project'.
+
+If the prefix argument SHOW_PROMPT is non nil, the command can be edited."
+ (interactive "P")
+ (let* ((project-root (projectile-acquire-root))
+ (command-history (projectile--get-command-history project-root))
+ (command (car-safe (ring-elements command-history)))
+ (compilation-read-command show-prompt)
+ executed-command)
+ (unless command
+ (user-error "No command has been run yet for this project"))
+ (setq executed-command
+ (projectile--run-project-cmd command
+ nil
+ :save-buffers t
+ :prompt-prefix "Execute command: "))
+ (unless (string= command executed-command)
+ (ring-insert command-history executed-command))))
+
+(defun compilation-find-file-projectile-find-compilation-buffer (orig-fun marker filename directory &rest formats)
+ "Advice around compilation-find-file.
+We enhance its functionality by appending the current project's directories
+to its search path. This way when filenames in compilation buffers can't be
+found by compilation's normal logic they are searched for in project
+directories."
+ (let* ((root (projectile-project-root))
+ (compilation-search-path
+ (if (projectile-project-p)
+ (append compilation-search-path (list root)
+ (mapcar (lambda (f) (expand-file-name f root))
+ (projectile-current-project-dirs)))
+ compilation-search-path)))
+ (apply orig-fun `(,marker ,filename ,directory ,@formats))))
+
+(defun projectile-open-projects ()
+ "Return a list of all open projects.
+An open project is a project with any open buffers."
+ (delete-dups
+ (delq nil
+ (mapcar (lambda (buffer)
+ (with-current-buffer buffer
+ (when (projectile-project-p)
+ (abbreviate-file-name (projectile-project-root)))))
+ (buffer-list)))))
+
+(defun projectile--remove-current-project (projects)
+ "Remove the current project (if any) from the list of PROJECTS."
+ (if-let ((project (projectile-project-root)))
+ (projectile-difference projects
+ (list (abbreviate-file-name project)))
+ projects))
+
+(defun projectile--move-current-project-to-end (projects)
+ "Move current project (if any) to the end of list in the list of PROJECTS."
+ (if-let ((project (projectile-project-root)))
+ (append
+ (projectile--remove-current-project projects)
+ (list (abbreviate-file-name project)))
+ projects))
+
+(defun projectile-relevant-known-projects ()
+ "Return a list of known projects."
+ (pcase projectile-current-project-on-switch
+ ('remove (projectile--remove-current-project projectile-known-projects))
+ ('move-to-end (projectile--move-current-project-to-end projectile-known-projects))
+ ('keep projectile-known-projects)))
+
+(defun projectile-relevant-open-projects ()
+ "Return a list of open projects."
+ (let ((open-projects (projectile-open-projects)))
+ (pcase projectile-current-project-on-switch
+ ('remove (projectile--remove-current-project open-projects))
+ ('move-to-end (projectile--move-current-project-to-end open-projects))
+ ('keep open-projects))))
+
+;;;###autoload
+(defun projectile-switch-project (&optional arg)
+ "Switch to a project we have visited before.
+Invokes the command referenced by `projectile-switch-project-action' on switch.
+With a prefix ARG invokes `projectile-commander' instead of
+`projectile-switch-project-action.'"
+ (interactive "P")
+ (let ((projects (projectile-relevant-known-projects)))
+ (if projects
+ (projectile-completing-read
+ "Switch to project: " projects
+ :action (lambda (project)
+ (projectile-switch-project-by-name project arg)))
+ (user-error "There are no known projects"))))
+
+;;;###autoload
+(defun projectile-switch-open-project (&optional arg)
+ "Switch to a project we have currently opened.
+Invokes the command referenced by `projectile-switch-project-action' on switch.
+With a prefix ARG invokes `projectile-commander' instead of
+`projectile-switch-project-action.'"
+ (interactive "P")
+ (let ((projects (projectile-relevant-open-projects)))
+ (if projects
+ (projectile-completing-read
+ "Switch to open project: " projects
+ :action (lambda (project)
+ (projectile-switch-project-by-name project arg)))
+ (user-error "There are no open projects"))))
+
+(defun projectile-switch-project-by-name (project-to-switch &optional arg)
+ "Switch to project by project name PROJECT-TO-SWITCH.
+Invokes the command referenced by `projectile-switch-project-action' on switch.
+With a prefix ARG invokes `projectile-commander' instead of
+`projectile-switch-project-action.'"
+ ;; let's make sure that the target directory exists and is actually a project
+ ;; we ignore remote folders, as the check breaks for TRAMP unless already connected
+ (unless (or (file-remote-p project-to-switch) (projectile-project-p project-to-switch))
+ (projectile-remove-known-project project-to-switch)
+ (error "Directory %s is not a project" project-to-switch))
+ (let ((switch-project-action (if arg
+ 'projectile-commander
+ projectile-switch-project-action)))
+ (run-hooks 'projectile-before-switch-project-hook)
+ (let* ((default-directory project-to-switch)
+ (switched-buffer
+ ;; use a temporary buffer to load PROJECT-TO-SWITCH's dir-locals
+ ;; before calling SWITCH-PROJECT-ACTION
+ (with-temp-buffer
+ (hack-dir-local-variables-non-file-buffer)
+ ;; Normally the project name is determined from the current
+ ;; buffer. However, when we're switching projects, we want to
+ ;; show the name of the project being switched to, rather than
+ ;; the current project, in the minibuffer. This is a simple hack
+ ;; to tell the `projectile-project-name' function to ignore the
+ ;; current buffer and the caching mechanism, and just return the
+ ;; value of the `projectile-project-name' variable.
+ (let ((projectile-project-name (funcall projectile-project-name-function
+ project-to-switch)))
+ (funcall switch-project-action)
+ (current-buffer)))))
+ ;; If switch-project-action switched buffers then with-temp-buffer will
+ ;; have lost that change, so switch back to the correct buffer.
+ (when (buffer-live-p switched-buffer)
+ (switch-to-buffer switched-buffer)))
+ (run-hooks 'projectile-after-switch-project-hook)))
+
+;;;###autoload
+(defun projectile-find-file-in-directory (&optional directory)
+ "Jump to a file in a (maybe regular) DIRECTORY.
+
+This command will first prompt for the directory the file is in."
+ (interactive "DFind file in directory: ")
+ (unless (projectile--directory-p directory)
+ (user-error "Directory %S does not exist" directory))
+ (let ((default-directory directory))
+ (if (projectile-project-p)
+ ;; target directory is in a project
+ (let ((file (projectile-completing-read "Find file: "
+ (projectile-dir-files directory))))
+ (find-file (expand-file-name file directory))
+ (run-hooks 'projectile-find-file-hook))
+ ;; target directory is not in a project
+ (projectile-find-file))))
+
+(defun projectile-all-project-files ()
+ "Get a list of all files in all projects."
+ (cl-mapcan
+ (lambda (project)
+ (when (file-exists-p project)
+ (mapcar (lambda (file)
+ (expand-file-name file project))
+ (projectile-project-files project))))
+ projectile-known-projects))
+
+;;;###autoload
+(defun projectile-find-file-in-known-projects ()
+ "Jump to a file in any of the known projects."
+ (interactive)
+ (find-file (projectile-completing-read "Find file in projects: " (projectile-all-project-files))))
+
+(defun projectile-keep-project-p (project)
+ "Determine whether we should cleanup (remove) PROJECT or not.
+
+It handles the case of remote projects as well.
+See `projectile--cleanup-known-projects'."
+ ;; Taken from from `recentf-keep-default-predicate'
+ (cond
+ ((file-remote-p project nil t) (file-readable-p project))
+ ((file-remote-p project))
+ ((file-readable-p project))))
+
+(defun projectile--cleanup-known-projects ()
+ "Remove known projects that don't exist anymore.
+Return a list of projects removed."
+ (projectile-merge-known-projects)
+ (let ((projects-kept (cl-remove-if-not #'projectile-keep-project-p projectile-known-projects))
+ (projects-removed (cl-remove-if #'projectile-keep-project-p projectile-known-projects)))
+ (setq projectile-known-projects projects-kept)
+ (projectile-merge-known-projects)
+ projects-removed))
+
+;;;###autoload
+(defun projectile-cleanup-known-projects ()
+ "Remove known projects that don't exist anymore."
+ (interactive)
+ (if-let ((projects-removed (projectile--cleanup-known-projects)))
+ (message "Projects removed: %s"
+ (mapconcat #'identity projects-removed ", "))
+ (message "No projects needed to be removed.")))
+
+;;;###autoload
+(defun projectile-clear-known-projects ()
+ "Clear both `projectile-known-projects' and `projectile-known-projects-file'."
+ (interactive)
+ (setq projectile-known-projects nil)
+ (projectile-save-known-projects))
+
+;;;###autoload
+(defun projectile-reset-known-projects ()
+ "Clear known projects and rediscover."
+ (interactive)
+ (projectile-clear-known-projects)
+ (projectile-discover-projects-in-search-path))
+
+;;;###autoload
+(defun projectile-remove-known-project (&optional project)
+ "Remove PROJECT from the list of known projects."
+ (interactive (list (projectile-completing-read
+ "Remove from known projects: " projectile-known-projects
+ :action 'projectile-remove-known-project)))
+ (unless (called-interactively-p 'any)
+ (setq projectile-known-projects
+ (cl-remove-if
+ (lambda (proj) (string= project proj))
+ projectile-known-projects))
+ (projectile-merge-known-projects)
+ (when projectile-verbose
+ (message "Project %s removed from the list of known projects." project))))
+
+;;;###autoload
+(defun projectile-remove-current-project-from-known-projects ()
+ "Remove the current project from the list of known projects."
+ (interactive)
+ (projectile-remove-known-project (abbreviate-file-name (projectile-acquire-root))))
+
+(defun projectile-ignored-projects ()
+ "A list of projects that should not be save in `projectile-known-projects'."
+ (mapcar #'file-truename projectile-ignored-projects))
+
+(defun projectile-ignored-project-p (project-root)
+ "Return t if PROJECT-ROOT should not be added to `projectile-known-projects'."
+ (or (member project-root (projectile-ignored-projects))
+ (and (functionp projectile-ignored-project-function)
+ (funcall projectile-ignored-project-function project-root))))
+
+;;;###autoload
+(defun projectile-add-known-project (project-root)
+ "Add PROJECT-ROOT to the list of known projects."
+ (interactive (list (read-directory-name "Add to known projects: ")))
+ (unless (projectile-ignored-project-p project-root)
+ (push (file-name-as-directory (abbreviate-file-name project-root)) projectile-known-projects)
+ (delete-dups projectile-known-projects)
+ (projectile-merge-known-projects)))
+
+(defun projectile-load-known-projects ()
+ "Load saved projects from `projectile-known-projects-file'.
+Also set `projectile-known-projects'."
+ (setq projectile-known-projects
+ (projectile-unserialize projectile-known-projects-file))
+ (setq projectile-known-projects-on-file
+ (and (sequencep projectile-known-projects)
+ (copy-sequence projectile-known-projects))))
+
+(defun projectile-save-known-projects ()
+ "Save PROJECTILE-KNOWN-PROJECTS to PROJECTILE-KNOWN-PROJECTS-FILE."
+ (projectile-serialize projectile-known-projects
+ projectile-known-projects-file)
+ (setq projectile-known-projects-on-file
+ (and (sequencep projectile-known-projects)
+ (copy-sequence projectile-known-projects))))
+
+(defun projectile-merge-known-projects ()
+ "Merge any change from `projectile-known-projects-file' and save to disk.
+
+This enables multiple Emacs processes to make changes without
+overwriting each other's changes."
+ (let* ((known-now projectile-known-projects)
+ (known-on-last-sync projectile-known-projects-on-file)
+ (known-on-file
+ (projectile-unserialize projectile-known-projects-file))
+ (removed-after-sync (projectile-difference known-on-last-sync known-now))
+ (removed-in-other-process
+ (projectile-difference known-on-last-sync known-on-file))
+ (result (delete-dups
+ (projectile-difference
+ (append known-now known-on-file)
+ (append removed-after-sync removed-in-other-process)))))
+ (setq projectile-known-projects result)
+ (projectile-save-known-projects)))
+
+
+;;; IBuffer integration
+(define-ibuffer-filter projectile-files
+ "Show Ibuffer with all buffers in the current project."
+ (:reader (read-directory-name "Project root: " (projectile-project-root))
+ :description nil)
+ (with-current-buffer buf
+ (let ((directory (file-name-as-directory (expand-file-name qualifier))))
+ (and (projectile-project-buffer-p buf directory)
+ (equal directory
+ (projectile-project-root))))))
+
+(defun projectile-ibuffer-by-project (project-root)
+ "Open an IBuffer window showing all buffers in PROJECT-ROOT."
+ (let ((project-name (funcall projectile-project-name-function project-root)))
+ (ibuffer nil (format "*%s Buffers*" project-name)
+ (list (cons 'projectile-files project-root)))))
+
+;;;###autoload
+(defun projectile-ibuffer (prompt-for-project)
+ "Open an IBuffer window showing all buffers in the current project.
+
+Let user choose another project when PROMPT-FOR-PROJECT is supplied."
+ (interactive "P")
+ (let ((project-root (if prompt-for-project
+ (projectile-completing-read
+ "Project name: "
+ (projectile-relevant-known-projects))
+ (projectile-acquire-root))))
+ (projectile-ibuffer-by-project project-root)))
+
+
+;;;; projectile-commander
+
+(defconst projectile-commander-help-buffer "*Projectile Commander Help*")
+
+(defvar projectile-commander-methods nil
+ "List of file-selection methods for the `projectile-commander' command.
+Each element is a list (KEY DESCRIPTION FUNCTION).
+DESCRIPTION is a one-line description of what the key selects.")
+
+;;;###autoload
+(defun projectile-commander ()
+ "Execute a Projectile command with a single letter.
+The user is prompted for a single character indicating the action to invoke.
+The `?' character describes then
+available actions.
+
+See `def-projectile-commander-method' for defining new methods."
+ (interactive)
+ (let* ((choices (mapcar #'car projectile-commander-methods))
+ (prompt (concat "Select Projectile command [" choices "]: "))
+ (ch (read-char-choice prompt choices))
+ (fn (nth 2 (assq ch projectile-commander-methods))))
+ (funcall fn)))
+
+(defmacro def-projectile-commander-method (key description &rest body)
+ "Define a new `projectile-commander' method.
+
+KEY is the key the user will enter to choose this method.
+
+DESCRIPTION is a one-line sentence describing how the method.
+
+BODY is a series of forms which are evaluated when the find
+is chosen."
+ (let ((method `(lambda ()
+ ,@body)))
+ `(setq projectile-commander-methods
+ (cl-sort (copy-sequence
+ (cons (list ,key ,description ,method)
+ (assq-delete-all ,key projectile-commander-methods)))
+ (lambda (a b) (< (car a) (car b)))))))
+
+(def-projectile-commander-method ?? "Commander help buffer."
+ (ignore-errors (kill-buffer projectile-commander-help-buffer))
+ (with-current-buffer (get-buffer-create projectile-commander-help-buffer)
+ (insert "Projectile Commander Methods:\n\n")
+ (dolist (met projectile-commander-methods)
+ (insert (format "%c:\t%s\n" (car met) (cadr met))))
+ (goto-char (point-min))
+ (help-mode)
+ (display-buffer (current-buffer) t))
+ (projectile-commander))
+
+(defun projectile-commander-bindings ()
+ "Setup the keybindings for the Projectile Commander."
+ (def-projectile-commander-method ?f
+ "Find file in project."
+ (projectile-find-file))
+
+ (def-projectile-commander-method ?T
+ "Find test file in project."
+ (projectile-find-test-file))
+
+ (def-projectile-commander-method ?b
+ "Switch to project buffer."
+ (projectile-switch-to-buffer))
+
+ (def-projectile-commander-method ?d
+ "Find directory in project."
+ (projectile-find-dir))
+
+ (def-projectile-commander-method ?D
+ "Open project root in dired."
+ (projectile-dired))
+
+ (def-projectile-commander-method ?v
+ "Open project root in vc-dir or magit."
+ (projectile-vc))
+
+ (def-projectile-commander-method ?V
+ "Browse dirty projects"
+ (projectile-browse-dirty-projects))
+
+ (def-projectile-commander-method ?r
+ "Replace a string in the project."
+ (projectile-replace))
+
+ (def-projectile-commander-method ?R
+ "Regenerate the project's [e|g]tags."
+ (projectile-regenerate-tags))
+
+ (def-projectile-commander-method ?g
+ "Run grep on project."
+ (projectile-grep))
+
+ (def-projectile-commander-method ?a
+ "Run ag on project."
+ (call-interactively #'projectile-ag))
+
+ (def-projectile-commander-method ?s
+ "Switch project."
+ (projectile-switch-project))
+
+ (def-projectile-commander-method ?o
+ "Run multi-occur on project buffers."
+ (projectile-multi-occur))
+
+ (def-projectile-commander-method ?j
+ "Find tag in project."
+ (projectile-find-tag))
+
+ (def-projectile-commander-method ?k
+ "Kill all project buffers."
+ (projectile-kill-buffers))
+
+ (def-projectile-commander-method ?e
+ "Find recently visited file in project."
+ (projectile-recentf)))
+
+
+;;; Dirty (modified) project check related functionality
+(defun projectile-check-vcs-status (&optional project-path)
+ "Check the status of the current project.
+If PROJECT-PATH is a project, check this one instead."
+ (let ((project-path (or project-path (projectile-acquire-root)))
+ (project-status nil))
+ (save-excursion
+ (vc-dir project-path)
+ ;; wait until vc-dir is done
+ (while (vc-dir-busy) (sleep-for 0 100))
+ ;; check for status
+ (save-excursion
+ (save-match-data
+ (dolist (check projectile-vcs-dirty-state)
+ (goto-char (point-min))
+ (when (search-forward check nil t)
+ (setq project-status (cons check project-status))))))
+ (kill-buffer)
+ project-status)))
+
+(defvar projectile-cached-dirty-projects-status nil
+ "Cache of the last dirty projects check.")
+
+(defun projectile-check-vcs-status-of-known-projects ()
+ "Return the list of dirty projects.
+The list is composed of sublists~: (project-path, project-status).
+Raise an error if their is no dirty project."
+ (save-window-excursion
+ (message "Checking for modifications in known projects...")
+ (let ((projects projectile-known-projects)
+ (status ()))
+ (dolist (project projects)
+ (when (and (projectile-keep-project-p project) (not (string= 'none (projectile-project-vcs project))))
+ (let ((tmp-status (projectile-check-vcs-status project)))
+ (when tmp-status
+ (setq status (cons (list project tmp-status) status))))))
+ (when (= (length status) 0)
+ (message "No dirty projects have been found"))
+ (setq projectile-cached-dirty-projects-status status)
+ status)))
+
+;;;###autoload
+(defun projectile-browse-dirty-projects (&optional cached)
+ "Browse dirty version controlled projects.
+
+With a prefix argument, or if CACHED is non-nil, try to use the cached
+dirty project list."
+ (interactive "P")
+ (let ((status (if (and cached projectile-cached-dirty-projects-status)
+ projectile-cached-dirty-projects-status
+ (projectile-check-vcs-status-of-known-projects)))
+ (mod-proj nil))
+ (while (not (= (length status) 0))
+ (setq mod-proj (cons (car (pop status)) mod-proj)))
+ (projectile-completing-read "Select project: " mod-proj
+ :action 'projectile-vc)))
+
+
+;;; Find next/previous project buffer
+(defun projectile--repeat-until-project-buffer (orig-fun &rest args)
+ "Repeat ORIG-FUN with ARGS until the current buffer is a project buffer."
+ (if (projectile-project-root)
+ (let* ((other-project-buffers (make-hash-table :test 'eq))
+ (projectile-project-buffers (projectile-project-buffers))
+ (max-iterations (length (buffer-list)))
+ (counter 0))
+ (dolist (buffer projectile-project-buffers)
+ (unless (eq buffer (current-buffer))
+ (puthash buffer t other-project-buffers)))
+ (when (cdr-safe projectile-project-buffers)
+ (while (and (< counter max-iterations)
+ (not (gethash (current-buffer) other-project-buffers)))
+ (apply orig-fun args)
+ (cl-incf counter))))
+ (apply orig-fun args)))
+
+(defun projectile-next-project-buffer ()
+ "In selected window switch to the next project buffer.
+
+If the current buffer does not belong to a project, call `next-buffer'."
+ (interactive)
+ (projectile--repeat-until-project-buffer #'next-buffer))
+
+(defun projectile-previous-project-buffer ()
+ "In selected window switch to the previous project buffer.
+
+If the current buffer does not belong to a project, call `previous-buffer'."
+ (interactive)
+ (projectile--repeat-until-project-buffer #'previous-buffer))
+
+
+;;; Editing a project's .dir-locals
+(defun projectile-read-variable ()
+ "Prompt for a variable and return its name."
+ (completing-read "Variable: "
+ obarray
+ (lambda (v)
+ (and (boundp v) (not (keywordp v))))
+ t))
+
+(define-skeleton projectile-skel-variable-cons
+ "Insert a variable-name and a value in a cons-cell."
+ "Value: "
+ "("
+ (projectile-read-variable)
+ " . "
+ str
+ ")")
+
+(define-skeleton projectile-skel-dir-locals
+ "Insert a .dir-locals.el template."
+ nil
+ "((nil . ("
+ ("" '(projectile-skel-variable-cons) \n)
+ resume:
+ ")))")
+
+;;;###autoload
+(defun projectile-edit-dir-locals ()
+ "Edit or create a .dir-locals.el file of the project."
+ (interactive)
+ (let ((file (expand-file-name ".dir-locals.el" (projectile-acquire-root))))
+ (find-file file)
+ (when (not (file-exists-p file))
+ (unwind-protect
+ (projectile-skel-dir-locals)
+ (save-buffer)))))
+
+
+;;; Projectile Minor mode
+(define-obsolete-variable-alias 'projectile-mode-line-lighter 'projectile-mode-line-prefix "0.12.0")
+(defcustom projectile-mode-line-prefix
+ " Projectile"
+ "Mode line lighter prefix for Projectile.
+It's used by `projectile-default-mode-line'
+when using dynamic mode line lighter and is the only
+thing shown in the mode line otherwise."
+ :group 'projectile
+ :type 'string
+ :package-version '(projectile . "0.12.0"))
+
+(defcustom projectile-show-menu t
+ "Controls whether to display Projectile's menu."
+ :group 'projectile
+ :type 'boolean
+ :package-version '(projectile . "2.6.0"))
+
+(defvar-local projectile--mode-line projectile-mode-line-prefix)
+
+(defun projectile-default-mode-line ()
+ "Report project name and type in the modeline."
+ (let ((project-name (projectile-project-name))
+ (project-type (projectile-project-type)))
+ (format "%s[%s%s]"
+ projectile-mode-line-prefix
+ (or project-name "-")
+ (if project-type
+ (format ":%s" project-type)
+ ""))))
+
+(defun projectile-update-mode-line ()
+ "Update the Projectile mode-line."
+ (let ((mode-line (funcall projectile-mode-line-function)))
+ (setq projectile--mode-line mode-line))
+ (force-mode-line-update))
+
+(defvar projectile-command-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map (kbd "4 a") #'projectile-find-other-file-other-window)
+ (define-key map (kbd "4 b") #'projectile-switch-to-buffer-other-window)
+ (define-key map (kbd "4 C-o") #'projectile-display-buffer)
+ (define-key map (kbd "4 d") #'projectile-find-dir-other-window)
+ (define-key map (kbd "4 D") #'projectile-dired-other-window)
+ (define-key map (kbd "4 f") #'projectile-find-file-other-window)
+ (define-key map (kbd "4 g") #'projectile-find-file-dwim-other-window)
+ (define-key map (kbd "4 t") #'projectile-find-implementation-or-test-other-window)
+ (define-key map (kbd "5 a") #'projectile-find-other-file-other-frame)
+ (define-key map (kbd "5 b") #'projectile-switch-to-buffer-other-frame)
+ (define-key map (kbd "5 d") #'projectile-find-dir-other-frame)
+ (define-key map (kbd "5 D") #'projectile-dired-other-frame)
+ (define-key map (kbd "5 f") #'projectile-find-file-other-frame)
+ (define-key map (kbd "5 g") #'projectile-find-file-dwim-other-frame)
+ (define-key map (kbd "5 t") #'projectile-find-implementation-or-test-other-frame)
+ (define-key map (kbd "!") #'projectile-run-shell-command-in-root)
+ (define-key map (kbd "&") #'projectile-run-async-shell-command-in-root)
+ (define-key map (kbd "a") #'projectile-find-other-file)
+ (define-key map (kbd "b") #'projectile-switch-to-buffer)
+ (define-key map (kbd "d") #'projectile-find-dir)
+ (define-key map (kbd "D") #'projectile-dired)
+ (define-key map (kbd "e") #'projectile-recentf)
+ (define-key map (kbd "E") #'projectile-edit-dir-locals)
+ (define-key map (kbd "f") #'projectile-find-file)
+ (define-key map (kbd "g") #'projectile-find-file-dwim)
+ (define-key map (kbd "F") #'projectile-find-file-in-known-projects)
+ (define-key map (kbd "i") #'projectile-invalidate-cache)
+ (define-key map (kbd "I") #'projectile-ibuffer)
+ (define-key map (kbd "j") #'projectile-find-tag)
+ (define-key map (kbd "k") #'projectile-kill-buffers)
+ (define-key map (kbd "l") #'projectile-find-file-in-directory)
+ (define-key map (kbd "m") #'projectile-commander)
+ (define-key map (kbd "o") #'projectile-multi-occur)
+ (define-key map (kbd "p") #'projectile-switch-project)
+ (define-key map (kbd "q") #'projectile-switch-open-project)
+ (define-key map (kbd "r") #'projectile-replace)
+ (define-key map (kbd "R") #'projectile-regenerate-tags)
+ (define-key map (kbd "s g") #'projectile-grep)
+ (define-key map (kbd "s r") #'projectile-ripgrep)
+ (define-key map (kbd "s s") #'projectile-ag)
+ (define-key map (kbd "S") #'projectile-save-project-buffers)
+ (define-key map (kbd "t") #'projectile-toggle-between-implementation-and-test)
+ (define-key map (kbd "T") #'projectile-find-test-file)
+ (define-key map (kbd "v") #'projectile-vc)
+ (define-key map (kbd "V") #'projectile-browse-dirty-projects)
+ ;; project lifecycle external commands
+ ;; TODO: Bundle those under some prefix key
+ (define-key map (kbd "C") #'projectile-configure-project)
+ (define-key map (kbd "c") #'projectile-compile-project)
+ (define-key map (kbd "K") #'projectile-package-project)
+ (define-key map (kbd "L") #'projectile-install-project)
+ (define-key map (kbd "P") #'projectile-test-project)
+ (define-key map (kbd "u") #'projectile-run-project)
+ ;; utilities
+ (define-key map (kbd "x e") #'projectile-run-eshell)
+ (define-key map (kbd "x i") #'projectile-run-ielm)
+ (define-key map (kbd "x t") #'projectile-run-term)
+ (define-key map (kbd "x s") #'projectile-run-shell)
+ (define-key map (kbd "x g") #'projectile-run-gdb)
+ (define-key map (kbd "x v") #'projectile-run-vterm)
+ (define-key map (kbd "z") #'projectile-cache-current-file)
+ (define-key map (kbd "<left>") #'projectile-previous-project-buffer)
+ (define-key map (kbd "<right>") #'projectile-next-project-buffer)
+ (define-key map (kbd "ESC") #'projectile-project-buffers-other-buffer)
+ map)
+ "Keymap for Projectile commands after `projectile-keymap-prefix'.")
+(fset 'projectile-command-map projectile-command-map)
+
+(defvar projectile-mode-map
+ (let ((map (make-sparse-keymap)))
+ (when projectile-keymap-prefix
+ (define-key map projectile-keymap-prefix 'projectile-command-map))
+ (easy-menu-define projectile-mode-menu map
+ "Menu for Projectile"
+ '("Projectile" :visible projectile-show-menu
+ ("Find..."
+ ["Find file" projectile-find-file]
+ ["Find file in known projects" projectile-find-file-in-known-projects]
+ ["Find test file" projectile-find-test-file]
+ ["Find directory" projectile-find-dir]
+ ["Find file in directory" projectile-find-file-in-directory]
+ ["Find other file" projectile-find-other-file]
+ ["Jump between implementation file and test file" projectile-toggle-between-implementation-and-test])
+ ("Buffers"
+ ["Switch to buffer" projectile-switch-to-buffer]
+ ["Kill project buffers" projectile-kill-buffers]
+ ["Save project buffers" projectile-save-project-buffers]
+ ["Recent files" projectile-recentf]
+ ["Previous buffer" projectile-previous-project-buffer]
+ ["Next buffer" projectile-next-project-buffer])
+ ("Projects"
+ ["Switch to project" projectile-switch-project]
+ ["Switch to open project" projectile-switch-open-project]
+ "--"
+ ["Discover projects in directory" projectile-discover-projects-in-directory]
+ ["Clear known projects" projectile-clear-known-projects]
+ ["Reset known projects" projectile-reset-known-projects]
+ "--"
+ ["Open project in dired" projectile-dired]
+ "--"
+ ["Browse dirty projects" projectile-browse-dirty-projects]
+ "--"
+ ["Cache current file" projectile-cache-current-file]
+ ["Invalidate cache" projectile-invalidate-cache]
+ ["Regenerate [e|g]tags" projectile-regenerate-tags]
+ "--"
+ ["Toggle project wide read-only" projectile-toggle-project-read-only]
+ ["Edit .dir-locals.el" projectile-edit-dir-locals]
+ ["Project info" projectile-project-info])
+ ("Search"
+ ["Search with grep" projectile-grep]
+ ["Search with ag" projectile-ag]
+ ["Search with ripgrep" projectile-ripgrep]
+ ["Replace in project" projectile-replace]
+ ["Multi-occur in project" projectile-multi-occur])
+ ("Run..."
+ ["Run shell" projectile-run-shell]
+ ["Run eshell" projectile-run-eshell]
+ ["Run ielm" projectile-run-ielm]
+ ["Run term" projectile-run-term]
+ ["Run vterm" projectile-run-vterm]
+ "--"
+ ["Run GDB" projectile-run-gdb])
+ ("Build"
+ ["Configure project" projectile-configure-project]
+ ["Compile project" projectile-compile-project]
+ ["Test project" projectile-test-project]
+ ["Install project" projectile-install-project]
+ ["Package project" projectile-package-project]
+ ["Run project" projectile-run-project]
+ "--"
+ ["Repeat last build command" projectile-repeat-last-command])
+ "--"
+ ["About" projectile-version]))
+ map)
+ "Keymap for Projectile mode.")
+
+(defun projectile-find-file-hook-function ()
+ "Called by `find-file-hook' when `projectile-mode' is on.
+
+The function does pretty much nothing when triggered on remote files
+as all the operations it normally performs are extremely slow over
+tramp."
+ (projectile-maybe-limit-project-file-buffers)
+ (unless (file-remote-p default-directory)
+ (when projectile-dynamic-mode-line
+ (projectile-update-mode-line))
+ (when projectile-auto-update-cache
+ (projectile-cache-files-find-file-hook))
+ (projectile-track-known-projects-find-file-hook)
+ (projectile-visit-project-tags-table)))
+
+(defun projectile-maybe-limit-project-file-buffers ()
+ "Limit the opened file buffers for a project.
+
+The function simply kills the last buffer, as it's normally called
+when opening new files."
+ (when projectile-max-file-buffer-count
+ (let ((project-buffers (projectile-project-buffer-files)))
+ (when (> (length project-buffers) projectile-max-file-buffer-count)
+ (kill-buffer (car (last project-buffers)))))))
+
+;;;###autoload
+(define-minor-mode projectile-mode
+ "Minor mode to assist project management and navigation.
+
+When called interactively, toggle `projectile-mode'. With prefix
+ARG, enable `projectile-mode' if ARG is positive, otherwise disable
+it.
+
+When called from Lisp, enable `projectile-mode' if ARG is omitted,
+nil or positive. If ARG is `toggle', toggle `projectile-mode'.
+Otherwise behave as if called interactively.
+
+\\{projectile-mode-map}"
+ :lighter projectile--mode-line
+ :keymap projectile-mode-map
+ :group 'projectile
+ :require 'projectile
+ :global t
+ (cond
+ (projectile-mode
+ ;; setup the commander bindings
+ (projectile-commander-bindings)
+ ;; initialize the projects cache if needed
+ (unless projectile-projects-cache
+ (setq projectile-projects-cache
+ (or (projectile-unserialize projectile-cache-file)
+ (make-hash-table :test 'equal))))
+ (unless projectile-projects-cache-time
+ (setq projectile-projects-cache-time
+ (make-hash-table :test 'equal)))
+ ;; load the known projects
+ (projectile-load-known-projects)
+ ;; update the list of known projects
+ (projectile--cleanup-known-projects)
+ (when projectile-auto-discover
+ (projectile-discover-projects-in-search-path))
+ (add-hook 'find-file-hook 'projectile-find-file-hook-function)
+ (add-hook 'projectile-find-dir-hook #'projectile-track-known-projects-find-file-hook t)
+ (add-hook 'dired-before-readin-hook #'projectile-track-known-projects-find-file-hook t t)
+ (advice-add 'compilation-find-file :around #'compilation-find-file-projectile-find-compilation-buffer)
+ (advice-add 'delete-file :before #'delete-file-projectile-remove-from-cache))
+ (t
+ (remove-hook 'find-file-hook #'projectile-find-file-hook-function)
+ (remove-hook 'dired-before-readin-hook #'projectile-track-known-projects-find-file-hook t)
+ (advice-remove 'compilation-find-file #'compilation-find-file-projectile-find-compilation-buffer)
+ (advice-remove 'delete-file #'delete-file-projectile-remove-from-cache))))
+
+;;; savehist-mode - When `savehist-mode' is t, projectile-project-command-history will be saved.
+;; See https://github.com/bbatsov/projectile/issues/1637 for more details
+(if (bound-and-true-p savehist-loaded)
+ (add-to-list 'savehist-additional-variables 'projectile-project-command-history)
+ (defvar savehist-additional-variables nil)
+ (add-hook 'savehist-mode-hook
+ (lambda()
+ (add-to-list 'savehist-additional-variables 'projectile-project-command-history))))
+
+;;;###autoload
+(define-obsolete-function-alias 'projectile-global-mode 'projectile-mode "1.0")
+
+(provide 'projectile)
+
+;;; projectile.el ends here
diff --git a/elpa/projectile-20220313.1334/projectile.elc b/elpa/projectile-20220313.1334/projectile.elc
new file mode 100644
index 0000000..18ad4c1
--- /dev/null
+++ b/elpa/projectile-20220313.1334/projectile.elc
Binary files differ
diff --git a/elpa/req-package-20180605.1141/req-package-args.el b/elpa/req-package-20180605.1141/req-package-args.el
new file mode 100644
index 0000000..bdcbab1
--- /dev/null
+++ b/elpa/req-package-20180605.1141/req-package-args.el
@@ -0,0 +1,31 @@
+;;; req-package-args.el --- summary:
+;;; commentary:
+;;; code:
+
+(require 'dash)
+
+(defconst req-package-keywords '(:require :force))
+
+(defun req-package-args-take-args (args acc)
+ "Take all args until next keyword."
+ (cond ((or (null args)
+ (and (keywordp (car args))
+ (or (-contains? use-package-keywords (car args))
+ (-contains? req-package-keywords (car args))))) (list (reverse acc) args))
+ (t (req-package-args-take-args (cdr args) (cons (car args) acc)))))
+
+(defun req-package-args-extract-arg (key args acc)
+ "Extract KEY value from ARGS list accummulating with ACC."
+ (if (null args)
+ (list nil (reverse acc))
+ (if (eq (car args) key)
+ (let* ((REST (cdr args))
+ (ALL (req-package-args-take-args REST nil))
+ (KEY-ARGS (car ALL))
+ (REST-ARGS (cadr ALL)))
+ (list KEY-ARGS
+ (append (reverse acc) REST-ARGS)))
+ (req-package-args-extract-arg key (cdr args) (cons (car args) acc)))))
+
+(provide 'req-package-args)
+;;; req-package-args ends here
diff --git a/elpa/req-package-20180605.1141/req-package-args.elc b/elpa/req-package-20180605.1141/req-package-args.elc
new file mode 100644
index 0000000..a810b81
--- /dev/null
+++ b/elpa/req-package-20180605.1141/req-package-args.elc
Binary files differ
diff --git a/elpa/req-package-20180605.1141/req-package-autoloads.el b/elpa/req-package-20180605.1141/req-package-autoloads.el
new file mode 100644
index 0000000..25b04f0
--- /dev/null
+++ b/elpa/req-package-20180605.1141/req-package-autoloads.el
@@ -0,0 +1,50 @@
+;;; req-package-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "req-package" "req-package.el" (0 0 0 0))
+;;; Generated autoloads from req-package.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "req-package" '("req-package")))
+
+;;;***
+
+;;;### (autoloads nil "req-package-args" "req-package-args.el" (0
+;;;;;; 0 0 0))
+;;; Generated autoloads from req-package-args.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "req-package-args" '("req-package-")))
+
+;;;***
+
+;;;### (autoloads nil "req-package-cycles" "req-package-cycles.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from req-package-cycles.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "req-package-cycles" '("req-package-cycles-")))
+
+;;;***
+
+;;;### (autoloads nil "req-package-hooks" "req-package-hooks.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from req-package-hooks.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "req-package-hooks" '("add-hook-exec" "req-package-hooks-")))
+
+;;;***
+
+;;;### (autoloads nil nil ("req-package-pkg.el") (0 0 0 0))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; req-package-autoloads.el ends here
diff --git a/elpa/req-package-20180605.1141/req-package-cycles.el b/elpa/req-package-20180605.1141/req-package-cycles.el
new file mode 100644
index 0000000..73d982e
--- /dev/null
+++ b/elpa/req-package-20180605.1141/req-package-cycles.el
@@ -0,0 +1,35 @@
+;;; req-package-cycles.el --- summary:
+;;; commentary:
+;;; code:
+
+(require 'dash)
+
+(defvar req-package-cycles-count 0
+ "Number of cycles detected.")
+
+(defun req-package-cycles-detect-traverse-impl (graph visited cur path)
+ "Traverse for cycles look up implementation"
+ (puthash cur t visited)
+ (if (not (-contains? path cur))
+ (-each (gethash cur graph nil)
+ (lambda (dependent)
+ (req-package-cycles-detect-traverse-impl graph visited dependent (cons cur path))))
+ (progn (setq req-package-cycles-count (+ req-package-cycles-count 1))
+ (req-package--log-error "cycle detected: %s" (cons cur path)))))
+
+(defun req-package-cycles-detect-traverse (graph visited)
+ "Traverse for cycles look up"
+ (maphash (lambda (key value)
+ (if (null (gethash key visited nil))
+ (req-package-cycles-detect-traverse-impl graph visited key nil)))
+ graph)
+ (if (not (eq 0 req-package-cycles-count))
+ (message "%s cycle(s) detected. see M-x req-package--log-open-log"
+ req-package-cycles-count)))
+
+(defun req-package-cycles-detect (graph)
+ (setq req-package-cycles-count 0)
+ (req-package-cycles-detect-traverse graph (make-hash-table :size 200)))
+
+(provide 'req-package-cycles)
+;;; req-package-cycles ends here
diff --git a/elpa/req-package-20180605.1141/req-package-cycles.elc b/elpa/req-package-20180605.1141/req-package-cycles.elc
new file mode 100644
index 0000000..8e0a89b
--- /dev/null
+++ b/elpa/req-package-20180605.1141/req-package-cycles.elc
Binary files differ
diff --git a/elpa/req-package-20180605.1141/req-package-hooks.el b/elpa/req-package-20180605.1141/req-package-hooks.el
new file mode 100644
index 0000000..b12d2c3
--- /dev/null
+++ b/elpa/req-package-20180605.1141/req-package-hooks.el
@@ -0,0 +1,26 @@
+;;; req-package-hooks.el --- summary:
+;;; commentary:
+;;; code:
+
+(defun req-package-hooks-mode-loaded-p (mode)
+ "Return true if MODE is loaded now."
+ (or (assoc mode minor-mode-list) (equal major-mode mode)))
+
+(defun req-package-hooks-add-execute-impl (m h f)
+ "Add function F to hook H and execute it if mode M is already activated"
+ (add-hook h f)
+ (if (req-package-hooks-mode-loaded-p m)
+ (funcall f)))
+
+(defun req-package-hooks-add-execute (m f)
+ "Add function F to mode M and execute it if already activated"
+ (let ((h (intern (concat (symbol-name m) "-hook"))))
+ (req-package-hooks-add-execute-impl m h f)))
+
+(defun add-hook-exec (m f &optional ff)
+ (if ff
+ (req-package-hooks-add-execute-impl m f ff)
+ (req-package-hooks-add-execute m f)))
+
+(provide 'req-package-hooks)
+;;; req-package-hooks ends here
diff --git a/elpa/req-package-20180605.1141/req-package-hooks.elc b/elpa/req-package-20180605.1141/req-package-hooks.elc
new file mode 100644
index 0000000..ad47738
--- /dev/null
+++ b/elpa/req-package-20180605.1141/req-package-hooks.elc
Binary files differ
diff --git a/elpa/req-package-20180605.1141/req-package-pkg.el b/elpa/req-package-20180605.1141/req-package-pkg.el
new file mode 100644
index 0000000..bab68a3
--- /dev/null
+++ b/elpa/req-package-20180605.1141/req-package-pkg.el
@@ -0,0 +1,15 @@
+(define-package "req-package" "20180605.1141" "A use-package wrapper for package runtime dependencies management"
+ '((use-package "1.0")
+ (dash "2.7.0")
+ (log4e "0.2.0")
+ (ht "0"))
+ :commit "a77da72931914ac5f3f64dc61fe9dc3522b2817e" :authors
+ '(("Edward Knyshov" . "edvorg@gmail.com"))
+ :maintainer
+ '("Edward Knyshov" . "edvorg@gmail.com")
+ :keywords
+ '("dotemacs" "startup" "speed" "config" "package")
+ :url "https://github.com/edvorg/req-package")
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/elpa/req-package-20180605.1141/req-package.el b/elpa/req-package-20180605.1141/req-package.el
new file mode 100644
index 0000000..d209d50
--- /dev/null
+++ b/elpa/req-package-20180605.1141/req-package.el
@@ -0,0 +1,494 @@
+;;; req-package.el --- A use-package wrapper for package runtime dependencies management
+
+;; Copyright (C) 2013-2018 Edward Knyshov
+
+;; Author: Edward Knyshov <edvorg@gmail.com>
+;; Created: 25 Dec 2013
+;; Version: 1.3
+;; Package-Requires: ((use-package "1.0") (dash "2.7.0") (log4e "0.2.0") (ht "0"))
+;; Keywords: dotemacs startup speed config package
+;; X-URL: https://github.com/edvorg/req-package
+
+;; This program 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, or (at
+;; your option) any later version.
+
+;; This program 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; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Table of Contents
+;; ─────────────────
+
+;; 1 req-package
+;; .. 1.1 Description
+;; .. 1.2 Usage
+;; .. 1.3 Logging
+;; .. 1.4 Migrate from use-package
+;; .. 1.5 Note
+;; .. 1.6 Contribute
+;; .. 1.7 Changelog
+;; ..... 1.7.1 `v1.3'
+;; ..... 1.7.2 `v1.2'
+;; ..... 1.7.3 `v1.1'
+;; ..... 1.7.4 `v1.0'
+;; ..... 1.7.5 `v0.9'
+;; ..... 1.7.6 `v0.8'
+;; ..... 1.7.7 `v0.7'
+;; ..... 1.7.8 `v0.6'
+;; ..... 1.7.9 `v0.5'
+;; ..... 1.7.10 `v0.4.2'
+;; ..... 1.7.11 `v0.4.1'
+;; ..... 1.7.12 `v0.4-all-cycles'
+;; ..... 1.7.13 `v0.3-cycles'
+;; ..... 1.7.14 `v0.2-auto-fetch'
+
+
+;; 1 req-package
+;; ═════════════
+
+;; [file:https://img.shields.io/badge/license-GPL_3-green.svg]
+;; [file:http://melpa.org/packages/req-package-badge.svg]
+;; [file:http://stable.melpa.org/packages/req-package-badge.svg]
+;; [file:https://travis-ci.org/edvorg/req-package.svg]
+;; [file:https://coveralls.io/repos/edvorg/req-package/badge.svg?branch=develop&service=github]
+
+
+;; [file:https://img.shields.io/badge/license-GPL_3-green.svg]
+;; http://www.gnu.org/licenses/gpl-3.0.txt
+
+;; [file:http://melpa.org/packages/req-package-badge.svg]
+;; http://melpa.org/#/req-package
+
+;; [file:http://stable.melpa.org/packages/req-package-badge.svg]
+;; http://stable.melpa.org/#/req-package
+
+;; [file:https://travis-ci.org/edvorg/req-package.svg]
+;; https://travis-ci.org/edvorg/req-package
+
+;; [file:https://coveralls.io/repos/edvorg/req-package/badge.svg?branch=develop&service=github]
+;; https://coveralls.io/github/edvorg/req-package?branch=develop
+
+;; 1.1 Description
+;; ───────────────
+
+;; `req-package' provides dependency management for use-package. This
+;; allows to write simple and modular configs. Migration from
+;; use-package is simple and syntax is almost same.
+
+
+;; 1.2 Usage
+;; ─────────
+
+;; Load req-package:
+
+;; ┌────
+;; │ (require 'req-package)
+;; │
+;; │ (req-package use-package-el-get ;; prepare el-get support for use-package (optional)
+;; │ :force t ;; load package immediately, no dependency resolution
+;; │ :config
+;; │ (add-to-list 'el-get-recipe-path "~/.emacs.d/el-get/el-get/recipes")
+;; │ (el-get 'sync)
+;; │ (use-package-el-get-setup))
+;; └────
+
+;; Define required packages with dependencies using `:require'. Use
+;; `:force t' if you want to avoid dependency management and load right
+;; now. Use `:el-get t' or `:el-get package-name' if you want to install
+;; from el-get (Requires `use-package-el-get' package setup like
+;; described above).
+
+;; ┌────
+;; │ ;; init-dired.el
+;; │
+;; │ (req-package dired) ;; this form is optional as it doesn't have any configuration
+;; │
+;; │ (req-package dired-single
+;; │ :require dired ;; depends on dired
+;; │ :config (...))
+;; │
+;; │ (req-package dired-isearch
+;; │ :require dired ;; depends on dired
+;; │ :config (...))
+;; │
+;; │ ;; init-lua.el
+;; │
+;; │ (req-package lua-mode
+;; │ :config (...))
+;; │
+;; │ (req-package flymake-lua
+;; │ :require flymake lua-mode
+;; │ :config (...))
+;; │
+;; │ ;; init-flymake.el
+;; │
+;; │ (req-package flymake
+;; │ :config (...))
+;; │
+;; │ (req-package flymake-cursor
+;; │ :require flymake
+;; │ :config (...))
+;; │
+;; │ (req-package flymake-custom
+;; │ :require flymake
+;; │ :load-path "/path/to/file/directory"
+;; │ :config (...))
+;; └────
+
+;; Solve dependencies, install and load packages in right order:
+
+;; ┌────
+;; │ ;; order doesn't matter here
+;; │ (require 'init-dired)
+;; │ (require 'init-lua)
+;; │ (require 'init-flymake)
+;; │ (req-package-finish)
+;; └────
+
+
+;; 1.3 Logging
+;; ───────────
+
+;; You can use `req-package--log-open-log' to see, what is happening with
+;; your configuration. You can choose log level in `req-package' group
+;; by `req-package-log-level' custom. These log levels are supported:
+;; `fatal', `error', `warn', `info', `debug', `trace'.
+
+
+;; 1.4 Migrate from use-package
+;; ────────────────────────────
+
+;; Just replace all `(use-package ...)' with `(req-package [:require
+;; DEPS] ...)' and add `(req-package-finish)' at the end of your
+;; configuration file. There is a `:force' keyword which simulates plain
+;; old use-package behavior.
+
+
+;; 1.5 Note
+;; ────────
+
+;; More complex req-package usage example can be found at
+;; [https://github.com/edvorg/emacs-configs].
+
+;; Use `load-dir' package to load all `*.el' files in a dir (e.g
+;; `~/.emacs.d/init.d')
+
+
+;; 1.6 Contribute
+;; ──────────────
+
+;; Please, pull-request your changes to `develop' branch. Master is used
+;; for automatic *release* package builds by travis-ci.
+
+
+;; 1.7 Changelog
+;; ─────────────
+
+;; 1.7.1 `v1.3'
+;; ╌╌╌╌╌╌╌╌╌╌╌╌
+
+;; • :el-get keyword support moved to separate package
+;; [use-package-el-get]
+
+
+;; [use-package-el-get] https://github.com/edvorg/use-package-el-get
+
+
+;; 1.7.2 `v1.2'
+;; ╌╌╌╌╌╌╌╌╌╌╌╌
+
+;; • add :el-get keyword
+
+
+;; 1.7.3 `v1.1'
+;; ╌╌╌╌╌╌╌╌╌╌╌╌
+
+;; • due to use-package being mature enough drop providers system
+
+
+;; 1.7.4 `v1.0'
+;; ╌╌╌╌╌╌╌╌╌╌╌╌
+
+;; • once you called `req-package-finish' you are able reload package
+;; just by reload `req-package' form
+;; • proper errors handling. see `req-package--log-open-log' for messages
+;; • smart add-hook which invokes function if mode is loaded
+;; • refactor providers system
+;; • no need to use progn in :init and :config sections
+;; • no need to use list literal in :require section
+;; • `:loader' keyword now accepts loaders as keywords or as functions.
+;; e.g. `:el-get', `:elpa', `:built-in', `:path' and `my-loader-fn'
+;; • `req-package-force' replaced with `:force' keyword
+
+
+;; 1.7.5 `v0.9'
+;; ╌╌╌╌╌╌╌╌╌╌╌╌
+
+;; • `:loader' keyword support
+
+
+;; 1.7.6 `v0.8'
+;; ╌╌╌╌╌╌╌╌╌╌╌╌
+
+;; • bugfixes
+
+
+;; 1.7.7 `v0.7'
+;; ╌╌╌╌╌╌╌╌╌╌╌╌
+
+;; • fixed some issues with packages installation. all packages will be
+;; installed at bootstrap time
+;; • custom package providers support by `req-package-providers'
+;; • priority feature for cross provider packages loading. you can
+;; choose, what to try first - elpa, el-get, or something else
+
+
+;; 1.7.8 `v0.6'
+;; ╌╌╌╌╌╌╌╌╌╌╌╌
+
+;; • `el-get' support
+
+
+;; 1.7.9 `v0.5'
+;; ╌╌╌╌╌╌╌╌╌╌╌╌
+
+;; • Major system refactoring.
+;; • Fixed bugs with defered loading.
+;; • Significant performance optimization.
+;; • `max-specpdl-size', `max-lisp-eval-depth' issues completely solved.
+;; • Flexible `:require' keyword parsing.
+
+
+;; 1.7.10 `v0.4.2'
+;; ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
+
+;; • Bug fixes.
+
+
+;; 1.7.11 `v0.4.1'
+;; ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
+
+;; • Various tweaks and bug fixes.
+
+
+;; 1.7.12 `v0.4-all-cycles'
+;; ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
+
+;; • All cycles of your dependencies will be printed now.
+;; • Also there are more handy log messages and some bug fixes.
+
+
+;; 1.7.13 `v0.3-cycles'
+;; ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
+
+;; • There are nice error messages about cycled dependencies now.
+;; • Cycles printed in a way: `pkg1 -> [pkg2 -> ...] pkg1'.
+;; • It means there is a cycle around `pkg1'.
+
+
+;; 1.7.14 `v0.2-auto-fetch'
+;; ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
+
+;; • There is no need of explicit `:ensure' in your code now.
+;; • When you req-package it adds `:ensure' if package is available in
+;; your repos.
+;; • Also package deps `:ensure''d automatically too.
+;; • Just write `(req-package pkg1 :require pkg2)' and all you need will
+;; be installed.
+
+;;; Code:
+
+(eval-when-compile (require 'cl))
+(require 'package)
+
+(defun req-package-bootstrap (package)
+ "Refresh package archives, check PACKAGE presence and install if it's not installed."
+ (if (null (require package nil t))
+ (progn (let* ((ARCHIVES (if (null package-archive-contents)
+ (progn (package-refresh-contents)
+ package-archive-contents)
+ package-archive-contents))
+ (AVAIL (assoc package ARCHIVES)))
+ (if AVAIL
+ (package-install package))))))
+
+(req-package-bootstrap 'use-package)
+(req-package-bootstrap 'dash)
+(req-package-bootstrap 'log4e)
+(req-package-bootstrap 'ht)
+
+(require 'use-package)
+(require 'dash)
+(require 'log4e)
+(require 'ht)
+
+(require 'req-package-hooks)
+(require 'req-package-args)
+(require 'req-package-cycles)
+
+(defgroup req-package nil
+ "A package loading system"
+ :group 'emacs)
+
+(defcustom req-package-log-level 'info
+ "Minimal log level, may be any level supported by log4e."
+ :group 'req-package)
+
+(defvar req-package-required-by (make-hash-table :size 200 :test 'equal)
+ "Package symbol -> list of packages dependent on it.")
+
+(defvar req-package-deps-left (make-hash-table :size 200 :test 'equal)
+ "Package symbol -> loaded dependencies counter.")
+
+(defvar req-package-evals (make-hash-table :size 200 :test 'equal)
+ "Package symbol -> loading code prepared for evaluation.")
+
+(defvar req-package-branches (make-hash-table :size 200 :test 'equal))
+
+(defun req-package-patch-config (pkg form)
+ "Wrap package PKG :config FORM into progn with callbacks."
+ (list 'progn
+ (list 'req-package-handle-loading (list 'quote pkg) (list 'lambda () form))
+ (list 'req-package-loaded (list 'quote pkg))))
+
+(defun req-package-eval-form (EVAL)
+ "Logs, macroexpands and evaluates EVAL form."
+ (req-package--log-trace "eval %s" EVAL)
+ (eval (macroexpand-all EVAL)))
+
+(defun req-package-eval (pkg)
+ "Evaluate package PKG request."
+ (let* ((DEFAULT (req-package-gen-eval pkg (list 'progn) (req-package-patch-config pkg nil) nil))
+ (EVAL (gethash pkg req-package-evals DEFAULT))
+ (PKG pkg))
+ (req-package-handle-loading PKG (lambda () (req-package-eval-form EVAL)))))
+
+(defun req-package-loaded (pkg)
+ "Called after package PKG loaded to continue dependency graph traverse."
+ (req-package--log-info "package loaded: %s" pkg)
+ (let* ((EVALS (-reduce-from
+ (lambda (memo dependent)
+ (let* ((DEPS-LEFT (- (gethash dependent req-package-deps-left 0) 1)))
+ (puthash dependent DEPS-LEFT req-package-deps-left)
+ (if (equal 0 DEPS-LEFT)
+ (cons dependent memo)
+ memo)))
+ nil
+ (gethash (car pkg) req-package-required-by nil))))
+ (-each EVALS (lambda (pkg)
+ (puthash pkg -1 req-package-deps-left)
+ (req-package-eval pkg)))))
+
+(defun req-package-handle-loading (pkg f)
+ "Error handle for package PKG loading process by calling F."
+ (condition-case-unless-debug e
+ (funcall f)
+ (error (req-package--log-error (format "Unable to load package %s -- %s" pkg e)))))
+
+(defun req-package-gen-eval (package init config rest)
+ "Generate eval for PACKAGE."
+ (let* ((package (car package)))
+ (append (list 'use-package package)
+ (list :init init)
+ (list :config config)
+ rest)))
+
+(defun req-package-schedule (PKG DEPS EVAL)
+ (let* ((DEPS-LEFT (gethash PKG req-package-deps-left 0))
+ (BRANCHES (ht-get req-package-branches (car PKG))))
+ (req-package--log-debug "package requested: %s %s" PKG EVAL)
+ (puthash PKG EVAL req-package-evals)
+ (ht-set req-package-branches (car PKG) (cons PKG BRANCHES))
+ (if (= DEPS-LEFT -1)
+ (progn ;; package already been loaded before, just eval again
+ (req-package-handle-loading PKG (lambda () (req-package-eval-form EVAL)))
+ DEPS-LEFT)
+ (progn ;; insert package in dependency graph
+ (puthash PKG 0 req-package-deps-left)
+ (-each DEPS
+ (lambda (req)
+ (let* ((REQUIRED-BY (gethash req req-package-required-by nil))
+ (DEPS-LEFT (gethash PKG req-package-deps-left 0))
+ (REQ-DEPS-LEFT (gethash req req-package-deps-left 0))
+ (BRANCHES (ht-get req-package-branches req)))
+ (ht-set req-package-branches req BRANCHES)
+ (when (not (equal -1 REQ-DEPS-LEFT))
+ (puthash req (cons PKG REQUIRED-BY) req-package-required-by)
+ (puthash PKG (+ DEPS-LEFT 1) req-package-deps-left)))))))))
+
+(defmacro req-package (pkg &rest args)
+ "Add package PKG with ARGS to target list."
+ `(let* ((PKG ',pkg)
+ (ARGS ',args)
+ (SPLIT1 (req-package-args-extract-arg :require ARGS nil))
+ (SPLIT2 (req-package-args-extract-arg :init (cadr SPLIT1) nil))
+ (SPLIT3 (req-package-args-extract-arg :config (cadr SPLIT2) nil))
+ (SPLIT4 (req-package-args-extract-arg :force (cadr SPLIT3) nil))
+ (DEPS (-flatten (car SPLIT1)))
+ (INIT (cons 'progn (car SPLIT2)))
+ (PKG (list PKG DEPS))
+ (CONFIG (req-package-patch-config PKG (cons 'progn (car SPLIT3))))
+ (FORCE (caar SPLIT4))
+ (REST (cadr SPLIT4))
+ (EVAL (req-package-gen-eval PKG INIT CONFIG REST)))
+ (if FORCE
+ (progn ;; load avoiding dependency management
+ (req-package--log-debug "package force-requested: %s %s" PKG EVAL)
+ (req-package-handle-loading PKG (lambda () (req-package-eval-form EVAL))))
+ (req-package-schedule PKG DEPS EVAL))))
+
+(defmacro req-package-force (pkg &rest args)
+ `(let* ((PKG ',pkg)
+ (ARGS ',args))
+ (eval (macroexpand-all (apply 'list 'req-package PKG :force t ARGS)))))
+
+(defun req-package-finish ()
+ "Start loading process, call this after all req-package invocations."
+ ;; (req-package-cycles-detect req-package-required-by) ;; FIXME
+ (req-package--log-debug "package requests finished: %s packages are waiting"
+ (hash-table-count req-package-branches))
+ (maphash (lambda (req branches)
+ (when (not branches)
+ (let* ((REQ-PKG (list req nil))
+ (CURRENT (gethash REQ-PKG req-package-deps-left 0)))
+ (puthash REQ-PKG CURRENT req-package-deps-left))))
+ req-package-branches)
+ (maphash (lambda (key value)
+ (when (equal (gethash key req-package-deps-left 0) 0)
+ (puthash key -1 req-package-deps-left)
+ (req-package-eval key)))
+ req-package-deps-left))
+
+(put 'req-package 'lisp-indent-function 'defun)
+(put 'req-package-force 'lisp-indent-function 'defun)
+(put 'req-package-hooks-add-execute 'lisp-indent-function 'defun)
+(put 'req-package-hooks-add-execute-impl 'lisp-indent-function 'defun)
+
+(defconst req-package-font-lock-keywords
+ '(("(\\(req-package\\|req-package-force\\)\\_>[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?"
+ (1 font-lock-keyword-face)
+ (2 font-lock-constant-face nil t))))
+
+(font-lock-add-keywords 'emacs-lisp-mode req-package-font-lock-keywords)
+
+(log4e:deflogger "req-package" "%t [%l] %m" "%H:%M:%S")
+(req-package--log-set-level req-package-log-level)
+(req-package--log-enable-logging)
+(req-package--log-clear-log)
+
+(provide 'req-package)
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
+;;; req-package.el ends here
diff --git a/elpa/req-package-20180605.1141/req-package.elc b/elpa/req-package-20180605.1141/req-package.elc
new file mode 100644
index 0000000..58c1eac
--- /dev/null
+++ b/elpa/req-package-20180605.1141/req-package.elc
Binary files differ
diff --git a/elpa/s-20210616.619/s-autoloads.el b/elpa/s-20210616.619/s-autoloads.el
new file mode 100644
index 0000000..187f6d1
--- /dev/null
+++ b/elpa/s-20210616.619/s-autoloads.el
@@ -0,0 +1,22 @@
+;;; s-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*-
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "s" "s.el" (0 0 0 0))
+;;; Generated autoloads from s.el
+
+(register-definition-prefixes "s" '("s-"))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; s-autoloads.el ends here
diff --git a/elpa/s-20210616.619/s-pkg.el b/elpa/s-20210616.619/s-pkg.el
new file mode 100644
index 0000000..31e930d
--- /dev/null
+++ b/elpa/s-20210616.619/s-pkg.el
@@ -0,0 +1,2 @@
+;;; Generated package description from s.el -*- no-byte-compile: t -*-
+(define-package "s" "20210616.619" "The long lost Emacs string manipulation library." 'nil :commit "08661efb075d1c6b4fa812184c1e5e90c08795a9" :authors '(("Magnar Sveen" . "magnars@gmail.com")) :maintainer '("Magnar Sveen" . "magnars@gmail.com") :keywords '("strings"))
diff --git a/elpa/s-20210616.619/s.el b/elpa/s-20210616.619/s.el
new file mode 100644
index 0000000..39c8d9e
--- /dev/null
+++ b/elpa/s-20210616.619/s.el
@@ -0,0 +1,745 @@
+;;; s.el --- The long lost Emacs string manipulation library.
+
+;; Copyright (C) 2012-2015 Magnar Sveen
+
+;; Author: Magnar Sveen <magnars@gmail.com>
+;; Version: 1.12.0
+;; Package-Version: 20210616.619
+;; Package-Commit: 08661efb075d1c6b4fa812184c1e5e90c08795a9
+;; Keywords: strings
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; The long lost Emacs string manipulation library.
+;;
+;; See documentation on https://github.com/magnars/s.el#functions
+
+;;; Code:
+
+;; Silence byte-compiler
+(defvar ucs-normalize-combining-chars) ; Defined in `ucs-normalize'
+(autoload 'slot-value "eieio")
+
+(defun s-trim-left (s)
+ "Remove whitespace at the beginning of S."
+ (declare (pure t) (side-effect-free t))
+ (save-match-data
+ (if (string-match "\\`[ \t\n\r]+" s)
+ (replace-match "" t t s)
+ s)))
+
+(defun s-trim-right (s)
+ "Remove whitespace at the end of S."
+ (save-match-data
+ (declare (pure t) (side-effect-free t))
+ (if (string-match "[ \t\n\r]+\\'" s)
+ (replace-match "" t t s)
+ s)))
+
+(defun s-trim (s)
+ "Remove whitespace at the beginning and end of S."
+ (declare (pure t) (side-effect-free t))
+ (s-trim-left (s-trim-right s)))
+
+(defun s-collapse-whitespace (s)
+ "Convert all adjacent whitespace characters to a single space."
+ (declare (pure t) (side-effect-free t))
+ (replace-regexp-in-string "[ \t\n\r]+" " " s))
+
+(defun s-split (separator s &optional omit-nulls)
+ "Split S into substrings bounded by matches for regexp SEPARATOR.
+If OMIT-NULLS is non-nil, zero-length substrings are omitted.
+
+This is a simple wrapper around the built-in `split-string'."
+ (declare (side-effect-free t))
+ (save-match-data
+ (split-string s separator omit-nulls)))
+
+(defun s-split-up-to (separator s n &optional omit-nulls)
+ "Split S up to N times into substrings bounded by matches for regexp SEPARATOR.
+
+If OMIT-NULLS is non-nil, zero-length substrings are omitted.
+
+See also `s-split'."
+ (declare (side-effect-free t))
+ (save-match-data
+ (let ((op 0)
+ (r nil))
+ (with-temp-buffer
+ (insert s)
+ (setq op (goto-char (point-min)))
+ (while (and (re-search-forward separator nil t)
+ (< 0 n))
+ (let ((sub (buffer-substring op (match-beginning 0))))
+ (unless (and omit-nulls
+ (equal sub ""))
+ (push sub r)))
+ (setq op (goto-char (match-end 0)))
+ (setq n (1- n)))
+ (let ((sub (buffer-substring op (point-max))))
+ (unless (and omit-nulls
+ (equal sub ""))
+ (push sub r))))
+ (nreverse r))))
+
+(defun s-lines (s)
+ "Splits S into a list of strings on newline characters."
+ (declare (pure t) (side-effect-free t))
+ (s-split "\\(\r\n\\|[\n\r]\\)" s))
+
+(defun s-join (separator strings)
+ "Join all the strings in STRINGS with SEPARATOR in between."
+ (declare (pure t) (side-effect-free t))
+ (mapconcat 'identity strings separator))
+
+(defun s-concat (&rest strings)
+ "Join all the string arguments into one string."
+ (declare (pure t) (side-effect-free t))
+ (apply 'concat strings))
+
+(defun s-prepend (prefix s)
+ "Concatenate PREFIX and S."
+ (declare (pure t) (side-effect-free t))
+ (concat prefix s))
+
+(defun s-append (suffix s)
+ "Concatenate S and SUFFIX."
+ (declare (pure t) (side-effect-free t))
+ (concat s suffix))
+
+(defun s-repeat (num s)
+ "Make a string of S repeated NUM times."
+ (declare (pure t) (side-effect-free t))
+ (let (ss)
+ (while (> num 0)
+ (setq ss (cons s ss))
+ (setq num (1- num)))
+ (apply 'concat ss)))
+
+(defun s-chop-suffix (suffix s)
+ "Remove SUFFIX if it is at end of S."
+ (declare (pure t) (side-effect-free t))
+ (let ((pos (- (length suffix))))
+ (if (and (>= (length s) (length suffix))
+ (string= suffix (substring s pos)))
+ (substring s 0 pos)
+ s)))
+
+(defun s-chop-suffixes (suffixes s)
+ "Remove SUFFIXES one by one in order, if they are at the end of S."
+ (declare (pure t) (side-effect-free t))
+ (while suffixes
+ (setq s (s-chop-suffix (car suffixes) s))
+ (setq suffixes (cdr suffixes)))
+ s)
+
+(defun s-chop-prefix (prefix s)
+ "Remove PREFIX if it is at the start of S."
+ (declare (pure t) (side-effect-free t))
+ (let ((pos (length prefix)))
+ (if (and (>= (length s) (length prefix))
+ (string= prefix (substring s 0 pos)))
+ (substring s pos)
+ s)))
+
+(defun s-chop-prefixes (prefixes s)
+ "Remove PREFIXES one by one in order, if they are at the start of S."
+ (declare (pure t) (side-effect-free t))
+ (while prefixes
+ (setq s (s-chop-prefix (car prefixes) s))
+ (setq prefixes (cdr prefixes)))
+ s)
+
+(defun s-shared-start (s1 s2)
+ "Returns the longest prefix S1 and S2 have in common."
+ (declare (pure t) (side-effect-free t))
+ (let ((cmp (compare-strings s1 0 (length s1) s2 0 (length s2))))
+ (if (eq cmp t) s1 (substring s1 0 (1- (abs cmp))))))
+
+(defun s-shared-end (s1 s2)
+ "Returns the longest suffix S1 and S2 have in common."
+ (declare (pure t) (side-effect-free t))
+ (let* ((l1 (length s1))
+ (l2 (length s2))
+ (search-length (min l1 l2))
+ (i 0))
+ (while (and (< i search-length)
+ (= (aref s1 (- l1 i 1)) (aref s2 (- l2 i 1))))
+ (setq i (1+ i)))
+ ;; If I is 0, then it means that there's no common suffix between
+ ;; S1 and S2.
+ ;;
+ ;; However, since (substring s (- 0)) will return the whole
+ ;; string, `s-shared-end' should simply return the empty string
+ ;; when I is 0.
+ (if (zerop i)
+ ""
+ (substring s1 (- i)))))
+
+(defun s-chomp (s)
+ "Remove one trailing `\\n`, `\\r` or `\\r\\n` from S."
+ (declare (pure t) (side-effect-free t))
+ (s-chop-suffixes '("\n" "\r") s))
+
+(defun s-truncate (len s &optional ellipsis)
+ "If S is longer than LEN, cut it down and add ELLIPSIS to the end.
+
+The resulting string, including ellipsis, will be LEN characters
+long.
+
+When not specified, ELLIPSIS defaults to ‘...’."
+ (declare (pure t) (side-effect-free t))
+ (unless ellipsis
+ (setq ellipsis "..."))
+ (if (> (length s) len)
+ (format "%s%s" (substring s 0 (- len (length ellipsis))) ellipsis)
+ s))
+
+(defun s-word-wrap (len s)
+ "If S is longer than LEN, wrap the words with newlines."
+ (declare (side-effect-free t))
+ (save-match-data
+ (with-temp-buffer
+ (insert s)
+ (let ((fill-column len))
+ (fill-region (point-min) (point-max)))
+ (buffer-substring (point-min) (point-max)))))
+
+(defun s-center (len s)
+ "If S is shorter than LEN, pad it with spaces so it is centered."
+ (declare (pure t) (side-effect-free t))
+ (let ((extra (max 0 (- len (length s)))))
+ (concat
+ (make-string (ceiling extra 2) ? )
+ s
+ (make-string (floor extra 2) ? ))))
+
+(defun s-pad-left (len padding s)
+ "If S is shorter than LEN, pad it with PADDING on the left."
+ (declare (pure t) (side-effect-free t))
+ (let ((extra (max 0 (- len (length s)))))
+ (concat (make-string extra (string-to-char padding))
+ s)))
+
+(defun s-pad-right (len padding s)
+ "If S is shorter than LEN, pad it with PADDING on the right."
+ (declare (pure t) (side-effect-free t))
+ (let ((extra (max 0 (- len (length s)))))
+ (concat s
+ (make-string extra (string-to-char padding)))))
+
+(defun s-left (len s)
+ "Returns up to the LEN first chars of S."
+ (declare (pure t) (side-effect-free t))
+ (if (> (length s) len)
+ (substring s 0 len)
+ s))
+
+(defun s-right (len s)
+ "Returns up to the LEN last chars of S."
+ (declare (pure t) (side-effect-free t))
+ (let ((l (length s)))
+ (if (> l len)
+ (substring s (- l len) l)
+ s)))
+
+(defun s-ends-with? (suffix s &optional ignore-case)
+ "Does S end with SUFFIX?
+
+If IGNORE-CASE is non-nil, the comparison is done without paying
+attention to case differences.
+
+Alias: `s-suffix?'"
+ (declare (pure t) (side-effect-free t))
+ (let ((start-pos (- (length s) (length suffix))))
+ (and (>= start-pos 0)
+ (eq t (compare-strings suffix nil nil
+ s start-pos nil ignore-case)))))
+
+(defun s-starts-with? (prefix s &optional ignore-case)
+ "Does S start with PREFIX?
+
+If IGNORE-CASE is non-nil, the comparison is done without paying
+attention to case differences.
+
+Alias: `s-prefix?'. This is a simple wrapper around the built-in
+`string-prefix-p'."
+ (declare (pure t) (side-effect-free t))
+ (string-prefix-p prefix s ignore-case))
+
+(defun s--truthy? (val)
+ (declare (pure t) (side-effect-free t))
+ (not (null val)))
+
+(defun s-contains? (needle s &optional ignore-case)
+ "Does S contain NEEDLE?
+
+If IGNORE-CASE is non-nil, the comparison is done without paying
+attention to case differences."
+ (declare (pure t) (side-effect-free t))
+ (let ((case-fold-search ignore-case))
+ (s--truthy? (string-match-p (regexp-quote needle) s))))
+
+(defun s-equals? (s1 s2)
+ "Is S1 equal to S2?
+
+This is a simple wrapper around the built-in `string-equal'."
+ (declare (pure t) (side-effect-free t))
+ (string-equal s1 s2))
+
+(defun s-less? (s1 s2)
+ "Is S1 less than S2?
+
+This is a simple wrapper around the built-in `string-lessp'."
+ (declare (pure t) (side-effect-free t))
+ (string-lessp s1 s2))
+
+(defun s-matches? (regexp s &optional start)
+ "Does REGEXP match S?
+If START is non-nil the search starts at that index.
+
+This is a simple wrapper around the built-in `string-match-p'."
+ (declare (side-effect-free t))
+ (s--truthy? (string-match-p regexp s start)))
+
+(defun s-blank? (s)
+ "Is S nil or the empty string?"
+ (declare (pure t) (side-effect-free t))
+ (or (null s) (string= "" s)))
+
+(defun s-blank-str? (s)
+ "Is S nil or the empty string or string only contains whitespace?"
+ (declare (pure t) (side-effect-free t))
+ (or (s-blank? s) (s-blank? (s-trim s))))
+
+(defun s-present? (s)
+ "Is S anything but nil or the empty string?"
+ (declare (pure t) (side-effect-free t))
+ (not (s-blank? s)))
+
+(defun s-presence (s)
+ "Return S if it's `s-present?', otherwise return nil."
+ (declare (pure t) (side-effect-free t))
+ (and (s-present? s) s))
+
+(defun s-lowercase? (s)
+ "Are all the letters in S in lower case?"
+ (declare (side-effect-free t))
+ (let ((case-fold-search nil))
+ (not (string-match-p "[[:upper:]]" s))))
+
+(defun s-uppercase? (s)
+ "Are all the letters in S in upper case?"
+ (declare (side-effect-free t))
+ (let ((case-fold-search nil))
+ (not (string-match-p "[[:lower:]]" s))))
+
+(defun s-mixedcase? (s)
+ "Are there both lower case and upper case letters in S?"
+ (let ((case-fold-search nil))
+ (s--truthy?
+ (and (string-match-p "[[:lower:]]" s)
+ (string-match-p "[[:upper:]]" s)))))
+
+(defun s-capitalized? (s)
+ "In S, is the first letter upper case, and all other letters lower case?"
+ (declare (side-effect-free t))
+ (let ((case-fold-search nil))
+ (s--truthy?
+ (string-match-p "^[[:upper:]][^[:upper:]]*$" s))))
+
+(defun s-numeric? (s)
+ "Is S a number?"
+ (declare (pure t) (side-effect-free t))
+ (s--truthy?
+ (string-match-p "^[0-9]+$" s)))
+
+(defun s-replace (old new s)
+ "Replaces OLD with NEW in S."
+ (declare (pure t) (side-effect-free t))
+ (replace-regexp-in-string (regexp-quote old) new s t t))
+
+(defalias 's-replace-regexp 'replace-regexp-in-string)
+
+(defun s--aget (alist key)
+ (declare (pure t) (side-effect-free t))
+ (cdr (assoc-string key alist)))
+
+(defun s-replace-all (replacements s)
+ "REPLACEMENTS is a list of cons-cells. Each `car` is replaced with `cdr` in S."
+ (declare (pure t) (side-effect-free t))
+ (replace-regexp-in-string (regexp-opt (mapcar 'car replacements))
+ (lambda (it) (s--aget replacements it))
+ s t t))
+
+(defun s-downcase (s)
+ "Convert S to lower case.
+
+This is a simple wrapper around the built-in `downcase'."
+ (declare (side-effect-free t))
+ (downcase s))
+
+(defun s-upcase (s)
+ "Convert S to upper case.
+
+This is a simple wrapper around the built-in `upcase'."
+ (declare (side-effect-free t))
+ (upcase s))
+
+(defun s-capitalize (s)
+ "Convert the first word's first character to upper case and the rest to lower case in S."
+ (declare (side-effect-free t))
+ (concat (upcase (substring s 0 1)) (downcase (substring s 1))))
+
+(defun s-titleize (s)
+ "Convert each word's first character to upper case and the rest to lower case in S.
+
+This is a simple wrapper around the built-in `capitalize'."
+ (declare (side-effect-free t))
+ (capitalize s))
+
+(defmacro s-with (s form &rest more)
+ "Threads S through the forms. Inserts S as the last item
+in the first form, making a list of it if it is not a list
+already. If there are more forms, inserts the first form as the
+last item in second form, etc."
+ (declare (debug (form &rest [&or (function &rest form) fboundp])))
+ (if (null more)
+ (if (listp form)
+ `(,(car form) ,@(cdr form) ,s)
+ (list form s))
+ `(s-with (s-with ,s ,form) ,@more)))
+
+(put 's-with 'lisp-indent-function 1)
+
+(defun s-index-of (needle s &optional ignore-case)
+ "Returns first index of NEEDLE in S, or nil.
+
+If IGNORE-CASE is non-nil, the comparison is done without paying
+attention to case differences."
+ (declare (pure t) (side-effect-free t))
+ (let ((case-fold-search ignore-case))
+ (string-match-p (regexp-quote needle) s)))
+
+(defun s-reverse (s)
+ "Return the reverse of S."
+ (declare (pure t) (side-effect-free t))
+ (save-match-data
+ (if (multibyte-string-p s)
+ (let ((input (string-to-list s))
+ output)
+ (require 'ucs-normalize)
+ (while input
+ ;; Handle entire grapheme cluster as a single unit
+ (let ((grapheme (list (pop input))))
+ (while (memql (car input) ucs-normalize-combining-chars)
+ (push (pop input) grapheme))
+ (setq output (nconc (nreverse grapheme) output))))
+ (concat output))
+ (concat (nreverse (string-to-list s))))))
+
+(defun s-match-strings-all (regex string)
+ "Return a list of matches for REGEX in STRING.
+
+Each element itself is a list of matches, as per
+`match-string'. Multiple matches at the same position will be
+ignored after the first."
+ (declare (side-effect-free t))
+ (save-match-data
+ (let ((all-strings ())
+ (i 0))
+ (while (and (< i (length string))
+ (string-match regex string i))
+ (setq i (1+ (match-beginning 0)))
+ (let (strings
+ (num-matches (/ (length (match-data)) 2))
+ (match 0))
+ (while (/= match num-matches)
+ (push (match-string match string) strings)
+ (setq match (1+ match)))
+ (push (nreverse strings) all-strings)))
+ (nreverse all-strings))))
+
+(defun s-matched-positions-all (regexp string &optional subexp-depth)
+ "Return a list of matched positions for REGEXP in STRING.
+SUBEXP-DEPTH is 0 by default."
+ (declare (side-effect-free t))
+ (if (null subexp-depth)
+ (setq subexp-depth 0))
+ (save-match-data
+ (let ((pos 0) result)
+ (while (and (string-match regexp string pos)
+ (< pos (length string)))
+ (let ((m (match-end subexp-depth)))
+ (push (cons (match-beginning subexp-depth) (match-end subexp-depth)) result)
+ (setq pos (match-end 0))))
+ (nreverse result))))
+
+(defun s-match (regexp s &optional start)
+ "When the given expression matches the string, this function returns a list
+of the whole matching string and a string for each matched subexpressions.
+If it did not match the returned value is an empty list (nil).
+
+When START is non-nil the search will start at that index."
+ (declare (side-effect-free t))
+ (save-match-data
+ (if (string-match regexp s start)
+ (let ((match-data-list (match-data))
+ result)
+ (while match-data-list
+ (let* ((beg (car match-data-list))
+ (end (cadr match-data-list))
+ (subs (if (and beg end) (substring s beg end) nil)))
+ (setq result (cons subs result))
+ (setq match-data-list
+ (cddr match-data-list))))
+ (nreverse result)))))
+
+(defun s-slice-at (regexp s)
+ "Slices S up at every index matching REGEXP."
+ (declare (side-effect-free t))
+ (if (= 0 (length s)) (list "")
+ (save-match-data
+ (let (i)
+ (setq i (string-match regexp s 1))
+ (if i
+ (cons (substring s 0 i)
+ (s-slice-at regexp (substring s i)))
+ (list s))))))
+
+(defun s-split-words (s)
+ "Split S into list of words."
+ (declare (side-effect-free t))
+ (s-split
+ "[^[:word:]0-9]+"
+ (let ((case-fold-search nil))
+ (replace-regexp-in-string
+ "\\([[:lower:]]\\)\\([[:upper:]]\\)" "\\1 \\2"
+ (replace-regexp-in-string "\\([[:upper:]]\\)\\([[:upper:]][0-9[:lower:]]\\)" "\\1 \\2" s)))
+ t))
+
+(defun s--mapcar-head (fn-head fn-rest list)
+ "Like MAPCAR, but applies a different function to the first element."
+ (if list
+ (cons (funcall fn-head (car list)) (mapcar fn-rest (cdr list)))))
+
+(defun s-lower-camel-case (s)
+ "Convert S to lowerCamelCase."
+ (declare (side-effect-free t))
+ (s-join "" (s--mapcar-head 'downcase 'capitalize (s-split-words s))))
+
+(defun s-upper-camel-case (s)
+ "Convert S to UpperCamelCase."
+ (declare (side-effect-free t))
+ (s-join "" (mapcar 'capitalize (s-split-words s))))
+
+(defun s-snake-case (s)
+ "Convert S to snake_case."
+ (declare (side-effect-free t))
+ (s-join "_" (mapcar 'downcase (s-split-words s))))
+
+(defun s-dashed-words (s)
+ "Convert S to dashed-words."
+ (declare (side-effect-free t))
+ (s-join "-" (mapcar 'downcase (s-split-words s))))
+
+(defun s-capitalized-words (s)
+ "Convert S to Capitalized words."
+ (declare (side-effect-free t))
+ (let ((words (s-split-words s)))
+ (s-join " " (cons (capitalize (car words)) (mapcar 'downcase (cdr words))))))
+
+(defun s-titleized-words (s)
+ "Convert S to Titleized Words."
+ (declare (side-effect-free t))
+ (s-join " " (mapcar 's-titleize (s-split-words s))))
+
+(defun s-word-initials (s)
+ "Convert S to its initials."
+ (declare (side-effect-free t))
+ (s-join "" (mapcar (lambda (ss) (substring ss 0 1))
+ (s-split-words s))))
+
+;; Errors for s-format
+(progn
+ (put 's-format-resolve
+ 'error-conditions
+ '(error s-format s-format-resolve))
+ (put 's-format-resolve
+ 'error-message
+ "Cannot resolve a template to values"))
+
+(defun s-format (template replacer &optional extra)
+ "Format TEMPLATE with the function REPLACER.
+
+REPLACER takes an argument of the format variable and optionally
+an extra argument which is the EXTRA value from the call to
+`s-format'.
+
+Several standard `s-format' helper functions are recognized and
+adapted for this:
+
+ (s-format \"${name}\" 'gethash hash-table)
+ (s-format \"${name}\" 'aget alist)
+ (s-format \"$0\" 'elt sequence)
+
+The REPLACER function may be used to do any other kind of
+transformation."
+ (let ((saved-match-data (match-data)))
+ (unwind-protect
+ (replace-regexp-in-string
+ "\\$\\({\\([^}]+\\)}\\|[0-9]+\\)"
+ (lambda (md)
+ (let ((var
+ (let ((m (match-string 2 md)))
+ (if m m
+ (string-to-number (match-string 1 md)))))
+ (replacer-match-data (match-data)))
+ (unwind-protect
+ (let ((v
+ (cond
+ ((eq replacer 'gethash)
+ (funcall replacer var extra))
+ ((eq replacer 'aget)
+ (funcall 's--aget extra var))
+ ((eq replacer 'elt)
+ (funcall replacer extra var))
+ ((eq replacer 'oref)
+ (funcall #'slot-value extra (intern var)))
+ (t
+ (set-match-data saved-match-data)
+ (if extra
+ (funcall replacer var extra)
+ (funcall replacer var))))))
+ (if v (format "%s" v) (signal 's-format-resolve md)))
+ (set-match-data replacer-match-data))))
+ template
+ ;; Need literal to make sure it works
+ t t)
+ (set-match-data saved-match-data))))
+
+(defvar s-lex-value-as-lisp nil
+ "If `t' interpolate lisp values as lisp.
+
+`s-lex-format' inserts values with (format \"%S\").")
+
+(defun s-lex-fmt|expand (fmt)
+ "Expand FMT into lisp."
+ (declare (side-effect-free t))
+ (list 's-format fmt (quote 'aget)
+ (append '(list)
+ (mapcar
+ (lambda (matches)
+ (list
+ 'cons
+ (cadr matches)
+ `(format
+ (if s-lex-value-as-lisp "%S" "%s")
+ ,(intern (cadr matches)))))
+ (s-match-strings-all "${\\([^}]+\\)}" fmt)))))
+
+(defmacro s-lex-format (format-str)
+ "`s-format` with the current environment.
+
+FORMAT-STR may use the `s-format' variable reference to refer to
+any variable:
+
+ (let ((x 1))
+ (s-lex-format \"x is: ${x}\"))
+
+The values of the variables are interpolated with \"%s\" unless
+the variable `s-lex-value-as-lisp' is `t' and then they are
+interpolated with \"%S\"."
+ (declare (debug (form)))
+ (s-lex-fmt|expand format-str))
+
+(defun s-count-matches (regexp s &optional start end)
+ "Count occurrences of `regexp' in `s'.
+
+`start', inclusive, and `end', exclusive, delimit the part of `s' to
+match. `start' and `end' are both indexed starting at 1; the initial
+character in `s' is index 1.
+
+This function starts looking for the next match from the end of the
+previous match. Hence, it ignores matches that overlap a previously
+found match. To count overlapping matches, use
+`s-count-matches-all'."
+ (declare (side-effect-free t))
+ (save-match-data
+ (with-temp-buffer
+ (insert s)
+ (goto-char (point-min))
+ (count-matches regexp (or start 1) (or end (point-max))))))
+
+(defun s-count-matches-all (regexp s &optional start end)
+ "Count occurrences of `regexp' in `s'.
+
+`start', inclusive, and `end', exclusive, delimit the part of `s' to
+match. `start' and `end' are both indexed starting at 1; the initial
+character in `s' is index 1.
+
+This function starts looking for the next match from the second
+character of the previous match. Hence, it counts matches that
+overlap a previously found match. To ignore matches that overlap a
+previously found match, use `s-count-matches'."
+ (declare (side-effect-free t))
+ (let* ((anchored-regexp (format "^%s" regexp))
+ (match-count 0)
+ (i 0)
+ (narrowed-s (substring s
+ (when start (1- start))
+ (when end (1- end)))))
+ (save-match-data
+ (while (< i (length narrowed-s))
+ (when (s-matches? anchored-regexp (substring narrowed-s i))
+ (setq match-count (1+ match-count)))
+ (setq i (1+ i))))
+ match-count))
+
+(defun s-wrap (s prefix &optional suffix)
+ "Wrap string S with PREFIX and optionally SUFFIX.
+
+Return string S with PREFIX prepended. If SUFFIX is present, it
+is appended, otherwise PREFIX is used as both prefix and
+suffix."
+ (declare (pure t) (side-effect-free t))
+ (concat prefix s (or suffix prefix)))
+
+
+;;; Aliases
+
+(defalias 's-blank-p 's-blank?)
+(defalias 's-blank-str-p 's-blank-str?)
+(defalias 's-capitalized-p 's-capitalized?)
+(defalias 's-contains-p 's-contains?)
+(defalias 's-ends-with-p 's-ends-with?)
+(defalias 's-equals-p 's-equals?)
+(defalias 's-less-p 's-less?)
+(defalias 's-lowercase-p 's-lowercase?)
+(defalias 's-matches-p 's-matches?)
+(defalias 's-mixedcase-p 's-mixedcase?)
+(defalias 's-numeric-p 's-numeric?)
+(defalias 's-prefix-p 's-starts-with?)
+(defalias 's-prefix? 's-starts-with?)
+(defalias 's-present-p 's-present?)
+(defalias 's-starts-with-p 's-starts-with?)
+(defalias 's-suffix-p 's-ends-with?)
+(defalias 's-suffix? 's-ends-with?)
+(defalias 's-uppercase-p 's-uppercase?)
+
+
+(provide 's)
+;;; s.el ends here
diff --git a/elpa/s-20210616.619/s.elc b/elpa/s-20210616.619/s.elc
new file mode 100644
index 0000000..ed8fa9d
--- /dev/null
+++ b/elpa/s-20210616.619/s.elc
Binary files differ
diff --git a/elpa/simple-httpd-20191103.1446/simple-httpd-autoloads.el b/elpa/simple-httpd-20191103.1446/simple-httpd-autoloads.el
new file mode 100644
index 0000000..e545936
--- /dev/null
+++ b/elpa/simple-httpd-20191103.1446/simple-httpd-autoloads.el
@@ -0,0 +1,38 @@
+;;; simple-httpd-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*-
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "simple-httpd" "simple-httpd.el" (0 0 0 0))
+;;; Generated autoloads from simple-httpd.el
+
+(autoload 'httpd-start "simple-httpd" "\
+Start the web server process. If the server is already
+running, this will restart the server. There is only one server
+instance per Emacs instance." t nil)
+
+(autoload 'httpd-stop "simple-httpd" "\
+Stop the web server if it is currently running, otherwise do nothing." t nil)
+
+(autoload 'httpd-running-p "simple-httpd" "\
+Return non-nil if the simple-httpd server is running." nil nil)
+
+(autoload 'httpd-serve-directory "simple-httpd" "\
+Start the web server with given `directory' as `httpd-root'.
+
+\(fn DIRECTORY)" t nil)
+
+(register-definition-prefixes "simple-httpd" '("defservlet" "httpd" "with-httpd-buffer"))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; simple-httpd-autoloads.el ends here
diff --git a/elpa/simple-httpd-20191103.1446/simple-httpd-pkg.el b/elpa/simple-httpd-20191103.1446/simple-httpd-pkg.el
new file mode 100644
index 0000000..ed8ad78
--- /dev/null
+++ b/elpa/simple-httpd-20191103.1446/simple-httpd-pkg.el
@@ -0,0 +1,2 @@
+;;; Generated package description from simple-httpd.el -*- no-byte-compile: t -*-
+(define-package "simple-httpd" "20191103.1446" "pure elisp HTTP server" '((cl-lib "0.3")) :commit "22ce66ea43e0eadb9ec1d691a35d9695fc29cee6" :authors '(("Christopher Wellons" . "wellons@nullprogram.com")) :maintainer '("Christopher Wellons" . "wellons@nullprogram.com") :url "https://github.com/skeeto/emacs-http-server")
diff --git a/elpa/simple-httpd-20191103.1446/simple-httpd.el b/elpa/simple-httpd-20191103.1446/simple-httpd.el
new file mode 100644
index 0000000..fcdc33f
--- /dev/null
+++ b/elpa/simple-httpd-20191103.1446/simple-httpd.el
@@ -0,0 +1,904 @@
+;;; simple-httpd.el --- pure elisp HTTP server
+
+;; This is free and unencumbered software released into the public domain.
+
+;; Author: Christopher Wellons <wellons@nullprogram.com>
+;; URL: https://github.com/skeeto/emacs-http-server
+;; Package-Version: 20191103.1446
+;; Package-Commit: 22ce66ea43e0eadb9ec1d691a35d9695fc29cee6
+;; Version: 1.5.1
+;; Package-Requires: ((cl-lib "0.3"))
+
+;;; Commentary:
+
+;; Use `httpd-start' to start the web server. Files are served from
+;; `httpd-root' on port `httpd-port' using `httpd-ip-family' at host
+;; `httpd-host'. While the root can be changed at any time, the server
+;; needs to be restarted in order for a port change to take effect.
+
+;; Everything is performed by servlets, including serving
+;; files. Servlets are enabled by setting `httpd-servlets' to true
+;; (default). Servlets are four-parameter functions that begin with
+;; "httpd/" where the trailing component specifies the initial path on
+;; the server. For example, the function `httpd/hello-world' will be
+;; called for the request "/hello-world" and "/hello-world/foo".
+
+;; The default servlet `httpd/' is the one that serves files from
+;; `httpd-root' and can be turned off through redefinition or setting
+;; `httpd-serve-files' to nil. It is used even when `httpd-servlets'
+;; is nil.
+
+;; The four parameters for a servlet are process, URI path, GET/POST
+;; arguments (alist), and the full request object (header
+;; alist). These are ordered by general importance so that some can be
+;; ignored. Two macros are provided to help with writing servlets.
+
+;; * `with-httpd-buffer' -- Creates a temporary buffer that is
+;; automatically served to the client at the end of the body.
+;; Additionally, `standard-output' is set to this output
+;; buffer. For example, this servlet says hello,
+
+;; (defun httpd/hello-world (proc path &rest args)
+;; (with-httpd-buffer proc "text/plain"
+;; (insert "hello, " (file-name-nondirectory path))))
+
+;; This servlet be viewed at http://localhost:8080/hello-world/Emacs
+
+;; * `defservlet' -- Similar to the above macro but totally hides the
+;; process object from the servlet itself. The above servlet can be
+;; re-written identically like so,
+
+;; (defservlet hello-world text/plain (path)
+;; (insert "hello, " (file-name-nondirectory path)))
+
+;; Note that `defservlet' automatically sets `httpd-current-proc'. See
+;; below.
+
+;; The "function parameters" part can be left empty or contain up to
+;; three parameters corresponding to the final three servlet
+;; parameters. For example, a servlet that shows *scratch* and doesn't
+;; need parameters,
+
+;; (defservlet scratch text/plain ()
+;; (insert-buffer-substring (get-buffer-create "*scratch*")))
+
+;; A higher level macro `defservlet*' wraps this lower-level
+;; `defservlet' macro, automatically binding variables to components
+;; of the request. For example, this binds parts of the request path
+;; and one query parameter. Request components not provided by the
+;; client are bound to nil.
+
+;; (defservlet* packages/:package/:version text/plain (verbose)
+;; (insert (format "%s\n%s\n" package version))
+;; (princ (get-description package version))
+;; (when verbose
+;; (insert (format "%S" (get-dependencies package version)))))
+
+;; It would be accessed like so,
+
+;; http://example.com/packages/foobar/1.0?verbose=1
+
+;; Some support functions are available for servlets for more
+;; customized responses.
+
+;; * `httpd-send-file' -- serve a file with proper caching
+;; * `httpd-redirect' -- redirect the browser to another url
+;; * `httpd-send-header' -- send custom headers
+;; * `httpd-error' -- report an error to the client
+;; * `httpd-log' -- log an object to *httpd*
+
+;; Some of these functions require a process object, which isn't
+;; passed to `defservlet' servlets. Use t in place of the process
+;; argument to use `httpd-current-proc' (like `standard-output').
+
+;; If you just need to serve static from some location under some
+;; route on the server, use `httpd-def-file-servlet'. It expands into
+;; a `defservlet' that serves files.
+
+;;; History:
+
+;; Version 1.5.1: improvements
+;; * Add `httpd-running-p'
+;; * Properly handle "Connection: close" and HTTP/1.0
+;; Version 1.5.0: improvements
+;; * Drastically improved performance for large requests
+;; * More HTTP status codes
+;; Version 1.4.6: fixes
+;; * Added httpd-serve-directory
+;; * Fix some encoding issues
+;; Version 1.4.5: fixes
+;; * Update to cl-lib from cl
+;; Version 1.4.4: features
+;; * Common Lisp &key-like defservlet* argument support
+;; * Fix up some defservlet* usage warnings.
+;; Version 1.4.3: features
+;; * Add `httpd-discard-buffer'
+;; * Add `httpd-def-file-servlet'
+;; * Be more careful about not sending extra headers
+;; Version 1.4.2: features, fixes
+;; * `defservlet*' macro
+;; Version 1.4.1: small bug fixes, one feature
+;; * All mime-type parameters now accept string designators
+;; * Documentation update
+;; Version 1.4.0: features, API change, and fixes
+;; * Removed httpd-send-buffer; httpd-send-header now does this implicitly
+;; * httpd-send-header now accepts keywords instead
+;; * Fix httpd-clean-path in Windows
+;; * Fix a content-length bug
+;; * defservlet fontification
+;; Version 1.3.1: features and fixes
+;; * Set `standard-output' in `with-httpd-buffer'
+;; Version 1.3.0: security fix
+;; * Fix path expansion security issue
+;; * Fix coding system (don't default)
+;; Version 1.2.4: fixes
+;; * Handle large POSTs
+;; * Fix date strings
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'pp)
+(require 'url-util)
+
+(defgroup simple-httpd nil
+ "A simple web server."
+ :group 'comm)
+
+(defcustom httpd-ip-family 'ipv4
+ "Web server IP family used by `make-network-process'."
+ :group 'simple-httpd
+ :type 'symbol)
+
+(defcustom httpd-host nil
+ "Web server host name used by `make-network-process'."
+ :group 'simple-httpd
+ :type '(choice (const nil) (const local) string))
+
+(defcustom httpd-port 8080
+ "Web server port."
+ :group 'simple-httpd
+ :type 'integer)
+
+(defcustom httpd-root "~/public_html"
+ "Web server file root."
+ :group 'simple-httpd
+ :type 'directory)
+
+(defcustom httpd-serve-files t
+ "Enable serving files from `httpd-root'."
+ :group 'simple-httpd
+ :type 'boolean)
+
+(defcustom httpd-listings t
+ "If true, serve directory listings."
+ :group 'simple-httpd
+ :type 'boolean)
+
+(defcustom httpd-servlets t
+ "Enable servlets."
+ :group 'simple-httpd
+ :type 'boolean)
+
+(defcustom httpd-show-backtrace-when-error nil
+ "If true, show backtrace on error page."
+ :group 'simple-httpd
+ :type 'boolean)
+
+(defcustom httpd-start-hook nil
+ "Hook to run when the server has started."
+ :group 'simple-httpd
+ :type 'hook)
+
+(defcustom httpd-stop-hook nil
+ "Hook to run when the server has stopped."
+ :group 'simple-httpd
+ :type 'hook)
+
+(defvar httpd-server-name (format "simple-httpd (Emacs %s)" emacs-version)
+ "String to use in the Server header.")
+
+(defvar httpd-mime-types
+ '(("png" . "image/png")
+ ("gif" . "image/gif")
+ ("jpg" . "image/jpeg")
+ ("jpeg" . "image/jpeg")
+ ("tif" . "image/tif")
+ ("tiff" . "image/tiff")
+ ("ico" . "image/x-icon")
+ ("svg" . "image/svg+xml")
+ ("css" . "text/css; charset=utf-8")
+ ("htm" . "text/html; charset=utf-8")
+ ("html" . "text/html; charset=utf-8")
+ ("xml" . "text/xml; charset=utf-8")
+ ("rss" . "text/xml; charset=utf-8")
+ ("atom" . "text/xml; charset=utf-8")
+ ("txt" . "text/plain; charset=utf-8")
+ ("el" . "text/plain; charset=utf-8")
+ ("js" . "text/javascript; charset=utf-8")
+ ("md" . "text/x-markdown; charset=utf-8")
+ ("gz" . "application/octet-stream")
+ ("ps" . "application/postscript")
+ ("eps" . "application/postscript")
+ ("pdf" . "application/pdf")
+ ("tar" . "application/x-tar")
+ ("zip" . "application/zip")
+ ("mp3" . "audio/mpeg")
+ ("wav" . "audio/x-wav")
+ ("flac" . "audio/flac")
+ ("spx" . "audio/ogg")
+ ("oga" . "audio/ogg")
+ ("ogg" . "audio/ogg")
+ ("ogv" . "video/ogg")
+ ("mp4" . "video/mp4")
+ ("mkv" . "video/x-matroska")
+ ("webm" . "video/webm"))
+ "MIME types for headers.")
+
+(defvar httpd-indexes
+ '("index.html"
+ "index.htm"
+ "index.xml")
+ "File served by default when accessing a directory.")
+
+(defvar httpd-status-codes
+ '((100 . "Continue")
+ (101 . "Switching Protocols")
+ (102 . "Processing")
+ (200 . "OK")
+ (201 . "Created")
+ (202 . "Accepted")
+ (203 . "Non-authoritative Information")
+ (204 . "No Content")
+ (205 . "Reset Content")
+ (206 . "Partial Content")
+ (207 . "Multi-Status")
+ (208 . "Already Reported")
+ (226 . "IM Used")
+ (300 . "Multiple Choices")
+ (301 . "Moved Permanently")
+ (302 . "Found")
+ (303 . "See Other")
+ (304 . "Not Modified")
+ (305 . "Use Proxy")
+ (307 . "Temporary Redirect")
+ (308 . "Permanent Redirect")
+ (400 . "Bad Request")
+ (401 . "Unauthorized")
+ (402 . "Payment Required")
+ (403 . "Forbidden")
+ (404 . "Not Found")
+ (405 . "Method Not Allowed")
+ (406 . "Not Acceptable")
+ (407 . "Proxy Authentication Required")
+ (408 . "Request Timeout")
+ (409 . "Conflict")
+ (410 . "Gone")
+ (411 . "Length Required")
+ (412 . "Precondition Failed")
+ (413 . "Payload Too Large")
+ (414 . "Request-URI Too Long")
+ (415 . "Unsupported Media Type")
+ (416 . "Requested Range Not Satisfiable")
+ (417 . "Expectation Failed")
+ (418 . "I'm a teapot")
+ (421 . "Misdirected Request")
+ (422 . "Unprocessable Entity")
+ (423 . "Locked")
+ (424 . "Failed Dependency")
+ (426 . "Upgrade Required")
+ (428 . "Precondition Required")
+ (429 . "Too Many Requests")
+ (431 . "Request Header Fields Too Large")
+ (444 . "Connection Closed Without Response")
+ (451 . "Unavailable For Legal Reasons")
+ (499 . "Client Closed Request")
+ (500 . "Internal Server Error")
+ (501 . "Not Implemented")
+ (502 . "Bad Gateway")
+ (503 . "Service Unavailable")
+ (504 . "Gateway Timeout")
+ (505 . "HTTP Version Not Supported")
+ (506 . "Variant Also Negotiates")
+ (507 . "Insufficient Storage")
+ (508 . "Loop Detected")
+ (510 . "Not Extended")
+ (511 . "Network Authentication Required")
+ (599 . "Network Connect Timeout Error"))
+ "HTTP status codes.")
+
+(defvar httpd-html
+ '((403 . "<!DOCTYPE html>
+<html><head>
+<title>403 Forbidden</title>
+</head><body>
+<h1>Forbidden</h1>
+<p>The requested URL is forbidden.</p>
+<pre>%s</pre>
+</body></html>")
+ (404 . "<!DOCTYPE html>
+<html><head>
+<title>404 Not Found</title>
+</head><body>
+<h1>Not Found</h1>
+<p>The requested URL was not found on this server.</p>
+<pre>%s</pre>
+</body></html>")
+ (500 . "<!DOCTYPE html>
+<html><head>
+<title>500 Internal Error</title>
+</head><body>
+<h1>500 Internal Error</h1>
+<p>Internal error when handling this request.</p>
+<pre>%s</pre>
+</body></html>"))
+ "HTML for various errors.")
+
+;; User interface
+
+;;;###autoload
+(defun httpd-start ()
+ "Start the web server process. If the server is already
+running, this will restart the server. There is only one server
+instance per Emacs instance."
+ (interactive)
+ (httpd-stop)
+ (httpd-log `(start ,(current-time-string)))
+ (make-network-process
+ :name "httpd"
+ :service httpd-port
+ :server t
+ :host httpd-host
+ :family httpd-ip-family
+ :filter 'httpd--filter
+ :coding 'binary
+ :log 'httpd--log)
+ (run-hooks 'httpd-start-hook))
+
+;;;###autoload
+(defun httpd-stop ()
+ "Stop the web server if it is currently running, otherwise do nothing."
+ (interactive)
+ (when (process-status "httpd")
+ (delete-process "httpd")
+ (httpd-log `(stop ,(current-time-string)))
+ (run-hooks 'httpd-stop-hook)))
+
+;;;###autoload
+(defun httpd-running-p ()
+ "Return non-nil if the simple-httpd server is running."
+ (not (null (process-status "httpd"))))
+
+;;;###autoload
+(defun httpd-serve-directory (directory)
+ "Start the web server with given `directory' as `httpd-root'."
+ (interactive "DServe directory: \n")
+ (setf httpd-root directory)
+ (httpd-start)
+ (message "Started simple-httpd on %s:%d, serving: %s"
+ (cl-case httpd-host
+ ((nil) "0.0.0.0")
+ ((local) "localhost")
+ (otherwise httpd-host)) httpd-port directory))
+
+(defun httpd-batch-start ()
+ "Never returns, holding the server open indefinitely for batch mode.
+Logs are redirected to stdout. To use, invoke Emacs like this:
+emacs -Q -batch -l simple-httpd.elc -f httpd-batch-start"
+ (if (not noninteractive)
+ (error "Only use `httpd-batch-start' in batch mode!")
+ (httpd-start)
+ (defalias 'httpd-log 'pp)
+ (while t (sleep-for 60))))
+
+;; Utility
+
+(defun httpd-date-string (&optional date)
+ "Return an HTTP date string (RFC 1123)."
+ (format-time-string "%a, %e %b %Y %T GMT" date t))
+
+(defun httpd-etag (file)
+ "Compute the ETag for FILE."
+ (concat "\"" (substring (sha1 (prin1-to-string (file-attributes file))) -16)
+ "\""))
+
+(defun httpd--stringify (designator)
+ "Turn a string designator into a string."
+ (let ((string (format "%s" designator)))
+ (if (keywordp designator)
+ (substring string 1)
+ string)))
+
+;; Networking code
+
+(defun httpd--connection-close-p (request)
+ "Return non-nil if the client requested \"connection: close\"."
+ (or (equal '("close") (cdr (assoc "Connection" request)))
+ (equal '("HTTP/1.0") (cddr (assoc "GET" request)))))
+
+(defun httpd--filter (proc chunk)
+ "Runs each time client makes a request."
+ (with-current-buffer (process-get proc :request-buffer)
+ (setf (point) (point-max))
+ (insert chunk)
+ (let ((request (process-get proc :request)))
+ (unless request
+ (when (setf request (httpd-parse))
+ (delete-region (point-min) (point))
+ (process-put proc :request request)))
+ (when request
+ (let ((content-length (cadr (assoc "Content-Length" request))))
+ (when (or (null content-length)
+ (= (buffer-size) (string-to-number content-length)))
+ (let* ((content (buffer-string))
+ (uri (cl-cadar request))
+ (parsed-uri (httpd-parse-uri (concat uri)))
+ (uri-path (httpd-unhex (nth 0 parsed-uri)))
+ (uri-query (append (nth 1 parsed-uri)
+ (httpd-parse-args content)))
+ (servlet (httpd-get-servlet uri-path)))
+ (erase-buffer)
+ (process-put proc :request nil)
+ (setf request (nreverse (cons (list "Content" content)
+ (nreverse request))))
+ (httpd-log `(request (date ,(httpd-date-string))
+ (address ,(car (process-contact proc)))
+ (get ,uri-path)
+ ,(cons 'headers request)))
+ (if (null servlet)
+ (httpd--error-safe proc 404)
+ (condition-case error-case
+ (funcall servlet proc uri-path uri-query request)
+ (error (httpd--error-safe proc 500 error-case))))
+ (when (httpd--connection-close-p request)
+ (process-send-eof proc)))))))))
+
+(defun httpd--log (server proc message)
+ "Runs each time a new client connects."
+ (with-current-buffer (generate-new-buffer " *httpd-client*")
+ (process-put proc :request-buffer (current-buffer)))
+ (set-process-sentinel proc #'httpd--sentinel)
+ (httpd-log (list 'connection (car (process-contact proc)))))
+
+(defun httpd--sentinel (proc message)
+ "Runs when a client closes the connection."
+ (unless (string-match-p "^open " message)
+ (let ((buffer (process-get proc :request-buffer)))
+ (when buffer
+ (kill-buffer buffer)))))
+
+;; Logging
+
+(defun httpd-log (item)
+ "Pretty print a lisp object to the log."
+ (with-current-buffer (get-buffer-create "*httpd*")
+ (setf buffer-read-only nil)
+ (let ((follow (= (point) (point-max))))
+ (save-excursion
+ (goto-char (point-max))
+ (pp item (current-buffer)))
+ (if follow (goto-char (point-max))))
+ (setf truncate-lines t
+ buffer-read-only t)
+ (set-buffer-modified-p nil)))
+
+;; Servlets
+
+(defvar httpd-current-proc nil
+ "The process object currently in use.")
+
+(defvar httpd--header-sent nil
+ "Buffer-local variable indicating if the header has been sent.")
+(make-variable-buffer-local 'httpd--header-sent)
+
+(defun httpd-resolve-proc (proc)
+ "Return the correct process to use. This handles `httpd-current-proc'."
+ (if (eq t proc) httpd-current-proc proc))
+
+(defmacro with-httpd-buffer (proc mime &rest body)
+ "Create a temporary buffer, set it as the current buffer, and,
+at the end of body, automatically serve it to an HTTP client with
+an HTTP header indicating the specified MIME type. Additionally,
+`standard-output' is set to this output buffer and
+`httpd-current-proc' is set to PROC."
+ (declare (indent defun))
+ (let ((proc-sym (make-symbol "--proc--")))
+ `(let ((,proc-sym ,proc))
+ (with-temp-buffer
+ (setf major-mode 'httpd-buffer)
+ (let ((standard-output (current-buffer))
+ (httpd-current-proc ,proc-sym))
+ ,@body)
+ (unless httpd--header-sent
+ (httpd-send-header ,proc-sym ,mime 200))))))
+
+(defun httpd-discard-buffer ()
+ "Don't respond using current server buffer (`with-httpd-buffer').
+Returns a process for future response."
+ (when (eq major-mode 'httpd-buffer) (setf httpd--header-sent t))
+ httpd-current-proc)
+
+(defmacro defservlet (name mime path-query-request &rest body)
+ "Defines a simple httpd servelet. The servlet runs in a
+temporary buffer which is automatically served to the client
+along with a header.
+
+A servlet that serves the contents of *scratch*,
+
+ (defservlet scratch text/plain ()
+ (insert-buffer-substring (get-buffer-create \"*scratch*\")))
+
+A servlet that says hello,
+
+ (defservlet hello-world text/plain (path)
+ (insert \"hello, \" (file-name-nondirectory path))))"
+ (declare (indent defun))
+ (let ((proc-sym (make-symbol "proc"))
+ (fname (intern (concat "httpd/" (symbol-name name)))))
+ `(defun ,fname (,proc-sym ,@path-query-request &rest ,(cl-gensym))
+ (with-httpd-buffer ,proc-sym ,(httpd--stringify mime)
+ ,@body))))
+
+(defun httpd-parse-endpoint (symbol)
+ "Parse an endpoint definition template for use with `defservlet*'."
+ (cl-loop for item in (split-string (symbol-name symbol) "/")
+ for n upfrom 0
+ when (and (> (length item) 0) (eql (aref item 0) ?:))
+ collect (cons (intern (substring item 1)) n) into vars
+ else collect item into path
+ finally
+ (cl-return
+ (cl-values (intern (mapconcat #'identity path "/")) vars))))
+
+(defvar httpd-path nil
+ "Anaphoric variable for `defservlet*'.")
+
+(defvar httpd-query nil
+ "Anaphoric variable for `defservlet*'.")
+
+(defvar httpd-request nil
+ "Anaphoric variable for `defservlet*'.")
+
+(defvar httpd-split-path nil
+ "Anaphoric variable for `defservlet*'.")
+
+(defmacro defservlet* (endpoint mime args &rest body)
+ "Like `defservlet', but automatically bind variables/arguments
+to the request. Trailing components of the ENDPOINT can be bound
+by prefixing these components with a colon, acting like a template.
+
+ (defservlet* packages/:package/:version text/plain (verbose)
+ (insert (format \"%s\\n%s\\n\" package version))
+ (princ (get-description package version))
+ (when verbose
+ (insert (format \"%S\" (get-dependencies package version)))))
+
+When accessed from this URL,
+
+ http://example.com/packages/foobar/1.0?verbose=1
+
+the variables package, version, and verbose will be bound to the
+associated components of the URL. Components not provided are
+bound to nil. The query arguments can use the Common Lisp &key
+form (variable default provided-p).
+
+ (defservlet* greeting/:name text/plain ((greeting \"hi\" greeting-p))
+ (princ (format \"%s, %s (provided: %s)\" greeting name greeting-p)))
+
+The original path, query, and request can be accessed by the
+anaphoric special variables `httpd-path', `httpd-query', and
+`httpd-request'."
+ (declare (indent defun))
+ (let ((path-lexical (cl-gensym))
+ (query-lexical (cl-gensym))
+ (request-lexical (cl-gensym)))
+ (cl-multiple-value-bind (path vars) (httpd-parse-endpoint endpoint)
+ `(defservlet ,path ,mime (,path-lexical ,query-lexical ,request-lexical)
+ (let ((httpd-path ,path-lexical)
+ (httpd-query ,query-lexical)
+ (httpd-request ,request-lexical)
+ (httpd-split-path (split-string
+ (substring ,path-lexical 1) "/")))
+ (let ,(cl-loop for (var . pos) in vars
+ for extract =
+ `(httpd-unhex (nth ,pos httpd-split-path))
+ collect (list var extract))
+ (let ,(cl-loop for arg in args
+ for has-default = (listp arg)
+ for has-default-p = (and has-default
+ (= 3 (length arg)))
+ for arg-name = (symbol-name
+ (if has-default (cl-first arg) arg))
+ when has-default collect
+ (list (cl-first arg)
+ `(let ((value (assoc ,arg-name httpd-query)))
+ (if value
+ (cl-second value)
+ ,(cl-second arg))))
+ else collect
+ (list arg `(cl-second
+ (assoc ,arg-name httpd-query)))
+ when has-default-p collect
+ (list (cl-third arg)
+ `(not (null (assoc ,arg-name httpd-query)))))
+ ,@body)))))))
+
+(font-lock-add-keywords
+ 'emacs-lisp-mode
+ '(("(\\<\\(defservlet\\*?\\)\\> +\\([^ ()]+\\) +\\([^ ()]+\\)"
+ (1 'font-lock-keyword-face)
+ (2 'font-lock-function-name-face)
+ (3 'font-lock-type-face))))
+
+(defmacro httpd-def-file-servlet (name root)
+ "Defines a servlet that serves files from ROOT under the route NAME.
+
+ (httpd-def-file-servlet my/www \"/var/www/\")
+
+Automatically handles redirects and uses `httpd-serve-root' to
+actually serve up files."
+ (let* ((short-root (directory-file-name (symbol-name name)))
+ (path-root (concat short-root "/"))
+ (chop (length path-root)))
+ `(defservlet ,name nil (uri-path query request)
+ (setf httpd--header-sent t) ; Don't actually use this temp buffer
+ (if (= (length uri-path) ,chop)
+ (httpd-redirect t ,path-root)
+ (let ((path (substring uri-path ,chop)))
+ (httpd-serve-root t ,root path request))))))
+
+;; Request parsing
+
+(defun httpd--normalize-header (header)
+ "Destructively capitalize the components of HEADER."
+ (mapconcat #'capitalize (split-string header "-") "-"))
+
+(defun httpd-parse ()
+ "Parse HTTP header in current buffer into association list.
+Leaves the point at the start of the request content. Returns nil
+if it failed to parse a complete HTTP header."
+ (setf (point) (point-min))
+ (when (looking-at "\\([^ ]+\\) +\\([^ ]+\\) +\\([^\r]+\\)\r\n")
+ (let ((method (match-string 1))
+ (path (decode-coding-string (match-string 2) 'iso-8859-1))
+ (version (match-string 3))
+ (headers ()))
+ (setf (point) (match-end 0))
+ (while (looking-at "\\([-!#-'*+.0-9A-Z^_`a-z|~]+\\): *\\([^\r]+\\)\r\n")
+ (setf (point) (match-end 0))
+ (let ((name (match-string 1))
+ (value (match-string 2)))
+ (push (list (httpd--normalize-header name)
+ (decode-coding-string value 'iso-8859-1)) headers)))
+ (when (looking-at "\r\n")
+ (setf (point) (match-end 0))
+ (cons (list method path version) (nreverse headers))))))
+
+(defun httpd-unhex (str)
+ "Fully decode the URL encoding in STR (including +'s)."
+ (when str
+ (let ((nonplussed (replace-regexp-in-string (regexp-quote "+") " " str)))
+ (decode-coding-string (url-unhex-string nonplussed t) 'utf-8))))
+
+(defun httpd-parse-args (argstr)
+ "Parse a string containing URL encoded arguments."
+ (unless (zerop (length argstr))
+ (mapcar (lambda (str)
+ (mapcar 'httpd-unhex (split-string str "=")))
+ (split-string argstr "&"))))
+
+(defun httpd-parse-uri (uri)
+ "Split a URI into its components.
+The first element of the return value is the script path, the
+second element is an alist of variable/value pairs, and the third
+element is the fragment."
+ (let ((p1 (string-match (regexp-quote "?") uri))
+ (p2 (string-match (regexp-quote "#") uri))
+ retval)
+ (push (if p2 (httpd-unhex (substring uri (1+ p2)))) retval)
+ (push (if p1 (httpd-parse-args (substring uri (1+ p1) p2))) retval)
+ (push (substring uri 0 (or p1 p2)) retval)))
+
+(defun httpd-escape-html-buffer ()
+ "Escape current buffer contents to be safe for inserting into HTML."
+ (setf (point) (point-min))
+ (while (search-forward-regexp "[<>&]" nil t)
+ (replace-match
+ (cl-case (aref (match-string 0) 0)
+ (?< "&lt;")
+ (?> "&gt;")
+ (?& "&amp;")))))
+
+(defun httpd-escape-html (string)
+ "Escape STRING so that it's safe to insert into an HTML document."
+ (with-temp-buffer
+ (insert string)
+ (httpd-escape-html-buffer)
+ (buffer-string)))
+
+;; Path handling
+
+(defun httpd-status (path)
+ "Determine status code for PATH."
+ (cond
+ ((not (file-exists-p path)) 404)
+ ((not (file-readable-p path)) 403)
+ ((and (file-directory-p path) (not httpd-listings)) 403)
+ (200)))
+
+(defun httpd-clean-path (path)
+ "Clean dangerous .. from PATH and remove the leading slash."
+ (let* ((sep (if (member system-type '(windows-nt ms-dos)) "[/\\]" "/"))
+ (split (delete ".." (split-string path sep)))
+ (unsplit (mapconcat 'identity (delete "" split) "/")))
+ (concat "./" unsplit)))
+
+(defun httpd-gen-path (path &optional root)
+ "Translate GET to secure path in ROOT (`httpd-root')."
+ (let ((clean (expand-file-name (httpd-clean-path path) (or root httpd-root))))
+ (if (file-directory-p clean)
+ (let* ((dir (file-name-as-directory clean))
+ (indexes (cl-mapcar (apply-partially 'concat dir) httpd-indexes))
+ (existing (cl-remove-if-not 'file-exists-p indexes)))
+ (or (car existing) dir))
+ clean)))
+
+(defun httpd-get-servlet (uri-path)
+ "Determine the servlet to be executed for URI-PATH."
+ (if (not httpd-servlets)
+ 'httpd/
+ (cl-labels ((cat (x)
+ (concat "httpd/" (mapconcat 'identity (reverse x) "/"))))
+ (let ((parts (cdr (split-string (directory-file-name uri-path) "/"))))
+ (or
+ (cl-find-if 'fboundp (mapcar 'intern-soft
+ (cl-maplist #'cat (reverse parts))))
+ 'httpd/)))))
+
+(defun httpd-serve-root (proc root uri-path &optional request)
+ "Securely serve a file from ROOT from under PATH."
+ (let* ((path (httpd-gen-path uri-path root))
+ (status (httpd-status path)))
+ (cond
+ ((not (= status 200)) (httpd-error proc status))
+ ((file-directory-p path) (httpd-send-directory proc path uri-path))
+ (t (httpd-send-file proc path request)))))
+
+(defun httpd/ (proc uri-path query request)
+ "Default root servlet which serves files when httpd-serve-files is T."
+ (if (and httpd-serve-files httpd-root)
+ (httpd-serve-root proc httpd-root uri-path request)
+ (httpd-error proc 403)))
+
+(defun httpd-get-mime (ext)
+ "Fetch MIME type given the file extention."
+ (or (and ext (cdr (assoc (downcase ext) httpd-mime-types)))
+ "application/octet-stream"))
+
+;; Data sending functions
+
+(defun httpd-send-header (proc mime status &rest header-keys)
+ "Send an HTTP header with given MIME type and STATUS, followed
+by the current buffer. If PROC is T use the `httpd-current-proc'
+as the process.
+
+Extra headers can be sent by supplying them like keywords, i.e.
+
+ (httpd-send-header t \"text/plain\" 200 :X-Powered-By \"simple-httpd\")"
+ (let ((status-str (cdr (assq status httpd-status-codes)))
+ (headers `(("Server" . ,httpd-server-name)
+ ("Date" . ,(httpd-date-string))
+ ("Connection" . "keep-alive")
+ ("Content-Type" . ,(httpd--stringify mime))
+ ("Content-Length" . ,(httpd--buffer-size)))))
+ (unless httpd--header-sent
+ (setf httpd--header-sent t)
+ (with-temp-buffer
+ (insert (format "HTTP/1.1 %d %s\r\n" status status-str))
+ (cl-loop for (header value) on header-keys by #'cddr
+ for header-name = (substring (symbol-name header) 1)
+ for value-name = (format "%s" value)
+ collect (cons header-name value-name) into extras
+ finally (setf headers (nconc headers extras)))
+ (dolist (header headers)
+ (insert (format "%s: %s\r\n" (car header) (cdr header))))
+ (insert "\r\n")
+ (process-send-region (httpd-resolve-proc proc)
+ (point-min) (point-max)))
+ (process-send-region (httpd-resolve-proc proc)
+ (point-min) (point-max)))))
+
+(defun httpd-redirect (proc path &optional code)
+ "Redirect the client to PATH (default 301). If PROC is T use
+the `httpd-current-proc' as the process."
+ (httpd-log (list 'redirect path))
+ (httpd-discard-buffer)
+ (with-temp-buffer
+ (httpd-send-header proc "text/plain" (or code 301) :Location path)))
+
+(defun httpd-send-file (proc path &optional req)
+ "Serve file to the given client. If PROC is T use the
+`httpd-current-proc' as the process."
+ (httpd-discard-buffer)
+ (let ((req-etag (cadr (assoc "If-None-Match" req)))
+ (etag (httpd-etag path))
+ (mtime (httpd-date-string (nth 4 (file-attributes path)))))
+ (if (equal req-etag etag)
+ (with-temp-buffer
+ (httpd-log `(file ,path not-modified))
+ (httpd-send-header proc "text/plain" 304))
+ (httpd-log `(file ,path))
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (insert-file-contents-literally path)
+ (httpd-send-header proc (httpd-get-mime (file-name-extension path))
+ 200 :Last-Modified mtime :ETag etag)))))
+
+(defun httpd-send-directory (proc path uri-path)
+ "Serve a file listing to the client. If PROC is T use the
+`httpd-current-proc' as the process."
+ (httpd-discard-buffer)
+ (let ((title (concat "Directory listing for "
+ (url-insert-entities-in-string uri-path))))
+ (if (equal "/" (substring uri-path -1))
+ (with-temp-buffer
+ (httpd-log `(directory ,path))
+ (insert "<!DOCTYPE html>\n")
+ (insert "<html>\n<head><title>" title "</title></head>\n")
+ (insert "<body>\n<h2>" title "</h2>\n<hr/>\n<ul>")
+ (dolist (file (directory-files path))
+ (unless (eq ?. (aref file 0))
+ (let* ((full (expand-file-name file path))
+ (tail (if (file-directory-p full) "/" ""))
+ (f (url-insert-entities-in-string file))
+ (l (url-hexify-string file)))
+ (insert (format "<li><a href=\"%s%s\">%s%s</a></li>\n"
+ l tail f tail)))))
+ (insert "</ul>\n<hr/>\n</body>\n</html>")
+ (httpd-send-header proc "text/html; charset=utf-8" 200))
+ (httpd-redirect proc (concat uri-path "/")))))
+
+(defun httpd--buffer-size (&optional buffer)
+ "Get the buffer size in bytes."
+ (let ((orig enable-multibyte-characters)
+ (size 0))
+ (with-current-buffer (or buffer (current-buffer))
+ (set-buffer-multibyte nil)
+ (setf size (buffer-size))
+ (if orig (set-buffer-multibyte orig)))
+ size))
+
+(defun httpd-error (proc status &optional info)
+ "Send an error page appropriate for STATUS to the client,
+optionally inserting object INFO into page. If PROC is T use the
+`httpd-current-proc' as the process."
+ (httpd-discard-buffer)
+ (httpd-log `(error ,status ,info))
+ (with-temp-buffer
+ (let ((html (or (cdr (assq status httpd-html)) ""))
+ (contents
+ (if (not info)
+ ""
+ (with-temp-buffer
+ (let ((standard-output (current-buffer)))
+ (insert "error: ")
+ (princ info)
+ (insert "\n")
+ (when httpd-show-backtrace-when-error
+ (insert "backtrace: ")
+ (princ (backtrace))
+ (insert "\n"))
+ (httpd-escape-html-buffer)
+ (buffer-string))))))
+ (insert (format html contents)))
+ (httpd-send-header proc "text/html" status)))
+
+(defun httpd--error-safe (&rest args)
+ "Call httpd-error and report failures to *httpd*."
+ (condition-case error-case
+ (apply #'httpd-error args)
+ (error (httpd-log `(hard-error ,error-case)))))
+
+(provide 'simple-httpd)
+
+;;; simple-httpd.el ends here
diff --git a/elpa/simple-httpd-20191103.1446/simple-httpd.elc b/elpa/simple-httpd-20191103.1446/simple-httpd.elc
new file mode 100644
index 0000000..94c7e04
--- /dev/null
+++ b/elpa/simple-httpd-20191103.1446/simple-httpd.elc
Binary files differ
diff --git a/elpa/skewer-mode-20200304.1142/cache-table.el b/elpa/skewer-mode-20200304.1142/cache-table.el
new file mode 100644
index 0000000..c3b2448
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/cache-table.el
@@ -0,0 +1,66 @@
+;;; cache-table.el --- a hash table with expiring entries -*- lexical-binding: t; -*-
+
+;; This is free and unencumbered software released into the public domain.
+
+;; Author: Christopher Wellons <mosquitopsu@gmail.com>
+;; Version: 1.0
+
+;;; Commentary:
+
+;; See the docstring of `cache-table-create'. There is no
+;; `cache-table-put': use `setf' on `cache-table-get' instead.
+
+;;; Code:
+
+(require 'cl-lib)
+
+(cl-defstruct (cache-table (:constructor cache-table--create))
+ "A cache table with expiring entries."
+ expire-time table)
+
+(defun cache-table-create (expire-time &rest keyword-args)
+ "Create a new cache-table with entries automatically removed
+from the table after EXPIRE-TIME seconds. This function accepts
+the same keyword arguments as `make-hash-table'. Entries are not
+actually removed from the cache-table until an access is made to
+the cache-table.
+
+Use `cache-table-get' to get and put (via setf) entries."
+ (cache-table--create :expire-time expire-time
+ :table (apply #'make-hash-table keyword-args)))
+
+(defun cache-table-clear-expired (cache-table)
+ "Remove all expired entries from CACHE-TABLE."
+ (cl-loop with expire-time = (cache-table-expire-time cache-table)
+ with table = (cache-table-table cache-table)
+ with dead-time = (- (float-time) expire-time)
+ for key being the hash-keys of table using (hash-value entry)
+ for (time . value) = entry
+ when (< time dead-time) do (remhash key table)))
+
+(defun cache-table-get (key cache-table &optional default)
+ "Access the value for KEY in CACHE-TABLE if it has not yet
+expired. Behaves just like `gethash'."
+ (cache-table-clear-expired cache-table)
+ (cdr (gethash key (cache-table-table cache-table) (cons 0 default))))
+
+(gv-define-setter cache-table-get (value key cache-table)
+ "Put an entry in the hash table, like (setf (gethash key table) value)."
+ `(progn
+ (cache-table-clear-expired ,cache-table)
+ (puthash ,key (cons (float-time) ,value)
+ (cache-table-table ,cache-table))))
+
+(defun cache-table-map (f cache-table)
+ "Like `maphash', call F for all non-expired entries in CACHE-TABLE."
+ (cache-table-clear-expired cache-table)
+ (maphash (lambda (k v) (funcall f k (cdr v)))
+ (cache-table-table cache-table)))
+
+(defun cache-table-count (cache-table)
+ "Like `hash-table-count', count the number of non-expired entries."
+ (hash-table-count (cache-table-table cache-table)))
+
+(provide 'cache-table)
+
+;;; cache-table.el ends here
diff --git a/elpa/skewer-mode-20200304.1142/cache-table.elc b/elpa/skewer-mode-20200304.1142/cache-table.elc
new file mode 100644
index 0000000..d83791e
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/cache-table.elc
Binary files differ
diff --git a/elpa/skewer-mode-20200304.1142/example.html b/elpa/skewer-mode-20200304.1142/example.html
new file mode 100644
index 0000000..a3e301a
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/example.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Skewer</title>
+ <script src="/skewer"></script>
+ </head>
+ <body>
+ </body>
+</html>
diff --git a/elpa/skewer-mode-20200304.1142/skewer-bower.el b/elpa/skewer-mode-20200304.1142/skewer-bower.el
new file mode 100644
index 0000000..69bfbe6
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-bower.el
@@ -0,0 +1,217 @@
+;;; skewer-bower.el --- dynamic library loading -*- lexical-binding: t; -*-
+
+;; This is free and unencumbered software released into the public domain.
+
+;;; Commentary:
+
+;; This package loads libraries into the current page using the bower
+;; infrastructure. Note: bower is not actually used by this package
+;; and so does *not* need to be installed. Only git is required (see
+;; `skewer-bower-git-executable'). It will try to learn how to run git
+;; from Magit if available.
+
+;; The interactive command for loading libraries is
+;; `skewer-bower-load'. It will prompt for a library and a version,
+;; automatically fetching it from the bower infrastructure if needed.
+;; For example, I often find it handy to load some version of jQuery
+;; when poking around at a page that doesn't already have it loaded.
+
+;; Caveat: unfortunately the bower infrastructure is a mess; many
+;; packages are in some sort of broken state -- missing dependencies,
+;; missing metadata, broken metadata, or an invalid repository URL.
+;; Some of this is due to under-specification of the metadata by the
+;; bower project. Broken packages are unlikely to be loadable by
+;; skewer-bower.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'skewer-mode)
+(require 'simple-httpd)
+(require 'magit nil t) ; optional
+
+(defcustom skewer-bower-cache-dir (locate-user-emacs-file "skewer-cache")
+ "Location of library cache (git repositories)."
+ :type 'string
+ :group 'skewer)
+
+(defcustom skewer-bower-endpoint "https://bower.herokuapp.com"
+ "Endpoint for accessing package information."
+ :type 'string
+ :group 'skewer)
+
+(defcustom skewer-bower-json '("bower.json" "package.json" "component.json")
+ "Files to search for package metadata."
+ :type 'list
+ :group 'skewer)
+
+; Try to match Magit's configuration if available
+(defcustom skewer-bower-git-executable "git"
+ "Name of the git executable."
+ :type 'string
+ :group 'skewer)
+
+(defvar skewer-bower-packages nil
+ "Alist of all packages known to bower.")
+
+(defvar skewer-bower-refreshed nil
+ "List of packages that have been refreshed recently. This keeps
+them from hitting the network frequently.")
+
+;;;###autoload
+(defun skewer-bower-refresh ()
+ "Update the package listing and packages synchronously."
+ (interactive)
+ (cl-declare (special url-http-end-of-headers))
+ (setf skewer-bower-refreshed nil)
+ (with-current-buffer
+ (url-retrieve-synchronously (concat skewer-bower-endpoint "/packages"))
+ (setf (point) url-http-end-of-headers)
+ (setf skewer-bower-packages
+ (cl-sort
+ (cl-loop for package across (json-read)
+ collect (cons (cdr (assoc 'name package))
+ (cdr (assoc 'url package))))
+ #'string< :key #'car))))
+
+;; Git functions
+
+(defun skewer-bower-cache (package)
+ "Return the cache repository directory for PACKAGE."
+ (unless (file-exists-p skewer-bower-cache-dir)
+ (make-directory skewer-bower-cache-dir t))
+ (expand-file-name package skewer-bower-cache-dir))
+
+(defun skewer-bower-git (package &rest args)
+ "Run git for PACKAGE's repository with ARGS."
+ (with-temp-buffer
+ (when (zerop (apply #'call-process skewer-bower-git-executable nil t nil
+ (format "--git-dir=%s" (skewer-bower-cache package))
+ args))
+ (buffer-string))))
+
+(defun skewer-bower-git-clone (url package)
+ "Clone or fetch PACKAGE's repository from URL if needed."
+ (if (member package skewer-bower-refreshed)
+ t
+ (let* ((cache (skewer-bower-cache package))
+ (status
+ (if (file-exists-p cache)
+ (when (skewer-bower-git package "fetch")
+ (push package skewer-bower-refreshed))
+ (skewer-bower-git package "clone" "--bare" url cache))))
+ (not (null status)))))
+
+(defun skewer-bower-git-show (package version file)
+ "Grab FILE from PACKAGE at version VERSION."
+ (when (string-match-p "^\\./" file) ; avoid relative paths
+ (setf file (substring file 2)))
+ (skewer-bower-git package "show" (format "%s:%s" version file)))
+
+(defun skewer-bower-git-tag (package)
+ "List all the tags in PACKAGE's repository."
+ (split-string (skewer-bower-git package "tag")))
+
+;; Bower functions
+
+(defun skewer-bower-package-ensure (package)
+ "Ensure a package is installed in the cache and up to date.
+Emit an error if the package could not be ensured."
+ (when (null skewer-bower-packages) (skewer-bower-refresh))
+ (let ((url (cdr (assoc package skewer-bower-packages))))
+ (when (null url)
+ (error "Unknown package: %s" package))
+ (when (null (skewer-bower-git-clone url package))
+ (error "Failed to fetch: %s" url))
+ t))
+
+(defun skewer-bower-package-versions (package)
+ "List the available versions for a package. Always returns at
+least one version."
+ (skewer-bower-package-ensure package)
+ (or (sort (skewer-bower-git-tag package) #'string<)
+ (list "master")))
+
+(defun skewer-bower-get-config (package &optional version)
+ "Get the configuration alist for PACKAGE at VERSION. Return nil
+if no configuration could be found."
+ (skewer-bower-package-ensure package)
+ (unless version (setf version "master"))
+ (json-read-from-string
+ (cl-loop for file in skewer-bower-json
+ for config = (skewer-bower-git-show package version file)
+ when config return it
+ finally (return "null"))))
+
+;; Serving the library
+
+(defvar skewer-bower-history ()
+ "Library selection history for `completing-read'.")
+
+(defun skewer-bowser--path (package version main)
+ "Return the simple-httpd hosted path for PACKAGE."
+ (format "/skewer/bower/%s/%s/%s" package (or version "master") main))
+
+(defun skewer-bower-prompt-package ()
+ "Prompt for a package and version from the user."
+ (when (null skewer-bower-packages) (skewer-bower-refresh))
+ ;; ido-completing-read bug workaround:
+ (when (> (length skewer-bower-history) 32)
+ (setf skewer-bower-history (cl-subseq skewer-bower-history 0 16)))
+ (let* ((packages (mapcar #'car skewer-bower-packages))
+ (selection (nconc skewer-bower-history packages))
+ (package (completing-read "Library: " selection nil t nil
+ 'skewer-bower-history))
+ (versions (reverse (skewer-bower-package-versions package)))
+ (version (completing-read "Version: " versions
+ nil t nil nil (car versions))))
+ (list package version)))
+
+(defun skewer-bower--js-p (filename)
+ "Return non-nil if FILENAME looks like JavaScript."
+ (string-match "\\.js$" filename))
+
+(defun skewer-bower-guess-main (package version config)
+ "Attempt to determine the main entrypoints from a potentially
+incomplete or incorrect bower configuration. Returns nil if
+guessing failed."
+ (let ((check (apply-partially #'skewer-bower-git-show package version))
+ (main (cdr (assoc 'main config))))
+ (cond ((and (vectorp main) (cl-some check main))
+ (cl-coerce (cl-remove-if-not #'skewer-bower--js-p main) 'list))
+ ((and (stringp main) (funcall check main))
+ (list main))
+ ((funcall check (concat package ".js"))
+ (list (concat package ".js")))
+ ((funcall check package)
+ (list package)))))
+
+;;;###autoload
+(defun skewer-bower-load (package &optional version)
+ "Dynamically load a library from bower into the current page."
+ (interactive (skewer-bower-prompt-package))
+ (let* ((config (skewer-bower-get-config package version))
+ (deps (cdr (assoc 'dependencies config)))
+ (main (skewer-bower-guess-main package version config)))
+ (when (null main)
+ (error "Could not load %s (%s): no \"main\" entrypoint specified"
+ package version))
+ (cl-loop for (dep . version) in deps
+ do (skewer-bower-load (format "%s" dep) version))
+ (cl-loop for entrypoint in main
+ for path = (skewer-bowser--path package version entrypoint)
+ do (skewer-eval path nil :type "script"))))
+
+(defservlet skewer/bower "application/javascript; charset=utf-8" (path)
+ "Serve a script from the local bower repository cache."
+ (cl-destructuring-bind (_ _skewer _bower package version . parts)
+ (split-string path "/")
+ (let* ((file (mapconcat #'identity parts "/"))
+ (contents (skewer-bower-git-show package version file)))
+ (if contents
+ (insert contents)
+ (httpd-error t 404)))))
+
+(provide 'skewer-bower)
+
+;;; skewer-bower.el ends here
diff --git a/elpa/skewer-mode-20200304.1142/skewer-bower.elc b/elpa/skewer-mode-20200304.1142/skewer-bower.elc
new file mode 100644
index 0000000..e85390c
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-bower.elc
Binary files differ
diff --git a/elpa/skewer-mode-20200304.1142/skewer-css.el b/elpa/skewer-mode-20200304.1142/skewer-css.el
new file mode 100644
index 0000000..457c742
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-css.el
@@ -0,0 +1,134 @@
+;;; skewer-css.el --- skewer support for live-interaction CSS -*- lexical-binding: t; -*-
+
+;; This is free and unencumbered software released into the public domain.
+
+;;; Commentary:
+
+;; This minor mode provides functionality for CSS like plain Skewer
+;; does for JavaScript.
+
+;; * C-x C-e -- `skewer-css-eval-current-declaration'
+;; * C-M-x -- `skewer-css-eval-current-rule'
+;; * C-c C-k -- `skewer-css-eval-buffer'
+
+;; These functions assume there are no comments within a CSS rule,
+;; *especially* not within a declaration. In the former case, if you
+;; keep the comment free of CSS syntax it should be able to manage
+;; reasonably well. This may be fixed someday.
+
+;;; Code:
+
+(require 'css-mode)
+(require 'skewer-mode)
+
+(defun skewer-css-trim (string)
+ "Trim and compress whitespace in the string."
+ (let ((cleaned (replace-regexp-in-string "[\t\n ]+" " " string)))
+ (replace-regexp-in-string "^[\t\n ]+\\|[\t\n ]+$" "" cleaned)))
+
+;; Parsing
+
+(defun skewer-css-beginning-of-rule ()
+ "Move to the beginning of the current rule and return point."
+ (skewer-css-end-of-rule)
+ (re-search-backward "{")
+ (when (re-search-backward "[}/]" nil 'start)
+ (forward-char))
+ (re-search-forward "[^ \t\n]")
+ (backward-char)
+ (point))
+
+(defun skewer-css-end-of-rule ()
+ "Move to the end of the current rule and return point."
+ (if (eql (char-before) ?})
+ (point)
+ (re-search-forward "}")))
+
+(defun skewer-css-end-of-declaration ()
+ "Move to the end of the current declaration and return point."
+ (if (eql (char-before) ?\;)
+ (point)
+ (re-search-forward ";")))
+
+(defun skewer-css-beginning-of-declaration ()
+ "Move to the end of the current declaration and return point."
+ (skewer-css-end-of-declaration)
+ (re-search-backward ":")
+ (backward-sexp 1)
+ (point))
+
+(defun skewer-css-selectors ()
+ "Return the selectors for the current rule."
+ (save-excursion
+ (let ((start (skewer-css-beginning-of-rule))
+ (end (1- (re-search-forward "{"))))
+ (skewer-css-trim
+ (buffer-substring-no-properties start end)))))
+
+(defun skewer-css-declaration ()
+ "Return the current declaration as a pair of strings."
+ (save-excursion
+ (let ((start (skewer-css-beginning-of-declaration))
+ (end (skewer-css-end-of-declaration)))
+ (let* ((clip (buffer-substring-no-properties start end))
+ (pair (split-string clip ":")))
+ (mapcar #'skewer-css-trim pair)))))
+
+;; Evaluation
+
+(defun skewer-css (rule)
+ "Add RULE as a new stylesheet."
+ (skewer-eval rule nil :type "css"))
+
+(defun skewer-css-eval-current-declaration ()
+ "Evaluate the declaration at the point."
+ (interactive)
+ (save-excursion
+ (let ((selectors (skewer-css-selectors))
+ (rule (skewer-css-declaration))
+ (start (skewer-css-beginning-of-declaration))
+ (end (skewer-css-end-of-declaration)))
+ (skewer-flash-region start end)
+ (skewer-css (apply #'format "%s { %s: %s }" selectors rule)))))
+
+(defun skewer-css-eval-current-rule ()
+ "Evaluate the rule at the point."
+ (interactive)
+ (save-excursion
+ (let* ((start (skewer-css-beginning-of-rule))
+ (end (skewer-css-end-of-rule))
+ (rule (buffer-substring-no-properties start end)))
+ (skewer-flash-region start end)
+ (skewer-css (skewer-css-trim rule)))))
+
+(defun skewer-css-eval-buffer ()
+ "Send the entire current buffer as a new stylesheet."
+ (interactive)
+ (skewer-css (buffer-substring-no-properties (point-min) (point-max))))
+
+(defun skewer-css-clear-all ()
+ "Remove *all* Skewer-added styles from the document."
+ (interactive)
+ (skewer-eval nil nil :type "cssClearAll"))
+
+;; Minor mode definition
+
+(defvar skewer-css-mode-map
+ (let ((map (make-sparse-keymap)))
+ (prog1 map
+ (define-key map (kbd "C-x C-e") 'skewer-css-eval-current-declaration)
+ (define-key map (kbd "C-M-x") 'skewer-css-eval-current-rule)
+ (define-key map (kbd "C-c C-k") 'skewer-css-eval-buffer)
+ (define-key map (kbd "C-c C-c") 'skewer-css-clear-all)))
+ "Keymap for skewer-css-mode.")
+
+;;;###autoload
+(define-minor-mode skewer-css-mode
+ "Minor mode for interactively loading new CSS rules."
+ :lighter " skewer-css"
+ :keymap skewer-css-mode-map
+ :group 'skewer)
+
+(provide 'skewer-css)
+
+;;; skewer-css.el ends here
diff --git a/elpa/skewer-mode-20200304.1142/skewer-css.elc b/elpa/skewer-mode-20200304.1142/skewer-css.elc
new file mode 100644
index 0000000..0026a9d
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-css.elc
Binary files differ
diff --git a/elpa/skewer-mode-20200304.1142/skewer-everything.user.js b/elpa/skewer-mode-20200304.1142/skewer-everything.user.js
new file mode 100644
index 0000000..4d22273
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-everything.user.js
@@ -0,0 +1,54 @@
+// ==UserScript==
+// @name Skewer Everything
+// @description Add a toggle button to run Skewer on the current page
+// @lastupdated 2015-09-14
+// @version 1.3
+// @license Public Domain
+// @include /^https?:///
+// @grant none
+// @run-at document-start
+// ==/UserScript==
+
+window.skewerNativeXHR = XMLHttpRequest;
+window.skewerInject = inject;
+
+var host = 'http://localhost:8080';
+
+var toggle = document.createElement('div');
+toggle.onclick = inject;
+toggle.style.width = '0px';
+toggle.style.height = '0px';
+toggle.style.borderStyle = 'solid';
+toggle.style.borderWidth = '0 12px 12px 0';
+toggle.style.borderColor = 'transparent #F00 transparent transparent';
+toggle.style.position = 'fixed';
+toggle.style.right = 0;
+toggle.style.top = 0;
+toggle.style.zIndex = 214748364;
+
+var injected = false;
+
+function inject() {
+ if (!injected) {
+ var script = document.createElement('script');
+ script.src = host + '/skewer';
+ document.body.appendChild(script);
+ toggle.style.borderRightColor = '#0F0';
+ } else {
+ /* break skewer to disable it */
+ skewer.fn = null;
+ toggle.style.borderRightColor = '#F00';
+ }
+ injected = !injected;
+ localStorage._autoskewered = JSON.stringify(injected);
+}
+
+document.addEventListener('DOMContentLoaded', function() {
+ /* Don't use on iframes. */
+ if (window.top === window.self) {
+ document.body.appendChild(toggle);
+ if (JSON.parse(localStorage._autoskewered || 'false')) {
+ inject();
+ }
+ }
+});
diff --git a/elpa/skewer-mode-20200304.1142/skewer-html.el b/elpa/skewer-mode-20200304.1142/skewer-html.el
new file mode 100644
index 0000000..b21de16
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-html.el
@@ -0,0 +1,165 @@
+;;; skewer-html.el --- skewer support for live-interaction HTML -*- lexical-binding: t; -*-
+
+;; This is free and unencumbered software released into the public domain.
+
+;;; Commentary:
+
+;; This minor mode provides functionality for HTML like plain Skewer
+;; does for JavaScript. There's no clean way to replace the body and
+;; head elements of a live document, so "evaluating" these elements is
+;; not supported.
+
+;; * C-M-x -- `skewer-html-eval-tag'
+
+;; See also `skewer-html-fetch-selector-into-buffer' for grabbing the
+;; page as it current exists.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'sgml-mode)
+(require 'skewer-mode)
+
+;; Macros
+
+(defmacro skewer-html--with-html-mode (&rest body)
+ "Evaluate BODY as if in `html-mode', using a temp buffer if necessary."
+ (declare (indent 0))
+ (let ((orig-buffer (make-symbol "orig-buffer"))
+ (temp-buffer (make-symbol "temp-buffer"))
+ (orig-point (make-symbol "orig-point")))
+ `(let ((,temp-buffer (and (not (eq major-mode 'html-mode))
+ (generate-new-buffer " *skewer-html*")))
+ (,orig-buffer (current-buffer))
+ (,orig-point (point)))
+ (unwind-protect
+ (with-current-buffer (or ,temp-buffer ,orig-buffer)
+ (when ,temp-buffer
+ (insert-buffer-substring ,orig-buffer)
+ (setf (point) ,orig-point)
+ (html-mode))
+ ,@body)
+ (when ,temp-buffer
+ (kill-buffer ,temp-buffer))))))
+
+;; Selector computation
+
+(defun skewer-html--cleanup (tag)
+ "Cleanup TAG name from sgml-mode."
+ (skewer-html--with-html-mode
+ (replace-regexp-in-string "/$" "" (sgml-tag-name tag))))
+
+(defun skewer-html--tag-after-point ()
+ "Return the tag struct for the tag immediately following point."
+ (skewer-html--with-html-mode
+ (save-excursion
+ (forward-char 1)
+ (sgml-parse-tag-backward))))
+
+(defun skewer-html--get-context ()
+ "Like `sgml-get-context' but to the root, skipping close tags."
+ (skewer-html--with-html-mode
+ (save-excursion
+ (cl-loop for context = (sgml-get-context)
+ while context
+ nconc (nreverse context) into tags
+ finally return (cl-delete 'close tags :key #'sgml-tag-type)))))
+
+(cl-defun skewer-html-compute-tag-nth (&optional (point (point)))
+ "Compute the position of this tag within its parent."
+ (skewer-html--with-html-mode
+ (save-excursion
+ (setf (point) point)
+ (let ((context (skewer-html--get-context)))
+ (when context
+ (let ((tag-name (skewer-html--cleanup (car context)))
+ (target-depth (1- (length context))))
+ (cl-loop with n = 0
+ ;; If point doesn't move, we're at the root.
+ for point-start = (point)
+ do (sgml-skip-tag-backward 1)
+ until (= (point) point-start)
+ ;; If depth changed, we're done.
+ for current-depth = (length (skewer-html--get-context))
+ until (< current-depth target-depth)
+ ;; Examine the sibling tag.
+ for current-name = (save-excursion
+ (forward-char)
+ (sgml-parse-tag-name))
+ when (equal current-name tag-name)
+ do (cl-incf n)
+ finally return n)))))))
+
+(defun skewer-html-compute-tag-ancestry ()
+ "Compute the ancestry chain at point."
+ (skewer-html--with-html-mode
+ (nreverse
+ (cl-loop for tag in (skewer-html--get-context)
+ for nth = (skewer-html-compute-tag-nth (1+ (sgml-tag-start tag)))
+ for name = (skewer-html--cleanup tag)
+ unless (equal name "html")
+ collect (list name nth)))))
+
+(defun skewer-html-compute-selector ()
+ "Compute the selector for exactly the tag around point."
+ (let ((ancestry (skewer-html-compute-tag-ancestry)))
+ (mapconcat (lambda (tag)
+ (format "%s:nth-of-type(%d)" (cl-first tag) (cl-second tag)))
+ ancestry " > ")))
+
+;; Fetching
+
+(defun skewer-html-fetch-selector (selector)
+ "Fetch the innerHTML of a selector."
+ (let ((result (skewer-eval-synchronously selector :type "fetchselector")))
+ (if (skewer-success-p result)
+ (cdr (assoc 'value result))
+ "")))
+
+(defun skewer-html-fetch-selector-into-buffer (selector)
+ "Fetch the innerHTML of a selector and insert it into the active buffer."
+ (interactive "sSelector: ")
+ (insert (skewer-html-fetch-selector selector)))
+
+;; Evaluation
+
+(defun skewer-html-eval (string ancestry &optional append)
+ "Load HTML into a selector, optionally appending."
+ (let ((ancestry* (cl-coerce ancestry 'vector))) ; for JSON
+ (skewer-eval string nil :type "html" :extra `((ancestry . ,ancestry*)
+ (append . ,append)))))
+
+(defun skewer-html-eval-tag ()
+ "Load HTML from the immediately surrounding tag."
+ (interactive)
+ (let ((ancestry (skewer-html-compute-tag-ancestry)))
+ (save-excursion
+ ;; Move to beginning of opening tag
+ (let* ((beg (skewer-html--with-html-mode
+ (sgml-skip-tag-forward 1) (point)))
+ (end (skewer-html--with-html-mode
+ (sgml-skip-tag-backward 1) (point)))
+ (region (buffer-substring-no-properties beg end)))
+ (skewer-flash-region beg end)
+ (if (= (length ancestry) 1)
+ (error "Error: cannot eval body and head tags.")
+ (skewer-html-eval region ancestry nil))))))
+
+;; Minor mode definition
+
+(defvar skewer-html-mode-map
+ (let ((map (make-sparse-keymap)))
+ (prog1 map
+ (define-key map (kbd "C-M-x") 'skewer-html-eval-tag)))
+ "Keymap for skewer-html-mode")
+
+;;;###autoload
+(define-minor-mode skewer-html-mode
+ "Minor mode for interactively loading new HTML."
+ :lighter " skewer-html"
+ :keymap skewer-html-mode-map
+ :group 'skewer)
+
+(provide 'skewer-html)
+
+;;; skewer-html.el ends here
diff --git a/elpa/skewer-mode-20200304.1142/skewer-html.elc b/elpa/skewer-mode-20200304.1142/skewer-html.elc
new file mode 100644
index 0000000..017178f
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-html.elc
Binary files differ
diff --git a/elpa/skewer-mode-20200304.1142/skewer-mode-autoloads.el b/elpa/skewer-mode-20200304.1142/skewer-mode-autoloads.el
new file mode 100644
index 0000000..f09afb8
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-mode-autoloads.el
@@ -0,0 +1,160 @@
+;;; skewer-mode-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*-
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "cache-table" "cache-table.el" (0 0 0 0))
+;;; Generated autoloads from cache-table.el
+
+(register-definition-prefixes "cache-table" '("cache-table-"))
+
+;;;***
+
+;;;### (autoloads nil "skewer-bower" "skewer-bower.el" (0 0 0 0))
+;;; Generated autoloads from skewer-bower.el
+
+(autoload 'skewer-bower-refresh "skewer-bower" "\
+Update the package listing and packages synchronously." t nil)
+
+(autoload 'skewer-bower-load "skewer-bower" "\
+Dynamically load a library from bower into the current page.
+
+\(fn PACKAGE &optional VERSION)" t nil)
+
+(register-definition-prefixes "skewer-bower" '("skewer"))
+
+;;;***
+
+;;;### (autoloads nil "skewer-css" "skewer-css.el" (0 0 0 0))
+;;; Generated autoloads from skewer-css.el
+
+(autoload 'skewer-css-mode "skewer-css" "\
+Minor mode for interactively loading new CSS rules.
+
+This is a minor mode. If called interactively, toggle the
+`skewer-css mode' mode. If the prefix argument is positive,
+enable the mode, and if it is zero or negative, disable the mode.
+
+If called from Lisp, toggle the mode if ARG is `toggle'. Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+To check whether the minor mode is enabled in the current buffer,
+evaluate `skewer-css-mode'.
+
+The mode's hook is called both when the mode is enabled and when
+it is disabled.
+
+\(fn &optional ARG)" t nil)
+
+(register-definition-prefixes "skewer-css" '("skewer-css"))
+
+;;;***
+
+;;;### (autoloads nil "skewer-html" "skewer-html.el" (0 0 0 0))
+;;; Generated autoloads from skewer-html.el
+
+(autoload 'skewer-html-mode "skewer-html" "\
+Minor mode for interactively loading new HTML.
+
+This is a minor mode. If called interactively, toggle the
+`skewer-html mode' mode. If the prefix argument is positive,
+enable the mode, and if it is zero or negative, disable the mode.
+
+If called from Lisp, toggle the mode if ARG is `toggle'. Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+To check whether the minor mode is enabled in the current buffer,
+evaluate `skewer-html-mode'.
+
+The mode's hook is called both when the mode is enabled and when
+it is disabled.
+
+\(fn &optional ARG)" t nil)
+
+(register-definition-prefixes "skewer-html" '("skewer-html-"))
+
+;;;***
+
+;;;### (autoloads nil "skewer-mode" "skewer-mode.el" (0 0 0 0))
+;;; Generated autoloads from skewer-mode.el
+
+(autoload 'list-skewer-clients "skewer-mode" "\
+List the attached browsers in a buffer." t nil)
+
+(autoload 'skewer-mode "skewer-mode" "\
+Minor mode for interacting with a browser.
+
+This is a minor mode. If called interactively, toggle the
+`skewer mode' mode. If the prefix argument is positive, enable
+the mode, and if it is zero or negative, disable the mode.
+
+If called from Lisp, toggle the mode if ARG is `toggle'. Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+To check whether the minor mode is enabled in the current buffer,
+evaluate `skewer-mode'.
+
+The mode's hook is called both when the mode is enabled and when
+it is disabled.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'run-skewer "skewer-mode" "\
+Attach a browser to Emacs for a skewer JavaScript REPL. Uses
+`browse-url' to launch a browser.
+
+With a prefix arugment (C-u), it will ask the filename of the
+root document. With two prefix arguments (C-u C-u), it will use
+the contents of the current buffer as the root document.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'skewer-run-phantomjs "skewer-mode" "\
+Connect an inferior PhantomJS process to Skewer, returning the process." t nil)
+
+(register-definition-prefixes "skewer-mode" '("httpd/skewer/" "phantomjs-program-name" "skewer"))
+
+;;;***
+
+;;;### (autoloads nil "skewer-repl" "skewer-repl.el" (0 0 0 0))
+;;; Generated autoloads from skewer-repl.el
+
+(autoload 'skewer-repl--response-hook "skewer-repl" "\
+Catches all browser messages logging some to the REPL.
+
+\(fn RESPONSE)" nil nil)
+
+(autoload 'skewer-repl "skewer-repl" "\
+Start a JavaScript REPL to be evaluated in the visiting browser." t nil)
+
+(eval-after-load 'skewer-mode '(progn (add-hook 'skewer-response-hook #'skewer-repl--response-hook) (add-hook 'skewer-repl-mode-hook #'skewer-repl-mode-compilation-shell-hook) (define-key skewer-mode-map (kbd "C-c C-z") #'skewer-repl)))
+
+(register-definition-prefixes "skewer-repl" '("company-skewer-repl" "skewer-"))
+
+;;;***
+
+;;;### (autoloads nil "skewer-setup" "skewer-setup.el" (0 0 0 0))
+;;; Generated autoloads from skewer-setup.el
+
+(autoload 'skewer-setup "skewer-setup" "\
+Fully integrate Skewer into js2-mode, css-mode, and html-mode buffers." nil nil)
+
+;;;***
+
+;;;### (autoloads nil nil ("skewer-mode-pkg.el") (0 0 0 0))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; skewer-mode-autoloads.el ends here
diff --git a/elpa/skewer-mode-20200304.1142/skewer-mode-pkg.el b/elpa/skewer-mode-20200304.1142/skewer-mode-pkg.el
new file mode 100644
index 0000000..ff0e79a
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-mode-pkg.el
@@ -0,0 +1,12 @@
+(define-package "skewer-mode" "20200304.1142" "live browser JavaScript, CSS, and HTML interaction"
+ '((simple-httpd "1.4.0")
+ (js2-mode "20090723")
+ (emacs "24"))
+ :commit "e5bed351939c92a1f788f78398583c2f83f1bb3c" :authors
+ '(("Christopher Wellons" . "wellons@nullprogram.com"))
+ :maintainer
+ '("Christopher Wellons" . "wellons@nullprogram.com")
+ :url "https://github.com/skeeto/skewer-mode")
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/elpa/skewer-mode-20200304.1142/skewer-mode.el b/elpa/skewer-mode-20200304.1142/skewer-mode.el
new file mode 100644
index 0000000..a439a9c
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-mode.el
@@ -0,0 +1,620 @@
+;;; skewer-mode.el --- live browser JavaScript, CSS, and HTML interaction -*- lexical-binding: t; -*-
+
+;; This is free and unencumbered software released into the public domain.
+
+;; Author: Christopher Wellons <wellons@nullprogram.com>
+;; URL: https://github.com/skeeto/skewer-mode
+
+;;; Commentary:
+
+;; Quick start (without package.el):
+
+;; 1. Put this directory in your `load-path'
+;; 2. Load skewer-mode.el
+;; 3. M-x `run-skewer' to attach a browser to Emacs
+;; 4. From a `js2-mode' buffer with `skewer-mode' minor mode enabled,
+;; send forms to the browser to evaluate
+
+;; The function `skewer-setup' can be used to configure all of mode
+;; hooks (previously this was the default). This can also be done
+;; manually like so,
+
+;; (add-hook 'js2-mode-hook 'skewer-mode)
+;; (add-hook 'css-mode-hook 'skewer-css-mode)
+;; (add-hook 'html-mode-hook 'skewer-html-mode)
+
+;; The keybindings for evaluating expressions in the browser are just
+;; like the Lisp modes. These are provided by the minor mode
+;; `skewer-mode'.
+
+;; * C-x C-e -- `skewer-eval-last-expression'
+;; * C-M-x -- `skewer-eval-defun'
+;; * C-c C-k -- `skewer-load-buffer'
+
+;; The result of the expression is echoed in the minibuffer.
+
+;; Additionally, `css-mode' and `html-mode' get a similar set of
+;; bindings for modifying the CSS rules and updating HTML on the
+;; current page.
+
+;; Note: `run-skewer' uses `browse-url' to launch the browser. This
+;; may require further setup depending on your operating system and
+;; personal preferences.
+
+;; Multiple browsers and browser tabs can be attached to Emacs at
+;; once. JavaScript forms are sent to all attached clients
+;; simultaneously, and each will echo back the result
+;; individually. Use `list-skewer-clients' to see a list of all
+;; currently attached clients.
+
+;; Sometimes Skewer's long polls from the browser will timeout after a
+;; number of hours of inactivity. If you find the browser disconnected
+;; from Emacs for any reason, use the browser's console to call
+;; skewer() to reconnect. This avoids a page reload, which would lose
+;; any fragile browser state you might care about.
+
+;; To skewer your own document rather than the provided blank page,
+
+;; 1. Load the dependencies
+;; 2. Load skewer-mode.el
+;; 3. Start the HTTP server (`httpd-start')
+;; 4. Include "http://localhost:8080/skewer" as a script
+;; (see `example.html' and check your `httpd-port')
+;; 5. Visit the document from your browser
+
+;; Skewer fully supports CORS, so the document need not be hosted by
+;; Emacs itself. A Greasemonkey userscript and a bookmarklet are
+;; provided for injecting Skewer into any arbitrary page you're
+;; visiting without needing to modify the page on the host.
+
+;; With skewer-repl.el loaded, a REPL into the browser can be created
+;; with M-x `skewer-repl', or C-c C-z. This should work like a console
+;; within the browser. Messages can be logged to this REPL with
+;; skewer.log() (just like console.log()).
+
+;; Extending Skewer:
+
+;; Skewer is flexible and open to extension. The REPL and the CSS and
+;; HTML minor modes are a partial examples of this. You can extend
+;; skewer.js with your own request handlers and talk to them from
+;; Emacs using `skewer-eval' (or `skewer-eval-synchronously') with
+;; your own custom :type. The :type string chooses the dispatch
+;; function under the skewer.fn object. To inject your own JavaScript
+;; into skewer.js, use `skewer-js-hook'.
+
+;; You can also catch messages sent from the browser not in response
+;; to an explicit request. Use `skewer-response-hook' to see all
+;; incoming objects.
+
+;;; History:
+
+;; Version 1.8.0: features
+;; * Work around XMLHttpRequest tampering in userscript
+;; * Add Makefile "run" target for testing
+;; Version 1.7.0: features and fixes
+;; * Support for other major modes (including web-mode) in skewer-html-mode
+;; * Opportunistic support for company-mode completions
+;; * Always serve content as UTF-8
+;; * Improve skewer-everything.js portability
+;; Version 1.6.2: fixes
+;; * skewer.log() takes multiple arguments
+;; * comint and encoding fixes
+;; Version 1.6.1: fixes
+;; * Add `skewer-css-clear-all'
+;; * Better IE8 compatibility
+;; * User interface tweaks
+;; Version 1.6.0: fixes
+;; * Bring up to speed with Emacs 24.3
+;; * Switch to cl-lib from cl
+;; Version 1.5.3: features
+;; * Add `skewer-run-phantomjs'
+;; Version 1.5.2: small cleanup
+;; * Add `skewer-apply' and `skewer-funall'
+;; * Improved safeStringify
+;; Version 1.5.1: features
+;; * No more automatic hook setup (see `skewer-setup')
+;; * Support for HTML interaction
+;; * Support for loading Bower packages
+;; * Drop jQuery dependency
+;; * Many small improvements
+;; Version 1.4: features
+;; * Full CSS interaction
+;; * Greasemonkey userscript for injection
+;; * Full, working CORS support
+;; * Better browser presence detection
+;; Version 1.3: features and fixes
+;; * Full offline support
+;; * No more callback registering
+;; * Fix 64-bit support
+;; * Two new hooks for improved extension support
+;; * More uniform keybindings with other interactive modes
+;; Version 1.2: features
+;; * Add a skewer-eval-print-last-expression
+;; * Display evaluation time when it's long
+;; * Flash the region on eval
+;; * Improve JS stringification
+;; Version 1.1: features and fixes
+;; * Added `list-skewer-clients'
+;; * Reduce the number of HTTP requests needed
+;; * Fix stringification issues
+;; Version 1.0: initial release
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'json)
+(require 'url-util)
+(require 'simple-httpd)
+(require 'js2-mode)
+(require 'cache-table)
+
+(defgroup skewer nil
+ "Live browser JavaScript interaction."
+ :group 'languages)
+
+(defvar skewer-mode-map
+ (let ((map (make-sparse-keymap)))
+ (prog1 map
+ (define-key map (kbd "C-x C-e") 'skewer-eval-last-expression)
+ (define-key map (kbd "C-M-x") 'skewer-eval-defun)
+ (define-key map (kbd "C-c C-k") 'skewer-load-buffer)))
+ "Keymap for skewer-mode.")
+
+(defvar skewer-data-root (file-name-directory load-file-name)
+ "Location of data files needed by impatient-mode.")
+
+(defvar skewer-js-hook ()
+ "Hook to run when skewer.js is being served to the browser.
+
+When hook functions are called, the current buffer is the buffer
+to be served to the client (a defservlet), with skewer.js script
+already inserted. This is the chance for other packages to insert
+their own JavaScript to extend skewer in the browser, such as
+adding a new type handler.")
+
+(defvar skewer-response-hook ()
+ "Hook to run when a response arrives from the browser. Used for
+catching messages from the browser with no associated
+callback. The response object is passed to the hook function.")
+
+(defvar skewer-timeout 3600
+ "Maximum time to wait on the browser to respond, in seconds.")
+
+(defvar skewer-clients ()
+ "Browsers awaiting JavaScript snippets.")
+
+(defvar skewer-callbacks (cache-table-create skewer-timeout :test 'equal)
+ "Maps evaluation IDs to local callbacks.")
+
+(defvar skewer-queue ()
+ "Queued messages for the browser.")
+
+(defvar skewer--last-timestamp 0
+ "Timestamp of the last browser response. Use
+`skewer-last-seen-seconds' to access this.")
+
+(cl-defstruct skewer-client
+ "A client connection awaiting a response."
+ proc agent)
+
+(defun skewer-process-queue ()
+ "Send all queued messages to clients."
+ (when (and skewer-queue skewer-clients)
+ (let ((message (pop skewer-queue))
+ (sent nil))
+ (while skewer-clients
+ (ignore-errors
+ (progn
+ (let ((proc (skewer-client-proc (pop skewer-clients))))
+ (with-temp-buffer
+ (insert (json-encode message))
+ (httpd-send-header proc "text/plain" 200
+ :Cache-Control "no-cache"
+ :Access-Control-Allow-Origin "*")))
+ (setq skewer--last-timestamp (float-time))
+ (setq sent t))))
+ (if (not sent) (push message skewer-queue)))
+ (skewer-process-queue)))
+
+(defun skewer-clients-tabulate ()
+ "Prepare client list for tabulated-list-mode."
+ (cl-loop for client in skewer-clients collect
+ (let ((proc (skewer-client-proc client))
+ (agent (skewer-client-agent client)))
+ (cl-destructuring-bind (host port) (process-contact proc)
+ `(,client [,host ,(format "%d" port) ,agent])))))
+
+(define-derived-mode skewer-clients-mode tabulated-list-mode "skewer-clients"
+ "Mode for listing browsers attached to Emacs for skewer-mode."
+ (setq tabulated-list-format [("Host" 12 t)
+ ("Port" 5 t)
+ ("User Agent" 0 t)])
+ (setq tabulated-list-entries #'skewer-clients-tabulate)
+ (tabulated-list-init-header))
+
+(define-key skewer-clients-mode-map (kbd "g")
+ (lambda ()
+ (interactive)
+ (skewer-ping)
+ (revert-buffer)))
+
+(defun skewer-update-list-buffer ()
+ "Revert the client list, due to an update."
+ (save-window-excursion
+ (let ((list-buffer (get-buffer "*skewer-clients*")))
+ (when list-buffer
+ (with-current-buffer list-buffer
+ (revert-buffer))))))
+
+;;;###autoload
+(defun list-skewer-clients ()
+ "List the attached browsers in a buffer."
+ (interactive)
+ (pop-to-buffer (get-buffer-create "*skewer-clients*"))
+ (skewer-clients-mode)
+ (tabulated-list-print))
+
+(defun skewer-queue-client (proc req)
+ "Add a client to the queue, given the HTTP header."
+ (let ((agent (cl-second (assoc "User-Agent" req))))
+ (push (make-skewer-client :proc proc :agent agent) skewer-clients))
+ (skewer-update-list-buffer)
+ (skewer-process-queue))
+
+;; Servlets
+
+(defservlet skewer "text/javascript; charset=UTF-8" ()
+ (insert-file-contents (expand-file-name "skewer.js" skewer-data-root))
+ (goto-char (point-max))
+ (run-hooks 'skewer-js-hook))
+
+(defun httpd/skewer/get (proc _path _query req &rest _args)
+ (skewer-queue-client proc req))
+
+(defun httpd/skewer/post (proc _path _query req &rest _args)
+ (let* ((result (json-read-from-string (cadr (assoc "Content" req))))
+ (id (cdr (assoc 'id result)))
+ (callback (cache-table-get id skewer-callbacks)))
+ (setq skewer--last-timestamp (float-time))
+ (when callback
+ (funcall callback result))
+ (if id
+ (skewer-queue-client proc req)
+ (with-temp-buffer
+ (httpd-send-header proc "text/plain" 200
+ :Access-Control-Allow-Origin "*")))
+ (dolist (hook skewer-response-hook)
+ (funcall hook result))))
+
+(defvar skewer-demo-source
+ (expand-file-name "example.html" skewer-data-root)
+ "Source file name or buffer for `httpd/skewer/demo' servlet.")
+
+(defservlet skewer/demo "text/html; charset=UTF-8" ()
+ (cl-etypecase skewer-demo-source
+ (buffer (insert-buffer-substring skewer-demo-source))
+ (string (insert-file-contents skewer-demo-source))))
+
+;; Minibuffer display
+
+(defun skewer-success-p (result)
+ "Return T if result was a success."
+ (equal "success" (cdr (assoc 'status result))))
+
+(define-derived-mode skewer-error-mode special-mode "skewer-error"
+ :group 'skewer
+ "Mode for displaying JavaScript errors returned by skewer-mode."
+ (setq truncate-lines t))
+
+(defface skewer-error-face
+ '((((class color) (background light))
+ :foreground "red" :underline t)
+ (((class color) (background dark))
+ :foreground "red" :underline t))
+ "Face for JavaScript errors."
+ :group 'skewer)
+
+(defun skewer--error (string)
+ "Return STRING propertized as an error message."
+ (propertize (or string "<unknown>") 'font-lock-face 'skewer-error-face))
+
+(defun skewer-post-minibuffer (result)
+ "Report results in the minibuffer or the error buffer."
+ (if (skewer-success-p result)
+ (let ((value (cdr (assoc 'value result)))
+ (time (cdr (assoc 'time result))))
+ (if (and time (> time 1.0))
+ (message "%s (%.3f seconds)" value time)
+ (message "%s" value)))
+ (with-current-buffer (pop-to-buffer (get-buffer-create "*skewer-error*"))
+ (let ((inhibit-read-only t)
+ (error (cdr (assoc 'error result))))
+ (erase-buffer)
+ (skewer-error-mode)
+ (insert (skewer--error (cdr (assoc 'name error))) ": ")
+ (insert (or (cdr (assoc 'message error)) "") "\n\n")
+ (insert (or (cdr (assoc 'stack error)) "") "\n\n")
+ (insert (format "Expression: %s\n\n"
+ (if (cdr (assoc 'strict result)) "(strict)" ""))
+ (cdr (assoc 'eval error)))
+ (goto-char (point-min))))))
+
+;; Evaluation functions
+
+(cl-defun skewer-eval (string &optional callback
+ &key verbose strict (type "eval") extra)
+ "Evaluate STRING in the waiting browsers, giving the result to CALLBACK.
+
+:VERBOSE -- if T, the return will try to be JSON encoded
+:STRICT -- if T, expression is evaluated with 'use strict'
+:TYPE -- chooses the JavaScript handler (default: eval)
+:EXTRA -- additional alist keys to append to the request object"
+ (let* ((id (format "%x" (random most-positive-fixnum)))
+ (request `((type . ,type)
+ (eval . ,string)
+ (id . ,id)
+ (verbose . ,verbose)
+ (strict . ,strict)
+ ,@extra)))
+ (prog1 request
+ (setf (cache-table-get id skewer-callbacks) callback)
+ (setq skewer-queue (append skewer-queue (list request)))
+ (skewer-process-queue))))
+
+(defun skewer-eval-synchronously (string &rest args)
+ "Just like `skewer-eval' but synchronously, so don't provide a
+callback. Use with caution."
+ (let ((result nil))
+ (apply #'skewer-eval string (lambda (v) (setq result v)) args)
+ (cl-loop until result
+ do (accept-process-output nil 0.01)
+ finally (return result))))
+
+(defun skewer-apply (function args)
+ "Synchronously apply FUNCTION in the browser with the supplied
+arguments, returning the result. All ARGS must be printable by
+`json-encode'. For example,
+
+ (skewer-apply \"Math.atan2\" '(1 -2)) ; => 2.677945044588987
+
+Uncaught exceptions propagate to Emacs as an error."
+ (let ((specials '(("undefined" . nil)
+ ("NaN" . 0.0e+NaN)
+ ("Infinity" . 1.0e+INF)
+ ("-Infinity" . -1.0e+INF))))
+ (let* ((expr (concat function "(" (mapconcat #'json-encode args ", ") ")"))
+ (result (skewer-eval-synchronously expr :verbose t))
+ (value (cdr (assoc 'value result))))
+ (if (skewer-success-p result)
+ (if (assoc value specials)
+ (cdr (assoc value specials))
+ (condition-case _
+ (json-read-from-string value)
+ (json-readtable-error value)))
+ (signal 'javascript
+ (list (cdr (assoc 'message (cdr (assoc'error result))))))))))
+
+(defun skewer-funcall (function &rest args)
+ "Synchronously call FUNCTION with the supplied ARGS. All ARGS
+must be printable by `json-read-from-string. For example,
+
+ (skewer-funcall \"Math.sin\" 0.5) ; => 0.479425538604203
+
+Uncaught exceptions propagate to Emacs as an error."
+ (skewer-apply function args))
+
+(defun skewer--save-point (f &rest args)
+ "Return a function that calls F with point at the current point."
+ (let ((saved-point (point)))
+ (lambda (&rest more)
+ (save-excursion
+ (goto-char saved-point)
+ (apply f (append args more))))))
+
+(defun skewer-ping ()
+ "Ping the browser to test that it's still alive."
+ (unless (null skewer-clients) ; don't queue pings
+ (skewer-eval (prin1-to-string (float-time)) nil :type "ping")))
+
+(defun skewer-last-seen-seconds ()
+ "Return the number of seconds since the browser was last seen."
+ (skewer-ping) ; make sure it's still alive next request
+ (- (float-time) skewer--last-timestamp))
+
+(defun skewer-mode-strict-p ()
+ "Return T if buffer contents indicates strict mode."
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (js2-forward-sws)
+ (forward-char 1)
+ (let* ((stricts '("\"use strict\"" "'use strict'"))
+ (node (js2-node-at-point))
+ (code (buffer-substring-no-properties (js2-node-abs-pos node)
+ (js2-node-abs-end node))))
+ (and (member code stricts) t)))))
+
+(defun skewer-flash-region (start end &optional timeout)
+ "Temporarily highlight region from START to END."
+ (let ((overlay (make-overlay start end)))
+ (overlay-put overlay 'face 'secondary-selection)
+ (run-with-timer (or timeout 0.2) nil 'delete-overlay overlay)))
+
+(defun skewer-get-last-expression ()
+ "Return the JavaScript expression before the point as a
+list: (string start end)."
+ (save-excursion
+ (js2-backward-sws)
+ (backward-char)
+ (let ((node (js2-node-at-point nil t)))
+ (when (eq js2-FUNCTION (js2-node-type (js2-node-parent node)))
+ (setq node (js2-node-parent node)))
+ (when (js2-ast-root-p node)
+ (error "no expression found"))
+ (let ((start (js2-node-abs-pos node))
+ (end (js2-node-abs-end node)))
+ (list (buffer-substring-no-properties start end) start end)))))
+
+(defun skewer-eval-last-expression (&optional prefix)
+ "Evaluate the JavaScript expression before the point in the
+waiting browser. If invoked with a prefix argument, insert the
+result into the current buffer."
+ (interactive "P")
+ (if prefix
+ (skewer-eval-print-last-expression)
+ (if js2-mode-buffer-dirty-p
+ (js2-mode-wait-for-parse
+ (skewer--save-point #'skewer-eval-last-expression))
+ (cl-destructuring-bind (string start end) (skewer-get-last-expression)
+ (skewer-flash-region start end)
+ (skewer-eval string #'skewer-post-minibuffer)))))
+
+(defun skewer-get-defun ()
+ "Return the toplevel JavaScript expression around the point as
+a list: (string start end)."
+ (save-excursion
+ (js2-backward-sws)
+ (backward-char)
+ (let ((node (js2-node-at-point nil t)))
+ (when (js2-ast-root-p node)
+ (error "no expression found"))
+ (while (and (js2-node-parent node)
+ (not (js2-ast-root-p (js2-node-parent node))))
+ (setf node (js2-node-parent node)))
+ (let ((start (js2-node-abs-pos node))
+ (end (js2-node-abs-end node)))
+ (list (buffer-substring-no-properties start end) start end)))))
+
+(defun skewer-eval-defun ()
+ "Evaluate the JavaScript expression before the point in the
+waiting browser."
+ (interactive)
+ (if js2-mode-buffer-dirty-p
+ (js2-mode-wait-for-parse (skewer--save-point #'skewer-eval-defun))
+ (cl-destructuring-bind (string start end) (skewer-get-defun)
+ (skewer-flash-region start end)
+ (skewer-eval string #'skewer-post-minibuffer))))
+
+;; Print last expression
+
+(defvar skewer-eval-print-map (cache-table-create skewer-timeout :test 'equal)
+ "A mapping of evaluation IDs to insertion points.")
+
+(defun skewer-post-print (result)
+ "Insert the result after its source expression."
+ (if (not (skewer-success-p result))
+ (skewer-post-minibuffer result)
+ (let* ((id (cdr (assoc 'id result)))
+ (pos (cache-table-get id skewer-eval-print-map)))
+ (when pos
+ (with-current-buffer (car pos)
+ (goto-char (cdr pos))
+ (insert (cdr (assoc 'value result)) "\n"))))))
+
+(defun skewer-eval-print-last-expression ()
+ "Evaluate the JavaScript expression before the point in the
+waiting browser and insert the result in the buffer at point."
+ (interactive)
+ (if js2-mode-buffer-dirty-p
+ (js2-mode-wait-for-parse
+ (skewer--save-point #'skewer-eval-print-last-expression))
+ (cl-destructuring-bind (string start end) (skewer-get-defun)
+ (skewer-flash-region start end)
+ (insert "\n")
+ (let* ((request (skewer-eval string #'skewer-post-print :verbose t))
+ (id (cdr (assoc 'id request)))
+ (pos (cons (current-buffer) (point))))
+ (setf (cache-table-get id skewer-eval-print-map) pos)))))
+
+;; Script loading
+
+(defvar skewer-hosted-scripts (cache-table-create skewer-timeout)
+ "Map of hosted scripts to IDs.")
+
+(defun skewer-host-script (string)
+ "Host script STRING from the script servlet, returning the script ID."
+ (let ((id (random most-positive-fixnum)))
+ (prog1 id
+ (setf (cache-table-get id skewer-hosted-scripts) string))))
+
+(defun skewer-load-buffer ()
+ "Load the entire current buffer into the browser. A snapshot of
+the buffer is hosted so that browsers visiting late won't see an
+inconsistent buffer."
+ (interactive)
+ (let ((id (skewer-host-script (buffer-string)))
+ (buffer-name (buffer-name)))
+ (skewer-eval (format "/skewer/script/%d/%s"
+ id (url-hexify-string buffer-name))
+ (lambda (_) (message "%s loaded" buffer-name))
+ :type "script")))
+
+(defservlet skewer/script "text/javascript; charset=UTF-8" (path)
+ (let ((id (string-to-number (nth 3 (split-string path "/")))))
+ (insert (cache-table-get id skewer-hosted-scripts ""))))
+
+;; Define the minor mode
+
+;;;###autoload
+(define-minor-mode skewer-mode
+ "Minor mode for interacting with a browser."
+ :lighter " skewer"
+ :keymap skewer-mode-map
+ :group 'skewer)
+
+;;;###autoload
+(defun run-skewer (&optional arg)
+ "Attach a browser to Emacs for a skewer JavaScript REPL. Uses
+`browse-url' to launch a browser.
+
+With a prefix arugment (C-u), it will ask the filename of the
+root document. With two prefix arguments (C-u C-u), it will use
+the contents of the current buffer as the root document."
+ (interactive "p")
+ (cl-case arg
+ (4 (setf skewer-demo-source (read-file-name "Skewer filename: ")))
+ (16 (setf skewer-demo-source (current-buffer))))
+ (httpd-start)
+ (browse-url (format "http://127.0.0.1:%d/skewer/demo" httpd-port)))
+
+;; PhantomJS
+
+(defvar phantomjs-program-name "/usr/bin/phantomjs"
+ "Path to the phantomjs executable.")
+
+(defvar skewer-phantomjs-processes ()
+ "List of phantomjs processes connected to Skewer.")
+
+(defun skewer-phantomjs-sentinel (proc event)
+ "Cleanup after phantomjs exits."
+ (when (cl-some (lambda (s) (string-match-p s event))
+ '("finished" "abnormal" "killed"))
+ (delete-file (process-get proc 'tempfile))))
+
+;;;###autoload
+(defun skewer-run-phantomjs ()
+ "Connect an inferior PhantomJS process to Skewer, returning the process."
+ (interactive)
+ (httpd-start)
+ (let ((script (make-temp-file "phantomjs-"))
+ (url (format "http://0:%d/skewer/demo" httpd-port)))
+ (with-temp-buffer
+ (insert (format "require('webpage').create().open('%s')" url))
+ (write-region nil nil script nil 0)
+ (let ((proc (start-process "phantomjs" nil
+ phantomjs-program-name script)))
+ (prog1 proc
+ (push proc skewer-phantomjs-processes)
+ (process-put proc 'tempfile script)
+ (set-process-sentinel proc 'skewer-phantomjs-sentinel))))))
+
+(defun skewer-phantomjs-kill ()
+ "Kill all inferior phantomjs processes connected to Skewer."
+ (interactive)
+ (mapc #'delete-process skewer-phantomjs-processes)
+ (setf skewer-phantomjs-processes nil))
+
+(provide 'skewer-mode)
+
+;;; skewer-mode.el ends here
diff --git a/elpa/skewer-mode-20200304.1142/skewer-mode.elc b/elpa/skewer-mode-20200304.1142/skewer-mode.elc
new file mode 100644
index 0000000..61c8fda
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-mode.elc
Binary files differ
diff --git a/elpa/skewer-mode-20200304.1142/skewer-repl.el b/elpa/skewer-mode-20200304.1142/skewer-repl.el
new file mode 100644
index 0000000..6a55d13
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-repl.el
@@ -0,0 +1,210 @@
+;;; skewer-repl.el --- create a REPL in a visiting browser -*- lexical-binding: t; -*-
+
+;; This is free and unencumbered software released into the public domain.
+
+;;; Commentary:
+
+;; This is largely based on of IELM's code. Run `skewer-repl' to
+;; switch to the REPL buffer and evaluate code. Use
+;; `skewer-repl-toggle-strict-mode' to turn strict mode on and off.
+
+;; If `compilation-search-path' is set up properly, along with
+;; `skewer-path-strip-level', asynchronous errors will provide
+;; clickable error messages that will take you to the source file of
+;; the error. This is done using `compilation-shell-minor-mode'.
+
+;;; Code:
+
+(require 'comint)
+(require 'compile)
+(require 'skewer-mode)
+
+(defcustom skewer-repl-strict-p nil
+ "When non-NIL, all REPL evaluations are done in strict mode."
+ :type 'boolean
+ :group 'skewer)
+
+(defcustom skewer-repl-prompt "js> "
+ "Prompt string for JavaScript REPL."
+ :type 'string
+ :group 'skewer)
+
+(defvar skewer-repl-welcome
+ (propertize "*** Welcome to Skewer ***\n"
+ 'font-lock-face 'font-lock-comment-face)
+ "Header line to show at the top of the REPL buffer. Hack
+notice: this allows log messages to appear before anything is
+evaluated because it provides insertable space at the top of the
+buffer.")
+
+(defun skewer-repl-process ()
+ "Return the process for the skewer REPL."
+ (get-buffer-process (current-buffer)))
+
+(defface skewer-repl-log-face
+ '((((class color) (background light))
+ :foreground "#77F")
+ (((class color) (background dark))
+ :foreground "#77F"))
+ "Face for skewer.log() messages."
+ :group 'skewer)
+
+(define-derived-mode skewer-repl-mode comint-mode "js-REPL"
+ "Provide a REPL into the visiting browser."
+ :group 'skewer
+ :syntax-table emacs-lisp-mode-syntax-table
+ (setq comint-prompt-regexp (concat "^" (regexp-quote skewer-repl-prompt))
+ comint-input-sender 'skewer-input-sender
+ comint-process-echoes nil)
+ ;; Make opportunistic use of company-mode, but don't require it.
+ ;; This means company-backends may be undeclared, so don't emit a
+ ;; warning about it.
+ (with-no-warnings
+ (setq-local company-backends '(company-skewer-repl)))
+ (unless (comint-check-proc (current-buffer))
+ (insert skewer-repl-welcome)
+ (start-process "skewer-repl" (current-buffer) nil)
+ (set-process-query-on-exit-flag (skewer-repl-process) nil)
+ (goto-char (point-max))
+ (set (make-local-variable 'comint-inhibit-carriage-motion) t)
+ (comint-output-filter (skewer-repl-process) skewer-repl-prompt)
+ (set-process-filter (skewer-repl-process) 'comint-output-filter)))
+
+(defun skewer-repl-toggle-strict-mode ()
+ "Toggle strict mode for expressions evaluated by the REPL."
+ (interactive)
+ (setq skewer-repl-strict-p (not skewer-repl-strict-p))
+ (message "REPL strict mode %s"
+ (if skewer-repl-strict-p "enabled" "disabled")))
+
+(defun skewer-input-sender (_ input)
+ "REPL comint handler."
+ (skewer-eval input 'skewer-post-repl
+ :verbose t :strict skewer-repl-strict-p))
+
+(defun skewer-post-repl (result)
+ "Callback for reporting results in the REPL."
+ (let ((buffer (get-buffer "*skewer-repl*"))
+ (output (cdr (assoc 'value result))))
+ (when buffer
+ (with-current-buffer buffer
+ (comint-output-filter (skewer-repl-process)
+ (concat output "\n" skewer-repl-prompt))))))
+
+(defvar skewer-repl-types
+ '(("log" . skewer-repl-log-face)
+ ("error" . skewer-error-face))
+ "Faces to use for different types of log messages.")
+
+(defun skewer-log-filename (log)
+ "Create a log string for the source file in LOG if present."
+ (let ((name (cdr (assoc 'filename log)))
+ (line (cdr (assoc 'line log)))
+ (column (cdr (assoc 'column log))))
+ (when name
+ (concat (format "\n at %s:%s" name line)
+ (if column (format ":%s" column))))))
+
+(defun skewer-post-log (log)
+ "Callback for logging messages to the REPL."
+ (let* ((buffer (get-buffer "*skewer-repl*"))
+ (face (cdr (assoc (cdr (assoc 'type log)) skewer-repl-types)))
+ (value (or (cdr (assoc 'value log)) "<unspecified error>"))
+ (output (propertize value 'font-lock-face face)))
+ (when buffer
+ (with-current-buffer buffer
+ (save-excursion
+ (goto-char (point-max))
+ (forward-line 0)
+ (if (bobp)
+ (insert (concat output (skewer-log-filename log) "\n"))
+ (backward-char)
+ (insert (concat "\n" output (skewer-log-filename log)))))))))
+
+(defcustom skewer-path-strip-level 1
+ "Number of folders which will be stripped from url when discovering paths.
+Use this to limit path matching to files in your filesystem. You
+may want to add some folders to `compilation-search-path', so
+matched files can be found."
+ :type 'number
+ :group 'skewer)
+
+(defun skewer-repl-mode-compilation-shell-hook ()
+ "Setup compilation shell minor mode for highlighting files"
+ (let ((error-re (format "^[ ]*at https?://[^/]+/\\(?:[^/]+/\\)\\{%d\\}\\([^:?#]+\\)\\(?:[?#][^:]*\\)?:\\([[:digit:]]+\\)\\(?::\\([[:digit:]]+\\)\\)?$" skewer-path-strip-level)))
+ (setq-local compilation-error-regexp-alist `((,error-re 1 2 3 2))))
+ (compilation-shell-minor-mode 1))
+
+;;;###autoload
+(defun skewer-repl--response-hook (response)
+ "Catches all browser messages logging some to the REPL."
+ (let ((type (cdr (assoc 'type response))))
+ (when (member type '("log" "error"))
+ (skewer-post-log response))))
+
+;;;###autoload
+(defun skewer-repl ()
+ "Start a JavaScript REPL to be evaluated in the visiting browser."
+ (interactive)
+ (when (not (get-buffer "*skewer-repl*"))
+ (with-current-buffer (get-buffer-create "*skewer-repl*")
+ (skewer-repl-mode)))
+ (pop-to-buffer (get-buffer "*skewer-repl*")))
+
+(defun company-skewer-repl (command &optional arg &rest _args)
+ "Skewerl REPL backend for company-mode.
+See `company-backends' for more info about COMMAND and ARG."
+ (interactive (list 'interactive))
+ (cl-case command
+ (interactive
+ (with-no-warnings ;; opportunistic use of company-mode
+ (company-begin-backend 'company-skewer-repl)))
+ (prefix (skewer-repl-company-prefix))
+ (ignore-case t)
+ (sorted t)
+ (candidates (cons :async
+ (lambda (callback)
+ (skewer-repl-get-completions arg callback))))))
+
+(defun skewer-repl-get-completions (arg callback)
+ "Get the completion list matching the prefix ARG.
+Evaluate CALLBACK with the completion candidates."
+ (let* ((expression (skewer-repl--get-completion-expression arg))
+ (pattern (if expression
+ (substring arg (1+ (length expression)))
+ arg)))
+ (skewer-eval (or expression "window")
+ (lambda (result)
+ (cl-loop with value = (cdr (assoc 'value result))
+ for key being the elements of value
+ when expression
+ collect (concat expression "." key) into results
+ else
+ collect key into results
+ finally (funcall callback results)))
+ :type "completions"
+ :extra `((regexp . ,pattern)))))
+
+(defun skewer-repl--get-completion-expression (arg)
+ "Get completion expression from ARG."
+ (let ((components (split-string arg "\\.")))
+ (when (> (length components) 1)
+ (mapconcat #'identity (cl-subseq components 0 -1) "."))))
+
+(defun skewer-repl-company-prefix ()
+ "Prefix for company."
+ (and (eq major-mode 'skewer-repl-mode)
+ (or (with-no-warnings ;; opportunistic use of company-mode
+ (company-grab-symbol-cons "\\." 1))
+ 'stop)))
+
+;;;###autoload
+(eval-after-load 'skewer-mode
+ '(progn
+ (add-hook 'skewer-response-hook #'skewer-repl--response-hook)
+ (add-hook 'skewer-repl-mode-hook #'skewer-repl-mode-compilation-shell-hook)
+ (define-key skewer-mode-map (kbd "C-c C-z") #'skewer-repl)))
+
+(provide 'skewer-repl)
+
+;;; skewer-repl.el ends here
diff --git a/elpa/skewer-mode-20200304.1142/skewer-repl.elc b/elpa/skewer-mode-20200304.1142/skewer-repl.elc
new file mode 100644
index 0000000..0f0560b
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-repl.elc
Binary files differ
diff --git a/elpa/skewer-mode-20200304.1142/skewer-setup.el b/elpa/skewer-mode-20200304.1142/skewer-setup.el
new file mode 100644
index 0000000..77aea1b
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-setup.el
@@ -0,0 +1,21 @@
+;;; skewer-setup.el --- automatic setup for the Skewer minor modes -*- lexical-binding: t; -*-
+
+;; This is free and unencumbered software released into the public domain.
+
+;;; Commentary:
+
+;; This exists as a separate file so that Skewer need not be fully
+;; loaded just to use this setup function.
+
+;;; Code:
+
+;;;###autoload
+(defun skewer-setup ()
+ "Fully integrate Skewer into js2-mode, css-mode, and html-mode buffers."
+ (add-hook 'js2-mode-hook 'skewer-mode)
+ (add-hook 'css-mode-hook 'skewer-css-mode)
+ (add-hook 'html-mode-hook 'skewer-html-mode))
+
+(provide 'skewer-setup)
+
+;;; skewer-setup.el ends here
diff --git a/elpa/skewer-mode-20200304.1142/skewer-setup.elc b/elpa/skewer-mode-20200304.1142/skewer-setup.elc
new file mode 100644
index 0000000..10c79d0
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer-setup.elc
Binary files differ
diff --git a/elpa/skewer-mode-20200304.1142/skewer.js b/elpa/skewer-mode-20200304.1142/skewer.js
new file mode 100644
index 0000000..eb741c7
--- /dev/null
+++ b/elpa/skewer-mode-20200304.1142/skewer.js
@@ -0,0 +1,436 @@
+/**
+ * @fileOverview Live browser interaction with Emacs
+ * @version 1.4
+ */
+
+/**
+ * Connects to Emacs and waits for a request. After handling the
+ * request it sends back the results and queues itself for another
+ * request.
+ * @namespace Holds all of Skewer's functionality.
+ */
+function skewer() {
+ function callback(request) {
+ var result = skewer.fn[request.type](request);
+ if (result) {
+ result = skewer.extend({
+ id: request.id,
+ type: request.type,
+ status: 'success',
+ value: ''
+ }, result);
+ skewer.postJSON(skewer.host + "/skewer/post", result, callback);
+ } else {
+ skewer.getJSON(skewer.host + "/skewer/get", callback);
+ }
+ };
+ skewer.getJSON(skewer.host + "/skewer/get", callback);
+}
+
+/**
+ * Get a JSON-encoded object from a server.
+ * @param {String} url The location of the remote server
+ * @param {Function} [callback] The callback to receive a response object
+ */
+skewer.getJSON = function(url, callback) {
+ var XHR = window.skewerNativeXHR || XMLHttpRequest;
+ var xhr = new XHR();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState === 4 && xhr.status === 200) {
+ callback(JSON.parse(xhr.responseText));
+ }
+ };
+ xhr.open('GET', url, true);
+ xhr.send();
+};
+
+/**
+ * Send a JSON-encoded object to a server.
+ * @param {String} url The location of the remote server
+ * @param {Object} object The object to transmit to the server
+ * @param {Function} [callback] The callback to receive a response object
+ */
+skewer.postJSON = function(url, object, callback) {
+ var XHR = window.skewerNativeXHR || XMLHttpRequest;
+ var xhr = new XHR();
+ xhr.onreadystatechange = function() {
+ if (callback && xhr.readyState === 4 && xhr.status === 200) {
+ callback(JSON.parse(xhr.responseText));
+ }
+ };
+ xhr.open('POST', url, true);
+ xhr.setRequestHeader("Content-Type", "text/plain"); // CORS
+ xhr.send(JSON.stringify(object));
+};
+
+/**
+ * Add the properties other objects to a target object (jQuery.extend).
+ * @param {Object} target The object to receive new properties
+ * @param {...Object} objects Source objects for properties
+ * @returns The target object
+ */
+skewer.extend = function(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var object = arguments[i];
+ for (var key in object) {
+ if (object.hasOwnProperty(key)) {
+ target[key] = object[key];
+ }
+ }
+ }
+ return target;
+};
+
+/**
+ * Globally evaluate an expression and return the result. This
+ * <i>only</i> works when the implementation's indirect eval performs
+ * a global eval. If not, there's no alternative, since a return value
+ * is essential.
+ *
+ * @see http://perfectionkills.com/global-eval-what-are-the-options/
+ *
+ * @param expression A string containing an expression to evaluate
+ * @returns The result of the evaluation
+ */
+skewer.globalEval = (function() {
+ var eval0 = (function(original, Object) {
+ try {
+ return [eval][0]('Object') === original;
+ } catch (e) {
+ return false;
+ }
+ }(Object, false));
+ if (eval0) {
+ return function(expression) {
+ return [eval][0](expression);
+ };
+ } else {
+ return function(expression) { // Safari
+ return eval.call(window, expression);
+ };
+ }
+}());
+
+/**
+ * Same as Date.now(), supplied for pre-ES5 JS (<=IE8).
+ * @returns {number} The epoch time in milliseconds
+ */
+skewer.now = function() {
+ return new Date().valueOf();
+};
+
+/**
+ * Handlers accept a request object from Emacs and return either a
+ * logical false (no response) or an object to return to Emacs.
+ * @namespace Request handlers.
+ */
+skewer.fn = {};
+
+/**
+ * Handles an code evaluation request from Emacs.
+ * @param request The request object sent by Emacs
+ * @returns The result object to be returned to Emacs
+ */
+skewer.fn.eval = function(request) {
+ var result = {
+ strict: request.strict
+ };
+ var start = skewer.now();
+ try {
+ var prefix = request.strict ? '"use strict";\n' : "";
+ var value = skewer.globalEval(prefix + request.eval);
+ result.value = skewer.safeStringify(value, request.verbose);
+ } catch (error) {
+ result = skewer.errorResult(error, result, request);
+ }
+ result.time = (skewer.now() - start) / 1000;
+ return result;
+};
+
+/**
+ * Load a hosted script named by the request.
+ * @param request The request object sent by Emacs
+ * @returns The result object to be returned to Emacs
+ */
+skewer.fn.script = function(request) {
+ var script = document.createElement('script');
+ script.src = skewer.host + request.eval;
+ document.body.appendChild(script);
+ return {value: JSON.stringify(request.eval)};
+};
+
+/**
+ * A keep-alive and connecton testing handler.
+ * @param request The request object sent by Emacs
+ * @returns The result object to be returned to Emacs
+ */
+skewer.fn.ping = function(request) {
+ return {
+ type: 'pong',
+ date: skewer.now() / 1000,
+ value: request.eval
+ };
+};
+
+/**
+ * Establish a new stylesheet with the provided value.
+ */
+skewer.fn.css = function(request) {
+ var style = document.createElement('style');
+ style.type = 'text/css';
+ style.className = 'skewer';
+ if (style.styleSheet) { // < IE9
+ style.styleSheet.cssText = request.eval;
+ } else {
+ style.appendChild(document.createTextNode(request.eval));
+ }
+ document.body.appendChild(style);
+ return {};
+};
+
+/**
+ * Remove all of Skewer's style tags from the document.
+ */
+skewer.fn.cssClearAll = function(request) {
+ var styles = document.body.querySelectorAll('style.skewer');
+ for (var i = 0; i < styles.length; i++) {
+ styles[i].parentNode.removeChild(styles[i]);
+ }
+ return {};
+};
+
+/**
+ * HTML evaluator, appends or replaces a selection with given HTML.
+ */
+skewer.fn.html = function(request) {
+ function buildSelector(ancestry) {
+ return ancestry.map(function(tag) {
+ return tag[0] + ':nth-of-type(' + tag[1] + ')';
+ }).join(' > ');
+ }
+ function query(ancestry) {
+ return document.querySelector(buildSelector(ancestry));
+ }
+ function htmlToNode(html) {
+ var wrapper = document.createElement('div');
+ wrapper.innerHTML = html;
+ return wrapper.firstChild;
+ }
+
+ var target = query(request.ancestry);
+
+ if (target == null) {
+ /* Determine missing part of the ancestry. */
+ var path = request.ancestry.slice(0); // copy
+ var missing = [];
+ while (query(path) == null) {
+ missing.push(path.pop());
+ }
+
+ /* Build up the missing elements. */
+ target = query(path);
+ while (missing.length > 0) {
+ var tag = missing.pop(),
+ name = tag[0],
+ nth = tag[1];
+ var empty = null;
+ var count = target.querySelectorAll(name).length;
+ for (; count < nth; count++) {
+ empty = document.createElement(tag[0]);
+ target.appendChild(empty);
+ }
+ target = empty;
+ }
+ }
+
+ target.parentNode.replaceChild(htmlToNode(request.eval), target);
+ return {};
+};
+
+/**
+ * Fetch the HTML contents of selector.
+ */
+skewer.fn.fetchselector = function(request) {
+ var element = document.querySelector(request.eval);
+ return { value: element.innerHTML };
+};
+
+/**
+ * Return a list of completions for an object.
+ */
+skewer.fn.completions = function(request) {
+ var object = skewer.globalEval(request.eval);
+ var keys = new Set();
+ var regex = new RegExp(request.regexp);
+ for (var key in object) {
+ if (regex.test(key)) {
+ keys.add(key);
+ }
+ }
+ var props = object != null ? Object.getOwnPropertyNames(object) : [];
+ for (var i = 0; i < props.length; i++) {
+ if (regex.test(props[i])) {
+ keys.add(props[i]);
+ }
+ }
+ return { value: Array.from(keys).sort() };
+};
+
+/**
+ * Host of the skewer script (CORS support).
+ * @type string
+ */
+(function() {
+ var script = document.querySelector('script[src$="/skewer"]');
+ if (script) {
+ skewer.host = script.src.match(/\w+:\/\/[^/]+/)[0];
+ } else {
+ skewer.host = ''; // default to the current host
+ }
+}());
+
+/**
+ * Stringify a potentially circular object without throwing an exception.
+ * @param object The object to be printed.
+ * @param {boolean} verbose Enable more verbose output.
+ * @returns {string} The printed object.
+ */
+skewer.safeStringify = function (object, verbose) {
+ "use strict";
+ var circular = "#<Circular>";
+ var seen = [];
+
+ var stringify = function(obj) {
+ if (obj === true) {
+ return "true";
+ } else if (obj === false) {
+ return "false";
+ } else if (obj === undefined) {
+ return "undefined";
+ } else if (obj === null) {
+ return "null";
+ } else if (typeof obj === "number") {
+ return obj.toString();
+ } else if (obj instanceof Array) {
+ if (seen.indexOf(obj) >= 0) {
+ return circular;
+ } else {
+ seen.push(obj);
+ return "[" + obj.map(function(e) {
+ return stringify(e);
+ }).join(", ") + "]";
+ }
+ } else if (typeof obj === "string") {
+ return JSON.stringify(obj);
+ } else if (window.Node != null && obj instanceof Node) {
+ return obj.toString(); // DOM elements can't stringify
+ } else if (typeof obj === "function") {
+ if (verbose)
+ return obj.toString();
+ else
+ return "Function";
+ } else if (Object.prototype.toString.call(obj) === '[object Date]') {
+ if (verbose)
+ return JSON.stringify(obj);
+ else
+ return obj.toString();
+ } else {
+ if (verbose) {
+ if (seen.indexOf(obj) >= 0)
+ return circular;
+ else
+ seen.push(obj);
+ var pairs = [];
+ for (var key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ var pair = JSON.stringify(key) + ":";
+ pair += stringify(obj[key]);
+ pairs.push(pair);
+ }
+ }
+ return "{" + pairs.join(',') + "}";
+ } else {
+ try {
+ return obj.toString();
+ } catch (error) {
+ return ({}).toString();
+ }
+ }
+ }
+ };
+
+ try {
+ return stringify(object);
+ } catch (error) {
+ return skewer.safeStringify(object, false);
+ }
+};
+
+/**
+ * Log an object to the Skewer REPL in Emacs (console.log).
+ * @param message The object to be logged.
+ */
+skewer.log = function() {
+ "use strict";
+ for (var i = 0; i < arguments.length; i++) {
+ var log = {
+ type: "log",
+ value: skewer.safeStringify(arguments[i], true)
+ };
+ skewer.postJSON(skewer.host + "/skewer/post", log);
+ }
+};
+
+/**
+ * Report an error event to the REPL.
+ * @param event An error event object.
+ */
+skewer.error = function(event) {
+ "use strict";
+ var log = {
+ type: "error",
+ value: event.message,
+ filename: event.filename,
+ line: event.lineno,
+ column: event.column
+ };
+ skewer.postJSON(skewer.host + "/skewer/post", log);
+};
+
+/**
+ * Prepare a result when an error occurs evaluating Javascript code.
+ * @param error The error object given by catch.
+ * @param result The resutl object to return to Emacs.
+ * @param request The request object from Emacs.
+ * @return The result object to send back to Emacs.
+ */
+skewer.errorResult = function(error, result, request) {
+ "use strict";
+ return skewer.extend({}, result, {
+ value: error.toString(),
+ status: 'error',
+ error: {
+ name: error.name,
+ stack: error.stack,
+ type: error.type,
+ message: error.message,
+ eval: request.eval
+ }
+ });
+};
+
+if (window.addEventListener) {
+ window.addEventListener('error', skewer.error);
+ if (document.readyState === 'complete') {
+ skewer();
+ } else {
+ window.addEventListener('load', skewer);
+ }
+} else { // < IE9
+ window.attachEvent('onerror', skewer.error);
+ if (document.readyState === 'complete') {
+ skewer();
+ } else {
+ window.attachEvent('onload', skewer);
+ }
+}
diff --git a/elpa/use-package-20210207.1926/dir b/elpa/use-package-20210207.1926/dir
new file mode 100644
index 0000000..651b05d
--- /dev/null
+++ b/elpa/use-package-20210207.1926/dir
@@ -0,0 +1,18 @@
+This is the file .../info/dir, which contains the
+topmost node of the Info hierarchy, called (dir)Top.
+The first time you invoke Info you start off looking at this node.
+
+File: dir, Node: Top This is the top of the INFO tree
+
+ This (the Directory node) gives a menu of major topics.
+ Typing "q" exits, "H" lists all Info commands, "d" returns here,
+ "h" gives a primer for first-timers,
+ "mEmacs<Return>" visits the Emacs manual, etc.
+
+ In Emacs, you can click mouse button 2 on a menu item or cross reference
+ to select it.
+
+* Menu:
+
+Emacs
+* use-package: (use-package). Declarative package configuration for Emacs.
diff --git a/elpa/use-package-20210207.1926/use-package-autoloads.el b/elpa/use-package-20210207.1926/use-package-autoloads.el
new file mode 100644
index 0000000..d5afb09
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-autoloads.el
@@ -0,0 +1,230 @@
+;;; use-package-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "use-package-bind-key" "use-package-bind-key.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from use-package-bind-key.el
+
+(autoload 'use-package-autoload-keymap "use-package-bind-key" "\
+Loads PACKAGE and then binds the key sequence used to invoke
+this function to KEYMAP-SYMBOL. It then simulates pressing the
+same key sequence a again, so that the next key pressed is routed
+to the newly loaded keymap.
+
+This function supports use-package's :bind-keymap keyword. It
+works by binding the given key sequence to an invocation of this
+function for a particular keymap. The keymap is expected to be
+defined by the package. In this way, loading the package is
+deferred until the prefix key sequence is pressed.
+
+\(fn KEYMAP-SYMBOL PACKAGE OVERRIDE)" nil nil)
+
+(autoload 'use-package-normalize-binder "use-package-bind-key" "\
+
+
+\(fn NAME KEYWORD ARGS)" nil nil)
+
+(defalias 'use-package-normalize/:bind 'use-package-normalize-binder)
+
+(defalias 'use-package-normalize/:bind* 'use-package-normalize-binder)
+
+(defalias 'use-package-autoloads/:bind 'use-package-autoloads-mode)
+
+(defalias 'use-package-autoloads/:bind* 'use-package-autoloads-mode)
+
+(autoload 'use-package-handler/:bind "use-package-bind-key" "\
+
+
+\(fn NAME KEYWORD ARGS REST STATE &optional BIND-MACRO)" nil nil)
+
+(defalias 'use-package-normalize/:bind-keymap 'use-package-normalize-binder)
+
+(defalias 'use-package-normalize/:bind-keymap* 'use-package-normalize-binder)
+
+(autoload 'use-package-handler/:bind-keymap "use-package-bind-key" "\
+
+
+\(fn NAME KEYWORD ARGS REST STATE &optional OVERRIDE)" nil nil)
+
+(autoload 'use-package-handler/:bind-keymap* "use-package-bind-key" "\
+
+
+\(fn NAME KEYWORD ARG REST STATE)" nil nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "use-package-bind-key" '("use-package-handler/:bind*")))
+
+;;;***
+
+;;;### (autoloads nil "use-package-core" "use-package-core.el" (0
+;;;;;; 0 0 0))
+;;; Generated autoloads from use-package-core.el
+
+(autoload 'use-package "use-package-core" "\
+Declare an Emacs package by specifying a group of configuration options.
+
+For full documentation, please see the README file that came with
+this file. Usage:
+
+ (use-package package-name
+ [:keyword [option]]...)
+
+:init Code to run before PACKAGE-NAME has been loaded.
+:config Code to run after PACKAGE-NAME has been loaded. Note that
+ if loading is deferred for any reason, this code does not
+ execute until the lazy load has occurred.
+:preface Code to be run before everything except `:disabled'; this
+ can be used to define functions for use in `:if', or that
+ should be seen by the byte-compiler.
+
+:mode Form to be added to `auto-mode-alist'.
+:magic Form to be added to `magic-mode-alist'.
+:magic-fallback Form to be added to `magic-fallback-mode-alist'.
+:interpreter Form to be added to `interpreter-mode-alist'.
+
+:commands Define autoloads for commands that will be defined by the
+ package. This is useful if the package is being lazily
+ loaded, and you wish to conditionally call functions in your
+ `:init' block that are defined in the package.
+:hook Specify hook(s) to attach this package to.
+
+:bind Bind keys, and define autoloads for the bound commands.
+:bind* Bind keys, and define autoloads for the bound commands,
+ *overriding all minor mode bindings*.
+:bind-keymap Bind a key prefix to an auto-loaded keymap defined in the
+ package. This is like `:bind', but for keymaps.
+:bind-keymap* Like `:bind-keymap', but overrides all minor mode bindings
+
+:defer Defer loading of a package -- this is implied when using
+ `:commands', `:bind', `:bind*', `:mode', `:magic', `:hook',
+ `:magic-fallback', or `:interpreter'. This can be an integer,
+ to force loading after N seconds of idle time, if the package
+ has not already been loaded.
+:after Delay the use-package declaration until after the named modules
+ have loaded. Once load, it will be as though the use-package
+ declaration (without `:after') had been seen at that moment.
+:demand Prevent the automatic deferred loading introduced by constructs
+ such as `:bind' (see `:defer' for the complete list).
+
+:if EXPR Initialize and load only if EXPR evaluates to a non-nil value.
+:disabled The package is ignored completely if this keyword is present.
+:defines Declare certain variables to silence the byte-compiler.
+:functions Declare certain functions to silence the byte-compiler.
+:load-path Add to the `load-path' before attempting to load the package.
+:diminish Support for diminish.el (if installed).
+:delight Support for delight.el (if installed).
+:custom Call `custom-set' or `set-default' with each variable
+ definition without modifying the Emacs `custom-file'.
+ (compare with `custom-set-variables').
+:custom-face Call `customize-set-faces' with each face definition.
+:ensure Loads the package using package.el if necessary.
+:pin Pin the package to an archive.
+
+\(fn NAME &rest ARGS)" nil t)
+
+(function-put 'use-package 'lisp-indent-function '1)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "use-package-core" '("use-package-")))
+
+;;;***
+
+;;;### (autoloads nil "use-package-delight" "use-package-delight.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from use-package-delight.el
+
+(autoload 'use-package-normalize/:delight "use-package-delight" "\
+Normalize arguments to delight.
+
+\(fn NAME KEYWORD ARGS)" nil nil)
+
+(autoload 'use-package-handler/:delight "use-package-delight" "\
+
+
+\(fn NAME KEYWORD ARGS REST STATE)" nil nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "use-package-delight" '("use-package-normalize-delight")))
+
+;;;***
+
+;;;### (autoloads nil "use-package-diminish" "use-package-diminish.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from use-package-diminish.el
+
+(autoload 'use-package-normalize/:diminish "use-package-diminish" "\
+
+
+\(fn NAME KEYWORD ARGS)" nil nil)
+
+(autoload 'use-package-handler/:diminish "use-package-diminish" "\
+
+
+\(fn NAME KEYWORD ARG REST STATE)" nil nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "use-package-diminish" '("use-package-normalize-diminish")))
+
+;;;***
+
+;;;### (autoloads nil "use-package-ensure" "use-package-ensure.el"
+;;;;;; (0 0 0 0))
+;;; Generated autoloads from use-package-ensure.el
+
+(autoload 'use-package-normalize/:ensure "use-package-ensure" "\
+
+
+\(fn NAME KEYWORD ARGS)" nil nil)
+
+(autoload 'use-package-handler/:ensure "use-package-ensure" "\
+
+
+\(fn NAME KEYWORD ENSURE REST STATE)" nil nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "use-package-ensure" '("use-package-")))
+
+;;;***
+
+;;;### (autoloads nil "use-package-jump" "use-package-jump.el" (0
+;;;;;; 0 0 0))
+;;; Generated autoloads from use-package-jump.el
+
+(autoload 'use-package-jump-to-package-form "use-package-jump" "\
+Attempt to find and jump to the `use-package' form that loaded
+PACKAGE. This will only find the form if that form actually
+required PACKAGE. If PACKAGE was previously required then this
+function will jump to the file that originally required PACKAGE
+instead.
+
+\(fn PACKAGE)" t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "use-package-jump" '("use-package-find-require")))
+
+;;;***
+
+;;;### (autoloads nil "use-package-lint" "use-package-lint.el" (0
+;;;;;; 0 0 0))
+;;; Generated autoloads from use-package-lint.el
+
+(autoload 'use-package-lint "use-package-lint" "\
+Check for errors in use-package declarations.
+For example, if the module's `:if' condition is met, but even
+with the specified `:load-path' the module cannot be found." t nil)
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "use-package-lint" '("use-package-lint-declaration")))
+
+;;;***
+
+;;;### (autoloads nil nil ("use-package-pkg.el" "use-package.el")
+;;;;;; (0 0 0 0))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; use-package-autoloads.el ends here
diff --git a/elpa/use-package-20210207.1926/use-package-bind-key.el b/elpa/use-package-20210207.1926/use-package-bind-key.el
new file mode 100644
index 0000000..e476b06
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-bind-key.el
@@ -0,0 +1,172 @@
+;;; use-package-bind-key.el --- Support for the :bind/:bind-keymap keywords -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2017 John Wiegley
+
+;; Author: John Wiegley <johnw@newartisans.com>
+;; Maintainer: John Wiegley <johnw@newartisans.com>
+;; Created: 17 Jun 2012
+;; Modified: 4 Dec 2017
+;; Version: 1.0
+;; Package-Requires: ((emacs "24.3") (use-package "2.4") (bind-key "2.4"))
+;; Keywords: dotemacs startup speed config package
+;; URL: https://github.com/jwiegley/use-package
+
+;; This program 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, or (at
+;; your option) any later version.
+
+;; This program 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; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Provides support for the :bind, :bind*, :bind-keymap and :bind-keymap*
+;; keywords. Note that these are currently still baked into
+;; `use-package-keywords' and `use-package-deferring-keywords', although this
+;; is harmless if they are never used.
+
+;;; Code:
+
+(require 'use-package-core)
+(require 'bind-key)
+
+;;;###autoload
+(defun use-package-autoload-keymap (keymap-symbol package override)
+ "Loads PACKAGE and then binds the key sequence used to invoke
+this function to KEYMAP-SYMBOL. It then simulates pressing the
+same key sequence a again, so that the next key pressed is routed
+to the newly loaded keymap.
+
+This function supports use-package's :bind-keymap keyword. It
+works by binding the given key sequence to an invocation of this
+function for a particular keymap. The keymap is expected to be
+defined by the package. In this way, loading the package is
+deferred until the prefix key sequence is pressed."
+ (if (not (require package nil t))
+ (use-package-error (format "Cannot load package.el: %s" package))
+ (if (and (boundp keymap-symbol)
+ (keymapp (symbol-value keymap-symbol)))
+ (let* ((kv (this-command-keys-vector))
+ (key (key-description kv))
+ (keymap (symbol-value keymap-symbol)))
+ (if override
+ (bind-key* key keymap)
+ (bind-key key keymap))
+ (setq unread-command-events
+ (mapcar (lambda (ev) (cons t ev))
+ (listify-key-sequence kv))))
+ (use-package-error
+ (format "package.el %s failed to define keymap %s"
+ package keymap-symbol)))))
+
+;;;###autoload
+(defun use-package-normalize-binder (name keyword args)
+ (let ((arg args)
+ args*)
+ (while arg
+ (let ((x (car arg)))
+ (cond
+ ;; (KEY . COMMAND)
+ ((and (consp x)
+ (or (stringp (car x))
+ (vectorp (car x)))
+ (or (use-package-recognize-function (cdr x) t #'stringp)))
+ (setq args* (nconc args* (list x)))
+ (setq arg (cdr arg)))
+ ;; KEYWORD
+ ;; :map KEYMAP
+ ;; :prefix-docstring STRING
+ ;; :prefix-map SYMBOL
+ ;; :prefix STRING
+ ;; :filter SEXP
+ ;; :menu-name STRING
+ ;; :package SYMBOL
+ ((or (and (eq x :map) (symbolp (cadr arg)))
+ (and (eq x :prefix) (stringp (cadr arg)))
+ (and (eq x :prefix-map) (symbolp (cadr arg)))
+ (and (eq x :prefix-docstring) (stringp (cadr arg)))
+ (eq x :filter)
+ (and (eq x :menu-name) (stringp (cadr arg)))
+ (and (eq x :package) (symbolp (cadr arg))))
+ (setq args* (nconc args* (list x (cadr arg))))
+ (setq arg (cddr arg)))
+ ((listp x)
+ (setq args*
+ (nconc args* (use-package-normalize-binder name keyword x)))
+ (setq arg (cdr arg)))
+ (t
+ ;; Error!
+ (use-package-error
+ (concat (symbol-name name)
+ " wants arguments acceptable to the `bind-keys' macro,"
+ " or a list of such values"))))))
+ args*))
+
+;;;; :bind, :bind*
+
+;;;###autoload
+(defalias 'use-package-normalize/:bind 'use-package-normalize-binder)
+;;;###autoload
+(defalias 'use-package-normalize/:bind* 'use-package-normalize-binder)
+
+;; jww (2017-12-07): This is too simplistic. It will fail to determine
+;; autoloads in this situation:
+;; (use-package foo
+;; :bind (:map foo-map (("C-a" . func))))
+;;;###autoload
+(defalias 'use-package-autoloads/:bind 'use-package-autoloads-mode)
+;;;###autoload
+(defalias 'use-package-autoloads/:bind* 'use-package-autoloads-mode)
+
+;;;###autoload
+(defun use-package-handler/:bind
+ (name _keyword args rest state &optional bind-macro)
+ (use-package-concat
+ (use-package-process-keywords name rest state)
+ `(,@(mapcar
+ #'(lambda (xs)
+ `(,(if bind-macro bind-macro 'bind-keys)
+ :package ,name ,@(use-package-normalize-commands xs)))
+ (use-package-split-list-at-keys :break args)))))
+
+(defun use-package-handler/:bind* (name keyword arg rest state)
+ (use-package-handler/:bind name keyword arg rest state 'bind-keys*))
+
+;;;; :bind-keymap, :bind-keymap*
+
+;;;###autoload
+(defalias 'use-package-normalize/:bind-keymap 'use-package-normalize-binder)
+;;;###autoload
+(defalias 'use-package-normalize/:bind-keymap* 'use-package-normalize-binder)
+
+;;;###autoload
+(defun use-package-handler/:bind-keymap
+ (name _keyword args rest state &optional override)
+ (use-package-concat
+ (use-package-process-keywords name rest state)
+ (mapcar
+ #'(lambda (binding)
+ `(,(if override 'bind-key* 'bind-key)
+ ,(car binding)
+ #'(lambda ()
+ (interactive)
+ (use-package-autoload-keymap
+ ',(cdr binding) ',(use-package-as-symbol name)
+ ,override))))
+ args)))
+
+;;;###autoload
+(defun use-package-handler/:bind-keymap* (name keyword arg rest state)
+ (use-package-handler/:bind-keymap name keyword arg rest state t))
+
+(provide 'use-package-bind-key)
+
+;;; use-package-bind-key.el ends here
diff --git a/elpa/use-package-20210207.1926/use-package-bind-key.elc b/elpa/use-package-20210207.1926/use-package-bind-key.elc
new file mode 100644
index 0000000..d70c79d
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-bind-key.elc
Binary files differ
diff --git a/elpa/use-package-20210207.1926/use-package-core.el b/elpa/use-package-20210207.1926/use-package-core.el
new file mode 100644
index 0000000..28bc5a5
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-core.el
@@ -0,0 +1,1633 @@
+;;; use-package-core.el --- A configuration macro for simplifying your .emacs -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2017 John Wiegley
+
+;; Author: John Wiegley <johnw@newartisans.com>
+;; Maintainer: John Wiegley <johnw@newartisans.com>
+;; Created: 17 Jun 2012
+;; Modified: 29 Nov 2017
+;; Version: 2.4.1
+;; Package-Requires: ((emacs "24.3"))
+;; Keywords: dotemacs startup speed config package
+;; URL: https://github.com/jwiegley/use-package
+
+;; This program 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, or (at
+;; your option) any later version.
+
+;; This program 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; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; The `use-package' declaration macro allows you to isolate package
+;; configuration in your ".emacs" in a way that is performance-oriented and,
+;; well, just tidy. I created it because I have over 80 packages that I use
+;; in Emacs, and things were getting difficult to manage. Yet with this
+;; utility my total load time is just under 1 second, with no loss of
+;; functionality!
+;;
+;; Please see README.md from the same repository for documentation.
+
+;;; Code:
+
+(require 'bytecomp)
+(require 'cl-lib)
+(require 'tabulated-list)
+
+(eval-and-compile
+ ;; Declare a synthetic theme for :custom variables.
+ ;; Necessary in order to avoid having those variables saved by custom.el.
+ (deftheme use-package))
+
+(enable-theme 'use-package)
+;; Remove the synthetic use-package theme from the enabled themes, so
+;; iterating over them to "disable all themes" won't disable it.
+(setq custom-enabled-themes (remq 'use-package custom-enabled-themes))
+
+(if (and (eq emacs-major-version 24) (eq emacs-minor-version 3))
+ (defsubst hash-table-keys (hash-table)
+ "Return a list of keys in HASH-TABLE."
+ (cl-loop for k being the hash-keys of hash-table collect k))
+ (eval-when-compile (require 'subr-x)))
+
+(eval-when-compile
+ (require 'regexp-opt))
+
+(defgroup use-package nil
+ "A use-package declaration for simplifying your `.emacs'."
+ :group 'startup)
+
+(defconst use-package-version "2.4.1"
+ "This version of use-package.")
+
+(defcustom use-package-keywords
+ '(:disabled
+ :load-path
+ :requires
+ :defines
+ :functions
+ :preface
+ :if :when :unless
+ :no-require
+ :catch
+ :after
+ :custom
+ :custom-face
+ :bind
+ :bind*
+ :bind-keymap
+ :bind-keymap*
+ :interpreter
+ :mode
+ :magic
+ :magic-fallback
+ :hook
+ ;; Any other keyword that also declares commands to be autoloaded (such as
+ ;; :bind) must appear before this keyword.
+ :commands
+ :init
+ :defer
+ :demand
+ :load
+ ;; This must occur almost last; the only forms which should appear after
+ ;; are those that must happen directly after the config forms.
+ :config)
+ "The set of valid keywords, in the order they are processed in.
+The order of this list is *very important*, so it is only
+advisable to insert new keywords, never to delete or reorder
+them. Further, attention should be paid to the NEWS.md if the
+default order ever changes, as they may have subtle effects on
+the semantics of use-package declarations and may necessitate
+changing where you had inserted a new keyword earlier.
+
+Note that `:disabled' is special in this list, as it causes
+nothing at all to happen, even if the rest of the use-package
+declaration is incorrect."
+ :type '(repeat symbol)
+ :group 'use-package)
+
+(defcustom use-package-deferring-keywords
+ '(:bind-keymap
+ :bind-keymap*
+ :commands)
+ "Unless `:demand' is used, keywords in this list imply deferred loading.
+The reason keywords like `:hook' are not in this list is that
+they only imply deferred loading if they reference actual
+function symbols that can be autoloaded from the module; whereas
+the default keywords provided here always defer loading unless
+otherwise requested."
+ :type '(repeat symbol)
+ :group 'use-package)
+
+(defcustom use-package-ignore-unknown-keywords nil
+ "If non-nil, issue warning instead of error when unknown
+keyword is encountered. The unknown keyword and its associated
+arguments will be ignored in the `use-package' expansion."
+ :type 'boolean
+ :group 'use-package)
+
+(defcustom use-package-use-theme t
+ "If non-nil, use a custom theme to avoid saving :custom
+variables twice (once in the Custom file, once in the use-package
+call)."
+ :type 'boolean
+ :group 'use-package)
+
+(defcustom use-package-verbose nil
+ "Whether to report about loading and configuration details.
+If you customize this, then you should require the `use-package'
+feature in files that use `use-package', even if these files only
+contain compiled expansions of the macros. If you don't do so,
+then the expanded macros do their job silently."
+ :type '(choice (const :tag "Quiet, without catching errors" errors)
+ (const :tag "Quiet" nil)
+ (const :tag "Verbose" t)
+ (const :tag "Debug" debug))
+ :group 'use-package)
+
+(defcustom use-package-check-before-init nil
+ "If non-nil, check that package exists before executing its `:init' block.
+This check is performed by calling `locate-library'."
+ :type 'boolean
+ :group 'use-package)
+
+(defcustom use-package-always-defer nil
+ "If non-nil, assume `:defer t' unless `:demand' is used.
+See also `use-package-defaults', which uses this value."
+ :type 'boolean
+ :group 'use-package)
+
+(defcustom use-package-always-demand nil
+ "If non-nil, assume `:demand t' unless `:defer' is used.
+See also `use-package-defaults', which uses this value."
+ :type 'boolean
+ :group 'use-package)
+
+(defcustom use-package-defaults
+ '(;; this '(t) has special meaning; see `use-package-handler/:config'
+ (:config '(t) t)
+ (:init nil t)
+ (:catch t (lambda (name args)
+ (not use-package-expand-minimally)))
+ (:defer use-package-always-defer
+ (lambda (name args)
+ (and use-package-always-defer
+ (not (plist-member args :defer))
+ (not (plist-member args :demand)))))
+ (:demand use-package-always-demand
+ (lambda (name args)
+ (and use-package-always-demand
+ (not (plist-member args :defer))
+ (not (plist-member args :demand))))))
+ "Default values for specified `use-package' keywords.
+Each entry in the alist is a list of three elements:
+The first element is the `use-package' keyword.
+
+The second is a form that can be evaluated to get the default
+value. It can also be a function that will receive the name of
+the use-package declaration and the keyword plist given to
+`use-package', in normalized form. The value it returns should
+also be in normalized form (which is sometimes *not* what one
+would normally write in a `use-package' declaration, so use
+caution).
+
+The third element is a form that can be evaluated to determine
+whether or not to assign a default value; if it evaluates to nil,
+then the default value is not assigned even if the keyword is not
+present in the `use-package' form. This third element may also be
+a function, in which case it receives the name of the package (as
+a symbol) and a list of keywords (in normalized form). It should
+return nil or non-nil depending on whether defaulting should be
+attempted."
+ :type `(repeat
+ (list (choice :tag "Keyword"
+ ,@(mapcar #'(lambda (k) (list 'const k))
+ use-package-keywords))
+ (choice :tag "Default value" sexp function)
+ (choice :tag "Enable if non-nil" sexp function)))
+ :group 'use-package)
+
+(defcustom use-package-merge-key-alist
+ '((:if . (lambda (new old) `(and ,new ,old)))
+ (:after . (lambda (new old) `(:all ,new ,old)))
+ (:defer . (lambda (new old) old))
+ (:bind . (lambda (new old) (append new (list :break) old))))
+ "Alist of keys and the functions used to merge multiple values.
+For example, if the following form is provided:
+
+ (use-package foo :if pred1 :if pred2)
+
+Then based on the above defaults, the merged result will be:
+
+ (use-package foo :if (and pred1 pred2))
+
+This is done so that, at the stage of invoking handlers, each
+handler is called only once."
+ :type `(repeat
+ (cons (choice :tag "Keyword"
+ ,@(mapcar #'(lambda (k) (list 'const k))
+ use-package-keywords)
+ (const :tag "Any" t))
+ function))
+ :group 'use-package)
+
+(defcustom use-package-hook-name-suffix "-hook"
+ "Text append to the name of hooks mentioned by :hook.
+Set to nil if you don't want this to happen; it's only a
+convenience."
+ :type '(choice string (const :tag "No suffix" nil))
+ :group 'use-package)
+
+(defcustom use-package-minimum-reported-time 0.1
+ "Minimal load time that will be reported.
+Note that `use-package-verbose' has to be set to a non-nil value
+for anything to be reported at all."
+ :type 'number
+ :group 'use-package)
+
+(defcustom use-package-inject-hooks nil
+ "If non-nil, add hooks to the `:init' and `:config' sections.
+In particular, for a given package `foo', the following hooks
+become available:
+
+ `use-package--foo--pre-init-hook'
+ `use-package--foo--post-init-hook'
+ `use-package--foo--pre-config-hook'
+ `use-package--foo--post-config-hook'
+
+This way, you can add to these hooks before evaluation of a
+`use-package` declaration, and exercise some control over what
+happens.
+
+NOTE: These hooks are run even if the user does not specify an
+`:init' or `:config' block, and they will happen at the regular
+time when initialization and configuration would have been
+performed.
+
+NOTE: If the `pre-init' hook return a nil value, that block's
+user-supplied configuration is not evaluated, so be certain to
+return t if you only wish to add behavior to what the user had
+specified."
+ :type 'boolean
+ :group 'use-package)
+
+(defcustom use-package-expand-minimally nil
+ "If non-nil, make the expanded code as minimal as possible.
+This disables:
+
+ - Printing to the *Messages* buffer of slowly-evaluating forms
+ - Capturing of load errors (normally redisplayed as warnings)
+ - Conditional loading of packages (load failures become errors)
+
+The main advantage to this variable is that, if you know your
+configuration works, it will make the byte-compiled file as
+minimal as possible. It can also help with reading macro-expanded
+definitions, to understand the main intent of what's happening."
+ :type 'boolean
+ :group 'use-package)
+
+(defcustom use-package-form-regexp-eval
+ `(concat ,(eval-when-compile
+ (concat "^\\s-*("
+ (regexp-opt '("use-package" "require") t)
+ "\\s-+\\("))
+ (or (bound-and-true-p lisp-mode-symbol-regexp)
+ "\\(?:\\sw\\|\\s_\\|\\\\.\\)+") "\\)")
+ "Sexp providing regexp for finding use-package forms in user files.
+This is used by `use-package-jump-to-package-form' and
+`use-package-enable-imenu-support'."
+ :type 'sexp
+ :group 'use-package)
+
+(defcustom use-package-enable-imenu-support nil
+ "If non-nil, cause imenu to see `use-package' declarations.
+This is done by adjusting `lisp-imenu-generic-expression' to
+include support for finding `use-package' and `require' forms.
+
+Must be set before loading use-package."
+ :type 'boolean
+ :set
+ #'(lambda (_sym value)
+ (eval-after-load 'lisp-mode
+ (if value
+ `(add-to-list 'lisp-imenu-generic-expression
+ (list "Packages" ,use-package-form-regexp-eval 2))
+ `(setq lisp-imenu-generic-expression
+ (remove (list "Packages" ,use-package-form-regexp-eval 2)
+ lisp-imenu-generic-expression)))))
+ :group 'use-package)
+
+(defconst use-package-font-lock-keywords
+ '(("(\\(use-package\\)\\_>[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?"
+ (1 font-lock-keyword-face)
+ (2 font-lock-constant-face nil t))))
+
+(font-lock-add-keywords 'emacs-lisp-mode use-package-font-lock-keywords)
+
+(defcustom use-package-compute-statistics nil
+ "If non-nil, compute statistics concerned use-package declarations.
+View the statistical report using `use-package-report'. Note that
+if this option is enabled, you must require `use-package' in your
+user init file at loadup time, or you will see errors concerning
+undefined variables."
+ :type 'boolean
+ :group 'use-package)
+
+(defvar use-package-statistics (make-hash-table))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Utility functions
+;;
+
+(defsubst use-package-error (msg)
+ "Report MSG as an error, so the user knows it came from this package."
+ (error "use-package: %s" msg))
+
+(defsubst use-package-concat (&rest elems)
+ "Delete all empty lists from ELEMS (nil or (list nil)), and append them."
+ (apply #'append (delete nil (delete (list nil) elems))))
+
+(defsubst use-package-non-nil-symbolp (sym)
+ (and sym (symbolp sym)))
+
+(defsubst use-package-as-symbol (string-or-symbol)
+ "If STRING-OR-SYMBOL is already a symbol, return it. Otherwise
+convert it to a symbol and return that."
+ (if (symbolp string-or-symbol) string-or-symbol
+ (intern string-or-symbol)))
+
+(defsubst use-package-as-string (string-or-symbol)
+ "If STRING-OR-SYMBOL is already a string, return it. Otherwise
+convert it to a string and return that."
+ (if (stringp string-or-symbol) string-or-symbol
+ (symbol-name string-or-symbol)))
+
+(defsubst use-package-regex-p (re)
+ "Return t if RE is some regexp-like thing."
+ (or (and (listp re) (eq (car re) 'rx))
+ (stringp re)))
+
+(defun use-package-normalize-regex (re)
+ "Given some regexp-like thing in RE, resolve to a regular expression."
+ (cond
+ ((and (listp re) (eq (car re) 'rx)) (eval re))
+ ((stringp re) re)
+ (t (error "Not recognized as regular expression: %s" re))))
+
+(defsubst use-package-is-pair (x car-pred cdr-pred)
+ "Return non-nil if X is a cons satisfying the given predicates.
+CAR-PRED and CDR-PRED are applied to X's `car' and `cdr',
+respectively."
+ (and (consp x)
+ (funcall car-pred (car x))
+ (funcall cdr-pred (cdr x))))
+
+(defun use-package-as-mode (string-or-symbol)
+ "If STRING-OR-SYMBOL ends in `-mode' (or its name does), return
+it as a symbol. Otherwise, return it as a symbol with `-mode'
+appended."
+ (let ((string (use-package-as-string string-or-symbol)))
+ (intern (if (string-match "-mode\\'" string)
+ string
+ (concat string "-mode")))))
+
+(defsubst use-package-load-name (name &optional noerror)
+ "Return a form which will load or require NAME.
+It does the right thing no matter if NAME is a string or symbol.
+Argument NOERROR means to indicate load failures as a warning."
+ (if (stringp name)
+ `(load ,name ,noerror)
+ `(require ',name nil ,noerror)))
+
+(defun use-package-hook-injector (name-string keyword body)
+ "Wrap pre/post hook injections around the given BODY for KEYWORD.
+The BODY is a list of forms, so `((foo))' if only `foo' is being called."
+ (if (not use-package-inject-hooks)
+ body
+ (let ((keyword-name (substring (format "%s" keyword) 1)))
+ `((when (run-hook-with-args-until-failure
+ ',(intern (concat "use-package--" name-string
+ "--pre-" keyword-name "-hook")))
+ ,@body
+ (run-hooks
+ ',(intern (concat "use-package--" name-string
+ "--post-" keyword-name "-hook"))))))))
+
+(defun use-package-with-elapsed-timer (text body)
+ "BODY is a list of forms, so `((foo))' if only `foo' is being called."
+ (declare (indent 1))
+ (if use-package-expand-minimally
+ body
+ (let ((nowvar (make-symbol "now")))
+ (if (bound-and-true-p use-package-verbose)
+ `((let ((,nowvar (current-time)))
+ (message "%s..." ,text)
+ (prog1
+ ,(macroexp-progn body)
+ (let ((elapsed
+ (float-time (time-subtract (current-time) ,nowvar))))
+ (if (> elapsed ,use-package-minimum-reported-time)
+ (message "%s...done (%.3fs)" ,text elapsed)
+ (message "%s...done" ,text))))))
+ body))))
+
+(put 'use-package-with-elapsed-timer 'lisp-indent-function 1)
+
+(defun use-package-require (name &optional no-require body)
+ (if use-package-expand-minimally
+ (use-package-concat
+ (unless no-require
+ (list (use-package-load-name name)))
+ body)
+ (if no-require
+ body
+ (use-package-with-elapsed-timer
+ (format "Loading package %s" name)
+ `((if (not ,(use-package-load-name name t))
+ (display-warning 'use-package
+ (format "Cannot load %s" ',name)
+ :error)
+ ,@body))))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Property lists
+;;
+
+(defun use-package-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 use-package-plist-delete-first (plist property)
+ "Delete PROPERTY from PLIST.
+This is in contrast to merely setting it to 0."
+ (let (p)
+ (while plist
+ (if (eq property (car plist))
+ (setq p (nconc p (cddr plist))
+ plist nil)
+ (setq p (nconc p (list (car plist) (cadr plist)))
+ plist (cddr plist))))
+ p))
+
+(defsubst use-package-plist-maybe-put (plist property value)
+ "Add a VALUE for PROPERTY to PLIST, if it does not already exist."
+ (if (plist-member plist property)
+ plist
+ (plist-put plist property value)))
+
+(defsubst use-package-plist-cons (plist property value)
+ "Cons VALUE onto the head of the list at PROPERTY in PLIST."
+ (plist-put plist property (cons value (plist-get plist property))))
+
+(defsubst use-package-plist-append (plist property value)
+ "Append VALUE onto the front of the list at PROPERTY in PLIST."
+ (plist-put plist property (append value (plist-get plist property))))
+
+(defun use-package-split-list (pred xs)
+ (let ((ys (list nil)) (zs (list nil)) flip)
+ (cl-dolist (x xs)
+ (if flip
+ (nconc zs (list x))
+ (if (funcall pred x)
+ (progn
+ (setq flip t)
+ (nconc zs (list x)))
+ (nconc ys (list x)))))
+ (cons (cdr ys) (cdr zs))))
+
+(defun use-package-split-list-at-keys (key lst)
+ (and lst
+ (let ((xs (use-package-split-list (apply-partially #'eq key) lst)))
+ (cons (car xs) (use-package-split-list-at-keys key (cddr xs))))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Keywords
+;;
+
+(defun use-package-keyword-index (keyword)
+ (cl-loop named outer
+ with index = 0
+ for k in use-package-keywords do
+ (if (eq k keyword)
+ (cl-return-from outer index))
+ (cl-incf index)))
+
+(defun use-package-normalize-plist (name input &optional plist merge-function)
+ "Given a pseudo-plist, normalize it to a regular plist.
+The normalized key/value pairs from input are added to PLIST,
+extending any keys already present."
+ (if (null input)
+ plist
+ (let* ((keyword (car input))
+ (xs (use-package-split-list #'keywordp (cdr input)))
+ (args (car xs))
+ (tail (cdr xs))
+ (normalizer
+ (intern-soft (concat "use-package-normalize/"
+ (symbol-name keyword))))
+ (arg (and (functionp normalizer)
+ (funcall normalizer name keyword args)))
+ (error-string (format "Unrecognized keyword: %s" keyword)))
+ (if (memq keyword use-package-keywords)
+ (progn
+ (setq plist (use-package-normalize-plist
+ name tail plist merge-function))
+ (plist-put plist keyword
+ (if (plist-member plist keyword)
+ (funcall merge-function keyword arg
+ (plist-get plist keyword))
+ arg)))
+ (if use-package-ignore-unknown-keywords
+ (progn
+ (display-warning 'use-package error-string)
+ (use-package-normalize-plist
+ name tail plist merge-function))
+ (use-package-error error-string))))))
+
+(defun use-package-unalias-keywords (_name args)
+ (setq args (cl-nsubstitute :if :when args))
+ (let (temp)
+ (while (setq temp (plist-get args :unless))
+ (setq args (use-package-plist-delete-first args :unless)
+ args (append args `(:if (not ,temp))))))
+ args)
+
+(defun use-package-merge-keys (key new old)
+ (let ((merger (assq key use-package-merge-key-alist)))
+ (if merger
+ (funcall (cdr merger) new old)
+ (append new old))))
+
+(defun use-package-sort-keywords (plist)
+ (let (plist-grouped)
+ (while plist
+ (push (cons (car plist) (cadr plist))
+ plist-grouped)
+ (setq plist (cddr plist)))
+ (let (result)
+ (cl-dolist
+ (x
+ (nreverse
+ (sort plist-grouped
+ #'(lambda (l r) (< (use-package-keyword-index (car l))
+ (use-package-keyword-index (car r)))))))
+ (setq result (cons (car x) (cons (cdr x) result))))
+ result)))
+
+(defun use-package-normalize-keywords (name args)
+ (let* ((name-symbol (if (stringp name) (intern name) name))
+ (name-string (symbol-name name-symbol)))
+
+ ;; The function `elisp--local-variables' inserts this unbound variable into
+ ;; macro forms to determine the locally bound variables for
+ ;; `elisp-completion-at-point'. It ends up throwing a lot of errors since it
+ ;; can occupy the position of a keyword (or look like a second argument to a
+ ;; keyword that takes one). Deleting it when it's at the top level should be
+ ;; harmless since there should be no locally bound variables to discover
+ ;; here anyway.
+ (setq args (delq 'elisp--witness--lisp args))
+
+ ;; Reduce the set of keywords down to its most fundamental expression.
+ (setq args (use-package-unalias-keywords name-symbol args))
+
+ ;; Normalize keyword values, coalescing multiple occurrences.
+ (setq args (use-package-normalize-plist name-symbol args nil
+ #'use-package-merge-keys))
+
+ ;; Add default values for keywords not specified, when applicable.
+ (cl-dolist (spec use-package-defaults)
+ (when (let ((func (nth 2 spec)))
+ (if (and func (functionp func))
+ (funcall func name args)
+ (eval func)))
+ (setq args (use-package-plist-maybe-put
+ args (nth 0 spec)
+ (let ((func (nth 1 spec)))
+ (if (and func (functionp func))
+ (funcall func name args)
+ (eval func)))))))
+
+ ;; Determine any autoloads implied by the keywords used.
+ (let ((iargs args)
+ commands)
+ (while iargs
+ (when (keywordp (car iargs))
+ (let ((autoloads
+ (intern-soft (concat "use-package-autoloads/"
+ (symbol-name (car iargs))))))
+ (when (functionp autoloads)
+ (setq commands
+ ;; jww (2017-12-07): Right now we just ignored the type of
+ ;; the autoload being requested, and assume they are all
+ ;; `command'.
+ (append (mapcar
+ #'car
+ (funcall autoloads name-symbol (car iargs)
+ (cadr iargs)))
+ commands)))))
+ (setq iargs (cddr iargs)))
+ (when commands
+ (setq args
+ ;; Like `use-package-plist-append', but removing duplicates.
+ (plist-put args :commands
+ (delete-dups
+ (append commands (plist-get args :commands)))))))
+
+ ;; If byte-compiling, pre-load the package so all its symbols are in
+ ;; scope. This is done by prepending statements to the :preface.
+ (when (bound-and-true-p byte-compile-current-file)
+ (setq args
+ (use-package-plist-append
+ args :preface
+ (use-package-concat
+ (mapcar #'(lambda (var) `(defvar ,var))
+ (plist-get args :defines))
+ (mapcar #'(lambda (fn) `(declare-function ,fn ,name-string))
+ (plist-get args :functions))
+ `((eval-when-compile
+ (with-demoted-errors
+ ,(format "Cannot load %s: %%S" name-string)
+ ,(when (eq use-package-verbose 'debug)
+ `(message ,(format "Compiling package %s" name-string)))
+ ,(unless (plist-get args :no-require)
+ `(unless (featurep ',name-symbol)
+ (load ,name-string nil t))))))))))
+
+ ;; Certain keywords imply :defer, if :demand was not specified.
+ (when (and (not (plist-member args :demand))
+ (not (plist-member args :defer))
+ (not (or (equal '(t) (plist-get args :load))
+ (equal (list (use-package-as-string name))
+ (mapcar #'use-package-as-string
+ (plist-get args :load)))))
+ (cl-some #'identity
+ (mapcar (apply-partially #'plist-member args)
+ use-package-deferring-keywords)))
+ (setq args (append args '(:defer t))))
+
+ ;; The :load keyword overrides :no-require
+ (when (and (plist-member args :load)
+ (plist-member args :no-require))
+ (setq args (use-package-plist-delete args :no-require)))
+
+ ;; If at this point no :load, :defer or :no-require has been seen, then
+ ;; :load the package itself.
+ (when (and (not (plist-member args :load))
+ (not (plist-member args :defer))
+ (not (plist-member args :no-require)))
+ (setq args (append args `(:load (,name)))))
+
+ ;; Sort the list of keywords based on the order of `use-package-keywords'.
+ (use-package-sort-keywords args)))
+
+(defun use-package-process-keywords (name plist &optional state)
+ "Process the next keyword in the free-form property list PLIST.
+The values in the PLIST have each been normalized by the function
+use-package-normalize/KEYWORD (minus the colon).
+
+STATE is a property list that the function may modify and/or
+query. This is useful if a package defines multiple keywords and
+wishes them to have some kind of stateful interaction.
+
+Unless the KEYWORD being processed intends to ignore remaining
+keywords, it must call this function recursively, passing in the
+plist with its keyword and argument removed, and passing in the
+next value for the STATE."
+ (declare (indent 1))
+ (unless (null plist)
+ (let* ((keyword (car plist))
+ (arg (cadr plist))
+ (rest (cddr plist)))
+ (unless (keywordp keyword)
+ (use-package-error (format "%s is not a keyword" keyword)))
+ (let* ((handler (concat "use-package-handler/" (symbol-name keyword)))
+ (handler-sym (intern handler)))
+ (if (functionp handler-sym)
+ (funcall handler-sym name keyword arg rest state)
+ (use-package-error
+ (format "Keyword handler not defined: %s" handler)))))))
+
+(put 'use-package-process-keywords 'lisp-indent-function 'defun)
+
+(defun use-package-list-insert (elem xs &optional anchor after test)
+ "Insert ELEM into the list XS.
+If ANCHOR is also a keyword, place the new KEYWORD before that
+one.
+If AFTER is non-nil, insert KEYWORD either at the end of the
+keywords list, or after the ANCHOR if one has been provided.
+If TEST is non-nil, it is the test used to compare ELEM to list
+elements. The default is `eq'.
+The modified list is returned. The original list is not modified."
+ (let (result)
+ (dolist (k xs)
+ (if (funcall (or test #'eq) k anchor)
+ (if after
+ (setq result (cons k result)
+ result (cons elem result))
+ (setq result (cons elem result)
+ result (cons k result)))
+ (setq result (cons k result))))
+ (if anchor
+ (nreverse result)
+ (if after
+ (nreverse (cons elem result))
+ (cons elem (nreverse result))))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Argument Processing
+;;
+
+(defun use-package-only-one (label args f)
+ "Call F on the first member of ARGS if it has exactly one element."
+ (declare (indent 1))
+ (cond
+ ((and (listp args) (listp (cdr args))
+ (= (length args) 1))
+ (funcall f label (car args)))
+ (t
+ (use-package-error
+ (concat label " wants exactly one argument")))))
+
+(put 'use-package-only-one 'lisp-indent-function 'defun)
+
+(defun use-package-as-one (label args f &optional allow-empty)
+ "Call F on the first element of ARGS if it has one element, or all of ARGS.
+If ALLOW-EMPTY is non-nil, it's OK for ARGS to be an empty list."
+ (declare (indent 1))
+ (if (if args
+ (and (listp args) (listp (cdr args)))
+ allow-empty)
+ (if (= (length args) 1)
+ (funcall f label (car args))
+ (funcall f label args))
+ (use-package-error
+ (concat label " wants a non-empty list"))))
+
+(put 'use-package-as-one 'lisp-indent-function 'defun)
+
+(defun use-package-memoize (f arg)
+ "Ensure the macro-expansion of F applied to ARG evaluates ARG
+no more than once."
+ (let ((loaded (cl-gentemp "use-package--loaded"))
+ (result (cl-gentemp "use-package--result"))
+ (next (cl-gentemp "use-package--next")))
+ `((defvar ,loaded nil)
+ (defvar ,result nil)
+ (defvar ,next #'(lambda () (if ,loaded ,result
+ (setq ,loaded t ,result ,arg))))
+ ,@(funcall f `((funcall ,next))))))
+
+(defsubst use-package-normalize-value (_label arg)
+ "Normalize the Lisp value given by ARG.
+The argument LABEL is ignored."
+ (cond ((null arg) nil)
+ ((eq t arg) t)
+ ((use-package-non-nil-symbolp arg)
+ `(symbol-value ',arg))
+ ((functionp arg)
+ `(funcall #',arg))
+ (t arg)))
+
+(defun use-package-normalize-symbols (label arg &optional recursed)
+ "Normalize a list of symbols."
+ (cond
+ ((use-package-non-nil-symbolp arg)
+ (list arg))
+ ((and (not recursed) (listp arg) (listp (cdr arg)))
+ (mapcar #'(lambda (x) (car (use-package-normalize-symbols label x t))) arg))
+ (t
+ (use-package-error
+ (concat label " wants a symbol, or list of symbols")))))
+
+(defun use-package-normalize-symlist (_name keyword args)
+ (use-package-as-one (symbol-name keyword) args
+ #'use-package-normalize-symbols))
+
+(defun use-package-normalize-recursive-symbols (label arg)
+ "Normalize a list of symbols."
+ (cond
+ ((use-package-non-nil-symbolp arg)
+ arg)
+ ((and (listp arg) (listp (cdr arg)))
+ (mapcar #'(lambda (x) (use-package-normalize-recursive-symbols label x))
+ arg))
+ (t
+ (use-package-error
+ (concat label " wants a symbol, or nested list of symbols")))))
+
+(defun use-package-normalize-recursive-symlist (_name keyword args)
+ (use-package-as-one (symbol-name keyword) args
+ #'use-package-normalize-recursive-symbols))
+
+(defun use-package-normalize-paths (label arg &optional recursed)
+ "Normalize a list of filesystem paths."
+ (cond
+ ((and arg (or (use-package-non-nil-symbolp arg) (functionp arg)))
+ (let ((value (use-package-normalize-value label arg)))
+ (use-package-normalize-paths label (eval value))))
+ ((stringp arg)
+ (let ((path (if (file-name-absolute-p arg)
+ arg
+ (expand-file-name arg user-emacs-directory))))
+ (list path)))
+ ((and (not recursed) (listp arg) (listp (cdr arg)))
+ (mapcar #'(lambda (x)
+ (car (use-package-normalize-paths label x t))) arg))
+ (t
+ (use-package-error
+ (concat label " wants a directory path, or list of paths")))))
+
+(defun use-package-normalize-predicate (_name keyword args)
+ (if (null args)
+ t
+ (use-package-only-one (symbol-name keyword) args
+ #'use-package-normalize-value)))
+
+(defun use-package-normalize-form (label args)
+ "Given a list of forms, return it wrapped in `progn'."
+ (unless (listp (car args))
+ (use-package-error (concat label " wants a sexp or list of sexps")))
+ (mapcar #'(lambda (form)
+ (if (and (consp form)
+ (memq (car form)
+ '(use-package bind-key bind-key*
+ unbind-key bind-keys bind-keys*)))
+ (macroexpand form)
+ form)) args))
+
+(defun use-package-normalize-forms (_name keyword args)
+ (use-package-normalize-form (symbol-name keyword) args))
+
+(defun use-package-normalize-pairs
+ (key-pred val-pred name label arg &optional recursed)
+ "Normalize a list of pairs.
+KEY-PRED and VAL-PRED are predicates recognizing valid keys and
+values, respectively.
+If RECURSED is non-nil, recurse into sublists."
+ (cond
+ ((funcall key-pred arg)
+ (list (cons arg (use-package-as-symbol name))))
+ ((use-package-is-pair arg key-pred val-pred)
+ (list arg))
+ ((and (not recursed) (listp arg) (listp (cdr arg)))
+ (let (last-item)
+ (mapcar
+ #'(lambda (x)
+ (prog1
+ (let ((ret (use-package-normalize-pairs
+ key-pred val-pred name label x t)))
+ (if (and (listp ret)
+ (not (keywordp last-item)))
+ (car ret)
+ ret))
+ (setq last-item x))) arg)))
+ (t arg)))
+
+(defun use-package-recognize-function (v &optional binding additional-pred)
+ "A predicate that recognizes functional constructions:
+ nil
+ sym
+ 'sym
+ (quote sym)
+ #'sym
+ (function sym)
+ (lambda () ...)
+ '(lambda () ...)
+ (quote (lambda () ...))
+ #'(lambda () ...)
+ (function (lambda () ...))"
+ (or (if binding
+ (symbolp v)
+ (use-package-non-nil-symbolp v))
+ (and (listp v)
+ (memq (car v) '(quote function))
+ (use-package-non-nil-symbolp (cadr v)))
+ (if binding (commandp v) (functionp v))
+ (and additional-pred
+ (funcall additional-pred v))))
+
+(defun use-package-normalize-function (v)
+ "Reduce functional constructions to one of two normal forms:
+ sym
+ #'(lambda () ...)"
+ (cond ((symbolp v) v)
+ ((and (listp v)
+ (memq (car v) '(quote function))
+ (use-package-non-nil-symbolp (cadr v)))
+ (cadr v))
+ ((and (consp v)
+ (eq 'lambda (car v)))
+ v)
+ ((and (listp v)
+ (memq (car v) '(quote function))
+ (eq 'lambda (car (cadr v))))
+ (cadr v))
+ (t v)))
+
+(defun use-package-normalize-commands (args)
+ "Map over ARGS of the form ((_ . F) ...), normalizing functional F's."
+ (mapcar #'(lambda (x)
+ (if (consp x)
+ (cons (car x) (use-package-normalize-function (cdr x)))
+ x))
+ args))
+
+(defun use-package-normalize-mode (name keyword args)
+ "Normalize arguments for keywords which add regexp/mode pairs to an alist."
+ (use-package-as-one (symbol-name keyword) args
+ (apply-partially #'use-package-normalize-pairs
+ #'use-package-regex-p
+ #'use-package-recognize-function
+ name)))
+
+(defun use-package-autoloads-mode (_name _keyword args)
+ (mapcar
+ #'(lambda (x) (cons (cdr x) 'command))
+ (cl-remove-if-not #'(lambda (x)
+ (and (consp x)
+ (use-package-non-nil-symbolp (cdr x))))
+ args)))
+
+(defun use-package-handle-mode (name alist args rest state)
+ "Handle keywords which add regexp/mode pairs to an alist."
+ (use-package-concat
+ (use-package-process-keywords name rest state)
+ (mapcar
+ #'(lambda (thing)
+ `(add-to-list
+ ',alist
+ ',(cons (use-package-normalize-regex (car thing))
+ (cdr thing))))
+ (use-package-normalize-commands args))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Statistics
+;;
+
+(defun use-package-reset-statistics ()
+ (interactive)
+ (setq use-package-statistics (make-hash-table)))
+
+(defun use-package-statistics-status (package)
+ "Return loading configuration status of PACKAGE statistics."
+ (cond ((gethash :config package) "Configured")
+ ((gethash :init package) "Initialized")
+ ((gethash :preface package) "Prefaced")
+ ((gethash :use-package package) "Declared")))
+
+(defun use-package-statistics-last-event (package)
+ "Return the date when PACKAGE's status last changed.
+The date is returned as a string."
+ (format-time-string "%Y-%m-%d %a %H:%M"
+ (or (gethash :config package)
+ (gethash :init package)
+ (gethash :preface package)
+ (gethash :use-package package))))
+
+(defun use-package-statistics-time (package)
+ "Return the time is took for PACKAGE to load."
+ (+ (float-time (gethash :config-secs package '(0 0 0 0)))
+ (float-time (gethash :init-secs package '(0 0 0 0)))
+ (float-time (gethash :preface-secs package '(0 0 0 0)))
+ (float-time (gethash :use-package-secs package '(0 0 0 0)))))
+
+(defun use-package-statistics-convert (package)
+ "Return information about PACKAGE.
+
+The information is formatted in a way suitable for
+`use-package-statistics-mode'."
+ (let ((statistics (gethash package use-package-statistics)))
+ (list
+ package
+ (vector
+ (symbol-name package)
+ (use-package-statistics-status statistics)
+ (use-package-statistics-last-event statistics)
+ (format "%.2f" (use-package-statistics-time statistics))))))
+
+(defun use-package-report ()
+ "Show current statistics gathered about use-package declarations.
+In the table that's generated, the status field has the following
+meaning:
+ Configured :config has been processed (the package is loaded!)
+ Initialized :init has been processed (load status unknown)
+ Prefaced :preface has been processed
+ Declared the use-package declaration was seen"
+ (interactive)
+ (with-current-buffer (get-buffer-create "*use-package statistics*")
+ (setq tabulated-list-entries
+ (mapcar #'use-package-statistics-convert
+ (hash-table-keys use-package-statistics)))
+ (use-package-statistics-mode)
+ (tabulated-list-print)
+ (display-buffer (current-buffer))))
+
+(define-derived-mode use-package-statistics-mode tabulated-list-mode
+ "use-package statistics"
+ "Show current statistics gathered about use-package declarations."
+ (setq tabulated-list-format
+ ;; The sum of column width is 80 characters:
+ [("Package" 25 t)
+ ("Status" 13 t)
+ ("Last Event" 23 t)
+ ("Time" 10 t)])
+ (tabulated-list-init-header))
+
+(defun use-package-statistics-gather (keyword name after)
+ (let* ((hash (gethash name use-package-statistics
+ (make-hash-table)))
+ (before (and after (gethash keyword hash (current-time)))))
+ (puthash keyword (current-time) hash)
+ (when after
+ (puthash (intern (concat (symbol-name keyword) "-secs"))
+ (time-subtract (current-time) before) hash))
+ (puthash name hash use-package-statistics)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Handlers
+;;
+
+;;;; :disabled
+
+;; Don't alias this to `ignore', as that will cause the resulting
+;; function to be interactive.
+(defun use-package-normalize/:disabled (_name _keyword _arg)
+ "Do nothing, return nil.")
+
+(defun use-package-handler/:disabled (name _keyword _arg rest state)
+ (use-package-process-keywords name rest state))
+
+;;;; :if, :when and :unless
+
+(defun use-package-normalize-test (_name keyword args)
+ (use-package-only-one (symbol-name keyword) args
+ #'use-package-normalize-value))
+
+(defalias 'use-package-normalize/:if 'use-package-normalize-test)
+
+(defun use-package-handler/:if (name _keyword pred rest state)
+ (let ((body (use-package-process-keywords name rest state)))
+ `((when ,pred ,@body))))
+
+(defalias 'use-package-normalize/:when 'use-package-normalize-test)
+
+(defalias 'use-package-handler/:when 'use-package-handler/:if)
+
+(defalias 'use-package-normalize/:unless 'use-package-normalize-test)
+
+(defun use-package-handler/:unless (name _keyword pred rest state)
+ (let ((body (use-package-process-keywords name rest state)))
+ `((unless ,pred ,@body))))
+
+;;;; :requires
+
+(defalias 'use-package-normalize/:requires 'use-package-normalize-symlist)
+
+(defun use-package-handler/:requires (name _keyword requires rest state)
+ (let ((body (use-package-process-keywords name rest state)))
+ (if (null requires)
+ body
+ `((when ,(if (> (length requires) 1)
+ `(not (member nil (mapcar #'featurep ',requires)))
+ `(featurep ',(car requires)))
+ ,@body)))))
+
+;;;; :load-path
+
+(defun use-package-normalize/:load-path (_name keyword args)
+ (use-package-as-one (symbol-name keyword) args
+ #'use-package-normalize-paths))
+
+(defun use-package-handler/:load-path (name _keyword arg rest state)
+ (let ((body (use-package-process-keywords name rest state)))
+ (use-package-concat
+ (mapcar #'(lambda (path)
+ `(eval-and-compile (add-to-list 'load-path ,path)))
+ arg)
+ body)))
+
+;;;; :no-require
+
+(defalias 'use-package-normalize/:no-require 'use-package-normalize-predicate)
+
+(defun use-package-handler/:no-require (name _keyword _arg rest state)
+ (use-package-process-keywords name rest state))
+
+;;;; :defines
+
+(defalias 'use-package-normalize/:defines 'use-package-normalize-symlist)
+
+(defun use-package-handler/:defines (name _keyword _arg rest state)
+ (use-package-process-keywords name rest state))
+
+;;;; :functions
+
+(defalias 'use-package-normalize/:functions 'use-package-normalize-symlist)
+
+(defun use-package-handler/:functions (name _keyword _arg rest state)
+ (use-package-process-keywords name rest state))
+
+;;;; :preface
+
+(defalias 'use-package-normalize/:preface 'use-package-normalize-forms)
+
+(defun use-package-handler/:preface (name _keyword arg rest state)
+ (let ((body (use-package-process-keywords name rest state)))
+ (use-package-concat
+ (when use-package-compute-statistics
+ `((use-package-statistics-gather :preface ',name nil)))
+ (when arg
+ `((eval-and-compile ,@arg)))
+ body
+ (when use-package-compute-statistics
+ `((use-package-statistics-gather :preface ',name t))))))
+
+;;;; :catch
+
+(defvar use-package--form)
+(defvar use-package--hush-function #'(lambda (_keyword body) body))
+
+(defsubst use-package-hush (context keyword body)
+ `((condition-case-unless-debug err
+ ,(macroexp-progn body)
+ (error (funcall ,context ,keyword err)))))
+
+(defun use-package-normalize/:catch (_name keyword args)
+ (if (null args)
+ t
+ (use-package-only-one (symbol-name keyword) args
+ use-package--hush-function)))
+
+(defun use-package-handler/:catch (name keyword arg rest state)
+ (let* ((context (cl-gentemp "use-package--warning")))
+ (cond
+ ((not arg)
+ (use-package-process-keywords name rest state))
+ ((eq arg t)
+ `((defvar ,context
+ #'(lambda (keyword err)
+ (let ((msg (format "%s/%s: %s" ',name keyword
+ (error-message-string err))))
+ ,@(when (eq use-package-verbose 'debug)
+ `((with-current-buffer
+ (get-buffer-create "*use-package*")
+ (goto-char (point-max))
+ (insert "-----\n" msg ,use-package--form)
+ (emacs-lisp-mode))
+ (setq msg
+ (concat msg
+ " (see the *use-package* buffer)"))))
+ (display-warning 'use-package msg :error))))
+ ,@(let ((use-package--hush-function
+ (apply-partially #'use-package-hush context)))
+ (funcall use-package--hush-function keyword
+ (use-package-process-keywords name rest state)))))
+ ((functionp arg)
+ `((defvar ,context ,arg)
+ ,@(let ((use-package--hush-function
+ (apply-partially #'use-package-hush context)))
+ (funcall use-package--hush-function keyword
+ (use-package-process-keywords name rest state)))))
+ (t
+ (use-package-error "The :catch keyword expects 't' or a function")))))
+
+;;;; :interpreter
+
+(defalias 'use-package-normalize/:interpreter 'use-package-normalize-mode)
+(defalias 'use-package-autoloads/:interpreter 'use-package-autoloads-mode)
+
+(defun use-package-handler/:interpreter (name _keyword arg rest state)
+ (use-package-handle-mode name 'interpreter-mode-alist arg rest state))
+
+;;;; :mode
+
+(defalias 'use-package-normalize/:mode 'use-package-normalize-mode)
+(defalias 'use-package-autoloads/:mode 'use-package-autoloads-mode)
+
+(defun use-package-handler/:mode (name _keyword arg rest state)
+ (use-package-handle-mode name 'auto-mode-alist arg rest state))
+
+;;;; :magic
+
+(defalias 'use-package-normalize/:magic 'use-package-normalize-mode)
+(defalias 'use-package-autoloads/:magic 'use-package-autoloads-mode)
+
+(defun use-package-handler/:magic (name _keyword arg rest state)
+ (use-package-handle-mode name 'magic-mode-alist arg rest state))
+
+;;;; :magic-fallback
+
+(defalias 'use-package-normalize/:magic-fallback 'use-package-normalize-mode)
+(defalias 'use-package-autoloads/:magic-fallback 'use-package-autoloads-mode)
+
+(defun use-package-handler/:magic-fallback (name _keyword arg rest state)
+ (use-package-handle-mode name 'magic-fallback-mode-alist arg rest state))
+
+;;;; :hook
+
+(defun use-package-normalize/:hook (name keyword args)
+ (use-package-as-one (symbol-name keyword) args
+ #'(lambda (label arg)
+ (unless (or (use-package-non-nil-symbolp arg) (consp arg))
+ (use-package-error
+ (concat label " a <symbol> or (<symbol or list of symbols> . <symbol or function>)"
+ " or list of these")))
+ (use-package-normalize-pairs
+ #'(lambda (k)
+ (or (use-package-non-nil-symbolp k)
+ (and k (let ((every t))
+ (while (and every k)
+ (if (and (consp k)
+ (use-package-non-nil-symbolp (car k)))
+ (setq k (cdr k))
+ (setq every nil)))
+ every))))
+ #'use-package-recognize-function
+ name label arg))))
+
+(defalias 'use-package-autoloads/:hook 'use-package-autoloads-mode)
+
+(defun use-package-handler/:hook (name _keyword args rest state)
+ "Generate use-package custom keyword code."
+ (use-package-concat
+ (use-package-process-keywords name rest state)
+ (cl-mapcan
+ #'(lambda (def)
+ (let ((syms (car def))
+ (fun (cdr def)))
+ (when fun
+ (mapcar
+ #'(lambda (sym)
+ `(add-hook
+ (quote ,(intern
+ (concat (symbol-name sym)
+ use-package-hook-name-suffix)))
+ (function ,fun)))
+ (if (use-package-non-nil-symbolp syms) (list syms) syms)))))
+ (use-package-normalize-commands args))))
+
+;;;; :commands
+
+(defalias 'use-package-normalize/:commands 'use-package-normalize-symlist)
+
+(defun use-package-handler/:commands (name _keyword arg rest state)
+ (use-package-concat
+ ;; Since we deferring load, establish any necessary autoloads, and also
+ ;; keep the byte-compiler happy.
+ (let ((name-string (use-package-as-string name)))
+ (cl-mapcan
+ #'(lambda (command)
+ (when (symbolp command)
+ (append
+ (unless (plist-get state :demand)
+ `((unless (fboundp ',command)
+ (autoload #',command ,name-string nil t))))
+ (when (bound-and-true-p byte-compile-current-file)
+ `((eval-when-compile
+ (declare-function ,command ,name-string)))))))
+ (delete-dups arg)))
+ (use-package-process-keywords name rest state)))
+
+;;;; :defer
+
+(defalias 'use-package-normalize/:defer 'use-package-normalize-predicate)
+
+(defun use-package-handler/:defer (name _keyword arg rest state)
+ (let ((body (use-package-process-keywords name rest state)))
+ (use-package-concat
+ ;; Load the package after a set amount of idle time, if the argument to
+ ;; `:defer' was a number.
+ (when (numberp arg)
+ `((run-with-idle-timer ,arg nil #'require
+ ',(use-package-as-symbol name) nil t)))
+ (if (or (not arg) (null body))
+ body
+ `((eval-after-load ',name ',(macroexp-progn body)))))))
+
+;;;; :after
+
+(defun use-package-normalize/:after (name keyword args)
+ (setq args (use-package-normalize-recursive-symlist name keyword args))
+ (if (consp args)
+ args
+ (list args)))
+
+(defun use-package-after-count-uses (features*)
+ "Count the number of time the body would appear in the result."
+ (cond ((use-package-non-nil-symbolp features*)
+ 1)
+ ((and (consp features*)
+ (memq (car features*) '(:or :any)))
+ (let ((num 0))
+ (cl-dolist (next (cdr features*))
+ (setq num (+ num (use-package-after-count-uses next))))
+ num))
+ ((and (consp features*)
+ (memq (car features*) '(:and :all)))
+ (apply #'max (mapcar #'use-package-after-count-uses
+ (cdr features*))))
+ ((listp features*)
+ (use-package-after-count-uses (cons :all features*)))))
+
+(defun use-package-require-after-load (features* body)
+ "Generate `eval-after-load' statements to represents FEATURES*.
+FEATURES* is a list containing keywords `:and' and `:all', where
+no keyword implies `:all'."
+ (cond
+ ((use-package-non-nil-symbolp features*)
+ `((eval-after-load ',features* ',(macroexp-progn body))))
+ ((and (consp features*)
+ (memq (car features*) '(:or :any)))
+ (cl-mapcan #'(lambda (x) (use-package-require-after-load x body))
+ (cdr features*)))
+ ((and (consp features*)
+ (memq (car features*) '(:and :all)))
+ (cl-dolist (next (cdr features*))
+ (setq body (use-package-require-after-load next body)))
+ body)
+ ((listp features*)
+ (use-package-require-after-load (cons :all features*) body))))
+
+(defun use-package-handler/:after (name _keyword arg rest state)
+ (let ((body (use-package-process-keywords name rest state))
+ (uses (use-package-after-count-uses arg)))
+ (if (or (null uses) (null body))
+ body
+ (if (<= uses 1)
+ (use-package-require-after-load arg body)
+ (use-package-memoize
+ (apply-partially #'use-package-require-after-load arg)
+ (macroexp-progn body))))))
+
+;;;; :demand
+
+(defalias 'use-package-normalize/:demand 'use-package-normalize-predicate)
+
+(defun use-package-handler/:demand (name _keyword _arg rest state)
+ (use-package-process-keywords name rest state))
+
+;;;; :custom
+
+(defun use-package-normalize/:custom (_name keyword args)
+ "Normalize use-package custom keyword."
+ (use-package-as-one (symbol-name keyword) args
+ #'(lambda (label arg)
+ (unless (listp arg)
+ (use-package-error
+ (concat label " a (<symbol> <value> [comment])"
+ " or list of these")))
+ (if (use-package-non-nil-symbolp (car arg))
+ (list arg)
+ arg))))
+
+(defun use-package-handler/:custom (name _keyword args rest state)
+ "Generate use-package custom keyword code."
+ (use-package-concat
+ (if (bound-and-true-p use-package-use-theme)
+ `((let ((custom--inhibit-theme-enable nil))
+ ;; Declare the theme here so use-package can be required inside
+ ;; eval-and-compile without warnings about unknown theme.
+ (unless (memq 'use-package custom-known-themes)
+ (deftheme use-package)
+ (enable-theme 'use-package)
+ (setq custom-enabled-themes (remq 'use-package custom-enabled-themes)))
+ (custom-theme-set-variables
+ 'use-package
+ ,@(mapcar
+ #'(lambda (def)
+ (let ((variable (nth 0 def))
+ (value (nth 1 def))
+ (comment (nth 2 def)))
+ (unless (and comment (stringp comment))
+ (setq comment (format "Customized with use-package %s" name)))
+ `'(,variable ,value nil () ,comment)))
+ args))))
+ (mapcar
+ #'(lambda (def)
+ (let ((variable (nth 0 def))
+ (value (nth 1 def))
+ (comment (nth 2 def)))
+ (unless (and comment (stringp comment))
+ (setq comment (format "Customized with use-package %s" name)))
+ `(customize-set-variable (quote ,variable) ,value ,comment)))
+ args))
+ (use-package-process-keywords name rest state)))
+
+;;;; :custom-face
+
+(defun use-package-normalize/:custom-face (name-symbol _keyword arg)
+ "Normalize use-package custom-face keyword."
+ (let ((error-msg
+ (format "%s wants a (<symbol> <face-spec>) or list of these"
+ name-symbol)))
+ (unless (listp arg)
+ (use-package-error error-msg))
+ (cl-dolist (def arg arg)
+ (unless (listp def)
+ (use-package-error error-msg))
+ (let ((face (nth 0 def))
+ (spec (nth 1 def)))
+ (when (or (not face)
+ (not spec)
+ (> (length def) 2))
+ (use-package-error error-msg))))))
+
+(defun use-package-handler/:custom-face (name _keyword args rest state)
+ "Generate use-package custom-face keyword code."
+ (use-package-concat
+ (mapcar #'(lambda (def) `(custom-set-faces (backquote ,def))) args)
+ (use-package-process-keywords name rest state)))
+
+;;;; :init
+
+(defalias 'use-package-normalize/:init 'use-package-normalize-forms)
+
+(defun use-package-handler/:init (name _keyword arg rest state)
+ (use-package-concat
+ (when use-package-compute-statistics
+ `((use-package-statistics-gather :init ',name nil)))
+ (let ((init-body
+ (use-package-hook-injector (use-package-as-string name)
+ :init arg)))
+ (when init-body
+ (funcall use-package--hush-function :init
+ (if use-package-check-before-init
+ `((when (locate-library ,(use-package-as-string name))
+ ,@init-body))
+ init-body))))
+ (use-package-process-keywords name rest state)
+ (when use-package-compute-statistics
+ `((use-package-statistics-gather :init ',name t)))))
+
+;;;; :load
+
+(defun use-package-normalize/:load (name keyword args)
+ (setq args (use-package-normalize-recursive-symlist name keyword args))
+ (if (consp args)
+ args
+ (list args)))
+
+(defun use-package-handler/:load (name _keyword arg rest state)
+ (let ((body (use-package-process-keywords name rest state)))
+ (cl-dolist (pkg arg)
+ (setq body (use-package-require (if (eq t pkg) name pkg) nil body)))
+ body))
+
+;;;; :config
+
+(defalias 'use-package-normalize/:config 'use-package-normalize-forms)
+
+(defun use-package-handler/:config (name _keyword arg rest state)
+ (let* ((body (use-package-process-keywords name rest state))
+ (name-symbol (use-package-as-symbol name)))
+ (use-package-concat
+ (when use-package-compute-statistics
+ `((use-package-statistics-gather :config ',name nil)))
+ (if (and (or (null arg) (equal arg '(t))) (not use-package-inject-hooks))
+ body
+ (use-package-with-elapsed-timer
+ (format "Configuring package %s" name-symbol)
+ (funcall use-package--hush-function :config
+ (use-package-concat
+ (use-package-hook-injector
+ (symbol-name name-symbol) :config arg)
+ body
+ (list t)))))
+ (when use-package-compute-statistics
+ `((use-package-statistics-gather :config ',name t))))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; The main macro
+;;
+
+(defmacro use-package-core (name args)
+ `(let* ((args* (use-package-normalize-keywords ,name ,args))
+ (use-package--form
+ (if (eq use-package-verbose 'debug)
+ (concat "\n\n"
+ (pp-to-string `(use-package ,name ,@,args))
+ "\n -->\n\n"
+ (pp-to-string `(use-package ,name ,@args*))
+ "\n ==>\n\n"
+ (pp-to-string
+ (macroexp-progn
+ (let ((use-package-verbose 'errors)
+ (use-package-expand-minimally t))
+ (use-package-process-keywords name args*
+ (and (plist-get args* :demand)
+ (list :demand t)))))))
+ "")))
+ (use-package-process-keywords name args*
+ (and (plist-get args* :demand)
+ (list :demand t)))))
+
+;;;###autoload
+(defmacro use-package (name &rest args)
+ "Declare an Emacs package by specifying a group of configuration options.
+
+For full documentation, please see the README file that came with
+this file. Usage:
+
+ (use-package package-name
+ [:keyword [option]]...)
+
+:init Code to run before PACKAGE-NAME has been loaded.
+:config Code to run after PACKAGE-NAME has been loaded. Note that
+ if loading is deferred for any reason, this code does not
+ execute until the lazy load has occurred.
+:preface Code to be run before everything except `:disabled'; this
+ can be used to define functions for use in `:if', or that
+ should be seen by the byte-compiler.
+
+:mode Form to be added to `auto-mode-alist'.
+:magic Form to be added to `magic-mode-alist'.
+:magic-fallback Form to be added to `magic-fallback-mode-alist'.
+:interpreter Form to be added to `interpreter-mode-alist'.
+
+:commands Define autoloads for commands that will be defined by the
+ package. This is useful if the package is being lazily
+ loaded, and you wish to conditionally call functions in your
+ `:init' block that are defined in the package.
+:hook Specify hook(s) to attach this package to.
+
+:bind Bind keys, and define autoloads for the bound commands.
+:bind* Bind keys, and define autoloads for the bound commands,
+ *overriding all minor mode bindings*.
+:bind-keymap Bind a key prefix to an auto-loaded keymap defined in the
+ package. This is like `:bind', but for keymaps.
+:bind-keymap* Like `:bind-keymap', but overrides all minor mode bindings
+
+:defer Defer loading of a package -- this is implied when using
+ `:commands', `:bind', `:bind*', `:mode', `:magic', `:hook',
+ `:magic-fallback', or `:interpreter'. This can be an integer,
+ to force loading after N seconds of idle time, if the package
+ has not already been loaded.
+:after Delay the use-package declaration until after the named modules
+ have loaded. Once load, it will be as though the use-package
+ declaration (without `:after') had been seen at that moment.
+:demand Prevent the automatic deferred loading introduced by constructs
+ such as `:bind' (see `:defer' for the complete list).
+
+:if EXPR Initialize and load only if EXPR evaluates to a non-nil value.
+:disabled The package is ignored completely if this keyword is present.
+:defines Declare certain variables to silence the byte-compiler.
+:functions Declare certain functions to silence the byte-compiler.
+:load-path Add to the `load-path' before attempting to load the package.
+:diminish Support for diminish.el (if installed).
+:delight Support for delight.el (if installed).
+:custom Call `custom-set' or `set-default' with each variable
+ definition without modifying the Emacs `custom-file'.
+ (compare with `custom-set-variables').
+:custom-face Call `customize-set-faces' with each face definition.
+:ensure Loads the package using package.el if necessary.
+:pin Pin the package to an archive."
+ (declare (indent 1))
+ (unless (memq :disabled args)
+ (macroexp-progn
+ (use-package-concat
+ (when use-package-compute-statistics
+ `((use-package-statistics-gather :use-package ',name nil)))
+ (if (eq use-package-verbose 'errors)
+ (use-package-core name args)
+ (condition-case-unless-debug err
+ (use-package-core name args)
+ (error
+ (ignore
+ (display-warning
+ 'use-package
+ (format "Failed to parse package %s: %s"
+ name (error-message-string err)) :error)))))
+ (when use-package-compute-statistics
+ `((use-package-statistics-gather :use-package ',name t)))))))
+
+(put 'use-package 'lisp-indent-function 'defun)
+
+(provide 'use-package-core)
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
+
+;;; use-package-core.el ends here
diff --git a/elpa/use-package-20210207.1926/use-package-core.elc b/elpa/use-package-20210207.1926/use-package-core.elc
new file mode 100644
index 0000000..53b4146
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-core.elc
Binary files differ
diff --git a/elpa/use-package-20210207.1926/use-package-delight.el b/elpa/use-package-20210207.1926/use-package-delight.el
new file mode 100644
index 0000000..85d5c7c
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-delight.el
@@ -0,0 +1,91 @@
+;;; use-package-delight.el --- Support for the :delight keyword -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2017 John Wiegley
+
+;; Author: John Wiegley <johnw@newartisans.com>
+;; Maintainer: John Wiegley <johnw@newartisans.com>
+;; Created: 17 Jun 2012
+;; Modified: 3 Dec 2017
+;; Version: 1.0
+;; Package-Requires: ((emacs "24.3") (use-package "2.4"))
+;; Keywords: dotemacs startup speed config package
+;; URL: https://github.com/jwiegley/use-package
+
+;; This program 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, or (at
+;; your option) any later version.
+
+;; This program 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; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Provides support for the :delight keyword, which is made available by
+;; default by requiring `use-package'.
+
+;;; Code:
+
+(require 'use-package-core)
+
+(defun use-package-normalize-delight (name args)
+ "Normalize ARGS for a single call to `delight'."
+ (when (eq :eval (car args))
+ ;; Handle likely common mistake.
+ (use-package-error ":delight mode line constructs must be quoted"))
+ (cond ((and (= (length args) 1)
+ (use-package-non-nil-symbolp (car args)))
+ `(,(nth 0 args) nil ,name))
+ ((= (length args) 2)
+ `(,(nth 0 args) ,(nth 1 args) ,name))
+ ((= (length args) 3)
+ args)
+ (t
+ (use-package-error
+ ":delight expects `delight' arguments or a list of them"))))
+
+;;;###autoload
+(defun use-package-normalize/:delight (name _keyword args)
+ "Normalize arguments to delight."
+ (cond ((null args)
+ `((,(use-package-as-mode name) nil ,name)))
+ ((and (= (length args) 1)
+ (use-package-non-nil-symbolp (car args)))
+ `((,(car args) nil ,name)))
+ ((and (= (length args) 1)
+ (stringp (car args)))
+ `((,(use-package-as-mode name) ,(car args) ,name)))
+ ((and (= (length args) 1)
+ (listp (car args))
+ (eq 'quote (caar args)))
+ `((,(use-package-as-mode name) ,@(cdar args) ,name)))
+ ((and (= (length args) 2)
+ (listp (nth 1 args))
+ (eq 'quote (car (nth 1 args))))
+ `((,(car args) ,@(cdr (nth 1 args)) ,name)))
+ (t (mapcar
+ (apply-partially #'use-package-normalize-delight name)
+ (if (use-package-non-nil-symbolp (car args))
+ (list args)
+ args)))))
+
+;;;###autoload
+(defun use-package-handler/:delight (name _keyword args rest state)
+ (let ((body (use-package-process-keywords name rest state)))
+ (use-package-concat
+ body
+ `((if (fboundp 'delight)
+ (delight '(,@args)))))))
+
+(add-to-list 'use-package-keywords :delight t)
+
+(provide 'use-package-delight)
+
+;;; use-package-delight.el ends here
diff --git a/elpa/use-package-20210207.1926/use-package-delight.elc b/elpa/use-package-20210207.1926/use-package-delight.elc
new file mode 100644
index 0000000..4beefd5
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-delight.elc
Binary files differ
diff --git a/elpa/use-package-20210207.1926/use-package-diminish.el b/elpa/use-package-20210207.1926/use-package-diminish.el
new file mode 100644
index 0000000..1f3895f
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-diminish.el
@@ -0,0 +1,80 @@
+;;; use-package-diminish.el --- Support for the :diminish keyword -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2017 John Wiegley
+
+;; Author: John Wiegley <johnw@newartisans.com>
+;; Maintainer: John Wiegley <johnw@newartisans.com>
+;; Created: 17 Jun 2012
+;; Modified: 3 Dec 2017
+;; Version: 1.0
+;; Package-Requires: ((emacs "24.3") (use-package "2.4"))
+;; Keywords: dotemacs startup speed config package
+;; URL: https://github.com/jwiegley/use-package
+
+;; This program 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, or (at
+;; your option) any later version.
+
+;; This program 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; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Provides support for the :diminish keyword, which is made available by
+;; default by requiring `use-package'.
+
+;;; Code:
+
+(require 'use-package-core)
+
+(defun use-package-normalize-diminish (name label arg &optional recursed)
+ "Normalize the arguments to diminish down to a list of one of two forms:
+ SYMBOL
+ (SYMBOL . STRING)"
+ (cond
+ ((not arg)
+ (list (use-package-as-mode name)))
+ ((use-package-non-nil-symbolp arg)
+ (list arg))
+ ((stringp arg)
+ (list (cons (use-package-as-mode name) arg)))
+ ((and (consp arg) (stringp (cdr arg)))
+ (list arg))
+ ((and (not recursed) (listp arg) (listp (cdr arg)))
+ (mapcar #'(lambda (x) (car (use-package-normalize-diminish
+ name label x t))) arg))
+ (t
+ (use-package-error
+ (concat label " wants a string, symbol, "
+ "(symbol . string) or list of these")))))
+
+;;;###autoload
+(defun use-package-normalize/:diminish (name keyword args)
+ (use-package-as-one (symbol-name keyword) args
+ (apply-partially #'use-package-normalize-diminish name) t))
+
+;;;###autoload
+(defun use-package-handler/:diminish (name _keyword arg rest state)
+ (let ((body (use-package-process-keywords name rest state)))
+ (use-package-concat
+ (mapcar #'(lambda (var)
+ `(if (fboundp 'diminish)
+ ,(if (consp var)
+ `(diminish ',(car var) ,(cdr var))
+ `(diminish ',var))))
+ arg)
+ body)))
+
+(add-to-list 'use-package-keywords :diminish t)
+
+(provide 'use-package-diminish)
+
+;;; use-package-diminish.el ends here
diff --git a/elpa/use-package-20210207.1926/use-package-diminish.elc b/elpa/use-package-20210207.1926/use-package-diminish.elc
new file mode 100644
index 0000000..27c5e1a
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-diminish.elc
Binary files differ
diff --git a/elpa/use-package-20210207.1926/use-package-ensure.el b/elpa/use-package-20210207.1926/use-package-ensure.el
new file mode 100644
index 0000000..50005a9
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-ensure.el
@@ -0,0 +1,214 @@
+;;; use-package-ensure.el --- Support for the :ensure and :pin keywords -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2017 John Wiegley
+
+;; Author: John Wiegley <johnw@newartisans.com>
+;; Maintainer: John Wiegley <johnw@newartisans.com>
+;; Created: 17 Jun 2012
+;; Modified: 3 Dec 2017
+;; Version: 1.0
+;; Package-Requires: ((emacs "24.3") (use-package "2.4"))
+;; Keywords: dotemacs startup speed config package
+;; URL: https://github.com/jwiegley/use-package
+
+;; This program 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, or (at
+;; your option) any later version.
+
+;; This program 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; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Provides support for the :ensure and :pin keywords, which is made available
+;; by default by requiring `use-package'.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'use-package-core)
+
+(defgroup use-package-ensure nil
+ "Support for :ensure and :pin keywords in use-package declarations."
+ :group 'use-package)
+
+(eval-when-compile
+ (declare-function package-installed-p "package")
+ (declare-function package-read-all-archive-contents "package" ()))
+
+(defcustom use-package-always-ensure nil
+ "Treat every package as though it had specified using `:ensure SEXP'.
+See also `use-package-defaults', which uses this value."
+ :type 'sexp
+ :group 'use-package-ensure)
+
+(defcustom use-package-always-pin nil
+ "Treat every package as though it had specified using `:pin SYM'.
+See also `use-package-defaults', which uses this value."
+ :type 'symbol
+ :group 'use-package-ensure)
+
+(defcustom use-package-ensure-function 'use-package-ensure-elpa
+ "Function that ensures a package is installed.
+This function is called with three arguments: the name of the
+package declared in the `use-package' form; the arguments passed
+to all `:ensure' keywords (always a list, even if only one); and
+the current `state' plist created by previous handlers.
+
+Note that this function is called whenever `:ensure' is provided,
+even if it is nil. It is up to the function to decide on the
+semantics of the various values for `:ensure'.
+
+This function should return non-nil if the package is installed.
+
+The default value uses package.el to install the package."
+ :type '(choice (const :tag "package.el" use-package-ensure-elpa)
+ (function :tag "Custom"))
+ :group 'use-package-ensure)
+
+;;;; :pin
+
+(defun use-package-normalize/:pin (_name keyword args)
+ (use-package-only-one (symbol-name keyword) args
+ #'(lambda (_label arg)
+ (cond
+ ((stringp arg) arg)
+ ((use-package-non-nil-symbolp arg) (symbol-name arg))
+ (t
+ (use-package-error
+ ":pin wants an archive name (a string)"))))))
+
+(eval-when-compile
+ (defvar package-pinned-packages)
+ (defvar package-archives))
+
+(defun use-package-archive-exists-p (archive)
+ "Check if a given ARCHIVE is enabled.
+
+ARCHIVE can be a string or a symbol or 'manual to indicate a
+manually updated package."
+ (if (member archive '(manual "manual"))
+ 't
+ (let ((valid nil))
+ (dolist (pa package-archives)
+ (when (member archive (list (car pa) (intern (car pa))))
+ (setq valid 't)))
+ valid)))
+
+(defun use-package-pin-package (package archive)
+ "Pin PACKAGE to ARCHIVE."
+ (unless (boundp 'package-pinned-packages)
+ (setq package-pinned-packages ()))
+ (let ((archive-symbol (if (symbolp archive) archive (intern archive)))
+ (archive-name (if (stringp archive) archive (symbol-name archive))))
+ (if (use-package-archive-exists-p archive-symbol)
+ (add-to-list 'package-pinned-packages (cons package archive-name))
+ (error "Archive '%s' requested for package '%s' is not available."
+ archive-name package))
+ (unless (bound-and-true-p package--initialized)
+ (package-initialize t))))
+
+(defun use-package-handler/:pin (name _keyword archive-name rest state)
+ (let ((body (use-package-process-keywords name rest state))
+ (pin-form (if archive-name
+ `(use-package-pin-package ',(use-package-as-symbol name)
+ ,archive-name))))
+ ;; Pinning should occur just before ensuring
+ ;; See `use-package-handler/:ensure'.
+ (if (bound-and-true-p byte-compile-current-file)
+ (eval pin-form) ; Eval when byte-compiling,
+ (push pin-form body)) ; or else wait until runtime.
+ body))
+
+;;;; :ensure
+
+(defvar package-archive-contents)
+
+;;;###autoload
+(defun use-package-normalize/:ensure (_name keyword args)
+ (if (null args)
+ (list t)
+ (use-package-only-one (symbol-name keyword) args
+ #'(lambda (_label arg)
+ (cond
+ ((symbolp arg)
+ (list arg))
+ ((and (listp arg) (= 3 (length arg))
+ (symbolp (nth 0 arg))
+ (eq :pin (nth 1 arg))
+ (or (stringp (nth 2 arg))
+ (symbolp (nth 2 arg))))
+ (list (cons (nth 0 arg) (nth 2 arg))))
+ (t
+ (use-package-error
+ (concat ":ensure wants an optional package name "
+ "(an unquoted symbol name), or (<symbol> :pin <string>)"))))))))
+
+(defun use-package-ensure-elpa (name args _state &optional _no-refresh)
+ (dolist (ensure args)
+ (let ((package
+ (or (and (eq ensure t) (use-package-as-symbol name))
+ ensure)))
+ (when package
+ (require 'package)
+ (when (consp package)
+ (use-package-pin-package (car package) (cdr package))
+ (setq package (car package)))
+ (unless (package-installed-p package)
+ (condition-case-unless-debug err
+ (progn
+ (when (assoc package (bound-and-true-p
+ package-pinned-packages))
+ (package-read-all-archive-contents))
+ (if (assoc package package-archive-contents)
+ (package-install package)
+ (package-refresh-contents)
+ (when (assoc package (bound-and-true-p
+ package-pinned-packages))
+ (package-read-all-archive-contents))
+ (package-install package))
+ t)
+ (error
+ (display-warning 'use-package
+ (format "Failed to install %s: %s"
+ name (error-message-string err))
+ :error))))))))
+
+;;;###autoload
+(defun use-package-handler/:ensure (name _keyword ensure rest state)
+ (let* ((body (use-package-process-keywords name rest state)))
+ ;; We want to avoid installing packages when the `use-package' macro is
+ ;; being macro-expanded by elisp completion (see `lisp--local-variables'),
+ ;; but still install packages when byte-compiling, to avoid requiring
+ ;; `package' at runtime.
+ (if (bound-and-true-p byte-compile-current-file)
+ ;; Eval when byte-compiling,
+ (funcall use-package-ensure-function name ensure state)
+ ;; or else wait until runtime.
+ (push `(,use-package-ensure-function ',name ',ensure ',state)
+ body))
+ body))
+
+(add-to-list 'use-package-defaults
+ '(:ensure (list use-package-always-ensure)
+ (lambda (name args)
+ (and use-package-always-ensure
+ (not (plist-member args :load-path))))) t)
+
+(add-to-list 'use-package-defaults
+ '(:pin use-package-always-pin use-package-always-pin) t)
+
+(add-to-list 'use-package-keywords :ensure)
+(add-to-list 'use-package-keywords :pin)
+
+(provide 'use-package-ensure)
+
+;;; use-package-ensure.el ends here
diff --git a/elpa/use-package-20210207.1926/use-package-ensure.elc b/elpa/use-package-20210207.1926/use-package-ensure.elc
new file mode 100644
index 0000000..0db6d4b
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-ensure.elc
Binary files differ
diff --git a/elpa/use-package-20210207.1926/use-package-jump.el b/elpa/use-package-20210207.1926/use-package-jump.el
new file mode 100644
index 0000000..4044ad1
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-jump.el
@@ -0,0 +1,79 @@
+;;; use-package-jump.el --- Attempt to jump to a use-package declaration -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2017 John Wiegley
+
+;; Author: John Wiegley <johnw@newartisans.com>
+;; Maintainer: John Wiegley <johnw@newartisans.com>
+;; Created: 17 Jun 2012
+;; Modified: 3 Dec 2017
+;; Version: 1.0
+;; Package-Requires: ((emacs "24.3") (use-package "2.4"))
+;; Keywords: dotemacs startup speed config package
+;; URL: https://github.com/jwiegley/use-package
+
+;; This program 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, or (at
+;; your option) any later version.
+
+;; This program 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; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Provides the command `M-x use-package-jump-to-package-form', however it
+;; only works if the package being jumped to was required during
+;; initialization. If it was delay-loaded, it will not work. Improvements are
+;; needed.
+
+;;; Code:
+
+(require 'use-package-core)
+
+(defun use-package-find-require (package)
+ "Find file that required PACKAGE by searching `load-history'.
+Returns an absolute file path or nil if none is found."
+ (catch 'suspect
+ (dolist (filespec load-history)
+ (dolist (entry (cdr filespec))
+ (when (equal entry (cons 'require package))
+ (throw 'suspect (car filespec)))))))
+
+;;;###autoload
+(defun use-package-jump-to-package-form (package)
+ "Attempt to find and jump to the `use-package' form that loaded
+PACKAGE. This will only find the form if that form actually
+required PACKAGE. If PACKAGE was previously required then this
+function will jump to the file that originally required PACKAGE
+instead."
+ (interactive (list (completing-read "Package: " features)))
+ (let* ((package (if (stringp package) (intern package) package))
+ (requiring-file (use-package-find-require package))
+ file location)
+ (if (null requiring-file)
+ (user-error "Can't find file requiring file; may have been autoloaded")
+ (setq file (if (string= (file-name-extension requiring-file) "elc")
+ (concat (file-name-sans-extension requiring-file) ".el")
+ requiring-file))
+ (when (file-exists-p file)
+ (find-file-other-window file)
+ (save-excursion
+ (goto-char (point-min))
+ (setq location
+ (re-search-forward
+ (format (eval use-package-form-regexp-eval) package) nil t)))
+ (if (null location)
+ (message "No use-package form found.")
+ (goto-char location)
+ (beginning-of-line))))))
+
+(provide 'use-package-jump)
+
+;;; use-package-jump.el ends here
diff --git a/elpa/use-package-20210207.1926/use-package-jump.elc b/elpa/use-package-20210207.1926/use-package-jump.elc
new file mode 100644
index 0000000..d45e0e9
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-jump.elc
Binary files differ
diff --git a/elpa/use-package-20210207.1926/use-package-lint.el b/elpa/use-package-20210207.1926/use-package-lint.el
new file mode 100644
index 0000000..c6e7c3c
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-lint.el
@@ -0,0 +1,84 @@
+;;; use-package-lint.el --- Attempt to find errors in use-package declarations -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2017 John Wiegley
+
+;; Author: John Wiegley <johnw@newartisans.com>
+;; Maintainer: John Wiegley <johnw@newartisans.com>
+;; Created: 17 Jun 2012
+;; Modified: 3 Dec 2017
+;; Version: 1.0
+;; Package-Requires: ((emacs "24.3") (use-package "2.4"))
+;; Keywords: dotemacs startup speed config package
+;; URL: https://github.com/jwiegley/use-package
+
+;; This program 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, or (at
+;; your option) any later version.
+
+;; This program 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; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Provides the command `M-x use-package-lint'.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'use-package-core)
+
+(defun use-package-lint-declaration (name plist)
+ (dolist (path (plist-get plist :load-path))
+ (unless (file-exists-p path)
+ (display-warning
+ 'use-package
+ (format "%s :load-path does not exist: %s"
+ name path) :error)))
+
+ (unless (or (plist-member plist :disabled)
+ (plist-get plist :no-require)
+ (locate-library (use-package-as-string name) nil
+ (plist-get plist :load-path)))
+ (display-warning
+ 'use-package
+ (format "%s module cannot be located" name) :error))
+
+ ;; (dolist (command (plist-get plist :commands))
+ ;; (unless (string= (find-lisp-object-file-name command nil)
+ ;; (locate-library (use-package-as-string name) nil
+ ;; (plist-get plist :load-path)))
+ ;; (display-warning
+ ;; 'use-package
+ ;; (format "%s :command is from different path: %s"
+ ;; name (symbol-name command)) :error)))
+ )
+
+;;;###autoload
+(defun use-package-lint ()
+ "Check for errors in use-package declarations.
+For example, if the module's `:if' condition is met, but even
+with the specified `:load-path' the module cannot be found."
+ (interactive)
+ (save-excursion
+ (goto-char (point-min))
+ (let ((re (eval use-package-form-regexp-eval)))
+ (while (re-search-forward re nil t)
+ (goto-char (match-beginning 0))
+ (let ((decl (read (current-buffer))))
+ (when (eq (car decl) 'use-package)
+ (use-package-lint-declaration
+ (use-package-as-string (cadr decl))
+ (use-package-normalize-keywords
+ (cadr decl) (cddr decl)))))))))
+
+(provide 'use-package-lint)
+
+;;; use-package-lint.el ends here
diff --git a/elpa/use-package-20210207.1926/use-package-lint.elc b/elpa/use-package-20210207.1926/use-package-lint.elc
new file mode 100644
index 0000000..d0134bf
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-lint.elc
Binary files differ
diff --git a/elpa/use-package-20210207.1926/use-package-pkg.el b/elpa/use-package-20210207.1926/use-package-pkg.el
new file mode 100644
index 0000000..9f0089b
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package-pkg.el
@@ -0,0 +1,13 @@
+(define-package "use-package" "20210207.1926" "A configuration macro for simplifying your .emacs"
+ '((emacs "24.3")
+ (bind-key "2.4"))
+ :commit "a7422fb8ab1baee19adb2717b5b47b9c3812a84c" :authors
+ '(("John Wiegley" . "johnw@newartisans.com"))
+ :maintainer
+ '("John Wiegley" . "johnw@newartisans.com")
+ :keywords
+ '("dotemacs" "startup" "speed" "config" "package")
+ :url "https://github.com/jwiegley/use-package")
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/elpa/use-package-20210207.1926/use-package.el b/elpa/use-package-20210207.1926/use-package.el
new file mode 100644
index 0000000..0e194d5
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package.el
@@ -0,0 +1,54 @@
+;;; use-package.el --- A configuration macro for simplifying your .emacs -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2012-2017 John Wiegley
+
+;; Author: John Wiegley <johnw@newartisans.com>
+;; Maintainer: John Wiegley <johnw@newartisans.com>
+;; Created: 17 Jun 2012
+;; Modified: 29 Nov 2017
+;; Version: 2.4.1
+;; Package-Requires: ((emacs "24.3") (bind-key "2.4"))
+;; Keywords: dotemacs startup speed config package
+;; URL: https://github.com/jwiegley/use-package
+
+;; This program 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, or (at
+;; your option) any later version.
+
+;; This program 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; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; The `use-package' declaration macro allows you to isolate package
+;; configuration in your ".emacs" in a way that is performance-oriented and,
+;; well, just tidy. I created it because I have over 80 packages that I use
+;; in Emacs, and things were getting difficult to manage. Yet with this
+;; utility my total load time is just under 1 second, with no loss of
+;; functionality!
+;;
+;; Please see README.md from the same repository for documentation.
+
+;;; Code:
+
+(require 'use-package-core)
+
+(require 'use-package-bind-key)
+(require 'use-package-diminish)
+(require 'use-package-delight)
+(require 'use-package-ensure)
+
+(declare-function use-package-jump-to-package-form "use-package-jump")
+(autoload #'use-package-jump-to-package-form "use-package-jump" nil t)
+
+(provide 'use-package)
+
+;;; use-package.el ends here
diff --git a/elpa/use-package-20210207.1926/use-package.elc b/elpa/use-package-20210207.1926/use-package.elc
new file mode 100644
index 0000000..a231943
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package.elc
Binary files differ
diff --git a/elpa/use-package-20210207.1926/use-package.info b/elpa/use-package-20210207.1926/use-package.info
new file mode 100644
index 0000000..c7b7b4b
--- /dev/null
+++ b/elpa/use-package-20210207.1926/use-package.info
@@ -0,0 +1,1048 @@
+This is use-package.info, produced by makeinfo version 6.7 from
+use-package.texi.
+
+ Copyright (C) 2012-2017 John Wiegley <johnw@newartisans.com>
+
+ You can redistribute this document 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.
+
+ This document 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.
+INFO-DIR-SECTION Emacs
+START-INFO-DIR-ENTRY
+* use-package: (use-package). Declarative package configuration for Emacs.
+END-INFO-DIR-ENTRY
+
+
+File: use-package.info, Node: Top, Next: Introduction, Up: (dir)
+
+use-package User Manual
+***********************
+
+use-package is...
+
+ Copyright (C) 2012-2017 John Wiegley <johnw@newartisans.com>
+
+ You can redistribute this document 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.
+
+ This document 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.
+
+* Menu:
+
+* Introduction::
+* Installation::
+* Getting Started::
+* Keywords::
+* FAQ::
+* Debugging Tools::
+* Command Index::
+* Function Index::
+* Variable Index::
+
+— The Detailed Node Listing —
+
+
+Installation
+
+* Installing from an Elpa Archive::
+* Installing from the Git Repository::
+* Post-Installation Tasks::
+
+
+
+
+Keywords
+
+* ‘:after’: after.
+* ‘:bind-keymap’, ‘:bind-keymap*’: bind-keymap bind-keymap*.
+* ‘:bind’, ‘:bind*’: bind bind*.
+* ‘:commands’: commands.
+* ‘:preface’, ‘:init’, ‘:config’: preface init config.
+* ‘:custom’: custom.
+* ‘:custom-face’: custom-face.
+* ‘:defer’, ‘:demand’: defer demand.
+* ‘:defines’, ‘:functions’: defines functions.
+* ‘:diminish’, ‘:delight’: diminish delight.
+* ‘:disabled’: disabled.
+* ‘:ensure’, ‘:pin’: ensure pin.
+* ‘:hook’: hook.
+* ‘:if’, ‘:when’, ‘:unless’: if when unless.
+* ‘:load-path’: load-path.
+* ‘:mode’, ‘:interpreter’: mode interpreter.
+* ‘:magic’, ‘:magic-fallback’: magic magic-fallback.
+* ‘:no-require’: no-require.
+* ‘:requires’: requires.
+
+
+
+‘:bind’, ‘:bind*’
+
+* Binding to local keymaps::
+
+FAQ
+
+* FAQ - How to ...?::
+* FAQ - Issues and Errors::
+
+FAQ - How to ...?
+
+* This is a question::
+
+
+FAQ - Issues and Errors
+
+* This is an issues::
+
+
+File: use-package.info, Node: Introduction, Next: Installation, Prev: Top, Up: Top
+
+1 Introduction
+**************
+
+The ‘use-package’ macro allows you to isolate package configuration in
+your ‘.emacs’ file in a way that is both performance-oriented and, well,
+tidy. I created it because I have over 400 packages that I use in
+Emacs, and things were getting difficult to manage. Yet with this
+utility my total load time is around 2 seconds, with no loss of
+functionality!
+
+
+File: use-package.info, Node: Installation, Next: Getting Started, Prev: Introduction, Up: Top
+
+2 Installation
+**************
+
+use-package can be installed using Emacs’ package manager or manually
+from its development repository.
+
+* Menu:
+
+* Installing from an Elpa Archive::
+* Installing from the Git Repository::
+* Post-Installation Tasks::
+
+
+File: use-package.info, Node: Installing from an Elpa Archive, Next: Installing from the Git Repository, Up: Installation
+
+2.1 Installing from an Elpa Archive
+===================================
+
+use-package is available from Melpa and Melpa-Stable. If you haven’t
+used Emacs’ package manager before, then it is high time you familiarize
+yourself with it by reading the documentation in the Emacs manual, see
+*note (emacs)Packages::. Then add one of the archives to
+‘package-archives’:
+
+ • To use Melpa:
+
+ (require 'package)
+ (add-to-list 'package-archives
+ '("melpa" . "https://melpa.org/packages/") t)
+
+ • To use Melpa-Stable:
+
+ (require 'package)
+ (add-to-list 'package-archives
+ '("melpa-stable" . "https://stable.melpa.org/packages/") t)
+
+ Once you have added your preferred archive, you need to update the
+local package list using:
+
+ M-x package-refresh-contents RET
+
+ Once you have done that, you can install use-package and its
+dependencies using:
+
+ M-x package-install RET use-package RET
+
+ Now see *note Post-Installation Tasks::.
+
+
+File: use-package.info, Node: Installing from the Git Repository, Next: Post-Installation Tasks, Prev: Installing from an Elpa Archive, Up: Installation
+
+2.2 Installing from the Git Repository
+======================================
+
+First, use Git to clone the use-package repository:
+
+ $ git clone https://github.com/jwiegley/use-package.git ~/.emacs.d/site-lisp/use-package
+ $ cd ~/.emacs.d/site-lisp/use-package
+
+ Then compile the libraries and generate the info manuals:
+
+ $ make
+
+ You may need to create ‘/path/to/use-package/config.mk’ with the
+following content before running ‘make’:
+
+ LOAD_PATH = -L /path/to/use-package
+
+ Finally add this to your init file:
+
+ (add-to-list 'load-path "~/.emacs.d/site-lisp/use-package")
+ (require 'use-package)
+
+ (with-eval-after-load 'info
+ (info-initialize)
+ (add-to-list 'Info-directory-list
+ "~/.emacs.d/site-lisp/use-package/"))
+
+ Note that elements of ‘load-path’ should not end with a slash, while
+those of ‘Info-directory-list’ should.
+
+ Instead of running use-package directly from the repository by adding
+it to the ‘load-path’, you might want to instead install it in some
+other directory using ‘sudo make install’ and setting ‘load-path’
+accordingly.
+
+ To update use-package use:
+
+ $ git pull
+ $ make
+
+ At times it might be necessary to run ‘make clean all’ instead.
+
+ To view all available targets use ‘make help’.
+
+ Now see *note Post-Installation Tasks::.
+
+
+File: use-package.info, Node: Post-Installation Tasks, Prev: Installing from the Git Repository, Up: Installation
+
+2.3 Post-Installation Tasks
+===========================
+
+After installing use-package you should verify that you are indeed using
+the use-package release you think you are using. It’s best to restart
+Emacs before doing so, to make sure you are not using an outdated value
+for ‘load-path’.
+
+ C-h v use-package-version RET
+
+ should display something like
+
+ use-package-version’s value is "2.4.1"
+
+ If you are completely new to use-package then see *note Getting
+Started::.
+
+ If you run into problems, then please see the *note FAQ::. Also see
+the *note Debugging Tools::.
+
+
+File: use-package.info, Node: Getting Started, Next: Keywords, Prev: Installation, Up: Top
+
+3 Getting Started
+*****************
+
+TODO. For now, see ‘README.md’.
+
+
+File: use-package.info, Node: Keywords, Next: FAQ, Prev: Getting Started, Up: Top
+
+4 Keywords
+**********
+
+* Menu:
+
+* ‘:after’: after.
+* ‘:bind-keymap’, ‘:bind-keymap*’: bind-keymap bind-keymap*.
+* ‘:bind’, ‘:bind*’: bind bind*.
+* ‘:commands’: commands.
+* ‘:preface’, ‘:init’, ‘:config’: preface init config.
+* ‘:custom’: custom.
+* ‘:custom-face’: custom-face.
+* ‘:defer’, ‘:demand’: defer demand.
+* ‘:defines’, ‘:functions’: defines functions.
+* ‘:diminish’, ‘:delight’: diminish delight.
+* ‘:disabled’: disabled.
+* ‘:ensure’, ‘:pin’: ensure pin.
+* ‘:hook’: hook.
+* ‘:if’, ‘:when’, ‘:unless’: if when unless.
+* ‘:load-path’: load-path.
+* ‘:mode’, ‘:interpreter’: mode interpreter.
+* ‘:magic’, ‘:magic-fallback’: magic magic-fallback.
+* ‘:no-require’: no-require.
+* ‘:requires’: requires.
+
+
+File: use-package.info, Node: after, Next: bind-keymap bind-keymap*, Up: Keywords
+
+4.1 ‘:after’
+============
+
+Sometimes it only makes sense to configure a package after another has
+been loaded, because certain variables or functions are not in scope
+until that time. This can achieved using an ‘:after’ keyword that
+allows a fairly rich description of the exact conditions when loading
+should occur. Here is an example:
+
+ (use-package hydra
+ :load-path "site-lisp/hydra")
+
+ (use-package ivy
+ :load-path "site-lisp/swiper")
+
+ (use-package ivy-hydra
+ :after (ivy hydra))
+
+ In this case, because all of these packages are demand-loaded in the
+order they occur, the use of ‘:after’ is not strictly necessary. By
+using it, however, the above code becomes order-independent, without an
+implicit depedence on the nature of your init file.
+
+ By default, ‘:after (foo bar)’ is the same as ‘:after (:all foo
+bar)’, meaning that loading of the given package will not happen until
+both ‘foo’ and ‘bar’ have been loaded. Here are some of the other
+possibilities:
+
+ :after (foo bar)
+ :after (:all foo bar)
+ :after (:any foo bar)
+ :after (:all (:any foo bar) (:any baz quux))
+ :after (:any (:all foo bar) (:all baz quux))
+
+ When you nest selectors, such as ‘(:any (:all foo bar) (:all baz
+quux))’, it means that the package will be loaded when either both ‘foo’
+and ‘bar’ have been loaded, or both ‘baz’ and ‘quux’ have been loaded.
+
+
+File: use-package.info, Node: bind-keymap bind-keymap*, Next: bind bind*, Prev: after, Up: Keywords
+
+4.2 ‘:bind-keymap’, ‘:bind-keymap*’
+===================================
+
+Normally ‘:bind’ expects that commands are functions that will be
+autoloaded from the given package. However, this does not work if one
+of those commands is actually a keymap, since keymaps are not functions,
+and cannot be autoloaded using Emacs’ ‘autoload’ mechanism.
+
+ To handle this case, ‘use-package’ offers a special, limited variant
+of ‘:bind’ called ‘:bind-keymap’. The only difference is that the
+"commands" bound to by ‘:bind-keymap’ must be keymaps defined in the
+package, rather than command functions. This is handled behind the
+scenes by generating custom code that loads the package containing the
+keymap, and then re-executes your keypress after the first load, to
+reinterpret that keypress as a prefix key.
+
+ For example:
+
+ (use-package projectile
+ :bind-keymap
+ ("C-c p" . projectile-command-map)
+
+
+File: use-package.info, Node: bind bind*, Next: commands, Prev: bind-keymap bind-keymap*, Up: Keywords
+
+4.3 ‘:bind’, ‘:bind*’
+=====================
+
+Another common thing to do when loading a module is to bind a key to
+primary commands within that module:
+
+ (use-package ace-jump-mode
+ :bind ("C-." . ace-jump-mode))
+
+ This does two things: first, it creates an autoload for the
+‘ace-jump-mode’ command and defers loading of ‘ace-jump-mode’ until you
+actually use it. Second, it binds the key ‘C-.’ to that command. After
+loading, you can use ‘M-x describe-personal-keybindings’ to see all such
+keybindings you’ve set throughout your ‘.emacs’ file.
+
+ A more literal way to do the exact same thing is:
+
+ (use-package ace-jump-mode
+ :commands ace-jump-mode
+ :init
+ (bind-key "C-." 'ace-jump-mode))
+
+ When you use the ‘:commands’ keyword, it creates autoloads for those
+commands and defers loading of the module until they are used. Since
+the ‘:init’ form is always run—even if ‘ace-jump-mode’ might not be on
+your system—remember to restrict ‘:init’ code to only what would succeed
+either way.
+
+ The ‘:bind’ keyword takes either a cons or a list of conses:
+
+ (use-package hi-lock
+ :bind (("M-o l" . highlight-lines-matching-regexp)
+ ("M-o r" . highlight-regexp)
+ ("M-o w" . highlight-phrase)))
+
+ The ‘:commands’ keyword likewise takes either a symbol or a list of
+symbols.
+
+ NOTE: Special keys like ‘tab’ or ‘F1’-‘Fn’ can be written in square
+brackets, i.e. ‘[tab]’ instead of ‘"tab"’. The syntax for the
+keybindings is similar to the "kbd" syntax: see the Emacs Manual
+(https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-Rebinding.html)
+for more information.
+
+ Examples:
+
+ (use-package helm
+ :bind (("M-x" . helm-M-x)
+ ("M-<f5>" . helm-find-files)
+ ([f10] . helm-buffers-list)
+ ([S-f10] . helm-recentf)))
+
+* Menu:
+
+* Binding to local keymaps::
+
+
+File: use-package.info, Node: Binding to local keymaps, Up: bind bind*
+
+4.3.1 Binding to local keymaps
+------------------------------
+
+Slightly different from binding a key to a keymap, is binding a key
+*within* a local keymap that only exists after the package is loaded.
+‘use-package’ supports this with a ‘:map’ modifier, taking the local
+keymap to bind to:
+
+ (use-package helm
+ :bind (:map helm-command-map
+ ("C-c h" . helm-execute-persistent-action)))
+
+ The effect of this statement is to wait until ‘helm’ has loaded, and
+then to bind the key ‘C-c h’ to ‘helm-execute-persistent-action’ within
+Helm’s local keymap, ‘helm-mode-map’.
+
+ Multiple uses of ‘:map’ may be specified. Any binding occurring
+before the first use of ‘:map’ are applied to the global keymap:
+
+ (use-package term
+ :bind (("C-c t" . term)
+ :map term-mode-map
+ ("M-p" . term-send-up)
+ ("M-n" . term-send-down)
+ :map term-raw-map
+ ("M-o" . other-window)
+ ("M-p" . term-send-up)
+ ("M-n" . term-send-down)))
+
+
+File: use-package.info, Node: commands, Next: preface init config, Prev: bind bind*, Up: Keywords
+
+4.4 ‘:commands’
+===============
+
+
+File: use-package.info, Node: preface init config, Next: custom, Prev: commands, Up: Keywords
+
+4.5 ‘:preface’, ‘:init’, ‘:config’
+==================================
+
+Here is the simplest ‘use-package’ declaration:
+
+ ;; This is only needed once, near the top of the file
+ (eval-when-compile
+ ;; Following line is not needed if use-package.el is in ~/.emacs.d
+ (add-to-list 'load-path "<path where use-package is installed>")
+ (require 'use-package))
+
+ (use-package foo)
+
+ This loads in the package ‘foo’, but only if ‘foo’ is available on
+your system. If not, a warning is logged to the ‘*Messages*’ buffer.
+If it succeeds, a message about ‘"Loading foo"’ is logged, along with
+the time it took to load, if it took over 0.1 seconds.
+
+ Use the ‘:init’ keyword to execute code before a package is loaded.
+It accepts one or more forms, up until the next keyword:
+
+ (use-package foo
+ :init
+ (setq foo-variable t))
+
+ Similarly, ‘:config’ can be used to execute code after a package is
+loaded. In cases where loading is done lazily (see more about
+autoloading below), this execution is deferred until after the autoload
+occurs:
+
+ (use-package foo
+ :init
+ (setq foo-variable t)
+ :config
+ (foo-mode 1))
+
+ As you might expect, you can use ‘:init’ and ‘:config’ together:
+
+ (use-package color-moccur
+ :commands (isearch-moccur isearch-all)
+ :bind (("M-s O" . moccur)
+ :map isearch-mode-map
+ ("M-o" . isearch-moccur)
+ ("M-O" . isearch-moccur-all))
+ :init
+ (setq isearch-lazy-highlight t)
+ :config
+ (use-package moccur-edit))
+
+ In this case, I want to autoload the commands ‘isearch-moccur’ and
+‘isearch-all’ from ‘color-moccur.el’, and bind keys both at the global
+level and within the ‘isearch-mode-map’ (see next section). When the
+package is actually loaded (by using one of these commands),
+‘moccur-edit’ is also loaded, to allow editing of the ‘moccur’ buffer.
+
+
+File: use-package.info, Node: custom, Next: custom-face, Prev: preface init config, Up: Keywords
+
+4.6 ‘:custom’
+=============
+
+The ‘:custom’ keyword allows customization of package custom variables.
+
+ (use-package comint
+ :custom
+ (comint-buffer-maximum-size 20000 "Increase comint buffer size.")
+ (comint-prompt-read-only t "Make the prompt read only."))
+
+ The documentation string is not mandatory.
+
+
+File: use-package.info, Node: custom-face, Next: defer demand, Prev: custom, Up: Keywords
+
+4.7 ‘:custom-face’
+==================
+
+The ‘:custom-face’ keyword allows customization of package custom faces.
+
+ (use-package eruby-mode
+ :custom-face
+ (eruby-standard-face ((t (:slant italic)))))
+
+
+File: use-package.info, Node: defer demand, Next: defines functions, Prev: custom-face, Up: Keywords
+
+4.8 ‘:defer’, ‘:demand’
+=======================
+
+In almost all cases you don’t need to manually specify ‘:defer t’. This
+is implied whenever ‘:bind’ or ‘:mode’ or ‘:interpreter’ is used.
+Typically, you only need to specify ‘:defer’ if you know for a fact that
+some other package will do something to cause your package to load at
+the appropriate time, and thus you would like to defer loading even
+though use-package isn’t creating any autoloads for you.
+
+ You can override package deferral with the ‘:demand’ keyword. Thus,
+even if you use ‘:bind’, using ‘:demand’ will force loading to occur
+immediately and not establish an autoload for the bound key.
+
+
+File: use-package.info, Node: defines functions, Next: diminish delight, Prev: defer demand, Up: Keywords
+
+4.9 ‘:defines’, ‘:functions’
+============================
+
+Another feature of ‘use-package’ is that it always loads every file that
+it can when ‘.emacs’ is being byte-compiled. This helps to silence
+spurious warnings about unknown variables and functions.
+
+ However, there are times when this is just not enough. For those
+times, use the ‘:defines’ and ‘:functions’ keywords to introduce dummy
+variable and function declarations solely for the sake of the
+byte-compiler:
+
+ (use-package texinfo
+ :defines texinfo-section-list
+ :commands texinfo-mode
+ :init
+ (add-to-list 'auto-mode-alist '("\\.texi$" . texinfo-mode)))
+
+ If you need to silence a missing function warning, you can use
+‘:functions’:
+
+ (use-package ruby-mode
+ :mode "\\.rb\\'"
+ :interpreter "ruby"
+ :functions inf-ruby-keys
+ :config
+ (defun my-ruby-mode-hook ()
+ (require 'inf-ruby)
+ (inf-ruby-keys))
+
+ (add-hook 'ruby-mode-hook 'my-ruby-mode-hook))
+
+
+File: use-package.info, Node: diminish delight, Next: disabled, Prev: defines functions, Up: Keywords
+
+4.10 ‘:diminish’, ‘:delight’
+============================
+
+‘use-package’ also provides built-in support for the diminish and
+delight utilities—if you have them installed. Their purpose is to
+remove or change minor mode strings in your mode-line.
+
+ diminish (https://github.com/myrjola/diminish.el) is invoked with the
+‘:diminish’ keyword, which is passed either a minor mode symbol, a cons
+of the symbol and its replacement string, or just a replacement string,
+in which case the minor mode symbol is guessed to be the package name
+with "-mode" appended at the end:
+
+ (use-package abbrev
+ :diminish abbrev-mode
+ :config
+ (if (file-exists-p abbrev-file-name)
+ (quietly-read-abbrev-file)))
+
+ delight (https://elpa.gnu.org/packages/delight.html) is invoked with
+the ‘:delight’ keyword, which is passed a minor mode symbol, a
+replacement string or quoted mode-line data
+(https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Data.html)
+(in which case the minor mode symbol is guessed to be the package name
+with "-mode" appended at the end), both of these, or several lists of
+both. If no arguments are provided, the default mode name is hidden
+completely.
+
+ ;; Don't show anything for rainbow-mode.
+ (use-package rainbow-mode
+ :delight)
+
+ ;; Don't show anything for auto-revert-mode, which doesn't match
+ ;; its package name.
+ (use-package autorevert
+ :delight auto-revert-mode)
+
+ ;; Remove the mode name for projectile-mode, but show the project name.
+ (use-package projectile
+ :delight '(:eval (concat " " (projectile-project-name))))
+
+ ;; Completely hide visual-line-mode and change auto-fill-mode to " AF".
+ (use-package emacs
+ :delight
+ (auto-fill-function " AF")
+ (visual-line-mode))
+
+
+File: use-package.info, Node: disabled, Next: ensure pin, Prev: diminish delight, Up: Keywords
+
+4.11 ‘:disabled’
+================
+
+The ‘:disabled’ keyword can turn off a module you’re having difficulties
+with, or stop loading something you’re not using at the present time:
+
+ (use-package ess-site
+ :disabled
+ :commands R)
+
+ When byte-compiling your ‘.emacs’ file, disabled declarations are
+omitted from the output entirely, to accelerate startup times.
+
+
+File: use-package.info, Node: ensure pin, Next: hook, Prev: disabled, Up: Keywords
+
+4.12 ‘:ensure’, ‘:pin’
+======================
+
+You can use ‘use-package’ to load packages from ELPA with ‘package.el’.
+This is particularly useful if you share your ‘.emacs’ among several
+machines; the relevant packages are downloaded automatically once
+declared in your ‘.emacs’. The ‘:ensure’ keyword causes the package(s)
+to be installed automatically if not already present on your system (set
+‘(setq use-package-always-ensure t)’ if you wish this behavior to be
+global for all packages):
+
+ (use-package magit
+ :ensure t)
+
+ If you need to install a different package from the one named by
+‘use-package’, you can specify it like this:
+
+ (use-package tex
+ :ensure auctex)
+
+ Lastly, when running on Emacs 24.4 or later, use-package can pin a
+package to a specific archive, allowing you to mix and match packages
+from different archives. The primary use-case for this is preferring
+packages from the ‘melpa-stable’ and ‘gnu’ archives, but using specific
+packages from ‘melpa’ when you need to track newer versions than what is
+available in the ‘stable’ archives is also a valid use-case.
+
+ By default ‘package.el’ prefers ‘melpa’ over ‘melpa-stable’ due to
+the versioning ‘(> evil-20141208.623 evil-1.0.9)’, so even if you are
+tracking only a single package from ‘melpa’, you will need to tag all
+the non-‘melpa’ packages with the appropriate archive. If this really
+annoys you, then you can set ‘use-package-always-pin’ to set a default.
+
+ If you want to manually keep a package updated and ignore upstream
+updates, you can pin it to ‘manual’, which as long as there is no
+repository by that name, will Just Work(tm).
+
+ ‘use-package’ throws an error if you try to pin a package to an
+archive that has not been configured using ‘package-archives’ (apart
+from the magic ‘manual’ archive mentioned above):
+
+ Archive 'foo' requested for package 'bar' is not available.
+
+ Example:
+
+ (use-package company
+ :ensure t
+ :pin melpa-stable)
+
+ (use-package evil
+ :ensure t)
+ ;; no :pin needed, as package.el will choose the version in melpa
+
+ (use-package adaptive-wrap
+ :ensure t
+ ;; as this package is available only in the gnu archive, this is
+ ;; technically not needed, but it helps to highlight where it
+ ;; comes from
+ :pin gnu)
+
+ (use-package org
+ :ensure t
+ ;; ignore org-mode from upstream and use a manually installed version
+ :pin manual)
+
+ *NOTE*: the ‘:pin’ argument has no effect on emacs versions < 24.4.
+
+
+File: use-package.info, Node: hook, Next: if when unless, Prev: ensure pin, Up: Keywords
+
+4.13 ‘:hook’
+============
+
+The ‘:hook’ keyword allows adding functions onto hooks, here only the
+basename of the hook is required. Thus, all of the following are
+equivalent:
+
+ (use-package ace-jump-mode
+ :hook prog-mode)
+
+ (use-package ace-jump-mode
+ :hook (prog-mode . ace-jump-mode))
+
+ (use-package ace-jump-mode
+ :commands ace-jump-mode
+ :init
+ (add-hook 'prog-mode-hook #'ace-jump-mode))
+
+ And likewise, when multiple hooks should be applied, the following
+are also equivalent:
+
+ (use-package ace-jump-mode
+ :hook (prog-mode text-mode))
+
+ (use-package ace-jump-mode
+ :hook ((prog-mode text-mode) . ace-jump-mode))
+
+ (use-package ace-jump-mode
+ :hook ((prog-mode . ace-jump-mode)
+ (text-mode . ace-jump-mode)))
+
+ (use-package ace-jump-mode
+ :commands ace-jump-mode
+ :init
+ (add-hook 'prog-mode-hook #'ace-jump-mode)
+ (add-hook 'text-mode-hook #'ace-jump-mode))
+
+ The use of ‘:hook’, as with ‘:bind’, ‘:mode’, ‘:interpreter’, etc.,
+causes the functions being hooked to implicitly be read as ‘:commands’
+(meaning they will establish interactive ‘autoload’ definitions for that
+module, if not already defined as functions), and so ‘:defer t’ is also
+implied by ‘:hook’.
+
+
+File: use-package.info, Node: if when unless, Next: load-path, Prev: hook, Up: Keywords
+
+4.14 ‘:if’, ‘:when’, ‘:unless’
+==============================
+
+You can use the ‘:if’ keyword to predicate the loading and
+initialization of modules.
+
+ For example, I only want ‘edit-server’ running for my main, graphical
+Emacs, not for other Emacsen I may start at the command line:
+
+ (use-package edit-server
+ :if window-system
+ :init
+ (add-hook 'after-init-hook 'server-start t)
+ (add-hook 'after-init-hook 'edit-server-start t))
+
+ In another example, we can load things conditional on the operating
+system:
+
+ (use-package exec-path-from-shell
+ :if (memq window-system '(mac ns))
+ :ensure t
+ :config
+ (exec-path-from-shell-initialize))
+
+ Note that ‘:when’ is provided as an alias for ‘:if’, and ‘:unless
+foo’ means the same thing as ‘:if (not foo)’.
+
+
+File: use-package.info, Node: load-path, Next: mode interpreter, Prev: if when unless, Up: Keywords
+
+4.15 ‘:load-path’
+=================
+
+If your package needs a directory added to the ‘load-path’ in order to
+load, use ‘:load-path’. This takes a symbol, a function, a string or a
+list of strings. If the path is relative, it is expanded within
+‘user-emacs-directory’:
+
+ (use-package ess-site
+ :load-path "site-lisp/ess/lisp/"
+ :commands R)
+
+ Note that when using a symbol or a function to provide a dynamically
+generated list of paths, you must inform the byte-compiler of this
+definition so the value is available at byte-compilation time. This is
+done by using the special form ‘eval-and-compile’ (as opposed to
+‘eval-when-compile’). Further, this value is fixed at whatever was
+determined during compilation, to avoid looking up the same information
+again on each startup:
+
+ (eval-and-compile
+ (defun ess-site-load-path ()
+ (shell-command "find ~ -path ess/lisp")))
+
+ (use-package ess-site
+ :load-path (lambda () (list (ess-site-load-path)))
+ :commands R)
+
+
+File: use-package.info, Node: mode interpreter, Next: magic magic-fallback, Prev: load-path, Up: Keywords
+
+4.16 ‘:mode’, ‘:interpreter’
+============================
+
+Similar to ‘:bind’, you can use ‘:mode’ and ‘:interpreter’ to establish
+a deferred binding within the ‘auto-mode-alist’ and
+‘interpreter-mode-alist’ variables. The specifier to either keyword can
+be a cons cell, a list of cons cells, or a string or regexp:
+
+ (use-package ruby-mode
+ :mode "\\.rb\\'"
+ :interpreter "ruby")
+
+ ;; The package is "python" but the mode is "python-mode":
+ (use-package python
+ :mode ("\\.py\\'" . python-mode)
+ :interpreter ("python" . python-mode))
+
+ If you aren’t using ‘:commands’, ‘:bind’, ‘:bind*’, ‘:bind-keymap’,
+‘:bind-keymap*’, ‘:mode’, or ‘:interpreter’ (all of which imply
+‘:defer’; see the docstring for ‘use-package’ for a brief description of
+each), you can still defer loading with the ‘:defer’ keyword:
+
+ (use-package ace-jump-mode
+ :defer t
+ :init
+ (autoload 'ace-jump-mode "ace-jump-mode" nil t)
+ (bind-key "C-." 'ace-jump-mode))
+
+ This does exactly the same thing as the following:
+
+ (use-package ace-jump-mode
+ :bind ("C-." . ace-jump-mode))
+
+
+File: use-package.info, Node: magic magic-fallback, Next: no-require, Prev: mode interpreter, Up: Keywords
+
+4.17 ‘:magic’, ‘:magic-fallback’
+================================
+
+Similar to ‘:mode‘ and ‘:interpreter‘, you can also use ‘:magic‘ and
+‘:magic-fallback‘ to cause certain function to be run if the beginning
+of a file matches a given regular expression. The difference between
+the two is that ‘:magic-fallback‘ has a lower priority than ‘:mode‘.
+For example:
+
+ “‘ elisp (use-package pdf-tools :load-path "site-lisp/pdf-tools/lisp"
+:magic ("%PDF" . pdf-view-mode) :config (pdf-tools-install)) “‘
+
+ This registers an autoloaded command for ‘pdf-view-mode‘, defers
+loading of ‘pdf-tools‘, and runs ‘pdf-view-mode‘ if the beginning of a
+buffer matches the string ‘"%PDF"‘.
+
+
+File: use-package.info, Node: no-require, Next: requires, Prev: magic magic-fallback, Up: Keywords
+
+4.18 ‘:no-require’
+==================
+
+Normally, ‘use-package’ will load each package at compile time before
+compiling the configuration, to ensure that any necessary symbols are in
+scope to satisfy the byte-compiler. At times this can cause problems,
+since a package may have special loading requirements, and all that you
+want to use ‘use-package’ for is to add a configuration to the
+‘eval-after-load’ hook. In such cases, use the ‘:no-require’ keyword:
+
+ (use-package foo
+ :no-require t
+ :config
+ (message "This is evaluated when `foo' is loaded"))
+
+
+File: use-package.info, Node: requires, Prev: no-require, Up: Keywords
+
+4.19 ‘:requires’
+================
+
+While the ‘:after’ keyword delays loading until the dependencies are
+loaded, the somewhat simpler ‘:requires’ keyword simply never loads the
+package if the dependencies are not available at the time the
+‘use-package’ declaration is encountered. By "available" in this
+context it means that ‘foo’ is available of ‘(featurep 'foo)’ evaluates
+to a non-nil value. For example:
+
+ (use-package abbrev
+ :requires foo)
+
+ This is the same as:
+
+ (use-package abbrev
+ :if (featurep 'foo))
+
+ As a convenience, a list of such packages may be specified:
+
+ (use-package abbrev
+ :requires (foo bar baz))
+
+ For more complex logic, such as that supported by ‘:after’, simply
+use ‘:if’ and the appropriate Lisp expression.
+
+
+File: use-package.info, Node: FAQ, Next: Debugging Tools, Prev: Keywords, Up: Top
+
+Appendix A FAQ
+**************
+
+The next two nodes lists frequently asked questions.
+
+ Please also use the *note Debugging Tools::.
+
+* Menu:
+
+* FAQ - How to ...?::
+* FAQ - Issues and Errors::
+
+
+File: use-package.info, Node: FAQ - How to ...?, Next: FAQ - Issues and Errors, Up: FAQ
+
+A.1 FAQ - How to ...?
+=====================
+
+* Menu:
+
+* This is a question::
+
+
+File: use-package.info, Node: This is a question, Up: FAQ - How to ...?
+
+A.1.1 This is a question
+------------------------
+
+This is an answer.
+
+
+File: use-package.info, Node: FAQ - Issues and Errors, Prev: FAQ - How to ...?, Up: FAQ
+
+A.2 FAQ - Issues and Errors
+===========================
+
+* Menu:
+
+* This is an issues::
+
+
+File: use-package.info, Node: This is an issues, Up: FAQ - Issues and Errors
+
+A.2.1 This is an issues
+-----------------------
+
+This is a description.
+
+
+File: use-package.info, Node: Debugging Tools, Next: Command Index, Prev: FAQ, Up: Top
+
+B Debugging Tools
+*****************
+
+TODO
+
+ Please also see the *note FAQ::.
+
+
+File: use-package.info, Node: Command Index, Next: Function Index, Prev: Debugging Tools, Up: Top
+
+Appendix C Command Index
+************************
+
+
+File: use-package.info, Node: Function Index, Next: Variable Index, Prev: Command Index, Up: Top
+
+Appendix D Function Index
+*************************
+
+
+File: use-package.info, Node: Variable Index, Prev: Function Index, Up: Top
+
+Appendix E Variable Index
+*************************
+
+
+
+Tag Table:
+Node: Top784
+Node: Introduction2819
+Node: Installation3306
+Node: Installing from an Elpa Archive3658
+Node: Installing from the Git Repository4773
+Node: Post-Installation Tasks6309
+Node: Getting Started7024
+Node: Keywords7196
+Node: after8115
+Node: bind-keymap bind-keymap*9647
+Node: bind bind*10700
+Node: Binding to local keymaps12740
+Node: commands13831
+Node: preface init config13973
+Node: custom16051
+Node: custom-face16491
+Node: defer demand16811
+Node: defines functions17623
+Node: diminish delight18768
+Node: disabled20711
+Node: ensure pin21206
+Node: hook23936
+Node: if when unless25354
+Node: load-path26300
+Node: mode interpreter27446
+Node: magic magic-fallback28757
+Node: no-require29602
+Node: requires30306
+Node: FAQ31193
+Node: FAQ - How to ...?31476
+Node: This is a question31648
+Node: FAQ - Issues and Errors31796
+Node: This is an issues31979
+Node: Debugging Tools32134
+Node: Command Index32308
+Node: Function Index32464
+Node: Variable Index32621
+
+End Tag Table
+
+
+Local Variables:
+coding: utf-8
+End:
diff --git a/elpa/yasnippet-20200604.246/yasnippet-autoloads.el b/elpa/yasnippet-20200604.246/yasnippet-autoloads.el
new file mode 100644
index 0000000..fc8fcd9
--- /dev/null
+++ b/elpa/yasnippet-20200604.246/yasnippet-autoloads.el
@@ -0,0 +1,81 @@
+;;; yasnippet-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*-
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+
+;;;### (autoloads nil "yasnippet" "yasnippet.el" (0 0 0 0))
+;;; Generated autoloads from yasnippet.el
+
+(autoload 'yas-minor-mode "yasnippet" "\
+Toggle YASnippet mode.
+
+This is a minor mode. If called interactively, toggle the `yas
+minor mode' mode. If the prefix argument is positive, enable the
+mode, and if it is zero or negative, disable the mode.
+
+If called from Lisp, toggle the mode if ARG is `toggle'. Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+To check whether the minor mode is enabled in the current buffer,
+evaluate `yas-minor-mode'.
+
+The mode's hook is called both when the mode is enabled and when
+it is disabled.
+
+When YASnippet mode is enabled, `yas-expand', normally bound to
+the TAB key, expands snippets of code depending on the major
+mode.
+
+With no argument, this command toggles the mode.
+positive prefix argument turns on the mode.
+Negative prefix argument turns off the mode.
+
+Key bindings:
+\\{yas-minor-mode-map}
+
+\(fn &optional ARG)" t nil)
+
+(put 'yas-global-mode 'globalized-minor-mode t)
+
+(defvar yas-global-mode nil "\
+Non-nil if Yas-Global mode is enabled.
+See the `yas-global-mode' command
+for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `yas-global-mode'.")
+
+(custom-autoload 'yas-global-mode "yasnippet" nil)
+
+(autoload 'yas-global-mode "yasnippet" "\
+Toggle Yas minor mode in all buffers.
+With prefix ARG, enable Yas-Global mode if ARG is positive; otherwise,
+disable it.
+
+If called from Lisp, toggle the mode if ARG is `toggle'.
+Enable the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+Yas minor mode is enabled in all buffers where `yas-minor-mode-on'
+would do it.
+
+See `yas-minor-mode' for more information on Yas minor mode.
+
+\(fn &optional ARG)" t nil)
+(autoload 'snippet-mode "yasnippet" "A mode for editing yasnippets" t nil)
+
+(register-definition-prefixes "yasnippet" '("help-snippet-def" "snippet-mode-map" "yas"))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; yasnippet-autoloads.el ends here
diff --git a/elpa/yasnippet-20200604.246/yasnippet-pkg.el b/elpa/yasnippet-20200604.246/yasnippet-pkg.el
new file mode 100644
index 0000000..22d3cc6
--- /dev/null
+++ b/elpa/yasnippet-20200604.246/yasnippet-pkg.el
@@ -0,0 +1,2 @@
+;;; Generated package description from yasnippet.el -*- no-byte-compile: t -*-
+(define-package "yasnippet" "20200604.246" "Yet another snippet extension for Emacs" '((cl-lib "0.5")) :commit "5cbdbf0d2015540c59ed8ee0fcf4788effdf75b6" :maintainer '("Noam Postavsky" . "npostavs@gmail.com") :keywords '("convenience" "emulation") :url "http://github.com/joaotavora/yasnippet")
diff --git a/elpa/yasnippet-20200604.246/yasnippet.el b/elpa/yasnippet-20200604.246/yasnippet.el
new file mode 100644
index 0000000..3eaae4c
--- /dev/null
+++ b/elpa/yasnippet-20200604.246/yasnippet.el
@@ -0,0 +1,5311 @@
+;;; yasnippet.el --- Yet another snippet extension for Emacs
+
+;; Copyright (C) 2008-2019 Free Software Foundation, Inc.
+;; Authors: pluskid <pluskid@gmail.com>,
+;; João Távora <joaotavora@gmail.com>,
+;; Noam Postavsky <npostavs@gmail.com>
+;; Maintainer: Noam Postavsky <npostavs@gmail.com>
+;; Version: 0.14.0
+;; Package-Version: 20200604.246
+;; Package-Commit: 5cbdbf0d2015540c59ed8ee0fcf4788effdf75b6
+;; X-URL: http://github.com/joaotavora/yasnippet
+;; Keywords: convenience, emulation
+;; URL: http://github.com/joaotavora/yasnippet
+;; Package-Requires: ((cl-lib "0.5"))
+;; EmacsWiki: YaSnippetMode
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Basic steps to setup:
+;;
+;; (add-to-list 'load-path
+;; "~/path-to-yasnippet")
+;; (require 'yasnippet)
+;; (yas-global-mode 1)
+;;
+;;
+;; Interesting variables are:
+;;
+;; `yas-snippet-dirs'
+;;
+;; The directory where user-created snippets are to be
+;; stored. Can also be a list of directories. In that case,
+;; when used for bulk (re)loading of snippets (at startup or
+;; via `yas-reload-all'), directories appearing earlier in
+;; the list override other dir's snippets. Also, the first
+;; directory is taken as the default for storing the user's
+;; new snippets.
+;;
+;; The deprecated `yas/root-directory' aliases this variable
+;; for backward-compatibility.
+;;
+;;
+;; Major commands are:
+;;
+;; M-x yas-expand
+;;
+;; Try to expand snippets before point. In `yas-minor-mode',
+;; this is normally bound to TAB, but you can customize it in
+;; `yas-minor-mode-map'.
+;;
+;; M-x yas-load-directory
+;;
+;; Prompts you for a directory hierarchy of snippets to load.
+;;
+;; M-x yas-activate-extra-mode
+;;
+;; Prompts you for an extra mode to add snippets for in the
+;; current buffer.
+;;
+;; M-x yas-insert-snippet
+;;
+;; Prompts you for possible snippet expansion if that is
+;; possible according to buffer-local and snippet-local
+;; expansion conditions. With prefix argument, ignore these
+;; conditions.
+;;
+;; M-x yas-visit-snippet-file
+;;
+;; Prompts you for possible snippet expansions like
+;; `yas-insert-snippet', but instead of expanding it, takes
+;; you directly to the snippet definition's file, if it
+;; exists.
+;;
+;; M-x yas-new-snippet
+;;
+;; Lets you create a new snippet file in the correct
+;; subdirectory of `yas-snippet-dirs', according to the
+;; active major mode.
+;;
+;; M-x yas-load-snippet-buffer
+;;
+;; When editing a snippet, this loads the snippet. This is
+;; bound to "C-c C-c" while in the `snippet-mode' editing
+;; mode.
+;;
+;; M-x yas-tryout-snippet
+;;
+;; When editing a snippet, this opens a new empty buffer,
+;; sets it to the appropriate major mode and inserts the
+;; snippet there, so you can see what it looks like. This is
+;; bound to "C-c C-t" while in `snippet-mode'.
+;;
+;; M-x yas-describe-tables
+;;
+;; Lists known snippets in a separate buffer. User is
+;; prompted as to whether only the currently active tables
+;; are to be displayed, or all the tables for all major
+;; modes.
+;;
+;; If you have `dropdown-list' installed, you can optionally use it
+;; as the preferred "prompting method", putting in your .emacs file,
+;; for example:
+;;
+;; (require 'dropdown-list)
+;; (setq yas-prompt-functions '(yas-dropdown-prompt
+;; yas-ido-prompt
+;; yas-completing-prompt))
+;;
+;; Also check out the customization group
+;;
+;; M-x customize-group RET yasnippet RET
+;;
+;; If you use the customization group to set variables
+;; `yas-snippet-dirs' or `yas-global-mode', make sure the path to
+;; "yasnippet.el" is present in the `load-path' *before* the
+;; `custom-set-variables' is executed in your .emacs file.
+;;
+;; For more information and detailed usage, refer to the project page:
+;; http://github.com/joaotavora/yasnippet
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'eldoc) ; Needed for 24.
+(declare-function cl-progv-after "cl-extra") ; Needed for 23.4.
+(require 'easymenu)
+(require 'help-mode)
+
+(defvar yas--editing-template)
+(defvar yas--guessed-modes)
+(defvar yas--indent-original-column)
+(defvar yas--scheduled-jit-loads)
+(defvar yas-keymap)
+(defvar yas-selected-text)
+(defvar yas-verbosity)
+(defvar yas--current-template)
+
+
+;;; User customizable variables
+
+(defgroup yasnippet nil
+ "Yet Another Snippet extension"
+ :prefix "yas-"
+ :group 'editing)
+
+(defconst yas--loaddir
+ (file-name-directory (or load-file-name buffer-file-name))
+ "Directory that yasnippet was loaded from.")
+
+(defconst yas-installed-snippets-dir (expand-file-name "snippets" yas--loaddir))
+(make-obsolete-variable 'yas-installed-snippets-dir "\
+Yasnippet no longer comes with installed snippets" "0.14")
+
+(defconst yas--default-user-snippets-dir
+ (expand-file-name "snippets" user-emacs-directory))
+
+(defcustom yas-snippet-dirs (list yas--default-user-snippets-dir)
+ "List of top-level snippet directories.
+
+Each element, a string or a symbol whose value is a string,
+designates a top-level directory where per-mode snippet
+directories can be found.
+
+Elements appearing earlier in the list override later elements'
+snippets.
+
+The first directory is taken as the default for storing snippet's
+created with `yas-new-snippet'. "
+ :type '(choice (directory :tag "Single directory")
+ (repeat :tag "List of directories"
+ (choice (directory) (variable))))
+ :set #'(lambda (symbol new)
+ (let ((old (and (boundp symbol)
+ (symbol-value symbol))))
+ (set-default symbol new)
+ (unless (or (not (fboundp 'yas-reload-all))
+ (equal old new))
+ (yas-reload-all)))))
+
+(defun yas-snippet-dirs ()
+ "Return variable `yas-snippet-dirs' as list of strings."
+ (cl-loop for e in (if (listp yas-snippet-dirs)
+ yas-snippet-dirs
+ (list yas-snippet-dirs))
+ collect
+ (cond ((stringp e) e)
+ ((and (symbolp e)
+ (boundp e)
+ (stringp (symbol-value e)))
+ (symbol-value e))
+ (t
+ (error "[yas] invalid element %s in `yas-snippet-dirs'" e)))))
+
+(defcustom yas-new-snippet-default "\
+# -*- mode: snippet -*-
+# name: $1
+# key: ${2:${1:$(yas--key-from-desc yas-text)}}
+# --
+$0`(yas-escape-text yas-selected-text)`"
+ "Default snippet to use when creating a new snippet.
+If nil, don't use any snippet."
+ :type 'string)
+
+(defcustom yas-prompt-functions '(yas-dropdown-prompt
+ yas-completing-prompt
+ yas-maybe-ido-prompt
+ yas-no-prompt)
+ "Functions to prompt for keys, templates, etc interactively.
+
+These functions are called with the following arguments:
+
+- PROMPT: A string to prompt the user
+
+- CHOICES: a list of strings or objects.
+
+- optional DISPLAY-FN : A function that, when applied to each of
+the objects in CHOICES will return a string.
+
+The return value of any function you put here should be one of
+the objects in CHOICES, properly formatted with DISPLAY-FN (if
+that is passed).
+
+- To signal that your particular style of prompting is
+unavailable at the moment, you can also have the function return
+nil.
+
+- To signal that the user quit the prompting process, you can
+signal `quit' with
+
+ (signal \\='quit \"user quit!\")"
+ :type '(repeat function))
+
+(defcustom yas-indent-line 'auto
+ "Controls indenting applied to a recent snippet expansion.
+
+The following values are possible:
+
+- `fixed' Indent the snippet to the current column;
+
+- `auto' Indent each line of the snippet with `indent-according-to-mode'
+
+Every other value means don't apply any snippet-side indentation
+after expansion (the manual per-line \"$>\" indentation still
+applies)."
+ :type '(choice (const :tag "Nothing" nothing)
+ (const :tag "Fixed" fixed)
+ (const :tag "Auto" auto)))
+
+(defcustom yas-also-auto-indent-first-line nil
+ "Non-nil means also auto indent first line according to mode.
+
+Naturally this is only valid when `yas-indent-line' is `auto'."
+ :type 'boolean)
+
+(defcustom yas-also-indent-empty-lines nil
+ "Non-nil means also indent empty lines according to mode."
+ :type 'boolean)
+
+(defcustom yas-snippet-revival t
+ "Non-nil means re-activate snippet fields after undo/redo."
+ :type 'boolean)
+
+(defcustom yas-triggers-in-field nil
+ "If non-nil, allow stacked expansions (snippets inside snippets).
+
+Otherwise `yas-next-field-or-maybe-expand' just moves on to the
+next field"
+ :type 'boolean)
+
+(defcustom yas-fallback-behavior 'return-nil
+ "This option is obsolete.
+Now that the conditional keybinding `yas-maybe-expand' is
+available, there's no more need for it."
+ :type '(choice (const :tag "Call previous command" call-other-command)
+ (const :tag "Do nothing" return-nil)))
+
+(make-obsolete-variable
+ 'yas-fallback-behavior
+ "For `call-other-command' behavior bind to the conditional
+command value `yas-maybe-expand', for `return-nil' behavior bind
+directly to `yas-expand'."
+ "0.12")
+
+(defcustom yas-choose-keys-first nil
+ "If non-nil, prompt for snippet key first, then for template.
+
+Otherwise prompts for all possible snippet names.
+
+This affects `yas-insert-snippet' and `yas-visit-snippet-file'."
+ :type 'boolean)
+
+(defcustom yas-choose-tables-first nil
+ "If non-nil, and multiple eligible snippet tables, prompts user for tables first.
+
+Otherwise, user chooses between the merging together of all
+eligible tables.
+
+This affects `yas-insert-snippet', `yas-visit-snippet-file'"
+ :type 'boolean)
+
+(defcustom yas-use-menu 'abbreviate
+ "Display a YASnippet menu in the menu bar.
+
+When non-nil, submenus for each snippet table will be listed
+under the menu \"Yasnippet\".
+
+- If set to `abbreviate', only the current major-mode
+menu and the modes set in `yas--extra-modes' are listed.
+
+- If set to `full', every submenu is listed
+
+- If set to nil, hide the menu.
+
+Any other non-nil value, every submenu is listed."
+ :type '(choice (const :tag "Full" full)
+ (const :tag "Abbreviate" abbreviate)
+ (const :tag "No menu" nil)))
+
+(defcustom yas-trigger-symbol (or (and (eq window-system 'mac)
+ (ignore-errors
+ (char-to-string ?\x21E5))) ;; little ->| sign
+ " =>")
+ "The text that will be used in menu to represent the trigger."
+ :type 'string)
+
+(defcustom yas-wrap-around-region nil
+ "What to insert for snippet's $0 field.
+
+If set to a character, insert contents of corresponding register.
+If non-nil insert region contents. This can be overridden on a
+per-snippet basis. A value of `cua' is considered equivalent to
+`?0' for backwards compatibility."
+ :type '(choice (character :tag "Insert from register")
+ (const t :tag "Insert region contents")
+ (const nil :tag "Don't insert anything")
+ (const cua))) ; backwards compat
+
+(defcustom yas-good-grace t
+ "If non-nil, don't raise errors in elisp evaluation.
+
+This affects both the inline elisp in snippets and the hook
+variables such as `yas-after-exit-snippet-hook'.
+
+If this variable's value is `inline', an error string \"[yas]
+error\" is returned instead of raising the error. If this
+variable's value is `hooks', a message is output to according to
+`yas-verbosity-level'. If this variable's value is t, both are
+active."
+ :type 'boolean)
+
+(defcustom yas-visit-from-menu nil
+ "If non-nil visit snippets's files from menu, instead of expanding them.
+
+This can only work when snippets are loaded from files."
+ :type 'boolean)
+
+(defcustom yas-expand-only-for-last-commands nil
+ "List of `last-command' values to restrict tab-triggering to, or nil.
+
+Leave this set at nil (the default) to be able to trigger an
+expansion simply by placing the cursor after a valid tab trigger,
+using whichever commands.
+
+Optionally, set this to something like (self-insert-command) if
+you to wish restrict expansion to only happen when the last
+letter of the snippet tab trigger was typed immediately before
+the trigger key itself."
+ :type '(repeat function))
+
+(defcustom yas-alias-to-yas/prefix-p t
+ "If non-nil make aliases for the old style yas/ prefixed symbols.
+It must be set to nil before loading yasnippet to take effect."
+ :type 'boolean)
+
+;; Only two faces, and one of them shouldn't even be used...
+;;
+(defface yas-field-highlight-face
+ '((t (:inherit region)))
+ "The face used to highlight the currently active field of a snippet")
+
+(defface yas--field-debug-face
+ '()
+ "The face used for debugging some overlays normally hidden")
+
+
+;;; User-visible variables
+
+(defconst yas-maybe-skip-and-clear-field
+ '(menu-item "" yas-skip-and-clear-field
+ :filter yas--maybe-clear-field-filter)
+ "A conditional key definition.
+This can be used as a key definition in keymaps to bind a key to
+`yas-skip-and-clear-field' only when at the beginning of an
+unmodified snippet field.")
+
+(defconst yas-maybe-clear-field
+ '(menu-item "" yas-clear-field
+ :filter yas--maybe-clear-field-filter)
+ "A conditional key definition.
+This can be used as a key definition in keymaps to bind a key to
+`yas-clear-field' only when at the beginning of an
+unmodified snippet field.")
+
+(defun yas-filtered-definition (def)
+ "Return a condition key definition.
+The condition will respect the value of `yas-keymap-disable-hook'."
+ `(menu-item "" ,def
+ :filter ,(lambda (cmd) (unless (run-hook-with-args-until-success
+ 'yas-keymap-disable-hook)
+ cmd))))
+
+(defvar yas-keymap
+ (let ((map (make-sparse-keymap)))
+ (define-key map [(tab)] (yas-filtered-definition 'yas-next-field-or-maybe-expand))
+ (define-key map (kbd "TAB") (yas-filtered-definition 'yas-next-field-or-maybe-expand))
+ (define-key map [(shift tab)] (yas-filtered-definition 'yas-prev-field))
+ (define-key map [backtab] (yas-filtered-definition 'yas-prev-field))
+ (define-key map (kbd "C-g") (yas-filtered-definition 'yas-abort-snippet))
+ ;; Yes, filters can be chained!
+ (define-key map (kbd "C-d") (yas-filtered-definition yas-maybe-skip-and-clear-field))
+ (define-key map (kbd "DEL") (yas-filtered-definition yas-maybe-clear-field))
+ map)
+ "The active keymap while a snippet expansion is in progress.")
+
+(defvar yas-key-syntaxes (list #'yas-try-key-from-whitespace
+ "w_.()" "w_." "w_" "w")
+ "Syntaxes and functions to help look for trigger keys before point.
+
+Each element in this list specifies how to skip buffer positions
+backwards and look for the start of a trigger key.
+
+Each element can be either a string or a function receiving the
+original point as an argument. A string element is simply passed
+to `skip-syntax-backward' whereas a function element is called
+with no arguments and should also place point before the original
+position.
+
+The string between the resulting buffer position and the original
+point is matched against the trigger keys in the active snippet
+tables.
+
+If no expandable snippets are found, the next element is the list
+is tried, unless a function element returned the symbol `again',
+in which case it is called again from the previous position and
+may once more reposition point.
+
+For example, if `yas-key-syntaxes' has the value (\"w\" \"w_\"),
+trigger keys composed exclusively of \"word\"-syntax characters
+are looked for first. Failing that, longer keys composed of
+\"word\" or \"symbol\" syntax are looked for. Therefore,
+triggering after
+
+foo-barbaz
+
+will, according to the \"w\" element first try \"barbaz\". If
+that isn't a trigger key, \"foo-barbaz\" is tried, respecting the
+second \"w_\" element. Notice that even if \"baz\" is a trigger
+key for an active snippet, it won't be expanded, unless a
+function is added to `yas-key-syntaxes' that eventually places
+point between \"bar\" and \"baz\".
+
+See also Info node `(elisp) Syntax Descriptors'.")
+
+(defvar yas-after-exit-snippet-hook
+ '()
+ "Hooks to run after a snippet exited.
+
+The hooks will be run in an environment where some variables bound to
+proper values:
+
+`yas-snippet-beg' : The beginning of the region of the snippet.
+
+`yas-snippet-end' : Similar to beg.
+
+Attention: These hooks are not run when exiting nested/stacked snippet expansion!")
+
+(defvar yas-before-expand-snippet-hook
+ '()
+ "Hooks to run just before expanding a snippet.")
+
+(defconst yas-not-string-or-comment-condition
+ '(if (let ((ppss (syntax-ppss)))
+ (or (nth 3 ppss) (nth 4 ppss)))
+ '(require-snippet-condition . force-in-comment)
+ t)
+ "Disables snippet expansion in strings and comments.
+To use, set `yas-buffer-local-condition' to this value.")
+
+(defcustom yas-buffer-local-condition t
+ "Snippet expanding condition.
+
+This variable is a Lisp form which is evaluated every time a
+snippet expansion is attempted:
+
+ * If it evaluates to nil, no snippets can be expanded.
+
+ * If it evaluates to the a cons (require-snippet-condition
+ . REQUIREMENT)
+
+ * Snippets bearing no \"# condition:\" directive are not
+ considered
+
+ * Snippets bearing conditions that evaluate to nil (or
+ produce an error) won't be considered.
+
+ * If the snippet has a condition that evaluates to non-nil
+ RESULT:
+
+ * If REQUIREMENT is t, the snippet is considered
+
+ * If REQUIREMENT is `eq' RESULT, the snippet is
+ considered
+
+ * Otherwise, the snippet is not considered.
+
+ * If it evaluates to the symbol `always', all snippets are
+ considered for expansion, regardless of any conditions.
+
+ * If it evaluates to t or some other non-nil value
+
+ * Snippet bearing no conditions, or conditions that
+ evaluate to non-nil, are considered for expansion.
+
+ * Otherwise, the snippet is not considered.
+
+Here's an example preventing snippets from being expanded from
+inside comments, in `python-mode' only, with the exception of
+snippets returning the symbol `force-in-comment' in their
+conditions.
+
+ (add-hook \\='python-mode-hook
+ (lambda ()
+ (setq yas-buffer-local-condition
+ \\='(if (python-syntax-comment-or-string-p)
+ \\='(require-snippet-condition . force-in-comment)
+ t))))"
+ :type
+ `(choice
+ (const :tag "Disable snippet expansion inside strings and comments"
+ ,yas-not-string-or-comment-condition)
+ (const :tag "Expand all snippets regardless of conditions" always)
+ (const :tag "Expand snippets unless their condition is nil" t)
+ (const :tag "Disable all snippet expansion" nil)
+ sexp))
+
+(defcustom yas-keymap-disable-hook nil
+ "The `yas-keymap' bindings are disabled if any function in this list returns non-nil.
+This is useful to control whether snippet navigation bindings
+override bindings from other packages (e.g., `company-mode')."
+ :type 'hook)
+
+(defcustom yas-overlay-priority 100
+ "Priority to use for yasnippets overlays.
+This is useful to control whether snippet navigation bindings
+override `keymap' overlay property bindings from other packages."
+ :type 'integer)
+
+(defcustom yas-inhibit-overlay-modification-protection nil
+ "If nil, changing text outside the active field aborts the snippet.
+This protection is intended to prevent yasnippet from ending up
+in an inconsistent state. However, some packages (e.g., the
+company completion package) may trigger this protection when it
+is not needed. In that case, setting this variable to non-nil
+can be useful."
+ ;; See also `yas--on-protection-overlay-modification'.
+ :type 'boolean)
+
+
+;;; Internal variables
+
+(defconst yas--version "0.14.0")
+
+(defvar yas--menu-table (make-hash-table)
+ "A hash table of MAJOR-MODE symbols to menu keymaps.")
+
+(defvar yas--escaped-characters
+ '(?\\ ?` ?\" ?' ?$ ?} ?{ ?\( ?\))
+ "List of characters which *might* need to be escaped.")
+
+(defconst yas--field-regexp
+ "${\\([0-9]+:\\)?\\([^}]*\\)}"
+ "A regexp to *almost* recognize a field.")
+
+(defconst yas--multi-dollar-lisp-expression-regexp
+ "$+[ \t\n]*\\(([^)]*)\\)"
+ "A regexp to *almost* recognize a \"$(...)\" expression.")
+
+(defconst yas--backquote-lisp-expression-regexp
+ "`\\([^`]*\\)`"
+ "A regexp to recognize a \"\\=`lisp-expression\\=`\" expression." )
+
+(defconst yas--transform-mirror-regexp
+ "${\\(?:\\([0-9]+\\):\\)?$\\([ \t\n]*([^}]*\\)"
+ "A regexp to *almost* recognize a mirror with a transform.")
+
+(defconst yas--simple-mirror-regexp
+ "$\\([0-9]+\\)"
+ "A regexp to recognize a simple mirror.")
+
+(defvar yas--snippet-id-seed 0
+ "Contains the next id for a snippet.")
+
+(defvar yas--original-auto-fill-function nil
+ "The original value of `auto-fill-function'.")
+(make-variable-buffer-local 'yas--original-auto-fill-function)
+
+(defvar yas--watch-auto-fill-backtrace nil)
+
+(defun yas--watch-auto-fill (sym newval op _where)
+ (when (and (or (and (eq sym 'yas--original-auto-fill-function)
+ (null newval)
+ (eq auto-fill-function 'yas--auto-fill))
+ (and (eq sym 'auto-fill-function)
+ (eq newval 'yas--auto-fill)
+ (null yas--original-auto-fill-function)))
+ (null yas--watch-auto-fill-backtrace)
+ (fboundp 'backtrace-frames) ; Suppress compiler warning.
+ ;; If we're about to change `auto-fill-function' too,
+ ;; it's okay (probably).
+ (not (and (eq op 'makunbound)
+ (not (eq (default-value 'auto-fill-function) 'yas--auto-fill))
+ (cl-member 'kill-all-local-variables
+ (backtrace-frames 'yas--watch-auto-fill)
+ :key (lambda (frame) (nth 1 frame))))))
+ (setq yas--watch-auto-fill-backtrace
+ (backtrace-frames 'yas--watch-auto-fill))))
+
+;; Try to get more info on #873/919 (this only works for Emacs 26+).
+(when (fboundp 'add-variable-watcher)
+ (add-variable-watcher 'yas--original-auto-fill-function
+ #'yas--watch-auto-fill)
+ (add-variable-watcher 'auto-fill-function
+ #'yas--watch-auto-fill))
+
+(defun yas--snippet-next-id ()
+ (let ((id yas--snippet-id-seed))
+ (cl-incf yas--snippet-id-seed)
+ id))
+
+
+;;; Minor mode stuff
+
+(defvar yas--minor-mode-menu nil
+ "Holds the YASnippet menu.")
+
+(defvar yas--condition-cache-timestamp nil)
+
+(defun yas-maybe-expand-abbrev-key-filter (cmd)
+ "Return CMD if there is an expandable snippet at point.
+This function is useful as a `:filter' to a conditional key
+definition."
+ (when (let ((yas--condition-cache-timestamp (current-time)))
+ (yas--templates-for-key-at-point))
+ cmd))
+
+(define-obsolete-function-alias 'yas--maybe-expand-key-filter
+ #'yas-maybe-expand-abbrev-key-filter "0.14")
+
+(defconst yas-maybe-expand
+ '(menu-item "" yas-expand :filter yas-maybe-expand-abbrev-key-filter)
+ "A conditional key definition.
+This can be used as a key definition in keymaps to bind a key to
+`yas-expand' only when there is a snippet available to be
+expanded.")
+
+(defvar yas-minor-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map [(tab)] yas-maybe-expand)
+ (define-key map (kbd "TAB") yas-maybe-expand)
+ (define-key map "\C-c&\C-s" 'yas-insert-snippet)
+ (define-key map "\C-c&\C-n" 'yas-new-snippet)
+ (define-key map "\C-c&\C-v" 'yas-visit-snippet-file)
+ map)
+ "The keymap used when `yas-minor-mode' is active.")
+
+(easy-menu-define yas--minor-mode-menu
+ yas-minor-mode-map
+ "Menu used when `yas-minor-mode' is active."
+ '("YASnippet" :visible yas-use-menu
+ "----"
+ ["Expand trigger" yas-expand
+ :help "Possibly expand tab trigger before point"]
+ ["Insert at point..." yas-insert-snippet
+ :help "Prompt for an expandable snippet and expand it at point"]
+ ["New snippet..." yas-new-snippet
+ :help "Create a new snippet in an appropriate directory"]
+ ["Visit snippet file..." yas-visit-snippet-file
+ :help "Prompt for an expandable snippet and find its file"]
+ "----"
+ ("Snippet menu behaviour"
+ ["Visit snippets" (setq yas-visit-from-menu t)
+ :help "Visit snippets from the menu"
+ :active t :style radio :selected yas-visit-from-menu]
+ ["Expand snippets" (setq yas-visit-from-menu nil)
+ :help "Expand snippets from the menu"
+ :active t :style radio :selected (not yas-visit-from-menu)]
+ "----"
+ ["Show all known modes" (setq yas-use-menu 'full)
+ :help "Show one snippet submenu for each loaded table"
+ :active t :style radio :selected (eq yas-use-menu 'full)]
+ ["Abbreviate according to current mode" (setq yas-use-menu 'abbreviate)
+ :help "Show only snippet submenus for the current active modes"
+ :active t :style radio :selected (eq yas-use-menu 'abbreviate)])
+ ("Indenting"
+ ["Auto" (setq yas-indent-line 'auto)
+ :help "Indent each line of the snippet with `indent-according-to-mode'"
+ :active t :style radio :selected (eq yas-indent-line 'auto)]
+ ["Fixed" (setq yas-indent-line 'fixed)
+ :help "Indent the snippet to the current column"
+ :active t :style radio :selected (eq yas-indent-line 'fixed)]
+ ["None" (setq yas-indent-line 'none)
+ :help "Don't apply any particular snippet indentation after expansion"
+ :active t :style radio :selected (not (member yas-indent-line '(fixed auto)))]
+ "----"
+ ["Also auto indent first line" (setq yas-also-auto-indent-first-line
+ (not yas-also-auto-indent-first-line))
+ :help "When auto-indenting also, auto indent the first line menu"
+ :active (eq yas-indent-line 'auto)
+ :style toggle :selected yas-also-auto-indent-first-line]
+ )
+ ("Prompting method"
+ ["System X-widget" (setq yas-prompt-functions
+ (cons #'yas-x-prompt
+ (remove #'yas-x-prompt
+ yas-prompt-functions)))
+ :help "Use your windowing system's (gtk, mac, windows, etc...) default menu"
+ :active t :style radio :selected (eq (car yas-prompt-functions)
+ #'yas-x-prompt)]
+ ["Dropdown-list" (setq yas-prompt-functions
+ (cons #'yas-dropdown-prompt
+ (remove #'yas-dropdown-prompt
+ yas-prompt-functions)))
+ :help "Use a special dropdown list"
+ :active t :style radio :selected (eq (car yas-prompt-functions)
+ #'yas-dropdown-prompt)]
+ ["Ido" (setq yas-prompt-functions
+ (cons #'yas-ido-prompt
+ (remove #'yas-ido-prompt
+ yas-prompt-functions)))
+ :help "Use an ido-style minibuffer prompt"
+ :active t :style radio :selected (eq (car yas-prompt-functions)
+ #'yas-ido-prompt)]
+ ["Completing read" (setq yas-prompt-functions
+ (cons #'yas-completing-prompt
+ (remove #'yas-completing-prompt
+ yas-prompt-functions)))
+ :help "Use a normal minibuffer prompt"
+ :active t :style radio :selected (eq (car yas-prompt-functions)
+ #'yas-completing-prompt)]
+ )
+ ("Misc"
+ ["Wrap region in exit marker"
+ (setq yas-wrap-around-region
+ (not yas-wrap-around-region))
+ :help "If non-nil automatically wrap the selected text in the $0 snippet exit"
+ :style toggle :selected yas-wrap-around-region]
+ ["Allow stacked expansions "
+ (setq yas-triggers-in-field
+ (not yas-triggers-in-field))
+ :help "If non-nil allow snippets to be triggered inside other snippet fields"
+ :style toggle :selected yas-triggers-in-field]
+ ["Revive snippets on undo "
+ (setq yas-snippet-revival
+ (not yas-snippet-revival))
+ :help "If non-nil allow snippets to become active again after undo"
+ :style toggle :selected yas-snippet-revival]
+ ["Good grace "
+ (setq yas-good-grace
+ (not yas-good-grace))
+ :help "If non-nil don't raise errors in bad embedded elisp in snippets"
+ :style toggle :selected yas-good-grace]
+ )
+ "----"
+ ["Load snippets..." yas-load-directory
+ :help "Load snippets from a specific directory"]
+ ["Reload everything" yas-reload-all
+ :help "Cleanup stuff, reload snippets, rebuild menus"]
+ ["About" yas-about
+ :help "Display some information about YASnippet"]))
+
+(define-obsolete-variable-alias 'yas-extra-modes 'yas--extra-modes "0.9.1")
+(defvar yas--extra-modes nil
+ "An internal list of modes for which to also lookup snippets.
+
+This variable probably makes more sense as buffer-local, so
+ensure your use `make-local-variable' when you set it.")
+
+(defvar yas--tables (make-hash-table)
+ "A hash table of mode symbols to `yas--table' objects.")
+
+(defvar yas--parents (make-hash-table)
+ "A hash table of mode symbols do lists of direct parent mode symbols.
+
+This list is populated when reading the \".yas-parents\" files
+found when traversing snippet directories with
+`yas-load-directory'.
+
+There might be additional parenting information stored in the
+`derived-mode-parent' property of some mode symbols, but that is
+not recorded here.")
+
+(defvar yas--direct-keymaps (list)
+ "Keymap alist supporting direct snippet keybindings.
+
+This variable is placed in `emulation-mode-map-alists'.
+
+Its elements looks like (TABLE-NAME . KEYMAP). They're
+instantiated on `yas-reload-all' but KEYMAP is added to only when
+loading snippets. `yas--direct-TABLE-NAME' is then a variable
+set buffer-locally when entering `yas-minor-mode'. KEYMAP binds
+all defined direct keybindings to `yas-maybe-expand-from-keymap'
+which decides on the snippet to expand.")
+
+(defun yas-direct-keymaps-reload ()
+ "Force reload the direct keybinding for active snippet tables."
+ (interactive)
+ (setq yas--direct-keymaps nil)
+ (maphash #'(lambda (name table)
+ (push (cons (intern (format "yas--direct-%s" name))
+ (yas--table-direct-keymap table))
+ yas--direct-keymaps))
+ yas--tables))
+
+(defun yas--modes-to-activate (&optional mode)
+ "Compute list of mode symbols that are active for `yas-expand' and friends."
+ (defvar yas--dfs) ;We rely on dynbind. We could use `letrec' instead!
+ (let* ((explored (if mode (list mode) ; Building up list in reverse.
+ (cons major-mode (reverse yas--extra-modes))))
+ (yas--dfs
+ (lambda (mode)
+ (cl-loop for neighbour
+ in (cl-list* (or (get mode 'derived-mode-parent)
+ ;; Consider `fundamental-mode'
+ ;; as ultimate ancestor.
+ 'fundamental-mode)
+ ;; NOTE: `fboundp' check is redundant
+ ;; since Emacs 24.4.
+ (and (fboundp mode) (symbol-function mode))
+ (gethash mode yas--parents))
+ when (and neighbour
+ (not (memq neighbour explored))
+ (symbolp neighbour))
+ do (push neighbour explored)
+ (funcall yas--dfs neighbour)))))
+ (mapc yas--dfs explored)
+ (nreverse explored)))
+
+(defvar yas-minor-mode-hook nil
+ "Hook run when `yas-minor-mode' is turned on.")
+
+(defun yas--auto-fill-wrapper ()
+ (when (and auto-fill-function
+ (not (eq auto-fill-function #'yas--auto-fill)))
+ (setq yas--original-auto-fill-function auto-fill-function)
+ (setq auto-fill-function #'yas--auto-fill)))
+
+;;;###autoload
+(define-minor-mode yas-minor-mode
+ "Toggle YASnippet mode.
+
+When YASnippet mode is enabled, `yas-expand', normally bound to
+the TAB key, expands snippets of code depending on the major
+mode.
+
+With no argument, this command toggles the mode.
+positive prefix argument turns on the mode.
+Negative prefix argument turns off the mode.
+
+Key bindings:
+\\{yas-minor-mode-map}"
+ :lighter " yas" ;; The indicator for the mode line.
+ (cond ((and yas-minor-mode (featurep 'yasnippet))
+ ;; Install the direct keymaps in `emulation-mode-map-alists'
+ ;; (we use `add-hook' even though it's not technically a hook,
+ ;; but it works). Then define variables named after modes to
+ ;; index `yas--direct-keymaps'.
+ ;;
+ ;; Also install the post-command-hook.
+ ;;
+ (cl-pushnew 'yas--direct-keymaps emulation-mode-map-alists)
+ (add-hook 'post-command-hook #'yas--post-command-handler nil t)
+ ;; Set the `yas--direct-%s' vars for direct keymap expansion
+ ;;
+ (dolist (mode (yas--modes-to-activate))
+ (let ((name (intern (format "yas--direct-%s" mode))))
+ (set-default name nil)
+ (set (make-local-variable name) t)))
+ ;; Perform JIT loads
+ (yas--load-pending-jits)
+ ;; Install auto-fill handler.
+ (yas--auto-fill-wrapper) ; Now...
+ (add-hook 'auto-fill-mode-hook #'yas--auto-fill-wrapper)) ; or later.
+ (t
+ ;; Uninstall the direct keymaps, post-command hook, and
+ ;; auto-fill handler.
+ (remove-hook 'post-command-hook #'yas--post-command-handler t)
+ (remove-hook 'auto-fill-mode-hook #'yas--auto-fill-wrapper)
+ (when (local-variable-p 'yas--original-auto-fill-function)
+ (setq auto-fill-function yas--original-auto-fill-function))
+ (setq emulation-mode-map-alists
+ (remove 'yas--direct-keymaps emulation-mode-map-alists)))))
+
+(defun yas-activate-extra-mode (mode)
+ "Activates the snippets for the given `mode' in the buffer.
+
+The function can be called in the hook of a minor mode to
+activate snippets associated with that mode."
+ (interactive
+ (let (modes
+ symbol)
+ (maphash (lambda (k _)
+ (setq modes (cons (list k) modes)))
+ yas--parents)
+ (setq symbol (completing-read
+ "Activate mode: " modes nil t))
+ (list
+ (when (not (string= "" symbol))
+ (intern symbol)))))
+ (when mode
+ (add-to-list (make-local-variable 'yas--extra-modes) mode)
+ (yas--load-pending-jits)))
+
+(defun yas-deactivate-extra-mode (mode)
+ "Deactivates the snippets for the given `mode' in the buffer."
+ (interactive
+ (list (intern
+ (completing-read
+ "Deactivate mode: " (mapcar #'list yas--extra-modes) nil t))))
+ (set (make-local-variable 'yas--extra-modes)
+ (remove mode
+ yas--extra-modes)))
+
+(defun yas-temp-buffer-p (&optional buffer)
+ (eq (aref (buffer-name buffer) 0) ?\s))
+
+(define-obsolete-variable-alias 'yas-dont-activate
+ 'yas-dont-activate-functions "0.9.2")
+(defvar yas-dont-activate-functions (list #'minibufferp #'yas-temp-buffer-p)
+ "Special hook to control which buffers `yas-global-mode' affects.
+Functions are called with no argument, and should return non-nil to prevent
+`yas-global-mode' from enabling yasnippet in this buffer.
+
+In Emacsen < 24, this variable is buffer-local. Because
+`yas-minor-mode-on' is called by `yas-global-mode' after
+executing the buffer's major mode hook, setting this variable
+there is an effective way to define exceptions to the \"global\"
+activation behaviour.
+
+In Emacsen >= 24, only the global value is used. To define
+per-mode exceptions to the \"global\" activation behaviour, call
+`yas-minor-mode' with a negative argument directily in the major
+mode's hook.")
+(unless (> emacs-major-version 23)
+ (with-no-warnings
+ (make-variable-buffer-local 'yas-dont-activate)))
+
+
+(defun yas-minor-mode-on ()
+ "Turn on YASnippet minor mode.
+
+Honour `yas-dont-activate-functions', which see."
+ (interactive)
+ (unless (or
+ ;; The old behavior used for Emacs<24 was to set
+ ;; `yas-dont-activate-functions' to t buffer-locally.
+ (not (or (listp yas-dont-activate-functions)
+ (functionp yas-dont-activate-functions)))
+ (run-hook-with-args-until-success 'yas-dont-activate-functions))
+ (yas-minor-mode 1)))
+
+;;;###autoload
+(define-globalized-minor-mode yas-global-mode yas-minor-mode yas-minor-mode-on)
+
+(defun yas--global-mode-reload-with-jit-maybe ()
+ "Run `yas-reload-all' when `yas-global-mode' is on."
+ (when yas-global-mode (yas-reload-all)))
+
+(add-hook 'yas-global-mode-hook #'yas--global-mode-reload-with-jit-maybe)
+
+
+;;; Major mode stuff
+
+(defvar yas--font-lock-keywords
+ (append '(("^#.*$" . font-lock-comment-face))
+ (with-temp-buffer
+ (let ((prog-mode-hook nil)
+ (emacs-lisp-mode-hook nil))
+ (ignore-errors (emacs-lisp-mode)))
+ (font-lock-set-defaults)
+ (if (eq t (car-safe font-lock-keywords))
+ ;; They're "compiled", so extract the source.
+ (cadr font-lock-keywords)
+ font-lock-keywords))
+ '(("\\$\\([0-9]+\\)"
+ (0 font-lock-keyword-face)
+ (1 font-lock-string-face t))
+ ("\\${\\([0-9]+\\):?"
+ (0 font-lock-keyword-face)
+ (1 font-lock-warning-face t))
+ ("\\(\\$(\\)" 1 font-lock-preprocessor-face)
+ ("}"
+ (0 font-lock-keyword-face)))))
+
+(defvar snippet-mode-map
+ (let ((map (make-sparse-keymap)))
+ (easy-menu-define nil
+ map
+ "Menu used when snippet-mode is active."
+ (cons "Snippet"
+ (mapcar #'(lambda (ent)
+ (when (nth 2 ent)
+ (define-key map (nth 2 ent) (nth 1 ent)))
+ (vector (nth 0 ent) (nth 1 ent) t))
+ '(("Load this snippet" yas-load-snippet-buffer "\C-c\C-l")
+ ("Load and quit window" yas-load-snippet-buffer-and-close "\C-c\C-c")
+ ("Try out this snippet" yas-tryout-snippet "\C-c\C-t")))))
+ map)
+ "The keymap used when `snippet-mode' is active.")
+
+
+
+;;;###autoload(autoload 'snippet-mode "yasnippet" "A mode for editing yasnippets" t nil)
+(eval-and-compile
+ (if (fboundp 'prog-mode)
+ ;; `prog-mode' is new in 24.1.
+ (define-derived-mode snippet-mode prog-mode "Snippet"
+ "A mode for editing yasnippets"
+ (setq font-lock-defaults '(yas--font-lock-keywords))
+ (set (make-local-variable 'require-final-newline) nil)
+ (set (make-local-variable 'comment-start) "#")
+ (set (make-local-variable 'comment-start-skip) "#+[\t ]*")
+ (add-hook 'after-save-hook #'yas-maybe-load-snippet-buffer nil t))
+ (define-derived-mode snippet-mode fundamental-mode "Snippet"
+ "A mode for editing yasnippets"
+ (setq font-lock-defaults '(yas--font-lock-keywords))
+ (set (make-local-variable 'require-final-newline) nil)
+ (set (make-local-variable 'comment-start) "#")
+ (set (make-local-variable 'comment-start-skip) "#+[\t ]*")
+ (add-hook 'after-save-hook #'yas-maybe-load-snippet-buffer nil t))))
+
+(defun yas-snippet-mode-buffer-p ()
+ "Return non-nil if current buffer should be in `snippet-mode'.
+Meaning it's visiting a file under one of the mode directories in
+`yas-snippet-dirs'."
+ (when buffer-file-name
+ (cl-member buffer-file-name (yas-snippet-dirs)
+ :test #'file-in-directory-p)))
+
+;; We're abusing `magic-fallback-mode-alist' here because
+;; `auto-mode-alist' doesn't support function matchers.
+(add-to-list 'magic-fallback-mode-alist
+ `(yas-snippet-mode-buffer-p . snippet-mode))
+
+
+;;; Internal structs for template management
+
+(cl-defstruct (yas--template
+ (:constructor yas--make-template)
+ ;; Handles `yas-define-snippets' format, plus the
+ ;; initial TABLE argument.
+ (:constructor
+ yas--define-snippets-2
+ (table
+ key content
+ &optional xname condition group
+ expand-env load-file xkeybinding xuuid save-file
+ &aux
+ (name (or xname
+ ;; A little redundant: we always get a name
+ ;; from `yas--parse-template' except when
+ ;; there isn't a file.
+ (and load-file (file-name-nondirectory load-file))
+ (and save-file (file-name-nondirectory save-file))
+ key))
+ (keybinding (yas--read-keybinding xkeybinding))
+ (uuid (or xuuid name))
+ (old (gethash uuid (yas--table-uuidhash table)))
+ (menu-binding-pair
+ (and old (yas--template-menu-binding-pair old)))
+ (perm-group
+ (and old (yas--template-perm-group old))))))
+ "A template for a snippet."
+ key
+ content
+ name
+ condition
+ expand-env
+ load-file
+ save-file
+ keybinding
+ uuid
+ menu-binding-pair
+ group ;; as dictated by the #group: directive or .yas-make-groups
+ perm-group ;; as dictated by `yas-define-menu'
+ table
+ )
+
+(cl-defstruct (yas--table (:constructor yas--make-snippet-table (name)))
+ "A table to store snippets for a particular mode.
+
+Has the following fields:
+
+`yas--table-name'
+
+ A symbol name normally corresponding to a major mode, but can
+ also be a pseudo major-mode to be used in
+ `yas-activate-extra-mode', for example.
+
+`yas--table-hash'
+
+ A hash table (KEY . NAMEHASH), known as the \"keyhash\". KEY is
+ a string or a vector, where the former is the snippet's trigger
+ and the latter means it's a direct keybinding. NAMEHASH is yet
+ another hash of (NAME . TEMPLATE) where NAME is the snippet's
+ name and TEMPLATE is a `yas--template' object.
+
+`yas--table-direct-keymap'
+
+ A keymap for the snippets in this table that have direct
+ keybindings. This is kept in sync with the keyhash, i.e., all
+ the elements of the keyhash that are vectors appear here as
+ bindings to `yas-maybe-expand-from-keymap'.
+
+`yas--table-uuidhash'
+
+ A hash table mapping snippets uuid's to the same `yas--template'
+ objects. A snippet uuid defaults to the snippet's name."
+ name
+ (hash (make-hash-table :test 'equal))
+ (uuidhash (make-hash-table :test 'equal))
+ (parents nil)
+ (direct-keymap (make-sparse-keymap)))
+
+(defun yas--get-template-by-uuid (mode uuid)
+ "Find the snippet template in MODE by its UUID."
+ (let* ((table (gethash mode yas--tables mode)))
+ (when table
+ (gethash uuid (yas--table-uuidhash table)))))
+
+;; Apropos storing/updating in TABLE, this works in two steps:
+;;
+;; 1. `yas--remove-template-by-uuid' removes any
+;; keyhash-namehash-template mappings from TABLE, grabbing the
+;; snippet by its uuid. Also removes mappings from TABLE's
+;; `yas--table-direct-keymap' (FIXME: and should probably take care
+;; of potentially stale menu bindings right?.)
+;;
+;; 2. `yas--add-template' adds this all over again.
+;;
+;; Create a new or add to an existing keyhash-namehash mapping.
+;;
+;; For reference on understanding this, consider three snippet
+;; definitions:
+;;
+;; A: # name: The Foo
+;; # key: foo
+;; # binding: C-c M-l
+;;
+;; B: # name: Mrs Foo
+;; # key: foo
+;;
+;; C: # name: The Bar
+;; # binding: C-c M-l
+;;
+;; D: # name: Baz
+;; # key: baz
+;;
+;; keyhash namehashes(3) yas--template structs(4)
+;; -----------------------------------------------------
+;; __________
+;; / \
+;; "foo" ---> "The Foo" ---> [yas--template A] |
+;; "Mrs Foo" ---> [yas--template B] |
+;; |
+;; [C-c M-l] ---> "The Foo" -------------------------/
+;; "The Bar" ---> [yas--template C]
+;;
+;; "baz" ---> "Baz" ---> [yas--template D]
+;;
+;; Additionally, since uuid defaults to the name, we have a
+;; `yas--table-uuidhash' for TABLE
+;;
+;; uuidhash yas--template structs
+;; -------------------------------
+;; "The Foo" ---> [yas--template A]
+;; "Mrs Foo" ---> [yas--template B]
+;; "The Bar" ---> [yas--template C]
+;; "Baz" ---> [yas--template D]
+;;
+;; FIXME: the more I look at this data-structure the more I think I'm
+;; stupid. There has to be an easier way (but beware lots of code
+;; depends on this).
+;;
+(defun yas--remove-template-by-uuid (table uuid)
+ "Remove from TABLE a template identified by UUID."
+ (let ((template (gethash uuid (yas--table-uuidhash table))))
+ (when template
+ (let* ((name (yas--template-name template))
+ (empty-keys nil))
+ ;; Remove the name from each of the targeted namehashes
+ ;;
+ (maphash #'(lambda (k v)
+ (let ((template (gethash name v)))
+ (when (and template
+ (equal uuid (yas--template-uuid template)))
+ (remhash name v)
+ (when (zerop (hash-table-count v))
+ (push k empty-keys)))))
+ (yas--table-hash table))
+ ;; Remove the namehash themselves if they've become empty
+ ;;
+ (dolist (key empty-keys)
+ (when (vectorp key)
+ (define-key (yas--table-direct-keymap table) key nil))
+ (remhash key (yas--table-hash table)))
+
+ ;; Finally, remove the uuid from the uuidhash
+ ;;
+ (remhash uuid (yas--table-uuidhash table))))))
+
+(defconst yas-maybe-expand-from-keymap
+ '(menu-item "" yas-expand-from-keymap
+ :filter yas--maybe-expand-from-keymap-filter))
+
+(defun yas--add-template (table template)
+ "Store in TABLE the snippet template TEMPLATE.
+
+KEY can be a string (trigger key) of a vector (direct
+keybinding)."
+ (let ((name (yas--template-name template))
+ (key (yas--template-key template))
+ (keybinding (yas--template-keybinding template))
+ (_menu-binding-pair (yas--template-menu-binding-pair-get-create template)))
+ (dolist (k (remove nil (list key keybinding)))
+ (puthash name
+ template
+ (or (gethash k
+ (yas--table-hash table))
+ (puthash k
+ (make-hash-table :test 'equal)
+ (yas--table-hash table))))
+ (when (vectorp k)
+ (define-key (yas--table-direct-keymap table) k yas-maybe-expand-from-keymap)))
+
+ ;; Update TABLE's `yas--table-uuidhash'
+ (puthash (yas--template-uuid template)
+ template
+ (yas--table-uuidhash table))))
+
+(defun yas--update-template (table template)
+ "Add or update TEMPLATE in TABLE.
+
+Also takes care of adding and updating to the associated menu.
+Return TEMPLATE."
+ ;; Remove from table by uuid
+ ;;
+ (yas--remove-template-by-uuid table (yas--template-uuid template))
+ ;; Add to table again
+ ;;
+ (yas--add-template table template)
+ ;; Take care of the menu
+ ;;
+ (yas--update-template-menu table template)
+ template)
+
+(defun yas--update-template-menu (table template)
+ "Update every menu-related for TEMPLATE."
+ (let ((menu-binding-pair (yas--template-menu-binding-pair-get-create template))
+ (key (yas--template-key template))
+ (keybinding (yas--template-keybinding template)))
+ ;; The snippet might have changed name or keys, so update
+ ;; user-visible strings
+ ;;
+ (unless (eq (cdr menu-binding-pair) :none)
+ ;; the menu item name
+ ;;
+ (setf (cl-cadar menu-binding-pair) (yas--template-name template))
+ ;; the :keys information (also visible to the user)
+ (setf (cl-getf (cdr (car menu-binding-pair)) :keys)
+ (or (and keybinding (key-description keybinding))
+ (and key (concat key yas-trigger-symbol))))))
+ (unless (yas--template-menu-managed-by-yas-define-menu template)
+ (let ((menu-keymap
+ (yas--menu-keymap-get-create (yas--table-mode table)
+ (mapcar #'yas--table-mode
+ (yas--table-parents table))))
+ (group (yas--template-group template)))
+ ;; Remove from menu keymap
+ ;;
+ (cl-assert menu-keymap)
+ (yas--delete-from-keymap menu-keymap (yas--template-uuid template))
+
+ ;; Add necessary subgroups as necessary.
+ ;;
+ (dolist (subgroup group)
+ (let ((subgroup-keymap (lookup-key menu-keymap (vector (make-symbol subgroup)))))
+ (unless (and subgroup-keymap
+ (keymapp subgroup-keymap))
+ (setq subgroup-keymap (make-sparse-keymap))
+ (define-key menu-keymap (vector (make-symbol subgroup))
+ `(menu-item ,subgroup ,subgroup-keymap)))
+ (setq menu-keymap subgroup-keymap)))
+
+ ;; Add this entry to the keymap
+ ;;
+ (define-key menu-keymap
+ (vector (make-symbol (yas--template-uuid template)))
+ (car (yas--template-menu-binding-pair template))))))
+
+(defun yas--namehash-templates-alist (namehash)
+ "Return NAMEHASH as an alist."
+ (let (alist)
+ (maphash #'(lambda (k v)
+ (push (cons k v) alist))
+ namehash)
+ alist))
+
+(defun yas--fetch (table key)
+ "Fetch templates in TABLE by KEY.
+
+Return a list of cons (NAME . TEMPLATE) where NAME is a
+string and TEMPLATE is a `yas--template' structure."
+ (let* ((keyhash (yas--table-hash table))
+ (namehash (and keyhash (gethash key keyhash))))
+ (when namehash
+ (yas--filter-templates-by-condition (yas--namehash-templates-alist namehash)))))
+
+
+;;; Filtering/condition logic
+
+(defun yas--eval-condition (condition)
+ (condition-case err
+ (save-excursion
+ (save-restriction
+ (save-match-data
+ (eval condition))))
+ (error (progn
+ (yas--message 1 "Error in condition evaluation: %s" (error-message-string err))
+ nil))))
+
+
+(defun yas--filter-templates-by-condition (templates)
+ "Filter the templates using the applicable condition.
+
+TEMPLATES is a list of cons (NAME . TEMPLATE) where NAME is a
+string and TEMPLATE is a `yas--template' structure.
+
+This function implements the rules described in
+`yas-buffer-local-condition'. See that variables documentation."
+ (let ((requirement (yas--require-template-specific-condition-p)))
+ (if (eq requirement 'always)
+ templates
+ (cl-remove-if-not (lambda (pair)
+ (yas--template-can-expand-p
+ (yas--template-condition (cdr pair)) requirement))
+ templates))))
+
+(defun yas--require-template-specific-condition-p ()
+ "Decide if this buffer requests/requires snippet-specific
+conditions to filter out potential expansions."
+ (if (eq 'always yas-buffer-local-condition)
+ 'always
+ (let ((local-condition (or (and (consp yas-buffer-local-condition)
+ (yas--eval-condition yas-buffer-local-condition))
+ yas-buffer-local-condition)))
+ (when local-condition
+ (if (eq local-condition t)
+ t
+ (and (consp local-condition)
+ (eq 'require-snippet-condition (car local-condition))
+ (symbolp (cdr local-condition))
+ (cdr local-condition)))))))
+
+(defun yas--template-can-expand-p (condition requirement)
+ "Evaluate CONDITION and REQUIREMENT and return a boolean."
+ (let* ((result (or (null condition)
+ (yas--eval-condition condition))))
+ (cond ((eq requirement t)
+ result)
+ (t
+ (eq requirement result)))))
+
+(defun yas--table-templates (table)
+ (when table
+ (let ((acc (list)))
+ (maphash #'(lambda (_key namehash)
+ (maphash #'(lambda (name template)
+ (push (cons name template) acc))
+ namehash))
+ (yas--table-hash table))
+ (maphash #'(lambda (uuid template)
+ (push (cons uuid template) acc))
+ (yas--table-uuidhash table))
+ (yas--filter-templates-by-condition acc))))
+
+(defun yas--templates-for-key-at-point ()
+ "Find `yas--template' objects for any trigger keys preceding point.
+Returns (TEMPLATES START END). This function respects
+`yas-key-syntaxes', which see."
+ (save-excursion
+ (let ((original (point))
+ (methods yas-key-syntaxes)
+ (templates)
+ (method))
+ (while (and methods
+ (not templates))
+ (unless (eq method (car methods))
+ ;; TRICKY: `eq'-ness test means we can only be here if
+ ;; `method' is a function that returned `again', and hence
+ ;; don't revert back to original position as per
+ ;; `yas-key-syntaxes'.
+ (goto-char original))
+ (setq method (car methods))
+ (cond ((stringp method)
+ (skip-syntax-backward method)
+ (setq methods (cdr methods)))
+ ((functionp method)
+ (unless (eq (funcall method original)
+ 'again)
+ (setq methods (cdr methods))))
+ (t
+ (setq methods (cdr methods))
+ (yas--warning "Invalid element `%s' in `yas-key-syntaxes'" method)))
+ (let ((possible-key (buffer-substring-no-properties (point) original)))
+ (save-excursion
+ (goto-char original)
+ (setq templates
+ (cl-mapcan (lambda (table)
+ (yas--fetch table possible-key))
+ (yas--get-snippet-tables))))))
+ (when templates
+ (list templates (point) original)))))
+
+(defun yas--table-all-keys (table)
+ "Get trigger keys of all active snippets in TABLE."
+ (let ((acc))
+ (maphash #'(lambda (key namehash)
+ (when (yas--filter-templates-by-condition (yas--namehash-templates-alist namehash))
+ (push key acc)))
+ (yas--table-hash table))
+ acc))
+
+(defun yas--table-mode (table)
+ (intern (yas--table-name table)))
+
+
+;;; Internal functions and macros:
+
+(defun yas--remove-misc-free-from-undo (old-undo-list)
+ "Tries to work around Emacs Bug#30931.
+Helper function for `yas--save-restriction-and-widen'."
+ ;; If Bug#30931 is unfixed, we get (#<Lisp_Misc_Free> . INTEGER)
+ ;; entries in the undo list. If we call `type-of' on the
+ ;; Lisp_Misc_Free object then Emacs aborts, so try to find it by
+ ;; checking that its type is none of the expected ones.
+ (when (consp buffer-undo-list)
+ (let* ((prev buffer-undo-list)
+ (undo-list prev))
+ (while (and (consp undo-list)
+ ;; Only check new entries.
+ (not (eq undo-list old-undo-list)))
+ (let ((entry (pop undo-list)))
+ (when (consp entry)
+ (let ((head (car entry)))
+ (unless (or (stringp head)
+ (markerp head)
+ (integerp head)
+ (symbolp head)
+ (not (integerp (cdr entry))))
+ ;; (message "removing misc free %S" entry)
+ (setcdr prev undo-list)))))
+ (setq prev undo-list)))))
+
+(defmacro yas--save-restriction-and-widen (&rest body)
+ "Equivalent to (save-restriction (widen) BODY).
+Also tries to work around Emacs Bug#30931."
+ (declare (debug (body)) (indent 0))
+ ;; Disable garbage collection, since it could cause an abort.
+ `(let ((gc-cons-threshold most-positive-fixnum)
+ (old-undo-list buffer-undo-list))
+ (prog1 (save-restriction
+ (widen)
+ ,@body)
+ (yas--remove-misc-free-from-undo old-undo-list))))
+
+(defun yas--eval-for-string (form)
+ "Evaluate FORM and convert the result to string."
+ (let ((debug-on-error (and (not (memq yas-good-grace '(t inline)))
+ debug-on-error)))
+ (condition-case oops
+ (save-excursion
+ (yas--save-restriction-and-widen
+ (save-match-data
+ (let ((result (eval form)))
+ (when result
+ (format "%s" result))))))
+ ((debug error) (error-message-string oops)))))
+
+(defun yas--eval-for-effect (form)
+ (yas--safely-call-fun (apply-partially #'eval form)))
+
+(defun yas--read-lisp (string &optional nil-on-error)
+ "Read STRING as a elisp expression and return it.
+
+In case STRING in an invalid expression and NIL-ON-ERROR is nil,
+return an expression that when evaluated will issue an error."
+ (condition-case err
+ (read string)
+ (error (and (not nil-on-error)
+ `(error (error-message-string ,err))))))
+
+(defun yas--read-keybinding (keybinding)
+ "Read KEYBINDING as a snippet keybinding, return a vector."
+ (when (and keybinding
+ (not (string-match "keybinding" keybinding)))
+ (condition-case err
+ (let ((res (or (and (string-match "^\\[.*\\]$" keybinding)
+ (read keybinding))
+ (read-kbd-macro keybinding 'need-vector))))
+ res)
+ (error
+ (yas--message 2 "warning: keybinding \"%s\" invalid since %s."
+ keybinding (error-message-string err))
+ nil))))
+
+(defun yas--table-get-create (mode)
+ "Get or create the snippet table corresponding to MODE."
+ (let ((table (gethash mode
+ yas--tables)))
+ (unless table
+ (setq table (yas--make-snippet-table (symbol-name mode)))
+ (puthash mode table yas--tables)
+ (push (cons (intern (format "yas--direct-%s" mode))
+ (yas--table-direct-keymap table))
+ yas--direct-keymaps))
+ table))
+
+(defun yas--get-snippet-tables (&optional mode)
+ "Get snippet tables for MODE.
+
+MODE defaults to the current buffer's `major-mode'.
+
+Return a list of `yas--table' objects. The list of modes to
+consider is returned by `yas--modes-to-activate'"
+ (remove nil
+ (mapcar #'(lambda (name)
+ (gethash name yas--tables))
+ (yas--modes-to-activate mode))))
+
+(defun yas--menu-keymap-get-create (mode &optional parents)
+ "Get or create the menu keymap for MODE and its PARENTS.
+
+This may very well create a plethora of menu keymaps and arrange
+them all in `yas--menu-table'"
+ (let* ((menu-keymap (or (gethash mode yas--menu-table)
+ (puthash mode (make-sparse-keymap) yas--menu-table))))
+ (mapc #'yas--menu-keymap-get-create parents)
+ (define-key yas--minor-mode-menu (vector mode)
+ `(menu-item ,(symbol-name mode) ,menu-keymap
+ :visible (yas--show-menu-p ',mode)))
+ menu-keymap))
+
+
+;;; Template-related and snippet loading functions
+
+(defun yas--parse-template (&optional file)
+ "Parse the template in the current buffer.
+
+Optional FILE is the absolute file name of the file being
+parsed.
+
+Optional GROUP is the group where the template is to go,
+otherwise we attempt to calculate it from FILE.
+
+Return a snippet-definition, i.e. a list
+
+ (KEY TEMPLATE NAME CONDITION GROUP VARS LOAD-FILE KEYBINDING UUID)
+
+If the buffer contains a line of \"# --\" then the contents above
+this line are ignored. Directives can set most of these with the syntax:
+
+# directive-name : directive-value
+
+Here's a list of currently recognized directives:
+
+ * type
+ * name
+ * contributor
+ * condition
+ * group
+ * key
+ * expand-env
+ * binding
+ * uuid"
+ (goto-char (point-min))
+ (let* ((type 'snippet)
+ (name (and file
+ (file-name-nondirectory file)))
+ (key nil)
+ template
+ bound
+ condition
+ (group (and file
+ (yas--calculate-group file)))
+ expand-env
+ binding
+ uuid)
+ (if (re-search-forward "^# --\\s-*\n" nil t)
+ (progn (setq template
+ (buffer-substring-no-properties (point)
+ (point-max)))
+ (setq bound (point))
+ (goto-char (point-min))
+ (while (re-search-forward "^# *\\([^ ]+?\\) *: *\\(.*?\\)[[:space:]]*$" bound t)
+ (when (string= "uuid" (match-string-no-properties 1))
+ (setq uuid (match-string-no-properties 2)))
+ (when (string= "type" (match-string-no-properties 1))
+ (setq type (if (string= "command" (match-string-no-properties 2))
+ 'command
+ 'snippet)))
+ (when (string= "key" (match-string-no-properties 1))
+ (setq key (match-string-no-properties 2)))
+ (when (string= "name" (match-string-no-properties 1))
+ (setq name (match-string-no-properties 2)))
+ (when (string= "condition" (match-string-no-properties 1))
+ (setq condition (yas--read-lisp (match-string-no-properties 2))))
+ (when (string= "group" (match-string-no-properties 1))
+ (setq group (match-string-no-properties 2)))
+ (when (string= "expand-env" (match-string-no-properties 1))
+ (setq expand-env (yas--read-lisp (match-string-no-properties 2)
+ 'nil-on-error)))
+ (when (string= "binding" (match-string-no-properties 1))
+ (setq binding (match-string-no-properties 2)))))
+ (setq template
+ (buffer-substring-no-properties (point-min) (point-max))))
+ (unless (or key binding)
+ (setq key (and file (file-name-nondirectory file))))
+ (when (eq type 'command)
+ (setq template (yas--read-lisp (concat "(progn" template ")"))))
+ (when group
+ (setq group (split-string group "\\.")))
+ (list key template name condition group expand-env file binding uuid)))
+
+(defun yas--calculate-group (file)
+ "Calculate the group for snippet file path FILE."
+ (let* ((dominating-dir (locate-dominating-file file
+ ".yas-make-groups"))
+ (extra-path (and dominating-dir
+ (file-relative-name file dominating-dir)))
+ (extra-dir (and extra-path
+ (file-name-directory extra-path)))
+ (group (and extra-dir
+ (replace-regexp-in-string "/"
+ "."
+ (directory-file-name extra-dir)))))
+ group))
+
+(defun yas--subdirs (directory &optional filep)
+ "Return subdirs or files of DIRECTORY according to FILEP."
+ (cl-remove-if (lambda (file)
+ (or (string-match "\\`\\."
+ (file-name-nondirectory file))
+ (string-match "\\`#.*#\\'"
+ (file-name-nondirectory file))
+ (string-match "~\\'"
+ (file-name-nondirectory file))
+ (if filep
+ (file-directory-p file)
+ (not (file-directory-p file)))))
+ (directory-files directory t)))
+
+(defun yas--make-menu-binding (template)
+ (let ((mode (yas--table-mode (yas--template-table template))))
+ `(lambda () (interactive) (yas--expand-or-visit-from-menu ',mode ,(yas--template-uuid template)))))
+
+(defun yas--expand-or-visit-from-menu (mode uuid)
+ (let* ((table (yas--table-get-create mode))
+ (yas--current-template (and table
+ (gethash uuid (yas--table-uuidhash table)))))
+ (when yas--current-template
+ (if yas-visit-from-menu
+ (yas--visit-snippet-file-1 yas--current-template)
+ (let ((where (if (region-active-p)
+ (cons (region-beginning) (region-end))
+ (cons (point) (point)))))
+ (yas-expand-snippet yas--current-template
+ (car where) (cdr where)))))))
+
+(defun yas--key-from-desc (text)
+ "Return a yasnippet key from a description string TEXT."
+ (replace-regexp-in-string "\\(\\w+\\).*" "\\1" text))
+
+
+;;; Popping up for keys and templates
+
+(defun yas--prompt-for-template (templates &optional prompt)
+ "Interactively choose a template from the list TEMPLATES.
+
+TEMPLATES is a list of `yas--template'.
+
+Optional PROMPT sets the prompt to use."
+ (when templates
+ (setq templates
+ (sort templates #'(lambda (t1 t2)
+ (< (length (yas--template-name t1))
+ (length (yas--template-name t2))))))
+ (cl-some (lambda (fn)
+ (funcall fn (or prompt "Choose a snippet: ")
+ templates
+ #'yas--template-name))
+ yas-prompt-functions)))
+
+(defun yas--prompt-for-keys (keys &optional prompt)
+ "Interactively choose a template key from the list KEYS.
+
+Optional PROMPT sets the prompt to use."
+ (when keys
+ (cl-some (lambda (fn)
+ (funcall fn (or prompt "Choose a snippet key: ") keys))
+ yas-prompt-functions)))
+
+(defun yas--prompt-for-table (tables &optional prompt)
+ "Interactively choose a table from the list TABLES.
+
+Optional PROMPT sets the prompt to use."
+ (when tables
+ (cl-some (lambda (fn)
+ (funcall fn (or prompt "Choose a snippet table: ")
+ tables
+ #'yas--table-name))
+ yas-prompt-functions)))
+
+(defun yas-x-prompt (prompt choices &optional display-fn)
+ "Display choices in a x-window prompt."
+ (when (and window-system choices)
+ ;; Let window position be recalculated to ensure that
+ ;; `posn-at-point' returns non-nil.
+ (redisplay)
+ (or
+ (x-popup-menu
+ (if (fboundp 'posn-at-point)
+ (let ((x-y (posn-x-y (posn-at-point (point)))))
+ (list (list (+ (car x-y) 10)
+ (+ (cdr x-y) 20))
+ (selected-window)))
+ t)
+ `(,prompt ("title"
+ ,@(cl-mapcar (lambda (c d) `(,(concat " " d) . ,c))
+ choices
+ (if display-fn (mapcar display-fn choices)
+ choices)))))
+ (keyboard-quit))))
+
+(defun yas-maybe-ido-prompt (prompt choices &optional display-fn)
+ (when (bound-and-true-p ido-mode)
+ (yas-ido-prompt prompt choices display-fn)))
+
+(defun yas-ido-prompt (prompt choices &optional display-fn)
+ (require 'ido)
+ (yas-completing-prompt prompt choices display-fn #'ido-completing-read))
+
+(defun yas-dropdown-prompt (_prompt choices &optional display-fn)
+ (when (fboundp 'dropdown-list)
+ (let* ((formatted-choices
+ (if display-fn (mapcar display-fn choices) choices))
+ (n (dropdown-list formatted-choices)))
+ (if n (nth n choices)
+ (keyboard-quit)))))
+
+(defun yas-completing-prompt (prompt choices &optional display-fn completion-fn)
+ (let* ((formatted-choices
+ (if display-fn (mapcar display-fn choices) choices))
+ (chosen (funcall (or completion-fn #'completing-read)
+ prompt formatted-choices
+ nil 'require-match nil nil)))
+ (if (eq choices formatted-choices)
+ chosen
+ (nth (or (cl-position chosen formatted-choices :test #'string=) 0)
+ choices))))
+
+(defun yas-no-prompt (_prompt choices &optional _display-fn)
+ (cl-first choices))
+
+
+;;; Defining snippets
+;; This consists of creating and registering `yas--template' objects in the
+;; correct tables.
+;;
+
+(defvar yas--creating-compiled-snippets nil)
+
+(defun yas--define-snippets-1 (snippet snippet-table)
+ "Helper for `yas-define-snippets'."
+ ;; Update the appropriate table. Also takes care of adding the
+ ;; key indicators in the templates menu entry, if any.
+ (yas--update-template
+ snippet-table (apply #'yas--define-snippets-2 snippet-table snippet)))
+
+(defun yas-define-snippets (mode snippets)
+ "Define SNIPPETS for MODE.
+
+SNIPPETS is a list of snippet definitions, each taking the
+following form
+
+ (KEY TEMPLATE NAME CONDITION GROUP EXPAND-ENV LOAD-FILE KEYBINDING UUID SAVE-FILE)
+
+Within these, only KEY and TEMPLATE are actually mandatory.
+
+TEMPLATE might be a Lisp form or a string, depending on whether
+this is a snippet or a snippet-command.
+
+CONDITION, EXPAND-ENV and KEYBINDING are Lisp forms, they have
+been `yas--read-lisp'-ed and will eventually be
+`yas--eval-for-string'-ed.
+
+The remaining elements are strings.
+
+FILE is probably of very little use if you're programatically
+defining snippets.
+
+UUID is the snippet's \"unique-id\". Loading a second snippet
+file with the same uuid would replace the previous snippet.
+
+You can use `yas--parse-template' to return such lists based on
+the current buffers contents."
+ (if yas--creating-compiled-snippets
+ (let ((print-length nil))
+ (insert ";;; Snippet definitions:\n;;;\n")
+ (dolist (snippet snippets)
+ ;; Fill in missing elements with nil.
+ (setq snippet (append snippet (make-list (- 10 (length snippet)) nil)))
+ ;; Move LOAD-FILE to SAVE-FILE because we will load from the
+ ;; compiled file, not LOAD-FILE.
+ (let ((load-file (nth 6 snippet)))
+ (setcar (nthcdr 6 snippet) nil)
+ (setcar (nthcdr 9 snippet) load-file)))
+ (insert (pp-to-string
+ `(yas-define-snippets ',mode ',snippets)))
+ (insert "\n\n"))
+ ;; Normal case.
+ (let ((snippet-table (yas--table-get-create mode))
+ (template nil))
+ (dolist (snippet snippets)
+ (setq template (yas--define-snippets-1 snippet
+ snippet-table)))
+ template)))
+
+
+;;; Loading snippets from files
+
+(defun yas--template-get-file (template)
+ "Return TEMPLATE's LOAD-FILE or SAVE-FILE."
+ (or (yas--template-load-file template)
+ (let ((file (yas--template-save-file template)))
+ (when file
+ (yas--message 3 "%s has no load file, using save file, %s, instead."
+ (yas--template-name template) file))
+ file)))
+
+(defun yas--load-yas-setup-file (file)
+ (if (not yas--creating-compiled-snippets)
+ ;; Normal case.
+ (load file 'noerror (<= yas-verbosity 4))
+ (let ((elfile (concat file ".el")))
+ (when (file-exists-p elfile)
+ (insert ";;; contents of the .yas-setup.el support file:\n;;;\n")
+ (insert-file-contents elfile)
+ (goto-char (point-max))))))
+
+(defun yas--define-parents (mode parents)
+ "Add PARENTS to the list of MODE's parents."
+ (puthash mode (cl-remove-duplicates
+ (append parents
+ (gethash mode yas--parents)))
+ yas--parents))
+
+(defun yas-load-directory (top-level-dir &optional use-jit interactive)
+ "Load snippets in directory hierarchy TOP-LEVEL-DIR.
+
+Below TOP-LEVEL-DIR each directory should be a mode name.
+
+With prefix argument USE-JIT do jit-loading of snippets."
+ (interactive
+ (list (read-directory-name "Select the root directory: " nil nil t)
+ current-prefix-arg t))
+ (unless yas-snippet-dirs
+ (setq yas-snippet-dirs top-level-dir))
+ (let ((impatient-buffers))
+ (dolist (dir (yas--subdirs top-level-dir))
+ (let* ((major-mode-and-parents (yas--compute-major-mode-and-parents
+ (concat dir "/dummy")))
+ (mode-sym (car major-mode-and-parents))
+ (parents (cdr major-mode-and-parents)))
+ ;; Attention: The parents and the menus are already defined
+ ;; here, even if the snippets are later jit-loaded.
+ ;;
+ ;; * We need to know the parents at this point since entering a
+ ;; given mode should jit load for its parents
+ ;; immediately. This could be reviewed, the parents could be
+ ;; discovered just-in-time-as well
+ ;;
+ ;; * We need to create the menus here to support the `full'
+ ;; option to `yas-use-menu' (all known snippet menus are shown to the user)
+ ;;
+ (yas--define-parents mode-sym parents)
+ (yas--menu-keymap-get-create mode-sym)
+ (let ((fun (apply-partially #'yas--load-directory-1 dir mode-sym)))
+ (if use-jit
+ (yas--schedule-jit mode-sym fun)
+ (funcall fun)))
+ ;; Look for buffers that are already in `mode-sym', and so
+ ;; need the new snippets immediately...
+ ;;
+ (when use-jit
+ (cl-loop for buffer in (buffer-list)
+ do (with-current-buffer buffer
+ (when (eq major-mode mode-sym)
+ (yas--message 4 "Discovered there was already %s in %s" buffer mode-sym)
+ (push buffer impatient-buffers)))))))
+ ;; ...after TOP-LEVEL-DIR has been completely loaded, call
+ ;; `yas--load-pending-jits' in these impatient buffers.
+ ;;
+ (cl-loop for buffer in impatient-buffers
+ do (with-current-buffer buffer (yas--load-pending-jits))))
+ (when interactive
+ (yas--message 3 "Loaded snippets from %s." top-level-dir)))
+
+(defun yas--load-directory-1 (directory mode-sym)
+ "Recursively load snippet templates from DIRECTORY."
+ (if yas--creating-compiled-snippets
+ (let ((output-file (expand-file-name ".yas-compiled-snippets.el"
+ directory)))
+ (with-temp-file output-file
+ (insert (format ";;; Compiled snippets and support files for `%s'\n"
+ mode-sym))
+ (yas--load-directory-2 directory mode-sym)
+ (insert (format ";;; Do not edit! File generated at %s\n"
+ (current-time-string)))))
+ ;; Normal case.
+ (unless (file-exists-p (expand-file-name ".yas-skip" directory))
+ (unless (and (load (expand-file-name ".yas-compiled-snippets" directory) 'noerror (<= yas-verbosity 3))
+ (progn (yas--message 4 "Loaded compiled snippets from %s" directory) t))
+ (yas--message 4 "Loading snippet files from %s" directory)
+ (yas--load-directory-2 directory mode-sym)))))
+
+(defun yas--load-directory-2 (directory mode-sym)
+ ;; Load .yas-setup.el files wherever we find them
+ ;;
+ (yas--load-yas-setup-file (expand-file-name ".yas-setup" directory))
+ (let* ((default-directory directory)
+ (snippet-defs nil))
+ ;; load the snippet files
+ ;;
+ (with-temp-buffer
+ (dolist (file (yas--subdirs directory 'no-subdirs-just-files))
+ (when (file-readable-p file)
+ ;; Erase the buffer instead of passing non-nil REPLACE to
+ ;; `insert-file-contents' (avoids Emacs bug #23659).
+ (erase-buffer)
+ (insert-file-contents file)
+ (push (yas--parse-template file)
+ snippet-defs))))
+ (when snippet-defs
+ (yas-define-snippets mode-sym
+ snippet-defs))
+ ;; now recurse to a lower level
+ ;;
+ (dolist (subdir (yas--subdirs directory))
+ (yas--load-directory-2 subdir
+ mode-sym))))
+
+(defun yas--load-snippet-dirs (&optional nojit)
+ "Reload the directories listed in `yas-snippet-dirs' or
+prompt the user to select one."
+ (let (errors)
+ (if (null yas-snippet-dirs)
+ (call-interactively 'yas-load-directory)
+ (when (member yas--default-user-snippets-dir yas-snippet-dirs)
+ (make-directory yas--default-user-snippets-dir t))
+ (dolist (directory (reverse (yas-snippet-dirs)))
+ (cond ((file-directory-p directory)
+ (yas-load-directory directory (not nojit))
+ (if nojit
+ (yas--message 4 "Loaded %s" directory)
+ (yas--message 4 "Prepared just-in-time loading for %s" directory)))
+ (t
+ (push (yas--message 1 "Check your `yas-snippet-dirs': %s is not a directory" directory) errors)))))
+ errors))
+
+(defun yas-reload-all (&optional no-jit interactive)
+ "Reload all snippets and rebuild the YASnippet menu.
+
+When NO-JIT is non-nil force immediate reload of all known
+snippets under `yas-snippet-dirs', otherwise use just-in-time
+loading.
+
+When called interactively, use just-in-time loading when given a
+prefix argument."
+ (interactive (list (not current-prefix-arg) t))
+ (catch 'abort
+ (let ((errors)
+ (snippet-editing-buffers
+ (cl-remove-if-not (lambda (buffer)
+ (with-current-buffer buffer
+ yas--editing-template))
+ (buffer-list))))
+ ;; Warn if there are buffers visiting snippets, since reloading will break
+ ;; any on-line editing of those buffers.
+ ;;
+ (when snippet-editing-buffers
+ (if interactive
+ (if (y-or-n-p "Some buffers editing live snippets, close them and proceed with reload? ")
+ (mapc #'kill-buffer snippet-editing-buffers)
+ (yas--message 1 "Aborted reload...")
+ (throw 'abort nil))
+ ;; in a non-interactive use, at least set
+ ;; `yas--editing-template' to nil, make it guess it next time around
+ (mapc #'(lambda (buffer)
+ (with-current-buffer buffer
+ (kill-local-variable 'yas--editing-template)))
+ (buffer-list))))
+
+ ;; Empty all snippet tables and parenting info
+ ;;
+ (setq yas--tables (make-hash-table))
+ (setq yas--parents (make-hash-table))
+
+ ;; Before killing `yas--menu-table' use its keys to cleanup the
+ ;; mode menu parts of `yas--minor-mode-menu' (thus also cleaning
+ ;; up `yas-minor-mode-map', which points to it)
+ ;;
+ (maphash #'(lambda (menu-symbol _keymap)
+ (define-key yas--minor-mode-menu (vector menu-symbol) nil))
+ yas--menu-table)
+ ;; Now empty `yas--menu-table' as well
+ (setq yas--menu-table (make-hash-table))
+
+ ;; Cancel all pending 'yas--scheduled-jit-loads'
+ ;;
+ (setq yas--scheduled-jit-loads (make-hash-table))
+
+ ;; Reload the directories listed in `yas-snippet-dirs' or prompt
+ ;; the user to select one.
+ ;;
+ (setq errors (yas--load-snippet-dirs no-jit))
+ ;; Reload the direct keybindings
+ ;;
+ (yas-direct-keymaps-reload)
+
+ (run-hooks 'yas-after-reload-hook)
+ (let ((no-snippets
+ (cl-every (lambda (table) (= (hash-table-count table) 0))
+ (list yas--scheduled-jit-loads
+ yas--parents yas--tables))))
+ (yas--message (if (or no-snippets errors) 2 3)
+ (if no-jit "Snippets loaded %s."
+ "Prepared just-in-time loading of snippets %s.")
+ (cond (errors
+ "with some errors. Check *Messages*")
+ (no-snippets
+ "(but no snippets found)")
+ (t
+ "successfully")))))))
+
+(defvar yas-after-reload-hook nil
+ "Hooks run after `yas-reload-all'.")
+
+(defun yas--load-pending-jits ()
+ (dolist (mode (yas--modes-to-activate))
+ (let ((funs (reverse (gethash mode yas--scheduled-jit-loads))))
+ ;; must reverse to maintain coherence with `yas-snippet-dirs'
+ (dolist (fun funs)
+ (yas--message 4 "Loading for `%s', just-in-time: %s!" mode fun)
+ (funcall fun))
+ (remhash mode yas--scheduled-jit-loads))))
+
+(defun yas-escape-text (text)
+ "Escape TEXT for snippet."
+ (when text
+ (replace-regexp-in-string "[\\$]" "\\\\\\&" text)))
+
+
+;;; Snippet compilation function
+
+(defun yas-compile-directory (top-level-dir)
+ "Create .yas-compiled-snippets.el files under subdirs of TOP-LEVEL-DIR.
+
+This works by stubbing a few functions, then calling
+`yas-load-directory'."
+ (interactive "DTop level snippet directory?")
+ (let ((yas--creating-compiled-snippets t))
+ (yas-load-directory top-level-dir nil)))
+
+(defun yas-recompile-all ()
+ "Compile every dir in `yas-snippet-dirs'."
+ (interactive)
+ (mapc #'yas-compile-directory (yas-snippet-dirs)))
+
+
+;;; JIT loading
+;;;
+
+(defvar yas--scheduled-jit-loads (make-hash-table)
+ "Alist of mode-symbols to forms to be evaled when `yas-minor-mode' kicks in.")
+
+(defun yas--schedule-jit (mode fun)
+ (push fun (gethash mode yas--scheduled-jit-loads)))
+
+
+
+;;; Some user level functions
+
+(defun yas-about ()
+ (interactive)
+ (message "yasnippet (version %s) -- pluskid/joaotavora/npostavs"
+ (or (ignore-errors (car (let ((default-directory yas--loaddir))
+ (process-lines "git" "describe"
+ "--tags" "--dirty"))))
+ (when (and (featurep 'package)
+ (fboundp 'package-desc-version)
+ (fboundp 'package-version-join))
+ (defvar package-alist)
+ (ignore-errors
+ (let* ((yas-pkg (cdr (assq 'yasnippet package-alist)))
+ (version (package-version-join
+ (package-desc-version (car yas-pkg)))))
+ ;; Special case for MELPA's bogus version numbers.
+ (if (string-match "\\`20..[01][0-9][0-3][0-9][.][0-9]\\{3,4\\}\\'"
+ version)
+ (concat yas--version "-snapshot" version)
+ version))))
+ yas--version)))
+
+
+;;; Apropos snippet menu:
+;;
+;; The snippet menu keymaps are stored by mode in hash table called
+;; `yas--menu-table'. They are linked to the main menu in
+;; `yas--menu-keymap-get-create' and are initially created empty,
+;; reflecting the table hierarchy.
+;;
+;; They can be populated in two mutually exclusive ways: (1) by
+;; reading `yas--template-group', which in turn is populated by the "#
+;; group:" directives of the snippets or the ".yas-make-groups" file
+;; or (2) by using a separate `yas-define-menu' call, which declares a
+;; menu structure based on snippets uuids.
+;;
+;; Both situations are handled in `yas--update-template-menu', which
+;; uses the predicate `yas--template-menu-managed-by-yas-define-menu'
+;; that can tell between the two situations.
+;;
+;; Note:
+;;
+;; * if `yas-define-menu' is used it must run before
+;; `yas-define-snippets' and the UUIDS must match, otherwise we get
+;; duplicate entries. The `yas--template' objects are created in
+;; `yas-define-menu', holding nothing but the menu entry,
+;; represented by a pair of ((menu-item NAME :keys KEYS) TYPE) and
+;; stored in `yas--template-menu-binding-pair'. The (menu-item ...)
+;; part is then stored in the menu keymap itself which make the item
+;; appear to the user. These limitations could probably be revised.
+;;
+;; * The `yas--template-perm-group' slot is only used in
+;; `yas-describe-tables'.
+;;
+(defun yas--template-menu-binding-pair-get-create (template &optional type)
+ "Get TEMPLATE's menu binding or assign it a new one.
+
+TYPE may be `:stay', signaling this menu binding should be
+static in the menu."
+ (or (yas--template-menu-binding-pair template)
+ (let (;; (key (yas--template-key template))
+ ;; (keybinding (yas--template-keybinding template))
+ )
+ (setf (yas--template-menu-binding-pair template)
+ (cons `(menu-item ,(or (yas--template-name template)
+ (yas--template-uuid template))
+ ,(yas--make-menu-binding template)
+ :keys ,nil)
+ type)))))
+(defun yas--template-menu-managed-by-yas-define-menu (template)
+ "Non-nil if TEMPLATE's menu entry was included in a `yas-define-menu' call."
+ (cdr (yas--template-menu-binding-pair template)))
+
+
+(defun yas--show-menu-p (mode)
+ (cond ((eq yas-use-menu 'abbreviate)
+ (cl-find mode
+ (mapcar #'yas--table-mode
+ (yas--get-snippet-tables))))
+ (yas-use-menu t)))
+
+(defun yas--delete-from-keymap (keymap uuid)
+ "Recursively delete items with UUID from KEYMAP and its submenus."
+
+ ;; XXX: This used to skip any submenus named \"parent mode\"
+ ;;
+ ;; First of all, recursively enter submenus, i.e. the tree is
+ ;; searched depth first so that stale submenus can be found in the
+ ;; higher passes.
+ ;;
+ (mapc #'(lambda (item)
+ (when (and (consp (cdr-safe item))
+ (keymapp (nth 2 (cdr item))))
+ (yas--delete-from-keymap (nth 2 (cdr item)) uuid)))
+ (cdr keymap))
+ ;; Set the uuid entry to nil
+ ;;
+ (define-key keymap (vector (make-symbol uuid)) nil)
+ ;; Destructively modify keymap
+ ;;
+ (setcdr keymap (cl-delete-if (lambda (item)
+ (cond ((not (listp item)) nil)
+ ((null (cdr item)))
+ ((and (keymapp (nth 2 (cdr item)))
+ (null (cdr (nth 2 (cdr item))))))))
+ (cdr keymap))))
+
+(defun yas-define-menu (mode menu &optional omit-items)
+ "Define a snippet menu for MODE according to MENU, omitting OMIT-ITEMS.
+
+MENU is a list, its elements can be:
+
+- (yas-item UUID) : Creates an entry the snippet identified with
+ UUID. The menu entry for a snippet thus identified is
+ permanent, i.e. it will never move (be reordered) in the menu.
+
+- (yas-separator) : Creates a separator
+
+- (yas-submenu NAME SUBMENU) : Creates a submenu with NAME,
+ SUBMENU has the same form as MENU. NAME is also added to the
+ list of groups of the snippets defined thereafter.
+
+OMIT-ITEMS is a list of snippet uuids that will always be
+omitted from MODE's menu, even if they're manually loaded."
+ (let* ((table (yas--table-get-create mode))
+ (hash (yas--table-uuidhash table)))
+ (yas--define-menu-1 table
+ (yas--menu-keymap-get-create mode)
+ menu
+ hash)
+ (dolist (uuid omit-items)
+ (let ((template (or (gethash uuid hash)
+ (puthash uuid
+ (yas--make-template :table table
+ :uuid uuid)
+ hash))))
+ (setf (yas--template-menu-binding-pair template) (cons nil :none))))))
+
+(defun yas--define-menu-1 (table menu-keymap menu uuidhash &optional group-list)
+ "Helper for `yas-define-menu'."
+ (cl-loop
+ for (type name submenu) in (reverse menu)
+ collect (cond
+ ((or (eq type 'yas-item)
+ (and yas-alias-to-yas/prefix-p
+ (eq type 'yas/item)))
+ (let ((template (or (gethash name uuidhash)
+ (puthash name
+ (yas--make-template
+ :table table
+ :perm-group group-list
+ :uuid name)
+ uuidhash))))
+ (car (yas--template-menu-binding-pair-get-create
+ template :stay))))
+ ((or (eq type 'yas-submenu)
+ (and yas-alias-to-yas/prefix-p
+ (eq type 'yas/submenu)))
+ (let ((subkeymap (make-sparse-keymap)))
+ (yas--define-menu-1 table subkeymap submenu uuidhash
+ (append group-list (list name)))
+ `(menu-item ,name ,subkeymap)))
+ ((or (eq type 'yas-separator)
+ (and yas-alias-to-yas/prefix-p
+ (eq type 'yas/separator)))
+ '(menu-item "----"))
+ (t (yas--message 1 "Don't know anything about menu entry %s" type)
+ nil))
+ into menu-entries
+ finally do (push (apply #'vector menu-entries) (cdr menu-keymap))))
+
+(defun yas--define (mode key template &optional name condition group)
+ "Define a snippet. Expanding KEY into TEMPLATE.
+
+NAME is a description to this template. Also update the menu if
+`yas-use-menu' is t. CONDITION is the condition attached to
+this snippet. If you attach a condition to a snippet, then it
+will only be expanded when the condition evaluated to non-nil."
+ (yas-define-snippets mode
+ (list (list key template name condition group))))
+
+(defun yas-hippie-try-expand (first-time?)
+ "Integrate with hippie expand.
+
+Just put this function in `hippie-expand-try-functions-list'."
+ (when yas-minor-mode
+ (if (not first-time?)
+ (let ((yas-fallback-behavior 'return-nil))
+ (yas-expand))
+ (undo 1)
+ nil)))
+
+
+;;; Apropos condition-cache:
+;;;
+;;;
+;;;
+;;;
+(defmacro yas-define-condition-cache (func doc &rest body)
+ "Define a function FUNC with doc DOC and body BODY.
+BODY is executed at most once every snippet expansion attempt, to check
+expansion conditions.
+
+It doesn't make any sense to call FUNC programatically."
+ `(defun ,func () ,(if (and doc
+ (stringp doc))
+ (concat doc
+"\n\nFor use in snippets' conditions. Within each
+snippet-expansion routine like `yas-expand', computes actual
+value for the first time then always returns a cached value.")
+ (setq body (cons doc body))
+ nil)
+ (let ((timestamp-and-value (get ',func 'yas--condition-cache)))
+ (if (equal (car timestamp-and-value) yas--condition-cache-timestamp)
+ (cdr timestamp-and-value)
+ (let ((new-value (progn
+ ,@body
+ )))
+ (put ',func 'yas--condition-cache (cons yas--condition-cache-timestamp new-value))
+ new-value)))))
+
+(defalias 'yas-expand 'yas-expand-from-trigger-key)
+(defun yas-expand-from-trigger-key (&optional field)
+ "Expand a snippet before point.
+
+If no snippet expansion is possible, fall back to the behaviour
+defined in `yas-fallback-behavior'.
+
+Optional argument FIELD is for non-interactive use and is an
+object satisfying `yas--field-p' to restrict the expansion to."
+ (interactive)
+ (setq yas--condition-cache-timestamp (current-time))
+ (let (templates-and-pos)
+ (unless (and yas-expand-only-for-last-commands
+ (not (member last-command yas-expand-only-for-last-commands)))
+ (setq templates-and-pos (if field
+ (save-restriction
+ (narrow-to-region (yas--field-start field)
+ (yas--field-end field))
+ (yas--templates-for-key-at-point))
+ (yas--templates-for-key-at-point))))
+ (if templates-and-pos
+ (yas--expand-or-prompt-for-template
+ (nth 0 templates-and-pos)
+ ;; Delete snippet key and active region when expanding.
+ (min (if (use-region-p) (region-beginning) most-positive-fixnum)
+ (nth 1 templates-and-pos))
+ (max (if (use-region-p) (region-end) most-negative-fixnum)
+ (nth 2 templates-and-pos)))
+ (yas--fallback))))
+
+(defun yas--maybe-expand-from-keymap-filter (cmd)
+ "Check whether a snippet may be expanded.
+If there are expandable snippets, return CMD (this is useful for
+conditional keybindings) or the list of expandable snippet
+template objects if CMD is nil (this is useful as a more general predicate)."
+ (let* ((yas--condition-cache-timestamp (current-time))
+ (vec (cl-subseq (this-command-keys-vector)
+ (if current-prefix-arg
+ (length (this-command-keys))
+ 0)))
+ (templates (cl-mapcan (lambda (table)
+ (yas--fetch table vec))
+ (yas--get-snippet-tables))))
+ (if templates (or cmd templates))))
+
+(defun yas-expand-from-keymap ()
+ "Directly expand some snippets, searching `yas--direct-keymaps'."
+ (interactive)
+ (setq yas--condition-cache-timestamp (current-time))
+ (let* ((templates (yas--maybe-expand-from-keymap-filter nil)))
+ (when templates
+ (yas--expand-or-prompt-for-template templates))))
+
+(defun yas--expand-or-prompt-for-template (templates &optional start end)
+ "Expand one of TEMPLATES from START to END.
+
+Prompt the user if TEMPLATES has more than one element, else
+expand immediately. Common gateway for
+`yas-expand-from-trigger-key' and `yas-expand-from-keymap'."
+ (let ((yas--current-template
+ (or (and (cl-rest templates) ;; more than one
+ (yas--prompt-for-template (mapcar #'cdr templates)))
+ (cdar templates))))
+ (when yas--current-template
+ (yas-expand-snippet yas--current-template start end))))
+
+;; Apropos the trigger key and the fallback binding:
+;;
+;; When `yas-minor-mode-map' binds <tab>, that correctly overrides
+;; org-mode's <tab>, for example and searching for fallbacks correctly
+;; returns `org-cycle'. However, most other modes bind "TAB". TODO,
+;; improve this explanation.
+;;
+(defun yas--fallback ()
+ "Fallback after expansion has failed.
+
+Common gateway for `yas-expand-from-trigger-key' and
+`yas-expand-from-keymap'."
+ (cond ((eq yas-fallback-behavior 'return-nil)
+ ;; return nil
+ nil)
+ ((eq yas-fallback-behavior 'yas--fallback)
+ (error (concat "yasnippet fallback loop!\n"
+ "This can happen when you bind `yas-expand' "
+ "outside of the `yas-minor-mode-map'.")))
+ ((eq yas-fallback-behavior 'call-other-command)
+ (let* ((yas-fallback-behavior 'yas--fallback)
+ ;; Also bind `yas-minor-mode' to prevent fallback
+ ;; loops when other extensions use mechanisms similar
+ ;; to `yas--keybinding-beyond-yasnippet'. (github #525
+ ;; and #526)
+ ;;
+ (yas-minor-mode nil)
+ (beyond-yasnippet (yas--keybinding-beyond-yasnippet)))
+ (yas--message 4 "Falling back to %s" beyond-yasnippet)
+ (cl-assert (or (null beyond-yasnippet) (commandp beyond-yasnippet)))
+ (setq this-command beyond-yasnippet)
+ (when beyond-yasnippet
+ (call-interactively beyond-yasnippet))))
+ ((and (listp yas-fallback-behavior)
+ (cdr yas-fallback-behavior)
+ (eq 'apply (car yas-fallback-behavior)))
+ (let ((command-or-fn (cadr yas-fallback-behavior))
+ (args (cddr yas-fallback-behavior))
+ (yas-fallback-behavior 'yas--fallback)
+ (yas-minor-mode nil))
+ (if args
+ (apply command-or-fn args)
+ (when (commandp command-or-fn)
+ (setq this-command command-or-fn)
+ (call-interactively command-or-fn)))))
+ (t
+ ;; also return nil if all the other fallbacks have failed
+ nil)))
+
+(defun yas--keybinding-beyond-yasnippet ()
+ "Get current keys's binding as if YASsnippet didn't exist."
+ (let* ((yas-minor-mode nil)
+ (yas--direct-keymaps nil)
+ (keys (this-single-command-keys)))
+ (or (key-binding keys t)
+ (key-binding (yas--fallback-translate-input keys) t))))
+
+(defun yas--fallback-translate-input (keys)
+ "Emulate `read-key-sequence', at least what I think it does.
+
+Keys should be an untranslated key vector. Returns a translated
+vector of keys. FIXME not thoroughly tested."
+ (let ((retval [])
+ (i 0))
+ (while (< i (length keys))
+ (let ((j i)
+ (translated local-function-key-map))
+ (while (and (< j (length keys))
+ translated
+ (keymapp translated))
+ (setq translated (cdr (assoc (aref keys j) (remove 'keymap translated)))
+ j (1+ j)))
+ (setq retval (vconcat retval (cond ((symbolp translated)
+ `[,translated])
+ ((vectorp translated)
+ translated)
+ (t
+ (substring keys i j)))))
+ (setq i j)))
+ retval))
+
+
+;;; Utils for snippet development:
+
+(defun yas--all-templates (tables)
+ "Get `yas--template' objects in TABLES, applicable for buffer and point.
+
+Honours `yas-choose-tables-first', `yas-choose-keys-first' and
+`yas-buffer-local-condition'"
+ (when yas-choose-tables-first
+ (setq tables (list (yas--prompt-for-table tables))))
+ (mapcar #'cdr
+ (if yas-choose-keys-first
+ (let ((key (yas--prompt-for-keys
+ (cl-mapcan #'yas--table-all-keys tables))))
+ (when key
+ (cl-mapcan (lambda (table)
+ (yas--fetch table key))
+ tables)))
+ (cl-remove-duplicates (cl-mapcan #'yas--table-templates tables)
+ :test #'equal))))
+
+(defun yas--lookup-snippet-1 (name mode)
+ "Get the snippet called NAME in MODE's tables."
+ (let ((yas-choose-tables-first nil) ; avoid prompts
+ (yas-choose-keys-first nil))
+ (cl-find name (yas--all-templates
+ (yas--get-snippet-tables mode))
+ :key #'yas--template-name :test #'string=)))
+
+(defun yas-lookup-snippet (name &optional mode noerror)
+ "Get the snippet named NAME in MODE's tables.
+
+MODE defaults to the current buffer's `major-mode'. If NOERROR
+is non-nil, then don't signal an error if there isn't any snippet
+called NAME.
+
+Honours `yas-buffer-local-condition'."
+ (cond
+ ((yas--lookup-snippet-1 name mode))
+ (noerror nil)
+ (t (error "No snippet named: %s" name))))
+
+(defun yas-insert-snippet (&optional no-condition)
+ "Choose a snippet to expand, pop-up a list of choices according
+to `yas-prompt-functions'.
+
+With prefix argument NO-CONDITION, bypass filtering of snippets
+by condition."
+ (interactive "P")
+ (setq yas--condition-cache-timestamp (current-time))
+ (let* ((yas-buffer-local-condition (or (and no-condition
+ 'always)
+ yas-buffer-local-condition))
+ (templates (yas--all-templates (yas--get-snippet-tables)))
+ (yas--current-template (and templates
+ (or (and (cl-rest templates) ;; more than one template for same key
+ (yas--prompt-for-template templates))
+ (car templates))))
+ (where (if (region-active-p)
+ (cons (region-beginning) (region-end))
+ (cons (point) (point)))))
+ (if yas--current-template
+ (yas-expand-snippet yas--current-template (car where) (cdr where))
+ (yas--message 1 "No snippets can be inserted here!"))))
+
+(defun yas-visit-snippet-file ()
+ "Choose a snippet to edit, selection like `yas-insert-snippet'.
+
+Only success if selected snippet was loaded from a file. Put the
+visited file in `snippet-mode'."
+ (interactive)
+ (let* ((yas-buffer-local-condition 'always)
+ (templates (yas--all-templates (yas--get-snippet-tables)))
+ (template (and templates
+ (or (yas--prompt-for-template templates
+ "Choose a snippet template to edit: ")
+ (car templates)))))
+
+ (if template
+ (yas--visit-snippet-file-1 template)
+ (message "No snippets tables active!"))))
+
+(defun yas--visit-snippet-file-1 (template)
+ "Helper for `yas-visit-snippet-file'."
+ (let ((file (yas--template-get-file template)))
+ (cond ((and file (file-readable-p file))
+ (find-file-other-window file)
+ (snippet-mode)
+ (set (make-local-variable 'yas--editing-template) template))
+ (file
+ (message "Original file %s no longer exists!" file))
+ (t
+ (switch-to-buffer (format "*%s*"(yas--template-name template)))
+ (let ((type 'snippet))
+ (when (listp (yas--template-content template))
+ (insert (format "# type: command\n"))
+ (setq type 'command))
+ (insert (format "# key: %s\n" (yas--template-key template)))
+ (insert (format "# name: %s\n" (yas--template-name template)))
+ (when (yas--template-keybinding template)
+ (insert (format "# binding: %s\n" (yas--template-keybinding template))))
+ (when (yas--template-expand-env template)
+ (insert (format "# expand-env: %s\n" (yas--template-expand-env template))))
+ (when (yas--template-condition template)
+ (insert (format "# condition: %s\n" (yas--template-condition template))))
+ (insert "# --\n")
+ (insert (if (eq type 'command)
+ (pp-to-string (yas--template-content template))
+ (yas--template-content template))))
+ (snippet-mode)
+ (set (make-local-variable 'yas--editing-template) template)
+ (set (make-local-variable 'default-directory)
+ (car (cdr (car (yas--guess-snippet-directories (yas--template-table template))))))))))
+
+(defun yas--guess-snippet-directories-1 (table)
+ "Guess possible snippet subdirectories for TABLE."
+ (cons (file-name-as-directory (yas--table-name table))
+ (cl-mapcan #'yas--guess-snippet-directories-1
+ (yas--table-parents table))))
+
+(defun yas--guess-snippet-directories (&optional table)
+ "Try to guess suitable directories based on the current active
+tables (or optional TABLE).
+
+Returns a list of elements (TABLE . DIRS) where TABLE is a
+`yas--table' object and DIRS is a list of all possible directories
+where snippets of table might exist."
+ (let ((main-dir (car (or (yas-snippet-dirs)
+ (setq yas-snippet-dirs
+ (list yas--default-user-snippets-dir)))))
+ (tables (if table (list table)
+ (yas--get-snippet-tables))))
+ ;; HACK! the snippet table created here is actually registered!
+ (unless table
+ ;; The major mode is probably the best guess, put it first.
+ (let ((major-mode-table (yas--table-get-create major-mode)))
+ (cl-callf2 delq major-mode-table tables)
+ (push major-mode-table tables)))
+
+ (mapcar #'(lambda (table)
+ (cons table
+ (mapcar #'(lambda (subdir)
+ (expand-file-name subdir main-dir))
+ (yas--guess-snippet-directories-1 table))))
+ tables)))
+
+(defun yas--make-directory-maybe (table-and-dirs &optional main-table-string)
+ "Return a dir inside TABLE-AND-DIRS, prompts for creation if none exists."
+ (or (cl-some (lambda (dir) (when (file-directory-p dir) dir))
+ (cdr table-and-dirs))
+ (let ((candidate (cl-first (cdr table-and-dirs))))
+ (unless (file-writable-p (file-name-directory candidate))
+ (error (yas--format "%s is not writable." candidate)))
+ (if (y-or-n-p (format "Guessed directory (%s) for%s%s table \"%s\" does not exist! Create? "
+ candidate
+ (if (gethash (yas--table-mode (car table-and-dirs))
+ yas--tables)
+ ""
+ " brand new")
+ (or main-table-string
+ "")
+ (yas--table-name (car table-and-dirs))))
+ (progn
+ (make-directory candidate 'also-make-parents)
+ ;; create the .yas-parents file here...
+ candidate)))))
+
+;; NOTE: Using the traditional "*new snippet*" stops whitespace mode
+;; from activating (it doesn't like the leading "*").
+(defconst yas-new-snippet-buffer-name "+new-snippet+")
+
+(defun yas-new-snippet (&optional no-template)
+ "Pops a new buffer for writing a snippet.
+
+Expands a snippet-writing snippet, unless the optional prefix arg
+NO-TEMPLATE is non-nil."
+ (interactive "P")
+ (let ((guessed-directories (yas--guess-snippet-directories))
+ (yas-selected-text (or yas-selected-text
+ (and (region-active-p)
+ (buffer-substring-no-properties
+ (region-beginning) (region-end))))))
+
+ (switch-to-buffer yas-new-snippet-buffer-name)
+ (erase-buffer)
+ (kill-all-local-variables)
+ (snippet-mode)
+ (yas-minor-mode 1)
+ (set (make-local-variable 'yas--guessed-modes)
+ (mapcar (lambda (d) (yas--table-mode (car d)))
+ guessed-directories))
+ (set (make-local-variable 'default-directory)
+ (car (cdr (car guessed-directories))))
+ (if (and (not no-template) yas-new-snippet-default)
+ (yas-expand-snippet yas-new-snippet-default))))
+
+(defun yas--compute-major-mode-and-parents (file)
+ "Given FILE, find the nearest snippet directory for a given mode.
+
+Returns a list (MODE-SYM PARENTS), the mode's symbol and a list
+representing one or more of the mode's parents.
+
+Note that MODE-SYM need not be the symbol of a real major mode,
+neither do the elements of PARENTS."
+ (let* ((file-dir (and file
+ (directory-file-name
+ (or (cl-some (lambda (special)
+ (locate-dominating-file file special))
+ '(".yas-setup.el"
+ ".yas-make-groups"
+ ".yas-parents"))
+ (directory-file-name (file-name-directory file))))))
+ (parents-file-name (concat file-dir "/.yas-parents"))
+ (major-mode-name (and file-dir
+ (file-name-nondirectory file-dir)))
+ (major-mode-sym (or (and major-mode-name
+ (intern major-mode-name))))
+ (parents (when (file-readable-p parents-file-name)
+ (mapcar #'intern
+ (split-string
+ (with-temp-buffer
+ (insert-file-contents parents-file-name)
+ (buffer-substring-no-properties (point-min)
+ (point-max))))))))
+ (when major-mode-sym
+ (cons major-mode-sym (remove major-mode-sym parents)))))
+
+(defvar yas--editing-template nil
+ "Supporting variable for `yas-load-snippet-buffer' and `yas--visit-snippet'.")
+
+(defvar yas--current-template nil
+ "Holds the current template being expanded into a snippet.")
+
+(defvar yas--guessed-modes nil
+ "List of guessed modes supporting `yas-load-snippet-buffer'.")
+
+(defun yas--read-table ()
+ "Ask user for a snippet table, help with some guessing."
+ (let ((prompt (if (and (featurep 'ido)
+ ido-mode)
+ 'ido-completing-read 'completing-read)))
+ (unless yas--guessed-modes
+ (set (make-local-variable 'yas--guessed-modes)
+ (or (yas--compute-major-mode-and-parents buffer-file-name))))
+ (intern
+ (funcall prompt (format "Choose or enter a table (yas guesses %s): "
+ (if yas--guessed-modes
+ (cl-first yas--guessed-modes)
+ "nothing"))
+ (mapcar #'symbol-name yas--guessed-modes)
+ nil
+ nil
+ nil
+ nil
+ (if (cl-first yas--guessed-modes)
+ (symbol-name (cl-first yas--guessed-modes)))))))
+
+(defun yas-load-snippet-buffer (table &optional interactive)
+ "Parse and load current buffer's snippet definition into TABLE.
+TABLE is a symbol name passed to `yas--table-get-create'. When
+called interactively, prompt for the table name.
+Return the `yas--template' object created"
+ (interactive (list (yas--read-table) t))
+ (cond
+ ;; We have `yas--editing-template', this buffer's content comes from a
+ ;; template which is already loaded and neatly positioned,...
+ ;;
+ (yas--editing-template
+ (yas--define-snippets-1 (yas--parse-template (yas--template-load-file yas--editing-template))
+ (yas--template-table yas--editing-template)))
+ ;; Try to use `yas--guessed-modes'. If we don't have that use the
+ ;; value from `yas--compute-major-mode-and-parents'
+ ;;
+ (t
+ (unless yas--guessed-modes
+ (set (make-local-variable 'yas--guessed-modes) (or (yas--compute-major-mode-and-parents buffer-file-name))))
+ (let* ((table (yas--table-get-create table)))
+ (set (make-local-variable 'yas--editing-template)
+ (yas--define-snippets-1 (yas--parse-template buffer-file-name)
+ table)))))
+ (when interactive
+ (yas--message 3 "Snippet \"%s\" loaded for %s."
+ (yas--template-name yas--editing-template)
+ (yas--table-name (yas--template-table yas--editing-template))))
+ yas--editing-template)
+
+(defun yas-maybe-load-snippet-buffer ()
+ "Added to `after-save-hook' in `snippet-mode'."
+ (let* ((mode (intern (file-name-sans-extension
+ (file-name-nondirectory
+ (directory-file-name default-directory)))))
+ (current-snippet
+ (apply #'yas--define-snippets-2 (yas--table-get-create mode)
+ (yas--parse-template buffer-file-name)))
+ (uuid (yas--template-uuid current-snippet)))
+ (unless (equal current-snippet
+ (if uuid (yas--get-template-by-uuid mode uuid)
+ (yas--lookup-snippet-1
+ (yas--template-name current-snippet) mode)))
+ (yas-load-snippet-buffer mode t))))
+
+(defun yas-load-snippet-buffer-and-close (table &optional kill)
+ "Load and save the snippet, then `quit-window' if saved.
+Loading is performed by `yas-load-snippet-buffer'. If the
+snippet is new, ask the user whether (and where) to save it. If
+the snippet already has a file, just save it.
+
+The prefix argument KILL is passed to `quit-window'.
+
+Don't use this from a Lisp program, call `yas-load-snippet-buffer'
+and `kill-buffer' instead."
+ (interactive (list (yas--read-table) current-prefix-arg))
+ (let ((template (yas-load-snippet-buffer table t)))
+ (when (and (buffer-modified-p)
+ (y-or-n-p
+ (format "[yas] Loaded for %s. Also save snippet buffer?"
+ (yas--table-name (yas--template-table template)))))
+ (let ((default-directory (car (cdr (car (yas--guess-snippet-directories
+ (yas--template-table template))))))
+ (default-file-name (yas--template-name template)))
+ (unless (or buffer-file-name (not default-file-name))
+ (setq buffer-file-name
+ (read-file-name "File to save snippet in: "
+ nil nil nil default-file-name))
+ (rename-buffer (file-name-nondirectory buffer-file-name) t))
+ (save-buffer)))
+ (quit-window kill)))
+
+(declare-function yas-debug-snippets "yasnippet-debug")
+
+(defun yas-tryout-snippet (&optional debug)
+ "Test current buffer's snippet template in other buffer.
+DEBUG is for debugging the YASnippet engine itself."
+ (interactive "P")
+ (let* ((major-mode-and-parent (yas--compute-major-mode-and-parents buffer-file-name))
+ (parsed (yas--parse-template))
+ (test-mode (or (and (car major-mode-and-parent)
+ (fboundp (car major-mode-and-parent))
+ (car major-mode-and-parent))
+ (cl-first yas--guessed-modes)
+ (intern (read-from-minibuffer (yas--format "Please input a mode: ")))))
+ (yas--current-template
+ (and parsed
+ (fboundp test-mode)
+ (yas--make-template :table nil ;; no tables for ephemeral snippets
+ :key (nth 0 parsed)
+ :content (nth 1 parsed)
+ :name (nth 2 parsed)
+ :expand-env (nth 5 parsed)))))
+ (cond (yas--current-template
+ (let ((buffer-name
+ (format "*testing snippet: %s*"
+ (yas--template-name yas--current-template))))
+ (kill-buffer (get-buffer-create buffer-name))
+ (switch-to-buffer (get-buffer-create buffer-name))
+ (setq buffer-undo-list nil)
+ (condition-case nil (funcall test-mode) (error nil))
+ (yas-minor-mode 1)
+ (setq buffer-read-only nil)
+ (yas-expand-snippet yas--current-template
+ (point-min) (point-max))
+ (when (and debug
+ (require 'yasnippet-debug nil t))
+ (yas-debug-snippets "*YASnippet trace*" 'snippet-navigation)
+ (display-buffer "*YASnippet trace*"))))
+ (t
+ (yas--message 1 "Cannot test snippet for unknown major mode")))))
+
+(defun yas-active-keys ()
+ "Return all active trigger keys for current buffer and point."
+ (cl-remove-duplicates
+ (cl-remove-if-not #'stringp (cl-mapcan #'yas--table-all-keys
+ (yas--get-snippet-tables)))
+ :test #'string=))
+
+(defun yas--template-fine-group (template)
+ (car (last (or (yas--template-group template)
+ (yas--template-perm-group template)))))
+
+(defun yas-describe-table-by-namehash ()
+ "Display snippet tables by NAMEHASH."
+ (interactive)
+ (with-current-buffer (get-buffer-create "*YASnippet Tables by NAMEHASH*")
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (insert "YASnippet tables by NAMEHASH: \n")
+ (maphash
+ (lambda (_mode table)
+ (insert (format "\nSnippet table `%s':\n\n" (yas--table-name table)))
+ (maphash
+ (lambda (key _v)
+ (insert (format " key %s maps snippets: %s\n" key
+ (let ((names))
+ (maphash #'(lambda (k _v)
+ (push k names))
+ (gethash key (yas--table-hash table)))
+ names))))
+ (yas--table-hash table)))
+ yas--tables))
+ (view-mode +1)
+ (goto-char 1)
+ (display-buffer (current-buffer))))
+
+(defun yas-describe-tables (&optional with-nonactive)
+ "Display snippets for each table."
+ (interactive "P")
+ (let ((original-buffer (current-buffer))
+ (tables (yas--get-snippet-tables)))
+ (with-current-buffer (get-buffer-create "*YASnippet Tables*")
+ (let ((inhibit-read-only t))
+ (when with-nonactive
+ (maphash #'(lambda (_k v)
+ (cl-pushnew v tables))
+ yas--tables))
+ (erase-buffer)
+ (insert "YASnippet tables:\n")
+ (dolist (table tables)
+ (yas--describe-pretty-table table original-buffer))
+ (yas--create-snippet-xrefs))
+ (help-mode)
+ (goto-char 1)
+ (display-buffer (current-buffer)))))
+
+(defun yas--describe-pretty-table (table &optional original-buffer)
+ (insert (format "\nSnippet table `%s'"
+ (yas--table-name table)))
+ (if (yas--table-parents table)
+ (insert (format " parents: %s\n"
+ (mapcar #'yas--table-name
+ (yas--table-parents table))))
+ (insert "\n"))
+ (insert (make-string 100 ?-) "\n")
+ (insert "group state name key binding\n")
+ (let ((groups-hash (make-hash-table :test #'equal)))
+ (maphash #'(lambda (_k v)
+ (let ((group (or (yas--template-fine-group v)
+ "(top level)")))
+ (when (yas--template-name v)
+ (puthash group
+ (cons v (gethash group groups-hash))
+ groups-hash))))
+ (yas--table-uuidhash table))
+ (maphash
+ #'(lambda (group templates)
+ (setq group (truncate-string-to-width group 25 0 ? "..."))
+ (insert (make-string 100 ?-) "\n")
+ (dolist (p templates)
+ (let* ((name (truncate-string-to-width (propertize (format "\\\\snippet `%s'" (yas--template-name p))
+ 'yasnippet p)
+ 50 0 ? "..."))
+ (group (prog1 group
+ (setq group (make-string (length group) ? ))))
+ (condition-string (let ((condition (yas--template-condition p)))
+ (if (and condition
+ original-buffer)
+ (with-current-buffer original-buffer
+ (if (yas--eval-condition condition)
+ "(y)"
+ "(s)"))
+ "(a)")))
+ (key-description-string (key-description (yas--template-keybinding p)))
+ (template-key-padding (if (string= key-description-string "") nil ? )))
+ (insert group " "
+ condition-string " "
+ name (if (string-match "\\.\\.\\.$" name)
+ "'" " ")
+ " "
+ (truncate-string-to-width (or (yas--template-key p) "")
+ 15 0 template-key-padding "...")
+ (or template-key-padding "")
+ (truncate-string-to-width key-description-string
+ 15 0 nil "...")
+ "\n"))))
+ groups-hash)))
+
+
+
+;;; User convenience functions, for using in `yas-key-syntaxes'
+
+(defun yas-try-key-from-whitespace (_start-point)
+ "As `yas-key-syntaxes' element, look for whitespace delimited key.
+
+A newline will be considered whitespace even if the mode syntax
+marks it as something else (typically comment ender)."
+ (skip-chars-backward "^[:space:]\n"))
+
+(defun yas-shortest-key-until-whitespace (_start-point)
+ "Like `yas-longest-key-from-whitespace' but take the shortest key."
+ (when (/= (skip-chars-backward "^[:space:]\n" (1- (point))) 0)
+ 'again))
+
+(defun yas-longest-key-from-whitespace (start-point)
+ "As `yas-key-syntaxes' element, look for longest key between point and whitespace.
+
+A newline will be considered whitespace even if the mode syntax
+marks it as something else (typically comment ender)."
+ (if (= (point) start-point)
+ (yas-try-key-from-whitespace start-point)
+ (forward-char))
+ (unless (<= start-point (1+ (point)))
+ 'again))
+
+
+
+;;; User convenience functions, for using in snippet definitions
+
+(defvar yas-modified-p nil
+ "Non-nil if field has been modified by user or transformation.")
+
+(defvar yas-moving-away-p nil
+ "Non-nil if user is about to exit field.")
+
+(defvar yas-text nil
+ "Contains current field text.")
+
+(defun yas-substr (str pattern &optional subexp)
+ "Search PATTERN in STR and return SUBEXPth match.
+
+If found, the content of subexp group SUBEXP (default 0) is
+ returned, or else the original STR will be returned."
+ (let ((grp (or subexp 0)))
+ (save-match-data
+ (if (string-match pattern str)
+ (match-string-no-properties grp str)
+ str))))
+
+(defun yas-choose-value (&rest possibilities)
+ "Prompt for a string in POSSIBILITIES and return it.
+
+The last element of POSSIBILITIES may be a list of strings."
+ (unless (or yas-moving-away-p
+ yas-modified-p)
+ (let* ((last-link (last possibilities))
+ (last-elem (car last-link)))
+ (when (listp last-elem)
+ (setcar last-link (car last-elem))
+ (setcdr last-link (cdr last-elem))))
+ (cl-some (lambda (fn)
+ (funcall fn "Choose: " possibilities))
+ yas-prompt-functions)))
+
+(defun yas-completing-read (&rest args)
+ "A snippet-aware version of `completing-read'.
+This can be used to query the user for the initial value of a
+snippet field. The arguments are the same as `completing-read'.
+
+\(fn PROMPT COLLECTION &optional PREDICATE REQUIRE-MATCH INITIAL-INPUT HIST DEF INHERIT-INPUT-METHOD)"
+ (unless (or yas-moving-away-p
+ yas-modified-p)
+ (apply #'completing-read args)))
+
+(defun yas--auto-next ()
+ "Helper for `yas-auto-next'."
+ (cl-loop
+ do (progn (remove-hook 'post-command-hook #'yas--auto-next t)
+ (yas-next-field))
+ ;; The transform in the next field may have requested auto-next as
+ ;; well. Call it ourselves, since the command loop itself won't
+ ;; recheck the value of post-command-hook while running it.
+ while (memq #'yas--auto-next post-command-hook)))
+
+(defmacro yas-auto-next (&rest body)
+ "Automatically advance to next field after eval'ing BODY."
+ (declare (indent 0) (debug t))
+ `(unless yas-moving-away-p
+ (prog1 ,@body
+ (add-hook 'post-command-hook #'yas--auto-next nil t))))
+
+(defun yas-key-to-value (alist)
+ (unless (or yas-moving-away-p
+ yas-modified-p)
+ (let ((key (read-key-sequence "")))
+ (when (stringp key)
+ (or (cdr (cl-find key alist :key #'car :test #'string=))
+ key)))))
+
+(defun yas-throw (text)
+ "Signal `yas-exception' with TEXT as the reason."
+ (signal 'yas-exception (list text)))
+(put 'yas-exception 'error-conditions '(error yas-exception))
+(put 'yas-exception 'error-message "[yas] Exception")
+
+(defun yas-verify-value (possibilities)
+ "Verify that the current field value is in POSSIBILITIES.
+Otherwise signal `yas-exception'."
+ (when (and yas-moving-away-p (not (member yas-text possibilities)))
+ (yas-throw (format "Field only allows %s" possibilities))))
+
+(defun yas-field-value (number)
+ "Get the string for field with NUMBER.
+
+Use this in primary and mirror transformations to get the text of
+other fields."
+ (let* ((snippet (car (yas-active-snippets)))
+ (field (and snippet
+ (yas--snippet-find-field snippet number))))
+ (when field
+ (yas--field-text-for-display field))))
+
+(defun yas-text ()
+ "Return `yas-text' if that exists and is non-empty, else nil."
+ (if (and yas-text
+ (not (string= "" yas-text)))
+ yas-text))
+
+(defun yas-selected-text ()
+ "Return `yas-selected-text' if that exists and is non-empty, else nil."
+ (if (and yas-selected-text
+ (not (string= "" yas-selected-text)))
+ yas-selected-text))
+
+(defun yas--get-field-once (number &optional transform-fn)
+ (unless yas-modified-p
+ (if transform-fn
+ (funcall transform-fn (yas-field-value number))
+ (yas-field-value number))))
+
+(defun yas-default-from-field (number)
+ (unless yas-modified-p
+ (yas-field-value number)))
+
+(defun yas-inside-string ()
+ "Return non-nil if the point is inside a string according to font-lock."
+ (equal 'font-lock-string-face (get-char-property (1- (point)) 'face)))
+
+(defun yas-unimplemented (&optional missing-feature)
+ (if yas--current-template
+ (if (y-or-n-p (format "This snippet is unimplemented (missing %s) Visit the snippet definition? "
+ (or missing-feature
+ "something")))
+ (yas--visit-snippet-file-1 yas--current-template))
+ (message "No implementation. Missing %s" (or missing-feature "something"))))
+
+
+;;; Snippet expansion and field management
+
+(defvar yas--active-field-overlay nil
+ "Overlays the currently active field.")
+
+(defvar yas--active-snippets nil
+ "List of currently active snippets")
+(make-variable-buffer-local 'yas--active-snippets)
+
+(defvar yas--field-protection-overlays nil
+ "Two overlays protect the current active field.")
+
+(defvar yas-selected-text nil
+ "The selected region deleted on the last snippet expansion.")
+
+(defvar yas--start-column nil
+ "The column where the snippet expansion started.")
+
+(make-variable-buffer-local 'yas--active-field-overlay)
+(make-variable-buffer-local 'yas--field-protection-overlays)
+(put 'yas--active-field-overlay 'permanent-local t)
+(put 'yas--field-protection-overlays 'permanent-local t)
+
+(cl-defstruct (yas--snippet (:constructor yas--make-snippet (expand-env)))
+ "A snippet.
+
+..."
+ expand-env
+ (fields '())
+ (exit nil)
+ (id (yas--snippet-next-id) :read-only t)
+ (control-overlay nil)
+ active-field
+ ;; stacked expansion: the `previous-active-field' slot saves the
+ ;; active field where the child expansion took place
+ previous-active-field
+ force-exit)
+
+(cl-defstruct (yas--field (:constructor yas--make-field (number start end parent-field)))
+ "A field.
+
+NUMBER is the field number.
+START and END are mostly buffer markers, but see \"apropos markers-to-points\".
+PARENT-FIELD is a `yas--field' this field is nested under, or nil.
+MIRRORS is a list of `yas--mirror's
+TRANSFORM is a lisp form.
+MODIFIED-P is a boolean set to true once user inputs text.
+NEXT is another `yas--field' or `yas--mirror' or `yas--exit'.
+"
+ number
+ start end
+ parent-field
+ (mirrors '())
+ (transform nil)
+ (modified-p nil)
+ next)
+
+
+(cl-defstruct (yas--mirror (:constructor yas--make-mirror (start end transform)))
+ "A mirror.
+
+START and END are mostly buffer markers, but see \"apropos markers-to-points\".
+TRANSFORM is a lisp form.
+PARENT-FIELD is a `yas--field' this mirror is nested under, or nil.
+NEXT is another `yas--field' or `yas--mirror' or `yas--exit'
+DEPTH is a count of how many nested mirrors can affect this mirror"
+ start end
+ (transform nil)
+ parent-field
+ next
+ depth)
+
+(cl-defstruct (yas--exit (:constructor yas--make-exit (marker)))
+ marker
+ next)
+
+(defmacro yas--letenv (env &rest body)
+ "Evaluate BODY with bindings from ENV.
+ENV is a lisp expression that evaluates to list of elements with
+the form (VAR FORM), where VAR is a symbol and FORM is a lisp
+expression that evaluates to its value."
+ (declare (debug (form body)) (indent 1))
+ (let ((envvar (make-symbol "envvar")))
+ `(let ((,envvar ,env))
+ (cl-progv
+ (mapcar #'car ,envvar)
+ (mapcar (lambda (v-f) (eval (cadr v-f))) ,envvar)
+ ,@body))))
+
+(defun yas--snippet-map-markers (fun snippet)
+ "Apply FUN to all marker (sub)fields in SNIPPET.
+Update each field with the result of calling FUN."
+ (dolist (field (yas--snippet-fields snippet))
+ (setf (yas--field-start field) (funcall fun (yas--field-start field)))
+ (setf (yas--field-end field) (funcall fun (yas--field-end field)))
+ (dolist (mirror (yas--field-mirrors field))
+ (setf (yas--mirror-start mirror) (funcall fun (yas--mirror-start mirror)))
+ (setf (yas--mirror-end mirror) (funcall fun (yas--mirror-end mirror)))))
+ (let ((snippet-exit (yas--snippet-exit snippet)))
+ (when snippet-exit
+ (setf (yas--exit-marker snippet-exit)
+ (funcall fun (yas--exit-marker snippet-exit))))))
+
+(defun yas--snippet-live-p (snippet)
+ "Return non-nil if SNIPPET hasn't been committed."
+ (catch 'live
+ (yas--snippet-map-markers (lambda (m)
+ (if (markerp m) m
+ (throw 'live nil)))
+ snippet)
+ t))
+
+(defun yas--apply-transform (field-or-mirror field &optional empty-on-nil-p)
+ "Calculate transformed string for FIELD-OR-MIRROR from FIELD.
+
+If there is no transform for ht field, return nil.
+
+If there is a transform but it returns nil, return the empty
+string iff EMPTY-ON-NIL-P is true."
+ (let* ((yas-text (yas--field-text-for-display field))
+ (yas-modified-p (yas--field-modified-p field))
+ (transform (if (yas--mirror-p field-or-mirror)
+ (yas--mirror-transform field-or-mirror)
+ (yas--field-transform field-or-mirror)))
+ (start-point (if (yas--mirror-p field-or-mirror)
+ (yas--mirror-start field-or-mirror)
+ (yas--field-start field-or-mirror)))
+ (transformed (and transform
+ (save-excursion
+ (goto-char start-point)
+ (let ((ret (yas--eval-for-string transform)))
+ (or ret (and empty-on-nil-p "")))))))
+ transformed))
+
+(defsubst yas--replace-all (from to &optional text)
+ "Replace all occurrences from FROM to TO.
+
+With optional string TEXT do it in that string."
+ (if text
+ (replace-regexp-in-string (regexp-quote from) to text t t)
+ (goto-char (point-min))
+ (while (search-forward from nil t)
+ (replace-match to t t text))))
+
+(defun yas--snippet-find-field (snippet number)
+ (cl-find-if (lambda (field)
+ (eq number (yas--field-number field)))
+ (yas--snippet-fields snippet)))
+
+(defun yas--snippet-sort-fields (snippet)
+ "Sort the fields of SNIPPET in navigation order."
+ (setf (yas--snippet-fields snippet)
+ (sort (yas--snippet-fields snippet)
+ #'yas--snippet-field-compare)))
+
+(defun yas--snippet-field-compare (field1 field2)
+ "Compare FIELD1 and FIELD2.
+
+The field with a number is sorted first. If they both have a
+number, compare through the number. If neither have, compare
+through the field's start point"
+ (let ((n1 (yas--field-number field1))
+ (n2 (yas--field-number field2)))
+ (if n1
+ (if n2
+ (or (zerop n2) (and (not (zerop n1))
+ (< n1 n2)))
+ (not (zerop n1)))
+ (if n2
+ (zerop n2)
+ (< (yas--field-start field1)
+ (yas--field-start field2))))))
+
+(defun yas--field-probably-deleted-p (snippet field)
+ "Guess if SNIPPET's FIELD should be skipped."
+ (and
+ ;; field must be zero length
+ ;;
+ (zerop (- (yas--field-start field) (yas--field-end field)))
+ ;; field must have been modified
+ ;;
+ (yas--field-modified-p field)
+ ;; either:
+ (or
+ ;; 1) it's a nested field
+ ;;
+ (yas--field-parent-field field)
+ ;; 2) ends just before the snippet end
+ ;;
+ (and (eq field (car (last (yas--snippet-fields snippet))))
+ (= (yas--field-start field) (overlay-end (yas--snippet-control-overlay snippet)))))
+ ;; the field numbered 0, just before the exit marker, should
+ ;; never be skipped
+ ;;
+ (not (and (yas--field-number field)
+ (zerop (yas--field-number field))))))
+
+(defun yas-active-snippets (&optional beg end)
+ "Return a sorted list of active snippets.
+The most recently-inserted snippets are returned first.
+
+Only snippets overlapping the region BEG ... END are returned.
+Overlapping has the same meaning as described in `overlays-in'.
+If END is omitted, it defaults to (1+ BEG). If BEG is omitted,
+it defaults to point. A non-nil, non-buffer position BEG is
+equivalent to a range covering the whole buffer."
+ (unless beg
+ (setq beg (point)))
+ (cond ((not (or (integerp beg) (markerp beg)))
+ (setq beg (point-min) end (point-max)))
+ ((not end)
+ (setq end (1+ beg))))
+ (if (and (eq beg (point-min))
+ (eq end (point-max)))
+ yas--active-snippets
+ ;; Note: don't use `mapcar' here, since it would allocate in
+ ;; proportion to the amount of overlays, even though the list of
+ ;; active snippets should be very small.
+ (let ((snippets nil))
+ (dolist (ov (overlays-in beg end))
+ (let ((snippet (overlay-get ov 'yas--snippet)))
+ ;; Snippets have multiple overlays, so check for dups.
+ (when (and snippet (not (memq snippet snippets)))
+ (push snippet snippets))))
+ (cl-sort snippets #'>= :key #'yas--snippet-id))))
+
+(define-obsolete-function-alias 'yas--snippets-at-point
+ 'yas-active-snippets "0.12")
+
+(defun yas-next-field-or-maybe-expand ()
+ "Try to expand a snippet at a key before point.
+
+Otherwise delegate to `yas-next-field'."
+ (interactive)
+ (if yas-triggers-in-field
+ (let ((yas-fallback-behavior 'return-nil)
+ (active-field (overlay-get yas--active-field-overlay 'yas--field)))
+ (when active-field
+ (unless (yas-expand-from-trigger-key active-field)
+ (yas-next-field))))
+ (yas-next-field)))
+
+(defun yas-next-field-will-exit-p (&optional arg)
+ "Return non-nil if (yas-next-field ARG) would exit the current snippet."
+ (let ((snippet (car (yas-active-snippets)))
+ (active (overlay-get yas--active-field-overlay 'yas--field)))
+ (when snippet
+ (not (yas--find-next-field arg snippet active)))))
+
+(defun yas--find-next-field (n snippet active)
+ "Return the Nth field after the ACTIVE one in SNIPPET."
+ (let ((live-fields (cl-remove-if
+ (lambda (field)
+ (and (not (eq field active))
+ (yas--field-probably-deleted-p snippet field)))
+ (yas--snippet-fields snippet))))
+ (nth (abs n) (memq active (if (>= n 0) live-fields (reverse live-fields))))))
+
+(defun yas-next-field (&optional arg)
+ "Navigate to the ARGth next field.
+
+If there's none, exit the snippet."
+ (interactive)
+ (unless arg (setq arg 1))
+ (let* ((active-field (overlay-get yas--active-field-overlay 'yas--field))
+ (snippet (car (yas-active-snippets (yas--field-start active-field)
+ (yas--field-end active-field))))
+ (target-field (yas--find-next-field arg snippet active-field)))
+ (yas--letenv (yas--snippet-expand-env snippet)
+ ;; Apply transform to active field.
+ (when active-field
+ (let ((yas-moving-away-p t))
+ (when (yas--field-update-display active-field)
+ (yas--update-mirrors snippet))))
+ ;; Now actually move...
+ (if target-field
+ (yas--move-to-field snippet target-field)
+ (yas-exit-snippet snippet)))))
+
+(defun yas--place-overlays (snippet field)
+ "Correctly place overlays for SNIPPET's FIELD."
+ (yas--make-move-field-protection-overlays snippet field)
+ ;; Only move active field overlays if this is field is from the
+ ;; innermost snippet.
+ (when (eq snippet (car (yas-active-snippets (1- (yas--field-start field))
+ (1+ (yas--field-end field)))))
+ (yas--make-move-active-field-overlay snippet field)))
+
+(defun yas--move-to-field (snippet field)
+ "Update SNIPPET to move to field FIELD.
+
+Also create some protection overlays"
+ (goto-char (yas--field-start field))
+ (yas--place-overlays snippet field)
+ (overlay-put yas--active-field-overlay 'yas--snippet snippet)
+ (overlay-put yas--active-field-overlay 'yas--field field)
+ (let ((number (yas--field-number field)))
+ ;; check for the special ${0: ...} field
+ (if (and number (zerop number))
+ (progn
+ (set-mark (yas--field-end field))
+ (setf (yas--snippet-force-exit snippet)
+ (or (yas--field-transform field)
+ t)))
+ ;; make this field active
+ (setf (yas--snippet-active-field snippet) field)
+ ;; primary field transform: first call to snippet transform
+ (unless (yas--field-modified-p field)
+ (if (yas--field-update-display field)
+ (yas--update-mirrors snippet)
+ (setf (yas--field-modified-p field) nil))))))
+
+(defun yas-prev-field ()
+ "Navigate to prev field. If there's none, exit the snippet."
+ (interactive)
+ (yas-next-field -1))
+
+(defun yas-abort-snippet (&optional snippet)
+ (interactive)
+ (let ((snippet (or snippet
+ (car (yas-active-snippets)))))
+ (when snippet
+ (setf (yas--snippet-force-exit snippet) t))))
+
+(defun yas-exit-snippet (snippet)
+ "Goto exit-marker of SNIPPET."
+ (interactive (list (cl-first (yas-active-snippets))))
+ (when snippet
+ (setf (yas--snippet-force-exit snippet) t)
+ (goto-char (if (yas--snippet-exit snippet)
+ (yas--exit-marker (yas--snippet-exit snippet))
+ (overlay-end (yas--snippet-control-overlay snippet))))))
+
+(defun yas-exit-all-snippets ()
+ "Exit all snippets."
+ (interactive)
+ (mapc #'(lambda (snippet)
+ (yas-exit-snippet snippet)
+ (yas--check-commit-snippet))
+ (yas-active-snippets 'all)))
+
+
+;;; Some low level snippet-routines:
+
+(defvar yas--inhibit-overlay-hooks nil
+ "Bind this temporarily to non-nil to prevent running `yas--on-*-modification'.")
+
+(defvar yas-snippet-beg nil "Beginning position of the last snippet committed.")
+(defvar yas-snippet-end nil "End position of the last snippet committed.")
+
+(defun yas--commit-snippet (snippet)
+ "Commit SNIPPET, but leave point as it is.
+
+This renders the snippet as ordinary text."
+
+ (let ((control-overlay (yas--snippet-control-overlay snippet)))
+ ;;
+ ;; Save the end of the moribund snippet in case we need to revive it
+ ;; its original expansion.
+ ;;
+ (when (and control-overlay
+ (overlay-buffer control-overlay))
+ (setq yas-snippet-beg (overlay-start control-overlay))
+ (setq yas-snippet-end (overlay-end control-overlay))
+ (delete-overlay control-overlay)
+ (setf (yas--snippet-control-overlay snippet) nil))
+
+ (let ((yas--inhibit-overlay-hooks t))
+ (when yas--active-field-overlay
+ (delete-overlay yas--active-field-overlay))
+ (when yas--field-protection-overlays
+ (mapc #'delete-overlay yas--field-protection-overlays)))
+
+ ;; stacked expansion: if the original expansion took place from a
+ ;; field, make sure we advance it here at least to
+ ;; `yas-snippet-end'...
+ ;;
+ (let ((previous-field (yas--snippet-previous-active-field snippet)))
+ (when (and yas-snippet-end previous-field)
+ (yas--advance-end-maybe-previous-fields
+ previous-field yas-snippet-end (cdr yas--active-snippets))))
+
+ ;; Convert all markers to points,
+ ;;
+ (yas--markers-to-points snippet)
+
+ ;; It's no longer an active snippet.
+ (cl-callf2 delq snippet yas--active-snippets)
+
+ ;; Take care of snippet revival on undo.
+ (if (and yas-snippet-revival (listp buffer-undo-list))
+ (push `(apply yas--snippet-revive ,yas-snippet-beg ,yas-snippet-end ,snippet)
+ buffer-undo-list)
+ ;; Dismember the snippet... this is useful if we get called
+ ;; again from `yas--take-care-of-redo'....
+ (setf (yas--snippet-fields snippet) nil)))
+
+ (yas--message 4 "Snippet %s exited." (yas--snippet-id snippet)))
+
+(defvar yas--snippets-to-move nil)
+(make-variable-buffer-local 'yas--snippets-to-move)
+
+(defun yas--prepare-snippets-for-move (beg end buf pos)
+ "Gather snippets in BEG..END for moving to POS in BUF."
+ (let ((to-move nil)
+ (snippets (yas-active-snippets beg end))
+ (dst-base-line (with-current-buffer buf
+ (count-lines (point-min) pos))))
+ (when snippets
+ (dolist (snippet snippets)
+ (yas--snippet-map-markers
+ (lambda (m)
+ (prog1 (cons m (yas--snapshot-line-location m))
+ (set-marker m nil)))
+ snippet)
+ (let ((ctrl-ov (yas--snapshot-overlay-line-location
+ (yas--snippet-control-overlay snippet))))
+ (push (list ctrl-ov dst-base-line snippet) to-move)
+ (delete-overlay (car ctrl-ov))))
+ (with-current-buffer buf
+ (cl-callf2 nconc to-move yas--snippets-to-move)))))
+
+(defun yas--on-buffer-kill ()
+ ;; Org mode uses temp buffers for fontification and "native tab",
+ ;; move all the snippets to the original org-mode buffer when it's
+ ;; killed.
+ (let ((org-marker nil)
+ (org-buffer nil))
+ (when (and yas-minor-mode
+ (or (bound-and-true-p org-edit-src-from-org-mode)
+ (bound-and-true-p org-src--from-org-mode))
+ (markerp
+ (setq org-marker
+ (or (bound-and-true-p org-edit-src-beg-marker)
+ (bound-and-true-p org-src--beg-marker))))
+ ;; If the org source buffer is killed before the temp
+ ;; fontification one, org-marker might point nowhere.
+ (setq org-buffer (marker-buffer org-marker)))
+ (yas--prepare-snippets-for-move
+ (point-min) (point-max)
+ org-buffer org-marker))))
+
+(add-hook 'kill-buffer-hook #'yas--on-buffer-kill)
+
+(defun yas--finish-moving-snippets ()
+ "Finish job started in `yas--prepare-snippets-for-move'."
+ (cl-loop for (ctrl-ov base-line snippet) in yas--snippets-to-move
+ for base-pos = (progn (goto-char (point-min))
+ (forward-line base-line) (point))
+ do (yas--snippet-map-markers
+ (lambda (saved-location)
+ (let ((m (pop saved-location)))
+ (set-marker m (yas--goto-saved-line-location
+ base-pos saved-location))
+ m))
+ snippet)
+ (goto-char base-pos)
+ (yas--restore-overlay-line-location base-pos ctrl-ov)
+ (yas--maybe-move-to-active-field snippet)
+ (push snippet yas--active-snippets))
+ (setq yas--snippets-to-move nil))
+
+(defun yas--safely-call-fun (fun)
+ "Call FUN and catch any errors."
+ (condition-case error
+ (funcall fun)
+ ((debug error)
+ (yas--message 2 "Error running %s: %s" fun
+ (error-message-string error)))))
+
+(defun yas--safely-run-hook (hook)
+ "Call HOOK's functions.
+HOOK should be a symbol, a hook variable, as in `run-hooks'."
+ (let ((debug-on-error (and (not (memq yas-good-grace '(t hooks)))
+ debug-on-error)))
+ (yas--safely-call-fun (apply-partially #'run-hooks hook))))
+
+(defun yas--check-commit-snippet ()
+ "Check if point exited the currently active field of the snippet.
+
+If so cleans up the whole snippet up."
+ (let* ((snippet-exit-transform nil)
+ (exited-snippets-p nil)
+ ;; Record the custom snippet `yas-after-exit-snippet-hook'
+ ;; set in the expand-env field.
+ (snippet-exit-hook yas-after-exit-snippet-hook))
+ (dolist (snippet yas--active-snippets)
+ (let ((active-field (yas--snippet-active-field snippet)))
+ (yas--letenv (yas--snippet-expand-env snippet)
+ ;; Note: the `force-exit' field could be a transform in case of
+ ;; ${0: ...}, see `yas--move-to-field'.
+ (setq snippet-exit-transform (yas--snippet-force-exit snippet))
+ (cond ((or snippet-exit-transform
+ (not (and active-field (yas--field-contains-point-p active-field))))
+ (setf (yas--snippet-force-exit snippet) nil)
+ (setq snippet-exit-hook yas-after-exit-snippet-hook)
+ (yas--commit-snippet snippet)
+ (setq exited-snippets-p t))
+ ((and active-field
+ (or (not yas--active-field-overlay)
+ (not (overlay-buffer yas--active-field-overlay))))
+ ;;
+ ;; stacked expansion: this case is mainly for recent
+ ;; snippet exits that place us back int the field of
+ ;; another snippet
+ ;;
+ (save-excursion
+ (yas--move-to-field snippet active-field)
+ (yas--update-mirrors snippet)))
+ (t
+ nil)))))
+ (unless (or yas--active-snippets (not exited-snippets-p))
+ (when snippet-exit-transform
+ (yas--eval-for-effect snippet-exit-transform))
+ (let ((yas-after-exit-snippet-hook snippet-exit-hook))
+ (yas--safely-run-hook 'yas-after-exit-snippet-hook)))))
+
+;; Apropos markers-to-points:
+;;
+;; This was found useful for performance reasons, so that an excessive
+;; number of live markers aren't kept around in the
+;; `buffer-undo-list'. We don't reuse the original marker object
+;; because that leaves an unreadable object in the history list and
+;; undo-tree persistence has trouble with that.
+;;
+;; This shouldn't bring horrible problems with undo/redo, but you
+;; never know.
+;;
+(defun yas--markers-to-points (snippet)
+ "Save all markers of SNIPPET as positions."
+ (yas--snippet-map-markers (lambda (m)
+ (prog1 (marker-position m)
+ (set-marker m nil)))
+ snippet))
+
+(defun yas--points-to-markers (snippet)
+ "Restore SNIPPET's marker positions, saved by `yas--markers-to-points'."
+ (yas--snippet-map-markers #'copy-marker snippet))
+
+(defun yas--maybe-move-to-active-field (snippet)
+ "Try to move to SNIPPET's active (or first) field and return it if found."
+ (let ((target-field (or (yas--snippet-active-field snippet)
+ (car (yas--snippet-fields snippet)))))
+ (when target-field
+ (yas--move-to-field snippet target-field)
+ target-field)))
+
+(defun yas--field-contains-point-p (field &optional point)
+ (let ((point (or point
+ (point))))
+ (and (>= point (yas--field-start field))
+ (<= point (yas--field-end field)))))
+
+(defun yas--field-text-for-display (field)
+ "Return the propertized display text for field FIELD."
+ (buffer-substring (yas--field-start field) (yas--field-end field)))
+
+(defun yas--undo-in-progress ()
+ "True if some kind of undo is in progress."
+ (or undo-in-progress
+ (eq this-command 'undo)
+ (eq this-command 'redo)))
+
+(defun yas--make-control-overlay (snippet start end)
+ "Create the control overlay that surrounds the snippet and
+holds the keymap."
+ (let ((overlay (make-overlay start
+ end
+ nil
+ nil
+ t)))
+ (overlay-put overlay 'keymap yas-keymap)
+ (overlay-put overlay 'priority yas-overlay-priority)
+ (overlay-put overlay 'yas--snippet snippet)
+ overlay))
+
+(defun yas-current-field ()
+ "Return the currently active field."
+ (and yas--active-field-overlay
+ (overlay-buffer yas--active-field-overlay)
+ (overlay-get yas--active-field-overlay 'yas--field)))
+
+(defun yas--maybe-clear-field-filter (cmd)
+ "Return CMD if at start of unmodified snippet field.
+Use as a `:filter' argument for a conditional keybinding."
+ (let ((field (yas-current-field)))
+ (when (and field
+ (not (yas--field-modified-p field))
+ (eq (point) (marker-position (yas--field-start field))))
+ cmd)))
+
+(defun yas-skip-and-clear-field (&optional field)
+ "Clears unmodified FIELD if at field start, skips to next tab."
+ (interactive)
+ (yas--skip-and-clear (or field (yas-current-field)))
+ (yas-next-field 1))
+
+(defun yas-clear-field (&optional field)
+ "Clears unmodified FIELD if at field start."
+ (interactive)
+ (yas--skip-and-clear (or field (yas-current-field))))
+
+(defun yas-skip-and-clear-or-delete-char (&optional field)
+ "Clears unmodified field if at field start, skips to next tab.
+
+Otherwise deletes a character normally by calling `delete-char'."
+ (interactive)
+ (declare (obsolete "Bind to `yas-maybe-skip-and-clear-field' instead." "0.13"))
+ (cond ((yas--maybe-clear-field-filter t)
+ (yas--skip-and-clear (or field (yas-current-field)))
+ (yas-next-field 1))
+ (t (call-interactively 'delete-char))))
+
+(defun yas--skip-and-clear (field &optional from)
+ "Deletes the region of FIELD and sets it's modified state to t.
+If given, FROM indicates position to start at instead of FIELD's beginning."
+ ;; Just before skipping-and-clearing the field, mark its children
+ ;; fields as modified, too. If the children have mirrors-in-fields
+ ;; this prevents them from updating erroneously (we're skipping and
+ ;; deleting!).
+ ;;
+ (yas--mark-this-and-children-modified field)
+ (unless (= (yas--field-start field) (yas--field-end field))
+ (delete-region (or from (yas--field-start field)) (yas--field-end field))))
+
+(defun yas--mark-this-and-children-modified (field)
+ (setf (yas--field-modified-p field) t)
+ (let ((fom (yas--field-next field)))
+ (while (and fom
+ (yas--fom-parent-field fom))
+ (when (and (eq (yas--fom-parent-field fom) field)
+ (yas--field-p fom))
+ (yas--mark-this-and-children-modified fom))
+ (setq fom (yas--fom-next fom)))))
+
+(defun yas--make-move-active-field-overlay (snippet field)
+ "Place the active field overlay in SNIPPET's FIELD.
+
+Move the overlay, or create it if it does not exit."
+ (if (and yas--active-field-overlay
+ (overlay-buffer yas--active-field-overlay))
+ (move-overlay yas--active-field-overlay
+ (yas--field-start field)
+ (yas--field-end field))
+ (setq yas--active-field-overlay
+ (make-overlay (yas--field-start field)
+ (yas--field-end field)
+ nil nil t))
+ (overlay-put yas--active-field-overlay 'priority yas-overlay-priority)
+ (overlay-put yas--active-field-overlay 'face 'yas-field-highlight-face)
+ (overlay-put yas--active-field-overlay 'yas--snippet snippet)
+ (overlay-put yas--active-field-overlay 'modification-hooks '(yas--on-field-overlay-modification))
+ (overlay-put yas--active-field-overlay 'insert-in-front-hooks
+ '(yas--on-field-overlay-modification))
+ (overlay-put yas--active-field-overlay 'insert-behind-hooks
+ '(yas--on-field-overlay-modification))))
+
+(defun yas--skip-and-clear-field-p (field beg _end length)
+ "Tell if newly modified FIELD should be cleared and skipped.
+BEG, END and LENGTH like overlay modification hooks."
+ (and (= length 0) ; A 0 pre-change length indicates insertion.
+ (= beg (yas--field-start field)) ; Insertion at field start?
+ (not (yas--field-modified-p field))))
+
+
+(defun yas--merge-and-drop-dups (list1 list2 cmp key)
+ ;; `delete-consecutive-dups' + `cl-merge'.
+ (funcall (if (fboundp 'delete-consecutive-dups)
+ #'delete-consecutive-dups ; 24.4
+ #'delete-dups)
+ (cl-merge 'list list1 list2 cmp :key key)))
+
+(defvar yas--before-change-modified-snippets nil)
+(make-variable-buffer-local 'yas--before-change-modified-snippets)
+
+(defun yas--gather-active-snippets (overlay beg end then-delete)
+ ;; Add active snippets in BEG..END into an OVERLAY keyed entry of
+ ;; `yas--before-change-modified-snippets'. Return accumulated list.
+ ;; If THEN-DELETE is non-nil, delete the entry.
+ (let ((new (yas-active-snippets beg end))
+ (old (assq overlay yas--before-change-modified-snippets)))
+ (prog1 (cond ((and new old)
+ (setf (cdr old)
+ (yas--merge-and-drop-dups
+ (cdr old) new
+ ;; Sort like `yas-active-snippets'.
+ #'>= #'yas--snippet-id)))
+ (new (unless then-delete
+ ;; Don't add new entry if we're about to
+ ;; remove it anyway.
+ (push (cons overlay new)
+ yas--before-change-modified-snippets))
+ new)
+ (old (cdr old))
+ (t nil))
+ (when then-delete
+ (cl-callf2 delq old yas--before-change-modified-snippets)))))
+
+(defvar yas--todo-snippet-indent nil nil)
+(make-variable-buffer-local 'yas--todo-snippet-indent)
+
+(defun yas--on-field-overlay-modification (overlay after? beg end &optional length)
+ "Clears the field and updates mirrors, conditionally.
+
+Only clears the field if it hasn't been modified and point is at
+field start. This hook does nothing if an undo is in progress."
+ (unless (or yas--inhibit-overlay-hooks
+ (not (overlayp yas--active-field-overlay)) ; Avoid Emacs bug #21824.
+ ;; If a single change hits multiple overlays of the same
+ ;; snippet, then we delete the snippet the first time,
+ ;; and then subsequent calls get a deleted overlay.
+ ;; Don't delete the snippet again!
+ (not (overlay-buffer overlay))
+ (yas--undo-in-progress))
+ (let* ((inhibit-modification-hooks nil)
+ (yas--inhibit-overlay-hooks t)
+ (field (overlay-get overlay 'yas--field))
+ (snippet (overlay-get yas--active-field-overlay 'yas--snippet)))
+ (if (yas--snippet-live-p snippet)
+ (if after?
+ (save-match-data
+ (yas--letenv (yas--snippet-expand-env snippet)
+ (when (yas--skip-and-clear-field-p field beg end length)
+ ;; We delete text starting from the END of insertion.
+ (yas--skip-and-clear field end))
+ (setf (yas--field-modified-p field) t)
+ ;; Adjust any pending active fields in case of stacked
+ ;; expansion.
+ (yas--advance-end-maybe-previous-fields
+ field (overlay-end overlay)
+ (yas--gather-active-snippets overlay beg end t))
+ ;; Update fields now, but delay auto indentation until
+ ;; post-command. We don't want to run indentation on
+ ;; the intermediate state where field text might be
+ ;; removed (and hence the field could be deleted along
+ ;; with leading indentation).
+ (let ((yas-indent-line nil))
+ (save-excursion
+ (yas--field-update-display field))
+ (yas--update-mirrors snippet))
+ (unless (or (not (eq yas-indent-line 'auto))
+ (memq snippet yas--todo-snippet-indent))
+ (push snippet yas--todo-snippet-indent))))
+ ;; Remember active snippets to use for after the change.
+ (yas--gather-active-snippets overlay beg end nil))
+ (lwarn '(yasnippet zombie) :warning "Killing zombie snippet!")
+ (delete-overlay overlay)))))
+
+(defun yas--do-todo-snippet-indent ()
+ ;; Do pending indentation of snippet fields, called from
+ ;; `yas--post-command-handler'.
+ (when yas--todo-snippet-indent
+ (save-excursion
+ (cl-loop for snippet in yas--todo-snippet-indent
+ do (yas--indent-mirrors-of-snippet
+ snippet (yas--snippet-field-mirrors snippet)))
+ (setq yas--todo-snippet-indent nil))))
+
+(defun yas--auto-fill ()
+ ;; Preserve snippet markers during auto-fill.
+ (let* ((orig-point (point))
+ (end (progn (forward-paragraph) (point)))
+ (beg (progn (backward-paragraph) (point)))
+ (snippets (yas-active-snippets beg end))
+ (remarkers nil)
+ (reoverlays nil))
+ (dolist (snippet snippets)
+ (dolist (m (yas--collect-snippet-markers snippet))
+ (when (and (<= beg m) (<= m end))
+ (push (cons m (yas--snapshot-location m beg end)) remarkers)))
+ (push (yas--snapshot-overlay-location
+ (yas--snippet-control-overlay snippet) beg end)
+ reoverlays))
+ (goto-char orig-point)
+ (let ((yas--inhibit-overlay-hooks t))
+ (if yas--original-auto-fill-function
+ (funcall yas--original-auto-fill-function)
+ ;; Shouldn't happen, gather more info about it (see #873/919).
+ (let ((yas--fill-fun-values `((t ,(default-value 'yas--original-auto-fill-function))))
+ (fill-fun-values `((t ,(default-value 'auto-fill-function))))
+ ;; Listing 2 buffers with the same value is enough
+ (print-length 3))
+ (save-current-buffer
+ (dolist (buf (let ((bufs (buffer-list)))
+ ;; List the current buffer first.
+ (setq bufs (cons (current-buffer)
+ (remq (current-buffer) bufs)))))
+ (set-buffer buf)
+ (let* ((yf-cell (assq yas--original-auto-fill-function
+ yas--fill-fun-values))
+ (af-cell (assq auto-fill-function fill-fun-values)))
+ (when (local-variable-p 'yas--original-auto-fill-function)
+ (if yf-cell (setcdr yf-cell (cons buf (cdr yf-cell)))
+ (push (list yas--original-auto-fill-function buf) yas--fill-fun-values)))
+ (when (local-variable-p 'auto-fill-function)
+ (if af-cell (setcdr af-cell (cons buf (cdr af-cell)))
+ (push (list auto-fill-function buf) fill-fun-values))))))
+ (lwarn '(yasnippet auto-fill bug) :error
+ "`yas--original-auto-fill-function' unexpectedly nil in %S! Disabling auto-fill.
+ %S
+ `auto-fill-function': %S\n%s"
+ (current-buffer) yas--fill-fun-values fill-fun-values
+ (if (fboundp 'backtrace--print-frame)
+ (with-output-to-string
+ (mapc (lambda (frame)
+ (apply #'backtrace--print-frame frame))
+ yas--watch-auto-fill-backtrace))
+ ""))
+ ;; Try to avoid repeated triggering of this bug.
+ (auto-fill-mode -1)
+ ;; Don't pop up more than once in a session (still log though).
+ (defvar warning-suppress-types) ; `warnings' is autoloaded by `lwarn'.
+ (add-to-list 'warning-suppress-types '(yasnippet auto-fill bug)))))
+ (save-excursion
+ (setq end (progn (forward-paragraph) (point)))
+ (setq beg (progn (backward-paragraph) (point))))
+ (save-excursion
+ (save-restriction
+ (narrow-to-region beg end)
+ (dolist (remarker remarkers)
+ (set-marker (car remarker)
+ (yas--goto-saved-location (cdr remarker))))
+ (mapc #'yas--restore-overlay-location reoverlays))
+ (mapc (lambda (snippet)
+ (yas--letenv (yas--snippet-expand-env snippet)
+ (yas--update-mirrors snippet)))
+ snippets))))
+
+
+;;; Apropos protection overlays:
+;;
+;; These exist for nasty users who will try to delete parts of the
+;; snippet outside the active field. Actual protection happens in
+;; `yas--on-protection-overlay-modification'.
+;;
+;; As of github #537 this no longer inhibits the command by issuing an
+;; error: all the snippets at point, including nested snippets, are
+;; automatically commited and the current command can proceed.
+;;
+(defun yas--make-move-field-protection-overlays (snippet field)
+ "Place protection overlays surrounding SNIPPET's FIELD.
+
+Move the overlays, or create them if they do not exit."
+ (let ((start (yas--field-start field))
+ (end (yas--field-end field)))
+ ;; First check if the (1+ end) is contained in the buffer,
+ ;; otherwise we'll have to do a bit of cheating and silently
+ ;; insert a newline. the `(1+ (buffer-size))' should prevent this
+ ;; when using stacked expansion
+ ;;
+ (when (< (buffer-size) end)
+ (save-excursion
+ (let ((yas--inhibit-overlay-hooks t))
+ (goto-char (point-max))
+ (newline))))
+ ;; go on to normal overlay creation/moving
+ ;;
+ (cond ((and yas--field-protection-overlays
+ (cl-every #'overlay-buffer yas--field-protection-overlays))
+ (move-overlay (nth 0 yas--field-protection-overlays)
+ (1- start) start)
+ (move-overlay (nth 1 yas--field-protection-overlays) end (1+ end)))
+ (t
+ (setq yas--field-protection-overlays
+ (list (make-overlay (1- start) start nil t nil)
+ (make-overlay end (1+ end) nil t nil)))
+ (dolist (ov yas--field-protection-overlays)
+ (overlay-put ov 'face 'yas--field-debug-face)
+ (overlay-put ov 'yas--snippet snippet)
+ ;; (overlay-put ov 'evaporate t)
+ (overlay-put ov 'modification-hooks '(yas--on-protection-overlay-modification)))))))
+
+(defun yas--on-protection-overlay-modification (_overlay after? beg end &optional length)
+ "Commit the snippet if the protection overlay is being killed."
+ (unless (or yas--inhibit-overlay-hooks
+ yas-inhibit-overlay-modification-protection
+ (not after?)
+ (= length (- end beg)) ; deletion or insertion
+ (yas--undo-in-progress))
+ (let ((snippets (yas-active-snippets)))
+ (yas--message 2 "Committing snippets. Action would destroy a protection overlay.")
+ (cl-loop for snippet in snippets
+ do (yas--commit-snippet snippet)))))
+
+(add-to-list 'debug-ignored-errors "^Exit the snippet first!$")
+
+
+;;; Snippet expansion and "stacked" expansion:
+;;
+;; Stacked expansion is when you try to expand a snippet when already
+;; inside a snippet expansion.
+;;
+;; The parent snippet does not run its fields modification hooks
+;; (`yas--on-field-overlay-modification' and
+;; `yas--on-protection-overlay-modification') while the child snippet
+;; is active. This means, among other things, that the mirrors of the
+;; parent snippet are not updated, this only happening when one exits
+;; the child snippet.
+;;
+;; Unfortunately, this also puts some ugly (and not fully-tested)
+;; bits of code in `yas-expand-snippet' and
+;; `yas--commit-snippet'. I've tried to mark them with "stacked
+;; expansion:".
+;;
+;; This was thought to be safer in an undo/redo perspective, but
+;; maybe the correct implementation is to make the globals
+;; `yas--active-field-overlay' and `yas--field-protection-overlays' be
+;; snippet-local and be active even while the child snippet is
+;; running. This would mean a lot of overlay modification hooks
+;; running, but if managed correctly (including overlay priorities)
+;; they should account for all situations...
+
+(defun yas-expand-snippet (snippet &optional start end expand-env)
+ "Expand SNIPPET at current point.
+
+Text between START and END will be deleted before inserting
+template. EXPAND-ENV is a list of (SYM VALUE) let-style dynamic
+bindings considered when expanding the snippet. If omitted, use
+SNIPPET's expand-env field.
+
+SNIPPET may be a snippet structure (e.g., as returned by
+`yas-lookup-snippet'), or just a snippet body (which is a string
+for normal snippets, and a list for command snippets)."
+ (cl-assert (and yas-minor-mode
+ (memq 'yas--post-command-handler post-command-hook))
+ nil
+ "[yas] `yas-expand-snippet' needs properly setup `yas-minor-mode'")
+ (run-hooks 'yas-before-expand-snippet-hook)
+
+ (let* ((clear-field
+ (let ((field (and yas--active-field-overlay
+ (overlay-buffer yas--active-field-overlay)
+ (overlay-get yas--active-field-overlay 'yas--field))))
+ (and field (yas--skip-and-clear-field-p
+ field (point) (point) 0)
+ field)))
+ (start (cond (start)
+ ((region-active-p)
+ (region-beginning))
+ (clear-field
+ (yas--field-start clear-field))
+ (t (point))))
+ (end (cond (end)
+ ((region-active-p)
+ (region-end))
+ (clear-field
+ (yas--field-end clear-field))
+ (t (point))))
+ (to-delete (and (> end start)
+ (buffer-substring-no-properties start end)))
+ (yas-selected-text
+ (cond (yas-selected-text)
+ ((and (region-active-p)
+ (not clear-field))
+ to-delete))))
+ (goto-char start)
+ (setq yas--indent-original-column (current-column))
+ ;; Delete the region to delete, this *does* get undo-recorded.
+ (when to-delete
+ (delete-region start end))
+
+ (let ((content (if (yas--template-p snippet)
+ (yas--template-content snippet)
+ snippet)))
+ (when (and (not expand-env) (yas--template-p snippet))
+ (setq expand-env (yas--template-expand-env snippet)))
+ (cond ((listp content)
+ ;; x) This is a snippet-command.
+ (yas--eval-for-effect content))
+ (t
+ ;; x) This is a snippet-snippet :-)
+ (setq yas--start-column (current-column))
+ ;; Stacked expansion: also shoosh the overlay modification hooks.
+ (let ((yas--inhibit-overlay-hooks t))
+ (setq snippet
+ (yas--snippet-create content expand-env start (point))))
+
+ ;; Stacked-expansion: This checks for stacked expansion, save the
+ ;; `yas--previous-active-field' and advance its boundary.
+ (let ((existing-field (and yas--active-field-overlay
+ (overlay-buffer yas--active-field-overlay)
+ (overlay-get yas--active-field-overlay 'yas--field))))
+ (when existing-field
+ (setf (yas--snippet-previous-active-field snippet) existing-field)
+ (yas--advance-end-maybe-previous-fields
+ existing-field (overlay-end yas--active-field-overlay)
+ (cdr yas--active-snippets))))
+
+ ;; Exit the snippet immediately if no fields.
+ (unless (yas--snippet-fields snippet)
+ (yas-exit-snippet snippet))
+
+ ;; Now, schedule a move to the first field.
+ (let ((first-field (car (yas--snippet-fields snippet))))
+ (when first-field
+ (sit-for 0) ;; fix issue 125
+ (yas--letenv (yas--snippet-expand-env snippet)
+ (yas--move-to-field snippet first-field))
+ (when (and (eq (yas--field-number first-field) 0)
+ (> (length (yas--field-text-for-display
+ first-field))
+ 0))
+ ;; Keep region for ${0:exit text}.
+ (setq deactivate-mark nil))))
+ (yas--message 4 "snippet %d expanded." (yas--snippet-id snippet))
+ t)))))
+
+(defun yas--take-care-of-redo (snippet)
+ "Commits SNIPPET, which in turn pushes an undo action for reviving it.
+
+Meant to exit in the `buffer-undo-list'."
+ ;; slightly optimize: this action is only needed for snippets with
+ ;; at least one field
+ (when (yas--snippet-fields snippet)
+ (yas--commit-snippet snippet)))
+
+(defun yas--snippet-revive (beg end snippet)
+ "Revives SNIPPET and creates a control overlay from BEG to END.
+
+BEG and END are, we hope, the original snippets boundaries.
+All the markers/points exiting existing inside SNIPPET should point
+to their correct locations *at the time the snippet is revived*.
+
+After revival, push the `yas--take-care-of-redo' in the
+`buffer-undo-list'"
+ ;; Reconvert all the points to markers
+ (yas--points-to-markers snippet)
+ ;; When at least one editable field existed in the zombie snippet,
+ ;; try to revive the whole thing...
+ (when (yas--maybe-move-to-active-field snippet)
+ (setf (yas--snippet-control-overlay snippet) (yas--make-control-overlay snippet beg end))
+ (overlay-put (yas--snippet-control-overlay snippet) 'yas--snippet snippet)
+ (push snippet yas--active-snippets)
+ (when (listp buffer-undo-list)
+ (push `(apply yas--take-care-of-redo ,snippet)
+ buffer-undo-list))))
+
+(defun yas--snippet-create (content expand-env begin end)
+ "Create a snippet from a template inserted at BEGIN to END.
+
+Returns the newly created snippet."
+ (save-restriction
+ (let ((snippet (yas--make-snippet expand-env)))
+ (yas--letenv expand-env
+ ;; Put a single undo action for the expanded snippet's
+ ;; content.
+ (let ((buffer-undo-list t))
+ (goto-char begin)
+ ;; Call before and after change functions manually,
+ ;; otherwise cc-mode's cache can get messed up. Don't use
+ ;; `inhibit-modification-hooks' for that, that blocks
+ ;; overlay and text property hooks as well! FIXME: Maybe
+ ;; use `combine-change-calls'? (Requires Emacs 27+ though.)
+ (run-hook-with-args 'before-change-functions begin end)
+ (let ((before-change-functions nil)
+ (after-change-functions nil))
+ ;; Some versions of cc-mode (might be the one with Emacs
+ ;; 24.3 only) fail when inserting snippet content in a
+ ;; narrowed buffer, so make sure to insert before
+ ;; narrowing.
+ (insert content)
+ (narrow-to-region begin (point))
+ (goto-char (point-min))
+ (yas--snippet-parse-create snippet))
+ (run-hook-with-args 'after-change-functions
+ (point-min) (point-max)
+ (- end begin)))
+ (when (listp buffer-undo-list)
+ (push (cons (point-min) (point-max))
+ buffer-undo-list))
+
+ ;; Indent, collecting undo information normally.
+ (yas--indent snippet)
+
+ ;; Follow up with `yas--take-care-of-redo' on the newly
+ ;; inserted snippet boundaries.
+ (when (listp buffer-undo-list)
+ (push `(apply yas--take-care-of-redo ,snippet)
+ buffer-undo-list))
+
+ ;; Sort and link each field
+ (yas--snippet-sort-fields snippet)
+
+ ;; Create keymap overlay for snippet
+ (setf (yas--snippet-control-overlay snippet)
+ (yas--make-control-overlay snippet (point-min) (point-max)))
+
+ ;; Move to end
+ (goto-char (point-max))
+
+ (push snippet yas--active-snippets)
+ snippet))))
+
+
+;;; Apropos adjacencies and "fom's":
+;;
+;; Once the $-constructs bits like "$n" and "${:n" are deleted in the
+;; recently expanded snippet, we might actually have many fields,
+;; mirrors (and the snippet exit) in the very same position in the
+;; buffer. Therefore we need to single-link the
+;; fields-or-mirrors-or-exit (which I have abbreviated to "fom")
+;; according to their original positions in the buffer.
+;;
+;; Then we have operation `yas--advance-end-maybe' and
+;; `yas--advance-start-maybe', which conditionally push the starts and
+;; ends of these foms down the chain.
+;;
+;; This allows for like the printf with the magic ",":
+;;
+;; printf ("${1:%s}\\n"${1:$(if (string-match "%" text) "," "\);")} \
+;; $2${1:$(if (string-match "%" text) "\);" "")}$0
+;;
+(defun yas--fom-start (fom)
+ (cond ((yas--field-p fom)
+ (yas--field-start fom))
+ ((yas--mirror-p fom)
+ (yas--mirror-start fom))
+ (t
+ (yas--exit-marker fom))))
+
+(defun yas--fom-end (fom)
+ (cond ((yas--field-p fom)
+ (yas--field-end fom))
+ ((yas--mirror-p fom)
+ (yas--mirror-end fom))
+ (t
+ (yas--exit-marker fom))))
+
+(defun yas--fom-next (fom)
+ (cond ((yas--field-p fom)
+ (yas--field-next fom))
+ ((yas--mirror-p fom)
+ (yas--mirror-next fom))
+ (t
+ (yas--exit-next fom))))
+
+(defun yas--fom-parent-field (fom)
+ (cond ((yas--field-p fom)
+ (yas--field-parent-field fom))
+ ((yas--mirror-p fom)
+ (yas--mirror-parent-field fom))
+ (t
+ nil)))
+
+(defun yas--calculate-adjacencies (snippet)
+ "Calculate adjacencies for fields or mirrors of SNIPPET.
+
+This is according to their relative positions in the buffer, and
+has to be called before the $-constructs are deleted."
+ (let* ((fom-set-next-fom
+ (lambda (fom nextfom)
+ (cond ((yas--field-p fom)
+ (setf (yas--field-next fom) nextfom))
+ ((yas--mirror-p fom)
+ (setf (yas--mirror-next fom) nextfom))
+ (t
+ (setf (yas--exit-next fom) nextfom)))))
+ (compare-fom-begs
+ (lambda (fom1 fom2)
+ (if (= (yas--fom-start fom2) (yas--fom-start fom1))
+ (yas--mirror-p fom2)
+ (>= (yas--fom-start fom2) (yas--fom-start fom1)))))
+ (link-foms fom-set-next-fom))
+ ;; make some yas--field, yas--mirror and yas--exit soup
+ (let ((soup))
+ (when (yas--snippet-exit snippet)
+ (push (yas--snippet-exit snippet) soup))
+ (dolist (field (yas--snippet-fields snippet))
+ (push field soup)
+ (dolist (mirror (yas--field-mirrors field))
+ (push mirror soup)))
+ (setq soup
+ (sort soup compare-fom-begs))
+ (when soup
+ (cl-reduce link-foms soup)))))
+
+(defun yas--calculate-simple-fom-parentage (snippet fom)
+ "Discover if FOM is parented by some field in SNIPPET.
+
+Use the tightest containing field if more than one field contains
+the mirror. Intended to be called *before* the dollar-regions are
+deleted."
+ (let ((min (point-min))
+ (max (point-max)))
+ (dolist (field (remq fom (yas--snippet-fields snippet)))
+ (when (and (<= (yas--field-start field) (yas--fom-start fom))
+ (<= (yas--fom-end fom) (yas--field-end field))
+ (< min (yas--field-start field))
+ (< (yas--field-end field) max))
+ (setq min (yas--field-start field)
+ max (yas--field-end field))
+ (cond ((yas--field-p fom)
+ (setf (yas--field-parent-field fom) field))
+ ((yas--mirror-p fom)
+ (setf (yas--mirror-parent-field fom) field))
+ (t ; it's an exit, so noop
+ nil ))))))
+
+(defun yas--advance-end-maybe (fom newend)
+ "Maybe advance FOM's end to NEWEND if it needs it.
+
+If it does, also:
+
+* call `yas--advance-start-maybe' on FOM's next fom.
+
+* in case FOM is field call `yas--advance-end-maybe' on its parent
+ field
+
+Also, if FOM is an exit-marker, always call
+`yas--advance-start-maybe' on its next fom. This is because
+exit-marker have identical start and end markers."
+ (cond ((and fom (< (yas--fom-end fom) newend))
+ (set-marker (yas--fom-end fom) newend)
+ (yas--advance-start-maybe (yas--fom-next fom) newend)
+ (yas--advance-end-of-parents-maybe (yas--fom-parent-field fom) newend))
+ ((yas--exit-p fom)
+ (yas--advance-start-maybe (yas--fom-next fom) newend))))
+
+(defun yas--advance-end-maybe-previous-fields (field end snippets)
+ "Call `yas--advance-end-maybe' on FIELD, and previous fields on SNIPPETS."
+ (dolist (snippet snippets)
+ (cl-assert (memq field (yas--snippet-fields snippet)))
+ (yas--advance-end-maybe field end)
+ (setq field (yas--snippet-previous-active-field snippet))))
+
+(defun yas--advance-start-maybe (fom newstart)
+ "Maybe advance FOM's start to NEWSTART if it needs it.
+
+If it does, also call `yas--advance-end-maybe' on FOM."
+ (when (and fom (< (yas--fom-start fom) newstart))
+ (set-marker (yas--fom-start fom) newstart)
+ (yas--advance-end-maybe fom newstart)))
+
+(defun yas--advance-end-of-parents-maybe (field newend)
+ "Like `yas--advance-end-maybe' but for parent fields.
+
+Only works for fields and doesn't care about the start of the
+next FOM. Works its way up recursively for parents of parents."
+ (when (and field
+ (< (yas--field-end field) newend))
+ (set-marker (yas--field-end field) newend)
+ (yas--advance-end-of-parents-maybe (yas--field-parent-field field) newend)))
+
+(defvar yas--dollar-regions nil
+ "When expanding the snippet the \"parse-create\" functions add
+cons cells to this var.")
+
+(defvar yas--indent-markers nil
+ "List of markers for manual indentation.")
+
+(defun yas--snippet-parse-create (snippet)
+ "Parse a recently inserted snippet template, creating all
+necessary fields, mirrors and exit points.
+
+Meant to be called in a narrowed buffer, does various passes"
+ (let ((saved-quotes nil)
+ (parse-start (point)))
+ ;; Avoid major-mode's syntax propertizing function, since we
+ ;; change the syntax-table while calling `scan-sexps'.
+ (let ((syntax-propertize-function nil))
+ (setq yas--dollar-regions nil) ; Reset the yas--dollar-regions.
+ (yas--protect-escapes nil '(?`)) ; Protect just the backquotes.
+ (goto-char parse-start)
+ (setq saved-quotes (yas--save-backquotes)) ; `expressions`.
+ (yas--protect-escapes) ; Protect escaped characters.
+ (goto-char parse-start)
+ (yas--indent-parse-create) ; Parse indent markers: `$>'.
+ (goto-char parse-start)
+ (yas--field-parse-create snippet) ; Parse fields with {}.
+ (goto-char parse-start)
+ (yas--simple-fom-create snippet) ; Parse simple mirrors & fields.
+ (goto-char parse-start)
+ (yas--transform-mirror-parse-create snippet) ; Parse mirror transforms.
+ ;; Invalidate any syntax-propertizing done while
+ ;; `syntax-propertize-function' was nil.
+ (syntax-ppss-flush-cache parse-start))
+ ;; Set "next" links of fields & mirrors.
+ (yas--calculate-adjacencies snippet)
+ (yas--save-restriction-and-widen ; Delete $-constructs.
+ (yas--delete-regions yas--dollar-regions))
+ ;; Make sure to do this insertion *after* deleting the dollar
+ ;; regions, otherwise we invalidate the calculated positions of
+ ;; all the fields following $0.
+ (let ((exit (yas--snippet-exit snippet)))
+ (goto-char (if exit (yas--exit-marker exit) (point-max))))
+ (when (eq yas-wrap-around-region 'cua)
+ (setq yas-wrap-around-region ?0))
+ (cond ((and yas-wrap-around-region yas-selected-text)
+ (insert yas-selected-text))
+ ((and (characterp yas-wrap-around-region)
+ (get-register yas-wrap-around-region))
+ (insert (prog1 (get-register yas-wrap-around-region)
+ (set-register yas-wrap-around-region nil)))))
+ (yas--restore-backquotes saved-quotes) ; Restore `expression` values.
+ (goto-char parse-start)
+ (yas--restore-escapes) ; Restore escapes.
+ (yas--update-mirrors snippet) ; Update mirrors for the first time.
+ (goto-char parse-start)))
+
+;; HACK: Some implementations of `indent-line-function' (called via
+;; `indent-according-to-mode') delete text before they insert (like
+;; cc-mode), some make complicated regexp replacements (looking at
+;; you, org-mode). To find place where the marker "should" go after
+;; indentation, we create a regexp based on what the line looks like
+;; before, putting a capture group where the marker is. The regexp
+;; matches any whitespace with [[:space:]]* to allow for the
+;; indentation changing whitespace. Additionally, we try to preserve
+;; the amount of whitespace *following* the marker, because
+;; indentation generally affects whitespace at the beginning, not the
+;; end.
+;;
+;; Two other cases where we apply a similar strategy:
+;;
+;; 1. Handling `auto-fill-mode', in this case we need to use the
+;; current paragraph instead of line.
+;;
+;; 2. Moving snippets from an `org-src' temp buffer into the main org
+;; buffer, in this case we need to count the relative line number
+;; (because org may add indentation on each line making character
+;; positions unreliable).
+;;
+;; Data formats:
+;; (LOCATION) = (REGEXP WS-COUNT)
+;; MARKER -> (MARKER . (LOCATION))
+;; OVERLAY -> (OVERLAY LOCATION-BEG LOCATION-END)
+;;
+;; For `org-src' temp buffer, add a line number to format:
+;; (LINE-LOCATION) = (LINE . (LOCATION))
+;; MARKER@LINE -> (MARKER . (LINE-LOCATION))
+;; OVERLAY@LINE -> (OVERLAY LINE-LOCATION-BEG LINE-LOCATION-END)
+;;
+;; This is all best-effort heuristic stuff, but it should cover 99% of
+;; use-cases.
+
+(defun yas--snapshot-location (position &optional beg end)
+ "Returns info for restoring POSITIONS's location after indent.
+The returned value is a list of the form (REGEXP WS-COUNT).
+POSITION may be either a marker or just a buffer position. The
+REGEXP matches text between BEG..END which default to the current
+line if omitted."
+ (goto-char position)
+ (unless beg (setq beg (line-beginning-position)))
+ (unless end (setq end (line-end-position)))
+ (let ((before (split-string (buffer-substring-no-properties beg position)
+ "[[:space:]\n]+" t))
+ (after (split-string (buffer-substring-no-properties position end)
+ "[[:space:]\n]+" t)))
+ (list (concat "[[:space:]\n]*"
+ (mapconcat (lambda (s)
+ (if (eq s position) "\\(\\)"
+ (regexp-quote s)))
+ (nconc before (list position) after)
+ "[[:space:]\n]*"))
+ (progn (skip-chars-forward "[:space:]\n" end)
+ (- (point) position)))))
+
+(defun yas--snapshot-line-location (position &optional beg end)
+ "Like `yas--snapshot-location', but return also line number.
+Returned format is (LINE REGEXP WS-COUNT)."
+ (goto-char position)
+ (cons (count-lines (point-min) (line-beginning-position))
+ (yas--snapshot-location position beg end)))
+
+(defun yas--snapshot-overlay-location (overlay beg end)
+ "Like `yas--snapshot-location' for overlays.
+The returned format is (OVERLAY (RE WS) (RE WS)). Either of
+the (RE WS) lists may be nil if the start or end, respectively,
+of the overlay is outside the range BEG .. END."
+ (let ((obeg (overlay-start overlay))
+ (oend (overlay-end overlay)))
+ (list overlay
+ (when (and (<= beg obeg) (< obeg end))
+ (yas--snapshot-location obeg beg end))
+ (when (and (<= beg oend) (< oend end))
+ (yas--snapshot-location oend beg end)))))
+
+(defun yas--snapshot-overlay-line-location (overlay)
+ "Return info for restoring OVERLAY's line based location.
+The returned format is (OVERLAY (LINE RE WS) (LINE RE WS))."
+ (list overlay
+ (yas--snapshot-line-location (overlay-start overlay))
+ (yas--snapshot-line-location (overlay-end overlay))))
+
+(defun yas--goto-saved-location (re-count)
+ "Move to and return point saved by `yas--snapshot-location'.
+Buffer must be narrowed to BEG..END used to create the snapshot info."
+ (let ((regexp (pop re-count))
+ (ws-count (pop re-count)))
+ (goto-char (point-min))
+ (if (not (looking-at regexp))
+ (lwarn '(yasnippet re-marker) :warning
+ "Couldn't find: %S" regexp)
+ (goto-char (match-beginning 1))
+ (skip-chars-forward "[:space:]\n")
+ (skip-chars-backward "[:space:]\n" (- (point) ws-count)))
+ (point)))
+
+(defun yas--restore-overlay-location (ov-locations)
+ "Restores marker based on info from `yas--snapshot-overlay-location'.
+Buffer must be narrowed to BEG..END used to create the snapshot info."
+ (cl-destructuring-bind (overlay loc-beg loc-end) ov-locations
+ (move-overlay overlay
+ (if (not loc-beg) (overlay-start overlay)
+ (yas--goto-saved-location loc-beg))
+ (if (not loc-end) (overlay-end overlay)
+ (yas--goto-saved-location loc-end)))))
+
+(defun yas--goto-saved-line-location (base-pos l-re-count)
+ "Move to and return point saved by `yas--snapshot-line-location'.
+Additionally requires BASE-POS to tell where the line numbers are
+relative to."
+ (goto-char base-pos)
+ (forward-line (pop l-re-count))
+ (save-restriction
+ (narrow-to-region (line-beginning-position)
+ (line-end-position))
+ (yas--goto-saved-location l-re-count)))
+
+(defun yas--restore-overlay-line-location (base-pos ov-locations)
+ "Restores marker based on info from `yas--snapshot-overlay-line-location'."
+ (cl-destructuring-bind (overlay beg-l-r-w end-l-r-w)
+ ov-locations
+ (move-overlay overlay
+ (yas--goto-saved-line-location base-pos beg-l-r-w)
+ (yas--goto-saved-line-location base-pos end-l-r-w))))
+
+(defun yas--indent-region (from to snippet)
+ "Indent the lines between FROM and TO with `indent-according-to-mode'.
+The SNIPPET's markers are preserved."
+ (save-excursion
+ (yas--save-restriction-and-widen
+ (let* ((snippet-markers (yas--collect-snippet-markers snippet))
+ (to (set-marker (make-marker) to)))
+ (goto-char from)
+ (cl-loop for bol = (line-beginning-position)
+ for eol = (line-end-position)
+ if (or yas-also-indent-empty-lines
+ (/= bol eol))
+ do
+ ;; Indent each non-empty line.
+ (let ((remarkers nil))
+ (dolist (m snippet-markers)
+ (when (and (<= bol m) (<= m eol))
+ (push (cons m (yas--snapshot-location m bol eol))
+ remarkers)))
+ (unwind-protect
+ (progn (back-to-indentation)
+ (indent-according-to-mode))
+ (save-restriction
+ (narrow-to-region bol (line-end-position))
+ (dolist (remarker remarkers)
+ (set-marker (car remarker)
+ (yas--goto-saved-location (cdr remarker)))))))
+ while (and (zerop (forward-line 1))
+ (< (point) to)))))))
+
+(defvar yas--indent-original-column nil)
+(defun yas--indent (snippet)
+ ;; Indent lines that had indent markers (`$>') on them.
+ (save-excursion
+ (dolist (marker yas--indent-markers)
+ (unless (eq yas-indent-line 'auto)
+ (goto-char marker)
+ (yas--indent-region (line-beginning-position)
+ (line-end-position)
+ snippet))
+ ;; Finished with this marker.
+ (set-marker marker nil))
+ (setq yas--indent-markers nil))
+ ;; Now do stuff for `fixed' and `auto'.
+ (save-excursion
+ ;; We need to be at end of line, so that `forward-line' will only
+ ;; report 0 if it actually moves over a newline.
+ (end-of-line)
+ (cond ((eq yas-indent-line 'fixed)
+ (when (= (forward-line 1) 0)
+ (let ((indent-line-function
+ (lambda ()
+ ;; We need to be at beginning of line in order to
+ ;; indent existing whitespace correctly.
+ (beginning-of-line)
+ (indent-to-column yas--indent-original-column))))
+ (yas--indent-region (line-beginning-position)
+ (point-max)
+ snippet))))
+ ((eq yas-indent-line 'auto)
+ (when (or yas-also-auto-indent-first-line
+ (= (forward-line 1) 0))
+ (yas--indent-region (line-beginning-position)
+ (point-max)
+ snippet))))))
+
+(defun yas--collect-snippet-markers (snippet)
+ "Make a list of all the markers used by SNIPPET."
+ (let (markers)
+ (yas--snippet-map-markers (lambda (m) (push m markers) m) snippet)
+ markers))
+
+(defun yas--escape-string (escaped)
+ (concat "YASESCAPE" (format "%d" escaped) "PROTECTGUARD"))
+
+(defun yas--protect-escapes (&optional text escaped)
+ "Protect all escaped characters with their numeric ASCII value.
+
+With optional string TEXT do it in string instead of buffer."
+ (let ((changed-text text)
+ (text-provided-p text))
+ (mapc #'(lambda (escaped)
+ (setq changed-text
+ (yas--replace-all (concat "\\" (char-to-string escaped))
+ (yas--escape-string escaped)
+ (when text-provided-p changed-text))))
+ (or escaped yas--escaped-characters))
+ changed-text))
+
+(defun yas--restore-escapes (&optional text escaped)
+ "Restore all escaped characters from their numeric ASCII value.
+
+With optional string TEXT do it in string instead of the buffer."
+ (let ((changed-text text)
+ (text-provided-p text))
+ (mapc #'(lambda (escaped)
+ (setq changed-text
+ (yas--replace-all (yas--escape-string escaped)
+ (char-to-string escaped)
+ (when text-provided-p changed-text))))
+ (or escaped yas--escaped-characters))
+ changed-text))
+
+(defun yas--save-backquotes ()
+ "Save all \"\\=`(lisp-expression)\\=`\"-style expressions.
+Return a list of (MARKER . STRING) entires for each backquoted
+Lisp expression."
+ (let* ((saved-quotes nil)
+ (yas--snippet-buffer (current-buffer))
+ (yas--change-detected nil)
+ (detect-change (lambda (_beg _end)
+ (when (eq (current-buffer) yas--snippet-buffer)
+ (setq yas--change-detected t)))))
+ (while (re-search-forward yas--backquote-lisp-expression-regexp nil t)
+ (let ((current-string (match-string-no-properties 1)) transformed)
+ (yas--save-restriction-and-widen
+ (delete-region (match-beginning 0) (match-end 0)))
+ (let ((before-change-functions
+ (cons detect-change before-change-functions)))
+ (setq transformed (yas--eval-for-string (yas--read-lisp
+ (yas--restore-escapes
+ current-string '(?`))))))
+ (goto-char (match-beginning 0))
+ (when transformed
+ (let ((marker (make-marker)))
+ (yas--save-restriction-and-widen
+ (insert "Y") ;; quite horrendous, I love it :)
+ (set-marker marker (point))
+ (insert "Y"))
+ (push (cons marker transformed) saved-quotes)))))
+ (when yas--change-detected
+ (lwarn '(yasnippet backquote-change) :warning
+ "`%s' modified buffer in a backquote expression.
+ To hide this warning, add (yasnippet backquote-change) to `warning-suppress-types'."
+ (if yas--current-template
+ (yas--template-name yas--current-template)
+ "Snippet")))
+ saved-quotes))
+
+(defun yas--restore-backquotes (saved-quotes)
+ "Replace markers in SAVED-QUOTES with their values.
+SAVED-QUOTES is the in format returned by `yas--save-backquotes'."
+ (cl-loop for (marker . string) in saved-quotes do
+ (save-excursion
+ (goto-char marker)
+ (yas--save-restriction-and-widen
+ (delete-char -1)
+ (insert string)
+ (delete-char 1))
+ (set-marker marker nil))))
+
+(defun yas--scan-sexps (from count)
+ (ignore-errors
+ (save-match-data ; `scan-sexps' may modify match data.
+ ;; Parse using the syntax table corresponding to the yasnippet syntax.
+ (with-syntax-table (standard-syntax-table)
+ ;; And ignore syntax-table properties that may have been placed by the
+ ;; major mode since these aren't related to the yasnippet syntax.
+ (let ((parse-sexp-lookup-properties nil))
+ (scan-sexps from count))))))
+
+(defun yas--make-marker (pos)
+ "Create a marker at POS with nil `marker-insertion-type'."
+ (let ((marker (set-marker (make-marker) pos)))
+ (set-marker-insertion-type marker nil)
+ marker))
+
+(defun yas--indent-parse-create ()
+ "Parse the \"$>\" indentation markers just inserted."
+ (setq yas--indent-markers ())
+ (while (search-forward "$>" nil t)
+ (delete-region (match-beginning 0) (match-end 0))
+ ;; Mark the beginning of the line.
+ (push (yas--make-marker (line-beginning-position))
+ yas--indent-markers))
+ (setq yas--indent-markers (nreverse yas--indent-markers)))
+
+(defun yas--scan-for-field-end ()
+ (while (progn (re-search-forward "\\${\\|}")
+ (when (eq (char-before) ?\{)
+ ;; Nested field.
+ (yas--scan-for-field-end))))
+ (point))
+
+(defun yas--field-parse-create (snippet &optional parent-field)
+ "Parse most field expressions in SNIPPET, except for the simple one \"$n\".
+
+The following count as a field:
+
+* \"${n: text}\", for a numbered field with default text, as long as N is not 0;
+
+* \"${n: text$(expression)}, the same with a Lisp expression;
+ this is caught with the curiously named `yas--multi-dollar-lisp-expression-regexp'
+
+* the same as above but unnumbered, (no N:) and number is calculated automatically.
+
+When multiple expressions are found, only the last one counts."
+ ;;
+ (save-excursion
+ (while (re-search-forward yas--field-regexp nil t)
+ (let* ((brace-scan (save-match-data
+ (goto-char (match-beginning 2))
+ (yas--scan-for-field-end)))
+ ;; if the `brace-scan' didn't reach a brace, we have a
+ ;; snippet with invalid escaping, probably a closing
+ ;; brace escaped with two backslashes (github#979). But
+ ;; be lenient, because we can.
+ (real-match-end-0 (if (eq ?} (char-before brace-scan))
+ brace-scan
+ (point)))
+ (number (and (match-string-no-properties 1)
+ (string-to-number (match-string-no-properties 1))))
+ (brand-new-field (and real-match-end-0
+ ;; break if on "$(" immediately
+ ;; after the ":", this will be
+ ;; caught as a mirror with
+ ;; transform later.
+ (not (string-match-p "\\`\\$[ \t\n]*("
+ (match-string-no-properties 2)))
+ ;; allow ${0: some exit text}
+ ;; (not (and number (zerop number)))
+ (yas--make-field number
+ (yas--make-marker (match-beginning 2))
+ (yas--make-marker (1- real-match-end-0))
+ parent-field))))
+ (when brand-new-field
+ (goto-char real-match-end-0)
+ (push (cons (1- real-match-end-0) real-match-end-0)
+ yas--dollar-regions)
+ (push (cons (match-beginning 0) (match-beginning 2))
+ yas--dollar-regions)
+ (push brand-new-field (yas--snippet-fields snippet))
+ (save-excursion
+ (save-restriction
+ (narrow-to-region (yas--field-start brand-new-field) (yas--field-end brand-new-field))
+ (goto-char (point-min))
+ (yas--field-parse-create snippet brand-new-field)))))))
+ ;; if we entered from a parent field, now search for the
+ ;; `yas--multi-dollar-lisp-expression-regexp'. This is used for
+ ;; primary field transformations
+ ;;
+ (when parent-field
+ (save-excursion
+ (while (re-search-forward yas--multi-dollar-lisp-expression-regexp nil t)
+ (let* ((real-match-end-1 (yas--scan-sexps (match-beginning 1) 1)))
+ ;; commit the primary field transformation if:
+ ;;
+ ;; 1. we don't find it in yas--dollar-regions (a subnested
+ ;; field) might have already caught it.
+ ;;
+ ;; 2. we really make sure we have either two '$' or some
+ ;; text and a '$' after the colon ':'. This is a FIXME: work
+ ;; my regular expressions and end these ugly hacks.
+ ;;
+ (when (and real-match-end-1
+ (not (member (cons (match-beginning 0)
+ real-match-end-1)
+ yas--dollar-regions))
+ (not (eq ?:
+ (char-before (1- (match-beginning 1))))))
+ (let ((lisp-expression-string (buffer-substring-no-properties (match-beginning 1)
+ real-match-end-1)))
+ (setf (yas--field-transform parent-field)
+ (yas--read-lisp (yas--restore-escapes lisp-expression-string))))
+ (push (cons (match-beginning 0) real-match-end-1)
+ yas--dollar-regions)))))))
+
+(defun yas--transform-mirror-parse-create (snippet)
+ "Parse the \"${n:$(lisp-expression)}\" mirror transformations in SNIPPET."
+ (while (re-search-forward yas--transform-mirror-regexp nil t)
+ (let* ((real-match-end-0 (yas--scan-sexps (1+ (match-beginning 0)) 1))
+ (number (string-to-number (match-string-no-properties 1)))
+ (field (and number
+ (not (zerop number))
+ (yas--snippet-find-field snippet number)))
+ (brand-new-mirror
+ (and real-match-end-0
+ field
+ (yas--make-mirror (yas--make-marker (match-beginning 0))
+ (yas--make-marker (match-beginning 0))
+ (yas--read-lisp
+ (yas--restore-escapes
+ (buffer-substring-no-properties (match-beginning 2)
+ (1- real-match-end-0))))))))
+ (when brand-new-mirror
+ (push brand-new-mirror
+ (yas--field-mirrors field))
+ (yas--calculate-simple-fom-parentage snippet brand-new-mirror)
+ (push (cons (match-beginning 0) real-match-end-0) yas--dollar-regions)))))
+
+(defun yas--simple-fom-create (snippet)
+ "Parse the simple \"$n\" fields/mirrors/exitmarkers in SNIPPET."
+ (while (re-search-forward yas--simple-mirror-regexp nil t)
+ (let ((number (string-to-number (match-string-no-properties 1))))
+ (cond ((zerop number)
+ (setf (yas--snippet-exit snippet)
+ (yas--make-exit (yas--make-marker (match-end 0))))
+ (push (cons (match-beginning 0) (yas--exit-marker (yas--snippet-exit snippet)))
+ yas--dollar-regions))
+ (t
+ (let ((field (yas--snippet-find-field snippet number))
+ (fom))
+ (if field
+ (push
+ (setq fom (yas--make-mirror
+ (yas--make-marker (match-beginning 0))
+ (yas--make-marker (match-beginning 0))
+ nil))
+ (yas--field-mirrors field))
+ (push
+ (setq fom (yas--make-field number
+ (yas--make-marker (match-beginning 0))
+ (yas--make-marker (match-beginning 0))
+ nil))
+ (yas--snippet-fields snippet)))
+ (yas--calculate-simple-fom-parentage snippet fom))
+ (push (cons (match-beginning 0) (match-end 0))
+ yas--dollar-regions))))))
+
+(defun yas--delete-regions (regions)
+ "Sort disjuct REGIONS by start point, then delete from the back."
+ (mapc #'(lambda (reg)
+ (delete-region (car reg) (cdr reg)))
+ (sort regions
+ #'(lambda (r1 r2)
+ (>= (car r1) (car r2))))))
+
+(defun yas--calculate-mirror-depth (mirror &optional traversed)
+ (let* ((parent (yas--mirror-parent-field mirror))
+ (parents-mirrors (and parent
+ (yas--field-mirrors parent))))
+ (or (yas--mirror-depth mirror)
+ (setf (yas--mirror-depth mirror)
+ (cond ((memq mirror traversed) 0)
+ ((and parent parents-mirrors)
+ (1+ (cl-reduce
+ #'max parents-mirrors
+ :key (lambda (m)
+ (yas--calculate-mirror-depth
+ m (cons mirror traversed))))))
+ (parent 1)
+ (t 0))))))
+
+(defun yas--snippet-field-mirrors (snippet)
+ ;; Make a list of (FIELD . MIRROR).
+ (cl-sort
+ (cl-mapcan (lambda (field)
+ (mapcar (lambda (mirror)
+ (cons field mirror))
+ (yas--field-mirrors field)))
+ (yas--snippet-fields snippet))
+ ;; Then sort this list so that entries with mirrors with
+ ;; parent fields appear before. This was important for
+ ;; fixing #290, and also handles the case where a mirror in
+ ;; a field causes another mirror to need reupdating.
+ #'> :key (lambda (fm) (yas--calculate-mirror-depth (cdr fm)))))
+
+(defun yas--indent-mirrors-of-snippet (snippet &optional f-ms)
+ ;; Indent mirrors of SNIPPET. F-MS is the return value of
+ ;; (yas--snippet-field-mirrors SNIPPET).
+ (when (eq yas-indent-line 'auto)
+ (let ((yas--inhibit-overlay-hooks t))
+ (cl-loop for (beg . end) in
+ (cl-sort (mapcar (lambda (f-m)
+ (let ((mirror (cdr f-m)))
+ (cons (yas--mirror-start mirror)
+ (yas--mirror-end mirror))))
+ (or f-ms
+ (yas--snippet-field-mirrors snippet)))
+ #'< :key #'car)
+ do (yas--indent-region beg end snippet)))))
+
+(defun yas--update-mirrors (snippet)
+ "Update all the mirrors of SNIPPET."
+ (yas--save-restriction-and-widen
+ (save-excursion
+ (let ((f-ms (yas--snippet-field-mirrors snippet)))
+ (cl-loop
+ for (field . mirror) in f-ms
+ ;; Before updating a mirror with a parent-field, maybe advance
+ ;; its start (#290).
+ do (let ((parent-field (yas--mirror-parent-field mirror)))
+ (when parent-field
+ (yas--advance-start-maybe mirror (yas--fom-start parent-field))))
+ ;; Update this mirror.
+ do (yas--mirror-update-display mirror field)
+ ;; `yas--place-overlays' is needed since the active field and
+ ;; protected overlays might have been changed because of insertions
+ ;; in `yas--mirror-update-display'.
+ do (let ((active-field (yas--snippet-active-field snippet)))
+ (when active-field (yas--place-overlays snippet active-field))))
+ ;; Delay indenting until we're done all mirrors. We must do
+ ;; this to avoid losing whitespace between fields that are
+ ;; still empty (i.e., they will be non-empty after updating).
+ (yas--indent-mirrors-of-snippet snippet f-ms)))))
+
+(defun yas--mirror-update-display (mirror field)
+ "Update MIRROR according to FIELD (and mirror transform)."
+
+ (let* ((mirror-parent-field (yas--mirror-parent-field mirror))
+ (reflection (and (not (and mirror-parent-field
+ (yas--field-modified-p mirror-parent-field)))
+ (or (yas--apply-transform mirror field 'empty-on-nil)
+ (yas--field-text-for-display field)))))
+ (when (and reflection
+ (not (string= reflection (buffer-substring-no-properties (yas--mirror-start mirror)
+ (yas--mirror-end mirror)))))
+ (goto-char (yas--mirror-start mirror))
+ (let ((yas--inhibit-overlay-hooks t))
+ (insert reflection))
+ (if (> (yas--mirror-end mirror) (point))
+ (delete-region (point) (yas--mirror-end mirror))
+ (set-marker (yas--mirror-end mirror) (point))
+ (yas--advance-start-maybe (yas--mirror-next mirror) (point))
+ ;; super-special advance
+ (yas--advance-end-of-parents-maybe mirror-parent-field (point))))))
+
+(defun yas--field-update-display (field)
+ "Much like `yas--mirror-update-display', but for fields."
+ (when (yas--field-transform field)
+ (let ((transformed (and (not (eq (yas--field-number field) 0))
+ (yas--apply-transform field field))))
+ (when (and transformed
+ (not (string= transformed (buffer-substring-no-properties (yas--field-start field)
+ (yas--field-end field)))))
+ (setf (yas--field-modified-p field) t)
+ (goto-char (yas--field-start field))
+ (let ((yas--inhibit-overlay-hooks t))
+ (insert transformed)
+ (if (> (yas--field-end field) (point))
+ (delete-region (point) (yas--field-end field))
+ (set-marker (yas--field-end field) (point))
+ (yas--advance-start-maybe (yas--field-next field) (point)))
+ t)))))
+
+
+;;; Post-command hook:
+;;
+(defun yas--post-command-handler ()
+ "Handles various yasnippet conditions after each command."
+ (when (and yas--watch-auto-fill-backtrace
+ (fboundp 'backtrace--print-frame)
+ (null yas--original-auto-fill-function)
+ (eq auto-fill-function 'yas--auto-fill))
+ (lwarn '(yasnippet auto-fill bug) :error
+ "`yas--original-auto-fill-function' unexpectedly nil! Please report this backtrace\n%S"
+ (with-output-to-string
+ (mapc #'backtrace--print-frame
+ yas--watch-auto-fill-backtrace)))
+ ;; Don't pop up more than once in a session (still log though).
+ (defvar warning-suppress-types) ; `warnings' is autoloaded by `lwarn'.
+ (add-to-list 'warning-suppress-types '(yasnippet auto-fill bug)))
+ (yas--do-todo-snippet-indent)
+ (condition-case err
+ (progn (yas--finish-moving-snippets)
+ (cond ((eq 'undo this-command)
+ ;;
+ ;; After undo revival the correct field is sometimes not
+ ;; restored correctly, this condition handles that
+ ;;
+ (let* ((snippet (car (yas-active-snippets)))
+ (target-field
+ (and snippet
+ (cl-find-if-not
+ (lambda (field)
+ (yas--field-probably-deleted-p snippet field))
+ (remq nil
+ (cons (yas--snippet-active-field snippet)
+ (yas--snippet-fields snippet)))))))
+ (when target-field
+ (yas--move-to-field snippet target-field))))
+ ((not (yas--undo-in-progress))
+ ;; When not in an undo, check if we must commit the snippet
+ ;; (user exited it).
+ (yas--check-commit-snippet))))
+ ((debug error) (signal (car err) (cdr err)))))
+
+;;; Fancy docs:
+;;
+;; The docstrings for some functions are generated dynamically
+;; depending on the context.
+;;
+(put 'yas-expand 'function-documentation
+ '(yas--expand-from-trigger-key-doc t))
+(defun yas--expand-from-trigger-key-doc (context)
+ "A doc synthesizer for `yas--expand-from-trigger-key-doc'."
+ (let* ((yas-fallback-behavior (and context yas-fallback-behavior))
+ (fallback-description
+ (cond ((eq yas-fallback-behavior 'call-other-command)
+ (let* ((fallback (yas--keybinding-beyond-yasnippet)))
+ (or (and fallback
+ (format "call command `%s'."
+ (pp-to-string fallback)))
+ "do nothing (`yas-expand' doesn't override\nanything).")))
+ ((eq yas-fallback-behavior 'return-nil)
+ "do nothing.")
+ (t "defer to `yas-fallback-behavior' (which see)."))))
+ (concat "Expand a snippet before point. If no snippet
+expansion is possible, "
+ fallback-description
+ "\n\nOptional argument FIELD is for non-interactive use and is an
+object satisfying `yas--field-p' to restrict the expansion to.")))
+
+(put 'yas-expand-from-keymap 'function-documentation
+ '(yas--expand-from-keymap-doc t))
+(defun yas--expand-from-keymap-doc (context)
+ "A doc synthesizer for `yas--expand-from-keymap-doc'."
+ (add-hook 'temp-buffer-show-hook #'yas--snippet-description-finish-runonce)
+ (concat "Expand/run snippets from keymaps, possibly falling back to original binding.\n"
+ (when (and context (eq this-command 'describe-key))
+ (let* ((vec (this-single-command-keys))
+ (templates (cl-mapcan (lambda (table)
+ (yas--fetch table vec))
+ (yas--get-snippet-tables)))
+ (yas--direct-keymaps nil)
+ (fallback (key-binding vec)))
+ (concat "In this case, "
+ (when templates
+ (concat "these snippets are bound to this key:\n"
+ (yas--template-pretty-list templates)
+ "\n\nIf none of these expands, "))
+ (or (and fallback
+ (format "fallback `%s' will be called." (pp-to-string fallback)))
+ "no fallback keybinding is called."))))))
+
+(defun yas--template-pretty-list (templates)
+ (let ((acc)
+ (yas-buffer-local-condition 'always))
+ (dolist (plate templates)
+ (setq acc (concat acc "\n*) "
+ (propertize (concat "\\\\snippet `" (car plate) "'")
+ 'yasnippet (cdr plate)))))
+ acc))
+
+(define-button-type 'help-snippet-def
+ :supertype 'help-xref
+ 'help-function (lambda (template) (yas--visit-snippet-file-1 template))
+ 'help-echo (purecopy "mouse-2, RET: find snippets's definition"))
+
+(defun yas--snippet-description-finish-runonce ()
+ "Final adjustments for the help buffer when snippets are concerned."
+ (yas--create-snippet-xrefs)
+ (remove-hook 'temp-buffer-show-hook
+ #'yas--snippet-description-finish-runonce))
+
+(defun yas--create-snippet-xrefs ()
+ (save-excursion
+ (goto-char (point-min))
+ (while (search-forward-regexp "\\\\\\\\snippet[ \s\t]+`\\([^']+\\)'" nil t)
+ (let ((template (get-text-property (match-beginning 1)
+ 'yasnippet)))
+ (when template
+ (help-xref-button 1 'help-snippet-def template)
+ (delete-region (match-end 1) (match-end 0))
+ (delete-region (match-beginning 0) (match-beginning 1)))))))
+
+;;; Eldoc configuration.
+(eldoc-add-command 'yas-next-field-or-maybe-expand
+ 'yas-next-field 'yas-prev-field
+ 'yas-expand 'yas-expand-from-keymap
+ 'yas-expand-from-trigger-key)
+
+;;; Utils
+
+(defvar yas-verbosity 3
+ "Log level for `yas--message' 4 means trace most anything, 0 means nothing.")
+
+(defun yas--message (level message &rest args)
+ "When LEVEL is at or below `yas-verbosity', log MESSAGE and ARGS."
+ (when (>= yas-verbosity level)
+ (message "%s" (apply #'yas--format message args))))
+
+(defun yas--warning (format-control &rest format-args)
+ (let ((msg (apply #'format format-control format-args)))
+ (display-warning 'yasnippet msg :warning)
+ (yas--message 1 msg)))
+
+(defun yas--format (format-control &rest format-args)
+ (apply #'format (concat "[yas] " format-control) format-args))
+
+
+;;; Unloading
+
+(defvar unload-function-defs-list) ; loadhist.el
+
+(defun yasnippet-unload-function ()
+ "Disable minor modes when calling `unload-feature'."
+ ;; Disable `yas-minor-mode' everywhere it's enabled.
+ (yas-global-mode -1)
+ (save-current-buffer
+ (dolist (buffer (buffer-list))
+ (set-buffer buffer)
+ (when yas-minor-mode
+ (yas-minor-mode -1))))
+ ;; Remove symbol properties of all our functions, this avoids
+ ;; Bug#25088 in Emacs 25.1, where the compiler macro on
+ ;; `cl-defstruct' created functions hang around in the symbol plist
+ ;; and cause errors when loading again (we don't *need* to clean
+ ;; *all* symbol plists, but it's easier than being precise).
+ (dolist (def unload-function-defs-list)
+ (when (eq (car-safe def) 'defun)
+ (setplist (cdr def) nil)))
+ ;; Return nil so that `unload-feature' will take of undefining
+ ;; functions, and changing any buffers using `snippet-mode'.
+ nil)
+
+
+;;; Backward compatibility to yasnippet <= 0.7
+
+(defun yas-initialize ()
+ "For backward compatibility, enable `yas-minor-mode' globally."
+ (declare (obsolete "Use (yas-global-mode 1) instead." "0.8"))
+ (yas-global-mode 1))
+
+(defvar yas--backported-syms '(;; `defcustom's
+ ;;
+ yas-snippet-dirs
+ yas-prompt-functions
+ yas-indent-line
+ yas-also-auto-indent-first-line
+ yas-snippet-revival
+ yas-triggers-in-field
+ yas-fallback-behavior
+ yas-choose-keys-first
+ yas-choose-tables-first
+ yas-use-menu
+ yas-trigger-symbol
+ yas-wrap-around-region
+ yas-good-grace
+ yas-visit-from-menu
+ yas-expand-only-for-last-commands
+ yas-field-highlight-face
+
+ ;; these vars can be customized as well
+ ;;
+ yas-keymap
+ yas-verbosity
+ yas-extra-modes
+ yas-key-syntaxes
+ yas-after-exit-snippet-hook
+ yas-before-expand-snippet-hook
+ yas-buffer-local-condition
+ yas-dont-activate
+
+ ;; prompting functions
+ ;;
+ yas-x-prompt
+ yas-ido-prompt
+ yas-no-prompt
+ yas-completing-prompt
+ yas-dropdown-prompt
+
+ ;; interactive functions
+ ;;
+ yas-expand
+ yas-minor-mode
+ yas-global-mode
+ yas-direct-keymaps-reload
+ yas-minor-mode-on
+ yas-load-directory
+ yas-reload-all
+ yas-compile-directory
+ yas-recompile-all
+ yas-about
+ yas-expand-from-trigger-key
+ yas-expand-from-keymap
+ yas-insert-snippet
+ yas-visit-snippet-file
+ yas-new-snippet
+ yas-load-snippet-buffer
+ yas-tryout-snippet
+ yas-describe-tables
+ yas-next-field-or-maybe-expand
+ yas-next-field
+ yas-prev-field
+ yas-abort-snippet
+ yas-exit-snippet
+ yas-exit-all-snippets
+ yas-skip-and-clear-or-delete-char
+ yas-initialize
+
+ ;; symbols that I "exported" for use
+ ;; in snippets and hookage
+ ;;
+ yas-expand-snippet
+ yas-define-snippets
+ yas-define-menu
+ yas-snippet-beg
+ yas-snippet-end
+ yas-modified-p
+ yas-moving-away-p
+ yas-substr
+ yas-choose-value
+ yas-key-to-value
+ yas-throw
+ yas-verify-value
+ yas-field-value
+ yas-text
+ yas-selected-text
+ yas-default-from-field
+ yas-inside-string
+ yas-unimplemented
+ yas-define-condition-cache
+ yas-hippie-try-expand
+
+ ;; debug definitions
+ ;; yas-debug-snippet-vars
+ ;; yas-exterminate-package
+ ;; yas-debug-test
+
+ ;; testing definitions
+ ;; yas-should-expand
+ ;; yas-should-not-expand
+ ;; yas-mock-insert
+ ;; yas-make-file-or-dirs
+ ;; yas-variables
+ ;; yas-saving-variables
+ ;; yas-call-with-snippet-dirs
+ ;; yas-with-snippet-dirs
+)
+ "Backported yasnippet symbols.
+
+They are mapped to \"yas/*\" variants.")
+
+(when yas-alias-to-yas/prefix-p
+ (dolist (sym yas--backported-syms)
+ (let ((backported (intern (replace-regexp-in-string "\\`yas-" "yas/" (symbol-name sym)))))
+ (when (boundp sym)
+ (make-obsolete-variable backported sym "yasnippet 0.8")
+ (defvaralias backported sym))
+ (when (fboundp sym)
+ (make-obsolete backported sym "yasnippet 0.8")
+ (defalias backported sym))))
+ (make-obsolete 'yas/root-directory 'yas-snippet-dirs "yasnippet 0.8")
+ (defvaralias 'yas/root-directory 'yas-snippet-dirs))
+
+(defvar yas--exported-syms
+ (let (exported)
+ (mapatoms (lambda (atom)
+ (if (and (or (and (boundp atom)
+ (not (get atom 'byte-obsolete-variable)))
+ (and (fboundp atom)
+ (not (get atom 'byte-obsolete-info))))
+ (string-match-p "\\`yas-[^-]" (symbol-name atom)))
+ (push atom exported))))
+ exported)
+ "Exported yasnippet symbols.
+
+i.e. the ones with \"yas-\" single dash prefix. I will try to
+keep them in future yasnippet versions and other elisp libraries
+can more or less safely rely upon them.")
+
+
+(provide 'yasnippet)
+;; Local Variables:
+;; coding: utf-8
+;; indent-tabs-mode: nil
+;; End:
+;;; yasnippet.el ends here
diff --git a/elpa/yasnippet-20200604.246/yasnippet.elc b/elpa/yasnippet-20200604.246/yasnippet.elc
new file mode 100644
index 0000000..bfe08e9
--- /dev/null
+++ b/elpa/yasnippet-20200604.246/yasnippet.elc
Binary files differ
diff --git a/init.el b/init.el
new file mode 100644
index 0000000..265654c
--- /dev/null
+++ b/init.el
@@ -0,0 +1,59 @@
+;; Load path
+(add-to-list 'load-path "~/.emacs.d/lisp/")
+(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
+
+;; Melpa support
+(require 'package)
+(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
+;; Comment/uncomment this line to enable MELPA Stable if desired. See `package-archive-priorities`
+;; and `package-pinned-packages`. Most users will not need or want to do this.
+;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
+(package-initialize)
+
+;; The default is 800 kilobytes. Measured in bytes.
+(setq gc-cons-threshold (* 50 1000 1000))
+
+;; Profile emacs startup
+(add-hook 'emacs-startup-hook
+ (lambda ()
+ (message "*** Emacs loaded in %s seconds with %d garbage collections."
+ (emacs-init-time "%.2f")
+ gcs-done)))
+
+;; Theme
+(load-theme 'vs-light t)
+(set-face-attribute 'region nil :background "#ffffcd")
+
+(require 'general)
+(setup-general)
+
+(require 'cpp)
+(add-hook 'c-mode-common-hook 'setup-c)
+
+(require 'text)
+(add-hook 'text-mode-hook 'setup-text-mode)
+
+(require 'org-custom)
+(add-hook 'org-mode-hook 'org-custom-hook)
+
+(require 'js-mode-custom)
+(setup-js)
+
+
+(custom-set-variables
+ ;; custom-set-variables was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ '(custom-safe-themes
+ '("5859f61b502aa335b502b231c86a051210cb5974f74966e620c31be3a966659f" "32a9fa0f3722e679ed77a28aed3ae99161ef54dc27c35fd19e68e0410633960b" default))
+ '(org-agenda-files (list org-directory))
+ '(org-directory "~/Documents/org")
+ '(package-selected-packages
+ '(js2-highlight-vars ac-js2 js2-refactor js2-mode flycheck-irony company-irony all-the-icons req-package projectile irony org)))
+(custom-set-faces
+ ;; custom-set-faces was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ )
diff --git a/irony/bin/irony-server b/irony/bin/irony-server
new file mode 100755
index 0000000..eb06e34
--- /dev/null
+++ b/irony/bin/irony-server
Binary files differ
diff --git a/lisp/#org-custom.el# b/lisp/#org-custom.el#
new file mode 100644
index 0000000..8fbc6a0
--- /dev/null
+++ b/lisp/#org-custom.el#
@@ -0,0 +1,64 @@
+;; https://zzamboni.org/post/beautifying-org-mode-in-emacs/
+
+(defun org-custom-hook()
+ (setq org-hide-emphasis-markers t)
+ (font-lock-add-keywords 'org-mode
+ '(("^ *\\([-]\\) "
+ (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•"))))))
+
+ (let* ((variable-tuple
+ (cond ((x-list-fonts "ETBembo") '(:font "ETBembo"))
+ ((x-list-fonts "Source Sans Pro") '(:font "Source Sans Pro"))
+ ((x-list-fonts "Lucida Grande") '(:font "Lucida Grande"))
+ ((x-list-fonts "Verdana") '(:font "Verdana"))
+ ((x-family-fonts "Sans Serif") '(:family "Sans Serif"))
+ (nil (warn "Cannot find a Sans Serif Font. Install Source Sans Pro."))))
+ (base-font-color (face-foreground 'default nil 'default))
+ (headline `(:inherit default :weight bold :foreground ,base-font-color)))
+
+ (custom-theme-set-faces
+ 'user
+ `(org-level-8 ((t (,@headline ,@variable-tuple))))
+ `(org-level-7 ((t (,@headline ,@variable-tuple))))
+ `(org-level-6 ((t (,@headline ,@variable-tuple))))
+ `(org-level-5 ((t (,@headline ,@variable-tuple))))
+ `(org-level-4 ((t (,@headline ,@variable-tuple :height 0.8))))
+ `(org-level-3 ((t (,@headline ,@variable-tuple :height 0.9))))
+ `(org-level-2 ((t (,@headline ,@variable-tuple :height 1.0))))
+ `(org-level-1 ((t (,@headline ,@variable-tuple :height 1.25))))
+ `(org-document-title ((t (,@headline ,@variable-tuple :height 1.5 :underline nil))))))
+
+ (custom-theme-set-faces
+ 'user
+ '(org-block ((t (:inherit fixed-pitch))))
+ '(org-code ((t (:inherit (shadow fixed-pitch)))))
+ '(org-document-info ((t (:foreground "dark orange"))))
+ '(org-document-info-keyword ((t (:inherit (shadow fixed-pitch)))))
+ '(org-indent ((t (:inherit (org-hide fixed-pitch)))))
+ '(org-link ((t (:foreground "royal blue" :underline t))))
+ '(org-meta-line ((t (:inherit (font-lock-comment-face fixed-pitch)))))
+ '(org-property-value ((t (:inherit fixed-pitch))) t)
+ '(org-special-keyword ((t (:inherit (font-lock-comment-face fixed-pitch)))))
+ '(org-table ((t (:inherit fixed-pitch :foreground "#83a598"))))
+ '(org-tag ((t (:inherit (shadow fixed-pitch) :weight bold :height 0.8))))
+ '(org-verbatim ((t (:inherit (shadow fixed-pitch))))))
+
+ (variable-pitch-mode)
+ (visual-line-mode)
+
+ (require 'org-bullets)
+ (org-bullets-mode 1)
+
+ (setq org-blank-before-new-entry (quote ((heading . nil)
+ (plain-list-item . nil))))
+)
+
+(custom-set-variables
+ '(org-directory "~/Documents/org")
+ '(org-agenda-files (list org-directory)))
+
+(setq org-todo-keywords
+ '((sequence "TODO" "PROGRESS" "VERIFY" "|" "DONE" "ABANDONED")))
+
+(provide 'org-custom)
+
diff --git a/lisp/cpp.el b/lisp/cpp.el
new file mode 100644
index 0000000..0fca237
--- /dev/null
+++ b/lisp/cpp.el
@@ -0,0 +1,54 @@
+(defun setup-c()
+ (setq c++-tab-always-indent 0)
+ (setq c-basic-offset 4) ;; Default is 2
+ (setq c-indent-level 4) ;; Default is 2
+ (c-set-offset 'brace-list-open 0)
+
+
+ (setq tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60))
+ (setq tab-width 4)
+ (electric-indent-mode 0)
+ )
+
+;; == irony-mode ==
+(use-package irony
+ :ensure t
+ :defer t
+ :init
+ (add-hook 'c++-mode-hook 'irony-mode)
+ (add-hook 'c-mode-hook 'irony-mode)
+ (add-hook 'objc-mode-hook 'irony-mode)
+ :config
+ ;; replace the `completion-at-point' and `complete-symbol' bindings in
+ ;; irony-mode's buffers by irony-mode's function
+ (defun my-irony-mode-hook ()
+ (define-key irony-mode-map [remap completion-at-point]
+ 'irony-completion-at-point-async)
+ (define-key irony-mode-map [remap complete-symbol]
+ 'irony-completion-at-point-async))
+ (add-hook 'irony-mode-hook 'my-irony-mode-hook)
+ (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
+ )
+
+;; == company-mode ==
+(use-package company
+ :ensure t
+ :defer t
+ :init (add-hook 'after-init-hook 'global-company-mode)
+ :config
+ (use-package company-irony :ensure t :defer t)
+ (setq company-idle-delay nil
+ company-minimum-prefix-length 2
+ company-show-numbers t
+ company-tooltip-limit 20
+ company-dabbrev-downcase nil
+ company-backends '((company-irony company-gtags))
+ )
+ :bind ("C-;" . company-complete-common)
+ )
+
+;; Flycheck
+(eval-after-load 'flycheck
+ '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup))
+
+(provide 'cpp)
diff --git a/lisp/general.el b/lisp/general.el
new file mode 100644
index 0000000..f6f447b
--- /dev/null
+++ b/lisp/general.el
@@ -0,0 +1,57 @@
+(defun setup-general()
+ ;; menu bars
+ (menu-bar-mode -1)
+ (toggle-scroll-bar -1)
+ (tool-bar-mode -1)
+ (setq mac-shift-modifier 'meta)
+
+ ;; Default Values
+ ;(setq-default indent-tabs-mode t) ; use spaces only if nil
+ (setq-default tab-width 4) ; Assuming you want your tabs to be four spaces wide
+ (set-face-attribute 'default nil :font "Droid Sans Mono-12")
+ (set-fontset-font t nil "Courier New" nil 'append)
+ (set-fontset-font t '(?😊 . ?😎) "Segoe UI Emoji")
+
+ ;;(set-face-attribute 'default nil :height 110 :family "Consolas")
+ (set-language-environment "UTF-8")
+ (set-default-coding-systems 'utf-8)
+
+ ;; Cursor
+ (setq-default cursor-type 'bar)
+ (blink-cursor-mode 1)
+
+ ;; Margin
+ (global-linum-mode 1)
+ ;; (require 'minimap)
+ ;; (minimap-mode 1)
+ (require 'perfect-margin)
+ (perfect-margin-mode 1)
+
+ ;; Highlight line
+ (require 'hl-line)
+ (global-hl-line-mode 1)
+ (set-face-background hl-line-face "#EFEFEF")
+
+ ;; Initialization screen
+ (setq inhibit-splash-screen t)
+ (setq initial-scratch-message "")
+ (setq initial-major-mode 'text-mode)
+
+ ;; Projectile for projects
+ (require 'projectile)
+ (projectile-mode +1)
+ (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
+
+ ;; Tree
+ (require 'neotree)
+ (global-set-key [f8] 'neotree-toggle)
+ (setq neo-smart-open t)
+ (setq projectile-switch-project-action 'neotree-projectile-action)
+ (setq neo-theme (if (display-graphic-p) 'icons 'arrow))
+
+ ;; Smooth scroll
+ (require 'smooth-scrolling)
+ (smooth-scrolling-mode 1)
+)
+
+(provide 'general)
diff --git a/lisp/hl-line.el b/lisp/hl-line.el
new file mode 100644
index 0000000..26cfcc3
--- /dev/null
+++ b/lisp/hl-line.el
@@ -0,0 +1,298 @@
+;;; hl-line.el --- highlight the current line -*- lexical-binding:t -*-
+
+;; Copyright (C) 1998, 2000-2021 Free Software Foundation, Inc.
+
+;; Author: Dave Love <fx@gnu.org>
+;; Maintainer: emacs-devel@gnu.org
+;; Created: 1998-09-13
+;; Keywords: faces, frames, emulations
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Provides a local minor mode (toggled by M-x hl-line-mode) and
+;; a global minor mode (toggled by M-x global-hl-line-mode) to
+;; highlight, on a suitable terminal, the line on which point is. The
+;; global mode highlights the current line in the selected window only
+;; (except when the minibuffer window is selected). This was
+;; implemented to satisfy a request for a feature of Lesser Editors.
+;; The local mode is sticky: it highlights the line about the buffer's
+;; point even if the buffer's window is not selected. Caveat: the
+;; buffer's point might be different from the point of a non-selected
+;; window. Set the variable `hl-line-sticky-flag' to nil to make the
+;; local mode behave like the global mode.
+
+;; You probably don't really want to use the global mode; if the
+;; cursor is difficult to spot, try changing its color, relying on
+;; `blink-cursor-mode' or both. The hookery used might affect
+;; response noticeably on a slow machine. The local mode may be
+;; useful in non-editing buffers such as Gnus or PCL-CVS though.
+
+;; An overlay is used. In the non-sticky cases, this overlay is
+;; active only on the selected window. A hook is added to
+;; `post-command-hook' to activate the overlay and move it to the line
+;; about point.
+
+;; You could make variable `global-hl-line-mode' buffer-local and set
+;; it to nil to avoid highlighting specific buffers, when the global
+;; mode is used.
+
+;; By default the whole line is highlighted. The range of highlighting
+;; can be changed by defining an appropriate function as the
+;; buffer-local value of `hl-line-range-function'.
+
+;;; Code:
+
+(defvar-local hl-line-overlay nil
+ "Overlay used by Hl-Line mode to highlight the current line.")
+
+(defvar-local global-hl-line-overlay nil
+ "Overlay used by Global-Hl-Line mode to highlight the current line.")
+
+(defvar global-hl-line-overlays nil
+ "Overlays used by Global-Hl-Line mode in various buffers.
+Global-Hl-Line keeps displaying one overlay in each buffer
+when `global-hl-line-sticky-flag' is non-nil.")
+
+(defgroup hl-line nil
+ "Highlight the current line."
+ :version "21.1"
+ :group 'convenience)
+
+(defface hl-line
+ '((t :inherit highlight :extend t))
+ "Default face for highlighting the current line in Hl-Line mode."
+ :version "22.1"
+ :group 'hl-line)
+
+(defcustom hl-line-face 'hl-line
+ "Face with which to highlight the current line in Hl-Line mode."
+ :type 'face
+ :group 'hl-line
+ :set (lambda (symbol value)
+ (set symbol value)
+ (dolist (buffer (buffer-list))
+ (with-current-buffer buffer
+ (when (overlayp hl-line-overlay)
+ (overlay-put hl-line-overlay 'face hl-line-face))))
+ (when (overlayp global-hl-line-overlay)
+ (overlay-put global-hl-line-overlay 'face hl-line-face))))
+
+(defcustom hl-line-sticky-flag t
+ "Non-nil means the HL-Line mode highlight appears in all windows.
+Otherwise Hl-Line mode will highlight only in the selected
+window. Setting this variable takes effect the next time you use
+the command `hl-line-mode' to turn Hl-Line mode on.
+
+This variable has no effect in Global Highlight Line mode.
+For that, use `global-hl-line-sticky-flag'."
+ :type 'boolean
+ :version "22.1"
+ :group 'hl-line)
+
+(defcustom global-hl-line-sticky-flag nil
+ "Non-nil means the Global HL-Line mode highlight appears in all windows.
+Otherwise Global Hl-Line mode will highlight only in the selected
+window. Setting this variable takes effect the next time you use
+the command `global-hl-line-mode' to turn Global Hl-Line mode on."
+ :type 'boolean
+ :version "24.1"
+ :group 'hl-line)
+
+(defvar hl-line-range-function nil
+ "If non-nil, function to call to return highlight range.
+The function of no args should return a cons cell; its car value
+is the beginning position of highlight and its cdr value is the
+end position of highlight in the buffer.
+It should return nil if there's no region to be highlighted.
+
+This variable is expected to be made buffer-local by modes.")
+
+(defvar hl-line-overlay-buffer nil
+ "Most recently visited buffer in which Hl-Line mode is enabled.")
+
+(defvar hl-line-overlay-priority -50
+ "Priority used on the overlay used by hl-line.")
+
+;;;###autoload
+(define-minor-mode hl-line-mode
+ "Toggle highlighting of the current line (Hl-Line mode).
+
+Hl-Line mode is a buffer-local minor mode. If
+`hl-line-sticky-flag' is non-nil, Hl-Line mode highlights the
+line about the buffer's point in all windows. Caveat: the
+buffer's point might be different from the point of a
+non-selected window. Hl-Line mode uses the function
+`hl-line-highlight' on `post-command-hook' in this case.
+
+When `hl-line-sticky-flag' is nil, Hl-Line mode highlights the
+line about point in the selected window only."
+ :group 'hl-line
+ (if hl-line-mode
+ (progn
+ ;; In case `kill-all-local-variables' is called.
+ (add-hook 'change-major-mode-hook #'hl-line-unhighlight nil t)
+ (hl-line-highlight)
+ (setq hl-line-overlay-buffer (current-buffer))
+ (add-hook 'post-command-hook #'hl-line-highlight nil t))
+ (remove-hook 'post-command-hook #'hl-line-highlight t)
+ (hl-line-unhighlight)
+ (remove-hook 'change-major-mode-hook #'hl-line-unhighlight t)))
+
+(defun hl-line-make-overlay ()
+ (let ((ol (make-overlay (point) (point))))
+ (overlay-put ol 'priority hl-line-overlay-priority) ;(bug#16192)
+ (overlay-put ol 'face hl-line-face)
+ ol))
+
+(defun hl-line-highlight ()
+ "Activate the Hl-Line overlay on the current line."
+ (if hl-line-mode ; Might be changed outside the mode function.
+ (progn
+ (unless (overlayp hl-line-overlay)
+ (setq hl-line-overlay (hl-line-make-overlay))) ; To be moved.
+ (overlay-put hl-line-overlay
+ 'window (unless hl-line-sticky-flag (selected-window)))
+ (hl-line-move hl-line-overlay)
+ (hl-line-maybe-unhighlight))
+ (hl-line-unhighlight)))
+
+(defun hl-line-unhighlight ()
+ "Deactivate the Hl-Line overlay on the current line."
+ (when (overlayp hl-line-overlay)
+ (delete-overlay hl-line-overlay)
+ (setq hl-line-overlay nil)))
+
+(defun hl-line-maybe-unhighlight ()
+ "Maybe deactivate the Hl-Line overlay on the current line.
+Specifically, when `hl-line-sticky-flag' is nil deactivate all
+such overlays in all buffers except the current one."
+ (let ((hlob hl-line-overlay-buffer)
+ (curbuf (current-buffer)))
+ (when (and (buffer-live-p hlob)
+ (not hl-line-sticky-flag)
+ (not (eq curbuf hlob))
+ (not (minibufferp)))
+ (with-current-buffer hlob
+ (hl-line-unhighlight)))
+ (when (and (overlayp hl-line-overlay)
+ (eq (overlay-buffer hl-line-overlay) curbuf))
+ (setq hl-line-overlay-buffer curbuf))))
+
+;;;###autoload
+(define-minor-mode global-hl-line-mode
+ "Toggle line highlighting in all buffers (Global Hl-Line mode).
+
+If `global-hl-line-sticky-flag' is non-nil, Global Hl-Line mode
+highlights the line about the current buffer's point in all live
+windows.
+
+Global-Hl-Line mode uses the function `global-hl-line-highlight'
+on `post-command-hook'."
+ :global t
+ :group 'hl-line
+ (if global-hl-line-mode
+ (progn
+ ;; In case `kill-all-local-variables' is called.
+ (add-hook 'change-major-mode-hook #'global-hl-line-unhighlight)
+ (global-hl-line-highlight-all)
+ (add-hook 'post-command-hook #'global-hl-line-highlight))
+ (global-hl-line-unhighlight-all)
+ (remove-hook 'post-command-hook #'global-hl-line-highlight)
+ (remove-hook 'change-major-mode-hook #'global-hl-line-unhighlight)))
+
+(defun global-hl-line-highlight ()
+ "Highlight the current line in the current window."
+ (when global-hl-line-mode ; Might be changed outside the mode function.
+ (unless (window-minibuffer-p)
+ (unless (overlayp global-hl-line-overlay)
+ (setq global-hl-line-overlay (hl-line-make-overlay))) ; To be moved.
+ (unless (member global-hl-line-overlay global-hl-line-overlays)
+ (push global-hl-line-overlay global-hl-line-overlays))
+ (overlay-put global-hl-line-overlay 'window
+ (unless global-hl-line-sticky-flag
+ (selected-window)))
+ (hl-line-move global-hl-line-overlay)
+ (global-hl-line-maybe-unhighlight))))
+
+(defun global-hl-line-highlight-all ()
+ "Highlight the current line in all live windows."
+ (walk-windows (lambda (w)
+ (with-current-buffer (window-buffer w)
+ (global-hl-line-highlight)))
+ nil t))
+
+(defun global-hl-line-unhighlight ()
+ "Deactivate the Global-Hl-Line overlay on the current line."
+ (when (overlayp global-hl-line-overlay)
+ (delete-overlay global-hl-line-overlay)
+ (setq global-hl-line-overlay nil)))
+
+(defun global-hl-line-maybe-unhighlight ()
+ "Maybe deactivate the Global-Hl-Line overlay on the current line.
+Specifically, when `global-hl-line-sticky-flag' is nil deactivate
+all such overlays in all buffers except the current one."
+ (mapc (lambda (ov)
+ (let ((ovb (overlay-buffer ov)))
+ (when (and (not global-hl-line-sticky-flag)
+ (bufferp ovb)
+ (not (eq ovb (current-buffer)))
+ (not (minibufferp)))
+ (with-current-buffer ovb
+ (global-hl-line-unhighlight)))))
+ global-hl-line-overlays))
+
+(defun global-hl-line-unhighlight-all ()
+ "Deactivate all Global-Hl-Line overlays."
+ (mapc (lambda (ov)
+ (let ((ovb (overlay-buffer ov)))
+ (when (bufferp ovb)
+ (with-current-buffer ovb
+ (global-hl-line-unhighlight)))))
+ global-hl-line-overlays)
+ (setq global-hl-line-overlays nil))
+
+(defun hl-line-move (overlay)
+ "Move the Hl-Line overlay.
+If `hl-line-range-function' is non-nil, move the OVERLAY to the position
+where the function returns. If `hl-line-range-function' is nil, fill
+the line including the point by OVERLAY."
+ (let (tmp b e)
+ (if hl-line-range-function
+ (setq tmp (funcall hl-line-range-function)
+ b (car tmp)
+ e (cdr tmp))
+ (setq tmp t
+ b (line-beginning-position)
+ e (line-beginning-position 2)))
+ (if tmp
+ (move-overlay overlay b e)
+ (move-overlay overlay 1 1))))
+
+(defun hl-line-unload-function ()
+ "Unload the Hl-Line library."
+ (global-hl-line-mode -1)
+ (save-current-buffer
+ (dolist (buffer (buffer-list))
+ (set-buffer buffer)
+ (when hl-line-mode (hl-line-mode -1))))
+ ;; continue standard unloading
+ nil)
+
+(provide 'hl-line)
+
+;;; hl-line.el ends here
diff --git a/lisp/js-mode-custom.el b/lisp/js-mode-custom.el
new file mode 100644
index 0000000..7f4d396
--- /dev/null
+++ b/lisp/js-mode-custom.el
@@ -0,0 +1,20 @@
+(defun setup-js()
+ (setq js-indent-level 2)
+ )
+
+(require 'js2-mode)
+(require 'js2-refactor)
+(require 'js2-highlight-vars)
+(require 'company)
+;(add-hook 'js-mode-hook 'js2-minor-mode)
+(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
+(add-hook 'js2-mode-hook #'js2-imenu-extras-mode)
+(add-hook 'js2-mode-hook 'ac-js2-mode)
+(add-hook 'js2-mode-hook 'js2-refactor-mode)
+(add-hook 'js2-mode-hook 'js2-highlight-vars-mode)
+(add-hook 'js2-mode-hook 'setup-js)
+(js2r-add-keybindings-with-prefix "C-c C-r")
+(add-to-list 'company-backends 'ac-js2-company)
+
+
+(provide 'js-mode-custom)
diff --git a/lisp/minimap.el b/lisp/minimap.el
new file mode 100644
index 0000000..c360673
--- /dev/null
+++ b/lisp/minimap.el
@@ -0,0 +1,936 @@
+;;; minimap.el --- Sidebar showing a "mini-map" of a buffer
+
+;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+
+;; Author: David Engster <deng@randomsample.de>
+;; Keywords:
+;; Version: 1.3
+
+;; This file is part of GNU Emacs.
+
+;; This program 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 2
+;; of the License, or (at your option) any later version.
+;;
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file is an implementation of a minimap sidebar, i.e., a
+;; smaller display of the current buffer on the left side. It
+;; highlights the currently shown region and updates its position
+;; automatically. You can navigate in the minibar by dragging the
+;; active region with the mouse, which will scroll the corresponding
+;; edit buffer. Additionally, you can overlay information from the
+;; tags gathered by CEDET's semantic analyzer.
+
+;; Simply use M-x minimap-mode to toggle activation of the minimap.
+;; Use 'M-x customize-group RET minimap RET' to adapt minimap to your
+;; needs.
+
+;;; KNOWN BUGS:
+
+;; * Currently cannot deal with images.
+;; * Display/movement can be a bit erratic at times.
+
+;;; TODO:
+
+;; * Fix known bugs.
+;; * Make sidebar permanently visible. This requires something like a
+;; 'window group' feature in Emacs, which is currently being worked on.
+;; * Moving the active region with the keyboard / mouse-wheel ?
+
+
+;;; News:
+;;
+;;;; Changes since v1.2:
+;;
+;; - New option: minimap-hide-cursor (active by default)
+;; - New option: minimap-disable-mode-line (active by default)
+;; - Make current line highlighting face configurable, change to dark gray.
+;; - New default behavior for minimap-automatically-delete-window:
+;; keep minimap window as long as buffer is visible. Change variable
+;; to 't' to get old behavior.
+;; - Bug fixes
+;;
+;;;; Changes since v1.1:
+;;
+;; - Change some defaults: better colors, reduced update delay.
+;; - `minimap-tag-only': New experimental feature to only display an
+;; 'abstract view' of the buffer with overlays generated from
+;; Semantic information. Works only for buffers parsed by Semantic.
+;; - `minimap-highlight-line': Highlight current line in Minimap.
+;; - Fix autoloads.
+;; - Display lines denoting beginning/end of functions in Semantic
+;; overlays.
+;;
+;;;; Changes since v1.0:
+;;
+;; - Largely rewritten as a minor mode; use M-x minimap-mode to
+;; enable/disable.
+;; - Minimap will now remain active for all buffers which derive from
+;; `prog-mode' (can be changed through `minimap-major-modes'). The
+;; minimap window will be automatically created or deleted (see new
+;; variables `minimap-recreate-window' and
+;; `minimap-automatically-delete-window').
+;; - Possibility to set a minimum width of the minimap window
+;; (`minimap-minimum-width').
+;; - Minimap window will be marked so that you should not be able to
+;; enter it.
+;; - Semantic overlays will be automatically updated during editing.
+;; - Lots of bug fixes.
+
+;; Silence byte compiler
+(declare-function semantic-active-p "semantic/fw")
+(declare-function semantic-fetch-tags "semantic")
+(declare-function semantic-tag-class "semantic/tag")
+(declare-function semantic-tag-overlay "semantic/tag")
+(declare-function semantic-tag-name "semantic/tag")
+
+(defgroup minimap nil
+ "A minimap sidebar for Emacs."
+ :group 'convenience)
+
+(defface minimap-font-face
+ '((default :family "DejaVu Sans Mono" :height 30))
+ "Face used for text in minimap buffer, notably the font family and height.
+This height should be really small. You probably want to use a
+TrueType font for this. After changing this, you should
+recreate the minimap to avoid problems with recentering."
+ :group 'minimap)
+
+(defface minimap-current-line-face
+ '((((background dark)) (:background "dark gray"))
+ (t (:background "dark gray")))
+ "Face for the current line in the minimap.
+By default, both foreground and background are yellow."
+ :group 'minimap)
+
+(defface minimap-active-region-background
+ '((((background dark)) (:background "#700000" :extend t))
+ (t (:background "#C847D8FEFFFF" :extend t)))
+ "Face for the active region in the minimap.
+By default, this is only a different background color."
+ :group 'minimap)
+
+(defface minimap-semantic-function-face
+ '((((background dark))
+ (:box (:line-width 1 :color "white")
+ :inherit (font-lock-function-name-face minimap-font-face)
+ :height 2.75 :background "#202414"))
+ (t (:box (:line-width 1 :color "black")
+ :inherit (font-lock-function-name-face minimap-font-face)
+ :height 2.75 :background "gray90")))
+ "Face used for functions in the semantic overlay.")
+
+(defface minimap-semantic-variable-face
+ '((((background dark))
+ (:box (:line-width 1 :color "white")
+ :inherit (font-lock-variable-name-face minimap-font-face)
+ :height 2.75 :background "gray10"))
+ (t (:box (:line-width 1 :color "black")
+ :inherit (font-lock-function-name-face minimap-font-face)
+ :height 2.75 :background "gray90")))
+ "Face used for variables in the semantic overlay.")
+
+(defface minimap-semantic-type-face
+ '((((background dark))
+ (:box (:line-width 1 :color "white")
+ :inherit (font-lock-type-face minimap-font-face)
+ :height 2.75 :background "gray10"))
+ (t (:box (:line-width 1 :color "black")
+ :inherit (font-lock-function-name-face minimap-font-face)
+ :height 2.75 :background "gray90")))
+ "Face used for types in the semantic overlay.")
+
+(defcustom minimap-width-fraction 0.15
+ "Fraction of width which should be used for minimap sidebar."
+ :type 'number
+ :group 'minimap)
+
+(defcustom minimap-minimum-width 30
+ "Minimum width of minimap in characters (default size).
+Use nil to disable."
+ :type 'number
+ :group 'minimap)
+
+(defcustom minimap-window-location 'left
+ "Location of the minimap window.
+Can be either the symbol `left' or `right'."
+ :type '(choice (const :tag "Left" left)
+ (const :tag "Right" right))
+ :group 'minimap)
+
+(defcustom minimap-buffer-name " *MINIMAP*"
+ "Buffer name of minimap sidebar."
+ :type 'string
+ :group 'minimap)
+
+(defcustom minimap-update-delay 0.1
+ "Delay in seconds after which sidebar gets updated.
+Setting this to 0 will let the minimap react immediately, but
+this will slow down scrolling."
+ :type 'number
+ :set (lambda (sym value)
+ (set sym value)
+ (when (and (boundp 'minimap-timer-object)
+ minimap-timer-object)
+ (cancel-timer minimap-timer-object)
+ (setq minimap-timer-object
+ (run-with-idle-timer
+ minimap-update-delay t 'minimap-update))))
+ :group 'minimap)
+
+(defcustom minimap-always-recenter nil
+ "Whether minimap sidebar should be recentered after every point movement."
+ :type 'boolean
+ :group 'minimap)
+
+(defcustom minimap-recenter-type 'relative
+ "Specifies the type of recentering the minimap should use.
+The minimap can use different types of recentering, i.e., how the
+minimap should behave when you scroll in the main window or when
+you drag the active region with the mouse. The following
+explanations will probably not help much, so simply try them and
+choose the one which suits you best.
+
+`relative' -- The position of the active region in the minimap
+corresponds with the relative position of this region in the
+buffer. This the default.
+
+`middle' -- The active region will stay fixed in the middle of
+the minimap.
+
+`free' -- The position will be more or less free. When dragging
+the active region, the minimap will scroll when you reach the
+bottom or top."
+ :type '(choice (const :tag "Relative" relative)
+ (const :tag "Middle" middle)
+ (const :tag "Free" free))
+ :group 'minimap)
+
+(defcustom minimap-hide-scroll-bar t
+ "Whether the minimap should hide the vertical scrollbar."
+ :type 'boolean
+ :group 'minimap)
+
+(defcustom minimap-hide-fringes nil
+ "Whether the minimap should hide the fringes."
+ :type 'boolean
+ :group 'minimap)
+
+(defcustom minimap-dedicated-window t
+ "Whether the minimap should create a dedicated window."
+ :type 'boolean
+ :group 'minimap)
+
+(defcustom minimap-display-semantic-overlays t
+ "Display overlays from CEDET's semantic analyzer.
+If you use CEDET and the buffer's major-mode is supported, the
+minimap can display overlays generated by the semantic analyzer.
+By default, it will apply the faces `minimap-semantic-<X>-face',
+with <X> being \"function\", \"variable\" and \"type\". Also, it
+will display the name of the tag in the middle of the overlay in
+the corresponding font-lock face.
+
+See also `minimap-enlarge-certain-faces', which can be used as
+fallback."
+ :type 'boolean
+ :group 'minimap)
+
+(defcustom minimap-enlarge-certain-faces 'as-fallback
+ "Whether certain faces should be enlarged in the minimap.
+All faces listed in `minimap-normal-height-faces' will be
+displayed using the default font height, allowing you to still
+read text using those faces. By default, this should enlarge all
+function names in the minimap, given you have font locking
+enabled. This variable can have the following values:
+
+'as-fallback (the default) -- The feature will only be activated
+ if information from CEDET's semantic analyzer isn't available
+ (see: `minimap-display-semantic-overlays').
+'always -- Always active.
+nil -- Inactive."
+ :type '(choice (const :tag "Fallback if CEDET unavailable." as-fallback)
+ (const :tag "Always active." always)
+ (const :tag "Inactive." nil))
+ :group 'minimap)
+
+(defcustom minimap-normal-height-faces '(font-lock-function-name-face)
+ "List of faces which should be displayed with normal height.
+When `minimap-enlarge-certain-faces' is non-nil, all faces in
+this list will be displayed using the default font height. By
+default, this list contains `font-lock-function-name-face', so
+you can still read function names in the minimap."
+ :type '(repeat face)
+ :group 'minimap)
+
+(defcustom minimap-sync-overlay-properties '(face invisible)
+ "Specifies which overlay properties should be synced.
+Unlike text properties, overlays are not applied automatically to
+the minimap and must be explicitly synced. This variable
+specifies which overlay properties should be synced by
+`minimap-sync-overlays'. Most importantly, this variable should
+include 'invisible', so that hidden text does not appear in the
+minimap buffer."
+ :type '(repeat symbol)
+ :group 'minimap)
+
+(defcustom minimap-major-modes '(prog-mode)
+ "Major modes for which a minimap should be created.
+This can also be a parent mode like 'prog-mode.
+If nil, a minimap must be explicitly created for each buffer."
+ :type '(repeat symbol)
+ :group 'minimap)
+
+(defcustom minimap-recreate-window t
+ "Whether the minimap window should be automatically re-created.
+If this is non-nil, the side window for the minimap will be
+automatically re-created as soon as you kill it."
+ :type 'boolean
+ :group 'minimap)
+
+(defcustom minimap-automatically-delete-window 'visible
+ "Whether the minimap window should be automatically deleted.
+You can choose between three different behaviors here: If this is
+`nil', the minimap window will never be automatically deleted. If
+this is set to symbol 'visible, the minimap stays active as long
+as the minimap's buffer is visible somewhere in the frame,
+whether it is active or not. Any other value will delete the
+minimap window as soon as you enter a buffer which is not derived
+from `minimap-major-modes' (excluding the minibuffer)."
+ :type '(choice (const :tag "Never delete automatically" nil)
+ (const :tag "Keep as long as buffer visible" visible)
+ (const :tag "Delete when entering unsupported buffer" t))
+ :group 'minimap)
+
+(defcustom minimap-tag-only nil
+ "Whether the minimap should only display parsed tags from CEDET."
+ :type 'boolean
+ :group 'minimap)
+
+(defcustom minimap-highlight-line t
+ "Whether the minimap should highlight the current line."
+ :type 'boolean
+ :group 'minimap)
+
+(defcustom minimap-disable-mode-line t
+ "Whether to disable the mode-line in the minimap window."
+ :type 'boolen
+ :group 'minimap)
+
+(defcustom minimap-hide-cursor t
+ "Whether to hide the cursor in the minimap window."
+ :type 'boolen
+ :group 'minimap)
+
+;;; Internal variables
+
+;; The buffer currently displayed in the minimap
+(defvar minimap-active-buffer nil)
+;; Window start/end from the base buffer
+(defvar minimap-start nil)
+(defvar minimap-end nil)
+;; General overlay for the minimap
+(defvar minimap-base-overlay nil)
+;; Overlay for the active region
+(defvar minimap-active-overlay nil)
+;; Timer
+(defvar minimap-timer-object nil)
+;; Lines the minimap can display
+(defvar minimap-numlines nil)
+(defvar minimap-pointmin-overlay nil)
+;; Line overlay
+(defvar minimap-line-overlay nil)
+
+
+;;; Helpers
+
+(defun minimap-active-current-buffer-p ()
+ "Whether the current buffer is displayed in the minimap."
+ (and (eq (current-buffer) minimap-active-buffer)
+ (get-buffer minimap-buffer-name)
+ (with-current-buffer minimap-buffer-name
+ (eq minimap-active-buffer (buffer-base-buffer)))))
+
+(defsubst minimap-get-window ()
+ "Get current minimap window."
+ (when (get-buffer minimap-buffer-name)
+ (get-buffer-window minimap-buffer-name)))
+
+(defsubst minimap-kill-buffer ()
+ "Kill the minimap buffer."
+ (when (get-buffer minimap-buffer-name)
+ (kill-buffer minimap-buffer-name)))
+
+(defun minimap-create-window ()
+ (let ((width (round (* (window-width)
+ minimap-width-fraction)))
+ buffer-window)
+ (when (< width minimap-minimum-width)
+ (setq width minimap-minimum-width))
+ (if (eq minimap-window-location 'left)
+ ;; The existing window becomes the minimap
+ (progn
+ (setq buffer-window (split-window-horizontally width))
+ ;; Restore prev/next buffers in the new window
+ (set-window-next-buffers buffer-window
+ (window-next-buffers))
+ (set-window-prev-buffers buffer-window
+ (window-prev-buffers)))
+ ;; The new window is the minimap
+ (setq buffer-window (selected-window))
+ (select-window (split-window-horizontally
+ (* -1 width))))
+ ;; Set up the minimap window:
+ ;; You should not be able to enter the minimap window.
+ (set-window-parameter nil 'no-other-window t)
+ ;; Switch to buffer.
+ (switch-to-buffer
+ (get-buffer-create minimap-buffer-name) t t)
+ ;; Do not fold lines in the minimap.
+ (setq truncate-lines t)
+ ;; Make it dedicated.
+ (when minimap-dedicated-window
+ (set-window-dedicated-p nil t))
+ ;; Return minimap window, but make sure we select the window where
+ ;; the buffer is in.
+ (prog1
+ (selected-window)
+ (select-window buffer-window))))
+
+(defun minimap-setup-hooks (&optional remove)
+ "Hook minimap into other modes.
+If REMOVE is non-nil, remove minimap from other modes."
+ (if remove
+ (progn
+ (remove-hook 'outline-view-change-hook 'minimap-sync-overlays)
+ (remove-hook 'hs-hide-hook 'minimap-sync-overlays)
+ (remove-hook 'hs-show-hook 'minimap-sync-overlays)
+ (remove-hook 'flycheck-after-syntax-check-hook 'minimap-sync-overlays))
+ ;; outline-(minor-)mode
+ (add-hook 'outline-view-change-hook 'minimap-sync-overlays)
+ ;; hideshow
+ (add-hook 'hs-hide-hook 'minimap-sync-overlays)
+ (add-hook 'hs-show-hook 'minimap-sync-overlays)
+ (add-hook 'flycheck-after-syntax-check-hook 'minimap-sync-overlays)))
+
+;;; Minimap creation / killing
+
+;;;###autoload
+(define-minor-mode minimap-mode
+ "Toggle minimap mode."
+ :global t
+ :group 'minimap
+ :lighter " MMap"
+ (if minimap-mode
+ (progn
+ (when (and minimap-major-modes
+ (apply 'derived-mode-p minimap-major-modes))
+ (unless (minimap-get-window)
+ (minimap-create-window))
+ ;; Create minimap.
+ (minimap-new-minimap))
+ ;; Create timer.
+ (setq minimap-timer-object
+ (run-with-idle-timer minimap-update-delay t 'minimap-update))
+ ;; Hook into other modes.
+ (minimap-setup-hooks))
+ ;; Turn it off
+ (minimap-kill)
+ (minimap-setup-hooks t)))
+
+(defun minimap-create ()
+ "Create a minimap sidebar."
+ (interactive)
+ (minimap-mode 1))
+
+(defun minimap-new-minimap ()
+ "Create new minimap BUFNAME for current buffer and window.
+Re-use already existing minimap window if possible."
+ (interactive)
+ (let ((currentbuffer (current-buffer))
+ (win (minimap-get-window))
+ (indbuf (make-indirect-buffer (current-buffer)
+ (concat minimap-buffer-name "_temp")))
+ (edges (window-pixel-edges)))
+ ;; Remember the active buffer currently displayed in the minimap.
+ (setq minimap-active-buffer (current-buffer))
+ ;; Hook into CEDET if necessary.
+ (when (and minimap-display-semantic-overlays
+ (boundp 'semantic-after-toplevel-cache-change-hook))
+ (add-hook 'semantic-after-partial-cache-change-hook
+ 'minimap-apply-semantic-overlays nil t)
+ (add-hook 'semantic-after-toplevel-cache-change-hook
+ 'minimap-apply-semantic-overlays nil t))
+ (with-selected-window win
+ ;; Now set up the minimap:
+ (when (window-dedicated-p)
+ (set-window-dedicated-p nil nil))
+ (switch-to-buffer indbuf t t)
+ (minimap-kill-buffer)
+ (rename-buffer minimap-buffer-name)
+ ;; Do not fold lines in the minimap.
+ (setq truncate-lines t)
+ (when minimap-dedicated-window
+ (set-window-dedicated-p nil t))
+ (setq minimap-base-overlay (make-overlay (point-min) (point-max) nil t t))
+ (overlay-put minimap-base-overlay 'face 'minimap-font-face)
+ (overlay-put minimap-base-overlay 'priority 1)
+ ;; Add the hand mouse pointer to visible text. It doesn’t seem
+ ;; possible to set the mouse cursor when there’s no text. See
+ ;; `void-text-area-pointer'.
+ (overlay-put minimap-base-overlay 'pointer 'hand)
+ (when minimap-tag-only
+ (overlay-put minimap-base-overlay 'face
+ `(:inherit minimap-font-face
+ :foreground ,(face-background 'default))))
+ (setq minimap-pointmin-overlay (make-overlay (point-min) (1+ (point-min))))
+ (setq minimap-start (window-start)
+ minimap-end (window-end)
+ minimap-active-overlay (make-overlay minimap-start minimap-end)
+ line-spacing 0)
+ (overlay-put minimap-active-overlay 'face
+ 'minimap-active-region-background)
+ (when minimap-tag-only
+ (overlay-put minimap-active-overlay 'face
+ `(:inherit 'minimap-active-region-background
+ :foreground ,(face-background 'minimap-active-region-background))))
+ (overlay-put minimap-active-overlay 'priority 5)
+ (minimap-sb-mode 1)
+ (when minimap-disable-mode-line
+ (setq mode-line-format nil))
+ (when minimap-hide-cursor
+ (setq cursor-type nil))
+ (when minimap-hide-scroll-bar
+ (setq vertical-scroll-bar nil)
+ (set-window-buffer nil (current-buffer)))
+ (when minimap-hide-fringes
+ (set-window-fringes nil 0 0))
+ (when (and (boundp 'linum-mode)
+ linum-mode)
+ (linum-mode 0))
+ (setq buffer-read-only t)
+ ;; Calculate the actual number of lines displayable with the minimap face.
+ (setq minimap-numlines
+ (floor
+ (/
+ (- (nth 3 edges) (nth 1 edges))
+ (car (progn (redisplay t) (window-line-height)))))))
+ (minimap-sync-overlays)))
+
+(defun minimap-kill ()
+ "Kill minimap."
+ (interactive)
+ (when (minimap-get-window)
+ (delete-window (minimap-get-window)))
+ (cancel-timer minimap-timer-object))
+
+;;; Minimap update
+
+(defun minimap-update (&optional force)
+ "Update minimap sidebar if necessary.
+This is meant to be called from the idle-timer or the post command hook.
+When FORCE, enforce update of the active region."
+ (interactive)
+ ;; If we are in the minibuffer, do nothing.
+ (unless (active-minibuffer-window)
+ (if (minimap-active-current-buffer-p)
+ ;; We are still in the same buffer, so just update the minimap.
+ (minimap-update-current-buffer force)
+ ;; The buffer was switched, check if the minimap should switch, too.
+ (if (and minimap-major-modes
+ (apply 'derived-mode-p minimap-major-modes))
+ (progn
+ ;; Create window if necessary...
+ (unless (minimap-get-window)
+ (minimap-create-window))
+ ;; ...and re-create minimap with new buffer...
+ (minimap-new-minimap)
+ ;; Redisplay
+ (sit-for 0)
+ ;; ...and call update again.
+ (minimap-update t))
+ ;; We have entered a buffer for which no minimap should be
+ ;; displayed. Check if we should de
+ (when (and (minimap-get-window)
+ (minimap-need-to-delete-window))
+ ;; We wait a tiny bit before deleting the window, since we
+ ;; might only be temporarily in another buffer.
+ (run-with-timer 0.3 nil
+ (lambda ()
+ (when (and (null (minimap-active-current-buffer-p))
+ (minimap-get-window))
+ (delete-window (minimap-get-window))))))))))
+
+(defun minimap-need-to-delete-window ()
+ "Check if we should delete the minimap window.
+This depends on `minimap-automatically-delete-window'."
+ (if (eq minimap-automatically-delete-window 'visible)
+ (null (get-buffer-window minimap-active-buffer))
+ (null minimap-automatically-delete-window)))
+
+(defun minimap-update-current-buffer (force)
+ "Update minimap for the current buffer."
+ (let ((win (minimap-get-window))
+ (start (window-start))
+ (end (window-end))
+ (pt (point)))
+ (when (and (null win)
+ minimap-recreate-window)
+ ;; The minimap window is no longer visible, so create it again...
+ (setq win (minimap-create-window))
+ ;; ...and switch to existing minimap buffer.
+ (with-selected-window win
+ (when (window-dedicated-p)
+ (set-window-dedicated-p nil nil))
+ (switch-to-buffer minimap-buffer-name t t)
+ (when minimap-hide-fringes
+ (set-window-fringes nil 0 0))
+ (when minimap-dedicated-window
+ (set-window-dedicated-p nil t))))
+ (with-selected-window win
+ ;; Make sure the base overlay spans the whole buffer.
+ (unless (and (= (overlay-start minimap-base-overlay) (point-min))
+ (= (overlay-end minimap-base-overlay) (point-max)))
+ (move-overlay minimap-base-overlay (point-min) (point-max)))
+ (unless (and (not force)
+ (= minimap-start start)
+ (= minimap-end end))
+ ;; Update the overlay.
+ (move-overlay minimap-active-overlay start end)
+ (setq minimap-start start
+ minimap-end end)
+ (minimap-recenter (line-number-at-pos (/ (+ end start) 2))
+ (/ (- (line-number-at-pos end)
+ (line-number-at-pos start))
+ 2)))
+ (goto-char pt)
+ (beginning-of-line)
+ (when minimap-highlight-line
+ (minimap-highlight-line))
+ (when minimap-always-recenter
+ (recenter (round (/ (window-height) 2)))))))
+
+(defun minimap-highlight-line ()
+ "Highlight current line in the minimap."
+ (unless minimap-line-overlay
+ (setq minimap-line-overlay (make-overlay (point) (1+ (point)) nil t))
+ (overlay-put minimap-line-overlay 'priority 6))
+ (overlay-put
+ minimap-line-overlay 'face
+ `(:background ,(face-background 'minimap-current-line-face)
+ :foreground ,(face-foreground 'minimap-current-line-face)))
+ (move-overlay minimap-line-overlay (point) (line-beginning-position 2)))
+
+;;; Overlay movement
+
+(defun minimap-move-overlay-mouse (start-event)
+ "Move overlay by tracking mouse movement."
+ (interactive "e")
+ (when (get-buffer-window (buffer-base-buffer (current-buffer)))
+ (let* ((echo-keystrokes 0)
+ (end-posn (event-end start-event))
+ (start-point (posn-point end-posn))
+ (make-cursor-line-fully-visible nil)
+ (cursor-type nil)
+ (minimap-automatically-delete-window nil)
+ (pcselmode (when (boundp 'pc-selection-mode)
+ pc-selection-mode))
+ pt ev)
+ (when (and pcselmode (fboundp 'pc-selection-mode))
+ (pc-selection-mode -1))
+ (move-overlay minimap-active-overlay start-point minimap-end)
+ (track-mouse
+ (minimap-set-overlay start-point)
+ (while (and
+ (consp (setq ev (read-event)))
+ (eq (car ev) 'mouse-movement))
+ (setq pt (posn-point (event-start ev)))
+ (when (numberp pt)
+ (with-selected-window (get-buffer-window minimap-buffer-name)
+ (goto-char pt)
+ (beginning-of-line)
+ (minimap-set-overlay (point))))))
+ (minimap-update)
+ (when (and pcselmode (fboundp 'pc-selection-mode))
+ (pc-selection-mode 1)))))
+
+(defun minimap-set-overlay (pt)
+ "Set overlay position, with PT being the middle."
+ (goto-char pt)
+ (let* ((ovstartline (line-number-at-pos minimap-start))
+ (ovendline (line-number-at-pos minimap-end))
+ (ovheight (round (/ (- ovendline ovstartline) 2)))
+ (line (line-number-at-pos))
+ (winstart (window-start))
+ (winend (window-end))
+ newstart newend)
+ (setq pt (point-at-bol))
+ (setq newstart (minimap-line-to-pos (- line ovheight)))
+ ;; Perform recentering
+ (minimap-recenter line ovheight)
+ ;; Set new position in main buffer and redisplay
+ (with-selected-window (get-buffer-window (buffer-base-buffer))
+ (goto-char pt)
+ (set-window-start nil newstart)
+ (redisplay t)
+ (setq newend (window-end)))
+ (when (eq minimap-recenter-type 'free)
+ (while (> newend winend)
+ (scroll-up 5)
+ (redisplay t)
+ (setq winend (window-end))))
+ (move-overlay minimap-active-overlay newstart newend)))
+
+(defun minimap-line-to-pos (line)
+ "Return point position of line number LINE."
+ (save-excursion
+ (goto-char 1)
+ (if (eq selective-display t)
+ (re-search-forward "[\n\C-m]" nil 'end (1- line))
+ (forward-line (1- line)))
+ (point)))
+
+(defun minimap-recenter (middle height)
+ "Recenter the minimap according to `minimap-recenter-type'.
+MIDDLE is the line number in the middle of the active region.
+HEIGHT is the number of lines from MIDDLE to begin/end of the
+active region."
+ (cond
+ ;; Relative recentering
+ ((eq minimap-recenter-type 'relative)
+ (let* ((maxlines (line-number-at-pos (point-max)))
+ percentage relpos newline start numlines)
+ (setq numlines (count-lines (window-start) (window-end)))
+ (setq percentage (/ (float middle) (float maxlines)))
+ (setq newline (ceiling (* percentage numlines)))
+ (setq start (minimap-line-to-pos
+ (- middle height
+ (floor (* percentage
+ (- numlines height height))))))
+ (or (> start (point-min))
+ (setq start (point-min)))
+ ;; If (point-max) already visible, don't go further
+ (if (and (> start (window-start))
+ (with-selected-window (get-buffer-window (buffer-base-buffer))
+ (= (point-max) (window-end))))
+ (save-excursion
+ (goto-char (point-max))
+ (recenter -1))
+ (unless (and (> start (window-start))
+ (= (point-max) (window-end)))
+ (set-window-start nil start)))))
+ ;; Middle recentering
+ ((eq minimap-recenter-type 'middle)
+ (let ((start (- middle height
+ (floor (* 0.5
+ (- minimap-numlines height height))))))
+ (if (< start 1)
+ (progn
+ ;; Hack: Emacs cannot scroll down any further, so we fake
+ ;; it using an overlay. Otherwise, the active region
+ ;; would move to the top.
+ (overlay-put minimap-pointmin-overlay
+ 'display (concat
+ (make-string (abs start) 10)
+ (buffer-substring (point-min) (1+ (point-min)))))
+ (overlay-put minimap-pointmin-overlay
+ 'face `(:background ,(face-background 'default)))
+ (overlay-put minimap-pointmin-overlay
+ 'priority 10)
+ (setq start 1))
+ (overlay-put minimap-pointmin-overlay 'display "")
+ (overlay-put minimap-pointmin-overlay 'face nil))
+ (set-window-start nil (minimap-line-to-pos start))))
+ ;; Free recentering
+ ((eq minimap-recenter-type 'free)
+ (let ((newstart (minimap-line-to-pos (- middle height)))
+ (winstart (window-start)))
+ (while (< newstart winstart)
+ (scroll-down 5)
+ (redisplay t)
+ (setq winstart (window-start)))))))
+
+;;; Minimap minor mode
+
+ (defvar minimap-sb-mode-map (make-sparse-keymap)
+ "Keymap used by `minimap-sb-mode'.")
+
+(define-key minimap-sb-mode-map [down-mouse-1] 'minimap-move-overlay-mouse)
+(define-key minimap-sb-mode-map [down-mouse-2] 'minimap-move-overlay-mouse)
+(define-key minimap-sb-mode-map [down-mouse-3] 'minimap-move-overlay-mouse)
+
+(define-minor-mode minimap-sb-mode
+ "Minor mode for minimap sidebar."
+ nil "minimap" minimap-sb-mode-map)
+
+;;; Sync minimap with modes which create/delete overlays.
+
+(defun minimap-sync-overlays ()
+ "Synchronize overlays between base and minimap buffer.
+Apply semantic overlays or face enlargement if necessary."
+ (interactive)
+ ;; Get overlays and Semantic status from base buffer.
+ (when (and minimap-mode
+ (minimap-active-current-buffer-p))
+ (with-current-buffer minimap-active-buffer
+ (let ((baseov (overlays-in (point-min) (point-max)))
+ (semantic (and (boundp 'semantic-version)
+ (semantic-active-p)))
+ ov props p)
+ ;; Apply overlays to minimap.
+ (with-current-buffer minimap-buffer-name
+ ;; Delete overlays (but keep our own).
+ (let ((ovs (overlays-in (point-min) (point-max))))
+ (dolist (ov ovs)
+ (unless (member ov (list minimap-pointmin-overlay
+ minimap-base-overlay
+ minimap-active-overlay))
+ (delete-overlay ov))))
+ (while baseov
+ (when (and (eq (overlay-buffer (car baseov)) minimap-active-buffer)
+ (setq props (minimap-get-sync-properties (car baseov))))
+ (setq ov (make-overlay (overlay-start (car baseov))
+ (overlay-end (car baseov))))
+ (while (setq p (car props))
+ (overlay-put ov (car p) (cadr p))
+ (setq props (cdr props))))
+ (setq baseov (cdr baseov)))
+ (move-overlay minimap-pointmin-overlay (point-min) (1+ (point-min)))
+ ;; Re-apply font overlay
+ (move-overlay minimap-base-overlay (point-min) (point-max)))
+ ;; Face enlargement
+ (when (and font-lock-mode
+ (or (eq minimap-enlarge-certain-faces 'always)
+ (and (eq minimap-enlarge-certain-faces 'as-fallback)
+ (or (not minimap-display-semantic-overlays)
+ (not semantic)))))
+ (when (eq font-lock-support-mode 'jit-lock-mode)
+ (condition-case nil
+ (jit-lock-fontify-now)
+ (error nil)))
+ (minimap-enlarge-faces))
+ ;; Semantic overlays
+ (when (and semantic
+ minimap-display-semantic-overlays)
+ (minimap-apply-semantic-overlays t))))))
+
+(defun minimap-get-sync-properties (ov)
+ "Get properties from overlay OV which should be synced.
+You can specify those properties with
+`minimap-sync-overlay-properties'."
+ (let ((syncprops minimap-sync-overlay-properties))
+ (when minimap-tag-only
+ (setq syncprops (delq 'face syncprops)))
+ (delq nil
+ (mapcar
+ (lambda (p)
+ (let ((val (overlay-get ov p)))
+ (if val
+ (list p val)
+ nil)))
+ syncprops))))
+
+(defun minimap-enlarge-faces ()
+ "Apply default font to all faces in `minimap-normal-height-faces'."
+ (let ((pos (next-single-property-change (point-min) 'face))
+ next ov face)
+ (while pos
+ (setq face (get-text-property pos 'face))
+ (when (and face
+ (member face minimap-normal-height-faces))
+ (with-current-buffer minimap-buffer-name
+ (setq ov
+ (make-overlay pos
+ (setq pos (next-single-property-change pos 'face))))
+ (overlay-put ov 'face `(:family ,(face-font 'default)))
+ (overlay-put ov 'priority 5)))
+ (setq pos (next-single-property-change pos 'face)))))
+
+(defun minimap-apply-semantic-overlays (tags)
+ "Apply semantic overlays to the minimap.
+TAGS is the list of tags. If it is t, fetch tags from buffer."
+ (when (and tags
+ minimap-mode)
+ (with-current-buffer minimap-active-buffer
+ (let (tag class ov ovnew)
+ (when (eq tags t)
+ (setq tags (semantic-fetch-tags)))
+ (while tags
+ (setq tag (car tags))
+ (setq class (semantic-tag-class tag))
+ (setq ov (semantic-tag-overlay tag))
+ (when (and (overlayp ov)
+ (or (eq class 'function)
+ (eq class 'type)
+ (eq class 'variable)))
+ (with-current-buffer minimap-buffer-name
+ (let* ((start (overlay-start ov))
+ (end (overlay-end ov))
+ (name (semantic-tag-name tag))
+ (lstart (line-number-at-pos start))
+ (lend (line-number-at-pos end)))
+ ;; First, remove old Semantic overlays.
+ (remove-overlays start end 'minimap-semantic t)
+ (if minimap-tag-only
+ ;; Now put the new ones.
+ (overlay-put
+ (setq ovnew (make-overlay start end))
+ 'face `(:background ,(face-background
+ (intern (format "minimap-semantic-%s-face"
+ (symbol-name class))))
+ :foreground
+ ,(face-background
+ (intern (format "minimap-semantic-%s-face"
+ (symbol-name class))))
+ ))
+ ;; Now put the new ones.
+ (overlay-put
+ (setq ovnew (make-overlay start end))
+ 'face `(:background ,(face-background
+ (intern (format "minimap-semantic-%s-face"
+ (symbol-name class)))))))
+ (overlay-put ovnew 'priority 4)
+ (when (and (eq class 'function)
+ (> (- lend lstart) 5))
+ (overlay-put ovnew 'priority 1)
+ (overlay-put ovnew 'minimap-semantic t)
+ (overlay-put (setq ovnew (make-overlay start (progn (goto-char start) (point-at-eol))))
+ 'display (make-string 200 ?\u203E))
+ (overlay-put ovnew 'minimap-semantic t)
+ (overlay-put ovnew 'face `(:foreground ,(face-foreground 'default) :overline nil))
+ (overlay-put ovnew 'priority 8)
+ (overlay-put (setq ovnew (make-overlay (progn (goto-char end) (point-at-bol)) end))
+ 'display (make-string 200 ?_))
+ (overlay-put ovnew 'face `(:foreground ,(face-foreground 'default)))
+ (overlay-put ovnew 'minimap-semantic t)
+ (overlay-put ovnew 'priority 8))
+ (setq start
+ (minimap-line-to-pos (/ (+ lstart lend) 2)))
+ (goto-char start)
+ (while (looking-at "^$")
+ (forward-line -1))
+ (setq start (point))
+ (setq end (progn (goto-char start) (point-at-eol)))
+ (setq ovnew (make-overlay start end))
+ (overlay-put ovnew 'face (format "minimap-semantic-%s-face"
+ (symbol-name class)))
+ (overlay-put ovnew 'display (concat " " name " "))
+ (overlay-put ovnew 'priority 7)
+ (overlay-put ovnew 'minimap-semantic t)
+
+
+ )))
+ (setq tags (cdr tags)))))))
+
+(provide 'minimap)
+
+;;; minimap.el ends here
diff --git a/lisp/neotree b/lisp/neotree
new file mode 160000
+Subproject 98fe21334affaffe2334bf7c987edaf1980d2d0
diff --git a/lisp/neotree.el b/lisp/neotree.el
new file mode 100644
index 0000000..0156cb9
--- /dev/null
+++ b/lisp/neotree.el
@@ -0,0 +1,2226 @@
+;;; neotree.el --- A tree plugin like NerdTree for Vim
+
+;; Copyright (C) 2014 jaypei
+
+;; Author: jaypei <jaypei97159@gmail.com>
+;; URL: https://github.com/jaypei/emacs-neotree
+;; Version: 0.5.1
+;; Package-Requires: ((cl-lib "0.5"))
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; To use this file, put something like the following in your
+;; ~/.emacs:
+;;
+;; (add-to-list 'load-path "/directory/containing/neotree/")
+;; (require 'neotree)
+;;
+;; Type M-x neotree to start.
+;;
+;; To set options for NeoTree, type M-x customize, then select
+;; Applications, NeoTree.
+;;
+
+;;; Code:
+
+(require 'cl-lib)
+
+;;
+;; Constants
+;;
+
+(defconst neo-buffer-name " *NeoTree*"
+ "Name of the buffer where neotree shows directory contents.")
+
+(defconst neo-dir
+ (expand-file-name (if load-file-name
+ (file-name-directory load-file-name)
+ default-directory)))
+
+(defconst neo-header-height 5)
+
+(eval-and-compile
+
+ ;; Added in Emacs 24.3
+ (unless (fboundp 'user-error)
+ (defalias 'user-error 'error))
+
+ ;; Added in Emacs 24.3 (mirrors/emacs@b335efc3).
+ (unless (fboundp 'setq-local)
+ (defmacro setq-local (var val)
+ "Set variable VAR to value VAL in current buffer."
+ (list 'set (list 'make-local-variable (list 'quote var)) val)))
+
+ ;; Added in Emacs 24.3 (mirrors/emacs@b335efc3).
+ (unless (fboundp 'defvar-local)
+ (defmacro defvar-local (var val &optional docstring)
+ "Define VAR as a buffer-local variable with default value VAL.
+Like `defvar' but additionally marks the variable as being automatically
+buffer-local wherever it is set."
+ (declare (debug defvar) (doc-string 3))
+ (list 'progn (list 'defvar var val docstring)
+ (list 'make-variable-buffer-local (list 'quote var))))))
+
+;; Add autoload function for vc (#153).
+(autoload 'vc-responsible-backend "vc.elc")
+
+;;
+;; Macros
+;;
+
+(defmacro neo-util--to-bool (obj)
+ "If OBJ is non-nil, return t, else return nil."
+ `(and ,obj t))
+
+(defmacro neo-global--with-buffer (&rest body)
+ "Execute the forms in BODY with global NeoTree buffer."
+ (declare (indent 0) (debug t))
+ `(let ((neotree-buffer (neo-global--get-buffer)))
+ (unless (null neotree-buffer)
+ (with-current-buffer neotree-buffer
+ ,@body))))
+
+(defmacro neo-global--with-window (&rest body)
+ "Execute the forms in BODY with global NeoTree window."
+ (declare (indent 0) (debug t))
+ `(save-selected-window
+ (neo-global--select-window)
+ ,@body))
+
+(defmacro neo-global--when-window (&rest body)
+ "Execute the forms in BODY when selected window is NeoTree window."
+ (declare (indent 0) (debug t))
+ `(when (eq (selected-window) neo-global--window)
+ ,@body))
+
+(defmacro neo-global--switch-to-buffer ()
+ "Switch to NeoTree buffer."
+ `(let ((neotree-buffer (neo-global--get-buffer)))
+ (unless (null neotree-buffer)
+ (switch-to-buffer neotree-buffer))))
+
+(defmacro neo-buffer--with-editing-buffer (&rest body)
+ "Execute BODY in neotree buffer without read-only restriction."
+ `(let (rlt)
+ (neo-global--with-buffer
+ (setq buffer-read-only nil)
+ (setq rlt (progn ,@body))
+ (setq buffer-read-only t))
+ rlt))
+
+(defmacro neo-buffer--with-resizable-window (&rest body)
+ "Execute BODY in neotree window without `window-size-fixed' restriction."
+ `(let (rlt)
+ (neo-global--with-buffer
+ (neo-buffer--unlock-width))
+ (setq rlt (progn ,@body))
+ (neo-global--with-buffer
+ (neo-buffer--lock-width))
+ rlt))
+
+(defmacro neotree-make-executor (&rest fn-form)
+ "Make an open event handler, FN-FORM is event handler form."
+ (let* ((get-args-fn
+ (lambda (sym) (or (plist-get fn-form sym) (lambda (&rest _)))))
+ (file-fn (funcall get-args-fn :file-fn))
+ (dir-fn (funcall get-args-fn :dir-fn)))
+ `(lambda (&optional arg)
+ (interactive "P")
+ (neo-global--select-window)
+ (neo-buffer--execute arg ,file-fn ,dir-fn))))
+
+
+;;
+;; Customization
+;;
+
+(defgroup neotree nil
+ "Options for neotree."
+ :prefix "neo-"
+ :group 'files)
+
+(defgroup neotree-vc-options nil
+ "Neotree-VC customizations."
+ :prefix "neo-vc-"
+ :group 'neotree
+ :link '(info-link "(neotree)Configuration"))
+
+(defgroup neotree-confirmations nil
+ "Neotree confirmation customizations."
+ :prefix "neo-confirm-"
+ :group 'neotree)
+
+(defcustom neo-window-position 'left
+ "*The position of NeoTree window."
+ :group 'neotree
+ :type '(choice (const left)
+ (const right)))
+
+(defcustom neo-display-action '(neo-default-display-fn)
+ "*Action to use for displaying NeoTree window.
+If you change the action so it doesn't use
+`neo-default-display-fn', then other variables such as
+`neo-window-position' won't be respected when opening NeoTree
+window."
+ :type 'sexp
+ :group 'neotree)
+
+(defcustom neo-create-file-auto-open nil
+ "*If non-nil, the file will auto open when created."
+ :type 'boolean
+ :group 'neotree)
+
+(defcustom neo-banner-message nil
+ "*The banner message of neotree window."
+ :type 'string
+ :group 'neotree)
+
+(defcustom neo-show-updir-line t
+ "*If non-nil, show the updir line (..)."
+ :type 'boolean
+ :group 'neotree)
+
+(defcustom neo-show-slash-for-folder t
+ "*If non-nil, show the slash at the end of folder (folder/)"
+ :type 'boolean
+ :group 'neotree)
+
+(defcustom neo-reset-size-on-open nil
+ "*If non-nil, the width of the noetree window will be reseted every time a file is open."
+ :type 'boolean
+ :group 'neotree)
+
+(defcustom neo-theme 'classic
+ "*The tree style to display.
+`classic' use icon to display, it only it suitable for GUI mode.
+`ascii' is the simplest style, it will use +/- to display the fold state,
+it suitable for terminal.
+`arrow' use unicode arrow.
+`nerd' use the nerdtree indentation mode and arrow."
+ :group 'neotree
+ :type '(choice (const classic)
+ (const ascii)
+ (const arrow)
+ (const icons)
+ (const nerd)))
+
+(defcustom neo-mode-line-type 'neotree
+ "*The mode-line type to display, `default' is a non-modified mode-line, \
+`neotree' is a compact mode-line that shows useful information about the
+ current node like the parent directory and the number of nodes,
+`custom' uses the format stored in `neo-mode-line-custom-format',
+`none' hide the mode-line."
+ :group 'neotree
+ :type '(choice (const default)
+ (const neotree)
+ (const custom)
+ (const none)))
+
+(defcustom neo-mode-line-custom-format nil
+ "*If `neo-mode-line-type' is set to `custom', this variable specifiy \
+the mode-line format."
+ :type 'sexp
+ :group 'neotree)
+
+(defcustom neo-smart-open nil
+ "*If non-nil, every time when the neotree window is opened, it will try to find current file and jump to node."
+ :type 'boolean
+ :group 'neotree)
+
+(defcustom neo-show-hidden-files nil
+ "*If non-nil, the hidden files are shown by default."
+ :type 'boolean
+ :group 'neotree)
+
+(defcustom neo-autorefresh nil
+ "*If non-nil, the neotree buffer will auto refresh."
+ :type 'boolean
+ :group 'neotree)
+
+(defcustom neo-window-width 25
+ "*Specifies the width of the NeoTree window."
+ :type 'integer
+ :group 'neotree)
+
+(defcustom neo-window-fixed-size t
+ "*If the neotree windows is fixed, it won't be resize when rebalance windows."
+ :type 'boolean
+ :group 'neotree)
+
+(defcustom neo-keymap-style 'default
+ "*The default keybindings for neotree-mode-map."
+ :group 'neotree
+ :type '(choice (const default)
+ (const concise)))
+
+(defcustom neo-cwd-line-style 'text
+ "*The default header style."
+ :group 'neotree
+ :type '(choice (const text)
+ (const button)))
+
+(defcustom neo-help-echo-style 'default
+ "The message NeoTree displays when the mouse moves onto nodes.
+`default' means the node name is displayed if it has a
+width (including the indent) larger than `neo-window-width', and
+`none' means NeoTree doesn't display any messages."
+ :group 'neotree
+ :type '(choice (const default)
+ (const none)))
+
+(defcustom neo-click-changes-root nil
+ "*If non-nil, clicking on a directory will change the current root to the directory."
+ :type 'boolean
+ :group 'neotree)
+
+(defcustom neo-auto-indent-point nil
+ "*If non-nil the point is autmotically put on the first letter of a node."
+ :type 'boolean
+ :group 'neotree)
+
+(defcustom neo-hidden-regexp-list
+ '("^\\." "\\.pyc$" "~$" "^#.*#$" "\\.elc$" "\\.o$")
+ "*The regexp list matching hidden files."
+ :type '(repeat (choice regexp))
+ :group 'neotree)
+
+(defcustom neo-enter-hook nil
+ "Functions to run if enter node occured."
+ :type 'hook
+ :group 'neotree)
+
+(defcustom neo-after-create-hook nil
+ "Hooks called after creating the neotree buffer."
+ :type 'hook
+ :group 'neotree)
+
+(defcustom neo-vc-integration nil
+ "If non-nil, show VC status."
+ :group 'neotree-vc
+ :type '(set (const :tag "Use different faces" face)
+ (const :tag "Use different characters" char)))
+
+(defcustom neo-vc-state-char-alist
+ '((up-to-date . ?\s)
+ (edited . ?E)
+ (added . ?+)
+ (removed . ?-)
+ (missing . ?!)
+ (needs-merge . ?M)
+ (conflict . ?!)
+ (unlocked-changes . ?!)
+ (needs-update . ?U)
+ (ignored . ?\s)
+ (user . ?U)
+ (unregistered . ?\s)
+ (nil . ?\s))
+ "Alist of vc-states to indicator characters.
+This variable is used in `neo-vc-for-node' when
+`neo-vc-integration' contains `char'."
+ :group 'neotree-vc
+ :type '(alist :key-type symbol
+ :value-type character))
+
+(defcustom neo-confirm-change-root 'yes-or-no-p
+ "Confirmation asking for permission to change root if file was not found in root path."
+ :type '(choice (function-item :tag "Verbose" yes-or-no-p)
+ (function-item :tag "Succinct" y-or-n-p)
+ (function-item :tag "Off" off-p))
+ :group 'neotree-confirmations)
+
+(defcustom neo-confirm-create-file 'yes-or-no-p
+ "Confirmation asking whether *NeoTree* should create a file."
+ :type '(choice (function-item :tag "Verbose" yes-or-no-p)
+ (function-item :tag "Succinct" y-or-n-p)
+ (function-item :tag "Off" off-p))
+ :group 'neotree-confirmations)
+
+(defcustom neo-confirm-create-directory 'yes-or-no-p
+ "Confirmation asking whether *NeoTree* should create a directory."
+ :type '(choice (function-item :tag "Verbose" yes-or-no-p)
+ (function-item :tag "Succinct" y-or-n-p)
+ (function-item :tag "Off" off-p))
+ :group 'neotree-confirmations)
+
+(defcustom neo-confirm-delete-file 'yes-or-no-p
+ "Confirmation asking whether *NeoTree* should delete the file."
+ :type '(choice (function-item :tag "Verbose" yes-or-no-p)
+ (function-item :tag "Succinct" y-or-n-p)
+ (function-item :tag "Off" off-p))
+ :group 'neotree-confirmations)
+
+(defcustom neo-confirm-delete-directory-recursively 'yes-or-no-p
+ "Confirmation asking whether the directory should be deleted recursively."
+ :type '(choice (function-item :tag "Verbose" yes-or-no-p)
+ (function-item :tag "Succinct" y-or-n-p)
+ (function-item :tag "Off" off-p))
+ :group 'neotree-confirmations)
+
+(defcustom neo-confirm-kill-buffers-for-files-in-directory 'yes-or-no-p
+ "Confirmation asking whether *NeoTree* should kill buffers for the directory in question."
+ :type '(choice (function-item :tag "Verbose" yes-or-no-p)
+ (function-item :tag "Succinct" y-or-n-p)
+ (function-item :tag "Off" off-p))
+ :group 'neotree-confirmations)
+
+(defcustom neo-toggle-window-keep-p nil
+ "If not nil, not switch to *NeoTree* buffer when executing `neotree-toggle'."
+ :type 'boolean
+ :group 'neotree)
+
+(defcustom neo-force-change-root t
+ "If not nil, do not prompt when switching root."
+ :type 'boolean
+ :group 'neotree)
+
+(defcustom neo-filepath-sort-function 'string<
+ "Function to be called when sorting neotree nodes."
+ :type '(symbol (const :tag "Normal" string<)
+ (const :tag "Sort Hidden at Bottom" neo-sort-hidden-last)
+ (function :tag "Other"))
+ :group 'neotree)
+
+(defcustom neo-default-system-application "xdg-open"
+ "*Name of the application that is used to open a file under point.
+By default it is xdg-open."
+ :type 'string
+ :group 'neotree)
+
+(defcustom neo-hide-cursor nil
+ "If not nil, hide cursor in NeoTree buffer and turn on line higlight."
+ :type 'boolean
+ :group 'neotree)
+
+;;
+;; Faces
+;;
+
+(defface neo-banner-face
+ '((((background dark)) (:foreground "lightblue" :weight bold))
+ (t (:foreground "DarkMagenta")))
+ "*Face used for the banner in neotree buffer."
+ :group 'neotree :group 'font-lock-highlighting-faces)
+(defvar neo-banner-face 'neo-banner-face)
+
+(defface neo-header-face
+ '((((background dark)) (:foreground "White"))
+ (t (:foreground "DarkMagenta")))
+ "*Face used for the header in neotree buffer."
+ :group 'neotree :group 'font-lock-highlighting-faces)
+(defvar neo-header-face 'neo-header-face)
+
+(defface neo-root-dir-face
+ '((((background dark)) (:foreground "lightblue" :weight bold))
+ (t (:foreground "DarkMagenta")))
+ "*Face used for the root dir in neotree buffer."
+ :group 'neotree :group 'font-lock-highlighting-faces)
+(defvar neo-root-dir-face 'neo-root-dir-face)
+
+(defface neo-dir-link-face
+ '((((background dark)) (:foreground "DeepSkyBlue"))
+ (t (:foreground "MediumBlue")))
+ "*Face used for expand sign [+] in neotree buffer."
+ :group 'neotree :group 'font-lock-highlighting-faces)
+(defvar neo-dir-link-face 'neo-dir-link-face)
+
+(defface neo-file-link-face
+ '((((background dark)) (:foreground "White"))
+ (t (:foreground "Black")))
+ "*Face used for open file/dir in neotree buffer."
+ :group 'neotree :group 'font-lock-highlighting-faces)
+(defvar neo-file-link-face 'neo-file-link-face)
+
+(defface neo-button-face
+ '((t (:underline nil)))
+ "*Face used for open file/dir in neotree buffer."
+ :group 'neotree :group 'font-lock-highlighting-faces)
+(defvar neo-button-face 'neo-button-face)
+
+(defface neo-expand-btn-face
+ '((((background dark)) (:foreground "SkyBlue"))
+ (t (:foreground "DarkCyan")))
+ "*Face used for open file/dir in neotree buffer."
+ :group 'neotree :group 'font-lock-highlighting-faces)
+(defvar neo-expand-btn-face 'neo-expand-btn-face)
+
+(defface neo-vc-default-face
+ '((((background dark)) (:foreground "White"))
+ (t (:foreground "Black")))
+ "*Face used for unknown files in the neotree buffer.
+Used only when \(vc-state node\) returns nil."
+ :group 'neotree-vc :group 'font-lock-highlighting-faces)
+(defvar neo-vc-default-face 'neo-vc-default-face)
+
+(defface neo-vc-user-face
+ '((t (:foreground "Red" :slant italic)))
+ "*Face used for user-locked files in the neotree buffer."
+ :group 'neotree-vc :group 'font-lock-highlighting-faces)
+(defvar neo-vc-user-face 'neo-vc-user-face)
+
+(defface neo-vc-up-to-date-face
+ '((((background dark)) (:foreground "LightGray"))
+ (t (:foreground "DarkGray")))
+ "*Face used for vc-up-to-date files in the neotree buffer."
+ :group 'neotree-vc :group 'font-lock-highlighting-faces)
+(defvar neo-vc-up-to-date-face 'neo-vc-up-to-date-face)
+
+(defface neo-vc-edited-face
+ '((((background dark)) (:foreground "Magenta"))
+ (t (:foreground "DarkMagenta")))
+ "*Face used for vc-edited files in the neotree buffer."
+ :group 'neotree-vc :group 'font-lock-highlighting-faces)
+(defvar neo-vc-edited-face 'neo-vc-edited-face)
+
+(defface neo-vc-needs-update-face
+ '((t (:underline t)))
+ "*Face used for vc-needs-update files in the neotree buffer."
+ :group 'neotree-vc :group 'font-lock-highlighting-faces)
+(defvar neo-vc-needs-update-face 'neo-vc-needs-update-face)
+
+(defface neo-vc-needs-merge-face
+ '((((background dark)) (:foreground "Red1"))
+ (t (:foreground "Red3")))
+ "*Face used for vc-needs-merge files in the neotree buffer."
+ :group 'neotree-vc :group 'font-lock-highlighting-faces)
+(defvar neo-vc-needs-merge-face 'neo-vc-needs-merge-face)
+
+(defface neo-vc-unlocked-changes-face
+ '((t (:foreground "Red" :background "Blue")))
+ "*Face used for vc-unlocked-changes files in the neotree buffer."
+ :group 'neotree-vc :group 'font-lock-highlighting-faces)
+(defvar neo-vc-unlocked-changes-face 'neo-vc-unlocked-changes-face)
+
+(defface neo-vc-added-face
+ '((((background dark)) (:foreground "LightGreen"))
+ (t (:foreground "DarkGreen")))
+ "*Face used for vc-added files in the neotree buffer."
+ :group 'neotree-vc :group 'font-lock-highlighting-faces)
+(defvar neo-vc-added-face 'neo-vc-added-face)
+
+(defface neo-vc-removed-face
+ '((t (:strike-through t)))
+ "*Face used for vc-removed files in the neotree buffer."
+ :group 'neotree-vc :group 'font-lock-highlighting-faces)
+(defvar neo-vc-removed-face 'neo-vc-removed-face)
+
+(defface neo-vc-conflict-face
+ '((((background dark)) (:foreground "Red1"))
+ (t (:foreground "Red3")))
+ "*Face used for vc-conflict files in the neotree buffer."
+ :group 'neotree-vc :group 'font-lock-highlighting-faces)
+(defvar neo-vc-conflict-face 'neo-vc-conflict-face)
+
+(defface neo-vc-missing-face
+ '((((background dark)) (:foreground "Red1"))
+ (t (:foreground "Red3")))
+ "*Face used for vc-missing files in the neotree buffer."
+ :group 'neotree-vc :group 'font-lock-highlighting-faces)
+(defvar neo-vc-missing-face 'neo-vc-missing-face)
+
+(defface neo-vc-ignored-face
+ '((((background dark)) (:foreground "DarkGrey"))
+ (t (:foreground "LightGray")))
+ "*Face used for vc-ignored files in the neotree buffer."
+ :group 'neotree-vc :group 'font-lock-highlighting-faces)
+(defvar neo-vc-ignored-face 'neo-vc-ignored-face)
+
+(defface neo-vc-unregistered-face
+ nil
+ "*Face used for vc-unregistered files in the neotree buffer."
+ :group 'neotree-vc :group 'font-lock-highlighting-faces)
+(defvar neo-vc-unregistered-face 'neo-vc-unregistered-face)
+
+;;
+;; Variables
+;;
+
+(defvar neo-global--buffer nil)
+
+(defvar neo-global--window nil)
+
+(defvar neo-global--autorefresh-timer nil)
+
+(defvar neo-mode-line-format
+ (list
+ '(:eval
+ (let* ((fname (neo-buffer--get-filename-current-line))
+ (current (if fname fname neo-buffer--start-node))
+ (parent (if fname (file-name-directory current) current))
+ (nodes (neo-buffer--get-nodes parent))
+ (dirs (car nodes))
+ (files (cdr nodes))
+ (ndirs (length dirs))
+ (nfiles (length files))
+ (index
+ (when fname
+ (1+ (if (file-directory-p current)
+ (neo-buffer--get-node-index current dirs)
+ (+ ndirs (neo-buffer--get-node-index current files)))))))
+ (neo-mode-line--compute-format parent index ndirs nfiles))))
+ "Neotree mode-line displaying information on the current node.
+This mode-line format is used if `neo-mode-line-type' is set to `neotree'")
+
+(defvar-local neo-buffer--start-node nil
+ "Start node(i.e. directory) for the window.")
+
+(defvar-local neo-buffer--start-line nil
+ "Index of the start line of the root.")
+
+(defvar-local neo-buffer--cursor-pos (cons nil 1)
+ "To save the cursor position.
+The car of the pair will store fullpath, and cdr will store line number.")
+
+(defvar-local neo-buffer--last-window-pos (cons nil 1)
+ "To save the scroll position for NeoTree window.")
+
+(defvar-local neo-buffer--show-hidden-file-p nil
+ "Show hidden nodes in tree.")
+
+(defvar-local neo-buffer--expanded-node-list nil
+ "A list of expanded dir nodes.")
+
+(defvar-local neo-buffer--node-list nil
+ "The model of current NeoTree buffer.")
+
+(defvar-local neo-buffer--node-list-1 nil
+ "The model of current NeoTree buffer (temp).")
+
+;;
+;; Major mode definitions
+;;
+
+(defvar neotree-file-button-keymap
+ (let ((map (make-sparse-keymap)))
+ (define-key map [mouse-2]
+ (neotree-make-executor
+ :file-fn 'neo-open-file))
+ map)
+ "Keymap for file-node button.")
+
+(defvar neotree-dir-button-keymap
+ (let ((map (make-sparse-keymap)))
+ (define-key map [mouse-2]
+ (neotree-make-executor :dir-fn 'neo-open-dir))
+ map)
+ "Keymap for dir-node button.")
+
+(defvar neotree-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map (kbd "TAB") (neotree-make-executor
+ :dir-fn 'neo-open-dir))
+ (define-key map (kbd "RET") (neotree-make-executor
+ :file-fn 'neo-open-file
+ :dir-fn 'neo-open-dir))
+ (define-key map (kbd "|") (neotree-make-executor
+ :file-fn 'neo-open-file-vertical-split))
+ (define-key map (kbd "-") (neotree-make-executor
+ :file-fn 'neo-open-file-horizontal-split))
+ (define-key map (kbd "a") (neotree-make-executor
+ :file-fn 'neo-open-file-ace-window))
+ (define-key map (kbd "d") (neotree-make-executor
+ :dir-fn 'neo-open-dired))
+ (define-key map (kbd "O") (neotree-make-executor
+ :dir-fn 'neo-open-dir-recursive))
+ (define-key map (kbd "SPC") 'neotree-quick-look)
+ (define-key map (kbd "g") 'neotree-refresh)
+ (define-key map (kbd "q") 'neotree-hide)
+ (define-key map (kbd "p") 'neotree-previous-line)
+ (define-key map (kbd "C-p") 'neotree-previous-line)
+ (define-key map (kbd "n") 'neotree-next-line)
+ (define-key map (kbd "C-n") 'neotree-next-line)
+ (define-key map (kbd "A") 'neotree-stretch-toggle)
+ (define-key map (kbd "U") 'neotree-select-up-node)
+ (define-key map (kbd "D") 'neotree-select-down-node)
+ (define-key map (kbd "H") 'neotree-hidden-file-toggle)
+ (define-key map (kbd "S") 'neotree-select-previous-sibling-node)
+ (define-key map (kbd "s") 'neotree-select-next-sibling-node)
+ (define-key map (kbd "o") 'neotree-open-file-in-system-application)
+ (define-key map (kbd "C-x C-f") 'find-file-other-window)
+ (define-key map (kbd "C-x 1") 'neotree-empty-fn)
+ (define-key map (kbd "C-x 2") 'neotree-empty-fn)
+ (define-key map (kbd "C-x 3") 'neotree-empty-fn)
+ (define-key map (kbd "C-c C-f") 'find-file-other-window)
+ (define-key map (kbd "C-c C-c") 'neotree-change-root)
+ (define-key map (kbd "C-c c") 'neotree-dir)
+ (define-key map (kbd "C-c C-a") 'neotree-collapse-all)
+ (cond
+ ((eq neo-keymap-style 'default)
+ (define-key map (kbd "C-c C-n") 'neotree-create-node)
+ (define-key map (kbd "C-c C-d") 'neotree-delete-node)
+ (define-key map (kbd "C-c C-r") 'neotree-rename-node)
+ (define-key map (kbd "C-c C-p") 'neotree-copy-node))
+ ((eq neo-keymap-style 'concise)
+ (define-key map (kbd "C") 'neotree-change-root)
+ (define-key map (kbd "c") 'neotree-create-node)
+ (define-key map (kbd "+") 'neotree-create-node)
+ (define-key map (kbd "d") 'neotree-delete-node)
+ (define-key map (kbd "r") 'neotree-rename-node)
+ (define-key map (kbd "e") 'neotree-enter)))
+ map)
+ "Keymap for `neotree-mode'.")
+
+(define-derived-mode neotree-mode special-mode "NeoTree"
+ "A major mode for displaying the directory tree in text mode."
+ (setq indent-tabs-mode nil ; only spaces
+ buffer-read-only t ; read only
+ truncate-lines -1
+ neo-buffer--show-hidden-file-p neo-show-hidden-files)
+ (when neo-hide-cursor
+ (progn
+ (setq cursor-type nil)
+ (hl-line-mode +1)))
+ (pcase neo-mode-line-type
+ (`neotree
+ (setq-local mode-line-format neo-mode-line-format)
+ (add-hook 'post-command-hook 'force-mode-line-update nil t))
+ (`none (setq-local mode-line-format nil))
+ (`custom
+ (setq-local mode-line-format neo-mode-line-custom-format)
+ (add-hook 'post-command-hook 'force-mode-line-update nil t))
+ (_ nil))
+ ;; fix for electric-indent-mode
+ ;; for emacs 24.4
+ (if (fboundp 'electric-indent-local-mode)
+ (electric-indent-local-mode -1)
+ ;; for emacs 24.3 or less
+ (add-hook 'electric-indent-functions
+ (lambda (arg) 'no-indent) nil 'local))
+ (when neo-auto-indent-point
+ (add-hook 'post-command-hook 'neo-hook--node-first-letter nil t)))
+
+;;
+;; Global methods
+;;
+
+(defun neo-global--window-exists-p ()
+ "Return non-nil if neotree window exists."
+ (and (not (null (window-buffer neo-global--window)))
+ (eql (window-buffer neo-global--window) (neo-global--get-buffer))))
+
+(defun neo-global--select-window ()
+ "Select the NeoTree window."
+ (interactive)
+ (let ((window (neo-global--get-window t)))
+ (select-window window)))
+
+(defun neo-global--get-window (&optional auto-create-p)
+ "Return the neotree window if it exists, else return nil.
+But when the neotree window does not exist and AUTO-CREATE-P is non-nil,
+it will create the neotree window and return it."
+ (unless (neo-global--window-exists-p)
+ (setf neo-global--window nil))
+ (when (and (null neo-global--window)
+ auto-create-p)
+ (setq neo-global--window
+ (neo-global--create-window)))
+ neo-global--window)
+
+(defun neo-default-display-fn (buffer _alist)
+ "Display BUFFER to the left or right of the root window.
+The side is decided according to `neo-window-position'.
+The root window is the root window of the selected frame.
+_ALIST is ignored."
+ (let ((window-pos (if (eq neo-window-position 'left) 'left 'right)))
+ (display-buffer-in-side-window buffer `((side . ,window-pos)))))
+
+(defun neo-global--create-window ()
+ "Create global neotree window."
+ (let ((window nil)
+ (buffer (neo-global--get-buffer t)))
+ (setq window
+ (select-window
+ (display-buffer buffer neo-display-action)))
+ (neo-window--init window buffer)
+ (neo-global--attach)
+ (neo-global--reset-width)
+ window))
+
+(defun neo-global--get-buffer (&optional init-p)
+ "Return the global neotree buffer if it exists.
+If INIT-P is non-nil and global NeoTree buffer not exists, then create it."
+ (unless (equal (buffer-name neo-global--buffer)
+ neo-buffer-name)
+ (setf neo-global--buffer nil))
+ (when (and init-p
+ (null neo-global--buffer))
+ (save-window-excursion
+ (setq neo-global--buffer
+ (neo-buffer--create))))
+ neo-global--buffer)
+
+(defun neo-global--file-in-root-p (path)
+ "Return non-nil if PATH in root dir."
+ (neo-global--with-buffer
+ (and (not (null neo-buffer--start-node))
+ (neo-path--file-in-directory-p path neo-buffer--start-node))))
+
+(defun neo-global--alone-p ()
+ "Check whether the global neotree window is alone with some other window."
+ (let ((windows (window-list)))
+ (and (= (length windows)
+ 2)
+ (member neo-global--window windows))))
+
+(defun neo-global--do-autorefresh ()
+ "Do auto refresh."
+ (interactive)
+ (when (and neo-autorefresh (neo-global--window-exists-p)
+ (buffer-file-name))
+ (neotree-refresh t)))
+
+(defun neo-global--open ()
+ "Show the NeoTree window."
+ (let ((valid-start-node-p nil))
+ (neo-global--with-buffer
+ (setf valid-start-node-p (neo-buffer--valid-start-node-p)))
+ (if (not valid-start-node-p)
+ (neo-global--open-dir (neo-path--get-working-dir))
+ (neo-global--get-window t))))
+
+(defun neo-global--open-dir (path)
+ "Show the NeoTree window, and change root to PATH."
+ (neo-global--get-window t)
+ (neo-global--with-buffer
+ (neo-buffer--change-root path)))
+
+(defun neo-global--open-and-find (path)
+ "Quick select node which specified PATH in NeoTree."
+ (let ((npath path)
+ root-dir)
+ (when (null npath)
+ (throw 'invalid-path "Invalid path to select."))
+ (setq root-dir (if (file-directory-p npath)
+ npath (neo-path--updir npath)))
+ (when (or (not (neo-global--window-exists-p))
+ (not (neo-global--file-in-root-p npath)))
+ (neo-global--open-dir root-dir))
+ (neo-global--with-window
+ (neo-buffer--select-file-node npath t))))
+
+(defun neo-global--select-mru-window (arg)
+ "Create or find a window to select when open a file node.
+The description of ARG is in `neotree-enter'."
+ (when (eq (safe-length (window-list)) 1)
+ (neo-buffer--with-resizable-window
+ (split-window-horizontally)))
+ (when neo-reset-size-on-open
+ (neo-global--when-window
+ (neo-window--zoom 'minimize)))
+ ;; select target window
+ (cond
+ ;; select window with winum
+ ((and (integerp arg)
+ (bound-and-true-p winum-mode)
+ (fboundp 'winum-select-window-by-number))
+ (winum-select-window-by-number arg))
+ ;; select window with window numbering
+ ((and (integerp arg)
+ (boundp 'window-numbering-mode)
+ (symbol-value window-numbering-mode)
+ (fboundp 'select-window-by-number))
+ (select-window-by-number arg))
+ ;; open node in a new vertically split window
+ ((and (stringp arg) (string= arg "a")
+ (fboundp 'ace-select-window))
+ (ace-select-window))
+ ((and (stringp arg) (string= arg "|"))
+ (select-window (get-mru-window))
+ (split-window-right)
+ (windmove-right))
+ ;; open node in a new horizontally split window
+ ((and (stringp arg) (string= arg "-"))
+ (select-window (get-mru-window))
+ (split-window-below)
+ (windmove-down)))
+ ;; open node in last active window
+ (select-window (get-mru-window)))
+
+(defun neo-global--detach ()
+ "Detach the global neotree buffer."
+ (when neo-global--autorefresh-timer
+ (cancel-timer neo-global--autorefresh-timer))
+ (neo-global--with-buffer
+ (neo-buffer--unlock-width))
+ (setq neo-global--buffer nil)
+ (setq neo-global--window nil))
+
+(defun neo-global--attach ()
+ "Attach the global neotree buffer"
+ (when neo-global--autorefresh-timer
+ (cancel-timer neo-global--autorefresh-timer))
+ (when neo-autorefresh
+ (setq neo-global--autorefresh-timer
+ (run-with-idle-timer 2 10 'neo-global--do-autorefresh)))
+ (setq neo-global--buffer (get-buffer neo-buffer-name))
+ (setq neo-global--window (get-buffer-window
+ neo-global--buffer))
+ (neo-global--with-buffer
+ (neo-buffer--lock-width))
+ (run-hook-with-args 'neo-after-create-hook '(window)))
+
+(defun neo-global--set-window-width (width)
+ "Set neotree window width to WIDTH."
+ (neo-global--with-window
+ (neo-buffer--with-resizable-window
+ (neo-util--set-window-width (selected-window) width))))
+
+(defun neo-global--reset-width ()
+ "Set neotree window width to `neo-window-width'."
+ (neo-global--set-window-width neo-window-width))
+
+;;
+;; Advices
+;;
+
+(defadvice mouse-drag-vertical-line
+ (around neotree-drag-vertical-line (start-event) activate)
+ "Drag and drop is not affected by the lock."
+ (neo-buffer--with-resizable-window
+ ad-do-it))
+
+(defadvice balance-windows
+ (around neotree-balance-windows activate)
+ "Fix neotree inhibits balance-windows."
+ (if (neo-global--window-exists-p)
+ (let (old-width)
+ (neo-global--with-window
+ (setq old-width (window-width)))
+ (neo-buffer--with-resizable-window
+ ad-do-it)
+ (neo-global--with-window
+ (neo-global--set-window-width old-width)))
+ ad-do-it))
+
+(eval-after-load 'popwin
+ '(progn
+ (defadvice popwin:create-popup-window
+ (around neotree/popwin-popup-buffer activate)
+ (let ((neo-exists-p (neo-global--window-exists-p)))
+ (when neo-exists-p
+ (neo-global--detach))
+ ad-do-it
+ (when neo-exists-p
+ (neo-global--attach)
+ (neo-global--reset-width))))
+
+ (defadvice popwin:close-popup-window
+ (around neotree/popwin-close-popup-window activate)
+ (let ((neo-exists-p (neo-global--window-exists-p)))
+ (when neo-exists-p
+ (neo-global--detach))
+ ad-do-it
+ (when neo-exists-p
+ (neo-global--attach)
+ (neo-global--reset-width))))))
+
+;;
+;; Hooks
+;;
+
+(defun neo-hook--node-first-letter ()
+ "Move point to the first letter of the current node."
+ (when (or (eq this-command 'next-line)
+ (eq this-command 'previous-line))
+ (neo-point-auto-indent)))
+
+;;
+;; Util methods
+;;
+
+(defun neo-util--filter (condp lst)
+ "Apply CONDP to elements of LST keeping those that return non-nil.
+
+Example:
+ (neo-util--filter 'symbolp '(a \"b\" 3 d4))
+ => (a d4)
+
+This procedure does not work when CONDP is the `null' function."
+ (delq nil
+ (mapcar (lambda (x) (and (funcall condp x) x)) lst)))
+
+(defun neo-util--find (where which)
+ "Find element of the list WHERE matching predicate WHICH."
+ (catch 'found
+ (dolist (elt where)
+ (when (funcall which elt)
+ (throw 'found elt)))
+ nil))
+
+(defun neo-util--make-printable-string (string)
+ "Strip newline character from STRING, like 'Icon\n'."
+ (replace-regexp-in-string "\n" "" string))
+
+(defun neo-util--walk-dir (path)
+ "Return the subdirectories and subfiles of the PATH."
+ (let* ((full-path (neo-path--file-truename path)))
+ (condition-case nil
+ (directory-files
+ path 'full directory-files-no-dot-files-regexp)
+ ('file-error
+ (message "Walk directory %S failed." path)
+ nil))))
+
+(defun neo-util--hidden-path-filter (node)
+ "A filter function, if the NODE can not match each item in \
+`neo-hidden-regexp-list', return t."
+ (if (not neo-buffer--show-hidden-file-p)
+ (let ((shortname (neo-path--file-short-name node)))
+ (null (neo-util--filter
+ (lambda (x) (not (null (string-match-p x shortname))))
+ neo-hidden-regexp-list)))
+ node))
+
+(defun neo-str--trim-left (s)
+ "Remove whitespace at the beginning of S."
+ (if (string-match "\\`[ \t\n\r]+" s)
+ (replace-match "" t t s)
+ s))
+
+(defun neo-str--trim-right (s)
+ "Remove whitespace at the end of S."
+ (if (string-match "[ \t\n\r]+\\'" s)
+ (replace-match "" t t s)
+ s))
+
+(defun neo-str--trim (s)
+ "Remove whitespace at the beginning and end of S."
+ (neo-str--trim-left (neo-str--trim-right s)))
+
+(defun neo-path--expand-name (path &optional current-dir)
+ (expand-file-name (or (if (file-name-absolute-p path) path)
+ (let ((r-path path))
+ (setq r-path (substitute-in-file-name r-path))
+ (setq r-path (expand-file-name r-path current-dir))
+ r-path))))
+
+(defun neo-path--shorten (path len)
+ "Shorten a given PATH to a specified LEN.
+This is needed for paths, which are to long for the window to display
+completely. The function cuts of the first part of the path to remain
+the last folder (the current one)."
+ (let ((result
+ (if (> (length path) len)
+ (concat "<" (substring path (- (- len 2))))
+ path)))
+ (when result
+ (decode-coding-string result 'utf-8))))
+
+(defun neo-path--insert-chroot-button (label path face)
+ (insert-button
+ label
+ 'action '(lambda (x) (neotree-change-root))
+ 'follow-link t
+ 'face face
+ 'neo-full-path path))
+
+(defun neo-path--insert-header-buttonized (path)
+ "Shortens the PATH to (window-body-width) and displays any \
+visible remains as buttons that, when clicked, navigate to that
+parent directory."
+ (let* ((dirs (reverse (cl-maplist 'identity (reverse (split-string path "/" :omitnulls)))))
+ (last (car-safe (car-safe (last dirs)))))
+ (neo-path--insert-chroot-button "/" "/" 'neo-root-dir-face)
+ (dolist (dir dirs)
+ (if (string= (car dir) last)
+ (neo-buffer--insert-with-face last 'neo-root-dir-face)
+ (neo-path--insert-chroot-button
+ (concat (car dir) "/")
+ (apply 'neo-path--join (cons "/" (reverse dir)))
+ 'neo-root-dir-face))))
+ ;;shorten the line if need be
+ (when (> (current-column) (window-body-width))
+ (forward-char (- (window-body-width)))
+ (delete-region (point-at-bol) (point))
+ (let* ((button (button-at (point)))
+ (path (if button (overlay-get button 'neo-full-path) "/")))
+ (neo-path--insert-chroot-button "<" path 'neo-root-dir-face))
+ (end-of-line)))
+
+(defun neo-path--updir (path)
+ (let ((r-path (neo-path--expand-name path)))
+ (if (and (> (length r-path) 0)
+ (equal (substring r-path -1) "/"))
+ (setq r-path (substring r-path 0 -1)))
+ (if (eq (length r-path) 0)
+ (setq r-path "/"))
+ (directory-file-name
+ (file-name-directory r-path))))
+
+(defun neo-path--join (root &rest dirs)
+ "Joins a series of directories together with ROOT and DIRS.
+Like Python's os.path.join,
+ (neo-path--join \"/tmp\" \"a\" \"b\" \"c\") => /tmp/a/b/c ."
+ (or (if (not dirs) root)
+ (let ((tdir (car dirs))
+ (epath nil))
+ (setq epath
+ (or (if (equal tdir ".") root)
+ (if (equal tdir "..") (neo-path--updir root))
+ (neo-path--expand-name tdir root)))
+ (apply 'neo-path--join
+ epath
+ (cdr dirs)))))
+
+(defun neo-path--file-short-name (file)
+ "Base file/directory name by FILE.
+Taken from http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg01238.html"
+ (or (if (string= file "/") "/")
+ (neo-util--make-printable-string (file-name-nondirectory (directory-file-name file)))))
+
+(defun neo-path--file-truename (path)
+ (let ((rlt (file-truename path)))
+ (if (not (null rlt))
+ (progn
+ (if (and (file-directory-p rlt)
+ (> (length rlt) 0)
+ (not (equal (substring rlt -1) "/")))
+ (setq rlt (concat rlt "/")))
+ rlt)
+ nil)))
+
+(defun neo-path--has-subfile-p (dir)
+ "To determine whether a directory(DIR) contain files."
+ (and (file-exists-p dir)
+ (file-directory-p dir)
+ (neo-util--walk-dir dir)
+ t))
+
+(defun neo-path--match-path-directory (path)
+ (let ((true-path (neo-path--file-truename path))
+ (rlt-path nil))
+ (setq rlt-path
+ (catch 'rlt
+ (if (file-directory-p true-path)
+ (throw 'rlt true-path))
+ (setq true-path
+ (file-name-directory true-path))
+ (if (file-directory-p true-path)
+ (throw 'rlt true-path))))
+ (if (not (null rlt-path))
+ (setq rlt-path (neo-path--join "." rlt-path "./")))
+ rlt-path))
+
+(defun neo-path--get-working-dir ()
+ "Return a directory name of the current buffer."
+ (file-name-as-directory (file-truename default-directory)))
+
+(defun neo-path--strip (path)
+ "Remove whitespace at the end of PATH."
+ (let* ((rlt (neo-str--trim path))
+ (pos (string-match "[\\\\/]+\\'" rlt)))
+ (when pos
+ (setq rlt (replace-match "" t t rlt))
+ (when (eq (length rlt) 0)
+ (setq rlt "/")))
+ rlt))
+
+(defun neo-path--path-equal-p (path1 path2)
+ "Return non-nil if pathes PATH1 and PATH2 are the same path."
+ (string-equal (neo-path--strip path1)
+ (neo-path--strip path2)))
+
+(defun neo-path--file-equal-p (file1 file2)
+ "Return non-nil if files FILE1 and FILE2 name the same file.
+If FILE1 or FILE2 does not exist, the return value is unspecified."
+ (unless (or (null file1)
+ (null file2))
+ (let ((nfile1 (neo-path--strip file1))
+ (nfile2 (neo-path--strip file2)))
+ (file-equal-p nfile1 nfile2))))
+
+(defun neo-path--file-in-directory-p (file dir)
+ "Return non-nil if FILE is in DIR or a subdirectory of DIR.
+A directory is considered to be \"in\" itself.
+Return nil if DIR is not an existing directory."
+ (let ((nfile (neo-path--strip file))
+ (ndir (neo-path--strip dir)))
+ (setq ndir (concat ndir "/"))
+ (file-in-directory-p nfile ndir)))
+
+(defun neo-util--kill-buffers-for-path (path)
+ "Kill all buffers for files in PATH."
+ (let ((buffer (find-buffer-visiting path)))
+ (when buffer
+ (kill-buffer buffer)))
+ (dolist (filename (directory-files path t directory-files-no-dot-files-regexp))
+ (let ((buffer (find-buffer-visiting filename)))
+ (when buffer
+ (kill-buffer buffer))
+ (when (and
+ (file-directory-p filename)
+ (neo-path--has-subfile-p filename))
+ (neo-util--kill-buffers-for-path filename)))))
+
+(defun neo-util--set-window-width (window n)
+ "Make WINDOW N columns width."
+ (let ((w (max n window-min-width)))
+ (unless (null window)
+ (if (> (window-width) w)
+ (shrink-window-horizontally (- (window-width) w))
+ (if (< (window-width) w)
+ (enlarge-window-horizontally (- w (window-width))))))))
+
+(defun neo-point-auto-indent ()
+ "Put the point on the first letter of the current node."
+ (when (neo-buffer--get-filename-current-line)
+ (beginning-of-line 1)
+ (re-search-forward "[^-\s+]" (line-end-position 1) t)
+ (backward-char 1)))
+
+(defun off-p (msg)
+ "Returns true regardless of message value in the argument."
+ t)
+
+(defun neo-sort-hidden-last (x y)
+ "Sort normally but with hidden files last."
+ (let ((x-hidden (neo-filepath-hidden-p x))
+ (y-hidden (neo-filepath-hidden-p y)))
+ (cond
+ ((and x-hidden (not y-hidden))
+ nil)
+ ((and (not x-hidden) y-hidden)
+ t)
+ (t
+ (string< x y)))))
+
+(defun neo-filepath-hidden-p (node)
+ "Return whether or not node is a hidden path."
+ (let ((shortname (neo-path--file-short-name node)))
+ (neo-util--filter
+ (lambda (x) (not (null (string-match-p x shortname))))
+ neo-hidden-regexp-list)))
+
+(defun neo-get-unsaved-buffers-from-projectile ()
+ "Return list of unsaved buffers from projectile buffers."
+ (interactive)
+ (let ((rlist '())
+ (rtag t))
+ (condition-case nil
+ (projectile-project-buffers)
+ (error (setq rtag nil)))
+ (when (and rtag (fboundp 'projectile-project-buffers))
+ (dolist (buf (projectile-project-buffers))
+ (with-current-buffer buf
+ (if (and (buffer-modified-p) buffer-file-name)
+ (setq rlist (cons (buffer-file-name) rlist))
+ ))))
+ rlist))
+
+;;
+;; Buffer methods
+;;
+
+(defun neo-buffer--newline-and-begin ()
+ "Insert new line."
+ (newline)
+ (beginning-of-line))
+
+(defun neo-buffer--get-icon (name)
+ "Get image by NAME."
+ (let ((icon-path (neo-path--join neo-dir "icons"))
+ image)
+ (setq image (create-image
+ (neo-path--join icon-path (concat name ".xpm"))
+ 'xpm nil :ascent 'center :mask '(heuristic t)))
+ image))
+
+(defun neo-buffer--insert-fold-symbol (name &optional node-name)
+ "Write icon by NAME, the icon style affected by neo-theme.
+`open' write opened folder icon.
+`close' write closed folder icon.
+`leaf' write leaf icon.
+Optional NODE-NAME is used for the `icons' theme"
+ (let ((n-insert-image (lambda (n)
+ (insert-image (neo-buffer--get-icon n))))
+ (n-insert-symbol (lambda (n)
+ (neo-buffer--insert-with-face
+ n 'neo-expand-btn-face))))
+ (cond
+ ((and (display-graphic-p) (equal neo-theme 'classic))
+ (or (and (equal name 'open) (funcall n-insert-image "open"))
+ (and (equal name 'close) (funcall n-insert-image "close"))
+ (and (equal name 'leaf) (funcall n-insert-image "leaf"))))
+ ((equal neo-theme 'arrow)
+ (or (and (equal name 'open) (funcall n-insert-symbol "▾"))
+ (and (equal name 'close) (funcall n-insert-symbol "▸"))))
+ ((equal neo-theme 'nerd)
+ (or (and (equal name 'open) (funcall n-insert-symbol "▾ "))
+ (and (equal name 'close) (funcall n-insert-symbol "▸ "))
+ (and (equal name 'leaf) (funcall n-insert-symbol " "))))
+ ((and (display-graphic-p) (equal neo-theme 'icons))
+ (unless (require 'all-the-icons nil 'noerror)
+ (error "Package `all-the-icons' isn't installed"))
+ (setq-local tab-width 1)
+ (or (and (equal name 'open) (insert (all-the-icons-icon-for-dir-with-chevron (directory-file-name node-name) "down")))
+ (and (equal name 'close) (insert (all-the-icons-icon-for-dir-with-chevron (directory-file-name node-name) "right")))
+ (and (equal name 'leaf) (insert (format "\t\t\t%s\t" (all-the-icons-icon-for-file node-name))))))
+ (t
+ (or (and (equal name 'open) (funcall n-insert-symbol "- "))
+ (and (equal name 'close) (funcall n-insert-symbol "+ ")))))))
+
+(defun neo-buffer--save-cursor-pos (&optional node-path line-pos)
+ "Save cursor position.
+If NODE-PATH and LINE-POS is nil, it will be save the current line node position."
+ (let ((cur-node-path nil)
+ (cur-line-pos nil)
+ (ws-wind (selected-window))
+ (ws-pos (window-start)))
+ (setq cur-node-path (if node-path
+ node-path
+ (neo-buffer--get-filename-current-line)))
+ (setq cur-line-pos (if line-pos
+ line-pos
+ (line-number-at-pos)))
+ (setq neo-buffer--cursor-pos (cons cur-node-path cur-line-pos))
+ (setq neo-buffer--last-window-pos (cons ws-wind ws-pos))))
+
+(defun neo-buffer--goto-cursor-pos ()
+ "Jump to saved cursor position."
+ (let ((line-pos nil)
+ (node (car neo-buffer--cursor-pos))
+ (line-pos (cdr neo-buffer--cursor-pos))
+ (ws-wind (car neo-buffer--last-window-pos))
+ (ws-pos (cdr neo-buffer--last-window-pos)))
+ (catch 'line-pos-founded
+ (unless (null node)
+ (setq line-pos 0)
+ (mapc
+ (lambda (x)
+ (setq line-pos (1+ line-pos))
+ (unless (null x)
+ (when (neo-path--path-equal-p x node)
+ (throw 'line-pos-founded line-pos))))
+ neo-buffer--node-list))
+ (setq line-pos (cdr neo-buffer--cursor-pos))
+ (throw 'line-pos-founded line-pos))
+ ;; goto line
+ (goto-char (point-min))
+ (neo-buffer--forward-line (1- line-pos))
+ ;; scroll window
+ (when (equal (selected-window) ws-wind)
+ (set-window-start ws-wind ws-pos t))))
+
+(defun neo-buffer--node-list-clear ()
+ "Clear node list."
+ (setq neo-buffer--node-list nil))
+
+(defun neo-buffer--node-list-set (line-num path)
+ "Set value in node list.
+LINE-NUM is the index of node list.
+PATH is value."
+ (let ((node-list-length (length neo-buffer--node-list))
+ (node-index line-num))
+ (when (null node-index)
+ (setq node-index (line-number-at-pos)))
+ (when (< node-list-length node-index)
+ (setq neo-buffer--node-list
+ (vconcat neo-buffer--node-list
+ (make-vector (- node-index node-list-length) nil))))
+ (aset neo-buffer--node-list (1- node-index) path))
+ neo-buffer--node-list)
+
+(defun neo-buffer--insert-with-face (content face)
+ (let ((pos-start (point)))
+ (insert content)
+ (set-text-properties pos-start
+ (point)
+ (list 'face face))))
+
+(defun neo-buffer--valid-start-node-p ()
+ (and (not (null neo-buffer--start-node))
+ (file-accessible-directory-p neo-buffer--start-node)))
+
+(defun neo-buffer--create ()
+ "Create and switch to NeoTree buffer."
+ (switch-to-buffer
+ (generate-new-buffer-name neo-buffer-name))
+ (neotree-mode)
+ ;; disable linum-mode
+ (when (and (boundp 'linum-mode)
+ (not (null linum-mode)))
+ (linum-mode -1))
+ ;; Use inside helm window in NeoTree
+ ;; Refs https://github.com/jaypei/emacs-neotree/issues/226
+ (setq-local helm-split-window-inside-p t)
+ (current-buffer))
+
+(defun neo-buffer--insert-banner ()
+ (unless (null neo-banner-message)
+ (let ((start (point)))
+ (insert neo-banner-message)
+ (set-text-properties start (point) '(face neo-banner-face)))
+ (neo-buffer--newline-and-begin)))
+
+(defun neo-buffer--insert-root-entry (node)
+ (neo-buffer--node-list-set nil node)
+ (cond ((eq neo-cwd-line-style 'button)
+ (neo-path--insert-header-buttonized node))
+ (t
+ (neo-buffer--insert-with-face (neo-path--shorten node (window-body-width))
+ 'neo-root-dir-face)))
+ (neo-buffer--newline-and-begin)
+ (when neo-show-updir-line
+ (neo-buffer--insert-fold-symbol 'close node)
+ (insert-button ".."
+ 'action '(lambda (x) (neotree-change-root))
+ 'follow-link t
+ 'face neo-dir-link-face
+ 'neo-full-path (neo-path--updir node))
+ (neo-buffer--newline-and-begin)))
+
+(defun neo-buffer--help-echo-message (node-name)
+ (cond
+ ((eq neo-help-echo-style 'default)
+ (if (<= (+ (current-column) (string-width node-name))
+ neo-window-width)
+ nil
+ node-name))
+ (t nil)))
+
+(defun neo-buffer--insert-dir-entry (node depth expanded)
+ (let ((node-short-name (neo-path--file-short-name node)))
+ (insert-char ?\s (* (- depth 1) 2)) ; indent
+ (when (memq 'char neo-vc-integration)
+ (insert-char ?\s 2))
+ (neo-buffer--insert-fold-symbol
+ (if expanded 'open 'close) node)
+ (insert-button (if neo-show-slash-for-folder (concat node-short-name "/") node-short-name)
+ 'follow-link t
+ 'face neo-dir-link-face
+ 'neo-full-path node
+ 'keymap neotree-dir-button-keymap
+ 'help-echo (neo-buffer--help-echo-message node-short-name))
+ (neo-buffer--node-list-set nil node)
+ (neo-buffer--newline-and-begin)))
+
+(defun neo-buffer--insert-file-entry (node depth)
+ (let ((node-short-name (neo-path--file-short-name node))
+ (vc (when neo-vc-integration (neo-vc-for-node node))))
+ (insert-char ?\s (* (- depth 1) 2)) ; indent
+ (when (memq 'char neo-vc-integration)
+ (insert-char (car vc))
+ (insert-char ?\s))
+ (neo-buffer--insert-fold-symbol 'leaf node-short-name)
+ (insert-button node-short-name
+ 'follow-link t
+ 'face (if (memq 'face neo-vc-integration)
+ (cdr vc)
+ neo-file-link-face)
+ 'neo-full-path node
+ 'keymap neotree-file-button-keymap
+ 'help-echo (neo-buffer--help-echo-message node-short-name))
+ (neo-buffer--node-list-set nil node)
+ (neo-buffer--newline-and-begin)))
+
+(defun neo-vc-for-node (node)
+ (let* ((backend (ignore-errors
+ (vc-responsible-backend node)))
+ (vc-state (when backend (vc-state node backend))))
+ (cons (cdr (assoc vc-state neo-vc-state-char-alist))
+ (cl-case vc-state
+ (up-to-date neo-vc-up-to-date-face)
+ (edited neo-vc-edited-face)
+ (needs-update neo-vc-needs-update-face)
+ (needs-merge neo-vc-needs-merge-face)
+ (unlocked-changes neo-vc-unlocked-changes-face)
+ (added neo-vc-added-face)
+ (removed neo-vc-removed-face)
+ (conflict neo-vc-conflict-face)
+ (missing neo-vc-missing-face)
+ (ignored neo-vc-ignored-face)
+ (unregistered neo-vc-unregistered-face)
+ (user neo-vc-user-face)
+ (otherwise neo-vc-default-face)))))
+
+(defun neo-buffer--get-nodes (path)
+ (let* ((nodes (neo-util--walk-dir path))
+ (comp neo-filepath-sort-function)
+ (nodes (neo-util--filter 'neo-util--hidden-path-filter nodes)))
+ (cons (sort (neo-util--filter 'file-directory-p nodes) comp)
+ (sort (neo-util--filter #'(lambda (f) (not (file-directory-p f))) nodes) comp))))
+
+(defun neo-buffer--get-node-index (node nodes)
+ "Return the index of NODE in NODES.
+
+NODES can be a list of directory or files.
+Return nil if NODE has not been found in NODES."
+ (let ((i 0)
+ (l (length nodes))
+ (cur (car nodes))
+ (rest (cdr nodes)))
+ (while (and cur (not (equal cur node)))
+ (setq i (1+ i))
+ (setq cur (car rest))
+ (setq rest (cdr rest)))
+ (if (< i l) i)))
+
+(defun neo-buffer--expanded-node-p (node)
+ "Return non-nil if NODE is expanded."
+ (neo-util--to-bool
+ (neo-util--find
+ neo-buffer--expanded-node-list
+ #'(lambda (x) (equal x node)))))
+
+(defun neo-buffer--set-expand (node do-expand)
+ "Set the expanded state of the NODE to DO-EXPAND.
+Return the new expand state for NODE (t for expanded, nil for collapsed)."
+ (if (not do-expand)
+ (setq neo-buffer--expanded-node-list
+ (neo-util--filter
+ #'(lambda (x) (not (equal node x)))
+ neo-buffer--expanded-node-list))
+ (push node neo-buffer--expanded-node-list))
+ do-expand)
+
+(defun neo-buffer--toggle-expand (node)
+ (neo-buffer--set-expand node (not (neo-buffer--expanded-node-p node))))
+
+(defun neo-buffer--insert-tree (path depth)
+ (if (eq depth 1)
+ (neo-buffer--insert-root-entry path))
+ (let* ((contents (neo-buffer--get-nodes path))
+ (nodes (car contents))
+ (leafs (cdr contents))
+ (default-directory path))
+ (dolist (node nodes)
+ (let ((expanded (neo-buffer--expanded-node-p node)))
+ (neo-buffer--insert-dir-entry
+ node depth expanded)
+ (if expanded (neo-buffer--insert-tree (concat node "/") (+ depth 1)))))
+ (dolist (leaf leafs)
+ (neo-buffer--insert-file-entry leaf depth))))
+
+(defun neo-buffer--refresh (save-pos-p &optional non-neotree-buffer)
+ "Refresh the NeoTree buffer.
+If SAVE-POS-P is non-nil, it will be auto save current line number."
+ (let ((start-node neo-buffer--start-node))
+ (unless start-node
+ (setq start-node default-directory))
+ (neo-buffer--with-editing-buffer
+ ;; save context
+ (when save-pos-p
+ (neo-buffer--save-cursor-pos))
+ (when non-neotree-buffer
+ (setq neo-buffer--start-node start-node))
+ ;; starting refresh
+ (erase-buffer)
+ (neo-buffer--node-list-clear)
+ (neo-buffer--insert-banner)
+ (setq neo-buffer--start-line neo-header-height)
+ (neo-buffer--insert-tree start-node 1))
+ ;; restore context
+ (neo-buffer--goto-cursor-pos)))
+
+(defun neo-buffer--post-move ()
+ "Reset current directory when position moved."
+ (funcall
+ (neotree-make-executor
+ :file-fn
+ '(lambda (path _)
+ (setq default-directory (neo-path--updir btn-full-path)))
+ :dir-fn
+ '(lambda (path _)
+ (setq default-directory (file-name-as-directory path))))))
+
+(defun neo-buffer--get-button-current-line ()
+ "Return the first button in current line."
+ (let* ((btn-position nil)
+ (pos-line-start (line-beginning-position))
+ (pos-line-end (line-end-position))
+ ;; NOTE: cannot find button when the button
+ ;; at beginning of the line
+ (current-button (or (button-at (point))
+ (button-at pos-line-start))))
+ (if (null current-button)
+ (progn
+ (setf btn-position
+ (catch 'ret-button
+ (let* ((next-button (next-button pos-line-start))
+ (pos-btn nil))
+ (if (null next-button) (throw 'ret-button nil))
+ (setf pos-btn (overlay-start next-button))
+ (if (> pos-btn pos-line-end) (throw 'ret-button nil))
+ (throw 'ret-button pos-btn))))
+ (if (null btn-position)
+ nil
+ (setf current-button (button-at btn-position)))))
+ current-button))
+
+(defun neo-buffer--get-filename-current-line (&optional default)
+ "Return filename for first button in current line.
+If there is no button in current line, then return DEFAULT."
+ (let ((btn (neo-buffer--get-button-current-line)))
+ (if (not (null btn))
+ (button-get btn 'neo-full-path)
+ default)))
+
+(defun neo-buffer--lock-width ()
+ "Lock the width size for NeoTree window."
+ (if neo-window-fixed-size
+ (setq window-size-fixed 'width)))
+
+(defun neo-buffer--unlock-width ()
+ "Unlock the width size for NeoTree window."
+ (setq window-size-fixed nil))
+
+(defun neo-buffer--rename-node ()
+ "Rename current node as another path."
+ (interactive)
+ (let* ((current-path (neo-buffer--get-filename-current-line))
+ (buffer (find-buffer-visiting current-path))
+ to-path
+ msg)
+ (unless (null current-path)
+ (setq msg (format "Rename [%s] to: " (neo-path--file-short-name current-path)))
+ (setq to-path (read-file-name msg (file-name-directory current-path)))
+ (if buffer
+ (with-current-buffer buffer
+ (set-visited-file-name to-path nil t)))
+ (rename-file current-path to-path 1)
+ (neo-buffer--refresh t)
+ (message "Rename successful."))))
+
+(defun neo-buffer--copy-node ()
+ "Copies current node as another path."
+ (interactive)
+ (let* ((current-path (neo-buffer--get-filename-current-line))
+ (buffer (find-buffer-visiting current-path))
+ to-path
+ msg)
+ (unless (null current-path)
+ (setq msg (format "Copy [%s] to: " (neo-path--file-short-name current-path)))
+ (setq to-path (read-file-name msg (file-name-directory current-path)))
+ (if (file-directory-p current-path)
+ (copy-directory current-path to-path)
+ (copy-file current-path to-path))
+ (neo-buffer--refresh t)
+ (message "Copy successful."))))
+
+(defun neo-buffer--select-file-node (file &optional recursive-p)
+ "Select the node that corresponds to the FILE.
+If RECURSIVE-P is non nil, find files will recursively."
+ (let ((efile file)
+ (iter-curr-dir nil)
+ (file-node-find-p nil)
+ (file-node-list nil))
+ (unless (file-name-absolute-p efile)
+ (setq efile (expand-file-name efile)))
+ (setq iter-curr-dir efile)
+ (catch 'return
+ (while t
+ (setq iter-curr-dir (neo-path--updir iter-curr-dir))
+ (push iter-curr-dir file-node-list)
+ (when (neo-path--file-equal-p iter-curr-dir neo-buffer--start-node)
+ (setq file-node-find-p t)
+ (throw 'return nil))
+ (let ((niter-curr-dir (file-remote-p iter-curr-dir 'localname)))
+ (unless niter-curr-dir
+ (setq niter-curr-dir iter-curr-dir))
+ (when (neo-path--file-equal-p niter-curr-dir "/")
+ (setq file-node-find-p nil)
+ (throw 'return nil)))))
+ (when file-node-find-p
+ (dolist (p file-node-list)
+ (neo-buffer--set-expand p t))
+ (neo-buffer--save-cursor-pos file)
+ (neo-buffer--refresh nil))))
+
+(defun neo-buffer--change-root (root-dir)
+ "Change the tree root to ROOT-DIR."
+ (let ((path root-dir)
+ start-path)
+ (unless (and (file-exists-p path)
+ (file-directory-p path))
+ (throw 'error "The path is not a valid directory."))
+ (setq start-path (expand-file-name (substitute-in-file-name path)))
+ (setq neo-buffer--start-node start-path)
+ (cd start-path)
+ (neo-buffer--save-cursor-pos path nil)
+ (neo-buffer--refresh nil)))
+
+(defun neo-buffer--get-nodes-for-select-down-node (path)
+ "Return the node list for the down dir selection."
+ (if path
+ (when (file-name-directory path)
+ (if (neo-buffer--expanded-node-p path)
+ (neo-buffer--get-nodes path)
+ (neo-buffer--get-nodes (file-name-directory path))))
+ (neo-buffer--get-nodes (file-name-as-directory neo-buffer--start-node))))
+
+(defun neo-buffer--get-nodes-for-sibling (path)
+ "Return the node list for the sibling selection. Return nil of no nodes can
+be found.
+The returned list is a directory list if path is a directory, otherwise it is
+a file list."
+ (when path
+ (let ((nodes (neo-buffer--get-nodes (file-name-directory path))))
+ (if (file-directory-p path)
+ (car nodes)
+ (cdr nodes)))))
+
+(defun neo-buffer--sibling (path &optional previous)
+ "Return the next sibling of node PATH.
+If PREVIOUS is non-nil the previous sibling is returned."
+ (let* ((nodes (neo-buffer--get-nodes-for-sibling path)))
+ (when nodes
+ (let ((i (neo-buffer--get-node-index path nodes))
+ (l (length nodes)))
+ (if i (nth (mod (+ i (if previous -1 1)) l) nodes))))))
+
+(defun neo-buffer--execute (arg &optional file-fn dir-fn)
+ "Define the behaviors for keyboard event.
+ARG is the parameter for command.
+If FILE-FN is non-nil, it will executed when a file node.
+If DIR-FN is non-nil, it will executed when a dir node."
+ (interactive "P")
+ (let* ((btn-full-path (neo-buffer--get-filename-current-line))
+ is-file-p
+ enter-fn)
+ (unless (null btn-full-path)
+ (setq is-file-p (not (file-directory-p btn-full-path))
+ enter-fn (if is-file-p file-fn dir-fn))
+ (unless (null enter-fn)
+ (funcall enter-fn btn-full-path arg)
+ (run-hook-with-args
+ 'neo-enter-hook
+ (if is-file-p 'file 'directory)
+ btn-full-path
+ arg)))
+ btn-full-path))
+
+(defun neo-buffer--set-show-hidden-file-p (show-p)
+ "If SHOW-P is non-nil, show hidden nodes in tree."
+ (setq neo-buffer--show-hidden-file-p show-p)
+ (neo-buffer--refresh t))
+
+(defun neo-buffer--forward-line (n)
+ "Move N lines forward in NeoTree buffer."
+ (forward-line (or n 1))
+ (neo-buffer--post-move))
+
+;;
+;; Mode-line methods
+;;
+
+(defun neo-mode-line--compute-format (parent index ndirs nfiles)
+ "Return a formated string to be used in the `neotree' mode-line."
+ (let* ((nall (+ ndirs nfiles))
+ (has-dirs (> ndirs 0))
+ (has-files (> nfiles 0))
+ (msg-index (when index (format "[%s/%s] " index nall)))
+ (msg-ndirs (when has-dirs (format (if has-files " (D:%s" " (D:%s)") ndirs)))
+ (msg-nfiles (when has-files (format (if has-dirs " F:%s)" " (F:%s)") nfiles)))
+ (msg-directory (file-name-nondirectory (directory-file-name parent)))
+ (msg-directory-max-length (- (window-width)
+ (length msg-index)
+ (length msg-ndirs)
+ (length msg-nfiles))))
+ (setq msg-directory (if (<= (length msg-directory) msg-directory-max-length)
+ msg-directory
+ (concat (substring msg-directory
+ 0 (- msg-directory-max-length 3))
+ "...")))
+ (propertize
+ (decode-coding-string (concat msg-index msg-directory msg-ndirs msg-nfiles) 'utf-8)
+ 'help-echo (decode-coding-string parent 'utf-8))))
+
+;;
+;; Window methods
+;;
+
+(defun neo-window--init (window buffer)
+ "Make WINDOW a NeoTree window.
+NeoTree buffer is BUFFER."
+ (neo-buffer--with-resizable-window
+ (switch-to-buffer buffer)
+ (set-window-parameter window 'no-delete-other-windows t)
+ (set-window-dedicated-p window t))
+ window)
+
+(defun neo-window--zoom (method)
+ "Zoom the NeoTree window, the METHOD should one of these options:
+'maximize 'minimize 'zoom-in 'zoom-out."
+ (neo-buffer--unlock-width)
+ (cond
+ ((eq method 'maximize)
+ (maximize-window))
+ ((eq method 'minimize)
+ (neo-util--set-window-width (selected-window) neo-window-width))
+ ((eq method 'zoom-in)
+ (shrink-window-horizontally 2))
+ ((eq method 'zoom-out)
+ (enlarge-window-horizontally 2)))
+ (neo-buffer--lock-width))
+
+(defun neo-window--minimize-p ()
+ "Return non-nil when the NeoTree window is minimize."
+ (<= (window-width) neo-window-width))
+
+;;
+;; Interactive functions
+;;
+
+(defun neotree-next-line (&optional count)
+ "Move next line in NeoTree buffer.
+Optional COUNT argument, moves COUNT lines down."
+ (interactive "p")
+ (neo-buffer--forward-line (or count 1)))
+
+(defun neotree-previous-line (&optional count)
+ "Move previous line in NeoTree buffer.
+Optional COUNT argument, moves COUNT lines up."
+ (interactive "p")
+ (neo-buffer--forward-line (- (or count 1))))
+
+;;;###autoload
+(defun neotree-find (&optional path default-path)
+ "Quick select node which specified PATH in NeoTree.
+If path is nil and no buffer file name, then use DEFAULT-PATH,"
+ (interactive)
+ (let* ((ndefault-path (if default-path default-path
+ (neo-path--get-working-dir)))
+ (npath (if path path
+ (or (buffer-file-name) ndefault-path)))
+ (do-open-p nil))
+ (if (and (not neo-force-change-root)
+ (not (neo-global--file-in-root-p npath))
+ (neo-global--window-exists-p))
+ (setq do-open-p (funcall neo-confirm-change-root "File not found in root path, do you want to change root?"))
+ (setq do-open-p t))
+ (when do-open-p
+ (neo-global--open-and-find npath))
+ (when neo-auto-indent-point
+ (neo-point-auto-indent)))
+ (neo-global--select-window))
+
+(defun neotree-click-changes-root-toggle ()
+ "Toggle the variable neo-click-changes-root.
+If true, clicking on a directory will change the current root to
+the directory instead of showing the directory contents."
+ (interactive)
+ (setq neo-click-changes-root (not neo-click-changes-root)))
+
+(defun neo-open-dir (full-path &optional arg)
+ "Toggle fold a directory node.
+
+FULL-PATH is the path of the directory.
+ARG is ignored."
+ (if neo-click-changes-root
+ (neotree-change-root)
+ (progn
+ (let ((new-state (neo-buffer--toggle-expand full-path)))
+ (neo-buffer--refresh t)
+ (when neo-auto-indent-point
+ (when new-state (forward-line 1))
+ (neo-point-auto-indent))))))
+
+
+(defun neo--expand-recursive (path state)
+ "Set the state of children recursively.
+
+The children of PATH will have state STATE."
+ (let ((children (car (neo-buffer--get-nodes path) )))
+ (dolist (node children)
+ (neo-buffer--set-expand node state)
+ (neo--expand-recursive node state ))))
+
+(defun neo-open-dir-recursive (full-path &optional arg)
+ "Toggle fold a directory node recursively.
+
+The children of the node will also be opened recursively.
+FULL-PATH is the path of the directory.
+ARG is ignored."
+ (if neo-click-changes-root
+ (neotree-change-root)
+ (let ((new-state (neo-buffer--toggle-expand full-path))
+ (children (car (neo-buffer--get-nodes full-path))))
+ (dolist (node children)
+ (neo-buffer--set-expand node new-state)
+ (neo--expand-recursive node new-state))
+ (neo-buffer--refresh t))))
+
+(defun neo-open-dired (full-path &optional arg)
+ "Open file or directory node in `dired-mode'.
+
+FULL-PATH is the path of node.
+ARG is same as `neo-open-file'."
+ (neo-global--select-mru-window arg)
+ (dired full-path))
+
+(defun neo-open-file (full-path &optional arg)
+ "Open a file node.
+
+FULL-PATH is the file path you want to open.
+If ARG is an integer then the node is opened in a window selected via
+`winum' or`window-numbering' (if available) according to the passed number.
+If ARG is `|' then the node is opened in new vertically split window.
+If ARG is `-' then the node is opened in new horizontally split window."
+ (neo-global--select-mru-window arg)
+ (find-file full-path))
+
+(defun neo-open-file-vertical-split (full-path arg)
+ "Open the current node is a vertically split window.
+FULL-PATH and ARG are the same as `neo-open-file'."
+ (neo-open-file full-path "|"))
+
+(defun neo-open-file-horizontal-split (full-path arg)
+ "Open the current node is horizontally split window.
+FULL-PATH and ARG are the same as `neo-open-file'."
+ (neo-open-file full-path "-"))
+
+(defun neo-open-file-ace-window (full-path arg)
+ "Open the current node in a window chosen by ace-window.
+FULL-PATH and ARG are the same as `neo-open-file'."
+ (neo-open-file full-path "a"))
+
+(defun neotree-open-file-in-system-application ()
+ "Open a file under point in the system application."
+ (interactive)
+ (call-process neo-default-system-application nil 0 nil
+ (neo-buffer--get-filename-current-line)))
+
+(defun neotree-change-root ()
+ "Change root to current node dir.
+If current node is a file, then it will do nothing.
+If cannot find any node in current line, it equivalent to using `neotree-dir'."
+ (interactive)
+ (neo-global--select-window)
+ (let ((btn-full-path (neo-buffer--get-filename-current-line)))
+ (if (null btn-full-path)
+ (call-interactively 'neotree-dir)
+ (neo-global--open-dir btn-full-path))))
+
+(defun neotree-select-up-node ()
+ "Select the parent directory of the current node. Change the root if
+necessary. "
+ (interactive)
+ (neo-global--select-window)
+ (let* ((btn-full-path (neo-buffer--get-filename-current-line))
+ (btn-parent-dir (if btn-full-path (file-name-directory btn-full-path)))
+ (root-slash (file-name-as-directory neo-buffer--start-node)))
+ (cond
+ ((equal btn-parent-dir root-slash) (neo-global--open-dir root-slash))
+ (btn-parent-dir (neotree-find btn-parent-dir))
+ (t (neo-global--open-dir (file-name-directory
+ (directory-file-name root-slash)))))))
+
+(defun neotree-select-down-node ()
+ "Select an expanded directory or content directory according to the
+current node, in this order:
+- select the first expanded child node if the current node has one
+- select the content of current node if it is expanded
+- select the next expanded sibling if the current node is not expanded."
+ (interactive)
+ (let* ((btn-full-path (neo-buffer--get-filename-current-line))
+ (path (if btn-full-path btn-full-path neo-buffer--start-node))
+ (nodes (neo-buffer--get-nodes-for-select-down-node path)))
+ (when nodes
+ (if (or (equal path neo-buffer--start-node)
+ (neo-buffer--expanded-node-p path))
+ ;; select the first expanded child node
+ (let ((expanded-dir (catch 'break
+ (dolist (node (car nodes))
+ (if (neo-buffer--expanded-node-p node)
+ (throw 'break node)))
+ nil)))
+ (if expanded-dir
+ (neotree-find expanded-dir)
+ ;; select the directory content if needed
+ (let ((dirs (car nodes))
+ (files (cdr nodes)))
+ (if (> (length dirs) 0)
+ (neotree-find (car dirs))
+ (when (> (length files) 0)
+ (neotree-find (car files)))))))
+ ;; select the next expanded sibling
+ (let ((sibling (neo-buffer--sibling path)))
+ (while (and (not (neo-buffer--expanded-node-p sibling))
+ (not (equal sibling path)))
+ (setq sibling (neo-buffer--sibling sibling)))
+ (when (not (string< sibling path))
+ ;; select next expanded sibling
+ (neotree-find sibling)))))))
+
+(defun neotree-select-next-sibling-node ()
+ "Select the next sibling of current node.
+If the current node is the last node then the first node is selected."
+ (interactive)
+ (let ((sibling (neo-buffer--sibling (neo-buffer--get-filename-current-line))))
+ (when sibling (neotree-find sibling))))
+
+(defun neotree-select-previous-sibling-node ()
+ "Select the previous sibling of current node.
+If the current node is the first node then the last node is selected."
+ (interactive)
+ (let ((sibling (neo-buffer--sibling (neo-buffer--get-filename-current-line) t)))
+ (when sibling (neotree-find sibling))))
+
+(defun neotree-create-node (filename)
+ "Create a file or directory use specified FILENAME in current node."
+ (interactive
+ (let* ((current-dir (neo-buffer--get-filename-current-line neo-buffer--start-node))
+ (current-dir (neo-path--match-path-directory current-dir))
+ (filename (read-file-name "Filename:" current-dir)))
+ (if (file-directory-p filename)
+ (setq filename (concat filename "/")))
+ (list filename)))
+ (catch 'rlt
+ (let ((is-file nil))
+ (when (= (length filename) 0)
+ (throw 'rlt nil))
+ (setq is-file (not (equal (substring filename -1) "/")))
+ (when (file-exists-p filename)
+ (message "File %S already exists." filename)
+ (throw 'rlt nil))
+ (when (and is-file
+ (funcall neo-confirm-create-file (format "Do you want to create file %S ?"
+ filename)))
+ ;; ensure parent directory exist before saving
+ (mkdir (substring filename 0 (+ 1 (cl-position ?/ filename :from-end t))) t)
+ ;; NOTE: create a empty file
+ (write-region "" nil filename)
+ (neo-buffer--save-cursor-pos filename)
+ (neo-buffer--refresh nil)
+ (if neo-create-file-auto-open
+ (find-file-other-window filename)))
+ (when (and (not is-file)
+ (funcall neo-confirm-create-directory (format "Do you want to create directory %S?"
+ filename)))
+ (mkdir filename t)
+ (neo-buffer--save-cursor-pos filename)
+ (neo-buffer--refresh nil)))))
+
+(defun neotree-delete-node ()
+ "Delete current node."
+ (interactive)
+ (let* ((filename (neo-buffer--get-filename-current-line))
+ (buffer (find-buffer-visiting filename))
+ (deleted-p nil)
+ (trash delete-by-moving-to-trash))
+ (catch 'end
+ (if (null filename) (throw 'end nil))
+ (if (not (file-exists-p filename)) (throw 'end nil))
+ (if (not (funcall neo-confirm-delete-file (format "Do you really want to delete %S?"
+ filename)))
+ (throw 'end nil))
+ (if (file-directory-p filename)
+ ;; delete directory
+ (progn
+ (unless (neo-path--has-subfile-p filename)
+ (delete-directory filename nil trash)
+ (setq deleted-p t)
+ (throw 'end nil))
+ (when (funcall neo-confirm-delete-directory-recursively
+ (format "%S is a directory, delete it recursively?"
+ filename))
+ (when (funcall neo-confirm-kill-buffers-for-files-in-directory
+ (format "kill buffers for files in directory %S?"
+ filename))
+ (neo-util--kill-buffers-for-path filename))
+ (delete-directory filename t trash)
+ (setq deleted-p t)))
+ ;; delete file
+ (progn
+ (delete-file filename trash)
+ (when buffer
+ (kill-buffer-ask buffer))
+ (setq deleted-p t))))
+ (when deleted-p
+ (message "%S deleted." filename)
+ (neo-buffer--refresh t))
+ filename))
+
+(defun neotree-rename-node ()
+ "Rename current node."
+ (interactive)
+ (neo-buffer--rename-node))
+
+(defun neotree-copy-node ()
+ "Copy current node."
+ (interactive)
+ (neo-buffer--copy-node))
+
+(defun neotree-hidden-file-toggle ()
+ "Toggle show hidden files."
+ (interactive)
+ (neo-buffer--set-show-hidden-file-p (not neo-buffer--show-hidden-file-p)))
+
+(defun neotree-empty-fn ()
+ "Used to bind the empty function to the shortcut."
+ (interactive))
+
+(defun neotree-refresh (&optional is-auto-refresh)
+ "Refresh the NeoTree buffer."
+ (interactive)
+ (if (eq (current-buffer) (neo-global--get-buffer))
+ (neo-buffer--refresh t)
+ (save-excursion
+ (let ((cw (selected-window))) ;; save current window
+ (if is-auto-refresh
+ (let ((origin-buffer-file-name (buffer-file-name)))
+ (when (and (fboundp 'projectile-project-p)
+ (projectile-project-p)
+ (fboundp 'projectile-project-root))
+ (neo-global--open-dir (projectile-project-root))
+ (neotree-find (projectile-project-root)))
+ (neotree-find origin-buffer-file-name))
+ (neo-buffer--refresh t t))
+ (recenter)
+ (when (or is-auto-refresh neo-toggle-window-keep-p)
+ (select-window cw))))))
+
+(defun neotree-stretch-toggle ()
+ "Make the NeoTree window toggle maximize/minimize."
+ (interactive)
+ (neo-global--with-window
+ (if (neo-window--minimize-p)
+ (neo-window--zoom 'maximize)
+ (neo-window--zoom 'minimize))))
+
+(defun neotree-collapse-all ()
+ (interactive)
+ "Collapse all expanded folders in the neotree buffer"
+ (setq list-of-expanded-folders neo-buffer--expanded-node-list)
+ (dolist (folder list-of-expanded-folders)
+ (neo-buffer--toggle-expand folder)
+ (neo-buffer--refresh t)
+ )
+ )
+;;;###autoload
+(defun neotree-projectile-action ()
+ "Integration with `Projectile'.
+
+Usage:
+ (setq projectile-switch-project-action 'neotree-projectile-action).
+
+When running `projectile-switch-project' (C-c p p), `neotree' will change root
+automatically."
+ (interactive)
+ (cond
+ ((fboundp 'projectile-project-root)
+ (neotree-dir (projectile-project-root)))
+ (t
+ (error "Projectile is not available"))))
+
+;;;###autoload
+(defun neotree-toggle ()
+ "Toggle show the NeoTree window."
+ (interactive)
+ (if (neo-global--window-exists-p)
+ (neotree-hide)
+ (neotree-show)))
+
+;;;###autoload
+(defun neotree-show ()
+ "Show the NeoTree window."
+ (interactive)
+ (let ((cw (selected-window))
+ (path (buffer-file-name))) ;; save current window and buffer
+ (if neo-smart-open
+ (progn
+ (when (and (fboundp 'projectile-project-p)
+ (projectile-project-p)
+ (fboundp 'projectile-project-root))
+ (neotree-dir (projectile-project-root)))
+ (neotree-find path))
+ (neo-global--open))
+ (neo-global--select-window)
+ (when neo-toggle-window-keep-p
+ (select-window cw))))
+
+;;;###autoload
+(defun neotree-hide ()
+ "Close the NeoTree window."
+ (interactive)
+ (if (neo-global--window-exists-p)
+ (delete-window neo-global--window)))
+
+;;;###autoload
+(defun neotree-dir (path)
+ "Show the NeoTree window, and change root to PATH."
+ (interactive "DDirectory: ")
+ (neo-global--open-dir path)
+ (neo-global--select-window))
+
+;;;###autoload
+(defalias 'neotree 'neotree-show "Show the NeoTree window.")
+
+;;
+;; backward compatible
+;;
+
+(defun neo-bc--make-obsolete-message (from to)
+ (message "Warning: `%S' is obsolete. Use `%S' instead." from to))
+
+(defun neo-buffer--enter-file (path)
+ (neo-bc--make-obsolete-message 'neo-buffer--enter-file 'neo-open-file))
+
+(defun neo-buffer--enter-dir (path)
+ (neo-bc--make-obsolete-message 'neo-buffer--enter-dir 'neo-open-dir))
+
+(defun neotree-enter (&optional arg)
+ "NeoTree typical open event.
+ARG are the same as `neo-open-file'."
+ (interactive "P")
+ (neo-buffer--execute arg 'neo-open-file 'neo-open-dir))
+
+(defun neotree-quick-look (&optional arg)
+ "Quick Look like NeoTree open event.
+ARG are the same as `neo-open-file'."
+ (interactive "P")
+ (neotree-enter arg)
+ (neo-global--select-window))
+
+(defun neotree-enter-vertical-split ()
+ "NeoTree open event, file node will opened in new vertically split window."
+ (interactive)
+ (neo-buffer--execute nil 'neo-open-file-vertical-split 'neo-open-dir))
+
+(defun neotree-enter-horizontal-split ()
+ "NeoTree open event, file node will opened in new horizontally split window."
+ (interactive)
+ (neo-buffer--execute nil 'neo-open-file-horizontal-split 'neo-open-dir))
+
+(defun neotree-enter-ace-window ()
+ "NeoTree open event, file node will be opened in window chosen by ace-window."
+ (interactive)
+ (neo-buffer--execute nil 'neo-open-file-ace-window 'neo-open-dir))
+
+(defun neotree-copy-filepath-to-yank-ring ()
+ "Neotree convenience interactive function: file node path will be added to the kill ring."
+ (interactive)
+ (kill-new (neo-buffer--get-filename-current-line)))
+
+(defun neotree-split-window-sensibly (&optional window)
+ "An neotree-version of split-window-sensibly,
+which is used to fix issue #209.
+(setq split-window-preferred-function 'neotree-split-window-sensibly)"
+ (let ((window (or window (selected-window))))
+ (or (split-window-sensibly window)
+ (and (get-buffer-window neo-buffer-name)
+ (not (window-minibuffer-p window))
+ ;; If WINDOW is the only window on its frame
+ ;; (or only include Neo window) and is not the
+ ;; minibuffer window, try to split it vertically disregarding
+ ;; the value of `split-height-threshold'.
+ (let ((split-height-threshold 0))
+ (when (window-splittable-p window)
+ (with-selected-window window
+ (split-window-below))))))))
+
+(provide 'neotree)
+;;; neotree.el ends here
+
diff --git a/lisp/org-bullets.el b/lisp/org-bullets.el
new file mode 100644
index 0000000..b161148
--- /dev/null
+++ b/lisp/org-bullets.el
@@ -0,0 +1,126 @@
+;;; org-bullets.el --- Show bullets in org-mode as UTF-8 characters
+;;; Version: 0.2.4
+;;; Author: sabof
+;;; URL: https://github.com/sabof/org-bullets
+
+;; This file is NOT part of GNU Emacs.
+;;
+;; This program 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, or (at
+;; your option) any later version.
+;;
+;; This program 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 this program ; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; The project is hosted at https://github.com/sabof/org-bullets
+;; The latest version, and all the relevant information can be found there.
+
+;;; Code:
+
+(eval-when-compile (require 'cl))
+
+(defgroup org-bullets nil
+ "Display bullets as UTF-8 characters"
+ :group 'org-appearance)
+
+;; A nice collection of unicode bullets:
+;; http://nadeausoftware.com/articles/2007/11/latency_friendly_customized_bullets_using_unicode_characters
+(defcustom org-bullets-bullet-list
+ '(;;; Large
+ "◉"
+ "○"
+ "✸"
+ "✿"
+ ;; ♥ ● ◇ ✚ ✜ ☯ ◆ ♠ ♣ ♦ ☢ ❀ ◆ ◖ ▶
+ ;;; Small
+ ;; ► • ★ ▸
+ )
+ "This variable contains the list of bullets.
+It can contain any number of symbols, which will be repeated."
+ :group 'org-bullets
+ :type '(repeat (string :tag "Bullet character")))
+
+(defcustom org-bullets-face-name nil
+ "This variable allows the org-mode bullets face to be
+ overridden. If set to a name of a face, that face will be
+ used. Otherwise the face of the heading level will be used."
+ :group 'org-bullets
+ :type 'symbol)
+
+(defvar org-bullets-bullet-map
+ '(keymap
+ (mouse-1 . org-cycle)
+ (mouse-2
+ . (lambda (e)
+ (interactive "e")
+ (mouse-set-point e)
+ (org-cycle))))
+ "Mouse events for bullets.
+Should this be undesirable, one can remove them with
+
+\(setcdr org-bullets-bullet-map nil\)")
+
+(defun org-bullets-level-char (level)
+ (string-to-char
+ (nth (mod (1- level)
+ (length org-bullets-bullet-list))
+ org-bullets-bullet-list)))
+
+;;;###autoload
+(define-minor-mode org-bullets-mode
+ "UTF8 Bullets for org-mode"
+ nil nil nil
+ (let* (( keyword
+ `(("^\\*+ "
+ (0 (let* (( level (- (match-end 0) (match-beginning 0) 1))
+ ( is-inline-task
+ (and (boundp 'org-inlinetask-min-level)
+ (>= level org-inlinetask-min-level))))
+ (compose-region (- (match-end 0) 2)
+ (- (match-end 0) 1)
+ (org-bullets-level-char level))
+ (when is-inline-task
+ (compose-region (- (match-end 0) 3)
+ (- (match-end 0) 2)
+ (org-bullets-level-char level)))
+ (when (facep org-bullets-face-name)
+ (put-text-property (- (match-end 0)
+ (if is-inline-task 3 2))
+ (- (match-end 0) 1)
+ 'face
+ org-bullets-face-name))
+ (put-text-property (match-beginning 0)
+ (- (match-end 0) 2)
+ 'face (list :foreground
+ (face-attribute
+ 'default :background)))
+ (put-text-property (match-beginning 0)
+ (match-end 0)
+ 'keymap
+ org-bullets-bullet-map)
+ nil))))))
+ (if org-bullets-mode
+ (progn
+ (font-lock-add-keywords nil keyword)
+ (font-lock-fontify-buffer))
+ (save-excursion
+ (goto-char (point-min))
+ (font-lock-remove-keywords nil keyword)
+ (while (re-search-forward "^\\*+ " nil t)
+ (decompose-region (match-beginning 0) (match-end 0)))
+ (font-lock-fontify-buffer))
+ )))
+
+(provide 'org-bullets)
+
+;;; org-bullets.el ends here
diff --git a/lisp/org-custom.el b/lisp/org-custom.el
new file mode 100644
index 0000000..10adab9
--- /dev/null
+++ b/lisp/org-custom.el
@@ -0,0 +1,68 @@
+;; https://zzamboni.org/post/beautifying-org-mode-in-emacs/
+
+(defun org-custom-hook()
+ (setq org-hide-emphasis-markers t)
+ (font-lock-add-keywords 'org-mode
+ '(("^ *\\([-]\\) "
+ (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•"))))))
+
+ (let* ((variable-tuple
+ (cond ((x-list-fonts "ETBembo") '(:font "ETBembo"))
+ ((x-list-fonts "Source Sans Pro") '(:font "Source Sans Pro"))
+ ((x-list-fonts "Lucida Grande") '(:font "Lucida Grande"))
+ ((x-list-fonts "Verdana") '(:font "Verdana"))
+ ((x-family-fonts "Sans Serif") '(:family "Sans Serif"))
+ (nil (warn "Cannot find a Sans Serif Font. Install Source Sans Pro."))))
+ (base-font-color (face-foreground 'default nil 'default))
+ (headline `(:inherit default :weight normal :foreground ,base-font-color)))
+
+ (custom-theme-set-faces
+ 'user
+ `(org-level-8 ((t (,@headline ,@variable-tuple))))
+ `(org-level-7 ((t (,@headline ,@variable-tuple))))
+ `(org-level-6 ((t (,@headline ,@variable-tuple))))
+ `(org-level-5 ((t (,@headline ,@variable-tuple))))
+ `(org-level-4 ((t (,@headline ,@variable-tuple :height 0.8))))
+ `(org-level-3 ((t (,@headline ,@variable-tuple :height 0.9))))
+ `(org-level-2 ((t (,@headline ,@variable-tuple :height 1.0))))
+ `(org-level-1 ((t (,@headline ,@variable-tuple :height 1.1 :weight bold))))
+ `(org-document-title ((t (,@headline ,@variable-tuple :height 1.5 :underline t :weight:bold))))))
+
+ (custom-theme-set-faces
+ 'user
+ '(org-block ((t (:inherit fixed-pitch))))
+ '(org-code ((t (:inherit (shadow fixed-pitch)))))
+ '(org-document-info ((t (:foreground "dark orange"))))
+ '(org-document-info-keyword ((t (:inherit (shadow fixed-pitch)))))
+ '(org-indent ((t (:inherit (org-hide fixed-pitch)))))
+ '(org-link ((t (:foreground "royal blue" :underline t))))
+ '(org-meta-line ((t (:inherit (font-lock-comment-face fixed-pitch)))))
+ '(org-property-value ((t (:inherit fixed-pitch))) t)
+ '(org-special-keyword ((t (:inherit (font-lock-comment-face fixed-pitch)))))
+ '(org-table ((t (:inherit fixed-pitch :foreground "#83a598"))))
+ '(org-tag ((t (:inherit (shadow fixed-pitch) :weight bold :height 0.8))))
+ '(org-verbatim ((t (:inherit (shadow fixed-pitch))))))
+
+ (variable-pitch-mode)
+ (visual-line-mode)
+
+ (require 'org-bullets)
+ (org-bullets-mode 1)
+
+ (setq org-blank-before-new-entry (quote ((heading . nil)
+ (plain-list-item . nil))))
+)
+
+(custom-set-variables
+ '(org-directory "~/Documents/org")
+ '(org-agenda-files (list org-directory)))
+
+(setq org-todo-keywords
+ '((sequence "TODO" "PROGRESS" "VERIFY" "|" "DONE" "ABANDONED")))
+
+(setq org-todo-keyword-faces
+ '(("TODO" . "RED") ("PROGRESS" . "royal blue") ("VERIFY" . "#E0A526") ("ABANDONED" . "light gray") ("DONE" . "dark green"))
+ )
+
+
+(provide 'org-custom)
diff --git a/lisp/perfect-margin.el b/lisp/perfect-margin.el
new file mode 100644
index 0000000..4453f85
--- /dev/null
+++ b/lisp/perfect-margin.el
@@ -0,0 +1,336 @@
+;;; perfect-margin.el --- auto center windows, work with minimap and/or linum-mode
+;; Copyright (C) 2014 Randall Wang
+
+;; Author: Randall Wang <randall.wjz@gmail.com>
+;; Created: 19 Nov 2014
+;; Version: 0.1
+;; URL: https://github.com/mpwang/perfect-margin
+;; Keywords: convenience, frames
+;; Package-Requires: ((emacs "24.0") (cl-lib "0.5"))
+
+;; This file is *NOT* part of GNU Emacs.
+
+;; This program 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 2
+;; of the License, or (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANT ABILITY 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; # Usage
+;;
+;; Put perfect-margin under your Emacs load path, and add this to your init.el
+;;
+;; (require 'perfect-margin)
+;;
+;; Use `M-x perfect-margin-mode` to turn on/off perfect-margin.
+;;
+;; To make it permanent add this to your init.el after require.
+;;
+;; (perfect-margin-mode 1)
+;;
+;; Note: when using together with minimap or linum, make sure you place config for perfect-margin *AFTER* minimap and linum.
+;;
+;; # Customization
+;;
+;; Via `M-x customize-group` and enter perfect-margin.
+;;
+;; Change `perfect-margin-visible-width` and `Apply and Save`. That's it.
+;;
+;; *Or* you can change the visible window width by setup `perfect-margin-visible-width` on the init.el.
+;;
+;; (setq perfect-margin-visible-width 128)
+;;
+;; # Additional binding on margin area
+;;
+;; You can place this in your init.el to make mouse wheel scroll on margin area just like it scroll on the visible window.
+;;
+;; (dolist (margin '("<left-margin> " "<right-margin> "))
+;; (global-set-key (kbd (concat margin "<mouse-1>")) 'ignore)
+;; (global-set-key (kbd (concat margin "<mouse-3>")) 'ignore)
+;; (dolist (multiple '("" "double-" "triple-"))
+;; (global-set-key (kbd (concat margin "<" multiple "wheel-up>")) 'mwheel-scroll)
+;; (global-set-key (kbd (concat margin "<" multiple "wheel-down>")) 'mwheel-scroll)))
+
+;;; Code:
+
+(require 'linum)
+(require 'cl-lib)
+
+(defvar minimap-width-fraction)
+(defvar minimap-buffer-name)
+(declare-function minimap-get-window "minimap")
+
+(defgroup perfect-margin nil
+ "Auto center windows, work with minimap and/or linum-mode."
+ :group 'emacs)
+
+(defcustom perfect-margin-lighter " \u24c2"
+ "Mode-line indicator for symbol `perfect-margin-mode'."
+ :type '(choice (const :tag "No lighter" "") string)
+ :safe 'stringp
+ :group 'perfect-margin)
+
+(defcustom perfect-margin-visible-width 128
+ "The visible width of main window to be kept at center."
+ :group 'perfect-margin
+ :type 'number)
+
+(defcustom perfect-margin-ignore-regexps
+ '("^minibuf" "^[*]")
+ "List of strings to determine if window is ignored.
+Each string is used as regular expression to match the window buffer name."
+ :group 'perfect-margin
+ :type '(repeat regexp))
+
+(defcustom perfect-margin-ignore-filters
+ '(window-minibuffer-p)
+ "List of functions to determine if window is ignored.
+Each function is called with window as its sole arguemnt, returning a non-nil value indicate to ignore the window."
+ :group 'perfect-margin
+ :type '(list function))
+
+(defcustom perfect-margin-ignore-modes
+ '(exwm-mode
+ doc-view-mode
+ nov-mode)
+ "List of symbols of ignored major modes."
+ :type '(repeat symbol)
+ :group 'perfect-margin)
+
+;;----------------------------------------------------------------------------
+;; env predictors
+;;----------------------------------------------------------------------------
+(defun perfect-margin-with-linum-p ()
+ "Whether linum is found and turn on."
+ (bound-and-true-p linum-mode))
+
+(defun perfect-margin-with-minimap-p ()
+ "Whether minimap is found."
+ (bound-and-true-p minimap-mode))
+
+;;----------------------------------------------------------------------------
+;; Private functions
+;;----------------------------------------------------------------------------
+(defun perfect-margin--width-with-margins (win)
+ "Calculate size of window(WIN) with it's margins."
+ (let ((margins (window-margins win)))
+ (+ (window-width win)
+ (or (car margins) 0)
+ (or (cdr margins) 0))))
+
+(defun perfect-margin--minimap-window-p (win)
+ "Judge if the window(WIN) is the minimap window itself, when it's live."
+ (when (and (perfect-margin-with-minimap-p)
+ (minimap-get-window)
+ (window-live-p (minimap-get-window)))
+ (let ((minimap-edges (window-edges (minimap-get-window)))
+ (current-edges (window-edges win)))
+ (and (= (nth 0 minimap-edges) (nth 0 current-edges))
+ (= (nth 1 minimap-edges) (nth 1 current-edges))
+ (= (nth 2 minimap-edges) (nth 2 current-edges))))))
+
+(defun perfect-margin--minimap-left-adjacent-covered-p (win)
+ "Judge if the window(WIN) is left adjacent to minimap window."
+ (when (and (perfect-margin-with-minimap-p)
+ (minimap-get-window)
+ (window-live-p (minimap-get-window)))
+ (let ((minimap-edges (window-edges (minimap-get-window)))
+ (current-edges (window-edges win)))
+ (and (= (nth 2 minimap-edges) (nth 0 current-edges))
+ (<= (nth 1 minimap-edges) (nth 1 current-edges))
+ (>= (nth 3 minimap-edges) (nth 3 current-edges))))))
+
+(defun perfect-margin--init-window-margins ()
+ "Calculate target window margins as if there is only one window on frame."
+ (let ((init-margin-width (round (max 0 (/ (- (frame-width) perfect-margin-visible-width) 2)))))
+ (cons init-margin-width init-margin-width)))
+
+(defun perfect-margin--auto-margin-ignore-p (win)
+ "Conditions for filtering window (WIN) to setup margin."
+ (let* ((buffer (window-buffer win))
+ (name (buffer-name buffer)))
+ (or (with-current-buffer buffer
+ (apply #'derived-mode-p perfect-margin-ignore-modes))
+ (cl-some #'identity
+ (nconc (mapcar (lambda (regexp) (string-match-p regexp name)) perfect-margin-ignore-regexps)
+ (mapcar (lambda (func) (funcall func win)) perfect-margin-ignore-filters))))))
+
+;;----------------------------------------------------------------------------
+;; Minimap
+;;----------------------------------------------------------------------------
+(defun perfect-margin-minimap-margin-window (win)
+ "Setup window margins with minimap at different stage.
+WIN will be any visible window, including the minimap window."
+ ;; Hint: do not reply on (window-width (minimap-get-window))
+ (let ((init-window-margins (perfect-margin--init-window-margins))
+ (win-edges (window-edges win)))
+ (cond
+ ((perfect-margin--auto-margin-ignore-p win)
+ (set-window-margins win (if (perfect-margin-with-linum-p) 3 0) 0))
+ ((not (minimap-get-window))
+ ;; minimap-window is not available
+ (cond
+ ((= (frame-width) (perfect-margin--width-with-margins win))
+ (set-window-margins win (car init-window-margins) (cdr init-window-margins)))
+ ;; When the window is first splited and minimap-window is not set,
+ ;; the minimap has the same buffer name with it's target window.
+ ;; Distinguish the minimap and target window base on edge and size.
+ ;;
+ ;; the left hand side window when minimap window is created by
+ ;; split-window-horizontally the first time.
+ ;; catch and don't set minimap window
+ ((and (= (nth 0 win-edges) 0)
+ (= (nth 2 win-edges) (round (* perfect-margin-visible-width minimap-width-fraction)))))
+ ((and (= (nth 0 win-edges) (round (* perfect-margin-visible-width minimap-width-fraction)))
+ (= (or (car (window-margins win)) 0) (car init-window-margins))
+ (= (or (cdr (window-margins win)) 0) (cdr init-window-margins)))
+ ;; the newly split-off window on the right hand side, which carries init-window-margins
+ (set-window-margins win
+ (max (if (perfect-margin-with-linum-p) 3 0)
+ (- (car init-window-margins)
+ (round (* perfect-margin-visible-width minimap-width-fraction))))
+ (cdr init-window-margins)))
+ (t
+ (set-window-margins win (if (perfect-margin-with-linum-p) 3 0) 0))))
+ ;; catch and don't set minimap window
+ ((string-match minimap-buffer-name (buffer-name (window-buffer win))))
+ ((not (window-live-p (minimap-get-window)))
+ ;; minimap-window is not live yet
+ (cond
+ ;; catch and don't set minimap window
+ ((and (= (nth 0 win-edges) 0)
+ (= (nth 2 win-edges) (round (* perfect-margin-visible-width minimap-width-fraction)))))
+ ((and (= (nth 0 win-edges) (round (* perfect-margin-visible-width minimap-width-fraction)))
+ ;; the splited target window carries original margins
+ (= (or (car (window-margins win)) 0) (car init-window-margins))
+ (= (or (cdr (window-margins win)) 0) (cdr init-window-margins)))
+ (set-window-margins win
+ (max (if (perfect-margin-with-linum-p) 3 0)
+ (- (car init-window-margins)
+ (round (* perfect-margin-visible-width minimap-width-fraction))))
+ (cdr init-window-margins)))
+ ((= (frame-width) (perfect-margin--width-with-margins win))
+ ;; when switch window, the minimap window is kill first, set it's left adjacent window margins to nil.
+ ;; left edge of win extends to frame's left-most edge, it's width increased by width of minimap window.
+ (set-window-margins win (car init-window-margins) (cdr init-window-margins)))
+ (t
+ (set-window-margins win (if (perfect-margin-with-linum-p) 3 0) 0))))
+ ;; minimap window is created, but it has the same name with it's target window
+ ;; catch and don't set minimap window
+ ((perfect-margin--minimap-window-p win))
+ ((perfect-margin--minimap-left-adjacent-covered-p win)
+ (cond
+ ((not (>= (nth 2 win-edges) (frame-width)))
+ (set-window-margins win (if (perfect-margin-with-linum-p) 3 0) 0))
+ (t
+ (set-window-margins win
+ (max (if (perfect-margin-with-linum-p) 3 0)
+ (- (car init-window-margins)
+ (round (* perfect-margin-visible-width minimap-width-fraction))))
+ (cdr init-window-margins)))))
+ ((= (frame-width) (perfect-margin--width-with-margins win))
+ (set-window-margins win (car init-window-margins) (cdr init-window-margins)))
+ (t
+ (set-window-margins win (if (perfect-margin-with-linum-p) 3 0) 0)))))
+
+;;----------------------------------------------------------------------------
+;; Main
+;;----------------------------------------------------------------------------
+(defun perfect-margin-margin-windows ()
+ "Main logic to setup window's margin, keep the visible main window always at center."
+ (dolist (win (window-list))
+ (cond
+ ((perfect-margin-with-minimap-p) (perfect-margin-minimap-margin-window win))
+ ((and (not (perfect-margin--auto-margin-ignore-p win))
+ (<= (frame-width) (perfect-margin--width-with-margins win)))
+ (let ((init-window-margins (perfect-margin--init-window-margins)))
+ (set-window-margins win (car init-window-margins) (cdr init-window-margins))))
+ (t (set-window-margins win (if (perfect-margin-with-linum-p) 3 0) 0)))
+ (set-window-fringes win 0 0)))
+
+(defun perfect-margin-margin-frame (&optional _)
+ "Hook to resize window when frame size change."
+ (when (frame-size-changed-p)
+ (perfect-margin-margin-windows)))
+
+;;----------------------------------------------------------------------------
+;; Advice
+;;----------------------------------------------------------------------------
+(defun perfect-margin--linum-format (line)
+ "Function for `linum-format' to set left margin for LINE to be 3 as maximum."
+ (propertize
+ (format (concat "%" (number-to-string (max 3 (length (number-to-string line)))) "d") line)
+ 'face
+ 'linum))
+
+(defvar perfect-margin--linum-update-win-left-margin nil
+ "Variable to store original window marings before `linum-update-window'.")
+
+(defadvice linum-update-window (before perfect-margin-linum-update-before (win))
+ "Save window's original left margin."
+ (setq perfect-margin--linum-update-win-left-margin (or (car (window-margins win)) 0)))
+
+(defadvice linum-update-window (after perfect-margin-linum-update-after (win))
+ "Restore windonw's original left margin, as `linum-update-window' always reset left margin."
+ (set-window-margins win perfect-margin--linum-update-win-left-margin (cdr (window-margins win))))
+
+(defadvice minimap-update (after minimap-update-no-fringe nil)
+ "Prevent fringe overlay of target buffer from drawing on `minimap-window'."
+ (when (and (minimap-get-window)
+ (window-live-p (minimap-get-window))
+ minimap-hide-fringes)
+ (set-window-fringes (minimap-get-window) 0 0)))
+
+(defadvice split-window (before perfect-margin--disable-margins nil)
+ (dolist (win (window-list))
+ (set-window-margins win 0 0)
+ (set-window-fringes win 0 0)))
+
+;;----------------------------------------------------------------------------
+;; MINOR mode definition
+;;----------------------------------------------------------------------------
+;;;###autoload
+(define-minor-mode perfect-margin-mode
+ "Auto center windows."
+ :init-value nil
+ :lighter perfect-margin-lighter
+ :global t
+ (if perfect-margin-mode
+ ;; add hook and activate
+ (progn
+ (when (perfect-margin-with-linum-p)
+ (ad-activate 'linum-update-window)
+ (when (eq linum-format 'dynamic)
+ (setq linum-format 'perfect-margin--linum-format)))
+ (when (perfect-margin-with-minimap-p)
+ (ad-activate 'minimap-update))
+ (ad-activate 'split-window)
+ (add-hook 'window-configuration-change-hook 'perfect-margin-margin-windows)
+ (add-hook 'window-size-change-functions 'perfect-margin-margin-frame)
+ (perfect-margin-margin-windows))
+ ;; remove hook and restore margin
+ (when (perfect-margin-with-linum-p)
+ (ad-deactivate 'linum-update-window)
+ (when (eq linum-format 'perfect-margin--linum-format)
+ (setq linum-format 'dynamic))
+ (linum-update-current))
+ (when (perfect-margin-with-minimap-p)
+ (ad-deactivate 'minimap-update))
+ (ad-deactivate 'split-window)
+ (remove-hook 'window-configuration-change-hook 'perfect-margin-margin-windows)
+ (remove-hook 'window-size-change-functions 'perfect-margin-margin-frame)
+ (dolist (window (window-list))
+ (set-window-margins window 0 0))))
+
+(provide 'perfect-margin)
+
+;;; perfect-margin.el ends here
diff --git a/lisp/smooth-scrolling.el b/lisp/smooth-scrolling.el
new file mode 100644
index 0000000..98df30e
--- /dev/null
+++ b/lisp/smooth-scrolling.el
@@ -0,0 +1,327 @@
+;;; smooth-scrolling.el --- Make emacs scroll smoothly
+;;
+;; Copyright (c) 2007-2016 Adam Spiers
+;;
+;; Filename: smooth-scrolling.el
+;; Description: Make emacs scroll smoothly
+;; Author: Adam Spiers <emacs-ss@adamspiers.org>
+;; Jeremy Bondeson <jbondeson@gmail.com>
+;; Ryan C. Thompson <rct+github@thompsonclan.org>
+;; Maintainer: Adam Spiers <emacs-ss@adamspiers.org>
+;; Homepage: http://github.com/aspiers/smooth-scrolling/
+;; Version: 2.0.0
+;; Keywords: convenience
+;; GitHub: http://github.com/aspiers/smooth-scrolling/
+
+;; This file is not part of GNU Emacs
+
+;;; License:
+;;
+;; This program 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 2
+;; of the License, or (at your option) any later version.
+;;
+;; This program 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 this program; if not, write to the Free Software
+;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; To interactively toggle the mode on / off:
+;;
+;; M-x smooth-scrolling-mode
+;;
+;; To make the mode permanent, put this in your .emacs:
+;;
+;; (require 'smooth-scrolling)
+;; (smooth-scrolling-mode 1)
+;;
+;; This package offers a global minor mode which make emacs scroll
+;; smoothly. It keeps the point away from the top and bottom of the
+;; current buffer's window in order to keep lines of context around
+;; the point visible as much as possible, whilst minimising the
+;; frequency of sudden scroll jumps which are visually confusing.
+;;
+;; This is a nice alternative to all the native `scroll-*` custom
+;; variables, which unfortunately cannot provide this functionality
+;; perfectly. For example, when using the built-in variables, clicking
+;; with the mouse in the margin will immediately scroll the window to
+;; maintain the margin, so the text that you clicked on will no longer be
+;; under the mouse. This can be disorienting. In contrast, this mode
+;; will not do any scrolling until you actually move up or down a line.
+;;
+;; Also, the built-in margin code does not interact well with small
+;; windows. If the margin is more than half the window height, you get
+;; some weird behavior, because the point is always hitting both the top
+;; and bottom margins. This package auto-adjusts the margin in each
+;; buffer to never exceed half the window height, so the top and bottom
+;; margins never overlap.
+
+;; See the README.md for more details.
+
+;;; Change Log:
+;; 27 Feb 2016 -- v2.0.0
+;; * Converted to global minor mode "smooth-scrolling-mode". This
+;; means that simply loading the file no longer enables smooth
+;; scrolling; you must also enable the mode.
+;; * Internal code restructuring that should improve some edge
+;; cases, but otherwise have no user-visible effects.
+;; 19 Dec 2013 -- v1.0.4
+;; * Disabled scrolling while a keyboard macro is executing in
+;; order to prevent a premature termination of the macro by
+;; the mode throwing an error such as "End of Buffer"
+;; 02 Jun 2013 -- v1.0.3
+;; * Fixed Issue #3 where bounds checking was not being performed
+;; prior to calls to 'count-lines' and 'count-screen-lines'
+;; functions.
+;; 14 Apr 2013 -- v1.0.2
+;; * Adam Spiers GitHub account now houses the canonical
+;; repository.
+;; 06 Dec 2011 -- v1.0.1
+;; * Altered structure to conform to package.el standards.
+;; * Restructured code to group settings changes
+;; * Set "redisplay-dont-pause" to true.
+;; ?? ??? 2007 -- v1.0.0
+;; * Original version from Adam Spiers
+
+;;; Code:
+
+;;;_ + internal variables
+(defvar smooth-scroll-orig-scroll-margin nil)
+
+;;;_ + defcustoms
+
+(defgroup smooth-scrolling nil
+ "Make emacs scroll smoothly"
+ :group 'convenience)
+
+;;;###autoload
+(define-minor-mode smooth-scrolling-mode
+ "Make emacs scroll smoothly"
+ :init-value nil
+ :global t
+ :group 'smooth-scrolling
+ (if smooth-scrolling-mode
+ (setq smooth-scroll-orig-scroll-margin scroll-margin
+ scroll-margin 0)
+ (setq scroll-margin smooth-scroll-orig-scroll-margin
+ smooth-scroll-orig-scroll-margin nil)))
+
+;;;###autoload
+(defcustom smooth-scroll-margin 10
+ "Number of lines of visible margin at the top and bottom of a window.
+If the point is within these margins, then scrolling will occur
+smoothly for `previous-line' at the top of the window, and for
+`next-line' at the bottom.
+
+This is very similar in its goal to `scroll-margin'. However, it
+is implemented by activating `smooth-scroll-down' and
+`smooth-scroll-up' advise via `defadvice' for `previous-line' and
+`next-line' respectively. As a result it avoids problems
+afflicting `scroll-margin', such as a sudden jump and unexpected
+highlighting of a region when the mouse is clicked in the margin.
+
+Scrolling only occurs when the point is closer to the window
+boundary it is heading for (top or bottom) than the middle of the
+window. This is to intelligently handle the case where the
+margins cover the whole buffer (e.g. `smooth-scroll-margin' set
+to 5 and `window-height' returning 10 or less).
+
+See also `smooth-scroll-strict-margins'."
+ :type 'integer
+ :group 'smooth-scrolling)
+
+;;;###autoload
+(defcustom smooth-scroll-strict-margins t
+ "If true, the advice code supporting `smooth-scroll-margin'
+will use `count-screen-lines' to determine the number of
+*visible* lines between the point and the window top/bottom,
+rather than `count-lines' which obtains the number of actual
+newlines. This is because there might be extra newlines hidden
+by a mode such as folding-mode, outline-mode, org-mode etc., or
+fewer due to very long lines being displayed wrapped when
+`truncate-lines' is nil.
+
+However, using `count-screen-lines' can supposedly cause
+performance issues in buffers with extremely long lines. Setting
+`cache-long-line-scans' may be able to address this;
+alternatively you can set this variable to nil so that the advice
+code uses `count-lines', and put up with the fact that sometimes
+the point will be allowed to stray into the margin."
+ :type 'boolean
+ :group 'smooth-scrolling)
+
+;;;_ + helper functions
+(defmacro smooth-scroll-ignore-scroll-errors (&rest body)
+ "Like `progn', but ignores beginning/end of line errors.
+
+If BODY encounters such an error, further evaluation is stopped
+and this form returns nil. Any other error is raised as normal."
+ (declare (indent 0))
+ `(condition-case err
+ (progn ,@body)
+ (end-of-buffer nil)
+ (beginning-of-buffer nil)
+ (error (signal (car err) (cdr err)))))
+
+(defun smooth-scroll-line-beginning-position ()
+ "Return position at beginning of (logical/visual) line.
+
+If `smooth-scroll-strict-margins' is non-nil, this looks to the
+beginning of the visual line. Otherwise it uses the beginning of
+the logical line."
+ (save-excursion
+ ;; Cannot use `line-beginning-position' here because there is no
+ ;; visual-line equivalent.
+ (funcall (if smooth-scroll-strict-margins
+ #'beginning-of-visual-line
+ #'beginning-of-line))
+ (point)))
+
+(defun smooth-scroll-count-lines (start end)
+ "Return number of (logical/visual) lines between START and END.
+
+If `smooth-scroll-strict-margins' is non-nil, this counts visual
+lines. Otherwise it counts logical lines.
+
+If END is less than START, this returns zero, so it is important
+to pass them in order."
+ (if (< end start)
+ 0
+ (funcall (if smooth-scroll-strict-margins
+ #'count-screen-lines
+ #'count-lines)
+ start end)))
+
+(defun smooth-scroll-lines-above-point ()
+ "Return the number of lines in window above point.
+
+This does not include the line that point is on."
+ (smooth-scroll-count-lines (window-start)
+ (smooth-scroll-line-beginning-position)))
+
+(defun smooth-scroll-lines-below-point ()
+ "Return the number of lines in window above point.
+
+This does not include the line that point is on."
+ ;; We don't rely on `window-end' because if we are scrolled near the
+ ;; end of the buffer, it will only give the number of lines
+ ;; remaining in the file, not the number of lines to the bottom of
+ ;; the window.
+ (- (window-height) 2 (smooth-scroll-lines-above-point)))
+
+(defun smooth-scroll-window-allowed-margin ()
+ "Return the maximum allowed margin above or below point.
+
+This only matters for windows whose height is
+`smooth-scroll-margin' * 2 lines or less."
+ ;; We subtract 1 for the modeline, which is counted in
+ ;; `window-height', and one more for the line that point is on. Then
+ ;; we divide by 2, rouding down.
+ (/ (- (window-height) 2) 2))
+
+(defsubst window-is-at-bob-p ()
+ "Returns non-nil if `(window-start)' is 1 (or less)."
+ (<= (window-start) 1))
+
+;;;_ + main function
+(defun do-smooth-scroll ()
+ "Ensure that point is not to close to window edges.
+
+This function scrolls the window until there are at least
+`smooth-scroll-margin' lines between the point and both the top
+and bottom of the window. If this is not possible because the
+window is too small, th window is scrolled such that the point is
+roughly centered within the window."
+ (interactive)
+ (when smooth-scrolling-mode
+ (let* ((desired-margin
+ ;; For short windows, we reduce `smooth-scroll-margin' to
+ ;; half the window height minus 1.
+ (min (smooth-scroll-window-allowed-margin)
+ smooth-scroll-margin))
+ (upper-margin (smooth-scroll-lines-above-point))
+ (lower-margin (smooth-scroll-lines-below-point)))
+ (smooth-scroll-ignore-scroll-errors
+ (cond
+ ((< upper-margin desired-margin)
+ (save-excursion
+ (dotimes (i (- desired-margin upper-margin))
+ (scroll-down 1))))
+ ((< lower-margin desired-margin)
+ (save-excursion
+ (dotimes (i (- desired-margin lower-margin))
+ (scroll-up 1)))))))))
+
+;;;_ + advice setup
+
+;;;###autoload
+(defmacro enable-smooth-scroll-for-function (func)
+ "Define advice on FUNC to do smooth scrolling.
+
+This adds after advice with name `smooth-scroll' to FUNC.
+
+Note that the advice will not have an effect unless
+`smooth-scrolling-mode' is enabled."
+ `(defadvice ,func (after smooth-scroll activate)
+ "Do smooth scrolling after command finishes.
+
+This advice only has an effect when `smooth-scrolling-mode' is
+enabled. See `smooth-scrolling-mode' for details. To remove this
+advice, use `disable-smooth-scroll-for-function'."
+ (do-smooth-scroll)))
+
+(defmacro enable-smooth-scroll-for-function-conditionally (func cond)
+ "Define advice on FUNC to do smooth scrolling conditionally.
+
+This adds after advice with name `smooth-scroll' to FUNC. The
+advice runs smooth scrolling if expression COND evaluates to
+true. COND is included within the advice and therefore has access
+to all of FUNC's arguments.
+
+Note that the advice will not have an effect unless
+`smooth-scrolling-mode' is enabled."
+ (declare (indent 1))
+ `(defadvice ,func (after smooth-scroll activate)
+ ,(format "Do smooth scrolling conditionally after command finishes.
+
+Smooth sccrolling will only be performed if the following
+expression evaluates to true after the function has run:
+
+%s
+This advice only has an effect when `smooth-scrolling-mode' is
+enabled. See `smooth-scrolling-mode' for details. To remove this
+advice, use `disable-smooth-scroll-for-function'."
+ (pp-to-string cond))
+ (when ,cond
+ (do-smooth-scroll))))
+
+(defmacro disable-smooth-scroll-for-function (func)
+ "Delete smooth-scroll advice for FUNC."
+ ;; This doesn't actually need to be a macro, but it is one for
+ ;; consistency with the enabling macro. Errors are ignored in case
+ ;; the advice has already been removed.
+ `(ignore-errors
+ (ad-remove-advice ',func 'after 'smooth-scroll)
+ (ad-activate ',func)))
+
+(progn
+ (enable-smooth-scroll-for-function previous-line)
+ (enable-smooth-scroll-for-function next-line)
+ (enable-smooth-scroll-for-function dired-previous-line)
+ (enable-smooth-scroll-for-function dired-next-line)
+ (enable-smooth-scroll-for-function isearch-repeat)
+ (enable-smooth-scroll-for-function-conditionally scroll-up-command
+ (not (window-is-at-bob-p)))
+ (enable-smooth-scroll-for-function-conditionally scroll-down-command
+ (not (window-is-at-bob-p))))
+
+;;;_ + provide
+(provide 'smooth-scrolling)
+;;; smooth-scrolling.el ends here
diff --git a/lisp/text.el b/lisp/text.el
new file mode 100644
index 0000000..498a373
--- /dev/null
+++ b/lisp/text.el
@@ -0,0 +1,7 @@
+;; Text file section
+(defun setup-text-mode ()
+ (setq word-wrap t)
+ (global-hl-line-mode 0)
+ )
+
+(provide 'text)
diff --git a/projectile-bookmarks.eld b/projectile-bookmarks.eld
new file mode 100644
index 0000000..002c09b
--- /dev/null
+++ b/projectile-bookmarks.eld
@@ -0,0 +1 @@
+("~/.emacs.d/" "~/Projects/personal_website/" "~/Monero/xmrig/" "~/Projects/LemonWedge/") \ No newline at end of file
diff --git a/projects b/projects
new file mode 100644
index 0000000..b5676fc
--- /dev/null
+++ b/projects
@@ -0,0 +1,2 @@
+;;; -*- lisp-data -*-
+(("~/Projects/personal_website/"))
diff --git a/themes/vs-light-theme.el b/themes/vs-light-theme.el
new file mode 100644
index 0000000..203d5dc
--- /dev/null
+++ b/themes/vs-light-theme.el
@@ -0,0 +1,81 @@
+;;; vs-light-theme.el --- Visual Studio IDE light theme
+
+;; Copyright (C) 2019-2021 , Jen-Chieh Shen
+
+;; Author: Jen-Chieh Shen
+;; URL: https://github.com/emacs-vs/vs-light-theme
+;; Version: 0.2
+;; Package-Requires: ((emacs "24.1"))
+;; Created with emacs-theme-generator, https://github.com/mswift42/theme-creator.
+
+;; This file is NOT part of GNU Emacs.
+
+;; This program 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.
+
+;; This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Visual Studio IDE light theme.
+;;
+
+;;; Code:
+
+(deftheme vs-light
+ "Visual Studio IDE light theme.")
+
+(let ((class '((class color) (min-colors 89)))
+ (fg1 "#000000")
+ (bg1 "#ffffff")
+ (builtin "#B0C4DE")
+ (keyword "#0000FF")
+ (const "#2B91AF")
+ (comment "#6B8E23")
+ (func "#74534B")
+ (str "#B21515")
+ (type "#2B91AF")
+ (var "#000000")
+ (prep "#8D9B99")
+ (ln-color-fg "#2B91AF")
+ (ln-color-bg "#EEEEEE"))
+ (custom-theme-set-faces
+ 'vs-light
+ `(default ((,class (:background ,bg1 :foreground ,fg1))))
+ `(font-lock-builtin-face ((,class (:foreground ,builtin))))
+ `(font-lock-comment-face ((,class (:foreground ,comment))))
+ `(font-lock-negation-char-face ((,class (:foreground ,const))))
+ `(font-lock-reference-face ((,class (:foreground ,const))))
+ `(font-lock-constant-face ((,class (:foreground ,const))))
+ `(font-lock-doc-face ((,class (:foreground ,comment))))
+ `(font-lock-function-name-face ((,class (:foreground ,func))))
+ `(font-lock-keyword-face ((,class (:foreground ,keyword))))
+ `(font-lock-string-face ((,class (:foreground ,str))))
+ `(font-lock-type-face ((,class (:foreground ,type ))))
+ `(font-lock-variable-name-face ((,class (:foreground ,var))))
+ `(font-lock-preprocessor-face ((,class (:foreground ,prep))))
+ `(line-number ((,class (:background ,ln-color-bg , :foreground ,ln-color-fg))))))
+
+;;;###autoload
+(when load-file-name
+ (add-to-list 'custom-theme-load-path
+ (file-name-as-directory (file-name-directory load-file-name))))
+
+;;;###autoload
+(defun vs-light-theme ()
+ "Load Visual Studio light theme."
+ (interactive)
+ (load-theme 'vs-light t))
+
+(provide-theme 'vs-light)
+
+(provide 'vs-light-theme)
+;;; vs-light-theme.el ends here